Built motion from commit 638d4e4c.|2.6.0
authorAndrea Amorese <andrea.amorese@xenialab.it>
Fri, 14 Jan 2022 15:06:11 +0000 (16:06 +0100)
committerAndrea Amorese <andrea.amorese@xenialab.it>
Fri, 14 Jan 2022 15:06:11 +0000 (16:06 +0100)
1170 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/authActiveDirectory/authActiveDirectory.controller.js
server/api/authActiveDirectory/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.events.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/client-side-logs.js
server/api/cloudProvider/cloudProvider.attributes.js
server/api/cloudProvider/cloudProvider.controller.js
server/api/cloudProvider/cloudProvider.model.js
server/api/cloudProvider/cloudProvider.oauth.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.events.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-setting/index.js
server/api/user-setting/user-setting.attributes.js
server/api/user-setting/user-setting.controller.js
server/api/user-setting/user-setting.events.js
server/api/user-setting/user-setting.model.js
server/api/user-setting/user-setting.socket.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/cloud-provider.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/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/project.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/tvox.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
server/utils/client-side-logger.js
server/utils/loggers.js
server/utils/mask-sensitive-data.js
server/utils/safe-template.js

index 083999a..0e44ef2 100644 (file)
@@ -17,7 +17,7 @@ define({
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2022-01-14T13:01:31.124Z",
+    "time": "2022-01-14T14:39:34.964Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index ae530d6..7e0848d 100644 (file)
@@ -17,7 +17,7 @@
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2022-01-14T13:01:31.124Z",
+    "time": "2022-01-14T14:39:34.964Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index a97ca4f..ec577d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x222a=['VIRTUAL','getDataValue','action','contactManager','integration','motionbar','urlForward','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize'];(function(_0x26e976,_0x3b0944){var _0x43d47f=function(_0x215dbc){while(--_0x215dbc){_0x26e976['push'](_0x26e976['shift']());}};_0x43d47f(++_0x3b0944);}(_0x222a,0x1ec));var _0xa222=function(_0x2ea4b1,_0x51ffe3){_0x2ea4b1=_0x2ea4b1-0x0;var _0x1312d8=_0x222a[_0x2ea4b1];return _0x1312d8;};'use strict';var Sequelize=require(_0xa222('0x0'));module['exports']={'name':{'type':Sequelize[_0xa222('0x1')],'get':function(_0x12569a){return this[_0xa222('0x2')](_0xa222('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xa222('0x4'),_0xa222('0x5'),_0xa222('0x6'),'jscripty',_0xa222('0x7'),_0xa222('0x8'),_0xa222('0x9'),'script']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xa222('0xa')},'data1':{'type':Sequelize[_0xa222('0xb')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xa222('0xc')},'data3':{'type':Sequelize[_0xa222('0xb')](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[_0xa222('0xb')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0xa222('0xd')},'data6':{'type':Sequelize[_0xa222('0xb')],'comments':_0xa222('0xe')},'data7':{'type':Sequelize[_0xa222('0xf')],'comments':_0xa222('0x10')}};
\ No newline at end of file
+var _0xa308=['jscripty','browser','bot','script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','urlForward[body]','sequelize','VIRTUAL','getDataValue','action','STRING','integration','motionbar'];(function(_0x5739d0,_0x440ea0){var _0x2a737c=function(_0xded926){while(--_0xded926){_0x5739d0['push'](_0x5739d0['shift']());}};_0x2a737c(++_0x440ea0);}(_0xa308,0x191));var _0x8a30=function(_0x13524d,_0x505b49){_0x13524d=_0x13524d-0x0;var _0x9918b4=_0xa308[_0x13524d];return _0x9918b4;};'use strict';var Sequelize=require(_0x8a30('0x0'));module['exports']={'name':{'type':Sequelize[_0x8a30('0x1')],'get':function(_0x24a61f){return this[_0x8a30('0x2')](_0x8a30('0x3'));}},'action':{'type':Sequelize[_0x8a30('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x8a30('0x5'),_0x8a30('0x6'),_0x8a30('0x7'),'urlForward',_0x8a30('0x8'),_0x8a30('0x9'),_0x8a30('0xa')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x8a30('0x4')](0x1000),'comment':_0x8a30('0xb')},'data2':{'type':Sequelize[_0x8a30('0x4')](0x1000),'comment':_0x8a30('0xc')},'data3':{'type':Sequelize[_0x8a30('0x4')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x8a30('0xd')},'data5':{'type':Sequelize[_0x8a30('0x4')](0x1000),'comments':_0x8a30('0xe')},'data6':{'type':Sequelize[_0x8a30('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x8a30('0xf')],'comments':_0x8a30('0x10')}};
\ No newline at end of file
index c1090ed..2681cf7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0285=['to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','undefined','limit','count','offset','Content-Range','save','update','then','destroy','error','stack','name','send','body','Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x0285,0x17b));var _0x5028=function(_0x169892,_0x33c068){_0x169892=_0x169892-0x0;var _0x55091c=_0x0285[_0x169892];return _0x55091c;};'use strict';var emlformat=require(_0x5028('0x0'));var rimraf=require(_0x5028('0x1'));var zipdir=require(_0x5028('0x2'));var jsonpatch=require(_0x5028('0x3'));var rp=require('request-promise');var moment=require(_0x5028('0x4'));var BPromise=require(_0x5028('0x5'));var Mustache=require(_0x5028('0x6'));var util=require('util');var path=require(_0x5028('0x7'));var sox=require('sox');var csv=require(_0x5028('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5028('0x9'));var _=require(_0x5028('0xa'));var squel=require(_0x5028('0xb'));var crypto=require(_0x5028('0xc'));var jsforce=require(_0x5028('0xd'));var deskjs=require(_0x5028('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5028('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5028('0x10'));var as=require(_0x5028('0x11'));var hardwareService=require(_0x5028('0x12'));var logger=require('../../config/logger')(_0x5028('0x13'));var utils=require(_0x5028('0x14'));var config=require(_0x5028('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419df6,_0x10d4a8){_0x10d4a8=_0x10d4a8||0xcc;return function(_0xa42648){if(_0xa42648){return _0x419df6[_0x5028('0x16')](_0x10d4a8);}return _0x419df6[_0x5028('0x17')](_0x10d4a8)[_0x5028('0x18')]();};}function respondWithResult(_0x1fe203,_0x250fca){_0x250fca=_0x250fca||0xc8;return function(_0x3820e0){if(_0x3820e0){return _0x1fe203['status'](_0x250fca)['json'](_0x3820e0);}};}function respondWithFilteredResult(_0x415e41,_0x43cd5d){return function(_0x267cc2){if(_0x267cc2){var _0x1da818=typeof _0x43cd5d['offset']===_0x5028('0x19')&&typeof _0x43cd5d[_0x5028('0x1a')]===_0x5028('0x19');var _0x51f619=_0x267cc2[_0x5028('0x1b')];var _0xa02c1b=_0x1da818?0x0:_0x43cd5d['offset'];var _0x1a0d6b=_0x1da818?_0x267cc2[_0x5028('0x1b')]:_0x43cd5d[_0x5028('0x1c')]+_0x43cd5d['limit'];var _0x621e0f;if(_0x1a0d6b>=_0x51f619){_0x1a0d6b=_0x51f619;_0x621e0f=0xc8;}else{_0x621e0f=0xce;}_0x415e41[_0x5028('0x17')](_0x621e0f);return _0x415e41['set'](_0x5028('0x1d'),_0xa02c1b+'-'+_0x1a0d6b+'/'+_0x51f619)['json'](_0x267cc2);}return null;};}function patchUpdates(_0x142830){return function(_0x55f366){try{jsonpatch['apply'](_0x55f366,_0x142830,!![]);}catch(_0x48b6bd){return BPromise['reject'](_0x48b6bd);}return _0x55f366[_0x5028('0x1e')]();};}function saveUpdates(_0x32547e,_0x2ecc65){return function(_0x5b14a3){if(_0x5b14a3){return _0x5b14a3[_0x5028('0x1f')](_0x32547e)[_0x5028('0x20')](function(_0xc6db8c){return _0xc6db8c;});}return null;};}function removeEntity(_0xffabe2,_0x552409){return function(_0x44c2f6){if(_0x44c2f6){return _0x44c2f6[_0x5028('0x21')]()[_0x5028('0x20')](function(){_0xffabe2['status'](0xcc)[_0x5028('0x18')]();});}};}function handleEntityNotFound(_0x2c9c0a,_0x1c3766){return function(_0x57c9bf){if(!_0x57c9bf){_0x2c9c0a[_0x5028('0x16')](0x194);}return _0x57c9bf;};}function handleError(_0xd1c8a3,_0x54e04c){_0x54e04c=_0x54e04c||0x1f4;return function(_0xe6dee7){logger[_0x5028('0x22')](_0xe6dee7[_0x5028('0x23')]);if(_0xe6dee7[_0x5028('0x24')]){delete _0xe6dee7[_0x5028('0x24')];}_0xd1c8a3[_0x5028('0x17')](_0x54e04c)[_0x5028('0x25')](_0xe6dee7);};}exports[_0x5028('0x1f')]=function(_0x4d6c0d,_0x202913){if(_0x4d6c0d['body']['id']){delete _0x4d6c0d[_0x5028('0x26')]['id'];}return db[_0x5028('0x27')][_0x5028('0x28')]({'where':{'id':_0x4d6c0d[_0x5028('0x29')]['id']}})[_0x5028('0x20')](handleEntityNotFound(_0x202913,null))[_0x5028('0x20')](saveUpdates(_0x4d6c0d[_0x5028('0x26')],null))[_0x5028('0x20')](respondWithResult(_0x202913,null))[_0x5028('0x2a')](handleError(_0x202913,null));};exports[_0x5028('0x21')]=function(_0xdf6247,_0x2a1a61){return db[_0x5028('0x27')][_0x5028('0x28')]({'where':{'id':_0xdf6247[_0x5028('0x29')]['id']}})[_0x5028('0x20')](handleEntityNotFound(_0x2a1a61,null))['then'](removeEntity(_0x2a1a61,null))['catch'](handleError(_0x2a1a61,null));};
\ No newline at end of file
+var _0xb588=['mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','count','limit','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','body','Action','find','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb588,0x173));var _0x8b58=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xb588[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8b58('0x0'));var zipdir=require(_0x8b58('0x1'));var jsonpatch=require(_0x8b58('0x2'));var rp=require(_0x8b58('0x3'));var moment=require(_0x8b58('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8b58('0x5'));var util=require(_0x8b58('0x6'));var path=require(_0x8b58('0x7'));var sox=require(_0x8b58('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b58('0x9'));var _=require('lodash');var squel=require(_0x8b58('0xa'));var crypto=require(_0x8b58('0xb'));var jsforce=require(_0x8b58('0xc'));var deskjs=require(_0x8b58('0xd'));var toCsv=require(_0x8b58('0xe'));var querystring=require('querystring');var Papa=require(_0x8b58('0xf'));var Redis=require(_0x8b58('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8b58('0x11'));var as=require(_0x8b58('0x12'));var hardwareService=require(_0x8b58('0x13'));var logger=require(_0x8b58('0x14'))(_0x8b58('0x15'));var utils=require(_0x8b58('0x16'));var config=require(_0x8b58('0x17'));var licenseUtil=require(_0x8b58('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x513913,_0x3779c2){_0x3779c2=_0x3779c2||0xcc;return function(_0x416297){if(_0x416297){return _0x513913['sendStatus'](_0x3779c2);}return _0x513913[_0x8b58('0x19')](_0x3779c2)[_0x8b58('0x1a')]();};}function respondWithResult(_0x397906,_0x546ade){_0x546ade=_0x546ade||0xc8;return function(_0x412757){if(_0x412757){return _0x397906['status'](_0x546ade)[_0x8b58('0x1b')](_0x412757);}};}function respondWithFilteredResult(_0xff871d,_0x7f9a61){return function(_0x15a102){if(_0x15a102){var _0x4d8b97=typeof _0x7f9a61[_0x8b58('0x1c')]==='undefined'&&typeof _0x7f9a61['limit']==='undefined';var _0x505f7a=_0x15a102[_0x8b58('0x1d')];var _0x32153f=_0x4d8b97?0x0:_0x7f9a61[_0x8b58('0x1c')];var _0x4ba1bd=_0x4d8b97?_0x15a102['count']:_0x7f9a61[_0x8b58('0x1c')]+_0x7f9a61[_0x8b58('0x1e')];var _0x5b4f20;if(_0x4ba1bd>=_0x505f7a){_0x4ba1bd=_0x505f7a;_0x5b4f20=0xc8;}else{_0x5b4f20=0xce;}_0xff871d['status'](_0x5b4f20);return _0xff871d[_0x8b58('0x1f')]('Content-Range',_0x32153f+'-'+_0x4ba1bd+'/'+_0x505f7a)['json'](_0x15a102);}return null;};}function patchUpdates(_0x2a6e5c){return function(_0x2edaea){try{jsonpatch[_0x8b58('0x20')](_0x2edaea,_0x2a6e5c,!![]);}catch(_0xa190b0){return BPromise[_0x8b58('0x21')](_0xa190b0);}return _0x2edaea[_0x8b58('0x22')]();};}function saveUpdates(_0x493307,_0x3a5897){return function(_0x126e7c){if(_0x126e7c){return _0x126e7c[_0x8b58('0x23')](_0x493307)[_0x8b58('0x24')](function(_0x2f8a3b){return _0x2f8a3b;});}return null;};}function removeEntity(_0x1bc6f4,_0x555a6b){return function(_0x3519a7){if(_0x3519a7){return _0x3519a7[_0x8b58('0x25')]()['then'](function(){_0x1bc6f4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x31372e,_0x15806f){return function(_0x3c5983){if(!_0x3c5983){_0x31372e[_0x8b58('0x26')](0x194);}return _0x3c5983;};}function handleError(_0xb3035b,_0x12f014){_0x12f014=_0x12f014||0x1f4;return function(_0x288e7c){logger[_0x8b58('0x27')](_0x288e7c[_0x8b58('0x28')]);if(_0x288e7c[_0x8b58('0x29')]){delete _0x288e7c[_0x8b58('0x29')];}_0xb3035b[_0x8b58('0x19')](_0x12f014)[_0x8b58('0x2a')](_0x288e7c);};}exports[_0x8b58('0x23')]=function(_0x4c38bb,_0x4fd3c2){if(_0x4c38bb[_0x8b58('0x2b')]['id']){delete _0x4c38bb[_0x8b58('0x2b')]['id'];}return db[_0x8b58('0x2c')][_0x8b58('0x2d')]({'where':{'id':_0x4c38bb['params']['id']}})[_0x8b58('0x24')](handleEntityNotFound(_0x4fd3c2,null))[_0x8b58('0x24')](saveUpdates(_0x4c38bb[_0x8b58('0x2b')],null))[_0x8b58('0x24')](respondWithResult(_0x4fd3c2,null))[_0x8b58('0x2e')](handleError(_0x4fd3c2,null));};exports[_0x8b58('0x25')]=function(_0x1d7e35,_0xea63eb){return db[_0x8b58('0x2c')][_0x8b58('0x2d')]({'where':{'id':_0x1d7e35['params']['id']}})['then'](handleEntityNotFound(_0xea63eb,null))[_0x8b58('0x24')](removeEntity(_0xea63eb,null))[_0x8b58('0x2e')](handleError(_0xea63eb,null));};
\ No newline at end of file
index ddc3336..e359489 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb81f=['./action.attributes','lodash','util','request-promise','path','rimraf','../../config/environment'];(function(_0x4360f3,_0x952ac4){var _0x584917=function(_0x2414ef){while(--_0x2414ef){_0x4360f3['push'](_0x4360f3['shift']());}};_0x584917(++_0x952ac4);}(_0xb81f,0xcc));var _0xfb81=function(_0xa8405c,_0x2e1253){_0xa8405c=_0xa8405c-0x0;var _0x495edd=_0xb81f[_0xa8405c];return _0x495edd;};'use strict';var _=require(_0xfb81('0x0'));var util=require(_0xfb81('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfb81('0x2'));var fs=require('fs');var path=require(_0xfb81('0x3'));var rimraf=require(_0xfb81('0x4'));var config=require(_0xfb81('0x5'));var attributes=require(_0xfb81('0x6'));module['exports']=function(_0x4e7473,_0x3d10a7){return _0x4e7473['define']('Action',attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xca73=['exports','define','Action','tools_actions','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes'];(function(_0xe79785,_0x52c7a){var _0x3abc7c=function(_0x53fd8d){while(--_0x53fd8d){_0xe79785['push'](_0xe79785['shift']());}};_0x3abc7c(++_0x52c7a);}(_0xca73,0x1ee));var _0x3ca7=function(_0x48a4bc,_0x19e9aa){_0x48a4bc=_0x48a4bc-0x0;var _0x1a27bd=_0xca73[_0x48a4bc];return _0x1a27bd;};'use strict';var _=require(_0x3ca7('0x0'));var util=require(_0x3ca7('0x1'));var logger=require('../../config/logger')(_0x3ca7('0x2'));var moment=require(_0x3ca7('0x3'));var BPromise=require(_0x3ca7('0x4'));var rp=require(_0x3ca7('0x5'));var fs=require('fs');var path=require(_0x3ca7('0x6'));var rimraf=require(_0x3ca7('0x7'));var config=require(_0x3ca7('0x8'));var attributes=require(_0x3ca7('0x9'));module[_0x3ca7('0xa')]=function(_0x3d0ce3,_0x5dce65){return _0x3d0ce3[_0x3ca7('0xb')](_0x3ca7('0xc'),attributes,{'tableName':_0x3ca7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 783aa31..35cbab5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x1cb9,0x14e));var _0x91cb=function(_0x4cf7ec,_0x18a053){_0x4cf7ec=_0x4cf7ec-0x0;var _0x4ef4e2=_0x1cb9[_0x4cf7ec];return _0x4ef4e2;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Action,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});}
\ No newline at end of file
+var _0x7fbe=['request','then','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3193c0,_0x1eefea){var _0x2c912c=function(_0x1502d2){while(--_0x1502d2){_0x3193c0['push'](_0x3193c0['shift']());}};_0x2c912c(++_0x1eefea);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x4b2407,_0x3fa63e){_0x4b2407=_0x4b2407-0x0;var _0x5defa2=_0x7fbe[_0x4b2407];return _0x5defa2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});}
\ No newline at end of file
index 1e577ea..21642bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3dbb=['update','delete','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated'];(function(_0x32e43d,_0x278541){var _0x470c6b=function(_0x235d29){while(--_0x235d29){_0x32e43d['push'](_0x32e43d['shift']());}};_0x470c6b(++_0x278541);}(_0x3dbb,0x152));var _0xb3db=function(_0x2f1d10,_0x49296b){_0x2f1d10=_0x2f1d10-0x0;var _0x23e49b=_0x3dbb[_0x2f1d10];return _0x23e49b;};'use strict';var multer=require(_0xb3db('0x0'));var util=require(_0xb3db('0x1'));var path=require(_0xb3db('0x2'));var timeout=require('connect-timeout');var express=require(_0xb3db('0x3'));var router=express[_0xb3db('0x4')]();var fs_extra=require(_0xb3db('0x5'));var auth=require(_0xb3db('0x6'));var interaction=require(_0xb3db('0x7'));var config=require(_0xb3db('0x8'));var controller=require(_0xb3db('0x9'));router[_0xb3db('0xa')]('/:id',auth[_0xb3db('0xb')](),controller[_0xb3db('0xc')]);router[_0xb3db('0xd')]('/:id',auth[_0xb3db('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xc9fd=['multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','put','/:id','isAuthenticated','update','delete','destroy','exports'];(function(_0x202492,_0x4a2989){var _0x3ac767=function(_0x4f4ec9){while(--_0x4f4ec9){_0x202492['push'](_0x202492['shift']());}};_0x3ac767(++_0x4a2989);}(_0xc9fd,0x1ee));var _0xdc9f=function(_0x3ee52e,_0x39f811){_0x3ee52e=_0x3ee52e-0x0;var _0x3285a8=_0xc9fd[_0x3ee52e];return _0x3285a8;};'use strict';var multer=require(_0xdc9f('0x0'));var util=require(_0xdc9f('0x1'));var path=require(_0xdc9f('0x2'));var timeout=require(_0xdc9f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xdc9f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xdc9f('0x5'));var controller=require('./action.controller');router[_0xdc9f('0x6')](_0xdc9f('0x7'),auth[_0xdc9f('0x8')](),controller[_0xdc9f('0x9')]);router[_0xdc9f('0xa')](_0xdc9f('0x7'),auth[_0xdc9f('0x8')](),controller[_0xdc9f('0xb')]);module[_0xdc9f('0xc')]=router;
\ No newline at end of file
index c3a91f8..db7e26a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee14=['STRING','TEXT'];(function(_0x4f73ad,_0x3c277c){var _0x616689=function(_0x341e27){while(--_0x341e27){_0x4f73ad['push'](_0x4f73ad['shift']());}};_0x616689(++_0x3c277c);}(_0xee14,0x13a));var _0x4ee1=function(_0x1be0b1,_0x12d22b){_0x1be0b1=_0x1be0b1-0x0;var _0x3cf1ea=_0xee14[_0x1be0b1];return _0x3cf1ea;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4ee1('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x4ee1('0x0')]},'parent':{'type':Sequelize[_0x4ee1('0x0')]},'table':{'type':Sequelize[_0x4ee1('0x0')]},'conditions':{'type':Sequelize[_0x4ee1('0x1')]},'joins':{'type':Sequelize[_0x4ee1('0x1')]}};
\ No newline at end of file
+var _0x6f47=['TEXT','exports','STRING'];(function(_0x208538,_0x396f6c){var _0x884e8d=function(_0x58fe98){while(--_0x58fe98){_0x208538['push'](_0x208538['shift']());}};_0x884e8d(++_0x396f6c);}(_0x6f47,0xc7));var _0x76f4=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0x6f47[_0x5c9307];return _0x373e29;};'use strict';var Sequelize=require('sequelize');module[_0x76f4('0x0')]={'name':{'type':Sequelize[_0x76f4('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x76f4('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x76f4('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 85a2c32..46f05b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4be8=['set','Content-Range','reject','save','update','then','destroy','UserProfileResource','sendStatus','error','stack','name','index','map','rawAttributes','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','AnalyticCustomReport','includeAll','include','rows','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','userProfileId','autoAssociation','CustomReports','catch','join','left_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','MetricId','metric','function','replace','format','groupBy','orderBy','alias','parse','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','table','conditions','clone','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','right_join','cross_join','SEC_TO_TIME(%s)','ROUND(%s)','IS\x20EMPTY','condition','Sequelize','select','from','DESC','output','web','fullPath','randomstring','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','savename','countTable','COUNT(*)','run','keyBy','debug','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','dbH','status','end','json','offset','undefined','limit','count'];(function(_0x18b5fb,_0x36862b){var _0x56f0e2=function(_0x1a1320){while(--_0x1a1320){_0x18b5fb['push'](_0x18b5fb['shift']());}};_0x56f0e2(++_0x36862b);}(_0x4be8,0x12a));var _0x84be=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0x4be8[_0x166742];return _0xb7814a;};'use strict';var emlformat=require(_0x84be('0x0'));var rimraf=require(_0x84be('0x1'));var zipdir=require(_0x84be('0x2'));var jsonpatch=require(_0x84be('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x84be('0x4'));var Mustache=require(_0x84be('0x5'));var util=require(_0x84be('0x6'));var path=require(_0x84be('0x7'));var sox=require(_0x84be('0x8'));var csv=require(_0x84be('0x9'));var ejs=require(_0x84be('0xa'));var fs=require('fs');var fs_extra=require(_0x84be('0xb'));var _=require(_0x84be('0xc'));var squel=require(_0x84be('0xd'));var crypto=require(_0x84be('0xe'));var jsforce=require(_0x84be('0xf'));var deskjs=require(_0x84be('0x10'));var toCsv=require(_0x84be('0x9'));var querystring=require(_0x84be('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x84be('0x12'));var qs=require(_0x84be('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x84be('0x14'));var logger=require(_0x84be('0x15'))(_0x84be('0x16'));var utils=require(_0x84be('0x17'));var config=require(_0x84be('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x84be('0x19'))['db'];var dbH=require(_0x84be('0x19'))[_0x84be('0x1a')];function respondWithStatusCode(_0x35b1c2,_0x533f9f){_0x533f9f=_0x533f9f||0xcc;return function(_0x9e97d1){if(_0x9e97d1){return _0x35b1c2['sendStatus'](_0x533f9f);}return _0x35b1c2[_0x84be('0x1b')](_0x533f9f)[_0x84be('0x1c')]();};}function respondWithResult(_0x4e0526,_0x2900e3){_0x2900e3=_0x2900e3||0xc8;return function(_0x511ff7){if(_0x511ff7){return _0x4e0526[_0x84be('0x1b')](_0x2900e3)[_0x84be('0x1d')](_0x511ff7);}};}function respondWithFilteredResult(_0x1d28f9,_0x1bf27d){return function(_0x13336c){if(_0x13336c){var _0x42faf0=typeof _0x1bf27d[_0x84be('0x1e')]===_0x84be('0x1f')&&typeof _0x1bf27d[_0x84be('0x20')]===_0x84be('0x1f');var _0x5d4704=_0x13336c[_0x84be('0x21')];var _0x355ff3=_0x42faf0?0x0:_0x1bf27d[_0x84be('0x1e')];var _0x5b0599=_0x42faf0?_0x13336c['count']:_0x1bf27d[_0x84be('0x1e')]+_0x1bf27d[_0x84be('0x20')];var _0x377c20;if(_0x5b0599>=_0x5d4704){_0x5b0599=_0x5d4704;_0x377c20=0xc8;}else{_0x377c20=0xce;}_0x1d28f9['status'](_0x377c20);return _0x1d28f9[_0x84be('0x22')](_0x84be('0x23'),_0x355ff3+'-'+_0x5b0599+'/'+_0x5d4704)[_0x84be('0x1d')](_0x13336c);}return null;};}function patchUpdates(_0x449658){return function(_0x326a75){try{jsonpatch['apply'](_0x326a75,_0x449658,!![]);}catch(_0x3a77e7){return BPromise[_0x84be('0x24')](_0x3a77e7);}return _0x326a75[_0x84be('0x25')]();};}function saveUpdates(_0x72aa8,_0x5b0059){return function(_0x369d2d){if(_0x369d2d){return _0x369d2d[_0x84be('0x26')](_0x72aa8)[_0x84be('0x27')](function(_0x3756c2){return _0x3756c2;});}return null;};}function removeEntity(_0x1f412a,_0x5669ab){return function(_0x5461fc){if(_0x5461fc){return _0x5461fc[_0x84be('0x28')]()[_0x84be('0x27')](function(){var _0x5b6443=_0x5461fc['get']({'plain':!![]});var _0x315f73='CustomReports';return db[_0x84be('0x29')]['destroy']({'where':{'type':_0x315f73,'resourceId':_0x5b6443['id']}})['then'](function(){return _0x5461fc;});})[_0x84be('0x27')](function(){_0x1f412a[_0x84be('0x1b')](0xcc)[_0x84be('0x1c')]();});}};}function handleEntityNotFound(_0x5f4cce,_0x13cee5){return function(_0x5ad5ee){if(!_0x5ad5ee){_0x5f4cce[_0x84be('0x2a')](0x194);}return _0x5ad5ee;};}function handleError(_0x5cd466,_0xb7e857){_0xb7e857=_0xb7e857||0x1f4;return function(_0x44ffa7){logger[_0x84be('0x2b')](_0x44ffa7[_0x84be('0x2c')]);if(_0x44ffa7[_0x84be('0x2d')]){delete _0x44ffa7[_0x84be('0x2d')];}_0x5cd466[_0x84be('0x1b')](_0xb7e857)['send'](_0x44ffa7);};}exports[_0x84be('0x2e')]=function(_0x1bac28,_0x29e5f3){var _0x2b7ef6={},_0x18685b={},_0x43a155={'count':0x0,'rows':[]};var _0x3b78bd=_[_0x84be('0x2f')](db['AnalyticCustomReport'][_0x84be('0x30')],function(_0x203657){return{'name':_0x203657['fieldName'],'type':_0x203657[_0x84be('0x31')]['key']};});_0x18685b[_0x84be('0x32')]=_[_0x84be('0x2f')](_0x3b78bd,_0x84be('0x2d'));_0x18685b[_0x84be('0x33')]=_['keys'](_0x1bac28[_0x84be('0x33')]);_0x18685b['filters']=_[_0x84be('0x34')](_0x18685b[_0x84be('0x32')],_0x18685b[_0x84be('0x33')]);_0x2b7ef6[_0x84be('0x35')]=_[_0x84be('0x34')](_0x18685b[_0x84be('0x32')],qs[_0x84be('0x36')](_0x1bac28['query'][_0x84be('0x36')]));_0x2b7ef6[_0x84be('0x35')]=_0x2b7ef6[_0x84be('0x35')][_0x84be('0x37')]?_0x2b7ef6[_0x84be('0x35')]:_0x18685b[_0x84be('0x32')];if(!_0x1bac28[_0x84be('0x33')][_0x84be('0x38')](_0x84be('0x39'))){_0x2b7ef6[_0x84be('0x20')]=qs[_0x84be('0x20')](_0x1bac28['query']['limit']);_0x2b7ef6[_0x84be('0x1e')]=qs[_0x84be('0x1e')](_0x1bac28['query'][_0x84be('0x1e')]);}_0x2b7ef6[_0x84be('0x3a')]=qs[_0x84be('0x3b')](_0x1bac28['query'][_0x84be('0x3b')]);_0x2b7ef6[_0x84be('0x3c')]=qs[_0x84be('0x3d')](_[_0x84be('0x3e')](_0x1bac28['query'],_0x18685b[_0x84be('0x3d')]),_0x3b78bd);if(_0x1bac28['query'][_0x84be('0x3f')]){_0x2b7ef6[_0x84be('0x3c')]=_[_0x84be('0x40')](_0x2b7ef6['where'],{'$or':_[_0x84be('0x2f')](_0x3b78bd,function(_0x506b29){if(_0x506b29['type']!=='VIRTUAL'){var _0xa5d6f7={};_0xa5d6f7[_0x506b29[_0x84be('0x2d')]]={'$like':'%'+_0x1bac28[_0x84be('0x33')]['filter']+'%'};return _0xa5d6f7;}})});}_0x2b7ef6=_[_0x84be('0x40')]({},_0x2b7ef6,_0x1bac28[_0x84be('0x41')]);var _0x536d02={'where':_0x2b7ef6[_0x84be('0x3c')]};return db[_0x84be('0x42')]['count'](_0x536d02)[_0x84be('0x27')](function(_0x1f8754){_0x43a155[_0x84be('0x21')]=_0x1f8754;if(_0x1bac28[_0x84be('0x33')][_0x84be('0x43')]){_0x2b7ef6[_0x84be('0x44')]=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x2b7ef6);})['then'](function(_0x5ac1b9){_0x43a155[_0x84be('0x45')]=_0x5ac1b9;return _0x43a155;})[_0x84be('0x27')](respondWithFilteredResult(_0x29e5f3,_0x2b7ef6))['catch'](handleError(_0x29e5f3,null));};exports[_0x84be('0x46')]=function(_0x282fd8,_0x1541b5){var _0x1a3f4f={'raw':![],'where':{'id':_0x282fd8[_0x84be('0x47')]['id']}},_0x1c93b4={};_0x1c93b4[_0x84be('0x32')]=_[_0x84be('0x48')](db['AnalyticCustomReport'][_0x84be('0x30')]);_0x1c93b4[_0x84be('0x33')]=_[_0x84be('0x48')](_0x282fd8[_0x84be('0x33')]);_0x1c93b4[_0x84be('0x3d')]=_['intersection'](_0x1c93b4[_0x84be('0x32')],_0x1c93b4[_0x84be('0x33')]);_0x1a3f4f['attributes']=_[_0x84be('0x34')](_0x1c93b4[_0x84be('0x32')],qs[_0x84be('0x36')](_0x282fd8['query'][_0x84be('0x36')]));_0x1a3f4f[_0x84be('0x35')]=_0x1a3f4f[_0x84be('0x35')][_0x84be('0x37')]?_0x1a3f4f[_0x84be('0x35')]:_0x1c93b4[_0x84be('0x32')];if(_0x282fd8[_0x84be('0x33')][_0x84be('0x43')]){_0x1a3f4f['include']=[{'all':!![]}];}_0x1a3f4f=_[_0x84be('0x40')]({},_0x1a3f4f,_0x282fd8[_0x84be('0x41')]);return db[_0x84be('0x42')][_0x84be('0x49')](_0x1a3f4f)['then'](handleEntityNotFound(_0x1541b5,null))[_0x84be('0x27')](respondWithResult(_0x1541b5,null))['catch'](handleError(_0x1541b5,null));};exports[_0x84be('0x4a')]=function(_0x357d93,_0x3539a0){return db['AnalyticCustomReport'][_0x84be('0x4a')](_0x357d93[_0x84be('0x4b')],{})[_0x84be('0x27')](function(_0x943f22){var _0x180fcf=_0x357d93[_0x84be('0x4c')]['get']({'plain':!![]});if(!_0x180fcf)throw new Error(_0x84be('0x4d'));if(_0x180fcf['role']==='user'){var _0x2d6524=_0x943f22['get']({'plain':!![]});var _0x31b418=_0x84be('0x4e');return db['UserProfileSection'][_0x84be('0x49')]({'where':{'name':_0x31b418,'userProfileId':_0x180fcf[_0x84be('0x4f')]},'raw':!![]})[_0x84be('0x27')](function(_0x48584c){if(_0x48584c&&_0x48584c[_0x84be('0x50')]===0x0){return db[_0x84be('0x29')][_0x84be('0x4a')]({'name':_0x2d6524[_0x84be('0x2d')],'resourceId':_0x2d6524['id'],'type':_0x84be('0x51'),'sectionId':_0x48584c['id']},{})[_0x84be('0x27')](function(){return _0x943f22;});}else{return _0x943f22;}})[_0x84be('0x52')](function(_0x43ca2e){logger[_0x84be('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x43ca2e);throw _0x43ca2e;});}return _0x943f22;})['then'](respondWithResult(_0x3539a0,0xc9))[_0x84be('0x52')](handleError(_0x3539a0,null));};exports[_0x84be('0x26')]=function(_0x1e603a,_0x48d515){if(_0x1e603a[_0x84be('0x4b')]['id']){delete _0x1e603a[_0x84be('0x4b')]['id'];}return db[_0x84be('0x42')][_0x84be('0x49')]({'where':{'id':_0x1e603a[_0x84be('0x47')]['id']}})[_0x84be('0x27')](handleEntityNotFound(_0x48d515,null))['then'](saveUpdates(_0x1e603a['body'],null))[_0x84be('0x27')](respondWithResult(_0x48d515,null))[_0x84be('0x52')](handleError(_0x48d515,null));};exports[_0x84be('0x28')]=function(_0x220dd2,_0x42e763){return db[_0x84be('0x42')][_0x84be('0x49')]({'where':{'id':_0x220dd2[_0x84be('0x47')]['id']}})['then'](handleEntityNotFound(_0x42e763,null))['then'](removeEntity(_0x42e763,null))[_0x84be('0x52')](handleError(_0x42e763,null));};exports['preview']=function(_0x2b51a0,_0x4553c7){var _0x115445=0xa;var _0x194199=[_0x84be('0x53'),_0x84be('0x54'),'right_join','cross_join'];var _0x2d80af={'SUM':_0x84be('0x55'),'COUNT':_0x84be('0x56'),'COUNT DISTINCT':_0x84be('0x57'),'MAX':_0x84be('0x58'),'MIN':_0x84be('0x59'),'AVG':_0x84be('0x5a'),'GROUP_CONCAT':_0x84be('0x5b'),'GROUP_CONCAT ASC':_0x84be('0x5c'),'GROUP_CONCAT DESC':_0x84be('0x5d')};var _0x5f2d61={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x84be('0x5e'),'HOUR':_0x84be('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x84be('0x60')};var _0x2a57f3=function(_0x1461a5){return!_[_0x84be('0x61')]([_0x84be('0x62'),_0x84be('0x63'),'IS\x20EMPTY',_0x84be('0x64')],_0x1461a5);};var _0x576a5e=function(_0x1e6283){if(!_0x1e6283||!_0x1e6283[_0x84be('0x65')]['length']){return'';}for(var _0x12da67='(',_0x561350=0x0;_0x561350<_0x1e6283[_0x84be('0x65')][_0x84be('0x37')];_0x561350+=0x1){_0x561350>0x0&&(_0x12da67+='\x20'+_0x1e6283[_0x84be('0x66')]+'\x20');_0x12da67+=_0x1e6283[_0x84be('0x65')][_0x561350][_0x84be('0x67')]?_0x576a5e(_0x1e6283[_0x84be('0x65')][_0x561350]['group']):_0x1e6283[_0x84be('0x65')][_0x561350][_0x84be('0x68')]+'\x20'+_0x1e6283['rules'][_0x561350]['condition']+(_0x2a57f3(_0x1e6283[_0x84be('0x65')][_0x561350]['condition'])?'\x20'+_0x1e6283[_0x84be('0x65')][_0x561350][_0x84be('0x69')]:'');}return _0x12da67+')';};var _0xe6dcd5={'where':{'id':_0x2b51a0[_0x84be('0x47')]['id']}},_0xfd27ab,_0x16f601,_0x3c3f69,_0x428b2f,_0x4d1595;_0xe6dcd5=_[_0x84be('0x40')]({},_0xe6dcd5,_0x2b51a0[_0x84be('0x41')]);return db[_0x84be('0x42')]['find'](_0xe6dcd5)[_0x84be('0x27')](function(_0x87e4cc){if(_0x87e4cc){_0xfd27ab=_0x87e4cc;return _0x87e4cc[_0x84be('0x6a')]();}return null;})[_0x84be('0x27')](function(_0x449b43){if(_0x449b43){if(!_0x449b43['length']){throw new db['Sequelize'][(_0x84be('0x6b'))](_0x84be('0x6c'),0x193);}_0x16f601=_0x449b43;return db[_0x84be('0x6d')][_0x84be('0x6e')]({'raw':!![]});}return null;})[_0x84be('0x27')](function(_0x44252f){if(_0x44252f){_0x3c3f69=_['keyBy'](_0x44252f,'id');var _0x3482d7;var _0x533d5e=squel['select']();_0x533d5e['from'](_0xfd27ab['table']);for(var _0x34c173=0x0;_0x34c173<_0x16f601[_0x84be('0x37')];_0x34c173+=0x1){_0x3482d7=_0x16f601[_0x34c173][_0x84be('0x6f')]?_0x3c3f69[_0x16f601[_0x34c173]['MetricId']][_0x84be('0x70')]:_0x16f601[_0x34c173]['field'];_0x3482d7=_0x16f601[_0x34c173][_0x84be('0x71')]?_[_0x84be('0x72')](_0x2d80af[_0x16f601[_0x34c173][_0x84be('0x71')]],'%s',_0x3482d7):_0x3482d7;_0x3482d7=_0x16f601[_0x34c173][_0x84be('0x73')]?_[_0x84be('0x72')](_0x5f2d61[_0x16f601[_0x34c173][_0x84be('0x73')]],'%s',_0x3482d7):_0x3482d7;if(_0x16f601[_0x34c173][_0x84be('0x74')]){_0x533d5e[_0x84be('0x67')](_0x3482d7);}_0x16f601[_0x34c173]['orderBy']&&_0x533d5e['order'](_0x3482d7,_0x16f601[_0x34c173][_0x84be('0x75')]==='DESC'?![]:!![]);_0x533d5e[_0x84be('0x68')](_0x3482d7,_0x16f601[_0x34c173][_0x84be('0x76')]||_0x3482d7);}if(_0xfd27ab['joins']){_0xfd27ab['joins']=JSON[_0x84be('0x77')](_0xfd27ab['joins']);for(var _0x4dd99a=0x0;_0x4dd99a<_0xfd27ab[_0x84be('0x78')][_0x84be('0x37')];_0x4dd99a+=0x1){if(_0xfd27ab[_0x84be('0x78')][_0x4dd99a][_0x84be('0x31')]&&_[_0x84be('0x61')](_0x194199,_0xfd27ab[_0x84be('0x78')][_0x4dd99a][_0x84be('0x31')])&&_0xfd27ab['joins'][_0x4dd99a][_0x84be('0x79')]&&_0xfd27ab[_0x84be('0x78')][_0x4dd99a]['foreignTable']&&_0xfd27ab[_0x84be('0x78')][_0x4dd99a][_0x84be('0x7a')]){_0x533d5e[_0xfd27ab[_0x84be('0x78')][_0x4dd99a][_0x84be('0x31')]](_0xfd27ab[_0x84be('0x78')][_0x4dd99a][_0x84be('0x7b')],null,util[_0x84be('0x73')](_0x84be('0x7c'),_0xfd27ab[_0x84be('0x7d')],_0xfd27ab[_0x84be('0x78')][_0x4dd99a][_0x84be('0x79')],_0xfd27ab[_0x84be('0x78')][_0x4dd99a]['foreignTable'],_0xfd27ab['joins'][_0x4dd99a]['foreignKey']));}}}if(_0xfd27ab[_0x84be('0x7e')]){_0xfd27ab[_0x84be('0x7e')]=JSON[_0x84be('0x77')](_0xfd27ab['conditions']);_0x533d5e[_0x84be('0x3c')](_0x576a5e(_0xfd27ab[_0x84be('0x7e')]['group']));}_0x4d1595=_0x533d5e[_0x84be('0x7f')]();_0x533d5e[_0x84be('0x20')](_0x115445);_0x533d5e['offset'](0x0);logger['debug'](_0x84be('0x80'),_0x533d5e['toString']());return dbH[_0x84be('0x81')][_0x84be('0x33')](_0x533d5e[_0x84be('0x82')](),{'type':dbH[_0x84be('0x81')][_0x84be('0x83')][_0x84be('0x84')]});}})[_0x84be('0x27')](respondWithResult(_0x4553c7,null))[_0x84be('0x52')](handleError(_0x4553c7,null));};function runReport(_0x15a1f4,_0x2a6a60,_0x3425a9){var _0x3ce0c9=_0x2a6a60[_0x84be('0x2d')];var _0x34d644=0xa;var _0x4472c5=['join','left_join',_0x84be('0x85'),_0x84be('0x86')];var _0x330f1c={'SUM':_0x84be('0x55'),'COUNT':_0x84be('0x56'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x84be('0x58'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x84be('0x5b'),'GROUP_CONCAT ASC':_0x84be('0x5c'),'GROUP_CONCAT DESC':_0x84be('0x5d')};var _0x4e19fc={'SEC_TO_TIME':_0x84be('0x87'),'DATE':_0x84be('0x5e'),'HOUR':'HOUR(%s)','ROUND':_0x84be('0x88'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1b566c=function(_0x53d951){return!_[_0x84be('0x61')](['IS\x20NULL',_0x84be('0x63'),_0x84be('0x89'),_0x84be('0x64')],_0x53d951);};var _0xffe1f8=function(_0x5bf80f){if(!_0x5bf80f||!_0x5bf80f['rules'][_0x84be('0x37')]){return'';}for(var _0x5b73dc='(',_0x5ca741=0x0;_0x5ca741<_0x5bf80f[_0x84be('0x65')][_0x84be('0x37')];_0x5ca741+=0x1){_0x5ca741>0x0&&(_0x5b73dc+='\x20'+_0x5bf80f[_0x84be('0x66')]+'\x20');_0x5b73dc+=_0x5bf80f[_0x84be('0x65')][_0x5ca741][_0x84be('0x67')]?_0xffe1f8(_0x5bf80f['rules'][_0x5ca741][_0x84be('0x67')]):_0x5bf80f[_0x84be('0x65')][_0x5ca741][_0x84be('0x68')]+'\x20'+_0x5bf80f['rules'][_0x5ca741][_0x84be('0x8a')]+(_0x1b566c(_0x5bf80f[_0x84be('0x65')][_0x5ca741]['condition'])?'\x20'+_0x5bf80f[_0x84be('0x65')][_0x5ca741][_0x84be('0x69')]:'');}return _0x5b73dc+')';};var _0x257e5f={'where':{'id':_0x15a1f4['id']}},_0x1cd58b,_0x596263,_0x2f087b,_0x44cab3,_0x47d4fe;_0x257e5f=_['merge']({},_0x257e5f,_0x3425a9);return db['AnalyticCustomReport']['find'](_0x257e5f)[_0x84be('0x27')](function(_0x2e231f){if(_0x2e231f){_0x1cd58b=_0x2e231f;return _0x2e231f[_0x84be('0x6a')]();}return null;})[_0x84be('0x27')](function(_0xe9ee58){if(_0xe9ee58){if(!_0xe9ee58['length']){throw new db[(_0x84be('0x8b'))][(_0x84be('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x596263=_0xe9ee58;return db[_0x84be('0x6d')][_0x84be('0x6e')]({'raw':!![]});}return null;})[_0x84be('0x27')](function(_0xd399bb){if(_0xd399bb){_0x2f087b=_['keyBy'](_0xd399bb,'id');var _0x6647e3;var _0x31bfa5=squel[_0x84be('0x8c')]();_0x31bfa5[_0x84be('0x8d')](_0x1cd58b[_0x84be('0x7d')]);for(var _0x21a072=0x0;_0x21a072<_0x596263[_0x84be('0x37')];_0x21a072+=0x1){_0x6647e3=_0x596263[_0x21a072][_0x84be('0x6f')]?_0x2f087b[_0x596263[_0x21a072]['MetricId']][_0x84be('0x70')]:_0x596263[_0x21a072][_0x84be('0x68')];_0x6647e3=_0x596263[_0x21a072][_0x84be('0x71')]?_[_0x84be('0x72')](_0x330f1c[_0x596263[_0x21a072][_0x84be('0x71')]],'%s',_0x6647e3):_0x6647e3;_0x6647e3=_0x596263[_0x21a072][_0x84be('0x73')]?_[_0x84be('0x72')](_0x4e19fc[_0x596263[_0x21a072][_0x84be('0x73')]],'%s',_0x6647e3):_0x6647e3;if(_0x596263[_0x21a072][_0x84be('0x74')]){_0x31bfa5['group'](_0x6647e3);}_0x596263[_0x21a072][_0x84be('0x75')]&&_0x31bfa5[_0x84be('0x3a')](_0x6647e3,_0x596263[_0x21a072][_0x84be('0x75')]===_0x84be('0x8e')?![]:!![]);_0x31bfa5['field'](_0x6647e3,_0x596263[_0x21a072][_0x84be('0x76')]||_0x6647e3);}if(_0x1cd58b[_0x84be('0x78')]){_0x1cd58b[_0x84be('0x78')]=JSON[_0x84be('0x77')](_0x1cd58b['joins']);for(var _0x109f6a=0x0;_0x109f6a<_0x1cd58b[_0x84be('0x78')][_0x84be('0x37')];_0x109f6a+=0x1){if(_0x1cd58b[_0x84be('0x78')][_0x109f6a]['type']&&_[_0x84be('0x61')](_0x4472c5,_0x1cd58b[_0x84be('0x78')][_0x109f6a][_0x84be('0x31')])&&_0x1cd58b['joins'][_0x109f6a]['parentKey']&&_0x1cd58b[_0x84be('0x78')][_0x109f6a][_0x84be('0x7b')]&&_0x1cd58b[_0x84be('0x78')][_0x109f6a][_0x84be('0x7a')]){_0x31bfa5[_0x1cd58b[_0x84be('0x78')][_0x109f6a][_0x84be('0x31')]](_0x1cd58b[_0x84be('0x78')][_0x109f6a]['foreignTable'],null,util[_0x84be('0x73')]('%s.%s\x20=\x20%s.%s',_0x1cd58b[_0x84be('0x7d')],_0x1cd58b[_0x84be('0x78')][_0x109f6a]['parentKey'],_0x1cd58b[_0x84be('0x78')][_0x109f6a][_0x84be('0x7b')],_0x1cd58b['joins'][_0x109f6a]['foreignKey']));}}}if(_0x1cd58b[_0x84be('0x7e')]){_0x1cd58b['conditions']=JSON[_0x84be('0x77')](_0x1cd58b['conditions']);_0x31bfa5[_0x84be('0x3c')](_0xffe1f8(_0x1cd58b[_0x84be('0x7e')]['group']));}_0x47d4fe=_0x31bfa5[_0x84be('0x7f')]();_0x31bfa5[_0x84be('0x20')](_0x34d644);_0x31bfa5[_0x84be('0x1e')](0x0);return;}})[_0x84be('0x27')](function(){if(_0x2a6a60[_0x84be('0x8f')]===_0x84be('0x90')){return null;}var _0x4cc9cb=_[_0x84be('0x40')](_0x2a6a60,{'name':_0x2a6a60[_0x84be('0x91')]||_0x2a6a60[_0x84be('0x2d')]||_0x1cd58b[_0x84be('0x2d')],'basename':_0x3ce0c9,'savename':util[_0x84be('0x73')]('%s-%s.%s',_0x2a6a60[_0x84be('0x2d')]||_0x1cd58b[_0x84be('0x2d')],require(_0x84be('0x92'))['generate'](0x4),_0x2a6a60[_0x84be('0x8f')]||'csv'),'reportId':_0x1cd58b['id'],'reportType':_0x84be('0x93')});return db[_0x84be('0x94')]['create'](_0x4cc9cb,{'raw':!![]});})[_0x84be('0x27')](function(_0x9aea4f){if(_0x1cd58b['table']===_0x84be('0x95')){_0x47d4fe[_0x84be('0x3c')](_0x1cd58b[_0x84be('0x7d')]+_0x84be('0x96'),_0x2a6a60[_0x84be('0x97')],_0x2a6a60[_0x84be('0x98')]);}else{_0x47d4fe[_0x84be('0x3c')](_0x1cd58b[_0x84be('0x7d')]+_0x84be('0x99'),_0x2a6a60['startDate'],_0x2a6a60[_0x84be('0x98')]);}if(_0x9aea4f){logger[_0x84be('0x9a')](_0x84be('0x9b'),_0x47d4fe[_0x84be('0x82')]());require(_0x84be('0x9c'))[_0x84be('0x9d')](path['join'](__dirname,_0x84be('0x9e'),_0x9aea4f[_0x84be('0x8f')]),[_0x9aea4f['id'],_0x47d4fe[_0x84be('0x82')](),path[_0x84be('0x53')](__dirname,_0x84be('0x9f'),_0x9aea4f[_0x84be('0xa0')]),_0x3ce0c9]);return _0x9aea4f;}else{var _0x273816=squel[_0x84be('0x8c')]();_0x273816[_0x84be('0x8d')]('('+_0x47d4fe[_0x84be('0x82')]()+')',_0x84be('0xa1'));_0x273816[_0x84be('0x68')](_0x84be('0xa2'),'count');_0x47d4fe[_0x84be('0x20')](_0x2a6a60[_0x84be('0x20')]||_0x34d644);_0x47d4fe[_0x84be('0x1e')](_0x2a6a60[_0x84be('0x1e')]||0x0);return dbH[_0x84be('0x81')][_0x84be('0x33')](_0x273816['toString'](),{'type':dbH[_0x84be('0x81')]['QueryTypes'][_0x84be('0x84')]})[_0x84be('0x27')](function(_0x8268ce){if(!_0x8268ce[_0x84be('0x37')]){_0x44cab3=0x0;}else{_0x44cab3=_0x8268ce[0x0][_0x84be('0x21')]||0x0;}return dbH[_0x84be('0x81')][_0x84be('0x33')](_0x47d4fe[_0x84be('0x82')](),{'type':dbH['sequelize']['QueryTypes'][_0x84be('0x84')]});})['then'](function(_0x4afb59){return{'rows':_0x4afb59||[],'count':_0x44cab3};});}});}exports[_0x84be('0xa3')]=function(_0x4d9def,_0x599e43){return runReport(_0x4d9def[_0x84be('0x47')],_0x4d9def[_0x84be('0x33')],_0x4d9def[_0x84be('0x41')])['then'](respondWithResult(_0x599e43,null))[_0x84be('0x52')](handleError(_0x599e43,null));};exports['runReport']=runReport;exports[_0x84be('0x33')]=function(_0x56cd06,_0x1ca5f8){var _0x22d271=0xa;var _0x29ed5e=[_0x84be('0x53'),_0x84be('0x54'),_0x84be('0x85'),_0x84be('0x86')];var _0x3151ad={'SUM':_0x84be('0x55'),'COUNT':_0x84be('0x56'),'COUNT DISTINCT':_0x84be('0x57'),'MAX':_0x84be('0x58'),'MIN':_0x84be('0x59'),'AVG':_0x84be('0x5a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x84be('0x5c'),'GROUP_CONCAT DESC':_0x84be('0x5d')};var _0x1a0ddd={'SEC_TO_TIME':_0x84be('0x87'),'DATE':_0x84be('0x5e'),'HOUR':_0x84be('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x84be('0x60')};var _0x3dd2f4=function(_0x276332){return!_[_0x84be('0x61')]([_0x84be('0x62'),_0x84be('0x63'),_0x84be('0x89'),'IS\x20NOT\x20EMPTY'],_0x276332);};var _0x34abb6=function(_0x510fb7){if(!_0x510fb7||!_0x510fb7['rules']['length']){return'';}for(var _0x3c3c4d='(',_0x3839cf=0x0;_0x3839cf<_0x510fb7[_0x84be('0x65')]['length'];_0x3839cf+=0x1){_0x3839cf>0x0&&(_0x3c3c4d+='\x20'+_0x510fb7[_0x84be('0x66')]+'\x20');_0x3c3c4d+=_0x510fb7[_0x84be('0x65')][_0x3839cf][_0x84be('0x67')]?_0x34abb6(_0x510fb7[_0x84be('0x65')][_0x3839cf]['group']):_0x510fb7[_0x84be('0x65')][_0x3839cf][_0x84be('0x68')]+'\x20'+_0x510fb7[_0x84be('0x65')][_0x3839cf]['condition']+(_0x3dd2f4(_0x510fb7[_0x84be('0x65')][_0x3839cf][_0x84be('0x8a')])?'\x20'+_0x510fb7['rules'][_0x3839cf][_0x84be('0x69')]:'');}return _0x3c3c4d+')';};var _0x437f1f={'where':{'id':_0x56cd06['params']['id']}},_0x3311a0,_0xc55772,_0x478dbd,_0x1e84cd,_0x27b71f;_0x437f1f=_[_0x84be('0x40')]({},_0x437f1f,_0x56cd06[_0x84be('0x41')]);return db[_0x84be('0x42')][_0x84be('0x49')](_0x437f1f)[_0x84be('0x27')](function(_0x3389d3){if(_0x3389d3){_0x3311a0=_0x3389d3;return _0x3389d3[_0x84be('0x6a')]();}return null;})['then'](function(_0x1a50e2){if(_0x1a50e2){if(!_0x1a50e2[_0x84be('0x37')]){throw new db[(_0x84be('0x8b'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xc55772=_0x1a50e2;return db[_0x84be('0x6d')][_0x84be('0x6e')]({'raw':!![]});}return null;})[_0x84be('0x27')](function(_0x5a047c){if(_0x5a047c){_0x478dbd=_[_0x84be('0xa4')](_0x5a047c,'id');var _0x120bb6;var _0x46d897=squel['select']();_0x46d897[_0x84be('0x8d')](_0x3311a0[_0x84be('0x7d')]);for(var _0x18c6bd=0x0;_0x18c6bd<_0xc55772[_0x84be('0x37')];_0x18c6bd+=0x1){_0x120bb6=_0xc55772[_0x18c6bd][_0x84be('0x6f')]?_0x478dbd[_0xc55772[_0x18c6bd]['MetricId']][_0x84be('0x70')]:_0xc55772[_0x18c6bd][_0x84be('0x68')];_0x120bb6=_0xc55772[_0x18c6bd][_0x84be('0x71')]?_['replace'](_0x3151ad[_0xc55772[_0x18c6bd][_0x84be('0x71')]],'%s',_0x120bb6):_0x120bb6;_0x120bb6=_0xc55772[_0x18c6bd][_0x84be('0x73')]?_[_0x84be('0x72')](_0x1a0ddd[_0xc55772[_0x18c6bd][_0x84be('0x73')]],'%s',_0x120bb6):_0x120bb6;if(_0xc55772[_0x18c6bd]['groupBy']){_0x46d897[_0x84be('0x67')](_0x120bb6);}_0xc55772[_0x18c6bd][_0x84be('0x75')]&&_0x46d897['order'](_0x120bb6,_0xc55772[_0x18c6bd][_0x84be('0x75')]===_0x84be('0x8e')?![]:!![]);_0x46d897[_0x84be('0x68')](_0x120bb6,_0xc55772[_0x18c6bd]['alias']||_0x120bb6);}if(_0x3311a0[_0x84be('0x78')]){_0x3311a0['joins']=JSON[_0x84be('0x77')](_0x3311a0[_0x84be('0x78')]);for(var _0x36a51b=0x0;_0x36a51b<_0x3311a0['joins'][_0x84be('0x37')];_0x36a51b+=0x1){if(_0x3311a0['joins'][_0x36a51b][_0x84be('0x31')]&&_['includes'](_0x29ed5e,_0x3311a0[_0x84be('0x78')][_0x36a51b][_0x84be('0x31')])&&_0x3311a0[_0x84be('0x78')][_0x36a51b][_0x84be('0x79')]&&_0x3311a0['joins'][_0x36a51b][_0x84be('0x7b')]&&_0x3311a0[_0x84be('0x78')][_0x36a51b]['foreignKey']){_0x46d897[_0x3311a0['joins'][_0x36a51b]['type']](_0x3311a0[_0x84be('0x78')][_0x36a51b][_0x84be('0x7b')],null,util[_0x84be('0x73')](_0x84be('0x7c'),_0x3311a0[_0x84be('0x7d')],_0x3311a0[_0x84be('0x78')][_0x36a51b][_0x84be('0x79')],_0x3311a0[_0x84be('0x78')][_0x36a51b][_0x84be('0x7b')],_0x3311a0[_0x84be('0x78')][_0x36a51b][_0x84be('0x7a')]));}}}if(_0x3311a0[_0x84be('0x7e')]){_0x3311a0['conditions']=JSON[_0x84be('0x77')](_0x3311a0[_0x84be('0x7e')]);_0x46d897['where'](_0x34abb6(_0x3311a0[_0x84be('0x7e')]['group']));}_0x27b71f=_0x46d897['clone']();_0x46d897[_0x84be('0x20')](_0x22d271);_0x46d897['offset'](0x0);logger[_0x84be('0xa5')](_0x84be('0x80'),_0x46d897['toString']());return dbH[_0x84be('0x81')][_0x84be('0x33')](_0x46d897[_0x84be('0x82')](),{'type':dbH[_0x84be('0x81')][_0x84be('0x83')][_0x84be('0x84')]});}})[_0x84be('0x27')](function(){return{'sql':_0x27b71f[_0x84be('0x82')]()};})[_0x84be('0x27')](respondWithResult(_0x1ca5f8,null))[_0x84be('0x52')](handleError(_0x1ca5f8,null));};
\ No newline at end of file
+var _0xf59d=['set','Content-Range','reject','save','update','then','get','CustomReports','destroy','error','stack','send','index','map','AnalyticCustomReport','rawAttributes','key','model','name','query','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','params','keys','attributes','create','body','user','role','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','operator','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','GROUP_CONCAT(%s)','table','groupBy','output','web','randomstring','generate','AnalyticExtractedReport','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','fork','../../components/export/','savename','countTable','COUNT(*)','SELECT','run','runReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xf59d,0x121));var _0xdf59=function(_0x1f54bf,_0x1287da){_0x1f54bf=_0x1f54bf-0x0;var _0x191b50=_0xf59d[_0x1f54bf];return _0x191b50;};'use strict';var emlformat=require(_0xdf59('0x0'));var rimraf=require(_0xdf59('0x1'));var zipdir=require(_0xdf59('0x2'));var jsonpatch=require(_0xdf59('0x3'));var rp=require(_0xdf59('0x4'));var moment=require(_0xdf59('0x5'));var BPromise=require(_0xdf59('0x6'));var Mustache=require('mustache');var util=require(_0xdf59('0x7'));var path=require(_0xdf59('0x8'));var sox=require(_0xdf59('0x9'));var csv=require(_0xdf59('0xa'));var ejs=require(_0xdf59('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdf59('0xc'));var squel=require(_0xdf59('0xd'));var crypto=require(_0xdf59('0xe'));var jsforce=require(_0xdf59('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xdf59('0xa'));var querystring=require(_0xdf59('0x10'));var Papa=require(_0xdf59('0x11'));var Redis=require(_0xdf59('0x12'));var authService=require(_0xdf59('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xdf59('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdf59('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xdf59('0x16'));var db=require('../../mysqldb')['db'];var dbH=require(_0xdf59('0x17'))['dbH'];function respondWithStatusCode(_0x14638,_0x4242a3){_0x4242a3=_0x4242a3||0xcc;return function(_0x551e23){if(_0x551e23){return _0x14638[_0xdf59('0x18')](_0x4242a3);}return _0x14638['status'](_0x4242a3)['end']();};}function respondWithResult(_0x260a00,_0xa0d708){_0xa0d708=_0xa0d708||0xc8;return function(_0x182b8a){if(_0x182b8a){return _0x260a00[_0xdf59('0x19')](_0xa0d708)[_0xdf59('0x1a')](_0x182b8a);}};}function respondWithFilteredResult(_0x40bf85,_0x274720){return function(_0x313f7d){if(_0x313f7d){var _0x1ea3c0=typeof _0x274720[_0xdf59('0x1b')]===_0xdf59('0x1c')&&typeof _0x274720[_0xdf59('0x1d')]===_0xdf59('0x1c');var _0x1aff46=_0x313f7d[_0xdf59('0x1e')];var _0x558f7b=_0x1ea3c0?0x0:_0x274720[_0xdf59('0x1b')];var _0x12c0b9=_0x1ea3c0?_0x313f7d[_0xdf59('0x1e')]:_0x274720[_0xdf59('0x1b')]+_0x274720[_0xdf59('0x1d')];var _0x56526c;if(_0x12c0b9>=_0x1aff46){_0x12c0b9=_0x1aff46;_0x56526c=0xc8;}else{_0x56526c=0xce;}_0x40bf85[_0xdf59('0x19')](_0x56526c);return _0x40bf85[_0xdf59('0x1f')](_0xdf59('0x20'),_0x558f7b+'-'+_0x12c0b9+'/'+_0x1aff46)['json'](_0x313f7d);}return null;};}function patchUpdates(_0x44287b){return function(_0x24fdd9){try{jsonpatch['apply'](_0x24fdd9,_0x44287b,!![]);}catch(_0x126abd){return BPromise[_0xdf59('0x21')](_0x126abd);}return _0x24fdd9[_0xdf59('0x22')]();};}function saveUpdates(_0x1a3e70,_0x3d53d1){return function(_0x44b054){if(_0x44b054){return _0x44b054[_0xdf59('0x23')](_0x1a3e70)['then'](function(_0x335e39){return _0x335e39;});}return null;};}function removeEntity(_0x37056f,_0x21192e){return function(_0x140ee6){if(_0x140ee6){return _0x140ee6['destroy']()[_0xdf59('0x24')](function(){var _0x6f72a2=_0x140ee6[_0xdf59('0x25')]({'plain':!![]});var _0x4866d4=_0xdf59('0x26');return db['UserProfileResource'][_0xdf59('0x27')]({'where':{'type':_0x4866d4,'resourceId':_0x6f72a2['id']}})['then'](function(){return _0x140ee6;});})[_0xdf59('0x24')](function(){_0x37056f[_0xdf59('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x732fed,_0x1efaba){return function(_0x18a5b3){if(!_0x18a5b3){_0x732fed[_0xdf59('0x18')](0x194);}return _0x18a5b3;};}function handleError(_0x2ee9ba,_0x162f31){_0x162f31=_0x162f31||0x1f4;return function(_0x3fab08){logger[_0xdf59('0x28')](_0x3fab08[_0xdf59('0x29')]);if(_0x3fab08['name']){delete _0x3fab08['name'];}_0x2ee9ba[_0xdf59('0x19')](_0x162f31)[_0xdf59('0x2a')](_0x3fab08);};}exports[_0xdf59('0x2b')]=function(_0x65bbdd,_0xe92c7f){var _0xe65e63={},_0x608517={},_0x1b98c7={'count':0x0,'rows':[]};var _0x36edad=_[_0xdf59('0x2c')](db[_0xdf59('0x2d')][_0xdf59('0x2e')],function(_0x592ad2){return{'name':_0x592ad2['fieldName'],'type':_0x592ad2['type'][_0xdf59('0x2f')]};});_0x608517[_0xdf59('0x30')]=_['map'](_0x36edad,_0xdf59('0x31'));_0x608517[_0xdf59('0x32')]=_['keys'](_0x65bbdd[_0xdf59('0x32')]);_0x608517['filters']=_['intersection'](_0x608517[_0xdf59('0x30')],_0x608517[_0xdf59('0x32')]);_0xe65e63['attributes']=_[_0xdf59('0x33')](_0x608517[_0xdf59('0x30')],qs[_0xdf59('0x34')](_0x65bbdd['query'][_0xdf59('0x34')]));_0xe65e63['attributes']=_0xe65e63['attributes'][_0xdf59('0x35')]?_0xe65e63['attributes']:_0x608517[_0xdf59('0x30')];if(!_0x65bbdd[_0xdf59('0x32')]['hasOwnProperty'](_0xdf59('0x36'))){_0xe65e63[_0xdf59('0x1d')]=qs['limit'](_0x65bbdd[_0xdf59('0x32')][_0xdf59('0x1d')]);_0xe65e63['offset']=qs[_0xdf59('0x1b')](_0x65bbdd[_0xdf59('0x32')][_0xdf59('0x1b')]);}_0xe65e63[_0xdf59('0x37')]=qs[_0xdf59('0x38')](_0x65bbdd[_0xdf59('0x32')][_0xdf59('0x38')]);_0xe65e63[_0xdf59('0x39')]=qs[_0xdf59('0x3a')](_[_0xdf59('0x3b')](_0x65bbdd['query'],_0x608517[_0xdf59('0x3a')]),_0x36edad);if(_0x65bbdd[_0xdf59('0x32')][_0xdf59('0x3c')]){_0xe65e63['where']=_[_0xdf59('0x3d')](_0xe65e63[_0xdf59('0x39')],{'$or':_[_0xdf59('0x2c')](_0x36edad,function(_0x31d133){if(_0x31d133[_0xdf59('0x3e')]!==_0xdf59('0x3f')){var _0x322a84={};_0x322a84[_0x31d133['name']]={'$like':'%'+_0x65bbdd[_0xdf59('0x32')][_0xdf59('0x3c')]+'%'};return _0x322a84;}})});}_0xe65e63=_[_0xdf59('0x3d')]({},_0xe65e63,_0x65bbdd[_0xdf59('0x40')]);var _0x49ae46={'where':_0xe65e63[_0xdf59('0x39')]};return db[_0xdf59('0x2d')][_0xdf59('0x1e')](_0x49ae46)['then'](function(_0x17ba68){_0x1b98c7[_0xdf59('0x1e')]=_0x17ba68;if(_0x65bbdd[_0xdf59('0x32')][_0xdf59('0x41')]){_0xe65e63[_0xdf59('0x42')]=[{'all':!![]}];}return db[_0xdf59('0x2d')][_0xdf59('0x43')](_0xe65e63);})[_0xdf59('0x24')](function(_0x2bb3f6){_0x1b98c7['rows']=_0x2bb3f6;return _0x1b98c7;})[_0xdf59('0x24')](respondWithFilteredResult(_0xe92c7f,_0xe65e63))[_0xdf59('0x44')](handleError(_0xe92c7f,null));};exports['show']=function(_0x265c69,_0x1dc7a2){var _0x4f01d8={'raw':![],'where':{'id':_0x265c69[_0xdf59('0x45')]['id']}},_0x596dd6={};_0x596dd6[_0xdf59('0x30')]=_['keys'](db[_0xdf59('0x2d')][_0xdf59('0x2e')]);_0x596dd6[_0xdf59('0x32')]=_[_0xdf59('0x46')](_0x265c69[_0xdf59('0x32')]);_0x596dd6[_0xdf59('0x3a')]=_[_0xdf59('0x33')](_0x596dd6[_0xdf59('0x30')],_0x596dd6[_0xdf59('0x32')]);_0x4f01d8[_0xdf59('0x47')]=_['intersection'](_0x596dd6[_0xdf59('0x30')],qs['fields'](_0x265c69[_0xdf59('0x32')]['fields']));_0x4f01d8[_0xdf59('0x47')]=_0x4f01d8[_0xdf59('0x47')]['length']?_0x4f01d8['attributes']:_0x596dd6[_0xdf59('0x30')];if(_0x265c69['query']['includeAll']){_0x4f01d8[_0xdf59('0x42')]=[{'all':!![]}];}_0x4f01d8=_[_0xdf59('0x3d')]({},_0x4f01d8,_0x265c69[_0xdf59('0x40')]);return db['AnalyticCustomReport']['find'](_0x4f01d8)['then'](handleEntityNotFound(_0x1dc7a2,null))[_0xdf59('0x24')](respondWithResult(_0x1dc7a2,null))[_0xdf59('0x44')](handleError(_0x1dc7a2,null));};exports['create']=function(_0x15d8b1,_0x527a16){return db[_0xdf59('0x2d')][_0xdf59('0x48')](_0x15d8b1[_0xdf59('0x49')],{})['then'](function(_0x3a9f9f){var _0x2d93da=_0x15d8b1[_0xdf59('0x4a')]['get']({'plain':!![]});if(!_0x2d93da)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2d93da[_0xdf59('0x4b')]===_0xdf59('0x4a')){var _0x4fc6bd=_0x3a9f9f['get']({'plain':!![]});var _0x1f7aeb='Reports';return db[_0xdf59('0x4c')][_0xdf59('0x4d')]({'where':{'name':_0x1f7aeb,'userProfileId':_0x2d93da['userProfileId']},'raw':!![]})[_0xdf59('0x24')](function(_0x26b290){if(_0x26b290&&_0x26b290[_0xdf59('0x4e')]===0x0){return db[_0xdf59('0x4f')]['create']({'name':_0x4fc6bd[_0xdf59('0x31')],'resourceId':_0x4fc6bd['id'],'type':_0xdf59('0x26'),'sectionId':_0x26b290['id']},{})[_0xdf59('0x24')](function(){return _0x3a9f9f;});}else{return _0x3a9f9f;}})[_0xdf59('0x44')](function(_0x2a19c9){logger['error'](_0xdf59('0x50'),_0x2a19c9);throw _0x2a19c9;});}return _0x3a9f9f;})['then'](respondWithResult(_0x527a16,0xc9))['catch'](handleError(_0x527a16,null));};exports['update']=function(_0x58c9fd,_0x3cf1b1){if(_0x58c9fd[_0xdf59('0x49')]['id']){delete _0x58c9fd[_0xdf59('0x49')]['id'];}return db[_0xdf59('0x2d')][_0xdf59('0x4d')]({'where':{'id':_0x58c9fd['params']['id']}})[_0xdf59('0x24')](handleEntityNotFound(_0x3cf1b1,null))['then'](saveUpdates(_0x58c9fd[_0xdf59('0x49')],null))[_0xdf59('0x24')](respondWithResult(_0x3cf1b1,null))['catch'](handleError(_0x3cf1b1,null));};exports[_0xdf59('0x27')]=function(_0x52ebac,_0x17238a){return db[_0xdf59('0x2d')][_0xdf59('0x4d')]({'where':{'id':_0x52ebac[_0xdf59('0x45')]['id']}})[_0xdf59('0x24')](handleEntityNotFound(_0x17238a,null))[_0xdf59('0x24')](removeEntity(_0x17238a,null))[_0xdf59('0x44')](handleError(_0x17238a,null));};exports[_0xdf59('0x51')]=function(_0x1d7cba,_0x5d5c65){var _0x225dd3=0xa;var _0xad414=[_0xdf59('0x52'),_0xdf59('0x53'),_0xdf59('0x54'),_0xdf59('0x55')];var _0x5ab365={'SUM':_0xdf59('0x56'),'COUNT':_0xdf59('0x57'),'COUNT DISTINCT':_0xdf59('0x58'),'MAX':_0xdf59('0x59'),'MIN':_0xdf59('0x5a'),'AVG':_0xdf59('0x5b'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xdf59('0x5c'),'GROUP_CONCAT DESC':_0xdf59('0x5d')};var _0x1a7624={'SEC_TO_TIME':_0xdf59('0x5e'),'DATE':_0xdf59('0x5f'),'HOUR':_0xdf59('0x60'),'ROUND':_0xdf59('0x61'),'UNIX_TIMESTAMP':_0xdf59('0x62')};var _0x2a7e2c=function(_0x57f1b8){return!_[_0xdf59('0x63')]([_0xdf59('0x64'),_0xdf59('0x65'),_0xdf59('0x66'),_0xdf59('0x67')],_0x57f1b8);};var _0x3c589d=function(_0x4050b1){if(!_0x4050b1||!_0x4050b1['rules'][_0xdf59('0x35')]){return'';}for(var _0x50185f='(',_0x2a90c2=0x0;_0x2a90c2<_0x4050b1['rules'][_0xdf59('0x35')];_0x2a90c2+=0x1){_0x2a90c2>0x0&&(_0x50185f+='\x20'+_0x4050b1[_0xdf59('0x68')]+'\x20');_0x50185f+=_0x4050b1[_0xdf59('0x69')][_0x2a90c2][_0xdf59('0x6a')]?_0x3c589d(_0x4050b1[_0xdf59('0x69')][_0x2a90c2][_0xdf59('0x6a')]):_0x4050b1['rules'][_0x2a90c2][_0xdf59('0x6b')]+'\x20'+_0x4050b1[_0xdf59('0x69')][_0x2a90c2]['condition']+(_0x2a7e2c(_0x4050b1[_0xdf59('0x69')][_0x2a90c2][_0xdf59('0x6c')])?'\x20'+_0x4050b1[_0xdf59('0x69')][_0x2a90c2][_0xdf59('0x6d')]:'');}return _0x50185f+')';};var _0x4666f8={'where':{'id':_0x1d7cba[_0xdf59('0x45')]['id']}},_0x17b1ac,_0x519b65,_0x3bd10b,_0x36acb8,_0x4a8f2a;_0x4666f8=_['merge']({},_0x4666f8,_0x1d7cba[_0xdf59('0x40')]);return db['AnalyticCustomReport']['find'](_0x4666f8)[_0xdf59('0x24')](function(_0x26e487){if(_0x26e487){_0x17b1ac=_0x26e487;return _0x26e487[_0xdf59('0x6e')]();}return null;})[_0xdf59('0x24')](function(_0x4f1cc1){if(_0x4f1cc1){if(!_0x4f1cc1[_0xdf59('0x35')]){throw new db[(_0xdf59('0x6f'))][(_0xdf59('0x70'))](_0xdf59('0x71'),0x193);}_0x519b65=_0x4f1cc1;return db[_0xdf59('0x72')][_0xdf59('0x43')]({'raw':!![]});}return null;})[_0xdf59('0x24')](function(_0x17dd8c){if(_0x17dd8c){_0x3bd10b=_[_0xdf59('0x73')](_0x17dd8c,'id');var _0x562bd2;var _0x15536e=squel[_0xdf59('0x74')]();_0x15536e[_0xdf59('0x75')](_0x17b1ac['table']);for(var _0x586bfd=0x0;_0x586bfd<_0x519b65[_0xdf59('0x35')];_0x586bfd+=0x1){_0x562bd2=_0x519b65[_0x586bfd][_0xdf59('0x76')]?_0x3bd10b[_0x519b65[_0x586bfd]['MetricId']][_0xdf59('0x77')]:_0x519b65[_0x586bfd][_0xdf59('0x6b')];_0x562bd2=_0x519b65[_0x586bfd][_0xdf59('0x78')]?_[_0xdf59('0x79')](_0x5ab365[_0x519b65[_0x586bfd][_0xdf59('0x78')]],'%s',_0x562bd2):_0x562bd2;_0x562bd2=_0x519b65[_0x586bfd]['format']?_[_0xdf59('0x79')](_0x1a7624[_0x519b65[_0x586bfd][_0xdf59('0x7a')]],'%s',_0x562bd2):_0x562bd2;if(_0x519b65[_0x586bfd]['groupBy']){_0x15536e[_0xdf59('0x6a')](_0x562bd2);}_0x519b65[_0x586bfd][_0xdf59('0x7b')]&&_0x15536e['order'](_0x562bd2,_0x519b65[_0x586bfd]['orderBy']===_0xdf59('0x7c')?![]:!![]);_0x15536e[_0xdf59('0x6b')](_0x562bd2,_0x519b65[_0x586bfd][_0xdf59('0x7d')]||_0x562bd2);}if(_0x17b1ac[_0xdf59('0x7e')]){_0x17b1ac[_0xdf59('0x7e')]=JSON['parse'](_0x17b1ac[_0xdf59('0x7e')]);for(var _0x5201e5=0x0;_0x5201e5<_0x17b1ac[_0xdf59('0x7e')][_0xdf59('0x35')];_0x5201e5+=0x1){if(_0x17b1ac[_0xdf59('0x7e')][_0x5201e5]['type']&&_['includes'](_0xad414,_0x17b1ac['joins'][_0x5201e5][_0xdf59('0x3e')])&&_0x17b1ac['joins'][_0x5201e5]['parentKey']&&_0x17b1ac['joins'][_0x5201e5][_0xdf59('0x7f')]&&_0x17b1ac[_0xdf59('0x7e')][_0x5201e5][_0xdf59('0x80')]){_0x15536e[_0x17b1ac[_0xdf59('0x7e')][_0x5201e5][_0xdf59('0x3e')]](_0x17b1ac[_0xdf59('0x7e')][_0x5201e5]['foreignTable'],null,util[_0xdf59('0x7a')](_0xdf59('0x81'),_0x17b1ac['table'],_0x17b1ac[_0xdf59('0x7e')][_0x5201e5][_0xdf59('0x82')],_0x17b1ac[_0xdf59('0x7e')][_0x5201e5]['foreignTable'],_0x17b1ac['joins'][_0x5201e5]['foreignKey']));}}}if(_0x17b1ac['conditions']){_0x17b1ac[_0xdf59('0x83')]=JSON[_0xdf59('0x84')](_0x17b1ac[_0xdf59('0x83')]);_0x15536e[_0xdf59('0x39')](_0x3c589d(_0x17b1ac[_0xdf59('0x83')][_0xdf59('0x6a')]));}_0x4a8f2a=_0x15536e[_0xdf59('0x85')]();_0x15536e[_0xdf59('0x1d')](_0x225dd3);_0x15536e['offset'](0x0);logger[_0xdf59('0x86')](_0xdf59('0x87'),_0x15536e[_0xdf59('0x88')]());return dbH[_0xdf59('0x89')][_0xdf59('0x32')](_0x15536e[_0xdf59('0x88')](),{'type':dbH['sequelize'][_0xdf59('0x8a')]['SELECT']});}})['then'](respondWithResult(_0x5d5c65,null))[_0xdf59('0x44')](handleError(_0x5d5c65,null));};function runReport(_0x220077,_0x544788,_0x209de4){var _0xe9e66e=_0x544788[_0xdf59('0x31')];var _0x1ae19f=0xa;var _0x54e0c4=['join',_0xdf59('0x53'),_0xdf59('0x54'),_0xdf59('0x55')];var _0x4da39c={'SUM':_0xdf59('0x56'),'COUNT':_0xdf59('0x57'),'COUNT DISTINCT':_0xdf59('0x58'),'MAX':_0xdf59('0x59'),'MIN':_0xdf59('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xdf59('0x8b'),'GROUP_CONCAT ASC':_0xdf59('0x5c'),'GROUP_CONCAT DESC':_0xdf59('0x5d')};var _0x30a9aa={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xdf59('0x5f'),'HOUR':_0xdf59('0x60'),'ROUND':_0xdf59('0x61'),'UNIX_TIMESTAMP':_0xdf59('0x62')};var _0xcb8deb=function(_0x1572d5){return!_[_0xdf59('0x63')]([_0xdf59('0x64'),_0xdf59('0x65'),_0xdf59('0x66'),_0xdf59('0x67')],_0x1572d5);};var _0x2a6693=function(_0x258ab5){if(!_0x258ab5||!_0x258ab5['rules'][_0xdf59('0x35')]){return'';}for(var _0x38921c='(',_0x3ce411=0x0;_0x3ce411<_0x258ab5['rules']['length'];_0x3ce411+=0x1){_0x3ce411>0x0&&(_0x38921c+='\x20'+_0x258ab5[_0xdf59('0x68')]+'\x20');_0x38921c+=_0x258ab5['rules'][_0x3ce411][_0xdf59('0x6a')]?_0x2a6693(_0x258ab5[_0xdf59('0x69')][_0x3ce411][_0xdf59('0x6a')]):_0x258ab5[_0xdf59('0x69')][_0x3ce411][_0xdf59('0x6b')]+'\x20'+_0x258ab5[_0xdf59('0x69')][_0x3ce411]['condition']+(_0xcb8deb(_0x258ab5[_0xdf59('0x69')][_0x3ce411][_0xdf59('0x6c')])?'\x20'+_0x258ab5[_0xdf59('0x69')][_0x3ce411]['value']:'');}return _0x38921c+')';};var _0x261e76={'where':{'id':_0x220077['id']}},_0x36d892,_0x2f3b36,_0x426f4d,_0x479018,_0x43d508;_0x261e76=_['merge']({},_0x261e76,_0x209de4);return db[_0xdf59('0x2d')][_0xdf59('0x4d')](_0x261e76)[_0xdf59('0x24')](function(_0x9fbc1a){if(_0x9fbc1a){_0x36d892=_0x9fbc1a;return _0x9fbc1a['getFields']();}return null;})[_0xdf59('0x24')](function(_0x325bf5){if(_0x325bf5){if(!_0x325bf5[_0xdf59('0x35')]){throw new db[(_0xdf59('0x6f'))][(_0xdf59('0x70'))](_0xdf59('0x71'),0x193);}_0x2f3b36=_0x325bf5;return db[_0xdf59('0x72')][_0xdf59('0x43')]({'raw':!![]});}return null;})[_0xdf59('0x24')](function(_0x210e83){if(_0x210e83){_0x426f4d=_[_0xdf59('0x73')](_0x210e83,'id');var _0x1eaa62;var _0x18694d=squel[_0xdf59('0x74')]();_0x18694d[_0xdf59('0x75')](_0x36d892[_0xdf59('0x8c')]);for(var _0x1d429e=0x0;_0x1d429e<_0x2f3b36[_0xdf59('0x35')];_0x1d429e+=0x1){_0x1eaa62=_0x2f3b36[_0x1d429e][_0xdf59('0x76')]?_0x426f4d[_0x2f3b36[_0x1d429e]['MetricId']][_0xdf59('0x77')]:_0x2f3b36[_0x1d429e]['field'];_0x1eaa62=_0x2f3b36[_0x1d429e]['function']?_[_0xdf59('0x79')](_0x4da39c[_0x2f3b36[_0x1d429e][_0xdf59('0x78')]],'%s',_0x1eaa62):_0x1eaa62;_0x1eaa62=_0x2f3b36[_0x1d429e][_0xdf59('0x7a')]?_[_0xdf59('0x79')](_0x30a9aa[_0x2f3b36[_0x1d429e][_0xdf59('0x7a')]],'%s',_0x1eaa62):_0x1eaa62;if(_0x2f3b36[_0x1d429e][_0xdf59('0x8d')]){_0x18694d[_0xdf59('0x6a')](_0x1eaa62);}_0x2f3b36[_0x1d429e]['orderBy']&&_0x18694d['order'](_0x1eaa62,_0x2f3b36[_0x1d429e][_0xdf59('0x7b')]===_0xdf59('0x7c')?![]:!![]);_0x18694d[_0xdf59('0x6b')](_0x1eaa62,_0x2f3b36[_0x1d429e][_0xdf59('0x7d')]||_0x1eaa62);}if(_0x36d892[_0xdf59('0x7e')]){_0x36d892['joins']=JSON['parse'](_0x36d892['joins']);for(var _0x5abb4c=0x0;_0x5abb4c<_0x36d892[_0xdf59('0x7e')][_0xdf59('0x35')];_0x5abb4c+=0x1){if(_0x36d892[_0xdf59('0x7e')][_0x5abb4c][_0xdf59('0x3e')]&&_[_0xdf59('0x63')](_0x54e0c4,_0x36d892['joins'][_0x5abb4c][_0xdf59('0x3e')])&&_0x36d892[_0xdf59('0x7e')][_0x5abb4c][_0xdf59('0x82')]&&_0x36d892['joins'][_0x5abb4c][_0xdf59('0x7f')]&&_0x36d892[_0xdf59('0x7e')][_0x5abb4c]['foreignKey']){_0x18694d[_0x36d892['joins'][_0x5abb4c][_0xdf59('0x3e')]](_0x36d892['joins'][_0x5abb4c][_0xdf59('0x7f')],null,util[_0xdf59('0x7a')](_0xdf59('0x81'),_0x36d892['table'],_0x36d892[_0xdf59('0x7e')][_0x5abb4c][_0xdf59('0x82')],_0x36d892['joins'][_0x5abb4c][_0xdf59('0x7f')],_0x36d892[_0xdf59('0x7e')][_0x5abb4c]['foreignKey']));}}}if(_0x36d892[_0xdf59('0x83')]){_0x36d892[_0xdf59('0x83')]=JSON['parse'](_0x36d892['conditions']);_0x18694d['where'](_0x2a6693(_0x36d892[_0xdf59('0x83')][_0xdf59('0x6a')]));}_0x43d508=_0x18694d['clone']();_0x18694d['limit'](_0x1ae19f);_0x18694d[_0xdf59('0x1b')](0x0);return;}})[_0xdf59('0x24')](function(){if(_0x544788[_0xdf59('0x8e')]===_0xdf59('0x8f')){return null;}var _0x1b6986=_[_0xdf59('0x3d')](_0x544788,{'name':_0x544788['fullPath']||_0x544788[_0xdf59('0x31')]||_0x36d892[_0xdf59('0x31')],'basename':_0xe9e66e,'savename':util[_0xdf59('0x7a')]('%s-%s.%s',_0x544788[_0xdf59('0x31')]||_0x36d892[_0xdf59('0x31')],require(_0xdf59('0x90'))[_0xdf59('0x91')](0x4),_0x544788['output']||'csv'),'reportId':_0x36d892['id'],'reportType':'custom'});return db[_0xdf59('0x92')][_0xdf59('0x48')](_0x1b6986,{'raw':!![]});})['then'](function(_0x45e014){if(_0x36d892['table']==='cdr'){_0x43d508[_0xdf59('0x39')](_0x36d892['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x544788[_0xdf59('0x93')],_0x544788[_0xdf59('0x94')]);}else{_0x43d508[_0xdf59('0x39')](_0x36d892[_0xdf59('0x8c')]+_0xdf59('0x95'),_0x544788[_0xdf59('0x93')],_0x544788[_0xdf59('0x94')]);}if(_0x45e014){logger[_0xdf59('0x96')](_0xdf59('0x97'),_0x43d508[_0xdf59('0x88')]());require('child_process')[_0xdf59('0x98')](path['join'](__dirname,_0xdf59('0x99'),_0x45e014['output']),[_0x45e014['id'],_0x43d508['toString'](),path['join'](__dirname,'../../files/reports',_0x45e014[_0xdf59('0x9a')]),_0xe9e66e]);return _0x45e014;}else{var _0x236212=squel[_0xdf59('0x74')]();_0x236212['from']('('+_0x43d508['toString']()+')',_0xdf59('0x9b'));_0x236212[_0xdf59('0x6b')](_0xdf59('0x9c'),_0xdf59('0x1e'));_0x43d508['limit'](_0x544788['limit']||_0x1ae19f);_0x43d508[_0xdf59('0x1b')](_0x544788[_0xdf59('0x1b')]||0x0);return dbH['sequelize'][_0xdf59('0x32')](_0x236212[_0xdf59('0x88')](),{'type':dbH[_0xdf59('0x89')][_0xdf59('0x8a')][_0xdf59('0x9d')]})[_0xdf59('0x24')](function(_0x34dba8){if(!_0x34dba8[_0xdf59('0x35')]){_0x479018=0x0;}else{_0x479018=_0x34dba8[0x0][_0xdf59('0x1e')]||0x0;}return dbH['sequelize'][_0xdf59('0x32')](_0x43d508[_0xdf59('0x88')](),{'type':dbH[_0xdf59('0x89')][_0xdf59('0x8a')][_0xdf59('0x9d')]});})['then'](function(_0x1cbd77){return{'rows':_0x1cbd77||[],'count':_0x479018};});}});}exports[_0xdf59('0x9e')]=function(_0x4ba243,_0x5f1d9a){return runReport(_0x4ba243[_0xdf59('0x45')],_0x4ba243[_0xdf59('0x32')],_0x4ba243[_0xdf59('0x40')])['then'](respondWithResult(_0x5f1d9a,null))['catch'](handleError(_0x5f1d9a,null));};exports[_0xdf59('0x9f')]=runReport;exports[_0xdf59('0x32')]=function(_0x3759c8,_0x2af8d8){var _0x283a95=0xa;var _0x4f1352=['join',_0xdf59('0x53'),_0xdf59('0x54'),'cross_join'];var _0x35c890={'SUM':_0xdf59('0x56'),'COUNT':_0xdf59('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xdf59('0x5a'),'AVG':_0xdf59('0x5b'),'GROUP_CONCAT':_0xdf59('0x8b'),'GROUP_CONCAT ASC':_0xdf59('0x5c'),'GROUP_CONCAT DESC':_0xdf59('0x5d')};var _0x55ba1f={'SEC_TO_TIME':_0xdf59('0x5e'),'DATE':_0xdf59('0x5f'),'HOUR':_0xdf59('0x60'),'ROUND':_0xdf59('0x61'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2e7a0a=function(_0x197ad4){return!_[_0xdf59('0x63')]([_0xdf59('0x64'),_0xdf59('0x65'),'IS\x20EMPTY',_0xdf59('0x67')],_0x197ad4);};var _0x5d02ed=function(_0x344823){if(!_0x344823||!_0x344823[_0xdf59('0x69')]['length']){return'';}for(var _0x6ff095='(',_0x4fe0e5=0x0;_0x4fe0e5<_0x344823[_0xdf59('0x69')][_0xdf59('0x35')];_0x4fe0e5+=0x1){_0x4fe0e5>0x0&&(_0x6ff095+='\x20'+_0x344823[_0xdf59('0x68')]+'\x20');_0x6ff095+=_0x344823[_0xdf59('0x69')][_0x4fe0e5][_0xdf59('0x6a')]?_0x5d02ed(_0x344823['rules'][_0x4fe0e5][_0xdf59('0x6a')]):_0x344823[_0xdf59('0x69')][_0x4fe0e5][_0xdf59('0x6b')]+'\x20'+_0x344823['rules'][_0x4fe0e5][_0xdf59('0x6c')]+(_0x2e7a0a(_0x344823[_0xdf59('0x69')][_0x4fe0e5][_0xdf59('0x6c')])?'\x20'+_0x344823[_0xdf59('0x69')][_0x4fe0e5]['value']:'');}return _0x6ff095+')';};var _0x2df7c9={'where':{'id':_0x3759c8[_0xdf59('0x45')]['id']}},_0x470593,_0x56c310,_0x13c935,_0x3eb45d,_0x1f08f7;_0x2df7c9=_[_0xdf59('0x3d')]({},_0x2df7c9,_0x3759c8[_0xdf59('0x40')]);return db[_0xdf59('0x2d')][_0xdf59('0x4d')](_0x2df7c9)[_0xdf59('0x24')](function(_0x3939f0){if(_0x3939f0){_0x470593=_0x3939f0;return _0x3939f0['getFields']();}return null;})[_0xdf59('0x24')](function(_0x3e5438){if(_0x3e5438){if(!_0x3e5438['length']){throw new db['Sequelize'][(_0xdf59('0x70'))](_0xdf59('0x71'),0x193);}_0x56c310=_0x3e5438;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xdf59('0x24')](function(_0x5147b6){if(_0x5147b6){_0x13c935=_['keyBy'](_0x5147b6,'id');var _0x17ead1;var _0xaab3f4=squel[_0xdf59('0x74')]();_0xaab3f4['from'](_0x470593[_0xdf59('0x8c')]);for(var _0x5db8be=0x0;_0x5db8be<_0x56c310[_0xdf59('0x35')];_0x5db8be+=0x1){_0x17ead1=_0x56c310[_0x5db8be][_0xdf59('0x76')]?_0x13c935[_0x56c310[_0x5db8be][_0xdf59('0x76')]][_0xdf59('0x77')]:_0x56c310[_0x5db8be]['field'];_0x17ead1=_0x56c310[_0x5db8be][_0xdf59('0x78')]?_[_0xdf59('0x79')](_0x35c890[_0x56c310[_0x5db8be][_0xdf59('0x78')]],'%s',_0x17ead1):_0x17ead1;_0x17ead1=_0x56c310[_0x5db8be]['format']?_['replace'](_0x55ba1f[_0x56c310[_0x5db8be][_0xdf59('0x7a')]],'%s',_0x17ead1):_0x17ead1;if(_0x56c310[_0x5db8be][_0xdf59('0x8d')]){_0xaab3f4[_0xdf59('0x6a')](_0x17ead1);}_0x56c310[_0x5db8be]['orderBy']&&_0xaab3f4[_0xdf59('0x37')](_0x17ead1,_0x56c310[_0x5db8be][_0xdf59('0x7b')]==='DESC'?![]:!![]);_0xaab3f4['field'](_0x17ead1,_0x56c310[_0x5db8be]['alias']||_0x17ead1);}if(_0x470593['joins']){_0x470593[_0xdf59('0x7e')]=JSON[_0xdf59('0x84')](_0x470593[_0xdf59('0x7e')]);for(var _0x309b74=0x0;_0x309b74<_0x470593[_0xdf59('0x7e')]['length'];_0x309b74+=0x1){if(_0x470593[_0xdf59('0x7e')][_0x309b74][_0xdf59('0x3e')]&&_['includes'](_0x4f1352,_0x470593['joins'][_0x309b74][_0xdf59('0x3e')])&&_0x470593['joins'][_0x309b74][_0xdf59('0x82')]&&_0x470593[_0xdf59('0x7e')][_0x309b74][_0xdf59('0x7f')]&&_0x470593[_0xdf59('0x7e')][_0x309b74]['foreignKey']){_0xaab3f4[_0x470593[_0xdf59('0x7e')][_0x309b74][_0xdf59('0x3e')]](_0x470593[_0xdf59('0x7e')][_0x309b74][_0xdf59('0x7f')],null,util[_0xdf59('0x7a')](_0xdf59('0x81'),_0x470593[_0xdf59('0x8c')],_0x470593[_0xdf59('0x7e')][_0x309b74][_0xdf59('0x82')],_0x470593[_0xdf59('0x7e')][_0x309b74][_0xdf59('0x7f')],_0x470593['joins'][_0x309b74]['foreignKey']));}}}if(_0x470593['conditions']){_0x470593[_0xdf59('0x83')]=JSON[_0xdf59('0x84')](_0x470593[_0xdf59('0x83')]);_0xaab3f4[_0xdf59('0x39')](_0x5d02ed(_0x470593[_0xdf59('0x83')][_0xdf59('0x6a')]));}_0x1f08f7=_0xaab3f4[_0xdf59('0x85')]();_0xaab3f4['limit'](_0x283a95);_0xaab3f4['offset'](0x0);logger[_0xdf59('0x86')](_0xdf59('0x87'),_0xaab3f4[_0xdf59('0x88')]());return dbH[_0xdf59('0x89')][_0xdf59('0x32')](_0xaab3f4[_0xdf59('0x88')](),{'type':dbH[_0xdf59('0x89')]['QueryTypes'][_0xdf59('0x9d')]});}})[_0xdf59('0x24')](function(){return{'sql':_0x1f08f7[_0xdf59('0x88')]()};})[_0xdf59('0x24')](respondWithResult(_0x2af8d8,null))[_0xdf59('0x44')](handleError(_0x2af8d8,null));};
\ No newline at end of file
index 3282f50..b7e14a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5573=['define','analytics_custom_reports','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports'];(function(_0x3a2726,_0xe56bc6){var _0x19e02b=function(_0x34797a){while(--_0x34797a){_0x3a2726['push'](_0x3a2726['shift']());}};_0x19e02b(++_0xe56bc6);}(_0x5573,0x9e));var _0x3557=function(_0x5ac0f0,_0xee4d98){_0x5ac0f0=_0x5ac0f0-0x0;var _0x4aceec=_0x5573[_0x5ac0f0];return _0x4aceec;};'use strict';var _=require(_0x3557('0x0'));var util=require('util');var logger=require(_0x3557('0x1'))(_0x3557('0x2'));var moment=require(_0x3557('0x3'));var BPromise=require(_0x3557('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3557('0x5'));var rimraf=require(_0x3557('0x6'));var config=require(_0x3557('0x7'));var attributes=require(_0x3557('0x8'));module[_0x3557('0x9')]=function(_0x27ac04,_0x4509ed){return _0x27ac04[_0x3557('0xa')]('AnalyticCustomReport',attributes,{'tableName':_0x3557('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb6f9=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash'];(function(_0x518b32,_0x4d195d){var _0x50c532=function(_0x265207){while(--_0x265207){_0x518b32['push'](_0x518b32['shift']());}};_0x50c532(++_0x4d195d);}(_0xb6f9,0x103));var _0x9b6f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb6f9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9b6f('0x0'));var util=require(_0x9b6f('0x1'));var logger=require(_0x9b6f('0x2'))(_0x9b6f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9b6f('0x4'));var fs=require('fs');var path=require(_0x9b6f('0x5'));var rimraf=require(_0x9b6f('0x6'));var config=require(_0x9b6f('0x7'));var attributes=require(_0x9b6f('0x8'));module[_0x9b6f('0x9')]=function(_0x3eb125,_0x65916a){return _0x3eb125[_0x9b6f('0xa')](_0x9b6f('0xb'),attributes,{'tableName':_0x9b6f('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1e416a5..e893630 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4909=['http','request','then','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3b81eb,_0x175f32){var _0x149491=function(_0x454753){while(--_0x454753){_0x3b81eb['push'](_0x3b81eb['shift']());}};_0x149491(++_0x175f32);}(_0x4909,0x19b));var _0x9490=function(_0xd3e0b9,_0xd80d4d){_0xd3e0b9=_0xd3e0b9-0x0;var _0x470133=_0x4909[_0xd3e0b9];return _0x470133;};'use strict';var _=require(_0x9490('0x0'));var util=require(_0x9490('0x1'));var moment=require('moment');var BPromise=require(_0x9490('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9490('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9490('0x4'))(_0x9490('0x5'));var config=require(_0x9490('0x6'));var jayson=require(_0x9490('0x7'));var client=jayson[_0x9490('0x8')][_0x9490('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x226371,_0x3628bf,_0x3d0655){return new BPromise(function(_0x2cca9e,_0x1f5382){return client[_0x9490('0xa')](_0x226371,_0x3d0655)[_0x9490('0xb')](function(_0x37b268){logger['info'](_0x9490('0xc'),_0x3628bf,'request\x20sent');logger[_0x9490('0xd')](_0x9490('0xe'),_0x3628bf,_0x9490('0xf'),JSON['stringify'](_0x37b268));if(_0x37b268[_0x9490('0x10')]){if(_0x37b268[_0x9490('0x10')][_0x9490('0x11')]===0x1f4){logger[_0x9490('0x10')](_0x9490('0xc'),_0x3628bf,_0x37b268[_0x9490('0x10')]['message']);return _0x1f5382(_0x37b268[_0x9490('0x10')][_0x9490('0x12')]);}logger['error'](_0x9490('0xc'),_0x3628bf,_0x37b268[_0x9490('0x10')][_0x9490('0x12')]);return _0x2cca9e(_0x37b268[_0x9490('0x10')][_0x9490('0x12')]);}else{logger['info'](_0x9490('0xc'),_0x3628bf,'request\x20sent');_0x2cca9e(_0x37b268['result']['message']);}})[_0x9490('0x13')](function(_0x3794f2){logger[_0x9490('0x10')](_0x9490('0xc'),_0x3628bf,_0x3794f2);_0x1f5382(_0x3794f2);});});}
\ No newline at end of file
+var _0x43cd=['request','then','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','AnalyticCustomReport,\x20%s,\x20%s','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x43cd,0x75));var _0xd43c=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x43cd[_0x5b561d];return _0x431060;};'use strict';var _=require(_0xd43c('0x0'));var util=require(_0xd43c('0x1'));var moment=require('moment');var BPromise=require(_0xd43c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd43c('0x3'));var db=require(_0xd43c('0x4'))['db'];var utils=require(_0xd43c('0x5'));var logger=require('../../config/logger')(_0xd43c('0x6'));var config=require('../../config/environment');var jayson=require(_0xd43c('0x7'));var client=jayson['client'][_0xd43c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x184f58,_0x3eb689,_0x25f32f){return new BPromise(function(_0xb72186,_0x5917a4){return client[_0xd43c('0x9')](_0x184f58,_0x25f32f)[_0xd43c('0xa')](function(_0x8c14a4){logger[_0xd43c('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0x3eb689,_0xd43c('0xc'));logger[_0xd43c('0xd')](_0xd43c('0xe'),_0x3eb689,_0xd43c('0xc'),JSON['stringify'](_0x8c14a4));if(_0x8c14a4[_0xd43c('0xf')]){if(_0x8c14a4[_0xd43c('0xf')][_0xd43c('0x10')]===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x3eb689,_0x8c14a4[_0xd43c('0xf')]['message']);return _0x5917a4(_0x8c14a4[_0xd43c('0xf')][_0xd43c('0x11')]);}logger[_0xd43c('0xf')](_0xd43c('0x12'),_0x3eb689,_0x8c14a4['error'][_0xd43c('0x11')]);return _0xb72186(_0x8c14a4['error'][_0xd43c('0x11')]);}else{logger[_0xd43c('0xb')](_0xd43c('0x12'),_0x3eb689,_0xd43c('0xc'));_0xb72186(_0x8c14a4[_0xd43c('0x13')]['message']);}})[_0xd43c('0x14')](function(_0x3cb654){logger['error'](_0xd43c('0x12'),_0x3eb689,_0x3cb654);_0x5917a4(_0x3cb654);});});}
\ No newline at end of file
index 09f9498..2a8a31b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8343=['path','express','fs-extra','./analyticCustomReport.controller','get','isAuthenticated','/:id','show','preview','/:id/run','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x4e8ea1,_0x3aaf22){var _0x435985=function(_0x237632){while(--_0x237632){_0x4e8ea1['push'](_0x4e8ea1['shift']());}};_0x435985(++_0x3aaf22);}(_0x8343,0xa9));var _0x3834=function(_0x393801,_0x47d092){_0x393801=_0x393801-0x0;var _0x5a5859=_0x8343[_0x393801];return _0x5a5859;};'use strict';var multer=require(_0x3834('0x0'));var util=require(_0x3834('0x1'));var path=require(_0x3834('0x2'));var timeout=require('connect-timeout');var express=require(_0x3834('0x3'));var router=express['Router']();var fs_extra=require(_0x3834('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3834('0x5'));router[_0x3834('0x6')]('/',auth[_0x3834('0x7')](),controller['index']);router[_0x3834('0x6')](_0x3834('0x8'),auth[_0x3834('0x7')](),controller[_0x3834('0x9')]);router['get']('/:id/preview',auth[_0x3834('0x7')](),controller[_0x3834('0xa')]);router[_0x3834('0x6')](_0x3834('0xb'),auth[_0x3834('0x7')](),controller['run']);router[_0x3834('0x6')]('/:id/query',auth['isAuthenticated'](),controller['query']);router[_0x3834('0xc')]('/',auth[_0x3834('0x7')](),controller[_0x3834('0xd')]);router[_0x3834('0xe')](_0x3834('0x8'),auth[_0x3834('0x7')](),controller[_0x3834('0xf')]);router[_0x3834('0x10')](_0x3834('0x8'),auth[_0x3834('0x7')](),controller[_0x3834('0x11')]);module[_0x3834('0x12')]=router;
\ No newline at end of file
+var _0x8920=['../../config/environment','isAuthenticated','show','/:id/preview','preview','get','/:id/run','run','/:id/query','create','put','/:id','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x2b59b1,_0x230ab0){var _0x57ef25=function(_0x3f3a61){while(--_0x3f3a61){_0x2b59b1['push'](_0x2b59b1['shift']());}};_0x57ef25(++_0x230ab0);}(_0x8920,0x176));var _0x0892=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8920[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x0892('0x0'));var util=require(_0x0892('0x1'));var path=require('path');var timeout=require(_0x0892('0x2'));var express=require(_0x0892('0x3'));var router=express[_0x0892('0x4')]();var fs_extra=require(_0x0892('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0892('0x6'));var controller=require('./analyticCustomReport.controller');router['get']('/',auth[_0x0892('0x7')](),controller['index']);router['get']('/:id',auth[_0x0892('0x7')](),controller[_0x0892('0x8')]);router['get'](_0x0892('0x9'),auth[_0x0892('0x7')](),controller[_0x0892('0xa')]);router[_0x0892('0xb')](_0x0892('0xc'),auth[_0x0892('0x7')](),controller[_0x0892('0xd')]);router['get'](_0x0892('0xe'),auth['isAuthenticated'](),controller['query']);router['post']('/',auth[_0x0892('0x7')](),controller[_0x0892('0xf')]);router[_0x0892('0x10')](_0x0892('0x11'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x0892('0x11'),auth['isAuthenticated'](),controller[_0x0892('0x12')]);module[_0x0892('0x13')]=router;
\ No newline at end of file
index 3bd6c97..01f13ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['STRING','TEXT','sequelize'];(function(_0xcd2f67,_0x2c91f5){var _0x52bef0=function(_0x4a6be2){while(--_0x4a6be2){_0xcd2f67['push'](_0xcd2f67['shift']());}};_0x52bef0(++_0x2c91f5);}(_0x326f,0xd1));var _0xf326=function(_0x34259e,_0x2e94b4){_0x34259e=_0x34259e-0x0;var _0x522001=_0x326f[_0x34259e];return _0x522001;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xf326('0x1')]},'parent':{'type':Sequelize[_0xf326('0x1')]},'table':{'type':Sequelize[_0xf326('0x1')]},'conditions':{'type':Sequelize[_0xf326('0x2')]},'joins':{'type':Sequelize[_0xf326('0x2')]}};
\ No newline at end of file
+var _0x5fab=['exports','STRING','TEXT','sequelize'];(function(_0x44ba19,_0x4f829d){var _0x56f6ee=function(_0xf692b8){while(--_0xf692b8){_0x44ba19['push'](_0x44ba19['shift']());}};_0x56f6ee(++_0x4f829d);}(_0x5fab,0x177));var _0xb5fa=function(_0x34ad17,_0x246dce){_0x34ad17=_0x34ad17-0x0;var _0x3dc241=_0x5fab[_0x34ad17];return _0x3dc241;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb5fa('0x2')]},'parent':{'type':Sequelize[_0xb5fa('0x2')]},'table':{'type':Sequelize[_0xb5fa('0x2')]},'conditions':{'type':Sequelize[_0xb5fa('0x3')]},'joins':{'type':Sequelize[_0xb5fa('0x3')]}};
\ No newline at end of file
index bb03efa..0b401df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f8a=['get','DefaultReports','end','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','key','keys','intersection','model','attributes','fields','query','order','sort','filters','pick','filter','merge','VIRTUAL','options','where','include','findAll','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','length','operator','group','field','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','Limited\x20Query:','sequelize','toString','SELECT','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NULL','condition','ValidationErrorItem','metric','DESC','clone','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)','QueryTypes','run','runReport','%s.%s\x20=\x20%s.%s','debug','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','then'];(function(_0xd6cf90,_0xc194e){var _0x57dd25=function(_0x4778cc){while(--_0x4778cc){_0xd6cf90['push'](_0xd6cf90['shift']());}};_0x57dd25(++_0xc194e);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x13b5d4,_0x1c2f9d){_0x13b5d4=_0x13b5d4-0x0;var _0x1736df=_0x3f8a[_0x13b5d4];return _0x1736df;};'use strict';var emlformat=require(_0xa3f8('0x0'));var rimraf=require(_0xa3f8('0x1'));var zipdir=require(_0xa3f8('0x2'));var jsonpatch=require(_0xa3f8('0x3'));var rp=require('request-promise');var moment=require(_0xa3f8('0x4'));var BPromise=require(_0xa3f8('0x5'));var Mustache=require(_0xa3f8('0x6'));var util=require(_0xa3f8('0x7'));var path=require(_0xa3f8('0x8'));var sox=require(_0xa3f8('0x9'));var csv=require(_0xa3f8('0xa'));var ejs=require(_0xa3f8('0xb'));var fs=require('fs');var fs_extra=require(_0xa3f8('0xc'));var _=require(_0xa3f8('0xd'));var squel=require(_0xa3f8('0xe'));var crypto=require(_0xa3f8('0xf'));var jsforce=require(_0xa3f8('0x10'));var deskjs=require(_0xa3f8('0x11'));var toCsv=require(_0xa3f8('0xa'));var querystring=require(_0xa3f8('0x12'));var Papa=require(_0xa3f8('0x13'));var Redis=require('ioredis');var authService=require(_0xa3f8('0x14'));var qs=require(_0xa3f8('0x15'));var as=require(_0xa3f8('0x16'));var hardwareService=require(_0xa3f8('0x17'));var logger=require('../../config/logger')(_0xa3f8('0x18'));var utils=require(_0xa3f8('0x19'));var config=require(_0xa3f8('0x1a'));var licenseUtil=require(_0xa3f8('0x1b'));var db=require(_0xa3f8('0x1c'))['db'];var dbH=require(_0xa3f8('0x1c'))[_0xa3f8('0x1d')];function respondWithStatusCode(_0x63de8b,_0x324aa8){_0x324aa8=_0x324aa8||0xcc;return function(_0x36b1b8){if(_0x36b1b8){return _0x63de8b[_0xa3f8('0x1e')](_0x324aa8);}return _0x63de8b[_0xa3f8('0x1f')](_0x324aa8)['end']();};}function respondWithResult(_0x2d8f74,_0xe55848){_0xe55848=_0xe55848||0xc8;return function(_0x45014f){if(_0x45014f){return _0x2d8f74[_0xa3f8('0x1f')](_0xe55848)['json'](_0x45014f);}};}function respondWithFilteredResult(_0x39c450,_0x33b98e){return function(_0x46a8d9){if(_0x46a8d9){var _0x8cd130=typeof _0x33b98e[_0xa3f8('0x20')]===_0xa3f8('0x21')&&typeof _0x33b98e[_0xa3f8('0x22')]===_0xa3f8('0x21');var _0x2cb49f=_0x46a8d9[_0xa3f8('0x23')];var _0x54b870=_0x8cd130?0x0:_0x33b98e[_0xa3f8('0x20')];var _0x5a0e18=_0x8cd130?_0x46a8d9[_0xa3f8('0x23')]:_0x33b98e[_0xa3f8('0x20')]+_0x33b98e[_0xa3f8('0x22')];var _0x46042d;if(_0x5a0e18>=_0x2cb49f){_0x5a0e18=_0x2cb49f;_0x46042d=0xc8;}else{_0x46042d=0xce;}_0x39c450['status'](_0x46042d);return _0x39c450[_0xa3f8('0x24')]('Content-Range',_0x54b870+'-'+_0x5a0e18+'/'+_0x2cb49f)[_0xa3f8('0x25')](_0x46a8d9);}return null;};}function patchUpdates(_0x58336d){return function(_0x4066bb){try{jsonpatch[_0xa3f8('0x26')](_0x4066bb,_0x58336d,!![]);}catch(_0x353daa){return BPromise[_0xa3f8('0x27')](_0x353daa);}return _0x4066bb[_0xa3f8('0x28')]();};}function saveUpdates(_0x1e5f30,_0x187352){return function(_0x490717){if(_0x490717){return _0x490717[_0xa3f8('0x29')](_0x1e5f30)['then'](function(_0x3ce57b){return _0x3ce57b;});}return null;};}function removeEntity(_0xa5a697,_0x24985a){return function(_0x37b290){if(_0x37b290){return _0x37b290[_0xa3f8('0x2a')]()[_0xa3f8('0x2b')](function(){var _0x6e3cb4=_0x37b290[_0xa3f8('0x2c')]({'plain':!![]});var _0x1e22b8=_0xa3f8('0x2d');return db['UserProfileResource'][_0xa3f8('0x2a')]({'where':{'type':_0x1e22b8,'resourceId':_0x6e3cb4['id']}})[_0xa3f8('0x2b')](function(){return _0x37b290;});})[_0xa3f8('0x2b')](function(){_0xa5a697['status'](0xcc)[_0xa3f8('0x2e')]();});}};}function handleEntityNotFound(_0x57f6be,_0xbad6a6){return function(_0x3a3746){if(!_0x3a3746){_0x57f6be[_0xa3f8('0x1e')](0x194);}return _0x3a3746;};}function handleError(_0x4ea213,_0x458824){_0x458824=_0x458824||0x1f4;return function(_0x5e69e2){logger[_0xa3f8('0x2f')](_0x5e69e2[_0xa3f8('0x30')]);if(_0x5e69e2[_0xa3f8('0x31')]){delete _0x5e69e2[_0xa3f8('0x31')];}_0x4ea213[_0xa3f8('0x1f')](_0x458824)[_0xa3f8('0x32')](_0x5e69e2);};}exports[_0xa3f8('0x33')]=function(_0x424a3e,_0x25f9f5){var _0x290a4e={},_0x6e83b0={},_0x57c465={'count':0x0,'rows':[]};var _0x4404da=_[_0xa3f8('0x34')](db[_0xa3f8('0x35')][_0xa3f8('0x36')],function(_0x3bb4b0){return{'name':_0x3bb4b0['fieldName'],'type':_0x3bb4b0[_0xa3f8('0x37')][_0xa3f8('0x38')]};});_0x6e83b0['model']=_[_0xa3f8('0x34')](_0x4404da,_0xa3f8('0x31'));_0x6e83b0['query']=_[_0xa3f8('0x39')](_0x424a3e['query']);_0x6e83b0['filters']=_[_0xa3f8('0x3a')](_0x6e83b0[_0xa3f8('0x3b')],_0x6e83b0['query']);_0x290a4e[_0xa3f8('0x3c')]=_['intersection'](_0x6e83b0[_0xa3f8('0x3b')],qs[_0xa3f8('0x3d')](_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x3d')]));_0x290a4e['attributes']=_0x290a4e[_0xa3f8('0x3c')]['length']?_0x290a4e[_0xa3f8('0x3c')]:_0x6e83b0['model'];if(!_0x424a3e[_0xa3f8('0x3e')]['hasOwnProperty']('nolimit')){_0x290a4e['limit']=qs[_0xa3f8('0x22')](_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x22')]);_0x290a4e[_0xa3f8('0x20')]=qs['offset'](_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x20')]);}_0x290a4e[_0xa3f8('0x3f')]=qs[_0xa3f8('0x40')](_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x40')]);_0x290a4e['where']=qs[_0xa3f8('0x41')](_[_0xa3f8('0x42')](_0x424a3e[_0xa3f8('0x3e')],_0x6e83b0['filters']),_0x4404da);if(_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x43')]){_0x290a4e['where']=_[_0xa3f8('0x44')](_0x290a4e['where'],{'$or':_[_0xa3f8('0x34')](_0x4404da,function(_0x5a077c){if(_0x5a077c[_0xa3f8('0x37')]!==_0xa3f8('0x45')){var _0x9a00e7={};_0x9a00e7[_0x5a077c[_0xa3f8('0x31')]]={'$like':'%'+_0x424a3e[_0xa3f8('0x3e')]['filter']+'%'};return _0x9a00e7;}})});}_0x290a4e=_[_0xa3f8('0x44')]({},_0x290a4e,_0x424a3e[_0xa3f8('0x46')]);var _0x4db9c5={'where':_0x290a4e[_0xa3f8('0x47')]};return db['AnalyticDefaultReport'][_0xa3f8('0x23')](_0x4db9c5)[_0xa3f8('0x2b')](function(_0x1542cc){_0x57c465[_0xa3f8('0x23')]=_0x1542cc;if(_0x424a3e[_0xa3f8('0x3e')]['includeAll']){_0x290a4e[_0xa3f8('0x48')]=[{'all':!![]}];}return db[_0xa3f8('0x35')][_0xa3f8('0x49')](_0x290a4e);})[_0xa3f8('0x2b')](function(_0x337808){_0x57c465['rows']=_0x337808;return _0x57c465;})[_0xa3f8('0x2b')](respondWithFilteredResult(_0x25f9f5,_0x290a4e))[_0xa3f8('0x4a')](handleError(_0x25f9f5,null));};exports[_0xa3f8('0x4b')]=function(_0x32e371,_0x2a124b){var _0x314dba={'raw':!![],'where':{'id':_0x32e371[_0xa3f8('0x4c')]['id']}},_0x497217={};_0x497217[_0xa3f8('0x3b')]=_[_0xa3f8('0x39')](db[_0xa3f8('0x35')][_0xa3f8('0x36')]);_0x497217[_0xa3f8('0x3e')]=_['keys'](_0x32e371['query']);_0x497217['filters']=_[_0xa3f8('0x3a')](_0x497217[_0xa3f8('0x3b')],_0x497217[_0xa3f8('0x3e')]);_0x314dba[_0xa3f8('0x3c')]=_[_0xa3f8('0x3a')](_0x497217[_0xa3f8('0x3b')],qs['fields'](_0x32e371[_0xa3f8('0x3e')][_0xa3f8('0x3d')]));_0x314dba[_0xa3f8('0x3c')]=_0x314dba[_0xa3f8('0x3c')]['length']?_0x314dba[_0xa3f8('0x3c')]:_0x497217[_0xa3f8('0x3b')];if(_0x32e371[_0xa3f8('0x3e')]['includeAll']){_0x314dba['include']=[{'all':!![]}];}_0x314dba=_['merge']({},_0x314dba,_0x32e371[_0xa3f8('0x46')]);return db[_0xa3f8('0x35')]['find'](_0x314dba)[_0xa3f8('0x2b')](handleEntityNotFound(_0x2a124b,null))[_0xa3f8('0x2b')](respondWithResult(_0x2a124b,null))[_0xa3f8('0x4a')](handleError(_0x2a124b,null));};exports[_0xa3f8('0x4d')]=function(_0x14932f,_0x3c74b5){return db[_0xa3f8('0x35')][_0xa3f8('0x4d')](_0x14932f[_0xa3f8('0x4e')],{})[_0xa3f8('0x2b')](function(_0x338554){var _0x29d8f5=_0x14932f[_0xa3f8('0x4f')][_0xa3f8('0x2c')]({'plain':!![]});if(!_0x29d8f5)throw new Error(_0xa3f8('0x50'));if(_0x29d8f5[_0xa3f8('0x51')]===_0xa3f8('0x4f')){var _0x559ae7=_0x338554['get']({'plain':!![]});var _0x1fad80=_0xa3f8('0x52');return db['UserProfileSection'][_0xa3f8('0x53')]({'where':{'name':_0x1fad80,'userProfileId':_0x29d8f5[_0xa3f8('0x54')]},'raw':!![]})[_0xa3f8('0x2b')](function(_0xaff79b){if(_0xaff79b&&_0xaff79b[_0xa3f8('0x55')]===0x0){return db[_0xa3f8('0x56')][_0xa3f8('0x4d')]({'name':_0x559ae7[_0xa3f8('0x31')],'resourceId':_0x559ae7['id'],'type':_0xa3f8('0x2d'),'sectionId':_0xaff79b['id']},{})[_0xa3f8('0x2b')](function(){return _0x338554;});}else{return _0x338554;}})[_0xa3f8('0x4a')](function(_0x3752fa){logger[_0xa3f8('0x2f')](_0xa3f8('0x57'),_0x3752fa);throw _0x3752fa;});}return _0x338554;})[_0xa3f8('0x2b')](respondWithResult(_0x3c74b5,0xc9))[_0xa3f8('0x4a')](handleError(_0x3c74b5,null));};exports['update']=function(_0x593614,_0xd0628e){if(_0x593614['body']['id']){delete _0x593614[_0xa3f8('0x4e')]['id'];}return db[_0xa3f8('0x35')][_0xa3f8('0x53')]({'where':{'id':_0x593614['params']['id']}})[_0xa3f8('0x2b')](handleEntityNotFound(_0xd0628e,null))[_0xa3f8('0x2b')](saveUpdates(_0x593614[_0xa3f8('0x4e')],null))[_0xa3f8('0x2b')](respondWithResult(_0xd0628e,null))['catch'](handleError(_0xd0628e,null));};exports[_0xa3f8('0x2a')]=function(_0x47cc0c,_0x392e1e){return db[_0xa3f8('0x35')][_0xa3f8('0x53')]({'where':{'id':_0x47cc0c['params']['id']}})['then'](handleEntityNotFound(_0x392e1e,null))[_0xa3f8('0x2b')](removeEntity(_0x392e1e,null))[_0xa3f8('0x4a')](handleError(_0x392e1e,null));};exports[_0xa3f8('0x58')]=function(_0x6ad40a,_0x48f5a6){var _0x36eac9=0xa;var _0x3478e8=[_0xa3f8('0x59'),_0xa3f8('0x5a'),_0xa3f8('0x5b'),'cross_join'];var _0x5d7877={'SUM':_0xa3f8('0x5c'),'COUNT':_0xa3f8('0x5d'),'COUNT DISTINCT':_0xa3f8('0x5e'),'MAX':_0xa3f8('0x5f'),'MIN':_0xa3f8('0x60'),'AVG':_0xa3f8('0x61'),'GROUP_CONCAT':_0xa3f8('0x62'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x521719={'SEC_TO_TIME':_0xa3f8('0x63'),'DATE':_0xa3f8('0x64'),'HOUR':_0xa3f8('0x65'),'ROUND':_0xa3f8('0x66'),'UNIX_TIMESTAMP':_0xa3f8('0x67')};var _0x27de61=function(_0x356643){return!_[_0xa3f8('0x68')](['IS\x20NULL',_0xa3f8('0x69'),_0xa3f8('0x6a'),_0xa3f8('0x6b')],_0x356643);};var _0x42e3f8=function(_0x27c5aa){if(!_0x27c5aa||!_0x27c5aa[_0xa3f8('0x6c')][_0xa3f8('0x6d')]){return'';}for(var _0x4d0404='(',_0x33ea06=0x0;_0x33ea06<_0x27c5aa[_0xa3f8('0x6c')]['length'];_0x33ea06+=0x1){_0x33ea06>0x0&&(_0x4d0404+='\x20'+_0x27c5aa[_0xa3f8('0x6e')]+'\x20');_0x4d0404+=_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06][_0xa3f8('0x6f')]?_0x42e3f8(_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06][_0xa3f8('0x6f')]):_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06][_0xa3f8('0x70')]+'\x20'+_0x27c5aa['rules'][_0x33ea06]['condition']+(_0x27de61(_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06]['condition'])?'\x20'+_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06][_0xa3f8('0x71')]:'');}return _0x4d0404+')';};var _0x3ff369={'where':{'id':_0x6ad40a[_0xa3f8('0x4c')]['id']}},_0x1dba7e,_0x452e99,_0x35d4d6,_0xeca2dc,_0x14508d;_0x3ff369=_[_0xa3f8('0x44')]({},_0x3ff369,_0x6ad40a[_0xa3f8('0x46')]);return db[_0xa3f8('0x35')][_0xa3f8('0x53')](_0x3ff369)['then'](function(_0x5efdcf){if(_0x5efdcf){_0x1dba7e=_0x5efdcf;return _0x5efdcf[_0xa3f8('0x72')]();}return null;})[_0xa3f8('0x2b')](function(_0x1688ca){if(_0x1688ca){if(!_0x1688ca[_0xa3f8('0x6d')]){throw new db[(_0xa3f8('0x73'))]['ValidationErrorItem'](_0xa3f8('0x74'),0x193);}_0x452e99=_0x1688ca;return db[_0xa3f8('0x75')][_0xa3f8('0x49')]({'raw':!![]});}return null;})[_0xa3f8('0x2b')](function(_0x28d359){if(_0x28d359){_0x35d4d6=_[_0xa3f8('0x76')](_0x28d359,'id');var _0x3d45ae;var _0x3a2362=squel[_0xa3f8('0x77')]();_0x3a2362[_0xa3f8('0x78')](_0x1dba7e[_0xa3f8('0x79')]);for(var _0x5d4fe5=0x0;_0x5d4fe5<_0x452e99[_0xa3f8('0x6d')];_0x5d4fe5+=0x1){_0x3d45ae=_0x452e99[_0x5d4fe5][_0xa3f8('0x7a')]?_0x35d4d6[_0x452e99[_0x5d4fe5]['MetricId']]['metric']:_0x452e99[_0x5d4fe5][_0xa3f8('0x70')];_0x3d45ae=_0x452e99[_0x5d4fe5][_0xa3f8('0x7b')]?_[_0xa3f8('0x7c')](_0x5d7877[_0x452e99[_0x5d4fe5][_0xa3f8('0x7b')]],'%s',_0x3d45ae):_0x3d45ae;_0x3d45ae=_0x452e99[_0x5d4fe5][_0xa3f8('0x7d')]?_[_0xa3f8('0x7c')](_0x521719[_0x452e99[_0x5d4fe5][_0xa3f8('0x7d')]],'%s',_0x3d45ae):_0x3d45ae;if(_0x452e99[_0x5d4fe5][_0xa3f8('0x7e')]){_0x3a2362['group'](_0x3d45ae);}_0x452e99[_0x5d4fe5][_0xa3f8('0x7f')]&&_0x3a2362[_0xa3f8('0x3f')](_0x3d45ae,_0x452e99[_0x5d4fe5][_0xa3f8('0x7f')]==='DESC'?![]:!![]);_0x3a2362[_0xa3f8('0x70')](_0x3d45ae,_0x452e99[_0x5d4fe5][_0xa3f8('0x80')]||_0x3d45ae);}if(_0x1dba7e['joins']){_0x1dba7e[_0xa3f8('0x81')]=JSON[_0xa3f8('0x82')](_0x1dba7e[_0xa3f8('0x81')]);for(var _0x14a5b5=0x0;_0x14a5b5<_0x1dba7e[_0xa3f8('0x81')][_0xa3f8('0x6d')];_0x14a5b5+=0x1){if(_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x37')]&&_[_0xa3f8('0x68')](_0x3478e8,_0x1dba7e['joins'][_0x14a5b5][_0xa3f8('0x37')])&&_0x1dba7e['joins'][_0x14a5b5][_0xa3f8('0x83')]&&_0x1dba7e['joins'][_0x14a5b5][_0xa3f8('0x84')]&&_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x85')]){_0x3a2362[_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x37')]](_0x1dba7e['joins'][_0x14a5b5][_0xa3f8('0x84')],null,util[_0xa3f8('0x7d')]('%s.%s\x20=\x20%s.%s',_0x1dba7e[_0xa3f8('0x79')],_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x83')],_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x84')],_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5]['foreignKey']));}}}if(_0x1dba7e[_0xa3f8('0x86')]){_0x1dba7e[_0xa3f8('0x86')]=JSON[_0xa3f8('0x82')](_0x1dba7e['conditions']);_0x3a2362[_0xa3f8('0x47')](_0x42e3f8(_0x1dba7e['conditions'][_0xa3f8('0x6f')]));}_0x14508d=_0x3a2362['clone']();_0x3a2362['limit'](_0x36eac9);_0x3a2362[_0xa3f8('0x20')](0x0);logger['debug'](_0xa3f8('0x87'),_0x3a2362['toString']());return dbH[_0xa3f8('0x88')][_0xa3f8('0x3e')](_0x3a2362[_0xa3f8('0x89')](),{'type':dbH[_0xa3f8('0x88')]['QueryTypes'][_0xa3f8('0x8a')]});}})[_0xa3f8('0x2b')](respondWithResult(_0x48f5a6,null))['catch'](handleError(_0x48f5a6,null));};function runReport(_0x3187e0,_0xd0d568,_0x3715ea){var _0x345089=_0xd0d568[_0xa3f8('0x31')];var _0x20ae51=0xa;var _0x190ce8=[_0xa3f8('0x59'),_0xa3f8('0x5a'),_0xa3f8('0x5b'),'cross_join'];var _0x7dc5ec={'SUM':_0xa3f8('0x5c'),'COUNT':_0xa3f8('0x5d'),'COUNT DISTINCT':_0xa3f8('0x5e'),'MAX':_0xa3f8('0x5f'),'MIN':_0xa3f8('0x60'),'AVG':_0xa3f8('0x61'),'GROUP_CONCAT':_0xa3f8('0x62'),'GROUP_CONCAT ASC':_0xa3f8('0x8b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2e2d99={'SEC_TO_TIME':_0xa3f8('0x63'),'DATE':_0xa3f8('0x64'),'HOUR':_0xa3f8('0x65'),'ROUND':_0xa3f8('0x66'),'UNIX_TIMESTAMP':_0xa3f8('0x67')};var _0x599484=function(_0x24fe62){return!_[_0xa3f8('0x68')]([_0xa3f8('0x8c'),_0xa3f8('0x69'),'IS\x20EMPTY',_0xa3f8('0x6b')],_0x24fe62);};var _0x427830=function(_0x3c5091){if(!_0x3c5091||!_0x3c5091[_0xa3f8('0x6c')][_0xa3f8('0x6d')]){return'';}for(var _0x2db7dd='(',_0x12fe03=0x0;_0x12fe03<_0x3c5091[_0xa3f8('0x6c')][_0xa3f8('0x6d')];_0x12fe03+=0x1){_0x12fe03>0x0&&(_0x2db7dd+='\x20'+_0x3c5091[_0xa3f8('0x6e')]+'\x20');_0x2db7dd+=_0x3c5091[_0xa3f8('0x6c')][_0x12fe03]['group']?_0x427830(_0x3c5091[_0xa3f8('0x6c')][_0x12fe03]['group']):_0x3c5091[_0xa3f8('0x6c')][_0x12fe03][_0xa3f8('0x70')]+'\x20'+_0x3c5091[_0xa3f8('0x6c')][_0x12fe03][_0xa3f8('0x8d')]+(_0x599484(_0x3c5091[_0xa3f8('0x6c')][_0x12fe03][_0xa3f8('0x8d')])?'\x20'+_0x3c5091[_0xa3f8('0x6c')][_0x12fe03][_0xa3f8('0x71')]:'');}return _0x2db7dd+')';};var _0x4bb7dd={'where':{'id':_0x3187e0['id']}},_0x2c6efe,_0x4f9513,_0x39bd5c,_0x52fcc3,_0x2d2883;_0x4bb7dd=_['merge']({},_0x4bb7dd,_0x3715ea);return db[_0xa3f8('0x35')][_0xa3f8('0x53')](_0x4bb7dd)[_0xa3f8('0x2b')](function(_0xe3cc6a){if(_0xe3cc6a){_0x2c6efe=_0xe3cc6a;return _0xe3cc6a['getFields']();}return null;})[_0xa3f8('0x2b')](function(_0x3d343f){if(_0x3d343f){if(!_0x3d343f[_0xa3f8('0x6d')]){throw new db[(_0xa3f8('0x73'))][(_0xa3f8('0x8e'))](_0xa3f8('0x74'),0x193);}_0x4f9513=_0x3d343f;return db['AnalyticMetric'][_0xa3f8('0x49')]({'raw':!![]});}return null;})[_0xa3f8('0x2b')](function(_0xbe1a54){if(_0xbe1a54){_0x39bd5c=_[_0xa3f8('0x76')](_0xbe1a54,'id');var _0x477b0a;var _0x565a10=squel[_0xa3f8('0x77')]();_0x565a10[_0xa3f8('0x78')](_0x2c6efe['table']);for(var _0x4494a5=0x0;_0x4494a5<_0x4f9513[_0xa3f8('0x6d')];_0x4494a5+=0x1){_0x477b0a=_0x4f9513[_0x4494a5][_0xa3f8('0x7a')]?_0x39bd5c[_0x4f9513[_0x4494a5]['MetricId']][_0xa3f8('0x8f')]:_0x4f9513[_0x4494a5][_0xa3f8('0x70')];_0x477b0a=_0x4f9513[_0x4494a5][_0xa3f8('0x7b')]?_[_0xa3f8('0x7c')](_0x7dc5ec[_0x4f9513[_0x4494a5][_0xa3f8('0x7b')]],'%s',_0x477b0a):_0x477b0a;_0x477b0a=_0x4f9513[_0x4494a5][_0xa3f8('0x7d')]?_[_0xa3f8('0x7c')](_0x2e2d99[_0x4f9513[_0x4494a5]['format']],'%s',_0x477b0a):_0x477b0a;if(_0x4f9513[_0x4494a5][_0xa3f8('0x7e')]){_0x565a10[_0xa3f8('0x6f')](_0x477b0a);}_0x4f9513[_0x4494a5]['orderBy']&&_0x565a10[_0xa3f8('0x3f')](_0x477b0a,_0x4f9513[_0x4494a5][_0xa3f8('0x7f')]===_0xa3f8('0x90')?![]:!![]);_0x565a10[_0xa3f8('0x70')](_0x477b0a,_0x4f9513[_0x4494a5][_0xa3f8('0x80')]||_0x477b0a);}if(_0x2c6efe[_0xa3f8('0x81')]){_0x2c6efe[_0xa3f8('0x81')]=JSON['parse'](_0x2c6efe[_0xa3f8('0x81')]);for(var _0x151bab=0x0;_0x151bab<_0x2c6efe[_0xa3f8('0x81')][_0xa3f8('0x6d')];_0x151bab+=0x1){if(_0x2c6efe[_0xa3f8('0x81')][_0x151bab][_0xa3f8('0x37')]&&_[_0xa3f8('0x68')](_0x190ce8,_0x2c6efe['joins'][_0x151bab][_0xa3f8('0x37')])&&_0x2c6efe[_0xa3f8('0x81')][_0x151bab][_0xa3f8('0x83')]&&_0x2c6efe[_0xa3f8('0x81')][_0x151bab]['foreignTable']&&_0x2c6efe['joins'][_0x151bab][_0xa3f8('0x85')]){_0x565a10[_0x2c6efe['joins'][_0x151bab][_0xa3f8('0x37')]](_0x2c6efe[_0xa3f8('0x81')][_0x151bab][_0xa3f8('0x84')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x2c6efe[_0xa3f8('0x79')],_0x2c6efe[_0xa3f8('0x81')][_0x151bab][_0xa3f8('0x83')],_0x2c6efe[_0xa3f8('0x81')][_0x151bab]['foreignTable'],_0x2c6efe[_0xa3f8('0x81')][_0x151bab]['foreignKey']));}}}if(_0x2c6efe[_0xa3f8('0x86')]){_0x2c6efe[_0xa3f8('0x86')]=JSON[_0xa3f8('0x82')](_0x2c6efe['conditions']);_0x565a10['where'](_0x427830(_0x2c6efe['conditions'][_0xa3f8('0x6f')]));}_0x2d2883=_0x565a10[_0xa3f8('0x91')]();_0x565a10[_0xa3f8('0x22')](_0x20ae51);_0x565a10[_0xa3f8('0x20')](0x0);return;}})[_0xa3f8('0x2b')](function(){if(_0xd0d568[_0xa3f8('0x92')]===_0xa3f8('0x93')){return null;}var _0x18890e=_['merge'](_0xd0d568,{'name':_0xd0d568[_0xa3f8('0x94')]||_0xd0d568[_0xa3f8('0x31')]||_0x2c6efe[_0xa3f8('0x31')],'basename':_0x345089,'savename':util['format'](_0xa3f8('0x95'),_0xd0d568[_0xa3f8('0x31')]||_0x2c6efe['name'],require(_0xa3f8('0x96'))[_0xa3f8('0x97')](0x4),_0xd0d568['output']||_0xa3f8('0x98')),'reportId':_0x2c6efe['id'],'reportType':_0xa3f8('0x99')});return db['AnalyticExtractedReport'][_0xa3f8('0x4d')](_0x18890e,{'raw':!![]});})[_0xa3f8('0x2b')](function(_0x21cc1d){if(_0x2c6efe['table']===_0xa3f8('0x9a')){_0x2d2883[_0xa3f8('0x47')](_0x2c6efe[_0xa3f8('0x79')]+_0xa3f8('0x9b'),_0xd0d568[_0xa3f8('0x9c')],_0xd0d568['endDate']);}else{_0x2d2883['where'](_0x2c6efe[_0xa3f8('0x79')]+_0xa3f8('0x9d'),_0xd0d568[_0xa3f8('0x9c')],_0xd0d568[_0xa3f8('0x9e')]);}if(_0x21cc1d){logger['info'](_0xa3f8('0x9f'),_0x2d2883[_0xa3f8('0x89')]());require(_0xa3f8('0xa0'))[_0xa3f8('0xa1')](path[_0xa3f8('0x59')](__dirname,_0xa3f8('0xa2'),_0x21cc1d[_0xa3f8('0x92')]),[_0x21cc1d['id'],_0x2d2883[_0xa3f8('0x89')](),path['join'](__dirname,_0xa3f8('0xa3'),_0x21cc1d['savename']),_0x345089]);return _0x21cc1d;}else{var _0xe9842=squel['select']();_0xe9842['from']('('+_0x2d2883[_0xa3f8('0x89')]()+')',_0xa3f8('0xa4'));_0xe9842[_0xa3f8('0x70')](_0xa3f8('0xa5'),_0xa3f8('0x23'));_0x2d2883['limit'](_0xd0d568['limit']||_0x20ae51);_0x2d2883[_0xa3f8('0x20')](_0xd0d568[_0xa3f8('0x20')]||0x0);return dbH[_0xa3f8('0x88')][_0xa3f8('0x3e')](_0xe9842[_0xa3f8('0x89')](),{'type':dbH[_0xa3f8('0x88')]['QueryTypes'][_0xa3f8('0x8a')]})[_0xa3f8('0x2b')](function(_0x5a4f4a){if(!_0x5a4f4a['length']){_0x52fcc3=0x0;}else{_0x52fcc3=_0x5a4f4a[0x0][_0xa3f8('0x23')]||0x0;}return dbH[_0xa3f8('0x88')]['query'](_0x2d2883[_0xa3f8('0x89')](),{'type':dbH[_0xa3f8('0x88')][_0xa3f8('0xa6')][_0xa3f8('0x8a')]});})[_0xa3f8('0x2b')](function(_0x52f592){return{'rows':_0x52f592||[],'count':_0x52fcc3};});}});}exports[_0xa3f8('0xa7')]=function(_0x59026b,_0x234636){return runReport(_0x59026b[_0xa3f8('0x4c')],_0x59026b['query'],_0x59026b['options'])[_0xa3f8('0x2b')](respondWithResult(_0x234636,null))[_0xa3f8('0x4a')](handleError(_0x234636,null));};exports[_0xa3f8('0xa8')]=runReport;exports[_0xa3f8('0x3e')]=function(_0x26ec07,_0x2c9db8){var _0x18ab67=0xa;var _0x1f21a2=[_0xa3f8('0x59'),_0xa3f8('0x5a'),_0xa3f8('0x5b'),'cross_join'];var _0x15a11c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xa3f8('0x5e'),'MAX':_0xa3f8('0x5f'),'MIN':_0xa3f8('0x60'),'AVG':_0xa3f8('0x61'),'GROUP_CONCAT':_0xa3f8('0x62'),'GROUP_CONCAT ASC':_0xa3f8('0x8b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x481b70={'SEC_TO_TIME':_0xa3f8('0x63'),'DATE':_0xa3f8('0x64'),'HOUR':_0xa3f8('0x65'),'ROUND':_0xa3f8('0x66'),'UNIX_TIMESTAMP':_0xa3f8('0x67')};var _0x1f776a=function(_0x5b1527){return!_['includes']([_0xa3f8('0x8c'),_0xa3f8('0x69'),_0xa3f8('0x6a'),_0xa3f8('0x6b')],_0x5b1527);};var _0x4670cc=function(_0xfde509){if(!_0xfde509||!_0xfde509['rules']['length']){return'';}for(var _0x3d81fe='(',_0x15111a=0x0;_0x15111a<_0xfde509[_0xa3f8('0x6c')]['length'];_0x15111a+=0x1){_0x15111a>0x0&&(_0x3d81fe+='\x20'+_0xfde509[_0xa3f8('0x6e')]+'\x20');_0x3d81fe+=_0xfde509[_0xa3f8('0x6c')][_0x15111a]['group']?_0x4670cc(_0xfde509[_0xa3f8('0x6c')][_0x15111a]['group']):_0xfde509[_0xa3f8('0x6c')][_0x15111a]['field']+'\x20'+_0xfde509['rules'][_0x15111a][_0xa3f8('0x8d')]+(_0x1f776a(_0xfde509[_0xa3f8('0x6c')][_0x15111a][_0xa3f8('0x8d')])?'\x20'+_0xfde509[_0xa3f8('0x6c')][_0x15111a]['value']:'');}return _0x3d81fe+')';};var _0x2e694e={'where':{'id':_0x26ec07[_0xa3f8('0x4c')]['id']}},_0x1669be,_0x4f248f,_0x6ef1ad,_0xae3a31,_0x31d45c;_0x2e694e=_[_0xa3f8('0x44')]({},_0x2e694e,_0x26ec07[_0xa3f8('0x46')]);return db[_0xa3f8('0x35')][_0xa3f8('0x53')](_0x2e694e)[_0xa3f8('0x2b')](function(_0x529021){if(_0x529021){_0x1669be=_0x529021;return _0x529021[_0xa3f8('0x72')]();}return null;})[_0xa3f8('0x2b')](function(_0x35c498){if(_0x35c498){if(!_0x35c498[_0xa3f8('0x6d')]){throw new db[(_0xa3f8('0x73'))][(_0xa3f8('0x8e'))](_0xa3f8('0x74'),0x193);}_0x4f248f=_0x35c498;return db[_0xa3f8('0x75')]['findAll']({'raw':!![]});}return null;})[_0xa3f8('0x2b')](function(_0x286490){if(_0x286490){_0x6ef1ad=_['keyBy'](_0x286490,'id');var _0x16e98d;var _0x3be5c9=squel['select']();_0x3be5c9[_0xa3f8('0x78')](_0x1669be[_0xa3f8('0x79')]);for(var _0x5260e0=0x0;_0x5260e0<_0x4f248f[_0xa3f8('0x6d')];_0x5260e0+=0x1){_0x16e98d=_0x4f248f[_0x5260e0][_0xa3f8('0x7a')]?_0x6ef1ad[_0x4f248f[_0x5260e0]['MetricId']][_0xa3f8('0x8f')]:_0x4f248f[_0x5260e0][_0xa3f8('0x70')];_0x16e98d=_0x4f248f[_0x5260e0]['function']?_['replace'](_0x15a11c[_0x4f248f[_0x5260e0][_0xa3f8('0x7b')]],'%s',_0x16e98d):_0x16e98d;_0x16e98d=_0x4f248f[_0x5260e0][_0xa3f8('0x7d')]?_[_0xa3f8('0x7c')](_0x481b70[_0x4f248f[_0x5260e0]['format']],'%s',_0x16e98d):_0x16e98d;if(_0x4f248f[_0x5260e0]['groupBy']){_0x3be5c9[_0xa3f8('0x6f')](_0x16e98d);}_0x4f248f[_0x5260e0][_0xa3f8('0x7f')]&&_0x3be5c9['order'](_0x16e98d,_0x4f248f[_0x5260e0][_0xa3f8('0x7f')]==='DESC'?![]:!![]);_0x3be5c9[_0xa3f8('0x70')](_0x16e98d,_0x4f248f[_0x5260e0]['alias']||_0x16e98d);}if(_0x1669be[_0xa3f8('0x81')]){_0x1669be['joins']=JSON['parse'](_0x1669be[_0xa3f8('0x81')]);for(var _0x5ac693=0x0;_0x5ac693<_0x1669be[_0xa3f8('0x81')][_0xa3f8('0x6d')];_0x5ac693+=0x1){if(_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x37')]&&_[_0xa3f8('0x68')](_0x1f21a2,_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x37')])&&_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x83')]&&_0x1669be['joins'][_0x5ac693][_0xa3f8('0x84')]&&_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x85')]){_0x3be5c9[_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x37')]](_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x84')],null,util[_0xa3f8('0x7d')](_0xa3f8('0xa9'),_0x1669be[_0xa3f8('0x79')],_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x83')],_0x1669be[_0xa3f8('0x81')][_0x5ac693]['foreignTable'],_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x85')]));}}}if(_0x1669be[_0xa3f8('0x86')]){_0x1669be[_0xa3f8('0x86')]=JSON[_0xa3f8('0x82')](_0x1669be[_0xa3f8('0x86')]);_0x3be5c9['where'](_0x4670cc(_0x1669be[_0xa3f8('0x86')][_0xa3f8('0x6f')]));}_0x31d45c=_0x3be5c9[_0xa3f8('0x91')]();_0x3be5c9[_0xa3f8('0x22')](_0x18ab67);_0x3be5c9[_0xa3f8('0x20')](0x0);logger[_0xa3f8('0xaa')](_0xa3f8('0x87'),_0x3be5c9[_0xa3f8('0x89')]());return dbH[_0xa3f8('0x88')][_0xa3f8('0x3e')](_0x3be5c9[_0xa3f8('0x89')](),{'type':dbH[_0xa3f8('0x88')][_0xa3f8('0xa6')][_0xa3f8('0x8a')]});}})[_0xa3f8('0x2b')](function(){return{'sql':_0x31d45c[_0xa3f8('0x89')]()};})[_0xa3f8('0x2b')](respondWithResult(_0x2c9db8,null))[_0xa3f8('0x4a')](handleError(_0x2c9db8,null));};
\ No newline at end of file
+var _0xda19=['ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','field','function','replace','groupBy','orderBy','order','alias','joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20EMPTY','operator','Sequelize','metric','format','DESC','parse','parentKey','web','output','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','run','runReport','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','dbH','status','json','offset','undefined','limit','count','set','apply','update','then','DefaultReports','destroy','end','error','stack','name','send','map','AnalyticDefaultReport','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','merge','includeAll','include','findAll','show','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','condition','value','options','find','getFields'];(function(_0x4227e8,_0x4103e1){var _0x47ebe7=function(_0x31d34f){while(--_0x31d34f){_0x4227e8['push'](_0x4227e8['shift']());}};_0x47ebe7(++_0x4103e1);}(_0xda19,0xd5));var _0x9da1=function(_0x300baa,_0x1e06bd){_0x300baa=_0x300baa-0x0;var _0x5e0577=_0xda19[_0x300baa];return _0x5e0577;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9da1('0x0'));var zipdir=require(_0x9da1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9da1('0x2'));var moment=require('moment');var BPromise=require(_0x9da1('0x3'));var Mustache=require('mustache');var util=require(_0x9da1('0x4'));var path=require(_0x9da1('0x5'));var sox=require(_0x9da1('0x6'));var csv=require(_0x9da1('0x7'));var ejs=require(_0x9da1('0x8'));var fs=require('fs');var fs_extra=require(_0x9da1('0x9'));var _=require(_0x9da1('0xa'));var squel=require(_0x9da1('0xb'));var crypto=require(_0x9da1('0xc'));var jsforce=require(_0x9da1('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9da1('0xe'));var Redis=require('ioredis');var authService=require(_0x9da1('0xf'));var qs=require(_0x9da1('0x10'));var as=require(_0x9da1('0x11'));var hardwareService=require(_0x9da1('0x12'));var logger=require(_0x9da1('0x13'))(_0x9da1('0x14'));var utils=require(_0x9da1('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9da1('0x16'))['db'];var dbH=require('../../mysqldb')[_0x9da1('0x17')];function respondWithStatusCode(_0x1d93f8,_0xd2d225){_0xd2d225=_0xd2d225||0xcc;return function(_0x1ffa2a){if(_0x1ffa2a){return _0x1d93f8['sendStatus'](_0xd2d225);}return _0x1d93f8[_0x9da1('0x18')](_0xd2d225)['end']();};}function respondWithResult(_0x4d17e1,_0x40ba9d){_0x40ba9d=_0x40ba9d||0xc8;return function(_0x479ccd){if(_0x479ccd){return _0x4d17e1[_0x9da1('0x18')](_0x40ba9d)[_0x9da1('0x19')](_0x479ccd);}};}function respondWithFilteredResult(_0x37653d,_0x1a1a6b){return function(_0x7f1a64){if(_0x7f1a64){var _0x514d8e=typeof _0x1a1a6b[_0x9da1('0x1a')]===_0x9da1('0x1b')&&typeof _0x1a1a6b[_0x9da1('0x1c')]===_0x9da1('0x1b');var _0xfb278d=_0x7f1a64[_0x9da1('0x1d')];var _0x497676=_0x514d8e?0x0:_0x1a1a6b['offset'];var _0x17205d=_0x514d8e?_0x7f1a64[_0x9da1('0x1d')]:_0x1a1a6b[_0x9da1('0x1a')]+_0x1a1a6b[_0x9da1('0x1c')];var _0x40a967;if(_0x17205d>=_0xfb278d){_0x17205d=_0xfb278d;_0x40a967=0xc8;}else{_0x40a967=0xce;}_0x37653d[_0x9da1('0x18')](_0x40a967);return _0x37653d[_0x9da1('0x1e')]('Content-Range',_0x497676+'-'+_0x17205d+'/'+_0xfb278d)[_0x9da1('0x19')](_0x7f1a64);}return null;};}function patchUpdates(_0x554845){return function(_0x9c3b37){try{jsonpatch[_0x9da1('0x1f')](_0x9c3b37,_0x554845,!![]);}catch(_0x1fc065){return BPromise['reject'](_0x1fc065);}return _0x9c3b37['save']();};}function saveUpdates(_0x14793b,_0x3e6f85){return function(_0x16ee0c){if(_0x16ee0c){return _0x16ee0c[_0x9da1('0x20')](_0x14793b)[_0x9da1('0x21')](function(_0x165b73){return _0x165b73;});}return null;};}function removeEntity(_0x4c60aa,_0x2413fe){return function(_0x3bfa40){if(_0x3bfa40){return _0x3bfa40['destroy']()[_0x9da1('0x21')](function(){var _0x3f5680=_0x3bfa40['get']({'plain':!![]});var _0x2fd49c=_0x9da1('0x22');return db['UserProfileResource'][_0x9da1('0x23')]({'where':{'type':_0x2fd49c,'resourceId':_0x3f5680['id']}})[_0x9da1('0x21')](function(){return _0x3bfa40;});})['then'](function(){_0x4c60aa['status'](0xcc)[_0x9da1('0x24')]();});}};}function handleEntityNotFound(_0x47055e,_0x5eca5b){return function(_0x27c6e2){if(!_0x27c6e2){_0x47055e['sendStatus'](0x194);}return _0x27c6e2;};}function handleError(_0x5a6f2d,_0x5a59c2){_0x5a59c2=_0x5a59c2||0x1f4;return function(_0x31b826){logger[_0x9da1('0x25')](_0x31b826[_0x9da1('0x26')]);if(_0x31b826[_0x9da1('0x27')]){delete _0x31b826[_0x9da1('0x27')];}_0x5a6f2d['status'](_0x5a59c2)[_0x9da1('0x28')](_0x31b826);};}exports['index']=function(_0x1feae0,_0x235ced){var _0x5b38b3={},_0xc29ba8={},_0x2eb48f={'count':0x0,'rows':[]};var _0x4f318b=_[_0x9da1('0x29')](db[_0x9da1('0x2a')][_0x9da1('0x2b')],function(_0x2b2b48){return{'name':_0x2b2b48['fieldName'],'type':_0x2b2b48['type'][_0x9da1('0x2c')]};});_0xc29ba8[_0x9da1('0x2d')]=_[_0x9da1('0x29')](_0x4f318b,_0x9da1('0x27'));_0xc29ba8[_0x9da1('0x2e')]=_['keys'](_0x1feae0[_0x9da1('0x2e')]);_0xc29ba8[_0x9da1('0x2f')]=_[_0x9da1('0x30')](_0xc29ba8[_0x9da1('0x2d')],_0xc29ba8[_0x9da1('0x2e')]);_0x5b38b3[_0x9da1('0x31')]=_['intersection'](_0xc29ba8[_0x9da1('0x2d')],qs['fields'](_0x1feae0['query'][_0x9da1('0x32')]));_0x5b38b3['attributes']=_0x5b38b3[_0x9da1('0x31')][_0x9da1('0x33')]?_0x5b38b3[_0x9da1('0x31')]:_0xc29ba8[_0x9da1('0x2d')];if(!_0x1feae0[_0x9da1('0x2e')][_0x9da1('0x34')](_0x9da1('0x35'))){_0x5b38b3[_0x9da1('0x1c')]=qs['limit'](_0x1feae0[_0x9da1('0x2e')]['limit']);_0x5b38b3[_0x9da1('0x1a')]=qs['offset'](_0x1feae0['query'][_0x9da1('0x1a')]);}_0x5b38b3['order']=qs[_0x9da1('0x36')](_0x1feae0[_0x9da1('0x2e')]['sort']);_0x5b38b3[_0x9da1('0x37')]=qs[_0x9da1('0x2f')](_[_0x9da1('0x38')](_0x1feae0[_0x9da1('0x2e')],_0xc29ba8['filters']),_0x4f318b);if(_0x1feae0[_0x9da1('0x2e')]['filter']){_0x5b38b3[_0x9da1('0x37')]=_['merge'](_0x5b38b3[_0x9da1('0x37')],{'$or':_[_0x9da1('0x29')](_0x4f318b,function(_0x58e165){if(_0x58e165[_0x9da1('0x39')]!==_0x9da1('0x3a')){var _0x394acf={};_0x394acf[_0x58e165['name']]={'$like':'%'+_0x1feae0['query']['filter']+'%'};return _0x394acf;}})});}_0x5b38b3=_[_0x9da1('0x3b')]({},_0x5b38b3,_0x1feae0['options']);var _0x5b215c={'where':_0x5b38b3[_0x9da1('0x37')]};return db[_0x9da1('0x2a')][_0x9da1('0x1d')](_0x5b215c)['then'](function(_0x42dbd8){_0x2eb48f[_0x9da1('0x1d')]=_0x42dbd8;if(_0x1feae0[_0x9da1('0x2e')][_0x9da1('0x3c')]){_0x5b38b3[_0x9da1('0x3d')]=[{'all':!![]}];}return db[_0x9da1('0x2a')][_0x9da1('0x3e')](_0x5b38b3);})['then'](function(_0x467350){_0x2eb48f['rows']=_0x467350;return _0x2eb48f;})[_0x9da1('0x21')](respondWithFilteredResult(_0x235ced,_0x5b38b3))['catch'](handleError(_0x235ced,null));};exports[_0x9da1('0x3f')]=function(_0x40d848,_0x599211){var _0x265366={'raw':!![],'where':{'id':_0x40d848['params']['id']}},_0xfeec5f={};_0xfeec5f[_0x9da1('0x2d')]=_['keys'](db[_0x9da1('0x2a')][_0x9da1('0x2b')]);_0xfeec5f['query']=_['keys'](_0x40d848[_0x9da1('0x2e')]);_0xfeec5f[_0x9da1('0x2f')]=_[_0x9da1('0x30')](_0xfeec5f[_0x9da1('0x2d')],_0xfeec5f[_0x9da1('0x2e')]);_0x265366[_0x9da1('0x31')]=_[_0x9da1('0x30')](_0xfeec5f[_0x9da1('0x2d')],qs['fields'](_0x40d848[_0x9da1('0x2e')][_0x9da1('0x32')]));_0x265366[_0x9da1('0x31')]=_0x265366['attributes'][_0x9da1('0x33')]?_0x265366[_0x9da1('0x31')]:_0xfeec5f[_0x9da1('0x2d')];if(_0x40d848['query'][_0x9da1('0x3c')]){_0x265366[_0x9da1('0x3d')]=[{'all':!![]}];}_0x265366=_[_0x9da1('0x3b')]({},_0x265366,_0x40d848['options']);return db[_0x9da1('0x2a')]['find'](_0x265366)['then'](handleEntityNotFound(_0x599211,null))[_0x9da1('0x21')](respondWithResult(_0x599211,null))[_0x9da1('0x40')](handleError(_0x599211,null));};exports['create']=function(_0x712d10,_0x2066d2){return db['AnalyticDefaultReport'][_0x9da1('0x41')](_0x712d10[_0x9da1('0x42')],{})[_0x9da1('0x21')](function(_0x3a529d){var _0x4780ca=_0x712d10[_0x9da1('0x43')][_0x9da1('0x44')]({'plain':!![]});if(!_0x4780ca)throw new Error(_0x9da1('0x45'));if(_0x4780ca[_0x9da1('0x46')]==='user'){var _0x147c65=_0x3a529d[_0x9da1('0x44')]({'plain':!![]});var _0x34a203=_0x9da1('0x47');return db['UserProfileSection']['find']({'where':{'name':_0x34a203,'userProfileId':_0x4780ca[_0x9da1('0x48')]},'raw':!![]})[_0x9da1('0x21')](function(_0x3870dd){if(_0x3870dd&&_0x3870dd[_0x9da1('0x49')]===0x0){return db[_0x9da1('0x4a')][_0x9da1('0x41')]({'name':_0x147c65[_0x9da1('0x27')],'resourceId':_0x147c65['id'],'type':_0x9da1('0x22'),'sectionId':_0x3870dd['id']},{})[_0x9da1('0x21')](function(){return _0x3a529d;});}else{return _0x3a529d;}})[_0x9da1('0x40')](function(_0x868167){logger[_0x9da1('0x25')](_0x9da1('0x4b'),_0x868167);throw _0x868167;});}return _0x3a529d;})[_0x9da1('0x21')](respondWithResult(_0x2066d2,0xc9))['catch'](handleError(_0x2066d2,null));};exports[_0x9da1('0x20')]=function(_0x1fbb5d,_0x4d241a){if(_0x1fbb5d[_0x9da1('0x42')]['id']){delete _0x1fbb5d['body']['id'];}return db[_0x9da1('0x2a')]['find']({'where':{'id':_0x1fbb5d[_0x9da1('0x4c')]['id']}})[_0x9da1('0x21')](handleEntityNotFound(_0x4d241a,null))[_0x9da1('0x21')](saveUpdates(_0x1fbb5d[_0x9da1('0x42')],null))[_0x9da1('0x21')](respondWithResult(_0x4d241a,null))[_0x9da1('0x40')](handleError(_0x4d241a,null));};exports[_0x9da1('0x23')]=function(_0x343b05,_0x170351){return db[_0x9da1('0x2a')]['find']({'where':{'id':_0x343b05[_0x9da1('0x4c')]['id']}})[_0x9da1('0x21')](handleEntityNotFound(_0x170351,null))[_0x9da1('0x21')](removeEntity(_0x170351,null))[_0x9da1('0x40')](handleError(_0x170351,null));};exports[_0x9da1('0x4d')]=function(_0x4607a9,_0x2020d0){var _0x3c01c3=0xa;var _0xfa8d3f=[_0x9da1('0x4e'),'left_join',_0x9da1('0x4f'),_0x9da1('0x50')];var _0x5bda2a={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0xc27b00={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':_0x9da1('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x9da1('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x27ac84=function(_0x10ebc9){return!_[_0x9da1('0x5c')]([_0x9da1('0x5d'),_0x9da1('0x5e'),_0x9da1('0x5f'),'IS\x20NOT\x20EMPTY'],_0x10ebc9);};var _0x5f5dc2=function(_0x454a68){if(!_0x454a68||!_0x454a68['rules']['length']){return'';}for(var _0x5b4a05='(',_0x6f86c3=0x0;_0x6f86c3<_0x454a68['rules'][_0x9da1('0x33')];_0x6f86c3+=0x1){_0x6f86c3>0x0&&(_0x5b4a05+='\x20'+_0x454a68['operator']+'\x20');_0x5b4a05+=_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x61')]?_0x5f5dc2(_0x454a68['rules'][_0x6f86c3][_0x9da1('0x61')]):_0x454a68[_0x9da1('0x60')][_0x6f86c3]['field']+'\x20'+_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x62')]+(_0x27ac84(_0x454a68['rules'][_0x6f86c3]['condition'])?'\x20'+_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x63')]:'');}return _0x5b4a05+')';};var _0x21d00c={'where':{'id':_0x4607a9['params']['id']}},_0x3ca531,_0x236b01,_0x44d7fe,_0x5cb102,_0x3d2c25;_0x21d00c=_['merge']({},_0x21d00c,_0x4607a9[_0x9da1('0x64')]);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0x21d00c)[_0x9da1('0x21')](function(_0x3382b1){if(_0x3382b1){_0x3ca531=_0x3382b1;return _0x3382b1[_0x9da1('0x66')]();}return null;})[_0x9da1('0x21')](function(_0x1f2a4b){if(_0x1f2a4b){if(!_0x1f2a4b[_0x9da1('0x33')]){throw new db['Sequelize'][(_0x9da1('0x67'))](_0x9da1('0x68'),0x193);}_0x236b01=_0x1f2a4b;return db[_0x9da1('0x69')][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x491fcb){if(_0x491fcb){_0x44d7fe=_[_0x9da1('0x6a')](_0x491fcb,'id');var _0x13fadd;var _0x419f78=squel[_0x9da1('0x6b')]();_0x419f78[_0x9da1('0x6c')](_0x3ca531[_0x9da1('0x6d')]);for(var _0x55a6d2=0x0;_0x55a6d2<_0x236b01[_0x9da1('0x33')];_0x55a6d2+=0x1){_0x13fadd=_0x236b01[_0x55a6d2]['MetricId']?_0x44d7fe[_0x236b01[_0x55a6d2][_0x9da1('0x6e')]]['metric']:_0x236b01[_0x55a6d2][_0x9da1('0x6f')];_0x13fadd=_0x236b01[_0x55a6d2][_0x9da1('0x70')]?_[_0x9da1('0x71')](_0x5bda2a[_0x236b01[_0x55a6d2][_0x9da1('0x70')]],'%s',_0x13fadd):_0x13fadd;_0x13fadd=_0x236b01[_0x55a6d2]['format']?_['replace'](_0xc27b00[_0x236b01[_0x55a6d2]['format']],'%s',_0x13fadd):_0x13fadd;if(_0x236b01[_0x55a6d2][_0x9da1('0x72')]){_0x419f78[_0x9da1('0x61')](_0x13fadd);}_0x236b01[_0x55a6d2][_0x9da1('0x73')]&&_0x419f78[_0x9da1('0x74')](_0x13fadd,_0x236b01[_0x55a6d2]['orderBy']==='DESC'?![]:!![]);_0x419f78[_0x9da1('0x6f')](_0x13fadd,_0x236b01[_0x55a6d2][_0x9da1('0x75')]||_0x13fadd);}if(_0x3ca531[_0x9da1('0x76')]){_0x3ca531['joins']=JSON['parse'](_0x3ca531[_0x9da1('0x76')]);for(var _0x1deb93=0x0;_0x1deb93<_0x3ca531[_0x9da1('0x76')]['length'];_0x1deb93+=0x1){if(_0x3ca531['joins'][_0x1deb93][_0x9da1('0x39')]&&_[_0x9da1('0x5c')](_0xfa8d3f,_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x39')])&&_0x3ca531[_0x9da1('0x76')][_0x1deb93]['parentKey']&&_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')]&&_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x78')]){_0x419f78[_0x3ca531['joins'][_0x1deb93][_0x9da1('0x39')]](_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')],null,util['format'](_0x9da1('0x79'),_0x3ca531[_0x9da1('0x6d')],_0x3ca531[_0x9da1('0x76')][_0x1deb93]['parentKey'],_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')],_0x3ca531['joins'][_0x1deb93][_0x9da1('0x78')]));}}}if(_0x3ca531['conditions']){_0x3ca531[_0x9da1('0x7a')]=JSON['parse'](_0x3ca531[_0x9da1('0x7a')]);_0x419f78[_0x9da1('0x37')](_0x5f5dc2(_0x3ca531[_0x9da1('0x7a')][_0x9da1('0x61')]));}_0x3d2c25=_0x419f78[_0x9da1('0x7b')]();_0x419f78[_0x9da1('0x1c')](_0x3c01c3);_0x419f78[_0x9da1('0x1a')](0x0);logger[_0x9da1('0x7c')](_0x9da1('0x7d'),_0x419f78[_0x9da1('0x7e')]());return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x419f78[_0x9da1('0x7e')](),{'type':dbH['sequelize'][_0x9da1('0x80')][_0x9da1('0x81')]});}})[_0x9da1('0x21')](respondWithResult(_0x2020d0,null))[_0x9da1('0x40')](handleError(_0x2020d0,null));};function runReport(_0x162597,_0x4f39bc,_0x1ca102){var _0x2eb5e6=_0x4f39bc['name'];var _0x4a4cda=0xa;var _0x84f8d8=[_0x9da1('0x4e'),_0x9da1('0x82'),_0x9da1('0x4f'),_0x9da1('0x50')];var _0x4701b3={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0x3a0a84={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':_0x9da1('0x5a'),'HOUR':_0x9da1('0x83'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9da1('0x84')};var _0x354c5a=function(_0x53ab6a){return!_[_0x9da1('0x5c')](['IS\x20NULL',_0x9da1('0x5e'),'IS\x20EMPTY',_0x9da1('0x85')],_0x53ab6a);};var _0x106bd9=function(_0x347cb8){if(!_0x347cb8||!_0x347cb8[_0x9da1('0x60')][_0x9da1('0x33')]){return'';}for(var _0x3e331a='(',_0x1f785c=0x0;_0x1f785c<_0x347cb8[_0x9da1('0x60')][_0x9da1('0x33')];_0x1f785c+=0x1){_0x1f785c>0x0&&(_0x3e331a+='\x20'+_0x347cb8[_0x9da1('0x86')]+'\x20');_0x3e331a+=_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x61')]?_0x106bd9(_0x347cb8['rules'][_0x1f785c][_0x9da1('0x61')]):_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x6f')]+'\x20'+_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x62')]+(_0x354c5a(_0x347cb8[_0x9da1('0x60')][_0x1f785c]['condition'])?'\x20'+_0x347cb8['rules'][_0x1f785c][_0x9da1('0x63')]:'');}return _0x3e331a+')';};var _0xdecc82={'where':{'id':_0x162597['id']}},_0xe12dd7,_0x4cd85f,_0x4bf74c,_0x28335d,_0x175b4b;_0xdecc82=_[_0x9da1('0x3b')]({},_0xdecc82,_0x1ca102);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0xdecc82)[_0x9da1('0x21')](function(_0x5561f0){if(_0x5561f0){_0xe12dd7=_0x5561f0;return _0x5561f0[_0x9da1('0x66')]();}return null;})[_0x9da1('0x21')](function(_0x5a64fd){if(_0x5a64fd){if(!_0x5a64fd['length']){throw new db[(_0x9da1('0x87'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4cd85f=_0x5a64fd;return db[_0x9da1('0x69')][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x18ae08){if(_0x18ae08){_0x4bf74c=_[_0x9da1('0x6a')](_0x18ae08,'id');var _0x30065d;var _0x40a2ef=squel[_0x9da1('0x6b')]();_0x40a2ef['from'](_0xe12dd7['table']);for(var _0xd10ba4=0x0;_0xd10ba4<_0x4cd85f[_0x9da1('0x33')];_0xd10ba4+=0x1){_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x6e')]?_0x4bf74c[_0x4cd85f[_0xd10ba4][_0x9da1('0x6e')]][_0x9da1('0x88')]:_0x4cd85f[_0xd10ba4][_0x9da1('0x6f')];_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x70')]?_[_0x9da1('0x71')](_0x4701b3[_0x4cd85f[_0xd10ba4]['function']],'%s',_0x30065d):_0x30065d;_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x89')]?_['replace'](_0x3a0a84[_0x4cd85f[_0xd10ba4][_0x9da1('0x89')]],'%s',_0x30065d):_0x30065d;if(_0x4cd85f[_0xd10ba4][_0x9da1('0x72')]){_0x40a2ef[_0x9da1('0x61')](_0x30065d);}_0x4cd85f[_0xd10ba4][_0x9da1('0x73')]&&_0x40a2ef[_0x9da1('0x74')](_0x30065d,_0x4cd85f[_0xd10ba4][_0x9da1('0x73')]===_0x9da1('0x8a')?![]:!![]);_0x40a2ef['field'](_0x30065d,_0x4cd85f[_0xd10ba4][_0x9da1('0x75')]||_0x30065d);}if(_0xe12dd7['joins']){_0xe12dd7[_0x9da1('0x76')]=JSON[_0x9da1('0x8b')](_0xe12dd7[_0x9da1('0x76')]);for(var _0x22b679=0x0;_0x22b679<_0xe12dd7['joins'][_0x9da1('0x33')];_0x22b679+=0x1){if(_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')]&&_[_0x9da1('0x5c')](_0x84f8d8,_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')])&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x8c')]&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x77')]&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x78')]){_0x40a2ef[_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')]](_0xe12dd7['joins'][_0x22b679][_0x9da1('0x77')],null,util['format'](_0x9da1('0x79'),_0xe12dd7['table'],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x8c')],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x77')],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x78')]));}}}if(_0xe12dd7[_0x9da1('0x7a')]){_0xe12dd7[_0x9da1('0x7a')]=JSON['parse'](_0xe12dd7[_0x9da1('0x7a')]);_0x40a2ef[_0x9da1('0x37')](_0x106bd9(_0xe12dd7['conditions'][_0x9da1('0x61')]));}_0x175b4b=_0x40a2ef[_0x9da1('0x7b')]();_0x40a2ef[_0x9da1('0x1c')](_0x4a4cda);_0x40a2ef['offset'](0x0);return;}})['then'](function(){if(_0x4f39bc['output']===_0x9da1('0x8d')){return null;}var _0x3b17aa=_[_0x9da1('0x3b')](_0x4f39bc,{'name':_0x4f39bc['fullPath']||_0x4f39bc['name']||_0xe12dd7[_0x9da1('0x27')],'basename':_0x2eb5e6,'savename':util[_0x9da1('0x89')]('%s-%s.%s',_0x4f39bc[_0x9da1('0x27')]||_0xe12dd7['name'],require('randomstring')['generate'](0x4),_0x4f39bc[_0x9da1('0x8e')]||_0x9da1('0x8f')),'reportId':_0xe12dd7['id'],'reportType':_0x9da1('0x90')});return db[_0x9da1('0x91')][_0x9da1('0x41')](_0x3b17aa,{'raw':!![]});})[_0x9da1('0x21')](function(_0x2aac99){if(_0xe12dd7[_0x9da1('0x6d')]===_0x9da1('0x92')){_0x175b4b[_0x9da1('0x37')](_0xe12dd7[_0x9da1('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x4f39bc['startDate'],_0x4f39bc['endDate']);}else{_0x175b4b[_0x9da1('0x37')](_0xe12dd7[_0x9da1('0x6d')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4f39bc[_0x9da1('0x93')],_0x4f39bc[_0x9da1('0x94')]);}if(_0x2aac99){logger[_0x9da1('0x95')](_0x9da1('0x96'),_0x175b4b[_0x9da1('0x7e')]());require(_0x9da1('0x97'))[_0x9da1('0x98')](path[_0x9da1('0x4e')](__dirname,'../../components/export/',_0x2aac99[_0x9da1('0x8e')]),[_0x2aac99['id'],_0x175b4b[_0x9da1('0x7e')](),path[_0x9da1('0x4e')](__dirname,_0x9da1('0x99'),_0x2aac99[_0x9da1('0x9a')]),_0x2eb5e6]);return _0x2aac99;}else{var _0x5ad3f8=squel[_0x9da1('0x6b')]();_0x5ad3f8['from']('('+_0x175b4b[_0x9da1('0x7e')]()+')',_0x9da1('0x9b'));_0x5ad3f8[_0x9da1('0x6f')]('COUNT(*)','count');_0x175b4b[_0x9da1('0x1c')](_0x4f39bc[_0x9da1('0x1c')]||_0x4a4cda);_0x175b4b[_0x9da1('0x1a')](_0x4f39bc['offset']||0x0);return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x5ad3f8['toString'](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')]['SELECT']})['then'](function(_0x489b3f){if(!_0x489b3f[_0x9da1('0x33')]){_0x28335d=0x0;}else{_0x28335d=_0x489b3f[0x0]['count']||0x0;}return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x175b4b[_0x9da1('0x7e')](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')][_0x9da1('0x81')]});})['then'](function(_0x355a71){return{'rows':_0x355a71||[],'count':_0x28335d};});}});}exports[_0x9da1('0x9c')]=function(_0x492e1a,_0x449a17){return runReport(_0x492e1a[_0x9da1('0x4c')],_0x492e1a[_0x9da1('0x2e')],_0x492e1a[_0x9da1('0x64')])['then'](respondWithResult(_0x449a17,null))[_0x9da1('0x40')](handleError(_0x449a17,null));};exports[_0x9da1('0x9d')]=runReport;exports[_0x9da1('0x2e')]=function(_0x8280a9,_0x374754){var _0x1e466a=0xa;var _0x3f9133=[_0x9da1('0x4e'),'left_join',_0x9da1('0x4f'),'cross_join'];var _0x3dd3e0={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0x52e4a6={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x9da1('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4aa903=function(_0x55d7f2){return!_['includes'](['IS\x20NULL',_0x9da1('0x5e'),_0x9da1('0x5f'),_0x9da1('0x85')],_0x55d7f2);};var _0x3212ad=function(_0x5ac65b){if(!_0x5ac65b||!_0x5ac65b[_0x9da1('0x60')][_0x9da1('0x33')]){return'';}for(var _0x21a99d='(',_0xd19a7c=0x0;_0xd19a7c<_0x5ac65b[_0x9da1('0x60')][_0x9da1('0x33')];_0xd19a7c+=0x1){_0xd19a7c>0x0&&(_0x21a99d+='\x20'+_0x5ac65b[_0x9da1('0x86')]+'\x20');_0x21a99d+=_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x61')]?_0x3212ad(_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x61')]):_0x5ac65b['rules'][_0xd19a7c][_0x9da1('0x6f')]+'\x20'+_0x5ac65b[_0x9da1('0x60')][_0xd19a7c]['condition']+(_0x4aa903(_0x5ac65b['rules'][_0xd19a7c][_0x9da1('0x62')])?'\x20'+_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x63')]:'');}return _0x21a99d+')';};var _0xb14af1={'where':{'id':_0x8280a9[_0x9da1('0x4c')]['id']}},_0x245566,_0x5b2591,_0x3c51e3,_0x54b83d,_0x23bf86;_0xb14af1=_['merge']({},_0xb14af1,_0x8280a9[_0x9da1('0x64')]);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0xb14af1)[_0x9da1('0x21')](function(_0x4bb140){if(_0x4bb140){_0x245566=_0x4bb140;return _0x4bb140[_0x9da1('0x66')]();}return null;})['then'](function(_0x47cbdd){if(_0x47cbdd){if(!_0x47cbdd['length']){throw new db[(_0x9da1('0x87'))][(_0x9da1('0x67'))](_0x9da1('0x68'),0x193);}_0x5b2591=_0x47cbdd;return db['AnalyticMetric'][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x5e1e24){if(_0x5e1e24){_0x3c51e3=_[_0x9da1('0x6a')](_0x5e1e24,'id');var _0x49ddec;var _0x407218=squel['select']();_0x407218['from'](_0x245566['table']);for(var _0x316fee=0x0;_0x316fee<_0x5b2591['length'];_0x316fee+=0x1){_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x6e')]?_0x3c51e3[_0x5b2591[_0x316fee][_0x9da1('0x6e')]]['metric']:_0x5b2591[_0x316fee]['field'];_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x70')]?_['replace'](_0x3dd3e0[_0x5b2591[_0x316fee][_0x9da1('0x70')]],'%s',_0x49ddec):_0x49ddec;_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x89')]?_['replace'](_0x52e4a6[_0x5b2591[_0x316fee]['format']],'%s',_0x49ddec):_0x49ddec;if(_0x5b2591[_0x316fee][_0x9da1('0x72')]){_0x407218[_0x9da1('0x61')](_0x49ddec);}_0x5b2591[_0x316fee][_0x9da1('0x73')]&&_0x407218[_0x9da1('0x74')](_0x49ddec,_0x5b2591[_0x316fee]['orderBy']==='DESC'?![]:!![]);_0x407218[_0x9da1('0x6f')](_0x49ddec,_0x5b2591[_0x316fee][_0x9da1('0x75')]||_0x49ddec);}if(_0x245566[_0x9da1('0x76')]){_0x245566[_0x9da1('0x76')]=JSON[_0x9da1('0x8b')](_0x245566['joins']);for(var _0x56ec7d=0x0;_0x56ec7d<_0x245566[_0x9da1('0x76')][_0x9da1('0x33')];_0x56ec7d+=0x1){if(_0x245566['joins'][_0x56ec7d][_0x9da1('0x39')]&&_['includes'](_0x3f9133,_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x39')])&&_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x8c')]&&_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x77')]&&_0x245566['joins'][_0x56ec7d][_0x9da1('0x78')]){_0x407218[_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x39')]](_0x245566[_0x9da1('0x76')][_0x56ec7d]['foreignTable'],null,util[_0x9da1('0x89')](_0x9da1('0x79'),_0x245566[_0x9da1('0x6d')],_0x245566['joins'][_0x56ec7d]['parentKey'],_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x77')],_0x245566['joins'][_0x56ec7d]['foreignKey']));}}}if(_0x245566[_0x9da1('0x7a')]){_0x245566[_0x9da1('0x7a')]=JSON[_0x9da1('0x8b')](_0x245566[_0x9da1('0x7a')]);_0x407218[_0x9da1('0x37')](_0x3212ad(_0x245566['conditions'][_0x9da1('0x61')]));}_0x23bf86=_0x407218['clone']();_0x407218[_0x9da1('0x1c')](_0x1e466a);_0x407218[_0x9da1('0x1a')](0x0);logger[_0x9da1('0x7c')](_0x9da1('0x7d'),_0x407218['toString']());return dbH['sequelize'][_0x9da1('0x2e')](_0x407218[_0x9da1('0x7e')](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')][_0x9da1('0x81')]});}})[_0x9da1('0x21')](function(){return{'sql':_0x23bf86['toString']()};})[_0x9da1('0x21')](respondWithResult(_0x374754,null))[_0x9da1('0x40')](handleError(_0x374754,null));};
\ No newline at end of file
index 60c1600..5cab667 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x957a=['analytics_default_reports','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports'];(function(_0x1cc203,_0x4c03d5){var _0x307ef7=function(_0x4d38d2){while(--_0x4d38d2){_0x1cc203['push'](_0x1cc203['shift']());}};_0x307ef7(++_0x4c03d5);}(_0x957a,0x161));var _0xa957=function(_0x3fd8ad,_0x12268b){_0x3fd8ad=_0x3fd8ad-0x0;var _0x410c88=_0x957a[_0x3fd8ad];return _0x410c88;};'use strict';var _=require(_0xa957('0x0'));var util=require(_0xa957('0x1'));var logger=require(_0xa957('0x2'))('api');var moment=require(_0xa957('0x3'));var BPromise=require(_0xa957('0x4'));var rp=require(_0xa957('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa957('0x6'));var config=require(_0xa957('0x7'));var attributes=require(_0xa957('0x8'));module[_0xa957('0x9')]=function(_0x20d288,_0x5d2856){return _0x20d288['define']('AnalyticDefaultReport',attributes,{'tableName':_0xa957('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5d0d=['./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','moment','request-promise','path','../../config/environment'];(function(_0x495131,_0x17125c){var _0x425446=function(_0x58ef5c){while(--_0x58ef5c){_0x495131['push'](_0x495131['shift']());}};_0x425446(++_0x17125c);}(_0x5d0d,0x191));var _0xd5d0=function(_0x3b5049,_0x495a94){_0x3b5049=_0x3b5049-0x0;var _0x12454e=_0x5d0d[_0x3b5049];return _0x12454e;};'use strict';var _=require('lodash');var util=require(_0xd5d0('0x0'));var logger=require(_0xd5d0('0x1'))('api');var moment=require(_0xd5d0('0x2'));var BPromise=require('bluebird');var rp=require(_0xd5d0('0x3'));var fs=require('fs');var path=require(_0xd5d0('0x4'));var rimraf=require('rimraf');var config=require(_0xd5d0('0x5'));var attributes=require(_0xd5d0('0x6'));module[_0xd5d0('0x7')]=function(_0x41ed33,_0x11a0f2){return _0x41ed33[_0xd5d0('0x8')](_0xd5d0('0x9'),attributes,{'tableName':_0xd5d0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 792203b..49fc596 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x921c=['then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x921c,0x193));var _0xc921=function(_0x44a24d,_0x5d69c0){_0x44a24d=_0x44a24d-0x0;var _0x2dd199=_0x921c[_0x44a24d];return _0x2dd199;};'use strict';var _=require(_0xc921('0x0'));var util=require(_0xc921('0x1'));var moment=require(_0xc921('0x2'));var BPromise=require('bluebird');var rs=require(_0xc921('0x3'));var fs=require('fs');var Redis=require(_0xc921('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc921('0x5'));var logger=require('../../config/logger')(_0xc921('0x6'));var config=require(_0xc921('0x7'));var jayson=require(_0xc921('0x8'));var client=jayson[_0xc921('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ebf76,_0x59e9b8,_0x2e00d4){return new BPromise(function(_0x37053a,_0x58879f){return client[_0xc921('0xa')](_0x1ebf76,_0x2e00d4)[_0xc921('0xb')](function(_0x1254e6){logger[_0xc921('0xc')](_0xc921('0xd'),_0x59e9b8,_0xc921('0xe'));logger[_0xc921('0xf')](_0xc921('0x10'),_0x59e9b8,_0xc921('0xe'),JSON[_0xc921('0x11')](_0x1254e6));if(_0x1254e6['error']){if(_0x1254e6['error'][_0xc921('0x12')]===0x1f4){logger[_0xc921('0x13')](_0xc921('0xd'),_0x59e9b8,_0x1254e6['error'][_0xc921('0x14')]);return _0x58879f(_0x1254e6['error'][_0xc921('0x14')]);}logger[_0xc921('0x13')](_0xc921('0xd'),_0x59e9b8,_0x1254e6[_0xc921('0x13')][_0xc921('0x14')]);return _0x37053a(_0x1254e6[_0xc921('0x13')][_0xc921('0x14')]);}else{logger[_0xc921('0xc')](_0xc921('0xd'),_0x59e9b8,_0xc921('0xe'));_0x37053a(_0x1254e6[_0xc921('0x15')]['message']);}})[_0xc921('0x16')](function(_0x3a963f){logger[_0xc921('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x59e9b8,_0x3a963f);_0x58879f(_0x3a963f);});});}
\ No newline at end of file
+var _0x6490=['message','result','catch','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x2dd390,_0x1bc894){var _0x3afe47=function(_0x42d8d3){while(--_0x42d8d3){_0x2dd390['push'](_0x2dd390['shift']());}};_0x3afe47(++_0x1bc894);}(_0x6490,0x146));var _0x0649=function(_0x53f707,_0x51a2f7){_0x53f707=_0x53f707-0x0;var _0x10a9f5=_0x6490[_0x53f707];return _0x10a9f5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0649('0x0'));var BPromise=require('bluebird');var rs=require(_0x0649('0x1'));var fs=require('fs');var Redis=require(_0x0649('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0649('0x3'))(_0x0649('0x4'));var config=require('../../config/environment');var jayson=require(_0x0649('0x5'));var client=jayson[_0x0649('0x6')][_0x0649('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x416923,_0x50d29b,_0x18731e){return new BPromise(function(_0x387881,_0x278224){return client[_0x0649('0x8')](_0x416923,_0x18731e)[_0x0649('0x9')](function(_0x46ad11){logger[_0x0649('0xa')](_0x0649('0xb'),_0x50d29b,'request\x20sent');logger[_0x0649('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x50d29b,_0x0649('0xd'),JSON[_0x0649('0xe')](_0x46ad11));if(_0x46ad11[_0x0649('0xf')]){if(_0x46ad11['error']['code']===0x1f4){logger[_0x0649('0xf')](_0x0649('0xb'),_0x50d29b,_0x46ad11[_0x0649('0xf')][_0x0649('0x10')]);return _0x278224(_0x46ad11[_0x0649('0xf')]['message']);}logger[_0x0649('0xf')](_0x0649('0xb'),_0x50d29b,_0x46ad11[_0x0649('0xf')][_0x0649('0x10')]);return _0x387881(_0x46ad11['error'][_0x0649('0x10')]);}else{logger[_0x0649('0xa')](_0x0649('0xb'),_0x50d29b,'request\x20sent');_0x387881(_0x46ad11[_0x0649('0x11')]['message']);}})[_0x0649('0x12')](function(_0x2f3c41){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x50d29b,_0x2f3c41);_0x278224(_0x2f3c41);});});}
\ No newline at end of file
index 1204b3c..0a0917c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f24=['update','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/interaction/service','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','preview','/:id/run','run','/:id/query','post','put'];(function(_0x25f953,_0x67255e){var _0x416c7c=function(_0x55e09f){while(--_0x55e09f){_0x25f953['push'](_0x25f953['shift']());}};_0x416c7c(++_0x67255e);}(_0x1f24,0x12f));var _0x41f2=function(_0x2765b7,_0x5a384c){_0x2765b7=_0x2765b7-0x0;var _0x3d4ba6=_0x1f24[_0x2765b7];return _0x3d4ba6;};'use strict';var multer=require(_0x41f2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x41f2('0x1'));var express=require(_0x41f2('0x2'));var router=express['Router']();var fs_extra=require(_0x41f2('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x41f2('0x4'));var config=require('../../config/environment');var controller=require(_0x41f2('0x5'));router[_0x41f2('0x6')]('/',auth[_0x41f2('0x7')](),controller[_0x41f2('0x8')]);router[_0x41f2('0x6')](_0x41f2('0x9'),auth[_0x41f2('0x7')](),controller[_0x41f2('0xa')]);router[_0x41f2('0x6')]('/:id/preview',auth[_0x41f2('0x7')](),controller[_0x41f2('0xb')]);router[_0x41f2('0x6')](_0x41f2('0xc'),auth[_0x41f2('0x7')](),controller[_0x41f2('0xd')]);router['get'](_0x41f2('0xe'),auth[_0x41f2('0x7')](),controller['query']);router[_0x41f2('0xf')]('/',auth[_0x41f2('0x7')](),controller['create']);router[_0x41f2('0x10')](_0x41f2('0x9'),auth[_0x41f2('0x7')](),controller[_0x41f2('0x11')]);router['delete'](_0x41f2('0x9'),auth[_0x41f2('0x7')](),controller[_0x41f2('0x12')]);module[_0x41f2('0x13')]=router;
\ No newline at end of file
+var _0x51d1=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','get','/:id','show','/:id/preview','/:id/run','/:id/query','query','post','create','put','delete'];(function(_0x5a727d,_0x1b4ff6){var _0x3d870b=function(_0x5dab65){while(--_0x5dab65){_0x5a727d['push'](_0x5a727d['shift']());}};_0x3d870b(++_0x1b4ff6);}(_0x51d1,0x1d6));var _0x151d=function(_0x402eff,_0x2525f2){_0x402eff=_0x402eff-0x0;var _0x2eb371=_0x51d1[_0x402eff];return _0x2eb371;};'use strict';var multer=require(_0x151d('0x0'));var util=require(_0x151d('0x1'));var path=require(_0x151d('0x2'));var timeout=require(_0x151d('0x3'));var express=require(_0x151d('0x4'));var router=express[_0x151d('0x5')]();var fs_extra=require(_0x151d('0x6'));var auth=require(_0x151d('0x7'));var interaction=require(_0x151d('0x8'));var config=require(_0x151d('0x9'));var controller=require(_0x151d('0xa'));router['get']('/',auth[_0x151d('0xb')](),controller[_0x151d('0xc')]);router[_0x151d('0xd')](_0x151d('0xe'),auth[_0x151d('0xb')](),controller[_0x151d('0xf')]);router[_0x151d('0xd')](_0x151d('0x10'),auth[_0x151d('0xb')](),controller['preview']);router['get'](_0x151d('0x11'),auth[_0x151d('0xb')](),controller['run']);router[_0x151d('0xd')](_0x151d('0x12'),auth[_0x151d('0xb')](),controller[_0x151d('0x13')]);router[_0x151d('0x14')]('/',auth[_0x151d('0xb')](),controller[_0x151d('0x15')]);router[_0x151d('0x16')](_0x151d('0xe'),auth[_0x151d('0xb')](),controller['update']);router[_0x151d('0x17')](_0x151d('0xe'),auth[_0x151d('0xb')](),controller[_0x151d('0x18')]);module[_0x151d('0x19')]=router;
\ No newline at end of file
index 3a99e52..a717c11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7f5=['INTEGER','sequelize','moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual','scheduled'];(function(_0x17b169,_0x5e3f15){var _0x2b4ad4=function(_0x326c34){while(--_0x326c34){_0x17b169['push'](_0x17b169['shift']());}};_0x2b4ad4(++_0x5e3f15);}(_0xb7f5,0x1e2));var _0x5b7f=function(_0x1b7b41,_0x2fdeeb){_0x1b7b41=_0x1b7b41-0x0;var _0x4b3eed=_0xb7f5[_0x1b7b41];return _0x4b3eed;};'use strict';var Sequelize=require(_0x5b7f('0x0'));var moment=require(_0x5b7f('0x1'));module[_0x5b7f('0x2')]={'name':{'type':Sequelize[_0x5b7f('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x5b7f('0x4')](_0x5b7f('0x5'),_0x5b7f('0x6'),_0x5b7f('0x7')),'allowNull':![],'defaultValue':_0x5b7f('0x5')},'savename':{'type':Sequelize[_0x5b7f('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x5b7f('0x8')]},'endDate':{'type':Sequelize[_0x5b7f('0x8')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x5b7f('0x9')},'type':{'type':Sequelize[_0x5b7f('0x4')](_0x5b7f('0xa'),_0x5b7f('0xb')),'allowNull':![],'defaultValue':_0x5b7f('0xa')},'reportId':{'type':Sequelize[_0x5b7f('0xc')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x5b7f('0x3')]}};
\ No newline at end of file
+var _0x0f8a=['exports','STRING','ENUM','pdf','xlsx','csv','DATE','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x0f8a,0x10f));var _0xa0f8=function(_0x261c0a,_0x20d5a8){_0x261c0a=_0x261c0a-0x0;var _0x3a52d6=_0x0f8a[_0x261c0a];return _0x3a52d6;};'use strict';var Sequelize=require(_0xa0f8('0x0'));var moment=require(_0xa0f8('0x1'));module[_0xa0f8('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0xa0f8('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xa0f8('0x4')]('csv',_0xa0f8('0x5'),_0xa0f8('0x6')),'allowNull':![],'defaultValue':_0xa0f8('0x7')},'savename':{'type':Sequelize[_0xa0f8('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0xa0f8('0x8')]},'status':{'type':Sequelize[_0xa0f8('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0xa0f8('0x9'),_0xa0f8('0xa')),'allowNull':![],'defaultValue':_0xa0f8('0x9')},'reportId':{'type':Sequelize[_0xa0f8('0xb')](0xb)[_0xa0f8('0xc')]},'reportType':{'type':Sequelize[_0xa0f8('0x3')]}};
\ No newline at end of file
index befb60c..d706e17 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa795=['includeAll','include','findAll','rows','show','params','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','existsSync','join','root','server/files/reports','savename','ValidationError','exists','sendStatus','format','%s.%s','basename','toLowerCase','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','end','error','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL'];(function(_0x327c0f,_0x188c04){var _0x1a936d=function(_0xab8e0b){while(--_0xab8e0b){_0x327c0f['push'](_0x327c0f['shift']());}};_0x1a936d(++_0x188c04);}(_0xa795,0xd3));var _0x5a79=function(_0x4f40c7,_0x19dcdf){_0x4f40c7=_0x4f40c7-0x0;var _0x5be624=_0xa795[_0x4f40c7];return _0x5be624;};'use strict';var emlformat=require(_0x5a79('0x0'));var rimraf=require(_0x5a79('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5a79('0x2'));var rp=require(_0x5a79('0x3'));var moment=require(_0x5a79('0x4'));var BPromise=require(_0x5a79('0x5'));var Mustache=require(_0x5a79('0x6'));var util=require('util');var path=require(_0x5a79('0x7'));var sox=require(_0x5a79('0x8'));var csv=require('to-csv');var ejs=require(_0x5a79('0x9'));var fs=require('fs');var fs_extra=require(_0x5a79('0xa'));var _=require(_0x5a79('0xb'));var squel=require('squel');var crypto=require(_0x5a79('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5a79('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5a79('0xe'));var as=require(_0x5a79('0xf'));var hardwareService=require(_0x5a79('0x10'));var logger=require(_0x5a79('0x11'))('api');var utils=require(_0x5a79('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x5a79('0x13'));var db=require(_0x5a79('0x14'))['db'];function respondWithStatusCode(_0x53da95,_0x492348){_0x492348=_0x492348||0xcc;return function(_0x52ac87){if(_0x52ac87){return _0x53da95['sendStatus'](_0x492348);}return _0x53da95['status'](_0x492348)['end']();};}function respondWithResult(_0x3595cf,_0x132c66){_0x132c66=_0x132c66||0xc8;return function(_0x29b7af){if(_0x29b7af){return _0x3595cf[_0x5a79('0x15')](_0x132c66)[_0x5a79('0x16')](_0x29b7af);}};}function respondWithFilteredResult(_0x4cfac8,_0x1f6d34){return function(_0x45da4b){if(_0x45da4b){var _0x314bda=typeof _0x1f6d34[_0x5a79('0x17')]===_0x5a79('0x18')&&typeof _0x1f6d34[_0x5a79('0x19')]===_0x5a79('0x18');var _0x2ea41b=_0x45da4b[_0x5a79('0x1a')];var _0x1a98c9=_0x314bda?0x0:_0x1f6d34[_0x5a79('0x17')];var _0x166c32=_0x314bda?_0x45da4b[_0x5a79('0x1a')]:_0x1f6d34[_0x5a79('0x17')]+_0x1f6d34[_0x5a79('0x19')];var _0xe8c93;if(_0x166c32>=_0x2ea41b){_0x166c32=_0x2ea41b;_0xe8c93=0xc8;}else{_0xe8c93=0xce;}_0x4cfac8[_0x5a79('0x15')](_0xe8c93);return _0x4cfac8['set'](_0x5a79('0x1b'),_0x1a98c9+'-'+_0x166c32+'/'+_0x2ea41b)[_0x5a79('0x16')](_0x45da4b);}return null;};}function patchUpdates(_0x521d23){return function(_0x415c7f){try{jsonpatch[_0x5a79('0x1c')](_0x415c7f,_0x521d23,!![]);}catch(_0x309d79){return BPromise[_0x5a79('0x1d')](_0x309d79);}return _0x415c7f[_0x5a79('0x1e')]();};}function saveUpdates(_0x26f06a,_0x573024){return function(_0x3b1122){if(_0x3b1122){return _0x3b1122[_0x5a79('0x1f')](_0x26f06a)[_0x5a79('0x20')](function(_0x42bea3){return _0x42bea3;});}return null;};}function removeEntity(_0x5a6d56,_0x2c18de){return function(_0x24ff7b){if(_0x24ff7b){return _0x24ff7b[_0x5a79('0x21')]()[_0x5a79('0x20')](function(){var _0x28fdb1=_0x24ff7b[_0x5a79('0x22')]({'plain':!![]});var _0xa1d6be=_0x5a79('0x23');return db['UserProfileResource'][_0x5a79('0x21')]({'where':{'type':_0xa1d6be,'resourceId':_0x28fdb1['id']}})[_0x5a79('0x20')](function(){return _0x24ff7b;});})[_0x5a79('0x20')](function(){_0x5a6d56['status'](0xcc)[_0x5a79('0x24')]();});}};}function handleEntityNotFound(_0xdd7bc0,_0x2086bb){return function(_0x4686a9){if(!_0x4686a9){_0xdd7bc0['sendStatus'](0x194);}return _0x4686a9;};}function handleError(_0x37fd42,_0x92a08b){_0x92a08b=_0x92a08b||0x1f4;return function(_0x124621){logger[_0x5a79('0x25')](_0x124621['stack']);if(_0x124621[_0x5a79('0x26')]){delete _0x124621['name'];}_0x37fd42[_0x5a79('0x15')](_0x92a08b)[_0x5a79('0x27')](_0x124621);};}exports[_0x5a79('0x28')]=function(_0x36eacf,_0x17549f){var _0x1d62d9={},_0x26f9e1={},_0x329c27={'count':0x0,'rows':[]};var _0x409d5f=_[_0x5a79('0x29')](db[_0x5a79('0x2a')][_0x5a79('0x2b')],function(_0x2151b6){return{'name':_0x2151b6[_0x5a79('0x2c')],'type':_0x2151b6[_0x5a79('0x2d')][_0x5a79('0x2e')]};});_0x26f9e1[_0x5a79('0x2f')]=_['map'](_0x409d5f,_0x5a79('0x26'));_0x26f9e1[_0x5a79('0x30')]=_[_0x5a79('0x31')](_0x36eacf['query']);_0x26f9e1['filters']=_[_0x5a79('0x32')](_0x26f9e1[_0x5a79('0x2f')],_0x26f9e1[_0x5a79('0x30')]);_0x1d62d9[_0x5a79('0x33')]=_[_0x5a79('0x32')](_0x26f9e1['model'],qs[_0x5a79('0x34')](_0x36eacf[_0x5a79('0x30')][_0x5a79('0x34')]));_0x1d62d9[_0x5a79('0x33')]=_0x1d62d9[_0x5a79('0x33')]['length']?_0x1d62d9[_0x5a79('0x33')]:_0x26f9e1['model'];if(!_0x36eacf[_0x5a79('0x30')][_0x5a79('0x35')](_0x5a79('0x36'))){_0x1d62d9[_0x5a79('0x19')]=qs['limit'](_0x36eacf[_0x5a79('0x30')][_0x5a79('0x19')]);_0x1d62d9[_0x5a79('0x17')]=qs['offset'](_0x36eacf[_0x5a79('0x30')]['offset']);}_0x1d62d9[_0x5a79('0x37')]=qs['sort'](_0x36eacf[_0x5a79('0x30')][_0x5a79('0x38')]);_0x1d62d9[_0x5a79('0x39')]=qs[_0x5a79('0x3a')](_[_0x5a79('0x3b')](_0x36eacf[_0x5a79('0x30')],_0x26f9e1[_0x5a79('0x3a')]),_0x409d5f);if(_0x36eacf['query']['filter']){_0x1d62d9[_0x5a79('0x39')]=_[_0x5a79('0x3c')](_0x1d62d9[_0x5a79('0x39')],{'$or':_['map'](_0x409d5f,function(_0x5d4bb3){if(_0x5d4bb3[_0x5a79('0x2d')]!==_0x5a79('0x3d')){var _0x5e00f2={};_0x5e00f2[_0x5d4bb3[_0x5a79('0x26')]]={'$like':'%'+_0x36eacf['query']['filter']+'%'};return _0x5e00f2;}})});}_0x1d62d9=_[_0x5a79('0x3c')]({},_0x1d62d9,_0x36eacf['options']);var _0x3180ab={'where':_0x1d62d9[_0x5a79('0x39')]};return db[_0x5a79('0x2a')][_0x5a79('0x1a')](_0x3180ab)[_0x5a79('0x20')](function(_0x1b0217){_0x329c27[_0x5a79('0x1a')]=_0x1b0217;if(_0x36eacf[_0x5a79('0x30')][_0x5a79('0x3e')]){_0x1d62d9[_0x5a79('0x3f')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x5a79('0x40')](_0x1d62d9);})[_0x5a79('0x20')](function(_0x5d12b0){_0x329c27[_0x5a79('0x41')]=_0x5d12b0;return _0x329c27;})[_0x5a79('0x20')](respondWithFilteredResult(_0x17549f,_0x1d62d9))['catch'](handleError(_0x17549f,null));};exports[_0x5a79('0x42')]=function(_0x3b91de,_0x87ed3c){var _0x477169={'raw':!![],'where':{'id':_0x3b91de[_0x5a79('0x43')]['id']}},_0x406558={};_0x406558[_0x5a79('0x2f')]=_[_0x5a79('0x31')](db[_0x5a79('0x2a')][_0x5a79('0x2b')]);_0x406558[_0x5a79('0x30')]=_[_0x5a79('0x31')](_0x3b91de['query']);_0x406558[_0x5a79('0x3a')]=_['intersection'](_0x406558[_0x5a79('0x2f')],_0x406558[_0x5a79('0x30')]);_0x477169[_0x5a79('0x33')]=_[_0x5a79('0x32')](_0x406558['model'],qs[_0x5a79('0x34')](_0x3b91de['query'][_0x5a79('0x34')]));_0x477169[_0x5a79('0x33')]=_0x477169[_0x5a79('0x33')]['length']?_0x477169[_0x5a79('0x33')]:_0x406558['model'];if(_0x3b91de[_0x5a79('0x30')][_0x5a79('0x3e')]){_0x477169[_0x5a79('0x3f')]=[{'all':!![]}];}_0x477169=_[_0x5a79('0x3c')]({},_0x477169,_0x3b91de[_0x5a79('0x44')]);return db['AnalyticExtractedReport'][_0x5a79('0x45')](_0x477169)[_0x5a79('0x20')](handleEntityNotFound(_0x87ed3c,null))[_0x5a79('0x20')](respondWithResult(_0x87ed3c,null))[_0x5a79('0x46')](handleError(_0x87ed3c,null));};exports[_0x5a79('0x47')]=function(_0x331e56,_0x5661a6){return db[_0x5a79('0x2a')]['create'](_0x331e56[_0x5a79('0x48')],{})['then'](function(_0x2d3d9f){var _0x3af999=_0x331e56[_0x5a79('0x49')][_0x5a79('0x22')]({'plain':!![]});if(!_0x3af999)throw new Error(_0x5a79('0x4a'));if(_0x3af999['role']===_0x5a79('0x49')){var _0x6eb97f=_0x2d3d9f[_0x5a79('0x22')]({'plain':!![]});var _0x3125ea=_0x5a79('0x23');return db['UserProfileSection'][_0x5a79('0x45')]({'where':{'name':_0x3125ea,'userProfileId':_0x3af999[_0x5a79('0x4b')]},'raw':!![]})['then'](function(_0x2d9d4c){if(_0x2d9d4c&&_0x2d9d4c[_0x5a79('0x4c')]===0x0){return db[_0x5a79('0x4d')][_0x5a79('0x47')]({'name':_0x6eb97f[_0x5a79('0x26')],'resourceId':_0x6eb97f['id'],'type':_0x2d9d4c['name'],'sectionId':_0x2d9d4c['id']},{})[_0x5a79('0x20')](function(){return _0x2d3d9f;});}else{return _0x2d3d9f;}})[_0x5a79('0x46')](function(_0x337bd4){logger[_0x5a79('0x25')](_0x5a79('0x4e'),_0x337bd4);throw _0x337bd4;});}return _0x2d3d9f;})[_0x5a79('0x20')](respondWithResult(_0x5661a6,0xc9))[_0x5a79('0x46')](handleError(_0x5661a6,null));};exports[_0x5a79('0x1f')]=function(_0x3a9ef4,_0x2add5e){if(_0x3a9ef4[_0x5a79('0x48')]['id']){delete _0x3a9ef4[_0x5a79('0x48')]['id'];}return db[_0x5a79('0x2a')][_0x5a79('0x45')]({'where':{'id':_0x3a9ef4[_0x5a79('0x43')]['id']}})[_0x5a79('0x20')](handleEntityNotFound(_0x2add5e,null))[_0x5a79('0x20')](saveUpdates(_0x3a9ef4[_0x5a79('0x48')],null))[_0x5a79('0x20')](respondWithResult(_0x2add5e,null))['catch'](handleError(_0x2add5e,null));};exports[_0x5a79('0x21')]=function(_0x1ad137,_0x411867){return db['AnalyticExtractedReport'][_0x5a79('0x45')]({'where':{'id':_0x1ad137[_0x5a79('0x43')]['id']}})[_0x5a79('0x20')](handleEntityNotFound(_0x411867,null))[_0x5a79('0x20')](removeEntity(_0x411867,null))['catch'](handleError(_0x411867,null));};exports['download']=function(_0x4dbd48,_0x24e721,_0x58fa78){return db['AnalyticExtractedReport'][_0x5a79('0x45')]({'where':{'id':_0x4dbd48[_0x5a79('0x43')]['id']},'attributes':[_0x5a79('0x26'),'basename','savename','output'],'raw':!![]})[_0x5a79('0x20')](handleEntityNotFound(_0x24e721,null))[_0x5a79('0x20')](function(_0x5c33e6){if(_0x5c33e6){if(!fs[_0x5a79('0x4f')](path[_0x5a79('0x50')](config[_0x5a79('0x51')],_0x5a79('0x52'),_0x5c33e6[_0x5a79('0x53')]))){throw new db['Sequelize'][(_0x5a79('0x54'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x4dbd48[_0x5a79('0x30')][_0x5a79('0x55')]){return _0x24e721[_0x5a79('0x56')](0xc8);}return _0x24e721['download'](path['join'](config[_0x5a79('0x51')],_0x5a79('0x52'),_0x5c33e6[_0x5a79('0x53')]),util[_0x5a79('0x57')](_0x5a79('0x58'),_0x5c33e6[_0x5a79('0x59')]||_0x5c33e6[_0x5a79('0x26')],_0x5c33e6['output'][_0x5a79('0x5a')]()));}})[_0x5a79('0x46')](handleError(_0x24e721,null));};
\ No newline at end of file
+var _0x3999=['model','query','keys','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','options','AnalyticExtractedReport','includeAll','show','rawAttributes','include','find','catch','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','name','map','type','key'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0x3999,0x13d));var _0x9399=function(_0x40edcc,_0x29537c){_0x40edcc=_0x40edcc-0x0;var _0x4a14c4=_0x3999[_0x40edcc];return _0x4a14c4;};'use strict';var emlformat=require(_0x9399('0x0'));var rimraf=require(_0x9399('0x1'));var zipdir=require(_0x9399('0x2'));var jsonpatch=require(_0x9399('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9399('0x4'));var Mustache=require('mustache');var util=require(_0x9399('0x5'));var path=require('path');var sox=require(_0x9399('0x6'));var csv=require('to-csv');var ejs=require(_0x9399('0x7'));var fs=require('fs');var fs_extra=require(_0x9399('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9399('0x9'));var jsforce=require(_0x9399('0xa'));var deskjs=require(_0x9399('0xb'));var toCsv=require(_0x9399('0xc'));var querystring=require(_0x9399('0xd'));var Papa=require(_0x9399('0xe'));var Redis=require(_0x9399('0xf'));var authService=require(_0x9399('0x10'));var qs=require(_0x9399('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9399('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x9399('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x9399('0x14'))['db'];function respondWithStatusCode(_0x4232c5,_0x5cc023){_0x5cc023=_0x5cc023||0xcc;return function(_0x54f0a2){if(_0x54f0a2){return _0x4232c5[_0x9399('0x15')](_0x5cc023);}return _0x4232c5[_0x9399('0x16')](_0x5cc023)[_0x9399('0x17')]();};}function respondWithResult(_0x1994e5,_0x505b4f){_0x505b4f=_0x505b4f||0xc8;return function(_0x51e4d3){if(_0x51e4d3){return _0x1994e5[_0x9399('0x16')](_0x505b4f)[_0x9399('0x18')](_0x51e4d3);}};}function respondWithFilteredResult(_0x2f4063,_0x2e64cd){return function(_0x1385d7){if(_0x1385d7){var _0x154c82=typeof _0x2e64cd[_0x9399('0x19')]===_0x9399('0x1a')&&typeof _0x2e64cd[_0x9399('0x1b')]===_0x9399('0x1a');var _0x175ab2=_0x1385d7[_0x9399('0x1c')];var _0x1c51d1=_0x154c82?0x0:_0x2e64cd[_0x9399('0x19')];var _0x576c65=_0x154c82?_0x1385d7['count']:_0x2e64cd['offset']+_0x2e64cd[_0x9399('0x1b')];var _0x4efc57;if(_0x576c65>=_0x175ab2){_0x576c65=_0x175ab2;_0x4efc57=0xc8;}else{_0x4efc57=0xce;}_0x2f4063[_0x9399('0x16')](_0x4efc57);return _0x2f4063[_0x9399('0x1d')](_0x9399('0x1e'),_0x1c51d1+'-'+_0x576c65+'/'+_0x175ab2)[_0x9399('0x18')](_0x1385d7);}return null;};}function patchUpdates(_0x2ed907){return function(_0x4ceddf){try{jsonpatch[_0x9399('0x1f')](_0x4ceddf,_0x2ed907,!![]);}catch(_0x572f4b){return BPromise[_0x9399('0x20')](_0x572f4b);}return _0x4ceddf[_0x9399('0x21')]();};}function saveUpdates(_0x5c851d,_0x25bd0b){return function(_0x5f5ce3){if(_0x5f5ce3){return _0x5f5ce3[_0x9399('0x22')](_0x5c851d)[_0x9399('0x23')](function(_0x456af9){return _0x456af9;});}return null;};}function removeEntity(_0x5e35dd,_0x5dfa2d){return function(_0x34d405){if(_0x34d405){return _0x34d405[_0x9399('0x24')]()[_0x9399('0x23')](function(){var _0x4de8a0=_0x34d405[_0x9399('0x25')]({'plain':!![]});var _0x155f2e=_0x9399('0x26');return db['UserProfileResource'][_0x9399('0x24')]({'where':{'type':_0x155f2e,'resourceId':_0x4de8a0['id']}})[_0x9399('0x23')](function(){return _0x34d405;});})['then'](function(){_0x5e35dd[_0x9399('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x470b48,_0x3f8754){return function(_0x166963){if(!_0x166963){_0x470b48[_0x9399('0x15')](0x194);}return _0x166963;};}function handleError(_0x5ad97e,_0x2ed2a4){_0x2ed2a4=_0x2ed2a4||0x1f4;return function(_0x34c268){logger['error'](_0x34c268['stack']);if(_0x34c268[_0x9399('0x27')]){delete _0x34c268[_0x9399('0x27')];}_0x5ad97e[_0x9399('0x16')](_0x2ed2a4)['send'](_0x34c268);};}exports['index']=function(_0x2090b5,_0x50015e){var _0x2a6f6a={},_0x266a2f={},_0x6345d5={'count':0x0,'rows':[]};var _0x2d3348=_[_0x9399('0x28')](db['AnalyticExtractedReport']['rawAttributes'],function(_0x18a34b){return{'name':_0x18a34b['fieldName'],'type':_0x18a34b[_0x9399('0x29')][_0x9399('0x2a')]};});_0x266a2f[_0x9399('0x2b')]=_[_0x9399('0x28')](_0x2d3348,_0x9399('0x27'));_0x266a2f[_0x9399('0x2c')]=_[_0x9399('0x2d')](_0x2090b5[_0x9399('0x2c')]);_0x266a2f['filters']=_['intersection'](_0x266a2f[_0x9399('0x2b')],_0x266a2f['query']);_0x2a6f6a['attributes']=_['intersection'](_0x266a2f[_0x9399('0x2b')],qs['fields'](_0x2090b5[_0x9399('0x2c')][_0x9399('0x2e')]));_0x2a6f6a[_0x9399('0x2f')]=_0x2a6f6a[_0x9399('0x2f')][_0x9399('0x30')]?_0x2a6f6a[_0x9399('0x2f')]:_0x266a2f[_0x9399('0x2b')];if(!_0x2090b5['query'][_0x9399('0x31')]('nolimit')){_0x2a6f6a[_0x9399('0x1b')]=qs[_0x9399('0x1b')](_0x2090b5[_0x9399('0x2c')][_0x9399('0x1b')]);_0x2a6f6a['offset']=qs[_0x9399('0x19')](_0x2090b5[_0x9399('0x2c')][_0x9399('0x19')]);}_0x2a6f6a['order']=qs[_0x9399('0x32')](_0x2090b5['query'][_0x9399('0x32')]);_0x2a6f6a[_0x9399('0x33')]=qs[_0x9399('0x34')](_[_0x9399('0x35')](_0x2090b5[_0x9399('0x2c')],_0x266a2f[_0x9399('0x34')]),_0x2d3348);if(_0x2090b5[_0x9399('0x2c')][_0x9399('0x36')]){_0x2a6f6a['where']=_[_0x9399('0x37')](_0x2a6f6a['where'],{'$or':_[_0x9399('0x28')](_0x2d3348,function(_0x2d02ac){if(_0x2d02ac['type']!==_0x9399('0x38')){var _0x2d774e={};_0x2d774e[_0x2d02ac['name']]={'$like':'%'+_0x2090b5[_0x9399('0x2c')]['filter']+'%'};return _0x2d774e;}})});}_0x2a6f6a=_[_0x9399('0x37')]({},_0x2a6f6a,_0x2090b5[_0x9399('0x39')]);var _0x37e9f5={'where':_0x2a6f6a[_0x9399('0x33')]};return db[_0x9399('0x3a')]['count'](_0x37e9f5)[_0x9399('0x23')](function(_0x1395c4){_0x6345d5[_0x9399('0x1c')]=_0x1395c4;if(_0x2090b5[_0x9399('0x2c')][_0x9399('0x3b')]){_0x2a6f6a['include']=[{'all':!![]}];}return db[_0x9399('0x3a')]['findAll'](_0x2a6f6a);})[_0x9399('0x23')](function(_0x96b1a1){_0x6345d5['rows']=_0x96b1a1;return _0x6345d5;})[_0x9399('0x23')](respondWithFilteredResult(_0x50015e,_0x2a6f6a))['catch'](handleError(_0x50015e,null));};exports[_0x9399('0x3c')]=function(_0x5b8e24,_0x5a0828){var _0x3eef99={'raw':!![],'where':{'id':_0x5b8e24['params']['id']}},_0xbbfc4c={};_0xbbfc4c[_0x9399('0x2b')]=_[_0x9399('0x2d')](db['AnalyticExtractedReport'][_0x9399('0x3d')]);_0xbbfc4c[_0x9399('0x2c')]=_[_0x9399('0x2d')](_0x5b8e24[_0x9399('0x2c')]);_0xbbfc4c[_0x9399('0x34')]=_['intersection'](_0xbbfc4c['model'],_0xbbfc4c['query']);_0x3eef99[_0x9399('0x2f')]=_['intersection'](_0xbbfc4c[_0x9399('0x2b')],qs[_0x9399('0x2e')](_0x5b8e24[_0x9399('0x2c')][_0x9399('0x2e')]));_0x3eef99[_0x9399('0x2f')]=_0x3eef99[_0x9399('0x2f')]['length']?_0x3eef99[_0x9399('0x2f')]:_0xbbfc4c[_0x9399('0x2b')];if(_0x5b8e24[_0x9399('0x2c')][_0x9399('0x3b')]){_0x3eef99[_0x9399('0x3e')]=[{'all':!![]}];}_0x3eef99=_['merge']({},_0x3eef99,_0x5b8e24[_0x9399('0x39')]);return db[_0x9399('0x3a')][_0x9399('0x3f')](_0x3eef99)['then'](handleEntityNotFound(_0x5a0828,null))[_0x9399('0x23')](respondWithResult(_0x5a0828,null))[_0x9399('0x40')](handleError(_0x5a0828,null));};exports[_0x9399('0x41')]=function(_0x41d285,_0x291ea8){return db['AnalyticExtractedReport'][_0x9399('0x41')](_0x41d285[_0x9399('0x42')],{})[_0x9399('0x23')](function(_0x41d95d){var _0x4981af=_0x41d285['user'][_0x9399('0x25')]({'plain':!![]});if(!_0x4981af)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4981af[_0x9399('0x43')]===_0x9399('0x44')){var _0x45bf45=_0x41d95d['get']({'plain':!![]});var _0xbe8f39=_0x9399('0x26');return db[_0x9399('0x45')]['find']({'where':{'name':_0xbe8f39,'userProfileId':_0x4981af[_0x9399('0x46')]},'raw':!![]})[_0x9399('0x23')](function(_0x1ea05d){if(_0x1ea05d&&_0x1ea05d[_0x9399('0x47')]===0x0){return db[_0x9399('0x48')]['create']({'name':_0x45bf45['name'],'resourceId':_0x45bf45['id'],'type':_0x1ea05d[_0x9399('0x27')],'sectionId':_0x1ea05d['id']},{})[_0x9399('0x23')](function(){return _0x41d95d;});}else{return _0x41d95d;}})['catch'](function(_0x3f2916){logger[_0x9399('0x49')](_0x9399('0x4a'),_0x3f2916);throw _0x3f2916;});}return _0x41d95d;})[_0x9399('0x23')](respondWithResult(_0x291ea8,0xc9))[_0x9399('0x40')](handleError(_0x291ea8,null));};exports[_0x9399('0x22')]=function(_0x59c013,_0x3d4179){if(_0x59c013[_0x9399('0x42')]['id']){delete _0x59c013[_0x9399('0x42')]['id'];}return db[_0x9399('0x3a')][_0x9399('0x3f')]({'where':{'id':_0x59c013[_0x9399('0x4b')]['id']}})[_0x9399('0x23')](handleEntityNotFound(_0x3d4179,null))[_0x9399('0x23')](saveUpdates(_0x59c013['body'],null))[_0x9399('0x23')](respondWithResult(_0x3d4179,null))[_0x9399('0x40')](handleError(_0x3d4179,null));};exports[_0x9399('0x24')]=function(_0x4d07a5,_0xac6fcd){return db[_0x9399('0x3a')][_0x9399('0x3f')]({'where':{'id':_0x4d07a5[_0x9399('0x4b')]['id']}})[_0x9399('0x23')](handleEntityNotFound(_0xac6fcd,null))[_0x9399('0x23')](removeEntity(_0xac6fcd,null))[_0x9399('0x40')](handleError(_0xac6fcd,null));};exports[_0x9399('0x4c')]=function(_0xdcb849,_0x4ebeb2,_0x131825){return db[_0x9399('0x3a')][_0x9399('0x3f')]({'where':{'id':_0xdcb849[_0x9399('0x4b')]['id']},'attributes':['name',_0x9399('0x4d'),_0x9399('0x4e'),_0x9399('0x4f')],'raw':!![]})[_0x9399('0x23')](handleEntityNotFound(_0x4ebeb2,null))[_0x9399('0x23')](function(_0x3f3f08){if(_0x3f3f08){if(!fs[_0x9399('0x50')](path[_0x9399('0x51')](config[_0x9399('0x52')],_0x9399('0x53'),_0x3f3f08['savename']))){throw new db[(_0x9399('0x54'))][(_0x9399('0x55'))](_0x9399('0x56'));}if(_0xdcb849[_0x9399('0x2c')]['exists']){return _0x4ebeb2[_0x9399('0x15')](0xc8);}return _0x4ebeb2[_0x9399('0x4c')](path['join'](config['root'],_0x9399('0x53'),_0x3f3f08[_0x9399('0x4e')]),util[_0x9399('0x57')](_0x9399('0x58'),_0x3f3f08[_0x9399('0x4d')]||_0x3f3f08[_0x9399('0x27')],_0x3f3f08[_0x9399('0x4f')][_0x9399('0x59')]()));}})[_0x9399('0x40')](handleError(_0x4ebeb2,null));};
\ No newline at end of file
index 21ef5a8..c5a01b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f96=['define','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports'];(function(_0x3e1f4c,_0x369893){var _0x4547eb=function(_0xcc98aa){while(--_0xcc98aa){_0x3e1f4c['push'](_0x3e1f4c['shift']());}};_0x4547eb(++_0x369893);}(_0x3f96,0x1cd));var _0x63f9=function(_0x3d4feb,_0x17dd4f){_0x3d4feb=_0x3d4feb-0x0;var _0x5c5f18=_0x3f96[_0x3d4feb];return _0x5c5f18;};'use strict';var _=require(_0x63f9('0x0'));var util=require(_0x63f9('0x1'));var logger=require(_0x63f9('0x2'))('api');var moment=require(_0x63f9('0x3'));var BPromise=require('bluebird');var rp=require(_0x63f9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x63f9('0x5'));var config=require(_0x63f9('0x6'));var attributes=require(_0x63f9('0x7'));module[_0x63f9('0x8')]=function(_0x50b7eb,_0x2beed7){return _0x50b7eb[_0x63f9('0x9')]('AnalyticExtractedReport',attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4299=['exports','define','AnalyticExtractedReport','lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./analyticExtractedReport.attributes'];(function(_0x4350c2,_0x112f3c){var _0x8b6406=function(_0x49e845){while(--_0x49e845){_0x4350c2['push'](_0x4350c2['shift']());}};_0x8b6406(++_0x112f3c);}(_0x4299,0xf5));var _0x9429=function(_0x4f338e,_0x32e8a1){_0x4f338e=_0x4f338e-0x0;var _0x556e0a=_0x4299[_0x4f338e];return _0x556e0a;};'use strict';var _=require(_0x9429('0x0'));var util=require('util');var logger=require(_0x9429('0x1'))(_0x9429('0x2'));var moment=require('moment');var BPromise=require(_0x9429('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9429('0x4'));var rimraf=require(_0x9429('0x5'));var config=require(_0x9429('0x6'));var attributes=require(_0x9429('0x7'));module[_0x9429('0x8')]=function(_0x254ff8,_0x544bce){return _0x254ff8[_0x9429('0x9')](_0x9429('0xa'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ca07d8d..ff4ef35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca99=['../../config/environment','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0xca99,0xca));var _0x9ca9=function(_0x405d5b,_0x367d49){_0x405d5b=_0x405d5b-0x0;var _0x26b41c=_0xca99[_0x405d5b];return _0x26b41c;};'use strict';var _=require(_0x9ca9('0x0'));var util=require(_0x9ca9('0x1'));var moment=require(_0x9ca9('0x2'));var BPromise=require(_0x9ca9('0x3'));var rs=require(_0x9ca9('0x4'));var fs=require('fs');var Redis=require(_0x9ca9('0x5'));var db=require(_0x9ca9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9ca9('0x7'))('rpc');var config=require(_0x9ca9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9ca9('0x9')][_0x9ca9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10436a,_0x46cbe1,_0x3b67bd){return new BPromise(function(_0x531d59,_0x406510){return client[_0x9ca9('0xb')](_0x10436a,_0x3b67bd)[_0x9ca9('0xc')](function(_0x46f875){logger[_0x9ca9('0xd')](_0x9ca9('0xe'),_0x46cbe1,_0x9ca9('0xf'));logger['debug'](_0x9ca9('0x10'),_0x46cbe1,'request\x20sent',JSON['stringify'](_0x46f875));if(_0x46f875['error']){if(_0x46f875[_0x9ca9('0x11')][_0x9ca9('0x12')]===0x1f4){logger[_0x9ca9('0x11')](_0x9ca9('0xe'),_0x46cbe1,_0x46f875[_0x9ca9('0x11')][_0x9ca9('0x13')]);return _0x406510(_0x46f875[_0x9ca9('0x11')]['message']);}logger[_0x9ca9('0x11')](_0x9ca9('0xe'),_0x46cbe1,_0x46f875[_0x9ca9('0x11')][_0x9ca9('0x13')]);return _0x531d59(_0x46f875['error'][_0x9ca9('0x13')]);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x46cbe1,_0x9ca9('0xf'));_0x531d59(_0x46f875[_0x9ca9('0x14')][_0x9ca9('0x13')]);}})['catch'](function(_0x345ab8){logger[_0x9ca9('0x11')](_0x9ca9('0xe'),_0x46cbe1,_0x345ab8);_0x406510(_0x345ab8);});});}
\ No newline at end of file
+var _0x2c24=['stringify','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2a16f0,_0x5e516e){var _0x2b2b9b=function(_0x333718){while(--_0x333718){_0x2a16f0['push'](_0x2a16f0['shift']());}};_0x2b2b9b(++_0x5e516e);}(_0x2c24,0x190));var _0x42c2=function(_0x32449b,_0x35c74b){_0x32449b=_0x32449b-0x0;var _0x28052a=_0x2c24[_0x32449b];return _0x28052a;};'use strict';var _=require(_0x42c2('0x0'));var util=require(_0x42c2('0x1'));var moment=require('moment');var BPromise=require(_0x42c2('0x2'));var rs=require(_0x42c2('0x3'));var fs=require('fs');var Redis=require(_0x42c2('0x4'));var db=require(_0x42c2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x42c2('0x6'))('rpc');var config=require(_0x42c2('0x7'));var jayson=require(_0x42c2('0x8'));var client=jayson[_0x42c2('0x9')][_0x42c2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x65f37c,_0x3e16c3,_0x1aa617){return new BPromise(function(_0x3bb141,_0x82ceab){return client[_0x42c2('0xb')](_0x65f37c,_0x1aa617)[_0x42c2('0xc')](function(_0x3ec9de){logger[_0x42c2('0xd')](_0x42c2('0xe'),_0x3e16c3,'request\x20sent');logger[_0x42c2('0xf')](_0x42c2('0x10'),_0x3e16c3,_0x42c2('0x11'),JSON[_0x42c2('0x12')](_0x3ec9de));if(_0x3ec9de['error']){if(_0x3ec9de[_0x42c2('0x13')]['code']===0x1f4){logger['error'](_0x42c2('0xe'),_0x3e16c3,_0x3ec9de[_0x42c2('0x13')]['message']);return _0x82ceab(_0x3ec9de[_0x42c2('0x13')][_0x42c2('0x14')]);}logger[_0x42c2('0x13')](_0x42c2('0xe'),_0x3e16c3,_0x3ec9de[_0x42c2('0x13')][_0x42c2('0x14')]);return _0x3bb141(_0x3ec9de['error'][_0x42c2('0x14')]);}else{logger['info'](_0x42c2('0xe'),_0x3e16c3,_0x42c2('0x11'));_0x3bb141(_0x3ec9de[_0x42c2('0x15')][_0x42c2('0x14')]);}})['catch'](function(_0x3d4697){logger[_0x42c2('0x13')](_0x42c2('0xe'),_0x3e16c3,_0x3d4697);_0x82ceab(_0x3d4697);});});}
\ No newline at end of file
index 8697599..fe983e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa1c3=['update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','/:id/download','download','post','create','/:id'];(function(_0x29ce02,_0x140514){var _0x318595=function(_0xe3bfe1){while(--_0xe3bfe1){_0x29ce02['push'](_0x29ce02['shift']());}};_0x318595(++_0x140514);}(_0xa1c3,0x1bc));var _0x3a1c=function(_0xcb4ad7,_0x2c761d){_0xcb4ad7=_0xcb4ad7-0x0;var _0x1de519=_0xa1c3[_0xcb4ad7];return _0x1de519;};'use strict';var multer=require('multer');var util=require(_0x3a1c('0x0'));var path=require(_0x3a1c('0x1'));var timeout=require(_0x3a1c('0x2'));var express=require(_0x3a1c('0x3'));var router=express[_0x3a1c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3a1c('0x5'));var interaction=require(_0x3a1c('0x6'));var config=require('../../config/environment');var controller=require('./analyticExtractedReport.controller');router[_0x3a1c('0x7')]('/',auth[_0x3a1c('0x8')](),controller[_0x3a1c('0x9')]);router[_0x3a1c('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x3a1c('0xa')]);router[_0x3a1c('0x7')](_0x3a1c('0xb'),auth['isAuthenticated'](),controller[_0x3a1c('0xc')]);router[_0x3a1c('0xd')]('/',auth[_0x3a1c('0x8')](),controller[_0x3a1c('0xe')]);router['put'](_0x3a1c('0xf'),auth[_0x3a1c('0x8')](),controller[_0x3a1c('0x10')]);router[_0x3a1c('0x11')](_0x3a1c('0xf'),auth['isAuthenticated'](),controller[_0x3a1c('0x12')]);module[_0x3a1c('0x13')]=router;
\ No newline at end of file
+var _0xc031=['Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','update','exports','multer','path','connect-timeout','express'];(function(_0x32f2f4,_0x9051c5){var _0x2d88a3=function(_0x486546){while(--_0x486546){_0x32f2f4['push'](_0x32f2f4['shift']());}};_0x2d88a3(++_0x9051c5);}(_0xc031,0x7a));var _0x1c03=function(_0x17fea7,_0x102927){_0x17fea7=_0x17fea7-0x0;var _0x3150c3=_0xc031[_0x17fea7];return _0x3150c3;};'use strict';var multer=require(_0x1c03('0x0'));var util=require('util');var path=require(_0x1c03('0x1'));var timeout=require(_0x1c03('0x2'));var express=require(_0x1c03('0x3'));var router=express[_0x1c03('0x4')]();var fs_extra=require(_0x1c03('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1c03('0x6'));var config=require(_0x1c03('0x7'));var controller=require(_0x1c03('0x8'));router[_0x1c03('0x9')]('/',auth[_0x1c03('0xa')](),controller[_0x1c03('0xb')]);router[_0x1c03('0x9')](_0x1c03('0xc'),auth[_0x1c03('0xa')](),controller[_0x1c03('0xd')]);router[_0x1c03('0x9')](_0x1c03('0xe'),auth['isAuthenticated'](),controller[_0x1c03('0xf')]);router[_0x1c03('0x10')]('/',auth[_0x1c03('0xa')](),controller[_0x1c03('0x11')]);router[_0x1c03('0x12')](_0x1c03('0xc'),auth['isAuthenticated'](),controller[_0x1c03('0x13')]);router['delete'](_0x1c03('0xc'),auth[_0x1c03('0xa')](),controller['destroy']);module[_0x1c03('0x14')]=router;
\ No newline at end of file
index 5499548..55a8375 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd4b=['BOOLEAN','sequelize','exports','STRING'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xfd4b,0x175));var _0xbfd4=function(_0x427963,_0x335473){_0x427963=_0x427963-0x0;var _0x50323f=_0xfd4b[_0x427963];return _0x50323f;};'use strict';var Sequelize=require(_0xbfd4('0x0'));module[_0xbfd4('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xbfd4('0x2')]},'function':{'type':Sequelize[_0xbfd4('0x2')]},'format':{'type':Sequelize[_0xbfd4('0x2')]},'groupBy':{'type':Sequelize[_0xbfd4('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xbfd4('0x2')]},'custom':{'type':Sequelize[_0xbfd4('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x94c0=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x3021ec,_0x1668c1){var _0x12f210=function(_0x4152ff){while(--_0x4152ff){_0x3021ec['push'](_0x3021ec['shift']());}};_0x12f210(++_0x1668c1);}(_0x94c0,0xbf));var _0x094c=function(_0x128450,_0x5869ba){_0x128450=_0x128450-0x0;var _0x4d80ed=_0x94c0[_0x128450];return _0x4d80ed;};'use strict';var Sequelize=require(_0x094c('0x0'));module[_0x094c('0x1')]={'field':{'type':Sequelize[_0x094c('0x2')]},'alias':{'type':Sequelize[_0x094c('0x3')]},'function':{'type':Sequelize[_0x094c('0x3')]},'format':{'type':Sequelize[_0x094c('0x3')]},'groupBy':{'type':Sequelize[_0x094c('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x094c('0x4')],'defaultValue':![]}};
\ No newline at end of file
index 34cb6bd..6dbee13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc796=['error','stack','name','send','map','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','AnalyticFieldReport','includeAll','include','findAll','rows','catch','show','options','find','create','bulkCreate','body','params','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','request-promise','moment','util','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','limit','count','set','Content-Range','json','apply','reject','update','then','destroy'];(function(_0x24f117,_0xe76cc){var _0x9d557=function(_0x3c4a05){while(--_0x3c4a05){_0x24f117['push'](_0x24f117['shift']());}};_0x9d557(++_0xe76cc);}(_0xc796,0x178));var _0x6c79=function(_0x31c5e9,_0x30e373){_0x31c5e9=_0x31c5e9-0x0;var _0x517a8d=_0xc796[_0x31c5e9];return _0x517a8d;};'use strict';var emlformat=require(_0x6c79('0x0'));var rimraf=require(_0x6c79('0x1'));var zipdir=require(_0x6c79('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6c79('0x3'));var moment=require(_0x6c79('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6c79('0x5'));var path=require('path');var sox=require(_0x6c79('0x6'));var csv=require('to-csv');var ejs=require(_0x6c79('0x7'));var fs=require('fs');var fs_extra=require(_0x6c79('0x8'));var _=require('lodash');var squel=require(_0x6c79('0x9'));var crypto=require('crypto');var jsforce=require(_0x6c79('0xa'));var deskjs=require(_0x6c79('0xb'));var toCsv=require(_0x6c79('0xc'));var querystring=require(_0x6c79('0xd'));var Papa=require(_0x6c79('0xe'));var Redis=require(_0x6c79('0xf'));var authService=require(_0x6c79('0x10'));var qs=require(_0x6c79('0x11'));var as=require(_0x6c79('0x12'));var hardwareService=require(_0x6c79('0x13'));var logger=require(_0x6c79('0x14'))(_0x6c79('0x15'));var utils=require(_0x6c79('0x16'));var config=require(_0x6c79('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x6c79('0x18'))['db'];function respondWithStatusCode(_0x1160bc,_0x55f323){_0x55f323=_0x55f323||0xcc;return function(_0x5be7fd){if(_0x5be7fd){return _0x1160bc[_0x6c79('0x19')](_0x55f323);}return _0x1160bc['status'](_0x55f323)[_0x6c79('0x1a')]();};}function respondWithResult(_0x466fb8,_0xd9e139){_0xd9e139=_0xd9e139||0xc8;return function(_0x990144){if(_0x990144){return _0x466fb8[_0x6c79('0x1b')](_0xd9e139)['json'](_0x990144);}};}function respondWithFilteredResult(_0x3b63fb,_0x36c454){return function(_0x39ecfa){if(_0x39ecfa){var _0x23a07e=typeof _0x36c454[_0x6c79('0x1c')]==='undefined'&&typeof _0x36c454[_0x6c79('0x1d')]==='undefined';var _0x4d7430=_0x39ecfa['count'];var _0x4ee737=_0x23a07e?0x0:_0x36c454['offset'];var _0x28baac=_0x23a07e?_0x39ecfa[_0x6c79('0x1e')]:_0x36c454[_0x6c79('0x1c')]+_0x36c454[_0x6c79('0x1d')];var _0x4fbcc2;if(_0x28baac>=_0x4d7430){_0x28baac=_0x4d7430;_0x4fbcc2=0xc8;}else{_0x4fbcc2=0xce;}_0x3b63fb[_0x6c79('0x1b')](_0x4fbcc2);return _0x3b63fb[_0x6c79('0x1f')](_0x6c79('0x20'),_0x4ee737+'-'+_0x28baac+'/'+_0x4d7430)[_0x6c79('0x21')](_0x39ecfa);}return null;};}function patchUpdates(_0x47275d){return function(_0x501719){try{jsonpatch[_0x6c79('0x22')](_0x501719,_0x47275d,!![]);}catch(_0x454aa4){return BPromise[_0x6c79('0x23')](_0x454aa4);}return _0x501719['save']();};}function saveUpdates(_0x32baa3,_0x4057cf){return function(_0x32f68c){if(_0x32f68c){return _0x32f68c[_0x6c79('0x24')](_0x32baa3)[_0x6c79('0x25')](function(_0x275d22){return _0x275d22;});}return null;};}function removeEntity(_0x978d6c,_0x28a8a3){return function(_0x154bf7){if(_0x154bf7){return _0x154bf7[_0x6c79('0x26')]()[_0x6c79('0x25')](function(){_0x978d6c[_0x6c79('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x288f80,_0x54b7cd){return function(_0x3fd2c5){if(!_0x3fd2c5){_0x288f80[_0x6c79('0x19')](0x194);}return _0x3fd2c5;};}function handleError(_0x4bbf42,_0x221f1f){_0x221f1f=_0x221f1f||0x1f4;return function(_0x3a40ed){logger[_0x6c79('0x27')](_0x3a40ed[_0x6c79('0x28')]);if(_0x3a40ed[_0x6c79('0x29')]){delete _0x3a40ed[_0x6c79('0x29')];}_0x4bbf42[_0x6c79('0x1b')](_0x221f1f)[_0x6c79('0x2a')](_0x3a40ed);};}exports['index']=function(_0x384267,_0x3fc187){var _0x40bd77={},_0x207580={},_0x15f2d6={'count':0x0,'rows':[]};var _0x106f2c=_[_0x6c79('0x2b')](db['AnalyticFieldReport'][_0x6c79('0x2c')],function(_0x588fce){return{'name':_0x588fce[_0x6c79('0x2d')],'type':_0x588fce['type']['key']};});_0x207580['model']=_[_0x6c79('0x2b')](_0x106f2c,_0x6c79('0x29'));_0x207580[_0x6c79('0x2e')]=_[_0x6c79('0x2f')](_0x384267['query']);_0x207580[_0x6c79('0x30')]=_[_0x6c79('0x31')](_0x207580[_0x6c79('0x32')],_0x207580[_0x6c79('0x2e')]);_0x40bd77[_0x6c79('0x33')]=_[_0x6c79('0x31')](_0x207580[_0x6c79('0x32')],qs[_0x6c79('0x34')](_0x384267[_0x6c79('0x2e')][_0x6c79('0x34')]));_0x40bd77[_0x6c79('0x33')]=_0x40bd77[_0x6c79('0x33')][_0x6c79('0x35')]?_0x40bd77['attributes']:_0x207580['model'];if(!_0x384267[_0x6c79('0x2e')][_0x6c79('0x36')](_0x6c79('0x37'))){_0x40bd77['limit']=qs[_0x6c79('0x1d')](_0x384267[_0x6c79('0x2e')][_0x6c79('0x1d')]);_0x40bd77[_0x6c79('0x1c')]=qs[_0x6c79('0x1c')](_0x384267[_0x6c79('0x2e')][_0x6c79('0x1c')]);}_0x40bd77[_0x6c79('0x38')]=qs[_0x6c79('0x39')](_0x384267[_0x6c79('0x2e')][_0x6c79('0x39')]);_0x40bd77[_0x6c79('0x3a')]=qs[_0x6c79('0x30')](_[_0x6c79('0x3b')](_0x384267['query'],_0x207580[_0x6c79('0x30')]),_0x106f2c);if(_0x384267[_0x6c79('0x2e')][_0x6c79('0x3c')]){_0x40bd77[_0x6c79('0x3a')]=_[_0x6c79('0x3d')](_0x40bd77[_0x6c79('0x3a')],{'$or':_[_0x6c79('0x2b')](_0x106f2c,function(_0x399fb2){if(_0x399fb2[_0x6c79('0x3e')]!=='VIRTUAL'){var _0x25d547={};_0x25d547[_0x399fb2[_0x6c79('0x29')]]={'$like':'%'+_0x384267[_0x6c79('0x2e')]['filter']+'%'};return _0x25d547;}})});}_0x40bd77=_[_0x6c79('0x3d')]({},_0x40bd77,_0x384267['options']);var _0x5b3864={'where':_0x40bd77['where']};return db[_0x6c79('0x3f')][_0x6c79('0x1e')](_0x5b3864)[_0x6c79('0x25')](function(_0x31d406){_0x15f2d6[_0x6c79('0x1e')]=_0x31d406;if(_0x384267[_0x6c79('0x2e')][_0x6c79('0x40')]){_0x40bd77[_0x6c79('0x41')]=[{'all':!![]}];}return db[_0x6c79('0x3f')][_0x6c79('0x42')](_0x40bd77);})[_0x6c79('0x25')](function(_0x3b8825){_0x15f2d6[_0x6c79('0x43')]=_0x3b8825;return _0x15f2d6;})[_0x6c79('0x25')](respondWithFilteredResult(_0x3fc187,_0x40bd77))[_0x6c79('0x44')](handleError(_0x3fc187,null));};exports[_0x6c79('0x45')]=function(_0x5987f2,_0x29587f){var _0x2504e6={'raw':![],'where':{'id':_0x5987f2['params']['id']}},_0x1dbffd={};_0x1dbffd['model']=_[_0x6c79('0x2f')](db['AnalyticFieldReport'][_0x6c79('0x2c')]);_0x1dbffd['query']=_[_0x6c79('0x2f')](_0x5987f2[_0x6c79('0x2e')]);_0x1dbffd['filters']=_['intersection'](_0x1dbffd[_0x6c79('0x32')],_0x1dbffd[_0x6c79('0x2e')]);_0x2504e6[_0x6c79('0x33')]=_[_0x6c79('0x31')](_0x1dbffd[_0x6c79('0x32')],qs[_0x6c79('0x34')](_0x5987f2[_0x6c79('0x2e')][_0x6c79('0x34')]));_0x2504e6[_0x6c79('0x33')]=_0x2504e6[_0x6c79('0x33')]['length']?_0x2504e6[_0x6c79('0x33')]:_0x1dbffd[_0x6c79('0x32')];if(_0x5987f2[_0x6c79('0x2e')]['includeAll']){_0x2504e6['include']=[{'all':!![]}];}_0x2504e6=_[_0x6c79('0x3d')]({},_0x2504e6,_0x5987f2[_0x6c79('0x46')]);return db[_0x6c79('0x3f')][_0x6c79('0x47')](_0x2504e6)[_0x6c79('0x25')](handleEntityNotFound(_0x29587f,null))[_0x6c79('0x25')](respondWithResult(_0x29587f,null))[_0x6c79('0x44')](handleError(_0x29587f,null));};exports['create']=function(_0x283561,_0x5d3d73){return db['AnalyticFieldReport'][_0x6c79('0x48')](_0x283561['body'],{})[_0x6c79('0x25')](respondWithResult(_0x5d3d73,0xc9))[_0x6c79('0x44')](handleError(_0x5d3d73,null));};exports[_0x6c79('0x49')]=function(_0x2ad409,_0x348d44){return db[_0x6c79('0x3f')]['bulkCreate'](_0x2ad409[_0x6c79('0x4a')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x348d44,0xc9))[_0x6c79('0x44')](handleError(_0x348d44,null));};exports[_0x6c79('0x24')]=function(_0x5ecfd4,_0x17dbfe){if(_0x5ecfd4['body']['id']){delete _0x5ecfd4[_0x6c79('0x4a')]['id'];}return db[_0x6c79('0x3f')][_0x6c79('0x47')]({'where':{'id':_0x5ecfd4[_0x6c79('0x4b')]['id']}})[_0x6c79('0x25')](handleEntityNotFound(_0x17dbfe,null))[_0x6c79('0x25')](saveUpdates(_0x5ecfd4[_0x6c79('0x4a')],null))[_0x6c79('0x25')](respondWithResult(_0x17dbfe,null))[_0x6c79('0x44')](handleError(_0x17dbfe,null));};exports[_0x6c79('0x26')]=function(_0x2c0e19,_0x94b99c){return db['AnalyticFieldReport'][_0x6c79('0x47')]({'where':{'id':_0x2c0e19[_0x6c79('0x4b')]['id']}})[_0x6c79('0x25')](handleEntityNotFound(_0x94b99c,null))['then'](removeEntity(_0x94b99c,null))[_0x6c79('0x44')](handleError(_0x94b99c,null));};exports['bulkDestroy']=function(_0x3d4409,_0x57b1c1){return db[_0x6c79('0x3f')]['destroy']({'where':{'id':_0x3d4409[_0x6c79('0x2e')][_0x6c79('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0x6c79('0x25')](respondWithResult(_0x57b1c1,0xcc))[_0x6c79('0x44')](handleError(_0x57b1c1,null));};exports[_0x6c79('0x4d')]=function(_0x14c527,_0x468c09,_0x33190b){return db[_0x6c79('0x4e')][_0x6c79('0x4f')]({'where':{'id':_0x14c527['params']['id']}})[_0x6c79('0x25')](handleEntityNotFound(_0x468c09,null))[_0x6c79('0x25')](function(_0xb73292){if(_0xb73292){return db[_0x6c79('0x50')][_0x6c79('0x51')](function(_0x2dcae3){return db[_0x6c79('0x3f')][_0x6c79('0x26')]({'where':{'CustomReportId':_0x14c527['params']['id']},'transaction':_0x2dcae3})[_0x6c79('0x25')](function(_0x11c9de){var _0x1425bc=_[_0x6c79('0x2b')](_0x14c527[_0x6c79('0x4a')],function(_0x541068){delete _0x541068['id'];_0x541068[_0x6c79('0x52')]=_0x14c527[_0x6c79('0x4b')]['id'];return _0x541068;});return db[_0x6c79('0x3f')][_0x6c79('0x49')](_0x1425bc,{'transaction':_0x2dcae3});});})['then'](function(){return db[_0x6c79('0x3f')][_0x6c79('0x42')]({'where':{'CustomReportId':_0x14c527[_0x6c79('0x4b')]['id']}});});}})[_0x6c79('0x25')](respondWithResult(_0x468c09,null))[_0x6c79('0x44')](handleError(_0x468c09,null));};
\ No newline at end of file
+var _0x3e4b=['status','end','undefined','limit','count','offset','apply','reject','save','then','destroy','error','stack','name','send','index','AnalyticFieldReport','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','findAll','show','keys','length','include','options','find','catch','create','body','bulkCreate','params','bulkDestroy','ids','AnalyticCustomReport','sequelize','transaction','map','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0x3e4b,0x81));var _0xb3e4=function(_0x2112da,_0x501eab){_0x2112da=_0x2112da-0x0;var _0x26301a=_0x3e4b[_0x2112da];return _0x26301a;};'use strict';var emlformat=require(_0xb3e4('0x0'));var rimraf=require(_0xb3e4('0x1'));var zipdir=require(_0xb3e4('0x2'));var jsonpatch=require(_0xb3e4('0x3'));var rp=require('request-promise');var moment=require(_0xb3e4('0x4'));var BPromise=require(_0xb3e4('0x5'));var Mustache=require('mustache');var util=require(_0xb3e4('0x6'));var path=require(_0xb3e4('0x7'));var sox=require(_0xb3e4('0x8'));var csv=require(_0xb3e4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb3e4('0xa'));var _=require(_0xb3e4('0xb'));var squel=require(_0xb3e4('0xc'));var crypto=require(_0xb3e4('0xd'));var jsforce=require(_0xb3e4('0xe'));var deskjs=require(_0xb3e4('0xf'));var toCsv=require(_0xb3e4('0x9'));var querystring=require(_0xb3e4('0x10'));var Papa=require('papaparse');var Redis=require(_0xb3e4('0x11'));var authService=require(_0xb3e4('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb3e4('0x13'))(_0xb3e4('0x14'));var utils=require('../../config/utils');var config=require(_0xb3e4('0x15'));var licenseUtil=require(_0xb3e4('0x16'));var db=require(_0xb3e4('0x17'))['db'];function respondWithStatusCode(_0x56a652,_0x231db4){_0x231db4=_0x231db4||0xcc;return function(_0x45f2eb){if(_0x45f2eb){return _0x56a652[_0xb3e4('0x18')](_0x231db4);}return _0x56a652[_0xb3e4('0x19')](_0x231db4)[_0xb3e4('0x1a')]();};}function respondWithResult(_0x55ed4e,_0x271ae8){_0x271ae8=_0x271ae8||0xc8;return function(_0x219434){if(_0x219434){return _0x55ed4e[_0xb3e4('0x19')](_0x271ae8)['json'](_0x219434);}};}function respondWithFilteredResult(_0x8603f8,_0x5740b9){return function(_0x1d1782){if(_0x1d1782){var _0x1a02b4=typeof _0x5740b9['offset']===_0xb3e4('0x1b')&&typeof _0x5740b9[_0xb3e4('0x1c')]===_0xb3e4('0x1b');var _0x388211=_0x1d1782['count'];var _0x1e83e9=_0x1a02b4?0x0:_0x5740b9['offset'];var _0x283429=_0x1a02b4?_0x1d1782[_0xb3e4('0x1d')]:_0x5740b9[_0xb3e4('0x1e')]+_0x5740b9[_0xb3e4('0x1c')];var _0xfcc1ff;if(_0x283429>=_0x388211){_0x283429=_0x388211;_0xfcc1ff=0xc8;}else{_0xfcc1ff=0xce;}_0x8603f8[_0xb3e4('0x19')](_0xfcc1ff);return _0x8603f8['set']('Content-Range',_0x1e83e9+'-'+_0x283429+'/'+_0x388211)['json'](_0x1d1782);}return null;};}function patchUpdates(_0x39c929){return function(_0x3fc05a){try{jsonpatch[_0xb3e4('0x1f')](_0x3fc05a,_0x39c929,!![]);}catch(_0x56ca83){return BPromise[_0xb3e4('0x20')](_0x56ca83);}return _0x3fc05a[_0xb3e4('0x21')]();};}function saveUpdates(_0xdc0064,_0x2e8a48){return function(_0x49917b){if(_0x49917b){return _0x49917b['update'](_0xdc0064)[_0xb3e4('0x22')](function(_0xdd1cb2){return _0xdd1cb2;});}return null;};}function removeEntity(_0x416217,_0x26a12d){return function(_0x23fcb9){if(_0x23fcb9){return _0x23fcb9[_0xb3e4('0x23')]()['then'](function(){_0x416217['status'](0xcc)[_0xb3e4('0x1a')]();});}};}function handleEntityNotFound(_0x3025dc,_0x1276c6){return function(_0xeab9e){if(!_0xeab9e){_0x3025dc[_0xb3e4('0x18')](0x194);}return _0xeab9e;};}function handleError(_0x4f0684,_0x17052b){_0x17052b=_0x17052b||0x1f4;return function(_0x57ceba){logger[_0xb3e4('0x24')](_0x57ceba[_0xb3e4('0x25')]);if(_0x57ceba[_0xb3e4('0x26')]){delete _0x57ceba['name'];}_0x4f0684[_0xb3e4('0x19')](_0x17052b)[_0xb3e4('0x27')](_0x57ceba);};}exports[_0xb3e4('0x28')]=function(_0x56772f,_0xe7eb2d){var _0x24fd72={},_0x4db861={},_0xdad9da={'count':0x0,'rows':[]};var _0x31dd66=_['map'](db[_0xb3e4('0x29')][_0xb3e4('0x2a')],function(_0x266447){return{'name':_0x266447[_0xb3e4('0x2b')],'type':_0x266447[_0xb3e4('0x2c')][_0xb3e4('0x2d')]};});_0x4db861['model']=_['map'](_0x31dd66,_0xb3e4('0x26'));_0x4db861[_0xb3e4('0x2e')]=_['keys'](_0x56772f[_0xb3e4('0x2e')]);_0x4db861[_0xb3e4('0x2f')]=_[_0xb3e4('0x30')](_0x4db861['model'],_0x4db861[_0xb3e4('0x2e')]);_0x24fd72[_0xb3e4('0x31')]=_[_0xb3e4('0x30')](_0x4db861[_0xb3e4('0x32')],qs[_0xb3e4('0x33')](_0x56772f[_0xb3e4('0x2e')][_0xb3e4('0x33')]));_0x24fd72[_0xb3e4('0x31')]=_0x24fd72[_0xb3e4('0x31')]['length']?_0x24fd72[_0xb3e4('0x31')]:_0x4db861[_0xb3e4('0x32')];if(!_0x56772f[_0xb3e4('0x2e')][_0xb3e4('0x34')]('nolimit')){_0x24fd72['limit']=qs[_0xb3e4('0x1c')](_0x56772f[_0xb3e4('0x2e')][_0xb3e4('0x1c')]);_0x24fd72[_0xb3e4('0x1e')]=qs[_0xb3e4('0x1e')](_0x56772f[_0xb3e4('0x2e')][_0xb3e4('0x1e')]);}_0x24fd72[_0xb3e4('0x35')]=qs[_0xb3e4('0x36')](_0x56772f[_0xb3e4('0x2e')]['sort']);_0x24fd72[_0xb3e4('0x37')]=qs[_0xb3e4('0x2f')](_['pick'](_0x56772f[_0xb3e4('0x2e')],_0x4db861[_0xb3e4('0x2f')]),_0x31dd66);if(_0x56772f['query'][_0xb3e4('0x38')]){_0x24fd72[_0xb3e4('0x37')]=_[_0xb3e4('0x39')](_0x24fd72['where'],{'$or':_['map'](_0x31dd66,function(_0x99e964){if(_0x99e964[_0xb3e4('0x2c')]!==_0xb3e4('0x3a')){var _0x4717bd={};_0x4717bd[_0x99e964[_0xb3e4('0x26')]]={'$like':'%'+_0x56772f[_0xb3e4('0x2e')][_0xb3e4('0x38')]+'%'};return _0x4717bd;}})});}_0x24fd72=_[_0xb3e4('0x39')]({},_0x24fd72,_0x56772f['options']);var _0x42a16d={'where':_0x24fd72['where']};return db[_0xb3e4('0x29')]['count'](_0x42a16d)[_0xb3e4('0x22')](function(_0x2e62fe){_0xdad9da[_0xb3e4('0x1d')]=_0x2e62fe;if(_0x56772f[_0xb3e4('0x2e')]['includeAll']){_0x24fd72['include']=[{'all':!![]}];}return db[_0xb3e4('0x29')][_0xb3e4('0x3b')](_0x24fd72);})[_0xb3e4('0x22')](function(_0x3f52ae){_0xdad9da['rows']=_0x3f52ae;return _0xdad9da;})['then'](respondWithFilteredResult(_0xe7eb2d,_0x24fd72))['catch'](handleError(_0xe7eb2d,null));};exports[_0xb3e4('0x3c')]=function(_0x546abf,_0x56a523){var _0x58de25={'raw':![],'where':{'id':_0x546abf['params']['id']}},_0x326e90={};_0x326e90[_0xb3e4('0x32')]=_['keys'](db[_0xb3e4('0x29')][_0xb3e4('0x2a')]);_0x326e90[_0xb3e4('0x2e')]=_[_0xb3e4('0x3d')](_0x546abf[_0xb3e4('0x2e')]);_0x326e90[_0xb3e4('0x2f')]=_['intersection'](_0x326e90[_0xb3e4('0x32')],_0x326e90[_0xb3e4('0x2e')]);_0x58de25[_0xb3e4('0x31')]=_['intersection'](_0x326e90['model'],qs[_0xb3e4('0x33')](_0x546abf['query'][_0xb3e4('0x33')]));_0x58de25[_0xb3e4('0x31')]=_0x58de25[_0xb3e4('0x31')][_0xb3e4('0x3e')]?_0x58de25[_0xb3e4('0x31')]:_0x326e90[_0xb3e4('0x32')];if(_0x546abf[_0xb3e4('0x2e')]['includeAll']){_0x58de25[_0xb3e4('0x3f')]=[{'all':!![]}];}_0x58de25=_[_0xb3e4('0x39')]({},_0x58de25,_0x546abf[_0xb3e4('0x40')]);return db[_0xb3e4('0x29')][_0xb3e4('0x41')](_0x58de25)[_0xb3e4('0x22')](handleEntityNotFound(_0x56a523,null))['then'](respondWithResult(_0x56a523,null))[_0xb3e4('0x42')](handleError(_0x56a523,null));};exports[_0xb3e4('0x43')]=function(_0x3cf283,_0x945473){return db[_0xb3e4('0x29')][_0xb3e4('0x43')](_0x3cf283[_0xb3e4('0x44')],{})['then'](respondWithResult(_0x945473,0xc9))[_0xb3e4('0x42')](handleError(_0x945473,null));};exports[_0xb3e4('0x45')]=function(_0x4342a4,_0x4fa39f){return db[_0xb3e4('0x29')][_0xb3e4('0x45')](_0x4342a4[_0xb3e4('0x44')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x4fa39f,0xc9))['catch'](handleError(_0x4fa39f,null));};exports['update']=function(_0x7a3444,_0x2fe5cd){if(_0x7a3444['body']['id']){delete _0x7a3444[_0xb3e4('0x44')]['id'];}return db[_0xb3e4('0x29')][_0xb3e4('0x41')]({'where':{'id':_0x7a3444[_0xb3e4('0x46')]['id']}})[_0xb3e4('0x22')](handleEntityNotFound(_0x2fe5cd,null))[_0xb3e4('0x22')](saveUpdates(_0x7a3444['body'],null))[_0xb3e4('0x22')](respondWithResult(_0x2fe5cd,null))[_0xb3e4('0x42')](handleError(_0x2fe5cd,null));};exports[_0xb3e4('0x23')]=function(_0x3f197e,_0x160298){return db[_0xb3e4('0x29')][_0xb3e4('0x41')]({'where':{'id':_0x3f197e[_0xb3e4('0x46')]['id']}})[_0xb3e4('0x22')](handleEntityNotFound(_0x160298,null))[_0xb3e4('0x22')](removeEntity(_0x160298,null))['catch'](handleError(_0x160298,null));};exports[_0xb3e4('0x47')]=function(_0x477b6d,_0x4e3b3c){return db[_0xb3e4('0x29')][_0xb3e4('0x23')]({'where':{'id':_0x477b6d[_0xb3e4('0x2e')][_0xb3e4('0x48')]||[]},'raw':![],'individualHooks':!![]})[_0xb3e4('0x22')](respondWithResult(_0x4e3b3c,0xcc))[_0xb3e4('0x42')](handleError(_0x4e3b3c,null));};exports['addFields']=function(_0x338d6e,_0x1d839d,_0x5be8e2){return db[_0xb3e4('0x49')]['findOne']({'where':{'id':_0x338d6e['params']['id']}})[_0xb3e4('0x22')](handleEntityNotFound(_0x1d839d,null))[_0xb3e4('0x22')](function(_0x454ca3){if(_0x454ca3){return db[_0xb3e4('0x4a')][_0xb3e4('0x4b')](function(_0x4fb5f4){return db[_0xb3e4('0x29')][_0xb3e4('0x23')]({'where':{'CustomReportId':_0x338d6e[_0xb3e4('0x46')]['id']},'transaction':_0x4fb5f4})[_0xb3e4('0x22')](function(_0x1bcad9){var _0x59bc15=_[_0xb3e4('0x4c')](_0x338d6e[_0xb3e4('0x44')],function(_0x315304){delete _0x315304['id'];_0x315304['CustomReportId']=_0x338d6e[_0xb3e4('0x46')]['id'];return _0x315304;});return db['AnalyticFieldReport'][_0xb3e4('0x45')](_0x59bc15,{'transaction':_0x4fb5f4});});})[_0xb3e4('0x22')](function(){return db[_0xb3e4('0x29')][_0xb3e4('0x3b')]({'where':{'CustomReportId':_0x338d6e['params']['id']}});});}})[_0xb3e4('0x22')](respondWithResult(_0x1d839d,null))[_0xb3e4('0x42')](handleError(_0x1d839d,null));};
\ No newline at end of file
index 797ab97..5458661 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d22=['path','rimraf','../../config/environment','./analyticFieldReport.attributes','define','analytics_report_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x11f541,_0x42b749){var _0x51421d=function(_0x12436c){while(--_0x12436c){_0x11f541['push'](_0x11f541['shift']());}};_0x51421d(++_0x42b749);}(_0x2d22,0xe3));var _0x22d2=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2d22[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x22d2('0x0'));var util=require(_0x22d2('0x1'));var logger=require(_0x22d2('0x2'))(_0x22d2('0x3'));var moment=require(_0x22d2('0x4'));var BPromise=require(_0x22d2('0x5'));var rp=require(_0x22d2('0x6'));var fs=require('fs');var path=require(_0x22d2('0x7'));var rimraf=require(_0x22d2('0x8'));var config=require(_0x22d2('0x9'));var attributes=require(_0x22d2('0xa'));module['exports']=function(_0x15b381,_0x12d499){return _0x15b381[_0x22d2('0xb')]('AnalyticFieldReport',attributes,{'tableName':_0x22d2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x803f=['path','../../config/environment','define','AnalyticFieldReport','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x12ceba,_0x51a9b0){var _0xefe619=function(_0x3378e7){while(--_0x3378e7){_0x12ceba['push'](_0x12ceba['shift']());}};_0xefe619(++_0x51a9b0);}(_0x803f,0x187));var _0xf803=function(_0x2d7573,_0x838409){_0x2d7573=_0x2d7573-0x0;var _0x17fed4=_0x803f[_0x2d7573];return _0x17fed4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf803('0x0'))(_0xf803('0x1'));var moment=require(_0xf803('0x2'));var BPromise=require(_0xf803('0x3'));var rp=require(_0xf803('0x4'));var fs=require('fs');var path=require(_0xf803('0x5'));var rimraf=require('rimraf');var config=require(_0xf803('0x6'));var attributes=require('./analyticFieldReport.attributes');module['exports']=function(_0x2ba57b,_0xc04c0d){return _0x2ba57b[_0xf803('0x7')](_0xf803('0x8'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f6e447b..5aa0b89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x75d6=['error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x4aa5c2,_0x35cf13){var _0xb8c19a=function(_0x35689a){while(--_0x35689a){_0x4aa5c2['push'](_0x4aa5c2['shift']());}};_0xb8c19a(++_0x35cf13);}(_0x75d6,0x137));var _0x675d=function(_0x36fbef,_0x4ffc84){_0x36fbef=_0x36fbef-0x0;var _0x45e270=_0x75d6[_0x36fbef];return _0x45e270;};'use strict';var _=require(_0x675d('0x0'));var util=require(_0x675d('0x1'));var moment=require(_0x675d('0x2'));var BPromise=require(_0x675d('0x3'));var rs=require(_0x675d('0x4'));var fs=require('fs');var Redis=require(_0x675d('0x5'));var db=require(_0x675d('0x6'))['db'];var utils=require(_0x675d('0x7'));var logger=require(_0x675d('0x8'))('rpc');var config=require(_0x675d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x675d('0xa')][_0x675d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e70ae,_0x2d513d,_0xb532a1){return new BPromise(function(_0x522b93,_0x497d70){return client[_0x675d('0xc')](_0x2e70ae,_0xb532a1)[_0x675d('0xd')](function(_0x2aa263){logger[_0x675d('0xe')](_0x675d('0xf'),_0x2d513d,'request\x20sent');logger[_0x675d('0x10')](_0x675d('0x11'),_0x2d513d,_0x675d('0x12'),JSON['stringify'](_0x2aa263));if(_0x2aa263[_0x675d('0x13')]){if(_0x2aa263[_0x675d('0x13')]['code']===0x1f4){logger[_0x675d('0x13')](_0x675d('0xf'),_0x2d513d,_0x2aa263[_0x675d('0x13')][_0x675d('0x14')]);return _0x497d70(_0x2aa263['error'][_0x675d('0x14')]);}logger[_0x675d('0x13')](_0x675d('0xf'),_0x2d513d,_0x2aa263['error'][_0x675d('0x14')]);return _0x522b93(_0x2aa263['error'][_0x675d('0x14')]);}else{logger[_0x675d('0xe')](_0x675d('0xf'),_0x2d513d,_0x675d('0x12'));_0x522b93(_0x2aa263[_0x675d('0x15')]['message']);}})['catch'](function(_0x282059){logger[_0x675d('0x13')](_0x675d('0xf'),_0x2d513d,_0x282059);_0x497d70(_0x282059);});});}
\ No newline at end of file
+var _0x7cd1=['debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','AnalyticFieldReport,\x20%s,\x20%s','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent'];(function(_0x230c78,_0x30250d){var _0x14951c=function(_0x37254f){while(--_0x37254f){_0x230c78['push'](_0x230c78['shift']());}};_0x14951c(++_0x30250d);}(_0x7cd1,0x179));var _0x17cd=function(_0x57fa7e,_0xd0b5ce){_0x57fa7e=_0x57fa7e-0x0;var _0x320671=_0x7cd1[_0x57fa7e];return _0x320671;};'use strict';var _=require(_0x17cd('0x0'));var util=require(_0x17cd('0x1'));var moment=require('moment');var BPromise=require(_0x17cd('0x2'));var rs=require(_0x17cd('0x3'));var fs=require('fs');var Redis=require(_0x17cd('0x4'));var db=require(_0x17cd('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x17cd('0x6'))(_0x17cd('0x7'));var config=require(_0x17cd('0x8'));var jayson=require(_0x17cd('0x9'));var client=jayson[_0x17cd('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b865d,_0x3e4f34,_0x5e7765){return new BPromise(function(_0x3446f0,_0x49a093){return client[_0x17cd('0xb')](_0x5b865d,_0x5e7765)[_0x17cd('0xc')](function(_0x30ff96){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x3e4f34,_0x17cd('0xd'));logger[_0x17cd('0xe')](_0x17cd('0xf'),_0x3e4f34,'request\x20sent',JSON[_0x17cd('0x10')](_0x30ff96));if(_0x30ff96[_0x17cd('0x11')]){if(_0x30ff96[_0x17cd('0x11')]['code']===0x1f4){logger[_0x17cd('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3e4f34,_0x30ff96[_0x17cd('0x11')]['message']);return _0x49a093(_0x30ff96['error'][_0x17cd('0x12')]);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x3e4f34,_0x30ff96[_0x17cd('0x11')][_0x17cd('0x12')]);return _0x3446f0(_0x30ff96[_0x17cd('0x11')][_0x17cd('0x12')]);}else{logger[_0x17cd('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3e4f34,_0x17cd('0xd'));_0x3446f0(_0x30ff96[_0x17cd('0x14')][_0x17cd('0x12')]);}})[_0x17cd('0x15')](function(_0x4f3b72){logger[_0x17cd('0x11')](_0x17cd('0x16'),_0x3e4f34,_0x4f3b72);_0x49a093(_0x4f3b72);});});}
\ No newline at end of file
index d994a06..94ceea3 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(_0x4ea616,_0x11d5fc){var _0x51cb37=function(_0x2227b6){while(--_0x2227b6){_0x4ea616['push'](_0x4ea616['shift']());}};_0x51cb37(++_0x11d5fc);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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(_0x7e8ffb,_0x272fcc){var _0x1756f6=function(_0x5edd94){while(--_0x5edd94){_0x7e8ffb['push'](_0x7e8ffb['shift']());}};_0x1756f6(++_0x272fcc);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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 5561f04..0a2c3c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x39cb=['TEXT','exports','STRING'];(function(_0xda8389,_0x57b905){var _0x4d460b=function(_0x2c857a){while(--_0x2c857a){_0xda8389['push'](_0xda8389['shift']());}};_0x4d460b(++_0x57b905);}(_0x39cb,0x1bd));var _0xb39c=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x39cb[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require('sequelize');module[_0xb39c('0x0')]={'name':{'type':Sequelize[_0xb39c('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xb39c('0x1')]},'metric':{'type':Sequelize[_0xb39c('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xf089=['exports','STRING','TEXT'];(function(_0x5ecadc,_0x1cf9f1){var _0x565037=function(_0x22908b){while(--_0x22908b){_0x5ecadc['push'](_0x5ecadc['shift']());}};_0x565037(++_0x1cf9f1);}(_0xf089,0xba));var _0x9f08=function(_0x5d2df6,_0x321cbe){_0x5d2df6=_0x5d2df6-0x0;var _0x3ea033=_0xf089[_0x5d2df6];return _0x3ea033;};'use strict';var Sequelize=require('sequelize');module[_0x9f08('0x0')]={'name':{'type':Sequelize[_0x9f08('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x9f08('0x1')]},'metric':{'type':Sequelize[_0x9f08('0x2')]},'description':{'type':Sequelize[_0x9f08('0x1')]}};
\ No newline at end of file
index 43f5b40..91a3c8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e74=['status','set','Content-Range','apply','save','update','then','destroy','get','Metrics','sendStatus','stack','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','filter','include','findAll','rows','catch','params','rawAttributes','length','includeAll','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count'];(function(_0x414b98,_0x416334){var _0x3c6ffb=function(_0x278dfb){while(--_0x278dfb){_0x414b98['push'](_0x414b98['shift']());}};_0x3c6ffb(++_0x416334);}(_0x3e74,0x175));var _0x43e7=function(_0x1382b0,_0x5d64b4){_0x1382b0=_0x1382b0-0x0;var _0x49bb1c=_0x3e74[_0x1382b0];return _0x49bb1c;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){var _0x4b2b9f=_0x4c9df3[_0x43e7('0x23')]({'plain':!![]});var _0x4ca5cf=_0x43e7('0x24');return db['UserProfileResource'][_0x43e7('0x22')]({'where':{'type':_0x4ca5cf,'resourceId':_0x4b2b9f['id']}})[_0x43e7('0x21')](function(){return _0x4c9df3;});})[_0x43e7('0x21')](function(){_0x454359[_0x43e7('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52b7b3,_0x805b54){return function(_0x501551){if(!_0x501551){_0x52b7b3[_0x43e7('0x25')](0x194);}return _0x501551;};}function handleError(_0x40dc8f,_0x3565cf){_0x3565cf=_0x3565cf||0x1f4;return function(_0xb1fc63){logger['error'](_0xb1fc63[_0x43e7('0x26')]);if(_0xb1fc63[_0x43e7('0x27')]){delete _0xb1fc63[_0x43e7('0x27')];}_0x40dc8f[_0x43e7('0x1b')](_0x3565cf)[_0x43e7('0x28')](_0xb1fc63);};}exports[_0x43e7('0x29')]=function(_0x2b85a5,_0x31b2a6){var _0x3bf475={},_0x35dbcd={},_0x17df44={'count':0x0,'rows':[]};var _0x19725a=_[_0x43e7('0x2a')](db[_0x43e7('0x2b')]['rawAttributes'],function(_0x238321){return{'name':_0x238321[_0x43e7('0x2c')],'type':_0x238321[_0x43e7('0x2d')][_0x43e7('0x2e')]};});_0x35dbcd[_0x43e7('0x2f')]=_['map'](_0x19725a,_0x43e7('0x27'));_0x35dbcd[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x2b85a5[_0x43e7('0x30')]);_0x35dbcd['filters']=_['intersection'](_0x35dbcd['model'],_0x35dbcd[_0x43e7('0x30')]);_0x3bf475[_0x43e7('0x32')]=_[_0x43e7('0x33')](_0x35dbcd[_0x43e7('0x2f')],qs[_0x43e7('0x34')](_0x2b85a5[_0x43e7('0x30')]['fields']));_0x3bf475['attributes']=_0x3bf475['attributes']['length']?_0x3bf475['attributes']:_0x35dbcd['model'];if(!_0x2b85a5['query'][_0x43e7('0x35')]('nolimit')){_0x3bf475[_0x43e7('0x18')]=qs[_0x43e7('0x18')](_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x18')]);_0x3bf475[_0x43e7('0x19')]=qs[_0x43e7('0x19')](_0x2b85a5[_0x43e7('0x30')]['offset']);}_0x3bf475['order']=qs['sort'](_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x36')]);_0x3bf475[_0x43e7('0x37')]=qs[_0x43e7('0x38')](_[_0x43e7('0x39')](_0x2b85a5[_0x43e7('0x30')],_0x35dbcd[_0x43e7('0x38')]),_0x19725a);if(_0x2b85a5[_0x43e7('0x30')]['filter']){_0x3bf475[_0x43e7('0x37')]=_[_0x43e7('0x3a')](_0x3bf475['where'],{'$or':_[_0x43e7('0x2a')](_0x19725a,function(_0x4c0c7a){if(_0x4c0c7a[_0x43e7('0x2d')]!==_0x43e7('0x3b')){var _0x1c6f45={};_0x1c6f45[_0x4c0c7a[_0x43e7('0x27')]]={'$like':'%'+_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x3c')]+'%'};return _0x1c6f45;}})});}_0x3bf475=_['merge']({},_0x3bf475,_0x2b85a5['options']);var _0x30dfa9={'where':_0x3bf475[_0x43e7('0x37')]};return db[_0x43e7('0x2b')][_0x43e7('0x1a')](_0x30dfa9)[_0x43e7('0x21')](function(_0x4a4a85){_0x17df44[_0x43e7('0x1a')]=_0x4a4a85;if(_0x2b85a5[_0x43e7('0x30')]['includeAll']){_0x3bf475[_0x43e7('0x3d')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x43e7('0x3e')](_0x3bf475);})['then'](function(_0x3d81ae){_0x17df44[_0x43e7('0x3f')]=_0x3d81ae;return _0x17df44;})[_0x43e7('0x21')](respondWithFilteredResult(_0x31b2a6,_0x3bf475))[_0x43e7('0x40')](handleError(_0x31b2a6,null));};exports['show']=function(_0x47d6a1,_0x103393){var _0x40c509={'raw':!![],'where':{'id':_0x47d6a1[_0x43e7('0x41')]['id']}},_0xe979b5={};_0xe979b5['model']=_['keys'](db['AnalyticMetric'][_0x43e7('0x42')]);_0xe979b5['query']=_[_0x43e7('0x31')](_0x47d6a1['query']);_0xe979b5['filters']=_[_0x43e7('0x33')](_0xe979b5['model'],_0xe979b5[_0x43e7('0x30')]);_0x40c509[_0x43e7('0x32')]=_[_0x43e7('0x33')](_0xe979b5[_0x43e7('0x2f')],qs['fields'](_0x47d6a1[_0x43e7('0x30')][_0x43e7('0x34')]));_0x40c509[_0x43e7('0x32')]=_0x40c509[_0x43e7('0x32')][_0x43e7('0x43')]?_0x40c509[_0x43e7('0x32')]:_0xe979b5['model'];if(_0x47d6a1['query'][_0x43e7('0x44')]){_0x40c509[_0x43e7('0x3d')]=[{'all':!![]}];}_0x40c509=_[_0x43e7('0x3a')]({},_0x40c509,_0x47d6a1['options']);return db['AnalyticMetric']['find'](_0x40c509)[_0x43e7('0x21')](handleEntityNotFound(_0x103393,null))[_0x43e7('0x21')](respondWithResult(_0x103393,null))['catch'](handleError(_0x103393,null));};exports[_0x43e7('0x45')]=function(_0x47686e,_0x3c96fe){return db['AnalyticMetric']['create'](_0x47686e['body'],{})['then'](function(_0x214e7e){var _0xe955fc=_0x47686e['user'][_0x43e7('0x23')]({'plain':!![]});if(!_0xe955fc)throw new Error(_0x43e7('0x46'));if(_0xe955fc[_0x43e7('0x47')]===_0x43e7('0x48')){var _0x4a0ce5=_0x214e7e[_0x43e7('0x23')]({'plain':!![]});var _0x483f20='Metrics';return db[_0x43e7('0x49')][_0x43e7('0x4a')]({'where':{'name':_0x483f20,'userProfileId':_0xe955fc[_0x43e7('0x4b')]},'raw':!![]})[_0x43e7('0x21')](function(_0x13503c){if(_0x13503c&&_0x13503c[_0x43e7('0x4c')]===0x0){return db[_0x43e7('0x4d')][_0x43e7('0x45')]({'name':_0x4a0ce5[_0x43e7('0x27')],'resourceId':_0x4a0ce5['id'],'type':_0x13503c[_0x43e7('0x27')],'sectionId':_0x13503c['id']},{})['then'](function(){return _0x214e7e;});}else{return _0x214e7e;}})[_0x43e7('0x40')](function(_0x46c910){logger['error'](_0x43e7('0x4e'),_0x46c910);throw _0x46c910;});}return _0x214e7e;})['then'](respondWithResult(_0x3c96fe,0xc9))[_0x43e7('0x40')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x20')]=function(_0x34e2ec,_0x1f561f){if(_0x34e2ec[_0x43e7('0x4f')]['id']){delete _0x34e2ec['body']['id'];}return db['AnalyticMetric'][_0x43e7('0x4a')]({'where':{'id':_0x34e2ec[_0x43e7('0x41')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x1f561f,null))[_0x43e7('0x21')](saveUpdates(_0x34e2ec[_0x43e7('0x4f')],null))[_0x43e7('0x21')](respondWithResult(_0x1f561f,null))[_0x43e7('0x40')](handleError(_0x1f561f,null));};exports[_0x43e7('0x22')]=function(_0x26d86c,_0x24e758){return db[_0x43e7('0x2b')]['find']({'where':{'id':_0x26d86c[_0x43e7('0x41')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x24e758,null))['then'](removeEntity(_0x24e758,null))[_0x43e7('0x40')](handleError(_0x24e758,null));};
\ No newline at end of file
+var _0x7da7=['model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','merge','options','where','AnalyticMetric','includeAll','include','findAll','rows','catch','params','keys','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','json','apply','reject','update','then','destroy','get','Metrics','UserProfileResource','end','name','send','index','map','rawAttributes','fieldName','type','key'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0x7da7,0x10d));var _0x77da=function(_0x3f6565,_0x12a8bb){_0x3f6565=_0x3f6565-0x0;var _0x4abd23=_0x7da7[_0x3f6565];return _0x4abd23;};'use strict';var emlformat=require(_0x77da('0x0'));var rimraf=require(_0x77da('0x1'));var zipdir=require(_0x77da('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x77da('0x3'));var BPromise=require(_0x77da('0x4'));var Mustache=require('mustache');var util=require(_0x77da('0x5'));var path=require(_0x77da('0x6'));var sox=require('sox');var csv=require(_0x77da('0x7'));var ejs=require(_0x77da('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x77da('0x9'));var squel=require('squel');var crypto=require(_0x77da('0xa'));var jsforce=require(_0x77da('0xb'));var deskjs=require(_0x77da('0xc'));var toCsv=require(_0x77da('0x7'));var querystring=require(_0x77da('0xd'));var Papa=require('papaparse');var Redis=require(_0x77da('0xe'));var authService=require(_0x77da('0xf'));var qs=require(_0x77da('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x77da('0x11'));var logger=require(_0x77da('0x12'))(_0x77da('0x13'));var utils=require(_0x77da('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x77da('0x15'));var db=require(_0x77da('0x16'))['db'];function respondWithStatusCode(_0x2acc65,_0x5d6e2f){_0x5d6e2f=_0x5d6e2f||0xcc;return function(_0x4a7748){if(_0x4a7748){return _0x2acc65[_0x77da('0x17')](_0x5d6e2f);}return _0x2acc65[_0x77da('0x18')](_0x5d6e2f)['end']();};}function respondWithResult(_0x3b0ff2,_0x369df0){_0x369df0=_0x369df0||0xc8;return function(_0x355719){if(_0x355719){return _0x3b0ff2[_0x77da('0x18')](_0x369df0)['json'](_0x355719);}};}function respondWithFilteredResult(_0x2172d0,_0x4e130c){return function(_0x29cd7b){if(_0x29cd7b){var _0x366443=typeof _0x4e130c[_0x77da('0x19')]===_0x77da('0x1a')&&typeof _0x4e130c['limit']==='undefined';var _0x514016=_0x29cd7b['count'];var _0x103e46=_0x366443?0x0:_0x4e130c[_0x77da('0x19')];var _0x289887=_0x366443?_0x29cd7b[_0x77da('0x1b')]:_0x4e130c[_0x77da('0x19')]+_0x4e130c[_0x77da('0x1c')];var _0x1d325c;if(_0x289887>=_0x514016){_0x289887=_0x514016;_0x1d325c=0xc8;}else{_0x1d325c=0xce;}_0x2172d0[_0x77da('0x18')](_0x1d325c);return _0x2172d0['set']('Content-Range',_0x103e46+'-'+_0x289887+'/'+_0x514016)[_0x77da('0x1d')](_0x29cd7b);}return null;};}function patchUpdates(_0x4d1512){return function(_0x507979){try{jsonpatch[_0x77da('0x1e')](_0x507979,_0x4d1512,!![]);}catch(_0x304a2b){return BPromise[_0x77da('0x1f')](_0x304a2b);}return _0x507979['save']();};}function saveUpdates(_0x58270c,_0x3e6cfe){return function(_0x58f6c1){if(_0x58f6c1){return _0x58f6c1[_0x77da('0x20')](_0x58270c)[_0x77da('0x21')](function(_0xc52f0e){return _0xc52f0e;});}return null;};}function removeEntity(_0x27b6c7,_0x10399a){return function(_0x270318){if(_0x270318){return _0x270318[_0x77da('0x22')]()['then'](function(){var _0x4885ec=_0x270318[_0x77da('0x23')]({'plain':!![]});var _0x2d009f=_0x77da('0x24');return db[_0x77da('0x25')]['destroy']({'where':{'type':_0x2d009f,'resourceId':_0x4885ec['id']}})[_0x77da('0x21')](function(){return _0x270318;});})[_0x77da('0x21')](function(){_0x27b6c7[_0x77da('0x18')](0xcc)[_0x77da('0x26')]();});}};}function handleEntityNotFound(_0x446ae7,_0x5997b6){return function(_0xce24b8){if(!_0xce24b8){_0x446ae7[_0x77da('0x17')](0x194);}return _0xce24b8;};}function handleError(_0x1f2279,_0x2913f7){_0x2913f7=_0x2913f7||0x1f4;return function(_0x496ecd){logger['error'](_0x496ecd['stack']);if(_0x496ecd[_0x77da('0x27')]){delete _0x496ecd[_0x77da('0x27')];}_0x1f2279[_0x77da('0x18')](_0x2913f7)[_0x77da('0x28')](_0x496ecd);};}exports[_0x77da('0x29')]=function(_0x4eeb99,_0x350b4e){var _0x26f5a0={},_0x356bfb={},_0x1d381b={'count':0x0,'rows':[]};var _0x1e7853=_[_0x77da('0x2a')](db['AnalyticMetric'][_0x77da('0x2b')],function(_0x228851){return{'name':_0x228851[_0x77da('0x2c')],'type':_0x228851[_0x77da('0x2d')][_0x77da('0x2e')]};});_0x356bfb[_0x77da('0x2f')]=_[_0x77da('0x2a')](_0x1e7853,_0x77da('0x27'));_0x356bfb['query']=_['keys'](_0x4eeb99[_0x77da('0x30')]);_0x356bfb[_0x77da('0x31')]=_['intersection'](_0x356bfb[_0x77da('0x2f')],_0x356bfb[_0x77da('0x30')]);_0x26f5a0[_0x77da('0x32')]=_[_0x77da('0x33')](_0x356bfb[_0x77da('0x2f')],qs[_0x77da('0x34')](_0x4eeb99[_0x77da('0x30')]['fields']));_0x26f5a0[_0x77da('0x32')]=_0x26f5a0['attributes']['length']?_0x26f5a0['attributes']:_0x356bfb[_0x77da('0x2f')];if(!_0x4eeb99['query'][_0x77da('0x35')](_0x77da('0x36'))){_0x26f5a0[_0x77da('0x1c')]=qs[_0x77da('0x1c')](_0x4eeb99[_0x77da('0x30')][_0x77da('0x1c')]);_0x26f5a0[_0x77da('0x19')]=qs['offset'](_0x4eeb99[_0x77da('0x30')][_0x77da('0x19')]);}_0x26f5a0[_0x77da('0x37')]=qs[_0x77da('0x38')](_0x4eeb99[_0x77da('0x30')][_0x77da('0x38')]);_0x26f5a0['where']=qs[_0x77da('0x31')](_[_0x77da('0x39')](_0x4eeb99[_0x77da('0x30')],_0x356bfb['filters']),_0x1e7853);if(_0x4eeb99[_0x77da('0x30')]['filter']){_0x26f5a0['where']=_['merge'](_0x26f5a0['where'],{'$or':_[_0x77da('0x2a')](_0x1e7853,function(_0x1adba5){if(_0x1adba5[_0x77da('0x2d')]!=='VIRTUAL'){var _0x21d337={};_0x21d337[_0x1adba5['name']]={'$like':'%'+_0x4eeb99[_0x77da('0x30')]['filter']+'%'};return _0x21d337;}})});}_0x26f5a0=_[_0x77da('0x3a')]({},_0x26f5a0,_0x4eeb99[_0x77da('0x3b')]);var _0x290667={'where':_0x26f5a0[_0x77da('0x3c')]};return db[_0x77da('0x3d')]['count'](_0x290667)[_0x77da('0x21')](function(_0x1f48bd){_0x1d381b[_0x77da('0x1b')]=_0x1f48bd;if(_0x4eeb99[_0x77da('0x30')][_0x77da('0x3e')]){_0x26f5a0[_0x77da('0x3f')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x77da('0x40')](_0x26f5a0);})[_0x77da('0x21')](function(_0x21de41){_0x1d381b[_0x77da('0x41')]=_0x21de41;return _0x1d381b;})[_0x77da('0x21')](respondWithFilteredResult(_0x350b4e,_0x26f5a0))[_0x77da('0x42')](handleError(_0x350b4e,null));};exports['show']=function(_0x10957b,_0x5abcd9){var _0x1ae806={'raw':!![],'where':{'id':_0x10957b[_0x77da('0x43')]['id']}},_0x373fb2={};_0x373fb2['model']=_[_0x77da('0x44')](db[_0x77da('0x3d')][_0x77da('0x2b')]);_0x373fb2[_0x77da('0x30')]=_[_0x77da('0x44')](_0x10957b[_0x77da('0x30')]);_0x373fb2[_0x77da('0x31')]=_[_0x77da('0x33')](_0x373fb2[_0x77da('0x2f')],_0x373fb2['query']);_0x1ae806[_0x77da('0x32')]=_[_0x77da('0x33')](_0x373fb2[_0x77da('0x2f')],qs[_0x77da('0x34')](_0x10957b[_0x77da('0x30')][_0x77da('0x34')]));_0x1ae806['attributes']=_0x1ae806['attributes'][_0x77da('0x45')]?_0x1ae806[_0x77da('0x32')]:_0x373fb2[_0x77da('0x2f')];if(_0x10957b[_0x77da('0x30')][_0x77da('0x3e')]){_0x1ae806[_0x77da('0x3f')]=[{'all':!![]}];}_0x1ae806=_['merge']({},_0x1ae806,_0x10957b[_0x77da('0x3b')]);return db[_0x77da('0x3d')][_0x77da('0x46')](_0x1ae806)[_0x77da('0x21')](handleEntityNotFound(_0x5abcd9,null))['then'](respondWithResult(_0x5abcd9,null))[_0x77da('0x42')](handleError(_0x5abcd9,null));};exports['create']=function(_0x518fd5,_0x36263b){return db[_0x77da('0x3d')][_0x77da('0x47')](_0x518fd5[_0x77da('0x48')],{})['then'](function(_0x16bf4b){var _0x1e36ee=_0x518fd5['user'][_0x77da('0x23')]({'plain':!![]});if(!_0x1e36ee)throw new Error(_0x77da('0x49'));if(_0x1e36ee['role']===_0x77da('0x4a')){var _0x3aaf5b=_0x16bf4b[_0x77da('0x23')]({'plain':!![]});var _0xef2496=_0x77da('0x24');return db[_0x77da('0x4b')][_0x77da('0x46')]({'where':{'name':_0xef2496,'userProfileId':_0x1e36ee[_0x77da('0x4c')]},'raw':!![]})[_0x77da('0x21')](function(_0x3a34a8){if(_0x3a34a8&&_0x3a34a8['autoAssociation']===0x0){return db[_0x77da('0x25')]['create']({'name':_0x3aaf5b[_0x77da('0x27')],'resourceId':_0x3aaf5b['id'],'type':_0x3a34a8[_0x77da('0x27')],'sectionId':_0x3a34a8['id']},{})[_0x77da('0x21')](function(){return _0x16bf4b;});}else{return _0x16bf4b;}})[_0x77da('0x42')](function(_0x374179){logger[_0x77da('0x4d')](_0x77da('0x4e'),_0x374179);throw _0x374179;});}return _0x16bf4b;})['then'](respondWithResult(_0x36263b,0xc9))[_0x77da('0x42')](handleError(_0x36263b,null));};exports[_0x77da('0x20')]=function(_0x1a7115,_0x353be9){if(_0x1a7115['body']['id']){delete _0x1a7115[_0x77da('0x48')]['id'];}return db[_0x77da('0x3d')][_0x77da('0x46')]({'where':{'id':_0x1a7115['params']['id']}})['then'](handleEntityNotFound(_0x353be9,null))[_0x77da('0x21')](saveUpdates(_0x1a7115[_0x77da('0x48')],null))[_0x77da('0x21')](respondWithResult(_0x353be9,null))[_0x77da('0x42')](handleError(_0x353be9,null));};exports[_0x77da('0x22')]=function(_0x528a32,_0x50437b){return db[_0x77da('0x3d')][_0x77da('0x46')]({'where':{'id':_0x528a32['params']['id']}})[_0x77da('0x21')](handleEntityNotFound(_0x50437b,null))[_0x77da('0x21')](removeEntity(_0x50437b,null))[_0x77da('0x42')](handleError(_0x50437b,null));};
\ No newline at end of file
index 178606d..c76603f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14f5=['moment','bluebird','path','rimraf','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','util','api'];(function(_0x4463ab,_0x186b3f){var _0x43083c=function(_0x11188c){while(--_0x11188c){_0x4463ab['push'](_0x4463ab['shift']());}};_0x43083c(++_0x186b3f);}(_0x14f5,0xae));var _0x514f=function(_0xe59cff,_0x1a7dbe){_0xe59cff=_0xe59cff-0x0;var _0x26e8c1=_0x14f5[_0xe59cff];return _0x26e8c1;};'use strict';var _=require('lodash');var util=require(_0x514f('0x0'));var logger=require('../../config/logger')(_0x514f('0x1'));var moment=require(_0x514f('0x2'));var BPromise=require(_0x514f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x514f('0x4'));var rimraf=require(_0x514f('0x5'));var config=require('../../config/environment');var attributes=require(_0x514f('0x6'));module[_0x514f('0x7')]=function(_0xc2ca56,_0x434452){return _0xc2ca56[_0x514f('0x8')](_0x514f('0x9'),attributes,{'tableName':_0x514f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3cb7=['define','AnalyticMetric','analytics_metrics','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports'];(function(_0x8c410f,_0x2c6376){var _0x558e03=function(_0x3a29b1){while(--_0x3a29b1){_0x8c410f['push'](_0x8c410f['shift']());}};_0x558e03(++_0x2c6376);}(_0x3cb7,0xcf));var _0x73cb=function(_0xc5a279,_0x155360){_0xc5a279=_0xc5a279-0x0;var _0xc755d3=_0x3cb7[_0xc5a279];return _0xc755d3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x73cb('0x0'))('api');var moment=require(_0x73cb('0x1'));var BPromise=require(_0x73cb('0x2'));var rp=require(_0x73cb('0x3'));var fs=require('fs');var path=require(_0x73cb('0x4'));var rimraf=require(_0x73cb('0x5'));var config=require(_0x73cb('0x6'));var attributes=require(_0x73cb('0x7'));module[_0x73cb('0x8')]=function(_0x574e69,_0x28a10b){return _0x574e69[_0x73cb('0x9')](_0x73cb('0xa'),attributes,{'tableName':_0x73cb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5590c9d..43d0278 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef96=['then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x180ad8,_0x3cab85){var _0x454074=function(_0x4e949f){while(--_0x4e949f){_0x180ad8['push'](_0x180ad8['shift']());}};_0x454074(++_0x3cab85);}(_0xef96,0x196));var _0x6ef9=function(_0xcb020b,_0x46b2a8){_0xcb020b=_0xcb020b-0x0;var _0x4d75d4=_0xef96[_0xcb020b];return _0x4d75d4;};'use strict';var _=require('lodash');var util=require(_0x6ef9('0x0'));var moment=require(_0x6ef9('0x1'));var BPromise=require(_0x6ef9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ef9('0x3'));var db=require(_0x6ef9('0x4'))['db'];var utils=require(_0x6ef9('0x5'));var logger=require('../../config/logger')(_0x6ef9('0x6'));var config=require(_0x6ef9('0x7'));var jayson=require(_0x6ef9('0x8'));var client=jayson[_0x6ef9('0x9')][_0x6ef9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f9770,_0x194e43,_0x40a6c8){return new BPromise(function(_0x48d892,_0x550bd4){return client[_0x6ef9('0xb')](_0x2f9770,_0x40a6c8)[_0x6ef9('0xc')](function(_0x22d222){logger['info'](_0x6ef9('0xd'),_0x194e43,_0x6ef9('0xe'));logger['debug'](_0x6ef9('0xf'),_0x194e43,_0x6ef9('0xe'),JSON[_0x6ef9('0x10')](_0x22d222));if(_0x22d222[_0x6ef9('0x11')]){if(_0x22d222[_0x6ef9('0x11')]['code']===0x1f4){logger[_0x6ef9('0x11')](_0x6ef9('0xd'),_0x194e43,_0x22d222[_0x6ef9('0x11')]['message']);return _0x550bd4(_0x22d222[_0x6ef9('0x11')]['message']);}logger['error'](_0x6ef9('0xd'),_0x194e43,_0x22d222['error'][_0x6ef9('0x12')]);return _0x48d892(_0x22d222[_0x6ef9('0x11')]['message']);}else{logger[_0x6ef9('0x13')](_0x6ef9('0xd'),_0x194e43,_0x6ef9('0xe'));_0x48d892(_0x22d222[_0x6ef9('0x14')]['message']);}})[_0x6ef9('0x15')](function(_0x5cff6d){logger[_0x6ef9('0x11')](_0x6ef9('0xd'),_0x194e43,_0x5cff6d);_0x550bd4(_0x5cff6d);});});}
\ No newline at end of file
+var _0x7254=['request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s'];(function(_0x64924c,_0x472da8){var _0x1b8e46=function(_0x3561fe){while(--_0x3561fe){_0x64924c['push'](_0x64924c['shift']());}};_0x1b8e46(++_0x472da8);}(_0x7254,0xb8));var _0x4725=function(_0x25169f,_0x1a7368){_0x25169f=_0x25169f-0x0;var _0x19dffa=_0x7254[_0x25169f];return _0x19dffa;};'use strict';var _=require(_0x4725('0x0'));var util=require(_0x4725('0x1'));var moment=require('moment');var BPromise=require(_0x4725('0x2'));var rs=require(_0x4725('0x3'));var fs=require('fs');var Redis=require(_0x4725('0x4'));var db=require(_0x4725('0x5'))['db'];var utils=require(_0x4725('0x6'));var logger=require('../../config/logger')(_0x4725('0x7'));var config=require(_0x4725('0x8'));var jayson=require(_0x4725('0x9'));var client=jayson[_0x4725('0xa')][_0x4725('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x18c47d,_0x4596f4,_0x4ceb34){return new BPromise(function(_0x3b25eb,_0x4645c7){return client[_0x4725('0xc')](_0x18c47d,_0x4ceb34)[_0x4725('0xd')](function(_0x3dee2f){logger[_0x4725('0xe')](_0x4725('0xf'),_0x4596f4,_0x4725('0x10'));logger[_0x4725('0x11')](_0x4725('0x12'),_0x4596f4,_0x4725('0x10'),JSON[_0x4725('0x13')](_0x3dee2f));if(_0x3dee2f[_0x4725('0x14')]){if(_0x3dee2f['error'][_0x4725('0x15')]===0x1f4){logger[_0x4725('0x14')]('AnalyticMetric,\x20%s,\x20%s',_0x4596f4,_0x3dee2f[_0x4725('0x14')][_0x4725('0x16')]);return _0x4645c7(_0x3dee2f[_0x4725('0x14')]['message']);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x4596f4,_0x3dee2f[_0x4725('0x14')]['message']);return _0x3b25eb(_0x3dee2f[_0x4725('0x14')][_0x4725('0x16')]);}else{logger[_0x4725('0xe')](_0x4725('0xf'),_0x4596f4,_0x4725('0x10'));_0x3b25eb(_0x3dee2f[_0x4725('0x17')]['message']);}})[_0x4725('0x18')](function(_0x1fbb7d){logger[_0x4725('0x14')](_0x4725('0xf'),_0x4596f4,_0x1fbb7d);_0x4645c7(_0x1fbb7d);});});}
\ No newline at end of file
index 625eb75..b919896 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf4e=['/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./analyticMetric.controller','get','index'];(function(_0x24e5ea,_0x57480f){var _0x2b59e1=function(_0x123fe7){while(--_0x123fe7){_0x24e5ea['push'](_0x24e5ea['shift']());}};_0x2b59e1(++_0x57480f);}(_0xbf4e,0x172));var _0xebf4=function(_0x373b1d,_0x3deb39){_0x373b1d=_0x373b1d-0x0;var _0x49631f=_0xbf4e[_0x373b1d];return _0x49631f;};'use strict';var multer=require(_0xebf4('0x0'));var util=require(_0xebf4('0x1'));var path=require(_0xebf4('0x2'));var timeout=require(_0xebf4('0x3'));var express=require(_0xebf4('0x4'));var router=express[_0xebf4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xebf4('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xebf4('0x7'));router[_0xebf4('0x8')]('/',auth['isAuthenticated'](),controller[_0xebf4('0x9')]);router[_0xebf4('0x8')](_0xebf4('0xa'),auth['isAuthenticated'](),controller[_0xebf4('0xb')]);router[_0xebf4('0xc')]('/',auth[_0xebf4('0xd')](),controller[_0xebf4('0xe')]);router[_0xebf4('0xf')](_0xebf4('0xa'),auth[_0xebf4('0xd')](),controller[_0xebf4('0x10')]);router[_0xebf4('0x11')](_0xebf4('0xa'),auth[_0xebf4('0xd')](),controller[_0xebf4('0x12')]);module[_0xebf4('0x13')]=router;
\ No newline at end of file
+var _0xde81=['./analyticMetric.controller','get','isAuthenticated','index','/:id','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xde81,0x109));var _0x1de8=function(_0x347794,_0x519f45){_0x347794=_0x347794-0x0;var _0x5514fd=_0xde81[_0x347794];return _0x5514fd;};'use strict';var multer=require(_0x1de8('0x0'));var util=require(_0x1de8('0x1'));var path=require(_0x1de8('0x2'));var timeout=require(_0x1de8('0x3'));var express=require(_0x1de8('0x4'));var router=express[_0x1de8('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1de8('0x6'));var config=require('../../config/environment');var controller=require(_0x1de8('0x7'));router[_0x1de8('0x8')]('/',auth[_0x1de8('0x9')](),controller[_0x1de8('0xa')]);router[_0x1de8('0x8')](_0x1de8('0xb'),auth[_0x1de8('0x9')](),controller['show']);router['post']('/',auth[_0x1de8('0x9')](),controller['create']);router[_0x1de8('0xc')](_0x1de8('0xb'),auth[_0x1de8('0x9')](),controller['update']);router[_0x1de8('0xd')](_0x1de8('0xb'),auth[_0x1de8('0x9')](),controller[_0x1de8('0xe')]);module[_0x1de8('0xf')]=router;
\ No newline at end of file
index b65e4e9..2d353e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ce2=['exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5ce2,0x1b6));var _0x25ce=function(_0x3aea4e,_0x3da357){_0x3aea4e=_0x3aea4e-0x0;var _0x2e9db0=_0x5ce2[_0x3aea4e];return _0x2e9db0;};'use strict';var Sequelize=require('sequelize');module[_0x25ce('0x0')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0x5711=['sequelize','exports'];(function(_0x52b914,_0x52bcd3){var _0x21e041=function(_0x379e3a){while(--_0x379e3a){_0x52b914['push'](_0x52b914['shift']());}};_0x21e041(++_0x52bcd3);}(_0x5711,0x94));var _0x1571=function(_0x60286b,_0x3247c1){_0x60286b=_0x60286b-0x0;var _0x5dff69=_0x5711[_0x60286b];return _0x5dff69;};'use strict';var Sequelize=require(_0x1571('0x0'));module[_0x1571('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
index aaf6b7a..e5f70dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x510a=['hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticTreeReport','includeAll','include','rows','catch','show','params','keys','find','create','body','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','update','destroy','then','error','name','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length'];(function(_0x3b5db,_0x2e3654){var _0xd4b2ff=function(_0x4159d6){while(--_0x4159d6){_0x3b5db['push'](_0x3b5db['shift']());}};_0xd4b2ff(++_0x2e3654);}(_0x510a,0x177));var _0xa510=function(_0xd96ab9,_0x2b44a1){_0xd96ab9=_0xd96ab9-0x0;var _0x580fd6=_0x510a[_0xd96ab9];return _0x580fd6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa510('0x0'));var jsonpatch=require(_0xa510('0x1'));var rp=require(_0xa510('0x2'));var moment=require(_0xa510('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa510('0x4'));var util=require(_0xa510('0x5'));var path=require(_0xa510('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa510('0x7'));var fs=require('fs');var fs_extra=require(_0xa510('0x8'));var _=require(_0xa510('0x9'));var squel=require(_0xa510('0xa'));var crypto=require('crypto');var jsforce=require(_0xa510('0xb'));var deskjs=require(_0xa510('0xc'));var toCsv=require(_0xa510('0xd'));var querystring=require(_0xa510('0xe'));var Papa=require(_0xa510('0xf'));var Redis=require(_0xa510('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa510('0x11'));var logger=require(_0xa510('0x12'))(_0xa510('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa510('0x14'));var db=require(_0xa510('0x15'))['db'];function respondWithStatusCode(_0x5c01d4,_0x4023db){_0x4023db=_0x4023db||0xcc;return function(_0x8444eb){if(_0x8444eb){return _0x5c01d4[_0xa510('0x16')](_0x4023db);}return _0x5c01d4['status'](_0x4023db)[_0xa510('0x17')]();};}function respondWithResult(_0x898a9f,_0x486b2b){_0x486b2b=_0x486b2b||0xc8;return function(_0x2f7a55){if(_0x2f7a55){return _0x898a9f[_0xa510('0x18')](_0x486b2b)[_0xa510('0x19')](_0x2f7a55);}};}function respondWithFilteredResult(_0x5d52cd,_0x12ccd6){return function(_0x391ec5){if(_0x391ec5){var _0x5195f1=typeof _0x12ccd6['offset']==='undefined'&&typeof _0x12ccd6[_0xa510('0x1a')]===_0xa510('0x1b');var _0x5ed72d=_0x391ec5[_0xa510('0x1c')];var _0x3b14cf=_0x5195f1?0x0:_0x12ccd6['offset'];var _0x58516f=_0x5195f1?_0x391ec5[_0xa510('0x1c')]:_0x12ccd6[_0xa510('0x1d')]+_0x12ccd6[_0xa510('0x1a')];var _0x19008a;if(_0x58516f>=_0x5ed72d){_0x58516f=_0x5ed72d;_0x19008a=0xc8;}else{_0x19008a=0xce;}_0x5d52cd[_0xa510('0x18')](_0x19008a);return _0x5d52cd[_0xa510('0x1e')](_0xa510('0x1f'),_0x3b14cf+'-'+_0x58516f+'/'+_0x5ed72d)[_0xa510('0x19')](_0x391ec5);}return null;};}function patchUpdates(_0x34e473){return function(_0xbac5b9){try{jsonpatch[_0xa510('0x20')](_0xbac5b9,_0x34e473,!![]);}catch(_0x4445fd){return BPromise['reject'](_0x4445fd);}return _0xbac5b9['save']();};}function saveUpdates(_0x3a7f36,_0x4fa023){return function(_0x6fe873){if(_0x6fe873){return _0x6fe873[_0xa510('0x21')](_0x3a7f36)['then'](function(_0xdbc86){return _0xdbc86;});}return null;};}function removeEntity(_0x2c8ed6,_0x2e5063){return function(_0x1cd21a){if(_0x1cd21a){return _0x1cd21a[_0xa510('0x22')]()[_0xa510('0x23')](function(){_0x2c8ed6[_0xa510('0x18')](0xcc)[_0xa510('0x17')]();});}};}function handleEntityNotFound(_0x5216ef,_0x33fd1b){return function(_0x13ab81){if(!_0x13ab81){_0x5216ef[_0xa510('0x16')](0x194);}return _0x13ab81;};}function handleError(_0x5b90ad,_0x3fa574){_0x3fa574=_0x3fa574||0x1f4;return function(_0x5e004d){logger[_0xa510('0x24')](_0x5e004d['stack']);if(_0x5e004d[_0xa510('0x25')]){delete _0x5e004d['name'];}_0x5b90ad[_0xa510('0x18')](_0x3fa574)['send'](_0x5e004d);};}exports[_0xa510('0x26')]=function(_0x5e564b,_0x37fd34){var _0x58ca1e={},_0x46858f={},_0x5b165c={'count':0x0,'rows':[]};var _0x2bc8b4=_['map'](db['AnalyticTreeReport'][_0xa510('0x27')],function(_0x368823){return{'name':_0x368823[_0xa510('0x28')],'type':_0x368823[_0xa510('0x29')][_0xa510('0x2a')]};});_0x46858f[_0xa510('0x2b')]=_[_0xa510('0x2c')](_0x2bc8b4,_0xa510('0x25'));_0x46858f[_0xa510('0x2d')]=_['keys'](_0x5e564b['query']);_0x46858f[_0xa510('0x2e')]=_[_0xa510('0x2f')](_0x46858f[_0xa510('0x2b')],_0x46858f[_0xa510('0x2d')]);_0x58ca1e[_0xa510('0x30')]=_[_0xa510('0x2f')](_0x46858f[_0xa510('0x2b')],qs[_0xa510('0x31')](_0x5e564b[_0xa510('0x2d')]['fields']));_0x58ca1e[_0xa510('0x30')]=_0x58ca1e['attributes'][_0xa510('0x32')]?_0x58ca1e[_0xa510('0x30')]:_0x46858f[_0xa510('0x2b')];if(!_0x5e564b[_0xa510('0x2d')][_0xa510('0x33')](_0xa510('0x34'))){_0x58ca1e[_0xa510('0x1a')]=qs['limit'](_0x5e564b[_0xa510('0x2d')]['limit']);_0x58ca1e[_0xa510('0x1d')]=qs['offset'](_0x5e564b[_0xa510('0x2d')][_0xa510('0x1d')]);}_0x58ca1e['order']=qs[_0xa510('0x35')](_0x5e564b[_0xa510('0x2d')][_0xa510('0x35')]);_0x58ca1e[_0xa510('0x36')]=qs['filters'](_[_0xa510('0x37')](_0x5e564b[_0xa510('0x2d')],_0x46858f['filters']),_0x2bc8b4);if(_0x5e564b[_0xa510('0x2d')][_0xa510('0x38')]){_0x58ca1e[_0xa510('0x36')]=_[_0xa510('0x39')](_0x58ca1e[_0xa510('0x36')],{'$or':_[_0xa510('0x2c')](_0x2bc8b4,function(_0xe96587){if(_0xe96587[_0xa510('0x29')]!==_0xa510('0x3a')){var _0x500f8b={};_0x500f8b[_0xe96587[_0xa510('0x25')]]={'$like':'%'+_0x5e564b[_0xa510('0x2d')]['filter']+'%'};return _0x500f8b;}})});}_0x58ca1e=_[_0xa510('0x39')]({},_0x58ca1e,_0x5e564b[_0xa510('0x3b')]);var _0x431fb3={'where':_0x58ca1e['where']};return db[_0xa510('0x3c')][_0xa510('0x1c')](_0x431fb3)[_0xa510('0x23')](function(_0x33d651){_0x5b165c['count']=_0x33d651;if(_0x5e564b[_0xa510('0x2d')][_0xa510('0x3d')]){_0x58ca1e[_0xa510('0x3e')]=[{'all':!![]}];}return db[_0xa510('0x3c')]['findAll'](_0x58ca1e);})[_0xa510('0x23')](function(_0x55d7ce){_0x5b165c[_0xa510('0x3f')]=_0x55d7ce;return _0x5b165c;})['then'](respondWithFilteredResult(_0x37fd34,_0x58ca1e))[_0xa510('0x40')](handleError(_0x37fd34,null));};exports[_0xa510('0x41')]=function(_0x6e78b5,_0x381210){var _0x18a120={'raw':!![],'where':{'id':_0x6e78b5[_0xa510('0x42')]['id']}},_0x46a9fd={};_0x46a9fd[_0xa510('0x2b')]=_[_0xa510('0x43')](db['AnalyticTreeReport'][_0xa510('0x27')]);_0x46a9fd['query']=_[_0xa510('0x43')](_0x6e78b5[_0xa510('0x2d')]);_0x46a9fd[_0xa510('0x2e')]=_[_0xa510('0x2f')](_0x46a9fd[_0xa510('0x2b')],_0x46a9fd[_0xa510('0x2d')]);_0x18a120[_0xa510('0x30')]=_[_0xa510('0x2f')](_0x46a9fd[_0xa510('0x2b')],qs[_0xa510('0x31')](_0x6e78b5[_0xa510('0x2d')][_0xa510('0x31')]));_0x18a120[_0xa510('0x30')]=_0x18a120[_0xa510('0x30')]['length']?_0x18a120[_0xa510('0x30')]:_0x46a9fd[_0xa510('0x2b')];if(_0x6e78b5['query'][_0xa510('0x3d')]){_0x18a120['include']=[{'all':!![]}];}_0x18a120=_[_0xa510('0x39')]({},_0x18a120,_0x6e78b5[_0xa510('0x3b')]);return db[_0xa510('0x3c')][_0xa510('0x44')](_0x18a120)[_0xa510('0x23')](handleEntityNotFound(_0x381210,null))[_0xa510('0x23')](respondWithResult(_0x381210,null))['catch'](handleError(_0x381210,null));};exports[_0xa510('0x45')]=function(_0x41b708,_0x53a05e){return db['AnalyticTreeReport']['create'](_0x41b708[_0xa510('0x46')],{})[_0xa510('0x23')](respondWithResult(_0x53a05e,0xc9))[_0xa510('0x40')](handleError(_0x53a05e,null));};exports[_0xa510('0x21')]=function(_0x445263,_0x4a8e99){if(_0x445263[_0xa510('0x46')]['id']){delete _0x445263['body']['id'];}return db[_0xa510('0x3c')][_0xa510('0x44')]({'where':{'id':_0x445263[_0xa510('0x42')]['id']}})[_0xa510('0x23')](handleEntityNotFound(_0x4a8e99,null))[_0xa510('0x23')](saveUpdates(_0x445263[_0xa510('0x46')],null))[_0xa510('0x23')](respondWithResult(_0x4a8e99,null))['catch'](handleError(_0x4a8e99,null));};exports[_0xa510('0x22')]=function(_0xdeb9ea,_0x3c9d0d){return db[_0xa510('0x3c')][_0xa510('0x44')]({'where':{'id':_0xdeb9ea[_0xa510('0x42')]['id']}})[_0xa510('0x23')](handleEntityNotFound(_0x3c9d0d,null))[_0xa510('0x23')](removeEntity(_0x3c9d0d,null))[_0xa510('0x40')](handleError(_0x3c9d0d,null));};
\ No newline at end of file
+var _0x2ba3=['query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','show','params','includeAll','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../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','apply','reject','update','destroy','then','end','sendStatus','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model'];(function(_0x4ed32d,_0x327695){var _0xf624df=function(_0x29518c){while(--_0x29518c){_0x4ed32d['push'](_0x4ed32d['shift']());}};_0xf624df(++_0x327695);}(_0x2ba3,0x149));var _0x32ba=function(_0x44b9d1,_0x4ee1ab){_0x44b9d1=_0x44b9d1-0x0;var _0x55f7e6=_0x2ba3[_0x44b9d1];return _0x55f7e6;};'use strict';var emlformat=require(_0x32ba('0x0'));var rimraf=require(_0x32ba('0x1'));var zipdir=require(_0x32ba('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x32ba('0x3'));var moment=require(_0x32ba('0x4'));var BPromise=require(_0x32ba('0x5'));var Mustache=require('mustache');var util=require(_0x32ba('0x6'));var path=require('path');var sox=require(_0x32ba('0x7'));var csv=require(_0x32ba('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x32ba('0x9'));var _=require(_0x32ba('0xa'));var squel=require(_0x32ba('0xb'));var crypto=require(_0x32ba('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x32ba('0xd'));var toCsv=require(_0x32ba('0x8'));var querystring=require(_0x32ba('0xe'));var Papa=require(_0x32ba('0xf'));var Redis=require('ioredis');var authService=require(_0x32ba('0x10'));var qs=require(_0x32ba('0x11'));var as=require(_0x32ba('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x32ba('0x13'))(_0x32ba('0x14'));var utils=require(_0x32ba('0x15'));var config=require(_0x32ba('0x16'));var licenseUtil=require(_0x32ba('0x17'));var db=require(_0x32ba('0x18'))['db'];function respondWithStatusCode(_0x356e22,_0x580824){_0x580824=_0x580824||0xcc;return function(_0x3cb6dd){if(_0x3cb6dd){return _0x356e22['sendStatus'](_0x580824);}return _0x356e22[_0x32ba('0x19')](_0x580824)['end']();};}function respondWithResult(_0x42200f,_0x51827a){_0x51827a=_0x51827a||0xc8;return function(_0x5e24b1){if(_0x5e24b1){return _0x42200f[_0x32ba('0x19')](_0x51827a)[_0x32ba('0x1a')](_0x5e24b1);}};}function respondWithFilteredResult(_0x1a7883,_0x25ff4d){return function(_0xdf0901){if(_0xdf0901){var _0x2abccc=typeof _0x25ff4d[_0x32ba('0x1b')]==='undefined'&&typeof _0x25ff4d[_0x32ba('0x1c')]===_0x32ba('0x1d');var _0x5d1202=_0xdf0901[_0x32ba('0x1e')];var _0x12ebb4=_0x2abccc?0x0:_0x25ff4d[_0x32ba('0x1b')];var _0x4949ab=_0x2abccc?_0xdf0901[_0x32ba('0x1e')]:_0x25ff4d[_0x32ba('0x1b')]+_0x25ff4d[_0x32ba('0x1c')];var _0x5099f2;if(_0x4949ab>=_0x5d1202){_0x4949ab=_0x5d1202;_0x5099f2=0xc8;}else{_0x5099f2=0xce;}_0x1a7883[_0x32ba('0x19')](_0x5099f2);return _0x1a7883[_0x32ba('0x1f')]('Content-Range',_0x12ebb4+'-'+_0x4949ab+'/'+_0x5d1202)[_0x32ba('0x1a')](_0xdf0901);}return null;};}function patchUpdates(_0x43687a){return function(_0x256903){try{jsonpatch[_0x32ba('0x20')](_0x256903,_0x43687a,!![]);}catch(_0x537909){return BPromise[_0x32ba('0x21')](_0x537909);}return _0x256903['save']();};}function saveUpdates(_0x15f333,_0x1a8d86){return function(_0x10e86e){if(_0x10e86e){return _0x10e86e[_0x32ba('0x22')](_0x15f333)['then'](function(_0x11f151){return _0x11f151;});}return null;};}function removeEntity(_0x32b82d,_0xdcb5ae){return function(_0x3a6099){if(_0x3a6099){return _0x3a6099[_0x32ba('0x23')]()[_0x32ba('0x24')](function(){_0x32b82d[_0x32ba('0x19')](0xcc)[_0x32ba('0x25')]();});}};}function handleEntityNotFound(_0x4b4191,_0xbea894){return function(_0x239c13){if(!_0x239c13){_0x4b4191[_0x32ba('0x26')](0x194);}return _0x239c13;};}function handleError(_0x1bc2fc,_0x589797){_0x589797=_0x589797||0x1f4;return function(_0x2084eb){logger[_0x32ba('0x27')](_0x2084eb[_0x32ba('0x28')]);if(_0x2084eb[_0x32ba('0x29')]){delete _0x2084eb['name'];}_0x1bc2fc[_0x32ba('0x19')](_0x589797)[_0x32ba('0x2a')](_0x2084eb);};}exports[_0x32ba('0x2b')]=function(_0x3a766c,_0x939c6f){var _0x16283c={},_0x361297={},_0x1efc6f={'count':0x0,'rows':[]};var _0x2ffbb0=_[_0x32ba('0x2c')](db[_0x32ba('0x2d')][_0x32ba('0x2e')],function(_0x1fc7be){return{'name':_0x1fc7be[_0x32ba('0x2f')],'type':_0x1fc7be[_0x32ba('0x30')][_0x32ba('0x31')]};});_0x361297[_0x32ba('0x32')]=_[_0x32ba('0x2c')](_0x2ffbb0,'name');_0x361297[_0x32ba('0x33')]=_[_0x32ba('0x34')](_0x3a766c[_0x32ba('0x33')]);_0x361297[_0x32ba('0x35')]=_[_0x32ba('0x36')](_0x361297[_0x32ba('0x32')],_0x361297['query']);_0x16283c[_0x32ba('0x37')]=_['intersection'](_0x361297[_0x32ba('0x32')],qs[_0x32ba('0x38')](_0x3a766c[_0x32ba('0x33')][_0x32ba('0x38')]));_0x16283c[_0x32ba('0x37')]=_0x16283c['attributes'][_0x32ba('0x39')]?_0x16283c[_0x32ba('0x37')]:_0x361297[_0x32ba('0x32')];if(!_0x3a766c[_0x32ba('0x33')]['hasOwnProperty'](_0x32ba('0x3a'))){_0x16283c[_0x32ba('0x1c')]=qs['limit'](_0x3a766c[_0x32ba('0x33')][_0x32ba('0x1c')]);_0x16283c[_0x32ba('0x1b')]=qs[_0x32ba('0x1b')](_0x3a766c[_0x32ba('0x33')][_0x32ba('0x1b')]);}_0x16283c[_0x32ba('0x3b')]=qs[_0x32ba('0x3c')](_0x3a766c[_0x32ba('0x33')][_0x32ba('0x3c')]);_0x16283c[_0x32ba('0x3d')]=qs[_0x32ba('0x35')](_[_0x32ba('0x3e')](_0x3a766c[_0x32ba('0x33')],_0x361297[_0x32ba('0x35')]),_0x2ffbb0);if(_0x3a766c['query'][_0x32ba('0x3f')]){_0x16283c[_0x32ba('0x3d')]=_[_0x32ba('0x40')](_0x16283c[_0x32ba('0x3d')],{'$or':_[_0x32ba('0x2c')](_0x2ffbb0,function(_0x1eb93d){if(_0x1eb93d[_0x32ba('0x30')]!==_0x32ba('0x41')){var _0x330aa8={};_0x330aa8[_0x1eb93d[_0x32ba('0x29')]]={'$like':'%'+_0x3a766c['query'][_0x32ba('0x3f')]+'%'};return _0x330aa8;}})});}_0x16283c=_[_0x32ba('0x40')]({},_0x16283c,_0x3a766c[_0x32ba('0x42')]);var _0x20e30d={'where':_0x16283c[_0x32ba('0x3d')]};return db['AnalyticTreeReport'][_0x32ba('0x1e')](_0x20e30d)[_0x32ba('0x24')](function(_0x143b39){_0x1efc6f[_0x32ba('0x1e')]=_0x143b39;if(_0x3a766c[_0x32ba('0x33')]['includeAll']){_0x16283c[_0x32ba('0x43')]=[{'all':!![]}];}return db[_0x32ba('0x2d')]['findAll'](_0x16283c);})[_0x32ba('0x24')](function(_0x25b3ca){_0x1efc6f[_0x32ba('0x44')]=_0x25b3ca;return _0x1efc6f;})[_0x32ba('0x24')](respondWithFilteredResult(_0x939c6f,_0x16283c))['catch'](handleError(_0x939c6f,null));};exports[_0x32ba('0x45')]=function(_0x1b5dfe,_0x547be8){var _0x4ef756={'raw':!![],'where':{'id':_0x1b5dfe[_0x32ba('0x46')]['id']}},_0x3f466b={};_0x3f466b[_0x32ba('0x32')]=_[_0x32ba('0x34')](db[_0x32ba('0x2d')]['rawAttributes']);_0x3f466b[_0x32ba('0x33')]=_[_0x32ba('0x34')](_0x1b5dfe['query']);_0x3f466b['filters']=_[_0x32ba('0x36')](_0x3f466b['model'],_0x3f466b[_0x32ba('0x33')]);_0x4ef756['attributes']=_[_0x32ba('0x36')](_0x3f466b[_0x32ba('0x32')],qs[_0x32ba('0x38')](_0x1b5dfe['query'][_0x32ba('0x38')]));_0x4ef756['attributes']=_0x4ef756[_0x32ba('0x37')][_0x32ba('0x39')]?_0x4ef756['attributes']:_0x3f466b[_0x32ba('0x32')];if(_0x1b5dfe['query'][_0x32ba('0x47')]){_0x4ef756[_0x32ba('0x43')]=[{'all':!![]}];}_0x4ef756=_[_0x32ba('0x40')]({},_0x4ef756,_0x1b5dfe[_0x32ba('0x42')]);return db[_0x32ba('0x2d')][_0x32ba('0x48')](_0x4ef756)['then'](handleEntityNotFound(_0x547be8,null))[_0x32ba('0x24')](respondWithResult(_0x547be8,null))[_0x32ba('0x49')](handleError(_0x547be8,null));};exports['create']=function(_0x599e5e,_0x1f4187){return db[_0x32ba('0x2d')][_0x32ba('0x4a')](_0x599e5e[_0x32ba('0x4b')],{})['then'](respondWithResult(_0x1f4187,0xc9))[_0x32ba('0x49')](handleError(_0x1f4187,null));};exports[_0x32ba('0x22')]=function(_0x207cdd,_0x1fcd6d){if(_0x207cdd[_0x32ba('0x4b')]['id']){delete _0x207cdd['body']['id'];}return db[_0x32ba('0x2d')][_0x32ba('0x48')]({'where':{'id':_0x207cdd[_0x32ba('0x46')]['id']}})[_0x32ba('0x24')](handleEntityNotFound(_0x1fcd6d,null))[_0x32ba('0x24')](saveUpdates(_0x207cdd['body'],null))[_0x32ba('0x24')](respondWithResult(_0x1fcd6d,null))[_0x32ba('0x49')](handleError(_0x1fcd6d,null));};exports['destroy']=function(_0x1aef56,_0x32e811){return db[_0x32ba('0x2d')]['find']({'where':{'id':_0x1aef56[_0x32ba('0x46')]['id']}})['then'](handleEntityNotFound(_0x32e811,null))[_0x32ba('0x24')](removeEntity(_0x32e811,null))[_0x32ba('0x49')](handleError(_0x32e811,null));};
\ No newline at end of file
index 74392db..9e0fdf9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x515a=['bluebird','rimraf','../../config/environment','exports','AnalyticTreeReport','lodash','util','../../config/logger','api','moment'];(function(_0x1e9c0c,_0x61b24f){var _0x4bceff=function(_0x40a491){while(--_0x40a491){_0x1e9c0c['push'](_0x1e9c0c['shift']());}};_0x4bceff(++_0x61b24f);}(_0x515a,0xeb));var _0xa515=function(_0x481f7d,_0x3bd71e){_0x481f7d=_0x481f7d-0x0;var _0x350666=_0x515a[_0x481f7d];return _0x350666;};'use strict';var _=require(_0xa515('0x0'));var util=require(_0xa515('0x1'));var logger=require(_0xa515('0x2'))(_0xa515('0x3'));var moment=require(_0xa515('0x4'));var BPromise=require(_0xa515('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa515('0x6'));var config=require(_0xa515('0x7'));var attributes=require('./analyticTreeReport.attributes');module[_0xa515('0x8')]=function(_0x8557e3,_0x4a6a32){return _0x8557e3['define'](_0xa515('0x9'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x413f=['path','../../config/environment','./analyticTreeReport.attributes','AnalyticTreeReport','analytics_report_trees','util','../../config/logger','api','bluebird','request-promise'];(function(_0x9f28a0,_0x3d2e43){var _0x5a5dea=function(_0x410614){while(--_0x410614){_0x9f28a0['push'](_0x9f28a0['shift']());}};_0x5a5dea(++_0x3d2e43);}(_0x413f,0xd7));var _0xf413=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x413f[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require(_0xf413('0x0'));var logger=require(_0xf413('0x1'))(_0xf413('0x2'));var moment=require('moment');var BPromise=require(_0xf413('0x3'));var rp=require(_0xf413('0x4'));var fs=require('fs');var path=require(_0xf413('0x5'));var rimraf=require('rimraf');var config=require(_0xf413('0x6'));var attributes=require(_0xf413('0x7'));module['exports']=function(_0x7f80de,_0x1e4023){return _0x7f80de['define'](_0xf413('0x8'),attributes,{'tableName':_0xf413('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index edd0d1a..9a13292 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','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x3d1830,_0x2fe463){var _0x41bb69=function(_0x144e18){while(--_0x144e18){_0x3d1830['push'](_0x3d1830['shift']());}};_0x41bb69(++_0x2fe463);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xc4aa[_0x5d6456];return _0x4d66c1;};'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')]('AnalyticTreeReport,\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','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x2162f1,_0x3544a1){var _0x5c7dab=function(_0x2ae16b){while(--_0x2ae16b){_0x2162f1['push'](_0x2162f1['shift']());}};_0x5c7dab(++_0x3544a1);}(_0xdb28,0x106));var _0x8db2=function(_0x5b6a41,_0x395dce){_0x5b6a41=_0x5b6a41-0x0;var _0x1c41bd=_0xdb28[_0x5b6a41];return _0x1c41bd;};'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')]('AnalyticTreeReport,\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 567c5b5..0a2a08a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae1b=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','destroy','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x4feb5f,_0x580ee5){var _0x448d0a=function(_0x29c78b){while(--_0x29c78b){_0x4feb5f['push'](_0x4feb5f['shift']());}};_0x448d0a(++_0x580ee5);}(_0xae1b,0xcb));var _0xbae1=function(_0x16f2ee,_0x1d33f7){_0x16f2ee=_0x16f2ee-0x0;var _0x185b1e=_0xae1b[_0x16f2ee];return _0x185b1e;};'use strict';var multer=require(_0xbae1('0x0'));var util=require(_0xbae1('0x1'));var path=require(_0xbae1('0x2'));var timeout=require(_0xbae1('0x3'));var express=require(_0xbae1('0x4'));var router=express['Router']();var fs_extra=require(_0xbae1('0x5'));var auth=require(_0xbae1('0x6'));var interaction=require(_0xbae1('0x7'));var config=require(_0xbae1('0x8'));var controller=require(_0xbae1('0x9'));router[_0xbae1('0xa')]('/',auth[_0xbae1('0xb')](),controller[_0xbae1('0xc')]);router['get'](_0xbae1('0xd'),auth[_0xbae1('0xb')](),controller[_0xbae1('0xe')]);router[_0xbae1('0xf')]('/',auth[_0xbae1('0xb')](),controller[_0xbae1('0x10')]);router[_0xbae1('0x11')](_0xbae1('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xbae1('0xd'),auth[_0xbae1('0xb')](),controller[_0xbae1('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0xd5b8=['multer','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports'];(function(_0x269b1d,_0x3b3ec2){var _0x58df06=function(_0x23153f){while(--_0x23153f){_0x269b1d['push'](_0x269b1d['shift']());}};_0x58df06(++_0x3b3ec2);}(_0xd5b8,0x1c8));var _0x8d5b=function(_0x442f0e,_0x4d81c6){_0x442f0e=_0x442f0e-0x0;var _0xf97504=_0xd5b8[_0x442f0e];return _0xf97504;};'use strict';var multer=require(_0x8d5b('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8d5b('0x1'));var router=express['Router']();var fs_extra=require(_0x8d5b('0x2'));var auth=require(_0x8d5b('0x3'));var interaction=require(_0x8d5b('0x4'));var config=require(_0x8d5b('0x5'));var controller=require(_0x8d5b('0x6'));router[_0x8d5b('0x7')]('/',auth[_0x8d5b('0x8')](),controller[_0x8d5b('0x9')]);router[_0x8d5b('0x7')]('/:id',auth[_0x8d5b('0x8')](),controller[_0x8d5b('0xa')]);router[_0x8d5b('0xb')]('/',auth[_0x8d5b('0x8')](),controller[_0x8d5b('0xc')]);router[_0x8d5b('0xd')](_0x8d5b('0xe'),auth['isAuthenticated'](),controller[_0x8d5b('0xf')]);router[_0x8d5b('0x10')](_0x8d5b('0xe'),auth[_0x8d5b('0x8')](),controller[_0x8d5b('0x11')]);module[_0x8d5b('0x12')]=router;
\ No newline at end of file
index 7c56141..98dcee7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe45=['sequelize','exports','STRING'];(function(_0xf31767,_0x381746){var _0x24bd0c=function(_0x3b3472){while(--_0x3b3472){_0xf31767['push'](_0xf31767['shift']());}};_0x24bd0c(++_0x381746);}(_0xbe45,0xf0));var _0x5be4=function(_0x3794c2,_0x53594e){_0x3794c2=_0x3794c2-0x0;var _0x36ebc8=_0xbe45[_0x3794c2];return _0x36ebc8;};'use strict';var Sequelize=require(_0x5be4('0x0'));module[_0x5be4('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x5be4('0x2')]},'type':{'type':Sequelize[_0x5be4('0x2')]}};
\ No newline at end of file
+var _0xf185=['sequelize','STRING'];(function(_0x4d0ee8,_0x28acb8){var _0x3e41b2=function(_0x169561){while(--_0x169561){_0x4d0ee8['push'](_0x4d0ee8['shift']());}};_0x3e41b2(++_0x28acb8);}(_0xf185,0x1be));var _0x5f18=function(_0x2ea0e2,_0x24ec0f){_0x2ea0e2=_0x2ea0e2-0x0;var _0x2a27c6=_0xf185[_0x2ea0e2];return _0x2a27c6;};'use strict';var Sequelize=require(_0x5f18('0x0'));module['exports']={'name':{'type':Sequelize[_0x5f18('0x1')]},'basename':{'type':Sequelize[_0x5f18('0x1')]},'type':{'type':Sequelize[_0x5f18('0x1')]}};
\ No newline at end of file
index 3bfe4e3..5ae1c47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e4f=['Attachment','rawAttributes','fieldName','type','key','query','model','attributes','length','hasOwnProperty','sort','pick','filters','filter','where','merge','options','includeAll','include','rows','catch','show','keys','intersection','fields','find','get','createdAt','body','omit','updatedAt','create','update','params','file','originalname','basename','filename','mimetype','download','findOne','join','root','offline-chat/','rimraf','zip-dir','fast-json-patch','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','apply','reject','then','destroy','error','stack','name','send','index','map'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0x2e4f,0x12b));var _0xf2e4=function(_0x26efac,_0x21ab8a){_0x26efac=_0x26efac-0x0;var _0x8482e4=_0x2e4f[_0x26efac];return _0x8482e4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf2e4('0x0'));var zipdir=require(_0xf2e4('0x1'));var jsonpatch=require(_0xf2e4('0x2'));var rp=require('request-promise');var moment=require(_0xf2e4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf2e4('0x4'));var util=require(_0xf2e4('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xf2e4('0x6'));var ejs=require(_0xf2e4('0x7'));var fs=require('fs');var fs_extra=require(_0xf2e4('0x8'));var _=require(_0xf2e4('0x9'));var squel=require(_0xf2e4('0xa'));var crypto=require(_0xf2e4('0xb'));var jsforce=require(_0xf2e4('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf2e4('0x6'));var querystring=require(_0xf2e4('0xd'));var Papa=require(_0xf2e4('0xe'));var Redis=require(_0xf2e4('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf2e4('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf2e4('0x11'));var logger=require(_0xf2e4('0x12'))(_0xf2e4('0x13'));var utils=require('../../config/utils');var config=require(_0xf2e4('0x14'));var licenseUtil=require(_0xf2e4('0x15'));var db=require(_0xf2e4('0x16'))['db'];function respondWithStatusCode(_0x87810,_0x4f1935){_0x4f1935=_0x4f1935||0xcc;return function(_0xf48111){if(_0xf48111){return _0x87810[_0xf2e4('0x17')](_0x4f1935);}return _0x87810[_0xf2e4('0x18')](_0x4f1935)[_0xf2e4('0x19')]();};}function respondWithResult(_0x417096,_0x2ed6b7){_0x2ed6b7=_0x2ed6b7||0xc8;return function(_0x1aa790){if(_0x1aa790){return _0x417096[_0xf2e4('0x18')](_0x2ed6b7)[_0xf2e4('0x1a')](_0x1aa790);}};}function respondWithFilteredResult(_0x4ffe6a,_0x1317a5){return function(_0xf3e67c){if(_0xf3e67c){var _0x458653=typeof _0x1317a5[_0xf2e4('0x1b')]==='undefined'&&typeof _0x1317a5[_0xf2e4('0x1c')]==='undefined';var _0x20670c=_0xf3e67c['count'];var _0x184669=_0x458653?0x0:_0x1317a5[_0xf2e4('0x1b')];var _0x5405ac=_0x458653?_0xf3e67c[_0xf2e4('0x1d')]:_0x1317a5['offset']+_0x1317a5['limit'];var _0x97d6f0;if(_0x5405ac>=_0x20670c){_0x5405ac=_0x20670c;_0x97d6f0=0xc8;}else{_0x97d6f0=0xce;}_0x4ffe6a[_0xf2e4('0x18')](_0x97d6f0);return _0x4ffe6a[_0xf2e4('0x1e')]('Content-Range',_0x184669+'-'+_0x5405ac+'/'+_0x20670c)[_0xf2e4('0x1a')](_0xf3e67c);}return null;};}function patchUpdates(_0x2dec89){return function(_0x407884){try{jsonpatch[_0xf2e4('0x1f')](_0x407884,_0x2dec89,!![]);}catch(_0x39e52d){return BPromise[_0xf2e4('0x20')](_0x39e52d);}return _0x407884['save']();};}function saveUpdates(_0x1e0a2a,_0x2925ef){return function(_0x3172f8){if(_0x3172f8){return _0x3172f8['update'](_0x1e0a2a)[_0xf2e4('0x21')](function(_0x40dedf){return _0x40dedf;});}return null;};}function removeEntity(_0x3e0552,_0x10d579){return function(_0x1f3c71){if(_0x1f3c71){return _0x1f3c71[_0xf2e4('0x22')]()['then'](function(){_0x3e0552[_0xf2e4('0x18')](0xcc)[_0xf2e4('0x19')]();});}};}function handleEntityNotFound(_0x4f0603,_0x469e12){return function(_0x381d8f){if(!_0x381d8f){_0x4f0603[_0xf2e4('0x17')](0x194);}return _0x381d8f;};}function handleError(_0x352b96,_0xb3dbd0){_0xb3dbd0=_0xb3dbd0||0x1f4;return function(_0x24dfbb){logger[_0xf2e4('0x23')](_0x24dfbb[_0xf2e4('0x24')]);if(_0x24dfbb[_0xf2e4('0x25')]){delete _0x24dfbb[_0xf2e4('0x25')];}_0x352b96[_0xf2e4('0x18')](_0xb3dbd0)[_0xf2e4('0x26')](_0x24dfbb);};}exports[_0xf2e4('0x27')]=function(_0x2ca89b,_0x1ca1eb){var _0x57330b={},_0x5cda26={},_0x3e93d5={'count':0x0,'rows':[]};var _0x43b403=_[_0xf2e4('0x28')](db[_0xf2e4('0x29')][_0xf2e4('0x2a')],function(_0x5acb7d){return{'name':_0x5acb7d[_0xf2e4('0x2b')],'type':_0x5acb7d[_0xf2e4('0x2c')][_0xf2e4('0x2d')]};});_0x5cda26['model']=_[_0xf2e4('0x28')](_0x43b403,_0xf2e4('0x25'));_0x5cda26[_0xf2e4('0x2e')]=_['keys'](_0x2ca89b[_0xf2e4('0x2e')]);_0x5cda26['filters']=_['intersection'](_0x5cda26[_0xf2e4('0x2f')],_0x5cda26['query']);_0x57330b['attributes']=_['intersection'](_0x5cda26['model'],qs['fields'](_0x2ca89b['query']['fields']));_0x57330b[_0xf2e4('0x30')]=_0x57330b[_0xf2e4('0x30')][_0xf2e4('0x31')]?_0x57330b[_0xf2e4('0x30')]:_0x5cda26[_0xf2e4('0x2f')];if(!_0x2ca89b['query'][_0xf2e4('0x32')]('nolimit')){_0x57330b[_0xf2e4('0x1c')]=qs['limit'](_0x2ca89b[_0xf2e4('0x2e')]['limit']);_0x57330b[_0xf2e4('0x1b')]=qs[_0xf2e4('0x1b')](_0x2ca89b[_0xf2e4('0x2e')]['offset']);}_0x57330b['order']=qs[_0xf2e4('0x33')](_0x2ca89b[_0xf2e4('0x2e')]['sort']);_0x57330b['where']=qs['filters'](_[_0xf2e4('0x34')](_0x2ca89b[_0xf2e4('0x2e')],_0x5cda26[_0xf2e4('0x35')]),_0x43b403);if(_0x2ca89b['query'][_0xf2e4('0x36')]){_0x57330b[_0xf2e4('0x37')]=_[_0xf2e4('0x38')](_0x57330b[_0xf2e4('0x37')],{'$or':_[_0xf2e4('0x28')](_0x43b403,function(_0x243209){if(_0x243209[_0xf2e4('0x2c')]!=='VIRTUAL'){var _0x258b00={};_0x258b00[_0x243209[_0xf2e4('0x25')]]={'$like':'%'+_0x2ca89b['query']['filter']+'%'};return _0x258b00;}})});}_0x57330b=_[_0xf2e4('0x38')]({},_0x57330b,_0x2ca89b[_0xf2e4('0x39')]);var _0x4bf0e8={'where':_0x57330b[_0xf2e4('0x37')]};return db['Attachment']['count'](_0x4bf0e8)[_0xf2e4('0x21')](function(_0x25d544){_0x3e93d5['count']=_0x25d544;if(_0x2ca89b[_0xf2e4('0x2e')][_0xf2e4('0x3a')]){_0x57330b[_0xf2e4('0x3b')]=[{'all':!![]}];}return db[_0xf2e4('0x29')]['findAll'](_0x57330b);})[_0xf2e4('0x21')](function(_0xe8e012){_0x3e93d5[_0xf2e4('0x3c')]=_0xe8e012;return _0x3e93d5;})[_0xf2e4('0x21')](respondWithFilteredResult(_0x1ca1eb,_0x57330b))[_0xf2e4('0x3d')](handleError(_0x1ca1eb,null));};exports[_0xf2e4('0x3e')]=function(_0x2c05fc,_0x4c1f2c){var _0x326839={'raw':!![],'where':{'id':_0x2c05fc['params']['id']}},_0xc0f44d={};_0xc0f44d[_0xf2e4('0x2f')]=_[_0xf2e4('0x3f')](db[_0xf2e4('0x29')][_0xf2e4('0x2a')]);_0xc0f44d[_0xf2e4('0x2e')]=_[_0xf2e4('0x3f')](_0x2c05fc[_0xf2e4('0x2e')]);_0xc0f44d[_0xf2e4('0x35')]=_[_0xf2e4('0x40')](_0xc0f44d[_0xf2e4('0x2f')],_0xc0f44d['query']);_0x326839[_0xf2e4('0x30')]=_[_0xf2e4('0x40')](_0xc0f44d[_0xf2e4('0x2f')],qs[_0xf2e4('0x41')](_0x2c05fc[_0xf2e4('0x2e')][_0xf2e4('0x41')]));_0x326839[_0xf2e4('0x30')]=_0x326839[_0xf2e4('0x30')][_0xf2e4('0x31')]?_0x326839[_0xf2e4('0x30')]:_0xc0f44d[_0xf2e4('0x2f')];if(_0x2c05fc['query'][_0xf2e4('0x3a')]){_0x326839['include']=[{'all':!![]}];}_0x326839=_[_0xf2e4('0x38')]({},_0x326839,_0x2c05fc[_0xf2e4('0x39')]);return db[_0xf2e4('0x29')][_0xf2e4('0x42')](_0x326839)[_0xf2e4('0x21')](handleEntityNotFound(_0x4c1f2c,null))['then'](respondWithResult(_0x4c1f2c,null))['catch'](handleError(_0x4c1f2c,null));};exports['clone']=function(_0x5d666e,_0x138d02){var _0x32df9c={'where':{'id':_0x5d666e['params']['id']}},_0x2f8103={};_0x2f8103[_0xf2e4('0x2f')]=_[_0xf2e4('0x3f')](db[_0xf2e4('0x29')][_0xf2e4('0x2a')]);_0x32df9c[_0xf2e4('0x30')]=_['intersection'](_0x2f8103[_0xf2e4('0x2f')],qs[_0xf2e4('0x41')](_0x5d666e['query'][_0xf2e4('0x41')]));_0x32df9c['attributes']=_0x32df9c['attributes'][_0xf2e4('0x31')]?_0x32df9c[_0xf2e4('0x30')]:_0x2f8103[_0xf2e4('0x2f')];if(_0x5d666e[_0xf2e4('0x2e')][_0xf2e4('0x3a')]){_0x32df9c['include']=[{'all':!![]}];}_0x32df9c=_[_0xf2e4('0x38')]({},_0x32df9c,_0x5d666e[_0xf2e4('0x39')]);return db['Attachment'][_0xf2e4('0x42')](_0x32df9c)[_0xf2e4('0x21')](handleEntityNotFound(_0x138d02,null))[_0xf2e4('0x21')](function(_0x5d6f71){if(_0x5d6f71){var _0x1d1ab6=_0x5d6f71[_0xf2e4('0x43')]({'plain':!![]});_0x1d1ab6=qs['omit'](_0x1d1ab6,['id',_0xf2e4('0x44'),'updatedAt']);_0x5d666e[_0xf2e4('0x45')]=_[_0xf2e4('0x46')](_0x5d666e['body'],['id','createdAt',_0xf2e4('0x47')]);return db['Attachment'][_0xf2e4('0x48')](_['merge'](_0x1d1ab6,_0x5d666e[_0xf2e4('0x45')]),{'include':_0x5d666e['query'][_0xf2e4('0x3a')]?[{'all':!![]}]:undefined});}})[_0xf2e4('0x21')](respondWithResult(_0x138d02,0xc9))[_0xf2e4('0x3d')](handleError(_0x138d02,null));};exports[_0xf2e4('0x49')]=function(_0x972386,_0x3123ee){if(_0x972386['body']['id']){delete _0x972386[_0xf2e4('0x45')]['id'];}return db['Attachment'][_0xf2e4('0x42')]({'where':{'id':_0x972386[_0xf2e4('0x4a')]['id']}})[_0xf2e4('0x21')](handleEntityNotFound(_0x3123ee,null))[_0xf2e4('0x21')](saveUpdates(_0x972386[_0xf2e4('0x45')],null))[_0xf2e4('0x21')](respondWithResult(_0x3123ee,null))[_0xf2e4('0x3d')](handleError(_0x3123ee,null));};exports[_0xf2e4('0x22')]=function(_0x43406d,_0x1b3f9b){return db[_0xf2e4('0x29')][_0xf2e4('0x42')]({'where':{'id':_0x43406d[_0xf2e4('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1b3f9b,null))[_0xf2e4('0x21')](removeEntity(_0x1b3f9b,null))[_0xf2e4('0x3d')](handleError(_0x1b3f9b,null));};exports[_0xf2e4('0x48')]=function(_0xa7752b,_0x2cd98e,_0x50e647){_0xa7752b[_0xf2e4('0x45')][_0xf2e4('0x25')]=_0xa7752b[_0xf2e4('0x4b')][_0xf2e4('0x4c')];_0xa7752b[_0xf2e4('0x45')][_0xf2e4('0x4d')]=_0xa7752b[_0xf2e4('0x4b')][_0xf2e4('0x4e')];_0xa7752b[_0xf2e4('0x45')]['type']=_0xa7752b[_0xf2e4('0x4b')][_0xf2e4('0x4f')];return db[_0xf2e4('0x29')]['create'](_0xa7752b[_0xf2e4('0x45')])[_0xf2e4('0x21')](respondWithResult(_0x2cd98e,0xc9))[_0xf2e4('0x3d')](handleError(_0x2cd98e,null));};exports[_0xf2e4('0x50')]=function(_0x41d670,_0x57c4ad,_0x4c1c80){return db[_0xf2e4('0x29')][_0xf2e4('0x51')]({'where':{'id':_0x41d670['params']['id']},'raw':!![]})[_0xf2e4('0x21')](handleEntityNotFound(_0x57c4ad,null))[_0xf2e4('0x21')](function(_0x4635f1){if(_0x4635f1){var _0xe8578b=_0x4635f1['ChatOfflineMessageId']!==null;var _0x4d19d4=path[_0xf2e4('0x52')](config[_0xf2e4('0x53')],'server/files/attachments/');if(_0xe8578b){_0x4d19d4=path[_0xf2e4('0x52')](_0x4d19d4,_0xf2e4('0x54'));}var _0x13114d=path['join'](_0x4d19d4,_0x4635f1[_0xf2e4('0x4d')]);return _0x57c4ad[_0xf2e4('0x50')](_0x13114d);}})[_0xf2e4('0x3d')](handleError(_0x57c4ad,null));};
\ No newline at end of file
+var _0x4c55=['include','findAll','catch','show','includeAll','find','clone','omit','updatedAt','body','create','params','file','originalname','basename','filename','mimetype','findOne','ChatOfflineMessageId','join','root','download','zip-dir','request-promise','moment','mustache','path','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','index','Attachment','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','fields','attributes','length','nolimit','sort','where','merge','VIRTUAL','options'];(function(_0x1756fa,_0x3d2edc){var _0x203ac9=function(_0x399fb7){while(--_0x399fb7){_0x1756fa['push'](_0x1756fa['shift']());}};_0x203ac9(++_0x3d2edc);}(_0x4c55,0x1a6));var _0x54c5=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x4c55[_0x3c4737];return _0x2bb926;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x54c5('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x54c5('0x1'));var moment=require(_0x54c5('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x54c5('0x3'));var util=require('util');var path=require(_0x54c5('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x54c5('0x5'));var _=require(_0x54c5('0x6'));var squel=require('squel');var crypto=require(_0x54c5('0x7'));var jsforce=require(_0x54c5('0x8'));var deskjs=require(_0x54c5('0x9'));var toCsv=require(_0x54c5('0xa'));var querystring=require(_0x54c5('0xb'));var Papa=require(_0x54c5('0xc'));var Redis=require(_0x54c5('0xd'));var authService=require(_0x54c5('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x54c5('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x54c5('0x10'))(_0x54c5('0x11'));var utils=require(_0x54c5('0x12'));var config=require(_0x54c5('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x54c5('0x14'))['db'];function respondWithStatusCode(_0x1abfa5,_0xa6647b){_0xa6647b=_0xa6647b||0xcc;return function(_0x5177e1){if(_0x5177e1){return _0x1abfa5[_0x54c5('0x15')](_0xa6647b);}return _0x1abfa5[_0x54c5('0x16')](_0xa6647b)['end']();};}function respondWithResult(_0x1cf61b,_0x41b350){_0x41b350=_0x41b350||0xc8;return function(_0x519730){if(_0x519730){return _0x1cf61b[_0x54c5('0x16')](_0x41b350)['json'](_0x519730);}};}function respondWithFilteredResult(_0x135566,_0xdffd78){return function(_0x1a4bf8){if(_0x1a4bf8){var _0x55b6e4=typeof _0xdffd78[_0x54c5('0x17')]==='undefined'&&typeof _0xdffd78['limit']===_0x54c5('0x18');var _0x29441d=_0x1a4bf8[_0x54c5('0x19')];var _0x47ac2a=_0x55b6e4?0x0:_0xdffd78[_0x54c5('0x17')];var _0x1ea882=_0x55b6e4?_0x1a4bf8[_0x54c5('0x19')]:_0xdffd78['offset']+_0xdffd78[_0x54c5('0x1a')];var _0x5bd358;if(_0x1ea882>=_0x29441d){_0x1ea882=_0x29441d;_0x5bd358=0xc8;}else{_0x5bd358=0xce;}_0x135566[_0x54c5('0x16')](_0x5bd358);return _0x135566[_0x54c5('0x1b')](_0x54c5('0x1c'),_0x47ac2a+'-'+_0x1ea882+'/'+_0x29441d)[_0x54c5('0x1d')](_0x1a4bf8);}return null;};}function patchUpdates(_0x4715a6){return function(_0x197ada){try{jsonpatch[_0x54c5('0x1e')](_0x197ada,_0x4715a6,!![]);}catch(_0x554d16){return BPromise[_0x54c5('0x1f')](_0x554d16);}return _0x197ada[_0x54c5('0x20')]();};}function saveUpdates(_0x1e9411,_0x41f821){return function(_0x340111){if(_0x340111){return _0x340111[_0x54c5('0x21')](_0x1e9411)[_0x54c5('0x22')](function(_0x432301){return _0x432301;});}return null;};}function removeEntity(_0x2f9d34,_0x119aed){return function(_0x1ead5f){if(_0x1ead5f){return _0x1ead5f[_0x54c5('0x23')]()['then'](function(){_0x2f9d34[_0x54c5('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3da963,_0x330194){return function(_0x5f4966){if(!_0x5f4966){_0x3da963['sendStatus'](0x194);}return _0x5f4966;};}function handleError(_0x563f80,_0x40f4ff){_0x40f4ff=_0x40f4ff||0x1f4;return function(_0x1b9b46){logger['error'](_0x1b9b46[_0x54c5('0x24')]);if(_0x1b9b46[_0x54c5('0x25')]){delete _0x1b9b46[_0x54c5('0x25')];}_0x563f80['status'](_0x40f4ff)['send'](_0x1b9b46);};}exports[_0x54c5('0x26')]=function(_0x57461e,_0x39dd5f){var _0x5736ef={},_0x3daff3={},_0x4c50fa={'count':0x0,'rows':[]};var _0xc11201=_['map'](db[_0x54c5('0x27')][_0x54c5('0x28')],function(_0x25ec4a){return{'name':_0x25ec4a[_0x54c5('0x29')],'type':_0x25ec4a[_0x54c5('0x2a')][_0x54c5('0x2b')]};});_0x3daff3['model']=_['map'](_0xc11201,_0x54c5('0x25'));_0x3daff3['query']=_[_0x54c5('0x2c')](_0x57461e['query']);_0x3daff3[_0x54c5('0x2d')]=_[_0x54c5('0x2e')](_0x3daff3[_0x54c5('0x2f')],_0x3daff3[_0x54c5('0x30')]);_0x5736ef['attributes']=_[_0x54c5('0x2e')](_0x3daff3['model'],qs[_0x54c5('0x31')](_0x57461e[_0x54c5('0x30')][_0x54c5('0x31')]));_0x5736ef[_0x54c5('0x32')]=_0x5736ef[_0x54c5('0x32')][_0x54c5('0x33')]?_0x5736ef['attributes']:_0x3daff3['model'];if(!_0x57461e[_0x54c5('0x30')]['hasOwnProperty'](_0x54c5('0x34'))){_0x5736ef[_0x54c5('0x1a')]=qs['limit'](_0x57461e['query'][_0x54c5('0x1a')]);_0x5736ef['offset']=qs[_0x54c5('0x17')](_0x57461e['query'][_0x54c5('0x17')]);}_0x5736ef['order']=qs[_0x54c5('0x35')](_0x57461e[_0x54c5('0x30')][_0x54c5('0x35')]);_0x5736ef[_0x54c5('0x36')]=qs[_0x54c5('0x2d')](_['pick'](_0x57461e[_0x54c5('0x30')],_0x3daff3['filters']),_0xc11201);if(_0x57461e[_0x54c5('0x30')]['filter']){_0x5736ef[_0x54c5('0x36')]=_[_0x54c5('0x37')](_0x5736ef[_0x54c5('0x36')],{'$or':_['map'](_0xc11201,function(_0x554609){if(_0x554609['type']!==_0x54c5('0x38')){var _0x5889a4={};_0x5889a4[_0x554609[_0x54c5('0x25')]]={'$like':'%'+_0x57461e['query']['filter']+'%'};return _0x5889a4;}})});}_0x5736ef=_[_0x54c5('0x37')]({},_0x5736ef,_0x57461e[_0x54c5('0x39')]);var _0x3a7c01={'where':_0x5736ef['where']};return db[_0x54c5('0x27')][_0x54c5('0x19')](_0x3a7c01)[_0x54c5('0x22')](function(_0x3ca41f){_0x4c50fa['count']=_0x3ca41f;if(_0x57461e[_0x54c5('0x30')]['includeAll']){_0x5736ef[_0x54c5('0x3a')]=[{'all':!![]}];}return db['Attachment'][_0x54c5('0x3b')](_0x5736ef);})[_0x54c5('0x22')](function(_0x2d665a){_0x4c50fa['rows']=_0x2d665a;return _0x4c50fa;})[_0x54c5('0x22')](respondWithFilteredResult(_0x39dd5f,_0x5736ef))[_0x54c5('0x3c')](handleError(_0x39dd5f,null));};exports[_0x54c5('0x3d')]=function(_0x136b46,_0x55a6e8){var _0x2a2e05={'raw':!![],'where':{'id':_0x136b46['params']['id']}},_0x4cb290={};_0x4cb290['model']=_[_0x54c5('0x2c')](db[_0x54c5('0x27')][_0x54c5('0x28')]);_0x4cb290[_0x54c5('0x30')]=_[_0x54c5('0x2c')](_0x136b46[_0x54c5('0x30')]);_0x4cb290[_0x54c5('0x2d')]=_['intersection'](_0x4cb290['model'],_0x4cb290[_0x54c5('0x30')]);_0x2a2e05[_0x54c5('0x32')]=_[_0x54c5('0x2e')](_0x4cb290[_0x54c5('0x2f')],qs[_0x54c5('0x31')](_0x136b46[_0x54c5('0x30')][_0x54c5('0x31')]));_0x2a2e05[_0x54c5('0x32')]=_0x2a2e05[_0x54c5('0x32')][_0x54c5('0x33')]?_0x2a2e05[_0x54c5('0x32')]:_0x4cb290[_0x54c5('0x2f')];if(_0x136b46['query'][_0x54c5('0x3e')]){_0x2a2e05[_0x54c5('0x3a')]=[{'all':!![]}];}_0x2a2e05=_[_0x54c5('0x37')]({},_0x2a2e05,_0x136b46[_0x54c5('0x39')]);return db[_0x54c5('0x27')][_0x54c5('0x3f')](_0x2a2e05)[_0x54c5('0x22')](handleEntityNotFound(_0x55a6e8,null))[_0x54c5('0x22')](respondWithResult(_0x55a6e8,null))[_0x54c5('0x3c')](handleError(_0x55a6e8,null));};exports[_0x54c5('0x40')]=function(_0x537ed3,_0x1ef28c){var _0x51d0aa={'where':{'id':_0x537ed3['params']['id']}},_0x557505={};_0x557505[_0x54c5('0x2f')]=_['keys'](db[_0x54c5('0x27')][_0x54c5('0x28')]);_0x51d0aa[_0x54c5('0x32')]=_[_0x54c5('0x2e')](_0x557505['model'],qs[_0x54c5('0x31')](_0x537ed3[_0x54c5('0x30')]['fields']));_0x51d0aa[_0x54c5('0x32')]=_0x51d0aa[_0x54c5('0x32')][_0x54c5('0x33')]?_0x51d0aa['attributes']:_0x557505[_0x54c5('0x2f')];if(_0x537ed3['query'][_0x54c5('0x3e')]){_0x51d0aa[_0x54c5('0x3a')]=[{'all':!![]}];}_0x51d0aa=_['merge']({},_0x51d0aa,_0x537ed3[_0x54c5('0x39')]);return db[_0x54c5('0x27')][_0x54c5('0x3f')](_0x51d0aa)['then'](handleEntityNotFound(_0x1ef28c,null))[_0x54c5('0x22')](function(_0x19411a){if(_0x19411a){var _0x2ded04=_0x19411a['get']({'plain':!![]});_0x2ded04=qs[_0x54c5('0x41')](_0x2ded04,['id','createdAt',_0x54c5('0x42')]);_0x537ed3[_0x54c5('0x43')]=_[_0x54c5('0x41')](_0x537ed3[_0x54c5('0x43')],['id','createdAt',_0x54c5('0x42')]);return db[_0x54c5('0x27')][_0x54c5('0x44')](_[_0x54c5('0x37')](_0x2ded04,_0x537ed3['body']),{'include':_0x537ed3[_0x54c5('0x30')][_0x54c5('0x3e')]?[{'all':!![]}]:undefined});}})[_0x54c5('0x22')](respondWithResult(_0x1ef28c,0xc9))[_0x54c5('0x3c')](handleError(_0x1ef28c,null));};exports['update']=function(_0x49d0d3,_0x41461f){if(_0x49d0d3['body']['id']){delete _0x49d0d3['body']['id'];}return db[_0x54c5('0x27')][_0x54c5('0x3f')]({'where':{'id':_0x49d0d3[_0x54c5('0x45')]['id']}})[_0x54c5('0x22')](handleEntityNotFound(_0x41461f,null))['then'](saveUpdates(_0x49d0d3[_0x54c5('0x43')],null))[_0x54c5('0x22')](respondWithResult(_0x41461f,null))['catch'](handleError(_0x41461f,null));};exports['destroy']=function(_0x57820c,_0x3b2638){return db[_0x54c5('0x27')][_0x54c5('0x3f')]({'where':{'id':_0x57820c[_0x54c5('0x45')]['id']}})['then'](handleEntityNotFound(_0x3b2638,null))['then'](removeEntity(_0x3b2638,null))['catch'](handleError(_0x3b2638,null));};exports['create']=function(_0x147e26,_0x1b4952,_0x16f25f){_0x147e26[_0x54c5('0x43')][_0x54c5('0x25')]=_0x147e26[_0x54c5('0x46')][_0x54c5('0x47')];_0x147e26['body'][_0x54c5('0x48')]=_0x147e26[_0x54c5('0x46')][_0x54c5('0x49')];_0x147e26[_0x54c5('0x43')][_0x54c5('0x2a')]=_0x147e26[_0x54c5('0x46')][_0x54c5('0x4a')];return db[_0x54c5('0x27')][_0x54c5('0x44')](_0x147e26[_0x54c5('0x43')])['then'](respondWithResult(_0x1b4952,0xc9))[_0x54c5('0x3c')](handleError(_0x1b4952,null));};exports['download']=function(_0x1ee5cb,_0x3fa5fa,_0x5a8474){return db[_0x54c5('0x27')][_0x54c5('0x4b')]({'where':{'id':_0x1ee5cb[_0x54c5('0x45')]['id']},'raw':!![]})[_0x54c5('0x22')](handleEntityNotFound(_0x3fa5fa,null))[_0x54c5('0x22')](function(_0x45d71c){if(_0x45d71c){var _0xf77c75=_0x45d71c[_0x54c5('0x4c')]!==null;var _0x2bcb8f=path[_0x54c5('0x4d')](config[_0x54c5('0x4e')],'server/files/attachments/');if(_0xf77c75){_0x2bcb8f=path[_0x54c5('0x4d')](_0x2bcb8f,'offline-chat/');}var _0x2eac3d=path[_0x54c5('0x4d')](_0x2bcb8f,_0x45d71c[_0x54c5('0x48')]);return _0x3fa5fa[_0x54c5('0x4f')](_0x2eac3d);}})[_0x54c5('0x3c')](handleError(_0x3fa5fa,null));};
\ No newline at end of file
index 0cb11e2..d22e205 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe4f2=['define','attachments','lodash','moment','bluebird','request-promise','path','../../config/environment','./attachment.attributes','exports'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xe4f2,0x160));var _0x2e4f=function(_0x350258,_0x4e0a50){_0x350258=_0x350258-0x0;var _0x3714b3=_0xe4f2[_0x350258];return _0x3714b3;};'use strict';var _=require(_0x2e4f('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x2e4f('0x1'));var BPromise=require(_0x2e4f('0x2'));var rp=require(_0x2e4f('0x3'));var fs=require('fs');var path=require(_0x2e4f('0x4'));var rimraf=require('rimraf');var config=require(_0x2e4f('0x5'));var attributes=require(_0x2e4f('0x6'));module[_0x2e4f('0x7')]=function(_0x24619b,_0x480937){return _0x24619b[_0x2e4f('0x8')]('Attachment',attributes,{'tableName':_0x2e4f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a39=['request-promise','path','../../config/environment','define','Attachment','attachments','lodash','util','../../config/logger','api','bluebird'];(function(_0x2c2931,_0x9c847b){var _0x1b78f5=function(_0x8ee54b){while(--_0x8ee54b){_0x2c2931['push'](_0x2c2931['shift']());}};_0x1b78f5(++_0x9c847b);}(_0x7a39,0xe2));var _0x97a3=function(_0x21287b,_0x4cec5c){_0x21287b=_0x21287b-0x0;var _0x34e5c1=_0x7a39[_0x21287b];return _0x34e5c1;};'use strict';var _=require(_0x97a3('0x0'));var util=require(_0x97a3('0x1'));var logger=require(_0x97a3('0x2'))(_0x97a3('0x3'));var moment=require('moment');var BPromise=require(_0x97a3('0x4'));var rp=require(_0x97a3('0x5'));var fs=require('fs');var path=require(_0x97a3('0x6'));var rimraf=require('rimraf');var config=require(_0x97a3('0x7'));var attributes=require('./attachment.attributes');module['exports']=function(_0x165bcb,_0x1856d5){return _0x165bcb[_0x97a3('0x8')](_0x97a3('0x9'),attributes,{'tableName':_0x97a3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ec4e2ad..11dd9c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1339=['request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Attachment','create','options','raw','debug','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x1f62e4,_0x24435f){var _0x50014b=function(_0x1b4685){while(--_0x1b4685){_0x1f62e4['push'](_0x1f62e4['shift']());}};_0x50014b(++_0x24435f);}(_0x1339,0x1ed));var _0x9133=function(_0x9fea5d,_0x4eb69d){_0x9fea5d=_0x9fea5d-0x0;var _0x2c96c9=_0x1339[_0x9fea5d];return _0x2c96c9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9133('0x0'));var BPromise=require(_0x9133('0x1'));var rs=require(_0x9133('0x2'));var fs=require('fs');var Redis=require(_0x9133('0x3'));var db=require(_0x9133('0x4'))['db'];var utils=require(_0x9133('0x5'));var logger=require(_0x9133('0x6'))(_0x9133('0x7'));var config=require('../../config/environment');var jayson=require(_0x9133('0x8'));var client=jayson[_0x9133('0x9')][_0x9133('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x539af6,_0x2758e2,_0x334dcd){return new BPromise(function(_0x3059c4,_0x431a55){return client[_0x9133('0xb')](_0x539af6,_0x334dcd)[_0x9133('0xc')](function(_0x4294b7){logger[_0x9133('0xd')](_0x9133('0xe'),_0x2758e2,_0x9133('0xf'));logger['debug'](_0x9133('0x10'),_0x2758e2,_0x9133('0xf'),JSON[_0x9133('0x11')](_0x4294b7));if(_0x4294b7[_0x9133('0x12')]){if(_0x4294b7[_0x9133('0x12')][_0x9133('0x13')]===0x1f4){logger['error'](_0x9133('0xe'),_0x2758e2,_0x4294b7[_0x9133('0x12')]['message']);return _0x431a55(_0x4294b7['error'][_0x9133('0x14')]);}logger['error'](_0x9133('0xe'),_0x2758e2,_0x4294b7[_0x9133('0x12')][_0x9133('0x14')]);return _0x3059c4(_0x4294b7[_0x9133('0x12')][_0x9133('0x14')]);}else{logger[_0x9133('0xd')]('Attachment,\x20%s,\x20%s',_0x2758e2,_0x9133('0xf'));_0x3059c4(_0x4294b7[_0x9133('0x15')]['message']);}})[_0x9133('0x16')](function(_0xa46eb1){logger[_0x9133('0x12')](_0x9133('0xe'),_0x2758e2,_0xa46eb1);_0x431a55(_0xa46eb1);});});}exports['CreateAttachment']=function(_0x1f3484){var _0x573998=this;return new Promise(function(_0x3c48ef,_0x5d4a77){return db[_0x9133('0x17')][_0x9133('0x18')](_0x1f3484['body'],{'raw':_0x1f3484[_0x9133('0x19')]?_0x1f3484['options'][_0x9133('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x5e4f0c){logger[_0x9133('0xd')]('CreateAttachment',_0x1f3484);logger[_0x9133('0x1b')]('CreateAttachment',_0x1f3484,JSON['stringify'](_0x5e4f0c));_0x3c48ef(_0x5e4f0c);})['catch'](function(_0x2e99a1){logger[_0x9133('0x12')]('CreateAttachment',_0x2e99a1[_0x9133('0x14')],_0x1f3484);_0x5d4a77(_0x573998[_0x9133('0x12')](0x1f4,_0x2e99a1[_0x9133('0x14')]));});});};
\ No newline at end of file
+var _0x7d5a=['http','request','then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','Attachment,\x20%s,\x20%s','message','catch','create','options','CreateAttachment','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client'];(function(_0x5897f4,_0x23e158){var _0x30cb83=function(_0x27bdca){while(--_0x27bdca){_0x5897f4['push'](_0x5897f4['shift']());}};_0x30cb83(++_0x23e158);}(_0x7d5a,0x17b));var _0xa7d5=function(_0x3a45d,_0x4a8189){_0x3a45d=_0x3a45d-0x0;var _0x20082f=_0x7d5a[_0x3a45d];return _0x20082f;};'use strict';var _=require(_0xa7d5('0x0'));var util=require(_0xa7d5('0x1'));var moment=require(_0xa7d5('0x2'));var BPromise=require(_0xa7d5('0x3'));var rs=require(_0xa7d5('0x4'));var fs=require('fs');var Redis=require(_0xa7d5('0x5'));var db=require(_0xa7d5('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa7d5('0x7'));var config=require(_0xa7d5('0x8'));var jayson=require(_0xa7d5('0x9'));var client=jayson[_0xa7d5('0xa')][_0xa7d5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x80431a,_0x5a8f8a,_0x21ccfa){return new BPromise(function(_0xb5bcd2,_0x2c2c25){return client[_0xa7d5('0xc')](_0x80431a,_0x21ccfa)[_0xa7d5('0xd')](function(_0xf40c67){logger[_0xa7d5('0xe')]('Attachment,\x20%s,\x20%s',_0x5a8f8a,_0xa7d5('0xf'));logger[_0xa7d5('0x10')](_0xa7d5('0x11'),_0x5a8f8a,'request\x20sent',JSON[_0xa7d5('0x12')](_0xf40c67));if(_0xf40c67[_0xa7d5('0x13')]){if(_0xf40c67[_0xa7d5('0x13')]['code']===0x1f4){logger[_0xa7d5('0x13')](_0xa7d5('0x14'),_0x5a8f8a,_0xf40c67[_0xa7d5('0x13')][_0xa7d5('0x15')]);return _0x2c2c25(_0xf40c67[_0xa7d5('0x13')]['message']);}logger[_0xa7d5('0x13')](_0xa7d5('0x14'),_0x5a8f8a,_0xf40c67[_0xa7d5('0x13')][_0xa7d5('0x15')]);return _0xb5bcd2(_0xf40c67[_0xa7d5('0x13')]['message']);}else{logger[_0xa7d5('0xe')](_0xa7d5('0x14'),_0x5a8f8a,_0xa7d5('0xf'));_0xb5bcd2(_0xf40c67['result']['message']);}})[_0xa7d5('0x16')](function(_0x53d884){logger[_0xa7d5('0x13')](_0xa7d5('0x14'),_0x5a8f8a,_0x53d884);_0x2c2c25(_0x53d884);});});}exports['CreateAttachment']=function(_0x2c1383){var _0x1237fb=this;return new Promise(function(_0x2093e0,_0x4aad8c){return db['Attachment'][_0xa7d5('0x17')](_0x2c1383['body'],{'raw':_0x2c1383[_0xa7d5('0x18')]?_0x2c1383['options']['raw']===undefined?!![]:![]:!![]})[_0xa7d5('0xd')](function(_0x123241){logger[_0xa7d5('0xe')](_0xa7d5('0x19'),_0x2c1383);logger[_0xa7d5('0x10')](_0xa7d5('0x19'),_0x2c1383,JSON['stringify'](_0x123241));_0x2093e0(_0x123241);})[_0xa7d5('0x16')](function(_0x3cabaf){logger[_0xa7d5('0x13')](_0xa7d5('0x19'),_0x3cabaf[_0xa7d5('0x15')],_0x2c1383);_0x4aad8c(_0x1237fb['error'](0x1f4,_0x3cabaf[_0xa7d5('0x15')]));});});};
\ No newline at end of file
index 4c2768e..84dfe75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x5f66[_0x4c12ec];return _0x3ae42c;};'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('./attachment.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['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router;
\ No newline at end of file
+var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x253198,_0x344544){var _0x5ea015=function(_0x37f592){while(--_0x37f592){_0x253198['push'](_0x253198['shift']());}};_0x5ea015(++_0x344544);}(_0xadb5,0xad));var _0x5adb=function(_0x17fbdf,_0x11cbad){_0x17fbdf=_0x17fbdf-0x0;var _0x6a1fe4=_0xadb5[_0x17fbdf];return _0x6a1fe4;};'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('./attachment.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('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router;
\ No newline at end of file
index 069bfeb..879aded 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7b2=['send','message','login','authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','use','User','passport','Strategy','moment','activedirectory2','bluebird','util','../../components/auth/service','../../config/environment','../../config/logger','api','activedirectory','url','domain','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','role','disabled','blocked','blockedAt','admin','user','then','add','minutes','clearBlockUser','getLicense','catch','status'];(function(_0xb50b2d,_0x359b53){var _0x2ec151=function(_0x450964){while(--_0x450964){_0xb50b2d['push'](_0xb50b2d['shift']());}};_0x2ec151(++_0x359b53);}(_0xd7b2,0x1af));var _0x2d7b=function(_0x393b7a,_0x2b3be7){_0x393b7a=_0x393b7a-0x0;var _0x184b50=_0xd7b2[_0x393b7a];return _0x184b50;};'use strict';var passport=require(_0x2d7b('0x0'));var LocalStrategy=require('passport-local')[_0x2d7b('0x1')];var moment=require(_0x2d7b('0x2'));var ActiveDirectory=require(_0x2d7b('0x3'));var BPromise=require(_0x2d7b('0x4'));var util=require(_0x2d7b('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0x2d7b('0x6'));var utils=require('../../config/utils');var config=require(_0x2d7b('0x7'));var logger=require(_0x2d7b('0x8'))(_0x2d7b('0x9'));function isActiveDirectoryConfigured(_0x4339b9){var _0x5a31e4=![];if(typeof _0x4339b9[_0x2d7b('0xa')]!=='undefined'){_0x5a31e4=_0x4339b9[_0x2d7b('0xa')]['baseDN']&&_0x4339b9[_0x2d7b('0xa')][_0x2d7b('0xb')]&&_0x4339b9[_0x2d7b('0xa')][_0x2d7b('0xc')];}return _0x5a31e4;}function adAuthenticate(_0x53278d,_0x319ac6,_0xb4cff0){return new BPromise(function(_0x24e6a6,_0x3d5403){try{var _0x358e1d=new ActiveDirectory(_0x53278d);_0x358e1d['authenticate'](_0x319ac6,_0xb4cff0,function(_0x3f7324,_0x1c1690){if(_0x3f7324){logger[_0x2d7b('0xd')](_0x2d7b('0xe'),_0x319ac6,util[_0x2d7b('0xf')](_0x3f7324,{'showHidden':![],'depth':null}));_0x3d5403(_0x2d7b('0x10'));}else if(!_0x1c1690){logger[_0x2d7b('0xd')](_0x2d7b('0x11'),_0x319ac6);_0x3d5403('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x24e6a6(_0x1c1690);}});}catch(_0x2f8ba6){_0x3d5403(_0x2f8ba6);}});}function ActiveDirectoryAuthenticate(_0x34778b,_0x5aacf9,_0x4b07e8,_0x6dc534){var _0x1b607a,_0x5bdee7;if(!isActiveDirectoryConfigured(config)){logger[_0x2d7b('0xd')](_0x2d7b('0x12'),_0x5aacf9);return _0x6dc534(null,![],{'message':_0x2d7b('0x10')});}return db[_0x2d7b('0x13')][_0x2d7b('0x14')]({'where':{'id':0x1},'attributes':[_0x2d7b('0x15'),_0x2d7b('0x16')],'raw':!![]})['then'](function(_0x2e9c5c){_0x1b607a=_0x2e9c5c;if(!_0x1b607a['adSsoEnabled']){logger[_0x2d7b('0xd')](_0x2d7b('0x17'),_0x5aacf9);throw new Error(_0x2d7b('0x10'));}return _0x34778b[_0x2d7b('0x14')]({'logging':!![],'attributes':['id',_0x2d7b('0x18'),_0x2d7b('0x19'),'salt',_0x2d7b('0x1a'),_0x2d7b('0x1b'),_0x2d7b('0x1c'),_0x2d7b('0x1d'),'online'],'where':{'name':_0x5aacf9,'role':{'$or':[_0x2d7b('0x1e'),_0x2d7b('0x1f'),'agent']},'adSsoEnabled':!![]}});})[_0x2d7b('0x20')](function(_0x4b789f){if(!_0x4b789f||_0x4b789f&&_0x4b789f[_0x2d7b('0x18')]!==_0x5aacf9){throw new Error(_0x2d7b('0x10'));}_0x5bdee7=_0x4b789f;var _0x557335=_0x5bdee7[_0x2d7b('0x18')]+'@'+config[_0x2d7b('0xa')][_0x2d7b('0xc')];return adAuthenticate(config['activedirectory'],_0x557335,_0x4b07e8);})[_0x2d7b('0x20')](function(_0x7174a2){if(_0x5bdee7[_0x2d7b('0x1b')]){throw new Error(_0x2d7b('0x10'));}if(_0x1b607a[_0x2d7b('0x16')]>0x0){if(_0x5bdee7[_0x2d7b('0x1c')]){if(moment(_0x5bdee7[_0x2d7b('0x1d')])[_0x2d7b('0x21')](_0x1b607a[_0x2d7b('0x16')],_0x2d7b('0x22'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x2d7b('0x23')](_0x5bdee7,0x0,![],null)['then'](function(){return utils[_0x2d7b('0x24')](_0x5bdee7);})['then'](function(){return _0x6dc534(null,_0x5bdee7);});}else{return utils[_0x2d7b('0x24')](_0x5bdee7)[_0x2d7b('0x20')](function(){return _0x6dc534(null,_0x5bdee7);});}}else{return utils[_0x2d7b('0x24')](_0x5bdee7)[_0x2d7b('0x20')](function(){return _0x6dc534(null,_0x5bdee7);});}})[_0x2d7b('0x25')](function(_0x1f88fd){return _0x6dc534(null,![],_0x1f88fd);});}function handleError(_0x4e0357,_0x3977fd,_0xa1c128){return _0x4e0357[_0x2d7b('0x26')](_0x3977fd||0x1f4)[_0x2d7b('0x27')]({'message':_0xa1c128?_0xa1c128[_0x2d7b('0x28')]||_0xa1c128:''});}exports[_0x2d7b('0x29')]=function(_0x10ff25,_0x2976e4,_0x3e682e){passport[_0x2d7b('0x2a')]('ad-login',function(_0x3d6e2c,_0x28f72f,_0x56a764){var _0xc88d85=_0x3d6e2c||_0x56a764;if(_0xc88d85){return handleError(_0x2976e4,0x191,_0xc88d85);}if(!_0x28f72f){return handleError(_0x2976e4,0x194,{'message':_0x2d7b('0x2b')});}else{var _0x216245={'payload':{'id':_0x28f72f['id'],'role':_0x28f72f[_0x2d7b('0x1a')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x216245)['then'](function(_0x36712){_0x2976e4[_0x2d7b('0x2c')]({'id':_0x28f72f['id'],'token':_0x36712,'statusCall':'','isAlreadyLogged':_0x28f72f['online']});});}})(_0x10ff25,_0x2976e4,_0x3e682e);};passport[_0x2d7b('0x2d')]('ad-login',new LocalStrategy({'usernameField':'name','passwordField':_0x2d7b('0x19')},function(_0x1df444,_0x151a33,_0x2f5987){return ActiveDirectoryAuthenticate(db[_0x2d7b('0x2e')],_0x1df444,_0x151a33,_0x2f5987);}));
\ No newline at end of file
+var _0x87f3=['util','../../mysqldb','../../components/auth/service','../../config/environment','../../config/logger','api','undefined','baseDN','activedirectory','url','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','salt','role','disabled','blocked','blockedAt','online','user','domain','add','minutes','clearBlockUser','getLicense','catch','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','use','password','User','passport','passport-local','Strategy','activedirectory2','bluebird'];(function(_0x3430a0,_0x1c74d1){var _0x56b223=function(_0x10c371){while(--_0x10c371){_0x3430a0['push'](_0x3430a0['shift']());}};_0x56b223(++_0x1c74d1);}(_0x87f3,0x1ef));var _0x387f=function(_0x513047,_0x2199c5){_0x513047=_0x513047-0x0;var _0x15b779=_0x87f3[_0x513047];return _0x15b779;};'use strict';var passport=require(_0x387f('0x0'));var LocalStrategy=require(_0x387f('0x1'))[_0x387f('0x2')];var moment=require('moment');var ActiveDirectory=require(_0x387f('0x3'));var BPromise=require(_0x387f('0x4'));var util=require(_0x387f('0x5'));var db=require(_0x387f('0x6'))['db'];var authService=require(_0x387f('0x7'));var utils=require('../../config/utils');var config=require(_0x387f('0x8'));var logger=require(_0x387f('0x9'))(_0x387f('0xa'));function isActiveDirectoryConfigured(_0x27cd70){var _0x50c75e=![];if(typeof _0x27cd70['activedirectory']!==_0x387f('0xb')){_0x50c75e=_0x27cd70['activedirectory'][_0x387f('0xc')]&&_0x27cd70[_0x387f('0xd')][_0x387f('0xe')]&&_0x27cd70['activedirectory']['domain'];}return _0x50c75e;}function adAuthenticate(_0x37896a,_0x595c0d,_0x521ffc){return new BPromise(function(_0x305c2e,_0x479679){try{var _0x50ae3b=new ActiveDirectory(_0x37896a);_0x50ae3b[_0x387f('0xf')](_0x595c0d,_0x521ffc,function(_0x1154b0,_0x2dc3b3){if(_0x1154b0){logger[_0x387f('0x10')](_0x387f('0x11'),_0x595c0d,util[_0x387f('0x12')](_0x1154b0,{'showHidden':![],'depth':null}));_0x479679('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x2dc3b3){logger[_0x387f('0x10')](_0x387f('0x13'),_0x595c0d);_0x479679('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x305c2e(_0x2dc3b3);}});}catch(_0x429e71){_0x479679(_0x429e71);}});}function ActiveDirectoryAuthenticate(_0x94f7aa,_0x3deacb,_0xef6540,_0x5c7a0d){var _0x3fb885,_0x5403dc;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x387f('0x14'),_0x3deacb);return _0x5c7a0d(null,![],{'message':_0x387f('0x15')});}return db['Setting'][_0x387f('0x16')]({'where':{'id':0x1},'attributes':[_0x387f('0x17'),_0x387f('0x18')],'raw':!![]})[_0x387f('0x19')](function(_0x5a36f8){_0x3fb885=_0x5a36f8;if(!_0x3fb885[_0x387f('0x17')]){logger[_0x387f('0x10')](_0x387f('0x1a'),_0x3deacb);throw new Error(_0x387f('0x15'));}return _0x94f7aa['findOne']({'logging':!![],'attributes':['id',_0x387f('0x1b'),'password',_0x387f('0x1c'),_0x387f('0x1d'),_0x387f('0x1e'),_0x387f('0x1f'),_0x387f('0x20'),_0x387f('0x21')],'where':{'name':_0x3deacb,'role':{'$or':['admin',_0x387f('0x22'),'agent']},'adSsoEnabled':!![]}});})['then'](function(_0x43c9de){if(!_0x43c9de||_0x43c9de&&_0x43c9de['name']!==_0x3deacb){throw new Error(_0x387f('0x15'));}_0x5403dc=_0x43c9de;var _0x353791=_0x5403dc['name']+'@'+config['activedirectory'][_0x387f('0x23')];return adAuthenticate(config[_0x387f('0xd')],_0x353791,_0xef6540);})[_0x387f('0x19')](function(_0x35ca3c){if(_0x5403dc[_0x387f('0x1e')]){throw new Error(_0x387f('0x15'));}if(_0x3fb885[_0x387f('0x18')]>0x0){if(_0x5403dc['blocked']){if(moment(_0x5403dc[_0x387f('0x20')])[_0x387f('0x24')](_0x3fb885[_0x387f('0x18')],_0x387f('0x25'))>moment()){throw new Error(_0x387f('0x15'));}return utils[_0x387f('0x26')](_0x5403dc,0x0,![],null)[_0x387f('0x19')](function(){return utils[_0x387f('0x27')](_0x5403dc);})[_0x387f('0x19')](function(){return _0x5c7a0d(null,_0x5403dc);});}else{return utils[_0x387f('0x27')](_0x5403dc)[_0x387f('0x19')](function(){return _0x5c7a0d(null,_0x5403dc);});}}else{return utils[_0x387f('0x27')](_0x5403dc)[_0x387f('0x19')](function(){return _0x5c7a0d(null,_0x5403dc);});}})[_0x387f('0x28')](function(_0x2394ed){return _0x5c7a0d(null,![],_0x2394ed);});}function handleError(_0x9ea123,_0x4ece5c,_0x504966){return _0x9ea123['status'](_0x4ece5c||0x1f4)[_0x387f('0x29')]({'message':_0x504966?_0x504966[_0x387f('0x2a')]||_0x504966:''});}exports[_0x387f('0x2b')]=function(_0x5aa356,_0x2ed950,_0x2fbcb4){passport[_0x387f('0xf')](_0x387f('0x2c'),function(_0x40c7ac,_0x93fe6f,_0x1223ea){var _0x53f930=_0x40c7ac||_0x1223ea;if(_0x53f930){return handleError(_0x2ed950,0x191,_0x53f930);}if(!_0x93fe6f){return handleError(_0x2ed950,0x194,{'message':_0x387f('0x2d')});}else{var _0x4329a2={'payload':{'id':_0x93fe6f['id'],'role':_0x93fe6f[_0x387f('0x1d')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x4329a2)[_0x387f('0x19')](function(_0x2959d7){_0x2ed950[_0x387f('0x2e')]({'id':_0x93fe6f['id'],'token':_0x2959d7,'statusCall':'','isAlreadyLogged':_0x93fe6f[_0x387f('0x21')]});});}})(_0x5aa356,_0x2ed950,_0x2fbcb4);};passport[_0x387f('0x2f')](_0x387f('0x2c'),new LocalStrategy({'usernameField':_0x387f('0x1b'),'passwordField':_0x387f('0x30')},function(_0x19f57c,_0xdddffc,_0x4a10be){return ActiveDirectoryAuthenticate(db[_0x387f('0x31')],_0x19f57c,_0xdddffc,_0x4a10be);}));
\ No newline at end of file
index d18ed5f..7a4d582 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x167d=['./authActiveDirectory.controller','post','login','exports'];(function(_0x3622e0,_0x225a6d){var _0x4613dd=function(_0x25e3ab){while(--_0x25e3ab){_0x3622e0['push'](_0x3622e0['shift']());}};_0x4613dd(++_0x225a6d);}(_0x167d,0xfc));var _0xd167=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x167d[_0x321bb2];return _0x9c12ed;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0xd167('0x0'));router[_0xd167('0x1')]('/',controller[_0xd167('0x2')]);module[_0xd167('0x3')]=router;
\ No newline at end of file
+var _0x7f19=['login','express','Router'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x7f19,0xd9));var _0x97f1=function(_0x2d1570,_0x5c24fd){_0x2d1570=_0x2d1570-0x0;var _0x2d6e76=_0x7f19[_0x2d1570];return _0x2d6e76;};'use strict';var express=require(_0x97f1('0x0'));var router=express[_0x97f1('0x1')]();var controller=require('./authActiveDirectory.controller');router['post']('/',controller[_0x97f1('0x2')]);module['exports']=router;
\ No newline at end of file
index 15b2713..f651dcc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x1df6f2,_0x10e25f){var _0x5b571e=function(_0x304bc1){while(--_0x304bc1){_0x1df6f2['push'](_0x1df6f2['shift']());}};_0x5b571e(++_0x10e25f);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
+var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x9ad4a,_0x1dfb41){var _0x3c6eb6=function(_0x55348b){while(--_0x55348b){_0x9ad4a['push'](_0x9ad4a['shift']());}};_0x3c6eb6(++_0x1dfb41);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
index 2a463a5..0730a1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3051=['isMiddleware','setTokenCookie','exports','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x3051,0x85));var _0x1305=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3051[_0x20a584];return _0x4b41a8;};'use strict';var express=require('express');var passport=require('passport');var router=express['Router']();var controller=require(_0x1305('0x0'));var userController=require(_0x1305('0x1'));var authService=require(_0x1305('0x2'));router[_0x1305('0x3')]('/',controller[_0x1305('0x4')]);router['get'](_0x1305('0x5'),controller[_0x1305('0x6')],authService[_0x1305('0x7')],userController[_0x1305('0x4')],authService[_0x1305('0x8')]);module[_0x1305('0x9')]=router;
\ No newline at end of file
+var _0x30a9=['./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','/callback','callback','isMiddleware','login','setTokenCookie','exports','passport','Router'];(function(_0x2dc343,_0xf015a2){var _0x51eac5=function(_0x1adfef){while(--_0x1adfef){_0x2dc343['push'](_0x2dc343['shift']());}};_0x51eac5(++_0xf015a2);}(_0x30a9,0x82));var _0x930a=function(_0xf39853,_0x520ded){_0xf39853=_0xf39853-0x0;var _0x3bc175=_0x30a9[_0xf39853];return _0x3bc175;};'use strict';var express=require('express');var passport=require(_0x930a('0x0'));var router=express[_0x930a('0x1')]();var controller=require(_0x930a('0x2'));var userController=require(_0x930a('0x3'));var authService=require(_0x930a('0x4'));router[_0x930a('0x5')]('/',controller['login']);router[_0x930a('0x5')](_0x930a('0x6'),controller[_0x930a('0x7')],authService[_0x930a('0x8')],userController[_0x930a('0x9')],authService[_0x930a('0xa')]);module[_0x930a('0xb')]=router;
\ No newline at end of file
index de20347..71098d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb3b=['name','salt','role','disabled','blockedAt','loginAttempts','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','minutes','clearBlockUser','blocked','add','getLicense','catch','MailAccount','find','email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','Smtp','port','secure','auth','pass','merge','\x22%s\x22\x20<%s>','SendMail','format','error','message','stringify','status','send','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','generate','body','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','previousPasswords','resetPasswordToken','Password\x20reset!','use','util','passport','passport-local','Strategy','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','Setting','findOne','allowedLoginAttempts','blockDuration','then'];(function(_0x568fda,_0x2e7668){var _0x4ad1a1=function(_0x1134ab){while(--_0x1134ab){_0x568fda['push'](_0x568fda['shift']());}};_0x4ad1a1(++_0x2e7668);}(_0xeb3b,0x150));var _0xbeb3=function(_0x46b1c9,_0x169f87){_0x46b1c9=_0x46b1c9-0x0;var _0x17569c=_0xeb3b[_0x46b1c9];return _0x17569c;};'use strict';var util=require(_0xbeb3('0x0'));var passport=require(_0xbeb3('0x1'));var LocalStrategy=require(_0xbeb3('0x2'))[_0xbeb3('0x3')];var jayson=require('jayson/promise');var _=require(_0xbeb3('0x4'));var rs=require(_0xbeb3('0x5'));var moment=require(_0xbeb3('0x6'));var db=require(_0xbeb3('0x7'))['db'];var authService=require(_0xbeb3('0x8'));var utils=require(_0xbeb3('0x9'));var client=jayson[_0xbeb3('0xa')]['http']({'port':0x232b});function localAuthenticate(_0x2e3d2f,_0x5bb3d0,_0x4d4d6b,_0x4be616){var _0x337937,_0x281d65;return db[_0xbeb3('0xb')][_0xbeb3('0xc')]({'where':{'id':0x1},'attributes':[_0xbeb3('0xd'),_0xbeb3('0xe')],'raw':!![]})[_0xbeb3('0xf')](function(_0x153613){_0x337937=_0x153613;return _0x2e3d2f[_0xbeb3('0xc')]({'attributes':['id',_0xbeb3('0x10'),'password',_0xbeb3('0x11'),_0xbeb3('0x12'),_0xbeb3('0x13'),'blocked',_0xbeb3('0x14'),_0xbeb3('0x15')],'where':{'name':_0x5bb3d0,'role':{'$or':[_0xbeb3('0x16'),_0xbeb3('0x17'),'agent']}}});})[_0xbeb3('0xf')](function(_0x1069c0){if(!_0x1069c0||_0x1069c0&&_0x1069c0[_0xbeb3('0x10')]!==_0x5bb3d0){throw new Error(_0xbeb3('0x18'));}else{_0x281d65=_0x1069c0;return _0x281d65;}})[_0xbeb3('0xf')](function(){_0x281d65['authenticate'](_0x4d4d6b,function(_0xc97521,_0x49a973){var _0x217e06=_0x281d65[_0xbeb3('0x15')]+0x1;if(_0xc97521){return _0x4be616(_0xc97521);}else if(!_0x49a973){if(_0x281d65['disabled']){return _0x4be616(null,![],{'message':_0xbeb3('0x18')});}else if(_0x337937[_0xbeb3('0xd')]>0x0){if(_0x281d65['blocked']){if(_0x337937[_0xbeb3('0xe')]>0x0){if(moment(_0x281d65[_0xbeb3('0x14')])['add'](_0x337937[_0xbeb3('0xe')],_0xbeb3('0x19'))>moment()){return _0x4be616(null,![],{'message':_0xbeb3('0x18')});}else{return utils[_0xbeb3('0x1a')](_0x281d65,_0x217e06,![],null)[_0xbeb3('0xf')](function(){return _0x4be616(null,![],{'message':_0xbeb3('0x18')});});}}else{return _0x4be616(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x217e06>=_0x337937[_0xbeb3('0xd')]){return utils[_0xbeb3('0x1a')](_0x281d65,0x0,!![],moment())[_0xbeb3('0xf')](function(){return _0x4be616(null,![],{'message':_0xbeb3('0x18')});});}else{return utils[_0xbeb3('0x1a')](_0x281d65,_0x217e06,![],null)['then'](function(){return _0x4be616(null,![],{'message':_0xbeb3('0x18')});});}}}else{return _0x4be616(null,![],{'message':_0xbeb3('0x18')});}}else{if(_0x281d65[_0xbeb3('0x13')]){return _0x4be616(null,![],{'message':_0xbeb3('0x18')});}else if(_0x337937[_0xbeb3('0xd')]>0x0){if(_0x281d65[_0xbeb3('0x1b')]){if(_0x337937['blockDuration']>0x0){if(moment(_0x281d65['blockedAt'])[_0xbeb3('0x1c')](_0x337937[_0xbeb3('0xe')],_0xbeb3('0x19'))>moment()){return _0x4be616(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xbeb3('0x1a')](_0x281d65,0x0,![],null)['then'](function(){return utils[_0xbeb3('0x1d')](_0x281d65);})[_0xbeb3('0xf')](function(){return _0x4be616(null,_0x281d65);});}}else{return _0x4be616(null,![],{'message':_0xbeb3('0x18')});}}else{return utils[_0xbeb3('0x1a')](_0x281d65,0x0,![],null)['then'](function(){return utils[_0xbeb3('0x1d')](_0x281d65);})[_0xbeb3('0xf')](function(){return _0x4be616(null,_0x281d65);})[_0xbeb3('0x1e')](function(_0x52de5d){return _0x4be616(null,![],_0x52de5d);});}}else{if(_0x281d65[_0xbeb3('0x1b')]){return _0x4be616(null,![],{'message':_0xbeb3('0x18')});}else{return utils[_0xbeb3('0x1d')](_0x281d65)[_0xbeb3('0xf')](function(){return _0x4be616(null,_0x281d65);});}}}});})['catch'](function(_0x57f2d0){return _0x4be616(null,![],_0x57f2d0);});}function sendServiceMail(_0x131e45){return db[_0xbeb3('0x1f')][_0xbeb3('0x20')]({'where':{'service':!![]},'attributes':['id',_0xbeb3('0x10'),_0xbeb3('0x21')],'include':[{'model':db[_0xbeb3('0x22')],'as':'Smtp'}]})[_0xbeb3('0xf')](function(_0x347e78){if(!_0x347e78){throw new Error(_0xbeb3('0x23'));}var _0x1bdcd5={'tls':{'rejectUnauthorized':![]}};if(_0x347e78['Smtp']['service']){_0x1bdcd5[_0xbeb3('0x24')]=_0x347e78['Smtp'][_0xbeb3('0x24')];}else{_0x1bdcd5[_0xbeb3('0x25')]=_0x347e78[_0xbeb3('0x26')][_0xbeb3('0x25')];_0x1bdcd5[_0xbeb3('0x27')]=_0x347e78[_0xbeb3('0x26')]['port'];_0x1bdcd5[_0xbeb3('0x28')]=_0x347e78['Smtp']['secure'];}if(_0x347e78['Smtp']['authentication']){_0x1bdcd5[_0xbeb3('0x29')]={'user':_0x347e78[_0xbeb3('0x26')]['user'],'pass':_0x347e78[_0xbeb3('0x26')][_0xbeb3('0x2a')]};}var _0x1c26da={'account':_0x1bdcd5,'message':_[_0xbeb3('0x2b')]({'from':util['format'](_0xbeb3('0x2c'),_0x347e78['name'],_0x347e78[_0xbeb3('0x21')]||_0x347e78[_0xbeb3('0x26')][_0xbeb3('0x17')])},_0x131e45)};return client['request'](_0xbeb3('0x2d'),_0x1c26da);})[_0xbeb3('0xf')](function(_0x4b6629){if(_0x4b6629['error']){throw new Error(util[_0xbeb3('0x2e')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x4b6629[_0xbeb3('0x2f')][_0xbeb3('0x30')]||JSON[_0xbeb3('0x31')](_0x4b6629[_0xbeb3('0x2f')])));}return!![];});}function handleError(_0x38ea2a,_0x347d7b,_0xadac86){return _0x38ea2a[_0xbeb3('0x32')](_0x347d7b||0x1f4)[_0xbeb3('0x33')]({'message':_0xadac86?_0xadac86[_0xbeb3('0x30')]||_0xadac86:''});}exports[_0xbeb3('0x34')]=function(_0xdebcdf,_0x19cd98,_0x1c388b){passport[_0xbeb3('0x35')](_0xbeb3('0x36'),function(_0xbceef4,_0x1d801b,_0x48277f){var _0x5d9293=_0xbceef4||_0x48277f;if(_0x5d9293){return handleError(_0x19cd98,0x191,_0x5d9293);}if(!_0x1d801b){return handleError(_0x19cd98,0x194,{'message':_0xbeb3('0x37')});}else{var _0x53f1f9={'payload':{'id':_0x1d801b['id'],'role':_0x1d801b['role']},'options':{'expiresIn':0x15180}};return authService[_0xbeb3('0x38')](_0x53f1f9)[_0xbeb3('0xf')](function(_0x8b164a){_0x19cd98[_0xbeb3('0x39')]({'id':_0x1d801b['id'],'token':_0x8b164a,'statusCall':'','isAlreadyLogged':_0x1d801b[_0xbeb3('0x3a')]});});}})(_0xdebcdf,_0x19cd98,_0x1c388b);};exports[_0xbeb3('0x3b')]=function(_0x3ae003,_0x3867fd,_0x4442c1){if(!_0x3ae003['body']['email']){return handleError(_0x3867fd,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x273a6e=rs[_0xbeb3('0x3c')]();_0x3ae003[_0xbeb3('0x3d')][_0xbeb3('0x21')]=_0x3ae003[_0xbeb3('0x3d')][_0xbeb3('0x21')][_0xbeb3('0x3e')]()[_0xbeb3('0x3f')]();var _0x585981;return db[_0xbeb3('0xb')]['findOne']({'where':{'id':0x1},'attributes':[_0xbeb3('0xd'),'blockDuration'],'raw':!![]})[_0xbeb3('0xf')](function(_0x591157){_0x585981=_0x591157;return db[_0xbeb3('0x40')]['find']({'where':{'email':_0x3ae003[_0xbeb3('0x3d')]['email']}});})[_0xbeb3('0xf')](function(_0x451ecc){if(!_0x451ecc){throw new Error(_0xbeb3('0x41'));}if(_0x451ecc[_0xbeb3('0x13')]){throw new Error(_0xbeb3('0x42'));}if(_0x451ecc[_0xbeb3('0x1b')]){if(moment(_0x451ecc[_0xbeb3('0x14')])[_0xbeb3('0x1c')](_0x585981[_0xbeb3('0xe')],_0xbeb3('0x19'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x451ecc[_0xbeb3('0x1b')]=![];_0x451ecc['blockedAt']=null;}}_0x451ecc['resetPasswordToken']=_0x273a6e;_0x451ecc[_0xbeb3('0x43')]=Date[_0xbeb3('0x44')]()+0x36ee80;return _0x451ecc[_0xbeb3('0x45')]();})['then'](function(){return sendServiceMail({'to':_0x3ae003[_0xbeb3('0x3d')][_0xbeb3('0x21')],'subject':_0xbeb3('0x46'),'text':_0xbeb3('0x47')+_0xbeb3('0x48')+_0xbeb3('0x49')+_0x3ae003[_0xbeb3('0x4a')][_0xbeb3('0x25')]+'/reset/'+_0x273a6e+'\x0a\x0a'+_0xbeb3('0x4b')});})[_0xbeb3('0xf')](function(){_0x3867fd[_0xbeb3('0x32')](0xc8)['send']({'message':_0xbeb3('0x4c')});})['catch'](function(_0x3f837e){return handleError(_0x3867fd,0x1f4,_0x3f837e);});};exports['reset']=function(_0xb60a23,_0x577b83,_0x3c599c){return db[_0xbeb3('0x40')][_0xbeb3('0x20')]({'where':{'resetPasswordToken':_0xb60a23[_0xbeb3('0x4d')][_0xbeb3('0x4e')],'resetPasswordExpires':{'$gt':Date[_0xbeb3('0x44')]()}}})[_0xbeb3('0xf')](function(_0x1dc70f){if(!_0x1dc70f){throw new Error(_0xbeb3('0x4f'));}return db['Setting'][_0xbeb3('0xc')]({'attributes':['id','securePassword',_0xbeb3('0x50'),_0xbeb3('0x51')]})[_0xbeb3('0xf')](function(_0x3ee3c2){if(_0x3ee3c2['securePassword'])authService[_0xbeb3('0x52')](_0xb60a23[_0xbeb3('0x3d')][_0xbeb3('0x53')]);if(!_0x3ee3c2[_0xbeb3('0x50')]||!_0x1dc70f[_0xbeb3('0x54')])return _0x1dc70f;authService['validatePasswordHistory'](_0xb60a23[_0xbeb3('0x3d')]['password'],_0x1dc70f[_0xbeb3('0x54')],_0x3ee3c2[_0xbeb3('0x51')]);return _0x1dc70f;})['then'](function(){_0x1dc70f[_0xbeb3('0x53')]=_0xb60a23[_0xbeb3('0x3d')][_0xbeb3('0x53')];_0x1dc70f[_0xbeb3('0x55')]=null;_0x1dc70f[_0xbeb3('0x43')]=null;return _0x1dc70f[_0xbeb3('0x45')]();});})[_0xbeb3('0xf')](function(){_0x577b83[_0xbeb3('0x32')](0xc8)[_0xbeb3('0x33')]({'message':_0xbeb3('0x56')});})['catch'](function(_0x41c179){return handleError(_0x577b83,0x1f4,_0x41c179);});};passport[_0xbeb3('0x57')]('local-login',new LocalStrategy({'usernameField':_0xbeb3('0x10'),'passwordField':_0xbeb3('0x53')},function(_0x55371a,_0x94daa5,_0x3f4fc2){return localAuthenticate(db[_0xbeb3('0x40')],_0x55371a,_0x94daa5,_0x3f4fc2);}));
\ No newline at end of file
+var _0x6f68=['params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','validatePasswordHistory','previousPasswords','use','util','passport','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','allowedLoginAttempts','blockDuration','then','findOne','name','password','role','disabled','blocked','blockedAt','loginAttempts','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','Smtp','host','port','secure','authentication','auth','pass','merge','format','request','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','forgot','Email\x20parameter\x20is\x20missing','generate','body','trim','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','Reset\x20Email\x20sent!','reset','User'];(function(_0x443cb1,_0x47db0b){var _0x2d21a3=function(_0x2d04a9){while(--_0x2d04a9){_0x443cb1['push'](_0x443cb1['shift']());}};_0x2d21a3(++_0x47db0b);}(_0x6f68,0x1bd));var _0x86f6=function(_0x2bd8cc,_0x13d352){_0x2bd8cc=_0x2bd8cc-0x0;var _0x43e411=_0x6f68[_0x2bd8cc];return _0x43e411;};'use strict';var util=require(_0x86f6('0x0'));var passport=require(_0x86f6('0x1'));var LocalStrategy=require('passport-local')[_0x86f6('0x2')];var jayson=require(_0x86f6('0x3'));var _=require(_0x86f6('0x4'));var rs=require(_0x86f6('0x5'));var moment=require(_0x86f6('0x6'));var db=require(_0x86f6('0x7'))['db'];var authService=require(_0x86f6('0x8'));var utils=require(_0x86f6('0x9'));var client=jayson[_0x86f6('0xa')][_0x86f6('0xb')]({'port':0x232b});function localAuthenticate(_0x6831fc,_0x20f724,_0x470da0,_0x4f3c7d){var _0x1a240d,_0x4c3a10;return db[_0x86f6('0xc')]['findOne']({'where':{'id':0x1},'attributes':[_0x86f6('0xd'),_0x86f6('0xe')],'raw':!![]})[_0x86f6('0xf')](function(_0x54d843){_0x1a240d=_0x54d843;return _0x6831fc[_0x86f6('0x10')]({'attributes':['id',_0x86f6('0x11'),_0x86f6('0x12'),'salt',_0x86f6('0x13'),_0x86f6('0x14'),_0x86f6('0x15'),_0x86f6('0x16'),_0x86f6('0x17')],'where':{'name':_0x20f724,'role':{'$or':['admin',_0x86f6('0x18'),_0x86f6('0x19')]}}});})[_0x86f6('0xf')](function(_0x116594){if(!_0x116594||_0x116594&&_0x116594['name']!==_0x20f724){throw new Error(_0x86f6('0x1a'));}else{_0x4c3a10=_0x116594;return _0x4c3a10;}})[_0x86f6('0xf')](function(){_0x4c3a10[_0x86f6('0x1b')](_0x470da0,function(_0x3ff0ad,_0x3a0e32){var _0x275b14=_0x4c3a10[_0x86f6('0x17')]+0x1;if(_0x3ff0ad){return _0x4f3c7d(_0x3ff0ad);}else if(!_0x3a0e32){if(_0x4c3a10[_0x86f6('0x14')]){return _0x4f3c7d(null,![],{'message':_0x86f6('0x1a')});}else if(_0x1a240d[_0x86f6('0xd')]>0x0){if(_0x4c3a10[_0x86f6('0x15')]){if(_0x1a240d['blockDuration']>0x0){if(moment(_0x4c3a10[_0x86f6('0x16')])[_0x86f6('0x1c')](_0x1a240d['blockDuration'],_0x86f6('0x1d'))>moment()){return _0x4f3c7d(null,![],{'message':_0x86f6('0x1a')});}else{return utils[_0x86f6('0x1e')](_0x4c3a10,_0x275b14,![],null)[_0x86f6('0xf')](function(){return _0x4f3c7d(null,![],{'message':_0x86f6('0x1a')});});}}else{return _0x4f3c7d(null,![],{'message':_0x86f6('0x1a')});}}else{if(_0x275b14>=_0x1a240d[_0x86f6('0xd')]){return utils[_0x86f6('0x1e')](_0x4c3a10,0x0,!![],moment())[_0x86f6('0xf')](function(){return _0x4f3c7d(null,![],{'message':_0x86f6('0x1a')});});}else{return utils[_0x86f6('0x1e')](_0x4c3a10,_0x275b14,![],null)[_0x86f6('0xf')](function(){return _0x4f3c7d(null,![],{'message':_0x86f6('0x1a')});});}}}else{return _0x4f3c7d(null,![],{'message':_0x86f6('0x1a')});}}else{if(_0x4c3a10[_0x86f6('0x14')]){return _0x4f3c7d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x1a240d[_0x86f6('0xd')]>0x0){if(_0x4c3a10[_0x86f6('0x15')]){if(_0x1a240d['blockDuration']>0x0){if(moment(_0x4c3a10[_0x86f6('0x16')])[_0x86f6('0x1c')](_0x1a240d['blockDuration'],_0x86f6('0x1d'))>moment()){return _0x4f3c7d(null,![],{'message':_0x86f6('0x1a')});}else{return utils['clearBlockUser'](_0x4c3a10,0x0,![],null)[_0x86f6('0xf')](function(){return utils[_0x86f6('0x1f')](_0x4c3a10);})[_0x86f6('0xf')](function(){return _0x4f3c7d(null,_0x4c3a10);});}}else{return _0x4f3c7d(null,![],{'message':_0x86f6('0x1a')});}}else{return utils[_0x86f6('0x1e')](_0x4c3a10,0x0,![],null)[_0x86f6('0xf')](function(){return utils[_0x86f6('0x1f')](_0x4c3a10);})[_0x86f6('0xf')](function(){return _0x4f3c7d(null,_0x4c3a10);})[_0x86f6('0x20')](function(_0x346e8d){return _0x4f3c7d(null,![],_0x346e8d);});}}else{if(_0x4c3a10[_0x86f6('0x15')]){return _0x4f3c7d(null,![],{'message':_0x86f6('0x1a')});}else{return utils['getLicense'](_0x4c3a10)['then'](function(){return _0x4f3c7d(null,_0x4c3a10);});}}}});})[_0x86f6('0x20')](function(_0x1d4abb){return _0x4f3c7d(null,![],_0x1d4abb);});}function sendServiceMail(_0x3662ce){return db[_0x86f6('0x21')][_0x86f6('0x22')]({'where':{'service':!![]},'attributes':['id',_0x86f6('0x11'),_0x86f6('0x23')],'include':[{'model':db[_0x86f6('0x24')],'as':'Smtp'}]})[_0x86f6('0xf')](function(_0x33437d){if(!_0x33437d){throw new Error(_0x86f6('0x25'));}var _0x2955ca={'tls':{'rejectUnauthorized':![]}};if(_0x33437d['Smtp'][_0x86f6('0x26')]){_0x2955ca['service']=_0x33437d[_0x86f6('0x27')]['service'];}else{_0x2955ca[_0x86f6('0x28')]=_0x33437d['Smtp'][_0x86f6('0x28')];_0x2955ca[_0x86f6('0x29')]=_0x33437d[_0x86f6('0x27')]['port'];_0x2955ca[_0x86f6('0x2a')]=_0x33437d[_0x86f6('0x27')][_0x86f6('0x2a')];}if(_0x33437d[_0x86f6('0x27')][_0x86f6('0x2b')]){_0x2955ca[_0x86f6('0x2c')]={'user':_0x33437d[_0x86f6('0x27')][_0x86f6('0x18')],'pass':_0x33437d[_0x86f6('0x27')][_0x86f6('0x2d')]};}var _0x57e250={'account':_0x2955ca,'message':_[_0x86f6('0x2e')]({'from':util[_0x86f6('0x2f')]('\x22%s\x22\x20<%s>',_0x33437d[_0x86f6('0x11')],_0x33437d['email']||_0x33437d[_0x86f6('0x27')][_0x86f6('0x18')])},_0x3662ce)};return client[_0x86f6('0x30')](_0x86f6('0x31'),_0x57e250);})[_0x86f6('0xf')](function(_0xb90188){if(_0xb90188['error']){throw new Error(util[_0x86f6('0x2f')](_0x86f6('0x32'),_0xb90188[_0x86f6('0x33')][_0x86f6('0x34')]||JSON['stringify'](_0xb90188[_0x86f6('0x33')])));}return!![];});}function handleError(_0x4279ba,_0x53d0a2,_0x4d4c14){return _0x4279ba[_0x86f6('0x35')](_0x53d0a2||0x1f4)[_0x86f6('0x36')]({'message':_0x4d4c14?_0x4d4c14['message']||_0x4d4c14:''});}exports[_0x86f6('0x37')]=function(_0x564b4f,_0x272151,_0x267678){passport[_0x86f6('0x1b')](_0x86f6('0x38'),function(_0x2c8f44,_0x51713c,_0x433e5b){var _0x329cb6=_0x2c8f44||_0x433e5b;if(_0x329cb6){return handleError(_0x272151,0x191,_0x329cb6);}if(!_0x51713c){return handleError(_0x272151,0x194,{'message':_0x86f6('0x39')});}else{var _0x54e063={'payload':{'id':_0x51713c['id'],'role':_0x51713c[_0x86f6('0x13')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x54e063)['then'](function(_0x1e2cf0){_0x272151[_0x86f6('0x3a')]({'id':_0x51713c['id'],'token':_0x1e2cf0,'statusCall':'','isAlreadyLogged':_0x51713c['online']});});}})(_0x564b4f,_0x272151,_0x267678);};exports[_0x86f6('0x3b')]=function(_0x5f2e2b,_0x2e1f68,_0x45a417){if(!_0x5f2e2b['body'][_0x86f6('0x23')]){return handleError(_0x2e1f68,0x1f4,{'message':_0x86f6('0x3c')});}var _0x386a6b=rs[_0x86f6('0x3d')]();_0x5f2e2b[_0x86f6('0x3e')][_0x86f6('0x23')]=_0x5f2e2b['body'][_0x86f6('0x23')][_0x86f6('0x3f')]()['toLowerCase']();var _0x4aba20;return db[_0x86f6('0xc')][_0x86f6('0x10')]({'where':{'id':0x1},'attributes':[_0x86f6('0xd'),_0x86f6('0xe')],'raw':!![]})[_0x86f6('0xf')](function(_0x47bf14){_0x4aba20=_0x47bf14;return db['User'][_0x86f6('0x22')]({'where':{'email':_0x5f2e2b[_0x86f6('0x3e')][_0x86f6('0x23')]}});})[_0x86f6('0xf')](function(_0x444676){if(!_0x444676){throw new Error(_0x86f6('0x40'));}if(_0x444676[_0x86f6('0x14')]){throw new Error(_0x86f6('0x41'));}if(_0x444676[_0x86f6('0x15')]){if(moment(_0x444676[_0x86f6('0x16')])[_0x86f6('0x1c')](_0x4aba20[_0x86f6('0xe')],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x444676[_0x86f6('0x15')]=![];_0x444676['blockedAt']=null;}}_0x444676[_0x86f6('0x42')]=_0x386a6b;_0x444676[_0x86f6('0x43')]=Date[_0x86f6('0x44')]()+0x36ee80;return _0x444676[_0x86f6('0x45')]();})[_0x86f6('0xf')](function(){return sendServiceMail({'to':_0x5f2e2b['body']['email'],'subject':_0x86f6('0x46'),'text':_0x86f6('0x47')+_0x86f6('0x48')+_0x86f6('0x49')+_0x5f2e2b['headers'][_0x86f6('0x28')]+'/reset/'+_0x386a6b+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x86f6('0xf')](function(){_0x2e1f68[_0x86f6('0x35')](0xc8)[_0x86f6('0x36')]({'message':_0x86f6('0x4a')});})[_0x86f6('0x20')](function(_0x5750c0){return handleError(_0x2e1f68,0x1f4,_0x5750c0);});};exports[_0x86f6('0x4b')]=function(_0x47322e,_0x3d81e8,_0xf84d7a){return db[_0x86f6('0x4c')][_0x86f6('0x22')]({'where':{'resetPasswordToken':_0x47322e[_0x86f6('0x4d')][_0x86f6('0x4e')],'resetPasswordExpires':{'$gt':Date[_0x86f6('0x44')]()}}})['then'](function(_0x4e260f){if(!_0x4e260f){throw new Error(_0x86f6('0x4f'));}return db['Setting'][_0x86f6('0x10')]({'attributes':['id','securePassword',_0x86f6('0x50'),_0x86f6('0x51')]})['then'](function(_0x180249){if(_0x180249[_0x86f6('0x52')])authService[_0x86f6('0x53')](_0x47322e['body'][_0x86f6('0x12')]);if(!_0x180249[_0x86f6('0x50')]||!_0x4e260f['previousPasswords'])return _0x4e260f;authService[_0x86f6('0x54')](_0x47322e[_0x86f6('0x3e')][_0x86f6('0x12')],_0x4e260f[_0x86f6('0x55')],_0x180249[_0x86f6('0x51')]);return _0x4e260f;})[_0x86f6('0xf')](function(){_0x4e260f[_0x86f6('0x12')]=_0x47322e[_0x86f6('0x3e')][_0x86f6('0x12')];_0x4e260f['resetPasswordToken']=null;_0x4e260f[_0x86f6('0x43')]=null;return _0x4e260f[_0x86f6('0x45')]();});})[_0x86f6('0xf')](function(){_0x3d81e8[_0x86f6('0x35')](0xc8)[_0x86f6('0x36')]({'message':'Password\x20reset!'});})['catch'](function(_0x515c0c){return handleError(_0x3d81e8,0x1f4,_0x515c0c);});};passport[_0x86f6('0x56')](_0x86f6('0x38'),new LocalStrategy({'usernameField':'name','passwordField':_0x86f6('0x12')},function(_0x1174cd,_0x15571f,_0x319b31){return localAuthenticate(db[_0x86f6('0x4c')],_0x1174cd,_0x15571f,_0x319b31);}));
\ No newline at end of file
index c540834..5b21ab7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a54=['Router','./authLocal.controller','login','post','/forgot','forgot','reset','express'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x4a54,0x1c7));var _0x44a5=function(_0x43f6d2,_0x11b4e9){_0x43f6d2=_0x43f6d2-0x0;var _0xaef57=_0x4a54[_0x43f6d2];return _0xaef57;};'use strict';var express=require(_0x44a5('0x0'));var router=express[_0x44a5('0x1')]();var controller=require(_0x44a5('0x2'));router['post']('/',controller[_0x44a5('0x3')]);router[_0x44a5('0x4')](_0x44a5('0x5'),controller[_0x44a5('0x6')]);router[_0x44a5('0x4')]('/reset/:token',controller[_0x44a5('0x7')]);module['exports']=router;
\ No newline at end of file
+var _0x3857=['Router','./authLocal.controller','post','forgot','/reset/:token','reset','exports','express'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3857,0x1b7));var _0x7385=function(_0x4397bd,_0x19d586){_0x4397bd=_0x4397bd-0x0;var _0x3c992e=_0x3857[_0x4397bd];return _0x3c992e;};'use strict';var express=require(_0x7385('0x0'));var router=express[_0x7385('0x1')]();var controller=require(_0x7385('0x2'));router[_0x7385('0x3')]('/',controller['login']);router['post']('/forgot',controller[_0x7385('0x4')]);router[_0x7385('0x3')](_0x7385('0x5'),controller[_0x7385('0x6')]);module[_0x7385('0x7')]=router;
\ No newline at end of file
index 6a43f9d..e9069cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbce3=['sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0xe4936,_0x3cd5c0){var _0x254fee=function(_0x3a2b9f){while(--_0x3a2b9f){_0xe4936['push'](_0xe4936['shift']());}};_0x254fee(++_0x3cd5c0);}(_0xbce3,0x154));var _0x3bce=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xbce3[_0x2bf141];return _0x48277b;};'use strict';var Sequelize=require(_0x3bce('0x0'));module[_0x3bce('0x1')]={'name':{'type':Sequelize[_0x3bce('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x3bce('0x2')]},'description':{'type':Sequelize[_0x3bce('0x2')]},'status':{'type':Sequelize[_0x3bce('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x3bce('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x86db=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0xfdc76e,_0x294924){var _0x48d7c4=function(_0x29306a){while(--_0x29306a){_0xfdc76e['push'](_0xfdc76e['shift']());}};_0x48d7c4(++_0x294924);}(_0x86db,0x123));var _0xb86d=function(_0x48d933,_0x4eaabe){_0x48d933=_0x48d933-0x0;var _0x4caf07=_0x86db[_0x48d933];return _0x4caf07;};'use strict';var Sequelize=require(_0xb86d('0x0'));module[_0xb86d('0x1')]={'name':{'type':Sequelize[_0xb86d('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb86d('0x2')]},'status':{'type':Sequelize[_0xb86d('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xb86d('0x4')],'defaultValue':0xa}};
\ No newline at end of file
index bcf6259..036eb49 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa0ae=['eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','find','create','body','params','addConditions','Condition','ids','findOne','length','addActions','Action','getActions','hasOwnProperty','nolimit'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa0ae,0xf3));var _0xea0a=function(_0x332ddf,_0x1ed1b5){_0x332ddf=_0x332ddf-0x0;var _0x4798a9=_0xa0ae[_0x332ddf];return _0x4798a9;};'use strict';var emlformat=require(_0xea0a('0x0'));var rimraf=require(_0xea0a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xea0a('0x2'));var rp=require(_0xea0a('0x3'));var moment=require('moment');var BPromise=require(_0xea0a('0x4'));var Mustache=require(_0xea0a('0x5'));var util=require(_0xea0a('0x6'));var path=require(_0xea0a('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xea0a('0x8'));var fs=require('fs');var fs_extra=require(_0xea0a('0x9'));var _=require(_0xea0a('0xa'));var squel=require(_0xea0a('0xb'));var crypto=require(_0xea0a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xea0a('0xd'));var toCsv=require('to-csv');var querystring=require(_0xea0a('0xe'));var Papa=require(_0xea0a('0xf'));var Redis=require(_0xea0a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xea0a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xea0a('0x12'))(_0xea0a('0x13'));var utils=require(_0xea0a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xea0a('0x15'));var db=require(_0xea0a('0x16'))['db'];function respondWithStatusCode(_0x28bf94,_0xa199de){_0xa199de=_0xa199de||0xcc;return function(_0x185272){if(_0x185272){return _0x28bf94[_0xea0a('0x17')](_0xa199de);}return _0x28bf94[_0xea0a('0x18')](_0xa199de)[_0xea0a('0x19')]();};}function respondWithResult(_0x417e9c,_0x2143d5){_0x2143d5=_0x2143d5||0xc8;return function(_0x44c853){if(_0x44c853){return _0x417e9c[_0xea0a('0x18')](_0x2143d5)[_0xea0a('0x1a')](_0x44c853);}};}function respondWithFilteredResult(_0x58826f,_0x1f592e){return function(_0x2a4fa3){if(_0x2a4fa3){var _0x2e25f9=typeof _0x1f592e[_0xea0a('0x1b')]==='undefined'&&typeof _0x1f592e[_0xea0a('0x1c')]===_0xea0a('0x1d');var _0x39da83=_0x2a4fa3[_0xea0a('0x1e')];var _0x44efaa=_0x2e25f9?0x0:_0x1f592e['offset'];var _0x5cafdb=_0x2e25f9?_0x2a4fa3[_0xea0a('0x1e')]:_0x1f592e[_0xea0a('0x1b')]+_0x1f592e[_0xea0a('0x1c')];var _0x5efaac;if(_0x5cafdb>=_0x39da83){_0x5cafdb=_0x39da83;_0x5efaac=0xc8;}else{_0x5efaac=0xce;}_0x58826f[_0xea0a('0x18')](_0x5efaac);return _0x58826f[_0xea0a('0x1f')](_0xea0a('0x20'),_0x44efaa+'-'+_0x5cafdb+'/'+_0x39da83)[_0xea0a('0x1a')](_0x2a4fa3);}return null;};}function patchUpdates(_0x330e01){return function(_0x3f2013){try{jsonpatch['apply'](_0x3f2013,_0x330e01,!![]);}catch(_0x237dcc){return BPromise[_0xea0a('0x21')](_0x237dcc);}return _0x3f2013[_0xea0a('0x22')]();};}function saveUpdates(_0x545a0d,_0x5c1422){return function(_0x502e86){if(_0x502e86){return _0x502e86[_0xea0a('0x23')](_0x545a0d)[_0xea0a('0x24')](function(_0x16da99){return _0x16da99;});}return null;};}function removeEntity(_0x4184a7,_0x5c6941){return function(_0x1a7a4e){if(_0x1a7a4e){return _0x1a7a4e[_0xea0a('0x25')]()[_0xea0a('0x24')](function(){_0x4184a7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e3637,_0x2938b7){return function(_0x12b5d1){if(!_0x12b5d1){_0x3e3637[_0xea0a('0x17')](0x194);}return _0x12b5d1;};}function handleError(_0x39277c,_0x1dedca){_0x1dedca=_0x1dedca||0x1f4;return function(_0x404dd1){logger['error'](_0x404dd1[_0xea0a('0x26')]);if(_0x404dd1[_0xea0a('0x27')]){delete _0x404dd1[_0xea0a('0x27')];}_0x39277c[_0xea0a('0x18')](_0x1dedca)[_0xea0a('0x28')](_0x404dd1);};}exports[_0xea0a('0x29')]=function(_0x2f6ff6,_0x64fb08){var _0x1aab0c={},_0x2e2298={},_0x3f2082={'count':0x0,'rows':[]};var _0x5d3f10=_[_0xea0a('0x2a')](db[_0xea0a('0x2b')][_0xea0a('0x2c')],function(_0x57c916){return{'name':_0x57c916[_0xea0a('0x2d')],'type':_0x57c916[_0xea0a('0x2e')][_0xea0a('0x2f')]};});_0x2e2298['model']=_['map'](_0x5d3f10,_0xea0a('0x27'));_0x2e2298[_0xea0a('0x30')]=_[_0xea0a('0x31')](_0x2f6ff6[_0xea0a('0x30')]);_0x2e2298[_0xea0a('0x32')]=_[_0xea0a('0x33')](_0x2e2298[_0xea0a('0x34')],_0x2e2298[_0xea0a('0x30')]);_0x1aab0c['attributes']=_[_0xea0a('0x33')](_0x2e2298[_0xea0a('0x34')],qs[_0xea0a('0x35')](_0x2f6ff6[_0xea0a('0x30')]['fields']));_0x1aab0c[_0xea0a('0x36')]=_0x1aab0c[_0xea0a('0x36')]['length']?_0x1aab0c[_0xea0a('0x36')]:_0x2e2298[_0xea0a('0x34')];if(!_0x2f6ff6['query']['hasOwnProperty']('nolimit')){_0x1aab0c[_0xea0a('0x1c')]=qs[_0xea0a('0x1c')](_0x2f6ff6[_0xea0a('0x30')][_0xea0a('0x1c')]);_0x1aab0c[_0xea0a('0x1b')]=qs['offset'](_0x2f6ff6[_0xea0a('0x30')][_0xea0a('0x1b')]);}_0x1aab0c[_0xea0a('0x37')]=qs[_0xea0a('0x38')](_0x2f6ff6[_0xea0a('0x30')][_0xea0a('0x38')]);_0x1aab0c[_0xea0a('0x39')]=qs[_0xea0a('0x32')](_[_0xea0a('0x3a')](_0x2f6ff6[_0xea0a('0x30')],_0x2e2298['filters']),_0x5d3f10);if(_0x2f6ff6[_0xea0a('0x30')][_0xea0a('0x3b')]){_0x1aab0c[_0xea0a('0x39')]=_[_0xea0a('0x3c')](_0x1aab0c[_0xea0a('0x39')],{'$or':_[_0xea0a('0x2a')](_0x5d3f10,function(_0x40ae36){if(_0x40ae36[_0xea0a('0x2e')]!==_0xea0a('0x3d')){var _0x5453ee={};_0x5453ee[_0x40ae36[_0xea0a('0x27')]]={'$like':'%'+_0x2f6ff6[_0xea0a('0x30')][_0xea0a('0x3b')]+'%'};return _0x5453ee;}})});}_0x1aab0c=_[_0xea0a('0x3c')]({},_0x1aab0c,_0x2f6ff6[_0xea0a('0x3e')]);var _0x1c2579={'where':_0x1aab0c[_0xea0a('0x39')]};return db[_0xea0a('0x2b')][_0xea0a('0x1e')](_0x1c2579)[_0xea0a('0x24')](function(_0x4913d8){_0x3f2082['count']=_0x4913d8;if(_0x2f6ff6['query']['includeAll']){_0x1aab0c[_0xea0a('0x3f')]=[{'all':!![]}];}return db[_0xea0a('0x2b')][_0xea0a('0x40')](_0x1aab0c);})[_0xea0a('0x24')](function(_0x25a983){_0x3f2082[_0xea0a('0x41')]=_0x25a983;return _0x3f2082;})[_0xea0a('0x24')](respondWithFilteredResult(_0x64fb08,_0x1aab0c))[_0xea0a('0x42')](handleError(_0x64fb08,null));};exports['show']=function(_0x58fa71,_0x36b422){var _0x509e78={'raw':![],'where':{'id':_0x58fa71['params']['id']}},_0x5dcd94={};_0x5dcd94[_0xea0a('0x34')]=_[_0xea0a('0x31')](db[_0xea0a('0x2b')][_0xea0a('0x2c')]);_0x5dcd94['query']=_['keys'](_0x58fa71[_0xea0a('0x30')]);_0x5dcd94['filters']=_[_0xea0a('0x33')](_0x5dcd94[_0xea0a('0x34')],_0x5dcd94[_0xea0a('0x30')]);_0x509e78['attributes']=_['intersection'](_0x5dcd94['model'],qs[_0xea0a('0x35')](_0x58fa71[_0xea0a('0x30')]['fields']));_0x509e78[_0xea0a('0x36')]=_0x509e78[_0xea0a('0x36')]['length']?_0x509e78['attributes']:_0x5dcd94[_0xea0a('0x34')];if(_0x58fa71[_0xea0a('0x30')]['includeAll']){_0x509e78[_0xea0a('0x3f')]=[{'all':!![]}];}_0x509e78=_[_0xea0a('0x3c')]({},_0x509e78,_0x58fa71[_0xea0a('0x3e')]);return db[_0xea0a('0x2b')][_0xea0a('0x43')](_0x509e78)['then'](handleEntityNotFound(_0x36b422,null))[_0xea0a('0x24')](respondWithResult(_0x36b422,null))[_0xea0a('0x42')](handleError(_0x36b422,null));};exports[_0xea0a('0x44')]=function(_0x2355df,_0x25954e){return db['Automation']['create'](_0x2355df['body'],{})['then'](respondWithResult(_0x25954e,0xc9))['catch'](handleError(_0x25954e,null));};exports[_0xea0a('0x23')]=function(_0x45af54,_0x162473){if(_0x45af54[_0xea0a('0x45')]['id']){delete _0x45af54[_0xea0a('0x45')]['id'];}return db['Automation']['find']({'where':{'id':_0x45af54['params']['id']}})[_0xea0a('0x24')](handleEntityNotFound(_0x162473,null))[_0xea0a('0x24')](saveUpdates(_0x45af54[_0xea0a('0x45')],null))[_0xea0a('0x24')](respondWithResult(_0x162473,null))[_0xea0a('0x42')](handleError(_0x162473,null));};exports['destroy']=function(_0x1483f6,_0xb5fed6){return db['Automation']['find']({'where':{'id':_0x1483f6[_0xea0a('0x46')]['id']}})['then'](handleEntityNotFound(_0xb5fed6,null))[_0xea0a('0x24')](removeEntity(_0xb5fed6,null))[_0xea0a('0x42')](handleError(_0xb5fed6,null));};exports[_0xea0a('0x47')]=function(_0x35fa22,_0x2b30fd,_0xb9a732){return db[_0xea0a('0x48')]['find']({'where':{'id':_0x35fa22[_0xea0a('0x46')]['id']}})['then'](handleEntityNotFound(_0x2b30fd,null))[_0xea0a('0x24')](function(_0x46f0c2){if(_0x46f0c2){return _0x46f0c2[_0xea0a('0x47')](_0x35fa22[_0xea0a('0x45')][_0xea0a('0x49')],_['omit'](_0x35fa22[_0xea0a('0x45')],[_0xea0a('0x49'),'id'])||{});}})[_0xea0a('0x24')](respondWithResult(_0x2b30fd,null))[_0xea0a('0x42')](handleError(_0x2b30fd,null));};exports['getConditions']=function(_0xce078b,_0x37707d,_0x34e96e){var _0x1c3e27={};var _0x5c7cb6={};var _0x58f2e1;var _0x3ba0b;return db[_0xea0a('0x2b')][_0xea0a('0x4a')]({'where':{'id':_0xce078b['params']['id']}})[_0xea0a('0x24')](handleEntityNotFound(_0x37707d,null))[_0xea0a('0x24')](function(_0x4d64ef){if(_0x4d64ef){_0x58f2e1=_0x4d64ef;_0x5c7cb6[_0xea0a('0x34')]=_[_0xea0a('0x31')](db[_0xea0a('0x48')][_0xea0a('0x2c')]);_0x5c7cb6['query']=_[_0xea0a('0x31')](_0xce078b[_0xea0a('0x30')]);_0x5c7cb6[_0xea0a('0x32')]=_[_0xea0a('0x33')](_0x5c7cb6[_0xea0a('0x34')],_0x5c7cb6['query']);_0x1c3e27[_0xea0a('0x36')]=_[_0xea0a('0x33')](_0x5c7cb6[_0xea0a('0x34')],qs[_0xea0a('0x35')](_0xce078b[_0xea0a('0x30')][_0xea0a('0x35')]));_0x1c3e27[_0xea0a('0x36')]=_0x1c3e27['attributes'][_0xea0a('0x4b')]?_0x1c3e27[_0xea0a('0x36')]:_0x5c7cb6[_0xea0a('0x34')];_0x1c3e27[_0xea0a('0x37')]=qs['sort'](_0xce078b[_0xea0a('0x30')][_0xea0a('0x38')]);_0x1c3e27[_0xea0a('0x39')]=qs[_0xea0a('0x32')](_['pick'](_0xce078b['query'],_0x5c7cb6['filters']));if(_0xce078b['query'][_0xea0a('0x3b')]){_0x1c3e27[_0xea0a('0x39')]=_['merge'](_0x1c3e27[_0xea0a('0x39')],{'$or':_[_0xea0a('0x2a')](_0x1c3e27[_0xea0a('0x36')],function(_0x38c71c){var _0x2cfc53={};_0x2cfc53[_0x38c71c]={'$like':'%'+_0xce078b['query'][_0xea0a('0x3b')]+'%'};return _0x2cfc53;})});}_0x1c3e27=_[_0xea0a('0x3c')]({},_0x1c3e27,_0xce078b[_0xea0a('0x3e')]);return _0x58f2e1['getConditions'](_0x1c3e27);}})['then'](function(_0x4a3b0d){if(_0x4a3b0d){_0x3ba0b=_0x4a3b0d[_0xea0a('0x4b')];if(!_0xce078b['query']['hasOwnProperty']('nolimit')){_0x1c3e27[_0xea0a('0x1c')]=qs['limit'](_0xce078b[_0xea0a('0x30')]['limit']);_0x1c3e27[_0xea0a('0x1b')]=qs[_0xea0a('0x1b')](_0xce078b[_0xea0a('0x30')][_0xea0a('0x1b')]);}return _0x58f2e1['getConditions'](_0x1c3e27);}})[_0xea0a('0x24')](function(_0x15ccc3){if(_0x15ccc3){return _0x15ccc3?{'count':_0x3ba0b,'rows':_0x15ccc3}:null;}})[_0xea0a('0x24')](respondWithResult(_0x37707d,null))[_0xea0a('0x42')](handleError(_0x37707d,null));};exports[_0xea0a('0x4c')]=function(_0x16cb2c,_0x294df3,_0x190f36){return db[_0xea0a('0x4d')][_0xea0a('0x43')]({'where':{'id':_0x16cb2c[_0xea0a('0x46')]['id']}})['then'](handleEntityNotFound(_0x294df3,null))[_0xea0a('0x24')](function(_0x9c3040){if(_0x9c3040){return _0x9c3040[_0xea0a('0x4c')](_0x16cb2c[_0xea0a('0x45')]['ids'],_['omit'](_0x16cb2c[_0xea0a('0x45')],[_0xea0a('0x49'),'id'])||{});}})[_0xea0a('0x24')](respondWithResult(_0x294df3,null))[_0xea0a('0x42')](handleError(_0x294df3,null));};exports[_0xea0a('0x4e')]=function(_0x3f134a,_0x313c2d,_0xbd8282){var _0x461462={};var _0x4d0e01={};var _0x249b54;var _0x51dee1;return db['Automation'][_0xea0a('0x4a')]({'where':{'id':_0x3f134a['params']['id']}})[_0xea0a('0x24')](handleEntityNotFound(_0x313c2d,null))[_0xea0a('0x24')](function(_0x4ae3a6){if(_0x4ae3a6){_0x249b54=_0x4ae3a6;_0x4d0e01[_0xea0a('0x34')]=_[_0xea0a('0x31')](db[_0xea0a('0x4d')][_0xea0a('0x2c')]);_0x4d0e01['query']=_[_0xea0a('0x31')](_0x3f134a[_0xea0a('0x30')]);_0x4d0e01[_0xea0a('0x32')]=_[_0xea0a('0x33')](_0x4d0e01[_0xea0a('0x34')],_0x4d0e01['query']);_0x461462[_0xea0a('0x36')]=_[_0xea0a('0x33')](_0x4d0e01[_0xea0a('0x34')],qs[_0xea0a('0x35')](_0x3f134a[_0xea0a('0x30')]['fields']));_0x461462['attributes']=_0x461462[_0xea0a('0x36')][_0xea0a('0x4b')]?_0x461462[_0xea0a('0x36')]:_0x4d0e01[_0xea0a('0x34')];_0x461462[_0xea0a('0x37')]=qs[_0xea0a('0x38')](_0x3f134a[_0xea0a('0x30')]['sort']);_0x461462['where']=qs[_0xea0a('0x32')](_[_0xea0a('0x3a')](_0x3f134a['query'],_0x4d0e01[_0xea0a('0x32')]));if(_0x3f134a[_0xea0a('0x30')][_0xea0a('0x3b')]){_0x461462[_0xea0a('0x39')]=_[_0xea0a('0x3c')](_0x461462[_0xea0a('0x39')],{'$or':_['map'](_0x461462[_0xea0a('0x36')],function(_0x59a394){var _0x2c0685={};_0x2c0685[_0x59a394]={'$like':'%'+_0x3f134a['query'][_0xea0a('0x3b')]+'%'};return _0x2c0685;})});}_0x461462=_[_0xea0a('0x3c')]({},_0x461462,_0x3f134a[_0xea0a('0x3e')]);return _0x249b54[_0xea0a('0x4e')](_0x461462);}})['then'](function(_0x114f1d){if(_0x114f1d){_0x51dee1=_0x114f1d[_0xea0a('0x4b')];if(!_0x3f134a[_0xea0a('0x30')][_0xea0a('0x4f')](_0xea0a('0x50'))){_0x461462[_0xea0a('0x1c')]=qs[_0xea0a('0x1c')](_0x3f134a[_0xea0a('0x30')][_0xea0a('0x1c')]);_0x461462['offset']=qs['offset'](_0x3f134a[_0xea0a('0x30')][_0xea0a('0x1b')]);}return _0x249b54[_0xea0a('0x4e')](_0x461462);}})['then'](function(_0x4e2910){if(_0x4e2910){return _0x4e2910?{'count':_0x51dee1,'rows':_0x4e2910}:null;}})[_0xea0a('0x24')](respondWithResult(_0x313c2d,null))[_0xea0a('0x42')](handleError(_0x313c2d,null));};
\ No newline at end of file
+var _0x5d1d=['limit','set','reject','save','update','then','destroy','error','stack','name','send','Automation','fieldName','type','query','keys','intersection','model','attributes','fields','length','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','addConditions','Condition','ids','omit','getConditions','nolimit','addActions','getActions','findOne','hasOwnProperty','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/auth/service','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count'];(function(_0x404466,_0x391ca3){var _0x27c318=function(_0x1d4c6d){while(--_0x1d4c6d){_0x404466['push'](_0x404466['shift']());}};_0x27c318(++_0x391ca3);}(_0x5d1d,0x12a));var _0xd5d1=function(_0x2609bf,_0x30573b){_0x2609bf=_0x2609bf-0x0;var _0x474bbe=_0x5d1d[_0x2609bf];return _0x474bbe;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd5d1('0x0'));var jsonpatch=require(_0xd5d1('0x1'));var rp=require(_0xd5d1('0x2'));var moment=require(_0xd5d1('0x3'));var BPromise=require(_0xd5d1('0x4'));var Mustache=require(_0xd5d1('0x5'));var util=require('util');var path=require(_0xd5d1('0x6'));var sox=require(_0xd5d1('0x7'));var csv=require(_0xd5d1('0x8'));var ejs=require(_0xd5d1('0x9'));var fs=require('fs');var fs_extra=require(_0xd5d1('0xa'));var _=require(_0xd5d1('0xb'));var squel=require(_0xd5d1('0xc'));var crypto=require(_0xd5d1('0xd'));var jsforce=require(_0xd5d1('0xe'));var deskjs=require(_0xd5d1('0xf'));var toCsv=require(_0xd5d1('0x8'));var querystring=require(_0xd5d1('0x10'));var Papa=require(_0xd5d1('0x11'));var Redis=require(_0xd5d1('0x12'));var authService=require(_0xd5d1('0x13'));var qs=require('../../components/parsers/qs');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(_0xd5d1('0x14'));var licenseUtil=require(_0xd5d1('0x15'));var db=require(_0xd5d1('0x16'))['db'];function respondWithStatusCode(_0x31b818,_0x1222ed){_0x1222ed=_0x1222ed||0xcc;return function(_0x2fedc6){if(_0x2fedc6){return _0x31b818[_0xd5d1('0x17')](_0x1222ed);}return _0x31b818['status'](_0x1222ed)[_0xd5d1('0x18')]();};}function respondWithResult(_0x5edb05,_0x3d4115){_0x3d4115=_0x3d4115||0xc8;return function(_0xaf2e7){if(_0xaf2e7){return _0x5edb05[_0xd5d1('0x19')](_0x3d4115)[_0xd5d1('0x1a')](_0xaf2e7);}};}function respondWithFilteredResult(_0x447bd5,_0x368dec){return function(_0x1e57b6){if(_0x1e57b6){var _0x4512ad=typeof _0x368dec[_0xd5d1('0x1b')]===_0xd5d1('0x1c')&&typeof _0x368dec['limit']===_0xd5d1('0x1c');var _0x1ffab8=_0x1e57b6[_0xd5d1('0x1d')];var _0x462b7a=_0x4512ad?0x0:_0x368dec['offset'];var _0x177764=_0x4512ad?_0x1e57b6[_0xd5d1('0x1d')]:_0x368dec[_0xd5d1('0x1b')]+_0x368dec[_0xd5d1('0x1e')];var _0x52a124;if(_0x177764>=_0x1ffab8){_0x177764=_0x1ffab8;_0x52a124=0xc8;}else{_0x52a124=0xce;}_0x447bd5[_0xd5d1('0x19')](_0x52a124);return _0x447bd5[_0xd5d1('0x1f')]('Content-Range',_0x462b7a+'-'+_0x177764+'/'+_0x1ffab8)['json'](_0x1e57b6);}return null;};}function patchUpdates(_0x2842a2){return function(_0x2ffed6){try{jsonpatch['apply'](_0x2ffed6,_0x2842a2,!![]);}catch(_0x25249b){return BPromise[_0xd5d1('0x20')](_0x25249b);}return _0x2ffed6[_0xd5d1('0x21')]();};}function saveUpdates(_0x5a6ff7,_0x5deffe){return function(_0x2b8d71){if(_0x2b8d71){return _0x2b8d71[_0xd5d1('0x22')](_0x5a6ff7)[_0xd5d1('0x23')](function(_0x3d11b5){return _0x3d11b5;});}return null;};}function removeEntity(_0x2b1eac,_0x5a4060){return function(_0x452a0f){if(_0x452a0f){return _0x452a0f[_0xd5d1('0x24')]()[_0xd5d1('0x23')](function(){_0x2b1eac[_0xd5d1('0x19')](0xcc)[_0xd5d1('0x18')]();});}};}function handleEntityNotFound(_0x2adde9,_0xbe2799){return function(_0x57e515){if(!_0x57e515){_0x2adde9[_0xd5d1('0x17')](0x194);}return _0x57e515;};}function handleError(_0x553402,_0x5c5e1){_0x5c5e1=_0x5c5e1||0x1f4;return function(_0x4086ba){logger[_0xd5d1('0x25')](_0x4086ba[_0xd5d1('0x26')]);if(_0x4086ba[_0xd5d1('0x27')]){delete _0x4086ba[_0xd5d1('0x27')];}_0x553402[_0xd5d1('0x19')](_0x5c5e1)[_0xd5d1('0x28')](_0x4086ba);};}exports['index']=function(_0x5cbf5f,_0x485022){var _0x5438bb={},_0x1d94c3={},_0x49b898={'count':0x0,'rows':[]};var _0x3d2995=_['map'](db[_0xd5d1('0x29')]['rawAttributes'],function(_0x40faa6){return{'name':_0x40faa6[_0xd5d1('0x2a')],'type':_0x40faa6[_0xd5d1('0x2b')]['key']};});_0x1d94c3['model']=_['map'](_0x3d2995,'name');_0x1d94c3[_0xd5d1('0x2c')]=_[_0xd5d1('0x2d')](_0x5cbf5f[_0xd5d1('0x2c')]);_0x1d94c3['filters']=_[_0xd5d1('0x2e')](_0x1d94c3[_0xd5d1('0x2f')],_0x1d94c3[_0xd5d1('0x2c')]);_0x5438bb[_0xd5d1('0x30')]=_[_0xd5d1('0x2e')](_0x1d94c3[_0xd5d1('0x2f')],qs[_0xd5d1('0x31')](_0x5cbf5f[_0xd5d1('0x2c')][_0xd5d1('0x31')]));_0x5438bb[_0xd5d1('0x30')]=_0x5438bb['attributes'][_0xd5d1('0x32')]?_0x5438bb[_0xd5d1('0x30')]:_0x1d94c3[_0xd5d1('0x2f')];if(!_0x5cbf5f['query']['hasOwnProperty']('nolimit')){_0x5438bb[_0xd5d1('0x1e')]=qs[_0xd5d1('0x1e')](_0x5cbf5f[_0xd5d1('0x2c')][_0xd5d1('0x1e')]);_0x5438bb[_0xd5d1('0x1b')]=qs['offset'](_0x5cbf5f[_0xd5d1('0x2c')]['offset']);}_0x5438bb[_0xd5d1('0x33')]=qs[_0xd5d1('0x34')](_0x5cbf5f['query']['sort']);_0x5438bb[_0xd5d1('0x35')]=qs[_0xd5d1('0x36')](_[_0xd5d1('0x37')](_0x5cbf5f[_0xd5d1('0x2c')],_0x1d94c3[_0xd5d1('0x36')]),_0x3d2995);if(_0x5cbf5f['query'][_0xd5d1('0x38')]){_0x5438bb['where']=_[_0xd5d1('0x39')](_0x5438bb[_0xd5d1('0x35')],{'$or':_[_0xd5d1('0x3a')](_0x3d2995,function(_0x54d40b){if(_0x54d40b['type']!==_0xd5d1('0x3b')){var _0x47733d={};_0x47733d[_0x54d40b[_0xd5d1('0x27')]]={'$like':'%'+_0x5cbf5f[_0xd5d1('0x2c')][_0xd5d1('0x38')]+'%'};return _0x47733d;}})});}_0x5438bb=_[_0xd5d1('0x39')]({},_0x5438bb,_0x5cbf5f[_0xd5d1('0x3c')]);var _0x1b3c31={'where':_0x5438bb[_0xd5d1('0x35')]};return db[_0xd5d1('0x29')]['count'](_0x1b3c31)[_0xd5d1('0x23')](function(_0x4d93f6){_0x49b898[_0xd5d1('0x1d')]=_0x4d93f6;if(_0x5cbf5f[_0xd5d1('0x2c')][_0xd5d1('0x3d')]){_0x5438bb[_0xd5d1('0x3e')]=[{'all':!![]}];}return db[_0xd5d1('0x29')][_0xd5d1('0x3f')](_0x5438bb);})[_0xd5d1('0x23')](function(_0x179f34){_0x49b898[_0xd5d1('0x40')]=_0x179f34;return _0x49b898;})[_0xd5d1('0x23')](respondWithFilteredResult(_0x485022,_0x5438bb))[_0xd5d1('0x41')](handleError(_0x485022,null));};exports[_0xd5d1('0x42')]=function(_0x2b6224,_0x4a414e){var _0x57d3ab={'raw':![],'where':{'id':_0x2b6224[_0xd5d1('0x43')]['id']}},_0x51cbb9={};_0x51cbb9[_0xd5d1('0x2f')]=_['keys'](db['Automation'][_0xd5d1('0x44')]);_0x51cbb9[_0xd5d1('0x2c')]=_[_0xd5d1('0x2d')](_0x2b6224['query']);_0x51cbb9['filters']=_['intersection'](_0x51cbb9[_0xd5d1('0x2f')],_0x51cbb9[_0xd5d1('0x2c')]);_0x57d3ab[_0xd5d1('0x30')]=_[_0xd5d1('0x2e')](_0x51cbb9[_0xd5d1('0x2f')],qs[_0xd5d1('0x31')](_0x2b6224[_0xd5d1('0x2c')][_0xd5d1('0x31')]));_0x57d3ab['attributes']=_0x57d3ab[_0xd5d1('0x30')][_0xd5d1('0x32')]?_0x57d3ab[_0xd5d1('0x30')]:_0x51cbb9['model'];if(_0x2b6224[_0xd5d1('0x2c')][_0xd5d1('0x3d')]){_0x57d3ab[_0xd5d1('0x3e')]=[{'all':!![]}];}_0x57d3ab=_[_0xd5d1('0x39')]({},_0x57d3ab,_0x2b6224[_0xd5d1('0x3c')]);return db[_0xd5d1('0x29')][_0xd5d1('0x45')](_0x57d3ab)[_0xd5d1('0x23')](handleEntityNotFound(_0x4a414e,null))['then'](respondWithResult(_0x4a414e,null))['catch'](handleError(_0x4a414e,null));};exports['create']=function(_0x53a1f8,_0x14a138){return db[_0xd5d1('0x29')][_0xd5d1('0x46')](_0x53a1f8['body'],{})[_0xd5d1('0x23')](respondWithResult(_0x14a138,0xc9))[_0xd5d1('0x41')](handleError(_0x14a138,null));};exports[_0xd5d1('0x22')]=function(_0x162014,_0x3c8b00){if(_0x162014[_0xd5d1('0x47')]['id']){delete _0x162014[_0xd5d1('0x47')]['id'];}return db['Automation'][_0xd5d1('0x45')]({'where':{'id':_0x162014['params']['id']}})[_0xd5d1('0x23')](handleEntityNotFound(_0x3c8b00,null))['then'](saveUpdates(_0x162014[_0xd5d1('0x47')],null))[_0xd5d1('0x23')](respondWithResult(_0x3c8b00,null))[_0xd5d1('0x41')](handleError(_0x3c8b00,null));};exports['destroy']=function(_0x54aa87,_0x1b58b3){return db[_0xd5d1('0x29')][_0xd5d1('0x45')]({'where':{'id':_0x54aa87[_0xd5d1('0x43')]['id']}})[_0xd5d1('0x23')](handleEntityNotFound(_0x1b58b3,null))[_0xd5d1('0x23')](removeEntity(_0x1b58b3,null))['catch'](handleError(_0x1b58b3,null));};exports[_0xd5d1('0x48')]=function(_0x131d72,_0x5867e4,_0xa380c1){return db[_0xd5d1('0x49')][_0xd5d1('0x45')]({'where':{'id':_0x131d72[_0xd5d1('0x43')]['id']}})[_0xd5d1('0x23')](handleEntityNotFound(_0x5867e4,null))[_0xd5d1('0x23')](function(_0x405d10){if(_0x405d10){return _0x405d10[_0xd5d1('0x48')](_0x131d72['body'][_0xd5d1('0x4a')],_[_0xd5d1('0x4b')](_0x131d72[_0xd5d1('0x47')],[_0xd5d1('0x4a'),'id'])||{});}})[_0xd5d1('0x23')](respondWithResult(_0x5867e4,null))['catch'](handleError(_0x5867e4,null));};exports[_0xd5d1('0x4c')]=function(_0x35ade1,_0x52a137,_0x396cc4){var _0x2e06d5={};var _0x3f40fc={};var _0x2007fd;var _0x5ba8d9;return db[_0xd5d1('0x29')]['findOne']({'where':{'id':_0x35ade1[_0xd5d1('0x43')]['id']}})[_0xd5d1('0x23')](handleEntityNotFound(_0x52a137,null))[_0xd5d1('0x23')](function(_0x352d19){if(_0x352d19){_0x2007fd=_0x352d19;_0x3f40fc[_0xd5d1('0x2f')]=_[_0xd5d1('0x2d')](db[_0xd5d1('0x49')][_0xd5d1('0x44')]);_0x3f40fc[_0xd5d1('0x2c')]=_[_0xd5d1('0x2d')](_0x35ade1[_0xd5d1('0x2c')]);_0x3f40fc[_0xd5d1('0x36')]=_[_0xd5d1('0x2e')](_0x3f40fc[_0xd5d1('0x2f')],_0x3f40fc[_0xd5d1('0x2c')]);_0x2e06d5['attributes']=_[_0xd5d1('0x2e')](_0x3f40fc[_0xd5d1('0x2f')],qs['fields'](_0x35ade1[_0xd5d1('0x2c')][_0xd5d1('0x31')]));_0x2e06d5[_0xd5d1('0x30')]=_0x2e06d5[_0xd5d1('0x30')][_0xd5d1('0x32')]?_0x2e06d5['attributes']:_0x3f40fc['model'];_0x2e06d5[_0xd5d1('0x33')]=qs[_0xd5d1('0x34')](_0x35ade1[_0xd5d1('0x2c')]['sort']);_0x2e06d5[_0xd5d1('0x35')]=qs[_0xd5d1('0x36')](_[_0xd5d1('0x37')](_0x35ade1[_0xd5d1('0x2c')],_0x3f40fc[_0xd5d1('0x36')]));if(_0x35ade1['query'][_0xd5d1('0x38')]){_0x2e06d5[_0xd5d1('0x35')]=_[_0xd5d1('0x39')](_0x2e06d5['where'],{'$or':_[_0xd5d1('0x3a')](_0x2e06d5[_0xd5d1('0x30')],function(_0x2f3d9b){var _0x4c04f1={};_0x4c04f1[_0x2f3d9b]={'$like':'%'+_0x35ade1[_0xd5d1('0x2c')][_0xd5d1('0x38')]+'%'};return _0x4c04f1;})});}_0x2e06d5=_[_0xd5d1('0x39')]({},_0x2e06d5,_0x35ade1[_0xd5d1('0x3c')]);return _0x2007fd[_0xd5d1('0x4c')](_0x2e06d5);}})[_0xd5d1('0x23')](function(_0x580d5e){if(_0x580d5e){_0x5ba8d9=_0x580d5e[_0xd5d1('0x32')];if(!_0x35ade1[_0xd5d1('0x2c')]['hasOwnProperty'](_0xd5d1('0x4d'))){_0x2e06d5[_0xd5d1('0x1e')]=qs[_0xd5d1('0x1e')](_0x35ade1[_0xd5d1('0x2c')][_0xd5d1('0x1e')]);_0x2e06d5[_0xd5d1('0x1b')]=qs[_0xd5d1('0x1b')](_0x35ade1[_0xd5d1('0x2c')][_0xd5d1('0x1b')]);}return _0x2007fd['getConditions'](_0x2e06d5);}})[_0xd5d1('0x23')](function(_0x136e25){if(_0x136e25){return _0x136e25?{'count':_0x5ba8d9,'rows':_0x136e25}:null;}})[_0xd5d1('0x23')](respondWithResult(_0x52a137,null))[_0xd5d1('0x41')](handleError(_0x52a137,null));};exports[_0xd5d1('0x4e')]=function(_0x4e1cbf,_0x38c206,_0x4a24a7){return db['Action']['find']({'where':{'id':_0x4e1cbf[_0xd5d1('0x43')]['id']}})['then'](handleEntityNotFound(_0x38c206,null))[_0xd5d1('0x23')](function(_0x2f9d7d){if(_0x2f9d7d){return _0x2f9d7d[_0xd5d1('0x4e')](_0x4e1cbf[_0xd5d1('0x47')][_0xd5d1('0x4a')],_['omit'](_0x4e1cbf['body'],['ids','id'])||{});}})[_0xd5d1('0x23')](respondWithResult(_0x38c206,null))[_0xd5d1('0x41')](handleError(_0x38c206,null));};exports[_0xd5d1('0x4f')]=function(_0x291abf,_0x32aaaa,_0x553cf5){var _0x3d7d1e={};var _0x1b2aaf={};var _0x4894c0;var _0x5b70c8;return db[_0xd5d1('0x29')][_0xd5d1('0x50')]({'where':{'id':_0x291abf[_0xd5d1('0x43')]['id']}})[_0xd5d1('0x23')](handleEntityNotFound(_0x32aaaa,null))[_0xd5d1('0x23')](function(_0x467178){if(_0x467178){_0x4894c0=_0x467178;_0x1b2aaf[_0xd5d1('0x2f')]=_['keys'](db['Action']['rawAttributes']);_0x1b2aaf['query']=_[_0xd5d1('0x2d')](_0x291abf[_0xd5d1('0x2c')]);_0x1b2aaf[_0xd5d1('0x36')]=_[_0xd5d1('0x2e')](_0x1b2aaf[_0xd5d1('0x2f')],_0x1b2aaf[_0xd5d1('0x2c')]);_0x3d7d1e['attributes']=_['intersection'](_0x1b2aaf['model'],qs[_0xd5d1('0x31')](_0x291abf[_0xd5d1('0x2c')][_0xd5d1('0x31')]));_0x3d7d1e[_0xd5d1('0x30')]=_0x3d7d1e[_0xd5d1('0x30')][_0xd5d1('0x32')]?_0x3d7d1e[_0xd5d1('0x30')]:_0x1b2aaf[_0xd5d1('0x2f')];_0x3d7d1e[_0xd5d1('0x33')]=qs[_0xd5d1('0x34')](_0x291abf[_0xd5d1('0x2c')][_0xd5d1('0x34')]);_0x3d7d1e[_0xd5d1('0x35')]=qs[_0xd5d1('0x36')](_['pick'](_0x291abf[_0xd5d1('0x2c')],_0x1b2aaf[_0xd5d1('0x36')]));if(_0x291abf[_0xd5d1('0x2c')][_0xd5d1('0x38')]){_0x3d7d1e['where']=_['merge'](_0x3d7d1e[_0xd5d1('0x35')],{'$or':_[_0xd5d1('0x3a')](_0x3d7d1e[_0xd5d1('0x30')],function(_0x22a62a){var _0x32c086={};_0x32c086[_0x22a62a]={'$like':'%'+_0x291abf['query'][_0xd5d1('0x38')]+'%'};return _0x32c086;})});}_0x3d7d1e=_[_0xd5d1('0x39')]({},_0x3d7d1e,_0x291abf[_0xd5d1('0x3c')]);return _0x4894c0[_0xd5d1('0x4f')](_0x3d7d1e);}})[_0xd5d1('0x23')](function(_0x47bf86){if(_0x47bf86){_0x5b70c8=_0x47bf86[_0xd5d1('0x32')];if(!_0x291abf[_0xd5d1('0x2c')][_0xd5d1('0x51')]('nolimit')){_0x3d7d1e[_0xd5d1('0x1e')]=qs[_0xd5d1('0x1e')](_0x291abf[_0xd5d1('0x2c')]['limit']);_0x3d7d1e[_0xd5d1('0x1b')]=qs[_0xd5d1('0x1b')](_0x291abf[_0xd5d1('0x2c')]['offset']);}return _0x4894c0[_0xd5d1('0x4f')](_0x3d7d1e);}})[_0xd5d1('0x23')](function(_0x50754b){if(_0x50754b){return _0x50754b?{'count':_0x5b70c8,'rows':_0x50754b}:null;}})[_0xd5d1('0x23')](respondWithResult(_0x32aaaa,null))[_0xd5d1('0x41')](handleError(_0x32aaaa,null));};
\ No newline at end of file
index 25e98ec..12139a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x242f=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations'];(function(_0x4978dd,_0x2fc5a2){var _0xfcdc68=function(_0x2b3352){while(--_0x2b3352){_0x4978dd['push'](_0x4978dd['shift']());}};_0xfcdc68(++_0x2fc5a2);}(_0x242f,0x126));var _0xf242=function(_0x41591c,_0x1f7594){_0x41591c=_0x41591c-0x0;var _0x1959be=_0x242f[_0x41591c];return _0x1959be;};'use strict';var _=require(_0xf242('0x0'));var util=require(_0xf242('0x1'));var logger=require(_0xf242('0x2'))(_0xf242('0x3'));var moment=require(_0xf242('0x4'));var BPromise=require(_0xf242('0x5'));var rp=require(_0xf242('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf242('0x7'));var config=require(_0xf242('0x8'));var attributes=require(_0xf242('0x9'));module[_0xf242('0xa')]=function(_0xfeec3f,_0x3cdcf5){return _0xfeec3f[_0xf242('0xb')](_0xf242('0xc'),attributes,{'tableName':_0xf242('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc6af=['../../config/environment','exports','define','Automation','tools_automations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4b8678,_0x3ad871){var _0x282bfd=function(_0x30d46){while(--_0x30d46){_0x4b8678['push'](_0x4b8678['shift']());}};_0x282bfd(++_0x3ad871);}(_0xc6af,0xfc));var _0xfc6a=function(_0x5e22a3,_0x3a67d0){_0x5e22a3=_0x5e22a3-0x0;var _0x82f75a=_0xc6af[_0x5e22a3];return _0x82f75a;};'use strict';var _=require(_0xfc6a('0x0'));var util=require(_0xfc6a('0x1'));var logger=require(_0xfc6a('0x2'))(_0xfc6a('0x3'));var moment=require(_0xfc6a('0x4'));var BPromise=require(_0xfc6a('0x5'));var rp=require(_0xfc6a('0x6'));var fs=require('fs');var path=require(_0xfc6a('0x7'));var rimraf=require('rimraf');var config=require(_0xfc6a('0x8'));var attributes=require('./automation.attributes');module[_0xfc6a('0x9')]=function(_0x3b4ef8,_0x11957e){return _0x3b4ef8[_0xfc6a('0xa')](_0xfc6a('0xb'),attributes,{'tableName':_0xfc6a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e13bf71..bc2c440 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0598=['../../config/utils','jayson/promise','client','info','Automation,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','util','bluebird','../../mysqldb'];(function(_0x1bfe13,_0x42661f){var _0x1ff87e=function(_0xe32a64){while(--_0xe32a64){_0x1bfe13['push'](_0x1bfe13['shift']());}};_0x1ff87e(++_0x42661f);}(_0x0598,0x92));var _0x8059=function(_0xcb9ade,_0x133200){_0xcb9ade=_0xcb9ade-0x0;var _0xde8748=_0x0598[_0xcb9ade];return _0xde8748;};'use strict';var _=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var moment=require('moment');var BPromise=require(_0x8059('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8059('0x3'))['db'];var utils=require(_0x8059('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8059('0x5'));var client=jayson[_0x8059('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5996d7,_0x248273,_0x347f1b){return new BPromise(function(_0x4610d2,_0x116946){return client['request'](_0x5996d7,_0x347f1b)['then'](function(_0x89dda1){logger[_0x8059('0x7')](_0x8059('0x8'),_0x248273,_0x8059('0x9'));logger[_0x8059('0xa')]('Automation,\x20%s,\x20%s,\x20%s',_0x248273,'request\x20sent',JSON[_0x8059('0xb')](_0x89dda1));if(_0x89dda1[_0x8059('0xc')]){if(_0x89dda1['error']['code']===0x1f4){logger['error'](_0x8059('0x8'),_0x248273,_0x89dda1[_0x8059('0xc')][_0x8059('0xd')]);return _0x116946(_0x89dda1[_0x8059('0xc')][_0x8059('0xd')]);}logger['error'](_0x8059('0x8'),_0x248273,_0x89dda1['error'][_0x8059('0xd')]);return _0x4610d2(_0x89dda1['error'][_0x8059('0xd')]);}else{logger[_0x8059('0x7')](_0x8059('0x8'),_0x248273,'request\x20sent');_0x4610d2(_0x89dda1['result']['message']);}})[_0x8059('0xe')](function(_0x239195){logger[_0x8059('0xc')](_0x8059('0x8'),_0x248273,_0x239195);_0x116946(_0x239195);});});}
\ No newline at end of file
+var _0x866a=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird'];(function(_0x3390e9,_0x1846ea){var _0x6aa5a7=function(_0x351272){while(--_0x351272){_0x3390e9['push'](_0x3390e9['shift']());}};_0x6aa5a7(++_0x1846ea);}(_0x866a,0x156));var _0xa866=function(_0x1acfb9,_0x52bc80){_0x1acfb9=_0x1acfb9-0x0;var _0x1416e3=_0x866a[_0x1acfb9];return _0x1416e3;};'use strict';var _=require('lodash');var util=require(_0xa866('0x0'));var moment=require(_0xa866('0x1'));var BPromise=require(_0xa866('0x2'));var rs=require(_0xa866('0x3'));var fs=require('fs');var Redis=require(_0xa866('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa866('0x5'));var logger=require(_0xa866('0x6'))(_0xa866('0x7'));var config=require('../../config/environment');var jayson=require(_0xa866('0x8'));var client=jayson[_0xa866('0x9')][_0xa866('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x288582,_0x3d1380,_0x2c7278){return new BPromise(function(_0x41a92a,_0x208625){return client[_0xa866('0xb')](_0x288582,_0x2c7278)[_0xa866('0xc')](function(_0x525ce6){logger[_0xa866('0xd')](_0xa866('0xe'),_0x3d1380,_0xa866('0xf'));logger['debug'](_0xa866('0x10'),_0x3d1380,_0xa866('0xf'),JSON[_0xa866('0x11')](_0x525ce6));if(_0x525ce6[_0xa866('0x12')]){if(_0x525ce6[_0xa866('0x12')][_0xa866('0x13')]===0x1f4){logger['error'](_0xa866('0xe'),_0x3d1380,_0x525ce6[_0xa866('0x12')][_0xa866('0x14')]);return _0x208625(_0x525ce6[_0xa866('0x12')]['message']);}logger[_0xa866('0x12')]('Automation,\x20%s,\x20%s',_0x3d1380,_0x525ce6[_0xa866('0x12')]['message']);return _0x41a92a(_0x525ce6[_0xa866('0x12')][_0xa866('0x14')]);}else{logger[_0xa866('0xd')]('Automation,\x20%s,\x20%s',_0x3d1380,_0xa866('0xf'));_0x41a92a(_0x525ce6[_0xa866('0x15')][_0xa866('0x14')]);}})[_0xa866('0x16')](function(_0x1e2211){logger[_0xa866('0x12')](_0xa866('0xe'),_0x3d1380,_0x1e2211);_0x208625(_0x1e2211);});});}
\ No newline at end of file
index 6833f14..dad47f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x51f8=['util','path','express','fs-extra','../../components/auth/service','../../config/environment','./automation.controller','get','isAuthenticated','index','show','/:id/conditions','/:id/actions','getActions','post','addConditions','put','/:id','update','destroy','exports','multer'];(function(_0x49c6cc,_0x308bdb){var _0x22e239=function(_0x48507d){while(--_0x48507d){_0x49c6cc['push'](_0x49c6cc['shift']());}};_0x22e239(++_0x308bdb);}(_0x51f8,0x15f));var _0x851f=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x51f8[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x851f('0x0'));var util=require(_0x851f('0x1'));var path=require(_0x851f('0x2'));var timeout=require('connect-timeout');var express=require(_0x851f('0x3'));var router=express['Router']();var fs_extra=require(_0x851f('0x4'));var auth=require(_0x851f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x851f('0x6'));var controller=require(_0x851f('0x7'));router[_0x851f('0x8')]('/',auth[_0x851f('0x9')](),controller[_0x851f('0xa')]);router[_0x851f('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x851f('0xb')]);router['get'](_0x851f('0xc'),auth['isAuthenticated'](),controller['getConditions']);router[_0x851f('0x8')](_0x851f('0xd'),auth[_0x851f('0x9')](),controller[_0x851f('0xe')]);router[_0x851f('0xf')]('/',auth[_0x851f('0x9')](),controller['create']);router['post'](_0x851f('0xc'),auth[_0x851f('0x9')](),controller[_0x851f('0x10')]);router[_0x851f('0xf')]('/:id/actions',auth[_0x851f('0x9')](),controller['addActions']);router[_0x851f('0x11')](_0x851f('0x12'),auth['isAuthenticated'](),controller[_0x851f('0x13')]);router['delete'](_0x851f('0x12'),auth[_0x851f('0x9')](),controller[_0x851f('0x14')]);module[_0x851f('0x15')]=router;
\ No newline at end of file
+var _0x92bc=['/:id/conditions','getActions','create','post','addConditions','/:id/actions','addActions','put','update','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','get','isAuthenticated','/:id'];(function(_0xe641a8,_0x20549f){var _0x7d69f2=function(_0x4bc7f4){while(--_0x4bc7f4){_0xe641a8['push'](_0xe641a8['shift']());}};_0x7d69f2(++_0x20549f);}(_0x92bc,0x106));var _0xc92b=function(_0x4dddff,_0x4d3142){_0x4dddff=_0x4dddff-0x0;var _0x53429f=_0x92bc[_0x4dddff];return _0x53429f;};'use strict';var multer=require(_0xc92b('0x0'));var util=require(_0xc92b('0x1'));var path=require(_0xc92b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc92b('0x3')]();var fs_extra=require(_0xc92b('0x4'));var auth=require(_0xc92b('0x5'));var interaction=require(_0xc92b('0x6'));var config=require('../../config/environment');var controller=require(_0xc92b('0x7'));router[_0xc92b('0x8')]('/',auth[_0xc92b('0x9')](),controller['index']);router['get'](_0xc92b('0xa'),auth[_0xc92b('0x9')](),controller['show']);router[_0xc92b('0x8')](_0xc92b('0xb'),auth[_0xc92b('0x9')](),controller['getConditions']);router[_0xc92b('0x8')]('/:id/actions',auth['isAuthenticated'](),controller[_0xc92b('0xc')]);router['post']('/',auth[_0xc92b('0x9')](),controller[_0xc92b('0xd')]);router[_0xc92b('0xe')](_0xc92b('0xb'),auth[_0xc92b('0x9')](),controller[_0xc92b('0xf')]);router[_0xc92b('0xe')](_0xc92b('0x10'),auth[_0xc92b('0x9')](),controller[_0xc92b('0x11')]);router[_0xc92b('0x12')](_0xc92b('0xa'),auth[_0xc92b('0x9')](),controller[_0xc92b('0x13')]);router['delete'](_0xc92b('0xa'),auth[_0xc92b('0x9')](),controller['destroy']);module[_0xc92b('0x14')]=router;
\ No newline at end of file
index fa3d072..eff75be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x158d=['#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','onlyIfOpen','always','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0x158d,0x1a2));var _0xd158=function(_0x2962d5,_0x38deda){_0x2962d5=_0x2962d5-0x0;var _0x273406=_0x158d[_0x2962d5];return _0x273406;};'use strict';var Sequelize=require(_0xd158('0x0'));module['exports']={'name':{'type':Sequelize[_0xd158('0x1')],'unique':_0xd158('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xd158('0x3')](_0xd158('0x4')),'allowNull':![],'defaultValue':_0xd158('0x4')},'description':{'type':Sequelize[_0xd158('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xd158('0x5')},'limitCalls':{'type':Sequelize[_0xd158('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0xd158('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xd158('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xd158('0x6')](0x3)[_0xd158('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xd158('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd158('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xd158('0x6')](0x5)[_0xd158('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd158('0x9')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd158('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd158('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0xd158('0x6')](0x5)[_0xd158('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd158('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xd158('0x6')](0x3)[_0xd158('0x7')],'defaultValue':0x3,'comment':_0xd158('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xd158('0x6')](0x5)[_0xd158('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd158('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0xd158('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xd158('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xd158('0x1')],'defaultValue':_0xd158('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0xd158('0x3')]('always','never',_0xd158('0xf')),'defaultValue':_0xd158('0x10')},'dialAMDActive':{'type':Sequelize[_0xd158('0x11')],'defaultValue':0x0,'comment':_0xd158('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0xd158('0x6')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xd158('0x13')},'dialAMDGreeting':{'type':Sequelize[_0xd158('0x6')](0x9)[_0xd158('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xd158('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xd158('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xd158('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xd158('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd158('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xd158('0x6')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xd158('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xd158('0x6')](0x9)[_0xd158('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xd158('0x6')](0x9)[_0xd158('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xd158('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xd158('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xd158('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xd158('0x6')](0x9)[_0xd158('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd158('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0xd158('0x3')](_0xd158('0x1b'),_0xd158('0x1c')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xd158('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xd158('0x6')](0x3)[_0xd158('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xd158('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd158('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xd158('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd158('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xd158('0x6')](0x5)[_0xd158('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xd158('0x6')](0x3)[_0xd158('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd158('0x1f')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd158('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd158('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xd158('0x6')](0x3)[_0xd158('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd158('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xd158('0x6')](0x5)[_0xd158('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd158('0x22')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xd158('0x6')](0x5)[_0xd158('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd158('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xd158('0x6')](0x3)[_0xd158('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd158('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xd158('0x6')](0x5)[_0xd158('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
+var _0x46bc=['07:00-22:00,*,*,*','never','Active/Disactive\x20AMD','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'];(function(_0x48df39,_0x2c45ea){var _0x1fb019=function(_0x3d9d7a){while(--_0x3d9d7a){_0x48df39['push'](_0x48df39['shift']());}};_0x1fb019(++_0x2c45ea);}(_0x46bc,0xe6));var _0xc46b=function(_0x1a1b6e,_0x3a07a9){_0x1a1b6e=_0x1a1b6e-0x0;var _0x571e2c=_0x46bc[_0x1a1b6e];return _0x571e2c;};'use strict';var Sequelize=require(_0xc46b('0x0'));module[_0xc46b('0x1')]={'name':{'type':Sequelize[_0xc46b('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xc46b('0x3')](_0xc46b('0x4')),'allowNull':![],'defaultValue':_0xc46b('0x4')},'description':{'type':Sequelize[_0xc46b('0x2')]},'active':{'type':Sequelize[_0xc46b('0x5')],'defaultValue':0x0,'comment':_0xc46b('0x6')},'limitCalls':{'type':Sequelize[_0xc46b('0x7')](0x4)[_0xc46b('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xc46b('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0xc46b('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xc46b('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xc46b('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc46b('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0xc46b('0x7')](0x3)[_0xc46b('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc46b('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xc46b('0x7')](0x5)[_0xc46b('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xc46b('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xc46b('0x7')](0x5)[_0xc46b('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc46b('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xc46b('0x7')](0x3)[_0xc46b('0x8')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc46b('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc46b('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0xc46b('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xc46b('0xe')},'dialTimezone':{'type':Sequelize[_0xc46b('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xc46b('0x2')],'defaultValue':_0xc46b('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xc46b('0x3')]('always',_0xc46b('0x10'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xc46b('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0xc46b('0x7')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xc46b('0x7')](0x9)[_0xc46b('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xc46b('0x7')](0x9)[_0xc46b('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xc46b('0x12')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xc46b('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc46b('0x13')},'dialAMDMinWordLength':{'type':Sequelize[_0xc46b('0x7')](0x9)[_0xc46b('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xc46b('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xc46b('0x7')](0x9)[_0xc46b('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xc46b('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xc46b('0x7')](0x9)[_0xc46b('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xc46b('0x7')](0x5)[_0xc46b('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xc46b('0x16')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc46b('0x7')](0x9)[_0xc46b('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc46b('0x17')},'dialOrderByScheduledAt':{'type':Sequelize[_0xc46b('0x3')](_0xc46b('0x18'),_0xc46b('0x19')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc46b('0x1a')},'dialCutDigit':{'type':Sequelize[_0xc46b('0x7')](0x3)[_0xc46b('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc46b('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xc46b('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc46b('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xc46b('0x7')](0x5)[_0xc46b('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc46b('0x1d')},'dialDropMaxRetry':{'type':Sequelize[_0xc46b('0x7')](0x3)[_0xc46b('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc46b('0x1e')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc46b('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xc46b('0x7')](0x3)[_0xc46b('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc46b('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc46b('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc46b('0x20')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc46b('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xc46b('0x7')](0x5)[_0xc46b('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc46b('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xc46b('0x7')](0x3)[_0xc46b('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xc46b('0x7')](0x5)[_0xc46b('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc46b('0x22')}};
\ No newline at end of file
index 3314f63..40747d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ec9=['index','Campaign','rawAttributes','type','model','query','keys','filters','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','show','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','intersection','omit','createdAt','updatedAt','UserProfileSection','userProfileId','getHoppers','CmHopper','nolimit','map','rows','CmHopperHistory','CampaignId','findOne','CmHopperFinal','getHopperBlacks','order','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','select','field','CmListId','toString','NOW()','from','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','ContactId','cm_contacts','ListId\x20=\x20?','CampaignId\x20=\x20?','push','sequelize','all','removeLists','CmList','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','bluebird','path','sox','ejs','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','stack','name','send'];(function(_0x4e7bb0,_0x1f38f9){var _0x41ca13=function(_0x439293){while(--_0x439293){_0x4e7bb0['push'](_0x4e7bb0['shift']());}};_0x41ca13(++_0x1f38f9);}(_0x0ec9,0x1e6));var _0x90ec=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x0ec9[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0x90ec('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x90ec('0x1'));var jsonpatch=require(_0x90ec('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x90ec('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x90ec('0x4'));var sox=require(_0x90ec('0x5'));var csv=require('to-csv');var ejs=require(_0x90ec('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x90ec('0x7'));var squel=require(_0x90ec('0x8'));var crypto=require('crypto');var jsforce=require(_0x90ec('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x90ec('0xa'));var querystring=require(_0x90ec('0xb'));var Papa=require('papaparse');var Redis=require(_0x90ec('0xc'));var authService=require(_0x90ec('0xd'));var qs=require(_0x90ec('0xe'));var as=require(_0x90ec('0xf'));var hardwareService=require(_0x90ec('0x10'));var logger=require(_0x90ec('0x11'))(_0x90ec('0x12'));var utils=require(_0x90ec('0x13'));var config=require(_0x90ec('0x14'));var licenseUtil=require(_0x90ec('0x15'));var db=require(_0x90ec('0x16'))['db'];function respondWithStatusCode(_0x4dd724,_0x441326){_0x441326=_0x441326||0xcc;return function(_0x27378b){if(_0x27378b){return _0x4dd724[_0x90ec('0x17')](_0x441326);}return _0x4dd724[_0x90ec('0x18')](_0x441326)[_0x90ec('0x19')]();};}function respondWithResult(_0xe0c123,_0x172d14){_0x172d14=_0x172d14||0xc8;return function(_0x2e8f9d){if(_0x2e8f9d){return _0xe0c123['status'](_0x172d14)[_0x90ec('0x1a')](_0x2e8f9d);}};}function respondWithFilteredResult(_0x30afa3,_0x28b500){return function(_0x2c05ed){if(_0x2c05ed){var _0x4478ef=typeof _0x28b500[_0x90ec('0x1b')]===_0x90ec('0x1c')&&typeof _0x28b500[_0x90ec('0x1d')]==='undefined';var _0x594ef4=_0x2c05ed[_0x90ec('0x1e')];var _0x5d4227=_0x4478ef?0x0:_0x28b500[_0x90ec('0x1b')];var _0x390aaf=_0x4478ef?_0x2c05ed['count']:_0x28b500[_0x90ec('0x1b')]+_0x28b500[_0x90ec('0x1d')];var _0x5c6d8b;if(_0x390aaf>=_0x594ef4){_0x390aaf=_0x594ef4;_0x5c6d8b=0xc8;}else{_0x5c6d8b=0xce;}_0x30afa3[_0x90ec('0x18')](_0x5c6d8b);return _0x30afa3['set']('Content-Range',_0x5d4227+'-'+_0x390aaf+'/'+_0x594ef4)[_0x90ec('0x1a')](_0x2c05ed);}return null;};}function patchUpdates(_0x6b215a){return function(_0x2b081b){try{jsonpatch['apply'](_0x2b081b,_0x6b215a,!![]);}catch(_0x20e321){return BPromise[_0x90ec('0x1f')](_0x20e321);}return _0x2b081b[_0x90ec('0x20')]();};}function saveUpdates(_0x5f23c0,_0x4111f6){return function(_0x7ef417){if(_0x7ef417){return _0x7ef417[_0x90ec('0x21')](_0x5f23c0)[_0x90ec('0x22')](function(_0x9f44ef){return _0x9f44ef;});}return null;};}function removeEntity(_0xd1bc12,_0x4cd3f1){return function(_0x475670){if(_0x475670){return _0x475670[_0x90ec('0x23')]()[_0x90ec('0x22')](function(){var _0x3eefd4=_0x475670[_0x90ec('0x24')]({'plain':!![]});var _0x25dd74=_0x90ec('0x25');return db[_0x90ec('0x26')][_0x90ec('0x23')]({'where':{'type':_0x25dd74,'resourceId':_0x3eefd4['id']}})['then'](function(){return _0x475670;});})[_0x90ec('0x22')](function(){_0xd1bc12[_0x90ec('0x18')](0xcc)[_0x90ec('0x19')]();});}};}function handleEntityNotFound(_0x1efeb4,_0x3f4ce4){return function(_0x41b5ac){if(!_0x41b5ac){_0x1efeb4[_0x90ec('0x17')](0x194);}return _0x41b5ac;};}function handleError(_0x3e1a5b,_0x22377b){_0x22377b=_0x22377b||0x1f4;return function(_0x41f8ff){logger['error'](_0x41f8ff[_0x90ec('0x27')]);if(_0x41f8ff[_0x90ec('0x28')]){delete _0x41f8ff[_0x90ec('0x28')];}_0x3e1a5b[_0x90ec('0x18')](_0x22377b)[_0x90ec('0x29')](_0x41f8ff);};}exports[_0x90ec('0x2a')]=function(_0x17cfa7,_0x251b04){var _0x55d52b={},_0x3720ac={},_0x4005cb={'count':0x0,'rows':[]};var _0x48b797=_['map'](db[_0x90ec('0x2b')][_0x90ec('0x2c')],function(_0x15ff03){return{'name':_0x15ff03['fieldName'],'type':_0x15ff03[_0x90ec('0x2d')]['key']};});_0x3720ac[_0x90ec('0x2e')]=_['map'](_0x48b797,_0x90ec('0x28'));_0x3720ac[_0x90ec('0x2f')]=_[_0x90ec('0x30')](_0x17cfa7[_0x90ec('0x2f')]);_0x3720ac[_0x90ec('0x31')]=_['intersection'](_0x3720ac[_0x90ec('0x2e')],_0x3720ac[_0x90ec('0x2f')]);_0x55d52b['attributes']=_['intersection'](_0x3720ac[_0x90ec('0x2e')],qs[_0x90ec('0x32')](_0x17cfa7[_0x90ec('0x2f')][_0x90ec('0x32')]));_0x55d52b[_0x90ec('0x33')]=_0x55d52b['attributes'][_0x90ec('0x34')]?_0x55d52b[_0x90ec('0x33')]:_0x3720ac[_0x90ec('0x2e')];if(!_0x17cfa7[_0x90ec('0x2f')][_0x90ec('0x35')]('nolimit')){_0x55d52b['limit']=qs[_0x90ec('0x1d')](_0x17cfa7[_0x90ec('0x2f')][_0x90ec('0x1d')]);_0x55d52b[_0x90ec('0x1b')]=qs[_0x90ec('0x1b')](_0x17cfa7['query'][_0x90ec('0x1b')]);}_0x55d52b['order']=qs[_0x90ec('0x36')](_0x17cfa7[_0x90ec('0x2f')]['sort']);_0x55d52b['where']=qs[_0x90ec('0x31')](_[_0x90ec('0x37')](_0x17cfa7[_0x90ec('0x2f')],_0x3720ac['filters']),_0x48b797);if(_0x17cfa7[_0x90ec('0x2f')][_0x90ec('0x38')]){_0x55d52b[_0x90ec('0x39')]=_[_0x90ec('0x3a')](_0x55d52b[_0x90ec('0x39')],{'$or':_['map'](_0x48b797,function(_0x218dea){if(_0x218dea['type']!==_0x90ec('0x3b')){var _0x7ec13d={};_0x7ec13d[_0x218dea[_0x90ec('0x28')]]={'$like':'%'+_0x17cfa7[_0x90ec('0x2f')][_0x90ec('0x38')]+'%'};return _0x7ec13d;}})});}_0x55d52b=_[_0x90ec('0x3a')]({},_0x55d52b,_0x17cfa7[_0x90ec('0x3c')]);var _0x36a880={'where':_0x55d52b[_0x90ec('0x39')]};return db[_0x90ec('0x2b')][_0x90ec('0x1e')](_0x36a880)[_0x90ec('0x22')](function(_0x2715f2){_0x4005cb[_0x90ec('0x1e')]=_0x2715f2;if(_0x17cfa7['query']['includeAll']){_0x55d52b[_0x90ec('0x3d')]=[{'all':!![]}];}return db[_0x90ec('0x2b')][_0x90ec('0x3e')](_0x55d52b);})['then'](function(_0xdc1215){_0x4005cb['rows']=_0xdc1215;return _0x4005cb;})['then'](respondWithFilteredResult(_0x251b04,_0x55d52b))['catch'](handleError(_0x251b04,null));};exports[_0x90ec('0x3f')]=function(_0x2b78a8,_0x1fd5c1){var _0x3dcbaa={'raw':![],'where':{'id':_0x2b78a8['params']['id']}},_0x83b3b7={};_0x83b3b7['model']=_[_0x90ec('0x30')](db[_0x90ec('0x2b')][_0x90ec('0x2c')]);_0x83b3b7['query']=_[_0x90ec('0x30')](_0x2b78a8[_0x90ec('0x2f')]);_0x83b3b7[_0x90ec('0x31')]=_['intersection'](_0x83b3b7[_0x90ec('0x2e')],_0x83b3b7[_0x90ec('0x2f')]);_0x3dcbaa[_0x90ec('0x33')]=_['intersection'](_0x83b3b7[_0x90ec('0x2e')],qs[_0x90ec('0x32')](_0x2b78a8[_0x90ec('0x2f')]['fields']));_0x3dcbaa[_0x90ec('0x33')]=_0x3dcbaa[_0x90ec('0x33')][_0x90ec('0x34')]?_0x3dcbaa['attributes']:_0x83b3b7[_0x90ec('0x2e')];if(_0x2b78a8['query'][_0x90ec('0x40')]){_0x3dcbaa[_0x90ec('0x3d')]=[{'all':!![]}];}_0x3dcbaa=_[_0x90ec('0x3a')]({},_0x3dcbaa,_0x2b78a8[_0x90ec('0x3c')]);return db[_0x90ec('0x2b')][_0x90ec('0x41')](_0x3dcbaa)['then'](handleEntityNotFound(_0x1fd5c1,null))[_0x90ec('0x22')](respondWithResult(_0x1fd5c1,null))['catch'](handleError(_0x1fd5c1,null));};exports['create']=function(_0x5920da,_0x492cdb){return db[_0x90ec('0x2b')][_0x90ec('0x42')](_0x5920da[_0x90ec('0x43')],{})[_0x90ec('0x22')](function(_0x1f336a){var _0x2264f5=_0x5920da[_0x90ec('0x44')][_0x90ec('0x24')]({'plain':!![]});if(!_0x2264f5)throw new Error(_0x90ec('0x45'));if(_0x2264f5[_0x90ec('0x46')]===_0x90ec('0x44')){var _0x2e498f=_0x1f336a['get']({'plain':!![]});var _0x5d60e8=_0x90ec('0x25');return db['UserProfileSection'][_0x90ec('0x41')]({'where':{'name':_0x5d60e8,'userProfileId':_0x2264f5['userProfileId']},'raw':!![]})['then'](function(_0x330d08){if(_0x330d08&&_0x330d08['autoAssociation']===0x0){return db[_0x90ec('0x26')][_0x90ec('0x42')]({'name':_0x2e498f['name'],'resourceId':_0x2e498f['id'],'type':_0x330d08[_0x90ec('0x28')],'sectionId':_0x330d08['id']},{})[_0x90ec('0x22')](function(){return _0x1f336a;});}else{return _0x1f336a;}})[_0x90ec('0x47')](function(_0xf35647){logger[_0x90ec('0x48')](_0x90ec('0x49'),_0xf35647);throw _0xf35647;});}return _0x1f336a;})['then'](respondWithResult(_0x492cdb,0xc9))[_0x90ec('0x47')](handleError(_0x492cdb,null));};exports[_0x90ec('0x4a')]=function(_0x2dfca2,_0x5e53e7){var _0x256029={'where':{'id':_0x2dfca2[_0x90ec('0x4b')]['id']}},_0x4fac6c={};_0x4fac6c[_0x90ec('0x2e')]=_[_0x90ec('0x30')](db[_0x90ec('0x2b')]['rawAttributes']);_0x256029[_0x90ec('0x33')]=_[_0x90ec('0x4c')](_0x4fac6c['model'],qs[_0x90ec('0x32')](_0x2dfca2[_0x90ec('0x2f')][_0x90ec('0x32')]));_0x256029[_0x90ec('0x33')]=_0x256029['attributes']['length']?_0x256029[_0x90ec('0x33')]:_0x4fac6c[_0x90ec('0x2e')];if(_0x2dfca2['query']['includeAll']){_0x256029[_0x90ec('0x3d')]=[{'all':!![]}];}_0x256029=_[_0x90ec('0x3a')]({},_0x256029,_0x2dfca2[_0x90ec('0x3c')]);return db['Campaign'][_0x90ec('0x41')](_0x256029)['then'](handleEntityNotFound(_0x5e53e7,null))[_0x90ec('0x22')](function(_0x2029b3){if(_0x2029b3){var _0x2aeac9=_0x2029b3['get']({'plain':!![]});_0x2aeac9=qs[_0x90ec('0x4d')](_0x2aeac9,['id',_0x90ec('0x4e'),_0x90ec('0x4f')]);_0x2dfca2['body']=_[_0x90ec('0x4d')](_0x2dfca2[_0x90ec('0x43')],['id',_0x90ec('0x4e'),_0x90ec('0x4f')]);return db[_0x90ec('0x2b')][_0x90ec('0x42')](_[_0x90ec('0x3a')](_0x2aeac9,_0x2dfca2[_0x90ec('0x43')]),{'include':_0x2dfca2[_0x90ec('0x2f')][_0x90ec('0x40')]?[{'all':!![]}]:undefined})[_0x90ec('0x22')](function(_0x3c759e){var _0x324ba5=_0x2dfca2[_0x90ec('0x44')][_0x90ec('0x24')]({'plain':!![]});if(!_0x324ba5)throw new Error(_0x90ec('0x45'));if(_0x324ba5[_0x90ec('0x46')]===_0x90ec('0x44')){var _0x5ddea2=_0x3c759e[_0x90ec('0x24')]({'plain':!![]});var _0x418240='IvrCampaigns';return db[_0x90ec('0x50')][_0x90ec('0x41')]({'where':{'name':_0x418240,'userProfileId':_0x324ba5[_0x90ec('0x51')]},'raw':!![]})[_0x90ec('0x22')](function(_0x4c3df1){if(_0x4c3df1&&_0x4c3df1['autoAssociation']===0x0){return db[_0x90ec('0x26')][_0x90ec('0x42')]({'name':_0x5ddea2[_0x90ec('0x28')],'resourceId':_0x5ddea2['id'],'type':_0x4c3df1['name'],'sectionId':_0x4c3df1['id']},{})[_0x90ec('0x22')](function(){return _0x3c759e;});}else{return _0x3c759e;}})['catch'](function(_0x51dd22){logger[_0x90ec('0x48')](_0x90ec('0x49'),_0x51dd22);throw _0x51dd22;});}return _0x3c759e;});}})[_0x90ec('0x22')](respondWithResult(_0x5e53e7,0xc9))['catch'](handleError(_0x5e53e7,null));};exports['update']=function(_0x4fd42a,_0x217e35){if(_0x4fd42a[_0x90ec('0x43')]['id']){delete _0x4fd42a[_0x90ec('0x43')]['id'];}return db[_0x90ec('0x2b')][_0x90ec('0x41')]({'where':{'id':_0x4fd42a['params']['id']}})[_0x90ec('0x22')](handleEntityNotFound(_0x217e35,null))['then'](saveUpdates(_0x4fd42a['body'],null))[_0x90ec('0x22')](respondWithResult(_0x217e35,null))[_0x90ec('0x47')](handleError(_0x217e35,null));};exports['destroy']=function(_0x22c0ec,_0x34fce3){return db['Campaign'][_0x90ec('0x41')]({'where':{'id':_0x22c0ec['params']['id']}})['then'](handleEntityNotFound(_0x34fce3,null))['then'](removeEntity(_0x34fce3,null))[_0x90ec('0x47')](handleError(_0x34fce3,null));};exports[_0x90ec('0x52')]=function(_0x51f571,_0x281879,_0x539239){var _0x776f3f={'raw':!![],'where':{}};var _0x219fcd={};var _0x1f9980={'count':0x0,'rows':[]};return db[_0x90ec('0x2b')]['findOne']({'where':{'id':_0x51f571[_0x90ec('0x4b')]['id']}})['then'](handleEntityNotFound(_0x281879,null))['then'](function(_0x1d911b){if(_0x1d911b){_0x219fcd[_0x90ec('0x2e')]=_[_0x90ec('0x30')](db[_0x90ec('0x53')][_0x90ec('0x2c')]);_0x219fcd[_0x90ec('0x2f')]=_[_0x90ec('0x30')](_0x51f571[_0x90ec('0x2f')]);_0x219fcd['filters']=_[_0x90ec('0x4c')](_0x219fcd['model'],_0x219fcd[_0x90ec('0x2f')]);_0x776f3f[_0x90ec('0x33')]=_[_0x90ec('0x4c')](_0x219fcd['model'],qs[_0x90ec('0x32')](_0x51f571['query'][_0x90ec('0x32')]));_0x776f3f[_0x90ec('0x33')]=_0x776f3f[_0x90ec('0x33')][_0x90ec('0x34')]?_0x776f3f['attributes']:_0x219fcd['model'];if(!_0x51f571[_0x90ec('0x2f')][_0x90ec('0x35')](_0x90ec('0x54'))){_0x776f3f[_0x90ec('0x1d')]=qs[_0x90ec('0x1d')](_0x51f571[_0x90ec('0x2f')]['limit']);_0x776f3f[_0x90ec('0x1b')]=qs[_0x90ec('0x1b')](_0x51f571[_0x90ec('0x2f')][_0x90ec('0x1b')]);}_0x776f3f['order']=qs[_0x90ec('0x36')](_0x51f571[_0x90ec('0x2f')][_0x90ec('0x36')]);_0x776f3f[_0x90ec('0x39')]=qs[_0x90ec('0x31')](_[_0x90ec('0x37')](_0x51f571[_0x90ec('0x2f')],_0x219fcd[_0x90ec('0x31')]));_0x776f3f['where']['CampaignId']=_0x1d911b['id'];if(_0x51f571[_0x90ec('0x2f')][_0x90ec('0x38')]){_0x776f3f[_0x90ec('0x39')]=_[_0x90ec('0x3a')](_0x776f3f[_0x90ec('0x39')],{'$or':_[_0x90ec('0x55')](_0x776f3f[_0x90ec('0x33')],function(_0x2bcdfb){var _0x491061={};_0x491061[_0x2bcdfb]={'$like':'%'+_0x51f571['query'][_0x90ec('0x38')]+'%'};return _0x491061;})});}_0x776f3f=_['merge']({},_0x776f3f,_0x51f571[_0x90ec('0x3c')]);return db[_0x90ec('0x53')]['count']({'where':_0x776f3f[_0x90ec('0x39')]})[_0x90ec('0x22')](function(_0x13c36f){_0x1f9980[_0x90ec('0x1e')]=_0x13c36f;if(_0x51f571['query'][_0x90ec('0x40')]){_0x776f3f['include']=[{'all':!![]}];}return db[_0x90ec('0x53')][_0x90ec('0x3e')](_0x776f3f);})[_0x90ec('0x22')](function(_0x2fc5e2){_0x1f9980[_0x90ec('0x56')]=_0x2fc5e2;return _0x1f9980;});}})['then'](respondWithFilteredResult(_0x281879,_0x776f3f))[_0x90ec('0x47')](handleError(_0x281879,null));};exports['getHopperHistories']=function(_0x13d574,_0x261705,_0x5fc68b){var _0x627b98={'raw':!![],'where':{}};var _0x3242a6={};var _0x28b2e5={'count':0x0,'rows':[]};return db[_0x90ec('0x2b')]['findOne']({'where':{'id':_0x13d574[_0x90ec('0x4b')]['id']}})[_0x90ec('0x22')](handleEntityNotFound(_0x261705,null))[_0x90ec('0x22')](function(_0x4f6483){if(_0x4f6483){_0x3242a6[_0x90ec('0x2e')]=_['keys'](db[_0x90ec('0x57')]['rawAttributes']);_0x3242a6[_0x90ec('0x2f')]=_[_0x90ec('0x30')](_0x13d574[_0x90ec('0x2f')]);_0x3242a6[_0x90ec('0x31')]=_[_0x90ec('0x4c')](_0x3242a6['model'],_0x3242a6[_0x90ec('0x2f')]);_0x627b98['attributes']=_[_0x90ec('0x4c')](_0x3242a6[_0x90ec('0x2e')],qs[_0x90ec('0x32')](_0x13d574[_0x90ec('0x2f')][_0x90ec('0x32')]));_0x627b98[_0x90ec('0x33')]=_0x627b98[_0x90ec('0x33')][_0x90ec('0x34')]?_0x627b98[_0x90ec('0x33')]:_0x3242a6[_0x90ec('0x2e')];if(!_0x13d574[_0x90ec('0x2f')]['hasOwnProperty'](_0x90ec('0x54'))){_0x627b98['limit']=qs['limit'](_0x13d574[_0x90ec('0x2f')][_0x90ec('0x1d')]);_0x627b98['offset']=qs['offset'](_0x13d574[_0x90ec('0x2f')]['offset']);}_0x627b98['order']=qs['sort'](_0x13d574[_0x90ec('0x2f')][_0x90ec('0x36')]);_0x627b98['where']=qs['filters'](_[_0x90ec('0x37')](_0x13d574[_0x90ec('0x2f')],_0x3242a6[_0x90ec('0x31')]));_0x627b98[_0x90ec('0x39')][_0x90ec('0x58')]=_0x4f6483['id'];if(_0x13d574[_0x90ec('0x2f')][_0x90ec('0x38')]){_0x627b98[_0x90ec('0x39')]=_[_0x90ec('0x3a')](_0x627b98['where'],{'$or':_['map'](_0x627b98[_0x90ec('0x33')],function(_0x5157e2){var _0x5c0b38={};_0x5c0b38[_0x5157e2]={'$like':'%'+_0x13d574[_0x90ec('0x2f')]['filter']+'%'};return _0x5c0b38;})});}_0x627b98=_['merge']({},_0x627b98,_0x13d574[_0x90ec('0x3c')]);return db[_0x90ec('0x57')][_0x90ec('0x1e')]({'where':_0x627b98[_0x90ec('0x39')]})[_0x90ec('0x22')](function(_0x5b5f93){_0x28b2e5[_0x90ec('0x1e')]=_0x5b5f93;if(_0x13d574[_0x90ec('0x2f')]['includeAll']){_0x627b98[_0x90ec('0x3d')]=[{'all':!![]}];}return db[_0x90ec('0x57')]['findAll'](_0x627b98);})[_0x90ec('0x22')](function(_0x53bdc1){_0x28b2e5[_0x90ec('0x56')]=_0x53bdc1;return _0x28b2e5;});}})[_0x90ec('0x22')](respondWithFilteredResult(_0x261705,_0x627b98))[_0x90ec('0x47')](handleError(_0x261705,null));};exports['getHopperFinals']=function(_0x310f5b,_0x533ab5,_0x329f55){var _0xfa69b0={'raw':!![],'where':{}};var _0x19eaa4={};var _0x4b8aec={'count':0x0,'rows':[]};return db[_0x90ec('0x2b')][_0x90ec('0x59')]({'where':{'id':_0x310f5b[_0x90ec('0x4b')]['id']}})[_0x90ec('0x22')](handleEntityNotFound(_0x533ab5,null))[_0x90ec('0x22')](function(_0x29d0be){if(_0x29d0be){_0x19eaa4[_0x90ec('0x2e')]=_[_0x90ec('0x30')](db[_0x90ec('0x5a')][_0x90ec('0x2c')]);_0x19eaa4[_0x90ec('0x2f')]=_[_0x90ec('0x30')](_0x310f5b[_0x90ec('0x2f')]);_0x19eaa4[_0x90ec('0x31')]=_[_0x90ec('0x4c')](_0x19eaa4[_0x90ec('0x2e')],_0x19eaa4[_0x90ec('0x2f')]);_0xfa69b0[_0x90ec('0x33')]=_[_0x90ec('0x4c')](_0x19eaa4[_0x90ec('0x2e')],qs[_0x90ec('0x32')](_0x310f5b['query']['fields']));_0xfa69b0[_0x90ec('0x33')]=_0xfa69b0['attributes'][_0x90ec('0x34')]?_0xfa69b0['attributes']:_0x19eaa4['model'];if(!_0x310f5b['query'][_0x90ec('0x35')](_0x90ec('0x54'))){_0xfa69b0[_0x90ec('0x1d')]=qs[_0x90ec('0x1d')](_0x310f5b[_0x90ec('0x2f')][_0x90ec('0x1d')]);_0xfa69b0['offset']=qs[_0x90ec('0x1b')](_0x310f5b[_0x90ec('0x2f')][_0x90ec('0x1b')]);}_0xfa69b0['order']=qs[_0x90ec('0x36')](_0x310f5b[_0x90ec('0x2f')][_0x90ec('0x36')]);_0xfa69b0['where']=qs['filters'](_[_0x90ec('0x37')](_0x310f5b['query'],_0x19eaa4[_0x90ec('0x31')]));_0xfa69b0[_0x90ec('0x39')][_0x90ec('0x58')]=_0x29d0be['id'];if(_0x310f5b[_0x90ec('0x2f')][_0x90ec('0x38')]){_0xfa69b0['where']=_[_0x90ec('0x3a')](_0xfa69b0[_0x90ec('0x39')],{'$or':_['map'](_0xfa69b0[_0x90ec('0x33')],function(_0x58a6cc){var _0x1c1856={};_0x1c1856[_0x58a6cc]={'$like':'%'+_0x310f5b[_0x90ec('0x2f')][_0x90ec('0x38')]+'%'};return _0x1c1856;})});}_0xfa69b0=_['merge']({},_0xfa69b0,_0x310f5b[_0x90ec('0x3c')]);return db['CmHopperFinal'][_0x90ec('0x1e')]({'where':_0xfa69b0[_0x90ec('0x39')]})[_0x90ec('0x22')](function(_0x3ca8bb){_0x4b8aec[_0x90ec('0x1e')]=_0x3ca8bb;if(_0x310f5b[_0x90ec('0x2f')][_0x90ec('0x40')]){_0xfa69b0[_0x90ec('0x3d')]=[{'all':!![]}];}return db[_0x90ec('0x5a')][_0x90ec('0x3e')](_0xfa69b0);})['then'](function(_0x443981){_0x4b8aec[_0x90ec('0x56')]=_0x443981;return _0x4b8aec;});}})['then'](respondWithFilteredResult(_0x533ab5,_0xfa69b0))[_0x90ec('0x47')](handleError(_0x533ab5,null));};exports[_0x90ec('0x5b')]=function(_0x4349c8,_0x1f6ea5,_0x1c6750){var _0x352dd5={'raw':!![],'where':{}};var _0xf3f377={};var _0x914a36={'count':0x0,'rows':[]};return db[_0x90ec('0x2b')][_0x90ec('0x59')]({'where':{'id':_0x4349c8['params']['id']}})['then'](handleEntityNotFound(_0x1f6ea5,null))['then'](function(_0x33031d){if(_0x33031d){_0xf3f377[_0x90ec('0x2e')]=_[_0x90ec('0x30')](db['CmHopperBlack'][_0x90ec('0x2c')]);_0xf3f377[_0x90ec('0x2f')]=_[_0x90ec('0x30')](_0x4349c8[_0x90ec('0x2f')]);_0xf3f377[_0x90ec('0x31')]=_['intersection'](_0xf3f377['model'],_0xf3f377[_0x90ec('0x2f')]);_0x352dd5['attributes']=_[_0x90ec('0x4c')](_0xf3f377['model'],qs['fields'](_0x4349c8[_0x90ec('0x2f')][_0x90ec('0x32')]));_0x352dd5['attributes']=_0x352dd5[_0x90ec('0x33')]['length']?_0x352dd5[_0x90ec('0x33')]:_0xf3f377[_0x90ec('0x2e')];if(!_0x4349c8[_0x90ec('0x2f')]['hasOwnProperty'](_0x90ec('0x54'))){_0x352dd5[_0x90ec('0x1d')]=qs[_0x90ec('0x1d')](_0x4349c8[_0x90ec('0x2f')][_0x90ec('0x1d')]);_0x352dd5[_0x90ec('0x1b')]=qs['offset'](_0x4349c8[_0x90ec('0x2f')][_0x90ec('0x1b')]);}_0x352dd5[_0x90ec('0x5c')]=qs['sort'](_0x4349c8[_0x90ec('0x2f')][_0x90ec('0x36')]);_0x352dd5['where']=qs[_0x90ec('0x31')](_[_0x90ec('0x37')](_0x4349c8[_0x90ec('0x2f')],_0xf3f377[_0x90ec('0x31')]));_0x352dd5['where'][_0x90ec('0x58')]=_0x33031d['id'];if(_0x4349c8[_0x90ec('0x2f')][_0x90ec('0x38')]){_0x352dd5[_0x90ec('0x39')]=_[_0x90ec('0x3a')](_0x352dd5[_0x90ec('0x39')],{'$or':_[_0x90ec('0x55')](_0x352dd5[_0x90ec('0x33')],function(_0x4846ab){var _0x5ef1b5={};_0x5ef1b5[_0x4846ab]={'$like':'%'+_0x4349c8[_0x90ec('0x2f')][_0x90ec('0x38')]+'%'};return _0x5ef1b5;})});}_0x352dd5=_[_0x90ec('0x3a')]({},_0x352dd5,_0x4349c8[_0x90ec('0x3c')]);return db[_0x90ec('0x5d')][_0x90ec('0x1e')]({'where':_0x352dd5[_0x90ec('0x39')]})['then'](function(_0x2b3f6f){_0x914a36[_0x90ec('0x1e')]=_0x2b3f6f;if(_0x4349c8[_0x90ec('0x2f')][_0x90ec('0x40')]){_0x352dd5[_0x90ec('0x3d')]=[{'all':!![]}];}return db[_0x90ec('0x5d')][_0x90ec('0x3e')](_0x352dd5);})[_0x90ec('0x22')](function(_0x1b0c55){_0x914a36[_0x90ec('0x56')]=_0x1b0c55;return _0x914a36;});}})[_0x90ec('0x22')](respondWithFilteredResult(_0x1f6ea5,_0x352dd5))[_0x90ec('0x47')](handleError(_0x1f6ea5,null));};exports[_0x90ec('0x5e')]=function(_0x538520,_0x34fd52,_0x2eca27){var _0x27db22={};var _0x1b6b91={};var _0x1e1f8f;var _0xd70ec3;return db[_0x90ec('0x2b')][_0x90ec('0x59')]({'where':{'id':_0x538520[_0x90ec('0x4b')]['id']}})[_0x90ec('0x22')](handleEntityNotFound(_0x34fd52,null))[_0x90ec('0x22')](function(_0x4bb59b){if(_0x4bb59b){_0x1e1f8f=_0x4bb59b;_0x1b6b91[_0x90ec('0x2e')]=_['keys'](db['CmList'][_0x90ec('0x2c')]);_0x1b6b91[_0x90ec('0x2f')]=_[_0x90ec('0x30')](_0x538520[_0x90ec('0x2f')]);_0x1b6b91[_0x90ec('0x31')]=_[_0x90ec('0x4c')](_0x1b6b91['model'],_0x1b6b91[_0x90ec('0x2f')]);_0x27db22['attributes']=_[_0x90ec('0x4c')](_0x1b6b91[_0x90ec('0x2e')],qs['fields'](_0x538520[_0x90ec('0x2f')][_0x90ec('0x32')]));_0x27db22[_0x90ec('0x33')]=_0x27db22['attributes']['length']?_0x27db22['attributes']:_0x1b6b91[_0x90ec('0x2e')];_0x27db22[_0x90ec('0x5c')]=qs[_0x90ec('0x36')](_0x538520[_0x90ec('0x2f')][_0x90ec('0x36')]);_0x27db22[_0x90ec('0x39')]=qs[_0x90ec('0x31')](_['pick'](_0x538520['query'],_0x1b6b91[_0x90ec('0x31')]));if(_0x538520[_0x90ec('0x2f')][_0x90ec('0x38')]){_0x27db22['where']=_['merge'](_0x27db22['where'],{'$or':_[_0x90ec('0x55')](_0x27db22[_0x90ec('0x33')],function(_0x59dd7a){var _0x107bc1={};_0x107bc1[_0x59dd7a]={'$like':'%'+_0x538520[_0x90ec('0x2f')][_0x90ec('0x38')]+'%'};return _0x107bc1;})});}_0x27db22=_[_0x90ec('0x3a')]({},_0x27db22,_0x538520[_0x90ec('0x3c')]);return _0x1e1f8f[_0x90ec('0x5e')](_0x27db22);}})[_0x90ec('0x22')](function(_0x446a39){if(_0x446a39){_0xd70ec3=_0x446a39[_0x90ec('0x34')];if(!_0x538520[_0x90ec('0x2f')][_0x90ec('0x35')](_0x90ec('0x54'))){_0x27db22['limit']=qs['limit'](_0x538520['query']['limit']);_0x27db22[_0x90ec('0x1b')]=qs[_0x90ec('0x1b')](_0x538520['query']['offset']);}return _0x1e1f8f[_0x90ec('0x5e')](_0x27db22);}})[_0x90ec('0x22')](function(_0x41b29b){if(_0x41b29b){return _0x41b29b?{'count':_0xd70ec3,'rows':_0x41b29b}:null;}})[_0x90ec('0x22')](respondWithResult(_0x34fd52,null))['catch'](handleError(_0x34fd52,null));};exports[_0x90ec('0x5f')]=function(_0x53037e,_0x2c876e,_0x41489c){var _0x884a0,_0x4ae5a9;return db['Campaign']['find']({'where':{'id':_0x53037e[_0x90ec('0x4b')]['id']}})[_0x90ec('0x22')](handleEntityNotFound(_0x2c876e,null))[_0x90ec('0x22')](function(_0x247a9b){if(_0x247a9b){_0x4ae5a9=_0x247a9b;return _0x247a9b[_0x90ec('0x5f')](_0x53037e[_0x90ec('0x43')][_0x90ec('0x60')],_[_0x90ec('0x4d')](_0x53037e[_0x90ec('0x43')],['ids','id'])||{});}return null;})[_0x90ec('0x61')](function(_0x8d4804){var _0x38140b;_0x884a0=_0x8d4804||[];var _0x531440=[];if(_0x8d4804){for(var _0x32c01b=0x0;_0x32c01b<_0x8d4804['length'];_0x32c01b+=0x1){var _0x1c7f30=_0x8d4804[_0x32c01b][_0x90ec('0x24')]({'plain':!![]});_0x4ae5a9['dialCheckDuplicateType']=_0x53037e[_0x90ec('0x43')][_0x90ec('0x62')]?_0x53037e[_0x90ec('0x43')][_0x90ec('0x62')]:_0x4ae5a9[_0x90ec('0x62')];switch(_0x4ae5a9['dialCheckDuplicateType']){case _0x90ec('0x63'):_0x38140b=squel[_0x90ec('0x64')]()[_0x90ec('0x65')](_0x90ec('0x66'))[_0x90ec('0x67')]([_0x90ec('0x68'),_0x90ec('0x69'),'ContactId',_0x90ec('0x6a'),_0x90ec('0x58'),_0x90ec('0x4e'),_0x90ec('0x4f')],squel[_0x90ec('0x6b')]()[_0x90ec('0x6c')](_0x90ec('0x68'),_0x90ec('0x68'))[_0x90ec('0x6c')]('NOW()',_0x90ec('0x69'))['field']('id','ContactId')[_0x90ec('0x6c')](_0x1c7f30[_0x90ec('0x6d')][_0x90ec('0x6e')](),'ListId')[_0x90ec('0x6c')](_0x53037e[_0x90ec('0x4b')]['id']['toString'](),_0x90ec('0x58'))['field'](_0x90ec('0x6f'),_0x90ec('0x4e'))[_0x90ec('0x6c')](_0x90ec('0x6f'),_0x90ec('0x4f'))[_0x90ec('0x70')]('cm_contacts')[_0x90ec('0x39')](_0x90ec('0x71'))[_0x90ec('0x39')]('ListId\x20=\x20?',_0x1c7f30['CmListId']['toString']())[_0x90ec('0x39')](_0x90ec('0x72'))[_0x90ec('0x39')](_0x90ec('0x73'),squel[_0x90ec('0x6b')]()[_0x90ec('0x6c')]('COALESCE(calleridnum,\x27\x27)')[_0x90ec('0x70')](_0x90ec('0x74'))[_0x90ec('0x39')]('CampaignId\x20=\x20?',_0x53037e[_0x90ec('0x4b')]['id'][_0x90ec('0x6e')]()))[_0x90ec('0x39')]('phone\x20NOT\x20IN\x20(?)',squel[_0x90ec('0x6b')]()[_0x90ec('0x6c')](_0x90ec('0x75'))['from'](_0x90ec('0x66'))[_0x90ec('0x39')]('CampaignId\x20=\x20?',_0x53037e[_0x90ec('0x4b')]['id']['toString']())))[_0x90ec('0x6e')]();break;case _0x90ec('0x76'):_0x38140b=squel[_0x90ec('0x64')]()[_0x90ec('0x65')](_0x90ec('0x66'))[_0x90ec('0x67')]([_0x90ec('0x68'),_0x90ec('0x69'),_0x90ec('0x77'),_0x90ec('0x6a'),_0x90ec('0x58'),'createdAt',_0x90ec('0x4f')],squel['select']()['field'](_0x90ec('0x68'),_0x90ec('0x68'))[_0x90ec('0x6c')](_0x90ec('0x6f'),_0x90ec('0x69'))[_0x90ec('0x6c')]('id',_0x90ec('0x77'))['field'](_0x1c7f30[_0x90ec('0x6d')][_0x90ec('0x6e')](),'ListId')[_0x90ec('0x6c')](_0x53037e[_0x90ec('0x4b')]['id'][_0x90ec('0x6e')](),_0x90ec('0x58'))[_0x90ec('0x6c')]('NOW()',_0x90ec('0x4e'))[_0x90ec('0x6c')](_0x90ec('0x6f'),'updatedAt')[_0x90ec('0x70')](_0x90ec('0x78'))[_0x90ec('0x39')](_0x90ec('0x71'))[_0x90ec('0x39')](_0x90ec('0x79'),_0x1c7f30[_0x90ec('0x6d')][_0x90ec('0x6e')]())['where'](_0x90ec('0x72'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x90ec('0x6b')]()[_0x90ec('0x6c')](_0x90ec('0x75'))[_0x90ec('0x70')](_0x90ec('0x66'))[_0x90ec('0x39')](_0x90ec('0x7a'),_0x53037e[_0x90ec('0x4b')]['id'][_0x90ec('0x6e')]())))[_0x90ec('0x6e')]();break;default:_0x38140b=squel[_0x90ec('0x64')]()[_0x90ec('0x65')](_0x90ec('0x66'))['fromQuery']([_0x90ec('0x68'),'scheduledAt','ContactId',_0x90ec('0x6a'),'CampaignId','createdAt',_0x90ec('0x4f')],squel[_0x90ec('0x6b')]()[_0x90ec('0x6c')](_0x90ec('0x68'),_0x90ec('0x68'))[_0x90ec('0x6c')](_0x90ec('0x6f'),'scheduledAt')['field']('id','ContactId')[_0x90ec('0x6c')](_0x1c7f30[_0x90ec('0x6d')][_0x90ec('0x6e')](),_0x90ec('0x6a'))[_0x90ec('0x6c')](_0x53037e['params']['id'][_0x90ec('0x6e')](),_0x90ec('0x58'))[_0x90ec('0x6c')]('NOW()',_0x90ec('0x4e'))[_0x90ec('0x6c')](_0x90ec('0x6f'),_0x90ec('0x4f'))['from'](_0x90ec('0x78'))[_0x90ec('0x39')]('deletedAt\x20IS\x20NULL')[_0x90ec('0x39')](_0x90ec('0x79'),_0x1c7f30[_0x90ec('0x6d')]['toString']())[_0x90ec('0x39')](_0x90ec('0x72')))[_0x90ec('0x6e')]();}_0x531440[_0x90ec('0x7b')](db[_0x90ec('0x7c')][_0x90ec('0x2f')](_0x38140b));}return BPromise[_0x90ec('0x7d')](_0x531440);}})['then'](function(){return _0x884a0;})['then'](respondWithResult(_0x2c876e,null))['catch'](handleError(_0x2c876e,null));};exports[_0x90ec('0x7e')]=function(_0xf41c1f,_0x10c8d7,_0x15998e){return db[_0x90ec('0x2b')][_0x90ec('0x41')]({'where':{'id':_0xf41c1f['params']['id']}})[_0x90ec('0x22')](handleEntityNotFound(_0x10c8d7,null))[_0x90ec('0x22')](function(_0x3220b6){if(_0x3220b6){return _0x3220b6[_0x90ec('0x7e')](_0xf41c1f[_0x90ec('0x2f')][_0x90ec('0x60')]);}})[_0x90ec('0x22')](function(_0x11cbd6){if(_0x11cbd6){return db[_0x90ec('0x53')][_0x90ec('0x23')]({'where':{'ListId':_0xf41c1f['query'][_0x90ec('0x60')],'CampaignId':_0xf41c1f[_0x90ec('0x4b')]['id']}})[_0x90ec('0x22')](function(){return _0x11cbd6;});}})['then'](respondWithStatusCode(_0x10c8d7,null))['catch'](handleError(_0x10c8d7,null));};exports['getBlackLists']=function(_0x423241,_0x32d840,_0x368f16){var _0x4690b6={};var _0x91a1ca={};var _0x4a8b1e;var _0x13c431;return db['Campaign'][_0x90ec('0x59')]({'where':{'id':_0x423241[_0x90ec('0x4b')]['id']}})['then'](handleEntityNotFound(_0x32d840,null))[_0x90ec('0x22')](function(_0x266824){if(_0x266824){_0x4a8b1e=_0x266824;_0x91a1ca['model']=_[_0x90ec('0x30')](db[_0x90ec('0x7f')][_0x90ec('0x2c')]);_0x91a1ca[_0x90ec('0x2f')]=_[_0x90ec('0x30')](_0x423241[_0x90ec('0x2f')]);_0x91a1ca[_0x90ec('0x31')]=_[_0x90ec('0x4c')](_0x91a1ca[_0x90ec('0x2e')],_0x91a1ca[_0x90ec('0x2f')]);_0x4690b6['attributes']=_['intersection'](_0x91a1ca['model'],qs[_0x90ec('0x32')](_0x423241[_0x90ec('0x2f')]['fields']));_0x4690b6['attributes']=_0x4690b6[_0x90ec('0x33')][_0x90ec('0x34')]?_0x4690b6[_0x90ec('0x33')]:_0x91a1ca[_0x90ec('0x2e')];_0x4690b6[_0x90ec('0x5c')]=qs[_0x90ec('0x36')](_0x423241[_0x90ec('0x2f')][_0x90ec('0x36')]);_0x4690b6['where']=qs[_0x90ec('0x31')](_[_0x90ec('0x37')](_0x423241[_0x90ec('0x2f')],_0x91a1ca[_0x90ec('0x31')]));if(_0x423241[_0x90ec('0x2f')]['filter']){_0x4690b6['where']=_['merge'](_0x4690b6[_0x90ec('0x39')],{'$or':_[_0x90ec('0x55')](_0x4690b6[_0x90ec('0x33')],function(_0x51c888){var _0x54a40c={};_0x54a40c[_0x51c888]={'$like':'%'+_0x423241[_0x90ec('0x2f')][_0x90ec('0x38')]+'%'};return _0x54a40c;})});}_0x4690b6=_['merge']({},_0x4690b6,_0x423241[_0x90ec('0x3c')]);return _0x4a8b1e[_0x90ec('0x80')](_0x4690b6);}})[_0x90ec('0x22')](function(_0x306605){if(_0x306605){_0x13c431=_0x306605[_0x90ec('0x34')];if(!_0x423241[_0x90ec('0x2f')][_0x90ec('0x35')](_0x90ec('0x54'))){_0x4690b6[_0x90ec('0x1d')]=qs[_0x90ec('0x1d')](_0x423241[_0x90ec('0x2f')][_0x90ec('0x1d')]);_0x4690b6[_0x90ec('0x1b')]=qs[_0x90ec('0x1b')](_0x423241[_0x90ec('0x2f')]['offset']);}return _0x4a8b1e[_0x90ec('0x80')](_0x4690b6);}})['then'](function(_0x427b0b){if(_0x427b0b){return _0x427b0b?{'count':_0x13c431,'rows':_0x427b0b}:null;}})[_0x90ec('0x22')](respondWithResult(_0x32d840,null))[_0x90ec('0x47')](handleError(_0x32d840,null));};exports[_0x90ec('0x81')]=function(_0x522385,_0x1c1bed,_0x3905b0){var _0x96eda4,_0xc79db3;return db['Campaign'][_0x90ec('0x41')]({'where':{'id':_0x522385[_0x90ec('0x4b')]['id']}})[_0x90ec('0x22')](handleEntityNotFound(_0x1c1bed,null))[_0x90ec('0x22')](function(_0x585de6){if(_0x585de6){_0xc79db3=_0x585de6;return _0x585de6[_0x90ec('0x81')](_0x522385[_0x90ec('0x43')][_0x90ec('0x60')],_[_0x90ec('0x4d')](_0x522385[_0x90ec('0x43')],[_0x90ec('0x60'),'id'])||{});}return null;})[_0x90ec('0x61')](function(_0x49048c){var _0x3ce9a1;_0x96eda4=_0x49048c||[];var _0x5f4f32=[];if(_0x49048c){for(var _0x1fecfb=0x0;_0x1fecfb<_0x49048c['length'];_0x1fecfb+=0x1){var _0x22bc4c=_0x49048c[_0x1fecfb][_0x90ec('0x24')]({'plain':!![]});_0x3ce9a1=squel[_0x90ec('0x64')]()[_0x90ec('0x65')](_0x90ec('0x82'))[_0x90ec('0x67')]([_0x90ec('0x68'),_0x90ec('0x77'),_0x90ec('0x6a'),_0x90ec('0x58'),_0x90ec('0x4e'),_0x90ec('0x4f')],squel[_0x90ec('0x6b')]()[_0x90ec('0x6c')](_0x90ec('0x68'),_0x90ec('0x68'))['field']('id',_0x90ec('0x77'))[_0x90ec('0x6c')](_0x22bc4c[_0x90ec('0x6d')]['toString'](),_0x90ec('0x6a'))[_0x90ec('0x6c')](_0x522385[_0x90ec('0x4b')]['id'][_0x90ec('0x6e')](),_0x90ec('0x58'))[_0x90ec('0x6c')](_0x90ec('0x6f'),_0x90ec('0x4e'))[_0x90ec('0x6c')](_0x90ec('0x6f'),_0x90ec('0x4f'))[_0x90ec('0x70')]('cm_contacts')['where'](_0x90ec('0x71'))[_0x90ec('0x39')]('ListId\x20=\x20?',_0x22bc4c[_0x90ec('0x6d')][_0x90ec('0x6e')]())[_0x90ec('0x39')](_0x90ec('0x72')))[_0x90ec('0x6e')]();_0x5f4f32[_0x90ec('0x7b')](db['sequelize'][_0x90ec('0x2f')](_0x3ce9a1));}return BPromise[_0x90ec('0x7d')](_0x5f4f32);}})[_0x90ec('0x22')](function(){return _0x96eda4;})[_0x90ec('0x22')](respondWithResult(_0x1c1bed,null))[_0x90ec('0x47')](handleError(_0x1c1bed,null));};exports[_0x90ec('0x83')]=function(_0x461820,_0x1aae99,_0xb0e935){return db[_0x90ec('0x2b')]['find']({'where':{'id':_0x461820[_0x90ec('0x4b')]['id']}})[_0x90ec('0x22')](handleEntityNotFound(_0x1aae99,null))[_0x90ec('0x22')](function(_0x3eb962){if(_0x3eb962){return _0x3eb962[_0x90ec('0x83')](_0x461820[_0x90ec('0x2f')][_0x90ec('0x60')]);}})[_0x90ec('0x22')](function(_0x1fd155){if(_0x1fd155){return db[_0x90ec('0x5d')][_0x90ec('0x23')]({'where':{'ListId':_0x461820[_0x90ec('0x2f')][_0x90ec('0x60')],'CampaignId':_0x461820[_0x90ec('0x4b')]['id']}})[_0x90ec('0x22')](function(){return _0x1fd155;});}})[_0x90ec('0x22')](respondWithStatusCode(_0x1aae99,null))['catch'](handleError(_0x1aae99,null));};
\ No newline at end of file
+var _0xb9a2=['json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','IvrCampaigns','UserProfileResource','error','stack','name','map','Campaign','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','get','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','user','userProfileId','autoAssociation','getHoppers','CmHopper','CampaignId','getHopperHistories','findOne','CmHopperHistory','pick','getHopperFinals','CmHopperFinal','CmHopperBlack','findAll','getLists','CmList','addLists','ids','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','scheduledAt','select','field','phone','NOW()','ContactId','toString','ListId','from','cm_contacts','deletedAt\x20IS\x20NULL','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','CampaignId\x20=\x20?','onlyIfOpen','into','ListId\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0x1e4483,_0x12d73e){var _0x2ab5be=function(_0x4cb35c){while(--_0x4cb35c){_0x1e4483['push'](_0x1e4483['shift']());}};_0x2ab5be(++_0x12d73e);}(_0xb9a2,0xed));var _0x2b9a=function(_0x48f1d5,_0x1b92ad){_0x48f1d5=_0x48f1d5-0x0;var _0x208a53=_0xb9a2[_0x48f1d5];return _0x208a53;};'use strict';var emlformat=require(_0x2b9a('0x0'));var rimraf=require(_0x2b9a('0x1'));var zipdir=require(_0x2b9a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2b9a('0x3'));var moment=require(_0x2b9a('0x4'));var BPromise=require(_0x2b9a('0x5'));var Mustache=require('mustache');var util=require(_0x2b9a('0x6'));var path=require(_0x2b9a('0x7'));var sox=require(_0x2b9a('0x8'));var csv=require(_0x2b9a('0x9'));var ejs=require(_0x2b9a('0xa'));var fs=require('fs');var fs_extra=require(_0x2b9a('0xb'));var _=require(_0x2b9a('0xc'));var squel=require(_0x2b9a('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2b9a('0xe'));var Papa=require(_0x2b9a('0xf'));var Redis=require(_0x2b9a('0x10'));var authService=require(_0x2b9a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2b9a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2b9a('0x13'));var utils=require(_0x2b9a('0x14'));var config=require(_0x2b9a('0x15'));var licenseUtil=require(_0x2b9a('0x16'));var db=require(_0x2b9a('0x17'))['db'];function respondWithStatusCode(_0x287b0c,_0x28b6d5){_0x28b6d5=_0x28b6d5||0xcc;return function(_0x84c8f8){if(_0x84c8f8){return _0x287b0c[_0x2b9a('0x18')](_0x28b6d5);}return _0x287b0c['status'](_0x28b6d5)[_0x2b9a('0x19')]();};}function respondWithResult(_0x39b516,_0x2f2d28){_0x2f2d28=_0x2f2d28||0xc8;return function(_0x5204ba){if(_0x5204ba){return _0x39b516[_0x2b9a('0x1a')](_0x2f2d28)[_0x2b9a('0x1b')](_0x5204ba);}};}function respondWithFilteredResult(_0x3ef186,_0x4926cf){return function(_0x251283){if(_0x251283){var _0x54b049=typeof _0x4926cf[_0x2b9a('0x1c')]===_0x2b9a('0x1d')&&typeof _0x4926cf[_0x2b9a('0x1e')]===_0x2b9a('0x1d');var _0x40a1c4=_0x251283['count'];var _0x44925f=_0x54b049?0x0:_0x4926cf[_0x2b9a('0x1c')];var _0x3a06c6=_0x54b049?_0x251283[_0x2b9a('0x1f')]:_0x4926cf[_0x2b9a('0x1c')]+_0x4926cf['limit'];var _0xe070dc;if(_0x3a06c6>=_0x40a1c4){_0x3a06c6=_0x40a1c4;_0xe070dc=0xc8;}else{_0xe070dc=0xce;}_0x3ef186[_0x2b9a('0x1a')](_0xe070dc);return _0x3ef186['set'](_0x2b9a('0x20'),_0x44925f+'-'+_0x3a06c6+'/'+_0x40a1c4)[_0x2b9a('0x1b')](_0x251283);}return null;};}function patchUpdates(_0x2db0a0){return function(_0x18ada5){try{jsonpatch['apply'](_0x18ada5,_0x2db0a0,!![]);}catch(_0xceb9e3){return BPromise[_0x2b9a('0x21')](_0xceb9e3);}return _0x18ada5['save']();};}function saveUpdates(_0x1c1f7c,_0x5a00c8){return function(_0x43e5e0){if(_0x43e5e0){return _0x43e5e0[_0x2b9a('0x22')](_0x1c1f7c)[_0x2b9a('0x23')](function(_0x38805f){return _0x38805f;});}return null;};}function removeEntity(_0x48ae01,_0x444042){return function(_0x1182f2){if(_0x1182f2){return _0x1182f2[_0x2b9a('0x24')]()['then'](function(){var _0x38ba03=_0x1182f2['get']({'plain':!![]});var _0x427668=_0x2b9a('0x25');return db[_0x2b9a('0x26')][_0x2b9a('0x24')]({'where':{'type':_0x427668,'resourceId':_0x38ba03['id']}})[_0x2b9a('0x23')](function(){return _0x1182f2;});})[_0x2b9a('0x23')](function(){_0x48ae01[_0x2b9a('0x1a')](0xcc)[_0x2b9a('0x19')]();});}};}function handleEntityNotFound(_0x4cc379,_0x5aeefd){return function(_0x41d4ef){if(!_0x41d4ef){_0x4cc379[_0x2b9a('0x18')](0x194);}return _0x41d4ef;};}function handleError(_0x508b40,_0x1f5d57){_0x1f5d57=_0x1f5d57||0x1f4;return function(_0x3cefae){logger[_0x2b9a('0x27')](_0x3cefae[_0x2b9a('0x28')]);if(_0x3cefae[_0x2b9a('0x29')]){delete _0x3cefae['name'];}_0x508b40[_0x2b9a('0x1a')](_0x1f5d57)['send'](_0x3cefae);};}exports['index']=function(_0x437dc1,_0x2624e1){var _0x5acf1e={},_0x173321={},_0x46710a={'count':0x0,'rows':[]};var _0x18d9f7=_[_0x2b9a('0x2a')](db[_0x2b9a('0x2b')][_0x2b9a('0x2c')],function(_0x169d40){return{'name':_0x169d40[_0x2b9a('0x2d')],'type':_0x169d40[_0x2b9a('0x2e')][_0x2b9a('0x2f')]};});_0x173321[_0x2b9a('0x30')]=_[_0x2b9a('0x2a')](_0x18d9f7,_0x2b9a('0x29'));_0x173321[_0x2b9a('0x31')]=_[_0x2b9a('0x32')](_0x437dc1[_0x2b9a('0x31')]);_0x173321[_0x2b9a('0x33')]=_['intersection'](_0x173321[_0x2b9a('0x30')],_0x173321[_0x2b9a('0x31')]);_0x5acf1e[_0x2b9a('0x34')]=_[_0x2b9a('0x35')](_0x173321[_0x2b9a('0x30')],qs[_0x2b9a('0x36')](_0x437dc1[_0x2b9a('0x31')]['fields']));_0x5acf1e['attributes']=_0x5acf1e[_0x2b9a('0x34')][_0x2b9a('0x37')]?_0x5acf1e['attributes']:_0x173321['model'];if(!_0x437dc1[_0x2b9a('0x31')][_0x2b9a('0x38')](_0x2b9a('0x39'))){_0x5acf1e[_0x2b9a('0x1e')]=qs['limit'](_0x437dc1[_0x2b9a('0x31')][_0x2b9a('0x1e')]);_0x5acf1e[_0x2b9a('0x1c')]=qs['offset'](_0x437dc1[_0x2b9a('0x31')][_0x2b9a('0x1c')]);}_0x5acf1e[_0x2b9a('0x3a')]=qs[_0x2b9a('0x3b')](_0x437dc1['query'][_0x2b9a('0x3b')]);_0x5acf1e[_0x2b9a('0x3c')]=qs[_0x2b9a('0x33')](_['pick'](_0x437dc1[_0x2b9a('0x31')],_0x173321[_0x2b9a('0x33')]),_0x18d9f7);if(_0x437dc1[_0x2b9a('0x31')][_0x2b9a('0x3d')]){_0x5acf1e['where']=_[_0x2b9a('0x3e')](_0x5acf1e['where'],{'$or':_[_0x2b9a('0x2a')](_0x18d9f7,function(_0x57b85b){if(_0x57b85b[_0x2b9a('0x2e')]!==_0x2b9a('0x3f')){var _0x26fc17={};_0x26fc17[_0x57b85b[_0x2b9a('0x29')]]={'$like':'%'+_0x437dc1['query'][_0x2b9a('0x3d')]+'%'};return _0x26fc17;}})});}_0x5acf1e=_[_0x2b9a('0x3e')]({},_0x5acf1e,_0x437dc1[_0x2b9a('0x40')]);var _0x14f575={'where':_0x5acf1e[_0x2b9a('0x3c')]};return db[_0x2b9a('0x2b')][_0x2b9a('0x1f')](_0x14f575)['then'](function(_0x36e9f6){_0x46710a[_0x2b9a('0x1f')]=_0x36e9f6;if(_0x437dc1[_0x2b9a('0x31')][_0x2b9a('0x41')]){_0x5acf1e[_0x2b9a('0x42')]=[{'all':!![]}];}return db[_0x2b9a('0x2b')]['findAll'](_0x5acf1e);})[_0x2b9a('0x23')](function(_0x2319c6){_0x46710a[_0x2b9a('0x43')]=_0x2319c6;return _0x46710a;})[_0x2b9a('0x23')](respondWithFilteredResult(_0x2624e1,_0x5acf1e))[_0x2b9a('0x44')](handleError(_0x2624e1,null));};exports[_0x2b9a('0x45')]=function(_0x2e06d3,_0x83abe0){var _0x2f9330={'raw':![],'where':{'id':_0x2e06d3[_0x2b9a('0x46')]['id']}},_0x13b619={};_0x13b619['model']=_[_0x2b9a('0x32')](db[_0x2b9a('0x2b')][_0x2b9a('0x2c')]);_0x13b619[_0x2b9a('0x31')]=_[_0x2b9a('0x32')](_0x2e06d3[_0x2b9a('0x31')]);_0x13b619[_0x2b9a('0x33')]=_[_0x2b9a('0x35')](_0x13b619[_0x2b9a('0x30')],_0x13b619[_0x2b9a('0x31')]);_0x2f9330['attributes']=_[_0x2b9a('0x35')](_0x13b619['model'],qs[_0x2b9a('0x36')](_0x2e06d3[_0x2b9a('0x31')][_0x2b9a('0x36')]));_0x2f9330[_0x2b9a('0x34')]=_0x2f9330[_0x2b9a('0x34')]['length']?_0x2f9330[_0x2b9a('0x34')]:_0x13b619['model'];if(_0x2e06d3[_0x2b9a('0x31')]['includeAll']){_0x2f9330[_0x2b9a('0x42')]=[{'all':!![]}];}_0x2f9330=_[_0x2b9a('0x3e')]({},_0x2f9330,_0x2e06d3[_0x2b9a('0x40')]);return db[_0x2b9a('0x2b')][_0x2b9a('0x47')](_0x2f9330)['then'](handleEntityNotFound(_0x83abe0,null))['then'](respondWithResult(_0x83abe0,null))[_0x2b9a('0x44')](handleError(_0x83abe0,null));};exports[_0x2b9a('0x48')]=function(_0x107e3e,_0xc96299){return db[_0x2b9a('0x2b')]['create'](_0x107e3e['body'],{})[_0x2b9a('0x23')](function(_0x1f8324){var _0x55894b=_0x107e3e['user'][_0x2b9a('0x49')]({'plain':!![]});if(!_0x55894b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55894b[_0x2b9a('0x4a')]==='user'){var _0x4e0b2d=_0x1f8324[_0x2b9a('0x49')]({'plain':!![]});var _0x129001=_0x2b9a('0x25');return db[_0x2b9a('0x4b')][_0x2b9a('0x47')]({'where':{'name':_0x129001,'userProfileId':_0x55894b['userProfileId']},'raw':!![]})[_0x2b9a('0x23')](function(_0x5c644b){if(_0x5c644b&&_0x5c644b['autoAssociation']===0x0){return db[_0x2b9a('0x26')][_0x2b9a('0x48')]({'name':_0x4e0b2d[_0x2b9a('0x29')],'resourceId':_0x4e0b2d['id'],'type':_0x5c644b[_0x2b9a('0x29')],'sectionId':_0x5c644b['id']},{})[_0x2b9a('0x23')](function(){return _0x1f8324;});}else{return _0x1f8324;}})[_0x2b9a('0x44')](function(_0x20b5f3){logger['error'](_0x2b9a('0x4c'),_0x20b5f3);throw _0x20b5f3;});}return _0x1f8324;})[_0x2b9a('0x23')](respondWithResult(_0xc96299,0xc9))[_0x2b9a('0x44')](handleError(_0xc96299,null));};exports[_0x2b9a('0x4d')]=function(_0x5cfe21,_0x768f25){var _0x31b3b3={'where':{'id':_0x5cfe21[_0x2b9a('0x46')]['id']}},_0x49d436={};_0x49d436[_0x2b9a('0x30')]=_[_0x2b9a('0x32')](db[_0x2b9a('0x2b')]['rawAttributes']);_0x31b3b3[_0x2b9a('0x34')]=_[_0x2b9a('0x35')](_0x49d436[_0x2b9a('0x30')],qs['fields'](_0x5cfe21[_0x2b9a('0x31')][_0x2b9a('0x36')]));_0x31b3b3['attributes']=_0x31b3b3['attributes'][_0x2b9a('0x37')]?_0x31b3b3[_0x2b9a('0x34')]:_0x49d436[_0x2b9a('0x30')];if(_0x5cfe21['query']['includeAll']){_0x31b3b3[_0x2b9a('0x42')]=[{'all':!![]}];}_0x31b3b3=_['merge']({},_0x31b3b3,_0x5cfe21['options']);return db[_0x2b9a('0x2b')]['find'](_0x31b3b3)[_0x2b9a('0x23')](handleEntityNotFound(_0x768f25,null))[_0x2b9a('0x23')](function(_0x2b14cf){if(_0x2b14cf){var _0x3aa05b=_0x2b14cf[_0x2b9a('0x49')]({'plain':!![]});_0x3aa05b=qs[_0x2b9a('0x4e')](_0x3aa05b,['id',_0x2b9a('0x4f'),_0x2b9a('0x50')]);_0x5cfe21[_0x2b9a('0x51')]=_[_0x2b9a('0x4e')](_0x5cfe21['body'],['id',_0x2b9a('0x4f'),'updatedAt']);return db[_0x2b9a('0x2b')][_0x2b9a('0x48')](_[_0x2b9a('0x3e')](_0x3aa05b,_0x5cfe21[_0x2b9a('0x51')]),{'include':_0x5cfe21[_0x2b9a('0x31')][_0x2b9a('0x41')]?[{'all':!![]}]:undefined})[_0x2b9a('0x23')](function(_0x37c16f){var _0x24f15d=_0x5cfe21[_0x2b9a('0x52')][_0x2b9a('0x49')]({'plain':!![]});if(!_0x24f15d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x24f15d[_0x2b9a('0x4a')]===_0x2b9a('0x52')){var _0x1fba42=_0x37c16f[_0x2b9a('0x49')]({'plain':!![]});var _0x876754=_0x2b9a('0x25');return db['UserProfileSection']['find']({'where':{'name':_0x876754,'userProfileId':_0x24f15d[_0x2b9a('0x53')]},'raw':!![]})['then'](function(_0x49d37d){if(_0x49d37d&&_0x49d37d[_0x2b9a('0x54')]===0x0){return db[_0x2b9a('0x26')][_0x2b9a('0x48')]({'name':_0x1fba42[_0x2b9a('0x29')],'resourceId':_0x1fba42['id'],'type':_0x49d37d[_0x2b9a('0x29')],'sectionId':_0x49d37d['id']},{})[_0x2b9a('0x23')](function(){return _0x37c16f;});}else{return _0x37c16f;}})[_0x2b9a('0x44')](function(_0x4a3e54){logger[_0x2b9a('0x27')](_0x2b9a('0x4c'),_0x4a3e54);throw _0x4a3e54;});}return _0x37c16f;});}})['then'](respondWithResult(_0x768f25,0xc9))['catch'](handleError(_0x768f25,null));};exports['update']=function(_0x308186,_0xff084b){if(_0x308186[_0x2b9a('0x51')]['id']){delete _0x308186[_0x2b9a('0x51')]['id'];}return db[_0x2b9a('0x2b')][_0x2b9a('0x47')]({'where':{'id':_0x308186[_0x2b9a('0x46')]['id']}})[_0x2b9a('0x23')](handleEntityNotFound(_0xff084b,null))[_0x2b9a('0x23')](saveUpdates(_0x308186[_0x2b9a('0x51')],null))[_0x2b9a('0x23')](respondWithResult(_0xff084b,null))[_0x2b9a('0x44')](handleError(_0xff084b,null));};exports[_0x2b9a('0x24')]=function(_0x210ac0,_0x35cf13){return db['Campaign'][_0x2b9a('0x47')]({'where':{'id':_0x210ac0[_0x2b9a('0x46')]['id']}})[_0x2b9a('0x23')](handleEntityNotFound(_0x35cf13,null))[_0x2b9a('0x23')](removeEntity(_0x35cf13,null))[_0x2b9a('0x44')](handleError(_0x35cf13,null));};exports[_0x2b9a('0x55')]=function(_0x17d02d,_0x1770af,_0x44880f){var _0xb06703={'raw':!![],'where':{}};var _0x54d0e4={};var _0x37b0a2={'count':0x0,'rows':[]};return db[_0x2b9a('0x2b')]['findOne']({'where':{'id':_0x17d02d[_0x2b9a('0x46')]['id']}})[_0x2b9a('0x23')](handleEntityNotFound(_0x1770af,null))[_0x2b9a('0x23')](function(_0xe06e6f){if(_0xe06e6f){_0x54d0e4[_0x2b9a('0x30')]=_[_0x2b9a('0x32')](db[_0x2b9a('0x56')][_0x2b9a('0x2c')]);_0x54d0e4['query']=_[_0x2b9a('0x32')](_0x17d02d[_0x2b9a('0x31')]);_0x54d0e4[_0x2b9a('0x33')]=_[_0x2b9a('0x35')](_0x54d0e4[_0x2b9a('0x30')],_0x54d0e4['query']);_0xb06703['attributes']=_[_0x2b9a('0x35')](_0x54d0e4['model'],qs[_0x2b9a('0x36')](_0x17d02d[_0x2b9a('0x31')][_0x2b9a('0x36')]));_0xb06703[_0x2b9a('0x34')]=_0xb06703[_0x2b9a('0x34')]['length']?_0xb06703[_0x2b9a('0x34')]:_0x54d0e4[_0x2b9a('0x30')];if(!_0x17d02d['query'][_0x2b9a('0x38')](_0x2b9a('0x39'))){_0xb06703['limit']=qs[_0x2b9a('0x1e')](_0x17d02d[_0x2b9a('0x31')][_0x2b9a('0x1e')]);_0xb06703[_0x2b9a('0x1c')]=qs[_0x2b9a('0x1c')](_0x17d02d[_0x2b9a('0x31')][_0x2b9a('0x1c')]);}_0xb06703['order']=qs[_0x2b9a('0x3b')](_0x17d02d[_0x2b9a('0x31')][_0x2b9a('0x3b')]);_0xb06703[_0x2b9a('0x3c')]=qs['filters'](_['pick'](_0x17d02d[_0x2b9a('0x31')],_0x54d0e4['filters']));_0xb06703[_0x2b9a('0x3c')][_0x2b9a('0x57')]=_0xe06e6f['id'];if(_0x17d02d[_0x2b9a('0x31')]['filter']){_0xb06703['where']=_[_0x2b9a('0x3e')](_0xb06703[_0x2b9a('0x3c')],{'$or':_[_0x2b9a('0x2a')](_0xb06703[_0x2b9a('0x34')],function(_0x51d00f){var _0x59e96d={};_0x59e96d[_0x51d00f]={'$like':'%'+_0x17d02d['query']['filter']+'%'};return _0x59e96d;})});}_0xb06703=_['merge']({},_0xb06703,_0x17d02d[_0x2b9a('0x40')]);return db['CmHopper']['count']({'where':_0xb06703[_0x2b9a('0x3c')]})[_0x2b9a('0x23')](function(_0x15bc6d){_0x37b0a2[_0x2b9a('0x1f')]=_0x15bc6d;if(_0x17d02d[_0x2b9a('0x31')][_0x2b9a('0x41')]){_0xb06703['include']=[{'all':!![]}];}return db['CmHopper']['findAll'](_0xb06703);})[_0x2b9a('0x23')](function(_0x451478){_0x37b0a2[_0x2b9a('0x43')]=_0x451478;return _0x37b0a2;});}})[_0x2b9a('0x23')](respondWithFilteredResult(_0x1770af,_0xb06703))['catch'](handleError(_0x1770af,null));};exports[_0x2b9a('0x58')]=function(_0x12ca17,_0x5a785d,_0x34f27b){var _0x5a8c0d={'raw':!![],'where':{}};var _0x2c6a08={};var _0x30de80={'count':0x0,'rows':[]};return db['Campaign'][_0x2b9a('0x59')]({'where':{'id':_0x12ca17[_0x2b9a('0x46')]['id']}})[_0x2b9a('0x23')](handleEntityNotFound(_0x5a785d,null))[_0x2b9a('0x23')](function(_0x4b1f81){if(_0x4b1f81){_0x2c6a08[_0x2b9a('0x30')]=_[_0x2b9a('0x32')](db[_0x2b9a('0x5a')]['rawAttributes']);_0x2c6a08[_0x2b9a('0x31')]=_[_0x2b9a('0x32')](_0x12ca17[_0x2b9a('0x31')]);_0x2c6a08[_0x2b9a('0x33')]=_['intersection'](_0x2c6a08['model'],_0x2c6a08[_0x2b9a('0x31')]);_0x5a8c0d[_0x2b9a('0x34')]=_[_0x2b9a('0x35')](_0x2c6a08[_0x2b9a('0x30')],qs['fields'](_0x12ca17['query'][_0x2b9a('0x36')]));_0x5a8c0d[_0x2b9a('0x34')]=_0x5a8c0d[_0x2b9a('0x34')][_0x2b9a('0x37')]?_0x5a8c0d['attributes']:_0x2c6a08[_0x2b9a('0x30')];if(!_0x12ca17[_0x2b9a('0x31')][_0x2b9a('0x38')](_0x2b9a('0x39'))){_0x5a8c0d[_0x2b9a('0x1e')]=qs[_0x2b9a('0x1e')](_0x12ca17[_0x2b9a('0x31')][_0x2b9a('0x1e')]);_0x5a8c0d[_0x2b9a('0x1c')]=qs[_0x2b9a('0x1c')](_0x12ca17[_0x2b9a('0x31')]['offset']);}_0x5a8c0d['order']=qs[_0x2b9a('0x3b')](_0x12ca17[_0x2b9a('0x31')]['sort']);_0x5a8c0d[_0x2b9a('0x3c')]=qs['filters'](_[_0x2b9a('0x5b')](_0x12ca17[_0x2b9a('0x31')],_0x2c6a08[_0x2b9a('0x33')]));_0x5a8c0d[_0x2b9a('0x3c')][_0x2b9a('0x57')]=_0x4b1f81['id'];if(_0x12ca17[_0x2b9a('0x31')][_0x2b9a('0x3d')]){_0x5a8c0d[_0x2b9a('0x3c')]=_[_0x2b9a('0x3e')](_0x5a8c0d['where'],{'$or':_[_0x2b9a('0x2a')](_0x5a8c0d[_0x2b9a('0x34')],function(_0x3cade8){var _0x3f4184={};_0x3f4184[_0x3cade8]={'$like':'%'+_0x12ca17[_0x2b9a('0x31')]['filter']+'%'};return _0x3f4184;})});}_0x5a8c0d=_[_0x2b9a('0x3e')]({},_0x5a8c0d,_0x12ca17[_0x2b9a('0x40')]);return db[_0x2b9a('0x5a')][_0x2b9a('0x1f')]({'where':_0x5a8c0d[_0x2b9a('0x3c')]})[_0x2b9a('0x23')](function(_0x1a379d){_0x30de80[_0x2b9a('0x1f')]=_0x1a379d;if(_0x12ca17[_0x2b9a('0x31')][_0x2b9a('0x41')]){_0x5a8c0d[_0x2b9a('0x42')]=[{'all':!![]}];}return db[_0x2b9a('0x5a')]['findAll'](_0x5a8c0d);})['then'](function(_0x400315){_0x30de80[_0x2b9a('0x43')]=_0x400315;return _0x30de80;});}})[_0x2b9a('0x23')](respondWithFilteredResult(_0x5a785d,_0x5a8c0d))[_0x2b9a('0x44')](handleError(_0x5a785d,null));};exports[_0x2b9a('0x5c')]=function(_0x53f69d,_0x1f6e4b,_0x5727aa){var _0x342851={'raw':!![],'where':{}};var _0x129303={};var _0x177228={'count':0x0,'rows':[]};return db[_0x2b9a('0x2b')][_0x2b9a('0x59')]({'where':{'id':_0x53f69d['params']['id']}})[_0x2b9a('0x23')](handleEntityNotFound(_0x1f6e4b,null))[_0x2b9a('0x23')](function(_0x4af86e){if(_0x4af86e){_0x129303[_0x2b9a('0x30')]=_['keys'](db[_0x2b9a('0x5d')][_0x2b9a('0x2c')]);_0x129303[_0x2b9a('0x31')]=_[_0x2b9a('0x32')](_0x53f69d[_0x2b9a('0x31')]);_0x129303[_0x2b9a('0x33')]=_[_0x2b9a('0x35')](_0x129303[_0x2b9a('0x30')],_0x129303[_0x2b9a('0x31')]);_0x342851[_0x2b9a('0x34')]=_['intersection'](_0x129303[_0x2b9a('0x30')],qs[_0x2b9a('0x36')](_0x53f69d[_0x2b9a('0x31')][_0x2b9a('0x36')]));_0x342851[_0x2b9a('0x34')]=_0x342851[_0x2b9a('0x34')][_0x2b9a('0x37')]?_0x342851[_0x2b9a('0x34')]:_0x129303[_0x2b9a('0x30')];if(!_0x53f69d[_0x2b9a('0x31')][_0x2b9a('0x38')]('nolimit')){_0x342851[_0x2b9a('0x1e')]=qs[_0x2b9a('0x1e')](_0x53f69d[_0x2b9a('0x31')][_0x2b9a('0x1e')]);_0x342851[_0x2b9a('0x1c')]=qs[_0x2b9a('0x1c')](_0x53f69d[_0x2b9a('0x31')]['offset']);}_0x342851[_0x2b9a('0x3a')]=qs[_0x2b9a('0x3b')](_0x53f69d[_0x2b9a('0x31')][_0x2b9a('0x3b')]);_0x342851['where']=qs[_0x2b9a('0x33')](_[_0x2b9a('0x5b')](_0x53f69d[_0x2b9a('0x31')],_0x129303[_0x2b9a('0x33')]));_0x342851[_0x2b9a('0x3c')][_0x2b9a('0x57')]=_0x4af86e['id'];if(_0x53f69d['query'][_0x2b9a('0x3d')]){_0x342851['where']=_[_0x2b9a('0x3e')](_0x342851[_0x2b9a('0x3c')],{'$or':_[_0x2b9a('0x2a')](_0x342851[_0x2b9a('0x34')],function(_0x51230a){var _0x5b27a8={};_0x5b27a8[_0x51230a]={'$like':'%'+_0x53f69d[_0x2b9a('0x31')][_0x2b9a('0x3d')]+'%'};return _0x5b27a8;})});}_0x342851=_[_0x2b9a('0x3e')]({},_0x342851,_0x53f69d[_0x2b9a('0x40')]);return db[_0x2b9a('0x5d')][_0x2b9a('0x1f')]({'where':_0x342851['where']})[_0x2b9a('0x23')](function(_0x44342b){_0x177228[_0x2b9a('0x1f')]=_0x44342b;if(_0x53f69d[_0x2b9a('0x31')]['includeAll']){_0x342851[_0x2b9a('0x42')]=[{'all':!![]}];}return db[_0x2b9a('0x5d')]['findAll'](_0x342851);})[_0x2b9a('0x23')](function(_0x492597){_0x177228[_0x2b9a('0x43')]=_0x492597;return _0x177228;});}})[_0x2b9a('0x23')](respondWithFilteredResult(_0x1f6e4b,_0x342851))[_0x2b9a('0x44')](handleError(_0x1f6e4b,null));};exports['getHopperBlacks']=function(_0x2a4c08,_0x56ecb4,_0x25f589){var _0x2ba63c={'raw':!![],'where':{}};var _0x16d333={};var _0x4f5fdf={'count':0x0,'rows':[]};return db['Campaign'][_0x2b9a('0x59')]({'where':{'id':_0x2a4c08['params']['id']}})[_0x2b9a('0x23')](handleEntityNotFound(_0x56ecb4,null))[_0x2b9a('0x23')](function(_0x3eb390){if(_0x3eb390){_0x16d333[_0x2b9a('0x30')]=_[_0x2b9a('0x32')](db[_0x2b9a('0x5e')][_0x2b9a('0x2c')]);_0x16d333[_0x2b9a('0x31')]=_[_0x2b9a('0x32')](_0x2a4c08[_0x2b9a('0x31')]);_0x16d333[_0x2b9a('0x33')]=_['intersection'](_0x16d333['model'],_0x16d333[_0x2b9a('0x31')]);_0x2ba63c[_0x2b9a('0x34')]=_[_0x2b9a('0x35')](_0x16d333[_0x2b9a('0x30')],qs[_0x2b9a('0x36')](_0x2a4c08['query'][_0x2b9a('0x36')]));_0x2ba63c[_0x2b9a('0x34')]=_0x2ba63c[_0x2b9a('0x34')]['length']?_0x2ba63c[_0x2b9a('0x34')]:_0x16d333[_0x2b9a('0x30')];if(!_0x2a4c08[_0x2b9a('0x31')][_0x2b9a('0x38')](_0x2b9a('0x39'))){_0x2ba63c[_0x2b9a('0x1e')]=qs[_0x2b9a('0x1e')](_0x2a4c08[_0x2b9a('0x31')][_0x2b9a('0x1e')]);_0x2ba63c[_0x2b9a('0x1c')]=qs[_0x2b9a('0x1c')](_0x2a4c08['query'][_0x2b9a('0x1c')]);}_0x2ba63c[_0x2b9a('0x3a')]=qs[_0x2b9a('0x3b')](_0x2a4c08[_0x2b9a('0x31')][_0x2b9a('0x3b')]);_0x2ba63c['where']=qs[_0x2b9a('0x33')](_['pick'](_0x2a4c08[_0x2b9a('0x31')],_0x16d333[_0x2b9a('0x33')]));_0x2ba63c[_0x2b9a('0x3c')][_0x2b9a('0x57')]=_0x3eb390['id'];if(_0x2a4c08[_0x2b9a('0x31')][_0x2b9a('0x3d')]){_0x2ba63c[_0x2b9a('0x3c')]=_[_0x2b9a('0x3e')](_0x2ba63c[_0x2b9a('0x3c')],{'$or':_[_0x2b9a('0x2a')](_0x2ba63c[_0x2b9a('0x34')],function(_0x45bb99){var _0x1c185e={};_0x1c185e[_0x45bb99]={'$like':'%'+_0x2a4c08[_0x2b9a('0x31')][_0x2b9a('0x3d')]+'%'};return _0x1c185e;})});}_0x2ba63c=_[_0x2b9a('0x3e')]({},_0x2ba63c,_0x2a4c08[_0x2b9a('0x40')]);return db['CmHopperBlack']['count']({'where':_0x2ba63c[_0x2b9a('0x3c')]})['then'](function(_0x1b6b35){_0x4f5fdf[_0x2b9a('0x1f')]=_0x1b6b35;if(_0x2a4c08[_0x2b9a('0x31')][_0x2b9a('0x41')]){_0x2ba63c[_0x2b9a('0x42')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x2b9a('0x5f')](_0x2ba63c);})[_0x2b9a('0x23')](function(_0x2ccea7){_0x4f5fdf[_0x2b9a('0x43')]=_0x2ccea7;return _0x4f5fdf;});}})[_0x2b9a('0x23')](respondWithFilteredResult(_0x56ecb4,_0x2ba63c))['catch'](handleError(_0x56ecb4,null));};exports[_0x2b9a('0x60')]=function(_0x5ba7de,_0x7d43c7,_0x27e208){var _0x3cbd72={};var _0x289a17={};var _0x651d5b;var _0x5f20b4;return db['Campaign'][_0x2b9a('0x59')]({'where':{'id':_0x5ba7de[_0x2b9a('0x46')]['id']}})['then'](handleEntityNotFound(_0x7d43c7,null))[_0x2b9a('0x23')](function(_0x5ab714){if(_0x5ab714){_0x651d5b=_0x5ab714;_0x289a17[_0x2b9a('0x30')]=_[_0x2b9a('0x32')](db[_0x2b9a('0x61')][_0x2b9a('0x2c')]);_0x289a17['query']=_[_0x2b9a('0x32')](_0x5ba7de[_0x2b9a('0x31')]);_0x289a17[_0x2b9a('0x33')]=_[_0x2b9a('0x35')](_0x289a17[_0x2b9a('0x30')],_0x289a17[_0x2b9a('0x31')]);_0x3cbd72[_0x2b9a('0x34')]=_[_0x2b9a('0x35')](_0x289a17[_0x2b9a('0x30')],qs[_0x2b9a('0x36')](_0x5ba7de['query'][_0x2b9a('0x36')]));_0x3cbd72[_0x2b9a('0x34')]=_0x3cbd72['attributes']['length']?_0x3cbd72[_0x2b9a('0x34')]:_0x289a17[_0x2b9a('0x30')];_0x3cbd72[_0x2b9a('0x3a')]=qs[_0x2b9a('0x3b')](_0x5ba7de[_0x2b9a('0x31')][_0x2b9a('0x3b')]);_0x3cbd72[_0x2b9a('0x3c')]=qs['filters'](_[_0x2b9a('0x5b')](_0x5ba7de[_0x2b9a('0x31')],_0x289a17[_0x2b9a('0x33')]));if(_0x5ba7de[_0x2b9a('0x31')][_0x2b9a('0x3d')]){_0x3cbd72['where']=_[_0x2b9a('0x3e')](_0x3cbd72[_0x2b9a('0x3c')],{'$or':_[_0x2b9a('0x2a')](_0x3cbd72['attributes'],function(_0x4c46af){var _0x3fb8c2={};_0x3fb8c2[_0x4c46af]={'$like':'%'+_0x5ba7de[_0x2b9a('0x31')][_0x2b9a('0x3d')]+'%'};return _0x3fb8c2;})});}_0x3cbd72=_[_0x2b9a('0x3e')]({},_0x3cbd72,_0x5ba7de[_0x2b9a('0x40')]);return _0x651d5b[_0x2b9a('0x60')](_0x3cbd72);}})[_0x2b9a('0x23')](function(_0x24971f){if(_0x24971f){_0x5f20b4=_0x24971f['length'];if(!_0x5ba7de[_0x2b9a('0x31')][_0x2b9a('0x38')](_0x2b9a('0x39'))){_0x3cbd72[_0x2b9a('0x1e')]=qs['limit'](_0x5ba7de[_0x2b9a('0x31')][_0x2b9a('0x1e')]);_0x3cbd72[_0x2b9a('0x1c')]=qs[_0x2b9a('0x1c')](_0x5ba7de[_0x2b9a('0x31')][_0x2b9a('0x1c')]);}return _0x651d5b[_0x2b9a('0x60')](_0x3cbd72);}})[_0x2b9a('0x23')](function(_0x522693){if(_0x522693){return _0x522693?{'count':_0x5f20b4,'rows':_0x522693}:null;}})[_0x2b9a('0x23')](respondWithResult(_0x7d43c7,null))[_0x2b9a('0x44')](handleError(_0x7d43c7,null));};exports['addLists']=function(_0xebb39b,_0x195fa9,_0x1fb0c7){var _0x185c3e,_0x405b91;return db['Campaign'][_0x2b9a('0x47')]({'where':{'id':_0xebb39b['params']['id']}})[_0x2b9a('0x23')](handleEntityNotFound(_0x195fa9,null))[_0x2b9a('0x23')](function(_0x57f9d4){if(_0x57f9d4){_0x405b91=_0x57f9d4;return _0x57f9d4[_0x2b9a('0x62')](_0xebb39b[_0x2b9a('0x51')][_0x2b9a('0x63')],_['omit'](_0xebb39b['body'],['ids','id'])||{});}return null;})['spread'](function(_0x531228){var _0x28e3f9;_0x185c3e=_0x531228||[];var _0x1bc5aa=[];if(_0x531228){for(var _0x28dcbf=0x0;_0x28dcbf<_0x531228[_0x2b9a('0x37')];_0x28dcbf+=0x1){var _0x415a5a=_0x531228[_0x28dcbf][_0x2b9a('0x49')]({'plain':!![]});_0x405b91[_0x2b9a('0x64')]=_0xebb39b['body'][_0x2b9a('0x64')]?_0xebb39b[_0x2b9a('0x51')][_0x2b9a('0x64')]:_0x405b91[_0x2b9a('0x64')];switch(_0x405b91['dialCheckDuplicateType']){case _0x2b9a('0x65'):_0x28e3f9=squel[_0x2b9a('0x66')]()['into'](_0x2b9a('0x67'))[_0x2b9a('0x68')](['phone',_0x2b9a('0x69'),'ContactId','ListId','CampaignId',_0x2b9a('0x4f'),_0x2b9a('0x50')],squel[_0x2b9a('0x6a')]()[_0x2b9a('0x6b')](_0x2b9a('0x6c'),_0x2b9a('0x6c'))[_0x2b9a('0x6b')](_0x2b9a('0x6d'),_0x2b9a('0x69'))['field']('id',_0x2b9a('0x6e'))[_0x2b9a('0x6b')](_0x415a5a['CmListId'][_0x2b9a('0x6f')](),_0x2b9a('0x70'))[_0x2b9a('0x6b')](_0xebb39b[_0x2b9a('0x46')]['id']['toString'](),_0x2b9a('0x57'))[_0x2b9a('0x6b')](_0x2b9a('0x6d'),_0x2b9a('0x4f'))['field'](_0x2b9a('0x6d'),_0x2b9a('0x50'))[_0x2b9a('0x71')](_0x2b9a('0x72'))[_0x2b9a('0x3c')](_0x2b9a('0x73'))['where']('ListId\x20=\x20?',_0x415a5a[_0x2b9a('0x74')][_0x2b9a('0x6f')]())[_0x2b9a('0x3c')](_0x2b9a('0x75'))[_0x2b9a('0x3c')](_0x2b9a('0x76'),squel[_0x2b9a('0x6a')]()['field']('COALESCE(calleridnum,\x27\x27)')[_0x2b9a('0x71')]('cm_hopper_final')[_0x2b9a('0x3c')](_0x2b9a('0x77'),_0xebb39b['params']['id'][_0x2b9a('0x6f')]()))[_0x2b9a('0x3c')](_0x2b9a('0x76'),squel[_0x2b9a('0x6a')]()['field']('COALESCE(phone,\x27\x27)')[_0x2b9a('0x71')](_0x2b9a('0x67'))[_0x2b9a('0x3c')](_0x2b9a('0x77'),_0xebb39b['params']['id']['toString']())))[_0x2b9a('0x6f')]();break;case _0x2b9a('0x78'):_0x28e3f9=squel['insert']()[_0x2b9a('0x79')](_0x2b9a('0x67'))[_0x2b9a('0x68')]([_0x2b9a('0x6c'),'scheduledAt',_0x2b9a('0x6e'),'ListId',_0x2b9a('0x57'),_0x2b9a('0x4f'),'updatedAt'],squel[_0x2b9a('0x6a')]()[_0x2b9a('0x6b')](_0x2b9a('0x6c'),_0x2b9a('0x6c'))['field'](_0x2b9a('0x6d'),_0x2b9a('0x69'))[_0x2b9a('0x6b')]('id',_0x2b9a('0x6e'))[_0x2b9a('0x6b')](_0x415a5a['CmListId'][_0x2b9a('0x6f')](),_0x2b9a('0x70'))[_0x2b9a('0x6b')](_0xebb39b['params']['id'][_0x2b9a('0x6f')](),_0x2b9a('0x57'))['field'](_0x2b9a('0x6d'),_0x2b9a('0x4f'))[_0x2b9a('0x6b')](_0x2b9a('0x6d'),_0x2b9a('0x50'))['from'](_0x2b9a('0x72'))[_0x2b9a('0x3c')](_0x2b9a('0x73'))[_0x2b9a('0x3c')](_0x2b9a('0x7a'),_0x415a5a[_0x2b9a('0x74')]['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0x2b9a('0x3c')]('phone\x20NOT\x20IN\x20(?)',squel[_0x2b9a('0x6a')]()['field']('COALESCE(phone,\x27\x27)')[_0x2b9a('0x71')](_0x2b9a('0x67'))[_0x2b9a('0x3c')](_0x2b9a('0x77'),_0xebb39b[_0x2b9a('0x46')]['id']['toString']())))[_0x2b9a('0x6f')]();break;default:_0x28e3f9=squel['insert']()['into'](_0x2b9a('0x67'))[_0x2b9a('0x68')]([_0x2b9a('0x6c'),_0x2b9a('0x69'),_0x2b9a('0x6e'),_0x2b9a('0x70'),_0x2b9a('0x57'),_0x2b9a('0x4f'),'updatedAt'],squel[_0x2b9a('0x6a')]()['field'](_0x2b9a('0x6c'),_0x2b9a('0x6c'))[_0x2b9a('0x6b')](_0x2b9a('0x6d'),_0x2b9a('0x69'))[_0x2b9a('0x6b')]('id',_0x2b9a('0x6e'))[_0x2b9a('0x6b')](_0x415a5a[_0x2b9a('0x74')][_0x2b9a('0x6f')](),_0x2b9a('0x70'))[_0x2b9a('0x6b')](_0xebb39b[_0x2b9a('0x46')]['id']['toString'](),_0x2b9a('0x57'))[_0x2b9a('0x6b')](_0x2b9a('0x6d'),_0x2b9a('0x4f'))[_0x2b9a('0x6b')](_0x2b9a('0x6d'),_0x2b9a('0x50'))[_0x2b9a('0x71')](_0x2b9a('0x72'))[_0x2b9a('0x3c')]('deletedAt\x20IS\x20NULL')['where'](_0x2b9a('0x7a'),_0x415a5a[_0x2b9a('0x74')]['toString']())['where'](_0x2b9a('0x75')))[_0x2b9a('0x6f')]();}_0x1bc5aa[_0x2b9a('0x7b')](db[_0x2b9a('0x7c')][_0x2b9a('0x31')](_0x28e3f9));}return BPromise[_0x2b9a('0x7d')](_0x1bc5aa);}})['then'](function(){return _0x185c3e;})[_0x2b9a('0x23')](respondWithResult(_0x195fa9,null))[_0x2b9a('0x44')](handleError(_0x195fa9,null));};exports[_0x2b9a('0x7e')]=function(_0x540edf,_0x864fd4,_0x26085b){return db['Campaign'][_0x2b9a('0x47')]({'where':{'id':_0x540edf[_0x2b9a('0x46')]['id']}})[_0x2b9a('0x23')](handleEntityNotFound(_0x864fd4,null))[_0x2b9a('0x23')](function(_0x5ccfef){if(_0x5ccfef){return _0x5ccfef['removeLists'](_0x540edf[_0x2b9a('0x31')][_0x2b9a('0x63')]);}})[_0x2b9a('0x23')](function(_0x486257){if(_0x486257){return db[_0x2b9a('0x56')][_0x2b9a('0x24')]({'where':{'ListId':_0x540edf[_0x2b9a('0x31')][_0x2b9a('0x63')],'CampaignId':_0x540edf[_0x2b9a('0x46')]['id']}})[_0x2b9a('0x23')](function(){return _0x486257;});}})[_0x2b9a('0x23')](respondWithStatusCode(_0x864fd4,null))[_0x2b9a('0x44')](handleError(_0x864fd4,null));};exports['getBlackLists']=function(_0x526531,_0x36a842,_0x4b5e76){var _0xf0c2f4={};var _0x293ce3={};var _0x5cd715;var _0x355ebb;return db[_0x2b9a('0x2b')][_0x2b9a('0x59')]({'where':{'id':_0x526531[_0x2b9a('0x46')]['id']}})[_0x2b9a('0x23')](handleEntityNotFound(_0x36a842,null))[_0x2b9a('0x23')](function(_0x38c838){if(_0x38c838){_0x5cd715=_0x38c838;_0x293ce3[_0x2b9a('0x30')]=_['keys'](db[_0x2b9a('0x61')][_0x2b9a('0x2c')]);_0x293ce3[_0x2b9a('0x31')]=_[_0x2b9a('0x32')](_0x526531['query']);_0x293ce3[_0x2b9a('0x33')]=_[_0x2b9a('0x35')](_0x293ce3[_0x2b9a('0x30')],_0x293ce3[_0x2b9a('0x31')]);_0xf0c2f4[_0x2b9a('0x34')]=_[_0x2b9a('0x35')](_0x293ce3[_0x2b9a('0x30')],qs['fields'](_0x526531[_0x2b9a('0x31')][_0x2b9a('0x36')]));_0xf0c2f4[_0x2b9a('0x34')]=_0xf0c2f4[_0x2b9a('0x34')]['length']?_0xf0c2f4[_0x2b9a('0x34')]:_0x293ce3[_0x2b9a('0x30')];_0xf0c2f4['order']=qs['sort'](_0x526531[_0x2b9a('0x31')][_0x2b9a('0x3b')]);_0xf0c2f4[_0x2b9a('0x3c')]=qs[_0x2b9a('0x33')](_[_0x2b9a('0x5b')](_0x526531[_0x2b9a('0x31')],_0x293ce3[_0x2b9a('0x33')]));if(_0x526531[_0x2b9a('0x31')][_0x2b9a('0x3d')]){_0xf0c2f4[_0x2b9a('0x3c')]=_[_0x2b9a('0x3e')](_0xf0c2f4[_0x2b9a('0x3c')],{'$or':_[_0x2b9a('0x2a')](_0xf0c2f4[_0x2b9a('0x34')],function(_0x35f69c){var _0x4051e6={};_0x4051e6[_0x35f69c]={'$like':'%'+_0x526531[_0x2b9a('0x31')][_0x2b9a('0x3d')]+'%'};return _0x4051e6;})});}_0xf0c2f4=_[_0x2b9a('0x3e')]({},_0xf0c2f4,_0x526531[_0x2b9a('0x40')]);return _0x5cd715[_0x2b9a('0x7f')](_0xf0c2f4);}})[_0x2b9a('0x23')](function(_0x48b7cb){if(_0x48b7cb){_0x355ebb=_0x48b7cb[_0x2b9a('0x37')];if(!_0x526531[_0x2b9a('0x31')][_0x2b9a('0x38')](_0x2b9a('0x39'))){_0xf0c2f4[_0x2b9a('0x1e')]=qs[_0x2b9a('0x1e')](_0x526531[_0x2b9a('0x31')][_0x2b9a('0x1e')]);_0xf0c2f4[_0x2b9a('0x1c')]=qs[_0x2b9a('0x1c')](_0x526531[_0x2b9a('0x31')][_0x2b9a('0x1c')]);}return _0x5cd715[_0x2b9a('0x7f')](_0xf0c2f4);}})['then'](function(_0x330b2b){if(_0x330b2b){return _0x330b2b?{'count':_0x355ebb,'rows':_0x330b2b}:null;}})['then'](respondWithResult(_0x36a842,null))[_0x2b9a('0x44')](handleError(_0x36a842,null));};exports[_0x2b9a('0x80')]=function(_0x5b1008,_0xcac6f3,_0x28e626){var _0x412a8d,_0xb4b702;return db[_0x2b9a('0x2b')][_0x2b9a('0x47')]({'where':{'id':_0x5b1008[_0x2b9a('0x46')]['id']}})[_0x2b9a('0x23')](handleEntityNotFound(_0xcac6f3,null))[_0x2b9a('0x23')](function(_0x1fa33e){if(_0x1fa33e){_0xb4b702=_0x1fa33e;return _0x1fa33e[_0x2b9a('0x80')](_0x5b1008['body'][_0x2b9a('0x63')],_[_0x2b9a('0x4e')](_0x5b1008[_0x2b9a('0x51')],[_0x2b9a('0x63'),'id'])||{});}return null;})[_0x2b9a('0x81')](function(_0x1d26bc){var _0x58f8ad;_0x412a8d=_0x1d26bc||[];var _0x58af68=[];if(_0x1d26bc){for(var _0xf15472=0x0;_0xf15472<_0x1d26bc['length'];_0xf15472+=0x1){var _0x5f578b=_0x1d26bc[_0xf15472]['get']({'plain':!![]});_0x58f8ad=squel[_0x2b9a('0x66')]()['into'](_0x2b9a('0x82'))[_0x2b9a('0x68')](['phone','ContactId',_0x2b9a('0x70'),'CampaignId','createdAt',_0x2b9a('0x50')],squel[_0x2b9a('0x6a')]()['field'](_0x2b9a('0x6c'),_0x2b9a('0x6c'))[_0x2b9a('0x6b')]('id',_0x2b9a('0x6e'))[_0x2b9a('0x6b')](_0x5f578b[_0x2b9a('0x74')][_0x2b9a('0x6f')](),_0x2b9a('0x70'))[_0x2b9a('0x6b')](_0x5b1008[_0x2b9a('0x46')]['id'][_0x2b9a('0x6f')](),_0x2b9a('0x57'))[_0x2b9a('0x6b')](_0x2b9a('0x6d'),_0x2b9a('0x4f'))[_0x2b9a('0x6b')](_0x2b9a('0x6d'),_0x2b9a('0x50'))[_0x2b9a('0x71')](_0x2b9a('0x72'))['where'](_0x2b9a('0x73'))[_0x2b9a('0x3c')](_0x2b9a('0x7a'),_0x5f578b[_0x2b9a('0x74')]['toString']())[_0x2b9a('0x3c')](_0x2b9a('0x75')))['toString']();_0x58af68[_0x2b9a('0x7b')](db[_0x2b9a('0x7c')][_0x2b9a('0x31')](_0x58f8ad));}return BPromise['all'](_0x58af68);}})['then'](function(){return _0x412a8d;})[_0x2b9a('0x23')](respondWithResult(_0xcac6f3,null))['catch'](handleError(_0xcac6f3,null));};exports[_0x2b9a('0x83')]=function(_0x3d75d2,_0x5a9ee2,_0x37a48c){return db[_0x2b9a('0x2b')][_0x2b9a('0x47')]({'where':{'id':_0x3d75d2['params']['id']}})[_0x2b9a('0x23')](handleEntityNotFound(_0x5a9ee2,null))[_0x2b9a('0x23')](function(_0x1c412b){if(_0x1c412b){return _0x1c412b[_0x2b9a('0x83')](_0x3d75d2[_0x2b9a('0x31')][_0x2b9a('0x63')]);}})['then'](function(_0x5b9e3d){if(_0x5b9e3d){return db[_0x2b9a('0x5e')][_0x2b9a('0x24')]({'where':{'ListId':_0x3d75d2['query'][_0x2b9a('0x63')],'CampaignId':_0x3d75d2['params']['id']}})[_0x2b9a('0x23')](function(){return _0x5b9e3d;});}})[_0x2b9a('0x23')](respondWithStatusCode(_0x5a9ee2,null))['catch'](handleError(_0x5a9ee2,null));};
\ No newline at end of file
index 312e831..9b121d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x12a024,_0x5e97e3){var _0x36efad=function(_0x1a6c14){while(--_0x1a6c14){_0x12a024['push'](_0x12a024['shift']());}};_0x36efad(++_0x5e97e3);}(_0x7a54,0x106));var _0x47a5=function(_0x420280,_0x13dec6){_0x420280=_0x420280-0x0;var _0x2279b8=_0x7a54[_0x420280];return _0x2279b8;};'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 c663919..458a09f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a32=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','request','info','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','options','raw','where','attributes','include','map','model','then','stringify'];(function(_0x3dd3d9,_0x88c6d){var _0x3d2119=function(_0x4d960c){while(--_0x4d960c){_0x3dd3d9['push'](_0x3dd3d9['shift']());}};_0x3d2119(++_0x88c6d);}(_0x3a32,0x9b));var _0x23a3=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x3a32[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0x23a3('0x0'));var util=require(_0x23a3('0x1'));var moment=require(_0x23a3('0x2'));var BPromise=require(_0x23a3('0x3'));var rs=require(_0x23a3('0x4'));var fs=require('fs');var Redis=require(_0x23a3('0x5'));var db=require(_0x23a3('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x23a3('0x7'));var config=require(_0x23a3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x23a3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x103499,_0x256bcf,_0xd4e907){return new BPromise(function(_0x2562bc,_0x11d423){return client[_0x23a3('0xa')](_0x103499,_0xd4e907)['then'](function(_0x233b17){logger[_0x23a3('0xb')]('Campaign,\x20%s,\x20%s',_0x256bcf,'request\x20sent');logger[_0x23a3('0xc')](_0x23a3('0xd'),_0x256bcf,_0x23a3('0xe'),JSON['stringify'](_0x233b17));if(_0x233b17[_0x23a3('0xf')]){if(_0x233b17['error'][_0x23a3('0x10')]===0x1f4){logger[_0x23a3('0xf')](_0x23a3('0x11'),_0x256bcf,_0x233b17['error'][_0x23a3('0x12')]);return _0x11d423(_0x233b17[_0x23a3('0xf')][_0x23a3('0x12')]);}logger[_0x23a3('0xf')](_0x23a3('0x11'),_0x256bcf,_0x233b17['error'][_0x23a3('0x12')]);return _0x2562bc(_0x233b17[_0x23a3('0xf')]['message']);}else{logger[_0x23a3('0xb')](_0x23a3('0x11'),_0x256bcf,'request\x20sent');_0x2562bc(_0x233b17[_0x23a3('0x13')][_0x23a3('0x12')]);}})[_0x23a3('0x14')](function(_0x3e3cc1){logger[_0x23a3('0xf')](_0x23a3('0x11'),_0x256bcf,_0x3e3cc1);_0x11d423(_0x3e3cc1);});});}exports[_0x23a3('0x15')]=function(_0xc33cbd){var _0x53f4e8=this;return new Promise(function(_0x3961e9,_0x2303d2){return db['Campaign']['findAll']({'raw':_0xc33cbd[_0x23a3('0x16')]?_0xc33cbd[_0x23a3('0x16')][_0x23a3('0x17')]===undefined?!![]:![]:!![],'where':_0xc33cbd[_0x23a3('0x16')]?_0xc33cbd[_0x23a3('0x16')][_0x23a3('0x18')]||null:null,'attributes':_0xc33cbd[_0x23a3('0x16')]?_0xc33cbd[_0x23a3('0x16')][_0x23a3('0x19')]||null:null,'limit':_0xc33cbd[_0x23a3('0x16')]?_0xc33cbd[_0x23a3('0x16')]['limit']||null:null,'include':_0xc33cbd[_0x23a3('0x16')]?_0xc33cbd[_0x23a3('0x16')][_0x23a3('0x1a')]?_[_0x23a3('0x1b')](_0xc33cbd[_0x23a3('0x16')][_0x23a3('0x1a')],function(_0x509aa3){return{'model':db[_0x509aa3[_0x23a3('0x1c')]],'as':_0x509aa3['as'],'attributes':_0x509aa3['attributes'],'include':_0x509aa3[_0x23a3('0x1a')]?_['map'](_0x509aa3[_0x23a3('0x1a')],function(_0x525b5f){return{'model':db[_0x525b5f[_0x23a3('0x1c')]],'as':_0x525b5f['as'],'attributes':_0x525b5f['attributes'],'include':_0x525b5f[_0x23a3('0x1a')]?_[_0x23a3('0x1b')](_0x525b5f['include'],function(_0x333998){return{'model':db[_0x333998[_0x23a3('0x1c')]],'as':_0x333998['as'],'attributes':_0x333998[_0x23a3('0x19')]};}):[]};}):[]};}):[]:[]})[_0x23a3('0x1d')](function(_0x2ace31){logger['info'](_0x23a3('0x15'),_0xc33cbd);logger[_0x23a3('0xc')](_0x23a3('0x15'),_0xc33cbd,JSON[_0x23a3('0x1e')](_0x2ace31));_0x3961e9(_0x2ace31);})[_0x23a3('0x14')](function(_0x35519f){logger[_0x23a3('0xf')](_0x23a3('0x15'),_0x35519f['message'],_0xc33cbd);_0x2303d2(_0x53f4e8[_0x23a3('0xf')](0x1f4,_0x35519f[_0x23a3('0x12')]));});});};
\ No newline at end of file
+var _0xf257=['map','model','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','where','attributes','limit','include'];(function(_0x56a6f0,_0x584bb5){var _0xda929b=function(_0x136343){while(--_0x136343){_0x56a6f0['push'](_0x56a6f0['shift']());}};_0xda929b(++_0x584bb5);}(_0xf257,0x82));var _0x7f25=function(_0x2a4a61,_0x3c3cae){_0x2a4a61=_0x2a4a61-0x0;var _0x308182=_0xf257[_0x2a4a61];return _0x308182;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7f25('0x0'));var BPromise=require(_0x7f25('0x1'));var rs=require(_0x7f25('0x2'));var fs=require('fs');var Redis=require(_0x7f25('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7f25('0x4'));var logger=require(_0x7f25('0x5'))(_0x7f25('0x6'));var config=require(_0x7f25('0x7'));var jayson=require(_0x7f25('0x8'));var client=jayson[_0x7f25('0x9')][_0x7f25('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x242a3e,_0x369a09,_0x16e278){return new BPromise(function(_0x31a5d8,_0x1ae607){return client[_0x7f25('0xb')](_0x242a3e,_0x16e278)[_0x7f25('0xc')](function(_0x57ba17){logger[_0x7f25('0xd')](_0x7f25('0xe'),_0x369a09,'request\x20sent');logger['debug'](_0x7f25('0xf'),_0x369a09,'request\x20sent',JSON[_0x7f25('0x10')](_0x57ba17));if(_0x57ba17[_0x7f25('0x11')]){if(_0x57ba17[_0x7f25('0x11')][_0x7f25('0x12')]===0x1f4){logger[_0x7f25('0x11')](_0x7f25('0xe'),_0x369a09,_0x57ba17[_0x7f25('0x11')]['message']);return _0x1ae607(_0x57ba17['error'][_0x7f25('0x13')]);}logger['error'](_0x7f25('0xe'),_0x369a09,_0x57ba17[_0x7f25('0x11')][_0x7f25('0x13')]);return _0x31a5d8(_0x57ba17[_0x7f25('0x11')][_0x7f25('0x13')]);}else{logger['info']('Campaign,\x20%s,\x20%s',_0x369a09,'request\x20sent');_0x31a5d8(_0x57ba17[_0x7f25('0x14')][_0x7f25('0x13')]);}})[_0x7f25('0x15')](function(_0x167363){logger[_0x7f25('0x11')](_0x7f25('0xe'),_0x369a09,_0x167363);_0x1ae607(_0x167363);});});}exports[_0x7f25('0x16')]=function(_0x26d4aa){var _0x5e0067=this;return new Promise(function(_0x23f30c,_0x1cd6c1){return db[_0x7f25('0x17')][_0x7f25('0x18')]({'raw':_0x26d4aa[_0x7f25('0x19')]?_0x26d4aa[_0x7f25('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x26d4aa['options']?_0x26d4aa[_0x7f25('0x19')][_0x7f25('0x1a')]||null:null,'attributes':_0x26d4aa[_0x7f25('0x19')]?_0x26d4aa[_0x7f25('0x19')][_0x7f25('0x1b')]||null:null,'limit':_0x26d4aa[_0x7f25('0x19')]?_0x26d4aa[_0x7f25('0x19')][_0x7f25('0x1c')]||null:null,'include':_0x26d4aa[_0x7f25('0x19')]?_0x26d4aa['options'][_0x7f25('0x1d')]?_[_0x7f25('0x1e')](_0x26d4aa[_0x7f25('0x19')][_0x7f25('0x1d')],function(_0x29039a){return{'model':db[_0x29039a['model']],'as':_0x29039a['as'],'attributes':_0x29039a[_0x7f25('0x1b')],'include':_0x29039a[_0x7f25('0x1d')]?_[_0x7f25('0x1e')](_0x29039a['include'],function(_0x17b38c){return{'model':db[_0x17b38c['model']],'as':_0x17b38c['as'],'attributes':_0x17b38c[_0x7f25('0x1b')],'include':_0x17b38c[_0x7f25('0x1d')]?_[_0x7f25('0x1e')](_0x17b38c[_0x7f25('0x1d')],function(_0x382fd4){return{'model':db[_0x382fd4[_0x7f25('0x1f')]],'as':_0x382fd4['as'],'attributes':_0x382fd4[_0x7f25('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7f25('0xc')](function(_0x44116d){logger[_0x7f25('0xd')]('GetCampaign',_0x26d4aa);logger['debug'](_0x7f25('0x16'),_0x26d4aa,JSON[_0x7f25('0x10')](_0x44116d));_0x23f30c(_0x44116d);})['catch'](function(_0xa373ee){logger[_0x7f25('0x11')](_0x7f25('0x16'),_0xa373ee[_0x7f25('0x13')],_0x26d4aa);_0x1cd6c1(_0x5e0067[_0x7f25('0x11')](0x1f4,_0xa373ee[_0x7f25('0x13')]));});});};
\ No newline at end of file
index d72bfd8..44d8508 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8150=['clone','addLists','put','delete','destroy','removeBlackLists','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone'];(function(_0x377e4d,_0x340622){var _0x5e1808=function(_0x2bf3dc){while(--_0x2bf3dc){_0x377e4d['push'](_0x377e4d['shift']());}};_0x5e1808(++_0x340622);}(_0x8150,0x1a7));var _0x0815=function(_0xbf4805,_0x1c479a){_0xbf4805=_0xbf4805-0x0;var _0x329242=_0x8150[_0xbf4805];return _0x329242;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x0815('0x0'));var express=require(_0x0815('0x1'));var router=express[_0x0815('0x2')]();var fs_extra=require(_0x0815('0x3'));var auth=require(_0x0815('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0815('0x5'));var controller=require('./campaign.controller');router[_0x0815('0x6')]('/',auth[_0x0815('0x7')](),controller[_0x0815('0x8')]);router['get'](_0x0815('0x9'),auth[_0x0815('0x7')](),controller[_0x0815('0xa')]);router[_0x0815('0x6')](_0x0815('0xb'),auth[_0x0815('0x7')](),controller[_0x0815('0xc')]);router[_0x0815('0x6')](_0x0815('0xd'),auth[_0x0815('0x7')](),controller[_0x0815('0xe')]);router[_0x0815('0x6')]('/:id/hopper_finals',auth[_0x0815('0x7')](),controller[_0x0815('0xf')]);router['get'](_0x0815('0x10'),auth[_0x0815('0x7')](),controller[_0x0815('0x11')]);router['get'](_0x0815('0x12'),auth[_0x0815('0x7')](),controller[_0x0815('0x13')]);router[_0x0815('0x6')](_0x0815('0x14'),auth['isAuthenticated'](),controller[_0x0815('0x15')]);router[_0x0815('0x16')]('/',auth[_0x0815('0x7')](),controller[_0x0815('0x17')]);router[_0x0815('0x16')](_0x0815('0x18'),auth[_0x0815('0x7')](),controller[_0x0815('0x19')]);router[_0x0815('0x16')](_0x0815('0x12'),auth[_0x0815('0x7')](),controller[_0x0815('0x1a')]);router['post'](_0x0815('0x14'),auth[_0x0815('0x7')](),controller['addBlackLists']);router[_0x0815('0x1b')](_0x0815('0x9'),auth[_0x0815('0x7')](),controller['update']);router[_0x0815('0x1c')]('/:id',auth[_0x0815('0x7')](),controller[_0x0815('0x1d')]);router[_0x0815('0x1c')](_0x0815('0x12'),auth[_0x0815('0x7')](),controller['removeLists']);router['delete'](_0x0815('0x14'),auth['isAuthenticated'](),controller[_0x0815('0x1e')]);module[_0x0815('0x1f')]=router;
\ No newline at end of file
+var _0x2f63=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./campaign.controller','index','get','/:id','show','/:id/hoppers','isAuthenticated','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','post','clone','addLists','update','delete','removeLists','removeBlackLists','exports','util'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x2f63,0x116));var _0x32f6=function(_0x351b46,_0x26b265){_0x351b46=_0x351b46-0x0;var _0x1515df=_0x2f63[_0x351b46];return _0x1515df;};'use strict';var multer=require('multer');var util=require(_0x32f6('0x0'));var path=require(_0x32f6('0x1'));var timeout=require(_0x32f6('0x2'));var express=require('express');var router=express[_0x32f6('0x3')]();var fs_extra=require(_0x32f6('0x4'));var auth=require(_0x32f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x32f6('0x6'));var controller=require(_0x32f6('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x32f6('0x8')]);router[_0x32f6('0x9')](_0x32f6('0xa'),auth['isAuthenticated'](),controller[_0x32f6('0xb')]);router[_0x32f6('0x9')](_0x32f6('0xc'),auth[_0x32f6('0xd')](),controller[_0x32f6('0xe')]);router['get'](_0x32f6('0xf'),auth[_0x32f6('0xd')](),controller[_0x32f6('0x10')]);router[_0x32f6('0x9')](_0x32f6('0x11'),auth[_0x32f6('0xd')](),controller['getHopperFinals']);router['get'](_0x32f6('0x12'),auth[_0x32f6('0xd')](),controller[_0x32f6('0x13')]);router[_0x32f6('0x9')](_0x32f6('0x14'),auth[_0x32f6('0xd')](),controller['getLists']);router['get'](_0x32f6('0x15'),auth[_0x32f6('0xd')](),controller[_0x32f6('0x16')]);router['post']('/',auth[_0x32f6('0xd')](),controller['create']);router[_0x32f6('0x17')]('/:id/clone',auth[_0x32f6('0xd')](),controller[_0x32f6('0x18')]);router[_0x32f6('0x17')](_0x32f6('0x14'),auth[_0x32f6('0xd')](),controller[_0x32f6('0x19')]);router[_0x32f6('0x17')]('/:id/blacklists',auth['isAuthenticated'](),controller['addBlackLists']);router['put'](_0x32f6('0xa'),auth['isAuthenticated'](),controller[_0x32f6('0x1a')]);router[_0x32f6('0x1b')](_0x32f6('0xa'),auth[_0x32f6('0xd')](),controller['destroy']);router['delete'](_0x32f6('0x14'),auth['isAuthenticated'](),controller[_0x32f6('0x1c')]);router[_0x32f6('0x1b')]('/:id/blacklists',auth[_0x32f6('0xd')](),controller[_0x32f6('0x1d')]);module[_0x32f6('0x1e')]=router;
\ No newline at end of file
index a4d6c29..e916765 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a57=['exports','STRING','TEXT','key','sequelize'];(function(_0x29e2c8,_0x14f9c4){var _0x213bfe=function(_0x40cc10){while(--_0x40cc10){_0x29e2c8['push'](_0x29e2c8['shift']());}};_0x213bfe(++_0x14f9c4);}(_0x9a57,0x9f));var _0x79a5=function(_0x4bb145,_0x3e7d33){_0x4bb145=_0x4bb145-0x0;var _0x4db596=_0x9a57[_0x4bb145];return _0x4db596;};'use strict';var Sequelize=require(_0x79a5('0x0'));module[_0x79a5('0x1')]={'key':{'type':Sequelize[_0x79a5('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x79a5('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x79a5('0x4'));}}};
\ No newline at end of file
+var _0x7a03=['getDataValue','key','sequelize','exports','STRING','TEXT','VIRTUAL'];(function(_0x4bcf1,_0x178250){var _0x16d873=function(_0x34a478){while(--_0x34a478){_0x4bcf1['push'](_0x4bcf1['shift']());}};_0x16d873(++_0x178250);}(_0x7a03,0x198));var _0x37a0=function(_0x2c3b44,_0x1e97ec){_0x2c3b44=_0x2c3b44-0x0;var _0x1c125a=_0x7a03[_0x2c3b44];return _0x1c125a;};'use strict';var Sequelize=require(_0x37a0('0x0'));module[_0x37a0('0x1')]={'key':{'type':Sequelize[_0x37a0('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x37a0('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x37a0('0x2')]},'name':{'type':Sequelize[_0x37a0('0x4')],'get':function(){return this[_0x37a0('0x5')](_0x37a0('0x6'));}}};
\ No newline at end of file
index 1b28eae..bc954e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb42=['bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','then','get','UserProfileResource','error','name','index','map','CannedAnswer','rawAttributes','fieldName','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','includeAll','include','findAll','rows','show','params','keys','intersection','options','find','catch','body','destroy','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x13832c,_0x3cf2cd){var _0x500659=function(_0x25c47d){while(--_0x25c47d){_0x13832c['push'](_0x13832c['shift']());}};_0x500659(++_0x3cf2cd);}(_0xfb42,0xa5));var _0x2fb4=function(_0x35b5d1,_0x4df906){_0x35b5d1=_0x35b5d1-0x0;var _0x4d8c8a=_0xfb42[_0x35b5d1];return _0x4d8c8a;};'use strict';var emlformat=require(_0x2fb4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2fb4('0x1'));var jsonpatch=require(_0x2fb4('0x2'));var rp=require(_0x2fb4('0x3'));var moment=require(_0x2fb4('0x4'));var BPromise=require(_0x2fb4('0x5'));var Mustache=require(_0x2fb4('0x6'));var util=require('util');var path=require(_0x2fb4('0x7'));var sox=require(_0x2fb4('0x8'));var csv=require('to-csv');var ejs=require(_0x2fb4('0x9'));var fs=require('fs');var fs_extra=require(_0x2fb4('0xa'));var _=require(_0x2fb4('0xb'));var squel=require(_0x2fb4('0xc'));var crypto=require(_0x2fb4('0xd'));var jsforce=require(_0x2fb4('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2fb4('0xf'));var querystring=require('querystring');var Papa=require(_0x2fb4('0x10'));var Redis=require(_0x2fb4('0x11'));var authService=require(_0x2fb4('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2fb4('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2fb4('0x14'))(_0x2fb4('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2fb4('0x16'))['db'];function respondWithStatusCode(_0x32d058,_0x18c020){_0x18c020=_0x18c020||0xcc;return function(_0x2d8fdc){if(_0x2d8fdc){return _0x32d058[_0x2fb4('0x17')](_0x18c020);}return _0x32d058[_0x2fb4('0x18')](_0x18c020)[_0x2fb4('0x19')]();};}function respondWithResult(_0x590f5e,_0x64a80e){_0x64a80e=_0x64a80e||0xc8;return function(_0x5d5a82){if(_0x5d5a82){return _0x590f5e[_0x2fb4('0x18')](_0x64a80e)[_0x2fb4('0x1a')](_0x5d5a82);}};}function respondWithFilteredResult(_0x3a9d81,_0x2cfa67){return function(_0x11eceb){if(_0x11eceb){var _0x5cd16a=typeof _0x2cfa67[_0x2fb4('0x1b')]===_0x2fb4('0x1c')&&typeof _0x2cfa67['limit']==='undefined';var _0x2fdb72=_0x11eceb[_0x2fb4('0x1d')];var _0x1115bc=_0x5cd16a?0x0:_0x2cfa67[_0x2fb4('0x1b')];var _0x13fdc9=_0x5cd16a?_0x11eceb['count']:_0x2cfa67[_0x2fb4('0x1b')]+_0x2cfa67[_0x2fb4('0x1e')];var _0x701ef4;if(_0x13fdc9>=_0x2fdb72){_0x13fdc9=_0x2fdb72;_0x701ef4=0xc8;}else{_0x701ef4=0xce;}_0x3a9d81[_0x2fb4('0x18')](_0x701ef4);return _0x3a9d81[_0x2fb4('0x1f')]('Content-Range',_0x1115bc+'-'+_0x13fdc9+'/'+_0x2fdb72)[_0x2fb4('0x1a')](_0x11eceb);}return null;};}function patchUpdates(_0x1705f6){return function(_0xda8a3c){try{jsonpatch[_0x2fb4('0x20')](_0xda8a3c,_0x1705f6,!![]);}catch(_0x25c3fa){return BPromise[_0x2fb4('0x21')](_0x25c3fa);}return _0xda8a3c[_0x2fb4('0x22')]();};}function saveUpdates(_0x3b838d,_0x515529){return function(_0x413a66){if(_0x413a66){return _0x413a66['update'](_0x3b838d)[_0x2fb4('0x23')](function(_0x3885b3){return _0x3885b3;});}return null;};}function removeEntity(_0x5d2ce4,_0x51eaae){return function(_0x2353c9){if(_0x2353c9){return _0x2353c9['destroy']()[_0x2fb4('0x23')](function(){var _0x2d4a95=_0x2353c9[_0x2fb4('0x24')]({'plain':!![]});var _0x270ba6='CannedAnswers';return db[_0x2fb4('0x25')]['destroy']({'where':{'type':_0x270ba6,'resourceId':_0x2d4a95['id']}})[_0x2fb4('0x23')](function(){return _0x2353c9;});})[_0x2fb4('0x23')](function(){_0x5d2ce4[_0x2fb4('0x18')](0xcc)[_0x2fb4('0x19')]();});}};}function handleEntityNotFound(_0x56858b,_0x426996){return function(_0x1a9363){if(!_0x1a9363){_0x56858b[_0x2fb4('0x17')](0x194);}return _0x1a9363;};}function handleError(_0x1d46a8,_0x3b0fd6){_0x3b0fd6=_0x3b0fd6||0x1f4;return function(_0x239e23){logger[_0x2fb4('0x26')](_0x239e23['stack']);if(_0x239e23[_0x2fb4('0x27')]){delete _0x239e23['name'];}_0x1d46a8[_0x2fb4('0x18')](_0x3b0fd6)['send'](_0x239e23);};}exports[_0x2fb4('0x28')]=function(_0x43c0f0,_0xe1cb19){var _0x4f81fb={},_0x56d65e={},_0x25377e={'count':0x0,'rows':[]};var _0xbb658b=_[_0x2fb4('0x29')](db[_0x2fb4('0x2a')][_0x2fb4('0x2b')],function(_0x2f9c59){return{'name':_0x2f9c59[_0x2fb4('0x2c')],'type':_0x2f9c59['type']['key']};});_0x56d65e[_0x2fb4('0x2d')]=_['map'](_0xbb658b,_0x2fb4('0x27'));_0x56d65e[_0x2fb4('0x2e')]=_['keys'](_0x43c0f0[_0x2fb4('0x2e')]);_0x56d65e['filters']=_['intersection'](_0x56d65e[_0x2fb4('0x2d')],_0x56d65e[_0x2fb4('0x2e')]);_0x4f81fb[_0x2fb4('0x2f')]=_['intersection'](_0x56d65e[_0x2fb4('0x2d')],qs[_0x2fb4('0x30')](_0x43c0f0[_0x2fb4('0x2e')][_0x2fb4('0x30')]));_0x4f81fb[_0x2fb4('0x2f')]=_0x4f81fb[_0x2fb4('0x2f')][_0x2fb4('0x31')]?_0x4f81fb[_0x2fb4('0x2f')]:_0x56d65e[_0x2fb4('0x2d')];if(!_0x43c0f0[_0x2fb4('0x2e')][_0x2fb4('0x32')](_0x2fb4('0x33'))){_0x4f81fb[_0x2fb4('0x1e')]=qs[_0x2fb4('0x1e')](_0x43c0f0[_0x2fb4('0x2e')][_0x2fb4('0x1e')]);_0x4f81fb['offset']=qs[_0x2fb4('0x1b')](_0x43c0f0[_0x2fb4('0x2e')][_0x2fb4('0x1b')]);}_0x4f81fb[_0x2fb4('0x34')]=qs[_0x2fb4('0x35')](_0x43c0f0['query']['sort']);_0x4f81fb['where']=qs[_0x2fb4('0x36')](_[_0x2fb4('0x37')](_0x43c0f0[_0x2fb4('0x2e')],_0x56d65e[_0x2fb4('0x36')]),_0xbb658b);if(_0x43c0f0[_0x2fb4('0x2e')][_0x2fb4('0x38')]){_0x4f81fb[_0x2fb4('0x39')]=_[_0x2fb4('0x3a')](_0x4f81fb[_0x2fb4('0x39')],{'$or':[{'key':{'$like':'%'+_0x43c0f0[_0x2fb4('0x2e')][_0x2fb4('0x38')]+'%'}},{'value':{'$like':'%'+_0x43c0f0[_0x2fb4('0x2e')][_0x2fb4('0x38')]+'%'}}]});}_0x4f81fb=_[_0x2fb4('0x3a')]({},_0x4f81fb,_0x43c0f0['options']);var _0x5aaa1c={'where':_0x4f81fb[_0x2fb4('0x39')]};return db[_0x2fb4('0x2a')][_0x2fb4('0x1d')](_0x5aaa1c)['then'](function(_0x21a44e){_0x25377e['count']=_0x21a44e;if(_0x43c0f0[_0x2fb4('0x2e')][_0x2fb4('0x3b')]){_0x4f81fb[_0x2fb4('0x3c')]=[{'all':!![]}];}return db[_0x2fb4('0x2a')][_0x2fb4('0x3d')](_0x4f81fb);})[_0x2fb4('0x23')](function(_0x54285d){_0x25377e[_0x2fb4('0x3e')]=_0x54285d;return _0x25377e;})['then'](respondWithFilteredResult(_0xe1cb19,_0x4f81fb))['catch'](handleError(_0xe1cb19,null));};exports[_0x2fb4('0x3f')]=function(_0x1d83d5,_0x106000){var _0x42ae26={'raw':!![],'where':{'id':_0x1d83d5[_0x2fb4('0x40')]['id']}},_0x1b4f17={};_0x1b4f17['model']=_[_0x2fb4('0x41')](db[_0x2fb4('0x2a')][_0x2fb4('0x2b')]);_0x1b4f17['query']=_['keys'](_0x1d83d5[_0x2fb4('0x2e')]);_0x1b4f17[_0x2fb4('0x36')]=_[_0x2fb4('0x42')](_0x1b4f17['model'],_0x1b4f17['query']);_0x42ae26[_0x2fb4('0x2f')]=_[_0x2fb4('0x42')](_0x1b4f17[_0x2fb4('0x2d')],qs[_0x2fb4('0x30')](_0x1d83d5[_0x2fb4('0x2e')][_0x2fb4('0x30')]));_0x42ae26[_0x2fb4('0x2f')]=_0x42ae26['attributes']['length']?_0x42ae26['attributes']:_0x1b4f17['model'];if(_0x1d83d5[_0x2fb4('0x2e')][_0x2fb4('0x3b')]){_0x42ae26['include']=[{'all':!![]}];}_0x42ae26=_[_0x2fb4('0x3a')]({},_0x42ae26,_0x1d83d5[_0x2fb4('0x43')]);return db[_0x2fb4('0x2a')][_0x2fb4('0x44')](_0x42ae26)[_0x2fb4('0x23')](handleEntityNotFound(_0x106000,null))[_0x2fb4('0x23')](respondWithResult(_0x106000,null))[_0x2fb4('0x45')](handleError(_0x106000,null));};exports['update']=function(_0x361f33,_0x5c5e2b){if(_0x361f33[_0x2fb4('0x46')]['id']){delete _0x361f33['body']['id'];}return db[_0x2fb4('0x2a')][_0x2fb4('0x44')]({'where':{'id':_0x361f33['params']['id']}})['then'](handleEntityNotFound(_0x5c5e2b,null))[_0x2fb4('0x23')](saveUpdates(_0x361f33['body'],null))[_0x2fb4('0x23')](respondWithResult(_0x5c5e2b,null))[_0x2fb4('0x45')](handleError(_0x5c5e2b,null));};exports[_0x2fb4('0x47')]=function(_0x47e071,_0x234730){return db[_0x2fb4('0x2a')][_0x2fb4('0x44')]({'where':{'id':_0x47e071[_0x2fb4('0x40')]['id']}})[_0x2fb4('0x23')](handleEntityNotFound(_0x234730,null))[_0x2fb4('0x23')](removeEntity(_0x234730,null))[_0x2fb4('0x45')](handleError(_0x234730,null));};exports[_0x2fb4('0x48')]=function(_0x446bdd,_0x317efc){var _0x362a6d={'key':_0x446bdd[_0x2fb4('0x46')][_0x2fb4('0x49')]};if(_0x446bdd[_0x2fb4('0x46')]['MailAccountId']){_0x362a6d[_0x2fb4('0x4a')]=_0x446bdd[_0x2fb4('0x46')][_0x2fb4('0x4a')];}else if(_0x446bdd[_0x2fb4('0x46')][_0x2fb4('0x4b')]){_0x362a6d[_0x2fb4('0x4b')]=_0x446bdd['body']['SmsAccountId'];}else if(_0x446bdd[_0x2fb4('0x46')][_0x2fb4('0x4c')]){_0x362a6d[_0x2fb4('0x4c')]=_0x446bdd[_0x2fb4('0x46')]['OpenchannelAccountId'];}else if(_0x446bdd[_0x2fb4('0x46')][_0x2fb4('0x4d')]){_0x362a6d[_0x2fb4('0x4d')]=_0x446bdd[_0x2fb4('0x46')][_0x2fb4('0x4d')];}return db['CannedAnswer'][_0x2fb4('0x44')]({'where':_0x362a6d})[_0x2fb4('0x23')](function(_0x3bbe3a){if(_0x3bbe3a){throw new db[(_0x2fb4('0x4e'))][(_0x2fb4('0x4f'))](_0x2fb4('0x50'));}return db['CannedAnswer'][_0x2fb4('0x48')](_0x446bdd[_0x2fb4('0x46')]);})['then'](function(_0x2e3abc){var _0x8f03d9=_0x446bdd['user'][_0x2fb4('0x24')]({'plain':!![]});if(!_0x8f03d9)throw new Error(_0x2fb4('0x51'));if(_0x8f03d9['role']==='user'){var _0x556ea1=_0x2e3abc[_0x2fb4('0x24')]({'plain':!![]});return db[_0x2fb4('0x52')][_0x2fb4('0x44')]({'where':{'name':'CannedAnswers','userProfileId':_0x8f03d9[_0x2fb4('0x53')]},'raw':!![]})['then'](function(_0x5236db){if(_0x5236db&&_0x5236db['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x556ea1['name'],'resourceId':_0x556ea1['id'],'type':_0x5236db[_0x2fb4('0x27')],'sectionId':_0x5236db['id']},{})[_0x2fb4('0x23')](function(){return _0x2e3abc;});}else{return _0x2e3abc;}})[_0x2fb4('0x45')](function(_0x5779d7){logger[_0x2fb4('0x26')](_0x2fb4('0x54'),_0x5779d7);throw _0x5779d7;});}return _0x2e3abc;})[_0x2fb4('0x23')](respondWithResult(_0x317efc,0xc9))[_0x2fb4('0x45')](handleError(_0x317efc,null));};
\ No newline at end of file
+var _0x8c99=['show','options','catch','body','params','find','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','get','CannedAnswers','destroy','sendStatus','name','CannedAnswer','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x8c99,0xc6));var _0x98c9=function(_0x4cfa2e,_0x5752b5){_0x4cfa2e=_0x4cfa2e-0x0;var _0x279b50=_0x8c99[_0x4cfa2e];return _0x279b50;};'use strict';var emlformat=require(_0x98c9('0x0'));var rimraf=require(_0x98c9('0x1'));var zipdir=require(_0x98c9('0x2'));var jsonpatch=require(_0x98c9('0x3'));var rp=require(_0x98c9('0x4'));var moment=require('moment');var BPromise=require(_0x98c9('0x5'));var Mustache=require(_0x98c9('0x6'));var util=require(_0x98c9('0x7'));var path=require(_0x98c9('0x8'));var sox=require(_0x98c9('0x9'));var csv=require(_0x98c9('0xa'));var ejs=require(_0x98c9('0xb'));var fs=require('fs');var fs_extra=require(_0x98c9('0xc'));var _=require('lodash');var squel=require(_0x98c9('0xd'));var crypto=require('crypto');var jsforce=require(_0x98c9('0xe'));var deskjs=require(_0x98c9('0xf'));var toCsv=require(_0x98c9('0xa'));var querystring=require(_0x98c9('0x10'));var Papa=require(_0x98c9('0x11'));var Redis=require(_0x98c9('0x12'));var authService=require(_0x98c9('0x13'));var qs=require(_0x98c9('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x98c9('0x15'));var logger=require(_0x98c9('0x16'))(_0x98c9('0x17'));var utils=require(_0x98c9('0x18'));var config=require(_0x98c9('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59efd1,_0x1b27ff){_0x1b27ff=_0x1b27ff||0xcc;return function(_0x18558e){if(_0x18558e){return _0x59efd1['sendStatus'](_0x1b27ff);}return _0x59efd1[_0x98c9('0x1a')](_0x1b27ff)[_0x98c9('0x1b')]();};}function respondWithResult(_0x50d46e,_0x2fbd0a){_0x2fbd0a=_0x2fbd0a||0xc8;return function(_0x384143){if(_0x384143){return _0x50d46e[_0x98c9('0x1a')](_0x2fbd0a)['json'](_0x384143);}};}function respondWithFilteredResult(_0x342e98,_0x192616){return function(_0x6b9d85){if(_0x6b9d85){var _0xc0fb56=typeof _0x192616[_0x98c9('0x1c')]===_0x98c9('0x1d')&&typeof _0x192616[_0x98c9('0x1e')]==='undefined';var _0x38ad8c=_0x6b9d85[_0x98c9('0x1f')];var _0x1b6b55=_0xc0fb56?0x0:_0x192616[_0x98c9('0x1c')];var _0x3b654c=_0xc0fb56?_0x6b9d85[_0x98c9('0x1f')]:_0x192616[_0x98c9('0x1c')]+_0x192616[_0x98c9('0x1e')];var _0x2ff711;if(_0x3b654c>=_0x38ad8c){_0x3b654c=_0x38ad8c;_0x2ff711=0xc8;}else{_0x2ff711=0xce;}_0x342e98['status'](_0x2ff711);return _0x342e98[_0x98c9('0x20')](_0x98c9('0x21'),_0x1b6b55+'-'+_0x3b654c+'/'+_0x38ad8c)[_0x98c9('0x22')](_0x6b9d85);}return null;};}function patchUpdates(_0x31b16f){return function(_0x10a560){try{jsonpatch['apply'](_0x10a560,_0x31b16f,!![]);}catch(_0x499d2d){return BPromise[_0x98c9('0x23')](_0x499d2d);}return _0x10a560[_0x98c9('0x24')]();};}function saveUpdates(_0x5830e0,_0x228277){return function(_0x1a814c){if(_0x1a814c){return _0x1a814c[_0x98c9('0x25')](_0x5830e0)[_0x98c9('0x26')](function(_0x8034ea){return _0x8034ea;});}return null;};}function removeEntity(_0x5495b0,_0x3feea9){return function(_0x52ffc0){if(_0x52ffc0){return _0x52ffc0['destroy']()[_0x98c9('0x26')](function(){var _0x196f12=_0x52ffc0[_0x98c9('0x27')]({'plain':!![]});var _0xb1bedc=_0x98c9('0x28');return db['UserProfileResource'][_0x98c9('0x29')]({'where':{'type':_0xb1bedc,'resourceId':_0x196f12['id']}})[_0x98c9('0x26')](function(){return _0x52ffc0;});})[_0x98c9('0x26')](function(){_0x5495b0[_0x98c9('0x1a')](0xcc)[_0x98c9('0x1b')]();});}};}function handleEntityNotFound(_0x316667,_0x510305){return function(_0x4ffcce){if(!_0x4ffcce){_0x316667[_0x98c9('0x2a')](0x194);}return _0x4ffcce;};}function handleError(_0x4609ed,_0xc8380a){_0xc8380a=_0xc8380a||0x1f4;return function(_0x3b0c4a){logger['error'](_0x3b0c4a['stack']);if(_0x3b0c4a[_0x98c9('0x2b')]){delete _0x3b0c4a['name'];}_0x4609ed[_0x98c9('0x1a')](_0xc8380a)['send'](_0x3b0c4a);};}exports['index']=function(_0x40e404,_0x4705dd){var _0x233bfe={},_0x5eed5c={},_0x5c9041={'count':0x0,'rows':[]};var _0x2be15e=_['map'](db[_0x98c9('0x2c')][_0x98c9('0x2d')],function(_0x38e35d){return{'name':_0x38e35d[_0x98c9('0x2e')],'type':_0x38e35d[_0x98c9('0x2f')][_0x98c9('0x30')]};});_0x5eed5c[_0x98c9('0x31')]=_['map'](_0x2be15e,'name');_0x5eed5c[_0x98c9('0x32')]=_[_0x98c9('0x33')](_0x40e404[_0x98c9('0x32')]);_0x5eed5c[_0x98c9('0x34')]=_[_0x98c9('0x35')](_0x5eed5c[_0x98c9('0x31')],_0x5eed5c['query']);_0x233bfe[_0x98c9('0x36')]=_[_0x98c9('0x35')](_0x5eed5c['model'],qs[_0x98c9('0x37')](_0x40e404[_0x98c9('0x32')]['fields']));_0x233bfe[_0x98c9('0x36')]=_0x233bfe['attributes'][_0x98c9('0x38')]?_0x233bfe[_0x98c9('0x36')]:_0x5eed5c[_0x98c9('0x31')];if(!_0x40e404[_0x98c9('0x32')][_0x98c9('0x39')](_0x98c9('0x3a'))){_0x233bfe[_0x98c9('0x1e')]=qs['limit'](_0x40e404['query'][_0x98c9('0x1e')]);_0x233bfe['offset']=qs[_0x98c9('0x1c')](_0x40e404[_0x98c9('0x32')][_0x98c9('0x1c')]);}_0x233bfe[_0x98c9('0x3b')]=qs[_0x98c9('0x3c')](_0x40e404['query'][_0x98c9('0x3c')]);_0x233bfe[_0x98c9('0x3d')]=qs[_0x98c9('0x34')](_[_0x98c9('0x3e')](_0x40e404[_0x98c9('0x32')],_0x5eed5c['filters']),_0x2be15e);if(_0x40e404[_0x98c9('0x32')]['filter']){_0x233bfe[_0x98c9('0x3d')]=_['merge'](_0x233bfe[_0x98c9('0x3d')],{'$or':[{'key':{'$like':'%'+_0x40e404[_0x98c9('0x32')][_0x98c9('0x3f')]+'%'}},{'value':{'$like':'%'+_0x40e404['query'][_0x98c9('0x3f')]+'%'}}]});}_0x233bfe=_[_0x98c9('0x40')]({},_0x233bfe,_0x40e404['options']);var _0x1babf4={'where':_0x233bfe[_0x98c9('0x3d')]};return db[_0x98c9('0x2c')][_0x98c9('0x1f')](_0x1babf4)['then'](function(_0x4fcad7){_0x5c9041[_0x98c9('0x1f')]=_0x4fcad7;if(_0x40e404[_0x98c9('0x32')][_0x98c9('0x41')]){_0x233bfe[_0x98c9('0x42')]=[{'all':!![]}];}return db[_0x98c9('0x2c')][_0x98c9('0x43')](_0x233bfe);})['then'](function(_0x1b4b88){_0x5c9041[_0x98c9('0x44')]=_0x1b4b88;return _0x5c9041;})['then'](respondWithFilteredResult(_0x4705dd,_0x233bfe))['catch'](handleError(_0x4705dd,null));};exports[_0x98c9('0x45')]=function(_0x19c4eb,_0x7c4431){var _0x2e35ab={'raw':!![],'where':{'id':_0x19c4eb['params']['id']}},_0x2827ee={};_0x2827ee[_0x98c9('0x31')]=_[_0x98c9('0x33')](db['CannedAnswer']['rawAttributes']);_0x2827ee[_0x98c9('0x32')]=_[_0x98c9('0x33')](_0x19c4eb[_0x98c9('0x32')]);_0x2827ee[_0x98c9('0x34')]=_[_0x98c9('0x35')](_0x2827ee['model'],_0x2827ee['query']);_0x2e35ab[_0x98c9('0x36')]=_[_0x98c9('0x35')](_0x2827ee['model'],qs['fields'](_0x19c4eb[_0x98c9('0x32')][_0x98c9('0x37')]));_0x2e35ab[_0x98c9('0x36')]=_0x2e35ab[_0x98c9('0x36')][_0x98c9('0x38')]?_0x2e35ab['attributes']:_0x2827ee[_0x98c9('0x31')];if(_0x19c4eb[_0x98c9('0x32')]['includeAll']){_0x2e35ab[_0x98c9('0x42')]=[{'all':!![]}];}_0x2e35ab=_['merge']({},_0x2e35ab,_0x19c4eb[_0x98c9('0x46')]);return db[_0x98c9('0x2c')]['find'](_0x2e35ab)[_0x98c9('0x26')](handleEntityNotFound(_0x7c4431,null))[_0x98c9('0x26')](respondWithResult(_0x7c4431,null))[_0x98c9('0x47')](handleError(_0x7c4431,null));};exports[_0x98c9('0x25')]=function(_0x2fd8e3,_0x5e620d){if(_0x2fd8e3[_0x98c9('0x48')]['id']){delete _0x2fd8e3['body']['id'];}return db[_0x98c9('0x2c')]['find']({'where':{'id':_0x2fd8e3[_0x98c9('0x49')]['id']}})[_0x98c9('0x26')](handleEntityNotFound(_0x5e620d,null))['then'](saveUpdates(_0x2fd8e3[_0x98c9('0x48')],null))[_0x98c9('0x26')](respondWithResult(_0x5e620d,null))[_0x98c9('0x47')](handleError(_0x5e620d,null));};exports['destroy']=function(_0x51d659,_0x292d43){return db['CannedAnswer'][_0x98c9('0x4a')]({'where':{'id':_0x51d659[_0x98c9('0x49')]['id']}})[_0x98c9('0x26')](handleEntityNotFound(_0x292d43,null))[_0x98c9('0x26')](removeEntity(_0x292d43,null))[_0x98c9('0x47')](handleError(_0x292d43,null));};exports['create']=function(_0xbe8961,_0x2bc96a){var _0x264a7b={'key':_0xbe8961['body'][_0x98c9('0x30')]};if(_0xbe8961['body'][_0x98c9('0x4b')]){_0x264a7b[_0x98c9('0x4b')]=_0xbe8961[_0x98c9('0x48')][_0x98c9('0x4b')];}else if(_0xbe8961['body']['SmsAccountId']){_0x264a7b['SmsAccountId']=_0xbe8961[_0x98c9('0x48')][_0x98c9('0x4c')];}else if(_0xbe8961[_0x98c9('0x48')][_0x98c9('0x4d')]){_0x264a7b[_0x98c9('0x4d')]=_0xbe8961[_0x98c9('0x48')][_0x98c9('0x4d')];}else if(_0xbe8961['body'][_0x98c9('0x4e')]){_0x264a7b[_0x98c9('0x4e')]=_0xbe8961['body']['ChatWebsiteId'];}return db['CannedAnswer']['find']({'where':_0x264a7b})[_0x98c9('0x26')](function(_0x236700){if(_0x236700){throw new db['Sequelize'][(_0x98c9('0x4f'))](_0x98c9('0x50'));}return db[_0x98c9('0x2c')]['create'](_0xbe8961[_0x98c9('0x48')]);})['then'](function(_0xd8d02e){var _0xb23b4b=_0xbe8961[_0x98c9('0x51')][_0x98c9('0x27')]({'plain':!![]});if(!_0xb23b4b)throw new Error(_0x98c9('0x52'));if(_0xb23b4b[_0x98c9('0x53')]===_0x98c9('0x51')){var _0xbcd1f1=_0xd8d02e[_0x98c9('0x27')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x98c9('0x28'),'userProfileId':_0xb23b4b[_0x98c9('0x54')]},'raw':!![]})[_0x98c9('0x26')](function(_0xe1bed1){if(_0xe1bed1&&_0xe1bed1[_0x98c9('0x55')]===0x0){return db[_0x98c9('0x56')][_0x98c9('0x57')]({'name':_0xbcd1f1[_0x98c9('0x2b')],'resourceId':_0xbcd1f1['id'],'type':_0xe1bed1['name'],'sectionId':_0xe1bed1['id']},{})[_0x98c9('0x26')](function(){return _0xd8d02e;});}else{return _0xd8d02e;}})['catch'](function(_0x57ee15){logger['error'](_0x98c9('0x58'),_0x57ee15);throw _0x57ee15;});}return _0xd8d02e;})[_0x98c9('0x26')](respondWithResult(_0x2bc96a,0xc9))[_0x98c9('0x47')](handleError(_0x2bc96a,null));};
\ No newline at end of file
index 222e0ad..bbb0ec6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x567e=['exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0x567e,0xd8));var _0xe567=function(_0x1c5318,_0x45737a){_0x1c5318=_0x1c5318-0x0;var _0x2f118c=_0x567e[_0x1c5318];return _0x2f118c;};'use strict';var _=require(_0xe567('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe567('0x1'));var moment=require(_0xe567('0x2'));var BPromise=require(_0xe567('0x3'));var rp=require(_0xe567('0x4'));var fs=require('fs');var path=require(_0xe567('0x5'));var rimraf=require(_0xe567('0x6'));var config=require(_0xe567('0x7'));var attributes=require(_0xe567('0x8'));module[_0xe567('0x9')]=function(_0x208b78,_0x5474c0){return _0x208b78[_0xe567('0xa')](_0xe567('0xb'),attributes,{'tableName':_0xe567('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe567('0xd'),'collate':_0xe567('0xe')});};
\ No newline at end of file
+var _0x01ab=['request-promise','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','api','moment','bluebird'];(function(_0xc88e0e,_0x130618){var _0xd89aa8=function(_0x2b6948){while(--_0x2b6948){_0xc88e0e['push'](_0xc88e0e['shift']());}};_0xd89aa8(++_0x130618);}(_0x01ab,0x1ab));var _0xb01a=function(_0x1cee4e,_0x2c30bb){_0x1cee4e=_0x1cee4e-0x0;var _0x22fdda=_0x01ab[_0x1cee4e];return _0x22fdda;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xb01a('0x0'));var moment=require(_0xb01a('0x1'));var BPromise=require(_0xb01a('0x2'));var rp=require(_0xb01a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb01a('0x4'));var attributes=require(_0xb01a('0x5'));module['exports']=function(_0x41cd8f,_0x2ce301){return _0x41cd8f[_0xb01a('0x6')](_0xb01a('0x7'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb01a('0x8'),'collate':_0xb01a('0x9')});};
\ No newline at end of file
index 22be16c..bf92e4a 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(_0x3671ad,_0x264719){var _0x5d3115=function(_0x544d7d){while(--_0x544d7d){_0x3671ad['push'](_0x3671ad['shift']());}};_0x5d3115(++_0x264719);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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(_0x2d9652,_0x491082){var _0x2a64b8=function(_0xe1a32f){while(--_0xe1a32f){_0x2d9652['push'](_0x2d9652['shift']());}};_0x2a64b8(++_0x491082);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
index d109a9d..330d802 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ae9=['get','isAuthenticated','index','/:id','post','create','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5471ec,_0x1ce81a){var _0x121d4c=function(_0xefb655){while(--_0xefb655){_0x5471ec['push'](_0x5471ec['shift']());}};_0x121d4c(++_0x1ce81a);}(_0x6ae9,0xf4));var _0x96ae=function(_0x866213,_0xed307e){_0x866213=_0x866213-0x0;var _0x333221=_0x6ae9[_0x866213];return _0x333221;};'use strict';var multer=require(_0x96ae('0x0'));var util=require(_0x96ae('0x1'));var path=require(_0x96ae('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x96ae('0x3')]();var fs_extra=require(_0x96ae('0x4'));var auth=require(_0x96ae('0x5'));var interaction=require(_0x96ae('0x6'));var config=require(_0x96ae('0x7'));var controller=require('./cannedAnswer.controller');router[_0x96ae('0x8')]('/',auth[_0x96ae('0x9')](),controller[_0x96ae('0xa')]);router['get'](_0x96ae('0xb'),auth[_0x96ae('0x9')](),controller['show']);router[_0x96ae('0xc')]('/',auth['isAuthenticated'](),controller[_0x96ae('0xd')]);router['put'](_0x96ae('0xb'),auth[_0x96ae('0x9')](),controller[_0x96ae('0xe')]);router[_0x96ae('0xf')](_0x96ae('0xb'),auth['isAuthenticated'](),controller[_0x96ae('0x10')]);module[_0x96ae('0x11')]=router;
\ No newline at end of file
+var _0xf98b=['show','post','create','put','update','destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id'];(function(_0x5027b1,_0x6c2346){var _0x5ef581=function(_0xb14398){while(--_0xb14398){_0x5027b1['push'](_0x5027b1['shift']());}};_0x5ef581(++_0x6c2346);}(_0xf98b,0x1e3));var _0xbf98=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xf98b[_0x550d12];return _0x12103d;};'use strict';var multer=require(_0xbf98('0x0'));var util=require(_0xbf98('0x1'));var path=require(_0xbf98('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xbf98('0x3'));var auth=require(_0xbf98('0x4'));var interaction=require(_0xbf98('0x5'));var config=require('../../config/environment');var controller=require('./cannedAnswer.controller');router[_0xbf98('0x6')]('/',auth[_0xbf98('0x7')](),controller[_0xbf98('0x8')]);router[_0xbf98('0x6')](_0xbf98('0x9'),auth[_0xbf98('0x7')](),controller[_0xbf98('0xa')]);router[_0xbf98('0xb')]('/',auth[_0xbf98('0x7')](),controller[_0xbf98('0xc')]);router[_0xbf98('0xd')]('/:id',auth[_0xbf98('0x7')](),controller[_0xbf98('0xe')]);router['delete'](_0xbf98('0x9'),auth[_0xbf98('0x7')](),controller[_0xbf98('0xf')]);module[_0xbf98('0x10')]=router;
\ No newline at end of file
index 3454d86..0d2aeee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdab3=['INTEGER','sequelize','exports','1970-01-01\x2000:00:01','STRING'];(function(_0xfca265,_0x1b3692){var _0x2c88c8=function(_0x21e7b5){while(--_0x21e7b5){_0xfca265['push'](_0xfca265['shift']());}};_0x2c88c8(++_0x1b3692);}(_0xdab3,0x97));var _0x3dab=function(_0x53ae6f,_0x18f684){_0x53ae6f=_0x53ae6f-0x0;var _0x3e76c4=_0xdab3[_0x53ae6f];return _0x3e76c4;};'use strict';var Sequelize=require(_0x3dab('0x0'));module[_0x3dab('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x3dab('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x3dab('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x3dab('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x3dab('0x3')]},'duration':{'type':Sequelize[_0x3dab('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x3dab('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x3dab('0x3')]},'amaflags':{'type':Sequelize[_0x3dab('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x3dab('0x3')]},'uniqueid':{'type':Sequelize[_0x3dab('0x3')]},'linkedid':{'type':Sequelize[_0x3dab('0x3')]},'sequence':{'type':Sequelize[_0x3dab('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x3dab('0x3')]},'tag':{'type':Sequelize[_0x3dab('0x3')]}};
\ No newline at end of file
+var _0x56ce=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x295314,_0x17b250){var _0x584b0c=function(_0x51cc84){while(--_0x51cc84){_0x295314['push'](_0x295314['shift']());}};_0x584b0c(++_0x17b250);}(_0x56ce,0x1e9));var _0xe56c=function(_0x231ec6,_0x51da46){_0x231ec6=_0x231ec6-0x0;var _0x3ba743=_0x56ce[_0x231ec6];return _0x3ba743;};'use strict';var Sequelize=require(_0xe56c('0x0'));module['exports']={'calldate':{'type':Sequelize[_0xe56c('0x1')],'allowNull':![],'defaultValue':_0xe56c('0x2')},'clid':{'type':Sequelize[_0xe56c('0x3')]},'src':{'type':Sequelize[_0xe56c('0x3')]},'dst':{'type':Sequelize[_0xe56c('0x3')]},'dcontext':{'type':Sequelize[_0xe56c('0x3')]},'channel':{'type':Sequelize[_0xe56c('0x3')]},'dstchannel':{'type':Sequelize[_0xe56c('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xe56c('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xe56c('0x3')]},'amaflags':{'type':Sequelize[_0xe56c('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xe56c('0x3')]},'userfield':{'type':Sequelize[_0xe56c('0x3')]},'uniqueid':{'type':Sequelize[_0xe56c('0x3')]},'linkedid':{'type':Sequelize[_0xe56c('0x3')]},'sequence':{'type':Sequelize[_0xe56c('0x3')]},'peeraccount':{'type':Sequelize[_0xe56c('0x3')]},'type':{'type':Sequelize[_0xe56c('0x3')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 13f535e..541abb5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f47=['undefined','limit','count','status','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','Cdr','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','include','findAll','rows','catch','show','rawAttributes','length','find','create','body','params','describe','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset'];(function(_0x2a9839,_0x35a502){var _0x3ca3c2=function(_0x13bec0){while(--_0x13bec0){_0x2a9839['push'](_0x2a9839['shift']());}};_0x3ca3c2(++_0x35a502);}(_0x6f47,0xc7));var _0x76f4=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0x6f47[_0x424a9a];return _0xa7831c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x76f4('0x0'));var zipdir=require(_0x76f4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x76f4('0x2'));var moment=require('moment');var BPromise=require(_0x76f4('0x3'));var Mustache=require('mustache');var util=require(_0x76f4('0x4'));var path=require(_0x76f4('0x5'));var sox=require(_0x76f4('0x6'));var csv=require(_0x76f4('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x76f4('0x8'));var _=require(_0x76f4('0x9'));var squel=require(_0x76f4('0xa'));var crypto=require('crypto');var jsforce=require(_0x76f4('0xb'));var deskjs=require(_0x76f4('0xc'));var toCsv=require(_0x76f4('0x7'));var querystring=require(_0x76f4('0xd'));var Papa=require(_0x76f4('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x76f4('0xf'));var as=require(_0x76f4('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x76f4('0x11'));var utils=require(_0x76f4('0x12'));var config=require(_0x76f4('0x13'));var licenseUtil=require(_0x76f4('0x14'));var db=require(_0x76f4('0x15'))['db'];function respondWithStatusCode(_0xafd21e,_0xf7e347){_0xf7e347=_0xf7e347||0xcc;return function(_0x3ec740){if(_0x3ec740){return _0xafd21e[_0x76f4('0x16')](_0xf7e347);}return _0xafd21e['status'](_0xf7e347)[_0x76f4('0x17')]();};}function respondWithResult(_0x30dabf,_0x5da1ff){_0x5da1ff=_0x5da1ff||0xc8;return function(_0x4b6021){if(_0x4b6021){return _0x30dabf['status'](_0x5da1ff)[_0x76f4('0x18')](_0x4b6021);}};}function respondWithFilteredResult(_0x3dd240,_0x979946){return function(_0x40252d){if(_0x40252d){var _0x3d8f5a=typeof _0x979946[_0x76f4('0x19')]===_0x76f4('0x1a')&&typeof _0x979946[_0x76f4('0x1b')]===_0x76f4('0x1a');var _0xb159a9=_0x40252d[_0x76f4('0x1c')];var _0x2d4bd1=_0x3d8f5a?0x0:_0x979946[_0x76f4('0x19')];var _0x38450e=_0x3d8f5a?_0x40252d[_0x76f4('0x1c')]:_0x979946[_0x76f4('0x19')]+_0x979946[_0x76f4('0x1b')];var _0x3e809f;if(_0x38450e>=_0xb159a9){_0x38450e=_0xb159a9;_0x3e809f=0xc8;}else{_0x3e809f=0xce;}_0x3dd240[_0x76f4('0x1d')](_0x3e809f);return _0x3dd240[_0x76f4('0x1e')](_0x76f4('0x1f'),_0x2d4bd1+'-'+_0x38450e+'/'+_0xb159a9)[_0x76f4('0x18')](_0x40252d);}return null;};}function patchUpdates(_0x5bf3d5){return function(_0x262937){try{jsonpatch['apply'](_0x262937,_0x5bf3d5,!![]);}catch(_0x13f3b1){return BPromise[_0x76f4('0x20')](_0x13f3b1);}return _0x262937[_0x76f4('0x21')]();};}function saveUpdates(_0x517c00,_0x567f2a){return function(_0x52da65){if(_0x52da65){return _0x52da65[_0x76f4('0x22')](_0x517c00)[_0x76f4('0x23')](function(_0x14bfe5){return _0x14bfe5;});}return null;};}function removeEntity(_0x2b6d51,_0x42ef70){return function(_0x4786c9){if(_0x4786c9){return _0x4786c9[_0x76f4('0x24')]()['then'](function(){_0x2b6d51['status'](0xcc)[_0x76f4('0x17')]();});}};}function handleEntityNotFound(_0x497913,_0x288365){return function(_0x5355bd){if(!_0x5355bd){_0x497913['sendStatus'](0x194);}return _0x5355bd;};}function handleError(_0x4f6087,_0x470242){_0x470242=_0x470242||0x1f4;return function(_0x38300d){logger[_0x76f4('0x25')](_0x38300d[_0x76f4('0x26')]);if(_0x38300d[_0x76f4('0x27')]){delete _0x38300d[_0x76f4('0x27')];}_0x4f6087['status'](_0x470242)[_0x76f4('0x28')](_0x38300d);};}exports['index']=function(_0x5346be,_0x5b3f07){var _0x10ddb4={},_0x30f02e={},_0x41dea4={'count':0x0,'rows':[]};var _0x1dea0e=_['map'](db[_0x76f4('0x29')]['rawAttributes'],function(_0x259c26){return{'name':_0x259c26[_0x76f4('0x2a')],'type':_0x259c26[_0x76f4('0x2b')][_0x76f4('0x2c')]};});_0x30f02e[_0x76f4('0x2d')]=_['map'](_0x1dea0e,'name');_0x30f02e[_0x76f4('0x2e')]=_[_0x76f4('0x2f')](_0x5346be[_0x76f4('0x2e')]);_0x30f02e[_0x76f4('0x30')]=_[_0x76f4('0x31')](_0x30f02e[_0x76f4('0x2d')],_0x30f02e[_0x76f4('0x2e')]);_0x10ddb4[_0x76f4('0x32')]=_[_0x76f4('0x31')](_0x30f02e[_0x76f4('0x2d')],qs[_0x76f4('0x33')](_0x5346be[_0x76f4('0x2e')]['fields']));_0x10ddb4['attributes']=_0x10ddb4['attributes']['length']?_0x10ddb4[_0x76f4('0x32')]:_0x30f02e[_0x76f4('0x2d')];if(!_0x5346be[_0x76f4('0x2e')][_0x76f4('0x34')](_0x76f4('0x35'))){_0x10ddb4['limit']=qs[_0x76f4('0x1b')](_0x5346be[_0x76f4('0x2e')][_0x76f4('0x1b')]);_0x10ddb4[_0x76f4('0x19')]=qs[_0x76f4('0x19')](_0x5346be[_0x76f4('0x2e')][_0x76f4('0x19')]);}_0x10ddb4[_0x76f4('0x36')]=qs[_0x76f4('0x37')](_0x5346be[_0x76f4('0x2e')][_0x76f4('0x37')]);_0x10ddb4[_0x76f4('0x38')]=qs[_0x76f4('0x30')](_[_0x76f4('0x39')](_0x5346be[_0x76f4('0x2e')],_0x30f02e[_0x76f4('0x30')]),_0x1dea0e);if(_0x5346be[_0x76f4('0x2e')][_0x76f4('0x3a')]){_0x10ddb4['where']=_[_0x76f4('0x3b')](_0x10ddb4[_0x76f4('0x38')],{'$or':_[_0x76f4('0x3c')](_0x1dea0e,function(_0x589637){if(_0x589637['type']!==_0x76f4('0x3d')){var _0x487926={};_0x487926[_0x589637[_0x76f4('0x27')]]={'$like':'%'+_0x5346be['query'][_0x76f4('0x3a')]+'%'};return _0x487926;}})});}_0x10ddb4=_[_0x76f4('0x3b')]({},_0x10ddb4,_0x5346be[_0x76f4('0x3e')]);var _0x378675={'where':_0x10ddb4[_0x76f4('0x38')]};return db[_0x76f4('0x29')][_0x76f4('0x1c')](_0x378675)[_0x76f4('0x23')](function(_0x16779e){_0x41dea4[_0x76f4('0x1c')]=_0x16779e;if(_0x5346be['query']['includeAll']){_0x10ddb4[_0x76f4('0x3f')]=[{'all':!![]}];}return db[_0x76f4('0x29')][_0x76f4('0x40')](_0x10ddb4);})[_0x76f4('0x23')](function(_0x2b7dc8){_0x41dea4[_0x76f4('0x41')]=_0x2b7dc8;return _0x41dea4;})[_0x76f4('0x23')](respondWithFilteredResult(_0x5b3f07,_0x10ddb4))[_0x76f4('0x42')](handleError(_0x5b3f07,null));};exports[_0x76f4('0x43')]=function(_0x5b667b,_0xbc3d7e){var _0xe744af={'raw':!![],'where':{'id':_0x5b667b['params']['id']}},_0x4f0d1a={};_0x4f0d1a[_0x76f4('0x2d')]=_[_0x76f4('0x2f')](db[_0x76f4('0x29')][_0x76f4('0x44')]);_0x4f0d1a[_0x76f4('0x2e')]=_['keys'](_0x5b667b[_0x76f4('0x2e')]);_0x4f0d1a[_0x76f4('0x30')]=_[_0x76f4('0x31')](_0x4f0d1a[_0x76f4('0x2d')],_0x4f0d1a[_0x76f4('0x2e')]);_0xe744af[_0x76f4('0x32')]=_['intersection'](_0x4f0d1a[_0x76f4('0x2d')],qs[_0x76f4('0x33')](_0x5b667b[_0x76f4('0x2e')]['fields']));_0xe744af['attributes']=_0xe744af[_0x76f4('0x32')][_0x76f4('0x45')]?_0xe744af[_0x76f4('0x32')]:_0x4f0d1a[_0x76f4('0x2d')];if(_0x5b667b[_0x76f4('0x2e')]['includeAll']){_0xe744af['include']=[{'all':!![]}];}_0xe744af=_[_0x76f4('0x3b')]({},_0xe744af,_0x5b667b['options']);return db[_0x76f4('0x29')][_0x76f4('0x46')](_0xe744af)['then'](handleEntityNotFound(_0xbc3d7e,null))['then'](respondWithResult(_0xbc3d7e,null))[_0x76f4('0x42')](handleError(_0xbc3d7e,null));};exports[_0x76f4('0x47')]=function(_0x3f35ce,_0x217d3a){return db['Cdr'][_0x76f4('0x47')](_0x3f35ce[_0x76f4('0x48')],{})[_0x76f4('0x23')](respondWithResult(_0x217d3a,0xc9))['catch'](handleError(_0x217d3a,null));};exports[_0x76f4('0x22')]=function(_0x6bbcf2,_0x535eca){if(_0x6bbcf2['body']['id']){delete _0x6bbcf2[_0x76f4('0x48')]['id'];}return db[_0x76f4('0x29')][_0x76f4('0x46')]({'where':{'id':_0x6bbcf2[_0x76f4('0x49')]['id']}})[_0x76f4('0x23')](handleEntityNotFound(_0x535eca,null))['then'](saveUpdates(_0x6bbcf2[_0x76f4('0x48')],null))['then'](respondWithResult(_0x535eca,null))[_0x76f4('0x42')](handleError(_0x535eca,null));};exports[_0x76f4('0x24')]=function(_0x270baf,_0x5e9a45){return db[_0x76f4('0x29')][_0x76f4('0x46')]({'where':{'id':_0x270baf['params']['id']}})[_0x76f4('0x23')](handleEntityNotFound(_0x5e9a45,null))[_0x76f4('0x23')](removeEntity(_0x5e9a45,null))[_0x76f4('0x42')](handleError(_0x5e9a45,null));};exports[_0x76f4('0x4a')]=function(_0x40ff20,_0x479c4b){return db[_0x76f4('0x29')]['describe']()[_0x76f4('0x23')](respondWithResult(_0x479c4b,null))[_0x76f4('0x42')](handleError(_0x479c4b,null));};
\ No newline at end of file
+var _0x7fbe=['order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','params','include','find','body','catch','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','end','error','stack','send','index','map','Cdr','rawAttributes','fieldName','type','key','name','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit'];(function(_0x16e4a7,_0x5bdf7b){var _0x1be3c7=function(_0xcd2702){while(--_0xcd2702){_0x16e4a7['push'](_0x16e4a7['shift']());}};_0x1be3c7(++_0x5bdf7b);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x8c7dcb,_0xea478d){_0x8c7dcb=_0x8c7dcb-0x0;var _0x3952e5=_0x7fbe[_0x8c7dcb];return _0x3952e5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7fb('0x0'));var jsonpatch=require(_0xe7fb('0x1'));var rp=require(_0xe7fb('0x2'));var moment=require(_0xe7fb('0x3'));var BPromise=require(_0xe7fb('0x4'));var Mustache=require(_0xe7fb('0x5'));var util=require(_0xe7fb('0x6'));var path=require(_0xe7fb('0x7'));var sox=require(_0xe7fb('0x8'));var csv=require(_0xe7fb('0x9'));var ejs=require(_0xe7fb('0xa'));var fs=require('fs');var fs_extra=require(_0xe7fb('0xb'));var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0x9'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var licenseUtil=require(_0xe7fb('0x19'));var db=require(_0xe7fb('0x1a'))['db'];function respondWithStatusCode(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xcc;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0x1b')](_0x188e1d);}return _0x2437d4[_0xe7fb('0x1c')](_0x188e1d)['end']();};}function respondWithResult(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0xc8;return function(_0x5573ab){if(_0x5573ab){return _0x278b75[_0xe7fb('0x1c')](_0x2225e5)[_0xe7fb('0x1d')](_0x5573ab);}};}function respondWithFilteredResult(_0x482f7d,_0xa76acf){return function(_0x559129){if(_0x559129){var _0x12fff6=typeof _0xa76acf[_0xe7fb('0x1e')]===_0xe7fb('0x1f')&&typeof _0xa76acf[_0xe7fb('0x20')]==='undefined';var _0x892b0f=_0x559129['count'];var _0x293a47=_0x12fff6?0x0:_0xa76acf['offset'];var _0x1e77fd=_0x12fff6?_0x559129[_0xe7fb('0x21')]:_0xa76acf[_0xe7fb('0x1e')]+_0xa76acf[_0xe7fb('0x20')];var _0x5df1a1;if(_0x1e77fd>=_0x892b0f){_0x1e77fd=_0x892b0f;_0x5df1a1=0xc8;}else{_0x5df1a1=0xce;}_0x482f7d[_0xe7fb('0x1c')](_0x5df1a1);return _0x482f7d['set'](_0xe7fb('0x22'),_0x293a47+'-'+_0x1e77fd+'/'+_0x892b0f)['json'](_0x559129);}return null;};}function patchUpdates(_0x15f7a4){return function(_0x4ea664){try{jsonpatch[_0xe7fb('0x23')](_0x4ea664,_0x15f7a4,!![]);}catch(_0x135624){return BPromise['reject'](_0x135624);}return _0x4ea664[_0xe7fb('0x24')]();};}function saveUpdates(_0x4742bd,_0x3ae8f1){return function(_0x4dcb4b){if(_0x4dcb4b){return _0x4dcb4b[_0xe7fb('0x25')](_0x4742bd)[_0xe7fb('0x26')](function(_0x5da3d9){return _0x5da3d9;});}return null;};}function removeEntity(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(_0x35e4db){return _0x35e4db['destroy']()['then'](function(){_0x5bea27[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x27')]();});}};}function handleEntityNotFound(_0x2996ae,_0x4f6c73){return function(_0x6c930){if(!_0x6c930){_0x2996ae[_0xe7fb('0x1b')](0x194);}return _0x6c930;};}function handleError(_0x390f32,_0x1ceed8){_0x1ceed8=_0x1ceed8||0x1f4;return function(_0x392d75){logger[_0xe7fb('0x28')](_0x392d75[_0xe7fb('0x29')]);if(_0x392d75['name']){delete _0x392d75['name'];}_0x390f32[_0xe7fb('0x1c')](_0x1ceed8)[_0xe7fb('0x2a')](_0x392d75);};}exports[_0xe7fb('0x2b')]=function(_0x4fd290,_0xb1f2f4){var _0x251807={},_0xd3fffe={},_0x5f265f={'count':0x0,'rows':[]};var _0x219554=_[_0xe7fb('0x2c')](db[_0xe7fb('0x2d')][_0xe7fb('0x2e')],function(_0x4ce993){return{'name':_0x4ce993[_0xe7fb('0x2f')],'type':_0x4ce993[_0xe7fb('0x30')][_0xe7fb('0x31')]};});_0xd3fffe['model']=_['map'](_0x219554,_0xe7fb('0x32'));_0xd3fffe['query']=_[_0xe7fb('0x33')](_0x4fd290[_0xe7fb('0x34')]);_0xd3fffe[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0xd3fffe['model'],_0xd3fffe[_0xe7fb('0x34')]);_0x251807[_0xe7fb('0x37')]=_[_0xe7fb('0x36')](_0xd3fffe[_0xe7fb('0x38')],qs[_0xe7fb('0x39')](_0x4fd290['query'][_0xe7fb('0x39')]));_0x251807[_0xe7fb('0x37')]=_0x251807[_0xe7fb('0x37')][_0xe7fb('0x3a')]?_0x251807[_0xe7fb('0x37')]:_0xd3fffe[_0xe7fb('0x38')];if(!_0x4fd290[_0xe7fb('0x34')][_0xe7fb('0x3b')](_0xe7fb('0x3c'))){_0x251807['limit']=qs[_0xe7fb('0x20')](_0x4fd290[_0xe7fb('0x34')][_0xe7fb('0x20')]);_0x251807['offset']=qs[_0xe7fb('0x1e')](_0x4fd290[_0xe7fb('0x34')][_0xe7fb('0x1e')]);}_0x251807[_0xe7fb('0x3d')]=qs[_0xe7fb('0x3e')](_0x4fd290[_0xe7fb('0x34')][_0xe7fb('0x3e')]);_0x251807[_0xe7fb('0x3f')]=qs[_0xe7fb('0x35')](_[_0xe7fb('0x40')](_0x4fd290[_0xe7fb('0x34')],_0xd3fffe[_0xe7fb('0x35')]),_0x219554);if(_0x4fd290[_0xe7fb('0x34')][_0xe7fb('0x41')]){_0x251807[_0xe7fb('0x3f')]=_[_0xe7fb('0x42')](_0x251807[_0xe7fb('0x3f')],{'$or':_[_0xe7fb('0x2c')](_0x219554,function(_0x21e35c){if(_0x21e35c['type']!==_0xe7fb('0x43')){var _0x23f9f9={};_0x23f9f9[_0x21e35c[_0xe7fb('0x32')]]={'$like':'%'+_0x4fd290[_0xe7fb('0x34')]['filter']+'%'};return _0x23f9f9;}})});}_0x251807=_[_0xe7fb('0x42')]({},_0x251807,_0x4fd290[_0xe7fb('0x44')]);var _0xd472d={'where':_0x251807[_0xe7fb('0x3f')]};return db['Cdr'][_0xe7fb('0x21')](_0xd472d)[_0xe7fb('0x26')](function(_0x34265f){_0x5f265f[_0xe7fb('0x21')]=_0x34265f;if(_0x4fd290[_0xe7fb('0x34')][_0xe7fb('0x45')]){_0x251807['include']=[{'all':!![]}];}return db[_0xe7fb('0x2d')][_0xe7fb('0x46')](_0x251807);})[_0xe7fb('0x26')](function(_0x4b263d){_0x5f265f[_0xe7fb('0x47')]=_0x4b263d;return _0x5f265f;})[_0xe7fb('0x26')](respondWithFilteredResult(_0xb1f2f4,_0x251807))['catch'](handleError(_0xb1f2f4,null));};exports['show']=function(_0x5a01ae,_0x5ed3d4){var _0x5e0153={'raw':!![],'where':{'id':_0x5a01ae[_0xe7fb('0x48')]['id']}},_0x900d67={};_0x900d67[_0xe7fb('0x38')]=_['keys'](db[_0xe7fb('0x2d')]['rawAttributes']);_0x900d67[_0xe7fb('0x34')]=_[_0xe7fb('0x33')](_0x5a01ae['query']);_0x900d67[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x900d67[_0xe7fb('0x38')],_0x900d67[_0xe7fb('0x34')]);_0x5e0153['attributes']=_[_0xe7fb('0x36')](_0x900d67[_0xe7fb('0x38')],qs[_0xe7fb('0x39')](_0x5a01ae['query'][_0xe7fb('0x39')]));_0x5e0153[_0xe7fb('0x37')]=_0x5e0153[_0xe7fb('0x37')][_0xe7fb('0x3a')]?_0x5e0153[_0xe7fb('0x37')]:_0x900d67['model'];if(_0x5a01ae[_0xe7fb('0x34')]['includeAll']){_0x5e0153[_0xe7fb('0x49')]=[{'all':!![]}];}_0x5e0153=_[_0xe7fb('0x42')]({},_0x5e0153,_0x5a01ae[_0xe7fb('0x44')]);return db[_0xe7fb('0x2d')][_0xe7fb('0x4a')](_0x5e0153)['then'](handleEntityNotFound(_0x5ed3d4,null))[_0xe7fb('0x26')](respondWithResult(_0x5ed3d4,null))['catch'](handleError(_0x5ed3d4,null));};exports['create']=function(_0x12c828,_0x3d740f){return db[_0xe7fb('0x2d')]['create'](_0x12c828[_0xe7fb('0x4b')],{})[_0xe7fb('0x26')](respondWithResult(_0x3d740f,0xc9))['catch'](handleError(_0x3d740f,null));};exports['update']=function(_0x284bcb,_0x42270b){if(_0x284bcb[_0xe7fb('0x4b')]['id']){delete _0x284bcb[_0xe7fb('0x4b')]['id'];}return db[_0xe7fb('0x2d')][_0xe7fb('0x4a')]({'where':{'id':_0x284bcb[_0xe7fb('0x48')]['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x42270b,null))['then'](saveUpdates(_0x284bcb[_0xe7fb('0x4b')],null))['then'](respondWithResult(_0x42270b,null))[_0xe7fb('0x4c')](handleError(_0x42270b,null));};exports[_0xe7fb('0x4d')]=function(_0x5cedfb,_0x25347b){return db['Cdr'][_0xe7fb('0x4a')]({'where':{'id':_0x5cedfb['params']['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x25347b,null))['then'](removeEntity(_0x25347b,null))[_0xe7fb('0x4c')](handleError(_0x25347b,null));};exports['describe']=function(_0x1fff6c,_0x1b6442){return db[_0xe7fb('0x2d')][_0xe7fb('0x4e')]()[_0xe7fb('0x26')](respondWithResult(_0x1b6442,null))[_0xe7fb('0x4c')](handleError(_0x1b6442,null));};
\ No newline at end of file
index 8a1d00e..bc791d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x2c6f64,_0x3b5f13){var _0x1d0970=function(_0x2afbce){while(--_0x2afbce){_0x2c6f64['push'](_0x2c6f64['shift']());}};_0x1d0970(++_0x3b5f13);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x90c031,_0x570a8f){var _0x4fc393=function(_0x1ef7f9){while(--_0x1ef7f9){_0x90c031['push'](_0x90c031['shift']());}};_0x4fc393(++_0x570a8f);}(_0x7a54,0x106));var _0x47a5=function(_0xa60def,_0x4b276c){_0xa60def=_0xa60def-0x0;var _0x20932e=_0x7a54[_0xa60def];return _0x20932e;};'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 7674e49..82f20e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x356e=['code','error','message','request\x20sent','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s'];(function(_0x5da3e1,_0x19ac49){var _0x22ee6e=function(_0x181bc4){while(--_0x181bc4){_0x5da3e1['push'](_0x5da3e1['shift']());}};_0x22ee6e(++_0x19ac49);}(_0x356e,0x192));var _0xe356=function(_0x4e752e,_0x479543){_0x4e752e=_0x4e752e-0x0;var _0x2392b0=_0x356e[_0x4e752e];return _0x2392b0;};'use strict';var _=require('lodash');var util=require(_0xe356('0x0'));var moment=require(_0xe356('0x1'));var BPromise=require(_0xe356('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe356('0x3'));var db=require(_0xe356('0x4'))['db'];var utils=require(_0xe356('0x5'));var logger=require(_0xe356('0x6'))(_0xe356('0x7'));var config=require(_0xe356('0x8'));var jayson=require(_0xe356('0x9'));var client=jayson[_0xe356('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x354f17,_0x5833fb,_0x36b5ce){return new BPromise(function(_0x1623a9,_0x8e7d03){return client['request'](_0x354f17,_0x36b5ce)[_0xe356('0xb')](function(_0x3a467a){logger[_0xe356('0xc')](_0xe356('0xd'),_0x5833fb,'request\x20sent');logger[_0xe356('0xe')](_0xe356('0xf'),_0x5833fb,'request\x20sent',JSON['stringify'](_0x3a467a));if(_0x3a467a['error']){if(_0x3a467a['error'][_0xe356('0x10')]===0x1f4){logger[_0xe356('0x11')](_0xe356('0xd'),_0x5833fb,_0x3a467a[_0xe356('0x11')]['message']);return _0x8e7d03(_0x3a467a[_0xe356('0x11')]['message']);}logger[_0xe356('0x11')](_0xe356('0xd'),_0x5833fb,_0x3a467a[_0xe356('0x11')]['message']);return _0x1623a9(_0x3a467a[_0xe356('0x11')][_0xe356('0x12')]);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x5833fb,_0xe356('0x13'));_0x1623a9(_0x3a467a[_0xe356('0x14')][_0xe356('0x12')]);}})[_0xe356('0x15')](function(_0x3bf5d7){logger[_0xe356('0x11')](_0xe356('0xd'),_0x5833fb,_0x3bf5d7);_0x8e7d03(_0x3bf5d7);});});}
\ No newline at end of file
+var _0x95c4=['Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','Cdr,\x20%s,\x20%s','debug'];(function(_0x4e1677,_0x32cf56){var _0x378449=function(_0x2898b8){while(--_0x2898b8){_0x4e1677['push'](_0x4e1677['shift']());}};_0x378449(++_0x32cf56);}(_0x95c4,0x168));var _0x495c=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0x95c4[_0x2f45ea];return _0x485a84;};'use strict';var _=require(_0x495c('0x0'));var util=require(_0x495c('0x1'));var moment=require(_0x495c('0x2'));var BPromise=require('bluebird');var rs=require(_0x495c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x495c('0x4'))['db'];var utils=require(_0x495c('0x5'));var logger=require(_0x495c('0x6'))(_0x495c('0x7'));var config=require(_0x495c('0x8'));var jayson=require(_0x495c('0x9'));var client=jayson[_0x495c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47bf6c,_0x69b84,_0x57762f){return new BPromise(function(_0x7fba90,_0x3867e4){return client[_0x495c('0xb')](_0x47bf6c,_0x57762f)['then'](function(_0x562760){logger['info'](_0x495c('0xc'),_0x69b84,'request\x20sent');logger[_0x495c('0xd')](_0x495c('0xe'),_0x69b84,_0x495c('0xf'),JSON[_0x495c('0x10')](_0x562760));if(_0x562760[_0x495c('0x11')]){if(_0x562760['error'][_0x495c('0x12')]===0x1f4){logger[_0x495c('0x11')](_0x495c('0xc'),_0x69b84,_0x562760[_0x495c('0x11')][_0x495c('0x13')]);return _0x3867e4(_0x562760['error'][_0x495c('0x13')]);}logger['error'](_0x495c('0xc'),_0x69b84,_0x562760[_0x495c('0x11')][_0x495c('0x13')]);return _0x7fba90(_0x562760[_0x495c('0x11')]['message']);}else{logger['info'](_0x495c('0xc'),_0x69b84,_0x495c('0xf'));_0x7fba90(_0x562760[_0x495c('0x14')][_0x495c('0x13')]);}})[_0x495c('0x15')](function(_0x1f2749){logger['error'](_0x495c('0xc'),_0x69b84,_0x1f2749);_0x3867e4(_0x1f2749);});});}
\ No newline at end of file
index 00bc640..a491363 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x10791d,_0x2562b6){var _0x1b4f9c=function(_0x3b2815){while(--_0x3b2815){_0x10791d['push'](_0x10791d['shift']());}};_0x1b4f9c(++_0x2562b6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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
+var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x319174,_0x44288d){var _0x31feaa=function(_0x44f030){while(--_0x44f030){_0x319174['push'](_0x319174['shift']());}};_0x31feaa(++_0x44288d);}(_0xb10b,0x12a));var _0xbb10=function(_0x350396,_0x391ad2){_0x350396=_0x350396-0x0;var _0xf306b1=_0xb10b[_0x350396];return _0xf306b1;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router;
\ No newline at end of file
index acc2498..7e04465 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc70=['STRING','TEXT','sequelize','exports'];(function(_0x59ae25,_0x354338){var _0x103f94=function(_0x249a56){while(--_0x249a56){_0x59ae25['push'](_0x59ae25['shift']());}};_0x103f94(++_0x354338);}(_0xfc70,0x1aa));var _0x0fc7=function(_0x278e6c,_0x5452c0){_0x278e6c=_0x278e6c-0x0;var _0x5c77ef=_0xfc70[_0x278e6c];return _0x5c77ef;};'use strict';var Sequelize=require(_0x0fc7('0x0'));module[_0x0fc7('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x0fc7('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x0fc7('0x3')]()},'description':{'type':Sequelize[_0x0fc7('0x2')]},'interval':{'type':Sequelize[_0x0fc7('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xa94b=['noop','STRING','INTEGER'];(function(_0x4e6d09,_0x1f15aa){var _0x50933d=function(_0xce7dcc){while(--_0xce7dcc){_0x4e6d09['push'](_0x4e6d09['shift']());}};_0x50933d(++_0x1f15aa);}(_0xa94b,0x8f));var _0xba94=function(_0x54bd64,_0x142b58){_0x54bd64=_0x54bd64-0x0;var _0xdd9a9f=_0xa94b[_0x54bd64];return _0xdd9a9f;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xba94('0x0')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xba94('0x1')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xba94('0x2')]},'interval':{'type':Sequelize[_0xba94('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index d7e6d6c..5dcb956 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x69d3=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','destroy','then','error','name','send','show','keys','ChatApplication','query','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','catch','update','body','find','params','eml-format','rimraf','zip-dir','request-promise','moment','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x69d3,0xda));var _0x369d=function(_0x4abc04,_0x536d38){_0x4abc04=_0x4abc04-0x0;var _0x2a4095=_0x69d3[_0x4abc04];return _0x2a4095;};'use strict';var emlformat=require(_0x369d('0x0'));var rimraf=require(_0x369d('0x1'));var zipdir=require(_0x369d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x369d('0x3'));var moment=require(_0x369d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x369d('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x369d('0x6'));var ejs=require(_0x369d('0x7'));var fs=require('fs');var fs_extra=require(_0x369d('0x8'));var _=require(_0x369d('0x9'));var squel=require(_0x369d('0xa'));var crypto=require(_0x369d('0xb'));var jsforce=require(_0x369d('0xc'));var deskjs=require(_0x369d('0xd'));var toCsv=require(_0x369d('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x369d('0xe'));var authService=require(_0x369d('0xf'));var qs=require(_0x369d('0x10'));var as=require(_0x369d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x369d('0x12'));var utils=require(_0x369d('0x13'));var config=require(_0x369d('0x14'));var licenseUtil=require(_0x369d('0x15'));var db=require(_0x369d('0x16'))['db'];function respondWithStatusCode(_0xee549e,_0x52c126){_0x52c126=_0x52c126||0xcc;return function(_0x15b417){if(_0x15b417){return _0xee549e[_0x369d('0x17')](_0x52c126);}return _0xee549e[_0x369d('0x18')](_0x52c126)[_0x369d('0x19')]();};}function respondWithResult(_0x121307,_0x539536){_0x539536=_0x539536||0xc8;return function(_0x5cd4c3){if(_0x5cd4c3){return _0x121307['status'](_0x539536)[_0x369d('0x1a')](_0x5cd4c3);}};}function respondWithFilteredResult(_0xa126c1,_0x389c43){return function(_0x5b4f55){if(_0x5b4f55){var _0x2c1a4a=typeof _0x389c43[_0x369d('0x1b')]===_0x369d('0x1c')&&typeof _0x389c43['limit']===_0x369d('0x1c');var _0x1f37ff=_0x5b4f55['count'];var _0x572513=_0x2c1a4a?0x0:_0x389c43['offset'];var _0x2946be=_0x2c1a4a?_0x5b4f55[_0x369d('0x1d')]:_0x389c43[_0x369d('0x1b')]+_0x389c43['limit'];var _0x410dbe;if(_0x2946be>=_0x1f37ff){_0x2946be=_0x1f37ff;_0x410dbe=0xc8;}else{_0x410dbe=0xce;}_0xa126c1[_0x369d('0x18')](_0x410dbe);return _0xa126c1[_0x369d('0x1e')](_0x369d('0x1f'),_0x572513+'-'+_0x2946be+'/'+_0x1f37ff)[_0x369d('0x1a')](_0x5b4f55);}return null;};}function patchUpdates(_0x538ca4){return function(_0x5c9fdd){try{jsonpatch[_0x369d('0x20')](_0x5c9fdd,_0x538ca4,!![]);}catch(_0x1edcd5){return BPromise[_0x369d('0x21')](_0x1edcd5);}return _0x5c9fdd[_0x369d('0x22')]();};}function saveUpdates(_0x84cc0f,_0x15fbef){return function(_0x1b262a){if(_0x1b262a){return _0x1b262a['update'](_0x84cc0f)['then'](function(_0x32ef9a){return _0x32ef9a;});}return null;};}function removeEntity(_0xed16e,_0xf7bc3a){return function(_0xcae58){if(_0xcae58){return _0xcae58[_0x369d('0x23')]()[_0x369d('0x24')](function(){_0xed16e[_0x369d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4dfe83,_0x16145e){return function(_0x46de2b){if(!_0x46de2b){_0x4dfe83[_0x369d('0x17')](0x194);}return _0x46de2b;};}function handleError(_0xe01d2b,_0x8aa521){_0x8aa521=_0x8aa521||0x1f4;return function(_0x41e0cf){logger[_0x369d('0x25')](_0x41e0cf['stack']);if(_0x41e0cf[_0x369d('0x26')]){delete _0x41e0cf[_0x369d('0x26')];}_0xe01d2b[_0x369d('0x18')](_0x8aa521)[_0x369d('0x27')](_0x41e0cf);};}exports[_0x369d('0x28')]=function(_0x41367a,_0x3d1ce0){var _0x4d42ea={'raw':!![],'where':{'id':_0x41367a['params']['id']}},_0x157291={};_0x157291['model']=_[_0x369d('0x29')](db[_0x369d('0x2a')]['rawAttributes']);_0x157291[_0x369d('0x2b')]=_['keys'](_0x41367a[_0x369d('0x2b')]);_0x157291[_0x369d('0x2c')]=_[_0x369d('0x2d')](_0x157291[_0x369d('0x2e')],_0x157291[_0x369d('0x2b')]);_0x4d42ea[_0x369d('0x2f')]=_[_0x369d('0x2d')](_0x157291['model'],qs[_0x369d('0x30')](_0x41367a[_0x369d('0x2b')][_0x369d('0x30')]));_0x4d42ea[_0x369d('0x2f')]=_0x4d42ea[_0x369d('0x2f')][_0x369d('0x31')]?_0x4d42ea[_0x369d('0x2f')]:_0x157291[_0x369d('0x2e')];if(_0x41367a['query'][_0x369d('0x32')]){_0x4d42ea[_0x369d('0x33')]=[{'all':!![]}];}_0x4d42ea=_[_0x369d('0x34')]({},_0x4d42ea,_0x41367a[_0x369d('0x35')]);return db[_0x369d('0x2a')]['find'](_0x4d42ea)[_0x369d('0x24')](handleEntityNotFound(_0x3d1ce0,null))[_0x369d('0x24')](respondWithResult(_0x3d1ce0,null))[_0x369d('0x36')](handleError(_0x3d1ce0,null));};exports[_0x369d('0x37')]=function(_0x3cb801,_0x3e6c14){if(_0x3cb801['body']['id']){delete _0x3cb801[_0x369d('0x38')]['id'];}return db[_0x369d('0x2a')][_0x369d('0x39')]({'where':{'id':_0x3cb801[_0x369d('0x3a')]['id']}})[_0x369d('0x24')](handleEntityNotFound(_0x3e6c14,null))[_0x369d('0x24')](saveUpdates(_0x3cb801[_0x369d('0x38')],null))[_0x369d('0x24')](respondWithResult(_0x3e6c14,null))[_0x369d('0x36')](handleError(_0x3e6c14,null));};exports[_0x369d('0x23')]=function(_0xddb3c1,_0x1edb38){return db[_0x369d('0x2a')][_0x369d('0x39')]({'where':{'id':_0xddb3c1[_0x369d('0x3a')]['id']}})[_0x369d('0x24')](handleEntityNotFound(_0x1edb38,null))[_0x369d('0x24')](removeEntity(_0x1edb38,null))[_0x369d('0x36')](handleError(_0x1edb38,null));};
\ No newline at end of file
+var _0x9c00=['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','json','undefined','limit','count','Content-Range','apply','reject','update','destroy','error','stack','name','show','params','keys','ChatApplication','rawAttributes','query','filters','intersection','model','attributes','fields','length','includeAll','merge','options','find','then','catch','body','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel'];(function(_0x43a37c,_0x25a567){var _0x5d1d40=function(_0x3ec673){while(--_0x3ec673){_0x43a37c['push'](_0x43a37c['shift']());}};_0x5d1d40(++_0x25a567);}(_0x9c00,0x1a0));var _0x09c0=function(_0x25678f,_0x5958d5){_0x25678f=_0x25678f-0x0;var _0x1961b5=_0x9c00[_0x25678f];return _0x1961b5;};'use strict';var emlformat=require(_0x09c0('0x0'));var rimraf=require(_0x09c0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x09c0('0x2'));var moment=require(_0x09c0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x09c0('0x4'));var util=require(_0x09c0('0x5'));var path=require(_0x09c0('0x6'));var sox=require(_0x09c0('0x7'));var csv=require(_0x09c0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x09c0('0x9'));var squel=require(_0x09c0('0xa'));var crypto=require(_0x09c0('0xb'));var jsforce=require(_0x09c0('0xc'));var deskjs=require(_0x09c0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x09c0('0xe'));var Papa=require(_0x09c0('0xf'));var Redis=require(_0x09c0('0x10'));var authService=require(_0x09c0('0x11'));var qs=require(_0x09c0('0x12'));var as=require(_0x09c0('0x13'));var hardwareService=require(_0x09c0('0x14'));var logger=require(_0x09c0('0x15'))(_0x09c0('0x16'));var utils=require(_0x09c0('0x17'));var config=require(_0x09c0('0x18'));var licenseUtil=require(_0x09c0('0x19'));var db=require(_0x09c0('0x1a'))['db'];function respondWithStatusCode(_0x144271,_0x3b95cc){_0x3b95cc=_0x3b95cc||0xcc;return function(_0x331905){if(_0x331905){return _0x144271[_0x09c0('0x1b')](_0x3b95cc);}return _0x144271[_0x09c0('0x1c')](_0x3b95cc)[_0x09c0('0x1d')]();};}function respondWithResult(_0x3649d2,_0x16e490){_0x16e490=_0x16e490||0xc8;return function(_0x254598){if(_0x254598){return _0x3649d2[_0x09c0('0x1c')](_0x16e490)[_0x09c0('0x1e')](_0x254598);}};}function respondWithFilteredResult(_0x33c3d6,_0x2fdf11){return function(_0x4ff6b7){if(_0x4ff6b7){var _0x590129=typeof _0x2fdf11['offset']===_0x09c0('0x1f')&&typeof _0x2fdf11[_0x09c0('0x20')]===_0x09c0('0x1f');var _0x628272=_0x4ff6b7['count'];var _0x2c4440=_0x590129?0x0:_0x2fdf11['offset'];var _0x4c29a7=_0x590129?_0x4ff6b7[_0x09c0('0x21')]:_0x2fdf11['offset']+_0x2fdf11[_0x09c0('0x20')];var _0x319c36;if(_0x4c29a7>=_0x628272){_0x4c29a7=_0x628272;_0x319c36=0xc8;}else{_0x319c36=0xce;}_0x33c3d6[_0x09c0('0x1c')](_0x319c36);return _0x33c3d6['set'](_0x09c0('0x22'),_0x2c4440+'-'+_0x4c29a7+'/'+_0x628272)[_0x09c0('0x1e')](_0x4ff6b7);}return null;};}function patchUpdates(_0x8ad645){return function(_0x3447c5){try{jsonpatch[_0x09c0('0x23')](_0x3447c5,_0x8ad645,!![]);}catch(_0xa5d16f){return BPromise[_0x09c0('0x24')](_0xa5d16f);}return _0x3447c5['save']();};}function saveUpdates(_0x1695e8,_0x46f171){return function(_0x473fbd){if(_0x473fbd){return _0x473fbd[_0x09c0('0x25')](_0x1695e8)['then'](function(_0x4f6824){return _0x4f6824;});}return null;};}function removeEntity(_0x321bcc,_0x25fdb5){return function(_0x1e8a1c){if(_0x1e8a1c){return _0x1e8a1c[_0x09c0('0x26')]()['then'](function(){_0x321bcc[_0x09c0('0x1c')](0xcc)[_0x09c0('0x1d')]();});}};}function handleEntityNotFound(_0x56d883,_0x2c7202){return function(_0x163a59){if(!_0x163a59){_0x56d883[_0x09c0('0x1b')](0x194);}return _0x163a59;};}function handleError(_0x30c2a1,_0x1f8131){_0x1f8131=_0x1f8131||0x1f4;return function(_0x1d2d9d){logger[_0x09c0('0x27')](_0x1d2d9d[_0x09c0('0x28')]);if(_0x1d2d9d[_0x09c0('0x29')]){delete _0x1d2d9d[_0x09c0('0x29')];}_0x30c2a1[_0x09c0('0x1c')](_0x1f8131)['send'](_0x1d2d9d);};}exports[_0x09c0('0x2a')]=function(_0x1bdde9,_0x53a7b8){var _0x1d09e0={'raw':!![],'where':{'id':_0x1bdde9[_0x09c0('0x2b')]['id']}},_0x5aa0b9={};_0x5aa0b9['model']=_[_0x09c0('0x2c')](db[_0x09c0('0x2d')][_0x09c0('0x2e')]);_0x5aa0b9[_0x09c0('0x2f')]=_['keys'](_0x1bdde9['query']);_0x5aa0b9[_0x09c0('0x30')]=_[_0x09c0('0x31')](_0x5aa0b9[_0x09c0('0x32')],_0x5aa0b9['query']);_0x1d09e0[_0x09c0('0x33')]=_['intersection'](_0x5aa0b9[_0x09c0('0x32')],qs[_0x09c0('0x34')](_0x1bdde9[_0x09c0('0x2f')]['fields']));_0x1d09e0[_0x09c0('0x33')]=_0x1d09e0[_0x09c0('0x33')][_0x09c0('0x35')]?_0x1d09e0[_0x09c0('0x33')]:_0x5aa0b9[_0x09c0('0x32')];if(_0x1bdde9[_0x09c0('0x2f')][_0x09c0('0x36')]){_0x1d09e0['include']=[{'all':!![]}];}_0x1d09e0=_[_0x09c0('0x37')]({},_0x1d09e0,_0x1bdde9[_0x09c0('0x38')]);return db[_0x09c0('0x2d')][_0x09c0('0x39')](_0x1d09e0)[_0x09c0('0x3a')](handleEntityNotFound(_0x53a7b8,null))['then'](respondWithResult(_0x53a7b8,null))[_0x09c0('0x3b')](handleError(_0x53a7b8,null));};exports[_0x09c0('0x25')]=function(_0xca8ae9,_0x12358f){if(_0xca8ae9[_0x09c0('0x3c')]['id']){delete _0xca8ae9['body']['id'];}return db[_0x09c0('0x2d')][_0x09c0('0x39')]({'where':{'id':_0xca8ae9[_0x09c0('0x2b')]['id']}})[_0x09c0('0x3a')](handleEntityNotFound(_0x12358f,null))[_0x09c0('0x3a')](saveUpdates(_0xca8ae9[_0x09c0('0x3c')],null))[_0x09c0('0x3a')](respondWithResult(_0x12358f,null))['catch'](handleError(_0x12358f,null));};exports[_0x09c0('0x26')]=function(_0x2a93d2,_0x3ab3d9){return db[_0x09c0('0x2d')][_0x09c0('0x39')]({'where':{'id':_0x2a93d2['params']['id']}})['then'](handleEntityNotFound(_0x3ab3d9,null))['then'](removeEntity(_0x3ab3d9,null))['catch'](handleError(_0x3ab3d9,null));};
\ No newline at end of file
index 8ce0ec6..3ecea44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b41=['ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./chatApplication.attributes','exports'];(function(_0x617021,_0x39fdb7){var _0x28b079=function(_0x46d097){while(--_0x46d097){_0x617021['push'](_0x617021['shift']());}};_0x28b079(++_0x39fdb7);}(_0x2b41,0x146));var _0x12b4=function(_0xf5605c,_0x178148){_0xf5605c=_0xf5605c-0x0;var _0x4a5d10=_0x2b41[_0xf5605c];return _0x4a5d10;};'use strict';var _=require(_0x12b4('0x0'));var util=require(_0x12b4('0x1'));var logger=require(_0x12b4('0x2'))(_0x12b4('0x3'));var moment=require(_0x12b4('0x4'));var BPromise=require(_0x12b4('0x5'));var rp=require(_0x12b4('0x6'));var fs=require('fs');var path=require(_0x12b4('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x12b4('0x8'));module[_0x12b4('0x9')]=function(_0x5712c5,_0x575691){return _0x5712c5['define'](_0x12b4('0xa'),attributes,{'tableName':_0x12b4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x12b4('0xc'),'collate':_0x12b4('0xd')});};
\ No newline at end of file
+var _0x901c=['exports','define','ChatApplication','chat_applications','utf8mb4','lodash','../../config/logger','moment','bluebird','path','rimraf','./chatApplication.attributes'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x901c,0x119));var _0xc901=function(_0x2269cc,_0x3c23f3){_0x2269cc=_0x2269cc-0x0;var _0x57a1c1=_0x901c[_0x2269cc];return _0x57a1c1;};'use strict';var _=require(_0xc901('0x0'));var util=require('util');var logger=require(_0xc901('0x1'))('api');var moment=require(_0xc901('0x2'));var BPromise=require(_0xc901('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc901('0x4'));var rimraf=require(_0xc901('0x5'));var config=require('../../config/environment');var attributes=require(_0xc901('0x6'));module[_0xc901('0x7')]=function(_0x29e64d,_0x5cad1b){return _0x29e64d[_0xc901('0x8')](_0xc901('0x9'),attributes,{'tableName':_0xc901('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc901('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 914eef1..32fd48f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb8bf=['ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info'];(function(_0x38ce2c,_0x5852f3){var _0x3562b8=function(_0x103340){while(--_0x103340){_0x38ce2c['push'](_0x38ce2c['shift']());}};_0x3562b8(++_0x5852f3);}(_0xb8bf,0x135));var _0xfb8b=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xb8bf[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xfb8b('0x0'));var util=require(_0xfb8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfb8b('0x2'));var fs=require('fs');var Redis=require(_0xfb8b('0x3'));var db=require(_0xfb8b('0x4'))['db'];var utils=require(_0xfb8b('0x5'));var logger=require(_0xfb8b('0x6'))(_0xfb8b('0x7'));var config=require(_0xfb8b('0x8'));var jayson=require(_0xfb8b('0x9'));var client=jayson['client'][_0xfb8b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a3cbc,_0x499b04,_0x47868d){return new BPromise(function(_0x1f893d,_0x2bb232){return client[_0xfb8b('0xb')](_0x5a3cbc,_0x47868d)['then'](function(_0x5774ad){logger[_0xfb8b('0xc')](_0xfb8b('0xd'),_0x499b04,_0xfb8b('0xe'));logger[_0xfb8b('0xf')](_0xfb8b('0x10'),_0x499b04,'request\x20sent',JSON[_0xfb8b('0x11')](_0x5774ad));if(_0x5774ad[_0xfb8b('0x12')]){if(_0x5774ad[_0xfb8b('0x12')][_0xfb8b('0x13')]===0x1f4){logger[_0xfb8b('0x12')](_0xfb8b('0xd'),_0x499b04,_0x5774ad[_0xfb8b('0x12')][_0xfb8b('0x14')]);return _0x2bb232(_0x5774ad[_0xfb8b('0x12')][_0xfb8b('0x14')]);}logger[_0xfb8b('0x12')]('ChatApplication,\x20%s,\x20%s',_0x499b04,_0x5774ad[_0xfb8b('0x12')][_0xfb8b('0x14')]);return _0x1f893d(_0x5774ad['error'][_0xfb8b('0x14')]);}else{logger[_0xfb8b('0xc')](_0xfb8b('0xd'),_0x499b04,_0xfb8b('0xe'));_0x1f893d(_0x5774ad[_0xfb8b('0x15')][_0xfb8b('0x14')]);}})[_0xfb8b('0x16')](function(_0xc76787){logger[_0xfb8b('0x12')](_0xfb8b('0xd'),_0x499b04,_0xc76787);_0x2bb232(_0xc76787);});});}
\ No newline at end of file
+var _0x37ff=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x37ff,0x8b));var _0xf37f=function(_0x1c5bdb,_0x44bf0e){_0x1c5bdb=_0x1c5bdb-0x0;var _0x4988a1=_0x37ff[_0x1c5bdb];return _0x4988a1;};'use strict';var _=require(_0xf37f('0x0'));var util=require(_0xf37f('0x1'));var moment=require(_0xf37f('0x2'));var BPromise=require(_0xf37f('0x3'));var rs=require(_0xf37f('0x4'));var fs=require('fs');var Redis=require(_0xf37f('0x5'));var db=require(_0xf37f('0x6'))['db'];var utils=require(_0xf37f('0x7'));var logger=require(_0xf37f('0x8'))(_0xf37f('0x9'));var config=require(_0xf37f('0xa'));var jayson=require(_0xf37f('0xb'));var client=jayson[_0xf37f('0xc')][_0xf37f('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x31e0f4,_0x399482,_0x56495b){return new BPromise(function(_0xee6404,_0x1db717){return client[_0xf37f('0xe')](_0x31e0f4,_0x56495b)[_0xf37f('0xf')](function(_0x7c96c6){logger[_0xf37f('0x10')](_0xf37f('0x11'),_0x399482,_0xf37f('0x12'));logger[_0xf37f('0x13')](_0xf37f('0x14'),_0x399482,_0xf37f('0x12'),JSON[_0xf37f('0x15')](_0x7c96c6));if(_0x7c96c6[_0xf37f('0x16')]){if(_0x7c96c6[_0xf37f('0x16')][_0xf37f('0x17')]===0x1f4){logger[_0xf37f('0x16')](_0xf37f('0x11'),_0x399482,_0x7c96c6[_0xf37f('0x16')][_0xf37f('0x18')]);return _0x1db717(_0x7c96c6[_0xf37f('0x16')]['message']);}logger['error']('ChatApplication,\x20%s,\x20%s',_0x399482,_0x7c96c6['error'][_0xf37f('0x18')]);return _0xee6404(_0x7c96c6[_0xf37f('0x16')][_0xf37f('0x18')]);}else{logger[_0xf37f('0x10')]('ChatApplication,\x20%s,\x20%s',_0x399482,'request\x20sent');_0xee6404(_0x7c96c6[_0xf37f('0x19')][_0xf37f('0x18')]);}})[_0xf37f('0x1a')](function(_0x20957b){logger[_0xf37f('0x16')]('ChatApplication,\x20%s,\x20%s',_0x399482,_0x20957b);_0x1db717(_0x20957b);});});}
\ No newline at end of file
index 870f863..0e0dc1f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x843b=['update','delete','isAuthenticated','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','get','/:id'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0x843b,0xd6));var _0xb843=function(_0x445ffa,_0x2b4b2d){_0x445ffa=_0x445ffa-0x0;var _0xc1e02c=_0x843b[_0x445ffa];return _0xc1e02c;};'use strict';var multer=require(_0xb843('0x0'));var util=require(_0xb843('0x1'));var path=require(_0xb843('0x2'));var timeout=require(_0xb843('0x3'));var express=require(_0xb843('0x4'));var router=express[_0xb843('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb843('0x6'));var interaction=require(_0xb843('0x7'));var config=require('../../config/environment');var controller=require(_0xb843('0x8'));router[_0xb843('0x9')](_0xb843('0xa'),auth['isAuthenticated'](),controller['show']);router['put'](_0xb843('0xa'),auth['isAuthenticated'](),controller[_0xb843('0xb')]);router[_0xb843('0xc')](_0xb843('0xa'),auth[_0xb843('0xd')](),controller['destroy']);module[_0xb843('0xe')]=router;
\ No newline at end of file
+var _0xbeef=['put','update','isAuthenticated','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','./chatApplication.controller','get','/:id','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbeef,0x1e5));var _0xfbee=function(_0xd6e946,_0x564e27){_0xd6e946=_0xd6e946-0x0;var _0x4f7679=_0xbeef[_0xd6e946];return _0x4f7679;};'use strict';var multer=require(_0xfbee('0x0'));var util=require(_0xfbee('0x1'));var path=require(_0xfbee('0x2'));var timeout=require(_0xfbee('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfbee('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xfbee('0x5'));var controller=require(_0xfbee('0x6'));router[_0xfbee('0x7')](_0xfbee('0x8'),auth['isAuthenticated'](),controller[_0xfbee('0x9')]);router[_0xfbee('0xa')](_0xfbee('0x8'),auth['isAuthenticated'](),controller[_0xfbee('0xb')]);router['delete']('/:id',auth[_0xfbee('0xc')](),controller[_0xfbee('0xd')]);module[_0xfbee('0xe')]=router;
\ No newline at end of file
index 8ca02f4..4ae20e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ecd=['STRING','BOOLEAN','sequelize','exports'];(function(_0xd1bf59,_0x435422){var _0x2e1086=function(_0x258439){while(--_0x258439){_0xd1bf59['push'](_0xd1bf59['shift']());}};_0x2e1086(++_0x435422);}(_0x1ecd,0xee));var _0xd1ec=function(_0xf2f332,_0x299fbf){_0xf2f332=_0xf2f332-0x0;var _0x56cce3=_0x1ecd[_0xf2f332];return _0x56cce3;};'use strict';var Sequelize=require(_0xd1ec('0x0'));module[_0xd1ec('0x1')]={'name':{'type':Sequelize[_0xd1ec('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd1ec('0x2')]},'write':{'type':Sequelize[_0xd1ec('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xf3fe=['STRING','BOOLEAN','exports'];(function(_0x14ac04,_0x319115){var _0x4bba8c=function(_0x436fbf){while(--_0x436fbf){_0x14ac04['push'](_0x14ac04['shift']());}};_0x4bba8c(++_0x319115);}(_0xf3fe,0x1cd));var _0xef3f=function(_0x590a76,_0x3eeaec){_0x590a76=_0x590a76-0x0;var _0x1c408d=_0xf3fe[_0x590a76];return _0x1c408d;};'use strict';var Sequelize=require('sequelize');module[_0xef3f('0x0')]={'name':{'type':Sequelize[_0xef3f('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xef3f('0x1')]},'write':{'type':Sequelize[_0xef3f('0x2')],'defaultValue':!![]}};
\ No newline at end of file
index 80103a0..0350e5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a95=['VIRTUAL','merge','options','include','findAll','rows','catch','show','params','length','includeAll','create','body','update','find','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','findOne','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','$gte','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','status','json','offset','undefined','limit','count','Content-Range','save','then','destroy','end','sendStatus','error','stack','name','index','map','ChatGroup','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','type'];(function(_0x442ede,_0x2c3376){var _0x3b7c68=function(_0x4fd896){while(--_0x4fd896){_0x442ede['push'](_0x442ede['shift']());}};_0x3b7c68(++_0x2c3376);}(_0x6a95,0x1ab));var _0x56a9=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x6a95[_0x5447fd];return _0x15b28a;};'use strict';var emlformat=require(_0x56a9('0x0'));var rimraf=require(_0x56a9('0x1'));var zipdir=require(_0x56a9('0x2'));var jsonpatch=require(_0x56a9('0x3'));var rp=require(_0x56a9('0x4'));var moment=require(_0x56a9('0x5'));var BPromise=require(_0x56a9('0x6'));var Mustache=require(_0x56a9('0x7'));var util=require(_0x56a9('0x8'));var path=require(_0x56a9('0x9'));var sox=require(_0x56a9('0xa'));var csv=require(_0x56a9('0xb'));var ejs=require(_0x56a9('0xc'));var fs=require('fs');var fs_extra=require(_0x56a9('0xd'));var _=require('lodash');var squel=require(_0x56a9('0xe'));var crypto=require(_0x56a9('0xf'));var jsforce=require(_0x56a9('0x10'));var deskjs=require(_0x56a9('0x11'));var toCsv=require('to-csv');var querystring=require(_0x56a9('0x12'));var Papa=require(_0x56a9('0x13'));var Redis=require(_0x56a9('0x14'));var authService=require(_0x56a9('0x15'));var qs=require(_0x56a9('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x56a9('0x17'));var logger=require('../../config/logger')(_0x56a9('0x18'));var utils=require('../../config/utils');var config=require(_0x56a9('0x19'));var licenseUtil=require(_0x56a9('0x1a'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x56a9('0x1b')](config[_0x56a9('0x1c')],{'host':_0x56a9('0x1d'),'port':0x18eb});var socket=require(_0x56a9('0x1e'))(new Redis(config[_0x56a9('0x1c')]));require(_0x56a9('0x1f'))[_0x56a9('0x20')](socket);function respondWithStatusCode(_0x5b49a2,_0x2ad162){_0x2ad162=_0x2ad162||0xcc;return function(_0x4bccdb){if(_0x4bccdb){return _0x5b49a2['sendStatus'](_0x2ad162);}return _0x5b49a2['status'](_0x2ad162)['end']();};}function respondWithResult(_0x4a35d9,_0x28db43){_0x28db43=_0x28db43||0xc8;return function(_0x47be2e){if(_0x47be2e){return _0x4a35d9[_0x56a9('0x21')](_0x28db43)[_0x56a9('0x22')](_0x47be2e);}};}function respondWithFilteredResult(_0x7f2092,_0xef87b6){return function(_0x5e2f8b){if(_0x5e2f8b){var _0x4e7a68=typeof _0xef87b6[_0x56a9('0x23')]===_0x56a9('0x24')&&typeof _0xef87b6[_0x56a9('0x25')]===_0x56a9('0x24');var _0x4da5d3=_0x5e2f8b[_0x56a9('0x26')];var _0x273868=_0x4e7a68?0x0:_0xef87b6[_0x56a9('0x23')];var _0x33b550=_0x4e7a68?_0x5e2f8b[_0x56a9('0x26')]:_0xef87b6['offset']+_0xef87b6[_0x56a9('0x25')];var _0x550a12;if(_0x33b550>=_0x4da5d3){_0x33b550=_0x4da5d3;_0x550a12=0xc8;}else{_0x550a12=0xce;}_0x7f2092['status'](_0x550a12);return _0x7f2092['set'](_0x56a9('0x27'),_0x273868+'-'+_0x33b550+'/'+_0x4da5d3)['json'](_0x5e2f8b);}return null;};}function patchUpdates(_0x562c7f){return function(_0x274ccd){try{jsonpatch['apply'](_0x274ccd,_0x562c7f,!![]);}catch(_0x36b17b){return BPromise['reject'](_0x36b17b);}return _0x274ccd[_0x56a9('0x28')]();};}function saveUpdates(_0x3cf063,_0x5302b0){return function(_0x263186){if(_0x263186){return _0x263186['update'](_0x3cf063)[_0x56a9('0x29')](function(_0x5e9567){return _0x5e9567;});}return null;};}function removeEntity(_0x5c0feb,_0x4863f3){return function(_0x1206cf){if(_0x1206cf){return _0x1206cf[_0x56a9('0x2a')]()[_0x56a9('0x29')](function(){_0x5c0feb[_0x56a9('0x21')](0xcc)[_0x56a9('0x2b')]();});}};}function handleEntityNotFound(_0x1e9c53,_0x28bb75){return function(_0x1d8f5e){if(!_0x1d8f5e){_0x1e9c53[_0x56a9('0x2c')](0x194);}return _0x1d8f5e;};}function handleError(_0x94b1b2,_0x41df58){_0x41df58=_0x41df58||0x1f4;return function(_0x5cd94e){logger[_0x56a9('0x2d')](_0x5cd94e[_0x56a9('0x2e')]);if(_0x5cd94e[_0x56a9('0x2f')]){delete _0x5cd94e[_0x56a9('0x2f')];}_0x94b1b2[_0x56a9('0x21')](_0x41df58)['send'](_0x5cd94e);};}exports[_0x56a9('0x30')]=function(_0x41535c,_0x305c9a){var _0x1d8eb6={},_0x183189={},_0x38c601={'count':0x0,'rows':[]};var _0x1f0787=_[_0x56a9('0x31')](db[_0x56a9('0x32')][_0x56a9('0x33')],function(_0x4e7177){return{'name':_0x4e7177['fieldName'],'type':_0x4e7177['type'][_0x56a9('0x34')]};});_0x183189[_0x56a9('0x35')]=_[_0x56a9('0x31')](_0x1f0787,_0x56a9('0x2f'));_0x183189[_0x56a9('0x36')]=_[_0x56a9('0x37')](_0x41535c[_0x56a9('0x36')]);_0x183189[_0x56a9('0x38')]=_[_0x56a9('0x39')](_0x183189[_0x56a9('0x35')],_0x183189[_0x56a9('0x36')]);_0x1d8eb6[_0x56a9('0x3a')]=_[_0x56a9('0x39')](_0x183189[_0x56a9('0x35')],qs[_0x56a9('0x3b')](_0x41535c['query'][_0x56a9('0x3b')]));_0x1d8eb6['attributes']=_0x1d8eb6['attributes']['length']?_0x1d8eb6[_0x56a9('0x3a')]:_0x183189[_0x56a9('0x35')];if(!_0x41535c[_0x56a9('0x36')][_0x56a9('0x3c')](_0x56a9('0x3d'))){_0x1d8eb6[_0x56a9('0x25')]=qs[_0x56a9('0x25')](_0x41535c[_0x56a9('0x36')][_0x56a9('0x25')]);_0x1d8eb6['offset']=qs['offset'](_0x41535c[_0x56a9('0x36')][_0x56a9('0x23')]);}_0x1d8eb6[_0x56a9('0x3e')]=qs[_0x56a9('0x3f')](_0x41535c[_0x56a9('0x36')][_0x56a9('0x3f')]);_0x1d8eb6['where']=qs[_0x56a9('0x38')](_[_0x56a9('0x40')](_0x41535c[_0x56a9('0x36')],_0x183189[_0x56a9('0x38')]),_0x1f0787);if(_0x41535c[_0x56a9('0x36')][_0x56a9('0x41')]){_0x1d8eb6[_0x56a9('0x42')]=_['merge'](_0x1d8eb6[_0x56a9('0x42')],{'$or':_[_0x56a9('0x31')](_0x1f0787,function(_0x2b0601){if(_0x2b0601[_0x56a9('0x43')]!==_0x56a9('0x44')){var _0x102061={};_0x102061[_0x2b0601[_0x56a9('0x2f')]]={'$like':'%'+_0x41535c[_0x56a9('0x36')][_0x56a9('0x41')]+'%'};return _0x102061;}})});}_0x1d8eb6=_[_0x56a9('0x45')]({},_0x1d8eb6,_0x41535c[_0x56a9('0x46')]);var _0x3cdba7={'where':_0x1d8eb6[_0x56a9('0x42')]};return db[_0x56a9('0x32')]['count'](_0x3cdba7)[_0x56a9('0x29')](function(_0x2cc41f){_0x38c601['count']=_0x2cc41f;if(_0x41535c['query']['includeAll']){_0x1d8eb6[_0x56a9('0x47')]=[{'all':!![]}];}return db[_0x56a9('0x32')][_0x56a9('0x48')](_0x1d8eb6);})[_0x56a9('0x29')](function(_0x531918){_0x38c601[_0x56a9('0x49')]=_0x531918;return _0x38c601;})['then'](respondWithFilteredResult(_0x305c9a,_0x1d8eb6))[_0x56a9('0x4a')](handleError(_0x305c9a,null));};exports[_0x56a9('0x4b')]=function(_0x3cb3b3,_0x5d0ba1){var _0x3c1ebe={'raw':!![],'where':{'id':_0x3cb3b3[_0x56a9('0x4c')]['id']}},_0x17a3b9={};_0x17a3b9[_0x56a9('0x35')]=_[_0x56a9('0x37')](db[_0x56a9('0x32')]['rawAttributes']);_0x17a3b9[_0x56a9('0x36')]=_['keys'](_0x3cb3b3['query']);_0x17a3b9['filters']=_['intersection'](_0x17a3b9['model'],_0x17a3b9[_0x56a9('0x36')]);_0x3c1ebe[_0x56a9('0x3a')]=_[_0x56a9('0x39')](_0x17a3b9['model'],qs['fields'](_0x3cb3b3['query'][_0x56a9('0x3b')]));_0x3c1ebe[_0x56a9('0x3a')]=_0x3c1ebe[_0x56a9('0x3a')][_0x56a9('0x4d')]?_0x3c1ebe[_0x56a9('0x3a')]:_0x17a3b9[_0x56a9('0x35')];if(_0x3cb3b3[_0x56a9('0x36')][_0x56a9('0x4e')]){_0x3c1ebe[_0x56a9('0x47')]=[{'all':!![]}];}_0x3c1ebe=_['merge']({},_0x3c1ebe,_0x3cb3b3[_0x56a9('0x46')]);return db['ChatGroup']['find'](_0x3c1ebe)[_0x56a9('0x29')](handleEntityNotFound(_0x5d0ba1,null))['then'](respondWithResult(_0x5d0ba1,null))['catch'](handleError(_0x5d0ba1,null));};exports[_0x56a9('0x4f')]=function(_0x51e774,_0x2ce42b){return db[_0x56a9('0x32')]['create'](_0x51e774[_0x56a9('0x50')],{})[_0x56a9('0x29')](respondWithResult(_0x2ce42b,0xc9))[_0x56a9('0x4a')](handleError(_0x2ce42b,null));};exports[_0x56a9('0x51')]=function(_0xa85203,_0x3d8c5a){if(_0xa85203['body']['id']){delete _0xa85203['body']['id'];}return db[_0x56a9('0x32')][_0x56a9('0x52')]({'where':{'id':_0xa85203[_0x56a9('0x4c')]['id']}})[_0x56a9('0x29')](handleEntityNotFound(_0x3d8c5a,null))[_0x56a9('0x29')](saveUpdates(_0xa85203['body'],null))[_0x56a9('0x29')](respondWithResult(_0x3d8c5a,null))[_0x56a9('0x4a')](handleError(_0x3d8c5a,null));};exports[_0x56a9('0x2a')]=function(_0x178761,_0x57b532){return db[_0x56a9('0x32')][_0x56a9('0x52')]({'where':{'id':_0x178761[_0x56a9('0x4c')]['id']}})['then'](handleEntityNotFound(_0x57b532,null))[_0x56a9('0x29')](removeEntity(_0x57b532,null))[_0x56a9('0x4a')](handleError(_0x57b532,null));};exports[_0x56a9('0x53')]=function(_0x40945c,_0x534b4f){return db[_0x56a9('0x32')][_0x56a9('0x53')]()['then'](respondWithResult(_0x534b4f,null))['catch'](handleError(_0x534b4f,null));};exports[_0x56a9('0x54')]=function(_0x49991c,_0x38e06a,_0x3a23b0){return db[_0x56a9('0x55')]['count']({'where':{'ChatGroupId':_0x49991c['params']['id'],'ToId':_0x49991c[_0x56a9('0x56')]['id'],'read':![]}})[_0x56a9('0x29')](function(_0x4715f5){return{'id':_[_0x56a9('0x57')](_0x49991c[_0x56a9('0x4c')]['id']),'count':_0x4715f5};})[_0x56a9('0x29')](respondWithResult(_0x38e06a,null))[_0x56a9('0x4a')](handleError(_0x38e06a,null));};exports['addMembers']=function(_0x442a28,_0x50a653,_0x3ba8b7){return db['ChatGroup'][_0x56a9('0x52')]({'where':{'id':_0x442a28['params']['id']}})[_0x56a9('0x29')](handleEntityNotFound(_0x50a653,null))['then'](function(_0x1997f8){if(_0x1997f8){return _0x1997f8[_0x56a9('0x58')](_0x442a28[_0x56a9('0x50')][_0x56a9('0x59')],_[_0x56a9('0x5a')](_0x442a28['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x50a653,null))[_0x56a9('0x4a')](handleError(_0x50a653,null));};exports['getMembers']=function(_0x356155,_0x3dc460,_0xf8b4b){var _0x95329b={};var _0x5512a8={};var _0x4e4414;var _0x5ae821;return db['ChatGroup'][_0x56a9('0x5b')]({'where':{'id':_0x356155[_0x56a9('0x4c')]['id']}})[_0x56a9('0x29')](handleEntityNotFound(_0x3dc460,null))[_0x56a9('0x29')](function(_0x82f2fe){if(_0x82f2fe){_0x4e4414=_0x82f2fe;_0x5512a8[_0x56a9('0x35')]=_[_0x56a9('0x37')](db['User']['rawAttributes']);_0x5512a8[_0x56a9('0x36')]=_[_0x56a9('0x37')](_0x356155[_0x56a9('0x36')]);_0x5512a8[_0x56a9('0x38')]=_['intersection'](_0x5512a8[_0x56a9('0x35')],_0x5512a8[_0x56a9('0x36')]);_0x95329b[_0x56a9('0x3a')]=_[_0x56a9('0x39')](_0x5512a8[_0x56a9('0x35')],qs['fields'](_0x356155[_0x56a9('0x36')][_0x56a9('0x3b')]));_0x95329b['attributes']=_0x95329b[_0x56a9('0x3a')][_0x56a9('0x4d')]?_0x95329b['attributes']:_0x5512a8['model'];_0x95329b[_0x56a9('0x3e')]=qs[_0x56a9('0x3f')](_0x356155[_0x56a9('0x36')][_0x56a9('0x3f')]);_0x95329b[_0x56a9('0x42')]=qs[_0x56a9('0x38')](_['pick'](_0x356155[_0x56a9('0x36')],_0x5512a8[_0x56a9('0x38')]));if(_0x356155[_0x56a9('0x36')][_0x56a9('0x41')]){_0x95329b[_0x56a9('0x42')]=_[_0x56a9('0x45')](_0x95329b[_0x56a9('0x42')],{'$or':_['map'](_0x95329b[_0x56a9('0x3a')],function(_0x44b63d){var _0xcac020={};_0xcac020[_0x44b63d]={'$like':'%'+_0x356155[_0x56a9('0x36')][_0x56a9('0x41')]+'%'};return _0xcac020;})});}_0x95329b=_['merge']({},_0x95329b,_0x356155[_0x56a9('0x46')]);return _0x4e4414[_0x56a9('0x5c')](_0x95329b);}})[_0x56a9('0x29')](function(_0x4d4f05){if(_0x4d4f05){_0x5ae821=_0x4d4f05[_0x56a9('0x4d')];if(!_0x356155[_0x56a9('0x36')][_0x56a9('0x3c')](_0x56a9('0x3d'))){_0x95329b[_0x56a9('0x25')]=qs[_0x56a9('0x25')](_0x356155[_0x56a9('0x36')][_0x56a9('0x25')]);_0x95329b[_0x56a9('0x23')]=qs[_0x56a9('0x23')](_0x356155['query']['offset']);}return _0x4e4414[_0x56a9('0x5c')](_0x95329b);}})[_0x56a9('0x29')](function(_0x3c30a2){if(_0x3c30a2){return _0x3c30a2?{'count':_0x5ae821,'rows':_0x3c30a2}:null;}})[_0x56a9('0x29')](respondWithResult(_0x3dc460,null))[_0x56a9('0x4a')](handleError(_0x3dc460,null));};exports[_0x56a9('0x5d')]=function(_0x4aebcb,_0x407d7c,_0x3e3566){return db['ChatGroup'][_0x56a9('0x52')]({'where':{'id':_0x4aebcb[_0x56a9('0x4c')]['id']}})[_0x56a9('0x29')](handleEntityNotFound(_0x407d7c,null))['then'](function(_0x4082f3){if(_0x4082f3){return _0x4082f3[_0x56a9('0x5d')](_0x4aebcb[_0x56a9('0x36')][_0x56a9('0x59')]);}})[_0x56a9('0x29')](respondWithStatusCode(_0x407d7c,null))[_0x56a9('0x4a')](handleError(_0x407d7c,null));};exports[_0x56a9('0x5e')]=function(_0xb7036d,_0x5585f2,_0x209c27){if(_0xb7036d[_0x56a9('0x50')]['id']){delete _0xb7036d[_0x56a9('0x50')]['id'];}return db[_0x56a9('0x32')][_0x56a9('0x52')]({'where':{'id':_0xb7036d[_0x56a9('0x4c')]['id']}})[_0x56a9('0x29')](handleEntityNotFound(_0x5585f2,null))[_0x56a9('0x29')](function(_0x5890a0){if(_0x5890a0){_0xb7036d[_0x56a9('0x50')][_0x56a9('0x5f')]=_0x5890a0['id'];return db[_0x56a9('0x55')][_0x56a9('0x4f')](_0xb7036d[_0x56a9('0x50')]);}})[_0x56a9('0x29')](respondWithResult(_0x5585f2,null))[_0x56a9('0x4a')](handleError(_0x5585f2,null));};exports[_0x56a9('0x60')]=function(_0x2d1d2e,_0x422348,_0x73fbab){var _0x30dcbc={};var _0xd21c64={};var _0x26ee1a;var _0x158f59;return db[_0x56a9('0x32')][_0x56a9('0x5b')]({'where':{'id':_0x2d1d2e[_0x56a9('0x4c')]['id']}})['then'](handleEntityNotFound(_0x422348,null))[_0x56a9('0x29')](function(_0x1f630f){if(_0x1f630f){_0x26ee1a=_0x1f630f;_0xd21c64['model']=_['keys'](db[_0x56a9('0x55')]['rawAttributes']);_0xd21c64[_0x56a9('0x36')]=_[_0x56a9('0x37')](_0x2d1d2e['query']);_0xd21c64[_0x56a9('0x38')]=_[_0x56a9('0x39')](_0xd21c64['model'],_0xd21c64[_0x56a9('0x36')]);_0x30dcbc[_0x56a9('0x3a')]=_['intersection'](_0xd21c64[_0x56a9('0x35')],qs['fields'](_0x2d1d2e[_0x56a9('0x36')][_0x56a9('0x3b')]));_0x30dcbc[_0x56a9('0x3a')]=_0x30dcbc[_0x56a9('0x3a')][_0x56a9('0x4d')]?_0x30dcbc[_0x56a9('0x3a')]:_0xd21c64[_0x56a9('0x35')];_0x30dcbc[_0x56a9('0x3e')]=qs[_0x56a9('0x3f')](_0x2d1d2e[_0x56a9('0x36')][_0x56a9('0x3f')]);_0x30dcbc['where']=qs[_0x56a9('0x38')](_['pick'](_0x2d1d2e[_0x56a9('0x36')],_0xd21c64['filters']));if(_0x2d1d2e[_0x56a9('0x36')]['filter']){_0x30dcbc['where']=_[_0x56a9('0x45')](_0x30dcbc['where'],{'$or':_[_0x56a9('0x31')](_0x30dcbc[_0x56a9('0x3a')],function(_0xb1d04f){var _0x3b1064={};_0x3b1064[_0xb1d04f]={'$like':'%'+_0x2d1d2e[_0x56a9('0x36')][_0x56a9('0x41')]+'%'};return _0x3b1064;})});}if(_0x2d1d2e[_0x56a9('0x36')]['$gte']){var _0x35d1e9=_0x2d1d2e['query'][_0x56a9('0x61')]['split'](',');var _0x32646e={};_0x32646e[_0x35d1e9[0x0]]={'$gte':moment(_0x35d1e9[0x1])['format'](_0x56a9('0x62'))};_0x30dcbc[_0x56a9('0x42')]=_[_0x56a9('0x45')](_0x30dcbc[_0x56a9('0x42')],_0x32646e);}_0x30dcbc=_['merge']({},_0x30dcbc,_0x2d1d2e[_0x56a9('0x46')]);return _0x26ee1a[_0x56a9('0x60')](_0x30dcbc);}})[_0x56a9('0x29')](function(_0x5b88d3){if(_0x5b88d3){_0x158f59=_0x5b88d3['length'];if(!_0x2d1d2e[_0x56a9('0x36')][_0x56a9('0x3c')]('nolimit')){_0x30dcbc[_0x56a9('0x25')]=qs['limit'](_0x2d1d2e[_0x56a9('0x36')]['limit']);_0x30dcbc[_0x56a9('0x23')]=qs[_0x56a9('0x23')](_0x2d1d2e[_0x56a9('0x36')][_0x56a9('0x23')]);}return _0x26ee1a[_0x56a9('0x60')](_0x30dcbc);}})[_0x56a9('0x29')](function(_0x38183f){if(_0x38183f){return _0x38183f?{'count':_0x158f59,'rows':_0x38183f}:null;}})[_0x56a9('0x29')](respondWithResult(_0x422348,null))[_0x56a9('0x4a')](handleError(_0x422348,null));};
\ No newline at end of file
+var _0xb789=['register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','ChatGroup','destroy','describe','ChatInternalMessage','addMembers','omit','findOne','User','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket'];(function(_0x5f1f87,_0x5f4875){var _0x3d1caa=function(_0x1b8722){while(--_0x1b8722){_0x5f1f87['push'](_0x5f1f87['shift']());}};_0x3d1caa(++_0x5f4875);}(_0xb789,0x16c));var _0x9b78=function(_0x33a792,_0x52c5b1){_0x33a792=_0x33a792-0x0;var _0x5c46c2=_0xb789[_0x33a792];return _0x5c46c2;};'use strict';var emlformat=require(_0x9b78('0x0'));var rimraf=require(_0x9b78('0x1'));var zipdir=require(_0x9b78('0x2'));var jsonpatch=require(_0x9b78('0x3'));var rp=require(_0x9b78('0x4'));var moment=require(_0x9b78('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9b78('0x6'));var util=require(_0x9b78('0x7'));var path=require(_0x9b78('0x8'));var sox=require(_0x9b78('0x9'));var csv=require(_0x9b78('0xa'));var ejs=require(_0x9b78('0xb'));var fs=require('fs');var fs_extra=require(_0x9b78('0xc'));var _=require('lodash');var squel=require(_0x9b78('0xd'));var crypto=require(_0x9b78('0xe'));var jsforce=require(_0x9b78('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9b78('0x10'));var Papa=require(_0x9b78('0x11'));var Redis=require(_0x9b78('0x12'));var authService=require(_0x9b78('0x13'));var qs=require(_0x9b78('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9b78('0x15'));var logger=require(_0x9b78('0x16'))(_0x9b78('0x17'));var utils=require(_0x9b78('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x9b78('0x19'));var db=require(_0x9b78('0x1a'))['db'];config[_0x9b78('0x1b')]=_[_0x9b78('0x1c')](config['redis'],{'host':_0x9b78('0x1d'),'port':0x18eb});var socket=require(_0x9b78('0x1e'))(new Redis(config[_0x9b78('0x1b')]));require(_0x9b78('0x1f'))[_0x9b78('0x20')](socket);function respondWithStatusCode(_0x57921f,_0x257203){_0x257203=_0x257203||0xcc;return function(_0x455ed5){if(_0x455ed5){return _0x57921f[_0x9b78('0x21')](_0x257203);}return _0x57921f[_0x9b78('0x22')](_0x257203)[_0x9b78('0x23')]();};}function respondWithResult(_0x146954,_0x2e2b37){_0x2e2b37=_0x2e2b37||0xc8;return function(_0x325481){if(_0x325481){return _0x146954[_0x9b78('0x22')](_0x2e2b37)[_0x9b78('0x24')](_0x325481);}};}function respondWithFilteredResult(_0x2f6e4e,_0x51258b){return function(_0x40208d){if(_0x40208d){var _0x482bb2=typeof _0x51258b[_0x9b78('0x25')]===_0x9b78('0x26')&&typeof _0x51258b[_0x9b78('0x27')]===_0x9b78('0x26');var _0x1676e7=_0x40208d[_0x9b78('0x28')];var _0x47183f=_0x482bb2?0x0:_0x51258b[_0x9b78('0x25')];var _0x3fdf05=_0x482bb2?_0x40208d[_0x9b78('0x28')]:_0x51258b[_0x9b78('0x25')]+_0x51258b[_0x9b78('0x27')];var _0x1c1047;if(_0x3fdf05>=_0x1676e7){_0x3fdf05=_0x1676e7;_0x1c1047=0xc8;}else{_0x1c1047=0xce;}_0x2f6e4e[_0x9b78('0x22')](_0x1c1047);return _0x2f6e4e[_0x9b78('0x29')](_0x9b78('0x2a'),_0x47183f+'-'+_0x3fdf05+'/'+_0x1676e7)['json'](_0x40208d);}return null;};}function patchUpdates(_0x50cf04){return function(_0x3015e8){try{jsonpatch['apply'](_0x3015e8,_0x50cf04,!![]);}catch(_0x1644b6){return BPromise[_0x9b78('0x2b')](_0x1644b6);}return _0x3015e8['save']();};}function saveUpdates(_0x568639,_0x5e8d18){return function(_0xed2aa9){if(_0xed2aa9){return _0xed2aa9[_0x9b78('0x2c')](_0x568639)['then'](function(_0x3af24d){return _0x3af24d;});}return null;};}function removeEntity(_0x3fe246,_0x4c521b){return function(_0x28c60b){if(_0x28c60b){return _0x28c60b['destroy']()[_0x9b78('0x2d')](function(){_0x3fe246['status'](0xcc)[_0x9b78('0x23')]();});}};}function handleEntityNotFound(_0x1d592b,_0xd45665){return function(_0x2e5787){if(!_0x2e5787){_0x1d592b[_0x9b78('0x21')](0x194);}return _0x2e5787;};}function handleError(_0x1a1677,_0x2c8561){_0x2c8561=_0x2c8561||0x1f4;return function(_0x204d37){logger[_0x9b78('0x2e')](_0x204d37[_0x9b78('0x2f')]);if(_0x204d37[_0x9b78('0x30')]){delete _0x204d37[_0x9b78('0x30')];}_0x1a1677[_0x9b78('0x22')](_0x2c8561)[_0x9b78('0x31')](_0x204d37);};}exports['index']=function(_0x2c65f9,_0x47f169){var _0x383a37={},_0x4a7e6e={},_0x109a20={'count':0x0,'rows':[]};var _0x57391e=_[_0x9b78('0x32')](db['ChatGroup'][_0x9b78('0x33')],function(_0x3711c3){return{'name':_0x3711c3[_0x9b78('0x34')],'type':_0x3711c3[_0x9b78('0x35')][_0x9b78('0x36')]};});_0x4a7e6e[_0x9b78('0x37')]=_[_0x9b78('0x32')](_0x57391e,_0x9b78('0x30'));_0x4a7e6e['query']=_[_0x9b78('0x38')](_0x2c65f9[_0x9b78('0x39')]);_0x4a7e6e[_0x9b78('0x3a')]=_[_0x9b78('0x3b')](_0x4a7e6e['model'],_0x4a7e6e['query']);_0x383a37[_0x9b78('0x3c')]=_[_0x9b78('0x3b')](_0x4a7e6e[_0x9b78('0x37')],qs[_0x9b78('0x3d')](_0x2c65f9[_0x9b78('0x39')][_0x9b78('0x3d')]));_0x383a37[_0x9b78('0x3c')]=_0x383a37[_0x9b78('0x3c')][_0x9b78('0x3e')]?_0x383a37[_0x9b78('0x3c')]:_0x4a7e6e[_0x9b78('0x37')];if(!_0x2c65f9['query'][_0x9b78('0x3f')](_0x9b78('0x40'))){_0x383a37['limit']=qs[_0x9b78('0x27')](_0x2c65f9['query'][_0x9b78('0x27')]);_0x383a37['offset']=qs[_0x9b78('0x25')](_0x2c65f9[_0x9b78('0x39')][_0x9b78('0x25')]);}_0x383a37[_0x9b78('0x41')]=qs[_0x9b78('0x42')](_0x2c65f9[_0x9b78('0x39')]['sort']);_0x383a37[_0x9b78('0x43')]=qs[_0x9b78('0x3a')](_[_0x9b78('0x44')](_0x2c65f9[_0x9b78('0x39')],_0x4a7e6e['filters']),_0x57391e);if(_0x2c65f9['query'][_0x9b78('0x45')]){_0x383a37[_0x9b78('0x43')]=_[_0x9b78('0x46')](_0x383a37[_0x9b78('0x43')],{'$or':_[_0x9b78('0x32')](_0x57391e,function(_0x589145){if(_0x589145[_0x9b78('0x35')]!=='VIRTUAL'){var _0x15fb9a={};_0x15fb9a[_0x589145[_0x9b78('0x30')]]={'$like':'%'+_0x2c65f9[_0x9b78('0x39')][_0x9b78('0x45')]+'%'};return _0x15fb9a;}})});}_0x383a37=_[_0x9b78('0x46')]({},_0x383a37,_0x2c65f9[_0x9b78('0x47')]);var _0x1449ae={'where':_0x383a37[_0x9b78('0x43')]};return db['ChatGroup'][_0x9b78('0x28')](_0x1449ae)[_0x9b78('0x2d')](function(_0x366f4b){_0x109a20[_0x9b78('0x28')]=_0x366f4b;if(_0x2c65f9[_0x9b78('0x39')][_0x9b78('0x48')]){_0x383a37['include']=[{'all':!![]}];}return db['ChatGroup'][_0x9b78('0x49')](_0x383a37);})[_0x9b78('0x2d')](function(_0x22da20){_0x109a20[_0x9b78('0x4a')]=_0x22da20;return _0x109a20;})[_0x9b78('0x2d')](respondWithFilteredResult(_0x47f169,_0x383a37))[_0x9b78('0x4b')](handleError(_0x47f169,null));};exports[_0x9b78('0x4c')]=function(_0x122cb7,_0x5addac){var _0x108b6a={'raw':!![],'where':{'id':_0x122cb7[_0x9b78('0x4d')]['id']}},_0x518fcb={};_0x518fcb[_0x9b78('0x37')]=_[_0x9b78('0x38')](db['ChatGroup']['rawAttributes']);_0x518fcb[_0x9b78('0x39')]=_[_0x9b78('0x38')](_0x122cb7[_0x9b78('0x39')]);_0x518fcb['filters']=_[_0x9b78('0x3b')](_0x518fcb[_0x9b78('0x37')],_0x518fcb['query']);_0x108b6a[_0x9b78('0x3c')]=_[_0x9b78('0x3b')](_0x518fcb[_0x9b78('0x37')],qs[_0x9b78('0x3d')](_0x122cb7[_0x9b78('0x39')][_0x9b78('0x3d')]));_0x108b6a[_0x9b78('0x3c')]=_0x108b6a[_0x9b78('0x3c')][_0x9b78('0x3e')]?_0x108b6a['attributes']:_0x518fcb[_0x9b78('0x37')];if(_0x122cb7[_0x9b78('0x39')][_0x9b78('0x48')]){_0x108b6a[_0x9b78('0x4e')]=[{'all':!![]}];}_0x108b6a=_[_0x9b78('0x46')]({},_0x108b6a,_0x122cb7[_0x9b78('0x47')]);return db['ChatGroup'][_0x9b78('0x4f')](_0x108b6a)['then'](handleEntityNotFound(_0x5addac,null))[_0x9b78('0x2d')](respondWithResult(_0x5addac,null))[_0x9b78('0x4b')](handleError(_0x5addac,null));};exports['create']=function(_0x1a0208,_0x358f22){return db['ChatGroup'][_0x9b78('0x50')](_0x1a0208[_0x9b78('0x51')],{})[_0x9b78('0x2d')](respondWithResult(_0x358f22,0xc9))['catch'](handleError(_0x358f22,null));};exports[_0x9b78('0x2c')]=function(_0x25352b,_0x5e4e7c){if(_0x25352b[_0x9b78('0x51')]['id']){delete _0x25352b['body']['id'];}return db[_0x9b78('0x52')][_0x9b78('0x4f')]({'where':{'id':_0x25352b[_0x9b78('0x4d')]['id']}})[_0x9b78('0x2d')](handleEntityNotFound(_0x5e4e7c,null))['then'](saveUpdates(_0x25352b[_0x9b78('0x51')],null))[_0x9b78('0x2d')](respondWithResult(_0x5e4e7c,null))[_0x9b78('0x4b')](handleError(_0x5e4e7c,null));};exports[_0x9b78('0x53')]=function(_0x49145e,_0x87f252){return db[_0x9b78('0x52')]['find']({'where':{'id':_0x49145e[_0x9b78('0x4d')]['id']}})[_0x9b78('0x2d')](handleEntityNotFound(_0x87f252,null))[_0x9b78('0x2d')](removeEntity(_0x87f252,null))[_0x9b78('0x4b')](handleError(_0x87f252,null));};exports[_0x9b78('0x54')]=function(_0x26766a,_0x295a2c){return db[_0x9b78('0x52')][_0x9b78('0x54')]()[_0x9b78('0x2d')](respondWithResult(_0x295a2c,null))[_0x9b78('0x4b')](handleError(_0x295a2c,null));};exports['getUnread']=function(_0x4e99c0,_0x31e1a0,_0x5bdcdd){return db[_0x9b78('0x55')][_0x9b78('0x28')]({'where':{'ChatGroupId':_0x4e99c0[_0x9b78('0x4d')]['id'],'ToId':_0x4e99c0['user']['id'],'read':![]}})[_0x9b78('0x2d')](function(_0x4cb215){return{'id':_['toInteger'](_0x4e99c0[_0x9b78('0x4d')]['id']),'count':_0x4cb215};})[_0x9b78('0x2d')](respondWithResult(_0x31e1a0,null))['catch'](handleError(_0x31e1a0,null));};exports[_0x9b78('0x56')]=function(_0x46035,_0xdc9f9d,_0x3abe80){return db[_0x9b78('0x52')]['find']({'where':{'id':_0x46035['params']['id']}})['then'](handleEntityNotFound(_0xdc9f9d,null))[_0x9b78('0x2d')](function(_0x5ab5e2){if(_0x5ab5e2){return _0x5ab5e2[_0x9b78('0x56')](_0x46035[_0x9b78('0x51')]['ids'],_[_0x9b78('0x57')](_0x46035['body'],['ids','id'])||{});}})[_0x9b78('0x2d')](respondWithResult(_0xdc9f9d,null))[_0x9b78('0x4b')](handleError(_0xdc9f9d,null));};exports['getMembers']=function(_0x23312e,_0x5e8761,_0x159819){var _0x1214d9={};var _0x57110f={};var _0x51051b;var _0xd86d73;return db[_0x9b78('0x52')][_0x9b78('0x58')]({'where':{'id':_0x23312e[_0x9b78('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5e8761,null))['then'](function(_0x2abf31){if(_0x2abf31){_0x51051b=_0x2abf31;_0x57110f[_0x9b78('0x37')]=_[_0x9b78('0x38')](db[_0x9b78('0x59')]['rawAttributes']);_0x57110f[_0x9b78('0x39')]=_[_0x9b78('0x38')](_0x23312e[_0x9b78('0x39')]);_0x57110f[_0x9b78('0x3a')]=_[_0x9b78('0x3b')](_0x57110f['model'],_0x57110f[_0x9b78('0x39')]);_0x1214d9[_0x9b78('0x3c')]=_[_0x9b78('0x3b')](_0x57110f[_0x9b78('0x37')],qs[_0x9b78('0x3d')](_0x23312e[_0x9b78('0x39')][_0x9b78('0x3d')]));_0x1214d9['attributes']=_0x1214d9[_0x9b78('0x3c')][_0x9b78('0x3e')]?_0x1214d9[_0x9b78('0x3c')]:_0x57110f[_0x9b78('0x37')];_0x1214d9[_0x9b78('0x41')]=qs[_0x9b78('0x42')](_0x23312e[_0x9b78('0x39')][_0x9b78('0x42')]);_0x1214d9[_0x9b78('0x43')]=qs[_0x9b78('0x3a')](_[_0x9b78('0x44')](_0x23312e['query'],_0x57110f[_0x9b78('0x3a')]));if(_0x23312e['query'][_0x9b78('0x45')]){_0x1214d9['where']=_[_0x9b78('0x46')](_0x1214d9[_0x9b78('0x43')],{'$or':_[_0x9b78('0x32')](_0x1214d9[_0x9b78('0x3c')],function(_0x52be11){var _0x34a358={};_0x34a358[_0x52be11]={'$like':'%'+_0x23312e[_0x9b78('0x39')][_0x9b78('0x45')]+'%'};return _0x34a358;})});}_0x1214d9=_['merge']({},_0x1214d9,_0x23312e[_0x9b78('0x47')]);return _0x51051b['getMembers'](_0x1214d9);}})['then'](function(_0x5d83e4){if(_0x5d83e4){_0xd86d73=_0x5d83e4[_0x9b78('0x3e')];if(!_0x23312e[_0x9b78('0x39')][_0x9b78('0x3f')](_0x9b78('0x40'))){_0x1214d9[_0x9b78('0x27')]=qs['limit'](_0x23312e['query'][_0x9b78('0x27')]);_0x1214d9[_0x9b78('0x25')]=qs[_0x9b78('0x25')](_0x23312e[_0x9b78('0x39')][_0x9b78('0x25')]);}return _0x51051b[_0x9b78('0x5a')](_0x1214d9);}})[_0x9b78('0x2d')](function(_0x345a7f){if(_0x345a7f){return _0x345a7f?{'count':_0xd86d73,'rows':_0x345a7f}:null;}})[_0x9b78('0x2d')](respondWithResult(_0x5e8761,null))[_0x9b78('0x4b')](handleError(_0x5e8761,null));};exports['removeMembers']=function(_0x3c00bc,_0x440ca1,_0xe78ad4){return db[_0x9b78('0x52')][_0x9b78('0x4f')]({'where':{'id':_0x3c00bc['params']['id']}})[_0x9b78('0x2d')](handleEntityNotFound(_0x440ca1,null))[_0x9b78('0x2d')](function(_0x2e46ba){if(_0x2e46ba){return _0x2e46ba[_0x9b78('0x5b')](_0x3c00bc[_0x9b78('0x39')]['ids']);}})[_0x9b78('0x2d')](respondWithStatusCode(_0x440ca1,null))['catch'](handleError(_0x440ca1,null));};exports[_0x9b78('0x5c')]=function(_0x416f1e,_0x52cd1e,_0x456779){if(_0x416f1e[_0x9b78('0x51')]['id']){delete _0x416f1e[_0x9b78('0x51')]['id'];}return db[_0x9b78('0x52')][_0x9b78('0x4f')]({'where':{'id':_0x416f1e[_0x9b78('0x4d')]['id']}})['then'](handleEntityNotFound(_0x52cd1e,null))[_0x9b78('0x2d')](function(_0x10fa72){if(_0x10fa72){_0x416f1e[_0x9b78('0x51')][_0x9b78('0x5d')]=_0x10fa72['id'];return db[_0x9b78('0x55')]['create'](_0x416f1e[_0x9b78('0x51')]);}})[_0x9b78('0x2d')](respondWithResult(_0x52cd1e,null))[_0x9b78('0x4b')](handleError(_0x52cd1e,null));};exports[_0x9b78('0x5e')]=function(_0x2ec9ec,_0x1a4432,_0x4d1b7f){var _0x49f423={};var _0xaf9b3c={};var _0x22ceb7;var _0x39be39;return db[_0x9b78('0x52')][_0x9b78('0x58')]({'where':{'id':_0x2ec9ec['params']['id']}})[_0x9b78('0x2d')](handleEntityNotFound(_0x1a4432,null))[_0x9b78('0x2d')](function(_0x16efbb){if(_0x16efbb){_0x22ceb7=_0x16efbb;_0xaf9b3c['model']=_[_0x9b78('0x38')](db[_0x9b78('0x55')][_0x9b78('0x33')]);_0xaf9b3c['query']=_[_0x9b78('0x38')](_0x2ec9ec[_0x9b78('0x39')]);_0xaf9b3c[_0x9b78('0x3a')]=_[_0x9b78('0x3b')](_0xaf9b3c[_0x9b78('0x37')],_0xaf9b3c[_0x9b78('0x39')]);_0x49f423['attributes']=_[_0x9b78('0x3b')](_0xaf9b3c['model'],qs[_0x9b78('0x3d')](_0x2ec9ec[_0x9b78('0x39')][_0x9b78('0x3d')]));_0x49f423[_0x9b78('0x3c')]=_0x49f423[_0x9b78('0x3c')][_0x9b78('0x3e')]?_0x49f423[_0x9b78('0x3c')]:_0xaf9b3c[_0x9b78('0x37')];_0x49f423[_0x9b78('0x41')]=qs[_0x9b78('0x42')](_0x2ec9ec[_0x9b78('0x39')]['sort']);_0x49f423[_0x9b78('0x43')]=qs[_0x9b78('0x3a')](_['pick'](_0x2ec9ec[_0x9b78('0x39')],_0xaf9b3c['filters']));if(_0x2ec9ec[_0x9b78('0x39')][_0x9b78('0x45')]){_0x49f423[_0x9b78('0x43')]=_[_0x9b78('0x46')](_0x49f423['where'],{'$or':_[_0x9b78('0x32')](_0x49f423['attributes'],function(_0x4ff761){var _0x1c8010={};_0x1c8010[_0x4ff761]={'$like':'%'+_0x2ec9ec[_0x9b78('0x39')][_0x9b78('0x45')]+'%'};return _0x1c8010;})});}if(_0x2ec9ec[_0x9b78('0x39')][_0x9b78('0x5f')]){var _0x549c0e=_0x2ec9ec[_0x9b78('0x39')][_0x9b78('0x5f')][_0x9b78('0x60')](',');var _0x2d6b78={};_0x2d6b78[_0x549c0e[0x0]]={'$gte':moment(_0x549c0e[0x1])[_0x9b78('0x61')](_0x9b78('0x62'))};_0x49f423[_0x9b78('0x43')]=_['merge'](_0x49f423[_0x9b78('0x43')],_0x2d6b78);}_0x49f423=_[_0x9b78('0x46')]({},_0x49f423,_0x2ec9ec[_0x9b78('0x47')]);return _0x22ceb7[_0x9b78('0x5e')](_0x49f423);}})['then'](function(_0x519a94){if(_0x519a94){_0x39be39=_0x519a94[_0x9b78('0x3e')];if(!_0x2ec9ec['query'][_0x9b78('0x3f')](_0x9b78('0x40'))){_0x49f423['limit']=qs[_0x9b78('0x27')](_0x2ec9ec['query']['limit']);_0x49f423[_0x9b78('0x25')]=qs[_0x9b78('0x25')](_0x2ec9ec[_0x9b78('0x39')][_0x9b78('0x25')]);}return _0x22ceb7['getMessages'](_0x49f423);}})['then'](function(_0x2789af){if(_0x2789af){return _0x2789af?{'count':_0x39be39,'rows':_0x2789af}:null;}})[_0x9b78('0x2d')](respondWithResult(_0x1a4432,null))[_0x9b78('0x4b')](handleError(_0x1a4432,null));};
\ No newline at end of file
index 4466b5e..d1ccc04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaecc=['events','ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x47242d,_0x13f993){var _0x30273a=function(_0x322cd2){while(--_0x322cd2){_0x47242d['push'](_0x47242d['shift']());}};_0x30273a(++_0x13f993);}(_0xaecc,0x172));var _0xcaec=function(_0x287528,_0x2fbba7){_0x287528=_0x287528-0x0;var _0xc05e28=_0xaecc[_0x287528];return _0xc05e28;};'use strict';var EventEmitter=require(_0xcaec('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xcaec('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xcaec('0x2')](0x0);var events={'afterCreate':_0xcaec('0x3'),'afterUpdate':_0xcaec('0x4'),'afterDestroy':_0xcaec('0x5')};function emitEvent(_0x1b7339){return function(_0x1de6a3,_0x5ab26c,_0x366499){ChatGroupEvents[_0xcaec('0x6')](_0x1b7339+':'+_0x1de6a3['id'],_0x1de6a3);ChatGroupEvents[_0xcaec('0x6')](_0x1b7339,_0x1de6a3);_0x366499(null);};}for(var e in events){if(events[_0xcaec('0x7')](e)){var event=events[e];ChatGroup[_0xcaec('0x8')](e,emitEvent(event));}}module[_0xcaec('0x9')]=ChatGroupEvents;
\ No newline at end of file
+var _0x2711=['hook','../../mysqldb','ChatGroup','update','remove','emit'];(function(_0x238929,_0x139d57){var _0x35441b=function(_0x3609bc){while(--_0x3609bc){_0x238929['push'](_0x238929['shift']());}};_0x35441b(++_0x139d57);}(_0x2711,0x1e1));var _0x1271=function(_0x4dd7c3,_0x23c5d0){_0x4dd7c3=_0x4dd7c3-0x0;var _0x32f5af=_0x2711[_0x4dd7c3];return _0x32f5af;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x1271('0x0'))['db'][_0x1271('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x1271('0x2'),'afterDestroy':_0x1271('0x3')};function emitEvent(_0xdb9e1){return function(_0xb50e9d,_0x474b4f,_0x3ad354){ChatGroupEvents[_0x1271('0x4')](_0xdb9e1+':'+_0xb50e9d['id'],_0xb50e9d);ChatGroupEvents[_0x1271('0x4')](_0xdb9e1,_0xb50e9d);_0x3ad354(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x1271('0x5')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
index 3d7d830..97e8007 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb2b=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatGroup','chat_groups'];(function(_0x1ad4a3,_0x1fc808){var _0x59febf=function(_0x593303){while(--_0x593303){_0x1ad4a3['push'](_0x1ad4a3['shift']());}};_0x59febf(++_0x1fc808);}(_0xdb2b,0xd8));var _0xbdb2=function(_0x19d350,_0x3c843f){_0x19d350=_0x19d350-0x0;var _0x3bfc8d=_0xdb2b[_0x19d350];return _0x3bfc8d;};'use strict';var _=require('lodash');var util=require(_0xbdb2('0x0'));var logger=require(_0xbdb2('0x1'))('api');var moment=require(_0xbdb2('0x2'));var BPromise=require(_0xbdb2('0x3'));var rp=require(_0xbdb2('0x4'));var fs=require('fs');var path=require(_0xbdb2('0x5'));var rimraf=require(_0xbdb2('0x6'));var config=require(_0xbdb2('0x7'));var attributes=require('./chatGroup.attributes');module[_0xbdb2('0x8')]=function(_0x3066b2,_0x3d5d84){return _0x3066b2[_0xbdb2('0x9')](_0xbdb2('0xa'),attributes,{'tableName':_0xbdb2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbb15=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger'];(function(_0x229d7e,_0x5bc489){var _0xa78280=function(_0x59850e){while(--_0x59850e){_0x229d7e['push'](_0x229d7e['shift']());}};_0xa78280(++_0x5bc489);}(_0xbb15,0x1af));var _0x5bb1=function(_0x4cde2e,_0x11207c){_0x4cde2e=_0x4cde2e-0x0;var _0x4eace9=_0xbb15[_0x4cde2e];return _0x4eace9;};'use strict';var _=require(_0x5bb1('0x0'));var util=require(_0x5bb1('0x1'));var logger=require(_0x5bb1('0x2'))(_0x5bb1('0x3'));var moment=require(_0x5bb1('0x4'));var BPromise=require(_0x5bb1('0x5'));var rp=require(_0x5bb1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5bb1('0x7'));var config=require(_0x5bb1('0x8'));var attributes=require(_0x5bb1('0x9'));module[_0x5bb1('0xa')]=function(_0x178475,_0x1827cc){return _0x178475[_0x5bb1('0xb')](_0x5bb1('0xc'),attributes,{'tableName':_0x5bb1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 13bf854..05a1521 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f7e=['../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','request','then','request\x20sent','debug','stringify','error','ChatGroup,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1fb6e2,_0x3a22ce){var _0x354690=function(_0x51f968){while(--_0x51f968){_0x1fb6e2['push'](_0x1fb6e2['shift']());}};_0x354690(++_0x3a22ce);}(_0x2f7e,0x122));var _0xe2f7=function(_0x567128,_0x288e16){_0x567128=_0x567128-0x0;var _0x4bfaa6=_0x2f7e[_0x567128];return _0x4bfaa6;};'use strict';var _=require(_0xe2f7('0x0'));var util=require(_0xe2f7('0x1'));var moment=require('moment');var BPromise=require(_0xe2f7('0x2'));var rs=require(_0xe2f7('0x3'));var fs=require('fs');var Redis=require(_0xe2f7('0x4'));var db=require(_0xe2f7('0x5'))['db'];var utils=require(_0xe2f7('0x6'));var logger=require(_0xe2f7('0x7'))(_0xe2f7('0x8'));var config=require(_0xe2f7('0x9'));var jayson=require(_0xe2f7('0xa'));var client=jayson[_0xe2f7('0xb')]['http']({'port':0x232a});config[_0xe2f7('0xc')]=_[_0xe2f7('0xd')](config[_0xe2f7('0xc')],{'host':_0xe2f7('0xe'),'port':0x18eb});var socket=require(_0xe2f7('0xf'))(new Redis(config[_0xe2f7('0xc')]));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0x376da4,_0x2c92f3,_0x5649a3){return new BPromise(function(_0x3986bb,_0x97c8d2){return client[_0xe2f7('0x10')](_0x376da4,_0x5649a3)[_0xe2f7('0x11')](function(_0x18e94b){logger['info']('ChatGroup,\x20%s,\x20%s',_0x2c92f3,_0xe2f7('0x12'));logger[_0xe2f7('0x13')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x2c92f3,_0xe2f7('0x12'),JSON[_0xe2f7('0x14')](_0x18e94b));if(_0x18e94b[_0xe2f7('0x15')]){if(_0x18e94b['error']['code']===0x1f4){logger[_0xe2f7('0x15')](_0xe2f7('0x16'),_0x2c92f3,_0x18e94b[_0xe2f7('0x15')][_0xe2f7('0x17')]);return _0x97c8d2(_0x18e94b[_0xe2f7('0x15')]['message']);}logger[_0xe2f7('0x15')](_0xe2f7('0x16'),_0x2c92f3,_0x18e94b[_0xe2f7('0x15')][_0xe2f7('0x17')]);return _0x3986bb(_0x18e94b[_0xe2f7('0x15')][_0xe2f7('0x17')]);}else{logger[_0xe2f7('0x18')]('ChatGroup,\x20%s,\x20%s',_0x2c92f3,_0xe2f7('0x12'));_0x3986bb(_0x18e94b[_0xe2f7('0x19')][_0xe2f7('0x17')]);}})[_0xe2f7('0x1a')](function(_0x4cd325){logger[_0xe2f7('0x15')](_0xe2f7('0x16'),_0x2c92f3,_0x4cd325);_0x97c8d2(_0x4cd325);});});}
\ No newline at end of file
+var _0xa459=['register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','redis','defaults','localhost','socket.io-emitter'];(function(_0x1e86d9,_0x3d1b03){var _0x478a43=function(_0x4a6538){while(--_0x4a6538){_0x1e86d9['push'](_0x1e86d9['shift']());}};_0x478a43(++_0x3d1b03);}(_0xa459,0x1d8));var _0x9a45=function(_0x1f72d2,_0x268155){_0x1f72d2=_0x1f72d2-0x0;var _0x82628c=_0xa459[_0x1f72d2];return _0x82628c;};'use strict';var _=require(_0x9a45('0x0'));var util=require(_0x9a45('0x1'));var moment=require(_0x9a45('0x2'));var BPromise=require(_0x9a45('0x3'));var rs=require(_0x9a45('0x4'));var fs=require('fs');var Redis=require(_0x9a45('0x5'));var db=require(_0x9a45('0x6'))['db'];var utils=require(_0x9a45('0x7'));var logger=require(_0x9a45('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9a45('0x9')]['http']({'port':0x232a});config[_0x9a45('0xa')]=_[_0x9a45('0xb')](config[_0x9a45('0xa')],{'host':_0x9a45('0xc'),'port':0x18eb});var socket=require(_0x9a45('0xd'))(new Redis(config[_0x9a45('0xa')]));require('./chatGroup.socket')[_0x9a45('0xe')](socket);function respondWithRpcPromise(_0x54b37e,_0x4ce63d,_0x4edb6d){return new BPromise(function(_0x15d229,_0x30c4a4){return client[_0x9a45('0xf')](_0x54b37e,_0x4edb6d)['then'](function(_0x18be7d){logger[_0x9a45('0x10')](_0x9a45('0x11'),_0x4ce63d,_0x9a45('0x12'));logger[_0x9a45('0x13')](_0x9a45('0x14'),_0x4ce63d,_0x9a45('0x12'),JSON[_0x9a45('0x15')](_0x18be7d));if(_0x18be7d[_0x9a45('0x16')]){if(_0x18be7d['error'][_0x9a45('0x17')]===0x1f4){logger[_0x9a45('0x16')](_0x9a45('0x11'),_0x4ce63d,_0x18be7d['error'][_0x9a45('0x18')]);return _0x30c4a4(_0x18be7d['error'][_0x9a45('0x18')]);}logger['error'](_0x9a45('0x11'),_0x4ce63d,_0x18be7d[_0x9a45('0x16')][_0x9a45('0x18')]);return _0x15d229(_0x18be7d[_0x9a45('0x16')][_0x9a45('0x18')]);}else{logger[_0x9a45('0x10')]('ChatGroup,\x20%s,\x20%s',_0x4ce63d,_0x9a45('0x12'));_0x15d229(_0x18be7d[_0x9a45('0x19')][_0x9a45('0x18')]);}})[_0x9a45('0x1a')](function(_0x31ca24){logger['error'](_0x9a45('0x11'),_0x4ce63d,_0x31ca24);_0x30c4a4(_0x31ca24);});});}
\ No newline at end of file
index 95b9844..e66885c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb74=['emit','removeListener','register','length','./chatGroup.events','save','update'];(function(_0x838000,_0x60c75b){var _0x1612f7=function(_0x500b39){while(--_0x500b39){_0x838000['push'](_0x838000['shift']());}};_0x1612f7(++_0x60c75b);}(_0xfb74,0xdd));var _0x4fb7=function(_0x16539a,_0x31409a){_0x16539a=_0x16539a-0x0;var _0x200796=_0xfb74[_0x16539a];return _0x200796;};'use strict';var ChatGroupEvents=require(_0x4fb7('0x0'));var events=[_0x4fb7('0x1'),'remove',_0x4fb7('0x2')];function createListener(_0x97671e,_0x3b1763){return function(_0x49a5e5){_0x3b1763[_0x4fb7('0x3')](_0x97671e,_0x49a5e5);};}function removeListener(_0x1498de,_0x102b2b){return function(){ChatGroupEvents[_0x4fb7('0x4')](_0x1498de,_0x102b2b);};}exports[_0x4fb7('0x5')]=function(_0x146b5d){for(var _0x377c02=0x0,_0x171f1b=events[_0x4fb7('0x6')];_0x377c02<_0x171f1b;_0x377c02++){var _0xffbdf6=events[_0x377c02];var _0x332359=createListener('chatGroup:'+_0xffbdf6,_0x146b5d);ChatGroupEvents['on'](_0xffbdf6,_0x332359);}};
\ No newline at end of file
+var _0xe174=['register','length','chatGroup:','./chatGroup.events','save','remove','update','removeListener'];(function(_0x512973,_0x564e8b){var _0x32f2e1=function(_0x5d5d3b){while(--_0x5d5d3b){_0x512973['push'](_0x512973['shift']());}};_0x32f2e1(++_0x564e8b);}(_0xe174,0x163));var _0x4e17=function(_0x514129,_0xcb03fb){_0x514129=_0x514129-0x0;var _0x672ea9=_0xe174[_0x514129];return _0x672ea9;};'use strict';var ChatGroupEvents=require(_0x4e17('0x0'));var events=[_0x4e17('0x1'),_0x4e17('0x2'),_0x4e17('0x3')];function createListener(_0x5359d5,_0x108546){return function(_0x9f6fd2){_0x108546['emit'](_0x5359d5,_0x9f6fd2);};}function removeListener(_0x50ed15,_0x6615da){return function(){ChatGroupEvents[_0x4e17('0x4')](_0x50ed15,_0x6615da);};}exports[_0x4e17('0x5')]=function(_0x3181bb){for(var _0x215237=0x0,_0x2a5db9=events[_0x4e17('0x6')];_0x215237<_0x2a5db9;_0x215237++){var _0x5378f8=events[_0x215237];var _0x3a3e84=createListener(_0x4e17('0x7')+_0x5378f8,_0x3181bb);ChatGroupEvents['on'](_0x5378f8,_0x3a3e84);}};
\ No newline at end of file
index bc408e5..bc44cb1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd664=['create','addMembers','addMessage','put','delete','removeMembers','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/members','getMembers','/:id/messages','getMessages','post'];(function(_0x247a24,_0xf304e0){var _0x1c1fc8=function(_0x37e74f){while(--_0x37e74f){_0x247a24['push'](_0x247a24['shift']());}};_0x1c1fc8(++_0xf304e0);}(_0xd664,0x9c));var _0x4d66=function(_0x5026c8,_0x3db800){_0x5026c8=_0x5026c8-0x0;var _0x3d70bf=_0xd664[_0x5026c8];return _0x3d70bf;};'use strict';var multer=require('multer');var util=require(_0x4d66('0x0'));var path=require('path');var timeout=require(_0x4d66('0x1'));var express=require(_0x4d66('0x2'));var router=express[_0x4d66('0x3')]();var fs_extra=require(_0x4d66('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4d66('0x5'));var config=require(_0x4d66('0x6'));var controller=require(_0x4d66('0x7'));router['get']('/',auth[_0x4d66('0x8')](),controller[_0x4d66('0x9')]);router[_0x4d66('0xa')](_0x4d66('0xb'),auth[_0x4d66('0x8')](),controller[_0x4d66('0xc')]);router[_0x4d66('0xa')](_0x4d66('0xd'),auth[_0x4d66('0x8')](),controller['show']);router[_0x4d66('0xa')]('/:id/unread',auth[_0x4d66('0x8')](),controller['getUnread']);router[_0x4d66('0xa')](_0x4d66('0xe'),auth['isAuthenticated'](),controller[_0x4d66('0xf')]);router[_0x4d66('0xa')](_0x4d66('0x10'),auth[_0x4d66('0x8')](),controller[_0x4d66('0x11')]);router[_0x4d66('0x12')]('/',auth['isAuthenticated'](),controller[_0x4d66('0x13')]);router[_0x4d66('0x12')](_0x4d66('0xe'),auth['isAuthenticated'](),controller[_0x4d66('0x14')]);router[_0x4d66('0x12')](_0x4d66('0x10'),auth[_0x4d66('0x8')](),controller[_0x4d66('0x15')]);router[_0x4d66('0x16')](_0x4d66('0xd'),auth[_0x4d66('0x8')](),controller['update']);router[_0x4d66('0x17')](_0x4d66('0xd'),auth[_0x4d66('0x8')](),controller['destroy']);router[_0x4d66('0x17')](_0x4d66('0xe'),auth['isAuthenticated'](),controller[_0x4d66('0x18')]);module['exports']=router;
\ No newline at end of file
+var _0x3588=['delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','index','get','/describe','isAuthenticated','/:id','show','/:id/unread','/:id/members','getMembers','getMessages','create','post','/:id/messages','addMessage','update'];(function(_0x28fd6b,_0x575a52){var _0x4f94c8=function(_0x1ab97b){while(--_0x1ab97b){_0x28fd6b['push'](_0x28fd6b['shift']());}};_0x4f94c8(++_0x575a52);}(_0x3588,0x154));var _0x8358=function(_0x5a474d,_0x3c85e2){_0x5a474d=_0x5a474d-0x0;var _0x512f2a=_0x3588[_0x5a474d];return _0x512f2a;};'use strict';var multer=require(_0x8358('0x0'));var util=require(_0x8358('0x1'));var path=require(_0x8358('0x2'));var timeout=require(_0x8358('0x3'));var express=require(_0x8358('0x4'));var router=express[_0x8358('0x5')]();var fs_extra=require(_0x8358('0x6'));var auth=require(_0x8358('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8358('0x8'));var controller=require('./chatGroup.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x8358('0x9')]);router[_0x8358('0xa')](_0x8358('0xb'),auth[_0x8358('0xc')](),controller['describe']);router[_0x8358('0xa')](_0x8358('0xd'),auth[_0x8358('0xc')](),controller[_0x8358('0xe')]);router[_0x8358('0xa')](_0x8358('0xf'),auth['isAuthenticated'](),controller['getUnread']);router['get'](_0x8358('0x10'),auth[_0x8358('0xc')](),controller[_0x8358('0x11')]);router['get']('/:id/messages',auth[_0x8358('0xc')](),controller[_0x8358('0x12')]);router['post']('/',auth[_0x8358('0xc')](),controller[_0x8358('0x13')]);router[_0x8358('0x14')]('/:id/members',auth[_0x8358('0xc')](),controller['addMembers']);router[_0x8358('0x14')](_0x8358('0x15'),auth[_0x8358('0xc')](),controller[_0x8358('0x16')]);router['put'](_0x8358('0xd'),auth[_0x8358('0xc')](),controller[_0x8358('0x17')]);router[_0x8358('0x18')]('/:id',auth[_0x8358('0xc')](),controller[_0x8358('0x19')]);router['delete'](_0x8358('0x10'),auth[_0x8358('0xc')](),controller[_0x8358('0x1a')]);module[_0x8358('0x1b')]=router;
\ No newline at end of file
index 37a3cd5..0142fa0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f59=['long','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE'];(function(_0x51f836,_0x44727c){var _0x5af459=function(_0x4d2c98){while(--_0x4d2c98){_0x51f836['push'](_0x51f836['shift']());}};_0x5af459(++_0x44727c);}(_0x6f59,0x1be));var _0x96f5=function(_0x17b3dd,_0x58a6e1){_0x17b3dd=_0x17b3dd-0x0;var _0x144433=_0x6f59[_0x17b3dd];return _0x144433;};'use strict';var Sequelize=require(_0x96f5('0x0'));module[_0x96f5('0x1')]={'closed':{'type':Sequelize[_0x96f5('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x96f5('0x3')]},'ratingType':{'type':Sequelize[_0x96f5('0x4')](_0x96f5('0x5'),_0x96f5('0x6')),'defaultValue':_0x96f5('0x5')},'ratingMessage':{'type':Sequelize[_0x96f5('0x7')]},'pathTranscript':{'type':Sequelize[_0x96f5('0x7')]},'mailTranscript':{'type':Sequelize[_0x96f5('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x96f5('0x9')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x96f5('0x8')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x96f5('0x8')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x96f5('0x8')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x96f5('0x8')]},'deviceModel':{'type':Sequelize[_0x96f5('0x8')]},'deviceVendor':{'type':Sequelize[_0x96f5('0x8')]},'deviceType':{'type':Sequelize[_0x96f5('0x8')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x96f5('0x8')]},'formData':{'type':Sequelize[_0x96f5('0x7')](_0x96f5('0xa'))},'read1stAt':{'type':Sequelize[_0x96f5('0x9')]},'lastMsgAt':{'type':Sequelize[_0x96f5('0x9')]},'lastMsgDirection':{'type':Sequelize[_0x96f5('0x4')]('in',_0x96f5('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x96f5('0x8')]},'customerPort':{'type':Sequelize[_0x96f5('0x8')]},'vidaooSessionId':{'type':Sequelize[_0x96f5('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0x96f5('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x49f8=['long','DATE','BOOLEAN','sequelize','INTEGER','ENUM','thumb','TEXT','STRING'];(function(_0x27300b,_0x298344){var _0x518a12=function(_0x60c85c){while(--_0x60c85c){_0x27300b['push'](_0x27300b['shift']());}};_0x518a12(++_0x298344);}(_0x49f8,0xff));var _0x849f=function(_0x49bfb8,_0x5b6e2b){_0x49bfb8=_0x49bfb8-0x0;var _0x1be0b7=_0x49f8[_0x49bfb8];return _0x1be0b7;};'use strict';var Sequelize=require(_0x849f('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x849f('0x1')]},'ratingType':{'type':Sequelize[_0x849f('0x2')]('star',_0x849f('0x3')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x849f('0x4')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x849f('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x849f('0x5')]},'secondDisposition':{'type':Sequelize[_0x849f('0x5')]},'thirdDisposition':{'type':Sequelize[_0x849f('0x5')]},'note':{'type':Sequelize[_0x849f('0x5')]},'browserName':{'type':Sequelize[_0x849f('0x5')]},'browserVersion':{'type':Sequelize[_0x849f('0x5')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x849f('0x5')]},'deviceType':{'type':Sequelize[_0x849f('0x5')]},'referer':{'type':Sequelize[_0x849f('0x4')]},'customerIp':{'type':Sequelize[_0x849f('0x5')]},'formData':{'type':Sequelize[_0x849f('0x4')](_0x849f('0x6'))},'read1stAt':{'type':Sequelize[_0x849f('0x7')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x849f('0x2')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x849f('0x5')]},'customerPort':{'type':Sequelize[_0x849f('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x849f('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x849f('0x8')],'defaultValue':![]}};
\ No newline at end of file
index b2dcc8e..931062c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe4bc=['split','forEach','waiting','talking','answered','unmanaged','abandoned','total','closed','UserId','disposition','index','ChatInteraction','fieldName','type','key','query','filters','intersection','attributes','model','fields','hasOwnProperty','order','sort','pick','select','field','color','from','tools_tags','u.id','ui.ChatInteractionId','user_has_chat_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','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','chat_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','unreadMessages','value','having','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?','find','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','keys','some','compact','ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.id','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','role','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','Contact.firstName','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)','groupBy','ChatInteractionId','push','all','show','params','rawAttributes','includeAll','include','create','update','describe','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','POST','email','isNull','follow','metadata','Sequelize','ValidationError','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','file','originalname','filename','mimetype','attachId','join','root','server/files/attachments/','basename','download','format','transcript-%s.txt','now','pathTranscript','Messages','%s%d','agentAlias','System','customer','Visitor','website_alias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','\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','omit','getMessages','YYYY-MM-DD\x20HH:mm:ss','options','findAll','rows','getMyMessages','secret','addTags','spread','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','lastName','Attachment','Account','Owner','get','mkdirSync','Chat','closedAt','osName','customerIp','customerPort','N.A.','tail','existsSync','createReadStream','pipe','createWriteStream','firstName','views','downloadInteraction.ejs','transcript-','.pdf','log','unlinkSync','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','destroy','stack','name','send','merge','body','contact','agent','interaction','account','map','fullname','TagIds','Tags'];(function(_0x1e4102,_0x49a399){var _0x2398f5=function(_0x1716be){while(--_0x1716be){_0x1e4102['push'](_0x1e4102['shift']());}};_0x2398f5(++_0x49a399);}(_0xe4bc,0xfb));var _0xce4b=function(_0x147a42,_0x25d46d){_0x147a42=_0x147a42-0x0;var _0x3c44f4=_0xe4bc[_0x147a42];return _0x3c44f4;};'use strict';var emlformat=require(_0xce4b('0x0'));var rimraf=require(_0xce4b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xce4b('0x2'));var moment=require(_0xce4b('0x3'));var BPromise=require(_0xce4b('0x4'));var Mustache=require(_0xce4b('0x5'));var util=require(_0xce4b('0x6'));var path=require('path');var sox=require(_0xce4b('0x7'));var csv=require(_0xce4b('0x8'));var ejs=require(_0xce4b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xce4b('0xa'));var squel=require(_0xce4b('0xb'));var crypto=require('crypto');var jsforce=require(_0xce4b('0xc'));var deskjs=require(_0xce4b('0xd'));var toCsv=require(_0xce4b('0x8'));var querystring=require(_0xce4b('0xe'));var Papa=require('papaparse');var Redis=require(_0xce4b('0xf'));var authService=require(_0xce4b('0x10'));var qs=require(_0xce4b('0x11'));var as=require(_0xce4b('0x12'));var pdf=require(_0xce4b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xce4b('0x14'))(_0xce4b('0x15'));var utils=require(_0xce4b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xce4b('0x17'));var db=require('../../mysqldb')['db'];config[_0xce4b('0x18')]=_[_0xce4b('0x19')](config[_0xce4b('0x18')],{'host':_0xce4b('0x1a'),'port':0x18eb});var socket=require(_0xce4b('0x1b'))(new Redis(config[_0xce4b('0x18')]));require('./chatInteraction.socket')['register'](socket);var jayson=require(_0xce4b('0x1c'));var client=jayson[_0xce4b('0x1d')][_0xce4b('0x1e')]({'port':0x232b});var client9004=jayson[_0xce4b('0x1d')][_0xce4b('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x4a4c05,_0x462edc,_0x266fb2,_0x454414){return new BPromise(function(_0x2e41b6,_0x963f0a){var _0x26eec1=_0x454414||client;return _0x26eec1[_0xce4b('0x1f')](_0x4a4c05,_0x266fb2)[_0xce4b('0x20')](function(_0x3aa84c){logger[_0xce4b('0x21')](_0xce4b('0x22'),_0x462edc,_0xce4b('0x23'));logger[_0xce4b('0x24')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x462edc,_0xce4b('0x23'),JSON['stringify'](_0x3aa84c));if(_0x3aa84c[_0xce4b('0x25')]){if(_0x3aa84c['error'][_0xce4b('0x26')]===0x1f4){logger[_0xce4b('0x25')](_0xce4b('0x22'),_0x462edc,_0x3aa84c[_0xce4b('0x25')][_0xce4b('0x27')]);return _0x963f0a(_0x3aa84c[_0xce4b('0x25')][_0xce4b('0x27')]);}logger[_0xce4b('0x25')](_0xce4b('0x22'),_0x462edc,_0x3aa84c['error'][_0xce4b('0x27')]);return _0x2e41b6(_0x3aa84c[_0xce4b('0x25')][_0xce4b('0x27')]);}else{logger[_0xce4b('0x21')](_0xce4b('0x22'),_0x462edc,_0xce4b('0x23'));_0x2e41b6(_0x3aa84c['result'][_0xce4b('0x27')]);}})[_0xce4b('0x28')](function(_0x104d60){logger[_0xce4b('0x25')](_0xce4b('0x22'),_0x462edc,_0x104d60);_0x963f0a(_0x104d60);});});}function respondWithStatusCode(_0x274093,_0x2eec8c){_0x2eec8c=_0x2eec8c||0xcc;return function(_0x5482b0){if(_0x5482b0){return _0x274093[_0xce4b('0x29')](_0x2eec8c);}return _0x274093['status'](_0x2eec8c)[_0xce4b('0x2a')]();};}function respondWithResult(_0x12aa12,_0x756db5){_0x756db5=_0x756db5||0xc8;return function(_0x2581bb){if(_0x2581bb){return _0x12aa12[_0xce4b('0x2b')](_0x756db5)[_0xce4b('0x2c')](_0x2581bb);}};}function respondWithFilteredResult(_0x26b678,_0x2e150c){return function(_0x41078e){if(_0x41078e){var _0x42797d=typeof _0x2e150c[_0xce4b('0x2d')]===_0xce4b('0x2e')&&typeof _0x2e150c['limit']==='undefined';var _0x1ecbb4=_0x41078e[_0xce4b('0x2f')];var _0x33f951=_0x42797d?0x0:_0x2e150c[_0xce4b('0x2d')];var _0x515b22=_0x42797d?_0x41078e[_0xce4b('0x2f')]:_0x2e150c[_0xce4b('0x2d')]+_0x2e150c[_0xce4b('0x30')];var _0x9562cc;if(_0x515b22>=_0x1ecbb4){_0x515b22=_0x1ecbb4;_0x9562cc=0xc8;}else{_0x9562cc=0xce;}_0x26b678['status'](_0x9562cc);return _0x26b678[_0xce4b('0x31')](_0xce4b('0x32'),_0x33f951+'-'+_0x515b22+'/'+_0x1ecbb4)[_0xce4b('0x2c')](_0x41078e);}return null;};}function patchUpdates(_0x41cab0){return function(_0x23c231){try{jsonpatch[_0xce4b('0x33')](_0x23c231,_0x41cab0,!![]);}catch(_0x491a84){return BPromise['reject'](_0x491a84);}return _0x23c231[_0xce4b('0x34')]();};}function saveUpdates(_0x292c8b,_0x1643a1){return function(_0xfb85d9){if(_0xfb85d9){return _0xfb85d9['update'](_0x292c8b)[_0xce4b('0x20')](function(_0x26281b){return _0x26281b;});}return null;};}function removeEntity(_0x140d72,_0x4fbb46){return function(_0x513404){if(_0x513404){return _0x513404[_0xce4b('0x35')]()['then'](function(){_0x140d72[_0xce4b('0x2b')](0xcc)[_0xce4b('0x2a')]();});}};}function handleEntityNotFound(_0x2eb252,_0xea4dbc){return function(_0x2b912a){if(!_0x2b912a){_0x2eb252['sendStatus'](0x194);}return _0x2b912a;};}function handleError(_0x2d6b33,_0x228347){_0x228347=_0x228347||0x1f4;return function(_0x5cd323){logger['error'](_0x5cd323[_0xce4b('0x36')]);if(_0x5cd323['name']){delete _0x5cd323[_0xce4b('0x37')];}_0x2d6b33[_0xce4b('0x2b')](_0x228347)[_0xce4b('0x38')](_0x5cd323);};}function getMustacheRender(_0xda9450,_0x2efb37){return Mustache['render'](_0xda9450,_[_0xce4b('0x39')](_0x2efb37[_0xce4b('0x3a')],{'contact':_0x2efb37[_0xce4b('0x3b')],'message':_0x2efb37['message'],'agent':_0x2efb37[_0xce4b('0x3c')],'interaction':_0x2efb37[_0xce4b('0x3d')],'account':_0x2efb37[_0xce4b('0x3e')]}))||'';}function getInteractionUsers(_0x3c6d55,_0x980727){return new BPromise(function(_0x552b9f,_0x4dc1e1){try{if(_0x980727[_0x3c6d55['id']]){_0x3c6d55['Users']=_[_0xce4b('0x3f')](_0x980727[_0x3c6d55['id']],function(_0x35d488){return{'id':_0x35d488['id'],'fullname':_0x35d488[_0xce4b('0x40')]};});}}catch(_0x5ebdbe){_0x4dc1e1(_0x5ebdbe);}_0x552b9f(_0x3c6d55);});}function getInteractionTags(_0x36db43,_0x249963){return new BPromise(function(_0xa3d0b0,_0x4b93da){try{if(_0x36db43[_0xce4b('0x41')]){_0x36db43[_0xce4b('0x42')]=[];_0x36db43[_0xce4b('0x41')][_0xce4b('0x43')](',')[_0xce4b('0x44')](function(_0x2ac77f){_0x36db43[_0xce4b('0x42')]['push'](_0x249963[_0x2ac77f]);});}delete _0x36db43[_0xce4b('0x41')];}catch(_0x4b499d){_0x4b93da(_0x4b499d);}_0xa3d0b0(_0x36db43);});}function updateChatInteraction(_0x1a5759,_0xe4d8b4,_0x393df7){return new BPromise(function(_0x12e8cc,_0x2c40ce){return getInteractionUsers(_0x1a5759,_0x393df7)[_0xce4b('0x20')](function(_0x317661){return getInteractionTags(_0x317661,_0xe4d8b4);})[_0xce4b('0x20')](function(_0x4c9120){return getStateInteraction(_0x4c9120);})[_0xce4b('0x20')](function(_0x4b2069){_0x12e8cc(_0x4b2069);})[_0xce4b('0x28')](function(_0x102a45){_0x2c40ce(_0x102a45);});});}function getStateInteraction(_0x34beef){return new BPromise(function(_0x1c0ba3){_0x34beef[_0xce4b('0x45')]=0x0;_0x34beef[_0xce4b('0x46')]=0x0;_0x34beef[_0xce4b('0x47')]=0x0;_0x34beef[_0xce4b('0x48')]=0x0;_0x34beef[_0xce4b('0x49')]=0x0;_0x34beef[_0xce4b('0x4a')]=0x0;if(!_0x34beef[_0xce4b('0x4b')]&&!_0x34beef[_0xce4b('0x4c')]){_0x34beef[_0xce4b('0x45')]+=0x1;}if(!_0x34beef['closed']&&_0x34beef[_0xce4b('0x4c')]){_0x34beef[_0xce4b('0x46')]+=0x1;if(_0x34beef[_0xce4b('0x45')]){_0x34beef[_0xce4b('0x45')]-=0x1;}}if(_0x34beef[_0xce4b('0x4b')]&&_0x34beef[_0xce4b('0x4d')]===_0xce4b('0x49')){_0x34beef['abandoned']+=0x1;if(_0x34beef[_0xce4b('0x45')]){_0x34beef[_0xce4b('0x45')]-=0x1;}}else if(_0x34beef[_0xce4b('0x4b')]&&!_0x34beef[_0xce4b('0x4c')]&&_0x34beef[_0xce4b('0x4d')]){_0x34beef[_0xce4b('0x48')]+=0x1;if(_0x34beef[_0xce4b('0x45')]){_0x34beef[_0xce4b('0x45')]-=0x1;}}else if(_0x34beef[_0xce4b('0x4b')]&&_0x34beef[_0xce4b('0x4c')]){_0x34beef[_0xce4b('0x47')]+=0x1;if(_0x34beef[_0xce4b('0x46')]){_0x34beef['talking']-=0x1;}}_0x34beef[_0xce4b('0x4a')]+=0x1;_0x1c0ba3(_0x34beef);});}exports[_0xce4b('0x4e')]=function(_0x9d953c,_0x4fe6fc){var _0x5cf037={},_0x2f6e35={},_0xa341f6={'count':0x0,'rows':[]};var _0x120964=_[_0xce4b('0x3f')](db[_0xce4b('0x4f')]['rawAttributes'],function(_0x42bfdc){return{'name':_0x42bfdc[_0xce4b('0x50')],'type':_0x42bfdc[_0xce4b('0x51')][_0xce4b('0x52')]};});_0x2f6e35['model']=_['map'](_0x120964,_0xce4b('0x37'));_0x2f6e35[_0xce4b('0x53')]=_['keys'](_0x9d953c[_0xce4b('0x53')]);_0x2f6e35[_0xce4b('0x54')]=_[_0xce4b('0x55')](_0x2f6e35['model'],_0x2f6e35['query']);_0x5cf037[_0xce4b('0x56')]=_[_0xce4b('0x55')](_0x2f6e35[_0xce4b('0x57')],qs[_0xce4b('0x58')](_0x9d953c[_0xce4b('0x53')][_0xce4b('0x58')]));_0x5cf037[_0xce4b('0x56')]=_0x5cf037['attributes']['length']?_0x5cf037['attributes']:_0x2f6e35['model'];if(!_0x9d953c[_0xce4b('0x53')][_0xce4b('0x59')]('nolimit')){_0x5cf037[_0xce4b('0x30')]=qs[_0xce4b('0x30')](_0x9d953c['query'][_0xce4b('0x30')]);_0x5cf037[_0xce4b('0x2d')]=qs['offset'](_0x9d953c['query']['offset']);}_0x5cf037[_0xce4b('0x5a')]=qs[_0xce4b('0x5b')](_0x9d953c[_0xce4b('0x53')]['sort']);_0x5cf037['where']=qs[_0xce4b('0x54')](_[_0xce4b('0x5c')](_0x9d953c[_0xce4b('0x53')],_0x2f6e35[_0xce4b('0x54')]),_0x120964);var _0x474869=[];var _0x404807=squel[_0xce4b('0x5d')]()[_0xce4b('0x5e')]('id')[_0xce4b('0x5e')]('name')['field'](_0xce4b('0x5f'))[_0xce4b('0x60')](_0xce4b('0x61'));var _0x385c2b=squel['select']()['field'](_0xce4b('0x62'))['field']('u.fullname')[_0xce4b('0x5e')](_0xce4b('0x63'))[_0xce4b('0x60')](_0xce4b('0x64'),'ui')[_0xce4b('0x65')](_0xce4b('0x66'),'u',_0xce4b('0x67'));var _0x8c08d9=squel[_0xce4b('0x5d')]()[_0xce4b('0x60')]('chat_interactions','i')['left_join'](_0xce4b('0x68'),'c',_0xce4b('0x69'))[_0xce4b('0x65')](_0xce4b('0x66'),'o',_0xce4b('0x6a'))[_0xce4b('0x65')](_0xce4b('0x6b'),'a',_0xce4b('0x6c'))[_0xce4b('0x65')](_0xce4b('0x6d'),'me','me.ChatInteractionId\x20=\x20i.id')[_0xce4b('0x65')](_0xce4b('0x6e'),'it','it.ChatInteractionId\x20=\x20i.id')['left_join'](_0xce4b('0x61'),'t',_0xce4b('0x6f'));var _0x3231b0=squel[_0xce4b('0x70')]();var _0x3de4c7=[];var _0x43a2c2=squel[_0xce4b('0x70')]();var _0x1e12a0;if(_0x9d953c['query'][_0xce4b('0x71')]){_0x1e12a0=as[_0xce4b('0x72')](_0x9d953c[_0xce4b('0x53')][_0xce4b('0x71')]);var _0x524a84=_0x1e12a0[_0xce4b('0x73')];for(var _0x588185=0x0;_0x588185<_0x1e12a0[_0xce4b('0x74')][_0xce4b('0x75')];_0x588185++){var _0x241524=_0x1e12a0[_0xce4b('0x74')][_0x588185];var _0x331094='i';var _0xc75541=_['find'](_0x120964,[_0xce4b('0x37'),_0x241524[_0xce4b('0x5e')]]);if(!_0xc75541){switch(_0x241524['field']){case _0xce4b('0x76'):if(_0x241524[_0xce4b('0x77')]==0x1){_0x8c08d9[_0xce4b('0x78')]('`'+_0x241524[_0xce4b('0x5e')]+'`\x20=\x200');}else{_0x8c08d9[_0xce4b('0x78')]('`'+_0x241524[_0xce4b('0x5e')]+'`\x20>\x200');}break;case _0xce4b('0x79'):if(_0x241524[_0xce4b('0x7a')]==='$substring'){if(_0x241524[_0xce4b('0x77')][_0xce4b('0x43')]('\x20')[_0xce4b('0x75')]>0x1){_0x3231b0[_0x524a84](_0xce4b('0x7b'),qs[_0xce4b('0x7c')](_0x241524[_0xce4b('0x77')]),null);}else{var _0x4f6466='%'+_0x241524[_0xce4b('0x77')]+'%';_0x3231b0[_0x524a84](_0xce4b('0x7d'),_0x4f6466,_0x4f6466,_0x4f6466);}}else{_0xc75541=_[_0xce4b('0x7e')](_0x120964,[_0xce4b('0x37'),'ContactId']);_0x241524[_0xce4b('0x5e')]=_0xce4b('0x7f');_0x402c03=as[_0xce4b('0x80')](_0x331094,_0xc75541[_0xce4b('0x51')],_0x241524);_0x3231b0[_0x524a84](_0x402c03[_0xce4b('0x81')],_0x402c03['value'][_0xce4b('0x82')],_0x402c03[_0xce4b('0x77')][_0xce4b('0x2a')]);}break;case _0xce4b('0x83'):var _0x16392a=_0x241524[_0xce4b('0x77')]['split'](',')[_0xce4b('0x3f')](function(_0x5c9261){return Number(_0x5c9261);});_0x16392a[_0xce4b('0x44')](function(_0x16b81b){_0x43a2c2['or'](_0xce4b('0x84'),'%,'+_0x16b81b+',%');});_0x3de4c7=_['union'](_0x3de4c7,_0x16392a);break;case _0xce4b('0x85'):if(_0x241524[_0xce4b('0x7a')]===_0xce4b('0x86')){_0x3231b0[_0x524a84](_0xce4b('0x87'),'%'+_0x241524[_0xce4b('0x77')]+'%',null);}else{_0xc75541=_[_0xce4b('0x7e')](_0x120964,[_0xce4b('0x37'),_0xce4b('0x4c')]);_0x241524[_0xce4b('0x5e')]=_0xce4b('0x4c');_0x402c03=as[_0xce4b('0x80')](_0x331094,_0xc75541[_0xce4b('0x51')],_0x241524);_0x3231b0[_0x524a84](_0x402c03['text'],_0x402c03[_0xce4b('0x77')]['start'],_0x402c03[_0xce4b('0x77')]['end']);}break;case _0xce4b('0x3a'):_0x402c03=as[_0xce4b('0x80')]('me',null,_0x241524);_0x3231b0[_0x524a84](_0x402c03['text'],_0x402c03[_0xce4b('0x77')][_0xce4b('0x82')],_0x402c03[_0xce4b('0x77')]['end']);break;}}else{var _0x402c03=as[_0xce4b('0x80')](_0x331094,_0xc75541[_0xce4b('0x51')],_0x241524);_0x3231b0[_0x524a84](_0x402c03['text'],_0x402c03[_0xce4b('0x77')]['start'],_0x402c03[_0xce4b('0x77')][_0xce4b('0x2a')]);}}}else{var _0xcc9179=_(_0x9d953c[_0xce4b('0x53')])[_0xce4b('0x88')]()[_0xce4b('0x3f')](function(_0x857e55){return _[_0xce4b('0x89')](_0x120964,[_0xce4b('0x37'),_0x857e55])?_0x857e55:undefined;})[_0xce4b('0x8a')]()['value']();if(!_['isEmpty'](_0xcc9179)){_0xcc9179[_0xce4b('0x44')](function(_0x158d06){if(_0x158d06===_0xce4b('0x8b')){_0x8c08d9[_0xce4b('0x8c')](_0xce4b('0x8d'),[][_0xce4b('0x8e')](_0x9d953c['query'][_0x158d06]));}else if(_0x158d06===_0xce4b('0x8f')){var _0x4f9242=JSON['parse'](_0x9d953c[_0xce4b('0x53')][_0x158d06])[_0xce4b('0x90')];var _0x299c31=JSON[_0xce4b('0x91')](_0x9d953c[_0xce4b('0x53')][_0x158d06])[_0xce4b('0x92')];_0x8c08d9['where'](_0xce4b('0x93'),_0x4f9242,_0x299c31);}else{if(_0x9d953c['query'][_0x158d06]===_0xce4b('0x94')){_0x8c08d9[_0xce4b('0x8c')]('i.'+_0x158d06+_0xce4b('0x95'));}else{_0x8c08d9['where']('i.'+_0x158d06+_0xce4b('0x96'),_0x9d953c['query'][_0x158d06]);}}});}if(_0x9d953c[_0xce4b('0x53')][_0xce4b('0x97')]){if(_0x9d953c[_0xce4b('0x53')][_0xce4b('0x97')]==0x1){_0x8c08d9[_0xce4b('0x78')]('`unreadMessages`\x20=\x200');}else{_0x8c08d9[_0xce4b('0x78')](_0xce4b('0x98'));}}if(_0x9d953c[_0xce4b('0x53')][_0xce4b('0x99')]){_0x3de4c7=_['isArray'](_0x9d953c[_0xce4b('0x53')][_0xce4b('0x99')])?_0x9d953c[_0xce4b('0x53')][_0xce4b('0x99')]:new Array(_0x9d953c[_0xce4b('0x53')]['tag']);_0x3de4c7[_0xce4b('0x44')](function(_0x4c8e35){_0x43a2c2['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4c8e35+',%');});}if(_0x9d953c[_0xce4b('0x53')][_0xce4b('0x9a')]){var _0x15e48a=_0x9d953c[_0xce4b('0x53')][_0xce4b('0x9a')][_0xce4b('0x9b')]('\x5c','\x5c\x5c')[_0xce4b('0x9b')](/'/g,'\x27\x27');if(qs[_0xce4b('0x9c')](_0x15e48a)){_0x3231b0['or'](_0xce4b('0x9d'),_0x15e48a+'%');}else{_0x3231b0['or'](_0xce4b('0x9e'),qs[_0xce4b('0x7c')](_0x15e48a))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x15e48a+'%');}}}_0x8c08d9[_0xce4b('0x8c')](_0x3231b0);_0x8c08d9['group'](_0xce4b('0x9f'));var _0x3373ed={'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]};var _0x26a958=_0x8c08d9[_0xce4b('0xa0')]();_0x26a958[_0xce4b('0x5e')](_0xce4b('0x9f'));_0x26a958[_0xce4b('0x5e')](_0xce4b('0xa1'),_0xce4b('0x76'));if(_0x5cf037['order']){_0x5cf037[_0xce4b('0x5a')][_0xce4b('0x44')](function(_0x19fa1b){var _0x357efc=_0x19fa1b[0x0]===_0xce4b('0xa2')?_0x19fa1b[0x0]:'i.'+_0x19fa1b[0x0];_0x8c08d9[_0xce4b('0x5a')](_0x357efc,_0x19fa1b[0x1]===_0xce4b('0xa3')?![]:!![]);});}if(!_[_0xce4b('0xa4')](_0x3de4c7)){_0x8c08d9['having'](_0x43a2c2);_0x26a958[_0xce4b('0x8c')](_0xce4b('0xa5'),_0x3de4c7);}BPromise[_0xce4b('0xa6')]()['then'](function(){if(!_0x1e12a0){if(_0x9d953c['query'][_0xce4b('0x8b')])return;_0x26a958[_0xce4b('0x8c')](_0xce4b('0xa7'));_0x8c08d9['where'](_0xce4b('0xa7'));return;}if(_0x9d953c['user']['role']!==_0xce4b('0x3c'))return;return _0x9d953c[_0xce4b('0xa8')][_0xce4b('0xa9')]({'attributes':['id'],'raw':!![]})[_0xce4b('0x20')](function(_0x3718ef){if(_[_0xce4b('0xa4')](_0x3718ef)){_0x26a958[_0xce4b('0x8c')]('i.ChatWebsiteId\x20IS\x20NULL');_0x8c08d9[_0xce4b('0x8c')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x26a958[_0xce4b('0x8c')](_0xce4b('0x8d'),_['map'](_0x3718ef,'id'));_0x8c08d9[_0xce4b('0x8c')](_0xce4b('0x8d'),_[_0xce4b('0x3f')](_0x3718ef,'id'));}});})[_0xce4b('0x20')](function(){if(_0x9d953c[_0xce4b('0xa8')][_0xce4b('0xaa')]==='agent'&&!_0x1e12a0&&!_0x9d953c[_0xce4b('0x53')]['ChatWebsiteId'])return[];return db['sequelize'][_0xce4b('0x53')](_0x26a958['toString'](),_0x3373ed);})[_0xce4b('0x20')](function(_0x56b6fb){_0xa341f6[_0xce4b('0x2f')]=_0x56b6fb[_0xce4b('0x75')];if(_0xa341f6[_0xce4b('0x2f')]===0x0)return[];return db[_0xce4b('0xab')]['query'](_0x404807[_0xce4b('0xac')](),_0x3373ed)['then'](function(_0x8f5d8b){_0x474869=_[_0xce4b('0xad')](_0x8f5d8b,'id');_0x3373ed=_['merge'](_0x3373ed,{'model':db[_0xce4b('0x4f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x9d953c['query'][_0xce4b('0x58')]){_0x5cf037['attributes'][_0xce4b('0x44')](function(_0x5a9492){_0x8c08d9['field']('i.'+_0x5a9492);});}else{_0x8c08d9[_0xce4b('0x5e')](_0xce4b('0xa1'),_0xce4b('0x76'));_0x8c08d9[_0xce4b('0x5e')](_0xce4b('0xae'),_0xce4b('0xaf'));_0x8c08d9[_0xce4b('0x5e')](_0xce4b('0xb0'),_0xce4b('0xb1'));_0x8c08d9[_0xce4b('0x5e')](_0xce4b('0xb2'),_0xce4b('0xa2'));_0x8c08d9[_0xce4b('0x5e')]('i.*');_0x8c08d9[_0xce4b('0x5e')]('c.firstName',_0xce4b('0xb3'));_0x8c08d9[_0xce4b('0x5e')](_0xce4b('0xb4'),_0xce4b('0xb5'));_0x8c08d9[_0xce4b('0x5e')](_0xce4b('0xb6'),_0xce4b('0xb7'));_0x8c08d9[_0xce4b('0x5e')](_0xce4b('0xb8'),_0xce4b('0xb9'));_0x8c08d9['field'](_0xce4b('0xba'),_0xce4b('0xbb'));_0x8c08d9[_0xce4b('0x5e')](_0xce4b('0xbc'),_0xce4b('0xbd'));_0x8c08d9[_0xce4b('0x5e')]('o.fullname',_0xce4b('0xbe'));_0x8c08d9[_0xce4b('0x5e')](_0xce4b('0xbf'),_0xce4b('0xc0'));_0x8c08d9[_0xce4b('0x5e')](_0xce4b('0xc1'),_0xce4b('0x41'));}if(_0x5cf037[_0xce4b('0x30')])_0x8c08d9['limit'](_0x5cf037[_0xce4b('0x30')]);if(_0x5cf037[_0xce4b('0x2d')])_0x8c08d9['offset'](_0x5cf037['offset']);return db['sequelize'][_0xce4b('0x53')](_0x8c08d9[_0xce4b('0xac')](),_0x3373ed);})['then'](function(_0x4424ed){if(_0x4424ed[_0xce4b('0x75')]>0x0)_0x385c2b['where']('ui.ChatInteractionId\x20IN\x20?',_[_0xce4b('0x3f')](_0x4424ed,'id'));return db[_0xce4b('0xab')][_0xce4b('0x53')](_0x385c2b[_0xce4b('0xac')](),_0x3373ed)['then'](function(_0x3fce1b){var _0xb26dab=_[_0xce4b('0xc2')](_0x3fce1b,_0xce4b('0xc3'));var _0x449e82=[];_0x4424ed[_0xce4b('0x44')](function(_0x53fb5a){_0x449e82[_0xce4b('0xc4')](updateChatInteraction(_0x53fb5a,_0x474869,_0xb26dab));});return BPromise[_0xce4b('0xc5')](_0x449e82);});});})['then'](function(_0x247a8b){_0xa341f6['rows']=_0x247a8b;return _0xa341f6;})[_0xce4b('0x20')](respondWithFilteredResult(_0x4fe6fc,_0x5cf037))[_0xce4b('0x28')](handleError(_0x4fe6fc,null));};exports[_0xce4b('0xc6')]=function(_0x3cd7fc,_0x15544c){var _0xbe917b={'raw':![],'where':{'id':_0x3cd7fc[_0xce4b('0xc7')]['id']}},_0x1c5527={};_0x1c5527['model']=_[_0xce4b('0x88')](db[_0xce4b('0x4f')][_0xce4b('0xc8')]);_0x1c5527['query']=_[_0xce4b('0x88')](_0x3cd7fc['query']);_0x1c5527[_0xce4b('0x54')]=_[_0xce4b('0x55')](_0x1c5527[_0xce4b('0x57')],_0x1c5527[_0xce4b('0x53')]);_0xbe917b[_0xce4b('0x56')]=_[_0xce4b('0x55')](_0x1c5527['model'],qs[_0xce4b('0x58')](_0x3cd7fc[_0xce4b('0x53')][_0xce4b('0x58')]));_0xbe917b[_0xce4b('0x56')]=_0xbe917b['attributes'][_0xce4b('0x75')]?_0xbe917b[_0xce4b('0x56')]:_0x1c5527[_0xce4b('0x57')];if(_0x3cd7fc[_0xce4b('0x53')][_0xce4b('0xc9')]){_0xbe917b[_0xce4b('0xca')]=[{'all':!![]}];}_0xbe917b=_['merge']({},_0xbe917b,_0x3cd7fc['options']);return db[_0xce4b('0x4f')][_0xce4b('0x7e')](_0xbe917b)[_0xce4b('0x20')](handleEntityNotFound(_0x15544c,null))[_0xce4b('0x20')](respondWithResult(_0x15544c,null))[_0xce4b('0x28')](handleError(_0x15544c,null));};exports['create']=function(_0x467ab2,_0xae5c19){return db['ChatInteraction'][_0xce4b('0xcb')](_0x467ab2['body'],{})[_0xce4b('0x20')](respondWithResult(_0xae5c19,0xc9))[_0xce4b('0x28')](handleError(_0xae5c19,null));};exports[_0xce4b('0xcc')]=function(_0x5cc2da,_0x26394c){if(_0x5cc2da[_0xce4b('0x3a')]['id']){delete _0x5cc2da[_0xce4b('0x3a')]['id'];}return db[_0xce4b('0x4f')][_0xce4b('0x7e')]({'where':{'id':_0x5cc2da['params']['id']}})['then'](handleEntityNotFound(_0x26394c,null))['then'](saveUpdates(_0x5cc2da[_0xce4b('0x3a')],null))[_0xce4b('0x20')](respondWithResult(_0x26394c,null))[_0xce4b('0x28')](handleError(_0x26394c,null));};exports[_0xce4b('0x35')]=function(_0x2fb88f,_0x6c69aa){return db[_0xce4b('0x4f')]['find']({'where':{'id':_0x2fb88f[_0xce4b('0xc7')]['id']}})[_0xce4b('0x20')](handleEntityNotFound(_0x6c69aa,null))[_0xce4b('0x20')](removeEntity(_0x6c69aa,null))[_0xce4b('0x28')](handleError(_0x6c69aa,null));};exports[_0xce4b('0xcd')]=function(_0x2be99b,_0x5ae344){return db[_0xce4b('0x4f')][_0xce4b('0xcd')]()[_0xce4b('0x20')](respondWithResult(_0x5ae344,null))[_0xce4b('0x28')](handleError(_0x5ae344,null));};exports['createVidaooSession']=function(_0x1ffa7d,_0x2a538b){var _0x1ead1a=_0x1ffa7d[_0xce4b('0xc7')]['id'];var _0x91fd08;var _0x284eb9;var _0x39ced7;return db['ChatInteraction'][_0xce4b('0xce')]({'where':{'id':_0x1ead1a}})[_0xce4b('0x20')](function(_0x2e0fe7){_0x91fd08=_0x2e0fe7;return db[_0xce4b('0xcf')][_0xce4b('0xce')]({'where':{'id':_0x2e0fe7[_0xce4b('0x8b')]},'attributes':['id',_0xce4b('0xd0'),_0xce4b('0xd1'),_0xce4b('0xd2'),_0xce4b('0xd3'),_0xce4b('0xd4')],'raw':!![]});})[_0xce4b('0x20')](function(_0x5c88e2){if(_0x5c88e2&&_0x5c88e2[_0xce4b('0xd0')]&&_0x5c88e2[_0xce4b('0xd1')]){_0x284eb9=_0x5c88e2;var _0x31251a={'interaction':{'id':_0x1ead1a},'agent':{'id':_0x1ffa7d['user']['id'],'name':_0x1ffa7d['user'][_0xce4b('0x37')],'fullname':_0x1ffa7d[_0xce4b('0xa8')][_0xce4b('0x40')],'email':_0x1ffa7d[_0xce4b('0xa8')]['email']},'contact':_0x1ffa7d['body']['contact'],'account':_0x1ffa7d[_0xce4b('0x3a')][_0xce4b('0x3e')]};var _0x2c10d4={'rejectUnauthorized':![],'method':_0xce4b('0xd5'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x5c88e2[_0xce4b('0xd0')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1ffa7d[_0xce4b('0xa8')][_0xce4b('0xd6')]],'buttons':null,'topic':_0x284eb9['vidaooTopic'],'note':_[_0xce4b('0xd7')](_0x284eb9[_0xce4b('0xd3')])?null:getMustacheRender(_0x284eb9[_0xce4b('0xd3')],_0x31251a),'metadata':null},'redirect':_0xce4b('0xd8'),'json':!![]};try{if(!_[_0xce4b('0xd7')](_0x284eb9[_0xce4b('0xd4')])){var _0x3b802f=getMustacheRender(_0x284eb9['vidaooMetadata'],_0x31251a);var _0xcecbcc=JSON[_0xce4b('0x91')](_0x3b802f);_0x2c10d4[_0xce4b('0x3a')][_0xce4b('0xd9')]=_0xcecbcc;}}catch(_0x569532){throw new db[(_0xce4b('0xda'))][(_0xce4b('0xdb'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x2c10d4);}else{throw new db[(_0xce4b('0xda'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})[_0xce4b('0x20')](function(_0xbb202d){_0x39ced7=_0xbb202d;if(_0x39ced7['id']){var _0x5e15bd={'body':_0x39ced7[_0xce4b('0xdc')],'ChatWebsiteId':_0x284eb9['id'],'ChatInteractionId':_0x91fd08['id'],'direction':_0xce4b('0xdd'),'UserId':_0x1ffa7d[_0xce4b('0xa8')]['id']};return db[_0xce4b('0xde')]['create'](_0x5e15bd,{});}else{throw new db[(_0xce4b('0xda'))][(_0xce4b('0xdb'))](_0xce4b('0xdf'));}})['then'](function(){return _0x91fd08[_0xce4b('0xe0')]({'vidaooSessionId':_0x39ced7['id']});})[_0xce4b('0x20')](respondWithResult(_0x2a538b,null))[_0xce4b('0x28')](handleError(_0x2a538b,null));};exports[_0xce4b('0xe1')]=function(_0x5f1e5c,_0x44cbf5){if(_0x5f1e5c['body']['id']){delete _0x5f1e5c[_0xce4b('0x3a')]['id'];}return db[_0xce4b('0x4f')][_0xce4b('0x7e')]({'where':{'id':_0x5f1e5c[_0xce4b('0xc7')]['id']},'include':[{'model':db[_0xce4b('0xe2')],'as':_0xce4b('0x79')}]})[_0xce4b('0x20')](handleEntityNotFound(_0x44cbf5,null))[_0xce4b('0x20')](saveUpdates(_0x5f1e5c['body'],null))[_0xce4b('0x20')](respondWithResult(_0x44cbf5,null))[_0xce4b('0x28')](handleError(_0x44cbf5,null));};exports['abandon']=function(_0x2f8106,_0x559cd9,_0x236146){if(_0x2f8106[_0xce4b('0x3a')]['id']){delete _0x2f8106[_0xce4b('0x3a')]['id'];}return db[_0xce4b('0x4f')]['find']({'where':{'id':_0x2f8106[_0xce4b('0xc7')]['id']}})[_0xce4b('0x20')](function(_0x2143df){if(!_0x2143df){logger[_0xce4b('0x25')](_0xce4b('0xe3'),_0xce4b('0xe4'),0x194,_0xce4b('0xe5'));_0x559cd9[_0xce4b('0x29')](0x194);}else{if(_0x2143df[_0xce4b('0x4c')]){throw new db[(_0xce4b('0xda'))]['ValidationError'](_0xce4b('0xe6'));}}return _0x2143df;})[_0xce4b('0x20')](function(_0x19eba5){if(_0x19eba5){return _0x19eba5[_0xce4b('0xcc')]({'closed':_0x2f8106[_0xce4b('0x3a')][_0xce4b('0x4b')],'disposition':_0x2f8106[_0xce4b('0x3a')][_0xce4b('0x4d')]})['then'](function(_0x147eee){return _0x147eee;});}})['then'](function(_0x26742c){return respondWithRpcPromise(_0xce4b('0xe7'),_0xce4b('0xe4'),_0x2f8106[_0xce4b('0x3a')],client9004);})[_0xce4b('0x20')](respondWithResult(_0x559cd9,null))[_0xce4b('0x28')](handleError(_0x559cd9,null));};exports[_0xce4b('0xe8')]=function(_0x14e4e3,_0x466ce1,_0x47796c){_0x14e4e3[_0xce4b('0x3a')][_0xce4b('0x37')]=_0x14e4e3[_0xce4b('0xe9')][_0xce4b('0xea')];_0x14e4e3[_0xce4b('0x3a')]['basename']=_0x14e4e3['file'][_0xce4b('0xeb')];_0x14e4e3[_0xce4b('0x3a')]['type']=_0x14e4e3[_0xce4b('0xe9')][_0xce4b('0xec')];return db['Attachment'][_0xce4b('0xcb')](_0x14e4e3['body'])['then'](respondWithResult(_0x466ce1,0xc9))[_0xce4b('0x28')](handleError(_0x466ce1,null));};exports['attachmentDownload']=function(_0x2092e0,_0x31129b,_0x59f41d){return db[_0xce4b('0x4f')]['findOne']({'where':{'id':_0x2092e0[_0xce4b('0xc7')]['id']},'raw':!![]})[_0xce4b('0x20')](handleEntityNotFound(_0x31129b,null))[_0xce4b('0x20')](function(_0x3dfa38){if(_0x3dfa38){if(_0x3dfa38['closed']){return _0x31129b[_0xce4b('0x2b')](0x193)[_0xce4b('0x2c')]({'status':0x193,'message':'Unauthorized'});}return db['Attachment'][_0xce4b('0xce')]({'where':{'id':_0x2092e0[_0xce4b('0x53')][_0xce4b('0xed')]},'raw':!![]})[_0xce4b('0x20')](handleEntityNotFound(_0x31129b,null));}})[_0xce4b('0x20')](function(_0x10d63f){if(_0x10d63f){var _0xc558a7=_0x10d63f['ChatOfflineMessageId']!==null;var _0x5b3d0a=path[_0xce4b('0xee')](config[_0xce4b('0xef')],_0xce4b('0xf0'));if(_0xc558a7){_0x5b3d0a=path['join'](_0x5b3d0a,'offline-chat/');}var _0x116d38=path[_0xce4b('0xee')](_0x5b3d0a,_0x10d63f[_0xce4b('0xf1')]);return _0x31129b[_0xce4b('0xf2')](_0x116d38);}})[_0xce4b('0x28')](handleError(_0x31129b,null));};exports['close']=function(_0x536a9b,_0x36818f){var _0x3d6ada=null;var _0x1e05e5=null;var _0x5ec49c=null;var _0x354950=null;if(_0x536a9b[_0xce4b('0x3a')]['id']){delete _0x536a9b['body']['id'];}if(_0x536a9b[_0xce4b('0x3a')]['mailTranscript']){_0x354950=path[_0xce4b('0xee')](config[_0xce4b('0xef')],'server/files/chat/upload/',util[_0xce4b('0xf3')](_0xce4b('0xf4'),Date[_0xce4b('0xf5')]()));_0x536a9b[_0xce4b('0x3a')][_0xce4b('0xf6')]=_0x354950;}return db[_0xce4b('0x4f')][_0xce4b('0x7e')]({'where':{'id':_0x536a9b[_0xce4b('0xc7')]['id']},'include':[{'model':db[_0xce4b('0xde')],'as':_0xce4b('0xf7'),'include':[{'model':db[_0xce4b('0x85')],'as':'User'}]}]})[_0xce4b('0x20')](handleEntityNotFound(_0x36818f,null))[_0xce4b('0x20')](saveUpdates(_0x536a9b[_0xce4b('0x3a')],null))[_0xce4b('0x20')](function(_0x44fc19){if(_0x44fc19){_0x3d6ada=_0x44fc19;return db['ChatWebsite']['find']({'where':{'id':_0x3d6ada[_0xce4b('0x8b')]}});}})['then'](function(_0x4a0c48){if(_0x4a0c48){_0x5ec49c=_0x4a0c48;return db[_0xce4b('0xe2')]['find']({'where':{'id':_0x3d6ada[_0xce4b('0x7f')]}});}})[_0xce4b('0x20')](function(_0x165a32){if(_0x165a32){_0x1e05e5=_0x165a32;if(_0x354950){var _0x3cc3de=null;for(var _0x891e83=0x1;_0x891e83<_0x3d6ada['Messages'][_0xce4b('0x75')];++_0x891e83){_0x3cc3de=_0x3d6ada[_0xce4b('0xf7')][_0x891e83];var _0x69e633=_0x3cc3de[_0xce4b('0x4c')]?util[_0xce4b('0xf3')](_0xce4b('0xf8'),_0x5ec49c[_0xce4b('0xf9')],_0x3cc3de[_0xce4b('0x4c')]):_0xce4b('0xfa');var _0x2755ac=_0x536a9b['body'][_0xce4b('0xfb')]||util['format'](_0xce4b('0xf8'),_0xce4b('0xfc'),_0x3cc3de[_0xce4b('0x7f')]);switch(_0x5ec49c['agentIdentifier']){case _0xce4b('0xfd'):_0x69e633=_0x3cc3de['UserId']?util[_0xce4b('0xf3')](_0xce4b('0xf8'),_0x5ec49c[_0xce4b('0xf9')],_0x3cc3de[_0xce4b('0x4c')]):'System';break;case _0xce4b('0xfe'):_0x69e633=_0x3cc3de[_0xce4b('0x4c')]?_0x3cc3de['User'][_0xce4b('0xff')]||_0x3cc3de[_0xce4b('0x85')]['fullname']:'System';break;case'agent_fullname':_0x69e633=_0x3cc3de['UserId']?_0x3cc3de[_0xce4b('0x85')]['fullname']:_0xce4b('0xfa');break;default:_0x69e633=_0x3cc3de[_0xce4b('0x4c')]?util[_0xce4b('0xf3')](_0xce4b('0xf8'),_0x5ec49c[_0xce4b('0xf9')],_0x3cc3de['UserId']):_0xce4b('0xfa');}var _0x5d6635=util[_0xce4b('0xf3')](_0xce4b('0x100'),moment(_0x3cc3de[_0xce4b('0x8f')])[_0xce4b('0xf3')](_0xce4b('0x101')),_0x3cc3de[_0xce4b('0x102')]==='in'?_0x2755ac:_0x69e633,_0x3cc3de[_0xce4b('0x3a')]);if(!_0x3cc3de['secret']){fs[_0xce4b('0x103')](_0x354950,_0x5d6635);}}return db[_0xce4b('0x104')][_0xce4b('0xce')]({'where':{'service':!![]},'include':[{'model':db[_0xce4b('0x105')],'as':_0xce4b('0x106'),'raw':!![]}]});}}})[_0xce4b('0x20')](function(_0xd630c4){if(_0xd630c4&&_0xd630c4[_0xce4b('0x106')]&&_0x536a9b['body']){var _0x5eb2bb={'tls':{'rejectUnauthorized':![]}};if(_0xd630c4[_0xce4b('0x106')][_0xce4b('0x107')]){_0x5eb2bb[_0xce4b('0x107')]=_0xd630c4[_0xce4b('0x106')][_0xce4b('0x107')];}else{_0x5eb2bb[_0xce4b('0x108')]=_0xd630c4[_0xce4b('0x106')]['host'];_0x5eb2bb[_0xce4b('0x109')]=_0xd630c4[_0xce4b('0x106')]['port'];_0x5eb2bb[_0xce4b('0x10a')]=_0xd630c4[_0xce4b('0x106')][_0xce4b('0x10a')];}if(_0xd630c4['Smtp'][_0xce4b('0x10b')]){_0x5eb2bb[_0xce4b('0x10c')]={'user':_0xd630c4['Smtp'][_0xce4b('0xa8')],'pass':_0xd630c4[_0xce4b('0x106')][_0xce4b('0x10d')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x5eb2bb,'message':{'from':util[_0xce4b('0xf3')](_0xce4b('0x10e'),_0xd630c4[_0xce4b('0x37')],_0xd630c4[_0xce4b('0xd6')]||_0xd630c4[_0xce4b('0x106')][_0xce4b('0xa8')]),'to':_0x536a9b[_0xce4b('0x3a')][_0xce4b('0x10f')],'subject':_0xce4b('0x110'),'text':util[_0xce4b('0xf3')](_0xce4b('0x111'),_0x536a9b[_0xce4b('0x3a')][_0xce4b('0x10f')]),'attachments':[{'path':_0x354950}]}})[_0xce4b('0x20')](function(){return _0x3d6ada;})[_0xce4b('0x28')](function(_0x471926){console['error'](_0x471926);});}else{return _0x3d6ada;}})[_0xce4b('0x20')](respondWithStatusCode(_0x36818f,0xc8))['catch'](handleError(_0x36818f,null));};exports[_0xce4b('0x112')]=function(_0x10fd96,_0x1a33ea,_0x389b32){return db[_0xce4b('0xde')][_0xce4b('0x7e')]({'where':{'id':_0x10fd96['params']['id']}})['then'](handleEntityNotFound(_0x1a33ea,null))[_0xce4b('0x20')](function(_0x193811){if(_0x193811){return _0x193811['addMessage'](_0x10fd96[_0xce4b('0x3a')][_0xce4b('0x113')],_[_0xce4b('0x114')](_0x10fd96['body'],[_0xce4b('0x113'),'id'])||{});}})['then'](respondWithResult(_0x1a33ea,null))[_0xce4b('0x28')](handleError(_0x1a33ea,null));};exports[_0xce4b('0x115')]=function(_0x1158a7,_0x5d08aa,_0x360448){var _0x4cea38={'raw':![],'where':{}};var _0x153a3e={};var _0x49bf7b={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xce4b('0xce')]({'where':{'id':_0x1158a7[_0xce4b('0xc7')]['id']}})[_0xce4b('0x20')](handleEntityNotFound(_0x5d08aa,null))[_0xce4b('0x20')](function(_0x3fbe44){if(_0x3fbe44){_0x153a3e[_0xce4b('0x57')]=_[_0xce4b('0x88')](db['ChatMessage'][_0xce4b('0xc8')]);_0x153a3e['query']=_['keys'](_0x1158a7[_0xce4b('0x53')]);_0x153a3e[_0xce4b('0x54')]=_[_0xce4b('0x55')](_0x153a3e[_0xce4b('0x57')],_0x153a3e[_0xce4b('0x53')]);_0x4cea38[_0xce4b('0x56')]=_[_0xce4b('0x55')](_0x153a3e[_0xce4b('0x57')],qs[_0xce4b('0x58')](_0x1158a7['query'][_0xce4b('0x58')]));_0x4cea38[_0xce4b('0x56')]=_0x4cea38[_0xce4b('0x56')][_0xce4b('0x75')]?_0x4cea38[_0xce4b('0x56')]:_0x153a3e[_0xce4b('0x57')];if(!_0x1158a7[_0xce4b('0x53')][_0xce4b('0x59')]('nolimit')){_0x4cea38[_0xce4b('0x30')]=qs[_0xce4b('0x30')](_0x1158a7[_0xce4b('0x53')]['limit']);_0x4cea38[_0xce4b('0x2d')]=qs[_0xce4b('0x2d')](_0x1158a7['query'][_0xce4b('0x2d')]);}_0x4cea38[_0xce4b('0x5a')]=qs[_0xce4b('0x5b')](_0x1158a7[_0xce4b('0x53')][_0xce4b('0x5b')]);_0x4cea38[_0xce4b('0x8c')]=qs[_0xce4b('0x54')](_[_0xce4b('0x5c')](_0x1158a7[_0xce4b('0x53')],_0x153a3e[_0xce4b('0x54')]));_0x4cea38[_0xce4b('0x8c')][_0xce4b('0xc3')]=_0x3fbe44['id'];if(_0x1158a7[_0xce4b('0x53')][_0xce4b('0x9a')]){_0x4cea38[_0xce4b('0x8c')]=_[_0xce4b('0x39')](_0x4cea38[_0xce4b('0x8c')],{'$or':_['map'](_0x4cea38[_0xce4b('0x56')],function(_0x231de7){var _0x52e1b2={};_0x52e1b2[_0x231de7]={'$like':'%'+_0x1158a7['query'][_0xce4b('0x9a')]+'%'};return _0x52e1b2;})});}if(_0x1158a7[_0xce4b('0x53')][_0xce4b('0x90')]){var _0x509355=_0x1158a7[_0xce4b('0x53')][_0xce4b('0x90')][_0xce4b('0x43')](',');var _0x371877={};_0x371877[_0x509355[0x0]]={'$gte':moment(_0x509355[0x1])[_0xce4b('0xf3')](_0xce4b('0x116'))};_0x4cea38[_0xce4b('0x8c')]=_['merge'](_0x4cea38[_0xce4b('0x8c')],_0x371877);}_0x4cea38=_[_0xce4b('0x39')]({},_0x4cea38,_0x1158a7[_0xce4b('0x117')]);return db['ChatMessage'][_0xce4b('0x2f')]({'where':_0x4cea38[_0xce4b('0x8c')]})['then'](function(_0x1a51d8){_0x49bf7b[_0xce4b('0x2f')]=_0x1a51d8;if(_0x1158a7[_0xce4b('0x53')][_0xce4b('0xc9')]){_0x4cea38[_0xce4b('0xca')]=[{'all':!![]}];}return db[_0xce4b('0xde')][_0xce4b('0x118')](_0x4cea38);})[_0xce4b('0x20')](function(_0x4705b8){_0x49bf7b[_0xce4b('0x119')]=_0x4705b8;return _0x49bf7b;});}})[_0xce4b('0x20')](respondWithFilteredResult(_0x5d08aa,_0x4cea38))[_0xce4b('0x28')](handleError(_0x5d08aa,null));};exports[_0xce4b('0x11a')]=function(_0xa3e61c,_0x36dc55,_0x4bab44){var _0x35a066={'where':{}},_0x337ab0={},_0x1ed019={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xce4b('0xce')]({'where':{'id':_0xa3e61c[_0xce4b('0xc7')]['id']}})[_0xce4b('0x20')](handleEntityNotFound(_0x36dc55,null))[_0xce4b('0x20')](function(_0x3b1212){if(_0x3b1212){_0x337ab0[_0xce4b('0x57')]=_[_0xce4b('0x88')](db[_0xce4b('0xde')]['rawAttributes']);_0x337ab0[_0xce4b('0x53')]=_['keys'](_0xa3e61c[_0xce4b('0x53')]);_0x337ab0[_0xce4b('0x54')]=_['intersection'](_0x337ab0['model'],_0x337ab0[_0xce4b('0x53')]);_0x35a066[_0xce4b('0x56')]=_['intersection'](_0x337ab0['model'],qs[_0xce4b('0x58')](_0xa3e61c[_0xce4b('0x53')][_0xce4b('0x58')]));_0x35a066[_0xce4b('0x56')]=_0x35a066[_0xce4b('0x56')]['length']?_0x35a066['attributes']:_0x337ab0[_0xce4b('0x57')];if(!_0xa3e61c[_0xce4b('0x53')][_0xce4b('0x59')]('nolimit')){_0x35a066[_0xce4b('0x30')]=qs[_0xce4b('0x30')](_0xa3e61c[_0xce4b('0x53')][_0xce4b('0x30')]);_0x35a066[_0xce4b('0x2d')]=qs['offset'](_0xa3e61c[_0xce4b('0x53')][_0xce4b('0x2d')]);}_0x35a066[_0xce4b('0x5a')]=qs[_0xce4b('0x5b')](_0xa3e61c[_0xce4b('0x53')][_0xce4b('0x5b')]);_0x35a066[_0xce4b('0x8c')]=qs[_0xce4b('0x54')](_[_0xce4b('0x5c')](_0xa3e61c[_0xce4b('0x53')],_0x337ab0[_0xce4b('0x54')]));_0x35a066['where'][_0xce4b('0xc3')]=_0x3b1212['id'];if(_0xa3e61c['query']['filter']){_0x35a066[_0xce4b('0x8c')]=_[_0xce4b('0x39')](_0x35a066[_0xce4b('0x8c')],{'$or':_[_0xce4b('0x3f')](_0x35a066[_0xce4b('0x56')],function(_0x356ea5){var _0x211b8d={};_0x211b8d[_0x356ea5]={'$like':'%'+_0xa3e61c[_0xce4b('0x53')][_0xce4b('0x9a')]+'%'};return _0x211b8d;})});}_0x35a066['where'][_0xce4b('0x11b')]=![];if(_0xa3e61c['query']['id']){_0x35a066['where']['id']={'$gt':_0xa3e61c[_0xce4b('0x53')]['id']};}_0x35a066=_[_0xce4b('0x39')]({},_0x35a066,_0xa3e61c[_0xce4b('0x117')]);return db[_0xce4b('0xde')][_0xce4b('0x2f')]({'where':_0x35a066[_0xce4b('0x8c')]})[_0xce4b('0x20')](function(_0x43a97e){_0x1ed019['count']=_0x43a97e;_0x35a066['include']=[];if(_0xa3e61c[_0xce4b('0x53')]['includeAgent']){_0x35a066[_0xce4b('0xca')][_0xce4b('0xc4')]({'model':db[_0xce4b('0x85')],'as':_0xce4b('0x85'),'attributes':['id',_0xce4b('0x40'),'alias']});}if(_0xa3e61c['query'][_0xce4b('0xc9')]){_0x35a066[_0xce4b('0xca')]=[{'all':!![]}];}return db['ChatMessage'][_0xce4b('0x118')](_0x35a066);})['then'](function(_0x28a32e){_0x1ed019[_0xce4b('0x119')]=_0x28a32e;return _0x1ed019;});}})[_0xce4b('0x20')](respondWithFilteredResult(_0x36dc55,_0x35a066))[_0xce4b('0x28')](handleError(_0x36dc55,null));};exports[_0xce4b('0x11c')]=function(_0xa17ef,_0x7015fd,_0x401cde){return db[_0xce4b('0x4f')][_0xce4b('0x7e')]({'where':{'id':_0xa17ef[_0xce4b('0xc7')]['id']}})[_0xce4b('0x20')](handleEntityNotFound(_0x7015fd,null))[_0xce4b('0x20')](function(_0x563669){if(_0x563669){return _0x563669['setTags'](_0xa17ef[_0xce4b('0x3a')][_0xce4b('0x113')],_[_0xce4b('0x114')](_0xa17ef[_0xce4b('0x3a')],[_0xce4b('0x113'),'id'])||{})[_0xce4b('0x11d')](function(){return db['Tag']['findAll']({'attributes':['id',_0xce4b('0x37'),'color'],'where':{'id':_0xa17ef[_0xce4b('0x3a')][_0xce4b('0x113')]}});})['then'](function(_0x2aae71){socket['emit'](_0xce4b('0x11e'),{'id':Number(_0xa17ef[_0xce4b('0xc7')]['id']),'tags':_0x2aae71||[]});return{'id':Number(_0xa17ef[_0xce4b('0xc7')]['id']),'tags':_0x2aae71||[]};});}})[_0xce4b('0x20')](respondWithResult(_0x7015fd,null))[_0xce4b('0x28')](handleError(_0x7015fd,null));};exports['removeTags']=function(_0x3a9566,_0x2816a8,_0x32812d){return db[_0xce4b('0x4f')][_0xce4b('0x7e')]({'where':{'id':_0x3a9566['params']['id']}})[_0xce4b('0x20')](handleEntityNotFound(_0x2816a8,null))[_0xce4b('0x20')](function(_0x2ee3d4){if(_0x2ee3d4){return _0x2ee3d4[_0xce4b('0x11f')](_0x3a9566[_0xce4b('0x53')][_0xce4b('0x113')]);}})[_0xce4b('0x20')](respondWithStatusCode(_0x2816a8,null))['catch'](handleError(_0x2816a8,null));};exports[_0xce4b('0xf2')]=function(_0x3d7fa9,_0xe3e262){var _0x527098=moment()[_0xce4b('0x120')]()[_0xce4b('0xac')]();var _0x12e0da=path[_0xce4b('0xee')](config['root'],_0xce4b('0x121'),_0xce4b('0x122'),_0xce4b('0x123'));var _0x589e82=path[_0xce4b('0xee')](config[_0xce4b('0xef')],_0xce4b('0x121'),_0xce4b('0x122'),_0xce4b('0x124'));var _0xa0b54=path[_0xce4b('0xee')](_0x12e0da,_0x527098);var _0x5afad7=util[_0xce4b('0xf3')](_0xce4b('0x125'),_0x3d7fa9[_0xce4b('0xc7')]['id'],_0x527098);var _0x2e3774=path[_0xce4b('0xee')](_0x12e0da,_0x5afad7);var _0x12305f=[];_0x12305f['push']({'model':db[_0xce4b('0x85')],'as':'User','attributes':['id',_0xce4b('0x40')],'raw':!![]});_0x12305f[_0xce4b('0xc4')]({'model':db[_0xce4b('0xe2')],'as':_0xce4b('0x79'),'attributes':['id','firstName',_0xce4b('0x126')],'raw':!![]});if(_0x3d7fa9[_0xce4b('0x53')][_0xce4b('0x124')]){_0x12305f[_0xce4b('0xc4')]({'model':db[_0xce4b('0x127')],'as':'Attachment','raw':!![]});}var _0x58df32=[{'model':db['ChatMessage'],'as':_0xce4b('0xf7'),'attributes':['id',_0xce4b('0x3a'),'createdAt',_0xce4b('0x102'),_0xce4b('0x11b'),'read'],'include':_0x12305f}];_0x58df32[_0xce4b('0xc4')]({'model':db[_0xce4b('0xcf')],'as':_0xce4b('0x128'),'attributes':['id',_0xce4b('0x37')]});_0x58df32[_0xce4b('0xc4')]({'model':db[_0xce4b('0x85')],'as':_0xce4b('0x129'),'attributes':['id',_0xce4b('0x40')]});return db['ChatInteraction'][_0xce4b('0x7e')]({'where':{'id':_0x3d7fa9[_0xce4b('0xc7')]['id']},'include':_0x58df32})[_0xce4b('0x20')](handleEntityNotFound(_0xe3e262,null))[_0xce4b('0x20')](function(_0xbc67f7){if(_0xbc67f7){var _0x3f6acc=_0xbc67f7[_0xce4b('0x12a')]({'plain':!![]});fs[_0xce4b('0x12b')](_0xa0b54);var _0x105720={'channel':_0xce4b('0x12c'),'account':_0x3f6acc['Account'][_0xce4b('0x37')],'agent':_0x3f6acc[_0xce4b('0x129')]?_0x3f6acc[_0xce4b('0x129')][_0xce4b('0x40')]:'N.A.','createdAt':moment(_0x3f6acc[_0xce4b('0x8f')])[_0xce4b('0xf3')]('YYYY-MM-DD\x20HH:mm:ss')[_0xce4b('0xac')](),'closedAt':_0x3f6acc[_0xce4b('0x4b')]?moment(_0x3f6acc[_0xce4b('0x12d')])[_0xce4b('0xf3')]('YYYY-MM-DD\x20HH:mm:ss')[_0xce4b('0xac')]():'','disposition':_0x3f6acc['disposition'],'chatInfo':{'browser':_0x3f6acc['browserName'],'os':_0x3f6acc[_0xce4b('0x12e')],'referer':_0x3f6acc['referer'],'customerIp':_0x3f6acc[_0xce4b('0x12f')],'customerPort':_0x3f6acc[_0xce4b('0x130')]?_0x3f6acc[_0xce4b('0x130')]:_0xce4b('0x131')},'messages':_(_0x3f6acc[_0xce4b('0xf7')])[_0xce4b('0x132')]()[_0xce4b('0x9a')]({'secret':![]})[_0xce4b('0x3f')](function(_0x1e696c){if(_0x1e696c[_0xce4b('0x127')]){var _0x5535ee=path[_0xce4b('0xee')](_0x589e82,_0x1e696c[_0xce4b('0x127')][_0xce4b('0xf1')]);if(fs[_0xce4b('0x133')](_0x5535ee)){fs[_0xce4b('0x134')](_0x5535ee)[_0xce4b('0x135')](fs[_0xce4b('0x136')](path[_0xce4b('0xee')](_0xa0b54,_0x1e696c[_0xce4b('0x127')][_0xce4b('0xf1')])));}}return{'date':moment(_0x1e696c[_0xce4b('0x8f')])[_0xce4b('0xf3')](_0xce4b('0x116'))[_0xce4b('0xac')](),'sender':_0x1e696c[_0xce4b('0x102')]===_0xce4b('0xdd')?_0x1e696c[_0xce4b('0x85')]?_0x1e696c[_0xce4b('0x85')][_0xce4b('0x40')]:'System':_0x1e696c[_0xce4b('0x79')][_0xce4b('0x137')]+(_0x1e696c[_0xce4b('0x79')][_0xce4b('0x126')]?'\x20'+_0x1e696c[_0xce4b('0x79')][_0xce4b('0x126')]:''),'body':_0x1e696c['Attachment']?_0x1e696c[_0xce4b('0x127')][_0xce4b('0xf1')]:_0x1e696c[_0xce4b('0x3a')],'direction':_0x1e696c[_0xce4b('0x102')]===_0xce4b('0xdd')?'A':'C','secret':_0x1e696c[_0xce4b('0x11b')],'read':_0x1e696c[_0xce4b('0x97')],'attachment':_0x1e696c['Attachment']};})[_0xce4b('0x77')]()};return ejs['renderFile'](path[_0xce4b('0xee')](config[_0xce4b('0xef')],_0xce4b('0x121'),_0xce4b('0x138'),_0xce4b('0x139')),{'interaction':_0x105720})[_0xce4b('0x20')](function(_0x187fcb){var _0xf825c5=path[_0xce4b('0xee')](_0xa0b54,_0xce4b('0x13a')+_0x3f6acc['id']+'-'+_0x527098+_0xce4b('0x13b'));var _0x5418b8={'path':_0xf825c5,'channel':_0xce4b('0x12c'),'interactionId':_0x3f6acc['id']};return pdf['createPdfFromHTML'](_0x187fcb,_0x5418b8);})[_0xce4b('0x20')](function(){return new BPromise(function(_0x43d894,_0x1da453){zipdir(_0xa0b54,{'saveTo':_0x2e3774},function(_0x267ad4,_0x55fcbf){if(_0x267ad4)return _0x1da453(_0x267ad4);return _0x43d894(_0x55fcbf);});})[_0xce4b('0x20')](function(){return new BPromise(function(_0x81a571,_0xa238c9){rimraf(_0xa0b54,function(_0x1d36a8){if(_0x1d36a8)_0xa238c9(_0x1d36a8);return _0x81a571();});});})['then'](function(){return _0xe3e262[_0xce4b('0xf2')](_0x2e3774,_0x5afad7,function(_0xe96784){if(_0xe96784){console[_0xce4b('0x13c')]('err',_0xe96784);}else{fs[_0xce4b('0x13d')](_0x2e3774);}});});});}else{return _0xe3e262[_0xce4b('0x29')](0xc8);}})['catch'](handleError(_0xe3e262,null));};
\ No newline at end of file
+var _0xd2b2=['removeTags','unix','server','files','tmp','firstName','attachments','Owner','get','mkdirSync','Chat','Account','N.A.','closedAt','YYYY-MM-DD\x20HH:mm:ss','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','createWriteStream','lastName','renderFile','downloadInteraction.ejs','transcript-','log','err','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','client','http','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','status','end','json','limit','count','offset','Content-Range','apply','save','update','then','destroy','stack','name','send','render','merge','contact','agent','interaction','fullname','TagIds','Tags','split','forEach','push','waiting','talking','answered','unmanaged','abandoned','total','closed','UserId','disposition','map','ChatInteraction','fieldName','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','select','field','color','tools_tags','u.id','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','me.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','text','Tag','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','body','buildExpression','some','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','all','rows','params','rawAttributes','includeAll','create','describe','createVidaooSession','ChatWebsite','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','metadata','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','originalname','basename','file','filename','mimetype','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','download','close','server/files/chat/upload/','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','format','System','customer','Visitor','agentIdentifier','%s%d','agentAlias','agent_alias','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','Smtp','service','host','port','secure','SendMail','sendMail','mailTranscript','Mail\x20Transcript','addMessage','ids','omit','getMessages','hasOwnProperty','pick','options','include','findAll','getMyMessages','includeAgent','alias','addTags','spread','emit'];(function(_0x24fead,_0x25afed){var _0x227220=function(_0x389484){while(--_0x389484){_0x24fead['push'](_0x24fead['shift']());}};_0x227220(++_0x25afed);}(_0xd2b2,0x15a));var _0x2d2b=function(_0x4bfade,_0xb26c0e){_0x4bfade=_0x4bfade-0x0;var _0x272465=_0xd2b2[_0x4bfade];return _0x272465;};'use strict';var emlformat=require(_0x2d2b('0x0'));var rimraf=require(_0x2d2b('0x1'));var zipdir=require(_0x2d2b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2d2b('0x3'));var BPromise=require(_0x2d2b('0x4'));var Mustache=require(_0x2d2b('0x5'));var util=require(_0x2d2b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x2d2b('0x7'));var ejs=require(_0x2d2b('0x8'));var fs=require('fs');var fs_extra=require(_0x2d2b('0x9'));var _=require(_0x2d2b('0xa'));var squel=require(_0x2d2b('0xb'));var crypto=require(_0x2d2b('0xc'));var jsforce=require(_0x2d2b('0xd'));var deskjs=require(_0x2d2b('0xe'));var toCsv=require(_0x2d2b('0x7'));var querystring=require(_0x2d2b('0xf'));var Papa=require(_0x2d2b('0x10'));var Redis=require(_0x2d2b('0x11'));var authService=require(_0x2d2b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2d2b('0x13'));var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2d2b('0x14'))(_0x2d2b('0x15'));var utils=require(_0x2d2b('0x16'));var config=require(_0x2d2b('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x2d2b('0x18'))['db'];config[_0x2d2b('0x19')]=_[_0x2d2b('0x1a')](config[_0x2d2b('0x19')],{'host':_0x2d2b('0x1b'),'port':0x18eb});var socket=require(_0x2d2b('0x1c'))(new Redis(config[_0x2d2b('0x19')]));require('./chatInteraction.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x2d2b('0x1d')][_0x2d2b('0x1e')]({'port':0x232b});var client9004=jayson[_0x2d2b('0x1d')]['http']({'port':0x232c});function respondWithRpcPromise(_0x1ebd9f,_0x2fd3d9,_0x4fe3d6,_0x2ba0c1){return new BPromise(function(_0x307c7f,_0x5d2920){var _0x436efd=_0x2ba0c1||client;return _0x436efd[_0x2d2b('0x1f')](_0x1ebd9f,_0x4fe3d6)['then'](function(_0x1b123e){logger[_0x2d2b('0x20')](_0x2d2b('0x21'),_0x2fd3d9,_0x2d2b('0x22'));logger[_0x2d2b('0x23')](_0x2d2b('0x24'),_0x2fd3d9,_0x2d2b('0x22'),JSON['stringify'](_0x1b123e));if(_0x1b123e[_0x2d2b('0x25')]){if(_0x1b123e[_0x2d2b('0x25')][_0x2d2b('0x26')]===0x1f4){logger[_0x2d2b('0x25')](_0x2d2b('0x21'),_0x2fd3d9,_0x1b123e[_0x2d2b('0x25')][_0x2d2b('0x27')]);return _0x5d2920(_0x1b123e['error'][_0x2d2b('0x27')]);}logger[_0x2d2b('0x25')](_0x2d2b('0x21'),_0x2fd3d9,_0x1b123e['error'][_0x2d2b('0x27')]);return _0x307c7f(_0x1b123e['error']['message']);}else{logger[_0x2d2b('0x20')](_0x2d2b('0x21'),_0x2fd3d9,_0x2d2b('0x22'));_0x307c7f(_0x1b123e['result'][_0x2d2b('0x27')]);}})[_0x2d2b('0x28')](function(_0x27f1f8){logger[_0x2d2b('0x25')]('ChatInteraction,\x20%s,\x20%s',_0x2fd3d9,_0x27f1f8);_0x5d2920(_0x27f1f8);});});}function respondWithStatusCode(_0x2316d8,_0x5a2531){_0x5a2531=_0x5a2531||0xcc;return function(_0x4ce7d7){if(_0x4ce7d7){return _0x2316d8[_0x2d2b('0x29')](_0x5a2531);}return _0x2316d8[_0x2d2b('0x2a')](_0x5a2531)[_0x2d2b('0x2b')]();};}function respondWithResult(_0x5454bd,_0x39dcfa){_0x39dcfa=_0x39dcfa||0xc8;return function(_0x39af3e){if(_0x39af3e){return _0x5454bd[_0x2d2b('0x2a')](_0x39dcfa)[_0x2d2b('0x2c')](_0x39af3e);}};}function respondWithFilteredResult(_0x59afa5,_0x176c11){return function(_0x35b5e0){if(_0x35b5e0){var _0x52febb=typeof _0x176c11['offset']==='undefined'&&typeof _0x176c11[_0x2d2b('0x2d')]==='undefined';var _0x455fe0=_0x35b5e0[_0x2d2b('0x2e')];var _0xf84a39=_0x52febb?0x0:_0x176c11[_0x2d2b('0x2f')];var _0x2f9e8c=_0x52febb?_0x35b5e0[_0x2d2b('0x2e')]:_0x176c11[_0x2d2b('0x2f')]+_0x176c11['limit'];var _0x37f4bc;if(_0x2f9e8c>=_0x455fe0){_0x2f9e8c=_0x455fe0;_0x37f4bc=0xc8;}else{_0x37f4bc=0xce;}_0x59afa5[_0x2d2b('0x2a')](_0x37f4bc);return _0x59afa5['set'](_0x2d2b('0x30'),_0xf84a39+'-'+_0x2f9e8c+'/'+_0x455fe0)[_0x2d2b('0x2c')](_0x35b5e0);}return null;};}function patchUpdates(_0x3ca1d1){return function(_0x2042e1){try{jsonpatch[_0x2d2b('0x31')](_0x2042e1,_0x3ca1d1,!![]);}catch(_0x4b2919){return BPromise['reject'](_0x4b2919);}return _0x2042e1[_0x2d2b('0x32')]();};}function saveUpdates(_0x6b4fd8,_0x34df2f){return function(_0x16ec3c){if(_0x16ec3c){return _0x16ec3c[_0x2d2b('0x33')](_0x6b4fd8)[_0x2d2b('0x34')](function(_0x5eaf7b){return _0x5eaf7b;});}return null;};}function removeEntity(_0x49ab4b,_0x575c37){return function(_0x3570cc){if(_0x3570cc){return _0x3570cc[_0x2d2b('0x35')]()[_0x2d2b('0x34')](function(){_0x49ab4b['status'](0xcc)[_0x2d2b('0x2b')]();});}};}function handleEntityNotFound(_0xd0bc2,_0x18ed37){return function(_0x1bf46f){if(!_0x1bf46f){_0xd0bc2['sendStatus'](0x194);}return _0x1bf46f;};}function handleError(_0x2e04e9,_0x33665a){_0x33665a=_0x33665a||0x1f4;return function(_0x5cb5b9){logger['error'](_0x5cb5b9[_0x2d2b('0x36')]);if(_0x5cb5b9[_0x2d2b('0x37')]){delete _0x5cb5b9[_0x2d2b('0x37')];}_0x2e04e9[_0x2d2b('0x2a')](_0x33665a)[_0x2d2b('0x38')](_0x5cb5b9);};}function getMustacheRender(_0x2a96c4,_0x970994){return Mustache[_0x2d2b('0x39')](_0x2a96c4,_[_0x2d2b('0x3a')](_0x970994['body'],{'contact':_0x970994[_0x2d2b('0x3b')],'message':_0x970994[_0x2d2b('0x27')],'agent':_0x970994[_0x2d2b('0x3c')],'interaction':_0x970994[_0x2d2b('0x3d')],'account':_0x970994['account']}))||'';}function getInteractionUsers(_0x344eef,_0x4e5dfd){return new BPromise(function(_0x4aca1e,_0x17c687){try{if(_0x4e5dfd[_0x344eef['id']]){_0x344eef['Users']=_['map'](_0x4e5dfd[_0x344eef['id']],function(_0x3eb6bb){return{'id':_0x3eb6bb['id'],'fullname':_0x3eb6bb[_0x2d2b('0x3e')]};});}}catch(_0x40d1a9){_0x17c687(_0x40d1a9);}_0x4aca1e(_0x344eef);});}function getInteractionTags(_0x1b94da,_0x307c09){return new BPromise(function(_0x18c050,_0x1a728e){try{if(_0x1b94da[_0x2d2b('0x3f')]){_0x1b94da[_0x2d2b('0x40')]=[];_0x1b94da[_0x2d2b('0x3f')][_0x2d2b('0x41')](',')[_0x2d2b('0x42')](function(_0x110e9c){_0x1b94da[_0x2d2b('0x40')][_0x2d2b('0x43')](_0x307c09[_0x110e9c]);});}delete _0x1b94da[_0x2d2b('0x3f')];}catch(_0xb4ae48){_0x1a728e(_0xb4ae48);}_0x18c050(_0x1b94da);});}function updateChatInteraction(_0x134d52,_0x4c6603,_0x3c8ee7){return new BPromise(function(_0x1552ea,_0x5237a6){return getInteractionUsers(_0x134d52,_0x3c8ee7)[_0x2d2b('0x34')](function(_0x27004d){return getInteractionTags(_0x27004d,_0x4c6603);})[_0x2d2b('0x34')](function(_0x238146){return getStateInteraction(_0x238146);})[_0x2d2b('0x34')](function(_0x7b8c59){_0x1552ea(_0x7b8c59);})[_0x2d2b('0x28')](function(_0x3f53a5){_0x5237a6(_0x3f53a5);});});}function getStateInteraction(_0x579faf){return new BPromise(function(_0x5e7328){_0x579faf[_0x2d2b('0x44')]=0x0;_0x579faf[_0x2d2b('0x45')]=0x0;_0x579faf[_0x2d2b('0x46')]=0x0;_0x579faf[_0x2d2b('0x47')]=0x0;_0x579faf[_0x2d2b('0x48')]=0x0;_0x579faf[_0x2d2b('0x49')]=0x0;if(!_0x579faf[_0x2d2b('0x4a')]&&!_0x579faf[_0x2d2b('0x4b')]){_0x579faf['waiting']+=0x1;}if(!_0x579faf[_0x2d2b('0x4a')]&&_0x579faf['UserId']){_0x579faf[_0x2d2b('0x45')]+=0x1;if(_0x579faf['waiting']){_0x579faf[_0x2d2b('0x44')]-=0x1;}}if(_0x579faf[_0x2d2b('0x4a')]&&_0x579faf[_0x2d2b('0x4c')]===_0x2d2b('0x48')){_0x579faf['abandoned']+=0x1;if(_0x579faf[_0x2d2b('0x44')]){_0x579faf[_0x2d2b('0x44')]-=0x1;}}else if(_0x579faf[_0x2d2b('0x4a')]&&!_0x579faf[_0x2d2b('0x4b')]&&_0x579faf[_0x2d2b('0x4c')]){_0x579faf[_0x2d2b('0x47')]+=0x1;if(_0x579faf[_0x2d2b('0x44')]){_0x579faf[_0x2d2b('0x44')]-=0x1;}}else if(_0x579faf[_0x2d2b('0x4a')]&&_0x579faf[_0x2d2b('0x4b')]){_0x579faf['answered']+=0x1;if(_0x579faf[_0x2d2b('0x45')]){_0x579faf['talking']-=0x1;}}_0x579faf[_0x2d2b('0x49')]+=0x1;_0x5e7328(_0x579faf);});}exports['index']=function(_0xda6dd7,_0x429b59){var _0x45706e={},_0x4d245c={},_0x1f74c6={'count':0x0,'rows':[]};var _0x9b98ad=_[_0x2d2b('0x4d')](db[_0x2d2b('0x4e')]['rawAttributes'],function(_0x1a9db1){return{'name':_0x1a9db1[_0x2d2b('0x4f')],'type':_0x1a9db1['type'][_0x2d2b('0x50')]};});_0x4d245c[_0x2d2b('0x51')]=_[_0x2d2b('0x4d')](_0x9b98ad,'name');_0x4d245c[_0x2d2b('0x52')]=_[_0x2d2b('0x53')](_0xda6dd7[_0x2d2b('0x52')]);_0x4d245c['filters']=_[_0x2d2b('0x54')](_0x4d245c[_0x2d2b('0x51')],_0x4d245c['query']);_0x45706e[_0x2d2b('0x55')]=_[_0x2d2b('0x54')](_0x4d245c['model'],qs['fields'](_0xda6dd7[_0x2d2b('0x52')][_0x2d2b('0x56')]));_0x45706e[_0x2d2b('0x55')]=_0x45706e[_0x2d2b('0x55')][_0x2d2b('0x57')]?_0x45706e['attributes']:_0x4d245c[_0x2d2b('0x51')];if(!_0xda6dd7[_0x2d2b('0x52')]['hasOwnProperty'](_0x2d2b('0x58'))){_0x45706e[_0x2d2b('0x2d')]=qs[_0x2d2b('0x2d')](_0xda6dd7[_0x2d2b('0x52')]['limit']);_0x45706e[_0x2d2b('0x2f')]=qs[_0x2d2b('0x2f')](_0xda6dd7[_0x2d2b('0x52')]['offset']);}_0x45706e[_0x2d2b('0x59')]=qs['sort'](_0xda6dd7[_0x2d2b('0x52')][_0x2d2b('0x5a')]);_0x45706e[_0x2d2b('0x5b')]=qs[_0x2d2b('0x5c')](_['pick'](_0xda6dd7['query'],_0x4d245c[_0x2d2b('0x5c')]),_0x9b98ad);var _0x2fb01a=[];var _0x24a778=squel[_0x2d2b('0x5d')]()[_0x2d2b('0x5e')]('id')['field'](_0x2d2b('0x37'))[_0x2d2b('0x5e')](_0x2d2b('0x5f'))['from'](_0x2d2b('0x60'));var _0x5693b7=squel[_0x2d2b('0x5d')]()[_0x2d2b('0x5e')](_0x2d2b('0x61'))[_0x2d2b('0x5e')](_0x2d2b('0x62'))[_0x2d2b('0x5e')](_0x2d2b('0x63'))[_0x2d2b('0x64')](_0x2d2b('0x65'),'ui')[_0x2d2b('0x66')](_0x2d2b('0x67'),'u','u.id\x20=\x20ui.UserId');var _0x2e2d9c=squel['select']()[_0x2d2b('0x64')](_0x2d2b('0x68'),'i')[_0x2d2b('0x66')](_0x2d2b('0x69'),'c',_0x2d2b('0x6a'))[_0x2d2b('0x66')](_0x2d2b('0x67'),'o',_0x2d2b('0x6b'))[_0x2d2b('0x66')](_0x2d2b('0x6c'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x2d2b('0x66')]('chat_messages','me',_0x2d2b('0x6d'))[_0x2d2b('0x66')]('chat_interaction_has_tags','it','it.ChatInteractionId\x20=\x20i.id')['left_join'](_0x2d2b('0x60'),'t',_0x2d2b('0x6e'));var _0x347a3f=squel[_0x2d2b('0x6f')]();var _0x3faef0=[];var _0x2b2a94=squel['expr']();var _0x2900bc;if(_0xda6dd7[_0x2d2b('0x52')]['search']){_0x2900bc=as['parseSearch'](_0xda6dd7['query'][_0x2d2b('0x70')]);var _0x157f70=_0x2900bc[_0x2d2b('0x71')];for(var _0xdee116=0x0;_0xdee116<_0x2900bc['conditions'][_0x2d2b('0x57')];_0xdee116++){var _0x86d8a4=_0x2900bc[_0x2d2b('0x72')][_0xdee116];var _0xfb4882='i';var _0xab7972=_[_0x2d2b('0x73')](_0x9b98ad,[_0x2d2b('0x37'),_0x86d8a4[_0x2d2b('0x5e')]]);if(!_0xab7972){switch(_0x86d8a4[_0x2d2b('0x5e')]){case _0x2d2b('0x74'):if(_0x86d8a4[_0x2d2b('0x75')]==0x1){_0x2e2d9c[_0x2d2b('0x76')]('`'+_0x86d8a4[_0x2d2b('0x5e')]+_0x2d2b('0x77'));}else{_0x2e2d9c[_0x2d2b('0x76')]('`'+_0x86d8a4[_0x2d2b('0x5e')]+_0x2d2b('0x78'));}break;case _0x2d2b('0x79'):if(_0x86d8a4['operator']===_0x2d2b('0x7a')){if(_0x86d8a4[_0x2d2b('0x75')][_0x2d2b('0x41')]('\x20')['length']>0x1){_0x347a3f[_0x157f70](_0x2d2b('0x7b'),qs[_0x2d2b('0x7c')](_0x86d8a4[_0x2d2b('0x75')]),null);}else{var _0x15065d='%'+_0x86d8a4[_0x2d2b('0x75')]+'%';_0x347a3f[_0x157f70](_0x2d2b('0x7d'),_0x15065d,_0x15065d,_0x15065d);}}else{_0xab7972=_[_0x2d2b('0x73')](_0x9b98ad,[_0x2d2b('0x37'),'ContactId']);_0x86d8a4[_0x2d2b('0x5e')]=_0x2d2b('0x7e');_0xf07f5e=as['buildExpression'](_0xfb4882,_0xab7972[_0x2d2b('0x7f')],_0x86d8a4);_0x347a3f[_0x157f70](_0xf07f5e[_0x2d2b('0x80')],_0xf07f5e[_0x2d2b('0x75')]['start'],_0xf07f5e[_0x2d2b('0x75')][_0x2d2b('0x2b')]);}break;case _0x2d2b('0x81'):var _0x347cb6=_0x86d8a4[_0x2d2b('0x75')][_0x2d2b('0x41')](',')[_0x2d2b('0x4d')](function(_0x4d1f8d){return Number(_0x4d1f8d);});_0x347cb6[_0x2d2b('0x42')](function(_0x7fc0a){_0x2b2a94['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x7fc0a+',%');});_0x3faef0=_['union'](_0x3faef0,_0x347cb6);break;case _0x2d2b('0x82'):if(_0x86d8a4['operator']===_0x2d2b('0x7a')){_0x347a3f[_0x157f70](_0x2d2b('0x83'),'%'+_0x86d8a4[_0x2d2b('0x75')]+'%',null);}else{_0xab7972=_['find'](_0x9b98ad,['name',_0x2d2b('0x4b')]);_0x86d8a4[_0x2d2b('0x5e')]='UserId';_0xf07f5e=as['buildExpression'](_0xfb4882,_0xab7972[_0x2d2b('0x7f')],_0x86d8a4);_0x347a3f[_0x157f70](_0xf07f5e[_0x2d2b('0x80')],_0xf07f5e['value'][_0x2d2b('0x84')],_0xf07f5e[_0x2d2b('0x75')][_0x2d2b('0x2b')]);}break;case _0x2d2b('0x85'):_0xf07f5e=as[_0x2d2b('0x86')]('me',null,_0x86d8a4);_0x347a3f[_0x157f70](_0xf07f5e[_0x2d2b('0x80')],_0xf07f5e[_0x2d2b('0x75')][_0x2d2b('0x84')],_0xf07f5e[_0x2d2b('0x75')][_0x2d2b('0x2b')]);break;}}else{var _0xf07f5e=as[_0x2d2b('0x86')](_0xfb4882,_0xab7972[_0x2d2b('0x7f')],_0x86d8a4);_0x347a3f[_0x157f70](_0xf07f5e[_0x2d2b('0x80')],_0xf07f5e['value'][_0x2d2b('0x84')],_0xf07f5e[_0x2d2b('0x75')][_0x2d2b('0x2b')]);}}}else{var _0x2ccdbd=_(_0xda6dd7['query'])[_0x2d2b('0x53')]()['map'](function(_0x50d200){return _[_0x2d2b('0x87')](_0x9b98ad,[_0x2d2b('0x37'),_0x50d200])?_0x50d200:undefined;})['compact']()[_0x2d2b('0x75')]();if(!_[_0x2d2b('0x88')](_0x2ccdbd)){_0x2ccdbd[_0x2d2b('0x42')](function(_0x52466a){if(_0x52466a===_0x2d2b('0x89')){_0x2e2d9c[_0x2d2b('0x5b')](_0x2d2b('0x8a'),[][_0x2d2b('0x8b')](_0xda6dd7[_0x2d2b('0x52')][_0x52466a]));}else if(_0x52466a===_0x2d2b('0x8c')){var _0x5e4ab5=JSON[_0x2d2b('0x8d')](_0xda6dd7['query'][_0x52466a])[_0x2d2b('0x8e')];var _0x319591=JSON[_0x2d2b('0x8d')](_0xda6dd7[_0x2d2b('0x52')][_0x52466a])[_0x2d2b('0x8f')];_0x2e2d9c[_0x2d2b('0x5b')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5e4ab5,_0x319591);}else{if(_0xda6dd7['query'][_0x52466a]===_0x2d2b('0x90')){_0x2e2d9c['where']('i.'+_0x52466a+_0x2d2b('0x91'));}else{_0x2e2d9c['where']('i.'+_0x52466a+_0x2d2b('0x92'),_0xda6dd7[_0x2d2b('0x52')][_0x52466a]);}}});}if(_0xda6dd7[_0x2d2b('0x52')][_0x2d2b('0x93')]){if(_0xda6dd7[_0x2d2b('0x52')][_0x2d2b('0x93')]==0x1){_0x2e2d9c[_0x2d2b('0x76')](_0x2d2b('0x94'));}else{_0x2e2d9c['having'](_0x2d2b('0x95'));}}if(_0xda6dd7['query'][_0x2d2b('0x96')]){_0x3faef0=_['isArray'](_0xda6dd7[_0x2d2b('0x52')]['tag'])?_0xda6dd7[_0x2d2b('0x52')][_0x2d2b('0x96')]:new Array(_0xda6dd7[_0x2d2b('0x52')][_0x2d2b('0x96')]);_0x3faef0[_0x2d2b('0x42')](function(_0x52efe4){_0x2b2a94['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x52efe4+',%');});}if(_0xda6dd7[_0x2d2b('0x52')][_0x2d2b('0x97')]){var _0x5483d3=_0xda6dd7[_0x2d2b('0x52')][_0x2d2b('0x97')][_0x2d2b('0x98')]('\x5c','\x5c\x5c')[_0x2d2b('0x98')](/'/g,'\x27\x27');if(qs[_0x2d2b('0x99')](_0x5483d3)){_0x347a3f['or'](_0x2d2b('0x9a'),_0x5483d3+'%');}else{_0x347a3f['or'](_0x2d2b('0x9b'),qs[_0x2d2b('0x7c')](_0x5483d3))['or'](_0x2d2b('0x9c'),_0x5483d3+'%');}}}_0x2e2d9c[_0x2d2b('0x5b')](_0x347a3f);_0x2e2d9c[_0x2d2b('0x9d')](_0x2d2b('0x9e'));var _0x4dce12={'type':db[_0x2d2b('0x9f')][_0x2d2b('0xa0')][_0x2d2b('0xa1')],'raw':!![]};var _0x2e9d37=_0x2e2d9c[_0x2d2b('0xa2')]();_0x2e9d37[_0x2d2b('0x5e')](_0x2d2b('0x9e'));_0x2e9d37[_0x2d2b('0x5e')](_0x2d2b('0xa3'),_0x2d2b('0x74'));if(_0x45706e[_0x2d2b('0x59')]){_0x45706e[_0x2d2b('0x59')][_0x2d2b('0x42')](function(_0x2f0c98){var _0x131715=_0x2f0c98[0x0]==='contactName'?_0x2f0c98[0x0]:'i.'+_0x2f0c98[0x0];_0x2e2d9c[_0x2d2b('0x59')](_0x131715,_0x2f0c98[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x3faef0)){_0x2e2d9c[_0x2d2b('0x76')](_0x2b2a94);_0x2e9d37[_0x2d2b('0x5b')]('t.id\x20IN\x20?',_0x3faef0);}BPromise[_0x2d2b('0xa4')]()['then'](function(){if(!_0x2900bc){if(_0xda6dd7[_0x2d2b('0x52')][_0x2d2b('0x89')])return;_0x2e9d37[_0x2d2b('0x5b')](_0x2d2b('0xa5'));_0x2e2d9c[_0x2d2b('0x5b')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0xda6dd7[_0x2d2b('0xa6')]['role']!==_0x2d2b('0x3c'))return;return _0xda6dd7[_0x2d2b('0xa6')]['getChatWebsites']({'attributes':['id'],'raw':!![]})[_0x2d2b('0x34')](function(_0x4812f8){if(_[_0x2d2b('0x88')](_0x4812f8)){_0x2e9d37[_0x2d2b('0x5b')](_0x2d2b('0xa7'));_0x2e2d9c[_0x2d2b('0x5b')](_0x2d2b('0xa7'));}else{_0x2e9d37['where'](_0x2d2b('0x8a'),_[_0x2d2b('0x4d')](_0x4812f8,'id'));_0x2e2d9c[_0x2d2b('0x5b')](_0x2d2b('0x8a'),_[_0x2d2b('0x4d')](_0x4812f8,'id'));}});})[_0x2d2b('0x34')](function(){if(_0xda6dd7[_0x2d2b('0xa6')]['role']===_0x2d2b('0x3c')&&!_0x2900bc&&!_0xda6dd7[_0x2d2b('0x52')][_0x2d2b('0x89')])return[];return db[_0x2d2b('0xa8')]['query'](_0x2e9d37[_0x2d2b('0xa9')](),_0x4dce12);})[_0x2d2b('0x34')](function(_0x392d09){_0x1f74c6[_0x2d2b('0x2e')]=_0x392d09[_0x2d2b('0x57')];if(_0x1f74c6[_0x2d2b('0x2e')]===0x0)return[];return db['sequelize']['query'](_0x24a778['toString'](),_0x4dce12)[_0x2d2b('0x34')](function(_0x48d068){_0x2fb01a=_[_0x2d2b('0xaa')](_0x48d068,'id');_0x4dce12=_['merge'](_0x4dce12,{'model':db[_0x2d2b('0x4e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xda6dd7[_0x2d2b('0x52')][_0x2d2b('0x56')]){_0x45706e[_0x2d2b('0x55')][_0x2d2b('0x42')](function(_0x32b0f4){_0x2e2d9c[_0x2d2b('0x5e')]('i.'+_0x32b0f4);});}else{_0x2e2d9c['field'](_0x2d2b('0xa3'),_0x2d2b('0x74'));_0x2e2d9c[_0x2d2b('0x5e')](_0x2d2b('0xab'),_0x2d2b('0xac'));_0x2e2d9c[_0x2d2b('0x5e')](_0x2d2b('0xad'),_0x2d2b('0xae'));_0x2e2d9c['field'](_0x2d2b('0xaf'),_0x2d2b('0xb0'));_0x2e2d9c[_0x2d2b('0x5e')]('i.*');_0x2e2d9c[_0x2d2b('0x5e')]('c.firstName',_0x2d2b('0xb1'));_0x2e2d9c['field'](_0x2d2b('0xb2'),_0x2d2b('0xb3'));_0x2e2d9c[_0x2d2b('0x5e')](_0x2d2b('0xb4'),_0x2d2b('0xb5'));_0x2e2d9c[_0x2d2b('0x5e')](_0x2d2b('0xb6'),'Contact.phone');_0x2e2d9c[_0x2d2b('0x5e')](_0x2d2b('0xb7'),_0x2d2b('0xb8'));_0x2e2d9c['field']('c.fax',_0x2d2b('0xb9'));_0x2e2d9c[_0x2d2b('0x5e')](_0x2d2b('0xba'),_0x2d2b('0xbb'));_0x2e2d9c[_0x2d2b('0x5e')](_0x2d2b('0xbc'),_0x2d2b('0xbd'));_0x2e2d9c['field']('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x45706e[_0x2d2b('0x2d')])_0x2e2d9c[_0x2d2b('0x2d')](_0x45706e[_0x2d2b('0x2d')]);if(_0x45706e[_0x2d2b('0x2f')])_0x2e2d9c[_0x2d2b('0x2f')](_0x45706e['offset']);return db[_0x2d2b('0xa8')][_0x2d2b('0x52')](_0x2e2d9c[_0x2d2b('0xa9')](),_0x4dce12);})[_0x2d2b('0x34')](function(_0x5075c3){if(_0x5075c3[_0x2d2b('0x57')]>0x0)_0x5693b7['where'](_0x2d2b('0xbe'),_[_0x2d2b('0x4d')](_0x5075c3,'id'));return db[_0x2d2b('0xa8')][_0x2d2b('0x52')](_0x5693b7[_0x2d2b('0xa9')](),_0x4dce12)['then'](function(_0x3753f6){var _0x2fc0d0=_['groupBy'](_0x3753f6,_0x2d2b('0xbf'));var _0x534d41=[];_0x5075c3['forEach'](function(_0x556439){_0x534d41[_0x2d2b('0x43')](updateChatInteraction(_0x556439,_0x2fb01a,_0x2fc0d0));});return BPromise[_0x2d2b('0xc0')](_0x534d41);});});})['then'](function(_0x2173df){_0x1f74c6[_0x2d2b('0xc1')]=_0x2173df;return _0x1f74c6;})[_0x2d2b('0x34')](respondWithFilteredResult(_0x429b59,_0x45706e))[_0x2d2b('0x28')](handleError(_0x429b59,null));};exports['show']=function(_0x3a4c7a,_0x4aab66){var _0x817f0b={'raw':![],'where':{'id':_0x3a4c7a[_0x2d2b('0xc2')]['id']}},_0x363488={};_0x363488[_0x2d2b('0x51')]=_[_0x2d2b('0x53')](db['ChatInteraction'][_0x2d2b('0xc3')]);_0x363488[_0x2d2b('0x52')]=_[_0x2d2b('0x53')](_0x3a4c7a[_0x2d2b('0x52')]);_0x363488['filters']=_[_0x2d2b('0x54')](_0x363488[_0x2d2b('0x51')],_0x363488[_0x2d2b('0x52')]);_0x817f0b[_0x2d2b('0x55')]=_['intersection'](_0x363488['model'],qs['fields'](_0x3a4c7a[_0x2d2b('0x52')][_0x2d2b('0x56')]));_0x817f0b['attributes']=_0x817f0b[_0x2d2b('0x55')]['length']?_0x817f0b[_0x2d2b('0x55')]:_0x363488['model'];if(_0x3a4c7a[_0x2d2b('0x52')][_0x2d2b('0xc4')]){_0x817f0b['include']=[{'all':!![]}];}_0x817f0b=_[_0x2d2b('0x3a')]({},_0x817f0b,_0x3a4c7a['options']);return db[_0x2d2b('0x4e')]['find'](_0x817f0b)[_0x2d2b('0x34')](handleEntityNotFound(_0x4aab66,null))[_0x2d2b('0x34')](respondWithResult(_0x4aab66,null))[_0x2d2b('0x28')](handleError(_0x4aab66,null));};exports[_0x2d2b('0xc5')]=function(_0x5bcd8f,_0x538e2b){return db['ChatInteraction'][_0x2d2b('0xc5')](_0x5bcd8f[_0x2d2b('0x85')],{})[_0x2d2b('0x34')](respondWithResult(_0x538e2b,0xc9))[_0x2d2b('0x28')](handleError(_0x538e2b,null));};exports[_0x2d2b('0x33')]=function(_0xc3fa04,_0x48626a){if(_0xc3fa04['body']['id']){delete _0xc3fa04[_0x2d2b('0x85')]['id'];}return db[_0x2d2b('0x4e')][_0x2d2b('0x73')]({'where':{'id':_0xc3fa04[_0x2d2b('0xc2')]['id']}})[_0x2d2b('0x34')](handleEntityNotFound(_0x48626a,null))[_0x2d2b('0x34')](saveUpdates(_0xc3fa04[_0x2d2b('0x85')],null))[_0x2d2b('0x34')](respondWithResult(_0x48626a,null))[_0x2d2b('0x28')](handleError(_0x48626a,null));};exports[_0x2d2b('0x35')]=function(_0x257c73,_0xdbc548){return db[_0x2d2b('0x4e')][_0x2d2b('0x73')]({'where':{'id':_0x257c73[_0x2d2b('0xc2')]['id']}})['then'](handleEntityNotFound(_0xdbc548,null))['then'](removeEntity(_0xdbc548,null))[_0x2d2b('0x28')](handleError(_0xdbc548,null));};exports[_0x2d2b('0xc6')]=function(_0xefb51e,_0x2b6607){return db[_0x2d2b('0x4e')][_0x2d2b('0xc6')]()['then'](respondWithResult(_0x2b6607,null))['catch'](handleError(_0x2b6607,null));};exports[_0x2d2b('0xc7')]=function(_0x470bd3,_0x4cb93a){var _0x297a4c=_0x470bd3[_0x2d2b('0xc2')]['id'];var _0x19798c;var _0x3157e1;var _0x54f7cc;return db['ChatInteraction']['findOne']({'where':{'id':_0x297a4c}})['then'](function(_0x54d7f8){_0x19798c=_0x54d7f8;return db[_0x2d2b('0xc8')][_0x2d2b('0xc9')]({'where':{'id':_0x54d7f8[_0x2d2b('0x89')]},'attributes':['id',_0x2d2b('0xca'),_0x2d2b('0xcb'),_0x2d2b('0xcc'),_0x2d2b('0xcd'),_0x2d2b('0xce')],'raw':!![]});})['then'](function(_0x2f6a78){if(_0x2f6a78&&_0x2f6a78[_0x2d2b('0xca')]&&_0x2f6a78['vidaooEscalation']){_0x3157e1=_0x2f6a78;var _0x36a13a={'interaction':{'id':_0x297a4c},'agent':{'id':_0x470bd3[_0x2d2b('0xa6')]['id'],'name':_0x470bd3[_0x2d2b('0xa6')][_0x2d2b('0x37')],'fullname':_0x470bd3[_0x2d2b('0xa6')]['fullname'],'email':_0x470bd3[_0x2d2b('0xa6')][_0x2d2b('0xcf')]},'contact':_0x470bd3['body'][_0x2d2b('0x3b')],'account':_0x470bd3[_0x2d2b('0x85')]['account']};var _0x28618f={'rejectUnauthorized':![],'method':'POST','url':_0x2d2b('0xd0'),'headers':{'X-APIKEY':_0x2f6a78[_0x2d2b('0xca')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x470bd3[_0x2d2b('0xa6')]['email']],'buttons':null,'topic':_0x3157e1['vidaooTopic'],'note':_[_0x2d2b('0xd1')](_0x3157e1[_0x2d2b('0xcd')])?null:getMustacheRender(_0x3157e1[_0x2d2b('0xcd')],_0x36a13a),'metadata':null},'redirect':_0x2d2b('0xd2'),'json':!![]};try{if(!_['isNull'](_0x3157e1[_0x2d2b('0xce')])){var _0x2139ce=getMustacheRender(_0x3157e1[_0x2d2b('0xce')],_0x36a13a);var _0x218ac9=JSON['parse'](_0x2139ce);_0x28618f[_0x2d2b('0x85')][_0x2d2b('0xd3')]=_0x218ac9;}}catch(_0x1187fb){throw new db[(_0x2d2b('0x9f'))]['ValidationError'](_0x2d2b('0xd4'));}return rp(_0x28618f);}else{throw new db[(_0x2d2b('0x9f'))][(_0x2d2b('0xd5'))](_0x2d2b('0xd6'));}})['then'](function(_0x536d02){_0x54f7cc=_0x536d02;if(_0x54f7cc['id']){var _0x5f41fb={'body':_0x54f7cc[_0x2d2b('0xd7')],'ChatWebsiteId':_0x3157e1['id'],'ChatInteractionId':_0x19798c['id'],'direction':_0x2d2b('0xd8'),'UserId':_0x470bd3[_0x2d2b('0xa6')]['id']};return db['ChatMessage'][_0x2d2b('0xc5')](_0x5f41fb,{});}else{throw new db[(_0x2d2b('0x9f'))][(_0x2d2b('0xd5'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x2d2b('0x34')](function(){return _0x19798c[_0x2d2b('0xd9')]({'vidaooSessionId':_0x54f7cc['id']});})[_0x2d2b('0x34')](respondWithResult(_0x4cb93a,null))['catch'](handleError(_0x4cb93a,null));};exports[_0x2d2b('0xda')]=function(_0x34fbd9,_0x57534){if(_0x34fbd9[_0x2d2b('0x85')]['id']){delete _0x34fbd9[_0x2d2b('0x85')]['id'];}return db[_0x2d2b('0x4e')][_0x2d2b('0x73')]({'where':{'id':_0x34fbd9[_0x2d2b('0xc2')]['id']},'include':[{'model':db[_0x2d2b('0xdb')],'as':_0x2d2b('0x79')}]})['then'](handleEntityNotFound(_0x57534,null))[_0x2d2b('0x34')](saveUpdates(_0x34fbd9[_0x2d2b('0x85')],null))[_0x2d2b('0x34')](respondWithResult(_0x57534,null))[_0x2d2b('0x28')](handleError(_0x57534,null));};exports[_0x2d2b('0xdc')]=function(_0x461448,_0x12b18e,_0x4a5920){if(_0x461448[_0x2d2b('0x85')]['id']){delete _0x461448[_0x2d2b('0x85')]['id'];}return db[_0x2d2b('0x4e')][_0x2d2b('0x73')]({'where':{'id':_0x461448[_0x2d2b('0xc2')]['id']}})[_0x2d2b('0x34')](function(_0x375774){if(!_0x375774){logger[_0x2d2b('0x25')](_0x2d2b('0xdd'),_0x2d2b('0xdc'),0x194,'entity\x20not\x20found');_0x12b18e['sendStatus'](0x194);}else{if(_0x375774[_0x2d2b('0x4b')]){throw new db[(_0x2d2b('0x9f'))][(_0x2d2b('0xd5'))](_0x2d2b('0xde'));}}return _0x375774;})[_0x2d2b('0x34')](function(_0x4c6cec){if(_0x4c6cec){return _0x4c6cec[_0x2d2b('0x33')]({'closed':_0x461448[_0x2d2b('0x85')][_0x2d2b('0x4a')],'disposition':_0x461448[_0x2d2b('0x85')]['disposition']})['then'](function(_0x2fb1f9){return _0x2fb1f9;});}})[_0x2d2b('0x34')](function(_0x3326c5){return respondWithRpcPromise(_0x2d2b('0xdf'),'abandon',_0x461448[_0x2d2b('0x85')],client9004);})['then'](respondWithResult(_0x12b18e,null))[_0x2d2b('0x28')](handleError(_0x12b18e,null));};exports[_0x2d2b('0xe0')]=function(_0x49f50f,_0x1bcbea,_0x4a2066){_0x49f50f[_0x2d2b('0x85')][_0x2d2b('0x37')]=_0x49f50f['file'][_0x2d2b('0xe1')];_0x49f50f[_0x2d2b('0x85')][_0x2d2b('0xe2')]=_0x49f50f[_0x2d2b('0xe3')][_0x2d2b('0xe4')];_0x49f50f[_0x2d2b('0x85')][_0x2d2b('0x7f')]=_0x49f50f['file'][_0x2d2b('0xe5')];return db[_0x2d2b('0xe6')][_0x2d2b('0xc5')](_0x49f50f[_0x2d2b('0x85')])[_0x2d2b('0x34')](respondWithResult(_0x1bcbea,0xc9))['catch'](handleError(_0x1bcbea,null));};exports[_0x2d2b('0xe7')]=function(_0x199c2a,_0xaa092b,_0x4346d2){return db['ChatInteraction'][_0x2d2b('0xc9')]({'where':{'id':_0x199c2a[_0x2d2b('0xc2')]['id']},'raw':!![]})[_0x2d2b('0x34')](handleEntityNotFound(_0xaa092b,null))[_0x2d2b('0x34')](function(_0x481fbd){if(_0x481fbd){if(_0x481fbd['closed']){return _0xaa092b[_0x2d2b('0x2a')](0x193)['json']({'status':0x193,'message':_0x2d2b('0xe8')});}return db[_0x2d2b('0xe6')]['findOne']({'where':{'id':_0x199c2a[_0x2d2b('0x52')]['attachId']},'raw':!![]})[_0x2d2b('0x34')](handleEntityNotFound(_0xaa092b,null));}})['then'](function(_0x19d14d){if(_0x19d14d){var _0x37ea6a=_0x19d14d[_0x2d2b('0xe9')]!==null;var _0x32e0df=path['join'](config[_0x2d2b('0xea')],_0x2d2b('0xeb'));if(_0x37ea6a){_0x32e0df=path[_0x2d2b('0xec')](_0x32e0df,_0x2d2b('0xed'));}var _0x3cddce=path[_0x2d2b('0xec')](_0x32e0df,_0x19d14d[_0x2d2b('0xe2')]);return _0xaa092b[_0x2d2b('0xee')](_0x3cddce);}})['catch'](handleError(_0xaa092b,null));};exports[_0x2d2b('0xef')]=function(_0x447fc6,_0x455145){var _0x358e69=null;var _0x2fa814=null;var _0x151c16=null;var _0x53f2ed=null;if(_0x447fc6[_0x2d2b('0x85')]['id']){delete _0x447fc6[_0x2d2b('0x85')]['id'];}if(_0x447fc6['body']['mailTranscript']){_0x53f2ed=path['join'](config[_0x2d2b('0xea')],_0x2d2b('0xf0'),util['format'](_0x2d2b('0xf1'),Date[_0x2d2b('0xf2')]()));_0x447fc6[_0x2d2b('0x85')][_0x2d2b('0xf3')]=_0x53f2ed;}return db[_0x2d2b('0x4e')][_0x2d2b('0x73')]({'where':{'id':_0x447fc6['params']['id']},'include':[{'model':db[_0x2d2b('0xf4')],'as':_0x2d2b('0xf5'),'include':[{'model':db[_0x2d2b('0x82')],'as':_0x2d2b('0x82')}]}]})['then'](handleEntityNotFound(_0x455145,null))['then'](saveUpdates(_0x447fc6[_0x2d2b('0x85')],null))[_0x2d2b('0x34')](function(_0x4c53a5){if(_0x4c53a5){_0x358e69=_0x4c53a5;return db[_0x2d2b('0xc8')]['find']({'where':{'id':_0x358e69[_0x2d2b('0x89')]}});}})[_0x2d2b('0x34')](function(_0x1b0893){if(_0x1b0893){_0x151c16=_0x1b0893;return db[_0x2d2b('0xdb')][_0x2d2b('0x73')]({'where':{'id':_0x358e69[_0x2d2b('0x7e')]}});}})[_0x2d2b('0x34')](function(_0x2d5af3){if(_0x2d5af3){_0x2fa814=_0x2d5af3;if(_0x53f2ed){var _0x353c45=null;for(var _0x46a3bd=0x1;_0x46a3bd<_0x358e69[_0x2d2b('0xf5')]['length'];++_0x46a3bd){_0x353c45=_0x358e69['Messages'][_0x46a3bd];var _0x379756=_0x353c45['UserId']?util[_0x2d2b('0xf6')]('%s%d',_0x151c16['agentAlias'],_0x353c45[_0x2d2b('0x4b')]):_0x2d2b('0xf7');var _0x4bf65c=_0x447fc6[_0x2d2b('0x85')][_0x2d2b('0xf8')]||util[_0x2d2b('0xf6')]('%s%d',_0x2d2b('0xf9'),_0x353c45[_0x2d2b('0x7e')]);switch(_0x151c16[_0x2d2b('0xfa')]){case'website_alias':_0x379756=_0x353c45['UserId']?util[_0x2d2b('0xf6')](_0x2d2b('0xfb'),_0x151c16[_0x2d2b('0xfc')],_0x353c45[_0x2d2b('0x4b')]):'System';break;case _0x2d2b('0xfd'):_0x379756=_0x353c45[_0x2d2b('0x4b')]?_0x353c45[_0x2d2b('0x82')]['alias']||_0x353c45[_0x2d2b('0x82')][_0x2d2b('0x3e')]:_0x2d2b('0xf7');break;case _0x2d2b('0xfe'):_0x379756=_0x353c45[_0x2d2b('0x4b')]?_0x353c45['User']['fullname']:'System';break;default:_0x379756=_0x353c45[_0x2d2b('0x4b')]?util['format'](_0x2d2b('0xfb'),_0x151c16[_0x2d2b('0xfc')],_0x353c45[_0x2d2b('0x4b')]):_0x2d2b('0xf7');}var _0x20143c=util[_0x2d2b('0xf6')]('[%s]\x20%s:\x20%s\x0a',moment(_0x353c45[_0x2d2b('0x8c')])[_0x2d2b('0xf6')](_0x2d2b('0xff')),_0x353c45[_0x2d2b('0x100')]==='in'?_0x4bf65c:_0x379756,_0x353c45[_0x2d2b('0x85')]);if(!_0x353c45[_0x2d2b('0x101')]){fs[_0x2d2b('0x102')](_0x53f2ed,_0x20143c);}}return db[_0x2d2b('0x103')][_0x2d2b('0xc9')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x2d2b('0x104'),'raw':!![]}]});}}})[_0x2d2b('0x34')](function(_0x4753a4){if(_0x4753a4&&_0x4753a4[_0x2d2b('0x104')]&&_0x447fc6[_0x2d2b('0x85')]){var _0x552434={'tls':{'rejectUnauthorized':![]}};if(_0x4753a4[_0x2d2b('0x104')][_0x2d2b('0x105')]){_0x552434['service']=_0x4753a4['Smtp'][_0x2d2b('0x105')];}else{_0x552434[_0x2d2b('0x106')]=_0x4753a4[_0x2d2b('0x104')][_0x2d2b('0x106')];_0x552434[_0x2d2b('0x107')]=_0x4753a4['Smtp'][_0x2d2b('0x107')];_0x552434[_0x2d2b('0x108')]=_0x4753a4[_0x2d2b('0x104')]['secure'];}if(_0x4753a4[_0x2d2b('0x104')]['authentication']){_0x552434['auth']={'user':_0x4753a4[_0x2d2b('0x104')][_0x2d2b('0xa6')],'pass':_0x4753a4[_0x2d2b('0x104')]['pass']};}return respondWithRpcPromise(_0x2d2b('0x109'),_0x2d2b('0x10a'),{'account':_0x552434,'message':{'from':util[_0x2d2b('0xf6')]('\x22%s\x22\x20<%s>',_0x4753a4[_0x2d2b('0x37')],_0x4753a4[_0x2d2b('0xcf')]||_0x4753a4['Smtp'][_0x2d2b('0xa6')]),'to':_0x447fc6['body'][_0x2d2b('0x10b')],'subject':_0x2d2b('0x10c'),'text':util[_0x2d2b('0xf6')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x447fc6[_0x2d2b('0x85')][_0x2d2b('0x10b')]),'attachments':[{'path':_0x53f2ed}]}})[_0x2d2b('0x34')](function(){return _0x358e69;})[_0x2d2b('0x28')](function(_0x24a53f){console['error'](_0x24a53f);});}else{return _0x358e69;}})['then'](respondWithStatusCode(_0x455145,0xc8))[_0x2d2b('0x28')](handleError(_0x455145,null));};exports[_0x2d2b('0x10d')]=function(_0x17ca8c,_0x3afdbb,_0x396a87){return db['ChatMessage']['find']({'where':{'id':_0x17ca8c[_0x2d2b('0xc2')]['id']}})[_0x2d2b('0x34')](handleEntityNotFound(_0x3afdbb,null))[_0x2d2b('0x34')](function(_0x2aea76){if(_0x2aea76){return _0x2aea76[_0x2d2b('0x10d')](_0x17ca8c['body'][_0x2d2b('0x10e')],_[_0x2d2b('0x10f')](_0x17ca8c[_0x2d2b('0x85')],['ids','id'])||{});}})['then'](respondWithResult(_0x3afdbb,null))[_0x2d2b('0x28')](handleError(_0x3afdbb,null));};exports[_0x2d2b('0x110')]=function(_0x17a5ef,_0x2c6ddb,_0x38731b){var _0x5b88d8={'raw':![],'where':{}};var _0x5c865d={};var _0x30769f={'count':0x0,'rows':[]};return db[_0x2d2b('0x4e')][_0x2d2b('0xc9')]({'where':{'id':_0x17a5ef['params']['id']}})[_0x2d2b('0x34')](handleEntityNotFound(_0x2c6ddb,null))[_0x2d2b('0x34')](function(_0x45cad8){if(_0x45cad8){_0x5c865d['model']=_[_0x2d2b('0x53')](db[_0x2d2b('0xf4')][_0x2d2b('0xc3')]);_0x5c865d[_0x2d2b('0x52')]=_[_0x2d2b('0x53')](_0x17a5ef[_0x2d2b('0x52')]);_0x5c865d[_0x2d2b('0x5c')]=_[_0x2d2b('0x54')](_0x5c865d[_0x2d2b('0x51')],_0x5c865d[_0x2d2b('0x52')]);_0x5b88d8['attributes']=_[_0x2d2b('0x54')](_0x5c865d[_0x2d2b('0x51')],qs[_0x2d2b('0x56')](_0x17a5ef[_0x2d2b('0x52')]['fields']));_0x5b88d8['attributes']=_0x5b88d8['attributes'][_0x2d2b('0x57')]?_0x5b88d8[_0x2d2b('0x55')]:_0x5c865d[_0x2d2b('0x51')];if(!_0x17a5ef[_0x2d2b('0x52')][_0x2d2b('0x111')](_0x2d2b('0x58'))){_0x5b88d8[_0x2d2b('0x2d')]=qs[_0x2d2b('0x2d')](_0x17a5ef[_0x2d2b('0x52')][_0x2d2b('0x2d')]);_0x5b88d8[_0x2d2b('0x2f')]=qs[_0x2d2b('0x2f')](_0x17a5ef[_0x2d2b('0x52')][_0x2d2b('0x2f')]);}_0x5b88d8[_0x2d2b('0x59')]=qs[_0x2d2b('0x5a')](_0x17a5ef['query'][_0x2d2b('0x5a')]);_0x5b88d8[_0x2d2b('0x5b')]=qs[_0x2d2b('0x5c')](_[_0x2d2b('0x112')](_0x17a5ef[_0x2d2b('0x52')],_0x5c865d[_0x2d2b('0x5c')]));_0x5b88d8[_0x2d2b('0x5b')][_0x2d2b('0xbf')]=_0x45cad8['id'];if(_0x17a5ef[_0x2d2b('0x52')]['filter']){_0x5b88d8[_0x2d2b('0x5b')]=_['merge'](_0x5b88d8[_0x2d2b('0x5b')],{'$or':_[_0x2d2b('0x4d')](_0x5b88d8['attributes'],function(_0x1a3449){var _0x115398={};_0x115398[_0x1a3449]={'$like':'%'+_0x17a5ef[_0x2d2b('0x52')][_0x2d2b('0x97')]+'%'};return _0x115398;})});}if(_0x17a5ef[_0x2d2b('0x52')]['$gte']){var _0x14f2b5=_0x17a5ef['query'][_0x2d2b('0x8e')][_0x2d2b('0x41')](',');var _0x5cf844={};_0x5cf844[_0x14f2b5[0x0]]={'$gte':moment(_0x14f2b5[0x1])[_0x2d2b('0xf6')]('YYYY-MM-DD\x20HH:mm:ss')};_0x5b88d8[_0x2d2b('0x5b')]=_[_0x2d2b('0x3a')](_0x5b88d8[_0x2d2b('0x5b')],_0x5cf844);}_0x5b88d8=_[_0x2d2b('0x3a')]({},_0x5b88d8,_0x17a5ef[_0x2d2b('0x113')]);return db['ChatMessage'][_0x2d2b('0x2e')]({'where':_0x5b88d8[_0x2d2b('0x5b')]})[_0x2d2b('0x34')](function(_0x382402){_0x30769f[_0x2d2b('0x2e')]=_0x382402;if(_0x17a5ef[_0x2d2b('0x52')][_0x2d2b('0xc4')]){_0x5b88d8[_0x2d2b('0x114')]=[{'all':!![]}];}return db['ChatMessage'][_0x2d2b('0x115')](_0x5b88d8);})['then'](function(_0x4356b5){_0x30769f[_0x2d2b('0xc1')]=_0x4356b5;return _0x30769f;});}})[_0x2d2b('0x34')](respondWithFilteredResult(_0x2c6ddb,_0x5b88d8))['catch'](handleError(_0x2c6ddb,null));};exports[_0x2d2b('0x116')]=function(_0x2d1d0d,_0x2c9038,_0x1a3373){var _0xe286e4={'where':{}},_0x3a97b4={},_0x4a5ab0={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x2d2b('0xc9')]({'where':{'id':_0x2d1d0d[_0x2d2b('0xc2')]['id']}})[_0x2d2b('0x34')](handleEntityNotFound(_0x2c9038,null))['then'](function(_0x4b1db8){if(_0x4b1db8){_0x3a97b4[_0x2d2b('0x51')]=_['keys'](db[_0x2d2b('0xf4')]['rawAttributes']);_0x3a97b4[_0x2d2b('0x52')]=_[_0x2d2b('0x53')](_0x2d1d0d[_0x2d2b('0x52')]);_0x3a97b4[_0x2d2b('0x5c')]=_[_0x2d2b('0x54')](_0x3a97b4['model'],_0x3a97b4[_0x2d2b('0x52')]);_0xe286e4[_0x2d2b('0x55')]=_[_0x2d2b('0x54')](_0x3a97b4['model'],qs[_0x2d2b('0x56')](_0x2d1d0d['query'][_0x2d2b('0x56')]));_0xe286e4[_0x2d2b('0x55')]=_0xe286e4[_0x2d2b('0x55')][_0x2d2b('0x57')]?_0xe286e4[_0x2d2b('0x55')]:_0x3a97b4[_0x2d2b('0x51')];if(!_0x2d1d0d[_0x2d2b('0x52')]['hasOwnProperty'](_0x2d2b('0x58'))){_0xe286e4[_0x2d2b('0x2d')]=qs[_0x2d2b('0x2d')](_0x2d1d0d[_0x2d2b('0x52')][_0x2d2b('0x2d')]);_0xe286e4[_0x2d2b('0x2f')]=qs['offset'](_0x2d1d0d['query'][_0x2d2b('0x2f')]);}_0xe286e4['order']=qs[_0x2d2b('0x5a')](_0x2d1d0d[_0x2d2b('0x52')]['sort']);_0xe286e4[_0x2d2b('0x5b')]=qs[_0x2d2b('0x5c')](_[_0x2d2b('0x112')](_0x2d1d0d[_0x2d2b('0x52')],_0x3a97b4[_0x2d2b('0x5c')]));_0xe286e4[_0x2d2b('0x5b')][_0x2d2b('0xbf')]=_0x4b1db8['id'];if(_0x2d1d0d[_0x2d2b('0x52')][_0x2d2b('0x97')]){_0xe286e4['where']=_[_0x2d2b('0x3a')](_0xe286e4[_0x2d2b('0x5b')],{'$or':_[_0x2d2b('0x4d')](_0xe286e4[_0x2d2b('0x55')],function(_0x2696a1){var _0xf09441={};_0xf09441[_0x2696a1]={'$like':'%'+_0x2d1d0d['query'][_0x2d2b('0x97')]+'%'};return _0xf09441;})});}_0xe286e4[_0x2d2b('0x5b')]['secret']=![];if(_0x2d1d0d[_0x2d2b('0x52')]['id']){_0xe286e4['where']['id']={'$gt':_0x2d1d0d[_0x2d2b('0x52')]['id']};}_0xe286e4=_[_0x2d2b('0x3a')]({},_0xe286e4,_0x2d1d0d[_0x2d2b('0x113')]);return db['ChatMessage'][_0x2d2b('0x2e')]({'where':_0xe286e4[_0x2d2b('0x5b')]})[_0x2d2b('0x34')](function(_0x428684){_0x4a5ab0[_0x2d2b('0x2e')]=_0x428684;_0xe286e4['include']=[];if(_0x2d1d0d[_0x2d2b('0x52')][_0x2d2b('0x117')]){_0xe286e4['include'][_0x2d2b('0x43')]({'model':db[_0x2d2b('0x82')],'as':'User','attributes':['id','fullname',_0x2d2b('0x118')]});}if(_0x2d1d0d[_0x2d2b('0x52')][_0x2d2b('0xc4')]){_0xe286e4['include']=[{'all':!![]}];}return db[_0x2d2b('0xf4')][_0x2d2b('0x115')](_0xe286e4);})['then'](function(_0x4e4b4b){_0x4a5ab0[_0x2d2b('0xc1')]=_0x4e4b4b;return _0x4a5ab0;});}})[_0x2d2b('0x34')](respondWithFilteredResult(_0x2c9038,_0xe286e4))[_0x2d2b('0x28')](handleError(_0x2c9038,null));};exports[_0x2d2b('0x119')]=function(_0x19be65,_0x31a462,_0x206a90){return db['ChatInteraction'][_0x2d2b('0x73')]({'where':{'id':_0x19be65[_0x2d2b('0xc2')]['id']}})[_0x2d2b('0x34')](handleEntityNotFound(_0x31a462,null))[_0x2d2b('0x34')](function(_0x126d76){if(_0x126d76){return _0x126d76['setTags'](_0x19be65['body'][_0x2d2b('0x10e')],_[_0x2d2b('0x10f')](_0x19be65[_0x2d2b('0x85')],[_0x2d2b('0x10e'),'id'])||{})[_0x2d2b('0x11a')](function(){return db['Tag']['findAll']({'attributes':['id',_0x2d2b('0x37'),_0x2d2b('0x5f')],'where':{'id':_0x19be65[_0x2d2b('0x85')]['ids']}});})[_0x2d2b('0x34')](function(_0x4c15a3){socket[_0x2d2b('0x11b')]('chatInteractionTags:save',{'id':Number(_0x19be65['params']['id']),'tags':_0x4c15a3||[]});return{'id':Number(_0x19be65[_0x2d2b('0xc2')]['id']),'tags':_0x4c15a3||[]};});}})['then'](respondWithResult(_0x31a462,null))[_0x2d2b('0x28')](handleError(_0x31a462,null));};exports[_0x2d2b('0x11c')]=function(_0x38a478,_0x478db4,_0x573801){return db[_0x2d2b('0x4e')][_0x2d2b('0x73')]({'where':{'id':_0x38a478[_0x2d2b('0xc2')]['id']}})[_0x2d2b('0x34')](handleEntityNotFound(_0x478db4,null))[_0x2d2b('0x34')](function(_0x2c7448){if(_0x2c7448){return _0x2c7448[_0x2d2b('0x11c')](_0x38a478[_0x2d2b('0x52')]['ids']);}})['then'](respondWithStatusCode(_0x478db4,null))[_0x2d2b('0x28')](handleError(_0x478db4,null));};exports[_0x2d2b('0xee')]=function(_0x2cc722,_0x2650c5){var _0x384767=moment()[_0x2d2b('0x11d')]()[_0x2d2b('0xa9')]();var _0x915d95=path[_0x2d2b('0xec')](config[_0x2d2b('0xea')],_0x2d2b('0x11e'),_0x2d2b('0x11f'),_0x2d2b('0x120'));var _0x33afb3=path[_0x2d2b('0xec')](config[_0x2d2b('0xea')],_0x2d2b('0x11e'),_0x2d2b('0x11f'),'attachments');var _0x27bf8c=path['join'](_0x915d95,_0x384767);var _0x3f887c=util['format']('transcript-%d-%s.zip',_0x2cc722['params']['id'],_0x384767);var _0xb8340c=path['join'](_0x915d95,_0x3f887c);var _0x14a6ba=[];_0x14a6ba['push']({'model':db[_0x2d2b('0x82')],'as':'User','attributes':['id',_0x2d2b('0x3e')],'raw':!![]});_0x14a6ba['push']({'model':db[_0x2d2b('0xdb')],'as':'Contact','attributes':['id',_0x2d2b('0x121'),'lastName'],'raw':!![]});if(_0x2cc722[_0x2d2b('0x52')][_0x2d2b('0x122')]){_0x14a6ba['push']({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x2ddb90=[{'model':db['ChatMessage'],'as':_0x2d2b('0xf5'),'attributes':['id','body','createdAt','direction',_0x2d2b('0x101'),_0x2d2b('0x93')],'include':_0x14a6ba}];_0x2ddb90[_0x2d2b('0x43')]({'model':db[_0x2d2b('0xc8')],'as':'Account','attributes':['id',_0x2d2b('0x37')]});_0x2ddb90[_0x2d2b('0x43')]({'model':db[_0x2d2b('0x82')],'as':_0x2d2b('0x123'),'attributes':['id',_0x2d2b('0x3e')]});return db['ChatInteraction'][_0x2d2b('0x73')]({'where':{'id':_0x2cc722[_0x2d2b('0xc2')]['id']},'include':_0x2ddb90})['then'](handleEntityNotFound(_0x2650c5,null))[_0x2d2b('0x34')](function(_0x392468){if(_0x392468){var _0x1ee9eb=_0x392468[_0x2d2b('0x124')]({'plain':!![]});fs[_0x2d2b('0x125')](_0x27bf8c);var _0x1a9c56={'channel':_0x2d2b('0x126'),'account':_0x1ee9eb[_0x2d2b('0x127')][_0x2d2b('0x37')],'agent':_0x1ee9eb[_0x2d2b('0x123')]?_0x1ee9eb[_0x2d2b('0x123')][_0x2d2b('0x3e')]:_0x2d2b('0x128'),'createdAt':moment(_0x1ee9eb[_0x2d2b('0x8c')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x2d2b('0xa9')](),'closedAt':_0x1ee9eb[_0x2d2b('0x4a')]?moment(_0x1ee9eb[_0x2d2b('0x129')])[_0x2d2b('0xf6')](_0x2d2b('0x12a'))['toString']():'','disposition':_0x1ee9eb['disposition'],'chatInfo':{'browser':_0x1ee9eb[_0x2d2b('0x12b')],'os':_0x1ee9eb[_0x2d2b('0x12c')],'referer':_0x1ee9eb[_0x2d2b('0x12d')],'customerIp':_0x1ee9eb[_0x2d2b('0x12e')],'customerPort':_0x1ee9eb[_0x2d2b('0x12f')]?_0x1ee9eb[_0x2d2b('0x12f')]:_0x2d2b('0x128')},'messages':_(_0x1ee9eb[_0x2d2b('0xf5')])[_0x2d2b('0x130')]()[_0x2d2b('0x97')]({'secret':![]})['map'](function(_0x167b50){if(_0x167b50[_0x2d2b('0xe6')]){var _0x44d46f=path['join'](_0x33afb3,_0x167b50[_0x2d2b('0xe6')][_0x2d2b('0xe2')]);if(fs[_0x2d2b('0x131')](_0x44d46f)){fs[_0x2d2b('0x132')](_0x44d46f)['pipe'](fs[_0x2d2b('0x133')](path[_0x2d2b('0xec')](_0x27bf8c,_0x167b50[_0x2d2b('0xe6')][_0x2d2b('0xe2')])));}}return{'date':moment(_0x167b50[_0x2d2b('0x8c')])[_0x2d2b('0xf6')](_0x2d2b('0x12a'))[_0x2d2b('0xa9')](),'sender':_0x167b50['direction']==='out'?_0x167b50[_0x2d2b('0x82')]?_0x167b50[_0x2d2b('0x82')][_0x2d2b('0x3e')]:_0x2d2b('0xf7'):_0x167b50[_0x2d2b('0x79')]['firstName']+(_0x167b50[_0x2d2b('0x79')][_0x2d2b('0x134')]?'\x20'+_0x167b50[_0x2d2b('0x79')][_0x2d2b('0x134')]:''),'body':_0x167b50[_0x2d2b('0xe6')]?_0x167b50['Attachment'][_0x2d2b('0xe2')]:_0x167b50[_0x2d2b('0x85')],'direction':_0x167b50[_0x2d2b('0x100')]==='out'?'A':'C','secret':_0x167b50['secret'],'read':_0x167b50['read'],'attachment':_0x167b50[_0x2d2b('0xe6')]};})[_0x2d2b('0x75')]()};return ejs[_0x2d2b('0x135')](path[_0x2d2b('0xec')](config[_0x2d2b('0xea')],_0x2d2b('0x11e'),'views',_0x2d2b('0x136')),{'interaction':_0x1a9c56})[_0x2d2b('0x34')](function(_0x57976b){var _0x5858d2=path[_0x2d2b('0xec')](_0x27bf8c,_0x2d2b('0x137')+_0x1ee9eb['id']+'-'+_0x384767+'.pdf');var _0x1b9939={'path':_0x5858d2,'channel':_0x2d2b('0x126'),'interactionId':_0x1ee9eb['id']};return pdf['createPdfFromHTML'](_0x57976b,_0x1b9939);})[_0x2d2b('0x34')](function(){return new BPromise(function(_0x207da2,_0x52a3da){zipdir(_0x27bf8c,{'saveTo':_0xb8340c},function(_0x1cf246,_0x16535c){if(_0x1cf246)return _0x52a3da(_0x1cf246);return _0x207da2(_0x16535c);});})[_0x2d2b('0x34')](function(){return new BPromise(function(_0x1930cb,_0x495467){rimraf(_0x27bf8c,function(_0x5bb235){if(_0x5bb235)_0x495467(_0x5bb235);return _0x1930cb();});});})[_0x2d2b('0x34')](function(){return _0x2650c5['download'](_0xb8340c,_0x3f887c,function(_0x170286){if(_0x170286){console[_0x2d2b('0x138')](_0x2d2b('0x139'),_0x170286);}else{fs[_0x2d2b('0x13a')](_0xb8340c);}});});});}else{return _0x2650c5[_0x2d2b('0x29')](0xc8);}})['catch'](handleError(_0x2650c5,null));};
\ No newline at end of file
index 74e3960..48ae01d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3506=['setDataValue','Users','length','catch','hasOwnProperty','hook','exports','events','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','save','update','then'];(function(_0x11079a,_0xcd17a3){var _0x4be50c=function(_0x445339){while(--_0x445339){_0x11079a['push'](_0x11079a['shift']());}};_0x4be50c(++_0xcd17a3);}(_0x3506,0x106));var _0x6350=function(_0x29aad6,_0x22b4c3){_0x29aad6=_0x29aad6-0x0;var _0x355592=_0x3506[_0x29aad6];return _0x355592;};'use strict';var EventEmitter=require(_0x6350('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x6350('0x1')];var ChatMessage=require(_0x6350('0x2'))['db'][_0x6350('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x6350('0x4')](0x0);var events={'afterCreate':_0x6350('0x5'),'afterUpdate':_0x6350('0x6'),'afterDestroy':'remove'};function emitEvent(_0xa38274){return function(_0x462ea4,_0x290d55,_0x16cda6){_0x462ea4['getUsers']({'attributes':['id'],'raw':!![]})[_0x6350('0x7')](function(_0x4f0f05){_0x462ea4[_0x6350('0x8')](_0x6350('0x9'),_0x4f0f05['map'](function(_0x2a735e){return{'id':_0x2a735e['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x462ea4['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6350('0x7')](function(_0x573925){_0x462ea4['setDataValue']('unreadMessages',_0x573925[_0x6350('0xa')]);ChatInteractionEvents['emit'](_0xa38274+':'+_0x462ea4['id'],_0x462ea4);ChatInteractionEvents['emit'](_0xa38274,_0x462ea4);_0x16cda6(null);})[_0x6350('0xb')](_0x16cda6(null));};}for(var e in events){if(events[_0x6350('0xc')](e)){var event=events[e];ChatInteraction[_0x6350('0xd')](e,emitEvent(event));}}module[_0x6350('0xe')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x9dbc=['unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers','Users','map'];(function(_0x5c1781,_0x517881){var _0x14af7f=function(_0x4c2a23){while(--_0x4c2a23){_0x5c1781['push'](_0x5c1781['shift']());}};_0x14af7f(++_0x517881);}(_0x9dbc,0x1c0));var _0xc9db=function(_0x3bc9c9,_0xcaf226){_0x3bc9c9=_0x3bc9c9-0x0;var _0x5414b1=_0x9dbc[_0x3bc9c9];return _0x5414b1;};'use strict';var EventEmitter=require(_0xc9db('0x0'));var ChatInteraction=require(_0xc9db('0x1'))['db'][_0xc9db('0x2')];var ChatMessage=require(_0xc9db('0x1'))['db'][_0xc9db('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xc9db('0x4')](0x0);var events={'afterCreate':_0xc9db('0x5'),'afterUpdate':_0xc9db('0x6'),'afterDestroy':_0xc9db('0x7')};function emitEvent(_0xc3605a){return function(_0x4b5cf8,_0x5493b1,_0x539bd2){_0x4b5cf8[_0xc9db('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5cda87){_0x4b5cf8['setDataValue'](_0xc9db('0x9'),_0x5cda87[_0xc9db('0xa')](function(_0xe18019){return{'id':_0xe18019['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x4b5cf8['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x1ee9b1){_0x4b5cf8['setDataValue'](_0xc9db('0xb'),_0x1ee9b1[_0xc9db('0xc')]);ChatInteractionEvents[_0xc9db('0xd')](_0xc3605a+':'+_0x4b5cf8['id'],_0x4b5cf8);ChatInteractionEvents['emit'](_0xc3605a,_0x4b5cf8);_0x539bd2(null);})['catch'](_0x539bd2(null));};}for(var e in events){if(events[_0xc9db('0xe')](e)){var event=events[e];ChatInteraction[_0xc9db('0xf')](e,emitEvent(event));}}module[_0xc9db('0x10')]=ChatInteractionEvents;
\ No newline at end of file
index 57df163..990bca4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0346=['request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2e9193,_0x3465b5){var _0x1cf9b3=function(_0x7fc8f){while(--_0x7fc8f){_0x2e9193['push'](_0x2e9193['shift']());}};_0x1cf9b3(++_0x3465b5);}(_0x0346,0x1b3));var _0x6034=function(_0x3bb36b,_0x198202){_0x3bb36b=_0x3bb36b-0x0;var _0x481591=_0x0346[_0x3bb36b];return _0x481591;};'use strict';var _=require(_0x6034('0x0'));var util=require(_0x6034('0x1'));var logger=require(_0x6034('0x2'))(_0x6034('0x3'));var moment=require(_0x6034('0x4'));var BPromise=require(_0x6034('0x5'));var rp=require(_0x6034('0x6'));var fs=require('fs');var path=require(_0x6034('0x7'));var rimraf=require(_0x6034('0x8'));var config=require(_0x6034('0x9'));var attributes=require(_0x6034('0xa'));module[_0x6034('0xb')]=function(_0x3c82dc,_0x5b10f4){return _0x3c82dc[_0x6034('0xc')](_0x6034('0xd'),attributes,{'tableName':_0x6034('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2afe2c,_0x516622,_0x112e30){if(_0x2afe2c['changed'](_0x6034('0xf'))){_0x2afe2c[_0x6034('0x10')]=moment()[_0x6034('0x11')](_0x6034('0x12'));}_0x112e30(null,_0x2afe2c);}},'charset':_0x6034('0x13'),'collate':_0x6034('0x14')});};
\ No newline at end of file
+var _0xfeed=['chat_interactions','changed','closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction'];(function(_0x1e73fc,_0x533750){var _0xeceac4=function(_0x2c6dda){while(--_0x2c6dda){_0x1e73fc['push'](_0x1e73fc['shift']());}};_0xeceac4(++_0x533750);}(_0xfeed,0x9e));var _0xdfee=function(_0x213b20,_0x538a55){_0x213b20=_0x213b20-0x0;var _0x529fde=_0xfeed[_0x213b20];return _0x529fde;};'use strict';var _=require(_0xdfee('0x0'));var util=require(_0xdfee('0x1'));var logger=require(_0xdfee('0x2'))(_0xdfee('0x3'));var moment=require('moment');var BPromise=require(_0xdfee('0x4'));var rp=require(_0xdfee('0x5'));var fs=require('fs');var path=require(_0xdfee('0x6'));var rimraf=require(_0xdfee('0x7'));var config=require(_0xdfee('0x8'));var attributes=require(_0xdfee('0x9'));module[_0xdfee('0xa')]=function(_0x1642cc,_0x7eb413){return _0x1642cc[_0xdfee('0xb')](_0xdfee('0xc'),attributes,{'tableName':_0xdfee('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4aa1a7,_0x4c4a26,_0x26f180){if(_0x4aa1a7[_0xdfee('0xe')]('closed')){_0x4aa1a7[_0xdfee('0xf')]=moment()[_0xdfee('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x26f180(null,_0x4aa1a7);}},'charset':_0xdfee('0x11'),'collate':_0xdfee('0x12')});};
\ No newline at end of file
index a7a2b9e..c63755a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe746=['../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ChatInteraction','update','body','options','where','attributes','limit','UpdateChatInteraction','catch','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x239632,_0x472e6a){var _0x2fad25=function(_0x2c7e31){while(--_0x2c7e31){_0x239632['push'](_0x239632['shift']());}};_0x2fad25(++_0x472e6a);}(_0xe746,0x18c));var _0x6e74=function(_0x62de3c,_0x4a6942){_0x62de3c=_0x62de3c-0x0;var _0x5660a1=_0xe746[_0x62de3c];return _0x5660a1;};'use strict';var _=require('lodash');var util=require(_0x6e74('0x0'));var moment=require(_0x6e74('0x1'));var BPromise=require(_0x6e74('0x2'));var rs=require(_0x6e74('0x3'));var fs=require('fs');var Redis=require(_0x6e74('0x4'));var db=require(_0x6e74('0x5'))['db'];var utils=require(_0x6e74('0x6'));var logger=require(_0x6e74('0x7'))(_0x6e74('0x8'));var config=require(_0x6e74('0x9'));var jayson=require(_0x6e74('0xa'));var client=jayson[_0x6e74('0xb')][_0x6e74('0xc')]({'port':0x232a});config[_0x6e74('0xd')]=_['defaults'](config[_0x6e74('0xd')],{'host':_0x6e74('0xe'),'port':0x18eb});var socket=require(_0x6e74('0xf'))(new Redis(config[_0x6e74('0xd')]));require(_0x6e74('0x10'))[_0x6e74('0x11')](socket);function respondWithRpcPromise(_0x1a2a03,_0x56dd31,_0x54c8dd){return new BPromise(function(_0x22eff6,_0x46d21e){return client['request'](_0x1a2a03,_0x54c8dd)[_0x6e74('0x12')](function(_0x9688b8){logger[_0x6e74('0x13')](_0x6e74('0x14'),_0x56dd31,_0x6e74('0x15'));logger[_0x6e74('0x16')](_0x6e74('0x17'),_0x56dd31,_0x6e74('0x15'),JSON[_0x6e74('0x18')](_0x9688b8));if(_0x9688b8['error']){if(_0x9688b8[_0x6e74('0x19')][_0x6e74('0x1a')]===0x1f4){logger[_0x6e74('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x56dd31,_0x9688b8[_0x6e74('0x19')][_0x6e74('0x1b')]);return _0x46d21e(_0x9688b8['error'][_0x6e74('0x1b')]);}logger[_0x6e74('0x19')](_0x6e74('0x14'),_0x56dd31,_0x9688b8[_0x6e74('0x19')][_0x6e74('0x1b')]);return _0x22eff6(_0x9688b8[_0x6e74('0x19')][_0x6e74('0x1b')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x56dd31,_0x6e74('0x15'));_0x22eff6(_0x9688b8[_0x6e74('0x1c')][_0x6e74('0x1b')]);}})['catch'](function(_0x2ea59d){logger[_0x6e74('0x19')](_0x6e74('0x14'),_0x56dd31,_0x2ea59d);_0x46d21e(_0x2ea59d);});});}exports['UpdateChatInteraction']=function(_0x1f7408){var _0x560b1f=this;return new Promise(function(_0x502cc9,_0x599d04){return db[_0x6e74('0x1d')][_0x6e74('0x1e')](_0x1f7408[_0x6e74('0x1f')],{'raw':_0x1f7408[_0x6e74('0x20')]?_0x1f7408[_0x6e74('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f7408[_0x6e74('0x20')]?_0x1f7408[_0x6e74('0x20')][_0x6e74('0x21')]||null:null,'attributes':_0x1f7408[_0x6e74('0x20')]?_0x1f7408[_0x6e74('0x20')][_0x6e74('0x22')]||null:null,'limit':_0x1f7408[_0x6e74('0x20')]?_0x1f7408[_0x6e74('0x20')][_0x6e74('0x23')]||null:null})['then'](function(_0xee4e3c){logger[_0x6e74('0x13')](_0x6e74('0x24'),_0x1f7408);logger[_0x6e74('0x16')](_0x6e74('0x24'),_0x1f7408,JSON[_0x6e74('0x18')](_0xee4e3c));_0x502cc9(_0xee4e3c);})[_0x6e74('0x25')](function(_0x529d22){logger[_0x6e74('0x19')](_0x6e74('0x24'),_0x529d22[_0x6e74('0x1b')],_0x1f7408);_0x599d04(_0x560b1f[_0x6e74('0x19')](0x1f4,_0x529d22['message']));});});};exports[_0x6e74('0x26')]=function(_0x5c17bf){return new Promise(function(_0x223265,_0x401a1a){return db[_0x6e74('0x1d')][_0x6e74('0x27')]({'where':_0x5c17bf[_0x6e74('0x20')]?_0x5c17bf[_0x6e74('0x20')][_0x6e74('0x21')]||null:null})['then'](function(_0x28165a){if(_0x28165a){return _0x28165a[_0x6e74('0x28')](_0x5c17bf[_0x6e74('0x1f')][_0x6e74('0x29')],_[_0x6e74('0x2a')](_0x5c17bf[_0x6e74('0x1f')],[_0x6e74('0x29'),'id'])||{});}})[_0x6e74('0x2b')](function(_0x227578){logger['info']('AddTags',_0x5c17bf);logger[_0x6e74('0x16')](_0x6e74('0x2c'),_0x5c17bf,JSON['stringify'](_0x227578));_0x223265(_0x227578);})[_0x6e74('0x25')](function(_0x44ea78){logger['error'](_0x6e74('0x2c'),_0x44ea78[_0x6e74('0x1b')],_0x5c17bf);_0x401a1a(_this[_0x6e74('0x19')](0x1f4,_0x44ea78[_0x6e74('0x1b')]));});});};
\ No newline at end of file
+var _0x8df9=['client','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','ChatInteraction,\x20%s,\x20%s','error','message','result','catch','UpdateChatInteraction','update','body','options','raw','where','attributes','then','info','AddTagsToChatInteraction','ChatInteraction','find','addTags','ids','omit','AddTags','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x406c33,_0x41cf5d){var _0x372529=function(_0x3a428b){while(--_0x3a428b){_0x406c33['push'](_0x406c33['shift']());}};_0x372529(++_0x41cf5d);}(_0x8df9,0x9c));var _0x98df=function(_0x5b3f04,_0x1d7c76){_0x5b3f04=_0x5b3f04-0x0;var _0x5a6b04=_0x8df9[_0x5b3f04];return _0x5a6b04;};'use strict';var _=require('lodash');var util=require(_0x98df('0x0'));var moment=require(_0x98df('0x1'));var BPromise=require('bluebird');var rs=require(_0x98df('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x98df('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x98df('0x4'))(_0x98df('0x5'));var config=require(_0x98df('0x6'));var jayson=require(_0x98df('0x7'));var client=jayson[_0x98df('0x8')][_0x98df('0x9')]({'port':0x232a});config[_0x98df('0xa')]=_['defaults'](config[_0x98df('0xa')],{'host':_0x98df('0xb'),'port':0x18eb});var socket=require(_0x98df('0xc'))(new Redis(config[_0x98df('0xa')]));require(_0x98df('0xd'))[_0x98df('0xe')](socket);function respondWithRpcPromise(_0x1e0408,_0x1bada4,_0xe08ebe){return new BPromise(function(_0x29ccdd,_0x35def6){return client[_0x98df('0xf')](_0x1e0408,_0xe08ebe)['then'](function(_0x20b1c7){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x1bada4,_0x98df('0x10'));logger[_0x98df('0x11')](_0x98df('0x12'),_0x1bada4,_0x98df('0x10'),JSON[_0x98df('0x13')](_0x20b1c7));if(_0x20b1c7['error']){if(_0x20b1c7['error']['code']===0x1f4){logger['error'](_0x98df('0x14'),_0x1bada4,_0x20b1c7['error']['message']);return _0x35def6(_0x20b1c7[_0x98df('0x15')]['message']);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x1bada4,_0x20b1c7[_0x98df('0x15')]['message']);return _0x29ccdd(_0x20b1c7[_0x98df('0x15')][_0x98df('0x16')]);}else{logger['info'](_0x98df('0x14'),_0x1bada4,_0x98df('0x10'));_0x29ccdd(_0x20b1c7[_0x98df('0x17')][_0x98df('0x16')]);}})[_0x98df('0x18')](function(_0x211392){logger[_0x98df('0x15')](_0x98df('0x14'),_0x1bada4,_0x211392);_0x35def6(_0x211392);});});}exports[_0x98df('0x19')]=function(_0x441c62){var _0x36d822=this;return new Promise(function(_0x5dd897,_0x27dd82){return db['ChatInteraction'][_0x98df('0x1a')](_0x441c62[_0x98df('0x1b')],{'raw':_0x441c62['options']?_0x441c62[_0x98df('0x1c')][_0x98df('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x441c62[_0x98df('0x1c')]?_0x441c62[_0x98df('0x1c')][_0x98df('0x1e')]||null:null,'attributes':_0x441c62[_0x98df('0x1c')]?_0x441c62[_0x98df('0x1c')][_0x98df('0x1f')]||null:null,'limit':_0x441c62['options']?_0x441c62[_0x98df('0x1c')]['limit']||null:null})[_0x98df('0x20')](function(_0x2bc65d){logger[_0x98df('0x21')](_0x98df('0x19'),_0x441c62);logger['debug'](_0x98df('0x19'),_0x441c62,JSON[_0x98df('0x13')](_0x2bc65d));_0x5dd897(_0x2bc65d);})[_0x98df('0x18')](function(_0xed3500){logger[_0x98df('0x15')](_0x98df('0x19'),_0xed3500['message'],_0x441c62);_0x27dd82(_0x36d822[_0x98df('0x15')](0x1f4,_0xed3500[_0x98df('0x16')]));});});};exports[_0x98df('0x22')]=function(_0x5bdf75){return new Promise(function(_0x4cb038,_0x3bb06a){return db[_0x98df('0x23')][_0x98df('0x24')]({'where':_0x5bdf75[_0x98df('0x1c')]?_0x5bdf75[_0x98df('0x1c')][_0x98df('0x1e')]||null:null})['then'](function(_0x30e99b){if(_0x30e99b){return _0x30e99b[_0x98df('0x25')](_0x5bdf75[_0x98df('0x1b')][_0x98df('0x26')],_[_0x98df('0x27')](_0x5bdf75[_0x98df('0x1b')],[_0x98df('0x26'),'id'])||{});}})['spread'](function(_0x224d41){logger[_0x98df('0x21')]('AddTags',_0x5bdf75);logger['debug'](_0x98df('0x28'),_0x5bdf75,JSON[_0x98df('0x13')](_0x224d41));_0x4cb038(_0x224d41);})[_0x98df('0x18')](function(_0x37a6c9){logger[_0x98df('0x15')](_0x98df('0x28'),_0x37a6c9['message'],_0x5bdf75);_0x3bb06a(_this[_0x98df('0x15')](0x1f4,_0x37a6c9[_0x98df('0x16')]));});});};
\ No newline at end of file
index 62abe73..a40c22d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x10f1=['./chatInteraction.events','save','remove','update','emit','removeListener','length','chatInteraction:'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x10f1,0x1a0));var _0x110f=function(_0x4c9d8a,_0x416654){_0x4c9d8a=_0x4c9d8a-0x0;var _0x2069b5=_0x10f1[_0x4c9d8a];return _0x2069b5;};'use strict';var ChatInteractionEvents=require(_0x110f('0x0'));var events=[_0x110f('0x1'),_0x110f('0x2'),_0x110f('0x3')];function createListener(_0x5020eb,_0x3d50bc){return function(_0x536b2c){_0x3d50bc[_0x110f('0x4')](_0x5020eb,_0x536b2c);};}function removeListener(_0x555c25,_0x5f2671){return function(){ChatInteractionEvents[_0x110f('0x5')](_0x555c25,_0x5f2671);};}exports['register']=function(_0x2617df){for(var _0x328bf3=0x0,_0x52ab04=events[_0x110f('0x6')];_0x328bf3<_0x52ab04;_0x328bf3++){var _0x1aeace=events[_0x328bf3];var _0x4b8e9e=createListener(_0x110f('0x7')+_0x1aeace,_0x2617df);ChatInteractionEvents['on'](_0x1aeace,_0x4b8e9e);}};
\ No newline at end of file
+var _0x64f7=['length','save','remove','update','emit','removeListener'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x64f7,0xa3));var _0x764f=function(_0x5356e3,_0x5f1031){_0x5356e3=_0x5356e3-0x0;var _0x257810=_0x64f7[_0x5356e3];return _0x257810;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x764f('0x0'),_0x764f('0x1'),_0x764f('0x2')];function createListener(_0x585aff,_0x53751b){return function(_0x5f0064){_0x53751b[_0x764f('0x3')](_0x585aff,_0x5f0064);};}function removeListener(_0x594a2d,_0x425fc4){return function(){ChatInteractionEvents[_0x764f('0x4')](_0x594a2d,_0x425fc4);};}exports['register']=function(_0x50b959){for(var _0x5a1113=0x0,_0x2b3c0d=events[_0x764f('0x5')];_0x5a1113<_0x2b3c0d;_0x5a1113++){var _0x19a491=events[_0x5a1113];var _0x5cdab2=createListener('chatInteraction:'+_0x19a491,_0x50b959);ChatInteractionEvents['on'](_0x19a491,_0x5cdab2);}};
\ No newline at end of file
index c342003..d2fe1d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc77d=['show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','now','originalname','replace','/:id/attachment_upload','single','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/close','close','delete','destroy','removeTags','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','index','isAuthenticated','/:id','isChatInteractionAuthorized'];(function(_0x21798d,_0x1b0a7b){var _0xce2d28=function(_0x4a46a0){while(--_0x4a46a0){_0x21798d['push'](_0x21798d['shift']());}};_0xce2d28(++_0x1b0a7b);}(_0xc77d,0x1d4));var _0xdc77=function(_0x1e197d,_0x2e551d){_0x1e197d=_0x1e197d-0x0;var _0x4ca88e=_0xc77d[_0x1e197d];return _0x4ca88e;};'use strict';var multer=require('multer');var util=require(_0xdc77('0x0'));var path=require(_0xdc77('0x1'));var timeout=require(_0xdc77('0x2'));var express=require(_0xdc77('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xdc77('0x4'));var interaction=require(_0xdc77('0x5'));var config=require('../../config/environment');var controller=require(_0xdc77('0x6'));router[_0xdc77('0x7')]('/',auth['isAuthenticated'](),controller[_0xdc77('0x8')]);router[_0xdc77('0x7')]('/describe',auth[_0xdc77('0x9')](),controller['describe']);router[_0xdc77('0x7')](_0xdc77('0xa'),auth[_0xdc77('0xb')](),controller[_0xdc77('0xc')]);router[_0xdc77('0x7')](_0xdc77('0xd'),auth['isChatInteractionAuthorized'](),controller[_0xdc77('0xe')]);router['get'](_0xdc77('0xf'),auth['isAuthenticated'](),controller[_0xdc77('0x10')]);router[_0xdc77('0x7')]('/:id/my_messages',auth[_0xdc77('0xb')](),controller['getMyMessages']);router['get'](_0xdc77('0x11'),auth[_0xdc77('0x9')](),controller['download']);router[_0xdc77('0x12')]('/',auth[_0xdc77('0x9')](),controller[_0xdc77('0x13')]);router[_0xdc77('0x12')](_0xdc77('0x14'),auth[_0xdc77('0x9')](),controller[_0xdc77('0x15')]);var upload=multer({'storage':multer[_0xdc77('0x16')]({'destination':function(_0xac465,_0x3e208e,_0x26ef6b){_0x26ef6b(null,path[_0xdc77('0x17')](config[_0xdc77('0x18')],_0xdc77('0x19')));},'filename':function(_0xce03fa,_0x490c74,_0x2ac8c8){_0x2ac8c8(null,util[_0xdc77('0x1a')]('%s-%s',Date[_0xdc77('0x1b')](),_0x490c74[_0xdc77('0x1c')][_0xdc77('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xdc77('0x12')](_0xdc77('0x1e'),upload[_0xdc77('0x1f')]('file'),controller['attachmentUpload']);router[_0xdc77('0x12')](_0xdc77('0xf'),auth[_0xdc77('0xb')](),controller[_0xdc77('0x20')]);router[_0xdc77('0x12')](_0xdc77('0x21'),auth['isAuthenticated'](),interaction[_0xdc77('0x22')](_0xdc77('0x23'),_0xdc77('0x24')),controller['addTags']);router[_0xdc77('0x25')](_0xdc77('0xa'),auth[_0xdc77('0x9')](),interaction[_0xdc77('0x22')](_0xdc77('0x23'),_0xdc77('0x26')),controller[_0xdc77('0x27')]);router[_0xdc77('0x25')](_0xdc77('0x28'),controller[_0xdc77('0x29')]);router[_0xdc77('0x25')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller['abandon']);router[_0xdc77('0x25')](_0xdc77('0x2a'),controller[_0xdc77('0x2b')]);router[_0xdc77('0x2c')](_0xdc77('0xa'),auth[_0xdc77('0x9')](),interaction[_0xdc77('0x22')](_0xdc77('0x23'),'chatinteraction:destroy'),controller[_0xdc77('0x2d')]);router[_0xdc77('0x2c')](_0xdc77('0x21'),auth['isAuthenticated'](),controller[_0xdc77('0x2e')]);module[_0xdc77('0x2f')]=router;
\ No newline at end of file
+var _0x9223=['createVidaooSession','diskStorage','join','root','format','%s-%s','now','originalname','/:id/attachment_upload','file','attachmentUpload','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','/:id','chatinteraction:destroy','destroy','/:id/tags','removeTags','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','getMyMessages','/:id/download','download','post','/:id/vidaoo'];(function(_0x3da853,_0x167bb8){var _0x1ef769=function(_0x45973d){while(--_0x45973d){_0x3da853['push'](_0x3da853['shift']());}};_0x1ef769(++_0x167bb8);}(_0x9223,0x12c));var _0x3922=function(_0x18b5e8,_0x51e875){_0x18b5e8=_0x18b5e8-0x0;var _0x25baed=_0x9223[_0x18b5e8];return _0x25baed;};'use strict';var multer=require(_0x3922('0x0'));var util=require(_0x3922('0x1'));var path=require('path');var timeout=require(_0x3922('0x2'));var express=require(_0x3922('0x3'));var router=express[_0x3922('0x4')]();var fs_extra=require(_0x3922('0x5'));var auth=require(_0x3922('0x6'));var interaction=require(_0x3922('0x7'));var config=require(_0x3922('0x8'));var controller=require('./chatInteraction.controller');router[_0x3922('0x9')]('/',auth[_0x3922('0xa')](),controller['index']);router['get'](_0x3922('0xb'),auth[_0x3922('0xa')](),controller[_0x3922('0xc')]);router[_0x3922('0x9')]('/:id',auth[_0x3922('0xd')](),controller[_0x3922('0xe')]);router[_0x3922('0x9')](_0x3922('0xf'),auth[_0x3922('0xd')](),controller[_0x3922('0x10')]);router[_0x3922('0x9')](_0x3922('0x11'),auth[_0x3922('0xa')](),controller[_0x3922('0x12')]);router[_0x3922('0x9')]('/:id/my_messages',auth['isChatInteractionAuthorized'](),controller[_0x3922('0x13')]);router['get'](_0x3922('0x14'),auth[_0x3922('0xa')](),controller[_0x3922('0x15')]);router[_0x3922('0x16')]('/',auth[_0x3922('0xa')](),controller['create']);router[_0x3922('0x16')](_0x3922('0x17'),auth[_0x3922('0xa')](),controller[_0x3922('0x18')]);var upload=multer({'storage':multer[_0x3922('0x19')]({'destination':function(_0x31402f,_0x22b14f,_0xbfff3){_0xbfff3(null,path[_0x3922('0x1a')](config[_0x3922('0x1b')],'server/files/attachments/'));},'filename':function(_0xd30a12,_0x399e97,_0x26436f){_0x26436f(null,util[_0x3922('0x1c')](_0x3922('0x1d'),Date[_0x3922('0x1e')](),_0x399e97[_0x3922('0x1f')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x3922('0x16')](_0x3922('0x20'),upload['single'](_0x3922('0x21')),controller[_0x3922('0x22')]);router[_0x3922('0x16')]('/:id/messages',auth[_0x3922('0xd')](),controller['addMessage']);router[_0x3922('0x16')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x3922('0x23')](_0x3922('0x24'),_0x3922('0x25')),controller[_0x3922('0x26')]);router[_0x3922('0x27')]('/:id',auth[_0x3922('0xa')](),interaction[_0x3922('0x23')](_0x3922('0x24'),_0x3922('0x28')),controller[_0x3922('0x29')]);router[_0x3922('0x27')](_0x3922('0x2a'),controller[_0x3922('0x2b')]);router['put'](_0x3922('0x2c'),auth[_0x3922('0xd')](),controller[_0x3922('0x2d')]);router[_0x3922('0x27')](_0x3922('0x2e'),controller[_0x3922('0x2f')]);router[_0x3922('0x30')](_0x3922('0x31'),auth[_0x3922('0xa')](),interaction[_0x3922('0x23')](_0x3922('0x24'),_0x3922('0x32')),controller[_0x3922('0x33')]);router['delete'](_0x3922('0x34'),auth[_0x3922('0xa')](),controller[_0x3922('0x35')]);module['exports']=router;
\ No newline at end of file
index bbc8ec5..ab31ada 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8187=['exports','BOOLEAN','INTEGER','sequelize'];(function(_0x4b3364,_0x19b3b6){var _0x4b4f28=function(_0x2210d1){while(--_0x2210d1){_0x4b3364['push'](_0x4b3364['shift']());}};_0x4b4f28(++_0x19b3b6);}(_0x8187,0xe3));var _0x7818=function(_0x1f34af,_0x60f3b3){_0x1f34af=_0x1f34af-0x0;var _0x3f4599=_0x8187[_0x1f34af];return _0x3f4599;};'use strict';var Sequelize=require(_0x7818('0x0'));module[_0x7818('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x7818('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x7818('0x3')]}};
\ No newline at end of file
+var _0x3612=['TEXT','medium','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3612,0x1d6));var _0x2361=function(_0x37a0ab,_0x34b900){_0x37a0ab=_0x37a0ab-0x0;var _0x13ca1d=_0x3612[_0x37a0ab];return _0x13ca1d;};'use strict';var Sequelize=require('sequelize');module[_0x2361('0x0')]={'body':{'type':Sequelize[_0x2361('0x1')](_0x2361('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index 2b34b42..2aeba9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x848a=['fs-extra','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','update','then','error','name','send','index','map','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','ChatInternalMessage','include','findAll','rows','catch','params','includeAll','merge','options','find','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','agent','admin','user','role','userpic','internal','online','allowmessenger','showWebBar','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','read','all','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv'];(function(_0x305737,_0x30a745){var _0x3fe85e=function(_0x47c6df){while(--_0x47c6df){_0x305737['push'](_0x305737['shift']());}};_0x3fe85e(++_0x30a745);}(_0x848a,0xc5));var _0xa848=function(_0x1a8ff0,_0x20788d){_0x1a8ff0=_0x1a8ff0-0x0;var _0x3588bf=_0x848a[_0x1a8ff0];return _0x3588bf;};'use strict';var emlformat=require(_0xa848('0x0'));var rimraf=require(_0xa848('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa848('0x2'));var moment=require(_0xa848('0x3'));var BPromise=require(_0xa848('0x4'));var Mustache=require(_0xa848('0x5'));var util=require('util');var path=require(_0xa848('0x6'));var sox=require(_0xa848('0x7'));var csv=require(_0xa848('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa848('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa848('0xa'));var deskjs=require(_0xa848('0xb'));var toCsv=require(_0xa848('0x8'));var querystring=require(_0xa848('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa848('0xd'));var qs=require(_0xa848('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa848('0xf'))('api');var utils=require(_0xa848('0x10'));var config=require(_0xa848('0x11'));var licenseUtil=require(_0xa848('0x12'));var db=require(_0xa848('0x13'))['db'];config[_0xa848('0x14')]=_[_0xa848('0x15')](config[_0xa848('0x14')],{'host':_0xa848('0x16'),'port':0x18eb});var socket=require(_0xa848('0x17'))(new Redis(config['redis']));require('./chatInternalMessage.socket')['register'](socket);function respondWithStatusCode(_0x40dae0,_0x3ba433){_0x3ba433=_0x3ba433||0xcc;return function(_0x14e1f1){if(_0x14e1f1){return _0x40dae0[_0xa848('0x18')](_0x3ba433);}return _0x40dae0[_0xa848('0x19')](_0x3ba433)[_0xa848('0x1a')]();};}function respondWithResult(_0x3ea709,_0x385b68){_0x385b68=_0x385b68||0xc8;return function(_0xe64a31){if(_0xe64a31){return _0x3ea709[_0xa848('0x19')](_0x385b68)['json'](_0xe64a31);}};}function respondWithFilteredResult(_0x5ef428,_0x193668){return function(_0x425542){if(_0x425542){var _0x3fd0e7=typeof _0x193668[_0xa848('0x1b')]==='undefined'&&typeof _0x193668['limit']===_0xa848('0x1c');var _0x4b3352=_0x425542[_0xa848('0x1d')];var _0x3a91d7=_0x3fd0e7?0x0:_0x193668[_0xa848('0x1b')];var _0x45af88=_0x3fd0e7?_0x425542[_0xa848('0x1d')]:_0x193668['offset']+_0x193668[_0xa848('0x1e')];var _0x5a4c00;if(_0x45af88>=_0x4b3352){_0x45af88=_0x4b3352;_0x5a4c00=0xc8;}else{_0x5a4c00=0xce;}_0x5ef428[_0xa848('0x19')](_0x5a4c00);return _0x5ef428[_0xa848('0x1f')](_0xa848('0x20'),_0x3a91d7+'-'+_0x45af88+'/'+_0x4b3352)[_0xa848('0x21')](_0x425542);}return null;};}function patchUpdates(_0x5733b4){return function(_0x19fe0b){try{jsonpatch[_0xa848('0x22')](_0x19fe0b,_0x5733b4,!![]);}catch(_0x5b9642){return BPromise[_0xa848('0x23')](_0x5b9642);}return _0x19fe0b['save']();};}function saveUpdates(_0x39e216,_0x320627){return function(_0x2576e4){if(_0x2576e4){return _0x2576e4[_0xa848('0x24')](_0x39e216)['then'](function(_0x1156d3){return _0x1156d3;});}return null;};}function removeEntity(_0x41d07f,_0x1a8825){return function(_0x55a6d3){if(_0x55a6d3){return _0x55a6d3['destroy']()[_0xa848('0x25')](function(){_0x41d07f[_0xa848('0x19')](0xcc)[_0xa848('0x1a')]();});}};}function handleEntityNotFound(_0x16285f,_0x5738d4){return function(_0x54fe66){if(!_0x54fe66){_0x16285f[_0xa848('0x18')](0x194);}return _0x54fe66;};}function handleError(_0x540034,_0x186855){_0x186855=_0x186855||0x1f4;return function(_0x2836aa){logger[_0xa848('0x26')](_0x2836aa['stack']);if(_0x2836aa[_0xa848('0x27')]){delete _0x2836aa[_0xa848('0x27')];}_0x540034[_0xa848('0x19')](_0x186855)[_0xa848('0x28')](_0x2836aa);};}exports[_0xa848('0x29')]=function(_0x4c1a46,_0x4361ce){var _0x21ecbd={},_0x197301={},_0x258f38={'count':0x0,'rows':[]};var _0x55c358=_[_0xa848('0x2a')](db['ChatInternalMessage'][_0xa848('0x2b')],function(_0x28372f){return{'name':_0x28372f['fieldName'],'type':_0x28372f[_0xa848('0x2c')][_0xa848('0x2d')]};});_0x197301[_0xa848('0x2e')]=_[_0xa848('0x2a')](_0x55c358,_0xa848('0x27'));_0x197301['query']=_[_0xa848('0x2f')](_0x4c1a46[_0xa848('0x30')]);_0x197301[_0xa848('0x31')]=_[_0xa848('0x32')](_0x197301[_0xa848('0x2e')],_0x197301[_0xa848('0x30')]);_0x21ecbd['attributes']=_[_0xa848('0x32')](_0x197301[_0xa848('0x2e')],qs[_0xa848('0x33')](_0x4c1a46['query']['fields']));_0x21ecbd[_0xa848('0x34')]=_0x21ecbd[_0xa848('0x34')][_0xa848('0x35')]?_0x21ecbd[_0xa848('0x34')]:_0x197301['model'];if(!_0x4c1a46[_0xa848('0x30')][_0xa848('0x36')](_0xa848('0x37'))){_0x21ecbd[_0xa848('0x1e')]=qs[_0xa848('0x1e')](_0x4c1a46[_0xa848('0x30')][_0xa848('0x1e')]);_0x21ecbd[_0xa848('0x1b')]=qs[_0xa848('0x1b')](_0x4c1a46['query'][_0xa848('0x1b')]);}_0x21ecbd[_0xa848('0x38')]=qs[_0xa848('0x39')](_0x4c1a46[_0xa848('0x30')][_0xa848('0x39')]);_0x21ecbd['where']=qs[_0xa848('0x31')](_[_0xa848('0x3a')](_0x4c1a46['query'],_0x197301['filters']),_0x55c358);if(_0x4c1a46['query'][_0xa848('0x3b')]){_0x21ecbd[_0xa848('0x3c')]=_['merge'](_0x21ecbd[_0xa848('0x3c')],{'$or':_['map'](_0x55c358,function(_0x3cea31){if(_0x3cea31[_0xa848('0x2c')]!==_0xa848('0x3d')){var _0x40ca2b={};_0x40ca2b[_0x3cea31['name']]={'$like':'%'+_0x4c1a46[_0xa848('0x30')][_0xa848('0x3b')]+'%'};return _0x40ca2b;}})});}_0x21ecbd=_['merge']({},_0x21ecbd,_0x4c1a46['options']);var _0x508433={'where':_0x21ecbd[_0xa848('0x3c')]};return db[_0xa848('0x3e')][_0xa848('0x1d')](_0x508433)[_0xa848('0x25')](function(_0x107db7){_0x258f38['count']=_0x107db7;if(_0x4c1a46[_0xa848('0x30')]['includeAll']){_0x21ecbd[_0xa848('0x3f')]=[{'all':!![]}];}return db[_0xa848('0x3e')][_0xa848('0x40')](_0x21ecbd);})[_0xa848('0x25')](function(_0x5dfd54){_0x258f38[_0xa848('0x41')]=_0x5dfd54;return _0x258f38;})[_0xa848('0x25')](respondWithFilteredResult(_0x4361ce,_0x21ecbd))[_0xa848('0x42')](handleError(_0x4361ce,null));};exports['show']=function(_0x4f4532,_0xeabac9){var _0x24349c={'raw':!![],'where':{'id':_0x4f4532[_0xa848('0x43')]['id']}},_0x273ba5={};_0x273ba5[_0xa848('0x2e')]=_[_0xa848('0x2f')](db[_0xa848('0x3e')][_0xa848('0x2b')]);_0x273ba5[_0xa848('0x30')]=_['keys'](_0x4f4532[_0xa848('0x30')]);_0x273ba5[_0xa848('0x31')]=_[_0xa848('0x32')](_0x273ba5[_0xa848('0x2e')],_0x273ba5[_0xa848('0x30')]);_0x24349c[_0xa848('0x34')]=_[_0xa848('0x32')](_0x273ba5[_0xa848('0x2e')],qs[_0xa848('0x33')](_0x4f4532[_0xa848('0x30')][_0xa848('0x33')]));_0x24349c[_0xa848('0x34')]=_0x24349c['attributes'][_0xa848('0x35')]?_0x24349c[_0xa848('0x34')]:_0x273ba5[_0xa848('0x2e')];if(_0x4f4532['query'][_0xa848('0x44')]){_0x24349c[_0xa848('0x3f')]=[{'all':!![]}];}_0x24349c=_[_0xa848('0x45')]({},_0x24349c,_0x4f4532[_0xa848('0x46')]);return db[_0xa848('0x3e')][_0xa848('0x47')](_0x24349c)[_0xa848('0x25')](handleEntityNotFound(_0xeabac9,null))['then'](respondWithResult(_0xeabac9,null))[_0xa848('0x42')](handleError(_0xeabac9,null));};exports[_0xa848('0x48')]=function(_0x2e4e8a,_0x52607a){return db[_0xa848('0x3e')]['create'](_0x2e4e8a[_0xa848('0x49')],{})[_0xa848('0x25')](respondWithResult(_0x52607a,0xc9))['catch'](handleError(_0x52607a,null));};exports[_0xa848('0x24')]=function(_0x1022c2,_0x10ea15){if(_0x1022c2['body']['id']){delete _0x1022c2[_0xa848('0x49')]['id'];}return db[_0xa848('0x3e')]['find']({'where':{'id':_0x1022c2[_0xa848('0x43')]['id']}})['then'](handleEntityNotFound(_0x10ea15,null))[_0xa848('0x25')](saveUpdates(_0x1022c2[_0xa848('0x49')],null))[_0xa848('0x25')](respondWithResult(_0x10ea15,null))[_0xa848('0x42')](handleError(_0x10ea15,null));};exports['destroy']=function(_0x43c834,_0x50fd22){return db[_0xa848('0x3e')][_0xa848('0x47')]({'where':{'id':_0x43c834['params']['id']}})[_0xa848('0x25')](handleEntityNotFound(_0x50fd22,null))['then'](removeEntity(_0x50fd22,null))[_0xa848('0x42')](handleError(_0x50fd22,null));};exports['describe']=function(_0x4a2d8b,_0x317919){return db[_0xa848('0x3e')][_0xa848('0x4a')]()[_0xa848('0x25')](respondWithResult(_0x317919,null))[_0xa848('0x42')](handleError(_0x317919,null));};function wrapUser(_0x22eb69){return function(_0x147ccb){var _0x5c888c=_0x22eb69[_0xa848('0x4b')]({'plain':!![]});_0x5c888c[_0xa848('0x4c')]=[];if(_0x147ccb){_0x5c888c[_0xa848('0x4d')]=_0x147ccb[_0xa848('0x4e')];_0x5c888c[_0xa848('0x4f')]=_0x147ccb;}else{_0x5c888c[_0xa848('0x4d')]=moment(0x0)[_0xa848('0x50')](_0xa848('0x51'));_0x5c888c[_0xa848('0x4f')]={};}return _0x5c888c;};}exports[_0xa848('0x52')]=function(_0x583799,_0x18e79a,_0x61cd84){var _0x591ce6=[];return db['User'][_0xa848('0x40')]({'where':{'role':[_0xa848('0x53'),_0xa848('0x54'),_0xa848('0x55')]},'attributes':['id','fullname',_0xa848('0x27'),_0xa848('0x56'),_0xa848('0x57'),_0xa848('0x58'),_0xa848('0x59'),'lastLoginAt',_0xa848('0x5a'),_0xa848('0x5b')],'order':qs[_0xa848('0x39')]('-online'),'include':[{'model':db[_0xa848('0x5c')],'as':'VoiceQueues','attributes':['id',_0xa848('0x27'),'type'],'through':{'attributes':[]}}]})['then'](function(_0x3f5bf8){if(_0x3f5bf8){var _0x9066af=_0x583799['user'][_0xa848('0x4b')]({'plain':!![]});if(!_0x9066af)throw new Error(_0xa848('0x5d'));if(_0x9066af[_0xa848('0x56')]==='user'){return db['UserProfileSection'][_0xa848('0x47')]({'where':{'name':_0xa848('0x5e'),'userProfileId':_0x9066af[_0xa848('0x5f')]},'raw':!![]})[_0xa848('0x25')](function(_0x5f7194){if(_0x5f7194){if(_0x5f7194[_0xa848('0x60')]===0x0){return db[_0xa848('0x61')][_0xa848('0x40')]({'where':{'sectionId':_0x5f7194['id']},'raw':!![]})[_0xa848('0x25')](function(_0x5b5ebd){var _0x224140=[];if(_[_0xa848('0x62')](_0x5b5ebd)){_0x224140=_['filter'](_0x3f5bf8,function(_0x371128){if(_0x371128[_0xa848('0x56')]!==_0xa848('0x53')){return _0x371128;}});return _0x224140;}else{for(var _0x40b81f=0x0;_0x40b81f<_0x3f5bf8[_0xa848('0x35')];_0x40b81f++){var _0x36d2b4=_0x3f5bf8[_0x40b81f];if(_0x36d2b4[_0xa848('0x56')]===_0xa848('0x53')){var _0x101a66=_[_0xa848('0x47')](_0x5b5ebd,function(_0xc136ec){return _0xc136ec[_0xa848('0x63')]===_0x36d2b4['id'];});if(_0x101a66)_0x224140[_0xa848('0x64')](_0x36d2b4);}else{_0x224140['push'](_0x36d2b4);}}return _0x224140;}});}else{return _0x3f5bf8;}}else{var _0x46071d=_[_0xa848('0x3b')](_0x3f5bf8,function(_0x5a0629){if(_0x5a0629[_0xa848('0x56')]!==_0xa848('0x53')){return _0x5a0629;}});return _0x46071d;}});}else{return _0x3f5bf8;}}})[_0xa848('0x25')](function(_0x4a4934){var _0x4d5955=[];if(_0x4a4934){_0x591ce6=_0x4a4934;for(var _0x448983=0x0;_0x448983<_0x4a4934['length'];_0x448983+=0x1){_0x591ce6[_0x448983][_0xa848('0x4c')]=[];_0x4d5955['push'](db[_0xa848('0x3e')][_0xa848('0x47')]({'where':{'FromId':[_0x583799[_0xa848('0x55')]['id'],_0x4a4934[_0x448983]['id']],'ToId':[_0x583799[_0xa848('0x55')]['id'],_0x4a4934[_0x448983]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId','ToId',_0xa848('0x65'),_0xa848('0x49')],'order':qs[_0xa848('0x39')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xa848('0x25')](wrapUser(_0x4a4934[_0x448983])));}return BPromise[_0xa848('0x66')](_0x4d5955);}return[];})[_0xa848('0x25')](function(_0x4edd3d){return{'rows':_0x4edd3d,'count':_0x4edd3d['length']};})['then'](respondWithResult(_0x18e79a,null))[_0xa848('0x42')](handleError(_0x18e79a,null));};
\ No newline at end of file
+var _0xdb56=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','crypto','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','stack','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','ChatInternalMessage','includeAll','include','rows','catch','show','params','rawAttributes','options','find','create','body','update','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','getUsers','User','findAll','admin','fullname','role','userpic','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','UserProfileResource','isEmpty','agent','resourceId','push','ToId','read','-createdAt'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0xdb56,0xdc));var _0x6db5=function(_0x4b3d88,_0x49a095){_0x4b3d88=_0x4b3d88-0x0;var _0x11dbf5=_0xdb56[_0x4b3d88];return _0x11dbf5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6db5('0x0'));var zipdir=require(_0x6db5('0x1'));var jsonpatch=require(_0x6db5('0x2'));var rp=require(_0x6db5('0x3'));var moment=require(_0x6db5('0x4'));var BPromise=require(_0x6db5('0x5'));var Mustache=require(_0x6db5('0x6'));var util=require('util');var path=require(_0x6db5('0x7'));var sox=require('sox');var csv=require(_0x6db5('0x8'));var ejs=require(_0x6db5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6db5('0xa'));var squel=require('squel');var crypto=require(_0x6db5('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6db5('0x8'));var querystring=require(_0x6db5('0xc'));var Papa=require('papaparse');var Redis=require(_0x6db5('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6db5('0xe'));var logger=require(_0x6db5('0xf'))(_0x6db5('0x10'));var utils=require(_0x6db5('0x11'));var config=require(_0x6db5('0x12'));var licenseUtil=require(_0x6db5('0x13'));var db=require(_0x6db5('0x14'))['db'];config[_0x6db5('0x15')]=_[_0x6db5('0x16')](config['redis'],{'host':_0x6db5('0x17'),'port':0x18eb});var socket=require(_0x6db5('0x18'))(new Redis(config['redis']));require(_0x6db5('0x19'))[_0x6db5('0x1a')](socket);function respondWithStatusCode(_0x107353,_0x1c69a2){_0x1c69a2=_0x1c69a2||0xcc;return function(_0x32f862){if(_0x32f862){return _0x107353[_0x6db5('0x1b')](_0x1c69a2);}return _0x107353[_0x6db5('0x1c')](_0x1c69a2)[_0x6db5('0x1d')]();};}function respondWithResult(_0xfc0c4c,_0xa5a51b){_0xa5a51b=_0xa5a51b||0xc8;return function(_0x5b75a1){if(_0x5b75a1){return _0xfc0c4c[_0x6db5('0x1c')](_0xa5a51b)[_0x6db5('0x1e')](_0x5b75a1);}};}function respondWithFilteredResult(_0x3c9935,_0x514ed7){return function(_0x270ecb){if(_0x270ecb){var _0x9cf16d=typeof _0x514ed7[_0x6db5('0x1f')]===_0x6db5('0x20')&&typeof _0x514ed7[_0x6db5('0x21')]===_0x6db5('0x20');var _0x17cec0=_0x270ecb[_0x6db5('0x22')];var _0x3a98a9=_0x9cf16d?0x0:_0x514ed7['offset'];var _0x25172b=_0x9cf16d?_0x270ecb[_0x6db5('0x22')]:_0x514ed7['offset']+_0x514ed7[_0x6db5('0x21')];var _0xca576;if(_0x25172b>=_0x17cec0){_0x25172b=_0x17cec0;_0xca576=0xc8;}else{_0xca576=0xce;}_0x3c9935[_0x6db5('0x1c')](_0xca576);return _0x3c9935[_0x6db5('0x23')](_0x6db5('0x24'),_0x3a98a9+'-'+_0x25172b+'/'+_0x17cec0)[_0x6db5('0x1e')](_0x270ecb);}return null;};}function patchUpdates(_0x5f5033){return function(_0x2cb131){try{jsonpatch['apply'](_0x2cb131,_0x5f5033,!![]);}catch(_0xee19c8){return BPromise[_0x6db5('0x25')](_0xee19c8);}return _0x2cb131[_0x6db5('0x26')]();};}function saveUpdates(_0x278009,_0x10e71e){return function(_0x44e385){if(_0x44e385){return _0x44e385['update'](_0x278009)[_0x6db5('0x27')](function(_0x5a4166){return _0x5a4166;});}return null;};}function removeEntity(_0x10db9f,_0x3e6b59){return function(_0x262678){if(_0x262678){return _0x262678[_0x6db5('0x28')]()['then'](function(){_0x10db9f[_0x6db5('0x1c')](0xcc)[_0x6db5('0x1d')]();});}};}function handleEntityNotFound(_0x45b826,_0x8031b8){return function(_0x84bdae){if(!_0x84bdae){_0x45b826[_0x6db5('0x1b')](0x194);}return _0x84bdae;};}function handleError(_0x1e272b,_0x3a27b6){_0x3a27b6=_0x3a27b6||0x1f4;return function(_0x4d4ffb){logger['error'](_0x4d4ffb[_0x6db5('0x29')]);if(_0x4d4ffb[_0x6db5('0x2a')]){delete _0x4d4ffb[_0x6db5('0x2a')];}_0x1e272b[_0x6db5('0x1c')](_0x3a27b6)[_0x6db5('0x2b')](_0x4d4ffb);};}exports[_0x6db5('0x2c')]=function(_0x7aa45a,_0x1b841f){var _0x249683={},_0xf93390={},_0x4bb26f={'count':0x0,'rows':[]};var _0x325595=_[_0x6db5('0x2d')](db['ChatInternalMessage']['rawAttributes'],function(_0x3732f2){return{'name':_0x3732f2[_0x6db5('0x2e')],'type':_0x3732f2[_0x6db5('0x2f')]['key']};});_0xf93390[_0x6db5('0x30')]=_['map'](_0x325595,_0x6db5('0x2a'));_0xf93390[_0x6db5('0x31')]=_[_0x6db5('0x32')](_0x7aa45a[_0x6db5('0x31')]);_0xf93390[_0x6db5('0x33')]=_[_0x6db5('0x34')](_0xf93390[_0x6db5('0x30')],_0xf93390['query']);_0x249683['attributes']=_[_0x6db5('0x34')](_0xf93390['model'],qs[_0x6db5('0x35')](_0x7aa45a[_0x6db5('0x31')]['fields']));_0x249683['attributes']=_0x249683[_0x6db5('0x36')][_0x6db5('0x37')]?_0x249683[_0x6db5('0x36')]:_0xf93390[_0x6db5('0x30')];if(!_0x7aa45a[_0x6db5('0x31')][_0x6db5('0x38')](_0x6db5('0x39'))){_0x249683[_0x6db5('0x21')]=qs[_0x6db5('0x21')](_0x7aa45a[_0x6db5('0x31')][_0x6db5('0x21')]);_0x249683['offset']=qs[_0x6db5('0x1f')](_0x7aa45a[_0x6db5('0x31')][_0x6db5('0x1f')]);}_0x249683['order']=qs[_0x6db5('0x3a')](_0x7aa45a[_0x6db5('0x31')][_0x6db5('0x3a')]);_0x249683['where']=qs[_0x6db5('0x33')](_[_0x6db5('0x3b')](_0x7aa45a[_0x6db5('0x31')],_0xf93390[_0x6db5('0x33')]),_0x325595);if(_0x7aa45a['query'][_0x6db5('0x3c')]){_0x249683[_0x6db5('0x3d')]=_['merge'](_0x249683[_0x6db5('0x3d')],{'$or':_[_0x6db5('0x2d')](_0x325595,function(_0x5ba49f){if(_0x5ba49f['type']!==_0x6db5('0x3e')){var _0x1cd9fd={};_0x1cd9fd[_0x5ba49f[_0x6db5('0x2a')]]={'$like':'%'+_0x7aa45a[_0x6db5('0x31')][_0x6db5('0x3c')]+'%'};return _0x1cd9fd;}})});}_0x249683=_[_0x6db5('0x3f')]({},_0x249683,_0x7aa45a['options']);var _0x5f0e82={'where':_0x249683[_0x6db5('0x3d')]};return db[_0x6db5('0x40')][_0x6db5('0x22')](_0x5f0e82)['then'](function(_0x2268fc){_0x4bb26f[_0x6db5('0x22')]=_0x2268fc;if(_0x7aa45a[_0x6db5('0x31')][_0x6db5('0x41')]){_0x249683[_0x6db5('0x42')]=[{'all':!![]}];}return db['ChatInternalMessage']['findAll'](_0x249683);})['then'](function(_0x3672c6){_0x4bb26f[_0x6db5('0x43')]=_0x3672c6;return _0x4bb26f;})[_0x6db5('0x27')](respondWithFilteredResult(_0x1b841f,_0x249683))[_0x6db5('0x44')](handleError(_0x1b841f,null));};exports[_0x6db5('0x45')]=function(_0x36b04a,_0xbb3978){var _0x16cf14={'raw':!![],'where':{'id':_0x36b04a[_0x6db5('0x46')]['id']}},_0x5e6b77={};_0x5e6b77['model']=_[_0x6db5('0x32')](db[_0x6db5('0x40')][_0x6db5('0x47')]);_0x5e6b77[_0x6db5('0x31')]=_[_0x6db5('0x32')](_0x36b04a[_0x6db5('0x31')]);_0x5e6b77[_0x6db5('0x33')]=_[_0x6db5('0x34')](_0x5e6b77[_0x6db5('0x30')],_0x5e6b77[_0x6db5('0x31')]);_0x16cf14[_0x6db5('0x36')]=_['intersection'](_0x5e6b77[_0x6db5('0x30')],qs[_0x6db5('0x35')](_0x36b04a['query'][_0x6db5('0x35')]));_0x16cf14[_0x6db5('0x36')]=_0x16cf14['attributes'][_0x6db5('0x37')]?_0x16cf14[_0x6db5('0x36')]:_0x5e6b77[_0x6db5('0x30')];if(_0x36b04a[_0x6db5('0x31')][_0x6db5('0x41')]){_0x16cf14[_0x6db5('0x42')]=[{'all':!![]}];}_0x16cf14=_['merge']({},_0x16cf14,_0x36b04a[_0x6db5('0x48')]);return db[_0x6db5('0x40')][_0x6db5('0x49')](_0x16cf14)[_0x6db5('0x27')](handleEntityNotFound(_0xbb3978,null))['then'](respondWithResult(_0xbb3978,null))['catch'](handleError(_0xbb3978,null));};exports[_0x6db5('0x4a')]=function(_0x4a430c,_0xa2b972){return db['ChatInternalMessage'][_0x6db5('0x4a')](_0x4a430c[_0x6db5('0x4b')],{})[_0x6db5('0x27')](respondWithResult(_0xa2b972,0xc9))[_0x6db5('0x44')](handleError(_0xa2b972,null));};exports[_0x6db5('0x4c')]=function(_0x205848,_0x1d664e){if(_0x205848[_0x6db5('0x4b')]['id']){delete _0x205848[_0x6db5('0x4b')]['id'];}return db[_0x6db5('0x40')][_0x6db5('0x49')]({'where':{'id':_0x205848[_0x6db5('0x46')]['id']}})[_0x6db5('0x27')](handleEntityNotFound(_0x1d664e,null))[_0x6db5('0x27')](saveUpdates(_0x205848['body'],null))[_0x6db5('0x27')](respondWithResult(_0x1d664e,null))[_0x6db5('0x44')](handleError(_0x1d664e,null));};exports[_0x6db5('0x28')]=function(_0x3624bd,_0x6052ed){return db[_0x6db5('0x40')][_0x6db5('0x49')]({'where':{'id':_0x3624bd[_0x6db5('0x46')]['id']}})[_0x6db5('0x27')](handleEntityNotFound(_0x6052ed,null))[_0x6db5('0x27')](removeEntity(_0x6052ed,null))[_0x6db5('0x44')](handleError(_0x6052ed,null));};exports[_0x6db5('0x4d')]=function(_0x522cb0,_0xe06d2c){return db['ChatInternalMessage'][_0x6db5('0x4d')]()[_0x6db5('0x27')](respondWithResult(_0xe06d2c,null))[_0x6db5('0x44')](handleError(_0xe06d2c,null));};function wrapUser(_0x268e26){return function(_0x41fca4){var _0x11bb83=_0x268e26[_0x6db5('0x4e')]({'plain':!![]});_0x11bb83[_0x6db5('0x4f')]=[];if(_0x41fca4){_0x11bb83[_0x6db5('0x50')]=_0x41fca4[_0x6db5('0x51')];_0x11bb83[_0x6db5('0x52')]=_0x41fca4;}else{_0x11bb83[_0x6db5('0x50')]=moment(0x0)[_0x6db5('0x53')]('YYYY-MM-DD\x20HH:mm:ss');_0x11bb83['lastMessage']={};}return _0x11bb83;};}exports[_0x6db5('0x54')]=function(_0x5db343,_0x4e82f3,_0x4ca4ea){var _0x4ea23e=[];return db[_0x6db5('0x55')][_0x6db5('0x56')]({'where':{'role':['agent',_0x6db5('0x57'),'user']},'attributes':['id',_0x6db5('0x58'),_0x6db5('0x2a'),_0x6db5('0x59'),_0x6db5('0x5a'),'internal',_0x6db5('0x5b'),_0x6db5('0x5c'),_0x6db5('0x5d'),_0x6db5('0x5e')],'order':qs['sort']('-online'),'include':[{'model':db[_0x6db5('0x5f')],'as':_0x6db5('0x60'),'attributes':['id',_0x6db5('0x2a'),_0x6db5('0x2f')],'through':{'attributes':[]}}]})[_0x6db5('0x27')](function(_0x3668ae){if(_0x3668ae){var _0x220929=_0x5db343[_0x6db5('0x61')][_0x6db5('0x4e')]({'plain':!![]});if(!_0x220929)throw new Error(_0x6db5('0x62'));if(_0x220929[_0x6db5('0x59')]===_0x6db5('0x61')){return db[_0x6db5('0x63')][_0x6db5('0x49')]({'where':{'name':_0x6db5('0x64'),'userProfileId':_0x220929[_0x6db5('0x65')]},'raw':!![]})['then'](function(_0x229581){if(_0x229581){if(_0x229581['autoAssociation']===0x0){return db[_0x6db5('0x66')][_0x6db5('0x56')]({'where':{'sectionId':_0x229581['id']},'raw':!![]})[_0x6db5('0x27')](function(_0xbe2322){var _0x577967=[];if(_[_0x6db5('0x67')](_0xbe2322)){_0x577967=_['filter'](_0x3668ae,function(_0x296d90){if(_0x296d90[_0x6db5('0x59')]!==_0x6db5('0x68')){return _0x296d90;}});return _0x577967;}else{for(var _0x2b1c7a=0x0;_0x2b1c7a<_0x3668ae['length'];_0x2b1c7a++){var _0x398b9d=_0x3668ae[_0x2b1c7a];if(_0x398b9d[_0x6db5('0x59')]==='agent'){var _0x14009d=_[_0x6db5('0x49')](_0xbe2322,function(_0x3bc0a3){return _0x3bc0a3[_0x6db5('0x69')]===_0x398b9d['id'];});if(_0x14009d)_0x577967[_0x6db5('0x6a')](_0x398b9d);}else{_0x577967[_0x6db5('0x6a')](_0x398b9d);}}return _0x577967;}});}else{return _0x3668ae;}}else{var _0x495ce1=_[_0x6db5('0x3c')](_0x3668ae,function(_0x15295d){if(_0x15295d[_0x6db5('0x59')]!==_0x6db5('0x68')){return _0x15295d;}});return _0x495ce1;}});}else{return _0x3668ae;}}})[_0x6db5('0x27')](function(_0x5abf97){var _0x1b934e=[];if(_0x5abf97){_0x4ea23e=_0x5abf97;for(var _0x1ff608=0x0;_0x1ff608<_0x5abf97[_0x6db5('0x37')];_0x1ff608+=0x1){_0x4ea23e[_0x1ff608][_0x6db5('0x4f')]=[];_0x1b934e[_0x6db5('0x6a')](db[_0x6db5('0x40')][_0x6db5('0x49')]({'where':{'FromId':[_0x5db343['user']['id'],_0x5abf97[_0x1ff608]['id']],'ToId':[_0x5db343['user']['id'],_0x5abf97[_0x1ff608]['id']],'ChatGroupId':null},'attributes':['id',_0x6db5('0x51'),'FromId',_0x6db5('0x6b'),_0x6db5('0x6c'),'body'],'order':qs[_0x6db5('0x3a')](_0x6db5('0x6d')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x5abf97[_0x1ff608])));}return BPromise['all'](_0x1b934e);}return[];})[_0x6db5('0x27')](function(_0x504bc3){return{'rows':_0x504bc3,'count':_0x504bc3[_0x6db5('0x37')]};})['then'](respondWithResult(_0x4e82f3,null))['catch'](handleError(_0x4e82f3,null));};
\ No newline at end of file
index 16737e2..683722e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb47=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x561432,_0x21ec65){var _0x3485b6=function(_0x3e022f){while(--_0x3e022f){_0x561432['push'](_0x561432['shift']());}};_0x3485b6(++_0x21ec65);}(_0xeb47,0x1b7));var _0x7eb4=function(_0xec7e54,_0x46135c){_0xec7e54=_0xec7e54-0x0;var _0x136d5a=_0xeb47[_0xec7e54];return _0x136d5a;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x7eb4('0x0'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7eb4('0x1'),'afterUpdate':_0x7eb4('0x2'),'afterDestroy':_0x7eb4('0x3')};function emitEvent(_0x65ac50){return function(_0x4fee3e,_0x5aad38,_0x36724c){ChatInternalMessageEvents[_0x7eb4('0x4')](_0x65ac50+':'+_0x4fee3e['id'],_0x4fee3e);ChatInternalMessageEvents[_0x7eb4('0x4')](_0x65ac50,_0x4fee3e);_0x36724c(null);};}for(var e in events){if(events[_0x7eb4('0x5')](e)){var event=events[e];ChatInternalMessage[_0x7eb4('0x6')](e,emitEvent(event));}}module[_0x7eb4('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x5b6e=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','update'];(function(_0xd4636c,_0x34dbf6){var _0x5ee17d=function(_0x223c38){while(--_0x223c38){_0xd4636c['push'](_0xd4636c['shift']());}};_0x5ee17d(++_0x34dbf6);}(_0x5b6e,0x14c));var _0xe5b6=function(_0x42a91d,_0x5e9038){_0x42a91d=_0x42a91d-0x0;var _0x31fe24=_0x5b6e[_0x42a91d];return _0x31fe24;};'use strict';var EventEmitter=require(_0xe5b6('0x0'));var ChatInternalMessage=require(_0xe5b6('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xe5b6('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe5b6('0x3'),'afterDestroy':_0xe5b6('0x4')};function emitEvent(_0x1bb70d){return function(_0x5bc7a1,_0x54b438,_0x3f1947){ChatInternalMessageEvents[_0xe5b6('0x5')](_0x1bb70d+':'+_0x5bc7a1['id'],_0x5bc7a1);ChatInternalMessageEvents[_0xe5b6('0x5')](_0x1bb70d,_0x5bc7a1);_0x3f1947(null);};}for(var e in events){if(events[_0xe5b6('0x6')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xe5b6('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
index 773a5b1..0c79812 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf6d4=['lodash','../../config/logger','moment','bluebird','request-promise','rimraf','exports','define','chat_internal_messages','utf8mb4_unicode_ci'];(function(_0x5db0c1,_0x335e4c){var _0x5a2983=function(_0xd62f38){while(--_0xd62f38){_0x5db0c1['push'](_0x5db0c1['shift']());}};_0x5a2983(++_0x335e4c);}(_0xf6d4,0x14a));var _0x4f6d=function(_0x4ccc75,_0x290732){_0x4ccc75=_0x4ccc75-0x0;var _0x2f7ba3=_0xf6d4[_0x4ccc75];return _0x2f7ba3;};'use strict';var _=require(_0x4f6d('0x0'));var util=require('util');var logger=require(_0x4f6d('0x1'))('api');var moment=require(_0x4f6d('0x2'));var BPromise=require(_0x4f6d('0x3'));var rp=require(_0x4f6d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4f6d('0x5'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0x4f6d('0x6')]=function(_0x4e563e,_0x5cb4bc){return _0x4e563e[_0x4f6d('0x7')]('ChatInternalMessage',attributes,{'tableName':_0x4f6d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4f6d('0x9')});};
\ No newline at end of file
+var _0xc7d9=['../../config/logger','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0xc7d9,0x82));var _0x9c7d=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xc7d9[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x9c7d('0x0'));var util=require(_0x9c7d('0x1'));var logger=require(_0x9c7d('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9c7d('0x3'));var fs=require('fs');var path=require(_0x9c7d('0x4'));var rimraf=require(_0x9c7d('0x5'));var config=require(_0x9c7d('0x6'));var attributes=require(_0x9c7d('0x7'));module['exports']=function(_0x360755,_0x524ceb){return _0x360755['define'](_0x9c7d('0x8'),attributes,{'tableName':_0x9c7d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9c7d('0xa'),'collate':_0x9c7d('0xb')});};
\ No newline at end of file
index 3c61eb9..598be44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb88=['request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','register','request','info','ChatInternalMessage,\x20%s,\x20%s'];(function(_0x4d6f43,_0x6cc7de){var _0x4d0798=function(_0x3f4c74){while(--_0x3f4c74){_0x4d6f43['push'](_0x4d6f43['shift']());}};_0x4d0798(++_0x6cc7de);}(_0xcb88,0x14c));var _0x8cb8=function(_0x5c9f5d,_0x3044ce){_0x5c9f5d=_0x5c9f5d-0x0;var _0x202878=_0xcb88[_0x5c9f5d];return _0x202878;};'use strict';var _=require(_0x8cb8('0x0'));var util=require(_0x8cb8('0x1'));var moment=require(_0x8cb8('0x2'));var BPromise=require(_0x8cb8('0x3'));var rs=require(_0x8cb8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8cb8('0x5'))['db'];var utils=require(_0x8cb8('0x6'));var logger=require(_0x8cb8('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8cb8('0x8'));var client=jayson[_0x8cb8('0x9')][_0x8cb8('0xa')]({'port':0x232a});config[_0x8cb8('0xb')]=_[_0x8cb8('0xc')](config[_0x8cb8('0xb')],{'host':_0x8cb8('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8cb8('0xb')]));require('./chatInternalMessage.socket')[_0x8cb8('0xe')](socket);function respondWithRpcPromise(_0x4d37d0,_0x1668ed,_0xf93d41){return new BPromise(function(_0x266c45,_0x148b00){return client[_0x8cb8('0xf')](_0x4d37d0,_0xf93d41)['then'](function(_0x1ae8c6){logger[_0x8cb8('0x10')](_0x8cb8('0x11'),_0x1668ed,_0x8cb8('0x12'));logger[_0x8cb8('0x13')](_0x8cb8('0x14'),_0x1668ed,_0x8cb8('0x12'),JSON[_0x8cb8('0x15')](_0x1ae8c6));if(_0x1ae8c6[_0x8cb8('0x16')]){if(_0x1ae8c6[_0x8cb8('0x16')]['code']===0x1f4){logger[_0x8cb8('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x1668ed,_0x1ae8c6[_0x8cb8('0x16')][_0x8cb8('0x17')]);return _0x148b00(_0x1ae8c6[_0x8cb8('0x16')][_0x8cb8('0x17')]);}logger[_0x8cb8('0x16')](_0x8cb8('0x11'),_0x1668ed,_0x1ae8c6['error'][_0x8cb8('0x17')]);return _0x266c45(_0x1ae8c6[_0x8cb8('0x16')][_0x8cb8('0x17')]);}else{logger[_0x8cb8('0x10')](_0x8cb8('0x11'),_0x1668ed,_0x8cb8('0x12'));_0x266c45(_0x1ae8c6[_0x8cb8('0x18')][_0x8cb8('0x17')]);}})['catch'](function(_0xe09537){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x1668ed,_0xe09537);_0x148b00(_0xe09537);});});}
\ No newline at end of file
+var _0x0441=['client','http','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5046cc,_0x3c7430){var _0x27365a=function(_0xee979b){while(--_0xee979b){_0x5046cc['push'](_0x5046cc['shift']());}};_0x27365a(++_0x3c7430);}(_0x0441,0x8c));var _0x1044=function(_0x374ccf,_0xa945c4){_0x374ccf=_0x374ccf-0x0;var _0x443cde=_0x0441[_0x374ccf];return _0x443cde;};'use strict';var _=require(_0x1044('0x0'));var util=require(_0x1044('0x1'));var moment=require(_0x1044('0x2'));var BPromise=require(_0x1044('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1044('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1044('0x5'));var logger=require(_0x1044('0x6'))(_0x1044('0x7'));var config=require(_0x1044('0x8'));var jayson=require(_0x1044('0x9'));var client=jayson[_0x1044('0xa')][_0x1044('0xb')]({'port':0x232a});config[_0x1044('0xc')]=_[_0x1044('0xd')](config[_0x1044('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x1044('0xe'))(new Redis(config[_0x1044('0xc')]));require(_0x1044('0xf'))[_0x1044('0x10')](socket);function respondWithRpcPromise(_0x364f34,_0x1b0f8c,_0x323c5d){return new BPromise(function(_0x33aea9,_0x3dfd34){return client[_0x1044('0x11')](_0x364f34,_0x323c5d)[_0x1044('0x12')](function(_0x30ecce){logger[_0x1044('0x13')](_0x1044('0x14'),_0x1b0f8c,'request\x20sent');logger[_0x1044('0x15')](_0x1044('0x16'),_0x1b0f8c,_0x1044('0x17'),JSON[_0x1044('0x18')](_0x30ecce));if(_0x30ecce[_0x1044('0x19')]){if(_0x30ecce[_0x1044('0x19')][_0x1044('0x1a')]===0x1f4){logger[_0x1044('0x19')]('ChatInternalMessage,\x20%s,\x20%s',_0x1b0f8c,_0x30ecce[_0x1044('0x19')][_0x1044('0x1b')]);return _0x3dfd34(_0x30ecce[_0x1044('0x19')][_0x1044('0x1b')]);}logger[_0x1044('0x19')](_0x1044('0x14'),_0x1b0f8c,_0x30ecce['error'][_0x1044('0x1b')]);return _0x33aea9(_0x30ecce['error'][_0x1044('0x1b')]);}else{logger[_0x1044('0x13')](_0x1044('0x14'),_0x1b0f8c,_0x1044('0x17'));_0x33aea9(_0x30ecce[_0x1044('0x1c')][_0x1044('0x1b')]);}})[_0x1044('0x1d')](function(_0x69cdce){logger[_0x1044('0x19')](_0x1044('0x14'),_0x1b0f8c,_0x69cdce);_0x3dfd34(_0x69cdce);});});}
\ No newline at end of file
index 7220b49..3708e85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe255=['chatInternalMessage:','save','remove','emit','removeListener','register','length'];(function(_0x55d038,_0x58b889){var _0xac442f=function(_0x580ddf){while(--_0x580ddf){_0x55d038['push'](_0x55d038['shift']());}};_0xac442f(++_0x58b889);}(_0xe255,0x104));var _0x5e25=function(_0x46229a,_0x5b7fbc){_0x46229a=_0x46229a-0x0;var _0xd68564=_0xe255[_0x46229a];return _0xd68564;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x5e25('0x0'),_0x5e25('0x1'),'update'];function createListener(_0x1fa85c,_0x544763){return function(_0x3e2af0){_0x544763[_0x5e25('0x2')](_0x1fa85c,_0x3e2af0);};}function removeListener(_0x5ca07a,_0x29bd17){return function(){ChatInternalMessageEvents[_0x5e25('0x3')](_0x5ca07a,_0x29bd17);};}exports[_0x5e25('0x4')]=function(_0x232fbf){for(var _0x21957b=0x0,_0x486703=events[_0x5e25('0x5')];_0x21957b<_0x486703;_0x21957b++){var _0x15ae05=events[_0x21957b];var _0x12df1d=createListener(_0x5e25('0x6')+_0x15ae05,_0x232fbf);ChatInternalMessageEvents['on'](_0x15ae05,_0x12df1d);}};
\ No newline at end of file
+var _0xc254=['chatInternalMessage:','remove','update','removeListener','register','length'];(function(_0x42dd53,_0x48aa95){var _0x4be107=function(_0x351acd){while(--_0x351acd){_0x42dd53['push'](_0x42dd53['shift']());}};_0x4be107(++_0x48aa95);}(_0xc254,0x1ed));var _0x4c25=function(_0x874d7c,_0x3b30ed){_0x874d7c=_0x874d7c-0x0;var _0x47b1a9=_0xc254[_0x874d7c];return _0x47b1a9;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=['save',_0x4c25('0x0'),_0x4c25('0x1')];function createListener(_0x61dd7f,_0x43c509){return function(_0x308804){_0x43c509['emit'](_0x61dd7f,_0x308804);};}function removeListener(_0x48bfab,_0x44f167){return function(){ChatInternalMessageEvents[_0x4c25('0x2')](_0x48bfab,_0x44f167);};}exports[_0x4c25('0x3')]=function(_0x189c84){for(var _0x628dc=0x0,_0x3ec8e5=events[_0x4c25('0x4')];_0x628dc<_0x3ec8e5;_0x628dc++){var _0x556c92=events[_0x628dc];var _0x2360c0=createListener(_0x4c25('0x5')+_0x556c92,_0x189c84);ChatInternalMessageEvents['on'](_0x556c92,_0x2360c0);}};
\ No newline at end of file
index 6482ac4..38ffd4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0504=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','isAuthenticated','get','/describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x433b00,_0x194621){var _0x43e9cf=function(_0x32943f){while(--_0x32943f){_0x433b00['push'](_0x433b00['shift']());}};_0x43e9cf(++_0x194621);}(_0x0504,0x18d));var _0x4050=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x0504[_0xb0f7c3];return _0x28ea68;};'use strict';var multer=require(_0x4050('0x0'));var util=require(_0x4050('0x1'));var path=require('path');var timeout=require(_0x4050('0x2'));var express=require(_0x4050('0x3'));var router=express[_0x4050('0x4')]();var fs_extra=require(_0x4050('0x5'));var auth=require(_0x4050('0x6'));var interaction=require(_0x4050('0x7'));var config=require('../../config/environment');var controller=require(_0x4050('0x8'));router['get']('/',auth[_0x4050('0x9')](),controller['index']);router[_0x4050('0xa')](_0x4050('0xb'),auth[_0x4050('0x9')](),controller['describe']);router['get']('/users',auth[_0x4050('0x9')](),controller['getUsers']);router['get'](_0x4050('0xc'),auth[_0x4050('0x9')](),controller[_0x4050('0xd')]);router['post']('/',auth[_0x4050('0x9')](),controller[_0x4050('0xe')]);router[_0x4050('0xf')](_0x4050('0xc'),controller[_0x4050('0x10')]);router[_0x4050('0x11')](_0x4050('0xc'),auth['isAuthenticated'](),controller[_0x4050('0x12')]);module[_0x4050('0x13')]=router;
\ No newline at end of file
+var _0x6c81=['../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show','post','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x6c81,0x10c));var _0x16c8=function(_0x11c221,_0x65c6a5){_0x11c221=_0x11c221-0x0;var _0x26deef=_0x6c81[_0x11c221];return _0x26deef;};'use strict';var multer=require(_0x16c8('0x0'));var util=require(_0x16c8('0x1'));var path=require(_0x16c8('0x2'));var timeout=require(_0x16c8('0x3'));var express=require(_0x16c8('0x4'));var router=express[_0x16c8('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x16c8('0x6'));var interaction=require(_0x16c8('0x7'));var config=require(_0x16c8('0x8'));var controller=require(_0x16c8('0x9'));router[_0x16c8('0xa')]('/',auth[_0x16c8('0xb')](),controller[_0x16c8('0xc')]);router[_0x16c8('0xa')](_0x16c8('0xd'),auth[_0x16c8('0xb')](),controller[_0x16c8('0xe')]);router[_0x16c8('0xa')](_0x16c8('0xf'),auth[_0x16c8('0xb')](),controller[_0x16c8('0x10')]);router[_0x16c8('0xa')](_0x16c8('0x11'),auth['isAuthenticated'](),controller[_0x16c8('0x12')]);router[_0x16c8('0x13')]('/',auth[_0x16c8('0xb')](),controller['create']);router['put'](_0x16c8('0x11'),controller['update']);router[_0x16c8('0x14')](_0x16c8('0x11'),auth[_0x16c8('0xb')](),controller[_0x16c8('0x15')]);module[_0x16c8('0x16')]=router;
\ No newline at end of file
index 511af96..6474946 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa249=['BOOLEAN','ENUM','out','sequelize','exports','medium'];(function(_0x552752,_0x423e32){var _0x19fa79=function(_0xc5e894){while(--_0xc5e894){_0x552752['push'](_0x552752['shift']());}};_0x19fa79(++_0x423e32);}(_0xa249,0x183));var _0x9a24=function(_0x366f43,_0x3e11e7){_0x366f43=_0x366f43-0x0;var _0x46dcd8=_0xa249[_0x366f43];return _0x46dcd8;};'use strict';var Sequelize=require(_0x9a24('0x0'));module[_0x9a24('0x1')]={'body':{'type':Sequelize['TEXT'](_0x9a24('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x9a24('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x9a24('0x4')]('in','out'),'defaultValue':_0x9a24('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x1678=['out','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x106cc7,_0x24ca66){var _0x42eb73=function(_0x1cb144){while(--_0x1cb144){_0x106cc7['push'](_0x106cc7['shift']());}};_0x42eb73(++_0x24ca66);}(_0x1678,0x17b));var _0x8167=function(_0x2b470a,_0x3379d9){_0x2b470a=_0x2b470a-0x0;var _0x55b41c=_0x1678[_0x2b470a];return _0x55b41c;};'use strict';var Sequelize=require(_0x8167('0x0'));module[_0x8167('0x1')]={'body':{'type':Sequelize[_0x8167('0x2')](_0x8167('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x8167('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x8167('0x5')),'defaultValue':_0x8167('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x8167('0x6')]},'providerName':{'type':Sequelize[_0x8167('0x7')]},'providerResponse':{'type':Sequelize[_0x8167('0x2')]}};
\ No newline at end of file
index f510d91..30e31fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb1e7=['reject','save','update','then','destroy','stack','name','map','ChatMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','includeAll','find','catch','create','body','params','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','ChatInteraction','ChatInteractionId','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','RejectMessage','rejectMessage','ContactId','QueryTypes','rejectmessage','formData','eml-format','fast-json-patch','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./chatMessage.socket','register','client','http','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb1e7,0xd5));var _0x7b1e=function(_0x4fb614,_0x3f1326){_0x4fb614=_0x4fb614-0x0;var _0x14222b=_0xb1e7[_0x4fb614];return _0x14222b;};'use strict';var emlformat=require(_0x7b1e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7b1e('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7b1e('0x2'));var util=require('util');var path=require(_0x7b1e('0x3'));var sox=require(_0x7b1e('0x4'));var csv=require('to-csv');var ejs=require(_0x7b1e('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7b1e('0x6'));var squel=require(_0x7b1e('0x7'));var crypto=require('crypto');var jsforce=require(_0x7b1e('0x8'));var deskjs=require(_0x7b1e('0x9'));var toCsv=require(_0x7b1e('0xa'));var querystring=require(_0x7b1e('0xb'));var Papa=require('papaparse');var Redis=require(_0x7b1e('0xc'));var authService=require(_0x7b1e('0xd'));var qs=require(_0x7b1e('0xe'));var as=require(_0x7b1e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7b1e('0x10'))('api');var utils=require(_0x7b1e('0x11'));var config=require(_0x7b1e('0x12'));var licenseUtil=require(_0x7b1e('0x13'));var db=require('../../mysqldb')['db'];config[_0x7b1e('0x14')]=_[_0x7b1e('0x15')](config[_0x7b1e('0x14')],{'host':_0x7b1e('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7b1e('0x14')]));require(_0x7b1e('0x17'))[_0x7b1e('0x18')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x7b1e('0x19')][_0x7b1e('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xc0fbe2,_0x3dcf26,_0x618728,_0x405596){return new BPromise(function(_0x48363d,_0x1d029b){var _0x3bac12=_0x405596||client;return _0x3bac12[_0x7b1e('0x1b')](_0xc0fbe2,_0x618728)['then'](function(_0x4f7133){logger[_0x7b1e('0x1c')](_0x7b1e('0x1d'),_0x3dcf26,_0x7b1e('0x1e'));logger['debug'](_0x7b1e('0x1f'),_0x3dcf26,_0x7b1e('0x1e'),JSON[_0x7b1e('0x20')](_0x4f7133));if(_0x4f7133[_0x7b1e('0x21')]){if(_0x4f7133[_0x7b1e('0x21')][_0x7b1e('0x22')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x3dcf26,_0x4f7133['error']['message']);return _0x1d029b(_0x4f7133['error']['message']);}logger[_0x7b1e('0x21')]('ChatMessage,\x20%s,\x20%s',_0x3dcf26,_0x4f7133[_0x7b1e('0x21')]['message']);return _0x48363d(_0x4f7133['error'][_0x7b1e('0x23')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x3dcf26,_0x7b1e('0x1e'));_0x48363d(_0x4f7133[_0x7b1e('0x24')][_0x7b1e('0x23')]);}})['catch'](function(_0x4613cc){logger[_0x7b1e('0x21')](_0x7b1e('0x1d'),_0x3dcf26,_0x4613cc);_0x1d029b(_0x4613cc);});});}function respondWithStatusCode(_0x1a6f83,_0x42070c){_0x42070c=_0x42070c||0xcc;return function(_0x389c9f){if(_0x389c9f){return _0x1a6f83[_0x7b1e('0x25')](_0x42070c);}return _0x1a6f83[_0x7b1e('0x26')](_0x42070c)[_0x7b1e('0x27')]();};}function respondWithResult(_0x15365a,_0x5af894){_0x5af894=_0x5af894||0xc8;return function(_0x3718b6){if(_0x3718b6){return _0x15365a[_0x7b1e('0x26')](_0x5af894)[_0x7b1e('0x28')](_0x3718b6);}};}function respondWithFilteredResult(_0x3419df,_0x118d37){return function(_0x4db6e2){if(_0x4db6e2){var _0x1819fe=typeof _0x118d37[_0x7b1e('0x29')]===_0x7b1e('0x2a')&&typeof _0x118d37['limit']===_0x7b1e('0x2a');var _0x28b789=_0x4db6e2[_0x7b1e('0x2b')];var _0x37fd38=_0x1819fe?0x0:_0x118d37[_0x7b1e('0x29')];var _0xf8634b=_0x1819fe?_0x4db6e2[_0x7b1e('0x2b')]:_0x118d37[_0x7b1e('0x29')]+_0x118d37[_0x7b1e('0x2c')];var _0x27810b;if(_0xf8634b>=_0x28b789){_0xf8634b=_0x28b789;_0x27810b=0xc8;}else{_0x27810b=0xce;}_0x3419df[_0x7b1e('0x26')](_0x27810b);return _0x3419df['set'](_0x7b1e('0x2d'),_0x37fd38+'-'+_0xf8634b+'/'+_0x28b789)[_0x7b1e('0x28')](_0x4db6e2);}return null;};}function patchUpdates(_0x283ad5){return function(_0x18f212){try{jsonpatch[_0x7b1e('0x2e')](_0x18f212,_0x283ad5,!![]);}catch(_0xbda323){return BPromise[_0x7b1e('0x2f')](_0xbda323);}return _0x18f212[_0x7b1e('0x30')]();};}function saveUpdates(_0x552fa1,_0x4252cb){return function(_0x3a882a){if(_0x3a882a){return _0x3a882a[_0x7b1e('0x31')](_0x552fa1)[_0x7b1e('0x32')](function(_0x3510a4){return _0x3510a4;});}return null;};}function removeEntity(_0x2548ed,_0x3b1f59){return function(_0x580b55){if(_0x580b55){return _0x580b55[_0x7b1e('0x33')]()[_0x7b1e('0x32')](function(){_0x2548ed['status'](0xcc)[_0x7b1e('0x27')]();});}};}function handleEntityNotFound(_0x1cc2e1,_0x54be6c){return function(_0x4537cd){if(!_0x4537cd){_0x1cc2e1['sendStatus'](0x194);}return _0x4537cd;};}function handleError(_0x1cf461,_0x4245f4){_0x4245f4=_0x4245f4||0x1f4;return function(_0x8a331f){logger[_0x7b1e('0x21')](_0x8a331f[_0x7b1e('0x34')]);if(_0x8a331f[_0x7b1e('0x35')]){delete _0x8a331f[_0x7b1e('0x35')];}_0x1cf461[_0x7b1e('0x26')](_0x4245f4)['send'](_0x8a331f);};}exports['index']=function(_0x2ffae6,_0x34f3b2){var _0x3903f9={},_0x14b79f={},_0x238313={'count':0x0,'rows':[]};var _0x8e4a86=_[_0x7b1e('0x36')](db[_0x7b1e('0x37')][_0x7b1e('0x38')],function(_0x29bd94){return{'name':_0x29bd94[_0x7b1e('0x39')],'type':_0x29bd94[_0x7b1e('0x3a')][_0x7b1e('0x3b')]};});_0x14b79f['model']=_[_0x7b1e('0x36')](_0x8e4a86,_0x7b1e('0x35'));_0x14b79f[_0x7b1e('0x3c')]=_[_0x7b1e('0x3d')](_0x2ffae6['query']);_0x14b79f[_0x7b1e('0x3e')]=_[_0x7b1e('0x3f')](_0x14b79f[_0x7b1e('0x40')],_0x14b79f[_0x7b1e('0x3c')]);_0x3903f9[_0x7b1e('0x41')]=_['intersection'](_0x14b79f['model'],qs[_0x7b1e('0x42')](_0x2ffae6[_0x7b1e('0x3c')][_0x7b1e('0x42')]));_0x3903f9[_0x7b1e('0x41')]=_0x3903f9[_0x7b1e('0x41')][_0x7b1e('0x43')]?_0x3903f9[_0x7b1e('0x41')]:_0x14b79f[_0x7b1e('0x40')];if(!_0x2ffae6['query']['hasOwnProperty'](_0x7b1e('0x44'))){_0x3903f9[_0x7b1e('0x2c')]=qs['limit'](_0x2ffae6[_0x7b1e('0x3c')]['limit']);_0x3903f9[_0x7b1e('0x29')]=qs['offset'](_0x2ffae6[_0x7b1e('0x3c')][_0x7b1e('0x29')]);}_0x3903f9[_0x7b1e('0x45')]=qs[_0x7b1e('0x46')](_0x2ffae6['query'][_0x7b1e('0x46')]);_0x3903f9[_0x7b1e('0x47')]=qs[_0x7b1e('0x3e')](_[_0x7b1e('0x48')](_0x2ffae6['query'],_0x14b79f[_0x7b1e('0x3e')]),_0x8e4a86);if(_0x2ffae6[_0x7b1e('0x3c')][_0x7b1e('0x49')]){_0x3903f9['where']=_[_0x7b1e('0x4a')](_0x3903f9[_0x7b1e('0x47')],{'$or':_[_0x7b1e('0x36')](_0x8e4a86,function(_0x38fce9){if(_0x38fce9['type']!==_0x7b1e('0x4b')){var _0x55a77a={};_0x55a77a[_0x38fce9[_0x7b1e('0x35')]]={'$like':'%'+_0x2ffae6[_0x7b1e('0x3c')][_0x7b1e('0x49')]+'%'};return _0x55a77a;}})});}_0x3903f9=_[_0x7b1e('0x4a')]({},_0x3903f9,_0x2ffae6[_0x7b1e('0x4c')]);var _0x3a50fd={'where':_0x3903f9[_0x7b1e('0x47')]};return db[_0x7b1e('0x37')]['count'](_0x3a50fd)['then'](function(_0x23a0c4){_0x238313['count']=_0x23a0c4;if(_0x2ffae6[_0x7b1e('0x3c')]['includeAll']){_0x3903f9[_0x7b1e('0x4d')]=[{'all':!![]}];}return db['ChatMessage'][_0x7b1e('0x4e')](_0x3903f9);})[_0x7b1e('0x32')](function(_0x53238c){_0x238313[_0x7b1e('0x4f')]=_0x53238c;return _0x238313;})[_0x7b1e('0x32')](respondWithFilteredResult(_0x34f3b2,_0x3903f9))['catch'](handleError(_0x34f3b2,null));};exports[_0x7b1e('0x50')]=function(_0x37a0e3,_0x2e968b){var _0x5b3057={'raw':!![],'where':{'id':_0x37a0e3['params']['id']}},_0x539671={};_0x539671[_0x7b1e('0x40')]=_['keys'](db[_0x7b1e('0x37')][_0x7b1e('0x38')]);_0x539671[_0x7b1e('0x3c')]=_[_0x7b1e('0x3d')](_0x37a0e3['query']);_0x539671['filters']=_[_0x7b1e('0x3f')](_0x539671['model'],_0x539671[_0x7b1e('0x3c')]);_0x5b3057[_0x7b1e('0x41')]=_[_0x7b1e('0x3f')](_0x539671[_0x7b1e('0x40')],qs[_0x7b1e('0x42')](_0x37a0e3['query']['fields']));_0x5b3057[_0x7b1e('0x41')]=_0x5b3057[_0x7b1e('0x41')][_0x7b1e('0x43')]?_0x5b3057['attributes']:_0x539671['model'];if(_0x37a0e3[_0x7b1e('0x3c')][_0x7b1e('0x51')]){_0x5b3057[_0x7b1e('0x4d')]=[{'all':!![]}];}_0x5b3057=_[_0x7b1e('0x4a')]({},_0x5b3057,_0x37a0e3[_0x7b1e('0x4c')]);return db[_0x7b1e('0x37')][_0x7b1e('0x52')](_0x5b3057)[_0x7b1e('0x32')](handleEntityNotFound(_0x2e968b,null))[_0x7b1e('0x32')](respondWithResult(_0x2e968b,null))[_0x7b1e('0x53')](handleError(_0x2e968b,null));};exports[_0x7b1e('0x54')]=function(_0x4f161c,_0x30f6e6){return db[_0x7b1e('0x37')][_0x7b1e('0x54')](_0x4f161c['body'],{})[_0x7b1e('0x32')](respondWithResult(_0x30f6e6,0xc9))[_0x7b1e('0x53')](handleError(_0x30f6e6,null));};exports[_0x7b1e('0x31')]=function(_0xc39a39,_0x5a0479){if(_0xc39a39['body']['id']){delete _0xc39a39[_0x7b1e('0x55')]['id'];}return db[_0x7b1e('0x37')][_0x7b1e('0x52')]({'where':{'id':_0xc39a39[_0x7b1e('0x56')]['id']}})[_0x7b1e('0x32')](handleEntityNotFound(_0x5a0479,null))[_0x7b1e('0x32')](saveUpdates(_0xc39a39[_0x7b1e('0x55')],null))['then'](respondWithResult(_0x5a0479,null))[_0x7b1e('0x53')](handleError(_0x5a0479,null));};exports['destroy']=function(_0xb96e4f,_0x361a15){return db[_0x7b1e('0x37')][_0x7b1e('0x52')]({'where':{'id':_0xb96e4f[_0x7b1e('0x56')]['id']}})[_0x7b1e('0x32')](handleEntityNotFound(_0x361a15,null))['then'](removeEntity(_0x361a15,null))[_0x7b1e('0x53')](handleError(_0x361a15,null));};exports['describe']=function(_0x28c880,_0xa0f29b){return db['ChatMessage'][_0x7b1e('0x57')]()[_0x7b1e('0x32')](respondWithResult(_0xa0f29b,null))[_0x7b1e('0x53')](handleError(_0xa0f29b,null));};var interaction_log=require(_0x7b1e('0x10'))(_0x7b1e('0x58'));exports[_0x7b1e('0x59')]=function(_0x4d787c,_0x4e71c0,_0x265492){var _0x596d7b={'agent':{},'channel':_0x7b1e('0x5a')};if(_0x4d787c[_0x7b1e('0x55')]['id']){delete _0x4d787c[_0x7b1e('0x55')]['id'];}_0x4d787c['body'][_0x7b1e('0x5b')]=!![];_0x4d787c[_0x7b1e('0x55')][_0x7b1e('0x5c')]=moment()[_0x7b1e('0x5d')](_0x7b1e('0x5e'));_0x4d787c[_0x7b1e('0x55')][_0x7b1e('0x5f')]=_0x4d787c[_0x7b1e('0x55')]['UserId']||_0x4d787c[_0x7b1e('0x60')]['id'];_0x596d7b[_0x7b1e('0x61')]['id']=_0x4d787c['body'][_0x7b1e('0x5f')];return db[_0x7b1e('0x37')][_0x7b1e('0x52')]({'where':{'id':_0x4d787c[_0x7b1e('0x56')]['id'],'UserId':null}})[_0x7b1e('0x32')](handleEntityNotFound(_0x4e71c0,null))['then'](saveUpdates(_0x4d787c[_0x7b1e('0x55')],null))[_0x7b1e('0x32')](function(_0x2e5df9){if(_0x2e5df9){_0x596d7b[_0x7b1e('0x23')]=_0x2e5df9['get']({'plain':!![]});return db[_0x7b1e('0x62')][_0x7b1e('0x52')]({'where':{'id':_0x2e5df9[_0x7b1e('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x4e71c0,null))[_0x7b1e('0x32')](function(_0x49c233){if(_0x49c233){return _0x49c233[_0x7b1e('0x31')]({'UserId':_0x4d787c[_0x7b1e('0x55')]['UserId'],'read1stAt':_['isNil'](_0x49c233[_0x7b1e('0x64')])?moment()[_0x7b1e('0x5d')](_0x7b1e('0x5e')):undefined});}return null;})[_0x7b1e('0x32')](function(_0x232f2e){if(_0x232f2e){_0x596d7b[_0x7b1e('0x65')]=_0x232f2e['get']({'plain':!![]});interaction_log['info'](_0x7b1e('0x66'),_0x4d787c[_0x7b1e('0x60')]['id'],_0x4d787c[_0x7b1e('0x60')]['name'],_0x4d787c[_0x7b1e('0x60')][_0x7b1e('0x67')],_0x596d7b[_0x7b1e('0x65')]['id'],_0x4d787c[_0x7b1e('0x55')]?JSON[_0x7b1e('0x20')](_0x4d787c[_0x7b1e('0x55')]):_0x7b1e('0x68'));return respondWithRpcPromise('AcceptMessage',_0x7b1e('0x69'),_0x596d7b);}return null;})['then'](function(_0x6c136){var _0xa388f4=_0x7b1e('0x6a')+_0x6c136[_0x7b1e('0x23')]['ContactId'];return db[_0x7b1e('0x6b')][_0x7b1e('0x3c')](_0xa388f4,{'type':db[_0x7b1e('0x6c')]['QueryTypes'][_0x7b1e('0x6d')],'raw':!![]})[_0x7b1e('0x32')](function(_0x2ffb1d){return _0x2ffb1d;});})[_0x7b1e('0x32')](function(_0x4bcccd){if(_0x4bcccd){_0x596d7b[_0x7b1e('0x23')][_0x7b1e('0x6e')]=_0x4bcccd[0x0];if(!_0x4d787c[_0x7b1e('0x55')]['UserId'])return;return db[_0x7b1e('0x6f')][_0x7b1e('0x52')]({'where':{'id':_0x4d787c[_0x7b1e('0x55')][_0x7b1e('0x5f')],'role':'agent'},'attributes':['id',_0x7b1e('0x35'),_0x7b1e('0x70'),_0x7b1e('0x71'),_0x7b1e('0x72')],'raw':!![]});}return null;})[_0x7b1e('0x32')](function(_0x6de7a4){if(!_0x6de7a4)return null;_0x596d7b['message'][_0x7b1e('0x61')]=_0x6de7a4;return _0x596d7b;})['then'](function(_0x127936){if(_0x127936){if(_0x4d787c[_0x7b1e('0x55')][_0x7b1e('0x73')]){_0x596d7b[_0x7b1e('0x23')][_0x7b1e('0x74')]=util[_0x7b1e('0x5d')](_0x7b1e('0x75'),_0x4d787c[_0x7b1e('0x60')][_0x7b1e('0x35')]);_0x596d7b['message'][_0x7b1e('0x76')]=_0x596d7b[_0x7b1e('0x76')];_0x596d7b[_0x7b1e('0x23')][_0x7b1e('0x77')]=_0x596d7b[_0x7b1e('0x76')];_0x596d7b[_0x7b1e('0x23')][_0x7b1e('0x78')]=_0x7b1e('0x59');return respondWithRpcPromise(_0x7b1e('0x79'),_0x7b1e('0x79'),{'event':_0x7b1e('0x7a'),'message':_[_0x7b1e('0x4a')](_0x596d7b[_0x7b1e('0x23')],JSON[_0x7b1e('0x7b')](_0x596d7b[_0x7b1e('0x65')]['formData']))},client9002)[_0x7b1e('0x32')](function(){return _0x596d7b;});}return _0x596d7b;}return null;})[_0x7b1e('0x32')](respondWithResult(_0x4e71c0,null))[_0x7b1e('0x53')](handleError(_0x4e71c0,null));};var interaction_log=require('../../config/logger')(_0x7b1e('0x58'));exports[_0x7b1e('0x2f')]=function(_0x18bb44,_0x12c8ca,_0x5b9d89){var _0x5887be={'agent':{},'channel':_0x7b1e('0x5a')};if(_0x18bb44[_0x7b1e('0x55')]['id']){delete _0x18bb44[_0x7b1e('0x55')]['id'];}_0x18bb44['body'][_0x7b1e('0x5f')]=_0x18bb44[_0x7b1e('0x55')][_0x7b1e('0x5f')]||_0x18bb44['user']['id'];_0x5887be[_0x7b1e('0x61')]['id']=_0x18bb44['body']['UserId'];return db[_0x7b1e('0x37')][_0x7b1e('0x52')]({'where':{'id':_0x18bb44[_0x7b1e('0x56')]['id'],'UserId':null}})[_0x7b1e('0x32')](handleEntityNotFound(_0x12c8ca,null))[_0x7b1e('0x32')](function(_0x3842b3){if(_0x3842b3){_0x5887be[_0x7b1e('0x23')]=_0x3842b3['get']({'plain':!![]});return db['ChatInteraction'][_0x7b1e('0x52')]({'where':{'id':_0x3842b3['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x12c8ca,null))[_0x7b1e('0x32')](function(_0x5d8d3f){if(_0x5d8d3f){_0x5887be[_0x7b1e('0x65')]=_0x5d8d3f['get']({'plain':!![]});interaction_log['info']('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x18bb44[_0x7b1e('0x60')]['id'],_0x18bb44[_0x7b1e('0x60')][_0x7b1e('0x35')],_0x18bb44[_0x7b1e('0x60')][_0x7b1e('0x67')],_0x5887be[_0x7b1e('0x65')]['id'],_0x18bb44[_0x7b1e('0x55')]?JSON[_0x7b1e('0x20')](_0x18bb44[_0x7b1e('0x55')]):_0x7b1e('0x68'));return respondWithRpcPromise(_0x7b1e('0x7c'),_0x7b1e('0x7d'),_0x5887be);}return null;})[_0x7b1e('0x32')](function(_0x44242d){var _0x299c01=_0x7b1e('0x6a')+_0x44242d[_0x7b1e('0x23')][_0x7b1e('0x7e')];return db[_0x7b1e('0x6b')][_0x7b1e('0x3c')](_0x299c01,{'type':db['Sequelize'][_0x7b1e('0x7f')]['SELECT'],'raw':!![]})[_0x7b1e('0x32')](function(_0x462d24){return _0x462d24;});})[_0x7b1e('0x32')](function(_0x41aee6){if(_0x41aee6){_0x5887be[_0x7b1e('0x23')][_0x7b1e('0x6e')]=_0x41aee6[0x0];if(!_0x18bb44['body'][_0x7b1e('0x5f')])return;return db['User']['find']({'where':{'id':_0x18bb44[_0x7b1e('0x55')][_0x7b1e('0x5f')],'role':_0x7b1e('0x61')},'attributes':['id',_0x7b1e('0x35'),_0x7b1e('0x70'),'email',_0x7b1e('0x72')],'raw':!![]});}return null;})['then'](function(_0x5b3dee){if(!_0x5b3dee)return null;_0x5887be['message'][_0x7b1e('0x61')]=_0x5b3dee;return _0x5887be;})['then'](function(_0x22fef2){if(_0x22fef2){_0x22fef2[_0x7b1e('0x23')][_0x7b1e('0x74')]=util[_0x7b1e('0x5d')](_0x7b1e('0x75'),_0x18bb44['user']['name']);_0x22fef2[_0x7b1e('0x23')][_0x7b1e('0x76')]=_0x5887be[_0x7b1e('0x76')];_0x22fef2[_0x7b1e('0x23')][_0x7b1e('0x77')]=_0x5887be[_0x7b1e('0x76')];_0x22fef2[_0x7b1e('0x23')][_0x7b1e('0x78')]=_0x7b1e('0x2f');respondWithRpcPromise('EventManager',_0x7b1e('0x79'),{'event':_0x7b1e('0x80'),'message':_[_0x7b1e('0x4a')](_0x5887be[_0x7b1e('0x23')],JSON[_0x7b1e('0x7b')](_0x5887be[_0x7b1e('0x65')][_0x7b1e('0x81')]))},client9002);return _0x5887be;}return null;})['then'](respondWithResult(_0x12c8ca,null))[_0x7b1e('0x53')](handleError(_0x12c8ca,null));};
\ No newline at end of file
+var _0xe96b=['User','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','ChatInteractionId','RejectMessage','fullname','interface','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','./chatMessage.socket','register','http','client','then','info','debug','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','stack','name','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','includeAll','findAll','rows','show','params','include','find','create','body','chat-interactions','accept','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','isNil','read1stAt','format','interaction','[CHATMESSAGE: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','Sequelize','QueryTypes'];(function(_0x50cd96,_0x14222a){var _0x134833=function(_0x185d8a){while(--_0x185d8a){_0x50cd96['push'](_0x50cd96['shift']());}};_0x134833(++_0x14222a);}(_0xe96b,0x187));var _0xbe96=function(_0x4dc382,_0x2ff4ed){_0x4dc382=_0x4dc382-0x0;var _0x62e1a2=_0xe96b[_0x4dc382];return _0x62e1a2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbe96('0x0'));var moment=require(_0xbe96('0x1'));var BPromise=require(_0xbe96('0x2'));var Mustache=require(_0xbe96('0x3'));var util=require(_0xbe96('0x4'));var path=require(_0xbe96('0x5'));var sox=require(_0xbe96('0x6'));var csv=require(_0xbe96('0x7'));var ejs=require(_0xbe96('0x8'));var fs=require('fs');var fs_extra=require(_0xbe96('0x9'));var _=require(_0xbe96('0xa'));var squel=require('squel');var crypto=require(_0xbe96('0xb'));var jsforce=require(_0xbe96('0xc'));var deskjs=require(_0xbe96('0xd'));var toCsv=require('to-csv');var querystring=require(_0xbe96('0xe'));var Papa=require(_0xbe96('0xf'));var Redis=require(_0xbe96('0x10'));var authService=require(_0xbe96('0x11'));var qs=require(_0xbe96('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbe96('0x13'))(_0xbe96('0x14'));var utils=require('../../config/utils');var config=require(_0xbe96('0x15'));var licenseUtil=require(_0xbe96('0x16'));var db=require('../../mysqldb')['db'];config[_0xbe96('0x17')]=_[_0xbe96('0x18')](config[_0xbe96('0x17')],{'host':_0xbe96('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbe96('0x17')]));require(_0xbe96('0x1a'))[_0xbe96('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xbe96('0x1c')]({'port':0x232c});var client9002=jayson[_0xbe96('0x1d')][_0xbe96('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x31cc80,_0x5be5a0,_0x12ab7b,_0x2ffcc8){return new BPromise(function(_0x4c570b,_0x29ed28){var _0x435038=_0x2ffcc8||client;return _0x435038['request'](_0x31cc80,_0x12ab7b)[_0xbe96('0x1e')](function(_0xf254e1){logger[_0xbe96('0x1f')]('ChatMessage,\x20%s,\x20%s',_0x5be5a0,'request\x20sent');logger[_0xbe96('0x20')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x5be5a0,'request\x20sent',JSON[_0xbe96('0x21')](_0xf254e1));if(_0xf254e1[_0xbe96('0x22')]){if(_0xf254e1['error'][_0xbe96('0x23')]===0x1f4){logger[_0xbe96('0x22')](_0xbe96('0x24'),_0x5be5a0,_0xf254e1[_0xbe96('0x22')][_0xbe96('0x25')]);return _0x29ed28(_0xf254e1['error']['message']);}logger[_0xbe96('0x22')](_0xbe96('0x24'),_0x5be5a0,_0xf254e1[_0xbe96('0x22')]['message']);return _0x4c570b(_0xf254e1[_0xbe96('0x22')][_0xbe96('0x25')]);}else{logger[_0xbe96('0x1f')](_0xbe96('0x24'),_0x5be5a0,'request\x20sent');_0x4c570b(_0xf254e1[_0xbe96('0x26')]['message']);}})[_0xbe96('0x27')](function(_0x122eb1){logger[_0xbe96('0x22')](_0xbe96('0x24'),_0x5be5a0,_0x122eb1);_0x29ed28(_0x122eb1);});});}function respondWithStatusCode(_0x45444f,_0x2e6f0b){_0x2e6f0b=_0x2e6f0b||0xcc;return function(_0x1304f){if(_0x1304f){return _0x45444f[_0xbe96('0x28')](_0x2e6f0b);}return _0x45444f[_0xbe96('0x29')](_0x2e6f0b)[_0xbe96('0x2a')]();};}function respondWithResult(_0x578554,_0x1bac6e){_0x1bac6e=_0x1bac6e||0xc8;return function(_0x33c3fd){if(_0x33c3fd){return _0x578554[_0xbe96('0x29')](_0x1bac6e)[_0xbe96('0x2b')](_0x33c3fd);}};}function respondWithFilteredResult(_0x43cc97,_0x5c3147){return function(_0x3ab468){if(_0x3ab468){var _0x3429f3=typeof _0x5c3147[_0xbe96('0x2c')]===_0xbe96('0x2d')&&typeof _0x5c3147[_0xbe96('0x2e')]===_0xbe96('0x2d');var _0x4e93c4=_0x3ab468[_0xbe96('0x2f')];var _0x40f0d2=_0x3429f3?0x0:_0x5c3147['offset'];var _0x3a35bd=_0x3429f3?_0x3ab468['count']:_0x5c3147['offset']+_0x5c3147[_0xbe96('0x2e')];var _0x1a5943;if(_0x3a35bd>=_0x4e93c4){_0x3a35bd=_0x4e93c4;_0x1a5943=0xc8;}else{_0x1a5943=0xce;}_0x43cc97[_0xbe96('0x29')](_0x1a5943);return _0x43cc97['set'](_0xbe96('0x30'),_0x40f0d2+'-'+_0x3a35bd+'/'+_0x4e93c4)[_0xbe96('0x2b')](_0x3ab468);}return null;};}function patchUpdates(_0x471678){return function(_0x157147){try{jsonpatch[_0xbe96('0x31')](_0x157147,_0x471678,!![]);}catch(_0x3b1b13){return BPromise[_0xbe96('0x32')](_0x3b1b13);}return _0x157147['save']();};}function saveUpdates(_0x4f9860,_0x29b049){return function(_0x1fa56b){if(_0x1fa56b){return _0x1fa56b[_0xbe96('0x33')](_0x4f9860)[_0xbe96('0x1e')](function(_0x445b22){return _0x445b22;});}return null;};}function removeEntity(_0x2deb78,_0x3274cb){return function(_0x444eea){if(_0x444eea){return _0x444eea['destroy']()['then'](function(){_0x2deb78[_0xbe96('0x29')](0xcc)[_0xbe96('0x2a')]();});}};}function handleEntityNotFound(_0x16e68a,_0x41ab5f){return function(_0x1bf9e6){if(!_0x1bf9e6){_0x16e68a['sendStatus'](0x194);}return _0x1bf9e6;};}function handleError(_0x15f7b1,_0x2fe134){_0x2fe134=_0x2fe134||0x1f4;return function(_0x47c7af){logger[_0xbe96('0x22')](_0x47c7af[_0xbe96('0x34')]);if(_0x47c7af[_0xbe96('0x35')]){delete _0x47c7af[_0xbe96('0x35')];}_0x15f7b1[_0xbe96('0x29')](_0x2fe134)['send'](_0x47c7af);};}exports[_0xbe96('0x36')]=function(_0x150ede,_0x28f2cb){var _0x33488f={},_0x141f11={},_0x3e700a={'count':0x0,'rows':[]};var _0xc80c03=_[_0xbe96('0x37')](db[_0xbe96('0x38')][_0xbe96('0x39')],function(_0xf0248a){return{'name':_0xf0248a[_0xbe96('0x3a')],'type':_0xf0248a[_0xbe96('0x3b')][_0xbe96('0x3c')]};});_0x141f11[_0xbe96('0x3d')]=_[_0xbe96('0x37')](_0xc80c03,_0xbe96('0x35'));_0x141f11[_0xbe96('0x3e')]=_[_0xbe96('0x3f')](_0x150ede[_0xbe96('0x3e')]);_0x141f11[_0xbe96('0x40')]=_['intersection'](_0x141f11[_0xbe96('0x3d')],_0x141f11[_0xbe96('0x3e')]);_0x33488f[_0xbe96('0x41')]=_[_0xbe96('0x42')](_0x141f11[_0xbe96('0x3d')],qs[_0xbe96('0x43')](_0x150ede[_0xbe96('0x3e')][_0xbe96('0x43')]));_0x33488f[_0xbe96('0x41')]=_0x33488f[_0xbe96('0x41')]['length']?_0x33488f[_0xbe96('0x41')]:_0x141f11['model'];if(!_0x150ede['query'][_0xbe96('0x44')](_0xbe96('0x45'))){_0x33488f[_0xbe96('0x2e')]=qs[_0xbe96('0x2e')](_0x150ede['query'][_0xbe96('0x2e')]);_0x33488f[_0xbe96('0x2c')]=qs[_0xbe96('0x2c')](_0x150ede['query']['offset']);}_0x33488f[_0xbe96('0x46')]=qs[_0xbe96('0x47')](_0x150ede[_0xbe96('0x3e')][_0xbe96('0x47')]);_0x33488f[_0xbe96('0x48')]=qs['filters'](_['pick'](_0x150ede[_0xbe96('0x3e')],_0x141f11['filters']),_0xc80c03);if(_0x150ede[_0xbe96('0x3e')]['filter']){_0x33488f[_0xbe96('0x48')]=_[_0xbe96('0x49')](_0x33488f[_0xbe96('0x48')],{'$or':_[_0xbe96('0x37')](_0xc80c03,function(_0x2babef){if(_0x2babef[_0xbe96('0x3b')]!=='VIRTUAL'){var _0x3f222d={};_0x3f222d[_0x2babef[_0xbe96('0x35')]]={'$like':'%'+_0x150ede['query'][_0xbe96('0x4a')]+'%'};return _0x3f222d;}})});}_0x33488f=_['merge']({},_0x33488f,_0x150ede[_0xbe96('0x4b')]);var _0x3f5951={'where':_0x33488f['where']};return db[_0xbe96('0x38')][_0xbe96('0x2f')](_0x3f5951)[_0xbe96('0x1e')](function(_0x27ca9e){_0x3e700a[_0xbe96('0x2f')]=_0x27ca9e;if(_0x150ede[_0xbe96('0x3e')][_0xbe96('0x4c')]){_0x33488f['include']=[{'all':!![]}];}return db[_0xbe96('0x38')][_0xbe96('0x4d')](_0x33488f);})[_0xbe96('0x1e')](function(_0x84be90){_0x3e700a[_0xbe96('0x4e')]=_0x84be90;return _0x3e700a;})[_0xbe96('0x1e')](respondWithFilteredResult(_0x28f2cb,_0x33488f))[_0xbe96('0x27')](handleError(_0x28f2cb,null));};exports[_0xbe96('0x4f')]=function(_0x368dba,_0x13e2c3){var _0x1fadc0={'raw':!![],'where':{'id':_0x368dba[_0xbe96('0x50')]['id']}},_0x44191e={};_0x44191e[_0xbe96('0x3d')]=_[_0xbe96('0x3f')](db[_0xbe96('0x38')][_0xbe96('0x39')]);_0x44191e[_0xbe96('0x3e')]=_[_0xbe96('0x3f')](_0x368dba[_0xbe96('0x3e')]);_0x44191e[_0xbe96('0x40')]=_['intersection'](_0x44191e[_0xbe96('0x3d')],_0x44191e[_0xbe96('0x3e')]);_0x1fadc0[_0xbe96('0x41')]=_[_0xbe96('0x42')](_0x44191e[_0xbe96('0x3d')],qs[_0xbe96('0x43')](_0x368dba[_0xbe96('0x3e')]['fields']));_0x1fadc0[_0xbe96('0x41')]=_0x1fadc0[_0xbe96('0x41')]['length']?_0x1fadc0[_0xbe96('0x41')]:_0x44191e[_0xbe96('0x3d')];if(_0x368dba[_0xbe96('0x3e')][_0xbe96('0x4c')]){_0x1fadc0[_0xbe96('0x51')]=[{'all':!![]}];}_0x1fadc0=_[_0xbe96('0x49')]({},_0x1fadc0,_0x368dba[_0xbe96('0x4b')]);return db[_0xbe96('0x38')][_0xbe96('0x52')](_0x1fadc0)[_0xbe96('0x1e')](handleEntityNotFound(_0x13e2c3,null))[_0xbe96('0x1e')](respondWithResult(_0x13e2c3,null))['catch'](handleError(_0x13e2c3,null));};exports['create']=function(_0x5c6c2c,_0x2568c9){return db[_0xbe96('0x38')][_0xbe96('0x53')](_0x5c6c2c[_0xbe96('0x54')],{})[_0xbe96('0x1e')](respondWithResult(_0x2568c9,0xc9))[_0xbe96('0x27')](handleError(_0x2568c9,null));};exports[_0xbe96('0x33')]=function(_0x517d7e,_0x1fccfc){if(_0x517d7e['body']['id']){delete _0x517d7e['body']['id'];}return db[_0xbe96('0x38')][_0xbe96('0x52')]({'where':{'id':_0x517d7e[_0xbe96('0x50')]['id']}})[_0xbe96('0x1e')](handleEntityNotFound(_0x1fccfc,null))[_0xbe96('0x1e')](saveUpdates(_0x517d7e[_0xbe96('0x54')],null))[_0xbe96('0x1e')](respondWithResult(_0x1fccfc,null))[_0xbe96('0x27')](handleError(_0x1fccfc,null));};exports['destroy']=function(_0x17bf76,_0x57ebad){return db[_0xbe96('0x38')][_0xbe96('0x52')]({'where':{'id':_0x17bf76[_0xbe96('0x50')]['id']}})[_0xbe96('0x1e')](handleEntityNotFound(_0x57ebad,null))[_0xbe96('0x1e')](removeEntity(_0x57ebad,null))[_0xbe96('0x27')](handleError(_0x57ebad,null));};exports['describe']=function(_0x23c9b5,_0x2dd97f){return db[_0xbe96('0x38')]['describe']()[_0xbe96('0x1e')](respondWithResult(_0x2dd97f,null))[_0xbe96('0x27')](handleError(_0x2dd97f,null));};var interaction_log=require(_0xbe96('0x13'))(_0xbe96('0x55'));exports[_0xbe96('0x56')]=function(_0x47330d,_0x1c32e5,_0x5278aa){var _0xb8ba86={'agent':{},'channel':_0xbe96('0x57')};if(_0x47330d[_0xbe96('0x54')]['id']){delete _0x47330d[_0xbe96('0x54')]['id'];}_0x47330d['body'][_0xbe96('0x58')]=!![];_0x47330d[_0xbe96('0x54')][_0xbe96('0x59')]=moment()['format'](_0xbe96('0x5a'));_0x47330d['body'][_0xbe96('0x5b')]=_0x47330d[_0xbe96('0x54')]['UserId']||_0x47330d[_0xbe96('0x5c')]['id'];_0xb8ba86[_0xbe96('0x5d')]['id']=_0x47330d['body'][_0xbe96('0x5b')];return db[_0xbe96('0x38')][_0xbe96('0x52')]({'where':{'id':_0x47330d[_0xbe96('0x50')]['id'],'UserId':null}})[_0xbe96('0x1e')](handleEntityNotFound(_0x1c32e5,null))[_0xbe96('0x1e')](saveUpdates(_0x47330d['body'],null))['then'](function(_0x4b4208){if(_0x4b4208){_0xb8ba86[_0xbe96('0x25')]=_0x4b4208[_0xbe96('0x5e')]({'plain':!![]});return db[_0xbe96('0x5f')][_0xbe96('0x52')]({'where':{'id':_0x4b4208['ChatInteractionId']}});}return null;})[_0xbe96('0x1e')](handleEntityNotFound(_0x1c32e5,null))[_0xbe96('0x1e')](function(_0x5672b1){if(_0x5672b1){return _0x5672b1['update']({'UserId':_0x47330d[_0xbe96('0x54')]['UserId'],'read1stAt':_[_0xbe96('0x60')](_0x5672b1[_0xbe96('0x61')])?moment()[_0xbe96('0x62')](_0xbe96('0x5a')):undefined});}return null;})[_0xbe96('0x1e')](function(_0xd600f8){if(_0xd600f8){_0xb8ba86[_0xbe96('0x63')]=_0xd600f8['get']({'plain':!![]});interaction_log[_0xbe96('0x1f')](_0xbe96('0x64'),_0x47330d[_0xbe96('0x5c')]['id'],_0x47330d['user']['name'],_0x47330d['user']['role'],_0xb8ba86[_0xbe96('0x63')]['id'],_0x47330d[_0xbe96('0x54')]?JSON[_0xbe96('0x21')](_0x47330d[_0xbe96('0x54')]):_0xbe96('0x65'));return respondWithRpcPromise(_0xbe96('0x66'),_0xbe96('0x67'),_0xb8ba86);}return null;})[_0xbe96('0x1e')](function(_0x3bf403){var _0x4a6cfd=_0xbe96('0x68')+_0x3bf403[_0xbe96('0x25')][_0xbe96('0x69')];return db[_0xbe96('0x6a')][_0xbe96('0x3e')](_0x4a6cfd,{'type':db[_0xbe96('0x6b')][_0xbe96('0x6c')]['SELECT'],'raw':!![]})[_0xbe96('0x1e')](function(_0x15f315){return _0x15f315;});})[_0xbe96('0x1e')](function(_0x363235){if(_0x363235){_0xb8ba86[_0xbe96('0x25')]['contact']=_0x363235[0x0];if(!_0x47330d[_0xbe96('0x54')]['UserId'])return;return db[_0xbe96('0x6d')][_0xbe96('0x52')]({'where':{'id':_0x47330d[_0xbe96('0x54')][_0xbe96('0x5b')],'role':_0xbe96('0x5d')},'attributes':['id',_0xbe96('0x35'),'fullname',_0xbe96('0x6e'),_0xbe96('0x6f')],'raw':!![]});}return null;})[_0xbe96('0x1e')](function(_0x13a310){if(!_0x13a310)return null;_0xb8ba86[_0xbe96('0x25')][_0xbe96('0x5d')]=_0x13a310;return _0xb8ba86;})[_0xbe96('0x1e')](function(_0x5b3bac){if(_0x5b3bac){if(_0x47330d[_0xbe96('0x54')][_0xbe96('0x70')]){_0xb8ba86[_0xbe96('0x25')]['interface']=util['format'](_0xbe96('0x71'),_0x47330d[_0xbe96('0x5c')][_0xbe96('0x35')]);_0xb8ba86[_0xbe96('0x25')][_0xbe96('0x72')]=_0xb8ba86[_0xbe96('0x72')];_0xb8ba86[_0xbe96('0x25')][_0xbe96('0x73')]=_0xb8ba86['channel'];_0xb8ba86[_0xbe96('0x25')][_0xbe96('0x74')]=_0xbe96('0x56');return respondWithRpcPromise(_0xbe96('0x75'),_0xbe96('0x75'),{'event':_0xbe96('0x76'),'message':_['merge'](_0xb8ba86[_0xbe96('0x25')],JSON[_0xbe96('0x77')](_0xb8ba86['interaction'][_0xbe96('0x78')]))},client9002)['then'](function(){return _0xb8ba86;});}return _0xb8ba86;}return null;})[_0xbe96('0x1e')](respondWithResult(_0x1c32e5,null))[_0xbe96('0x27')](handleError(_0x1c32e5,null));};var interaction_log=require(_0xbe96('0x13'))(_0xbe96('0x55'));exports[_0xbe96('0x32')]=function(_0x4d6a9d,_0x469a9e,_0x5f394f){var _0x1ca5e9={'agent':{},'channel':_0xbe96('0x57')};if(_0x4d6a9d['body']['id']){delete _0x4d6a9d[_0xbe96('0x54')]['id'];}_0x4d6a9d[_0xbe96('0x54')][_0xbe96('0x5b')]=_0x4d6a9d[_0xbe96('0x54')][_0xbe96('0x5b')]||_0x4d6a9d[_0xbe96('0x5c')]['id'];_0x1ca5e9[_0xbe96('0x5d')]['id']=_0x4d6a9d['body'][_0xbe96('0x5b')];return db['ChatMessage'][_0xbe96('0x52')]({'where':{'id':_0x4d6a9d[_0xbe96('0x50')]['id'],'UserId':null}})[_0xbe96('0x1e')](handleEntityNotFound(_0x469a9e,null))[_0xbe96('0x1e')](function(_0x55f98a){if(_0x55f98a){_0x1ca5e9['message']=_0x55f98a[_0xbe96('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0xbe96('0x52')]({'where':{'id':_0x55f98a[_0xbe96('0x79')]}});}return null;})[_0xbe96('0x1e')](handleEntityNotFound(_0x469a9e,null))[_0xbe96('0x1e')](function(_0x3b6c99){if(_0x3b6c99){_0x1ca5e9[_0xbe96('0x63')]=_0x3b6c99[_0xbe96('0x5e')]({'plain':!![]});interaction_log[_0xbe96('0x1f')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4d6a9d[_0xbe96('0x5c')]['id'],_0x4d6a9d['user'][_0xbe96('0x35')],_0x4d6a9d[_0xbe96('0x5c')]['role'],_0x1ca5e9[_0xbe96('0x63')]['id'],_0x4d6a9d[_0xbe96('0x54')]?JSON['stringify'](_0x4d6a9d[_0xbe96('0x54')]):_0xbe96('0x65'));return respondWithRpcPromise(_0xbe96('0x7a'),'rejectMessage',_0x1ca5e9);}return null;})[_0xbe96('0x1e')](function(_0x530142){var _0x56634b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x530142[_0xbe96('0x25')][_0xbe96('0x69')];return db[_0xbe96('0x6a')][_0xbe96('0x3e')](_0x56634b,{'type':db[_0xbe96('0x6b')][_0xbe96('0x6c')]['SELECT'],'raw':!![]})[_0xbe96('0x1e')](function(_0x5932ba){return _0x5932ba;});})[_0xbe96('0x1e')](function(_0x1c2491){if(_0x1c2491){_0x1ca5e9['message']['contact']=_0x1c2491[0x0];if(!_0x4d6a9d['body']['UserId'])return;return db[_0xbe96('0x6d')]['find']({'where':{'id':_0x4d6a9d[_0xbe96('0x54')][_0xbe96('0x5b')],'role':_0xbe96('0x5d')},'attributes':['id',_0xbe96('0x35'),_0xbe96('0x7b'),'email',_0xbe96('0x6f')],'raw':!![]});}return null;})[_0xbe96('0x1e')](function(_0x71b860){if(!_0x71b860)return null;_0x1ca5e9['message'][_0xbe96('0x5d')]=_0x71b860;return _0x1ca5e9;})['then'](function(_0x47bc71){if(_0x47bc71){_0x47bc71[_0xbe96('0x25')][_0xbe96('0x7c')]=util[_0xbe96('0x62')](_0xbe96('0x71'),_0x4d6a9d['user']['name']);_0x47bc71[_0xbe96('0x25')][_0xbe96('0x72')]=_0x1ca5e9[_0xbe96('0x72')];_0x47bc71['message'][_0xbe96('0x73')]=_0x1ca5e9[_0xbe96('0x72')];_0x47bc71[_0xbe96('0x25')]['event']=_0xbe96('0x32');respondWithRpcPromise(_0xbe96('0x75'),_0xbe96('0x75'),{'event':'rejectmessage','message':_[_0xbe96('0x49')](_0x1ca5e9[_0xbe96('0x25')],JSON[_0xbe96('0x77')](_0x1ca5e9[_0xbe96('0x63')]['formData']))},client9002);return _0x1ca5e9;}return null;})[_0xbe96('0x1e')](respondWithResult(_0x469a9e,null))[_0xbe96('0x27')](handleError(_0x469a9e,null));};
\ No newline at end of file
index ecabc61..bc779f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0548=['save','update','remove','emit','hasOwnProperty','exports','events','setMaxListeners'];(function(_0x263c1e,_0x2fcf43){var _0x11207c=function(_0x3c58a9){while(--_0x3c58a9){_0x263c1e['push'](_0x263c1e['shift']());}};_0x11207c(++_0x2fcf43);}(_0x0548,0x1ae));var _0x8054=function(_0x41c501,_0x753dcb){_0x41c501=_0x41c501-0x0;var _0x351dd5=_0x0548[_0x41c501];return _0x351dd5;};'use strict';var EventEmitter=require(_0x8054('0x0'));var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x8054('0x1')](0x0);var events={'afterCreate':_0x8054('0x2'),'afterUpdate':_0x8054('0x3'),'afterDestroy':_0x8054('0x4')};function emitEvent(_0x1e2fef){return function(_0x2330b2,_0x4b252b,_0x63ec89){ChatMessageEvents[_0x8054('0x5')](_0x1e2fef+':'+_0x2330b2['id'],_0x2330b2);ChatMessageEvents[_0x8054('0x5')](_0x1e2fef,_0x2330b2);_0x63ec89(null);};}for(var e in events){if(events[_0x8054('0x6')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x8054('0x7')]=ChatMessageEvents;
\ No newline at end of file
+var _0x1ab0=['exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','emit','hasOwnProperty','hook'];(function(_0xf6e716,_0x227b34){var _0x540fb2=function(_0xf7acb7){while(--_0xf7acb7){_0xf6e716['push'](_0xf6e716['shift']());}};_0x540fb2(++_0x227b34);}(_0x1ab0,0x1c3));var _0x01ab=function(_0x1e22bf,_0x3f1b29){_0x1e22bf=_0x1e22bf-0x0;var _0xf46aed=_0x1ab0[_0x1e22bf];return _0xf46aed;};'use strict';var EventEmitter=require(_0x01ab('0x0'));var ChatMessage=require(_0x01ab('0x1'))['db'][_0x01ab('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x01ab('0x3')](0x0);var events={'afterCreate':_0x01ab('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x749c87){return function(_0x5982a0,_0x3ac8e7,_0x1b6c5c){ChatMessageEvents[_0x01ab('0x5')](_0x749c87+':'+_0x5982a0['id'],_0x5982a0);ChatMessageEvents[_0x01ab('0x5')](_0x749c87,_0x5982a0);_0x1b6c5c(null);};}for(var e in events){if(events[_0x01ab('0x6')](e)){var event=events[e];ChatMessage[_0x01ab('0x7')](e,emitEvent(event));}}module[_0x01ab('0x8')]=ChatMessageEvents;
\ No newline at end of file
index 970f5f9..ab41358 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe4b8=['direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','update','createdAt','catch','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./chatMessage.attributes','exports','ChatMessage','models','get'];(function(_0x1aa5c1,_0x24ab28){var _0x5545c8=function(_0x1c717a){while(--_0x1c717a){_0x1aa5c1['push'](_0x1aa5c1['shift']());}};_0x5545c8(++_0x24ab28);}(_0xe4b8,0x179));var _0x8e4b=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0xe4b8[_0x24f31b];return _0x488401;};'use strict';var _=require(_0x8e4b('0x0'));var util=require(_0x8e4b('0x1'));var logger=require(_0x8e4b('0x2'))(_0x8e4b('0x3'));var moment=require(_0x8e4b('0x4'));var BPromise=require(_0x8e4b('0x5'));var rp=require(_0x8e4b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8e4b('0x7'));var attributes=require(_0x8e4b('0x8'));module[_0x8e4b('0x9')]=function(_0x47e630,_0x2796f8){return _0x47e630['define'](_0x8e4b('0xa'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4dd799,_0x2e048b,_0x5c4b06){var _0x50f47=_0x47e630[_0x8e4b('0xb')];var _0x57bbcb=_0x4dd799[_0x8e4b('0xc')]({'plain':!![]});if(_0x57bbcb[_0x8e4b('0xd')][_0x8e4b('0xe')]()==='in'||_0x57bbcb['direction'][_0x8e4b('0xe')]()===_0x8e4b('0xf')&&!_0x57bbcb[_0x8e4b('0x10')]&&!_[_0x8e4b('0x11')](_0x57bbcb[_0x8e4b('0x12')])){_0x50f47[_0x8e4b('0x13')][_0x8e4b('0x14')]({'where':{'id':_0x57bbcb[_0x8e4b('0x15')]}})['then'](function(_0x5f56fb){if(_0x5f56fb){_0x5f56fb[_0x8e4b('0x16')]({'lastMsgAt':_0x57bbcb[_0x8e4b('0x17')],'lastMsgDirection':_0x57bbcb[_0x8e4b('0xd')][_0x8e4b('0xe')]()});}})[_0x8e4b('0x18')](function(_0x4d10fd){console['error'](_0x4d10fd);});}_0x5c4b06();}},'charset':_0x8e4b('0x19'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xcdbd=['chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','then','createdAt','catch','error','utf8mb4','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatMessage.attributes','exports','define'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0xcdbd,0x15d));var _0xdcdb=function(_0x1b2cc3,_0x4055ca){_0x1b2cc3=_0x1b2cc3-0x0;var _0x17dc53=_0xcdbd[_0x1b2cc3];return _0x17dc53;};'use strict';var _=require(_0xdcdb('0x0'));var util=require('util');var logger=require(_0xdcdb('0x1'))(_0xdcdb('0x2'));var moment=require(_0xdcdb('0x3'));var BPromise=require(_0xdcdb('0x4'));var rp=require(_0xdcdb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdcdb('0x6'));var config=require(_0xdcdb('0x7'));var attributes=require(_0xdcdb('0x8'));module[_0xdcdb('0x9')]=function(_0xfb5e7c,_0x1a5242){return _0xfb5e7c[_0xdcdb('0xa')]('ChatMessage',attributes,{'tableName':_0xdcdb('0xb'),'paranoid':![],'indexes':[{'name':_0xdcdb('0xc'),'fields':[_0xdcdb('0xd')],'type':_0xdcdb('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x29040d,_0xcb7ffe,_0x366b02){var _0x58e7d2=_0xfb5e7c[_0xdcdb('0xf')];var _0x3bc376=_0x29040d[_0xdcdb('0x10')]({'plain':!![]});if(_0x3bc376['direction']['toLowerCase']()==='in'||_0x3bc376[_0xdcdb('0x11')][_0xdcdb('0x12')]()===_0xdcdb('0x13')&&!_0x3bc376[_0xdcdb('0x14')]&&!_[_0xdcdb('0x15')](_0x3bc376[_0xdcdb('0x16')])){_0x58e7d2[_0xdcdb('0x17')][_0xdcdb('0x18')]({'where':{'id':_0x3bc376['ChatInteractionId']}})[_0xdcdb('0x19')](function(_0x18eae4){if(_0x18eae4){_0x18eae4['update']({'lastMsgAt':_0x3bc376[_0xdcdb('0x1a')],'lastMsgDirection':_0x3bc376[_0xdcdb('0x11')][_0xdcdb('0x12')]()});}})[_0xdcdb('0x1b')](function(_0x164afe){console[_0xdcdb('0x1c')](_0x164afe);});}_0x366b02();}},'charset':_0xdcdb('0x1d'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 8ab6284..6950c58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d29=['http','redis','defaults','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateChatMessage','ChatMessage','create','options','raw','debug','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x4d29,0xc8));var _0x94d2=function(_0x4d8f31,_0x54db92){_0x4d8f31=_0x4d8f31-0x0;var _0x39c47e=_0x4d29[_0x4d8f31];return _0x39c47e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x94d2('0x0'));var BPromise=require(_0x94d2('0x1'));var rs=require(_0x94d2('0x2'));var fs=require('fs');var Redis=require(_0x94d2('0x3'));var db=require(_0x94d2('0x4'))['db'];var utils=require(_0x94d2('0x5'));var logger=require(_0x94d2('0x6'))(_0x94d2('0x7'));var config=require(_0x94d2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x94d2('0x9')][_0x94d2('0xa')]({'port':0x232a});config[_0x94d2('0xb')]=_[_0x94d2('0xc')](config[_0x94d2('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x94d2('0xd'))[_0x94d2('0xe')](socket);function respondWithRpcPromise(_0x14bca1,_0x1eac0d,_0x371920){return new BPromise(function(_0x5eea65,_0x9bdf97){return client[_0x94d2('0xf')](_0x14bca1,_0x371920)[_0x94d2('0x10')](function(_0x47cc82){logger[_0x94d2('0x11')](_0x94d2('0x12'),_0x1eac0d,'request\x20sent');logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x1eac0d,_0x94d2('0x13'),JSON[_0x94d2('0x14')](_0x47cc82));if(_0x47cc82['error']){if(_0x47cc82[_0x94d2('0x15')]['code']===0x1f4){logger[_0x94d2('0x15')](_0x94d2('0x12'),_0x1eac0d,_0x47cc82[_0x94d2('0x15')][_0x94d2('0x16')]);return _0x9bdf97(_0x47cc82[_0x94d2('0x15')][_0x94d2('0x16')]);}logger['error'](_0x94d2('0x12'),_0x1eac0d,_0x47cc82[_0x94d2('0x15')][_0x94d2('0x16')]);return _0x5eea65(_0x47cc82[_0x94d2('0x15')]['message']);}else{logger[_0x94d2('0x11')]('ChatMessage,\x20%s,\x20%s',_0x1eac0d,_0x94d2('0x13'));_0x5eea65(_0x47cc82[_0x94d2('0x17')][_0x94d2('0x16')]);}})['catch'](function(_0x586711){logger[_0x94d2('0x15')](_0x94d2('0x12'),_0x1eac0d,_0x586711);_0x9bdf97(_0x586711);});});}exports[_0x94d2('0x18')]=function(_0x3f39d4){var _0x14a6b3=this;return new Promise(function(_0x221204,_0x3c8a51){return db[_0x94d2('0x19')][_0x94d2('0x1a')](_0x3f39d4['body'],{'raw':_0x3f39d4[_0x94d2('0x1b')]?_0x3f39d4[_0x94d2('0x1b')][_0x94d2('0x1c')]===undefined?!![]:![]:!![]})[_0x94d2('0x10')](function(_0xa2a7b5){logger['info'](_0x94d2('0x18'),_0x3f39d4);logger[_0x94d2('0x1d')](_0x94d2('0x18'),_0x3f39d4,JSON[_0x94d2('0x14')](_0xa2a7b5));_0x221204(_0xa2a7b5);})['catch'](function(_0xde06aa){logger[_0x94d2('0x15')](_0x94d2('0x18'),_0xde06aa['message'],_0x3f39d4);_0x3c8a51(_0x14a6b3['error'](0x1f4,_0xde06aa[_0x94d2('0x16')]));});});};
\ No newline at end of file
+var _0x2b01=['localhost','socket.io-emitter','./chatMessage.socket','request','then','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','info','catch','ChatMessage','create','body','options','raw','CreateChatMessage','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults'];(function(_0xfaf19d,_0x57304b){var _0x14a9d9=function(_0x5337fc){while(--_0x5337fc){_0xfaf19d['push'](_0xfaf19d['shift']());}};_0x14a9d9(++_0x57304b);}(_0x2b01,0x18b));var _0x12b0=function(_0x46f8fd,_0x3590d2){_0x46f8fd=_0x46f8fd-0x0;var _0x34c6be=_0x2b01[_0x46f8fd];return _0x34c6be;};'use strict';var _=require(_0x12b0('0x0'));var util=require(_0x12b0('0x1'));var moment=require('moment');var BPromise=require(_0x12b0('0x2'));var rs=require(_0x12b0('0x3'));var fs=require('fs');var Redis=require(_0x12b0('0x4'));var db=require(_0x12b0('0x5'))['db'];var utils=require(_0x12b0('0x6'));var logger=require('../../config/logger')(_0x12b0('0x7'));var config=require('../../config/environment');var jayson=require(_0x12b0('0x8'));var client=jayson[_0x12b0('0x9')][_0x12b0('0xa')]({'port':0x232a});config[_0x12b0('0xb')]=_[_0x12b0('0xc')](config[_0x12b0('0xb')],{'host':_0x12b0('0xd'),'port':0x18eb});var socket=require(_0x12b0('0xe'))(new Redis(config[_0x12b0('0xb')]));require(_0x12b0('0xf'))['register'](socket);function respondWithRpcPromise(_0x51d729,_0x5c71b7,_0x1a96aa){return new BPromise(function(_0x32c30f,_0x5cd992){return client[_0x12b0('0x10')](_0x51d729,_0x1a96aa)[_0x12b0('0x11')](function(_0x2389f0){logger['info']('ChatMessage,\x20%s,\x20%s',_0x5c71b7,_0x12b0('0x12'));logger['debug'](_0x12b0('0x13'),_0x5c71b7,_0x12b0('0x12'),JSON[_0x12b0('0x14')](_0x2389f0));if(_0x2389f0[_0x12b0('0x15')]){if(_0x2389f0[_0x12b0('0x15')][_0x12b0('0x16')]===0x1f4){logger[_0x12b0('0x15')](_0x12b0('0x17'),_0x5c71b7,_0x2389f0[_0x12b0('0x15')][_0x12b0('0x18')]);return _0x5cd992(_0x2389f0['error'][_0x12b0('0x18')]);}logger[_0x12b0('0x15')]('ChatMessage,\x20%s,\x20%s',_0x5c71b7,_0x2389f0[_0x12b0('0x15')]['message']);return _0x32c30f(_0x2389f0[_0x12b0('0x15')][_0x12b0('0x18')]);}else{logger[_0x12b0('0x19')](_0x12b0('0x17'),_0x5c71b7,_0x12b0('0x12'));_0x32c30f(_0x2389f0['result']['message']);}})[_0x12b0('0x1a')](function(_0x258b2d){logger[_0x12b0('0x15')](_0x12b0('0x17'),_0x5c71b7,_0x258b2d);_0x5cd992(_0x258b2d);});});}exports['CreateChatMessage']=function(_0x46cfaa){var _0x283413=this;return new Promise(function(_0x5ab5f3,_0x44fa72){return db[_0x12b0('0x1b')][_0x12b0('0x1c')](_0x46cfaa[_0x12b0('0x1d')],{'raw':_0x46cfaa[_0x12b0('0x1e')]?_0x46cfaa['options'][_0x12b0('0x1f')]===undefined?!![]:![]:!![]})[_0x12b0('0x11')](function(_0x15a367){logger[_0x12b0('0x19')](_0x12b0('0x20'),_0x46cfaa);logger[_0x12b0('0x21')](_0x12b0('0x20'),_0x46cfaa,JSON[_0x12b0('0x14')](_0x15a367));_0x5ab5f3(_0x15a367);})[_0x12b0('0x1a')](function(_0x21631){logger[_0x12b0('0x15')](_0x12b0('0x20'),_0x21631[_0x12b0('0x18')],_0x46cfaa);_0x44fa72(_0x283413[_0x12b0('0x15')](0x1f4,_0x21631['message']));});});};
\ No newline at end of file
index d7b3260..94e8e33 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b20=['remove','update','emit','removeListener','length','chatMessage:','./chatMessage.events','save'];(function(_0x1dac7a,_0x1828ce){var _0x4cb363=function(_0x80f6de){while(--_0x80f6de){_0x1dac7a['push'](_0x1dac7a['shift']());}};_0x4cb363(++_0x1828ce);}(_0x5b20,0x86));var _0x05b2=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x5b20[_0x59ee6f];return _0x4c0979;};'use strict';var ChatMessageEvents=require(_0x05b2('0x0'));var events=[_0x05b2('0x1'),_0x05b2('0x2'),_0x05b2('0x3')];function createListener(_0x34eed0,_0x54e72e){return function(_0x3f63b3){_0x54e72e[_0x05b2('0x4')](_0x34eed0,_0x3f63b3);};}function removeListener(_0x19cb65,_0x1d9490){return function(){ChatMessageEvents[_0x05b2('0x5')](_0x19cb65,_0x1d9490);};}exports['register']=function(_0x22e0e2){for(var _0x83fd18=0x0,_0x541855=events[_0x05b2('0x6')];_0x83fd18<_0x541855;_0x83fd18++){var _0x43cd94=events[_0x83fd18];var _0x3be69a=createListener(_0x05b2('0x7')+_0x43cd94,_0x22e0e2);ChatMessageEvents['on'](_0x43cd94,_0x3be69a);}};
\ No newline at end of file
+var _0x432b=['remove','update','removeListener','length','chatMessage:','./chatMessage.events'];(function(_0x5b8f6d,_0x15ecd0){var _0x729fba=function(_0xfeecfc){while(--_0xfeecfc){_0x5b8f6d['push'](_0x5b8f6d['shift']());}};_0x729fba(++_0x15ecd0);}(_0x432b,0x161));var _0xb432=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x432b[_0x3dd15e];return _0x231fd0;};'use strict';var ChatMessageEvents=require(_0xb432('0x0'));var events=['save',_0xb432('0x1'),_0xb432('0x2')];function createListener(_0x7170b6,_0xee80f1){return function(_0x5173f6){_0xee80f1['emit'](_0x7170b6,_0x5173f6);};}function removeListener(_0x93e722,_0x4cefc4){return function(){ChatMessageEvents[_0xb432('0x3')](_0x93e722,_0x4cefc4);};}exports['register']=function(_0x143093){for(var _0x3f1a78=0x0,_0x274447=events[_0xb432('0x4')];_0x3f1a78<_0x274447;_0x3f1a78++){var _0x14fed4=events[_0x3f1a78];var _0x6833df=createListener(_0xb432('0x5')+_0x14fed4,_0x143093);ChatMessageEvents['on'](_0x14fed4,_0x6833df);}};
\ No newline at end of file
index 3fabb8d..aafe073 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1178=['isAuthenticated','index','/describe','describe','show','post','tracked','chat','chatmessage:create','create','put','/:id','update','/:id/accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get'];(function(_0x1f3c33,_0x1a5c67){var _0x5c8c8a=function(_0x47c7b4){while(--_0x47c7b4){_0x1f3c33['push'](_0x1f3c33['shift']());}};_0x5c8c8a(++_0x1a5c67);}(_0x1178,0x18c));var _0x8117=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1178[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x8117('0x0'));var util=require(_0x8117('0x1'));var path=require(_0x8117('0x2'));var timeout=require(_0x8117('0x3'));var express=require('express');var router=express[_0x8117('0x4')]();var fs_extra=require(_0x8117('0x5'));var auth=require(_0x8117('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8117('0x7'));var controller=require('./chatMessage.controller');router[_0x8117('0x8')]('/',auth[_0x8117('0x9')](),controller[_0x8117('0xa')]);router[_0x8117('0x8')](_0x8117('0xb'),auth[_0x8117('0x9')](),controller[_0x8117('0xc')]);router[_0x8117('0x8')]('/:id',auth[_0x8117('0x9')](),controller[_0x8117('0xd')]);router[_0x8117('0xe')]('/',auth[_0x8117('0x9')](),interaction[_0x8117('0xf')](_0x8117('0x10'),_0x8117('0x11')),controller[_0x8117('0x12')]);router[_0x8117('0x13')](_0x8117('0x14'),controller[_0x8117('0x15')]);router[_0x8117('0x13')](_0x8117('0x16'),auth[_0x8117('0x9')](),controller['accept']);router[_0x8117('0x13')]('/:id/reject',auth[_0x8117('0x9')](),controller[_0x8117('0x17')]);router[_0x8117('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x8117('0x19')]);module[_0x8117('0x1a')]=router;
\ No newline at end of file
+var _0x3fc4=['accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','get','/describe','/:id','show','tracked','chatmessage:create','create','update','put','/:id/accept'];(function(_0x51bbed,_0x355ccc){var _0x283e84=function(_0x210216){while(--_0x210216){_0x51bbed['push'](_0x51bbed['shift']());}};_0x283e84(++_0x355ccc);}(_0x3fc4,0xd5));var _0x43fc=function(_0x499227,_0x591059){_0x499227=_0x499227-0x0;var _0x26e12d=_0x3fc4[_0x499227];return _0x26e12d;};'use strict';var multer=require(_0x43fc('0x0'));var util=require(_0x43fc('0x1'));var path=require(_0x43fc('0x2'));var timeout=require(_0x43fc('0x3'));var express=require('express');var router=express[_0x43fc('0x4')]();var fs_extra=require(_0x43fc('0x5'));var auth=require(_0x43fc('0x6'));var interaction=require(_0x43fc('0x7'));var config=require(_0x43fc('0x8'));var controller=require(_0x43fc('0x9'));router['get']('/',auth[_0x43fc('0xa')](),controller['index']);router[_0x43fc('0xb')](_0x43fc('0xc'),auth[_0x43fc('0xa')](),controller['describe']);router[_0x43fc('0xb')](_0x43fc('0xd'),auth[_0x43fc('0xa')](),controller[_0x43fc('0xe')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x43fc('0xf')]('chat',_0x43fc('0x10')),controller[_0x43fc('0x11')]);router['put'](_0x43fc('0xd'),controller[_0x43fc('0x12')]);router[_0x43fc('0x13')](_0x43fc('0x14'),auth[_0x43fc('0xa')](),controller[_0x43fc('0x15')]);router[_0x43fc('0x13')]('/:id/reject',auth[_0x43fc('0xa')](),controller[_0x43fc('0x16')]);router[_0x43fc('0x17')](_0x43fc('0xd'),auth[_0x43fc('0xa')](),controller[_0x43fc('0x18')]);module[_0x43fc('0x19')]=router;
\ No newline at end of file
index 43ee7b1..111cf4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f66=['medium','TEXT','exports'];(function(_0x5953d6,_0x3e4049){var _0x282da3=function(_0x2d319a){while(--_0x2d319a){_0x5953d6['push'](_0x5953d6['shift']());}};_0x282da3(++_0x3e4049);}(_0x5f66,0x1a0));var _0x65f6=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x5f66[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}};
\ No newline at end of file
+var _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x5138de,_0x120ccb){var _0x1b1e7d=function(_0x84da68){while(--_0x84da68){_0x5138de['push'](_0x5138de['shift']());}};_0x1b1e7d(++_0x120ccb);}(_0x5f2f,0x73));var _0xf5f2=function(_0x341b59,_0x2e23ad){_0x341b59=_0x341b59-0x0;var _0x19e0a1=_0x5f2f[_0x341b59];return _0x19e0a1;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]}};
\ No newline at end of file
index a562c8f..10a1d6d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0xddb6f0,_0xf3ebc6){var _0x414b23=function(_0x176269){while(--_0x176269){_0xddb6f0['push'](_0xddb6f0['shift']());}};_0x414b23(++_0xf3ebc6);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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
+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(_0x52e175,_0xea622c){var _0x471e4c=function(_0x45033f){while(--_0x45033f){_0x52e175['push'](_0x52e175['shift']());}};_0x471e4c(++_0xea622c);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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 6f10e5a..7455d23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x607c=['remove','emit','hook','exports','../../mysqldb','ChatOfflineMessage','save','update'];(function(_0x15fc07,_0x41cc0c){var _0x3d2c0f=function(_0x2a9a17){while(--_0x2a9a17){_0x15fc07['push'](_0x15fc07['shift']());}};_0x3d2c0f(++_0x41cc0c);}(_0x607c,0x1dc));var _0xc607=function(_0x2eb7e4,_0x16f077){_0x2eb7e4=_0x2eb7e4-0x0;var _0x36a109=_0x607c[_0x2eb7e4];return _0x36a109;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0xc607('0x0'))['db'][_0xc607('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc607('0x2'),'afterUpdate':_0xc607('0x3'),'afterDestroy':_0xc607('0x4')};function emitEvent(_0xe7ef3b){return function(_0x1f52d7,_0x4f16b8,_0x40249d){ChatOfflineMessageEvents[_0xc607('0x5')](_0xe7ef3b+':'+_0x1f52d7['id'],_0x1f52d7);ChatOfflineMessageEvents['emit'](_0xe7ef3b,_0x1f52d7);_0x40249d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0xc607('0x6')](e,emitEvent(event));}}module[_0xc607('0x7')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x3079=['../../mysqldb','ChatOfflineMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x4c625f,_0x17d2c4){var _0xc23f32=function(_0xf40900){while(--_0xf40900){_0x4c625f['push'](_0x4c625f['shift']());}};_0xc23f32(++_0x17d2c4);}(_0x3079,0x110));var _0x9307=function(_0xb93732,_0x3ad6b9){_0xb93732=_0xb93732-0x0;var _0x1f1316=_0x3079[_0xb93732];return _0x1f1316;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x9307('0x0'))['db'][_0x9307('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x9307('0x2')](0x0);var events={'afterCreate':_0x9307('0x3'),'afterUpdate':'update','afterDestroy':_0x9307('0x4')};function emitEvent(_0x1f7680){return function(_0x513b2c,_0x57c9a6,_0x42c46a){ChatOfflineMessageEvents[_0x9307('0x5')](_0x1f7680+':'+_0x513b2c['id'],_0x513b2c);ChatOfflineMessageEvents[_0x9307('0x5')](_0x1f7680,_0x513b2c);_0x42c46a(null);};}for(var e in events){if(events[_0x9307('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x9307('0x7')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
index 4f8a103..050fe86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfccc=['./chatOfflineMessage.attributes','exports','ChatOfflineMessage','utf8mb4'];(function(_0x225e10,_0xc6e1d7){var _0x3ef9e7=function(_0x568555){while(--_0x568555){_0x225e10['push'](_0x225e10['shift']());}};_0x3ef9e7(++_0xc6e1d7);}(_0xfccc,0x1bc));var _0xcfcc=function(_0x5b939b,_0x6b23b9){_0x5b939b=_0x5b939b-0x0;var _0x372760=_0xfccc[_0x5b939b];return _0x372760;};'use strict';var attributes=require(_0xcfcc('0x0'));module[_0xcfcc('0x1')]=function(_0x303c22){return _0x303c22['define'](_0xcfcc('0x2'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcfcc('0x3'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xf25c=['ChatOfflineMessage','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports'];(function(_0x57062c,_0x5dd5e2){var _0x1073b3=function(_0x29ee56){while(--_0x29ee56){_0x57062c['push'](_0x57062c['shift']());}};_0x1073b3(++_0x5dd5e2);}(_0xf25c,0x9e));var _0xcf25=function(_0x5ce15c,_0x19c917){_0x5ce15c=_0x5ce15c-0x0;var _0x36e4f5=_0xf25c[_0x5ce15c];return _0x36e4f5;};'use strict';var attributes=require(_0xcf25('0x0'));module[_0xcf25('0x1')]=function(_0x1d4725){return _0x1d4725['define'](_0xcf25('0x2'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xcf25('0x3')});};
\ No newline at end of file
index 647f2b8..4020e97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a44=['result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','message','info'];(function(_0x216c8d,_0x1b53f4){var _0x376461=function(_0x4e8a94){while(--_0x4e8a94){_0x216c8d['push'](_0x216c8d['shift']());}};_0x376461(++_0x1b53f4);}(_0x9a44,0x156));var _0x49a4=function(_0x303ed9,_0x496477){_0x303ed9=_0x303ed9-0x0;var _0x54bbd9=_0x9a44[_0x303ed9];return _0x54bbd9;};'use strict';var _=require(_0x49a4('0x0'));var util=require(_0x49a4('0x1'));var moment=require(_0x49a4('0x2'));var BPromise=require('bluebird');var rs=require(_0x49a4('0x3'));var fs=require('fs');var Redis=require(_0x49a4('0x4'));var db=require(_0x49a4('0x5'))['db'];var utils=require(_0x49a4('0x6'));var logger=require(_0x49a4('0x7'))(_0x49a4('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x49a4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x12de2f,_0x41c6c4,_0x4e00e1){return new BPromise(function(_0x11d123,_0x4fefbb){return client[_0x49a4('0xa')](_0x12de2f,_0x4e00e1)[_0x49a4('0xb')](function(_0x415ba1){logger['info'](_0x49a4('0xc'),_0x41c6c4,_0x49a4('0xd'));logger['debug'](_0x49a4('0xe'),_0x41c6c4,_0x49a4('0xd'),JSON['stringify'](_0x415ba1));if(_0x415ba1[_0x49a4('0xf')]){if(_0x415ba1['error']['code']===0x1f4){logger[_0x49a4('0xf')](_0x49a4('0xc'),_0x41c6c4,_0x415ba1['error'][_0x49a4('0x10')]);return _0x4fefbb(_0x415ba1['error'][_0x49a4('0x10')]);}logger[_0x49a4('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x41c6c4,_0x415ba1[_0x49a4('0xf')][_0x49a4('0x10')]);return _0x11d123(_0x415ba1[_0x49a4('0xf')][_0x49a4('0x10')]);}else{logger[_0x49a4('0x11')](_0x49a4('0xc'),_0x41c6c4,'request\x20sent');_0x11d123(_0x415ba1[_0x49a4('0x12')]['message']);}})[_0x49a4('0x13')](function(_0x327957){logger[_0x49a4('0xf')](_0x49a4('0xc'),_0x41c6c4,_0x327957);_0x4fefbb(_0x327957);});});}
\ No newline at end of file
+var _0xf4b0=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','bluebird','ioredis','../../mysqldb'];(function(_0x7f1086,_0x434356){var _0x358a47=function(_0x1f14ab){while(--_0x1f14ab){_0x7f1086['push'](_0x7f1086['shift']());}};_0x358a47(++_0x434356);}(_0xf4b0,0x1d1));var _0x0f4b=function(_0x26c22c,_0x584677){_0x26c22c=_0x26c22c-0x0;var _0xf09a0e=_0xf4b0[_0x26c22c];return _0xf09a0e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x0f4b('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0f4b('0x1'));var db=require(_0x0f4b('0x2'))['db'];var utils=require(_0x0f4b('0x3'));var logger=require(_0x0f4b('0x4'))(_0x0f4b('0x5'));var config=require(_0x0f4b('0x6'));var jayson=require(_0x0f4b('0x7'));var client=jayson[_0x0f4b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52bea8,_0x2ea563,_0x36e227){return new BPromise(function(_0x5b5362,_0x2f352f){return client[_0x0f4b('0x9')](_0x52bea8,_0x36e227)[_0x0f4b('0xa')](function(_0xaf5acf){logger[_0x0f4b('0xb')](_0x0f4b('0xc'),_0x2ea563,_0x0f4b('0xd'));logger['debug']('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x2ea563,'request\x20sent',JSON[_0x0f4b('0xe')](_0xaf5acf));if(_0xaf5acf['error']){if(_0xaf5acf['error']['code']===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x2ea563,_0xaf5acf[_0x0f4b('0xf')][_0x0f4b('0x10')]);return _0x2f352f(_0xaf5acf[_0x0f4b('0xf')][_0x0f4b('0x10')]);}logger[_0x0f4b('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x2ea563,_0xaf5acf['error']['message']);return _0x5b5362(_0xaf5acf[_0x0f4b('0xf')]['message']);}else{logger['info'](_0x0f4b('0xc'),_0x2ea563,_0x0f4b('0xd'));_0x5b5362(_0xaf5acf[_0x0f4b('0x11')][_0x0f4b('0x10')]);}})['catch'](function(_0x2434d1){logger[_0x0f4b('0xf')](_0x0f4b('0xc'),_0x2ea563,_0x2434d1);_0x2f352f(_0x2434d1);});});}
\ No newline at end of file
index f39d633..5a384db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2855=['create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post'];(function(_0x16e73a,_0x146629){var _0x187aa1=function(_0x26eb2f){while(--_0x26eb2f){_0x16e73a['push'](_0x16e73a['shift']());}};_0x187aa1(++_0x146629);}(_0x2855,0x12b));var _0x5285=function(_0x43b584,_0x20a6bd){_0x43b584=_0x43b584-0x0;var _0x48f27b=_0x2855[_0x43b584];return _0x48f27b;};'use strict';var multer=require(_0x5285('0x0'));var util=require(_0x5285('0x1'));var path=require(_0x5285('0x2'));var timeout=require(_0x5285('0x3'));var express=require(_0x5285('0x4'));var router=express[_0x5285('0x5')]();var fs_extra=require(_0x5285('0x6'));var auth=require(_0x5285('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x5285('0x8'));var controller=require('./chatOfflineMessage.controller');router[_0x5285('0x9')]('/',auth[_0x5285('0xa')](),controller[_0x5285('0xb')]);router[_0x5285('0x9')](_0x5285('0xc'),auth[_0x5285('0xa')](),controller['describe']);router[_0x5285('0x9')](_0x5285('0xd'),auth[_0x5285('0xa')](),controller[_0x5285('0xe')]);router[_0x5285('0xf')]('/',auth[_0x5285('0xa')](),controller[_0x5285('0x10')]);router[_0x5285('0x11')](_0x5285('0xd'),auth[_0x5285('0xa')](),controller[_0x5285('0x12')]);router['delete'](_0x5285('0xd'),auth['isAuthenticated'](),controller[_0x5285('0x13')]);module[_0x5285('0x14')]=router;
\ No newline at end of file
+var _0x21e6=['./chatOfflineMessage.controller','get','index','/describe','isAuthenticated','describe','post','create','put','/:id','delete','exports','multer','util','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x442546,_0x2c4eec){var _0x4464e6=function(_0x182849){while(--_0x182849){_0x442546['push'](_0x442546['shift']());}};_0x4464e6(++_0x2c4eec);}(_0x21e6,0x8a));var _0x621e=function(_0x5bff0,_0x20716d){_0x5bff0=_0x5bff0-0x0;var _0x3ead2e=_0x21e6[_0x5bff0];return _0x3ead2e;};'use strict';var multer=require(_0x621e('0x0'));var util=require(_0x621e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x621e('0x2'));var router=express[_0x621e('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x621e('0x4'));var config=require(_0x621e('0x5'));var controller=require(_0x621e('0x6'));router[_0x621e('0x7')]('/',auth['isAuthenticated'](),controller[_0x621e('0x8')]);router[_0x621e('0x7')](_0x621e('0x9'),auth[_0x621e('0xa')](),controller[_0x621e('0xb')]);router[_0x621e('0x7')]('/:id',auth[_0x621e('0xa')](),controller['show']);router[_0x621e('0xc')]('/',auth['isAuthenticated'](),controller[_0x621e('0xd')]);router[_0x621e('0xe')](_0x621e('0xf'),auth[_0x621e('0xa')](),controller['update']);router[_0x621e('0x10')](_0x621e('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x621e('0x11')]=router;
\ No newline at end of file
index 2c6f412..ec2e60c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd4b=['ENUM','timeout','STRING','sequelize'];(function(_0x330fd1,_0x219869){var _0x2f3fea=function(_0x2fb134){while(--_0x2fb134){_0x330fd1['push'](_0x330fd1['shift']());}};_0x2f3fea(++_0x219869);}(_0xdd4b,0x1cf));var _0xbdd4=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xdd4b[_0x4b055c];return _0x4b62bb;};'use strict';var Sequelize=require(_0xbdd4('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xbdd4('0x1')]('mouseOver',_0xbdd4('0x2')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xbdd4('0x3')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xc2d5=['exports','STRING','ENUM','mouseOver','timeout','INTEGER','sequelize'];(function(_0xace267,_0x2bc132){var _0x5649af=function(_0x1d6aec){while(--_0x1d6aec){_0xace267['push'](_0xace267['shift']());}};_0x5649af(++_0x2bc132);}(_0xc2d5,0xd8));var _0x5c2d=function(_0x1e6659,_0x1f860c){_0x1e6659=_0x1e6659-0x0;var _0x4d16e4=_0xc2d5[_0x1e6659];return _0x4d16e4;};'use strict';var Sequelize=require(_0x5c2d('0x0'));module[_0x5c2d('0x1')]={'name':{'type':Sequelize[_0x5c2d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x5c2d('0x3')](_0x5c2d('0x4'),_0x5c2d('0x5')),'defaultValue':_0x5c2d('0x4')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x5c2d('0x6')]}};
\ No newline at end of file
index f909c62..fd8762c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7217=['../../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','update','then','destroy','sendStatus','stack','send','show','params','keys','ChatProactiveAction','query','intersection','model','fields','attributes','length','includeAll','merge','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x1a90f7,_0x433b73){var _0x37f5f0=function(_0x5234e8){while(--_0x5234e8){_0x1a90f7['push'](_0x1a90f7['shift']());}};_0x37f5f0(++_0x433b73);}(_0x7217,0x19e));var _0x7721=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x7217[_0x220dbb];return _0x2b77de;};'use strict';var emlformat=require(_0x7721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7721('0x1'));var jsonpatch=require(_0x7721('0x2'));var rp=require(_0x7721('0x3'));var moment=require(_0x7721('0x4'));var BPromise=require(_0x7721('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7721('0x6'));var sox=require(_0x7721('0x7'));var csv=require(_0x7721('0x8'));var ejs=require(_0x7721('0x9'));var fs=require('fs');var fs_extra=require(_0x7721('0xa'));var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x8'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var licenseUtil=require(_0x7721('0x1a'));var db=require(_0x7721('0x1b'))['db'];function respondWithStatusCode(_0x55b4ca,_0x2911ec){_0x2911ec=_0x2911ec||0xcc;return function(_0x199930){if(_0x199930){return _0x55b4ca['sendStatus'](_0x2911ec);}return _0x55b4ca[_0x7721('0x1c')](_0x2911ec)[_0x7721('0x1d')]();};}function respondWithResult(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0xc8;return function(_0x5069da){if(_0x5069da){return _0x3f01c5[_0x7721('0x1c')](_0x2e9752)[_0x7721('0x1e')](_0x5069da);}};}function respondWithFilteredResult(_0x534f1b,_0x4e199a){return function(_0x4b183e){if(_0x4b183e){var _0x5ed54=typeof _0x4e199a[_0x7721('0x1f')]===_0x7721('0x20')&&typeof _0x4e199a[_0x7721('0x21')]==='undefined';var _0x20f669=_0x4b183e['count'];var _0x3fc09e=_0x5ed54?0x0:_0x4e199a['offset'];var _0xfec626=_0x5ed54?_0x4b183e[_0x7721('0x22')]:_0x4e199a[_0x7721('0x1f')]+_0x4e199a[_0x7721('0x21')];var _0x2286e5;if(_0xfec626>=_0x20f669){_0xfec626=_0x20f669;_0x2286e5=0xc8;}else{_0x2286e5=0xce;}_0x534f1b[_0x7721('0x1c')](_0x2286e5);return _0x534f1b[_0x7721('0x23')](_0x7721('0x24'),_0x3fc09e+'-'+_0xfec626+'/'+_0x20f669)[_0x7721('0x1e')](_0x4b183e);}return null;};}function patchUpdates(_0xaeccc4){return function(_0x4ce1db){try{jsonpatch[_0x7721('0x25')](_0x4ce1db,_0xaeccc4,!![]);}catch(_0x2c1583){return BPromise[_0x7721('0x26')](_0x2c1583);}return _0x4ce1db[_0x7721('0x27')]();};}function saveUpdates(_0x57140c,_0x28f5a6){return function(_0x512f31){if(_0x512f31){return _0x512f31[_0x7721('0x28')](_0x57140c)[_0x7721('0x29')](function(_0x3e8a4e){return _0x3e8a4e;});}return null;};}function removeEntity(_0x1caad8,_0x121cc4){return function(_0x395b15){if(_0x395b15){return _0x395b15[_0x7721('0x2a')]()['then'](function(){_0x1caad8[_0x7721('0x1c')](0xcc)[_0x7721('0x1d')]();});}};}function handleEntityNotFound(_0x125564,_0x1f67c7){return function(_0x40d550){if(!_0x40d550){_0x125564[_0x7721('0x2b')](0x194);}return _0x40d550;};}function handleError(_0x424e05,_0xf753f1){_0xf753f1=_0xf753f1||0x1f4;return function(_0x40f367){logger['error'](_0x40f367[_0x7721('0x2c')]);if(_0x40f367['name']){delete _0x40f367['name'];}_0x424e05[_0x7721('0x1c')](_0xf753f1)[_0x7721('0x2d')](_0x40f367);};}exports[_0x7721('0x2e')]=function(_0x158d98,_0x1ea4d){var _0x37b9f0={'raw':!![],'where':{'id':_0x158d98[_0x7721('0x2f')]['id']}},_0xd7d703={};_0xd7d703['model']=_[_0x7721('0x30')](db[_0x7721('0x31')]['rawAttributes']);_0xd7d703['query']=_[_0x7721('0x30')](_0x158d98[_0x7721('0x32')]);_0xd7d703['filters']=_[_0x7721('0x33')](_0xd7d703[_0x7721('0x34')],_0xd7d703[_0x7721('0x32')]);_0x37b9f0['attributes']=_[_0x7721('0x33')](_0xd7d703[_0x7721('0x34')],qs[_0x7721('0x35')](_0x158d98[_0x7721('0x32')][_0x7721('0x35')]));_0x37b9f0['attributes']=_0x37b9f0[_0x7721('0x36')][_0x7721('0x37')]?_0x37b9f0[_0x7721('0x36')]:_0xd7d703['model'];if(_0x158d98[_0x7721('0x32')][_0x7721('0x38')]){_0x37b9f0['include']=[{'all':!![]}];}_0x37b9f0=_[_0x7721('0x39')]({},_0x37b9f0,_0x158d98['options']);return db[_0x7721('0x31')][_0x7721('0x3a')](_0x37b9f0)[_0x7721('0x29')](handleEntityNotFound(_0x1ea4d,null))[_0x7721('0x29')](respondWithResult(_0x1ea4d,null))[_0x7721('0x3b')](handleError(_0x1ea4d,null));};exports[_0x7721('0x3c')]=function(_0x2f1fe0,_0x15545a){return db[_0x7721('0x31')][_0x7721('0x3c')](_0x2f1fe0[_0x7721('0x3d')],{})['then'](respondWithResult(_0x15545a,0xc9))[_0x7721('0x3b')](handleError(_0x15545a,null));};exports['update']=function(_0x212384,_0x35614c){if(_0x212384[_0x7721('0x3d')]['id']){delete _0x212384[_0x7721('0x3d')]['id'];}return db[_0x7721('0x31')][_0x7721('0x3a')]({'where':{'id':_0x212384['params']['id']}})['then'](handleEntityNotFound(_0x35614c,null))['then'](saveUpdates(_0x212384['body'],null))[_0x7721('0x29')](respondWithResult(_0x35614c,null))[_0x7721('0x3b')](handleError(_0x35614c,null));};exports[_0x7721('0x2a')]=function(_0x22ef35,_0x4a90ce){return db[_0x7721('0x31')]['find']({'where':{'id':_0x22ef35[_0x7721('0x2f')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x4a90ce,null))['then'](removeEntity(_0x4a90ce,null))[_0x7721('0x3b')](handleError(_0x4a90ce,null));};
\ No newline at end of file
+var _0x097c=['options','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','reject','save','update','then','end','error','stack','name','send','show','params','keys','ChatProactiveAction','rawAttributes','query','intersection','attributes','model','fields','length','includeAll','include'];(function(_0x4e16e1,_0x2e826b){var _0x33653c=function(_0x24f01d){while(--_0x24f01d){_0x4e16e1['push'](_0x4e16e1['shift']());}};_0x33653c(++_0x2e826b);}(_0x097c,0x1d5));var _0xc097=function(_0xa55ff,_0x55b12b){_0xa55ff=_0xa55ff-0x0;var _0x21c6a5=_0x097c[_0xa55ff];return _0x21c6a5;};'use strict';var emlformat=require(_0xc097('0x0'));var rimraf=require(_0xc097('0x1'));var zipdir=require(_0xc097('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc097('0x3'));var moment=require(_0xc097('0x4'));var BPromise=require(_0xc097('0x5'));var Mustache=require(_0xc097('0x6'));var util=require('util');var path=require(_0xc097('0x7'));var sox=require('sox');var csv=require(_0xc097('0x8'));var ejs=require(_0xc097('0x9'));var fs=require('fs');var fs_extra=require(_0xc097('0xa'));var _=require(_0xc097('0xb'));var squel=require('squel');var crypto=require(_0xc097('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc097('0x8'));var querystring=require(_0xc097('0xd'));var Papa=require(_0xc097('0xe'));var Redis=require(_0xc097('0xf'));var authService=require(_0xc097('0x10'));var qs=require(_0xc097('0x11'));var as=require(_0xc097('0x12'));var hardwareService=require(_0xc097('0x13'));var logger=require(_0xc097('0x14'))('api');var utils=require(_0xc097('0x15'));var config=require(_0xc097('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc097('0x17'))['db'];function respondWithStatusCode(_0x24a5d8,_0x2a2897){_0x2a2897=_0x2a2897||0xcc;return function(_0x276ad2){if(_0x276ad2){return _0x24a5d8[_0xc097('0x18')](_0x2a2897);}return _0x24a5d8[_0xc097('0x19')](_0x2a2897)['end']();};}function respondWithResult(_0x511b68,_0x42fd3a){_0x42fd3a=_0x42fd3a||0xc8;return function(_0xa31949){if(_0xa31949){return _0x511b68[_0xc097('0x19')](_0x42fd3a)[_0xc097('0x1a')](_0xa31949);}};}function respondWithFilteredResult(_0x409add,_0x54e63a){return function(_0x3cd66f){if(_0x3cd66f){var _0x5d910e=typeof _0x54e63a[_0xc097('0x1b')]==='undefined'&&typeof _0x54e63a[_0xc097('0x1c')]===_0xc097('0x1d');var _0x35170e=_0x3cd66f[_0xc097('0x1e')];var _0xd7cd88=_0x5d910e?0x0:_0x54e63a['offset'];var _0x5a3317=_0x5d910e?_0x3cd66f[_0xc097('0x1e')]:_0x54e63a[_0xc097('0x1b')]+_0x54e63a[_0xc097('0x1c')];var _0x5ebc4a;if(_0x5a3317>=_0x35170e){_0x5a3317=_0x35170e;_0x5ebc4a=0xc8;}else{_0x5ebc4a=0xce;}_0x409add[_0xc097('0x19')](_0x5ebc4a);return _0x409add['set']('Content-Range',_0xd7cd88+'-'+_0x5a3317+'/'+_0x35170e)['json'](_0x3cd66f);}return null;};}function patchUpdates(_0x1d137e){return function(_0x4d8b46){try{jsonpatch['apply'](_0x4d8b46,_0x1d137e,!![]);}catch(_0x714cac){return BPromise[_0xc097('0x1f')](_0x714cac);}return _0x4d8b46[_0xc097('0x20')]();};}function saveUpdates(_0x470e59,_0x2eff2f){return function(_0x4072b4){if(_0x4072b4){return _0x4072b4[_0xc097('0x21')](_0x470e59)[_0xc097('0x22')](function(_0x2ec38d){return _0x2ec38d;});}return null;};}function removeEntity(_0x5e5130,_0x50b88e){return function(_0x516177){if(_0x516177){return _0x516177['destroy']()[_0xc097('0x22')](function(){_0x5e5130[_0xc097('0x19')](0xcc)[_0xc097('0x23')]();});}};}function handleEntityNotFound(_0x38de3d,_0x25e014){return function(_0xaf8497){if(!_0xaf8497){_0x38de3d[_0xc097('0x18')](0x194);}return _0xaf8497;};}function handleError(_0x133bf2,_0x1c0aba){_0x1c0aba=_0x1c0aba||0x1f4;return function(_0x1312d6){logger[_0xc097('0x24')](_0x1312d6[_0xc097('0x25')]);if(_0x1312d6[_0xc097('0x26')]){delete _0x1312d6[_0xc097('0x26')];}_0x133bf2['status'](_0x1c0aba)[_0xc097('0x27')](_0x1312d6);};}exports[_0xc097('0x28')]=function(_0x497618,_0x4943e2){var _0x3b3077={'raw':!![],'where':{'id':_0x497618[_0xc097('0x29')]['id']}},_0x41ccf0={};_0x41ccf0['model']=_[_0xc097('0x2a')](db[_0xc097('0x2b')][_0xc097('0x2c')]);_0x41ccf0['query']=_['keys'](_0x497618[_0xc097('0x2d')]);_0x41ccf0['filters']=_[_0xc097('0x2e')](_0x41ccf0['model'],_0x41ccf0['query']);_0x3b3077[_0xc097('0x2f')]=_['intersection'](_0x41ccf0[_0xc097('0x30')],qs[_0xc097('0x31')](_0x497618[_0xc097('0x2d')][_0xc097('0x31')]));_0x3b3077['attributes']=_0x3b3077['attributes'][_0xc097('0x32')]?_0x3b3077[_0xc097('0x2f')]:_0x41ccf0[_0xc097('0x30')];if(_0x497618[_0xc097('0x2d')][_0xc097('0x33')]){_0x3b3077[_0xc097('0x34')]=[{'all':!![]}];}_0x3b3077=_['merge']({},_0x3b3077,_0x497618[_0xc097('0x35')]);return db[_0xc097('0x2b')][_0xc097('0x36')](_0x3b3077)[_0xc097('0x22')](handleEntityNotFound(_0x4943e2,null))[_0xc097('0x22')](respondWithResult(_0x4943e2,null))[_0xc097('0x37')](handleError(_0x4943e2,null));};exports[_0xc097('0x38')]=function(_0x2ab647,_0xd4fcd0){return db['ChatProactiveAction']['create'](_0x2ab647[_0xc097('0x39')],{})[_0xc097('0x22')](respondWithResult(_0xd4fcd0,0xc9))[_0xc097('0x37')](handleError(_0xd4fcd0,null));};exports[_0xc097('0x21')]=function(_0x3dd845,_0x574986){if(_0x3dd845[_0xc097('0x39')]['id']){delete _0x3dd845[_0xc097('0x39')]['id'];}return db[_0xc097('0x2b')][_0xc097('0x36')]({'where':{'id':_0x3dd845[_0xc097('0x29')]['id']}})[_0xc097('0x22')](handleEntityNotFound(_0x574986,null))[_0xc097('0x22')](saveUpdates(_0x3dd845[_0xc097('0x39')],null))[_0xc097('0x22')](respondWithResult(_0x574986,null))[_0xc097('0x37')](handleError(_0x574986,null));};exports['destroy']=function(_0x4bba49,_0x224cd3){return db[_0xc097('0x2b')][_0xc097('0x36')]({'where':{'id':_0x4bba49[_0xc097('0x29')]['id']}})[_0xc097('0x22')](handleEntityNotFound(_0x224cd3,null))[_0xc097('0x22')](removeEntity(_0x224cd3,null))[_0xc097('0x37')](handleError(_0x224cd3,null));};
\ No newline at end of file
index 56e0d7c..f978a72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1304=['./chatProactiveAction.attributes','exports','define','chat_proactive_actions','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5d3108,_0x11e101){var _0x16985a=function(_0x41abe6){while(--_0x41abe6){_0x5d3108['push'](_0x5d3108['shift']());}};_0x16985a(++_0x11e101);}(_0x1304,0x1b4));var _0x4130=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1304[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4130('0x0'));var util=require(_0x4130('0x1'));var logger=require(_0x4130('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4130('0x3'));var rp=require(_0x4130('0x4'));var fs=require('fs');var path=require(_0x4130('0x5'));var rimraf=require(_0x4130('0x6'));var config=require(_0x4130('0x7'));var attributes=require(_0x4130('0x8'));module[_0x4130('0x9')]=function(_0x32eb93,_0x390f84){return _0x32eb93[_0x4130('0xa')]('ChatProactiveAction',attributes,{'tableName':_0x4130('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x190e=['path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x382832,_0x46e5cf){var _0x202fea=function(_0x28c5e2){while(--_0x28c5e2){_0x382832['push'](_0x382832['shift']());}};_0x202fea(++_0x46e5cf);}(_0x190e,0x13c));var _0xe190=function(_0x5cbf0e,_0x4cd140){_0x5cbf0e=_0x5cbf0e-0x0;var _0x1c76f8=_0x190e[_0x5cbf0e];return _0x1c76f8;};'use strict';var _=require('lodash');var util=require(_0xe190('0x0'));var logger=require(_0xe190('0x1'))(_0xe190('0x2'));var moment=require(_0xe190('0x3'));var BPromise=require(_0xe190('0x4'));var rp=require(_0xe190('0x5'));var fs=require('fs');var path=require(_0xe190('0x6'));var rimraf=require(_0xe190('0x7'));var config=require(_0xe190('0x8'));var attributes=require(_0xe190('0x9'));module[_0xe190('0xa')]=function(_0x343c22,_0x3bad1f){return _0x343c22[_0xe190('0xb')](_0xe190('0xc'),attributes,{'tableName':_0xe190('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 40efb11..f358c0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ead=['ChatProactiveAction,\x20%s,\x20%s,\x20%s','code','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x176b5d,_0x40d0c9){var _0x305b6c=function(_0x338385){while(--_0x338385){_0x176b5d['push'](_0x176b5d['shift']());}};_0x305b6c(++_0x40d0c9);}(_0x9ead,0x191));var _0xd9ea=function(_0x1ee9a1,_0x5f1434){_0x1ee9a1=_0x1ee9a1-0x0;var _0x21270f=_0x9ead[_0x1ee9a1];return _0x21270f;};'use strict';var _=require(_0xd9ea('0x0'));var util=require(_0xd9ea('0x1'));var moment=require('moment');var BPromise=require(_0xd9ea('0x2'));var rs=require(_0xd9ea('0x3'));var fs=require('fs');var Redis=require(_0xd9ea('0x4'));var db=require(_0xd9ea('0x5'))['db'];var utils=require(_0xd9ea('0x6'));var logger=require(_0xd9ea('0x7'))(_0xd9ea('0x8'));var config=require(_0xd9ea('0x9'));var jayson=require(_0xd9ea('0xa'));var client=jayson[_0xd9ea('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24f462,_0x1d0203,_0x245b7a){return new BPromise(function(_0x456602,_0x43c172){return client[_0xd9ea('0xc')](_0x24f462,_0x245b7a)['then'](function(_0x40dbca){logger[_0xd9ea('0xd')](_0xd9ea('0xe'),_0x1d0203,_0xd9ea('0xf'));logger[_0xd9ea('0x10')](_0xd9ea('0x11'),_0x1d0203,'request\x20sent',JSON['stringify'](_0x40dbca));if(_0x40dbca['error']){if(_0x40dbca['error'][_0xd9ea('0x12')]===0x1f4){logger[_0xd9ea('0x13')]('ChatProactiveAction,\x20%s,\x20%s',_0x1d0203,_0x40dbca[_0xd9ea('0x13')][_0xd9ea('0x14')]);return _0x43c172(_0x40dbca[_0xd9ea('0x13')]['message']);}logger[_0xd9ea('0x13')](_0xd9ea('0xe'),_0x1d0203,_0x40dbca[_0xd9ea('0x13')]['message']);return _0x456602(_0x40dbca['error'][_0xd9ea('0x14')]);}else{logger[_0xd9ea('0xd')](_0xd9ea('0xe'),_0x1d0203,'request\x20sent');_0x456602(_0x40dbca['result'][_0xd9ea('0x14')]);}})[_0xd9ea('0x15')](function(_0x3db58f){logger[_0xd9ea('0x13')]('ChatProactiveAction,\x20%s,\x20%s',_0x1d0203,_0x3db58f);_0x43c172(_0x3db58f);});});}
\ No newline at end of file
+var _0x12e8=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','request\x20sent','error','code','ChatProactiveAction,\x20%s,\x20%s','message','info','catch','util','moment'];(function(_0x3220e0,_0x348d9d){var _0x15c42f=function(_0x362458){while(--_0x362458){_0x3220e0['push'](_0x3220e0['shift']());}};_0x15c42f(++_0x348d9d);}(_0x12e8,0x19c));var _0x812e=function(_0x3da241,_0xeba26a){_0x3da241=_0x3da241-0x0;var _0x43e156=_0x12e8[_0x3da241];return _0x43e156;};'use strict';var _=require('lodash');var util=require(_0x812e('0x0'));var moment=require(_0x812e('0x1'));var BPromise=require(_0x812e('0x2'));var rs=require(_0x812e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x812e('0x4'))['db'];var utils=require(_0x812e('0x5'));var logger=require(_0x812e('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x812e('0x7'));var client=jayson['client'][_0x812e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x19da62,_0x614152,_0x261589){return new BPromise(function(_0x5d34f5,_0x33c264){return client[_0x812e('0x9')](_0x19da62,_0x261589)[_0x812e('0xa')](function(_0x2d5563){logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x614152,'request\x20sent');logger['debug']('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x614152,_0x812e('0xb'),JSON['stringify'](_0x2d5563));if(_0x2d5563[_0x812e('0xc')]){if(_0x2d5563['error'][_0x812e('0xd')]===0x1f4){logger[_0x812e('0xc')](_0x812e('0xe'),_0x614152,_0x2d5563[_0x812e('0xc')][_0x812e('0xf')]);return _0x33c264(_0x2d5563[_0x812e('0xc')]['message']);}logger[_0x812e('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x614152,_0x2d5563['error']['message']);return _0x5d34f5(_0x2d5563['error'][_0x812e('0xf')]);}else{logger[_0x812e('0x10')](_0x812e('0xe'),_0x614152,_0x812e('0xb'));_0x5d34f5(_0x2d5563['result'][_0x812e('0xf')]);}})[_0x812e('0x11')](function(_0x255ba6){logger[_0x812e('0xc')](_0x812e('0xe'),_0x614152,_0x255ba6);_0x33c264(_0x255ba6);});});}
\ No newline at end of file
index a993d67..a291225 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2eb2=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','/:id','isAuthenticated','show','post','create','put','update','delete','util'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x2eb2,0x19f));var _0x22eb=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0x2eb2[_0x4d07cc];return _0x42de3b;};'use strict';var multer=require('multer');var util=require(_0x22eb('0x0'));var path=require(_0x22eb('0x1'));var timeout=require(_0x22eb('0x2'));var express=require(_0x22eb('0x3'));var router=express[_0x22eb('0x4')]();var fs_extra=require(_0x22eb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x22eb('0x6'));var config=require('../../config/environment');var controller=require('./chatProactiveAction.controller');router[_0x22eb('0x7')](_0x22eb('0x8'),auth[_0x22eb('0x9')](),controller[_0x22eb('0xa')]);router[_0x22eb('0xb')]('/',auth[_0x22eb('0x9')](),controller[_0x22eb('0xc')]);router[_0x22eb('0xd')](_0x22eb('0x8'),auth[_0x22eb('0x9')](),controller[_0x22eb('0xe')]);router[_0x22eb('0xf')]('/:id',auth[_0x22eb('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xd8fb=['multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','isAuthenticated','post','create','put','update','delete','/:id','destroy','exports'];(function(_0x4cf961,_0x15c379){var _0x3650fa=function(_0x52b742){while(--_0x52b742){_0x4cf961['push'](_0x4cf961['shift']());}};_0x3650fa(++_0x15c379);}(_0xd8fb,0x99));var _0xbd8f=function(_0x319eef,_0x54793d){_0x319eef=_0x319eef-0x0;var _0x58d584=_0xd8fb[_0x319eef];return _0x58d584;};'use strict';var multer=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var path=require(_0xbd8f('0x2'));var timeout=require(_0xbd8f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbd8f('0x4'));var interaction=require(_0xbd8f('0x5'));var config=require('../../config/environment');var controller=require(_0xbd8f('0x6'));router[_0xbd8f('0x7')]('/:id',auth[_0xbd8f('0x8')](),controller['show']);router[_0xbd8f('0x9')]('/',auth['isAuthenticated'](),controller[_0xbd8f('0xa')]);router[_0xbd8f('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xbd8f('0xc')]);router[_0xbd8f('0xd')](_0xbd8f('0xe'),auth['isAuthenticated'](),controller[_0xbd8f('0xf')]);module[_0xbd8f('0x10')]=router;
\ No newline at end of file
index 284c779..ed45dd9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf088=['sequelize','STRING','name','INTEGER','ENUM','rrmemory','roundrobin'];(function(_0x46cd93,_0x1dec80){var _0x53ac24=function(_0x437dae){while(--_0x437dae){_0x46cd93['push'](_0x46cd93['shift']());}};_0x53ac24(++_0x1dec80);}(_0xf088,0x126));var _0x8f08=function(_0x443ac4,_0x343001){_0x443ac4=_0x443ac4-0x0;var _0xc132e5=_0xf088[_0x443ac4];return _0xc132e5;};'use strict';var Sequelize=require(_0x8f08('0x0'));module['exports']={'name':{'type':Sequelize[_0x8f08('0x1')],'unique':_0x8f08('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x8f08('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8f08('0x4')](_0x8f08('0x5'),'beepall',_0x8f08('0x6'))}};
\ No newline at end of file
+var _0x9613=['name','INTEGER','ENUM','rrmemory','sequelize','exports','STRING'];(function(_0x178d74,_0x113896){var _0xa38e13=function(_0x42c03c){while(--_0x42c03c){_0x178d74['push'](_0x178d74['shift']());}};_0xa38e13(++_0x113896);}(_0x9613,0x138));var _0x3961=function(_0x5d8265,_0x16ba83){_0x5d8265=_0x5d8265-0x0;var _0x1968a0=_0x9613[_0x5d8265];return _0x1968a0;};'use strict';var Sequelize=require(_0x3961('0x0'));module[_0x3961('0x1')]={'name':{'type':Sequelize[_0x3961('0x2')],'unique':_0x3961('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3961('0x2')]},'timeout':{'type':Sequelize[_0x3961('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3961('0x5')](_0x3961('0x6'),'beepall','roundrobin')}};
\ No newline at end of file
index 6e015dc..b03ded0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee66=['flatMap','sequelize','transaction','findOrCreate','userChatQueue:save','removeTeams','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','includes','all','union','compact','ids','isEmpty','forEach','emit','userChatQueue:remove','addAgents','spread','isArray','getAgents','nolimit','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','get','ChatQueues','UserProfileResource','name','send','index','map','ChatQueue','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','pick','UserChatQueue','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','chatPause','getTeams','order','Team','Agents','online','voicePause'];(function(_0x5998d0,_0x24ad81){var _0x47149d=function(_0x5e4d63){while(--_0x5e4d63){_0x5998d0['push'](_0x5998d0['shift']());}};_0x47149d(++_0x24ad81);}(_0xee66,0x149));var _0x6ee6=function(_0x58a4ac,_0x43fd42){_0x58a4ac=_0x58a4ac-0x0;var _0x545810=_0xee66[_0x58a4ac];return _0x545810;};'use strict';var emlformat=require(_0x6ee6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6ee6('0x1'));var rp=require(_0x6ee6('0x2'));var moment=require('moment');var BPromise=require(_0x6ee6('0x3'));var Mustache=require(_0x6ee6('0x4'));var util=require(_0x6ee6('0x5'));var path=require(_0x6ee6('0x6'));var sox=require(_0x6ee6('0x7'));var csv=require(_0x6ee6('0x8'));var ejs=require(_0x6ee6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6ee6('0xa'));var squel=require(_0x6ee6('0xb'));var crypto=require('crypto');var jsforce=require(_0x6ee6('0xc'));var deskjs=require(_0x6ee6('0xd'));var toCsv=require(_0x6ee6('0x8'));var querystring=require(_0x6ee6('0xe'));var Papa=require(_0x6ee6('0xf'));var Redis=require('ioredis');var authService=require(_0x6ee6('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6ee6('0x11'));var hardwareService=require(_0x6ee6('0x12'));var logger=require(_0x6ee6('0x13'))('api');var utils=require(_0x6ee6('0x14'));var config=require(_0x6ee6('0x15'));var licenseUtil=require(_0x6ee6('0x16'));var db=require('../../mysqldb')['db'];config[_0x6ee6('0x17')]=_[_0x6ee6('0x18')](config['redis'],{'host':_0x6ee6('0x19'),'port':0x18eb});var socket=require(_0x6ee6('0x1a'))(new Redis(config[_0x6ee6('0x17')]));require(_0x6ee6('0x1b'))[_0x6ee6('0x1c')](socket);var jayson=require(_0x6ee6('0x1d'));var client=jayson[_0x6ee6('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ac501,_0x3d3f55,_0x2b1b20,_0x1743a1){return new BPromise(function(_0x3c7a15,_0x550b65){var _0x2232e6=_0x1743a1||client;return _0x2232e6['request'](_0x5ac501,_0x2b1b20)[_0x6ee6('0x1f')](function(_0x374685){logger['info'](_0x6ee6('0x20'),_0x3d3f55,_0x6ee6('0x21'));logger[_0x6ee6('0x22')](_0x6ee6('0x23'),_0x3d3f55,'request\x20sent',JSON[_0x6ee6('0x24')](_0x374685));if(_0x374685[_0x6ee6('0x25')]){if(_0x374685[_0x6ee6('0x25')][_0x6ee6('0x26')]===0x1f4){logger[_0x6ee6('0x25')](_0x6ee6('0x20'),_0x3d3f55,_0x374685[_0x6ee6('0x25')][_0x6ee6('0x27')]);return _0x550b65(_0x374685[_0x6ee6('0x25')]['message']);}logger[_0x6ee6('0x25')](_0x6ee6('0x20'),_0x3d3f55,_0x374685[_0x6ee6('0x25')][_0x6ee6('0x27')]);return _0x3c7a15(_0x374685[_0x6ee6('0x25')][_0x6ee6('0x27')]);}else{logger[_0x6ee6('0x28')](_0x6ee6('0x20'),_0x3d3f55,_0x6ee6('0x21'));_0x3c7a15(_0x374685[_0x6ee6('0x29')][_0x6ee6('0x27')]);}})[_0x6ee6('0x2a')](function(_0x171038){logger[_0x6ee6('0x25')]('ChatQueue,\x20%s,\x20%s',_0x3d3f55,_0x171038);_0x550b65(_0x171038);});});}function respondWithStatusCode(_0x5aa4d5,_0x179265){_0x179265=_0x179265||0xcc;return function(_0x45b776){if(_0x45b776){return _0x5aa4d5[_0x6ee6('0x2b')](_0x179265);}return _0x5aa4d5['status'](_0x179265)[_0x6ee6('0x2c')]();};}function respondWithResult(_0x4f96f4,_0x25af3c){_0x25af3c=_0x25af3c||0xc8;return function(_0x543333){if(_0x543333){return _0x4f96f4[_0x6ee6('0x2d')](_0x25af3c)[_0x6ee6('0x2e')](_0x543333);}};}function respondWithFilteredResult(_0x6f72f2,_0x3d581a){return function(_0x102118){if(_0x102118){var _0x4c6a38=typeof _0x3d581a[_0x6ee6('0x2f')]===_0x6ee6('0x30')&&typeof _0x3d581a[_0x6ee6('0x31')]===_0x6ee6('0x30');var _0x3f89df=_0x102118[_0x6ee6('0x32')];var _0x282782=_0x4c6a38?0x0:_0x3d581a[_0x6ee6('0x2f')];var _0x3d8146=_0x4c6a38?_0x102118[_0x6ee6('0x32')]:_0x3d581a[_0x6ee6('0x2f')]+_0x3d581a[_0x6ee6('0x31')];var _0x438bad;if(_0x3d8146>=_0x3f89df){_0x3d8146=_0x3f89df;_0x438bad=0xc8;}else{_0x438bad=0xce;}_0x6f72f2[_0x6ee6('0x2d')](_0x438bad);return _0x6f72f2['set'](_0x6ee6('0x33'),_0x282782+'-'+_0x3d8146+'/'+_0x3f89df)[_0x6ee6('0x2e')](_0x102118);}return null;};}function patchUpdates(_0x38815d){return function(_0x3b7422){try{jsonpatch[_0x6ee6('0x34')](_0x3b7422,_0x38815d,!![]);}catch(_0x13bc22){return BPromise[_0x6ee6('0x35')](_0x13bc22);}return _0x3b7422[_0x6ee6('0x36')]();};}function saveUpdates(_0x5f8df7,_0x5136b5){return function(_0x5d05d0){if(_0x5d05d0){return _0x5d05d0[_0x6ee6('0x37')](_0x5f8df7)[_0x6ee6('0x1f')](function(_0x488714){return _0x488714;});}return null;};}function removeEntity(_0x4dd323,_0x5643ee){return function(_0x4a8b42){if(_0x4a8b42){return _0x4a8b42[_0x6ee6('0x38')]()['then'](function(){var _0x111283=_0x4a8b42[_0x6ee6('0x39')]({'plain':!![]});var _0x34e6b8=_0x6ee6('0x3a');return db[_0x6ee6('0x3b')][_0x6ee6('0x38')]({'where':{'type':_0x34e6b8,'resourceId':_0x111283['id']}})[_0x6ee6('0x1f')](function(){return _0x4a8b42;});})[_0x6ee6('0x1f')](function(){_0x4dd323['status'](0xcc)[_0x6ee6('0x2c')]();});}};}function handleEntityNotFound(_0x135cd3,_0x4a40d4){return function(_0xe0c364){if(!_0xe0c364){_0x135cd3[_0x6ee6('0x2b')](0x194);}return _0xe0c364;};}function handleError(_0x2eec2f,_0x14b5d1){_0x14b5d1=_0x14b5d1||0x1f4;return function(_0xa27658){logger[_0x6ee6('0x25')](_0xa27658['stack']);if(_0xa27658[_0x6ee6('0x3c')]){delete _0xa27658[_0x6ee6('0x3c')];}_0x2eec2f['status'](_0x14b5d1)[_0x6ee6('0x3d')](_0xa27658);};}exports[_0x6ee6('0x3e')]=function(_0x4c737c,_0x2a66e7){var _0x4fcff0={},_0x599bc5={},_0x179621={'count':0x0,'rows':[]};var _0x39af90=_[_0x6ee6('0x3f')](db[_0x6ee6('0x40')]['rawAttributes'],function(_0x2d708b){return{'name':_0x2d708b['fieldName'],'type':_0x2d708b['type'][_0x6ee6('0x41')]};});_0x599bc5['model']=_['map'](_0x39af90,'name');_0x599bc5[_0x6ee6('0x42')]=_[_0x6ee6('0x43')](_0x4c737c[_0x6ee6('0x42')]);_0x599bc5['filters']=_[_0x6ee6('0x44')](_0x599bc5[_0x6ee6('0x45')],_0x599bc5[_0x6ee6('0x42')]);_0x4fcff0[_0x6ee6('0x46')]=_[_0x6ee6('0x44')](_0x599bc5['model'],qs[_0x6ee6('0x47')](_0x4c737c['query']['fields']));_0x4fcff0[_0x6ee6('0x46')]=_0x4fcff0[_0x6ee6('0x46')][_0x6ee6('0x48')]?_0x4fcff0[_0x6ee6('0x46')]:_0x599bc5[_0x6ee6('0x45')];if(!_0x4c737c[_0x6ee6('0x42')][_0x6ee6('0x49')]('nolimit')){_0x4fcff0[_0x6ee6('0x31')]=qs['limit'](_0x4c737c[_0x6ee6('0x42')][_0x6ee6('0x31')]);_0x4fcff0[_0x6ee6('0x2f')]=qs[_0x6ee6('0x2f')](_0x4c737c[_0x6ee6('0x42')][_0x6ee6('0x2f')]);}_0x4fcff0['order']=qs[_0x6ee6('0x4a')](_0x4c737c['query']['sort']);_0x4fcff0[_0x6ee6('0x4b')]=qs[_0x6ee6('0x4c')](_['pick'](_0x4c737c['query'],_0x599bc5['filters']),_0x39af90);if(_0x4c737c[_0x6ee6('0x42')][_0x6ee6('0x4d')]){_0x4fcff0[_0x6ee6('0x4b')]=_[_0x6ee6('0x4e')](_0x4fcff0['where'],{'$or':_[_0x6ee6('0x3f')](_0x39af90,function(_0x50c136){if(_0x50c136[_0x6ee6('0x4f')]!==_0x6ee6('0x50')){var _0xf64331={};_0xf64331[_0x50c136[_0x6ee6('0x3c')]]={'$like':'%'+_0x4c737c[_0x6ee6('0x42')][_0x6ee6('0x4d')]+'%'};return _0xf64331;}})});}_0x4fcff0=_['merge']({},_0x4fcff0,_0x4c737c[_0x6ee6('0x51')]);var _0x390d7c={'where':_0x4fcff0[_0x6ee6('0x4b')]};return db['ChatQueue'][_0x6ee6('0x32')](_0x390d7c)[_0x6ee6('0x1f')](function(_0x4972b5){_0x179621[_0x6ee6('0x32')]=_0x4972b5;if(_0x4c737c[_0x6ee6('0x42')][_0x6ee6('0x52')]){_0x4fcff0[_0x6ee6('0x53')]=[{'all':!![]}];}return db[_0x6ee6('0x40')][_0x6ee6('0x54')](_0x4fcff0);})[_0x6ee6('0x1f')](function(_0x25a65f){_0x179621['rows']=_0x25a65f;return _0x179621;})['then'](respondWithFilteredResult(_0x2a66e7,_0x4fcff0))[_0x6ee6('0x2a')](handleError(_0x2a66e7,null));};exports[_0x6ee6('0x55')]=function(_0x3f1e5c,_0x4b0e35){var _0x38f0c4={'raw':!![],'where':{'id':_0x3f1e5c[_0x6ee6('0x56')]['id']}},_0x35e994={};_0x35e994[_0x6ee6('0x45')]=_['keys'](db[_0x6ee6('0x40')][_0x6ee6('0x57')]);_0x35e994[_0x6ee6('0x42')]=_[_0x6ee6('0x43')](_0x3f1e5c[_0x6ee6('0x42')]);_0x35e994['filters']=_['intersection'](_0x35e994[_0x6ee6('0x45')],_0x35e994[_0x6ee6('0x42')]);_0x38f0c4[_0x6ee6('0x46')]=_[_0x6ee6('0x44')](_0x35e994[_0x6ee6('0x45')],qs['fields'](_0x3f1e5c[_0x6ee6('0x42')][_0x6ee6('0x47')]));_0x38f0c4[_0x6ee6('0x46')]=_0x38f0c4[_0x6ee6('0x46')]['length']?_0x38f0c4['attributes']:_0x35e994[_0x6ee6('0x45')];if(_0x3f1e5c[_0x6ee6('0x42')][_0x6ee6('0x52')]){_0x38f0c4[_0x6ee6('0x53')]=[{'all':!![]}];}_0x38f0c4=_['merge']({},_0x38f0c4,_0x3f1e5c['options']);return db[_0x6ee6('0x40')][_0x6ee6('0x58')](_0x38f0c4)[_0x6ee6('0x1f')](handleEntityNotFound(_0x4b0e35,null))[_0x6ee6('0x1f')](respondWithResult(_0x4b0e35,null))[_0x6ee6('0x2a')](handleError(_0x4b0e35,null));};exports[_0x6ee6('0x59')]=function(_0x26c4f4,_0x5c8e8a){return db['ChatQueue'][_0x6ee6('0x59')](_0x26c4f4[_0x6ee6('0x5a')],{})['then'](function(_0x547ad2){var _0x154d65=_0x26c4f4[_0x6ee6('0x5b')][_0x6ee6('0x39')]({'plain':!![]});if(!_0x154d65)throw new Error(_0x6ee6('0x5c'));if(_0x154d65[_0x6ee6('0x5d')]===_0x6ee6('0x5b')){var _0x3ff598=_0x547ad2[_0x6ee6('0x39')]({'plain':!![]});var _0x298492='ChatQueues';return db[_0x6ee6('0x5e')][_0x6ee6('0x58')]({'where':{'name':_0x298492,'userProfileId':_0x154d65[_0x6ee6('0x5f')]},'raw':!![]})[_0x6ee6('0x1f')](function(_0xd85a80){if(_0xd85a80&&_0xd85a80[_0x6ee6('0x60')]===0x0){return db[_0x6ee6('0x3b')][_0x6ee6('0x59')]({'name':_0x3ff598[_0x6ee6('0x3c')],'resourceId':_0x3ff598['id'],'type':_0xd85a80['name'],'sectionId':_0xd85a80['id']},{})['then'](function(){return _0x547ad2;});}else{return _0x547ad2;}})[_0x6ee6('0x2a')](function(_0x25b37b){logger['error'](_0x6ee6('0x61'),_0x25b37b);throw _0x25b37b;});}return _0x547ad2;})['then'](respondWithResult(_0x5c8e8a,0xc9))['catch'](handleError(_0x5c8e8a,null));};exports[_0x6ee6('0x37')]=function(_0x3813de,_0x42654f){if(_0x3813de[_0x6ee6('0x5a')]['id']){delete _0x3813de[_0x6ee6('0x5a')]['id'];}return db[_0x6ee6('0x40')][_0x6ee6('0x58')]({'where':{'id':_0x3813de[_0x6ee6('0x56')]['id']}})[_0x6ee6('0x1f')](handleEntityNotFound(_0x42654f,null))[_0x6ee6('0x1f')](saveUpdates(_0x3813de['body'],null))[_0x6ee6('0x1f')](respondWithResult(_0x42654f,null))['catch'](handleError(_0x42654f,null));};exports['destroy']=function(_0x259679,_0x353eb3){return db['ChatQueue'][_0x6ee6('0x58')]({'where':{'id':_0x259679[_0x6ee6('0x56')]['id']}})[_0x6ee6('0x1f')](handleEntityNotFound(_0x353eb3,null))[_0x6ee6('0x1f')](removeEntity(_0x353eb3,null))[_0x6ee6('0x2a')](handleError(_0x353eb3,null));};exports[_0x6ee6('0x62')]=function(_0x438eb8,_0x42e32e){return db[_0x6ee6('0x40')][_0x6ee6('0x62')]()[_0x6ee6('0x1f')](respondWithResult(_0x42e32e,null))[_0x6ee6('0x2a')](handleError(_0x42e32e,null));};exports[_0x6ee6('0x63')]=function(_0x592b2b,_0x151e8e,_0x4f7680){var _0x36ba4d={'raw':!![],'where':{}},_0x28ecf6={},_0x17c317;return db[_0x6ee6('0x40')][_0x6ee6('0x64')]({'where':{'id':_0x592b2b[_0x6ee6('0x56')]['id']}})[_0x6ee6('0x1f')](handleEntityNotFound(_0x151e8e,null))[_0x6ee6('0x1f')](function(_0x4ed7c3){if(_0x4ed7c3){_0x17c317=_0x4ed7c3[_0x6ee6('0x39')]({'plain':!![]});_0x28ecf6[_0x6ee6('0x45')]=_['keys'](db['UserChatQueue'][_0x6ee6('0x57')]);_0x28ecf6['query']=_['keys'](_0x592b2b['query']);_0x28ecf6[_0x6ee6('0x4c')]=_[_0x6ee6('0x44')](_0x28ecf6[_0x6ee6('0x45')],_0x28ecf6[_0x6ee6('0x42')]);_0x36ba4d[_0x6ee6('0x46')]=_[_0x6ee6('0x44')](_0x28ecf6[_0x6ee6('0x45')],qs[_0x6ee6('0x47')](_0x592b2b[_0x6ee6('0x42')][_0x6ee6('0x47')]));_0x36ba4d[_0x6ee6('0x46')]=_0x36ba4d[_0x6ee6('0x46')]['length']?_0x36ba4d[_0x6ee6('0x46')]:_0x28ecf6[_0x6ee6('0x45')];if(!_0x592b2b[_0x6ee6('0x42')][_0x6ee6('0x49')]('nolimit')){_0x36ba4d[_0x6ee6('0x31')]=qs[_0x6ee6('0x31')](_0x592b2b['query']['limit']);_0x36ba4d[_0x6ee6('0x2f')]=qs[_0x6ee6('0x2f')](_0x592b2b[_0x6ee6('0x42')]['offset']);}_0x36ba4d['order']=qs[_0x6ee6('0x4a')](_0x592b2b[_0x6ee6('0x42')][_0x6ee6('0x4a')]);_0x36ba4d[_0x6ee6('0x4b')]=qs['filters'](_[_0x6ee6('0x65')](_0x592b2b[_0x6ee6('0x42')],_0x28ecf6[_0x6ee6('0x4c')]));_0x36ba4d[_0x6ee6('0x4b')]['ChatQueueId']=_0x4ed7c3['id'];if(_0x592b2b['query'][_0x6ee6('0x4d')]){_0x36ba4d['where']=_[_0x6ee6('0x4e')](_0x36ba4d['where'],{'$or':_['map'](_0x36ba4d[_0x6ee6('0x46')],function(_0x432891){var _0xb5b19b={};_0xb5b19b[_0x432891]={'$like':'%'+_0x592b2b[_0x6ee6('0x42')][_0x6ee6('0x4d')]+'%'};return _0xb5b19b;})});}_0x36ba4d=_[_0x6ee6('0x4e')]({},_0x36ba4d,_0x592b2b['options']);return db[_0x6ee6('0x66')][_0x6ee6('0x54')](_0x36ba4d);}})[_0x6ee6('0x1f')](function(_0xc8117d){if(_0xc8117d){return db[_0x6ee6('0x67')][_0x6ee6('0x68')]({'where':{'id':_[_0x6ee6('0x3f')](_0xc8117d,_0x6ee6('0x69')),'role':_0x6ee6('0x6a')},'attributes':['id',_0x6ee6('0x3c'),'chatPause',_0x6ee6('0x6b'),_0x6ee6('0x6c')]});}})[_0x6ee6('0x1f')](function(_0x29f032){if(_0x29f032){return{'count':_0x29f032[_0x6ee6('0x32')],'rows':_[_0x6ee6('0x3f')](_0x29f032['rows'],function(_0x36a36c){return{'membername':_0x36a36c[_0x6ee6('0x3c')],'UserId':_0x36a36c['id'],'queue_name':_0x17c317[_0x6ee6('0x3c')],'ChatQueueId':_0x17c317['id'],'interface':util[_0x6ee6('0x6d')](_0x6ee6('0x6e'),'SIP',_0x36a36c[_0x6ee6('0x3c')]),'penalty':0x0,'paused':_0x36a36c[_0x6ee6('0x6f')],'createdAt':_0x36a36c[_0x6ee6('0x6c')],'updatedAt':_0x36a36c[_0x6ee6('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6ee6('0x1f')](respondWithFilteredResult(_0x151e8e,_0x36ba4d))['catch'](handleError(_0x151e8e,null));};exports[_0x6ee6('0x70')]=function(_0x19a23a,_0x3fc096,_0x17ae9d){var _0x2c5e84={};var _0x3868ef={};var _0x394f77;var _0x242fe0;return db[_0x6ee6('0x40')][_0x6ee6('0x64')]({'where':{'id':_0x19a23a[_0x6ee6('0x56')]['id']}})['then'](handleEntityNotFound(_0x3fc096,null))[_0x6ee6('0x1f')](function(_0x4f5705){if(_0x4f5705){_0x394f77=_0x4f5705;_0x3868ef['model']=_['keys'](db['Team'][_0x6ee6('0x57')]);_0x3868ef[_0x6ee6('0x42')]=_[_0x6ee6('0x43')](_0x19a23a[_0x6ee6('0x42')]);_0x3868ef['filters']=_[_0x6ee6('0x44')](_0x3868ef[_0x6ee6('0x45')],_0x3868ef[_0x6ee6('0x42')]);_0x2c5e84[_0x6ee6('0x46')]=_[_0x6ee6('0x44')](_0x3868ef[_0x6ee6('0x45')],qs[_0x6ee6('0x47')](_0x19a23a[_0x6ee6('0x42')][_0x6ee6('0x47')]));_0x2c5e84[_0x6ee6('0x46')]=_0x2c5e84['attributes']['length']?_0x2c5e84[_0x6ee6('0x46')]:_0x3868ef['model'];_0x2c5e84[_0x6ee6('0x71')]=qs['sort'](_0x19a23a[_0x6ee6('0x42')][_0x6ee6('0x4a')]);_0x2c5e84['where']=qs['filters'](_['pick'](_0x19a23a[_0x6ee6('0x42')],_0x3868ef['filters']));if(_0x19a23a[_0x6ee6('0x42')][_0x6ee6('0x4d')]){_0x2c5e84[_0x6ee6('0x4b')]=_[_0x6ee6('0x4e')](_0x2c5e84[_0x6ee6('0x4b')],{'$or':_[_0x6ee6('0x3f')](_0x2c5e84['attributes'],function(_0x5a8793){var _0x2c36a4={};_0x2c36a4[_0x5a8793]={'$like':'%'+_0x19a23a[_0x6ee6('0x42')][_0x6ee6('0x4d')]+'%'};return _0x2c36a4;})});}_0x2c5e84=_[_0x6ee6('0x4e')]({},_0x2c5e84,_0x19a23a[_0x6ee6('0x51')]);return _0x394f77['getTeams'](_0x2c5e84);}})[_0x6ee6('0x1f')](function(_0x424281){if(_0x424281){_0x242fe0=_0x424281['length'];if(!_0x19a23a['query'][_0x6ee6('0x49')]('nolimit')){_0x2c5e84['limit']=qs['limit'](_0x19a23a[_0x6ee6('0x42')][_0x6ee6('0x31')]);_0x2c5e84['offset']=qs[_0x6ee6('0x2f')](_0x19a23a['query'][_0x6ee6('0x2f')]);}return _0x394f77['getTeams'](_0x2c5e84);}})[_0x6ee6('0x1f')](function(_0x5b53b2){if(_0x5b53b2){return _0x5b53b2?{'count':_0x242fe0,'rows':_0x5b53b2}:null;}})[_0x6ee6('0x1f')](respondWithResult(_0x3fc096,null))['catch'](handleError(_0x3fc096,null));};exports['addTeams']=function(_0x83c140,_0x5433f2,_0x986a79){var _0x43752e=_0x83c140[_0x6ee6('0x5a')]['ids'];return db[_0x6ee6('0x72')][_0x6ee6('0x54')]({'where':{'id':_0x43752e},'attributes':['id'],'include':[{'model':db[_0x6ee6('0x67')],'as':_0x6ee6('0x73'),'attributes':['id',_0x6ee6('0x3c'),_0x6ee6('0x74'),_0x6ee6('0x75'),'interface'],'raw':!![]}]})[_0x6ee6('0x1f')](function(_0x5df88c){if(_0x5df88c){var _0x175ce8=_[_0x6ee6('0x76')](_0x5df88c,function(_0x37502a){var _0x4bc529=_0x37502a[_0x6ee6('0x39')]({'plain':!![]});return _0x4bc529[_0x6ee6('0x73')];});return db[_0x6ee6('0x40')][_0x6ee6('0x58')]({'where':{'id':_0x83c140[_0x6ee6('0x56')]['id']}})[_0x6ee6('0x1f')](function(_0x58d84a){return db[_0x6ee6('0x77')][_0x6ee6('0x78')](function(_0x2a82c6){return _0x58d84a['addTeams'](_0x43752e,{'transaction':_0x2a82c6})[_0x6ee6('0x1f')](function(){return BPromise['each'](_0x175ce8,function(_0x995de0){return db['UserChatQueue'][_0x6ee6('0x79')]({'where':{'UserId':_0x995de0['id'],'ChatQueueId':_0x83c140['params']['id']},'transaction':_0x2a82c6});});})[_0x6ee6('0x1f')](function(){_0x175ce8['forEach'](function(_0x220de0){socket['emit'](_0x6ee6('0x7a'),{'UserId':_0x220de0['id'],'ChatQueueId':_0x58d84a['id']});});});});});}})['then'](respondWithStatusCode(_0x5433f2,null))[_0x6ee6('0x2a')](handleError(_0x5433f2,null));};exports[_0x6ee6('0x7b')]=function(_0x4d5084,_0x43eaa3,_0x572e78){return db[_0x6ee6('0x72')][_0x6ee6('0x54')]({'where':{'id':_0x4d5084[_0x6ee6('0x42')]['ids']},'attributes':['id'],'include':[{'model':db[_0x6ee6('0x67')],'as':_0x6ee6('0x73'),'attributes':['id'],'raw':!![]}]})[_0x6ee6('0x1f')](handleEntityNotFound(_0x43eaa3,null))[_0x6ee6('0x1f')](function(_0x310628){var _0x3222da=_[_0x6ee6('0x3f')](_0x310628,'id');var _0xf6448e=[];var _0x2fc12a=[];var _0x4a305e=squel['select']();_0x4a305e['field'](_0x6ee6('0x7c'))['from'](_0x6ee6('0x7d'),'tq')[_0x6ee6('0x7e')](_0x6ee6('0x7f'),'ut',_0x6ee6('0x80'))[_0x6ee6('0x4b')](_0x6ee6('0x81'),_0x4d5084[_0x6ee6('0x56')]['id']);for(var _0x5ed4d7=0x0;_0x5ed4d7<_0x310628[_0x6ee6('0x48')];_0x5ed4d7+=0x1){let _0x4feaf1=_0x310628[_0x5ed4d7];for(var _0x74dde2=0x0;_0x74dde2<_0x4feaf1[_0x6ee6('0x73')][_0x6ee6('0x48')];_0x74dde2+=0x1){let _0x225246=_0x4feaf1[_0x6ee6('0x73')][_0x74dde2];var _0x46922a=_0x4a305e[_0x6ee6('0x82')]();_0x46922a[_0x6ee6('0x4b')]('ut.UserId\x20=\x20?',_0x225246['id']);_0x2fc12a[_0x6ee6('0x83')](db['sequelize']['query'](_0x46922a[_0x6ee6('0x84')](),{'type':db[_0x6ee6('0x77')][_0x6ee6('0x85')][_0x6ee6('0x86')]})[_0x6ee6('0x1f')](function(_0x1d0abb){if(_0x1d0abb[_0x6ee6('0x48')]===0x1){return _0x225246['id'];}else{var _0x5bb455=_['every'](_[_0x6ee6('0x3f')](_0x1d0abb,'TeamId'),function(_0x43544c){return _[_0x6ee6('0x87')](_0x3222da,_0x43544c);});if(_0x5bb455){return _0x225246['id'];}}}));}}return BPromise[_0x6ee6('0x88')](_0x2fc12a)[_0x6ee6('0x1f')](function(_0x245678){_0xf6448e=_(_0xf6448e)[_0x6ee6('0x89')](_0x245678)[_0x6ee6('0x8a')]()['value']();return db[_0x6ee6('0x40')][_0x6ee6('0x58')]({'where':{'id':_0x4d5084[_0x6ee6('0x56')]['id']}})[_0x6ee6('0x1f')](function(_0x1fe991){return db[_0x6ee6('0x77')][_0x6ee6('0x78')](function(_0x41e2de){return _0x1fe991['removeTeams'](_0x4d5084[_0x6ee6('0x42')][_0x6ee6('0x8b')],{'transaction':_0x41e2de})[_0x6ee6('0x1f')](function(){if(!_[_0x6ee6('0x8c')](_0xf6448e)){return _0x1fe991['removeAgents'](_0xf6448e,{'transaction':_0x41e2de});}})['then'](function(){_0xf6448e[_0x6ee6('0x8d')](function(_0x4f28ed){socket[_0x6ee6('0x8e')](_0x6ee6('0x8f'),{'UserId':_0x4f28ed,'ChatQueueId':_0x1fe991['id']});});});});});});})[_0x6ee6('0x1f')](respondWithStatusCode(_0x43eaa3,null))[_0x6ee6('0x2a')](handleError(_0x43eaa3,null));};exports[_0x6ee6('0x90')]=function(_0x4509bc,_0x11010e,_0x11b52f){return db[_0x6ee6('0x40')][_0x6ee6('0x58')]({'where':{'id':_0x4509bc[_0x6ee6('0x56')]['id']}})[_0x6ee6('0x1f')](handleEntityNotFound(_0x11010e,null))['then'](function(_0x26a239){if(_0x26a239){return _0x26a239[_0x6ee6('0x90')](_0x4509bc[_0x6ee6('0x5a')][_0x6ee6('0x8b')],_['omit'](_0x4509bc['body'],['ids','id'])||{})[_0x6ee6('0x91')](function(_0x22a41e){for(var _0x38ff91=0x0;_0x38ff91<_0x4509bc[_0x6ee6('0x5a')][_0x6ee6('0x8b')][_0x6ee6('0x48')];_0x38ff91+=0x1){socket[_0x6ee6('0x8e')](_0x6ee6('0x7a'),{'UserId':Number(_0x4509bc['body'][_0x6ee6('0x8b')][_0x38ff91]),'ChatQueueId':Number(_0x4509bc['params']['id'])});}return _0x22a41e;});}})[_0x6ee6('0x1f')](respondWithResult(_0x11010e,null))[_0x6ee6('0x2a')](handleError(_0x11010e,null));};exports['removeAgents']=function(_0x102b63,_0xf2a0a7,_0x5605e8){return db[_0x6ee6('0x40')][_0x6ee6('0x58')]({'where':{'id':_0x102b63[_0x6ee6('0x56')]['id']}})[_0x6ee6('0x1f')](handleEntityNotFound(_0xf2a0a7,null))['then'](function(_0x3111da){if(_0x3111da){return _0x3111da['removeAgents'](_0x102b63['query']['ids'])[_0x6ee6('0x1f')](function(){if(_[_0x6ee6('0x92')](_0x102b63[_0x6ee6('0x42')][_0x6ee6('0x8b')])){for(var _0x40e38a=0x0;_0x40e38a<_0x102b63[_0x6ee6('0x42')][_0x6ee6('0x8b')][_0x6ee6('0x48')];_0x40e38a+=0x1){socket[_0x6ee6('0x8e')](_0x6ee6('0x8f'),{'UserId':Number(_0x102b63['query'][_0x6ee6('0x8b')][_0x40e38a]),'ChatQueueId':Number(_0x102b63['params']['id'])});}}else{socket[_0x6ee6('0x8e')](_0x6ee6('0x8f'),{'UserId':Number(_0x102b63[_0x6ee6('0x42')]['ids']),'ChatQueueId':Number(_0x102b63['params']['id'])});}});}})[_0x6ee6('0x1f')](respondWithStatusCode(_0xf2a0a7,null))['catch'](handleError(_0xf2a0a7,null));};exports[_0x6ee6('0x93')]=function(_0x639d78,_0x2c09cb,_0x29d85c){var _0x40a627={};var _0x8fc2={};var _0x2ec820;var _0x32db12;return db[_0x6ee6('0x40')][_0x6ee6('0x64')]({'where':{'id':_0x639d78[_0x6ee6('0x56')]['id']}})[_0x6ee6('0x1f')](handleEntityNotFound(_0x2c09cb,null))[_0x6ee6('0x1f')](function(_0x4c4410){if(_0x4c4410){_0x2ec820=_0x4c4410;_0x8fc2['model']=_[_0x6ee6('0x43')](db[_0x6ee6('0x67')][_0x6ee6('0x57')]);_0x8fc2[_0x6ee6('0x42')]=_[_0x6ee6('0x43')](_0x639d78['query']);_0x8fc2['filters']=_['intersection'](_0x8fc2[_0x6ee6('0x45')],_0x8fc2[_0x6ee6('0x42')]);_0x40a627['attributes']=_['intersection'](_0x8fc2['model'],qs[_0x6ee6('0x47')](_0x639d78[_0x6ee6('0x42')][_0x6ee6('0x47')]));_0x40a627[_0x6ee6('0x46')]=_0x40a627[_0x6ee6('0x46')]['length']?_0x40a627[_0x6ee6('0x46')]:_0x8fc2[_0x6ee6('0x45')];_0x40a627[_0x6ee6('0x71')]=qs[_0x6ee6('0x4a')](_0x639d78[_0x6ee6('0x42')][_0x6ee6('0x4a')]);_0x40a627[_0x6ee6('0x4b')]=qs[_0x6ee6('0x4c')](_[_0x6ee6('0x65')](_0x639d78[_0x6ee6('0x42')],_0x8fc2[_0x6ee6('0x4c')]));if(_0x639d78[_0x6ee6('0x42')][_0x6ee6('0x4d')]){_0x40a627[_0x6ee6('0x4b')]=_[_0x6ee6('0x4e')](_0x40a627[_0x6ee6('0x4b')],{'$or':_[_0x6ee6('0x3f')](_0x40a627[_0x6ee6('0x46')],function(_0x343880){var _0x4c8165={};_0x4c8165[_0x343880]={'$like':'%'+_0x639d78[_0x6ee6('0x42')]['filter']+'%'};return _0x4c8165;})});}_0x40a627=_['merge']({},_0x40a627,_0x639d78[_0x6ee6('0x51')]);return _0x2ec820[_0x6ee6('0x93')](_0x40a627);}})[_0x6ee6('0x1f')](function(_0x1fea4e){if(_0x1fea4e){_0x32db12=_0x1fea4e[_0x6ee6('0x48')];if(!_0x639d78[_0x6ee6('0x42')][_0x6ee6('0x49')](_0x6ee6('0x94'))){_0x40a627[_0x6ee6('0x31')]=qs['limit'](_0x639d78[_0x6ee6('0x42')][_0x6ee6('0x31')]);_0x40a627[_0x6ee6('0x2f')]=qs[_0x6ee6('0x2f')](_0x639d78[_0x6ee6('0x42')]['offset']);}return _0x2ec820[_0x6ee6('0x93')](_0x40a627);}})['then'](function(_0x516213){if(_0x516213){return _0x516213?{'count':_0x32db12,'rows':_0x516213}:null;}})[_0x6ee6('0x1f')](respondWithResult(_0x2c09cb,null))[_0x6ee6('0x2a')](handleError(_0x2c09cb,null));};
\ No newline at end of file
+var _0xf46e=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','reject','get','ChatQueues','UserProfileResource','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','includeAll','ChatQueue','findAll','rows','show','params','find','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','describe','getMembers','findOne','UserChatQueue','order','ChatQueueId','User','findAndCountAll','UserId','chatPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','Agents','online','sequelize','transaction','addTeams','findOrCreate','forEach','userChatQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_chat_queues','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','value','isEmpty','removeAgents','emit','userChatQueue:remove','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis'];(function(_0x95767b,_0xaa3114){var _0x51513e=function(_0x48d4ff){while(--_0x48d4ff){_0x95767b['push'](_0x95767b['shift']());}};_0x51513e(++_0xaa3114);}(_0xf46e,0x119));var _0xef46=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xf46e[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0xef46('0x0'));var rimraf=require(_0xef46('0x1'));var zipdir=require(_0xef46('0x2'));var jsonpatch=require(_0xef46('0x3'));var rp=require(_0xef46('0x4'));var moment=require('moment');var BPromise=require(_0xef46('0x5'));var Mustache=require(_0xef46('0x6'));var util=require(_0xef46('0x7'));var path=require(_0xef46('0x8'));var sox=require('sox');var csv=require(_0xef46('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xef46('0xa'));var squel=require(_0xef46('0xb'));var crypto=require(_0xef46('0xc'));var jsforce=require(_0xef46('0xd'));var deskjs=require(_0xef46('0xe'));var toCsv=require('to-csv');var querystring=require(_0xef46('0xf'));var Papa=require('papaparse');var Redis=require(_0xef46('0x10'));var authService=require(_0xef46('0x11'));var qs=require(_0xef46('0x12'));var as=require(_0xef46('0x13'));var hardwareService=require(_0xef46('0x14'));var logger=require(_0xef46('0x15'))(_0xef46('0x16'));var utils=require(_0xef46('0x17'));var config=require(_0xef46('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xef46('0x19'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xef46('0x1a'),'port':0x18eb});var socket=require(_0xef46('0x1b'))(new Redis(config['redis']));require(_0xef46('0x1c'))[_0xef46('0x1d')](socket);var jayson=require(_0xef46('0x1e'));var client=jayson[_0xef46('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x438353,_0x348619,_0x26f3db,_0x2b5a69){return new BPromise(function(_0x12a345,_0xd3a48){var _0x439a5a=_0x2b5a69||client;return _0x439a5a[_0xef46('0x20')](_0x438353,_0x26f3db)[_0xef46('0x21')](function(_0x13d9e3){logger[_0xef46('0x22')](_0xef46('0x23'),_0x348619,_0xef46('0x24'));logger['debug'](_0xef46('0x25'),_0x348619,'request\x20sent',JSON[_0xef46('0x26')](_0x13d9e3));if(_0x13d9e3[_0xef46('0x27')]){if(_0x13d9e3[_0xef46('0x27')][_0xef46('0x28')]===0x1f4){logger[_0xef46('0x27')](_0xef46('0x23'),_0x348619,_0x13d9e3[_0xef46('0x27')][_0xef46('0x29')]);return _0xd3a48(_0x13d9e3[_0xef46('0x27')][_0xef46('0x29')]);}logger[_0xef46('0x27')](_0xef46('0x23'),_0x348619,_0x13d9e3[_0xef46('0x27')]['message']);return _0x12a345(_0x13d9e3[_0xef46('0x27')][_0xef46('0x29')]);}else{logger[_0xef46('0x22')](_0xef46('0x23'),_0x348619,_0xef46('0x24'));_0x12a345(_0x13d9e3[_0xef46('0x2a')]['message']);}})[_0xef46('0x2b')](function(_0x5082f5){logger[_0xef46('0x27')](_0xef46('0x23'),_0x348619,_0x5082f5);_0xd3a48(_0x5082f5);});});}function respondWithStatusCode(_0x559ded,_0x1f4af9){_0x1f4af9=_0x1f4af9||0xcc;return function(_0x5b0919){if(_0x5b0919){return _0x559ded[_0xef46('0x2c')](_0x1f4af9);}return _0x559ded[_0xef46('0x2d')](_0x1f4af9)[_0xef46('0x2e')]();};}function respondWithResult(_0x4392e1,_0x474fcc){_0x474fcc=_0x474fcc||0xc8;return function(_0x4f5531){if(_0x4f5531){return _0x4392e1[_0xef46('0x2d')](_0x474fcc)[_0xef46('0x2f')](_0x4f5531);}};}function respondWithFilteredResult(_0x1c4a93,_0x417bbf){return function(_0x470883){if(_0x470883){var _0x107ce8=typeof _0x417bbf['offset']==='undefined'&&typeof _0x417bbf[_0xef46('0x30')]==='undefined';var _0x29dd10=_0x470883[_0xef46('0x31')];var _0x3077df=_0x107ce8?0x0:_0x417bbf[_0xef46('0x32')];var _0x4eb386=_0x107ce8?_0x470883[_0xef46('0x31')]:_0x417bbf['offset']+_0x417bbf[_0xef46('0x30')];var _0x4ce368;if(_0x4eb386>=_0x29dd10){_0x4eb386=_0x29dd10;_0x4ce368=0xc8;}else{_0x4ce368=0xce;}_0x1c4a93[_0xef46('0x2d')](_0x4ce368);return _0x1c4a93[_0xef46('0x33')](_0xef46('0x34'),_0x3077df+'-'+_0x4eb386+'/'+_0x29dd10)[_0xef46('0x2f')](_0x470883);}return null;};}function patchUpdates(_0x1e60fc){return function(_0x2120e3){try{jsonpatch[_0xef46('0x35')](_0x2120e3,_0x1e60fc,!![]);}catch(_0x554dbd){return BPromise[_0xef46('0x36')](_0x554dbd);}return _0x2120e3['save']();};}function saveUpdates(_0x2e8845,_0x22b0e7){return function(_0x1137be){if(_0x1137be){return _0x1137be['update'](_0x2e8845)[_0xef46('0x21')](function(_0x3b3a8a){return _0x3b3a8a;});}return null;};}function removeEntity(_0x236f9c,_0x1a4c95){return function(_0x5debb7){if(_0x5debb7){return _0x5debb7['destroy']()[_0xef46('0x21')](function(){var _0x362802=_0x5debb7[_0xef46('0x37')]({'plain':!![]});var _0x4a6880=_0xef46('0x38');return db[_0xef46('0x39')]['destroy']({'where':{'type':_0x4a6880,'resourceId':_0x362802['id']}})['then'](function(){return _0x5debb7;});})[_0xef46('0x21')](function(){_0x236f9c[_0xef46('0x2d')](0xcc)[_0xef46('0x2e')]();});}};}function handleEntityNotFound(_0x1a5bec,_0x5f0476){return function(_0x2f969c){if(!_0x2f969c){_0x1a5bec[_0xef46('0x2c')](0x194);}return _0x2f969c;};}function handleError(_0x1b55a4,_0xaa42f0){_0xaa42f0=_0xaa42f0||0x1f4;return function(_0x5572ee){logger['error'](_0x5572ee[_0xef46('0x3a')]);if(_0x5572ee[_0xef46('0x3b')]){delete _0x5572ee[_0xef46('0x3b')];}_0x1b55a4[_0xef46('0x2d')](_0xaa42f0)[_0xef46('0x3c')](_0x5572ee);};}exports[_0xef46('0x3d')]=function(_0x48e316,_0xbaa9f5){var _0x58598c={},_0xb59b9={},_0x3c2143={'count':0x0,'rows':[]};var _0xa9b0f2=_[_0xef46('0x3e')](db['ChatQueue'][_0xef46('0x3f')],function(_0x1c94ed){return{'name':_0x1c94ed['fieldName'],'type':_0x1c94ed['type'][_0xef46('0x40')]};});_0xb59b9[_0xef46('0x41')]=_[_0xef46('0x3e')](_0xa9b0f2,_0xef46('0x3b'));_0xb59b9[_0xef46('0x42')]=_[_0xef46('0x43')](_0x48e316[_0xef46('0x42')]);_0xb59b9[_0xef46('0x44')]=_[_0xef46('0x45')](_0xb59b9[_0xef46('0x41')],_0xb59b9['query']);_0x58598c[_0xef46('0x46')]=_[_0xef46('0x45')](_0xb59b9[_0xef46('0x41')],qs[_0xef46('0x47')](_0x48e316[_0xef46('0x42')][_0xef46('0x47')]));_0x58598c[_0xef46('0x46')]=_0x58598c['attributes'][_0xef46('0x48')]?_0x58598c[_0xef46('0x46')]:_0xb59b9['model'];if(!_0x48e316['query'][_0xef46('0x49')](_0xef46('0x4a'))){_0x58598c[_0xef46('0x30')]=qs[_0xef46('0x30')](_0x48e316[_0xef46('0x42')][_0xef46('0x30')]);_0x58598c[_0xef46('0x32')]=qs[_0xef46('0x32')](_0x48e316[_0xef46('0x42')][_0xef46('0x32')]);}_0x58598c['order']=qs[_0xef46('0x4b')](_0x48e316[_0xef46('0x42')][_0xef46('0x4b')]);_0x58598c[_0xef46('0x4c')]=qs['filters'](_[_0xef46('0x4d')](_0x48e316['query'],_0xb59b9['filters']),_0xa9b0f2);if(_0x48e316[_0xef46('0x42')][_0xef46('0x4e')]){_0x58598c[_0xef46('0x4c')]=_[_0xef46('0x4f')](_0x58598c[_0xef46('0x4c')],{'$or':_[_0xef46('0x3e')](_0xa9b0f2,function(_0x2de434){if(_0x2de434[_0xef46('0x50')]!=='VIRTUAL'){var _0x4454df={};_0x4454df[_0x2de434['name']]={'$like':'%'+_0x48e316[_0xef46('0x42')][_0xef46('0x4e')]+'%'};return _0x4454df;}})});}_0x58598c=_['merge']({},_0x58598c,_0x48e316[_0xef46('0x51')]);var _0x497c4c={'where':_0x58598c[_0xef46('0x4c')]};return db['ChatQueue'][_0xef46('0x31')](_0x497c4c)[_0xef46('0x21')](function(_0x1e7c8e){_0x3c2143['count']=_0x1e7c8e;if(_0x48e316[_0xef46('0x42')][_0xef46('0x52')]){_0x58598c['include']=[{'all':!![]}];}return db[_0xef46('0x53')][_0xef46('0x54')](_0x58598c);})[_0xef46('0x21')](function(_0x25991d){_0x3c2143[_0xef46('0x55')]=_0x25991d;return _0x3c2143;})[_0xef46('0x21')](respondWithFilteredResult(_0xbaa9f5,_0x58598c))[_0xef46('0x2b')](handleError(_0xbaa9f5,null));};exports[_0xef46('0x56')]=function(_0x41a068,_0x14da1e){var _0x1cfa86={'raw':!![],'where':{'id':_0x41a068[_0xef46('0x57')]['id']}},_0x52fd0f={};_0x52fd0f['model']=_[_0xef46('0x43')](db[_0xef46('0x53')][_0xef46('0x3f')]);_0x52fd0f[_0xef46('0x42')]=_[_0xef46('0x43')](_0x41a068[_0xef46('0x42')]);_0x52fd0f[_0xef46('0x44')]=_[_0xef46('0x45')](_0x52fd0f[_0xef46('0x41')],_0x52fd0f[_0xef46('0x42')]);_0x1cfa86['attributes']=_[_0xef46('0x45')](_0x52fd0f[_0xef46('0x41')],qs[_0xef46('0x47')](_0x41a068[_0xef46('0x42')]['fields']));_0x1cfa86[_0xef46('0x46')]=_0x1cfa86[_0xef46('0x46')][_0xef46('0x48')]?_0x1cfa86[_0xef46('0x46')]:_0x52fd0f[_0xef46('0x41')];if(_0x41a068['query'][_0xef46('0x52')]){_0x1cfa86['include']=[{'all':!![]}];}_0x1cfa86=_[_0xef46('0x4f')]({},_0x1cfa86,_0x41a068['options']);return db[_0xef46('0x53')][_0xef46('0x58')](_0x1cfa86)['then'](handleEntityNotFound(_0x14da1e,null))[_0xef46('0x21')](respondWithResult(_0x14da1e,null))[_0xef46('0x2b')](handleError(_0x14da1e,null));};exports['create']=function(_0x32689d,_0x41f160){return db[_0xef46('0x53')]['create'](_0x32689d[_0xef46('0x59')],{})[_0xef46('0x21')](function(_0xff3099){var _0xb21ca8=_0x32689d[_0xef46('0x5a')][_0xef46('0x37')]({'plain':!![]});if(!_0xb21ca8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xb21ca8[_0xef46('0x5b')]===_0xef46('0x5a')){var _0x36c390=_0xff3099[_0xef46('0x37')]({'plain':!![]});var _0x4611d8=_0xef46('0x38');return db[_0xef46('0x5c')][_0xef46('0x58')]({'where':{'name':_0x4611d8,'userProfileId':_0xb21ca8[_0xef46('0x5d')]},'raw':!![]})[_0xef46('0x21')](function(_0x53150d){if(_0x53150d&&_0x53150d[_0xef46('0x5e')]===0x0){return db[_0xef46('0x39')]['create']({'name':_0x36c390[_0xef46('0x3b')],'resourceId':_0x36c390['id'],'type':_0x53150d[_0xef46('0x3b')],'sectionId':_0x53150d['id']},{})['then'](function(){return _0xff3099;});}else{return _0xff3099;}})[_0xef46('0x2b')](function(_0x1ab38d){logger[_0xef46('0x27')](_0xef46('0x5f'),_0x1ab38d);throw _0x1ab38d;});}return _0xff3099;})[_0xef46('0x21')](respondWithResult(_0x41f160,0xc9))[_0xef46('0x2b')](handleError(_0x41f160,null));};exports[_0xef46('0x60')]=function(_0x11323c,_0x563378){if(_0x11323c[_0xef46('0x59')]['id']){delete _0x11323c[_0xef46('0x59')]['id'];}return db[_0xef46('0x53')]['find']({'where':{'id':_0x11323c[_0xef46('0x57')]['id']}})[_0xef46('0x21')](handleEntityNotFound(_0x563378,null))['then'](saveUpdates(_0x11323c[_0xef46('0x59')],null))['then'](respondWithResult(_0x563378,null))[_0xef46('0x2b')](handleError(_0x563378,null));};exports[_0xef46('0x61')]=function(_0x519ea0,_0x4c534a){return db['ChatQueue'][_0xef46('0x58')]({'where':{'id':_0x519ea0['params']['id']}})[_0xef46('0x21')](handleEntityNotFound(_0x4c534a,null))[_0xef46('0x21')](removeEntity(_0x4c534a,null))[_0xef46('0x2b')](handleError(_0x4c534a,null));};exports['describe']=function(_0xd7aa75,_0x5bc418){return db[_0xef46('0x53')][_0xef46('0x62')]()['then'](respondWithResult(_0x5bc418,null))[_0xef46('0x2b')](handleError(_0x5bc418,null));};exports[_0xef46('0x63')]=function(_0x3cf157,_0x2800f6,_0x222605){var _0x585866={'raw':!![],'where':{}},_0x3acc7a={},_0x53b9f5;return db['ChatQueue'][_0xef46('0x64')]({'where':{'id':_0x3cf157[_0xef46('0x57')]['id']}})['then'](handleEntityNotFound(_0x2800f6,null))[_0xef46('0x21')](function(_0x21bde1){if(_0x21bde1){_0x53b9f5=_0x21bde1[_0xef46('0x37')]({'plain':!![]});_0x3acc7a[_0xef46('0x41')]=_[_0xef46('0x43')](db[_0xef46('0x65')][_0xef46('0x3f')]);_0x3acc7a[_0xef46('0x42')]=_[_0xef46('0x43')](_0x3cf157[_0xef46('0x42')]);_0x3acc7a[_0xef46('0x44')]=_[_0xef46('0x45')](_0x3acc7a[_0xef46('0x41')],_0x3acc7a[_0xef46('0x42')]);_0x585866['attributes']=_[_0xef46('0x45')](_0x3acc7a[_0xef46('0x41')],qs[_0xef46('0x47')](_0x3cf157['query']['fields']));_0x585866[_0xef46('0x46')]=_0x585866['attributes'][_0xef46('0x48')]?_0x585866[_0xef46('0x46')]:_0x3acc7a[_0xef46('0x41')];if(!_0x3cf157[_0xef46('0x42')][_0xef46('0x49')](_0xef46('0x4a'))){_0x585866['limit']=qs[_0xef46('0x30')](_0x3cf157[_0xef46('0x42')][_0xef46('0x30')]);_0x585866[_0xef46('0x32')]=qs['offset'](_0x3cf157[_0xef46('0x42')][_0xef46('0x32')]);}_0x585866[_0xef46('0x66')]=qs['sort'](_0x3cf157[_0xef46('0x42')][_0xef46('0x4b')]);_0x585866[_0xef46('0x4c')]=qs[_0xef46('0x44')](_[_0xef46('0x4d')](_0x3cf157['query'],_0x3acc7a[_0xef46('0x44')]));_0x585866[_0xef46('0x4c')][_0xef46('0x67')]=_0x21bde1['id'];if(_0x3cf157['query']['filter']){_0x585866[_0xef46('0x4c')]=_[_0xef46('0x4f')](_0x585866[_0xef46('0x4c')],{'$or':_[_0xef46('0x3e')](_0x585866[_0xef46('0x46')],function(_0x125630){var _0x49bcff={};_0x49bcff[_0x125630]={'$like':'%'+_0x3cf157[_0xef46('0x42')][_0xef46('0x4e')]+'%'};return _0x49bcff;})});}_0x585866=_[_0xef46('0x4f')]({},_0x585866,_0x3cf157[_0xef46('0x51')]);return db['UserChatQueue'][_0xef46('0x54')](_0x585866);}})[_0xef46('0x21')](function(_0xa2229e){if(_0xa2229e){return db[_0xef46('0x68')][_0xef46('0x69')]({'where':{'id':_[_0xef46('0x3e')](_0xa2229e,_0xef46('0x6a')),'role':'agent'},'attributes':['id',_0xef46('0x3b'),_0xef46('0x6b'),_0xef46('0x6c'),_0xef46('0x6d')]});}})['then'](function(_0x1d1b91){if(_0x1d1b91){return{'count':_0x1d1b91[_0xef46('0x31')],'rows':_[_0xef46('0x3e')](_0x1d1b91['rows'],function(_0x32a843){return{'membername':_0x32a843[_0xef46('0x3b')],'UserId':_0x32a843['id'],'queue_name':_0x53b9f5['name'],'ChatQueueId':_0x53b9f5['id'],'interface':util[_0xef46('0x6e')](_0xef46('0x6f'),'SIP',_0x32a843[_0xef46('0x3b')]),'penalty':0x0,'paused':_0x32a843[_0xef46('0x6b')],'createdAt':_0x32a843['createdAt'],'updatedAt':_0x32a843['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2800f6,_0x585866))[_0xef46('0x2b')](handleError(_0x2800f6,null));};exports[_0xef46('0x70')]=function(_0x3a5a88,_0x4b53cb,_0x257e4c){var _0x1dd98b={};var _0x7fc11c={};var _0x1249c6;var _0x563533;return db[_0xef46('0x53')][_0xef46('0x64')]({'where':{'id':_0x3a5a88[_0xef46('0x57')]['id']}})[_0xef46('0x21')](handleEntityNotFound(_0x4b53cb,null))['then'](function(_0x5d36e4){if(_0x5d36e4){_0x1249c6=_0x5d36e4;_0x7fc11c[_0xef46('0x41')]=_[_0xef46('0x43')](db[_0xef46('0x71')][_0xef46('0x3f')]);_0x7fc11c[_0xef46('0x42')]=_['keys'](_0x3a5a88[_0xef46('0x42')]);_0x7fc11c['filters']=_[_0xef46('0x45')](_0x7fc11c[_0xef46('0x41')],_0x7fc11c[_0xef46('0x42')]);_0x1dd98b[_0xef46('0x46')]=_[_0xef46('0x45')](_0x7fc11c[_0xef46('0x41')],qs[_0xef46('0x47')](_0x3a5a88['query']['fields']));_0x1dd98b[_0xef46('0x46')]=_0x1dd98b['attributes']['length']?_0x1dd98b[_0xef46('0x46')]:_0x7fc11c[_0xef46('0x41')];_0x1dd98b[_0xef46('0x66')]=qs['sort'](_0x3a5a88[_0xef46('0x42')][_0xef46('0x4b')]);_0x1dd98b[_0xef46('0x4c')]=qs['filters'](_[_0xef46('0x4d')](_0x3a5a88[_0xef46('0x42')],_0x7fc11c[_0xef46('0x44')]));if(_0x3a5a88['query'][_0xef46('0x4e')]){_0x1dd98b['where']=_[_0xef46('0x4f')](_0x1dd98b[_0xef46('0x4c')],{'$or':_[_0xef46('0x3e')](_0x1dd98b[_0xef46('0x46')],function(_0x59450d){var _0x128a29={};_0x128a29[_0x59450d]={'$like':'%'+_0x3a5a88[_0xef46('0x42')][_0xef46('0x4e')]+'%'};return _0x128a29;})});}_0x1dd98b=_['merge']({},_0x1dd98b,_0x3a5a88[_0xef46('0x51')]);return _0x1249c6[_0xef46('0x70')](_0x1dd98b);}})[_0xef46('0x21')](function(_0x3cba5a){if(_0x3cba5a){_0x563533=_0x3cba5a[_0xef46('0x48')];if(!_0x3a5a88[_0xef46('0x42')][_0xef46('0x49')]('nolimit')){_0x1dd98b[_0xef46('0x30')]=qs[_0xef46('0x30')](_0x3a5a88[_0xef46('0x42')]['limit']);_0x1dd98b[_0xef46('0x32')]=qs[_0xef46('0x32')](_0x3a5a88[_0xef46('0x42')]['offset']);}return _0x1249c6[_0xef46('0x70')](_0x1dd98b);}})[_0xef46('0x21')](function(_0x47a844){if(_0x47a844){return _0x47a844?{'count':_0x563533,'rows':_0x47a844}:null;}})[_0xef46('0x21')](respondWithResult(_0x4b53cb,null))[_0xef46('0x2b')](handleError(_0x4b53cb,null));};exports['addTeams']=function(_0x3a9f40,_0x2675d0,_0x587e03){var _0x2b1eba=_0x3a9f40[_0xef46('0x59')]['ids'];return db['Team'][_0xef46('0x54')]({'where':{'id':_0x2b1eba},'attributes':['id'],'include':[{'model':db[_0xef46('0x68')],'as':_0xef46('0x72'),'attributes':['id',_0xef46('0x3b'),_0xef46('0x73'),'voicePause','interface'],'raw':!![]}]})[_0xef46('0x21')](function(_0x399b2c){if(_0x399b2c){var _0x43bcbc=_['flatMap'](_0x399b2c,function(_0x39d4b3){var _0x2f3c22=_0x39d4b3[_0xef46('0x37')]({'plain':!![]});return _0x2f3c22[_0xef46('0x72')];});return db[_0xef46('0x53')]['find']({'where':{'id':_0x3a9f40[_0xef46('0x57')]['id']}})['then'](function(_0x597021){return db[_0xef46('0x74')][_0xef46('0x75')](function(_0x2a31aa){return _0x597021[_0xef46('0x76')](_0x2b1eba,{'transaction':_0x2a31aa})['then'](function(){return BPromise['each'](_0x43bcbc,function(_0x323237){return db[_0xef46('0x65')][_0xef46('0x77')]({'where':{'UserId':_0x323237['id'],'ChatQueueId':_0x3a9f40[_0xef46('0x57')]['id']},'transaction':_0x2a31aa});});})[_0xef46('0x21')](function(){_0x43bcbc[_0xef46('0x78')](function(_0x3ef067){socket['emit'](_0xef46('0x79'),{'UserId':_0x3ef067['id'],'ChatQueueId':_0x597021['id']});});});});});}})['then'](respondWithStatusCode(_0x2675d0,null))[_0xef46('0x2b')](handleError(_0x2675d0,null));};exports[_0xef46('0x7a')]=function(_0x1c239b,_0x572d05,_0x2dc9a5){return db[_0xef46('0x71')][_0xef46('0x54')]({'where':{'id':_0x1c239b[_0xef46('0x42')][_0xef46('0x7b')]},'attributes':['id'],'include':[{'model':db[_0xef46('0x68')],'as':_0xef46('0x72'),'attributes':['id'],'raw':!![]}]})[_0xef46('0x21')](handleEntityNotFound(_0x572d05,null))[_0xef46('0x21')](function(_0x21a82d){var _0x373644=_[_0xef46('0x3e')](_0x21a82d,'id');var _0x12b8f6=[];var _0x4a8134=[];var _0x3f067e=squel[_0xef46('0x7c')]();_0x3f067e[_0xef46('0x7d')](_0xef46('0x7e'))[_0xef46('0x7f')](_0xef46('0x80'),'tq')['join']('user_has_teams','ut',_0xef46('0x81'))[_0xef46('0x4c')](_0xef46('0x82'),_0x1c239b[_0xef46('0x57')]['id']);for(var _0xeb7871=0x0;_0xeb7871<_0x21a82d[_0xef46('0x48')];_0xeb7871+=0x1){let _0x278f0c=_0x21a82d[_0xeb7871];for(var _0x13ea07=0x0;_0x13ea07<_0x278f0c['Agents'][_0xef46('0x48')];_0x13ea07+=0x1){let _0x39b636=_0x278f0c[_0xef46('0x72')][_0x13ea07];var _0x45f095=_0x3f067e[_0xef46('0x83')]();_0x45f095[_0xef46('0x4c')](_0xef46('0x84'),_0x39b636['id']);_0x4a8134[_0xef46('0x85')](db[_0xef46('0x74')][_0xef46('0x42')](_0x45f095[_0xef46('0x86')](),{'type':db[_0xef46('0x74')][_0xef46('0x87')][_0xef46('0x88')]})[_0xef46('0x21')](function(_0xabb6d){if(_0xabb6d[_0xef46('0x48')]===0x1){return _0x39b636['id'];}else{var _0x475ede=_[_0xef46('0x89')](_['map'](_0xabb6d,_0xef46('0x8a')),function(_0x116d09){return _['includes'](_0x373644,_0x116d09);});if(_0x475ede){return _0x39b636['id'];}}}));}}return BPromise[_0xef46('0x8b')](_0x4a8134)[_0xef46('0x21')](function(_0x1f21fc){_0x12b8f6=_(_0x12b8f6)[_0xef46('0x8c')](_0x1f21fc)['compact']()[_0xef46('0x8d')]();return db[_0xef46('0x53')][_0xef46('0x58')]({'where':{'id':_0x1c239b[_0xef46('0x57')]['id']}})['then'](function(_0x139def){return db[_0xef46('0x74')][_0xef46('0x75')](function(_0x3c7f92){return _0x139def['removeTeams'](_0x1c239b[_0xef46('0x42')][_0xef46('0x7b')],{'transaction':_0x3c7f92})[_0xef46('0x21')](function(){if(!_[_0xef46('0x8e')](_0x12b8f6)){return _0x139def[_0xef46('0x8f')](_0x12b8f6,{'transaction':_0x3c7f92});}})['then'](function(){_0x12b8f6[_0xef46('0x78')](function(_0x4e7f5d){socket[_0xef46('0x90')](_0xef46('0x91'),{'UserId':_0x4e7f5d,'ChatQueueId':_0x139def['id']});});});});});});})[_0xef46('0x21')](respondWithStatusCode(_0x572d05,null))[_0xef46('0x2b')](handleError(_0x572d05,null));};exports['addAgents']=function(_0x244bd9,_0x478aaf,_0x5dc7fa){return db[_0xef46('0x53')]['find']({'where':{'id':_0x244bd9[_0xef46('0x57')]['id']}})[_0xef46('0x21')](handleEntityNotFound(_0x478aaf,null))[_0xef46('0x21')](function(_0x45d446){if(_0x45d446){return _0x45d446['addAgents'](_0x244bd9['body']['ids'],_['omit'](_0x244bd9[_0xef46('0x59')],[_0xef46('0x7b'),'id'])||{})[_0xef46('0x92')](function(_0x3ec2ec){for(var _0x31be85=0x0;_0x31be85<_0x244bd9[_0xef46('0x59')][_0xef46('0x7b')][_0xef46('0x48')];_0x31be85+=0x1){socket[_0xef46('0x90')]('userChatQueue:save',{'UserId':Number(_0x244bd9['body'][_0xef46('0x7b')][_0x31be85]),'ChatQueueId':Number(_0x244bd9[_0xef46('0x57')]['id'])});}return _0x3ec2ec;});}})[_0xef46('0x21')](respondWithResult(_0x478aaf,null))[_0xef46('0x2b')](handleError(_0x478aaf,null));};exports['removeAgents']=function(_0x271d23,_0x49f193,_0x2c7c84){return db[_0xef46('0x53')]['find']({'where':{'id':_0x271d23[_0xef46('0x57')]['id']}})['then'](handleEntityNotFound(_0x49f193,null))[_0xef46('0x21')](function(_0x3c16a1){if(_0x3c16a1){return _0x3c16a1[_0xef46('0x8f')](_0x271d23[_0xef46('0x42')][_0xef46('0x7b')])[_0xef46('0x21')](function(){if(_[_0xef46('0x93')](_0x271d23[_0xef46('0x42')][_0xef46('0x7b')])){for(var _0x567684=0x0;_0x567684<_0x271d23[_0xef46('0x42')][_0xef46('0x7b')][_0xef46('0x48')];_0x567684+=0x1){socket[_0xef46('0x90')](_0xef46('0x91'),{'UserId':Number(_0x271d23[_0xef46('0x42')][_0xef46('0x7b')][_0x567684]),'ChatQueueId':Number(_0x271d23[_0xef46('0x57')]['id'])});}}else{socket[_0xef46('0x90')]('userChatQueue:remove',{'UserId':Number(_0x271d23[_0xef46('0x42')][_0xef46('0x7b')]),'ChatQueueId':Number(_0x271d23[_0xef46('0x57')]['id'])});}});}})[_0xef46('0x21')](respondWithStatusCode(_0x49f193,null))[_0xef46('0x2b')](handleError(_0x49f193,null));};exports['getAgents']=function(_0x54c8fd,_0x422e73,_0x663c2c){var _0x3d1187={};var _0xda1d5f={};var _0x1fc7fe;var _0x14e898;return db[_0xef46('0x53')][_0xef46('0x64')]({'where':{'id':_0x54c8fd[_0xef46('0x57')]['id']}})[_0xef46('0x21')](handleEntityNotFound(_0x422e73,null))[_0xef46('0x21')](function(_0x3093ec){if(_0x3093ec){_0x1fc7fe=_0x3093ec;_0xda1d5f['model']=_[_0xef46('0x43')](db[_0xef46('0x68')][_0xef46('0x3f')]);_0xda1d5f[_0xef46('0x42')]=_[_0xef46('0x43')](_0x54c8fd['query']);_0xda1d5f['filters']=_[_0xef46('0x45')](_0xda1d5f[_0xef46('0x41')],_0xda1d5f[_0xef46('0x42')]);_0x3d1187['attributes']=_[_0xef46('0x45')](_0xda1d5f[_0xef46('0x41')],qs[_0xef46('0x47')](_0x54c8fd['query'][_0xef46('0x47')]));_0x3d1187[_0xef46('0x46')]=_0x3d1187['attributes'][_0xef46('0x48')]?_0x3d1187[_0xef46('0x46')]:_0xda1d5f['model'];_0x3d1187[_0xef46('0x66')]=qs[_0xef46('0x4b')](_0x54c8fd[_0xef46('0x42')][_0xef46('0x4b')]);_0x3d1187[_0xef46('0x4c')]=qs[_0xef46('0x44')](_[_0xef46('0x4d')](_0x54c8fd[_0xef46('0x42')],_0xda1d5f[_0xef46('0x44')]));if(_0x54c8fd['query'][_0xef46('0x4e')]){_0x3d1187['where']=_['merge'](_0x3d1187[_0xef46('0x4c')],{'$or':_[_0xef46('0x3e')](_0x3d1187[_0xef46('0x46')],function(_0x243dd2){var _0x1e49ec={};_0x1e49ec[_0x243dd2]={'$like':'%'+_0x54c8fd[_0xef46('0x42')][_0xef46('0x4e')]+'%'};return _0x1e49ec;})});}_0x3d1187=_[_0xef46('0x4f')]({},_0x3d1187,_0x54c8fd[_0xef46('0x51')]);return _0x1fc7fe[_0xef46('0x94')](_0x3d1187);}})[_0xef46('0x21')](function(_0x41eafb){if(_0x41eafb){_0x14e898=_0x41eafb[_0xef46('0x48')];if(!_0x54c8fd[_0xef46('0x42')][_0xef46('0x49')](_0xef46('0x4a'))){_0x3d1187[_0xef46('0x30')]=qs[_0xef46('0x30')](_0x54c8fd['query'][_0xef46('0x30')]);_0x3d1187[_0xef46('0x32')]=qs[_0xef46('0x32')](_0x54c8fd[_0xef46('0x42')][_0xef46('0x32')]);}return _0x1fc7fe['getAgents'](_0x3d1187);}})[_0xef46('0x21')](function(_0x10ae85){if(_0x10ae85){return _0x10ae85?{'count':_0x14e898,'rows':_0x10ae85}:null;}})[_0xef46('0x21')](respondWithResult(_0x422e73,null))[_0xef46('0x2b')](handleError(_0x422e73,null));};
\ No newline at end of file
index c0b6ee9..ffe14e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd54c=['events','ChatQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x218476,_0x35e8c7){var _0x3185d1=function(_0x31be06){while(--_0x31be06){_0x218476['push'](_0x218476['shift']());}};_0x3185d1(++_0x35e8c7);}(_0xd54c,0x171));var _0xcd54=function(_0x564c05,_0x34d663){_0x564c05=_0x564c05-0x0;var _0x43ca94=_0xd54c[_0x564c05];return _0x43ca94;};'use strict';var EventEmitter=require(_0xcd54('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xcd54('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xcd54('0x2')](0x0);var events={'afterCreate':_0xcd54('0x3'),'afterUpdate':'update','afterDestroy':_0xcd54('0x4')};function emitEvent(_0x1720c4){return function(_0x47fa36,_0xedba2d,_0x229490){ChatQueueEvents[_0xcd54('0x5')](_0x1720c4+':'+_0x47fa36['id'],_0x47fa36);ChatQueueEvents['emit'](_0x1720c4,_0x47fa36);_0x229490(null);};}for(var e in events){if(events[_0xcd54('0x6')](e)){var event=events[e];ChatQueue[_0xcd54('0x7')](e,emitEvent(event));}}module[_0xcd54('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0x1732=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','update','remove'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x1732,0x158));var _0x2173=function(_0x1d5c94,_0x10d403){_0x1d5c94=_0x1d5c94-0x0;var _0x503886=_0x1732[_0x1d5c94];return _0x503886;};'use strict';var EventEmitter=require(_0x2173('0x0'));var ChatQueue=require(_0x2173('0x1'))['db'][_0x2173('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x2173('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2173('0x4'),'afterDestroy':_0x2173('0x5')};function emitEvent(_0x21f0e5){return function(_0x151060,_0x3a8761,_0x3522c0){ChatQueueEvents['emit'](_0x21f0e5+':'+_0x151060['id'],_0x151060);ChatQueueEvents[_0x2173('0x6')](_0x21f0e5,_0x151060);_0x3522c0(null);};}for(var e in events){if(events[_0x2173('0x7')](e)){var event=events[e];ChatQueue[_0x2173('0x8')](e,emitEvent(event));}}module[_0x2173('0x9')]=ChatQueueEvents;
\ No newline at end of file
index 77ee89e..f12dd58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73a3=['request-promise','path','../../config/environment','exports','ChatQueue','lodash','util','../../config/logger','api','moment'];(function(_0x123564,_0x5cc46d){var _0x3f5021=function(_0x481379){while(--_0x481379){_0x123564['push'](_0x123564['shift']());}};_0x3f5021(++_0x5cc46d);}(_0x73a3,0x159));var _0x373a=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x73a3[_0x2dadb9];return _0x2f0097;};'use strict';var _=require(_0x373a('0x0'));var util=require(_0x373a('0x1'));var logger=require(_0x373a('0x2'))(_0x373a('0x3'));var moment=require(_0x373a('0x4'));var BPromise=require('bluebird');var rp=require(_0x373a('0x5'));var fs=require('fs');var path=require(_0x373a('0x6'));var rimraf=require('rimraf');var config=require(_0x373a('0x7'));var attributes=require('./chatQueue.attributes');module[_0x373a('0x8')]=function(_0xb05fe6,_0x1418ea){return _0xb05fe6['define'](_0x373a('0x9'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x43e5=['rimraf','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x3d7642,_0x394153){var _0x566ed8=function(_0x2bd245){while(--_0x2bd245){_0x3d7642['push'](_0x3d7642['shift']());}};_0x566ed8(++_0x394153);}(_0x43e5,0x11a));var _0x543e=function(_0x59d89c,_0x2164f8){_0x59d89c=_0x59d89c-0x0;var _0x877535=_0x43e5[_0x59d89c];return _0x877535;};'use strict';var _=require(_0x543e('0x0'));var util=require(_0x543e('0x1'));var logger=require(_0x543e('0x2'))(_0x543e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x543e('0x4'));var fs=require('fs');var path=require(_0x543e('0x5'));var rimraf=require(_0x543e('0x6'));var config=require('../../config/environment');var attributes=require(_0x543e('0x7'));module[_0x543e('0x8')]=function(_0x5067bb,_0x275769){return _0x5067bb[_0x543e('0x9')](_0x543e('0xa'),attributes,{'tableName':_0x543e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b75c171..7549ac2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x841e=['../../config/utils','../../config/environment','jayson/promise','client','http','redis','localhost','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','model','find','map','ShowChatQueue','lodash','util','moment','randomstring'];(function(_0x537ff9,_0xa28f7b){var _0x78975d=function(_0x407c6b){while(--_0x407c6b){_0x537ff9['push'](_0x537ff9['shift']());}};_0x78975d(++_0xa28f7b);}(_0x841e,0x15b));var _0xe841=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x841e[_0x432682];return _0x463d05;};'use strict';var _=require(_0xe841('0x0'));var util=require(_0xe841('0x1'));var moment=require(_0xe841('0x2'));var BPromise=require('bluebird');var rs=require(_0xe841('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe841('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xe841('0x5'));var jayson=require(_0xe841('0x6'));var client=jayson[_0xe841('0x7')][_0xe841('0x8')]({'port':0x232a});config[_0xe841('0x9')]=_['defaults'](config[_0xe841('0x9')],{'host':_0xe841('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe841('0x9')]));require(_0xe841('0xb'))[_0xe841('0xc')](socket);function respondWithRpcPromise(_0x6d30cd,_0x55f3ff,_0x2f22d2){return new BPromise(function(_0xda2984,_0xab1d85){return client[_0xe841('0xd')](_0x6d30cd,_0x2f22d2)[_0xe841('0xe')](function(_0xfbde70){logger[_0xe841('0xf')](_0xe841('0x10'),_0x55f3ff,_0xe841('0x11'));logger[_0xe841('0x12')](_0xe841('0x13'),_0x55f3ff,_0xe841('0x11'),JSON[_0xe841('0x14')](_0xfbde70));if(_0xfbde70[_0xe841('0x15')]){if(_0xfbde70[_0xe841('0x15')][_0xe841('0x16')]===0x1f4){logger[_0xe841('0x15')](_0xe841('0x10'),_0x55f3ff,_0xfbde70[_0xe841('0x15')]['message']);return _0xab1d85(_0xfbde70[_0xe841('0x15')][_0xe841('0x17')]);}logger[_0xe841('0x15')](_0xe841('0x10'),_0x55f3ff,_0xfbde70['error']['message']);return _0xda2984(_0xfbde70[_0xe841('0x15')][_0xe841('0x17')]);}else{logger['info'](_0xe841('0x10'),_0x55f3ff,'request\x20sent');_0xda2984(_0xfbde70[_0xe841('0x18')][_0xe841('0x17')]);}})[_0xe841('0x19')](function(_0x3eb535){logger[_0xe841('0x15')]('ChatQueue,\x20%s,\x20%s',_0x55f3ff,_0x3eb535);_0xab1d85(_0x3eb535);});});}exports[_0xe841('0x1a')]=function(_0x1b402e){var _0x25558f=this;return new Promise(function(_0xce9fcf,_0x383609){return db[_0xe841('0x1b')][_0xe841('0x1c')]({'raw':_0x1b402e[_0xe841('0x1d')]?_0x1b402e[_0xe841('0x1d')][_0xe841('0x1e')]===undefined?!![]:![]:!![],'where':_0x1b402e[_0xe841('0x1d')]?_0x1b402e[_0xe841('0x1d')][_0xe841('0x1f')]||null:null,'attributes':_0x1b402e[_0xe841('0x1d')]?_0x1b402e[_0xe841('0x1d')][_0xe841('0x20')]||null:null,'limit':_0x1b402e[_0xe841('0x1d')]?_0x1b402e[_0xe841('0x1d')][_0xe841('0x21')]||null:null,'include':_0x1b402e[_0xe841('0x1d')]?_0x1b402e['options']['include']?_['map'](_0x1b402e[_0xe841('0x1d')]['include'],function(_0x21f392){return{'model':db[_0x21f392['model']],'as':_0x21f392['as'],'attributes':_0x21f392[_0xe841('0x20')],'include':_0x21f392[_0xe841('0x22')]?_['map'](_0x21f392[_0xe841('0x22')],function(_0x4c0c06){return{'model':db[_0x4c0c06[_0xe841('0x23')]],'as':_0x4c0c06['as'],'attributes':_0x4c0c06[_0xe841('0x20')],'include':_0x4c0c06[_0xe841('0x22')]?_['map'](_0x4c0c06[_0xe841('0x22')],function(_0x406d88){return{'model':db[_0x406d88['model']],'as':_0x406d88['as'],'attributes':_0x406d88[_0xe841('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe841('0xe')](function(_0x1f25c4){logger['info']('GetChatQueue',_0x1b402e);logger[_0xe841('0x12')](_0xe841('0x1a'),_0x1b402e,JSON[_0xe841('0x14')](_0x1f25c4));_0xce9fcf(_0x1f25c4);})['catch'](function(_0x1bf3cd){logger[_0xe841('0x15')]('GetChatQueue',_0x1bf3cd['message'],_0x1b402e);_0x383609(_0x25558f[_0xe841('0x15')](0x1f4,_0x1bf3cd[_0xe841('0x17')]));});});};exports['ShowChatQueue']=function(_0x1da1ea){var _0x4fd3d5=this;return new Promise(function(_0x27d219,_0x1ffcb8){return db['ChatQueue'][_0xe841('0x24')]({'raw':_0x1da1ea[_0xe841('0x1d')]?_0x1da1ea[_0xe841('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x1da1ea['options']?_0x1da1ea['options'][_0xe841('0x1f')]||null:null,'attributes':_0x1da1ea[_0xe841('0x1d')]?_0x1da1ea[_0xe841('0x1d')][_0xe841('0x20')]||null:null,'include':_0x1da1ea[_0xe841('0x1d')]?_0x1da1ea['options'][_0xe841('0x22')]?_[_0xe841('0x25')](_0x1da1ea[_0xe841('0x1d')]['include'],function(_0x5d44ec){return{'model':db[_0x5d44ec[_0xe841('0x23')]],'as':_0x5d44ec['as'],'attributes':_0x5d44ec['attributes'],'include':_0x5d44ec[_0xe841('0x22')]?_[_0xe841('0x25')](_0x5d44ec[_0xe841('0x22')],function(_0x34cda6){return{'model':db[_0x34cda6[_0xe841('0x23')]],'as':_0x34cda6['as'],'attributes':_0x34cda6[_0xe841('0x20')],'include':_0x34cda6['include']?_[_0xe841('0x25')](_0x34cda6[_0xe841('0x22')],function(_0x39d83f){return{'model':db[_0x39d83f[_0xe841('0x23')]],'as':_0x39d83f['as'],'attributes':_0x39d83f[_0xe841('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe841('0xe')](function(_0x4e26b4){logger['info'](_0xe841('0x26'),_0x1da1ea);logger['debug'](_0xe841('0x26'),_0x1da1ea,JSON[_0xe841('0x14')](_0x4e26b4));_0x27d219(_0x4e26b4);})[_0xe841('0x19')](function(_0x5ea917){logger[_0xe841('0x15')]('ShowChatQueue',_0x5ea917[_0xe841('0x17')],_0x1da1ea);_0x1ffcb8(_0x4fd3d5['error'](0x1f4,_0x5ea917[_0xe841('0x17')]));});});};
\ No newline at end of file
+var _0xde1e=['client','redis','defaults','localhost','socket.io-emitter','register','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','model','map','ShowChatQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x44e00a,_0x248bbc){var _0x2bdfba=function(_0x5e66c4){while(--_0x5e66c4){_0x44e00a['push'](_0x44e00a['shift']());}};_0x2bdfba(++_0x248bbc);}(_0xde1e,0x9d));var _0xede1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xde1e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xede1('0x0'));var util=require(_0xede1('0x1'));var moment=require(_0xede1('0x2'));var BPromise=require(_0xede1('0x3'));var rs=require(_0xede1('0x4'));var fs=require('fs');var Redis=require(_0xede1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xede1('0x6'));var logger=require(_0xede1('0x7'))(_0xede1('0x8'));var config=require(_0xede1('0x9'));var jayson=require(_0xede1('0xa'));var client=jayson[_0xede1('0xb')]['http']({'port':0x232a});config[_0xede1('0xc')]=_[_0xede1('0xd')](config[_0xede1('0xc')],{'host':_0xede1('0xe'),'port':0x18eb});var socket=require(_0xede1('0xf'))(new Redis(config[_0xede1('0xc')]));require('./chatQueue.socket')[_0xede1('0x10')](socket);function respondWithRpcPromise(_0x4bc1f1,_0x5828f7,_0x217cf3){return new BPromise(function(_0x1a896b,_0x336f1a){return client[_0xede1('0x11')](_0x4bc1f1,_0x217cf3)[_0xede1('0x12')](function(_0x11216b){logger['info'](_0xede1('0x13'),_0x5828f7,_0xede1('0x14'));logger[_0xede1('0x15')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x5828f7,'request\x20sent',JSON[_0xede1('0x16')](_0x11216b));if(_0x11216b[_0xede1('0x17')]){if(_0x11216b[_0xede1('0x17')][_0xede1('0x18')]===0x1f4){logger[_0xede1('0x17')]('ChatQueue,\x20%s,\x20%s',_0x5828f7,_0x11216b[_0xede1('0x17')][_0xede1('0x19')]);return _0x336f1a(_0x11216b[_0xede1('0x17')][_0xede1('0x19')]);}logger[_0xede1('0x17')](_0xede1('0x13'),_0x5828f7,_0x11216b[_0xede1('0x17')][_0xede1('0x19')]);return _0x1a896b(_0x11216b['error'][_0xede1('0x19')]);}else{logger[_0xede1('0x1a')](_0xede1('0x13'),_0x5828f7,_0xede1('0x14'));_0x1a896b(_0x11216b[_0xede1('0x1b')][_0xede1('0x19')]);}})[_0xede1('0x1c')](function(_0x119411){logger[_0xede1('0x17')](_0xede1('0x13'),_0x5828f7,_0x119411);_0x336f1a(_0x119411);});});}exports[_0xede1('0x1d')]=function(_0x49555c){var _0x480b6d=this;return new Promise(function(_0x5e2d7b,_0x55523b){return db[_0xede1('0x1e')][_0xede1('0x1f')]({'raw':_0x49555c[_0xede1('0x20')]?_0x49555c[_0xede1('0x20')][_0xede1('0x21')]===undefined?!![]:![]:!![],'where':_0x49555c[_0xede1('0x20')]?_0x49555c[_0xede1('0x20')][_0xede1('0x22')]||null:null,'attributes':_0x49555c['options']?_0x49555c[_0xede1('0x20')][_0xede1('0x23')]||null:null,'limit':_0x49555c['options']?_0x49555c['options'][_0xede1('0x24')]||null:null,'include':_0x49555c[_0xede1('0x20')]?_0x49555c['options']['include']?_['map'](_0x49555c[_0xede1('0x20')][_0xede1('0x25')],function(_0x3576d2){return{'model':db[_0x3576d2[_0xede1('0x26')]],'as':_0x3576d2['as'],'attributes':_0x3576d2[_0xede1('0x23')],'include':_0x3576d2[_0xede1('0x25')]?_[_0xede1('0x27')](_0x3576d2[_0xede1('0x25')],function(_0x23509d){return{'model':db[_0x23509d[_0xede1('0x26')]],'as':_0x23509d['as'],'attributes':_0x23509d[_0xede1('0x23')],'include':_0x23509d[_0xede1('0x25')]?_['map'](_0x23509d[_0xede1('0x25')],function(_0x44d7d4){return{'model':db[_0x44d7d4['model']],'as':_0x44d7d4['as'],'attributes':_0x44d7d4[_0xede1('0x23')]};}):[]};}):[]};}):[]:[]})[_0xede1('0x12')](function(_0xbf0a98){logger[_0xede1('0x1a')](_0xede1('0x1d'),_0x49555c);logger[_0xede1('0x15')](_0xede1('0x1d'),_0x49555c,JSON[_0xede1('0x16')](_0xbf0a98));_0x5e2d7b(_0xbf0a98);})[_0xede1('0x1c')](function(_0x5a7bdd){logger['error'](_0xede1('0x1d'),_0x5a7bdd['message'],_0x49555c);_0x55523b(_0x480b6d[_0xede1('0x17')](0x1f4,_0x5a7bdd[_0xede1('0x19')]));});});};exports[_0xede1('0x28')]=function(_0x3661a8){var _0x3954d3=this;return new Promise(function(_0x136350,_0xc0d992){return db[_0xede1('0x1e')][_0xede1('0x29')]({'raw':_0x3661a8['options']?_0x3661a8[_0xede1('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x3661a8[_0xede1('0x20')]?_0x3661a8['options'][_0xede1('0x22')]||null:null,'attributes':_0x3661a8[_0xede1('0x20')]?_0x3661a8[_0xede1('0x20')][_0xede1('0x23')]||null:null,'include':_0x3661a8[_0xede1('0x20')]?_0x3661a8['options'][_0xede1('0x25')]?_['map'](_0x3661a8[_0xede1('0x20')][_0xede1('0x25')],function(_0x12d116){return{'model':db[_0x12d116[_0xede1('0x26')]],'as':_0x12d116['as'],'attributes':_0x12d116[_0xede1('0x23')],'include':_0x12d116['include']?_[_0xede1('0x27')](_0x12d116[_0xede1('0x25')],function(_0x316e0d){return{'model':db[_0x316e0d[_0xede1('0x26')]],'as':_0x316e0d['as'],'attributes':_0x316e0d[_0xede1('0x23')],'include':_0x316e0d[_0xede1('0x25')]?_['map'](_0x316e0d[_0xede1('0x25')],function(_0x23d389){return{'model':db[_0x23d389[_0xede1('0x26')]],'as':_0x23d389['as'],'attributes':_0x23d389['attributes']};}):[]};}):[]};}):[]:[]})[_0xede1('0x12')](function(_0x3e3b06){logger['info'](_0xede1('0x28'),_0x3661a8);logger[_0xede1('0x15')]('ShowChatQueue',_0x3661a8,JSON['stringify'](_0x3e3b06));_0x136350(_0x3e3b06);})[_0xede1('0x1c')](function(_0x42d6d0){logger[_0xede1('0x17')](_0xede1('0x28'),_0x42d6d0[_0xede1('0x19')],_0x3661a8);_0xc0d992(_0x3954d3[_0xede1('0x17')](0x1f4,_0x42d6d0[_0xede1('0x19')]));});});};
\ No newline at end of file
index f1112ad..b7b46c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['removeListener','register','./chatQueue.events','save'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x55ca,0x126));var _0xa55c=function(_0x17541e,_0x46df72){_0x17541e=_0x17541e-0x0;var _0x1c17eb=_0x55ca[_0x17541e];return _0x1c17eb;};'use strict';var ChatQueueEvents=require(_0xa55c('0x0'));var events=[_0xa55c('0x1'),'remove','update'];function createListener(_0x49875a,_0x1c6ec3){return function(_0x267ea0){_0x1c6ec3['emit'](_0x49875a,_0x267ea0);};}function removeListener(_0x3b478a,_0x2db02a){return function(){ChatQueueEvents[_0xa55c('0x2')](_0x3b478a,_0x2db02a);};}exports[_0xa55c('0x3')]=function(_0x3c97c8){for(var _0x279caa=0x0,_0x36b623=events['length'];_0x279caa<_0x36b623;_0x279caa++){var _0x2121fd=events[_0x279caa];var _0x2537f0=createListener('chatQueue:'+_0x2121fd,_0x3c97c8);ChatQueueEvents['on'](_0x2121fd,_0x2537f0);}};
\ No newline at end of file
+var _0x524a=['./chatQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x5262b2,_0x51f466){var _0x2120d8=function(_0x56a95b){while(--_0x56a95b){_0x5262b2['push'](_0x5262b2['shift']());}};_0x2120d8(++_0x51f466);}(_0x524a,0xf5));var _0xa524=function(_0x46538c,_0x3a0c08){_0x46538c=_0x46538c-0x0;var _0x583fa1=_0x524a[_0x46538c];return _0x583fa1;};'use strict';var ChatQueueEvents=require(_0xa524('0x0'));var events=[_0xa524('0x1'),_0xa524('0x2'),_0xa524('0x3')];function createListener(_0x53c48c,_0x4a29b7){return function(_0x2ef77c){_0x4a29b7[_0xa524('0x4')](_0x53c48c,_0x2ef77c);};}function removeListener(_0x56ab08,_0x50ec75){return function(){ChatQueueEvents[_0xa524('0x5')](_0x56ab08,_0x50ec75);};}exports[_0xa524('0x6')]=function(_0x16227b){for(var _0x5f472f=0x0,_0x460738=events['length'];_0x5f472f<_0x460738;_0x5f472f++){var _0x3a2dd6=events[_0x5f472f];var _0x11aa98=createListener('chatQueue:'+_0x3a2dd6,_0x16227b);ChatQueueEvents['on'](_0x3a2dd6,_0x11aa98);}};
\ No newline at end of file
index ac77200..0f37ce4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x31d022,_0x261de7){var _0x23150e=function(_0x3166f3){while(--_0x3166f3){_0x31d022['push'](_0x31d022['shift']());}};_0x23150e(++_0x261de7);}(_0xe14b,0x93));var _0xbe14=function(_0x4a7be9,_0x389a6d){_0x4a7be9=_0x4a7be9-0x0;var _0x181f5b=_0xe14b[_0x4a7be9];return _0x181f5b;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router;
\ No newline at end of file
+var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x5e28f4,_0x5edb09){var _0x50a051=function(_0x3393c4){while(--_0x3393c4){_0x5e28f4['push'](_0x5e28f4['shift']());}};_0x50a051(++_0x5edb09);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
index f64e22a..50feeaf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb575=['exports','STRING','DATE','moment'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xb575,0x103));var _0x5b57=function(_0x45b9fc,_0x1d3da9){_0x45b9fc=_0x45b9fc-0x0;var _0x7ff744=_0xb575[_0x45b9fc];return _0x7ff744;};'use strict';var moment=require(_0x5b57('0x0'));var Sequelize=require('sequelize');module[_0x5b57('0x1')]={'uniqueid':{'type':Sequelize[_0x5b57('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x5b57('0x2')]},'joinAt':{'type':Sequelize[_0x5b57('0x3')]},'leaveAt':{'type':Sequelize[_0x5b57('0x3')]},'acceptAt':{'type':Sequelize[_0x5b57('0x3')]},'exitAt':{'type':Sequelize[_0x5b57('0x3')]},'reason':{'type':Sequelize[_0x5b57('0x2')]}};
\ No newline at end of file
+var _0x666d=['moment','exports','STRING','DATE'];(function(_0x45fa7d,_0x475a5c){var _0x48b32b=function(_0x5f441f){while(--_0x5f441f){_0x45fa7d['push'](_0x45fa7d['shift']());}};_0x48b32b(++_0x475a5c);}(_0x666d,0x120));var _0xd666=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0x666d[_0x4dc7b9];return _0x3ab114;};'use strict';var moment=require(_0xd666('0x0'));var Sequelize=require('sequelize');module[_0xd666('0x1')]={'uniqueid':{'type':Sequelize[_0xd666('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xd666('0x2')]},'joinAt':{'type':Sequelize[_0xd666('0x3')]},'leaveAt':{'type':Sequelize[_0xd666('0x3')]},'acceptAt':{'type':Sequelize[_0xd666('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xd666('0x2')]}};
\ No newline at end of file
index 6061dd0..fdd8957 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b3d=['json','offset','limit','undefined','count','set','apply','reject','save','then','error','stack','name','send','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','find','catch','create','body','update','params','destroy','describe','eml-format','zip-dir','request-promise','bluebird','util','sox','to-csv','fs-extra','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end'];(function(_0x1ad6e0,_0x2633a5){var _0x2a828a=function(_0x201ecc){while(--_0x201ecc){_0x1ad6e0['push'](_0x1ad6e0['shift']());}};_0x2a828a(++_0x2633a5);}(_0x0b3d,0x76));var _0xd0b3=function(_0xdc0397,_0x20d1f1){_0xdc0397=_0xdc0397-0x0;var _0x553d02=_0x0b3d[_0xdc0397];return _0x553d02;};'use strict';var emlformat=require(_0xd0b3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd0b3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd0b3('0x2'));var moment=require('moment');var BPromise=require(_0xd0b3('0x3'));var Mustache=require('mustache');var util=require(_0xd0b3('0x4'));var path=require('path');var sox=require(_0xd0b3('0x5'));var csv=require(_0xd0b3('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd0b3('0x7'));var _=require('lodash');var squel=require(_0xd0b3('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd0b3('0x9'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd0b3('0xa'));var Redis=require('ioredis');var authService=require(_0xd0b3('0xb'));var qs=require(_0xd0b3('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd0b3('0xd'))(_0xd0b3('0xe'));var utils=require(_0xd0b3('0xf'));var config=require(_0xd0b3('0x10'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x97ca75,_0x2202ec){_0x2202ec=_0x2202ec||0xcc;return function(_0x43af8d){if(_0x43af8d){return _0x97ca75[_0xd0b3('0x11')](_0x2202ec);}return _0x97ca75[_0xd0b3('0x12')](_0x2202ec)[_0xd0b3('0x13')]();};}function respondWithResult(_0x2e4734,_0x5af82f){_0x5af82f=_0x5af82f||0xc8;return function(_0x2d1376){if(_0x2d1376){return _0x2e4734[_0xd0b3('0x12')](_0x5af82f)[_0xd0b3('0x14')](_0x2d1376);}};}function respondWithFilteredResult(_0x28d379,_0x49bfde){return function(_0xd7a36e){if(_0xd7a36e){var _0x1426cc=typeof _0x49bfde[_0xd0b3('0x15')]==='undefined'&&typeof _0x49bfde[_0xd0b3('0x16')]===_0xd0b3('0x17');var _0x50ea99=_0xd7a36e[_0xd0b3('0x18')];var _0x232e6a=_0x1426cc?0x0:_0x49bfde['offset'];var _0x4ed917=_0x1426cc?_0xd7a36e[_0xd0b3('0x18')]:_0x49bfde[_0xd0b3('0x15')]+_0x49bfde['limit'];var _0x8176e2;if(_0x4ed917>=_0x50ea99){_0x4ed917=_0x50ea99;_0x8176e2=0xc8;}else{_0x8176e2=0xce;}_0x28d379[_0xd0b3('0x12')](_0x8176e2);return _0x28d379[_0xd0b3('0x19')]('Content-Range',_0x232e6a+'-'+_0x4ed917+'/'+_0x50ea99)['json'](_0xd7a36e);}return null;};}function patchUpdates(_0xbd82dc){return function(_0x4f755f){try{jsonpatch[_0xd0b3('0x1a')](_0x4f755f,_0xbd82dc,!![]);}catch(_0x1d023d){return BPromise[_0xd0b3('0x1b')](_0x1d023d);}return _0x4f755f[_0xd0b3('0x1c')]();};}function saveUpdates(_0x155add,_0x553c27){return function(_0x55261e){if(_0x55261e){return _0x55261e['update'](_0x155add)[_0xd0b3('0x1d')](function(_0x40a637){return _0x40a637;});}return null;};}function removeEntity(_0x1a84a5,_0x1bfe7b){return function(_0x1ac0cd){if(_0x1ac0cd){return _0x1ac0cd['destroy']()[_0xd0b3('0x1d')](function(){_0x1a84a5[_0xd0b3('0x12')](0xcc)[_0xd0b3('0x13')]();});}};}function handleEntityNotFound(_0x2e0dcc,_0x550d35){return function(_0x259e05){if(!_0x259e05){_0x2e0dcc[_0xd0b3('0x11')](0x194);}return _0x259e05;};}function handleError(_0x1a1d36,_0x52606c){_0x52606c=_0x52606c||0x1f4;return function(_0x48fb43){logger[_0xd0b3('0x1e')](_0x48fb43[_0xd0b3('0x1f')]);if(_0x48fb43[_0xd0b3('0x20')]){delete _0x48fb43['name'];}_0x1a1d36[_0xd0b3('0x12')](_0x52606c)[_0xd0b3('0x21')](_0x48fb43);};}exports['index']=function(_0x1e4c8f,_0x43bfe7){var _0x52f324={},_0x2b2d05={},_0x47cc10={'count':0x0,'rows':[]};var _0x400a9d=_['map'](db[_0xd0b3('0x22')][_0xd0b3('0x23')],function(_0xbb9663){return{'name':_0xbb9663[_0xd0b3('0x24')],'type':_0xbb9663[_0xd0b3('0x25')][_0xd0b3('0x26')]};});_0x2b2d05[_0xd0b3('0x27')]=_['map'](_0x400a9d,_0xd0b3('0x20'));_0x2b2d05[_0xd0b3('0x28')]=_[_0xd0b3('0x29')](_0x1e4c8f[_0xd0b3('0x28')]);_0x2b2d05['filters']=_[_0xd0b3('0x2a')](_0x2b2d05[_0xd0b3('0x27')],_0x2b2d05[_0xd0b3('0x28')]);_0x52f324[_0xd0b3('0x2b')]=_['intersection'](_0x2b2d05[_0xd0b3('0x27')],qs[_0xd0b3('0x2c')](_0x1e4c8f[_0xd0b3('0x28')][_0xd0b3('0x2c')]));_0x52f324[_0xd0b3('0x2b')]=_0x52f324[_0xd0b3('0x2b')][_0xd0b3('0x2d')]?_0x52f324[_0xd0b3('0x2b')]:_0x2b2d05[_0xd0b3('0x27')];if(!_0x1e4c8f[_0xd0b3('0x28')][_0xd0b3('0x2e')](_0xd0b3('0x2f'))){_0x52f324[_0xd0b3('0x16')]=qs[_0xd0b3('0x16')](_0x1e4c8f['query'][_0xd0b3('0x16')]);_0x52f324[_0xd0b3('0x15')]=qs[_0xd0b3('0x15')](_0x1e4c8f[_0xd0b3('0x28')]['offset']);}_0x52f324['order']=qs['sort'](_0x1e4c8f[_0xd0b3('0x28')][_0xd0b3('0x30')]);_0x52f324[_0xd0b3('0x31')]=qs[_0xd0b3('0x32')](_[_0xd0b3('0x33')](_0x1e4c8f[_0xd0b3('0x28')],_0x2b2d05['filters']),_0x400a9d);if(_0x1e4c8f[_0xd0b3('0x28')][_0xd0b3('0x34')]){_0x52f324[_0xd0b3('0x31')]=_[_0xd0b3('0x35')](_0x52f324[_0xd0b3('0x31')],{'$or':_[_0xd0b3('0x36')](_0x400a9d,function(_0x34477e){if(_0x34477e[_0xd0b3('0x25')]!==_0xd0b3('0x37')){var _0x536e23={};_0x536e23[_0x34477e[_0xd0b3('0x20')]]={'$like':'%'+_0x1e4c8f['query']['filter']+'%'};return _0x536e23;}})});}_0x52f324=_[_0xd0b3('0x35')]({},_0x52f324,_0x1e4c8f[_0xd0b3('0x38')]);var _0x2c402c={'where':_0x52f324[_0xd0b3('0x31')]};return db[_0xd0b3('0x22')][_0xd0b3('0x18')](_0x2c402c)['then'](function(_0x463749){_0x47cc10['count']=_0x463749;if(_0x1e4c8f[_0xd0b3('0x28')][_0xd0b3('0x39')]){_0x52f324[_0xd0b3('0x3a')]=[{'all':!![]}];}return db[_0xd0b3('0x22')][_0xd0b3('0x3b')](_0x52f324);})['then'](function(_0x54b345){_0x47cc10[_0xd0b3('0x3c')]=_0x54b345;return _0x47cc10;})[_0xd0b3('0x1d')](respondWithFilteredResult(_0x43bfe7,_0x52f324))['catch'](handleError(_0x43bfe7,null));};exports['show']=function(_0x47b367,_0x3f852f){var _0x175caa={'raw':!![],'where':{'id':_0x47b367['params']['id']}},_0x2fe65={};_0x2fe65['model']=_[_0xd0b3('0x29')](db[_0xd0b3('0x22')][_0xd0b3('0x23')]);_0x2fe65[_0xd0b3('0x28')]=_['keys'](_0x47b367[_0xd0b3('0x28')]);_0x2fe65['filters']=_[_0xd0b3('0x2a')](_0x2fe65['model'],_0x2fe65[_0xd0b3('0x28')]);_0x175caa[_0xd0b3('0x2b')]=_['intersection'](_0x2fe65['model'],qs['fields'](_0x47b367[_0xd0b3('0x28')][_0xd0b3('0x2c')]));_0x175caa[_0xd0b3('0x2b')]=_0x175caa['attributes'][_0xd0b3('0x2d')]?_0x175caa[_0xd0b3('0x2b')]:_0x2fe65[_0xd0b3('0x27')];if(_0x47b367[_0xd0b3('0x28')][_0xd0b3('0x39')]){_0x175caa[_0xd0b3('0x3a')]=[{'all':!![]}];}_0x175caa=_['merge']({},_0x175caa,_0x47b367[_0xd0b3('0x38')]);return db['ChatQueueReport'][_0xd0b3('0x3d')](_0x175caa)[_0xd0b3('0x1d')](handleEntityNotFound(_0x3f852f,null))[_0xd0b3('0x1d')](respondWithResult(_0x3f852f,null))[_0xd0b3('0x3e')](handleError(_0x3f852f,null));};exports[_0xd0b3('0x3f')]=function(_0x3e666e,_0x31860b){return db[_0xd0b3('0x22')]['create'](_0x3e666e[_0xd0b3('0x40')],{})[_0xd0b3('0x1d')](respondWithResult(_0x31860b,0xc9))[_0xd0b3('0x3e')](handleError(_0x31860b,null));};exports[_0xd0b3('0x41')]=function(_0x29eaf2,_0x1478cc){if(_0x29eaf2[_0xd0b3('0x40')]['id']){delete _0x29eaf2[_0xd0b3('0x40')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x29eaf2[_0xd0b3('0x42')]['id']}})['then'](handleEntityNotFound(_0x1478cc,null))['then'](saveUpdates(_0x29eaf2[_0xd0b3('0x40')],null))[_0xd0b3('0x1d')](respondWithResult(_0x1478cc,null))[_0xd0b3('0x3e')](handleError(_0x1478cc,null));};exports[_0xd0b3('0x43')]=function(_0x474f37,_0x292d2b){return db[_0xd0b3('0x22')][_0xd0b3('0x3d')]({'where':{'id':_0x474f37[_0xd0b3('0x42')]['id']}})['then'](handleEntityNotFound(_0x292d2b,null))['then'](removeEntity(_0x292d2b,null))['catch'](handleError(_0x292d2b,null));};exports['describe']=function(_0x354f16,_0x5508d9){return db['ChatQueueReport'][_0xd0b3('0x44')]()[_0xd0b3('0x1d')](respondWithResult(_0x5508d9,null))[_0xd0b3('0x3e')](handleError(_0x5508d9,null));};
\ No newline at end of file
+var _0x6f44=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','Content-Range','apply','save','update','then','destroy','error','stack','name','map','ChatQueueReport','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','VIRTUAL','where','count','includeAll','include','rows','catch','params','keys','rawAttributes','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x121088,_0x1f128d){var _0x43eb89=function(_0x1b1bf0){while(--_0x1b1bf0){_0x121088['push'](_0x121088['shift']());}};_0x43eb89(++_0x1f128d);}(_0x6f44,0x1ea));var _0x46f4=function(_0xcd0774,_0x57e0ae){_0xcd0774=_0xcd0774-0x0;var _0x19534a=_0x6f44[_0xcd0774];return _0x19534a;};'use strict';var emlformat=require(_0x46f4('0x0'));var rimraf=require(_0x46f4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x46f4('0x2'));var rp=require(_0x46f4('0x3'));var moment=require(_0x46f4('0x4'));var BPromise=require(_0x46f4('0x5'));var Mustache=require(_0x46f4('0x6'));var util=require(_0x46f4('0x7'));var path=require(_0x46f4('0x8'));var sox=require(_0x46f4('0x9'));var csv=require(_0x46f4('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x46f4('0xb'));var _=require(_0x46f4('0xc'));var squel=require(_0x46f4('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x46f4('0xe'));var toCsv=require(_0x46f4('0xa'));var querystring=require('querystring');var Papa=require(_0x46f4('0xf'));var Redis=require('ioredis');var authService=require(_0x46f4('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x46f4('0x11'));var hardwareService=require(_0x46f4('0x12'));var logger=require(_0x46f4('0x13'))(_0x46f4('0x14'));var utils=require(_0x46f4('0x15'));var config=require(_0x46f4('0x16'));var licenseUtil=require(_0x46f4('0x17'));var db=require(_0x46f4('0x18'))['db'];function respondWithStatusCode(_0x21d4a6,_0x1f4748){_0x1f4748=_0x1f4748||0xcc;return function(_0x1dd233){if(_0x1dd233){return _0x21d4a6[_0x46f4('0x19')](_0x1f4748);}return _0x21d4a6['status'](_0x1f4748)[_0x46f4('0x1a')]();};}function respondWithResult(_0x33f73c,_0x52db86){_0x52db86=_0x52db86||0xc8;return function(_0x44a55b){if(_0x44a55b){return _0x33f73c[_0x46f4('0x1b')](_0x52db86)[_0x46f4('0x1c')](_0x44a55b);}};}function respondWithFilteredResult(_0x4dd2fb,_0x3dc516){return function(_0x4e0661){if(_0x4e0661){var _0x4e84ce=typeof _0x3dc516[_0x46f4('0x1d')]===_0x46f4('0x1e')&&typeof _0x3dc516[_0x46f4('0x1f')]==='undefined';var _0x5c191a=_0x4e0661['count'];var _0x5d3471=_0x4e84ce?0x0:_0x3dc516[_0x46f4('0x1d')];var _0x433297=_0x4e84ce?_0x4e0661['count']:_0x3dc516[_0x46f4('0x1d')]+_0x3dc516[_0x46f4('0x1f')];var _0x2232d6;if(_0x433297>=_0x5c191a){_0x433297=_0x5c191a;_0x2232d6=0xc8;}else{_0x2232d6=0xce;}_0x4dd2fb[_0x46f4('0x1b')](_0x2232d6);return _0x4dd2fb['set'](_0x46f4('0x20'),_0x5d3471+'-'+_0x433297+'/'+_0x5c191a)[_0x46f4('0x1c')](_0x4e0661);}return null;};}function patchUpdates(_0x1627db){return function(_0x6476f0){try{jsonpatch[_0x46f4('0x21')](_0x6476f0,_0x1627db,!![]);}catch(_0xdb9f25){return BPromise['reject'](_0xdb9f25);}return _0x6476f0[_0x46f4('0x22')]();};}function saveUpdates(_0x2b88d3,_0x39760b){return function(_0x4ba21a){if(_0x4ba21a){return _0x4ba21a[_0x46f4('0x23')](_0x2b88d3)[_0x46f4('0x24')](function(_0x185ec2){return _0x185ec2;});}return null;};}function removeEntity(_0x47528b,_0x36092e){return function(_0x41be5e){if(_0x41be5e){return _0x41be5e[_0x46f4('0x25')]()[_0x46f4('0x24')](function(){_0x47528b[_0x46f4('0x1b')](0xcc)[_0x46f4('0x1a')]();});}};}function handleEntityNotFound(_0x2ad553,_0x16cd7f){return function(_0x197e55){if(!_0x197e55){_0x2ad553['sendStatus'](0x194);}return _0x197e55;};}function handleError(_0x46e96d,_0x30d4fc){_0x30d4fc=_0x30d4fc||0x1f4;return function(_0xb23194){logger[_0x46f4('0x26')](_0xb23194[_0x46f4('0x27')]);if(_0xb23194[_0x46f4('0x28')]){delete _0xb23194['name'];}_0x46e96d[_0x46f4('0x1b')](_0x30d4fc)['send'](_0xb23194);};}exports['index']=function(_0x53ac21,_0x2cf22c){var _0x57ff78={},_0x1fb343={},_0x183f0c={'count':0x0,'rows':[]};var _0x3c8c91=_[_0x46f4('0x29')](db[_0x46f4('0x2a')]['rawAttributes'],function(_0x1d512b){return{'name':_0x1d512b[_0x46f4('0x2b')],'type':_0x1d512b[_0x46f4('0x2c')]['key']};});_0x1fb343[_0x46f4('0x2d')]=_[_0x46f4('0x29')](_0x3c8c91,_0x46f4('0x28'));_0x1fb343['query']=_['keys'](_0x53ac21[_0x46f4('0x2e')]);_0x1fb343[_0x46f4('0x2f')]=_[_0x46f4('0x30')](_0x1fb343['model'],_0x1fb343[_0x46f4('0x2e')]);_0x57ff78[_0x46f4('0x31')]=_['intersection'](_0x1fb343[_0x46f4('0x2d')],qs['fields'](_0x53ac21[_0x46f4('0x2e')][_0x46f4('0x32')]));_0x57ff78[_0x46f4('0x31')]=_0x57ff78[_0x46f4('0x31')][_0x46f4('0x33')]?_0x57ff78['attributes']:_0x1fb343[_0x46f4('0x2d')];if(!_0x53ac21[_0x46f4('0x2e')]['hasOwnProperty'](_0x46f4('0x34'))){_0x57ff78[_0x46f4('0x1f')]=qs[_0x46f4('0x1f')](_0x53ac21[_0x46f4('0x2e')]['limit']);_0x57ff78[_0x46f4('0x1d')]=qs['offset'](_0x53ac21[_0x46f4('0x2e')][_0x46f4('0x1d')]);}_0x57ff78[_0x46f4('0x35')]=qs[_0x46f4('0x36')](_0x53ac21['query'][_0x46f4('0x36')]);_0x57ff78['where']=qs['filters'](_[_0x46f4('0x37')](_0x53ac21['query'],_0x1fb343['filters']),_0x3c8c91);if(_0x53ac21[_0x46f4('0x2e')][_0x46f4('0x38')]){_0x57ff78['where']=_[_0x46f4('0x39')](_0x57ff78['where'],{'$or':_[_0x46f4('0x29')](_0x3c8c91,function(_0x190c1a){if(_0x190c1a[_0x46f4('0x2c')]!==_0x46f4('0x3a')){var _0x5c6662={};_0x5c6662[_0x190c1a[_0x46f4('0x28')]]={'$like':'%'+_0x53ac21[_0x46f4('0x2e')][_0x46f4('0x38')]+'%'};return _0x5c6662;}})});}_0x57ff78=_['merge']({},_0x57ff78,_0x53ac21['options']);var _0x4a44a6={'where':_0x57ff78[_0x46f4('0x3b')]};return db[_0x46f4('0x2a')][_0x46f4('0x3c')](_0x4a44a6)[_0x46f4('0x24')](function(_0x57bfd2){_0x183f0c[_0x46f4('0x3c')]=_0x57bfd2;if(_0x53ac21[_0x46f4('0x2e')][_0x46f4('0x3d')]){_0x57ff78[_0x46f4('0x3e')]=[{'all':!![]}];}return db[_0x46f4('0x2a')]['findAll'](_0x57ff78);})[_0x46f4('0x24')](function(_0x306400){_0x183f0c[_0x46f4('0x3f')]=_0x306400;return _0x183f0c;})[_0x46f4('0x24')](respondWithFilteredResult(_0x2cf22c,_0x57ff78))[_0x46f4('0x40')](handleError(_0x2cf22c,null));};exports['show']=function(_0x549af3,_0x4e11cb){var _0x21ce83={'raw':!![],'where':{'id':_0x549af3[_0x46f4('0x41')]['id']}},_0x1c0513={};_0x1c0513['model']=_[_0x46f4('0x42')](db[_0x46f4('0x2a')][_0x46f4('0x43')]);_0x1c0513[_0x46f4('0x2e')]=_[_0x46f4('0x42')](_0x549af3[_0x46f4('0x2e')]);_0x1c0513[_0x46f4('0x2f')]=_[_0x46f4('0x30')](_0x1c0513[_0x46f4('0x2d')],_0x1c0513[_0x46f4('0x2e')]);_0x21ce83[_0x46f4('0x31')]=_[_0x46f4('0x30')](_0x1c0513[_0x46f4('0x2d')],qs['fields'](_0x549af3[_0x46f4('0x2e')][_0x46f4('0x32')]));_0x21ce83[_0x46f4('0x31')]=_0x21ce83[_0x46f4('0x31')][_0x46f4('0x33')]?_0x21ce83[_0x46f4('0x31')]:_0x1c0513['model'];if(_0x549af3['query']['includeAll']){_0x21ce83[_0x46f4('0x3e')]=[{'all':!![]}];}_0x21ce83=_[_0x46f4('0x39')]({},_0x21ce83,_0x549af3[_0x46f4('0x44')]);return db[_0x46f4('0x2a')][_0x46f4('0x45')](_0x21ce83)[_0x46f4('0x24')](handleEntityNotFound(_0x4e11cb,null))[_0x46f4('0x24')](respondWithResult(_0x4e11cb,null))[_0x46f4('0x40')](handleError(_0x4e11cb,null));};exports[_0x46f4('0x46')]=function(_0xf73c15,_0x21319d){return db[_0x46f4('0x2a')]['create'](_0xf73c15[_0x46f4('0x47')],{})[_0x46f4('0x24')](respondWithResult(_0x21319d,0xc9))[_0x46f4('0x40')](handleError(_0x21319d,null));};exports['update']=function(_0x5a6d1f,_0x1fedc8){if(_0x5a6d1f[_0x46f4('0x47')]['id']){delete _0x5a6d1f[_0x46f4('0x47')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x5a6d1f[_0x46f4('0x41')]['id']}})[_0x46f4('0x24')](handleEntityNotFound(_0x1fedc8,null))[_0x46f4('0x24')](saveUpdates(_0x5a6d1f[_0x46f4('0x47')],null))[_0x46f4('0x24')](respondWithResult(_0x1fedc8,null))[_0x46f4('0x40')](handleError(_0x1fedc8,null));};exports['destroy']=function(_0x18f0e0,_0x2bbb25){return db[_0x46f4('0x2a')]['find']({'where':{'id':_0x18f0e0[_0x46f4('0x41')]['id']}})[_0x46f4('0x24')](handleEntityNotFound(_0x2bbb25,null))[_0x46f4('0x24')](removeEntity(_0x2bbb25,null))[_0x46f4('0x40')](handleError(_0x2bbb25,null));};exports['describe']=function(_0x26f39a,_0x478dd7){return db[_0x46f4('0x2a')][_0x46f4('0x48')]()[_0x46f4('0x24')](respondWithResult(_0x478dd7,null))['catch'](handleError(_0x478dd7,null));};
\ No newline at end of file
index de40df0..3e4bfc5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['path','rimraf','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x4d496,_0x18baec){var _0x305eec=function(_0x33589c){while(--_0x33589c){_0x4d496['push'](_0x4d496['shift']());}};_0x305eec(++_0x18baec);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x36bff5,_0x3156cb){_0x36bff5=_0x36bff5-0x0;var _0x80ade5=_0xcb91[_0x36bff5];return _0x80ade5;};'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')]('ChatQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x20d1b6,_0x44cf7a){var _0x3cbb33=function(_0x36b446){while(--_0x36b446){_0x20d1b6['push'](_0x20d1b6['shift']());}};_0x3cbb33(++_0x44cf7a);}(_0xb7e7,0x121));var _0x7b7e=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0xb7e7[_0x5c9307];return _0x373e29;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index bd2fb11..b0bfa61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8427=['limit','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateChatQueueReport','create','options','then','catch','UpdateChatQueueReport','body','raw','where'];(function(_0x5c6562,_0xb6020c){var _0x2a0f79=function(_0x3f6cbf){while(--_0x3f6cbf){_0x5c6562['push'](_0x5c6562['shift']());}};_0x2a0f79(++_0xb6020c);}(_0x8427,0x7d));var _0x7842=function(_0x16a7cb,_0x3833e4){_0x16a7cb=_0x16a7cb-0x0;var _0x754c1d=_0x8427[_0x16a7cb];return _0x754c1d;};'use strict';var _=require(_0x7842('0x0'));var util=require(_0x7842('0x1'));var moment=require(_0x7842('0x2'));var BPromise=require('bluebird');var rs=require(_0x7842('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7842('0x4'))['db'];var utils=require(_0x7842('0x5'));var logger=require(_0x7842('0x6'))(_0x7842('0x7'));var config=require(_0x7842('0x8'));var jayson=require(_0x7842('0x9'));var client=jayson[_0x7842('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27b8a9,_0x39c299,_0x518144){return new BPromise(function(_0x134d72,_0x3c781e){return client['request'](_0x27b8a9,_0x518144)['then'](function(_0x205d27){logger[_0x7842('0xb')](_0x7842('0xc'),_0x39c299,_0x7842('0xd'));logger[_0x7842('0xe')](_0x7842('0xf'),_0x39c299,_0x7842('0xd'),JSON[_0x7842('0x10')](_0x205d27));if(_0x205d27[_0x7842('0x11')]){if(_0x205d27['error'][_0x7842('0x12')]===0x1f4){logger[_0x7842('0x11')](_0x7842('0xc'),_0x39c299,_0x205d27['error'][_0x7842('0x13')]);return _0x3c781e(_0x205d27[_0x7842('0x11')][_0x7842('0x13')]);}logger[_0x7842('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x39c299,_0x205d27[_0x7842('0x11')][_0x7842('0x13')]);return _0x134d72(_0x205d27[_0x7842('0x11')][_0x7842('0x13')]);}else{logger[_0x7842('0xb')](_0x7842('0xc'),_0x39c299,'request\x20sent');_0x134d72(_0x205d27[_0x7842('0x14')][_0x7842('0x13')]);}})['catch'](function(_0x45bab4){logger[_0x7842('0x11')](_0x7842('0xc'),_0x39c299,_0x45bab4);_0x3c781e(_0x45bab4);});});}exports[_0x7842('0x15')]=function(_0x981f61){var _0x48ff54=this;return new Promise(function(_0x54ee44,_0xff4aa8){return db['ChatQueueReport'][_0x7842('0x16')](_0x981f61['body'],{'raw':_0x981f61[_0x7842('0x17')]?_0x981f61[_0x7842('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x7842('0x18')](function(_0xf46815){logger[_0x7842('0xb')]('CreateChatQueueReport',_0x981f61);logger['debug'](_0x7842('0x15'),_0x981f61,JSON[_0x7842('0x10')](_0xf46815));_0x54ee44(_0xf46815);})[_0x7842('0x19')](function(_0x1a7a93){logger[_0x7842('0x11')](_0x7842('0x15'),_0x1a7a93[_0x7842('0x13')],_0x981f61);_0xff4aa8(_0x48ff54[_0x7842('0x11')](0x1f4,_0x1a7a93[_0x7842('0x13')]));});});};exports[_0x7842('0x1a')]=function(_0x397cd7){var _0x1326fa=this;return new Promise(function(_0x14d869,_0x49fff1){return db['ChatQueueReport']['update'](_0x397cd7[_0x7842('0x1b')],{'raw':_0x397cd7[_0x7842('0x17')]?_0x397cd7[_0x7842('0x17')][_0x7842('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x397cd7[_0x7842('0x17')]?_0x397cd7[_0x7842('0x17')][_0x7842('0x1d')]||null:null,'attributes':_0x397cd7[_0x7842('0x17')]?_0x397cd7[_0x7842('0x17')]['attributes']||null:null,'limit':_0x397cd7[_0x7842('0x17')]?_0x397cd7[_0x7842('0x17')][_0x7842('0x1e')]||null:null})[_0x7842('0x18')](function(_0x2416b5){logger['info'](_0x7842('0x1a'),_0x397cd7);logger[_0x7842('0xe')](_0x7842('0x1a'),_0x397cd7,JSON[_0x7842('0x10')](_0x2416b5));_0x14d869(_0x2416b5);})['catch'](function(_0x4462d4){logger['error'](_0x7842('0x1a'),_0x4462d4[_0x7842('0x13')],_0x397cd7);_0x49fff1(_0x1326fa[_0x7842('0x11')](0x1f4,_0x4462d4['message']));});});};
\ No newline at end of file
+var _0x1fce=['ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','then','UpdateChatQueueReport','update','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1ef982,_0x1382b5){var _0x5f5538=function(_0x5968ce){while(--_0x5968ce){_0x1ef982['push'](_0x1ef982['shift']());}};_0x5f5538(++_0x1382b5);}(_0x1fce,0x14c));var _0xe1fc=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0x1fce[_0x9fd887];return _0x1a54ab;};'use strict';var _=require(_0xe1fc('0x0'));var util=require(_0xe1fc('0x1'));var moment=require(_0xe1fc('0x2'));var BPromise=require(_0xe1fc('0x3'));var rs=require(_0xe1fc('0x4'));var fs=require('fs');var Redis=require(_0xe1fc('0x5'));var db=require(_0xe1fc('0x6'))['db'];var utils=require(_0xe1fc('0x7'));var logger=require(_0xe1fc('0x8'))(_0xe1fc('0x9'));var config=require(_0xe1fc('0xa'));var jayson=require(_0xe1fc('0xb'));var client=jayson[_0xe1fc('0xc')][_0xe1fc('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x588f45,_0x30e736,_0x15827a){return new BPromise(function(_0x4d47f9,_0x471e6b){return client['request'](_0x588f45,_0x15827a)['then'](function(_0x4a8aab){logger[_0xe1fc('0xe')](_0xe1fc('0xf'),_0x30e736,_0xe1fc('0x10'));logger[_0xe1fc('0x11')](_0xe1fc('0x12'),_0x30e736,_0xe1fc('0x10'),JSON[_0xe1fc('0x13')](_0x4a8aab));if(_0x4a8aab[_0xe1fc('0x14')]){if(_0x4a8aab[_0xe1fc('0x14')][_0xe1fc('0x15')]===0x1f4){logger[_0xe1fc('0x14')](_0xe1fc('0xf'),_0x30e736,_0x4a8aab[_0xe1fc('0x14')][_0xe1fc('0x16')]);return _0x471e6b(_0x4a8aab[_0xe1fc('0x14')][_0xe1fc('0x16')]);}logger[_0xe1fc('0x14')](_0xe1fc('0xf'),_0x30e736,_0x4a8aab[_0xe1fc('0x14')][_0xe1fc('0x16')]);return _0x4d47f9(_0x4a8aab[_0xe1fc('0x14')][_0xe1fc('0x16')]);}else{logger['info'](_0xe1fc('0xf'),_0x30e736,_0xe1fc('0x10'));_0x4d47f9(_0x4a8aab[_0xe1fc('0x17')][_0xe1fc('0x16')]);}})[_0xe1fc('0x18')](function(_0x49b6ca){logger[_0xe1fc('0x14')]('ChatQueueReport,\x20%s,\x20%s',_0x30e736,_0x49b6ca);_0x471e6b(_0x49b6ca);});});}exports[_0xe1fc('0x19')]=function(_0x1311ba){var _0x25ec16=this;return new Promise(function(_0x1509de,_0x583e9c){return db[_0xe1fc('0x1a')][_0xe1fc('0x1b')](_0x1311ba[_0xe1fc('0x1c')],{'raw':_0x1311ba['options']?_0x1311ba[_0xe1fc('0x1d')][_0xe1fc('0x1e')]===undefined?!![]:![]:!![]})[_0xe1fc('0x1f')](function(_0xa2a5a3){logger[_0xe1fc('0xe')]('CreateChatQueueReport',_0x1311ba);logger[_0xe1fc('0x11')](_0xe1fc('0x19'),_0x1311ba,JSON[_0xe1fc('0x13')](_0xa2a5a3));_0x1509de(_0xa2a5a3);})[_0xe1fc('0x18')](function(_0x4fa1a1){logger[_0xe1fc('0x14')](_0xe1fc('0x19'),_0x4fa1a1['message'],_0x1311ba);_0x583e9c(_0x25ec16[_0xe1fc('0x14')](0x1f4,_0x4fa1a1[_0xe1fc('0x16')]));});});};exports[_0xe1fc('0x20')]=function(_0x4f8599){var _0x5408d5=this;return new Promise(function(_0x38a06a,_0x46da83){return db[_0xe1fc('0x1a')][_0xe1fc('0x21')](_0x4f8599['body'],{'raw':_0x4f8599['options']?_0x4f8599[_0xe1fc('0x1d')][_0xe1fc('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f8599['options']?_0x4f8599['options']['where']||null:null,'attributes':_0x4f8599[_0xe1fc('0x1d')]?_0x4f8599[_0xe1fc('0x1d')][_0xe1fc('0x22')]||null:null,'limit':_0x4f8599['options']?_0x4f8599[_0xe1fc('0x1d')]['limit']||null:null})['then'](function(_0x4b3ca7){logger[_0xe1fc('0xe')](_0xe1fc('0x20'),_0x4f8599);logger[_0xe1fc('0x11')](_0xe1fc('0x20'),_0x4f8599,JSON[_0xe1fc('0x13')](_0x4b3ca7));_0x38a06a(_0x4b3ca7);})[_0xe1fc('0x18')](function(_0x2a7773){logger['error'](_0xe1fc('0x20'),_0x2a7773[_0xe1fc('0x16')],_0x4f8599);_0x46da83(_0x5408d5[_0xe1fc('0x14')](0x1f4,_0x2a7773['message']));});});};
\ No newline at end of file
index 240c9df..62a27be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff77=['../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','path','express','Router'];(function(_0x4a62b9,_0x5679ff){var _0x2d28db=function(_0x5a3dc9){while(--_0x5a3dc9){_0x4a62b9['push'](_0x4a62b9['shift']());}};_0x2d28db(++_0x5679ff);}(_0xff77,0x88));var _0x7ff7=function(_0x524277,_0x213156){_0x524277=_0x524277-0x0;var _0x48aced=_0xff77[_0x524277];return _0x48aced;};'use strict';var multer=require(_0x7ff7('0x0'));var util=require('util');var path=require(_0x7ff7('0x1'));var timeout=require('connect-timeout');var express=require(_0x7ff7('0x2'));var router=express[_0x7ff7('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7ff7('0x4'));var interaction=require(_0x7ff7('0x5'));var config=require(_0x7ff7('0x6'));var controller=require('./chatQueueReport.controller');router['get']('/',auth[_0x7ff7('0x7')](),controller[_0x7ff7('0x8')]);router[_0x7ff7('0x9')](_0x7ff7('0xa'),auth['isAuthenticated'](),controller[_0x7ff7('0xb')]);router[_0x7ff7('0x9')](_0x7ff7('0xc'),auth[_0x7ff7('0x7')](),controller[_0x7ff7('0xd')]);router[_0x7ff7('0xe')]('/',auth[_0x7ff7('0x7')](),controller[_0x7ff7('0xf')]);router['put'](_0x7ff7('0xc'),auth['isAuthenticated'](),controller[_0x7ff7('0x10')]);router[_0x7ff7('0x11')](_0x7ff7('0xc'),auth['isAuthenticated'](),controller[_0x7ff7('0x12')]);module[_0x7ff7('0x13')]=router;
\ No newline at end of file
+var _0x7211=['get','isAuthenticated','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../config/environment','./chatQueueReport.controller'];(function(_0x5bf9a4,_0x33d20c){var _0x2bb53a=function(_0x48f0aa){while(--_0x48f0aa){_0x5bf9a4['push'](_0x5bf9a4['shift']());}};_0x2bb53a(++_0x33d20c);}(_0x7211,0x1ae));var _0x1721=function(_0x5d325a,_0x404a9b){_0x5d325a=_0x5d325a-0x0;var _0x183d9c=_0x7211[_0x5d325a];return _0x183d9c;};'use strict';var multer=require('multer');var util=require(_0x1721('0x0'));var path=require(_0x1721('0x1'));var timeout=require(_0x1721('0x2'));var express=require(_0x1721('0x3'));var router=express['Router']();var fs_extra=require(_0x1721('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1721('0x5'));var controller=require(_0x1721('0x6'));router[_0x1721('0x7')]('/',auth[_0x1721('0x8')](),controller['index']);router['get'](_0x1721('0x9'),auth['isAuthenticated'](),controller[_0x1721('0xa')]);router[_0x1721('0x7')](_0x1721('0xb'),auth['isAuthenticated'](),controller[_0x1721('0xc')]);router[_0x1721('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1721('0xe')](_0x1721('0xb'),auth[_0x1721('0x8')](),controller[_0x1721('0xf')]);router[_0x1721('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x1721('0x11')]);module[_0x1721('0x12')]=router;
\ No newline at end of file
index d181aab..b42adea 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(_0x1e4003,_0x2e06e1){var _0x327147=function(_0x3aff0d){while(--_0x3aff0d){_0x1e4003['push'](_0x1e4003['shift']());}};_0x327147(++_0x2e06e1);}(_0xedd9,0xfc));var _0x9edd=function(_0x1ac853,_0x3b315b){_0x1ac853=_0x1ac853-0x0;var _0x3b249d=_0xedd9[_0x1ac853];return _0x3b249d;};'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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x4fe69a,_0x4cd41d){var _0x5d9fb4=function(_0x12ce56){while(--_0x12ce56){_0x4fe69a['push'](_0x4fe69a['shift']());}};_0x5d9fb4(++_0x4cd41d);}(_0x70e0,0x17b));var _0x070e=function(_0x253bcf,_0x1a959c){_0x253bcf=_0x253bcf-0x0;var _0x144d69=_0x70e0[_0x253bcf];return _0x144d69;};'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 75bb4fd..f2c7b52 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59ec=['then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','filters','pick','filter','where','VIRTUAL','options','include','ChatTransferReport','findAll','rows','catch','show','params','keys','length','includeAll','merge','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','save','update'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x59ec,0x76));var _0xc59e=function(_0x5663a9,_0x399776){_0x5663a9=_0x5663a9-0x0;var _0x56af5a=_0x59ec[_0x5663a9];return _0x56af5a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc59e('0x0'));var zipdir=require(_0xc59e('0x1'));var jsonpatch=require(_0xc59e('0x2'));var rp=require(_0xc59e('0x3'));var moment=require(_0xc59e('0x4'));var BPromise=require(_0xc59e('0x5'));var Mustache=require(_0xc59e('0x6'));var util=require(_0xc59e('0x7'));var path=require(_0xc59e('0x8'));var sox=require(_0xc59e('0x9'));var csv=require(_0xc59e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc59e('0xb'));var squel=require(_0xc59e('0xc'));var crypto=require('crypto');var jsforce=require(_0xc59e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc59e('0xa'));var querystring=require(_0xc59e('0xe'));var Papa=require(_0xc59e('0xf'));var Redis=require(_0xc59e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc59e('0x11'));var as=require(_0xc59e('0x12'));var hardwareService=require(_0xc59e('0x13'));var logger=require(_0xc59e('0x14'))(_0xc59e('0x15'));var utils=require('../../config/utils');var config=require(_0xc59e('0x16'));var licenseUtil=require(_0xc59e('0x17'));var db=require(_0xc59e('0x18'))['db'];function respondWithStatusCode(_0x392774,_0x5e42a2){_0x5e42a2=_0x5e42a2||0xcc;return function(_0x2a267b){if(_0x2a267b){return _0x392774[_0xc59e('0x19')](_0x5e42a2);}return _0x392774[_0xc59e('0x1a')](_0x5e42a2)[_0xc59e('0x1b')]();};}function respondWithResult(_0x5eed21,_0x3c787d){_0x3c787d=_0x3c787d||0xc8;return function(_0x5d1dc6){if(_0x5d1dc6){return _0x5eed21['status'](_0x3c787d)[_0xc59e('0x1c')](_0x5d1dc6);}};}function respondWithFilteredResult(_0x3a3f5f,_0x137cfb){return function(_0x49e5e6){if(_0x49e5e6){var _0x2fbd02=typeof _0x137cfb[_0xc59e('0x1d')]===_0xc59e('0x1e')&&typeof _0x137cfb[_0xc59e('0x1f')]===_0xc59e('0x1e');var _0x1c0e48=_0x49e5e6[_0xc59e('0x20')];var _0xa2bd6a=_0x2fbd02?0x0:_0x137cfb['offset'];var _0x4a85fc=_0x2fbd02?_0x49e5e6[_0xc59e('0x20')]:_0x137cfb[_0xc59e('0x1d')]+_0x137cfb['limit'];var _0x5ac2e5;if(_0x4a85fc>=_0x1c0e48){_0x4a85fc=_0x1c0e48;_0x5ac2e5=0xc8;}else{_0x5ac2e5=0xce;}_0x3a3f5f[_0xc59e('0x1a')](_0x5ac2e5);return _0x3a3f5f[_0xc59e('0x21')]('Content-Range',_0xa2bd6a+'-'+_0x4a85fc+'/'+_0x1c0e48)[_0xc59e('0x1c')](_0x49e5e6);}return null;};}function patchUpdates(_0x496357){return function(_0x56a10b){try{jsonpatch['apply'](_0x56a10b,_0x496357,!![]);}catch(_0x57b3ac){return BPromise['reject'](_0x57b3ac);}return _0x56a10b[_0xc59e('0x22')]();};}function saveUpdates(_0x457edb,_0x345bf3){return function(_0x19b2c0){if(_0x19b2c0){return _0x19b2c0[_0xc59e('0x23')](_0x457edb)[_0xc59e('0x24')](function(_0x45ded3){return _0x45ded3;});}return null;};}function removeEntity(_0x169c62,_0xd27242){return function(_0x207b8c){if(_0x207b8c){return _0x207b8c[_0xc59e('0x25')]()[_0xc59e('0x24')](function(){_0x169c62[_0xc59e('0x1a')](0xcc)[_0xc59e('0x1b')]();});}};}function handleEntityNotFound(_0x5dd6e7,_0x213f9b){return function(_0x103b39){if(!_0x103b39){_0x5dd6e7['sendStatus'](0x194);}return _0x103b39;};}function handleError(_0x33b8e7,_0x387fd5){_0x387fd5=_0x387fd5||0x1f4;return function(_0x46ac3a){logger[_0xc59e('0x26')](_0x46ac3a[_0xc59e('0x27')]);if(_0x46ac3a['name']){delete _0x46ac3a[_0xc59e('0x28')];}_0x33b8e7[_0xc59e('0x1a')](_0x387fd5)[_0xc59e('0x29')](_0x46ac3a);};}exports[_0xc59e('0x2a')]=function(_0x224e58,_0xdca500){var _0x1f2ad9={},_0x2960bc={},_0x178595={'count':0x0,'rows':[]};var _0x6fd6cd=_[_0xc59e('0x2b')](db['ChatTransferReport'][_0xc59e('0x2c')],function(_0xf5841a){return{'name':_0xf5841a[_0xc59e('0x2d')],'type':_0xf5841a[_0xc59e('0x2e')][_0xc59e('0x2f')]};});_0x2960bc[_0xc59e('0x30')]=_['map'](_0x6fd6cd,_0xc59e('0x28'));_0x2960bc[_0xc59e('0x31')]=_['keys'](_0x224e58['query']);_0x2960bc['filters']=_[_0xc59e('0x32')](_0x2960bc['model'],_0x2960bc['query']);_0x1f2ad9[_0xc59e('0x33')]=_[_0xc59e('0x32')](_0x2960bc['model'],qs[_0xc59e('0x34')](_0x224e58[_0xc59e('0x31')][_0xc59e('0x34')]));_0x1f2ad9[_0xc59e('0x33')]=_0x1f2ad9[_0xc59e('0x33')]['length']?_0x1f2ad9[_0xc59e('0x33')]:_0x2960bc['model'];if(!_0x224e58[_0xc59e('0x31')][_0xc59e('0x35')](_0xc59e('0x36'))){_0x1f2ad9[_0xc59e('0x1f')]=qs[_0xc59e('0x1f')](_0x224e58[_0xc59e('0x31')][_0xc59e('0x1f')]);_0x1f2ad9[_0xc59e('0x1d')]=qs[_0xc59e('0x1d')](_0x224e58[_0xc59e('0x31')]['offset']);}_0x1f2ad9[_0xc59e('0x37')]=qs['sort'](_0x224e58[_0xc59e('0x31')]['sort']);_0x1f2ad9['where']=qs[_0xc59e('0x38')](_[_0xc59e('0x39')](_0x224e58[_0xc59e('0x31')],_0x2960bc[_0xc59e('0x38')]),_0x6fd6cd);if(_0x224e58[_0xc59e('0x31')][_0xc59e('0x3a')]){_0x1f2ad9[_0xc59e('0x3b')]=_['merge'](_0x1f2ad9['where'],{'$or':_[_0xc59e('0x2b')](_0x6fd6cd,function(_0x5d2ace){if(_0x5d2ace[_0xc59e('0x2e')]!==_0xc59e('0x3c')){var _0x4b9fc9={};_0x4b9fc9[_0x5d2ace[_0xc59e('0x28')]]={'$like':'%'+_0x224e58['query'][_0xc59e('0x3a')]+'%'};return _0x4b9fc9;}})});}_0x1f2ad9=_['merge']({},_0x1f2ad9,_0x224e58[_0xc59e('0x3d')]);var _0x112ded={'where':_0x1f2ad9[_0xc59e('0x3b')]};return db['ChatTransferReport']['count'](_0x112ded)['then'](function(_0x19f6e6){_0x178595[_0xc59e('0x20')]=_0x19f6e6;if(_0x224e58[_0xc59e('0x31')]['includeAll']){_0x1f2ad9[_0xc59e('0x3e')]=[{'all':!![]}];}return db[_0xc59e('0x3f')][_0xc59e('0x40')](_0x1f2ad9);})[_0xc59e('0x24')](function(_0x1d02dd){_0x178595[_0xc59e('0x41')]=_0x1d02dd;return _0x178595;})[_0xc59e('0x24')](respondWithFilteredResult(_0xdca500,_0x1f2ad9))[_0xc59e('0x42')](handleError(_0xdca500,null));};exports[_0xc59e('0x43')]=function(_0x146670,_0x3a5d59){var _0x5904a1={'raw':!![],'where':{'id':_0x146670[_0xc59e('0x44')]['id']}},_0x2f8d3b={};_0x2f8d3b['model']=_['keys'](db[_0xc59e('0x3f')][_0xc59e('0x2c')]);_0x2f8d3b[_0xc59e('0x31')]=_[_0xc59e('0x45')](_0x146670[_0xc59e('0x31')]);_0x2f8d3b[_0xc59e('0x38')]=_[_0xc59e('0x32')](_0x2f8d3b[_0xc59e('0x30')],_0x2f8d3b[_0xc59e('0x31')]);_0x5904a1[_0xc59e('0x33')]=_['intersection'](_0x2f8d3b['model'],qs['fields'](_0x146670[_0xc59e('0x31')][_0xc59e('0x34')]));_0x5904a1[_0xc59e('0x33')]=_0x5904a1[_0xc59e('0x33')][_0xc59e('0x46')]?_0x5904a1[_0xc59e('0x33')]:_0x2f8d3b[_0xc59e('0x30')];if(_0x146670[_0xc59e('0x31')][_0xc59e('0x47')]){_0x5904a1[_0xc59e('0x3e')]=[{'all':!![]}];}_0x5904a1=_[_0xc59e('0x48')]({},_0x5904a1,_0x146670[_0xc59e('0x3d')]);return db[_0xc59e('0x3f')][_0xc59e('0x49')](_0x5904a1)[_0xc59e('0x24')](handleEntityNotFound(_0x3a5d59,null))[_0xc59e('0x24')](respondWithResult(_0x3a5d59,null))[_0xc59e('0x42')](handleError(_0x3a5d59,null));};exports[_0xc59e('0x4a')]=function(_0x321ef1,_0x57b7c8){return db[_0xc59e('0x3f')][_0xc59e('0x4a')](_0x321ef1['body'],{})['then'](respondWithResult(_0x57b7c8,0xc9))['catch'](handleError(_0x57b7c8,null));};exports[_0xc59e('0x23')]=function(_0x307e95,_0x17683b){if(_0x307e95['body']['id']){delete _0x307e95[_0xc59e('0x4b')]['id'];}return db[_0xc59e('0x3f')][_0xc59e('0x49')]({'where':{'id':_0x307e95[_0xc59e('0x44')]['id']}})[_0xc59e('0x24')](handleEntityNotFound(_0x17683b,null))[_0xc59e('0x24')](saveUpdates(_0x307e95[_0xc59e('0x4b')],null))[_0xc59e('0x24')](respondWithResult(_0x17683b,null))[_0xc59e('0x42')](handleError(_0x17683b,null));};exports[_0xc59e('0x25')]=function(_0x98ac24,_0x4c5767){return db[_0xc59e('0x3f')][_0xc59e('0x49')]({'where':{'id':_0x98ac24[_0xc59e('0x44')]['id']}})[_0xc59e('0x24')](handleEntityNotFound(_0x4c5767,null))[_0xc59e('0x24')](removeEntity(_0x4c5767,null))[_0xc59e('0x42')](handleError(_0x4c5767,null));};exports['describe']=function(_0x4b3466,_0x5b14ed){return db[_0xc59e('0x3f')][_0xc59e('0x4c')]()[_0xc59e('0x24')](respondWithResult(_0x5b14ed,null))[_0xc59e('0x42')](handleError(_0x5b14ed,null));};
\ No newline at end of file
+var _0x8ca2=['to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','destroy','sendStatus','error','stack','name','index','map','ChatTransferReport','rawAttributes','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','then','includeAll','include','rows','catch','params','find','create','body','update','describe','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox'];(function(_0x4e142d,_0x165722){var _0x246827=function(_0x4e8e2d){while(--_0x4e8e2d){_0x4e142d['push'](_0x4e142d['shift']());}};_0x246827(++_0x165722);}(_0x8ca2,0x8d));var _0x28ca=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x8ca2[_0x484e36];return _0xafc85d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x28ca('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x28ca('0x1'));var rp=require(_0x28ca('0x2'));var moment=require('moment');var BPromise=require(_0x28ca('0x3'));var Mustache=require('mustache');var util=require(_0x28ca('0x4'));var path=require(_0x28ca('0x5'));var sox=require(_0x28ca('0x6'));var csv=require(_0x28ca('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x28ca('0x8'));var _=require('lodash');var squel=require(_0x28ca('0x9'));var crypto=require(_0x28ca('0xa'));var jsforce=require(_0x28ca('0xb'));var deskjs=require(_0x28ca('0xc'));var toCsv=require(_0x28ca('0x7'));var querystring=require(_0x28ca('0xd'));var Papa=require(_0x28ca('0xe'));var Redis=require(_0x28ca('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x28ca('0x10'));var hardwareService=require(_0x28ca('0x11'));var logger=require(_0x28ca('0x12'))(_0x28ca('0x13'));var utils=require(_0x28ca('0x14'));var config=require(_0x28ca('0x15'));var licenseUtil=require(_0x28ca('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x306234,_0x51d25b){_0x51d25b=_0x51d25b||0xcc;return function(_0x4b0b6f){if(_0x4b0b6f){return _0x306234['sendStatus'](_0x51d25b);}return _0x306234[_0x28ca('0x17')](_0x51d25b)[_0x28ca('0x18')]();};}function respondWithResult(_0x27099c,_0x312825){_0x312825=_0x312825||0xc8;return function(_0x52a0c5){if(_0x52a0c5){return _0x27099c[_0x28ca('0x17')](_0x312825)['json'](_0x52a0c5);}};}function respondWithFilteredResult(_0xdf0173,_0x27216e){return function(_0x2a0ace){if(_0x2a0ace){var _0x1889cf=typeof _0x27216e[_0x28ca('0x19')]==='undefined'&&typeof _0x27216e[_0x28ca('0x1a')]===_0x28ca('0x1b');var _0x275425=_0x2a0ace[_0x28ca('0x1c')];var _0x58fa28=_0x1889cf?0x0:_0x27216e[_0x28ca('0x19')];var _0xda3221=_0x1889cf?_0x2a0ace[_0x28ca('0x1c')]:_0x27216e[_0x28ca('0x19')]+_0x27216e[_0x28ca('0x1a')];var _0x5939c5;if(_0xda3221>=_0x275425){_0xda3221=_0x275425;_0x5939c5=0xc8;}else{_0x5939c5=0xce;}_0xdf0173[_0x28ca('0x17')](_0x5939c5);return _0xdf0173[_0x28ca('0x1d')](_0x28ca('0x1e'),_0x58fa28+'-'+_0xda3221+'/'+_0x275425)[_0x28ca('0x1f')](_0x2a0ace);}return null;};}function patchUpdates(_0x377ca2){return function(_0x5bc24e){try{jsonpatch[_0x28ca('0x20')](_0x5bc24e,_0x377ca2,!![]);}catch(_0xa443d5){return BPromise['reject'](_0xa443d5);}return _0x5bc24e[_0x28ca('0x21')]();};}function saveUpdates(_0x2dbcc0,_0x2f9b0e){return function(_0x355f72){if(_0x355f72){return _0x355f72['update'](_0x2dbcc0)['then'](function(_0x47d298){return _0x47d298;});}return null;};}function removeEntity(_0x3d9392,_0x4db799){return function(_0x289c3f){if(_0x289c3f){return _0x289c3f[_0x28ca('0x22')]()['then'](function(){_0x3d9392[_0x28ca('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14f005,_0x32c206){return function(_0x5a8f0b){if(!_0x5a8f0b){_0x14f005[_0x28ca('0x23')](0x194);}return _0x5a8f0b;};}function handleError(_0x33c84e,_0x12e362){_0x12e362=_0x12e362||0x1f4;return function(_0x305e8b){logger[_0x28ca('0x24')](_0x305e8b[_0x28ca('0x25')]);if(_0x305e8b[_0x28ca('0x26')]){delete _0x305e8b[_0x28ca('0x26')];}_0x33c84e['status'](_0x12e362)['send'](_0x305e8b);};}exports[_0x28ca('0x27')]=function(_0xf2e521,_0x24e3d4){var _0x27690c={},_0x4acae1={},_0x273545={'count':0x0,'rows':[]};var _0x5ce9d5=_[_0x28ca('0x28')](db[_0x28ca('0x29')][_0x28ca('0x2a')],function(_0x300af6){return{'name':_0x300af6['fieldName'],'type':_0x300af6[_0x28ca('0x2b')][_0x28ca('0x2c')]};});_0x4acae1['model']=_['map'](_0x5ce9d5,_0x28ca('0x26'));_0x4acae1[_0x28ca('0x2d')]=_[_0x28ca('0x2e')](_0xf2e521[_0x28ca('0x2d')]);_0x4acae1['filters']=_['intersection'](_0x4acae1[_0x28ca('0x2f')],_0x4acae1[_0x28ca('0x2d')]);_0x27690c[_0x28ca('0x30')]=_[_0x28ca('0x31')](_0x4acae1[_0x28ca('0x2f')],qs['fields'](_0xf2e521[_0x28ca('0x2d')][_0x28ca('0x32')]));_0x27690c[_0x28ca('0x30')]=_0x27690c[_0x28ca('0x30')][_0x28ca('0x33')]?_0x27690c[_0x28ca('0x30')]:_0x4acae1['model'];if(!_0xf2e521['query'][_0x28ca('0x34')](_0x28ca('0x35'))){_0x27690c[_0x28ca('0x1a')]=qs[_0x28ca('0x1a')](_0xf2e521['query'][_0x28ca('0x1a')]);_0x27690c[_0x28ca('0x19')]=qs['offset'](_0xf2e521[_0x28ca('0x2d')][_0x28ca('0x19')]);}_0x27690c[_0x28ca('0x36')]=qs['sort'](_0xf2e521[_0x28ca('0x2d')][_0x28ca('0x37')]);_0x27690c[_0x28ca('0x38')]=qs[_0x28ca('0x39')](_[_0x28ca('0x3a')](_0xf2e521[_0x28ca('0x2d')],_0x4acae1[_0x28ca('0x39')]),_0x5ce9d5);if(_0xf2e521[_0x28ca('0x2d')][_0x28ca('0x3b')]){_0x27690c[_0x28ca('0x38')]=_['merge'](_0x27690c[_0x28ca('0x38')],{'$or':_[_0x28ca('0x28')](_0x5ce9d5,function(_0x1d1780){if(_0x1d1780[_0x28ca('0x2b')]!==_0x28ca('0x3c')){var _0x230c78={};_0x230c78[_0x1d1780[_0x28ca('0x26')]]={'$like':'%'+_0xf2e521['query'][_0x28ca('0x3b')]+'%'};return _0x230c78;}})});}_0x27690c=_[_0x28ca('0x3d')]({},_0x27690c,_0xf2e521[_0x28ca('0x3e')]);var _0x1624bd={'where':_0x27690c[_0x28ca('0x38')]};return db[_0x28ca('0x29')][_0x28ca('0x1c')](_0x1624bd)[_0x28ca('0x3f')](function(_0x4fcc97){_0x273545['count']=_0x4fcc97;if(_0xf2e521[_0x28ca('0x2d')][_0x28ca('0x40')]){_0x27690c[_0x28ca('0x41')]=[{'all':!![]}];}return db[_0x28ca('0x29')]['findAll'](_0x27690c);})[_0x28ca('0x3f')](function(_0x513a7f){_0x273545[_0x28ca('0x42')]=_0x513a7f;return _0x273545;})[_0x28ca('0x3f')](respondWithFilteredResult(_0x24e3d4,_0x27690c))[_0x28ca('0x43')](handleError(_0x24e3d4,null));};exports['show']=function(_0x57b046,_0x46ffe8){var _0x5676c1={'raw':!![],'where':{'id':_0x57b046[_0x28ca('0x44')]['id']}},_0x353bfe={};_0x353bfe[_0x28ca('0x2f')]=_['keys'](db[_0x28ca('0x29')][_0x28ca('0x2a')]);_0x353bfe[_0x28ca('0x2d')]=_['keys'](_0x57b046[_0x28ca('0x2d')]);_0x353bfe['filters']=_[_0x28ca('0x31')](_0x353bfe[_0x28ca('0x2f')],_0x353bfe['query']);_0x5676c1[_0x28ca('0x30')]=_[_0x28ca('0x31')](_0x353bfe[_0x28ca('0x2f')],qs['fields'](_0x57b046['query'][_0x28ca('0x32')]));_0x5676c1['attributes']=_0x5676c1[_0x28ca('0x30')][_0x28ca('0x33')]?_0x5676c1['attributes']:_0x353bfe[_0x28ca('0x2f')];if(_0x57b046[_0x28ca('0x2d')][_0x28ca('0x40')]){_0x5676c1[_0x28ca('0x41')]=[{'all':!![]}];}_0x5676c1=_[_0x28ca('0x3d')]({},_0x5676c1,_0x57b046[_0x28ca('0x3e')]);return db[_0x28ca('0x29')][_0x28ca('0x45')](_0x5676c1)['then'](handleEntityNotFound(_0x46ffe8,null))['then'](respondWithResult(_0x46ffe8,null))[_0x28ca('0x43')](handleError(_0x46ffe8,null));};exports['create']=function(_0x53174b,_0x27e1eb){return db['ChatTransferReport'][_0x28ca('0x46')](_0x53174b[_0x28ca('0x47')],{})['then'](respondWithResult(_0x27e1eb,0xc9))[_0x28ca('0x43')](handleError(_0x27e1eb,null));};exports[_0x28ca('0x48')]=function(_0x3b9c03,_0xf9f249){if(_0x3b9c03[_0x28ca('0x47')]['id']){delete _0x3b9c03[_0x28ca('0x47')]['id'];}return db[_0x28ca('0x29')]['find']({'where':{'id':_0x3b9c03[_0x28ca('0x44')]['id']}})[_0x28ca('0x3f')](handleEntityNotFound(_0xf9f249,null))[_0x28ca('0x3f')](saveUpdates(_0x3b9c03[_0x28ca('0x47')],null))[_0x28ca('0x3f')](respondWithResult(_0xf9f249,null))['catch'](handleError(_0xf9f249,null));};exports['destroy']=function(_0x39d096,_0x54202f){return db['ChatTransferReport'][_0x28ca('0x45')]({'where':{'id':_0x39d096[_0x28ca('0x44')]['id']}})[_0x28ca('0x3f')](handleEntityNotFound(_0x54202f,null))[_0x28ca('0x3f')](removeEntity(_0x54202f,null))[_0x28ca('0x43')](handleError(_0x54202f,null));};exports[_0x28ca('0x49')]=function(_0x538ca9,_0x1fb230){return db[_0x28ca('0x29')][_0x28ca('0x49')]()[_0x28ca('0x3f')](respondWithResult(_0x1fb230,null))[_0x28ca('0x43')](handleError(_0x1fb230,null));};
\ No newline at end of file
index 03b7e8a..b5ec880 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8707=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','util','../../config/logger','api'];(function(_0x38e218,_0x1d33e5){var _0x327edf=function(_0x43b8bf){while(--_0x43b8bf){_0x38e218['push'](_0x38e218['shift']());}};_0x327edf(++_0x1d33e5);}(_0x8707,0x142));var _0x7870=function(_0x528603,_0x3317c8){_0x528603=_0x528603-0x0;var _0x4ab500=_0x8707[_0x528603];return _0x4ab500;};'use strict';var _=require('lodash');var util=require(_0x7870('0x0'));var logger=require(_0x7870('0x1'))(_0x7870('0x2'));var moment=require(_0x7870('0x3'));var BPromise=require(_0x7870('0x4'));var rp=require(_0x7870('0x5'));var fs=require('fs');var path=require(_0x7870('0x6'));var rimraf=require(_0x7870('0x7'));var config=require(_0x7870('0x8'));var attributes=require(_0x7870('0x9'));module[_0x7870('0xa')]=function(_0x232a46,_0x598f79){return _0x232a46['define'](_0x7870('0xb'),attributes,{'tableName':_0x7870('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9c25=['request-promise','path','rimraf','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x58df3b,_0x182132){var _0x1c82d6=function(_0x48b1a2){while(--_0x48b1a2){_0x58df3b['push'](_0x58df3b['shift']());}};_0x1c82d6(++_0x182132);}(_0x9c25,0x19e));var _0x59c2=function(_0xdce78a,_0x507cad){_0xdce78a=_0xdce78a-0x0;var _0x47c31c=_0x9c25[_0xdce78a];return _0x47c31c;};'use strict';var _=require(_0x59c2('0x0'));var util=require(_0x59c2('0x1'));var logger=require(_0x59c2('0x2'))(_0x59c2('0x3'));var moment=require(_0x59c2('0x4'));var BPromise=require(_0x59c2('0x5'));var rp=require(_0x59c2('0x6'));var fs=require('fs');var path=require(_0x59c2('0x7'));var rimraf=require(_0x59c2('0x8'));var config=require('../../config/environment');var attributes=require(_0x59c2('0x9'));module[_0x59c2('0xa')]=function(_0x1564c4,_0x5671ff){return _0x1564c4[_0x59c2('0xb')](_0x59c2('0xc'),attributes,{'tableName':_0x59c2('0xd'),'paranoid':![],'indexes':[{'name':_0x59c2('0xe'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 9605c8c..ed2ab06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe770=['ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0xe770,0x1e7));var _0x0e77=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe770[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0e77('0x0'));var util=require('util');var moment=require(_0x0e77('0x1'));var BPromise=require(_0x0e77('0x2'));var rs=require(_0x0e77('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0e77('0x4'));var logger=require(_0x0e77('0x5'))('rpc');var config=require(_0x0e77('0x6'));var jayson=require(_0x0e77('0x7'));var client=jayson[_0x0e77('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x101388,_0x1e2276,_0x526fd7){return new BPromise(function(_0x31216b,_0x36c053){return client[_0x0e77('0x9')](_0x101388,_0x526fd7)[_0x0e77('0xa')](function(_0x20dbda){logger[_0x0e77('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x1e2276,_0x0e77('0xc'));logger['debug'](_0x0e77('0xd'),_0x1e2276,_0x0e77('0xc'),JSON[_0x0e77('0xe')](_0x20dbda));if(_0x20dbda[_0x0e77('0xf')]){if(_0x20dbda[_0x0e77('0xf')][_0x0e77('0x10')]===0x1f4){logger['error'](_0x0e77('0x11'),_0x1e2276,_0x20dbda['error'][_0x0e77('0x12')]);return _0x36c053(_0x20dbda[_0x0e77('0xf')][_0x0e77('0x12')]);}logger[_0x0e77('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x1e2276,_0x20dbda['error'][_0x0e77('0x12')]);return _0x31216b(_0x20dbda[_0x0e77('0xf')][_0x0e77('0x12')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x1e2276,_0x0e77('0xc'));_0x31216b(_0x20dbda[_0x0e77('0x13')][_0x0e77('0x12')]);}})['catch'](function(_0x71e840){logger[_0x0e77('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x1e2276,_0x71e840);_0x36c053(_0x71e840);});});}
\ No newline at end of file
+var _0xfeab=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4509db,_0x26e8bf){var _0x3134b5=function(_0xc2c8f7){while(--_0xc2c8f7){_0x4509db['push'](_0x4509db['shift']());}};_0x3134b5(++_0x26e8bf);}(_0xfeab,0x162));var _0xbfea=function(_0xfb369e,_0x2335a2){_0xfb369e=_0xfb369e-0x0;var _0x2e2e97=_0xfeab[_0xfb369e];return _0x2e2e97;};'use strict';var _=require('lodash');var util=require(_0xbfea('0x0'));var moment=require(_0xbfea('0x1'));var BPromise=require(_0xbfea('0x2'));var rs=require(_0xbfea('0x3'));var fs=require('fs');var Redis=require(_0xbfea('0x4'));var db=require(_0xbfea('0x5'))['db'];var utils=require(_0xbfea('0x6'));var logger=require(_0xbfea('0x7'))(_0xbfea('0x8'));var config=require(_0xbfea('0x9'));var jayson=require(_0xbfea('0xa'));var client=jayson['client'][_0xbfea('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36e1e8,_0x3470d0,_0x66abaf){return new BPromise(function(_0x108cff,_0x54f851){return client[_0xbfea('0xc')](_0x36e1e8,_0x66abaf)[_0xbfea('0xd')](function(_0x288560){logger[_0xbfea('0xe')](_0xbfea('0xf'),_0x3470d0,_0xbfea('0x10'));logger[_0xbfea('0x11')](_0xbfea('0x12'),_0x3470d0,_0xbfea('0x10'),JSON[_0xbfea('0x13')](_0x288560));if(_0x288560['error']){if(_0x288560[_0xbfea('0x14')][_0xbfea('0x15')]===0x1f4){logger['error'](_0xbfea('0xf'),_0x3470d0,_0x288560[_0xbfea('0x14')]['message']);return _0x54f851(_0x288560[_0xbfea('0x14')][_0xbfea('0x16')]);}logger[_0xbfea('0x14')](_0xbfea('0xf'),_0x3470d0,_0x288560['error'][_0xbfea('0x16')]);return _0x108cff(_0x288560['error']['message']);}else{logger[_0xbfea('0xe')](_0xbfea('0xf'),_0x3470d0,_0xbfea('0x10'));_0x108cff(_0x288560[_0xbfea('0x17')][_0xbfea('0x16')]);}})['catch'](function(_0x3bb65f){logger[_0xbfea('0x14')](_0xbfea('0xf'),_0x3470d0,_0x3bb65f);_0x54f851(_0x3bb65f);});});}
\ No newline at end of file
index 53ea6c8..a002d5e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed98=['./chatTransferReport.controller','isAuthenticated','index','get','/describe','/:id','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1a883d,_0xdc658d){var _0x32014b=function(_0xa44dff){while(--_0xa44dff){_0x1a883d['push'](_0x1a883d['shift']());}};_0x32014b(++_0xdc658d);}(_0xed98,0x1b1));var _0x8ed9=function(_0x420532,_0x43af73){_0x420532=_0x420532-0x0;var _0xbde273=_0xed98[_0x420532];return _0xbde273;};'use strict';var multer=require('multer');var util=require(_0x8ed9('0x0'));var path=require(_0x8ed9('0x1'));var timeout=require(_0x8ed9('0x2'));var express=require('express');var router=express[_0x8ed9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8ed9('0x4'));var interaction=require(_0x8ed9('0x5'));var config=require(_0x8ed9('0x6'));var controller=require(_0x8ed9('0x7'));router['get']('/',auth[_0x8ed9('0x8')](),controller[_0x8ed9('0x9')]);router[_0x8ed9('0xa')](_0x8ed9('0xb'),auth[_0x8ed9('0x8')](),controller['describe']);router[_0x8ed9('0xa')](_0x8ed9('0xc'),auth[_0x8ed9('0x8')](),controller['show']);router[_0x8ed9('0xd')]('/',auth['isAuthenticated'](),controller[_0x8ed9('0xe')]);router[_0x8ed9('0xf')](_0x8ed9('0xc'),auth['isAuthenticated'](),controller[_0x8ed9('0x10')]);router[_0x8ed9('0x11')]('/:id',auth[_0x8ed9('0x8')](),controller[_0x8ed9('0x12')]);module[_0x8ed9('0x13')]=router;
\ No newline at end of file
+var _0x1513=['put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','post'];(function(_0x3e4879,_0x4bbfb8){var _0x3c3e0c=function(_0x32cd33){while(--_0x32cd33){_0x3e4879['push'](_0x3e4879['shift']());}};_0x3c3e0c(++_0x4bbfb8);}(_0x1513,0x1a8));var _0x3151=function(_0x4878be,_0x4f0f9b){_0x4878be=_0x4878be-0x0;var _0x35c80b=_0x1513[_0x4878be];return _0x35c80b;};'use strict';var multer=require('multer');var util=require(_0x3151('0x0'));var path=require(_0x3151('0x1'));var timeout=require(_0x3151('0x2'));var express=require(_0x3151('0x3'));var router=express[_0x3151('0x4')]();var fs_extra=require(_0x3151('0x5'));var auth=require(_0x3151('0x6'));var interaction=require(_0x3151('0x7'));var config=require(_0x3151('0x8'));var controller=require(_0x3151('0x9'));router[_0x3151('0xa')]('/',auth[_0x3151('0xb')](),controller['index']);router[_0x3151('0xa')](_0x3151('0xc'),auth[_0x3151('0xb')](),controller[_0x3151('0xd')]);router['get'](_0x3151('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x3151('0xf')]('/',auth[_0x3151('0xb')](),controller['create']);router[_0x3151('0x10')](_0x3151('0xe'),auth['isAuthenticated'](),controller[_0x3151('0x11')]);router['delete'](_0x3151('0xe'),auth[_0x3151('0xb')](),controller[_0x3151('0x12')]);module[_0x3151('0x13')]=router;
\ No newline at end of file
index 8e4ec8a..ab63288 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c8a=['We\x20are\x20here!','Chat','Contact\x20us','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Feedback','star','TEXT','stringify','input','name','parse','getDataValue','onlineForm','textarea','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Skip','alternate','#fafafa','System','mandatoryDispositionPauseId','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded'];(function(_0xd25b59,_0x217f8a){var _0x4cab47=function(_0x26362d){while(--_0x26362d){_0xd25b59['push'](_0xd25b59['shift']());}};_0x4cab47(++_0x217f8a);}(_0x7c8a,0xd4));var _0xa7c8=function(_0x3703fe,_0x10ad36){_0x3703fe=_0x3703fe-0x0;var _0x23c2b0=_0x7c8a[_0x3703fe];return _0x23c2b0;};'use strict';var Sequelize=require(_0xa7c8('0x0'));var rs=require(_0xa7c8('0x1'));module[_0xa7c8('0x2')]={'name':{'type':Sequelize[_0xa7c8('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa7c8('0x4')},'description':{'type':Sequelize[_0xa7c8('0x3')]},'mapKey':{'type':Sequelize[_0xa7c8('0x3')],'defaultValue':_0xa7c8('0x5')},'mapKeyOffline':{'type':Sequelize[_0xa7c8('0x3')],'defaultValue':_0xa7c8('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xa7c8('0x6')},'customerAlias':{'type':Sequelize[_0xa7c8('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xa7c8('0x3')],'allowNull':![],'defaultValue':_0xa7c8('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa7c8('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xa7c8('0x3')],'allowNull':![],'defaultValue':_0xa7c8('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xa7c8('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xa7c8('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xa7c8('0xb')](_0xa7c8('0xc'),'squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xa7c8('0x3')],'defaultValue':_0xa7c8('0xd')},'start_chat_button':{'type':Sequelize[_0xa7c8('0x3')],'defaultValue':_0xa7c8('0xe')},'offline_chat_button':{'type':Sequelize[_0xa7c8('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0xa7c8('0x3')],'defaultValue':_0xa7c8('0xf')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xa7c8('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xa7c8('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xa7c8('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xa7c8('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0xa7c8('0x3')],'defaultValue':_0xa7c8('0x11')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xa7c8('0x12')},'noteTitle':{'type':Sequelize[_0xa7c8('0x3')],'defaultValue':_0xa7c8('0x13')},'placeholderMessage':{'type':Sequelize[_0xa7c8('0x3')],'defaultValue':_0xa7c8('0x14')},'closingMessage':{'type':Sequelize[_0xa7c8('0x3')],'defaultValue':_0xa7c8('0x15')},'closingMessageButton':{'type':Sequelize[_0xa7c8('0x3')],'defaultValue':_0xa7c8('0x16')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0xa7c8('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xa7c8('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xa7c8('0x3')],'defaultValue':_0xa7c8('0x17')},'ratingType':{'type':Sequelize[_0xa7c8('0xb')](_0xa7c8('0x18'),'thumb'),'defaultValue':_0xa7c8('0x18')},'ratingStarsNumber':{'type':Sequelize[_0xa7c8('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xa7c8('0x19')],'defaultValue':function(){return JSON[_0xa7c8('0x1a')]({'items':[{'type':_0xa7c8('0x1b'),'variable':null,'config':{'placeholder':_0xa7c8('0x1c'),'type':'text','required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xa7c8('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xa7c8('0x5'),'type':_0xa7c8('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON[_0xa7c8('0x1d')](this[_0xa7c8('0x1e')](_0xa7c8('0x1f'))):{};},'set':function(_0x3fa600){return this['setDataValue'](_0xa7c8('0x1f'),JSON[_0xa7c8('0x1a')](_0x3fa600));}},'offlineForm':{'type':Sequelize[_0xa7c8('0x19')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xa7c8('0x1b'),'props':{'title':_0xa7c8('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xa7c8('0x5'),'type':_0xa7c8('0x5')},'variable':null},{'type':_0xa7c8('0x20'),'config':{'placeholder':_0xa7c8('0x21')},'props':{'title':_0xa7c8('0x21'),'helpText':_0xa7c8('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0xa7c8('0x1e')](_0xa7c8('0x23'))?JSON[_0xa7c8('0x1d')](this[_0xa7c8('0x1e')]('offlineForm')):{};},'set':function(_0x1e5558){return this[_0xa7c8('0x24')](_0xa7c8('0x23'),JSON[_0xa7c8('0x1a')](_0x1e5558));}},'token':{'type':Sequelize[_0xa7c8('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xa7c8('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xa7c8('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xa7c8('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xa7c8('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xa7c8('0x25')},'waitingMessage':{'type':Sequelize[_0xa7c8('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xa7c8('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xa7c8('0x3')],'defaultValue':_0xa7c8('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0xa7c8('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xa7c8('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xa7c8('0x3')],'defaultValue':_0xa7c8('0x27')},'sendUnmanaged':{'type':Sequelize[_0xa7c8('0x3')],'defaultValue':_0xa7c8('0x16')},'enableCustomerAttachment':{'type':Sequelize[_0xa7c8('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xa7c8('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0xa7c8('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xa7c8('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xa7c8('0x3')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xa7c8('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xa7c8('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0xa7c8('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xa7c8('0x28')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xa7c8('0x19')]},'showCustomerAvatar':{'type':Sequelize[_0xa7c8('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xa7c8('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xa7c8('0x3')],'allowNull':![],'defaultValue':_0xa7c8('0x29'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xa7c8('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa7c8('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa7c8('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa7c8('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xa7c8('0x3')],'defaultValue':_0xa7c8('0x2a')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa7c8('0x9')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xa7c8('0xa')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x10a2b6){if(!_0x10a2b6)this[_0xa7c8('0x24')](_0xa7c8('0x2b'),null);this[_0xa7c8('0x24')]('mandatoryDisposition',_0x10a2b6);}},'vidaooEscalation':{'type':Sequelize[_0xa7c8('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0xa7c8('0x3')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0xa7c8('0x3')],'defaultValue':function(){return _0xa7c8('0x2c');}},'vidaooMetadata':{'type':Sequelize[_0xa7c8('0x19')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xa7c8('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x60fe=['Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','bottom_right','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','TEXT','stringify','text','name','input','getDataValue','onlineForm','parse','setDataValue','textarea'];(function(_0x233ccb,_0x1b4138){var _0x390588=function(_0x227348){while(--_0x227348){_0x233ccb['push'](_0x233ccb['shift']());}};_0x390588(++_0x1b4138);}(_0x60fe,0x1ee));var _0xe60f=function(_0x562163,_0x264e2a){_0x562163=_0x562163-0x0;var _0x551eed=_0x60fe[_0x562163];return _0x551eed;};'use strict';var Sequelize=require(_0xe60f('0x0'));var rs=require('randomstring');module[_0xe60f('0x1')]={'name':{'type':Sequelize[_0xe60f('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xe60f('0x2')],'allowNull':![],'unique':_0xe60f('0x3')},'description':{'type':Sequelize[_0xe60f('0x2')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xe60f('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xe60f('0x4')},'key':{'type':Sequelize[_0xe60f('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xe60f('0x2')],'defaultValue':_0xe60f('0x5')},'customerAlias':{'type':Sequelize[_0xe60f('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xe60f('0x2')],'allowNull':![],'defaultValue':_0xe60f('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xe60f('0x2')],'allowNull':![],'defaultValue':_0xe60f('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xe60f('0x2')],'allowNull':![],'defaultValue':_0xe60f('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xe60f('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xe60f('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xe60f('0xa')](_0xe60f('0xb'),'squared'),'defaultValue':_0xe60f('0xb')},'header_online':{'type':Sequelize[_0xe60f('0x2')],'defaultValue':_0xe60f('0xc')},'start_chat_button':{'type':Sequelize[_0xe60f('0x2')],'defaultValue':_0xe60f('0xd')},'offline_chat_button':{'type':Sequelize[_0xe60f('0x2')],'defaultValue':_0xe60f('0xe')},'header_offline':{'type':Sequelize[_0xe60f('0x2')],'defaultValue':_0xe60f('0xf')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xe60f('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xe60f('0x2')],'defaultValue':_0xe60f('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0xe60f('0x2')],'defaultValue':_0xe60f('0x11')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xe60f('0x12')},'noteTitle':{'type':Sequelize[_0xe60f('0x2')],'defaultValue':_0xe60f('0x13')},'placeholderMessage':{'type':Sequelize[_0xe60f('0x2')],'defaultValue':_0xe60f('0x14')},'closingMessage':{'type':Sequelize[_0xe60f('0x2')],'defaultValue':_0xe60f('0x15')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xe60f('0x2')],'defaultValue':_0xe60f('0x16')},'conditionAgreement':{'type':Sequelize[_0xe60f('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xe60f('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xe60f('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xe60f('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xe60f('0x2')],'defaultValue':_0xe60f('0x17')},'ratingType':{'type':Sequelize[_0xe60f('0xa')](_0xe60f('0x18'),_0xe60f('0x19')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xe60f('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xe60f('0x1a')],'defaultValue':function(){return JSON[_0xe60f('0x1b')]({'items':[{'type':'input','variable':null,'config':{'placeholder':'name','type':_0xe60f('0x1c'),'required':!![]},'props':{'title':_0xe60f('0x1d'),'helpText':''}},{'type':_0xe60f('0x1e'),'props':{'title':_0xe60f('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xe60f('0x4'),'type':_0xe60f('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xe60f('0x1f')](_0xe60f('0x20'))?JSON[_0xe60f('0x21')](this[_0xe60f('0x1f')]('onlineForm')):{};},'set':function(_0x1148cb){return this[_0xe60f('0x22')](_0xe60f('0x20'),JSON[_0xe60f('0x1b')](_0x1148cb));}},'offlineForm':{'type':Sequelize[_0xe60f('0x1a')],'defaultValue':function(){return JSON[_0xe60f('0x1b')]({'items':[{'type':_0xe60f('0x1e'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xe60f('0x4'),'type':_0xe60f('0x4')},'variable':null},{'type':_0xe60f('0x23'),'config':{'placeholder':'Comments'},'props':{'title':_0xe60f('0x24'),'helpText':_0xe60f('0x25')}}],'fromKey':0x0});},'get':function(){return this[_0xe60f('0x1f')]('offlineForm')?JSON[_0xe60f('0x21')](this[_0xe60f('0x1f')]('offlineForm')):{};},'set':function(_0x4a0a59){return this[_0xe60f('0x22')](_0xe60f('0x26'),JSON['stringify'](_0x4a0a59));}},'token':{'type':Sequelize[_0xe60f('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xe60f('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xe60f('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0xe60f('0x2')],'defaultValue':_0xe60f('0x27')},'waitingMessage':{'type':Sequelize[_0xe60f('0x2')],'defaultValue':_0xe60f('0x28')},'offlineMessageSubject':{'type':Sequelize[_0xe60f('0x2')],'defaultValue':_0xe60f('0x29')},'offlineMessageBody':{'type':Sequelize[_0xe60f('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xe60f('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xe60f('0x2')],'defaultValue':_0xe60f('0x2a')},'skipUnmanaged':{'type':Sequelize[_0xe60f('0x2')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xe60f('0x2')],'defaultValue':_0xe60f('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0xe60f('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xe60f('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xe60f('0x1a')]},'showAgentAvatar':{'type':Sequelize[_0xe60f('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xe60f('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xe60f('0x2b');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe60f('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xe60f('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xe60f('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xe60f('0x2')],'defaultValue':_0xe60f('0x2c')},'verticalAlignment':{'type':Sequelize[_0xe60f('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xe60f('0x2d')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xe60f('0x1a')]},'showCustomerAvatar':{'type':Sequelize[_0xe60f('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xe60f('0x2')],'allowNull':![],'defaultValue':_0xe60f('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe60f('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe60f('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xe60f('0x2')],'defaultValue':_0xe60f('0x2f')},'systemAvatar':{'type':Sequelize[_0xe60f('0x1a')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe60f('0x8')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xe60f('0x9')],'defaultValue':![],'comment':_0xe60f('0x30'),'set':function(_0x2554ae){if(!_0x2554ae)this['setDataValue'](_0xe60f('0x31'),null);this[_0xe60f('0x22')](_0xe60f('0x32'),_0x2554ae);}},'vidaooEscalation':{'type':Sequelize[_0xe60f('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xe60f('0x2')]},'vidaooTopic':{'type':Sequelize[_0xe60f('0x2')],'allowNull':![],'defaultValue':_0xe60f('0x33')},'vidaooNote':{'type':Sequelize[_0xe60f('0x2')],'defaultValue':function(){return _0xe60f('0x34');}},'vidaooMetadata':{'type':Sequelize[_0xe60f('0x1a')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xe60f('0x1a')]}};
\ No newline at end of file
index c817b45..d41185e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57cf=['redis','socket.io-emitter','html-to-text','jayson/promise','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','UserProfileResource','end','stack','name','send','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','ChatWebsite','findAll','show','params','keys','includeAll','include','create','body','get','role','user','ChatWebsites','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','length','rows','removeDispositions','ids','pick','CannedAnswer','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','customerAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','getResult','chat','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','ChatApplication','account','applications','Applications','list','asc','Contacts','defaults','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','browser','version','format','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','contact','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','service','host','port','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','email','toPairsIn','mapValues','offlineMessageSubject','NotifyMailAccount','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Owner','fullname','Tag','Tags','tag','getSnippet','timezone','iftime\x20%s','interval','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','License','increment','chatLicenseExceeded','some','readFileSync','server/files/chat/iframe.ejs','remote','x-real-ip','remoteAddress','referer','virtual','replace','alignment','color','textColor','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','priority','finally','getApplications','ChatProactiveAction','getFields','false','offlineForm','onlineForm','items','fromKey','Contact','Attachments','addAgents','spread','emit','removeAgents','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','api','../../mysqldb'];(function(_0x1316a9,_0x15fbb1){var _0xdcc0ae=function(_0x1cfed4){while(--_0x1cfed4){_0x1316a9['push'](_0x1316a9['shift']());}};_0xdcc0ae(++_0x15fbb1);}(_0x57cf,0x11b));var _0xf57c=function(_0x581af1,_0x4f02c5){_0x581af1=_0x581af1-0x0;var _0x54c22e=_0x57cf[_0x581af1];return _0x54c22e;};'use strict';var BPromise=require(_0xf57c('0x0'));var Mustache=require(_0xf57c('0x1'));var util=require(_0xf57c('0x2'));var path=require(_0xf57c('0x3'));var ejs=require(_0xf57c('0x4'));var fs=require('fs');var fs_extra=require(_0xf57c('0x5'));var _=require(_0xf57c('0x6'));var querystring=require(_0xf57c('0x7'));var Redis=require(_0xf57c('0x8'));var qs=require(_0xf57c('0x9'));var logger=require('../../config/logger')(_0xf57c('0xa'));var config=require('../../config/environment');var db=require(_0xf57c('0xb'))['db'];config['redis']=_['defaults'](config[_0xf57c('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xf57c('0xd'))(new Redis(config[_0xf57c('0xc')]));require('./chatWebsite.socket')['register'](socket);var htmlToText=require(_0xf57c('0xe'));var jayson=require(_0xf57c('0xf'));var client=jayson[_0xf57c('0x10')][_0xf57c('0x11')]({'port':0x232c});var client9002=jayson['client'][_0xf57c('0x11')]({'port':0x232a});var client9003=jayson[_0xf57c('0x10')][_0xf57c('0x11')]({'port':0x232b});var client9001=jayson['client'][_0xf57c('0x11')]({'port':0x2329});function respondWithRpcPromise(_0x48b55c,_0x27de1b,_0x15e264,_0x4cc38b){return new BPromise(function(_0x33e14e,_0x5d635d){var _0x71267f=_0x4cc38b||client;return _0x71267f['request'](_0x48b55c,_0x15e264)[_0xf57c('0x12')](function(_0xc56c5){logger[_0xf57c('0x13')](_0xf57c('0x14'),_0x27de1b,_0xf57c('0x15'));logger[_0xf57c('0x16')](_0xf57c('0x17'),_0x27de1b,_0xf57c('0x15'),JSON['stringify'](_0xc56c5));if(_0xc56c5[_0xf57c('0x18')]){if(_0xc56c5['error'][_0xf57c('0x19')]===0x1f4){logger[_0xf57c('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x27de1b,_0xc56c5[_0xf57c('0x18')][_0xf57c('0x1a')]);return _0x5d635d(_0xc56c5[_0xf57c('0x18')][_0xf57c('0x1a')]);}logger[_0xf57c('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x27de1b,_0xc56c5[_0xf57c('0x18')][_0xf57c('0x1a')]);return _0x33e14e(_0xc56c5[_0xf57c('0x18')]['message']);}else{logger['info'](_0xf57c('0x14'),_0x27de1b,_0xf57c('0x15'));_0x33e14e(_0xc56c5[_0xf57c('0x1b')][_0xf57c('0x1a')]);}})[_0xf57c('0x1c')](function(_0x341fb8){logger[_0xf57c('0x18')](_0xf57c('0x14'),_0x27de1b,_0x341fb8);_0x5d635d(_0x341fb8);});});}function respondWithStatusCode(_0xf3baee,_0x50b440){_0x50b440=_0x50b440||0xcc;return function(_0x42c9ef){if(_0x42c9ef){return _0xf3baee[_0xf57c('0x1d')](_0x50b440);}return _0xf3baee['status'](_0x50b440)['end']();};}function respondWithResult(_0x3c4923,_0x53ea83){_0x53ea83=_0x53ea83||0xc8;return function(_0x1741cd){if(_0x1741cd){return _0x3c4923[_0xf57c('0x1e')](_0x53ea83)[_0xf57c('0x1f')](_0x1741cd);}};}function respondWithFilteredResult(_0x584bc3,_0xc70f3e){return function(_0x195ae5){if(_0x195ae5){var _0x5e3a89=typeof _0xc70f3e[_0xf57c('0x20')]===_0xf57c('0x21')&&typeof _0xc70f3e[_0xf57c('0x22')]===_0xf57c('0x21');var _0x3b14f9=_0x195ae5[_0xf57c('0x23')];var _0x21028e=_0x5e3a89?0x0:_0xc70f3e[_0xf57c('0x20')];var _0x1f1b40=_0x5e3a89?_0x195ae5['count']:_0xc70f3e[_0xf57c('0x20')]+_0xc70f3e[_0xf57c('0x22')];var _0x56726f;if(_0x1f1b40>=_0x3b14f9){_0x1f1b40=_0x3b14f9;_0x56726f=0xc8;}else{_0x56726f=0xce;}_0x584bc3[_0xf57c('0x1e')](_0x56726f);return _0x584bc3[_0xf57c('0x24')](_0xf57c('0x25'),_0x21028e+'-'+_0x1f1b40+'/'+_0x3b14f9)[_0xf57c('0x1f')](_0x195ae5);}return null;};}function saveUpdates(_0x33ee51){return function(_0x3bf095){if(_0x3bf095){return _0x3bf095[_0xf57c('0x26')](_0x33ee51)[_0xf57c('0x12')](function(_0x1c01a3){return _0x1c01a3;});}return null;};}function removeEntity(_0x3d79a8){return function(_0x49208b){if(_0x49208b){return _0x49208b[_0xf57c('0x27')]()[_0xf57c('0x12')](function(){var _0xad694c=_0x49208b['get']({'plain':!![]});var _0x50494d='ChatWebsites';return db[_0xf57c('0x28')][_0xf57c('0x27')]({'where':{'type':_0x50494d,'resourceId':_0xad694c['id']}})[_0xf57c('0x12')](function(){return _0x49208b;});})[_0xf57c('0x12')](function(){_0x3d79a8['status'](0xcc)[_0xf57c('0x29')]();});}};}function handleEntityNotFound(_0xccff8){return function(_0x3bd004){if(!_0x3bd004){_0xccff8['sendStatus'](0x194);}return _0x3bd004;};}function handleError(_0x4560a2,_0x3d7376){_0x3d7376=_0x3d7376||0x1f4;return function(_0x1f57cb){logger[_0xf57c('0x18')](_0x1f57cb[_0xf57c('0x2a')]);if(_0x1f57cb[_0xf57c('0x2b')]){delete _0x1f57cb['name'];}_0x4560a2[_0xf57c('0x1e')](_0x3d7376)[_0xf57c('0x2c')](_0x1f57cb);};}exports['index']=function(_0x533795,_0x3c4a0f){var _0x4befc1={'include':[{'model':db[_0xf57c('0x2d')],'as':_0xf57c('0x2e')}]},_0x422b47={},_0x5c9c3e={'count':0x0,'rows':[]};var _0x17e8dc=_[_0xf57c('0x2f')](db['ChatWebsite'][_0xf57c('0x30')],function(_0x4beee3){return{'name':_0x4beee3[_0xf57c('0x31')],'type':_0x4beee3[_0xf57c('0x32')][_0xf57c('0x33')]};});_0x422b47[_0xf57c('0x34')]=_[_0xf57c('0x2f')](_0x17e8dc,_0xf57c('0x2b'));_0x422b47['query']=_['keys'](_0x533795[_0xf57c('0x35')]);_0x422b47[_0xf57c('0x36')]=_[_0xf57c('0x37')](_0x422b47['model'],_0x422b47[_0xf57c('0x35')]);_0x4befc1['attributes']=_[_0xf57c('0x37')](_0x422b47[_0xf57c('0x34')],qs[_0xf57c('0x38')](_0x533795['query'][_0xf57c('0x38')]));_0x4befc1['attributes']=_0x4befc1[_0xf57c('0x39')]['length']?_0x4befc1[_0xf57c('0x39')]:_0x422b47[_0xf57c('0x34')];if(!_0x533795[_0xf57c('0x35')][_0xf57c('0x3a')](_0xf57c('0x3b'))){_0x4befc1['limit']=qs[_0xf57c('0x22')](_0x533795[_0xf57c('0x35')][_0xf57c('0x22')]);_0x4befc1[_0xf57c('0x20')]=qs[_0xf57c('0x20')](_0x533795[_0xf57c('0x35')][_0xf57c('0x20')]);}_0x4befc1[_0xf57c('0x3c')]=qs[_0xf57c('0x3d')](_0x533795['query'][_0xf57c('0x3d')]);_0x4befc1[_0xf57c('0x3e')]=qs[_0xf57c('0x36')](_['pick'](_0x533795[_0xf57c('0x35')],_0x422b47[_0xf57c('0x36')]),_0x17e8dc);if(_0x533795[_0xf57c('0x35')][_0xf57c('0x3f')]){_0x4befc1[_0xf57c('0x3e')]=_[_0xf57c('0x40')](_0x4befc1[_0xf57c('0x3e')],{'$or':_[_0xf57c('0x2f')](_0x17e8dc,function(_0x29f285){if(_0x29f285['type']!==_0xf57c('0x41')){var _0xefe37f={};_0xefe37f[_0x29f285[_0xf57c('0x2b')]]={'$like':'%'+_0x533795[_0xf57c('0x35')]['filter']+'%'};return _0xefe37f;}})});}_0x4befc1=_['merge']({},_0x4befc1,_0x533795[_0xf57c('0x42')]);var _0x89b280={'where':_0x4befc1[_0xf57c('0x3e')]};return db[_0xf57c('0x43')][_0xf57c('0x23')](_0x89b280)[_0xf57c('0x12')](function(_0x582fd3){_0x5c9c3e['count']=_0x582fd3;if(_0x533795[_0xf57c('0x35')]['includeAll']){_0x4befc1['include']=[{'all':!![]}];}return db[_0xf57c('0x43')][_0xf57c('0x44')](_0x4befc1);})[_0xf57c('0x12')](function(_0x2731d3){_0x5c9c3e['rows']=_0x2731d3;return _0x5c9c3e;})[_0xf57c('0x12')](respondWithFilteredResult(_0x3c4a0f,_0x4befc1))[_0xf57c('0x1c')](handleError(_0x3c4a0f,null));};exports[_0xf57c('0x45')]=function(_0x5ebcdc,_0x4fb83e){var _0x376032={'raw':![],'where':{'id':_0x5ebcdc[_0xf57c('0x46')]['id']},'include':[{'model':db[_0xf57c('0x2d')],'as':_0xf57c('0x2e')}]},_0xf48fe8={};_0xf48fe8[_0xf57c('0x34')]=_['keys'](db['ChatWebsite'][_0xf57c('0x30')]);_0xf48fe8[_0xf57c('0x35')]=_[_0xf57c('0x47')](_0x5ebcdc[_0xf57c('0x35')]);_0xf48fe8[_0xf57c('0x36')]=_['intersection'](_0xf48fe8[_0xf57c('0x34')],_0xf48fe8['query']);_0x376032[_0xf57c('0x39')]=_[_0xf57c('0x37')](_0xf48fe8[_0xf57c('0x34')],qs[_0xf57c('0x38')](_0x5ebcdc[_0xf57c('0x35')][_0xf57c('0x38')]));_0x376032['attributes']=_0x376032[_0xf57c('0x39')]['length']?_0x376032[_0xf57c('0x39')]:_0xf48fe8[_0xf57c('0x34')];if(_0x5ebcdc['query'][_0xf57c('0x48')]){_0x376032[_0xf57c('0x49')]=[{'all':!![]}];}_0x376032=_[_0xf57c('0x40')]({},_0x376032,_0x5ebcdc[_0xf57c('0x42')]);return db[_0xf57c('0x43')]['find'](_0x376032)[_0xf57c('0x12')](handleEntityNotFound(_0x4fb83e,null))['then'](respondWithResult(_0x4fb83e,null))['catch'](handleError(_0x4fb83e,null));};exports[_0xf57c('0x4a')]=function(_0x17e9ba,_0x271915){return db['ChatWebsite'][_0xf57c('0x4a')](_0x17e9ba[_0xf57c('0x4b')],{})[_0xf57c('0x12')](function(_0x3bf0a2){var _0x50776c=_0x17e9ba['user'][_0xf57c('0x4c')]({'plain':!![]});if(!_0x50776c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x50776c[_0xf57c('0x4d')]===_0xf57c('0x4e')){var _0x1862f3=_0x3bf0a2['get']({'plain':!![]});var _0x48cfa0=_0xf57c('0x4f');return db[_0xf57c('0x50')][_0xf57c('0x51')]({'where':{'name':_0x48cfa0,'userProfileId':_0x50776c[_0xf57c('0x52')]},'raw':!![]})[_0xf57c('0x12')](function(_0x251b77){if(_0x251b77&&_0x251b77[_0xf57c('0x53')]===0x0){return db[_0xf57c('0x28')][_0xf57c('0x4a')]({'name':_0x1862f3[_0xf57c('0x2b')],'resourceId':_0x1862f3['id'],'type':_0x251b77[_0xf57c('0x2b')],'sectionId':_0x251b77['id']},{})[_0xf57c('0x12')](function(){return _0x3bf0a2;});}else{return _0x3bf0a2;}})[_0xf57c('0x1c')](function(_0x36514e){logger[_0xf57c('0x18')](_0xf57c('0x54'),_0x36514e);throw _0x36514e;});}return _0x3bf0a2;})[_0xf57c('0x12')](respondWithResult(_0x271915,0xc9))[_0xf57c('0x1c')](handleError(_0x271915,null));};exports['update']=function(_0x512a24,_0x2b93dc){if(_0x512a24['body']['id']){delete _0x512a24[_0xf57c('0x4b')]['id'];}return db[_0xf57c('0x43')][_0xf57c('0x51')]({'where':{'id':_0x512a24[_0xf57c('0x46')]['id']},'include':[{'model':db['Pause'],'as':_0xf57c('0x2e')}]})['then'](handleEntityNotFound(_0x2b93dc,null))[_0xf57c('0x12')](saveUpdates(_0x512a24[_0xf57c('0x4b')],null))[_0xf57c('0x12')](respondWithResult(_0x2b93dc,null))[_0xf57c('0x1c')](handleError(_0x2b93dc,null));};exports[_0xf57c('0x27')]=function(_0x91ef5d,_0x146c87){return db['ChatWebsite'][_0xf57c('0x51')]({'where':{'id':_0x91ef5d[_0xf57c('0x46')]['id']}})[_0xf57c('0x12')](handleEntityNotFound(_0x146c87,null))[_0xf57c('0x12')](removeEntity(_0x146c87,null))['catch'](handleError(_0x146c87,null));};exports['describe']=function(_0x3cf75d,_0x2fb2d8){return db[_0xf57c('0x43')][_0xf57c('0x55')]()[_0xf57c('0x12')](respondWithResult(_0x2fb2d8,null))[_0xf57c('0x1c')](handleError(_0x2fb2d8,null));};exports[_0xf57c('0x56')]=function(_0x163568,_0x21096c){if(_0x163568[_0xf57c('0x4b')]['id']){delete _0x163568[_0xf57c('0x4b')]['id'];}return db[_0xf57c('0x43')][_0xf57c('0x51')]({'where':{'id':_0x163568[_0xf57c('0x46')]['id']}})[_0xf57c('0x12')](handleEntityNotFound(_0x21096c,null))[_0xf57c('0x12')](function(_0x242fea){if(_0x242fea){_0x163568[_0xf57c('0x4b')][_0xf57c('0x57')]=_0x242fea['id'];return db[_0xf57c('0x58')][_0xf57c('0x4a')](_0x163568[_0xf57c('0x4b')]);}})[_0xf57c('0x12')](respondWithResult(_0x21096c,null))[_0xf57c('0x1c')](handleError(_0x21096c,null));};exports[_0xf57c('0x59')]=function(_0x32b79d,_0x24c11e){var _0x5f3a5d={'raw':![],'where':{}};var _0x1dc29e={};var _0x5244f7={'count':0x0,'rows':[]};return db[_0xf57c('0x43')][_0xf57c('0x5a')]({'where':{'id':_0x32b79d[_0xf57c('0x46')]['id']}})[_0xf57c('0x12')](handleEntityNotFound(_0x24c11e,null))['then'](function(_0x4f8683){if(_0x4f8683){_0x1dc29e[_0xf57c('0x34')]=_[_0xf57c('0x47')](db['Disposition'][_0xf57c('0x30')]);_0x1dc29e['query']=_[_0xf57c('0x47')](_0x32b79d['query']);_0x1dc29e['filters']=_[_0xf57c('0x37')](_0x1dc29e[_0xf57c('0x34')],_0x1dc29e[_0xf57c('0x35')]);_0x5f3a5d[_0xf57c('0x39')]=_[_0xf57c('0x37')](_0x1dc29e['model'],qs['fields'](_0x32b79d[_0xf57c('0x35')]['fields']));_0x5f3a5d[_0xf57c('0x39')]=_0x5f3a5d['attributes'][_0xf57c('0x5b')]?_0x5f3a5d[_0xf57c('0x39')]:_0x1dc29e[_0xf57c('0x34')];if(!_0x32b79d['query'][_0xf57c('0x3a')](_0xf57c('0x3b'))){_0x5f3a5d['limit']=qs[_0xf57c('0x22')](_0x32b79d[_0xf57c('0x35')][_0xf57c('0x22')]);_0x5f3a5d[_0xf57c('0x20')]=qs[_0xf57c('0x20')](_0x32b79d[_0xf57c('0x35')]['offset']);}_0x5f3a5d[_0xf57c('0x3c')]=qs[_0xf57c('0x3d')](_0x32b79d[_0xf57c('0x35')][_0xf57c('0x3d')]);_0x5f3a5d['where']=qs[_0xf57c('0x36')](_['pick'](_0x32b79d[_0xf57c('0x35')],_0x1dc29e[_0xf57c('0x36')]));_0x5f3a5d['where'][_0xf57c('0x57')]=_0x4f8683['id'];if(_0x32b79d[_0xf57c('0x35')][_0xf57c('0x3f')]){_0x5f3a5d[_0xf57c('0x3e')]=_[_0xf57c('0x40')](_0x5f3a5d[_0xf57c('0x3e')],{'$or':_[_0xf57c('0x2f')](_0x5f3a5d[_0xf57c('0x39')],function(_0x3a60e4){var _0x4a475a={};_0x4a475a[_0x3a60e4]={'$like':'%'+_0x32b79d[_0xf57c('0x35')][_0xf57c('0x3f')]+'%'};return _0x4a475a;})});}_0x5f3a5d=_['merge']({},_0x5f3a5d,_0x32b79d[_0xf57c('0x42')]);return db['Disposition'][_0xf57c('0x23')]({'where':_0x5f3a5d['where']})['then'](function(_0x10b852){_0x5244f7[_0xf57c('0x23')]=_0x10b852;if(_0x32b79d['query'][_0xf57c('0x48')]){_0x5f3a5d[_0xf57c('0x49')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x5f3a5d);})[_0xf57c('0x12')](function(_0x33a61c){_0x5244f7[_0xf57c('0x5c')]=_0x33a61c;return _0x5244f7;});}})[_0xf57c('0x12')](respondWithFilteredResult(_0x24c11e,_0x5f3a5d))[_0xf57c('0x1c')](handleError(_0x24c11e,null));};exports[_0xf57c('0x5d')]=function(_0x4ffe11,_0x448115){return db[_0xf57c('0x43')]['find']({'where':{'id':_0x4ffe11[_0xf57c('0x46')]['id']}})[_0xf57c('0x12')](handleEntityNotFound(_0x448115,null))[_0xf57c('0x12')](function(_0x3344a2){if(_0x3344a2){return _0x3344a2[_0xf57c('0x5d')](_0x4ffe11[_0xf57c('0x35')][_0xf57c('0x5e')]);}})[_0xf57c('0x12')](respondWithStatusCode(_0x448115,null))['catch'](handleError(_0x448115,null));};exports['addAnswer']=function(_0x1429a6,_0x444897){if(_0x1429a6['body']['id']){delete _0x1429a6['body']['id'];}return db[_0xf57c('0x43')][_0xf57c('0x51')]({'where':{'id':_0x1429a6['params']['id']}})[_0xf57c('0x12')](handleEntityNotFound(_0x444897,null))[_0xf57c('0x12')](function(_0x307c60){if(_0x307c60){_0x1429a6[_0xf57c('0x4b')]['ChatWebsiteId']=_0x307c60['id'];return db['CannedAnswer'][_0xf57c('0x4a')](_0x1429a6[_0xf57c('0x4b')]);}})[_0xf57c('0x12')](respondWithResult(_0x444897,null))[_0xf57c('0x1c')](handleError(_0x444897,null));};exports['getAnswers']=function(_0x48fc93,_0x4f4451){var _0x4338dd={'raw':![],'where':{}};var _0x22aeeb={};var _0x3695f7={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x48fc93['params']['id']}})[_0xf57c('0x12')](handleEntityNotFound(_0x4f4451,null))[_0xf57c('0x12')](function(_0x5b45d4){if(_0x5b45d4){_0x22aeeb['model']=_[_0xf57c('0x47')](db['CannedAnswer'][_0xf57c('0x30')]);_0x22aeeb[_0xf57c('0x35')]=_['keys'](_0x48fc93['query']);_0x22aeeb[_0xf57c('0x36')]=_[_0xf57c('0x37')](_0x22aeeb[_0xf57c('0x34')],_0x22aeeb[_0xf57c('0x35')]);_0x4338dd[_0xf57c('0x39')]=_[_0xf57c('0x37')](_0x22aeeb[_0xf57c('0x34')],qs[_0xf57c('0x38')](_0x48fc93[_0xf57c('0x35')][_0xf57c('0x38')]));_0x4338dd[_0xf57c('0x39')]=_0x4338dd['attributes'][_0xf57c('0x5b')]?_0x4338dd['attributes']:_0x22aeeb['model'];if(!_0x48fc93[_0xf57c('0x35')][_0xf57c('0x3a')](_0xf57c('0x3b'))){_0x4338dd[_0xf57c('0x22')]=qs[_0xf57c('0x22')](_0x48fc93[_0xf57c('0x35')][_0xf57c('0x22')]);_0x4338dd[_0xf57c('0x20')]=qs['offset'](_0x48fc93[_0xf57c('0x35')][_0xf57c('0x20')]);}_0x4338dd[_0xf57c('0x3c')]=qs[_0xf57c('0x3d')](_0x48fc93[_0xf57c('0x35')][_0xf57c('0x3d')]);_0x4338dd['where']=qs[_0xf57c('0x36')](_[_0xf57c('0x5f')](_0x48fc93[_0xf57c('0x35')],_0x22aeeb['filters']));_0x4338dd[_0xf57c('0x3e')]['ChatWebsiteId']=_0x5b45d4['id'];if(_0x48fc93['query'][_0xf57c('0x3f')]){_0x4338dd[_0xf57c('0x3e')]=_[_0xf57c('0x40')](_0x4338dd[_0xf57c('0x3e')],{'$or':_[_0xf57c('0x2f')](_0x4338dd[_0xf57c('0x39')],function(_0x43b182){var _0x5ae60e={};_0x5ae60e[_0x43b182]={'$like':'%'+_0x48fc93[_0xf57c('0x35')][_0xf57c('0x3f')]+'%'};return _0x5ae60e;})});}_0x4338dd=_[_0xf57c('0x40')]({},_0x4338dd,_0x48fc93['options']);return db['CannedAnswer'][_0xf57c('0x23')]({'where':_0x4338dd[_0xf57c('0x3e')]})[_0xf57c('0x12')](function(_0x113701){_0x3695f7[_0xf57c('0x23')]=_0x113701;if(_0x48fc93[_0xf57c('0x35')][_0xf57c('0x48')]){_0x4338dd[_0xf57c('0x49')]=[{'all':!![]}];}return db[_0xf57c('0x60')][_0xf57c('0x44')](_0x4338dd);})[_0xf57c('0x12')](function(_0x29c39a){_0x3695f7['rows']=_0x29c39a;return _0x3695f7;});}})[_0xf57c('0x12')](respondWithFilteredResult(_0x4f4451,_0x4338dd))['catch'](handleError(_0x4f4451,null));};exports['removeAnswers']=function(_0xc5ba93,_0x4635ce){return db['ChatWebsite']['find']({'where':{'id':_0xc5ba93[_0xf57c('0x46')]['id']}})[_0xf57c('0x12')](handleEntityNotFound(_0x4635ce,null))[_0xf57c('0x12')](function(_0x8b50e3){if(_0x8b50e3){return _0x8b50e3['removeAnswers'](_0xc5ba93[_0xf57c('0x35')][_0xf57c('0x5e')]);}})[_0xf57c('0x12')](respondWithStatusCode(_0x4635ce,null))[_0xf57c('0x1c')](handleError(_0x4635ce,null));};exports[_0xf57c('0x61')]=function(_0xa3d492,_0x226a02){_0xa3d492[_0xf57c('0x4b')][_0xf57c('0x62')]=_0xa3d492[_0xf57c('0x63')][_0xf57c('0x64')];return db['ChatWebsite'][_0xf57c('0x51')]({'where':{'id':_0xa3d492[_0xf57c('0x46')]['id']}})[_0xf57c('0x12')](handleEntityNotFound(_0x226a02,null))[_0xf57c('0x12')](saveUpdates(_0xa3d492[_0xf57c('0x4b')],null))[_0xf57c('0x12')](respondWithResult(_0x226a02,null))['catch'](handleError(_0x226a02,null));};exports[_0xf57c('0x65')]=function(_0x37510f,_0x10215d){_0x37510f[_0xf57c('0x4b')][_0xf57c('0x66')]=_0x37510f[_0xf57c('0x63')][_0xf57c('0x64')];return db['ChatWebsite']['find']({'where':{'id':_0x37510f['params']['id']}})['then'](handleEntityNotFound(_0x10215d,null))[_0xf57c('0x12')](saveUpdates(_0x37510f['body'],null))['then'](respondWithResult(_0x10215d,null))['catch'](handleError(_0x10215d,null));};exports[_0xf57c('0x67')]=function(_0x2bb94b,_0x4f0de8){_0x2bb94b[_0xf57c('0x4b')]['customerAvatar']=_0x2bb94b[_0xf57c('0x63')][_0xf57c('0x64')];return db[_0xf57c('0x43')][_0xf57c('0x51')]({'where':{'id':_0x2bb94b[_0xf57c('0x46')]['id']}})[_0xf57c('0x12')](handleEntityNotFound(_0x4f0de8,null))[_0xf57c('0x12')](saveUpdates(_0x2bb94b[_0xf57c('0x4b')],null))['then'](respondWithResult(_0x4f0de8,null))['catch'](handleError(_0x4f0de8,null));};exports[_0xf57c('0x68')]=function(_0xe1d33e,_0x3815e7){_0xe1d33e[_0xf57c('0x4b')][_0xf57c('0x69')]=_0xe1d33e[_0xf57c('0x63')]['filename'];return db[_0xf57c('0x43')][_0xf57c('0x51')]({'where':{'id':_0xe1d33e['params']['id']}})[_0xf57c('0x12')](handleEntityNotFound(_0x3815e7,null))[_0xf57c('0x12')](saveUpdates(_0xe1d33e[_0xf57c('0x4b')],null))[_0xf57c('0x12')](respondWithResult(_0x3815e7,null))[_0xf57c('0x1c')](handleError(_0x3815e7,null));};exports[_0xf57c('0x6a')]=function(_0x1ce61e,_0x26ee83){var _0x4d39f6=path['join'](config[_0xf57c('0x6b')],_0xf57c('0x6c'));var _0x2ee4e3={'where':{'id':_0x1ce61e['params']['id']},'attributes':['id',_0xf57c('0x62')],'raw':!![]};var _0xcb8a5b=![];return require(_0xf57c('0x6d'))[_0xf57c('0x6e')]()[_0xf57c('0x12')](function(_0x5496cd){if(_0x5496cd){_0xcb8a5b=_0x5496cd[_0xf57c('0x6f')];}})[_0xf57c('0x12')](function(){return db['ChatWebsite']['find'](_0x2ee4e3);})[_0xf57c('0x12')](handleEntityNotFound(_0x26ee83,null))[_0xf57c('0x12')](function(_0x1965c4){if(_0x1965c4){if(!_[_0xf57c('0x70')](_0x1965c4[_0xf57c('0x62')])){if(fs[_0xf57c('0x71')](path[_0xf57c('0x72')](config['root'],_0xf57c('0x73'),_0x1965c4['sitepic']))&&_0xcb8a5b){_0x4d39f6=path[_0xf57c('0x72')](config[_0xf57c('0x6b')],'server/files/images/logos/',_0x1965c4[_0xf57c('0x62')]);}}return _0x26ee83[_0xf57c('0x74')](_0x4d39f6);}})['catch'](handleError(_0x26ee83,null));};exports[_0xf57c('0x75')]=function(_0x3f9fd4,_0x2bd83a){var _0x30d823=path['join'](config['root'],_0xf57c('0x76'));var _0x27eb20={'where':{'id':_0x3f9fd4[_0xf57c('0x46')]['id']},'attributes':['id',_0xf57c('0x66')],'raw':!![]};return db[_0xf57c('0x43')][_0xf57c('0x51')](_0x27eb20)['then'](handleEntityNotFound(_0x2bd83a,null))[_0xf57c('0x12')](function(_0x476936){if(_0x476936){if(!_[_0xf57c('0x70')](_0x476936['agentAvatar'])){if(fs[_0xf57c('0x71')](path[_0xf57c('0x72')](config['root'],_0xf57c('0x77'),_0x476936[_0xf57c('0x66')]))){_0x30d823=path[_0xf57c('0x72')](config[_0xf57c('0x6b')],_0xf57c('0x77'),_0x476936[_0xf57c('0x66')]);}}return _0x2bd83a[_0xf57c('0x74')](_0x30d823);}})[_0xf57c('0x1c')](handleError(_0x2bd83a,null));};exports['getCustomerAvatar']=function(_0xb34fec,_0x2e7831){var _0x2c58c2=path[_0xf57c('0x72')](config[_0xf57c('0x6b')],_0xf57c('0x78'));var _0x391e73={'where':{'id':_0xb34fec[_0xf57c('0x46')]['id']},'attributes':['id','customerAvatar',_0xf57c('0x79')],'raw':!![]};return db[_0xf57c('0x43')]['find'](_0x391e73)['then'](handleEntityNotFound(_0x2e7831,null))['then'](function(_0x47137b){if(_0x47137b){if(!_[_0xf57c('0x70')](_0x47137b['customerAvatar'])){if(fs[_0xf57c('0x71')](path[_0xf57c('0x72')](config[_0xf57c('0x6b')],_0xf57c('0x77'),_0x47137b[_0xf57c('0x7a')]))&&_0x47137b[_0xf57c('0x79')]){_0x2c58c2=path['join'](config['root'],_0xf57c('0x77'),_0x47137b[_0xf57c('0x7a')]);}}return _0x2e7831[_0xf57c('0x74')](_0x2c58c2);}})[_0xf57c('0x1c')](handleError(_0x2e7831,null));};exports['getSystemAvatar']=function(_0x32c30e,_0x35a91e){var _0x3324bb=path[_0xf57c('0x72')](config[_0xf57c('0x6b')],_0xf57c('0x7b'));var _0x1470aa={'where':{'id':_0x32c30e[_0xf57c('0x46')]['id']},'attributes':['id',_0xf57c('0x69')],'raw':!![]};return db[_0xf57c('0x43')][_0xf57c('0x51')](_0x1470aa)[_0xf57c('0x12')](handleEntityNotFound(_0x35a91e,null))[_0xf57c('0x12')](function(_0x15c294){if(_0x15c294){if(!_['isNil'](_0x15c294[_0xf57c('0x69')])){if(fs[_0xf57c('0x71')](path['join'](config[_0xf57c('0x6b')],'server/files/images/avatars/',_0x15c294[_0xf57c('0x69')]))){_0x3324bb=path[_0xf57c('0x72')](config['root'],_0xf57c('0x77'),_0x15c294[_0xf57c('0x69')]);}}return _0x35a91e[_0xf57c('0x74')](_0x3324bb);}})[_0xf57c('0x1c')](handleError(_0x35a91e,null));};exports[_0xf57c('0x7c')]=function(_0x110028,_0x244cea){var _0x5813af=require(_0xf57c('0x7d'));var _0x2256c5=new _0x5813af();var _0x3d7343=_0x2256c5[_0xf57c('0x7e')](_0x110028[_0xf57c('0x7f')]['user-agent'])[_0xf57c('0x80')]();var _0xd252df={'body':_0x110028[_0xf57c('0x4b')],'channel':_0xf57c('0x81')};var _0x1dae37=[];var _0x48e590=[];var _0x3bae74={};var _0x4cd7d9=![];return db[_0xf57c('0x82')][_0xf57c('0x55')]()[_0xf57c('0x12')](function(_0x543d28){if(!_0x543d28){throw new db[(_0xf57c('0x83'))]['ValidationError'](_0xf57c('0x84'));}_0x1dae37=_[_0xf57c('0x85')](_[_0xf57c('0x47')](_0x543d28),[_0xf57c('0x86'),_0xf57c('0x87')]);_0x48e590=_[_0xf57c('0x85')](_[_0xf57c('0x47')](_0x543d28),['createdAt',_0xf57c('0x87'),_0xf57c('0x88'),_0xf57c('0x89')]);if(_0x110028[_0xf57c('0x4b')]['id']){delete _0x110028[_0xf57c('0x4b')]['id'];}if(_['isNil'](_0x110028[_0xf57c('0x4b')][_0xf57c('0x8a')])){throw new db[(_0xf57c('0x83'))][(_0xf57c('0x8b'))](_0xf57c('0x8c'));}if(_[_0xf57c('0x70')](_0x110028[_0xf57c('0x4b')][_0xf57c('0x4b')])||_0x110028[_0xf57c('0x4b')][_0xf57c('0x4b')]===''){throw new db[(_0xf57c('0x83'))]['ValidationError'](_0xf57c('0x8d'));}if(_[_0xf57c('0x70')](_0x110028['body'][_0xf57c('0x8e')])){throw new db[(_0xf57c('0x83'))][(_0xf57c('0x8b'))](_0xf57c('0x8f')+_0x48e590);}if(!_['includes'](_0x48e590,_0x110028[_0xf57c('0x4b')][_0xf57c('0x8e')])){throw new db[(_0xf57c('0x83'))]['ValidationError'](_0xf57c('0x90')+_0x48e590);}_0x3bae74[_0x110028['body'][_0xf57c('0x8e')]]=_0x110028['body'][_0xf57c('0x8a')];})[_0xf57c('0x12')](function(){return db['ChatWebsite'][_0xf57c('0x51')]({'where':{'id':_0x110028['params']['id']},'include':[{'model':db[_0xf57c('0x91')],'as':_0xf57c('0x92'),'include':[{'model':db[_0xf57c('0x82')],'as':'Contacts','where':_0x3bae74,'limit':0x1,'order':[[_0xf57c('0x87'),'DESC']]}]},{'model':db[_0xf57c('0x93')],'as':'Applications'}]});})[_0xf57c('0x12')](handleEntityNotFound(_0x244cea,null))[_0xf57c('0x12')](function(_0xfbff62){if(_0xfbff62&&_0xfbff62['List']){_0xd252df[_0xf57c('0x94')]=_0xfbff62;_0xd252df[_0xf57c('0x95')]=_0xfbff62[_0xf57c('0x96')];_0xd252df[_0xf57c('0x97')]=_0xfbff62['List'];_0xd252df['applications']=_['orderBy'](_0xd252df[_0xf57c('0x95')],['priority'],[_0xf57c('0x98')]);if(_0xd252df['account'][_0xf57c('0x96')]){delete _0xd252df[_0xf57c('0x94')][_0xf57c('0x96')];}if(_0xd252df['account'][_0xf57c('0x92')]&&_0xd252df['account'][_0xf57c('0x92')][_0xf57c('0x99')]['length']){return _0xd252df[_0xf57c('0x94')][_0xf57c('0x92')]['Contacts'][0x0];}var _0x5175ea=_[_0xf57c('0x9a')](_0x110028[_0xf57c('0x4b')],{'firstName':_0x110028[_0xf57c('0x4b')][_0xf57c('0x8a')],'ListId':_0xfbff62[_0xf57c('0x89')]});_0x5175ea[_0x110028[_0xf57c('0x4b')][_0xf57c('0x8e')]]=_0x110028[_0xf57c('0x4b')]['from'];return db[_0xf57c('0x82')]['create'](_0x5175ea,{'fields':_0x1dae37,'raw':!![]});}})[_0xf57c('0x12')](handleEntityNotFound(_0x244cea,null))[_0xf57c('0x12')](function(_0x24b654){_0xd252df['contact']=_0x24b654;var _0x8cca15=_0x110028[_0xf57c('0x4b')]['customerIp'];if(_0x110028[_0xf57c('0x7f')][_0xf57c('0x9b')]){_0x8cca15=_0x110028['headers'][_0xf57c('0x9b')];}else if(_0x110028[_0xf57c('0x7f')]['x-forwarded-for']){_0x8cca15=_[_0xf57c('0x9c')](_0x110028[_0xf57c('0x7f')][_0xf57c('0x9d')][_0xf57c('0x9e')](','));}if(_0x24b654){var _0x7eb04d={'ContactId':_0x24b654['id'],'ChatWebsiteId':_0x110028['params']['id'],'from':(_0x24b654[_0xf57c('0x9f')]||'')+'\x20'+(_0x24b654[_0xf57c('0xa0')]||''),'customerIp':_0x8cca15,'customerPort':_0x110028[_0xf57c('0x7f')][_0xf57c('0xa1')]?_0x110028['headers'][_0xf57c('0xa1')]:null,'referer':_0x110028[_0xf57c('0x4b')]['referer'],'browserName':_0x3d7343['browser'][_0xf57c('0x2b')]&&_0x3d7343[_0xf57c('0xa2')][_0xf57c('0xa3')]?util[_0xf57c('0xa4')]('%s\x20%s',_0x3d7343[_0xf57c('0xa2')][_0xf57c('0x2b')],_0x3d7343[_0xf57c('0xa2')][_0xf57c('0xa3')]):_0xf57c('0xa5'),'browserVersion':_0x3d7343[_0xf57c('0xa2')][_0xf57c('0xa3')]||_0xf57c('0xa5'),'osName':util[_0xf57c('0xa4')](_0xf57c('0xa6'),_0x3d7343['os'][_0xf57c('0x2b')],_0x3d7343['os'][_0xf57c('0xa3')]),'osVersion':_0x3d7343['os'][_0xf57c('0xa3')],'deviceModel':_0x3d7343[_0xf57c('0xa7')][_0xf57c('0x34')]&&_0x3d7343['device'][_0xf57c('0xa8')]?util[_0xf57c('0xa4')](_0xf57c('0xa9'),_0x3d7343[_0xf57c('0xa7')][_0xf57c('0x34')],_0x3d7343[_0xf57c('0xa7')]['vendor'],_0x3d7343[_0xf57c('0xa7')][_0xf57c('0x32')]):null,'deviceVendor':_0x3d7343[_0xf57c('0xa7')][_0xf57c('0xa8')],'deviceType':_0x3d7343['device']['type'],'formData':JSON[_0xf57c('0xaa')](_0x110028[_0xf57c('0x4b')])};var _0x3e6b52={'ChatWebsiteId':_0x110028[_0xf57c('0x46')]['id'],'closed':![]};if(_0x110028[_0xf57c('0x4b')][_0xf57c('0xab')]){_0x3e6b52[_0xf57c('0xab')]=_0x110028[_0xf57c('0x4b')]['threadId'];return db[_0xf57c('0xac')][_0xf57c('0x51')]({'where':_0x3e6b52})[_0xf57c('0x12')](function(_0x4adea7){if(_0x4adea7){return[_0x4adea7,![]];}_0x7eb04d[_0xf57c('0xab')]=_0x110028[_0xf57c('0x4b')][_0xf57c('0xab')];_0x7eb04d['externalUrl']=_0x110028[_0xf57c('0x4b')][_0xf57c('0xad')];return db[_0xf57c('0xac')][_0xf57c('0x4a')](_0x7eb04d)[_0xf57c('0x12')](function(_0x3b4270){return[_0x3b4270,!![]];});});}_0x3e6b52[_0xf57c('0xae')]=_0x24b654['id'];if(_0x110028[_0xf57c('0x4b')][_0xf57c('0xaf')]&&_0x110028[_0xf57c('0x4b')][_0xf57c('0xaf')]['id']){_0x3e6b52['id']=_0x110028[_0xf57c('0x4b')][_0xf57c('0xaf')]['id'];return db['ChatInteraction'][_0xf57c('0x51')]({'where':_0x3e6b52})['then'](function(_0x1aa8be){if(_0x1aa8be){return[_0x1aa8be,![]];}return db[_0xf57c('0xac')]['create'](_0x7eb04d)['then'](function(_0x5e72cd){return[_0x5e72cd,!![]];});});}return db[_0xf57c('0xac')][_0xf57c('0x4a')](_0x7eb04d)[_0xf57c('0x12')](function(_0x226ee3){return[_0x226ee3,!![]];});}})['spread'](function(_0x5b4923,_0x28765d){if(_0x5b4923){_0x4cd7d9=_0x28765d;if(!_0x28765d){var _0x4341a4={'from':(_0xd252df['contact']['firstName']||'')+'\x20'+(_0xd252df[_0xf57c('0xb0')]['lastName']||'')};if(_0x110028[_0xf57c('0x4b')][_0xf57c('0xab')]&&_0x110028[_0xf57c('0x4b')]['messageId']&&_0x110028[_0xf57c('0x4b')][_0xf57c('0xab')]!=_0x110028[_0xf57c('0x4b')][_0xf57c('0xb1')]){_0x4341a4[_0xf57c('0xab')]=_0x110028[_0xf57c('0x4b')][_0xf57c('0xb1')];}return _0x5b4923[_0xf57c('0x26')](_0x4341a4);}else{return _0x5b4923;}}})[_0xf57c('0x12')](function(_0x68a0c2){_0xd252df[_0xf57c('0xaf')]=_0x68a0c2[_0xf57c('0x4c')]({'plain':!![]});_0xd252df['interaction'][_0xf57c('0xb2')]=_0x4cd7d9;if(_0xd252df[_0xf57c('0xaf')][_0xf57c('0xb2')]){if(_0xd252df[_0xf57c('0x94')][_0xf57c('0xb3')]){_0xd252df[_0xf57c('0x95')][_0xf57c('0xb4')]({'id':0x0,'priority':_0xd252df[_0xf57c('0x95')][_0xf57c('0x5b')]+0x1,'app':_0xf57c('0xb5'),'appdata':_0xf57c('0xb6'),'interval':_0xf57c('0xb7')});}}return db['ChatMessage'][_0xf57c('0x4a')]({'body':_0x110028['body']['body'],'ChatWebsiteId':_0x110028[_0xf57c('0x46')]['id'],'ChatInteractionId':_0x68a0c2['id'],'direction':'in','ContactId':_0xd252df['contact']['id'],'AttachmentId':_0x110028['body'][_0xf57c('0xb8')]});})['then'](function(_0x96931f){_0xd252df[_0xf57c('0x1a')]=_0x96931f;if(_0xd252df[_0xf57c('0xaf')][_0xf57c('0xb9')]){return db[_0xf57c('0xba')][_0xf57c('0x51')]({'attributes':['id',_0xf57c('0x2b')],'where':{'id':_0xd252df['interaction'][_0xf57c('0xb9')]}})[_0xf57c('0x12')](function(_0x5d4d3a){if(_0x5d4d3a){_0xd252df[_0xf57c('0x95')][_0xf57c('0xbb')]({'id':0x0,'priority':0x0,'app':_0xf57c('0xbc'),'appdata':_0x5d4d3a[_0xf57c('0x2b')]+','+(_0xd252df[_0xf57c('0x94')][_0xf57c('0xbd')]||0xa),'interval':_0xf57c('0xb7')});_0xd252df[_0xf57c('0xbe')]=!![];}return respondWithRpcPromise(_0xf57c('0xbf'),_0xf57c('0xc0'),_0xd252df);});}return respondWithRpcPromise(_0xf57c('0xbf'),_0xf57c('0xc0'),_0xd252df);})[_0xf57c('0x12')](function(_0x174ccd){respondWithRpcPromise('EventManager',_0xf57c('0xc1'),{'event':_0xf57c('0x7c'),'message':_0x174ccd},client9002);return _0x174ccd;})[_0xf57c('0x12')](respondWithResult(_0x244cea,null))[_0xf57c('0x1c')](handleError(_0x244cea,null));};exports[_0xf57c('0xc2')]=function(_0x38b86f,_0x51e6e3){var _0x4fc3c3,_0x56140c,_0x121e36;var _0x38369e=[];var _0x53e46b={};var _0x3da5a9=_0x38b86f[_0xf57c('0xc3')]||[];var _0x23b5d2=[];var _0x15a01b;return db[_0xf57c('0x82')][_0xf57c('0x55')]()[_0xf57c('0x12')](function(_0x389065){if(!_0x389065){throw new db[(_0xf57c('0x83'))][(_0xf57c('0x8b'))](_0xf57c('0x84'));}_0x38369e=_[_0xf57c('0x85')](_[_0xf57c('0x47')](_0x389065),[_0xf57c('0x86'),'updatedAt',_0xf57c('0x88'),_0xf57c('0x89')]);if(_0x38b86f['body']['id']){delete _0x38b86f[_0xf57c('0x4b')]['id'];}if(_['isNil'](_0x38b86f[_0xf57c('0x4b')]['from'])){throw _0x51e6e3[_0xf57c('0x1e')](0x1f4)[_0xf57c('0x2c')](new db['Sequelize'][(_0xf57c('0x8b'))](_0xf57c('0x8c')));}if(_[_0xf57c('0x70')](_0x38b86f[_0xf57c('0x4b')][_0xf57c('0x4b')])||_0x38b86f[_0xf57c('0x4b')][_0xf57c('0x4b')]===''){throw _0x51e6e3['status'](0x1f4)[_0xf57c('0x2c')](new db[(_0xf57c('0x83'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0x38b86f[_0xf57c('0x4b')]['mapKeyOffline'])){throw _0x51e6e3[_0xf57c('0x1e')](0x1f4)[_0xf57c('0x2c')](new db['Sequelize'][(_0xf57c('0x8b'))](_0xf57c('0xc4')+_0x38369e));}if(!_[_0xf57c('0xc5')](_0x38369e,_0x38b86f['body']['mapKeyOffline'])){throw _0x51e6e3['status'](0x1f4)[_0xf57c('0x2c')](new db['Sequelize']['ValidationError'](_0xf57c('0xc6')+_0x38369e));}_0x53e46b[_0x38b86f['body'][_0xf57c('0xc7')]]=_0x38b86f[_0xf57c('0x4b')]['from'];})[_0xf57c('0x12')](function(){return db[_0xf57c('0x43')]['find']({'where':{'id':_0x38b86f['params']['id']},'include':[{'model':db[_0xf57c('0x91')],'as':'List'},{'model':db[_0xf57c('0xc8')],'as':_0xf57c('0xc8')}]});})[_0xf57c('0x12')](handleEntityNotFound(_0x51e6e3,null))['then'](function(_0x20c045){if(_0x20c045&&_0x20c045[_0xf57c('0x92')]){_0x56140c=_0x20c045;var _0x4cafc7=_[_0xf57c('0x9a')](_0x38b86f[_0xf57c('0x4b')],{'firstName':_0x38b86f['body']['from'],'phone':_0x38b86f[_0xf57c('0x4b')][_0xf57c('0x8a')],'ListId':_0x20c045[_0xf57c('0x89')]});_0x4cafc7[_0x38b86f['body'][_0xf57c('0xc7')]]=_0x38b86f[_0xf57c('0x4b')][_0xf57c('0x8a')];return db[_0xf57c('0x82')][_0xf57c('0xc9')]({'where':_0x53e46b,'defaults':_0x4cafc7});}})['spread'](function(_0x2afd86){if(_0x2afd86){_0x121e36=_0x2afd86;var _0x10fad4=fs['readFileSync'](path[_0xf57c('0x72')](config[_0xf57c('0x6b')],_0xf57c('0xca')),_0xf57c('0xcb'));var _0x107bd1=ejs[_0xf57c('0xcc')](_0x10fad4,{'body':_[_0xf57c('0xcd')](_0x38b86f['body'][_0xf57c('0x4b')]),'bodyTitle':_0x56140c[_0xf57c('0xce')]});return db[_0xf57c('0xcf')][_0xf57c('0x4a')]({'body':_0x107bd1,'plainBody':htmlToText[_0xf57c('0xd0')](_0x107bd1),'ContactId':_0x2afd86['id'],'ChatWebsiteId':_0x56140c['id']});}})[_0xf57c('0x12')](function(_0x2e5c0d){_0x15a01b=_0x2e5c0d;if(_0x3da5a9[_0xf57c('0x5b')]){var _0x3f7dba=_0x3da5a9['map'](function(_0x548985){return{'name':_0x548985[_0xf57c('0xd1')],'basename':_0x548985['filename'],'type':_0x548985[_0xf57c('0xd2')],'ChatOfflineMessageId':_0x2e5c0d['id']};});_0x23b5d2=_0x3f7dba[_0xf57c('0x2f')](_0x4a1f98=>{var _0x4b5931={'filename':_0x4a1f98[_0xf57c('0x2b')],'path':path[_0xf57c('0x72')](config[_0xf57c('0x6b')],_0xf57c('0xd3'),_0xf57c('0xc3'),_0xf57c('0xd4'),_0xf57c('0xd5'),_0x4a1f98['basename'])};return _0x4b5931;});if(!_0x56140c[_0xf57c('0xd6')]){return db[_0xf57c('0xd7')][_0xf57c('0xd8')](function(_0x1f05d0){return db[_0xf57c('0xd9')][_0xf57c('0xda')](_0x3f7dba,{'transaction':_0x1f05d0});});}}})[_0xf57c('0x12')](function(){if(_0x15a01b){_0x4fc3c3=_0x15a01b;return db['MailAccount']['findOne']({'where':{'active':!![]},'include':[{'model':db[_0xf57c('0xdb')],'as':_0xf57c('0xdc'),'raw':!![]}]});}})[_0xf57c('0x12')](function(_0x415bb4){if(_0x415bb4&&_0x415bb4[_0xf57c('0xdc')]&&_0x56140c[_0xf57c('0xdd')]&&_0x56140c['forwardOfflineAddress']){var _0x5b33d6={'tls':{'rejectUnauthorized':![]}};if(_0x415bb4[_0xf57c('0xdc')][_0xf57c('0xde')]){_0x5b33d6[_0xf57c('0xde')]=_0x415bb4[_0xf57c('0xdc')][_0xf57c('0xde')];}else{_0x5b33d6[_0xf57c('0xdf')]=_0x415bb4[_0xf57c('0xdc')][_0xf57c('0xdf')];_0x5b33d6[_0xf57c('0xe0')]=_0x415bb4[_0xf57c('0xdc')]['port'];_0x5b33d6['secure']=_0x415bb4[_0xf57c('0xdc')]['secure'];}if(_0x415bb4[_0xf57c('0xdc')]['authentication']){_0x5b33d6[_0xf57c('0xe1')]={'user':_0x415bb4[_0xf57c('0xdc')][_0xf57c('0x4e')],'pass':_0x415bb4[_0xf57c('0xdc')]['pass']};}return respondWithRpcPromise(_0xf57c('0xe2'),_0xf57c('0xe3'),{'account':_0x5b33d6,'message':{'from':util[_0xf57c('0xa4')](_0xf57c('0xe4'),_0x415bb4['name'],_0x415bb4[_0xf57c('0xe5')]||_0x415bb4['Smtp'][_0xf57c('0x4e')]),'to':_0x56140c['forwardOfflineAddress'],'subject':_0x56140c['offlineMessageSubject'],'html':_0x4fc3c3[_0xf57c('0x4b')],'attachments':_0x23b5d2}},client9003)[_0xf57c('0x12')](function(){return _0x4fc3c3;})['catch'](function(_0x38cd2f){console[_0xf57c('0x18')](_0x38cd2f);});}})[_0xf57c('0x12')](function(){if(_0x56140c&&_0x56140c['openNewInteraction']&&_0x56140c['MailAccountId']){var _0x1898e1=[];if(_0x3da5a9[_0xf57c('0x5b')]){_0x1898e1=_0x3da5a9['map'](function(_0x3efeba){return{'name':_0x3efeba[_0xf57c('0xd1')],'basename':_0x3efeba[_0xf57c('0x64')],'type':_0x3efeba[_0xf57c('0xd2')],'ChatOfflineMessageId':_0x15a01b['id']};});}var _0x50cb83;if(!_[_0xf57c('0x70')](_0x56140c['subjectOffline'])){var _0x19b7fe=_['map'](_0x38b86f[_0xf57c('0x4b')],function(_0xbab18b){return _0xbab18b;});var _0x18ab1b=_[_0xf57c('0xe6')](_0x19b7fe)[0x0];var _0x210946=_[_0xf57c('0xe7')](_0x18ab1b,function(_0x3655f5){return _0x3655f5;});_0x50cb83=_0x210946[0x1][_0x56140c['subjectOffline']];}var _0x1c852e={'from':_0x121e36[_0xf57c('0xe5')],'firstName':_0x121e36[_0xf57c('0x9f')],'lastName':_0x121e36[_0xf57c('0xa0')],'mapKey':_0xf57c('0xe5'),'message':{'from':_0x121e36[_0xf57c('0xe5')],'to':_0x56140c[_0xf57c('0xc8')][_0xf57c('0xe5')],'cc':'','subject':_[_0xf57c('0x70')](_0x50cb83)?_0x56140c[_0xf57c('0xe8')]:_0x50cb83,'messageId':'','sentAt':new Date(),'attach':_0x1898e1[_0xf57c('0x5b')],'attachments':_0x1898e1,'originChannel':'Chat','ChatWebsiteId':_0x56140c['id'],'ChatOfflineMessageId':_0x4fc3c3['id'],'originTo':_0x56140c[_0xf57c('0xc8')][_0xf57c('0xe5')]},'body':_0x4fc3c3[_0xf57c('0x4b')]};var _0x2387d9={'account':{'id':_0x56140c['MailAccountId']},'body':_0x1c852e,'log':_0xf57c('0xe9')};return respondWithRpcPromise(_0xf57c('0xe9'),'notifyMail',_0x2387d9,client9001)[_0xf57c('0x12')](function(){return _0x4fc3c3;})['catch'](function(_0x227e40){console[_0xf57c('0x18')](_0x227e40);});}return;})[_0xf57c('0x12')](function(){if(_0x4fc3c3){return _0x4fc3c3;}})['then'](respondWithResult(_0x51e6e3,null))[_0xf57c('0x1c')](function(_0x1b8b79){console['error'](_0xf57c('0x1c'),_0x1b8b79);for(var _0x466104 of _0x3da5a9){var _0x165bb9=path['join'](config[_0xf57c('0x6b')],_0xf57c('0xd3'),_0xf57c('0xc3'),_0xf57c('0xd4'),_0xf57c('0xd5'),_0x466104['filename']);fs_extra[_0xf57c('0xea')](_0x165bb9)['catch'](function(_0x22ccd7){console['error'](_0xf57c('0xeb'),_0x165bb9,_0x22ccd7);});}});};exports[_0xf57c('0xec')]=function(_0x1960ca,_0x1d4fa8){return db[_0xf57c('0xac')][_0xf57c('0x51')]({'where':{'id':_0x1960ca[_0xf57c('0x46')]['id']}})[_0xf57c('0x12')](handleEntityNotFound(_0x1d4fa8,null))[_0xf57c('0x12')](function(_0x3b1dc2){if(_0x3b1dc2){return _0x3b1dc2[_0xf57c('0xec')](_0x1960ca[_0xf57c('0x4b')]['ids'],_[_0xf57c('0xed')](_0x1960ca[_0xf57c('0x4b')],['ids','id'])||{});}})[_0xf57c('0x12')](respondWithResult(_0x1d4fa8,null))[_0xf57c('0x1c')](handleError(_0x1d4fa8,null));};exports[_0xf57c('0xee')]=function(_0x4b747a,_0x30b6ed){var _0x53cbe2={'raw':![],'where':{}};var _0x5c3179={};var _0x9d53b={'count':0x0,'rows':[]};return db[_0xf57c('0x43')][_0xf57c('0x5a')]({'where':{'id':_0x4b747a[_0xf57c('0x46')]['id']}})[_0xf57c('0x12')](handleEntityNotFound(_0x30b6ed,null))[_0xf57c('0x12')](function(_0x59c00f){if(_0x59c00f){_0x5c3179[_0xf57c('0x34')]=_[_0xf57c('0x47')](db['ChatInteraction'][_0xf57c('0x30')]);_0x5c3179['query']=_['keys'](_0x4b747a[_0xf57c('0x35')]);_0x5c3179['filters']=_[_0xf57c('0x37')](_0x5c3179[_0xf57c('0x34')],_0x5c3179[_0xf57c('0x35')]);_0x53cbe2[_0xf57c('0x39')]=_[_0xf57c('0x37')](_0x5c3179['model'],qs['fields'](_0x4b747a[_0xf57c('0x35')][_0xf57c('0x38')]));_0x53cbe2[_0xf57c('0x39')]=_0x53cbe2[_0xf57c('0x39')][_0xf57c('0x5b')]?_0x53cbe2[_0xf57c('0x39')]:_0x5c3179[_0xf57c('0x34')];if(!_0x4b747a[_0xf57c('0x35')][_0xf57c('0x3a')](_0xf57c('0x3b'))){_0x53cbe2[_0xf57c('0x22')]=qs[_0xf57c('0x22')](_0x4b747a[_0xf57c('0x35')][_0xf57c('0x22')]);_0x53cbe2[_0xf57c('0x20')]=qs[_0xf57c('0x20')](_0x4b747a[_0xf57c('0x35')][_0xf57c('0x20')]);}_0x53cbe2[_0xf57c('0x3c')]=qs[_0xf57c('0x3d')](_0x4b747a[_0xf57c('0x35')]['sort']);_0x53cbe2[_0xf57c('0x3e')]=qs['filters'](_[_0xf57c('0x5f')](_0x4b747a['query'],_0x5c3179['filters']));_0x53cbe2[_0xf57c('0x3e')][_0xf57c('0x57')]=_0x59c00f['id'];if(_0x4b747a['query'][_0xf57c('0x3f')]){_0x53cbe2[_0xf57c('0x3e')]=_[_0xf57c('0x40')](_0x53cbe2[_0xf57c('0x3e')],{'$or':_[_0xf57c('0x2f')](_0x53cbe2[_0xf57c('0x39')],function(_0x4cd802){var _0x3d79aa={};_0x3d79aa[_0x4cd802]={'$like':'%'+_0x4b747a[_0xf57c('0x35')]['filter']+'%'};return _0x3d79aa;})});}_0x53cbe2=_[_0xf57c('0x40')]({},_0x53cbe2,_0x4b747a['options']);return db[_0xf57c('0xac')][_0xf57c('0x23')]({'where':_0x53cbe2[_0xf57c('0x3e')]})[_0xf57c('0x12')](function(_0x2b0ba4){_0x9d53b['count']=_0x2b0ba4;if(_0x4b747a['query']['includeAll']){_0x53cbe2[_0xf57c('0x49')]=[{'model':db[_0xf57c('0x82')],'as':'Contact','required':![]},{'model':db[_0xf57c('0xba')],'as':_0xf57c('0xef'),'attributes':['name',_0xf57c('0xf0'),'internal'],'required':![]},{'model':db[_0xf57c('0xf1')],'as':_0xf57c('0xf2'),'attributes':['id','name','color'],'where':_0x4b747a[_0xf57c('0x35')][_0xf57c('0xf3')]?{'id':_0x4b747a[_0xf57c('0x35')][_0xf57c('0xf3')]}:undefined,'required':_0x4b747a[_0xf57c('0x35')][_0xf57c('0xf3')]?!![]:![]}];}return db[_0xf57c('0xac')][_0xf57c('0x44')](_0x53cbe2);})[_0xf57c('0x12')](function(_0x1293bf){_0x9d53b[_0xf57c('0x5c')]=_0x1293bf;return _0x9d53b;});}})['then'](respondWithFilteredResult(_0x30b6ed,_0x53cbe2))[_0xf57c('0x1c')](handleError(_0x30b6ed,null));};function iftimePromise(_0x8e1d52,_0x4aac44){return respondWithRpcPromise('Command',_0xf57c('0xf4'),{'command':_0x4aac44[_0xf57c('0xf5')]?util[_0xf57c('0xa4')]('iftime\x20%s,%s',_0x8e1d52['interval'],_0x4aac44['timezone']):util[_0xf57c('0xa4')](_0xf57c('0xf6'),_0x8e1d52[_0xf57c('0xf7')])},client9002)[_0xf57c('0x12')](function(_0x2c628f){var _0x2264ab=_0x2c628f&&_0x2c628f['indexOf']('true')>=0x0?!![]:![];logger[_0xf57c('0x13')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x4aac44['id'],_0x8e1d52['id'],_0x8e1d52[_0xf57c('0xf7')],_0x2264ab?_0xf57c('0xf8'):_0xf57c('0xf9'),_0x4aac44[_0xf57c('0xf5')]?_0x4aac44[_0xf57c('0xf5')]:_0xf57c('0xfa'));return _0x2264ab;})[_0xf57c('0x1c')](function(_0x3e20c1){logger[_0xf57c('0x18')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x4aac44['id'],_0x8e1d52['id'],_0x8e1d52[_0xf57c('0xf7')],util[_0xf57c('0xfb')](_0x3e20c1,{'showHidden':![],'depth':null}),_0x4aac44[_0xf57c('0xf5')]?_0x4aac44['timezone']:_0xf57c('0xfa'));return![];});}exports[_0xf57c('0xf4')]=function(_0x255070,_0x3235e6){var _0x20b646=0x0;var _0x4f4fb8=0x0;var _0x44d72e=![];var _0x2b0626;var _0x615db5;return db[_0xf57c('0x43')][_0xf57c('0x51')]({'where':{'id':_0x255070[_0xf57c('0x46')]['id']},'include':[{'model':db[_0xf57c('0xfc')],'as':_0xf57c('0xfc'),'include':[{'model':db[_0xf57c('0xfc')],'as':_0xf57c('0xfd'),'attributes':['id',_0xf57c('0xf7')],'raw':!![]}]}]})[_0xf57c('0x12')](handleEntityNotFound(_0x3235e6,null))[_0xf57c('0x12')](function(_0x2fc7b0){if(_0x2fc7b0){_0x2b0626=_0x2fc7b0;return _0x2fc7b0[_0xf57c('0xfe')]({'raw':!![]});}})['then'](function(_0x213526){if(_0x2b0626){if(_0x213526){_0x615db5=_0x213526;}}return require(_0xf57c('0x6d'))[_0xf57c('0x6e')]();})[_0xf57c('0x12')](function(_0x430ac3){if(_0x430ac3){_0x4f4fb8=_0x430ac3['virtual'];_0x44d72e=_0x430ac3[_0xf57c('0x6f')];}})['then'](function(){return db[_0xf57c('0xac')]['count']({'where':{'closed':![]}});})[_0xf57c('0x12')](function(_0x5cd508){_0x20b646=_0x5cd508;if(_0x4f4fb8&&_0x5cd508>_0x4f4fb8){return db[_0xf57c('0xff')]['findOne']({'where':{'id':0x1}})[_0xf57c('0x12')](function(_0x54bd2a){if(_0x54bd2a){_0x54bd2a[_0xf57c('0x100')](_0xf57c('0x101'));}});}})[_0xf57c('0x12')](function(){if(_0x2b0626[_0xf57c('0xfc')]&&_0x2b0626[_0xf57c('0xfc')]['Intervals']){var _0x35d1ea=[];for(var _0x43cc1d=0x0;_0x43cc1d<_0x2b0626[_0xf57c('0xfc')][_0xf57c('0xfd')][_0xf57c('0x5b')];_0x43cc1d++){var _0x35de7f=_0x2b0626[_0xf57c('0xfc')][_0xf57c('0xfd')][_0x43cc1d][_0xf57c('0x4c')]({'plain':!![]});_0x35d1ea[_0xf57c('0xb4')](iftimePromise(_0x35de7f,_0x2b0626));}return BPromise['all'](_0x35d1ea)[_0xf57c('0x12')](function(_0x2baa34){return _[_0xf57c('0x102')](_0x2baa34);});}else{return!![];}})[_0xf57c('0x12')](function(_0x531117){var _0x5b6d86=fs[_0xf57c('0x103')](path[_0xf57c('0x72')](config[_0xf57c('0x6b')],_0xf57c('0x104')),_0xf57c('0xcb'));var _0xc0478c={'remote':_0x2b0626[_0xf57c('0x105')],'query':querystring['stringify'](_[_0xf57c('0x40')](_0x2b0626['get']({'plain':!![]}),{'customerIp':_0x255070[_0xf57c('0x7f')]['x-forwarded-for']||_0x255070[_0xf57c('0x7f')][_0xf57c('0x106')]||_0x255070['connection'][_0xf57c('0x107')]||_0x255070['ip'],'referer':_0x255070[_0xf57c('0x7f')][_0xf57c('0x108')],'openedInteractions':_0x20b646,'maxInteractions':_0x4f4fb8,'virtual':_0x44d72e[_0xf57c('0x109')],'online':_0x531117,'custom':_0x44d72e}))[_0xf57c('0x10a')](/'/g,'\x5c\x27')};_0x3235e6[_0xf57c('0x2c')](ejs[_0xf57c('0xcc')](Mustache[_0xf57c('0xcc')](_0x5b6d86,_0xc0478c),{'proactiveActions':_0x615db5,'alignment':_0x2b0626[_0xf57c('0x10b')],'verticalAlignment':_0x2b0626['verticalAlignment'],'div_color':_0x2b0626[_0xf57c('0x10c')],'labelText':_0x2b0626['labelText'],'text_color':_0x2b0626[_0xf57c('0x10d')],'button_color':_0x2b0626['color_button'],'background_color':_0x2b0626['backgroundColor'],'hideWhenOffline':_0x2b0626[_0xf57c('0x10e')],'interval':_0x2b0626[_0xf57c('0x10f')]}));})[_0xf57c('0x1c')](handleError(_0x3235e6,null));};exports[_0xf57c('0x110')]=function(_0x5dc585,_0x2d5571){var _0x123336=_0x5dc585[_0xf57c('0x46')]['id'];var _0x7f03a2=_0x5dc585[_0xf57c('0x4b')];var _0x3edf9c=0xc8;var _0x2e3842=null;return db[_0xf57c('0xd7')][_0xf57c('0xd8')]({'isolationLevel':db['sequelize'][_0xf57c('0x111')][_0xf57c('0x112')][_0xf57c('0x113')]},function(_0x57a2c8){return db[_0xf57c('0x43')][_0xf57c('0x5a')]({'where':{'id':_0x123336},'transaction':_0x57a2c8})[_0xf57c('0x12')](function(_0x2f9a9e){if(_0x2f9a9e){return db[_0xf57c('0x93')][_0xf57c('0x27')]({'where':{'ChatWebsiteId':_0x123336},'transaction':_0x57a2c8})[_0xf57c('0x12')](function(){var _0x425938=_[_0xf57c('0x2f')](_0x7f03a2,function(_0x53df95){_0x53df95['ChatWebsiteId']=_0x123336;return _0x53df95;});return db[_0xf57c('0x93')][_0xf57c('0xda')](_0x425938,{'transaction':_0x57a2c8});});}else{_0x3edf9c=0x194;_0x2e3842=[];}});})[_0xf57c('0x12')](function(){if(_0x3edf9c!==0x194){return db[_0xf57c('0x93')][_0xf57c('0x114')]({'where':{'ChatWebsiteId':_0x123336},'order':_0xf57c('0x115')})[_0xf57c('0x12')](function(_0x402e29){_0x2e3842=_0x402e29;});}})[_0xf57c('0x1c')](function(_0x5bd4f6){_0x3edf9c=0x1f4;logger[_0xf57c('0x18')](_0x5bd4f6[_0xf57c('0x2a')]);if(_0x5bd4f6[_0xf57c('0x2b')]){delete _0x5bd4f6['name'];}_0x2e3842=_0x5bd4f6;})[_0xf57c('0x116')](function(){if(_0x2e3842===null){_0x2d5571[_0xf57c('0x1d')](_0x3edf9c);}else{if(_0x3edf9c===0x1f4){_0x2d5571[_0xf57c('0x1e')](_0x3edf9c)[_0xf57c('0x2c')](_0x2e3842);}else{_0x2d5571[_0xf57c('0x1e')](_0x3edf9c)[_0xf57c('0x1f')](_0x2e3842);}}});};exports[_0xf57c('0x117')]=function(_0x1490e7,_0x2a2201){var _0x2d5c04={};var _0x45f4be={};var _0x3ad981;var _0x4c0eb7;return db['ChatWebsite']['findOne']({'where':{'id':_0x1490e7['params']['id']}})[_0xf57c('0x12')](handleEntityNotFound(_0x2a2201,null))[_0xf57c('0x12')](function(_0x45a3f9){if(_0x45a3f9){_0x3ad981=_0x45a3f9;_0x45f4be['model']=_['keys'](db['ChatApplication'][_0xf57c('0x30')]);_0x45f4be[_0xf57c('0x35')]=_[_0xf57c('0x47')](_0x1490e7[_0xf57c('0x35')]);_0x45f4be[_0xf57c('0x36')]=_[_0xf57c('0x37')](_0x45f4be[_0xf57c('0x34')],_0x45f4be[_0xf57c('0x35')]);_0x2d5c04['attributes']=_[_0xf57c('0x37')](_0x45f4be[_0xf57c('0x34')],qs[_0xf57c('0x38')](_0x1490e7[_0xf57c('0x35')][_0xf57c('0x38')]));_0x2d5c04[_0xf57c('0x39')]=_0x2d5c04[_0xf57c('0x39')][_0xf57c('0x5b')]?_0x2d5c04[_0xf57c('0x39')]:_0x45f4be['model'];_0x2d5c04[_0xf57c('0x3c')]=qs[_0xf57c('0x3d')](_0x1490e7[_0xf57c('0x35')][_0xf57c('0x3d')]);_0x2d5c04['where']=qs[_0xf57c('0x36')](_[_0xf57c('0x5f')](_0x1490e7[_0xf57c('0x35')],_0x45f4be['filters']));if(_0x1490e7[_0xf57c('0x35')][_0xf57c('0x3f')]){_0x2d5c04[_0xf57c('0x3e')]=_[_0xf57c('0x40')](_0x2d5c04[_0xf57c('0x3e')],{'$or':_['map'](_0x2d5c04['attributes'],function(_0x30a1a7){var _0x2cf13e={};_0x2cf13e[_0x30a1a7]={'$like':'%'+_0x1490e7[_0xf57c('0x35')][_0xf57c('0x3f')]+'%'};return _0x2cf13e;})});}_0x2d5c04=_[_0xf57c('0x40')]({},_0x2d5c04,_0x1490e7[_0xf57c('0x42')]);return _0x3ad981[_0xf57c('0x117')](_0x2d5c04);}})['then'](function(_0x279a3e){if(_0x279a3e){_0x4c0eb7=_0x279a3e[_0xf57c('0x5b')];if(!_0x1490e7['query'][_0xf57c('0x3a')](_0xf57c('0x3b'))){_0x2d5c04[_0xf57c('0x22')]=qs[_0xf57c('0x22')](_0x1490e7[_0xf57c('0x35')]['limit']);_0x2d5c04[_0xf57c('0x20')]=qs[_0xf57c('0x20')](_0x1490e7[_0xf57c('0x35')]['offset']);}return _0x3ad981[_0xf57c('0x117')](_0x2d5c04);}})[_0xf57c('0x12')](function(_0x45cd51){if(_0x45cd51){return _0x45cd51?{'count':_0x4c0eb7,'rows':_0x45cd51}:null;}})['then'](respondWithResult(_0x2a2201,null))[_0xf57c('0x1c')](handleError(_0x2a2201,null));};exports['addProactiveActions']=function(_0x1f87a2,_0xbb5b26){return db['chatProactiveAction']['find']({'where':{'id':_0x1f87a2[_0xf57c('0x46')]['id']}})[_0xf57c('0x12')](handleEntityNotFound(_0xbb5b26,null))[_0xf57c('0x12')](function(_0x4fe5fb){if(_0x4fe5fb){return _0x4fe5fb['addProactiveActions'](_0x1f87a2[_0xf57c('0x4b')][_0xf57c('0x5e')],_[_0xf57c('0xed')](_0x1f87a2['body'],[_0xf57c('0x5e'),'id'])||{});}})[_0xf57c('0x12')](respondWithResult(_0xbb5b26,null))['catch'](handleError(_0xbb5b26,null));};exports[_0xf57c('0xfe')]=function(_0x1e8f23,_0x32585f){var _0x4ac184={};var _0x16f0b9={};var _0x3a8504;var _0x238865;return db['ChatWebsite'][_0xf57c('0x5a')]({'where':{'id':_0x1e8f23[_0xf57c('0x46')]['id']}})[_0xf57c('0x12')](handleEntityNotFound(_0x32585f,null))[_0xf57c('0x12')](function(_0x383e21){if(_0x383e21){_0x3a8504=_0x383e21;_0x16f0b9[_0xf57c('0x34')]=_['keys'](db[_0xf57c('0x118')][_0xf57c('0x30')]);_0x16f0b9['query']=_['keys'](_0x1e8f23['query']);_0x16f0b9[_0xf57c('0x36')]=_['intersection'](_0x16f0b9['model'],_0x16f0b9[_0xf57c('0x35')]);_0x4ac184['attributes']=_[_0xf57c('0x37')](_0x16f0b9[_0xf57c('0x34')],qs[_0xf57c('0x38')](_0x1e8f23[_0xf57c('0x35')]['fields']));_0x4ac184[_0xf57c('0x39')]=_0x4ac184[_0xf57c('0x39')]['length']?_0x4ac184[_0xf57c('0x39')]:_0x16f0b9[_0xf57c('0x34')];_0x4ac184[_0xf57c('0x3c')]=qs['sort'](_0x1e8f23[_0xf57c('0x35')][_0xf57c('0x3d')]);_0x4ac184[_0xf57c('0x3e')]=qs[_0xf57c('0x36')](_['pick'](_0x1e8f23[_0xf57c('0x35')],_0x16f0b9['filters']));if(_0x1e8f23[_0xf57c('0x35')][_0xf57c('0x3f')]){_0x4ac184[_0xf57c('0x3e')]=_['merge'](_0x4ac184['where'],{'$or':_[_0xf57c('0x2f')](_0x4ac184[_0xf57c('0x39')],function(_0x283dc3){var _0x412894={};_0x412894[_0x283dc3]={'$like':'%'+_0x1e8f23[_0xf57c('0x35')][_0xf57c('0x3f')]+'%'};return _0x412894;})});}_0x4ac184=_[_0xf57c('0x40')]({},_0x4ac184,_0x1e8f23[_0xf57c('0x42')]);return _0x3a8504[_0xf57c('0xfe')](_0x4ac184);}})[_0xf57c('0x12')](function(_0x3660ba){if(_0x3660ba){_0x238865=_0x3660ba['length'];if(!_0x1e8f23[_0xf57c('0x35')][_0xf57c('0x3a')](_0xf57c('0x3b'))){_0x4ac184[_0xf57c('0x22')]=qs[_0xf57c('0x22')](_0x1e8f23[_0xf57c('0x35')]['limit']);_0x4ac184[_0xf57c('0x20')]=qs[_0xf57c('0x20')](_0x1e8f23['query'][_0xf57c('0x20')]);}return _0x3a8504['getProactiveActions'](_0x4ac184);}})[_0xf57c('0x12')](function(_0x2251e7){if(_0x2251e7){return _0x2251e7?{'count':_0x238865,'rows':_0x2251e7}:null;}})[_0xf57c('0x12')](respondWithResult(_0x32585f,null))[_0xf57c('0x1c')](handleError(_0x32585f,null));};exports[_0xf57c('0x119')]=function(_0x17f8df,_0xce3d19){var _0x4e4a7a=_0x17f8df[_0xf57c('0x35')]['online']===_0xf57c('0x11a')?_0xf57c('0x11b'):_0xf57c('0x11c');return db[_0xf57c('0x43')]['find']({'attributes':['id',_0x4e4a7a],'where':{'id':_0x17f8df[_0xf57c('0x46')]['id']}})[_0xf57c('0x12')](handleEntityNotFound(_0xce3d19,null))[_0xf57c('0x12')](function(_0x1cdaf7){if(_0x1cdaf7){var _0x3e76f3=_0x1cdaf7[_0x4e4a7a];var _0x4a8ffb=_0x3e76f3&&_0x3e76f3[_0xf57c('0x11d')]?_0x3e76f3[_0xf57c('0x11d')]:[];_0xce3d19['send']({'fromKey':_[_0xf57c('0x70')](_0x3e76f3[_0xf57c('0x11e')])?undefined:_0x3e76f3[_0xf57c('0x11e')],'count':_0x4a8ffb[_0xf57c('0x5b')],'rows':_0x4a8ffb});}})[_0xf57c('0x1c')](handleError(_0xce3d19,null));};exports['getOfflineMessages']=function(_0x2858ea,_0x3bc7f1){var _0x33fe3a={'raw':![],'where':{}};var _0x2e1f45={};var _0x576882={'count':0x0,'rows':[]};return db[_0xf57c('0x43')][_0xf57c('0x5a')]({'where':{'id':_0x2858ea[_0xf57c('0x46')]['id']}})[_0xf57c('0x12')](handleEntityNotFound(_0x3bc7f1,null))[_0xf57c('0x12')](function(_0x371dd7){if(_0x371dd7){_0x2e1f45[_0xf57c('0x34')]=_['keys'](db[_0xf57c('0xcf')][_0xf57c('0x30')]);_0x2e1f45[_0xf57c('0x35')]=_[_0xf57c('0x47')](_0x2858ea[_0xf57c('0x35')]);_0x2e1f45[_0xf57c('0x36')]=_[_0xf57c('0x37')](_0x2e1f45['model'],_0x2e1f45[_0xf57c('0x35')]);_0x33fe3a[_0xf57c('0x39')]=_[_0xf57c('0x37')](_0x2e1f45['model'],qs['fields'](_0x2858ea['query'][_0xf57c('0x38')]));_0x33fe3a[_0xf57c('0x39')]=_0x33fe3a[_0xf57c('0x39')]['length']?_0x33fe3a['attributes']:_0x2e1f45[_0xf57c('0x34')];if(!_0x2858ea[_0xf57c('0x35')]['hasOwnProperty'](_0xf57c('0x3b'))){_0x33fe3a['limit']=qs[_0xf57c('0x22')](_0x2858ea[_0xf57c('0x35')]['limit']);_0x33fe3a[_0xf57c('0x20')]=qs[_0xf57c('0x20')](_0x2858ea[_0xf57c('0x35')][_0xf57c('0x20')]);}_0x33fe3a[_0xf57c('0x3c')]=qs['sort'](_0x2858ea['query'][_0xf57c('0x3d')]);_0x33fe3a[_0xf57c('0x3e')]=qs[_0xf57c('0x36')](_[_0xf57c('0x5f')](_0x2858ea[_0xf57c('0x35')],_0x2e1f45['filters']));_0x33fe3a[_0xf57c('0x3e')][_0xf57c('0x57')]=_0x371dd7['id'];if(_0x2858ea[_0xf57c('0x35')]['filter']){_0x33fe3a[_0xf57c('0x3e')]=_[_0xf57c('0x40')](_0x33fe3a['where'],{'$or':_[_0xf57c('0x2f')](_0x33fe3a[_0xf57c('0x39')],function(_0x58764a){var _0x3b6235={};_0x3b6235[_0x58764a]={'$like':'%'+_0x2858ea['query'][_0xf57c('0x3f')]+'%'};return _0x3b6235;})});}_0x33fe3a=_[_0xf57c('0x40')]({},_0x33fe3a,_0x2858ea['options']);return db['ChatOfflineMessage'][_0xf57c('0x23')]({'where':_0x33fe3a[_0xf57c('0x3e')]})[_0xf57c('0x12')](function(_0x5691f6){_0x576882[_0xf57c('0x23')]=_0x5691f6;if(_0x2858ea[_0xf57c('0x35')][_0xf57c('0x48')]){_0x33fe3a[_0xf57c('0x49')]=[{'all':!![]}];}else{_0x33fe3a[_0xf57c('0x49')]=[{'model':db[_0xf57c('0x82')],'as':_0xf57c('0x11f'),'required':![]},{'model':db[_0xf57c('0xd9')],'as':_0xf57c('0x120'),'required':![]}];}return db[_0xf57c('0xcf')][_0xf57c('0x44')](_0x33fe3a);})[_0xf57c('0x12')](function(_0x513037){_0x576882['rows']=_0x513037;return _0x576882;});}})[_0xf57c('0x12')](respondWithFilteredResult(_0x3bc7f1,_0x33fe3a))[_0xf57c('0x1c')](handleError(_0x3bc7f1,null));};exports['addAgents']=function(_0x3e314e,_0x3fd323){return db[_0xf57c('0x43')]['find']({'where':{'id':_0x3e314e[_0xf57c('0x46')]['id']}})['then'](handleEntityNotFound(_0x3fd323,null))[_0xf57c('0x12')](function(_0x23e98b){if(_0x23e98b){return _0x23e98b[_0xf57c('0x121')](_0x3e314e[_0xf57c('0x4b')][_0xf57c('0x5e')],_['omit'](_0x3e314e[_0xf57c('0x4b')],['ids','id'])||{})[_0xf57c('0x122')](function(_0x447a1a){for(var _0x5159af=0x0;_0x5159af<_0x3e314e['body']['ids']['length'];_0x5159af+=0x1){socket[_0xf57c('0x123')]('userChatWebsite:save',{'UserId':Number(_0x3e314e['body'][_0xf57c('0x5e')][_0x5159af]),'ChatWebsiteId':Number(_0x3e314e[_0xf57c('0x46')]['id'])});}return _0x447a1a;});}})[_0xf57c('0x12')](respondWithResult(_0x3fd323,null))[_0xf57c('0x1c')](handleError(_0x3fd323,null));};exports[_0xf57c('0x124')]=function(_0x47b304,_0x3964f2){return db[_0xf57c('0x43')][_0xf57c('0x51')]({'where':{'id':_0x47b304[_0xf57c('0x46')]['id']}})['then'](handleEntityNotFound(_0x3964f2,null))['then'](function(_0xb2ccef){if(_0xb2ccef){return _0xb2ccef['removeAgents'](_0x47b304[_0xf57c('0x35')][_0xf57c('0x5e')])[_0xf57c('0x12')](function(){if(_['isArray'](_0x47b304[_0xf57c('0x35')][_0xf57c('0x5e')])){for(var _0x2a238a=0x0;_0x2a238a<_0x47b304[_0xf57c('0x35')][_0xf57c('0x5e')][_0xf57c('0x5b')];_0x2a238a+=0x1){socket['emit'](_0xf57c('0x125'),{'UserId':Number(_0x47b304[_0xf57c('0x35')][_0xf57c('0x5e')][_0x2a238a]),'ChatWebsiteId':Number(_0x47b304['params']['id'])});}}else{socket['emit'](_0xf57c('0x125'),{'UserId':Number(_0x47b304[_0xf57c('0x35')][_0xf57c('0x5e')]),'ChatWebsiteId':Number(_0x47b304['params']['id'])});}});}})[_0xf57c('0x12')](respondWithStatusCode(_0x3964f2,null))[_0xf57c('0x1c')](handleError(_0x3964f2,null));};exports[_0xf57c('0x126')]=function(_0x1ae119,_0x338204){var _0x316ce9={};var _0x59e14b={};var _0x106921;var _0x55c45d;return db[_0xf57c('0x43')]['findOne']({'where':{'id':_0x1ae119['params']['id']}})[_0xf57c('0x12')](handleEntityNotFound(_0x338204,null))[_0xf57c('0x12')](function(_0x43f1f0){if(_0x43f1f0){_0x106921=_0x43f1f0;_0x59e14b[_0xf57c('0x34')]=_[_0xf57c('0x47')](db['User']['rawAttributes']);_0x59e14b[_0xf57c('0x35')]=_[_0xf57c('0x47')](_0x1ae119[_0xf57c('0x35')]);_0x59e14b[_0xf57c('0x36')]=_[_0xf57c('0x37')](_0x59e14b['model'],_0x59e14b[_0xf57c('0x35')]);_0x316ce9[_0xf57c('0x39')]=_[_0xf57c('0x37')](_0x59e14b[_0xf57c('0x34')],qs['fields'](_0x1ae119[_0xf57c('0x35')]['fields']));_0x316ce9[_0xf57c('0x39')]=_0x316ce9[_0xf57c('0x39')][_0xf57c('0x5b')]?_0x316ce9[_0xf57c('0x39')]:_0x59e14b['model'];_0x316ce9[_0xf57c('0x3c')]=qs[_0xf57c('0x3d')](_0x1ae119[_0xf57c('0x35')][_0xf57c('0x3d')]);_0x316ce9['where']=qs[_0xf57c('0x36')](_[_0xf57c('0x5f')](_0x1ae119[_0xf57c('0x35')],_0x59e14b['filters']));if(_0x1ae119[_0xf57c('0x35')][_0xf57c('0x3f')]){_0x316ce9[_0xf57c('0x3e')]=_['merge'](_0x316ce9[_0xf57c('0x3e')],{'$or':_[_0xf57c('0x2f')](_0x316ce9[_0xf57c('0x39')],function(_0x2b62a7){var _0x272b39={};_0x272b39[_0x2b62a7]={'$like':'%'+_0x1ae119[_0xf57c('0x35')][_0xf57c('0x3f')]+'%'};return _0x272b39;})});}_0x316ce9=_[_0xf57c('0x40')]({},_0x316ce9,_0x1ae119[_0xf57c('0x42')]);return _0x106921[_0xf57c('0x126')](_0x316ce9);}})[_0xf57c('0x12')](function(_0x28b08d){if(_0x28b08d){_0x55c45d=_0x28b08d[_0xf57c('0x5b')];if(!_0x1ae119[_0xf57c('0x35')]['hasOwnProperty'](_0xf57c('0x3b'))){_0x316ce9[_0xf57c('0x22')]=qs[_0xf57c('0x22')](_0x1ae119[_0xf57c('0x35')][_0xf57c('0x22')]);_0x316ce9[_0xf57c('0x20')]=qs['offset'](_0x1ae119['query'][_0xf57c('0x20')]);}return _0x106921[_0xf57c('0x126')](_0x316ce9);}})[_0xf57c('0x12')](function(_0x5027c4){if(_0x5027c4){return _0x5027c4?{'count':_0x55c45d,'rows':_0x5027c4}:null;}})[_0xf57c('0x12')](respondWithResult(_0x338204,null))[_0xf57c('0x1c')](handleError(_0x338204,null));};
\ No newline at end of file
+var _0x8d9b=['UserProfileResource','stack','send','index','Pause','map','fieldName','type','key','model','name','query','keys','filters','intersection','fields','length','hasOwnProperty','where','pick','merge','VIRTUAL','filter','ChatWebsite','includeAll','include','findAll','rows','show','mandatoryDispositionPause','rawAttributes','attributes','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','UserProfileSection','userProfileId','autoAssociation','params','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','Disposition','nolimit','order','sort','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','file','addAvatar','agentAvatar','filename','addCustomerAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','getLicense','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','server/files/images/avatars/','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','Applications','applications','list','priority','asc','account','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','contact','messageId','created','autoclose','push','close','unmanaged','ChatMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','offline','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','defaults','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','files','offline-chat','basename','openNewInteraction','sequelize','transaction','bulkCreate','MailServerOut','Smtp','forwardOfflineAddress','host','port','auth','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','toPairsIn','mapValues','subjectOffline','Chat','NotifyMailAccount','notifyMail','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','internal','Tags','tag','Command','timezone','iftime\x20%s,%s','iftime\x20%s','interval','indexOf','info','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','getSnippet','Interval','virtual','custom','increment','chatLicenseExceeded','Intervals','all','server/files/chat/iframe.ejs','connection','render','verticalAlignment','color','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','READ_COMMITTED','ChatApplication','findAndCountAll','finally','getApplications','addProactiveActions','getProactiveActions','ChatProactiveAction','getFields','online','false','items','fromKey','getOfflineMessages','Attachment','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','getAgents','bluebird','mustache','util','path','ejs','querystring','../../components/parsers/qs','../../config/logger','redis','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','destroy','get'];(function(_0x2e3cb8,_0x590443){var _0x486d78=function(_0xf380f0){while(--_0xf380f0){_0x2e3cb8['push'](_0x2e3cb8['shift']());}};_0x486d78(++_0x590443);}(_0x8d9b,0x104));var _0xb8d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8d9b[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0xb8d9('0x0'));var Mustache=require(_0xb8d9('0x1'));var util=require(_0xb8d9('0x2'));var path=require(_0xb8d9('0x3'));var ejs=require(_0xb8d9('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var querystring=require(_0xb8d9('0x5'));var Redis=require('ioredis');var qs=require(_0xb8d9('0x6'));var logger=require(_0xb8d9('0x7'))('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xb8d9('0x8')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb8d9('0x9'))(new Redis(config[_0xb8d9('0x8')]));require(_0xb8d9('0xa'))[_0xb8d9('0xb')](socket);var htmlToText=require(_0xb8d9('0xc'));var jayson=require(_0xb8d9('0xd'));var client=jayson[_0xb8d9('0xe')]['http']({'port':0x232c});var client9002=jayson[_0xb8d9('0xe')]['http']({'port':0x232a});var client9003=jayson[_0xb8d9('0xe')][_0xb8d9('0xf')]({'port':0x232b});var client9001=jayson[_0xb8d9('0xe')][_0xb8d9('0xf')]({'port':0x2329});function respondWithRpcPromise(_0x7f604f,_0x13b1d8,_0x10b7fe,_0x265472){return new BPromise(function(_0x20674b,_0x11b664){var _0x2b3223=_0x265472||client;return _0x2b3223[_0xb8d9('0x10')](_0x7f604f,_0x10b7fe)[_0xb8d9('0x11')](function(_0xb3fa68){logger['info'](_0xb8d9('0x12'),_0x13b1d8,_0xb8d9('0x13'));logger[_0xb8d9('0x14')](_0xb8d9('0x15'),_0x13b1d8,_0xb8d9('0x13'),JSON['stringify'](_0xb3fa68));if(_0xb3fa68['error']){if(_0xb3fa68['error'][_0xb8d9('0x16')]===0x1f4){logger[_0xb8d9('0x17')](_0xb8d9('0x12'),_0x13b1d8,_0xb3fa68[_0xb8d9('0x17')]['message']);return _0x11b664(_0xb3fa68[_0xb8d9('0x17')]['message']);}logger[_0xb8d9('0x17')](_0xb8d9('0x12'),_0x13b1d8,_0xb3fa68[_0xb8d9('0x17')][_0xb8d9('0x18')]);return _0x20674b(_0xb3fa68[_0xb8d9('0x17')]['message']);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x13b1d8,_0xb8d9('0x13'));_0x20674b(_0xb3fa68[_0xb8d9('0x19')][_0xb8d9('0x18')]);}})[_0xb8d9('0x1a')](function(_0x3f4ea7){logger['error'](_0xb8d9('0x12'),_0x13b1d8,_0x3f4ea7);_0x11b664(_0x3f4ea7);});});}function respondWithStatusCode(_0x430794,_0x1a2bfe){_0x1a2bfe=_0x1a2bfe||0xcc;return function(_0x1e70e2){if(_0x1e70e2){return _0x430794[_0xb8d9('0x1b')](_0x1a2bfe);}return _0x430794[_0xb8d9('0x1c')](_0x1a2bfe)[_0xb8d9('0x1d')]();};}function respondWithResult(_0x3d1659,_0x3fa36e){_0x3fa36e=_0x3fa36e||0xc8;return function(_0x250457){if(_0x250457){return _0x3d1659['status'](_0x3fa36e)[_0xb8d9('0x1e')](_0x250457);}};}function respondWithFilteredResult(_0x49380d,_0x52b730){return function(_0x1eb6ee){if(_0x1eb6ee){var _0x1b6e1e=typeof _0x52b730[_0xb8d9('0x1f')]===_0xb8d9('0x20')&&typeof _0x52b730[_0xb8d9('0x21')]==='undefined';var _0x241041=_0x1eb6ee[_0xb8d9('0x22')];var _0x3111aa=_0x1b6e1e?0x0:_0x52b730['offset'];var _0x2d1439=_0x1b6e1e?_0x1eb6ee[_0xb8d9('0x22')]:_0x52b730[_0xb8d9('0x1f')]+_0x52b730['limit'];var _0x24a9cf;if(_0x2d1439>=_0x241041){_0x2d1439=_0x241041;_0x24a9cf=0xc8;}else{_0x24a9cf=0xce;}_0x49380d[_0xb8d9('0x1c')](_0x24a9cf);return _0x49380d['set'](_0xb8d9('0x23'),_0x3111aa+'-'+_0x2d1439+'/'+_0x241041)[_0xb8d9('0x1e')](_0x1eb6ee);}return null;};}function saveUpdates(_0x2694f0){return function(_0x1b1212){if(_0x1b1212){return _0x1b1212[_0xb8d9('0x24')](_0x2694f0)[_0xb8d9('0x11')](function(_0x13120c){return _0x13120c;});}return null;};}function removeEntity(_0x27ed72){return function(_0x8674fc){if(_0x8674fc){return _0x8674fc[_0xb8d9('0x25')]()['then'](function(){var _0x2097b0=_0x8674fc[_0xb8d9('0x26')]({'plain':!![]});var _0x2307fc='ChatWebsites';return db[_0xb8d9('0x27')][_0xb8d9('0x25')]({'where':{'type':_0x2307fc,'resourceId':_0x2097b0['id']}})[_0xb8d9('0x11')](function(){return _0x8674fc;});})[_0xb8d9('0x11')](function(){_0x27ed72[_0xb8d9('0x1c')](0xcc)[_0xb8d9('0x1d')]();});}};}function handleEntityNotFound(_0x4dc734){return function(_0x5a3c81){if(!_0x5a3c81){_0x4dc734[_0xb8d9('0x1b')](0x194);}return _0x5a3c81;};}function handleError(_0x125889,_0xaf13b){_0xaf13b=_0xaf13b||0x1f4;return function(_0x1daf9d){logger[_0xb8d9('0x17')](_0x1daf9d[_0xb8d9('0x28')]);if(_0x1daf9d['name']){delete _0x1daf9d['name'];}_0x125889[_0xb8d9('0x1c')](_0xaf13b)[_0xb8d9('0x29')](_0x1daf9d);};}exports[_0xb8d9('0x2a')]=function(_0x499334,_0x3866b2){var _0x4fca56={'include':[{'model':db[_0xb8d9('0x2b')],'as':'mandatoryDispositionPause'}]},_0x15ce53={},_0x34d007={'count':0x0,'rows':[]};var _0x3330e7=_[_0xb8d9('0x2c')](db['ChatWebsite']['rawAttributes'],function(_0xb6c649){return{'name':_0xb6c649[_0xb8d9('0x2d')],'type':_0xb6c649[_0xb8d9('0x2e')][_0xb8d9('0x2f')]};});_0x15ce53[_0xb8d9('0x30')]=_[_0xb8d9('0x2c')](_0x3330e7,_0xb8d9('0x31'));_0x15ce53[_0xb8d9('0x32')]=_[_0xb8d9('0x33')](_0x499334[_0xb8d9('0x32')]);_0x15ce53[_0xb8d9('0x34')]=_[_0xb8d9('0x35')](_0x15ce53[_0xb8d9('0x30')],_0x15ce53[_0xb8d9('0x32')]);_0x4fca56['attributes']=_['intersection'](_0x15ce53[_0xb8d9('0x30')],qs[_0xb8d9('0x36')](_0x499334[_0xb8d9('0x32')][_0xb8d9('0x36')]));_0x4fca56['attributes']=_0x4fca56['attributes'][_0xb8d9('0x37')]?_0x4fca56['attributes']:_0x15ce53[_0xb8d9('0x30')];if(!_0x499334['query'][_0xb8d9('0x38')]('nolimit')){_0x4fca56[_0xb8d9('0x21')]=qs[_0xb8d9('0x21')](_0x499334[_0xb8d9('0x32')]['limit']);_0x4fca56[_0xb8d9('0x1f')]=qs[_0xb8d9('0x1f')](_0x499334[_0xb8d9('0x32')]['offset']);}_0x4fca56['order']=qs['sort'](_0x499334['query']['sort']);_0x4fca56[_0xb8d9('0x39')]=qs[_0xb8d9('0x34')](_[_0xb8d9('0x3a')](_0x499334['query'],_0x15ce53['filters']),_0x3330e7);if(_0x499334[_0xb8d9('0x32')]['filter']){_0x4fca56[_0xb8d9('0x39')]=_[_0xb8d9('0x3b')](_0x4fca56[_0xb8d9('0x39')],{'$or':_[_0xb8d9('0x2c')](_0x3330e7,function(_0x41ad43){if(_0x41ad43['type']!==_0xb8d9('0x3c')){var _0x444d1a={};_0x444d1a[_0x41ad43['name']]={'$like':'%'+_0x499334[_0xb8d9('0x32')][_0xb8d9('0x3d')]+'%'};return _0x444d1a;}})});}_0x4fca56=_['merge']({},_0x4fca56,_0x499334['options']);var _0x3a2f4b={'where':_0x4fca56[_0xb8d9('0x39')]};return db[_0xb8d9('0x3e')][_0xb8d9('0x22')](_0x3a2f4b)[_0xb8d9('0x11')](function(_0x533ba7){_0x34d007[_0xb8d9('0x22')]=_0x533ba7;if(_0x499334[_0xb8d9('0x32')][_0xb8d9('0x3f')]){_0x4fca56[_0xb8d9('0x40')]=[{'all':!![]}];}return db[_0xb8d9('0x3e')][_0xb8d9('0x41')](_0x4fca56);})['then'](function(_0x181182){_0x34d007[_0xb8d9('0x42')]=_0x181182;return _0x34d007;})[_0xb8d9('0x11')](respondWithFilteredResult(_0x3866b2,_0x4fca56))[_0xb8d9('0x1a')](handleError(_0x3866b2,null));};exports[_0xb8d9('0x43')]=function(_0x367920,_0x59a26d){var _0x3cd322={'raw':![],'where':{'id':_0x367920['params']['id']},'include':[{'model':db[_0xb8d9('0x2b')],'as':_0xb8d9('0x44')}]},_0x7da2c={};_0x7da2c['model']=_['keys'](db[_0xb8d9('0x3e')][_0xb8d9('0x45')]);_0x7da2c[_0xb8d9('0x32')]=_[_0xb8d9('0x33')](_0x367920[_0xb8d9('0x32')]);_0x7da2c[_0xb8d9('0x34')]=_[_0xb8d9('0x35')](_0x7da2c['model'],_0x7da2c[_0xb8d9('0x32')]);_0x3cd322[_0xb8d9('0x46')]=_[_0xb8d9('0x35')](_0x7da2c['model'],qs[_0xb8d9('0x36')](_0x367920[_0xb8d9('0x32')]['fields']));_0x3cd322['attributes']=_0x3cd322[_0xb8d9('0x46')][_0xb8d9('0x37')]?_0x3cd322['attributes']:_0x7da2c[_0xb8d9('0x30')];if(_0x367920[_0xb8d9('0x32')][_0xb8d9('0x3f')]){_0x3cd322[_0xb8d9('0x40')]=[{'all':!![]}];}_0x3cd322=_['merge']({},_0x3cd322,_0x367920[_0xb8d9('0x47')]);return db[_0xb8d9('0x3e')][_0xb8d9('0x48')](_0x3cd322)[_0xb8d9('0x11')](handleEntityNotFound(_0x59a26d,null))[_0xb8d9('0x11')](respondWithResult(_0x59a26d,null))[_0xb8d9('0x1a')](handleError(_0x59a26d,null));};exports[_0xb8d9('0x49')]=function(_0x518bb4,_0x3101da){return db['ChatWebsite'][_0xb8d9('0x49')](_0x518bb4[_0xb8d9('0x4a')],{})[_0xb8d9('0x11')](function(_0x5c1c55){var _0x181878=_0x518bb4[_0xb8d9('0x4b')][_0xb8d9('0x26')]({'plain':!![]});if(!_0x181878)throw new Error(_0xb8d9('0x4c'));if(_0x181878[_0xb8d9('0x4d')]===_0xb8d9('0x4b')){var _0x4533e5=_0x5c1c55[_0xb8d9('0x26')]({'plain':!![]});var _0x400f9b=_0xb8d9('0x4e');return db[_0xb8d9('0x4f')]['find']({'where':{'name':_0x400f9b,'userProfileId':_0x181878[_0xb8d9('0x50')]},'raw':!![]})[_0xb8d9('0x11')](function(_0x242100){if(_0x242100&&_0x242100[_0xb8d9('0x51')]===0x0){return db['UserProfileResource'][_0xb8d9('0x49')]({'name':_0x4533e5[_0xb8d9('0x31')],'resourceId':_0x4533e5['id'],'type':_0x242100[_0xb8d9('0x31')],'sectionId':_0x242100['id']},{})[_0xb8d9('0x11')](function(){return _0x5c1c55;});}else{return _0x5c1c55;}})[_0xb8d9('0x1a')](function(_0x52512d){logger[_0xb8d9('0x17')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x52512d);throw _0x52512d;});}return _0x5c1c55;})[_0xb8d9('0x11')](respondWithResult(_0x3101da,0xc9))[_0xb8d9('0x1a')](handleError(_0x3101da,null));};exports[_0xb8d9('0x24')]=function(_0x13cf3b,_0x24ccf4){if(_0x13cf3b[_0xb8d9('0x4a')]['id']){delete _0x13cf3b[_0xb8d9('0x4a')]['id'];}return db['ChatWebsite'][_0xb8d9('0x48')]({'where':{'id':_0x13cf3b[_0xb8d9('0x52')]['id']},'include':[{'model':db['Pause'],'as':_0xb8d9('0x44')}]})['then'](handleEntityNotFound(_0x24ccf4,null))[_0xb8d9('0x11')](saveUpdates(_0x13cf3b[_0xb8d9('0x4a')],null))['then'](respondWithResult(_0x24ccf4,null))[_0xb8d9('0x1a')](handleError(_0x24ccf4,null));};exports[_0xb8d9('0x25')]=function(_0x48bf68,_0x45fe4a){return db[_0xb8d9('0x3e')]['find']({'where':{'id':_0x48bf68[_0xb8d9('0x52')]['id']}})['then'](handleEntityNotFound(_0x45fe4a,null))[_0xb8d9('0x11')](removeEntity(_0x45fe4a,null))[_0xb8d9('0x1a')](handleError(_0x45fe4a,null));};exports[_0xb8d9('0x53')]=function(_0x1e62fa,_0x44b6ce){return db['ChatWebsite']['describe']()['then'](respondWithResult(_0x44b6ce,null))[_0xb8d9('0x1a')](handleError(_0x44b6ce,null));};exports[_0xb8d9('0x54')]=function(_0x32e433,_0x389adc){if(_0x32e433[_0xb8d9('0x4a')]['id']){delete _0x32e433[_0xb8d9('0x4a')]['id'];}return db[_0xb8d9('0x3e')][_0xb8d9('0x48')]({'where':{'id':_0x32e433[_0xb8d9('0x52')]['id']}})[_0xb8d9('0x11')](handleEntityNotFound(_0x389adc,null))[_0xb8d9('0x11')](function(_0x32e58f){if(_0x32e58f){_0x32e433[_0xb8d9('0x4a')][_0xb8d9('0x55')]=_0x32e58f['id'];return db['Disposition'][_0xb8d9('0x49')](_0x32e433[_0xb8d9('0x4a')]);}})[_0xb8d9('0x11')](respondWithResult(_0x389adc,null))[_0xb8d9('0x1a')](handleError(_0x389adc,null));};exports[_0xb8d9('0x56')]=function(_0x5bc526,_0x2b2d8f){var _0x2fb1a9={'raw':![],'where':{}};var _0x55e2eb={};var _0x3561fe={'count':0x0,'rows':[]};return db[_0xb8d9('0x3e')][_0xb8d9('0x57')]({'where':{'id':_0x5bc526['params']['id']}})[_0xb8d9('0x11')](handleEntityNotFound(_0x2b2d8f,null))['then'](function(_0x327baa){if(_0x327baa){_0x55e2eb[_0xb8d9('0x30')]=_[_0xb8d9('0x33')](db[_0xb8d9('0x58')]['rawAttributes']);_0x55e2eb[_0xb8d9('0x32')]=_[_0xb8d9('0x33')](_0x5bc526[_0xb8d9('0x32')]);_0x55e2eb['filters']=_['intersection'](_0x55e2eb[_0xb8d9('0x30')],_0x55e2eb['query']);_0x2fb1a9[_0xb8d9('0x46')]=_[_0xb8d9('0x35')](_0x55e2eb[_0xb8d9('0x30')],qs[_0xb8d9('0x36')](_0x5bc526['query'][_0xb8d9('0x36')]));_0x2fb1a9[_0xb8d9('0x46')]=_0x2fb1a9['attributes']['length']?_0x2fb1a9[_0xb8d9('0x46')]:_0x55e2eb['model'];if(!_0x5bc526['query'][_0xb8d9('0x38')](_0xb8d9('0x59'))){_0x2fb1a9[_0xb8d9('0x21')]=qs[_0xb8d9('0x21')](_0x5bc526['query'][_0xb8d9('0x21')]);_0x2fb1a9[_0xb8d9('0x1f')]=qs['offset'](_0x5bc526[_0xb8d9('0x32')][_0xb8d9('0x1f')]);}_0x2fb1a9[_0xb8d9('0x5a')]=qs['sort'](_0x5bc526['query'][_0xb8d9('0x5b')]);_0x2fb1a9[_0xb8d9('0x39')]=qs[_0xb8d9('0x34')](_[_0xb8d9('0x3a')](_0x5bc526[_0xb8d9('0x32')],_0x55e2eb[_0xb8d9('0x34')]));_0x2fb1a9[_0xb8d9('0x39')]['ChatWebsiteId']=_0x327baa['id'];if(_0x5bc526[_0xb8d9('0x32')][_0xb8d9('0x3d')]){_0x2fb1a9[_0xb8d9('0x39')]=_[_0xb8d9('0x3b')](_0x2fb1a9[_0xb8d9('0x39')],{'$or':_[_0xb8d9('0x2c')](_0x2fb1a9[_0xb8d9('0x46')],function(_0x577aac){var _0x10b2e9={};_0x10b2e9[_0x577aac]={'$like':'%'+_0x5bc526['query'][_0xb8d9('0x3d')]+'%'};return _0x10b2e9;})});}_0x2fb1a9=_[_0xb8d9('0x3b')]({},_0x2fb1a9,_0x5bc526[_0xb8d9('0x47')]);return db[_0xb8d9('0x58')][_0xb8d9('0x22')]({'where':_0x2fb1a9['where']})[_0xb8d9('0x11')](function(_0x515dff){_0x3561fe[_0xb8d9('0x22')]=_0x515dff;if(_0x5bc526['query']['includeAll']){_0x2fb1a9[_0xb8d9('0x40')]=[{'all':!![]}];}return db['Disposition'][_0xb8d9('0x41')](_0x2fb1a9);})[_0xb8d9('0x11')](function(_0x26ed5e){_0x3561fe['rows']=_0x26ed5e;return _0x3561fe;});}})[_0xb8d9('0x11')](respondWithFilteredResult(_0x2b2d8f,_0x2fb1a9))['catch'](handleError(_0x2b2d8f,null));};exports[_0xb8d9('0x5c')]=function(_0x16a62a,_0x33d327){return db[_0xb8d9('0x3e')]['find']({'where':{'id':_0x16a62a[_0xb8d9('0x52')]['id']}})['then'](handleEntityNotFound(_0x33d327,null))[_0xb8d9('0x11')](function(_0x351b4a){if(_0x351b4a){return _0x351b4a['removeDispositions'](_0x16a62a[_0xb8d9('0x32')]['ids']);}})[_0xb8d9('0x11')](respondWithStatusCode(_0x33d327,null))[_0xb8d9('0x1a')](handleError(_0x33d327,null));};exports[_0xb8d9('0x5d')]=function(_0xfaaf4e,_0xe67b56){if(_0xfaaf4e['body']['id']){delete _0xfaaf4e[_0xb8d9('0x4a')]['id'];}return db[_0xb8d9('0x3e')][_0xb8d9('0x48')]({'where':{'id':_0xfaaf4e['params']['id']}})[_0xb8d9('0x11')](handleEntityNotFound(_0xe67b56,null))['then'](function(_0x23ed8d){if(_0x23ed8d){_0xfaaf4e[_0xb8d9('0x4a')][_0xb8d9('0x55')]=_0x23ed8d['id'];return db[_0xb8d9('0x5e')][_0xb8d9('0x49')](_0xfaaf4e[_0xb8d9('0x4a')]);}})[_0xb8d9('0x11')](respondWithResult(_0xe67b56,null))[_0xb8d9('0x1a')](handleError(_0xe67b56,null));};exports[_0xb8d9('0x5f')]=function(_0x3fa2fc,_0x44e76a){var _0x410bf8={'raw':![],'where':{}};var _0x51e5e7={};var _0x5ef59a={'count':0x0,'rows':[]};return db[_0xb8d9('0x3e')]['findOne']({'where':{'id':_0x3fa2fc[_0xb8d9('0x52')]['id']}})['then'](handleEntityNotFound(_0x44e76a,null))[_0xb8d9('0x11')](function(_0x1a8d14){if(_0x1a8d14){_0x51e5e7[_0xb8d9('0x30')]=_[_0xb8d9('0x33')](db[_0xb8d9('0x5e')][_0xb8d9('0x45')]);_0x51e5e7['query']=_[_0xb8d9('0x33')](_0x3fa2fc[_0xb8d9('0x32')]);_0x51e5e7[_0xb8d9('0x34')]=_[_0xb8d9('0x35')](_0x51e5e7[_0xb8d9('0x30')],_0x51e5e7['query']);_0x410bf8[_0xb8d9('0x46')]=_[_0xb8d9('0x35')](_0x51e5e7[_0xb8d9('0x30')],qs[_0xb8d9('0x36')](_0x3fa2fc['query'][_0xb8d9('0x36')]));_0x410bf8[_0xb8d9('0x46')]=_0x410bf8[_0xb8d9('0x46')]['length']?_0x410bf8['attributes']:_0x51e5e7[_0xb8d9('0x30')];if(!_0x3fa2fc[_0xb8d9('0x32')][_0xb8d9('0x38')]('nolimit')){_0x410bf8[_0xb8d9('0x21')]=qs['limit'](_0x3fa2fc[_0xb8d9('0x32')][_0xb8d9('0x21')]);_0x410bf8[_0xb8d9('0x1f')]=qs[_0xb8d9('0x1f')](_0x3fa2fc[_0xb8d9('0x32')][_0xb8d9('0x1f')]);}_0x410bf8[_0xb8d9('0x5a')]=qs[_0xb8d9('0x5b')](_0x3fa2fc['query'][_0xb8d9('0x5b')]);_0x410bf8[_0xb8d9('0x39')]=qs[_0xb8d9('0x34')](_['pick'](_0x3fa2fc[_0xb8d9('0x32')],_0x51e5e7[_0xb8d9('0x34')]));_0x410bf8[_0xb8d9('0x39')][_0xb8d9('0x55')]=_0x1a8d14['id'];if(_0x3fa2fc['query'][_0xb8d9('0x3d')]){_0x410bf8[_0xb8d9('0x39')]=_[_0xb8d9('0x3b')](_0x410bf8['where'],{'$or':_[_0xb8d9('0x2c')](_0x410bf8[_0xb8d9('0x46')],function(_0x384b83){var _0x231d33={};_0x231d33[_0x384b83]={'$like':'%'+_0x3fa2fc[_0xb8d9('0x32')][_0xb8d9('0x3d')]+'%'};return _0x231d33;})});}_0x410bf8=_[_0xb8d9('0x3b')]({},_0x410bf8,_0x3fa2fc[_0xb8d9('0x47')]);return db[_0xb8d9('0x5e')][_0xb8d9('0x22')]({'where':_0x410bf8['where']})['then'](function(_0x2bb7a4){_0x5ef59a[_0xb8d9('0x22')]=_0x2bb7a4;if(_0x3fa2fc['query'][_0xb8d9('0x3f')]){_0x410bf8[_0xb8d9('0x40')]=[{'all':!![]}];}return db[_0xb8d9('0x5e')][_0xb8d9('0x41')](_0x410bf8);})[_0xb8d9('0x11')](function(_0x19c02e){_0x5ef59a['rows']=_0x19c02e;return _0x5ef59a;});}})[_0xb8d9('0x11')](respondWithFilteredResult(_0x44e76a,_0x410bf8))['catch'](handleError(_0x44e76a,null));};exports[_0xb8d9('0x60')]=function(_0x438f18,_0x1bb3d2){return db[_0xb8d9('0x3e')][_0xb8d9('0x48')]({'where':{'id':_0x438f18[_0xb8d9('0x52')]['id']}})[_0xb8d9('0x11')](handleEntityNotFound(_0x1bb3d2,null))[_0xb8d9('0x11')](function(_0x51efa7){if(_0x51efa7){return _0x51efa7[_0xb8d9('0x60')](_0x438f18[_0xb8d9('0x32')][_0xb8d9('0x61')]);}})['then'](respondWithStatusCode(_0x1bb3d2,null))[_0xb8d9('0x1a')](handleError(_0x1bb3d2,null));};exports['addLogo']=function(_0x31e2e7,_0xb84761){_0x31e2e7[_0xb8d9('0x4a')]['sitepic']=_0x31e2e7[_0xb8d9('0x62')]['filename'];return db[_0xb8d9('0x3e')]['find']({'where':{'id':_0x31e2e7[_0xb8d9('0x52')]['id']}})[_0xb8d9('0x11')](handleEntityNotFound(_0xb84761,null))[_0xb8d9('0x11')](saveUpdates(_0x31e2e7[_0xb8d9('0x4a')],null))[_0xb8d9('0x11')](respondWithResult(_0xb84761,null))[_0xb8d9('0x1a')](handleError(_0xb84761,null));};exports[_0xb8d9('0x63')]=function(_0x1980f2,_0x20356a){_0x1980f2[_0xb8d9('0x4a')][_0xb8d9('0x64')]=_0x1980f2[_0xb8d9('0x62')][_0xb8d9('0x65')];return db[_0xb8d9('0x3e')][_0xb8d9('0x48')]({'where':{'id':_0x1980f2[_0xb8d9('0x52')]['id']}})[_0xb8d9('0x11')](handleEntityNotFound(_0x20356a,null))['then'](saveUpdates(_0x1980f2[_0xb8d9('0x4a')],null))[_0xb8d9('0x11')](respondWithResult(_0x20356a,null))['catch'](handleError(_0x20356a,null));};exports[_0xb8d9('0x66')]=function(_0x55ba23,_0x5379fb){_0x55ba23['body']['customerAvatar']=_0x55ba23[_0xb8d9('0x62')]['filename'];return db[_0xb8d9('0x3e')][_0xb8d9('0x48')]({'where':{'id':_0x55ba23[_0xb8d9('0x52')]['id']}})['then'](handleEntityNotFound(_0x5379fb,null))[_0xb8d9('0x11')](saveUpdates(_0x55ba23[_0xb8d9('0x4a')],null))[_0xb8d9('0x11')](respondWithResult(_0x5379fb,null))[_0xb8d9('0x1a')](handleError(_0x5379fb,null));};exports['addSystemAvatar']=function(_0x5b3fdc,_0x4b47ec){_0x5b3fdc[_0xb8d9('0x4a')][_0xb8d9('0x67')]=_0x5b3fdc[_0xb8d9('0x62')][_0xb8d9('0x65')];return db['ChatWebsite']['find']({'where':{'id':_0x5b3fdc[_0xb8d9('0x52')]['id']}})[_0xb8d9('0x11')](handleEntityNotFound(_0x4b47ec,null))[_0xb8d9('0x11')](saveUpdates(_0x5b3fdc['body'],null))[_0xb8d9('0x11')](respondWithResult(_0x4b47ec,null))[_0xb8d9('0x1a')](handleError(_0x4b47ec,null));};exports[_0xb8d9('0x68')]=function(_0xd346b9,_0x22f3da){var _0xfc676f=path[_0xb8d9('0x69')](config[_0xb8d9('0x6a')],_0xb8d9('0x6b'));var _0x1134fc={'where':{'id':_0xd346b9[_0xb8d9('0x52')]['id']},'attributes':['id',_0xb8d9('0x6c')],'raw':!![]};var _0x447464=![];return require(_0xb8d9('0x6d'))[_0xb8d9('0x6e')]()[_0xb8d9('0x11')](function(_0x13561f){if(_0x13561f){_0x447464=_0x13561f['custom'];}})[_0xb8d9('0x11')](function(){return db[_0xb8d9('0x3e')][_0xb8d9('0x48')](_0x1134fc);})[_0xb8d9('0x11')](handleEntityNotFound(_0x22f3da,null))['then'](function(_0x43ee00){if(_0x43ee00){if(!_[_0xb8d9('0x6f')](_0x43ee00['sitepic'])){if(fs[_0xb8d9('0x70')](path['join'](config[_0xb8d9('0x6a')],_0xb8d9('0x71'),_0x43ee00['sitepic']))&&_0x447464){_0xfc676f=path['join'](config[_0xb8d9('0x6a')],'server/files/images/logos/',_0x43ee00['sitepic']);}}return _0x22f3da[_0xb8d9('0x72')](_0xfc676f);}})[_0xb8d9('0x1a')](handleError(_0x22f3da,null));};exports[_0xb8d9('0x73')]=function(_0x49dd64,_0x3de96c){var _0x485194=path[_0xb8d9('0x69')](config[_0xb8d9('0x6a')],_0xb8d9('0x74'));var _0x539ce2={'where':{'id':_0x49dd64[_0xb8d9('0x52')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xb8d9('0x3e')][_0xb8d9('0x48')](_0x539ce2)[_0xb8d9('0x11')](handleEntityNotFound(_0x3de96c,null))['then'](function(_0xb2c9ec){if(_0xb2c9ec){if(!_[_0xb8d9('0x6f')](_0xb2c9ec[_0xb8d9('0x64')])){if(fs['existsSync'](path[_0xb8d9('0x69')](config[_0xb8d9('0x6a')],'server/files/images/avatars/',_0xb2c9ec[_0xb8d9('0x64')]))){_0x485194=path[_0xb8d9('0x69')](config[_0xb8d9('0x6a')],'server/files/images/avatars/',_0xb2c9ec['agentAvatar']);}}return _0x3de96c[_0xb8d9('0x72')](_0x485194);}})[_0xb8d9('0x1a')](handleError(_0x3de96c,null));};exports[_0xb8d9('0x75')]=function(_0x57d3a6,_0x263f26){var _0x3061e5=path[_0xb8d9('0x69')](config['root'],_0xb8d9('0x76'));var _0x52febc={'where':{'id':_0x57d3a6[_0xb8d9('0x52')]['id']},'attributes':['id',_0xb8d9('0x77'),'showCustomerAvatar'],'raw':!![]};return db[_0xb8d9('0x3e')][_0xb8d9('0x48')](_0x52febc)[_0xb8d9('0x11')](handleEntityNotFound(_0x263f26,null))['then'](function(_0x20e87a){if(_0x20e87a){if(!_[_0xb8d9('0x6f')](_0x20e87a[_0xb8d9('0x77')])){if(fs[_0xb8d9('0x70')](path[_0xb8d9('0x69')](config[_0xb8d9('0x6a')],'server/files/images/avatars/',_0x20e87a[_0xb8d9('0x77')]))&&_0x20e87a[_0xb8d9('0x78')]){_0x3061e5=path[_0xb8d9('0x69')](config[_0xb8d9('0x6a')],_0xb8d9('0x79'),_0x20e87a[_0xb8d9('0x77')]);}}return _0x263f26['download'](_0x3061e5);}})['catch'](handleError(_0x263f26,null));};exports[_0xb8d9('0x7a')]=function(_0x58aefd,_0x14e3dc){var _0x399375=path[_0xb8d9('0x69')](config[_0xb8d9('0x6a')],_0xb8d9('0x7b'));var _0x10383f={'where':{'id':_0x58aefd[_0xb8d9('0x52')]['id']},'attributes':['id',_0xb8d9('0x67')],'raw':!![]};return db['ChatWebsite']['find'](_0x10383f)[_0xb8d9('0x11')](handleEntityNotFound(_0x14e3dc,null))[_0xb8d9('0x11')](function(_0x46b465){if(_0x46b465){if(!_[_0xb8d9('0x6f')](_0x46b465[_0xb8d9('0x67')])){if(fs['existsSync'](path[_0xb8d9('0x69')](config[_0xb8d9('0x6a')],_0xb8d9('0x79'),_0x46b465[_0xb8d9('0x67')]))){_0x399375=path[_0xb8d9('0x69')](config[_0xb8d9('0x6a')],_0xb8d9('0x79'),_0x46b465[_0xb8d9('0x67')]);}}return _0x14e3dc[_0xb8d9('0x72')](_0x399375);}})[_0xb8d9('0x1a')](handleError(_0x14e3dc,null));};exports[_0xb8d9('0x7c')]=function(_0x32ef0c,_0x39d3bc){var _0x2559b8=require(_0xb8d9('0x7d'));var _0x5aa2a7=new _0x2559b8();var _0x5ddcb3=_0x5aa2a7[_0xb8d9('0x7e')](_0x32ef0c['headers']['user-agent'])[_0xb8d9('0x7f')]();var _0xf07a80={'body':_0x32ef0c[_0xb8d9('0x4a')],'channel':_0xb8d9('0x80')};var _0x2202e8=[];var _0x552ccd=[];var _0x2f70e7={};var _0x544c29=![];return db[_0xb8d9('0x81')][_0xb8d9('0x53')]()[_0xb8d9('0x11')](function(_0x529795){if(!_0x529795){throw new db[(_0xb8d9('0x82'))][(_0xb8d9('0x83'))](_0xb8d9('0x84'));}_0x2202e8=_[_0xb8d9('0x85')](_[_0xb8d9('0x33')](_0x529795),[_0xb8d9('0x86'),_0xb8d9('0x87')]);_0x552ccd=_[_0xb8d9('0x85')](_[_0xb8d9('0x33')](_0x529795),[_0xb8d9('0x86'),_0xb8d9('0x87'),_0xb8d9('0x88'),_0xb8d9('0x89')]);if(_0x32ef0c[_0xb8d9('0x4a')]['id']){delete _0x32ef0c[_0xb8d9('0x4a')]['id'];}if(_[_0xb8d9('0x6f')](_0x32ef0c['body'][_0xb8d9('0x8a')])){throw new db[(_0xb8d9('0x82'))][(_0xb8d9('0x83'))](_0xb8d9('0x8b'));}if(_[_0xb8d9('0x6f')](_0x32ef0c[_0xb8d9('0x4a')]['body'])||_0x32ef0c[_0xb8d9('0x4a')][_0xb8d9('0x4a')]===''){throw new db[(_0xb8d9('0x82'))][(_0xb8d9('0x83'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xb8d9('0x6f')](_0x32ef0c[_0xb8d9('0x4a')]['mapKey'])){throw new db[(_0xb8d9('0x82'))][(_0xb8d9('0x83'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x552ccd);}if(!_[_0xb8d9('0x8c')](_0x552ccd,_0x32ef0c['body'][_0xb8d9('0x8d')])){throw new db[(_0xb8d9('0x82'))][(_0xb8d9('0x83'))](_0xb8d9('0x8e')+_0x552ccd);}_0x2f70e7[_0x32ef0c[_0xb8d9('0x4a')][_0xb8d9('0x8d')]]=_0x32ef0c['body'][_0xb8d9('0x8a')];})['then'](function(){return db[_0xb8d9('0x3e')][_0xb8d9('0x48')]({'where':{'id':_0x32ef0c[_0xb8d9('0x52')]['id']},'include':[{'model':db[_0xb8d9('0x8f')],'as':_0xb8d9('0x90'),'include':[{'model':db[_0xb8d9('0x81')],'as':_0xb8d9('0x91'),'where':_0x2f70e7,'limit':0x1,'order':[['updatedAt',_0xb8d9('0x92')]]}]},{'model':db['ChatApplication'],'as':_0xb8d9('0x93')}]});})[_0xb8d9('0x11')](handleEntityNotFound(_0x39d3bc,null))[_0xb8d9('0x11')](function(_0x523bad){if(_0x523bad&&_0x523bad[_0xb8d9('0x90')]){_0xf07a80['account']=_0x523bad;_0xf07a80[_0xb8d9('0x94')]=_0x523bad[_0xb8d9('0x93')];_0xf07a80[_0xb8d9('0x95')]=_0x523bad['List'];_0xf07a80[_0xb8d9('0x94')]=_['orderBy'](_0xf07a80[_0xb8d9('0x94')],[_0xb8d9('0x96')],[_0xb8d9('0x97')]);if(_0xf07a80[_0xb8d9('0x98')][_0xb8d9('0x93')]){delete _0xf07a80['account']['Applications'];}if(_0xf07a80[_0xb8d9('0x98')]['List']&&_0xf07a80[_0xb8d9('0x98')][_0xb8d9('0x90')]['Contacts'][_0xb8d9('0x37')]){return _0xf07a80[_0xb8d9('0x98')][_0xb8d9('0x90')][_0xb8d9('0x91')][0x0];}var _0x562bce=_['defaults'](_0x32ef0c[_0xb8d9('0x4a')],{'firstName':_0x32ef0c[_0xb8d9('0x4a')]['from'],'ListId':_0x523bad['ListId']});_0x562bce[_0x32ef0c['body'][_0xb8d9('0x8d')]]=_0x32ef0c[_0xb8d9('0x4a')][_0xb8d9('0x8a')];return db['CmContact'][_0xb8d9('0x49')](_0x562bce,{'fields':_0x2202e8,'raw':!![]});}})[_0xb8d9('0x11')](handleEntityNotFound(_0x39d3bc,null))['then'](function(_0x411c75){_0xf07a80['contact']=_0x411c75;var _0xb92518=_0x32ef0c[_0xb8d9('0x4a')][_0xb8d9('0x99')];if(_0x32ef0c[_0xb8d9('0x9a')][_0xb8d9('0x9b')]){_0xb92518=_0x32ef0c[_0xb8d9('0x9a')]['cf-connecting-ip'];}else if(_0x32ef0c['headers'][_0xb8d9('0x9c')]){_0xb92518=_[_0xb8d9('0x9d')](_0x32ef0c[_0xb8d9('0x9a')][_0xb8d9('0x9c')][_0xb8d9('0x9e')](','));}if(_0x411c75){var _0x5dc6c1={'ContactId':_0x411c75['id'],'ChatWebsiteId':_0x32ef0c[_0xb8d9('0x52')]['id'],'from':(_0x411c75[_0xb8d9('0x9f')]||'')+'\x20'+(_0x411c75[_0xb8d9('0xa0')]||''),'customerIp':_0xb92518,'customerPort':_0x32ef0c[_0xb8d9('0x9a')]['x-real-port']?_0x32ef0c['headers'][_0xb8d9('0xa1')]:null,'referer':_0x32ef0c['body'][_0xb8d9('0xa2')],'browserName':_0x5ddcb3[_0xb8d9('0xa3')][_0xb8d9('0x31')]&&_0x5ddcb3[_0xb8d9('0xa3')][_0xb8d9('0xa4')]?util[_0xb8d9('0xa5')](_0xb8d9('0xa6'),_0x5ddcb3['browser']['name'],_0x5ddcb3[_0xb8d9('0xa3')][_0xb8d9('0xa4')]):'unknown','browserVersion':_0x5ddcb3[_0xb8d9('0xa3')][_0xb8d9('0xa4')]||_0xb8d9('0xa7'),'osName':util[_0xb8d9('0xa5')](_0xb8d9('0xa6'),_0x5ddcb3['os'][_0xb8d9('0x31')],_0x5ddcb3['os']['version']),'osVersion':_0x5ddcb3['os'][_0xb8d9('0xa4')],'deviceModel':_0x5ddcb3[_0xb8d9('0xa8')][_0xb8d9('0x30')]&&_0x5ddcb3[_0xb8d9('0xa8')][_0xb8d9('0xa9')]?util['format'](_0xb8d9('0xaa'),_0x5ddcb3[_0xb8d9('0xa8')][_0xb8d9('0x30')],_0x5ddcb3[_0xb8d9('0xa8')][_0xb8d9('0xa9')],_0x5ddcb3[_0xb8d9('0xa8')][_0xb8d9('0x2e')]):null,'deviceVendor':_0x5ddcb3[_0xb8d9('0xa8')][_0xb8d9('0xa9')],'deviceType':_0x5ddcb3[_0xb8d9('0xa8')][_0xb8d9('0x2e')],'formData':JSON[_0xb8d9('0xab')](_0x32ef0c['body'])};var _0x3099bd={'ChatWebsiteId':_0x32ef0c[_0xb8d9('0x52')]['id'],'closed':![]};if(_0x32ef0c['body'][_0xb8d9('0xac')]){_0x3099bd[_0xb8d9('0xac')]=_0x32ef0c['body'][_0xb8d9('0xac')];return db[_0xb8d9('0xad')]['find']({'where':_0x3099bd})[_0xb8d9('0x11')](function(_0x4ed699){if(_0x4ed699){return[_0x4ed699,![]];}_0x5dc6c1['threadId']=_0x32ef0c[_0xb8d9('0x4a')][_0xb8d9('0xac')];_0x5dc6c1[_0xb8d9('0xae')]=_0x32ef0c[_0xb8d9('0x4a')][_0xb8d9('0xae')];return db[_0xb8d9('0xad')]['create'](_0x5dc6c1)[_0xb8d9('0x11')](function(_0x2b31ba){return[_0x2b31ba,!![]];});});}_0x3099bd[_0xb8d9('0xaf')]=_0x411c75['id'];if(_0x32ef0c[_0xb8d9('0x4a')][_0xb8d9('0xb0')]&&_0x32ef0c[_0xb8d9('0x4a')][_0xb8d9('0xb0')]['id']){_0x3099bd['id']=_0x32ef0c[_0xb8d9('0x4a')][_0xb8d9('0xb0')]['id'];return db['ChatInteraction'][_0xb8d9('0x48')]({'where':_0x3099bd})[_0xb8d9('0x11')](function(_0x42575b){if(_0x42575b){return[_0x42575b,![]];}return db[_0xb8d9('0xad')]['create'](_0x5dc6c1)['then'](function(_0x1c1fb9){return[_0x1c1fb9,!![]];});});}return db[_0xb8d9('0xad')][_0xb8d9('0x49')](_0x5dc6c1)[_0xb8d9('0x11')](function(_0x1f55d6){return[_0x1f55d6,!![]];});}})[_0xb8d9('0xb1')](function(_0x49c5a9,_0x28a779){if(_0x49c5a9){_0x544c29=_0x28a779;if(!_0x28a779){var _0x34eb72={'from':(_0xf07a80[_0xb8d9('0xb2')][_0xb8d9('0x9f')]||'')+'\x20'+(_0xf07a80[_0xb8d9('0xb2')][_0xb8d9('0xa0')]||'')};if(_0x32ef0c['body'][_0xb8d9('0xac')]&&_0x32ef0c['body'][_0xb8d9('0xb3')]&&_0x32ef0c[_0xb8d9('0x4a')][_0xb8d9('0xac')]!=_0x32ef0c['body']['messageId']){_0x34eb72['threadId']=_0x32ef0c[_0xb8d9('0x4a')][_0xb8d9('0xb3')];}return _0x49c5a9[_0xb8d9('0x24')](_0x34eb72);}else{return _0x49c5a9;}}})[_0xb8d9('0x11')](function(_0x2dd4ca){_0xf07a80[_0xb8d9('0xb0')]=_0x2dd4ca[_0xb8d9('0x26')]({'plain':!![]});_0xf07a80['interaction'][_0xb8d9('0xb4')]=_0x544c29;if(_0xf07a80['interaction'][_0xb8d9('0xb4')]){if(_0xf07a80[_0xb8d9('0x98')][_0xb8d9('0xb5')]){_0xf07a80['applications'][_0xb8d9('0xb6')]({'id':0x0,'priority':_0xf07a80[_0xb8d9('0x94')]['length']+0x1,'app':_0xb8d9('0xb7'),'appdata':_0xb8d9('0xb8'),'interval':'*,*,*,*'});}}return db[_0xb8d9('0xb9')][_0xb8d9('0x49')]({'body':_0x32ef0c[_0xb8d9('0x4a')][_0xb8d9('0x4a')],'ChatWebsiteId':_0x32ef0c[_0xb8d9('0x52')]['id'],'ChatInteractionId':_0x2dd4ca['id'],'direction':'in','ContactId':_0xf07a80[_0xb8d9('0xb2')]['id'],'AttachmentId':_0x32ef0c['body'][_0xb8d9('0xba')]});})[_0xb8d9('0x11')](function(_0x561487){_0xf07a80[_0xb8d9('0x18')]=_0x561487;if(_0xf07a80[_0xb8d9('0xb0')][_0xb8d9('0xbb')]){return db[_0xb8d9('0xbc')][_0xb8d9('0x48')]({'attributes':['id',_0xb8d9('0x31')],'where':{'id':_0xf07a80[_0xb8d9('0xb0')][_0xb8d9('0xbb')]}})[_0xb8d9('0x11')](function(_0x123913){if(_0x123913){_0xf07a80['applications'][_0xb8d9('0xbd')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x123913['name']+','+(_0xf07a80[_0xb8d9('0x98')][_0xb8d9('0xbe')]||0xa),'interval':_0xb8d9('0xbf')});_0xf07a80[_0xb8d9('0xc0')]=!![];}return respondWithRpcPromise(_0xb8d9('0xc1'),_0xb8d9('0xc2'),_0xf07a80);});}return respondWithRpcPromise(_0xb8d9('0xc1'),_0xb8d9('0xc2'),_0xf07a80);})['then'](function(_0x15806f){respondWithRpcPromise(_0xb8d9('0xc3'),_0xb8d9('0xc3'),{'event':_0xb8d9('0x7c'),'message':_0x15806f},client9002);return _0x15806f;})[_0xb8d9('0x11')](respondWithResult(_0x39d3bc,null))[_0xb8d9('0x1a')](handleError(_0x39d3bc,null));};exports[_0xb8d9('0xc4')]=function(_0x4aaace,_0x145afd){var _0x1446e5,_0x1676ae,_0x1baa35;var _0x3fbc4b=[];var _0x1c0a43={};var _0x551634=_0x4aaace['files']||[];var _0x50fdd7=[];var _0x2a2dd4;return db[_0xb8d9('0x81')]['describe']()[_0xb8d9('0x11')](function(_0xb46c97){if(!_0xb46c97){throw new db['Sequelize']['ValidationError']('no\x20available\x20attributes');}_0x3fbc4b=_[_0xb8d9('0x85')](_['keys'](_0xb46c97),[_0xb8d9('0x86'),_0xb8d9('0x87'),'CompanyId',_0xb8d9('0x89')]);if(_0x4aaace[_0xb8d9('0x4a')]['id']){delete _0x4aaace[_0xb8d9('0x4a')]['id'];}if(_[_0xb8d9('0x6f')](_0x4aaace[_0xb8d9('0x4a')][_0xb8d9('0x8a')])){throw _0x145afd[_0xb8d9('0x1c')](0x1f4)['send'](new db[(_0xb8d9('0x82'))][(_0xb8d9('0x83'))]('from\x20is\x20mandatory'));}if(_['isNil'](_0x4aaace[_0xb8d9('0x4a')][_0xb8d9('0x4a')])||_0x4aaace[_0xb8d9('0x4a')]['body']===''){throw _0x145afd[_0xb8d9('0x1c')](0x1f4)[_0xb8d9('0x29')](new db[(_0xb8d9('0x82'))][(_0xb8d9('0x83'))](_0xb8d9('0xc5')));}if(_[_0xb8d9('0x6f')](_0x4aaace['body'][_0xb8d9('0xc6')])){throw _0x145afd['status'](0x1f4)['send'](new db['Sequelize'][(_0xb8d9('0x83'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3fbc4b));}if(!_[_0xb8d9('0x8c')](_0x3fbc4b,_0x4aaace[_0xb8d9('0x4a')][_0xb8d9('0xc6')])){throw _0x145afd['status'](0x1f4)[_0xb8d9('0x29')](new db['Sequelize'][(_0xb8d9('0x83'))](_0xb8d9('0xc7')+_0x3fbc4b));}_0x1c0a43[_0x4aaace[_0xb8d9('0x4a')][_0xb8d9('0xc6')]]=_0x4aaace['body']['from'];})['then'](function(){return db['ChatWebsite']['find']({'where':{'id':_0x4aaace[_0xb8d9('0x52')]['id']},'include':[{'model':db['CmList'],'as':_0xb8d9('0x90')},{'model':db[_0xb8d9('0xc8')],'as':'MailAccount'}]});})[_0xb8d9('0x11')](handleEntityNotFound(_0x145afd,null))[_0xb8d9('0x11')](function(_0x166a7a){if(_0x166a7a&&_0x166a7a[_0xb8d9('0x90')]){_0x1676ae=_0x166a7a;var _0x8c2fad=_[_0xb8d9('0xc9')](_0x4aaace[_0xb8d9('0x4a')],{'firstName':_0x4aaace[_0xb8d9('0x4a')][_0xb8d9('0x8a')],'phone':_0x4aaace[_0xb8d9('0x4a')][_0xb8d9('0x8a')],'ListId':_0x166a7a[_0xb8d9('0x89')]});_0x8c2fad[_0x4aaace[_0xb8d9('0x4a')]['mapKeyOffline']]=_0x4aaace[_0xb8d9('0x4a')][_0xb8d9('0x8a')];return db[_0xb8d9('0x81')][_0xb8d9('0xca')]({'where':_0x1c0a43,'defaults':_0x8c2fad});}})[_0xb8d9('0xb1')](function(_0x3a1826){if(_0x3a1826){_0x1baa35=_0x3a1826;var _0x356395=fs[_0xb8d9('0xcb')](path[_0xb8d9('0x69')](config[_0xb8d9('0x6a')],_0xb8d9('0xcc')),_0xb8d9('0xcd'));var _0x317d4f=ejs['render'](_0x356395,{'body':_[_0xb8d9('0xce')](_0x4aaace[_0xb8d9('0x4a')][_0xb8d9('0x4a')]),'bodyTitle':_0x1676ae[_0xb8d9('0xcf')]});return db[_0xb8d9('0xd0')][_0xb8d9('0x49')]({'body':_0x317d4f,'plainBody':htmlToText[_0xb8d9('0xd1')](_0x317d4f),'ContactId':_0x3a1826['id'],'ChatWebsiteId':_0x1676ae['id']});}})[_0xb8d9('0x11')](function(_0x527dda){_0x2a2dd4=_0x527dda;if(_0x551634[_0xb8d9('0x37')]){var _0x13597a=_0x551634[_0xb8d9('0x2c')](function(_0x1b4ee3){return{'name':_0x1b4ee3[_0xb8d9('0xd2')],'basename':_0x1b4ee3['filename'],'type':_0x1b4ee3[_0xb8d9('0xd3')],'ChatOfflineMessageId':_0x527dda['id']};});_0x50fdd7=_0x13597a['map'](_0x5f25ee=>{var _0x32efcf={'filename':_0x5f25ee[_0xb8d9('0x31')],'path':path[_0xb8d9('0x69')](config['root'],_0xb8d9('0xd4'),_0xb8d9('0xd5'),'attachments',_0xb8d9('0xd6'),_0x5f25ee[_0xb8d9('0xd7')])};return _0x32efcf;});if(!_0x1676ae[_0xb8d9('0xd8')]){return db[_0xb8d9('0xd9')][_0xb8d9('0xda')](function(_0x41173e){return db['Attachment'][_0xb8d9('0xdb')](_0x13597a,{'transaction':_0x41173e});});}}})[_0xb8d9('0x11')](function(){if(_0x2a2dd4){_0x1446e5=_0x2a2dd4;return db[_0xb8d9('0xc8')][_0xb8d9('0x57')]({'where':{'active':!![]},'include':[{'model':db[_0xb8d9('0xdc')],'as':_0xb8d9('0xdd'),'raw':!![]}]});}})[_0xb8d9('0x11')](function(_0xc1ab1f){if(_0xc1ab1f&&_0xc1ab1f['Smtp']&&_0x1676ae['forwardOffline']&&_0x1676ae[_0xb8d9('0xde')]){var _0x2b1ecb={'tls':{'rejectUnauthorized':![]}};if(_0xc1ab1f[_0xb8d9('0xdd')]['service']){_0x2b1ecb['service']=_0xc1ab1f[_0xb8d9('0xdd')]['service'];}else{_0x2b1ecb[_0xb8d9('0xdf')]=_0xc1ab1f[_0xb8d9('0xdd')][_0xb8d9('0xdf')];_0x2b1ecb[_0xb8d9('0xe0')]=_0xc1ab1f[_0xb8d9('0xdd')][_0xb8d9('0xe0')];_0x2b1ecb['secure']=_0xc1ab1f[_0xb8d9('0xdd')]['secure'];}if(_0xc1ab1f[_0xb8d9('0xdd')]['authentication']){_0x2b1ecb[_0xb8d9('0xe1')]={'user':_0xc1ab1f['Smtp'][_0xb8d9('0x4b')],'pass':_0xc1ab1f[_0xb8d9('0xdd')]['pass']};}return respondWithRpcPromise('SendMail',_0xb8d9('0xe2'),{'account':_0x2b1ecb,'message':{'from':util[_0xb8d9('0xa5')](_0xb8d9('0xe3'),_0xc1ab1f[_0xb8d9('0x31')],_0xc1ab1f[_0xb8d9('0xe4')]||_0xc1ab1f[_0xb8d9('0xdd')]['user']),'to':_0x1676ae[_0xb8d9('0xde')],'subject':_0x1676ae[_0xb8d9('0xe5')],'html':_0x1446e5[_0xb8d9('0x4a')],'attachments':_0x50fdd7}},client9003)[_0xb8d9('0x11')](function(){return _0x1446e5;})[_0xb8d9('0x1a')](function(_0x49ddc5){console[_0xb8d9('0x17')](_0x49ddc5);});}})['then'](function(){if(_0x1676ae&&_0x1676ae['openNewInteraction']&&_0x1676ae[_0xb8d9('0xe6')]){var _0xaa104c=[];if(_0x551634[_0xb8d9('0x37')]){_0xaa104c=_0x551634['map'](function(_0xe9cb79){return{'name':_0xe9cb79[_0xb8d9('0xd2')],'basename':_0xe9cb79[_0xb8d9('0x65')],'type':_0xe9cb79[_0xb8d9('0xd3')],'ChatOfflineMessageId':_0x2a2dd4['id']};});}var _0x3f14c3;if(!_[_0xb8d9('0x6f')](_0x1676ae['subjectOffline'])){var _0x44479d=_[_0xb8d9('0x2c')](_0x4aaace[_0xb8d9('0x4a')],function(_0x1fe330){return _0x1fe330;});var _0x553611=_[_0xb8d9('0xe7')](_0x44479d)[0x0];var _0x44addb=_[_0xb8d9('0xe8')](_0x553611,function(_0x5b205d){return _0x5b205d;});_0x3f14c3=_0x44addb[0x1][_0x1676ae[_0xb8d9('0xe9')]];}var _0x1d7c38={'from':_0x1baa35[_0xb8d9('0xe4')],'firstName':_0x1baa35[_0xb8d9('0x9f')],'lastName':_0x1baa35['lastName'],'mapKey':_0xb8d9('0xe4'),'message':{'from':_0x1baa35[_0xb8d9('0xe4')],'to':_0x1676ae[_0xb8d9('0xc8')][_0xb8d9('0xe4')],'cc':'','subject':_[_0xb8d9('0x6f')](_0x3f14c3)?_0x1676ae[_0xb8d9('0xe5')]:_0x3f14c3,'messageId':'','sentAt':new Date(),'attach':_0xaa104c[_0xb8d9('0x37')],'attachments':_0xaa104c,'originChannel':_0xb8d9('0xea'),'ChatWebsiteId':_0x1676ae['id'],'ChatOfflineMessageId':_0x1446e5['id'],'originTo':_0x1676ae['MailAccount'][_0xb8d9('0xe4')]},'body':_0x1446e5[_0xb8d9('0x4a')]};var _0x4b59ad={'account':{'id':_0x1676ae[_0xb8d9('0xe6')]},'body':_0x1d7c38,'log':_0xb8d9('0xeb')};return respondWithRpcPromise(_0xb8d9('0xeb'),_0xb8d9('0xec'),_0x4b59ad,client9001)[_0xb8d9('0x11')](function(){return _0x1446e5;})['catch'](function(_0x394c35){console[_0xb8d9('0x17')](_0x394c35);});}return;})[_0xb8d9('0x11')](function(){if(_0x1446e5){return _0x1446e5;}})['then'](respondWithResult(_0x145afd,null))[_0xb8d9('0x1a')](function(_0x1e978b){console[_0xb8d9('0x17')](_0xb8d9('0x1a'),_0x1e978b);for(var _0x59bf01 of _0x551634){var _0xb561b9=path[_0xb8d9('0x69')](config['root'],_0xb8d9('0xd4'),'files',_0xb8d9('0xed'),'offline-chat',_0x59bf01[_0xb8d9('0x65')]);fs_extra[_0xb8d9('0xee')](_0xb561b9)['catch'](function(_0x25cf1d){console['error'](_0xb8d9('0xef'),_0xb561b9,_0x25cf1d);});}});};exports['addInteraction']=function(_0x4c6a84,_0x5c4be3){return db[_0xb8d9('0xad')]['find']({'where':{'id':_0x4c6a84['params']['id']}})[_0xb8d9('0x11')](handleEntityNotFound(_0x5c4be3,null))[_0xb8d9('0x11')](function(_0x42e1b8){if(_0x42e1b8){return _0x42e1b8[_0xb8d9('0xf0')](_0x4c6a84[_0xb8d9('0x4a')][_0xb8d9('0x61')],_[_0xb8d9('0xf1')](_0x4c6a84[_0xb8d9('0x4a')],[_0xb8d9('0x61'),'id'])||{});}})['then'](respondWithResult(_0x5c4be3,null))[_0xb8d9('0x1a')](handleError(_0x5c4be3,null));};exports[_0xb8d9('0xf2')]=function(_0x40318d,_0x59bd8e){var _0x3cdadd={'raw':![],'where':{}};var _0x35773d={};var _0x2d757c={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x40318d['params']['id']}})['then'](handleEntityNotFound(_0x59bd8e,null))[_0xb8d9('0x11')](function(_0x6d6eda){if(_0x6d6eda){_0x35773d[_0xb8d9('0x30')]=_[_0xb8d9('0x33')](db['ChatInteraction'][_0xb8d9('0x45')]);_0x35773d[_0xb8d9('0x32')]=_[_0xb8d9('0x33')](_0x40318d[_0xb8d9('0x32')]);_0x35773d[_0xb8d9('0x34')]=_[_0xb8d9('0x35')](_0x35773d[_0xb8d9('0x30')],_0x35773d[_0xb8d9('0x32')]);_0x3cdadd[_0xb8d9('0x46')]=_[_0xb8d9('0x35')](_0x35773d[_0xb8d9('0x30')],qs[_0xb8d9('0x36')](_0x40318d[_0xb8d9('0x32')][_0xb8d9('0x36')]));_0x3cdadd[_0xb8d9('0x46')]=_0x3cdadd[_0xb8d9('0x46')][_0xb8d9('0x37')]?_0x3cdadd[_0xb8d9('0x46')]:_0x35773d[_0xb8d9('0x30')];if(!_0x40318d[_0xb8d9('0x32')][_0xb8d9('0x38')](_0xb8d9('0x59'))){_0x3cdadd[_0xb8d9('0x21')]=qs[_0xb8d9('0x21')](_0x40318d[_0xb8d9('0x32')][_0xb8d9('0x21')]);_0x3cdadd[_0xb8d9('0x1f')]=qs[_0xb8d9('0x1f')](_0x40318d['query'][_0xb8d9('0x1f')]);}_0x3cdadd[_0xb8d9('0x5a')]=qs[_0xb8d9('0x5b')](_0x40318d[_0xb8d9('0x32')][_0xb8d9('0x5b')]);_0x3cdadd[_0xb8d9('0x39')]=qs[_0xb8d9('0x34')](_[_0xb8d9('0x3a')](_0x40318d['query'],_0x35773d[_0xb8d9('0x34')]));_0x3cdadd[_0xb8d9('0x39')]['ChatWebsiteId']=_0x6d6eda['id'];if(_0x40318d[_0xb8d9('0x32')][_0xb8d9('0x3d')]){_0x3cdadd[_0xb8d9('0x39')]=_['merge'](_0x3cdadd[_0xb8d9('0x39')],{'$or':_['map'](_0x3cdadd[_0xb8d9('0x46')],function(_0x1b1ad3){var _0x5cba4a={};_0x5cba4a[_0x1b1ad3]={'$like':'%'+_0x40318d[_0xb8d9('0x32')][_0xb8d9('0x3d')]+'%'};return _0x5cba4a;})});}_0x3cdadd=_[_0xb8d9('0x3b')]({},_0x3cdadd,_0x40318d[_0xb8d9('0x47')]);return db[_0xb8d9('0xad')][_0xb8d9('0x22')]({'where':_0x3cdadd[_0xb8d9('0x39')]})[_0xb8d9('0x11')](function(_0x2384d3){_0x2d757c['count']=_0x2384d3;if(_0x40318d['query']['includeAll']){_0x3cdadd[_0xb8d9('0x40')]=[{'model':db[_0xb8d9('0x81')],'as':_0xb8d9('0xf3'),'required':![]},{'model':db[_0xb8d9('0xbc')],'as':'Owner','attributes':[_0xb8d9('0x31'),'fullname',_0xb8d9('0xf4')],'required':![]},{'model':db['Tag'],'as':_0xb8d9('0xf5'),'attributes':['id','name','color'],'where':_0x40318d[_0xb8d9('0x32')][_0xb8d9('0xf6')]?{'id':_0x40318d[_0xb8d9('0x32')][_0xb8d9('0xf6')]}:undefined,'required':_0x40318d['query'][_0xb8d9('0xf6')]?!![]:![]}];}return db[_0xb8d9('0xad')][_0xb8d9('0x41')](_0x3cdadd);})[_0xb8d9('0x11')](function(_0x1f8ca2){_0x2d757c[_0xb8d9('0x42')]=_0x1f8ca2;return _0x2d757c;});}})[_0xb8d9('0x11')](respondWithFilteredResult(_0x59bd8e,_0x3cdadd))['catch'](handleError(_0x59bd8e,null));};function iftimePromise(_0x465a63,_0x416224){return respondWithRpcPromise(_0xb8d9('0xf7'),'getSnippet',{'command':_0x416224[_0xb8d9('0xf8')]?util[_0xb8d9('0xa5')](_0xb8d9('0xf9'),_0x465a63['interval'],_0x416224['timezone']):util[_0xb8d9('0xa5')](_0xb8d9('0xfa'),_0x465a63[_0xb8d9('0xfb')])},client9002)[_0xb8d9('0x11')](function(_0x30b38d){var _0x43f051=_0x30b38d&&_0x30b38d[_0xb8d9('0xfc')]('true')>=0x0?!![]:![];logger[_0xb8d9('0xfd')](_0xb8d9('0xfe'),_0x416224['id'],_0x465a63['id'],_0x465a63[_0xb8d9('0xfb')],_0x43f051?_0xb8d9('0xff'):_0xb8d9('0x100'),_0x416224[_0xb8d9('0xf8')]?_0x416224[_0xb8d9('0xf8')]:_0xb8d9('0x101'));return _0x43f051;})[_0xb8d9('0x1a')](function(_0x575c1e){logger[_0xb8d9('0x17')](_0xb8d9('0xfe'),_0x416224['id'],_0x465a63['id'],_0x465a63['interval'],util[_0xb8d9('0x102')](_0x575c1e,{'showHidden':![],'depth':null}),_0x416224[_0xb8d9('0xf8')]?_0x416224[_0xb8d9('0xf8')]:_0xb8d9('0x101'));return![];});}exports[_0xb8d9('0x103')]=function(_0x58abb7,_0x3fcb59){var _0xeaa9e=0x0;var _0x202c5b=0x0;var _0x5edd93=![];var _0x495fdd;var _0x1cebc0;return db[_0xb8d9('0x3e')]['find']({'where':{'id':_0x58abb7[_0xb8d9('0x52')]['id']},'include':[{'model':db[_0xb8d9('0x104')],'as':_0xb8d9('0x104'),'include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0xb8d9('0xfb')],'raw':!![]}]}]})[_0xb8d9('0x11')](handleEntityNotFound(_0x3fcb59,null))[_0xb8d9('0x11')](function(_0x38beb9){if(_0x38beb9){_0x495fdd=_0x38beb9;return _0x38beb9['getProactiveActions']({'raw':!![]});}})['then'](function(_0x181853){if(_0x495fdd){if(_0x181853){_0x1cebc0=_0x181853;}}return require('../../config/license/util')[_0xb8d9('0x6e')]();})[_0xb8d9('0x11')](function(_0x55fe52){if(_0x55fe52){_0x202c5b=_0x55fe52[_0xb8d9('0x105')];_0x5edd93=_0x55fe52[_0xb8d9('0x106')];}})['then'](function(){return db[_0xb8d9('0xad')][_0xb8d9('0x22')]({'where':{'closed':![]}});})[_0xb8d9('0x11')](function(_0x25d26b){_0xeaa9e=_0x25d26b;if(_0x202c5b&&_0x25d26b>_0x202c5b){return db['License']['findOne']({'where':{'id':0x1}})[_0xb8d9('0x11')](function(_0x50e7da){if(_0x50e7da){_0x50e7da[_0xb8d9('0x107')](_0xb8d9('0x108'));}});}})[_0xb8d9('0x11')](function(){if(_0x495fdd[_0xb8d9('0x104')]&&_0x495fdd[_0xb8d9('0x104')][_0xb8d9('0x109')]){var _0x39229c=[];for(var _0x552b80=0x0;_0x552b80<_0x495fdd[_0xb8d9('0x104')]['Intervals'][_0xb8d9('0x37')];_0x552b80++){var _0x1fecc1=_0x495fdd[_0xb8d9('0x104')][_0xb8d9('0x109')][_0x552b80]['get']({'plain':!![]});_0x39229c['push'](iftimePromise(_0x1fecc1,_0x495fdd));}return BPromise[_0xb8d9('0x10a')](_0x39229c)[_0xb8d9('0x11')](function(_0x2a153d){return _['some'](_0x2a153d);});}else{return!![];}})[_0xb8d9('0x11')](function(_0x1e7416){var _0x412ac4=fs['readFileSync'](path[_0xb8d9('0x69')](config[_0xb8d9('0x6a')],_0xb8d9('0x10b')),_0xb8d9('0xcd'));var _0x14bf76={'remote':_0x495fdd['remote'],'query':querystring['stringify'](_[_0xb8d9('0x3b')](_0x495fdd['get']({'plain':!![]}),{'customerIp':_0x58abb7[_0xb8d9('0x9a')][_0xb8d9('0x9c')]||_0x58abb7['headers']['x-real-ip']||_0x58abb7[_0xb8d9('0x10c')]['remoteAddress']||_0x58abb7['ip'],'referer':_0x58abb7[_0xb8d9('0x9a')][_0xb8d9('0xa2')],'openedInteractions':_0xeaa9e,'maxInteractions':_0x202c5b,'virtual':_0x5edd93[_0xb8d9('0x105')],'online':_0x1e7416,'custom':_0x5edd93}))['replace'](/'/g,'\x5c\x27')};_0x3fcb59[_0xb8d9('0x29')](ejs[_0xb8d9('0x10d')](Mustache[_0xb8d9('0x10d')](_0x412ac4,_0x14bf76),{'proactiveActions':_0x1cebc0,'alignment':_0x495fdd['alignment'],'verticalAlignment':_0x495fdd[_0xb8d9('0x10e')],'div_color':_0x495fdd[_0xb8d9('0x10f')],'labelText':_0x495fdd['labelText'],'text_color':_0x495fdd['textColor'],'button_color':_0x495fdd['color_button'],'background_color':_0x495fdd[_0xb8d9('0x110')],'hideWhenOffline':_0x495fdd[_0xb8d9('0x111')],'interval':_0x495fdd[_0xb8d9('0x112')]}));})[_0xb8d9('0x1a')](handleError(_0x3fcb59,null));};exports[_0xb8d9('0x113')]=function(_0x2e7bcd,_0xf02719){var _0x3be845=_0x2e7bcd[_0xb8d9('0x52')]['id'];var _0x438736=_0x2e7bcd[_0xb8d9('0x4a')];var _0x5825d1=0xc8;var _0x25c46d=null;return db[_0xb8d9('0xd9')][_0xb8d9('0xda')]({'isolationLevel':db[_0xb8d9('0xd9')][_0xb8d9('0x114')]['ISOLATION_LEVELS'][_0xb8d9('0x115')]},function(_0x35c704){return db[_0xb8d9('0x3e')][_0xb8d9('0x57')]({'where':{'id':_0x3be845},'transaction':_0x35c704})[_0xb8d9('0x11')](function(_0x43c385){if(_0x43c385){return db['ChatApplication'][_0xb8d9('0x25')]({'where':{'ChatWebsiteId':_0x3be845},'transaction':_0x35c704})[_0xb8d9('0x11')](function(){var _0x47e4c3=_[_0xb8d9('0x2c')](_0x438736,function(_0x5339cf){_0x5339cf[_0xb8d9('0x55')]=_0x3be845;return _0x5339cf;});return db['ChatApplication'][_0xb8d9('0xdb')](_0x47e4c3,{'transaction':_0x35c704});});}else{_0x5825d1=0x194;_0x25c46d=[];}});})[_0xb8d9('0x11')](function(){if(_0x5825d1!==0x194){return db[_0xb8d9('0x116')][_0xb8d9('0x117')]({'where':{'ChatWebsiteId':_0x3be845},'order':'priority'})[_0xb8d9('0x11')](function(_0x2f3174){_0x25c46d=_0x2f3174;});}})[_0xb8d9('0x1a')](function(_0x22308f){_0x5825d1=0x1f4;logger[_0xb8d9('0x17')](_0x22308f[_0xb8d9('0x28')]);if(_0x22308f[_0xb8d9('0x31')]){delete _0x22308f['name'];}_0x25c46d=_0x22308f;})[_0xb8d9('0x118')](function(){if(_0x25c46d===null){_0xf02719[_0xb8d9('0x1b')](_0x5825d1);}else{if(_0x5825d1===0x1f4){_0xf02719[_0xb8d9('0x1c')](_0x5825d1)['send'](_0x25c46d);}else{_0xf02719[_0xb8d9('0x1c')](_0x5825d1)['json'](_0x25c46d);}}});};exports[_0xb8d9('0x119')]=function(_0x2da470,_0x44b4df){var _0x3a6966={};var _0x190dd8={};var _0x4ca1be;var _0xd7e860;return db[_0xb8d9('0x3e')][_0xb8d9('0x57')]({'where':{'id':_0x2da470[_0xb8d9('0x52')]['id']}})[_0xb8d9('0x11')](handleEntityNotFound(_0x44b4df,null))[_0xb8d9('0x11')](function(_0x5df3e8){if(_0x5df3e8){_0x4ca1be=_0x5df3e8;_0x190dd8[_0xb8d9('0x30')]=_['keys'](db[_0xb8d9('0x116')]['rawAttributes']);_0x190dd8[_0xb8d9('0x32')]=_[_0xb8d9('0x33')](_0x2da470['query']);_0x190dd8[_0xb8d9('0x34')]=_[_0xb8d9('0x35')](_0x190dd8[_0xb8d9('0x30')],_0x190dd8['query']);_0x3a6966['attributes']=_[_0xb8d9('0x35')](_0x190dd8[_0xb8d9('0x30')],qs[_0xb8d9('0x36')](_0x2da470[_0xb8d9('0x32')][_0xb8d9('0x36')]));_0x3a6966['attributes']=_0x3a6966['attributes']['length']?_0x3a6966[_0xb8d9('0x46')]:_0x190dd8[_0xb8d9('0x30')];_0x3a6966[_0xb8d9('0x5a')]=qs[_0xb8d9('0x5b')](_0x2da470[_0xb8d9('0x32')][_0xb8d9('0x5b')]);_0x3a6966[_0xb8d9('0x39')]=qs['filters'](_[_0xb8d9('0x3a')](_0x2da470[_0xb8d9('0x32')],_0x190dd8[_0xb8d9('0x34')]));if(_0x2da470[_0xb8d9('0x32')]['filter']){_0x3a6966[_0xb8d9('0x39')]=_['merge'](_0x3a6966['where'],{'$or':_[_0xb8d9('0x2c')](_0x3a6966['attributes'],function(_0x1cccea){var _0x376848={};_0x376848[_0x1cccea]={'$like':'%'+_0x2da470[_0xb8d9('0x32')][_0xb8d9('0x3d')]+'%'};return _0x376848;})});}_0x3a6966=_['merge']({},_0x3a6966,_0x2da470[_0xb8d9('0x47')]);return _0x4ca1be[_0xb8d9('0x119')](_0x3a6966);}})[_0xb8d9('0x11')](function(_0x7a6ea2){if(_0x7a6ea2){_0xd7e860=_0x7a6ea2[_0xb8d9('0x37')];if(!_0x2da470['query'][_0xb8d9('0x38')](_0xb8d9('0x59'))){_0x3a6966['limit']=qs[_0xb8d9('0x21')](_0x2da470[_0xb8d9('0x32')][_0xb8d9('0x21')]);_0x3a6966[_0xb8d9('0x1f')]=qs[_0xb8d9('0x1f')](_0x2da470[_0xb8d9('0x32')][_0xb8d9('0x1f')]);}return _0x4ca1be[_0xb8d9('0x119')](_0x3a6966);}})[_0xb8d9('0x11')](function(_0x2c488e){if(_0x2c488e){return _0x2c488e?{'count':_0xd7e860,'rows':_0x2c488e}:null;}})[_0xb8d9('0x11')](respondWithResult(_0x44b4df,null))[_0xb8d9('0x1a')](handleError(_0x44b4df,null));};exports[_0xb8d9('0x11a')]=function(_0x460167,_0x3acea8){return db['chatProactiveAction'][_0xb8d9('0x48')]({'where':{'id':_0x460167[_0xb8d9('0x52')]['id']}})[_0xb8d9('0x11')](handleEntityNotFound(_0x3acea8,null))['then'](function(_0x210bcb){if(_0x210bcb){return _0x210bcb['addProactiveActions'](_0x460167[_0xb8d9('0x4a')][_0xb8d9('0x61')],_[_0xb8d9('0xf1')](_0x460167['body'],[_0xb8d9('0x61'),'id'])||{});}})[_0xb8d9('0x11')](respondWithResult(_0x3acea8,null))[_0xb8d9('0x1a')](handleError(_0x3acea8,null));};exports[_0xb8d9('0x11b')]=function(_0x40dd7b,_0x434505){var _0x3dbf1d={};var _0x5b88d9={};var _0x564163;var _0x4b9214;return db[_0xb8d9('0x3e')][_0xb8d9('0x57')]({'where':{'id':_0x40dd7b[_0xb8d9('0x52')]['id']}})[_0xb8d9('0x11')](handleEntityNotFound(_0x434505,null))[_0xb8d9('0x11')](function(_0x3e9424){if(_0x3e9424){_0x564163=_0x3e9424;_0x5b88d9[_0xb8d9('0x30')]=_[_0xb8d9('0x33')](db[_0xb8d9('0x11c')][_0xb8d9('0x45')]);_0x5b88d9[_0xb8d9('0x32')]=_[_0xb8d9('0x33')](_0x40dd7b[_0xb8d9('0x32')]);_0x5b88d9[_0xb8d9('0x34')]=_[_0xb8d9('0x35')](_0x5b88d9[_0xb8d9('0x30')],_0x5b88d9[_0xb8d9('0x32')]);_0x3dbf1d[_0xb8d9('0x46')]=_[_0xb8d9('0x35')](_0x5b88d9[_0xb8d9('0x30')],qs[_0xb8d9('0x36')](_0x40dd7b[_0xb8d9('0x32')][_0xb8d9('0x36')]));_0x3dbf1d[_0xb8d9('0x46')]=_0x3dbf1d[_0xb8d9('0x46')][_0xb8d9('0x37')]?_0x3dbf1d['attributes']:_0x5b88d9[_0xb8d9('0x30')];_0x3dbf1d[_0xb8d9('0x5a')]=qs['sort'](_0x40dd7b[_0xb8d9('0x32')][_0xb8d9('0x5b')]);_0x3dbf1d[_0xb8d9('0x39')]=qs[_0xb8d9('0x34')](_[_0xb8d9('0x3a')](_0x40dd7b[_0xb8d9('0x32')],_0x5b88d9[_0xb8d9('0x34')]));if(_0x40dd7b['query']['filter']){_0x3dbf1d[_0xb8d9('0x39')]=_['merge'](_0x3dbf1d['where'],{'$or':_[_0xb8d9('0x2c')](_0x3dbf1d[_0xb8d9('0x46')],function(_0x460c46){var _0x1a1202={};_0x1a1202[_0x460c46]={'$like':'%'+_0x40dd7b[_0xb8d9('0x32')][_0xb8d9('0x3d')]+'%'};return _0x1a1202;})});}_0x3dbf1d=_[_0xb8d9('0x3b')]({},_0x3dbf1d,_0x40dd7b['options']);return _0x564163[_0xb8d9('0x11b')](_0x3dbf1d);}})['then'](function(_0x1e163b){if(_0x1e163b){_0x4b9214=_0x1e163b[_0xb8d9('0x37')];if(!_0x40dd7b[_0xb8d9('0x32')]['hasOwnProperty'](_0xb8d9('0x59'))){_0x3dbf1d['limit']=qs['limit'](_0x40dd7b[_0xb8d9('0x32')][_0xb8d9('0x21')]);_0x3dbf1d[_0xb8d9('0x1f')]=qs[_0xb8d9('0x1f')](_0x40dd7b['query'][_0xb8d9('0x1f')]);}return _0x564163[_0xb8d9('0x11b')](_0x3dbf1d);}})[_0xb8d9('0x11')](function(_0x15d227){if(_0x15d227){return _0x15d227?{'count':_0x4b9214,'rows':_0x15d227}:null;}})[_0xb8d9('0x11')](respondWithResult(_0x434505,null))['catch'](handleError(_0x434505,null));};exports[_0xb8d9('0x11d')]=function(_0xdf79ac,_0x3612ec){var _0xfae473=_0xdf79ac['query'][_0xb8d9('0x11e')]===_0xb8d9('0x11f')?'offlineForm':'onlineForm';return db['ChatWebsite'][_0xb8d9('0x48')]({'attributes':['id',_0xfae473],'where':{'id':_0xdf79ac[_0xb8d9('0x52')]['id']}})['then'](handleEntityNotFound(_0x3612ec,null))[_0xb8d9('0x11')](function(_0x26f288){if(_0x26f288){var _0x38cfd0=_0x26f288[_0xfae473];var _0x287b10=_0x38cfd0&&_0x38cfd0[_0xb8d9('0x120')]?_0x38cfd0['items']:[];_0x3612ec[_0xb8d9('0x29')]({'fromKey':_[_0xb8d9('0x6f')](_0x38cfd0[_0xb8d9('0x121')])?undefined:_0x38cfd0[_0xb8d9('0x121')],'count':_0x287b10[_0xb8d9('0x37')],'rows':_0x287b10});}})[_0xb8d9('0x1a')](handleError(_0x3612ec,null));};exports[_0xb8d9('0x122')]=function(_0x4955d4,_0x3ba581){var _0x54ad8b={'raw':![],'where':{}};var _0x4d101e={};var _0x30c444={'count':0x0,'rows':[]};return db[_0xb8d9('0x3e')]['findOne']({'where':{'id':_0x4955d4[_0xb8d9('0x52')]['id']}})[_0xb8d9('0x11')](handleEntityNotFound(_0x3ba581,null))['then'](function(_0x513802){if(_0x513802){_0x4d101e[_0xb8d9('0x30')]=_[_0xb8d9('0x33')](db[_0xb8d9('0xd0')][_0xb8d9('0x45')]);_0x4d101e[_0xb8d9('0x32')]=_[_0xb8d9('0x33')](_0x4955d4[_0xb8d9('0x32')]);_0x4d101e[_0xb8d9('0x34')]=_[_0xb8d9('0x35')](_0x4d101e[_0xb8d9('0x30')],_0x4d101e['query']);_0x54ad8b[_0xb8d9('0x46')]=_[_0xb8d9('0x35')](_0x4d101e[_0xb8d9('0x30')],qs['fields'](_0x4955d4[_0xb8d9('0x32')][_0xb8d9('0x36')]));_0x54ad8b[_0xb8d9('0x46')]=_0x54ad8b[_0xb8d9('0x46')][_0xb8d9('0x37')]?_0x54ad8b['attributes']:_0x4d101e[_0xb8d9('0x30')];if(!_0x4955d4[_0xb8d9('0x32')][_0xb8d9('0x38')](_0xb8d9('0x59'))){_0x54ad8b[_0xb8d9('0x21')]=qs[_0xb8d9('0x21')](_0x4955d4['query'][_0xb8d9('0x21')]);_0x54ad8b[_0xb8d9('0x1f')]=qs['offset'](_0x4955d4[_0xb8d9('0x32')][_0xb8d9('0x1f')]);}_0x54ad8b[_0xb8d9('0x5a')]=qs[_0xb8d9('0x5b')](_0x4955d4['query'][_0xb8d9('0x5b')]);_0x54ad8b[_0xb8d9('0x39')]=qs[_0xb8d9('0x34')](_[_0xb8d9('0x3a')](_0x4955d4[_0xb8d9('0x32')],_0x4d101e['filters']));_0x54ad8b['where']['ChatWebsiteId']=_0x513802['id'];if(_0x4955d4[_0xb8d9('0x32')][_0xb8d9('0x3d')]){_0x54ad8b[_0xb8d9('0x39')]=_[_0xb8d9('0x3b')](_0x54ad8b['where'],{'$or':_[_0xb8d9('0x2c')](_0x54ad8b[_0xb8d9('0x46')],function(_0x524add){var _0x304ada={};_0x304ada[_0x524add]={'$like':'%'+_0x4955d4[_0xb8d9('0x32')][_0xb8d9('0x3d')]+'%'};return _0x304ada;})});}_0x54ad8b=_[_0xb8d9('0x3b')]({},_0x54ad8b,_0x4955d4[_0xb8d9('0x47')]);return db[_0xb8d9('0xd0')][_0xb8d9('0x22')]({'where':_0x54ad8b[_0xb8d9('0x39')]})[_0xb8d9('0x11')](function(_0x2df536){_0x30c444[_0xb8d9('0x22')]=_0x2df536;if(_0x4955d4[_0xb8d9('0x32')][_0xb8d9('0x3f')]){_0x54ad8b[_0xb8d9('0x40')]=[{'all':!![]}];}else{_0x54ad8b[_0xb8d9('0x40')]=[{'model':db[_0xb8d9('0x81')],'as':'Contact','required':![]},{'model':db[_0xb8d9('0x123')],'as':_0xb8d9('0x124'),'required':![]}];}return db[_0xb8d9('0xd0')][_0xb8d9('0x41')](_0x54ad8b);})[_0xb8d9('0x11')](function(_0x21e52e){_0x30c444[_0xb8d9('0x42')]=_0x21e52e;return _0x30c444;});}})[_0xb8d9('0x11')](respondWithFilteredResult(_0x3ba581,_0x54ad8b))[_0xb8d9('0x1a')](handleError(_0x3ba581,null));};exports[_0xb8d9('0x125')]=function(_0x45409c,_0x47c622){return db['ChatWebsite'][_0xb8d9('0x48')]({'where':{'id':_0x45409c[_0xb8d9('0x52')]['id']}})[_0xb8d9('0x11')](handleEntityNotFound(_0x47c622,null))['then'](function(_0x59bdbe){if(_0x59bdbe){return _0x59bdbe[_0xb8d9('0x125')](_0x45409c[_0xb8d9('0x4a')]['ids'],_[_0xb8d9('0xf1')](_0x45409c[_0xb8d9('0x4a')],[_0xb8d9('0x61'),'id'])||{})[_0xb8d9('0xb1')](function(_0x4af661){for(var _0x357ffc=0x0;_0x357ffc<_0x45409c[_0xb8d9('0x4a')][_0xb8d9('0x61')][_0xb8d9('0x37')];_0x357ffc+=0x1){socket[_0xb8d9('0x126')](_0xb8d9('0x127'),{'UserId':Number(_0x45409c['body']['ids'][_0x357ffc]),'ChatWebsiteId':Number(_0x45409c[_0xb8d9('0x52')]['id'])});}return _0x4af661;});}})['then'](respondWithResult(_0x47c622,null))['catch'](handleError(_0x47c622,null));};exports[_0xb8d9('0x128')]=function(_0x822bf7,_0x56581c){return db[_0xb8d9('0x3e')][_0xb8d9('0x48')]({'where':{'id':_0x822bf7['params']['id']}})[_0xb8d9('0x11')](handleEntityNotFound(_0x56581c,null))[_0xb8d9('0x11')](function(_0x4af72f){if(_0x4af72f){return _0x4af72f['removeAgents'](_0x822bf7[_0xb8d9('0x32')][_0xb8d9('0x61')])['then'](function(){if(_[_0xb8d9('0x129')](_0x822bf7[_0xb8d9('0x32')]['ids'])){for(var _0x5cdb07=0x0;_0x5cdb07<_0x822bf7['query'][_0xb8d9('0x61')][_0xb8d9('0x37')];_0x5cdb07+=0x1){socket[_0xb8d9('0x126')]('userChatWebsite:remove',{'UserId':Number(_0x822bf7[_0xb8d9('0x32')][_0xb8d9('0x61')][_0x5cdb07]),'ChatWebsiteId':Number(_0x822bf7[_0xb8d9('0x52')]['id'])});}}else{socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x822bf7['query'][_0xb8d9('0x61')]),'ChatWebsiteId':Number(_0x822bf7[_0xb8d9('0x52')]['id'])});}});}})[_0xb8d9('0x11')](respondWithStatusCode(_0x56581c,null))[_0xb8d9('0x1a')](handleError(_0x56581c,null));};exports[_0xb8d9('0x12a')]=function(_0x272d37,_0x133c7c){var _0x281921={};var _0x64ddd3={};var _0x2d8374;var _0x1164da;return db[_0xb8d9('0x3e')][_0xb8d9('0x57')]({'where':{'id':_0x272d37[_0xb8d9('0x52')]['id']}})['then'](handleEntityNotFound(_0x133c7c,null))[_0xb8d9('0x11')](function(_0x31e36f){if(_0x31e36f){_0x2d8374=_0x31e36f;_0x64ddd3['model']=_[_0xb8d9('0x33')](db[_0xb8d9('0xbc')]['rawAttributes']);_0x64ddd3[_0xb8d9('0x32')]=_['keys'](_0x272d37[_0xb8d9('0x32')]);_0x64ddd3['filters']=_[_0xb8d9('0x35')](_0x64ddd3[_0xb8d9('0x30')],_0x64ddd3[_0xb8d9('0x32')]);_0x281921[_0xb8d9('0x46')]=_[_0xb8d9('0x35')](_0x64ddd3['model'],qs[_0xb8d9('0x36')](_0x272d37[_0xb8d9('0x32')]['fields']));_0x281921[_0xb8d9('0x46')]=_0x281921['attributes'][_0xb8d9('0x37')]?_0x281921[_0xb8d9('0x46')]:_0x64ddd3[_0xb8d9('0x30')];_0x281921[_0xb8d9('0x5a')]=qs[_0xb8d9('0x5b')](_0x272d37[_0xb8d9('0x32')][_0xb8d9('0x5b')]);_0x281921['where']=qs[_0xb8d9('0x34')](_['pick'](_0x272d37[_0xb8d9('0x32')],_0x64ddd3[_0xb8d9('0x34')]));if(_0x272d37[_0xb8d9('0x32')][_0xb8d9('0x3d')]){_0x281921[_0xb8d9('0x39')]=_[_0xb8d9('0x3b')](_0x281921['where'],{'$or':_[_0xb8d9('0x2c')](_0x281921[_0xb8d9('0x46')],function(_0x400d39){var _0x280fa5={};_0x280fa5[_0x400d39]={'$like':'%'+_0x272d37[_0xb8d9('0x32')][_0xb8d9('0x3d')]+'%'};return _0x280fa5;})});}_0x281921=_['merge']({},_0x281921,_0x272d37[_0xb8d9('0x47')]);return _0x2d8374[_0xb8d9('0x12a')](_0x281921);}})[_0xb8d9('0x11')](function(_0x2b20b6){if(_0x2b20b6){_0x1164da=_0x2b20b6['length'];if(!_0x272d37[_0xb8d9('0x32')]['hasOwnProperty'](_0xb8d9('0x59'))){_0x281921['limit']=qs[_0xb8d9('0x21')](_0x272d37[_0xb8d9('0x32')]['limit']);_0x281921[_0xb8d9('0x1f')]=qs[_0xb8d9('0x1f')](_0x272d37[_0xb8d9('0x32')][_0xb8d9('0x1f')]);}return _0x2d8374['getAgents'](_0x281921);}})[_0xb8d9('0x11')](function(_0x2e948b){if(_0x2e948b){return _0x2e948b?{'count':_0x1164da,'rows':_0x2e948b}:null;}})['then'](respondWithResult(_0x133c7c,null))[_0xb8d9('0x1a')](handleError(_0x133c7c,null));};
\ No newline at end of file
index 85236b7..5ef6aff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4016=['ChatWebsite','remove','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x2f1089,_0x42d03d){var _0x1af573=function(_0x13d931){while(--_0x13d931){_0x2f1089['push'](_0x2f1089['shift']());}};_0x1af573(++_0x42d03d);}(_0x4016,0x131));var _0x6401=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4016[_0xa464c9];return _0x3d73c4;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x6401('0x0'))['db'][_0x6401('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x6401('0x2')};function emitEvent(_0x4de6b1){return function(_0x4fc38,_0x27c82a,_0x5f37ea){ChatWebsiteEvents['emit'](_0x4de6b1+':'+_0x4fc38['id'],_0x4fc38);ChatWebsiteEvents[_0x6401('0x3')](_0x4de6b1,_0x4fc38);_0x5f37ea(null);};}for(var e in events){if(events[_0x6401('0x4')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x6401('0x5')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x3663=['../../mysqldb','ChatWebsite','save','update','emit','hasOwnProperty','hook','events'];(function(_0x5d6e35,_0x4d1ac0){var _0x5d7ada=function(_0x2f7dd3){while(--_0x2f7dd3){_0x5d6e35['push'](_0x5d6e35['shift']());}};_0x5d7ada(++_0x4d1ac0);}(_0x3663,0x1cf));var _0x3366=function(_0x458848,_0x2dcecd){_0x458848=_0x458848-0x0;var _0x20469e=_0x3663[_0x458848];return _0x20469e;};'use strict';var EventEmitter=require(_0x3366('0x0'));var ChatWebsite=require(_0x3366('0x1'))['db'][_0x3366('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3366('0x3'),'afterUpdate':_0x3366('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2daeb7){return function(_0x206d65,_0x2c87e1,_0x16593e){ChatWebsiteEvents[_0x3366('0x5')](_0x2daeb7+':'+_0x206d65['id'],_0x206d65);ChatWebsiteEvents['emit'](_0x2daeb7,_0x206d65);_0x16593e(null);};}for(var e in events){if(events[_0x3366('0x6')](e)){var event=events[e];ChatWebsite[_0x3366('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
index ce6d8ff..58f8434 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe8ad=['../../config/environment','./chatWebsite.attributes','exports','define','chat_websites','lodash','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x58716f,_0x57a5df){var _0x2a2283=function(_0x533802){while(--_0x533802){_0x58716f['push'](_0x58716f['shift']());}};_0x2a2283(++_0x57a5df);}(_0xe8ad,0x155));var _0xde8a=function(_0x558dae,_0x3ceb27){_0x558dae=_0x558dae-0x0;var _0x5c290d=_0xe8ad[_0x558dae];return _0x5c290d;};'use strict';var _=require(_0xde8a('0x0'));var util=require(_0xde8a('0x1'));var logger=require(_0xde8a('0x2'))(_0xde8a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xde8a('0x4'));var fs=require('fs');var path=require(_0xde8a('0x5'));var rimraf=require(_0xde8a('0x6'));var config=require(_0xde8a('0x7'));var attributes=require(_0xde8a('0x8'));module[_0xde8a('0x9')]=function(_0x5ada38,_0x1f068e){return _0x5ada38[_0xde8a('0xa')]('ChatWebsite',attributes,{'tableName':_0xde8a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf83b=['ChatWebsite','lodash','../../config/logger','bluebird','path','../../config/environment','./chatWebsite.attributes','exports','define'];(function(_0x7506fc,_0x2de24d){var _0x1597fa=function(_0x90d013){while(--_0x90d013){_0x7506fc['push'](_0x7506fc['shift']());}};_0x1597fa(++_0x2de24d);}(_0xf83b,0x1c3));var _0xbf83=function(_0x5adfec,_0x413b39){_0x5adfec=_0x5adfec-0x0;var _0x2db4d0=_0xf83b[_0x5adfec];return _0x2db4d0;};'use strict';var _=require(_0xbf83('0x0'));var util=require('util');var logger=require(_0xbf83('0x1'))('api');var moment=require('moment');var BPromise=require(_0xbf83('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf83('0x3'));var rimraf=require('rimraf');var config=require(_0xbf83('0x4'));var attributes=require(_0xbf83('0x5'));module[_0xbf83('0x6')]=function(_0x55db1c,_0xb89819){return _0x55db1c[_0xbf83('0x7')](_0xbf83('0x8'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a5c5d8c..108de5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x612f=['info','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','./chatWebsite.socket','register','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x47bc5e,_0x6fc500){var _0x323a59=function(_0x32df89){while(--_0x32df89){_0x47bc5e['push'](_0x47bc5e['shift']());}};_0x323a59(++_0x6fc500);}(_0x612f,0x12e));var _0xf612=function(_0x50a700,_0x5901b1){_0x50a700=_0x50a700-0x0;var _0x3abf0c=_0x612f[_0x50a700];return _0x3abf0c;};'use strict';var _=require('lodash');var util=require(_0xf612('0x0'));var moment=require(_0xf612('0x1'));var BPromise=require(_0xf612('0x2'));var rs=require(_0xf612('0x3'));var fs=require('fs');var Redis=require(_0xf612('0x4'));var db=require(_0xf612('0x5'))['db'];var utils=require(_0xf612('0x6'));var logger=require(_0xf612('0x7'))(_0xf612('0x8'));var config=require(_0xf612('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xf612('0xa')]=_[_0xf612('0xb')](config[_0xf612('0xa')],{'host':_0xf612('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf612('0xa')]));require(_0xf612('0xd'))[_0xf612('0xe')](socket);function respondWithRpcPromise(_0x511967,_0x44c5b5,_0x4c215){return new BPromise(function(_0x54b865,_0x17bd07){return client[_0xf612('0xf')](_0x511967,_0x4c215)[_0xf612('0x10')](function(_0x7be046){logger['info'](_0xf612('0x11'),_0x44c5b5,_0xf612('0x12'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x44c5b5,_0xf612('0x12'),JSON[_0xf612('0x13')](_0x7be046));if(_0x7be046[_0xf612('0x14')]){if(_0x7be046[_0xf612('0x14')][_0xf612('0x15')]===0x1f4){logger[_0xf612('0x14')](_0xf612('0x11'),_0x44c5b5,_0x7be046[_0xf612('0x14')][_0xf612('0x16')]);return _0x17bd07(_0x7be046[_0xf612('0x14')][_0xf612('0x16')]);}logger[_0xf612('0x14')](_0xf612('0x11'),_0x44c5b5,_0x7be046[_0xf612('0x14')]['message']);return _0x54b865(_0x7be046[_0xf612('0x14')][_0xf612('0x16')]);}else{logger[_0xf612('0x17')](_0xf612('0x11'),_0x44c5b5,'request\x20sent');_0x54b865(_0x7be046[_0xf612('0x18')]['message']);}})['catch'](function(_0xf52ebe){logger['error'](_0xf612('0x11'),_0x44c5b5,_0xf52ebe);_0x17bd07(_0xf52ebe);});});}
\ No newline at end of file
+var _0xd80a=['redis','localhost','./chatWebsite.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','message','ChatWebsite,\x20%s,\x20%s','result','catch','lodash','util','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5e8866,_0xe67853){var _0x4352db=function(_0x46cf0e){while(--_0x46cf0e){_0x5e8866['push'](_0x5e8866['shift']());}};_0x4352db(++_0xe67853);}(_0xd80a,0x1b0));var _0xad80=function(_0x4743ea,_0x42c0d3){_0x4743ea=_0x4743ea-0x0;var _0x1789f5=_0xd80a[_0x4743ea];return _0x1789f5;};'use strict';var _=require(_0xad80('0x0'));var util=require(_0xad80('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xad80('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xad80('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xad80('0x4'))(_0xad80('0x5'));var config=require(_0xad80('0x6'));var jayson=require(_0xad80('0x7'));var client=jayson[_0xad80('0x8')][_0xad80('0x9')]({'port':0x232a});config[_0xad80('0xa')]=_['defaults'](config['redis'],{'host':_0xad80('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xad80('0xa')]));require(_0xad80('0xc'))[_0xad80('0xd')](socket);function respondWithRpcPromise(_0x258084,_0x2f5f95,_0xbcd75d){return new BPromise(function(_0x596047,_0x41744d){return client[_0xad80('0xe')](_0x258084,_0xbcd75d)[_0xad80('0xf')](function(_0x5d9e78){logger[_0xad80('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x2f5f95,_0xad80('0x11'));logger[_0xad80('0x12')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x2f5f95,'request\x20sent',JSON[_0xad80('0x13')](_0x5d9e78));if(_0x5d9e78[_0xad80('0x14')]){if(_0x5d9e78[_0xad80('0x14')][_0xad80('0x15')]===0x1f4){logger[_0xad80('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x2f5f95,_0x5d9e78[_0xad80('0x14')][_0xad80('0x16')]);return _0x41744d(_0x5d9e78[_0xad80('0x14')][_0xad80('0x16')]);}logger['error'](_0xad80('0x17'),_0x2f5f95,_0x5d9e78['error']['message']);return _0x596047(_0x5d9e78['error']['message']);}else{logger[_0xad80('0x10')](_0xad80('0x17'),_0x2f5f95,'request\x20sent');_0x596047(_0x5d9e78[_0xad80('0x18')][_0xad80('0x16')]);}})[_0xad80('0x19')](function(_0x48a1c4){logger[_0xad80('0x14')](_0xad80('0x17'),_0x2f5f95,_0x48a1c4);_0x41744d(_0x48a1c4);});});}
\ No newline at end of file
index 9300cd0..8a9d83b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd038=['length','./chatWebsite.events','save','update','emit','removeListener','register'];(function(_0x412d2f,_0xed68c8){var _0xd984a8=function(_0x1be6bb){while(--_0x1be6bb){_0x412d2f['push'](_0x412d2f['shift']());}};_0xd984a8(++_0xed68c8);}(_0xd038,0x158));var _0x8d03=function(_0x424501,_0x42096d){_0x424501=_0x424501-0x0;var _0xb719af=_0xd038[_0x424501];return _0xb719af;};'use strict';var ChatWebsiteEvents=require(_0x8d03('0x0'));var events=[_0x8d03('0x1'),'remove',_0x8d03('0x2')];function createListener(_0x4c3cfd,_0x11b1ba){return function(_0x576cab){_0x11b1ba[_0x8d03('0x3')](_0x4c3cfd,_0x576cab);};}function removeListener(_0x5bf4b4,_0x4574e1){return function(){ChatWebsiteEvents[_0x8d03('0x4')](_0x5bf4b4,_0x4574e1);};}exports[_0x8d03('0x5')]=function(_0x2481b9){for(var _0x283908=0x0,_0x3cc489=events[_0x8d03('0x6')];_0x283908<_0x3cc489;_0x283908++){var _0x33f076=events[_0x283908];var _0x4a39bc=createListener('chatWebsite:'+_0x33f076,_0x2481b9);ChatWebsiteEvents['on'](_0x33f076,_0x4a39bc);}};
\ No newline at end of file
+var _0x7ee9=['length','./chatWebsite.events','save','update','removeListener'];(function(_0x5410b5,_0x54b890){var _0x15dc53=function(_0x22552f){while(--_0x22552f){_0x5410b5['push'](_0x5410b5['shift']());}};_0x15dc53(++_0x54b890);}(_0x7ee9,0xbf));var _0x97ee=function(_0x12363c,_0x464c7b){_0x12363c=_0x12363c-0x0;var _0x2ab2c2=_0x7ee9[_0x12363c];return _0x2ab2c2;};'use strict';var ChatWebsiteEvents=require(_0x97ee('0x0'));var events=[_0x97ee('0x1'),'remove',_0x97ee('0x2')];function createListener(_0x1a3df8,_0x4df8bd){return function(_0x3d133b){_0x4df8bd['emit'](_0x1a3df8,_0x3d133b);};}function removeListener(_0x29cb9c,_0x3df3ba){return function(){ChatWebsiteEvents[_0x97ee('0x3')](_0x29cb9c,_0x3df3ba);};}exports['register']=function(_0x169496){for(var _0x1be902=0x0,_0x59ce95=events[_0x97ee('0x4')];_0x1be902<_0x59ce95;_0x1be902++){var _0x248664=events[_0x1be902];var _0x45d889=createListener('chatWebsite:'+_0x248664,_0x169496);ChatWebsiteEvents['on'](_0x248664,_0x45d889);}};
\ No newline at end of file
index a204c82..ceaf7b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb5f3=['server/files/images/avatars/','%s-%s','now','/:id/avatar','single','addAvatar','diskStorage','/:id/customer_avatar','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','extname','replace','/:id/offline','any','offline','/:id/interactions','addApplications','addProactiveActions','addAgents','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','describe','show','/:id/dispositions','getAnswers','/:id/logo','getLogo','getAvatar','getSystemAvatar','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','/:id/canned_answers','addAnswer','root','server/files/images/logos/','format','originalname','file','addLogo','join'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xb5f3,0x156));var _0x3b5f=function(_0x325501,_0x5242f6){_0x325501=_0x325501-0x0;var _0x2c1626=_0xb5f3[_0x325501];return _0x2c1626;};'use strict';var multer=require('multer');var util=require(_0x3b5f('0x0'));var path=require(_0x3b5f('0x1'));var timeout=require(_0x3b5f('0x2'));var express=require(_0x3b5f('0x3'));var router=express[_0x3b5f('0x4')]();var fs_extra=require(_0x3b5f('0x5'));var auth=require(_0x3b5f('0x6'));var interaction=require(_0x3b5f('0x7'));var config=require(_0x3b5f('0x8'));var controller=require(_0x3b5f('0x9'));router[_0x3b5f('0xa')]('/',auth[_0x3b5f('0xb')](),controller[_0x3b5f('0xc')]);router[_0x3b5f('0xa')]('/describe',auth[_0x3b5f('0xb')](),controller[_0x3b5f('0xd')]);router[_0x3b5f('0xa')]('/:id',auth[_0x3b5f('0xb')](),controller[_0x3b5f('0xe')]);router[_0x3b5f('0xa')](_0x3b5f('0xf'),auth[_0x3b5f('0xb')](),controller['getDispositions']);router['get']('/:id/canned_answers',auth[_0x3b5f('0xb')](),controller[_0x3b5f('0x10')]);router[_0x3b5f('0xa')](_0x3b5f('0x11'),controller[_0x3b5f('0x12')]);router[_0x3b5f('0xa')]('/:id/avatar',controller[_0x3b5f('0x13')]);router[_0x3b5f('0xa')]('/:id/customer_avatar',controller['getCustomerAvatar']);router[_0x3b5f('0xa')]('/:id/system_avatar',controller[_0x3b5f('0x14')]);router[_0x3b5f('0xa')]('/:id/interactions',auth['isAuthenticated'](),controller['getInteractions']);router[_0x3b5f('0xa')](_0x3b5f('0x15'),controller[_0x3b5f('0x16')]);router['get'](_0x3b5f('0x17'),auth['isAuthenticated'](),controller[_0x3b5f('0x18')]);router[_0x3b5f('0xa')](_0x3b5f('0x19'),auth['isAuthenticated'](),controller[_0x3b5f('0x1a')]);router[_0x3b5f('0xa')](_0x3b5f('0x1b'),controller[_0x3b5f('0x1c')]);router[_0x3b5f('0xa')](_0x3b5f('0x1d'),auth[_0x3b5f('0xb')](),controller[_0x3b5f('0x1e')]);router[_0x3b5f('0xa')](_0x3b5f('0x1f'),auth[_0x3b5f('0xb')](),controller[_0x3b5f('0x20')]);router[_0x3b5f('0x21')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x3b5f('0xf'),auth[_0x3b5f('0xb')](),controller['addDisposition']);router[_0x3b5f('0x21')](_0x3b5f('0x22'),auth[_0x3b5f('0xb')](),controller[_0x3b5f('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x33f3a8,_0x1aa10f,_0x45181f){_0x45181f(null,path['join'](config[_0x3b5f('0x24')],_0x3b5f('0x25')));},'filename':function(_0x14653b,_0x16078b,_0x2d9f80){_0x2d9f80(null,util[_0x3b5f('0x26')]('%s-%s',Date['now'](),_0x16078b[_0x3b5f('0x27')]));}})});router['post'](_0x3b5f('0x11'),upload['single'](_0x3b5f('0x28')),controller[_0x3b5f('0x29')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x236320,_0x4a0f1e,_0x1d10a4){_0x1d10a4(null,path[_0x3b5f('0x2a')](config[_0x3b5f('0x24')],_0x3b5f('0x2b')));},'filename':function(_0x3543f0,_0x44779a,_0x54168f){_0x54168f(null,util['format'](_0x3b5f('0x2c'),Date[_0x3b5f('0x2d')](),_0x44779a['originalname']));}})});router[_0x3b5f('0x21')](_0x3b5f('0x2e'),upload[_0x3b5f('0x2f')](_0x3b5f('0x28')),controller[_0x3b5f('0x30')]);var upload=multer({'storage':multer[_0x3b5f('0x31')]({'destination':function(_0x5974ad,_0x501b0d,_0x84e581){_0x84e581(null,path[_0x3b5f('0x2a')](config[_0x3b5f('0x24')],_0x3b5f('0x2b')));},'filename':function(_0x3ec20c,_0x50f6a6,_0x60da2b){_0x60da2b(null,util[_0x3b5f('0x26')]('%s-%s',Date[_0x3b5f('0x2d')](),_0x50f6a6[_0x3b5f('0x27')]));}})});router[_0x3b5f('0x21')](_0x3b5f('0x32'),upload[_0x3b5f('0x2f')](_0x3b5f('0x28')),controller[_0x3b5f('0x33')]);var upload=multer({'storage':multer[_0x3b5f('0x31')]({'destination':function(_0x7bcd2b,_0x2ef6e0,_0xe7c79f){_0xe7c79f(null,path[_0x3b5f('0x2a')](config[_0x3b5f('0x24')],_0x3b5f('0x2b')));},'filename':function(_0x4c9f92,_0x5d0987,_0x3c7846){_0x3c7846(null,util['format'](_0x3b5f('0x2c'),Date['now'](),_0x5d0987[_0x3b5f('0x27')]));}})});router[_0x3b5f('0x21')](_0x3b5f('0x34'),upload['single'](_0x3b5f('0x28')),controller[_0x3b5f('0x35')]);router['post'](_0x3b5f('0x36'),controller[_0x3b5f('0x37')]);const offlineUploadMulter=multer({'storage':multer[_0x3b5f('0x31')]({'destination':function(_0x409abf,_0x451d2b,_0x5b2f71){const _0x45c144=path[_0x3b5f('0x2a')](config['root'],_0x3b5f('0x38'),_0x3b5f('0x39'),_0x3b5f('0x3a'));fs_extra[_0x3b5f('0x3b')](_0x45c144,function(){_0x5b2f71(null,_0x45c144);});},'filename':function(_0x248767,_0xc0df18,_0x51d063){const _0x505748=_0xc0df18[_0x3b5f('0x27')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3ad894=path[_0x3b5f('0x3c')](_0x505748);const _0x147c62=Date[_0x3b5f('0x2d')]()+'-'+_0x505748[_0x3b5f('0x3d')](_0x3ad894,'')+_0x3ad894;_0x51d063(null,_0x147c62);}})});router['post'](_0x3b5f('0x3e'),offlineUploadMulter[_0x3b5f('0x3f')](),controller[_0x3b5f('0x40')]);router[_0x3b5f('0x21')](_0x3b5f('0x41'),auth['isAuthenticated'](),controller['addInteraction']);router[_0x3b5f('0x21')](_0x3b5f('0x17'),auth[_0x3b5f('0xb')](),controller[_0x3b5f('0x42')]);router['post'](_0x3b5f('0x19'),auth[_0x3b5f('0xb')](),controller[_0x3b5f('0x43')]);router[_0x3b5f('0x21')](_0x3b5f('0x1f'),auth[_0x3b5f('0xb')](),controller[_0x3b5f('0x44')]);router[_0x3b5f('0x45')](_0x3b5f('0x46'),auth['isAuthenticated'](),controller[_0x3b5f('0x47')]);router[_0x3b5f('0x48')]('/:id',auth[_0x3b5f('0xb')](),controller[_0x3b5f('0x49')]);router[_0x3b5f('0x48')]('/:id/dispositions',auth[_0x3b5f('0xb')](),controller[_0x3b5f('0x4a')]);router['delete'](_0x3b5f('0x22'),auth['isAuthenticated'](),controller[_0x3b5f('0x4b')]);router[_0x3b5f('0x48')](_0x3b5f('0x1f'),auth['isAuthenticated'](),controller[_0x3b5f('0x4c')]);module['exports']=router;
\ No newline at end of file
+var _0x4851=['diskStorage','root','server/files/images/logos/','format','%s-%s','originalname','single','file','addLogo','server/files/images/avatars/','addAvatar','join','now','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','extname','replace','/:id/offline','any','offline','addInteraction','/:id/applications','addApplications','/:id/proactive_actions','addProactiveActions','addAgents','put','update','delete','destroy','removeAnswers','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','getApplications','getProactiveActions','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','create','post','addDisposition','addAnswer'];(function(_0x5a6de2,_0x5c8b10){var _0x2c0525=function(_0x59d072){while(--_0x59d072){_0x5a6de2['push'](_0x5a6de2['shift']());}};_0x2c0525(++_0x5c8b10);}(_0x4851,0xc3));var _0x1485=function(_0x17ae29,_0x5bc377){_0x17ae29=_0x17ae29-0x0;var _0x3e5b60=_0x4851[_0x17ae29];return _0x3e5b60;};'use strict';var multer=require(_0x1485('0x0'));var util=require(_0x1485('0x1'));var path=require('path');var timeout=require(_0x1485('0x2'));var express=require(_0x1485('0x3'));var router=express[_0x1485('0x4')]();var fs_extra=require(_0x1485('0x5'));var auth=require(_0x1485('0x6'));var interaction=require(_0x1485('0x7'));var config=require(_0x1485('0x8'));var controller=require('./chatWebsite.controller');router[_0x1485('0x9')]('/',auth[_0x1485('0xa')](),controller[_0x1485('0xb')]);router[_0x1485('0x9')](_0x1485('0xc'),auth[_0x1485('0xa')](),controller[_0x1485('0xd')]);router[_0x1485('0x9')](_0x1485('0xe'),auth[_0x1485('0xa')](),controller[_0x1485('0xf')]);router[_0x1485('0x9')](_0x1485('0x10'),auth[_0x1485('0xa')](),controller[_0x1485('0x11')]);router['get'](_0x1485('0x12'),auth[_0x1485('0xa')](),controller[_0x1485('0x13')]);router[_0x1485('0x9')](_0x1485('0x14'),controller['getLogo']);router[_0x1485('0x9')](_0x1485('0x15'),controller[_0x1485('0x16')]);router[_0x1485('0x9')](_0x1485('0x17'),controller[_0x1485('0x18')]);router[_0x1485('0x9')]('/:id/system_avatar',controller[_0x1485('0x19')]);router[_0x1485('0x9')](_0x1485('0x1a'),auth[_0x1485('0xa')](),controller[_0x1485('0x1b')]);router[_0x1485('0x9')]('/:id/snippet',controller[_0x1485('0x1c')]);router['get']('/:id/applications',auth[_0x1485('0xa')](),controller[_0x1485('0x1d')]);router[_0x1485('0x9')]('/:id/proactive_actions',auth[_0x1485('0xa')](),controller[_0x1485('0x1e')]);router[_0x1485('0x9')]('/:id/fields',controller['getFields']);router['get'](_0x1485('0x1f'),auth[_0x1485('0xa')](),controller[_0x1485('0x20')]);router[_0x1485('0x9')](_0x1485('0x21'),auth[_0x1485('0xa')](),controller[_0x1485('0x22')]);router['post']('/',auth[_0x1485('0xa')](),controller[_0x1485('0x23')]);router[_0x1485('0x24')](_0x1485('0x10'),auth[_0x1485('0xa')](),controller[_0x1485('0x25')]);router['post'](_0x1485('0x12'),auth['isAuthenticated'](),controller[_0x1485('0x26')]);var upload=multer({'storage':multer[_0x1485('0x27')]({'destination':function(_0x4a0efc,_0x4f2d1e,_0x59b3cc){_0x59b3cc(null,path['join'](config[_0x1485('0x28')],_0x1485('0x29')));},'filename':function(_0x5713cc,_0x1cea1a,_0x3a4ecd){_0x3a4ecd(null,util[_0x1485('0x2a')](_0x1485('0x2b'),Date['now'](),_0x1cea1a[_0x1485('0x2c')]));}})});router[_0x1485('0x24')](_0x1485('0x14'),upload[_0x1485('0x2d')](_0x1485('0x2e')),controller[_0x1485('0x2f')]);var upload=multer({'storage':multer[_0x1485('0x27')]({'destination':function(_0x189dc0,_0x54e99a,_0x2b62a7){_0x2b62a7(null,path['join'](config[_0x1485('0x28')],_0x1485('0x30')));},'filename':function(_0x21c993,_0x2cd08b,_0x493c19){_0x493c19(null,util['format'](_0x1485('0x2b'),Date['now'](),_0x2cd08b[_0x1485('0x2c')]));}})});router[_0x1485('0x24')](_0x1485('0x15'),upload[_0x1485('0x2d')](_0x1485('0x2e')),controller[_0x1485('0x31')]);var upload=multer({'storage':multer[_0x1485('0x27')]({'destination':function(_0x166a8c,_0x4529b7,_0x29dea1){_0x29dea1(null,path[_0x1485('0x32')](config[_0x1485('0x28')],_0x1485('0x30')));},'filename':function(_0x269100,_0x3c61cf,_0x1fcda6){_0x1fcda6(null,util[_0x1485('0x2a')](_0x1485('0x2b'),Date[_0x1485('0x33')](),_0x3c61cf[_0x1485('0x2c')]));}})});router[_0x1485('0x24')](_0x1485('0x17'),upload[_0x1485('0x2d')](_0x1485('0x2e')),controller[_0x1485('0x34')]);var upload=multer({'storage':multer[_0x1485('0x27')]({'destination':function(_0x4754e7,_0x348448,_0x525603){_0x525603(null,path[_0x1485('0x32')](config[_0x1485('0x28')],_0x1485('0x30')));},'filename':function(_0xda856,_0x5cc3c4,_0x158771){_0x158771(null,util[_0x1485('0x2a')](_0x1485('0x2b'),Date[_0x1485('0x33')](),_0x5cc3c4[_0x1485('0x2c')]));}})});router[_0x1485('0x24')](_0x1485('0x35'),upload['single'](_0x1485('0x2e')),controller[_0x1485('0x36')]);router['post'](_0x1485('0x37'),controller[_0x1485('0x38')]);const offlineUploadMulter=multer({'storage':multer[_0x1485('0x27')]({'destination':function(_0x148d18,_0x290f1b,_0x24e33f){const _0x2d82a9=path['join'](config[_0x1485('0x28')],_0x1485('0x39'),_0x1485('0x3a'),_0x1485('0x3b'));fs_extra[_0x1485('0x3c')](_0x2d82a9,function(){_0x24e33f(null,_0x2d82a9);});},'filename':function(_0x44009e,_0x3e9f95,_0x26d485){const _0x4cd71f=_0x3e9f95[_0x1485('0x2c')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3de301=path[_0x1485('0x3d')](_0x4cd71f);const _0x504982=Date['now']()+'-'+_0x4cd71f[_0x1485('0x3e')](_0x3de301,'')+_0x3de301;_0x26d485(null,_0x504982);}})});router['post'](_0x1485('0x3f'),offlineUploadMulter[_0x1485('0x40')](),controller[_0x1485('0x41')]);router[_0x1485('0x24')]('/:id/interactions',auth[_0x1485('0xa')](),controller[_0x1485('0x42')]);router[_0x1485('0x24')](_0x1485('0x43'),auth[_0x1485('0xa')](),controller[_0x1485('0x44')]);router['post'](_0x1485('0x45'),auth[_0x1485('0xa')](),controller[_0x1485('0x46')]);router[_0x1485('0x24')](_0x1485('0x21'),auth[_0x1485('0xa')](),controller[_0x1485('0x47')]);router[_0x1485('0x48')](_0x1485('0xe'),auth[_0x1485('0xa')](),controller[_0x1485('0x49')]);router[_0x1485('0x4a')](_0x1485('0xe'),auth['isAuthenticated'](),controller[_0x1485('0x4b')]);router['delete'](_0x1485('0x10'),auth['isAuthenticated'](),controller['removeDispositions']);router['delete'](_0x1485('0x12'),auth[_0x1485('0xa')](),controller[_0x1485('0x4c')]);router[_0x1485('0x4a')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0x1485('0x4d')]=router;
\ No newline at end of file
index 74f0243..92141c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2260=['Client-Side\x20logger\x20not\x20found!','exports','beaver-logger/server','express','../components/auth/service','../config/environment','env','production','app','client-side-logger'];(function(_0x190ff6,_0x515cfd){var _0x5356d2=function(_0x2cf77c){while(--_0x2cf77c){_0x190ff6['push'](_0x190ff6['shift']());}};_0x5356d2(++_0x515cfd);}(_0x2260,0x192));var _0x0226=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x2260[_0x397e5f];return _0x5302b8;};var beaverLogger=require(_0x0226('0x0'));var express=require(_0x0226('0x1'));var auth=require(_0x0226('0x2'));var config=require(_0x0226('0x3'));var router=express['Router']();var isProduction=config[_0x0226('0x4')]===_0x0226('0x5')||![];function clientSideLogs(_0x4b05de,_0x278ba5,_0x415247){var _0x1fff85=_0x4b05de[_0x0226('0x6')]['get'](_0x0226('0x7'));if(!_0x1fff85){throw new Error(_0x0226('0x8'));}return beaverLogger['expressEndpoint']({'uri':'/client-logs','logger':_0x1fff85,'enableCors':!isProduction})(_0x4b05de,_0x278ba5,_0x415247);}router['use'](auth['isAuthenticated'](),clientSideLogs);module[_0x0226('0x9')]=router;
\ No newline at end of file
+var _0xc03f=['Router','env','production','app','get','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','beaver-logger/server','../components/auth/service','../config/environment'];(function(_0x4d7f15,_0x2436a3){var _0xe9048c=function(_0x1d1098){while(--_0x1d1098){_0x4d7f15['push'](_0x4d7f15['shift']());}};_0xe9048c(++_0x2436a3);}(_0xc03f,0x14f));var _0xfc03=function(_0x352580,_0x40db47){_0x352580=_0x352580-0x0;var _0x459385=_0xc03f[_0x352580];return _0x459385;};var beaverLogger=require(_0xfc03('0x0'));var express=require('express');var auth=require(_0xfc03('0x1'));var config=require(_0xfc03('0x2'));var router=express[_0xfc03('0x3')]();var isProduction=config[_0xfc03('0x4')]===_0xfc03('0x5')||![];function clientSideLogs(_0x4c8cee,_0x3d7f9e,_0x492e93){var _0x810744=_0x4c8cee[_0xfc03('0x6')][_0xfc03('0x7')]('client-side-logger');if(!_0x810744){throw new Error(_0xfc03('0x8'));}return beaverLogger[_0xfc03('0x9')]({'uri':_0xfc03('0xa'),'logger':_0x810744,'enableCors':!isProduction})(_0x4c8cee,_0x3d7f9e,_0x492e93);}router[_0xfc03('0xb')](auth[_0xfc03('0xc')](),clientSideLogs);module['exports']=router;
\ No newline at end of file
index 71392a8..2db4ef5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33a4=['Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports','STRING','ENUM','Google','Outlook365'];(function(_0x2e8322,_0x1e296b){var _0x6fa1c7=function(_0x166737){while(--_0x166737){_0x2e8322['push'](_0x2e8322['shift']());}};_0x6fa1c7(++_0x1e296b);}(_0x33a4,0xdb));var _0x433a=function(_0x3e2ee3,_0x3c08d8){_0x3e2ee3=_0x3e2ee3-0x0;var _0xc79caa=_0x33a4[_0x3e2ee3];return _0xc79caa;};'use strict';var Sequelize=require('sequelize');module[_0x433a('0x0')]={'name':{'type':Sequelize[_0x433a('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x433a('0x2')]('AmazonAWS',_0x433a('0x3'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x433a('0x4'),_0x433a('0x5'))},'data1':{'type':Sequelize[_0x433a('0x1')],'comment':_0x433a('0x6')},'data2':{'type':Sequelize[_0x433a('0x1')],'comment':_0x433a('0x7')},'data3':{'type':Sequelize[_0x433a('0x1')],'comment':_0x433a('0x8')},'data4':{'type':Sequelize[_0x433a('0x1')],'comment':_0x433a('0x9')},'data5':{'type':Sequelize['TEXT'],'comment':_0x433a('0xa')},'data6':{'type':Sequelize[_0x433a('0xb')],'comment':_0x433a('0xc')},'data7':{'type':Sequelize[_0x433a('0xb')],'comment':_0x433a('0xd')}};
\ No newline at end of file
+var _0x67e4=['Dynamics365','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20refresh_token','sequelize','exports','STRING','ENUM','AmazonAWS','MicrosoftAzure','Outlook365'];(function(_0x3a5edf,_0x4793e8){var _0x336b66=function(_0x2611e5){while(--_0x2611e5){_0x3a5edf['push'](_0x3a5edf['shift']());}};_0x336b66(++_0x4793e8);}(_0x67e4,0x1e8));var _0x467e=function(_0x28e2cd,_0x153b42){_0x28e2cd=_0x28e2cd-0x0;var _0x11fd46=_0x67e4[_0x28e2cd];return _0x11fd46;};'use strict';var Sequelize=require(_0x467e('0x0'));module[_0x467e('0x1')]={'name':{'type':Sequelize[_0x467e('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x467e('0x3')](_0x467e('0x4'),'Google',_0x467e('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x467e('0x3')](_0x467e('0x6'),_0x467e('0x7'))},'data1':{'type':Sequelize[_0x467e('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x467e('0x2')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x467e('0x2')],'comment':_0x467e('0x8')},'data4':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0x467e('0x9')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0x467e('0x9')],'comment':_0x467e('0xa')},'data7':{'type':Sequelize[_0x467e('0x9')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
index eb89d87..9854523 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3268=['rows','service','MicrosoftAzure','data3','show','params','find','catch','create','body','Name\x20parameter\x20not\x20specified','includes','join','encryptString','findOne','generateMicrosoftAuthorizationUrl','user','get','state','from','toString','isValidIdToken','oauth2Claims','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','../../mysqldb','redis','defaults','localhost','sendStatus','status','json','offset','undefined','limit','count','Content-Range','update','then','destroy','end','stack','name','send','slice','map','CloudProvider','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','filter','options','includeAll','include'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x3268,0x74));var _0x8326=function(_0x5376f7,_0x363a83){_0x5376f7=_0x5376f7-0x0;var _0x38c0ad=_0x3268[_0x5376f7];return _0x38c0ad;};'use strict';var _=require(_0x8326('0x0'));var Redis=require(_0x8326('0x1'));var qs=require(_0x8326('0x2'));var encryptor=require(_0x8326('0x3'));var config=require(_0x8326('0x4'));var logger=require(_0x8326('0x5'))('api');var db=require(_0x8326('0x6'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x8326('0x7')]=_[_0x8326('0x8')](config[_0x8326('0x7')],{'host':_0x8326('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8326('0x7')]));var redis=new Redis(config[_0x8326('0x7')]);function respondWithStatusCode(_0xbd0371,_0x44c04c){_0x44c04c=_0x44c04c||0xcc;return function(_0x50647a){if(_0x50647a){return _0xbd0371[_0x8326('0xa')](_0x44c04c);}return _0xbd0371[_0x8326('0xb')](_0x44c04c)['end']();};}function respondWithResult(_0x586177,_0x168023){_0x168023=_0x168023||0xc8;return function(_0x5423ec){if(_0x5423ec){return _0x586177[_0x8326('0xb')](_0x168023)[_0x8326('0xc')](_0x5423ec);}};}function respondWithFilteredResult(_0x198e1b,_0x51e37e){return function(_0x17e74e){if(_0x17e74e){var _0x3d9a9c=typeof _0x51e37e[_0x8326('0xd')]===_0x8326('0xe')&&typeof _0x51e37e[_0x8326('0xf')]==='undefined';var _0xc93962=_0x17e74e[_0x8326('0x10')];var _0x474afa=_0x3d9a9c?0x0:_0x51e37e[_0x8326('0xd')];var _0x3b5ee7=_0x3d9a9c?_0x17e74e['count']:_0x51e37e[_0x8326('0xd')]+_0x51e37e['limit'];var _0x566cc1;if(_0x3b5ee7>=_0xc93962){_0x3b5ee7=_0xc93962;_0x566cc1=0xc8;}else{_0x566cc1=0xce;}_0x198e1b[_0x8326('0xb')](_0x566cc1);return _0x198e1b['set'](_0x8326('0x11'),_0x474afa+'-'+_0x3b5ee7+'/'+_0xc93962)[_0x8326('0xc')](_0x17e74e);}return null;};}function saveUpdates(_0xa5033d){return function(_0x309a24){if(_0x309a24){return _0x309a24[_0x8326('0x12')](_0xa5033d)[_0x8326('0x13')](function(_0x5d17c9){return _0x5d17c9;});}return null;};}function removeEntity(_0x1b986f){return function(_0x41f0a1){if(_0x41f0a1){return _0x41f0a1[_0x8326('0x14')]()[_0x8326('0x13')](function(){_0x1b986f[_0x8326('0xb')](0xcc)[_0x8326('0x15')]();});}};}function handleEntityNotFound(_0xf778fa){return function(_0x3030ce){if(!_0x3030ce){_0xf778fa['sendStatus'](0x194);}return _0x3030ce;};}function handleError(_0x3b19a6,_0x2392e5){_0x2392e5=_0x2392e5||0x1f4;return function(_0x2d59be){logger['error'](_0x2d59be[_0x8326('0x16')]);if(_0x2d59be[_0x8326('0x17')]){delete _0x2d59be[_0x8326('0x17')];}_0x3b19a6[_0x8326('0xb')](_0x2392e5)[_0x8326('0x18')](_0x2d59be);};}function maskClientSecret(_0xa2cd59){return _['padEnd'](_0xa2cd59[_0x8326('0x19')](0x0,0x3),0x14,'*');}exports['index']=function(_0x2c16dd,_0x2aaeb8){var _0x5a46e9={},_0x103487={},_0x3639a8={'count':0x0,'rows':[]};var _0x51db44=_[_0x8326('0x1a')](db[_0x8326('0x1b')]['rawAttributes'],function(_0x174c41){return{'name':_0x174c41['fieldName'],'type':_0x174c41[_0x8326('0x1c')]['key']};});_0x103487['model']=_[_0x8326('0x1a')](_0x51db44,'name');_0x103487[_0x8326('0x1d')]=_[_0x8326('0x1e')](_0x2c16dd[_0x8326('0x1d')]);_0x103487[_0x8326('0x1f')]=_[_0x8326('0x20')](_0x103487['model'],_0x103487['query']);_0x5a46e9['attributes']=_[_0x8326('0x20')](_0x103487[_0x8326('0x21')],qs['fields'](_0x2c16dd[_0x8326('0x1d')][_0x8326('0x22')]));_0x5a46e9[_0x8326('0x23')]=_0x5a46e9['attributes'][_0x8326('0x24')]?_0x5a46e9[_0x8326('0x23')]:_0x103487[_0x8326('0x21')];if(!_0x2c16dd[_0x8326('0x1d')][_0x8326('0x25')](_0x8326('0x26'))){_0x5a46e9[_0x8326('0xf')]=qs[_0x8326('0xf')](_0x2c16dd[_0x8326('0x1d')][_0x8326('0xf')]);_0x5a46e9['offset']=qs['offset'](_0x2c16dd[_0x8326('0x1d')][_0x8326('0xd')]);}_0x5a46e9[_0x8326('0x27')]=qs['sort'](_0x2c16dd['query']['sort']);_0x5a46e9[_0x8326('0x28')]=qs['filters'](_[_0x8326('0x29')](_0x2c16dd[_0x8326('0x1d')],_0x103487['filters']),_0x51db44);if(_0x2c16dd[_0x8326('0x1d')]['filter']){_0x5a46e9['where']=_[_0x8326('0x2a')](_0x5a46e9['where'],{'$or':_[_0x8326('0x1a')](_0x51db44,function(_0x8f0a54){if(_0x8f0a54[_0x8326('0x1c')]!==_0x8326('0x2b')){var _0x4bf55d={};_0x4bf55d[_0x8f0a54[_0x8326('0x17')]]={'$like':'%'+_0x2c16dd[_0x8326('0x1d')][_0x8326('0x2c')]+'%'};return _0x4bf55d;}})});}_0x5a46e9=_[_0x8326('0x2a')]({},_0x5a46e9,_0x2c16dd[_0x8326('0x2d')]);var _0x2768a2={'where':_0x5a46e9['where']};return db[_0x8326('0x1b')][_0x8326('0x10')](_0x2768a2)[_0x8326('0x13')](function(_0xe2dedc){_0x3639a8[_0x8326('0x10')]=_0xe2dedc;if(_0x2c16dd[_0x8326('0x1d')][_0x8326('0x2e')]){_0x5a46e9[_0x8326('0x2f')]=[{'all':!![]}];}return db[_0x8326('0x1b')]['findAll'](_0x5a46e9);})['then'](function(_0x5e75fc){_0x3639a8[_0x8326('0x30')]=_[_0x8326('0x1a')](_0x5e75fc,function(_0xdec0a4){if(_0xdec0a4[_0x8326('0x31')]===_0x8326('0x32')){var _0x37df87=encryptor['decryptString'](_0xdec0a4[_0x8326('0x33')]);_0xdec0a4[_0x8326('0x33')]=maskClientSecret(_0x37df87);}return _0xdec0a4;});return _0x3639a8;})[_0x8326('0x13')](respondWithFilteredResult(_0x2aaeb8,_0x5a46e9))['catch'](handleError(_0x2aaeb8,null));};exports[_0x8326('0x34')]=function(_0x2a3324,_0x436c2f){var _0x550567={'raw':!![],'where':{'id':_0x2a3324[_0x8326('0x35')]['id']}},_0x9e59c9={};_0x9e59c9[_0x8326('0x21')]=_['keys'](db[_0x8326('0x1b')]['rawAttributes']);_0x9e59c9[_0x8326('0x1d')]=_[_0x8326('0x1e')](_0x2a3324[_0x8326('0x1d')]);_0x9e59c9[_0x8326('0x1f')]=_[_0x8326('0x20')](_0x9e59c9[_0x8326('0x21')],_0x9e59c9[_0x8326('0x1d')]);_0x550567[_0x8326('0x23')]=_[_0x8326('0x20')](_0x9e59c9[_0x8326('0x21')],qs[_0x8326('0x22')](_0x2a3324[_0x8326('0x1d')][_0x8326('0x22')]));_0x550567[_0x8326('0x23')]=_0x550567[_0x8326('0x23')][_0x8326('0x24')]?_0x550567[_0x8326('0x23')]:_0x9e59c9[_0x8326('0x21')];if(_0x2a3324[_0x8326('0x1d')][_0x8326('0x2e')]){_0x550567[_0x8326('0x2f')]=[{'all':!![]}];}_0x550567=_['merge']({},_0x550567,_0x2a3324['options']);return db['CloudProvider'][_0x8326('0x36')](_0x550567)[_0x8326('0x13')](handleEntityNotFound(_0x436c2f,null))[_0x8326('0x13')](function(_0x6615f7){if(_0x6615f7['service']===_0x8326('0x32')){var _0x42ed4c=encryptor['decryptString'](_0x6615f7[_0x8326('0x33')]);_0x6615f7['data3']=maskClientSecret(_0x42ed4c);}return _0x6615f7;})[_0x8326('0x13')](respondWithResult(_0x436c2f,null))[_0x8326('0x37')](handleError(_0x436c2f,null));};exports[_0x8326('0x38')]=function(_0x471978,_0x1110b6){if(!_0x471978[_0x8326('0x39')][_0x8326('0x17')])throw new Error(_0x8326('0x3a'));if(!_0x471978[_0x8326('0x39')]['service'])throw new Error('Service\x20parameter\x20not\x20specified');var _0x5df1c7=db['CloudProvider']['rawAttributes']['service']['values'];if(!_0x5df1c7[_0x8326('0x3b')](_0x471978[_0x8326('0x39')][_0x8326('0x31')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x5df1c7[_0x8326('0x3c')](',\x20'));if(_0x471978['body'][_0x8326('0x31')]==='MicrosoftAzure'&&_0x471978[_0x8326('0x39')]['data3']){_0x471978[_0x8326('0x39')][_0x8326('0x33')]=encryptor[_0x8326('0x3d')](_0x471978[_0x8326('0x39')][_0x8326('0x33')]);}return db[_0x8326('0x1b')][_0x8326('0x38')](_0x471978[_0x8326('0x39')],{})[_0x8326('0x13')](respondWithResult(_0x1110b6,0xc9))['catch'](handleError(_0x1110b6,null));};exports['update']=function(_0xe5c65e,_0x214a12){if(_0xe5c65e[_0x8326('0x39')]['id']){delete _0xe5c65e['body']['id'];}return db[_0x8326('0x1b')][_0x8326('0x36')]({'where':{'id':_0xe5c65e[_0x8326('0x35')]['id']}})[_0x8326('0x13')](handleEntityNotFound(_0x214a12,null))['then'](function(_0x39681f){if(_0x39681f[_0x8326('0x31')]===_0x8326('0x32')&&_0xe5c65e[_0x8326('0x39')][_0x8326('0x33')]){_0xe5c65e[_0x8326('0x39')]['data3']=encryptor[_0x8326('0x3d')](_0xe5c65e['body']['data3']);}return _0x39681f;})[_0x8326('0x13')](saveUpdates(_0xe5c65e[_0x8326('0x39')],null))[_0x8326('0x13')](respondWithResult(_0x214a12,null))['catch'](handleError(_0x214a12,null));};exports['destroy']=function(_0x5d9468,_0x2d8f65){return db[_0x8326('0x1b')]['find']({'where':{'id':_0x5d9468['params']['id']}})[_0x8326('0x13')](handleEntityNotFound(_0x2d8f65,null))[_0x8326('0x13')](removeEntity(_0x2d8f65,null))[_0x8326('0x37')](handleError(_0x2d8f65,null));};exports['oauth2MicrosoftAuthorize']=function(_0x5df9a2,_0x3b0d4f){return db[_0x8326('0x1b')][_0x8326('0x3e')]({'where':{'id':_0x5df9a2['params']['id']},'raw':!![]})['then'](function(_0x5833c7){if(!_0x5833c7)return _0x3b0d4f[_0x8326('0xa')](0x194);return{'url':oauth[_0x8326('0x3f')](_0x5833c7,_0x5df9a2[_0x8326('0x40')]['id'])};})[_0x8326('0x13')](respondWithResult(_0x3b0d4f,null))[_0x8326('0x37')](handleError(_0x3b0d4f,null));};exports['oauth2MicrosoftCallback']=function(_0x16650f,_0x35dc5d){var _0x596e7c=_0x16650f[_0x8326('0x39')];var _0x1cb788;var _0x296be8;if(_0x596e7c['error'])throw _0x596e7c;redis[_0x8326('0x41')](_0x596e7c[_0x8326('0x42')])[_0x8326('0x13')](function(_0x4a8b98){if(!_0x4a8b98)throw new Error('Invalid\x20state\x20parameter');_0x1cb788=JSON['parse'](_0x4a8b98);var _0x18494c=Buffer[_0x8326('0x43')](_0x596e7c[_0x8326('0x42')],'base64')[_0x8326('0x44')]('ascii');_0x296be8=JSON['parse'](_0x18494c);if(!oauth[_0x8326('0x45')](_0x596e7c['id_token'],_0x1cb788[_0x8326('0x46')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis['del'](_0x596e7c[_0x8326('0x42')]);return oauth[_0x8326('0x47')](_0x596e7c[_0x8326('0x48')],_0x1cb788);})[_0x8326('0x13')](function(_0x558134){_0x1cb788[_0x8326('0x49')]=_0x558134[_0x8326('0x4a')];_0x1cb788[_0x8326('0x4b')]=_0x558134['refresh_token'];return db[_0x8326('0x1b')]['update']({'data5':_0x1cb788['data5'],'data6':_0x1cb788['data6']},{'where':{'id':_0x1cb788['id']}});})[_0x8326('0x13')](function(){oauth[_0x8326('0x4c')](_0x1cb788);socket[_0x8326('0x4d')](_0x8326('0x4e'),{'id':_0x296be8['id']});return;})[_0x8326('0x13')](respondWithStatusCode(_0x35dc5d,null))[_0x8326('0x37')](function(_0x14a110){if(_0x296be8){socket[_0x8326('0x4d')](_0x8326('0x4f'),{'id':_0x296be8['id']});}if(!_0x1cb788){logger['error'](_0x8326('0x50'),_0x14a110);return _0x35dc5d['status'](0x1f4)[_0x8326('0x18')](_0x14a110['message']);}logger['error']('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x1cb788['id'],JSON[_0x8326('0x51')](_0x14a110));});};
\ No newline at end of file
+var _0xe2d4=['undefined','count','set','Content-Range','update','then','destroy','error','stack','name','send','padEnd','slice','index','map','CloudProvider','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','MicrosoftAzure','data3','show','params','find','service','decryptString','catch','Name\x20parameter\x20not\x20specified','body','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','create','findOne','user','oauth2MicrosoftCallback','state','Invalid\x20state\x20parameter','parse','from','ascii','isValidIdToken','id_token','oauth2Claims','code','data5','access_token','refresh_token','data6','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','redis','defaults','localhost','sendStatus','end','status','offset'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0xe2d4,0xa3));var _0x4e2d=function(_0x251449,_0x3b5c74){_0x251449=_0x251449-0x0;var _0x7669e8=_0xe2d4[_0x251449];return _0x7669e8;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require(_0x4e2d('0x0'));var encryptor=require(_0x4e2d('0x1'));var config=require(_0x4e2d('0x2'));var logger=require(_0x4e2d('0x3'))(_0x4e2d('0x4'));var db=require(_0x4e2d('0x5'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x4e2d('0x6')]=_[_0x4e2d('0x7')](config[_0x4e2d('0x6')],{'host':_0x4e2d('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4e2d('0x6')]));var redis=new Redis(config[_0x4e2d('0x6')]);function respondWithStatusCode(_0x3598f3,_0xf860d6){_0xf860d6=_0xf860d6||0xcc;return function(_0x5c5b37){if(_0x5c5b37){return _0x3598f3[_0x4e2d('0x9')](_0xf860d6);}return _0x3598f3['status'](_0xf860d6)[_0x4e2d('0xa')]();};}function respondWithResult(_0x5eeaa2,_0x1d02ab){_0x1d02ab=_0x1d02ab||0xc8;return function(_0x2ca4bc){if(_0x2ca4bc){return _0x5eeaa2[_0x4e2d('0xb')](_0x1d02ab)['json'](_0x2ca4bc);}};}function respondWithFilteredResult(_0x22648b,_0x26769f){return function(_0xe02272){if(_0xe02272){var _0x44db06=typeof _0x26769f[_0x4e2d('0xc')]===_0x4e2d('0xd')&&typeof _0x26769f['limit']===_0x4e2d('0xd');var _0x4cdbc6=_0xe02272[_0x4e2d('0xe')];var _0x41640d=_0x44db06?0x0:_0x26769f['offset'];var _0x39f82c=_0x44db06?_0xe02272[_0x4e2d('0xe')]:_0x26769f['offset']+_0x26769f['limit'];var _0xcd99be;if(_0x39f82c>=_0x4cdbc6){_0x39f82c=_0x4cdbc6;_0xcd99be=0xc8;}else{_0xcd99be=0xce;}_0x22648b[_0x4e2d('0xb')](_0xcd99be);return _0x22648b[_0x4e2d('0xf')](_0x4e2d('0x10'),_0x41640d+'-'+_0x39f82c+'/'+_0x4cdbc6)['json'](_0xe02272);}return null;};}function saveUpdates(_0x3688d2){return function(_0x2992ca){if(_0x2992ca){return _0x2992ca[_0x4e2d('0x11')](_0x3688d2)[_0x4e2d('0x12')](function(_0x293aec){return _0x293aec;});}return null;};}function removeEntity(_0x194e5a){return function(_0x2e2506){if(_0x2e2506){return _0x2e2506[_0x4e2d('0x13')]()[_0x4e2d('0x12')](function(){_0x194e5a['status'](0xcc)[_0x4e2d('0xa')]();});}};}function handleEntityNotFound(_0x169c9e){return function(_0x4b3581){if(!_0x4b3581){_0x169c9e['sendStatus'](0x194);}return _0x4b3581;};}function handleError(_0x4ce29e,_0x38c329){_0x38c329=_0x38c329||0x1f4;return function(_0xe3c7bb){logger[_0x4e2d('0x14')](_0xe3c7bb[_0x4e2d('0x15')]);if(_0xe3c7bb[_0x4e2d('0x16')]){delete _0xe3c7bb['name'];}_0x4ce29e[_0x4e2d('0xb')](_0x38c329)[_0x4e2d('0x17')](_0xe3c7bb);};}function maskClientSecret(_0x3485bd){return _[_0x4e2d('0x18')](_0x3485bd[_0x4e2d('0x19')](0x0,0x3),0x14,'*');}exports[_0x4e2d('0x1a')]=function(_0x3f0786,_0x18b268){var _0x44ddb4={},_0x31c41f={},_0x5bb251={'count':0x0,'rows':[]};var _0x26a8aa=_[_0x4e2d('0x1b')](db[_0x4e2d('0x1c')]['rawAttributes'],function(_0x1bdd05){return{'name':_0x1bdd05['fieldName'],'type':_0x1bdd05[_0x4e2d('0x1d')]['key']};});_0x31c41f[_0x4e2d('0x1e')]=_[_0x4e2d('0x1b')](_0x26a8aa,_0x4e2d('0x16'));_0x31c41f[_0x4e2d('0x1f')]=_[_0x4e2d('0x20')](_0x3f0786[_0x4e2d('0x1f')]);_0x31c41f[_0x4e2d('0x21')]=_[_0x4e2d('0x22')](_0x31c41f[_0x4e2d('0x1e')],_0x31c41f[_0x4e2d('0x1f')]);_0x44ddb4[_0x4e2d('0x23')]=_[_0x4e2d('0x22')](_0x31c41f[_0x4e2d('0x1e')],qs[_0x4e2d('0x24')](_0x3f0786[_0x4e2d('0x1f')][_0x4e2d('0x24')]));_0x44ddb4[_0x4e2d('0x23')]=_0x44ddb4[_0x4e2d('0x23')][_0x4e2d('0x25')]?_0x44ddb4[_0x4e2d('0x23')]:_0x31c41f[_0x4e2d('0x1e')];if(!_0x3f0786[_0x4e2d('0x1f')][_0x4e2d('0x26')]('nolimit')){_0x44ddb4[_0x4e2d('0x27')]=qs[_0x4e2d('0x27')](_0x3f0786[_0x4e2d('0x1f')][_0x4e2d('0x27')]);_0x44ddb4[_0x4e2d('0xc')]=qs[_0x4e2d('0xc')](_0x3f0786[_0x4e2d('0x1f')]['offset']);}_0x44ddb4[_0x4e2d('0x28')]=qs[_0x4e2d('0x29')](_0x3f0786[_0x4e2d('0x1f')]['sort']);_0x44ddb4[_0x4e2d('0x2a')]=qs[_0x4e2d('0x21')](_[_0x4e2d('0x2b')](_0x3f0786[_0x4e2d('0x1f')],_0x31c41f[_0x4e2d('0x21')]),_0x26a8aa);if(_0x3f0786[_0x4e2d('0x1f')][_0x4e2d('0x2c')]){_0x44ddb4[_0x4e2d('0x2a')]=_[_0x4e2d('0x2d')](_0x44ddb4['where'],{'$or':_[_0x4e2d('0x1b')](_0x26a8aa,function(_0x263fa9){if(_0x263fa9[_0x4e2d('0x1d')]!=='VIRTUAL'){var _0x460210={};_0x460210[_0x263fa9['name']]={'$like':'%'+_0x3f0786['query']['filter']+'%'};return _0x460210;}})});}_0x44ddb4=_['merge']({},_0x44ddb4,_0x3f0786[_0x4e2d('0x2e')]);var _0x49be96={'where':_0x44ddb4[_0x4e2d('0x2a')]};return db[_0x4e2d('0x1c')]['count'](_0x49be96)['then'](function(_0x56f7b1){_0x5bb251[_0x4e2d('0xe')]=_0x56f7b1;if(_0x3f0786['query'][_0x4e2d('0x2f')]){_0x44ddb4[_0x4e2d('0x30')]=[{'all':!![]}];}return db[_0x4e2d('0x1c')]['findAll'](_0x44ddb4);})[_0x4e2d('0x12')](function(_0x2efd53){_0x5bb251[_0x4e2d('0x31')]=_[_0x4e2d('0x1b')](_0x2efd53,function(_0x298bdb){if(_0x298bdb['service']===_0x4e2d('0x32')){var _0x59688a=encryptor['decryptString'](_0x298bdb[_0x4e2d('0x33')]);_0x298bdb[_0x4e2d('0x33')]=maskClientSecret(_0x59688a);}return _0x298bdb;});return _0x5bb251;})[_0x4e2d('0x12')](respondWithFilteredResult(_0x18b268,_0x44ddb4))['catch'](handleError(_0x18b268,null));};exports[_0x4e2d('0x34')]=function(_0x448b44,_0x64475d){var _0x1f3e39={'raw':!![],'where':{'id':_0x448b44[_0x4e2d('0x35')]['id']}},_0x5a0207={};_0x5a0207[_0x4e2d('0x1e')]=_['keys'](db[_0x4e2d('0x1c')]['rawAttributes']);_0x5a0207['query']=_[_0x4e2d('0x20')](_0x448b44[_0x4e2d('0x1f')]);_0x5a0207[_0x4e2d('0x21')]=_[_0x4e2d('0x22')](_0x5a0207[_0x4e2d('0x1e')],_0x5a0207[_0x4e2d('0x1f')]);_0x1f3e39[_0x4e2d('0x23')]=_[_0x4e2d('0x22')](_0x5a0207[_0x4e2d('0x1e')],qs[_0x4e2d('0x24')](_0x448b44[_0x4e2d('0x1f')][_0x4e2d('0x24')]));_0x1f3e39[_0x4e2d('0x23')]=_0x1f3e39[_0x4e2d('0x23')][_0x4e2d('0x25')]?_0x1f3e39[_0x4e2d('0x23')]:_0x5a0207[_0x4e2d('0x1e')];if(_0x448b44[_0x4e2d('0x1f')][_0x4e2d('0x2f')]){_0x1f3e39[_0x4e2d('0x30')]=[{'all':!![]}];}_0x1f3e39=_[_0x4e2d('0x2d')]({},_0x1f3e39,_0x448b44[_0x4e2d('0x2e')]);return db['CloudProvider'][_0x4e2d('0x36')](_0x1f3e39)[_0x4e2d('0x12')](handleEntityNotFound(_0x64475d,null))[_0x4e2d('0x12')](function(_0x51c410){if(_0x51c410[_0x4e2d('0x37')]===_0x4e2d('0x32')){var _0x738953=encryptor[_0x4e2d('0x38')](_0x51c410[_0x4e2d('0x33')]);_0x51c410['data3']=maskClientSecret(_0x738953);}return _0x51c410;})[_0x4e2d('0x12')](respondWithResult(_0x64475d,null))[_0x4e2d('0x39')](handleError(_0x64475d,null));};exports['create']=function(_0x1a1c6a,_0x9c6858){if(!_0x1a1c6a['body']['name'])throw new Error(_0x4e2d('0x3a'));if(!_0x1a1c6a[_0x4e2d('0x3b')][_0x4e2d('0x37')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x2f4754=db['CloudProvider']['rawAttributes'][_0x4e2d('0x37')][_0x4e2d('0x3c')];if(!_0x2f4754[_0x4e2d('0x3d')](_0x1a1c6a['body']['service']))throw new Error(_0x4e2d('0x3e')+_0x2f4754[_0x4e2d('0x3f')](',\x20'));if(_0x1a1c6a[_0x4e2d('0x3b')][_0x4e2d('0x37')]===_0x4e2d('0x32')&&_0x1a1c6a[_0x4e2d('0x3b')][_0x4e2d('0x33')]){_0x1a1c6a[_0x4e2d('0x3b')][_0x4e2d('0x33')]=encryptor[_0x4e2d('0x40')](_0x1a1c6a[_0x4e2d('0x3b')][_0x4e2d('0x33')]);}return db[_0x4e2d('0x1c')][_0x4e2d('0x41')](_0x1a1c6a[_0x4e2d('0x3b')],{})[_0x4e2d('0x12')](respondWithResult(_0x9c6858,0xc9))[_0x4e2d('0x39')](handleError(_0x9c6858,null));};exports[_0x4e2d('0x11')]=function(_0x4c3bf1,_0x3eb870){if(_0x4c3bf1[_0x4e2d('0x3b')]['id']){delete _0x4c3bf1[_0x4e2d('0x3b')]['id'];}return db[_0x4e2d('0x1c')][_0x4e2d('0x36')]({'where':{'id':_0x4c3bf1['params']['id']}})[_0x4e2d('0x12')](handleEntityNotFound(_0x3eb870,null))['then'](function(_0x123f82){if(_0x123f82[_0x4e2d('0x37')]===_0x4e2d('0x32')&&_0x4c3bf1[_0x4e2d('0x3b')][_0x4e2d('0x33')]){_0x4c3bf1['body'][_0x4e2d('0x33')]=encryptor[_0x4e2d('0x40')](_0x4c3bf1[_0x4e2d('0x3b')][_0x4e2d('0x33')]);}return _0x123f82;})[_0x4e2d('0x12')](saveUpdates(_0x4c3bf1[_0x4e2d('0x3b')],null))[_0x4e2d('0x12')](respondWithResult(_0x3eb870,null))[_0x4e2d('0x39')](handleError(_0x3eb870,null));};exports['destroy']=function(_0x5f0099,_0x5ed8ca){return db[_0x4e2d('0x1c')][_0x4e2d('0x36')]({'where':{'id':_0x5f0099[_0x4e2d('0x35')]['id']}})[_0x4e2d('0x12')](handleEntityNotFound(_0x5ed8ca,null))['then'](removeEntity(_0x5ed8ca,null))[_0x4e2d('0x39')](handleError(_0x5ed8ca,null));};exports['oauth2MicrosoftAuthorize']=function(_0x2d38fc,_0x478b7a){return db[_0x4e2d('0x1c')][_0x4e2d('0x42')]({'where':{'id':_0x2d38fc[_0x4e2d('0x35')]['id']},'raw':!![]})[_0x4e2d('0x12')](function(_0x5d1ad9){if(!_0x5d1ad9)return _0x478b7a[_0x4e2d('0x9')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x5d1ad9,_0x2d38fc[_0x4e2d('0x43')]['id'])};})[_0x4e2d('0x12')](respondWithResult(_0x478b7a,null))[_0x4e2d('0x39')](handleError(_0x478b7a,null));};exports[_0x4e2d('0x44')]=function(_0x50dfe6,_0x41cdf1){var _0x4c8798=_0x50dfe6['body'];var _0x542d71;var _0x3c1630;if(_0x4c8798[_0x4e2d('0x14')])throw _0x4c8798;redis['get'](_0x4c8798[_0x4e2d('0x45')])[_0x4e2d('0x12')](function(_0x44e8d9){if(!_0x44e8d9)throw new Error(_0x4e2d('0x46'));_0x542d71=JSON[_0x4e2d('0x47')](_0x44e8d9);var _0x362476=Buffer[_0x4e2d('0x48')](_0x4c8798[_0x4e2d('0x45')],'base64')['toString'](_0x4e2d('0x49'));_0x3c1630=JSON[_0x4e2d('0x47')](_0x362476);if(!oauth[_0x4e2d('0x4a')](_0x4c8798[_0x4e2d('0x4b')],_0x542d71[_0x4e2d('0x4c')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis['del'](_0x4c8798['state']);return oauth['getOauth2MicrosoftAccessToken'](_0x4c8798[_0x4e2d('0x4d')],_0x542d71);})[_0x4e2d('0x12')](function(_0x5d1745){_0x542d71[_0x4e2d('0x4e')]=_0x5d1745[_0x4e2d('0x4f')];_0x542d71['data6']=_0x5d1745[_0x4e2d('0x50')];return db['CloudProvider']['update']({'data5':_0x542d71[_0x4e2d('0x4e')],'data6':_0x542d71[_0x4e2d('0x51')]},{'where':{'id':_0x542d71['id']}});})[_0x4e2d('0x12')](function(){oauth['startRefreshInterval'](_0x542d71);socket[_0x4e2d('0x52')](_0x4e2d('0x53'),{'id':_0x3c1630['id']});return;})[_0x4e2d('0x12')](respondWithStatusCode(_0x41cdf1,null))['catch'](function(_0x321153){if(_0x3c1630){socket[_0x4e2d('0x52')](_0x4e2d('0x54'),{'id':_0x3c1630['id']});}if(!_0x542d71){logger['error'](_0x4e2d('0x55'),_0x321153);return _0x41cdf1[_0x4e2d('0xb')](0x1f4)['send'](_0x321153['message']);}logger['error'](_0x4e2d('0x56'),_0x542d71['id'],JSON[_0x4e2d('0x57')](_0x321153));});};
\ No newline at end of file
index 63741af..01215fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x443a=['bluebird','request-promise','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','cloud_providers','lodash','util','../../config/logger','api','moment'];(function(_0x24668d,_0x42d5cd){var _0x488e37=function(_0x4fde7b){while(--_0x4fde7b){_0x24668d['push'](_0x24668d['shift']());}};_0x488e37(++_0x42d5cd);}(_0x443a,0x1dc));var _0xa443=function(_0x20b5f5,_0x8eb71f){_0x20b5f5=_0x20b5f5-0x0;var _0x38cb49=_0x443a[_0x20b5f5];return _0x38cb49;};'use strict';var _=require(_0xa443('0x0'));var util=require(_0xa443('0x1'));var logger=require(_0xa443('0x2'))(_0xa443('0x3'));var moment=require(_0xa443('0x4'));var BPromise=require(_0xa443('0x5'));var rp=require(_0xa443('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa443('0x7'));var config=require(_0xa443('0x8'));var attributes=require(_0xa443('0x9'));module[_0xa443('0xa')]=function(_0x48f828,_0x161190){return _0x48f828[_0xa443('0xb')]('CloudProvider',attributes,{'tableName':_0xa443('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc994=['request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','define','CloudProvider','cloud_providers','lodash','../../config/logger','api','moment','bluebird'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xc994,0x1b5));var _0x4c99=function(_0xb3add3,_0x2b6e6f){_0xb3add3=_0xb3add3-0x0;var _0x111b74=_0xc994[_0xb3add3];return _0x111b74;};'use strict';var _=require(_0x4c99('0x0'));var util=require('util');var logger=require(_0x4c99('0x1'))(_0x4c99('0x2'));var moment=require(_0x4c99('0x3'));var BPromise=require(_0x4c99('0x4'));var rp=require(_0x4c99('0x5'));var fs=require('fs');var path=require(_0x4c99('0x6'));var rimraf=require(_0x4c99('0x7'));var config=require(_0x4c99('0x8'));var attributes=require(_0x4c99('0x9'));module['exports']=function(_0x4904df,_0x48917e){return _0x4904df[_0x4c99('0xa')](_0x4c99('0xb'),attributes,{'tableName':_0x4c99('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8f56c76..0246295 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f40=['CloudProvider','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','bind','intervals','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','moment','ioredis','util','../../components/encryptor','../../config/environment','../../config/schedule/cloud-provider','../../mysqldb','localhost','redis','openid','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','{TENANT_ID}','id_token','stringify','randomBytes','toString','client_id','data1','response_type','redirect_uri','response_mode','form_post','scope','nonce','prompt','login','key','oauth2Claims','oauth2/','set','decode','iss','issuer','aud','audience','isAfter','unix','then','data3','findOne','refresh_token','data6','data4','decryptString','POST','data2','data5','access_token'];(function(_0x12b2fe,_0x2f0199){var _0x277d52=function(_0x49fc49){while(--_0x49fc49){_0x12b2fe['push'](_0x12b2fe['shift']());}};_0x277d52(++_0x2f0199);}(_0x3f40,0x17d));var _0x03f4=function(_0x1a5af7,_0x528b65){_0x1a5af7=_0x1a5af7-0x0;var _0x4443ee=_0x3f40[_0x1a5af7];return _0x4443ee;};'use strict';var _=require(_0x03f4('0x0'));var crypto=require(_0x03f4('0x1'));var jwt=require('jsonwebtoken');var moment=require(_0x03f4('0x2'));var Redis=require(_0x03f4('0x3'));var rp=require('request-promise');var util=require(_0x03f4('0x4'));var encryptor=require(_0x03f4('0x5'));var config=require(_0x03f4('0x6'));var logger=require('../../config/logger')('api');var schedule=require(_0x03f4('0x7'));var db=require(_0x03f4('0x8'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x03f4('0x9'),'port':0x18eb});var redis=new Redis(config[_0x03f4('0xa')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x03f4('0xb'),'profile',_0x03f4('0xc'),_0x03f4('0xd'),_0x03f4('0xe'),'https://outlook.office.com/POP.AccessAsUser.All',_0x03f4('0xf')],'Dynamics365':['openid',_0x03f4('0xd')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x03f4('0x10');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x66c151){var _0x338d79=_[_0x03f4('0x11')](AZURE_AUTH_SCOPES[_0x66c151[_0x03f4('0x12')]]);if(_0x66c151['type']===_0x03f4('0x13'))_0x338d79[_0x03f4('0x14')](_0x66c151[_0x03f4('0x15')]+_0x03f4('0x16'));return _0x338d79[_0x03f4('0x17')]('\x20');}function getAccessTokenScope(_0xffa525){if(_0xffa525['type']===_0x03f4('0x18'))return _0x03f4('0xe');if(_0xffa525[_0x03f4('0x12')]===_0x03f4('0x13'))return _0xffa525[_0x03f4('0x15')]+_0x03f4('0x16');}function generateMicrosoftAuthorizationUrl(_0x1e07d0,_0x3c683b){var _0x57b865=MICROSOFT_AUTH_URL[_0x03f4('0x19')](_0x03f4('0x1a'),_0x1e07d0['data2']);var _0x7b890c=['code',_0x03f4('0x1b')];var _0xb4cf56=Buffer['from'](JSON[_0x03f4('0x1c')]({'id':_0x3c683b}))['toString']('base64');var _0x195371=crypto[_0x03f4('0x1d')](0x10)[_0x03f4('0x1e')]('hex');var _0x510449=getAuthorizationScopes(_0x1e07d0);var _0x32ddb4=[{'key':_0x03f4('0x1f'),'value':_0x1e07d0[_0x03f4('0x20')]},{'key':_0x03f4('0x21'),'value':encodeURIComponent(_0x7b890c[_0x03f4('0x17')]('\x20'))},{'key':_0x03f4('0x22'),'value':_0x1e07d0['data4']},{'key':_0x03f4('0x23'),'value':_0x03f4('0x24')},{'key':_0x03f4('0x25'),'value':encodeURIComponent(_0x510449)},{'key':'state','value':_0xb4cf56},{'key':_0x03f4('0x26'),'value':_0x195371},{'key':_0x03f4('0x27'),'value':_0x03f4('0x28')}];var _0x58209e=_0x57b865+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x03f4('0x11')](_0x32ddb4,function(_0x49ad3c){return _0x49ad3c[_0x03f4('0x29')]+'='+_0x49ad3c['value'];})['join']('&');_0x1e07d0[_0x03f4('0x2a')]={'issuer':_0x57b865['replace'](_0x03f4('0x2b'),''),'audience':_0x1e07d0[_0x03f4('0x20')],'state':_0xb4cf56,'nonce':_0x195371};redis[_0x03f4('0x2c')](_0xb4cf56,JSON['stringify'](_0x1e07d0));return _0x58209e;}function isValidIdToken(_0x3d99c8,_0x398500){try{var _0x33ad8f=jwt[_0x03f4('0x2d')](_0x3d99c8,{'complete':!![]});var _0x54c0d7=_0x33ad8f['payload'];if(_0x54c0d7[_0x03f4('0x2e')]!==_0x398500[_0x03f4('0x2f')])return![];if(_0x54c0d7[_0x03f4('0x30')]!==_0x398500[_0x03f4('0x31')])return![];if(_0x54c0d7[_0x03f4('0x26')]!==_0x398500[_0x03f4('0x26')])return![];if(moment()[_0x03f4('0x32')](moment[_0x03f4('0x33')](_0x54c0d7['exp'])))return![];return!![];}catch(_0x580ec6){throw _0x580ec6;}}function refreshOauth2MicrosoftAccessToken(_0x2c8f67){return Promise['resolve']()[_0x03f4('0x34')](function(){if(_0x2c8f67[_0x03f4('0x35')])return _0x2c8f67;return db['CloudProvider'][_0x03f4('0x36')]({'where':{'id':_0x2c8f67['id']},'raw':!![]});})[_0x03f4('0x34')](function(_0x46d75){var _0x3ca14a={'grant_type':_0x03f4('0x37'),'refresh_token':_0x46d75[_0x03f4('0x38')],'scope':getAccessTokenScope(_0x46d75),'redirect_uri':_0x46d75[_0x03f4('0x39')],'client_id':_0x46d75['data1'],'client_secret':encryptor[_0x03f4('0x3a')](_0x46d75[_0x03f4('0x35')])};var _0x15ce85={'method':_0x03f4('0x3b'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x46d75[_0x03f4('0x3c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3ca14a,'json':!![]};return rp(_0x15ce85);})[_0x03f4('0x34')](function(_0xe1c8f3){_0x2c8f67[_0x03f4('0x3d')]=_0xe1c8f3[_0x03f4('0x3e')];_0x2c8f67['data6']=_0xe1c8f3[_0x03f4('0x37')];return db[_0x03f4('0x3f')]['update']({'data5':_0x2c8f67[_0x03f4('0x3d')],'data6':_0x2c8f67[_0x03f4('0x38')]},{'where':{'id':_0x2c8f67['id']}});})[_0x03f4('0x34')](function(){return _0x2c8f67;})[_0x03f4('0x40')](function(_0x559f0f){logger[_0x03f4('0x41')](_0x03f4('0x42'),_0x2c8f67['id'],_0x559f0f);});}function getOauth2MicrosoftAccessToken(_0x3ed0c9,_0x12e4f7){var _0xef538={'grant_type':'authorization_code','code':_0x3ed0c9,'scope':getAccessTokenScope(_0x12e4f7),'redirect_uri':_0x12e4f7['data4'],'client_id':_0x12e4f7[_0x03f4('0x20')],'client_secret':encryptor[_0x03f4('0x3a')](_0x12e4f7[_0x03f4('0x35')])};var _0x5b5181={'method':_0x03f4('0x3b'),'uri':MICROSOFT_AUTH_URL[_0x03f4('0x19')](_0x03f4('0x1a'),_0x12e4f7[_0x03f4('0x3c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xef538,'json':!![]};return rp(_0x5b5181);}function startRefreshInterval(_0x597ab1){var _0x1fd0d7=schedule['intervals'];if(_0x1fd0d7[_0x597ab1['id']])clearInterval(_0x1fd0d7[_0x597ab1['id']]);_0x1fd0d7[_0x597ab1['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x03f4('0x43')](this,{'id':_0x597ab1['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x03f4('0x44')]=_0x1fd0d7;}function startAllRefreshIntervals(){return db[_0x03f4('0x3f')][_0x03f4('0x45')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x03f4('0x34')](function(_0x596d59){var _0x3e7c0f=_0x596d59[_0x03f4('0x11')](function(_0x23a9cc){return refreshOauth2MicrosoftAccessToken(_0x23a9cc)[_0x03f4('0x34')](function(_0x469f0e){startRefreshInterval(_0x469f0e);});});return Promise[_0x03f4('0x46')](_0x3e7c0f);})[_0x03f4('0x40')](function(_0x5a357f){var _0x138488=_0x5a357f?util[_0x03f4('0x47')](_0x5a357f,{'showHidden':![],'depth':null}):'';logger[_0x03f4('0x41')](_0x03f4('0x48'),_0x138488);});}module[_0x03f4('0x49')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x3307=['refresh_token','CloudProvider','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','request-promise','util','api','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','/token','map','type','data7','/.default','join','Outlook365','Dynamics365','replace','{TENANT_ID}','data2','code','from','stringify','base64','randomBytes','toString','hex','data1','response_type','redirect_uri','data4','response_mode','form_post','scope','state','login','key','value','set','decode','payload','issuer','aud','nonce','isAfter','unix','exp','resolve','then','data3','findOne','data6','decryptString','POST','data5'];(function(_0x4bdf64,_0x3022b2){var _0x9a1a19=function(_0x4e551b){while(--_0x4e551b){_0x4bdf64['push'](_0x4bdf64['shift']());}};_0x9a1a19(++_0x3022b2);}(_0x3307,0x1bb));var _0x7330=function(_0xebaab,_0x2ee709){_0xebaab=_0xebaab-0x0;var _0x59ec8a=_0x3307[_0xebaab];return _0x59ec8a;};'use strict';var _=require(_0x7330('0x0'));var crypto=require(_0x7330('0x1'));var jwt=require(_0x7330('0x2'));var moment=require('moment');var Redis=require('ioredis');var rp=require(_0x7330('0x3'));var util=require(_0x7330('0x4'));var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require('../../config/logger')(_0x7330('0x5'));var schedule=require('../../config/schedule/cloud-provider');var db=require('../../mysqldb')['db'];config[_0x7330('0x6')]=_[_0x7330('0x7')](config[_0x7330('0x6')],{'host':_0x7330('0x8'),'port':0x18eb});var redis=new Redis(config[_0x7330('0x6')]);var MICROSOFT_AUTH_URL=_0x7330('0x9');var AZURE_AUTH_SCOPES={'Outlook365':[_0x7330('0xa'),_0x7330('0xb'),_0x7330('0xc'),_0x7330('0xd'),_0x7330('0xe'),'https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send'],'Dynamics365':['openid','offline_access']};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x7330('0xf');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x39e9f0){var _0x35904b=_[_0x7330('0x10')](AZURE_AUTH_SCOPES[_0x39e9f0['type']]);if(_0x39e9f0[_0x7330('0x11')]==='Dynamics365')_0x35904b['push'](_0x39e9f0[_0x7330('0x12')]+_0x7330('0x13'));return _0x35904b[_0x7330('0x14')]('\x20');}function getAccessTokenScope(_0xe4a8a){if(_0xe4a8a[_0x7330('0x11')]===_0x7330('0x15'))return _0x7330('0xe');if(_0xe4a8a['type']===_0x7330('0x16'))return _0xe4a8a['data7']+_0x7330('0x13');}function generateMicrosoftAuthorizationUrl(_0x2408d3,_0x2fa78f){var _0x2dcc04=MICROSOFT_AUTH_URL[_0x7330('0x17')](_0x7330('0x18'),_0x2408d3[_0x7330('0x19')]);var _0xc90807=[_0x7330('0x1a'),'id_token'];var _0x4f925d=Buffer[_0x7330('0x1b')](JSON[_0x7330('0x1c')]({'id':_0x2fa78f}))['toString'](_0x7330('0x1d'));var _0x4072a0=crypto[_0x7330('0x1e')](0x10)[_0x7330('0x1f')](_0x7330('0x20'));var _0x308441=getAuthorizationScopes(_0x2408d3);var _0x4d3dd9=[{'key':'client_id','value':_0x2408d3[_0x7330('0x21')]},{'key':_0x7330('0x22'),'value':encodeURIComponent(_0xc90807[_0x7330('0x14')]('\x20'))},{'key':_0x7330('0x23'),'value':_0x2408d3[_0x7330('0x24')]},{'key':_0x7330('0x25'),'value':_0x7330('0x26')},{'key':_0x7330('0x27'),'value':encodeURIComponent(_0x308441)},{'key':_0x7330('0x28'),'value':_0x4f925d},{'key':'nonce','value':_0x4072a0},{'key':'prompt','value':_0x7330('0x29')}];var _0x10ea82=_0x2dcc04+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x4d3dd9,function(_0x142c81){return _0x142c81[_0x7330('0x2a')]+'='+_0x142c81[_0x7330('0x2b')];})['join']('&');_0x2408d3['oauth2Claims']={'issuer':_0x2dcc04[_0x7330('0x17')]('oauth2/',''),'audience':_0x2408d3[_0x7330('0x21')],'state':_0x4f925d,'nonce':_0x4072a0};redis[_0x7330('0x2c')](_0x4f925d,JSON[_0x7330('0x1c')](_0x2408d3));return _0x10ea82;}function isValidIdToken(_0x227fc0,_0x370432){try{var _0x46116c=jwt[_0x7330('0x2d')](_0x227fc0,{'complete':!![]});var _0x5492d3=_0x46116c[_0x7330('0x2e')];if(_0x5492d3['iss']!==_0x370432[_0x7330('0x2f')])return![];if(_0x5492d3[_0x7330('0x30')]!==_0x370432['audience'])return![];if(_0x5492d3[_0x7330('0x31')]!==_0x370432['nonce'])return![];if(moment()[_0x7330('0x32')](moment[_0x7330('0x33')](_0x5492d3[_0x7330('0x34')])))return![];return!![];}catch(_0x533a66){throw _0x533a66;}}function refreshOauth2MicrosoftAccessToken(_0x5acdf2){return Promise[_0x7330('0x35')]()[_0x7330('0x36')](function(){if(_0x5acdf2[_0x7330('0x37')])return _0x5acdf2;return db['CloudProvider'][_0x7330('0x38')]({'where':{'id':_0x5acdf2['id']},'raw':!![]});})[_0x7330('0x36')](function(_0x2bcdac){var _0x54b39d={'grant_type':'refresh_token','refresh_token':_0x2bcdac[_0x7330('0x39')],'scope':getAccessTokenScope(_0x2bcdac),'redirect_uri':_0x2bcdac[_0x7330('0x24')],'client_id':_0x2bcdac[_0x7330('0x21')],'client_secret':encryptor[_0x7330('0x3a')](_0x2bcdac[_0x7330('0x37')])};var _0xb5e7c9={'method':_0x7330('0x3b'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x2bcdac[_0x7330('0x19')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x54b39d,'json':!![]};return rp(_0xb5e7c9);})['then'](function(_0x1d55e8){_0x5acdf2[_0x7330('0x3c')]=_0x1d55e8['access_token'];_0x5acdf2[_0x7330('0x39')]=_0x1d55e8[_0x7330('0x3d')];return db[_0x7330('0x3e')][_0x7330('0x3f')]({'data5':_0x5acdf2[_0x7330('0x3c')],'data6':_0x5acdf2[_0x7330('0x39')]},{'where':{'id':_0x5acdf2['id']}});})[_0x7330('0x36')](function(){return _0x5acdf2;})[_0x7330('0x40')](function(_0x320e6d){logger[_0x7330('0x41')](_0x7330('0x42'),_0x5acdf2['id'],_0x320e6d);});}function getOauth2MicrosoftAccessToken(_0x4aeea8,_0x9c127){var _0x24556a={'grant_type':_0x7330('0x43'),'code':_0x4aeea8,'scope':getAccessTokenScope(_0x9c127),'redirect_uri':_0x9c127['data4'],'client_id':_0x9c127[_0x7330('0x21')],'client_secret':encryptor['decryptString'](_0x9c127[_0x7330('0x37')])};var _0x18a369={'method':_0x7330('0x3b'),'uri':MICROSOFT_AUTH_URL[_0x7330('0x17')]('{TENANT_ID}',_0x9c127['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x24556a,'json':!![]};return rp(_0x18a369);}function startRefreshInterval(_0xed388e){var _0x286722=schedule['intervals'];if(_0x286722[_0xed388e['id']])clearInterval(_0x286722[_0xed388e['id']]);_0x286722[_0xed388e['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0xed388e['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x286722;}function startAllRefreshIntervals(){return db[_0x7330('0x3e')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x4f1590){var _0x3464f8=_0x4f1590['map'](function(_0x34e682){return refreshOauth2MicrosoftAccessToken(_0x34e682)[_0x7330('0x36')](function(_0x2a1d1e){startRefreshInterval(_0x2a1d1e);});});return Promise[_0x7330('0x44')](_0x3464f8);})[_0x7330('0x40')](function(_0x447c56){var _0x126326=_0x447c56?util[_0x7330('0x45')](_0x447c56,{'showHidden':![],'depth':null}):'';logger['error'](_0x7330('0x46'),_0x126326);});}module[_0x7330('0x47')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
index ebe072e..49a4944 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x10ad=['code','message','result','catch','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x10ad,0xf4));var _0xd10a=function(_0x43be0a,_0x4d8b3c){_0x43be0a=_0x43be0a-0x0;var _0x800c61=_0x10ad[_0x43be0a];return _0x800c61;};'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')]('CloudProvider,\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);});});}
\ No newline at end of file
+var _0x5d0a=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0xd49418,_0x1e744b){var _0x47f430=function(_0x302e91){while(--_0x302e91){_0xd49418['push'](_0xd49418['shift']());}};_0x47f430(++_0x1e744b);}(_0x5d0a,0x175));var _0xa5d0=function(_0x4437c9,_0x4a4e1e){_0x4437c9=_0x4437c9-0x0;var _0x47285a=_0x5d0a[_0x4437c9];return _0x47285a;};'use strict';var _=require(_0xa5d0('0x0'));var util=require('util');var moment=require(_0xa5d0('0x1'));var BPromise=require('bluebird');var rs=require(_0xa5d0('0x2'));var fs=require('fs');var Redis=require(_0xa5d0('0x3'));var db=require(_0xa5d0('0x4'))['db'];var utils=require(_0xa5d0('0x5'));var logger=require('../../config/logger')(_0xa5d0('0x6'));var config=require(_0xa5d0('0x7'));var jayson=require(_0xa5d0('0x8'));var client=jayson[_0xa5d0('0x9')][_0xa5d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16af3f,_0x19d26f,_0x1841a1){return new BPromise(function(_0x295165,_0x27fe5a){return client[_0xa5d0('0xb')](_0x16af3f,_0x1841a1)['then'](function(_0x43698e){logger[_0xa5d0('0xc')](_0xa5d0('0xd'),_0x19d26f,_0xa5d0('0xe'));logger[_0xa5d0('0xf')](_0xa5d0('0x10'),_0x19d26f,_0xa5d0('0xe'),JSON[_0xa5d0('0x11')](_0x43698e));if(_0x43698e[_0xa5d0('0x12')]){if(_0x43698e[_0xa5d0('0x12')]['code']===0x1f4){logger[_0xa5d0('0x12')]('CloudProvider,\x20%s,\x20%s',_0x19d26f,_0x43698e['error'][_0xa5d0('0x13')]);return _0x27fe5a(_0x43698e[_0xa5d0('0x12')][_0xa5d0('0x13')]);}logger[_0xa5d0('0x12')]('CloudProvider,\x20%s,\x20%s',_0x19d26f,_0x43698e['error'][_0xa5d0('0x13')]);return _0x295165(_0x43698e[_0xa5d0('0x12')][_0xa5d0('0x13')]);}else{logger[_0xa5d0('0xc')](_0xa5d0('0xd'),_0x19d26f,_0xa5d0('0xe'));_0x295165(_0x43698e[_0xa5d0('0x14')]['message']);}})[_0xa5d0('0x15')](function(_0x5bfe18){logger[_0xa5d0('0x12')](_0xa5d0('0xd'),_0x19d26f,_0x5bfe18);_0x27fe5a(_0x5bfe18);});});}
\ No newline at end of file
index 19c1f1e..21a2d6e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0xd2f4ac,_0x5aa8e5){var _0x9757b2=function(_0x442ced){while(--_0x442ced){_0xd2f4ac['push'](_0xd2f4ac['shift']());}};_0x9757b2(++_0x5aa8e5);}(_0x1261,0x144));var _0x1126=function(_0x50499c,_0x188984){_0x50499c=_0x50499c-0x0;var _0xd422b3=_0x1261[_0x50499c];return _0xd422b3;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router;
\ No newline at end of file
+var _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x7a54,0x106));var _0x47a5=function(_0x367aa6,_0x2512f7){_0x367aa6=_0x367aa6-0x0;var _0x4320d2=_0x7a54[_0x367aa6];return _0x4320d2;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router;
\ No newline at end of file
index d404eef..f5eb344 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb377=['STRING','name','sequelize','exports'];(function(_0x33d4b9,_0x557e45){var _0x435aef=function(_0xde64db){while(--_0xde64db){_0x33d4b9['push'](_0x33d4b9['shift']());}};_0x435aef(++_0x557e45);}(_0xb377,0x1b6));var _0x7b37=function(_0x40da8e,_0x9f8d11){_0x40da8e=_0x40da8e-0x0;var _0x2200c8=_0xb377[_0x40da8e];return _0x2200c8;};'use strict';var Sequelize=require(_0x7b37('0x0'));module[_0x7b37('0x1')]={'name':{'type':Sequelize[_0x7b37('0x2')],'unique':_0x7b37('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x7b37('0x2')]},'companyId':{'type':Sequelize[_0x7b37('0x2')]},'website':{'type':Sequelize[_0x7b37('0x2')]},'phone':{'type':Sequelize[_0x7b37('0x2')]},'fax':{'type':Sequelize[_0x7b37('0x2')]},'type':{'type':Sequelize[_0x7b37('0x2')]},'street':{'type':Sequelize[_0x7b37('0x2')]},'postalCode':{'type':Sequelize[_0x7b37('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x7b37('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x7b37('0x2')]},'sCity':{'type':Sequelize[_0x7b37('0x2')]},'sCountry':{'type':Sequelize[_0x7b37('0x2')]},'description':{'type':Sequelize[_0x7b37('0x2')]}};
\ No newline at end of file
+var _0xe970=['exports','STRING','name','sequelize'];(function(_0xe9f78a,_0x5e17b4){var _0x3de080=function(_0x2f69fd){while(--_0x2f69fd){_0xe9f78a['push'](_0xe9f78a['shift']());}};_0x3de080(++_0x5e17b4);}(_0xe970,0x18b));var _0x0e97=function(_0x386f43,_0x1c9928){_0x386f43=_0x386f43-0x0;var _0x184645=_0xe970[_0x386f43];return _0x184645;};'use strict';var Sequelize=require(_0x0e97('0x0'));module[_0x0e97('0x1')]={'name':{'type':Sequelize[_0x0e97('0x2')],'unique':_0x0e97('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x0e97('0x2')]},'companyId':{'type':Sequelize[_0x0e97('0x2')]},'website':{'type':Sequelize[_0x0e97('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x0e97('0x2')]},'type':{'type':Sequelize[_0x0e97('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x0e97('0x2')]},'city':{'type':Sequelize[_0x0e97('0x2')]},'country':{'type':Sequelize[_0x0e97('0x2')]},'email':{'type':Sequelize[_0x0e97('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x0e97('0x2')]},'sStreet':{'type':Sequelize[_0x0e97('0x2')]},'sPostalCode':{'type':Sequelize[_0x0e97('0x2')]},'sCity':{'type':Sequelize[_0x0e97('0x2')]},'sCountry':{'type':Sequelize[_0x0e97('0x2')]},'description':{'type':Sequelize[_0x0e97('0x2')]}};
\ No newline at end of file
index e974371..f17fccc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b0f=['UserProfileSection','find','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','getContacts','findOne','hasOwnProperty','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Companies','stack','name','index','CmCompany','describe','model','query','keys','intersection','fields','attributes','nolimit','order','sort','where','filters','pick','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x3e86e2,_0xbdc053){var _0x3ff730=function(_0x417d87){while(--_0x417d87){_0x3e86e2['push'](_0x3e86e2['shift']());}};_0x3ff730(++_0xbdc053);}(_0x6b0f,0xc1));var _0xf6b0=function(_0x108ec3,_0x2f3f26){_0x108ec3=_0x108ec3-0x0;var _0x15083d=_0x6b0f[_0x108ec3];return _0x15083d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf6b0('0x0'));var zipdir=require(_0xf6b0('0x1'));var jsonpatch=require(_0xf6b0('0x2'));var rp=require(_0xf6b0('0x3'));var moment=require(_0xf6b0('0x4'));var BPromise=require(_0xf6b0('0x5'));var Mustache=require('mustache');var util=require(_0xf6b0('0x6'));var path=require(_0xf6b0('0x7'));var sox=require(_0xf6b0('0x8'));var csv=require(_0xf6b0('0x9'));var ejs=require(_0xf6b0('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf6b0('0xb'));var squel=require(_0xf6b0('0xc'));var crypto=require(_0xf6b0('0xd'));var jsforce=require(_0xf6b0('0xe'));var deskjs=require(_0xf6b0('0xf'));var toCsv=require(_0xf6b0('0x9'));var querystring=require(_0xf6b0('0x10'));var Papa=require(_0xf6b0('0x11'));var Redis=require(_0xf6b0('0x12'));var authService=require(_0xf6b0('0x13'));var qs=require(_0xf6b0('0x14'));var as=require(_0xf6b0('0x15'));var hardwareService=require(_0xf6b0('0x16'));var logger=require(_0xf6b0('0x17'))(_0xf6b0('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf6b0('0x19'));var db=require(_0xf6b0('0x1a'))['db'];function respondWithStatusCode(_0xc8c39d,_0x260062){_0x260062=_0x260062||0xcc;return function(_0x39bcb2){if(_0x39bcb2){return _0xc8c39d[_0xf6b0('0x1b')](_0x260062);}return _0xc8c39d[_0xf6b0('0x1c')](_0x260062)[_0xf6b0('0x1d')]();};}function respondWithResult(_0x575907,_0x3ee658){_0x3ee658=_0x3ee658||0xc8;return function(_0x964ee9){if(_0x964ee9){return _0x575907[_0xf6b0('0x1c')](_0x3ee658)[_0xf6b0('0x1e')](_0x964ee9);}};}function respondWithFilteredResult(_0x4c2f06,_0x43fc50){return function(_0x529396){if(_0x529396){var _0x557827=typeof _0x43fc50[_0xf6b0('0x1f')]===_0xf6b0('0x20')&&typeof _0x43fc50[_0xf6b0('0x21')]==='undefined';var _0x371336=_0x529396[_0xf6b0('0x22')];var _0x54a4b2=_0x557827?0x0:_0x43fc50['offset'];var _0x3f2dca=_0x557827?_0x529396[_0xf6b0('0x22')]:_0x43fc50[_0xf6b0('0x1f')]+_0x43fc50[_0xf6b0('0x21')];var _0x126d98;if(_0x3f2dca>=_0x371336){_0x3f2dca=_0x371336;_0x126d98=0xc8;}else{_0x126d98=0xce;}_0x4c2f06['status'](_0x126d98);return _0x4c2f06[_0xf6b0('0x23')](_0xf6b0('0x24'),_0x54a4b2+'-'+_0x3f2dca+'/'+_0x371336)[_0xf6b0('0x1e')](_0x529396);}return null;};}function patchUpdates(_0x22a4af){return function(_0x3ddd92){try{jsonpatch[_0xf6b0('0x25')](_0x3ddd92,_0x22a4af,!![]);}catch(_0xbf10b4){return BPromise[_0xf6b0('0x26')](_0xbf10b4);}return _0x3ddd92[_0xf6b0('0x27')]();};}function saveUpdates(_0x134f8a,_0x256bb3){return function(_0x4962b6){if(_0x4962b6){return _0x4962b6[_0xf6b0('0x28')](_0x134f8a)[_0xf6b0('0x29')](function(_0x415e09){return _0x415e09;});}return null;};}function removeEntity(_0x43702e,_0x5ca580){return function(_0x2c1a93){if(_0x2c1a93){return _0x2c1a93[_0xf6b0('0x2a')]()[_0xf6b0('0x29')](function(){var _0x1ef9c1=_0x2c1a93[_0xf6b0('0x2b')]({'plain':!![]});var _0x5439a2=_0xf6b0('0x2c');return db['UserProfileResource'][_0xf6b0('0x2a')]({'where':{'type':_0x5439a2,'resourceId':_0x1ef9c1['id']}})['then'](function(){return _0x2c1a93;});})[_0xf6b0('0x29')](function(){_0x43702e[_0xf6b0('0x1c')](0xcc)[_0xf6b0('0x1d')]();});}};}function handleEntityNotFound(_0xc1e3ce,_0x44bc28){return function(_0x24108a){if(!_0x24108a){_0xc1e3ce[_0xf6b0('0x1b')](0x194);}return _0x24108a;};}function handleError(_0x54f6db,_0x443466){_0x443466=_0x443466||0x1f4;return function(_0x26aada){logger['error'](_0x26aada[_0xf6b0('0x2d')]);if(_0x26aada['name']){delete _0x26aada[_0xf6b0('0x2e')];}_0x54f6db['status'](_0x443466)['send'](_0x26aada);};}exports[_0xf6b0('0x2f')]=function(_0x344ad1,_0x31b22a){var _0x1622e8={},_0x31a93c={},_0x20b808={'count':0x0,'rows':[]};return db[_0xf6b0('0x30')][_0xf6b0('0x31')]()[_0xf6b0('0x29')](function(_0xaee38){_0x31a93c[_0xf6b0('0x32')]=_['keys'](_0xaee38);_0x31a93c[_0xf6b0('0x33')]=_[_0xf6b0('0x34')](_0x344ad1[_0xf6b0('0x33')]);_0x31a93c['filters']=_[_0xf6b0('0x35')](_0x31a93c[_0xf6b0('0x32')],_0x31a93c[_0xf6b0('0x33')]);_0x1622e8['attributes']=_['intersection'](_0x31a93c[_0xf6b0('0x32')],qs[_0xf6b0('0x36')](_0x344ad1[_0xf6b0('0x33')][_0xf6b0('0x36')]));_0x1622e8[_0xf6b0('0x37')]=_0x1622e8[_0xf6b0('0x37')]['length']?_0x1622e8[_0xf6b0('0x37')]:_0x31a93c[_0xf6b0('0x32')];if(!_0x344ad1[_0xf6b0('0x33')]['hasOwnProperty'](_0xf6b0('0x38'))){_0x1622e8[_0xf6b0('0x21')]=qs[_0xf6b0('0x21')](_0x344ad1[_0xf6b0('0x33')][_0xf6b0('0x21')]);_0x1622e8['offset']=qs['offset'](_0x344ad1[_0xf6b0('0x33')]['offset']);}_0x1622e8[_0xf6b0('0x39')]=qs[_0xf6b0('0x3a')](_0x344ad1[_0xf6b0('0x33')][_0xf6b0('0x3a')]);_0x1622e8[_0xf6b0('0x3b')]=qs[_0xf6b0('0x3c')](_[_0xf6b0('0x3d')](_0x344ad1[_0xf6b0('0x33')],_0x31a93c[_0xf6b0('0x3c')]),_0xaee38);if(_0x344ad1[_0xf6b0('0x33')][_0xf6b0('0x3e')]){_0x1622e8[_0xf6b0('0x3b')]=_[_0xf6b0('0x3f')](_0x1622e8[_0xf6b0('0x3b')],{'$or':_[_0xf6b0('0x40')](_0x1622e8['attributes'],function(_0xde193e){var _0x428992={};_0x428992[_0xde193e]={'$like':'%'+_0x344ad1[_0xf6b0('0x33')]['filter']+'%'};return _0x428992;})});}_0x1622e8=_[_0xf6b0('0x3f')]({},_0x1622e8,_0x344ad1[_0xf6b0('0x41')]);var _0x2c7231={'where':_0x1622e8['where']};return db['CmCompany'][_0xf6b0('0x22')](_0x2c7231)[_0xf6b0('0x29')](function(_0x419844){_0x20b808[_0xf6b0('0x22')]=_0x419844;if(_0x344ad1['query'][_0xf6b0('0x42')]){_0x1622e8[_0xf6b0('0x43')]=[{'all':!![]}];}return db[_0xf6b0('0x30')][_0xf6b0('0x44')](_0x1622e8);})[_0xf6b0('0x29')](function(_0x4ad957){_0x20b808[_0xf6b0('0x45')]=_0x4ad957;return _0x20b808;})[_0xf6b0('0x29')](respondWithFilteredResult(_0x31b22a,_0x1622e8))[_0xf6b0('0x46')](handleError(_0x31b22a,null));})[_0xf6b0('0x46')](handleError(_0x31b22a,null));};exports[_0xf6b0('0x47')]=function(_0x41e580,_0x3bfd53){var _0x3c2ea4={'raw':![],'where':{'id':_0x41e580[_0xf6b0('0x48')]['id']}},_0x2f6116={};_0x2f6116['model']=_[_0xf6b0('0x34')](db[_0xf6b0('0x30')][_0xf6b0('0x49')]);_0x2f6116[_0xf6b0('0x33')]=_[_0xf6b0('0x34')](_0x41e580[_0xf6b0('0x33')]);_0x2f6116['filters']=_[_0xf6b0('0x35')](_0x2f6116[_0xf6b0('0x32')],_0x2f6116['query']);_0x3c2ea4[_0xf6b0('0x37')]=_[_0xf6b0('0x35')](_0x2f6116[_0xf6b0('0x32')],qs[_0xf6b0('0x36')](_0x41e580['query'][_0xf6b0('0x36')]));_0x3c2ea4['attributes']=_0x3c2ea4[_0xf6b0('0x37')][_0xf6b0('0x4a')]?_0x3c2ea4[_0xf6b0('0x37')]:_0x2f6116['model'];if(_0x41e580[_0xf6b0('0x33')][_0xf6b0('0x42')]){_0x3c2ea4[_0xf6b0('0x43')]=[{'all':!![]}];}_0x3c2ea4=_[_0xf6b0('0x3f')]({},_0x3c2ea4,_0x41e580[_0xf6b0('0x41')]);return db['CmCompany']['find'](_0x3c2ea4)[_0xf6b0('0x29')](handleEntityNotFound(_0x3bfd53,null))[_0xf6b0('0x29')](respondWithResult(_0x3bfd53,null))['catch'](handleError(_0x3bfd53,null));};exports[_0xf6b0('0x4b')]=function(_0x2c9438,_0x352404){return db['CmCompany']['create'](_0x2c9438[_0xf6b0('0x4c')],{})[_0xf6b0('0x29')](function(_0x1331c7){var _0x488a52=_0x2c9438[_0xf6b0('0x4d')][_0xf6b0('0x2b')]({'plain':!![]});if(!_0x488a52)throw new Error(_0xf6b0('0x4e'));if(_0x488a52[_0xf6b0('0x4f')]==='user'){var _0x4e0329=_0x1331c7[_0xf6b0('0x2b')]({'plain':!![]});var _0x3ed6a1='Companies';return db[_0xf6b0('0x50')][_0xf6b0('0x51')]({'where':{'name':_0x3ed6a1,'userProfileId':_0x488a52['userProfileId']},'raw':!![]})['then'](function(_0x2e0596){if(_0x2e0596&&_0x2e0596[_0xf6b0('0x52')]===0x0){return db['UserProfileResource'][_0xf6b0('0x4b')]({'name':_0x4e0329['name'],'resourceId':_0x4e0329['id'],'type':_0x2e0596[_0xf6b0('0x2e')],'sectionId':_0x2e0596['id']},{})['then'](function(){return _0x1331c7;});}else{return _0x1331c7;}})[_0xf6b0('0x46')](function(_0x5dca53){logger[_0xf6b0('0x53')](_0xf6b0('0x54'),_0x5dca53);throw _0x5dca53;});}return _0x1331c7;})[_0xf6b0('0x29')](respondWithResult(_0x352404,0xc9))[_0xf6b0('0x46')](handleError(_0x352404,null));};exports[_0xf6b0('0x28')]=function(_0x534734,_0x11f062){if(_0x534734[_0xf6b0('0x4c')]['id']){delete _0x534734[_0xf6b0('0x4c')]['id'];}return db['CmCompany'][_0xf6b0('0x51')]({'where':{'id':_0x534734[_0xf6b0('0x48')]['id']}})[_0xf6b0('0x29')](handleEntityNotFound(_0x11f062,null))[_0xf6b0('0x29')](saveUpdates(_0x534734[_0xf6b0('0x4c')],null))[_0xf6b0('0x29')](respondWithResult(_0x11f062,null))[_0xf6b0('0x46')](handleError(_0x11f062,null));};exports[_0xf6b0('0x2a')]=function(_0x3a2df,_0x486238){return db[_0xf6b0('0x30')][_0xf6b0('0x51')]({'where':{'id':_0x3a2df[_0xf6b0('0x48')]['id']}})['then'](handleEntityNotFound(_0x486238,null))[_0xf6b0('0x29')](removeEntity(_0x486238,null))[_0xf6b0('0x46')](handleError(_0x486238,null));};exports[_0xf6b0('0x31')]=function(_0x373386,_0x39e03e){return db[_0xf6b0('0x30')]['describe']()['then'](respondWithResult(_0x39e03e,null))['catch'](handleError(_0x39e03e,null));};exports[_0xf6b0('0x55')]=function(_0xfd4d10,_0x1fb42e,_0x2c37d2){return db[_0xf6b0('0x56')][_0xf6b0('0x51')]({'where':{'id':_0xfd4d10['params']['id']}})['then'](handleEntityNotFound(_0x1fb42e,null))[_0xf6b0('0x29')](function(_0x1feeba){if(_0x1feeba){return _0x1feeba[_0xf6b0('0x55')](_0xfd4d10[_0xf6b0('0x4c')][_0xf6b0('0x57')],_['omit'](_0xfd4d10[_0xf6b0('0x4c')],[_0xf6b0('0x57'),'id'])||{});}})[_0xf6b0('0x29')](respondWithResult(_0x1fb42e,null))['catch'](handleError(_0x1fb42e,null));};exports[_0xf6b0('0x58')]=function(_0x76c490,_0x3b7af7,_0x5bfb15){var _0x716417={};var _0x46c9ce={};var _0x20389e;var _0x5cb4f9;return db['CmCompany'][_0xf6b0('0x59')]({'where':{'id':_0x76c490[_0xf6b0('0x48')]['id']}})[_0xf6b0('0x29')](handleEntityNotFound(_0x3b7af7,null))[_0xf6b0('0x29')](function(_0x1d4bf9){if(_0x1d4bf9){_0x20389e=_0x1d4bf9;_0x46c9ce[_0xf6b0('0x32')]=_[_0xf6b0('0x34')](db[_0xf6b0('0x56')][_0xf6b0('0x49')]);_0x46c9ce[_0xf6b0('0x33')]=_[_0xf6b0('0x34')](_0x76c490[_0xf6b0('0x33')]);_0x46c9ce[_0xf6b0('0x3c')]=_[_0xf6b0('0x35')](_0x46c9ce[_0xf6b0('0x32')],_0x46c9ce[_0xf6b0('0x33')]);_0x716417[_0xf6b0('0x37')]=_['intersection'](_0x46c9ce[_0xf6b0('0x32')],qs[_0xf6b0('0x36')](_0x76c490[_0xf6b0('0x33')][_0xf6b0('0x36')]));_0x716417[_0xf6b0('0x37')]=_0x716417[_0xf6b0('0x37')][_0xf6b0('0x4a')]?_0x716417[_0xf6b0('0x37')]:_0x46c9ce[_0xf6b0('0x32')];_0x716417['order']=qs[_0xf6b0('0x3a')](_0x76c490[_0xf6b0('0x33')][_0xf6b0('0x3a')]);_0x716417[_0xf6b0('0x3b')]=qs['filters'](_[_0xf6b0('0x3d')](_0x76c490['query'],_0x46c9ce[_0xf6b0('0x3c')]));if(_0x76c490[_0xf6b0('0x33')][_0xf6b0('0x3e')]){_0x716417['where']=_['merge'](_0x716417['where'],{'$or':_['map'](_0x716417[_0xf6b0('0x37')],function(_0x722867){var _0x4775dd={};_0x4775dd[_0x722867]={'$like':'%'+_0x76c490[_0xf6b0('0x33')][_0xf6b0('0x3e')]+'%'};return _0x4775dd;})});}_0x716417=_['merge']({},_0x716417,_0x76c490['options']);return _0x20389e[_0xf6b0('0x58')](_0x716417);}})[_0xf6b0('0x29')](function(_0x4bf4de){if(_0x4bf4de){_0x5cb4f9=_0x4bf4de[_0xf6b0('0x4a')];if(!_0x76c490[_0xf6b0('0x33')][_0xf6b0('0x5a')](_0xf6b0('0x38'))){_0x716417['limit']=qs['limit'](_0x76c490['query'][_0xf6b0('0x21')]);_0x716417[_0xf6b0('0x1f')]=qs['offset'](_0x76c490['query'][_0xf6b0('0x1f')]);}return _0x20389e[_0xf6b0('0x58')](_0x716417);}})[_0xf6b0('0x29')](function(_0xfcc6ae){if(_0xfcc6ae){return _0xfcc6ae?{'count':_0x5cb4f9,'rows':_0xfcc6ae}:null;}})['then'](respondWithResult(_0x3b7af7,null))[_0xf6b0('0x46')](handleError(_0x3b7af7,null));};
\ No newline at end of file
+var _0xdb9c=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','get','Companies','error','stack','name','index','CmCompany','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','role','user','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','CmContact','addContacts','ids','getContacts','length','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring'];(function(_0x2d366d,_0x444137){var _0x34dc75=function(_0x3b3dc5){while(--_0x3b3dc5){_0x2d366d['push'](_0x2d366d['shift']());}};_0x34dc75(++_0x444137);}(_0xdb9c,0xf2));var _0xcdb9=function(_0x17bef4,_0x552bb9){_0x17bef4=_0x17bef4-0x0;var _0x1ad2f2=_0xdb9c[_0x17bef4];return _0x1ad2f2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcdb9('0x0'));var zipdir=require(_0xcdb9('0x1'));var jsonpatch=require(_0xcdb9('0x2'));var rp=require('request-promise');var moment=require(_0xcdb9('0x3'));var BPromise=require(_0xcdb9('0x4'));var Mustache=require(_0xcdb9('0x5'));var util=require(_0xcdb9('0x6'));var path=require('path');var sox=require(_0xcdb9('0x7'));var csv=require(_0xcdb9('0x8'));var ejs=require(_0xcdb9('0x9'));var fs=require('fs');var fs_extra=require(_0xcdb9('0xa'));var _=require(_0xcdb9('0xb'));var squel=require(_0xcdb9('0xc'));var crypto=require(_0xcdb9('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xcdb9('0xe'));var toCsv=require(_0xcdb9('0x8'));var querystring=require(_0xcdb9('0xf'));var Papa=require(_0xcdb9('0x10'));var Redis=require(_0xcdb9('0x11'));var authService=require(_0xcdb9('0x12'));var qs=require(_0xcdb9('0x13'));var as=require(_0xcdb9('0x14'));var hardwareService=require(_0xcdb9('0x15'));var logger=require(_0xcdb9('0x16'))('api');var utils=require(_0xcdb9('0x17'));var config=require(_0xcdb9('0x18'));var licenseUtil=require(_0xcdb9('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3669a6,_0x5bf865){_0x5bf865=_0x5bf865||0xcc;return function(_0x225419){if(_0x225419){return _0x3669a6['sendStatus'](_0x5bf865);}return _0x3669a6['status'](_0x5bf865)[_0xcdb9('0x1a')]();};}function respondWithResult(_0x49fa6c,_0x460851){_0x460851=_0x460851||0xc8;return function(_0x29ef39){if(_0x29ef39){return _0x49fa6c[_0xcdb9('0x1b')](_0x460851)[_0xcdb9('0x1c')](_0x29ef39);}};}function respondWithFilteredResult(_0x58b80d,_0x38fe68){return function(_0x36d2d0){if(_0x36d2d0){var _0x22ca3f=typeof _0x38fe68[_0xcdb9('0x1d')]===_0xcdb9('0x1e')&&typeof _0x38fe68[_0xcdb9('0x1f')]===_0xcdb9('0x1e');var _0xea6f66=_0x36d2d0[_0xcdb9('0x20')];var _0x126d5f=_0x22ca3f?0x0:_0x38fe68[_0xcdb9('0x1d')];var _0x1d821b=_0x22ca3f?_0x36d2d0['count']:_0x38fe68['offset']+_0x38fe68['limit'];var _0x5d0b16;if(_0x1d821b>=_0xea6f66){_0x1d821b=_0xea6f66;_0x5d0b16=0xc8;}else{_0x5d0b16=0xce;}_0x58b80d['status'](_0x5d0b16);return _0x58b80d[_0xcdb9('0x21')](_0xcdb9('0x22'),_0x126d5f+'-'+_0x1d821b+'/'+_0xea6f66)['json'](_0x36d2d0);}return null;};}function patchUpdates(_0x31665a){return function(_0x286211){try{jsonpatch[_0xcdb9('0x23')](_0x286211,_0x31665a,!![]);}catch(_0x4e93ed){return BPromise[_0xcdb9('0x24')](_0x4e93ed);}return _0x286211['save']();};}function saveUpdates(_0x3edf4a,_0x238b57){return function(_0x24790a){if(_0x24790a){return _0x24790a[_0xcdb9('0x25')](_0x3edf4a)['then'](function(_0x1b29f1){return _0x1b29f1;});}return null;};}function removeEntity(_0x24a658,_0x4a9b68){return function(_0x4883a3){if(_0x4883a3){return _0x4883a3[_0xcdb9('0x26')]()[_0xcdb9('0x27')](function(){var _0x1c37c7=_0x4883a3[_0xcdb9('0x28')]({'plain':!![]});var _0x599963=_0xcdb9('0x29');return db['UserProfileResource'][_0xcdb9('0x26')]({'where':{'type':_0x599963,'resourceId':_0x1c37c7['id']}})['then'](function(){return _0x4883a3;});})[_0xcdb9('0x27')](function(){_0x24a658[_0xcdb9('0x1b')](0xcc)[_0xcdb9('0x1a')]();});}};}function handleEntityNotFound(_0x4e892e,_0x3097ed){return function(_0x2291b8){if(!_0x2291b8){_0x4e892e['sendStatus'](0x194);}return _0x2291b8;};}function handleError(_0x205e81,_0x33f7bb){_0x33f7bb=_0x33f7bb||0x1f4;return function(_0x234b15){logger[_0xcdb9('0x2a')](_0x234b15[_0xcdb9('0x2b')]);if(_0x234b15[_0xcdb9('0x2c')]){delete _0x234b15[_0xcdb9('0x2c')];}_0x205e81[_0xcdb9('0x1b')](_0x33f7bb)['send'](_0x234b15);};}exports[_0xcdb9('0x2d')]=function(_0xbdb47a,_0x1e5ac2){var _0x45cc97={},_0xb83aa5={},_0x28fd20={'count':0x0,'rows':[]};return db[_0xcdb9('0x2e')]['describe']()[_0xcdb9('0x27')](function(_0x21f600){_0xb83aa5['model']=_[_0xcdb9('0x2f')](_0x21f600);_0xb83aa5[_0xcdb9('0x30')]=_[_0xcdb9('0x2f')](_0xbdb47a['query']);_0xb83aa5[_0xcdb9('0x31')]=_[_0xcdb9('0x32')](_0xb83aa5[_0xcdb9('0x33')],_0xb83aa5[_0xcdb9('0x30')]);_0x45cc97[_0xcdb9('0x34')]=_[_0xcdb9('0x32')](_0xb83aa5[_0xcdb9('0x33')],qs['fields'](_0xbdb47a[_0xcdb9('0x30')][_0xcdb9('0x35')]));_0x45cc97[_0xcdb9('0x34')]=_0x45cc97[_0xcdb9('0x34')]['length']?_0x45cc97['attributes']:_0xb83aa5['model'];if(!_0xbdb47a[_0xcdb9('0x30')][_0xcdb9('0x36')](_0xcdb9('0x37'))){_0x45cc97['limit']=qs[_0xcdb9('0x1f')](_0xbdb47a['query'][_0xcdb9('0x1f')]);_0x45cc97[_0xcdb9('0x1d')]=qs[_0xcdb9('0x1d')](_0xbdb47a[_0xcdb9('0x30')]['offset']);}_0x45cc97[_0xcdb9('0x38')]=qs['sort'](_0xbdb47a[_0xcdb9('0x30')][_0xcdb9('0x39')]);_0x45cc97[_0xcdb9('0x3a')]=qs['filters'](_[_0xcdb9('0x3b')](_0xbdb47a[_0xcdb9('0x30')],_0xb83aa5[_0xcdb9('0x31')]),_0x21f600);if(_0xbdb47a['query'][_0xcdb9('0x3c')]){_0x45cc97['where']=_[_0xcdb9('0x3d')](_0x45cc97[_0xcdb9('0x3a')],{'$or':_[_0xcdb9('0x3e')](_0x45cc97[_0xcdb9('0x34')],function(_0x79e618){var _0x126a0e={};_0x126a0e[_0x79e618]={'$like':'%'+_0xbdb47a[_0xcdb9('0x30')][_0xcdb9('0x3c')]+'%'};return _0x126a0e;})});}_0x45cc97=_[_0xcdb9('0x3d')]({},_0x45cc97,_0xbdb47a[_0xcdb9('0x3f')]);var _0xcca5e1={'where':_0x45cc97[_0xcdb9('0x3a')]};return db['CmCompany'][_0xcdb9('0x20')](_0xcca5e1)['then'](function(_0x5cf543){_0x28fd20['count']=_0x5cf543;if(_0xbdb47a[_0xcdb9('0x30')][_0xcdb9('0x40')]){_0x45cc97[_0xcdb9('0x41')]=[{'all':!![]}];}return db[_0xcdb9('0x2e')][_0xcdb9('0x42')](_0x45cc97);})[_0xcdb9('0x27')](function(_0x446a0f){_0x28fd20[_0xcdb9('0x43')]=_0x446a0f;return _0x28fd20;})[_0xcdb9('0x27')](respondWithFilteredResult(_0x1e5ac2,_0x45cc97))[_0xcdb9('0x44')](handleError(_0x1e5ac2,null));})[_0xcdb9('0x44')](handleError(_0x1e5ac2,null));};exports[_0xcdb9('0x45')]=function(_0x33ddc3,_0xbcf8ff){var _0x18512c={'raw':![],'where':{'id':_0x33ddc3['params']['id']}},_0x1261f0={};_0x1261f0[_0xcdb9('0x33')]=_[_0xcdb9('0x2f')](db[_0xcdb9('0x2e')][_0xcdb9('0x46')]);_0x1261f0[_0xcdb9('0x30')]=_[_0xcdb9('0x2f')](_0x33ddc3['query']);_0x1261f0[_0xcdb9('0x31')]=_[_0xcdb9('0x32')](_0x1261f0[_0xcdb9('0x33')],_0x1261f0[_0xcdb9('0x30')]);_0x18512c[_0xcdb9('0x34')]=_[_0xcdb9('0x32')](_0x1261f0[_0xcdb9('0x33')],qs[_0xcdb9('0x35')](_0x33ddc3[_0xcdb9('0x30')][_0xcdb9('0x35')]));_0x18512c['attributes']=_0x18512c['attributes']['length']?_0x18512c['attributes']:_0x1261f0[_0xcdb9('0x33')];if(_0x33ddc3['query'][_0xcdb9('0x40')]){_0x18512c['include']=[{'all':!![]}];}_0x18512c=_[_0xcdb9('0x3d')]({},_0x18512c,_0x33ddc3[_0xcdb9('0x3f')]);return db[_0xcdb9('0x2e')][_0xcdb9('0x47')](_0x18512c)[_0xcdb9('0x27')](handleEntityNotFound(_0xbcf8ff,null))['then'](respondWithResult(_0xbcf8ff,null))[_0xcdb9('0x44')](handleError(_0xbcf8ff,null));};exports[_0xcdb9('0x48')]=function(_0x2e4cfe,_0x5c968e){return db[_0xcdb9('0x2e')][_0xcdb9('0x48')](_0x2e4cfe[_0xcdb9('0x49')],{})[_0xcdb9('0x27')](function(_0x2fc7ab){var _0x259c7d=_0x2e4cfe['user'][_0xcdb9('0x28')]({'plain':!![]});if(!_0x259c7d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x259c7d[_0xcdb9('0x4a')]===_0xcdb9('0x4b')){var _0x1eb029=_0x2fc7ab[_0xcdb9('0x28')]({'plain':!![]});var _0x351209=_0xcdb9('0x29');return db[_0xcdb9('0x4c')]['find']({'where':{'name':_0x351209,'userProfileId':_0x259c7d['userProfileId']},'raw':!![]})[_0xcdb9('0x27')](function(_0x497b26){if(_0x497b26&&_0x497b26['autoAssociation']===0x0){return db[_0xcdb9('0x4d')][_0xcdb9('0x48')]({'name':_0x1eb029[_0xcdb9('0x2c')],'resourceId':_0x1eb029['id'],'type':_0x497b26[_0xcdb9('0x2c')],'sectionId':_0x497b26['id']},{})['then'](function(){return _0x2fc7ab;});}else{return _0x2fc7ab;}})['catch'](function(_0x460f3c){logger[_0xcdb9('0x2a')](_0xcdb9('0x4e'),_0x460f3c);throw _0x460f3c;});}return _0x2fc7ab;})[_0xcdb9('0x27')](respondWithResult(_0x5c968e,0xc9))[_0xcdb9('0x44')](handleError(_0x5c968e,null));};exports[_0xcdb9('0x25')]=function(_0x49025e,_0xf0357e){if(_0x49025e[_0xcdb9('0x49')]['id']){delete _0x49025e[_0xcdb9('0x49')]['id'];}return db[_0xcdb9('0x2e')][_0xcdb9('0x47')]({'where':{'id':_0x49025e[_0xcdb9('0x4f')]['id']}})[_0xcdb9('0x27')](handleEntityNotFound(_0xf0357e,null))[_0xcdb9('0x27')](saveUpdates(_0x49025e[_0xcdb9('0x49')],null))[_0xcdb9('0x27')](respondWithResult(_0xf0357e,null))[_0xcdb9('0x44')](handleError(_0xf0357e,null));};exports['destroy']=function(_0x3aadb3,_0x18c804){return db[_0xcdb9('0x2e')]['find']({'where':{'id':_0x3aadb3['params']['id']}})['then'](handleEntityNotFound(_0x18c804,null))[_0xcdb9('0x27')](removeEntity(_0x18c804,null))['catch'](handleError(_0x18c804,null));};exports[_0xcdb9('0x50')]=function(_0x276400,_0x173b66){return db[_0xcdb9('0x2e')]['describe']()[_0xcdb9('0x27')](respondWithResult(_0x173b66,null))[_0xcdb9('0x44')](handleError(_0x173b66,null));};exports['addContacts']=function(_0x37b425,_0x11c49c,_0x7a9b64){return db[_0xcdb9('0x51')][_0xcdb9('0x47')]({'where':{'id':_0x37b425['params']['id']}})[_0xcdb9('0x27')](handleEntityNotFound(_0x11c49c,null))[_0xcdb9('0x27')](function(_0x274c40){if(_0x274c40){return _0x274c40[_0xcdb9('0x52')](_0x37b425['body'][_0xcdb9('0x53')],_['omit'](_0x37b425[_0xcdb9('0x49')],[_0xcdb9('0x53'),'id'])||{});}})[_0xcdb9('0x27')](respondWithResult(_0x11c49c,null))['catch'](handleError(_0x11c49c,null));};exports[_0xcdb9('0x54')]=function(_0x4bf280,_0x1b4c34,_0x3a9ba7){var _0x3f5463={};var _0x436843={};var _0x3f4ec2;var _0x485c62;return db['CmCompany']['findOne']({'where':{'id':_0x4bf280[_0xcdb9('0x4f')]['id']}})[_0xcdb9('0x27')](handleEntityNotFound(_0x1b4c34,null))[_0xcdb9('0x27')](function(_0x30b12d){if(_0x30b12d){_0x3f4ec2=_0x30b12d;_0x436843[_0xcdb9('0x33')]=_[_0xcdb9('0x2f')](db['CmContact']['rawAttributes']);_0x436843[_0xcdb9('0x30')]=_[_0xcdb9('0x2f')](_0x4bf280['query']);_0x436843[_0xcdb9('0x31')]=_[_0xcdb9('0x32')](_0x436843[_0xcdb9('0x33')],_0x436843[_0xcdb9('0x30')]);_0x3f5463[_0xcdb9('0x34')]=_[_0xcdb9('0x32')](_0x436843[_0xcdb9('0x33')],qs[_0xcdb9('0x35')](_0x4bf280['query'][_0xcdb9('0x35')]));_0x3f5463[_0xcdb9('0x34')]=_0x3f5463[_0xcdb9('0x34')][_0xcdb9('0x55')]?_0x3f5463[_0xcdb9('0x34')]:_0x436843[_0xcdb9('0x33')];_0x3f5463['order']=qs[_0xcdb9('0x39')](_0x4bf280[_0xcdb9('0x30')][_0xcdb9('0x39')]);_0x3f5463[_0xcdb9('0x3a')]=qs[_0xcdb9('0x31')](_[_0xcdb9('0x3b')](_0x4bf280[_0xcdb9('0x30')],_0x436843[_0xcdb9('0x31')]));if(_0x4bf280['query'][_0xcdb9('0x3c')]){_0x3f5463[_0xcdb9('0x3a')]=_[_0xcdb9('0x3d')](_0x3f5463[_0xcdb9('0x3a')],{'$or':_[_0xcdb9('0x3e')](_0x3f5463['attributes'],function(_0x1bf3d3){var _0x57ee75={};_0x57ee75[_0x1bf3d3]={'$like':'%'+_0x4bf280[_0xcdb9('0x30')][_0xcdb9('0x3c')]+'%'};return _0x57ee75;})});}_0x3f5463=_[_0xcdb9('0x3d')]({},_0x3f5463,_0x4bf280[_0xcdb9('0x3f')]);return _0x3f4ec2[_0xcdb9('0x54')](_0x3f5463);}})[_0xcdb9('0x27')](function(_0x334649){if(_0x334649){_0x485c62=_0x334649[_0xcdb9('0x55')];if(!_0x4bf280[_0xcdb9('0x30')]['hasOwnProperty'](_0xcdb9('0x37'))){_0x3f5463['limit']=qs[_0xcdb9('0x1f')](_0x4bf280[_0xcdb9('0x30')][_0xcdb9('0x1f')]);_0x3f5463[_0xcdb9('0x1d')]=qs[_0xcdb9('0x1d')](_0x4bf280[_0xcdb9('0x30')][_0xcdb9('0x1d')]);}return _0x3f4ec2[_0xcdb9('0x54')](_0x3f5463);}})[_0xcdb9('0x27')](function(_0x5b41d5){if(_0x5b41d5){return _0x5b41d5?{'count':_0x485c62,'rows':_0x5b41d5}:null;}})[_0xcdb9('0x27')](respondWithResult(_0x1b4c34,null))['catch'](handleError(_0x1b4c34,null));};
\ No newline at end of file
index c72d6cf..6802801 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb382=['bluebird','request-promise','path','rimraf','../../config/environment','exports','CmCompany','cm_companies','util','../../config/logger','api','moment'];(function(_0x8b9e62,_0x173b44){var _0x31a9a0=function(_0x5cacf7){while(--_0x5cacf7){_0x8b9e62['push'](_0x8b9e62['shift']());}};_0x31a9a0(++_0x173b44);}(_0xb382,0xc8));var _0x2b38=function(_0x283939,_0x29cd3e){_0x283939=_0x283939-0x0;var _0x2b9c73=_0xb382[_0x283939];return _0x2b9c73;};'use strict';var _=require('lodash');var util=require(_0x2b38('0x0'));var logger=require(_0x2b38('0x1'))(_0x2b38('0x2'));var moment=require(_0x2b38('0x3'));var BPromise=require(_0x2b38('0x4'));var rp=require(_0x2b38('0x5'));var fs=require('fs');var path=require(_0x2b38('0x6'));var rimraf=require(_0x2b38('0x7'));var config=require(_0x2b38('0x8'));var attributes=require('./cmCompany.attributes');module[_0x2b38('0x9')]=function(_0x51f025,_0x2165a4){return _0x51f025['define'](_0x2b38('0xa'),attributes,{'tableName':_0x2b38('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x85c9=['cm_companies','lodash','util','api','bluebird','request-promise','../../config/environment','./cmCompany.attributes','define','CmCompany'];(function(_0xce93c,_0x555be5){var _0x230720=function(_0x6d5428){while(--_0x6d5428){_0xce93c['push'](_0xce93c['shift']());}};_0x230720(++_0x555be5);}(_0x85c9,0x8d));var _0x985c=function(_0x383356,_0x33d2f5){_0x383356=_0x383356-0x0;var _0x32ee5a=_0x85c9[_0x383356];return _0x32ee5a;};'use strict';var _=require(_0x985c('0x0'));var util=require(_0x985c('0x1'));var logger=require('../../config/logger')(_0x985c('0x2'));var moment=require('moment');var BPromise=require(_0x985c('0x3'));var rp=require(_0x985c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x985c('0x5'));var attributes=require(_0x985c('0x6'));module['exports']=function(_0x3a8ae3,_0x3a6430){return _0x3a8ae3[_0x985c('0x7')](_0x985c('0x8'),attributes,{'tableName':_0x985c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 82a4ec8..ddb381f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d86=['catch','lodash','moment','randomstring','ioredis','../../config/logger','../../config/environment','client','http','request','then','CmCompany,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result'];(function(_0x63704b,_0x585040){var _0xc3e445=function(_0x3dc527){while(--_0x3dc527){_0x63704b['push'](_0x63704b['shift']());}};_0xc3e445(++_0x585040);}(_0x1d86,0x1dc));var _0x61d8=function(_0xd58173,_0xe21f66){_0xd58173=_0xd58173-0x0;var _0x58c5f6=_0x1d86[_0xd58173];return _0x58c5f6;};'use strict';var _=require(_0x61d8('0x0'));var util=require('util');var moment=require(_0x61d8('0x1'));var BPromise=require('bluebird');var rs=require(_0x61d8('0x2'));var fs=require('fs');var Redis=require(_0x61d8('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x61d8('0x4'))('rpc');var config=require(_0x61d8('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x61d8('0x6')][_0x61d8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x22e02f,_0x5cb6f5,_0x10c407){return new BPromise(function(_0x42aa88,_0x33bdef){return client[_0x61d8('0x8')](_0x22e02f,_0x10c407)[_0x61d8('0x9')](function(_0x1c1b9d){logger['info'](_0x61d8('0xa'),_0x5cb6f5,'request\x20sent');logger[_0x61d8('0xb')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x5cb6f5,'request\x20sent',JSON[_0x61d8('0xc')](_0x1c1b9d));if(_0x1c1b9d[_0x61d8('0xd')]){if(_0x1c1b9d[_0x61d8('0xd')][_0x61d8('0xe')]===0x1f4){logger[_0x61d8('0xd')](_0x61d8('0xa'),_0x5cb6f5,_0x1c1b9d[_0x61d8('0xd')]['message']);return _0x33bdef(_0x1c1b9d['error'][_0x61d8('0xf')]);}logger['error'](_0x61d8('0xa'),_0x5cb6f5,_0x1c1b9d['error'][_0x61d8('0xf')]);return _0x42aa88(_0x1c1b9d[_0x61d8('0xd')][_0x61d8('0xf')]);}else{logger['info']('CmCompany,\x20%s,\x20%s',_0x5cb6f5,_0x61d8('0x10'));_0x42aa88(_0x1c1b9d[_0x61d8('0x11')][_0x61d8('0xf')]);}})[_0x61d8('0x12')](function(_0x3db080){logger[_0x61d8('0xd')](_0x61d8('0xa'),_0x5cb6f5,_0x3db080);_0x33bdef(_0x3db080);});});}
\ No newline at end of file
+var _0xb0f0=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment'];(function(_0x530f02,_0x1d3a26){var _0x47e3ba=function(_0x5d6f70){while(--_0x5d6f70){_0x530f02['push'](_0x530f02['shift']());}};_0x47e3ba(++_0x1d3a26);}(_0xb0f0,0x15d));var _0x0b0f=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xb0f0[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x0b0f('0x0'));var util=require(_0x0b0f('0x1'));var moment=require(_0x0b0f('0x2'));var BPromise=require(_0x0b0f('0x3'));var rs=require(_0x0b0f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0b0f('0x5'))['db'];var utils=require(_0x0b0f('0x6'));var logger=require(_0x0b0f('0x7'))(_0x0b0f('0x8'));var config=require('../../config/environment');var jayson=require(_0x0b0f('0x9'));var client=jayson[_0x0b0f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x49e636,_0x46b1ed,_0xd6af1){return new BPromise(function(_0x1c00a3,_0x15ea50){return client['request'](_0x49e636,_0xd6af1)[_0x0b0f('0xb')](function(_0x4a399b){logger[_0x0b0f('0xc')](_0x0b0f('0xd'),_0x46b1ed,_0x0b0f('0xe'));logger[_0x0b0f('0xf')](_0x0b0f('0x10'),_0x46b1ed,_0x0b0f('0xe'),JSON[_0x0b0f('0x11')](_0x4a399b));if(_0x4a399b[_0x0b0f('0x12')]){if(_0x4a399b['error'][_0x0b0f('0x13')]===0x1f4){logger[_0x0b0f('0x12')](_0x0b0f('0xd'),_0x46b1ed,_0x4a399b['error'][_0x0b0f('0x14')]);return _0x15ea50(_0x4a399b[_0x0b0f('0x12')][_0x0b0f('0x14')]);}logger[_0x0b0f('0x12')]('CmCompany,\x20%s,\x20%s',_0x46b1ed,_0x4a399b[_0x0b0f('0x12')][_0x0b0f('0x14')]);return _0x1c00a3(_0x4a399b['error'][_0x0b0f('0x14')]);}else{logger['info'](_0x0b0f('0xd'),_0x46b1ed,_0x0b0f('0xe'));_0x1c00a3(_0x4a399b[_0x0b0f('0x15')][_0x0b0f('0x14')]);}})['catch'](function(_0x1cd55d){logger['error']('CmCompany,\x20%s,\x20%s',_0x46b1ed,_0x1cd55d);_0x15ea50(_0x1cd55d);});});}
\ No newline at end of file
index 23a4b7e..9f3fb65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe056=['util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/contacts','post','create','addContacts','put','update','delete','exports','multer'];(function(_0xfb42e6,_0x5f5d4b){var _0x27265b=function(_0x163e81){while(--_0x163e81){_0xfb42e6['push'](_0xfb42e6['shift']());}};_0x27265b(++_0x5f5d4b);}(_0xe056,0xc5));var _0x6e05=function(_0x3f94f9,_0x42774b){_0x3f94f9=_0x3f94f9-0x0;var _0x46f84f=_0xe056[_0x3f94f9];return _0x46f84f;};'use strict';var multer=require(_0x6e05('0x0'));var util=require(_0x6e05('0x1'));var path=require(_0x6e05('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6e05('0x3')]();var fs_extra=require(_0x6e05('0x4'));var auth=require(_0x6e05('0x5'));var interaction=require(_0x6e05('0x6'));var config=require(_0x6e05('0x7'));var controller=require('./cmCompany.controller');router[_0x6e05('0x8')]('/',auth[_0x6e05('0x9')](),controller[_0x6e05('0xa')]);router[_0x6e05('0x8')](_0x6e05('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x6e05('0xc'),auth[_0x6e05('0x9')](),controller[_0x6e05('0xd')]);router[_0x6e05('0x8')](_0x6e05('0xe'),auth[_0x6e05('0x9')](),controller['getContacts']);router[_0x6e05('0xf')]('/',auth[_0x6e05('0x9')](),controller[_0x6e05('0x10')]);router[_0x6e05('0xf')](_0x6e05('0xe'),auth['isAuthenticated'](),controller[_0x6e05('0x11')]);router[_0x6e05('0x12')](_0x6e05('0xc'),auth['isAuthenticated'](),controller[_0x6e05('0x13')]);router[_0x6e05('0x14')]('/:id',auth[_0x6e05('0x9')](),controller['destroy']);module[_0x6e05('0x15')]=router;
\ No newline at end of file
+var _0x235e=['isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','get'];(function(_0x288237,_0xa88834){var _0x3c94b9=function(_0x5301a3){while(--_0x5301a3){_0x288237['push'](_0x288237['shift']());}};_0x3c94b9(++_0xa88834);}(_0x235e,0xa5));var _0xe235=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x235e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xe235('0x0'));var util=require('util');var path=require(_0xe235('0x1'));var timeout=require(_0xe235('0x2'));var express=require(_0xe235('0x3'));var router=express[_0xe235('0x4')]();var fs_extra=require(_0xe235('0x5'));var auth=require(_0xe235('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe235('0x7'));var controller=require(_0xe235('0x8'));router[_0xe235('0x9')]('/',auth[_0xe235('0xa')](),controller[_0xe235('0xb')]);router['get'](_0xe235('0xc'),auth[_0xe235('0xa')](),controller[_0xe235('0xd')]);router[_0xe235('0x9')](_0xe235('0xe'),auth[_0xe235('0xa')](),controller[_0xe235('0xf')]);router[_0xe235('0x9')](_0xe235('0x10'),auth['isAuthenticated'](),controller[_0xe235('0x11')]);router[_0xe235('0x12')]('/',auth[_0xe235('0xa')](),controller[_0xe235('0x13')]);router[_0xe235('0x12')](_0xe235('0x10'),auth[_0xe235('0xa')](),controller[_0xe235('0x14')]);router['put'](_0xe235('0xe'),auth[_0xe235('0xa')](),controller[_0xe235('0x15')]);router[_0xe235('0x16')](_0xe235('0xe'),auth['isAuthenticated'](),controller[_0xe235('0x17')]);module[_0xe235('0x18')]=router;
\ No newline at end of file
index a58f059..c72d68e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x757a=['STRING','TEXT','INTEGER','UNSIGNED','DATE','sequelize','exports'];(function(_0x388b47,_0x5cdac5){var _0x4859df=function(_0x466a16){while(--_0x466a16){_0x388b47['push'](_0x388b47['shift']());}};_0x4859df(++_0x5cdac5);}(_0x757a,0xde));var _0xa757=function(_0x588fb0,_0x4ba68d){_0x588fb0=_0x588fb0-0x0;var _0x1cbccc=_0x757a[_0x588fb0];return _0x1cbccc;};'use strict';var _=require('lodash');var Sequelize=require(_0xa757('0x0'));module[_0xa757('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xa757('0x2')]},'city':{'type':Sequelize[_0xa757('0x2')]},'country':{'type':Sequelize[_0xa757('0x2')]},'dateOfBirth':{'type':Sequelize[_0xa757('0x2')]},'description':{'type':Sequelize[_0xa757('0x3')]},'phone':{'type':Sequelize[_0xa757('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xa757('0x2')]},'email':{'type':Sequelize[_0xa757('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xa757('0x2')]},'fb_data':{'type':Sequelize[_0xa757('0x2')]},'twitter':{'type':Sequelize[_0xa757('0x2')]},'skype':{'type':Sequelize[_0xa757('0x2')]},'teams':{'type':Sequelize[_0xa757('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xa757('0x2')]},'wechat':{'type':Sequelize[_0xa757('0x2')]},'telegram':{'type':Sequelize[_0xa757('0x2')]},'UserId':{'type':Sequelize[_0xa757('0x4')]},'priority':{'type':Sequelize[_0xa757('0x4')](0x2)[_0xa757('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xa757('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xbaf0=['DATE','NOW','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x351943,_0x30d06b){var _0x15e6d6=function(_0x1b5918){while(--_0x1b5918){_0x351943['push'](_0x351943['shift']());}};_0x15e6d6(++_0x30d06b);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var Sequelize=require(_0x0baf('0x0'));module[_0x0baf('0x1')]={'firstName':{'type':Sequelize[_0x0baf('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x0baf('0x2')]},'street':{'type':Sequelize[_0x0baf('0x2')]},'postalCode':{'type':Sequelize[_0x0baf('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x0baf('0x2')]},'dateOfBirth':{'type':Sequelize[_0x0baf('0x2')]},'description':{'type':Sequelize[_0x0baf('0x3')]},'phone':{'type':Sequelize[_0x0baf('0x2')]},'mobile':{'type':Sequelize[_0x0baf('0x2')]},'fax':{'type':Sequelize[_0x0baf('0x2')]},'email':{'type':Sequelize[_0x0baf('0x2')]},'url':{'type':Sequelize[_0x0baf('0x2')]},'facebook':{'type':Sequelize[_0x0baf('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x0baf('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x0baf('0x2')]},'viber':{'type':Sequelize[_0x0baf('0x2')]},'line':{'type':Sequelize[_0x0baf('0x2')]},'wechat':{'type':Sequelize[_0x0baf('0x2')]},'telegram':{'type':Sequelize[_0x0baf('0x2')]},'UserId':{'type':Sequelize[_0x0baf('0x4')]},'priority':{'type':Sequelize[_0x0baf('0x4')](0x2)[_0x0baf('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x0baf('0x6')],'defaultValue':Sequelize[_0x0baf('0x7')]},'dialTimezone':{'type':Sequelize[_0x0baf('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index 90204f9..929c566 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf408=['WhatsappQueueReport','dialTimezone','timezones','utcOffset','bulkCreate','each','duplicates','$or','findOrCreate','spread','show','$and','omit','format','cf_%d','params','table','cm_contacts','id\x20=\x20?','toParam','phone','findOne','options','getTags','setTags','ids','getHoppers','CmHopper','ContactId','includeAll','getHopperHistories','rawAttributes','getHopperFinals','include','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','zipObject','firstName','No\x20firstName\x20column\x20specified','root','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','socket_timestamp','upload','createReadStream','file','path','meta','binding','No\x20phone\x20column\x20specified','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','stringify','message','start\x20child\x20process\x20correctly!','pid','exit','error\x20child\x20process','mail','sms','fax','whatsapp','voice','-createdAt','channel','toLowerCase','Invalid\x20channel','parse','range','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','destination','callerid','duration','note','createdAt','userDisposition','UserId','fullname','startCase','closed','disposition','Account','key','Owner','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','subject','substatus','externalUrl','threadId','findAndCountAll','all','flatten','sortBy','reverse','moment','bluebird','util','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','./cmContact.socket','status','json','limit','undefined','count','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','index','CmContact','describe','keys','length','startsWith','cf_','push','CmCustomField','trimStart','model','query','attributes','intersection','hasOwnProperty','nolimit','offset','sort','pick','filters','field','color','from','tools_tags','select','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','where','c.deletedAt\x20IS\x20NULL','expr','search','conditions','Tag','split','map','forEach','union','User','and','uc.UserId\x20=\x20?','value','dateOfBirth','fieldType','datetime','buildExpression','type','text','filter','isNil','Contact','ListId','c.ListId\x20IN\x20?','concat','\x20=\x20?','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','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.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','order','DESC','isEmpty','having','t.id\x20IN\x20?','resolve','user','some','getLists','c.ListId\x20IS\x20NULL','role','agent','sequelize','toString','keyBy','merge','fields','c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.email','c.ListId','c.createdAt','c.CompanyId','TagIds','Tags','rows','catch','find','tags','displayName','analytics','findAll','alias','custom','values','columnName','body','get','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappMessage'];(function(_0x1f7a11,_0x46c2bf){var _0x2d5f62=function(_0x125899){while(--_0x125899){_0x1f7a11['push'](_0x1f7a11['shift']());}};_0x2d5f62(++_0x46c2bf);}(_0xf408,0x199));var _0x8f40=function(_0x1de8cc,_0x3e3f90){_0x1de8cc=_0x1de8cc-0x0;var _0x6f59fa=_0xf408[_0x1de8cc];return _0x6f59fa;};'use strict';var moment=require(_0x8f40('0x0'));var BPromise=require(_0x8f40('0x1'));var util=require(_0x8f40('0x2'));var path=require('path');var fs=require('fs');var _=require(_0x8f40('0x3'));var squel=require(_0x8f40('0x4'));var Papa=require(_0x8f40('0x5'));var Redis=require(_0x8f40('0x6'));var qs=require(_0x8f40('0x7'));var as=require(_0x8f40('0x8'));var logger=require(_0x8f40('0x9'))(_0x8f40('0xa'));var config=require(_0x8f40('0xb'));var shared=require(_0x8f40('0xc'));var db=require(_0x8f40('0xd'))['db'];config[_0x8f40('0xe')]=_[_0x8f40('0xf')](config[_0x8f40('0xe')],{'host':_0x8f40('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8f40('0x11'))['register'](socket);function respondWithResult(_0x1cbb4e,_0x61e172){_0x61e172=_0x61e172||0xc8;return function(_0x4caf14){if(_0x4caf14){return _0x1cbb4e[_0x8f40('0x12')](_0x61e172)[_0x8f40('0x13')](_0x4caf14);}};}function respondWithFilteredResult(_0x36f90a,_0x5a3809){return function(_0x2c766b){if(_0x2c766b){var _0x25074b=typeof _0x5a3809['offset']==='undefined'&&typeof _0x5a3809[_0x8f40('0x14')]===_0x8f40('0x15');var _0x19c1ea=_0x2c766b[_0x8f40('0x16')];var _0x3066f6=_0x25074b?0x0:_0x5a3809['offset'];var _0x2c31e1=_0x25074b?_0x2c766b[_0x8f40('0x16')]:_0x5a3809['offset']+_0x5a3809[_0x8f40('0x14')];var _0x1030b1;if(_0x2c31e1>=_0x19c1ea){_0x2c31e1=_0x19c1ea;_0x1030b1=0xc8;}else{_0x1030b1=0xce;}_0x36f90a[_0x8f40('0x12')](_0x1030b1);return _0x36f90a[_0x8f40('0x17')](_0x8f40('0x18'),_0x3066f6+'-'+_0x2c31e1+'/'+_0x19c1ea)[_0x8f40('0x13')](_0x2c766b);}return null;};}function saveUpdates(_0x45a53c){return function(_0x402203){if(_0x402203){return _0x402203[_0x8f40('0x19')](_0x45a53c)[_0x8f40('0x1a')](function(_0x5c99b4){return _0x5c99b4;});}return null;};}function removeEntity(_0x3c59a9){return function(_0x41db64){if(_0x41db64){return _0x41db64[_0x8f40('0x1b')]()[_0x8f40('0x1a')](function(){_0x3c59a9[_0x8f40('0x12')](0xcc)[_0x8f40('0x1c')]();});}};}function handleEntityNotFound(_0x1ee716){return function(_0x5359f9){if(!_0x5359f9){_0x1ee716[_0x8f40('0x1d')](0x194);}return _0x5359f9;};}function handleError(_0x549e99,_0x37a1dd){_0x37a1dd=_0x37a1dd||0x1f4;return function(_0x4cb45e){logger[_0x8f40('0x1e')](_0x4cb45e[_0x8f40('0x1f')]);if(_0x4cb45e[_0x8f40('0x20')]){delete _0x4cb45e[_0x8f40('0x20')];}_0x549e99['status'](_0x37a1dd)[_0x8f40('0x21')](_0x4cb45e);};}exports[_0x8f40('0x22')]=function(_0x51b997,_0x4e410f){var _0xcf8839={},_0x5a479a={},_0x2f4191={'count':0x0,'rows':[]};return db[_0x8f40('0x23')][_0x8f40('0x24')]()[_0x8f40('0x1a')](function(_0x1efb2c){var _0x2f6e8f=[];for(var _0x19b997=0x0;_0x19b997<Object[_0x8f40('0x25')](_0x1efb2c)[_0x8f40('0x26')];_0x19b997++){var _0x24276a=Object['keys'](_0x1efb2c)[_0x19b997];if(_[_0x8f40('0x27')](_0x24276a,_0x8f40('0x28'))){_0x2f6e8f[_0x8f40('0x29')](db[_0x8f40('0x2a')]['findOne']({'where':{'id':_[_0x8f40('0x2b')](_0x24276a,_0x8f40('0x28'))},'raw':!![]}));}}return BPromise['all'](_0x2f6e8f)['then'](function(_0x39e8d2){for(var _0x4f1cdc=0x0;_0x4f1cdc<_0x39e8d2[_0x8f40('0x26')];_0x4f1cdc++){if(_0x39e8d2[_0x4f1cdc]){var _0x38cc07=_0x8f40('0x28')+_0x39e8d2[_0x4f1cdc]['id'];var _0x1b59b3=_0x1efb2c[_0x38cc07];_0x1b59b3['fieldType']=_0x39e8d2[_0x4f1cdc]['type'];}}return _0x1efb2c;});})[_0x8f40('0x1a')](function(_0x5d2502){_0x5a479a[_0x8f40('0x2c')]=_['keys'](_0x5d2502);_0x5a479a['query']=_[_0x8f40('0x25')](_0x51b997['query']);_0x5a479a['filters']=_['intersection'](_0x5a479a[_0x8f40('0x2c')],_0x5a479a[_0x8f40('0x2d')]);_0xcf8839[_0x8f40('0x2e')]=_[_0x8f40('0x2f')](_0x5a479a[_0x8f40('0x2c')],qs['fields'](_0x51b997[_0x8f40('0x2d')]['fields']));_0xcf8839[_0x8f40('0x2e')]=_0xcf8839['attributes']['length']?_0xcf8839[_0x8f40('0x2e')]:_0x5a479a['model'];if(!_0x51b997[_0x8f40('0x2d')][_0x8f40('0x30')](_0x8f40('0x31'))){_0xcf8839[_0x8f40('0x14')]=qs[_0x8f40('0x14')](_0x51b997[_0x8f40('0x2d')][_0x8f40('0x14')]);_0xcf8839[_0x8f40('0x32')]=qs[_0x8f40('0x32')](_0x51b997[_0x8f40('0x2d')][_0x8f40('0x32')]);}_0xcf8839['order']=qs[_0x8f40('0x33')](_0x51b997[_0x8f40('0x2d')][_0x8f40('0x33')]);_0xcf8839['where']=qs['filters'](_[_0x8f40('0x34')](_0x51b997[_0x8f40('0x2d')],_0x5a479a[_0x8f40('0x35')]),_0x5d2502);var _0x2d840f=[];var _0xf10c96=squel['select']()['field']('id')['field']('name')[_0x8f40('0x36')](_0x8f40('0x37'))[_0x8f40('0x38')](_0x8f40('0x39'));var _0x45568c=squel[_0x8f40('0x3a')]()[_0x8f40('0x38')]('cm_contacts','c')[_0x8f40('0x3b')](_0x8f40('0x3c'),'uc',_0x8f40('0x3d'))['left_join'](_0x8f40('0x3e'),'ct',_0x8f40('0x3f'))[_0x8f40('0x3b')](_0x8f40('0x39'),'t',_0x8f40('0x40'))[_0x8f40('0x41')](_0x8f40('0x42'));var _0x5b026d=squel[_0x8f40('0x43')]();var _0x4c862c=[];var _0x40b06c=squel['expr']();var _0x1e6b49;if(_0x51b997[_0x8f40('0x2d')][_0x8f40('0x44')]){_0x1e6b49=as['parseSearch'](_0x51b997['query']['search']);var _0x37b946=_0x1e6b49['sqlOperator'];for(var _0x1f05c1=0x0;_0x1f05c1<_0x1e6b49[_0x8f40('0x45')][_0x8f40('0x26')];_0x1f05c1++){var _0x587b15=_0x1e6b49['conditions'][_0x1f05c1];var _0x5d6d69='c';var _0x46ed62=_(_0x5d2502)[_0x8f40('0x25')]()['find'](function(_0x54073f){return _0x54073f===_0x587b15['field'];});if(_0x46ed62)_0x46ed62=_0x5d2502[_0x587b15[_0x8f40('0x36')]];if(!_0x46ed62){if(_0x587b15[_0x8f40('0x36')]===_0x8f40('0x46')){var _0x5c9cef=_0x587b15['value'][_0x8f40('0x47')](',')[_0x8f40('0x48')](function(_0x57ed02){return Number(_0x57ed02);});_0x5c9cef[_0x8f40('0x49')](function(_0x473077){_0x40b06c['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x473077+',%');});_0x4c862c=_[_0x8f40('0x4a')](_0x4c862c,_0x5c9cef);}else if(_0x587b15[_0x8f40('0x36')]===_0x8f40('0x4b')){_0x5b026d[_0x8f40('0x4c')](_0x8f40('0x4d'),_0x587b15[_0x8f40('0x4e')]);}}else{if(_0x587b15['field']===_0x8f40('0x4f')||_0x46ed62[_0x8f40('0x50')]===_0x8f40('0x51'))_0x587b15['castTo']='DATE';var _0x153e94=as[_0x8f40('0x52')](_0x5d6d69,_0x46ed62[_0x8f40('0x53')],_0x587b15);_0x5b026d[_0x37b946](_0x153e94[_0x8f40('0x54')],_0x153e94['value']['start'],_0x153e94[_0x8f40('0x4e')][_0x8f40('0x1c')]);}}}else{var _0x103058=_(Object[_0x8f40('0x25')](_0x51b997[_0x8f40('0x2d')]))['map'](function(_0x2afa56){return _0x5d2502[_0x8f40('0x30')](_0x2afa56)?_0x2afa56:undefined;})[_0x8f40('0x55')](function(_0x5d56c9){return!_[_0x8f40('0x56')](_0x5d56c9);})[_0x8f40('0x4e')]();if(_0x51b997[_0x8f40('0x2d')][_0x8f40('0x57')])_0x103058[_0x8f40('0x29')]('Contact');if(!_['isEmpty'](_0x103058)){_0x103058[_0x8f40('0x49')](function(_0x822135){if(_0x822135===_0x8f40('0x58')){_0x45568c[_0x8f40('0x41')](_0x8f40('0x59'),[][_0x8f40('0x5a')](_0x51b997['query'][_0x822135]));}else if(_0x822135===_0x8f40('0x57')){var _0x557e04='%'+_0x51b997['query'][_0x822135]+'%';_0x45568c[_0x8f40('0x41')]('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x557e04);}else{_0x45568c[_0x8f40('0x41')]('c.'+_0x822135+_0x8f40('0x5b'),_0x51b997[_0x8f40('0x2d')][_0x822135]);}});}if(_0x51b997[_0x8f40('0x2d')][_0x8f40('0x5c')]){_0x4c862c=_[_0x8f40('0x5d')](_0x51b997[_0x8f40('0x2d')][_0x8f40('0x5c')])?_0x51b997[_0x8f40('0x2d')][_0x8f40('0x5c')]:new Array(_0x51b997[_0x8f40('0x2d')][_0x8f40('0x5c')]);_0x4c862c[_0x8f40('0x49')](function(_0x3e388a){_0x40b06c['or'](_0x8f40('0x5e'),'%,'+_0x3e388a+',%');});}if(_0x51b997[_0x8f40('0x2d')][_0x8f40('0x55')]){var _0x1110cb=_0x51b997['query'][_0x8f40('0x55')][_0x8f40('0x5f')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x1110cb['split']('\x20')[_0x8f40('0x26')]>0x1){_0x5b026d['or'](_0x8f40('0x60'),qs[_0x8f40('0x61')](_0x1110cb),null);}else{if(qs[_0x8f40('0x62')](_0x1110cb)){_0x5b026d['or'](_0x8f40('0x63'),_0x1110cb+'%');_0x5b026d['or'](_0x8f40('0x64'),_0x1110cb+'%');_0x5b026d['or'](_0x8f40('0x65'),_0x1110cb+'%');_0x5b026d['or']('c.fax\x20LIKE\x20?',_0x1110cb+'%');}else if(qs[_0x8f40('0x66')](_0x1110cb)){_0x5b026d['or']('c.email\x20LIKE\x20?',_0x1110cb+'%');}else{_0x5b026d['or']('c.firstName\x20LIKE\x20?','%'+_0x1110cb+'%');_0x5b026d['or'](_0x8f40('0x67'),'%'+_0x1110cb+'%');_0x5b026d['or'](_0x8f40('0x68'),'%'+_0x1110cb+'%');}}}}_0x45568c['where'](_0x5b026d);_0x45568c[_0x8f40('0x69')](_0x8f40('0x6a'));var _0x1a75b9={'type':db[_0x8f40('0x6b')][_0x8f40('0x6c')][_0x8f40('0x6d')],'raw':!![]};var _0x151f61=_0x45568c[_0x8f40('0x6e')]()['field'](_0x8f40('0x6a'));if(_0xcf8839[_0x8f40('0x6f')]){_0xcf8839[_0x8f40('0x6f')][_0x8f40('0x49')](function(_0x51d0a3){_0x45568c[_0x8f40('0x6f')]('c.'+_0x51d0a3[0x0],_0x51d0a3[0x1]===_0x8f40('0x70')?![]:!![]);});}if(!_[_0x8f40('0x71')](_0x4c862c)){_0x45568c[_0x8f40('0x72')](_0x40b06c);_0x151f61[_0x8f40('0x41')](_0x8f40('0x73'),_0x4c862c);}BPromise[_0x8f40('0x74')]()[_0x8f40('0x1a')](function(){if(!_0x1e6b49)return;if(_0x51b997[_0x8f40('0x75')]['role']!=='agent')return;if(!_[_0x8f40('0x76')](_0x1e6b49[_0x8f40('0x45')],[_0x8f40('0x36'),_0x8f40('0x4b')])){return _0x51b997[_0x8f40('0x75')][_0x8f40('0x77')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1805b5){if(_['isEmpty'](_0x1805b5)){_0x151f61[_0x8f40('0x41')](_0x8f40('0x78'));_0x45568c[_0x8f40('0x41')](_0x8f40('0x78'));}else{_0x151f61[_0x8f40('0x41')](_0x8f40('0x59'),_['map'](_0x1805b5,'id'));_0x45568c[_0x8f40('0x41')](_0x8f40('0x59'),_['map'](_0x1805b5,'id'));}});}})[_0x8f40('0x1a')](function(){if(_0x51b997[_0x8f40('0x75')][_0x8f40('0x79')]===_0x8f40('0x7a')&&!_0x1e6b49&&!_0x51b997['query'][_0x8f40('0x58')])return[];return db[_0x8f40('0x7b')]['query'](_0x151f61[_0x8f40('0x7c')](),_0x1a75b9);})[_0x8f40('0x1a')](function(_0x3b01f6){_0x2f4191[_0x8f40('0x16')]=_0x3b01f6['length'];if(_0x2f4191[_0x8f40('0x16')]===0x0)return[];return db[_0x8f40('0x7b')]['query'](_0xf10c96[_0x8f40('0x7c')](),_0x1a75b9)[_0x8f40('0x1a')](function(_0x37479c){_0x2d840f=_[_0x8f40('0x7d')](_0x37479c,'id');_0x1a75b9=_[_0x8f40('0x7e')](_0x1a75b9,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x51b997[_0x8f40('0x2d')][_0x8f40('0x7f')]){_0xcf8839['attributes'][_0x8f40('0x49')](function(_0x57c237){_0x45568c[_0x8f40('0x36')]('c.'+_0x57c237);});}else{_0x45568c[_0x8f40('0x36')](_0x8f40('0x6a'));_0x45568c[_0x8f40('0x36')](_0x8f40('0x80'));_0x45568c[_0x8f40('0x36')](_0x8f40('0x81'));_0x45568c[_0x8f40('0x36')](_0x8f40('0x82'));_0x45568c[_0x8f40('0x36')](_0x8f40('0x83'));_0x45568c[_0x8f40('0x36')](_0x8f40('0x84'));_0x45568c['field'](_0x8f40('0x85'));_0x45568c[_0x8f40('0x36')](_0x8f40('0x86'));_0x45568c[_0x8f40('0x36')](_0x8f40('0x87'));_0x45568c[_0x8f40('0x36')]('c.deletedAt');_0x45568c['field'](_0x8f40('0x88'));_0x45568c['field']('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0xcf8839[_0x8f40('0x14')])_0x45568c[_0x8f40('0x14')](_0xcf8839[_0x8f40('0x14')]);if(_0xcf8839[_0x8f40('0x32')])_0x45568c[_0x8f40('0x32')](_0xcf8839[_0x8f40('0x32')]);return db[_0x8f40('0x7b')][_0x8f40('0x2d')](_0x45568c[_0x8f40('0x7c')](),_0x1a75b9);});})[_0x8f40('0x1a')](function(_0xa0bb53){_0xa0bb53[_0x8f40('0x49')](function(_0x5336cf){if(_0x5336cf[_0x8f40('0x89')]){_0x5336cf['Tags']=[];_0x5336cf['TagIds'][_0x8f40('0x47')](',')[_0x8f40('0x49')](function(_0x5352f7){_0x5336cf[_0x8f40('0x8a')][_0x8f40('0x29')](_0x2d840f[_0x5352f7]);});}delete _0x5336cf[_0x8f40('0x89')];});_0x2f4191[_0x8f40('0x8b')]=_0xa0bb53;return _0x2f4191;})[_0x8f40('0x1a')](respondWithFilteredResult(_0x4e410f,_0xcf8839));})[_0x8f40('0x8c')](handleError(_0x4e410f,null));};exports[_0x8f40('0x1b')]=function(_0x1da552,_0x4d687b){return db['CmContact'][_0x8f40('0x8d')]({'where':{'id':_0x1da552['params']['id']}})[_0x8f40('0x1a')](handleEntityNotFound(_0x4d687b,null))[_0x8f40('0x1a')](removeEntity(_0x4d687b,null))['catch'](handleError(_0x4d687b,null));};exports[_0x8f40('0x24')]=function(_0x51f084,_0x5804b4){return db[_0x8f40('0x23')][_0x8f40('0x24')]()['then'](function(_0x2c8573){delete _0x2c8573[_0x8f40('0x8e')];for(var _0x14b8ca=0x0;_0x14b8ca<Object[_0x8f40('0x25')](_0x2c8573)[_0x8f40('0x26')];_0x14b8ca++){var _0x4f33d3=Object['keys'](_0x2c8573)[_0x14b8ca];if(!_[_0x8f40('0x27')](_0x4f33d3,_0x8f40('0x28'))){_0x2c8573[_0x4f33d3]['columnName']=_0x4f33d3;_0x2c8573[_0x4f33d3][_0x8f40('0x8f')]=_0x4f33d3;}}return _0x2c8573;})['then'](function(_0x59e8c1){var _0x5e09ad={'where':Boolean(_0x51f084[_0x8f40('0x2d')][_0x8f40('0x90')])===!![]?undefined:{'$or':[{'ListId':_0x51f084[_0x8f40('0x2d')]['id']},{'ListId':null}]},'raw':!![]};return db[_0x8f40('0x2a')][_0x8f40('0x91')](_0x5e09ad)[_0x8f40('0x1a')](function(_0x1023a4){for(var _0x1d50e8=0x0;_0x1d50e8<_0x1023a4[_0x8f40('0x26')];_0x1d50e8++){var _0x3d6d48=_0x8f40('0x28')+_0x1023a4[_0x1d50e8]['id'];_0x59e8c1[_0x3d6d48]['columnName']=_0x3d6d48;_0x59e8c1[_0x3d6d48][_0x8f40('0x8f')]=_0x1023a4[_0x1d50e8][_0x8f40('0x92')];_0x59e8c1[_0x3d6d48][_0x8f40('0x93')]={'type':_0x1023a4[_0x1d50e8]['type'],'values':_0x1023a4[_0x1d50e8][_0x8f40('0x94')]};}Object[_0x8f40('0x25')](_0x59e8c1)['forEach'](function(_0x5a64b9){if(!_0x59e8c1[_0x5a64b9][_0x8f40('0x30')](_0x8f40('0x95'))){delete _0x59e8c1[_0x5a64b9];}});return _0x59e8c1;});})[_0x8f40('0x1a')](respondWithResult(_0x5804b4,null))[_0x8f40('0x8c')](handleError(_0x5804b4,null));};exports['merge']=function(_0x2a19fc,_0x1fcf4e){var _0x3aa90d;var _0x255150;var _0x5c7d30;if(_0x2a19fc[_0x8f40('0x96')]['id']){delete _0x2a19fc[_0x8f40('0x96')]['id'];}return db[_0x8f40('0x23')][_0x8f40('0x91')]({'where':{'id':[_0x2a19fc[_0x8f40('0x96')]['to'],_0x2a19fc[_0x8f40('0x96')][_0x8f40('0x38')]]}})[_0x8f40('0x1a')](function(_0x80132b){if(_0x80132b){if(_0x80132b[_0x8f40('0x26')]!==0x2){return null;}_0x80132b[0x0]=_0x80132b[0x0]['get']({'plain':!![]});_0x80132b[0x1]=_0x80132b[0x1][_0x8f40('0x97')]({'plain':!![]});delete _0x80132b[0x0]['id'];delete _0x80132b[0x1]['id'];return _['mergeWith'](_0x80132b[0x0],_0x80132b[0x1],function(_0xf1f56d,_0x5c939a){if(Array[_0x8f40('0x5d')](_0x5c939a)&&!_0x5c939a[_0x8f40('0x26')]){return _0xf1f56d;}else if(!_0x5c939a){return _0xf1f56d;}});}})[_0x8f40('0x1a')](handleEntityNotFound(_0x1fcf4e,null))[_0x8f40('0x1a')](function(_0x4ae122){if(_0x4ae122){if(_0x4ae122[_0x8f40('0x8e')]&&_[_0x8f40('0x5d')](_0x4ae122[_0x8f40('0x8e')])){_0x4ae122[_0x8f40('0x8e')]=_0x4ae122[_0x8f40('0x8e')][_0x8f40('0x98')]();}logger[_0x8f40('0x99')](_0x8f40('0x9a'),_0x2a19fc[_0x8f40('0x96')]['to'],_0x2a19fc['body']['from']);return db['CmHopper']['destroy']({'where':{'ContactId':[_0x2a19fc['body']['to'],_0x2a19fc[_0x8f40('0x96')][_0x8f40('0x38')]]}})[_0x8f40('0x1a')](function(_0x3bdf4c){logger[_0x8f40('0x99')](_0x8f40('0x9b'),_0x3bdf4c);return db[_0x8f40('0x9c')][_0x8f40('0x1b')]({'where':{'ContactId':[_0x2a19fc[_0x8f40('0x96')]['to'],_0x2a19fc[_0x8f40('0x96')][_0x8f40('0x38')]]}})[_0x8f40('0x1a')](function(_0x5651e9){logger[_0x8f40('0x99')](_0x8f40('0x9d'),_0x5651e9);return db[_0x8f40('0x23')][_0x8f40('0x9e')](_0x4ae122);});});}})[_0x8f40('0x1a')](function(_0x3d6711){if(_0x3d6711){_0x3aa90d=_0x3d6711;_0x255150={'ContactId':_0x3aa90d['id']};_0x5c7d30={'where':{'ContactId':[_0x2a19fc['body']['to'],_0x2a19fc['body'][_0x8f40('0x38')]]}};return db[_0x8f40('0x9f')]['update'](_0x255150,_0x5c7d30);}})[_0x8f40('0x1a')](function(){if(_0x3aa90d){return db[_0x8f40('0xa0')][_0x8f40('0x19')](_0x255150,_0x5c7d30);}})[_0x8f40('0x1a')](function(){if(_0x3aa90d){return db[_0x8f40('0xa1')]['update'](_0x255150,_0x5c7d30);}})[_0x8f40('0x1a')](function(){if(_0x3aa90d){return db[_0x8f40('0xa2')][_0x8f40('0x19')](_0x255150,_0x5c7d30);}})[_0x8f40('0x1a')](function(){if(_0x3aa90d){return db[_0x8f40('0xa3')]['update'](_0x255150,_0x5c7d30);}})[_0x8f40('0x1a')](function(){if(_0x3aa90d){return db[_0x8f40('0xa2')][_0x8f40('0x19')](_0x255150,_0x5c7d30);}})[_0x8f40('0x1a')](function(){if(_0x3aa90d){return db[_0x8f40('0xa3')][_0x8f40('0x19')](_0x255150,_0x5c7d30);}})['then'](function(){if(_0x3aa90d){return db[_0x8f40('0xa4')]['update'](_0x255150,_0x5c7d30);}})['then'](function(){if(_0x3aa90d){return db[_0x8f40('0xa5')][_0x8f40('0x19')](_0x255150,_0x5c7d30);}})[_0x8f40('0x1a')](function(){if(_0x3aa90d){return db[_0x8f40('0xa6')][_0x8f40('0x19')](_0x255150,_0x5c7d30);}})['then'](function(){if(_0x3aa90d){return db[_0x8f40('0xa7')][_0x8f40('0x19')](_0x255150,_0x5c7d30);}})['then'](function(){if(_0x3aa90d){return db[_0x8f40('0xa8')][_0x8f40('0x19')](_0x255150,_0x5c7d30);}})[_0x8f40('0x1a')](function(){if(_0x3aa90d){return db[_0x8f40('0xa9')][_0x8f40('0x19')](_0x255150,_0x5c7d30);}})[_0x8f40('0x1a')](function(){if(_0x3aa90d){return db[_0x8f40('0xaa')][_0x8f40('0x19')](_0x255150,_0x5c7d30);}})[_0x8f40('0x1a')](function(){if(_0x3aa90d){return db[_0x8f40('0xab')][_0x8f40('0x19')](_0x255150,_0x5c7d30);}})['then'](function(){if(_0x3aa90d){return db['ReportAgentPreview'][_0x8f40('0x19')](_0x255150,_0x5c7d30);}})[_0x8f40('0x1a')](function(){if(_0x3aa90d){return db[_0x8f40('0xac')][_0x8f40('0x19')](_0x255150,_0x5c7d30);}})['then'](function(){if(_0x3aa90d){return db[_0x8f40('0xad')][_0x8f40('0x19')](_0x255150,_0x5c7d30);}})[_0x8f40('0x1a')](function(){if(_0x3aa90d){return db[_0x8f40('0xae')]['update'](_0x255150,_0x5c7d30);}})['then'](function(){if(_0x3aa90d){return db[_0x8f40('0xaf')][_0x8f40('0x19')](_0x255150,_0x5c7d30);}})[_0x8f40('0x1a')](function(){if(_0x3aa90d){return db[_0x8f40('0xb0')][_0x8f40('0x19')](_0x255150,_0x5c7d30);}})[_0x8f40('0x1a')](function(){if(_0x3aa90d){return db[_0x8f40('0xb1')][_0x8f40('0x19')](_0x255150,_0x5c7d30);}})[_0x8f40('0x1a')](function(){if(_0x3aa90d){return db['JscriptySessionReport'][_0x8f40('0x19')](_0x255150,_0x5c7d30);}})[_0x8f40('0x1a')](function(){if(_0x3aa90d){return db['WhatsappInteraction'][_0x8f40('0x19')](_0x255150,_0x5c7d30);}})[_0x8f40('0x1a')](function(){if(_0x3aa90d){return db[_0x8f40('0xb2')][_0x8f40('0x19')](_0x255150,_0x5c7d30);}})[_0x8f40('0x1a')](function(){if(_0x3aa90d){return db[_0x8f40('0xb3')][_0x8f40('0x19')](_0x255150,_0x5c7d30);}})[_0x8f40('0x1a')](function(){if(_0x3aa90d){return db['CmContact'][_0x8f40('0x1b')]({'where':{'id':[_0x2a19fc['body']['to'],_0x2a19fc[_0x8f40('0x96')][_0x8f40('0x38')]]}});}})['then'](function(){if(_0x3aa90d){return _0x3aa90d;}})['then'](respondWithResult(_0x1fcf4e,null))[_0x8f40('0x8c')](handleError(_0x1fcf4e,null));};exports[_0x8f40('0x9e')]=function(_0x2c77df,_0xa0541d){return db[_0x8f40('0x23')][_0x8f40('0x24')]()[_0x8f40('0x1a')](function(_0x31a630){if(_0x2c77df[_0x8f40('0x96')][_0x8f40('0x8e')]&&_['isArray'](_0x2c77df[_0x8f40('0x96')]['tags'])){if(_0x2c77df[_0x8f40('0x96')][_0x8f40('0x8e')][_0x8f40('0x26')]){_0x2c77df[_0x8f40('0x96')][_0x8f40('0x8e')]=_0x2c77df[_0x8f40('0x96')][_0x8f40('0x8e')][_0x8f40('0x98')](';')+';';}else{_0x2c77df[_0x8f40('0x96')]['tags']=null;}}else{_0x2c77df[_0x8f40('0x96')][_0x8f40('0x8e')]=null;}if(!_[_0x8f40('0x56')](_0x2c77df[_0x8f40('0x96')][_0x8f40('0xb4')])){var _0x2e3243=_0x2c77df[_0x8f40('0x96')][_0x8f40('0xb4')];if(!_[_0x8f40('0x56')](shared[_0x8f40('0xb5')][_0x2e3243]))_0x2c77df['body'][_0x8f40('0xb6')]=shared[_0x8f40('0xb5')][_0x2e3243][_0x8f40('0xb6')];}return db['CmContact']['create'](_0x2c77df[_0x8f40('0x96')],{'fields':_['keys'](_0x31a630),'raw':!![]});})[_0x8f40('0x1a')](respondWithResult(_0xa0541d,0xc9))['catch'](handleError(_0xa0541d,null));};exports[_0x8f40('0xb7')]=function(_0xd50122,_0x32abe4){var _0x267e97=0x0;var _0x21c0bc=0x0;var _0x387e0a=0x0;return db[_0x8f40('0x23')][_0x8f40('0x24')]()['then'](function(_0x2ff0a3){return BPromise[_0x8f40('0xb8')](_0xd50122[_0x8f40('0x96')],function(_0x207c93){var _0x568aea={'where':{'$or':[]},'defaults':_0x207c93,'fields':_['keys'](_0x2ff0a3),'raw':!![]};if(_0x207c93['duplicates']){for(var _0x4bde8f=0x0;_0x4bde8f<_0x207c93[_0x8f40('0xb9')][_0x8f40('0x26')];_0x4bde8f++){var _0x59f79d={};_0x59f79d[_0x207c93[_0x8f40('0xb9')][_0x4bde8f]]=_0x207c93[_0x207c93[_0x8f40('0xb9')][_0x4bde8f]];_0x568aea[_0x8f40('0x41')][_0x8f40('0xba')][_0x8f40('0x29')](_0x59f79d);}_0x568aea[_0x8f40('0x41')]['ListId']=_0x207c93[_0x8f40('0x58')];}return db[_0x8f40('0x23')][_0x8f40('0xbb')](_0x568aea)[_0x8f40('0xbc')](function(_0x4e3c96,_0x3d4963){if(_0x3d4963){_0x267e97++;}else{_0x387e0a++;}})['catch'](function(){_0x21c0bc++;});});})['then'](function(_0xa8c55c){if(_0xa8c55c){return{'success':_0x267e97,'failure':_0x21c0bc,'duplicates':_0x387e0a};}})['then'](respondWithResult(_0x32abe4,0xc9))[_0x8f40('0x8c')](handleError(_0x32abe4,null));};exports[_0x8f40('0xbd')]=function(_0x48ccf3,_0x5da336){var _0x48f799;return db[_0x8f40('0x23')]['describe']()[_0x8f40('0x1a')](function(_0x2a30a6){return db[_0x8f40('0x23')][_0x8f40('0x8d')]({'where':{'id':_0x48ccf3['params']['id']},'include':[{'model':db['Tag'],'as':'Tags','attributes':['id',_0x8f40('0x20'),_0x8f40('0x37')],'required':_0x48ccf3[_0x8f40('0x2d')][_0x8f40('0x5c')]?!![]:![]}],'attributes':_['keys'](_0x2a30a6)});})[_0x8f40('0x1a')](function(_0x53f444){if(!_[_0x8f40('0x56')](_0x53f444)){_0x48f799=_0x53f444[_0x8f40('0x97')]({'plain':!![]});var _0x54def4={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x53f444&&_0x53f444[_0x8f40('0x58')]){if(_0x53f444['ListId']){_0x54def4[_0x8f40('0x41')][_0x8f40('0xbe')][_0x8f40('0x29')]({'ListId':{'$ne':_0x53f444[_0x8f40('0x58')]}});}}return db['CmCustomField']['findAll'](_0x54def4);}})[_0x8f40('0x1a')](function(_0x2597b4){if(!_[_0x8f40('0x56')](_0x2597b4)){return _[_0x8f40('0xbf')](_0x48f799,_[_0x8f40('0x48')](_0x2597b4,function(_0x2a1e91){return util[_0x8f40('0xc0')](_0x8f40('0xc1'),_0x2a1e91['id']);}));}})[_0x8f40('0x1a')](handleEntityNotFound(_0x5da336,null))['then'](respondWithResult(_0x5da336,null))[_0x8f40('0x8c')](handleError(_0x5da336,null));};exports[_0x8f40('0x19')]=function(_0x3318c1,_0x4391a9){var _0x2e2319;if(_0x3318c1[_0x8f40('0x96')]['id']){delete _0x3318c1[_0x8f40('0x96')]['id'];}if(!_[_0x8f40('0x56')](_0x3318c1[_0x8f40('0x96')][_0x8f40('0xb4')])){var _0x4c9544=_0x3318c1[_0x8f40('0x96')]['dialTimezone'];if(!_[_0x8f40('0x56')](shared[_0x8f40('0xb5')][_0x4c9544]))_0x3318c1[_0x8f40('0x96')]['utcOffset']=shared['timezones'][_0x4c9544][_0x8f40('0xb6')];}return db[_0x8f40('0x23')][_0x8f40('0x8d')]({'where':{'id':_0x3318c1[_0x8f40('0xc2')]['id']}})[_0x8f40('0x1a')](handleEntityNotFound(_0x4391a9,null))[_0x8f40('0x1a')](saveUpdates(_0x3318c1[_0x8f40('0x96')],null))[_0x8f40('0x1a')](function(_0x42d669){_0x2e2319=_0x42d669;var _0x2a8445={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x42d669&&_0x42d669[_0x8f40('0x58')]){if(_0x42d669[_0x8f40('0x58')]){_0x2a8445['where'][_0x8f40('0xbe')][_0x8f40('0x29')]({'ListId':{'$ne':_0x42d669['ListId']}});}}return db['CmCustomField'][_0x8f40('0x91')](_0x2a8445);})['then'](function(_0x4bc88c){if(_0x4bc88c){return _['omit'](_['pickBy'](_0x3318c1[_0x8f40('0x96')],function(_0x14a7f4,_0x2bb506){return _[_0x8f40('0x27')](_0x2bb506,_0x8f40('0x28'));}),_['map'](_0x4bc88c,function(_0x5cac68){return util[_0x8f40('0xc0')]('cf_%d',_0x5cac68['id']);}));}})[_0x8f40('0x1a')](function(_0x403b6d){if(_0x403b6d&&!_[_0x8f40('0x71')](_0x403b6d)){var _0x564b37=squel['update']()[_0x8f40('0xc3')](_0x8f40('0xc4'))['setFields'](_0x403b6d)[_0x8f40('0x41')](_0x8f40('0xc5'),_0x3318c1[_0x8f40('0xc2')]['id'])[_0x8f40('0xc6')]();return db[_0x8f40('0x7b')][_0x8f40('0x2d')](_0x564b37['text'],{'replacements':_0x564b37[_0x8f40('0x94')]});}})[_0x8f40('0x1a')](function(){if(_0x3318c1[_0x8f40('0x96')]['phone']&&_0x2e2319){return db['CmHopper'][_0x8f40('0x19')]({'phone':_0x3318c1[_0x8f40('0x96')][_0x8f40('0xc7')]},{'where':{'ContactId':_0x2e2319['id']}});}})[_0x8f40('0x1a')](function(){return _0x2e2319;})[_0x8f40('0x1a')](respondWithResult(_0x4391a9,null))['catch'](handleError(_0x4391a9,null));};exports['getTags']=function(_0x20a340,_0x3a2cc1){var _0x14f8e1={};var _0x62e6c6={};var _0x3014db;var _0x3ff794;return db[_0x8f40('0x23')][_0x8f40('0xc8')]({'where':{'id':_0x20a340[_0x8f40('0xc2')]['id']}})[_0x8f40('0x1a')](handleEntityNotFound(_0x3a2cc1,null))[_0x8f40('0x1a')](function(_0x59c610){if(_0x59c610){_0x3014db=_0x59c610;_0x62e6c6['model']=_['keys'](db['Tag']['rawAttributes']);_0x62e6c6[_0x8f40('0x2d')]=_['keys'](_0x20a340[_0x8f40('0x2d')]);_0x62e6c6[_0x8f40('0x35')]=_['intersection'](_0x62e6c6[_0x8f40('0x2c')],_0x62e6c6[_0x8f40('0x2d')]);_0x14f8e1[_0x8f40('0x2e')]=_['intersection'](_0x62e6c6['model'],qs[_0x8f40('0x7f')](_0x20a340[_0x8f40('0x2d')][_0x8f40('0x7f')]));_0x14f8e1['attributes']=_0x14f8e1[_0x8f40('0x2e')][_0x8f40('0x26')]?_0x14f8e1[_0x8f40('0x2e')]:_0x62e6c6['model'];_0x14f8e1[_0x8f40('0x6f')]=qs[_0x8f40('0x33')](_0x20a340['query'][_0x8f40('0x33')]);_0x14f8e1['where']=qs[_0x8f40('0x35')](_[_0x8f40('0x34')](_0x20a340[_0x8f40('0x2d')],_0x62e6c6['filters']));if(_0x20a340[_0x8f40('0x2d')][_0x8f40('0x55')]){_0x14f8e1[_0x8f40('0x41')]=_[_0x8f40('0x7e')](_0x14f8e1[_0x8f40('0x41')],{'$or':_[_0x8f40('0x48')](_0x14f8e1[_0x8f40('0x2e')],function(_0x2cff4f){var _0x269bc6={};_0x269bc6[_0x2cff4f]={'$like':'%'+_0x20a340[_0x8f40('0x2d')][_0x8f40('0x55')]+'%'};return _0x269bc6;})});}_0x14f8e1=_[_0x8f40('0x7e')]({},_0x14f8e1,_0x20a340[_0x8f40('0xc9')]);return _0x3014db[_0x8f40('0xca')](_0x14f8e1);}})[_0x8f40('0x1a')](function(_0x30a620){if(_0x30a620){_0x3ff794=_0x30a620['length'];if(!_0x20a340[_0x8f40('0x2d')][_0x8f40('0x30')](_0x8f40('0x31'))){_0x14f8e1[_0x8f40('0x14')]=qs[_0x8f40('0x14')](_0x20a340[_0x8f40('0x2d')][_0x8f40('0x14')]);_0x14f8e1[_0x8f40('0x32')]=qs['offset'](_0x20a340[_0x8f40('0x2d')][_0x8f40('0x32')]);}return _0x3014db[_0x8f40('0xca')](_0x14f8e1);}})[_0x8f40('0x1a')](function(_0x3833c2){if(_0x3833c2){return _0x3833c2?{'count':_0x3ff794,'rows':_0x3833c2}:null;}})[_0x8f40('0x1a')](respondWithResult(_0x3a2cc1,null))[_0x8f40('0x8c')](handleError(_0x3a2cc1,null));};exports['setTags']=function(_0x386bff,_0x56846a){if(_0x386bff[_0x8f40('0x96')]['id']){delete _0x386bff['body']['id'];}return db[_0x8f40('0x23')]['findOne']({'where':{'id':_0x386bff['params']['id']}})[_0x8f40('0x1a')](handleEntityNotFound(_0x56846a,null))[_0x8f40('0x1a')](function(_0x27554d){if(_0x27554d){return _0x27554d[_0x8f40('0xcb')](_0x386bff[_0x8f40('0x96')][_0x8f40('0xcc')]||[]);}return null;})['then'](respondWithResult(_0x56846a,null))[_0x8f40('0x8c')](handleError(_0x56846a,null));};exports[_0x8f40('0xcd')]=function(_0x2afb89,_0x15e9df){var _0x445f72={'raw':![],'where':{}};var _0x17ef65={};var _0x26a6d7={'count':0x0,'rows':[]};return db[_0x8f40('0x23')]['findOne']({'where':{'id':_0x2afb89[_0x8f40('0xc2')]['id']}})[_0x8f40('0x1a')](handleEntityNotFound(_0x15e9df,null))[_0x8f40('0x1a')](function(_0x227b8b){if(_0x227b8b){_0x17ef65[_0x8f40('0x2c')]=_[_0x8f40('0x25')](db[_0x8f40('0xce')]['rawAttributes']);_0x17ef65['query']=_[_0x8f40('0x25')](_0x2afb89[_0x8f40('0x2d')]);_0x17ef65['filters']=_[_0x8f40('0x2f')](_0x17ef65[_0x8f40('0x2c')],_0x17ef65[_0x8f40('0x2d')]);_0x445f72[_0x8f40('0x2e')]=_[_0x8f40('0x2f')](_0x17ef65[_0x8f40('0x2c')],qs[_0x8f40('0x7f')](_0x2afb89[_0x8f40('0x2d')][_0x8f40('0x7f')]));_0x445f72[_0x8f40('0x2e')]=_0x445f72[_0x8f40('0x2e')][_0x8f40('0x26')]?_0x445f72[_0x8f40('0x2e')]:_0x17ef65[_0x8f40('0x2c')];if(!_0x2afb89['query'][_0x8f40('0x30')](_0x8f40('0x31'))){_0x445f72[_0x8f40('0x14')]=qs['limit'](_0x2afb89['query']['limit']);_0x445f72[_0x8f40('0x32')]=qs['offset'](_0x2afb89[_0x8f40('0x2d')][_0x8f40('0x32')]);}_0x445f72['order']=qs[_0x8f40('0x33')](_0x2afb89[_0x8f40('0x2d')]['sort']);_0x445f72['where']=qs['filters'](_[_0x8f40('0x34')](_0x2afb89[_0x8f40('0x2d')],_0x17ef65[_0x8f40('0x35')]));_0x445f72[_0x8f40('0x41')][_0x8f40('0xcf')]=_0x227b8b['id'];if(_0x2afb89[_0x8f40('0x2d')][_0x8f40('0x55')]){_0x445f72['where']=_[_0x8f40('0x7e')](_0x445f72[_0x8f40('0x41')],{'$or':_[_0x8f40('0x48')](_0x445f72[_0x8f40('0x2e')],function(_0x1f949a){var _0x316be7={};_0x316be7[_0x1f949a]={'$like':'%'+_0x2afb89[_0x8f40('0x2d')][_0x8f40('0x55')]+'%'};return _0x316be7;})});}_0x445f72=_[_0x8f40('0x7e')]({},_0x445f72,_0x2afb89[_0x8f40('0xc9')]);return db[_0x8f40('0xce')][_0x8f40('0x16')]({'where':_0x445f72[_0x8f40('0x41')]})[_0x8f40('0x1a')](function(_0x15b686){_0x26a6d7['count']=_0x15b686;if(_0x2afb89[_0x8f40('0x2d')][_0x8f40('0xd0')]){_0x445f72['include']=[{'all':!![]}];}return db['CmHopper'][_0x8f40('0x91')](_0x445f72);})[_0x8f40('0x1a')](function(_0xd042dc){_0x26a6d7['rows']=_0xd042dc;return _0x26a6d7;});}})[_0x8f40('0x1a')](respondWithFilteredResult(_0x15e9df,_0x445f72))[_0x8f40('0x8c')](handleError(_0x15e9df,null));};exports[_0x8f40('0xd1')]=function(_0xf18472,_0x3ccfb9){var _0x972a34={'raw':!![],'where':{}};var _0x9f989a={};var _0x42d571={'count':0x0,'rows':[]};return db[_0x8f40('0x23')][_0x8f40('0xc8')]({'where':{'id':_0xf18472[_0x8f40('0xc2')]['id']}})[_0x8f40('0x1a')](handleEntityNotFound(_0x3ccfb9,null))[_0x8f40('0x1a')](function(_0x142318){if(_0x142318){_0x9f989a['model']=_[_0x8f40('0x25')](db['CmHopperHistory'][_0x8f40('0xd2')]);_0x9f989a[_0x8f40('0x2d')]=_[_0x8f40('0x25')](_0xf18472[_0x8f40('0x2d')]);_0x9f989a[_0x8f40('0x35')]=_[_0x8f40('0x2f')](_0x9f989a['model'],_0x9f989a['query']);_0x972a34[_0x8f40('0x2e')]=_[_0x8f40('0x2f')](_0x9f989a[_0x8f40('0x2c')],qs[_0x8f40('0x7f')](_0xf18472[_0x8f40('0x2d')][_0x8f40('0x7f')]));_0x972a34[_0x8f40('0x2e')]=_0x972a34[_0x8f40('0x2e')][_0x8f40('0x26')]?_0x972a34[_0x8f40('0x2e')]:_0x9f989a[_0x8f40('0x2c')];if(!_0xf18472[_0x8f40('0x2d')]['hasOwnProperty'](_0x8f40('0x31'))){_0x972a34['limit']=qs[_0x8f40('0x14')](_0xf18472['query']['limit']);_0x972a34['offset']=qs[_0x8f40('0x32')](_0xf18472['query'][_0x8f40('0x32')]);}_0x972a34[_0x8f40('0x6f')]=qs[_0x8f40('0x33')](_0xf18472['query']['sort']);_0x972a34['where']=qs[_0x8f40('0x35')](_[_0x8f40('0x34')](_0xf18472['query'],_0x9f989a[_0x8f40('0x35')]));_0x972a34['where'][_0x8f40('0xcf')]=_0x142318['id'];if(_0xf18472[_0x8f40('0x2d')][_0x8f40('0x55')]){_0x972a34[_0x8f40('0x41')]=_[_0x8f40('0x7e')](_0x972a34['where'],{'$or':_['map'](_0x972a34[_0x8f40('0x2e')],function(_0x2adbd8){var _0x139e2d={};_0x139e2d[_0x2adbd8]={'$like':'%'+_0xf18472[_0x8f40('0x2d')]['filter']+'%'};return _0x139e2d;})});}_0x972a34=_['merge']({},_0x972a34,_0xf18472[_0x8f40('0xc9')]);return db[_0x8f40('0xab')]['count']({'where':_0x972a34['where']})[_0x8f40('0x1a')](function(_0x498df0){_0x42d571[_0x8f40('0x16')]=_0x498df0;if(_0xf18472[_0x8f40('0x2d')][_0x8f40('0xd0')]){_0x972a34['include']=[{'all':!![]}];}return db[_0x8f40('0xab')][_0x8f40('0x91')](_0x972a34);})[_0x8f40('0x1a')](function(_0x21f727){_0x42d571['rows']=_0x21f727;return _0x42d571;});}})[_0x8f40('0x1a')](respondWithFilteredResult(_0x3ccfb9,_0x972a34))[_0x8f40('0x8c')](handleError(_0x3ccfb9,null));};exports[_0x8f40('0xd3')]=function(_0x362466,_0x3b11e8){var _0x3abbd1={'raw':!![],'where':{}};var _0x3c5393={};var _0x2b26cd={'count':0x0,'rows':[]};return db[_0x8f40('0x23')][_0x8f40('0xc8')]({'where':{'id':_0x362466[_0x8f40('0xc2')]['id']}})[_0x8f40('0x1a')](handleEntityNotFound(_0x3b11e8,null))['then'](function(_0x13bacd){if(_0x13bacd){_0x3c5393[_0x8f40('0x2c')]=_[_0x8f40('0x25')](db[_0x8f40('0xaa')][_0x8f40('0xd2')]);_0x3c5393['query']=_['keys'](_0x362466['query']);_0x3c5393[_0x8f40('0x35')]=_[_0x8f40('0x2f')](_0x3c5393[_0x8f40('0x2c')],_0x3c5393[_0x8f40('0x2d')]);_0x3abbd1[_0x8f40('0x2e')]=_[_0x8f40('0x2f')](_0x3c5393[_0x8f40('0x2c')],qs['fields'](_0x362466['query'][_0x8f40('0x7f')]));_0x3abbd1['attributes']=_0x3abbd1[_0x8f40('0x2e')][_0x8f40('0x26')]?_0x3abbd1['attributes']:_0x3c5393[_0x8f40('0x2c')];if(!_0x362466[_0x8f40('0x2d')][_0x8f40('0x30')](_0x8f40('0x31'))){_0x3abbd1[_0x8f40('0x14')]=qs[_0x8f40('0x14')](_0x362466[_0x8f40('0x2d')][_0x8f40('0x14')]);_0x3abbd1[_0x8f40('0x32')]=qs[_0x8f40('0x32')](_0x362466[_0x8f40('0x2d')][_0x8f40('0x32')]);}_0x3abbd1[_0x8f40('0x6f')]=qs[_0x8f40('0x33')](_0x362466[_0x8f40('0x2d')][_0x8f40('0x33')]);_0x3abbd1[_0x8f40('0x41')]=qs['filters'](_[_0x8f40('0x34')](_0x362466[_0x8f40('0x2d')],_0x3c5393[_0x8f40('0x35')]));_0x3abbd1[_0x8f40('0x41')]['ContactId']=_0x13bacd['id'];if(_0x362466[_0x8f40('0x2d')]['filter']){_0x3abbd1[_0x8f40('0x41')]=_[_0x8f40('0x7e')](_0x3abbd1[_0x8f40('0x41')],{'$or':_[_0x8f40('0x48')](_0x3abbd1[_0x8f40('0x2e')],function(_0xb55942){var _0x497c0e={};_0x497c0e[_0xb55942]={'$like':'%'+_0x362466['query'][_0x8f40('0x55')]+'%'};return _0x497c0e;})});}_0x3abbd1=_[_0x8f40('0x7e')]({},_0x3abbd1,_0x362466[_0x8f40('0xc9')]);return db[_0x8f40('0xaa')]['count']({'where':_0x3abbd1[_0x8f40('0x41')]})[_0x8f40('0x1a')](function(_0x387464){_0x2b26cd[_0x8f40('0x16')]=_0x387464;if(_0x362466[_0x8f40('0x2d')][_0x8f40('0xd0')]){_0x3abbd1[_0x8f40('0xd4')]=[{'all':!![]}];}return db[_0x8f40('0xaa')]['findAll'](_0x3abbd1);})[_0x8f40('0x1a')](function(_0x3dc89e){_0x2b26cd[_0x8f40('0x8b')]=_0x3dc89e;return _0x2b26cd;});}})[_0x8f40('0x1a')](respondWithFilteredResult(_0x3b11e8,_0x3abbd1))[_0x8f40('0x8c')](handleError(_0x3b11e8,null));};exports[_0x8f40('0xd5')]=function(_0x56452f,_0x1ff51d){var _0x3fce12={'raw':!![],'where':{}};var _0x42a5e2={};var _0x46b1fc={'count':0x0,'rows':[]};return db[_0x8f40('0x23')][_0x8f40('0xc8')]({'where':{'id':_0x56452f[_0x8f40('0xc2')]['id']}})['then'](handleEntityNotFound(_0x1ff51d,null))[_0x8f40('0x1a')](function(_0x5e001d){if(_0x5e001d){_0x42a5e2[_0x8f40('0x2c')]=_['keys'](db[_0x8f40('0xd6')][_0x8f40('0xd2')]);_0x42a5e2[_0x8f40('0x2d')]=_[_0x8f40('0x25')](_0x56452f[_0x8f40('0x2d')]);_0x42a5e2['filters']=_[_0x8f40('0x2f')](_0x42a5e2[_0x8f40('0x2c')],_0x42a5e2[_0x8f40('0x2d')]);_0x3fce12['attributes']=_[_0x8f40('0x2f')](_0x42a5e2[_0x8f40('0x2c')],qs[_0x8f40('0x7f')](_0x56452f[_0x8f40('0x2d')]['fields']));_0x3fce12[_0x8f40('0x2e')]=_0x3fce12[_0x8f40('0x2e')][_0x8f40('0x26')]?_0x3fce12[_0x8f40('0x2e')]:_0x42a5e2[_0x8f40('0x2c')];if(!_0x56452f['query'][_0x8f40('0x30')](_0x8f40('0x31'))){_0x3fce12[_0x8f40('0x14')]=qs[_0x8f40('0x14')](_0x56452f[_0x8f40('0x2d')][_0x8f40('0x14')]);_0x3fce12[_0x8f40('0x32')]=qs['offset'](_0x56452f['query'][_0x8f40('0x32')]);}_0x3fce12[_0x8f40('0x6f')]=qs['sort'](_0x56452f[_0x8f40('0x2d')][_0x8f40('0x33')]);_0x3fce12[_0x8f40('0x41')]=qs['filters'](_[_0x8f40('0x34')](_0x56452f[_0x8f40('0x2d')],_0x42a5e2['filters']));_0x3fce12[_0x8f40('0x41')]['ContactId']=_0x5e001d['id'];if(_0x56452f['query']['filter']){_0x3fce12[_0x8f40('0x41')]=_[_0x8f40('0x7e')](_0x3fce12['where'],{'$or':_['map'](_0x3fce12[_0x8f40('0x2e')],function(_0xc39c3){var _0x5ced90={};_0x5ced90[_0xc39c3]={'$like':'%'+_0x56452f[_0x8f40('0x2d')]['filter']+'%'};return _0x5ced90;})});}_0x3fce12=_[_0x8f40('0x7e')]({},_0x3fce12,_0x56452f[_0x8f40('0xc9')]);return db[_0x8f40('0xd6')]['count']({'where':_0x3fce12[_0x8f40('0x41')]})[_0x8f40('0x1a')](function(_0x1b3a44){_0x46b1fc[_0x8f40('0x16')]=_0x1b3a44;if(_0x56452f[_0x8f40('0x2d')]['includeAll']){_0x3fce12[_0x8f40('0xd4')]=[{'all':!![]}];}return db[_0x8f40('0xd6')][_0x8f40('0x91')](_0x3fce12);})[_0x8f40('0x1a')](function(_0x288280){_0x46b1fc[_0x8f40('0x8b')]=_0x288280;return _0x46b1fc;});}})['then'](respondWithFilteredResult(_0x1ff51d,_0x3fce12))[_0x8f40('0x8c')](handleError(_0x1ff51d,null));};exports[_0x8f40('0xd7')]=function(_0x221158,_0x3e8f6e){try{if(!_0x221158['body'][_0x8f40('0x58')]){throw new Error(_0x8f40('0xd8'));}if(!_0x221158[_0x8f40('0x96')]['binding_keys']){throw new Error(_0x8f40('0xd9'));}if(!_0x221158[_0x8f40('0x96')][_0x8f40('0xda')]){throw new Error(_0x8f40('0xdb'));}if(!_0x221158[_0x8f40('0x96')]['socket_timestamp']){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x1b5bcc=_0x221158[_0x8f40('0x96')]['binding_keys']['split'](',');var _0x36031d=_0x221158[_0x8f40('0x96')][_0x8f40('0xda')][_0x8f40('0x47')](',');if(!_0x1b5bcc[_0x8f40('0x26')]||!_0x36031d[_0x8f40('0x26')]||_0x1b5bcc[_0x8f40('0x26')]!==_0x36031d[_0x8f40('0x26')]){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x221158[_0x8f40('0x96')][_0x8f40('0x7f')]=_[_0x8f40('0xdc')](_0x1b5bcc,_0x36031d);if(!_0x221158[_0x8f40('0x96')]['fields'][_0x8f40('0xc7')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x221158[_0x8f40('0x96')]['fields'][_0x8f40('0xdd')]){throw new Error(_0x8f40('0xde'));}var _0x4665c5=path[_0x8f40('0x98')](config[_0x8f40('0xdf')],'server/files/tmp',_0x221158['file'][_0x8f40('0xe0')]);fs[_0x8f40('0xe1')](_0x4665c5,parseInt(_0x8f40('0xe2'),0x8));var _0x3a4e50=require(_0x8f40('0xe3'))[_0x8f40('0xe4')](path[_0x8f40('0x98')](__dirname,_0x8f40('0xe5')),[_0x4665c5,_0x221158[_0x8f40('0x96')]['binding_keys'],_0x221158[_0x8f40('0x96')][_0x8f40('0xda')],_0x221158[_0x8f40('0x96')][_0x8f40('0x58')],_0x221158[_0x8f40('0x96')][_0x8f40('0xe6')],_0x221158[_0x8f40('0x96')][_0x8f40('0xb9')],_0x221158[_0x8f40('0x96')][_0x8f40('0xe7')]]);return _0x3e8f6e['status'](0xc8)[_0x8f40('0x13')]({'message':'File\x20uploaded\x20correctly!','pid':_0x3a4e50['pid']});}catch(_0x165600){return _0x3e8f6e[_0x8f40('0x12')](0x1f4)[_0x8f40('0x21')](_0x165600);}};exports[_0x8f40('0xe8')]=function(_0x57cf66,_0x5b9094){var _0x517101=fs[_0x8f40('0xe9')](_0x57cf66[_0x8f40('0xea')][_0x8f40('0xeb')]);Papa['parse'](_0x517101,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x33d979){return _0x5b9094[_0x8f40('0x12')](0xc8)[_0x8f40('0x13')]({'file':_0x57cf66['file'],'fields':_0x33d979[_0x8f40('0xec')][_0x8f40('0x7f')]});}});};exports['import']=function(_0x221b4a,_0x5d74cc){return db['User'][_0x8f40('0x91')]({'raw':!![],'attributes':['id'],'where':{'role':_0x8f40('0x7a')}})['then'](function(_0x3c9d05){var _0x427310=![];if(!_0x221b4a['body'][_0x8f40('0x58')]){throw new Error(_0x8f40('0xd8'));}if(!_0x221b4a[_0x8f40('0x96')][_0x8f40('0xed')]['phone']){throw new Error(_0x8f40('0xee'));}if(!_0x221b4a[_0x8f40('0x96')][_0x8f40('0xed')][_0x8f40('0xdd')]){throw new Error(_0x8f40('0xde'));}if(!_0x221b4a['body'][_0x8f40('0xe7')]){throw new Error(_0x8f40('0xef'));}var _0xdfe77=require('child_process')[_0x8f40('0xe4')](path[_0x8f40('0x98')](__dirname,'../../components/import/cm/csv2'),[_0x221b4a[_0x8f40('0xc2')]['id'],JSON[_0x8f40('0xf0')](_0x221b4a[_0x8f40('0x96')]),JSON[_0x8f40('0xf0')](_0x3c9d05)]);_0xdfe77['on'](_0x8f40('0xf1'),function(){_0x427310=!![];return _0x5d74cc[_0x8f40('0x12')](0xc8)[_0x8f40('0x13')]({'message':_0x8f40('0xf2'),'pid':_0xdfe77[_0x8f40('0xf3')]});});_0xdfe77['on'](_0x8f40('0xf4'),function(_0x2a5482){if(_0x2a5482&&!_0x427310){return _0x5d74cc[_0x8f40('0x12')](0x1f4)['json']({'message':_0x8f40('0xf5'),'pid':_0xdfe77[_0x8f40('0xf3')]});}});})['catch'](handleError(_0x5d74cc,null));};exports['getJourney']=function(_0x5d8bfe,_0x2ce8c9){var _0x1f4f50=[_0x8f40('0xf6'),'chat',_0x8f40('0xf7'),'openchannel',_0x8f40('0xf8'),_0x8f40('0xf9'),_0x8f40('0xfa')];var _0x2c0795={'offset':0x0,'order':qs['sort'](_0x8f40('0xfb'))},_0x75382d={'count':0x0,'rows':[]};Promise['resolve']()['then'](function(){if(_0x5d8bfe[_0x8f40('0x2d')][_0x8f40('0xfc')]){if(!_['includes'](_0x1f4f50,_0x5d8bfe['query']['channel'][_0x8f40('0xfd')]())){throw new Error(_0x8f40('0xfe'));}_0x1f4f50=[_0x5d8bfe['query'][_0x8f40('0xfc')][_0x8f40('0xfd')]()];}if(_0x5d8bfe['query']['range']){try{var _0x5e7d05=JSON[_0x8f40('0xff')](_0x5d8bfe[_0x8f40('0x2d')][_0x8f40('0x100')]);if(!moment(_0x5e7d05[_0x8f40('0x38')])['isValid']()){throw new Error(_0x8f40('0x101'));}if(!moment(_0x5e7d05['to'])[_0x8f40('0x102')]()){throw new Error(_0x8f40('0x103'));}}catch(_0x216236){throw new Error(_0x8f40('0x104'));}}if(!_0x5d8bfe[_0x8f40('0x2d')][_0x8f40('0x30')](_0x8f40('0x31'))){_0x2c0795[_0x8f40('0x14')]=qs[_0x8f40('0x14')](_0x5d8bfe[_0x8f40('0x2d')]['limit']||0xa);_0x2c0795[_0x8f40('0x32')]=qs['offset'](_0x5d8bfe['query'][_0x8f40('0x32')]);}var _0x114cd8=_0x1f4f50[_0x8f40('0x48')](function(_0x5bb3dd){if(_0x5bb3dd==='voice'){var _0x1f0b86={'attributes':['id',_0x8f40('0x105'),_0x8f40('0x53'),'source',_0x8f40('0x106'),_0x8f40('0x107'),'starttime','endtime',_0x8f40('0x108'),_0x8f40('0x109'),_0x8f40('0x10a'),_0x8f40('0x10b'),'userSecondDisposition','userThirdDisposition',_0x8f40('0x10c')],'where':{'ContactId':_0x5d8bfe[_0x8f40('0xc2')]['id']},'include':[{'model':db[_0x8f40('0x4b')],'as':'User','attributes':['id',_0x8f40('0x20'),_0x8f40('0x10d'),_0x8f40('0x92')]}],'order':[[_0x8f40('0x10a'),_0x8f40('0x70')]]};if(_0x5d8bfe['query'][_0x8f40('0x100')]){_0x1f0b86[_0x8f40('0x41')][_0x8f40('0x10a')]={'$gte':_0x5e7d05[_0x8f40('0x38')],'$lte':_0x5e7d05['to']};}return db[_0x8f40('0xac')]['findAndCountAll'](_0x1f0b86)['then'](function(_0x2ea376){_0x75382d[_0x8f40('0x16')]+=_0x2ea376['count'];return _['map'](_0x2ea376[_0x8f40('0x8b')],function(_0x371cdd){var _0x42b241=_0x371cdd[_0x8f40('0x97')]({'plain':!![]});_0x42b241[_0x8f40('0xfc')]=_0x5bb3dd;if(_0x42b241[_0x8f40('0x4b')]){_0x42b241[_0x8f40('0x4b')]={'id':_0x42b241['User']['id'],'name':_0x42b241[_0x8f40('0x4b')][_0x8f40('0x20')],'fullname':_0x42b241['User'][_0x8f40('0x10d')],'alias':_0x42b241[_0x8f40('0x4b')]['alias']};}return _0x42b241;});});}else{var _0xa7c0ae=_[_0x8f40('0x10e')](_0x5bb3dd)+(_0x5bb3dd==='chat'?'Website':'Account');var _0xd1df0b={'attributes':['id',_0x8f40('0x10f'),'closedAt',_0x8f40('0x10a'),_0x8f40('0x109'),_0x8f40('0x110'),'secondDisposition','thirdDisposition',_0x8f40('0x10c'),_0xa7c0ae+'Id'],'where':{'ContactId':_0x5d8bfe[_0x8f40('0xc2')]['id']},'include':[{'model':db[_0xa7c0ae],'as':_0x8f40('0x111'),'attributes':['id',_0x8f40('0x20'),_0x8f40('0x112')]},{'model':db['User'],'as':_0x8f40('0x113'),'attributes':['id',_0x8f40('0x20'),_0x8f40('0x10d')]},{'model':db['Tag'],'as':_0x8f40('0x8a'),'attributes':['id','name','color'],'through':{'attributes':[]}}],'order':[[_0x8f40('0x10a'),_0x8f40('0x70')]]};if(_0x5d8bfe['query'][_0x8f40('0x100')]){_0xd1df0b[_0x8f40('0x41')]['createdAt']={'$gte':_0x5e7d05[_0x8f40('0x38')],'$lte':_0x5e7d05['to']};}switch(_0x5bb3dd){case'chat':_0xd1df0b[_0x8f40('0x2e')][_0x8f40('0x29')](_0x8f40('0x114'),_0x8f40('0x115'),_0x8f40('0x116'),_0x8f40('0x117'),_0x8f40('0x118'),_0x8f40('0x119'),_0x8f40('0x11a'),_0x8f40('0x11b'),_0x8f40('0x11c'));break;case _0x8f40('0xf6'):_0xd1df0b[_0x8f40('0x2e')]['push'](_0x8f40('0x11d'),_0x8f40('0x11e'));break;case'openchannel':_0xd1df0b[_0x8f40('0x2e')][_0x8f40('0x29')](_0x8f40('0x11f'),_0x8f40('0x120'));break;}return db[_[_0x8f40('0x10e')](_0x5bb3dd)+'Interaction'][_0x8f40('0x121')](_0xd1df0b)['then'](function(_0x123cef){_0x75382d[_0x8f40('0x16')]+=_0x123cef[_0x8f40('0x16')];return _[_0x8f40('0x48')](_0x123cef['rows'],function(_0x224199){var _0x32f964=_0x224199['get']({'plain':!![]});_0x32f964[_0x8f40('0xfc')]=_0x5bb3dd;if(_0x32f964[_0x8f40('0x113')]){_0x32f964[_0x8f40('0x113')]={'id':_0x32f964['Owner']['id'],'name':_0x32f964['Owner'][_0x8f40('0x20')],'fullname':_0x32f964[_0x8f40('0x113')][_0x8f40('0x10d')]};}return _0x32f964;});});}});return Promise[_0x8f40('0x122')](_0x114cd8);})[_0x8f40('0x1a')](function(_0xdb118){return _(_0xdb118)[_0x8f40('0x123')]()[_0x8f40('0x124')](_0x8f40('0x10a'))[_0x8f40('0x125')]()[_0x8f40('0x4e')]();})[_0x8f40('0x1a')](function(_0x29dbde){_0x75382d[_0x8f40('0x8b')]=_0x2c0795[_0x8f40('0x14')]?_0x29dbde['slice'](_0x2c0795[_0x8f40('0x32')],_0x2c0795[_0x8f40('0x32')]+_0x2c0795[_0x8f40('0x14')]):_0x29dbde;return _0x75382d;})[_0x8f40('0x1a')](respondWithFilteredResult(_0x2ce8c9,_0x2c0795))[_0x8f40('0x8c')](handleError(_0x2ce8c9,null));};
\ No newline at end of file
+var _0x7ef0=['Interaction','flatten','sortBy','reverse','slice','moment','bluebird','util','path','squel','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','socket.io-emitter','./cmContact.socket','register','status','offset','undefined','count','limit','set','json','update','destroy','then','end','sendStatus','error','stack','name','send','index','CmContact','describe','keys','cf_','push','CmCustomField','findOne','trimStart','all','length','fieldType','type','query','model','attributes','intersection','fields','nolimit','order','sort','where','filters','pick','field','color','tools_tags','select','cm_contacts','left_join','cm_user_has_contacts','cm_contact_has_tags','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','conditions','Tag','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','and','uc.UserId\x20=\x20?','datetime','castTo','DATE','buildExpression','text','start','hasOwnProperty','isNil','Contact','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','tag','isArray','replace','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.phone\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.email\x20LIKE\x20?','c.id','Sequelize','QueryTypes','DESC','having','t.id\x20IN\x20?','resolve','user','role','agent','some','User','getLists','isEmpty','c.ListId\x20IS\x20NULL','sequelize','toString','keyBy','c.firstName','c.lastName','c.phone','c.mobile','c.email','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','find','catch','tags','columnName','analytics','findAll','displayName','custom','merge','body','mergeWith','join','info','CmHopper','from','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperHistory','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','timezones','utcOffset','bulkCreate','each','duplicates','$or','findOrCreate','spread','show','params','get','$and','omit','format','cf_%d','startsWith','id\x20=\x20?','toParam','phone','rawAttributes','options','getTags','setTags','ids','getHoppers','filter','include','getHopperHistories','ContactId','includeAll','getHopperFinals','CmHopperFinal','getJscriptySessions','No\x20ListId\x20specified','binding_values','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','file','0777','child_process','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','parse','meta','import','binding','fork','../../components/import/cm/csv2','stringify','message','exit','getJourney','mail','chat','openchannel','fax','whatsapp','voice','-createdAt','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','source','destination','callerid','endtime','userDisposition','userThirdDisposition','UserId','fullname','alias','createdAt','findAndCountAll','startCase','Website','Account','closed','closedAt','note','disposition','secondDisposition','thirdDisposition','key','Owner','browserName','customerIp','customerPort','deviceModel','osName','ratingType','ratingValue','referer','subject','substatus','threadId'];(function(_0x19da41,_0x351b50){var _0x5a1834=function(_0x52627d){while(--_0x52627d){_0x19da41['push'](_0x19da41['shift']());}};_0x5a1834(++_0x351b50);}(_0x7ef0,0x122));var _0x07ef=function(_0x2bfd41,_0x1d50d9){_0x2bfd41=_0x2bfd41-0x0;var _0x34032e=_0x7ef0[_0x2bfd41];return _0x34032e;};'use strict';var moment=require(_0x07ef('0x0'));var BPromise=require(_0x07ef('0x1'));var util=require(_0x07ef('0x2'));var path=require(_0x07ef('0x3'));var fs=require('fs');var _=require('lodash');var squel=require(_0x07ef('0x4'));var Papa=require(_0x07ef('0x5'));var Redis=require(_0x07ef('0x6'));var qs=require(_0x07ef('0x7'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0x07ef('0x8'))(_0x07ef('0x9'));var config=require('../../config/environment');var shared=require(_0x07ef('0xa'));var db=require(_0x07ef('0xb'))['db'];config[_0x07ef('0xc')]=_['defaults'](config['redis'],{'host':_0x07ef('0xd'),'port':0x18eb});var socket=require(_0x07ef('0xe'))(new Redis(config[_0x07ef('0xc')]));require(_0x07ef('0xf'))[_0x07ef('0x10')](socket);function respondWithResult(_0x5ee31c,_0x4f08ba){_0x4f08ba=_0x4f08ba||0xc8;return function(_0x32268a){if(_0x32268a){return _0x5ee31c[_0x07ef('0x11')](_0x4f08ba)['json'](_0x32268a);}};}function respondWithFilteredResult(_0x22fe6f,_0x459c76){return function(_0x3174d0){if(_0x3174d0){var _0x4f2297=typeof _0x459c76[_0x07ef('0x12')]==='undefined'&&typeof _0x459c76['limit']===_0x07ef('0x13');var _0x25f398=_0x3174d0[_0x07ef('0x14')];var _0x30c3b2=_0x4f2297?0x0:_0x459c76[_0x07ef('0x12')];var _0x3d6643=_0x4f2297?_0x3174d0[_0x07ef('0x14')]:_0x459c76['offset']+_0x459c76[_0x07ef('0x15')];var _0x46b74d;if(_0x3d6643>=_0x25f398){_0x3d6643=_0x25f398;_0x46b74d=0xc8;}else{_0x46b74d=0xce;}_0x22fe6f[_0x07ef('0x11')](_0x46b74d);return _0x22fe6f[_0x07ef('0x16')]('Content-Range',_0x30c3b2+'-'+_0x3d6643+'/'+_0x25f398)[_0x07ef('0x17')](_0x3174d0);}return null;};}function saveUpdates(_0x3df7d8){return function(_0x3f2924){if(_0x3f2924){return _0x3f2924[_0x07ef('0x18')](_0x3df7d8)['then'](function(_0x3aaaa8){return _0x3aaaa8;});}return null;};}function removeEntity(_0x292632){return function(_0x12594b){if(_0x12594b){return _0x12594b[_0x07ef('0x19')]()[_0x07ef('0x1a')](function(){_0x292632[_0x07ef('0x11')](0xcc)[_0x07ef('0x1b')]();});}};}function handleEntityNotFound(_0x4d26c6){return function(_0x310934){if(!_0x310934){_0x4d26c6[_0x07ef('0x1c')](0x194);}return _0x310934;};}function handleError(_0x4a34fe,_0x151369){_0x151369=_0x151369||0x1f4;return function(_0x57fbcc){logger[_0x07ef('0x1d')](_0x57fbcc[_0x07ef('0x1e')]);if(_0x57fbcc['name']){delete _0x57fbcc[_0x07ef('0x1f')];}_0x4a34fe[_0x07ef('0x11')](_0x151369)[_0x07ef('0x20')](_0x57fbcc);};}exports[_0x07ef('0x21')]=function(_0x19c011,_0x5c9282){var _0x4d120a={},_0x462bad={},_0x382f25={'count':0x0,'rows':[]};return db[_0x07ef('0x22')][_0x07ef('0x23')]()['then'](function(_0x277d22){var _0x43e823=[];for(var _0x1b2921=0x0;_0x1b2921<Object[_0x07ef('0x24')](_0x277d22)['length'];_0x1b2921++){var _0x177d59=Object[_0x07ef('0x24')](_0x277d22)[_0x1b2921];if(_['startsWith'](_0x177d59,_0x07ef('0x25'))){_0x43e823[_0x07ef('0x26')](db[_0x07ef('0x27')][_0x07ef('0x28')]({'where':{'id':_[_0x07ef('0x29')](_0x177d59,_0x07ef('0x25'))},'raw':!![]}));}}return BPromise[_0x07ef('0x2a')](_0x43e823)[_0x07ef('0x1a')](function(_0x448dce){for(var _0x298c85=0x0;_0x298c85<_0x448dce[_0x07ef('0x2b')];_0x298c85++){if(_0x448dce[_0x298c85]){var _0x38bd5f=_0x07ef('0x25')+_0x448dce[_0x298c85]['id'];var _0x45cb5d=_0x277d22[_0x38bd5f];_0x45cb5d[_0x07ef('0x2c')]=_0x448dce[_0x298c85][_0x07ef('0x2d')];}}return _0x277d22;});})[_0x07ef('0x1a')](function(_0x472a1e){_0x462bad['model']=_[_0x07ef('0x24')](_0x472a1e);_0x462bad[_0x07ef('0x2e')]=_[_0x07ef('0x24')](_0x19c011[_0x07ef('0x2e')]);_0x462bad['filters']=_['intersection'](_0x462bad[_0x07ef('0x2f')],_0x462bad[_0x07ef('0x2e')]);_0x4d120a[_0x07ef('0x30')]=_[_0x07ef('0x31')](_0x462bad[_0x07ef('0x2f')],qs[_0x07ef('0x32')](_0x19c011[_0x07ef('0x2e')][_0x07ef('0x32')]));_0x4d120a[_0x07ef('0x30')]=_0x4d120a['attributes'][_0x07ef('0x2b')]?_0x4d120a[_0x07ef('0x30')]:_0x462bad[_0x07ef('0x2f')];if(!_0x19c011[_0x07ef('0x2e')]['hasOwnProperty'](_0x07ef('0x33'))){_0x4d120a['limit']=qs['limit'](_0x19c011[_0x07ef('0x2e')][_0x07ef('0x15')]);_0x4d120a[_0x07ef('0x12')]=qs[_0x07ef('0x12')](_0x19c011[_0x07ef('0x2e')][_0x07ef('0x12')]);}_0x4d120a[_0x07ef('0x34')]=qs['sort'](_0x19c011[_0x07ef('0x2e')][_0x07ef('0x35')]);_0x4d120a[_0x07ef('0x36')]=qs[_0x07ef('0x37')](_[_0x07ef('0x38')](_0x19c011[_0x07ef('0x2e')],_0x462bad['filters']),_0x472a1e);var _0xf920ae=[];var _0x5e1f2c=squel['select']()['field']('id')[_0x07ef('0x39')](_0x07ef('0x1f'))[_0x07ef('0x39')](_0x07ef('0x3a'))['from'](_0x07ef('0x3b'));var _0xcfebaf=squel[_0x07ef('0x3c')]()['from'](_0x07ef('0x3d'),'c')[_0x07ef('0x3e')](_0x07ef('0x3f'),'uc','uc.CmContactId\x20=\x20c.id')['left_join'](_0x07ef('0x40'),'ct','ct.CmContactId\x20=\x20c.id')[_0x07ef('0x3e')]('tools_tags','t',_0x07ef('0x41'))[_0x07ef('0x36')](_0x07ef('0x42'));var _0x10e13d=squel[_0x07ef('0x43')]();var _0x48a385=[];var _0x35183a=squel['expr']();var _0x15709c;if(_0x19c011[_0x07ef('0x2e')][_0x07ef('0x44')]){_0x15709c=as[_0x07ef('0x45')](_0x19c011[_0x07ef('0x2e')]['search']);var _0x455992=_0x15709c['sqlOperator'];for(var _0x334a3c=0x0;_0x334a3c<_0x15709c[_0x07ef('0x46')][_0x07ef('0x2b')];_0x334a3c++){var _0x61da5=_0x15709c[_0x07ef('0x46')][_0x334a3c];var _0x525efa='c';var _0x6b1415=_(_0x472a1e)[_0x07ef('0x24')]()['find'](function(_0x2bfbe8){return _0x2bfbe8===_0x61da5[_0x07ef('0x39')];});if(_0x6b1415)_0x6b1415=_0x472a1e[_0x61da5['field']];if(!_0x6b1415){if(_0x61da5['field']===_0x07ef('0x47')){var _0x64b272=_0x61da5[_0x07ef('0x48')][_0x07ef('0x49')](',')[_0x07ef('0x4a')](function(_0x25088e){return Number(_0x25088e);});_0x64b272[_0x07ef('0x4b')](function(_0x3f00ac){_0x35183a['or'](_0x07ef('0x4c'),'%,'+_0x3f00ac+',%');});_0x48a385=_[_0x07ef('0x4d')](_0x48a385,_0x64b272);}else if(_0x61da5[_0x07ef('0x39')]==='User'){_0x10e13d[_0x07ef('0x4e')](_0x07ef('0x4f'),_0x61da5[_0x07ef('0x48')]);}}else{if(_0x61da5[_0x07ef('0x39')]==='dateOfBirth'||_0x6b1415['fieldType']===_0x07ef('0x50'))_0x61da5[_0x07ef('0x51')]=_0x07ef('0x52');var _0x15b819=as[_0x07ef('0x53')](_0x525efa,_0x6b1415[_0x07ef('0x2d')],_0x61da5);_0x10e13d[_0x455992](_0x15b819[_0x07ef('0x54')],_0x15b819[_0x07ef('0x48')][_0x07ef('0x55')],_0x15b819[_0x07ef('0x48')]['end']);}}}else{var _0x6c0f96=_(Object['keys'](_0x19c011[_0x07ef('0x2e')]))[_0x07ef('0x4a')](function(_0x1edc59){return _0x472a1e[_0x07ef('0x56')](_0x1edc59)?_0x1edc59:undefined;})['filter'](function(_0x2808f0){return!_[_0x07ef('0x57')](_0x2808f0);})[_0x07ef('0x48')]();if(_0x19c011[_0x07ef('0x2e')]['Contact'])_0x6c0f96[_0x07ef('0x26')](_0x07ef('0x58'));if(!_['isEmpty'](_0x6c0f96)){_0x6c0f96[_0x07ef('0x4b')](function(_0xe1a150){if(_0xe1a150===_0x07ef('0x59')){_0xcfebaf[_0x07ef('0x36')](_0x07ef('0x5a'),[][_0x07ef('0x5b')](_0x19c011[_0x07ef('0x2e')][_0xe1a150]));}else if(_0xe1a150===_0x07ef('0x58')){var _0x552282='%'+_0x19c011[_0x07ef('0x2e')][_0xe1a150]+'%';_0xcfebaf[_0x07ef('0x36')](_0x07ef('0x5c'),_0x552282);}else{_0xcfebaf[_0x07ef('0x36')]('c.'+_0xe1a150+'\x20=\x20?',_0x19c011[_0x07ef('0x2e')][_0xe1a150]);}});}if(_0x19c011['query'][_0x07ef('0x5d')]){_0x48a385=_[_0x07ef('0x5e')](_0x19c011[_0x07ef('0x2e')][_0x07ef('0x5d')])?_0x19c011[_0x07ef('0x2e')][_0x07ef('0x5d')]:new Array(_0x19c011[_0x07ef('0x2e')][_0x07ef('0x5d')]);_0x48a385[_0x07ef('0x4b')](function(_0xd123c2){_0x35183a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xd123c2+',%');});}if(_0x19c011[_0x07ef('0x2e')]['filter']){var _0x58ff4d=_0x19c011[_0x07ef('0x2e')]['filter'][_0x07ef('0x5f')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x58ff4d[_0x07ef('0x49')]('\x20')[_0x07ef('0x2b')]>0x1){_0x10e13d['or'](_0x07ef('0x60'),qs[_0x07ef('0x61')](_0x58ff4d),null);}else{if(qs[_0x07ef('0x62')](_0x58ff4d)){_0x10e13d['or'](_0x07ef('0x63'),_0x58ff4d+'%');_0x10e13d['or'](_0x07ef('0x64'),_0x58ff4d+'%');_0x10e13d['or']('c.mobile\x20LIKE\x20?',_0x58ff4d+'%');_0x10e13d['or']('c.fax\x20LIKE\x20?',_0x58ff4d+'%');}else if(qs[_0x07ef('0x65')](_0x58ff4d)){_0x10e13d['or']('c.email\x20LIKE\x20?',_0x58ff4d+'%');}else{_0x10e13d['or'](_0x07ef('0x66'),'%'+_0x58ff4d+'%');_0x10e13d['or']('c.lastName\x20LIKE\x20?','%'+_0x58ff4d+'%');_0x10e13d['or'](_0x07ef('0x67'),'%'+_0x58ff4d+'%');}}}}_0xcfebaf[_0x07ef('0x36')](_0x10e13d);_0xcfebaf['group'](_0x07ef('0x68'));var _0x72f3aa={'type':db[_0x07ef('0x69')][_0x07ef('0x6a')]['SELECT'],'raw':!![]};var _0x3ff72f=_0xcfebaf['clone']()['field'](_0x07ef('0x68'));if(_0x4d120a[_0x07ef('0x34')]){_0x4d120a[_0x07ef('0x34')][_0x07ef('0x4b')](function(_0x1182bf){_0xcfebaf[_0x07ef('0x34')]('c.'+_0x1182bf[0x0],_0x1182bf[0x1]===_0x07ef('0x6b')?![]:!![]);});}if(!_['isEmpty'](_0x48a385)){_0xcfebaf[_0x07ef('0x6c')](_0x35183a);_0x3ff72f[_0x07ef('0x36')](_0x07ef('0x6d'),_0x48a385);}BPromise[_0x07ef('0x6e')]()[_0x07ef('0x1a')](function(){if(!_0x15709c)return;if(_0x19c011[_0x07ef('0x6f')][_0x07ef('0x70')]!==_0x07ef('0x71'))return;if(!_[_0x07ef('0x72')](_0x15709c[_0x07ef('0x46')],[_0x07ef('0x39'),_0x07ef('0x73')])){return _0x19c011[_0x07ef('0x6f')][_0x07ef('0x74')]({'attributes':['id'],'raw':!![]})[_0x07ef('0x1a')](function(_0x5ca954){if(_[_0x07ef('0x75')](_0x5ca954)){_0x3ff72f[_0x07ef('0x36')](_0x07ef('0x76'));_0xcfebaf[_0x07ef('0x36')](_0x07ef('0x76'));}else{_0x3ff72f[_0x07ef('0x36')]('c.ListId\x20IN\x20?',_[_0x07ef('0x4a')](_0x5ca954,'id'));_0xcfebaf[_0x07ef('0x36')](_0x07ef('0x5a'),_['map'](_0x5ca954,'id'));}});}})[_0x07ef('0x1a')](function(){if(_0x19c011['user'][_0x07ef('0x70')]===_0x07ef('0x71')&&!_0x15709c&&!_0x19c011[_0x07ef('0x2e')][_0x07ef('0x59')])return[];return db[_0x07ef('0x77')][_0x07ef('0x2e')](_0x3ff72f[_0x07ef('0x78')](),_0x72f3aa);})[_0x07ef('0x1a')](function(_0x3b56b3){_0x382f25[_0x07ef('0x14')]=_0x3b56b3[_0x07ef('0x2b')];if(_0x382f25[_0x07ef('0x14')]===0x0)return[];return db[_0x07ef('0x77')][_0x07ef('0x2e')](_0x5e1f2c['toString'](),_0x72f3aa)[_0x07ef('0x1a')](function(_0x49f4c0){_0xf920ae=_[_0x07ef('0x79')](_0x49f4c0,'id');_0x72f3aa=_['merge'](_0x72f3aa,{'model':db[_0x07ef('0x22')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x19c011[_0x07ef('0x2e')]['fields']){_0x4d120a['attributes'][_0x07ef('0x4b')](function(_0x7586c4){_0xcfebaf['field']('c.'+_0x7586c4);});}else{_0xcfebaf['field'](_0x07ef('0x68'));_0xcfebaf['field'](_0x07ef('0x7a'));_0xcfebaf[_0x07ef('0x39')](_0x07ef('0x7b'));_0xcfebaf[_0x07ef('0x39')](_0x07ef('0x7c'));_0xcfebaf[_0x07ef('0x39')](_0x07ef('0x7d'));_0xcfebaf['field']('c.fax');_0xcfebaf[_0x07ef('0x39')](_0x07ef('0x7e'));_0xcfebaf[_0x07ef('0x39')]('c.ListId');_0xcfebaf[_0x07ef('0x39')]('c.createdAt');_0xcfebaf[_0x07ef('0x39')](_0x07ef('0x7f'));_0xcfebaf[_0x07ef('0x39')](_0x07ef('0x80'));_0xcfebaf[_0x07ef('0x39')](_0x07ef('0x81'),_0x07ef('0x82'));}if(_0x4d120a[_0x07ef('0x15')])_0xcfebaf['limit'](_0x4d120a[_0x07ef('0x15')]);if(_0x4d120a[_0x07ef('0x12')])_0xcfebaf[_0x07ef('0x12')](_0x4d120a[_0x07ef('0x12')]);return db[_0x07ef('0x77')][_0x07ef('0x2e')](_0xcfebaf['toString'](),_0x72f3aa);});})[_0x07ef('0x1a')](function(_0x1ad96e){_0x1ad96e[_0x07ef('0x4b')](function(_0x3bde03){if(_0x3bde03['TagIds']){_0x3bde03[_0x07ef('0x83')]=[];_0x3bde03[_0x07ef('0x82')]['split'](',')['forEach'](function(_0x2e660c){_0x3bde03[_0x07ef('0x83')][_0x07ef('0x26')](_0xf920ae[_0x2e660c]);});}delete _0x3bde03[_0x07ef('0x82')];});_0x382f25[_0x07ef('0x84')]=_0x1ad96e;return _0x382f25;})[_0x07ef('0x1a')](respondWithFilteredResult(_0x5c9282,_0x4d120a));})['catch'](handleError(_0x5c9282,null));};exports[_0x07ef('0x19')]=function(_0x5a0700,_0x5937b0){return db[_0x07ef('0x22')][_0x07ef('0x85')]({'where':{'id':_0x5a0700['params']['id']}})['then'](handleEntityNotFound(_0x5937b0,null))[_0x07ef('0x1a')](removeEntity(_0x5937b0,null))[_0x07ef('0x86')](handleError(_0x5937b0,null));};exports['describe']=function(_0x305dbc,_0x497b49){return db[_0x07ef('0x22')][_0x07ef('0x23')]()[_0x07ef('0x1a')](function(_0x158922){delete _0x158922[_0x07ef('0x87')];for(var _0x3e8c4a=0x0;_0x3e8c4a<Object[_0x07ef('0x24')](_0x158922)[_0x07ef('0x2b')];_0x3e8c4a++){var _0x80f554=Object[_0x07ef('0x24')](_0x158922)[_0x3e8c4a];if(!_['startsWith'](_0x80f554,_0x07ef('0x25'))){_0x158922[_0x80f554][_0x07ef('0x88')]=_0x80f554;_0x158922[_0x80f554]['displayName']=_0x80f554;}}return _0x158922;})[_0x07ef('0x1a')](function(_0x234c36){var _0xc1f317={'where':Boolean(_0x305dbc[_0x07ef('0x2e')][_0x07ef('0x89')])===!![]?undefined:{'$or':[{'ListId':_0x305dbc['query']['id']},{'ListId':null}]},'raw':!![]};return db[_0x07ef('0x27')][_0x07ef('0x8a')](_0xc1f317)[_0x07ef('0x1a')](function(_0x1511c8){for(var _0xb15719=0x0;_0xb15719<_0x1511c8[_0x07ef('0x2b')];_0xb15719++){var _0x443981=_0x07ef('0x25')+_0x1511c8[_0xb15719]['id'];_0x234c36[_0x443981][_0x07ef('0x88')]=_0x443981;_0x234c36[_0x443981][_0x07ef('0x8b')]=_0x1511c8[_0xb15719]['alias'];_0x234c36[_0x443981][_0x07ef('0x8c')]={'type':_0x1511c8[_0xb15719]['type'],'values':_0x1511c8[_0xb15719]['values']};}Object[_0x07ef('0x24')](_0x234c36)[_0x07ef('0x4b')](function(_0x1bf1f8){if(!_0x234c36[_0x1bf1f8][_0x07ef('0x56')](_0x07ef('0x88'))){delete _0x234c36[_0x1bf1f8];}});return _0x234c36;});})['then'](respondWithResult(_0x497b49,null))[_0x07ef('0x86')](handleError(_0x497b49,null));};exports[_0x07ef('0x8d')]=function(_0x5e2400,_0x4595f5){var _0x5cd760;var _0x2f9508;var _0x304e5f;if(_0x5e2400[_0x07ef('0x8e')]['id']){delete _0x5e2400[_0x07ef('0x8e')]['id'];}return db[_0x07ef('0x22')]['findAll']({'where':{'id':[_0x5e2400[_0x07ef('0x8e')]['to'],_0x5e2400['body']['from']]}})[_0x07ef('0x1a')](function(_0x15766f){if(_0x15766f){if(_0x15766f[_0x07ef('0x2b')]!==0x2){return null;}_0x15766f[0x0]=_0x15766f[0x0]['get']({'plain':!![]});_0x15766f[0x1]=_0x15766f[0x1]['get']({'plain':!![]});delete _0x15766f[0x0]['id'];delete _0x15766f[0x1]['id'];return _[_0x07ef('0x8f')](_0x15766f[0x0],_0x15766f[0x1],function(_0x2bd235,_0x2820c4){if(Array['isArray'](_0x2820c4)&&!_0x2820c4[_0x07ef('0x2b')]){return _0x2bd235;}else if(!_0x2820c4){return _0x2bd235;}});}})[_0x07ef('0x1a')](handleEntityNotFound(_0x4595f5,null))[_0x07ef('0x1a')](function(_0x4c0755){if(_0x4c0755){if(_0x4c0755[_0x07ef('0x87')]&&_[_0x07ef('0x5e')](_0x4c0755['tags'])){_0x4c0755[_0x07ef('0x87')]=_0x4c0755['tags'][_0x07ef('0x90')]();}logger[_0x07ef('0x91')]('[CmContact][merge]\x20to\x20%s\x20from\x20%s',_0x5e2400[_0x07ef('0x8e')]['to'],_0x5e2400[_0x07ef('0x8e')]['from']);return db[_0x07ef('0x92')][_0x07ef('0x19')]({'where':{'ContactId':[_0x5e2400['body']['to'],_0x5e2400[_0x07ef('0x8e')][_0x07ef('0x93')]]}})['then'](function(_0x1c2027){logger[_0x07ef('0x91')](_0x07ef('0x94'),_0x1c2027);return db[_0x07ef('0x95')][_0x07ef('0x19')]({'where':{'ContactId':[_0x5e2400[_0x07ef('0x8e')]['to'],_0x5e2400[_0x07ef('0x8e')][_0x07ef('0x93')]]}})[_0x07ef('0x1a')](function(_0x126217){logger[_0x07ef('0x91')](_0x07ef('0x96'),_0x126217);return db[_0x07ef('0x22')][_0x07ef('0x97')](_0x4c0755);});});}})[_0x07ef('0x1a')](function(_0x49451a){if(_0x49451a){_0x5cd760=_0x49451a;_0x2f9508={'ContactId':_0x5cd760['id']};_0x304e5f={'where':{'ContactId':[_0x5e2400['body']['to'],_0x5e2400['body'][_0x07ef('0x93')]]}};return db['ChatInteraction'][_0x07ef('0x18')](_0x2f9508,_0x304e5f);}})[_0x07ef('0x1a')](function(){if(_0x5cd760){return db[_0x07ef('0x98')][_0x07ef('0x18')](_0x2f9508,_0x304e5f);}})[_0x07ef('0x1a')](function(){if(_0x5cd760){return db[_0x07ef('0x99')][_0x07ef('0x18')](_0x2f9508,_0x304e5f);}})[_0x07ef('0x1a')](function(){if(_0x5cd760){return db[_0x07ef('0x9a')]['update'](_0x2f9508,_0x304e5f);}})[_0x07ef('0x1a')](function(){if(_0x5cd760){return db[_0x07ef('0x9b')][_0x07ef('0x18')](_0x2f9508,_0x304e5f);}})[_0x07ef('0x1a')](function(){if(_0x5cd760){return db[_0x07ef('0x9a')][_0x07ef('0x18')](_0x2f9508,_0x304e5f);}})[_0x07ef('0x1a')](function(){if(_0x5cd760){return db['MailMessage'][_0x07ef('0x18')](_0x2f9508,_0x304e5f);}})[_0x07ef('0x1a')](function(){if(_0x5cd760){return db[_0x07ef('0x9c')][_0x07ef('0x18')](_0x2f9508,_0x304e5f);}})[_0x07ef('0x1a')](function(){if(_0x5cd760){return db[_0x07ef('0x9d')][_0x07ef('0x18')](_0x2f9508,_0x304e5f);}})['then'](function(){if(_0x5cd760){return db[_0x07ef('0x9e')][_0x07ef('0x18')](_0x2f9508,_0x304e5f);}})[_0x07ef('0x1a')](function(){if(_0x5cd760){return db[_0x07ef('0x9f')][_0x07ef('0x18')](_0x2f9508,_0x304e5f);}})[_0x07ef('0x1a')](function(){if(_0x5cd760){return db[_0x07ef('0xa0')][_0x07ef('0x18')](_0x2f9508,_0x304e5f);}})[_0x07ef('0x1a')](function(){if(_0x5cd760){return db[_0x07ef('0xa1')]['update'](_0x2f9508,_0x304e5f);}})['then'](function(){if(_0x5cd760){return db['CmHopperFinal']['update'](_0x2f9508,_0x304e5f);}})[_0x07ef('0x1a')](function(){if(_0x5cd760){return db[_0x07ef('0xa2')][_0x07ef('0x18')](_0x2f9508,_0x304e5f);}})[_0x07ef('0x1a')](function(){if(_0x5cd760){return db['ReportAgentPreview'][_0x07ef('0x18')](_0x2f9508,_0x304e5f);}})[_0x07ef('0x1a')](function(){if(_0x5cd760){return db[_0x07ef('0xa3')][_0x07ef('0x18')](_0x2f9508,_0x304e5f);}})[_0x07ef('0x1a')](function(){if(_0x5cd760){return db[_0x07ef('0xa4')][_0x07ef('0x18')](_0x2f9508,_0x304e5f);}})[_0x07ef('0x1a')](function(){if(_0x5cd760){return db['FaxQueueReport'][_0x07ef('0x18')](_0x2f9508,_0x304e5f);}})[_0x07ef('0x1a')](function(){if(_0x5cd760){return db[_0x07ef('0xa5')][_0x07ef('0x18')](_0x2f9508,_0x304e5f);}})[_0x07ef('0x1a')](function(){if(_0x5cd760){return db[_0x07ef('0xa6')][_0x07ef('0x18')](_0x2f9508,_0x304e5f);}})[_0x07ef('0x1a')](function(){if(_0x5cd760){return db[_0x07ef('0xa7')][_0x07ef('0x18')](_0x2f9508,_0x304e5f);}})[_0x07ef('0x1a')](function(){if(_0x5cd760){return db[_0x07ef('0xa8')][_0x07ef('0x18')](_0x2f9508,_0x304e5f);}})['then'](function(){if(_0x5cd760){return db[_0x07ef('0xa9')][_0x07ef('0x18')](_0x2f9508,_0x304e5f);}})[_0x07ef('0x1a')](function(){if(_0x5cd760){return db[_0x07ef('0xaa')]['update'](_0x2f9508,_0x304e5f);}})[_0x07ef('0x1a')](function(){if(_0x5cd760){return db[_0x07ef('0xab')]['update'](_0x2f9508,_0x304e5f);}})['then'](function(){if(_0x5cd760){return db['CmContact']['destroy']({'where':{'id':[_0x5e2400[_0x07ef('0x8e')]['to'],_0x5e2400[_0x07ef('0x8e')][_0x07ef('0x93')]]}});}})['then'](function(){if(_0x5cd760){return _0x5cd760;}})[_0x07ef('0x1a')](respondWithResult(_0x4595f5,null))['catch'](handleError(_0x4595f5,null));};exports[_0x07ef('0x97')]=function(_0x13d5be,_0x6e3285){return db[_0x07ef('0x22')][_0x07ef('0x23')]()['then'](function(_0x45380e){if(_0x13d5be[_0x07ef('0x8e')][_0x07ef('0x87')]&&_['isArray'](_0x13d5be[_0x07ef('0x8e')]['tags'])){if(_0x13d5be['body'][_0x07ef('0x87')]['length']){_0x13d5be[_0x07ef('0x8e')]['tags']=_0x13d5be[_0x07ef('0x8e')][_0x07ef('0x87')]['join'](';')+';';}else{_0x13d5be[_0x07ef('0x8e')]['tags']=null;}}else{_0x13d5be['body']['tags']=null;}if(!_[_0x07ef('0x57')](_0x13d5be[_0x07ef('0x8e')][_0x07ef('0xac')])){var _0x25785f=_0x13d5be[_0x07ef('0x8e')][_0x07ef('0xac')];if(!_[_0x07ef('0x57')](shared[_0x07ef('0xad')][_0x25785f]))_0x13d5be[_0x07ef('0x8e')][_0x07ef('0xae')]=shared['timezones'][_0x25785f][_0x07ef('0xae')];}return db[_0x07ef('0x22')]['create'](_0x13d5be[_0x07ef('0x8e')],{'fields':_[_0x07ef('0x24')](_0x45380e),'raw':!![]});})[_0x07ef('0x1a')](respondWithResult(_0x6e3285,0xc9))[_0x07ef('0x86')](handleError(_0x6e3285,null));};exports[_0x07ef('0xaf')]=function(_0x1bb961,_0x1c0d4e){var _0x4f4253=0x0;var _0x59f912=0x0;var _0x260f04=0x0;return db[_0x07ef('0x22')][_0x07ef('0x23')]()[_0x07ef('0x1a')](function(_0x4486e6){return BPromise[_0x07ef('0xb0')](_0x1bb961[_0x07ef('0x8e')],function(_0x11aa15){var _0x3a2443={'where':{'$or':[]},'defaults':_0x11aa15,'fields':_[_0x07ef('0x24')](_0x4486e6),'raw':!![]};if(_0x11aa15[_0x07ef('0xb1')]){for(var _0x4085dc=0x0;_0x4085dc<_0x11aa15['duplicates'][_0x07ef('0x2b')];_0x4085dc++){var _0x54eb2e={};_0x54eb2e[_0x11aa15['duplicates'][_0x4085dc]]=_0x11aa15[_0x11aa15[_0x07ef('0xb1')][_0x4085dc]];_0x3a2443[_0x07ef('0x36')][_0x07ef('0xb2')][_0x07ef('0x26')](_0x54eb2e);}_0x3a2443[_0x07ef('0x36')][_0x07ef('0x59')]=_0x11aa15[_0x07ef('0x59')];}return db['CmContact'][_0x07ef('0xb3')](_0x3a2443)[_0x07ef('0xb4')](function(_0x5791cb,_0x62e779){if(_0x62e779){_0x4f4253++;}else{_0x260f04++;}})[_0x07ef('0x86')](function(){_0x59f912++;});});})[_0x07ef('0x1a')](function(_0x5687cb){if(_0x5687cb){return{'success':_0x4f4253,'failure':_0x59f912,'duplicates':_0x260f04};}})[_0x07ef('0x1a')](respondWithResult(_0x1c0d4e,0xc9))[_0x07ef('0x86')](handleError(_0x1c0d4e,null));};exports[_0x07ef('0xb5')]=function(_0xc1eb15,_0x50b8fc){var _0xf0f2ce;return db[_0x07ef('0x22')][_0x07ef('0x23')]()[_0x07ef('0x1a')](function(_0x192b1d){return db[_0x07ef('0x22')][_0x07ef('0x85')]({'where':{'id':_0xc1eb15[_0x07ef('0xb6')]['id']},'include':[{'model':db[_0x07ef('0x47')],'as':_0x07ef('0x83'),'attributes':['id',_0x07ef('0x1f'),'color'],'required':_0xc1eb15[_0x07ef('0x2e')][_0x07ef('0x5d')]?!![]:![]}],'attributes':_[_0x07ef('0x24')](_0x192b1d)});})[_0x07ef('0x1a')](function(_0xe3aabb){if(!_[_0x07ef('0x57')](_0xe3aabb)){_0xf0f2ce=_0xe3aabb[_0x07ef('0xb7')]({'plain':!![]});var _0x276cf4={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xe3aabb&&_0xe3aabb['ListId']){if(_0xe3aabb[_0x07ef('0x59')]){_0x276cf4['where'][_0x07ef('0xb8')]['push']({'ListId':{'$ne':_0xe3aabb['ListId']}});}}return db[_0x07ef('0x27')][_0x07ef('0x8a')](_0x276cf4);}})[_0x07ef('0x1a')](function(_0x28c4c8){if(!_['isNil'](_0x28c4c8)){return _[_0x07ef('0xb9')](_0xf0f2ce,_[_0x07ef('0x4a')](_0x28c4c8,function(_0x1595d0){return util[_0x07ef('0xba')](_0x07ef('0xbb'),_0x1595d0['id']);}));}})[_0x07ef('0x1a')](handleEntityNotFound(_0x50b8fc,null))[_0x07ef('0x1a')](respondWithResult(_0x50b8fc,null))[_0x07ef('0x86')](handleError(_0x50b8fc,null));};exports['update']=function(_0x1db759,_0x1f3d02){var _0x3879c2;if(_0x1db759[_0x07ef('0x8e')]['id']){delete _0x1db759[_0x07ef('0x8e')]['id'];}if(!_[_0x07ef('0x57')](_0x1db759[_0x07ef('0x8e')][_0x07ef('0xac')])){var _0x568ba8=_0x1db759['body']['dialTimezone'];if(!_[_0x07ef('0x57')](shared[_0x07ef('0xad')][_0x568ba8]))_0x1db759[_0x07ef('0x8e')][_0x07ef('0xae')]=shared['timezones'][_0x568ba8][_0x07ef('0xae')];}return db[_0x07ef('0x22')]['find']({'where':{'id':_0x1db759['params']['id']}})['then'](handleEntityNotFound(_0x1f3d02,null))['then'](saveUpdates(_0x1db759[_0x07ef('0x8e')],null))[_0x07ef('0x1a')](function(_0x4b6fa3){_0x3879c2=_0x4b6fa3;var _0x51fe2b={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4b6fa3&&_0x4b6fa3[_0x07ef('0x59')]){if(_0x4b6fa3['ListId']){_0x51fe2b[_0x07ef('0x36')]['$and'][_0x07ef('0x26')]({'ListId':{'$ne':_0x4b6fa3[_0x07ef('0x59')]}});}}return db[_0x07ef('0x27')][_0x07ef('0x8a')](_0x51fe2b);})['then'](function(_0x17f4eb){if(_0x17f4eb){return _[_0x07ef('0xb9')](_['pickBy'](_0x1db759[_0x07ef('0x8e')],function(_0x5886ea,_0x2b2d5e){return _[_0x07ef('0xbc')](_0x2b2d5e,_0x07ef('0x25'));}),_[_0x07ef('0x4a')](_0x17f4eb,function(_0x3ceb3c){return util[_0x07ef('0xba')](_0x07ef('0xbb'),_0x3ceb3c['id']);}));}})['then'](function(_0x187b53){if(_0x187b53&&!_[_0x07ef('0x75')](_0x187b53)){var _0xfafc4e=squel[_0x07ef('0x18')]()['table'](_0x07ef('0x3d'))['setFields'](_0x187b53)[_0x07ef('0x36')](_0x07ef('0xbd'),_0x1db759['params']['id'])[_0x07ef('0xbe')]();return db[_0x07ef('0x77')][_0x07ef('0x2e')](_0xfafc4e['text'],{'replacements':_0xfafc4e['values']});}})[_0x07ef('0x1a')](function(){if(_0x1db759[_0x07ef('0x8e')][_0x07ef('0xbf')]&&_0x3879c2){return db[_0x07ef('0x92')][_0x07ef('0x18')]({'phone':_0x1db759[_0x07ef('0x8e')]['phone']},{'where':{'ContactId':_0x3879c2['id']}});}})[_0x07ef('0x1a')](function(){return _0x3879c2;})[_0x07ef('0x1a')](respondWithResult(_0x1f3d02,null))[_0x07ef('0x86')](handleError(_0x1f3d02,null));};exports['getTags']=function(_0x37c669,_0x2da035){var _0x25d237={};var _0x2edcf3={};var _0x4c8f25;var _0x4f1ff5;return db[_0x07ef('0x22')]['findOne']({'where':{'id':_0x37c669['params']['id']}})['then'](handleEntityNotFound(_0x2da035,null))['then'](function(_0x135c58){if(_0x135c58){_0x4c8f25=_0x135c58;_0x2edcf3[_0x07ef('0x2f')]=_[_0x07ef('0x24')](db[_0x07ef('0x47')][_0x07ef('0xc0')]);_0x2edcf3[_0x07ef('0x2e')]=_[_0x07ef('0x24')](_0x37c669['query']);_0x2edcf3[_0x07ef('0x37')]=_['intersection'](_0x2edcf3[_0x07ef('0x2f')],_0x2edcf3[_0x07ef('0x2e')]);_0x25d237[_0x07ef('0x30')]=_['intersection'](_0x2edcf3[_0x07ef('0x2f')],qs[_0x07ef('0x32')](_0x37c669[_0x07ef('0x2e')][_0x07ef('0x32')]));_0x25d237['attributes']=_0x25d237['attributes'][_0x07ef('0x2b')]?_0x25d237['attributes']:_0x2edcf3['model'];_0x25d237[_0x07ef('0x34')]=qs['sort'](_0x37c669[_0x07ef('0x2e')][_0x07ef('0x35')]);_0x25d237['where']=qs[_0x07ef('0x37')](_[_0x07ef('0x38')](_0x37c669[_0x07ef('0x2e')],_0x2edcf3['filters']));if(_0x37c669[_0x07ef('0x2e')]['filter']){_0x25d237[_0x07ef('0x36')]=_['merge'](_0x25d237[_0x07ef('0x36')],{'$or':_['map'](_0x25d237[_0x07ef('0x30')],function(_0x183055){var _0xce9db0={};_0xce9db0[_0x183055]={'$like':'%'+_0x37c669[_0x07ef('0x2e')]['filter']+'%'};return _0xce9db0;})});}_0x25d237=_[_0x07ef('0x8d')]({},_0x25d237,_0x37c669[_0x07ef('0xc1')]);return _0x4c8f25['getTags'](_0x25d237);}})['then'](function(_0x184724){if(_0x184724){_0x4f1ff5=_0x184724['length'];if(!_0x37c669['query'][_0x07ef('0x56')](_0x07ef('0x33'))){_0x25d237['limit']=qs[_0x07ef('0x15')](_0x37c669['query'][_0x07ef('0x15')]);_0x25d237[_0x07ef('0x12')]=qs[_0x07ef('0x12')](_0x37c669['query']['offset']);}return _0x4c8f25[_0x07ef('0xc2')](_0x25d237);}})[_0x07ef('0x1a')](function(_0x46b8e1){if(_0x46b8e1){return _0x46b8e1?{'count':_0x4f1ff5,'rows':_0x46b8e1}:null;}})[_0x07ef('0x1a')](respondWithResult(_0x2da035,null))[_0x07ef('0x86')](handleError(_0x2da035,null));};exports[_0x07ef('0xc3')]=function(_0x1aa0e2,_0x408af6){if(_0x1aa0e2[_0x07ef('0x8e')]['id']){delete _0x1aa0e2[_0x07ef('0x8e')]['id'];}return db[_0x07ef('0x22')]['findOne']({'where':{'id':_0x1aa0e2[_0x07ef('0xb6')]['id']}})[_0x07ef('0x1a')](handleEntityNotFound(_0x408af6,null))[_0x07ef('0x1a')](function(_0xf33113){if(_0xf33113){return _0xf33113[_0x07ef('0xc3')](_0x1aa0e2[_0x07ef('0x8e')][_0x07ef('0xc4')]||[]);}return null;})[_0x07ef('0x1a')](respondWithResult(_0x408af6,null))[_0x07ef('0x86')](handleError(_0x408af6,null));};exports[_0x07ef('0xc5')]=function(_0x4954e2,_0x25ede7){var _0x104f78={'raw':![],'where':{}};var _0x98be0={};var _0x2e934b={'count':0x0,'rows':[]};return db[_0x07ef('0x22')][_0x07ef('0x28')]({'where':{'id':_0x4954e2[_0x07ef('0xb6')]['id']}})[_0x07ef('0x1a')](handleEntityNotFound(_0x25ede7,null))[_0x07ef('0x1a')](function(_0x30e0e1){if(_0x30e0e1){_0x98be0[_0x07ef('0x2f')]=_['keys'](db['CmHopper']['rawAttributes']);_0x98be0[_0x07ef('0x2e')]=_[_0x07ef('0x24')](_0x4954e2[_0x07ef('0x2e')]);_0x98be0['filters']=_[_0x07ef('0x31')](_0x98be0[_0x07ef('0x2f')],_0x98be0['query']);_0x104f78[_0x07ef('0x30')]=_[_0x07ef('0x31')](_0x98be0['model'],qs['fields'](_0x4954e2[_0x07ef('0x2e')][_0x07ef('0x32')]));_0x104f78['attributes']=_0x104f78[_0x07ef('0x30')][_0x07ef('0x2b')]?_0x104f78[_0x07ef('0x30')]:_0x98be0[_0x07ef('0x2f')];if(!_0x4954e2[_0x07ef('0x2e')][_0x07ef('0x56')](_0x07ef('0x33'))){_0x104f78[_0x07ef('0x15')]=qs[_0x07ef('0x15')](_0x4954e2[_0x07ef('0x2e')][_0x07ef('0x15')]);_0x104f78['offset']=qs[_0x07ef('0x12')](_0x4954e2['query'][_0x07ef('0x12')]);}_0x104f78['order']=qs[_0x07ef('0x35')](_0x4954e2['query'][_0x07ef('0x35')]);_0x104f78[_0x07ef('0x36')]=qs[_0x07ef('0x37')](_['pick'](_0x4954e2[_0x07ef('0x2e')],_0x98be0[_0x07ef('0x37')]));_0x104f78[_0x07ef('0x36')]['ContactId']=_0x30e0e1['id'];if(_0x4954e2[_0x07ef('0x2e')][_0x07ef('0xc6')]){_0x104f78['where']=_['merge'](_0x104f78[_0x07ef('0x36')],{'$or':_[_0x07ef('0x4a')](_0x104f78[_0x07ef('0x30')],function(_0x279a40){var _0x3640c5={};_0x3640c5[_0x279a40]={'$like':'%'+_0x4954e2[_0x07ef('0x2e')][_0x07ef('0xc6')]+'%'};return _0x3640c5;})});}_0x104f78=_['merge']({},_0x104f78,_0x4954e2[_0x07ef('0xc1')]);return db[_0x07ef('0x92')][_0x07ef('0x14')]({'where':_0x104f78[_0x07ef('0x36')]})[_0x07ef('0x1a')](function(_0x2606c0){_0x2e934b[_0x07ef('0x14')]=_0x2606c0;if(_0x4954e2[_0x07ef('0x2e')]['includeAll']){_0x104f78[_0x07ef('0xc7')]=[{'all':!![]}];}return db[_0x07ef('0x92')][_0x07ef('0x8a')](_0x104f78);})[_0x07ef('0x1a')](function(_0x42267a){_0x2e934b['rows']=_0x42267a;return _0x2e934b;});}})['then'](respondWithFilteredResult(_0x25ede7,_0x104f78))[_0x07ef('0x86')](handleError(_0x25ede7,null));};exports[_0x07ef('0xc8')]=function(_0x2b7e76,_0x2dcc5f){var _0x155929={'raw':!![],'where':{}};var _0x4c6ac9={};var _0x4fe811={'count':0x0,'rows':[]};return db[_0x07ef('0x22')][_0x07ef('0x28')]({'where':{'id':_0x2b7e76['params']['id']}})[_0x07ef('0x1a')](handleEntityNotFound(_0x2dcc5f,null))[_0x07ef('0x1a')](function(_0x394e02){if(_0x394e02){_0x4c6ac9[_0x07ef('0x2f')]=_[_0x07ef('0x24')](db[_0x07ef('0xa2')][_0x07ef('0xc0')]);_0x4c6ac9[_0x07ef('0x2e')]=_[_0x07ef('0x24')](_0x2b7e76[_0x07ef('0x2e')]);_0x4c6ac9['filters']=_[_0x07ef('0x31')](_0x4c6ac9['model'],_0x4c6ac9[_0x07ef('0x2e')]);_0x155929[_0x07ef('0x30')]=_[_0x07ef('0x31')](_0x4c6ac9[_0x07ef('0x2f')],qs['fields'](_0x2b7e76['query'][_0x07ef('0x32')]));_0x155929[_0x07ef('0x30')]=_0x155929['attributes'][_0x07ef('0x2b')]?_0x155929['attributes']:_0x4c6ac9['model'];if(!_0x2b7e76[_0x07ef('0x2e')]['hasOwnProperty']('nolimit')){_0x155929[_0x07ef('0x15')]=qs[_0x07ef('0x15')](_0x2b7e76[_0x07ef('0x2e')][_0x07ef('0x15')]);_0x155929[_0x07ef('0x12')]=qs[_0x07ef('0x12')](_0x2b7e76[_0x07ef('0x2e')][_0x07ef('0x12')]);}_0x155929['order']=qs['sort'](_0x2b7e76[_0x07ef('0x2e')][_0x07ef('0x35')]);_0x155929[_0x07ef('0x36')]=qs[_0x07ef('0x37')](_['pick'](_0x2b7e76[_0x07ef('0x2e')],_0x4c6ac9[_0x07ef('0x37')]));_0x155929[_0x07ef('0x36')][_0x07ef('0xc9')]=_0x394e02['id'];if(_0x2b7e76['query']['filter']){_0x155929['where']=_['merge'](_0x155929[_0x07ef('0x36')],{'$or':_[_0x07ef('0x4a')](_0x155929[_0x07ef('0x30')],function(_0x1d4c18){var _0xa2c730={};_0xa2c730[_0x1d4c18]={'$like':'%'+_0x2b7e76['query'][_0x07ef('0xc6')]+'%'};return _0xa2c730;})});}_0x155929=_[_0x07ef('0x8d')]({},_0x155929,_0x2b7e76['options']);return db[_0x07ef('0xa2')][_0x07ef('0x14')]({'where':_0x155929[_0x07ef('0x36')]})['then'](function(_0x4f5bcc){_0x4fe811[_0x07ef('0x14')]=_0x4f5bcc;if(_0x2b7e76[_0x07ef('0x2e')][_0x07ef('0xca')]){_0x155929[_0x07ef('0xc7')]=[{'all':!![]}];}return db[_0x07ef('0xa2')][_0x07ef('0x8a')](_0x155929);})[_0x07ef('0x1a')](function(_0x59da50){_0x4fe811[_0x07ef('0x84')]=_0x59da50;return _0x4fe811;});}})[_0x07ef('0x1a')](respondWithFilteredResult(_0x2dcc5f,_0x155929))[_0x07ef('0x86')](handleError(_0x2dcc5f,null));};exports[_0x07ef('0xcb')]=function(_0x18e874,_0x3045cf){var _0x3a2f31={'raw':!![],'where':{}};var _0x284cba={};var _0x15776d={'count':0x0,'rows':[]};return db['CmContact'][_0x07ef('0x28')]({'where':{'id':_0x18e874['params']['id']}})[_0x07ef('0x1a')](handleEntityNotFound(_0x3045cf,null))[_0x07ef('0x1a')](function(_0x4d0729){if(_0x4d0729){_0x284cba[_0x07ef('0x2f')]=_[_0x07ef('0x24')](db['CmHopperFinal'][_0x07ef('0xc0')]);_0x284cba[_0x07ef('0x2e')]=_[_0x07ef('0x24')](_0x18e874['query']);_0x284cba['filters']=_[_0x07ef('0x31')](_0x284cba[_0x07ef('0x2f')],_0x284cba['query']);_0x3a2f31[_0x07ef('0x30')]=_[_0x07ef('0x31')](_0x284cba[_0x07ef('0x2f')],qs['fields'](_0x18e874[_0x07ef('0x2e')][_0x07ef('0x32')]));_0x3a2f31[_0x07ef('0x30')]=_0x3a2f31['attributes'][_0x07ef('0x2b')]?_0x3a2f31['attributes']:_0x284cba[_0x07ef('0x2f')];if(!_0x18e874[_0x07ef('0x2e')]['hasOwnProperty'](_0x07ef('0x33'))){_0x3a2f31['limit']=qs['limit'](_0x18e874[_0x07ef('0x2e')][_0x07ef('0x15')]);_0x3a2f31[_0x07ef('0x12')]=qs[_0x07ef('0x12')](_0x18e874[_0x07ef('0x2e')][_0x07ef('0x12')]);}_0x3a2f31[_0x07ef('0x34')]=qs[_0x07ef('0x35')](_0x18e874[_0x07ef('0x2e')][_0x07ef('0x35')]);_0x3a2f31[_0x07ef('0x36')]=qs[_0x07ef('0x37')](_[_0x07ef('0x38')](_0x18e874[_0x07ef('0x2e')],_0x284cba[_0x07ef('0x37')]));_0x3a2f31['where'][_0x07ef('0xc9')]=_0x4d0729['id'];if(_0x18e874[_0x07ef('0x2e')][_0x07ef('0xc6')]){_0x3a2f31['where']=_[_0x07ef('0x8d')](_0x3a2f31[_0x07ef('0x36')],{'$or':_[_0x07ef('0x4a')](_0x3a2f31[_0x07ef('0x30')],function(_0xd1428b){var _0x59be90={};_0x59be90[_0xd1428b]={'$like':'%'+_0x18e874[_0x07ef('0x2e')]['filter']+'%'};return _0x59be90;})});}_0x3a2f31=_['merge']({},_0x3a2f31,_0x18e874[_0x07ef('0xc1')]);return db[_0x07ef('0xcc')][_0x07ef('0x14')]({'where':_0x3a2f31[_0x07ef('0x36')]})[_0x07ef('0x1a')](function(_0x5d3a7e){_0x15776d[_0x07ef('0x14')]=_0x5d3a7e;if(_0x18e874[_0x07ef('0x2e')][_0x07ef('0xca')]){_0x3a2f31['include']=[{'all':!![]}];}return db[_0x07ef('0xcc')][_0x07ef('0x8a')](_0x3a2f31);})[_0x07ef('0x1a')](function(_0x4b56fa){_0x15776d['rows']=_0x4b56fa;return _0x15776d;});}})['then'](respondWithFilteredResult(_0x3045cf,_0x3a2f31))['catch'](handleError(_0x3045cf,null));};exports[_0x07ef('0xcd')]=function(_0x2c885b,_0x1e342c){var _0x4b79d4={'raw':!![],'where':{}};var _0x40a326={};var _0x50d953={'count':0x0,'rows':[]};return db['CmContact']['findOne']({'where':{'id':_0x2c885b[_0x07ef('0xb6')]['id']}})[_0x07ef('0x1a')](handleEntityNotFound(_0x1e342c,null))[_0x07ef('0x1a')](function(_0x4b9ffb){if(_0x4b9ffb){_0x40a326[_0x07ef('0x2f')]=_[_0x07ef('0x24')](db[_0x07ef('0xa8')][_0x07ef('0xc0')]);_0x40a326[_0x07ef('0x2e')]=_[_0x07ef('0x24')](_0x2c885b[_0x07ef('0x2e')]);_0x40a326[_0x07ef('0x37')]=_['intersection'](_0x40a326[_0x07ef('0x2f')],_0x40a326[_0x07ef('0x2e')]);_0x4b79d4[_0x07ef('0x30')]=_[_0x07ef('0x31')](_0x40a326[_0x07ef('0x2f')],qs[_0x07ef('0x32')](_0x2c885b[_0x07ef('0x2e')][_0x07ef('0x32')]));_0x4b79d4['attributes']=_0x4b79d4[_0x07ef('0x30')][_0x07ef('0x2b')]?_0x4b79d4[_0x07ef('0x30')]:_0x40a326[_0x07ef('0x2f')];if(!_0x2c885b[_0x07ef('0x2e')][_0x07ef('0x56')]('nolimit')){_0x4b79d4[_0x07ef('0x15')]=qs['limit'](_0x2c885b[_0x07ef('0x2e')]['limit']);_0x4b79d4[_0x07ef('0x12')]=qs[_0x07ef('0x12')](_0x2c885b[_0x07ef('0x2e')][_0x07ef('0x12')]);}_0x4b79d4[_0x07ef('0x34')]=qs[_0x07ef('0x35')](_0x2c885b[_0x07ef('0x2e')]['sort']);_0x4b79d4['where']=qs[_0x07ef('0x37')](_[_0x07ef('0x38')](_0x2c885b['query'],_0x40a326[_0x07ef('0x37')]));_0x4b79d4['where'][_0x07ef('0xc9')]=_0x4b9ffb['id'];if(_0x2c885b[_0x07ef('0x2e')]['filter']){_0x4b79d4[_0x07ef('0x36')]=_[_0x07ef('0x8d')](_0x4b79d4['where'],{'$or':_['map'](_0x4b79d4[_0x07ef('0x30')],function(_0x1b906a){var _0x4ea741={};_0x4ea741[_0x1b906a]={'$like':'%'+_0x2c885b[_0x07ef('0x2e')][_0x07ef('0xc6')]+'%'};return _0x4ea741;})});}_0x4b79d4=_['merge']({},_0x4b79d4,_0x2c885b[_0x07ef('0xc1')]);return db[_0x07ef('0xa8')][_0x07ef('0x14')]({'where':_0x4b79d4[_0x07ef('0x36')]})[_0x07ef('0x1a')](function(_0x626472){_0x50d953[_0x07ef('0x14')]=_0x626472;if(_0x2c885b[_0x07ef('0x2e')][_0x07ef('0xca')]){_0x4b79d4[_0x07ef('0xc7')]=[{'all':!![]}];}return db[_0x07ef('0xa8')][_0x07ef('0x8a')](_0x4b79d4);})[_0x07ef('0x1a')](function(_0x47aa70){_0x50d953[_0x07ef('0x84')]=_0x47aa70;return _0x50d953;});}})[_0x07ef('0x1a')](respondWithFilteredResult(_0x1e342c,_0x4b79d4))[_0x07ef('0x86')](handleError(_0x1e342c,null));};exports['uploadCsv']=function(_0x20e688,_0x5428ce){try{if(!_0x20e688[_0x07ef('0x8e')][_0x07ef('0x59')]){throw new Error(_0x07ef('0xce'));}if(!_0x20e688[_0x07ef('0x8e')]['binding_keys']){throw new Error('No\x20association\x20keys\x20specified!');}if(!_0x20e688['body'][_0x07ef('0xcf')]){throw new Error('No\x20association\x20values\x20specified!');}if(!_0x20e688[_0x07ef('0x8e')]['socket_timestamp']){throw new Error(_0x07ef('0xd0'));}var _0x103908=_0x20e688[_0x07ef('0x8e')][_0x07ef('0xd1')][_0x07ef('0x49')](',');var _0x553180=_0x20e688[_0x07ef('0x8e')]['binding_values'][_0x07ef('0x49')](',');if(!_0x103908['length']||!_0x553180['length']||_0x103908[_0x07ef('0x2b')]!==_0x553180['length']){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x20e688[_0x07ef('0x8e')][_0x07ef('0x32')]=_[_0x07ef('0xd2')](_0x103908,_0x553180);if(!_0x20e688[_0x07ef('0x8e')]['fields']['phone']){throw new Error(_0x07ef('0xd3'));}if(!_0x20e688['body'][_0x07ef('0x32')][_0x07ef('0xd4')]){throw new Error(_0x07ef('0xd5'));}var _0x17d7b2=path[_0x07ef('0x90')](config['root'],'server/files/tmp',_0x20e688[_0x07ef('0xd6')]['filename']);fs['chmodSync'](_0x17d7b2,parseInt(_0x07ef('0xd7'),0x8));var _0x216a0f=require(_0x07ef('0xd8'))['fork'](path[_0x07ef('0x90')](__dirname,_0x07ef('0xd9')),[_0x17d7b2,_0x20e688[_0x07ef('0x8e')]['binding_keys'],_0x20e688[_0x07ef('0x8e')]['binding_values'],_0x20e688['body'][_0x07ef('0x59')],_0x20e688['body'][_0x07ef('0xda')],_0x20e688[_0x07ef('0x8e')]['duplicates'],_0x20e688[_0x07ef('0x8e')]['socket_timestamp']]);return _0x5428ce[_0x07ef('0x11')](0xc8)['json']({'message':_0x07ef('0xdb'),'pid':_0x216a0f[_0x07ef('0xdc')]});}catch(_0x4f9c63){return _0x5428ce['status'](0x1f4)[_0x07ef('0x20')](_0x4f9c63);}};exports['upload']=function(_0x3f18d7,_0x31ef56){var _0x218d55=fs['createReadStream'](_0x3f18d7[_0x07ef('0xd6')][_0x07ef('0x3')]);Papa[_0x07ef('0xdd')](_0x218d55,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0xa7e0da){return _0x31ef56[_0x07ef('0x11')](0xc8)[_0x07ef('0x17')]({'file':_0x3f18d7[_0x07ef('0xd6')],'fields':_0xa7e0da[_0x07ef('0xde')][_0x07ef('0x32')]});}});};exports[_0x07ef('0xdf')]=function(_0x35cafc,_0x5704f3){return db[_0x07ef('0x73')][_0x07ef('0x8a')]({'raw':!![],'attributes':['id'],'where':{'role':_0x07ef('0x71')}})[_0x07ef('0x1a')](function(_0x2c080a){var _0x445b2e=![];if(!_0x35cafc[_0x07ef('0x8e')][_0x07ef('0x59')]){throw new Error(_0x07ef('0xce'));}if(!_0x35cafc[_0x07ef('0x8e')][_0x07ef('0xe0')][_0x07ef('0xbf')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x35cafc[_0x07ef('0x8e')]['binding'][_0x07ef('0xd4')]){throw new Error(_0x07ef('0xd5'));}if(!_0x35cafc[_0x07ef('0x8e')]['socket_timestamp']){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x154761=require(_0x07ef('0xd8'))[_0x07ef('0xe1')](path[_0x07ef('0x90')](__dirname,_0x07ef('0xe2')),[_0x35cafc['params']['id'],JSON[_0x07ef('0xe3')](_0x35cafc[_0x07ef('0x8e')]),JSON[_0x07ef('0xe3')](_0x2c080a)]);_0x154761['on'](_0x07ef('0xe4'),function(){_0x445b2e=!![];return _0x5704f3[_0x07ef('0x11')](0xc8)[_0x07ef('0x17')]({'message':'start\x20child\x20process\x20correctly!','pid':_0x154761[_0x07ef('0xdc')]});});_0x154761['on'](_0x07ef('0xe5'),function(_0x148de5){if(_0x148de5&&!_0x445b2e){return _0x5704f3[_0x07ef('0x11')](0x1f4)[_0x07ef('0x17')]({'message':'error\x20child\x20process','pid':_0x154761[_0x07ef('0xdc')]});}});})[_0x07ef('0x86')](handleError(_0x5704f3,null));};exports[_0x07ef('0xe6')]=function(_0x23a4d7,_0x3e47bb){var _0x5c6d7b=[_0x07ef('0xe7'),_0x07ef('0xe8'),'sms',_0x07ef('0xe9'),_0x07ef('0xea'),_0x07ef('0xeb'),_0x07ef('0xec')];var _0x424b8d={'offset':0x0,'order':qs[_0x07ef('0x35')](_0x07ef('0xed'))},_0x531ece={'count':0x0,'rows':[]};Promise[_0x07ef('0x6e')]()[_0x07ef('0x1a')](function(){if(_0x23a4d7[_0x07ef('0x2e')][_0x07ef('0xee')]){if(!_[_0x07ef('0xef')](_0x5c6d7b,_0x23a4d7[_0x07ef('0x2e')][_0x07ef('0xee')][_0x07ef('0xf0')]())){throw new Error(_0x07ef('0xf1'));}_0x5c6d7b=[_0x23a4d7[_0x07ef('0x2e')]['channel'][_0x07ef('0xf0')]()];}if(_0x23a4d7['query'][_0x07ef('0xf2')]){try{var _0x3f7f8b=JSON[_0x07ef('0xdd')](_0x23a4d7[_0x07ef('0x2e')][_0x07ef('0xf2')]);if(!moment(_0x3f7f8b[_0x07ef('0x93')])[_0x07ef('0xf3')]()){throw new Error(_0x07ef('0xf4'));}if(!moment(_0x3f7f8b['to'])[_0x07ef('0xf3')]()){throw new Error(_0x07ef('0xf5'));}}catch(_0x300ab){throw new Error(_0x07ef('0xf6'));}}if(!_0x23a4d7[_0x07ef('0x2e')][_0x07ef('0x56')](_0x07ef('0x33'))){_0x424b8d[_0x07ef('0x15')]=qs[_0x07ef('0x15')](_0x23a4d7[_0x07ef('0x2e')][_0x07ef('0x15')]||0xa);_0x424b8d[_0x07ef('0x12')]=qs[_0x07ef('0x12')](_0x23a4d7['query'][_0x07ef('0x12')]);}var _0x551327=_0x5c6d7b[_0x07ef('0x4a')](function(_0x345858){if(_0x345858==='voice'){var _0x50f1a9={'attributes':['id','uniqueid',_0x07ef('0x2d'),_0x07ef('0xf7'),_0x07ef('0xf8'),_0x07ef('0xf9'),'starttime',_0x07ef('0xfa'),'duration','note','createdAt',_0x07ef('0xfb'),'userSecondDisposition',_0x07ef('0xfc'),_0x07ef('0xfd')],'where':{'ContactId':_0x23a4d7[_0x07ef('0xb6')]['id']},'include':[{'model':db['User'],'as':_0x07ef('0x73'),'attributes':['id',_0x07ef('0x1f'),_0x07ef('0xfe'),_0x07ef('0xff')]}],'order':[[_0x07ef('0x100'),_0x07ef('0x6b')]]};if(_0x23a4d7[_0x07ef('0x2e')][_0x07ef('0xf2')]){_0x50f1a9['where'][_0x07ef('0x100')]={'$gte':_0x3f7f8b['from'],'$lte':_0x3f7f8b['to']};}return db[_0x07ef('0xa3')][_0x07ef('0x101')](_0x50f1a9)['then'](function(_0x10e437){_0x531ece[_0x07ef('0x14')]+=_0x10e437[_0x07ef('0x14')];return _[_0x07ef('0x4a')](_0x10e437[_0x07ef('0x84')],function(_0x553b3f){var _0x32cbeb=_0x553b3f[_0x07ef('0xb7')]({'plain':!![]});_0x32cbeb[_0x07ef('0xee')]=_0x345858;if(_0x32cbeb[_0x07ef('0x73')]){_0x32cbeb[_0x07ef('0x73')]={'id':_0x32cbeb[_0x07ef('0x73')]['id'],'name':_0x32cbeb[_0x07ef('0x73')][_0x07ef('0x1f')],'fullname':_0x32cbeb[_0x07ef('0x73')][_0x07ef('0xfe')],'alias':_0x32cbeb[_0x07ef('0x73')]['alias']};}return _0x32cbeb;});});}else{var _0x3dfd5c=_[_0x07ef('0x102')](_0x345858)+(_0x345858==='chat'?_0x07ef('0x103'):_0x07ef('0x104'));var _0xe21d27={'attributes':['id',_0x07ef('0x105'),_0x07ef('0x106'),'createdAt',_0x07ef('0x107'),_0x07ef('0x108'),_0x07ef('0x109'),_0x07ef('0x10a'),'UserId',_0x3dfd5c+'Id'],'where':{'ContactId':_0x23a4d7['params']['id']},'include':[{'model':db[_0x3dfd5c],'as':_0x07ef('0x104'),'attributes':['id',_0x07ef('0x1f'),_0x07ef('0x10b')]},{'model':db['User'],'as':_0x07ef('0x10c'),'attributes':['id','name',_0x07ef('0xfe')]},{'model':db['Tag'],'as':_0x07ef('0x83'),'attributes':['id',_0x07ef('0x1f'),_0x07ef('0x3a')],'through':{'attributes':[]}}],'order':[[_0x07ef('0x100'),_0x07ef('0x6b')]]};if(_0x23a4d7[_0x07ef('0x2e')][_0x07ef('0xf2')]){_0xe21d27[_0x07ef('0x36')]['createdAt']={'$gte':_0x3f7f8b['from'],'$lte':_0x3f7f8b['to']};}switch(_0x345858){case _0x07ef('0xe8'):_0xe21d27[_0x07ef('0x30')]['push'](_0x07ef('0x10d'),_0x07ef('0x10e'),_0x07ef('0x10f'),_0x07ef('0x110'),_0x07ef('0x111'),'ratingMessage',_0x07ef('0x112'),_0x07ef('0x113'),_0x07ef('0x114'));break;case'mail':_0xe21d27[_0x07ef('0x30')]['push'](_0x07ef('0x115'),_0x07ef('0x116'));break;case _0x07ef('0xe9'):_0xe21d27[_0x07ef('0x30')][_0x07ef('0x26')]('externalUrl',_0x07ef('0x117'));break;}return db[_[_0x07ef('0x102')](_0x345858)+_0x07ef('0x118')]['findAndCountAll'](_0xe21d27)[_0x07ef('0x1a')](function(_0x2c2d90){_0x531ece[_0x07ef('0x14')]+=_0x2c2d90[_0x07ef('0x14')];return _[_0x07ef('0x4a')](_0x2c2d90[_0x07ef('0x84')],function(_0x169f6){var _0x20d4a6=_0x169f6[_0x07ef('0xb7')]({'plain':!![]});_0x20d4a6[_0x07ef('0xee')]=_0x345858;if(_0x20d4a6[_0x07ef('0x10c')]){_0x20d4a6[_0x07ef('0x10c')]={'id':_0x20d4a6[_0x07ef('0x10c')]['id'],'name':_0x20d4a6[_0x07ef('0x10c')][_0x07ef('0x1f')],'fullname':_0x20d4a6[_0x07ef('0x10c')][_0x07ef('0xfe')]};}return _0x20d4a6;});});}});return Promise['all'](_0x551327);})['then'](function(_0x5b00f4){return _(_0x5b00f4)[_0x07ef('0x119')]()[_0x07ef('0x11a')](_0x07ef('0x100'))[_0x07ef('0x11b')]()[_0x07ef('0x48')]();})[_0x07ef('0x1a')](function(_0x53cc89){_0x531ece[_0x07ef('0x84')]=_0x424b8d[_0x07ef('0x15')]?_0x53cc89[_0x07ef('0x11c')](_0x424b8d[_0x07ef('0x12')],_0x424b8d['offset']+_0x424b8d[_0x07ef('0x15')]):_0x53cc89;return _0x531ece;})[_0x07ef('0x1a')](respondWithFilteredResult(_0x3e47bb,_0x424b8d))[_0x07ef('0x86')](handleError(_0x3e47bb,null));};
\ No newline at end of file
index e278e8f..99b9e2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcedd=['remove','hasOwnProperty','hook','events','../../mysqldb','CmContact','setMaxListeners','save'];(function(_0x4e0296,_0x30a8d8){var _0x2c62a6=function(_0xaf17a){while(--_0xaf17a){_0x4e0296['push'](_0x4e0296['shift']());}};_0x2c62a6(++_0x30a8d8);}(_0xcedd,0x19b));var _0xdced=function(_0x1d0035,_0x45354b){_0x1d0035=_0x1d0035-0x0;var _0x310e3a=_0xcedd[_0x1d0035];return _0x310e3a;};'use strict';var EventEmitter=require(_0xdced('0x0'));var CmContact=require(_0xdced('0x1'))['db'][_0xdced('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xdced('0x3')](0x0);var events={'afterCreate':_0xdced('0x4'),'afterUpdate':'update','afterDestroy':_0xdced('0x5')};function emitEvent(_0x5b30af){return function(_0x2533f1,_0x5ca25f,_0x31dc70){CmContactEvents['emit'](_0x5b30af+':'+_0x2533f1['id'],_0x2533f1);CmContactEvents['emit'](_0x5b30af,_0x2533f1);_0x31dc70(null);};}for(var e in events){if(events[_0xdced('0x6')](e)){var event=events[e];CmContact[_0xdced('0x7')](e,emitEvent(event));}}module['exports']=CmContactEvents;
\ No newline at end of file
+var _0x5608=['hasOwnProperty','hook','exports','../../mysqldb','CmContact','setMaxListeners','save','update','remove'];(function(_0x5072b6,_0xec775f){var _0x5e5c1c=function(_0x223042){while(--_0x223042){_0x5072b6['push'](_0x5072b6['shift']());}};_0x5e5c1c(++_0xec775f);}(_0x5608,0x6f));var _0x8560=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x5608[_0x297fd3];return _0x2af381;};'use strict';var EventEmitter=require('events');var CmContact=require(_0x8560('0x0'))['db'][_0x8560('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x8560('0x2')](0x0);var events={'afterCreate':_0x8560('0x3'),'afterUpdate':_0x8560('0x4'),'afterDestroy':_0x8560('0x5')};function emitEvent(_0x5a1150){return function(_0x25de1e,_0x551110,_0xa885f3){CmContactEvents['emit'](_0x5a1150+':'+_0x25de1e['id'],_0x25de1e);CmContactEvents['emit'](_0x5a1150,_0x25de1e);_0xa885f3(null);};}for(var e in events){if(events[_0x8560('0x6')](e)){var event=events[e];CmContact[_0x8560('0x7')](e,emitEvent(event));}}module[_0x8560('0x8')]=CmContactEvents;
\ No newline at end of file
index b0c4c17..5915149 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfef2=['\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','outbound','CmList','Lists','always','onlyIfOpen','findAll','CmHopperBlack','cmContact,\x20%s,\x20%s','message','dialCheckDuplicateType','length','List\x20not\x20found','isEmpty','VoiceQueueId','push','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','util','../../config/logger','request-promise','path','rimraf','../../config/environment/shared','./cmContact.attributes','exports','define','CmContact','phone','fti_cm_contacts','firstName','lastName','fax','email','utf8mb4','models','get','error','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','timezones','utcOffset','add','then','CmHopper','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','catch','ret','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','Campaign','minutes'];(function(_0x5e3cbd,_0x2fd5cd){var _0x1ed1ce=function(_0x4bae94){while(--_0x4bae94){_0x5e3cbd['push'](_0x5e3cbd['shift']());}};_0x1ed1ce(++_0x2fd5cd);}(_0xfef2,0x173));var _0x2fef=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xfef2[_0x1e4360];return _0x31e6b4;};'use strict';var _=require('lodash');var util=require(_0x2fef('0x0'));var logger=require(_0x2fef('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2fef('0x2'));var fs=require('fs');var path=require(_0x2fef('0x3'));var rimraf=require(_0x2fef('0x4'));var config=require('../../config/environment');var shared=require(_0x2fef('0x5'));var attributes=require(_0x2fef('0x6'));module[_0x2fef('0x7')]=function(_0x24b849,_0x3b5c59){return _0x24b849[_0x2fef('0x8')](_0x2fef('0x9'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':_0x2fef('0xa'),'fields':['phone']},{'name':_0x2fef('0xb'),'fields':[_0x2fef('0xc'),_0x2fef('0xd'),_0x2fef('0xa'),'mobile',_0x2fef('0xe'),_0x2fef('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'charset':_0x2fef('0x10'),'collate':'utf8mb4_unicode_ci','hooks':{'afterCreate':function(_0x578f14,_0x176ac7,_0xea6fc1){var _0x4305ef=_0x24b849[_0x2fef('0x11')];var _0x2591ad=_0x578f14[_0x2fef('0x12')]({'plain':!![]});function _0x214201(){return function(_0x57bfa1){logger[_0x2fef('0x13')](_0x2fef('0x14'),_0x2fef('0x15'),util[_0x2fef('0x16')](_0x57bfa1,{'showHidden':![],'depth':null}));};}function _0x4e50d1(_0x371366,_0x1a2487){var _0x2b3702=_0x1a2487[_0x2fef('0x17')]?_0x1a2487[_0x2fef('0x17')]:moment()[_0x2fef('0x18')](_0x2fef('0x19'));return new BPromise(function(_0x50e60,_0x5abbb0){if(_[_0x2fef('0x1a')](_0x1a2487[_0x2fef('0x1b')])){_0x50e60({'ret':_0x2b3702});}else{_0x4305ef[_0x2fef('0x1c')][_0x2fef('0x1d')]({'where':{'id':_0x371366['id']}})['then'](function(_0xb15186){if(!_[_0x2fef('0x1a')](_0xb15186)){var _0x1453e3=_0xb15186['dialTimezone'];if(!_['isNil'](_0x1453e3)){var _0x299cd1=shared[_0x2fef('0x1e')];var _0x915747=_0x299cd1[_0x1453e3];var _0x6b2edc=_0x299cd1[_0x1a2487['dialTimezone']];if(!_[_0x2fef('0x1a')](_0x915747)&&!_[_0x2fef('0x1a')](_0x6b2edc)){var _0xa8ecdf=_0x915747[_0x2fef('0x1f')]-_0x6b2edc[_0x2fef('0x1f')];_0x2b3702=_0x1a2487['scheduledat']?_0x1a2487[_0x2fef('0x17')]:moment();var _0x27ebae=moment(_0x2b3702)[_0x2fef('0x20')](_0xa8ecdf,'minutes');_0x50e60({'ret':_0x27ebae['format'](_0x2fef('0x19'))});}else _0x50e60({'ret':_0x2b3702});}else _0x50e60({'ret':_0x2b3702});}else{_0x50e60({'ret':_0x2b3702});}});}});return 0xa;}var _0x3098cb=function(_0xf41aca){return new BPromise(function(_0x407969,_0x6f5061){_0x4e50d1(_0xf41aca,_0x2591ad)[_0x2fef('0x21')](function(_0x38c914){_0x2591ad[_0x2fef('0x17')]=_0x38c914['ret'];_0x4305ef[_0x2fef('0x22')][_0x2fef('0x1d')]({'where':{'phone':_0x2591ad[_0x2fef('0xa')],'VoiceQueueId':_0xf41aca['id']}})[_0x2fef('0x21')](function(_0x533928){if(!_[_0x2fef('0x1a')](_0x533928)){throw new Error('cmContact,\x20afterCreate\x20'+_0x2591ad[_0x2fef('0xa')]+_0x2fef('0x23')+_0xf41aca['id']);}return _0x4305ef[_0x2fef('0x22')][_0x2fef('0x24')]({'phone':_0x2591ad[_0x2fef('0xa')],'ContactId':_0x2591ad['id'],'ListId':_0x2591ad[_0x2fef('0x25')],'priority':_0x2591ad[_0x2fef('0x26')]?_0x2591ad[_0x2fef('0x26')]:0x2,'scheduledat':_0x2591ad[_0x2fef('0x17')]?_0x2591ad[_0x2fef('0x17')]:moment()[_0x2fef('0x18')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x2591ad[_0x2fef('0x27')]?!![]:![],'callbackuniqueid':_0x2591ad[_0x2fef('0x27')]?_0x2591ad[_0x2fef('0x27')]:undefined,'callbackat':_0x2591ad[_0x2fef('0x27')]?moment()[_0x2fef('0x18')](_0x2fef('0x19')):undefined,'VoiceQueueId':_0xf41aca['id']});})[_0x2fef('0x28')](function(_0x53e6b4){_0x6f5061(_0x53e6b4);});});});};var _0x220e25=function(_0x8b3485){return new BPromise(function(_0x442229,_0x1dcee8){_0x4e50d1(_0x8b3485,_0x2591ad)[_0x2fef('0x21')](function(_0x34959d){_0x2591ad[_0x2fef('0x17')]=_0x34959d[_0x2fef('0x29')];_0x4305ef[_0x2fef('0x22')][_0x2fef('0x1d')]({'where':{'phone':_0x2591ad[_0x2fef('0xa')],'VoiceQueueId':_0x8b3485['id']}})[_0x2fef('0x21')](function(_0x2d7688){if(!_['isNil'](_0x2d7688)){throw new Error(_0x2fef('0x2a')+_0x2591ad['phone']+_0x2fef('0x2b')+_0x8b3485['id']);}return _0x4305ef[_0x2fef('0x2c')][_0x2fef('0x1d')]({'where':{'calleridnum':_0x2591ad['phone'],'VoiceQueueId':_0x8b3485['id']}});})[_0x2fef('0x21')](function(_0x179bd0){if(!_[_0x2fef('0x1a')](_0x179bd0)){throw new Error(_0x2fef('0x2d')+_0x2591ad[_0x2fef('0xa')]+_0x2fef('0x2e')+_0x8b3485['id']);}return _0x4305ef['CmHopper'][_0x2fef('0x24')]({'phone':_0x2591ad[_0x2fef('0xa')],'ContactId':_0x2591ad['id'],'ListId':_0x2591ad[_0x2fef('0x25')],'priority':_0x2591ad['priority']?_0x2591ad['priority']:0x2,'scheduledat':_0x2591ad[_0x2fef('0x17')]?_0x2591ad[_0x2fef('0x17')]:moment()[_0x2fef('0x18')](_0x2fef('0x19')),'callback':_0x2591ad[_0x2fef('0x27')]?!![]:![],'callbackuniqueid':_0x2591ad['callbackUniqueid']?_0x2591ad[_0x2fef('0x27')]:undefined,'callbackat':_0x2591ad[_0x2fef('0x27')]?moment()[_0x2fef('0x18')](_0x2fef('0x19')):undefined,'VoiceQueueId':_0x8b3485['id']});})[_0x2fef('0x28')](function(_0x451633){_0x1dcee8(_0x451633);});});});};function _0x240890(){return function(_0x29dc15){logger[_0x2fef('0x13')](_0x2fef('0x14'),_0x2fef('0x15'),util[_0x2fef('0x16')](_0x29dc15,{'showHidden':![],'depth':null}));};}function _0x2b5ea6(_0x2318ec,_0x414e37){var _0x110bcf=_0x414e37[_0x2fef('0x17')]?_0x414e37[_0x2fef('0x17')]:moment()[_0x2fef('0x18')](_0x2fef('0x19'));return new BPromise(function(_0x33f239,_0x36bacd){if(_[_0x2fef('0x1a')](_0x414e37['dialTimezone'])){_0x33f239({'ret':_0x110bcf});}else{_0x4305ef[_0x2fef('0x2f')]['findOne']({'where':{'id':_0x2318ec['id']}})[_0x2fef('0x21')](function(_0x43871a){if(!_[_0x2fef('0x1a')](_0x43871a)){var _0x34e342=_0x43871a[_0x2fef('0x1b')];if(!_[_0x2fef('0x1a')](_0x34e342)){var _0x520abb=shared[_0x2fef('0x1e')];var _0x2df47d=_0x520abb[_0x34e342];var _0x51dc4b=_0x520abb[_0x414e37['dialTimezone']];if(!_[_0x2fef('0x1a')](_0x2df47d)&&!_['isNil'](_0x51dc4b)){var _0x494b05=_0x2df47d[_0x2fef('0x1f')]-_0x51dc4b[_0x2fef('0x1f')];_0x110bcf=_0x414e37[_0x2fef('0x17')]?_0x414e37['scheduledat']:moment();var _0x2f8e91=moment(_0x110bcf)[_0x2fef('0x20')](_0x494b05,_0x2fef('0x30'));_0x33f239({'ret':_0x2f8e91[_0x2fef('0x18')](_0x2fef('0x19'))});}else _0x33f239({'ret':_0x110bcf});}else _0x33f239({'ret':_0x110bcf});}else{_0x33f239({'ret':_0x110bcf});}});}});return 0xa;}var _0x429db4=function(_0x271aed){return new BPromise(function(_0x2361ba,_0xe7ef94){_0x2b5ea6(_0x271aed,_0x2591ad)[_0x2fef('0x21')](function(_0x223cc6){_0x2591ad[_0x2fef('0x17')]=_0x223cc6['ret'];_0x4305ef[_0x2fef('0x22')]['findOne']({'where':{'phone':_0x2591ad[_0x2fef('0xa')],'CampaignId':_0x271aed['id']}})[_0x2fef('0x21')](function(_0x942c17){if(!_['isNil'](_0x942c17)){throw new Error('cmContact,\x20afterCreate\x20'+_0x2591ad[_0x2fef('0xa')]+_0x2fef('0x31')+_0x271aed['id']);}return _0x4305ef['CmHopper'][_0x2fef('0x24')]({'phone':_0x2591ad['phone'],'ContactId':_0x2591ad['id'],'ListId':_0x2591ad[_0x2fef('0x25')],'priority':_0x2591ad[_0x2fef('0x26')]?_0x2591ad[_0x2fef('0x26')]:0x2,'scheduledat':_0x2591ad[_0x2fef('0x17')]?_0x2591ad[_0x2fef('0x17')]:moment()[_0x2fef('0x18')](_0x2fef('0x19')),'callback':_0x2591ad[_0x2fef('0x27')]?!![]:![],'callbackuniqueid':_0x2591ad[_0x2fef('0x27')]?_0x2591ad['callbackUniqueid']:undefined,'callbackat':_0x2591ad[_0x2fef('0x27')]?moment()['format'](_0x2fef('0x19')):undefined,'CampaignId':_0x271aed['id']});})['catch'](function(_0x3c8b93){_0xe7ef94(_0x3c8b93);});});});};var _0x4e07b2=function(_0x1e23e6){return new BPromise(function(_0x42b10c,_0x5a05cc){_0x2b5ea6(_0x1e23e6,_0x2591ad)[_0x2fef('0x21')](function(_0x37b368){_0x2591ad[_0x2fef('0x17')]=_0x37b368[_0x2fef('0x29')];_0x4305ef[_0x2fef('0x22')][_0x2fef('0x1d')]({'where':{'phone':_0x2591ad[_0x2fef('0xa')],'CampaignId':_0x1e23e6['id']}})[_0x2fef('0x21')](function(_0x5bd8a7){if(!_['isNil'](_0x5bd8a7)){throw new Error(_0x2fef('0x2a')+_0x2591ad[_0x2fef('0xa')]+_0x2fef('0x32')+_0x1e23e6['id']);}return _0x4305ef['CmHopperFinal'][_0x2fef('0x1d')]({'where':{'calleridnum':_0x2591ad[_0x2fef('0xa')],'CampaignId':_0x1e23e6['id']}});})['then'](function(_0x14fb51){if(!_[_0x2fef('0x1a')](_0x14fb51)){throw new Error(_0x2fef('0x2d')+_0x2591ad[_0x2fef('0xa')]+_0x2fef('0x33')+_0x1e23e6['id']);}return _0x4305ef[_0x2fef('0x22')]['create']({'phone':_0x2591ad[_0x2fef('0xa')],'ContactId':_0x2591ad['id'],'ListId':_0x2591ad[_0x2fef('0x25')],'priority':_0x2591ad[_0x2fef('0x26')]?_0x2591ad['priority']:0x2,'scheduledat':_0x2591ad['scheduledat']?_0x2591ad[_0x2fef('0x17')]:moment()[_0x2fef('0x18')](_0x2fef('0x19')),'callback':_0x2591ad[_0x2fef('0x27')]?!![]:![],'callbackuniqueid':_0x2591ad['callbackUniqueid']?_0x2591ad['callbackUniqueid']:undefined,'callbackat':_0x2591ad[_0x2fef('0x27')]?moment()[_0x2fef('0x18')](_0x2fef('0x19')):undefined,'CampaignId':_0x1e23e6['id']});})['catch'](function(_0x468024){_0x5a05cc(_0x468024);});});});};if(_0x2591ad[_0x2fef('0x25')]){_0x4305ef['VoiceQueue']['findAll']({'where':{'type':_0x2fef('0x34')},'attributes':['id','dialCheckDuplicateType','dialTimezone'],'include':[{'model':_0x4305ef[_0x2fef('0x35')],'as':_0x2fef('0x36'),'where':{'id':_0x2591ad[_0x2fef('0x25')]}}]})[_0x2fef('0x21')](function(_0x3f7547){if(_0x3f7547){var _0x53f10b=[];for(var _0x2eeccf=0x0,_0x5d2c4d;_0x2eeccf<_0x3f7547['length'];_0x2eeccf+=0x1){_0x5d2c4d=_0x3f7547[_0x2eeccf][_0x2fef('0x12')]({'plain':!![]});switch(_0x5d2c4d['dialCheckDuplicateType']){case _0x2fef('0x37'):_0x220e25(_0x5d2c4d)[_0x2fef('0x28')](_0x214201());break;case _0x2fef('0x38'):_0x3098cb(_0x5d2c4d)[_0x2fef('0x28')](_0x214201());break;default:_0x2b5ea6(_0x5d2c4d,_0x2591ad)[_0x2fef('0x21')](function(_0x38c3ed){_0x2591ad[_0x2fef('0x17')]=_0x38c3ed[_0x2fef('0x29')];_0x4305ef['CmHopper'][_0x2fef('0x24')]({'phone':_0x2591ad[_0x2fef('0xa')],'ContactId':_0x2591ad['id'],'ListId':_0x2591ad[_0x2fef('0x25')],'scheduledat':_0x2591ad[_0x2fef('0x17')]?_0x2591ad[_0x2fef('0x17')]:moment()[_0x2fef('0x18')](_0x2fef('0x19')),'priority':_0x2591ad[_0x2fef('0x26')]?_0x2591ad['priority']:0x2,'callback':_0x2591ad[_0x2fef('0x27')]?!![]:![],'callbackuniqueid':_0x2591ad[_0x2fef('0x27')]?_0x2591ad['callbackUniqueid']:undefined,'callbackat':_0x2591ad[_0x2fef('0x27')]?moment()[_0x2fef('0x18')](_0x2fef('0x19')):undefined,'VoiceQueueId':_0x5d2c4d['id']})[_0x2fef('0x28')](_0x214201());});}}}})[_0x2fef('0x21')](function(){return _0x4305ef[_0x2fef('0x1c')][_0x2fef('0x39')]({'where':{'type':_0x2fef('0x34')},'attributes':['id'],'include':[{'model':_0x4305ef[_0x2fef('0x35')],'as':'BlackLists','where':{'id':_0x2591ad[_0x2fef('0x25')]}}]})[_0x2fef('0x21')](function(_0x534e7e){if(_0x534e7e){var _0x33d9f7=[];for(var _0x3d7eaa=0x0,_0x25053d;_0x3d7eaa<_0x534e7e['length'];_0x3d7eaa+=0x1){_0x25053d=_0x534e7e[_0x3d7eaa]['get']({'plain':!![]});_0x4305ef[_0x2fef('0x3a')][_0x2fef('0x24')]({'phone':_0x2591ad['phone'],'ContactId':_0x2591ad['id'],'ListId':_0x2591ad['ListId'],'VoiceQueueId':_0x25053d['id']})[_0x2fef('0x28')](function(_0x1b6605){logger[_0x2fef('0x13')](_0x2fef('0x3b'),_0x2fef('0x15'),_0x1b6605[_0x2fef('0x3c')]);});}}});})['then'](function(){return _0x4305ef['Campaign'][_0x2fef('0x39')]({'attributes':['id',_0x2fef('0x3d'),'dialTimezone'],'include':[{'model':_0x4305ef[_0x2fef('0x35')],'as':_0x2fef('0x36'),'where':{'id':_0x2591ad[_0x2fef('0x25')]}}]})[_0x2fef('0x21')](function(_0x3a9712){if(_0x3a9712){var _0x1fd330=[];for(var _0x471629=0x0,_0x24a57a;_0x471629<_0x3a9712[_0x2fef('0x3e')];_0x471629+=0x1){_0x24a57a=_0x3a9712[_0x471629]['get']({'plain':!![]});switch(_0x24a57a[_0x2fef('0x3d')]){case _0x2fef('0x37'):_0x4e07b2(_0x24a57a)[_0x2fef('0x28')](_0x240890());break;case _0x2fef('0x38'):_0x429db4(_0x24a57a)[_0x2fef('0x28')](_0x240890());break;default:_0x4305ef[_0x2fef('0x22')][_0x2fef('0x24')]({'phone':_0x2591ad[_0x2fef('0xa')],'ContactId':_0x2591ad['id'],'ListId':_0x2591ad[_0x2fef('0x25')],'scheduledat':_0x2591ad[_0x2fef('0x17')]?_0x2591ad[_0x2fef('0x17')]:moment()[_0x2fef('0x18')](_0x2fef('0x19')),'priority':_0x2591ad[_0x2fef('0x26')]?_0x2591ad[_0x2fef('0x26')]:0x2,'callback':_0x2591ad[_0x2fef('0x27')]?!![]:![],'callbackuniqueid':_0x2591ad[_0x2fef('0x27')]?_0x2591ad[_0x2fef('0x27')]:undefined,'callbackat':_0x2591ad[_0x2fef('0x27')]?moment()['format'](_0x2fef('0x19')):undefined,'CampaignId':_0x24a57a['id']})[_0x2fef('0x28')](_0x240890());}}}});})[_0x2fef('0x21')](function(){return _0x4305ef['Campaign'][_0x2fef('0x39')]({'attributes':['id'],'include':[{'model':_0x4305ef[_0x2fef('0x35')],'as':'BlackLists','where':{'id':_0x2591ad[_0x2fef('0x25')]}}]})[_0x2fef('0x21')](function(_0x7caa75){if(_0x7caa75){var _0x4cf38c=[];for(var _0x2ec4f=0x0,_0xb8812c;_0x2ec4f<_0x7caa75[_0x2fef('0x3e')];_0x2ec4f+=0x1){_0xb8812c=_0x7caa75[_0x2ec4f]['get']({'plain':!![]});_0x4305ef[_0x2fef('0x3a')][_0x2fef('0x24')]({'phone':_0x2591ad[_0x2fef('0xa')],'ContactId':_0x2591ad['id'],'ListId':_0x2591ad[_0x2fef('0x25')],'CampaignId':_0xb8812c['id']})[_0x2fef('0x28')](function(_0xc0a570){logger[_0x2fef('0x13')](_0x2fef('0x3b'),_0x2fef('0x15'),_0xc0a570[_0x2fef('0x3c')]);});}}});})[_0x2fef('0x21')](function(){_0xea6fc1();})['catch'](function(_0x289721){logger['error'](_0x2fef('0x3b'),_0x2fef('0x15'),_0x289721[_0x2fef('0x3c')]);_0xea6fc1(_0x289721);});}else{_0xea6fc1(new Error(_0x2fef('0x3f')));}},'afterDestroy':function(_0x3af9bb,_0x464638,_0x5e4656){var _0x27d115=_0x24b849[_0x2fef('0x11')];var _0x16cff7=_0x3af9bb[_0x2fef('0x12')]({'plain':!![]});return _0x27d115['CmHopper'][_0x2fef('0x39')]({'raw':!![],'where':{'ListId':_0x16cff7[_0x2fef('0x25')],'ContactId':_0x16cff7['id']}})[_0x2fef('0x21')](function(_0x3620fb){if(!_[_0x2fef('0x40')](_0x3620fb)){var _0x2eb70b=[];for(var _0x4ff725=0x0;_0x4ff725<_0x3620fb[_0x2fef('0x3e')];_0x4ff725+=0x1){var _0x5d6c41=_0x27d115[_0x2fef('0x22')]['destroy']({'where':{'ListId':_0x3620fb[_0x4ff725][_0x2fef('0x25')],'ContactId':_0x3620fb[_0x4ff725]['ContactId'],'VoiceQueueId':_0x3620fb[_0x4ff725][_0x2fef('0x41')],'CampaignId':_0x3620fb[_0x4ff725]['CampaignId']}});_0x2eb70b[_0x2fef('0x42')](_0x5d6c41);}return BPromise['all'](_0x2eb70b);}})[_0x2fef('0x21')](function(_0x1e4a98){logger[_0x2fef('0x43')](_0x2fef('0x44'),util[_0x2fef('0x16')](_0x1e4a98,{'showHidden':![],'depth':null}));_0x5e4656();})[_0x2fef('0x28')](function(_0x3630d7){logger[_0x2fef('0x13')](_0x2fef('0x45'),util['inspect'](_0x3630d7,{'showHidden':![],'depth':null}));_0x5e4656(_0x3630d7);});}}});};
\ No newline at end of file
+var _0x00e4=['CmList','Lists','length','get','always','onlyIfOpen','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','message','List\x20not\x20found','isEmpty','destroy','ContactId','VoiceQueueId','push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','CmContact','phone','fti_cm_contacts','firstName','fax','email','utf8mb4','utf8mb4_unicode_ci','models','error','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','then','timezones','utcOffset','minutes','ret','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','catch','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','Campaign','add','\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','findAll','outbound','dialCheckDuplicateType'];(function(_0x578818,_0xd3b4ac){var _0x33aad8=function(_0x36946f){while(--_0x36946f){_0x578818['push'](_0x578818['shift']());}};_0x33aad8(++_0xd3b4ac);}(_0x00e4,0x1b8));var _0x400e=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x00e4[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0x400e('0x0'));var util=require(_0x400e('0x1'));var logger=require(_0x400e('0x2'))(_0x400e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x400e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x400e('0x5'));var config=require(_0x400e('0x6'));var shared=require('../../config/environment/shared');var attributes=require('./cmContact.attributes');module['exports']=function(_0x258554,_0x50e598){return _0x258554['define'](_0x400e('0x7'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':_0x400e('0x8'),'fields':[_0x400e('0x8')]},{'name':_0x400e('0x9'),'fields':[_0x400e('0xa'),'lastName',_0x400e('0x8'),'mobile',_0x400e('0xb'),_0x400e('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'charset':_0x400e('0xd'),'collate':_0x400e('0xe'),'hooks':{'afterCreate':function(_0xe59d88,_0x103bbd,_0x51cbbe){var _0x38ec1c=_0x258554[_0x400e('0xf')];var _0x28b612=_0xe59d88['get']({'plain':!![]});function _0x103850(){return function(_0x2643ef){logger[_0x400e('0x10')](_0x400e('0x11'),_0x400e('0x12'),util[_0x400e('0x13')](_0x2643ef,{'showHidden':![],'depth':null}));};}function _0x29665a(_0x36969f,_0x4d2491){var _0x28f909=_0x4d2491[_0x400e('0x14')]?_0x4d2491[_0x400e('0x14')]:moment()[_0x400e('0x15')](_0x400e('0x16'));return new BPromise(function(_0x388c24,_0x372751){if(_[_0x400e('0x17')](_0x4d2491[_0x400e('0x18')])){_0x388c24({'ret':_0x28f909});}else{_0x38ec1c[_0x400e('0x19')][_0x400e('0x1a')]({'where':{'id':_0x36969f['id']}})[_0x400e('0x1b')](function(_0x24fbfb){if(!_['isNil'](_0x24fbfb)){var _0x200d2b=_0x24fbfb['dialTimezone'];if(!_[_0x400e('0x17')](_0x200d2b)){var _0xfa7496=shared[_0x400e('0x1c')];var _0x3fdb93=_0xfa7496[_0x200d2b];var _0x574fd4=_0xfa7496[_0x4d2491['dialTimezone']];if(!_['isNil'](_0x3fdb93)&&!_[_0x400e('0x17')](_0x574fd4)){var _0x503967=_0x3fdb93[_0x400e('0x1d')]-_0x574fd4[_0x400e('0x1d')];_0x28f909=_0x4d2491['scheduledat']?_0x4d2491['scheduledat']:moment();var _0x4d0f27=moment(_0x28f909)['add'](_0x503967,_0x400e('0x1e'));_0x388c24({'ret':_0x4d0f27[_0x400e('0x15')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x388c24({'ret':_0x28f909});}else _0x388c24({'ret':_0x28f909});}else{_0x388c24({'ret':_0x28f909});}});}});return 0xa;}var _0x2db8ce=function(_0x110ad3){return new BPromise(function(_0x5eb6ed,_0x58e1c5){_0x29665a(_0x110ad3,_0x28b612)['then'](function(_0x5052bc){_0x28b612[_0x400e('0x14')]=_0x5052bc[_0x400e('0x1f')];_0x38ec1c[_0x400e('0x20')][_0x400e('0x1a')]({'where':{'phone':_0x28b612[_0x400e('0x8')],'VoiceQueueId':_0x110ad3['id']}})[_0x400e('0x1b')](function(_0x3151e1){if(!_[_0x400e('0x17')](_0x3151e1)){throw new Error(_0x400e('0x21')+_0x28b612[_0x400e('0x8')]+_0x400e('0x22')+_0x110ad3['id']);}return _0x38ec1c[_0x400e('0x20')][_0x400e('0x23')]({'phone':_0x28b612[_0x400e('0x8')],'ContactId':_0x28b612['id'],'ListId':_0x28b612[_0x400e('0x24')],'priority':_0x28b612[_0x400e('0x25')]?_0x28b612[_0x400e('0x25')]:0x2,'scheduledat':_0x28b612[_0x400e('0x14')]?_0x28b612[_0x400e('0x14')]:moment()['format'](_0x400e('0x16')),'callback':_0x28b612[_0x400e('0x26')]?!![]:![],'callbackuniqueid':_0x28b612[_0x400e('0x26')]?_0x28b612[_0x400e('0x26')]:undefined,'callbackat':_0x28b612[_0x400e('0x26')]?moment()[_0x400e('0x15')](_0x400e('0x16')):undefined,'VoiceQueueId':_0x110ad3['id']});})[_0x400e('0x27')](function(_0x523e23){_0x58e1c5(_0x523e23);});});});};var _0x2686e1=function(_0x1d37ba){return new BPromise(function(_0x394587,_0xeaeac9){_0x29665a(_0x1d37ba,_0x28b612)[_0x400e('0x1b')](function(_0x11b5bb){_0x28b612[_0x400e('0x14')]=_0x11b5bb[_0x400e('0x1f')];_0x38ec1c[_0x400e('0x20')]['findOne']({'where':{'phone':_0x28b612[_0x400e('0x8')],'VoiceQueueId':_0x1d37ba['id']}})['then'](function(_0x3e666a){if(!_['isNil'](_0x3e666a)){throw new Error(_0x400e('0x21')+_0x28b612[_0x400e('0x8')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x1d37ba['id']);}return _0x38ec1c['CmHopperFinal'][_0x400e('0x1a')]({'where':{'calleridnum':_0x28b612[_0x400e('0x8')],'VoiceQueueId':_0x1d37ba['id']}});})[_0x400e('0x1b')](function(_0x54972d){if(!_[_0x400e('0x17')](_0x54972d)){throw new Error(_0x400e('0x28')+_0x28b612[_0x400e('0x8')]+_0x400e('0x29')+_0x1d37ba['id']);}return _0x38ec1c[_0x400e('0x20')][_0x400e('0x23')]({'phone':_0x28b612[_0x400e('0x8')],'ContactId':_0x28b612['id'],'ListId':_0x28b612[_0x400e('0x24')],'priority':_0x28b612[_0x400e('0x25')]?_0x28b612['priority']:0x2,'scheduledat':_0x28b612[_0x400e('0x14')]?_0x28b612[_0x400e('0x14')]:moment()[_0x400e('0x15')](_0x400e('0x16')),'callback':_0x28b612['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x28b612[_0x400e('0x26')]?_0x28b612[_0x400e('0x26')]:undefined,'callbackat':_0x28b612[_0x400e('0x26')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x1d37ba['id']});})[_0x400e('0x27')](function(_0x50a2d8){_0xeaeac9(_0x50a2d8);});});});};function _0xfd209b(){return function(_0xbae664){logger[_0x400e('0x10')]('cmContact','afterCreate',util[_0x400e('0x13')](_0xbae664,{'showHidden':![],'depth':null}));};}function _0x41e1d0(_0x555add,_0x3d6e8f){var _0x214004=_0x3d6e8f['scheduledat']?_0x3d6e8f['scheduledat']:moment()[_0x400e('0x15')](_0x400e('0x16'));return new BPromise(function(_0x29fc7a,_0x391918){if(_[_0x400e('0x17')](_0x3d6e8f[_0x400e('0x18')])){_0x29fc7a({'ret':_0x214004});}else{_0x38ec1c[_0x400e('0x2a')][_0x400e('0x1a')]({'where':{'id':_0x555add['id']}})[_0x400e('0x1b')](function(_0x23cec4){if(!_[_0x400e('0x17')](_0x23cec4)){var _0x55ef61=_0x23cec4['dialTimezone'];if(!_['isNil'](_0x55ef61)){var _0x133c52=shared[_0x400e('0x1c')];var _0x53acb6=_0x133c52[_0x55ef61];var _0x5d10e5=_0x133c52[_0x3d6e8f[_0x400e('0x18')]];if(!_['isNil'](_0x53acb6)&&!_[_0x400e('0x17')](_0x5d10e5)){var _0x47e6b7=_0x53acb6['utcOffset']-_0x5d10e5[_0x400e('0x1d')];_0x214004=_0x3d6e8f[_0x400e('0x14')]?_0x3d6e8f[_0x400e('0x14')]:moment();var _0x3671a0=moment(_0x214004)[_0x400e('0x2b')](_0x47e6b7,_0x400e('0x1e'));_0x29fc7a({'ret':_0x3671a0[_0x400e('0x15')](_0x400e('0x16'))});}else _0x29fc7a({'ret':_0x214004});}else _0x29fc7a({'ret':_0x214004});}else{_0x29fc7a({'ret':_0x214004});}});}});return 0xa;}var _0x1265c7=function(_0x11dc17){return new BPromise(function(_0x285f3e,_0x2b1608){_0x41e1d0(_0x11dc17,_0x28b612)[_0x400e('0x1b')](function(_0x2e462e){_0x28b612[_0x400e('0x14')]=_0x2e462e[_0x400e('0x1f')];_0x38ec1c[_0x400e('0x20')][_0x400e('0x1a')]({'where':{'phone':_0x28b612[_0x400e('0x8')],'CampaignId':_0x11dc17['id']}})[_0x400e('0x1b')](function(_0x479c10){if(!_[_0x400e('0x17')](_0x479c10)){throw new Error(_0x400e('0x21')+_0x28b612[_0x400e('0x8')]+_0x400e('0x2c')+_0x11dc17['id']);}return _0x38ec1c[_0x400e('0x20')]['create']({'phone':_0x28b612['phone'],'ContactId':_0x28b612['id'],'ListId':_0x28b612[_0x400e('0x24')],'priority':_0x28b612[_0x400e('0x25')]?_0x28b612[_0x400e('0x25')]:0x2,'scheduledat':_0x28b612[_0x400e('0x14')]?_0x28b612['scheduledat']:moment()[_0x400e('0x15')](_0x400e('0x16')),'callback':_0x28b612[_0x400e('0x26')]?!![]:![],'callbackuniqueid':_0x28b612[_0x400e('0x26')]?_0x28b612[_0x400e('0x26')]:undefined,'callbackat':_0x28b612[_0x400e('0x26')]?moment()[_0x400e('0x15')](_0x400e('0x16')):undefined,'CampaignId':_0x11dc17['id']});})[_0x400e('0x27')](function(_0x49fb91){_0x2b1608(_0x49fb91);});});});};var _0x1200fc=function(_0xa0a57b){return new BPromise(function(_0x58449a,_0x1fafdb){_0x41e1d0(_0xa0a57b,_0x28b612)['then'](function(_0x329eb2){_0x28b612[_0x400e('0x14')]=_0x329eb2[_0x400e('0x1f')];_0x38ec1c[_0x400e('0x20')][_0x400e('0x1a')]({'where':{'phone':_0x28b612[_0x400e('0x8')],'CampaignId':_0xa0a57b['id']}})['then'](function(_0x1c9b21){if(!_['isNil'](_0x1c9b21)){throw new Error(_0x400e('0x21')+_0x28b612['phone']+_0x400e('0x2d')+_0xa0a57b['id']);}return _0x38ec1c[_0x400e('0x2e')][_0x400e('0x1a')]({'where':{'calleridnum':_0x28b612[_0x400e('0x8')],'CampaignId':_0xa0a57b['id']}});})[_0x400e('0x1b')](function(_0x458dab){if(!_[_0x400e('0x17')](_0x458dab)){throw new Error(_0x400e('0x28')+_0x28b612[_0x400e('0x8')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0xa0a57b['id']);}return _0x38ec1c[_0x400e('0x20')][_0x400e('0x23')]({'phone':_0x28b612[_0x400e('0x8')],'ContactId':_0x28b612['id'],'ListId':_0x28b612[_0x400e('0x24')],'priority':_0x28b612[_0x400e('0x25')]?_0x28b612[_0x400e('0x25')]:0x2,'scheduledat':_0x28b612[_0x400e('0x14')]?_0x28b612[_0x400e('0x14')]:moment()[_0x400e('0x15')](_0x400e('0x16')),'callback':_0x28b612[_0x400e('0x26')]?!![]:![],'callbackuniqueid':_0x28b612['callbackUniqueid']?_0x28b612[_0x400e('0x26')]:undefined,'callbackat':_0x28b612[_0x400e('0x26')]?moment()[_0x400e('0x15')](_0x400e('0x16')):undefined,'CampaignId':_0xa0a57b['id']});})[_0x400e('0x27')](function(_0xa9b58){_0x1fafdb(_0xa9b58);});});});};if(_0x28b612['ListId']){_0x38ec1c[_0x400e('0x19')][_0x400e('0x2f')]({'where':{'type':_0x400e('0x30')},'attributes':['id',_0x400e('0x31'),_0x400e('0x18')],'include':[{'model':_0x38ec1c[_0x400e('0x32')],'as':_0x400e('0x33'),'where':{'id':_0x28b612[_0x400e('0x24')]}}]})['then'](function(_0x5e0ff0){if(_0x5e0ff0){var _0x47c1b3=[];for(var _0x463bb4=0x0,_0x3fee94;_0x463bb4<_0x5e0ff0[_0x400e('0x34')];_0x463bb4+=0x1){_0x3fee94=_0x5e0ff0[_0x463bb4][_0x400e('0x35')]({'plain':!![]});switch(_0x3fee94[_0x400e('0x31')]){case _0x400e('0x36'):_0x2686e1(_0x3fee94)[_0x400e('0x27')](_0x103850());break;case _0x400e('0x37'):_0x2db8ce(_0x3fee94)[_0x400e('0x27')](_0x103850());break;default:_0x41e1d0(_0x3fee94,_0x28b612)[_0x400e('0x1b')](function(_0x28ff21){_0x28b612[_0x400e('0x14')]=_0x28ff21[_0x400e('0x1f')];_0x38ec1c[_0x400e('0x20')]['create']({'phone':_0x28b612[_0x400e('0x8')],'ContactId':_0x28b612['id'],'ListId':_0x28b612[_0x400e('0x24')],'scheduledat':_0x28b612[_0x400e('0x14')]?_0x28b612[_0x400e('0x14')]:moment()[_0x400e('0x15')](_0x400e('0x16')),'priority':_0x28b612[_0x400e('0x25')]?_0x28b612[_0x400e('0x25')]:0x2,'callback':_0x28b612[_0x400e('0x26')]?!![]:![],'callbackuniqueid':_0x28b612['callbackUniqueid']?_0x28b612[_0x400e('0x26')]:undefined,'callbackat':_0x28b612[_0x400e('0x26')]?moment()[_0x400e('0x15')](_0x400e('0x16')):undefined,'VoiceQueueId':_0x3fee94['id']})[_0x400e('0x27')](_0x103850());});}}}})[_0x400e('0x1b')](function(){return _0x38ec1c['VoiceQueue'][_0x400e('0x2f')]({'where':{'type':_0x400e('0x30')},'attributes':['id'],'include':[{'model':_0x38ec1c[_0x400e('0x32')],'as':_0x400e('0x38'),'where':{'id':_0x28b612[_0x400e('0x24')]}}]})[_0x400e('0x1b')](function(_0x2ff041){if(_0x2ff041){var _0x3126a5=[];for(var _0x427e0e=0x0,_0x781548;_0x427e0e<_0x2ff041[_0x400e('0x34')];_0x427e0e+=0x1){_0x781548=_0x2ff041[_0x427e0e][_0x400e('0x35')]({'plain':!![]});_0x38ec1c[_0x400e('0x39')][_0x400e('0x23')]({'phone':_0x28b612[_0x400e('0x8')],'ContactId':_0x28b612['id'],'ListId':_0x28b612['ListId'],'VoiceQueueId':_0x781548['id']})['catch'](function(_0x3773ec){logger['error'](_0x400e('0x3a'),_0x400e('0x12'),_0x3773ec[_0x400e('0x3b')]);});}}});})[_0x400e('0x1b')](function(){return _0x38ec1c['Campaign'][_0x400e('0x2f')]({'attributes':['id','dialCheckDuplicateType',_0x400e('0x18')],'include':[{'model':_0x38ec1c[_0x400e('0x32')],'as':'Lists','where':{'id':_0x28b612[_0x400e('0x24')]}}]})['then'](function(_0x331866){if(_0x331866){var _0x16e88d=[];for(var _0x1004ec=0x0,_0x38e922;_0x1004ec<_0x331866[_0x400e('0x34')];_0x1004ec+=0x1){_0x38e922=_0x331866[_0x1004ec][_0x400e('0x35')]({'plain':!![]});switch(_0x38e922[_0x400e('0x31')]){case _0x400e('0x36'):_0x1200fc(_0x38e922)['catch'](_0xfd209b());break;case _0x400e('0x37'):_0x1265c7(_0x38e922)[_0x400e('0x27')](_0xfd209b());break;default:_0x38ec1c[_0x400e('0x20')][_0x400e('0x23')]({'phone':_0x28b612[_0x400e('0x8')],'ContactId':_0x28b612['id'],'ListId':_0x28b612['ListId'],'scheduledat':_0x28b612[_0x400e('0x14')]?_0x28b612['scheduledat']:moment()[_0x400e('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x28b612['priority']?_0x28b612['priority']:0x2,'callback':_0x28b612['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x28b612['callbackUniqueid']?_0x28b612[_0x400e('0x26')]:undefined,'callbackat':_0x28b612[_0x400e('0x26')]?moment()[_0x400e('0x15')](_0x400e('0x16')):undefined,'CampaignId':_0x38e922['id']})[_0x400e('0x27')](_0xfd209b());}}}});})['then'](function(){return _0x38ec1c[_0x400e('0x2a')][_0x400e('0x2f')]({'attributes':['id'],'include':[{'model':_0x38ec1c[_0x400e('0x32')],'as':'BlackLists','where':{'id':_0x28b612[_0x400e('0x24')]}}]})[_0x400e('0x1b')](function(_0x15438d){if(_0x15438d){var _0x11b6af=[];for(var _0x305eac=0x0,_0x27ce89;_0x305eac<_0x15438d[_0x400e('0x34')];_0x305eac+=0x1){_0x27ce89=_0x15438d[_0x305eac][_0x400e('0x35')]({'plain':!![]});_0x38ec1c[_0x400e('0x39')][_0x400e('0x23')]({'phone':_0x28b612[_0x400e('0x8')],'ContactId':_0x28b612['id'],'ListId':_0x28b612['ListId'],'CampaignId':_0x27ce89['id']})[_0x400e('0x27')](function(_0x1ae1f4){logger['error'](_0x400e('0x3a'),_0x400e('0x12'),_0x1ae1f4[_0x400e('0x3b')]);});}}});})[_0x400e('0x1b')](function(){_0x51cbbe();})[_0x400e('0x27')](function(_0x1bd82e){logger[_0x400e('0x10')](_0x400e('0x3a'),_0x400e('0x12'),_0x1bd82e[_0x400e('0x3b')]);_0x51cbbe(_0x1bd82e);});}else{_0x51cbbe(new Error(_0x400e('0x3c')));}},'afterDestroy':function(_0xdb1abf,_0x293c2d,_0x4990f5){var _0x31c63d=_0x258554[_0x400e('0xf')];var _0x332328=_0xdb1abf[_0x400e('0x35')]({'plain':!![]});return _0x31c63d[_0x400e('0x20')][_0x400e('0x2f')]({'raw':!![],'where':{'ListId':_0x332328[_0x400e('0x24')],'ContactId':_0x332328['id']}})['then'](function(_0x1d15d8){if(!_[_0x400e('0x3d')](_0x1d15d8)){var _0x5495be=[];for(var _0x12c020=0x0;_0x12c020<_0x1d15d8[_0x400e('0x34')];_0x12c020+=0x1){var _0x35276d=_0x31c63d[_0x400e('0x20')][_0x400e('0x3e')]({'where':{'ListId':_0x1d15d8[_0x12c020][_0x400e('0x24')],'ContactId':_0x1d15d8[_0x12c020][_0x400e('0x3f')],'VoiceQueueId':_0x1d15d8[_0x12c020][_0x400e('0x40')],'CampaignId':_0x1d15d8[_0x12c020]['CampaignId']}});_0x5495be[_0x400e('0x41')](_0x35276d);}return BPromise[_0x400e('0x42')](_0x5495be);}})[_0x400e('0x1b')](function(_0x120b58){logger[_0x400e('0x43')](_0x400e('0x44'),util[_0x400e('0x13')](_0x120b58,{'showHidden':![],'depth':null}));_0x4990f5();})['catch'](function(_0xd7cb87){logger[_0x400e('0x10')](_0x400e('0x45'),util[_0x400e('0x13')](_0xd7cb87,{'showHidden':![],'depth':null}));_0x4990f5(_0xd7cb87);});}}});};
\ No newline at end of file
index 25ef71e..f3893c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd99=['debug','request\x20sent','stringify','error','CmContact,\x20%s,\x20%s','message','result','catch','GetCmContact','CmContact','options','raw','where','limit','include','map','model','attributes','CreateCmContact','create','body','keys','startsWith','cf_','update','table','cm_contacts','id\x20=\x20?','toString','sequelize','lodash','util','moment','bluebird','randomstring','ioredis','squel','../../config/utils','client','defaults','redis','localhost','socket.io-emitter','./cmContact.socket','register','request','then','info'];(function(_0x2705ba,_0x1a27d4){var _0xffaa5=function(_0x60cff1){while(--_0x60cff1){_0x2705ba['push'](_0x2705ba['shift']());}};_0xffaa5(++_0x1a27d4);}(_0xdd99,0x13e));var _0x9dd9=function(_0x302c73,_0x10b571){_0x302c73=_0x302c73-0x0;var _0x4a3159=_0xdd99[_0x302c73];return _0x4a3159;};'use strict';var _=require(_0x9dd9('0x0'));var util=require(_0x9dd9('0x1'));var moment=require(_0x9dd9('0x2'));var BPromise=require(_0x9dd9('0x3'));var rs=require(_0x9dd9('0x4'));var fs=require('fs');var Redis=require(_0x9dd9('0x5'));var squel=require(_0x9dd9('0x6'));var db=require('../../mysqldb')['db'];var utils=require(_0x9dd9('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9dd9('0x8')]['http']({'port':0x232a});config['redis']=_[_0x9dd9('0x9')](config[_0x9dd9('0xa')],{'host':_0x9dd9('0xb'),'port':0x18eb});var socket=require(_0x9dd9('0xc'))(new Redis(config[_0x9dd9('0xa')]));require(_0x9dd9('0xd'))[_0x9dd9('0xe')](socket);function respondWithRpcPromise(_0xa66ec7,_0x348818,_0x586da0){return new BPromise(function(_0x26b744,_0x20106d){return client[_0x9dd9('0xf')](_0xa66ec7,_0x586da0)[_0x9dd9('0x10')](function(_0x3efde4){logger[_0x9dd9('0x11')]('CmContact,\x20%s,\x20%s',_0x348818,'request\x20sent');logger[_0x9dd9('0x12')]('CmContact,\x20%s,\x20%s,\x20%s',_0x348818,_0x9dd9('0x13'),JSON[_0x9dd9('0x14')](_0x3efde4));if(_0x3efde4[_0x9dd9('0x15')]){if(_0x3efde4[_0x9dd9('0x15')]['code']===0x1f4){logger['error'](_0x9dd9('0x16'),_0x348818,_0x3efde4[_0x9dd9('0x15')][_0x9dd9('0x17')]);return _0x20106d(_0x3efde4['error'][_0x9dd9('0x17')]);}logger['error']('CmContact,\x20%s,\x20%s',_0x348818,_0x3efde4[_0x9dd9('0x15')][_0x9dd9('0x17')]);return _0x26b744(_0x3efde4[_0x9dd9('0x15')][_0x9dd9('0x17')]);}else{logger[_0x9dd9('0x11')](_0x9dd9('0x16'),_0x348818,_0x9dd9('0x13'));_0x26b744(_0x3efde4[_0x9dd9('0x18')]['message']);}})[_0x9dd9('0x19')](function(_0x15029d){logger[_0x9dd9('0x15')](_0x9dd9('0x16'),_0x348818,_0x15029d);_0x20106d(_0x15029d);});});}exports[_0x9dd9('0x1a')]=function(_0x407782){var _0x5a545b=this;return new Promise(function(_0x224bd8,_0x3b88fe){return db[_0x9dd9('0x1b')]['findAll']({'raw':_0x407782[_0x9dd9('0x1c')]?_0x407782[_0x9dd9('0x1c')][_0x9dd9('0x1d')]===undefined?!![]:![]:!![],'where':_0x407782['options']?_0x407782[_0x9dd9('0x1c')][_0x9dd9('0x1e')]||null:null,'attributes':_0x407782[_0x9dd9('0x1c')]?_0x407782['options']['attributes']||null:null,'limit':_0x407782['options']?_0x407782[_0x9dd9('0x1c')][_0x9dd9('0x1f')]||null:null,'include':_0x407782[_0x9dd9('0x1c')]?_0x407782[_0x9dd9('0x1c')][_0x9dd9('0x20')]?_[_0x9dd9('0x21')](_0x407782[_0x9dd9('0x1c')][_0x9dd9('0x20')],function(_0x48760a){return{'model':db[_0x48760a[_0x9dd9('0x22')]],'as':_0x48760a['as'],'attributes':_0x48760a[_0x9dd9('0x23')],'include':_0x48760a['include']?_[_0x9dd9('0x21')](_0x48760a[_0x9dd9('0x20')],function(_0x2410bd){return{'model':db[_0x2410bd[_0x9dd9('0x22')]],'as':_0x2410bd['as'],'attributes':_0x2410bd['attributes'],'include':_0x2410bd['include']?_['map'](_0x2410bd['include'],function(_0x551fbb){return{'model':db[_0x551fbb[_0x9dd9('0x22')]],'as':_0x551fbb['as'],'attributes':_0x551fbb['attributes']};}):[]};}):[]};}):[]:[]})[_0x9dd9('0x10')](function(_0x5ad62b){logger[_0x9dd9('0x11')]('GetCmContact',_0x407782);logger[_0x9dd9('0x12')](_0x9dd9('0x1a'),_0x407782,JSON[_0x9dd9('0x14')](_0x5ad62b));_0x224bd8(_0x5ad62b);})['catch'](function(_0x1b7090){logger[_0x9dd9('0x15')](_0x9dd9('0x1a'),_0x1b7090[_0x9dd9('0x17')],_0x407782);_0x3b88fe(_0x5a545b[_0x9dd9('0x15')](0x1f4,_0x1b7090[_0x9dd9('0x17')]));});});};exports[_0x9dd9('0x24')]=function(_0x16dd1c){var _0x5c78a=this;return new Promise(function(_0x238449,_0x30a8aa){return db[_0x9dd9('0x1b')][_0x9dd9('0x25')](_0x16dd1c[_0x9dd9('0x26')],{'raw':_0x16dd1c[_0x9dd9('0x1c')]?_0x16dd1c['options'][_0x9dd9('0x1d')]===undefined?!![]:![]:!![]})[_0x9dd9('0x10')](function(_0x9004c6){var _0x3ec120;for(var _0x5d3327=0x0;_0x5d3327<Object[_0x9dd9('0x27')](_0x16dd1c[_0x9dd9('0x26')])['length'];_0x5d3327++){var _0x5128c9=Object[_0x9dd9('0x27')](_0x16dd1c[_0x9dd9('0x26')])[_0x5d3327];if(_0x5128c9[_0x9dd9('0x28')](_0x9dd9('0x29'))){_0x3ec120=squel[_0x9dd9('0x2a')]()[_0x9dd9('0x2b')](_0x9dd9('0x2c'))['set'](_0x5128c9,_0x16dd1c['body'][_0x5128c9])[_0x9dd9('0x1e')](_0x9dd9('0x2d'),_0x9004c6['id'])[_0x9dd9('0x2e')]();break;}}if(!_0x3ec120)return _0x9004c6;return db[_0x9dd9('0x2f')]['query'](_0x3ec120)[_0x9dd9('0x10')](function(){return _0x9004c6;});})['then'](function(_0x4f4c33){logger[_0x9dd9('0x11')]('CreateCmContact',_0x16dd1c);logger[_0x9dd9('0x12')](_0x9dd9('0x24'),_0x16dd1c,JSON['stringify'](_0x4f4c33));_0x238449(_0x4f4c33);})[_0x9dd9('0x19')](function(_0x3a34dc){logger[_0x9dd9('0x15')](_0x9dd9('0x24'),_0x3a34dc[_0x9dd9('0x17')],_0x16dd1c);_0x30a8aa(_0x5c78a[_0x9dd9('0x15')](0x1f4,_0x3a34dc[_0x9dd9('0x17')]));});});};
\ No newline at end of file
+var _0x7738=['attributes','CreateCmContact','create','body','keys','startsWith','cf_','update','table','cm_contacts','set','id\x20=\x20?','toString','sequelize','query','then','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','jayson/promise','client','redis','socket.io-emitter','request','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetCmContact','CmContact','findAll','options','raw','where','limit','include','map','model'];(function(_0x9cfe28,_0x1a335c){var _0x54a1d0=function(_0x46bc02){while(--_0x46bc02){_0x9cfe28['push'](_0x9cfe28['shift']());}};_0x54a1d0(++_0x1a335c);}(_0x7738,0x160));var _0x8773=function(_0x28beaf,_0x122959){_0x28beaf=_0x28beaf-0x0;var _0x2df201=_0x7738[_0x28beaf];return _0x2df201;};'use strict';var _=require(_0x8773('0x0'));var util=require(_0x8773('0x1'));var moment=require(_0x8773('0x2'));var BPromise=require(_0x8773('0x3'));var rs=require(_0x8773('0x4'));var fs=require('fs');var Redis=require('ioredis');var squel=require('squel');var db=require(_0x8773('0x5'))['db'];var utils=require(_0x8773('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8773('0x7'));var client=jayson[_0x8773('0x8')]['http']({'port':0x232a});config[_0x8773('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8773('0xa'))(new Redis(config[_0x8773('0x9')]));require('./cmContact.socket')['register'](socket);function respondWithRpcPromise(_0x10f86c,_0x454595,_0x1c0dd4){return new BPromise(function(_0x1bff96,_0x5550cf){return client[_0x8773('0xb')](_0x10f86c,_0x1c0dd4)['then'](function(_0x4391b3){logger[_0x8773('0xc')](_0x8773('0xd'),_0x454595,_0x8773('0xe'));logger[_0x8773('0xf')](_0x8773('0x10'),_0x454595,_0x8773('0xe'),JSON[_0x8773('0x11')](_0x4391b3));if(_0x4391b3[_0x8773('0x12')]){if(_0x4391b3[_0x8773('0x12')][_0x8773('0x13')]===0x1f4){logger[_0x8773('0x12')](_0x8773('0xd'),_0x454595,_0x4391b3['error'][_0x8773('0x14')]);return _0x5550cf(_0x4391b3['error'][_0x8773('0x14')]);}logger[_0x8773('0x12')](_0x8773('0xd'),_0x454595,_0x4391b3[_0x8773('0x12')][_0x8773('0x14')]);return _0x1bff96(_0x4391b3[_0x8773('0x12')]['message']);}else{logger[_0x8773('0xc')](_0x8773('0xd'),_0x454595,_0x8773('0xe'));_0x1bff96(_0x4391b3['result'][_0x8773('0x14')]);}})[_0x8773('0x15')](function(_0x3018d5){logger[_0x8773('0x12')]('CmContact,\x20%s,\x20%s',_0x454595,_0x3018d5);_0x5550cf(_0x3018d5);});});}exports[_0x8773('0x16')]=function(_0x177897){var _0x25c0f3=this;return new Promise(function(_0x2063a7,_0x32a503){return db[_0x8773('0x17')][_0x8773('0x18')]({'raw':_0x177897[_0x8773('0x19')]?_0x177897[_0x8773('0x19')][_0x8773('0x1a')]===undefined?!![]:![]:!![],'where':_0x177897[_0x8773('0x19')]?_0x177897[_0x8773('0x19')][_0x8773('0x1b')]||null:null,'attributes':_0x177897['options']?_0x177897[_0x8773('0x19')]['attributes']||null:null,'limit':_0x177897[_0x8773('0x19')]?_0x177897['options'][_0x8773('0x1c')]||null:null,'include':_0x177897[_0x8773('0x19')]?_0x177897[_0x8773('0x19')][_0x8773('0x1d')]?_[_0x8773('0x1e')](_0x177897[_0x8773('0x19')]['include'],function(_0x42e06a){return{'model':db[_0x42e06a[_0x8773('0x1f')]],'as':_0x42e06a['as'],'attributes':_0x42e06a['attributes'],'include':_0x42e06a[_0x8773('0x1d')]?_['map'](_0x42e06a['include'],function(_0x18a793){return{'model':db[_0x18a793[_0x8773('0x1f')]],'as':_0x18a793['as'],'attributes':_0x18a793[_0x8773('0x20')],'include':_0x18a793[_0x8773('0x1d')]?_[_0x8773('0x1e')](_0x18a793[_0x8773('0x1d')],function(_0xd40c6c){return{'model':db[_0xd40c6c[_0x8773('0x1f')]],'as':_0xd40c6c['as'],'attributes':_0xd40c6c[_0x8773('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x28f7b9){logger[_0x8773('0xc')]('GetCmContact',_0x177897);logger[_0x8773('0xf')](_0x8773('0x16'),_0x177897,JSON[_0x8773('0x11')](_0x28f7b9));_0x2063a7(_0x28f7b9);})[_0x8773('0x15')](function(_0xcbb72c){logger[_0x8773('0x12')](_0x8773('0x16'),_0xcbb72c[_0x8773('0x14')],_0x177897);_0x32a503(_0x25c0f3[_0x8773('0x12')](0x1f4,_0xcbb72c[_0x8773('0x14')]));});});};exports[_0x8773('0x21')]=function(_0x4626fd){var _0x40a5b4=this;return new Promise(function(_0x33774a,_0x38bf13){return db['CmContact'][_0x8773('0x22')](_0x4626fd[_0x8773('0x23')],{'raw':_0x4626fd[_0x8773('0x19')]?_0x4626fd[_0x8773('0x19')][_0x8773('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x550c93){var _0x45fe80;for(var _0x16d295=0x0;_0x16d295<Object[_0x8773('0x24')](_0x4626fd[_0x8773('0x23')])['length'];_0x16d295++){var _0x3e595e=Object[_0x8773('0x24')](_0x4626fd['body'])[_0x16d295];if(_0x3e595e[_0x8773('0x25')](_0x8773('0x26'))){_0x45fe80=squel[_0x8773('0x27')]()[_0x8773('0x28')](_0x8773('0x29'))[_0x8773('0x2a')](_0x3e595e,_0x4626fd[_0x8773('0x23')][_0x3e595e])[_0x8773('0x1b')](_0x8773('0x2b'),_0x550c93['id'])[_0x8773('0x2c')]();break;}}if(!_0x45fe80)return _0x550c93;return db[_0x8773('0x2d')][_0x8773('0x2e')](_0x45fe80)[_0x8773('0x2f')](function(){return _0x550c93;});})[_0x8773('0x2f')](function(_0x4bfae9){logger[_0x8773('0xc')]('CreateCmContact',_0x4626fd);logger[_0x8773('0xf')]('CreateCmContact',_0x4626fd,JSON[_0x8773('0x11')](_0x4bfae9));_0x33774a(_0x4bfae9);})[_0x8773('0x15')](function(_0x4f5444){logger[_0x8773('0x12')](_0x8773('0x21'),_0x4f5444['message'],_0x4626fd);_0x38bf13(_0x40a5b4[_0x8773('0x12')](0x1f4,_0x4f5444[_0x8773('0x14')]));});});};
\ No newline at end of file
index a7f28f5..d73c1e8 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(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'use strict';var CmContactEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){CmContactEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);CmContactEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
+var _0xa9e0=['register','length','cmContact:','./cmContact.events','save','remove','emit','removeListener'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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 569a31c..5b82f7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9689=['/describe','/:id/tags','getTags','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','/merge','merge','/create_many','bulkCreate','setTags','diskStorage','join','root','originalname','format','%s-%s%s','extname','now','/csv','single','file','uploadCsv','server/files/tmp','basename','/upload','upload','/upload/:id','import','put','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','isAuthenticated','index'];(function(_0x7b8a87,_0x2f2523){var _0x2131a1=function(_0x856847){while(--_0x856847){_0x7b8a87['push'](_0x7b8a87['shift']());}};_0x2131a1(++_0x2f2523);}(_0x9689,0xef));var _0x9968=function(_0xc9c6c7,_0x5484c6){_0xc9c6c7=_0xc9c6c7-0x0;var _0x2b37b7=_0x9689[_0xc9c6c7];return _0x2b37b7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9968('0x0'));var timeout=require(_0x9968('0x1'));var express=require(_0x9968('0x2'));var router=express[_0x9968('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9968('0x4'));var interaction=require(_0x9968('0x5'));var config=require(_0x9968('0x6'));var controller=require(_0x9968('0x7'));router[_0x9968('0x8')]('/',auth[_0x9968('0x9')](),controller[_0x9968('0xa')]);router['get'](_0x9968('0xb'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x9968('0x9')](),controller['show']);router[_0x9968('0x8')](_0x9968('0xc'),auth['isAuthenticated'](),controller[_0x9968('0xd')]);router[_0x9968('0x8')]('/:id/hoppers',auth[_0x9968('0x9')](),controller['getHoppers']);router[_0x9968('0x8')]('/:id/hopper_histories',auth[_0x9968('0x9')](),controller[_0x9968('0xe')]);router[_0x9968('0x8')](_0x9968('0xf'),auth[_0x9968('0x9')](),controller[_0x9968('0x10')]);router[_0x9968('0x8')](_0x9968('0x11'),auth[_0x9968('0x9')](),controller[_0x9968('0x12')]);router[_0x9968('0x8')](_0x9968('0x13'),auth[_0x9968('0x9')](),controller[_0x9968('0x14')]);router[_0x9968('0x15')](_0x9968('0x16'),auth[_0x9968('0x9')](),controller[_0x9968('0x17')]);router[_0x9968('0x15')]('/',auth[_0x9968('0x9')](),controller['create']);router['post'](_0x9968('0x18'),auth[_0x9968('0x9')](),controller[_0x9968('0x19')]);router[_0x9968('0x15')](_0x9968('0xc'),auth[_0x9968('0x9')](),controller[_0x9968('0x1a')]);var upload=multer({'storage':multer[_0x9968('0x1b')]({'destination':function(_0x517ee5,_0x5610fc,_0x58e5dd){_0x58e5dd(null,path[_0x9968('0x1c')](config[_0x9968('0x1d')],'server/files/tmp'));},'filename':function(_0x456dad,_0x292a37,_0x5c4fcf){_0x292a37[_0x9968('0x1e')]=_0x292a37[_0x9968('0x1e')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5c4fcf(null,util[_0x9968('0x1f')](_0x9968('0x20'),path['basename'](_0x292a37[_0x9968('0x1e')],path[_0x9968('0x21')](_0x292a37['originalname'])),Date[_0x9968('0x22')](),path[_0x9968('0x21')](_0x292a37[_0x9968('0x1e')])));}})});router[_0x9968('0x15')](_0x9968('0x23'),upload[_0x9968('0x24')](_0x9968('0x25')),controller[_0x9968('0x26')]);var upload=multer({'storage':multer[_0x9968('0x1b')]({'destination':function(_0xc97cd6,_0x1afdae,_0x5e3162){_0x5e3162(null,path[_0x9968('0x1c')](config[_0x9968('0x1d')],_0x9968('0x27')));},'filename':function(_0x119540,_0x57b369,_0x1ca403){_0x57b369[_0x9968('0x1e')]=_0x57b369[_0x9968('0x1e')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1ca403(null,util[_0x9968('0x1f')](_0x9968('0x20'),path[_0x9968('0x28')](_0x57b369[_0x9968('0x1e')],path[_0x9968('0x21')](_0x57b369['originalname'])),Date[_0x9968('0x22')](),path['extname'](_0x57b369['originalname'])));}})});router[_0x9968('0x15')](_0x9968('0x29'),upload[_0x9968('0x24')]('file'),controller[_0x9968('0x2a')]);router[_0x9968('0x15')](_0x9968('0x2b'),auth['isAuthenticated'](),controller[_0x9968('0x2c')]);router[_0x9968('0x2d')]('/:id',auth[_0x9968('0x9')](),controller[_0x9968('0x2e')]);router[_0x9968('0x2f')]('/:id',auth[_0x9968('0x9')](),controller[_0x9968('0x30')]);module[_0x9968('0x31')]=router;
\ No newline at end of file
+var _0xeb45=['diskStorage','join','root','server/files/tmp','originalname','replace','format','%s-%s%s','extname','/csv','single','file','uploadCsv','basename','now','/upload','upload','/upload/:id','import','put','/:id','update','delete','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cmContact.controller','isAuthenticated','get','/describe','show','/:id/tags','getTags','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/journey','getJourney','post','/merge','merge','create','/create_many','bulkCreate','setTags'];(function(_0xf60ed4,_0x2f591c){var _0x4073cf=function(_0x3160b3){while(--_0x3160b3){_0xf60ed4['push'](_0xf60ed4['shift']());}};_0x4073cf(++_0x2f591c);}(_0xeb45,0x7e));var _0x5eb4=function(_0x6bd386,_0x7ed37c){_0x6bd386=_0x6bd386-0x0;var _0x4556c2=_0xeb45[_0x6bd386];return _0x4556c2;};'use strict';var multer=require('multer');var util=require(_0x5eb4('0x0'));var path=require('path');var timeout=require(_0x5eb4('0x1'));var express=require(_0x5eb4('0x2'));var router=express[_0x5eb4('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5eb4('0x4'));var config=require(_0x5eb4('0x5'));var controller=require(_0x5eb4('0x6'));router['get']('/',auth[_0x5eb4('0x7')](),controller['index']);router[_0x5eb4('0x8')](_0x5eb4('0x9'),auth[_0x5eb4('0x7')](),controller['describe']);router[_0x5eb4('0x8')]('/:id',auth[_0x5eb4('0x7')](),controller[_0x5eb4('0xa')]);router[_0x5eb4('0x8')](_0x5eb4('0xb'),auth['isAuthenticated'](),controller[_0x5eb4('0xc')]);router['get'](_0x5eb4('0xd'),auth[_0x5eb4('0x7')](),controller['getHoppers']);router[_0x5eb4('0x8')](_0x5eb4('0xe'),auth[_0x5eb4('0x7')](),controller[_0x5eb4('0xf')]);router[_0x5eb4('0x8')](_0x5eb4('0x10'),auth[_0x5eb4('0x7')](),controller[_0x5eb4('0x11')]);router['get']('/:id/jscripty_sessions',auth[_0x5eb4('0x7')](),controller['getJscriptySessions']);router[_0x5eb4('0x8')](_0x5eb4('0x12'),auth['isAuthenticated'](),controller[_0x5eb4('0x13')]);router[_0x5eb4('0x14')](_0x5eb4('0x15'),auth['isAuthenticated'](),controller[_0x5eb4('0x16')]);router[_0x5eb4('0x14')]('/',auth[_0x5eb4('0x7')](),controller[_0x5eb4('0x17')]);router[_0x5eb4('0x14')](_0x5eb4('0x18'),auth[_0x5eb4('0x7')](),controller[_0x5eb4('0x19')]);router[_0x5eb4('0x14')]('/:id/tags',auth[_0x5eb4('0x7')](),controller[_0x5eb4('0x1a')]);var upload=multer({'storage':multer[_0x5eb4('0x1b')]({'destination':function(_0x115b4f,_0x4e6e2d,_0x35f3e6){_0x35f3e6(null,path[_0x5eb4('0x1c')](config[_0x5eb4('0x1d')],_0x5eb4('0x1e')));},'filename':function(_0x416786,_0x389d81,_0x37d6d6){_0x389d81[_0x5eb4('0x1f')]=_0x389d81[_0x5eb4('0x1f')][_0x5eb4('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x37d6d6(null,util[_0x5eb4('0x21')](_0x5eb4('0x22'),path['basename'](_0x389d81[_0x5eb4('0x1f')],path[_0x5eb4('0x23')](_0x389d81['originalname'])),Date['now'](),path[_0x5eb4('0x23')](_0x389d81['originalname'])));}})});router[_0x5eb4('0x14')](_0x5eb4('0x24'),upload[_0x5eb4('0x25')](_0x5eb4('0x26')),controller[_0x5eb4('0x27')]);var upload=multer({'storage':multer[_0x5eb4('0x1b')]({'destination':function(_0x2d05e2,_0xd1949d,_0xe956fc){_0xe956fc(null,path[_0x5eb4('0x1c')](config[_0x5eb4('0x1d')],_0x5eb4('0x1e')));},'filename':function(_0x405649,_0x27fd6c,_0x142481){_0x27fd6c[_0x5eb4('0x1f')]=_0x27fd6c['originalname'][_0x5eb4('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x142481(null,util['format'](_0x5eb4('0x22'),path[_0x5eb4('0x28')](_0x27fd6c['originalname'],path['extname'](_0x27fd6c[_0x5eb4('0x1f')])),Date[_0x5eb4('0x29')](),path[_0x5eb4('0x23')](_0x27fd6c[_0x5eb4('0x1f')])));}})});router['post'](_0x5eb4('0x2a'),upload['single']('file'),controller[_0x5eb4('0x2b')]);router[_0x5eb4('0x14')](_0x5eb4('0x2c'),auth['isAuthenticated'](),controller[_0x5eb4('0x2d')]);router[_0x5eb4('0x2e')](_0x5eb4('0x2f'),auth[_0x5eb4('0x7')](),controller[_0x5eb4('0x30')]);router[_0x5eb4('0x31')](_0x5eb4('0x2f'),auth[_0x5eb4('0x7')](),controller['destroy']);module[_0x5eb4('0x32')]=router;
\ No newline at end of file
index 92f1b20..10a7078 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a26=['TEXT','long','getDataValue','type','values','isArray','setDataValue','BOOLEAN','sequelize','lodash','exports','VIRTUAL','STRING','alias','name'];(function(_0x4cab0b,_0x19312b){var _0x3cfde5=function(_0x4015a8){while(--_0x4015a8){_0x4cab0b['push'](_0x4cab0b['shift']());}};_0x3cfde5(++_0x19312b);}(_0x6a26,0x1ac));var _0x66a2=function(_0x40e6f3,_0x4e5815){_0x40e6f3=_0x40e6f3-0x0;var _0x40da18=_0x6a26[_0x40e6f3];return _0x40da18;};'use strict';var Sequelize=require(_0x66a2('0x0'));var _=require(_0x66a2('0x1'));module[_0x66a2('0x2')]={'name':{'type':Sequelize[_0x66a2('0x3')],'get':function(_0xde261e){return this['getDataValue']('alias');}},'alias':{'type':Sequelize[_0x66a2('0x4')],'allowNull':![],'set':function(_0x3776d3){this['setDataValue'](_0x66a2('0x5'),_0x3776d3?_0x3776d3:this['getDataValue'](_0x66a2('0x6')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x66a2('0x7')](_0x66a2('0x8')),'get':function(){if(this[_0x66a2('0x9')](_0x66a2('0xa'))==='select'){return JSON['parse'](this['getDataValue'](_0x66a2('0xb')));}else{return this['getDataValue'](_0x66a2('0xb'));}},'set':function(_0x1dd418){if(Array[_0x66a2('0xc')](_0x1dd418)){this[_0x66a2('0xd')]('values',JSON['stringify'](_0x1dd418));}else{this['setDataValue']('values',_0x1dd418);}}},'required':{'type':Sequelize[_0x66a2('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x66a2('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM']('voice')}};
\ No newline at end of file
+var _0xd97d=['sequelize','lodash','exports','VIRTUAL','STRING','setDataValue','alias','getDataValue','name','TEXT','long','type','parse','values','isArray','stringify','BOOLEAN','ENUM'];(function(_0x3e2489,_0x41d9dd){var _0x2254ce=function(_0x227e46){while(--_0x227e46){_0x3e2489['push'](_0x3e2489['shift']());}};_0x2254ce(++_0x41d9dd);}(_0xd97d,0x19e));var _0xdd97=function(_0x46ae5a,_0x2a38d0){_0x46ae5a=_0x46ae5a-0x0;var _0x434986=_0xd97d[_0x46ae5a];return _0x434986;};'use strict';var Sequelize=require(_0xdd97('0x0'));var _=require(_0xdd97('0x1'));module[_0xdd97('0x2')]={'name':{'type':Sequelize[_0xdd97('0x3')],'get':function(_0x174606){return this['getDataValue']('alias');}},'alias':{'type':Sequelize[_0xdd97('0x4')],'allowNull':![],'set':function(_0x4ef265){this[_0xdd97('0x5')](_0xdd97('0x6'),_0x4ef265?_0x4ef265:this[_0xdd97('0x7')](_0xdd97('0x8')));}},'type':{'type':Sequelize[_0xdd97('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0xdd97('0x9')](_0xdd97('0xa')),'get':function(){if(this[_0xdd97('0x7')](_0xdd97('0xb'))==='select'){return JSON[_0xdd97('0xc')](this['getDataValue'](_0xdd97('0xd')));}else{return this[_0xdd97('0x7')]('values');}},'set':function(_0x3a92da){if(Array[_0xdd97('0xe')](_0x3a92da)){this[_0xdd97('0x5')](_0xdd97('0xd'),JSON[_0xdd97('0xf')](_0x3a92da));}else{this[_0xdd97('0x5')]('values',_0x3a92da);}}},'required':{'type':Sequelize[_0xdd97('0x10')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xdd97('0x10')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xdd97('0x11')]('voice')}};
\ No newline at end of file
index 60bffb6..1487b0b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4862=['where','pick','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','find','body','create','sequelize','transaction','text','TEXT','number','INTEGER','Sequelize','defaultValue','addColumn','cm_contacts','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','name','send','index','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x5cb367,_0x27ec9d){var _0x279365=function(_0x1d9d85){while(--_0x1d9d85){_0x5cb367['push'](_0x5cb367['shift']());}};_0x279365(++_0x27ec9d);}(_0x4862,0x189));var _0x2486=function(_0xe206ed,_0x179821){_0xe206ed=_0xe206ed-0x0;var _0x4423ab=_0x4862[_0xe206ed];return _0x4423ab;};'use strict';var emlformat=require(_0x2486('0x0'));var rimraf=require(_0x2486('0x1'));var zipdir=require(_0x2486('0x2'));var jsonpatch=require(_0x2486('0x3'));var rp=require(_0x2486('0x4'));var moment=require('moment');var BPromise=require(_0x2486('0x5'));var Mustache=require(_0x2486('0x6'));var util=require(_0x2486('0x7'));var path=require(_0x2486('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2486('0x9'));var fs=require('fs');var fs_extra=require(_0x2486('0xa'));var _=require(_0x2486('0xb'));var squel=require(_0x2486('0xc'));var crypto=require('crypto');var jsforce=require(_0x2486('0xd'));var deskjs=require(_0x2486('0xe'));var toCsv=require(_0x2486('0xf'));var querystring=require(_0x2486('0x10'));var Papa=require(_0x2486('0x11'));var Redis=require(_0x2486('0x12'));var authService=require(_0x2486('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2486('0x14'));var hardwareService=require(_0x2486('0x15'));var logger=require(_0x2486('0x16'))(_0x2486('0x17'));var utils=require(_0x2486('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x2486('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59d633,_0x596982){_0x596982=_0x596982||0xcc;return function(_0x11616b){if(_0x11616b){return _0x59d633[_0x2486('0x1a')](_0x596982);}return _0x59d633[_0x2486('0x1b')](_0x596982)[_0x2486('0x1c')]();};}function respondWithResult(_0x3415f6,_0x21bb4a){_0x21bb4a=_0x21bb4a||0xc8;return function(_0x44d8d7){if(_0x44d8d7){return _0x3415f6[_0x2486('0x1b')](_0x21bb4a)[_0x2486('0x1d')](_0x44d8d7);}};}function respondWithFilteredResult(_0xe48691,_0x1dfea7){return function(_0x754fa5){if(_0x754fa5){var _0x3c9398=typeof _0x1dfea7[_0x2486('0x1e')]===_0x2486('0x1f')&&typeof _0x1dfea7[_0x2486('0x20')]==='undefined';var _0x42b298=_0x754fa5[_0x2486('0x21')];var _0x2e7b2c=_0x3c9398?0x0:_0x1dfea7['offset'];var _0x544af9=_0x3c9398?_0x754fa5[_0x2486('0x21')]:_0x1dfea7[_0x2486('0x1e')]+_0x1dfea7[_0x2486('0x20')];var _0x248765;if(_0x544af9>=_0x42b298){_0x544af9=_0x42b298;_0x248765=0xc8;}else{_0x248765=0xce;}_0xe48691['status'](_0x248765);return _0xe48691[_0x2486('0x22')](_0x2486('0x23'),_0x2e7b2c+'-'+_0x544af9+'/'+_0x42b298)[_0x2486('0x1d')](_0x754fa5);}return null;};}function patchUpdates(_0x512114){return function(_0x38e619){try{jsonpatch[_0x2486('0x24')](_0x38e619,_0x512114,!![]);}catch(_0x67cf7b){return BPromise[_0x2486('0x25')](_0x67cf7b);}return _0x38e619[_0x2486('0x26')]();};}function saveUpdates(_0x3c31ae,_0x50e08f){return function(_0x1fd5af){if(_0x1fd5af){return _0x1fd5af[_0x2486('0x27')](_0x3c31ae)['then'](function(_0x47c1c2){return _0x47c1c2;});}return null;};}function removeEntity(_0x4fe835,_0x19e11e){return function(_0x543ad1){if(_0x543ad1){return _0x543ad1[_0x2486('0x28')]()[_0x2486('0x29')](function(){_0x4fe835['status'](0xcc)[_0x2486('0x1c')]();});}};}function handleEntityNotFound(_0x271270,_0x55b9e3){return function(_0x2c49f4){if(!_0x2c49f4){_0x271270['sendStatus'](0x194);}return _0x2c49f4;};}function handleError(_0x5cbcea,_0x20c437){_0x20c437=_0x20c437||0x1f4;return function(_0x50cc90){logger[_0x2486('0x2a')](_0x50cc90['stack']);if(_0x50cc90['name']){delete _0x50cc90[_0x2486('0x2b')];}_0x5cbcea[_0x2486('0x1b')](_0x20c437)[_0x2486('0x2c')](_0x50cc90);};}exports[_0x2486('0x2d')]=function(_0x4f2c11,_0xb5eb74){var _0x585e4d={},_0x1a952c={},_0x43653b={'count':0x0,'rows':[]};var _0x220eb6=_['map'](db[_0x2486('0x2e')][_0x2486('0x2f')],function(_0x34ca5d){return{'name':_0x34ca5d[_0x2486('0x30')],'type':_0x34ca5d[_0x2486('0x31')][_0x2486('0x32')]};});_0x1a952c[_0x2486('0x33')]=_[_0x2486('0x34')](_['map'](_0x220eb6,_0x2486('0x2b')),['name']);_0x1a952c[_0x2486('0x35')]=_['keys'](_0x4f2c11['query']);_0x1a952c['filters']=_[_0x2486('0x36')](_0x1a952c[_0x2486('0x33')],_0x1a952c['query']);_0x585e4d['attributes']=_[_0x2486('0x36')](_0x1a952c[_0x2486('0x33')],qs[_0x2486('0x37')](_0x4f2c11[_0x2486('0x35')]['fields']));_0x585e4d[_0x2486('0x38')]=_0x585e4d['attributes'][_0x2486('0x39')]?_0x585e4d['attributes']:_0x1a952c[_0x2486('0x33')];if(!_0x4f2c11[_0x2486('0x35')][_0x2486('0x3a')](_0x2486('0x3b'))){_0x585e4d['limit']=qs[_0x2486('0x20')](_0x4f2c11[_0x2486('0x35')][_0x2486('0x20')]);_0x585e4d[_0x2486('0x1e')]=qs[_0x2486('0x1e')](_0x4f2c11['query'][_0x2486('0x1e')]);}_0x585e4d[_0x2486('0x3c')]=qs[_0x2486('0x3d')](_0x4f2c11[_0x2486('0x35')][_0x2486('0x3d')]);_0x585e4d[_0x2486('0x3e')]=qs['filters'](_[_0x2486('0x3f')](_0x4f2c11[_0x2486('0x35')],_0x1a952c[_0x2486('0x40')]),_0x220eb6);if(_0x4f2c11[_0x2486('0x35')]['filter']){_0x585e4d[_0x2486('0x3e')]=_[_0x2486('0x41')](_0x585e4d[_0x2486('0x3e')],{'$or':_['map'](_0x220eb6,function(_0x5bccfa){if(_0x5bccfa[_0x2486('0x31')]!==_0x2486('0x42')){var _0x532fea={};_0x532fea[_0x5bccfa[_0x2486('0x2b')]]={'$like':'%'+_0x4f2c11['query'][_0x2486('0x43')]+'%'};return _0x532fea;}})});}_0x585e4d=_[_0x2486('0x41')]({},_0x585e4d,_0x4f2c11[_0x2486('0x44')]);var _0x2a9ea9={'where':_0x585e4d[_0x2486('0x3e')]};return db[_0x2486('0x2e')][_0x2486('0x21')](_0x2a9ea9)[_0x2486('0x29')](function(_0x1583b8){_0x43653b['count']=_0x1583b8;if(_0x4f2c11[_0x2486('0x35')][_0x2486('0x45')]){_0x585e4d[_0x2486('0x46')]=[{'all':!![]}];}return db['CmCustomField'][_0x2486('0x47')](_0x585e4d);})[_0x2486('0x29')](function(_0x444df7){_0x43653b[_0x2486('0x48')]=_0x444df7;return _0x43653b;})[_0x2486('0x29')](respondWithFilteredResult(_0xb5eb74,_0x585e4d))[_0x2486('0x49')](handleError(_0xb5eb74,null));};exports[_0x2486('0x4a')]=function(_0x3bc3aa,_0x36a12e){var _0x8dde8b={'raw':!![],'where':{'id':_0x3bc3aa[_0x2486('0x4b')]['id']}},_0x3e1b1b={};_0x3e1b1b[_0x2486('0x33')]=_[_0x2486('0x4c')](db[_0x2486('0x2e')][_0x2486('0x2f')]);_0x3e1b1b[_0x2486('0x35')]=_[_0x2486('0x4c')](_0x3bc3aa[_0x2486('0x35')]);_0x3e1b1b['filters']=_[_0x2486('0x36')](_0x3e1b1b[_0x2486('0x33')],_0x3e1b1b[_0x2486('0x35')]);_0x8dde8b[_0x2486('0x38')]=_[_0x2486('0x36')](_0x3e1b1b[_0x2486('0x33')],qs[_0x2486('0x37')](_0x3bc3aa[_0x2486('0x35')]['fields']));_0x8dde8b[_0x2486('0x38')]=_0x8dde8b[_0x2486('0x38')][_0x2486('0x39')]?_0x8dde8b['attributes']:_0x3e1b1b[_0x2486('0x33')];if(_0x3bc3aa[_0x2486('0x35')][_0x2486('0x45')]){_0x8dde8b[_0x2486('0x46')]=[{'all':!![]}];}_0x8dde8b=_[_0x2486('0x41')]({},_0x8dde8b,_0x3bc3aa[_0x2486('0x44')]);return db['CmCustomField'][_0x2486('0x4d')](_0x8dde8b)[_0x2486('0x29')](handleEntityNotFound(_0x36a12e,null))[_0x2486('0x29')](respondWithResult(_0x36a12e,null))[_0x2486('0x49')](handleError(_0x36a12e,null));};exports[_0x2486('0x27')]=function(_0x5805c5,_0x328fce){if(_0x5805c5[_0x2486('0x4e')]['id']){delete _0x5805c5[_0x2486('0x4e')]['id'];}return db[_0x2486('0x2e')][_0x2486('0x4d')]({'where':{'id':_0x5805c5['params']['id']}})[_0x2486('0x29')](handleEntityNotFound(_0x328fce,null))['then'](saveUpdates(_0x5805c5[_0x2486('0x4e')],null))[_0x2486('0x29')](respondWithResult(_0x328fce,null))[_0x2486('0x49')](handleError(_0x328fce,null));};exports[_0x2486('0x28')]=function(_0x5d132d,_0x5cd970){return db[_0x2486('0x2e')][_0x2486('0x4d')]({'where':{'id':_0x5d132d[_0x2486('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5cd970,null))[_0x2486('0x29')](removeEntity(_0x5cd970,null))[_0x2486('0x49')](handleError(_0x5cd970,null));};exports[_0x2486('0x4f')]=function(_0x507089,_0x34e05c){var _0x16065d;return db[_0x2486('0x50')][_0x2486('0x51')](function(_0x1b5330){return db['CmCustomField']['create'](_0x507089['body'],{'transaction':_0x1b5330})[_0x2486('0x29')](function(_0x4eaab4){_0x16065d=_0x4eaab4;var _0x4dd2dd={'type':db['Sequelize']['TEXT'],'transaction':_0x1b5330};switch(_0x507089[_0x2486('0x4e')][_0x2486('0x31')]){case _0x2486('0x52'):_0x4dd2dd['type']=db['Sequelize'][_0x2486('0x53')];break;case _0x2486('0x54'):_0x4dd2dd['type']=db['Sequelize'][_0x2486('0x55')];break;case'switch':_0x4dd2dd[_0x2486('0x31')]=db[_0x2486('0x56')]['BOOLEAN'];_0x4dd2dd[_0x2486('0x57')]=![];break;default:}return db['sequelize']['queryInterface'][_0x2486('0x58')](_0x2486('0x59'),util['format'](_0x2486('0x5a'),_0x16065d['id']),_0x4dd2dd);})['then'](function(){return _0x16065d;});})[_0x2486('0x29')](respondWithResult(_0x34e05c,0xc9))[_0x2486('0x49')](handleError(_0x34e05c,null));};
\ No newline at end of file
+var _0x736e=['fields','length','hasOwnProperty','nolimit','order','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','intersection','find','body','destroy','create','sequelize','transaction','Sequelize','TEXT','text','INTEGER','switch','type','defaultValue','queryInterface','addColumn','format','eml-format','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','CmCustomField','rawAttributes','key','model','differenceBy','keys','query','filters','attributes'];(function(_0x2be488,_0x1e5521){var _0x1b6624=function(_0x77ff0a){while(--_0x77ff0a){_0x2be488['push'](_0x2be488['shift']());}};_0x1b6624(++_0x1e5521);}(_0x736e,0x73));var _0xe736=function(_0x40cc9a,_0x235304){_0x40cc9a=_0x40cc9a-0x0;var _0x5e51cb=_0x736e[_0x40cc9a];return _0x5e51cb;};'use strict';var emlformat=require(_0xe736('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe736('0x1'));var rp=require(_0xe736('0x2'));var moment=require(_0xe736('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe736('0x4'));var util=require(_0xe736('0x5'));var path=require('path');var sox=require(_0xe736('0x6'));var csv=require(_0xe736('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe736('0x8'));var squel=require(_0xe736('0x9'));var crypto=require(_0xe736('0xa'));var jsforce=require(_0xe736('0xb'));var deskjs=require(_0xe736('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe736('0xd'));var Redis=require('ioredis');var authService=require(_0xe736('0xe'));var qs=require(_0xe736('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe736('0x10'));var logger=require('../../config/logger')(_0xe736('0x11'));var utils=require('../../config/utils');var config=require(_0xe736('0x12'));var licenseUtil=require(_0xe736('0x13'));var db=require(_0xe736('0x14'))['db'];function respondWithStatusCode(_0x3cb3ab,_0x5d0815){_0x5d0815=_0x5d0815||0xcc;return function(_0x139113){if(_0x139113){return _0x3cb3ab[_0xe736('0x15')](_0x5d0815);}return _0x3cb3ab[_0xe736('0x16')](_0x5d0815)[_0xe736('0x17')]();};}function respondWithResult(_0x2689ae,_0x11b53f){_0x11b53f=_0x11b53f||0xc8;return function(_0x2f2681){if(_0x2f2681){return _0x2689ae[_0xe736('0x16')](_0x11b53f)[_0xe736('0x18')](_0x2f2681);}};}function respondWithFilteredResult(_0xece22c,_0x375fe2){return function(_0x5e26a6){if(_0x5e26a6){var _0x343ce0=typeof _0x375fe2['offset']==='undefined'&&typeof _0x375fe2[_0xe736('0x19')]===_0xe736('0x1a');var _0x290983=_0x5e26a6[_0xe736('0x1b')];var _0x1b087b=_0x343ce0?0x0:_0x375fe2[_0xe736('0x1c')];var _0x1af6e0=_0x343ce0?_0x5e26a6[_0xe736('0x1b')]:_0x375fe2[_0xe736('0x1c')]+_0x375fe2[_0xe736('0x19')];var _0x2b2bec;if(_0x1af6e0>=_0x290983){_0x1af6e0=_0x290983;_0x2b2bec=0xc8;}else{_0x2b2bec=0xce;}_0xece22c['status'](_0x2b2bec);return _0xece22c['set'](_0xe736('0x1d'),_0x1b087b+'-'+_0x1af6e0+'/'+_0x290983)[_0xe736('0x18')](_0x5e26a6);}return null;};}function patchUpdates(_0x2a161a){return function(_0x4d74c6){try{jsonpatch[_0xe736('0x1e')](_0x4d74c6,_0x2a161a,!![]);}catch(_0x1b50d1){return BPromise[_0xe736('0x1f')](_0x1b50d1);}return _0x4d74c6[_0xe736('0x20')]();};}function saveUpdates(_0xa2f3be,_0x164ec3){return function(_0x299ead){if(_0x299ead){return _0x299ead[_0xe736('0x21')](_0xa2f3be)[_0xe736('0x22')](function(_0x225fa4){return _0x225fa4;});}return null;};}function removeEntity(_0x4251fc,_0x2eadcd){return function(_0x294c55){if(_0x294c55){return _0x294c55['destroy']()[_0xe736('0x22')](function(){_0x4251fc[_0xe736('0x16')](0xcc)[_0xe736('0x17')]();});}};}function handleEntityNotFound(_0x223b95,_0x251b71){return function(_0x57cf00){if(!_0x57cf00){_0x223b95[_0xe736('0x15')](0x194);}return _0x57cf00;};}function handleError(_0x1a97d9,_0x47e480){_0x47e480=_0x47e480||0x1f4;return function(_0x4655a6){logger['error'](_0x4655a6[_0xe736('0x23')]);if(_0x4655a6['name']){delete _0x4655a6[_0xe736('0x24')];}_0x1a97d9[_0xe736('0x16')](_0x47e480)[_0xe736('0x25')](_0x4655a6);};}exports[_0xe736('0x26')]=function(_0x56c5c7,_0x57c1bd){var _0x1bffe7={},_0x5256e2={},_0xb55c64={'count':0x0,'rows':[]};var _0x56467e=_[_0xe736('0x27')](db[_0xe736('0x28')][_0xe736('0x29')],function(_0x48e933){return{'name':_0x48e933['fieldName'],'type':_0x48e933['type'][_0xe736('0x2a')]};});_0x5256e2[_0xe736('0x2b')]=_[_0xe736('0x2c')](_['map'](_0x56467e,_0xe736('0x24')),[_0xe736('0x24')]);_0x5256e2['query']=_[_0xe736('0x2d')](_0x56c5c7[_0xe736('0x2e')]);_0x5256e2[_0xe736('0x2f')]=_['intersection'](_0x5256e2['model'],_0x5256e2['query']);_0x1bffe7[_0xe736('0x30')]=_['intersection'](_0x5256e2[_0xe736('0x2b')],qs[_0xe736('0x31')](_0x56c5c7[_0xe736('0x2e')]['fields']));_0x1bffe7[_0xe736('0x30')]=_0x1bffe7[_0xe736('0x30')][_0xe736('0x32')]?_0x1bffe7[_0xe736('0x30')]:_0x5256e2[_0xe736('0x2b')];if(!_0x56c5c7['query'][_0xe736('0x33')](_0xe736('0x34'))){_0x1bffe7[_0xe736('0x19')]=qs['limit'](_0x56c5c7[_0xe736('0x2e')][_0xe736('0x19')]);_0x1bffe7['offset']=qs['offset'](_0x56c5c7['query']['offset']);}_0x1bffe7[_0xe736('0x35')]=qs['sort'](_0x56c5c7['query']['sort']);_0x1bffe7['where']=qs[_0xe736('0x2f')](_['pick'](_0x56c5c7[_0xe736('0x2e')],_0x5256e2[_0xe736('0x2f')]),_0x56467e);if(_0x56c5c7[_0xe736('0x2e')][_0xe736('0x36')]){_0x1bffe7[_0xe736('0x37')]=_[_0xe736('0x38')](_0x1bffe7['where'],{'$or':_[_0xe736('0x27')](_0x56467e,function(_0x5cb6ca){if(_0x5cb6ca['type']!==_0xe736('0x39')){var _0x1e040f={};_0x1e040f[_0x5cb6ca[_0xe736('0x24')]]={'$like':'%'+_0x56c5c7['query']['filter']+'%'};return _0x1e040f;}})});}_0x1bffe7=_['merge']({},_0x1bffe7,_0x56c5c7[_0xe736('0x3a')]);var _0x224d61={'where':_0x1bffe7[_0xe736('0x37')]};return db[_0xe736('0x28')]['count'](_0x224d61)[_0xe736('0x22')](function(_0x3015f2){_0xb55c64[_0xe736('0x1b')]=_0x3015f2;if(_0x56c5c7['query'][_0xe736('0x3b')]){_0x1bffe7[_0xe736('0x3c')]=[{'all':!![]}];}return db[_0xe736('0x28')][_0xe736('0x3d')](_0x1bffe7);})['then'](function(_0x8010c8){_0xb55c64[_0xe736('0x3e')]=_0x8010c8;return _0xb55c64;})['then'](respondWithFilteredResult(_0x57c1bd,_0x1bffe7))[_0xe736('0x3f')](handleError(_0x57c1bd,null));};exports['show']=function(_0x3052cf,_0x5e9067){var _0x15d91d={'raw':!![],'where':{'id':_0x3052cf[_0xe736('0x40')]['id']}},_0x15b45e={};_0x15b45e[_0xe736('0x2b')]=_[_0xe736('0x2d')](db[_0xe736('0x28')][_0xe736('0x29')]);_0x15b45e[_0xe736('0x2e')]=_[_0xe736('0x2d')](_0x3052cf[_0xe736('0x2e')]);_0x15b45e[_0xe736('0x2f')]=_[_0xe736('0x41')](_0x15b45e['model'],_0x15b45e['query']);_0x15d91d[_0xe736('0x30')]=_[_0xe736('0x41')](_0x15b45e[_0xe736('0x2b')],qs['fields'](_0x3052cf[_0xe736('0x2e')][_0xe736('0x31')]));_0x15d91d[_0xe736('0x30')]=_0x15d91d[_0xe736('0x30')][_0xe736('0x32')]?_0x15d91d[_0xe736('0x30')]:_0x15b45e[_0xe736('0x2b')];if(_0x3052cf[_0xe736('0x2e')][_0xe736('0x3b')]){_0x15d91d[_0xe736('0x3c')]=[{'all':!![]}];}_0x15d91d=_[_0xe736('0x38')]({},_0x15d91d,_0x3052cf['options']);return db[_0xe736('0x28')][_0xe736('0x42')](_0x15d91d)['then'](handleEntityNotFound(_0x5e9067,null))[_0xe736('0x22')](respondWithResult(_0x5e9067,null))[_0xe736('0x3f')](handleError(_0x5e9067,null));};exports[_0xe736('0x21')]=function(_0x243627,_0x5e427a){if(_0x243627[_0xe736('0x43')]['id']){delete _0x243627['body']['id'];}return db[_0xe736('0x28')][_0xe736('0x42')]({'where':{'id':_0x243627[_0xe736('0x40')]['id']}})[_0xe736('0x22')](handleEntityNotFound(_0x5e427a,null))[_0xe736('0x22')](saveUpdates(_0x243627[_0xe736('0x43')],null))['then'](respondWithResult(_0x5e427a,null))[_0xe736('0x3f')](handleError(_0x5e427a,null));};exports[_0xe736('0x44')]=function(_0x4fbafe,_0x2d407b){return db[_0xe736('0x28')][_0xe736('0x42')]({'where':{'id':_0x4fbafe[_0xe736('0x40')]['id']}})[_0xe736('0x22')](handleEntityNotFound(_0x2d407b,null))['then'](removeEntity(_0x2d407b,null))[_0xe736('0x3f')](handleError(_0x2d407b,null));};exports[_0xe736('0x45')]=function(_0x2876da,_0xd6b433){var _0x5265b4;return db[_0xe736('0x46')][_0xe736('0x47')](function(_0x466209){return db['CmCustomField']['create'](_0x2876da[_0xe736('0x43')],{'transaction':_0x466209})[_0xe736('0x22')](function(_0x2d2ab0){_0x5265b4=_0x2d2ab0;var _0x557ea0={'type':db[_0xe736('0x48')][_0xe736('0x49')],'transaction':_0x466209};switch(_0x2876da[_0xe736('0x43')]['type']){case _0xe736('0x4a'):_0x557ea0['type']=db[_0xe736('0x48')][_0xe736('0x49')];break;case'number':_0x557ea0['type']=db['Sequelize'][_0xe736('0x4b')];break;case _0xe736('0x4c'):_0x557ea0[_0xe736('0x4d')]=db[_0xe736('0x48')]['BOOLEAN'];_0x557ea0[_0xe736('0x4e')]=![];break;default:}return db['sequelize'][_0xe736('0x4f')][_0xe736('0x50')]('cm_contacts',util[_0xe736('0x51')]('cf_%d',_0x5265b4['id']),_0x557ea0);})[_0xe736('0x22')](function(){return _0x5265b4;});})[_0xe736('0x22')](respondWithResult(_0xd6b433,0xc9))[_0xe736('0x3f')](handleError(_0xd6b433,null));};
\ No newline at end of file
index efe9c95..720815c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb665=['bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','api','moment'];(function(_0x58c0a2,_0x40209a){var _0x5004d6=function(_0x1a44f2){while(--_0x1a44f2){_0x58c0a2['push'](_0x58c0a2['shift']());}};_0x5004d6(++_0x40209a);}(_0xb665,0xeb));var _0x5b66=function(_0x3167bf,_0x1f2bca){_0x3167bf=_0x3167bf-0x0;var _0x400e91=_0xb665[_0x3167bf];return _0x400e91;};'use strict';var _=require(_0x5b66('0x0'));var util=require(_0x5b66('0x1'));var logger=require(_0x5b66('0x2'))(_0x5b66('0x3'));var moment=require(_0x5b66('0x4'));var BPromise=require(_0x5b66('0x5'));var rp=require(_0x5b66('0x6'));var fs=require('fs');var path=require(_0x5b66('0x7'));var rimraf=require(_0x5b66('0x8'));var config=require(_0x5b66('0x9'));var attributes=require(_0x5b66('0xa'));module[_0x5b66('0xb')]=function(_0x4655f7,_0x476e65){return _0x4655f7[_0x5b66('0xc')](_0x5b66('0xd'),attributes,{'tableName':_0x5b66('0xe'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xac60=['CmCustomField','cm_custom_fields','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmCustomField.attributes','exports'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xac60,0xf9));var _0x0ac6=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xac60[_0x3a6efd];return _0x487b9a;};'use strict';var _=require(_0x0ac6('0x0'));var util=require(_0x0ac6('0x1'));var logger=require(_0x0ac6('0x2'))(_0x0ac6('0x3'));var moment=require(_0x0ac6('0x4'));var BPromise=require(_0x0ac6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0ac6('0x6'));var rimraf=require(_0x0ac6('0x7'));var config=require(_0x0ac6('0x8'));var attributes=require(_0x0ac6('0x9'));module[_0x0ac6('0xa')]=function(_0x21f2c4,_0x1c1711){return _0x21f2c4['define'](_0x0ac6('0xb'),attributes,{'tableName':_0x0ac6('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 46c33f2..6e50bcf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c0a=['CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x22756c,_0x4c7e64){var _0x26bcf1=function(_0x584307){while(--_0x584307){_0x22756c['push'](_0x22756c['shift']());}};_0x26bcf1(++_0x4c7e64);}(_0x0c0a,0x69));var _0xa0c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c0a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa0c0('0x0'));var util=require(_0xa0c0('0x1'));var moment=require(_0xa0c0('0x2'));var BPromise=require(_0xa0c0('0x3'));var rs=require(_0xa0c0('0x4'));var fs=require('fs');var Redis=require(_0xa0c0('0x5'));var db=require(_0xa0c0('0x6'))['db'];var utils=require(_0xa0c0('0x7'));var logger=require('../../config/logger')(_0xa0c0('0x8'));var config=require(_0xa0c0('0x9'));var jayson=require(_0xa0c0('0xa'));var client=jayson[_0xa0c0('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x531f9a,_0x237c08,_0x8a3e2b){return new BPromise(function(_0x9dc0e4,_0xbde271){return client[_0xa0c0('0xc')](_0x531f9a,_0x8a3e2b)[_0xa0c0('0xd')](function(_0x3d62dc){logger[_0xa0c0('0xe')](_0xa0c0('0xf'),_0x237c08,_0xa0c0('0x10'));logger[_0xa0c0('0x11')](_0xa0c0('0x12'),_0x237c08,_0xa0c0('0x10'),JSON[_0xa0c0('0x13')](_0x3d62dc));if(_0x3d62dc[_0xa0c0('0x14')]){if(_0x3d62dc['error']['code']===0x1f4){logger['error'](_0xa0c0('0xf'),_0x237c08,_0x3d62dc[_0xa0c0('0x14')][_0xa0c0('0x15')]);return _0xbde271(_0x3d62dc[_0xa0c0('0x14')]['message']);}logger[_0xa0c0('0x14')]('CmCustomField,\x20%s,\x20%s',_0x237c08,_0x3d62dc['error'][_0xa0c0('0x15')]);return _0x9dc0e4(_0x3d62dc[_0xa0c0('0x14')][_0xa0c0('0x15')]);}else{logger[_0xa0c0('0xe')](_0xa0c0('0xf'),_0x237c08,_0xa0c0('0x10'));_0x9dc0e4(_0x3d62dc[_0xa0c0('0x16')][_0xa0c0('0x15')]);}})[_0xa0c0('0x17')](function(_0x552827){logger['error'](_0xa0c0('0xf'),_0x237c08,_0x552827);_0xbde271(_0x552827);});});}
\ No newline at end of file
+var _0xdd82=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result'];(function(_0x28509b,_0x5831ff){var _0x1e0b6=function(_0x37d8a2){while(--_0x37d8a2){_0x28509b['push'](_0x28509b['shift']());}};_0x1e0b6(++_0x5831ff);}(_0xdd82,0x1b8));var _0x2dd8=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xdd82[_0x432682];return _0x463d05;};'use strict';var _=require(_0x2dd8('0x0'));var util=require(_0x2dd8('0x1'));var moment=require(_0x2dd8('0x2'));var BPromise=require(_0x2dd8('0x3'));var rs=require(_0x2dd8('0x4'));var fs=require('fs');var Redis=require(_0x2dd8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2dd8('0x6'));var logger=require(_0x2dd8('0x7'))(_0x2dd8('0x8'));var config=require('../../config/environment');var jayson=require(_0x2dd8('0x9'));var client=jayson[_0x2dd8('0xa')][_0x2dd8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x18d52f,_0x55dbb3,_0x128c6d){return new BPromise(function(_0x362a81,_0x2a4e38){return client['request'](_0x18d52f,_0x128c6d)['then'](function(_0x43c314){logger[_0x2dd8('0xc')](_0x2dd8('0xd'),_0x55dbb3,_0x2dd8('0xe'));logger[_0x2dd8('0xf')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x55dbb3,_0x2dd8('0xe'),JSON[_0x2dd8('0x10')](_0x43c314));if(_0x43c314['error']){if(_0x43c314[_0x2dd8('0x11')]['code']===0x1f4){logger[_0x2dd8('0x11')]('CmCustomField,\x20%s,\x20%s',_0x55dbb3,_0x43c314[_0x2dd8('0x11')]['message']);return _0x2a4e38(_0x43c314['error'][_0x2dd8('0x12')]);}logger[_0x2dd8('0x11')](_0x2dd8('0xd'),_0x55dbb3,_0x43c314[_0x2dd8('0x11')][_0x2dd8('0x12')]);return _0x362a81(_0x43c314[_0x2dd8('0x11')][_0x2dd8('0x12')]);}else{logger[_0x2dd8('0xc')](_0x2dd8('0xd'),_0x55dbb3,_0x2dd8('0xe'));_0x362a81(_0x43c314[_0x2dd8('0x13')][_0x2dd8('0x12')]);}})['catch'](function(_0x344f3c){logger['error'](_0x2dd8('0xd'),_0x55dbb3,_0x344f3c);_0x2a4e38(_0x344f3c);});});}
\ No newline at end of file
index 5e636f8..723555c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0958=['create','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id'];(function(_0x20fb02,_0x96c029){var _0x24a33e=function(_0x4b5c8a){while(--_0x4b5c8a){_0x20fb02['push'](_0x20fb02['shift']());}};_0x24a33e(++_0x96c029);}(_0x0958,0x7c));var _0x8095=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0958[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x8095('0x0'));var util=require(_0x8095('0x1'));var path=require(_0x8095('0x2'));var timeout=require('connect-timeout');var express=require(_0x8095('0x3'));var router=express[_0x8095('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8095('0x5'));var config=require(_0x8095('0x6'));var controller=require('./cmCustomField.controller');router['get']('/',auth[_0x8095('0x7')](),controller[_0x8095('0x8')]);router[_0x8095('0x9')](_0x8095('0xa'),auth[_0x8095('0x7')](),controller['show']);router['post']('/',auth[_0x8095('0x7')](),controller[_0x8095('0xb')]);router['put']('/:id',auth[_0x8095('0x7')](),controller['update']);router[_0x8095('0xc')](_0x8095('0xa'),auth[_0x8095('0x7')](),controller[_0x8095('0xd')]);module[_0x8095('0xe')]=router;
\ No newline at end of file
+var _0x53fa=['index','get','isAuthenticated','show','post','create','/:id','delete','multer','util','connect-timeout','express','../../config/environment','./cmCustomField.controller'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x53fa,0x1ac));var _0xa53f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x53fa[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xa53f('0x0'));var util=require(_0xa53f('0x1'));var path=require('path');var timeout=require(_0xa53f('0x2'));var express=require(_0xa53f('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa53f('0x4'));var controller=require(_0xa53f('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xa53f('0x6')]);router[_0xa53f('0x7')]('/:id',auth[_0xa53f('0x8')](),controller[_0xa53f('0x9')]);router[_0xa53f('0xa')]('/',auth[_0xa53f('0x8')](),controller[_0xa53f('0xb')]);router['put'](_0xa53f('0xc'),auth[_0xa53f('0x8')](),controller['update']);router[_0xa53f('0xd')]('/:id',auth[_0xa53f('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index b2c42a5..88afb4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9582=['sequelize','exports','STRING','BOOLEAN','DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment'];(function(_0x548bb5,_0x4e71d3){var _0x22d4b2=function(_0x1c668a){while(--_0x1c668a){_0x548bb5['push'](_0x548bb5['shift']());}};_0x22d4b2(++_0x4e71d3);}(_0x9582,0x95));var _0x2958=function(_0x56788f,_0x40fa02){_0x56788f=_0x56788f-0x0;var _0x2832c5=_0x9582[_0x56788f];return _0x2832c5;};'use strict';var moment=require(_0x2958('0x0'));var Sequelize=require(_0x2958('0x1'));module[_0x2958('0x2')]={'phone':{'type':Sequelize[_0x2958('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x2958('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x2958('0x5')],'defaultValue':moment()['format'](_0x2958('0x6'))},'countbusyretry':{'type':Sequelize[_0x2958('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2958('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2958('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x2958('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x2958('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x2958('0x5')]},'priority':{'type':Sequelize[_0x2958('0x7')](0x2)[_0x2958('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x2958('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x2958('0x7')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x2958('0x7')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x2958('0x9')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x2958('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x2958('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x2958('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x2958('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2958('0x7')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize[_0x2958('0x5')],'allowNull':!![],'defaultValue':null}};
\ No newline at end of file
+var _0x2032=['contactListQueue','sequelize','exports','STRING','DATE','format','INTEGER','BOOLEAN','UNSIGNED'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x2032,0xd9));var _0x2203=function(_0x85a02c,_0x5d5b5a){_0x85a02c=_0x85a02c-0x0;var _0x3e3f39=_0x2032[_0x85a02c];return _0x3e3f39;};'use strict';var moment=require('moment');var Sequelize=require(_0x2203('0x0'));module[_0x2203('0x1')]={'phone':{'type':Sequelize[_0x2203('0x2')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x2203('0x3')],'defaultValue':moment()[_0x2203('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x2203('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2203('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2203('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x2203('0x6')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x2203('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x2203('0x3')]},'priority':{'type':Sequelize[_0x2203('0x5')](0x2)[_0x2203('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x2203('0x6')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x2203('0x5')],'unique':_0x2203('0x8')},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x2203('0x5')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x2203('0x8')},'CampaignId':{'type':Sequelize[_0x2203('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x2203('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x2203('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2203('0x5')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize[_0x2203('0x3')],'allowNull':!![],'defaultValue':null}};
\ No newline at end of file
index 83835d2..4035a07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb01a=['VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','state','statedesc','deleted','membername','user','deletedat','format','calleridnum','phone','queue','ivr','CmContact','ContactId','lastName','isNil','calleridname','firstName','CmHopperFinal','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','YYYY-MM-DD\x20HH:mm:ss','value','direction','prev','isEmpty','priority','ASC','scheduledAt','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','hopperIds','findOne','scheduledat','recallme','UPDATE','Contact','CmCompany','Company','List','Queue','dialActive','getPreviewRecall','hopperId','LOCK','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','CmHopper','rawAttributes','fieldName','type','query','keys','filters','intersection','model','concat','$or','$gt','$gte','$lt','$ne','$eq','$not','$between','$in','$like','$notLike','$notILike','$overlap','$any','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','find','create','body','describe'];(function(_0x46617c,_0x3de81b){var _0x367b7b=function(_0x55e10a){while(--_0x55e10a){_0x46617c['push'](_0x46617c['shift']());}};_0x367b7b(++_0x3de81b);}(_0xb01a,0xe0));var _0xab01=function(_0x1392c4,_0x5a51c6){_0x1392c4=_0x1392c4-0x0;var _0x179f77=_0xb01a[_0x1392c4];return _0x179f77;};'use strict';var emlformat=require(_0xab01('0x0'));var rimraf=require(_0xab01('0x1'));var zipdir=require(_0xab01('0x2'));var jsonpatch=require(_0xab01('0x3'));var rp=require(_0xab01('0x4'));var moment=require(_0xab01('0x5'));var BPromise=require(_0xab01('0x6'));var Mustache=require(_0xab01('0x7'));var util=require(_0xab01('0x8'));var path=require(_0xab01('0x9'));var sox=require(_0xab01('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xab01('0xb'));var squel=require('squel');var crypto=require(_0xab01('0xc'));var jsforce=require(_0xab01('0xd'));var deskjs=require(_0xab01('0xe'));var toCsv=require(_0xab01('0xf'));var querystring=require(_0xab01('0x10'));var Papa=require('papaparse');var Redis=require(_0xab01('0x11'));var authService=require(_0xab01('0x12'));var qs=require(_0xab01('0x13'));var as=require(_0xab01('0x14'));var hardwareService=require(_0xab01('0x15'));var logger=require(_0xab01('0x16'))('api');var utils=require(_0xab01('0x17'));var config=require('../../config/environment');var shared=require(_0xab01('0x18'));var licenseUtil=require(_0xab01('0x19'));var db=require(_0xab01('0x1a'))['db'];function respondWithStatusCode(_0x3b6342,_0x2dad8c){_0x2dad8c=_0x2dad8c||0xcc;return function(_0x62bb0e){if(_0x62bb0e){return _0x3b6342[_0xab01('0x1b')](_0x2dad8c);}return _0x3b6342['status'](_0x2dad8c)[_0xab01('0x1c')]();};}function respondWithResult(_0x5ecd06,_0x5b527a){_0x5b527a=_0x5b527a||0xc8;return function(_0x2bf92a){if(_0x2bf92a){return _0x5ecd06[_0xab01('0x1d')](_0x5b527a)[_0xab01('0x1e')](_0x2bf92a);}};}function respondWithFilteredResult(_0x4f2e2d,_0x468309){return function(_0x1e366e){if(_0x1e366e){var _0x538be1=typeof _0x468309[_0xab01('0x1f')]==='undefined'&&typeof _0x468309[_0xab01('0x20')]==='undefined';var _0x44a39e=_0x1e366e['count'];var _0x4c8871=_0x538be1?0x0:_0x468309[_0xab01('0x1f')];var _0x30117b=_0x538be1?_0x1e366e[_0xab01('0x21')]:_0x468309['offset']+_0x468309['limit'];var _0x182693;if(_0x30117b>=_0x44a39e){_0x30117b=_0x44a39e;_0x182693=0xc8;}else{_0x182693=0xce;}_0x4f2e2d[_0xab01('0x1d')](_0x182693);return _0x4f2e2d['set'](_0xab01('0x22'),_0x4c8871+'-'+_0x30117b+'/'+_0x44a39e)[_0xab01('0x1e')](_0x1e366e);}return null;};}function patchUpdates(_0x139660){return function(_0x3fcfae){try{jsonpatch['apply'](_0x3fcfae,_0x139660,!![]);}catch(_0x1d53c0){return BPromise[_0xab01('0x23')](_0x1d53c0);}return _0x3fcfae[_0xab01('0x24')]();};}function saveUpdates(_0x2e4716,_0x17d88a){return function(_0x146c7d){if(_0x146c7d){return _0x146c7d[_0xab01('0x25')](_0x2e4716)[_0xab01('0x26')](function(_0xaf2f74){return _0xaf2f74;});}return null;};}function removeEntity(_0x2bc32b,_0x7b89e8){return function(_0x5a91cb){if(_0x5a91cb){return _0x5a91cb[_0xab01('0x27')]()[_0xab01('0x26')](function(){_0x2bc32b[_0xab01('0x1d')](0xcc)[_0xab01('0x1c')]();});}};}function handleEntityNotFound(_0xe689f6,_0x30e8f9){return function(_0x2601a7){if(!_0x2601a7){_0xe689f6[_0xab01('0x1b')](0x194);}return _0x2601a7;};}function handleError(_0x42c8af,_0x4b4bf1){_0x4b4bf1=_0x4b4bf1||0x1f4;return function(_0x44529e){logger[_0xab01('0x28')](_0x44529e[_0xab01('0x29')]);if(_0x44529e[_0xab01('0x2a')]){delete _0x44529e[_0xab01('0x2a')];}_0x42c8af[_0xab01('0x1d')](_0x4b4bf1)['send'](_0x44529e);};}exports[_0xab01('0x2b')]=function(_0x23a071,_0x607a77){var _0x426f05={},_0x100375={},_0x11e1e8={'count':0x0,'rows':[]};var _0x5bca10=_[_0xab01('0x2c')](db[_0xab01('0x2d')][_0xab01('0x2e')],function(_0xac04e5){return{'name':_0xac04e5[_0xab01('0x2f')],'type':_0xac04e5[_0xab01('0x30')]['key']};});_0x100375['model']=_['map'](_0x5bca10,_0xab01('0x2a'));_0x100375[_0xab01('0x31')]=_[_0xab01('0x32')](_0x23a071[_0xab01('0x31')]);_0x100375[_0xab01('0x33')]=_[_0xab01('0x34')](_0x100375[_0xab01('0x35')],_0x100375['query']);_0x100375[_0xab01('0x33')]=_[_0xab01('0x36')](_0x100375[_0xab01('0x33')],['$and',_0xab01('0x37'),_0xab01('0x38'),_0xab01('0x39'),_0xab01('0x3a'),'$lte',_0xab01('0x3b'),_0xab01('0x3c'),_0xab01('0x3d'),_0xab01('0x3e'),'$notBetween',_0xab01('0x3f'),'$notIn',_0xab01('0x40'),_0xab01('0x41'),'$iLike',_0xab01('0x42'),_0xab01('0x40'),_0xab01('0x43'),'$contains','$contained',_0xab01('0x44')]);_0x426f05[_0xab01('0x45')]=_[_0xab01('0x34')](_0x100375[_0xab01('0x35')],qs[_0xab01('0x46')](_0x23a071[_0xab01('0x31')][_0xab01('0x46')]));_0x426f05[_0xab01('0x45')]=_0x426f05[_0xab01('0x45')][_0xab01('0x47')]?_0x426f05[_0xab01('0x45')]:_0x100375[_0xab01('0x35')];if(!_0x23a071[_0xab01('0x31')]['hasOwnProperty'](_0xab01('0x48'))){_0x426f05[_0xab01('0x20')]=qs['limit'](_0x23a071[_0xab01('0x31')][_0xab01('0x20')]);_0x426f05[_0xab01('0x1f')]=qs[_0xab01('0x1f')](_0x23a071[_0xab01('0x31')][_0xab01('0x1f')]);}_0x426f05[_0xab01('0x49')]=qs[_0xab01('0x4a')](_0x23a071[_0xab01('0x31')][_0xab01('0x4a')]);_0x426f05[_0xab01('0x4b')]=qs['filters'](_[_0xab01('0x4c')](_0x23a071['query'],_0x100375[_0xab01('0x33')]),_0x5bca10);if(_0x23a071['query'][_0xab01('0x4d')]){_0x426f05['where']=_[_0xab01('0x4e')](_0x426f05[_0xab01('0x4b')],{'$or':_[_0xab01('0x2c')](_0x5bca10,function(_0x3dccf4){if(_0x3dccf4[_0xab01('0x30')]!=='VIRTUAL'){var _0x1f1d48={};_0x1f1d48[_0x3dccf4['name']]={'$like':'%'+_0x23a071[_0xab01('0x31')][_0xab01('0x4d')]+'%'};return _0x1f1d48;}})});}_0x426f05=_[_0xab01('0x4e')]({},_0x426f05,_0x23a071[_0xab01('0x4f')]);var _0x2b50f6={'where':_0x426f05[_0xab01('0x4b')]};return db['CmHopper'][_0xab01('0x21')](_0x2b50f6)[_0xab01('0x26')](function(_0x53f2bf){_0x11e1e8[_0xab01('0x21')]=_0x53f2bf;if(_0x23a071['query'][_0xab01('0x50')]){_0x426f05[_0xab01('0x51')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x426f05);})[_0xab01('0x26')](function(_0x319646){_0x11e1e8[_0xab01('0x52')]=_0x319646;return _0x11e1e8;})[_0xab01('0x26')](respondWithFilteredResult(_0x607a77,_0x426f05))[_0xab01('0x53')](handleError(_0x607a77,null));};exports[_0xab01('0x54')]=function(_0xb630d2,_0x31dbe9){var _0x29c5b8={'raw':!![],'where':{'id':_0xb630d2[_0xab01('0x55')]['id']}},_0x2114be={};_0x2114be[_0xab01('0x35')]=_[_0xab01('0x32')](db[_0xab01('0x2d')][_0xab01('0x2e')]);_0x2114be['query']=_['keys'](_0xb630d2[_0xab01('0x31')]);_0x2114be[_0xab01('0x33')]=_[_0xab01('0x34')](_0x2114be[_0xab01('0x35')],_0x2114be[_0xab01('0x31')]);_0x29c5b8['attributes']=_[_0xab01('0x34')](_0x2114be[_0xab01('0x35')],qs[_0xab01('0x46')](_0xb630d2[_0xab01('0x31')][_0xab01('0x46')]));_0x29c5b8[_0xab01('0x45')]=_0x29c5b8[_0xab01('0x45')][_0xab01('0x47')]?_0x29c5b8[_0xab01('0x45')]:_0x2114be[_0xab01('0x35')];if(_0xb630d2['query'][_0xab01('0x50')]){_0x29c5b8['include']=[{'all':!![]}];}_0x29c5b8=_[_0xab01('0x4e')]({},_0x29c5b8,_0xb630d2[_0xab01('0x4f')]);return db['CmHopper'][_0xab01('0x56')](_0x29c5b8)[_0xab01('0x26')](handleEntityNotFound(_0x31dbe9,null))['then'](respondWithResult(_0x31dbe9,null))[_0xab01('0x53')](handleError(_0x31dbe9,null));};exports[_0xab01('0x57')]=function(_0x5eb57a,_0x3664d0){return db[_0xab01('0x2d')][_0xab01('0x57')](_0x5eb57a[_0xab01('0x58')],{})['then'](respondWithResult(_0x3664d0,0xc9))[_0xab01('0x53')](handleError(_0x3664d0,null));};exports[_0xab01('0x25')]=function(_0x141e66,_0x1459b2){if(_0x141e66[_0xab01('0x58')]['id']){delete _0x141e66[_0xab01('0x58')]['id'];}return db[_0xab01('0x2d')][_0xab01('0x56')]({'where':{'id':_0x141e66[_0xab01('0x55')]['id']}})[_0xab01('0x26')](handleEntityNotFound(_0x1459b2,null))[_0xab01('0x26')](saveUpdates(_0x141e66['body'],null))['then'](respondWithResult(_0x1459b2,null))[_0xab01('0x53')](handleError(_0x1459b2,null));};exports[_0xab01('0x59')]=function(_0x380545,_0x191920){return db['CmHopper'][_0xab01('0x59')]()[_0xab01('0x26')](respondWithResult(_0x191920,null))[_0xab01('0x53')](handleError(_0x191920,null));};exports[_0xab01('0x27')]=function(_0x23211c,_0xb3fc49){var _0x4a8562;return db['CmHopper'][_0xab01('0x56')]({'where':{'id':_0x23211c['params']['id']}})[_0xab01('0x26')](handleEntityNotFound(_0xb3fc49,null))['then'](function(_0x2160fe){if(_0x2160fe){return _0x2160fe['destroy']()[_0xab01('0x26')](function(_0x1ef95d){return _0x1ef95d;});}})['then'](function(_0x34c754){_0x4a8562=_0x34c754;if(_0x34c754){if(_0x34c754[_0xab01('0x5a')]||_0x34c754[_0xab01('0x5b')]){return db[_0x34c754[_0xab01('0x5a')]?_0xab01('0x5c'):_0xab01('0x5d')][_0xab01('0x56')]({'where':{'id':_0x34c754['VoiceQueueId']?_0x34c754[_0xab01('0x5a')]:_0x34c754[_0xab01('0x5b')]},'attributes':['id','name'],'raw':!![]});}}})['then'](function(_0x48bb33){var _0xb68ed1={};if(_0x48bb33){_[_0xab01('0x4e')](_0xb68ed1,_[_0xab01('0x5e')](_0x4a8562[_0xab01('0x5f')],[_0xab01('0x60'),'updatedAt','id']));_0xb68ed1[_0xab01('0x61')]=0x15;_0xb68ed1[_0xab01('0x62')]=_0xab01('0x63');_0xb68ed1['campaign']=_0x48bb33[_0xab01('0x2a')];_0xb68ed1[_0xab01('0x64')]=_0x23211c[_0xab01('0x65')][_0xab01('0x2a')];_0xb68ed1['UserId']=_0x23211c[_0xab01('0x65')]['id'];_0xb68ed1[_0xab01('0x63')]=!![];_0xb68ed1[_0xab01('0x66')]=moment()[_0xab01('0x67')]('YYYY-MM-DD\x20HH:mm:ss');_0xb68ed1[_0xab01('0x68')]=_0x4a8562[_0xab01('0x69')];_0xb68ed1['campaigntype']=_0x4a8562[_0xab01('0x5a')]?_0xab01('0x6a'):_0xab01('0x6b');return db[_0xab01('0x6c')]['find']({'where':{'id':_0xb68ed1[_0xab01('0x6d')]},'attributes':['firstName',_0xab01('0x6e')]})[_0xab01('0x26')](function(_0x22b9c9){if(!_[_0xab01('0x6f')](_0xb3fc49)&&!_[_0xab01('0x6f')](_0x22b9c9['firstName'])){_0xb68ed1[_0xab01('0x70')]=_0x22b9c9[_0xab01('0x71')];if(!_[_0xab01('0x6f')](_0x22b9c9['lastName'])){_0xb68ed1[_0xab01('0x70')]+='\x20'+_0x22b9c9[_0xab01('0x6e')];}}})['finally'](function(){return db[_0xab01('0x72')]['create'](_0xb68ed1);});}})[_0xab01('0x26')](function(){return _0xb3fc49[_0xab01('0x1d')](0xcc)['end']();})[_0xab01('0x53')](handleError(_0xb3fc49,null));};exports[_0xab01('0x73')]=function(_0x6b9002,_0x510f4c,_0x306b33){var _0xe2a97e=[];return db['CmContact'][_0xab01('0x59')]()['then'](function(_0x2b64e6){_0xe2a97e=_['keys'](_0x2b64e6);return _0x6b9002[_0xab01('0x65')][_0xab01('0x74')]({'where':{'type':_0xab01('0x75'),'dialActive':!![],'dialMethod':_0xab01('0x76')},'attributes':['id',_0xab01('0x77'),_0xab01('0x78')],'raw':!![]});})[_0xab01('0x26')](function(_0x2ef52b){if(_0x2ef52b&&_0x2ef52b[_0xab01('0x47')]){return db[_0xab01('0x79')][_0xab01('0x7a')](function(_0x913b50){var _0x31fcf1={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xab01('0x7b'))},'VoiceQueueId':{'$in':_[_0xab01('0x2c')](_0x2ef52b,'id')},'$or':[{'UserId':null},{'UserId':_0x6b9002['user']['id']}]};var _0x2c3ad1={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x2ef52b)[_0xab01('0x4d')]([_0xab01('0x78'),0x0])['map']('id')[_0xab01('0x7c')]()},'$or':[{'UserId':null},{'UserId':_0x6b9002[_0xab01('0x65')]['id']}]};var _0xb5b639={'$or':[_0x31fcf1,_0x2c3ad1]};var _0xb2f122=[];if(_0x6b9002[_0xab01('0x58')][_0xab01('0x7d')]&&_0x6b9002[_0xab01('0x58')][_0xab01('0x7d')]===_0xab01('0x7e')){if(!_[_0xab01('0x7f')](_0x6b9002[_0xab01('0x58')]['hopperIds'])){_0xb5b639['id']={'$in':_0x6b9002['body']['hopperIds']};}_0xb2f122=[[_0xab01('0x80'),_0xab01('0x81')],[_0xab01('0x82'),_0x2ef52b[0x0][_0xab01('0x77')]===_0xab01('0x81')?'DESC':'ASC'],db['sequelize'][_0xab01('0x83')](_0xab01('0x84')),['id',_0xab01('0x85')]];}else{if(!_[_0xab01('0x7f')](_0x6b9002[_0xab01('0x58')][_0xab01('0x86')])){_0xb5b639['id']={'$notIn':_0x6b9002['body']['hopperIds']};}_0xb2f122=[[_0xab01('0x80'),_0xab01('0x85')],[_0xab01('0x82'),_0x2ef52b[0x0][_0xab01('0x77')]],db['sequelize'][_0xab01('0x83')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id','ASC']];}return db[_0xab01('0x2d')][_0xab01('0x87')]({'attributes':['id',_0xab01('0x88'),_0xab01('0x89')],'where':_0xb5b639,'order':_0xb2f122,'transaction':_0x913b50,'lock':_0x913b50['LOCK'][_0xab01('0x8a')],'include':[{'model':db[_0xab01('0x6c')],'as':_0xab01('0x8b'),'attributes':_0xe2a97e,'include':[{'model':db[_0xab01('0x8c')],'as':_0xab01('0x8d'),'attributes':['id',_0xab01('0x2a')]}]},{'model':db['CmList'],'as':_0xab01('0x8e'),'attributes':['id','name']},{'model':db[_0xab01('0x5c')],'as':_0xab01('0x8f'),'attributes':['id',_0xab01('0x2a'),_0xab01('0x90')]}]})['then'](function(_0x5ec3a2){if(_0x5ec3a2){return _0x5ec3a2[_0xab01('0x25')]({'UserId':_0x6b9002[_0xab01('0x65')]['id']},{'transaction':_0x913b50});}});});}})[_0xab01('0x26')](handleEntityNotFound(_0x510f4c,null))['then'](respondWithResult(_0x510f4c,null))[_0xab01('0x53')](handleError(_0x510f4c,null));};exports[_0xab01('0x91')]=function(_0xe6488a,_0x28066e,_0x586263){var _0x5098da=[];return db[_0xab01('0x6c')][_0xab01('0x59')]()[_0xab01('0x26')](function(_0x2838e1){_0x5098da=_['keys'](_0x2838e1);return _0xe6488a[_0xab01('0x65')][_0xab01('0x74')]({'where':{'type':_0xab01('0x75'),'dialActive':!![],'dialMethod':_0xab01('0x76')},'attributes':['id','dialOrderByScheduledAt',_0xab01('0x78')],'raw':!![]});})['then'](function(_0x430232){if(_0x430232&&_0x430232[_0xab01('0x47')]){return db[_0xab01('0x79')]['transaction'](function(_0x135e0d){var _0x3eca6c={'active':![],'recallme':!![],'id':_0xe6488a[_0xab01('0x58')][_0xab01('0x92')]};return db[_0xab01('0x2d')][_0xab01('0x87')]({'attributes':['id',_0xab01('0x88'),_0xab01('0x89')],'where':_0x3eca6c,'transaction':_0x135e0d,'lock':_0x135e0d[_0xab01('0x93')]['UPDATE'],'include':[{'model':db[_0xab01('0x6c')],'as':_0xab01('0x8b'),'attributes':_0x5098da,'include':[{'model':db[_0xab01('0x8c')],'as':'Company','attributes':['id','name']}]},{'model':db['CmList'],'as':_0xab01('0x8e'),'attributes':['id',_0xab01('0x2a')]},{'model':db[_0xab01('0x5c')],'as':_0xab01('0x8f'),'attributes':['id','name','dialActive']}]})[_0xab01('0x26')](function(_0x57f4a3){if(_0x57f4a3){return _0x57f4a3['update']({'UserId':_0xe6488a['user']['id']},{'transaction':_0x135e0d});}});});}})['then'](handleEntityNotFound(_0x28066e,null))[_0xab01('0x26')](respondWithResult(_0x28066e,null))[_0xab01('0x53')](handleError(_0x28066e,null));};exports['getOpenContacts']=function(_0x3b3fdb,_0x331e57,_0x490fea){return _0x3b3fdb[_0xab01('0x65')]['getVoiceQueues']({'where':{'type':_0xab01('0x75'),'dialActive':!![],'dialMethod':_0xab01('0x76')},'attributes':['id'],'raw':!![]})[_0xab01('0x26')](function(_0x1b3707){if(_0x1b3707&&_0x1b3707[_0xab01('0x47')]){return db[_0xab01('0x2d')][_0xab01('0x21')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xab01('0x67')](_0xab01('0x7b'))},'VoiceQueueId':{'$in':_[_0xab01('0x2c')](_0x1b3707,'id')},'$or':[{'UserId':null},{'UserId':_0x3b3fdb[_0xab01('0x65')]['id']}]}});}return 0x0;})['then'](function(_0x2e0ade){if(!_['isNil'](_0x2e0ade)&&_[_0xab01('0x94')](_0x2e0ade)){return _0x331e57['status'](0xc8)[_0xab01('0x1e')]({'contacts':_0x2e0ade});}else{logger[_0xab01('0x28')](_0xab01('0x95'),_0xab01('0x96'),0x194,_0xab01('0x97'));_0x331e57[_0xab01('0x1b')](0x194);}})[_0xab01('0x53')](handleError(_0x331e57,null));};exports[_0xab01('0x98')]=function(_0x1469ce,_0x1d208a,_0x42d766){var _0x3ce784=shared[_0xab01('0x99')];var _0x3eb521=[];_[_0xab01('0x2c')](_0x3ce784,function(_0x20471c){_0x3eb521[_0xab01('0x9a')]({'id':_0x20471c['name'],'name':_0x20471c[_0xab01('0x2a')],'utcOffset':_0x20471c[_0xab01('0x9b')]});});return _0x1d208a[_0xab01('0x1d')](0xc8)[_0xab01('0x1e')]({'tz':_0x3eb521});};exports[_0xab01('0x9c')]=function(_0x18450e,_0x3a8681,_0x301041){var _0x327293=shared['timezones'];var _0x65bde6={};if(!_[_0xab01('0x6f')](_0x327293[_0x18450e[_0xab01('0x58')]['id']]))_0x65bde6=_0x327293[_0x18450e['body']['id']];return _0x3a8681[_0xab01('0x1d')](0xc8)[_0xab01('0x1e')](_0x65bde6);};
\ No newline at end of file
+var _0xa461=['ASC','literal','DESC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','recallme','LOCK','UPDATE','Contact','CmCompany','Company','CmList','Queue','dialActive','getPreviewRecall','CmContact','outbound','hopperId','scheduledat','List','getOpenContacts','YYYY-MM-DD\x20HH:mm:ss','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','timezones','push','utcOffset','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','concat','$and','$gt','$gte','$lt','$lte','$eq','$between','$notBetween','$like','$notLike','$iLike','$notILike','$overlap','$contains','$any','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','merge','includeAll','include','CmHopper','findAll','rows','show','params','find','catch','create','body','describe','VoiceQueueId','VoiceQueue','Campaign','CampaignId','omit','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','deletedat','format','calleridnum','phone','campaigntype','queue','ivr','ContactId','lastName','isNil','firstName','calleridname','finally','CmHopperFinal','getPreview','getVoiceQueues','preview','dialOrderByScheduledAt','sequelize','transaction','dialPreviewAutoRecallMe','prev','isEmpty','hopperIds','priority'];(function(_0x5938c8,_0x4a9ca){var _0x4353f7=function(_0x50764f){while(--_0x50764f){_0x5938c8['push'](_0x5938c8['shift']());}};_0x4353f7(++_0x4a9ca);}(_0xa461,0x1f2));var _0x1a46=function(_0x28d395,_0x324b13){_0x28d395=_0x28d395-0x0;var _0x16b908=_0xa461[_0x28d395];return _0x16b908;};'use strict';var emlformat=require(_0x1a46('0x0'));var rimraf=require(_0x1a46('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1a46('0x2'));var moment=require(_0x1a46('0x3'));var BPromise=require(_0x1a46('0x4'));var Mustache=require(_0x1a46('0x5'));var util=require(_0x1a46('0x6'));var path=require(_0x1a46('0x7'));var sox=require('sox');var csv=require(_0x1a46('0x8'));var ejs=require(_0x1a46('0x9'));var fs=require('fs');var fs_extra=require(_0x1a46('0xa'));var _=require(_0x1a46('0xb'));var squel=require(_0x1a46('0xc'));var crypto=require(_0x1a46('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1a46('0x8'));var querystring=require(_0x1a46('0xe'));var Papa=require(_0x1a46('0xf'));var Redis=require(_0x1a46('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1a46('0x11'));var as=require(_0x1a46('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1a46('0x13'));var utils=require(_0x1a46('0x14'));var config=require('../../config/environment');var shared=require(_0x1a46('0x15'));var licenseUtil=require(_0x1a46('0x16'));var db=require(_0x1a46('0x17'))['db'];function respondWithStatusCode(_0x3871a4,_0x555000){_0x555000=_0x555000||0xcc;return function(_0x212f05){if(_0x212f05){return _0x3871a4[_0x1a46('0x18')](_0x555000);}return _0x3871a4[_0x1a46('0x19')](_0x555000)[_0x1a46('0x1a')]();};}function respondWithResult(_0x1eed47,_0x4e0f5d){_0x4e0f5d=_0x4e0f5d||0xc8;return function(_0x5501c4){if(_0x5501c4){return _0x1eed47[_0x1a46('0x19')](_0x4e0f5d)[_0x1a46('0x1b')](_0x5501c4);}};}function respondWithFilteredResult(_0x438d2d,_0x178383){return function(_0x158cee){if(_0x158cee){var _0x33350d=typeof _0x178383[_0x1a46('0x1c')]===_0x1a46('0x1d')&&typeof _0x178383[_0x1a46('0x1e')]===_0x1a46('0x1d');var _0xa3813a=_0x158cee[_0x1a46('0x1f')];var _0x326a13=_0x33350d?0x0:_0x178383['offset'];var _0x3691ad=_0x33350d?_0x158cee['count']:_0x178383[_0x1a46('0x1c')]+_0x178383[_0x1a46('0x1e')];var _0x30f0e2;if(_0x3691ad>=_0xa3813a){_0x3691ad=_0xa3813a;_0x30f0e2=0xc8;}else{_0x30f0e2=0xce;}_0x438d2d[_0x1a46('0x19')](_0x30f0e2);return _0x438d2d[_0x1a46('0x20')](_0x1a46('0x21'),_0x326a13+'-'+_0x3691ad+'/'+_0xa3813a)['json'](_0x158cee);}return null;};}function patchUpdates(_0x2b6824){return function(_0xd07442){try{jsonpatch[_0x1a46('0x22')](_0xd07442,_0x2b6824,!![]);}catch(_0x24b08d){return BPromise[_0x1a46('0x23')](_0x24b08d);}return _0xd07442[_0x1a46('0x24')]();};}function saveUpdates(_0x3dac24,_0x77c572){return function(_0xe8621b){if(_0xe8621b){return _0xe8621b[_0x1a46('0x25')](_0x3dac24)[_0x1a46('0x26')](function(_0x1aebb1){return _0x1aebb1;});}return null;};}function removeEntity(_0x564e0e,_0x1406fc){return function(_0x478d73){if(_0x478d73){return _0x478d73[_0x1a46('0x27')]()['then'](function(){_0x564e0e['status'](0xcc)[_0x1a46('0x1a')]();});}};}function handleEntityNotFound(_0xed5782,_0x3c0d96){return function(_0x1d9bdc){if(!_0x1d9bdc){_0xed5782['sendStatus'](0x194);}return _0x1d9bdc;};}function handleError(_0x15c263,_0x1dc75e){_0x1dc75e=_0x1dc75e||0x1f4;return function(_0x42bb03){logger[_0x1a46('0x28')](_0x42bb03[_0x1a46('0x29')]);if(_0x42bb03[_0x1a46('0x2a')]){delete _0x42bb03[_0x1a46('0x2a')];}_0x15c263[_0x1a46('0x19')](_0x1dc75e)[_0x1a46('0x2b')](_0x42bb03);};}exports[_0x1a46('0x2c')]=function(_0x436190,_0x17af9f){var _0x505ff8={},_0x59d8cf={},_0x4e9416={'count':0x0,'rows':[]};var _0x22e805=_[_0x1a46('0x2d')](db['CmHopper'][_0x1a46('0x2e')],function(_0x18eec4){return{'name':_0x18eec4['fieldName'],'type':_0x18eec4[_0x1a46('0x2f')]['key']};});_0x59d8cf[_0x1a46('0x30')]=_['map'](_0x22e805,_0x1a46('0x2a'));_0x59d8cf[_0x1a46('0x31')]=_[_0x1a46('0x32')](_0x436190[_0x1a46('0x31')]);_0x59d8cf[_0x1a46('0x33')]=_[_0x1a46('0x34')](_0x59d8cf[_0x1a46('0x30')],_0x59d8cf[_0x1a46('0x31')]);_0x59d8cf[_0x1a46('0x33')]=_[_0x1a46('0x35')](_0x59d8cf[_0x1a46('0x33')],[_0x1a46('0x36'),'$or',_0x1a46('0x37'),_0x1a46('0x38'),_0x1a46('0x39'),_0x1a46('0x3a'),'$ne',_0x1a46('0x3b'),'$not',_0x1a46('0x3c'),_0x1a46('0x3d'),'$in','$notIn',_0x1a46('0x3e'),_0x1a46('0x3f'),_0x1a46('0x40'),_0x1a46('0x41'),_0x1a46('0x3e'),_0x1a46('0x42'),_0x1a46('0x43'),'$contained',_0x1a46('0x44')]);_0x505ff8[_0x1a46('0x45')]=_[_0x1a46('0x34')](_0x59d8cf[_0x1a46('0x30')],qs[_0x1a46('0x46')](_0x436190[_0x1a46('0x31')][_0x1a46('0x46')]));_0x505ff8['attributes']=_0x505ff8['attributes'][_0x1a46('0x47')]?_0x505ff8['attributes']:_0x59d8cf['model'];if(!_0x436190[_0x1a46('0x31')][_0x1a46('0x48')](_0x1a46('0x49'))){_0x505ff8[_0x1a46('0x1e')]=qs[_0x1a46('0x1e')](_0x436190[_0x1a46('0x31')]['limit']);_0x505ff8['offset']=qs[_0x1a46('0x1c')](_0x436190[_0x1a46('0x31')][_0x1a46('0x1c')]);}_0x505ff8[_0x1a46('0x4a')]=qs['sort'](_0x436190['query']['sort']);_0x505ff8[_0x1a46('0x4b')]=qs[_0x1a46('0x33')](_[_0x1a46('0x4c')](_0x436190[_0x1a46('0x31')],_0x59d8cf[_0x1a46('0x33')]),_0x22e805);if(_0x436190['query'][_0x1a46('0x4d')]){_0x505ff8[_0x1a46('0x4b')]=_['merge'](_0x505ff8['where'],{'$or':_['map'](_0x22e805,function(_0x50bc9c){if(_0x50bc9c['type']!==_0x1a46('0x4e')){var _0x46a93e={};_0x46a93e[_0x50bc9c[_0x1a46('0x2a')]]={'$like':'%'+_0x436190[_0x1a46('0x31')][_0x1a46('0x4d')]+'%'};return _0x46a93e;}})});}_0x505ff8=_[_0x1a46('0x4f')]({},_0x505ff8,_0x436190['options']);var _0x3b34b2={'where':_0x505ff8[_0x1a46('0x4b')]};return db['CmHopper']['count'](_0x3b34b2)[_0x1a46('0x26')](function(_0x6e768d){_0x4e9416[_0x1a46('0x1f')]=_0x6e768d;if(_0x436190[_0x1a46('0x31')][_0x1a46('0x50')]){_0x505ff8[_0x1a46('0x51')]=[{'all':!![]}];}return db[_0x1a46('0x52')][_0x1a46('0x53')](_0x505ff8);})[_0x1a46('0x26')](function(_0x5a5b41){_0x4e9416[_0x1a46('0x54')]=_0x5a5b41;return _0x4e9416;})['then'](respondWithFilteredResult(_0x17af9f,_0x505ff8))['catch'](handleError(_0x17af9f,null));};exports[_0x1a46('0x55')]=function(_0x25411f,_0x9606fc){var _0x3123e7={'raw':!![],'where':{'id':_0x25411f[_0x1a46('0x56')]['id']}},_0x4564a5={};_0x4564a5[_0x1a46('0x30')]=_[_0x1a46('0x32')](db[_0x1a46('0x52')][_0x1a46('0x2e')]);_0x4564a5[_0x1a46('0x31')]=_[_0x1a46('0x32')](_0x25411f['query']);_0x4564a5['filters']=_[_0x1a46('0x34')](_0x4564a5[_0x1a46('0x30')],_0x4564a5[_0x1a46('0x31')]);_0x3123e7[_0x1a46('0x45')]=_[_0x1a46('0x34')](_0x4564a5[_0x1a46('0x30')],qs[_0x1a46('0x46')](_0x25411f['query'][_0x1a46('0x46')]));_0x3123e7[_0x1a46('0x45')]=_0x3123e7['attributes'][_0x1a46('0x47')]?_0x3123e7[_0x1a46('0x45')]:_0x4564a5['model'];if(_0x25411f['query'][_0x1a46('0x50')]){_0x3123e7[_0x1a46('0x51')]=[{'all':!![]}];}_0x3123e7=_[_0x1a46('0x4f')]({},_0x3123e7,_0x25411f['options']);return db[_0x1a46('0x52')][_0x1a46('0x57')](_0x3123e7)['then'](handleEntityNotFound(_0x9606fc,null))[_0x1a46('0x26')](respondWithResult(_0x9606fc,null))[_0x1a46('0x58')](handleError(_0x9606fc,null));};exports[_0x1a46('0x59')]=function(_0x4f7d04,_0x58721d){return db['CmHopper'][_0x1a46('0x59')](_0x4f7d04[_0x1a46('0x5a')],{})[_0x1a46('0x26')](respondWithResult(_0x58721d,0xc9))['catch'](handleError(_0x58721d,null));};exports[_0x1a46('0x25')]=function(_0x4e20c2,_0x2c2027){if(_0x4e20c2[_0x1a46('0x5a')]['id']){delete _0x4e20c2[_0x1a46('0x5a')]['id'];}return db[_0x1a46('0x52')][_0x1a46('0x57')]({'where':{'id':_0x4e20c2[_0x1a46('0x56')]['id']}})[_0x1a46('0x26')](handleEntityNotFound(_0x2c2027,null))[_0x1a46('0x26')](saveUpdates(_0x4e20c2[_0x1a46('0x5a')],null))[_0x1a46('0x26')](respondWithResult(_0x2c2027,null))[_0x1a46('0x58')](handleError(_0x2c2027,null));};exports[_0x1a46('0x5b')]=function(_0x2fe6d9,_0x405c22){return db[_0x1a46('0x52')]['describe']()[_0x1a46('0x26')](respondWithResult(_0x405c22,null))[_0x1a46('0x58')](handleError(_0x405c22,null));};exports[_0x1a46('0x27')]=function(_0x425f21,_0x51a006){var _0x503b2a;return db[_0x1a46('0x52')]['find']({'where':{'id':_0x425f21['params']['id']}})[_0x1a46('0x26')](handleEntityNotFound(_0x51a006,null))['then'](function(_0x2d8b08){if(_0x2d8b08){return _0x2d8b08[_0x1a46('0x27')]()[_0x1a46('0x26')](function(_0x55488f){return _0x55488f;});}})[_0x1a46('0x26')](function(_0x878c7b){_0x503b2a=_0x878c7b;if(_0x878c7b){if(_0x878c7b[_0x1a46('0x5c')]||_0x878c7b['CampaignId']){return db[_0x878c7b[_0x1a46('0x5c')]?_0x1a46('0x5d'):_0x1a46('0x5e')][_0x1a46('0x57')]({'where':{'id':_0x878c7b[_0x1a46('0x5c')]?_0x878c7b[_0x1a46('0x5c')]:_0x878c7b[_0x1a46('0x5f')]},'attributes':['id',_0x1a46('0x2a')],'raw':!![]});}}})['then'](function(_0x3a1745){var _0x7e43ee={};if(_0x3a1745){_[_0x1a46('0x4f')](_0x7e43ee,_[_0x1a46('0x60')](_0x503b2a['dataValues'],[_0x1a46('0x61'),_0x1a46('0x62'),'id']));_0x7e43ee[_0x1a46('0x63')]=0x15;_0x7e43ee[_0x1a46('0x64')]=_0x1a46('0x65');_0x7e43ee[_0x1a46('0x66')]=_0x3a1745[_0x1a46('0x2a')];_0x7e43ee[_0x1a46('0x67')]=_0x425f21[_0x1a46('0x68')]['name'];_0x7e43ee['UserId']=_0x425f21[_0x1a46('0x68')]['id'];_0x7e43ee[_0x1a46('0x65')]=!![];_0x7e43ee[_0x1a46('0x69')]=moment()[_0x1a46('0x6a')]('YYYY-MM-DD\x20HH:mm:ss');_0x7e43ee[_0x1a46('0x6b')]=_0x503b2a[_0x1a46('0x6c')];_0x7e43ee[_0x1a46('0x6d')]=_0x503b2a[_0x1a46('0x5c')]?_0x1a46('0x6e'):_0x1a46('0x6f');return db['CmContact']['find']({'where':{'id':_0x7e43ee[_0x1a46('0x70')]},'attributes':['firstName',_0x1a46('0x71')]})[_0x1a46('0x26')](function(_0x19c9c4){if(!_[_0x1a46('0x72')](_0x51a006)&&!_[_0x1a46('0x72')](_0x19c9c4[_0x1a46('0x73')])){_0x7e43ee[_0x1a46('0x74')]=_0x19c9c4[_0x1a46('0x73')];if(!_[_0x1a46('0x72')](_0x19c9c4['lastName'])){_0x7e43ee[_0x1a46('0x74')]+='\x20'+_0x19c9c4[_0x1a46('0x71')];}}})[_0x1a46('0x75')](function(){return db[_0x1a46('0x76')][_0x1a46('0x59')](_0x7e43ee);});}})[_0x1a46('0x26')](function(){return _0x51a006[_0x1a46('0x19')](0xcc)[_0x1a46('0x1a')]();})[_0x1a46('0x58')](handleError(_0x51a006,null));};exports[_0x1a46('0x77')]=function(_0x28e302,_0x559d76,_0x4d9e28){var _0x35a3a1=[];return db['CmContact'][_0x1a46('0x5b')]()['then'](function(_0x622882){_0x35a3a1=_[_0x1a46('0x32')](_0x622882);return _0x28e302[_0x1a46('0x68')][_0x1a46('0x78')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x1a46('0x79')},'attributes':['id',_0x1a46('0x7a'),'dialPreviewAutoRecallMe'],'raw':!![]});})[_0x1a46('0x26')](function(_0x1f4b2a){if(_0x1f4b2a&&_0x1f4b2a[_0x1a46('0x47')]){return db[_0x1a46('0x7b')][_0x1a46('0x7c')](function(_0xfb7585){var _0x2e7612={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x1a46('0x6a')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x1a46('0x2d')](_0x1f4b2a,'id')},'$or':[{'UserId':null},{'UserId':_0x28e302['user']['id']}]};var _0x53308f={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x1f4b2a)['filter']([_0x1a46('0x7d'),0x0])[_0x1a46('0x2d')]('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x28e302[_0x1a46('0x68')]['id']}]};var _0x1c6b22={'$or':[_0x2e7612,_0x53308f]};var _0x1fa1ed=[];if(_0x28e302[_0x1a46('0x5a')]['direction']&&_0x28e302[_0x1a46('0x5a')]['direction']===_0x1a46('0x7e')){if(!_[_0x1a46('0x7f')](_0x28e302[_0x1a46('0x5a')][_0x1a46('0x80')])){_0x1c6b22['id']={'$in':_0x28e302[_0x1a46('0x5a')]['hopperIds']};}_0x1fa1ed=[[_0x1a46('0x81'),'ASC'],['scheduledAt',_0x1f4b2a[0x0]['dialOrderByScheduledAt']===_0x1a46('0x82')?'DESC':_0x1a46('0x82')],db[_0x1a46('0x7b')][_0x1a46('0x83')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id','DESC']];}else{if(!_[_0x1a46('0x7f')](_0x28e302[_0x1a46('0x5a')][_0x1a46('0x80')])){_0x1c6b22['id']={'$notIn':_0x28e302[_0x1a46('0x5a')][_0x1a46('0x80')]};}_0x1fa1ed=[[_0x1a46('0x81'),_0x1a46('0x84')],['scheduledAt',_0x1f4b2a[0x0][_0x1a46('0x7a')]],db[_0x1a46('0x7b')][_0x1a46('0x83')](_0x1a46('0x85')),['id','ASC']];}return db[_0x1a46('0x52')][_0x1a46('0x86')]({'attributes':['id','scheduledat',_0x1a46('0x87')],'where':_0x1c6b22,'order':_0x1fa1ed,'transaction':_0xfb7585,'lock':_0xfb7585[_0x1a46('0x88')][_0x1a46('0x89')],'include':[{'model':db['CmContact'],'as':_0x1a46('0x8a'),'attributes':_0x35a3a1,'include':[{'model':db[_0x1a46('0x8b')],'as':_0x1a46('0x8c'),'attributes':['id',_0x1a46('0x2a')]}]},{'model':db[_0x1a46('0x8d')],'as':'List','attributes':['id',_0x1a46('0x2a')]},{'model':db[_0x1a46('0x5d')],'as':_0x1a46('0x8e'),'attributes':['id','name',_0x1a46('0x8f')]}]})[_0x1a46('0x26')](function(_0x47113a){if(_0x47113a){return _0x47113a[_0x1a46('0x25')]({'UserId':_0x28e302[_0x1a46('0x68')]['id']},{'transaction':_0xfb7585});}});});}})[_0x1a46('0x26')](handleEntityNotFound(_0x559d76,null))[_0x1a46('0x26')](respondWithResult(_0x559d76,null))[_0x1a46('0x58')](handleError(_0x559d76,null));};exports[_0x1a46('0x90')]=function(_0x459b48,_0x176145,_0x10a92e){var _0x4cf974=[];return db[_0x1a46('0x91')][_0x1a46('0x5b')]()[_0x1a46('0x26')](function(_0x237afa){_0x4cf974=_[_0x1a46('0x32')](_0x237afa);return _0x459b48[_0x1a46('0x68')][_0x1a46('0x78')]({'where':{'type':_0x1a46('0x92'),'dialActive':!![],'dialMethod':_0x1a46('0x79')},'attributes':['id','dialOrderByScheduledAt',_0x1a46('0x7d')],'raw':!![]});})[_0x1a46('0x26')](function(_0x40d6d4){if(_0x40d6d4&&_0x40d6d4[_0x1a46('0x47')]){return db['sequelize'][_0x1a46('0x7c')](function(_0x57a652){var _0x49cdc0={'active':![],'recallme':!![],'id':_0x459b48['body'][_0x1a46('0x93')]};return db[_0x1a46('0x52')][_0x1a46('0x86')]({'attributes':['id',_0x1a46('0x94'),'recallme'],'where':_0x49cdc0,'transaction':_0x57a652,'lock':_0x57a652['LOCK'][_0x1a46('0x89')],'include':[{'model':db[_0x1a46('0x91')],'as':_0x1a46('0x8a'),'attributes':_0x4cf974,'include':[{'model':db[_0x1a46('0x8b')],'as':'Company','attributes':['id',_0x1a46('0x2a')]}]},{'model':db[_0x1a46('0x8d')],'as':_0x1a46('0x95'),'attributes':['id',_0x1a46('0x2a')]},{'model':db[_0x1a46('0x5d')],'as':_0x1a46('0x8e'),'attributes':['id',_0x1a46('0x2a'),_0x1a46('0x8f')]}]})[_0x1a46('0x26')](function(_0x4fda23){if(_0x4fda23){return _0x4fda23['update']({'UserId':_0x459b48['user']['id']},{'transaction':_0x57a652});}});});}})[_0x1a46('0x26')](handleEntityNotFound(_0x176145,null))[_0x1a46('0x26')](respondWithResult(_0x176145,null))[_0x1a46('0x58')](handleError(_0x176145,null));};exports[_0x1a46('0x96')]=function(_0x47e0b2,_0x1d7b3a,_0x1cc2c6){return _0x47e0b2[_0x1a46('0x68')]['getVoiceQueues']({'where':{'type':_0x1a46('0x92'),'dialActive':!![],'dialMethod':_0x1a46('0x79')},'attributes':['id'],'raw':!![]})[_0x1a46('0x26')](function(_0x1257c0){if(_0x1257c0&&_0x1257c0[_0x1a46('0x47')]){return db[_0x1a46('0x52')][_0x1a46('0x1f')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x1a46('0x6a')](_0x1a46('0x97'))},'VoiceQueueId':{'$in':_[_0x1a46('0x2d')](_0x1257c0,'id')},'$or':[{'UserId':null},{'UserId':_0x47e0b2[_0x1a46('0x68')]['id']}]}});}return 0x0;})[_0x1a46('0x26')](function(_0x329185){if(!_[_0x1a46('0x72')](_0x329185)&&_[_0x1a46('0x98')](_0x329185)){return _0x1d7b3a['status'](0xc8)[_0x1a46('0x1b')]({'contacts':_0x329185});}else{logger['error'](_0x1a46('0x99'),_0x1a46('0x96'),0x194,'entity\x20not\x20found');_0x1d7b3a[_0x1a46('0x18')](0x194);}})[_0x1a46('0x58')](handleError(_0x1d7b3a,null));};exports['getTimezones']=function(_0x439879,_0x4ff387,_0xaab662){var _0x4a5b2a=shared[_0x1a46('0x9a')];var _0x5c7227=[];_[_0x1a46('0x2d')](_0x4a5b2a,function(_0x3f9122){_0x5c7227[_0x1a46('0x9b')]({'id':_0x3f9122[_0x1a46('0x2a')],'name':_0x3f9122[_0x1a46('0x2a')],'utcOffset':_0x3f9122[_0x1a46('0x9c')]});});return _0x4ff387['status'](0xc8)[_0x1a46('0x1b')]({'tz':_0x5c7227});};exports['getTimezone']=function(_0x1f0b74,_0x5c632e,_0x2a7c93){var _0x264d55=shared[_0x1a46('0x9a')];var _0x20582f={};if(!_['isNil'](_0x264d55[_0x1f0b74['body']['id']]))_0x20582f=_0x264d55[_0x1f0b74[_0x1a46('0x5a')]['id']];return _0x5c632e['status'](0xc8)[_0x1a46('0x1b')](_0x20582f);};
\ No newline at end of file
index b9617d2..bcfbb44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0295=['define','scheduledat','phone','priority','lodash','api','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0x5471ec,_0x1ce81a){var _0x121d4c=function(_0xefb655){while(--_0xefb655){_0x5471ec['push'](_0x5471ec['shift']());}};_0x121d4c(++_0x1ce81a);}(_0x0295,0x1f0));var _0x5029=function(_0x3d83ac,_0x1d0135){_0x3d83ac=_0x3d83ac-0x0;var _0x299760=_0x0295[_0x3d83ac];return _0x299760;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5029('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5029('0x2'));var fs=require('fs');var path=require(_0x5029('0x3'));var rimraf=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var attributes=require(_0x5029('0x6'));module[_0x5029('0x7')]=function(_0x200217,_0x215955){return _0x200217[_0x5029('0x8')]('CmHopper',attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0x5029('0x9')]},{'name':'phone','fields':[_0x5029('0xa')]},{'name':'priority','fields':[_0x5029('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2a07=['api','moment','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger'];(function(_0x591db7,_0x150445){var _0x4ad760=function(_0x5dd24e){while(--_0x5dd24e){_0x591db7['push'](_0x591db7['shift']());}};_0x4ad760(++_0x150445);}(_0x2a07,0x74));var _0x72a0=function(_0xd75b98,_0x15ad99){_0xd75b98=_0xd75b98-0x0;var _0xdd720e=_0x2a07[_0xd75b98];return _0xdd720e;};'use strict';var _=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var logger=require(_0x72a0('0x2'))(_0x72a0('0x3'));var moment=require(_0x72a0('0x4'));var BPromise=require('bluebird');var rp=require(_0x72a0('0x5'));var fs=require('fs');var path=require(_0x72a0('0x6'));var rimraf=require(_0x72a0('0x7'));var config=require(_0x72a0('0x8'));var attributes=require(_0x72a0('0x9'));module[_0x72a0('0xa')]=function(_0x3ccf6d,_0x20dab9){return _0x3ccf6d[_0x72a0('0xb')](_0x72a0('0xc'),attributes,{'tableName':_0x72a0('0xd'),'paranoid':![],'indexes':[{'name':_0x72a0('0xe'),'fields':[_0x72a0('0xe')]},{'name':_0x72a0('0xf'),'fields':[_0x72a0('0xf')]},{'name':_0x72a0('0x10'),'fields':['priority']}],'timestamps':!![]});};
\ No newline at end of file
index 9131361..166e2f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x724b=['GetContactDialer','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','MoveContactManagedDialer','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','\x22%s\x22','format','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','describe','UPDATE','GetContactRecallMe','GetCmHopperPreview','GetContactByPhone','findOne','dialTimezone','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueId','voicePause','CmList','List','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','twilio/lib/webhooks/webhooks','client','http','request','then','info','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmHopper,\x20%s,\x20%s','catch','GetCmHopper','options','where','attributes','limit','map','include','model','CmHopper','find','raw','ShowCmHopper','CreateCmHopper','create','body','update','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','destroy','DestroyCmHopper','CmContact','sequelize','transaction','findAll','order','LOCK','Contact','keys','User','Agent','name','length','UserId','push','all'];(function(_0x2ba91b,_0x13ba38){var _0x416a59=function(_0x1434c0){while(--_0x1434c0){_0x2ba91b['push'](_0x2ba91b['shift']());}};_0x416a59(++_0x13ba38);}(_0x724b,0xd6));var _0xb724=function(_0x26d5fd,_0x282168){_0x26d5fd=_0x26d5fd-0x0;var _0xcc5e2f=_0x724b[_0x26d5fd];return _0xcc5e2f;};'use strict';var _=require(_0xb724('0x0'));var util=require(_0xb724('0x1'));var moment=require(_0xb724('0x2'));var BPromise=require(_0xb724('0x3'));var rs=require(_0xb724('0x4'));var fs=require('fs');var Redis=require(_0xb724('0x5'));var db=require(_0xb724('0x6'))['db'];var utils=require(_0xb724('0x7'));var logger=require(_0xb724('0x8'))(_0xb724('0x9'));var config=require(_0xb724('0xa'));var jayson=require('jayson/promise');const {validateExpressRequest}=require(_0xb724('0xb'));var client=jayson[_0xb724('0xc')][_0xb724('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x41bbdf,_0x245d8d,_0x417924){return new BPromise(function(_0x3e0dde,_0x203305){return client[_0xb724('0xe')](_0x41bbdf,_0x417924)[_0xb724('0xf')](function(_0x5e747e){logger[_0xb724('0x10')]('CmHopper,\x20%s,\x20%s',_0x245d8d,_0xb724('0x11'));logger[_0xb724('0x12')](_0xb724('0x13'),_0x245d8d,'request\x20sent',JSON[_0xb724('0x14')](_0x5e747e));if(_0x5e747e['error']){if(_0x5e747e[_0xb724('0x15')][_0xb724('0x16')]===0x1f4){logger[_0xb724('0x15')]('CmHopper,\x20%s,\x20%s',_0x245d8d,_0x5e747e[_0xb724('0x15')][_0xb724('0x17')]);return _0x203305(_0x5e747e['error']['message']);}logger[_0xb724('0x15')](_0xb724('0x18'),_0x245d8d,_0x5e747e['error'][_0xb724('0x17')]);return _0x3e0dde(_0x5e747e['error']['message']);}else{logger[_0xb724('0x10')](_0xb724('0x18'),_0x245d8d,_0xb724('0x11'));_0x3e0dde(_0x5e747e['result']['message']);}})[_0xb724('0x19')](function(_0x4231cc){logger['error'](_0xb724('0x18'),_0x245d8d,_0x4231cc);_0x203305(_0x4231cc);});});}exports[_0xb724('0x1a')]=function(_0x47b21e){var _0xe9dec0=this;return new Promise(function(_0x161678,_0x5c14e8){return db['CmHopper']['findAll']({'raw':_0x47b21e[_0xb724('0x1b')]?_0x47b21e[_0xb724('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x47b21e[_0xb724('0x1b')]?_0x47b21e[_0xb724('0x1b')][_0xb724('0x1c')]||null:null,'attributes':_0x47b21e[_0xb724('0x1b')]?_0x47b21e[_0xb724('0x1b')][_0xb724('0x1d')]||null:null,'limit':_0x47b21e[_0xb724('0x1b')]?_0x47b21e[_0xb724('0x1b')][_0xb724('0x1e')]||null:null,'include':_0x47b21e[_0xb724('0x1b')]?_0x47b21e[_0xb724('0x1b')]['include']?_[_0xb724('0x1f')](_0x47b21e['options'][_0xb724('0x20')],function(_0x1c26c7){return{'model':db[_0x1c26c7[_0xb724('0x21')]],'as':_0x1c26c7['as'],'attributes':_0x1c26c7[_0xb724('0x1d')],'include':_0x1c26c7[_0xb724('0x20')]?_[_0xb724('0x1f')](_0x1c26c7[_0xb724('0x20')],function(_0x14f84d){return{'model':db[_0x14f84d[_0xb724('0x21')]],'as':_0x14f84d['as'],'attributes':_0x14f84d[_0xb724('0x1d')],'include':_0x14f84d['include']?_[_0xb724('0x1f')](_0x14f84d[_0xb724('0x20')],function(_0x2f5f8a){return{'model':db[_0x2f5f8a[_0xb724('0x21')]],'as':_0x2f5f8a['as'],'attributes':_0x2f5f8a['attributes']};}):[]};}):[]};}):[]:[]})[_0xb724('0xf')](function(_0x4be869){logger[_0xb724('0x10')](_0xb724('0x1a'),_0x47b21e);logger[_0xb724('0x12')](_0xb724('0x1a'),_0x47b21e,JSON[_0xb724('0x14')](_0x4be869));_0x161678(_0x4be869);})[_0xb724('0x19')](function(_0x3bd80d){logger[_0xb724('0x15')]('GetCmHopper',_0x3bd80d['message'],_0x47b21e);_0x5c14e8(_0xe9dec0[_0xb724('0x15')](0x1f4,_0x3bd80d['message']));});});};exports['ShowCmHopper']=function(_0x5eb8a8){var _0x501f25=this;return new Promise(function(_0x4f2910,_0x9f7376){return db[_0xb724('0x22')][_0xb724('0x23')]({'raw':_0x5eb8a8['options']?_0x5eb8a8['options'][_0xb724('0x24')]===undefined?!![]:![]:!![],'where':_0x5eb8a8['options']?_0x5eb8a8[_0xb724('0x1b')][_0xb724('0x1c')]||null:null,'attributes':_0x5eb8a8[_0xb724('0x1b')]?_0x5eb8a8['options'][_0xb724('0x1d')]||null:null,'include':_0x5eb8a8[_0xb724('0x1b')]?_0x5eb8a8[_0xb724('0x1b')][_0xb724('0x20')]?_[_0xb724('0x1f')](_0x5eb8a8['options'][_0xb724('0x20')],function(_0x8ee258){return{'model':db[_0x8ee258[_0xb724('0x21')]],'as':_0x8ee258['as'],'attributes':_0x8ee258[_0xb724('0x1d')],'include':_0x8ee258[_0xb724('0x20')]?_[_0xb724('0x1f')](_0x8ee258[_0xb724('0x20')],function(_0x2e530c){return{'model':db[_0x2e530c[_0xb724('0x21')]],'as':_0x2e530c['as'],'attributes':_0x2e530c[_0xb724('0x1d')],'include':_0x2e530c[_0xb724('0x20')]?_[_0xb724('0x1f')](_0x2e530c[_0xb724('0x20')],function(_0x2bb264){return{'model':db[_0x2bb264[_0xb724('0x21')]],'as':_0x2bb264['as'],'attributes':_0x2bb264[_0xb724('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x11dde3){logger[_0xb724('0x10')](_0xb724('0x25'),_0x5eb8a8);logger['debug'](_0xb724('0x25'),_0x5eb8a8,JSON[_0xb724('0x14')](_0x11dde3));_0x4f2910(_0x11dde3);})[_0xb724('0x19')](function(_0x156db3){logger[_0xb724('0x15')](_0xb724('0x25'),_0x156db3[_0xb724('0x17')],_0x5eb8a8);_0x9f7376(_0x501f25[_0xb724('0x15')](0x1f4,_0x156db3[_0xb724('0x17')]));});});};exports[_0xb724('0x26')]=function(_0x3c90c4){var _0x1814c5=this;return new Promise(function(_0x16b546,_0xecf09e){return db[_0xb724('0x22')][_0xb724('0x27')](_0x3c90c4[_0xb724('0x28')],{'raw':_0x3c90c4['options']?_0x3c90c4['options']['raw']===undefined?!![]:![]:!![]})[_0xb724('0xf')](function(_0x2a0777){logger['info'](_0xb724('0x26'),_0x3c90c4);logger[_0xb724('0x12')](_0xb724('0x26'),_0x3c90c4,JSON[_0xb724('0x14')](_0x2a0777));_0x16b546(_0x2a0777);})[_0xb724('0x19')](function(_0xa1f317){logger[_0xb724('0x15')]('CreateCmHopper',_0xa1f317[_0xb724('0x17')],_0x3c90c4);_0xecf09e(_0x1814c5[_0xb724('0x15')](0x1f4,_0xa1f317[_0xb724('0x17')]));});});};exports['UpdateCmHopper']=function(_0x219231){var _0x1684e4=this;return new Promise(function(_0x41da2e,_0xe2db86){return db[_0xb724('0x22')][_0xb724('0x29')](_0x219231['body'],{'raw':_0x219231[_0xb724('0x1b')]?_0x219231[_0xb724('0x1b')][_0xb724('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x219231[_0xb724('0x1b')]?_0x219231[_0xb724('0x1b')]['where']||null:null,'attributes':_0x219231[_0xb724('0x1b')]?_0x219231[_0xb724('0x1b')][_0xb724('0x1d')]||null:null,'limit':_0x219231[_0xb724('0x1b')]?_0x219231[_0xb724('0x1b')]['limit']||null:null})[_0xb724('0xf')](function(_0x15fe43){logger[_0xb724('0x10')](_0xb724('0x2a'),_0x219231);logger['info'](_0xb724('0x2b'),JSON[_0xb724('0x14')](_0x219231[_0xb724('0x1b')]['where']),_0x219231['body'][_0xb724('0x2c')]);logger['debug'](_0xb724('0x2a'),_0x219231,JSON[_0xb724('0x14')](_0x15fe43));_0x41da2e(_0x15fe43);})['catch'](function(_0x323144){logger[_0xb724('0x15')](_0xb724('0x2a'),_0x323144['message'],_0x219231);_0xe2db86(_0x1684e4[_0xb724('0x15')](0x1f4,_0x323144['message']));});});};exports['DestroyCmHopper']=function(_0x557284){var _0x3e4397=this;return new Promise(function(_0x13ba25,_0x35b899){return db[_0xb724('0x22')][_0xb724('0x2d')]({'where':_0x557284[_0xb724('0x1b')]?_0x557284[_0xb724('0x1b')][_0xb724('0x1c')]||null:null})[_0xb724('0xf')](function(_0x1b5c39){logger[_0xb724('0x10')]('DestroyCmHopper',_0x557284);logger[_0xb724('0x12')](_0xb724('0x2e'),_0x557284,JSON[_0xb724('0x14')](_0x1b5c39));_0x13ba25(_0x1b5c39);})['catch'](function(_0x4bb99b){logger[_0xb724('0x15')]('DestroyCmHopper',_0x4bb99b['message'],_0x557284);_0x35b899(_0x3e4397[_0xb724('0x15')](0x1f4,_0x4bb99b[_0xb724('0x17')]));});});};exports['GetContactDialer']=function(_0x6b973e){var _0x3d8b9d=this;return new Promise(function(_0x7bb881,_0x204f31){return db[_0xb724('0x2f')]['describe']()[_0xb724('0xf')](function(_0x4b8e56){return db[_0xb724('0x30')][_0xb724('0x31')](function(_0x3501b5){return db['CmHopper'][_0xb724('0x32')]({'where':_0x6b973e['options']?_0x6b973e[_0xb724('0x1b')][_0xb724('0x1c')]||null:null,'attributes':_0x6b973e[_0xb724('0x1b')]?_0x6b973e['options'][_0xb724('0x1d')]||null:null,'limit':_0x6b973e['options']?_0x6b973e[_0xb724('0x1b')]['limit']||null:null,'order':_0x6b973e[_0xb724('0x1b')]?_0x6b973e[_0xb724('0x1b')][_0xb724('0x33')]||null:null,'transaction':_0x3501b5,'lock':_0x3501b5[_0xb724('0x34')]['UPDATE'],'include':[{'model':db[_0xb724('0x2f')],'as':_0xb724('0x35'),'attributes':_[_0xb724('0x36')](_0x4b8e56)},{'model':db[_0xb724('0x37')],'as':_0xb724('0x38'),'attributes':['id',_0xb724('0x39'),'voicePause']}]})[_0xb724('0xf')](function(_0x23a473){var _0x34510a=[];var _0x2c0551=[];for(var _0x57f683=0x0;_0x57f683<_0x23a473[_0xb724('0x3a')];_0x57f683+=0x1){var _0x3adfc7=_0x23a473[_0x57f683][_0xb724('0x3b')];if(_0x3adfc7===null){_0x34510a['push'](_0x23a473[_0x57f683][_0xb724('0x29')](_0x6b973e[_0xb724('0x28')],{'transaction':_0x3501b5}));}else if(!_0x2c0551['includes'](_0x3adfc7)){_0x2c0551[_0xb724('0x3c')](_0x3adfc7);_0x34510a[_0xb724('0x3c')](_0x23a473[_0x57f683][_0xb724('0x29')](_0x6b973e[_0xb724('0x28')],{'transaction':_0x3501b5}));}}return BPromise[_0xb724('0x3d')](_0x34510a);});})[_0xb724('0xf')](function(_0x3e51a5){logger[_0xb724('0x10')](_0xb724('0x3e'),_0x6b973e);if(_0x3e51a5['length']>0x0){logger[_0xb724('0x10')](_0xb724('0x3f'),_0x3e51a5[0x0]['dataValues']['id'],_0x3e51a5[0x0][_0xb724('0x40')]['ContactId'],_0x3e51a5[0x0]['dataValues'][_0xb724('0x2c')]);}logger[_0xb724('0x12')](_0xb724('0x3e'),_0x6b973e,JSON['stringify'](_0x3e51a5));_0x7bb881(_0x3e51a5);})[_0xb724('0x19')](function(_0x36384f){logger[_0xb724('0x15')](_0xb724('0x3e'),_0x36384f[_0xb724('0x17')],_0x6b973e);_0x204f31(_0x3d8b9d['error'](0x1f4,_0x36384f[_0xb724('0x17')]));});});});};exports[_0xb724('0x41')]=function(_0x5738ac){var _0x1727e5=this;return new Promise(function(_0x5741d0,_0x1f4195){return db['sequelize']['transaction'](function(_0x10a49f){return db[_0xb724('0x42')][_0xb724('0x27')](_0x5738ac[_0xb724('0x28')],{'raw':_0x5738ac[_0xb724('0x1b')]?_0x5738ac[_0xb724('0x1b')][_0xb724('0x24')]===undefined?!![]:![]:!![],'transaction':_0x10a49f})['then'](function(){logger[_0xb724('0x10')](_0xb724('0x43'),JSON[_0xb724('0x14')](_0x5738ac['options']['where']),_0x5738ac[_0xb724('0x1b')][_0xb724('0x1c')][_0xb724('0x2c')]);return db[_0xb724('0x22')][_0xb724('0x2d')]({'where':_0x5738ac[_0xb724('0x1b')]?_0x5738ac[_0xb724('0x1b')][_0xb724('0x1c')]||null:null,'transaction':_0x10a49f});});})[_0xb724('0xf')](function(_0x639092){logger[_0xb724('0x10')]('MoveContactManagedDialer',_0x5738ac);logger[_0xb724('0x12')](_0xb724('0x41'),_0x5738ac,JSON[_0xb724('0x14')](_0x639092));_0x5741d0(_0x639092);})[_0xb724('0x19')](function(_0x8d4a2e){logger[_0xb724('0x15')](_0xb724('0x41'),_0x8d4a2e[_0xb724('0x17')],_0x5738ac);_0x1f4195(_0x1727e5[_0xb724('0x15')](0x1f4,_0x8d4a2e[_0xb724('0x17')]));});});};exports[_0xb724('0x44')]=function(_0x5ba7b6){var _0x59b528=this;return new Promise(function(_0x44dd80,_0x1b5a17){return db[_0xb724('0x22')][_0xb724('0x32')]({'raw':_0x5ba7b6[_0xb724('0x1b')]?_0x5ba7b6[_0xb724('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x5ba7b6[_0xb724('0x1b')]?_0x5ba7b6['options'][_0xb724('0x1c')]||null:null,'attributes':[[db[_0xb724('0x30')]['fn'](_0xb724('0x45'),db[_0xb724('0x30')]['fn']('IF',db[_0xb724('0x30')][_0xb724('0x46')](_0xb724('0x47')+util['format'](_0xb724('0x48'),moment()[_0xb724('0x49')](_0xb724('0x4a')))+'\x20,\x201,\x20null'))),_0xb724('0x4b')]]})['then'](function(_0x1238ca){logger[_0xb724('0x10')]('CountReScheduled',_0x5ba7b6);logger[_0xb724('0x12')](_0xb724('0x44'),_0x5ba7b6,JSON[_0xb724('0x14')](_0x1238ca));_0x44dd80(_0x1238ca);})[_0xb724('0x19')](function(_0x1fb8f8){logger[_0xb724('0x15')](_0xb724('0x44'),_0x1fb8f8['message'],_0x5ba7b6);_0x1b5a17(_0x59b528[_0xb724('0x15')](0x1f4,_0x1fb8f8[_0xb724('0x17')]));});});};exports['GetContactRecallMe']=function(_0x12a970){var _0x20b623=this;return new Promise(function(_0x2722cb,_0x338eec){return db[_0xb724('0x2f')][_0xb724('0x4c')]()[_0xb724('0xf')](function(_0x59840e){return db[_0xb724('0x30')]['transaction'](function(_0x14ef8){return db[_0xb724('0x22')][_0xb724('0x32')]({'where':_0x12a970[_0xb724('0x1b')]?_0x12a970['options'][_0xb724('0x1c')]||null:null,'attributes':_0x12a970[_0xb724('0x1b')]?_0x12a970[_0xb724('0x1b')][_0xb724('0x1d')]||null:null,'limit':0x1,'order':_0x12a970[_0xb724('0x1b')]?_0x12a970['options'][_0xb724('0x33')]||null:null,'group':db[_0xb724('0x22')]['UserId'],'transaction':_0x14ef8,'lock':_0x14ef8[_0xb724('0x34')][_0xb724('0x4d')],'include':_0x12a970[_0xb724('0x1b')]?_0x12a970['options'][_0xb724('0x20')]?_[_0xb724('0x1f')](_0x12a970['options'][_0xb724('0x20')],function(_0x3e4f58){return{'model':db[_0x3e4f58[_0xb724('0x21')]],'as':_0x3e4f58['as'],'attributes':_0x3e4f58[_0xb724('0x1d')],'include':_0x3e4f58[_0xb724('0x20')]?_[_0xb724('0x1f')](_0x3e4f58[_0xb724('0x20')],function(_0x311bfe){return{'model':db[_0x311bfe[_0xb724('0x21')]],'as':_0x311bfe['as'],'attributes':_0x311bfe['attributes'],'include':_0x311bfe['include']?_[_0xb724('0x1f')](_0x311bfe[_0xb724('0x20')],function(_0x1608b8){return{'model':db[_0x1608b8[_0xb724('0x21')]],'as':_0x1608b8['as'],'attributes':_0x1608b8[_0xb724('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb724('0xf')](function(_0x955d9e){var _0x5453ee=[];for(var _0x34c264=0x0;_0x34c264<_0x955d9e[_0xb724('0x3a')];_0x34c264+=0x1){_0x5453ee[_0xb724('0x3c')](_0x955d9e[_0x34c264][_0xb724('0x29')](_0x12a970[_0xb724('0x28')],{'transaction':_0x14ef8}));}return BPromise[_0xb724('0x3d')](_0x5453ee);});})['then'](function(_0x57d92d){logger['info'](_0xb724('0x4e'),_0x12a970);logger[_0xb724('0x12')](_0xb724('0x4e'),_0x12a970,JSON[_0xb724('0x14')](_0x57d92d));_0x2722cb(_0x57d92d);})[_0xb724('0x19')](function(_0xe97eae){logger['error'](_0xb724('0x4e'),_0xe97eae['message'],_0x12a970);_0x338eec(_0x20b623[_0xb724('0x15')](0x1f4,_0xe97eae[_0xb724('0x17')]));});});});};exports[_0xb724('0x4f')]=function(_0x2224b2){var _0x50973e=this;return new Promise(function(_0x49e6e5,_0x475a59){db['CmContact'][_0xb724('0x4c')]()[_0xb724('0xf')](function(_0x27983b){return db['CmHopper'][_0xb724('0x32')]({'raw':_0x2224b2[_0xb724('0x1b')]?_0x2224b2[_0xb724('0x1b')][_0xb724('0x24')]===undefined?!![]:![]:!![],'where':_0x2224b2['options']?_0x2224b2['options']['where']||null:null,'attributes':_0x2224b2[_0xb724('0x1b')]?_0x2224b2[_0xb724('0x1b')][_0xb724('0x1d')]||null:null,'limit':_0x2224b2[_0xb724('0x1b')]?_0x2224b2[_0xb724('0x1b')][_0xb724('0x1e')]||null:null,'include':_0x2224b2[_0xb724('0x1b')]?_0x2224b2[_0xb724('0x1b')][_0xb724('0x20')]?_[_0xb724('0x1f')](_0x2224b2[_0xb724('0x1b')][_0xb724('0x20')],function(_0x26c1b4){return{'model':db[_0x26c1b4['model']],'as':_0x26c1b4['as'],'attributes':_0x26c1b4['as']==='Contact'?_[_0xb724('0x36')](_0x27983b):_0x26c1b4[_0xb724('0x1d')],'include':_0x26c1b4['include']?_[_0xb724('0x1f')](_0x26c1b4[_0xb724('0x20')],function(_0x271b84){return{'model':db[_0x271b84['model']],'as':_0x271b84['as'],'attributes':_0x271b84['attributes'],'include':_0x271b84[_0xb724('0x20')]?_['map'](_0x271b84[_0xb724('0x20')],function(_0x6775ec){return{'model':db[_0x6775ec[_0xb724('0x21')]],'as':_0x6775ec['as'],'attributes':_0x6775ec[_0xb724('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4821c5){logger[_0xb724('0x10')](_0xb724('0x1a'),_0x2224b2);logger[_0xb724('0x12')](_0xb724('0x1a'),_0x2224b2,JSON[_0xb724('0x14')](_0x4821c5));_0x49e6e5(_0x4821c5);})['catch'](function(_0x435608){logger['error']('GetCmHopper',_0x435608[_0xb724('0x17')],_0x2224b2);_0x475a59(_0x50973e[_0xb724('0x15')](0x1f4,_0x435608[_0xb724('0x17')]));});});});};exports[_0xb724('0x50')]=function(_0x33f306){var _0x176625=this;return new Promise(function(_0xc5152e,_0x4be526){return db[_0xb724('0x2f')][_0xb724('0x51')]({'raw':!![],'where':{'phone':_0x33f306[_0xb724('0x1b')][_0xb724('0x1c')]['phone']},'attributes':['id',_0xb724('0x52')],'order':[['id','DESC']]})[_0xb724('0xf')](function(_0xfffd50){logger['info'](_0xb724('0x53'),_0x33f306);logger[_0xb724('0x12')]('getContactByPhone',_0x33f306,JSON[_0xb724('0x14')](_0xfffd50));_0xc5152e(_0xfffd50);})[_0xb724('0x19')](function(_0x159e44){logger[_0xb724('0x15')](_0xb724('0x53'),_0x159e44[_0xb724('0x17')],_0x33f306);_0x4be526(_0x176625[_0xb724('0x15')](0x1f4,_0x159e44['message']));});});};exports[_0xb724('0x54')]=function(_0x49109d){var _0x2592dd=this;return new Promise(function(_0x30ed6d,_0x4ff4c6){return db[_0xb724('0x30')][_0xb724('0x31')](function(_0x149e90){return db[_0xb724('0x22')][_0xb724('0x29')]({'active':![]},{'where':{},'transaction':_0x149e90})['then'](function(_0x2001e8){logger['info'](_0xb724('0x54'),_0x49109d);logger[_0xb724('0x12')]('ResetActiveCalls',_0x49109d,JSON[_0xb724('0x14')](_0x2001e8));_0x30ed6d(_0x2001e8);})[_0xb724('0x19')](function(_0x4d26dd){logger[_0xb724('0x15')](_0xb724('0x54'),_0x4d26dd[_0xb724('0x17')],_0x49109d);_0x4ff4c6(_0x2592dd[_0xb724('0x15')](0x1f4,_0x4d26dd['message']));});});});};exports[_0xb724('0x55')]=function(_0x309a2b){var _0x38c3d2=this;var _0x590883=_0x309a2b['body'][_0xb724('0x1c')][_0xb724('0x56')];var _0x4c05df=_0x309a2b[_0xb724('0x28')][_0xb724('0x1c')]['interval'];return new Promise(function(_0x2cb12c,_0x23cc1b){return db[_0xb724('0x22')][_0xb724('0x32')]({'where':{'voiceQueueId':_0x590883,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0xb724('0x30')]['literal']('NOW()\x20+\x20INTERVAL\x20'+_0x4c05df+'\x20MINUTE')}},'include':[{'model':db[_0xb724('0x2f')],'as':_0xb724('0x35')},{'model':db[_0xb724('0x37')],'as':'Agent','attributes':['id','name',_0xb724('0x57')]},{'model':db[_0xb724('0x58')],'as':_0xb724('0x59')}]})[_0xb724('0xf')](function(_0x42e4d0){return db[_0xb724('0x30')][_0xb724('0x31')](function(_0xc3bda2){return db[_0xb724('0x22')][_0xb724('0x29')]({'recallmeNotifiedDate':new Date()},{'where':{'voiceQueueId':_0x590883,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db['sequelize'][_0xb724('0x46')](_0xb724('0x5a')+_0x4c05df+_0xb724('0x5b'))}},'transaction':_0xc3bda2})[_0xb724('0xf')](function(_0x16a9fa){_0x2cb12c(_0x42e4d0);})['catch'](function(_0x12eeb7){logger['error'](_0xb724('0x55'),_0x12eeb7[_0xb724('0x17')],_0x309a2b);_0x23cc1b(validateExpressRequest);});});})['catch'](function(_0x453239){logger[_0xb724('0x15')](_0xb724('0x55'),_0x453239['message'],_0x309a2b);_0x23cc1b(_0x38c3d2[_0xb724('0x15')](0x1f4,_0x453239[_0xb724('0x17')]));});});};
\ No newline at end of file
+var _0xc111=['order','LOCK','UPDATE','Contact','keys','User','Agent','voicePause','length','UserId','push','update','includes','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','sequelize','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','GetContactRecallMe','GetCmHopperPreview','GetContactByPhone','findOne','phone','dialTimezone','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','interval','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','CmList','List','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','twilio/lib/webhooks/webhooks','client','http','request','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','raw','where','limit','include','map','model','attributes','then','GetCmHopper','ShowCmHopper','CmHopper','find','CreateCmHopper','create','UpdateCmHopper','body','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','transaction'];(function(_0x54996f,_0x15e866){var _0x9c2827=function(_0x3b40a7){while(--_0x3b40a7){_0x54996f['push'](_0x54996f['shift']());}};_0x9c2827(++_0x15e866);}(_0xc111,0xda));var _0x1c11=function(_0x458c85,_0x1c791a){_0x458c85=_0x458c85-0x0;var _0x5c6213=_0xc111[_0x458c85];return _0x5c6213;};'use strict';var _=require(_0x1c11('0x0'));var util=require(_0x1c11('0x1'));var moment=require('moment');var BPromise=require(_0x1c11('0x2'));var rs=require(_0x1c11('0x3'));var fs=require('fs');var Redis=require(_0x1c11('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1c11('0x5'));var logger=require(_0x1c11('0x6'))('rpc');var config=require(_0x1c11('0x7'));var jayson=require('jayson/promise');const {validateExpressRequest}=require(_0x1c11('0x8'));var client=jayson[_0x1c11('0x9')][_0x1c11('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4636c6,_0x580616,_0x4c11c8){return new BPromise(function(_0x5f0d16,_0x43e778){return client[_0x1c11('0xb')](_0x4636c6,_0x4c11c8)['then'](function(_0x377895){logger[_0x1c11('0xc')](_0x1c11('0xd'),_0x580616,_0x1c11('0xe'));logger[_0x1c11('0xf')](_0x1c11('0x10'),_0x580616,_0x1c11('0xe'),JSON[_0x1c11('0x11')](_0x377895));if(_0x377895['error']){if(_0x377895[_0x1c11('0x12')][_0x1c11('0x13')]===0x1f4){logger[_0x1c11('0x12')]('CmHopper,\x20%s,\x20%s',_0x580616,_0x377895[_0x1c11('0x12')][_0x1c11('0x14')]);return _0x43e778(_0x377895[_0x1c11('0x12')][_0x1c11('0x14')]);}logger[_0x1c11('0x12')](_0x1c11('0xd'),_0x580616,_0x377895['error']['message']);return _0x5f0d16(_0x377895[_0x1c11('0x12')]['message']);}else{logger[_0x1c11('0xc')](_0x1c11('0xd'),_0x580616,_0x1c11('0xe'));_0x5f0d16(_0x377895[_0x1c11('0x15')][_0x1c11('0x14')]);}})[_0x1c11('0x16')](function(_0x13de9c){logger[_0x1c11('0x12')](_0x1c11('0xd'),_0x580616,_0x13de9c);_0x43e778(_0x13de9c);});});}exports['GetCmHopper']=function(_0x2a3e60){var _0x1d97eb=this;return new Promise(function(_0x3a2e75,_0x214a57){return db['CmHopper'][_0x1c11('0x17')]({'raw':_0x2a3e60['options']?_0x2a3e60[_0x1c11('0x18')][_0x1c11('0x19')]===undefined?!![]:![]:!![],'where':_0x2a3e60[_0x1c11('0x18')]?_0x2a3e60[_0x1c11('0x18')][_0x1c11('0x1a')]||null:null,'attributes':_0x2a3e60[_0x1c11('0x18')]?_0x2a3e60[_0x1c11('0x18')]['attributes']||null:null,'limit':_0x2a3e60['options']?_0x2a3e60[_0x1c11('0x18')][_0x1c11('0x1b')]||null:null,'include':_0x2a3e60[_0x1c11('0x18')]?_0x2a3e60[_0x1c11('0x18')][_0x1c11('0x1c')]?_[_0x1c11('0x1d')](_0x2a3e60[_0x1c11('0x18')][_0x1c11('0x1c')],function(_0x809197){return{'model':db[_0x809197[_0x1c11('0x1e')]],'as':_0x809197['as'],'attributes':_0x809197[_0x1c11('0x1f')],'include':_0x809197[_0x1c11('0x1c')]?_[_0x1c11('0x1d')](_0x809197[_0x1c11('0x1c')],function(_0x4799ef){return{'model':db[_0x4799ef[_0x1c11('0x1e')]],'as':_0x4799ef['as'],'attributes':_0x4799ef['attributes'],'include':_0x4799ef[_0x1c11('0x1c')]?_['map'](_0x4799ef[_0x1c11('0x1c')],function(_0x516eb2){return{'model':db[_0x516eb2[_0x1c11('0x1e')]],'as':_0x516eb2['as'],'attributes':_0x516eb2['attributes']};}):[]};}):[]};}):[]:[]})[_0x1c11('0x20')](function(_0x35c1bf){logger[_0x1c11('0xc')](_0x1c11('0x21'),_0x2a3e60);logger[_0x1c11('0xf')](_0x1c11('0x21'),_0x2a3e60,JSON[_0x1c11('0x11')](_0x35c1bf));_0x3a2e75(_0x35c1bf);})[_0x1c11('0x16')](function(_0x29a19e){logger[_0x1c11('0x12')](_0x1c11('0x21'),_0x29a19e[_0x1c11('0x14')],_0x2a3e60);_0x214a57(_0x1d97eb['error'](0x1f4,_0x29a19e[_0x1c11('0x14')]));});});};exports[_0x1c11('0x22')]=function(_0x2f3f36){var _0x588d40=this;return new Promise(function(_0x18afb6,_0x1438c3){return db[_0x1c11('0x23')][_0x1c11('0x24')]({'raw':_0x2f3f36[_0x1c11('0x18')]?_0x2f3f36[_0x1c11('0x18')][_0x1c11('0x19')]===undefined?!![]:![]:!![],'where':_0x2f3f36['options']?_0x2f3f36[_0x1c11('0x18')][_0x1c11('0x1a')]||null:null,'attributes':_0x2f3f36[_0x1c11('0x18')]?_0x2f3f36[_0x1c11('0x18')][_0x1c11('0x1f')]||null:null,'include':_0x2f3f36[_0x1c11('0x18')]?_0x2f3f36[_0x1c11('0x18')][_0x1c11('0x1c')]?_[_0x1c11('0x1d')](_0x2f3f36[_0x1c11('0x18')][_0x1c11('0x1c')],function(_0x18a170){return{'model':db[_0x18a170[_0x1c11('0x1e')]],'as':_0x18a170['as'],'attributes':_0x18a170[_0x1c11('0x1f')],'include':_0x18a170[_0x1c11('0x1c')]?_[_0x1c11('0x1d')](_0x18a170[_0x1c11('0x1c')],function(_0x285e6a){return{'model':db[_0x285e6a[_0x1c11('0x1e')]],'as':_0x285e6a['as'],'attributes':_0x285e6a['attributes'],'include':_0x285e6a['include']?_[_0x1c11('0x1d')](_0x285e6a[_0x1c11('0x1c')],function(_0x45ba4c){return{'model':db[_0x45ba4c[_0x1c11('0x1e')]],'as':_0x45ba4c['as'],'attributes':_0x45ba4c[_0x1c11('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5cc349){logger[_0x1c11('0xc')](_0x1c11('0x22'),_0x2f3f36);logger[_0x1c11('0xf')]('ShowCmHopper',_0x2f3f36,JSON[_0x1c11('0x11')](_0x5cc349));_0x18afb6(_0x5cc349);})[_0x1c11('0x16')](function(_0x1a7a9f){logger[_0x1c11('0x12')](_0x1c11('0x22'),_0x1a7a9f[_0x1c11('0x14')],_0x2f3f36);_0x1438c3(_0x588d40['error'](0x1f4,_0x1a7a9f['message']));});});};exports[_0x1c11('0x25')]=function(_0x4f5962){var _0x583247=this;return new Promise(function(_0x1656e5,_0x23a3de){return db[_0x1c11('0x23')][_0x1c11('0x26')](_0x4f5962['body'],{'raw':_0x4f5962[_0x1c11('0x18')]?_0x4f5962[_0x1c11('0x18')][_0x1c11('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0xd86495){logger[_0x1c11('0xc')]('CreateCmHopper',_0x4f5962);logger[_0x1c11('0xf')](_0x1c11('0x25'),_0x4f5962,JSON[_0x1c11('0x11')](_0xd86495));_0x1656e5(_0xd86495);})[_0x1c11('0x16')](function(_0xde0da2){logger['error'](_0x1c11('0x25'),_0xde0da2[_0x1c11('0x14')],_0x4f5962);_0x23a3de(_0x583247[_0x1c11('0x12')](0x1f4,_0xde0da2['message']));});});};exports[_0x1c11('0x27')]=function(_0x55e95d){var _0x349918=this;return new Promise(function(_0x280739,_0x310288){return db[_0x1c11('0x23')]['update'](_0x55e95d[_0x1c11('0x28')],{'raw':_0x55e95d[_0x1c11('0x18')]?_0x55e95d[_0x1c11('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55e95d['options']?_0x55e95d[_0x1c11('0x18')]['where']||null:null,'attributes':_0x55e95d['options']?_0x55e95d[_0x1c11('0x18')][_0x1c11('0x1f')]||null:null,'limit':_0x55e95d[_0x1c11('0x18')]?_0x55e95d[_0x1c11('0x18')][_0x1c11('0x1b')]||null:null})['then'](function(_0x40138e){logger[_0x1c11('0xc')](_0x1c11('0x27'),_0x55e95d);logger[_0x1c11('0xc')](_0x1c11('0x29'),JSON[_0x1c11('0x11')](_0x55e95d[_0x1c11('0x18')][_0x1c11('0x1a')]),_0x55e95d[_0x1c11('0x28')][_0x1c11('0x2a')]);logger[_0x1c11('0xf')](_0x1c11('0x27'),_0x55e95d,JSON[_0x1c11('0x11')](_0x40138e));_0x280739(_0x40138e);})[_0x1c11('0x16')](function(_0x314fe4){logger[_0x1c11('0x12')]('UpdateCmHopper',_0x314fe4[_0x1c11('0x14')],_0x55e95d);_0x310288(_0x349918[_0x1c11('0x12')](0x1f4,_0x314fe4[_0x1c11('0x14')]));});});};exports[_0x1c11('0x2b')]=function(_0x165e54){var _0x3ea58b=this;return new Promise(function(_0x307f1b,_0x4b36d5){return db['CmHopper'][_0x1c11('0x2c')]({'where':_0x165e54[_0x1c11('0x18')]?_0x165e54[_0x1c11('0x18')][_0x1c11('0x1a')]||null:null})[_0x1c11('0x20')](function(_0x10f6c5){logger[_0x1c11('0xc')]('DestroyCmHopper',_0x165e54);logger['debug'](_0x1c11('0x2b'),_0x165e54,JSON['stringify'](_0x10f6c5));_0x307f1b(_0x10f6c5);})[_0x1c11('0x16')](function(_0x5ec2e7){logger['error'](_0x1c11('0x2b'),_0x5ec2e7[_0x1c11('0x14')],_0x165e54);_0x4b36d5(_0x3ea58b[_0x1c11('0x12')](0x1f4,_0x5ec2e7[_0x1c11('0x14')]));});});};exports[_0x1c11('0x2d')]=function(_0x2cdfb9){var _0xb0656d=this;return new Promise(function(_0xc0e826,_0x54160f){return db[_0x1c11('0x2e')][_0x1c11('0x2f')]()[_0x1c11('0x20')](function(_0x46ce55){return db['sequelize'][_0x1c11('0x30')](function(_0x3982cc){return db['CmHopper']['findAll']({'where':_0x2cdfb9['options']?_0x2cdfb9[_0x1c11('0x18')]['where']||null:null,'attributes':_0x2cdfb9[_0x1c11('0x18')]?_0x2cdfb9[_0x1c11('0x18')]['attributes']||null:null,'limit':_0x2cdfb9[_0x1c11('0x18')]?_0x2cdfb9[_0x1c11('0x18')]['limit']||null:null,'order':_0x2cdfb9['options']?_0x2cdfb9['options'][_0x1c11('0x31')]||null:null,'transaction':_0x3982cc,'lock':_0x3982cc[_0x1c11('0x32')][_0x1c11('0x33')],'include':[{'model':db[_0x1c11('0x2e')],'as':_0x1c11('0x34'),'attributes':_[_0x1c11('0x35')](_0x46ce55)},{'model':db[_0x1c11('0x36')],'as':_0x1c11('0x37'),'attributes':['id','name',_0x1c11('0x38')]}]})[_0x1c11('0x20')](function(_0x306959){var _0x517c6e=[];var _0x5a3d4b=[];for(var _0x19acf6=0x0;_0x19acf6<_0x306959[_0x1c11('0x39')];_0x19acf6+=0x1){var _0x5ec40d=_0x306959[_0x19acf6][_0x1c11('0x3a')];if(_0x5ec40d===null){_0x517c6e[_0x1c11('0x3b')](_0x306959[_0x19acf6][_0x1c11('0x3c')](_0x2cdfb9[_0x1c11('0x28')],{'transaction':_0x3982cc}));}else if(!_0x5a3d4b[_0x1c11('0x3d')](_0x5ec40d)){_0x5a3d4b[_0x1c11('0x3b')](_0x5ec40d);_0x517c6e[_0x1c11('0x3b')](_0x306959[_0x19acf6][_0x1c11('0x3c')](_0x2cdfb9[_0x1c11('0x28')],{'transaction':_0x3982cc}));}}return BPromise['all'](_0x517c6e);});})[_0x1c11('0x20')](function(_0x352068){logger['info'](_0x1c11('0x2d'),_0x2cdfb9);if(_0x352068['length']>0x0){logger['info'](_0x1c11('0x3e'),_0x352068[0x0][_0x1c11('0x3f')]['id'],_0x352068[0x0][_0x1c11('0x3f')][_0x1c11('0x40')],_0x352068[0x0]['dataValues'][_0x1c11('0x2a')]);}logger[_0x1c11('0xf')]('GetContactDialer',_0x2cdfb9,JSON[_0x1c11('0x11')](_0x352068));_0xc0e826(_0x352068);})[_0x1c11('0x16')](function(_0x598ca0){logger[_0x1c11('0x12')]('GetContactDialer',_0x598ca0['message'],_0x2cdfb9);_0x54160f(_0xb0656d[_0x1c11('0x12')](0x1f4,_0x598ca0['message']));});});});};exports[_0x1c11('0x41')]=function(_0x585f14){var _0x3670f6=this;return new Promise(function(_0x14b8c5,_0x5dea29){return db[_0x1c11('0x42')][_0x1c11('0x30')](function(_0x5e6412){return db['CmHopperFinal'][_0x1c11('0x26')](_0x585f14[_0x1c11('0x28')],{'raw':_0x585f14['options']?_0x585f14[_0x1c11('0x18')][_0x1c11('0x19')]===undefined?!![]:![]:!![],'transaction':_0x5e6412})['then'](function(){logger[_0x1c11('0xc')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x1c11('0x11')](_0x585f14[_0x1c11('0x18')][_0x1c11('0x1a')]),_0x585f14[_0x1c11('0x18')][_0x1c11('0x1a')][_0x1c11('0x2a')]);return db[_0x1c11('0x23')][_0x1c11('0x2c')]({'where':_0x585f14['options']?_0x585f14[_0x1c11('0x18')][_0x1c11('0x1a')]||null:null,'transaction':_0x5e6412});});})[_0x1c11('0x20')](function(_0x3d9cc2){logger[_0x1c11('0xc')]('MoveContactManagedDialer',_0x585f14);logger[_0x1c11('0xf')](_0x1c11('0x41'),_0x585f14,JSON[_0x1c11('0x11')](_0x3d9cc2));_0x14b8c5(_0x3d9cc2);})[_0x1c11('0x16')](function(_0x149de0){logger[_0x1c11('0x12')](_0x1c11('0x41'),_0x149de0[_0x1c11('0x14')],_0x585f14);_0x5dea29(_0x3670f6[_0x1c11('0x12')](0x1f4,_0x149de0['message']));});});};exports[_0x1c11('0x43')]=function(_0x44f3fc){var _0x238ef4=this;return new Promise(function(_0x26b2d0,_0x183569){return db[_0x1c11('0x23')][_0x1c11('0x17')]({'raw':_0x44f3fc[_0x1c11('0x18')]?_0x44f3fc[_0x1c11('0x18')][_0x1c11('0x19')]===undefined?!![]:![]:!![],'where':_0x44f3fc[_0x1c11('0x18')]?_0x44f3fc[_0x1c11('0x18')][_0x1c11('0x1a')]||null:null,'attributes':[[db[_0x1c11('0x42')]['fn'](_0x1c11('0x44'),db[_0x1c11('0x42')]['fn']('IF',db['sequelize'][_0x1c11('0x45')](_0x1c11('0x46')+util[_0x1c11('0x47')](_0x1c11('0x48'),moment()['format'](_0x1c11('0x49')))+'\x20,\x201,\x20null'))),_0x1c11('0x4a')]]})['then'](function(_0x184aee){logger[_0x1c11('0xc')](_0x1c11('0x43'),_0x44f3fc);logger['debug']('CountReScheduled',_0x44f3fc,JSON['stringify'](_0x184aee));_0x26b2d0(_0x184aee);})[_0x1c11('0x16')](function(_0x426ce2){logger[_0x1c11('0x12')](_0x1c11('0x43'),_0x426ce2[_0x1c11('0x14')],_0x44f3fc);_0x183569(_0x238ef4['error'](0x1f4,_0x426ce2[_0x1c11('0x14')]));});});};exports[_0x1c11('0x4b')]=function(_0x1570aa){var _0x18210c=this;return new Promise(function(_0x110e33,_0x5bd3fd){return db[_0x1c11('0x2e')][_0x1c11('0x2f')]()[_0x1c11('0x20')](function(_0x3beda5){return db['sequelize'][_0x1c11('0x30')](function(_0x53ce69){return db[_0x1c11('0x23')][_0x1c11('0x17')]({'where':_0x1570aa[_0x1c11('0x18')]?_0x1570aa[_0x1c11('0x18')][_0x1c11('0x1a')]||null:null,'attributes':_0x1570aa[_0x1c11('0x18')]?_0x1570aa[_0x1c11('0x18')][_0x1c11('0x1f')]||null:null,'limit':0x1,'order':_0x1570aa[_0x1c11('0x18')]?_0x1570aa[_0x1c11('0x18')]['order']||null:null,'group':db[_0x1c11('0x23')]['UserId'],'transaction':_0x53ce69,'lock':_0x53ce69[_0x1c11('0x32')]['UPDATE'],'include':_0x1570aa['options']?_0x1570aa[_0x1c11('0x18')]['include']?_[_0x1c11('0x1d')](_0x1570aa[_0x1c11('0x18')]['include'],function(_0x4d0781){return{'model':db[_0x4d0781[_0x1c11('0x1e')]],'as':_0x4d0781['as'],'attributes':_0x4d0781[_0x1c11('0x1f')],'include':_0x4d0781['include']?_[_0x1c11('0x1d')](_0x4d0781[_0x1c11('0x1c')],function(_0xd6176f){return{'model':db[_0xd6176f[_0x1c11('0x1e')]],'as':_0xd6176f['as'],'attributes':_0xd6176f[_0x1c11('0x1f')],'include':_0xd6176f['include']?_[_0x1c11('0x1d')](_0xd6176f['include'],function(_0x501b38){return{'model':db[_0x501b38[_0x1c11('0x1e')]],'as':_0x501b38['as'],'attributes':_0x501b38[_0x1c11('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1c11('0x20')](function(_0x3ff605){var _0x1a61e6=[];for(var _0x55b1e8=0x0;_0x55b1e8<_0x3ff605[_0x1c11('0x39')];_0x55b1e8+=0x1){_0x1a61e6['push'](_0x3ff605[_0x55b1e8][_0x1c11('0x3c')](_0x1570aa[_0x1c11('0x28')],{'transaction':_0x53ce69}));}return BPromise['all'](_0x1a61e6);});})[_0x1c11('0x20')](function(_0x1728e4){logger[_0x1c11('0xc')](_0x1c11('0x4b'),_0x1570aa);logger[_0x1c11('0xf')](_0x1c11('0x4b'),_0x1570aa,JSON['stringify'](_0x1728e4));_0x110e33(_0x1728e4);})['catch'](function(_0x25dedc){logger[_0x1c11('0x12')](_0x1c11('0x4b'),_0x25dedc[_0x1c11('0x14')],_0x1570aa);_0x5bd3fd(_0x18210c[_0x1c11('0x12')](0x1f4,_0x25dedc[_0x1c11('0x14')]));});});});};exports[_0x1c11('0x4c')]=function(_0x32893e){var _0x45dbff=this;return new Promise(function(_0x9d476d,_0x512a6d){db[_0x1c11('0x2e')][_0x1c11('0x2f')]()[_0x1c11('0x20')](function(_0x2a1242){return db['CmHopper'][_0x1c11('0x17')]({'raw':_0x32893e[_0x1c11('0x18')]?_0x32893e[_0x1c11('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x32893e[_0x1c11('0x18')]?_0x32893e['options'][_0x1c11('0x1a')]||null:null,'attributes':_0x32893e[_0x1c11('0x18')]?_0x32893e['options']['attributes']||null:null,'limit':_0x32893e[_0x1c11('0x18')]?_0x32893e['options'][_0x1c11('0x1b')]||null:null,'include':_0x32893e[_0x1c11('0x18')]?_0x32893e['options'][_0x1c11('0x1c')]?_[_0x1c11('0x1d')](_0x32893e[_0x1c11('0x18')][_0x1c11('0x1c')],function(_0x290bcd){return{'model':db[_0x290bcd[_0x1c11('0x1e')]],'as':_0x290bcd['as'],'attributes':_0x290bcd['as']==='Contact'?_[_0x1c11('0x35')](_0x2a1242):_0x290bcd['attributes'],'include':_0x290bcd['include']?_[_0x1c11('0x1d')](_0x290bcd[_0x1c11('0x1c')],function(_0x3a18c1){return{'model':db[_0x3a18c1[_0x1c11('0x1e')]],'as':_0x3a18c1['as'],'attributes':_0x3a18c1[_0x1c11('0x1f')],'include':_0x3a18c1[_0x1c11('0x1c')]?_[_0x1c11('0x1d')](_0x3a18c1[_0x1c11('0x1c')],function(_0x8c8283){return{'model':db[_0x8c8283[_0x1c11('0x1e')]],'as':_0x8c8283['as'],'attributes':_0x8c8283[_0x1c11('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1c11('0x20')](function(_0x516054){logger[_0x1c11('0xc')](_0x1c11('0x21'),_0x32893e);logger[_0x1c11('0xf')](_0x1c11('0x21'),_0x32893e,JSON[_0x1c11('0x11')](_0x516054));_0x9d476d(_0x516054);})[_0x1c11('0x16')](function(_0x1a3d13){logger['error'](_0x1c11('0x21'),_0x1a3d13[_0x1c11('0x14')],_0x32893e);_0x512a6d(_0x45dbff[_0x1c11('0x12')](0x1f4,_0x1a3d13['message']));});});});};exports[_0x1c11('0x4d')]=function(_0x415197){var _0x5a1e46=this;return new Promise(function(_0x4556f1,_0x16c6d8){return db[_0x1c11('0x2e')][_0x1c11('0x4e')]({'raw':!![],'where':{'phone':_0x415197[_0x1c11('0x18')][_0x1c11('0x1a')][_0x1c11('0x4f')]},'attributes':['id',_0x1c11('0x50')],'order':[['id','DESC']]})[_0x1c11('0x20')](function(_0x55c96f){logger[_0x1c11('0xc')]('getContactByPhone',_0x415197);logger[_0x1c11('0xf')]('getContactByPhone',_0x415197,JSON['stringify'](_0x55c96f));_0x4556f1(_0x55c96f);})['catch'](function(_0x5582d7){logger[_0x1c11('0x12')](_0x1c11('0x51'),_0x5582d7[_0x1c11('0x14')],_0x415197);_0x16c6d8(_0x5a1e46['error'](0x1f4,_0x5582d7[_0x1c11('0x14')]));});});};exports[_0x1c11('0x52')]=function(_0x3060b3){var _0x129986=this;return new Promise(function(_0xd4fb34,_0x4d5a9e){return db[_0x1c11('0x42')][_0x1c11('0x30')](function(_0x14f007){return db[_0x1c11('0x23')][_0x1c11('0x3c')]({'active':![]},{'where':{},'transaction':_0x14f007})[_0x1c11('0x20')](function(_0x4f6d1e){logger[_0x1c11('0xc')]('ResetActiveCalls',_0x3060b3);logger['debug']('ResetActiveCalls',_0x3060b3,JSON[_0x1c11('0x11')](_0x4f6d1e));_0xd4fb34(_0x4f6d1e);})[_0x1c11('0x16')](function(_0x3c0c82){logger[_0x1c11('0x12')](_0x1c11('0x52'),_0x3c0c82[_0x1c11('0x14')],_0x3060b3);_0x4d5a9e(_0x129986[_0x1c11('0x12')](0x1f4,_0x3c0c82[_0x1c11('0x14')]));});});});};exports[_0x1c11('0x53')]=function(_0x33a023){var _0x438e69=this;var _0x1ddef1=_0x33a023['body'][_0x1c11('0x1a')]['voiceQueueId'];var _0x44bd55=_0x33a023[_0x1c11('0x28')][_0x1c11('0x1a')][_0x1c11('0x54')];return new Promise(function(_0x5427ce,_0x2a7893){return db[_0x1c11('0x23')]['findAll']({'where':{'voiceQueueId':_0x1ddef1,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0x1c11('0x42')][_0x1c11('0x45')](_0x1c11('0x55')+_0x44bd55+_0x1c11('0x56'))}},'include':[{'model':db[_0x1c11('0x2e')],'as':_0x1c11('0x34')},{'model':db['User'],'as':_0x1c11('0x37'),'attributes':['id','name','voicePause']},{'model':db[_0x1c11('0x57')],'as':_0x1c11('0x58')}]})[_0x1c11('0x20')](function(_0xeb89e3){return db['sequelize'][_0x1c11('0x30')](function(_0x58ec87){return db['CmHopper']['update']({'recallmeNotifiedDate':new Date()},{'where':{'voiceQueueId':_0x1ddef1,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0x1c11('0x42')]['literal'](_0x1c11('0x55')+_0x44bd55+_0x1c11('0x56'))}},'transaction':_0x58ec87})[_0x1c11('0x20')](function(_0x9a0682){_0x5427ce(_0xeb89e3);})[_0x1c11('0x16')](function(_0x8294f6){logger[_0x1c11('0x12')](_0x1c11('0x53'),_0x8294f6[_0x1c11('0x14')],_0x33a023);_0x2a7893(validateExpressRequest);});});})[_0x1c11('0x16')](function(_0x3cfb3e){logger[_0x1c11('0x12')](_0x1c11('0x53'),_0x3cfb3e[_0x1c11('0x14')],_0x33a023);_0x2a7893(_0x438e69[_0x1c11('0x12')](0x1f4,_0x3cfb3e[_0x1c11('0x14')]));});});};
\ No newline at end of file
index 0190e6f..1a1fc15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4637=['/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopper.controller','get','isAuthenticated','index','/describe','/opencontacts','/timezones','show','post','create','getPreview','getTimezone','getPreviewRecall','put'];(function(_0xc62237,_0x26c525){var _0x2aaa03=function(_0xbd39aa){while(--_0xbd39aa){_0xc62237['push'](_0xc62237['shift']());}};_0x2aaa03(++_0x26c525);}(_0x4637,0x12e));var _0x7463=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x4637[_0xae7c2f];return _0x5d7001;};'use strict';var multer=require(_0x7463('0x0'));var util=require('util');var path=require(_0x7463('0x1'));var timeout=require(_0x7463('0x2'));var express=require(_0x7463('0x3'));var router=express[_0x7463('0x4')]();var fs_extra=require(_0x7463('0x5'));var auth=require(_0x7463('0x6'));var interaction=require(_0x7463('0x7'));var config=require('../../config/environment');var controller=require(_0x7463('0x8'));router[_0x7463('0x9')]('/',auth[_0x7463('0xa')](),controller[_0x7463('0xb')]);router['get'](_0x7463('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x7463('0x9')](_0x7463('0xd'),auth['isAuthenticated'](),controller['getOpenContacts']);router['get'](_0x7463('0xe'),auth[_0x7463('0xa')](),controller['getTimezones']);router[_0x7463('0x9')]('/:id',auth[_0x7463('0xa')](),controller[_0x7463('0xf')]);router[_0x7463('0x10')]('/',auth[_0x7463('0xa')](),controller[_0x7463('0x11')]);router[_0x7463('0x10')]('/preview',auth[_0x7463('0xa')](),controller[_0x7463('0x12')]);router[_0x7463('0x10')]('/timezone',auth[_0x7463('0xa')](),controller[_0x7463('0x13')]);router['post']('/previewrecall',auth[_0x7463('0xa')](),controller[_0x7463('0x14')]);router[_0x7463('0x15')](_0x7463('0x16'),auth['isAuthenticated'](),controller[_0x7463('0x17')]);router[_0x7463('0x18')](_0x7463('0x16'),auth['isAuthenticated'](),controller[_0x7463('0x19')]);module[_0x7463('0x1a')]=router;
\ No newline at end of file
+var _0x20b7=['./cmHopper.controller','get','isAuthenticated','index','describe','/opencontacts','getOpenContacts','/timezones','/:id','show','post','create','/preview','getPreview','/timezone','getTimezone','getPreviewRecall','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x450ca0,_0x16dbf2){var _0x42a022=function(_0x2ee6e3){while(--_0x2ee6e3){_0x450ca0['push'](_0x450ca0['shift']());}};_0x42a022(++_0x16dbf2);}(_0x20b7,0x166));var _0x720b=function(_0x2be672,_0x501111){_0x2be672=_0x2be672-0x0;var _0x1c49e0=_0x20b7[_0x2be672];return _0x1c49e0;};'use strict';var multer=require(_0x720b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x720b('0x1'));var express=require(_0x720b('0x2'));var router=express[_0x720b('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x720b('0x4'));var config=require(_0x720b('0x5'));var controller=require(_0x720b('0x6'));router[_0x720b('0x7')]('/',auth[_0x720b('0x8')](),controller[_0x720b('0x9')]);router[_0x720b('0x7')]('/describe',auth[_0x720b('0x8')](),controller[_0x720b('0xa')]);router[_0x720b('0x7')](_0x720b('0xb'),auth[_0x720b('0x8')](),controller[_0x720b('0xc')]);router[_0x720b('0x7')](_0x720b('0xd'),auth['isAuthenticated'](),controller['getTimezones']);router[_0x720b('0x7')](_0x720b('0xe'),auth['isAuthenticated'](),controller[_0x720b('0xf')]);router[_0x720b('0x10')]('/',auth[_0x720b('0x8')](),controller[_0x720b('0x11')]);router['post'](_0x720b('0x12'),auth[_0x720b('0x8')](),controller[_0x720b('0x13')]);router[_0x720b('0x10')](_0x720b('0x14'),auth[_0x720b('0x8')](),controller[_0x720b('0x15')]);router[_0x720b('0x10')]('/previewrecall',auth[_0x720b('0x8')](),controller[_0x720b('0x16')]);router[_0x720b('0x17')](_0x720b('0xe'),auth[_0x720b('0x8')](),controller[_0x720b('0x18')]);router[_0x720b('0x19')](_0x720b('0xe'),auth['isAuthenticated'](),controller[_0x720b('0x1a')]);module[_0x720b('0x1b')]=router;
\ No newline at end of file
index 8c01771..5433957 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f8a=['INTEGER','moment','sequelize','exports','STRING','contactListQueue'];(function(_0x20845e,_0x211e78){var _0x28cf2b=function(_0x31d613){while(--_0x31d613){_0x20845e['push'](_0x20845e['shift']());}};_0x28cf2b(++_0x211e78);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x523508,_0x4b3bb3){_0x523508=_0x523508-0x0;var _0x20d656=_0x3f8a[_0x523508];return _0x20d656;};'use strict';var moment=require(_0xa3f8('0x0'));var Sequelize=require(_0xa3f8('0x1'));module[_0xa3f8('0x2')]={'phone':{'type':Sequelize[_0xa3f8('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xa3f8('0x4')},'ListId':{'type':Sequelize[_0xa3f8('0x5')],'unique':_0xa3f8('0x4')},'VoiceQueueId':{'type':Sequelize[_0xa3f8('0x5')],'unique':_0xa3f8('0x4')}};
\ No newline at end of file
+var _0x3912=['sequelize','STRING','INTEGER','contactListQueue','moment'];(function(_0x144435,_0x1c2d19){var _0x429011=function(_0x3d192a){while(--_0x3d192a){_0x144435['push'](_0x144435['shift']());}};_0x429011(++_0x1c2d19);}(_0x3912,0xa9));var _0x2391=function(_0xe68434,_0x429344){_0xe68434=_0xe68434-0x0;var _0x22220e=_0x3912[_0xe68434];return _0x22220e;};'use strict';var moment=require(_0x2391('0x0'));var Sequelize=require(_0x2391('0x1'));module['exports']={'phone':{'type':Sequelize[_0x2391('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x2391('0x3')],'unique':_0x2391('0x4')},'ListId':{'type':Sequelize[_0x2391('0x3')],'unique':_0x2391('0x4')},'VoiceQueueId':{'type':Sequelize[_0x2391('0x3')],'unique':_0x2391('0x4')}};
\ No newline at end of file
index 6ecfa74..8c19f00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22df=['undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','CmHopperBlack','includeAll','include','findAll','show','params','keys','body','find','catch','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','offset'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x22df,0x11c));var _0xf22d=function(_0x416c72,_0x5a2bc9){_0x416c72=_0x416c72-0x0;var _0x5ebb4b=_0x22df[_0x416c72];return _0x5ebb4b;};'use strict';var emlformat=require(_0xf22d('0x0'));var rimraf=require(_0xf22d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf22d('0x2'));var rp=require(_0xf22d('0x3'));var moment=require(_0xf22d('0x4'));var BPromise=require(_0xf22d('0x5'));var Mustache=require(_0xf22d('0x6'));var util=require(_0xf22d('0x7'));var path=require(_0xf22d('0x8'));var sox=require(_0xf22d('0x9'));var csv=require(_0xf22d('0xa'));var ejs=require(_0xf22d('0xb'));var fs=require('fs');var fs_extra=require(_0xf22d('0xc'));var _=require(_0xf22d('0xd'));var squel=require(_0xf22d('0xe'));var crypto=require('crypto');var jsforce=require(_0xf22d('0xf'));var deskjs=require(_0xf22d('0x10'));var toCsv=require('to-csv');var querystring=require(_0xf22d('0x11'));var Papa=require(_0xf22d('0x12'));var Redis=require('ioredis');var authService=require(_0xf22d('0x13'));var qs=require(_0xf22d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf22d('0x15'));var logger=require(_0xf22d('0x16'))(_0xf22d('0x17'));var utils=require(_0xf22d('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25c97c,_0x42060a){_0x42060a=_0x42060a||0xcc;return function(_0x2cf75a){if(_0x2cf75a){return _0x25c97c['sendStatus'](_0x42060a);}return _0x25c97c[_0xf22d('0x19')](_0x42060a)[_0xf22d('0x1a')]();};}function respondWithResult(_0x58fa4e,_0x2afceb){_0x2afceb=_0x2afceb||0xc8;return function(_0xc56cc8){if(_0xc56cc8){return _0x58fa4e['status'](_0x2afceb)['json'](_0xc56cc8);}};}function respondWithFilteredResult(_0x8bb04f,_0x16b90f){return function(_0x5925b9){if(_0x5925b9){var _0xdf52a=typeof _0x16b90f[_0xf22d('0x1b')]===_0xf22d('0x1c')&&typeof _0x16b90f[_0xf22d('0x1d')]===_0xf22d('0x1c');var _0x1ffa12=_0x5925b9[_0xf22d('0x1e')];var _0x5d5b63=_0xdf52a?0x0:_0x16b90f[_0xf22d('0x1b')];var _0x435c79=_0xdf52a?_0x5925b9[_0xf22d('0x1e')]:_0x16b90f['offset']+_0x16b90f[_0xf22d('0x1d')];var _0x2594d1;if(_0x435c79>=_0x1ffa12){_0x435c79=_0x1ffa12;_0x2594d1=0xc8;}else{_0x2594d1=0xce;}_0x8bb04f[_0xf22d('0x19')](_0x2594d1);return _0x8bb04f[_0xf22d('0x1f')](_0xf22d('0x20'),_0x5d5b63+'-'+_0x435c79+'/'+_0x1ffa12)[_0xf22d('0x21')](_0x5925b9);}return null;};}function patchUpdates(_0x25e72a){return function(_0x18ed50){try{jsonpatch[_0xf22d('0x22')](_0x18ed50,_0x25e72a,!![]);}catch(_0x2f64f2){return BPromise[_0xf22d('0x23')](_0x2f64f2);}return _0x18ed50[_0xf22d('0x24')]();};}function saveUpdates(_0x4ab961,_0x5834d5){return function(_0x5c560f){if(_0x5c560f){return _0x5c560f[_0xf22d('0x25')](_0x4ab961)['then'](function(_0x9795d2){return _0x9795d2;});}return null;};}function removeEntity(_0x2ea732,_0x52f924){return function(_0x2dd3eb){if(_0x2dd3eb){return _0x2dd3eb[_0xf22d('0x26')]()[_0xf22d('0x27')](function(){_0x2ea732['status'](0xcc)[_0xf22d('0x1a')]();});}};}function handleEntityNotFound(_0x336fb3,_0x49add5){return function(_0x32fc3a){if(!_0x32fc3a){_0x336fb3['sendStatus'](0x194);}return _0x32fc3a;};}function handleError(_0x2a5e82,_0x389ac4){_0x389ac4=_0x389ac4||0x1f4;return function(_0x1fb156){logger[_0xf22d('0x28')](_0x1fb156[_0xf22d('0x29')]);if(_0x1fb156[_0xf22d('0x2a')]){delete _0x1fb156['name'];}_0x2a5e82['status'](_0x389ac4)[_0xf22d('0x2b')](_0x1fb156);};}exports[_0xf22d('0x2c')]=function(_0x5e175c,_0x148f55){var _0x1a6db7={},_0x11602d={},_0x76f0af={'count':0x0,'rows':[]};var _0x834291=_[_0xf22d('0x2d')](db['CmHopperBlack'][_0xf22d('0x2e')],function(_0x393233){return{'name':_0x393233[_0xf22d('0x2f')],'type':_0x393233[_0xf22d('0x30')][_0xf22d('0x31')]};});_0x11602d['model']=_[_0xf22d('0x2d')](_0x834291,_0xf22d('0x2a'));_0x11602d[_0xf22d('0x32')]=_['keys'](_0x5e175c[_0xf22d('0x32')]);_0x11602d[_0xf22d('0x33')]=_['intersection'](_0x11602d[_0xf22d('0x34')],_0x11602d[_0xf22d('0x32')]);_0x1a6db7[_0xf22d('0x35')]=_[_0xf22d('0x36')](_0x11602d[_0xf22d('0x34')],qs['fields'](_0x5e175c['query'][_0xf22d('0x37')]));_0x1a6db7[_0xf22d('0x35')]=_0x1a6db7[_0xf22d('0x35')][_0xf22d('0x38')]?_0x1a6db7[_0xf22d('0x35')]:_0x11602d[_0xf22d('0x34')];if(!_0x5e175c['query'][_0xf22d('0x39')](_0xf22d('0x3a'))){_0x1a6db7[_0xf22d('0x1d')]=qs[_0xf22d('0x1d')](_0x5e175c[_0xf22d('0x32')][_0xf22d('0x1d')]);_0x1a6db7[_0xf22d('0x1b')]=qs[_0xf22d('0x1b')](_0x5e175c[_0xf22d('0x32')][_0xf22d('0x1b')]);}_0x1a6db7[_0xf22d('0x3b')]=qs[_0xf22d('0x3c')](_0x5e175c[_0xf22d('0x32')][_0xf22d('0x3c')]);_0x1a6db7[_0xf22d('0x3d')]=qs[_0xf22d('0x33')](_[_0xf22d('0x3e')](_0x5e175c['query'],_0x11602d[_0xf22d('0x33')]),_0x834291);if(_0x5e175c[_0xf22d('0x32')][_0xf22d('0x3f')]){_0x1a6db7[_0xf22d('0x3d')]=_[_0xf22d('0x40')](_0x1a6db7[_0xf22d('0x3d')],{'$or':_[_0xf22d('0x2d')](_0x834291,function(_0x4a4f31){if(_0x4a4f31['type']!==_0xf22d('0x41')){var _0x413a05={};_0x413a05[_0x4a4f31[_0xf22d('0x2a')]]={'$like':'%'+_0x5e175c[_0xf22d('0x32')][_0xf22d('0x3f')]+'%'};return _0x413a05;}})});}_0x1a6db7=_[_0xf22d('0x40')]({},_0x1a6db7,_0x5e175c[_0xf22d('0x42')]);var _0x525b78={'where':_0x1a6db7[_0xf22d('0x3d')]};return db[_0xf22d('0x43')][_0xf22d('0x1e')](_0x525b78)[_0xf22d('0x27')](function(_0x35d9eb){_0x76f0af[_0xf22d('0x1e')]=_0x35d9eb;if(_0x5e175c[_0xf22d('0x32')][_0xf22d('0x44')]){_0x1a6db7[_0xf22d('0x45')]=[{'all':!![]}];}return db[_0xf22d('0x43')][_0xf22d('0x46')](_0x1a6db7);})[_0xf22d('0x27')](function(_0x317f68){_0x76f0af['rows']=_0x317f68;return _0x76f0af;})[_0xf22d('0x27')](respondWithFilteredResult(_0x148f55,_0x1a6db7))['catch'](handleError(_0x148f55,null));};exports[_0xf22d('0x47')]=function(_0x4eaa62,_0x22c09b){var _0x269a72={'raw':!![],'where':{'id':_0x4eaa62[_0xf22d('0x48')]['id']}},_0x1864f0={};_0x1864f0[_0xf22d('0x34')]=_[_0xf22d('0x49')](db[_0xf22d('0x43')][_0xf22d('0x2e')]);_0x1864f0[_0xf22d('0x32')]=_[_0xf22d('0x49')](_0x4eaa62[_0xf22d('0x32')]);_0x1864f0[_0xf22d('0x33')]=_[_0xf22d('0x36')](_0x1864f0['model'],_0x1864f0[_0xf22d('0x32')]);_0x269a72[_0xf22d('0x35')]=_[_0xf22d('0x36')](_0x1864f0[_0xf22d('0x34')],qs[_0xf22d('0x37')](_0x4eaa62[_0xf22d('0x32')]['fields']));_0x269a72[_0xf22d('0x35')]=_0x269a72[_0xf22d('0x35')][_0xf22d('0x38')]?_0x269a72[_0xf22d('0x35')]:_0x1864f0[_0xf22d('0x34')];if(_0x4eaa62[_0xf22d('0x32')][_0xf22d('0x44')]){_0x269a72['include']=[{'all':!![]}];}_0x269a72=_[_0xf22d('0x40')]({},_0x269a72,_0x4eaa62[_0xf22d('0x42')]);return db[_0xf22d('0x43')]['find'](_0x269a72)[_0xf22d('0x27')](handleEntityNotFound(_0x22c09b,null))['then'](respondWithResult(_0x22c09b,null))['catch'](handleError(_0x22c09b,null));};exports[_0xf22d('0x25')]=function(_0x51c8a7,_0x3adea8){if(_0x51c8a7[_0xf22d('0x4a')]['id']){delete _0x51c8a7[_0xf22d('0x4a')]['id'];}return db['CmHopperBlack'][_0xf22d('0x4b')]({'where':{'id':_0x51c8a7[_0xf22d('0x48')]['id']}})[_0xf22d('0x27')](handleEntityNotFound(_0x3adea8,null))['then'](saveUpdates(_0x51c8a7[_0xf22d('0x4a')],null))[_0xf22d('0x27')](respondWithResult(_0x3adea8,null))[_0xf22d('0x4c')](handleError(_0x3adea8,null));};exports[_0xf22d('0x26')]=function(_0x11701a,_0x2031b9){return db[_0xf22d('0x43')][_0xf22d('0x4b')]({'where':{'id':_0x11701a['params']['id']}})[_0xf22d('0x27')](handleEntityNotFound(_0x2031b9,null))['then'](removeEntity(_0x2031b9,null))['catch'](handleError(_0x2031b9,null));};exports['describe']=function(_0x578473,_0x42b08b){return db[_0xf22d('0x43')][_0xf22d('0x4d')]()[_0xf22d('0x27')](respondWithResult(_0x42b08b,null))[_0xf22d('0x4c')](handleError(_0x42b08b,null));};
\ No newline at end of file
+var _0x918e=['end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','CmHopperBlack','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','findAll','rows','catch','params','keys','filters','includeAll','find','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x7d59c0,_0x2df9c2){var _0x3c0a1e=function(_0xac9d7){while(--_0xac9d7){_0x7d59c0['push'](_0x7d59c0['shift']());}};_0x3c0a1e(++_0x2df9c2);}(_0x918e,0x173));var _0xe918=function(_0x249f99,_0x487dad){_0x249f99=_0x249f99-0x0;var _0x55486a=_0x918e[_0x249f99];return _0x55486a;};'use strict';var emlformat=require(_0xe918('0x0'));var rimraf=require(_0xe918('0x1'));var zipdir=require(_0xe918('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe918('0x3'));var moment=require(_0xe918('0x4'));var BPromise=require(_0xe918('0x5'));var Mustache=require(_0xe918('0x6'));var util=require(_0xe918('0x7'));var path=require(_0xe918('0x8'));var sox=require(_0xe918('0x9'));var csv=require(_0xe918('0xa'));var ejs=require(_0xe918('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe918('0xc'));var squel=require('squel');var crypto=require(_0xe918('0xd'));var jsforce=require(_0xe918('0xe'));var deskjs=require(_0xe918('0xf'));var toCsv=require(_0xe918('0xa'));var querystring=require(_0xe918('0x10'));var Papa=require(_0xe918('0x11'));var Redis=require(_0xe918('0x12'));var authService=require(_0xe918('0x13'));var qs=require(_0xe918('0x14'));var as=require(_0xe918('0x15'));var hardwareService=require(_0xe918('0x16'));var logger=require(_0xe918('0x17'))(_0xe918('0x18'));var utils=require(_0xe918('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xe918('0x1a'));var db=require(_0xe918('0x1b'))['db'];function respondWithStatusCode(_0x34359c,_0x337fc6){_0x337fc6=_0x337fc6||0xcc;return function(_0x1e3718){if(_0x1e3718){return _0x34359c[_0xe918('0x1c')](_0x337fc6);}return _0x34359c['status'](_0x337fc6)[_0xe918('0x1d')]();};}function respondWithResult(_0x2436c4,_0x13f37e){_0x13f37e=_0x13f37e||0xc8;return function(_0x1120a9){if(_0x1120a9){return _0x2436c4[_0xe918('0x1e')](_0x13f37e)[_0xe918('0x1f')](_0x1120a9);}};}function respondWithFilteredResult(_0x4d88ac,_0x1f38ef){return function(_0x4a4233){if(_0x4a4233){var _0x1eb754=typeof _0x1f38ef[_0xe918('0x20')]===_0xe918('0x21')&&typeof _0x1f38ef[_0xe918('0x22')]===_0xe918('0x21');var _0x4f3ac7=_0x4a4233[_0xe918('0x23')];var _0x3d97f9=_0x1eb754?0x0:_0x1f38ef[_0xe918('0x20')];var _0x2c4116=_0x1eb754?_0x4a4233['count']:_0x1f38ef[_0xe918('0x20')]+_0x1f38ef[_0xe918('0x22')];var _0x2fccff;if(_0x2c4116>=_0x4f3ac7){_0x2c4116=_0x4f3ac7;_0x2fccff=0xc8;}else{_0x2fccff=0xce;}_0x4d88ac[_0xe918('0x1e')](_0x2fccff);return _0x4d88ac[_0xe918('0x24')](_0xe918('0x25'),_0x3d97f9+'-'+_0x2c4116+'/'+_0x4f3ac7)[_0xe918('0x1f')](_0x4a4233);}return null;};}function patchUpdates(_0x548f40){return function(_0x2b5874){try{jsonpatch[_0xe918('0x26')](_0x2b5874,_0x548f40,!![]);}catch(_0x31d593){return BPromise[_0xe918('0x27')](_0x31d593);}return _0x2b5874[_0xe918('0x28')]();};}function saveUpdates(_0x425dbc,_0xec955b){return function(_0x2c7c25){if(_0x2c7c25){return _0x2c7c25[_0xe918('0x29')](_0x425dbc)[_0xe918('0x2a')](function(_0x41d794){return _0x41d794;});}return null;};}function removeEntity(_0x4c66a3,_0x46fc75){return function(_0x52d0aa){if(_0x52d0aa){return _0x52d0aa[_0xe918('0x2b')]()[_0xe918('0x2a')](function(){_0x4c66a3[_0xe918('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bd3bb,_0x15c72b){return function(_0x2c6730){if(!_0x2c6730){_0x2bd3bb['sendStatus'](0x194);}return _0x2c6730;};}function handleError(_0x17ace3,_0x17acb1){_0x17acb1=_0x17acb1||0x1f4;return function(_0x2400ae){logger[_0xe918('0x2c')](_0x2400ae[_0xe918('0x2d')]);if(_0x2400ae[_0xe918('0x2e')]){delete _0x2400ae['name'];}_0x17ace3['status'](_0x17acb1)['send'](_0x2400ae);};}exports[_0xe918('0x2f')]=function(_0x436514,_0x5d6922){var _0x3151f5={},_0x9972c4={},_0x949ee2={'count':0x0,'rows':[]};var _0x1007c7=_[_0xe918('0x30')](db[_0xe918('0x31')][_0xe918('0x32')],function(_0x1a79c2){return{'name':_0x1a79c2[_0xe918('0x33')],'type':_0x1a79c2['type'][_0xe918('0x34')]};});_0x9972c4[_0xe918('0x35')]=_[_0xe918('0x30')](_0x1007c7,_0xe918('0x2e'));_0x9972c4[_0xe918('0x36')]=_['keys'](_0x436514['query']);_0x9972c4['filters']=_[_0xe918('0x37')](_0x9972c4[_0xe918('0x35')],_0x9972c4[_0xe918('0x36')]);_0x3151f5['attributes']=_[_0xe918('0x37')](_0x9972c4['model'],qs[_0xe918('0x38')](_0x436514['query'][_0xe918('0x38')]));_0x3151f5[_0xe918('0x39')]=_0x3151f5['attributes'][_0xe918('0x3a')]?_0x3151f5[_0xe918('0x39')]:_0x9972c4['model'];if(!_0x436514[_0xe918('0x36')][_0xe918('0x3b')](_0xe918('0x3c'))){_0x3151f5[_0xe918('0x22')]=qs[_0xe918('0x22')](_0x436514[_0xe918('0x36')]['limit']);_0x3151f5[_0xe918('0x20')]=qs[_0xe918('0x20')](_0x436514['query'][_0xe918('0x20')]);}_0x3151f5[_0xe918('0x3d')]=qs['sort'](_0x436514['query'][_0xe918('0x3e')]);_0x3151f5[_0xe918('0x3f')]=qs['filters'](_[_0xe918('0x40')](_0x436514[_0xe918('0x36')],_0x9972c4['filters']),_0x1007c7);if(_0x436514['query'][_0xe918('0x41')]){_0x3151f5[_0xe918('0x3f')]=_['merge'](_0x3151f5[_0xe918('0x3f')],{'$or':_[_0xe918('0x30')](_0x1007c7,function(_0x122fb5){if(_0x122fb5[_0xe918('0x42')]!==_0xe918('0x43')){var _0x181413={};_0x181413[_0x122fb5['name']]={'$like':'%'+_0x436514[_0xe918('0x36')][_0xe918('0x41')]+'%'};return _0x181413;}})});}_0x3151f5=_[_0xe918('0x44')]({},_0x3151f5,_0x436514[_0xe918('0x45')]);var _0x428fc7={'where':_0x3151f5[_0xe918('0x3f')]};return db[_0xe918('0x31')][_0xe918('0x23')](_0x428fc7)[_0xe918('0x2a')](function(_0x45c59b){_0x949ee2[_0xe918('0x23')]=_0x45c59b;if(_0x436514['query']['includeAll']){_0x3151f5['include']=[{'all':!![]}];}return db[_0xe918('0x31')][_0xe918('0x46')](_0x3151f5);})[_0xe918('0x2a')](function(_0x1e0ffb){_0x949ee2[_0xe918('0x47')]=_0x1e0ffb;return _0x949ee2;})[_0xe918('0x2a')](respondWithFilteredResult(_0x5d6922,_0x3151f5))[_0xe918('0x48')](handleError(_0x5d6922,null));};exports['show']=function(_0x24da99,_0x278ac2){var _0x378b3d={'raw':!![],'where':{'id':_0x24da99[_0xe918('0x49')]['id']}},_0x423237={};_0x423237[_0xe918('0x35')]=_[_0xe918('0x4a')](db['CmHopperBlack'][_0xe918('0x32')]);_0x423237[_0xe918('0x36')]=_[_0xe918('0x4a')](_0x24da99[_0xe918('0x36')]);_0x423237[_0xe918('0x4b')]=_[_0xe918('0x37')](_0x423237[_0xe918('0x35')],_0x423237['query']);_0x378b3d['attributes']=_[_0xe918('0x37')](_0x423237['model'],qs[_0xe918('0x38')](_0x24da99[_0xe918('0x36')]['fields']));_0x378b3d[_0xe918('0x39')]=_0x378b3d[_0xe918('0x39')][_0xe918('0x3a')]?_0x378b3d[_0xe918('0x39')]:_0x423237[_0xe918('0x35')];if(_0x24da99[_0xe918('0x36')][_0xe918('0x4c')]){_0x378b3d['include']=[{'all':!![]}];}_0x378b3d=_[_0xe918('0x44')]({},_0x378b3d,_0x24da99[_0xe918('0x45')]);return db['CmHopperBlack'][_0xe918('0x4d')](_0x378b3d)['then'](handleEntityNotFound(_0x278ac2,null))[_0xe918('0x2a')](respondWithResult(_0x278ac2,null))[_0xe918('0x48')](handleError(_0x278ac2,null));};exports[_0xe918('0x29')]=function(_0x22a79c,_0x4d7114){if(_0x22a79c['body']['id']){delete _0x22a79c[_0xe918('0x4e')]['id'];}return db['CmHopperBlack'][_0xe918('0x4d')]({'where':{'id':_0x22a79c['params']['id']}})[_0xe918('0x2a')](handleEntityNotFound(_0x4d7114,null))[_0xe918('0x2a')](saveUpdates(_0x22a79c[_0xe918('0x4e')],null))[_0xe918('0x2a')](respondWithResult(_0x4d7114,null))[_0xe918('0x48')](handleError(_0x4d7114,null));};exports['destroy']=function(_0x36cb89,_0x42c504){return db[_0xe918('0x31')][_0xe918('0x4d')]({'where':{'id':_0x36cb89[_0xe918('0x49')]['id']}})[_0xe918('0x2a')](handleEntityNotFound(_0x42c504,null))[_0xe918('0x2a')](removeEntity(_0x42c504,null))['catch'](handleError(_0x42c504,null));};exports[_0xe918('0x4f')]=function(_0x3be432,_0x5f256b){return db['CmHopperBlack'][_0xe918('0x4f')]()[_0xe918('0x2a')](respondWithResult(_0x5f256b,null))[_0xe918('0x48')](handleError(_0x5f256b,null));};
\ No newline at end of file
index 3b8b0ab..a1b0343 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0497=['request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','define','CmHopperBlack','cm_hopper_black','lodash','util','api','moment','bluebird'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x0497,0xe5));var _0x7049=function(_0x3a29e5,_0xffee26){_0x3a29e5=_0x3a29e5-0x0;var _0x496fb5=_0x0497[_0x3a29e5];return _0x496fb5;};'use strict';var _=require(_0x7049('0x0'));var util=require(_0x7049('0x1'));var logger=require('../../config/logger')(_0x7049('0x2'));var moment=require(_0x7049('0x3'));var BPromise=require(_0x7049('0x4'));var rp=require(_0x7049('0x5'));var fs=require('fs');var path=require(_0x7049('0x6'));var rimraf=require(_0x7049('0x7'));var config=require(_0x7049('0x8'));var attributes=require(_0x7049('0x9'));module['exports']=function(_0x28eabf,_0x5f0377){return _0x28eabf[_0x7049('0xa')](_0x7049('0xb'),attributes,{'tableName':_0x7049('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x12e2=['define','CmHopperBlack','cm_hopper_black','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./cmHopperBlack.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x12e2,0x116));var _0x212e=function(_0x5a6478,_0x14dc7b){_0x5a6478=_0x5a6478-0x0;var _0x58b375=_0x12e2[_0x5a6478];return _0x58b375;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x212e('0x0'))(_0x212e('0x1'));var moment=require('moment');var BPromise=require(_0x212e('0x2'));var rp=require(_0x212e('0x3'));var fs=require('fs');var path=require(_0x212e('0x4'));var rimraf=require('rimraf');var config=require(_0x212e('0x5'));var attributes=require(_0x212e('0x6'));module[_0x212e('0x7')]=function(_0x4c6912,_0x3750b5){return _0x4c6912[_0x212e('0x8')](_0x212e('0x9'),attributes,{'tableName':_0x212e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0f7a85d..1985ceb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ad4=['message','result','catch','GetCmHopperBlack','findAll','options','raw','attributes','limit','include','map','model','UpdateCmHopperBlack','CmHopperBlack','update','DestroyCmHopperBlack','destroy','where','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x50f17d,_0x260de1){var _0x207fb8=function(_0x50456a){while(--_0x50456a){_0x50f17d['push'](_0x50f17d['shift']());}};_0x207fb8(++_0x260de1);}(_0x4ad4,0x10e));var _0x44ad=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x4ad4[_0x50007c];return _0x5c1ec7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x44ad('0x0'));var BPromise=require(_0x44ad('0x1'));var rs=require(_0x44ad('0x2'));var fs=require('fs');var Redis=require(_0x44ad('0x3'));var db=require(_0x44ad('0x4'))['db'];var utils=require(_0x44ad('0x5'));var logger=require(_0x44ad('0x6'))(_0x44ad('0x7'));var config=require('../../config/environment');var jayson=require(_0x44ad('0x8'));var client=jayson['client'][_0x44ad('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c52b1,_0x9ee1ca,_0xa4a767){return new BPromise(function(_0x12e265,_0x57e361){return client[_0x44ad('0xa')](_0x1c52b1,_0xa4a767)[_0x44ad('0xb')](function(_0x530597){logger[_0x44ad('0xc')](_0x44ad('0xd'),_0x9ee1ca,_0x44ad('0xe'));logger[_0x44ad('0xf')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x9ee1ca,'request\x20sent',JSON[_0x44ad('0x10')](_0x530597));if(_0x530597['error']){if(_0x530597[_0x44ad('0x11')]['code']===0x1f4){logger['error'](_0x44ad('0xd'),_0x9ee1ca,_0x530597['error'][_0x44ad('0x12')]);return _0x57e361(_0x530597[_0x44ad('0x11')][_0x44ad('0x12')]);}logger['error'](_0x44ad('0xd'),_0x9ee1ca,_0x530597[_0x44ad('0x11')][_0x44ad('0x12')]);return _0x12e265(_0x530597[_0x44ad('0x11')]['message']);}else{logger['info'](_0x44ad('0xd'),_0x9ee1ca,_0x44ad('0xe'));_0x12e265(_0x530597[_0x44ad('0x13')][_0x44ad('0x12')]);}})[_0x44ad('0x14')](function(_0x2b080d){logger[_0x44ad('0x11')](_0x44ad('0xd'),_0x9ee1ca,_0x2b080d);_0x57e361(_0x2b080d);});});}exports[_0x44ad('0x15')]=function(_0x1e16a8){var _0x44dc8a=this;return new Promise(function(_0x2a7cf6,_0x183fa6){return db['CmHopperBlack'][_0x44ad('0x16')]({'raw':_0x1e16a8['options']?_0x1e16a8[_0x44ad('0x17')][_0x44ad('0x18')]===undefined?!![]:![]:!![],'where':_0x1e16a8[_0x44ad('0x17')]?_0x1e16a8[_0x44ad('0x17')]['where']||null:null,'attributes':_0x1e16a8[_0x44ad('0x17')]?_0x1e16a8[_0x44ad('0x17')][_0x44ad('0x19')]||null:null,'limit':_0x1e16a8['options']?_0x1e16a8[_0x44ad('0x17')][_0x44ad('0x1a')]||null:null,'include':_0x1e16a8['options']?_0x1e16a8[_0x44ad('0x17')][_0x44ad('0x1b')]?_[_0x44ad('0x1c')](_0x1e16a8[_0x44ad('0x17')][_0x44ad('0x1b')],function(_0x23b72d){return{'model':db[_0x23b72d[_0x44ad('0x1d')]],'as':_0x23b72d['as'],'attributes':_0x23b72d[_0x44ad('0x19')],'include':_0x23b72d[_0x44ad('0x1b')]?_[_0x44ad('0x1c')](_0x23b72d[_0x44ad('0x1b')],function(_0x25b24c){return{'model':db[_0x25b24c['model']],'as':_0x25b24c['as'],'attributes':_0x25b24c[_0x44ad('0x19')],'include':_0x25b24c['include']?_[_0x44ad('0x1c')](_0x25b24c[_0x44ad('0x1b')],function(_0x311aee){return{'model':db[_0x311aee[_0x44ad('0x1d')]],'as':_0x311aee['as'],'attributes':_0x311aee[_0x44ad('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3060dc){logger[_0x44ad('0xc')](_0x44ad('0x15'),_0x1e16a8);logger[_0x44ad('0xf')](_0x44ad('0x15'),_0x1e16a8,JSON[_0x44ad('0x10')](_0x3060dc));_0x2a7cf6(_0x3060dc);})[_0x44ad('0x14')](function(_0x49aeeb){logger['error']('GetCmHopperBlack',_0x49aeeb['message'],_0x1e16a8);_0x183fa6(_0x44dc8a[_0x44ad('0x11')](0x1f4,_0x49aeeb[_0x44ad('0x12')]));});});};exports[_0x44ad('0x1e')]=function(_0x572e9e){var _0x456286=this;return new Promise(function(_0x2a64d4,_0x98e71b){return db[_0x44ad('0x1f')][_0x44ad('0x20')](_0x572e9e['body'],{'raw':_0x572e9e[_0x44ad('0x17')]?_0x572e9e[_0x44ad('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x572e9e[_0x44ad('0x17')]?_0x572e9e[_0x44ad('0x17')]['where']||null:null,'attributes':_0x572e9e[_0x44ad('0x17')]?_0x572e9e['options'][_0x44ad('0x19')]||null:null,'limit':_0x572e9e[_0x44ad('0x17')]?_0x572e9e[_0x44ad('0x17')]['limit']||null:null})[_0x44ad('0xb')](function(_0x2d2622){logger[_0x44ad('0xc')](_0x44ad('0x1e'),_0x572e9e);logger['debug'](_0x44ad('0x1e'),_0x572e9e,JSON['stringify'](_0x2d2622));_0x2a64d4(_0x2d2622);})[_0x44ad('0x14')](function(_0x2c34fd){logger[_0x44ad('0x11')](_0x44ad('0x1e'),_0x2c34fd[_0x44ad('0x12')],_0x572e9e);_0x98e71b(_0x456286[_0x44ad('0x11')](0x1f4,_0x2c34fd[_0x44ad('0x12')]));});});};exports[_0x44ad('0x21')]=function(_0x5e2e82){var _0x43fa6a=this;return new Promise(function(_0x4791dc,_0x5ba161){return db[_0x44ad('0x1f')][_0x44ad('0x22')]({'where':_0x5e2e82[_0x44ad('0x17')]?_0x5e2e82[_0x44ad('0x17')][_0x44ad('0x23')]||null:null})[_0x44ad('0xb')](function(_0x594c0d){logger[_0x44ad('0xc')](_0x44ad('0x21'),_0x5e2e82);logger[_0x44ad('0xf')](_0x44ad('0x21'),_0x5e2e82,JSON[_0x44ad('0x10')](_0x594c0d));_0x4791dc(_0x594c0d);})['catch'](function(_0x226886){logger['error']('DestroyCmHopperBlack',_0x226886['message'],_0x5e2e82);_0x5ba161(_0x43fa6a[_0x44ad('0x11')](0x1f4,_0x226886[_0x44ad('0x12')]));});});};
\ No newline at end of file
+var _0x1759=['stringify','code','error','CmHopperBlack,\x20%s,\x20%s','message','info','result','findAll','options','raw','attributes','limit','include','map','model','GetCmHopperBlack','catch','CmHopperBlack','body','UpdateCmHopperBlack','DestroyCmHopperBlack','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s'];(function(_0x3f4315,_0xd6ec89){var _0x5842e3=function(_0x4b12f5){while(--_0x4b12f5){_0x3f4315['push'](_0x3f4315['shift']());}};_0x5842e3(++_0xd6ec89);}(_0x1759,0xb2));var _0x9175=function(_0x34bd34,_0x1444f7){_0x34bd34=_0x34bd34-0x0;var _0x4e36d6=_0x1759[_0x34bd34];return _0x4e36d6;};'use strict';var _=require(_0x9175('0x0'));var util=require(_0x9175('0x1'));var moment=require(_0x9175('0x2'));var BPromise=require(_0x9175('0x3'));var rs=require(_0x9175('0x4'));var fs=require('fs');var Redis=require(_0x9175('0x5'));var db=require(_0x9175('0x6'))['db'];var utils=require(_0x9175('0x7'));var logger=require(_0x9175('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9175('0x9'));var client=jayson[_0x9175('0xa')][_0x9175('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5af769,_0x2057ae,_0x5c16b4){return new BPromise(function(_0x2ba60b,_0x29b5c9){return client[_0x9175('0xc')](_0x5af769,_0x5c16b4)[_0x9175('0xd')](function(_0x5be22f){logger['info']('CmHopperBlack,\x20%s,\x20%s',_0x2057ae,_0x9175('0xe'));logger[_0x9175('0xf')](_0x9175('0x10'),_0x2057ae,_0x9175('0xe'),JSON[_0x9175('0x11')](_0x5be22f));if(_0x5be22f['error']){if(_0x5be22f['error'][_0x9175('0x12')]===0x1f4){logger[_0x9175('0x13')](_0x9175('0x14'),_0x2057ae,_0x5be22f[_0x9175('0x13')][_0x9175('0x15')]);return _0x29b5c9(_0x5be22f[_0x9175('0x13')][_0x9175('0x15')]);}logger[_0x9175('0x13')]('CmHopperBlack,\x20%s,\x20%s',_0x2057ae,_0x5be22f[_0x9175('0x13')][_0x9175('0x15')]);return _0x2ba60b(_0x5be22f[_0x9175('0x13')][_0x9175('0x15')]);}else{logger[_0x9175('0x16')](_0x9175('0x14'),_0x2057ae,_0x9175('0xe'));_0x2ba60b(_0x5be22f[_0x9175('0x17')][_0x9175('0x15')]);}})['catch'](function(_0x5cf7ef){logger[_0x9175('0x13')](_0x9175('0x14'),_0x2057ae,_0x5cf7ef);_0x29b5c9(_0x5cf7ef);});});}exports['GetCmHopperBlack']=function(_0x3c736a){var _0x2808d7=this;return new Promise(function(_0x41bea0,_0xc4aa46){return db['CmHopperBlack'][_0x9175('0x18')]({'raw':_0x3c736a[_0x9175('0x19')]?_0x3c736a[_0x9175('0x19')][_0x9175('0x1a')]===undefined?!![]:![]:!![],'where':_0x3c736a[_0x9175('0x19')]?_0x3c736a[_0x9175('0x19')]['where']||null:null,'attributes':_0x3c736a[_0x9175('0x19')]?_0x3c736a[_0x9175('0x19')][_0x9175('0x1b')]||null:null,'limit':_0x3c736a['options']?_0x3c736a[_0x9175('0x19')][_0x9175('0x1c')]||null:null,'include':_0x3c736a['options']?_0x3c736a[_0x9175('0x19')][_0x9175('0x1d')]?_[_0x9175('0x1e')](_0x3c736a[_0x9175('0x19')][_0x9175('0x1d')],function(_0x46637b){return{'model':db[_0x46637b[_0x9175('0x1f')]],'as':_0x46637b['as'],'attributes':_0x46637b[_0x9175('0x1b')],'include':_0x46637b['include']?_[_0x9175('0x1e')](_0x46637b[_0x9175('0x1d')],function(_0x19b8cd){return{'model':db[_0x19b8cd[_0x9175('0x1f')]],'as':_0x19b8cd['as'],'attributes':_0x19b8cd['attributes'],'include':_0x19b8cd['include']?_['map'](_0x19b8cd[_0x9175('0x1d')],function(_0x4bea76){return{'model':db[_0x4bea76[_0x9175('0x1f')]],'as':_0x4bea76['as'],'attributes':_0x4bea76['attributes']};}):[]};}):[]};}):[]:[]})[_0x9175('0xd')](function(_0x5c081e){logger['info'](_0x9175('0x20'),_0x3c736a);logger[_0x9175('0xf')](_0x9175('0x20'),_0x3c736a,JSON[_0x9175('0x11')](_0x5c081e));_0x41bea0(_0x5c081e);})[_0x9175('0x21')](function(_0x399495){logger['error'](_0x9175('0x20'),_0x399495[_0x9175('0x15')],_0x3c736a);_0xc4aa46(_0x2808d7[_0x9175('0x13')](0x1f4,_0x399495['message']));});});};exports['UpdateCmHopperBlack']=function(_0x527d67){var _0x5d11ce=this;return new Promise(function(_0x554ee5,_0x231410){return db[_0x9175('0x22')]['update'](_0x527d67[_0x9175('0x23')],{'raw':_0x527d67['options']?_0x527d67['options'][_0x9175('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x527d67['options']?_0x527d67['options']['where']||null:null,'attributes':_0x527d67[_0x9175('0x19')]?_0x527d67[_0x9175('0x19')][_0x9175('0x1b')]||null:null,'limit':_0x527d67['options']?_0x527d67[_0x9175('0x19')][_0x9175('0x1c')]||null:null})[_0x9175('0xd')](function(_0x323265){logger[_0x9175('0x16')]('UpdateCmHopperBlack',_0x527d67);logger[_0x9175('0xf')](_0x9175('0x24'),_0x527d67,JSON['stringify'](_0x323265));_0x554ee5(_0x323265);})[_0x9175('0x21')](function(_0x147433){logger[_0x9175('0x13')]('UpdateCmHopperBlack',_0x147433[_0x9175('0x15')],_0x527d67);_0x231410(_0x5d11ce[_0x9175('0x13')](0x1f4,_0x147433[_0x9175('0x15')]));});});};exports[_0x9175('0x25')]=function(_0x1cbe44){var _0x10111e=this;return new Promise(function(_0xa15f2b,_0x1707de){return db[_0x9175('0x22')]['destroy']({'where':_0x1cbe44['options']?_0x1cbe44['options'][_0x9175('0x26')]||null:null})[_0x9175('0xd')](function(_0x434737){logger[_0x9175('0x16')](_0x9175('0x25'),_0x1cbe44);logger[_0x9175('0xf')]('DestroyCmHopperBlack',_0x1cbe44,JSON['stringify'](_0x434737));_0xa15f2b(_0x434737);})[_0x9175('0x21')](function(_0x10d87c){logger['error']('DestroyCmHopperBlack',_0x10d87c[_0x9175('0x15')],_0x1cbe44);_0x1707de(_0x10111e[_0x9175('0x13')](0x1f4,_0x10d87c[_0x9175('0x15')]));});});};
\ No newline at end of file
index 3a983d7..61e6b43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeda8=['get','isAuthenticated','index','describe','/:id','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller'];(function(_0x1bfd25,_0x349005){var _0x11804d=function(_0x47334c){while(--_0x47334c){_0x1bfd25['push'](_0x1bfd25['shift']());}};_0x11804d(++_0x349005);}(_0xeda8,0x104));var _0x8eda=function(_0x5d4940,_0x3328b9){_0x5d4940=_0x5d4940-0x0;var _0x2386af=_0xeda8[_0x5d4940];return _0x2386af;};'use strict';var multer=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var path=require('path');var timeout=require(_0x8eda('0x2'));var express=require(_0x8eda('0x3'));var router=express[_0x8eda('0x4')]();var fs_extra=require(_0x8eda('0x5'));var auth=require(_0x8eda('0x6'));var interaction=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var controller=require(_0x8eda('0x9'));router[_0x8eda('0xa')]('/',auth[_0x8eda('0xb')](),controller[_0x8eda('0xc')]);router[_0x8eda('0xa')]('/describe',auth[_0x8eda('0xb')](),controller[_0x8eda('0xd')]);router[_0x8eda('0xa')](_0x8eda('0xe'),auth['isAuthenticated'](),controller['show']);router['put']('/:id',auth[_0x8eda('0xb')](),controller[_0x8eda('0xf')]);router[_0x8eda('0x10')]('/:id',auth[_0x8eda('0xb')](),controller['destroy']);module[_0x8eda('0x11')]=router;
\ No newline at end of file
+var _0x8ca9=['express','Router','fs-extra','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3fcc20,_0x57c31b){var _0x15d3ce=function(_0x575619){while(--_0x575619){_0x3fcc20['push'](_0x3fcc20['shift']());}};_0x15d3ce(++_0x57c31b);}(_0x8ca9,0x9c));var _0x98ca=function(_0x37fcd0,_0x141d80){_0x37fcd0=_0x37fcd0-0x0;var _0x3869d4=_0x8ca9[_0x37fcd0];return _0x3869d4;};'use strict';var multer=require(_0x98ca('0x0'));var util=require(_0x98ca('0x1'));var path=require(_0x98ca('0x2'));var timeout=require(_0x98ca('0x3'));var express=require(_0x98ca('0x4'));var router=express[_0x98ca('0x5')]();var fs_extra=require(_0x98ca('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x98ca('0x7'));var controller=require('./cmHopperBlack.controller');router[_0x98ca('0x8')]('/',auth['isAuthenticated'](),controller[_0x98ca('0x9')]);router[_0x98ca('0x8')](_0x98ca('0xa'),auth[_0x98ca('0xb')](),controller[_0x98ca('0xc')]);router[_0x98ca('0x8')](_0x98ca('0xd'),auth[_0x98ca('0xb')](),controller[_0x98ca('0xe')]);router[_0x98ca('0xf')](_0x98ca('0xd'),auth[_0x98ca('0xb')](),controller[_0x98ca('0x10')]);router[_0x98ca('0x11')](_0x98ca('0xd'),auth[_0x98ca('0xb')](),controller[_0x98ca('0x12')]);module[_0x98ca('0x13')]=router;
\ No newline at end of file
index aaf0f9b..a86e0fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb1ae=['moment','exports','INTEGER','STRING','DATE','getDataValue','endtime','followuptime','seconds','setDataValue','dispositionat','BOOLEAN','sequelize'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xb1ae,0x185));var _0xeb1a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb1ae[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xeb1a('0x0'));var moment=require(_0xeb1a('0x1'));module[_0xeb1a('0x2')]={'state':{'type':Sequelize[_0xeb1a('0x3')](0x2)},'statedesc':{'type':Sequelize[_0xeb1a('0x4')]},'scheduledat':{'type':Sequelize[_0xeb1a('0x5')]},'countbusyretry':{'type':Sequelize[_0xeb1a('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xeb1a('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xeb1a('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xeb1a('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xeb1a('0x4')]},'starttime':{'type':Sequelize[_0xeb1a('0x5')]},'responsetime':{'type':Sequelize[_0xeb1a('0x5')]},'answertime':{'type':Sequelize[_0xeb1a('0x5')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xeb1a('0x5')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xeb1a('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xeb1a('0x4')]},'campaign':{'type':Sequelize[_0xeb1a('0x4')]},'campaigntype':{'type':Sequelize[_0xeb1a('0x4')]},'membername':{'type':Sequelize[_0xeb1a('0x4')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xeb1a('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0xeb1a('0x5')],'set':function(_0x398226){var _0x457440=this[_0xeb1a('0x6')](_0xeb1a('0x7'));if(_0x457440&&_0x398226){this['setDataValue'](_0xeb1a('0x8'),moment(_0x398226)['diff'](moment(_0x457440),_0xeb1a('0x9')));}return this[_0xeb1a('0xa')](_0xeb1a('0xb'),_0x398226);}},'amd':{'type':Sequelize[_0xeb1a('0xc')],'defaultValue':![]},'fax':{'type':Sequelize[_0xeb1a('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xeb1a('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xeb1a('0xc')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0xeb1a('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xeb1a('0x5')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0xeb1a('0x5')]},'recallme':{'type':Sequelize[_0xeb1a('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xeb1a('0x5')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xeb1a('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xeb1a('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x9d3f=['setDataValue','followuptime','diff','seconds','dispositionat','BOOLEAN','sequelize','exports','INTEGER','STRING','DATE','getDataValue'];(function(_0x2fda24,_0x526bdf){var _0x55b24f=function(_0x45c751){while(--_0x45c751){_0x2fda24['push'](_0x2fda24['shift']());}};_0x55b24f(++_0x526bdf);}(_0x9d3f,0x16e));var _0xf9d3=function(_0x4826dc,_0x4f5fde){_0x4826dc=_0x4826dc-0x0;var _0xb0dc35=_0x9d3f[_0x4826dc];return _0xb0dc35;};'use strict';var Sequelize=require(_0xf9d3('0x0'));var moment=require('moment');module[_0xf9d3('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xf9d3('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf9d3('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xf9d3('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xf9d3('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xf9d3('0x3')]},'originatecalleridname':{'type':Sequelize[_0xf9d3('0x3')]},'calleridnum':{'type':Sequelize[_0xf9d3('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xf9d3('0x4')]},'responsetime':{'type':Sequelize[_0xf9d3('0x4')]},'answertime':{'type':Sequelize[_0xf9d3('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xf9d3('0x4')]},'ringtime':{'type':Sequelize[_0xf9d3('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xf9d3('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xf9d3('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xf9d3('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xf9d3('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xf9d3('0x3')]},'membername':{'type':Sequelize[_0xf9d3('0x3')]},'reason':{'type':Sequelize[_0xf9d3('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xf9d3('0x3')]},'thirdDisposition':{'type':Sequelize[_0xf9d3('0x3')]},'dispositionat':{'type':Sequelize[_0xf9d3('0x4')],'set':function(_0xc08ee3){var _0xf1acd3=this[_0xf9d3('0x5')]('endtime');if(_0xf1acd3&&_0xc08ee3){this[_0xf9d3('0x6')](_0xf9d3('0x7'),moment(_0xc08ee3)[_0xf9d3('0x8')](moment(_0xf1acd3),_0xf9d3('0x9')));}return this[_0xf9d3('0x6')](_0xf9d3('0xa'),_0xc08ee3);}},'amd':{'type':Sequelize[_0xf9d3('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0xf9d3('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xf9d3('0x4')]},'callback':{'type':Sequelize[_0xf9d3('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xf9d3('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xf9d3('0x4')]},'deleted':{'type':Sequelize[_0xf9d3('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xf9d3('0x4')]},'recallme':{'type':Sequelize[_0xf9d3('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xf9d3('0x4')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xf9d3('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xf9d3('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index e576c0e..2fc8233 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fab=['json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','includeAll','include','findAll','then','rows','show','params','intersection','fields','options','find','catch','describe','body','countContactsQueueCampaignHopperFinal','COUNT','sequelize','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','dropContacts','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','VoiceQueueId','select','field','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','NOW()','updatedAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','Campaign','insert','CampaignId','createdAt','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status'];(function(_0x9cec8e,_0x3e73eb){var _0x45a605=function(_0x824da6){while(--_0x824da6){_0x9cec8e['push'](_0x9cec8e['shift']());}};_0x45a605(++_0x3e73eb);}(_0x5fab,0x177));var _0xb5fa=function(_0x126af7,_0x25fa06){_0x126af7=_0x126af7-0x0;var _0x25b500=_0x5fab[_0x126af7];return _0x25b500;};'use strict';var emlformat=require(_0xb5fa('0x0'));var rimraf=require(_0xb5fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5fa('0x2'));var rp=require(_0xb5fa('0x3'));var moment=require(_0xb5fa('0x4'));var BPromise=require(_0xb5fa('0x5'));var Mustache=require(_0xb5fa('0x6'));var util=require(_0xb5fa('0x7'));var path=require(_0xb5fa('0x8'));var sox=require(_0xb5fa('0x9'));var csv=require(_0xb5fa('0xa'));var ejs=require(_0xb5fa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xa'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var licenseUtil=require(_0xb5fa('0x18'));var db=require(_0xb5fa('0x19'))['db'];function respondWithStatusCode(_0x4d3576,_0x2ad830){_0x2ad830=_0x2ad830||0xcc;return function(_0x3dad4d){if(_0x3dad4d){return _0x4d3576['sendStatus'](_0x2ad830);}return _0x4d3576[_0xb5fa('0x1a')](_0x2ad830)['end']();};}function respondWithResult(_0x265992,_0x3fc372){_0x3fc372=_0x3fc372||0xc8;return function(_0x40c914){if(_0x40c914){return _0x265992[_0xb5fa('0x1a')](_0x3fc372)[_0xb5fa('0x1b')](_0x40c914);}};}function respondWithFilteredResult(_0x5371cf,_0x567f31){return function(_0x38e964){if(_0x38e964){var _0x587043=typeof _0x567f31[_0xb5fa('0x1c')]===_0xb5fa('0x1d')&&typeof _0x567f31['limit']==='undefined';var _0x451a55=_0x38e964[_0xb5fa('0x1e')];var _0x32e9e5=_0x587043?0x0:_0x567f31[_0xb5fa('0x1c')];var _0x324ba5=_0x587043?_0x38e964[_0xb5fa('0x1e')]:_0x567f31[_0xb5fa('0x1c')]+_0x567f31[_0xb5fa('0x1f')];var _0xc14dc4;if(_0x324ba5>=_0x451a55){_0x324ba5=_0x451a55;_0xc14dc4=0xc8;}else{_0xc14dc4=0xce;}_0x5371cf[_0xb5fa('0x1a')](_0xc14dc4);return _0x5371cf[_0xb5fa('0x20')](_0xb5fa('0x21'),_0x32e9e5+'-'+_0x324ba5+'/'+_0x451a55)['json'](_0x38e964);}return null;};}function patchUpdates(_0x432bfa){return function(_0x519e20){try{jsonpatch[_0xb5fa('0x22')](_0x519e20,_0x432bfa,!![]);}catch(_0x4a6c04){return BPromise[_0xb5fa('0x23')](_0x4a6c04);}return _0x519e20[_0xb5fa('0x24')]();};}function saveUpdates(_0x4e05c0,_0x40dfdf){return function(_0x3a2ab9){if(_0x3a2ab9){return _0x3a2ab9[_0xb5fa('0x25')](_0x4e05c0)['then'](function(_0x32a85c){return _0x32a85c;});}return null;};}function removeEntity(_0xec108f,_0x444237){return function(_0x542348){if(_0x542348){return _0x542348[_0xb5fa('0x26')]()['then'](function(){_0xec108f[_0xb5fa('0x1a')](0xcc)[_0xb5fa('0x27')]();});}};}function handleEntityNotFound(_0x11053a,_0x543edf){return function(_0x2dbd22){if(!_0x2dbd22){_0x11053a[_0xb5fa('0x28')](0x194);}return _0x2dbd22;};}function handleError(_0x6a455c,_0x20d649){_0x20d649=_0x20d649||0x1f4;return function(_0x568870){logger['error'](_0x568870['stack']);if(_0x568870['name']){delete _0x568870[_0xb5fa('0x29')];}_0x6a455c[_0xb5fa('0x1a')](_0x20d649)[_0xb5fa('0x2a')](_0x568870);};}exports[_0xb5fa('0x2b')]=function(_0x534884,_0x3506a4){var _0x358549={},_0x353314={},_0x409af9={'count':0x0,'rows':[]};var _0x2a5690=_[_0xb5fa('0x2c')](db[_0xb5fa('0x2d')][_0xb5fa('0x2e')],function(_0x1f4380){return{'name':_0x1f4380[_0xb5fa('0x2f')],'type':_0x1f4380[_0xb5fa('0x30')][_0xb5fa('0x31')]};});_0x353314[_0xb5fa('0x32')]=_[_0xb5fa('0x2c')](_0x2a5690,_0xb5fa('0x29'));_0x353314[_0xb5fa('0x33')]=_[_0xb5fa('0x34')](_0x534884[_0xb5fa('0x33')]);_0x353314[_0xb5fa('0x35')]=_['intersection'](_0x353314[_0xb5fa('0x32')],_0x353314['query']);_0x358549['attributes']=_['intersection'](_0x353314[_0xb5fa('0x32')],qs['fields'](_0x534884[_0xb5fa('0x33')]['fields']));_0x358549['attributes']=_0x358549[_0xb5fa('0x36')][_0xb5fa('0x37')]?_0x358549['attributes']:_0x353314['model'];if(!_0x534884[_0xb5fa('0x33')][_0xb5fa('0x38')](_0xb5fa('0x39'))){_0x358549['limit']=qs[_0xb5fa('0x1f')](_0x534884[_0xb5fa('0x33')]['limit']);_0x358549[_0xb5fa('0x1c')]=qs[_0xb5fa('0x1c')](_0x534884[_0xb5fa('0x33')]['offset']);}_0x358549[_0xb5fa('0x3a')]=qs[_0xb5fa('0x3b')](_0x534884[_0xb5fa('0x33')]['sort']);_0x358549[_0xb5fa('0x3c')]=qs[_0xb5fa('0x35')](_[_0xb5fa('0x3d')](_0x534884[_0xb5fa('0x33')],_0x353314['filters']),_0x2a5690);if(_0x534884['query']['filter']){_0x358549['where']=_['merge'](_0x358549['where'],{'$or':_[_0xb5fa('0x2c')](_0x2a5690,function(_0x4c0a4d){if(_0x4c0a4d[_0xb5fa('0x30')]!==_0xb5fa('0x3e')){var _0x36db1a={};_0x36db1a[_0x4c0a4d[_0xb5fa('0x29')]]={'$like':'%'+_0x534884[_0xb5fa('0x33')][_0xb5fa('0x3f')]+'%'};return _0x36db1a;}})});}_0x358549=_['merge']({},_0x358549,_0x534884['options']);var _0x4c4bf0={'where':_0x358549[_0xb5fa('0x3c')]};return db['CmHopperFinal'][_0xb5fa('0x1e')](_0x4c4bf0)['then'](function(_0x58aa97){_0x409af9[_0xb5fa('0x1e')]=_0x58aa97;if(_0x534884[_0xb5fa('0x33')][_0xb5fa('0x40')]){_0x358549[_0xb5fa('0x41')]=[{'all':!![]}];}return db[_0xb5fa('0x2d')][_0xb5fa('0x42')](_0x358549);})[_0xb5fa('0x43')](function(_0x83df0b){_0x409af9[_0xb5fa('0x44')]=_0x83df0b;return _0x409af9;})[_0xb5fa('0x43')](respondWithFilteredResult(_0x3506a4,_0x358549))['catch'](handleError(_0x3506a4,null));};exports[_0xb5fa('0x45')]=function(_0x4bc9df,_0x233f90){var _0x39aac3={'raw':!![],'where':{'id':_0x4bc9df[_0xb5fa('0x46')]['id']}},_0x2c7c5f={};_0x2c7c5f[_0xb5fa('0x32')]=_[_0xb5fa('0x34')](db[_0xb5fa('0x2d')][_0xb5fa('0x2e')]);_0x2c7c5f['query']=_[_0xb5fa('0x34')](_0x4bc9df[_0xb5fa('0x33')]);_0x2c7c5f['filters']=_[_0xb5fa('0x47')](_0x2c7c5f['model'],_0x2c7c5f[_0xb5fa('0x33')]);_0x39aac3[_0xb5fa('0x36')]=_['intersection'](_0x2c7c5f['model'],qs[_0xb5fa('0x48')](_0x4bc9df[_0xb5fa('0x33')][_0xb5fa('0x48')]));_0x39aac3[_0xb5fa('0x36')]=_0x39aac3[_0xb5fa('0x36')][_0xb5fa('0x37')]?_0x39aac3[_0xb5fa('0x36')]:_0x2c7c5f[_0xb5fa('0x32')];if(_0x4bc9df['query'][_0xb5fa('0x40')]){_0x39aac3[_0xb5fa('0x41')]=[{'all':!![]}];}_0x39aac3=_['merge']({},_0x39aac3,_0x4bc9df[_0xb5fa('0x49')]);return db[_0xb5fa('0x2d')][_0xb5fa('0x4a')](_0x39aac3)[_0xb5fa('0x43')](handleEntityNotFound(_0x233f90,null))[_0xb5fa('0x43')](respondWithResult(_0x233f90,null))[_0xb5fa('0x4b')](handleError(_0x233f90,null));};exports[_0xb5fa('0x4c')]=function(_0x33eb2c,_0x20f5f5){return db[_0xb5fa('0x2d')][_0xb5fa('0x4c')]()[_0xb5fa('0x43')](respondWithResult(_0x20f5f5,null))[_0xb5fa('0x4b')](handleError(_0x20f5f5,null));};exports[_0xb5fa('0x25')]=function(_0x42a359,_0x3a39f2){if(_0x42a359['body']['uniqueid']){delete _0x42a359[_0xb5fa('0x4d')]['uniqueid'];}return db[_0xb5fa('0x2d')][_0xb5fa('0x4a')]({'where':{'uniqueid':_0x42a359['params']['id']}})[_0xb5fa('0x43')](handleEntityNotFound(_0x3a39f2,null))[_0xb5fa('0x43')](saveUpdates(_0x42a359[_0xb5fa('0x4d')],null))[_0xb5fa('0x43')](respondWithResult(_0x3a39f2,null))[_0xb5fa('0x4b')](handleError(_0x3a39f2,null));};exports[_0xb5fa('0x4e')]=function(_0x51d5f7,_0x27a651,_0x4fd5bf){return db[_0xb5fa('0x2d')][_0xb5fa('0x42')]({'raw':![],'where':{'VoiceQueueId':_0x51d5f7[_0xb5fa('0x46')]['id']},'attributes':[[db['sequelize']['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db['sequelize']['literal'](_0xb5fa('0x51')))),_0xb5fa('0x52')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x54')))),_0xb5fa('0x55')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x56')))),_0xb5fa('0x57')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db['sequelize']['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x58')))),_0xb5fa('0x59')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x5a')))),'dropContacts'],[db['sequelize']['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')]['literal'](_0xb5fa('0x5b')))),_0xb5fa('0x5c')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')]('`state`\x20=\x2022,\x201,\x20null'))),_0xb5fa('0x5d')],[db[_0xb5fa('0x50')]['fn']('COUNT',db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')]['literal'](_0xb5fa('0x5e')))),_0xb5fa('0x5f')]]})[_0xb5fa('0x43')](handleEntityNotFound(_0x27a651,null))[_0xb5fa('0x43')](respondWithResult(_0x27a651,null))[_0xb5fa('0x4b')](handleError(_0x27a651,null));};exports[_0xb5fa('0x60')]=function(_0x18cde9,_0x40d7d5,_0xd2ba4e){return db[_0xb5fa('0x2d')][_0xb5fa('0x42')]({'raw':![],'where':{'CampaignId':_0x18cde9[_0xb5fa('0x46')]['id']},'attributes':[[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x51')))),_0xb5fa('0x52')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db['sequelize'][_0xb5fa('0x53')](_0xb5fa('0x54')))),_0xb5fa('0x55')],[db['sequelize']['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db['sequelize'][_0xb5fa('0x53')](_0xb5fa('0x56')))),_0xb5fa('0x57')],[db['sequelize']['fn']('COUNT',db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')]('`state`\x20=\x208,\x201,\x20null'))),_0xb5fa('0x59')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xb5fa('0x61')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db['sequelize']['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x5b')))),_0xb5fa('0x5c')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x62')))),_0xb5fa('0x5d')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')]['literal'](_0xb5fa('0x5e')))),'answeringMachine']]})[_0xb5fa('0x43')](handleEntityNotFound(_0x40d7d5,null))[_0xb5fa('0x43')](respondWithResult(_0x40d7d5,null))[_0xb5fa('0x4b')](handleError(_0x40d7d5,null));};exports[_0xb5fa('0x63')]=function(_0x339dfb,_0x56e6b0,_0x1585cd){return db['VoiceQueue'][_0xb5fa('0x4a')]({'where':{'id':_0x339dfb[_0xb5fa('0x46')]['id']}})[_0xb5fa('0x43')](handleEntityNotFound(_0x56e6b0,null))[_0xb5fa('0x43')](function(_0x5e44d8){var _0x4d1117;if(_0x5e44d8){_0x4d1117=squel['insert']()[_0xb5fa('0x64')](_0xb5fa('0x65'))[_0xb5fa('0x66')]([_0xb5fa('0x67'),_0xb5fa('0x68'),_0xb5fa('0x69'),'ListId',_0xb5fa('0x6a'),'createdAt','updatedAt'],squel[_0xb5fa('0x6b')]()['field']('ANY_VALUE(calleridnum)','phone')[_0xb5fa('0x6c')]('NOW()',_0xb5fa('0x68'))[_0xb5fa('0x6c')](_0xb5fa('0x6d'),'ContactId')['field'](_0xb5fa('0x6e'),_0xb5fa('0x6f'))['field'](_0xb5fa('0x70'),_0xb5fa('0x6a'))[_0xb5fa('0x6c')](_0xb5fa('0x71'),'createdAt')[_0xb5fa('0x6c')](_0xb5fa('0x71'),_0xb5fa('0x72'))[_0xb5fa('0x73')](_0xb5fa('0x74'))[_0xb5fa('0x3c')](_0xb5fa('0x75'),_0x339dfb['params']['id'][_0xb5fa('0x76')]())['where'](_0xb5fa('0x77'),_0x339dfb[_0xb5fa('0x4d')]['state'][_0xb5fa('0x76')]())[_0xb5fa('0x3c')](_0xb5fa('0x78'))[_0xb5fa('0x3c')](_0xb5fa('0x79'),squel[_0xb5fa('0x6b')]()[_0xb5fa('0x6c')](_0xb5fa('0x67'))['from'](_0xb5fa('0x65'))[_0xb5fa('0x3c')](_0xb5fa('0x75'),_0x339dfb[_0xb5fa('0x46')]['id']['toString']()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0xb5fa('0x6c')](_0xb5fa('0x7a'))[_0xb5fa('0x73')](_0xb5fa('0x74'))['where']('VoiceQueueId\x20=\x20?',_0x339dfb[_0xb5fa('0x46')]['id']['toString']())[_0xb5fa('0x3c')](_0xb5fa('0x7b')))[_0xb5fa('0x7c')](_0xb5fa('0x69')))['toString']();return db[_0xb5fa('0x50')]['query'](_0x4d1117);}return[];})[_0xb5fa('0x43')](respondWithResult(_0x56e6b0,null))[_0xb5fa('0x4b')](handleError(_0x56e6b0,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x5e6852,_0x391412,_0x3150ac){return db[_0xb5fa('0x7d')][_0xb5fa('0x4a')]({'where':{'id':_0x5e6852[_0xb5fa('0x46')]['id']}})[_0xb5fa('0x43')](handleEntityNotFound(_0x391412,null))[_0xb5fa('0x43')](function(_0x25b278){var _0x1a0255;if(_0x25b278){_0x1a0255=squel[_0xb5fa('0x7e')]()[_0xb5fa('0x64')](_0xb5fa('0x65'))[_0xb5fa('0x66')](['phone','scheduledAt',_0xb5fa('0x69'),'ListId',_0xb5fa('0x7f'),_0xb5fa('0x80'),'updatedAt'],squel[_0xb5fa('0x6b')]()[_0xb5fa('0x6c')]('ANY_VALUE(calleridnum)',_0xb5fa('0x67'))[_0xb5fa('0x6c')]('NOW()',_0xb5fa('0x68'))[_0xb5fa('0x6c')](_0xb5fa('0x6d'),'ContactId')['field'](_0xb5fa('0x6e'),_0xb5fa('0x6f'))[_0xb5fa('0x6c')](_0xb5fa('0x81'),_0xb5fa('0x7f'))[_0xb5fa('0x6c')](_0xb5fa('0x71'),_0xb5fa('0x80'))[_0xb5fa('0x6c')](_0xb5fa('0x71'),'updatedAt')['from'](_0xb5fa('0x74'))[_0xb5fa('0x3c')](_0xb5fa('0x82'),_0x5e6852[_0xb5fa('0x46')]['id']['toString']())[_0xb5fa('0x3c')](_0xb5fa('0x77'),_0x5e6852[_0xb5fa('0x4d')]['state'][_0xb5fa('0x76')]())[_0xb5fa('0x3c')](_0xb5fa('0x78'))[_0xb5fa('0x3c')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xb5fa('0x6b')]()[_0xb5fa('0x6c')](_0xb5fa('0x67'))[_0xb5fa('0x73')](_0xb5fa('0x65'))[_0xb5fa('0x3c')](_0xb5fa('0x82'),_0x5e6852[_0xb5fa('0x46')]['id'][_0xb5fa('0x76')]()))[_0xb5fa('0x3c')](_0xb5fa('0x79'),squel[_0xb5fa('0x6b')]()[_0xb5fa('0x6c')](_0xb5fa('0x7a'))[_0xb5fa('0x73')]('cm_hopper_final')[_0xb5fa('0x3c')](_0xb5fa('0x82'),_0x5e6852[_0xb5fa('0x46')]['id'][_0xb5fa('0x76')]())[_0xb5fa('0x3c')](_0xb5fa('0x7b')))[_0xb5fa('0x7c')](_0xb5fa('0x69')))['toString']();return db['sequelize'][_0xb5fa('0x33')](_0x1a0255);}return[];})['then'](respondWithResult(_0x391412,null))['catch'](handleError(_0x391412,null));};exports[_0xb5fa('0x83')]=function(_0x27dbe8,_0x2faf23,_0x4d607d){return db[_0xb5fa('0x84')][_0xb5fa('0x85')]({'where':{'VoiceQueueId':_0x27dbe8[_0xb5fa('0x4d')]['VoiceQueueId'],'CampaignId':_0x27dbe8[_0xb5fa('0x4d')][_0xb5fa('0x7f')],'ContactId':_0x27dbe8['body'][_0xb5fa('0x69')]}})[_0xb5fa('0x43')](handleEntityNotFound(_0x2faf23,null))[_0xb5fa('0x43')](function(_0xf15d5c){if(_0xf15d5c){return _0xf15d5c;}return null;})[_0xb5fa('0x43')](respondWithResult(_0x2faf23,null))[_0xb5fa('0x4b')](handleError(_0x2faf23,null));};
\ No newline at end of file
+var _0xc1c6=['jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','CmHopperFinal','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','length','find','describe','body','uniqueid','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','ANY_VALUE(calleridnum)','phone','ANY_VALUE(ContactId)','field','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','VoiceQueueId','NOW()','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','state\x20=\x204','group','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','CmHopper','findOne','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','to-csv','fs-extra','squel','crypto'];(function(_0x14363e,_0x4f0e0d){var _0x17c56d=function(_0x1c7bac){while(--_0x1c7bac){_0x14363e['push'](_0x14363e['shift']());}};_0x17c56d(++_0x4f0e0d);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x324558,_0x5756f6){_0x324558=_0x324558-0x0;var _0x68ce1=_0xc1c6[_0x324558];return _0x68ce1;};'use strict';var emlformat=require(_0x6c1c('0x0'));var rimraf=require(_0x6c1c('0x1'));var zipdir=require(_0x6c1c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6c1c('0x3'));var moment=require('moment');var BPromise=require(_0x6c1c('0x4'));var Mustache=require(_0x6c1c('0x5'));var util=require(_0x6c1c('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6c1c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6c1c('0x8'));var _=require('lodash');var squel=require(_0x6c1c('0x9'));var crypto=require(_0x6c1c('0xa'));var jsforce=require(_0x6c1c('0xb'));var deskjs=require(_0x6c1c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6c1c('0xd'));var Papa=require(_0x6c1c('0xe'));var Redis=require('ioredis');var authService=require(_0x6c1c('0xf'));var qs=require(_0x6c1c('0x10'));var as=require(_0x6c1c('0x11'));var hardwareService=require(_0x6c1c('0x12'));var logger=require('../../config/logger')(_0x6c1c('0x13'));var utils=require(_0x6c1c('0x14'));var config=require(_0x6c1c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6c1c('0x16'))['db'];function respondWithStatusCode(_0x12a9e6,_0x2067bd){_0x2067bd=_0x2067bd||0xcc;return function(_0x49304f){if(_0x49304f){return _0x12a9e6[_0x6c1c('0x17')](_0x2067bd);}return _0x12a9e6['status'](_0x2067bd)[_0x6c1c('0x18')]();};}function respondWithResult(_0x15a1fc,_0x2d279e){_0x2d279e=_0x2d279e||0xc8;return function(_0x154107){if(_0x154107){return _0x15a1fc[_0x6c1c('0x19')](_0x2d279e)[_0x6c1c('0x1a')](_0x154107);}};}function respondWithFilteredResult(_0x297c33,_0x41aa74){return function(_0x448f35){if(_0x448f35){var _0x5f3758=typeof _0x41aa74[_0x6c1c('0x1b')]===_0x6c1c('0x1c')&&typeof _0x41aa74['limit']===_0x6c1c('0x1c');var _0x237cac=_0x448f35['count'];var _0x137770=_0x5f3758?0x0:_0x41aa74['offset'];var _0x338dc2=_0x5f3758?_0x448f35[_0x6c1c('0x1d')]:_0x41aa74['offset']+_0x41aa74[_0x6c1c('0x1e')];var _0x59ab38;if(_0x338dc2>=_0x237cac){_0x338dc2=_0x237cac;_0x59ab38=0xc8;}else{_0x59ab38=0xce;}_0x297c33[_0x6c1c('0x19')](_0x59ab38);return _0x297c33[_0x6c1c('0x1f')](_0x6c1c('0x20'),_0x137770+'-'+_0x338dc2+'/'+_0x237cac)[_0x6c1c('0x1a')](_0x448f35);}return null;};}function patchUpdates(_0x1acf7f){return function(_0x1efb19){try{jsonpatch[_0x6c1c('0x21')](_0x1efb19,_0x1acf7f,!![]);}catch(_0x2ed830){return BPromise[_0x6c1c('0x22')](_0x2ed830);}return _0x1efb19[_0x6c1c('0x23')]();};}function saveUpdates(_0x3d2bf3,_0x450b1f){return function(_0x2382c0){if(_0x2382c0){return _0x2382c0[_0x6c1c('0x24')](_0x3d2bf3)[_0x6c1c('0x25')](function(_0x19c269){return _0x19c269;});}return null;};}function removeEntity(_0x2319d3,_0x12c638){return function(_0x3a3f13){if(_0x3a3f13){return _0x3a3f13[_0x6c1c('0x26')]()[_0x6c1c('0x25')](function(){_0x2319d3[_0x6c1c('0x19')](0xcc)[_0x6c1c('0x18')]();});}};}function handleEntityNotFound(_0x7ff10d,_0x18452d){return function(_0x80bc05){if(!_0x80bc05){_0x7ff10d[_0x6c1c('0x17')](0x194);}return _0x80bc05;};}function handleError(_0x1b9d7d,_0x2feaf4){_0x2feaf4=_0x2feaf4||0x1f4;return function(_0x5f4568){logger[_0x6c1c('0x27')](_0x5f4568['stack']);if(_0x5f4568[_0x6c1c('0x28')]){delete _0x5f4568['name'];}_0x1b9d7d[_0x6c1c('0x19')](_0x2feaf4)['send'](_0x5f4568);};}exports[_0x6c1c('0x29')]=function(_0xf557ba,_0x504348){var _0x3b1a4f={},_0x24da4c={},_0x4e13e3={'count':0x0,'rows':[]};var _0x3b319a=_[_0x6c1c('0x2a')](db[_0x6c1c('0x2b')][_0x6c1c('0x2c')],function(_0x4fc279){return{'name':_0x4fc279['fieldName'],'type':_0x4fc279[_0x6c1c('0x2d')][_0x6c1c('0x2e')]};});_0x24da4c[_0x6c1c('0x2f')]=_[_0x6c1c('0x2a')](_0x3b319a,_0x6c1c('0x28'));_0x24da4c[_0x6c1c('0x30')]=_['keys'](_0xf557ba[_0x6c1c('0x30')]);_0x24da4c[_0x6c1c('0x31')]=_['intersection'](_0x24da4c[_0x6c1c('0x2f')],_0x24da4c[_0x6c1c('0x30')]);_0x3b1a4f[_0x6c1c('0x32')]=_[_0x6c1c('0x33')](_0x24da4c['model'],qs[_0x6c1c('0x34')](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x3b1a4f['attributes']=_0x3b1a4f[_0x6c1c('0x32')]['length']?_0x3b1a4f[_0x6c1c('0x32')]:_0x24da4c['model'];if(!_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x35')](_0x6c1c('0x36'))){_0x3b1a4f['limit']=qs['limit'](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x1e')]);_0x3b1a4f[_0x6c1c('0x1b')]=qs['offset'](_0xf557ba[_0x6c1c('0x30')]['offset']);}_0x3b1a4f['order']=qs[_0x6c1c('0x37')](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x37')]);_0x3b1a4f[_0x6c1c('0x38')]=qs['filters'](_[_0x6c1c('0x39')](_0xf557ba[_0x6c1c('0x30')],_0x24da4c[_0x6c1c('0x31')]),_0x3b319a);if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3a')]){_0x3b1a4f[_0x6c1c('0x38')]=_[_0x6c1c('0x3b')](_0x3b1a4f[_0x6c1c('0x38')],{'$or':_[_0x6c1c('0x2a')](_0x3b319a,function(_0x232508){if(_0x232508['type']!==_0x6c1c('0x3c')){var _0x464549={};_0x464549[_0x232508[_0x6c1c('0x28')]]={'$like':'%'+_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3a')]+'%'};return _0x464549;}})});}_0x3b1a4f=_['merge']({},_0x3b1a4f,_0xf557ba['options']);var _0x549db1={'where':_0x3b1a4f[_0x6c1c('0x38')]};return db['CmHopperFinal']['count'](_0x549db1)[_0x6c1c('0x25')](function(_0x37244e){_0x4e13e3['count']=_0x37244e;if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x3b1a4f[_0x6c1c('0x3e')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x6c1c('0x3f')](_0x3b1a4f);})[_0x6c1c('0x25')](function(_0x502e75){_0x4e13e3[_0x6c1c('0x40')]=_0x502e75;return _0x4e13e3;})['then'](respondWithFilteredResult(_0x504348,_0x3b1a4f))[_0x6c1c('0x41')](handleError(_0x504348,null));};exports[_0x6c1c('0x42')]=function(_0x16a389,_0x174f2c){var _0x10764a={'raw':!![],'where':{'id':_0x16a389[_0x6c1c('0x43')]['id']}},_0x595ba2={};_0x595ba2[_0x6c1c('0x2f')]=_[_0x6c1c('0x44')](db['CmHopperFinal'][_0x6c1c('0x2c')]);_0x595ba2[_0x6c1c('0x30')]=_[_0x6c1c('0x44')](_0x16a389[_0x6c1c('0x30')]);_0x595ba2[_0x6c1c('0x31')]=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],_0x595ba2['query']);_0x10764a['attributes']=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],qs[_0x6c1c('0x34')](_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x10764a[_0x6c1c('0x32')]=_0x10764a[_0x6c1c('0x32')][_0x6c1c('0x45')]?_0x10764a[_0x6c1c('0x32')]:_0x595ba2['model'];if(_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x10764a['include']=[{'all':!![]}];}_0x10764a=_[_0x6c1c('0x3b')]({},_0x10764a,_0x16a389['options']);return db[_0x6c1c('0x2b')][_0x6c1c('0x46')](_0x10764a)[_0x6c1c('0x25')](handleEntityNotFound(_0x174f2c,null))[_0x6c1c('0x25')](respondWithResult(_0x174f2c,null))[_0x6c1c('0x41')](handleError(_0x174f2c,null));};exports['describe']=function(_0x1fe6e8,_0x58d075){return db[_0x6c1c('0x2b')][_0x6c1c('0x47')]()[_0x6c1c('0x25')](respondWithResult(_0x58d075,null))[_0x6c1c('0x41')](handleError(_0x58d075,null));};exports[_0x6c1c('0x24')]=function(_0x26cf7f,_0x52c14d){if(_0x26cf7f[_0x6c1c('0x48')][_0x6c1c('0x49')]){delete _0x26cf7f['body'][_0x6c1c('0x49')];}return db[_0x6c1c('0x2b')][_0x6c1c('0x46')]({'where':{'uniqueid':_0x26cf7f[_0x6c1c('0x43')]['id']}})['then'](handleEntityNotFound(_0x52c14d,null))[_0x6c1c('0x25')](saveUpdates(_0x26cf7f[_0x6c1c('0x48')],null))[_0x6c1c('0x25')](respondWithResult(_0x52c14d,null))['catch'](handleError(_0x52c14d,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x56b367,_0x5714a6,_0x5008b7){return db[_0x6c1c('0x2b')][_0x6c1c('0x3f')]({'raw':![],'where':{'VoiceQueueId':_0x56b367['params']['id']},'attributes':[[db[_0x6c1c('0x4a')]['fn'](_0x6c1c('0x4b'),db[_0x6c1c('0x4a')]['fn']('IF',db['sequelize']['literal'](_0x6c1c('0x4c')))),_0x6c1c('0x4d')],[db['sequelize']['fn'](_0x6c1c('0x4b'),db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')](_0x6c1c('0x4f')))),_0x6c1c('0x50')],[db['sequelize']['fn'](_0x6c1c('0x4b'),db[_0x6c1c('0x4a')]['fn']('IF',db['sequelize']['literal'](_0x6c1c('0x51')))),_0x6c1c('0x52')],[db[_0x6c1c('0x4a')]['fn']('COUNT',db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')](_0x6c1c('0x53')))),'congestionContacts'],[db['sequelize']['fn'](_0x6c1c('0x4b'),db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x6c1c('0x54')],[db[_0x6c1c('0x4a')]['fn']('COUNT',db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')](_0x6c1c('0x55')))),_0x6c1c('0x56')],[db[_0x6c1c('0x4a')]['fn']('COUNT',db[_0x6c1c('0x4a')]['fn']('IF',db['sequelize'][_0x6c1c('0x4e')](_0x6c1c('0x57')))),_0x6c1c('0x58')],[db[_0x6c1c('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')](_0x6c1c('0x59')))),'answeringMachine']]})[_0x6c1c('0x25')](handleEntityNotFound(_0x5714a6,null))[_0x6c1c('0x25')](respondWithResult(_0x5714a6,null))[_0x6c1c('0x41')](handleError(_0x5714a6,null));};exports[_0x6c1c('0x5a')]=function(_0x14f3b5,_0x3229e6,_0xed095f){return db['CmHopperFinal'][_0x6c1c('0x3f')]({'raw':![],'where':{'CampaignId':_0x14f3b5['params']['id']},'attributes':[[db[_0x6c1c('0x4a')]['fn'](_0x6c1c('0x4b'),db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')]['literal'](_0x6c1c('0x4c')))),_0x6c1c('0x4d')],[db[_0x6c1c('0x4a')]['fn'](_0x6c1c('0x4b'),db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')](_0x6c1c('0x4f')))),_0x6c1c('0x50')],[db[_0x6c1c('0x4a')]['fn'](_0x6c1c('0x4b'),db['sequelize']['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')](_0x6c1c('0x51')))),_0x6c1c('0x52')],[db[_0x6c1c('0x4a')]['fn']('COUNT',db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')]['literal'](_0x6c1c('0x53')))),_0x6c1c('0x5b')],[db[_0x6c1c('0x4a')]['fn']('COUNT',db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')](_0x6c1c('0x5c')))),_0x6c1c('0x54')],[db[_0x6c1c('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')]('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db['sequelize']['fn'](_0x6c1c('0x4b'),db[_0x6c1c('0x4a')]['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')]('`state`\x20=\x2022,\x201,\x20null'))),_0x6c1c('0x58')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6c1c('0x4a')][_0x6c1c('0x4e')](_0x6c1c('0x59')))),_0x6c1c('0x5d')]]})[_0x6c1c('0x25')](handleEntityNotFound(_0x3229e6,null))[_0x6c1c('0x25')](respondWithResult(_0x3229e6,null))['catch'](handleError(_0x3229e6,null));};exports[_0x6c1c('0x5e')]=function(_0x16b741,_0x204e78,_0x5a919a){return db['VoiceQueue']['find']({'where':{'id':_0x16b741[_0x6c1c('0x43')]['id']}})[_0x6c1c('0x25')](handleEntityNotFound(_0x204e78,null))['then'](function(_0x10e499){var _0x579ca3;if(_0x10e499){_0x579ca3=squel[_0x6c1c('0x5f')]()[_0x6c1c('0x60')](_0x6c1c('0x61'))[_0x6c1c('0x62')](['phone',_0x6c1c('0x63'),_0x6c1c('0x64'),'ListId','VoiceQueueId',_0x6c1c('0x65'),_0x6c1c('0x66')],squel[_0x6c1c('0x67')]()['field'](_0x6c1c('0x68'),_0x6c1c('0x69'))['field']('NOW()','scheduledAt')['field'](_0x6c1c('0x6a'),'ContactId')[_0x6c1c('0x6b')](_0x6c1c('0x6c'),_0x6c1c('0x6d'))['field'](_0x6c1c('0x6e'),_0x6c1c('0x6f'))[_0x6c1c('0x6b')](_0x6c1c('0x70'),_0x6c1c('0x65'))['field'](_0x6c1c('0x70'),'updatedAt')[_0x6c1c('0x71')](_0x6c1c('0x72'))[_0x6c1c('0x38')](_0x6c1c('0x73'),_0x16b741[_0x6c1c('0x43')]['id'][_0x6c1c('0x74')]())[_0x6c1c('0x38')](_0x6c1c('0x75'),_0x16b741['body'][_0x6c1c('0x76')]['toString']())['where'](_0x6c1c('0x77'))[_0x6c1c('0x38')](_0x6c1c('0x78'),squel[_0x6c1c('0x67')]()['field'](_0x6c1c('0x69'))['from'](_0x6c1c('0x61'))['where'](_0x6c1c('0x73'),_0x16b741[_0x6c1c('0x43')]['id'][_0x6c1c('0x74')]()))['where'](_0x6c1c('0x78'),squel[_0x6c1c('0x67')]()[_0x6c1c('0x6b')]('calleridnum')[_0x6c1c('0x71')](_0x6c1c('0x72'))[_0x6c1c('0x38')](_0x6c1c('0x73'),_0x16b741['params']['id'][_0x6c1c('0x74')]())[_0x6c1c('0x38')](_0x6c1c('0x79')))[_0x6c1c('0x7a')](_0x6c1c('0x64')))['toString']();return db[_0x6c1c('0x4a')][_0x6c1c('0x30')](_0x579ca3);}return[];})[_0x6c1c('0x25')](respondWithResult(_0x204e78,null))[_0x6c1c('0x41')](handleError(_0x204e78,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x1ad9e2,_0x44d8c4,_0x33a141){return db['Campaign'][_0x6c1c('0x46')]({'where':{'id':_0x1ad9e2[_0x6c1c('0x43')]['id']}})['then'](handleEntityNotFound(_0x44d8c4,null))[_0x6c1c('0x25')](function(_0x50b56b){var _0x1a493a;if(_0x50b56b){_0x1a493a=squel[_0x6c1c('0x5f')]()[_0x6c1c('0x60')](_0x6c1c('0x61'))['fromQuery']([_0x6c1c('0x69'),_0x6c1c('0x63'),_0x6c1c('0x64'),'ListId',_0x6c1c('0x7b'),_0x6c1c('0x65'),_0x6c1c('0x66')],squel[_0x6c1c('0x67')]()['field'](_0x6c1c('0x68'),_0x6c1c('0x69'))[_0x6c1c('0x6b')]('NOW()',_0x6c1c('0x63'))['field'](_0x6c1c('0x6a'),_0x6c1c('0x64'))[_0x6c1c('0x6b')](_0x6c1c('0x6c'),_0x6c1c('0x6d'))[_0x6c1c('0x6b')](_0x6c1c('0x7c'),_0x6c1c('0x7b'))['field'](_0x6c1c('0x70'),'createdAt')[_0x6c1c('0x6b')](_0x6c1c('0x70'),_0x6c1c('0x66'))[_0x6c1c('0x71')]('cm_hopper_final')[_0x6c1c('0x38')](_0x6c1c('0x7d'),_0x1ad9e2[_0x6c1c('0x43')]['id']['toString']())[_0x6c1c('0x38')](_0x6c1c('0x75'),_0x1ad9e2['body']['state'][_0x6c1c('0x74')]())[_0x6c1c('0x38')](_0x6c1c('0x77'))[_0x6c1c('0x38')](_0x6c1c('0x78'),squel[_0x6c1c('0x67')]()[_0x6c1c('0x6b')](_0x6c1c('0x69'))[_0x6c1c('0x71')](_0x6c1c('0x61'))[_0x6c1c('0x38')](_0x6c1c('0x7d'),_0x1ad9e2['params']['id'][_0x6c1c('0x74')]()))[_0x6c1c('0x38')](_0x6c1c('0x78'),squel[_0x6c1c('0x67')]()[_0x6c1c('0x6b')](_0x6c1c('0x7e'))[_0x6c1c('0x71')]('cm_hopper_final')[_0x6c1c('0x38')]('CampaignId\x20=\x20?',_0x1ad9e2['params']['id'][_0x6c1c('0x74')]())[_0x6c1c('0x38')](_0x6c1c('0x79')))[_0x6c1c('0x7a')](_0x6c1c('0x64')))[_0x6c1c('0x74')]();return db[_0x6c1c('0x4a')][_0x6c1c('0x30')](_0x1a493a);}return[];})[_0x6c1c('0x25')](respondWithResult(_0x44d8c4,null))[_0x6c1c('0x41')](handleError(_0x44d8c4,null));};exports['checkContactHopper']=function(_0x3e40b6,_0x654041,_0x1a0da8){return db[_0x6c1c('0x7f')][_0x6c1c('0x80')]({'where':{'VoiceQueueId':_0x3e40b6[_0x6c1c('0x48')][_0x6c1c('0x6f')],'CampaignId':_0x3e40b6[_0x6c1c('0x48')]['CampaignId'],'ContactId':_0x3e40b6[_0x6c1c('0x48')][_0x6c1c('0x64')]}})[_0x6c1c('0x25')](handleEntityNotFound(_0x654041,null))[_0x6c1c('0x25')](function(_0x385629){if(_0x385629){return _0x385629;}return null;})[_0x6c1c('0x25')](respondWithResult(_0x654041,null))[_0x6c1c('0x41')](handleError(_0x654041,null));};
\ No newline at end of file
index a1d6fca..0a19a94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71e3=['uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','CmHopperFinal','cm_hopper_final','calleridnum'];(function(_0x5bd1b9,_0x4bb414){var _0x9d4bef=function(_0x3c98a1){while(--_0x3c98a1){_0x5bd1b9['push'](_0x5bd1b9['shift']());}};_0x9d4bef(++_0x4bb414);}(_0x71e3,0x197));var _0x371e=function(_0x33dbc1,_0x14e9de){_0x33dbc1=_0x33dbc1-0x0;var _0x60ad91=_0x71e3[_0x33dbc1];return _0x60ad91;};'use strict';var _=require('lodash');var util=require(_0x371e('0x0'));var logger=require(_0x371e('0x1'))(_0x371e('0x2'));var moment=require(_0x371e('0x3'));var BPromise=require(_0x371e('0x4'));var rp=require(_0x371e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x371e('0x6'));var config=require(_0x371e('0x7'));var attributes=require(_0x371e('0x8'));module[_0x371e('0x9')]=function(_0x7c83fe,_0x54bad4){return _0x7c83fe['define'](_0x371e('0xa'),attributes,{'tableName':_0x371e('0xb'),'paranoid':![],'indexes':[{'name':_0x371e('0xc'),'fields':[_0x371e('0xc')]},{'name':'uniqueid','fields':[_0x371e('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2844=['uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./cmHopperFinal.attributes','define','CmHopperFinal','cm_hopper_final','calleridnum'];(function(_0x2728f7,_0x3c50b6){var _0x2f893f=function(_0x280096){while(--_0x280096){_0x2728f7['push'](_0x2728f7['shift']());}};_0x2f893f(++_0x3c50b6);}(_0x2844,0x1b3));var _0x4284=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x2844[_0x3ff085];return _0x2b68c3;};'use strict';var _=require(_0x4284('0x0'));var util=require(_0x4284('0x1'));var logger=require(_0x4284('0x2'))('api');var moment=require(_0x4284('0x3'));var BPromise=require(_0x4284('0x4'));var rp=require(_0x4284('0x5'));var fs=require('fs');var path=require(_0x4284('0x6'));var rimraf=require(_0x4284('0x7'));var config=require('../../config/environment');var attributes=require(_0x4284('0x8'));module['exports']=function(_0x1ad9fe,_0x4c5de1){return _0x1ad9fe[_0x4284('0x9')](_0x4284('0xa'),attributes,{'tableName':_0x4284('0xb'),'paranoid':![],'indexes':[{'name':_0x4284('0xc'),'fields':['calleridnum']},{'name':_0x4284('0xd'),'fields':[_0x4284('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 21ffa94..9c6c3a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x4b5c71,_0x4d2d91){var _0x190764=function(_0xd3a9fc){while(--_0xd3a9fc){_0x4b5c71['push'](_0x4b5c71['shift']());}};_0x190764(++_0x4d2d91);}(_0x7a54,0x106));var _0x47a5=function(_0x218a6c,_0x2406f1){_0x218a6c=_0x218a6c-0x0;var _0x4aa33e=_0x7a54[_0x218a6c];return _0x4aa33e;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};
\ No newline at end of file
+var _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(_0x1cc3f0,_0x3fe635){var _0x50fbe6=function(_0x37f5a4){while(--_0x37f5a4){_0x1cc3f0['push'](_0x1cc3f0['shift']());}};_0x50fbe6(++_0x3fe635);}(_0xb10b,0x12a));var _0xbb10=function(_0x335cfa,_0x1e7634){_0x335cfa=_0x335cfa-0x0;var _0xb7a81b=_0xb10b[_0x335cfa];return _0xb7a81b;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});};
\ No newline at end of file
index 02b2950..c00535e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x848e=['isAuthenticated','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperFinal.controller','get','/describe'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x848e,0x91));var _0xe848=function(_0x155eb8,_0x5aca30){_0x155eb8=_0x155eb8-0x0;var _0x159589=_0x848e[_0x155eb8];return _0x159589;};'use strict';var multer=require(_0xe848('0x0'));var util=require(_0xe848('0x1'));var path=require(_0xe848('0x2'));var timeout=require(_0xe848('0x3'));var express=require(_0xe848('0x4'));var router=express['Router']();var fs_extra=require(_0xe848('0x5'));var auth=require(_0xe848('0x6'));var interaction=require(_0xe848('0x7'));var config=require('../../config/environment');var controller=require(_0xe848('0x8'));router[_0xe848('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe848('0x9')](_0xe848('0xa'),auth[_0xe848('0xb')](),controller[_0xe848('0xc')]);router[_0xe848('0x9')](_0xe848('0xd'),auth['isAuthenticated'](),controller[_0xe848('0xe')]);router[_0xe848('0x9')](_0xe848('0xf'),auth[_0xe848('0xb')](),controller[_0xe848('0x10')]);router[_0xe848('0x9')]('/campaign/countAttributes/:id',auth[_0xe848('0xb')](),controller[_0xe848('0x11')]);router[_0xe848('0x12')](_0xe848('0x13'),auth[_0xe848('0xb')](),controller[_0xe848('0x14')]);router[_0xe848('0x12')](_0xe848('0x15'),auth[_0xe848('0xb')](),controller[_0xe848('0x16')]);router[_0xe848('0x12')](_0xe848('0x17'),auth[_0xe848('0xb')](),controller[_0xe848('0x18')]);router[_0xe848('0x19')]('/:id',auth[_0xe848('0xb')](),controller['update']);module['exports']=router;
\ No newline at end of file
+var _0xdd2e=['/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','moveContactsIvrCampaignHopperFinal','put','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe'];(function(_0xff460b,_0x21f4bd){var _0x4ec5ea=function(_0x93bb61){while(--_0x93bb61){_0xff460b['push'](_0xff460b['shift']());}};_0x4ec5ea(++_0x21f4bd);}(_0xdd2e,0x13d));var _0xedd2=function(_0xb85abb,_0xe82dac){_0xb85abb=_0xb85abb-0x0;var _0xe97155=_0xdd2e[_0xb85abb];return _0xe97155;};'use strict';var multer=require(_0xedd2('0x0'));var util=require(_0xedd2('0x1'));var path=require('path');var timeout=require(_0xedd2('0x2'));var express=require(_0xedd2('0x3'));var router=express['Router']();var fs_extra=require(_0xedd2('0x4'));var auth=require(_0xedd2('0x5'));var interaction=require(_0xedd2('0x6'));var config=require(_0xedd2('0x7'));var controller=require('./cmHopperFinal.controller');router['get']('/',auth[_0xedd2('0x8')](),controller[_0xedd2('0x9')]);router[_0xedd2('0xa')](_0xedd2('0xb'),auth[_0xedd2('0x8')](),controller[_0xedd2('0xc')]);router[_0xedd2('0xa')]('/:id',auth[_0xedd2('0x8')](),controller['show']);router[_0xedd2('0xa')](_0xedd2('0xd'),auth[_0xedd2('0x8')](),controller[_0xedd2('0xe')]);router[_0xedd2('0xa')](_0xedd2('0xf'),auth[_0xedd2('0x8')](),controller['countContactsIvrCampaignHopperFinal']);router['post'](_0xedd2('0x10'),auth[_0xedd2('0x8')](),controller[_0xedd2('0x11')]);router[_0xedd2('0x12')]('/voice/campaign/moveContacts/:id',auth['isAuthenticated'](),controller[_0xedd2('0x13')]);router['post']('/checkContactHopper',auth[_0xedd2('0x8')](),controller['checkContactHopper']);router[_0xedd2('0x14')]('/:id',auth[_0xedd2('0x8')](),controller['update']);module[_0xedd2('0x15')]=router;
\ No newline at end of file
index ef1535b..5713176 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38fc=['DATE','BOOLEAN','sequelize','exports','INTEGER','STRING'];(function(_0x4346ab,_0x33a311){var _0x472234=function(_0x31be6e){while(--_0x31be6e){_0x4346ab['push'](_0x4346ab['shift']());}};_0x472234(++_0x33a311);}(_0x38fc,0x8c));var _0xc38f=function(_0x22bb29,_0x120f0a){_0x22bb29=_0x22bb29-0x0;var _0x4a3bac=_0x38fc[_0x22bb29];return _0x4a3bac;};'use strict';var Sequelize=require(_0xc38f('0x0'));module[_0xc38f('0x1')]={'state':{'type':Sequelize[_0xc38f('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xc38f('0x3')]},'scheduledat':{'type':Sequelize[_0xc38f('0x4')]},'countbusyretry':{'type':Sequelize[_0xc38f('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xc38f('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xc38f('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xc38f('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xc38f('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xc38f('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xc38f('0x4')]},'responsetime':{'type':Sequelize[_0xc38f('0x4')]},'answertime':{'type':Sequelize[_0xc38f('0x4')]},'droptime':{'type':Sequelize[_0xc38f('0x4')]},'endtime':{'type':Sequelize[_0xc38f('0x4')]},'ringtime':{'type':Sequelize[_0xc38f('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xc38f('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xc38f('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xc38f('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xc38f('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xc38f('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0xc38f('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xc38f('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xc38f('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xc38f('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xc38f('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xc38f('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xc38f('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xc38f('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xdcd5=['DATE','BOOLEAN','sequelize','exports','INTEGER','STRING'];(function(_0x1e5b53,_0x2d9fb6){var _0x48b242=function(_0x286e2a){while(--_0x286e2a){_0x1e5b53['push'](_0x1e5b53['shift']());}};_0x48b242(++_0x2d9fb6);}(_0xdcd5,0x110));var _0x5dcd=function(_0x39bc44,_0x1d4373){_0x39bc44=_0x39bc44-0x0;var _0x2916d8=_0xdcd5[_0x39bc44];return _0x2916d8;};'use strict';var Sequelize=require(_0x5dcd('0x0'));module[_0x5dcd('0x1')]={'state':{'type':Sequelize[_0x5dcd('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x5dcd('0x3')]},'scheduledat':{'type':Sequelize[_0x5dcd('0x4')]},'countbusyretry':{'type':Sequelize[_0x5dcd('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5dcd('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x5dcd('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x5dcd('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x5dcd('0x3')]},'originatecalleridname':{'type':Sequelize[_0x5dcd('0x3')]},'calleridnum':{'type':Sequelize[_0x5dcd('0x3')]},'calleridname':{'type':Sequelize[_0x5dcd('0x3')]},'starttime':{'type':Sequelize[_0x5dcd('0x4')]},'responsetime':{'type':Sequelize[_0x5dcd('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x5dcd('0x4')]},'ringtime':{'type':Sequelize[_0x5dcd('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x5dcd('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x5dcd('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x5dcd('0x3')]},'campaign':{'type':Sequelize[_0x5dcd('0x3')]},'campaigntype':{'type':Sequelize[_0x5dcd('0x3')]},'membername':{'type':Sequelize[_0x5dcd('0x3')]},'reason':{'type':Sequelize[_0x5dcd('0x3')]},'amd':{'type':Sequelize[_0x5dcd('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5dcd('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5dcd('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0x5dcd('0x4')]},'edited':{'type':Sequelize[_0x5dcd('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x5dcd('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5dcd('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5dcd('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5dcd('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5dcd('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x5dcd('0x3')]}};
\ No newline at end of file
index c56e384..ed23c43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c20=['length','find','create','body','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','name','index','map','CmHopperHistory','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x7c20,0x168));var _0x07c2=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x7c20[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0x07c2('0x0'));var rimraf=require(_0x07c2('0x1'));var zipdir=require(_0x07c2('0x2'));var jsonpatch=require(_0x07c2('0x3'));var rp=require('request-promise');var moment=require(_0x07c2('0x4'));var BPromise=require(_0x07c2('0x5'));var Mustache=require(_0x07c2('0x6'));var util=require(_0x07c2('0x7'));var path=require(_0x07c2('0x8'));var sox=require(_0x07c2('0x9'));var csv=require(_0x07c2('0xa'));var ejs=require(_0x07c2('0xb'));var fs=require('fs');var fs_extra=require(_0x07c2('0xc'));var _=require(_0x07c2('0xd'));var squel=require(_0x07c2('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x07c2('0xf'));var toCsv=require(_0x07c2('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x07c2('0x10'));var authService=require(_0x07c2('0x11'));var qs=require(_0x07c2('0x12'));var as=require(_0x07c2('0x13'));var hardwareService=require(_0x07c2('0x14'));var logger=require('../../config/logger')(_0x07c2('0x15'));var utils=require(_0x07c2('0x16'));var config=require(_0x07c2('0x17'));var licenseUtil=require(_0x07c2('0x18'));var db=require(_0x07c2('0x19'))['db'];function respondWithStatusCode(_0x215d1b,_0x153db0){_0x153db0=_0x153db0||0xcc;return function(_0x518f23){if(_0x518f23){return _0x215d1b['sendStatus'](_0x153db0);}return _0x215d1b[_0x07c2('0x1a')](_0x153db0)[_0x07c2('0x1b')]();};}function respondWithResult(_0xbd1796,_0x50e744){_0x50e744=_0x50e744||0xc8;return function(_0x5319b2){if(_0x5319b2){return _0xbd1796[_0x07c2('0x1a')](_0x50e744)[_0x07c2('0x1c')](_0x5319b2);}};}function respondWithFilteredResult(_0x3406ca,_0xd95d7){return function(_0x204c08){if(_0x204c08){var _0x149fac=typeof _0xd95d7[_0x07c2('0x1d')]===_0x07c2('0x1e')&&typeof _0xd95d7[_0x07c2('0x1f')]===_0x07c2('0x1e');var _0x6565d7=_0x204c08[_0x07c2('0x20')];var _0x168760=_0x149fac?0x0:_0xd95d7[_0x07c2('0x1d')];var _0x4177de=_0x149fac?_0x204c08[_0x07c2('0x20')]:_0xd95d7[_0x07c2('0x1d')]+_0xd95d7['limit'];var _0x45f88d;if(_0x4177de>=_0x6565d7){_0x4177de=_0x6565d7;_0x45f88d=0xc8;}else{_0x45f88d=0xce;}_0x3406ca['status'](_0x45f88d);return _0x3406ca['set'](_0x07c2('0x21'),_0x168760+'-'+_0x4177de+'/'+_0x6565d7)['json'](_0x204c08);}return null;};}function patchUpdates(_0x494261){return function(_0x1143cb){try{jsonpatch[_0x07c2('0x22')](_0x1143cb,_0x494261,!![]);}catch(_0x19fd4d){return BPromise['reject'](_0x19fd4d);}return _0x1143cb[_0x07c2('0x23')]();};}function saveUpdates(_0x467b15,_0x13fe9a){return function(_0x18eea){if(_0x18eea){return _0x18eea[_0x07c2('0x24')](_0x467b15)[_0x07c2('0x25')](function(_0x4bdbc1){return _0x4bdbc1;});}return null;};}function removeEntity(_0x3aa862,_0x1b51be){return function(_0x35fcf8){if(_0x35fcf8){return _0x35fcf8['destroy']()[_0x07c2('0x25')](function(){_0x3aa862['status'](0xcc)[_0x07c2('0x1b')]();});}};}function handleEntityNotFound(_0x3cd33f,_0x7a9891){return function(_0x54efb9){if(!_0x54efb9){_0x3cd33f['sendStatus'](0x194);}return _0x54efb9;};}function handleError(_0xea1b4d,_0x4615ed){_0x4615ed=_0x4615ed||0x1f4;return function(_0x31057b){logger['error'](_0x31057b['stack']);if(_0x31057b[_0x07c2('0x26')]){delete _0x31057b['name'];}_0xea1b4d[_0x07c2('0x1a')](_0x4615ed)['send'](_0x31057b);};}exports[_0x07c2('0x27')]=function(_0x70e67e,_0x1ba5b7){var _0x35632e={},_0x23f881={},_0x365e97={'count':0x0,'rows':[]};var _0x38e2a4=_[_0x07c2('0x28')](db[_0x07c2('0x29')][_0x07c2('0x2a')],function(_0x5ca455){return{'name':_0x5ca455[_0x07c2('0x2b')],'type':_0x5ca455[_0x07c2('0x2c')]['key']};});_0x23f881[_0x07c2('0x2d')]=_[_0x07c2('0x28')](_0x38e2a4,'name');_0x23f881['query']=_[_0x07c2('0x2e')](_0x70e67e[_0x07c2('0x2f')]);_0x23f881[_0x07c2('0x30')]=_['intersection'](_0x23f881[_0x07c2('0x2d')],_0x23f881[_0x07c2('0x2f')]);_0x35632e['attributes']=_[_0x07c2('0x31')](_0x23f881[_0x07c2('0x2d')],qs[_0x07c2('0x32')](_0x70e67e['query'][_0x07c2('0x32')]));_0x35632e[_0x07c2('0x33')]=_0x35632e['attributes']['length']?_0x35632e[_0x07c2('0x33')]:_0x23f881[_0x07c2('0x2d')];if(!_0x70e67e[_0x07c2('0x2f')]['hasOwnProperty'](_0x07c2('0x34'))){_0x35632e['limit']=qs[_0x07c2('0x1f')](_0x70e67e[_0x07c2('0x2f')][_0x07c2('0x1f')]);_0x35632e[_0x07c2('0x1d')]=qs['offset'](_0x70e67e['query'][_0x07c2('0x1d')]);}_0x35632e[_0x07c2('0x35')]=qs[_0x07c2('0x36')](_0x70e67e['query']['sort']);_0x35632e['where']=qs[_0x07c2('0x30')](_['pick'](_0x70e67e[_0x07c2('0x2f')],_0x23f881['filters']),_0x38e2a4);if(_0x70e67e[_0x07c2('0x2f')]['filter']){_0x35632e[_0x07c2('0x37')]=_[_0x07c2('0x38')](_0x35632e[_0x07c2('0x37')],{'$or':_['map'](_0x38e2a4,function(_0x4aed9a){if(_0x4aed9a[_0x07c2('0x2c')]!==_0x07c2('0x39')){var _0x3335aa={};_0x3335aa[_0x4aed9a[_0x07c2('0x26')]]={'$like':'%'+_0x70e67e['query'][_0x07c2('0x3a')]+'%'};return _0x3335aa;}})});}_0x35632e=_['merge']({},_0x35632e,_0x70e67e[_0x07c2('0x3b')]);var _0x3926f4={'where':_0x35632e['where']};return db['CmHopperHistory'][_0x07c2('0x20')](_0x3926f4)[_0x07c2('0x25')](function(_0x2b3afc){_0x365e97[_0x07c2('0x20')]=_0x2b3afc;if(_0x70e67e[_0x07c2('0x2f')][_0x07c2('0x3c')]){_0x35632e[_0x07c2('0x3d')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x07c2('0x3e')](_0x35632e);})[_0x07c2('0x25')](function(_0x626f9b){_0x365e97[_0x07c2('0x3f')]=_0x626f9b;return _0x365e97;})[_0x07c2('0x25')](respondWithFilteredResult(_0x1ba5b7,_0x35632e))[_0x07c2('0x40')](handleError(_0x1ba5b7,null));};exports['show']=function(_0x35502c,_0x4ad0d9){var _0x35ad98={'raw':!![],'where':{'id':_0x35502c[_0x07c2('0x41')]['id']}},_0xa72123={};_0xa72123[_0x07c2('0x2d')]=_[_0x07c2('0x2e')](db[_0x07c2('0x29')][_0x07c2('0x2a')]);_0xa72123[_0x07c2('0x2f')]=_[_0x07c2('0x2e')](_0x35502c[_0x07c2('0x2f')]);_0xa72123[_0x07c2('0x30')]=_[_0x07c2('0x31')](_0xa72123[_0x07c2('0x2d')],_0xa72123[_0x07c2('0x2f')]);_0x35ad98['attributes']=_[_0x07c2('0x31')](_0xa72123[_0x07c2('0x2d')],qs[_0x07c2('0x32')](_0x35502c[_0x07c2('0x2f')][_0x07c2('0x32')]));_0x35ad98[_0x07c2('0x33')]=_0x35ad98['attributes'][_0x07c2('0x42')]?_0x35ad98['attributes']:_0xa72123[_0x07c2('0x2d')];if(_0x35502c[_0x07c2('0x2f')][_0x07c2('0x3c')]){_0x35ad98['include']=[{'all':!![]}];}_0x35ad98=_[_0x07c2('0x38')]({},_0x35ad98,_0x35502c[_0x07c2('0x3b')]);return db['CmHopperHistory'][_0x07c2('0x43')](_0x35ad98)['then'](handleEntityNotFound(_0x4ad0d9,null))[_0x07c2('0x25')](respondWithResult(_0x4ad0d9,null))[_0x07c2('0x40')](handleError(_0x4ad0d9,null));};exports['create']=function(_0x2deca9,_0x24937d){return db[_0x07c2('0x29')][_0x07c2('0x44')](_0x2deca9[_0x07c2('0x45')],{})[_0x07c2('0x25')](respondWithResult(_0x24937d,0xc9))[_0x07c2('0x40')](handleError(_0x24937d,null));};exports['describe']=function(_0x2a8b12,_0x2ee903){return db['CmHopperHistory']['describe']()[_0x07c2('0x25')](respondWithResult(_0x2ee903,null))[_0x07c2('0x40')](handleError(_0x2ee903,null));};exports[_0x07c2('0x24')]=function(_0x3ec27f,_0x9b4da7){if(_0x3ec27f[_0x07c2('0x45')][_0x07c2('0x46')]){delete _0x3ec27f[_0x07c2('0x45')][_0x07c2('0x46')];}return db[_0x07c2('0x29')][_0x07c2('0x43')]({'where':{'uniqueid':_0x3ec27f[_0x07c2('0x41')]['id']}})[_0x07c2('0x25')](handleEntityNotFound(_0x9b4da7,null))[_0x07c2('0x25')](saveUpdates(_0x3ec27f[_0x07c2('0x45')],null))[_0x07c2('0x25')](respondWithResult(_0x9b4da7,null))[_0x07c2('0x40')](handleError(_0x9b4da7,null));};
\ No newline at end of file
+var _0xf88a=['key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','describe','uniqueid','eml-format','fast-json-patch','request-promise','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/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','end','stack','name','send','map','CmHopperHistory'];(function(_0x131fe8,_0x197b65){var _0x1972c2=function(_0x2f74b7){while(--_0x2f74b7){_0x131fe8['push'](_0x131fe8['shift']());}};_0x1972c2(++_0x197b65);}(_0xf88a,0x1e8));var _0xaf88=function(_0x561e7b,_0x4bcd2e){_0x561e7b=_0x561e7b-0x0;var _0x5851ed=_0xf88a[_0x561e7b];return _0x5851ed;};'use strict';var emlformat=require(_0xaf88('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xaf88('0x1'));var rp=require(_0xaf88('0x2'));var moment=require('moment');var BPromise=require(_0xaf88('0x3'));var Mustache=require('mustache');var util=require(_0xaf88('0x4'));var path=require(_0xaf88('0x5'));var sox=require(_0xaf88('0x6'));var csv=require(_0xaf88('0x7'));var ejs=require(_0xaf88('0x8'));var fs=require('fs');var fs_extra=require(_0xaf88('0x9'));var _=require(_0xaf88('0xa'));var squel=require(_0xaf88('0xb'));var crypto=require(_0xaf88('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xaf88('0xd'));var toCsv=require(_0xaf88('0x7'));var querystring=require(_0xaf88('0xe'));var Papa=require(_0xaf88('0xf'));var Redis=require('ioredis');var authService=require(_0xaf88('0x10'));var qs=require(_0xaf88('0x11'));var as=require(_0xaf88('0x12'));var hardwareService=require(_0xaf88('0x13'));var logger=require('../../config/logger')(_0xaf88('0x14'));var utils=require(_0xaf88('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xaf88('0x16'));var db=require(_0xaf88('0x17'))['db'];function respondWithStatusCode(_0x160101,_0x372241){_0x372241=_0x372241||0xcc;return function(_0x5793f9){if(_0x5793f9){return _0x160101[_0xaf88('0x18')](_0x372241);}return _0x160101[_0xaf88('0x19')](_0x372241)['end']();};}function respondWithResult(_0x400bc0,_0x17771e){_0x17771e=_0x17771e||0xc8;return function(_0x2b2a2e){if(_0x2b2a2e){return _0x400bc0['status'](_0x17771e)[_0xaf88('0x1a')](_0x2b2a2e);}};}function respondWithFilteredResult(_0x2b11c4,_0xf43537){return function(_0x53ea6e){if(_0x53ea6e){var _0x3472ab=typeof _0xf43537[_0xaf88('0x1b')]===_0xaf88('0x1c')&&typeof _0xf43537['limit']===_0xaf88('0x1c');var _0x172d02=_0x53ea6e[_0xaf88('0x1d')];var _0x46da21=_0x3472ab?0x0:_0xf43537[_0xaf88('0x1b')];var _0x298269=_0x3472ab?_0x53ea6e[_0xaf88('0x1d')]:_0xf43537[_0xaf88('0x1b')]+_0xf43537[_0xaf88('0x1e')];var _0x1424f5;if(_0x298269>=_0x172d02){_0x298269=_0x172d02;_0x1424f5=0xc8;}else{_0x1424f5=0xce;}_0x2b11c4['status'](_0x1424f5);return _0x2b11c4[_0xaf88('0x1f')](_0xaf88('0x20'),_0x46da21+'-'+_0x298269+'/'+_0x172d02)['json'](_0x53ea6e);}return null;};}function patchUpdates(_0x1521ea){return function(_0x438231){try{jsonpatch[_0xaf88('0x21')](_0x438231,_0x1521ea,!![]);}catch(_0x18402c){return BPromise[_0xaf88('0x22')](_0x18402c);}return _0x438231[_0xaf88('0x23')]();};}function saveUpdates(_0xcfd198,_0x4da524){return function(_0x2b8199){if(_0x2b8199){return _0x2b8199['update'](_0xcfd198)[_0xaf88('0x24')](function(_0x502a42){return _0x502a42;});}return null;};}function removeEntity(_0x2774dd,_0xf32fef){return function(_0xb67ef5){if(_0xb67ef5){return _0xb67ef5[_0xaf88('0x25')]()['then'](function(){_0x2774dd[_0xaf88('0x19')](0xcc)[_0xaf88('0x26')]();});}};}function handleEntityNotFound(_0x5bd613,_0x187229){return function(_0x16a325){if(!_0x16a325){_0x5bd613[_0xaf88('0x18')](0x194);}return _0x16a325;};}function handleError(_0x19ee24,_0x3d1fee){_0x3d1fee=_0x3d1fee||0x1f4;return function(_0x5064df){logger['error'](_0x5064df[_0xaf88('0x27')]);if(_0x5064df['name']){delete _0x5064df[_0xaf88('0x28')];}_0x19ee24[_0xaf88('0x19')](_0x3d1fee)[_0xaf88('0x29')](_0x5064df);};}exports['index']=function(_0x5d930e,_0x440257){var _0x356923={},_0x3a00e6={},_0x3be689={'count':0x0,'rows':[]};var _0x147573=_[_0xaf88('0x2a')](db[_0xaf88('0x2b')]['rawAttributes'],function(_0x1148b1){return{'name':_0x1148b1['fieldName'],'type':_0x1148b1['type'][_0xaf88('0x2c')]};});_0x3a00e6[_0xaf88('0x2d')]=_[_0xaf88('0x2a')](_0x147573,'name');_0x3a00e6[_0xaf88('0x2e')]=_[_0xaf88('0x2f')](_0x5d930e[_0xaf88('0x2e')]);_0x3a00e6[_0xaf88('0x30')]=_[_0xaf88('0x31')](_0x3a00e6[_0xaf88('0x2d')],_0x3a00e6[_0xaf88('0x2e')]);_0x356923[_0xaf88('0x32')]=_['intersection'](_0x3a00e6[_0xaf88('0x2d')],qs['fields'](_0x5d930e['query'][_0xaf88('0x33')]));_0x356923[_0xaf88('0x32')]=_0x356923[_0xaf88('0x32')][_0xaf88('0x34')]?_0x356923[_0xaf88('0x32')]:_0x3a00e6[_0xaf88('0x2d')];if(!_0x5d930e[_0xaf88('0x2e')][_0xaf88('0x35')](_0xaf88('0x36'))){_0x356923[_0xaf88('0x1e')]=qs['limit'](_0x5d930e['query']['limit']);_0x356923[_0xaf88('0x1b')]=qs[_0xaf88('0x1b')](_0x5d930e[_0xaf88('0x2e')][_0xaf88('0x1b')]);}_0x356923[_0xaf88('0x37')]=qs['sort'](_0x5d930e[_0xaf88('0x2e')][_0xaf88('0x38')]);_0x356923[_0xaf88('0x39')]=qs['filters'](_[_0xaf88('0x3a')](_0x5d930e['query'],_0x3a00e6[_0xaf88('0x30')]),_0x147573);if(_0x5d930e[_0xaf88('0x2e')][_0xaf88('0x3b')]){_0x356923[_0xaf88('0x39')]=_['merge'](_0x356923['where'],{'$or':_[_0xaf88('0x2a')](_0x147573,function(_0x272107){if(_0x272107[_0xaf88('0x3c')]!==_0xaf88('0x3d')){var _0x173828={};_0x173828[_0x272107['name']]={'$like':'%'+_0x5d930e['query']['filter']+'%'};return _0x173828;}})});}_0x356923=_[_0xaf88('0x3e')]({},_0x356923,_0x5d930e[_0xaf88('0x3f')]);var _0x7da1bf={'where':_0x356923[_0xaf88('0x39')]};return db['CmHopperHistory'][_0xaf88('0x1d')](_0x7da1bf)['then'](function(_0x1a8ede){_0x3be689['count']=_0x1a8ede;if(_0x5d930e[_0xaf88('0x2e')][_0xaf88('0x40')]){_0x356923[_0xaf88('0x41')]=[{'all':!![]}];}return db[_0xaf88('0x2b')][_0xaf88('0x42')](_0x356923);})[_0xaf88('0x24')](function(_0x3518f1){_0x3be689[_0xaf88('0x43')]=_0x3518f1;return _0x3be689;})[_0xaf88('0x24')](respondWithFilteredResult(_0x440257,_0x356923))[_0xaf88('0x44')](handleError(_0x440257,null));};exports['show']=function(_0xa3732d,_0xf330ac){var _0x227f94={'raw':!![],'where':{'id':_0xa3732d[_0xaf88('0x45')]['id']}},_0xb8d30e={};_0xb8d30e['model']=_[_0xaf88('0x2f')](db[_0xaf88('0x2b')][_0xaf88('0x46')]);_0xb8d30e[_0xaf88('0x2e')]=_[_0xaf88('0x2f')](_0xa3732d[_0xaf88('0x2e')]);_0xb8d30e[_0xaf88('0x30')]=_['intersection'](_0xb8d30e[_0xaf88('0x2d')],_0xb8d30e[_0xaf88('0x2e')]);_0x227f94[_0xaf88('0x32')]=_[_0xaf88('0x31')](_0xb8d30e[_0xaf88('0x2d')],qs[_0xaf88('0x33')](_0xa3732d[_0xaf88('0x2e')][_0xaf88('0x33')]));_0x227f94[_0xaf88('0x32')]=_0x227f94[_0xaf88('0x32')][_0xaf88('0x34')]?_0x227f94[_0xaf88('0x32')]:_0xb8d30e[_0xaf88('0x2d')];if(_0xa3732d['query'][_0xaf88('0x40')]){_0x227f94[_0xaf88('0x41')]=[{'all':!![]}];}_0x227f94=_[_0xaf88('0x3e')]({},_0x227f94,_0xa3732d[_0xaf88('0x3f')]);return db[_0xaf88('0x2b')][_0xaf88('0x47')](_0x227f94)[_0xaf88('0x24')](handleEntityNotFound(_0xf330ac,null))[_0xaf88('0x24')](respondWithResult(_0xf330ac,null))['catch'](handleError(_0xf330ac,null));};exports[_0xaf88('0x48')]=function(_0x2caaa3,_0x3e84df){return db[_0xaf88('0x2b')][_0xaf88('0x48')](_0x2caaa3[_0xaf88('0x49')],{})[_0xaf88('0x24')](respondWithResult(_0x3e84df,0xc9))[_0xaf88('0x44')](handleError(_0x3e84df,null));};exports['describe']=function(_0x38c3b,_0x478f76){return db[_0xaf88('0x2b')][_0xaf88('0x4a')]()['then'](respondWithResult(_0x478f76,null))[_0xaf88('0x44')](handleError(_0x478f76,null));};exports['update']=function(_0x2e2220,_0x502a79){if(_0x2e2220[_0xaf88('0x49')][_0xaf88('0x4b')]){delete _0x2e2220[_0xaf88('0x49')][_0xaf88('0x4b')];}return db[_0xaf88('0x2b')][_0xaf88('0x47')]({'where':{'uniqueid':_0x2e2220[_0xaf88('0x45')]['id']}})['then'](handleEntityNotFound(_0x502a79,null))[_0xaf88('0x24')](saveUpdates(_0x2e2220[_0xaf88('0x49')],null))[_0xaf88('0x24')](respondWithResult(_0x502a79,null))[_0xaf88('0x44')](handleError(_0x502a79,null));};
\ No newline at end of file
index 6a8bb91..93f0da3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44fe=['rimraf','../../config/environment','./cmHopperHistory.attributes','define','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x55c979,_0x36c5f0){var _0x690107=function(_0xa61dad){while(--_0xa61dad){_0x55c979['push'](_0x55c979['shift']());}};_0x690107(++_0x36c5f0);}(_0x44fe,0x16f));var _0xe44f=function(_0x91280,_0x4872c6){_0x91280=_0x91280-0x0;var _0x3a0654=_0x44fe[_0x91280];return _0x3a0654;};'use strict';var _=require(_0xe44f('0x0'));var util=require(_0xe44f('0x1'));var logger=require(_0xe44f('0x2'))(_0xe44f('0x3'));var moment=require(_0xe44f('0x4'));var BPromise=require(_0xe44f('0x5'));var rp=require(_0xe44f('0x6'));var fs=require('fs');var path=require(_0xe44f('0x7'));var rimraf=require(_0xe44f('0x8'));var config=require(_0xe44f('0x9'));var attributes=require(_0xe44f('0xa'));module['exports']=function(_0x4a41be,_0x1abe56){return _0x4a41be[_0xe44f('0xb')]('CmHopperHistory',attributes,{'tableName':_0xe44f('0xc'),'paranoid':![],'indexes':[{'name':_0xe44f('0xd'),'fields':[_0xe44f('0xd')]},{'name':_0xe44f('0xe'),'fields':[_0xe44f('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8f4c=['endtime','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','CmHopperHistory'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0x8f4c,0x113));var _0xc8f4=function(_0x28467d,_0x2ac2bf){_0x28467d=_0x28467d-0x0;var _0x22cbbd=_0x8f4c[_0x28467d];return _0x22cbbd;};'use strict';var _=require(_0xc8f4('0x0'));var util=require(_0xc8f4('0x1'));var logger=require(_0xc8f4('0x2'))(_0xc8f4('0x3'));var moment=require(_0xc8f4('0x4'));var BPromise=require(_0xc8f4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc8f4('0x6'));var rimraf=require(_0xc8f4('0x7'));var config=require(_0xc8f4('0x8'));var attributes=require('./cmHopperHistory.attributes');module[_0xc8f4('0x9')]=function(_0x5208da,_0x4c86f8){return _0x5208da['define'](_0xc8f4('0xa'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0xc8f4('0xb'),'fields':[_0xc8f4('0xb')]},{'name':_0xc8f4('0xc'),'fields':[_0xc8f4('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 153a793..1ed2bcd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9219=['where','col','COUNT','sequelize','`state`\x20=\x204,\x201,\x20null','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','AvgHandleTime','findAll','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','options','raw'];(function(_0x4f3f71,_0x1e35ce){var _0x559c25=function(_0x1d874e){while(--_0x1d874e){_0x4f3f71['push'](_0x4f3f71['shift']());}};_0x559c25(++_0x1e35ce);}(_0x9219,0xc0));var _0x9921=function(_0x32e00d,_0x179884){_0x32e00d=_0x32e00d-0x0;var _0x11022a=_0x9219[_0x32e00d];return _0x11022a;};'use strict';var _=require(_0x9921('0x0'));var util=require(_0x9921('0x1'));var moment=require(_0x9921('0x2'));var BPromise=require(_0x9921('0x3'));var rs=require(_0x9921('0x4'));var fs=require('fs');var Redis=require(_0x9921('0x5'));var db=require(_0x9921('0x6'))['db'];var utils=require(_0x9921('0x7'));var logger=require(_0x9921('0x8'))('rpc');var config=require(_0x9921('0x9'));var jayson=require(_0x9921('0xa'));var client=jayson[_0x9921('0xb')][_0x9921('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x59aaa6,_0x1f959d,_0x3bb89a){return new BPromise(function(_0x160efa,_0x5b5cb4){return client[_0x9921('0xd')](_0x59aaa6,_0x3bb89a)[_0x9921('0xe')](function(_0x127a0c){logger[_0x9921('0xf')](_0x9921('0x10'),_0x1f959d,'request\x20sent');logger[_0x9921('0x11')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x1f959d,_0x9921('0x12'),JSON[_0x9921('0x13')](_0x127a0c));if(_0x127a0c[_0x9921('0x14')]){if(_0x127a0c[_0x9921('0x14')][_0x9921('0x15')]===0x1f4){logger[_0x9921('0x14')](_0x9921('0x10'),_0x1f959d,_0x127a0c[_0x9921('0x14')][_0x9921('0x16')]);return _0x5b5cb4(_0x127a0c[_0x9921('0x14')][_0x9921('0x16')]);}logger['error'](_0x9921('0x10'),_0x1f959d,_0x127a0c['error'][_0x9921('0x16')]);return _0x160efa(_0x127a0c['error'][_0x9921('0x16')]);}else{logger[_0x9921('0xf')](_0x9921('0x10'),_0x1f959d,'request\x20sent');_0x160efa(_0x127a0c[_0x9921('0x17')][_0x9921('0x16')]);}})[_0x9921('0x18')](function(_0x5da894){logger[_0x9921('0x14')](_0x9921('0x10'),_0x1f959d,_0x5da894);_0x5b5cb4(_0x5da894);});});}exports[_0x9921('0x19')]=function(_0x238770){var _0x191117=this;return new Promise(function(_0x122bda,_0x1673da){return db[_0x9921('0x1a')][_0x9921('0x1b')](_0x238770['body'],{'raw':_0x238770[_0x9921('0x1c')]?_0x238770['options'][_0x9921('0x1d')]===undefined?!![]:![]:!![]})[_0x9921('0xe')](function(_0x574009){logger['info']('CreateCmHopperHistory',_0x238770);logger[_0x9921('0x11')](_0x9921('0x19'),_0x238770,JSON[_0x9921('0x13')](_0x574009));_0x122bda(_0x574009);})[_0x9921('0x18')](function(_0x4c6c88){logger[_0x9921('0x14')](_0x9921('0x19'),_0x4c6c88[_0x9921('0x16')],_0x238770);_0x1673da(_0x191117[_0x9921('0x14')](0x1f4,_0x4c6c88[_0x9921('0x16')]));});});};exports['AvgHandleTime']=function(_0x43845b){var _0x4f2ad7=this;return new Promise(function(_0x3f88f1,_0x6ceb43){return db[_0x9921('0x1a')]['findAll']({'raw':_0x43845b['options']?_0x43845b[_0x9921('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x43845b['options']?_0x43845b[_0x9921('0x1c')][_0x9921('0x1e')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db['sequelize'][_0x9921('0x1f')]('id')),'predictiveIntervalTotalCalls'],[db['sequelize']['fn'](_0x9921('0x20'),db[_0x9921('0x21')]['fn']('IF',db[_0x9921('0x21')]['literal'](_0x9921('0x22')))),'predictiveIntervalAnsweredCalls'],[db['sequelize']['fn'](_0x9921('0x20'),db[_0x9921('0x21')]['fn']('IF',db['sequelize'][_0x9921('0x23')](_0x9921('0x24')))),_0x9921('0x25')],[db[_0x9921('0x21')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x9921('0x21')][_0x9921('0x23')](_0x9921('0x26')))),_0x9921('0x27')],[db[_0x9921('0x21')]['fn'](_0x9921('0x28'),db[_0x9921('0x21')]['fn']('IF',db['sequelize'][_0x9921('0x23')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0x9921('0x29')],[db[_0x9921('0x21')]['fn'](_0x9921('0x28'),db['sequelize']['fn']('IF',db[_0x9921('0x21')][_0x9921('0x23')](_0x9921('0x2a')))),_0x9921('0x2b')]]})[_0x9921('0xe')](function(_0x39b09e){logger[_0x9921('0xf')](_0x9921('0x2c'),_0x43845b);logger['debug'](_0x9921('0x2c'),_0x43845b,JSON[_0x9921('0x13')](_0x39b09e));_0x3f88f1(_0x39b09e);})[_0x9921('0x18')](function(_0x8f2aca){logger[_0x9921('0x14')]('AvgHandleTime',_0x8f2aca['message'],_0x43845b);_0x6ceb43(_0x4f2ad7[_0x9921('0x14')](0x1f4,_0x8f2aca[_0x9921('0x16')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x477ebf){var _0x349cfc=this;return new Promise(function(_0x2d87c6,_0x45762a){return db['CmHopperHistory'][_0x9921('0x2d')]({'raw':_0x477ebf[_0x9921('0x1c')]?_0x477ebf[_0x9921('0x1c')][_0x9921('0x1d')]===undefined?!![]:![]:!![],'where':_0x477ebf[_0x9921('0x1c')]?_0x477ebf[_0x9921('0x1c')][_0x9921('0x1e')]||null:null,'attributes':[[_0x9921('0x2e'),_0x9921('0x2f')],[db[_0x9921('0x21')]['fn']('COUNT',db[_0x9921('0x21')]['fn']('IF',db['sequelize'][_0x9921('0x23')](_0x9921('0x30')))),_0x9921('0x31')],[db[_0x9921('0x21')]['fn']('COUNT',db[_0x9921('0x21')]['fn']('IF',db[_0x9921('0x21')]['literal']('`state`\x20=\x203,\x201,\x20null'))),_0x9921('0x32')],[db[_0x9921('0x21')]['fn'](_0x9921('0x20'),db[_0x9921('0x21')]['fn']('IF',db['sequelize'][_0x9921('0x23')](_0x9921('0x22')))),_0x9921('0x33')],[db[_0x9921('0x21')]['fn']('COUNT',db[_0x9921('0x21')]['fn']('IF',db[_0x9921('0x21')][_0x9921('0x23')](_0x9921('0x34')))),'outboundBusyCallsDay'],[db[_0x9921('0x21')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x9921('0x21')][_0x9921('0x23')](_0x9921('0x35')))),_0x9921('0x36')],[db['sequelize']['fn'](_0x9921('0x20'),db[_0x9921('0x21')]['fn']('IF',db[_0x9921('0x21')][_0x9921('0x23')](_0x9921('0x37')))),_0x9921('0x38')],[db[_0x9921('0x21')]['fn'](_0x9921('0x20'),db[_0x9921('0x21')]['fn']('IF',db[_0x9921('0x21')][_0x9921('0x23')](_0x9921('0x39')))),_0x9921('0x3a')],[db[_0x9921('0x21')]['fn'](_0x9921('0x20'),db['sequelize']['fn']('IF',db[_0x9921('0x21')][_0x9921('0x23')](_0x9921('0x3b')))),_0x9921('0x3c')],[db[_0x9921('0x21')]['fn'](_0x9921('0x20'),db[_0x9921('0x21')]['fn']('IF',db[_0x9921('0x21')]['literal'](_0x9921('0x3d')))),_0x9921('0x3e')],[db[_0x9921('0x21')]['fn'](_0x9921('0x20'),db[_0x9921('0x21')]['fn']('IF',db[_0x9921('0x21')][_0x9921('0x23')](_0x9921('0x3f')))),_0x9921('0x40')],[db['sequelize']['fn'](_0x9921('0x20'),db[_0x9921('0x21')]['fn']('IF',db['sequelize'][_0x9921('0x23')]('`state`\x20=\x2018,\x201,\x20null'))),_0x9921('0x41')],[db[_0x9921('0x21')]['fn']('COUNT',db[_0x9921('0x21')]['fn']('IF',db['sequelize']['literal'](_0x9921('0x42')))),_0x9921('0x43')],[db[_0x9921('0x21')]['fn'](_0x9921('0x20'),db[_0x9921('0x21')]['fn']('IF',db[_0x9921('0x21')][_0x9921('0x23')](_0x9921('0x44')))),_0x9921('0x41')],[db[_0x9921('0x21')]['fn'](_0x9921('0x20'),db[_0x9921('0x21')]['fn']('IF',db['sequelize']['literal'](_0x9921('0x45')))),'outboundReCallsDay']],'group':[_0x9921('0x2e')]})['then'](function(_0x24b8f4){logger[_0x9921('0xf')]('GetVoiceQueueHopperHistory',_0x477ebf);logger[_0x9921('0x11')]('GetVoiceQueueHopperHistory',_0x477ebf,JSON[_0x9921('0x13')](_0x24b8f4));_0x2d87c6(_0x24b8f4);})[_0x9921('0x18')](function(_0x5f66e){logger[_0x9921('0x14')](_0x9921('0x46'),_0x5f66e[_0x9921('0x16')],_0x477ebf);_0x45762a(_0x349cfc[_0x9921('0x14')](0x1f4,_0x5f66e[_0x9921('0x16')]));});});};exports[_0x9921('0x47')]=function(_0x3201fc){var _0x1f7327=this;return new Promise(function(_0x4fd740,_0x3178a6){return db[_0x9921('0x1a')]['findAll']({'raw':_0x3201fc[_0x9921('0x1c')]?_0x3201fc['options']['raw']===undefined?!![]:![]:!![],'where':_0x3201fc[_0x9921('0x1c')]?_0x3201fc[_0x9921('0x1c')][_0x9921('0x1e')]||null:null,'attributes':[[_0x9921('0x2e'),_0x9921('0x2f')],[db[_0x9921('0x21')]['fn'](_0x9921('0x20'),db['sequelize'][_0x9921('0x1f')]('id')),_0x9921('0x48')],[db[_0x9921('0x21')]['fn'](_0x9921('0x20'),db[_0x9921('0x21')]['fn']('IF',db[_0x9921('0x21')][_0x9921('0x23')](_0x9921('0x22')))),_0x9921('0x49')]],'group':[_0x9921('0x2e')]})[_0x9921('0xe')](function(_0x232d8c){logger['info']('GetCampaignHopperHistory',_0x3201fc);logger[_0x9921('0x11')]('GetCampaignHopperHistory',_0x3201fc,JSON[_0x9921('0x13')](_0x232d8c));_0x4fd740(_0x232d8c);})['catch'](function(_0x9b06d1){logger[_0x9921('0x14')](_0x9921('0x47'),_0x9b06d1['message'],_0x3201fc);_0x3178a6(_0x1f7327[_0x9921('0x14')](0x1f4,_0x9b06d1[_0x9921('0x16')]));});});};
\ No newline at end of file
+var _0x5c9f=['outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','AvgHandleTime','findAll','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','literal','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','then','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5c9f,0x173));var _0xf5c9=function(_0x211a02,_0x3b5362){_0x211a02=_0x211a02-0x0;var _0x13d91c=_0x5c9f[_0x211a02];return _0x13d91c;};'use strict';var _=require('lodash');var util=require(_0xf5c9('0x0'));var moment=require(_0xf5c9('0x1'));var BPromise=require('bluebird');var rs=require(_0xf5c9('0x2'));var fs=require('fs');var Redis=require(_0xf5c9('0x3'));var db=require(_0xf5c9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf5c9('0x5'))(_0xf5c9('0x6'));var config=require('../../config/environment');var jayson=require(_0xf5c9('0x7'));var client=jayson['client'][_0xf5c9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4f4285,_0x4de023,_0x2b5be8){return new BPromise(function(_0x9ba836,_0x1ebaab){return client[_0xf5c9('0x9')](_0x4f4285,_0x2b5be8)['then'](function(_0x4f2c1d){logger['info'](_0xf5c9('0xa'),_0x4de023,_0xf5c9('0xb'));logger[_0xf5c9('0xc')](_0xf5c9('0xd'),_0x4de023,_0xf5c9('0xb'),JSON[_0xf5c9('0xe')](_0x4f2c1d));if(_0x4f2c1d[_0xf5c9('0xf')]){if(_0x4f2c1d[_0xf5c9('0xf')][_0xf5c9('0x10')]===0x1f4){logger[_0xf5c9('0xf')]('CmHopperHistory,\x20%s,\x20%s',_0x4de023,_0x4f2c1d['error'][_0xf5c9('0x11')]);return _0x1ebaab(_0x4f2c1d[_0xf5c9('0xf')]['message']);}logger[_0xf5c9('0xf')](_0xf5c9('0xa'),_0x4de023,_0x4f2c1d['error'][_0xf5c9('0x11')]);return _0x9ba836(_0x4f2c1d[_0xf5c9('0xf')][_0xf5c9('0x11')]);}else{logger[_0xf5c9('0x12')](_0xf5c9('0xa'),_0x4de023,'request\x20sent');_0x9ba836(_0x4f2c1d['result'][_0xf5c9('0x11')]);}})[_0xf5c9('0x13')](function(_0xb2b7c5){logger['error'](_0xf5c9('0xa'),_0x4de023,_0xb2b7c5);_0x1ebaab(_0xb2b7c5);});});}exports[_0xf5c9('0x14')]=function(_0xfecc65){var _0x58967f=this;return new Promise(function(_0x9229ff,_0x54a54b){return db[_0xf5c9('0x15')][_0xf5c9('0x16')](_0xfecc65[_0xf5c9('0x17')],{'raw':_0xfecc65[_0xf5c9('0x18')]?_0xfecc65[_0xf5c9('0x18')][_0xf5c9('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x2b347a){logger['info'](_0xf5c9('0x14'),_0xfecc65);logger[_0xf5c9('0xc')](_0xf5c9('0x14'),_0xfecc65,JSON[_0xf5c9('0xe')](_0x2b347a));_0x9229ff(_0x2b347a);})[_0xf5c9('0x13')](function(_0x576f36){logger['error'](_0xf5c9('0x14'),_0x576f36[_0xf5c9('0x11')],_0xfecc65);_0x54a54b(_0x58967f['error'](0x1f4,_0x576f36[_0xf5c9('0x11')]));});});};exports[_0xf5c9('0x1a')]=function(_0x2a8994){var _0x5b27cf=this;return new Promise(function(_0x2959cf,_0x37ffc2){return db[_0xf5c9('0x15')][_0xf5c9('0x1b')]({'raw':_0x2a8994[_0xf5c9('0x18')]?_0x2a8994['options']['raw']===undefined?!![]:![]:!![],'where':_0x2a8994[_0xf5c9('0x18')]?_0x2a8994[_0xf5c9('0x18')][_0xf5c9('0x1c')]||null:null,'attributes':[[db[_0xf5c9('0x1d')]['fn']('COUNT',db[_0xf5c9('0x1d')][_0xf5c9('0x1e')]('id')),_0xf5c9('0x1f')],[db[_0xf5c9('0x1d')]['fn'](_0xf5c9('0x20'),db[_0xf5c9('0x1d')]['fn']('IF',db['sequelize'][_0xf5c9('0x21')]('`state`\x20=\x204,\x201,\x20null'))),_0xf5c9('0x22')],[db[_0xf5c9('0x1d')]['fn'](_0xf5c9('0x20'),db[_0xf5c9('0x1d')]['fn']('IF',db[_0xf5c9('0x1d')][_0xf5c9('0x21')](_0xf5c9('0x23')))),_0xf5c9('0x24')],[db[_0xf5c9('0x1d')]['fn'](_0xf5c9('0x20'),db[_0xf5c9('0x1d')]['fn']('IF',db[_0xf5c9('0x1d')][_0xf5c9('0x21')](_0xf5c9('0x25')))),_0xf5c9('0x26')],[db[_0xf5c9('0x1d')]['fn'](_0xf5c9('0x27'),db[_0xf5c9('0x1d')]['fn']('IF',db['sequelize'][_0xf5c9('0x21')](_0xf5c9('0x28')))),_0xf5c9('0x29')],[db[_0xf5c9('0x1d')]['fn'](_0xf5c9('0x27'),db[_0xf5c9('0x1d')]['fn']('IF',db[_0xf5c9('0x1d')][_0xf5c9('0x21')](_0xf5c9('0x2a')))),_0xf5c9('0x2b')]]})[_0xf5c9('0x2c')](function(_0x5a14ae){logger['info'](_0xf5c9('0x1a'),_0x2a8994);logger[_0xf5c9('0xc')]('AvgHandleTime',_0x2a8994,JSON[_0xf5c9('0xe')](_0x5a14ae));_0x2959cf(_0x5a14ae);})[_0xf5c9('0x13')](function(_0x3a4d13){logger['error'](_0xf5c9('0x1a'),_0x3a4d13[_0xf5c9('0x11')],_0x2a8994);_0x37ffc2(_0x5b27cf[_0xf5c9('0xf')](0x1f4,_0x3a4d13[_0xf5c9('0x11')]));});});};exports[_0xf5c9('0x2d')]=function(_0x5a369e){var _0x2d16da=this;return new Promise(function(_0x528ab7,_0x27e7f8){return db[_0xf5c9('0x15')][_0xf5c9('0x1b')]({'raw':_0x5a369e['options']?_0x5a369e['options']['raw']===undefined?!![]:![]:!![],'where':_0x5a369e['options']?_0x5a369e[_0xf5c9('0x18')][_0xf5c9('0x1c')]||null:null,'attributes':[[_0xf5c9('0x2e'),_0xf5c9('0x2f')],[db[_0xf5c9('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xf5c9('0x1d')]['literal'](_0xf5c9('0x30')))),_0xf5c9('0x31')],[db[_0xf5c9('0x1d')]['fn'](_0xf5c9('0x20'),db['sequelize']['fn']('IF',db[_0xf5c9('0x1d')][_0xf5c9('0x21')]('`state`\x20=\x203,\x201,\x20null'))),'outboundNoAnswerCallsDay'],[db[_0xf5c9('0x1d')]['fn'](_0xf5c9('0x20'),db['sequelize']['fn']('IF',db[_0xf5c9('0x1d')]['literal'](_0xf5c9('0x32')))),_0xf5c9('0x33')],[db[_0xf5c9('0x1d')]['fn'](_0xf5c9('0x20'),db[_0xf5c9('0x1d')]['fn']('IF',db[_0xf5c9('0x1d')]['literal'](_0xf5c9('0x34')))),_0xf5c9('0x35')],[db[_0xf5c9('0x1d')]['fn'](_0xf5c9('0x20'),db[_0xf5c9('0x1d')]['fn']('IF',db[_0xf5c9('0x1d')]['literal'](_0xf5c9('0x36')))),_0xf5c9('0x37')],[db[_0xf5c9('0x1d')]['fn'](_0xf5c9('0x20'),db[_0xf5c9('0x1d')]['fn']('IF',db['sequelize'][_0xf5c9('0x21')](_0xf5c9('0x38')))),_0xf5c9('0x39')],[db[_0xf5c9('0x1d')]['fn']('COUNT',db[_0xf5c9('0x1d')]['fn']('IF',db[_0xf5c9('0x1d')][_0xf5c9('0x21')](_0xf5c9('0x3a')))),_0xf5c9('0x3b')],[db[_0xf5c9('0x1d')]['fn']('COUNT',db[_0xf5c9('0x1d')]['fn']('IF',db['sequelize']['literal'](_0xf5c9('0x3c')))),_0xf5c9('0x3d')],[db[_0xf5c9('0x1d')]['fn'](_0xf5c9('0x20'),db[_0xf5c9('0x1d')]['fn']('IF',db['sequelize'][_0xf5c9('0x21')](_0xf5c9('0x3e')))),'outboundBlacklistCallsDay'],[db['sequelize']['fn'](_0xf5c9('0x20'),db['sequelize']['fn']('IF',db[_0xf5c9('0x1d')][_0xf5c9('0x21')](_0xf5c9('0x3f')))),'outboundOriginateFailureCallsDay'],[db[_0xf5c9('0x1d')]['fn']('COUNT',db[_0xf5c9('0x1d')]['fn']('IF',db['sequelize'][_0xf5c9('0x21')](_0xf5c9('0x40')))),_0xf5c9('0x41')],[db[_0xf5c9('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xf5c9('0x1d')]['literal'](_0xf5c9('0x42')))),'outboundAnswerAgiCallsDay'],[db[_0xf5c9('0x1d')]['fn'](_0xf5c9('0x20'),db[_0xf5c9('0x1d')]['fn']('IF',db[_0xf5c9('0x1d')][_0xf5c9('0x21')]('`state`\x20=\x2020,\x201,\x20null'))),_0xf5c9('0x41')],[db[_0xf5c9('0x1d')]['fn'](_0xf5c9('0x20'),db['sequelize']['fn']('IF',db['sequelize'][_0xf5c9('0x21')](_0xf5c9('0x43')))),_0xf5c9('0x44')]],'group':[_0xf5c9('0x2e')]})['then'](function(_0x943254){logger[_0xf5c9('0x12')](_0xf5c9('0x2d'),_0x5a369e);logger[_0xf5c9('0xc')](_0xf5c9('0x2d'),_0x5a369e,JSON[_0xf5c9('0xe')](_0x943254));_0x528ab7(_0x943254);})[_0xf5c9('0x13')](function(_0xc03c2a){logger['error']('GetVoiceQueueHopperHistory',_0xc03c2a['message'],_0x5a369e);_0x27e7f8(_0x2d16da['error'](0x1f4,_0xc03c2a[_0xf5c9('0x11')]));});});};exports[_0xf5c9('0x45')]=function(_0x20b2ed){var _0x470904=this;return new Promise(function(_0x2d2e68,_0x809397){return db[_0xf5c9('0x15')][_0xf5c9('0x1b')]({'raw':_0x20b2ed[_0xf5c9('0x18')]?_0x20b2ed[_0xf5c9('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x20b2ed[_0xf5c9('0x18')]?_0x20b2ed['options']['where']||null:null,'attributes':[['campaign',_0xf5c9('0x2f')],[db[_0xf5c9('0x1d')]['fn']('COUNT',db[_0xf5c9('0x1d')][_0xf5c9('0x1e')]('id')),_0xf5c9('0x46')],[db[_0xf5c9('0x1d')]['fn'](_0xf5c9('0x20'),db['sequelize']['fn']('IF',db[_0xf5c9('0x1d')]['literal'](_0xf5c9('0x32')))),'ivrAnswerCallsDay']],'group':[_0xf5c9('0x2e')]})[_0xf5c9('0x2c')](function(_0x16a7e7){logger[_0xf5c9('0x12')](_0xf5c9('0x45'),_0x20b2ed);logger[_0xf5c9('0xc')](_0xf5c9('0x45'),_0x20b2ed,JSON['stringify'](_0x16a7e7));_0x2d2e68(_0x16a7e7);})[_0xf5c9('0x13')](function(_0x6d39dd){logger[_0xf5c9('0xf')](_0xf5c9('0x45'),_0x6d39dd[_0xf5c9('0x11')],_0x20b2ed);_0x809397(_0x470904[_0xf5c9('0xf')](0x1f4,_0x6d39dd[_0xf5c9('0x11')]));});});};
\ No newline at end of file
index 5848d19..2708c18 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c89=['describe','/:id','post','create','put','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./cmHopperHistory.controller','get','index','isAuthenticated'];(function(_0x284d42,_0x308275){var _0x23c5da=function(_0x57bf55){while(--_0x57bf55){_0x284d42['push'](_0x284d42['shift']());}};_0x23c5da(++_0x308275);}(_0x1c89,0x115));var _0x91c8=function(_0x575a16,_0x18eefa){_0x575a16=_0x575a16-0x0;var _0x298d59=_0x1c89[_0x575a16];return _0x298d59;};'use strict';var multer=require('multer');var util=require(_0x91c8('0x0'));var path=require(_0x91c8('0x1'));var timeout=require(_0x91c8('0x2'));var express=require(_0x91c8('0x3'));var router=express[_0x91c8('0x4')]();var fs_extra=require(_0x91c8('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x91c8('0x6'));var controller=require(_0x91c8('0x7'));router[_0x91c8('0x8')]('/',auth['isAuthenticated'](),controller[_0x91c8('0x9')]);router[_0x91c8('0x8')]('/describe',auth[_0x91c8('0xa')](),controller[_0x91c8('0xb')]);router[_0x91c8('0x8')](_0x91c8('0xc'),auth[_0x91c8('0xa')](),controller['show']);router[_0x91c8('0xd')]('/',auth[_0x91c8('0xa')](),controller[_0x91c8('0xe')]);router[_0x91c8('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x91c8('0x10')]);module[_0x91c8('0x11')]=router;
\ No newline at end of file
+var _0x2fad=['./cmHopperHistory.controller','get','isAuthenticated','/describe','describe','create','put','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2be048,_0x331a44){var _0x37854b=function(_0x12577c){while(--_0x12577c){_0x2be048['push'](_0x2be048['shift']());}};_0x37854b(++_0x331a44);}(_0x2fad,0xda));var _0xd2fa=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x2fad[_0x279d37];return _0x530173;};'use strict';var multer=require(_0xd2fa('0x0'));var util=require(_0xd2fa('0x1'));var path=require(_0xd2fa('0x2'));var timeout=require(_0xd2fa('0x3'));var express=require(_0xd2fa('0x4'));var router=express[_0xd2fa('0x5')]();var fs_extra=require(_0xd2fa('0x6'));var auth=require(_0xd2fa('0x7'));var interaction=require(_0xd2fa('0x8'));var config=require(_0xd2fa('0x9'));var controller=require(_0xd2fa('0xa'));router[_0xd2fa('0xb')]('/',auth[_0xd2fa('0xc')](),controller['index']);router[_0xd2fa('0xb')](_0xd2fa('0xd'),auth['isAuthenticated'](),controller[_0xd2fa('0xe')]);router[_0xd2fa('0xb')]('/:id',auth[_0xd2fa('0xc')](),controller['show']);router['post']('/',auth[_0xd2fa('0xc')](),controller[_0xd2fa('0xf')]);router[_0xd2fa('0x10')](_0xd2fa('0x11'),auth[_0xd2fa('0xc')](),controller['update']);module[_0xd2fa('0x12')]=router;
\ No newline at end of file
index 3e649ed..0f5b435 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab29=['name','sequelize','exports','STRING'];(function(_0x53bd41,_0x4fdb27){var _0x2bdd37=function(_0x385a77){while(--_0x385a77){_0x53bd41['push'](_0x53bd41['shift']());}};_0x2bdd37(++_0x4fdb27);}(_0xab29,0x145));var _0x9ab2=function(_0x1e5621,_0x5bfcf2){_0x1e5621=_0x1e5621-0x0;var _0x6b9168=_0xab29[_0x1e5621];return _0x6b9168;};'use strict';var Sequelize=require(_0x9ab2('0x0'));module[_0x9ab2('0x1')]={'name':{'type':Sequelize[_0x9ab2('0x2')],'unique':_0x9ab2('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0x9ab2('0x2')]}};
\ No newline at end of file
+var _0xff3c=['STRING','sequelize','exports','name'];(function(_0x1a72de,_0x427b56){var _0x34f762=function(_0x1bbf21){while(--_0x1bbf21){_0x1a72de['push'](_0x1a72de['shift']());}};_0x34f762(++_0x427b56);}(_0xff3c,0x179));var _0xcff3=function(_0x5d87a6,_0x1d1c62){_0x5d87a6=_0x5d87a6-0x0;var _0x3bcb55=_0xff3c[_0x5d87a6];return _0x3bcb55;};'use strict';var Sequelize=require(_0xcff3('0x0'));module[_0xcff3('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xcff3('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xcff3('0x3')]},'dialPrefix':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 424a123..0af156f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa25e=['Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','sequelize','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','emit','removeAgents','userCmList:remove','User','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./cmList.socket','sendStatus','end','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','Lists','destroy','status','error','name','send','index','map','CmList','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addDisposition','getDispositions','nolimit','ListId','filter','Disposition','removeDispositions','ids','addContacts','CmContact','describe','tags','isArray','join','each','omit','success','errors','push','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','isEmpty','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','addCustomField','findOne','transaction','addCustomFields'];(function(_0x5b077b,_0x50b707){var _0x16faf7=function(_0x41ba83){while(--_0x41ba83){_0x5b077b['push'](_0x5b077b['shift']());}};_0x16faf7(++_0x50b707);}(_0xa25e,0x1d0));var _0xea25=function(_0x3303d3,_0xe6a9a8){_0x3303d3=_0x3303d3-0x0;var _0xcec931=_0xa25e[_0x3303d3];return _0xcec931;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xea25('0x0'));var zipdir=require(_0xea25('0x1'));var jsonpatch=require(_0xea25('0x2'));var rp=require(_0xea25('0x3'));var moment=require(_0xea25('0x4'));var BPromise=require(_0xea25('0x5'));var Mustache=require(_0xea25('0x6'));var util=require(_0xea25('0x7'));var path=require(_0xea25('0x8'));var sox=require(_0xea25('0x9'));var csv=require(_0xea25('0xa'));var ejs=require(_0xea25('0xb'));var fs=require('fs');var fs_extra=require(_0xea25('0xc'));var _=require('lodash');var squel=require(_0xea25('0xd'));var crypto=require(_0xea25('0xe'));var jsforce=require(_0xea25('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xea25('0xa'));var querystring=require(_0xea25('0x10'));var Papa=require(_0xea25('0x11'));var Redis=require(_0xea25('0x12'));var authService=require(_0xea25('0x13'));var qs=require(_0xea25('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xea25('0x15'));var logger=require('../../config/logger')(_0xea25('0x16'));var utils=require(_0xea25('0x17'));var config=require(_0xea25('0x18'));var licenseUtil=require(_0xea25('0x19'));var db=require('../../mysqldb')['db'];config[_0xea25('0x1a')]=_[_0xea25('0x1b')](config[_0xea25('0x1a')],{'host':_0xea25('0x1c'),'port':0x18eb});var socket=require(_0xea25('0x1d'))(new Redis(config[_0xea25('0x1a')]));require(_0xea25('0x1e'))['register'](socket);function respondWithStatusCode(_0x501a0a,_0x3c2cbc){_0x3c2cbc=_0x3c2cbc||0xcc;return function(_0x4414a9){if(_0x4414a9){return _0x501a0a[_0xea25('0x1f')](_0x3c2cbc);}return _0x501a0a['status'](_0x3c2cbc)[_0xea25('0x20')]();};}function respondWithResult(_0x16f1e8,_0x2932ec){_0x2932ec=_0x2932ec||0xc8;return function(_0x5f4761){if(_0x5f4761){return _0x16f1e8['status'](_0x2932ec)['json'](_0x5f4761);}};}function respondWithFilteredResult(_0x2f1d5d,_0x4f0f34){return function(_0x389b7c){if(_0x389b7c){var _0x385750=typeof _0x4f0f34[_0xea25('0x21')]===_0xea25('0x22')&&typeof _0x4f0f34[_0xea25('0x23')]===_0xea25('0x22');var _0x41965b=_0x389b7c[_0xea25('0x24')];var _0x13b715=_0x385750?0x0:_0x4f0f34['offset'];var _0x3c5b8f=_0x385750?_0x389b7c[_0xea25('0x24')]:_0x4f0f34[_0xea25('0x21')]+_0x4f0f34[_0xea25('0x23')];var _0x44de24;if(_0x3c5b8f>=_0x41965b){_0x3c5b8f=_0x41965b;_0x44de24=0xc8;}else{_0x44de24=0xce;}_0x2f1d5d['status'](_0x44de24);return _0x2f1d5d['set'](_0xea25('0x25'),_0x13b715+'-'+_0x3c5b8f+'/'+_0x41965b)[_0xea25('0x26')](_0x389b7c);}return null;};}function patchUpdates(_0x45643a){return function(_0x3d927c){try{jsonpatch['apply'](_0x3d927c,_0x45643a,!![]);}catch(_0x2810b4){return BPromise[_0xea25('0x27')](_0x2810b4);}return _0x3d927c[_0xea25('0x28')]();};}function saveUpdates(_0x1f1101,_0x19ac6c){return function(_0xc1d3da){if(_0xc1d3da){return _0xc1d3da[_0xea25('0x29')](_0x1f1101)[_0xea25('0x2a')](function(_0x29289c){return _0x29289c;});}return null;};}function removeEntity(_0x1906fc,_0x3b9a45){return function(_0x518c7c){if(_0x518c7c){return _0x518c7c['destroy']()[_0xea25('0x2a')](function(){var _0x3ef17e=_0x518c7c['get']({'plain':!![]});var _0x2b39a2=_0xea25('0x2b');return db['UserProfileResource'][_0xea25('0x2c')]({'where':{'type':_0x2b39a2,'resourceId':_0x3ef17e['id']}})[_0xea25('0x2a')](function(){return _0x518c7c;});})[_0xea25('0x2a')](function(){_0x1906fc[_0xea25('0x2d')](0xcc)[_0xea25('0x20')]();});}};}function handleEntityNotFound(_0x5a84d0,_0x43c308){return function(_0x22ac78){if(!_0x22ac78){_0x5a84d0[_0xea25('0x1f')](0x194);}return _0x22ac78;};}function handleError(_0x2b9b29,_0x338a3c){_0x338a3c=_0x338a3c||0x1f4;return function(_0x303bd3){logger[_0xea25('0x2e')](_0x303bd3['stack']);if(_0x303bd3[_0xea25('0x2f')]){delete _0x303bd3[_0xea25('0x2f')];}_0x2b9b29[_0xea25('0x2d')](_0x338a3c)[_0xea25('0x30')](_0x303bd3);};}exports[_0xea25('0x31')]=function(_0x723ca7,_0x4f9125){var _0xccc8cb={},_0x4cf4cc={},_0x134dc6={'count':0x0,'rows':[]};var _0xda8756=_[_0xea25('0x32')](db[_0xea25('0x33')]['rawAttributes'],function(_0x4ba77f){return{'name':_0x4ba77f['fieldName'],'type':_0x4ba77f['type'][_0xea25('0x34')]};});_0x4cf4cc['model']=_[_0xea25('0x32')](_0xda8756,_0xea25('0x2f'));_0x4cf4cc[_0xea25('0x35')]=_[_0xea25('0x36')](_0x723ca7[_0xea25('0x35')]);_0x4cf4cc['filters']=_[_0xea25('0x37')](_0x4cf4cc[_0xea25('0x38')],_0x4cf4cc[_0xea25('0x35')]);_0xccc8cb[_0xea25('0x39')]=_[_0xea25('0x37')](_0x4cf4cc[_0xea25('0x38')],qs['fields'](_0x723ca7['query'][_0xea25('0x3a')]));_0xccc8cb['attributes']=_0xccc8cb[_0xea25('0x39')]['length']?_0xccc8cb[_0xea25('0x39')]:_0x4cf4cc[_0xea25('0x38')];if(!_0x723ca7[_0xea25('0x35')][_0xea25('0x3b')]('nolimit')){_0xccc8cb['limit']=qs[_0xea25('0x23')](_0x723ca7[_0xea25('0x35')][_0xea25('0x23')]);_0xccc8cb['offset']=qs[_0xea25('0x21')](_0x723ca7[_0xea25('0x35')][_0xea25('0x21')]);}_0xccc8cb[_0xea25('0x3c')]=qs[_0xea25('0x3d')](_0x723ca7['query'][_0xea25('0x3d')]);_0xccc8cb[_0xea25('0x3e')]=qs[_0xea25('0x3f')](_[_0xea25('0x40')](_0x723ca7['query'],_0x4cf4cc[_0xea25('0x3f')]),_0xda8756);if(_0x723ca7['query']['filter']){_0xccc8cb['where']=_[_0xea25('0x41')](_0xccc8cb[_0xea25('0x3e')],{'$or':_[_0xea25('0x32')](_0xda8756,function(_0x9df1e3){if(_0x9df1e3[_0xea25('0x42')]!==_0xea25('0x43')){var _0x345085={};_0x345085[_0x9df1e3[_0xea25('0x2f')]]={'$like':'%'+_0x723ca7['query']['filter']+'%'};return _0x345085;}})});}_0xccc8cb=_[_0xea25('0x41')]({},_0xccc8cb,_0x723ca7[_0xea25('0x44')]);var _0x4bbb42={'where':_0xccc8cb[_0xea25('0x3e')]};return db['CmList']['count'](_0x4bbb42)[_0xea25('0x2a')](function(_0x1a0c35){_0x134dc6['count']=_0x1a0c35;if(_0x723ca7[_0xea25('0x35')][_0xea25('0x45')]){_0xccc8cb['include']=[{'all':!![]}];}return db[_0xea25('0x33')][_0xea25('0x46')](_0xccc8cb);})[_0xea25('0x2a')](function(_0x14abc9){_0x134dc6[_0xea25('0x47')]=_0x14abc9;return _0x134dc6;})[_0xea25('0x2a')](respondWithFilteredResult(_0x4f9125,_0xccc8cb))[_0xea25('0x48')](handleError(_0x4f9125,null));};exports[_0xea25('0x49')]=function(_0x5f4e5d,_0x178a21){var _0x3891df={'raw':![],'where':{'id':_0x5f4e5d[_0xea25('0x4a')]['id']}},_0x18f085={};_0x18f085[_0xea25('0x38')]=_[_0xea25('0x36')](db[_0xea25('0x33')][_0xea25('0x4b')]);_0x18f085[_0xea25('0x35')]=_[_0xea25('0x36')](_0x5f4e5d[_0xea25('0x35')]);_0x18f085[_0xea25('0x3f')]=_[_0xea25('0x37')](_0x18f085[_0xea25('0x38')],_0x18f085[_0xea25('0x35')]);_0x3891df[_0xea25('0x39')]=_[_0xea25('0x37')](_0x18f085[_0xea25('0x38')],qs['fields'](_0x5f4e5d[_0xea25('0x35')][_0xea25('0x3a')]));_0x3891df['attributes']=_0x3891df[_0xea25('0x39')][_0xea25('0x4c')]?_0x3891df[_0xea25('0x39')]:_0x18f085[_0xea25('0x38')];if(_0x5f4e5d[_0xea25('0x35')][_0xea25('0x45')]){_0x3891df[_0xea25('0x4d')]=[{'all':!![]}];}_0x3891df=_[_0xea25('0x41')]({},_0x3891df,_0x5f4e5d[_0xea25('0x44')]);return db[_0xea25('0x33')][_0xea25('0x4e')](_0x3891df)[_0xea25('0x2a')](handleEntityNotFound(_0x178a21,null))[_0xea25('0x2a')](respondWithResult(_0x178a21,null))['catch'](handleError(_0x178a21,null));};exports[_0xea25('0x4f')]=function(_0xc3c1a4,_0x5426aa){return db[_0xea25('0x33')]['create'](_0xc3c1a4['body'],{})[_0xea25('0x2a')](function(_0xc79d3a){var _0x10400e=_0xc3c1a4[_0xea25('0x50')]['get']({'plain':!![]});if(!_0x10400e)throw new Error(_0xea25('0x51'));if(_0x10400e[_0xea25('0x52')]===_0xea25('0x50')){var _0x5aab8e=_0xc79d3a[_0xea25('0x53')]({'plain':!![]});var _0x2dd421=_0xea25('0x2b');return db[_0xea25('0x54')][_0xea25('0x4e')]({'where':{'name':_0x2dd421,'userProfileId':_0x10400e[_0xea25('0x55')]},'raw':!![]})[_0xea25('0x2a')](function(_0x92dd71){if(_0x92dd71&&_0x92dd71['autoAssociation']===0x0){return db[_0xea25('0x56')][_0xea25('0x4f')]({'name':_0x5aab8e[_0xea25('0x2f')],'resourceId':_0x5aab8e['id'],'type':_0x92dd71[_0xea25('0x2f')],'sectionId':_0x92dd71['id']},{})[_0xea25('0x2a')](function(){return _0xc79d3a;});}else{return _0xc79d3a;}})[_0xea25('0x48')](function(_0xa205f5){logger['error'](_0xea25('0x57'),_0xa205f5);throw _0xa205f5;});}return _0xc79d3a;})[_0xea25('0x2a')](respondWithResult(_0x5426aa,0xc9))['catch'](handleError(_0x5426aa,null));};exports['update']=function(_0x58c08c,_0x315faa){if(_0x58c08c['body']['id']){delete _0x58c08c[_0xea25('0x58')]['id'];}return db[_0xea25('0x33')][_0xea25('0x4e')]({'where':{'id':_0x58c08c[_0xea25('0x4a')]['id']}})['then'](handleEntityNotFound(_0x315faa,null))[_0xea25('0x2a')](saveUpdates(_0x58c08c[_0xea25('0x58')],null))[_0xea25('0x2a')](respondWithResult(_0x315faa,null))['catch'](handleError(_0x315faa,null));};exports[_0xea25('0x2c')]=function(_0x37cc37,_0x4e4020){return db[_0xea25('0x33')][_0xea25('0x4e')]({'where':{'id':_0x37cc37[_0xea25('0x4a')]['id']}})[_0xea25('0x2a')](handleEntityNotFound(_0x4e4020,null))['then'](removeEntity(_0x4e4020,null))[_0xea25('0x48')](handleError(_0x4e4020,null));};exports['describe']=function(_0x13c54b,_0x35b02e){return db[_0xea25('0x33')]['describe']()['then'](respondWithResult(_0x35b02e,null))[_0xea25('0x48')](handleError(_0x35b02e,null));};exports[_0xea25('0x59')]=function(_0xdf6b06,_0x237a84,_0x1924f3){if(_0xdf6b06['body']['id']){delete _0xdf6b06[_0xea25('0x58')]['id'];}return db[_0xea25('0x33')][_0xea25('0x4e')]({'where':{'id':_0xdf6b06[_0xea25('0x4a')]['id']}})[_0xea25('0x2a')](handleEntityNotFound(_0x237a84,null))[_0xea25('0x2a')](function(_0x37314f){if(_0x37314f){_0xdf6b06[_0xea25('0x58')]['ListId']=_0x37314f['id'];return db['Disposition'][_0xea25('0x4f')](_0xdf6b06[_0xea25('0x58')]);}})['then'](respondWithResult(_0x237a84,null))[_0xea25('0x48')](handleError(_0x237a84,null));};exports[_0xea25('0x5a')]=function(_0x165d13,_0x5944a4,_0x53a5f5){var _0x172050={'raw':![],'where':{}};var _0x39633b={};var _0x1f2361={'count':0x0,'rows':[]};return db[_0xea25('0x33')]['findOne']({'where':{'id':_0x165d13['params']['id']}})[_0xea25('0x2a')](handleEntityNotFound(_0x5944a4,null))[_0xea25('0x2a')](function(_0x31ca64){if(_0x31ca64){_0x39633b[_0xea25('0x38')]=_[_0xea25('0x36')](db['Disposition']['rawAttributes']);_0x39633b[_0xea25('0x35')]=_[_0xea25('0x36')](_0x165d13['query']);_0x39633b[_0xea25('0x3f')]=_[_0xea25('0x37')](_0x39633b[_0xea25('0x38')],_0x39633b[_0xea25('0x35')]);_0x172050['attributes']=_[_0xea25('0x37')](_0x39633b[_0xea25('0x38')],qs[_0xea25('0x3a')](_0x165d13['query']['fields']));_0x172050['attributes']=_0x172050['attributes']['length']?_0x172050['attributes']:_0x39633b[_0xea25('0x38')];if(!_0x165d13[_0xea25('0x35')]['hasOwnProperty'](_0xea25('0x5b'))){_0x172050[_0xea25('0x23')]=qs[_0xea25('0x23')](_0x165d13[_0xea25('0x35')][_0xea25('0x23')]);_0x172050[_0xea25('0x21')]=qs['offset'](_0x165d13[_0xea25('0x35')][_0xea25('0x21')]);}_0x172050[_0xea25('0x3c')]=qs[_0xea25('0x3d')](_0x165d13[_0xea25('0x35')]['sort']);_0x172050['where']=qs['filters'](_[_0xea25('0x40')](_0x165d13[_0xea25('0x35')],_0x39633b[_0xea25('0x3f')]));_0x172050[_0xea25('0x3e')][_0xea25('0x5c')]=_0x31ca64['id'];if(_0x165d13[_0xea25('0x35')]['filter']){_0x172050[_0xea25('0x3e')]=_['merge'](_0x172050[_0xea25('0x3e')],{'$or':_[_0xea25('0x32')](_0x172050['attributes'],function(_0x91ea1f){var _0x2e7d68={};_0x2e7d68[_0x91ea1f]={'$like':'%'+_0x165d13['query'][_0xea25('0x5d')]+'%'};return _0x2e7d68;})});}_0x172050=_[_0xea25('0x41')]({},_0x172050,_0x165d13[_0xea25('0x44')]);return db[_0xea25('0x5e')][_0xea25('0x24')]({'where':_0x172050[_0xea25('0x3e')]})[_0xea25('0x2a')](function(_0x30eac6){_0x1f2361[_0xea25('0x24')]=_0x30eac6;if(_0x165d13[_0xea25('0x35')][_0xea25('0x45')]){_0x172050['include']=[{'all':!![]}];}return db[_0xea25('0x5e')][_0xea25('0x46')](_0x172050);})[_0xea25('0x2a')](function(_0x123678){_0x1f2361[_0xea25('0x47')]=_0x123678;return _0x1f2361;});}})[_0xea25('0x2a')](respondWithFilteredResult(_0x5944a4,_0x172050))['catch'](handleError(_0x5944a4,null));};exports[_0xea25('0x5f')]=function(_0x4e8139,_0x390fcd,_0x1b8706){return db[_0xea25('0x33')][_0xea25('0x4e')]({'where':{'id':_0x4e8139[_0xea25('0x4a')]['id']}})[_0xea25('0x2a')](handleEntityNotFound(_0x390fcd,null))['then'](function(_0x33bd23){if(_0x33bd23){return _0x33bd23['removeDispositions'](_0x4e8139[_0xea25('0x35')][_0xea25('0x60')]);}})['then'](respondWithStatusCode(_0x390fcd,null))[_0xea25('0x48')](handleError(_0x390fcd,null));};exports[_0xea25('0x61')]=function(_0x2910e1,_0x2b9351,_0x321107){return db[_0xea25('0x33')][_0xea25('0x4e')]({'where':{'id':_0x2910e1['params']['id']}})['then'](handleEntityNotFound(_0x2b9351,null))[_0xea25('0x2a')](function(_0x3aedb1){if(_0x3aedb1){var _0x20526c=[];var _0x5a6913={'success':[],'errors':[]};return db[_0xea25('0x62')][_0xea25('0x63')]()[_0xea25('0x2a')](function(_0x4cb84e){if(_0x2910e1[_0xea25('0x58')][_0xea25('0x64')]&&_[_0xea25('0x65')](_0x2910e1[_0xea25('0x58')][_0xea25('0x64')])){if(_0x2910e1[_0xea25('0x58')][_0xea25('0x64')]['length']){_0x2910e1['body'][_0xea25('0x64')]=_0x2910e1['body']['tags'][_0xea25('0x66')](';')+';';}else{_0x2910e1[_0xea25('0x58')]['tags']=null;}}else{_0x2910e1[_0xea25('0x58')]['tags']=null;}if(_0x2910e1[_0xea25('0x58')]&&_['isArray'](_0x2910e1[_0xea25('0x58')])){for(var _0x2e69f8=0x0;_0x2e69f8<_0x2910e1[_0xea25('0x58')][_0xea25('0x4c')];_0x2e69f8+=0x1){_0x2910e1[_0xea25('0x58')][_0x2e69f8][_0xea25('0x5c')]=_0x2910e1['params']['id'];_0x20526c['push'](_0x2910e1['body'][_0x2e69f8]);}return BPromise[_0xea25('0x67')](_0x20526c,function(_0x454f7f){return db[_0xea25('0x62')][_0xea25('0x4f')](_[_0xea25('0x68')](_0x454f7f,[_0xea25('0x60'),'id'])||{},{'fields':_['keys'](_0x4cb84e),'raw':!![]})[_0xea25('0x2a')](function(_0x1fdf1a){_0x5a6913[_0xea25('0x69')]['push'](_0x1fdf1a['dataValues']);})['catch'](function(_0xd27425){_0x5a6913[_0xea25('0x6a')][_0xea25('0x6b')]({'data':_0x454f7f,'error':_0xd27425[_0xea25('0x6c')]});});})['then'](function(_0x136c07){return _0x5a6913;})['catch'](function(_0x4bd3bf){return _0x4bd3bf;});}else{_0x2b9351[_0xea25('0x2d')](0x190)[_0xea25('0x26')]({'message':_0xea25('0x6d')});}});}})[_0xea25('0x2a')](respondWithResult(_0x2b9351,null))[_0xea25('0x48')](handleError(_0x2b9351,null));};exports[_0xea25('0x6e')]=function(_0x49dce9,_0x79845c,_0x254164){var _0x187855;return db[_0xea25('0x33')]['find']({'where':{'id':_0x49dce9['params']['id']},'include':[{'model':db[_0xea25('0x6f')],'as':_0xea25('0x70')}]})[_0xea25('0x2a')](handleEntityNotFound(_0x79845c,null))['then'](function(_0x1bf6bb){if(_0x1bf6bb){_0x187855=_0x1bf6bb;return db[_0xea25('0x62')][_0xea25('0x4b')];}})[_0xea25('0x2a')](function(_0x575410){if(_0x575410){var _0x1eee27={};var _0x4e80be={};_0x4e80be[_0xea25('0x38')]=_[_0xea25('0x71')](_['keys'](_0x575410),_['map'](_0x187855['CustomFields'],function(_0x4e9367){return util[_0xea25('0x72')](_0xea25('0x73'),_0x4e9367['id']);}));_0x4e80be[_0xea25('0x35')]=_[_0xea25('0x36')](_0x49dce9[_0xea25('0x35')]);_0x4e80be[_0xea25('0x3f')]=_['intersection'](_0x4e80be['model'],_0x4e80be[_0xea25('0x35')]);_0x1eee27[_0xea25('0x39')]=_[_0xea25('0x37')](_0x4e80be[_0xea25('0x38')],qs[_0xea25('0x3a')](_0x49dce9[_0xea25('0x35')][_0xea25('0x3a')]));_0x1eee27[_0xea25('0x39')]=_0x1eee27[_0xea25('0x39')][_0xea25('0x4c')]?_0x1eee27[_0xea25('0x39')]:_0x4e80be[_0xea25('0x38')];if(!_0x49dce9['query'][_0xea25('0x3b')](_0xea25('0x5b'))){_0x1eee27['limit']=qs[_0xea25('0x23')](_0x49dce9[_0xea25('0x35')][_0xea25('0x23')]);_0x1eee27[_0xea25('0x21')]=qs[_0xea25('0x21')](_0x49dce9[_0xea25('0x35')][_0xea25('0x21')]);}_0x1eee27[_0xea25('0x3c')]=qs[_0xea25('0x3d')](_0x49dce9[_0xea25('0x35')][_0xea25('0x3d')]);_0x1eee27[_0xea25('0x3e')]=qs['filters'](_['pick'](_0x49dce9['query'],_0x4e80be['filters']));_0x1eee27[_0xea25('0x74')]=!![];if(_0x49dce9[_0xea25('0x35')][_0xea25('0x5d')]){_0x1eee27[_0xea25('0x3e')]=_[_0xea25('0x41')](_0x1eee27[_0xea25('0x3e')],{'$or':_[_0xea25('0x32')](_0x1eee27[_0xea25('0x39')],function(_0x2be37e){var _0x1010a8={};_0x1010a8[_0x2be37e]={'$like':'%'+_0x49dce9[_0xea25('0x35')][_0xea25('0x5d')]+'%'};return _0x1010a8;})});}_0x1eee27=_[_0xea25('0x41')]({},_0x1eee27,_0x49dce9['options']);return _0x187855[_0xea25('0x6e')](_0x1eee27);}})['then'](respondWithResult(_0x79845c,null))[_0xea25('0x48')](handleError(_0x79845c,null));};exports['getContactsCsv']=function(_0x22dd69,_0x28213f,_0x4f5937){var _0x4839df;return db[_0xea25('0x33')]['find']({'where':{'id':_0x22dd69['params']['id']},'include':[{'model':db[_0xea25('0x6f')],'as':_0xea25('0x70')}]})[_0xea25('0x2a')](handleEntityNotFound(_0x28213f,null))['then'](function(_0x2d3331){if(_0x2d3331){_0x4839df=_0x2d3331;return db[_0xea25('0x62')][_0xea25('0x4b')];}})[_0xea25('0x2a')](function(_0x49bd41){if(_0x49bd41){var _0x304b80={};var _0x1ddde5={};_0x1ddde5[_0xea25('0x38')]=_['concat'](_[_0xea25('0x36')](_0x49bd41),_['map'](_0x4839df[_0xea25('0x70')],function(_0x25b503){return util[_0xea25('0x72')](_0xea25('0x73'),_0x25b503['id']);}));_0x1ddde5['query']=_[_0xea25('0x36')](_0x22dd69[_0xea25('0x35')]);_0x1ddde5[_0xea25('0x3f')]=_[_0xea25('0x37')](_0x1ddde5[_0xea25('0x38')],_0x1ddde5[_0xea25('0x35')]);_0x304b80[_0xea25('0x39')]=_[_0xea25('0x37')](_0x1ddde5[_0xea25('0x38')],qs['fields'](_0x22dd69[_0xea25('0x35')]['fields']));_0x304b80['attributes']=_0x304b80[_0xea25('0x39')][_0xea25('0x4c')]?_0x304b80['attributes']:_0x1ddde5[_0xea25('0x38')];if(!_0x22dd69[_0xea25('0x35')]['hasOwnProperty'](_0xea25('0x5b'))){_0x304b80['limit']=qs['limit'](_0x22dd69[_0xea25('0x35')][_0xea25('0x23')]);_0x304b80[_0xea25('0x21')]=qs['offset'](_0x22dd69[_0xea25('0x35')][_0xea25('0x21')]);}_0x304b80['order']=qs[_0xea25('0x3d')](_0x22dd69[_0xea25('0x35')][_0xea25('0x3d')]);_0x304b80[_0xea25('0x3e')]=qs['filters'](_['pick'](_0x22dd69[_0xea25('0x35')],_0x1ddde5[_0xea25('0x3f')]));_0x304b80[_0xea25('0x74')]=!![];if(_0x22dd69[_0xea25('0x35')][_0xea25('0x5d')]){_0x304b80[_0xea25('0x3e')]=_[_0xea25('0x41')](_0x304b80[_0xea25('0x3e')],{'$or':_['map'](_0x304b80[_0xea25('0x39')],function(_0x42d8b3){var _0x369684={};_0x369684[_0x42d8b3]={'$like':'%'+_0x22dd69[_0xea25('0x35')][_0xea25('0x5d')]+'%'};return _0x369684;})});}_0x304b80=_[_0xea25('0x41')]({},_0x304b80,_0x22dd69[_0xea25('0x44')]);return _0x4839df['getContacts'](_0x304b80);}})[_0xea25('0x2a')](function(_0x1da6af){if(!_[_0xea25('0x75')](_0x1da6af)){var _0x783ce2=toCsv(_0x1da6af);var _0x46817d=Date['now']();fs[_0xea25('0x76')](util[_0xea25('0x72')](_0xea25('0x77'),_0x4839df['id'],_0x46817d),_0x783ce2);_0x28213f[_0xea25('0x78')](_0xea25('0x79'),_0xea25('0x7a')+util[_0xea25('0x72')]('list_%d_%s.csv',_0x4839df['id'],_0x46817d));_0x28213f[_0xea25('0x78')](_0xea25('0x7b'),'text/csv');return _0x28213f['download'](util[_0xea25('0x72')](_0xea25('0x77'),_0x4839df['id'],_0x46817d));}else{return _0x28213f[_0xea25('0x1f')](0xcc);}})['catch'](handleError(_0x28213f,null));};exports[_0xea25('0x7c')]=function(_0x5e21de,_0x106daf,_0x405311){var _0x23b961;delete _0x5e21de[_0xea25('0x58')]['id'];return db[_0xea25('0x33')][_0xea25('0x7d')]({'where':{'id':_0x5e21de[_0xea25('0x4a')]['id']}})['then'](handleEntityNotFound(_0x106daf,null))[_0xea25('0x2a')](function(_0xbff1ad){if(_0xbff1ad){return db['sequelize'][_0xea25('0x7e')](function(_0x5bed98){return db[_0xea25('0x6f')][_0xea25('0x4f')](_0x5e21de[_0xea25('0x58')],{'transaction':_0x5bed98})[_0xea25('0x2a')](function(_0x4cf54e){_0x23b961=_0x4cf54e;return _0xbff1ad[_0xea25('0x7f')](_0x4cf54e,{'transaction':_0x5bed98});})['then'](function(){var _0x4ce6ce={'type':db[_0xea25('0x80')][_0xea25('0x81')],'transaction':_0x5bed98};switch(_0x5e21de['body'][_0xea25('0x42')]){case _0xea25('0x82'):_0x4ce6ce['type']=db['Sequelize'][_0xea25('0x81')];break;case _0xea25('0x83'):_0x4ce6ce['type']=db['Sequelize'][_0xea25('0x84')];break;case _0xea25('0x85'):_0x4ce6ce[_0xea25('0x42')]=db[_0xea25('0x80')][_0xea25('0x86')];_0x4ce6ce[_0xea25('0x87')]=![];break;default:}return db[_0xea25('0x88')]['queryInterface'][_0xea25('0x89')](_0xea25('0x8a'),util[_0xea25('0x72')](_0xea25('0x8b'),_0x23b961['id']),_0x4ce6ce);})[_0xea25('0x2a')](function(){return _0x23b961;});});}})[_0xea25('0x2a')](respondWithResult(_0x106daf,null))['catch'](handleError(_0x106daf,null));};exports[_0xea25('0x8c')]=function(_0x3364bb,_0x1b97c5,_0x15c6b6){var _0x489e14={};var _0x195dde={};var _0x29be37;var _0x1cbf73;return db['CmList'][_0xea25('0x7d')]({'where':{'id':_0x3364bb[_0xea25('0x4a')]['id']}})[_0xea25('0x2a')](handleEntityNotFound(_0x1b97c5,null))[_0xea25('0x2a')](function(_0x53a1fa){if(_0x53a1fa){_0x29be37=_0x53a1fa;_0x195dde[_0xea25('0x38')]=_['keys'](db[_0xea25('0x6f')]['rawAttributes']);_0x195dde[_0xea25('0x35')]=_[_0xea25('0x36')](_0x3364bb[_0xea25('0x35')]);_0x195dde['filters']=_[_0xea25('0x37')](_0x195dde[_0xea25('0x38')],_0x195dde[_0xea25('0x35')]);_0x489e14[_0xea25('0x39')]=_[_0xea25('0x37')](_0x195dde[_0xea25('0x38')],qs[_0xea25('0x3a')](_0x3364bb[_0xea25('0x35')]['fields']));_0x489e14['attributes']=_0x489e14[_0xea25('0x39')][_0xea25('0x4c')]?_0x489e14[_0xea25('0x39')]:_0x195dde['model'];_0x489e14['order']=qs[_0xea25('0x3d')](_0x3364bb[_0xea25('0x35')]['sort']);_0x489e14['where']=qs['filters'](_[_0xea25('0x40')](_0x3364bb[_0xea25('0x35')],_0x195dde[_0xea25('0x3f')]));_0x489e14[_0xea25('0x3e')]=_[_0xea25('0x41')](_0x489e14[_0xea25('0x3e')],{'$or':[{'ListId':_0x53a1fa['id']},{'ListId':null}]});if(_0x3364bb[_0xea25('0x35')]['filter']){_0x489e14[_0xea25('0x3e')]=_['merge'](_0x489e14['where'],{'$or':_[_0xea25('0x32')](_0x489e14['attributes'],function(_0x1426ad){var _0x530500={};_0x530500[_0x1426ad]={'$like':'%'+_0x3364bb['query'][_0xea25('0x5d')]+'%'};return _0x530500;})});}_0x489e14=_['merge']({},_0x489e14,_0x3364bb['options']);return db[_0xea25('0x6f')][_0xea25('0x8d')](_0x489e14);}})[_0xea25('0x2a')](respondWithResult(_0x1b97c5,null))[_0xea25('0x48')](handleError(_0x1b97c5,null));};exports[_0xea25('0x8e')]=function(_0x5048e7,_0x536506,_0x4bebba){return db['CmList']['find']({'where':{'id':_0x5048e7[_0xea25('0x4a')]['id']}})[_0xea25('0x2a')](handleEntityNotFound(_0x536506,null))[_0xea25('0x2a')](function(_0x4ca99f){if(_0x4ca99f){return _0x4ca99f[_0xea25('0x8e')](_0x5048e7['body'][_0xea25('0x60')],_['omit'](_0x5048e7[_0xea25('0x58')],['ids','id'])||{})['spread'](function(_0x523ee2){for(var _0x4e28fa=0x0;_0x4e28fa<_0x5048e7[_0xea25('0x58')][_0xea25('0x60')]['length'];_0x4e28fa+=0x1){socket[_0xea25('0x8f')]('userCmList:save',{'UserId':Number(_0x5048e7[_0xea25('0x58')][_0xea25('0x60')][_0x4e28fa]),'CmListId':Number(_0x5048e7[_0xea25('0x4a')]['id'])});}return _0x523ee2;});}})['then'](respondWithResult(_0x536506,null))[_0xea25('0x48')](handleError(_0x536506,null));};exports[_0xea25('0x90')]=function(_0x205cba,_0x4231a1,_0x653e86){return db['CmList'][_0xea25('0x4e')]({'where':{'id':_0x205cba[_0xea25('0x4a')]['id']}})[_0xea25('0x2a')](handleEntityNotFound(_0x4231a1,null))['then'](function(_0x5aa5fc){if(_0x5aa5fc){return _0x5aa5fc[_0xea25('0x90')](_0x205cba[_0xea25('0x35')]['ids'])[_0xea25('0x2a')](function(){if(_['isArray'](_0x205cba[_0xea25('0x35')][_0xea25('0x60')])){for(var _0x51c8f0=0x0;_0x51c8f0<_0x205cba[_0xea25('0x35')][_0xea25('0x60')][_0xea25('0x4c')];_0x51c8f0+=0x1){socket['emit'](_0xea25('0x91'),{'UserId':Number(_0x205cba['query']['ids'][_0x51c8f0]),'CmListId':Number(_0x205cba['params']['id'])});}}else{socket[_0xea25('0x8f')](_0xea25('0x91'),{'UserId':Number(_0x205cba[_0xea25('0x35')]['ids']),'CmListId':Number(_0x205cba['params']['id'])});}});}})[_0xea25('0x2a')](respondWithStatusCode(_0x4231a1,null))['catch'](handleError(_0x4231a1,null));};exports['getAgents']=function(_0x5731a5,_0x3ebc93,_0x1e7d91){var _0x345cb4={};var _0x329c0f={};var _0x29605b;var _0xb54ca4;return db['CmList'][_0xea25('0x7d')]({'where':{'id':_0x5731a5[_0xea25('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3ebc93,null))[_0xea25('0x2a')](function(_0xc0c6b0){if(_0xc0c6b0){_0x29605b=_0xc0c6b0;_0x329c0f['model']=_[_0xea25('0x36')](db[_0xea25('0x92')]['rawAttributes']);_0x329c0f[_0xea25('0x35')]=_[_0xea25('0x36')](_0x5731a5['query']);_0x329c0f[_0xea25('0x3f')]=_[_0xea25('0x37')](_0x329c0f[_0xea25('0x38')],_0x329c0f['query']);_0x345cb4['attributes']=_[_0xea25('0x37')](_0x329c0f[_0xea25('0x38')],qs['fields'](_0x5731a5['query'][_0xea25('0x3a')]));_0x345cb4[_0xea25('0x39')]=_0x345cb4[_0xea25('0x39')][_0xea25('0x4c')]?_0x345cb4[_0xea25('0x39')]:_0x329c0f[_0xea25('0x38')];_0x345cb4['order']=qs['sort'](_0x5731a5[_0xea25('0x35')]['sort']);_0x345cb4[_0xea25('0x3e')]=qs[_0xea25('0x3f')](_[_0xea25('0x40')](_0x5731a5[_0xea25('0x35')],_0x329c0f[_0xea25('0x3f')]));if(_0x5731a5[_0xea25('0x35')][_0xea25('0x5d')]){_0x345cb4[_0xea25('0x3e')]=_['merge'](_0x345cb4[_0xea25('0x3e')],{'$or':_[_0xea25('0x32')](_0x345cb4[_0xea25('0x39')],function(_0x37e8db){var _0x115b5a={};_0x115b5a[_0x37e8db]={'$like':'%'+_0x5731a5[_0xea25('0x35')][_0xea25('0x5d')]+'%'};return _0x115b5a;})});}_0x345cb4=_[_0xea25('0x41')]({},_0x345cb4,_0x5731a5[_0xea25('0x44')]);return _0x29605b[_0xea25('0x93')](_0x345cb4);}})[_0xea25('0x2a')](function(_0x2f8bc9){if(_0x2f8bc9){_0xb54ca4=_0x2f8bc9[_0xea25('0x4c')];if(!_0x5731a5[_0xea25('0x35')][_0xea25('0x3b')](_0xea25('0x5b'))){_0x345cb4[_0xea25('0x23')]=qs[_0xea25('0x23')](_0x5731a5[_0xea25('0x35')][_0xea25('0x23')]);_0x345cb4[_0xea25('0x21')]=qs[_0xea25('0x21')](_0x5731a5[_0xea25('0x35')]['offset']);}return _0x29605b['getAgents'](_0x345cb4);}})[_0xea25('0x2a')](function(_0x54deef){if(_0x54deef){return _0x54deef?{'count':_0xb54ca4,'rows':_0x54deef}:null;}})[_0xea25('0x2a')](respondWithResult(_0x3ebc93,null))['catch'](handleError(_0x3ebc93,null));};
\ No newline at end of file
+var _0x1303=['util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','update','destroy','then','get','Lists','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','CmList','include','findAll','params','includeAll','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','nolimit','rows','removeDispositions','ids','addContacts','CmContact','isArray','tags','join','push','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','pick','raw','getContactsCsv','isEmpty','now','/tmp/list_%d_%s.csv','Content-disposition','list_%d_%s.csv','Content-type','text/csv','download','findOne','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','number','INTEGER','BOOLEAN','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache'];(function(_0x3e1ec6,_0x43128b){var _0x36f1cd=function(_0x3c8225){while(--_0x3c8225){_0x3e1ec6['push'](_0x3e1ec6['shift']());}};_0x36f1cd(++_0x43128b);}(_0x1303,0x86));var _0x3130=function(_0x22e690,_0x5f570e){_0x22e690=_0x22e690-0x0;var _0x2b515f=_0x1303[_0x22e690];return _0x2b515f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3130('0x0'));var zipdir=require(_0x3130('0x1'));var jsonpatch=require(_0x3130('0x2'));var rp=require(_0x3130('0x3'));var moment=require(_0x3130('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3130('0x5'));var util=require(_0x3130('0x6'));var path=require(_0x3130('0x7'));var sox=require(_0x3130('0x8'));var csv=require(_0x3130('0x9'));var ejs=require(_0x3130('0xa'));var fs=require('fs');var fs_extra=require(_0x3130('0xb'));var _=require('lodash');var squel=require(_0x3130('0xc'));var crypto=require(_0x3130('0xd'));var jsforce=require(_0x3130('0xe'));var deskjs=require(_0x3130('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3130('0x10'));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('../../config/license/hardware');var logger=require('../../config/logger')(_0x3130('0x11'));var utils=require('../../config/utils');var config=require(_0x3130('0x12'));var licenseUtil=require(_0x3130('0x13'));var db=require('../../mysqldb')['db'];config[_0x3130('0x14')]=_[_0x3130('0x15')](config[_0x3130('0x14')],{'host':_0x3130('0x16'),'port':0x18eb});var socket=require(_0x3130('0x17'))(new Redis(config[_0x3130('0x14')]));require(_0x3130('0x18'))[_0x3130('0x19')](socket);function respondWithStatusCode(_0x163fb8,_0x1a98df){_0x1a98df=_0x1a98df||0xcc;return function(_0x4c7195){if(_0x4c7195){return _0x163fb8[_0x3130('0x1a')](_0x1a98df);}return _0x163fb8['status'](_0x1a98df)['end']();};}function respondWithResult(_0xfd9f02,_0x3db915){_0x3db915=_0x3db915||0xc8;return function(_0x47c3d4){if(_0x47c3d4){return _0xfd9f02[_0x3130('0x1b')](_0x3db915)[_0x3130('0x1c')](_0x47c3d4);}};}function respondWithFilteredResult(_0x232f49,_0xa5159){return function(_0xbae37){if(_0xbae37){var _0x164aaa=typeof _0xa5159[_0x3130('0x1d')]===_0x3130('0x1e')&&typeof _0xa5159[_0x3130('0x1f')]==='undefined';var _0x400896=_0xbae37['count'];var _0x423cb2=_0x164aaa?0x0:_0xa5159[_0x3130('0x1d')];var _0x590364=_0x164aaa?_0xbae37[_0x3130('0x20')]:_0xa5159[_0x3130('0x1d')]+_0xa5159[_0x3130('0x1f')];var _0x19456a;if(_0x590364>=_0x400896){_0x590364=_0x400896;_0x19456a=0xc8;}else{_0x19456a=0xce;}_0x232f49['status'](_0x19456a);return _0x232f49['set']('Content-Range',_0x423cb2+'-'+_0x590364+'/'+_0x400896)[_0x3130('0x1c')](_0xbae37);}return null;};}function patchUpdates(_0x1506e7){return function(_0x1cdcc0){try{jsonpatch[_0x3130('0x21')](_0x1cdcc0,_0x1506e7,!![]);}catch(_0x3e5669){return BPromise[_0x3130('0x22')](_0x3e5669);}return _0x1cdcc0[_0x3130('0x23')]();};}function saveUpdates(_0x503ded,_0x24c4ab){return function(_0x3d5e37){if(_0x3d5e37){return _0x3d5e37[_0x3130('0x24')](_0x503ded)['then'](function(_0x5e00c3){return _0x5e00c3;});}return null;};}function removeEntity(_0x2a3c0b,_0x82df5d){return function(_0x44f1e9){if(_0x44f1e9){return _0x44f1e9[_0x3130('0x25')]()[_0x3130('0x26')](function(){var _0x1ece7d=_0x44f1e9[_0x3130('0x27')]({'plain':!![]});var _0x3c1505=_0x3130('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x3c1505,'resourceId':_0x1ece7d['id']}})['then'](function(){return _0x44f1e9;});})[_0x3130('0x26')](function(){_0x2a3c0b['status'](0xcc)[_0x3130('0x29')]();});}};}function handleEntityNotFound(_0x216544,_0x3d0c5a){return function(_0x422f9d){if(!_0x422f9d){_0x216544['sendStatus'](0x194);}return _0x422f9d;};}function handleError(_0x89f0bc,_0xad182f){_0xad182f=_0xad182f||0x1f4;return function(_0x33d943){logger[_0x3130('0x2a')](_0x33d943[_0x3130('0x2b')]);if(_0x33d943[_0x3130('0x2c')]){delete _0x33d943[_0x3130('0x2c')];}_0x89f0bc[_0x3130('0x1b')](_0xad182f)[_0x3130('0x2d')](_0x33d943);};}exports[_0x3130('0x2e')]=function(_0x28d926,_0x51cda5){var _0xd8bc50={},_0x46b9c8={},_0x21f741={'count':0x0,'rows':[]};var _0x44a9d9=_[_0x3130('0x2f')](db['CmList'][_0x3130('0x30')],function(_0x482e04){return{'name':_0x482e04['fieldName'],'type':_0x482e04[_0x3130('0x31')][_0x3130('0x32')]};});_0x46b9c8[_0x3130('0x33')]=_[_0x3130('0x2f')](_0x44a9d9,_0x3130('0x2c'));_0x46b9c8[_0x3130('0x34')]=_[_0x3130('0x35')](_0x28d926['query']);_0x46b9c8[_0x3130('0x36')]=_['intersection'](_0x46b9c8[_0x3130('0x33')],_0x46b9c8[_0x3130('0x34')]);_0xd8bc50[_0x3130('0x37')]=_[_0x3130('0x38')](_0x46b9c8['model'],qs[_0x3130('0x39')](_0x28d926['query'][_0x3130('0x39')]));_0xd8bc50[_0x3130('0x37')]=_0xd8bc50[_0x3130('0x37')][_0x3130('0x3a')]?_0xd8bc50[_0x3130('0x37')]:_0x46b9c8[_0x3130('0x33')];if(!_0x28d926[_0x3130('0x34')][_0x3130('0x3b')]('nolimit')){_0xd8bc50[_0x3130('0x1f')]=qs[_0x3130('0x1f')](_0x28d926[_0x3130('0x34')][_0x3130('0x1f')]);_0xd8bc50[_0x3130('0x1d')]=qs[_0x3130('0x1d')](_0x28d926['query'][_0x3130('0x1d')]);}_0xd8bc50[_0x3130('0x3c')]=qs[_0x3130('0x3d')](_0x28d926[_0x3130('0x34')][_0x3130('0x3d')]);_0xd8bc50[_0x3130('0x3e')]=qs[_0x3130('0x36')](_['pick'](_0x28d926[_0x3130('0x34')],_0x46b9c8[_0x3130('0x36')]),_0x44a9d9);if(_0x28d926[_0x3130('0x34')][_0x3130('0x3f')]){_0xd8bc50[_0x3130('0x3e')]=_['merge'](_0xd8bc50['where'],{'$or':_[_0x3130('0x2f')](_0x44a9d9,function(_0x5e319a){if(_0x5e319a[_0x3130('0x31')]!=='VIRTUAL'){var _0x96fd79={};_0x96fd79[_0x5e319a[_0x3130('0x2c')]]={'$like':'%'+_0x28d926[_0x3130('0x34')][_0x3130('0x3f')]+'%'};return _0x96fd79;}})});}_0xd8bc50=_[_0x3130('0x40')]({},_0xd8bc50,_0x28d926[_0x3130('0x41')]);var _0x215510={'where':_0xd8bc50['where']};return db[_0x3130('0x42')][_0x3130('0x20')](_0x215510)[_0x3130('0x26')](function(_0x185544){_0x21f741[_0x3130('0x20')]=_0x185544;if(_0x28d926[_0x3130('0x34')]['includeAll']){_0xd8bc50[_0x3130('0x43')]=[{'all':!![]}];}return db[_0x3130('0x42')][_0x3130('0x44')](_0xd8bc50);})['then'](function(_0x590500){_0x21f741['rows']=_0x590500;return _0x21f741;})[_0x3130('0x26')](respondWithFilteredResult(_0x51cda5,_0xd8bc50))['catch'](handleError(_0x51cda5,null));};exports['show']=function(_0xdd6ab6,_0x5a8eb7){var _0x1841c7={'raw':![],'where':{'id':_0xdd6ab6[_0x3130('0x45')]['id']}},_0x3a4df5={};_0x3a4df5[_0x3130('0x33')]=_[_0x3130('0x35')](db[_0x3130('0x42')][_0x3130('0x30')]);_0x3a4df5[_0x3130('0x34')]=_[_0x3130('0x35')](_0xdd6ab6[_0x3130('0x34')]);_0x3a4df5['filters']=_[_0x3130('0x38')](_0x3a4df5[_0x3130('0x33')],_0x3a4df5[_0x3130('0x34')]);_0x1841c7['attributes']=_[_0x3130('0x38')](_0x3a4df5[_0x3130('0x33')],qs['fields'](_0xdd6ab6[_0x3130('0x34')][_0x3130('0x39')]));_0x1841c7[_0x3130('0x37')]=_0x1841c7[_0x3130('0x37')]['length']?_0x1841c7[_0x3130('0x37')]:_0x3a4df5[_0x3130('0x33')];if(_0xdd6ab6[_0x3130('0x34')][_0x3130('0x46')]){_0x1841c7[_0x3130('0x43')]=[{'all':!![]}];}_0x1841c7=_[_0x3130('0x40')]({},_0x1841c7,_0xdd6ab6['options']);return db[_0x3130('0x42')][_0x3130('0x47')](_0x1841c7)[_0x3130('0x26')](handleEntityNotFound(_0x5a8eb7,null))['then'](respondWithResult(_0x5a8eb7,null))[_0x3130('0x48')](handleError(_0x5a8eb7,null));};exports[_0x3130('0x49')]=function(_0x508984,_0x2ab07d){return db[_0x3130('0x42')][_0x3130('0x49')](_0x508984[_0x3130('0x4a')],{})[_0x3130('0x26')](function(_0x41abf3){var _0x444446=_0x508984['user'][_0x3130('0x27')]({'plain':!![]});if(!_0x444446)throw new Error(_0x3130('0x4b'));if(_0x444446[_0x3130('0x4c')]===_0x3130('0x4d')){var _0x5cc90e=_0x41abf3[_0x3130('0x27')]({'plain':!![]});var _0x13bfec='Lists';return db['UserProfileSection'][_0x3130('0x47')]({'where':{'name':_0x13bfec,'userProfileId':_0x444446[_0x3130('0x4e')]},'raw':!![]})[_0x3130('0x26')](function(_0x4352e7){if(_0x4352e7&&_0x4352e7['autoAssociation']===0x0){return db[_0x3130('0x4f')][_0x3130('0x49')]({'name':_0x5cc90e[_0x3130('0x2c')],'resourceId':_0x5cc90e['id'],'type':_0x4352e7[_0x3130('0x2c')],'sectionId':_0x4352e7['id']},{})[_0x3130('0x26')](function(){return _0x41abf3;});}else{return _0x41abf3;}})[_0x3130('0x48')](function(_0x4db692){logger[_0x3130('0x2a')](_0x3130('0x50'),_0x4db692);throw _0x4db692;});}return _0x41abf3;})[_0x3130('0x26')](respondWithResult(_0x2ab07d,0xc9))[_0x3130('0x48')](handleError(_0x2ab07d,null));};exports[_0x3130('0x24')]=function(_0x306a83,_0x2b783b){if(_0x306a83[_0x3130('0x4a')]['id']){delete _0x306a83[_0x3130('0x4a')]['id'];}return db[_0x3130('0x42')][_0x3130('0x47')]({'where':{'id':_0x306a83['params']['id']}})[_0x3130('0x26')](handleEntityNotFound(_0x2b783b,null))[_0x3130('0x26')](saveUpdates(_0x306a83[_0x3130('0x4a')],null))['then'](respondWithResult(_0x2b783b,null))[_0x3130('0x48')](handleError(_0x2b783b,null));};exports[_0x3130('0x25')]=function(_0x40b538,_0x41ea87){return db[_0x3130('0x42')][_0x3130('0x47')]({'where':{'id':_0x40b538[_0x3130('0x45')]['id']}})[_0x3130('0x26')](handleEntityNotFound(_0x41ea87,null))[_0x3130('0x26')](removeEntity(_0x41ea87,null))['catch'](handleError(_0x41ea87,null));};exports['describe']=function(_0x5366b5,_0x5217af){return db[_0x3130('0x42')][_0x3130('0x51')]()['then'](respondWithResult(_0x5217af,null))[_0x3130('0x48')](handleError(_0x5217af,null));};exports[_0x3130('0x52')]=function(_0x52b996,_0x1360ce,_0x3a8a6b){if(_0x52b996[_0x3130('0x4a')]['id']){delete _0x52b996[_0x3130('0x4a')]['id'];}return db['CmList'][_0x3130('0x47')]({'where':{'id':_0x52b996[_0x3130('0x45')]['id']}})['then'](handleEntityNotFound(_0x1360ce,null))['then'](function(_0x220485){if(_0x220485){_0x52b996['body'][_0x3130('0x53')]=_0x220485['id'];return db[_0x3130('0x54')][_0x3130('0x49')](_0x52b996[_0x3130('0x4a')]);}})[_0x3130('0x26')](respondWithResult(_0x1360ce,null))['catch'](handleError(_0x1360ce,null));};exports[_0x3130('0x55')]=function(_0x327712,_0x5517b2,_0x399e8b){var _0x22e4cc={'raw':![],'where':{}};var _0x1961bd={};var _0x5713dd={'count':0x0,'rows':[]};return db['CmList']['findOne']({'where':{'id':_0x327712['params']['id']}})[_0x3130('0x26')](handleEntityNotFound(_0x5517b2,null))[_0x3130('0x26')](function(_0x5f385f){if(_0x5f385f){_0x1961bd[_0x3130('0x33')]=_[_0x3130('0x35')](db[_0x3130('0x54')][_0x3130('0x30')]);_0x1961bd['query']=_[_0x3130('0x35')](_0x327712['query']);_0x1961bd[_0x3130('0x36')]=_[_0x3130('0x38')](_0x1961bd[_0x3130('0x33')],_0x1961bd['query']);_0x22e4cc[_0x3130('0x37')]=_['intersection'](_0x1961bd[_0x3130('0x33')],qs[_0x3130('0x39')](_0x327712[_0x3130('0x34')][_0x3130('0x39')]));_0x22e4cc['attributes']=_0x22e4cc[_0x3130('0x37')][_0x3130('0x3a')]?_0x22e4cc[_0x3130('0x37')]:_0x1961bd[_0x3130('0x33')];if(!_0x327712[_0x3130('0x34')][_0x3130('0x3b')](_0x3130('0x56'))){_0x22e4cc[_0x3130('0x1f')]=qs['limit'](_0x327712[_0x3130('0x34')]['limit']);_0x22e4cc[_0x3130('0x1d')]=qs[_0x3130('0x1d')](_0x327712[_0x3130('0x34')]['offset']);}_0x22e4cc[_0x3130('0x3c')]=qs['sort'](_0x327712['query']['sort']);_0x22e4cc[_0x3130('0x3e')]=qs[_0x3130('0x36')](_['pick'](_0x327712['query'],_0x1961bd['filters']));_0x22e4cc['where'][_0x3130('0x53')]=_0x5f385f['id'];if(_0x327712['query'][_0x3130('0x3f')]){_0x22e4cc['where']=_[_0x3130('0x40')](_0x22e4cc['where'],{'$or':_[_0x3130('0x2f')](_0x22e4cc['attributes'],function(_0x2e9958){var _0xc8849e={};_0xc8849e[_0x2e9958]={'$like':'%'+_0x327712[_0x3130('0x34')][_0x3130('0x3f')]+'%'};return _0xc8849e;})});}_0x22e4cc=_[_0x3130('0x40')]({},_0x22e4cc,_0x327712[_0x3130('0x41')]);return db[_0x3130('0x54')]['count']({'where':_0x22e4cc[_0x3130('0x3e')]})['then'](function(_0x5e01cf){_0x5713dd['count']=_0x5e01cf;if(_0x327712[_0x3130('0x34')][_0x3130('0x46')]){_0x22e4cc[_0x3130('0x43')]=[{'all':!![]}];}return db[_0x3130('0x54')][_0x3130('0x44')](_0x22e4cc);})[_0x3130('0x26')](function(_0x5db487){_0x5713dd[_0x3130('0x57')]=_0x5db487;return _0x5713dd;});}})[_0x3130('0x26')](respondWithFilteredResult(_0x5517b2,_0x22e4cc))[_0x3130('0x48')](handleError(_0x5517b2,null));};exports['removeDispositions']=function(_0x9c24db,_0x3cc74d,_0xe4e77e){return db['CmList'][_0x3130('0x47')]({'where':{'id':_0x9c24db[_0x3130('0x45')]['id']}})[_0x3130('0x26')](handleEntityNotFound(_0x3cc74d,null))[_0x3130('0x26')](function(_0x537797){if(_0x537797){return _0x537797[_0x3130('0x58')](_0x9c24db[_0x3130('0x34')][_0x3130('0x59')]);}})[_0x3130('0x26')](respondWithStatusCode(_0x3cc74d,null))['catch'](handleError(_0x3cc74d,null));};exports[_0x3130('0x5a')]=function(_0x48ed35,_0x3d32c5,_0x53eed1){return db['CmList']['find']({'where':{'id':_0x48ed35['params']['id']}})[_0x3130('0x26')](handleEntityNotFound(_0x3d32c5,null))[_0x3130('0x26')](function(_0x1f324d){if(_0x1f324d){var _0x115593=[];var _0x52e096={'success':[],'errors':[]};return db[_0x3130('0x5b')][_0x3130('0x51')]()[_0x3130('0x26')](function(_0xbe45d2){if(_0x48ed35[_0x3130('0x4a')]['tags']&&_[_0x3130('0x5c')](_0x48ed35[_0x3130('0x4a')][_0x3130('0x5d')])){if(_0x48ed35[_0x3130('0x4a')][_0x3130('0x5d')][_0x3130('0x3a')]){_0x48ed35[_0x3130('0x4a')][_0x3130('0x5d')]=_0x48ed35[_0x3130('0x4a')]['tags'][_0x3130('0x5e')](';')+';';}else{_0x48ed35[_0x3130('0x4a')][_0x3130('0x5d')]=null;}}else{_0x48ed35[_0x3130('0x4a')][_0x3130('0x5d')]=null;}if(_0x48ed35['body']&&_[_0x3130('0x5c')](_0x48ed35['body'])){for(var _0x283066=0x0;_0x283066<_0x48ed35['body']['length'];_0x283066+=0x1){_0x48ed35[_0x3130('0x4a')][_0x283066][_0x3130('0x53')]=_0x48ed35['params']['id'];_0x115593[_0x3130('0x5f')](_0x48ed35[_0x3130('0x4a')][_0x283066]);}return BPromise['each'](_0x115593,function(_0x2c654d){return db['CmContact'][_0x3130('0x49')](_['omit'](_0x2c654d,['ids','id'])||{},{'fields':_[_0x3130('0x35')](_0xbe45d2),'raw':!![]})['then'](function(_0x8f2ccb){_0x52e096['success'][_0x3130('0x5f')](_0x8f2ccb[_0x3130('0x60')]);})[_0x3130('0x48')](function(_0x31c5a7){_0x52e096[_0x3130('0x61')][_0x3130('0x5f')]({'data':_0x2c654d,'error':_0x31c5a7[_0x3130('0x62')]});});})[_0x3130('0x26')](function(_0x52f1cd){return _0x52e096;})[_0x3130('0x48')](function(_0x1868e8){return _0x1868e8;});}else{_0x3d32c5[_0x3130('0x1b')](0x190)['json']({'message':_0x3130('0x63')});}});}})[_0x3130('0x26')](respondWithResult(_0x3d32c5,null))['catch'](handleError(_0x3d32c5,null));};exports[_0x3130('0x64')]=function(_0x4e370d,_0x332da7,_0x589793){var _0x12bf15;return db[_0x3130('0x42')][_0x3130('0x47')]({'where':{'id':_0x4e370d[_0x3130('0x45')]['id']},'include':[{'model':db[_0x3130('0x65')],'as':_0x3130('0x66')}]})['then'](handleEntityNotFound(_0x332da7,null))[_0x3130('0x26')](function(_0x25d15a){if(_0x25d15a){_0x12bf15=_0x25d15a;return db[_0x3130('0x5b')][_0x3130('0x30')];}})[_0x3130('0x26')](function(_0x12ca14){if(_0x12ca14){var _0x469c48={};var _0x2b080f={};_0x2b080f[_0x3130('0x33')]=_[_0x3130('0x67')](_[_0x3130('0x35')](_0x12ca14),_['map'](_0x12bf15['CustomFields'],function(_0x63e138){return util[_0x3130('0x68')](_0x3130('0x69'),_0x63e138['id']);}));_0x2b080f[_0x3130('0x34')]=_['keys'](_0x4e370d[_0x3130('0x34')]);_0x2b080f[_0x3130('0x36')]=_[_0x3130('0x38')](_0x2b080f['model'],_0x2b080f[_0x3130('0x34')]);_0x469c48[_0x3130('0x37')]=_[_0x3130('0x38')](_0x2b080f[_0x3130('0x33')],qs['fields'](_0x4e370d[_0x3130('0x34')]['fields']));_0x469c48[_0x3130('0x37')]=_0x469c48[_0x3130('0x37')]['length']?_0x469c48[_0x3130('0x37')]:_0x2b080f[_0x3130('0x33')];if(!_0x4e370d[_0x3130('0x34')][_0x3130('0x3b')]('nolimit')){_0x469c48['limit']=qs[_0x3130('0x1f')](_0x4e370d['query']['limit']);_0x469c48[_0x3130('0x1d')]=qs[_0x3130('0x1d')](_0x4e370d[_0x3130('0x34')][_0x3130('0x1d')]);}_0x469c48[_0x3130('0x3c')]=qs[_0x3130('0x3d')](_0x4e370d['query'][_0x3130('0x3d')]);_0x469c48[_0x3130('0x3e')]=qs[_0x3130('0x36')](_[_0x3130('0x6a')](_0x4e370d[_0x3130('0x34')],_0x2b080f[_0x3130('0x36')]));_0x469c48[_0x3130('0x6b')]=!![];if(_0x4e370d[_0x3130('0x34')][_0x3130('0x3f')]){_0x469c48['where']=_[_0x3130('0x40')](_0x469c48[_0x3130('0x3e')],{'$or':_[_0x3130('0x2f')](_0x469c48[_0x3130('0x37')],function(_0xd2f98a){var _0x4cee0a={};_0x4cee0a[_0xd2f98a]={'$like':'%'+_0x4e370d['query']['filter']+'%'};return _0x4cee0a;})});}_0x469c48=_[_0x3130('0x40')]({},_0x469c48,_0x4e370d[_0x3130('0x41')]);return _0x12bf15[_0x3130('0x64')](_0x469c48);}})[_0x3130('0x26')](respondWithResult(_0x332da7,null))[_0x3130('0x48')](handleError(_0x332da7,null));};exports[_0x3130('0x6c')]=function(_0x21d639,_0x2c3f78,_0x4c6dc0){var _0x50b222;return db[_0x3130('0x42')][_0x3130('0x47')]({'where':{'id':_0x21d639['params']['id']},'include':[{'model':db[_0x3130('0x65')],'as':_0x3130('0x66')}]})[_0x3130('0x26')](handleEntityNotFound(_0x2c3f78,null))['then'](function(_0x1018c2){if(_0x1018c2){_0x50b222=_0x1018c2;return db[_0x3130('0x5b')]['rawAttributes'];}})[_0x3130('0x26')](function(_0x11d438){if(_0x11d438){var _0x4fdc39={};var _0x4bb4c5={};_0x4bb4c5[_0x3130('0x33')]=_['concat'](_[_0x3130('0x35')](_0x11d438),_[_0x3130('0x2f')](_0x50b222['CustomFields'],function(_0x453a6f){return util[_0x3130('0x68')]('cf_%d',_0x453a6f['id']);}));_0x4bb4c5[_0x3130('0x34')]=_[_0x3130('0x35')](_0x21d639[_0x3130('0x34')]);_0x4bb4c5['filters']=_[_0x3130('0x38')](_0x4bb4c5['model'],_0x4bb4c5[_0x3130('0x34')]);_0x4fdc39[_0x3130('0x37')]=_[_0x3130('0x38')](_0x4bb4c5[_0x3130('0x33')],qs['fields'](_0x21d639['query'][_0x3130('0x39')]));_0x4fdc39['attributes']=_0x4fdc39[_0x3130('0x37')][_0x3130('0x3a')]?_0x4fdc39[_0x3130('0x37')]:_0x4bb4c5[_0x3130('0x33')];if(!_0x21d639[_0x3130('0x34')]['hasOwnProperty'](_0x3130('0x56'))){_0x4fdc39[_0x3130('0x1f')]=qs[_0x3130('0x1f')](_0x21d639[_0x3130('0x34')][_0x3130('0x1f')]);_0x4fdc39[_0x3130('0x1d')]=qs['offset'](_0x21d639['query'][_0x3130('0x1d')]);}_0x4fdc39['order']=qs['sort'](_0x21d639[_0x3130('0x34')][_0x3130('0x3d')]);_0x4fdc39['where']=qs['filters'](_[_0x3130('0x6a')](_0x21d639[_0x3130('0x34')],_0x4bb4c5['filters']));_0x4fdc39[_0x3130('0x6b')]=!![];if(_0x21d639[_0x3130('0x34')][_0x3130('0x3f')]){_0x4fdc39[_0x3130('0x3e')]=_['merge'](_0x4fdc39['where'],{'$or':_[_0x3130('0x2f')](_0x4fdc39['attributes'],function(_0x46270b){var _0x8acd59={};_0x8acd59[_0x46270b]={'$like':'%'+_0x21d639['query'][_0x3130('0x3f')]+'%'};return _0x8acd59;})});}_0x4fdc39=_[_0x3130('0x40')]({},_0x4fdc39,_0x21d639[_0x3130('0x41')]);return _0x50b222[_0x3130('0x64')](_0x4fdc39);}})[_0x3130('0x26')](function(_0x5bbd24){if(!_[_0x3130('0x6d')](_0x5bbd24)){var _0x1d6243=toCsv(_0x5bbd24);var _0x2720f7=Date[_0x3130('0x6e')]();fs['writeFileSync'](util['format'](_0x3130('0x6f'),_0x50b222['id'],_0x2720f7),_0x1d6243);_0x2c3f78['setHeader'](_0x3130('0x70'),'attachment;\x20filename='+util[_0x3130('0x68')](_0x3130('0x71'),_0x50b222['id'],_0x2720f7));_0x2c3f78['setHeader'](_0x3130('0x72'),_0x3130('0x73'));return _0x2c3f78[_0x3130('0x74')](util[_0x3130('0x68')](_0x3130('0x6f'),_0x50b222['id'],_0x2720f7));}else{return _0x2c3f78[_0x3130('0x1a')](0xcc);}})[_0x3130('0x48')](handleError(_0x2c3f78,null));};exports['addCustomField']=function(_0x2512dc,_0x1df14b,_0x4d8134){var _0x278306;delete _0x2512dc[_0x3130('0x4a')]['id'];return db[_0x3130('0x42')][_0x3130('0x75')]({'where':{'id':_0x2512dc[_0x3130('0x45')]['id']}})['then'](handleEntityNotFound(_0x1df14b,null))['then'](function(_0x415be2){if(_0x415be2){return db[_0x3130('0x76')][_0x3130('0x77')](function(_0x45dc66){return db[_0x3130('0x65')][_0x3130('0x49')](_0x2512dc['body'],{'transaction':_0x45dc66})[_0x3130('0x26')](function(_0x1c5be6){_0x278306=_0x1c5be6;return _0x415be2[_0x3130('0x78')](_0x1c5be6,{'transaction':_0x45dc66});})[_0x3130('0x26')](function(){var _0x29ca86={'type':db[_0x3130('0x79')][_0x3130('0x7a')],'transaction':_0x45dc66};switch(_0x2512dc[_0x3130('0x4a')][_0x3130('0x31')]){case _0x3130('0x7b'):_0x29ca86[_0x3130('0x31')]=db['Sequelize'][_0x3130('0x7a')];break;case _0x3130('0x7c'):_0x29ca86['type']=db[_0x3130('0x79')][_0x3130('0x7d')];break;case'switch':_0x29ca86[_0x3130('0x31')]=db[_0x3130('0x79')][_0x3130('0x7e')];_0x29ca86['defaultValue']=![];break;default:}return db[_0x3130('0x76')][_0x3130('0x7f')][_0x3130('0x80')](_0x3130('0x81'),util[_0x3130('0x68')](_0x3130('0x82'),_0x278306['id']),_0x29ca86);})[_0x3130('0x26')](function(){return _0x278306;});});}})[_0x3130('0x26')](respondWithResult(_0x1df14b,null))[_0x3130('0x48')](handleError(_0x1df14b,null));};exports[_0x3130('0x83')]=function(_0x5bfed0,_0x41627e,_0x296ae8){var _0x346ecd={};var _0x3e1a98={};var _0x35ecf1;var _0x1866d2;return db['CmList'][_0x3130('0x75')]({'where':{'id':_0x5bfed0[_0x3130('0x45')]['id']}})[_0x3130('0x26')](handleEntityNotFound(_0x41627e,null))['then'](function(_0x120bf){if(_0x120bf){_0x35ecf1=_0x120bf;_0x3e1a98[_0x3130('0x33')]=_[_0x3130('0x35')](db[_0x3130('0x65')]['rawAttributes']);_0x3e1a98[_0x3130('0x34')]=_[_0x3130('0x35')](_0x5bfed0[_0x3130('0x34')]);_0x3e1a98['filters']=_[_0x3130('0x38')](_0x3e1a98['model'],_0x3e1a98[_0x3130('0x34')]);_0x346ecd['attributes']=_[_0x3130('0x38')](_0x3e1a98[_0x3130('0x33')],qs['fields'](_0x5bfed0[_0x3130('0x34')][_0x3130('0x39')]));_0x346ecd[_0x3130('0x37')]=_0x346ecd[_0x3130('0x37')][_0x3130('0x3a')]?_0x346ecd[_0x3130('0x37')]:_0x3e1a98[_0x3130('0x33')];_0x346ecd[_0x3130('0x3c')]=qs[_0x3130('0x3d')](_0x5bfed0[_0x3130('0x34')][_0x3130('0x3d')]);_0x346ecd[_0x3130('0x3e')]=qs['filters'](_[_0x3130('0x6a')](_0x5bfed0['query'],_0x3e1a98['filters']));_0x346ecd[_0x3130('0x3e')]=_['merge'](_0x346ecd[_0x3130('0x3e')],{'$or':[{'ListId':_0x120bf['id']},{'ListId':null}]});if(_0x5bfed0[_0x3130('0x34')][_0x3130('0x3f')]){_0x346ecd[_0x3130('0x3e')]=_[_0x3130('0x40')](_0x346ecd[_0x3130('0x3e')],{'$or':_[_0x3130('0x2f')](_0x346ecd[_0x3130('0x37')],function(_0x50cda6){var _0x10c181={};_0x10c181[_0x50cda6]={'$like':'%'+_0x5bfed0[_0x3130('0x34')][_0x3130('0x3f')]+'%'};return _0x10c181;})});}_0x346ecd=_['merge']({},_0x346ecd,_0x5bfed0['options']);return db[_0x3130('0x65')]['findAndCountAll'](_0x346ecd);}})[_0x3130('0x26')](respondWithResult(_0x41627e,null))[_0x3130('0x48')](handleError(_0x41627e,null));};exports[_0x3130('0x84')]=function(_0x1700b9,_0x3d745b,_0x584ec7){return db[_0x3130('0x42')][_0x3130('0x47')]({'where':{'id':_0x1700b9['params']['id']}})[_0x3130('0x26')](handleEntityNotFound(_0x3d745b,null))[_0x3130('0x26')](function(_0xd70762){if(_0xd70762){return _0xd70762[_0x3130('0x84')](_0x1700b9['body'][_0x3130('0x59')],_['omit'](_0x1700b9[_0x3130('0x4a')],['ids','id'])||{})[_0x3130('0x85')](function(_0x8dc920){for(var _0x279852=0x0;_0x279852<_0x1700b9[_0x3130('0x4a')]['ids'][_0x3130('0x3a')];_0x279852+=0x1){socket[_0x3130('0x86')](_0x3130('0x87'),{'UserId':Number(_0x1700b9[_0x3130('0x4a')]['ids'][_0x279852]),'CmListId':Number(_0x1700b9[_0x3130('0x45')]['id'])});}return _0x8dc920;});}})[_0x3130('0x26')](respondWithResult(_0x3d745b,null))[_0x3130('0x48')](handleError(_0x3d745b,null));};exports[_0x3130('0x88')]=function(_0x1b3aad,_0x1e7fb6,_0x441806){return db['CmList']['find']({'where':{'id':_0x1b3aad['params']['id']}})[_0x3130('0x26')](handleEntityNotFound(_0x1e7fb6,null))[_0x3130('0x26')](function(_0x3a1a38){if(_0x3a1a38){return _0x3a1a38[_0x3130('0x88')](_0x1b3aad['query'][_0x3130('0x59')])['then'](function(){if(_[_0x3130('0x5c')](_0x1b3aad[_0x3130('0x34')]['ids'])){for(var _0x34e35f=0x0;_0x34e35f<_0x1b3aad[_0x3130('0x34')][_0x3130('0x59')][_0x3130('0x3a')];_0x34e35f+=0x1){socket[_0x3130('0x86')](_0x3130('0x89'),{'UserId':Number(_0x1b3aad['query']['ids'][_0x34e35f]),'CmListId':Number(_0x1b3aad[_0x3130('0x45')]['id'])});}}else{socket[_0x3130('0x86')](_0x3130('0x89'),{'UserId':Number(_0x1b3aad[_0x3130('0x34')][_0x3130('0x59')]),'CmListId':Number(_0x1b3aad[_0x3130('0x45')]['id'])});}});}})[_0x3130('0x26')](respondWithStatusCode(_0x1e7fb6,null))[_0x3130('0x48')](handleError(_0x1e7fb6,null));};exports[_0x3130('0x8a')]=function(_0x48079b,_0x9668e8,_0xef8a90){var _0x283aac={};var _0x565ad5={};var _0x471d25;var _0x9e031b;return db[_0x3130('0x42')][_0x3130('0x75')]({'where':{'id':_0x48079b[_0x3130('0x45')]['id']}})[_0x3130('0x26')](handleEntityNotFound(_0x9668e8,null))[_0x3130('0x26')](function(_0x19060f){if(_0x19060f){_0x471d25=_0x19060f;_0x565ad5[_0x3130('0x33')]=_[_0x3130('0x35')](db[_0x3130('0x8b')][_0x3130('0x30')]);_0x565ad5[_0x3130('0x34')]=_[_0x3130('0x35')](_0x48079b[_0x3130('0x34')]);_0x565ad5['filters']=_[_0x3130('0x38')](_0x565ad5[_0x3130('0x33')],_0x565ad5['query']);_0x283aac[_0x3130('0x37')]=_[_0x3130('0x38')](_0x565ad5['model'],qs[_0x3130('0x39')](_0x48079b[_0x3130('0x34')]['fields']));_0x283aac[_0x3130('0x37')]=_0x283aac[_0x3130('0x37')][_0x3130('0x3a')]?_0x283aac[_0x3130('0x37')]:_0x565ad5[_0x3130('0x33')];_0x283aac[_0x3130('0x3c')]=qs[_0x3130('0x3d')](_0x48079b[_0x3130('0x34')][_0x3130('0x3d')]);_0x283aac['where']=qs['filters'](_[_0x3130('0x6a')](_0x48079b[_0x3130('0x34')],_0x565ad5[_0x3130('0x36')]));if(_0x48079b[_0x3130('0x34')][_0x3130('0x3f')]){_0x283aac[_0x3130('0x3e')]=_[_0x3130('0x40')](_0x283aac[_0x3130('0x3e')],{'$or':_[_0x3130('0x2f')](_0x283aac[_0x3130('0x37')],function(_0x9a6481){var _0x154ef3={};_0x154ef3[_0x9a6481]={'$like':'%'+_0x48079b[_0x3130('0x34')][_0x3130('0x3f')]+'%'};return _0x154ef3;})});}_0x283aac=_[_0x3130('0x40')]({},_0x283aac,_0x48079b[_0x3130('0x41')]);return _0x471d25[_0x3130('0x8a')](_0x283aac);}})[_0x3130('0x26')](function(_0x18fce0){if(_0x18fce0){_0x9e031b=_0x18fce0[_0x3130('0x3a')];if(!_0x48079b[_0x3130('0x34')][_0x3130('0x3b')]('nolimit')){_0x283aac[_0x3130('0x1f')]=qs[_0x3130('0x1f')](_0x48079b[_0x3130('0x34')][_0x3130('0x1f')]);_0x283aac[_0x3130('0x1d')]=qs[_0x3130('0x1d')](_0x48079b[_0x3130('0x34')]['offset']);}return _0x471d25['getAgents'](_0x283aac);}})[_0x3130('0x26')](function(_0x1582ae){if(_0x1582ae){return _0x1582ae?{'count':_0x9e031b,'rows':_0x1582ae}:null;}})['then'](respondWithResult(_0x9668e8,null))['catch'](handleError(_0x9668e8,null));};
\ No newline at end of file
index 14c9658..b7e32ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x26defd,_0x1f54bd){var _0x42d085=function(_0x4e5ae3){while(--_0x4e5ae3){_0x26defd['push'](_0x26defd['shift']());}};_0x42d085(++_0x1f54bd);}(_0x814b,0x1a2));var _0xb814=function(_0x287059,_0x499940){_0x287059=_0x287059-0x0;var _0x225c79=_0x814b[_0x287059];return _0x225c79;};'use strict';var EventEmitter=require(_0xb814('0x0'));var CmList=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xb814('0x3')](0x0);var events={'afterCreate':_0xb814('0x4'),'afterUpdate':_0xb814('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38c21a){return function(_0x3e1e9,_0x258866,_0x4237bc){CmListEvents[_0xb814('0x6')](_0x38c21a+':'+_0x3e1e9['id'],_0x3e1e9);CmListEvents[_0xb814('0x6')](_0x38c21a,_0x3e1e9);_0x4237bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xb814('0x7')](e,emitEvent(event));}}module[_0xb814('0x8')]=CmListEvents;
\ No newline at end of file
+var _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x19ad94,_0x3db153){var _0x572692=function(_0x5133b3){while(--_0x5133b3){_0x19ad94['push'](_0x19ad94['shift']());}};_0x572692(++_0x3db153);}(_0x814b,0x1a2));var _0xb814=function(_0x5a6644,_0x45d612){_0x5a6644=_0x5a6644-0x0;var _0x3a2a5d=_0x814b[_0x5a6644];return _0x3a2a5d;};'use strict';var EventEmitter=require(_0xb814('0x0'));var CmList=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xb814('0x3')](0x0);var events={'afterCreate':_0xb814('0x4'),'afterUpdate':_0xb814('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38c21a){return function(_0x3e1e9,_0x258866,_0x4237bc){CmListEvents[_0xb814('0x6')](_0x38c21a+':'+_0x3e1e9['id'],_0x3e1e9);CmListEvents[_0xb814('0x6')](_0x38c21a,_0x3e1e9);_0x4237bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xb814('0x7')](e,emitEvent(event));}}module[_0xb814('0x8')]=CmListEvents;
\ No newline at end of file
index 968c48b..b77dd46 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x750a=['path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','util','moment','bluebird','request-promise'];(function(_0x299d31,_0x317fd5){var _0x1c4be4=function(_0x509b2c){while(--_0x509b2c){_0x299d31['push'](_0x299d31['shift']());}};_0x1c4be4(++_0x317fd5);}(_0x750a,0x140));var _0xa750=function(_0x4dd6c5,_0x27658f){_0x4dd6c5=_0x4dd6c5-0x0;var _0xcd843f=_0x750a[_0x4dd6c5];return _0xcd843f;};'use strict';var _=require('lodash');var util=require(_0xa750('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xa750('0x1'));var BPromise=require(_0xa750('0x2'));var rp=require(_0xa750('0x3'));var fs=require('fs');var path=require(_0xa750('0x4'));var rimraf=require(_0xa750('0x5'));var config=require(_0xa750('0x6'));var attributes=require(_0xa750('0x7'));module[_0xa750('0x8')]=function(_0x10b4d9,_0x2497df){return _0x10b4d9[_0xa750('0x9')](_0xa750('0xa'),attributes,{'tableName':_0xa750('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x70e0=['cm_lists','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./cmList.attributes'];(function(_0x2f3d2b,_0x450c70){var _0x30e056=function(_0x156dc9){while(--_0x156dc9){_0x2f3d2b['push'](_0x2f3d2b['shift']());}};_0x30e056(++_0x450c70);}(_0x70e0,0x17b));var _0x070e=function(_0x51e15a,_0x72794e){_0x51e15a=_0x51e15a-0x0;var _0x527e73=_0x70e0[_0x51e15a];return _0x527e73;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('CmList',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ed2a6a7..fd56f1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe01b=['util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','defaults','redis','socket.io-emitter','register','request','info','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','CmList,\x20%s,\x20%s','message','result'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe01b,0x176));var _0xbe01=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0xe01b[_0xa8883];return _0x479426;};'use strict';var _=require('lodash');var util=require(_0xbe01('0x0'));var moment=require('moment');var BPromise=require(_0xbe01('0x1'));var rs=require(_0xbe01('0x2'));var fs=require('fs');var Redis=require(_0xbe01('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe01('0x4'));var logger=require('../../config/logger')(_0xbe01('0x5'));var config=require(_0xbe01('0x6'));var jayson=require(_0xbe01('0x7'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xbe01('0x8')](config[_0xbe01('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xbe01('0xa'))(new Redis(config[_0xbe01('0x9')]));require('./cmList.socket')[_0xbe01('0xb')](socket);function respondWithRpcPromise(_0x1f85b6,_0x262f65,_0x568c29){return new BPromise(function(_0x3293ec,_0xa9042){return client[_0xbe01('0xc')](_0x1f85b6,_0x568c29)['then'](function(_0x394f72){logger[_0xbe01('0xd')]('CmList,\x20%s,\x20%s',_0x262f65,_0xbe01('0xe'));logger[_0xbe01('0xf')](_0xbe01('0x10'),_0x262f65,_0xbe01('0xe'),JSON[_0xbe01('0x11')](_0x394f72));if(_0x394f72[_0xbe01('0x12')]){if(_0x394f72[_0xbe01('0x12')]['code']===0x1f4){logger[_0xbe01('0x12')](_0xbe01('0x13'),_0x262f65,_0x394f72[_0xbe01('0x12')]['message']);return _0xa9042(_0x394f72[_0xbe01('0x12')]['message']);}logger[_0xbe01('0x12')]('CmList,\x20%s,\x20%s',_0x262f65,_0x394f72['error']['message']);return _0x3293ec(_0x394f72[_0xbe01('0x12')][_0xbe01('0x14')]);}else{logger[_0xbe01('0xd')](_0xbe01('0x13'),_0x262f65,_0xbe01('0xe'));_0x3293ec(_0x394f72[_0xbe01('0x15')][_0xbe01('0x14')]);}})['catch'](function(_0x33e86c){logger['error']('CmList,\x20%s,\x20%s',_0x262f65,_0x33e86c);_0xa9042(_0x33e86c);});});}
\ No newline at end of file
+var _0x2dc3=['then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','request'];(function(_0x1c9215,_0x1b80ed){var _0x4ae013=function(_0x3742a3){while(--_0x3742a3){_0x1c9215['push'](_0x1c9215['shift']());}};_0x4ae013(++_0x1b80ed);}(_0x2dc3,0xb1));var _0x32dc=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x2dc3[_0x6131cd];return _0x47e916;};'use strict';var _=require('lodash');var util=require(_0x32dc('0x0'));var moment=require(_0x32dc('0x1'));var BPromise=require('bluebird');var rs=require(_0x32dc('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x32dc('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x32dc('0x4'))(_0x32dc('0x5'));var config=require('../../config/environment');var jayson=require(_0x32dc('0x6'));var client=jayson[_0x32dc('0x7')][_0x32dc('0x8')]({'port':0x232a});config[_0x32dc('0x9')]=_[_0x32dc('0xa')](config[_0x32dc('0x9')],{'host':_0x32dc('0xb'),'port':0x18eb});var socket=require(_0x32dc('0xc'))(new Redis(config[_0x32dc('0x9')]));require(_0x32dc('0xd'))['register'](socket);function respondWithRpcPromise(_0x42deea,_0x335c51,_0x333d76){return new BPromise(function(_0x48a43d,_0x50c4e5){return client[_0x32dc('0xe')](_0x42deea,_0x333d76)[_0x32dc('0xf')](function(_0xc97a61){logger[_0x32dc('0x10')](_0x32dc('0x11'),_0x335c51,_0x32dc('0x12'));logger[_0x32dc('0x13')]('CmList,\x20%s,\x20%s,\x20%s',_0x335c51,'request\x20sent',JSON[_0x32dc('0x14')](_0xc97a61));if(_0xc97a61['error']){if(_0xc97a61['error']['code']===0x1f4){logger[_0x32dc('0x15')](_0x32dc('0x11'),_0x335c51,_0xc97a61[_0x32dc('0x15')][_0x32dc('0x16')]);return _0x50c4e5(_0xc97a61[_0x32dc('0x15')]['message']);}logger[_0x32dc('0x15')](_0x32dc('0x11'),_0x335c51,_0xc97a61[_0x32dc('0x15')][_0x32dc('0x16')]);return _0x48a43d(_0xc97a61['error'][_0x32dc('0x16')]);}else{logger[_0x32dc('0x10')]('CmList,\x20%s,\x20%s',_0x335c51,'request\x20sent');_0x48a43d(_0xc97a61['result']['message']);}})[_0x32dc('0x17')](function(_0x3a7ab1){logger[_0x32dc('0x15')]('CmList,\x20%s,\x20%s',_0x335c51,_0x3a7ab1);_0x50c4e5(_0x3a7ab1);});});}
\ No newline at end of file
index eea7966..fab44fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa1a4=['length','cmList:','remove','update','emit','removeListener','register'];(function(_0x1ee351,_0x54261b){var _0x245aaf=function(_0x3e4b65){while(--_0x3e4b65){_0x1ee351['push'](_0x1ee351['shift']());}};_0x245aaf(++_0x54261b);}(_0xa1a4,0x198));var _0x4a1a=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xa1a4[_0x27af45];return _0x18df21;};'use strict';var CmListEvents=require('./cmList.events');var events=['save',_0x4a1a('0x0'),_0x4a1a('0x1')];function createListener(_0x5aed45,_0xc73703){return function(_0xaa5f86){_0xc73703[_0x4a1a('0x2')](_0x5aed45,_0xaa5f86);};}function removeListener(_0x335a32,_0x21b47f){return function(){CmListEvents[_0x4a1a('0x3')](_0x335a32,_0x21b47f);};}exports[_0x4a1a('0x4')]=function(_0x3922ab){for(var _0x51e8a2=0x0,_0x49f97b=events[_0x4a1a('0x5')];_0x51e8a2<_0x49f97b;_0x51e8a2++){var _0x2e879a=events[_0x51e8a2];var _0x4e419e=createListener(_0x4a1a('0x6')+_0x2e879a,_0x3922ab);CmListEvents['on'](_0x2e879a,_0x4e419e);}};
\ No newline at end of file
+var _0x4755=['cmList:','./cmList.events','remove','update','length'];(function(_0x45096e,_0x17e82d){var _0xba1fa3=function(_0x29f43c){while(--_0x29f43c){_0x45096e['push'](_0x45096e['shift']());}};_0xba1fa3(++_0x17e82d);}(_0x4755,0x11e));var _0x5475=function(_0x5d8631,_0x44944b){_0x5d8631=_0x5d8631-0x0;var _0x34c15e=_0x4755[_0x5d8631];return _0x34c15e;};'use strict';var CmListEvents=require(_0x5475('0x0'));var events=['save',_0x5475('0x1'),_0x5475('0x2')];function createListener(_0x3bc4b9,_0x2b5886){return function(_0x1d1df9){_0x2b5886['emit'](_0x3bc4b9,_0x1d1df9);};}function removeListener(_0x236017,_0x3a918a){return function(){CmListEvents['removeListener'](_0x236017,_0x3a918a);};}exports['register']=function(_0x31799){for(var _0x5522ac=0x0,_0x299c9a=events[_0x5475('0x3')];_0x5522ac<_0x299c9a;_0x5522ac++){var _0x2b428f=events[_0x5522ac];var _0x10adb7=createListener(_0x5475('0x4')+_0x2b428f,_0x31799);CmListEvents['on'](_0x2b428f,_0x10adb7);}};
\ No newline at end of file
index 990077e..8be004f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5628=['addDisposition','addContacts','/:id/users','addAgents','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','post'];(function(_0x556927,_0x34b53f){var _0x5f1235=function(_0x4f4e44){while(--_0x4f4e44){_0x556927['push'](_0x556927['shift']());}};_0x5f1235(++_0x34b53f);}(_0x5628,0x1e9));var _0x8562=function(_0x3a159c,_0x339b12){_0x3a159c=_0x3a159c-0x0;var _0x40ef5d=_0x5628[_0x3a159c];return _0x40ef5d;};'use strict';var multer=require(_0x8562('0x0'));var util=require(_0x8562('0x1'));var path=require(_0x8562('0x2'));var timeout=require(_0x8562('0x3'));var express=require('express');var router=express[_0x8562('0x4')]();var fs_extra=require(_0x8562('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8562('0x6'));var controller=require('./cmList.controller');router[_0x8562('0x7')]('/',auth[_0x8562('0x8')](),controller[_0x8562('0x9')]);router[_0x8562('0x7')](_0x8562('0xa'),auth['isAuthenticated'](),controller[_0x8562('0xb')]);router[_0x8562('0x7')](_0x8562('0xc'),auth[_0x8562('0x8')](),controller['show']);router[_0x8562('0x7')](_0x8562('0xd'),auth[_0x8562('0x8')](),controller[_0x8562('0xe')]);router[_0x8562('0x7')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x8562('0xf')]);router[_0x8562('0x7')](_0x8562('0x10'),auth['isAuthenticated'](),controller[_0x8562('0x11')]);router[_0x8562('0x7')](_0x8562('0x12'),auth['isAuthenticated'](),controller[_0x8562('0x13')]);router[_0x8562('0x7')]('/:id/users',auth[_0x8562('0x8')](),controller['getAgents']);router[_0x8562('0x14')]('/',auth[_0x8562('0x8')](),controller['create']);router[_0x8562('0x14')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x8562('0x15')]);router[_0x8562('0x14')]('/:id/contacts',auth[_0x8562('0x8')](),controller[_0x8562('0x16')]);router['post'](_0x8562('0x12'),auth[_0x8562('0x8')](),controller['addCustomField']);router[_0x8562('0x14')](_0x8562('0x17'),auth['isAuthenticated'](),controller[_0x8562('0x18')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x8562('0x19')]);router[_0x8562('0x1a')](_0x8562('0xc'),auth[_0x8562('0x8')](),controller[_0x8562('0x1b')]);router['delete']('/:id/dispositions',auth[_0x8562('0x8')](),controller['removeDispositions']);router[_0x8562('0x1a')](_0x8562('0x17'),auth[_0x8562('0x8')](),controller[_0x8562('0x1c')]);module[_0x8562('0x1d')]=router;
\ No newline at end of file
+var _0x86ae=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','show','/:id/dispositions','getDispositions','getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addDisposition','/:id/contacts','addCustomField','addAgents','put','/:id','destroy','delete','removeAgents'];(function(_0x9adcd6,_0x36278b){var _0xdf8ff2=function(_0x4f7087){while(--_0x4f7087){_0x9adcd6['push'](_0x9adcd6['shift']());}};_0xdf8ff2(++_0x36278b);}(_0x86ae,0x160));var _0xe86a=function(_0xbb02a6,_0x2b3f2c){_0xbb02a6=_0xbb02a6-0x0;var _0x4d7739=_0x86ae[_0xbb02a6];return _0x4d7739;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe86a('0x0'));var timeout=require(_0xe86a('0x1'));var express=require(_0xe86a('0x2'));var router=express['Router']();var fs_extra=require(_0xe86a('0x3'));var auth=require(_0xe86a('0x4'));var interaction=require(_0xe86a('0x5'));var config=require(_0xe86a('0x6'));var controller=require(_0xe86a('0x7'));router[_0xe86a('0x8')]('/',auth[_0xe86a('0x9')](),controller[_0xe86a('0xa')]);router[_0xe86a('0x8')](_0xe86a('0xb'),auth[_0xe86a('0x9')](),controller['describe']);router[_0xe86a('0x8')]('/:id',auth[_0xe86a('0x9')](),controller[_0xe86a('0xc')]);router[_0xe86a('0x8')](_0xe86a('0xd'),auth[_0xe86a('0x9')](),controller[_0xe86a('0xe')]);router[_0xe86a('0x8')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xe86a('0xf')]);router['get'](_0xe86a('0x10'),auth[_0xe86a('0x9')](),controller['getContactsCsv']);router['get'](_0xe86a('0x11'),auth[_0xe86a('0x9')](),controller[_0xe86a('0x12')]);router[_0xe86a('0x8')](_0xe86a('0x13'),auth['isAuthenticated'](),controller[_0xe86a('0x14')]);router[_0xe86a('0x15')]('/',auth[_0xe86a('0x9')](),controller[_0xe86a('0x16')]);router[_0xe86a('0x15')](_0xe86a('0xd'),auth['isAuthenticated'](),controller[_0xe86a('0x17')]);router[_0xe86a('0x15')](_0xe86a('0x18'),auth[_0xe86a('0x9')](),controller['addContacts']);router[_0xe86a('0x15')](_0xe86a('0x11'),auth[_0xe86a('0x9')](),controller[_0xe86a('0x19')]);router['post'](_0xe86a('0x13'),auth[_0xe86a('0x9')](),controller[_0xe86a('0x1a')]);router[_0xe86a('0x1b')](_0xe86a('0x1c'),auth[_0xe86a('0x9')](),controller['update']);router['delete']('/:id',auth[_0xe86a('0x9')](),controller[_0xe86a('0x1d')]);router[_0xe86a('0x1e')](_0xe86a('0xd'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0xe86a('0x1e')](_0xe86a('0x13'),auth['isAuthenticated'](),controller[_0xe86a('0x1f')]);module['exports']=router;
\ No newline at end of file
index f2c4d38..9a7b061 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc184=['STRING','sequelize','exports','VIRTUAL'];(function(_0x5c72ee,_0x5a8bf8){var _0x231876=function(_0x955276){while(--_0x955276){_0x5c72ee['push'](_0x5c72ee['shift']());}};_0x231876(++_0x5a8bf8);}(_0xc184,0x89));var _0x4c18=function(_0x57966a,_0x477964){_0x57966a=_0x57966a-0x0;var _0x191765=_0xc184[_0x57966a];return _0x191765;};'use strict';var Sequelize=require(_0x4c18('0x0'));module[_0x4c18('0x1')]={'name':{'type':Sequelize[_0x4c18('0x2')],'get':function(_0x372374){return this['getDataValue']('field');}},'field':{'type':Sequelize[_0x4c18('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0x4c18('0x3')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0x01ab=['VIRTUAL','field','STRING','sequelize','exports'];(function(_0x2e71ba,_0x4e04f4){var _0x4715d4=function(_0x33c8be){while(--_0x33c8be){_0x2e71ba['push'](_0x2e71ba['shift']());}};_0x4715d4(++_0x4e04f4);}(_0x01ab,0x148));var _0xb01a=function(_0x2f023d,_0x29dfe5){_0x2f023d=_0x2f023d-0x0;var _0x4ef240=_0x01ab[_0x2f023d];return _0x4ef240;};'use strict';var Sequelize=require(_0xb01a('0x0'));module[_0xb01a('0x1')]={'name':{'type':Sequelize[_0xb01a('0x2')],'get':function(_0x16c217){return this['getDataValue'](_0xb01a('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0xb01a('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0xb01a('0x4')],'allowNull':![]}};
\ No newline at end of file
index d7deded..ecef22d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x5bde19,_0x1107d0){var _0x5e598b=function(_0x1d1ccd){while(--_0x1d1ccd){_0x5bde19['push'](_0x5bde19['shift']());}};_0x5e598b(++_0x1107d0);}(_0x7a54,0x106));var _0x47a5=function(_0x24ed0c,_0x37ca52){_0x24ed0c=_0x24ed0c-0x0;var _0x3014ef=_0x7a54[_0x24ed0c];return _0x3014ef;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));};
\ No newline at end of file
+var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x150ad3,_0x5b1042){var _0x51c0d7=function(_0x469c99){while(--_0x469c99){_0x150ad3['push'](_0x150ad3['shift']());}};_0x51c0d7(++_0x5b1042);}(_0x7a54,0x106));var _0x47a5=function(_0x4ae3da,_0x2b99aa){_0x4ae3da=_0x4ae3da-0x0;var _0x4803c1=_0x7a54[_0x4ae3da];return _0x4803c1;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));};
\ No newline at end of file
index c1d9aa7..b545a1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e00=['define','Condition','tools_conditions','lodash','util','../../config/logger','api','moment','bluebird','path','./condition.attributes','exports'];(function(_0x3371a0,_0x362893){var _0x41b811=function(_0x3e3f11){while(--_0x3e3f11){_0x3371a0['push'](_0x3371a0['shift']());}};_0x41b811(++_0x362893);}(_0x9e00,0x1ef));var _0x09e0=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9e00[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x09e0('0x0'));var util=require(_0x09e0('0x1'));var logger=require(_0x09e0('0x2'))(_0x09e0('0x3'));var moment=require(_0x09e0('0x4'));var BPromise=require(_0x09e0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x09e0('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x09e0('0x7'));module[_0x09e0('0x8')]=function(_0x54bf8c,_0x32beea){return _0x54bf8c[_0x09e0('0x9')](_0x09e0('0xa'),attributes,{'tableName':_0x09e0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x10c3=['api','moment','request-promise','path','rimraf','../../config/environment','./condition.attributes','exports','define','Condition','util','../../config/logger'];(function(_0x133345,_0x4a78b1){var _0x51f3d2=function(_0x374e6e){while(--_0x374e6e){_0x133345['push'](_0x133345['shift']());}};_0x51f3d2(++_0x4a78b1);}(_0x10c3,0x11e));var _0x310c=function(_0x179a68,_0x3c37ab){_0x179a68=_0x179a68-0x0;var _0x3519f4=_0x10c3[_0x179a68];return _0x3519f4;};'use strict';var _=require('lodash');var util=require(_0x310c('0x0'));var logger=require(_0x310c('0x1'))(_0x310c('0x2'));var moment=require(_0x310c('0x3'));var BPromise=require('bluebird');var rp=require(_0x310c('0x4'));var fs=require('fs');var path=require(_0x310c('0x5'));var rimraf=require(_0x310c('0x6'));var config=require(_0x310c('0x7'));var attributes=require(_0x310c('0x8'));module[_0x310c('0x9')]=function(_0x2ed13e,_0x6954ef){return _0x2ed13e[_0x310c('0xa')](_0x310c('0xb'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c1d2e9e..c71e185 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc686=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','debug','request\x20sent','stringify','error','code','Condition,\x20%s,\x20%s','message','result','catch','util','moment','bluebird'];(function(_0x761b6d,_0x7c7fa8){var _0x3a1639=function(_0x33b90a){while(--_0x33b90a){_0x761b6d['push'](_0x761b6d['shift']());}};_0x3a1639(++_0x7c7fa8);}(_0xc686,0x1c9));var _0x6c68=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xc686[_0x5b561d];return _0x431060;};'use strict';var _=require('lodash');var util=require(_0x6c68('0x0'));var moment=require(_0x6c68('0x1'));var BPromise=require(_0x6c68('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6c68('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6c68('0x4'))('rpc');var config=require(_0x6c68('0x5'));var jayson=require(_0x6c68('0x6'));var client=jayson[_0x6c68('0x7')][_0x6c68('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xadc5ab,_0x38b38e,_0x15ea2d){return new BPromise(function(_0x1bad4c,_0x2d14f9){return client['request'](_0xadc5ab,_0x15ea2d)[_0x6c68('0x9')](function(_0x397d6d){logger[_0x6c68('0xa')]('Condition,\x20%s,\x20%s',_0x38b38e,'request\x20sent');logger[_0x6c68('0xb')]('Condition,\x20%s,\x20%s,\x20%s',_0x38b38e,_0x6c68('0xc'),JSON[_0x6c68('0xd')](_0x397d6d));if(_0x397d6d[_0x6c68('0xe')]){if(_0x397d6d[_0x6c68('0xe')][_0x6c68('0xf')]===0x1f4){logger['error'](_0x6c68('0x10'),_0x38b38e,_0x397d6d[_0x6c68('0xe')]['message']);return _0x2d14f9(_0x397d6d[_0x6c68('0xe')][_0x6c68('0x11')]);}logger['error'](_0x6c68('0x10'),_0x38b38e,_0x397d6d['error'][_0x6c68('0x11')]);return _0x1bad4c(_0x397d6d[_0x6c68('0xe')][_0x6c68('0x11')]);}else{logger[_0x6c68('0xa')](_0x6c68('0x10'),_0x38b38e,_0x6c68('0xc'));_0x1bad4c(_0x397d6d[_0x6c68('0x12')][_0x6c68('0x11')]);}})[_0x6c68('0x13')](function(_0x24530e){logger['error']('Condition,\x20%s,\x20%s',_0x38b38e,_0x24530e);_0x2d14f9(_0x24530e);});});}
\ No newline at end of file
+var _0xcda5=['stringify','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s'];(function(_0x1b00b1,_0x540a3a){var _0x3b614e=function(_0x2a44d6){while(--_0x2a44d6){_0x1b00b1['push'](_0x1b00b1['shift']());}};_0x3b614e(++_0x540a3a);}(_0xcda5,0x10c));var _0x5cda=function(_0x21aa61,_0x30677c){_0x21aa61=_0x21aa61-0x0;var _0x560e00=_0xcda5[_0x21aa61];return _0x560e00;};'use strict';var _=require('lodash');var util=require(_0x5cda('0x0'));var moment=require(_0x5cda('0x1'));var BPromise=require(_0x5cda('0x2'));var rs=require(_0x5cda('0x3'));var fs=require('fs');var Redis=require(_0x5cda('0x4'));var db=require(_0x5cda('0x5'))['db'];var utils=require(_0x5cda('0x6'));var logger=require(_0x5cda('0x7'))(_0x5cda('0x8'));var config=require(_0x5cda('0x9'));var jayson=require(_0x5cda('0xa'));var client=jayson[_0x5cda('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13c9fd,_0x2b0704,_0x4b762c){return new BPromise(function(_0x87625d,_0xee1ee1){return client[_0x5cda('0xc')](_0x13c9fd,_0x4b762c)['then'](function(_0x4b88b3){logger[_0x5cda('0xd')](_0x5cda('0xe'),_0x2b0704,_0x5cda('0xf'));logger[_0x5cda('0x10')](_0x5cda('0x11'),_0x2b0704,_0x5cda('0xf'),JSON[_0x5cda('0x12')](_0x4b88b3));if(_0x4b88b3[_0x5cda('0x13')]){if(_0x4b88b3[_0x5cda('0x13')][_0x5cda('0x14')]===0x1f4){logger[_0x5cda('0x13')](_0x5cda('0xe'),_0x2b0704,_0x4b88b3[_0x5cda('0x13')][_0x5cda('0x15')]);return _0xee1ee1(_0x4b88b3[_0x5cda('0x13')][_0x5cda('0x15')]);}logger['error'](_0x5cda('0xe'),_0x2b0704,_0x4b88b3[_0x5cda('0x13')][_0x5cda('0x15')]);return _0x87625d(_0x4b88b3[_0x5cda('0x13')][_0x5cda('0x15')]);}else{logger['info']('Condition,\x20%s,\x20%s',_0x2b0704,_0x5cda('0xf'));_0x87625d(_0x4b88b3['result'][_0x5cda('0x15')]);}})['catch'](function(_0x3786c9){logger[_0x5cda('0x13')](_0x5cda('0xe'),_0x2b0704,_0x3786c9);_0xee1ee1(_0x3786c9);});});}
\ No newline at end of file
index 387e882..bc5add7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf22=['/:id','isAuthenticated','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./condition.controller','put'];(function(_0x43b1c7,_0x5ca4c4){var _0x2a927f=function(_0x1f8351){while(--_0x1f8351){_0x43b1c7['push'](_0x43b1c7['shift']());}};_0x2a927f(++_0x5ca4c4);}(_0xdf22,0x155));var _0x2df2=function(_0xa7a8ff,_0x2f9864){_0xa7a8ff=_0xa7a8ff-0x0;var _0x58f4ee=_0xdf22[_0xa7a8ff];return _0x58f4ee;};'use strict';var multer=require(_0x2df2('0x0'));var util=require(_0x2df2('0x1'));var path=require(_0x2df2('0x2'));var timeout=require(_0x2df2('0x3'));var express=require(_0x2df2('0x4'));var router=express['Router']();var fs_extra=require(_0x2df2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2df2('0x6'));var config=require('../../config/environment');var controller=require(_0x2df2('0x7'));router[_0x2df2('0x8')](_0x2df2('0x9'),auth[_0x2df2('0xa')](),controller[_0x2df2('0xb')]);router['delete'](_0x2df2('0x9'),auth[_0x2df2('0xa')](),controller[_0x2df2('0xc')]);module[_0x2df2('0xd')]=router;
\ No newline at end of file
+var _0x21db=['/:id','isAuthenticated','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./condition.controller','put'];(function(_0x1c3297,_0xfc395e){var _0x29e4ae=function(_0x1bfcd9){while(--_0x1bfcd9){_0x1c3297['push'](_0x1c3297['shift']());}};_0x29e4ae(++_0xfc395e);}(_0x21db,0x1e4));var _0xb21d=function(_0x2feb24,_0x4ba759){_0x2feb24=_0x2feb24-0x0;var _0x50b1e4=_0x21db[_0x2feb24];return _0x50b1e4;};'use strict';var multer=require(_0xb21d('0x0'));var util=require(_0xb21d('0x1'));var path=require(_0xb21d('0x2'));var timeout=require(_0xb21d('0x3'));var express=require(_0xb21d('0x4'));var router=express['Router']();var fs_extra=require(_0xb21d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb21d('0x6'));var config=require(_0xb21d('0x7'));var controller=require(_0xb21d('0x8'));router[_0xb21d('0x9')](_0xb21d('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xb21d('0xa'),auth[_0xb21d('0xb')](),controller[_0xb21d('0xc')]);module['exports']=router;
\ No newline at end of file
index f2e6db0..17b782b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['name','sequelize','STRING'];(function(_0x56bf5c,_0x3a49a6){var _0x4e16b2=function(_0x19df67){while(--_0x19df67){_0x56bf5c['push'](_0x56bf5c['shift']());}};_0x4e16b2(++_0x3a49a6);}(_0xb10b,0x12a));var _0xbb10=function(_0x17eec6,_0x54a955){_0x17eec6=_0x17eec6-0x0;var _0x1e4d32=_0xb10b[_0x17eec6];return _0x1e4d32;};'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 _0x0713=['STRING','name'];(function(_0x40b134,_0x140aaa){var _0x405124=function(_0x25c62a){while(--_0x25c62a){_0x40b134['push'](_0x40b134['shift']());}};_0x405124(++_0x140aaa);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}};
\ No newline at end of file
index e8a9ce1..f3b7a3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x10f1=['nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','merge','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','rawAttributes','omit','createdAt','updatedAt','user','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','attrOpenchannelAccounts','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardItem','getItems','findOne','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./dashboard.socket','register','status','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','get','CustomDashboards','UserProfileResource','end','error','stack','name','send','map','Dashboard','fieldName','key','keys','filters','model','query','intersection','fields','attributes','hasOwnProperty'];(function(_0x3068d7,_0x4b8fcd){var _0x534202=function(_0x3b6f95){while(--_0x3b6f95){_0x3068d7['push'](_0x3068d7['shift']());}};_0x534202(++_0x4b8fcd);}(_0x10f1,0x1c7));var _0x110f=function(_0xe348d6,_0x11a06a){_0xe348d6=_0xe348d6-0x0;var _0x57a7ff=_0x10f1[_0xe348d6];return _0x57a7ff;};'use strict';var emlformat=require(_0x110f('0x0'));var rimraf=require(_0x110f('0x1'));var zipdir=require(_0x110f('0x2'));var jsonpatch=require(_0x110f('0x3'));var rp=require('request-promise');var moment=require(_0x110f('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x110f('0x5'));var path=require('path');var sox=require(_0x110f('0x6'));var csv=require(_0x110f('0x7'));var ejs=require(_0x110f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x110f('0x9'));var squel=require(_0x110f('0xa'));var crypto=require(_0x110f('0xb'));var jsforce=require(_0x110f('0xc'));var deskjs=require(_0x110f('0xd'));var toCsv=require(_0x110f('0x7'));var querystring=require(_0x110f('0xe'));var Papa=require(_0x110f('0xf'));var Redis=require(_0x110f('0x10'));var authService=require(_0x110f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x110f('0x12'));var hardwareService=require(_0x110f('0x13'));var logger=require('../../config/logger')(_0x110f('0x14'));var utils=require(_0x110f('0x15'));var config=require(_0x110f('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x110f('0x17')](config[_0x110f('0x18')],{'host':_0x110f('0x19'),'port':0x18eb});var socket=require(_0x110f('0x1a'))(new Redis(config[_0x110f('0x18')]));require(_0x110f('0x1b'))[_0x110f('0x1c')](socket);function respondWithStatusCode(_0x39a11b,_0x51d5b5){_0x51d5b5=_0x51d5b5||0xcc;return function(_0x98ffdd){if(_0x98ffdd){return _0x39a11b['sendStatus'](_0x51d5b5);}return _0x39a11b[_0x110f('0x1d')](_0x51d5b5)['end']();};}function respondWithResult(_0x4df778,_0x218ee3){_0x218ee3=_0x218ee3||0xc8;return function(_0x581a7d){if(_0x581a7d){return _0x4df778[_0x110f('0x1d')](_0x218ee3)['json'](_0x581a7d);}};}function respondWithFilteredResult(_0x48c297,_0x5c4a8a){return function(_0x26b019){if(_0x26b019){var _0x1f3a1e=typeof _0x5c4a8a[_0x110f('0x1e')]===_0x110f('0x1f')&&typeof _0x5c4a8a[_0x110f('0x20')]==='undefined';var _0x1d5fd5=_0x26b019[_0x110f('0x21')];var _0x4d37d0=_0x1f3a1e?0x0:_0x5c4a8a[_0x110f('0x1e')];var _0x1cb13b=_0x1f3a1e?_0x26b019['count']:_0x5c4a8a['offset']+_0x5c4a8a[_0x110f('0x20')];var _0x503b79;if(_0x1cb13b>=_0x1d5fd5){_0x1cb13b=_0x1d5fd5;_0x503b79=0xc8;}else{_0x503b79=0xce;}_0x48c297[_0x110f('0x1d')](_0x503b79);return _0x48c297[_0x110f('0x22')](_0x110f('0x23'),_0x4d37d0+'-'+_0x1cb13b+'/'+_0x1d5fd5)['json'](_0x26b019);}return null;};}function patchUpdates(_0x38b0b6){return function(_0x270458){try{jsonpatch[_0x110f('0x24')](_0x270458,_0x38b0b6,!![]);}catch(_0x7d06d4){return BPromise['reject'](_0x7d06d4);}return _0x270458[_0x110f('0x25')]();};}function saveUpdates(_0x3b28cd,_0x50e935){return function(_0x1edfd4){if(_0x1edfd4){return _0x1edfd4[_0x110f('0x26')](_0x3b28cd)['then'](function(_0x3d6680){return _0x3d6680;});}return null;};}function removeEntity(_0x26e722,_0x30bbdc){return function(_0x341dd4){if(_0x341dd4){return _0x341dd4[_0x110f('0x27')]()[_0x110f('0x28')](function(){var _0xfa3753=_0x341dd4[_0x110f('0x29')]({'plain':!![]});var _0x5d3037=_0x110f('0x2a');return db[_0x110f('0x2b')][_0x110f('0x27')]({'where':{'type':_0x5d3037,'resourceId':_0xfa3753['id']}})[_0x110f('0x28')](function(){return _0x341dd4;});})[_0x110f('0x28')](function(){_0x26e722[_0x110f('0x1d')](0xcc)[_0x110f('0x2c')]();});}};}function handleEntityNotFound(_0xb935a0,_0x4bb206){return function(_0x569e44){if(!_0x569e44){_0xb935a0['sendStatus'](0x194);}return _0x569e44;};}function handleError(_0x22a636,_0x3ddeda){_0x3ddeda=_0x3ddeda||0x1f4;return function(_0x51ad15){logger[_0x110f('0x2d')](_0x51ad15[_0x110f('0x2e')]);if(_0x51ad15[_0x110f('0x2f')]){delete _0x51ad15[_0x110f('0x2f')];}_0x22a636['status'](_0x3ddeda)[_0x110f('0x30')](_0x51ad15);};}exports['index']=function(_0x6295f3,_0x17e19a){var _0x18c417={},_0x4f7260={},_0x26dbe2={'count':0x0,'rows':[]};var _0x1b41e6=_[_0x110f('0x31')](db[_0x110f('0x32')]['rawAttributes'],function(_0x2db8bb){return{'name':_0x2db8bb[_0x110f('0x33')],'type':_0x2db8bb['type'][_0x110f('0x34')]};});_0x4f7260['model']=_[_0x110f('0x31')](_0x1b41e6,_0x110f('0x2f'));_0x4f7260['query']=_[_0x110f('0x35')](_0x6295f3['query']);_0x4f7260[_0x110f('0x36')]=_['intersection'](_0x4f7260[_0x110f('0x37')],_0x4f7260[_0x110f('0x38')]);_0x18c417['attributes']=_[_0x110f('0x39')](_0x4f7260[_0x110f('0x37')],qs[_0x110f('0x3a')](_0x6295f3['query'][_0x110f('0x3a')]));_0x18c417[_0x110f('0x3b')]=_0x18c417[_0x110f('0x3b')]['length']?_0x18c417['attributes']:_0x4f7260[_0x110f('0x37')];if(!_0x6295f3['query'][_0x110f('0x3c')](_0x110f('0x3d'))){_0x18c417[_0x110f('0x20')]=qs[_0x110f('0x20')](_0x6295f3['query'][_0x110f('0x20')]);_0x18c417[_0x110f('0x1e')]=qs[_0x110f('0x1e')](_0x6295f3['query']['offset']);}_0x18c417[_0x110f('0x3e')]=qs['sort'](_0x6295f3['query'][_0x110f('0x3f')]);_0x18c417[_0x110f('0x40')]=qs[_0x110f('0x36')](_[_0x110f('0x41')](_0x6295f3[_0x110f('0x38')],_0x4f7260[_0x110f('0x36')]),_0x1b41e6);if(_0x6295f3[_0x110f('0x38')][_0x110f('0x42')]){_0x18c417[_0x110f('0x40')]=_['merge'](_0x18c417[_0x110f('0x40')],{'$or':_[_0x110f('0x31')](_0x1b41e6,function(_0xee7537){if(_0xee7537[_0x110f('0x43')]!==_0x110f('0x44')){var _0x587e8e={};_0x587e8e[_0xee7537[_0x110f('0x2f')]]={'$like':'%'+_0x6295f3['query'][_0x110f('0x42')]+'%'};return _0x587e8e;}})});}_0x18c417=_['merge']({},_0x18c417,_0x6295f3[_0x110f('0x45')]);var _0x41a403={'where':_0x18c417[_0x110f('0x40')]};return db[_0x110f('0x32')][_0x110f('0x21')](_0x41a403)['then'](function(_0x10b38f){_0x26dbe2[_0x110f('0x21')]=_0x10b38f;if(_0x6295f3[_0x110f('0x38')][_0x110f('0x46')]){_0x18c417['include']=[{'all':!![]}];}return db[_0x110f('0x32')][_0x110f('0x47')](_0x18c417);})[_0x110f('0x28')](function(_0x4dd53f){_0x26dbe2[_0x110f('0x48')]=_0x4dd53f;return _0x26dbe2;})[_0x110f('0x28')](respondWithFilteredResult(_0x17e19a,_0x18c417))[_0x110f('0x49')](handleError(_0x17e19a,null));};exports[_0x110f('0x4a')]=function(_0x1ce17a,_0x543a22){var _0x579df4={'raw':![],'where':{'id':_0x1ce17a[_0x110f('0x4b')]['id']}},_0x2e8a1c={};_0x2e8a1c[_0x110f('0x37')]=_[_0x110f('0x35')](db['Dashboard']['rawAttributes']);_0x2e8a1c[_0x110f('0x38')]=_[_0x110f('0x35')](_0x1ce17a['query']);_0x2e8a1c[_0x110f('0x36')]=_[_0x110f('0x39')](_0x2e8a1c[_0x110f('0x37')],_0x2e8a1c[_0x110f('0x38')]);_0x579df4['attributes']=_[_0x110f('0x39')](_0x2e8a1c['model'],qs['fields'](_0x1ce17a[_0x110f('0x38')][_0x110f('0x3a')]));_0x579df4[_0x110f('0x3b')]=_0x579df4['attributes'][_0x110f('0x4c')]?_0x579df4[_0x110f('0x3b')]:_0x2e8a1c[_0x110f('0x37')];if(_0x1ce17a[_0x110f('0x38')]['includeAll']){_0x579df4[_0x110f('0x4d')]=[{'all':!![]}];}_0x579df4=_[_0x110f('0x4e')]({},_0x579df4,_0x1ce17a['options']);return db[_0x110f('0x32')][_0x110f('0x4f')](_0x579df4)[_0x110f('0x28')](handleEntityNotFound(_0x543a22,null))[_0x110f('0x28')](respondWithResult(_0x543a22,null))[_0x110f('0x49')](handleError(_0x543a22,null));};exports[_0x110f('0x50')]=function(_0x29ea90,_0x103137){return db['Dashboard'][_0x110f('0x50')](_0x29ea90[_0x110f('0x51')],{})[_0x110f('0x28')](function(_0x27213a){var _0x3d014f=_0x29ea90['user'][_0x110f('0x29')]({'plain':!![]});if(!_0x3d014f)throw new Error(_0x110f('0x52'));if(_0x3d014f[_0x110f('0x53')]==='user'){var _0xc7851a=_0x27213a[_0x110f('0x29')]({'plain':!![]});var _0x299acb='CustomDashboards';return db[_0x110f('0x54')][_0x110f('0x4f')]({'where':{'name':_0x299acb,'userProfileId':_0x3d014f[_0x110f('0x55')]},'raw':!![]})['then'](function(_0x594310){if(_0x594310&&_0x594310[_0x110f('0x56')]===0x0){return db[_0x110f('0x2b')][_0x110f('0x50')]({'name':_0xc7851a['name'],'resourceId':_0xc7851a['id'],'type':_0x594310['name'],'sectionId':_0x594310['id']},{})[_0x110f('0x28')](function(){return _0x27213a;});}else{return _0x27213a;}})[_0x110f('0x49')](function(_0x23e600){logger[_0x110f('0x2d')](_0x110f('0x57'),_0x23e600);throw _0x23e600;});}return _0x27213a;})[_0x110f('0x28')](respondWithResult(_0x103137,0xc9))[_0x110f('0x49')](handleError(_0x103137,null));};exports[_0x110f('0x58')]=function(_0x21c36b,_0x404e2a){var _0x2f43ee={'where':{'id':_0x21c36b[_0x110f('0x4b')]['id']}},_0x43cf5b={};_0x43cf5b[_0x110f('0x37')]=_[_0x110f('0x35')](db[_0x110f('0x32')][_0x110f('0x59')]);_0x2f43ee[_0x110f('0x3b')]=_['intersection'](_0x43cf5b[_0x110f('0x37')],qs[_0x110f('0x3a')](_0x21c36b[_0x110f('0x38')][_0x110f('0x3a')]));_0x2f43ee[_0x110f('0x3b')]=_0x2f43ee[_0x110f('0x3b')][_0x110f('0x4c')]?_0x2f43ee[_0x110f('0x3b')]:_0x43cf5b['model'];if(_0x21c36b[_0x110f('0x38')][_0x110f('0x46')]){_0x2f43ee[_0x110f('0x4d')]=[{'all':!![]}];}_0x2f43ee=_[_0x110f('0x4e')]({},_0x2f43ee,_0x21c36b[_0x110f('0x45')]);return db['Dashboard'][_0x110f('0x4f')](_0x2f43ee)[_0x110f('0x28')](handleEntityNotFound(_0x404e2a,null))[_0x110f('0x28')](function(_0x48e4d6){if(_0x48e4d6){var _0x28ba4e=_0x48e4d6[_0x110f('0x29')]({'plain':!![]});_0x28ba4e=qs[_0x110f('0x5a')](_0x28ba4e,['id',_0x110f('0x5b'),_0x110f('0x5c')]);_0x21c36b[_0x110f('0x51')]=_[_0x110f('0x5a')](_0x21c36b['body'],['id',_0x110f('0x5b'),_0x110f('0x5c')]);return db['Dashboard'][_0x110f('0x50')](_[_0x110f('0x4e')](_0x28ba4e,_0x21c36b[_0x110f('0x51')]),{'include':_0x21c36b['query'][_0x110f('0x46')]?[{'all':!![]}]:undefined})[_0x110f('0x28')](function(_0x4e619f){var _0x399efd=_0x21c36b[_0x110f('0x5d')][_0x110f('0x29')]({'plain':!![]});if(!_0x399efd)throw new Error(_0x110f('0x52'));if(_0x399efd['role']===_0x110f('0x5d')){var _0x3b99cd=_0x4e619f[_0x110f('0x29')]({'plain':!![]});var _0x13cd04=_0x110f('0x2a');return db[_0x110f('0x54')]['find']({'where':{'name':_0x13cd04,'userProfileId':_0x399efd[_0x110f('0x55')]},'raw':!![]})['then'](function(_0x430522){if(_0x430522&&_0x430522['autoAssociation']===0x0){return db['UserProfileResource'][_0x110f('0x50')]({'name':_0x3b99cd[_0x110f('0x2f')],'resourceId':_0x3b99cd['id'],'type':_0x430522[_0x110f('0x2f')],'sectionId':_0x430522['id']},{})['then'](function(){return _0x4e619f;});}else{return _0x4e619f;}})[_0x110f('0x49')](function(_0xaa72e4){logger[_0x110f('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xaa72e4);throw _0xaa72e4;});}return _0x4e619f;});}})[_0x110f('0x28')](respondWithResult(_0x404e2a,0xc9))[_0x110f('0x49')](handleError(_0x404e2a,null));};exports[_0x110f('0x26')]=function(_0x2ee8e2,_0x23d1f3){if(_0x2ee8e2[_0x110f('0x51')]['id']){delete _0x2ee8e2[_0x110f('0x51')]['id'];}return db[_0x110f('0x32')][_0x110f('0x4f')]({'where':{'id':_0x2ee8e2[_0x110f('0x4b')]['id']}})[_0x110f('0x28')](handleEntityNotFound(_0x23d1f3,null))['then'](saveUpdates(_0x2ee8e2['body'],null))[_0x110f('0x28')](respondWithResult(_0x23d1f3,null))[_0x110f('0x49')](handleError(_0x23d1f3,null));};exports[_0x110f('0x27')]=function(_0x578651,_0x40c6e8){return db[_0x110f('0x32')]['find']({'where':{'id':_0x578651['params']['id']}})['then'](handleEntityNotFound(_0x40c6e8,null))[_0x110f('0x28')](removeEntity(_0x40c6e8,null))[_0x110f('0x49')](handleError(_0x40c6e8,null));};function widgetAttributes(_0x47bb2e){try{switch(_0x47bb2e[_0x110f('0x43')]){case _0x110f('0x5e'):return[{'name':_0x110f('0x5f'),'value':_0x47bb2e[_0x110f('0x5f')]||(_0x47bb2e[_0x110f('0x60')]&&_0x47bb2e[_0x110f('0x60')][0x0]?_0x47bb2e[_0x110f('0x60')][0x0][_0x110f('0x61')]:undefined)||_0x110f('0x62')}];case'custom':return[{'name':_0x110f('0x63'),'value':_0x47bb2e[_0x110f('0x63')]||(_0x47bb2e[_0x110f('0x60')]&&_0x47bb2e['attrs'][0x0]?_0x47bb2e[_0x110f('0x60')][0x0]['value']:undefined)||''}];case _0x110f('0x64'):return[{'name':_0x110f('0x65'),'value':_0x47bb2e[_0x110f('0x65')]||(_0x47bb2e[_0x110f('0x60')]&&_0x47bb2e['attrs'][0x0]?_0x47bb2e[_0x110f('0x60')][0x0][_0x110f('0x61')]:undefined)||'HH:mm:ss'},{'name':_0x110f('0x66'),'value':_0x47bb2e['attrTimezone']||(_0x47bb2e[_0x110f('0x60')]&&_0x47bb2e[_0x110f('0x60')][0x1]?_0x47bb2e[_0x110f('0x60')][0x1]['value']:undefined)||_0x110f('0x67')},{'name':_0x110f('0x68'),'value':_0x47bb2e[_0x110f('0x68')]||(_0x47bb2e[_0x110f('0x60')]&&_0x47bb2e['attrs'][0x2]?_0x47bb2e[_0x110f('0x60')][0x2][_0x110f('0x61')]:undefined)||0xc}];case _0x110f('0x69'):return[{'name':_0x110f('0x6a'),'value':_0x47bb2e['attrMetric']||(_0x47bb2e['attrs']&&_0x47bb2e['attrs'][0x0]?_0x47bb2e['attrs'][0x0][_0x110f('0x61')]:undefined)||'total'},{'name':_0x110f('0x6b'),'value':_0x47bb2e['attrVoiceQueues']||(_0x47bb2e['attrs']&&_0x47bb2e[_0x110f('0x60')][0x1]?_0x47bb2e[_0x110f('0x60')][0x1][_0x110f('0x61')]:undefined)||[]},{'name':_0x110f('0x68'),'value':_0x47bb2e[_0x110f('0x68')]||(_0x47bb2e[_0x110f('0x60')]&&_0x47bb2e[_0x110f('0x60')][0x2]?_0x47bb2e['attrs'][0x2][_0x110f('0x61')]:undefined)||0x14},{'name':'attrChannel','value':_0x47bb2e[_0x110f('0x6c')]||(_0x47bb2e[_0x110f('0x60')]&&_0x47bb2e['attrs'][0x3]?_0x47bb2e[_0x110f('0x60')][0x3]['value']:undefined)||_0x110f('0x6d')},{'name':_0x110f('0x6e'),'value':_0x47bb2e[_0x110f('0x6e')]||(_0x47bb2e[_0x110f('0x60')]&&_0x47bb2e[_0x110f('0x60')][0x4]?_0x47bb2e['attrs'][0x4][_0x110f('0x61')]:undefined)||''},{'name':_0x110f('0x6f'),'value':_0x47bb2e[_0x110f('0x6f')]||(_0x47bb2e[_0x110f('0x60')]&&_0x47bb2e['attrs'][0x5]?_0x47bb2e['attrs'][0x5][_0x110f('0x61')]:undefined)||''},{'name':_0x110f('0x70'),'value':_0x47bb2e[_0x110f('0x70')]||(_0x47bb2e['attrs']&&_0x47bb2e['attrs'][0x6]?_0x47bb2e[_0x110f('0x60')][0x6][_0x110f('0x61')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x47bb2e['attrOpenchannelAccounts']||(_0x47bb2e['attrs']&&_0x47bb2e[_0x110f('0x60')][0x7]?_0x47bb2e['attrs'][0x7][_0x110f('0x61')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x47bb2e[_0x110f('0x71')]||(_0x47bb2e[_0x110f('0x60')]&&_0x47bb2e[_0x110f('0x60')][0x8]?_0x47bb2e[_0x110f('0x60')][0x8][_0x110f('0x61')]:undefined)||''},{'name':'attrChatWebsites','value':_0x47bb2e[_0x110f('0x72')]||(_0x47bb2e[_0x110f('0x60')]&&_0x47bb2e[_0x110f('0x60')][0x9]?_0x47bb2e[_0x110f('0x60')][0x9]['value']:undefined)||''}];case _0x110f('0x73'):case'pie-chart':return[{'name':'attrSerie1','value':_0x47bb2e[_0x110f('0x74')]||(_0x47bb2e[_0x110f('0x60')]&&_0x47bb2e[_0x110f('0x60')][0x0]?_0x47bb2e['attrs'][0x0][_0x110f('0x61')]:undefined)||'total'},{'name':_0x110f('0x75'),'value':_0x47bb2e['attrSerie2']||(_0x47bb2e[_0x110f('0x60')]&&_0x47bb2e[_0x110f('0x60')][0x1]?_0x47bb2e[_0x110f('0x60')][0x1][_0x110f('0x61')]:undefined)||null},{'name':_0x110f('0x76'),'value':_0x47bb2e[_0x110f('0x76')]||(_0x47bb2e[_0x110f('0x60')]&&_0x47bb2e[_0x110f('0x60')][0x2]?_0x47bb2e[_0x110f('0x60')][0x2][_0x110f('0x61')]:undefined)||null},{'name':_0x110f('0x6b'),'value':_0x47bb2e['attrVoiceQueues']||(_0x47bb2e[_0x110f('0x60')]&&_0x47bb2e[_0x110f('0x60')][0x3]?_0x47bb2e['attrs'][0x3][_0x110f('0x61')]:undefined)||[]},{'name':_0x110f('0x6c'),'value':_0x47bb2e[_0x110f('0x6c')]||(_0x47bb2e[_0x110f('0x60')]&&_0x47bb2e[_0x110f('0x60')][0x4]?_0x47bb2e['attrs'][0x4][_0x110f('0x61')]:undefined)||_0x110f('0x6d')},{'name':_0x110f('0x6e'),'value':_0x47bb2e[_0x110f('0x6e')]||(_0x47bb2e[_0x110f('0x60')]&&_0x47bb2e[_0x110f('0x60')][0x5]?_0x47bb2e[_0x110f('0x60')][0x5]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x47bb2e['attrFaxAccounts']||(_0x47bb2e['attrs']&&_0x47bb2e[_0x110f('0x60')][0x6]?_0x47bb2e['attrs'][0x6]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x47bb2e[_0x110f('0x70')]||(_0x47bb2e[_0x110f('0x60')]&&_0x47bb2e[_0x110f('0x60')][0x7]?_0x47bb2e[_0x110f('0x60')][0x7][_0x110f('0x61')]:undefined)||''},{'name':_0x110f('0x77'),'value':_0x47bb2e[_0x110f('0x77')]||(_0x47bb2e[_0x110f('0x60')]&&_0x47bb2e[_0x110f('0x60')][0x8]?_0x47bb2e[_0x110f('0x60')][0x8]['value']:undefined)||''},{'name':_0x110f('0x71'),'value':_0x47bb2e['attrWhatsappAccounts']||(_0x47bb2e['attrs']&&_0x47bb2e['attrs'][0x9]?_0x47bb2e['attrs'][0x9][_0x110f('0x61')]:undefined)||''},{'name':_0x110f('0x72'),'value':_0x47bb2e['attrChatWebsites']||(_0x47bb2e['attrs']&&_0x47bb2e[_0x110f('0x60')][0xa]?_0x47bb2e[_0x110f('0x60')][0xa][_0x110f('0x61')]:undefined)||''}];case'web-report':return[{'name':_0x110f('0x78'),'type':_0x47bb2e[_0x110f('0x79')]||(_0x47bb2e[_0x110f('0x60')]&&_0x47bb2e[_0x110f('0x60')][0x0]?_0x47bb2e[_0x110f('0x60')][0x0][_0x110f('0x43')]:undefined)||null,'value':_0x47bb2e[_0x110f('0x78')]||(_0x47bb2e[_0x110f('0x60')]&&_0x47bb2e[_0x110f('0x60')][0x0]?_0x47bb2e[_0x110f('0x60')][0x0][_0x110f('0x61')]:undefined)||null},{'name':_0x110f('0x7a'),'value':_0x47bb2e[_0x110f('0x7a')]||(_0x47bb2e[_0x110f('0x60')]&&_0x47bb2e[_0x110f('0x60')][0x1]?_0x47bb2e[_0x110f('0x60')][0x1][_0x110f('0x61')]:undefined)||0x0}];default:return[];}}catch(_0x37194c){logger[_0x110f('0x2d')](_0x110f('0x7b'),JSON[_0x110f('0x7c')](_0x37194c));return[];}}exports[_0x110f('0x7d')]=function(_0x598ea8,_0xe8f2a6,_0x3e3074){if(_0x598ea8[_0x110f('0x51')]['id']){delete _0x598ea8[_0x110f('0x51')]['id'];}return db['Dashboard'][_0x110f('0x4f')]({'where':{'id':_0x598ea8[_0x110f('0x4b')]['id']}})[_0x110f('0x28')](handleEntityNotFound(_0xe8f2a6,null))[_0x110f('0x28')](function(_0x3f3e68){if(_0x3f3e68){_0x598ea8[_0x110f('0x51')]['DashboardId']=_0x3f3e68['id'];_0x598ea8['body'][_0x110f('0x60')]=widgetAttributes(_0x598ea8[_0x110f('0x51')]);return db[_0x110f('0x7e')]['create'](_0x598ea8[_0x110f('0x51')]);}})[_0x110f('0x28')](respondWithResult(_0xe8f2a6,null))['catch'](handleError(_0xe8f2a6,null));};exports[_0x110f('0x7f')]=function(_0x37fdad,_0x100375,_0xc8ea95){var _0x25d4f0={};var _0x3d30a4={};var _0x40423b;var _0x3f43c1;return db['Dashboard'][_0x110f('0x80')]({'where':{'id':_0x37fdad['params']['id']}})[_0x110f('0x28')](handleEntityNotFound(_0x100375,null))[_0x110f('0x28')](function(_0x769f3c){if(_0x769f3c){_0x40423b=_0x769f3c;_0x3d30a4[_0x110f('0x37')]=_['keys'](db['DashboardItem'][_0x110f('0x59')]);_0x3d30a4[_0x110f('0x38')]=_[_0x110f('0x35')](_0x37fdad[_0x110f('0x38')]);_0x3d30a4[_0x110f('0x36')]=_[_0x110f('0x39')](_0x3d30a4['model'],_0x3d30a4[_0x110f('0x38')]);_0x25d4f0[_0x110f('0x3b')]=_[_0x110f('0x39')](_0x3d30a4[_0x110f('0x37')],qs[_0x110f('0x3a')](_0x37fdad[_0x110f('0x38')][_0x110f('0x3a')]));_0x25d4f0[_0x110f('0x3b')]=_0x25d4f0[_0x110f('0x3b')][_0x110f('0x4c')]?_0x25d4f0['attributes']:_0x3d30a4[_0x110f('0x37')];_0x25d4f0[_0x110f('0x3e')]=qs[_0x110f('0x3f')](_0x37fdad['query']['sort']);_0x25d4f0['where']=qs[_0x110f('0x36')](_[_0x110f('0x41')](_0x37fdad[_0x110f('0x38')],_0x3d30a4[_0x110f('0x36')]));if(_0x37fdad[_0x110f('0x38')][_0x110f('0x42')]){_0x25d4f0[_0x110f('0x40')]=_[_0x110f('0x4e')](_0x25d4f0['where'],{'$or':_['map'](_0x25d4f0[_0x110f('0x3b')],function(_0x25ccaf){var _0x4aedac={};_0x4aedac[_0x25ccaf]={'$like':'%'+_0x37fdad[_0x110f('0x38')][_0x110f('0x42')]+'%'};return _0x4aedac;})});}_0x25d4f0=_[_0x110f('0x4e')]({},_0x25d4f0,_0x37fdad[_0x110f('0x45')]);return _0x40423b['getItems'](_0x25d4f0);}})['then'](function(_0x1176c3){if(_0x1176c3){_0x3f43c1=_0x1176c3['length'];if(!_0x37fdad[_0x110f('0x38')][_0x110f('0x3c')](_0x110f('0x3d'))){_0x25d4f0[_0x110f('0x20')]=qs[_0x110f('0x20')](_0x37fdad['query'][_0x110f('0x20')]);_0x25d4f0[_0x110f('0x1e')]=qs[_0x110f('0x1e')](_0x37fdad[_0x110f('0x38')][_0x110f('0x1e')]);}return _0x40423b[_0x110f('0x7f')](_0x25d4f0);}})[_0x110f('0x28')](function(_0x2b2b36){if(_0x2b2b36){return _0x2b2b36?{'count':_0x3f43c1,'rows':_0x2b2b36}:null;}})[_0x110f('0x28')](respondWithResult(_0x100375,null))[_0x110f('0x49')](handleError(_0x100375,null));};
\ No newline at end of file
+var _0xa320=['Content-Range','apply','reject','save','update','then','get','CustomDashboards','UserProfileResource','destroy','end','sendStatus','error','stack','name','send','Dashboard','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','VIRTUAL','options','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','includeAll','include','omit','createdAt','updatedAt','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrSmsAccounts','attrOpenchannelAccounts','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','pick','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./dashboard.socket','register','status','json','offset','undefined','limit','count','set'];(function(_0x452ac8,_0x382b4c){var _0x16b3df=function(_0x5a36d7){while(--_0x5a36d7){_0x452ac8['push'](_0x452ac8['shift']());}};_0x16b3df(++_0x382b4c);}(_0xa320,0x1f3));var _0x0a32=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xa320[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0x0a32('0x0'));var rimraf=require(_0x0a32('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0a32('0x2'));var rp=require('request-promise');var moment=require(_0x0a32('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a32('0x4'));var util=require(_0x0a32('0x5'));var path=require(_0x0a32('0x6'));var sox=require(_0x0a32('0x7'));var csv=require(_0x0a32('0x8'));var ejs=require(_0x0a32('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0a32('0xa'));var squel=require(_0x0a32('0xb'));var crypto=require(_0x0a32('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0a32('0xd'));var toCsv=require(_0x0a32('0x8'));var querystring=require(_0x0a32('0xe'));var Papa=require('papaparse');var Redis=require(_0x0a32('0xf'));var authService=require(_0x0a32('0x10'));var qs=require(_0x0a32('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0a32('0x12'));var logger=require(_0x0a32('0x13'))(_0x0a32('0x14'));var utils=require(_0x0a32('0x15'));var config=require(_0x0a32('0x16'));var licenseUtil=require(_0x0a32('0x17'));var db=require(_0x0a32('0x18'))['db'];config[_0x0a32('0x19')]=_[_0x0a32('0x1a')](config[_0x0a32('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x0a32('0x1b'))(new Redis(config[_0x0a32('0x19')]));require(_0x0a32('0x1c'))[_0x0a32('0x1d')](socket);function respondWithStatusCode(_0x1222a5,_0x4409c5){_0x4409c5=_0x4409c5||0xcc;return function(_0x1ccbe0){if(_0x1ccbe0){return _0x1222a5['sendStatus'](_0x4409c5);}return _0x1222a5[_0x0a32('0x1e')](_0x4409c5)['end']();};}function respondWithResult(_0x3df788,_0x563f5f){_0x563f5f=_0x563f5f||0xc8;return function(_0x320dc7){if(_0x320dc7){return _0x3df788[_0x0a32('0x1e')](_0x563f5f)[_0x0a32('0x1f')](_0x320dc7);}};}function respondWithFilteredResult(_0x4537c5,_0x5f10f6){return function(_0x3696f5){if(_0x3696f5){var _0x2ab24d=typeof _0x5f10f6[_0x0a32('0x20')]===_0x0a32('0x21')&&typeof _0x5f10f6[_0x0a32('0x22')]===_0x0a32('0x21');var _0x253ba6=_0x3696f5[_0x0a32('0x23')];var _0x488682=_0x2ab24d?0x0:_0x5f10f6['offset'];var _0x1106ec=_0x2ab24d?_0x3696f5['count']:_0x5f10f6[_0x0a32('0x20')]+_0x5f10f6[_0x0a32('0x22')];var _0x48ee3c;if(_0x1106ec>=_0x253ba6){_0x1106ec=_0x253ba6;_0x48ee3c=0xc8;}else{_0x48ee3c=0xce;}_0x4537c5[_0x0a32('0x1e')](_0x48ee3c);return _0x4537c5[_0x0a32('0x24')](_0x0a32('0x25'),_0x488682+'-'+_0x1106ec+'/'+_0x253ba6)[_0x0a32('0x1f')](_0x3696f5);}return null;};}function patchUpdates(_0x2521e0){return function(_0x341cbf){try{jsonpatch[_0x0a32('0x26')](_0x341cbf,_0x2521e0,!![]);}catch(_0x1c961f){return BPromise[_0x0a32('0x27')](_0x1c961f);}return _0x341cbf[_0x0a32('0x28')]();};}function saveUpdates(_0x398cd0,_0x70566c){return function(_0xe000f7){if(_0xe000f7){return _0xe000f7[_0x0a32('0x29')](_0x398cd0)['then'](function(_0x2f4c24){return _0x2f4c24;});}return null;};}function removeEntity(_0x2aba6e,_0x5bfe96){return function(_0x10d542){if(_0x10d542){return _0x10d542['destroy']()[_0x0a32('0x2a')](function(){var _0x4e8ed3=_0x10d542[_0x0a32('0x2b')]({'plain':!![]});var _0xeaab37=_0x0a32('0x2c');return db[_0x0a32('0x2d')][_0x0a32('0x2e')]({'where':{'type':_0xeaab37,'resourceId':_0x4e8ed3['id']}})['then'](function(){return _0x10d542;});})[_0x0a32('0x2a')](function(){_0x2aba6e[_0x0a32('0x1e')](0xcc)[_0x0a32('0x2f')]();});}};}function handleEntityNotFound(_0x3c6322,_0x1dd055){return function(_0x255b01){if(!_0x255b01){_0x3c6322[_0x0a32('0x30')](0x194);}return _0x255b01;};}function handleError(_0x2ef778,_0x38c5fa){_0x38c5fa=_0x38c5fa||0x1f4;return function(_0xe75fa1){logger[_0x0a32('0x31')](_0xe75fa1[_0x0a32('0x32')]);if(_0xe75fa1[_0x0a32('0x33')]){delete _0xe75fa1[_0x0a32('0x33')];}_0x2ef778[_0x0a32('0x1e')](_0x38c5fa)[_0x0a32('0x34')](_0xe75fa1);};}exports['index']=function(_0x49690f,_0x677303){var _0x307268={},_0x5787e3={},_0x17a56e={'count':0x0,'rows':[]};var _0x4553df=_['map'](db[_0x0a32('0x35')][_0x0a32('0x36')],function(_0xbd0e7c){return{'name':_0xbd0e7c[_0x0a32('0x37')],'type':_0xbd0e7c['type'][_0x0a32('0x38')]};});_0x5787e3[_0x0a32('0x39')]=_['map'](_0x4553df,_0x0a32('0x33'));_0x5787e3[_0x0a32('0x3a')]=_[_0x0a32('0x3b')](_0x49690f[_0x0a32('0x3a')]);_0x5787e3[_0x0a32('0x3c')]=_['intersection'](_0x5787e3[_0x0a32('0x39')],_0x5787e3[_0x0a32('0x3a')]);_0x307268[_0x0a32('0x3d')]=_[_0x0a32('0x3e')](_0x5787e3['model'],qs[_0x0a32('0x3f')](_0x49690f[_0x0a32('0x3a')][_0x0a32('0x3f')]));_0x307268['attributes']=_0x307268[_0x0a32('0x3d')][_0x0a32('0x40')]?_0x307268[_0x0a32('0x3d')]:_0x5787e3[_0x0a32('0x39')];if(!_0x49690f[_0x0a32('0x3a')][_0x0a32('0x41')](_0x0a32('0x42'))){_0x307268[_0x0a32('0x22')]=qs[_0x0a32('0x22')](_0x49690f[_0x0a32('0x3a')][_0x0a32('0x22')]);_0x307268['offset']=qs[_0x0a32('0x20')](_0x49690f[_0x0a32('0x3a')][_0x0a32('0x20')]);}_0x307268[_0x0a32('0x43')]=qs[_0x0a32('0x44')](_0x49690f['query'][_0x0a32('0x44')]);_0x307268[_0x0a32('0x45')]=qs[_0x0a32('0x3c')](_['pick'](_0x49690f['query'],_0x5787e3[_0x0a32('0x3c')]),_0x4553df);if(_0x49690f[_0x0a32('0x3a')][_0x0a32('0x46')]){_0x307268[_0x0a32('0x45')]=_[_0x0a32('0x47')](_0x307268[_0x0a32('0x45')],{'$or':_[_0x0a32('0x48')](_0x4553df,function(_0xa50170){if(_0xa50170[_0x0a32('0x49')]!==_0x0a32('0x4a')){var _0x1afa62={};_0x1afa62[_0xa50170[_0x0a32('0x33')]]={'$like':'%'+_0x49690f['query'][_0x0a32('0x46')]+'%'};return _0x1afa62;}})});}_0x307268=_[_0x0a32('0x47')]({},_0x307268,_0x49690f[_0x0a32('0x4b')]);var _0x38f2ef={'where':_0x307268[_0x0a32('0x45')]};return db['Dashboard'][_0x0a32('0x23')](_0x38f2ef)['then'](function(_0x102369){_0x17a56e['count']=_0x102369;if(_0x49690f[_0x0a32('0x3a')]['includeAll']){_0x307268['include']=[{'all':!![]}];}return db[_0x0a32('0x35')]['findAll'](_0x307268);})[_0x0a32('0x2a')](function(_0x4da324){_0x17a56e['rows']=_0x4da324;return _0x17a56e;})[_0x0a32('0x2a')](respondWithFilteredResult(_0x677303,_0x307268))[_0x0a32('0x4c')](handleError(_0x677303,null));};exports[_0x0a32('0x4d')]=function(_0x348ac1,_0x2590af){var _0x240a16={'raw':![],'where':{'id':_0x348ac1[_0x0a32('0x4e')]['id']}},_0x5bbb2b={};_0x5bbb2b[_0x0a32('0x39')]=_[_0x0a32('0x3b')](db[_0x0a32('0x35')][_0x0a32('0x36')]);_0x5bbb2b[_0x0a32('0x3a')]=_[_0x0a32('0x3b')](_0x348ac1['query']);_0x5bbb2b[_0x0a32('0x3c')]=_[_0x0a32('0x3e')](_0x5bbb2b[_0x0a32('0x39')],_0x5bbb2b[_0x0a32('0x3a')]);_0x240a16[_0x0a32('0x3d')]=_[_0x0a32('0x3e')](_0x5bbb2b['model'],qs[_0x0a32('0x3f')](_0x348ac1[_0x0a32('0x3a')][_0x0a32('0x3f')]));_0x240a16[_0x0a32('0x3d')]=_0x240a16[_0x0a32('0x3d')][_0x0a32('0x40')]?_0x240a16[_0x0a32('0x3d')]:_0x5bbb2b[_0x0a32('0x39')];if(_0x348ac1[_0x0a32('0x3a')]['includeAll']){_0x240a16['include']=[{'all':!![]}];}_0x240a16=_['merge']({},_0x240a16,_0x348ac1[_0x0a32('0x4b')]);return db['Dashboard'][_0x0a32('0x4f')](_0x240a16)[_0x0a32('0x2a')](handleEntityNotFound(_0x2590af,null))[_0x0a32('0x2a')](respondWithResult(_0x2590af,null))[_0x0a32('0x4c')](handleError(_0x2590af,null));};exports['create']=function(_0x4413f6,_0x547a54){return db['Dashboard'][_0x0a32('0x50')](_0x4413f6[_0x0a32('0x51')],{})[_0x0a32('0x2a')](function(_0x4f311d){var _0x2ac2da=_0x4413f6[_0x0a32('0x52')][_0x0a32('0x2b')]({'plain':!![]});if(!_0x2ac2da)throw new Error(_0x0a32('0x53'));if(_0x2ac2da[_0x0a32('0x54')]===_0x0a32('0x52')){var _0x4e83ad=_0x4f311d['get']({'plain':!![]});var _0x39baa4=_0x0a32('0x2c');return db[_0x0a32('0x55')][_0x0a32('0x4f')]({'where':{'name':_0x39baa4,'userProfileId':_0x2ac2da['userProfileId']},'raw':!![]})['then'](function(_0x328909){if(_0x328909&&_0x328909[_0x0a32('0x56')]===0x0){return db[_0x0a32('0x2d')][_0x0a32('0x50')]({'name':_0x4e83ad[_0x0a32('0x33')],'resourceId':_0x4e83ad['id'],'type':_0x328909[_0x0a32('0x33')],'sectionId':_0x328909['id']},{})[_0x0a32('0x2a')](function(){return _0x4f311d;});}else{return _0x4f311d;}})['catch'](function(_0x174adf){logger['error'](_0x0a32('0x57'),_0x174adf);throw _0x174adf;});}return _0x4f311d;})[_0x0a32('0x2a')](respondWithResult(_0x547a54,0xc9))[_0x0a32('0x4c')](handleError(_0x547a54,null));};exports['clone']=function(_0xc743af,_0x2b3a5d){var _0x5a9b5f={'where':{'id':_0xc743af['params']['id']}},_0x4d365f={};_0x4d365f[_0x0a32('0x39')]=_[_0x0a32('0x3b')](db[_0x0a32('0x35')][_0x0a32('0x36')]);_0x5a9b5f[_0x0a32('0x3d')]=_[_0x0a32('0x3e')](_0x4d365f[_0x0a32('0x39')],qs[_0x0a32('0x3f')](_0xc743af['query'][_0x0a32('0x3f')]));_0x5a9b5f[_0x0a32('0x3d')]=_0x5a9b5f[_0x0a32('0x3d')][_0x0a32('0x40')]?_0x5a9b5f[_0x0a32('0x3d')]:_0x4d365f[_0x0a32('0x39')];if(_0xc743af[_0x0a32('0x3a')][_0x0a32('0x58')]){_0x5a9b5f[_0x0a32('0x59')]=[{'all':!![]}];}_0x5a9b5f=_[_0x0a32('0x47')]({},_0x5a9b5f,_0xc743af[_0x0a32('0x4b')]);return db[_0x0a32('0x35')]['find'](_0x5a9b5f)[_0x0a32('0x2a')](handleEntityNotFound(_0x2b3a5d,null))['then'](function(_0x2bf06b){if(_0x2bf06b){var _0x413dd=_0x2bf06b[_0x0a32('0x2b')]({'plain':!![]});_0x413dd=qs[_0x0a32('0x5a')](_0x413dd,['id',_0x0a32('0x5b'),'updatedAt']);_0xc743af[_0x0a32('0x51')]=_['omit'](_0xc743af['body'],['id',_0x0a32('0x5b'),_0x0a32('0x5c')]);return db[_0x0a32('0x35')][_0x0a32('0x50')](_[_0x0a32('0x47')](_0x413dd,_0xc743af[_0x0a32('0x51')]),{'include':_0xc743af[_0x0a32('0x3a')][_0x0a32('0x58')]?[{'all':!![]}]:undefined})[_0x0a32('0x2a')](function(_0x1a5c5c){var _0x3cc34a=_0xc743af['user'][_0x0a32('0x2b')]({'plain':!![]});if(!_0x3cc34a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3cc34a[_0x0a32('0x54')]===_0x0a32('0x52')){var _0x111c57=_0x1a5c5c[_0x0a32('0x2b')]({'plain':!![]});var _0x31323c='CustomDashboards';return db[_0x0a32('0x55')][_0x0a32('0x4f')]({'where':{'name':_0x31323c,'userProfileId':_0x3cc34a['userProfileId']},'raw':!![]})['then'](function(_0x120fdf){if(_0x120fdf&&_0x120fdf[_0x0a32('0x56')]===0x0){return db['UserProfileResource'][_0x0a32('0x50')]({'name':_0x111c57[_0x0a32('0x33')],'resourceId':_0x111c57['id'],'type':_0x120fdf[_0x0a32('0x33')],'sectionId':_0x120fdf['id']},{})['then'](function(){return _0x1a5c5c;});}else{return _0x1a5c5c;}})[_0x0a32('0x4c')](function(_0x3b1030){logger['error'](_0x0a32('0x57'),_0x3b1030);throw _0x3b1030;});}return _0x1a5c5c;});}})[_0x0a32('0x2a')](respondWithResult(_0x2b3a5d,0xc9))[_0x0a32('0x4c')](handleError(_0x2b3a5d,null));};exports[_0x0a32('0x29')]=function(_0x3d17ab,_0x3371f0){if(_0x3d17ab[_0x0a32('0x51')]['id']){delete _0x3d17ab['body']['id'];}return db[_0x0a32('0x35')][_0x0a32('0x4f')]({'where':{'id':_0x3d17ab['params']['id']}})[_0x0a32('0x2a')](handleEntityNotFound(_0x3371f0,null))[_0x0a32('0x2a')](saveUpdates(_0x3d17ab['body'],null))[_0x0a32('0x2a')](respondWithResult(_0x3371f0,null))[_0x0a32('0x4c')](handleError(_0x3371f0,null));};exports['destroy']=function(_0x46e8e9,_0x1227b7){return db['Dashboard'][_0x0a32('0x4f')]({'where':{'id':_0x46e8e9[_0x0a32('0x4e')]['id']}})[_0x0a32('0x2a')](handleEntityNotFound(_0x1227b7,null))[_0x0a32('0x2a')](removeEntity(_0x1227b7,null))['catch'](handleError(_0x1227b7,null));};function widgetAttributes(_0xd97f39){try{switch(_0xd97f39['type']){case _0x0a32('0x5d'):return[{'name':_0x0a32('0x5e'),'value':_0xd97f39[_0x0a32('0x5e')]||(_0xd97f39['attrs']&&_0xd97f39[_0x0a32('0x5f')][0x0]?_0xd97f39['attrs'][0x0][_0x0a32('0x60')]:undefined)||_0x0a32('0x61')}];case _0x0a32('0x62'):return[{'name':_0x0a32('0x63'),'value':_0xd97f39[_0x0a32('0x63')]||(_0xd97f39[_0x0a32('0x5f')]&&_0xd97f39['attrs'][0x0]?_0xd97f39[_0x0a32('0x5f')][0x0][_0x0a32('0x60')]:undefined)||''}];case _0x0a32('0x64'):return[{'name':_0x0a32('0x65'),'value':_0xd97f39[_0x0a32('0x65')]||(_0xd97f39[_0x0a32('0x5f')]&&_0xd97f39['attrs'][0x0]?_0xd97f39[_0x0a32('0x5f')][0x0][_0x0a32('0x60')]:undefined)||_0x0a32('0x66')},{'name':_0x0a32('0x67'),'value':_0xd97f39[_0x0a32('0x67')]||(_0xd97f39['attrs']&&_0xd97f39[_0x0a32('0x5f')][0x1]?_0xd97f39[_0x0a32('0x5f')][0x1][_0x0a32('0x60')]:undefined)||'0.00'},{'name':_0x0a32('0x68'),'value':_0xd97f39['attrFontSize']||(_0xd97f39[_0x0a32('0x5f')]&&_0xd97f39['attrs'][0x2]?_0xd97f39[_0x0a32('0x5f')][0x2][_0x0a32('0x60')]:undefined)||0xc}];case _0x0a32('0x69'):return[{'name':_0x0a32('0x6a'),'value':_0xd97f39[_0x0a32('0x6a')]||(_0xd97f39[_0x0a32('0x5f')]&&_0xd97f39['attrs'][0x0]?_0xd97f39[_0x0a32('0x5f')][0x0]['value']:undefined)||_0x0a32('0x6b')},{'name':_0x0a32('0x6c'),'value':_0xd97f39[_0x0a32('0x6c')]||(_0xd97f39['attrs']&&_0xd97f39[_0x0a32('0x5f')][0x1]?_0xd97f39['attrs'][0x1][_0x0a32('0x60')]:undefined)||[]},{'name':_0x0a32('0x68'),'value':_0xd97f39['attrFontSize']||(_0xd97f39['attrs']&&_0xd97f39[_0x0a32('0x5f')][0x2]?_0xd97f39[_0x0a32('0x5f')][0x2][_0x0a32('0x60')]:undefined)||0x14},{'name':_0x0a32('0x6d'),'value':_0xd97f39[_0x0a32('0x6d')]||(_0xd97f39[_0x0a32('0x5f')]&&_0xd97f39[_0x0a32('0x5f')][0x3]?_0xd97f39['attrs'][0x3][_0x0a32('0x60')]:undefined)||_0x0a32('0x6e')},{'name':_0x0a32('0x6f'),'value':_0xd97f39[_0x0a32('0x6f')]||(_0xd97f39[_0x0a32('0x5f')]&&_0xd97f39[_0x0a32('0x5f')][0x4]?_0xd97f39[_0x0a32('0x5f')][0x4][_0x0a32('0x60')]:undefined)||''},{'name':'attrFaxAccounts','value':_0xd97f39[_0x0a32('0x70')]||(_0xd97f39['attrs']&&_0xd97f39[_0x0a32('0x5f')][0x5]?_0xd97f39[_0x0a32('0x5f')][0x5][_0x0a32('0x60')]:undefined)||''},{'name':'attrSmsAccounts','value':_0xd97f39['attrSmsAccounts']||(_0xd97f39['attrs']&&_0xd97f39[_0x0a32('0x5f')][0x6]?_0xd97f39[_0x0a32('0x5f')][0x6][_0x0a32('0x60')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0xd97f39['attrOpenchannelAccounts']||(_0xd97f39[_0x0a32('0x5f')]&&_0xd97f39['attrs'][0x7]?_0xd97f39['attrs'][0x7][_0x0a32('0x60')]:undefined)||''},{'name':_0x0a32('0x71'),'value':_0xd97f39[_0x0a32('0x71')]||(_0xd97f39[_0x0a32('0x5f')]&&_0xd97f39['attrs'][0x8]?_0xd97f39[_0x0a32('0x5f')][0x8][_0x0a32('0x60')]:undefined)||''},{'name':_0x0a32('0x72'),'value':_0xd97f39['attrChatWebsites']||(_0xd97f39[_0x0a32('0x5f')]&&_0xd97f39[_0x0a32('0x5f')][0x9]?_0xd97f39['attrs'][0x9][_0x0a32('0x60')]:undefined)||''}];case _0x0a32('0x73'):case _0x0a32('0x74'):return[{'name':_0x0a32('0x75'),'value':_0xd97f39[_0x0a32('0x75')]||(_0xd97f39['attrs']&&_0xd97f39['attrs'][0x0]?_0xd97f39[_0x0a32('0x5f')][0x0][_0x0a32('0x60')]:undefined)||_0x0a32('0x6b')},{'name':'attrSerie2','value':_0xd97f39[_0x0a32('0x76')]||(_0xd97f39[_0x0a32('0x5f')]&&_0xd97f39['attrs'][0x1]?_0xd97f39[_0x0a32('0x5f')][0x1]['value']:undefined)||null},{'name':_0x0a32('0x77'),'value':_0xd97f39[_0x0a32('0x77')]||(_0xd97f39[_0x0a32('0x5f')]&&_0xd97f39[_0x0a32('0x5f')][0x2]?_0xd97f39['attrs'][0x2]['value']:undefined)||null},{'name':_0x0a32('0x6c'),'value':_0xd97f39[_0x0a32('0x6c')]||(_0xd97f39['attrs']&&_0xd97f39['attrs'][0x3]?_0xd97f39['attrs'][0x3][_0x0a32('0x60')]:undefined)||[]},{'name':'attrChannel','value':_0xd97f39[_0x0a32('0x6d')]||(_0xd97f39[_0x0a32('0x5f')]&&_0xd97f39[_0x0a32('0x5f')][0x4]?_0xd97f39[_0x0a32('0x5f')][0x4][_0x0a32('0x60')]:undefined)||_0x0a32('0x6e')},{'name':_0x0a32('0x6f'),'value':_0xd97f39[_0x0a32('0x6f')]||(_0xd97f39['attrs']&&_0xd97f39['attrs'][0x5]?_0xd97f39[_0x0a32('0x5f')][0x5][_0x0a32('0x60')]:undefined)||''},{'name':_0x0a32('0x70'),'value':_0xd97f39[_0x0a32('0x70')]||(_0xd97f39['attrs']&&_0xd97f39[_0x0a32('0x5f')][0x6]?_0xd97f39['attrs'][0x6][_0x0a32('0x60')]:undefined)||''},{'name':'attrSmsAccounts','value':_0xd97f39[_0x0a32('0x78')]||(_0xd97f39[_0x0a32('0x5f')]&&_0xd97f39[_0x0a32('0x5f')][0x7]?_0xd97f39['attrs'][0x7]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0xd97f39[_0x0a32('0x79')]||(_0xd97f39['attrs']&&_0xd97f39[_0x0a32('0x5f')][0x8]?_0xd97f39[_0x0a32('0x5f')][0x8][_0x0a32('0x60')]:undefined)||''},{'name':_0x0a32('0x71'),'value':_0xd97f39['attrWhatsappAccounts']||(_0xd97f39[_0x0a32('0x5f')]&&_0xd97f39[_0x0a32('0x5f')][0x9]?_0xd97f39['attrs'][0x9][_0x0a32('0x60')]:undefined)||''},{'name':'attrChatWebsites','value':_0xd97f39[_0x0a32('0x72')]||(_0xd97f39['attrs']&&_0xd97f39[_0x0a32('0x5f')][0xa]?_0xd97f39[_0x0a32('0x5f')][0xa][_0x0a32('0x60')]:undefined)||''}];case _0x0a32('0x7a'):return[{'name':_0x0a32('0x7b'),'type':_0xd97f39[_0x0a32('0x7c')]||(_0xd97f39['attrs']&&_0xd97f39[_0x0a32('0x5f')][0x0]?_0xd97f39['attrs'][0x0][_0x0a32('0x49')]:undefined)||null,'value':_0xd97f39['attrReport']||(_0xd97f39[_0x0a32('0x5f')]&&_0xd97f39['attrs'][0x0]?_0xd97f39[_0x0a32('0x5f')][0x0][_0x0a32('0x60')]:undefined)||null},{'name':_0x0a32('0x7d'),'value':_0xd97f39['attrRefresh']||(_0xd97f39[_0x0a32('0x5f')]&&_0xd97f39[_0x0a32('0x5f')][0x1]?_0xd97f39['attrs'][0x1][_0x0a32('0x60')]:undefined)||0x0}];default:return[];}}catch(_0x15cee2){logger['error'](_0x0a32('0x7e'),JSON[_0x0a32('0x7f')](_0x15cee2));return[];}}exports[_0x0a32('0x80')]=function(_0x320467,_0x3a5149,_0x4d1f7a){if(_0x320467[_0x0a32('0x51')]['id']){delete _0x320467[_0x0a32('0x51')]['id'];}return db[_0x0a32('0x35')][_0x0a32('0x4f')]({'where':{'id':_0x320467[_0x0a32('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3a5149,null))[_0x0a32('0x2a')](function(_0x3138a2){if(_0x3138a2){_0x320467[_0x0a32('0x51')][_0x0a32('0x81')]=_0x3138a2['id'];_0x320467['body'][_0x0a32('0x5f')]=widgetAttributes(_0x320467['body']);return db[_0x0a32('0x82')][_0x0a32('0x50')](_0x320467['body']);}})[_0x0a32('0x2a')](respondWithResult(_0x3a5149,null))[_0x0a32('0x4c')](handleError(_0x3a5149,null));};exports[_0x0a32('0x83')]=function(_0x555168,_0x3f440a,_0x14aa29){var _0x1610ec={};var _0x164761={};var _0x53e6c5;var _0x34ec79;return db[_0x0a32('0x35')][_0x0a32('0x84')]({'where':{'id':_0x555168[_0x0a32('0x4e')]['id']}})[_0x0a32('0x2a')](handleEntityNotFound(_0x3f440a,null))[_0x0a32('0x2a')](function(_0x4c9747){if(_0x4c9747){_0x53e6c5=_0x4c9747;_0x164761[_0x0a32('0x39')]=_[_0x0a32('0x3b')](db[_0x0a32('0x82')][_0x0a32('0x36')]);_0x164761['query']=_[_0x0a32('0x3b')](_0x555168[_0x0a32('0x3a')]);_0x164761[_0x0a32('0x3c')]=_[_0x0a32('0x3e')](_0x164761[_0x0a32('0x39')],_0x164761[_0x0a32('0x3a')]);_0x1610ec[_0x0a32('0x3d')]=_[_0x0a32('0x3e')](_0x164761[_0x0a32('0x39')],qs['fields'](_0x555168['query'][_0x0a32('0x3f')]));_0x1610ec['attributes']=_0x1610ec[_0x0a32('0x3d')][_0x0a32('0x40')]?_0x1610ec[_0x0a32('0x3d')]:_0x164761[_0x0a32('0x39')];_0x1610ec[_0x0a32('0x43')]=qs[_0x0a32('0x44')](_0x555168[_0x0a32('0x3a')][_0x0a32('0x44')]);_0x1610ec[_0x0a32('0x45')]=qs[_0x0a32('0x3c')](_[_0x0a32('0x85')](_0x555168['query'],_0x164761[_0x0a32('0x3c')]));if(_0x555168[_0x0a32('0x3a')][_0x0a32('0x46')]){_0x1610ec['where']=_['merge'](_0x1610ec[_0x0a32('0x45')],{'$or':_[_0x0a32('0x48')](_0x1610ec[_0x0a32('0x3d')],function(_0x22c3db){var _0x3537fb={};_0x3537fb[_0x22c3db]={'$like':'%'+_0x555168[_0x0a32('0x3a')]['filter']+'%'};return _0x3537fb;})});}_0x1610ec=_[_0x0a32('0x47')]({},_0x1610ec,_0x555168[_0x0a32('0x4b')]);return _0x53e6c5[_0x0a32('0x83')](_0x1610ec);}})[_0x0a32('0x2a')](function(_0x47d8f0){if(_0x47d8f0){_0x34ec79=_0x47d8f0['length'];if(!_0x555168[_0x0a32('0x3a')]['hasOwnProperty'](_0x0a32('0x42'))){_0x1610ec[_0x0a32('0x22')]=qs[_0x0a32('0x22')](_0x555168[_0x0a32('0x3a')][_0x0a32('0x22')]);_0x1610ec['offset']=qs[_0x0a32('0x20')](_0x555168['query'][_0x0a32('0x20')]);}return _0x53e6c5[_0x0a32('0x83')](_0x1610ec);}})[_0x0a32('0x2a')](function(_0x5ea189){if(_0x5ea189){return _0x5ea189?{'count':_0x34ec79,'rows':_0x5ea189}:null;}})[_0x0a32('0x2a')](respondWithResult(_0x3f440a,null))[_0x0a32('0x4c')](handleError(_0x3f440a,null));};
\ No newline at end of file
index da72588..d3d4d68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb725=['save','update','remove','emit','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0xb725,0x86));var _0x5b72=function(_0x449fc1,_0x4384f9){_0x449fc1=_0x449fc1-0x0;var _0x3579b5=_0xb725[_0x449fc1];return _0x3579b5;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x5b72('0x0'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x5b72('0x1')](0x0);var events={'afterCreate':_0x5b72('0x2'),'afterUpdate':_0x5b72('0x3'),'afterDestroy':_0x5b72('0x4')};function emitEvent(_0xde5e3a){return function(_0x3fa8ef,_0x1bf63a,_0x32e4e3){DashboardEvents[_0x5b72('0x5')](_0xde5e3a+':'+_0x3fa8ef['id'],_0x3fa8ef);DashboardEvents[_0x5b72('0x5')](_0xde5e3a,_0x3fa8ef);_0x32e4e3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x5b72('0x6')](e,emitEvent(event));}}module[_0x5b72('0x7')]=DashboardEvents;
\ No newline at end of file
+var _0xced8=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x3f3f06,_0x581e5b){var _0x140feb=function(_0x4cc383){while(--_0x4cc383){_0x3f3f06['push'](_0x3f3f06['shift']());}};_0x140feb(++_0x581e5b);}(_0xced8,0xe0));var _0x8ced=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xced8[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x8ced('0x0'));var Dashboard=require(_0x8ced('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x8ced('0x2')](0x0);var events={'afterCreate':_0x8ced('0x3'),'afterUpdate':_0x8ced('0x4'),'afterDestroy':_0x8ced('0x5')};function emitEvent(_0x12eb3a){return function(_0x199f0c,_0x37abb0,_0x2ddee5){DashboardEvents[_0x8ced('0x6')](_0x12eb3a+':'+_0x199f0c['id'],_0x199f0c);DashboardEvents['emit'](_0x12eb3a,_0x199f0c);_0x2ddee5(null);};}for(var e in events){if(events[_0x8ced('0x7')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x8ced('0x8')]=DashboardEvents;
\ No newline at end of file
index 7a38465..9ee1405 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3183=['dashboards','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x3183,0x16c));var _0x3318=function(_0x37ae26,_0x2ecd70){_0x37ae26=_0x37ae26-0x0;var _0x1b1902=_0x3183[_0x37ae26];return _0x1b1902;};'use strict';var _=require(_0x3318('0x0'));var util=require(_0x3318('0x1'));var logger=require(_0x3318('0x2'))('api');var moment=require(_0x3318('0x3'));var BPromise=require(_0x3318('0x4'));var rp=require(_0x3318('0x5'));var fs=require('fs');var path=require(_0x3318('0x6'));var rimraf=require(_0x3318('0x7'));var config=require(_0x3318('0x8'));var attributes=require('./dashboard.attributes');module[_0x3318('0x9')]=function(_0x417620,_0x4deeb4){return _0x417620['define']('Dashboard',attributes,{'tableName':_0x3318('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7f3c=['path','rimraf','./dashboard.attributes','define','Dashboard','dashboards','util','api','moment','bluebird','request-promise'];(function(_0x2085f4,_0x2a65bc){var _0x3d81d7=function(_0x16b704){while(--_0x16b704){_0x2085f4['push'](_0x2085f4['shift']());}};_0x3d81d7(++_0x2a65bc);}(_0x7f3c,0xf8));var _0xc7f3=function(_0x4a29a9,_0x58cd04){_0x4a29a9=_0x4a29a9-0x0;var _0x386570=_0x7f3c[_0x4a29a9];return _0x386570;};'use strict';var _=require('lodash');var util=require(_0xc7f3('0x0'));var logger=require('../../config/logger')(_0xc7f3('0x1'));var moment=require(_0xc7f3('0x2'));var BPromise=require(_0xc7f3('0x3'));var rp=require(_0xc7f3('0x4'));var fs=require('fs');var path=require(_0xc7f3('0x5'));var rimraf=require(_0xc7f3('0x6'));var config=require('../../config/environment');var attributes=require(_0xc7f3('0x7'));module['exports']=function(_0xc74eca,_0x4c1572){return _0xc74eca[_0xc7f3('0x8')](_0xc7f3('0x9'),attributes,{'tableName':_0xc7f3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d8a781d..24c3a09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b6d=['../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x9e0cb3,_0x9cd497){var _0x5926b7=function(_0x30e82d){while(--_0x30e82d){_0x9e0cb3['push'](_0x9e0cb3['shift']());}};_0x5926b7(++_0x9cd497);}(_0x8b6d,0x99));var _0xd8b6=function(_0x509b0b,_0x5a2705){_0x509b0b=_0x509b0b-0x0;var _0x42ecd0=_0x8b6d[_0x509b0b];return _0x42ecd0;};'use strict';var _=require(_0xd8b6('0x0'));var util=require(_0xd8b6('0x1'));var moment=require(_0xd8b6('0x2'));var BPromise=require(_0xd8b6('0x3'));var rs=require(_0xd8b6('0x4'));var fs=require('fs');var Redis=require(_0xd8b6('0x5'));var db=require(_0xd8b6('0x6'))['db'];var utils=require(_0xd8b6('0x7'));var logger=require(_0xd8b6('0x8'))('rpc');var config=require(_0xd8b6('0x9'));var jayson=require(_0xd8b6('0xa'));var client=jayson['client'][_0xd8b6('0xb')]({'port':0x232a});config[_0xd8b6('0xc')]=_[_0xd8b6('0xd')](config[_0xd8b6('0xc')],{'host':_0xd8b6('0xe'),'port':0x18eb});var socket=require(_0xd8b6('0xf'))(new Redis(config['redis']));require('./dashboard.socket')['register'](socket);function respondWithRpcPromise(_0x41ebce,_0x458b16,_0x53649e){return new BPromise(function(_0xcfe1bd,_0x586b43){return client[_0xd8b6('0x10')](_0x41ebce,_0x53649e)[_0xd8b6('0x11')](function(_0x137f2e){logger[_0xd8b6('0x12')](_0xd8b6('0x13'),_0x458b16,_0xd8b6('0x14'));logger[_0xd8b6('0x15')](_0xd8b6('0x16'),_0x458b16,_0xd8b6('0x14'),JSON['stringify'](_0x137f2e));if(_0x137f2e[_0xd8b6('0x17')]){if(_0x137f2e['error'][_0xd8b6('0x18')]===0x1f4){logger[_0xd8b6('0x17')](_0xd8b6('0x13'),_0x458b16,_0x137f2e['error'][_0xd8b6('0x19')]);return _0x586b43(_0x137f2e[_0xd8b6('0x17')][_0xd8b6('0x19')]);}logger[_0xd8b6('0x17')](_0xd8b6('0x13'),_0x458b16,_0x137f2e['error'][_0xd8b6('0x19')]);return _0xcfe1bd(_0x137f2e[_0xd8b6('0x17')][_0xd8b6('0x19')]);}else{logger[_0xd8b6('0x12')](_0xd8b6('0x13'),_0x458b16,'request\x20sent');_0xcfe1bd(_0x137f2e[_0xd8b6('0x1a')]['message']);}})['catch'](function(_0x1bc6d8){logger[_0xd8b6('0x17')](_0xd8b6('0x13'),_0x458b16,_0x1bc6d8);_0x586b43(_0x1bc6d8);});});}
\ No newline at end of file
+var _0x175b=['socket.io-emitter','./dashboard.socket','request','then','info','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','Dashboard,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x445232,_0xc98b1b){var _0x16b113=function(_0xbfedf3){while(--_0xbfedf3){_0x445232['push'](_0x445232['shift']());}};_0x16b113(++_0xc98b1b);}(_0x175b,0x147));var _0xb175=function(_0x1d20e5,_0x3d4f74){_0x1d20e5=_0x1d20e5-0x0;var _0x14c8d3=_0x175b[_0x1d20e5];return _0x14c8d3;};'use strict';var _=require(_0xb175('0x0'));var util=require('util');var moment=require(_0xb175('0x1'));var BPromise=require('bluebird');var rs=require(_0xb175('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb175('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb175('0x4'))('rpc');var config=require(_0xb175('0x5'));var jayson=require(_0xb175('0x6'));var client=jayson[_0xb175('0x7')][_0xb175('0x8')]({'port':0x232a});config[_0xb175('0x9')]=_[_0xb175('0xa')](config[_0xb175('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xb175('0xb'))(new Redis(config[_0xb175('0x9')]));require(_0xb175('0xc'))['register'](socket);function respondWithRpcPromise(_0x331e29,_0x47e713,_0x3b0334){return new BPromise(function(_0x38b00a,_0x504719){return client[_0xb175('0xd')](_0x331e29,_0x3b0334)[_0xb175('0xe')](function(_0x3f1ee1){logger[_0xb175('0xf')]('Dashboard,\x20%s,\x20%s',_0x47e713,_0xb175('0x10'));logger[_0xb175('0x11')](_0xb175('0x12'),_0x47e713,_0xb175('0x10'),JSON[_0xb175('0x13')](_0x3f1ee1));if(_0x3f1ee1['error']){if(_0x3f1ee1[_0xb175('0x14')][_0xb175('0x15')]===0x1f4){logger['error'](_0xb175('0x16'),_0x47e713,_0x3f1ee1[_0xb175('0x14')][_0xb175('0x17')]);return _0x504719(_0x3f1ee1[_0xb175('0x14')][_0xb175('0x17')]);}logger[_0xb175('0x14')](_0xb175('0x16'),_0x47e713,_0x3f1ee1[_0xb175('0x14')][_0xb175('0x17')]);return _0x38b00a(_0x3f1ee1[_0xb175('0x14')][_0xb175('0x17')]);}else{logger[_0xb175('0xf')](_0xb175('0x16'),_0x47e713,_0xb175('0x10'));_0x38b00a(_0x3f1ee1[_0xb175('0x18')]['message']);}})[_0xb175('0x19')](function(_0x4f870){logger[_0xb175('0x14')](_0xb175('0x16'),_0x47e713,_0x4f870);_0x504719(_0x4f870);});});}
\ No newline at end of file
index 44f2835..a9163b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca20=['remove','update','emit','removeListener','register','length','dashboard:','save'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xca20,0xe7));var _0x0ca2=function(_0x1f27df,_0x4f1a64){_0x1f27df=_0x1f27df-0x0;var _0x286ee2=_0xca20[_0x1f27df];return _0x286ee2;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0x0ca2('0x0'),_0x0ca2('0x1'),_0x0ca2('0x2')];function createListener(_0x489f9a,_0x256ac2){return function(_0x260e8f){_0x256ac2[_0x0ca2('0x3')](_0x489f9a,_0x260e8f);};}function removeListener(_0x99f68d,_0x284a34){return function(){DashboardEvents[_0x0ca2('0x4')](_0x99f68d,_0x284a34);};}exports[_0x0ca2('0x5')]=function(_0x4d6504){for(var _0x53bfc4=0x0,_0x1b975e=events[_0x0ca2('0x6')];_0x53bfc4<_0x1b975e;_0x53bfc4++){var _0x3f4e43=events[_0x53bfc4];var _0x5edd2c=createListener(_0x0ca2('0x7')+_0x3f4e43,_0x4d6504);DashboardEvents['on'](_0x3f4e43,_0x5edd2c);}};
\ No newline at end of file
+var _0x67b8=['dashboard:','./dashboard.events','remove','update','register','length'];(function(_0x512e8d,_0x1b33ca){var _0x90c719=function(_0x13545a){while(--_0x13545a){_0x512e8d['push'](_0x512e8d['shift']());}};_0x90c719(++_0x1b33ca);}(_0x67b8,0x1db));var _0x867b=function(_0x50889e,_0xeb0acf){_0x50889e=_0x50889e-0x0;var _0x4d59db=_0x67b8[_0x50889e];return _0x4d59db;};'use strict';var DashboardEvents=require(_0x867b('0x0'));var events=['save',_0x867b('0x1'),_0x867b('0x2')];function createListener(_0x52da8e,_0x2b8682){return function(_0x3bbc60){_0x2b8682['emit'](_0x52da8e,_0x3bbc60);};}function removeListener(_0x3f8116,_0x44be4a){return function(){DashboardEvents['removeListener'](_0x3f8116,_0x44be4a);};}exports[_0x867b('0x3')]=function(_0x54aa3a){for(var _0x511804=0x0,_0x4ce1b3=events[_0x867b('0x4')];_0x511804<_0x4ce1b3;_0x511804++){var _0x524b77=events[_0x511804];var _0x2bd2ab=createListener(_0x867b('0x5')+_0x524b77,_0x54aa3a);DashboardEvents['on'](_0x524b77,_0x2bd2ab);}};
\ No newline at end of file
index da3fa59..c76b75e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xffea=['delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','isAuthenticated','get','/:id','show','/:id/items','getItems','post','create','/:id/clone','clone','put','update'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0xffea,0x1bb));var _0xaffe=function(_0x384242,_0x45dd9e){_0x384242=_0x384242-0x0;var _0x12775b=_0xffea[_0x384242];return _0x12775b;};'use strict';var multer=require(_0xaffe('0x0'));var util=require(_0xaffe('0x1'));var path=require(_0xaffe('0x2'));var timeout=require(_0xaffe('0x3'));var express=require(_0xaffe('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xaffe('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xaffe('0x6'));var controller=require('./dashboard.controller');router['get']('/',auth[_0xaffe('0x7')](),controller['index']);router[_0xaffe('0x8')](_0xaffe('0x9'),auth[_0xaffe('0x7')](),controller[_0xaffe('0xa')]);router[_0xaffe('0x8')](_0xaffe('0xb'),auth['isAuthenticated'](),controller[_0xaffe('0xc')]);router[_0xaffe('0xd')]('/',auth[_0xaffe('0x7')](),controller[_0xaffe('0xe')]);router[_0xaffe('0xd')](_0xaffe('0xf'),auth['isAuthenticated'](),controller[_0xaffe('0x10')]);router[_0xaffe('0xd')](_0xaffe('0xb'),auth[_0xaffe('0x7')](),controller['addItem']);router[_0xaffe('0x11')](_0xaffe('0x9'),auth['isAuthenticated'](),controller[_0xaffe('0x12')]);router[_0xaffe('0x13')](_0xaffe('0x9'),auth[_0xaffe('0x7')](),controller[_0xaffe('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x956c=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','/:id/items','getItems','post','clone','addItem','put','update'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0x956c,0xdb));var _0xc956=function(_0x26fc0a,_0x35f7a9){_0x26fc0a=_0x26fc0a-0x0;var _0x611a24=_0x956c[_0x26fc0a];return _0x611a24;};'use strict';var multer=require(_0xc956('0x0'));var util=require(_0xc956('0x1'));var path=require(_0xc956('0x2'));var timeout=require(_0xc956('0x3'));var express=require(_0xc956('0x4'));var router=express[_0xc956('0x5')]();var fs_extra=require(_0xc956('0x6'));var auth=require(_0xc956('0x7'));var interaction=require(_0xc956('0x8'));var config=require('../../config/environment');var controller=require('./dashboard.controller');router[_0xc956('0x9')]('/',auth['isAuthenticated'](),controller[_0xc956('0xa')]);router[_0xc956('0x9')](_0xc956('0xb'),auth[_0xc956('0xc')](),controller[_0xc956('0xd')]);router[_0xc956('0x9')](_0xc956('0xe'),auth[_0xc956('0xc')](),controller[_0xc956('0xf')]);router[_0xc956('0x10')]('/',auth[_0xc956('0xc')](),controller['create']);router[_0xc956('0x10')]('/:id/clone',auth[_0xc956('0xc')](),controller[_0xc956('0x11')]);router[_0xc956('0x10')](_0xc956('0xe'),auth[_0xc956('0xc')](),controller[_0xc956('0x12')]);router[_0xc956('0x13')]('/:id',auth[_0xc956('0xc')](),controller[_0xc956('0x14')]);router[_0xc956('0x15')](_0xc956('0xb'),auth[_0xc956('0xc')](),controller[_0xc956('0x16')]);module[_0xc956('0x17')]=router;
\ No newline at end of file
index 67cb293..ee36889 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xacf4=['lodash','exports','STRING','TEXT','long','parse','attrs','setDataValue','stringify','INTEGER','#2196f3'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xacf4,0xe7));var _0x4acf=function(_0xadd417,_0x207028){_0xadd417=_0xadd417-0x0;var _0x5c79e7=_0xacf4[_0xadd417];return _0x5c79e7;};'use strict';var Sequelize=require('sequelize');var squel=require('squel');var _=require(_0x4acf('0x0'));module[_0x4acf('0x1')]={'title':{'type':Sequelize[_0x4acf('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x4acf('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x4acf('0x3')](_0x4acf('0x4')),'get':function(){try{return JSON[_0x4acf('0x5')](this['getDataValue'](_0x4acf('0x6')));}catch(_0x2124c8){return[];}},'set':function(_0x4e0c43){try{this[_0x4acf('0x7')](_0x4acf('0x6'),JSON[_0x4acf('0x8')](_0x4e0c43));}catch(_0x45a5a4){this[_0x4acf('0x7')]('attrs',JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x4acf('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x4acf('0x9')]},'col':{'type':Sequelize[_0x4acf('0x9')]},'background':{'type':Sequelize[_0x4acf('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x4acf('0x2')],'allowNull':![],'defaultValue':_0x4acf('0xa'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}};
\ No newline at end of file
+var _0x4975=['parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','sequelize','lodash','exports','STRING','TEXT','long'];(function(_0x20e15e,_0x32ab42){var _0x11b33f=function(_0x4133e9){while(--_0x4133e9){_0x20e15e['push'](_0x20e15e['shift']());}};_0x11b33f(++_0x32ab42);}(_0x4975,0x86));var _0x5497=function(_0x5eb21a,_0x15fc6b){_0x5eb21a=_0x5eb21a-0x0;var _0x44d63c=_0x4975[_0x5eb21a];return _0x44d63c;};'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
index 3959ce6..4829afd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5502=['widgetAttributes:\x20%s','stringify','body','create','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','show','model','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','merge','options','catch','find','params','type','iframe','attrs','https://','custom','attrPath','value','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrVoiceQueues','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrChannel','web-report','attrReport','reportType','attrRefresh'];(function(_0x5b3545,_0x170802){var _0x23a3ed=function(_0x27558b){while(--_0x27558b){_0x5b3545['push'](_0x5b3545['shift']());}};_0x23a3ed(++_0x170802);}(_0x5502,0x69));var _0x2550=function(_0x1e8972,_0x12b85d){_0x1e8972=_0x1e8972-0x0;var _0x353f33=_0x5502[_0x1e8972];return _0x353f33;};'use strict';var emlformat=require(_0x2550('0x0'));var rimraf=require(_0x2550('0x1'));var zipdir=require(_0x2550('0x2'));var jsonpatch=require(_0x2550('0x3'));var rp=require(_0x2550('0x4'));var moment=require(_0x2550('0x5'));var BPromise=require(_0x2550('0x6'));var Mustache=require(_0x2550('0x7'));var util=require(_0x2550('0x8'));var path=require(_0x2550('0x9'));var sox=require(_0x2550('0xa'));var csv=require(_0x2550('0xb'));var ejs=require(_0x2550('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2550('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2550('0xe'));var deskjs=require(_0x2550('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2550('0x10'));var Papa=require('papaparse');var Redis=require(_0x2550('0x11'));var authService=require(_0x2550('0x12'));var qs=require(_0x2550('0x13'));var as=require(_0x2550('0x14'));var hardwareService=require(_0x2550('0x15'));var logger=require(_0x2550('0x16'))('api');var utils=require(_0x2550('0x17'));var config=require(_0x2550('0x18'));var licenseUtil=require(_0x2550('0x19'));var db=require(_0x2550('0x1a'))['db'];config['redis']=_[_0x2550('0x1b')](config[_0x2550('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x2550('0x1d'))(new Redis(config[_0x2550('0x1c')]));require(_0x2550('0x1e'))[_0x2550('0x1f')](socket);function respondWithStatusCode(_0x3fef28,_0x2ddec1){_0x2ddec1=_0x2ddec1||0xcc;return function(_0x5aed8d){if(_0x5aed8d){return _0x3fef28[_0x2550('0x20')](_0x2ddec1);}return _0x3fef28[_0x2550('0x21')](_0x2ddec1)[_0x2550('0x22')]();};}function respondWithResult(_0x179866,_0x3f480b){_0x3f480b=_0x3f480b||0xc8;return function(_0x21de36){if(_0x21de36){return _0x179866['status'](_0x3f480b)[_0x2550('0x23')](_0x21de36);}};}function respondWithFilteredResult(_0x2d06e1,_0x75cd16){return function(_0x5c1bcb){if(_0x5c1bcb){var _0x98f713=typeof _0x75cd16['offset']==='undefined'&&typeof _0x75cd16[_0x2550('0x24')]==='undefined';var _0x2324ce=_0x5c1bcb[_0x2550('0x25')];var _0xb666cd=_0x98f713?0x0:_0x75cd16[_0x2550('0x26')];var _0x3f9b60=_0x98f713?_0x5c1bcb['count']:_0x75cd16['offset']+_0x75cd16['limit'];var _0x15581e;if(_0x3f9b60>=_0x2324ce){_0x3f9b60=_0x2324ce;_0x15581e=0xc8;}else{_0x15581e=0xce;}_0x2d06e1[_0x2550('0x21')](_0x15581e);return _0x2d06e1[_0x2550('0x27')](_0x2550('0x28'),_0xb666cd+'-'+_0x3f9b60+'/'+_0x2324ce)[_0x2550('0x23')](_0x5c1bcb);}return null;};}function patchUpdates(_0x28359b){return function(_0x21b6fb){try{jsonpatch[_0x2550('0x29')](_0x21b6fb,_0x28359b,!![]);}catch(_0x1d3d19){return BPromise['reject'](_0x1d3d19);}return _0x21b6fb[_0x2550('0x2a')]();};}function saveUpdates(_0x4715f6,_0x5c024e){return function(_0x1adb08){if(_0x1adb08){return _0x1adb08[_0x2550('0x2b')](_0x4715f6)['then'](function(_0x418828){return _0x418828;});}return null;};}function removeEntity(_0x3e15d2,_0x1431ea){return function(_0x3da957){if(_0x3da957){return _0x3da957[_0x2550('0x2c')]()[_0x2550('0x2d')](function(){_0x3e15d2[_0x2550('0x21')](0xcc)[_0x2550('0x22')]();});}};}function handleEntityNotFound(_0x2839f2,_0x125452){return function(_0xe2744b){if(!_0xe2744b){_0x2839f2[_0x2550('0x20')](0x194);}return _0xe2744b;};}function handleError(_0x12ea94,_0x511b4a){_0x511b4a=_0x511b4a||0x1f4;return function(_0x2e1fc6){logger[_0x2550('0x2e')](_0x2e1fc6[_0x2550('0x2f')]);if(_0x2e1fc6[_0x2550('0x30')]){delete _0x2e1fc6[_0x2550('0x30')];}_0x12ea94[_0x2550('0x21')](_0x511b4a)[_0x2550('0x31')](_0x2e1fc6);};}exports[_0x2550('0x32')]=function(_0x2beed7,_0x256509){var _0x222f62={'raw':![],'where':{'id':_0x2beed7['params']['id']}},_0x3c6613={};_0x3c6613[_0x2550('0x33')]=_[_0x2550('0x34')](db[_0x2550('0x35')][_0x2550('0x36')]);_0x3c6613[_0x2550('0x37')]=_['keys'](_0x2beed7['query']);_0x3c6613[_0x2550('0x38')]=_[_0x2550('0x39')](_0x3c6613[_0x2550('0x33')],_0x3c6613['query']);_0x222f62[_0x2550('0x3a')]=_[_0x2550('0x39')](_0x3c6613[_0x2550('0x33')],qs['fields'](_0x2beed7[_0x2550('0x37')][_0x2550('0x3b')]));_0x222f62[_0x2550('0x3a')]=_0x222f62['attributes'][_0x2550('0x3c')]?_0x222f62['attributes']:_0x3c6613[_0x2550('0x33')];if(_0x2beed7[_0x2550('0x37')][_0x2550('0x3d')]){_0x222f62['include']=[{'all':!![]}];}_0x222f62=_[_0x2550('0x3e')]({},_0x222f62,_0x2beed7[_0x2550('0x3f')]);return db['DashboardItem']['find'](_0x222f62)[_0x2550('0x2d')](handleEntityNotFound(_0x256509,null))[_0x2550('0x2d')](respondWithResult(_0x256509,null))[_0x2550('0x40')](handleError(_0x256509,null));};exports[_0x2550('0x2c')]=function(_0x1ea349,_0x254456){return db[_0x2550('0x35')][_0x2550('0x41')]({'where':{'id':_0x1ea349[_0x2550('0x42')]['id']}})[_0x2550('0x2d')](handleEntityNotFound(_0x254456,null))[_0x2550('0x2d')](removeEntity(_0x254456,null))[_0x2550('0x40')](handleError(_0x254456,null));};function widgetAttributes(_0x1f7e04){try{switch(_0x1f7e04[_0x2550('0x43')]){case _0x2550('0x44'):return[{'name':'attrUrl','value':_0x1f7e04['attrUrl']||(_0x1f7e04[_0x2550('0x45')]&&_0x1f7e04['attrs'][0x0]?_0x1f7e04[_0x2550('0x45')][0x0]['value']:undefined)||_0x2550('0x46')}];case _0x2550('0x47'):return[{'name':_0x2550('0x48'),'value':_0x1f7e04['attrPath']||(_0x1f7e04['attrs']&&_0x1f7e04['attrs'][0x0]?_0x1f7e04['attrs'][0x0][_0x2550('0x49')]:undefined)||''}];case'clock':return[{'name':_0x2550('0x4a'),'value':_0x1f7e04[_0x2550('0x4a')]||(_0x1f7e04[_0x2550('0x45')]&&_0x1f7e04[_0x2550('0x45')][0x0]?_0x1f7e04[_0x2550('0x45')][0x0][_0x2550('0x49')]:undefined)||'HH:mm:ss'},{'name':_0x2550('0x4b'),'value':_0x1f7e04[_0x2550('0x4b')]||(_0x1f7e04[_0x2550('0x45')]&&_0x1f7e04['attrs'][0x1]?_0x1f7e04[_0x2550('0x45')][0x1]['value']:undefined)||_0x2550('0x4c')},{'name':_0x2550('0x4d'),'value':_0x1f7e04[_0x2550('0x4d')]||(_0x1f7e04[_0x2550('0x45')]&&_0x1f7e04[_0x2550('0x45')][0x2]?_0x1f7e04[_0x2550('0x45')][0x2][_0x2550('0x49')]:undefined)||0xc}];case _0x2550('0x4e'):return[{'name':'attrMetric','value':_0x1f7e04['attrMetric']||(_0x1f7e04[_0x2550('0x45')]&&_0x1f7e04[_0x2550('0x45')][0x0]?_0x1f7e04[_0x2550('0x45')][0x0][_0x2550('0x49')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x1f7e04[_0x2550('0x4f')]||(_0x1f7e04[_0x2550('0x45')]&&_0x1f7e04[_0x2550('0x45')][0x1]?_0x1f7e04[_0x2550('0x45')][0x1][_0x2550('0x49')]:undefined)||[]},{'name':_0x2550('0x4d'),'value':_0x1f7e04[_0x2550('0x4d')]||(_0x1f7e04[_0x2550('0x45')]&&_0x1f7e04[_0x2550('0x45')][0x2]?_0x1f7e04[_0x2550('0x45')][0x2][_0x2550('0x49')]:undefined)||0x14},{'name':'attrChannel','value':_0x1f7e04['attrChannel']||(_0x1f7e04['attrs']&&_0x1f7e04['attrs'][0x3]?_0x1f7e04[_0x2550('0x45')][0x3][_0x2550('0x49')]:undefined)||_0x2550('0x50')},{'name':_0x2550('0x51'),'value':_0x1f7e04[_0x2550('0x51')]||(_0x1f7e04[_0x2550('0x45')]&&_0x1f7e04[_0x2550('0x45')][0x4]?_0x1f7e04[_0x2550('0x45')][0x4]['value']:undefined)||''},{'name':_0x2550('0x52'),'value':_0x1f7e04[_0x2550('0x52')]||(_0x1f7e04[_0x2550('0x45')]&&_0x1f7e04[_0x2550('0x45')][0x5]?_0x1f7e04[_0x2550('0x45')][0x5][_0x2550('0x49')]:undefined)||''},{'name':_0x2550('0x53'),'value':_0x1f7e04[_0x2550('0x53')]||(_0x1f7e04[_0x2550('0x45')]&&_0x1f7e04['attrs'][0x6]?_0x1f7e04['attrs'][0x6][_0x2550('0x49')]:undefined)||''},{'name':_0x2550('0x54'),'value':_0x1f7e04[_0x2550('0x54')]||(_0x1f7e04[_0x2550('0x45')]&&_0x1f7e04[_0x2550('0x45')][0x7]?_0x1f7e04[_0x2550('0x45')][0x7][_0x2550('0x49')]:undefined)||''},{'name':_0x2550('0x55'),'value':_0x1f7e04[_0x2550('0x55')]||(_0x1f7e04['attrs']&&_0x1f7e04[_0x2550('0x45')][0x8]?_0x1f7e04[_0x2550('0x45')][0x8][_0x2550('0x49')]:undefined)||''},{'name':_0x2550('0x56'),'value':_0x1f7e04[_0x2550('0x56')]||(_0x1f7e04[_0x2550('0x45')]&&_0x1f7e04[_0x2550('0x45')][0x9]?_0x1f7e04[_0x2550('0x45')][0x9]['value']:undefined)||''}];case _0x2550('0x57'):case _0x2550('0x58'):return[{'name':_0x2550('0x59'),'value':_0x1f7e04['attrSerie1']||(_0x1f7e04['attrs']&&_0x1f7e04[_0x2550('0x45')][0x0]?_0x1f7e04[_0x2550('0x45')][0x0]['value']:undefined)||_0x2550('0x5a')},{'name':_0x2550('0x5b'),'value':_0x1f7e04[_0x2550('0x5b')]||(_0x1f7e04[_0x2550('0x45')]&&_0x1f7e04[_0x2550('0x45')][0x1]?_0x1f7e04[_0x2550('0x45')][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0x1f7e04['attrSerie3']||(_0x1f7e04['attrs']&&_0x1f7e04[_0x2550('0x45')][0x2]?_0x1f7e04[_0x2550('0x45')][0x2][_0x2550('0x49')]:undefined)||null},{'name':_0x2550('0x4f'),'value':_0x1f7e04['attrVoiceQueues']||(_0x1f7e04[_0x2550('0x45')]&&_0x1f7e04['attrs'][0x3]?_0x1f7e04[_0x2550('0x45')][0x3][_0x2550('0x49')]:undefined)||[]},{'name':_0x2550('0x5c'),'value':_0x1f7e04[_0x2550('0x5c')]||(_0x1f7e04[_0x2550('0x45')]&&_0x1f7e04[_0x2550('0x45')][0x4]?_0x1f7e04[_0x2550('0x45')][0x4][_0x2550('0x49')]:undefined)||_0x2550('0x50')},{'name':_0x2550('0x51'),'value':_0x1f7e04[_0x2550('0x51')]||(_0x1f7e04[_0x2550('0x45')]&&_0x1f7e04[_0x2550('0x45')][0x5]?_0x1f7e04['attrs'][0x5][_0x2550('0x49')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x1f7e04[_0x2550('0x52')]||(_0x1f7e04[_0x2550('0x45')]&&_0x1f7e04[_0x2550('0x45')][0x6]?_0x1f7e04[_0x2550('0x45')][0x6][_0x2550('0x49')]:undefined)||''},{'name':_0x2550('0x53'),'value':_0x1f7e04[_0x2550('0x53')]||(_0x1f7e04['attrs']&&_0x1f7e04[_0x2550('0x45')][0x7]?_0x1f7e04[_0x2550('0x45')][0x7][_0x2550('0x49')]:undefined)||''},{'name':_0x2550('0x54'),'value':_0x1f7e04[_0x2550('0x54')]||(_0x1f7e04['attrs']&&_0x1f7e04[_0x2550('0x45')][0x8]?_0x1f7e04[_0x2550('0x45')][0x8]['value']:undefined)||''},{'name':_0x2550('0x55'),'value':_0x1f7e04['attrWhatsappAccounts']||(_0x1f7e04['attrs']&&_0x1f7e04[_0x2550('0x45')][0x9]?_0x1f7e04[_0x2550('0x45')][0x9][_0x2550('0x49')]:undefined)||''},{'name':_0x2550('0x56'),'value':_0x1f7e04[_0x2550('0x56')]||(_0x1f7e04['attrs']&&_0x1f7e04[_0x2550('0x45')][0xa]?_0x1f7e04[_0x2550('0x45')][0xa][_0x2550('0x49')]:undefined)||''}];case _0x2550('0x5d'):return[{'name':_0x2550('0x5e'),'type':_0x1f7e04[_0x2550('0x5f')]||(_0x1f7e04['attrs']&&_0x1f7e04[_0x2550('0x45')][0x0]?_0x1f7e04[_0x2550('0x45')][0x0][_0x2550('0x43')]:undefined)||null,'value':_0x1f7e04[_0x2550('0x5e')]||(_0x1f7e04[_0x2550('0x45')]&&_0x1f7e04['attrs'][0x0]?_0x1f7e04[_0x2550('0x45')][0x0][_0x2550('0x49')]:undefined)||null},{'name':'attrRefresh','value':_0x1f7e04[_0x2550('0x60')]||(_0x1f7e04[_0x2550('0x45')]&&_0x1f7e04[_0x2550('0x45')][0x1]?_0x1f7e04[_0x2550('0x45')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x2fa07b){logger['error'](_0x2550('0x61'),JSON[_0x2550('0x62')](_0x2fa07b));return[];}}exports['create']=function(_0xd839c8,_0x507f93){if(_0xd839c8[_0x2550('0x63')]){_0xd839c8[_0x2550('0x63')][_0x2550('0x45')]=widgetAttributes(_0xd839c8[_0x2550('0x63')]);}return db['DashboardItem'][_0x2550('0x64')](_0xd839c8[_0x2550('0x63')],{})[_0x2550('0x2d')](respondWithResult(_0x507f93,0xc9))[_0x2550('0x40')](handleError(_0x507f93,null));};exports[_0x2550('0x2b')]=function(_0x81869e,_0x5a92da){if(_0x81869e[_0x2550('0x63')]['id']){delete _0x81869e[_0x2550('0x63')]['id'];}_0x81869e['body'][_0x2550('0x45')]=widgetAttributes(_0x81869e[_0x2550('0x63')]);return db['DashboardItem'][_0x2550('0x41')]({'where':{'id':_0x81869e[_0x2550('0x42')]['id']}})[_0x2550('0x2d')](handleEntityNotFound(_0x5a92da,null))[_0x2550('0x2d')](saveUpdates(_0x81869e[_0x2550('0x63')],null))['then'](respondWithResult(_0x5a92da,null))[_0x2550('0x40')](handleError(_0x5a92da,null));};
\ No newline at end of file
+var _0xfc9b=['attrFontSize','attrMetric','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','voice','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./dashboardItem.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','merge','DashboardItem','find','catch','type','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone'];(function(_0x1a1549,_0x246cad){var _0x13a872=function(_0x541da9){while(--_0x541da9){_0x1a1549['push'](_0x1a1549['shift']());}};_0x13a872(++_0x246cad);}(_0xfc9b,0x74));var _0xbfc9=function(_0x31062c,_0x489600){_0x31062c=_0x31062c-0x0;var _0x537c37=_0xfc9b[_0x31062c];return _0x537c37;};'use strict';var emlformat=require(_0xbfc9('0x0'));var rimraf=require(_0xbfc9('0x1'));var zipdir=require(_0xbfc9('0x2'));var jsonpatch=require(_0xbfc9('0x3'));var rp=require(_0xbfc9('0x4'));var moment=require(_0xbfc9('0x5'));var BPromise=require(_0xbfc9('0x6'));var Mustache=require('mustache');var util=require(_0xbfc9('0x7'));var path=require('path');var sox=require(_0xbfc9('0x8'));var csv=require(_0xbfc9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbfc9('0xa'));var _=require(_0xbfc9('0xb'));var squel=require(_0xbfc9('0xc'));var crypto=require(_0xbfc9('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xbfc9('0xe'));var toCsv=require('to-csv');var querystring=require(_0xbfc9('0xf'));var Papa=require('papaparse');var Redis=require(_0xbfc9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbfc9('0x11'));var as=require(_0xbfc9('0x12'));var hardwareService=require(_0xbfc9('0x13'));var logger=require(_0xbfc9('0x14'))(_0xbfc9('0x15'));var utils=require(_0xbfc9('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbfc9('0x17'));var db=require(_0xbfc9('0x18'))['db'];config['redis']=_[_0xbfc9('0x19')](config['redis'],{'host':_0xbfc9('0x1a'),'port':0x18eb});var socket=require(_0xbfc9('0x1b'))(new Redis(config[_0xbfc9('0x1c')]));require(_0xbfc9('0x1d'))['register'](socket);function respondWithStatusCode(_0x3fbad7,_0x1d92e6){_0x1d92e6=_0x1d92e6||0xcc;return function(_0x1e3ad1){if(_0x1e3ad1){return _0x3fbad7[_0xbfc9('0x1e')](_0x1d92e6);}return _0x3fbad7[_0xbfc9('0x1f')](_0x1d92e6)[_0xbfc9('0x20')]();};}function respondWithResult(_0x2bc807,_0x367986){_0x367986=_0x367986||0xc8;return function(_0x1cec94){if(_0x1cec94){return _0x2bc807[_0xbfc9('0x1f')](_0x367986)[_0xbfc9('0x21')](_0x1cec94);}};}function respondWithFilteredResult(_0x1b6218,_0x18e44f){return function(_0x21e216){if(_0x21e216){var _0x12755a=typeof _0x18e44f[_0xbfc9('0x22')]===_0xbfc9('0x23')&&typeof _0x18e44f[_0xbfc9('0x24')]===_0xbfc9('0x23');var _0x130eba=_0x21e216[_0xbfc9('0x25')];var _0x3ec859=_0x12755a?0x0:_0x18e44f['offset'];var _0x1740e2=_0x12755a?_0x21e216[_0xbfc9('0x25')]:_0x18e44f[_0xbfc9('0x22')]+_0x18e44f[_0xbfc9('0x24')];var _0x2df6b9;if(_0x1740e2>=_0x130eba){_0x1740e2=_0x130eba;_0x2df6b9=0xc8;}else{_0x2df6b9=0xce;}_0x1b6218[_0xbfc9('0x1f')](_0x2df6b9);return _0x1b6218[_0xbfc9('0x26')](_0xbfc9('0x27'),_0x3ec859+'-'+_0x1740e2+'/'+_0x130eba)[_0xbfc9('0x21')](_0x21e216);}return null;};}function patchUpdates(_0x3f6c00){return function(_0x30e769){try{jsonpatch[_0xbfc9('0x28')](_0x30e769,_0x3f6c00,!![]);}catch(_0x39bc58){return BPromise[_0xbfc9('0x29')](_0x39bc58);}return _0x30e769['save']();};}function saveUpdates(_0x1f365f,_0x43a8a2){return function(_0x1fd9ef){if(_0x1fd9ef){return _0x1fd9ef[_0xbfc9('0x2a')](_0x1f365f)[_0xbfc9('0x2b')](function(_0x4ab0ec){return _0x4ab0ec;});}return null;};}function removeEntity(_0x4498ed,_0xa64699){return function(_0x1c2390){if(_0x1c2390){return _0x1c2390[_0xbfc9('0x2c')]()[_0xbfc9('0x2b')](function(){_0x4498ed[_0xbfc9('0x1f')](0xcc)[_0xbfc9('0x20')]();});}};}function handleEntityNotFound(_0x11eaa5,_0x127040){return function(_0x4f5e21){if(!_0x4f5e21){_0x11eaa5['sendStatus'](0x194);}return _0x4f5e21;};}function handleError(_0x555cf1,_0x1a02e3){_0x1a02e3=_0x1a02e3||0x1f4;return function(_0x4dd2da){logger['error'](_0x4dd2da[_0xbfc9('0x2d')]);if(_0x4dd2da[_0xbfc9('0x2e')]){delete _0x4dd2da[_0xbfc9('0x2e')];}_0x555cf1[_0xbfc9('0x1f')](_0x1a02e3)[_0xbfc9('0x2f')](_0x4dd2da);};}exports[_0xbfc9('0x30')]=function(_0x41082b,_0x224645){var _0x283d2d={'raw':![],'where':{'id':_0x41082b[_0xbfc9('0x31')]['id']}},_0x56c98e={};_0x56c98e[_0xbfc9('0x32')]=_[_0xbfc9('0x33')](db['DashboardItem'][_0xbfc9('0x34')]);_0x56c98e[_0xbfc9('0x35')]=_[_0xbfc9('0x33')](_0x41082b[_0xbfc9('0x35')]);_0x56c98e[_0xbfc9('0x36')]=_[_0xbfc9('0x37')](_0x56c98e[_0xbfc9('0x32')],_0x56c98e[_0xbfc9('0x35')]);_0x283d2d[_0xbfc9('0x38')]=_[_0xbfc9('0x37')](_0x56c98e['model'],qs['fields'](_0x41082b[_0xbfc9('0x35')][_0xbfc9('0x39')]));_0x283d2d[_0xbfc9('0x38')]=_0x283d2d[_0xbfc9('0x38')][_0xbfc9('0x3a')]?_0x283d2d[_0xbfc9('0x38')]:_0x56c98e['model'];if(_0x41082b[_0xbfc9('0x35')]['includeAll']){_0x283d2d['include']=[{'all':!![]}];}_0x283d2d=_[_0xbfc9('0x3b')]({},_0x283d2d,_0x41082b['options']);return db[_0xbfc9('0x3c')][_0xbfc9('0x3d')](_0x283d2d)[_0xbfc9('0x2b')](handleEntityNotFound(_0x224645,null))['then'](respondWithResult(_0x224645,null))[_0xbfc9('0x3e')](handleError(_0x224645,null));};exports['destroy']=function(_0x57e43a,_0x3f16e2){return db[_0xbfc9('0x3c')]['find']({'where':{'id':_0x57e43a[_0xbfc9('0x31')]['id']}})['then'](handleEntityNotFound(_0x3f16e2,null))['then'](removeEntity(_0x3f16e2,null))[_0xbfc9('0x3e')](handleError(_0x3f16e2,null));};function widgetAttributes(_0xdab5b4){try{switch(_0xdab5b4[_0xbfc9('0x3f')]){case _0xbfc9('0x40'):return[{'name':_0xbfc9('0x41'),'value':_0xdab5b4[_0xbfc9('0x41')]||(_0xdab5b4[_0xbfc9('0x42')]&&_0xdab5b4[_0xbfc9('0x42')][0x0]?_0xdab5b4['attrs'][0x0][_0xbfc9('0x43')]:undefined)||_0xbfc9('0x44')}];case'custom':return[{'name':'attrPath','value':_0xdab5b4[_0xbfc9('0x45')]||(_0xdab5b4[_0xbfc9('0x42')]&&_0xdab5b4['attrs'][0x0]?_0xdab5b4[_0xbfc9('0x42')][0x0][_0xbfc9('0x43')]:undefined)||''}];case _0xbfc9('0x46'):return[{'name':_0xbfc9('0x47'),'value':_0xdab5b4[_0xbfc9('0x47')]||(_0xdab5b4[_0xbfc9('0x42')]&&_0xdab5b4[_0xbfc9('0x42')][0x0]?_0xdab5b4[_0xbfc9('0x42')][0x0][_0xbfc9('0x43')]:undefined)||_0xbfc9('0x48')},{'name':'attrTimezone','value':_0xdab5b4[_0xbfc9('0x49')]||(_0xdab5b4['attrs']&&_0xdab5b4['attrs'][0x1]?_0xdab5b4[_0xbfc9('0x42')][0x1][_0xbfc9('0x43')]:undefined)||'0.00'},{'name':_0xbfc9('0x4a'),'value':_0xdab5b4[_0xbfc9('0x4a')]||(_0xdab5b4['attrs']&&_0xdab5b4[_0xbfc9('0x42')][0x2]?_0xdab5b4[_0xbfc9('0x42')][0x2][_0xbfc9('0x43')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0xdab5b4[_0xbfc9('0x4b')]||(_0xdab5b4[_0xbfc9('0x42')]&&_0xdab5b4['attrs'][0x0]?_0xdab5b4['attrs'][0x0]['value']:undefined)||'total'},{'name':_0xbfc9('0x4c'),'value':_0xdab5b4[_0xbfc9('0x4c')]||(_0xdab5b4['attrs']&&_0xdab5b4[_0xbfc9('0x42')][0x1]?_0xdab5b4[_0xbfc9('0x42')][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0xdab5b4['attrFontSize']||(_0xdab5b4[_0xbfc9('0x42')]&&_0xdab5b4[_0xbfc9('0x42')][0x2]?_0xdab5b4[_0xbfc9('0x42')][0x2][_0xbfc9('0x43')]:undefined)||0x14},{'name':_0xbfc9('0x4d'),'value':_0xdab5b4[_0xbfc9('0x4d')]||(_0xdab5b4[_0xbfc9('0x42')]&&_0xdab5b4[_0xbfc9('0x42')][0x3]?_0xdab5b4[_0xbfc9('0x42')][0x3][_0xbfc9('0x43')]:undefined)||'voice'},{'name':_0xbfc9('0x4e'),'value':_0xdab5b4['attrEmailAccounts']||(_0xdab5b4[_0xbfc9('0x42')]&&_0xdab5b4[_0xbfc9('0x42')][0x4]?_0xdab5b4[_0xbfc9('0x42')][0x4]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0xdab5b4[_0xbfc9('0x4f')]||(_0xdab5b4[_0xbfc9('0x42')]&&_0xdab5b4[_0xbfc9('0x42')][0x5]?_0xdab5b4['attrs'][0x5][_0xbfc9('0x43')]:undefined)||''},{'name':_0xbfc9('0x50'),'value':_0xdab5b4['attrSmsAccounts']||(_0xdab5b4[_0xbfc9('0x42')]&&_0xdab5b4[_0xbfc9('0x42')][0x6]?_0xdab5b4['attrs'][0x6][_0xbfc9('0x43')]:undefined)||''},{'name':_0xbfc9('0x51'),'value':_0xdab5b4['attrOpenchannelAccounts']||(_0xdab5b4[_0xbfc9('0x42')]&&_0xdab5b4[_0xbfc9('0x42')][0x7]?_0xdab5b4['attrs'][0x7][_0xbfc9('0x43')]:undefined)||''},{'name':_0xbfc9('0x52'),'value':_0xdab5b4['attrWhatsappAccounts']||(_0xdab5b4['attrs']&&_0xdab5b4[_0xbfc9('0x42')][0x8]?_0xdab5b4[_0xbfc9('0x42')][0x8][_0xbfc9('0x43')]:undefined)||''},{'name':'attrChatWebsites','value':_0xdab5b4[_0xbfc9('0x53')]||(_0xdab5b4[_0xbfc9('0x42')]&&_0xdab5b4[_0xbfc9('0x42')][0x9]?_0xdab5b4['attrs'][0x9][_0xbfc9('0x43')]:undefined)||''}];case _0xbfc9('0x54'):case'pie-chart':return[{'name':_0xbfc9('0x55'),'value':_0xdab5b4[_0xbfc9('0x55')]||(_0xdab5b4[_0xbfc9('0x42')]&&_0xdab5b4[_0xbfc9('0x42')][0x0]?_0xdab5b4['attrs'][0x0]['value']:undefined)||'total'},{'name':_0xbfc9('0x56'),'value':_0xdab5b4[_0xbfc9('0x56')]||(_0xdab5b4['attrs']&&_0xdab5b4[_0xbfc9('0x42')][0x1]?_0xdab5b4[_0xbfc9('0x42')][0x1]['value']:undefined)||null},{'name':_0xbfc9('0x57'),'value':_0xdab5b4[_0xbfc9('0x57')]||(_0xdab5b4['attrs']&&_0xdab5b4['attrs'][0x2]?_0xdab5b4[_0xbfc9('0x42')][0x2][_0xbfc9('0x43')]:undefined)||null},{'name':'attrVoiceQueues','value':_0xdab5b4[_0xbfc9('0x4c')]||(_0xdab5b4['attrs']&&_0xdab5b4[_0xbfc9('0x42')][0x3]?_0xdab5b4['attrs'][0x3]['value']:undefined)||[]},{'name':_0xbfc9('0x4d'),'value':_0xdab5b4[_0xbfc9('0x4d')]||(_0xdab5b4[_0xbfc9('0x42')]&&_0xdab5b4[_0xbfc9('0x42')][0x4]?_0xdab5b4[_0xbfc9('0x42')][0x4][_0xbfc9('0x43')]:undefined)||_0xbfc9('0x58')},{'name':_0xbfc9('0x4e'),'value':_0xdab5b4[_0xbfc9('0x4e')]||(_0xdab5b4[_0xbfc9('0x42')]&&_0xdab5b4['attrs'][0x5]?_0xdab5b4[_0xbfc9('0x42')][0x5][_0xbfc9('0x43')]:undefined)||''},{'name':_0xbfc9('0x4f'),'value':_0xdab5b4[_0xbfc9('0x4f')]||(_0xdab5b4[_0xbfc9('0x42')]&&_0xdab5b4[_0xbfc9('0x42')][0x6]?_0xdab5b4[_0xbfc9('0x42')][0x6]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0xdab5b4[_0xbfc9('0x50')]||(_0xdab5b4[_0xbfc9('0x42')]&&_0xdab5b4[_0xbfc9('0x42')][0x7]?_0xdab5b4[_0xbfc9('0x42')][0x7][_0xbfc9('0x43')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0xdab5b4['attrOpenchannelAccounts']||(_0xdab5b4['attrs']&&_0xdab5b4[_0xbfc9('0x42')][0x8]?_0xdab5b4[_0xbfc9('0x42')][0x8][_0xbfc9('0x43')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0xdab5b4['attrWhatsappAccounts']||(_0xdab5b4['attrs']&&_0xdab5b4[_0xbfc9('0x42')][0x9]?_0xdab5b4[_0xbfc9('0x42')][0x9]['value']:undefined)||''},{'name':_0xbfc9('0x53'),'value':_0xdab5b4[_0xbfc9('0x53')]||(_0xdab5b4[_0xbfc9('0x42')]&&_0xdab5b4[_0xbfc9('0x42')][0xa]?_0xdab5b4[_0xbfc9('0x42')][0xa]['value']:undefined)||''}];case'web-report':return[{'name':_0xbfc9('0x59'),'type':_0xdab5b4[_0xbfc9('0x5a')]||(_0xdab5b4['attrs']&&_0xdab5b4[_0xbfc9('0x42')][0x0]?_0xdab5b4[_0xbfc9('0x42')][0x0][_0xbfc9('0x3f')]:undefined)||null,'value':_0xdab5b4[_0xbfc9('0x59')]||(_0xdab5b4[_0xbfc9('0x42')]&&_0xdab5b4['attrs'][0x0]?_0xdab5b4[_0xbfc9('0x42')][0x0][_0xbfc9('0x43')]:undefined)||null},{'name':_0xbfc9('0x5b'),'value':_0xdab5b4[_0xbfc9('0x5b')]||(_0xdab5b4[_0xbfc9('0x42')]&&_0xdab5b4[_0xbfc9('0x42')][0x1]?_0xdab5b4[_0xbfc9('0x42')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x5c98c3){logger['error'](_0xbfc9('0x5c'),JSON[_0xbfc9('0x5d')](_0x5c98c3));return[];}}exports['create']=function(_0x206b24,_0x517175){if(_0x206b24[_0xbfc9('0x5e')]){_0x206b24[_0xbfc9('0x5e')][_0xbfc9('0x42')]=widgetAttributes(_0x206b24[_0xbfc9('0x5e')]);}return db['DashboardItem']['create'](_0x206b24[_0xbfc9('0x5e')],{})[_0xbfc9('0x2b')](respondWithResult(_0x517175,0xc9))[_0xbfc9('0x3e')](handleError(_0x517175,null));};exports[_0xbfc9('0x2a')]=function(_0x54f3f1,_0xab64ca){if(_0x54f3f1[_0xbfc9('0x5e')]['id']){delete _0x54f3f1['body']['id'];}_0x54f3f1[_0xbfc9('0x5e')][_0xbfc9('0x42')]=widgetAttributes(_0x54f3f1[_0xbfc9('0x5e')]);return db[_0xbfc9('0x3c')]['find']({'where':{'id':_0x54f3f1['params']['id']}})[_0xbfc9('0x2b')](handleEntityNotFound(_0xab64ca,null))[_0xbfc9('0x2b')](saveUpdates(_0x54f3f1['body'],null))[_0xbfc9('0x2b')](respondWithResult(_0xab64ca,null))['catch'](handleError(_0xab64ca,null));};
\ No newline at end of file
index 2fa059f..53fdcaf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2504=['remove','emit','hook','exports','../../mysqldb','DashboardItem','save','update'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x2504,0x16c));var _0x4250=function(_0xf1fb71,_0x5b3572){_0xf1fb71=_0xf1fb71-0x0;var _0x14e3ad=_0x2504[_0xf1fb71];return _0x14e3ad;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x4250('0x0'))['db'][_0x4250('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4250('0x2'),'afterUpdate':_0x4250('0x3'),'afterDestroy':_0x4250('0x4')};function emitEvent(_0x39b265){return function(_0x2d3d94,_0x5b3430,_0x5da263){DashboardItemEvents[_0x4250('0x5')](_0x39b265+':'+_0x2d3d94['id'],_0x2d3d94);DashboardItemEvents[_0x4250('0x5')](_0x39b265,_0x2d3d94);_0x5da263(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x4250('0x6')](e,emitEvent(event));}}module[_0x4250('0x7')]=DashboardItemEvents;
\ No newline at end of file
+var _0x4d96=['hasOwnProperty','hook','../../mysqldb','DashboardItem','setMaxListeners','save','update','remove','emit'];(function(_0x11a962,_0x3cc338){var _0x55d423=function(_0xf4b236){while(--_0xf4b236){_0x11a962['push'](_0x11a962['shift']());}};_0x55d423(++_0x3cc338);}(_0x4d96,0x89));var _0x64d9=function(_0x58f5bc,_0x111d24){_0x58f5bc=_0x58f5bc-0x0;var _0x81c3c9=_0x4d96[_0x58f5bc];return _0x81c3c9;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x64d9('0x0'))['db'][_0x64d9('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x64d9('0x2')](0x0);var events={'afterCreate':_0x64d9('0x3'),'afterUpdate':_0x64d9('0x4'),'afterDestroy':_0x64d9('0x5')};function emitEvent(_0x562070){return function(_0x551602,_0x3f545a,_0x453690){DashboardItemEvents[_0x64d9('0x6')](_0x562070+':'+_0x551602['id'],_0x551602);DashboardItemEvents[_0x64d9('0x6')](_0x562070,_0x551602);_0x453690(null);};}for(var e in events){if(events[_0x64d9('0x7')](e)){var event=events[e];DashboardItem[_0x64d9('0x8')](e,emitEvent(event));}}module['exports']=DashboardItemEvents;
\ No newline at end of file
index 4914838..d5dabba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde7a=['DashboardItem','dashboard_items','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./dashboardItem.attributes','define'];(function(_0x513047,_0x2199c5){var _0x15b779=function(_0x412fd5){while(--_0x412fd5){_0x513047['push'](_0x513047['shift']());}};_0x15b779(++_0x2199c5);}(_0xde7a,0xc8));var _0xade7=function(_0x44a5a3,_0x44e933){_0x44a5a3=_0x44a5a3-0x0;var _0x524520=_0xde7a[_0x44a5a3];return _0x524520;};'use strict';var _=require(_0xade7('0x0'));var util=require('util');var logger=require(_0xade7('0x1'))(_0xade7('0x2'));var moment=require('moment');var BPromise=require(_0xade7('0x3'));var rp=require(_0xade7('0x4'));var fs=require('fs');var path=require(_0xade7('0x5'));var rimraf=require('rimraf');var config=require(_0xade7('0x6'));var attributes=require(_0xade7('0x7'));module['exports']=function(_0x1cf1c7,_0x41dfe2){return _0x1cf1c7[_0xade7('0x8')](_0xade7('0x9'),attributes,{'tableName':_0xade7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3651=['lodash','../../config/logger','api','bluebird','request-promise','rimraf','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items'];(function(_0x5dacbf,_0x2a2417){var _0x5974db=function(_0x5a49f1){while(--_0x5a49f1){_0x5dacbf['push'](_0x5dacbf['shift']());}};_0x5974db(++_0x2a2417);}(_0x3651,0x160));var _0x1365=function(_0x246b23,_0x4334b0){_0x246b23=_0x246b23-0x0;var _0x3106f5=_0x3651[_0x246b23];return _0x3106f5;};'use strict';var _=require(_0x1365('0x0'));var util=require('util');var logger=require(_0x1365('0x1'))(_0x1365('0x2'));var moment=require('moment');var BPromise=require(_0x1365('0x3'));var rp=require(_0x1365('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1365('0x5'));var config=require('../../config/environment');var attributes=require(_0x1365('0x6'));module[_0x1365('0x7')]=function(_0x7b1590,_0x533756){return _0x7b1590[_0x1365('0x8')](_0x1365('0x9'),attributes,{'tableName':_0x1365('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 065e38d..c588607 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc4e=['rpc','../../config/environment','jayson/promise','redis','defaults','localhost','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0xfc4e,0x137));var _0xefc4=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0xfc4e[_0x1f36bb];return _0xaf97fa;};'use strict';var _=require(_0xefc4('0x0'));var util=require(_0xefc4('0x1'));var moment=require(_0xefc4('0x2'));var BPromise=require('bluebird');var rs=require(_0xefc4('0x3'));var fs=require('fs');var Redis=require(_0xefc4('0x4'));var db=require(_0xefc4('0x5'))['db'];var utils=require(_0xefc4('0x6'));var logger=require(_0xefc4('0x7'))(_0xefc4('0x8'));var config=require(_0xefc4('0x9'));var jayson=require(_0xefc4('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0xefc4('0xb')]=_[_0xefc4('0xc')](config['redis'],{'host':_0xefc4('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xefc4('0xb')]));require(_0xefc4('0xe'))[_0xefc4('0xf')](socket);function respondWithRpcPromise(_0x19e16e,_0x19db60,_0x4342c1){return new BPromise(function(_0x4abf95,_0x4e2cde){return client[_0xefc4('0x10')](_0x19e16e,_0x4342c1)[_0xefc4('0x11')](function(_0xf94732){logger[_0xefc4('0x12')](_0xefc4('0x13'),_0x19db60,_0xefc4('0x14'));logger[_0xefc4('0x15')](_0xefc4('0x16'),_0x19db60,_0xefc4('0x14'),JSON[_0xefc4('0x17')](_0xf94732));if(_0xf94732[_0xefc4('0x18')]){if(_0xf94732[_0xefc4('0x18')][_0xefc4('0x19')]===0x1f4){logger[_0xefc4('0x18')](_0xefc4('0x13'),_0x19db60,_0xf94732[_0xefc4('0x18')][_0xefc4('0x1a')]);return _0x4e2cde(_0xf94732[_0xefc4('0x18')]['message']);}logger[_0xefc4('0x18')](_0xefc4('0x13'),_0x19db60,_0xf94732[_0xefc4('0x18')][_0xefc4('0x1a')]);return _0x4abf95(_0xf94732[_0xefc4('0x18')][_0xefc4('0x1a')]);}else{logger[_0xefc4('0x12')](_0xefc4('0x13'),_0x19db60,_0xefc4('0x14'));_0x4abf95(_0xf94732[_0xefc4('0x1b')][_0xefc4('0x1a')]);}})[_0xefc4('0x1c')](function(_0x118375){logger[_0xefc4('0x18')](_0xefc4('0x13'),_0x19db60,_0x118375);_0x4e2cde(_0x118375);});});}
\ No newline at end of file
+var _0x347a=['../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','debug','request\x20sent','stringify','error','DashboardItem,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils'];(function(_0x3bdcba,_0x139826){var _0x307c30=function(_0x38f186){while(--_0x38f186){_0x3bdcba['push'](_0x3bdcba['shift']());}};_0x307c30(++_0x139826);}(_0x347a,0xfe));var _0xa347=function(_0x1ab0e6,_0x17ba8d){_0x1ab0e6=_0x1ab0e6-0x0;var _0x248815=_0x347a[_0x1ab0e6];return _0x248815;};'use strict';var _=require(_0xa347('0x0'));var util=require(_0xa347('0x1'));var moment=require(_0xa347('0x2'));var BPromise=require('bluebird');var rs=require(_0xa347('0x3'));var fs=require('fs');var Redis=require(_0xa347('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa347('0x5'));var logger=require(_0xa347('0x6'))(_0xa347('0x7'));var config=require('../../config/environment');var jayson=require(_0xa347('0x8'));var client=jayson[_0xa347('0x9')][_0xa347('0xa')]({'port':0x232a});config[_0xa347('0xb')]=_[_0xa347('0xc')](config[_0xa347('0xb')],{'host':_0xa347('0xd'),'port':0x18eb});var socket=require(_0xa347('0xe'))(new Redis(config['redis']));require('./dashboardItem.socket')[_0xa347('0xf')](socket);function respondWithRpcPromise(_0x3c5f3e,_0x2d125f,_0x1c2780){return new BPromise(function(_0x2de1bd,_0x2ada44){return client[_0xa347('0x10')](_0x3c5f3e,_0x1c2780)['then'](function(_0x2eec47){logger['info']('DashboardItem,\x20%s,\x20%s',_0x2d125f,'request\x20sent');logger[_0xa347('0x11')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x2d125f,_0xa347('0x12'),JSON[_0xa347('0x13')](_0x2eec47));if(_0x2eec47[_0xa347('0x14')]){if(_0x2eec47['error']['code']===0x1f4){logger[_0xa347('0x14')](_0xa347('0x15'),_0x2d125f,_0x2eec47['error']['message']);return _0x2ada44(_0x2eec47[_0xa347('0x14')]['message']);}logger[_0xa347('0x14')]('DashboardItem,\x20%s,\x20%s',_0x2d125f,_0x2eec47['error'][_0xa347('0x16')]);return _0x2de1bd(_0x2eec47[_0xa347('0x14')][_0xa347('0x16')]);}else{logger[_0xa347('0x17')](_0xa347('0x15'),_0x2d125f,'request\x20sent');_0x2de1bd(_0x2eec47[_0xa347('0x18')][_0xa347('0x16')]);}})[_0xa347('0x19')](function(_0x26707b){logger[_0xa347('0x14')]('DashboardItem,\x20%s,\x20%s',_0x2d125f,_0x26707b);_0x2ada44(_0x26707b);});});}
\ No newline at end of file
index ab02e36..5e57058 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9337=['update','emit','length','dashboardItem:','save'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x9337,0x176));var _0x7933=function(_0x35f72a,_0x16eb7c){_0x35f72a=_0x35f72a-0x0;var _0x2e8536=_0x9337[_0x35f72a];return _0x2e8536;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x7933('0x0'),'remove',_0x7933('0x1')];function createListener(_0x3cb420,_0x316ae9){return function(_0x48d28e){_0x316ae9[_0x7933('0x2')](_0x3cb420,_0x48d28e);};}function removeListener(_0x20a001,_0x1e4d2c){return function(){DashboardItemEvents['removeListener'](_0x20a001,_0x1e4d2c);};}exports['register']=function(_0x484104){for(var _0x5895d9=0x0,_0x35940c=events[_0x7933('0x3')];_0x5895d9<_0x35940c;_0x5895d9++){var _0x23f0fe=events[_0x5895d9];var _0x2abd7f=createListener(_0x7933('0x4')+_0x23f0fe,_0x484104);DashboardItemEvents['on'](_0x23f0fe,_0x2abd7f);}};
\ No newline at end of file
+var _0x5c02=['length','dashboardItem:','./dashboardItem.events','save','remove','update','emit','removeListener'];(function(_0x2aaa60,_0x22258f){var _0x2e3fa5=function(_0x335589){while(--_0x335589){_0x2aaa60['push'](_0x2aaa60['shift']());}};_0x2e3fa5(++_0x22258f);}(_0x5c02,0xe2));var _0x25c0=function(_0x5755e7,_0x9d3a08){_0x5755e7=_0x5755e7-0x0;var _0x59f9b9=_0x5c02[_0x5755e7];return _0x59f9b9;};'use strict';var DashboardItemEvents=require(_0x25c0('0x0'));var events=[_0x25c0('0x1'),_0x25c0('0x2'),_0x25c0('0x3')];function createListener(_0x3c696a,_0x5821b7){return function(_0x559c9c){_0x5821b7[_0x25c0('0x4')](_0x3c696a,_0x559c9c);};}function removeListener(_0x50af4b,_0x32aa18){return function(){DashboardItemEvents[_0x25c0('0x5')](_0x50af4b,_0x32aa18);};}exports['register']=function(_0x31380b){for(var _0x4652b1=0x0,_0x2db6a1=events[_0x25c0('0x6')];_0x4652b1<_0x2db6a1;_0x4652b1++){var _0x551317=events[_0x4652b1];var _0x45dd00=createListener(_0x25c0('0x7')+_0x551317,_0x31380b);DashboardItemEvents['on'](_0x551317,_0x45dd00);}};
\ No newline at end of file
index 30b1f56..4aded82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33e1=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','isAuthenticated','create','put','/:id','delete','destroy','path'];(function(_0x2e11fc,_0xe2514f){var _0x19514e=function(_0x17c5c7){while(--_0x17c5c7){_0x2e11fc['push'](_0x2e11fc['shift']());}};_0x19514e(++_0xe2514f);}(_0x33e1,0x1db));var _0x133e=function(_0x217ca9,_0x1b8733){_0x217ca9=_0x217ca9-0x0;var _0x4b5e8a=_0x33e1[_0x217ca9];return _0x4b5e8a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x133e('0x0'));var timeout=require(_0x133e('0x1'));var express=require('express');var router=express[_0x133e('0x2')]();var fs_extra=require(_0x133e('0x3'));var auth=require(_0x133e('0x4'));var interaction=require(_0x133e('0x5'));var config=require(_0x133e('0x6'));var controller=require(_0x133e('0x7'));router['get']('/:id',auth[_0x133e('0x8')](),controller['show']);router['post']('/',auth[_0x133e('0x8')](),controller[_0x133e('0x9')]);router[_0x133e('0xa')](_0x133e('0xb'),auth[_0x133e('0x8')](),controller['update']);router[_0x133e('0xc')](_0x133e('0xb'),auth[_0x133e('0x8')](),controller[_0x133e('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0xb89f=['connect-timeout','fs-extra','../../components/interaction/service','./dashboardItem.controller','get','isAuthenticated','update','delete','/:id','destroy','exports','multer','path'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb89f,0x16a));var _0xfb89=function(_0x1f1d55,_0x52d1b6){_0x1f1d55=_0x1f1d55-0x0;var _0xf43613=_0xb89f[_0x1f1d55];return _0xf43613;};'use strict';var multer=require(_0xfb89('0x0'));var util=require('util');var path=require(_0xfb89('0x1'));var timeout=require(_0xfb89('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xfb89('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xfb89('0x4'));var config=require('../../config/environment');var controller=require(_0xfb89('0x5'));router[_0xfb89('0x6')]('/:id',auth[_0xfb89('0x7')](),controller['show']);router['post']('/',auth[_0xfb89('0x7')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xfb89('0x8')]);router[_0xfb89('0x9')](_0xfb89('0xa'),auth[_0xfb89('0x7')](),controller[_0xfb89('0xb')]);module[_0xfb89('0xc')]=router;
\ No newline at end of file
index a5caa9a..6e273b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae39=['STRING','sequelize','ENUM','first','third'];(function(_0x33de4e,_0x9fc79e){var _0x2832bc=function(_0x1680a9){while(--_0x1680a9){_0x33de4e['push'](_0x33de4e['shift']());}};_0x2832bc(++_0x9fc79e);}(_0xae39,0x123));var _0x9ae3=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xae39[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0x9ae3('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0x9ae3('0x1')](_0x9ae3('0x2'),'second',_0x9ae3('0x3')),'allowNull':![],'defaultValue':_0x9ae3('0x2')},'description':{'type':Sequelize[_0x9ae3('0x4')]}};
\ No newline at end of file
+var _0xe491=['STRING','sequelize','exports','ENUM','first','second','third'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0xe491,0x8d));var _0x1e49=function(_0x259b23,_0x537bae){_0x259b23=_0x259b23-0x0;var _0xc0dfa7=_0xe491[_0x259b23];return _0xc0dfa7;};'use strict';var Sequelize=require(_0x1e49('0x0'));module[_0x1e49('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0x1e49('0x2')](_0x1e49('0x3'),_0x1e49('0x4'),_0x1e49('0x5')),'allowNull':![],'defaultValue':_0x1e49('0x3')},'description':{'type':Sequelize[_0x1e49('0x6')]}};
\ No newline at end of file
index c28d2e9..160f6ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcafb=['Disposition','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','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','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','update','then','get','Dispositions','destroy','end','sendStatus','error','stack','name','send','index','map'];(function(_0xfb8f31,_0x2d3880){var _0x28b6e0=function(_0x4a3f1e){while(--_0x4a3f1e){_0xfb8f31['push'](_0xfb8f31['shift']());}};_0x28b6e0(++_0x2d3880);}(_0xcafb,0x188));var _0xbcaf=function(_0x262c8c,_0x271222){_0x262c8c=_0x262c8c-0x0;var _0x5847dc=_0xcafb[_0x262c8c];return _0x5847dc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbcaf('0x0'));var zipdir=require(_0xbcaf('0x1'));var jsonpatch=require(_0xbcaf('0x2'));var rp=require(_0xbcaf('0x3'));var moment=require(_0xbcaf('0x4'));var BPromise=require(_0xbcaf('0x5'));var Mustache=require(_0xbcaf('0x6'));var util=require('util');var path=require(_0xbcaf('0x7'));var sox=require(_0xbcaf('0x8'));var csv=require(_0xbcaf('0x9'));var ejs=require(_0xbcaf('0xa'));var fs=require('fs');var fs_extra=require(_0xbcaf('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xbcaf('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbcaf('0xd'));var toCsv=require(_0xbcaf('0x9'));var querystring=require(_0xbcaf('0xe'));var Papa=require(_0xbcaf('0xf'));var Redis=require(_0xbcaf('0x10'));var authService=require(_0xbcaf('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xbcaf('0x12'));var hardwareService=require(_0xbcaf('0x13'));var logger=require(_0xbcaf('0x14'))('api');var utils=require(_0xbcaf('0x15'));var config=require(_0xbcaf('0x16'));var licenseUtil=require(_0xbcaf('0x17'));var db=require(_0xbcaf('0x18'))['db'];function respondWithStatusCode(_0x15db82,_0x5be89f){_0x5be89f=_0x5be89f||0xcc;return function(_0x21ad45){if(_0x21ad45){return _0x15db82['sendStatus'](_0x5be89f);}return _0x15db82[_0xbcaf('0x19')](_0x5be89f)['end']();};}function respondWithResult(_0x5291e0,_0xd42af6){_0xd42af6=_0xd42af6||0xc8;return function(_0x3f10f4){if(_0x3f10f4){return _0x5291e0[_0xbcaf('0x19')](_0xd42af6)['json'](_0x3f10f4);}};}function respondWithFilteredResult(_0x593d9d,_0x41dfde){return function(_0x4507d9){if(_0x4507d9){var _0x4e4a65=typeof _0x41dfde[_0xbcaf('0x1a')]==='undefined'&&typeof _0x41dfde['limit']===_0xbcaf('0x1b');var _0x2c5efc=_0x4507d9[_0xbcaf('0x1c')];var _0x1f7862=_0x4e4a65?0x0:_0x41dfde[_0xbcaf('0x1a')];var _0x5d6e09=_0x4e4a65?_0x4507d9[_0xbcaf('0x1c')]:_0x41dfde['offset']+_0x41dfde[_0xbcaf('0x1d')];var _0x5b026a;if(_0x5d6e09>=_0x2c5efc){_0x5d6e09=_0x2c5efc;_0x5b026a=0xc8;}else{_0x5b026a=0xce;}_0x593d9d['status'](_0x5b026a);return _0x593d9d[_0xbcaf('0x1e')](_0xbcaf('0x1f'),_0x1f7862+'-'+_0x5d6e09+'/'+_0x2c5efc)[_0xbcaf('0x20')](_0x4507d9);}return null;};}function patchUpdates(_0x3772b3){return function(_0x5d93c0){try{jsonpatch[_0xbcaf('0x21')](_0x5d93c0,_0x3772b3,!![]);}catch(_0x3ce683){return BPromise[_0xbcaf('0x22')](_0x3ce683);}return _0x5d93c0['save']();};}function saveUpdates(_0x1f97ac,_0x19ce71){return function(_0x45714a){if(_0x45714a){return _0x45714a[_0xbcaf('0x23')](_0x1f97ac)[_0xbcaf('0x24')](function(_0x23574f){return _0x23574f;});}return null;};}function removeEntity(_0x32ad8a,_0x1306d1){return function(_0x44b462){if(_0x44b462){return _0x44b462['destroy']()['then'](function(){var _0x41f397=_0x44b462[_0xbcaf('0x25')]({'plain':!![]});var _0xe0c35f=_0xbcaf('0x26');return db['UserProfileResource'][_0xbcaf('0x27')]({'where':{'type':_0xe0c35f,'resourceId':_0x41f397['id']}})[_0xbcaf('0x24')](function(){return _0x44b462;});})[_0xbcaf('0x24')](function(){_0x32ad8a[_0xbcaf('0x19')](0xcc)[_0xbcaf('0x28')]();});}};}function handleEntityNotFound(_0x5b5980,_0x5652ba){return function(_0x44f856){if(!_0x44f856){_0x5b5980[_0xbcaf('0x29')](0x194);}return _0x44f856;};}function handleError(_0x1a8db4,_0x37b6fe){_0x37b6fe=_0x37b6fe||0x1f4;return function(_0xefc6f5){logger[_0xbcaf('0x2a')](_0xefc6f5[_0xbcaf('0x2b')]);if(_0xefc6f5[_0xbcaf('0x2c')]){delete _0xefc6f5[_0xbcaf('0x2c')];}_0x1a8db4[_0xbcaf('0x19')](_0x37b6fe)[_0xbcaf('0x2d')](_0xefc6f5);};}exports[_0xbcaf('0x2e')]=function(_0x5dc2c3,_0x73631f){var _0x292236={},_0xddfd02={},_0x3041d8={'count':0x0,'rows':[]};var _0x1b0dd6=_[_0xbcaf('0x2f')](db[_0xbcaf('0x30')][_0xbcaf('0x31')],function(_0x6b45c4){return{'name':_0x6b45c4[_0xbcaf('0x32')],'type':_0x6b45c4[_0xbcaf('0x33')][_0xbcaf('0x34')]};});_0xddfd02[_0xbcaf('0x35')]=_[_0xbcaf('0x2f')](_0x1b0dd6,_0xbcaf('0x2c'));_0xddfd02[_0xbcaf('0x36')]=_[_0xbcaf('0x37')](_0x5dc2c3[_0xbcaf('0x36')]);_0xddfd02[_0xbcaf('0x38')]=_[_0xbcaf('0x39')](_0xddfd02['model'],_0xddfd02[_0xbcaf('0x36')]);_0x292236['attributes']=_['intersection'](_0xddfd02[_0xbcaf('0x35')],qs[_0xbcaf('0x3a')](_0x5dc2c3[_0xbcaf('0x36')][_0xbcaf('0x3a')]));_0x292236[_0xbcaf('0x3b')]=_0x292236[_0xbcaf('0x3b')][_0xbcaf('0x3c')]?_0x292236[_0xbcaf('0x3b')]:_0xddfd02[_0xbcaf('0x35')];if(!_0x5dc2c3[_0xbcaf('0x36')][_0xbcaf('0x3d')](_0xbcaf('0x3e'))){_0x292236['limit']=qs[_0xbcaf('0x1d')](_0x5dc2c3[_0xbcaf('0x36')][_0xbcaf('0x1d')]);_0x292236['offset']=qs['offset'](_0x5dc2c3[_0xbcaf('0x36')][_0xbcaf('0x1a')]);}_0x292236[_0xbcaf('0x3f')]=qs[_0xbcaf('0x40')](_0x5dc2c3[_0xbcaf('0x36')]['sort']);_0x292236[_0xbcaf('0x41')]=qs['filters'](_[_0xbcaf('0x42')](_0x5dc2c3['query'],_0xddfd02[_0xbcaf('0x38')]),_0x1b0dd6);if(_0x5dc2c3[_0xbcaf('0x36')][_0xbcaf('0x43')]){_0x292236[_0xbcaf('0x41')]=_[_0xbcaf('0x44')](_0x292236[_0xbcaf('0x41')],{'$or':_[_0xbcaf('0x2f')](_0x1b0dd6,function(_0x52087b){if(_0x52087b[_0xbcaf('0x33')]!==_0xbcaf('0x45')){var _0x255fde={};_0x255fde[_0x52087b['name']]={'$like':'%'+_0x5dc2c3[_0xbcaf('0x36')][_0xbcaf('0x43')]+'%'};return _0x255fde;}})});}_0x292236=_[_0xbcaf('0x44')]({},_0x292236,_0x5dc2c3[_0xbcaf('0x46')]);var _0x3aea16={'where':_0x292236[_0xbcaf('0x41')]};return db[_0xbcaf('0x30')]['count'](_0x3aea16)['then'](function(_0x94deb9){_0x3041d8[_0xbcaf('0x1c')]=_0x94deb9;if(_0x5dc2c3['query'][_0xbcaf('0x47')]){_0x292236[_0xbcaf('0x48')]=[{'all':!![]}];}return db[_0xbcaf('0x30')][_0xbcaf('0x49')](_0x292236);})['then'](function(_0x28f144){_0x3041d8[_0xbcaf('0x4a')]=_0x28f144;return _0x3041d8;})[_0xbcaf('0x24')](respondWithFilteredResult(_0x73631f,_0x292236))[_0xbcaf('0x4b')](handleError(_0x73631f,null));};exports[_0xbcaf('0x4c')]=function(_0x29ac9c,_0x4a8798){var _0x41efa8={'raw':!![],'where':{'id':_0x29ac9c[_0xbcaf('0x4d')]['id']}},_0x5bc15f={};_0x5bc15f[_0xbcaf('0x35')]=_[_0xbcaf('0x37')](db[_0xbcaf('0x30')]['rawAttributes']);_0x5bc15f[_0xbcaf('0x36')]=_[_0xbcaf('0x37')](_0x29ac9c[_0xbcaf('0x36')]);_0x5bc15f['filters']=_[_0xbcaf('0x39')](_0x5bc15f[_0xbcaf('0x35')],_0x5bc15f[_0xbcaf('0x36')]);_0x41efa8[_0xbcaf('0x3b')]=_[_0xbcaf('0x39')](_0x5bc15f[_0xbcaf('0x35')],qs[_0xbcaf('0x3a')](_0x29ac9c['query'][_0xbcaf('0x3a')]));_0x41efa8[_0xbcaf('0x3b')]=_0x41efa8[_0xbcaf('0x3b')]['length']?_0x41efa8[_0xbcaf('0x3b')]:_0x5bc15f[_0xbcaf('0x35')];if(_0x29ac9c[_0xbcaf('0x36')][_0xbcaf('0x47')]){_0x41efa8[_0xbcaf('0x48')]=[{'all':!![]}];}_0x41efa8=_['merge']({},_0x41efa8,_0x29ac9c[_0xbcaf('0x46')]);return db[_0xbcaf('0x30')][_0xbcaf('0x4e')](_0x41efa8)['then'](handleEntityNotFound(_0x4a8798,null))[_0xbcaf('0x24')](respondWithResult(_0x4a8798,null))[_0xbcaf('0x4b')](handleError(_0x4a8798,null));};exports['create']=function(_0x35b613,_0x92dca7){return db[_0xbcaf('0x30')][_0xbcaf('0x4f')](_0x35b613['body'],{})['then'](function(_0x16d961){var _0x5e2765=_0x35b613['user']['get']({'plain':!![]});if(!_0x5e2765)throw new Error(_0xbcaf('0x50'));if(_0x5e2765[_0xbcaf('0x51')]===_0xbcaf('0x52')){var _0x4868a8=_0x16d961['get']({'plain':!![]});var _0x3a0370=_0xbcaf('0x26');return db[_0xbcaf('0x53')][_0xbcaf('0x4e')]({'where':{'name':_0x3a0370,'userProfileId':_0x5e2765['userProfileId']},'raw':!![]})['then'](function(_0x3eb41b){if(_0x3eb41b&&_0x3eb41b[_0xbcaf('0x54')]===0x0){return db[_0xbcaf('0x55')][_0xbcaf('0x4f')]({'name':_0x4868a8[_0xbcaf('0x2c')],'resourceId':_0x4868a8['id'],'type':_0x3eb41b[_0xbcaf('0x2c')],'sectionId':_0x3eb41b['id']},{})['then'](function(){return _0x16d961;});}else{return _0x16d961;}})[_0xbcaf('0x4b')](function(_0x48b065){logger['error'](_0xbcaf('0x56'),_0x48b065);throw _0x48b065;});}return _0x16d961;})[_0xbcaf('0x24')](respondWithResult(_0x92dca7,0xc9))['catch'](handleError(_0x92dca7,null));};exports['update']=function(_0xdc4c0a,_0x2cf357){if(_0xdc4c0a[_0xbcaf('0x57')]['id']){delete _0xdc4c0a[_0xbcaf('0x57')]['id'];}return db['Disposition'][_0xbcaf('0x4e')]({'where':{'id':_0xdc4c0a[_0xbcaf('0x4d')]['id']}})[_0xbcaf('0x24')](handleEntityNotFound(_0x2cf357,null))[_0xbcaf('0x24')](saveUpdates(_0xdc4c0a[_0xbcaf('0x57')],null))[_0xbcaf('0x24')](respondWithResult(_0x2cf357,null))['catch'](handleError(_0x2cf357,null));};exports['destroy']=function(_0x22a0e3,_0x2e653b){return db[_0xbcaf('0x30')][_0xbcaf('0x4e')]({'where':{'id':_0x22a0e3['params']['id']}})[_0xbcaf('0x24')](handleEntityNotFound(_0x2e653b,null))[_0xbcaf('0x24')](removeEntity(_0x2e653b,null))[_0xbcaf('0x4b')](handleError(_0x2e653b,null));};
\ No newline at end of file
+var _0x5dfa=['catch','show','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Dispositions','UserProfileSection','find','userProfileId','autoAssociation','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','sendStatus','error','send','index','map','Disposition','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','order','sort','where','filters','pick','merge','VIRTUAL','name','filter','options','includeAll','rows'];(function(_0x3cd80c,_0xfeb08f){var _0x244e29=function(_0x666b9b){while(--_0x666b9b){_0x3cd80c['push'](_0x3cd80c['shift']());}};_0x244e29(++_0xfeb08f);}(_0x5dfa,0x1ad));var _0xa5df=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5dfa[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xa5df('0x0'));var rimraf=require(_0xa5df('0x1'));var zipdir=require(_0xa5df('0x2'));var jsonpatch=require(_0xa5df('0x3'));var rp=require(_0xa5df('0x4'));var moment=require(_0xa5df('0x5'));var BPromise=require(_0xa5df('0x6'));var Mustache=require(_0xa5df('0x7'));var util=require(_0xa5df('0x8'));var path=require('path');var sox=require(_0xa5df('0x9'));var csv=require(_0xa5df('0xa'));var ejs=require(_0xa5df('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa5df('0xc'));var squel=require(_0xa5df('0xd'));var crypto=require(_0xa5df('0xe'));var jsforce=require(_0xa5df('0xf'));var deskjs=require(_0xa5df('0x10'));var toCsv=require(_0xa5df('0xa'));var querystring=require('querystring');var Papa=require(_0xa5df('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa5df('0x12'));var logger=require(_0xa5df('0x13'))(_0xa5df('0x14'));var utils=require(_0xa5df('0x15'));var config=require(_0xa5df('0x16'));var licenseUtil=require(_0xa5df('0x17'));var db=require(_0xa5df('0x18'))['db'];function respondWithStatusCode(_0x4f07a8,_0x312d9f){_0x312d9f=_0x312d9f||0xcc;return function(_0x4ec612){if(_0x4ec612){return _0x4f07a8['sendStatus'](_0x312d9f);}return _0x4f07a8[_0xa5df('0x19')](_0x312d9f)['end']();};}function respondWithResult(_0xed8753,_0x4cccf4){_0x4cccf4=_0x4cccf4||0xc8;return function(_0x13307f){if(_0x13307f){return _0xed8753[_0xa5df('0x19')](_0x4cccf4)[_0xa5df('0x1a')](_0x13307f);}};}function respondWithFilteredResult(_0x545f59,_0x3c2a31){return function(_0x1a269a){if(_0x1a269a){var _0x1d4929=typeof _0x3c2a31[_0xa5df('0x1b')]==='undefined'&&typeof _0x3c2a31[_0xa5df('0x1c')]==='undefined';var _0x34d6b4=_0x1a269a[_0xa5df('0x1d')];var _0x519139=_0x1d4929?0x0:_0x3c2a31[_0xa5df('0x1b')];var _0x36fe4a=_0x1d4929?_0x1a269a[_0xa5df('0x1d')]:_0x3c2a31[_0xa5df('0x1b')]+_0x3c2a31[_0xa5df('0x1c')];var _0xf8e1f7;if(_0x36fe4a>=_0x34d6b4){_0x36fe4a=_0x34d6b4;_0xf8e1f7=0xc8;}else{_0xf8e1f7=0xce;}_0x545f59[_0xa5df('0x19')](_0xf8e1f7);return _0x545f59[_0xa5df('0x1e')](_0xa5df('0x1f'),_0x519139+'-'+_0x36fe4a+'/'+_0x34d6b4)[_0xa5df('0x1a')](_0x1a269a);}return null;};}function patchUpdates(_0xf3f9e0){return function(_0x2a8c70){try{jsonpatch[_0xa5df('0x20')](_0x2a8c70,_0xf3f9e0,!![]);}catch(_0x4a68ad){return BPromise[_0xa5df('0x21')](_0x4a68ad);}return _0x2a8c70[_0xa5df('0x22')]();};}function saveUpdates(_0x129409,_0x4d5cf0){return function(_0x2503c1){if(_0x2503c1){return _0x2503c1[_0xa5df('0x23')](_0x129409)[_0xa5df('0x24')](function(_0x2714ee){return _0x2714ee;});}return null;};}function removeEntity(_0x442109,_0x38d154){return function(_0x10d749){if(_0x10d749){return _0x10d749['destroy']()[_0xa5df('0x24')](function(){var _0xafefe3=_0x10d749[_0xa5df('0x25')]({'plain':!![]});var _0x47ead3='Dispositions';return db[_0xa5df('0x26')][_0xa5df('0x27')]({'where':{'type':_0x47ead3,'resourceId':_0xafefe3['id']}})[_0xa5df('0x24')](function(){return _0x10d749;});})['then'](function(){_0x442109[_0xa5df('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x553d08,_0xcc9c18){return function(_0x3b4e03){if(!_0x3b4e03){_0x553d08[_0xa5df('0x28')](0x194);}return _0x3b4e03;};}function handleError(_0x257044,_0x9952e6){_0x9952e6=_0x9952e6||0x1f4;return function(_0x87fe9d){logger[_0xa5df('0x29')](_0x87fe9d['stack']);if(_0x87fe9d['name']){delete _0x87fe9d['name'];}_0x257044[_0xa5df('0x19')](_0x9952e6)[_0xa5df('0x2a')](_0x87fe9d);};}exports[_0xa5df('0x2b')]=function(_0x418b01,_0x4a6cae){var _0x200423={},_0x796a12={},_0x35be7b={'count':0x0,'rows':[]};var _0x54ffce=_[_0xa5df('0x2c')](db[_0xa5df('0x2d')][_0xa5df('0x2e')],function(_0x5ddf5e){return{'name':_0x5ddf5e[_0xa5df('0x2f')],'type':_0x5ddf5e[_0xa5df('0x30')][_0xa5df('0x31')]};});_0x796a12[_0xa5df('0x32')]=_[_0xa5df('0x2c')](_0x54ffce,'name');_0x796a12[_0xa5df('0x33')]=_[_0xa5df('0x34')](_0x418b01[_0xa5df('0x33')]);_0x796a12['filters']=_[_0xa5df('0x35')](_0x796a12[_0xa5df('0x32')],_0x796a12[_0xa5df('0x33')]);_0x200423[_0xa5df('0x36')]=_[_0xa5df('0x35')](_0x796a12[_0xa5df('0x32')],qs['fields'](_0x418b01[_0xa5df('0x33')][_0xa5df('0x37')]));_0x200423['attributes']=_0x200423[_0xa5df('0x36')][_0xa5df('0x38')]?_0x200423[_0xa5df('0x36')]:_0x796a12[_0xa5df('0x32')];if(!_0x418b01['query']['hasOwnProperty']('nolimit')){_0x200423[_0xa5df('0x1c')]=qs['limit'](_0x418b01[_0xa5df('0x33')][_0xa5df('0x1c')]);_0x200423[_0xa5df('0x1b')]=qs[_0xa5df('0x1b')](_0x418b01[_0xa5df('0x33')][_0xa5df('0x1b')]);}_0x200423[_0xa5df('0x39')]=qs[_0xa5df('0x3a')](_0x418b01[_0xa5df('0x33')][_0xa5df('0x3a')]);_0x200423[_0xa5df('0x3b')]=qs[_0xa5df('0x3c')](_[_0xa5df('0x3d')](_0x418b01['query'],_0x796a12[_0xa5df('0x3c')]),_0x54ffce);if(_0x418b01[_0xa5df('0x33')]['filter']){_0x200423[_0xa5df('0x3b')]=_[_0xa5df('0x3e')](_0x200423['where'],{'$or':_[_0xa5df('0x2c')](_0x54ffce,function(_0x2c6128){if(_0x2c6128[_0xa5df('0x30')]!==_0xa5df('0x3f')){var _0x289bd3={};_0x289bd3[_0x2c6128[_0xa5df('0x40')]]={'$like':'%'+_0x418b01[_0xa5df('0x33')][_0xa5df('0x41')]+'%'};return _0x289bd3;}})});}_0x200423=_[_0xa5df('0x3e')]({},_0x200423,_0x418b01[_0xa5df('0x42')]);var _0x413765={'where':_0x200423[_0xa5df('0x3b')]};return db['Disposition'][_0xa5df('0x1d')](_0x413765)[_0xa5df('0x24')](function(_0x2e453a){_0x35be7b[_0xa5df('0x1d')]=_0x2e453a;if(_0x418b01[_0xa5df('0x33')][_0xa5df('0x43')]){_0x200423['include']=[{'all':!![]}];}return db[_0xa5df('0x2d')]['findAll'](_0x200423);})[_0xa5df('0x24')](function(_0x4ecefa){_0x35be7b[_0xa5df('0x44')]=_0x4ecefa;return _0x35be7b;})['then'](respondWithFilteredResult(_0x4a6cae,_0x200423))[_0xa5df('0x45')](handleError(_0x4a6cae,null));};exports[_0xa5df('0x46')]=function(_0x3f5b53,_0x18e746){var _0x1a519b={'raw':!![],'where':{'id':_0x3f5b53['params']['id']}},_0xf637d5={};_0xf637d5[_0xa5df('0x32')]=_[_0xa5df('0x34')](db['Disposition']['rawAttributes']);_0xf637d5[_0xa5df('0x33')]=_[_0xa5df('0x34')](_0x3f5b53[_0xa5df('0x33')]);_0xf637d5[_0xa5df('0x3c')]=_[_0xa5df('0x35')](_0xf637d5[_0xa5df('0x32')],_0xf637d5[_0xa5df('0x33')]);_0x1a519b[_0xa5df('0x36')]=_['intersection'](_0xf637d5[_0xa5df('0x32')],qs[_0xa5df('0x37')](_0x3f5b53['query'][_0xa5df('0x37')]));_0x1a519b[_0xa5df('0x36')]=_0x1a519b[_0xa5df('0x36')]['length']?_0x1a519b[_0xa5df('0x36')]:_0xf637d5[_0xa5df('0x32')];if(_0x3f5b53[_0xa5df('0x33')]['includeAll']){_0x1a519b[_0xa5df('0x47')]=[{'all':!![]}];}_0x1a519b=_[_0xa5df('0x3e')]({},_0x1a519b,_0x3f5b53[_0xa5df('0x42')]);return db[_0xa5df('0x2d')]['find'](_0x1a519b)[_0xa5df('0x24')](handleEntityNotFound(_0x18e746,null))[_0xa5df('0x24')](respondWithResult(_0x18e746,null))[_0xa5df('0x45')](handleError(_0x18e746,null));};exports[_0xa5df('0x48')]=function(_0x3ed787,_0x5ea38c){return db['Disposition'][_0xa5df('0x48')](_0x3ed787[_0xa5df('0x49')],{})[_0xa5df('0x24')](function(_0xcd4380){var _0x4a7b19=_0x3ed787[_0xa5df('0x4a')][_0xa5df('0x25')]({'plain':!![]});if(!_0x4a7b19)throw new Error(_0xa5df('0x4b'));if(_0x4a7b19[_0xa5df('0x4c')]==='user'){var _0x3c8b90=_0xcd4380['get']({'plain':!![]});var _0x5530e7=_0xa5df('0x4d');return db[_0xa5df('0x4e')][_0xa5df('0x4f')]({'where':{'name':_0x5530e7,'userProfileId':_0x4a7b19[_0xa5df('0x50')]},'raw':!![]})[_0xa5df('0x24')](function(_0x508265){if(_0x508265&&_0x508265[_0xa5df('0x51')]===0x0){return db[_0xa5df('0x26')][_0xa5df('0x48')]({'name':_0x3c8b90[_0xa5df('0x40')],'resourceId':_0x3c8b90['id'],'type':_0x508265['name'],'sectionId':_0x508265['id']},{})[_0xa5df('0x24')](function(){return _0xcd4380;});}else{return _0xcd4380;}})[_0xa5df('0x45')](function(_0x5f1a27){logger[_0xa5df('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5f1a27);throw _0x5f1a27;});}return _0xcd4380;})['then'](respondWithResult(_0x5ea38c,0xc9))['catch'](handleError(_0x5ea38c,null));};exports[_0xa5df('0x23')]=function(_0x3004fb,_0xe47ac8){if(_0x3004fb[_0xa5df('0x49')]['id']){delete _0x3004fb[_0xa5df('0x49')]['id'];}return db[_0xa5df('0x2d')][_0xa5df('0x4f')]({'where':{'id':_0x3004fb['params']['id']}})[_0xa5df('0x24')](handleEntityNotFound(_0xe47ac8,null))['then'](saveUpdates(_0x3004fb[_0xa5df('0x49')],null))[_0xa5df('0x24')](respondWithResult(_0xe47ac8,null))[_0xa5df('0x45')](handleError(_0xe47ac8,null));};exports[_0xa5df('0x27')]=function(_0x444e9c,_0xe3c608){return db[_0xa5df('0x2d')][_0xa5df('0x4f')]({'where':{'id':_0x444e9c[_0xa5df('0x52')]['id']}})[_0xa5df('0x24')](handleEntityNotFound(_0xe3c608,null))['then'](removeEntity(_0xe3c608,null))['catch'](handleError(_0xe3c608,null));};
\ No newline at end of file
index 891bc1e..0f67da8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x981c=['name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','api','moment','bluebird','request-promise','path','../../config/environment','./disposition.attributes','define','Disposition','tools_dispositions','name_voice','name','ListId'];(function(_0x3048ea,_0x3838c2){var _0x1a13c4=function(_0x2c6a6b){while(--_0x2c6a6b){_0x3048ea['push'](_0x3048ea['shift']());}};_0x1a13c4(++_0x3838c2);}(_0x981c,0x19c));var _0xc981=function(_0x18bbbb,_0x2ed526){_0x18bbbb=_0x18bbbb-0x0;var _0x240a4c=_0x981c[_0x18bbbb];return _0x240a4c;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xc981('0x0'));var moment=require(_0xc981('0x1'));var BPromise=require(_0xc981('0x2'));var rp=require(_0xc981('0x3'));var fs=require('fs');var path=require(_0xc981('0x4'));var rimraf=require('rimraf');var config=require(_0xc981('0x5'));var attributes=require(_0xc981('0x6'));module['exports']=function(_0x2abb65,_0x55f6be){return _0x2abb65[_0xc981('0x7')](_0xc981('0x8'),attributes,{'tableName':_0xc981('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xc981('0xa'),'fields':[_0xc981('0xb'),_0xc981('0xc')]},{'unique':!![],'name':_0xc981('0xd'),'fields':[_0xc981('0xb'),_0xc981('0xe')]},{'unique':!![],'name':_0xc981('0xf'),'fields':[_0xc981('0xb'),_0xc981('0x10')]},{'unique':!![],'name':_0xc981('0x11'),'fields':['name',_0xc981('0x12')]},{'unique':!![],'name':_0xc981('0x13'),'fields':['name',_0xc981('0x14')]},{'unique':!![],'name':_0xc981('0x15'),'fields':[_0xc981('0xb'),_0xc981('0x16')]},{'unique':!![],'name':_0xc981('0x17'),'fields':[_0xc981('0xb'),_0xc981('0x18')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5c08=['ChatWebsiteId','MailAccountId','name_sms','name_fax','FaxAccountId','name_openchannel','name_whatsapp','WhatsappAccountId','util','../../config/logger','bluebird','request-promise','path','../../config/environment','./disposition.attributes','define','tools_dispositions','name_voice','name','name_chat'];(function(_0x51652a,_0x5144fc){var _0xae7099=function(_0x4b239b){while(--_0x4b239b){_0x51652a['push'](_0x51652a['shift']());}};_0xae7099(++_0x5144fc);}(_0x5c08,0x148));var _0x85c0=function(_0xe561dc,_0x143ad1){_0xe561dc=_0xe561dc-0x0;var _0x883c3d=_0x5c08[_0xe561dc];return _0x883c3d;};'use strict';var _=require('lodash');var util=require(_0x85c0('0x0'));var logger=require(_0x85c0('0x1'))('api');var moment=require('moment');var BPromise=require(_0x85c0('0x2'));var rp=require(_0x85c0('0x3'));var fs=require('fs');var path=require(_0x85c0('0x4'));var rimraf=require('rimraf');var config=require(_0x85c0('0x5'));var attributes=require(_0x85c0('0x6'));module['exports']=function(_0x48fb7a,_0x3fb93a){return _0x48fb7a[_0x85c0('0x7')]('Disposition',attributes,{'tableName':_0x85c0('0x8'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x85c0('0x9'),'fields':[_0x85c0('0xa'),'ListId']},{'unique':!![],'name':_0x85c0('0xb'),'fields':[_0x85c0('0xa'),_0x85c0('0xc')]},{'unique':!![],'name':'name_mail','fields':[_0x85c0('0xa'),_0x85c0('0xd')]},{'unique':!![],'name':_0x85c0('0xe'),'fields':['name','SmsAccountId']},{'unique':!![],'name':_0x85c0('0xf'),'fields':[_0x85c0('0xa'),_0x85c0('0x10')]},{'unique':!![],'name':_0x85c0('0x11'),'fields':[_0x85c0('0xa'),'OpenchannelAccountId']},{'unique':!![],'name':_0x85c0('0x12'),'fields':[_0x85c0('0xa'),_0x85c0('0x13')]}],'timestamps':!![]});};
\ No newline at end of file
index 559fb1d..60b1777 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(_0x5f1de2,_0x33ea79){var _0x55b8ba=function(_0x2bf26a){while(--_0x2bf26a){_0x5f1de2['push'](_0x5f1de2['shift']());}};_0x55b8ba(++_0x33ea79);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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(_0x522fa0,_0x4c139c){var _0x3f96d0=function(_0x1476ad){while(--_0x1476ad){_0x522fa0['push'](_0x522fa0['shift']());}};_0x3f96d0(++_0x4c139c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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 2f58b64..37798ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49f2=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show','put','update','delete','destroy','exports'];(function(_0x1a75d4,_0x4d8965){var _0x45b7fd=function(_0xde87a5){while(--_0xde87a5){_0x1a75d4['push'](_0x1a75d4['shift']());}};_0x45b7fd(++_0x4d8965);}(_0x49f2,0xc8));var _0x249f=function(_0x5428d2,_0x5f08e2){_0x5428d2=_0x5428d2-0x0;var _0x14e038=_0x49f2[_0x5428d2];return _0x14e038;};'use strict';var multer=require(_0x249f('0x0'));var util=require(_0x249f('0x1'));var path=require(_0x249f('0x2'));var timeout=require('connect-timeout');var express=require(_0x249f('0x3'));var router=express[_0x249f('0x4')]();var fs_extra=require(_0x249f('0x5'));var auth=require(_0x249f('0x6'));var interaction=require(_0x249f('0x7'));var config=require(_0x249f('0x8'));var controller=require(_0x249f('0x9'));router[_0x249f('0xa')]('/',auth[_0x249f('0xb')](),controller[_0x249f('0xc')]);router['get'](_0x249f('0xd'),auth[_0x249f('0xb')](),controller[_0x249f('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x249f('0xf')]('/:id',auth[_0x249f('0xb')](),controller[_0x249f('0x10')]);router[_0x249f('0x11')](_0x249f('0xd'),auth[_0x249f('0xb')](),controller[_0x249f('0x12')]);module[_0x249f('0x13')]=router;
\ No newline at end of file
+var _0x590e=['/:id','delete','destroy','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','show','post','create','put'];(function(_0x327b65,_0x4888d1){var _0x216687=function(_0x2cc9c4){while(--_0x2cc9c4){_0x327b65['push'](_0x327b65['shift']());}};_0x216687(++_0x4888d1);}(_0x590e,0x143));var _0xe590=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x590e[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xe590('0x0'));var util=require('util');var path=require(_0xe590('0x1'));var timeout=require(_0xe590('0x2'));var express=require(_0xe590('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe590('0x4'));var interaction=require(_0xe590('0x5'));var config=require(_0xe590('0x6'));var controller=require('./disposition.controller');router['get']('/',auth[_0xe590('0x7')](),controller['index']);router[_0xe590('0x8')]('/:id',auth[_0xe590('0x7')](),controller[_0xe590('0x9')]);router[_0xe590('0xa')]('/',auth[_0xe590('0x7')](),controller[_0xe590('0xb')]);router[_0xe590('0xc')](_0xe590('0xd'),auth[_0xe590('0x7')](),controller['update']);router[_0xe590('0xe')](_0xe590('0xd'),auth[_0xe590('0x7')](),controller[_0xe590('0xf')]);module['exports']=router;
\ No newline at end of file
index 6e87563..831deb1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc3d5=['IAX','DADHI','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','9600','12000','14400','v17,v27,v29','INTEGER','SIP'];(function(_0x2d3bd6,_0x41d581){var _0xba6c81=function(_0x54721b){while(--_0x54721b){_0x2d3bd6['push'](_0x2d3bd6['shift']());}};_0xba6c81(++_0x41d581);}(_0xc3d5,0x180));var _0x5c3d=function(_0x5641e3,_0x1437ae){_0x5641e3=_0x5641e3-0x0;var _0x4065e8=_0xc3d5[_0x5641e3];return _0x4065e8;};'use strict';var Sequelize=require(_0x5c3d('0x0'));module[_0x5c3d('0x1')]={'name':{'type':Sequelize[_0x5c3d('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5c3d('0x2')]},'ecm':{'type':Sequelize[_0x5c3d('0x3')](_0x5c3d('0x4'),'no'),'defaultValue':_0x5c3d('0x4')},'headerinfo':{'type':Sequelize[_0x5c3d('0x2')],'defaultValue':_0x5c3d('0x5')},'localstationid':{'type':Sequelize[_0x5c3d('0x2')],'unique':_0x5c3d('0x6')},'minrate':{'type':Sequelize[_0x5c3d('0x3')](_0x5c3d('0x7'),_0x5c3d('0x8'),_0x5c3d('0x9'),_0x5c3d('0xa'),_0x5c3d('0xb'),_0x5c3d('0xc')),'defaultValue':_0x5c3d('0x8')},'maxrate':{'type':Sequelize[_0x5c3d('0x3')](_0x5c3d('0x7'),_0x5c3d('0x8'),_0x5c3d('0x9'),_0x5c3d('0xa'),_0x5c3d('0xb'),'14400'),'defaultValue':_0x5c3d('0xc')},'modem':{'type':Sequelize[_0x5c3d('0x2')],'defaultValue':_0x5c3d('0xd')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x5c3d('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x5c3d('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x5c3d('0x3')](_0x5c3d('0xf'),_0x5c3d('0x10'),_0x5c3d('0x11'),'KHOMP'),'defaultValue':_0x5c3d('0xf')},'key':{'type':Sequelize[_0x5c3d('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x5c3d('0x12')],'defaultValue':function(){return _0x5c3d('0x13');}},'notificationSound':{'type':Sequelize[_0x5c3d('0x14')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5c3d('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5c3d('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5c3d('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5c3d('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5c3d('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5c3d('0xe')],'allowNull':!![],'defaultValue':null,'comment':_0x5c3d('0x15')},'mandatoryDisposition':{'type':Sequelize[_0x5c3d('0x14')],'defaultValue':![],'comment':_0x5c3d('0x16'),'set':function(_0x1cae3e){if(!_0x1cae3e)this[_0x5c3d('0x17')](_0x5c3d('0x18'),null);this[_0x5c3d('0x17')]('mandatoryDisposition',_0x1cae3e);}}};
\ No newline at end of file
+var _0x2236=['TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','ENUM','yes','2400','7200','9600','12000','14400','4800','INTEGER','SIP','IAX','DADHI','KHOMP'];(function(_0x5e3c2a,_0x305984){var _0x480fcd=function(_0x34013e){while(--_0x34013e){_0x5e3c2a['push'](_0x5e3c2a['shift']());}};_0x480fcd(++_0x305984);}(_0x2236,0x64));var _0x6223=function(_0x17c8cc,_0x5e5647){_0x17c8cc=_0x17c8cc-0x0;var _0x3db4eb=_0x2236[_0x17c8cc];return _0x3db4eb;};'use strict';var Sequelize=require('sequelize');module[_0x6223('0x0')]={'name':{'type':Sequelize[_0x6223('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x6223('0x1')]},'ecm':{'type':Sequelize[_0x6223('0x2')](_0x6223('0x3'),'no'),'defaultValue':_0x6223('0x3')},'headerinfo':{'type':Sequelize[_0x6223('0x1')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize['STRING'],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x6223('0x2')](_0x6223('0x4'),'4800',_0x6223('0x5'),_0x6223('0x6'),_0x6223('0x7'),_0x6223('0x8')),'defaultValue':_0x6223('0x9')},'maxrate':{'type':Sequelize[_0x6223('0x2')](_0x6223('0x4'),_0x6223('0x9'),_0x6223('0x5'),'9600',_0x6223('0x7'),_0x6223('0x8')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x6223('0x1')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x6223('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x6223('0xa')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x6223('0xb'),_0x6223('0xc'),_0x6223('0xd'),_0x6223('0xe')),'defaultValue':_0x6223('0xb')},'key':{'type':Sequelize[_0x6223('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x6223('0xf')],'defaultValue':function(){return _0x6223('0x10');}},'notificationSound':{'type':Sequelize[_0x6223('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6223('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6223('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6223('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6223('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6223('0xa')],'allowNull':!![],'defaultValue':null,'comment':_0x6223('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x6223('0x11')],'defaultValue':![],'comment':_0x6223('0x13'),'set':function(_0x1a308d){if(!_0x1a308d)this[_0x6223('0x14')](_0x6223('0x15'),null);this[_0x6223('0x14')](_0x6223('0x16'),_0x1a308d);}}};
\ No newline at end of file
index a6de6e5..d396764 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x578e=['redis','defaults','localhost','./faxAccount.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','get','stack','name','send','index','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','FaxAccount','include','findAll','rows','show','params','Pause','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','FaxAccounts','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','update','describe','FaxAccountId','Disposition','getDispositions','options','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','FaxInteraction','omit','CmContact','Contact','Owner','fullname','internal','Tag','Tags','tag','addApplications','Transaction','ISOLATION_LEVELS','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension','appdata','push','CDR(type)=inbound-fax','Set','gateway','faxdetect','headerinfo','maxrate','t38timeout','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','sequelize','transaction','VoiceExtension','updateAccountApplications','tech','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','Contacts','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','fax','List','out','filename','Messages','Contact\x20not\x20found','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','spread','emit','removeAgents','userFaxAccount:remove','User','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','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/environment','../../config/license/util','../../mysqldb'];(function(_0x4fec26,_0x1dee2b){var _0x426319=function(_0x4c78f4){while(--_0x4c78f4){_0x4fec26['push'](_0x4fec26['shift']());}};_0x426319(++_0x1dee2b);}(_0x578e,0xad));var _0xe578=function(_0x118799,_0x246b44){_0x118799=_0x118799-0x0;var _0x2b16e6=_0x578e[_0x118799];return _0x2b16e6;};'use strict';var emlformat=require(_0xe578('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe578('0x1'));var jsonpatch=require(_0xe578('0x2'));var rp=require(_0xe578('0x3'));var moment=require(_0xe578('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe578('0x5'));var util=require(_0xe578('0x6'));var path=require(_0xe578('0x7'));var sox=require(_0xe578('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe578('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe578('0xa'));var deskjs=require(_0xe578('0xb'));var toCsv=require('to-csv');var querystring=require(_0xe578('0xc'));var Papa=require(_0xe578('0xd'));var Redis=require(_0xe578('0xe'));var authService=require(_0xe578('0xf'));var qs=require(_0xe578('0x10'));var as=require(_0xe578('0x11'));var hardwareService=require(_0xe578('0x12'));var logger=require(_0xe578('0x13'))(_0xe578('0x14'));var utils=require(_0xe578('0x15'));var config=require(_0xe578('0x16'));var licenseUtil=require(_0xe578('0x17'));var db=require(_0xe578('0x18'))['db'];config[_0xe578('0x19')]=_[_0xe578('0x1a')](config[_0xe578('0x19')],{'host':_0xe578('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe578('0x19')]));require(_0xe578('0x1c'))[_0xe578('0x1d')](socket);var jayson=require(_0xe578('0x1e'));var client=jayson[_0xe578('0x1f')][_0xe578('0x20')]({'port':0x232c});var client9002=jayson['client'][_0xe578('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x42b032,_0x300acd,_0x2caa96,_0x5193be){return new BPromise(function(_0x561a37,_0x2b41bd){var _0x17d8cb=_0x5193be||client;return _0x17d8cb[_0xe578('0x21')](_0x42b032,_0x2caa96)[_0xe578('0x22')](function(_0x5e31aa){logger[_0xe578('0x23')]('FaxAccount,\x20%s,\x20%s',_0x300acd,_0xe578('0x24'));logger[_0xe578('0x25')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x300acd,_0xe578('0x24'),JSON[_0xe578('0x26')](_0x5e31aa));if(_0x5e31aa[_0xe578('0x27')]){if(_0x5e31aa[_0xe578('0x27')][_0xe578('0x28')]===0x1f4){logger[_0xe578('0x27')](_0xe578('0x29'),_0x300acd,_0x5e31aa['error']['message']);return _0x2b41bd(_0x5e31aa['error'][_0xe578('0x2a')]);}logger[_0xe578('0x27')](_0xe578('0x29'),_0x300acd,_0x5e31aa[_0xe578('0x27')][_0xe578('0x2a')]);return _0x561a37(_0x5e31aa[_0xe578('0x27')][_0xe578('0x2a')]);}else{logger['info'](_0xe578('0x29'),_0x300acd,_0xe578('0x24'));_0x561a37(_0x5e31aa[_0xe578('0x2b')]['message']);}})[_0xe578('0x2c')](function(_0x1e8e9a){logger[_0xe578('0x27')](_0xe578('0x29'),_0x300acd,_0x1e8e9a);_0x2b41bd(_0x1e8e9a);});});}function respondWithStatusCode(_0x49d1f7,_0x58e25a){_0x58e25a=_0x58e25a||0xcc;return function(_0x1dd352){if(_0x1dd352){return _0x49d1f7[_0xe578('0x2d')](_0x58e25a);}return _0x49d1f7[_0xe578('0x2e')](_0x58e25a)[_0xe578('0x2f')]();};}function respondWithResult(_0x4ab520,_0x5e53a7){_0x5e53a7=_0x5e53a7||0xc8;return function(_0x350f91){if(_0x350f91){return _0x4ab520[_0xe578('0x2e')](_0x5e53a7)[_0xe578('0x30')](_0x350f91);}};}function respondWithFilteredResult(_0x4f7ce4,_0x59531c){return function(_0x75723d){if(_0x75723d){var _0xa9c5b2=typeof _0x59531c[_0xe578('0x31')]==='undefined'&&typeof _0x59531c[_0xe578('0x32')]===_0xe578('0x33');var _0x39a451=_0x75723d[_0xe578('0x34')];var _0x47ec91=_0xa9c5b2?0x0:_0x59531c[_0xe578('0x31')];var _0x3f9115=_0xa9c5b2?_0x75723d[_0xe578('0x34')]:_0x59531c[_0xe578('0x31')]+_0x59531c['limit'];var _0x312af6;if(_0x3f9115>=_0x39a451){_0x3f9115=_0x39a451;_0x312af6=0xc8;}else{_0x312af6=0xce;}_0x4f7ce4[_0xe578('0x2e')](_0x312af6);return _0x4f7ce4[_0xe578('0x35')](_0xe578('0x36'),_0x47ec91+'-'+_0x3f9115+'/'+_0x39a451)['json'](_0x75723d);}return null;};}function patchUpdates(_0x580e5c){return function(_0x3e4121){try{jsonpatch[_0xe578('0x37')](_0x3e4121,_0x580e5c,!![]);}catch(_0x7eaa81){return BPromise[_0xe578('0x38')](_0x7eaa81);}return _0x3e4121[_0xe578('0x39')]();};}function saveUpdates(_0x5883ab,_0x20481b){return function(_0x235716){if(_0x235716){return _0x235716['update'](_0x5883ab)[_0xe578('0x22')](function(_0x544ffe){return _0x544ffe;});}return null;};}function removeEntity(_0x170f5b,_0x31a055){return function(_0x1625e5){if(_0x1625e5){return _0x1625e5[_0xe578('0x3a')]()[_0xe578('0x22')](function(){var _0x423c91=_0x1625e5[_0xe578('0x3b')]({'plain':!![]});var _0x3ef5dd='FaxAccounts';return db['UserProfileResource'][_0xe578('0x3a')]({'where':{'type':_0x3ef5dd,'resourceId':_0x423c91['id']}})[_0xe578('0x22')](function(){return _0x1625e5;});})[_0xe578('0x22')](function(){_0x170f5b[_0xe578('0x2e')](0xcc)[_0xe578('0x2f')]();});}};}function handleEntityNotFound(_0xf49c2b,_0x4ca649){return function(_0x5bfd4a){if(!_0x5bfd4a){_0xf49c2b[_0xe578('0x2d')](0x194);}return _0x5bfd4a;};}function handleError(_0x5161c8,_0x1757fb){_0x1757fb=_0x1757fb||0x1f4;return function(_0x4da2f5){logger[_0xe578('0x27')](_0x4da2f5[_0xe578('0x3c')]);if(_0x4da2f5[_0xe578('0x3d')]){delete _0x4da2f5['name'];}_0x5161c8[_0xe578('0x2e')](_0x1757fb)[_0xe578('0x3e')](_0x4da2f5);};}exports[_0xe578('0x3f')]=function(_0x39fbd3,_0x2a3a27){var _0x130625={'include':[{'model':db['Pause'],'as':_0xe578('0x40')}]},_0x4f952d={},_0x8d13a8={'count':0x0,'rows':[]};var _0x9ef5d0=_[_0xe578('0x41')](db['FaxAccount'][_0xe578('0x42')],function(_0x34505c){return{'name':_0x34505c[_0xe578('0x43')],'type':_0x34505c[_0xe578('0x44')][_0xe578('0x45')]};});_0x4f952d[_0xe578('0x46')]=_[_0xe578('0x41')](_0x9ef5d0,_0xe578('0x3d'));_0x4f952d[_0xe578('0x47')]=_[_0xe578('0x48')](_0x39fbd3[_0xe578('0x47')]);_0x4f952d[_0xe578('0x49')]=_[_0xe578('0x4a')](_0x4f952d[_0xe578('0x46')],_0x4f952d[_0xe578('0x47')]);_0x130625['attributes']=_[_0xe578('0x4a')](_0x4f952d[_0xe578('0x46')],qs['fields'](_0x39fbd3[_0xe578('0x47')][_0xe578('0x4b')]));_0x130625['attributes']=_0x130625['attributes'][_0xe578('0x4c')]?_0x130625[_0xe578('0x4d')]:_0x4f952d[_0xe578('0x46')];if(!_0x39fbd3[_0xe578('0x47')][_0xe578('0x4e')](_0xe578('0x4f'))){_0x130625[_0xe578('0x32')]=qs[_0xe578('0x32')](_0x39fbd3[_0xe578('0x47')][_0xe578('0x32')]);_0x130625[_0xe578('0x31')]=qs[_0xe578('0x31')](_0x39fbd3['query'][_0xe578('0x31')]);}_0x130625[_0xe578('0x50')]=qs['sort'](_0x39fbd3[_0xe578('0x47')][_0xe578('0x51')]);_0x130625[_0xe578('0x52')]=qs[_0xe578('0x49')](_[_0xe578('0x53')](_0x39fbd3['query'],_0x4f952d[_0xe578('0x49')]),_0x9ef5d0);if(_0x39fbd3[_0xe578('0x47')][_0xe578('0x54')]){_0x130625[_0xe578('0x52')]=_[_0xe578('0x55')](_0x130625[_0xe578('0x52')],{'$or':_[_0xe578('0x41')](_0x9ef5d0,function(_0x13c17e){if(_0x13c17e[_0xe578('0x44')]!=='VIRTUAL'){var _0x21f223={};_0x21f223[_0x13c17e[_0xe578('0x3d')]]={'$like':'%'+_0x39fbd3[_0xe578('0x47')][_0xe578('0x54')]+'%'};return _0x21f223;}})});}_0x130625=_[_0xe578('0x55')]({},_0x130625,_0x39fbd3['options']);var _0x3c417b={'where':_0x130625[_0xe578('0x52')]};return db[_0xe578('0x56')][_0xe578('0x34')](_0x3c417b)[_0xe578('0x22')](function(_0x12df8f){_0x8d13a8[_0xe578('0x34')]=_0x12df8f;if(_0x39fbd3['query']['includeAll']){_0x130625[_0xe578('0x57')]=[{'all':!![]}];}return db[_0xe578('0x56')][_0xe578('0x58')](_0x130625);})[_0xe578('0x22')](function(_0x3cfcdb){_0x8d13a8[_0xe578('0x59')]=_0x3cfcdb;return _0x8d13a8;})[_0xe578('0x22')](respondWithFilteredResult(_0x2a3a27,_0x130625))[_0xe578('0x2c')](handleError(_0x2a3a27,null));};exports[_0xe578('0x5a')]=function(_0x1703a0,_0x262462){var _0x4d2d9e={'raw':![],'where':{'id':_0x1703a0[_0xe578('0x5b')]['id']},'include':[{'model':db[_0xe578('0x5c')],'as':_0xe578('0x40')}]},_0x40f13f={};_0x40f13f['model']=_[_0xe578('0x48')](db[_0xe578('0x56')][_0xe578('0x42')]);_0x40f13f[_0xe578('0x47')]=_[_0xe578('0x48')](_0x1703a0[_0xe578('0x47')]);_0x40f13f[_0xe578('0x49')]=_[_0xe578('0x4a')](_0x40f13f[_0xe578('0x46')],_0x40f13f['query']);_0x4d2d9e[_0xe578('0x4d')]=_['intersection'](_0x40f13f[_0xe578('0x46')],qs['fields'](_0x1703a0[_0xe578('0x47')]['fields']));_0x4d2d9e['attributes']=_0x4d2d9e[_0xe578('0x4d')][_0xe578('0x4c')]?_0x4d2d9e[_0xe578('0x4d')]:_0x40f13f[_0xe578('0x46')];if(_0x1703a0['query'][_0xe578('0x5d')]){_0x4d2d9e[_0xe578('0x57')]=[{'all':!![]}];}_0x4d2d9e=_[_0xe578('0x55')]({},_0x4d2d9e,_0x1703a0['options']);return db[_0xe578('0x56')][_0xe578('0x5e')](_0x4d2d9e)['then'](handleEntityNotFound(_0x262462,null))['then'](respondWithResult(_0x262462,null))[_0xe578('0x2c')](handleError(_0x262462,null));};exports['create']=function(_0x862114,_0x457d42){return db[_0xe578('0x56')][_0xe578('0x5f')](_0x862114[_0xe578('0x60')],{})[_0xe578('0x22')](function(_0x19ee69){var _0x33c1ca=_0x862114['user'][_0xe578('0x3b')]({'plain':!![]});if(!_0x33c1ca)throw new Error(_0xe578('0x61'));if(_0x33c1ca[_0xe578('0x62')]===_0xe578('0x63')){var _0x57b565=_0x19ee69['get']({'plain':!![]});var _0x3d2d96=_0xe578('0x64');return db[_0xe578('0x65')][_0xe578('0x5e')]({'where':{'name':_0x3d2d96,'userProfileId':_0x33c1ca[_0xe578('0x66')]},'raw':!![]})[_0xe578('0x22')](function(_0x20a47b){if(_0x20a47b&&_0x20a47b[_0xe578('0x67')]===0x0){return db[_0xe578('0x68')][_0xe578('0x5f')]({'name':_0x57b565[_0xe578('0x3d')],'resourceId':_0x57b565['id'],'type':_0x20a47b[_0xe578('0x3d')],'sectionId':_0x20a47b['id']},{})[_0xe578('0x22')](function(){return _0x19ee69;});}else{return _0x19ee69;}})[_0xe578('0x2c')](function(_0x16dabb){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x16dabb);throw _0x16dabb;});}return _0x19ee69;})[_0xe578('0x22')](respondWithResult(_0x457d42,0xc9))[_0xe578('0x2c')](handleError(_0x457d42,null));};exports[_0xe578('0x69')]=function(_0x563e52,_0x1efa0f){if(_0x563e52[_0xe578('0x60')]['id']){delete _0x563e52[_0xe578('0x60')]['id'];}return db[_0xe578('0x56')][_0xe578('0x5e')]({'where':{'id':_0x563e52[_0xe578('0x5b')]['id']},'include':[{'model':db[_0xe578('0x5c')],'as':_0xe578('0x40')}]})['then'](handleEntityNotFound(_0x1efa0f,null))[_0xe578('0x22')](saveUpdates(_0x563e52[_0xe578('0x60')],null))[_0xe578('0x22')](respondWithResult(_0x1efa0f,null))[_0xe578('0x2c')](handleError(_0x1efa0f,null));};exports[_0xe578('0x3a')]=function(_0x309ac7,_0x47a48e){return db['FaxAccount'][_0xe578('0x5e')]({'where':{'id':_0x309ac7[_0xe578('0x5b')]['id']}})['then'](handleEntityNotFound(_0x47a48e,null))[_0xe578('0x22')](removeEntity(_0x47a48e,null))[_0xe578('0x2c')](handleError(_0x47a48e,null));};exports[_0xe578('0x6a')]=function(_0x39cb62,_0x5aa0d4){return db[_0xe578('0x56')]['describe']()[_0xe578('0x22')](respondWithResult(_0x5aa0d4,null))[_0xe578('0x2c')](handleError(_0x5aa0d4,null));};exports['addDisposition']=function(_0x246657,_0x29f7b7,_0x18c9cd){if(_0x246657['body']['id']){delete _0x246657['body']['id'];}return db['FaxAccount']['find']({'where':{'id':_0x246657[_0xe578('0x5b')]['id']}})[_0xe578('0x22')](handleEntityNotFound(_0x29f7b7,null))[_0xe578('0x22')](function(_0x147997){if(_0x147997){_0x246657[_0xe578('0x60')][_0xe578('0x6b')]=_0x147997['id'];return db[_0xe578('0x6c')][_0xe578('0x5f')](_0x246657[_0xe578('0x60')]);}})[_0xe578('0x22')](respondWithResult(_0x29f7b7,null))['catch'](handleError(_0x29f7b7,null));};exports[_0xe578('0x6d')]=function(_0x263cb5,_0x5e9e0b,_0x4cc8bc){var _0x3d2509={'raw':![],'where':{}};var _0x28c586={};var _0x1e4dd8={'count':0x0,'rows':[]};return db[_0xe578('0x56')]['findOne']({'where':{'id':_0x263cb5['params']['id']}})[_0xe578('0x22')](handleEntityNotFound(_0x5e9e0b,null))[_0xe578('0x22')](function(_0x2ff052){if(_0x2ff052){_0x28c586['model']=_['keys'](db[_0xe578('0x6c')][_0xe578('0x42')]);_0x28c586['query']=_[_0xe578('0x48')](_0x263cb5[_0xe578('0x47')]);_0x28c586[_0xe578('0x49')]=_[_0xe578('0x4a')](_0x28c586[_0xe578('0x46')],_0x28c586['query']);_0x3d2509['attributes']=_[_0xe578('0x4a')](_0x28c586[_0xe578('0x46')],qs['fields'](_0x263cb5[_0xe578('0x47')][_0xe578('0x4b')]));_0x3d2509['attributes']=_0x3d2509[_0xe578('0x4d')]['length']?_0x3d2509[_0xe578('0x4d')]:_0x28c586['model'];if(!_0x263cb5['query'][_0xe578('0x4e')](_0xe578('0x4f'))){_0x3d2509[_0xe578('0x32')]=qs[_0xe578('0x32')](_0x263cb5[_0xe578('0x47')][_0xe578('0x32')]);_0x3d2509['offset']=qs[_0xe578('0x31')](_0x263cb5[_0xe578('0x47')][_0xe578('0x31')]);}_0x3d2509['order']=qs[_0xe578('0x51')](_0x263cb5[_0xe578('0x47')][_0xe578('0x51')]);_0x3d2509['where']=qs[_0xe578('0x49')](_[_0xe578('0x53')](_0x263cb5[_0xe578('0x47')],_0x28c586[_0xe578('0x49')]));_0x3d2509[_0xe578('0x52')][_0xe578('0x6b')]=_0x2ff052['id'];if(_0x263cb5[_0xe578('0x47')]['filter']){_0x3d2509[_0xe578('0x52')]=_['merge'](_0x3d2509[_0xe578('0x52')],{'$or':_[_0xe578('0x41')](_0x3d2509[_0xe578('0x4d')],function(_0x3a1a1e){var _0x4eeb5c={};_0x4eeb5c[_0x3a1a1e]={'$like':'%'+_0x263cb5[_0xe578('0x47')][_0xe578('0x54')]+'%'};return _0x4eeb5c;})});}_0x3d2509=_['merge']({},_0x3d2509,_0x263cb5[_0xe578('0x6e')]);return db[_0xe578('0x6c')][_0xe578('0x34')]({'where':_0x3d2509[_0xe578('0x52')]})[_0xe578('0x22')](function(_0x52e831){_0x1e4dd8['count']=_0x52e831;if(_0x263cb5[_0xe578('0x47')]['includeAll']){_0x3d2509['include']=[{'all':!![]}];}return db[_0xe578('0x6c')][_0xe578('0x58')](_0x3d2509);})[_0xe578('0x22')](function(_0x1f9142){_0x1e4dd8['rows']=_0x1f9142;return _0x1e4dd8;});}})[_0xe578('0x22')](respondWithFilteredResult(_0x5e9e0b,_0x3d2509))[_0xe578('0x2c')](handleError(_0x5e9e0b,null));};exports[_0xe578('0x6f')]=function(_0x373987,_0x12b62c,_0x16eb2c){return db[_0xe578('0x56')][_0xe578('0x5e')]({'where':{'id':_0x373987[_0xe578('0x5b')]['id']}})[_0xe578('0x22')](handleEntityNotFound(_0x12b62c,null))[_0xe578('0x22')](function(_0xfb962e){if(_0xfb962e){return _0xfb962e[_0xe578('0x6f')](_0x373987[_0xe578('0x47')][_0xe578('0x70')]);}})[_0xe578('0x22')](respondWithStatusCode(_0x12b62c,null))['catch'](handleError(_0x12b62c,null));};exports[_0xe578('0x71')]=function(_0x3f06f3,_0x36da30,_0x895002){if(_0x3f06f3[_0xe578('0x60')]['id']){delete _0x3f06f3[_0xe578('0x60')]['id'];}return db[_0xe578('0x56')][_0xe578('0x5e')]({'where':{'id':_0x3f06f3[_0xe578('0x5b')]['id']}})[_0xe578('0x22')](handleEntityNotFound(_0x36da30,null))[_0xe578('0x22')](function(_0x2f38fe){if(_0x2f38fe){_0x3f06f3['body'][_0xe578('0x6b')]=_0x2f38fe['id'];return db[_0xe578('0x72')]['create'](_0x3f06f3['body']);}})[_0xe578('0x22')](respondWithResult(_0x36da30,null))[_0xe578('0x2c')](handleError(_0x36da30,null));};exports[_0xe578('0x73')]=function(_0x2addbc,_0x3c91de,_0x1cdf65){var _0x263a96={'raw':![],'where':{}};var _0x260cfb={};var _0x4aa2b8={'count':0x0,'rows':[]};return db[_0xe578('0x56')][_0xe578('0x74')]({'where':{'id':_0x2addbc[_0xe578('0x5b')]['id']}})[_0xe578('0x22')](handleEntityNotFound(_0x3c91de,null))['then'](function(_0x323281){if(_0x323281){_0x260cfb[_0xe578('0x46')]=_[_0xe578('0x48')](db[_0xe578('0x72')][_0xe578('0x42')]);_0x260cfb[_0xe578('0x47')]=_['keys'](_0x2addbc[_0xe578('0x47')]);_0x260cfb[_0xe578('0x49')]=_[_0xe578('0x4a')](_0x260cfb[_0xe578('0x46')],_0x260cfb[_0xe578('0x47')]);_0x263a96[_0xe578('0x4d')]=_[_0xe578('0x4a')](_0x260cfb[_0xe578('0x46')],qs[_0xe578('0x4b')](_0x2addbc[_0xe578('0x47')][_0xe578('0x4b')]));_0x263a96[_0xe578('0x4d')]=_0x263a96[_0xe578('0x4d')][_0xe578('0x4c')]?_0x263a96[_0xe578('0x4d')]:_0x260cfb[_0xe578('0x46')];if(!_0x2addbc[_0xe578('0x47')][_0xe578('0x4e')](_0xe578('0x4f'))){_0x263a96[_0xe578('0x32')]=qs[_0xe578('0x32')](_0x2addbc[_0xe578('0x47')][_0xe578('0x32')]);_0x263a96[_0xe578('0x31')]=qs[_0xe578('0x31')](_0x2addbc[_0xe578('0x47')][_0xe578('0x31')]);}_0x263a96['order']=qs[_0xe578('0x51')](_0x2addbc['query'][_0xe578('0x51')]);_0x263a96[_0xe578('0x52')]=qs[_0xe578('0x49')](_[_0xe578('0x53')](_0x2addbc[_0xe578('0x47')],_0x260cfb[_0xe578('0x49')]));_0x263a96[_0xe578('0x52')][_0xe578('0x6b')]=_0x323281['id'];if(_0x2addbc['query']['filter']){_0x263a96[_0xe578('0x52')]=_[_0xe578('0x55')](_0x263a96[_0xe578('0x52')],{'$or':_['map'](_0x263a96[_0xe578('0x4d')],function(_0x39ad98){var _0x38a468={};_0x38a468[_0x39ad98]={'$like':'%'+_0x2addbc['query']['filter']+'%'};return _0x38a468;})});}_0x263a96=_[_0xe578('0x55')]({},_0x263a96,_0x2addbc['options']);return db[_0xe578('0x72')][_0xe578('0x34')]({'where':_0x263a96[_0xe578('0x52')]})[_0xe578('0x22')](function(_0x2c0407){_0x4aa2b8[_0xe578('0x34')]=_0x2c0407;if(_0x2addbc['query']['includeAll']){_0x263a96[_0xe578('0x57')]=[{'all':!![]}];}return db[_0xe578('0x72')][_0xe578('0x58')](_0x263a96);})[_0xe578('0x22')](function(_0x315448){_0x4aa2b8[_0xe578('0x59')]=_0x315448;return _0x4aa2b8;});}})['then'](respondWithFilteredResult(_0x3c91de,_0x263a96))[_0xe578('0x2c')](handleError(_0x3c91de,null));};exports[_0xe578('0x75')]=function(_0x24c8ac,_0x1127e8,_0x109f11){return db[_0xe578('0x56')]['find']({'where':{'id':_0x24c8ac[_0xe578('0x5b')]['id']}})[_0xe578('0x22')](handleEntityNotFound(_0x1127e8,null))[_0xe578('0x22')](function(_0x2b6fbc){if(_0x2b6fbc){return _0x2b6fbc['removeAnswers'](_0x24c8ac['query'][_0xe578('0x70')]);}})[_0xe578('0x22')](respondWithStatusCode(_0x1127e8,null))[_0xe578('0x2c')](handleError(_0x1127e8,null));};exports['addInteraction']=function(_0x4af202,_0x35572f,_0x2cbc7a){return db[_0xe578('0x76')][_0xe578('0x5e')]({'where':{'id':_0x4af202[_0xe578('0x5b')]['id']}})[_0xe578('0x22')](handleEntityNotFound(_0x35572f,null))[_0xe578('0x22')](function(_0x1f2238){if(_0x1f2238){return _0x1f2238['addInteraction'](_0x4af202[_0xe578('0x60')]['ids'],_[_0xe578('0x77')](_0x4af202[_0xe578('0x60')],['ids','id'])||{});}})[_0xe578('0x22')](respondWithResult(_0x35572f,null))[_0xe578('0x2c')](handleError(_0x35572f,null));};exports['getInteractions']=function(_0x27329e,_0x2b0dec,_0x1893b0){var _0x49c5ed={'raw':![],'where':{}};var _0x79d58b={};var _0x43fee5={'count':0x0,'rows':[]};return db[_0xe578('0x56')][_0xe578('0x74')]({'where':{'id':_0x27329e[_0xe578('0x5b')]['id']}})[_0xe578('0x22')](handleEntityNotFound(_0x2b0dec,null))['then'](function(_0x37b8e5){if(_0x37b8e5){_0x79d58b[_0xe578('0x46')]=_[_0xe578('0x48')](db['FaxInteraction'][_0xe578('0x42')]);_0x79d58b[_0xe578('0x47')]=_[_0xe578('0x48')](_0x27329e[_0xe578('0x47')]);_0x79d58b[_0xe578('0x49')]=_[_0xe578('0x4a')](_0x79d58b[_0xe578('0x46')],_0x79d58b[_0xe578('0x47')]);_0x49c5ed[_0xe578('0x4d')]=_[_0xe578('0x4a')](_0x79d58b['model'],qs[_0xe578('0x4b')](_0x27329e[_0xe578('0x47')]['fields']));_0x49c5ed[_0xe578('0x4d')]=_0x49c5ed['attributes'][_0xe578('0x4c')]?_0x49c5ed[_0xe578('0x4d')]:_0x79d58b['model'];if(!_0x27329e[_0xe578('0x47')][_0xe578('0x4e')](_0xe578('0x4f'))){_0x49c5ed[_0xe578('0x32')]=qs['limit'](_0x27329e[_0xe578('0x47')]['limit']);_0x49c5ed[_0xe578('0x31')]=qs[_0xe578('0x31')](_0x27329e[_0xe578('0x47')][_0xe578('0x31')]);}_0x49c5ed[_0xe578('0x50')]=qs['sort'](_0x27329e[_0xe578('0x47')][_0xe578('0x51')]);_0x49c5ed[_0xe578('0x52')]=qs[_0xe578('0x49')](_[_0xe578('0x53')](_0x27329e[_0xe578('0x47')],_0x79d58b['filters']));_0x49c5ed['where'][_0xe578('0x6b')]=_0x37b8e5['id'];if(_0x27329e[_0xe578('0x47')][_0xe578('0x54')]){_0x49c5ed[_0xe578('0x52')]=_['merge'](_0x49c5ed['where'],{'$or':_['map'](_0x49c5ed[_0xe578('0x4d')],function(_0x1114e5){var _0x49243c={};_0x49243c[_0x1114e5]={'$like':'%'+_0x27329e['query'][_0xe578('0x54')]+'%'};return _0x49243c;})});}_0x49c5ed=_['merge']({},_0x49c5ed,_0x27329e['options']);return db[_0xe578('0x76')][_0xe578('0x34')]({'where':_0x49c5ed[_0xe578('0x52')]})['then'](function(_0x102d1e){_0x43fee5[_0xe578('0x34')]=_0x102d1e;if(_0x27329e['query'][_0xe578('0x5d')]){_0x49c5ed['include']=[{'model':db[_0xe578('0x78')],'as':_0xe578('0x79'),'required':![]},{'model':db['User'],'as':_0xe578('0x7a'),'attributes':[_0xe578('0x3d'),_0xe578('0x7b'),_0xe578('0x7c')],'required':![]},{'model':db[_0xe578('0x7d')],'as':_0xe578('0x7e'),'attributes':['id','name','color'],'where':_0x27329e[_0xe578('0x47')][_0xe578('0x7f')]?{'id':_0x27329e[_0xe578('0x47')]['tag']}:undefined,'required':_0x27329e['query'][_0xe578('0x7f')]?!![]:![]}];}return db[_0xe578('0x76')][_0xe578('0x58')](_0x49c5ed);})[_0xe578('0x22')](function(_0xda97b1){_0x43fee5['rows']=_0xda97b1;return _0x43fee5;});}})[_0xe578('0x22')](respondWithFilteredResult(_0x2b0dec,_0x49c5ed))[_0xe578('0x2c')](handleError(_0x2b0dec,null));};exports[_0xe578('0x80')]=function(_0x2fe2c5,_0x22a0c0){var _0x124510=_0x2fe2c5[_0xe578('0x5b')]['id'];var _0x281f23=_0x2fe2c5[_0xe578('0x60')];var _0x4ff341=0xc8;var _0x515950=null;return db['sequelize']['transaction']({'isolationLevel':db['sequelize'][_0xe578('0x81')][_0xe578('0x82')]['READ_COMMITTED']},function(_0x1f0775){return db[_0xe578('0x56')][_0xe578('0x74')]({'where':{'id':_0x124510},'transaction':_0x1f0775})[_0xe578('0x22')](function(_0x25a30d){if(_0x25a30d){return db[_0xe578('0x83')][_0xe578('0x3a')]({'where':{'FaxAccountId':_0x124510},'transaction':_0x1f0775})[_0xe578('0x22')](function(){var _0x1c4d9c=_[_0xe578('0x41')](_0x281f23,function(_0x3c5f46){_0x3c5f46[_0xe578('0x6b')]=_0x124510;return _0x3c5f46;});return db[_0xe578('0x83')][_0xe578('0x84')](_0x1c4d9c,{'transaction':_0x1f0775});});}else{_0x4ff341=0x194;_0x515950=[];}});})[_0xe578('0x22')](function(){if(_0x4ff341!==0x194){return db[_0xe578('0x83')][_0xe578('0x85')]({'where':{'FaxAccountId':_0x124510},'order':_0xe578('0x86')})[_0xe578('0x22')](function(_0x3e8142){_0x515950=_0x3e8142;});}})['catch'](function(_0x2342f5){_0x4ff341=0x1f4;logger[_0xe578('0x27')](_0x2342f5[_0xe578('0x3c')]);if(_0x2342f5['name']){delete _0x2342f5[_0xe578('0x3d')];}_0x515950=_0x2342f5;})['finally'](function(){if(_0x515950===null){_0x22a0c0[_0xe578('0x2d')](_0x4ff341);}else{if(_0x4ff341===0x1f4){_0x22a0c0[_0xe578('0x2e')](_0x4ff341)[_0xe578('0x3e')](_0x515950);}else{_0x22a0c0[_0xe578('0x2e')](_0x4ff341)[_0xe578('0x30')](_0x515950);}}});};exports['getApplications']=function(_0x5e9b2d,_0x5ab329,_0x2696b5){var _0x1fcf55={};var _0x2053db={};var _0x463426;var _0x5534c1;return db[_0xe578('0x56')][_0xe578('0x74')]({'where':{'id':_0x5e9b2d['params']['id']}})[_0xe578('0x22')](handleEntityNotFound(_0x5ab329,null))[_0xe578('0x22')](function(_0x38626f){if(_0x38626f){_0x463426=_0x38626f;_0x2053db['model']=_['keys'](db[_0xe578('0x83')][_0xe578('0x42')]);_0x2053db['query']=_['keys'](_0x5e9b2d[_0xe578('0x47')]);_0x2053db[_0xe578('0x49')]=_['intersection'](_0x2053db[_0xe578('0x46')],_0x2053db[_0xe578('0x47')]);_0x1fcf55['attributes']=_[_0xe578('0x4a')](_0x2053db[_0xe578('0x46')],qs['fields'](_0x5e9b2d['query']['fields']));_0x1fcf55[_0xe578('0x4d')]=_0x1fcf55[_0xe578('0x4d')][_0xe578('0x4c')]?_0x1fcf55[_0xe578('0x4d')]:_0x2053db[_0xe578('0x46')];_0x1fcf55[_0xe578('0x50')]=qs[_0xe578('0x51')](_0x5e9b2d[_0xe578('0x47')][_0xe578('0x51')]);_0x1fcf55['where']=qs[_0xe578('0x49')](_[_0xe578('0x53')](_0x5e9b2d[_0xe578('0x47')],_0x2053db[_0xe578('0x49')]));if(_0x5e9b2d[_0xe578('0x47')]['filter']){_0x1fcf55[_0xe578('0x52')]=_[_0xe578('0x55')](_0x1fcf55[_0xe578('0x52')],{'$or':_[_0xe578('0x41')](_0x1fcf55[_0xe578('0x4d')],function(_0x69a78c){var _0x34021f={};_0x34021f[_0x69a78c]={'$like':'%'+_0x5e9b2d[_0xe578('0x47')][_0xe578('0x54')]+'%'};return _0x34021f;})});}_0x1fcf55=_[_0xe578('0x55')]({},_0x1fcf55,_0x5e9b2d['options']);return _0x463426['getApplications'](_0x1fcf55);}})[_0xe578('0x22')](function(_0x5efd1a){if(_0x5efd1a){_0x5534c1=_0x5efd1a['length'];if(!_0x5e9b2d[_0xe578('0x47')][_0xe578('0x4e')](_0xe578('0x4f'))){_0x1fcf55[_0xe578('0x32')]=qs[_0xe578('0x32')](_0x5e9b2d[_0xe578('0x47')]['limit']);_0x1fcf55[_0xe578('0x31')]=qs[_0xe578('0x31')](_0x5e9b2d[_0xe578('0x47')][_0xe578('0x31')]);}return _0x463426[_0xe578('0x87')](_0x1fcf55);}})[_0xe578('0x22')](function(_0x48e37c){if(_0x48e37c){return _0x48e37c?{'count':_0x5534c1,'rows':_0x48e37c}:null;}})['then'](respondWithResult(_0x5ab329,null))[_0xe578('0x2c')](handleError(_0x5ab329,null));};function Extension(_0x2d24fa,_0x1a5d35,_0x4ff56c,_0x205890){this['context']=_0xe578('0x88');this[_0xe578('0x89')]=_0x2d24fa[_0xe578('0x8a')];this[_0xe578('0x8b')]=_0x205890;this[_0xe578('0x44')]=_0xe578('0x8c');this[_0xe578('0x8d')]=_0xe578('0x8e');this[_0xe578('0x6b')]=_0x2d24fa['id'];this[_0xe578('0x86')]=_0x1a5d35;this[_0xe578('0x8f')]=_0x4ff56c;}function createExtensionsReciveFax(_0x33bd36){var _0xac99ac=0x1;var _0x6c6161=[];_0x6c6161[_0xe578('0x90')](new Extension(_0x33bd36,_0xac99ac,'','Answer'));_0xac99ac+=0x1;_0x6c6161[_0xe578('0x90')](new Extension(_0x33bd36,_0xac99ac,_0xe578('0x91'),_0xe578('0x92')));_0xac99ac+=0x1;for(var _0x4526ba in _0x33bd36){if(_0x33bd36[_0xe578('0x4e')](_0x4526ba)&&(_0x4526ba==='ecm'||_0x4526ba===_0xe578('0x8a')||_0x4526ba===_0xe578('0x93')||_0x4526ba===_0xe578('0x94')||_0x4526ba===_0xe578('0x95')||_0x4526ba===_0xe578('0x96')||_0x4526ba==='minrate'||_0x4526ba==='modem'||_0x4526ba===_0xe578('0x97'))){_0x6c6161[_0xe578('0x90')](new Extension(_0x33bd36,_0xac99ac,'FAXOPT('+_0x4526ba+')='+_0x33bd36[_0x4526ba],_0xe578('0x92')));_0xac99ac+=0x1;}}_0x6c6161[_0xe578('0x90')](new Extension(_0x33bd36,_0xac99ac,'6',_0xe578('0x98')));_0xac99ac+=0x1;_0x6c6161[_0xe578('0x90')](new Extension(_0x33bd36,_0xac99ac,_0xe578('0x99'),_0xe578('0x9a')));_0xac99ac=0x0;return _0x6c6161;}exports[_0xe578('0x9b')]=function(_0xc8f1d9,_0x55546e,_0xac93c8){var _0x4976bd;return db[_0xe578('0x9c')][_0xe578('0x9d')](function(_0x3ce447){return db[_0xe578('0x56')][_0xe578('0x5f')](_0xc8f1d9['body'],{'transaction':_0x3ce447})[_0xe578('0x22')](function(_0x50cb57){_0x4976bd=_0x50cb57[_0xe578('0x3b')]({'plain':!![]});return db[_0xe578('0x9e')][_0xe578('0x84')](createExtensionsReciveFax(_0x4976bd),{'transaction':_0x3ce447});});})[_0xe578('0x22')](function(){return _0x4976bd;})[_0xe578('0x22')](respondWithResult(_0x55546e,null))[_0xe578('0x2c')](handleError(_0x55546e,null));};exports[_0xe578('0x9f')]=function(_0x43b696,_0x110383,_0x311f3c){var _0x3f1ae7;return db[_0xe578('0x9c')][_0xe578('0x9d')](function(_0x75acef){return db[_0xe578('0x56')][_0xe578('0x69')](_0x43b696[_0xe578('0x60')],{'where':{'id':_0x43b696[_0xe578('0x60')]['id']},'transaction':_0x75acef})['then'](function(_0x47e434){return db['VoiceExtension']['destroy']({'where':{'FaxAccountId':_0x43b696[_0xe578('0x60')]['id']},'transaction':_0x75acef})[_0xe578('0x22')](function(_0x340e9e){return db[_0xe578('0x9e')][_0xe578('0x84')](createExtensionsReciveFax(_[_0xe578('0x77')](_0x43b696[_0xe578('0x60')],[_0xe578('0xa0'),'key',_0xe578('0xa1'),_0xe578('0xa2'),_0xe578('0xa3'),_0xe578('0xa4')])),{'transaction':_0x75acef});});});})[_0xe578('0x22')](function(){return db[_0xe578('0x56')][_0xe578('0xa5')](_0x43b696[_0xe578('0x60')]['id']);})['then'](respondWithResult(_0x110383,null))[_0xe578('0x2c')](handleError(_0x110383,null));};exports[_0xe578('0xa6')]=function(_0xa221d,_0x56e7c7,_0x1242b5){var _0x3c3a53={'raw':!![],'where':{}};var _0x26905c={};var _0x1637fa={'count':0x0,'rows':[]};return db[_0xe578('0x56')][_0xe578('0x74')]({'where':{'id':_0xa221d[_0xe578('0x5b')]['id']}})[_0xe578('0x22')](handleEntityNotFound(_0x56e7c7,null))[_0xe578('0x22')](function(_0xc353b9){if(_0xc353b9){_0x26905c[_0xe578('0x46')]=_[_0xe578('0x48')](db[_0xe578('0xa7')][_0xe578('0x42')]);_0x26905c[_0xe578('0x47')]=_['keys'](_0xa221d[_0xe578('0x47')]);_0x26905c['filters']=_[_0xe578('0x4a')](_0x26905c[_0xe578('0x46')],_0x26905c[_0xe578('0x47')]);_0x3c3a53['attributes']=_[_0xe578('0x4a')](_0x26905c['model'],qs[_0xe578('0x4b')](_0xa221d['query'][_0xe578('0x4b')]));_0x3c3a53[_0xe578('0x4d')]=_0x3c3a53[_0xe578('0x4d')][_0xe578('0x4c')]?_0x3c3a53[_0xe578('0x4d')]:_0x26905c[_0xe578('0x46')];if(!_0xa221d[_0xe578('0x47')][_0xe578('0x4e')](_0xe578('0x4f'))){_0x3c3a53[_0xe578('0x32')]=qs[_0xe578('0x32')](_0xa221d['query'][_0xe578('0x32')]);_0x3c3a53['offset']=qs[_0xe578('0x31')](_0xa221d[_0xe578('0x47')][_0xe578('0x31')]);}_0x3c3a53['order']=qs['sort'](_0xa221d['query'][_0xe578('0x51')]);_0x3c3a53[_0xe578('0x52')]=qs[_0xe578('0x49')](_[_0xe578('0x53')](_0xa221d['query'],_0x26905c[_0xe578('0x49')]));_0x3c3a53[_0xe578('0x52')]['FaxAccountId']=_0xc353b9['id'];if(_0xa221d['query'][_0xe578('0x54')]){_0x3c3a53[_0xe578('0x52')]=_[_0xe578('0x55')](_0x3c3a53[_0xe578('0x52')],{'$or':_['map'](_0x3c3a53[_0xe578('0x4d')],function(_0x41fb61){var _0x27b6b9={};_0x27b6b9[_0x41fb61]={'$like':'%'+_0xa221d['query'][_0xe578('0x54')]+'%'};return _0x27b6b9;})});}if(_0xa221d[_0xe578('0x47')][_0xe578('0xa8')]){var _0x34b3fa=_0xa221d[_0xe578('0x47')][_0xe578('0xa8')][_0xe578('0xa9')](',');var _0x1b65c6={};_0x1b65c6[_0x34b3fa[0x0]]={'$gte':moment(_0x34b3fa[0x1])[_0xe578('0xaa')](_0xe578('0xab'))};_0x3c3a53[_0xe578('0x52')]=_[_0xe578('0x55')](_0x3c3a53[_0xe578('0x52')],_0x1b65c6);}_0x3c3a53=_[_0xe578('0x55')]({},_0x3c3a53,_0xa221d[_0xe578('0x6e')]);return db['FaxMessage']['count']({'where':_0x3c3a53[_0xe578('0x52')]})[_0xe578('0x22')](function(_0x378bfa){_0x1637fa[_0xe578('0x34')]=_0x378bfa;if(_0xa221d[_0xe578('0x47')][_0xe578('0x5d')]){_0x3c3a53['include']=[{'all':!![]}];}return db[_0xe578('0xa7')]['findAll'](_0x3c3a53);})['then'](function(_0x5c73f5){_0x1637fa['rows']=_0x5c73f5;return _0x1637fa;});}})[_0xe578('0x22')](respondWithFilteredResult(_0x56e7c7,_0x3c3a53))['catch'](handleError(_0x56e7c7,null));};exports[_0xe578('0x3e')]=function(_0x2658f5,_0x57ba60,_0x3eae07){var _0x183ae6,_0x14708b={},_0x23aa46;if(_0x2658f5['body']['to']){_0x23aa46=_0x2658f5[_0xe578('0x60')]['to'][0x0];}return db[_0xe578('0x56')][_0xe578('0x5e')]({'where':{'id':_0x2658f5[_0xe578('0x5b')]['id']},'include':[{'model':db[_0xe578('0xac')],'as':'List','include':[{'model':db[_0xe578('0x78')],'as':_0xe578('0xad'),'where':{'fax':_0x23aa46},'limit':0x1,'order':[[_0xe578('0xa2'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x57ba60,null))[_0xe578('0x22')](function(_0x63aa98){_0x183ae6=_0x63aa98;if(_0x2658f5['body'][_0xe578('0xae')]&&_0x2658f5[_0xe578('0x60')][_0xe578('0xae')]['length']){for(var _0x3eee91=0x0;_0x3eee91<_0x2658f5[_0xe578('0x60')]['attachments']['length'];_0x3eee91+=0x1){_0x2658f5['body'][_0xe578('0xae')][_0x3eee91]={'filename':_0x2658f5[_0xe578('0x60')][_0xe578('0xae')][_0x3eee91][_0xe578('0x3d')],'id':_0x2658f5[_0xe578('0x60')][_0xe578('0xae')][_0x3eee91]['id'],'path':path[_0xe578('0xaf')](config[_0xe578('0xb0')],_0xe578('0xb1'),_0x2658f5[_0xe578('0x60')][_0xe578('0xae')][_0x3eee91][_0xe578('0xb2')])};}}return respondWithRpcPromise(_0xe578('0xb3'),'CheckAfterSend',{'FaxAccountId':_[_0xe578('0xb4')](_0x2658f5[_0xe578('0x5b')]['id'])?undefined:_0x2658f5[_0xe578('0x5b')]['id'],'path':_[_0xe578('0xb4')](_0x2658f5[_0xe578('0x60')][_0xe578('0xae')][0x0][_0xe578('0x7')])?undefined:_0x2658f5[_0xe578('0x60')]['attachments'][0x0]['path'],'fax':_[_0xe578('0xb4')](_0x2658f5[_0xe578('0x60')]['to'][0x0])?undefined:_0x2658f5['body']['to'][0x0]},client9002);})[_0xe578('0x22')](function(){if(_0x183ae6){if(_[_0xe578('0xb4')](_0x2658f5[_0xe578('0x60')][_0xe578('0xb5')])){_0x2658f5[_0xe578('0x60')][_0xe578('0xb5')]=util[_0xe578('0xaa')]('\x22%s\x22\x20<%s>',_0x183ae6[_0xe578('0x3d')],_0x183ae6[_0xe578('0xb6')]);}if(_0x183ae6[_0xe578('0xb7')]){if(_0x183ae6[_0xe578('0xb7')][_0xe578('0xad')][_0xe578('0x4c')]){return _0x183ae6[_0xe578('0xb7')][_0xe578('0xad')][0x0];}else{return db[_0xe578('0x78')][_0xe578('0x5f')](_[_0xe578('0x1a')](_0x2658f5[_0xe578('0x60')],{'firstName':_0x2658f5['body']['to'][0x0],'phone':_0x2658f5[_0xe578('0x60')]['to'][0x0],'fax':_0x2658f5['body']['to'][0x0],'ListId':_0x183ae6[_0xe578('0xa4')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error('Send\x20Fax\x20failed');}})['then'](function(_0x25e96b){if(_0x25e96b){return db[_0xe578('0x76')][_0xe578('0x5e')]({'where':{'ContactId':_0x25e96b['id'],'closed':![],'FaxAccountId':_0x183ae6['id']}})[_0xe578('0x22')](function(_0x1d8242){if(_0x1d8242){return[_0x1d8242,![]];}return db[_0xe578('0x76')][_0xe578('0x5f')]({'UserId':_0x2658f5[_0xe578('0x63')]['id'],'ContactId':_0x25e96b['id'],'FaxAccountId':_0x183ae6['id'],'fax':_0x2658f5[_0xe578('0x60')]['to'][0x0],'firstMsgDirection':_0xe578('0xb8'),'Messages':[_['merge'](_0x2658f5[_0xe578('0x60')],{'read':![],'body':_0x2658f5['body']['attachments'][0x0][_0xe578('0xb9')],'FaxAccountId':_0x183ae6['id'],'UserId':_0x2658f5['user']['id'],'ContactId':_0x25e96b['id'],'AttachmentId':_0x2658f5[_0xe578('0x60')][_0xe578('0xae')][0x0]['id']})]},{'include':[{'model':db[_0xe578('0xa7')],'as':_0xe578('0xba')}]})[_0xe578('0x22')](function(_0x3765ea){return[_0x3765ea,!![]];});});}else{throw new Error(_0xe578('0xbb'));}})['spread'](function(_0x5ae224,_0x5985a8){if(_0x5985a8){return _0x5ae224;}return db[_0xe578('0xa7')][_0xe578('0x5f')]({'direction':_0xe578('0xb8'),'read':![],'body':_0x2658f5[_0xe578('0x60')]['attachments'][0x0][_0xe578('0xb9')],'FaxAccountId':_0x183ae6['id'],'FaxInteractionId':_0x5ae224['id'],'UserId':_0x2658f5['user']['id'],'ContactId':_0x5ae224['ContactId'],'AttachmentId':_0x2658f5[_0xe578('0x60')][_0xe578('0xae')][0x0]['id']})['then'](function(_0x3e5e62){_0x5ae224[_0xe578('0xbc')][_0xe578('0xba')]=[];_0x5ae224[_0xe578('0xbc')][_0xe578('0xba')][_0xe578('0x90')](_0x3e5e62[_0xe578('0xbc')]);return _0x5ae224;});})[_0xe578('0x22')](function(_0xa33223){respondWithRpcPromise(_0xe578('0xbd'),_0xe578('0xbd'),{'FaxAccountId':_[_0xe578('0xb4')](_0x2658f5[_0xe578('0x5b')]['id'])?undefined:_0x2658f5[_0xe578('0x5b')]['id'],'path':_[_0xe578('0xb4')](_0x2658f5['body']['attachments'][0x0][_0xe578('0x7')])?undefined:_0x2658f5['body']['attachments'][0x0]['path'],'fax':_[_0xe578('0xb4')](_0x2658f5['body']['to'][0x0])?undefined:_0x2658f5[_0xe578('0x60')]['to'][0x0],'AttachmentId':_0x2658f5[_0xe578('0x60')][_0xe578('0xae')][0x0]['id']},client9002)[_0xe578('0x22')](function(_0x31beb1){logger['info'](_0xe578('0xbe'),_0x31beb1);})[_0xe578('0x2c')](function(_0x19e176){logger[_0xe578('0x23')](_0xe578('0xbe'),_0x19e176);});return _0xa33223;})[_0xe578('0x22')](respondWithResult(_0x57ba60,null))[_0xe578('0x2c')](handleError(_0x57ba60,null));};exports[_0xe578('0xbf')]=function(_0x535e5d,_0x3bf43c,_0x520ff9){return db[_0xe578('0x56')]['find']({'where':{'id':_0x535e5d['params']['id']}})[_0xe578('0x22')](handleEntityNotFound(_0x3bf43c,null))[_0xe578('0x22')](function(_0x23b52b){if(_0x23b52b){return _0x23b52b[_0xe578('0xbf')](_0x535e5d[_0xe578('0x60')][_0xe578('0x70')],_[_0xe578('0x77')](_0x535e5d[_0xe578('0x60')],[_0xe578('0x70'),'id'])||{})[_0xe578('0xc0')](function(_0x3dac87){for(var _0x28a9e1=0x0;_0x28a9e1<_0x535e5d[_0xe578('0x60')]['ids'][_0xe578('0x4c')];_0x28a9e1+=0x1){socket[_0xe578('0xc1')]('userFaxAccount:save',{'UserId':Number(_0x535e5d[_0xe578('0x60')][_0xe578('0x70')][_0x28a9e1]),'FaxAccountId':Number(_0x535e5d[_0xe578('0x5b')]['id'])});}return _0x3dac87;});}})[_0xe578('0x22')](respondWithResult(_0x3bf43c,null))[_0xe578('0x2c')](handleError(_0x3bf43c,null));};exports['removeAgents']=function(_0x59a643,_0x3cf2bf,_0xbde437){return db['FaxAccount'][_0xe578('0x5e')]({'where':{'id':_0x59a643['params']['id']}})[_0xe578('0x22')](handleEntityNotFound(_0x3cf2bf,null))[_0xe578('0x22')](function(_0x2b9731){if(_0x2b9731){return _0x2b9731[_0xe578('0xc2')](_0x59a643[_0xe578('0x47')][_0xe578('0x70')])[_0xe578('0x22')](function(){if(_['isArray'](_0x59a643['query']['ids'])){for(var _0x52f46c=0x0;_0x52f46c<_0x59a643['query']['ids'][_0xe578('0x4c')];_0x52f46c+=0x1){socket[_0xe578('0xc1')](_0xe578('0xc3'),{'UserId':Number(_0x59a643[_0xe578('0x47')][_0xe578('0x70')][_0x52f46c]),'FaxAccountId':Number(_0x59a643[_0xe578('0x5b')]['id'])});}}else{socket[_0xe578('0xc1')](_0xe578('0xc3'),{'UserId':Number(_0x59a643[_0xe578('0x47')][_0xe578('0x70')]),'FaxAccountId':Number(_0x59a643[_0xe578('0x5b')]['id'])});}});}})['then'](respondWithStatusCode(_0x3cf2bf,null))[_0xe578('0x2c')](handleError(_0x3cf2bf,null));};exports['getAgents']=function(_0x5e326c,_0x40fb90,_0x2ac10a){var _0x298fb4={};var _0x10f8f8={};var _0x5cb9f3;var _0x294641;return db[_0xe578('0x56')][_0xe578('0x74')]({'where':{'id':_0x5e326c[_0xe578('0x5b')]['id']}})[_0xe578('0x22')](handleEntityNotFound(_0x40fb90,null))[_0xe578('0x22')](function(_0x4c5900){if(_0x4c5900){_0x5cb9f3=_0x4c5900;_0x10f8f8['model']=_[_0xe578('0x48')](db[_0xe578('0xc4')][_0xe578('0x42')]);_0x10f8f8[_0xe578('0x47')]=_[_0xe578('0x48')](_0x5e326c[_0xe578('0x47')]);_0x10f8f8[_0xe578('0x49')]=_[_0xe578('0x4a')](_0x10f8f8[_0xe578('0x46')],_0x10f8f8[_0xe578('0x47')]);_0x298fb4[_0xe578('0x4d')]=_[_0xe578('0x4a')](_0x10f8f8[_0xe578('0x46')],qs[_0xe578('0x4b')](_0x5e326c[_0xe578('0x47')]['fields']));_0x298fb4[_0xe578('0x4d')]=_0x298fb4['attributes'][_0xe578('0x4c')]?_0x298fb4[_0xe578('0x4d')]:_0x10f8f8['model'];_0x298fb4[_0xe578('0x50')]=qs[_0xe578('0x51')](_0x5e326c[_0xe578('0x47')][_0xe578('0x51')]);_0x298fb4[_0xe578('0x52')]=qs['filters'](_['pick'](_0x5e326c[_0xe578('0x47')],_0x10f8f8['filters']));if(_0x5e326c[_0xe578('0x47')][_0xe578('0x54')]){_0x298fb4['where']=_[_0xe578('0x55')](_0x298fb4['where'],{'$or':_[_0xe578('0x41')](_0x298fb4['attributes'],function(_0x9d9a7b){var _0x2b3caf={};_0x2b3caf[_0x9d9a7b]={'$like':'%'+_0x5e326c[_0xe578('0x47')][_0xe578('0x54')]+'%'};return _0x2b3caf;})});}_0x298fb4=_['merge']({},_0x298fb4,_0x5e326c[_0xe578('0x6e')]);return _0x5cb9f3['getAgents'](_0x298fb4);}})['then'](function(_0x5f17cd){if(_0x5f17cd){_0x294641=_0x5f17cd['length'];if(!_0x5e326c[_0xe578('0x47')][_0xe578('0x4e')]('nolimit')){_0x298fb4[_0xe578('0x32')]=qs[_0xe578('0x32')](_0x5e326c[_0xe578('0x47')][_0xe578('0x32')]);_0x298fb4[_0xe578('0x31')]=qs['offset'](_0x5e326c[_0xe578('0x47')][_0xe578('0x31')]);}return _0x5cb9f3[_0xe578('0xc5')](_0x298fb4);}})['then'](function(_0x232c07){if(_0x232c07){return _0x232c07?{'count':_0x294641,'rows':_0x232c07}:null;}})[_0xe578('0x22')](respondWithResult(_0x40fb90,null))[_0xe578('0x2c')](handleError(_0x40fb90,null));};
\ No newline at end of file
+var _0x5ada=['addDisposition','FaxAccountId','getDispositions','Disposition','order','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','findOne','CmContact','Contact','User','Owner','fullname','internal','Tag','color','tag','addApplications','transaction','sequelize','Transaction','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','from-voip-provider','localstationid','app','description','Fax\x20Extension','appdata','push','CDR(type)=inbound-fax','Set','ecm','faxdetect','headerinfo','modem','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','updateAccountApplications','VoiceExtension','createdAt','updatedAt','TrunkId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','Contacts','DESC','attachments','join','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','spread','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','emit','getAgents','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','redis','defaults','socket.io-emitter','./faxAccount.socket','jayson/promise','client','http','request','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','status','end','json','offset','undefined','limit','count','set','apply','save','update','destroy','then','FaxAccounts','UserProfileResource','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','FaxAccount','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','create','describe'];(function(_0x246115,_0x398123){var _0x385878=function(_0x534a9c){while(--_0x534a9c){_0x246115['push'](_0x246115['shift']());}};_0x385878(++_0x398123);}(_0x5ada,0x1d9));var _0xa5ad=function(_0x1ffff7,_0x2f9ff6){_0x1ffff7=_0x1ffff7-0x0;var _0x49d017=_0x5ada[_0x1ffff7];return _0x49d017;};'use strict';var emlformat=require(_0xa5ad('0x0'));var rimraf=require(_0xa5ad('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa5ad('0x2'));var rp=require(_0xa5ad('0x3'));var moment=require('moment');var BPromise=require(_0xa5ad('0x4'));var Mustache=require(_0xa5ad('0x5'));var util=require(_0xa5ad('0x6'));var path=require(_0xa5ad('0x7'));var sox=require(_0xa5ad('0x8'));var csv=require('to-csv');var ejs=require(_0xa5ad('0x9'));var fs=require('fs');var fs_extra=require(_0xa5ad('0xa'));var _=require(_0xa5ad('0xb'));var squel=require(_0xa5ad('0xc'));var crypto=require(_0xa5ad('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa5ad('0xe'));var toCsv=require(_0xa5ad('0xf'));var querystring=require('querystring');var Papa=require(_0xa5ad('0x10'));var Redis=require(_0xa5ad('0x11'));var authService=require(_0xa5ad('0x12'));var qs=require(_0xa5ad('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa5ad('0x14'));var logger=require(_0xa5ad('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xa5ad('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xa5ad('0x17')]=_[_0xa5ad('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa5ad('0x19'))(new Redis(config['redis']));require(_0xa5ad('0x1a'))['register'](socket);var jayson=require(_0xa5ad('0x1b'));var client=jayson[_0xa5ad('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0xa5ad('0x1c')][_0xa5ad('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5475f4,_0x466519,_0x466166,_0xee3a88){return new BPromise(function(_0x54773e,_0x51ddd4){var _0x3bc2a2=_0xee3a88||client;return _0x3bc2a2[_0xa5ad('0x1e')](_0x5475f4,_0x466166)['then'](function(_0x437671){logger['info'](_0xa5ad('0x1f'),_0x466519,_0xa5ad('0x20'));logger[_0xa5ad('0x21')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x466519,_0xa5ad('0x20'),JSON['stringify'](_0x437671));if(_0x437671[_0xa5ad('0x22')]){if(_0x437671['error'][_0xa5ad('0x23')]===0x1f4){logger[_0xa5ad('0x22')]('FaxAccount,\x20%s,\x20%s',_0x466519,_0x437671['error'][_0xa5ad('0x24')]);return _0x51ddd4(_0x437671['error'][_0xa5ad('0x24')]);}logger[_0xa5ad('0x22')](_0xa5ad('0x1f'),_0x466519,_0x437671[_0xa5ad('0x22')]['message']);return _0x54773e(_0x437671[_0xa5ad('0x22')][_0xa5ad('0x24')]);}else{logger[_0xa5ad('0x25')]('FaxAccount,\x20%s,\x20%s',_0x466519,_0xa5ad('0x20'));_0x54773e(_0x437671[_0xa5ad('0x26')][_0xa5ad('0x24')]);}})[_0xa5ad('0x27')](function(_0x5c8569){logger[_0xa5ad('0x22')](_0xa5ad('0x1f'),_0x466519,_0x5c8569);_0x51ddd4(_0x5c8569);});});}function respondWithStatusCode(_0x4c4e44,_0x129a15){_0x129a15=_0x129a15||0xcc;return function(_0xfd3df1){if(_0xfd3df1){return _0x4c4e44['sendStatus'](_0x129a15);}return _0x4c4e44[_0xa5ad('0x28')](_0x129a15)[_0xa5ad('0x29')]();};}function respondWithResult(_0x6b9f6,_0x399a1e){_0x399a1e=_0x399a1e||0xc8;return function(_0x27b28e){if(_0x27b28e){return _0x6b9f6[_0xa5ad('0x28')](_0x399a1e)[_0xa5ad('0x2a')](_0x27b28e);}};}function respondWithFilteredResult(_0x2f6482,_0x359778){return function(_0x2525f7){if(_0x2525f7){var _0x28fb41=typeof _0x359778[_0xa5ad('0x2b')]===_0xa5ad('0x2c')&&typeof _0x359778[_0xa5ad('0x2d')]===_0xa5ad('0x2c');var _0x3a0841=_0x2525f7['count'];var _0x347a28=_0x28fb41?0x0:_0x359778[_0xa5ad('0x2b')];var _0x4eed69=_0x28fb41?_0x2525f7[_0xa5ad('0x2e')]:_0x359778[_0xa5ad('0x2b')]+_0x359778[_0xa5ad('0x2d')];var _0x44e02d;if(_0x4eed69>=_0x3a0841){_0x4eed69=_0x3a0841;_0x44e02d=0xc8;}else{_0x44e02d=0xce;}_0x2f6482[_0xa5ad('0x28')](_0x44e02d);return _0x2f6482[_0xa5ad('0x2f')]('Content-Range',_0x347a28+'-'+_0x4eed69+'/'+_0x3a0841)[_0xa5ad('0x2a')](_0x2525f7);}return null;};}function patchUpdates(_0x8b9438){return function(_0x3e310b){try{jsonpatch[_0xa5ad('0x30')](_0x3e310b,_0x8b9438,!![]);}catch(_0x4a48f3){return BPromise['reject'](_0x4a48f3);}return _0x3e310b[_0xa5ad('0x31')]();};}function saveUpdates(_0x219e72,_0x5f1c93){return function(_0x52580f){if(_0x52580f){return _0x52580f[_0xa5ad('0x32')](_0x219e72)['then'](function(_0x21569a){return _0x21569a;});}return null;};}function removeEntity(_0x27adf5,_0x568c1f){return function(_0x52da85){if(_0x52da85){return _0x52da85[_0xa5ad('0x33')]()[_0xa5ad('0x34')](function(){var _0xc74016=_0x52da85['get']({'plain':!![]});var _0x1de19e=_0xa5ad('0x35');return db[_0xa5ad('0x36')][_0xa5ad('0x33')]({'where':{'type':_0x1de19e,'resourceId':_0xc74016['id']}})['then'](function(){return _0x52da85;});})['then'](function(){_0x27adf5[_0xa5ad('0x28')](0xcc)[_0xa5ad('0x29')]();});}};}function handleEntityNotFound(_0xbbeb3,_0x32cece){return function(_0x1620d8){if(!_0x1620d8){_0xbbeb3[_0xa5ad('0x37')](0x194);}return _0x1620d8;};}function handleError(_0x220fe1,_0x345c0b){_0x345c0b=_0x345c0b||0x1f4;return function(_0x5bff0c){logger[_0xa5ad('0x22')](_0x5bff0c[_0xa5ad('0x38')]);if(_0x5bff0c[_0xa5ad('0x39')]){delete _0x5bff0c[_0xa5ad('0x39')];}_0x220fe1[_0xa5ad('0x28')](_0x345c0b)[_0xa5ad('0x3a')](_0x5bff0c);};}exports[_0xa5ad('0x3b')]=function(_0x1ad93a,_0x50d2f4){var _0x4e4a11={'include':[{'model':db[_0xa5ad('0x3c')],'as':_0xa5ad('0x3d')}]},_0x512663={},_0x5c2ab1={'count':0x0,'rows':[]};var _0x3b2d62=_[_0xa5ad('0x3e')](db['FaxAccount'][_0xa5ad('0x3f')],function(_0x501f99){return{'name':_0x501f99['fieldName'],'type':_0x501f99['type']['key']};});_0x512663['model']=_['map'](_0x3b2d62,_0xa5ad('0x39'));_0x512663[_0xa5ad('0x40')]=_['keys'](_0x1ad93a['query']);_0x512663[_0xa5ad('0x41')]=_[_0xa5ad('0x42')](_0x512663[_0xa5ad('0x43')],_0x512663[_0xa5ad('0x40')]);_0x4e4a11[_0xa5ad('0x44')]=_[_0xa5ad('0x42')](_0x512663[_0xa5ad('0x43')],qs['fields'](_0x1ad93a[_0xa5ad('0x40')][_0xa5ad('0x45')]));_0x4e4a11['attributes']=_0x4e4a11[_0xa5ad('0x44')][_0xa5ad('0x46')]?_0x4e4a11[_0xa5ad('0x44')]:_0x512663[_0xa5ad('0x43')];if(!_0x1ad93a[_0xa5ad('0x40')][_0xa5ad('0x47')](_0xa5ad('0x48'))){_0x4e4a11[_0xa5ad('0x2d')]=qs[_0xa5ad('0x2d')](_0x1ad93a[_0xa5ad('0x40')][_0xa5ad('0x2d')]);_0x4e4a11[_0xa5ad('0x2b')]=qs[_0xa5ad('0x2b')](_0x1ad93a[_0xa5ad('0x40')]['offset']);}_0x4e4a11['order']=qs[_0xa5ad('0x49')](_0x1ad93a[_0xa5ad('0x40')][_0xa5ad('0x49')]);_0x4e4a11['where']=qs['filters'](_[_0xa5ad('0x4a')](_0x1ad93a[_0xa5ad('0x40')],_0x512663['filters']),_0x3b2d62);if(_0x1ad93a[_0xa5ad('0x40')][_0xa5ad('0x4b')]){_0x4e4a11[_0xa5ad('0x4c')]=_[_0xa5ad('0x4d')](_0x4e4a11[_0xa5ad('0x4c')],{'$or':_[_0xa5ad('0x3e')](_0x3b2d62,function(_0xd6ce79){if(_0xd6ce79[_0xa5ad('0x4e')]!==_0xa5ad('0x4f')){var _0x27717f={};_0x27717f[_0xd6ce79['name']]={'$like':'%'+_0x1ad93a[_0xa5ad('0x40')][_0xa5ad('0x4b')]+'%'};return _0x27717f;}})});}_0x4e4a11=_[_0xa5ad('0x4d')]({},_0x4e4a11,_0x1ad93a[_0xa5ad('0x50')]);var _0x245f84={'where':_0x4e4a11['where']};return db['FaxAccount'][_0xa5ad('0x2e')](_0x245f84)[_0xa5ad('0x34')](function(_0x39a2b2){_0x5c2ab1[_0xa5ad('0x2e')]=_0x39a2b2;if(_0x1ad93a[_0xa5ad('0x40')][_0xa5ad('0x51')]){_0x4e4a11[_0xa5ad('0x52')]=[{'all':!![]}];}return db['FaxAccount'][_0xa5ad('0x53')](_0x4e4a11);})[_0xa5ad('0x34')](function(_0x34f765){_0x5c2ab1[_0xa5ad('0x54')]=_0x34f765;return _0x5c2ab1;})[_0xa5ad('0x34')](respondWithFilteredResult(_0x50d2f4,_0x4e4a11))[_0xa5ad('0x27')](handleError(_0x50d2f4,null));};exports[_0xa5ad('0x55')]=function(_0x12d4b3,_0xa75840){var _0x54afed={'raw':![],'where':{'id':_0x12d4b3[_0xa5ad('0x56')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x342acd={};_0x342acd[_0xa5ad('0x43')]=_[_0xa5ad('0x57')](db[_0xa5ad('0x58')]['rawAttributes']);_0x342acd['query']=_[_0xa5ad('0x57')](_0x12d4b3[_0xa5ad('0x40')]);_0x342acd[_0xa5ad('0x41')]=_[_0xa5ad('0x42')](_0x342acd['model'],_0x342acd[_0xa5ad('0x40')]);_0x54afed['attributes']=_[_0xa5ad('0x42')](_0x342acd[_0xa5ad('0x43')],qs[_0xa5ad('0x45')](_0x12d4b3[_0xa5ad('0x40')][_0xa5ad('0x45')]));_0x54afed[_0xa5ad('0x44')]=_0x54afed[_0xa5ad('0x44')][_0xa5ad('0x46')]?_0x54afed[_0xa5ad('0x44')]:_0x342acd[_0xa5ad('0x43')];if(_0x12d4b3[_0xa5ad('0x40')][_0xa5ad('0x51')]){_0x54afed[_0xa5ad('0x52')]=[{'all':!![]}];}_0x54afed=_[_0xa5ad('0x4d')]({},_0x54afed,_0x12d4b3[_0xa5ad('0x50')]);return db[_0xa5ad('0x58')][_0xa5ad('0x59')](_0x54afed)[_0xa5ad('0x34')](handleEntityNotFound(_0xa75840,null))['then'](respondWithResult(_0xa75840,null))['catch'](handleError(_0xa75840,null));};exports['create']=function(_0x20e452,_0x42e8fe){return db[_0xa5ad('0x58')]['create'](_0x20e452[_0xa5ad('0x5a')],{})[_0xa5ad('0x34')](function(_0x578e1f){var _0x49acfb=_0x20e452[_0xa5ad('0x5b')][_0xa5ad('0x5c')]({'plain':!![]});if(!_0x49acfb)throw new Error(_0xa5ad('0x5d'));if(_0x49acfb['role']===_0xa5ad('0x5b')){var _0x198c9a=_0x578e1f[_0xa5ad('0x5c')]({'plain':!![]});var _0x54f4e7=_0xa5ad('0x35');return db[_0xa5ad('0x5e')][_0xa5ad('0x59')]({'where':{'name':_0x54f4e7,'userProfileId':_0x49acfb['userProfileId']},'raw':!![]})[_0xa5ad('0x34')](function(_0x56ddac){if(_0x56ddac&&_0x56ddac['autoAssociation']===0x0){return db['UserProfileResource'][_0xa5ad('0x5f')]({'name':_0x198c9a[_0xa5ad('0x39')],'resourceId':_0x198c9a['id'],'type':_0x56ddac[_0xa5ad('0x39')],'sectionId':_0x56ddac['id']},{})[_0xa5ad('0x34')](function(){return _0x578e1f;});}else{return _0x578e1f;}})[_0xa5ad('0x27')](function(_0x39ff71){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x39ff71);throw _0x39ff71;});}return _0x578e1f;})[_0xa5ad('0x34')](respondWithResult(_0x42e8fe,0xc9))['catch'](handleError(_0x42e8fe,null));};exports[_0xa5ad('0x32')]=function(_0x3853e6,_0x2a78c9){if(_0x3853e6[_0xa5ad('0x5a')]['id']){delete _0x3853e6[_0xa5ad('0x5a')]['id'];}return db[_0xa5ad('0x58')][_0xa5ad('0x59')]({'where':{'id':_0x3853e6[_0xa5ad('0x56')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0xa5ad('0x34')](handleEntityNotFound(_0x2a78c9,null))[_0xa5ad('0x34')](saveUpdates(_0x3853e6[_0xa5ad('0x5a')],null))[_0xa5ad('0x34')](respondWithResult(_0x2a78c9,null))[_0xa5ad('0x27')](handleError(_0x2a78c9,null));};exports[_0xa5ad('0x33')]=function(_0x541bf4,_0x680a92){return db[_0xa5ad('0x58')][_0xa5ad('0x59')]({'where':{'id':_0x541bf4[_0xa5ad('0x56')]['id']}})[_0xa5ad('0x34')](handleEntityNotFound(_0x680a92,null))[_0xa5ad('0x34')](removeEntity(_0x680a92,null))[_0xa5ad('0x27')](handleError(_0x680a92,null));};exports['describe']=function(_0x6f3807,_0x1d19ef){return db[_0xa5ad('0x58')][_0xa5ad('0x60')]()[_0xa5ad('0x34')](respondWithResult(_0x1d19ef,null))['catch'](handleError(_0x1d19ef,null));};exports[_0xa5ad('0x61')]=function(_0xe1fc1b,_0x10206a,_0x4f05cb){if(_0xe1fc1b[_0xa5ad('0x5a')]['id']){delete _0xe1fc1b['body']['id'];}return db[_0xa5ad('0x58')]['find']({'where':{'id':_0xe1fc1b[_0xa5ad('0x56')]['id']}})[_0xa5ad('0x34')](handleEntityNotFound(_0x10206a,null))[_0xa5ad('0x34')](function(_0x3b938f){if(_0x3b938f){_0xe1fc1b[_0xa5ad('0x5a')][_0xa5ad('0x62')]=_0x3b938f['id'];return db['Disposition'][_0xa5ad('0x5f')](_0xe1fc1b[_0xa5ad('0x5a')]);}})[_0xa5ad('0x34')](respondWithResult(_0x10206a,null))[_0xa5ad('0x27')](handleError(_0x10206a,null));};exports[_0xa5ad('0x63')]=function(_0x5c988c,_0x228553,_0x3b6136){var _0x5abc60={'raw':![],'where':{}};var _0x463b85={};var _0x308e81={'count':0x0,'rows':[]};return db[_0xa5ad('0x58')]['findOne']({'where':{'id':_0x5c988c['params']['id']}})['then'](handleEntityNotFound(_0x228553,null))[_0xa5ad('0x34')](function(_0x45cd28){if(_0x45cd28){_0x463b85[_0xa5ad('0x43')]=_[_0xa5ad('0x57')](db[_0xa5ad('0x64')]['rawAttributes']);_0x463b85['query']=_[_0xa5ad('0x57')](_0x5c988c[_0xa5ad('0x40')]);_0x463b85[_0xa5ad('0x41')]=_[_0xa5ad('0x42')](_0x463b85[_0xa5ad('0x43')],_0x463b85['query']);_0x5abc60[_0xa5ad('0x44')]=_['intersection'](_0x463b85[_0xa5ad('0x43')],qs[_0xa5ad('0x45')](_0x5c988c[_0xa5ad('0x40')]['fields']));_0x5abc60[_0xa5ad('0x44')]=_0x5abc60[_0xa5ad('0x44')][_0xa5ad('0x46')]?_0x5abc60['attributes']:_0x463b85[_0xa5ad('0x43')];if(!_0x5c988c[_0xa5ad('0x40')][_0xa5ad('0x47')](_0xa5ad('0x48'))){_0x5abc60[_0xa5ad('0x2d')]=qs[_0xa5ad('0x2d')](_0x5c988c['query'][_0xa5ad('0x2d')]);_0x5abc60[_0xa5ad('0x2b')]=qs[_0xa5ad('0x2b')](_0x5c988c[_0xa5ad('0x40')]['offset']);}_0x5abc60[_0xa5ad('0x65')]=qs[_0xa5ad('0x49')](_0x5c988c[_0xa5ad('0x40')]['sort']);_0x5abc60[_0xa5ad('0x4c')]=qs[_0xa5ad('0x41')](_[_0xa5ad('0x4a')](_0x5c988c['query'],_0x463b85[_0xa5ad('0x41')]));_0x5abc60[_0xa5ad('0x4c')][_0xa5ad('0x62')]=_0x45cd28['id'];if(_0x5c988c['query'][_0xa5ad('0x4b')]){_0x5abc60[_0xa5ad('0x4c')]=_[_0xa5ad('0x4d')](_0x5abc60[_0xa5ad('0x4c')],{'$or':_[_0xa5ad('0x3e')](_0x5abc60[_0xa5ad('0x44')],function(_0x2cc564){var _0x4f52b4={};_0x4f52b4[_0x2cc564]={'$like':'%'+_0x5c988c[_0xa5ad('0x40')][_0xa5ad('0x4b')]+'%'};return _0x4f52b4;})});}_0x5abc60=_[_0xa5ad('0x4d')]({},_0x5abc60,_0x5c988c[_0xa5ad('0x50')]);return db[_0xa5ad('0x64')][_0xa5ad('0x2e')]({'where':_0x5abc60['where']})[_0xa5ad('0x34')](function(_0x490e38){_0x308e81[_0xa5ad('0x2e')]=_0x490e38;if(_0x5c988c[_0xa5ad('0x40')][_0xa5ad('0x51')]){_0x5abc60[_0xa5ad('0x52')]=[{'all':!![]}];}return db[_0xa5ad('0x64')][_0xa5ad('0x53')](_0x5abc60);})[_0xa5ad('0x34')](function(_0x266cee){_0x308e81[_0xa5ad('0x54')]=_0x266cee;return _0x308e81;});}})['then'](respondWithFilteredResult(_0x228553,_0x5abc60))[_0xa5ad('0x27')](handleError(_0x228553,null));};exports[_0xa5ad('0x66')]=function(_0x270d30,_0x2096a7,_0x35f2){return db[_0xa5ad('0x58')][_0xa5ad('0x59')]({'where':{'id':_0x270d30[_0xa5ad('0x56')]['id']}})[_0xa5ad('0x34')](handleEntityNotFound(_0x2096a7,null))[_0xa5ad('0x34')](function(_0x48f294){if(_0x48f294){return _0x48f294[_0xa5ad('0x66')](_0x270d30[_0xa5ad('0x40')][_0xa5ad('0x67')]);}})[_0xa5ad('0x34')](respondWithStatusCode(_0x2096a7,null))[_0xa5ad('0x27')](handleError(_0x2096a7,null));};exports[_0xa5ad('0x68')]=function(_0x54a5dc,_0xf54b8e,_0x57a55d){if(_0x54a5dc[_0xa5ad('0x5a')]['id']){delete _0x54a5dc[_0xa5ad('0x5a')]['id'];}return db[_0xa5ad('0x58')][_0xa5ad('0x59')]({'where':{'id':_0x54a5dc[_0xa5ad('0x56')]['id']}})[_0xa5ad('0x34')](handleEntityNotFound(_0xf54b8e,null))[_0xa5ad('0x34')](function(_0x5230e5){if(_0x5230e5){_0x54a5dc[_0xa5ad('0x5a')][_0xa5ad('0x62')]=_0x5230e5['id'];return db[_0xa5ad('0x69')][_0xa5ad('0x5f')](_0x54a5dc[_0xa5ad('0x5a')]);}})[_0xa5ad('0x34')](respondWithResult(_0xf54b8e,null))[_0xa5ad('0x27')](handleError(_0xf54b8e,null));};exports[_0xa5ad('0x6a')]=function(_0x513d70,_0x2b3925,_0x396f53){var _0x4e35b9={'raw':![],'where':{}};var _0x453568={};var _0x27b056={'count':0x0,'rows':[]};return db[_0xa5ad('0x58')]['findOne']({'where':{'id':_0x513d70[_0xa5ad('0x56')]['id']}})[_0xa5ad('0x34')](handleEntityNotFound(_0x2b3925,null))[_0xa5ad('0x34')](function(_0x3ee116){if(_0x3ee116){_0x453568[_0xa5ad('0x43')]=_[_0xa5ad('0x57')](db['CannedAnswer']['rawAttributes']);_0x453568['query']=_[_0xa5ad('0x57')](_0x513d70['query']);_0x453568[_0xa5ad('0x41')]=_[_0xa5ad('0x42')](_0x453568[_0xa5ad('0x43')],_0x453568[_0xa5ad('0x40')]);_0x4e35b9[_0xa5ad('0x44')]=_[_0xa5ad('0x42')](_0x453568['model'],qs[_0xa5ad('0x45')](_0x513d70[_0xa5ad('0x40')][_0xa5ad('0x45')]));_0x4e35b9[_0xa5ad('0x44')]=_0x4e35b9[_0xa5ad('0x44')]['length']?_0x4e35b9[_0xa5ad('0x44')]:_0x453568[_0xa5ad('0x43')];if(!_0x513d70[_0xa5ad('0x40')][_0xa5ad('0x47')](_0xa5ad('0x48'))){_0x4e35b9['limit']=qs[_0xa5ad('0x2d')](_0x513d70[_0xa5ad('0x40')][_0xa5ad('0x2d')]);_0x4e35b9[_0xa5ad('0x2b')]=qs[_0xa5ad('0x2b')](_0x513d70[_0xa5ad('0x40')]['offset']);}_0x4e35b9[_0xa5ad('0x65')]=qs[_0xa5ad('0x49')](_0x513d70['query']['sort']);_0x4e35b9[_0xa5ad('0x4c')]=qs['filters'](_[_0xa5ad('0x4a')](_0x513d70[_0xa5ad('0x40')],_0x453568[_0xa5ad('0x41')]));_0x4e35b9['where'][_0xa5ad('0x62')]=_0x3ee116['id'];if(_0x513d70['query']['filter']){_0x4e35b9[_0xa5ad('0x4c')]=_[_0xa5ad('0x4d')](_0x4e35b9[_0xa5ad('0x4c')],{'$or':_[_0xa5ad('0x3e')](_0x4e35b9['attributes'],function(_0x21578d){var _0x33e7d3={};_0x33e7d3[_0x21578d]={'$like':'%'+_0x513d70[_0xa5ad('0x40')][_0xa5ad('0x4b')]+'%'};return _0x33e7d3;})});}_0x4e35b9=_['merge']({},_0x4e35b9,_0x513d70[_0xa5ad('0x50')]);return db[_0xa5ad('0x69')][_0xa5ad('0x2e')]({'where':_0x4e35b9[_0xa5ad('0x4c')]})[_0xa5ad('0x34')](function(_0x3cdced){_0x27b056[_0xa5ad('0x2e')]=_0x3cdced;if(_0x513d70[_0xa5ad('0x40')][_0xa5ad('0x51')]){_0x4e35b9[_0xa5ad('0x52')]=[{'all':!![]}];}return db[_0xa5ad('0x69')][_0xa5ad('0x53')](_0x4e35b9);})[_0xa5ad('0x34')](function(_0x1e09da){_0x27b056['rows']=_0x1e09da;return _0x27b056;});}})[_0xa5ad('0x34')](respondWithFilteredResult(_0x2b3925,_0x4e35b9))[_0xa5ad('0x27')](handleError(_0x2b3925,null));};exports[_0xa5ad('0x6b')]=function(_0x1feba6,_0x18cee1,_0x4b504a){return db[_0xa5ad('0x58')][_0xa5ad('0x59')]({'where':{'id':_0x1feba6[_0xa5ad('0x56')]['id']}})[_0xa5ad('0x34')](handleEntityNotFound(_0x18cee1,null))['then'](function(_0x1881d4){if(_0x1881d4){return _0x1881d4[_0xa5ad('0x6b')](_0x1feba6['query']['ids']);}})[_0xa5ad('0x34')](respondWithStatusCode(_0x18cee1,null))[_0xa5ad('0x27')](handleError(_0x18cee1,null));};exports[_0xa5ad('0x6c')]=function(_0x1e4067,_0x338644,_0xd34fa8){return db[_0xa5ad('0x6d')][_0xa5ad('0x59')]({'where':{'id':_0x1e4067[_0xa5ad('0x56')]['id']}})[_0xa5ad('0x34')](handleEntityNotFound(_0x338644,null))['then'](function(_0x4a2042){if(_0x4a2042){return _0x4a2042[_0xa5ad('0x6c')](_0x1e4067[_0xa5ad('0x5a')]['ids'],_[_0xa5ad('0x6e')](_0x1e4067[_0xa5ad('0x5a')],[_0xa5ad('0x67'),'id'])||{});}})['then'](respondWithResult(_0x338644,null))[_0xa5ad('0x27')](handleError(_0x338644,null));};exports[_0xa5ad('0x6f')]=function(_0x4b094b,_0x562aee,_0x4d5d30){var _0x464fe9={'raw':![],'where':{}};var _0x43134b={};var _0x119d7c={'count':0x0,'rows':[]};return db[_0xa5ad('0x58')][_0xa5ad('0x70')]({'where':{'id':_0x4b094b[_0xa5ad('0x56')]['id']}})[_0xa5ad('0x34')](handleEntityNotFound(_0x562aee,null))['then'](function(_0x4cf1a4){if(_0x4cf1a4){_0x43134b[_0xa5ad('0x43')]=_[_0xa5ad('0x57')](db[_0xa5ad('0x6d')]['rawAttributes']);_0x43134b[_0xa5ad('0x40')]=_['keys'](_0x4b094b[_0xa5ad('0x40')]);_0x43134b['filters']=_[_0xa5ad('0x42')](_0x43134b['model'],_0x43134b[_0xa5ad('0x40')]);_0x464fe9[_0xa5ad('0x44')]=_['intersection'](_0x43134b[_0xa5ad('0x43')],qs['fields'](_0x4b094b[_0xa5ad('0x40')][_0xa5ad('0x45')]));_0x464fe9[_0xa5ad('0x44')]=_0x464fe9[_0xa5ad('0x44')][_0xa5ad('0x46')]?_0x464fe9[_0xa5ad('0x44')]:_0x43134b['model'];if(!_0x4b094b['query']['hasOwnProperty'](_0xa5ad('0x48'))){_0x464fe9['limit']=qs[_0xa5ad('0x2d')](_0x4b094b[_0xa5ad('0x40')][_0xa5ad('0x2d')]);_0x464fe9['offset']=qs[_0xa5ad('0x2b')](_0x4b094b['query'][_0xa5ad('0x2b')]);}_0x464fe9['order']=qs[_0xa5ad('0x49')](_0x4b094b[_0xa5ad('0x40')][_0xa5ad('0x49')]);_0x464fe9[_0xa5ad('0x4c')]=qs[_0xa5ad('0x41')](_[_0xa5ad('0x4a')](_0x4b094b['query'],_0x43134b['filters']));_0x464fe9[_0xa5ad('0x4c')][_0xa5ad('0x62')]=_0x4cf1a4['id'];if(_0x4b094b[_0xa5ad('0x40')][_0xa5ad('0x4b')]){_0x464fe9[_0xa5ad('0x4c')]=_[_0xa5ad('0x4d')](_0x464fe9[_0xa5ad('0x4c')],{'$or':_[_0xa5ad('0x3e')](_0x464fe9[_0xa5ad('0x44')],function(_0x2d1aa4){var _0x3a5210={};_0x3a5210[_0x2d1aa4]={'$like':'%'+_0x4b094b[_0xa5ad('0x40')][_0xa5ad('0x4b')]+'%'};return _0x3a5210;})});}_0x464fe9=_[_0xa5ad('0x4d')]({},_0x464fe9,_0x4b094b[_0xa5ad('0x50')]);return db[_0xa5ad('0x6d')][_0xa5ad('0x2e')]({'where':_0x464fe9['where']})[_0xa5ad('0x34')](function(_0x6f721e){_0x119d7c['count']=_0x6f721e;if(_0x4b094b['query']['includeAll']){_0x464fe9[_0xa5ad('0x52')]=[{'model':db[_0xa5ad('0x71')],'as':_0xa5ad('0x72'),'required':![]},{'model':db[_0xa5ad('0x73')],'as':_0xa5ad('0x74'),'attributes':['name',_0xa5ad('0x75'),_0xa5ad('0x76')],'required':![]},{'model':db[_0xa5ad('0x77')],'as':'Tags','attributes':['id','name',_0xa5ad('0x78')],'where':_0x4b094b[_0xa5ad('0x40')][_0xa5ad('0x79')]?{'id':_0x4b094b['query']['tag']}:undefined,'required':_0x4b094b['query'][_0xa5ad('0x79')]?!![]:![]}];}return db[_0xa5ad('0x6d')][_0xa5ad('0x53')](_0x464fe9);})[_0xa5ad('0x34')](function(_0x4b2264){_0x119d7c[_0xa5ad('0x54')]=_0x4b2264;return _0x119d7c;});}})[_0xa5ad('0x34')](respondWithFilteredResult(_0x562aee,_0x464fe9))[_0xa5ad('0x27')](handleError(_0x562aee,null));};exports[_0xa5ad('0x7a')]=function(_0x1508b7,_0x1c33df){var _0x2172a1=_0x1508b7[_0xa5ad('0x56')]['id'];var _0x5125de=_0x1508b7[_0xa5ad('0x5a')];var _0x289f0f=0xc8;var _0x446428=null;return db['sequelize'][_0xa5ad('0x7b')]({'isolationLevel':db[_0xa5ad('0x7c')][_0xa5ad('0x7d')]['ISOLATION_LEVELS'][_0xa5ad('0x7e')]},function(_0x4b3a21){return db[_0xa5ad('0x58')]['findOne']({'where':{'id':_0x2172a1},'transaction':_0x4b3a21})[_0xa5ad('0x34')](function(_0x19b79a){if(_0x19b79a){return db['FaxApplication'][_0xa5ad('0x33')]({'where':{'FaxAccountId':_0x2172a1},'transaction':_0x4b3a21})['then'](function(){var _0x39e0f8=_[_0xa5ad('0x3e')](_0x5125de,function(_0xc9257){_0xc9257['FaxAccountId']=_0x2172a1;return _0xc9257;});return db[_0xa5ad('0x7f')][_0xa5ad('0x80')](_0x39e0f8,{'transaction':_0x4b3a21});});}else{_0x289f0f=0x194;_0x446428=[];}});})['then'](function(){if(_0x289f0f!==0x194){return db['FaxApplication'][_0xa5ad('0x81')]({'where':{'FaxAccountId':_0x2172a1},'order':_0xa5ad('0x82')})[_0xa5ad('0x34')](function(_0x18012c){_0x446428=_0x18012c;});}})[_0xa5ad('0x27')](function(_0x25401f){_0x289f0f=0x1f4;logger[_0xa5ad('0x22')](_0x25401f[_0xa5ad('0x38')]);if(_0x25401f[_0xa5ad('0x39')]){delete _0x25401f[_0xa5ad('0x39')];}_0x446428=_0x25401f;})[_0xa5ad('0x83')](function(){if(_0x446428===null){_0x1c33df['sendStatus'](_0x289f0f);}else{if(_0x289f0f===0x1f4){_0x1c33df[_0xa5ad('0x28')](_0x289f0f)[_0xa5ad('0x3a')](_0x446428);}else{_0x1c33df[_0xa5ad('0x28')](_0x289f0f)[_0xa5ad('0x2a')](_0x446428);}}});};exports['getApplications']=function(_0x56682d,_0x9971c8,_0x46b93b){var _0x17a186={};var _0x1c1ac8={};var _0x3ef49a;var _0x26a901;return db[_0xa5ad('0x58')][_0xa5ad('0x70')]({'where':{'id':_0x56682d[_0xa5ad('0x56')]['id']}})['then'](handleEntityNotFound(_0x9971c8,null))[_0xa5ad('0x34')](function(_0x5d441a){if(_0x5d441a){_0x3ef49a=_0x5d441a;_0x1c1ac8[_0xa5ad('0x43')]=_[_0xa5ad('0x57')](db[_0xa5ad('0x7f')]['rawAttributes']);_0x1c1ac8[_0xa5ad('0x40')]=_[_0xa5ad('0x57')](_0x56682d[_0xa5ad('0x40')]);_0x1c1ac8[_0xa5ad('0x41')]=_[_0xa5ad('0x42')](_0x1c1ac8[_0xa5ad('0x43')],_0x1c1ac8['query']);_0x17a186[_0xa5ad('0x44')]=_[_0xa5ad('0x42')](_0x1c1ac8[_0xa5ad('0x43')],qs['fields'](_0x56682d[_0xa5ad('0x40')][_0xa5ad('0x45')]));_0x17a186[_0xa5ad('0x44')]=_0x17a186[_0xa5ad('0x44')][_0xa5ad('0x46')]?_0x17a186['attributes']:_0x1c1ac8[_0xa5ad('0x43')];_0x17a186[_0xa5ad('0x65')]=qs[_0xa5ad('0x49')](_0x56682d[_0xa5ad('0x40')]['sort']);_0x17a186[_0xa5ad('0x4c')]=qs[_0xa5ad('0x41')](_[_0xa5ad('0x4a')](_0x56682d[_0xa5ad('0x40')],_0x1c1ac8[_0xa5ad('0x41')]));if(_0x56682d[_0xa5ad('0x40')][_0xa5ad('0x4b')]){_0x17a186[_0xa5ad('0x4c')]=_[_0xa5ad('0x4d')](_0x17a186[_0xa5ad('0x4c')],{'$or':_[_0xa5ad('0x3e')](_0x17a186['attributes'],function(_0x5314fa){var _0x2c2302={};_0x2c2302[_0x5314fa]={'$like':'%'+_0x56682d[_0xa5ad('0x40')][_0xa5ad('0x4b')]+'%'};return _0x2c2302;})});}_0x17a186=_[_0xa5ad('0x4d')]({},_0x17a186,_0x56682d[_0xa5ad('0x50')]);return _0x3ef49a[_0xa5ad('0x84')](_0x17a186);}})[_0xa5ad('0x34')](function(_0x55c30c){if(_0x55c30c){_0x26a901=_0x55c30c['length'];if(!_0x56682d[_0xa5ad('0x40')][_0xa5ad('0x47')](_0xa5ad('0x48'))){_0x17a186[_0xa5ad('0x2d')]=qs['limit'](_0x56682d[_0xa5ad('0x40')][_0xa5ad('0x2d')]);_0x17a186[_0xa5ad('0x2b')]=qs[_0xa5ad('0x2b')](_0x56682d[_0xa5ad('0x40')]['offset']);}return _0x3ef49a[_0xa5ad('0x84')](_0x17a186);}})['then'](function(_0x9bc93e){if(_0x9bc93e){return _0x9bc93e?{'count':_0x26a901,'rows':_0x9bc93e}:null;}})[_0xa5ad('0x34')](respondWithResult(_0x9971c8,null))['catch'](handleError(_0x9971c8,null));};function Extension(_0x5c4104,_0x291dca,_0x5cb542,_0x3da531){this['context']=_0xa5ad('0x85');this['exten']=_0x5c4104[_0xa5ad('0x86')];this[_0xa5ad('0x87')]=_0x3da531;this['type']='system';this[_0xa5ad('0x88')]=_0xa5ad('0x89');this[_0xa5ad('0x62')]=_0x5c4104['id'];this[_0xa5ad('0x82')]=_0x291dca;this[_0xa5ad('0x8a')]=_0x5cb542;}function createExtensionsReciveFax(_0x3fa805){var _0xff689=0x1;var _0x27adbf=[];_0x27adbf[_0xa5ad('0x8b')](new Extension(_0x3fa805,_0xff689,'','Answer'));_0xff689+=0x1;_0x27adbf['push'](new Extension(_0x3fa805,_0xff689,_0xa5ad('0x8c'),_0xa5ad('0x8d')));_0xff689+=0x1;for(var _0x57d0e5 in _0x3fa805){if(_0x3fa805['hasOwnProperty'](_0x57d0e5)&&(_0x57d0e5===_0xa5ad('0x8e')||_0x57d0e5===_0xa5ad('0x86')||_0x57d0e5==='gateway'||_0x57d0e5===_0xa5ad('0x8f')||_0x57d0e5===_0xa5ad('0x90')||_0x57d0e5==='maxrate'||_0x57d0e5==='minrate'||_0x57d0e5===_0xa5ad('0x91')||_0x57d0e5==='t38timeout')){_0x27adbf[_0xa5ad('0x8b')](new Extension(_0x3fa805,_0xff689,'FAXOPT('+_0x57d0e5+')='+_0x3fa805[_0x57d0e5],_0xa5ad('0x8d')));_0xff689+=0x1;}}_0x27adbf[_0xa5ad('0x8b')](new Extension(_0x3fa805,_0xff689,'6',_0xa5ad('0x92')));_0xff689+=0x1;_0x27adbf['push'](new Extension(_0x3fa805,_0xff689,_0xa5ad('0x93'),_0xa5ad('0x94')));_0xff689=0x0;return _0x27adbf;}exports[_0xa5ad('0x95')]=function(_0x59bbc7,_0x6d4bae,_0x3175ed){var _0x3a51a7;return db['sequelize'][_0xa5ad('0x7b')](function(_0x15efec){return db[_0xa5ad('0x58')]['create'](_0x59bbc7['body'],{'transaction':_0x15efec})[_0xa5ad('0x34')](function(_0x251e07){_0x3a51a7=_0x251e07['get']({'plain':!![]});return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_0x3a51a7),{'transaction':_0x15efec});});})['then'](function(){return _0x3a51a7;})['then'](respondWithResult(_0x6d4bae,null))[_0xa5ad('0x27')](handleError(_0x6d4bae,null));};exports[_0xa5ad('0x96')]=function(_0x2d6a30,_0x3e9a90,_0xcccb6d){var _0x5dfcfa;return db['sequelize'][_0xa5ad('0x7b')](function(_0x2e388e){return db[_0xa5ad('0x58')]['update'](_0x2d6a30[_0xa5ad('0x5a')],{'where':{'id':_0x2d6a30[_0xa5ad('0x5a')]['id']},'transaction':_0x2e388e})[_0xa5ad('0x34')](function(_0x555561){return db[_0xa5ad('0x97')][_0xa5ad('0x33')]({'where':{'FaxAccountId':_0x2d6a30['body']['id']},'transaction':_0x2e388e})[_0xa5ad('0x34')](function(_0xe930f6){return db[_0xa5ad('0x97')][_0xa5ad('0x80')](createExtensionsReciveFax(_[_0xa5ad('0x6e')](_0x2d6a30[_0xa5ad('0x5a')],['tech','key',_0xa5ad('0x98'),_0xa5ad('0x99'),_0xa5ad('0x9a'),'ListId'])),{'transaction':_0x2e388e});});});})[_0xa5ad('0x34')](function(){return db[_0xa5ad('0x58')][_0xa5ad('0x9b')](_0x2d6a30['body']['id']);})[_0xa5ad('0x34')](respondWithResult(_0x3e9a90,null))[_0xa5ad('0x27')](handleError(_0x3e9a90,null));};exports[_0xa5ad('0x9c')]=function(_0x4c8bae,_0x2ecdc3,_0x43298f){var _0x59a533={'raw':!![],'where':{}};var _0x13684b={};var _0xe3d89a={'count':0x0,'rows':[]};return db['FaxAccount'][_0xa5ad('0x70')]({'where':{'id':_0x4c8bae['params']['id']}})['then'](handleEntityNotFound(_0x2ecdc3,null))[_0xa5ad('0x34')](function(_0x522376){if(_0x522376){_0x13684b[_0xa5ad('0x43')]=_[_0xa5ad('0x57')](db[_0xa5ad('0x9d')][_0xa5ad('0x3f')]);_0x13684b[_0xa5ad('0x40')]=_[_0xa5ad('0x57')](_0x4c8bae[_0xa5ad('0x40')]);_0x13684b['filters']=_[_0xa5ad('0x42')](_0x13684b[_0xa5ad('0x43')],_0x13684b[_0xa5ad('0x40')]);_0x59a533[_0xa5ad('0x44')]=_[_0xa5ad('0x42')](_0x13684b[_0xa5ad('0x43')],qs[_0xa5ad('0x45')](_0x4c8bae['query'][_0xa5ad('0x45')]));_0x59a533[_0xa5ad('0x44')]=_0x59a533[_0xa5ad('0x44')][_0xa5ad('0x46')]?_0x59a533['attributes']:_0x13684b[_0xa5ad('0x43')];if(!_0x4c8bae[_0xa5ad('0x40')][_0xa5ad('0x47')](_0xa5ad('0x48'))){_0x59a533['limit']=qs[_0xa5ad('0x2d')](_0x4c8bae[_0xa5ad('0x40')][_0xa5ad('0x2d')]);_0x59a533[_0xa5ad('0x2b')]=qs[_0xa5ad('0x2b')](_0x4c8bae[_0xa5ad('0x40')][_0xa5ad('0x2b')]);}_0x59a533[_0xa5ad('0x65')]=qs[_0xa5ad('0x49')](_0x4c8bae[_0xa5ad('0x40')][_0xa5ad('0x49')]);_0x59a533[_0xa5ad('0x4c')]=qs['filters'](_['pick'](_0x4c8bae[_0xa5ad('0x40')],_0x13684b[_0xa5ad('0x41')]));_0x59a533[_0xa5ad('0x4c')][_0xa5ad('0x62')]=_0x522376['id'];if(_0x4c8bae['query'][_0xa5ad('0x4b')]){_0x59a533[_0xa5ad('0x4c')]=_['merge'](_0x59a533[_0xa5ad('0x4c')],{'$or':_[_0xa5ad('0x3e')](_0x59a533[_0xa5ad('0x44')],function(_0x385ba3){var _0x7aeb4c={};_0x7aeb4c[_0x385ba3]={'$like':'%'+_0x4c8bae[_0xa5ad('0x40')][_0xa5ad('0x4b')]+'%'};return _0x7aeb4c;})});}if(_0x4c8bae[_0xa5ad('0x40')][_0xa5ad('0x9e')]){var _0x52d62d=_0x4c8bae[_0xa5ad('0x40')]['$gte'][_0xa5ad('0x9f')](',');var _0x4ba981={};_0x4ba981[_0x52d62d[0x0]]={'$gte':moment(_0x52d62d[0x1])[_0xa5ad('0xa0')](_0xa5ad('0xa1'))};_0x59a533['where']=_[_0xa5ad('0x4d')](_0x59a533['where'],_0x4ba981);}_0x59a533=_[_0xa5ad('0x4d')]({},_0x59a533,_0x4c8bae['options']);return db[_0xa5ad('0x9d')]['count']({'where':_0x59a533[_0xa5ad('0x4c')]})[_0xa5ad('0x34')](function(_0x41d153){_0xe3d89a[_0xa5ad('0x2e')]=_0x41d153;if(_0x4c8bae[_0xa5ad('0x40')][_0xa5ad('0x51')]){_0x59a533[_0xa5ad('0x52')]=[{'all':!![]}];}return db['FaxMessage'][_0xa5ad('0x53')](_0x59a533);})[_0xa5ad('0x34')](function(_0x477b3f){_0xe3d89a[_0xa5ad('0x54')]=_0x477b3f;return _0xe3d89a;});}})[_0xa5ad('0x34')](respondWithFilteredResult(_0x2ecdc3,_0x59a533))[_0xa5ad('0x27')](handleError(_0x2ecdc3,null));};exports['send']=function(_0x5dd995,_0x22bc0b,_0x38b032){var _0x332ce9,_0x295717={},_0x122b9e;if(_0x5dd995[_0xa5ad('0x5a')]['to']){_0x122b9e=_0x5dd995[_0xa5ad('0x5a')]['to'][0x0];}return db[_0xa5ad('0x58')][_0xa5ad('0x59')]({'where':{'id':_0x5dd995[_0xa5ad('0x56')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xa5ad('0x71')],'as':_0xa5ad('0xa2'),'where':{'fax':_0x122b9e},'limit':0x1,'order':[[_0xa5ad('0x99'),_0xa5ad('0xa3')]]}]}]})['then'](handleEntityNotFound(_0x22bc0b,null))[_0xa5ad('0x34')](function(_0x19f3c2){_0x332ce9=_0x19f3c2;if(_0x5dd995[_0xa5ad('0x5a')][_0xa5ad('0xa4')]&&_0x5dd995[_0xa5ad('0x5a')][_0xa5ad('0xa4')][_0xa5ad('0x46')]){for(var _0x456524=0x0;_0x456524<_0x5dd995[_0xa5ad('0x5a')]['attachments'][_0xa5ad('0x46')];_0x456524+=0x1){_0x5dd995[_0xa5ad('0x5a')][_0xa5ad('0xa4')][_0x456524]={'filename':_0x5dd995[_0xa5ad('0x5a')]['attachments'][_0x456524][_0xa5ad('0x39')],'id':_0x5dd995[_0xa5ad('0x5a')][_0xa5ad('0xa4')][_0x456524]['id'],'path':path[_0xa5ad('0xa5')](config['root'],'server/files/attachments',_0x5dd995[_0xa5ad('0x5a')]['attachments'][_0x456524][_0xa5ad('0xa6')])};}}return respondWithRpcPromise(_0xa5ad('0xa7'),'CheckAfterSend',{'FaxAccountId':_[_0xa5ad('0xa8')](_0x5dd995[_0xa5ad('0x56')]['id'])?undefined:_0x5dd995[_0xa5ad('0x56')]['id'],'path':_[_0xa5ad('0xa8')](_0x5dd995['body']['attachments'][0x0][_0xa5ad('0x7')])?undefined:_0x5dd995[_0xa5ad('0x5a')][_0xa5ad('0xa4')][0x0]['path'],'fax':_['isNil'](_0x5dd995[_0xa5ad('0x5a')]['to'][0x0])?undefined:_0x5dd995[_0xa5ad('0x5a')]['to'][0x0]},client9002);})[_0xa5ad('0x34')](function(){if(_0x332ce9){if(_[_0xa5ad('0xa8')](_0x5dd995[_0xa5ad('0x5a')][_0xa5ad('0xa9')])){_0x5dd995[_0xa5ad('0x5a')]['from']=util['format'](_0xa5ad('0xaa'),_0x332ce9['name'],_0x332ce9[_0xa5ad('0xab')]);}if(_0x332ce9[_0xa5ad('0xac')]){if(_0x332ce9[_0xa5ad('0xac')][_0xa5ad('0xa2')][_0xa5ad('0x46')]){return _0x332ce9[_0xa5ad('0xac')][_0xa5ad('0xa2')][0x0];}else{return db[_0xa5ad('0x71')][_0xa5ad('0x5f')](_[_0xa5ad('0x18')](_0x5dd995[_0xa5ad('0x5a')],{'firstName':_0x5dd995[_0xa5ad('0x5a')]['to'][0x0],'phone':_0x5dd995[_0xa5ad('0x5a')]['to'][0x0],'fax':_0x5dd995[_0xa5ad('0x5a')]['to'][0x0],'ListId':_0x332ce9['ListId']}));}}else{throw new Error(_0xa5ad('0xad'));}}else{throw new Error(_0xa5ad('0xae'));}})[_0xa5ad('0x34')](function(_0x14d94c){if(_0x14d94c){return db[_0xa5ad('0x6d')][_0xa5ad('0x59')]({'where':{'ContactId':_0x14d94c['id'],'closed':![],'FaxAccountId':_0x332ce9['id']}})[_0xa5ad('0x34')](function(_0x3fc3c7){if(_0x3fc3c7){return[_0x3fc3c7,![]];}return db[_0xa5ad('0x6d')][_0xa5ad('0x5f')]({'UserId':_0x5dd995[_0xa5ad('0x5b')]['id'],'ContactId':_0x14d94c['id'],'FaxAccountId':_0x332ce9['id'],'fax':_0x5dd995['body']['to'][0x0],'firstMsgDirection':_0xa5ad('0xaf'),'Messages':[_[_0xa5ad('0x4d')](_0x5dd995[_0xa5ad('0x5a')],{'read':![],'body':_0x5dd995[_0xa5ad('0x5a')][_0xa5ad('0xa4')][0x0][_0xa5ad('0xb0')],'FaxAccountId':_0x332ce9['id'],'UserId':_0x5dd995[_0xa5ad('0x5b')]['id'],'ContactId':_0x14d94c['id'],'AttachmentId':_0x5dd995['body']['attachments'][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0xa5ad('0xb1')}]})['then'](function(_0x36ba7f){return[_0x36ba7f,!![]];});});}else{throw new Error(_0xa5ad('0xb2'));}})['spread'](function(_0x38288c,_0x224def){if(_0x224def){return _0x38288c;}return db[_0xa5ad('0x9d')]['create']({'direction':_0xa5ad('0xaf'),'read':![],'body':_0x5dd995['body'][_0xa5ad('0xa4')][0x0][_0xa5ad('0xb0')],'FaxAccountId':_0x332ce9['id'],'FaxInteractionId':_0x38288c['id'],'UserId':_0x5dd995[_0xa5ad('0x5b')]['id'],'ContactId':_0x38288c['ContactId'],'AttachmentId':_0x5dd995[_0xa5ad('0x5a')]['attachments'][0x0]['id']})['then'](function(_0x141e7e){_0x38288c[_0xa5ad('0xb3')][_0xa5ad('0xb1')]=[];_0x38288c[_0xa5ad('0xb3')][_0xa5ad('0xb1')]['push'](_0x141e7e['dataValues']);return _0x38288c;});})[_0xa5ad('0x34')](function(_0x36bbe4){respondWithRpcPromise(_0xa5ad('0xb4'),'SendFax',{'FaxAccountId':_['isNil'](_0x5dd995[_0xa5ad('0x56')]['id'])?undefined:_0x5dd995['params']['id'],'path':_[_0xa5ad('0xa8')](_0x5dd995['body'][_0xa5ad('0xa4')][0x0][_0xa5ad('0x7')])?undefined:_0x5dd995[_0xa5ad('0x5a')][_0xa5ad('0xa4')][0x0]['path'],'fax':_[_0xa5ad('0xa8')](_0x5dd995[_0xa5ad('0x5a')]['to'][0x0])?undefined:_0x5dd995[_0xa5ad('0x5a')]['to'][0x0],'AttachmentId':_0x5dd995['body'][_0xa5ad('0xa4')][0x0]['id']},client9002)[_0xa5ad('0x34')](function(_0x3620f2){logger[_0xa5ad('0x25')](_0xa5ad('0xb5'),_0x3620f2);})[_0xa5ad('0x27')](function(_0x367e72){logger[_0xa5ad('0x25')]('SendFaxRpc,\x20%s',_0x367e72);});return _0x36bbe4;})[_0xa5ad('0x34')](respondWithResult(_0x22bc0b,null))['catch'](handleError(_0x22bc0b,null));};exports[_0xa5ad('0xb6')]=function(_0x2bbf54,_0x3dac11,_0x13ba6d){return db[_0xa5ad('0x58')]['find']({'where':{'id':_0x2bbf54[_0xa5ad('0x56')]['id']}})[_0xa5ad('0x34')](handleEntityNotFound(_0x3dac11,null))[_0xa5ad('0x34')](function(_0x46e44b){if(_0x46e44b){return _0x46e44b[_0xa5ad('0xb6')](_0x2bbf54[_0xa5ad('0x5a')][_0xa5ad('0x67')],_[_0xa5ad('0x6e')](_0x2bbf54[_0xa5ad('0x5a')],['ids','id'])||{})[_0xa5ad('0xb7')](function(_0x279acb){for(var _0x317b4b=0x0;_0x317b4b<_0x2bbf54[_0xa5ad('0x5a')][_0xa5ad('0x67')][_0xa5ad('0x46')];_0x317b4b+=0x1){socket['emit'](_0xa5ad('0xb8'),{'UserId':Number(_0x2bbf54[_0xa5ad('0x5a')][_0xa5ad('0x67')][_0x317b4b]),'FaxAccountId':Number(_0x2bbf54['params']['id'])});}return _0x279acb;});}})[_0xa5ad('0x34')](respondWithResult(_0x3dac11,null))[_0xa5ad('0x27')](handleError(_0x3dac11,null));};exports[_0xa5ad('0xb9')]=function(_0x40ef12,_0x1a8015,_0x3fe377){return db[_0xa5ad('0x58')]['find']({'where':{'id':_0x40ef12[_0xa5ad('0x56')]['id']}})[_0xa5ad('0x34')](handleEntityNotFound(_0x1a8015,null))[_0xa5ad('0x34')](function(_0xd351d3){if(_0xd351d3){return _0xd351d3[_0xa5ad('0xb9')](_0x40ef12[_0xa5ad('0x40')]['ids'])[_0xa5ad('0x34')](function(){if(_[_0xa5ad('0xba')](_0x40ef12[_0xa5ad('0x40')][_0xa5ad('0x67')])){for(var _0x4aedc6=0x0;_0x4aedc6<_0x40ef12['query'][_0xa5ad('0x67')][_0xa5ad('0x46')];_0x4aedc6+=0x1){socket['emit'](_0xa5ad('0xbb'),{'UserId':Number(_0x40ef12[_0xa5ad('0x40')][_0xa5ad('0x67')][_0x4aedc6]),'FaxAccountId':Number(_0x40ef12['params']['id'])});}}else{socket[_0xa5ad('0xbc')](_0xa5ad('0xbb'),{'UserId':Number(_0x40ef12[_0xa5ad('0x40')]['ids']),'FaxAccountId':Number(_0x40ef12['params']['id'])});}});}})[_0xa5ad('0x34')](respondWithStatusCode(_0x1a8015,null))['catch'](handleError(_0x1a8015,null));};exports['getAgents']=function(_0xe309f9,_0x50b77e,_0x12e138){var _0x55268b={};var _0x56881a={};var _0x269233;var _0x265715;return db['FaxAccount'][_0xa5ad('0x70')]({'where':{'id':_0xe309f9[_0xa5ad('0x56')]['id']}})['then'](handleEntityNotFound(_0x50b77e,null))['then'](function(_0x1d4bea){if(_0x1d4bea){_0x269233=_0x1d4bea;_0x56881a[_0xa5ad('0x43')]=_[_0xa5ad('0x57')](db[_0xa5ad('0x73')][_0xa5ad('0x3f')]);_0x56881a[_0xa5ad('0x40')]=_[_0xa5ad('0x57')](_0xe309f9['query']);_0x56881a['filters']=_['intersection'](_0x56881a[_0xa5ad('0x43')],_0x56881a[_0xa5ad('0x40')]);_0x55268b[_0xa5ad('0x44')]=_[_0xa5ad('0x42')](_0x56881a[_0xa5ad('0x43')],qs['fields'](_0xe309f9[_0xa5ad('0x40')][_0xa5ad('0x45')]));_0x55268b[_0xa5ad('0x44')]=_0x55268b['attributes']['length']?_0x55268b['attributes']:_0x56881a[_0xa5ad('0x43')];_0x55268b[_0xa5ad('0x65')]=qs[_0xa5ad('0x49')](_0xe309f9[_0xa5ad('0x40')][_0xa5ad('0x49')]);_0x55268b[_0xa5ad('0x4c')]=qs[_0xa5ad('0x41')](_[_0xa5ad('0x4a')](_0xe309f9['query'],_0x56881a[_0xa5ad('0x41')]));if(_0xe309f9[_0xa5ad('0x40')][_0xa5ad('0x4b')]){_0x55268b[_0xa5ad('0x4c')]=_[_0xa5ad('0x4d')](_0x55268b[_0xa5ad('0x4c')],{'$or':_[_0xa5ad('0x3e')](_0x55268b[_0xa5ad('0x44')],function(_0x410282){var _0x323d61={};_0x323d61[_0x410282]={'$like':'%'+_0xe309f9[_0xa5ad('0x40')]['filter']+'%'};return _0x323d61;})});}_0x55268b=_['merge']({},_0x55268b,_0xe309f9[_0xa5ad('0x50')]);return _0x269233[_0xa5ad('0xbd')](_0x55268b);}})['then'](function(_0x1416c2){if(_0x1416c2){_0x265715=_0x1416c2[_0xa5ad('0x46')];if(!_0xe309f9['query']['hasOwnProperty'](_0xa5ad('0x48'))){_0x55268b['limit']=qs[_0xa5ad('0x2d')](_0xe309f9['query'][_0xa5ad('0x2d')]);_0x55268b['offset']=qs[_0xa5ad('0x2b')](_0xe309f9[_0xa5ad('0x40')][_0xa5ad('0x2b')]);}return _0x269233[_0xa5ad('0xbd')](_0x55268b);}})[_0xa5ad('0x34')](function(_0x4e4cbb){if(_0x4e4cbb){return _0x4e4cbb?{'count':_0x265715,'rows':_0x4e4cbb}:null;}})[_0xa5ad('0x34')](respondWithResult(_0x50b77e,null))['catch'](handleError(_0x50b77e,null));};
\ No newline at end of file
index 7d170b2..2f5b3c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1071=['events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x521ac3,_0x4fd93c){var _0x2392d7=function(_0x46e225){while(--_0x46e225){_0x521ac3['push'](_0x521ac3['shift']());}};_0x2392d7(++_0x4fd93c);}(_0x1071,0xb0));var _0x1107=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x1071[_0x3947c9];return _0x2e7871;};'use strict';var EventEmitter=require(_0x1107('0x0'));var FaxAccount=require(_0x1107('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x1107('0x2')](0x0);var events={'afterCreate':_0x1107('0x3'),'afterUpdate':'update','afterDestroy':_0x1107('0x4')};function emitEvent(_0x4f1d2f){return function(_0x4557da,_0x53078c,_0x41fdcc){FaxAccountEvents[_0x1107('0x5')](_0x4f1d2f+':'+_0x4557da['id'],_0x4557da);FaxAccountEvents['emit'](_0x4f1d2f,_0x4557da);_0x41fdcc(null);};}for(var e in events){if(events[_0x1107('0x6')](e)){var event=events[e];FaxAccount[_0x1107('0x7')](e,emitEvent(event));}}module['exports']=FaxAccountEvents;
\ No newline at end of file
+var _0x8aaa=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','FaxAccount','setMaxListeners','save','update'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x8aaa,0x19f));var _0xa8aa=function(_0x456a84,_0x46bc0b){_0x456a84=_0x456a84-0x0;var _0x1117d6=_0x8aaa[_0x456a84];return _0x1117d6;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0xa8aa('0x0'))['db'][_0xa8aa('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xa8aa('0x2')](0x0);var events={'afterCreate':_0xa8aa('0x3'),'afterUpdate':_0xa8aa('0x4'),'afterDestroy':_0xa8aa('0x5')};function emitEvent(_0x48be6b){return function(_0x52fd67,_0x410114,_0x2cffaa){FaxAccountEvents[_0xa8aa('0x6')](_0x48be6b+':'+_0x52fd67['id'],_0x52fd67);FaxAccountEvents[_0xa8aa('0x6')](_0x48be6b,_0x52fd67);_0x2cffaa(null);};}for(var e in events){if(events[_0xa8aa('0x7')](e)){var event=events[e];FaxAccount[_0xa8aa('0x8')](e,emitEvent(event));}}module[_0xa8aa('0x9')]=FaxAccountEvents;
\ No newline at end of file
index e826191..37f8279 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa306=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts'];(function(_0x4e5ede,_0x2bc3b9){var _0x1b8eff=function(_0x3e3c5a){while(--_0x3e3c5a){_0x4e5ede['push'](_0x4e5ede['shift']());}};_0x1b8eff(++_0x2bc3b9);}(_0xa306,0xf2));var _0x6a30=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xa306[_0x32f7d7];return _0x133d09;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6a30('0x0'))(_0x6a30('0x1'));var moment=require(_0x6a30('0x2'));var BPromise=require(_0x6a30('0x3'));var rp=require(_0x6a30('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6a30('0x5'));var attributes=require(_0x6a30('0x6'));module[_0x6a30('0x7')]=function(_0x29ded5,_0x31975e){return _0x29ded5[_0x6a30('0x8')](_0x6a30('0x9'),attributes,{'tableName':_0x6a30('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2129=['../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x2129,0xe3));var _0x9212=function(_0x94cf58,_0x2bc514){_0x94cf58=_0x94cf58-0x0;var _0x396f79=_0x2129[_0x94cf58];return _0x396f79;};'use strict';var _=require(_0x9212('0x0'));var util=require(_0x9212('0x1'));var logger=require('../../config/logger')(_0x9212('0x2'));var moment=require(_0x9212('0x3'));var BPromise=require(_0x9212('0x4'));var rp=require(_0x9212('0x5'));var fs=require('fs');var path=require(_0x9212('0x6'));var rimraf=require('rimraf');var config=require(_0x9212('0x7'));var attributes=require(_0x9212('0x8'));module[_0x9212('0x9')]=function(_0x41f6ea,_0x3122f5){return _0x41f6ea[_0x9212('0xa')](_0x9212('0xb'),attributes,{'tableName':_0x9212('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 97e5cf9..3c09ef5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x62ff=['GetFaxAccount','findAll','raw','options','attributes','map','include','model','NotifyFaxAccount','body','fax','CmContact','describe','then','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','isNil','from','Sequelize','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','FaxAccount','account','CmList','List','list','applications','orderBy','priority','Applications','Contacts','length','create','contact','find','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','close','*,*,*,*','created','interaction','ContactId','AttachmentId','UserId','User','unshift','name','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','request','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch'];(function(_0x261aad,_0x4bc661){var _0x3b2266=function(_0x44a08f){while(--_0x44a08f){_0x261aad['push'](_0x261aad['shift']());}};_0x3b2266(++_0x4bc661);}(_0x62ff,0x136));var _0xf62f=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x62ff[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0xf62f('0x0'));var util=require('util');var moment=require(_0xf62f('0x1'));var BPromise=require(_0xf62f('0x2'));var rs=require(_0xf62f('0x3'));var fs=require('fs');var Redis=require(_0xf62f('0x4'));var db=require(_0xf62f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf62f('0x6'))(_0xf62f('0x7'));var config=require('../../config/environment');var jayson=require(_0xf62f('0x8'));var client=jayson[_0xf62f('0x9')][_0xf62f('0xa')]({'port':0x232c});config['redis']=_[_0xf62f('0xb')](config[_0xf62f('0xc')],{'host':_0xf62f('0xd'),'port':0x18eb});var socket=require(_0xf62f('0xe'))(new Redis(config[_0xf62f('0xc')]));require(_0xf62f('0xf'))['register'](socket);function respondWithRpcPromise(_0x985025,_0x223598,_0x25fe49){return new BPromise(function(_0x130d87,_0x14cd34){return client[_0xf62f('0x10')](_0x985025,_0x25fe49)['then'](function(_0x2e7bc5){logger['info'](_0xf62f('0x11'),_0x223598,_0xf62f('0x12'));logger[_0xf62f('0x13')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x223598,_0xf62f('0x12'),JSON[_0xf62f('0x14')](_0x2e7bc5));if(_0x2e7bc5[_0xf62f('0x15')]){if(_0x2e7bc5[_0xf62f('0x15')][_0xf62f('0x16')]===0x1f4){logger[_0xf62f('0x15')](_0xf62f('0x11'),_0x223598,_0x2e7bc5[_0xf62f('0x15')][_0xf62f('0x17')]);return _0x14cd34(_0x2e7bc5[_0xf62f('0x15')][_0xf62f('0x17')]);}logger[_0xf62f('0x15')](_0xf62f('0x11'),_0x223598,_0x2e7bc5[_0xf62f('0x15')][_0xf62f('0x17')]);return _0x130d87(_0x2e7bc5[_0xf62f('0x15')][_0xf62f('0x17')]);}else{logger[_0xf62f('0x18')]('FaxAccount,\x20%s,\x20%s',_0x223598,'request\x20sent');_0x130d87(_0x2e7bc5['result'][_0xf62f('0x17')]);}})[_0xf62f('0x19')](function(_0x3cf982){logger[_0xf62f('0x15')](_0xf62f('0x11'),_0x223598,_0x3cf982);_0x14cd34(_0x3cf982);});});}exports[_0xf62f('0x1a')]=function(_0x167d66){var _0x29a6cc=this;return new Promise(function(_0x10e9aa,_0x53b0ec){return db['FaxAccount'][_0xf62f('0x1b')]({'raw':_0x167d66['options']?_0x167d66['options'][_0xf62f('0x1c')]===undefined?!![]:![]:!![],'where':_0x167d66['options']?_0x167d66['options']['where']||null:null,'attributes':_0x167d66[_0xf62f('0x1d')]?_0x167d66[_0xf62f('0x1d')][_0xf62f('0x1e')]||null:null,'limit':_0x167d66[_0xf62f('0x1d')]?_0x167d66['options']['limit']||null:null,'include':_0x167d66[_0xf62f('0x1d')]?_0x167d66[_0xf62f('0x1d')]['include']?_[_0xf62f('0x1f')](_0x167d66[_0xf62f('0x1d')][_0xf62f('0x20')],function(_0x1181ff){return{'model':db[_0x1181ff[_0xf62f('0x21')]],'as':_0x1181ff['as'],'attributes':_0x1181ff[_0xf62f('0x1e')],'include':_0x1181ff['include']?_[_0xf62f('0x1f')](_0x1181ff[_0xf62f('0x20')],function(_0x2d2e5a){return{'model':db[_0x2d2e5a[_0xf62f('0x21')]],'as':_0x2d2e5a['as'],'attributes':_0x2d2e5a[_0xf62f('0x1e')],'include':_0x2d2e5a[_0xf62f('0x20')]?_['map'](_0x2d2e5a[_0xf62f('0x20')],function(_0x2e4ecf){return{'model':db[_0x2e4ecf['model']],'as':_0x2e4ecf['as'],'attributes':_0x2e4ecf[_0xf62f('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5c2c91){logger[_0xf62f('0x18')](_0xf62f('0x1a'),_0x167d66);logger[_0xf62f('0x13')](_0xf62f('0x1a'),_0x167d66,JSON[_0xf62f('0x14')](_0x5c2c91));_0x10e9aa(_0x5c2c91);})['catch'](function(_0x5e36a8){logger[_0xf62f('0x15')](_0xf62f('0x1a'),_0x5e36a8[_0xf62f('0x17')],_0x167d66);_0x53b0ec(_0x29a6cc[_0xf62f('0x15')](0x1f4,_0x5e36a8[_0xf62f('0x17')]));});});};exports[_0xf62f('0x22')]=function(_0x5e8b14,_0x2efa68,_0x400fa7){var _0x80836f=this;return new Promise(function(_0x397c42,_0x25ebe6){var _0x178bbf={'body':_0x5e8b14[_0xf62f('0x23')],'channel':_0xf62f('0x24')};var _0xd43fde=[];var _0x41d756=[];var _0x453034={};return db[_0xf62f('0x25')][_0xf62f('0x26')]()[_0xf62f('0x27')](function(_0x5c1644){if(!_0x5c1644){throw new db['Sequelize']['ValidationError'](_0xf62f('0x28'));}_0xd43fde=_[_0xf62f('0x29')](_['keys'](_0x5c1644),[_0xf62f('0x2a'),_0xf62f('0x2b')]);_0x41d756=_[_0xf62f('0x29')](_['keys'](_0x5c1644),[_0xf62f('0x2a'),_0xf62f('0x2b'),'CompanyId',_0xf62f('0x2c')]);if(_0x5e8b14[_0xf62f('0x23')]['id']){delete _0x5e8b14[_0xf62f('0x23')]['id'];}if(_[_0xf62f('0x2d')](_0x5e8b14['body'][_0xf62f('0x2e')])){throw new db[(_0xf62f('0x2f'))][(_0xf62f('0x30'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x5e8b14['body'][_0xf62f('0x23')])||_0x5e8b14[_0xf62f('0x23')][_0xf62f('0x23')]===''){throw new db['Sequelize'][(_0xf62f('0x30'))](_0xf62f('0x31'));}if(_[_0xf62f('0x2d')](_0x5e8b14[_0xf62f('0x23')][_0xf62f('0x32')])){throw new db[(_0xf62f('0x2f'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x41d756);}if(!_[_0xf62f('0x33')](_0x41d756,_0x5e8b14[_0xf62f('0x23')][_0xf62f('0x32')])){throw new db[(_0xf62f('0x2f'))]['ValidationError'](_0xf62f('0x34')+_0x41d756);}_0x453034[_0x5e8b14[_0xf62f('0x23')][_0xf62f('0x32')]]=_0x5e8b14[_0xf62f('0x23')]['from'];})['then'](function(){return db[_0xf62f('0x35')]['find']({'where':{'id':_0x5e8b14[_0xf62f('0x36')]['id']},'include':[{'model':db[_0xf62f('0x37')],'as':'List','include':[{'model':db[_0xf62f('0x25')],'as':'Contacts','where':_0x453034,'limit':0x1,'order':[[_0xf62f('0x2b'),'DESC']]}]},{'model':db['FaxApplication'],'as':'Applications'}]});})[_0xf62f('0x27')](function(_0x526190){if(_0x526190&&_0x526190[_0xf62f('0x38')]){var _0x142f3b=_0x526190['get']({'plain':!![]});_0x178bbf[_0xf62f('0x36')]=_0x142f3b;_0x178bbf['applications']=_0x142f3b['Applications'];_0x178bbf[_0xf62f('0x39')]=_0x142f3b[_0xf62f('0x38')];_0x178bbf[_0xf62f('0x3a')]=_[_0xf62f('0x3b')](_0x178bbf[_0xf62f('0x3a')],[_0xf62f('0x3c')],['asc']);if(_0x178bbf[_0xf62f('0x36')][_0xf62f('0x3d')]){delete _0x178bbf[_0xf62f('0x36')][_0xf62f('0x3d')];}if(_0x178bbf[_0xf62f('0x36')][_0xf62f('0x38')]&&_0x178bbf[_0xf62f('0x36')][_0xf62f('0x38')][_0xf62f('0x3e')][_0xf62f('0x3f')]){return _0x178bbf[_0xf62f('0x36')][_0xf62f('0x38')][_0xf62f('0x3e')][0x0];}var _0x4e5d72=_['defaults'](_0x5e8b14[_0xf62f('0x23')],{'firstName':_0x5e8b14[_0xf62f('0x23')][_0xf62f('0x2e')],'ListId':_0x142f3b['ListId']});_0x4e5d72[_0x5e8b14[_0xf62f('0x23')][_0xf62f('0x32')]]=_0x5e8b14[_0xf62f('0x23')][_0xf62f('0x2e')];return db['CmContact'][_0xf62f('0x40')](_0x4e5d72,{'fields':_0xd43fde,'raw':!![]});}})[_0xf62f('0x27')](function(_0x23f2bd){_0x178bbf[_0xf62f('0x41')]=_0x23f2bd;if(_0x23f2bd){var _0x36bd4f={'ContactId':_0x23f2bd['id'],'FaxAccountId':_0x5e8b14[_0xf62f('0x36')]['id'],'fax':_0x23f2bd['fax']};return db['FaxInteraction'][_0xf62f('0x42')]({'where':{'ContactId':_0x23f2bd['id'],'closed':![],'FaxAccountId':_0x5e8b14['account']['id']}})[_0xf62f('0x27')](function(_0x12cd4f){if(_0x12cd4f){return[_0x12cd4f,![]];}return db[_0xf62f('0x43')][_0xf62f('0x40')](_0x36bd4f)['then'](function(_0x46e818){return[_0x46e818,!![]];});});}else{throw new Error(_0xf62f('0x44'));}})[_0xf62f('0x45')](function(_0xa7aa14,_0x23fb66){var _0x261a5d=_0xa7aa14['get']({'plain':!![]});if(_0x23fb66){if(_0x178bbf[_0xf62f('0x36')][_0xf62f('0x46')]){_0x178bbf[_0xf62f('0x3a')][_0xf62f('0x47')]({'id':0x0,'priority':_0x178bbf[_0xf62f('0x3a')][_0xf62f('0x3f')]+0x1,'app':_0xf62f('0x48'),'appdata':'unmanaged','interval':_0xf62f('0x49')});}_0x261a5d[_0xf62f('0x4a')]=!![];}else{_0x261a5d[_0xf62f('0x4a')]=![];}_0x178bbf[_0xf62f('0x4b')]=_0x261a5d;return db['FaxMessage'][_0xf62f('0x40')]({'body':_0x5e8b14[_0xf62f('0x23')][_0xf62f('0x23')],'FaxAccountId':_0x5e8b14[_0xf62f('0x36')]['id'],'FaxInteractionId':_0xa7aa14['id'],'direction':'in','ContactId':_0xa7aa14[_0xf62f('0x4c')],'AttachmentId':_0x5e8b14['body'][_0xf62f('0x4d')]});})[_0xf62f('0x27')](function(_0x47b0a0){_0x178bbf[_0xf62f('0x17')]=_0x47b0a0;if(_0x178bbf[_0xf62f('0x4b')][_0xf62f('0x4e')]){return db[_0xf62f('0x4f')][_0xf62f('0x42')]({'attributes':['id','name'],'where':{'id':_0x178bbf['interaction']['UserId']}})[_0xf62f('0x27')](function(_0x35bd57){if(_0x35bd57){_0x178bbf['applications'][_0xf62f('0x50')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x35bd57[_0xf62f('0x51')]+','+(_0x178bbf[_0xf62f('0x36')]['waitForTheAssignedAgent']||0xa),'interval':_0xf62f('0x49')});}return respondWithRpcPromise(_0xf62f('0x52'),_0xf62f('0x53'),_0x178bbf);});}return respondWithRpcPromise(_0xf62f('0x52'),_0xf62f('0x53'),_0x178bbf);})[_0xf62f('0x27')](function(_0x3be043){_0x397c42(_0x3be043);})['catch'](function(_0x21cfd2){_0x25ebe6(_0x80836f['error'](0x1f4,_0x21cfd2[_0xf62f('0x17')]));});});};
\ No newline at end of file
+var _0xd897=['stringify','error','code','FaxAccount,\x20%s,\x20%s','message','info','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','body','fax','describe','Sequelize','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','CmContact','Contacts','FaxApplication','Applications','get','applications','list','priority','asc','length','defaults','create','contact','find','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','created','ContactId','AttachmentId','interaction','UserId','unshift','name','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s'];(function(_0x3396cd,_0x4047f0){var _0x2d6b4a=function(_0x389663){while(--_0x389663){_0x3396cd['push'](_0x3396cd['shift']());}};_0x2d6b4a(++_0x4047f0);}(_0xd897,0xa8));var _0x7d89=function(_0x17d5c3,_0x1dc9ca){_0x17d5c3=_0x17d5c3-0x0;var _0x236310=_0xd897[_0x17d5c3];return _0x236310;};'use strict';var _=require('lodash');var util=require(_0x7d89('0x0'));var moment=require('moment');var BPromise=require(_0x7d89('0x1'));var rs=require(_0x7d89('0x2'));var fs=require('fs');var Redis=require(_0x7d89('0x3'));var db=require(_0x7d89('0x4'))['db'];var utils=require(_0x7d89('0x5'));var logger=require(_0x7d89('0x6'))(_0x7d89('0x7'));var config=require(_0x7d89('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7d89('0x9')][_0x7d89('0xa')]({'port':0x232c});config[_0x7d89('0xb')]=_['defaults'](config[_0x7d89('0xb')],{'host':_0x7d89('0xc'),'port':0x18eb});var socket=require(_0x7d89('0xd'))(new Redis(config['redis']));require(_0x7d89('0xe'))[_0x7d89('0xf')](socket);function respondWithRpcPromise(_0x4418ae,_0x59d3f3,_0x222d7d){return new BPromise(function(_0x3bd4d3,_0x4f3920){return client[_0x7d89('0x10')](_0x4418ae,_0x222d7d)[_0x7d89('0x11')](function(_0x3fc79b){logger['info']('FaxAccount,\x20%s,\x20%s',_0x59d3f3,_0x7d89('0x12'));logger['debug'](_0x7d89('0x13'),_0x59d3f3,_0x7d89('0x12'),JSON[_0x7d89('0x14')](_0x3fc79b));if(_0x3fc79b[_0x7d89('0x15')]){if(_0x3fc79b['error'][_0x7d89('0x16')]===0x1f4){logger[_0x7d89('0x15')](_0x7d89('0x17'),_0x59d3f3,_0x3fc79b[_0x7d89('0x15')][_0x7d89('0x18')]);return _0x4f3920(_0x3fc79b[_0x7d89('0x15')][_0x7d89('0x18')]);}logger[_0x7d89('0x15')](_0x7d89('0x17'),_0x59d3f3,_0x3fc79b[_0x7d89('0x15')][_0x7d89('0x18')]);return _0x3bd4d3(_0x3fc79b[_0x7d89('0x15')]['message']);}else{logger[_0x7d89('0x19')](_0x7d89('0x17'),_0x59d3f3,'request\x20sent');_0x3bd4d3(_0x3fc79b[_0x7d89('0x1a')]['message']);}})[_0x7d89('0x1b')](function(_0x4e736a){logger[_0x7d89('0x15')]('FaxAccount,\x20%s,\x20%s',_0x59d3f3,_0x4e736a);_0x4f3920(_0x4e736a);});});}exports[_0x7d89('0x1c')]=function(_0x4e504e){var _0x2ecb73=this;return new Promise(function(_0x4aaddd,_0x1af4e2){return db[_0x7d89('0x1d')][_0x7d89('0x1e')]({'raw':_0x4e504e['options']?_0x4e504e[_0x7d89('0x1f')][_0x7d89('0x20')]===undefined?!![]:![]:!![],'where':_0x4e504e[_0x7d89('0x1f')]?_0x4e504e[_0x7d89('0x1f')][_0x7d89('0x21')]||null:null,'attributes':_0x4e504e[_0x7d89('0x1f')]?_0x4e504e[_0x7d89('0x1f')][_0x7d89('0x22')]||null:null,'limit':_0x4e504e[_0x7d89('0x1f')]?_0x4e504e[_0x7d89('0x1f')][_0x7d89('0x23')]||null:null,'include':_0x4e504e[_0x7d89('0x1f')]?_0x4e504e[_0x7d89('0x1f')][_0x7d89('0x24')]?_[_0x7d89('0x25')](_0x4e504e[_0x7d89('0x1f')][_0x7d89('0x24')],function(_0x2d814c){return{'model':db[_0x2d814c[_0x7d89('0x26')]],'as':_0x2d814c['as'],'attributes':_0x2d814c[_0x7d89('0x22')],'include':_0x2d814c['include']?_[_0x7d89('0x25')](_0x2d814c['include'],function(_0x2de036){return{'model':db[_0x2de036[_0x7d89('0x26')]],'as':_0x2de036['as'],'attributes':_0x2de036['attributes'],'include':_0x2de036[_0x7d89('0x24')]?_[_0x7d89('0x25')](_0x2de036[_0x7d89('0x24')],function(_0x5738c0){return{'model':db[_0x5738c0[_0x7d89('0x26')]],'as':_0x5738c0['as'],'attributes':_0x5738c0['attributes']};}):[]};}):[]};}):[]:[]})[_0x7d89('0x11')](function(_0x460730){logger[_0x7d89('0x19')](_0x7d89('0x1c'),_0x4e504e);logger[_0x7d89('0x27')]('GetFaxAccount',_0x4e504e,JSON[_0x7d89('0x14')](_0x460730));_0x4aaddd(_0x460730);})[_0x7d89('0x1b')](function(_0x452f7e){logger[_0x7d89('0x15')](_0x7d89('0x1c'),_0x452f7e[_0x7d89('0x18')],_0x4e504e);_0x1af4e2(_0x2ecb73[_0x7d89('0x15')](0x1f4,_0x452f7e[_0x7d89('0x18')]));});});};exports['NotifyFaxAccount']=function(_0x41983f,_0x1e9af3,_0x472fc5){var _0x352c57=this;return new Promise(function(_0x56addb,_0x1eff79){var _0x1f8d15={'body':_0x41983f[_0x7d89('0x28')],'channel':_0x7d89('0x29')};var _0xc9c8e8=[];var _0x40963c=[];var _0x252451={};return db['CmContact'][_0x7d89('0x2a')]()[_0x7d89('0x11')](function(_0x2bf994){if(!_0x2bf994){throw new db[(_0x7d89('0x2b'))]['ValidationError'](_0x7d89('0x2c'));}_0xc9c8e8=_[_0x7d89('0x2d')](_[_0x7d89('0x2e')](_0x2bf994),[_0x7d89('0x2f'),_0x7d89('0x30')]);_0x40963c=_['difference'](_[_0x7d89('0x2e')](_0x2bf994),['createdAt','updatedAt',_0x7d89('0x31'),_0x7d89('0x32')]);if(_0x41983f['body']['id']){delete _0x41983f['body']['id'];}if(_[_0x7d89('0x33')](_0x41983f[_0x7d89('0x28')][_0x7d89('0x34')])){throw new db[(_0x7d89('0x2b'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x41983f['body'][_0x7d89('0x28')])||_0x41983f[_0x7d89('0x28')]['body']===''){throw new db[(_0x7d89('0x2b'))][(_0x7d89('0x35'))](_0x7d89('0x36'));}if(_[_0x7d89('0x33')](_0x41983f[_0x7d89('0x28')][_0x7d89('0x37')])){throw new db[(_0x7d89('0x2b'))][(_0x7d89('0x35'))](_0x7d89('0x38')+_0x40963c);}if(!_[_0x7d89('0x39')](_0x40963c,_0x41983f['body']['mapKey'])){throw new db[(_0x7d89('0x2b'))][(_0x7d89('0x35'))](_0x7d89('0x3a')+_0x40963c);}_0x252451[_0x41983f[_0x7d89('0x28')]['mapKey']]=_0x41983f['body'][_0x7d89('0x34')];})[_0x7d89('0x11')](function(){return db[_0x7d89('0x1d')]['find']({'where':{'id':_0x41983f[_0x7d89('0x3b')]['id']},'include':[{'model':db[_0x7d89('0x3c')],'as':_0x7d89('0x3d'),'include':[{'model':db[_0x7d89('0x3e')],'as':_0x7d89('0x3f'),'where':_0x252451,'limit':0x1,'order':[[_0x7d89('0x30'),'DESC']]}]},{'model':db[_0x7d89('0x40')],'as':_0x7d89('0x41')}]});})[_0x7d89('0x11')](function(_0x403cb5){if(_0x403cb5&&_0x403cb5['List']){var _0x5e0dbc=_0x403cb5[_0x7d89('0x42')]({'plain':!![]});_0x1f8d15[_0x7d89('0x3b')]=_0x5e0dbc;_0x1f8d15[_0x7d89('0x43')]=_0x5e0dbc[_0x7d89('0x41')];_0x1f8d15[_0x7d89('0x44')]=_0x5e0dbc[_0x7d89('0x3d')];_0x1f8d15['applications']=_['orderBy'](_0x1f8d15[_0x7d89('0x43')],[_0x7d89('0x45')],[_0x7d89('0x46')]);if(_0x1f8d15['account'][_0x7d89('0x41')]){delete _0x1f8d15['account'][_0x7d89('0x41')];}if(_0x1f8d15['account'][_0x7d89('0x3d')]&&_0x1f8d15[_0x7d89('0x3b')][_0x7d89('0x3d')]['Contacts'][_0x7d89('0x47')]){return _0x1f8d15[_0x7d89('0x3b')][_0x7d89('0x3d')][_0x7d89('0x3f')][0x0];}var _0x22105d=_[_0x7d89('0x48')](_0x41983f[_0x7d89('0x28')],{'firstName':_0x41983f[_0x7d89('0x28')][_0x7d89('0x34')],'ListId':_0x5e0dbc[_0x7d89('0x32')]});_0x22105d[_0x41983f['body'][_0x7d89('0x37')]]=_0x41983f[_0x7d89('0x28')]['from'];return db[_0x7d89('0x3e')][_0x7d89('0x49')](_0x22105d,{'fields':_0xc9c8e8,'raw':!![]});}})[_0x7d89('0x11')](function(_0x49209c){_0x1f8d15[_0x7d89('0x4a')]=_0x49209c;if(_0x49209c){var _0x59f40b={'ContactId':_0x49209c['id'],'FaxAccountId':_0x41983f['account']['id'],'fax':_0x49209c[_0x7d89('0x29')]};return db['FaxInteraction'][_0x7d89('0x4b')]({'where':{'ContactId':_0x49209c['id'],'closed':![],'FaxAccountId':_0x41983f['account']['id']}})[_0x7d89('0x11')](function(_0x3de71a){if(_0x3de71a){return[_0x3de71a,![]];}return db[_0x7d89('0x4c')][_0x7d89('0x49')](_0x59f40b)[_0x7d89('0x11')](function(_0x2bb4b2){return[_0x2bb4b2,!![]];});});}else{throw new Error(_0x7d89('0x4d'));}})[_0x7d89('0x4e')](function(_0x1b2100,_0x5b7af7){var _0x50d83c=_0x1b2100[_0x7d89('0x42')]({'plain':!![]});if(_0x5b7af7){if(_0x1f8d15[_0x7d89('0x3b')][_0x7d89('0x4f')]){_0x1f8d15[_0x7d89('0x43')][_0x7d89('0x50')]({'id':0x0,'priority':_0x1f8d15['applications'][_0x7d89('0x47')]+0x1,'app':_0x7d89('0x51'),'appdata':_0x7d89('0x52'),'interval':'*,*,*,*'});}_0x50d83c[_0x7d89('0x53')]=!![];}else{_0x50d83c['created']=![];}_0x1f8d15['interaction']=_0x50d83c;return db['FaxMessage'][_0x7d89('0x49')]({'body':_0x41983f[_0x7d89('0x28')][_0x7d89('0x28')],'FaxAccountId':_0x41983f['account']['id'],'FaxInteractionId':_0x1b2100['id'],'direction':'in','ContactId':_0x1b2100[_0x7d89('0x54')],'AttachmentId':_0x41983f[_0x7d89('0x28')][_0x7d89('0x55')]});})[_0x7d89('0x11')](function(_0x3ab82d){_0x1f8d15['message']=_0x3ab82d;if(_0x1f8d15[_0x7d89('0x56')][_0x7d89('0x57')]){return db['User']['find']({'attributes':['id','name'],'where':{'id':_0x1f8d15[_0x7d89('0x56')]['UserId']}})[_0x7d89('0x11')](function(_0x243e53){if(_0x243e53){_0x1f8d15['applications'][_0x7d89('0x58')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x243e53[_0x7d89('0x59')]+','+(_0x1f8d15[_0x7d89('0x3b')][_0x7d89('0x5a')]||0xa),'interval':_0x7d89('0x5b')});}return respondWithRpcPromise(_0x7d89('0x5c'),_0x7d89('0x5d'),_0x1f8d15);});}return respondWithRpcPromise('Start','startRouting',_0x1f8d15);})[_0x7d89('0x11')](function(_0x1464f8){_0x56addb(_0x1464f8);})['catch'](function(_0x441cd6){_0x1eff79(_0x352c57[_0x7d89('0x15')](0x1f4,_0x441cd6['message']));});});};
\ No newline at end of file
index 21a70a1..1a661a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8105=['faxAccount:','save','remove','update','removeListener','register','length'];(function(_0x103d67,_0x14bb9d){var _0x486125=function(_0x5f131b){while(--_0x5f131b){_0x103d67['push'](_0x103d67['shift']());}};_0x486125(++_0x14bb9d);}(_0x8105,0x13c));var _0x5810=function(_0x323b67,_0x54ed53){_0x323b67=_0x323b67-0x0;var _0x5ccf29=_0x8105[_0x323b67];return _0x5ccf29;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0x5810('0x0'),_0x5810('0x1'),_0x5810('0x2')];function createListener(_0x55407c,_0x1c71bd){return function(_0x3eeebf){_0x1c71bd['emit'](_0x55407c,_0x3eeebf);};}function removeListener(_0x5bf516,_0x355601){return function(){FaxAccountEvents[_0x5810('0x3')](_0x5bf516,_0x355601);};}exports[_0x5810('0x4')]=function(_0x2e26a5){for(var _0x197e66=0x0,_0x2829c5=events[_0x5810('0x5')];_0x197e66<_0x2829c5;_0x197e66++){var _0x1b7a74=events[_0x197e66];var _0x22f5e2=createListener(_0x5810('0x6')+_0x1b7a74,_0x2e26a5);FaxAccountEvents['on'](_0x1b7a74,_0x22f5e2);}};
\ No newline at end of file
+var _0x8174=['./faxAccount.events','remove','update','emit','removeListener','register','length','faxAccount:'];(function(_0x2eb874,_0x4fef8c){var _0x1c1294=function(_0x2a2645){while(--_0x2a2645){_0x2eb874['push'](_0x2eb874['shift']());}};_0x1c1294(++_0x4fef8c);}(_0x8174,0x1a0));var _0x4817=function(_0x5903da,_0x573b67){_0x5903da=_0x5903da-0x0;var _0x13f8bd=_0x8174[_0x5903da];return _0x13f8bd;};'use strict';var FaxAccountEvents=require(_0x4817('0x0'));var events=['save',_0x4817('0x1'),_0x4817('0x2')];function createListener(_0x405a6e,_0x1354f2){return function(_0x238df5){_0x1354f2[_0x4817('0x3')](_0x405a6e,_0x238df5);};}function removeListener(_0x29fe6a,_0xd339c5){return function(){FaxAccountEvents[_0x4817('0x4')](_0x29fe6a,_0xd339c5);};}exports[_0x4817('0x5')]=function(_0x1091cc){for(var _0x37df0b=0x0,_0x28ffb3=events[_0x4817('0x6')];_0x37df0b<_0x28ffb3;_0x37df0b++){var _0xcc0e6b=events[_0x37df0b];var _0x2d3fce=createListener(_0x4817('0x7')+_0xcc0e6b,_0x1091cc);FaxAccountEvents['on'](_0xcc0e6b,_0x2d3fce);}};
\ No newline at end of file
index 3fa9165..e96987b 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(_0x3fd540,_0x384de7){var _0xe53b89=function(_0x2dc21c){while(--_0x2dc21c){_0x3fd540['push'](_0x3fd540['shift']());}};_0xe53b89(++_0x384de7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'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(_0x2c7780,_0x100f4a){var _0x580bc8=function(_0x3d435c){while(--_0x3d435c){_0x2c7780['push'](_0x2c7780['shift']());}};_0x580bc8(++_0x100f4a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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 d7df85c..b1427a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01f5=['*,*,*,*','exports','INTEGER','STRING','noop','TEXT'];(function(_0x3e50eb,_0x5e2188){var _0x3d24d4=function(_0x20d830){while(--_0x20d830){_0x3e50eb['push'](_0x3e50eb['shift']());}};_0x3d24d4(++_0x5e2188);}(_0x01f5,0x1b1));var _0x501f=function(_0x4147e7,_0x28fdd3){_0x4147e7=_0x4147e7-0x0;var _0x40030a=_0x01f5[_0x4147e7];return _0x40030a;};'use strict';var Sequelize=require('sequelize');module[_0x501f('0x0')]={'priority':{'type':Sequelize[_0x501f('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x501f('0x2')],'allowNull':![],'defaultValue':_0x501f('0x3')},'appdata':{'type':Sequelize[_0x501f('0x4')]()},'description':{'type':Sequelize[_0x501f('0x2')]},'interval':{'type':Sequelize[_0x501f('0x2')],'defaultValue':_0x501f('0x5')}};
\ No newline at end of file
+var _0x5e5b=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x1d426f,_0x37e919){var _0x17f71a=function(_0x3bf60c){while(--_0x3bf60c){_0x1d426f['push'](_0x1d426f['shift']());}};_0x17f71a(++_0x37e919);}(_0x5e5b,0x66));var _0xb5e5=function(_0x5f0294,_0xad2c60){_0x5f0294=_0x5f0294-0x0;var _0x1ff2b2=_0x5e5b[_0x5f0294];return _0x1ff2b2;};'use strict';var Sequelize=require('sequelize');module[_0xb5e5('0x0')]={'priority':{'type':Sequelize[_0xb5e5('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xb5e5('0x2')],'allowNull':![],'defaultValue':_0xb5e5('0x3')},'appdata':{'type':Sequelize[_0xb5e5('0x4')]()},'description':{'type':Sequelize[_0xb5e5('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xb5e5('0x5')}};
\ No newline at end of file
index c9bfb0b..d6cbef6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78a1=['params','include','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','FaxApplication','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','filter','where','merge','options','includeAll','rows'];(function(_0x254295,_0x50730a){var _0x235c7d=function(_0x13d15c){while(--_0x13d15c){_0x254295['push'](_0x254295['shift']());}};_0x235c7d(++_0x50730a);}(_0x78a1,0x1b6));var _0x178a=function(_0x2c11d8,_0x3c8f42){_0x2c11d8=_0x2c11d8-0x0;var _0x3bfeef=_0x78a1[_0x2c11d8];return _0x3bfeef;};'use strict';var emlformat=require(_0x178a('0x0'));var rimraf=require(_0x178a('0x1'));var zipdir=require(_0x178a('0x2'));var jsonpatch=require(_0x178a('0x3'));var rp=require(_0x178a('0x4'));var moment=require(_0x178a('0x5'));var BPromise=require(_0x178a('0x6'));var Mustache=require(_0x178a('0x7'));var util=require('util');var path=require('path');var sox=require(_0x178a('0x8'));var csv=require(_0x178a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x178a('0xa'));var _=require(_0x178a('0xb'));var squel=require(_0x178a('0xc'));var crypto=require(_0x178a('0xd'));var jsforce=require(_0x178a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x178a('0x9'));var querystring=require(_0x178a('0xf'));var Papa=require('papaparse');var Redis=require(_0x178a('0x10'));var authService=require(_0x178a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x178a('0x12'));var hardwareService=require(_0x178a('0x13'));var logger=require(_0x178a('0x14'))(_0x178a('0x15'));var utils=require(_0x178a('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x178a('0x17'))['db'];function respondWithStatusCode(_0x437e9a,_0x2ebe20){_0x2ebe20=_0x2ebe20||0xcc;return function(_0x5ade17){if(_0x5ade17){return _0x437e9a[_0x178a('0x18')](_0x2ebe20);}return _0x437e9a['status'](_0x2ebe20)[_0x178a('0x19')]();};}function respondWithResult(_0x4ff689,_0x24d0ce){_0x24d0ce=_0x24d0ce||0xc8;return function(_0x5b5e71){if(_0x5b5e71){return _0x4ff689[_0x178a('0x1a')](_0x24d0ce)[_0x178a('0x1b')](_0x5b5e71);}};}function respondWithFilteredResult(_0x1ceaa0,_0x3f5056){return function(_0x5896a8){if(_0x5896a8){var _0x3a52bb=typeof _0x3f5056[_0x178a('0x1c')]===_0x178a('0x1d')&&typeof _0x3f5056[_0x178a('0x1e')]===_0x178a('0x1d');var _0x354085=_0x5896a8[_0x178a('0x1f')];var _0x4e6063=_0x3a52bb?0x0:_0x3f5056[_0x178a('0x1c')];var _0x525a2e=_0x3a52bb?_0x5896a8['count']:_0x3f5056[_0x178a('0x1c')]+_0x3f5056[_0x178a('0x1e')];var _0x627a3b;if(_0x525a2e>=_0x354085){_0x525a2e=_0x354085;_0x627a3b=0xc8;}else{_0x627a3b=0xce;}_0x1ceaa0[_0x178a('0x1a')](_0x627a3b);return _0x1ceaa0[_0x178a('0x20')](_0x178a('0x21'),_0x4e6063+'-'+_0x525a2e+'/'+_0x354085)[_0x178a('0x1b')](_0x5896a8);}return null;};}function patchUpdates(_0x454e0e){return function(_0x5bfade){try{jsonpatch[_0x178a('0x22')](_0x5bfade,_0x454e0e,!![]);}catch(_0x4a3641){return BPromise[_0x178a('0x23')](_0x4a3641);}return _0x5bfade[_0x178a('0x24')]();};}function saveUpdates(_0x4c87b2,_0xffa11c){return function(_0xc0f381){if(_0xc0f381){return _0xc0f381[_0x178a('0x25')](_0x4c87b2)['then'](function(_0x321f8f){return _0x321f8f;});}return null;};}function removeEntity(_0x51f9f1,_0x365ea5){return function(_0xa88868){if(_0xa88868){return _0xa88868[_0x178a('0x26')]()[_0x178a('0x27')](function(){_0x51f9f1[_0x178a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b24c0,_0x288f6a){return function(_0x102d51){if(!_0x102d51){_0x1b24c0['sendStatus'](0x194);}return _0x102d51;};}function handleError(_0x54cd59,_0xf44a46){_0xf44a46=_0xf44a46||0x1f4;return function(_0x3f2078){logger[_0x178a('0x28')](_0x3f2078[_0x178a('0x29')]);if(_0x3f2078[_0x178a('0x2a')]){delete _0x3f2078[_0x178a('0x2a')];}_0x54cd59[_0x178a('0x1a')](_0xf44a46)[_0x178a('0x2b')](_0x3f2078);};}exports[_0x178a('0x2c')]=function(_0x49a5d3,_0x219515){var _0x57ee4f={},_0x501f7d={},_0xa66a73={'count':0x0,'rows':[]};var _0x543498=_[_0x178a('0x2d')](db[_0x178a('0x2e')][_0x178a('0x2f')],function(_0x40c849){return{'name':_0x40c849[_0x178a('0x30')],'type':_0x40c849[_0x178a('0x31')]['key']};});_0x501f7d[_0x178a('0x32')]=_['map'](_0x543498,_0x178a('0x2a'));_0x501f7d[_0x178a('0x33')]=_[_0x178a('0x34')](_0x49a5d3['query']);_0x501f7d[_0x178a('0x35')]=_[_0x178a('0x36')](_0x501f7d[_0x178a('0x32')],_0x501f7d['query']);_0x57ee4f['attributes']=_[_0x178a('0x36')](_0x501f7d[_0x178a('0x32')],qs[_0x178a('0x37')](_0x49a5d3[_0x178a('0x33')][_0x178a('0x37')]));_0x57ee4f[_0x178a('0x38')]=_0x57ee4f[_0x178a('0x38')][_0x178a('0x39')]?_0x57ee4f[_0x178a('0x38')]:_0x501f7d[_0x178a('0x32')];if(!_0x49a5d3[_0x178a('0x33')][_0x178a('0x3a')]('nolimit')){_0x57ee4f['limit']=qs['limit'](_0x49a5d3[_0x178a('0x33')][_0x178a('0x1e')]);_0x57ee4f[_0x178a('0x1c')]=qs[_0x178a('0x1c')](_0x49a5d3['query'][_0x178a('0x1c')]);}_0x57ee4f['order']=qs['sort'](_0x49a5d3[_0x178a('0x33')][_0x178a('0x3b')]);_0x57ee4f['where']=qs[_0x178a('0x35')](_['pick'](_0x49a5d3[_0x178a('0x33')],_0x501f7d[_0x178a('0x35')]),_0x543498);if(_0x49a5d3[_0x178a('0x33')][_0x178a('0x3c')]){_0x57ee4f[_0x178a('0x3d')]=_[_0x178a('0x3e')](_0x57ee4f[_0x178a('0x3d')],{'$or':_[_0x178a('0x2d')](_0x543498,function(_0x20804f){if(_0x20804f['type']!=='VIRTUAL'){var _0x5a5296={};_0x5a5296[_0x20804f[_0x178a('0x2a')]]={'$like':'%'+_0x49a5d3['query'][_0x178a('0x3c')]+'%'};return _0x5a5296;}})});}_0x57ee4f=_['merge']({},_0x57ee4f,_0x49a5d3[_0x178a('0x3f')]);var _0x158be2={'where':_0x57ee4f['where']};return db[_0x178a('0x2e')][_0x178a('0x1f')](_0x158be2)[_0x178a('0x27')](function(_0x13a7df){_0xa66a73[_0x178a('0x1f')]=_0x13a7df;if(_0x49a5d3['query'][_0x178a('0x40')]){_0x57ee4f['include']=[{'all':!![]}];}return db['FaxApplication']['findAll'](_0x57ee4f);})[_0x178a('0x27')](function(_0x39175a){_0xa66a73[_0x178a('0x41')]=_0x39175a;return _0xa66a73;})[_0x178a('0x27')](respondWithFilteredResult(_0x219515,_0x57ee4f))['catch'](handleError(_0x219515,null));};exports['show']=function(_0x49d5c6,_0x93bba0){var _0x9c92c6={'raw':!![],'where':{'id':_0x49d5c6[_0x178a('0x42')]['id']}},_0x42e5fa={};_0x42e5fa[_0x178a('0x32')]=_[_0x178a('0x34')](db[_0x178a('0x2e')][_0x178a('0x2f')]);_0x42e5fa[_0x178a('0x33')]=_['keys'](_0x49d5c6['query']);_0x42e5fa[_0x178a('0x35')]=_[_0x178a('0x36')](_0x42e5fa[_0x178a('0x32')],_0x42e5fa[_0x178a('0x33')]);_0x9c92c6[_0x178a('0x38')]=_['intersection'](_0x42e5fa[_0x178a('0x32')],qs[_0x178a('0x37')](_0x49d5c6[_0x178a('0x33')][_0x178a('0x37')]));_0x9c92c6[_0x178a('0x38')]=_0x9c92c6[_0x178a('0x38')]['length']?_0x9c92c6[_0x178a('0x38')]:_0x42e5fa[_0x178a('0x32')];if(_0x49d5c6[_0x178a('0x33')]['includeAll']){_0x9c92c6[_0x178a('0x43')]=[{'all':!![]}];}_0x9c92c6=_['merge']({},_0x9c92c6,_0x49d5c6[_0x178a('0x3f')]);return db[_0x178a('0x2e')][_0x178a('0x44')](_0x9c92c6)['then'](handleEntityNotFound(_0x93bba0,null))[_0x178a('0x27')](respondWithResult(_0x93bba0,null))[_0x178a('0x45')](handleError(_0x93bba0,null));};exports[_0x178a('0x46')]=function(_0x178f51,_0x1a86b2){return db[_0x178a('0x2e')]['create'](_0x178f51[_0x178a('0x47')],{})[_0x178a('0x27')](respondWithResult(_0x1a86b2,0xc9))['catch'](handleError(_0x1a86b2,null));};exports['update']=function(_0x4f5cd6,_0x155e4f){if(_0x4f5cd6[_0x178a('0x47')]['id']){delete _0x4f5cd6[_0x178a('0x47')]['id'];}return db['FaxApplication'][_0x178a('0x44')]({'where':{'id':_0x4f5cd6[_0x178a('0x42')]['id']}})[_0x178a('0x27')](handleEntityNotFound(_0x155e4f,null))[_0x178a('0x27')](saveUpdates(_0x4f5cd6['body'],null))[_0x178a('0x27')](respondWithResult(_0x155e4f,null))[_0x178a('0x45')](handleError(_0x155e4f,null));};exports['destroy']=function(_0x2e822c,_0xd5c2b){return db['FaxApplication'][_0x178a('0x44')]({'where':{'id':_0x2e822c[_0x178a('0x42')]['id']}})[_0x178a('0x27')](handleEntityNotFound(_0xd5c2b,null))[_0x178a('0x27')](removeEntity(_0xd5c2b,null))[_0x178a('0x45')](handleError(_0xd5c2b,null));};
\ No newline at end of file
+var _0x1e1d=['json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','name','send','index','FaxApplication','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end'];(function(_0x405541,_0x2945cc){var _0x194a1e=function(_0x46fffe){while(--_0x46fffe){_0x405541['push'](_0x405541['shift']());}};_0x194a1e(++_0x2945cc);}(_0x1e1d,0x79));var _0xd1e1=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x1e1d[_0x2dadb9];return _0x2f0097;};'use strict';var emlformat=require(_0xd1e1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd1e1('0x1'));var jsonpatch=require(_0xd1e1('0x2'));var rp=require(_0xd1e1('0x3'));var moment=require(_0xd1e1('0x4'));var BPromise=require(_0xd1e1('0x5'));var Mustache=require(_0xd1e1('0x6'));var util=require(_0xd1e1('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd1e1('0x8'));var fs=require('fs');var fs_extra=require(_0xd1e1('0x9'));var _=require('lodash');var squel=require(_0xd1e1('0xa'));var crypto=require(_0xd1e1('0xb'));var jsforce=require(_0xd1e1('0xc'));var deskjs=require(_0xd1e1('0xd'));var toCsv=require(_0xd1e1('0xe'));var querystring=require('querystring');var Papa=require(_0xd1e1('0xf'));var Redis=require(_0xd1e1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd1e1('0x11'));var as=require(_0xd1e1('0x12'));var hardwareService=require(_0xd1e1('0x13'));var logger=require(_0xd1e1('0x14'))('api');var utils=require(_0xd1e1('0x15'));var config=require(_0xd1e1('0x16'));var licenseUtil=require(_0xd1e1('0x17'));var db=require(_0xd1e1('0x18'))['db'];function respondWithStatusCode(_0x2a138b,_0x22a1b3){_0x22a1b3=_0x22a1b3||0xcc;return function(_0x3a4a27){if(_0x3a4a27){return _0x2a138b['sendStatus'](_0x22a1b3);}return _0x2a138b[_0xd1e1('0x19')](_0x22a1b3)[_0xd1e1('0x1a')]();};}function respondWithResult(_0x13999c,_0x3a6c14){_0x3a6c14=_0x3a6c14||0xc8;return function(_0x2c484f){if(_0x2c484f){return _0x13999c[_0xd1e1('0x19')](_0x3a6c14)[_0xd1e1('0x1b')](_0x2c484f);}};}function respondWithFilteredResult(_0x2381e6,_0x598494){return function(_0x4f8414){if(_0x4f8414){var _0x5292ba=typeof _0x598494[_0xd1e1('0x1c')]===_0xd1e1('0x1d')&&typeof _0x598494['limit']===_0xd1e1('0x1d');var _0x4b4d05=_0x4f8414[_0xd1e1('0x1e')];var _0x2bde30=_0x5292ba?0x0:_0x598494['offset'];var _0x41bb20=_0x5292ba?_0x4f8414['count']:_0x598494['offset']+_0x598494['limit'];var _0x5c6bd8;if(_0x41bb20>=_0x4b4d05){_0x41bb20=_0x4b4d05;_0x5c6bd8=0xc8;}else{_0x5c6bd8=0xce;}_0x2381e6[_0xd1e1('0x19')](_0x5c6bd8);return _0x2381e6['set'](_0xd1e1('0x1f'),_0x2bde30+'-'+_0x41bb20+'/'+_0x4b4d05)[_0xd1e1('0x1b')](_0x4f8414);}return null;};}function patchUpdates(_0x4baae9){return function(_0x4fb116){try{jsonpatch[_0xd1e1('0x20')](_0x4fb116,_0x4baae9,!![]);}catch(_0x4d4c47){return BPromise[_0xd1e1('0x21')](_0x4d4c47);}return _0x4fb116[_0xd1e1('0x22')]();};}function saveUpdates(_0x14ffaf,_0x7653d3){return function(_0x47d99a){if(_0x47d99a){return _0x47d99a[_0xd1e1('0x23')](_0x14ffaf)[_0xd1e1('0x24')](function(_0x79a190){return _0x79a190;});}return null;};}function removeEntity(_0x3bc41a,_0x2c0218){return function(_0x39a09e){if(_0x39a09e){return _0x39a09e[_0xd1e1('0x25')]()[_0xd1e1('0x24')](function(){_0x3bc41a[_0xd1e1('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45734e,_0xc010e8){return function(_0x1fb4d1){if(!_0x1fb4d1){_0x45734e['sendStatus'](0x194);}return _0x1fb4d1;};}function handleError(_0xd6bf07,_0xe9c712){_0xe9c712=_0xe9c712||0x1f4;return function(_0x49a4f9){logger['error'](_0x49a4f9['stack']);if(_0x49a4f9[_0xd1e1('0x26')]){delete _0x49a4f9[_0xd1e1('0x26')];}_0xd6bf07[_0xd1e1('0x19')](_0xe9c712)[_0xd1e1('0x27')](_0x49a4f9);};}exports[_0xd1e1('0x28')]=function(_0x29b335,_0x12bf50){var _0x3d0ffb={},_0x55dbe1={},_0x1af969={'count':0x0,'rows':[]};var _0x1f5f9c=_['map'](db[_0xd1e1('0x29')][_0xd1e1('0x2a')],function(_0x7f7155){return{'name':_0x7f7155[_0xd1e1('0x2b')],'type':_0x7f7155[_0xd1e1('0x2c')][_0xd1e1('0x2d')]};});_0x55dbe1[_0xd1e1('0x2e')]=_[_0xd1e1('0x2f')](_0x1f5f9c,'name');_0x55dbe1[_0xd1e1('0x30')]=_[_0xd1e1('0x31')](_0x29b335['query']);_0x55dbe1[_0xd1e1('0x32')]=_[_0xd1e1('0x33')](_0x55dbe1['model'],_0x55dbe1[_0xd1e1('0x30')]);_0x3d0ffb[_0xd1e1('0x34')]=_[_0xd1e1('0x33')](_0x55dbe1[_0xd1e1('0x2e')],qs[_0xd1e1('0x35')](_0x29b335[_0xd1e1('0x30')][_0xd1e1('0x35')]));_0x3d0ffb['attributes']=_0x3d0ffb['attributes']['length']?_0x3d0ffb[_0xd1e1('0x34')]:_0x55dbe1[_0xd1e1('0x2e')];if(!_0x29b335[_0xd1e1('0x30')][_0xd1e1('0x36')]('nolimit')){_0x3d0ffb['limit']=qs[_0xd1e1('0x37')](_0x29b335['query']['limit']);_0x3d0ffb[_0xd1e1('0x1c')]=qs[_0xd1e1('0x1c')](_0x29b335[_0xd1e1('0x30')][_0xd1e1('0x1c')]);}_0x3d0ffb[_0xd1e1('0x38')]=qs[_0xd1e1('0x39')](_0x29b335['query'][_0xd1e1('0x39')]);_0x3d0ffb['where']=qs[_0xd1e1('0x32')](_[_0xd1e1('0x3a')](_0x29b335[_0xd1e1('0x30')],_0x55dbe1[_0xd1e1('0x32')]),_0x1f5f9c);if(_0x29b335[_0xd1e1('0x30')]['filter']){_0x3d0ffb[_0xd1e1('0x3b')]=_[_0xd1e1('0x3c')](_0x3d0ffb[_0xd1e1('0x3b')],{'$or':_[_0xd1e1('0x2f')](_0x1f5f9c,function(_0x24ef5e){if(_0x24ef5e[_0xd1e1('0x2c')]!==_0xd1e1('0x3d')){var _0xf6def={};_0xf6def[_0x24ef5e['name']]={'$like':'%'+_0x29b335[_0xd1e1('0x30')][_0xd1e1('0x3e')]+'%'};return _0xf6def;}})});}_0x3d0ffb=_[_0xd1e1('0x3c')]({},_0x3d0ffb,_0x29b335[_0xd1e1('0x3f')]);var _0x269181={'where':_0x3d0ffb['where']};return db[_0xd1e1('0x29')][_0xd1e1('0x1e')](_0x269181)['then'](function(_0x43cfa2){_0x1af969[_0xd1e1('0x1e')]=_0x43cfa2;if(_0x29b335['query'][_0xd1e1('0x40')]){_0x3d0ffb[_0xd1e1('0x41')]=[{'all':!![]}];}return db[_0xd1e1('0x29')][_0xd1e1('0x42')](_0x3d0ffb);})[_0xd1e1('0x24')](function(_0x13095a){_0x1af969[_0xd1e1('0x43')]=_0x13095a;return _0x1af969;})[_0xd1e1('0x24')](respondWithFilteredResult(_0x12bf50,_0x3d0ffb))[_0xd1e1('0x44')](handleError(_0x12bf50,null));};exports[_0xd1e1('0x45')]=function(_0x3fc449,_0x489307){var _0x557db4={'raw':!![],'where':{'id':_0x3fc449[_0xd1e1('0x46')]['id']}},_0xed4ff2={};_0xed4ff2['model']=_[_0xd1e1('0x31')](db[_0xd1e1('0x29')][_0xd1e1('0x2a')]);_0xed4ff2[_0xd1e1('0x30')]=_['keys'](_0x3fc449[_0xd1e1('0x30')]);_0xed4ff2[_0xd1e1('0x32')]=_[_0xd1e1('0x33')](_0xed4ff2['model'],_0xed4ff2[_0xd1e1('0x30')]);_0x557db4[_0xd1e1('0x34')]=_['intersection'](_0xed4ff2[_0xd1e1('0x2e')],qs[_0xd1e1('0x35')](_0x3fc449[_0xd1e1('0x30')][_0xd1e1('0x35')]));_0x557db4['attributes']=_0x557db4[_0xd1e1('0x34')]['length']?_0x557db4['attributes']:_0xed4ff2[_0xd1e1('0x2e')];if(_0x3fc449[_0xd1e1('0x30')]['includeAll']){_0x557db4['include']=[{'all':!![]}];}_0x557db4=_[_0xd1e1('0x3c')]({},_0x557db4,_0x3fc449['options']);return db[_0xd1e1('0x29')][_0xd1e1('0x47')](_0x557db4)['then'](handleEntityNotFound(_0x489307,null))[_0xd1e1('0x24')](respondWithResult(_0x489307,null))[_0xd1e1('0x44')](handleError(_0x489307,null));};exports[_0xd1e1('0x48')]=function(_0x2b0eed,_0x321d83){return db[_0xd1e1('0x29')][_0xd1e1('0x48')](_0x2b0eed[_0xd1e1('0x49')],{})['then'](respondWithResult(_0x321d83,0xc9))[_0xd1e1('0x44')](handleError(_0x321d83,null));};exports[_0xd1e1('0x23')]=function(_0x95bbd,_0x1f3b9c){if(_0x95bbd[_0xd1e1('0x49')]['id']){delete _0x95bbd[_0xd1e1('0x49')]['id'];}return db[_0xd1e1('0x29')][_0xd1e1('0x47')]({'where':{'id':_0x95bbd[_0xd1e1('0x46')]['id']}})['then'](handleEntityNotFound(_0x1f3b9c,null))[_0xd1e1('0x24')](saveUpdates(_0x95bbd[_0xd1e1('0x49')],null))[_0xd1e1('0x24')](respondWithResult(_0x1f3b9c,null))['catch'](handleError(_0x1f3b9c,null));};exports['destroy']=function(_0x547f62,_0x48b466){return db[_0xd1e1('0x29')]['find']({'where':{'id':_0x547f62['params']['id']}})[_0xd1e1('0x24')](handleEntityNotFound(_0x48b466,null))['then'](removeEntity(_0x48b466,null))['catch'](handleError(_0x48b466,null));};
\ No newline at end of file
index 85460a2..6f541d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xccc7=['./faxApplication.attributes','exports','fax_applications','utf8mb4','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x3fd649,_0x4fdc9c){var _0xa47606=function(_0x30c079){while(--_0x30c079){_0x3fd649['push'](_0x3fd649['shift']());}};_0xa47606(++_0x4fdc9c);}(_0xccc7,0x70));var _0x7ccc=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0xccc7[_0xe73080];return _0x12cbc4;};'use strict';var _=require(_0x7ccc('0x0'));var util=require('util');var logger=require(_0x7ccc('0x1'))(_0x7ccc('0x2'));var moment=require(_0x7ccc('0x3'));var BPromise=require('bluebird');var rp=require(_0x7ccc('0x4'));var fs=require('fs');var path=require(_0x7ccc('0x5'));var rimraf=require(_0x7ccc('0x6'));var config=require(_0x7ccc('0x7'));var attributes=require(_0x7ccc('0x8'));module[_0x7ccc('0x9')]=function(_0x15d167,_0x72d24d){return _0x15d167['define']('FaxApplication',attributes,{'tableName':_0x7ccc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7ccc('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x0569=['define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports'];(function(_0x2b0b8b,_0x1962d9){var _0xa9850c=function(_0x50657f){while(--_0x50657f){_0x2b0b8b['push'](_0x2b0b8b['shift']());}};_0xa9850c(++_0x1962d9);}(_0x0569,0x6e));var _0x9056=function(_0xa388a2,_0x40bde6){_0xa388a2=_0xa388a2-0x0;var _0x7ce7f6=_0x0569[_0xa388a2];return _0x7ce7f6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9056('0x0'))(_0x9056('0x1'));var moment=require(_0x9056('0x2'));var BPromise=require(_0x9056('0x3'));var rp=require(_0x9056('0x4'));var fs=require('fs');var path=require(_0x9056('0x5'));var rimraf=require(_0x9056('0x6'));var config=require(_0x9056('0x7'));var attributes=require(_0x9056('0x8'));module[_0x9056('0x9')]=function(_0x141f11,_0x214160){return _0x141f11[_0x9056('0xa')](_0x9056('0xb'),attributes,{'tableName':_0x9056('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9056('0xd'),'collate':_0x9056('0xe')});};
\ No newline at end of file
index 7436ae9..95d725c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe033=['debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateFaxApplication','FaxApplication','body','options','raw','limit','util','moment','randomstring','rpc','request','info','FaxApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0xe033,0x8b));var _0x3e03=function(_0x37edd4,_0x3498c5){_0x37edd4=_0x37edd4-0x0;var _0x132809=_0xe033[_0x37edd4];return _0x132809;};'use strict';var _=require('lodash');var util=require(_0x3e03('0x0'));var moment=require(_0x3e03('0x1'));var BPromise=require('bluebird');var rs=require(_0x3e03('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3e03('0x3'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5ed869,_0x590dca,_0x378688){return new BPromise(function(_0x203bc5,_0x262714){return client[_0x3e03('0x4')](_0x5ed869,_0x378688)['then'](function(_0x33ce4a){logger[_0x3e03('0x5')](_0x3e03('0x6'),_0x590dca,_0x3e03('0x7'));logger[_0x3e03('0x8')](_0x3e03('0x9'),_0x590dca,_0x3e03('0x7'),JSON[_0x3e03('0xa')](_0x33ce4a));if(_0x33ce4a[_0x3e03('0xb')]){if(_0x33ce4a[_0x3e03('0xb')][_0x3e03('0xc')]===0x1f4){logger[_0x3e03('0xb')](_0x3e03('0x6'),_0x590dca,_0x33ce4a[_0x3e03('0xb')][_0x3e03('0xd')]);return _0x262714(_0x33ce4a['error'][_0x3e03('0xd')]);}logger[_0x3e03('0xb')](_0x3e03('0x6'),_0x590dca,_0x33ce4a[_0x3e03('0xb')]['message']);return _0x203bc5(_0x33ce4a[_0x3e03('0xb')][_0x3e03('0xd')]);}else{logger[_0x3e03('0x5')](_0x3e03('0x6'),_0x590dca,'request\x20sent');_0x203bc5(_0x33ce4a['result'][_0x3e03('0xd')]);}})[_0x3e03('0xe')](function(_0x29e7b2){logger[_0x3e03('0xb')](_0x3e03('0x6'),_0x590dca,_0x29e7b2);_0x262714(_0x29e7b2);});});}exports[_0x3e03('0xf')]=function(_0x253ebf){var _0x967f15=this;return new Promise(function(_0x3701c4,_0x4aaff8){return db[_0x3e03('0x10')]['update'](_0x253ebf[_0x3e03('0x11')],{'raw':_0x253ebf['options']?_0x253ebf[_0x3e03('0x12')][_0x3e03('0x13')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x253ebf[_0x3e03('0x12')]?_0x253ebf[_0x3e03('0x12')]['where']||null:null,'attributes':_0x253ebf[_0x3e03('0x12')]?_0x253ebf[_0x3e03('0x12')]['attributes']||null:null,'limit':_0x253ebf[_0x3e03('0x12')]?_0x253ebf[_0x3e03('0x12')][_0x3e03('0x14')]||null:null})['then'](function(_0x4f5149){logger[_0x3e03('0x5')]('UpdateFaxApplication',_0x253ebf);logger[_0x3e03('0x8')](_0x3e03('0xf'),_0x253ebf,JSON[_0x3e03('0xa')](_0x4f5149));_0x3701c4(_0x4f5149);})[_0x3e03('0xe')](function(_0x296df8){logger[_0x3e03('0xb')]('UpdateFaxApplication',_0x296df8[_0x3e03('0xd')],_0x253ebf);_0x4aaff8(_0x967f15[_0x3e03('0xb')](0x1f4,_0x296df8[_0x3e03('0xd')]));});});};
\ No newline at end of file
+var _0x48fc=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','UpdateFaxApplication','FaxApplication','update','body','options','raw','where','limit','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x24abae,_0x5c34d8){var _0x8365ac=function(_0x3dd7f2){while(--_0x3dd7f2){_0x24abae['push'](_0x24abae['shift']());}};_0x8365ac(++_0x5c34d8);}(_0x48fc,0x103));var _0xc48f=function(_0x3cfb1c,_0x216580){_0x3cfb1c=_0x3cfb1c-0x0;var _0x531124=_0x48fc[_0x3cfb1c];return _0x531124;};'use strict';var _=require(_0xc48f('0x0'));var util=require(_0xc48f('0x1'));var moment=require('moment');var BPromise=require(_0xc48f('0x2'));var rs=require(_0xc48f('0x3'));var fs=require('fs');var Redis=require(_0xc48f('0x4'));var db=require(_0xc48f('0x5'))['db'];var utils=require(_0xc48f('0x6'));var logger=require(_0xc48f('0x7'))(_0xc48f('0x8'));var config=require(_0xc48f('0x9'));var jayson=require(_0xc48f('0xa'));var client=jayson[_0xc48f('0xb')][_0xc48f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3767bb,_0x16c165,_0x385eb2){return new BPromise(function(_0x24d8ef,_0x214f74){return client['request'](_0x3767bb,_0x385eb2)[_0xc48f('0xd')](function(_0x213fd3){logger['info'](_0xc48f('0xe'),_0x16c165,_0xc48f('0xf'));logger[_0xc48f('0x10')](_0xc48f('0x11'),_0x16c165,_0xc48f('0xf'),JSON[_0xc48f('0x12')](_0x213fd3));if(_0x213fd3[_0xc48f('0x13')]){if(_0x213fd3['error'][_0xc48f('0x14')]===0x1f4){logger[_0xc48f('0x13')](_0xc48f('0xe'),_0x16c165,_0x213fd3[_0xc48f('0x13')][_0xc48f('0x15')]);return _0x214f74(_0x213fd3[_0xc48f('0x13')][_0xc48f('0x15')]);}logger[_0xc48f('0x13')](_0xc48f('0xe'),_0x16c165,_0x213fd3[_0xc48f('0x13')][_0xc48f('0x15')]);return _0x24d8ef(_0x213fd3['error'][_0xc48f('0x15')]);}else{logger[_0xc48f('0x16')]('FaxApplication,\x20%s,\x20%s',_0x16c165,_0xc48f('0xf'));_0x24d8ef(_0x213fd3[_0xc48f('0x17')][_0xc48f('0x15')]);}})['catch'](function(_0x254522){logger[_0xc48f('0x13')](_0xc48f('0xe'),_0x16c165,_0x254522);_0x214f74(_0x254522);});});}exports[_0xc48f('0x18')]=function(_0x48e6fd){var _0x25e163=this;return new Promise(function(_0x133d48,_0x2ea7d8){return db[_0xc48f('0x19')][_0xc48f('0x1a')](_0x48e6fd[_0xc48f('0x1b')],{'raw':_0x48e6fd[_0xc48f('0x1c')]?_0x48e6fd['options'][_0xc48f('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48e6fd[_0xc48f('0x1c')]?_0x48e6fd[_0xc48f('0x1c')][_0xc48f('0x1e')]||null:null,'attributes':_0x48e6fd[_0xc48f('0x1c')]?_0x48e6fd[_0xc48f('0x1c')]['attributes']||null:null,'limit':_0x48e6fd['options']?_0x48e6fd[_0xc48f('0x1c')][_0xc48f('0x1f')]||null:null})[_0xc48f('0xd')](function(_0x2a8107){logger[_0xc48f('0x16')](_0xc48f('0x18'),_0x48e6fd);logger[_0xc48f('0x10')](_0xc48f('0x18'),_0x48e6fd,JSON[_0xc48f('0x12')](_0x2a8107));_0x133d48(_0x2a8107);})[_0xc48f('0x20')](function(_0x13b787){logger[_0xc48f('0x13')]('UpdateFaxApplication',_0x13b787[_0xc48f('0x15')],_0x48e6fd);_0x2ea7d8(_0x25e163[_0xc48f('0x13')](0x1f4,_0x13b787['message']));});});};
\ No newline at end of file
index 4fdbf85..64cc624 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0972=['isAuthenticated','index','show','post','create','/:id','update','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxApplication.controller','get'];(function(_0x5eb447,_0xd7e005){var _0x1758f2=function(_0x2215d4){while(--_0x2215d4){_0x5eb447['push'](_0x5eb447['shift']());}};_0x1758f2(++_0xd7e005);}(_0x0972,0x64));var _0x2097=function(_0x2039c6,_0x5ea21d){_0x2039c6=_0x2039c6-0x0;var _0x41391b=_0x0972[_0x2039c6];return _0x41391b;};'use strict';var multer=require('multer');var util=require(_0x2097('0x0'));var path=require('path');var timeout=require(_0x2097('0x1'));var express=require('express');var router=express[_0x2097('0x2')]();var fs_extra=require(_0x2097('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2097('0x4'));var config=require(_0x2097('0x5'));var controller=require(_0x2097('0x6'));router[_0x2097('0x7')]('/',auth[_0x2097('0x8')](),controller[_0x2097('0x9')]);router[_0x2097('0x7')]('/:id',auth[_0x2097('0x8')](),controller[_0x2097('0xa')]);router[_0x2097('0xb')]('/',auth[_0x2097('0x8')](),controller[_0x2097('0xc')]);router['put'](_0x2097('0xd'),auth[_0x2097('0x8')](),controller[_0x2097('0xe')]);router[_0x2097('0xf')](_0x2097('0xd'),auth[_0x2097('0x8')](),controller[_0x2097('0x10')]);module[_0x2097('0x11')]=router;
\ No newline at end of file
+var _0x4cf8=['show','create','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated'];(function(_0x56c70f,_0x4e4493){var _0x3812ed=function(_0x25460f){while(--_0x25460f){_0x56c70f['push'](_0x56c70f['shift']());}};_0x3812ed(++_0x4e4493);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x4c70c4,_0x963969){_0x4c70c4=_0x4c70c4-0x0;var _0x437865=_0x4cf8[_0x4c70c4];return _0x437865;};'use strict';var multer=require(_0x84cf('0x0'));var util=require(_0x84cf('0x1'));var path=require(_0x84cf('0x2'));var timeout=require(_0x84cf('0x3'));var express=require(_0x84cf('0x4'));var router=express[_0x84cf('0x5')]();var fs_extra=require(_0x84cf('0x6'));var auth=require(_0x84cf('0x7'));var interaction=require(_0x84cf('0x8'));var config=require(_0x84cf('0x9'));var controller=require(_0x84cf('0xa'));router[_0x84cf('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x84cf('0xb')]('/:id',auth[_0x84cf('0xc')](),controller[_0x84cf('0xd')]);router['post']('/',auth[_0x84cf('0xc')](),controller[_0x84cf('0xe')]);router['put'](_0x84cf('0xf'),auth[_0x84cf('0xc')](),controller[_0x84cf('0x10')]);router[_0x84cf('0x11')]('/:id',auth[_0x84cf('0xc')](),controller[_0x84cf('0x12')]);module['exports']=router;
\ No newline at end of file
index 691c42d..fba811c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcdff=['DATE','STRING','ENUM','out','sequelize','BOOLEAN'];(function(_0x564dc2,_0x336945){var _0xebb671=function(_0x27a575){while(--_0x27a575){_0x564dc2['push'](_0x564dc2['shift']());}};_0xebb671(++_0x336945);}(_0xcdff,0x100));var _0xfcdf=function(_0x40e343,_0xda9986){_0x40e343=_0x40e343-0x0;var _0x2db460=_0xcdff[_0x40e343];return _0x2db460;};'use strict';var Sequelize=require(_0xfcdf('0x0'));module['exports']={'closed':{'type':Sequelize[_0xfcdf('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xfcdf('0x2')]},'disposition':{'type':Sequelize[_0xfcdf('0x3')]},'secondDisposition':{'type':Sequelize[_0xfcdf('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xfcdf('0x3')]},'read1stAt':{'type':Sequelize[_0xfcdf('0x2')]},'fax':{'type':Sequelize[_0xfcdf('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xfcdf('0x4')]('in',_0xfcdf('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xfcdf('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xfcdf('0x4')]('in',_0xfcdf('0x5')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0xd8dc=['STRING','ENUM','out','sequelize','exports','BOOLEAN','DATE'];(function(_0x3c7d72,_0x352272){var _0x20abe8=function(_0x2afc3b){while(--_0x2afc3b){_0x3c7d72['push'](_0x3c7d72['shift']());}};_0x20abe8(++_0x352272);}(_0xd8dc,0xd5));var _0xcd8d=function(_0x23d3fb,_0x13ea0a){_0x23d3fb=_0x23d3fb-0x0;var _0x309dc9=_0xd8dc[_0x23d3fb];return _0x309dc9;};'use strict';var Sequelize=require(_0xcd8d('0x0'));module[_0xcd8d('0x1')]={'closed':{'type':Sequelize[_0xcd8d('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xcd8d('0x3')]},'disposition':{'type':Sequelize[_0xcd8d('0x4')]},'secondDisposition':{'type':Sequelize[_0xcd8d('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xcd8d('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0xcd8d('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xcd8d('0x5')]('in',_0xcd8d('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xcd8d('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xcd8d('0x5')]('in',_0xcd8d('0x6')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
index 495432c..06a7d14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2be7=['attributes','length','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','users','u.id\x20=\x20ui.UserId','fax_interactions','left_join','cm_contacts','o.id\x20=\x20i.UserId','fax_accounts','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20>\x200','$substring','value','split','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','type','start','Tag','union','User','operator','text','body','compact','FaxAccountId','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','contactName','isEmpty','i.FaxAccountId\x20IS\x20NOT\x20NULL','role','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','toString','merge','FaxInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','FaxInteractionId','push','params','rawAttributes','includeAll','options','create','describe','FaxMessage','addMessage','ids','omit','findOne','hasOwnProperty','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','spread','faxInteractionTags:save','removeTags','download','unix','join','root','server','files','attachments','transcript-%d-%s.zip','Attachment','Messages','createdAt','get','mkdirSync','createReadStream','pipe','basename','resolve','log','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','apply','save','update','then','destroy','end','error','stack','name','send','Users','map','fullname','Tags','TagIds','forEach','catch','waiting','answered','closed','UserId','talking','index','fieldName','key','model','query','keys','filters','intersection','fields'];(function(_0x33d8d2,_0x5e9312){var _0x112a48=function(_0x42c0a4){while(--_0x42c0a4){_0x33d8d2['push'](_0x33d8d2['shift']());}};_0x112a48(++_0x5e9312);}(_0x2be7,0x171));var _0x72be=function(_0x3a9083,_0x3c9f8d){_0x3a9083=_0x3a9083-0x0;var _0x160306=_0x2be7[_0x3a9083];return _0x160306;};'use strict';var emlformat=require(_0x72be('0x0'));var rimraf=require(_0x72be('0x1'));var zipdir=require(_0x72be('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x72be('0x3'));var moment=require(_0x72be('0x4'));var BPromise=require(_0x72be('0x5'));var Mustache=require(_0x72be('0x6'));var util=require(_0x72be('0x7'));var path=require(_0x72be('0x8'));var sox=require(_0x72be('0x9'));var csv=require(_0x72be('0xa'));var ejs=require(_0x72be('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x72be('0xc'));var squel=require(_0x72be('0xd'));var crypto=require(_0x72be('0xe'));var jsforce=require(_0x72be('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x72be('0xa'));var querystring=require(_0x72be('0x10'));var Papa=require(_0x72be('0x11'));var Redis=require(_0x72be('0x12'));var authService=require(_0x72be('0x13'));var qs=require(_0x72be('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x72be('0x15'));var config=require(_0x72be('0x16'));var licenseUtil=require(_0x72be('0x17'));var db=require(_0x72be('0x18'))['db'];config[_0x72be('0x19')]=_['defaults'](config[_0x72be('0x19')],{'host':_0x72be('0x1a'),'port':0x18eb});var socket=require(_0x72be('0x1b'))(new Redis(config[_0x72be('0x19')]));require('./faxInteraction.socket')[_0x72be('0x1c')](socket);function respondWithStatusCode(_0x4f9572,_0x59897e){_0x59897e=_0x59897e||0xcc;return function(_0x33d56b){if(_0x33d56b){return _0x4f9572[_0x72be('0x1d')](_0x59897e);}return _0x4f9572['status'](_0x59897e)['end']();};}function respondWithResult(_0x507f90,_0x3f1247){_0x3f1247=_0x3f1247||0xc8;return function(_0x18099d){if(_0x18099d){return _0x507f90[_0x72be('0x1e')](_0x3f1247)[_0x72be('0x1f')](_0x18099d);}};}function respondWithFilteredResult(_0x3186de,_0x331836){return function(_0xa97f3d){if(_0xa97f3d){var _0x492bf2=typeof _0x331836[_0x72be('0x20')]===_0x72be('0x21')&&typeof _0x331836[_0x72be('0x22')]===_0x72be('0x21');var _0x335df8=_0xa97f3d[_0x72be('0x23')];var _0x1daf7f=_0x492bf2?0x0:_0x331836[_0x72be('0x20')];var _0x10109e=_0x492bf2?_0xa97f3d[_0x72be('0x23')]:_0x331836['offset']+_0x331836['limit'];var _0x52b821;if(_0x10109e>=_0x335df8){_0x10109e=_0x335df8;_0x52b821=0xc8;}else{_0x52b821=0xce;}_0x3186de[_0x72be('0x1e')](_0x52b821);return _0x3186de['set']('Content-Range',_0x1daf7f+'-'+_0x10109e+'/'+_0x335df8)[_0x72be('0x1f')](_0xa97f3d);}return null;};}function patchUpdates(_0x3fd627){return function(_0x52c156){try{jsonpatch[_0x72be('0x24')](_0x52c156,_0x3fd627,!![]);}catch(_0x2ad50e){return BPromise['reject'](_0x2ad50e);}return _0x52c156[_0x72be('0x25')]();};}function saveUpdates(_0xdcb102,_0x28b1ea){return function(_0x1d7f52){if(_0x1d7f52){return _0x1d7f52[_0x72be('0x26')](_0xdcb102)[_0x72be('0x27')](function(_0x18c8ac){return _0x18c8ac;});}return null;};}function removeEntity(_0x2b5790,_0x2cc912){return function(_0x4cc46a){if(_0x4cc46a){return _0x4cc46a[_0x72be('0x28')]()[_0x72be('0x27')](function(){_0x2b5790[_0x72be('0x1e')](0xcc)[_0x72be('0x29')]();});}};}function handleEntityNotFound(_0x268484,_0x414018){return function(_0x2dfd21){if(!_0x2dfd21){_0x268484[_0x72be('0x1d')](0x194);}return _0x2dfd21;};}function handleError(_0x356309,_0x2c30b8){_0x2c30b8=_0x2c30b8||0x1f4;return function(_0x2963a3){logger[_0x72be('0x2a')](_0x2963a3[_0x72be('0x2b')]);if(_0x2963a3['name']){delete _0x2963a3[_0x72be('0x2c')];}_0x356309[_0x72be('0x1e')](_0x2c30b8)[_0x72be('0x2d')](_0x2963a3);};}function getInteractionUsers(_0x2ee31e,_0x3dbc84){return new BPromise(function(_0x35eda2,_0x5d4fde){try{if(_0x3dbc84[_0x2ee31e['id']]){_0x2ee31e[_0x72be('0x2e')]=_[_0x72be('0x2f')](_0x3dbc84[_0x2ee31e['id']],function(_0xe318ad){return{'id':_0xe318ad['id'],'fullname':_0xe318ad[_0x72be('0x30')]};});}}catch(_0x5ea43b){_0x5d4fde(_0x5ea43b);}_0x35eda2(_0x2ee31e);});}function getInteractionTags(_0x2e5e16,_0x2919b5){return new BPromise(function(_0x227938,_0x4ec869){try{if(_0x2e5e16['TagIds']){_0x2e5e16[_0x72be('0x31')]=[];_0x2e5e16[_0x72be('0x32')]['split'](',')[_0x72be('0x33')](function(_0x402624){_0x2e5e16[_0x72be('0x31')]['push'](_0x2919b5[_0x402624]);});}delete _0x2e5e16[_0x72be('0x32')];}catch(_0x16ee20){_0x4ec869(_0x16ee20);}_0x227938(_0x2e5e16);});}function updateFaxInteraction(_0x5cac70,_0x385b4a,_0x5ddb08){return new BPromise(function(_0x116287,_0x4af44c){return getInteractionUsers(_0x5cac70,_0x5ddb08)[_0x72be('0x27')](function(_0xc92d4d){return getInteractionTags(_0xc92d4d,_0x385b4a);})[_0x72be('0x27')](function(_0x2d2391){return getStateInteraction(_0x2d2391);})['then'](function(_0x69e197){_0x116287(_0x69e197);})[_0x72be('0x34')](function(_0x2eabd3){_0x4af44c(_0x2eabd3);});});}function getStateInteraction(_0x59a7ae){return new BPromise(function(_0x3849c0){_0x59a7ae[_0x72be('0x35')]=0x0;_0x59a7ae['talking']=0x0;_0x59a7ae[_0x72be('0x36')]=0x0;_0x59a7ae['unmanaged']=0x0;_0x59a7ae['total']=0x0;if(!_0x59a7ae[_0x72be('0x37')]&&!_0x59a7ae['UserId']){_0x59a7ae[_0x72be('0x35')]+=0x1;}if(!_0x59a7ae[_0x72be('0x37')]&&_0x59a7ae[_0x72be('0x38')]){_0x59a7ae['talking']+=0x1;if(_0x59a7ae[_0x72be('0x35')]){_0x59a7ae[_0x72be('0x35')]-=0x1;}}if(_0x59a7ae[_0x72be('0x37')]&&_0x59a7ae[_0x72be('0x38')]){_0x59a7ae[_0x72be('0x36')]+=0x1;if(_0x59a7ae[_0x72be('0x39')]){_0x59a7ae[_0x72be('0x39')]-=0x1;}}if(_0x59a7ae[_0x72be('0x37')]&&!_0x59a7ae[_0x72be('0x38')]){_0x59a7ae['unmanaged']+=0x1;if(_0x59a7ae[_0x72be('0x35')]){_0x59a7ae[_0x72be('0x35')]-=0x1;}}_0x59a7ae['total']+=0x1;_0x3849c0(_0x59a7ae);});}exports[_0x72be('0x3a')]=function(_0xbf04bc,_0x1f2c26){var _0x215ee6={},_0x258622={},_0x137f07={'count':0x0,'rows':[]};var _0x507cd9=_[_0x72be('0x2f')](db['FaxInteraction']['rawAttributes'],function(_0x113128){return{'name':_0x113128[_0x72be('0x3b')],'type':_0x113128['type'][_0x72be('0x3c')]};});_0x258622[_0x72be('0x3d')]=_[_0x72be('0x2f')](_0x507cd9,_0x72be('0x2c'));_0x258622[_0x72be('0x3e')]=_[_0x72be('0x3f')](_0xbf04bc[_0x72be('0x3e')]);_0x258622[_0x72be('0x40')]=_[_0x72be('0x41')](_0x258622['model'],_0x258622[_0x72be('0x3e')]);_0x215ee6['attributes']=_[_0x72be('0x41')](_0x258622[_0x72be('0x3d')],qs[_0x72be('0x42')](_0xbf04bc['query'][_0x72be('0x42')]));_0x215ee6['attributes']=_0x215ee6[_0x72be('0x43')][_0x72be('0x44')]?_0x215ee6[_0x72be('0x43')]:_0x258622[_0x72be('0x3d')];if(!_0xbf04bc['query']['hasOwnProperty'](_0x72be('0x45'))){_0x215ee6[_0x72be('0x22')]=qs[_0x72be('0x22')](_0xbf04bc[_0x72be('0x3e')]['limit']);_0x215ee6['offset']=qs['offset'](_0xbf04bc[_0x72be('0x3e')][_0x72be('0x20')]);}_0x215ee6[_0x72be('0x46')]=qs[_0x72be('0x47')](_0xbf04bc[_0x72be('0x3e')][_0x72be('0x47')]);_0x215ee6[_0x72be('0x48')]=qs[_0x72be('0x40')](_[_0x72be('0x49')](_0xbf04bc[_0x72be('0x3e')],_0x258622[_0x72be('0x40')]),_0x507cd9);var _0x56a4d8=[];var _0x3911a7=squel[_0x72be('0x4a')]()[_0x72be('0x4b')]('id')[_0x72be('0x4b')](_0x72be('0x2c'))[_0x72be('0x4b')](_0x72be('0x4c'))[_0x72be('0x4d')](_0x72be('0x4e'));var _0x13e4d7=squel[_0x72be('0x4a')]()[_0x72be('0x4b')](_0x72be('0x4f'))[_0x72be('0x4b')](_0x72be('0x50'))[_0x72be('0x4b')](_0x72be('0x51'))[_0x72be('0x4d')](_0x72be('0x52'),'ui')['left_join'](_0x72be('0x53'),'u',_0x72be('0x54'));var _0x4b7d29=squel[_0x72be('0x4a')]()[_0x72be('0x4d')](_0x72be('0x55'),'i')[_0x72be('0x56')](_0x72be('0x57'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x72be('0x56')](_0x72be('0x53'),'o',_0x72be('0x58'))[_0x72be('0x56')](_0x72be('0x59'),'a','a.id\x20=\x20i.FaxAccountId')[_0x72be('0x56')](_0x72be('0x5a'),'me',_0x72be('0x5b'))['left_join'](_0x72be('0x5c'),'it',_0x72be('0x5d'))[_0x72be('0x56')](_0x72be('0x4e'),'t',_0x72be('0x5e'));var _0x3136a3=squel[_0x72be('0x5f')]();var _0x45c493=[];var _0x4ec14e=squel['expr']();var _0x41aaed;if(_0xbf04bc[_0x72be('0x3e')][_0x72be('0x60')]){_0x41aaed=as[_0x72be('0x61')](_0xbf04bc['query']['search']);var _0x25024f=_0x41aaed[_0x72be('0x62')];for(var _0x1a3d78=0x0;_0x1a3d78<_0x41aaed[_0x72be('0x63')][_0x72be('0x44')];_0x1a3d78++){var _0x53868b=_0x41aaed[_0x72be('0x63')][_0x1a3d78];var _0x4104e5='i';var _0x6048a0=_[_0x72be('0x64')](_0x507cd9,[_0x72be('0x2c'),_0x53868b[_0x72be('0x4b')]]);if(!_0x6048a0){switch(_0x53868b[_0x72be('0x4b')]){case _0x72be('0x65'):if(_0x53868b['value']==0x1){_0x4b7d29[_0x72be('0x66')]('`'+_0x53868b[_0x72be('0x4b')]+'`\x20=\x200');}else{_0x4b7d29[_0x72be('0x66')]('`'+_0x53868b[_0x72be('0x4b')]+_0x72be('0x67'));}break;case'Contact':if(_0x53868b['operator']===_0x72be('0x68')){if(_0x53868b[_0x72be('0x69')][_0x72be('0x6a')]('\x20')[_0x72be('0x44')]>0x1){_0x3136a3[_0x25024f](_0x72be('0x6b'),qs['getFullTextValue'](_0x53868b[_0x72be('0x69')]),null);}else{var _0x18c2a1='%'+_0x53868b[_0x72be('0x69')]+'%';_0x3136a3[_0x25024f](_0x72be('0x6c'),_0x18c2a1,_0x18c2a1,_0x18c2a1);}}else{_0x6048a0=_[_0x72be('0x64')](_0x507cd9,[_0x72be('0x2c'),_0x72be('0x6d')]);_0x53868b[_0x72be('0x4b')]=_0x72be('0x6d');_0xf3e029=as[_0x72be('0x6e')](_0x4104e5,_0x6048a0[_0x72be('0x6f')],_0x53868b);_0x3136a3[_0x25024f](_0xf3e029['text'],_0xf3e029[_0x72be('0x69')][_0x72be('0x70')],_0xf3e029[_0x72be('0x69')][_0x72be('0x29')]);}break;case _0x72be('0x71'):var _0xfa6c9=_0x53868b['value'][_0x72be('0x6a')](',')['map'](function(_0x35ff6c){return Number(_0x35ff6c);});_0xfa6c9[_0x72be('0x33')](function(_0x5b2f73){_0x4ec14e['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5b2f73+',%');});_0x45c493=_[_0x72be('0x72')](_0x45c493,_0xfa6c9);break;case _0x72be('0x73'):if(_0x53868b[_0x72be('0x74')]===_0x72be('0x68')){_0x3136a3[_0x25024f]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x53868b[_0x72be('0x69')]+'%',null);}else{_0x6048a0=_['find'](_0x507cd9,['name',_0x72be('0x38')]);_0x53868b[_0x72be('0x4b')]=_0x72be('0x38');_0xf3e029=as['buildExpression'](_0x4104e5,_0x6048a0[_0x72be('0x6f')],_0x53868b);_0x3136a3[_0x25024f](_0xf3e029[_0x72be('0x75')],_0xf3e029[_0x72be('0x69')][_0x72be('0x70')],_0xf3e029[_0x72be('0x69')]['end']);}break;case _0x72be('0x76'):_0xf3e029=as['buildExpression']('me',null,_0x53868b);_0x3136a3[_0x25024f](_0xf3e029['text'],_0xf3e029[_0x72be('0x69')][_0x72be('0x70')],_0xf3e029[_0x72be('0x69')][_0x72be('0x29')]);break;}}else{var _0xf3e029=as[_0x72be('0x6e')](_0x4104e5,_0x6048a0['type'],_0x53868b);_0x3136a3[_0x25024f](_0xf3e029[_0x72be('0x75')],_0xf3e029[_0x72be('0x69')][_0x72be('0x70')],_0xf3e029['value'][_0x72be('0x29')]);}}}else{var _0x333064=_(_0xbf04bc[_0x72be('0x3e')])[_0x72be('0x3f')]()[_0x72be('0x2f')](function(_0x502b5d){return _['some'](_0x507cd9,[_0x72be('0x2c'),_0x502b5d])?_0x502b5d:undefined;})[_0x72be('0x77')]()[_0x72be('0x69')]();if(!_['isEmpty'](_0x333064)){_0x333064[_0x72be('0x33')](function(_0x301c40){if(_0x301c40===_0x72be('0x78')){_0x4b7d29[_0x72be('0x48')]('i.FaxAccountId\x20IN\x20?',[]['concat'](_0xbf04bc[_0x72be('0x3e')][_0x301c40]));}else if(_0x301c40==='createdAt'){var _0x551650=JSON[_0x72be('0x79')](_0xbf04bc[_0x72be('0x3e')][_0x301c40])[_0x72be('0x7a')];var _0x3aa51b=JSON[_0x72be('0x79')](_0xbf04bc[_0x72be('0x3e')][_0x301c40])[_0x72be('0x7b')];_0x4b7d29[_0x72be('0x48')](_0x72be('0x7c'),_0x551650,_0x3aa51b);}else{if(_0xbf04bc['query'][_0x301c40]===_0x72be('0x7d')){_0x4b7d29[_0x72be('0x48')]('i.'+_0x301c40+_0x72be('0x7e'));}else{_0x4b7d29[_0x72be('0x48')]('i.'+_0x301c40+_0x72be('0x7f'),_0xbf04bc['query'][_0x301c40]);}}});}if(_0xbf04bc[_0x72be('0x3e')]['read']){if(_0xbf04bc['query'][_0x72be('0x80')]==0x1){_0x4b7d29[_0x72be('0x66')](_0x72be('0x81'));}else{_0x4b7d29[_0x72be('0x66')](_0x72be('0x82'));}}if(_0xbf04bc[_0x72be('0x3e')]['tag']){_0x45c493=_[_0x72be('0x83')](_0xbf04bc[_0x72be('0x3e')][_0x72be('0x84')])?_0xbf04bc[_0x72be('0x3e')][_0x72be('0x84')]:new Array(_0xbf04bc[_0x72be('0x3e')][_0x72be('0x84')]);_0x45c493['forEach'](function(_0x364c49){_0x4ec14e['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x364c49+',%');});}if(_0xbf04bc[_0x72be('0x3e')][_0x72be('0x85')]){var _0x44cfb0=_0xbf04bc[_0x72be('0x3e')][_0x72be('0x85')][_0x72be('0x86')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x72be('0x87')](_0x44cfb0)){_0x3136a3['or'](_0x72be('0x88'),_0x44cfb0+'%')['or']('i.fax\x20LIKE\x20?',_0x44cfb0+'%');}_0x3136a3['or'](_0x72be('0x89'),_0x44cfb0+'%');}}_0x4b7d29[_0x72be('0x48')](_0x3136a3);_0x4b7d29[_0x72be('0x8a')](_0x72be('0x8b'));var _0x2c6fde={'type':db[_0x72be('0x8c')][_0x72be('0x8d')][_0x72be('0x8e')],'raw':!![]};var _0x6ba2c6=_0x4b7d29[_0x72be('0x8f')]();_0x6ba2c6['field'](_0x72be('0x8b'));_0x6ba2c6['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x72be('0x65'));if(_0x215ee6[_0x72be('0x46')]){_0x215ee6[_0x72be('0x46')][_0x72be('0x33')](function(_0x606bd2){var _0x43e4ee=_0x606bd2[0x0]===_0x72be('0x90')?_0x606bd2[0x0]:'i.'+_0x606bd2[0x0];_0x4b7d29[_0x72be('0x46')](_0x43e4ee,_0x606bd2[0x1]==='DESC'?![]:!![]);});}if(!_[_0x72be('0x91')](_0x45c493)){_0x4b7d29[_0x72be('0x66')](_0x4ec14e);_0x6ba2c6[_0x72be('0x48')]('t.id\x20IN\x20?',_0x45c493);}BPromise['resolve']()[_0x72be('0x27')](function(){if(!_0x41aaed){if(_0xbf04bc[_0x72be('0x3e')]['FaxAccountId'])return;_0x6ba2c6[_0x72be('0x48')](_0x72be('0x92'));_0x4b7d29[_0x72be('0x48')](_0x72be('0x92'));return;}if(_0xbf04bc['user'][_0x72be('0x93')]!==_0x72be('0x94'))return;return _0xbf04bc['user'][_0x72be('0x95')]({'attributes':['id'],'raw':!![]})['then'](function(_0x419c2f){if(_[_0x72be('0x91')](_0x419c2f)){_0x6ba2c6[_0x72be('0x48')](_0x72be('0x96'));_0x4b7d29[_0x72be('0x48')](_0x72be('0x96'));}else{_0x6ba2c6['where']('i.FaxAccountId\x20IN\x20?',_[_0x72be('0x2f')](_0x419c2f,'id'));_0x4b7d29[_0x72be('0x48')]('i.FaxAccountId\x20IN\x20?',_[_0x72be('0x2f')](_0x419c2f,'id'));}});})['then'](function(){if(_0xbf04bc['user'][_0x72be('0x93')]===_0x72be('0x94')&&!_0x41aaed&&!_0xbf04bc[_0x72be('0x3e')][_0x72be('0x78')])return[];return db['sequelize'][_0x72be('0x3e')](_0x6ba2c6[_0x72be('0x97')](),_0x2c6fde);})[_0x72be('0x27')](function(_0x3dbecb){_0x137f07[_0x72be('0x23')]=_0x3dbecb[_0x72be('0x44')];if(_0x137f07[_0x72be('0x23')]===0x0)return[];return db['sequelize'][_0x72be('0x3e')](_0x3911a7[_0x72be('0x97')](),_0x2c6fde)['then'](function(_0x4091b6){_0x56a4d8=_['keyBy'](_0x4091b6,'id');_0x2c6fde=_[_0x72be('0x98')](_0x2c6fde,{'model':db[_0x72be('0x99')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xbf04bc[_0x72be('0x3e')][_0x72be('0x42')]){_0x215ee6[_0x72be('0x43')][_0x72be('0x33')](function(_0x32ec50){_0x4b7d29[_0x72be('0x4b')]('i.'+_0x32ec50);});}else{_0x4b7d29[_0x72be('0x4b')](_0x72be('0x9a'),_0x72be('0x65'));_0x4b7d29['field'](_0x72be('0x9b'),_0x72be('0x9c'));_0x4b7d29[_0x72be('0x4b')]('a.mandatoryDisposition',_0x72be('0x9d'));_0x4b7d29[_0x72be('0x4b')](_0x72be('0x9e'),'contactName');_0x4b7d29[_0x72be('0x4b')](_0x72be('0x9f'));_0x4b7d29[_0x72be('0x4b')](_0x72be('0xa0'),_0x72be('0xa1'));_0x4b7d29[_0x72be('0x4b')](_0x72be('0xa2'),_0x72be('0xa3'));_0x4b7d29['field'](_0x72be('0xa4'),_0x72be('0xa5'));_0x4b7d29[_0x72be('0x4b')]('c.phone',_0x72be('0xa6'));_0x4b7d29[_0x72be('0x4b')](_0x72be('0xa7'),'Contact.mobile');_0x4b7d29['field'](_0x72be('0xa8'),_0x72be('0xa9'));_0x4b7d29['field'](_0x72be('0xaa'),_0x72be('0xab'));_0x4b7d29[_0x72be('0x4b')](_0x72be('0xac'),_0x72be('0xad'));_0x4b7d29[_0x72be('0x4b')](_0x72be('0xae'),_0x72be('0x32'));}if(_0x215ee6['limit'])_0x4b7d29[_0x72be('0x22')](_0x215ee6[_0x72be('0x22')]);if(_0x215ee6[_0x72be('0x20')])_0x4b7d29['offset'](_0x215ee6[_0x72be('0x20')]);return db['sequelize'][_0x72be('0x3e')](_0x4b7d29[_0x72be('0x97')](),_0x2c6fde);})['then'](function(_0x806a64){if(_0x806a64[_0x72be('0x44')]>0x0)_0x13e4d7[_0x72be('0x48')](_0x72be('0xaf'),_['map'](_0x806a64,'id'));return db['sequelize'][_0x72be('0x3e')](_0x13e4d7[_0x72be('0x97')](),_0x2c6fde)[_0x72be('0x27')](function(_0x42e0b7){var _0x31e115=_['groupBy'](_0x42e0b7,_0x72be('0xb0'));var _0xe0eb38=[];_0x806a64[_0x72be('0x33')](function(_0x3fb3c2){_0xe0eb38[_0x72be('0xb1')](updateFaxInteraction(_0x3fb3c2,_0x56a4d8,_0x31e115));});return BPromise['all'](_0xe0eb38);});});})[_0x72be('0x27')](function(_0x1e5945){_0x137f07['rows']=_0x1e5945;return _0x137f07;})[_0x72be('0x27')](respondWithFilteredResult(_0x1f2c26,_0x215ee6))['catch'](handleError(_0x1f2c26,null));};exports['show']=function(_0x11e393,_0x58748f){var _0x2b8b58={'raw':![],'where':{'id':_0x11e393[_0x72be('0xb2')]['id']}},_0x15a848={};_0x15a848[_0x72be('0x3d')]=_[_0x72be('0x3f')](db['FaxInteraction'][_0x72be('0xb3')]);_0x15a848[_0x72be('0x3e')]=_[_0x72be('0x3f')](_0x11e393[_0x72be('0x3e')]);_0x15a848[_0x72be('0x40')]=_[_0x72be('0x41')](_0x15a848[_0x72be('0x3d')],_0x15a848[_0x72be('0x3e')]);_0x2b8b58['attributes']=_[_0x72be('0x41')](_0x15a848[_0x72be('0x3d')],qs[_0x72be('0x42')](_0x11e393[_0x72be('0x3e')][_0x72be('0x42')]));_0x2b8b58['attributes']=_0x2b8b58[_0x72be('0x43')]['length']?_0x2b8b58[_0x72be('0x43')]:_0x15a848[_0x72be('0x3d')];if(_0x11e393['query'][_0x72be('0xb4')]){_0x2b8b58['include']=[{'all':!![]}];}_0x2b8b58=_['merge']({},_0x2b8b58,_0x11e393[_0x72be('0xb5')]);return db[_0x72be('0x99')][_0x72be('0x64')](_0x2b8b58)[_0x72be('0x27')](handleEntityNotFound(_0x58748f,null))['then'](respondWithResult(_0x58748f,null))['catch'](handleError(_0x58748f,null));};exports[_0x72be('0xb6')]=function(_0x4fdfa4,_0x300b66){return db[_0x72be('0x99')][_0x72be('0xb6')](_0x4fdfa4['body'],{})[_0x72be('0x27')](respondWithResult(_0x300b66,0xc9))[_0x72be('0x34')](handleError(_0x300b66,null));};exports[_0x72be('0x26')]=function(_0xd5ab36,_0x2fdce3){if(_0xd5ab36[_0x72be('0x76')]['id']){delete _0xd5ab36[_0x72be('0x76')]['id'];}return db['FaxInteraction'][_0x72be('0x64')]({'where':{'id':_0xd5ab36[_0x72be('0xb2')]['id']}})[_0x72be('0x27')](handleEntityNotFound(_0x2fdce3,null))[_0x72be('0x27')](saveUpdates(_0xd5ab36[_0x72be('0x76')],null))[_0x72be('0x27')](respondWithResult(_0x2fdce3,null))[_0x72be('0x34')](handleError(_0x2fdce3,null));};exports['destroy']=function(_0x3c8fd6,_0x1a5dd6){return db['FaxInteraction']['find']({'where':{'id':_0x3c8fd6[_0x72be('0xb2')]['id']}})[_0x72be('0x27')](handleEntityNotFound(_0x1a5dd6,null))[_0x72be('0x27')](removeEntity(_0x1a5dd6,null))[_0x72be('0x34')](handleError(_0x1a5dd6,null));};exports[_0x72be('0xb7')]=function(_0x24aa7e,_0xeda9a2){return db[_0x72be('0x99')][_0x72be('0xb7')]()[_0x72be('0x27')](respondWithResult(_0xeda9a2,null))[_0x72be('0x34')](handleError(_0xeda9a2,null));};exports['addMessage']=function(_0x49fd67,_0x44d815,_0x10c1c3){return db[_0x72be('0xb8')][_0x72be('0x64')]({'where':{'id':_0x49fd67[_0x72be('0xb2')]['id']}})[_0x72be('0x27')](handleEntityNotFound(_0x44d815,null))['then'](function(_0x7d8221){if(_0x7d8221){return _0x7d8221[_0x72be('0xb9')](_0x49fd67[_0x72be('0x76')][_0x72be('0xba')],_[_0x72be('0xbb')](_0x49fd67[_0x72be('0x76')],[_0x72be('0xba'),'id'])||{});}})['then'](respondWithResult(_0x44d815,null))[_0x72be('0x34')](handleError(_0x44d815,null));};exports['getMessages']=function(_0x8fa705,_0x23c333,_0x3adeeb){var _0x2b3067={'raw':![],'where':{}};var _0x178800={};var _0xe68717={'count':0x0,'rows':[]};return db[_0x72be('0x99')][_0x72be('0xbc')]({'where':{'id':_0x8fa705['params']['id']}})[_0x72be('0x27')](handleEntityNotFound(_0x23c333,null))[_0x72be('0x27')](function(_0x45e4da){if(_0x45e4da){_0x178800[_0x72be('0x3d')]=_['keys'](db['FaxMessage'][_0x72be('0xb3')]);_0x178800[_0x72be('0x3e')]=_[_0x72be('0x3f')](_0x8fa705['query']);_0x178800['filters']=_[_0x72be('0x41')](_0x178800[_0x72be('0x3d')],_0x178800[_0x72be('0x3e')]);_0x2b3067[_0x72be('0x43')]=_[_0x72be('0x41')](_0x178800[_0x72be('0x3d')],qs['fields'](_0x8fa705[_0x72be('0x3e')][_0x72be('0x42')]));_0x2b3067[_0x72be('0x43')]=_0x2b3067['attributes'][_0x72be('0x44')]?_0x2b3067[_0x72be('0x43')]:_0x178800[_0x72be('0x3d')];if(!_0x8fa705['query'][_0x72be('0xbd')](_0x72be('0x45'))){_0x2b3067[_0x72be('0x22')]=qs['limit'](_0x8fa705[_0x72be('0x3e')][_0x72be('0x22')]);_0x2b3067[_0x72be('0x20')]=qs[_0x72be('0x20')](_0x8fa705[_0x72be('0x3e')][_0x72be('0x20')]);}_0x2b3067[_0x72be('0x46')]=qs[_0x72be('0x47')](_0x8fa705[_0x72be('0x3e')][_0x72be('0x47')]);_0x2b3067[_0x72be('0x48')]=qs[_0x72be('0x40')](_[_0x72be('0x49')](_0x8fa705['query'],_0x178800[_0x72be('0x40')]));_0x2b3067['where'][_0x72be('0xb0')]=_0x45e4da['id'];if(_0x8fa705['query'][_0x72be('0x85')]){_0x2b3067[_0x72be('0x48')]=_[_0x72be('0x98')](_0x2b3067['where'],{'$or':_[_0x72be('0x2f')](_0x2b3067[_0x72be('0x43')],function(_0x287444){var _0x2db74b={};_0x2db74b[_0x287444]={'$like':'%'+_0x8fa705[_0x72be('0x3e')]['filter']+'%'};return _0x2db74b;})});}if(_0x8fa705[_0x72be('0x3e')]['$gte']){var _0x2790c4=_0x8fa705['query']['$gte'][_0x72be('0x6a')](',');var _0x3bf44b={};_0x3bf44b[_0x2790c4[0x0]]={'$gte':moment(_0x2790c4[0x1])[_0x72be('0xbe')](_0x72be('0xbf'))};_0x2b3067[_0x72be('0x48')]=_[_0x72be('0x98')](_0x2b3067[_0x72be('0x48')],_0x3bf44b);}_0x2b3067=_[_0x72be('0x98')]({},_0x2b3067,_0x8fa705['options']);return db[_0x72be('0xb8')][_0x72be('0x23')]({'where':_0x2b3067[_0x72be('0x48')]})[_0x72be('0x27')](function(_0x2add24){_0xe68717['count']=_0x2add24;if(_0x8fa705['query']['includeAll']){_0x2b3067['include']=[{'all':!![]}];}return db[_0x72be('0xb8')][_0x72be('0xc0')](_0x2b3067);})[_0x72be('0x27')](function(_0x4be93f){_0xe68717[_0x72be('0xc1')]=_0x4be93f;return _0xe68717;});}})[_0x72be('0x27')](respondWithFilteredResult(_0x23c333,_0x2b3067))['catch'](handleError(_0x23c333,null));};exports[_0x72be('0xc2')]=function(_0x52e6a9,_0x38dafc,_0x5d4224){return db['FaxInteraction']['find']({'where':{'id':_0x52e6a9['params']['id']}})['then'](handleEntityNotFound(_0x38dafc,null))[_0x72be('0x27')](function(_0x30f049){if(_0x30f049){return _0x30f049[_0x72be('0xc3')](_0x52e6a9[_0x72be('0x76')]['ids'],_[_0x72be('0xbb')](_0x52e6a9[_0x72be('0x76')],['ids','id'])||{})[_0x72be('0xc4')](function(){return db[_0x72be('0x71')][_0x72be('0xc0')]({'attributes':['id',_0x72be('0x2c'),_0x72be('0x4c')],'where':{'id':_0x52e6a9['body'][_0x72be('0xba')]}});})[_0x72be('0x27')](function(_0x11214e){socket['emit'](_0x72be('0xc5'),{'id':Number(_0x52e6a9[_0x72be('0xb2')]['id']),'tags':_0x11214e||[]});return{'id':Number(_0x52e6a9['params']['id']),'tags':_0x11214e||[]};});}})['then'](respondWithResult(_0x38dafc,null))[_0x72be('0x34')](handleError(_0x38dafc,null));};exports[_0x72be('0xc6')]=function(_0xad2370,_0x1871b6,_0x26a070){return db[_0x72be('0x99')][_0x72be('0x64')]({'where':{'id':_0xad2370[_0x72be('0xb2')]['id']}})[_0x72be('0x27')](handleEntityNotFound(_0x1871b6,null))[_0x72be('0x27')](function(_0x14c66f){if(_0x14c66f){return _0x14c66f['removeTags'](_0xad2370[_0x72be('0x3e')]['ids']);}})[_0x72be('0x27')](respondWithStatusCode(_0x1871b6,null))[_0x72be('0x34')](handleError(_0x1871b6,null));};exports[_0x72be('0xc7')]=function(_0x41c107,_0x1822a5){var _0x908f91=moment()[_0x72be('0xc8')]()[_0x72be('0x97')]();var _0x2a5138=path[_0x72be('0xc9')](config[_0x72be('0xca')],_0x72be('0xcb'),'files','tmp');var _0x4a9e68=path[_0x72be('0xc9')](config['root'],_0x72be('0xcb'),_0x72be('0xcc'),_0x72be('0xcd'));var _0x5a10b9=path[_0x72be('0xc9')](_0x2a5138,_0x908f91);var _0xd8a854=util[_0x72be('0xbe')](_0x72be('0xce'),_0x41c107[_0x72be('0xb2')]['id'],_0x908f91);var _0x43d077=path[_0x72be('0xc9')](_0x2a5138,_0xd8a854);var _0x4b8302=[];_0x4b8302[_0x72be('0xb1')]({'model':db[_0x72be('0xcf')],'as':_0x72be('0xcf'),'raw':!![]});var _0x47f9bb=[{'model':db[_0x72be('0xb8')],'as':_0x72be('0xd0'),'attributes':['id',_0x72be('0x76'),_0x72be('0xd1')],'include':_0x4b8302}];return db[_0x72be('0x99')][_0x72be('0x64')]({'where':{'id':_0x41c107[_0x72be('0xb2')]['id']},'include':_0x47f9bb})['then'](handleEntityNotFound(_0x1822a5,null))[_0x72be('0x27')](function(_0xb798ad){if(_0xb798ad&&_0xb798ad[_0x72be('0xd0')]){var _0x9e6324=_0xb798ad[_0x72be('0xd2')]({'plain':!![]});fs[_0x72be('0xd3')](_0x5a10b9);for(var _0x29e238=0x0;_0x29e238<_0x9e6324['Messages']['length'];_0x29e238++){var _0x5d5be2=_0x9e6324[_0x72be('0xd0')][_0x29e238][_0x72be('0xcf')];if(_0x5d5be2){var _0x373bfc=path['join'](_0x4a9e68,_0x5d5be2['basename']);if(fs['existsSync'](_0x373bfc)){fs[_0x72be('0xd4')](_0x373bfc)[_0x72be('0xd5')](fs['createWriteStream'](path[_0x72be('0xc9')](_0x5a10b9,_0x5d5be2[_0x72be('0xd6')])));}}}return BPromise[_0x72be('0xd7')]()[_0x72be('0x27')](function(){return new BPromise(function(_0x348c58,_0xaae985){zipdir(_0x5a10b9,{'saveTo':_0x43d077},function(_0x171bb0,_0x45d3b1){if(_0x171bb0)return _0xaae985(_0x171bb0);return _0x348c58(_0x45d3b1);});})[_0x72be('0x27')](function(){return new BPromise(function(_0xf6eeaa,_0x1e570e){rimraf(_0x5a10b9,function(_0x20d88e){if(_0x20d88e)_0x1e570e(_0x20d88e);return _0xf6eeaa();});});})[_0x72be('0x27')](function(){return _0x1822a5[_0x72be('0xc7')](_0x43d077,_0xd8a854,function(_0x37b602){if(_0x37b602){console[_0x72be('0xd8')]('err',_0x37b602);}else{fs[_0x72be('0xd9')](_0x43d077);}});});});}else{return _0x1822a5['sendStatus'](0xc8);}})['catch'](handleError(_0x1822a5,null));};
\ No newline at end of file
+var _0x66e7=['omit','getMessages','findOne','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','addTags','ids','spread','findAll','emit','removeTags','download','unix','join','root','server','tmp','files','attachments','format','transcript-%d-%s.zip','createdAt','Messages','get','mkdirSync','Attachment','basename','createReadStream','createWriteStream','log','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','error','stack','name','send','Users','map','fullname','Tags','TagIds','forEach','push','catch','waiting','talking','answered','total','closed','UserId','FaxInteraction','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','select','field','color','tools_tags','ui.FaxInteractionId','from','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','type','text','start','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','parse','$gte','$lte','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','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','i.*','c.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','ui.FaxInteractionId\x20IN\x20?','toString','groupBy','FaxInteractionId','all','rows','show','params','include','merge','create','update','describe','addMessage','FaxMessage'];(function(_0x4921a7,_0x5286c8){var _0x4d1442=function(_0x21d884){while(--_0x21d884){_0x4921a7['push'](_0x4921a7['shift']());}};_0x4d1442(++_0x5286c8);}(_0x66e7,0x106));var _0x766e=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x66e7[_0x4fbfd9];return _0x31dc94;};'use strict';var emlformat=require(_0x766e('0x0'));var rimraf=require(_0x766e('0x1'));var zipdir=require(_0x766e('0x2'));var jsonpatch=require(_0x766e('0x3'));var rp=require(_0x766e('0x4'));var moment=require(_0x766e('0x5'));var BPromise=require(_0x766e('0x6'));var Mustache=require(_0x766e('0x7'));var util=require(_0x766e('0x8'));var path=require(_0x766e('0x9'));var sox=require(_0x766e('0xa'));var csv=require(_0x766e('0xb'));var ejs=require(_0x766e('0xc'));var fs=require('fs');var fs_extra=require(_0x766e('0xd'));var _=require(_0x766e('0xe'));var squel=require(_0x766e('0xf'));var crypto=require('crypto');var jsforce=require(_0x766e('0x10'));var deskjs=require(_0x766e('0x11'));var toCsv=require(_0x766e('0xb'));var querystring=require(_0x766e('0x12'));var Papa=require(_0x766e('0x13'));var Redis=require(_0x766e('0x14'));var authService=require(_0x766e('0x15'));var qs=require(_0x766e('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x766e('0x17'))(_0x766e('0x18'));var utils=require(_0x766e('0x19'));var config=require(_0x766e('0x1a'));var licenseUtil=require(_0x766e('0x1b'));var db=require(_0x766e('0x1c'))['db'];config[_0x766e('0x1d')]=_[_0x766e('0x1e')](config['redis'],{'host':_0x766e('0x1f'),'port':0x18eb});var socket=require(_0x766e('0x20'))(new Redis(config['redis']));require(_0x766e('0x21'))['register'](socket);function respondWithStatusCode(_0x33c294,_0x25a327){_0x25a327=_0x25a327||0xcc;return function(_0xa44345){if(_0xa44345){return _0x33c294[_0x766e('0x22')](_0x25a327);}return _0x33c294['status'](_0x25a327)[_0x766e('0x23')]();};}function respondWithResult(_0x1689d0,_0x3114a5){_0x3114a5=_0x3114a5||0xc8;return function(_0x1df9e4){if(_0x1df9e4){return _0x1689d0[_0x766e('0x24')](_0x3114a5)[_0x766e('0x25')](_0x1df9e4);}};}function respondWithFilteredResult(_0x172612,_0x46c77d){return function(_0x4f8bbf){if(_0x4f8bbf){var _0x412159=typeof _0x46c77d[_0x766e('0x26')]===_0x766e('0x27')&&typeof _0x46c77d[_0x766e('0x28')]===_0x766e('0x27');var _0x228bf7=_0x4f8bbf[_0x766e('0x29')];var _0x1a9746=_0x412159?0x0:_0x46c77d[_0x766e('0x26')];var _0x33b2e4=_0x412159?_0x4f8bbf[_0x766e('0x29')]:_0x46c77d[_0x766e('0x26')]+_0x46c77d['limit'];var _0x275b96;if(_0x33b2e4>=_0x228bf7){_0x33b2e4=_0x228bf7;_0x275b96=0xc8;}else{_0x275b96=0xce;}_0x172612[_0x766e('0x24')](_0x275b96);return _0x172612['set'](_0x766e('0x2a'),_0x1a9746+'-'+_0x33b2e4+'/'+_0x228bf7)['json'](_0x4f8bbf);}return null;};}function patchUpdates(_0x471119){return function(_0x271362){try{jsonpatch[_0x766e('0x2b')](_0x271362,_0x471119,!![]);}catch(_0x3b23d2){return BPromise[_0x766e('0x2c')](_0x3b23d2);}return _0x271362[_0x766e('0x2d')]();};}function saveUpdates(_0x48ee78,_0x2ae952){return function(_0x40ff9a){if(_0x40ff9a){return _0x40ff9a['update'](_0x48ee78)[_0x766e('0x2e')](function(_0x2fb16b){return _0x2fb16b;});}return null;};}function removeEntity(_0x2dab94,_0x4e13ec){return function(_0x276d47){if(_0x276d47){return _0x276d47['destroy']()[_0x766e('0x2e')](function(){_0x2dab94[_0x766e('0x24')](0xcc)[_0x766e('0x23')]();});}};}function handleEntityNotFound(_0x20c46c,_0x109431){return function(_0x2bb219){if(!_0x2bb219){_0x20c46c[_0x766e('0x22')](0x194);}return _0x2bb219;};}function handleError(_0x32e1f7,_0x3a5703){_0x3a5703=_0x3a5703||0x1f4;return function(_0x4d10dd){logger[_0x766e('0x2f')](_0x4d10dd[_0x766e('0x30')]);if(_0x4d10dd[_0x766e('0x31')]){delete _0x4d10dd['name'];}_0x32e1f7[_0x766e('0x24')](_0x3a5703)[_0x766e('0x32')](_0x4d10dd);};}function getInteractionUsers(_0x14a0cb,_0xc0a045){return new BPromise(function(_0x391384,_0x4e04cb){try{if(_0xc0a045[_0x14a0cb['id']]){_0x14a0cb[_0x766e('0x33')]=_[_0x766e('0x34')](_0xc0a045[_0x14a0cb['id']],function(_0x4d765b){return{'id':_0x4d765b['id'],'fullname':_0x4d765b[_0x766e('0x35')]};});}}catch(_0x1329cd){_0x4e04cb(_0x1329cd);}_0x391384(_0x14a0cb);});}function getInteractionTags(_0x16857e,_0x44136c){return new BPromise(function(_0x1b8988,_0x10bbbd){try{if(_0x16857e['TagIds']){_0x16857e[_0x766e('0x36')]=[];_0x16857e[_0x766e('0x37')]['split'](',')[_0x766e('0x38')](function(_0x53c402){_0x16857e[_0x766e('0x36')][_0x766e('0x39')](_0x44136c[_0x53c402]);});}delete _0x16857e[_0x766e('0x37')];}catch(_0xb02fb){_0x10bbbd(_0xb02fb);}_0x1b8988(_0x16857e);});}function updateFaxInteraction(_0x4cbd69,_0x130a21,_0x13b831){return new BPromise(function(_0x18b1a3,_0x43bd7f){return getInteractionUsers(_0x4cbd69,_0x13b831)[_0x766e('0x2e')](function(_0x4a9cb6){return getInteractionTags(_0x4a9cb6,_0x130a21);})['then'](function(_0x122812){return getStateInteraction(_0x122812);})[_0x766e('0x2e')](function(_0x37108d){_0x18b1a3(_0x37108d);})[_0x766e('0x3a')](function(_0x144687){_0x43bd7f(_0x144687);});});}function getStateInteraction(_0x2292a7){return new BPromise(function(_0x36417d){_0x2292a7[_0x766e('0x3b')]=0x0;_0x2292a7[_0x766e('0x3c')]=0x0;_0x2292a7[_0x766e('0x3d')]=0x0;_0x2292a7['unmanaged']=0x0;_0x2292a7[_0x766e('0x3e')]=0x0;if(!_0x2292a7[_0x766e('0x3f')]&&!_0x2292a7['UserId']){_0x2292a7[_0x766e('0x3b')]+=0x1;}if(!_0x2292a7[_0x766e('0x3f')]&&_0x2292a7[_0x766e('0x40')]){_0x2292a7['talking']+=0x1;if(_0x2292a7[_0x766e('0x3b')]){_0x2292a7[_0x766e('0x3b')]-=0x1;}}if(_0x2292a7['closed']&&_0x2292a7['UserId']){_0x2292a7[_0x766e('0x3d')]+=0x1;if(_0x2292a7['talking']){_0x2292a7[_0x766e('0x3c')]-=0x1;}}if(_0x2292a7[_0x766e('0x3f')]&&!_0x2292a7[_0x766e('0x40')]){_0x2292a7['unmanaged']+=0x1;if(_0x2292a7[_0x766e('0x3b')]){_0x2292a7[_0x766e('0x3b')]-=0x1;}}_0x2292a7['total']+=0x1;_0x36417d(_0x2292a7);});}exports['index']=function(_0x3e5002,_0x4e467){var _0x50f3ef={},_0x4f8872={},_0x2faff9={'count':0x0,'rows':[]};var _0x49d1f0=_[_0x766e('0x34')](db[_0x766e('0x41')][_0x766e('0x42')],function(_0x44b8b4){return{'name':_0x44b8b4[_0x766e('0x43')],'type':_0x44b8b4['type']['key']};});_0x4f8872['model']=_[_0x766e('0x34')](_0x49d1f0,_0x766e('0x31'));_0x4f8872[_0x766e('0x44')]=_[_0x766e('0x45')](_0x3e5002[_0x766e('0x44')]);_0x4f8872[_0x766e('0x46')]=_[_0x766e('0x47')](_0x4f8872[_0x766e('0x48')],_0x4f8872[_0x766e('0x44')]);_0x50f3ef[_0x766e('0x49')]=_[_0x766e('0x47')](_0x4f8872['model'],qs['fields'](_0x3e5002[_0x766e('0x44')][_0x766e('0x4a')]));_0x50f3ef['attributes']=_0x50f3ef['attributes'][_0x766e('0x4b')]?_0x50f3ef[_0x766e('0x49')]:_0x4f8872['model'];if(!_0x3e5002[_0x766e('0x44')]['hasOwnProperty'](_0x766e('0x4c'))){_0x50f3ef[_0x766e('0x28')]=qs[_0x766e('0x28')](_0x3e5002['query'][_0x766e('0x28')]);_0x50f3ef[_0x766e('0x26')]=qs[_0x766e('0x26')](_0x3e5002[_0x766e('0x44')][_0x766e('0x26')]);}_0x50f3ef[_0x766e('0x4d')]=qs['sort'](_0x3e5002[_0x766e('0x44')][_0x766e('0x4e')]);_0x50f3ef[_0x766e('0x4f')]=qs[_0x766e('0x46')](_[_0x766e('0x50')](_0x3e5002[_0x766e('0x44')],_0x4f8872[_0x766e('0x46')]),_0x49d1f0);var _0x301904=[];var _0x2cba41=squel[_0x766e('0x51')]()[_0x766e('0x52')]('id')[_0x766e('0x52')]('name')[_0x766e('0x52')](_0x766e('0x53'))['from'](_0x766e('0x54'));var _0xd6b99b=squel[_0x766e('0x51')]()['field']('u.id')['field']('u.fullname')['field'](_0x766e('0x55'))[_0x766e('0x56')]('user_has_fax_interactions','ui')[_0x766e('0x57')](_0x766e('0x58'),'u',_0x766e('0x59'));var _0x9faaca=squel[_0x766e('0x51')]()[_0x766e('0x56')](_0x766e('0x5a'),'i')[_0x766e('0x57')](_0x766e('0x5b'),'c',_0x766e('0x5c'))[_0x766e('0x57')](_0x766e('0x58'),'o',_0x766e('0x5d'))[_0x766e('0x57')](_0x766e('0x5e'),'a',_0x766e('0x5f'))[_0x766e('0x57')]('fax_messages','me',_0x766e('0x60'))[_0x766e('0x57')](_0x766e('0x61'),'it',_0x766e('0x62'))[_0x766e('0x57')](_0x766e('0x54'),'t',_0x766e('0x63'));var _0x5e6a59=squel[_0x766e('0x64')]();var _0x4e3f9a=[];var _0x227e43=squel['expr']();var _0x6641d;if(_0x3e5002[_0x766e('0x44')]['search']){_0x6641d=as[_0x766e('0x65')](_0x3e5002[_0x766e('0x44')][_0x766e('0x66')]);var _0x596d03=_0x6641d[_0x766e('0x67')];for(var _0x503d4b=0x0;_0x503d4b<_0x6641d['conditions'][_0x766e('0x4b')];_0x503d4b++){var _0x50069d=_0x6641d[_0x766e('0x68')][_0x503d4b];var _0x117823='i';var _0x33089b=_[_0x766e('0x69')](_0x49d1f0,[_0x766e('0x31'),_0x50069d['field']]);if(!_0x33089b){switch(_0x50069d[_0x766e('0x52')]){case _0x766e('0x6a'):if(_0x50069d[_0x766e('0x6b')]==0x1){_0x9faaca[_0x766e('0x6c')]('`'+_0x50069d[_0x766e('0x52')]+_0x766e('0x6d'));}else{_0x9faaca[_0x766e('0x6c')]('`'+_0x50069d[_0x766e('0x52')]+_0x766e('0x6e'));}break;case _0x766e('0x6f'):if(_0x50069d[_0x766e('0x70')]===_0x766e('0x71')){if(_0x50069d[_0x766e('0x6b')][_0x766e('0x72')]('\x20')[_0x766e('0x4b')]>0x1){_0x5e6a59[_0x596d03](_0x766e('0x73'),qs[_0x766e('0x74')](_0x50069d['value']),null);}else{var _0x2c377b='%'+_0x50069d[_0x766e('0x6b')]+'%';_0x5e6a59[_0x596d03]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x2c377b,_0x2c377b,_0x2c377b);}}else{_0x33089b=_['find'](_0x49d1f0,[_0x766e('0x31'),_0x766e('0x75')]);_0x50069d['field']='ContactId';_0x2f96ea=as[_0x766e('0x76')](_0x117823,_0x33089b[_0x766e('0x77')],_0x50069d);_0x5e6a59[_0x596d03](_0x2f96ea[_0x766e('0x78')],_0x2f96ea['value'][_0x766e('0x79')],_0x2f96ea['value']['end']);}break;case _0x766e('0x7a'):var _0x3f6b5d=_0x50069d[_0x766e('0x6b')]['split'](',')['map'](function(_0x1aa36e){return Number(_0x1aa36e);});_0x3f6b5d[_0x766e('0x38')](function(_0x4b18ea){_0x227e43['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4b18ea+',%');});_0x4e3f9a=_[_0x766e('0x7b')](_0x4e3f9a,_0x3f6b5d);break;case _0x766e('0x7c'):if(_0x50069d[_0x766e('0x70')]===_0x766e('0x71')){_0x5e6a59[_0x596d03](_0x766e('0x7d'),'%'+_0x50069d[_0x766e('0x6b')]+'%',null);}else{_0x33089b=_['find'](_0x49d1f0,['name',_0x766e('0x40')]);_0x50069d['field']=_0x766e('0x40');_0x2f96ea=as[_0x766e('0x76')](_0x117823,_0x33089b[_0x766e('0x77')],_0x50069d);_0x5e6a59[_0x596d03](_0x2f96ea[_0x766e('0x78')],_0x2f96ea['value']['start'],_0x2f96ea[_0x766e('0x6b')][_0x766e('0x23')]);}break;case _0x766e('0x7e'):_0x2f96ea=as[_0x766e('0x76')]('me',null,_0x50069d);_0x5e6a59[_0x596d03](_0x2f96ea[_0x766e('0x78')],_0x2f96ea[_0x766e('0x6b')]['start'],_0x2f96ea[_0x766e('0x6b')]['end']);break;}}else{var _0x2f96ea=as[_0x766e('0x76')](_0x117823,_0x33089b[_0x766e('0x77')],_0x50069d);_0x5e6a59[_0x596d03](_0x2f96ea['text'],_0x2f96ea[_0x766e('0x6b')][_0x766e('0x79')],_0x2f96ea[_0x766e('0x6b')][_0x766e('0x23')]);}}}else{var _0x2fd4f4=_(_0x3e5002[_0x766e('0x44')])['keys']()[_0x766e('0x34')](function(_0x11456d){return _[_0x766e('0x7f')](_0x49d1f0,[_0x766e('0x31'),_0x11456d])?_0x11456d:undefined;})[_0x766e('0x80')]()[_0x766e('0x6b')]();if(!_[_0x766e('0x81')](_0x2fd4f4)){_0x2fd4f4[_0x766e('0x38')](function(_0xa9c2a4){if(_0xa9c2a4===_0x766e('0x82')){_0x9faaca[_0x766e('0x4f')](_0x766e('0x83'),[][_0x766e('0x84')](_0x3e5002[_0x766e('0x44')][_0xa9c2a4]));}else if(_0xa9c2a4==='createdAt'){var _0x240ca4=JSON[_0x766e('0x85')](_0x3e5002[_0x766e('0x44')][_0xa9c2a4])[_0x766e('0x86')];var _0x44582e=JSON['parse'](_0x3e5002[_0x766e('0x44')][_0xa9c2a4])[_0x766e('0x87')];_0x9faaca[_0x766e('0x4f')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x240ca4,_0x44582e);}else{if(_0x3e5002[_0x766e('0x44')][_0xa9c2a4]===_0x766e('0x88')){_0x9faaca['where']('i.'+_0xa9c2a4+'\x20IS\x20NULL');}else{_0x9faaca[_0x766e('0x4f')]('i.'+_0xa9c2a4+_0x766e('0x89'),_0x3e5002[_0x766e('0x44')][_0xa9c2a4]);}}});}if(_0x3e5002['query'][_0x766e('0x8a')]){if(_0x3e5002['query'][_0x766e('0x8a')]==0x1){_0x9faaca['having'](_0x766e('0x8b'));}else{_0x9faaca[_0x766e('0x6c')](_0x766e('0x8c'));}}if(_0x3e5002[_0x766e('0x44')][_0x766e('0x8d')]){_0x4e3f9a=_[_0x766e('0x8e')](_0x3e5002[_0x766e('0x44')][_0x766e('0x8d')])?_0x3e5002[_0x766e('0x44')]['tag']:new Array(_0x3e5002[_0x766e('0x44')][_0x766e('0x8d')]);_0x4e3f9a[_0x766e('0x38')](function(_0x70ecdd){_0x227e43['or'](_0x766e('0x8f'),'%,'+_0x70ecdd+',%');});}if(_0x3e5002[_0x766e('0x44')]['filter']){var _0x538dda=_0x3e5002[_0x766e('0x44')][_0x766e('0x90')]['replace']('\x5c','\x5c\x5c')[_0x766e('0x91')](/'/g,'\x27\x27');if(qs[_0x766e('0x92')](_0x538dda)){_0x5e6a59['or'](_0x766e('0x93'),_0x538dda+'%')['or'](_0x766e('0x94'),_0x538dda+'%');}_0x5e6a59['or'](_0x766e('0x95'),_0x538dda+'%');}}_0x9faaca[_0x766e('0x4f')](_0x5e6a59);_0x9faaca[_0x766e('0x96')](_0x766e('0x97'));var _0xbac258={'type':db[_0x766e('0x98')][_0x766e('0x99')][_0x766e('0x9a')],'raw':!![]};var _0x262a3c=_0x9faaca[_0x766e('0x9b')]();_0x262a3c[_0x766e('0x52')]('i.id');_0x262a3c[_0x766e('0x52')](_0x766e('0x9c'),_0x766e('0x6a'));if(_0x50f3ef[_0x766e('0x4d')]){_0x50f3ef['order'][_0x766e('0x38')](function(_0x2eed93){var _0x21ac91=_0x2eed93[0x0]==='contactName'?_0x2eed93[0x0]:'i.'+_0x2eed93[0x0];_0x9faaca[_0x766e('0x4d')](_0x21ac91,_0x2eed93[0x1]==='DESC'?![]:!![]);});}if(!_[_0x766e('0x81')](_0x4e3f9a)){_0x9faaca[_0x766e('0x6c')](_0x227e43);_0x262a3c['where'](_0x766e('0x9d'),_0x4e3f9a);}BPromise[_0x766e('0x9e')]()['then'](function(){if(!_0x6641d){if(_0x3e5002[_0x766e('0x44')][_0x766e('0x82')])return;_0x262a3c[_0x766e('0x4f')](_0x766e('0x9f'));_0x9faaca[_0x766e('0x4f')](_0x766e('0x9f'));return;}if(_0x3e5002[_0x766e('0xa0')]['role']!==_0x766e('0xa1'))return;return _0x3e5002[_0x766e('0xa0')][_0x766e('0xa2')]({'attributes':['id'],'raw':!![]})[_0x766e('0x2e')](function(_0x392c5a){if(_[_0x766e('0x81')](_0x392c5a)){_0x262a3c[_0x766e('0x4f')](_0x766e('0xa3'));_0x9faaca[_0x766e('0x4f')](_0x766e('0xa3'));}else{_0x262a3c[_0x766e('0x4f')](_0x766e('0x83'),_[_0x766e('0x34')](_0x392c5a,'id'));_0x9faaca[_0x766e('0x4f')]('i.FaxAccountId\x20IN\x20?',_[_0x766e('0x34')](_0x392c5a,'id'));}});})[_0x766e('0x2e')](function(){if(_0x3e5002[_0x766e('0xa0')]['role']===_0x766e('0xa1')&&!_0x6641d&&!_0x3e5002[_0x766e('0x44')][_0x766e('0x82')])return[];return db['sequelize'][_0x766e('0x44')](_0x262a3c['toString'](),_0xbac258);})[_0x766e('0x2e')](function(_0x558eaf){_0x2faff9['count']=_0x558eaf[_0x766e('0x4b')];if(_0x2faff9[_0x766e('0x29')]===0x0)return[];return db['sequelize'][_0x766e('0x44')](_0x2cba41['toString'](),_0xbac258)[_0x766e('0x2e')](function(_0x2be52d){_0x301904=_['keyBy'](_0x2be52d,'id');_0xbac258=_['merge'](_0xbac258,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3e5002[_0x766e('0x44')]['fields']){_0x50f3ef[_0x766e('0x49')]['forEach'](function(_0x8aa2c8){_0x9faaca[_0x766e('0x52')]('i.'+_0x8aa2c8);});}else{_0x9faaca[_0x766e('0x52')](_0x766e('0x9c'),'unreadMessages');_0x9faaca[_0x766e('0x52')](_0x766e('0xa4'),_0x766e('0xa5'));_0x9faaca[_0x766e('0x52')](_0x766e('0xa6'),_0x766e('0xa7'));_0x9faaca[_0x766e('0x52')](_0x766e('0xa8'),_0x766e('0xa9'));_0x9faaca[_0x766e('0x52')](_0x766e('0xaa'));_0x9faaca[_0x766e('0x52')](_0x766e('0xab'),'Contact.firstName');_0x9faaca[_0x766e('0x52')](_0x766e('0xac'),'Contact.lastName');_0x9faaca['field'](_0x766e('0xad'),_0x766e('0xae'));_0x9faaca[_0x766e('0x52')](_0x766e('0xaf'),_0x766e('0xb0'));_0x9faaca['field']('c.mobile',_0x766e('0xb1'));_0x9faaca[_0x766e('0x52')]('c.fax',_0x766e('0xb2'));_0x9faaca['field'](_0x766e('0xb3'),_0x766e('0xb4'));_0x9faaca['field'](_0x766e('0xb5'),_0x766e('0xb6'));_0x9faaca[_0x766e('0x52')](_0x766e('0xb7'),_0x766e('0x37'));}if(_0x50f3ef['limit'])_0x9faaca[_0x766e('0x28')](_0x50f3ef['limit']);if(_0x50f3ef['offset'])_0x9faaca[_0x766e('0x26')](_0x50f3ef[_0x766e('0x26')]);return db[_0x766e('0xb8')][_0x766e('0x44')](_0x9faaca['toString'](),_0xbac258);})['then'](function(_0x158e98){if(_0x158e98[_0x766e('0x4b')]>0x0)_0xd6b99b['where'](_0x766e('0xb9'),_[_0x766e('0x34')](_0x158e98,'id'));return db[_0x766e('0xb8')]['query'](_0xd6b99b[_0x766e('0xba')](),_0xbac258)[_0x766e('0x2e')](function(_0x27d647){var _0x144227=_[_0x766e('0xbb')](_0x27d647,_0x766e('0xbc'));var _0x41bb78=[];_0x158e98[_0x766e('0x38')](function(_0x17592c){_0x41bb78[_0x766e('0x39')](updateFaxInteraction(_0x17592c,_0x301904,_0x144227));});return BPromise[_0x766e('0xbd')](_0x41bb78);});});})[_0x766e('0x2e')](function(_0x2ceb61){_0x2faff9[_0x766e('0xbe')]=_0x2ceb61;return _0x2faff9;})['then'](respondWithFilteredResult(_0x4e467,_0x50f3ef))[_0x766e('0x3a')](handleError(_0x4e467,null));};exports[_0x766e('0xbf')]=function(_0x50407,_0x31a238){var _0x31d094={'raw':![],'where':{'id':_0x50407[_0x766e('0xc0')]['id']}},_0x5260b7={};_0x5260b7[_0x766e('0x48')]=_[_0x766e('0x45')](db[_0x766e('0x41')][_0x766e('0x42')]);_0x5260b7[_0x766e('0x44')]=_['keys'](_0x50407['query']);_0x5260b7['filters']=_[_0x766e('0x47')](_0x5260b7[_0x766e('0x48')],_0x5260b7[_0x766e('0x44')]);_0x31d094[_0x766e('0x49')]=_[_0x766e('0x47')](_0x5260b7[_0x766e('0x48')],qs[_0x766e('0x4a')](_0x50407[_0x766e('0x44')]['fields']));_0x31d094[_0x766e('0x49')]=_0x31d094['attributes'][_0x766e('0x4b')]?_0x31d094[_0x766e('0x49')]:_0x5260b7[_0x766e('0x48')];if(_0x50407['query']['includeAll']){_0x31d094[_0x766e('0xc1')]=[{'all':!![]}];}_0x31d094=_[_0x766e('0xc2')]({},_0x31d094,_0x50407['options']);return db[_0x766e('0x41')]['find'](_0x31d094)['then'](handleEntityNotFound(_0x31a238,null))[_0x766e('0x2e')](respondWithResult(_0x31a238,null))[_0x766e('0x3a')](handleError(_0x31a238,null));};exports[_0x766e('0xc3')]=function(_0x509b15,_0x28e173){return db[_0x766e('0x41')][_0x766e('0xc3')](_0x509b15[_0x766e('0x7e')],{})[_0x766e('0x2e')](respondWithResult(_0x28e173,0xc9))['catch'](handleError(_0x28e173,null));};exports[_0x766e('0xc4')]=function(_0x5f2cd4,_0x45cade){if(_0x5f2cd4[_0x766e('0x7e')]['id']){delete _0x5f2cd4[_0x766e('0x7e')]['id'];}return db[_0x766e('0x41')]['find']({'where':{'id':_0x5f2cd4[_0x766e('0xc0')]['id']}})['then'](handleEntityNotFound(_0x45cade,null))[_0x766e('0x2e')](saveUpdates(_0x5f2cd4[_0x766e('0x7e')],null))[_0x766e('0x2e')](respondWithResult(_0x45cade,null))[_0x766e('0x3a')](handleError(_0x45cade,null));};exports['destroy']=function(_0x1b7593,_0x3bf326){return db[_0x766e('0x41')][_0x766e('0x69')]({'where':{'id':_0x1b7593[_0x766e('0xc0')]['id']}})[_0x766e('0x2e')](handleEntityNotFound(_0x3bf326,null))[_0x766e('0x2e')](removeEntity(_0x3bf326,null))[_0x766e('0x3a')](handleError(_0x3bf326,null));};exports[_0x766e('0xc5')]=function(_0x4e93d9,_0x3be26c){return db[_0x766e('0x41')][_0x766e('0xc5')]()[_0x766e('0x2e')](respondWithResult(_0x3be26c,null))[_0x766e('0x3a')](handleError(_0x3be26c,null));};exports[_0x766e('0xc6')]=function(_0x3a2fad,_0x195c4e,_0x2379a3){return db[_0x766e('0xc7')][_0x766e('0x69')]({'where':{'id':_0x3a2fad[_0x766e('0xc0')]['id']}})[_0x766e('0x2e')](handleEntityNotFound(_0x195c4e,null))[_0x766e('0x2e')](function(_0x253418){if(_0x253418){return _0x253418[_0x766e('0xc6')](_0x3a2fad['body']['ids'],_[_0x766e('0xc8')](_0x3a2fad[_0x766e('0x7e')],['ids','id'])||{});}})['then'](respondWithResult(_0x195c4e,null))['catch'](handleError(_0x195c4e,null));};exports[_0x766e('0xc9')]=function(_0x314135,_0x4ed5df,_0x163609){var _0x3496da={'raw':![],'where':{}};var _0x13c399={};var _0x21825b={'count':0x0,'rows':[]};return db['FaxInteraction'][_0x766e('0xca')]({'where':{'id':_0x314135[_0x766e('0xc0')]['id']}})[_0x766e('0x2e')](handleEntityNotFound(_0x4ed5df,null))[_0x766e('0x2e')](function(_0x484b02){if(_0x484b02){_0x13c399[_0x766e('0x48')]=_[_0x766e('0x45')](db['FaxMessage'][_0x766e('0x42')]);_0x13c399[_0x766e('0x44')]=_[_0x766e('0x45')](_0x314135[_0x766e('0x44')]);_0x13c399[_0x766e('0x46')]=_['intersection'](_0x13c399[_0x766e('0x48')],_0x13c399[_0x766e('0x44')]);_0x3496da[_0x766e('0x49')]=_[_0x766e('0x47')](_0x13c399[_0x766e('0x48')],qs['fields'](_0x314135['query'][_0x766e('0x4a')]));_0x3496da[_0x766e('0x49')]=_0x3496da[_0x766e('0x49')][_0x766e('0x4b')]?_0x3496da[_0x766e('0x49')]:_0x13c399[_0x766e('0x48')];if(!_0x314135[_0x766e('0x44')]['hasOwnProperty'](_0x766e('0x4c'))){_0x3496da[_0x766e('0x28')]=qs['limit'](_0x314135[_0x766e('0x44')][_0x766e('0x28')]);_0x3496da[_0x766e('0x26')]=qs[_0x766e('0x26')](_0x314135['query'][_0x766e('0x26')]);}_0x3496da['order']=qs[_0x766e('0x4e')](_0x314135['query']['sort']);_0x3496da['where']=qs[_0x766e('0x46')](_[_0x766e('0x50')](_0x314135[_0x766e('0x44')],_0x13c399[_0x766e('0x46')]));_0x3496da['where']['FaxInteractionId']=_0x484b02['id'];if(_0x314135[_0x766e('0x44')]['filter']){_0x3496da[_0x766e('0x4f')]=_[_0x766e('0xc2')](_0x3496da[_0x766e('0x4f')],{'$or':_[_0x766e('0x34')](_0x3496da[_0x766e('0x49')],function(_0xe0d2e7){var _0x22db71={};_0x22db71[_0xe0d2e7]={'$like':'%'+_0x314135[_0x766e('0x44')]['filter']+'%'};return _0x22db71;})});}if(_0x314135[_0x766e('0x44')][_0x766e('0x86')]){var _0xa8deeb=_0x314135[_0x766e('0x44')]['$gte'][_0x766e('0x72')](',');var _0x39366f={};_0x39366f[_0xa8deeb[0x0]]={'$gte':moment(_0xa8deeb[0x1])['format'](_0x766e('0xcb'))};_0x3496da[_0x766e('0x4f')]=_[_0x766e('0xc2')](_0x3496da[_0x766e('0x4f')],_0x39366f);}_0x3496da=_[_0x766e('0xc2')]({},_0x3496da,_0x314135[_0x766e('0xcc')]);return db[_0x766e('0xc7')][_0x766e('0x29')]({'where':_0x3496da[_0x766e('0x4f')]})[_0x766e('0x2e')](function(_0x3e72b1){_0x21825b[_0x766e('0x29')]=_0x3e72b1;if(_0x314135[_0x766e('0x44')][_0x766e('0xcd')]){_0x3496da[_0x766e('0xc1')]=[{'all':!![]}];}return db[_0x766e('0xc7')]['findAll'](_0x3496da);})[_0x766e('0x2e')](function(_0x26e43c){_0x21825b['rows']=_0x26e43c;return _0x21825b;});}})[_0x766e('0x2e')](respondWithFilteredResult(_0x4ed5df,_0x3496da))['catch'](handleError(_0x4ed5df,null));};exports[_0x766e('0xce')]=function(_0x3a112a,_0x158d45,_0x31d138){return db[_0x766e('0x41')][_0x766e('0x69')]({'where':{'id':_0x3a112a[_0x766e('0xc0')]['id']}})[_0x766e('0x2e')](handleEntityNotFound(_0x158d45,null))[_0x766e('0x2e')](function(_0x2207d0){if(_0x2207d0){return _0x2207d0['setTags'](_0x3a112a['body']['ids'],_['omit'](_0x3a112a[_0x766e('0x7e')],[_0x766e('0xcf'),'id'])||{})[_0x766e('0xd0')](function(){return db[_0x766e('0x7a')][_0x766e('0xd1')]({'attributes':['id','name',_0x766e('0x53')],'where':{'id':_0x3a112a['body'][_0x766e('0xcf')]}});})[_0x766e('0x2e')](function(_0x5a8116){socket[_0x766e('0xd2')]('faxInteractionTags:save',{'id':Number(_0x3a112a[_0x766e('0xc0')]['id']),'tags':_0x5a8116||[]});return{'id':Number(_0x3a112a[_0x766e('0xc0')]['id']),'tags':_0x5a8116||[]};});}})['then'](respondWithResult(_0x158d45,null))[_0x766e('0x3a')](handleError(_0x158d45,null));};exports[_0x766e('0xd3')]=function(_0x4ca83b,_0x3d42ad,_0xc4d249){return db[_0x766e('0x41')][_0x766e('0x69')]({'where':{'id':_0x4ca83b[_0x766e('0xc0')]['id']}})[_0x766e('0x2e')](handleEntityNotFound(_0x3d42ad,null))[_0x766e('0x2e')](function(_0x3e67a9){if(_0x3e67a9){return _0x3e67a9['removeTags'](_0x4ca83b[_0x766e('0x44')][_0x766e('0xcf')]);}})[_0x766e('0x2e')](respondWithStatusCode(_0x3d42ad,null))['catch'](handleError(_0x3d42ad,null));};exports[_0x766e('0xd4')]=function(_0x3c6df5,_0x2c6422){var _0x6e1dd=moment()[_0x766e('0xd5')]()[_0x766e('0xba')]();var _0x5955de=path[_0x766e('0xd6')](config[_0x766e('0xd7')],_0x766e('0xd8'),'files',_0x766e('0xd9'));var _0x1d3d0f=path['join'](config['root'],_0x766e('0xd8'),_0x766e('0xda'),_0x766e('0xdb'));var _0x499e2a=path['join'](_0x5955de,_0x6e1dd);var _0x5735a5=util[_0x766e('0xdc')](_0x766e('0xdd'),_0x3c6df5['params']['id'],_0x6e1dd);var _0x2d687c=path['join'](_0x5955de,_0x5735a5);var _0x396ee2=[];_0x396ee2[_0x766e('0x39')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});var _0x43f32c=[{'model':db[_0x766e('0xc7')],'as':'Messages','attributes':['id',_0x766e('0x7e'),_0x766e('0xde')],'include':_0x396ee2}];return db[_0x766e('0x41')]['find']({'where':{'id':_0x3c6df5[_0x766e('0xc0')]['id']},'include':_0x43f32c})[_0x766e('0x2e')](handleEntityNotFound(_0x2c6422,null))[_0x766e('0x2e')](function(_0x108664){if(_0x108664&&_0x108664[_0x766e('0xdf')]){var _0xa54f0e=_0x108664[_0x766e('0xe0')]({'plain':!![]});fs[_0x766e('0xe1')](_0x499e2a);for(var _0x154b2a=0x0;_0x154b2a<_0xa54f0e[_0x766e('0xdf')][_0x766e('0x4b')];_0x154b2a++){var _0x248357=_0xa54f0e[_0x766e('0xdf')][_0x154b2a][_0x766e('0xe2')];if(_0x248357){var _0x338a58=path[_0x766e('0xd6')](_0x1d3d0f,_0x248357[_0x766e('0xe3')]);if(fs['existsSync'](_0x338a58)){fs[_0x766e('0xe4')](_0x338a58)['pipe'](fs[_0x766e('0xe5')](path['join'](_0x499e2a,_0x248357[_0x766e('0xe3')])));}}}return BPromise['resolve']()[_0x766e('0x2e')](function(){return new BPromise(function(_0x55d468,_0xe6a709){zipdir(_0x499e2a,{'saveTo':_0x2d687c},function(_0x4fee8b,_0x40210a){if(_0x4fee8b)return _0xe6a709(_0x4fee8b);return _0x55d468(_0x40210a);});})[_0x766e('0x2e')](function(){return new BPromise(function(_0x28118e,_0x2c3e22){rimraf(_0x499e2a,function(_0x36cb06){if(_0x36cb06)_0x2c3e22(_0x36cb06);return _0x28118e();});});})['then'](function(){return _0x2c6422[_0x766e('0xd4')](_0x2d687c,_0x5735a5,function(_0x48348c){if(_0x48348c){console[_0x766e('0xe6')]('err',_0x48348c);}else{fs['unlinkSync'](_0x2d687c);}});});});}else{return _0x2c6422['sendStatus'](0xc8);}})[_0x766e('0x3a')](handleError(_0x2c6422,null));};
\ No newline at end of file
index e344f81..89acac9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa7c5=['hook','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','remove','getUsers','then','findAll','setDataValue','unreadMessages','emit','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa7c5,0x151));var _0x5a7c=function(_0x14506c,_0x4d31c1){_0x14506c=_0x14506c-0x0;var _0x47cdaa=_0xa7c5[_0x14506c];return _0x47cdaa;};'use strict';var EventEmitter=require(_0x5a7c('0x0'));var FaxInteraction=require(_0x5a7c('0x1'))['db'][_0x5a7c('0x2')];var FaxMessage=require(_0x5a7c('0x1'))['db'][_0x5a7c('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x5a7c('0x4')](0x0);var events={'afterCreate':_0x5a7c('0x5'),'afterUpdate':_0x5a7c('0x6'),'afterDestroy':_0x5a7c('0x7')};function emitEvent(_0x312c8a){return function(_0x2e89d1,_0x5a3db3,_0x25f6f7){_0x2e89d1[_0x5a7c('0x8')]({'attributes':['id'],'raw':!![]})[_0x5a7c('0x9')](function(_0x43a6c8){_0x2e89d1['setDataValue']('Users',_0x43a6c8['map'](function(_0xb37430){return{'id':_0xb37430['id']};}));return FaxMessage[_0x5a7c('0xa')]({'where':{'FaxInteractionId':_0x2e89d1['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5a7c('0x9')](function(_0x3d6723){_0x2e89d1[_0x5a7c('0xb')](_0x5a7c('0xc'),_0x3d6723['length']);FaxInteractionEvents[_0x5a7c('0xd')](_0x312c8a+':'+_0x2e89d1['id'],_0x2e89d1);FaxInteractionEvents[_0x5a7c('0xd')](_0x312c8a,_0x2e89d1);_0x25f6f7(null);})[_0x5a7c('0xe')](_0x25f6f7(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0x5a7c('0xf')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents;
\ No newline at end of file
+var _0xf6d4=['../../mysqldb','FaxInteraction','setMaxListeners','save','update','remove','getUsers','map','findAll','then','setDataValue','length','emit','catch','hook','events'];(function(_0x298d4b,_0x2c34fa){var _0x57e113=function(_0x4f288b){while(--_0x4f288b){_0x298d4b['push'](_0x298d4b['shift']());}};_0x57e113(++_0x2c34fa);}(_0xf6d4,0xbf));var _0x4f6d=function(_0x3d035d,_0x3a2215){_0x3d035d=_0x3d035d-0x0;var _0x331b80=_0xf6d4[_0x3d035d];return _0x331b80;};'use strict';var EventEmitter=require(_0x4f6d('0x0'));var FaxInteraction=require(_0x4f6d('0x1'))['db'][_0x4f6d('0x2')];var FaxMessage=require(_0x4f6d('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x4f6d('0x3')](0x0);var events={'afterCreate':_0x4f6d('0x4'),'afterUpdate':_0x4f6d('0x5'),'afterDestroy':_0x4f6d('0x6')};function emitEvent(_0x436dd8){return function(_0x27833e,_0x16527e,_0x2dbea7){_0x27833e[_0x4f6d('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2560b1){_0x27833e['setDataValue']('Users',_0x2560b1[_0x4f6d('0x8')](function(_0xe61811){return{'id':_0xe61811['id']};}));return FaxMessage[_0x4f6d('0x9')]({'where':{'FaxInteractionId':_0x27833e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4f6d('0xa')](function(_0x566535){_0x27833e[_0x4f6d('0xb')]('unreadMessages',_0x566535[_0x4f6d('0xc')]);FaxInteractionEvents[_0x4f6d('0xd')](_0x436dd8+':'+_0x27833e['id'],_0x27833e);FaxInteractionEvents[_0x4f6d('0xd')](_0x436dd8,_0x27833e);_0x2dbea7(null);})[_0x4f6d('0xe')](_0x2dbea7(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0x4f6d('0xf')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents;
\ No newline at end of file
index 119542e..98f88d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9898=['closed','closedAt','format','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','define','FaxInteraction','fax_interactions','changed'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x9898,0x12f));var _0x8989=function(_0x5c4585,_0x3d0eab){_0x5c4585=_0x5c4585-0x0;var _0x21dede=_0x9898[_0x5c4585];return _0x21dede;};'use strict';var _=require('lodash');var util=require(_0x8989('0x0'));var logger=require(_0x8989('0x1'))('api');var moment=require(_0x8989('0x2'));var BPromise=require(_0x8989('0x3'));var rp=require(_0x8989('0x4'));var fs=require('fs');var path=require(_0x8989('0x5'));var rimraf=require(_0x8989('0x6'));var config=require('../../config/environment');var attributes=require('./faxInteraction.attributes');module[_0x8989('0x7')]=function(_0x20c18c,_0x143232){return _0x20c18c[_0x8989('0x8')](_0x8989('0x9'),attributes,{'tableName':_0x8989('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x350d79,_0x3fb975,_0xd55caa){if(_0x350d79[_0x8989('0xb')](_0x8989('0xc'))){_0x350d79[_0x8989('0xd')]=moment()[_0x8989('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0xd55caa(null,_0x350d79);}}});};
\ No newline at end of file
+var _0xee4a=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','request-promise','rimraf','./faxInteraction.attributes','define','FaxInteraction','fax_interactions'];(function(_0x40d870,_0x6ebb5f){var _0x48db45=function(_0x56dbd7){while(--_0x56dbd7){_0x40d870['push'](_0x40d870['shift']());}};_0x48db45(++_0x6ebb5f);}(_0xee4a,0x9e));var _0xaee4=function(_0x1060fa,_0x1adcc1){_0x1060fa=_0x1060fa-0x0;var _0x32ea41=_0xee4a[_0x1060fa];return _0x32ea41;};'use strict';var _=require(_0xaee4('0x0'));var util=require('util');var logger=require(_0xaee4('0x1'))(_0xaee4('0x2'));var moment=require(_0xaee4('0x3'));var BPromise=require('bluebird');var rp=require(_0xaee4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaee4('0x5'));var config=require('../../config/environment');var attributes=require(_0xaee4('0x6'));module['exports']=function(_0x23f47b,_0x555e98){return _0x23f47b[_0xaee4('0x7')](_0xaee4('0x8'),attributes,{'tableName':_0xaee4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5e0ab4,_0x274758,_0x6de436){if(_0x5e0ab4['changed'](_0xaee4('0xa'))){_0x5e0ab4[_0xaee4('0xb')]=moment()[_0xaee4('0xc')](_0xaee4('0xd'));}_0x6de436(null,_0x5e0ab4);}}});};
\ No newline at end of file
index 5c6d78c..0dc19f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f92=['defaults','localhost','socket.io-emitter','./faxInteraction.socket','request','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','limit','then','find','where','addTags','ids','spread','AddTags','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','redis'];(function(_0x10b85a,_0x2e5185){var _0x382add=function(_0x11a150){while(--_0x11a150){_0x10b85a['push'](_0x10b85a['shift']());}};_0x382add(++_0x2e5185);}(_0x0f92,0x8c));var _0x20f9=function(_0x1893c6,_0x3a34ce){_0x1893c6=_0x1893c6-0x0;var _0x4dc157=_0x0f92[_0x1893c6];return _0x4dc157;};'use strict';var _=require('lodash');var util=require(_0x20f9('0x0'));var moment=require(_0x20f9('0x1'));var BPromise=require('bluebird');var rs=require(_0x20f9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x20f9('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x20f9('0x4'))(_0x20f9('0x5'));var config=require(_0x20f9('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x20f9('0x7')]=_[_0x20f9('0x8')](config['redis'],{'host':_0x20f9('0x9'),'port':0x18eb});var socket=require(_0x20f9('0xa'))(new Redis(config[_0x20f9('0x7')]));require(_0x20f9('0xb'))['register'](socket);function respondWithRpcPromise(_0x4213b7,_0x540f2b,_0x14ddcf){return new BPromise(function(_0x4528b3,_0x19d5b8){return client[_0x20f9('0xc')](_0x4213b7,_0x14ddcf)['then'](function(_0x5de896){logger[_0x20f9('0xd')](_0x20f9('0xe'),_0x540f2b,_0x20f9('0xf'));logger[_0x20f9('0x10')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x540f2b,_0x20f9('0xf'),JSON[_0x20f9('0x11')](_0x5de896));if(_0x5de896[_0x20f9('0x12')]){if(_0x5de896[_0x20f9('0x12')][_0x20f9('0x13')]===0x1f4){logger[_0x20f9('0x12')]('FaxInteraction,\x20%s,\x20%s',_0x540f2b,_0x5de896[_0x20f9('0x12')][_0x20f9('0x14')]);return _0x19d5b8(_0x5de896[_0x20f9('0x12')][_0x20f9('0x14')]);}logger[_0x20f9('0x12')](_0x20f9('0xe'),_0x540f2b,_0x5de896[_0x20f9('0x12')][_0x20f9('0x14')]);return _0x4528b3(_0x5de896[_0x20f9('0x12')][_0x20f9('0x14')]);}else{logger[_0x20f9('0xd')](_0x20f9('0xe'),_0x540f2b,_0x20f9('0xf'));_0x4528b3(_0x5de896[_0x20f9('0x15')]['message']);}})[_0x20f9('0x16')](function(_0x41d276){logger['error'](_0x20f9('0xe'),_0x540f2b,_0x41d276);_0x19d5b8(_0x41d276);});});}exports[_0x20f9('0x17')]=function(_0x551312){var _0x4fdd82=this;return new Promise(function(_0x277b52,_0xaf9318){return db[_0x20f9('0x18')][_0x20f9('0x19')](_0x551312[_0x20f9('0x1a')],{'raw':_0x551312[_0x20f9('0x1b')]?_0x551312[_0x20f9('0x1b')][_0x20f9('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x551312['options']?_0x551312[_0x20f9('0x1b')]['where']||null:null,'attributes':_0x551312[_0x20f9('0x1b')]?_0x551312['options']['attributes']||null:null,'limit':_0x551312[_0x20f9('0x1b')]?_0x551312[_0x20f9('0x1b')][_0x20f9('0x1d')]||null:null})[_0x20f9('0x1e')](function(_0x19adcf){logger[_0x20f9('0xd')]('UpdateFaxInteraction',_0x551312);logger[_0x20f9('0x10')]('UpdateFaxInteraction',_0x551312,JSON[_0x20f9('0x11')](_0x19adcf));_0x277b52(_0x19adcf);})['catch'](function(_0x12b40e){logger[_0x20f9('0x12')](_0x20f9('0x17'),_0x12b40e[_0x20f9('0x14')],_0x551312);_0xaf9318(_0x4fdd82['error'](0x1f4,_0x12b40e[_0x20f9('0x14')]));});});};exports['AddTagsToFaxInteraction']=function(_0x1c076a){return new Promise(function(_0x459c68,_0x48ad8c){return db[_0x20f9('0x18')][_0x20f9('0x1f')]({'where':_0x1c076a[_0x20f9('0x1b')]?_0x1c076a[_0x20f9('0x1b')][_0x20f9('0x20')]||null:null})[_0x20f9('0x1e')](function(_0x544dee){if(_0x544dee){return _0x544dee[_0x20f9('0x21')](_0x1c076a['body']['ids'],_['omit'](_0x1c076a['body'],[_0x20f9('0x22'),'id'])||{});}})[_0x20f9('0x23')](function(_0x22fada){logger['info'](_0x20f9('0x24'),_0x1c076a);logger[_0x20f9('0x10')](_0x20f9('0x24'),_0x1c076a,JSON['stringify'](_0x22fada));_0x459c68(_0x22fada);})[_0x20f9('0x16')](function(_0x252908){logger[_0x20f9('0x12')](_0x20f9('0x24'),_0x252908[_0x20f9('0x14')],_0x1c076a);_0x48ad8c(_this['error'](0x1f4,_0x252908[_0x20f9('0x14')]));});});};
\ No newline at end of file
+var _0x7608=['socket.io-emitter','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','UpdateFaxInteraction','FaxInteraction','update','options','where','limit','stringify','AddTagsToFaxInteraction','body','ids','AddTags','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7608,0x195));var _0x8760=function(_0x2fd8a7,_0x5db621){_0x2fd8a7=_0x2fd8a7-0x0;var _0x4bdc24=_0x7608[_0x2fd8a7];return _0x4bdc24;};'use strict';var _=require(_0x8760('0x0'));var util=require(_0x8760('0x1'));var moment=require(_0x8760('0x2'));var BPromise=require(_0x8760('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8760('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8760('0x5'));var logger=require(_0x8760('0x6'))('rpc');var config=require(_0x8760('0x7'));var jayson=require(_0x8760('0x8'));var client=jayson[_0x8760('0x9')][_0x8760('0xa')]({'port':0x232a});config[_0x8760('0xb')]=_['defaults'](config[_0x8760('0xb')],{'host':_0x8760('0xc'),'port':0x18eb});var socket=require(_0x8760('0xd'))(new Redis(config[_0x8760('0xb')]));require(_0x8760('0xe'))[_0x8760('0xf')](socket);function respondWithRpcPromise(_0x555386,_0x1bff9e,_0x18455f){return new BPromise(function(_0x3eac3d,_0x2006da){return client[_0x8760('0x10')](_0x555386,_0x18455f)[_0x8760('0x11')](function(_0x20f9f4){logger[_0x8760('0x12')](_0x8760('0x13'),_0x1bff9e,_0x8760('0x14'));logger[_0x8760('0x15')](_0x8760('0x16'),_0x1bff9e,_0x8760('0x14'),JSON['stringify'](_0x20f9f4));if(_0x20f9f4[_0x8760('0x17')]){if(_0x20f9f4[_0x8760('0x17')][_0x8760('0x18')]===0x1f4){logger[_0x8760('0x17')](_0x8760('0x13'),_0x1bff9e,_0x20f9f4['error'][_0x8760('0x19')]);return _0x2006da(_0x20f9f4[_0x8760('0x17')][_0x8760('0x19')]);}logger[_0x8760('0x17')](_0x8760('0x13'),_0x1bff9e,_0x20f9f4[_0x8760('0x17')][_0x8760('0x19')]);return _0x3eac3d(_0x20f9f4[_0x8760('0x17')]['message']);}else{logger['info'](_0x8760('0x13'),_0x1bff9e,_0x8760('0x14'));_0x3eac3d(_0x20f9f4['result']['message']);}})[_0x8760('0x1a')](function(_0x61d015){logger['error'](_0x8760('0x13'),_0x1bff9e,_0x61d015);_0x2006da(_0x61d015);});});}exports[_0x8760('0x1b')]=function(_0x1d82bc){var _0x552e8c=this;return new Promise(function(_0x51ee89,_0x213f4a){return db[_0x8760('0x1c')][_0x8760('0x1d')](_0x1d82bc['body'],{'raw':_0x1d82bc['options']?_0x1d82bc['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d82bc[_0x8760('0x1e')]?_0x1d82bc[_0x8760('0x1e')][_0x8760('0x1f')]||null:null,'attributes':_0x1d82bc[_0x8760('0x1e')]?_0x1d82bc[_0x8760('0x1e')]['attributes']||null:null,'limit':_0x1d82bc[_0x8760('0x1e')]?_0x1d82bc['options'][_0x8760('0x20')]||null:null})[_0x8760('0x11')](function(_0x42d771){logger[_0x8760('0x12')](_0x8760('0x1b'),_0x1d82bc);logger[_0x8760('0x15')](_0x8760('0x1b'),_0x1d82bc,JSON[_0x8760('0x21')](_0x42d771));_0x51ee89(_0x42d771);})[_0x8760('0x1a')](function(_0x2594f3){logger['error'](_0x8760('0x1b'),_0x2594f3['message'],_0x1d82bc);_0x213f4a(_0x552e8c[_0x8760('0x17')](0x1f4,_0x2594f3[_0x8760('0x19')]));});});};exports[_0x8760('0x22')]=function(_0x103fcb){return new Promise(function(_0x3f9e87,_0x33ffbc){return db[_0x8760('0x1c')]['find']({'where':_0x103fcb[_0x8760('0x1e')]?_0x103fcb[_0x8760('0x1e')][_0x8760('0x1f')]||null:null})[_0x8760('0x11')](function(_0x116274){if(_0x116274){return _0x116274['addTags'](_0x103fcb[_0x8760('0x23')][_0x8760('0x24')],_['omit'](_0x103fcb[_0x8760('0x23')],[_0x8760('0x24'),'id'])||{});}})['spread'](function(_0x544466){logger[_0x8760('0x12')]('AddTags',_0x103fcb);logger[_0x8760('0x15')]('AddTags',_0x103fcb,JSON[_0x8760('0x21')](_0x544466));_0x3f9e87(_0x544466);})[_0x8760('0x1a')](function(_0x4bfed1){logger['error'](_0x8760('0x25'),_0x4bfed1[_0x8760('0x19')],_0x103fcb);_0x33ffbc(_this[_0x8760('0x17')](0x1f4,_0x4bfed1[_0x8760('0x19')]));});});};
\ No newline at end of file
index 8ae20a3..cf71200 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed32=['remove','update','emit','removeListener','register','length','faxInteraction:','./faxInteraction.events'];(function(_0xe96e8d,_0x2e8529){var _0x28eab7=function(_0x37a6db){while(--_0x37a6db){_0xe96e8d['push'](_0xe96e8d['shift']());}};_0x28eab7(++_0x2e8529);}(_0xed32,0xcf));var _0x2ed3=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xed32[_0x422905];return _0x33dc6c;};'use strict';var FaxInteractionEvents=require(_0x2ed3('0x0'));var events=['save',_0x2ed3('0x1'),_0x2ed3('0x2')];function createListener(_0x4ef49e,_0x424bea){return function(_0x202c4a){_0x424bea[_0x2ed3('0x3')](_0x4ef49e,_0x202c4a);};}function removeListener(_0x18d78e,_0x2ececb){return function(){FaxInteractionEvents[_0x2ed3('0x4')](_0x18d78e,_0x2ececb);};}exports[_0x2ed3('0x5')]=function(_0x353583){for(var _0x3ecff4=0x0,_0x1945e4=events[_0x2ed3('0x6')];_0x3ecff4<_0x1945e4;_0x3ecff4++){var _0x17b578=events[_0x3ecff4];var _0x5c3097=createListener(_0x2ed3('0x7')+_0x17b578,_0x353583);FaxInteractionEvents['on'](_0x17b578,_0x5c3097);}};
\ No newline at end of file
+var _0x3b74=['removeListener','register','faxInteraction:','./faxInteraction.events','save','update','emit'];(function(_0x5cf21f,_0x2b9d7a){var _0x36efed=function(_0x595cad){while(--_0x595cad){_0x5cf21f['push'](_0x5cf21f['shift']());}};_0x36efed(++_0x2b9d7a);}(_0x3b74,0x161));var _0x43b7=function(_0x58e19c,_0x17b34e){_0x58e19c=_0x58e19c-0x0;var _0x536652=_0x3b74[_0x58e19c];return _0x536652;};'use strict';var FaxInteractionEvents=require(_0x43b7('0x0'));var events=[_0x43b7('0x1'),'remove',_0x43b7('0x2')];function createListener(_0x4ffd97,_0x3ec961){return function(_0x48a960){_0x3ec961[_0x43b7('0x3')](_0x4ffd97,_0x48a960);};}function removeListener(_0x556ef5,_0x4f936){return function(){FaxInteractionEvents[_0x43b7('0x4')](_0x556ef5,_0x4f936);};}exports[_0x43b7('0x5')]=function(_0x2c308c){for(var _0x159d32=0x0,_0x36460e=events['length'];_0x159d32<_0x36460e;_0x159d32++){var _0x3a808b=events[_0x159d32];var _0x30ebbf=createListener(_0x43b7('0x6')+_0x3a808b,_0x2c308c);FaxInteractionEvents['on'](_0x3a808b,_0x30ebbf);}};
\ No newline at end of file
index 7cd1477..a8df8ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb9da=['index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','create','post','addMessage','/:id/tags','tracked','fax','addTags','faxinteraction:update','update','delete','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x33be60,_0x1027f5){var _0x5b1a9d=function(_0x366f99){while(--_0x366f99){_0x33be60['push'](_0x33be60['shift']());}};_0x5b1a9d(++_0x1027f5);}(_0xb9da,0x1d6));var _0xab9d=function(_0x1f239e,_0x367b43){_0x1f239e=_0x1f239e-0x0;var _0x826971=_0xb9da[_0x1f239e];return _0x826971;};'use strict';var multer=require(_0xab9d('0x0'));var util=require(_0xab9d('0x1'));var path=require(_0xab9d('0x2'));var timeout=require(_0xab9d('0x3'));var express=require('express');var router=express[_0xab9d('0x4')]();var fs_extra=require(_0xab9d('0x5'));var auth=require(_0xab9d('0x6'));var interaction=require(_0xab9d('0x7'));var config=require('../../config/environment');var controller=require('./faxInteraction.controller');router[_0xab9d('0x8')]('/',auth[_0xab9d('0x9')](),controller[_0xab9d('0xa')]);router[_0xab9d('0x8')](_0xab9d('0xb'),auth[_0xab9d('0x9')](),controller[_0xab9d('0xc')]);router['get'](_0xab9d('0xd'),auth['isAuthenticated'](),controller[_0xab9d('0xe')]);router[_0xab9d('0x8')](_0xab9d('0xf'),auth['isAuthenticated'](),controller[_0xab9d('0x10')]);router[_0xab9d('0x8')](_0xab9d('0x11'),auth[_0xab9d('0x9')](),controller['download']);router['post']('/',auth[_0xab9d('0x9')](),controller[_0xab9d('0x12')]);router[_0xab9d('0x13')](_0xab9d('0xf'),auth[_0xab9d('0x9')](),controller[_0xab9d('0x14')]);router[_0xab9d('0x13')](_0xab9d('0x15'),auth['isAuthenticated'](),interaction[_0xab9d('0x16')](_0xab9d('0x17'),'faxinteraction:addtags'),controller[_0xab9d('0x18')]);router['put'](_0xab9d('0xd'),auth[_0xab9d('0x9')](),interaction[_0xab9d('0x16')]('fax',_0xab9d('0x19')),controller[_0xab9d('0x1a')]);router[_0xab9d('0x1b')](_0xab9d('0xd'),auth[_0xab9d('0x9')](),interaction[_0xab9d('0x16')]('fax','faxinteraction:destroy'),controller['destroy']);router[_0xab9d('0x1b')]('/:id/tags',auth[_0xab9d('0x9')](),controller[_0xab9d('0x1c')]);module[_0xab9d('0x1d')]=router;
\ No newline at end of file
+var _0xd9ca=['multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','getMessages','post','create','/:id/messages','/:id/tags','fax','faxinteraction:addtags','addTags','/:id','tracked','update','delete','destroy'];(function(_0x2edac3,_0x1e7c79){var _0x23ca9d=function(_0x31b26f){while(--_0x31b26f){_0x2edac3['push'](_0x2edac3['shift']());}};_0x23ca9d(++_0x1e7c79);}(_0xd9ca,0x1a0));var _0xad9c=function(_0x38c814,_0x49993d){_0x38c814=_0x38c814-0x0;var _0x459f15=_0xd9ca[_0x38c814];return _0x459f15;};'use strict';var multer=require(_0xad9c('0x0'));var util=require(_0xad9c('0x1'));var path=require(_0xad9c('0x2'));var timeout=require('connect-timeout');var express=require(_0xad9c('0x3'));var router=express[_0xad9c('0x4')]();var fs_extra=require(_0xad9c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xad9c('0x6'));var config=require(_0xad9c('0x7'));var controller=require('./faxInteraction.controller');router[_0xad9c('0x8')]('/',auth[_0xad9c('0x9')](),controller[_0xad9c('0xa')]);router[_0xad9c('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xad9c('0xb')]);router[_0xad9c('0x8')]('/:id',auth[_0xad9c('0x9')](),controller[_0xad9c('0xc')]);router['get']('/:id/messages',auth[_0xad9c('0x9')](),controller[_0xad9c('0xd')]);router['get']('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0xad9c('0xe')]('/',auth['isAuthenticated'](),controller[_0xad9c('0xf')]);router[_0xad9c('0xe')](_0xad9c('0x10'),auth[_0xad9c('0x9')](),controller['addMessage']);router[_0xad9c('0xe')](_0xad9c('0x11'),auth[_0xad9c('0x9')](),interaction['tracked'](_0xad9c('0x12'),_0xad9c('0x13')),controller[_0xad9c('0x14')]);router['put'](_0xad9c('0x15'),auth[_0xad9c('0x9')](),interaction[_0xad9c('0x16')]('fax','faxinteraction:update'),controller[_0xad9c('0x17')]);router[_0xad9c('0x18')](_0xad9c('0x15'),auth[_0xad9c('0x9')](),interaction[_0xad9c('0x16')]('fax','faxinteraction:destroy'),controller[_0xad9c('0x19')]);router[_0xad9c('0x18')](_0xad9c('0x11'),auth[_0xad9c('0x9')](),controller['removeTags']);module['exports']=router;
\ No newline at end of file
index b8e6d9c..de681dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed95=['DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x3ccda8,_0x367da7){var _0x3436a9=function(_0x1fc093){while(--_0x1fc093){_0x3ccda8['push'](_0x3ccda8['shift']());}};_0x3436a9(++_0x367da7);}(_0xed95,0xb9));var _0x5ed9=function(_0x1f7cc3,_0x4a0168){_0x1f7cc3=_0x1f7cc3-0x0;var _0x41775b=_0xed95[_0x1f7cc3];return _0x41775b;};'use strict';var Sequelize=require(_0x5ed9('0x0'));module[_0x5ed9('0x1')]={'body':{'type':Sequelize[_0x5ed9('0x2')](_0x5ed9('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x5ed9('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5ed9('0x5')]('in',_0x5ed9('0x6')),'defaultValue':_0x5ed9('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x5ed9('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x5ed9('0x7')]}};
\ No newline at end of file
+var _0x2904=['out','TEXT','DATE','sequelize','exports','medium','ENUM'];(function(_0x1c25e4,_0x18c03c){var _0x566bec=function(_0x4fd24e){while(--_0x4fd24e){_0x1c25e4['push'](_0x1c25e4['shift']());}};_0x566bec(++_0x18c03c);}(_0x2904,0x137));var _0x4290=function(_0x4446d2,_0x337f3a){_0x4446d2=_0x4446d2-0x0;var _0x26e301=_0x2904[_0x4446d2];return _0x26e301;};'use strict';var Sequelize=require(_0x4290('0x0'));module[_0x4290('0x1')]={'body':{'type':Sequelize['TEXT'](_0x4290('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x4290('0x3')]('in',_0x4290('0x4')),'defaultValue':_0x4290('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x4290('0x5')],'defaultValue':null},'readAt':{'type':Sequelize[_0x4290('0x6')]}};
\ No newline at end of file
index 15faa66..fc8a204 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe9d=['role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectmessage','create','CmContact','Attachment','findOne','AttachmentId','SendFax','FaxAccountId','isNil','/var/opt/motion2/server/files/attachments/%s','download','join','server','files','attachments','basename','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','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','localhost','redis','register','jayson/promise','client','http','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','error','message','result','catch','sendStatus','end','status','offset','undefined','limit','set','json','apply','reject','save','update','destroy','stack','name','send','index','map','type','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','options','count','FaxMessage','params','keys','rawAttributes','includeAll','find','body','describe','fax-interactions','accept','fax','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','read1stAt','format','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0xfe9d,0xb6));var _0xdfe9=function(_0x1b6895,_0x319457){_0x1b6895=_0x1b6895-0x0;var _0x23d42f=_0xfe9d[_0x1b6895];return _0x23d42f;};'use strict';var emlformat=require(_0xdfe9('0x0'));var rimraf=require(_0xdfe9('0x1'));var zipdir=require(_0xdfe9('0x2'));var jsonpatch=require(_0xdfe9('0x3'));var rp=require(_0xdfe9('0x4'));var moment=require(_0xdfe9('0x5'));var BPromise=require(_0xdfe9('0x6'));var Mustache=require(_0xdfe9('0x7'));var util=require(_0xdfe9('0x8'));var path=require('path');var sox=require(_0xdfe9('0x9'));var csv=require(_0xdfe9('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdfe9('0xb'));var _=require('lodash');var squel=require(_0xdfe9('0xc'));var crypto=require(_0xdfe9('0xd'));var jsforce=require(_0xdfe9('0xe'));var deskjs=require(_0xdfe9('0xf'));var toCsv=require(_0xdfe9('0xa'));var querystring=require(_0xdfe9('0x10'));var Papa=require(_0xdfe9('0x11'));var Redis=require(_0xdfe9('0x12'));var authService=require(_0xdfe9('0x13'));var qs=require(_0xdfe9('0x14'));var as=require(_0xdfe9('0x15'));var hardwareService=require(_0xdfe9('0x16'));var logger=require(_0xdfe9('0x17'))(_0xdfe9('0x18'));var utils=require(_0xdfe9('0x19'));var config=require(_0xdfe9('0x1a'));var licenseUtil=require(_0xdfe9('0x1b'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xdfe9('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdfe9('0x1d')]));require('./faxMessage.socket')[_0xdfe9('0x1e')](socket);var jayson=require(_0xdfe9('0x1f'));var client=jayson[_0xdfe9('0x20')][_0xdfe9('0x21')]({'port':0x232c});var client9002=jayson[_0xdfe9('0x20')][_0xdfe9('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x2b067e,_0x4d8b90,_0x416f5a,_0x43f4fb){return new BPromise(function(_0x40fcdd,_0x405f6e){var _0x12fee4=_0x43f4fb||client;return _0x12fee4['request'](_0x2b067e,_0x416f5a)[_0xdfe9('0x22')](function(_0x57ccda){logger[_0xdfe9('0x23')](_0xdfe9('0x24'),_0x4d8b90,_0xdfe9('0x25'));logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x4d8b90,_0xdfe9('0x25'),JSON['stringify'](_0x57ccda));if(_0x57ccda[_0xdfe9('0x26')]){if(_0x57ccda['error']['code']===0x1f4){logger[_0xdfe9('0x26')](_0xdfe9('0x24'),_0x4d8b90,_0x57ccda[_0xdfe9('0x26')][_0xdfe9('0x27')]);return _0x405f6e(_0x57ccda['error'][_0xdfe9('0x27')]);}logger['error'](_0xdfe9('0x24'),_0x4d8b90,_0x57ccda[_0xdfe9('0x26')][_0xdfe9('0x27')]);return _0x40fcdd(_0x57ccda[_0xdfe9('0x26')][_0xdfe9('0x27')]);}else{logger[_0xdfe9('0x23')]('FaxMessage,\x20%s,\x20%s',_0x4d8b90,_0xdfe9('0x25'));_0x40fcdd(_0x57ccda[_0xdfe9('0x28')][_0xdfe9('0x27')]);}})[_0xdfe9('0x29')](function(_0x463ca9){logger[_0xdfe9('0x26')](_0xdfe9('0x24'),_0x4d8b90,_0x463ca9);_0x405f6e(_0x463ca9);});});}function respondWithStatusCode(_0x4563b8,_0x41fb27){_0x41fb27=_0x41fb27||0xcc;return function(_0x17417a){if(_0x17417a){return _0x4563b8[_0xdfe9('0x2a')](_0x41fb27);}return _0x4563b8['status'](_0x41fb27)[_0xdfe9('0x2b')]();};}function respondWithResult(_0xa9d85,_0x18f08a){_0x18f08a=_0x18f08a||0xc8;return function(_0x5e8995){if(_0x5e8995){return _0xa9d85[_0xdfe9('0x2c')](_0x18f08a)['json'](_0x5e8995);}};}function respondWithFilteredResult(_0x5410b3,_0x51a5b9){return function(_0x4d0e41){if(_0x4d0e41){var _0x351e09=typeof _0x51a5b9[_0xdfe9('0x2d')]===_0xdfe9('0x2e')&&typeof _0x51a5b9[_0xdfe9('0x2f')]===_0xdfe9('0x2e');var _0x153808=_0x4d0e41['count'];var _0x58a7cf=_0x351e09?0x0:_0x51a5b9['offset'];var _0x374fc7=_0x351e09?_0x4d0e41['count']:_0x51a5b9['offset']+_0x51a5b9[_0xdfe9('0x2f')];var _0x432805;if(_0x374fc7>=_0x153808){_0x374fc7=_0x153808;_0x432805=0xc8;}else{_0x432805=0xce;}_0x5410b3[_0xdfe9('0x2c')](_0x432805);return _0x5410b3[_0xdfe9('0x30')]('Content-Range',_0x58a7cf+'-'+_0x374fc7+'/'+_0x153808)[_0xdfe9('0x31')](_0x4d0e41);}return null;};}function patchUpdates(_0x235b13){return function(_0x5f930f){try{jsonpatch[_0xdfe9('0x32')](_0x5f930f,_0x235b13,!![]);}catch(_0x3cb90d){return BPromise[_0xdfe9('0x33')](_0x3cb90d);}return _0x5f930f[_0xdfe9('0x34')]();};}function saveUpdates(_0x101098,_0x11765b){return function(_0x47dbdd){if(_0x47dbdd){return _0x47dbdd[_0xdfe9('0x35')](_0x101098)[_0xdfe9('0x22')](function(_0x26da0d){return _0x26da0d;});}return null;};}function removeEntity(_0x135506,_0x197b63){return function(_0x538bb6){if(_0x538bb6){return _0x538bb6[_0xdfe9('0x36')]()[_0xdfe9('0x22')](function(){_0x135506[_0xdfe9('0x2c')](0xcc)[_0xdfe9('0x2b')]();});}};}function handleEntityNotFound(_0x245975,_0x358a93){return function(_0xb4c351){if(!_0xb4c351){_0x245975[_0xdfe9('0x2a')](0x194);}return _0xb4c351;};}function handleError(_0x11e111,_0x33643b){_0x33643b=_0x33643b||0x1f4;return function(_0x3d5b1e){logger[_0xdfe9('0x26')](_0x3d5b1e[_0xdfe9('0x37')]);if(_0x3d5b1e[_0xdfe9('0x38')]){delete _0x3d5b1e[_0xdfe9('0x38')];}_0x11e111[_0xdfe9('0x2c')](_0x33643b)[_0xdfe9('0x39')](_0x3d5b1e);};}exports[_0xdfe9('0x3a')]=function(_0x1db492,_0x23029c){var _0x45a731={},_0x39f5b7={},_0x2b9349={'count':0x0,'rows':[]};var _0x3eeee2=_[_0xdfe9('0x3b')](db['FaxMessage']['rawAttributes'],function(_0x3745c0){return{'name':_0x3745c0['fieldName'],'type':_0x3745c0[_0xdfe9('0x3c')]['key']};});_0x39f5b7[_0xdfe9('0x3d')]=_[_0xdfe9('0x3b')](_0x3eeee2,_0xdfe9('0x38'));_0x39f5b7[_0xdfe9('0x3e')]=_['keys'](_0x1db492['query']);_0x39f5b7[_0xdfe9('0x3f')]=_['intersection'](_0x39f5b7[_0xdfe9('0x3d')],_0x39f5b7['query']);_0x45a731[_0xdfe9('0x40')]=_[_0xdfe9('0x41')](_0x39f5b7[_0xdfe9('0x3d')],qs['fields'](_0x1db492['query'][_0xdfe9('0x42')]));_0x45a731[_0xdfe9('0x40')]=_0x45a731[_0xdfe9('0x40')][_0xdfe9('0x43')]?_0x45a731[_0xdfe9('0x40')]:_0x39f5b7[_0xdfe9('0x3d')];if(!_0x1db492['query']['hasOwnProperty'](_0xdfe9('0x44'))){_0x45a731['limit']=qs[_0xdfe9('0x2f')](_0x1db492[_0xdfe9('0x3e')][_0xdfe9('0x2f')]);_0x45a731[_0xdfe9('0x2d')]=qs[_0xdfe9('0x2d')](_0x1db492['query'][_0xdfe9('0x2d')]);}_0x45a731[_0xdfe9('0x45')]=qs['sort'](_0x1db492['query'][_0xdfe9('0x46')]);_0x45a731[_0xdfe9('0x47')]=qs[_0xdfe9('0x3f')](_[_0xdfe9('0x48')](_0x1db492[_0xdfe9('0x3e')],_0x39f5b7[_0xdfe9('0x3f')]),_0x3eeee2);if(_0x1db492['query']['filter']){_0x45a731[_0xdfe9('0x47')]=_[_0xdfe9('0x49')](_0x45a731[_0xdfe9('0x47')],{'$or':_[_0xdfe9('0x3b')](_0x3eeee2,function(_0x9ba6fd){if(_0x9ba6fd[_0xdfe9('0x3c')]!==_0xdfe9('0x4a')){var _0x3e6775={};_0x3e6775[_0x9ba6fd[_0xdfe9('0x38')]]={'$like':'%'+_0x1db492[_0xdfe9('0x3e')]['filter']+'%'};return _0x3e6775;}})});}_0x45a731=_[_0xdfe9('0x49')]({},_0x45a731,_0x1db492[_0xdfe9('0x4b')]);var _0x3421ef={'where':_0x45a731[_0xdfe9('0x47')]};return db['FaxMessage']['count'](_0x3421ef)[_0xdfe9('0x22')](function(_0x5a4847){_0x2b9349[_0xdfe9('0x4c')]=_0x5a4847;if(_0x1db492[_0xdfe9('0x3e')]['includeAll']){_0x45a731['include']=[{'all':!![]}];}return db[_0xdfe9('0x4d')]['findAll'](_0x45a731);})[_0xdfe9('0x22')](function(_0x41c07e){_0x2b9349['rows']=_0x41c07e;return _0x2b9349;})[_0xdfe9('0x22')](respondWithFilteredResult(_0x23029c,_0x45a731))['catch'](handleError(_0x23029c,null));};exports['show']=function(_0x4c7263,_0x9f37b8){var _0xea4bc5={'raw':!![],'where':{'id':_0x4c7263[_0xdfe9('0x4e')]['id']}},_0x2817bb={};_0x2817bb[_0xdfe9('0x3d')]=_[_0xdfe9('0x4f')](db['FaxMessage'][_0xdfe9('0x50')]);_0x2817bb['query']=_[_0xdfe9('0x4f')](_0x4c7263[_0xdfe9('0x3e')]);_0x2817bb[_0xdfe9('0x3f')]=_[_0xdfe9('0x41')](_0x2817bb[_0xdfe9('0x3d')],_0x2817bb[_0xdfe9('0x3e')]);_0xea4bc5[_0xdfe9('0x40')]=_['intersection'](_0x2817bb[_0xdfe9('0x3d')],qs['fields'](_0x4c7263[_0xdfe9('0x3e')]['fields']));_0xea4bc5[_0xdfe9('0x40')]=_0xea4bc5[_0xdfe9('0x40')][_0xdfe9('0x43')]?_0xea4bc5[_0xdfe9('0x40')]:_0x2817bb[_0xdfe9('0x3d')];if(_0x4c7263[_0xdfe9('0x3e')][_0xdfe9('0x51')]){_0xea4bc5['include']=[{'all':!![]}];}_0xea4bc5=_['merge']({},_0xea4bc5,_0x4c7263[_0xdfe9('0x4b')]);return db[_0xdfe9('0x4d')][_0xdfe9('0x52')](_0xea4bc5)[_0xdfe9('0x22')](handleEntityNotFound(_0x9f37b8,null))['then'](respondWithResult(_0x9f37b8,null))['catch'](handleError(_0x9f37b8,null));};exports['update']=function(_0x2e0573,_0xc48d0f){if(_0x2e0573[_0xdfe9('0x53')]['id']){delete _0x2e0573[_0xdfe9('0x53')]['id'];}return db[_0xdfe9('0x4d')][_0xdfe9('0x52')]({'where':{'id':_0x2e0573[_0xdfe9('0x4e')]['id']}})['then'](handleEntityNotFound(_0xc48d0f,null))[_0xdfe9('0x22')](saveUpdates(_0x2e0573[_0xdfe9('0x53')],null))[_0xdfe9('0x22')](respondWithResult(_0xc48d0f,null))[_0xdfe9('0x29')](handleError(_0xc48d0f,null));};exports[_0xdfe9('0x36')]=function(_0xdbc4dc,_0x37cd22){return db['FaxMessage'][_0xdfe9('0x52')]({'where':{'id':_0xdbc4dc[_0xdfe9('0x4e')]['id']}})[_0xdfe9('0x22')](handleEntityNotFound(_0x37cd22,null))[_0xdfe9('0x22')](removeEntity(_0x37cd22,null))[_0xdfe9('0x29')](handleError(_0x37cd22,null));};exports[_0xdfe9('0x54')]=function(_0xa62990,_0x18ffe6){return db[_0xdfe9('0x4d')][_0xdfe9('0x54')]()[_0xdfe9('0x22')](respondWithResult(_0x18ffe6,null))[_0xdfe9('0x29')](handleError(_0x18ffe6,null));};var interaction_log=require(_0xdfe9('0x17'))(_0xdfe9('0x55'));exports[_0xdfe9('0x56')]=function(_0x32396e,_0xbe3c6,_0x1097cf){var _0x40d97e={'agent':{},'channel':_0xdfe9('0x57')};if(_0x32396e[_0xdfe9('0x53')]['id']){delete _0x32396e[_0xdfe9('0x53')]['id'];}_0x32396e[_0xdfe9('0x53')][_0xdfe9('0x58')]=!![];_0x32396e['body']['readAt']=moment()['format'](_0xdfe9('0x59'));_0x32396e[_0xdfe9('0x53')][_0xdfe9('0x5a')]=_0x32396e['body'][_0xdfe9('0x5a')]||_0x32396e[_0xdfe9('0x5b')]['id'];_0x40d97e[_0xdfe9('0x5c')]['id']=_0x32396e['body'][_0xdfe9('0x5a')];return db['FaxMessage'][_0xdfe9('0x52')]({'where':{'id':_0x32396e[_0xdfe9('0x4e')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xbe3c6,null))[_0xdfe9('0x22')](saveUpdates(_0x32396e[_0xdfe9('0x53')],null))[_0xdfe9('0x22')](function(_0x5b23d3){if(_0x5b23d3){_0x40d97e['message']=_0x5b23d3[_0xdfe9('0x5d')]({'plain':!![]});return db[_0xdfe9('0x5e')]['find']({'where':{'id':_0x5b23d3[_0xdfe9('0x5f')]}});}return null;})[_0xdfe9('0x22')](handleEntityNotFound(_0xbe3c6,null))[_0xdfe9('0x22')](function(_0x1dc11a){if(_0x1dc11a){return _0x1dc11a[_0xdfe9('0x35')]({'UserId':_0x32396e[_0xdfe9('0x53')][_0xdfe9('0x5a')],'read1stAt':_['isNil'](_0x1dc11a[_0xdfe9('0x60')])?moment()[_0xdfe9('0x61')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xdfe9('0x22')](function(_0x26852f){if(_0x26852f){_0x40d97e[_0xdfe9('0x62')]=_0x26852f[_0xdfe9('0x5d')]({'plain':!![]});interaction_log[_0xdfe9('0x23')](_0xdfe9('0x63'),_0x32396e['user']['id'],_0x32396e[_0xdfe9('0x5b')][_0xdfe9('0x38')],_0x32396e[_0xdfe9('0x5b')][_0xdfe9('0x64')],_0x40d97e[_0xdfe9('0x62')]['id'],_0x32396e[_0xdfe9('0x53')]?JSON[_0xdfe9('0x65')](_0x32396e[_0xdfe9('0x53')]):_0xdfe9('0x66'));return respondWithRpcPromise(_0xdfe9('0x67'),_0xdfe9('0x68'),_0x40d97e);}return null;})[_0xdfe9('0x22')](function(_0x2d4ed8){var _0x5b2a67=_0xdfe9('0x69')+_0x2d4ed8[_0xdfe9('0x27')][_0xdfe9('0x6a')];return db[_0xdfe9('0x6b')][_0xdfe9('0x3e')](_0x5b2a67,{'type':db[_0xdfe9('0x6c')][_0xdfe9('0x6d')][_0xdfe9('0x6e')],'raw':!![]})[_0xdfe9('0x22')](function(_0x29fe1a){return _0x29fe1a;});})[_0xdfe9('0x22')](function(_0x5423e9){if(_0x5423e9){_0x40d97e['message'][_0xdfe9('0x6f')]=_0x5423e9[0x0];if(!_0x32396e[_0xdfe9('0x53')][_0xdfe9('0x5a')])return;return db[_0xdfe9('0x70')][_0xdfe9('0x52')]({'where':{'id':_0x32396e['body'][_0xdfe9('0x5a')],'role':'agent'},'attributes':['id',_0xdfe9('0x38'),_0xdfe9('0x71'),_0xdfe9('0x72'),_0xdfe9('0x73')],'raw':!![]});}return null;})['then'](function(_0x11d982){if(!_0x11d982)return null;_0x40d97e[_0xdfe9('0x27')][_0xdfe9('0x5c')]=_0x11d982;return _0x40d97e;})[_0xdfe9('0x22')](function(_0x16df60){if(_0x16df60){if(_0x32396e[_0xdfe9('0x53')][_0xdfe9('0x74')]){_0x40d97e[_0xdfe9('0x27')][_0xdfe9('0x75')]=util[_0xdfe9('0x61')](_0xdfe9('0x76'),_0x32396e[_0xdfe9('0x5b')][_0xdfe9('0x38')]);_0x40d97e[_0xdfe9('0x27')][_0xdfe9('0x77')]=_0x40d97e['channel'];_0x40d97e[_0xdfe9('0x27')][_0xdfe9('0x78')]=_0x40d97e['channel'];_0x40d97e[_0xdfe9('0x27')][_0xdfe9('0x79')]=_0xdfe9('0x56');return respondWithRpcPromise(_0xdfe9('0x7a'),_0xdfe9('0x7a'),{'event':_0xdfe9('0x7b'),'message':_0x40d97e['message']},client9002)[_0xdfe9('0x22')](function(){return _0x40d97e;});}return _0x40d97e;}return null;})[_0xdfe9('0x22')](respondWithResult(_0xbe3c6,null))[_0xdfe9('0x29')](handleError(_0xbe3c6,null));};var interaction_log=require('../../config/logger')(_0xdfe9('0x55'));exports['reject']=function(_0x506033,_0x568e2b,_0x475e52){var _0xeed839={'agent':{},'channel':'fax'};if(_0x506033[_0xdfe9('0x53')]['id']){delete _0x506033['body']['id'];}_0x506033[_0xdfe9('0x53')][_0xdfe9('0x5a')]=_0x506033['body'][_0xdfe9('0x5a')]||_0x506033[_0xdfe9('0x5b')]['id'];_0xeed839[_0xdfe9('0x5c')]['id']=_0x506033[_0xdfe9('0x53')]['UserId'];return db[_0xdfe9('0x4d')][_0xdfe9('0x52')]({'where':{'id':_0x506033['params']['id'],'UserId':null}})[_0xdfe9('0x22')](handleEntityNotFound(_0x568e2b,null))[_0xdfe9('0x22')](function(_0x2a6241){if(_0x2a6241){_0xeed839[_0xdfe9('0x27')]=_0x2a6241[_0xdfe9('0x5d')]({'plain':!![]});return db[_0xdfe9('0x5e')][_0xdfe9('0x52')]({'where':{'id':_0x2a6241['FaxInteractionId']}});}return null;})[_0xdfe9('0x22')](handleEntityNotFound(_0x568e2b,null))[_0xdfe9('0x22')](function(_0x126a8b){if(_0x126a8b){_0xeed839[_0xdfe9('0x62')]=_0x126a8b[_0xdfe9('0x5d')]({'plain':!![]});interaction_log['info'](_0xdfe9('0x7c'),_0x506033['user']['id'],_0x506033[_0xdfe9('0x5b')]['name'],_0x506033[_0xdfe9('0x5b')][_0xdfe9('0x64')],_0xeed839[_0xdfe9('0x62')]['id'],_0x506033[_0xdfe9('0x53')]?JSON[_0xdfe9('0x65')](_0x506033[_0xdfe9('0x53')]):_0xdfe9('0x66'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0xeed839);}return null;})[_0xdfe9('0x22')](function(_0x408f86){var _0x488b0e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x408f86['message']['ContactId'];return db[_0xdfe9('0x6b')][_0xdfe9('0x3e')](_0x488b0e,{'type':db[_0xdfe9('0x6c')][_0xdfe9('0x6d')][_0xdfe9('0x6e')],'raw':!![]})['then'](function(_0x5b9ffa){return _0x5b9ffa;});})['then'](function(_0x565053){if(_0x565053){_0xeed839[_0xdfe9('0x27')]['contact']=_0x565053[0x0];if(!_0x506033[_0xdfe9('0x53')]['UserId'])return;return db[_0xdfe9('0x70')]['find']({'where':{'id':_0x506033['body'][_0xdfe9('0x5a')],'role':_0xdfe9('0x5c')},'attributes':['id','name',_0xdfe9('0x71'),_0xdfe9('0x72'),_0xdfe9('0x73')],'raw':!![]});}return null;})[_0xdfe9('0x22')](function(_0x4165bb){if(!_0x4165bb)return null;_0xeed839[_0xdfe9('0x27')]['agent']=_0x4165bb;return _0xeed839;})[_0xdfe9('0x22')](function(_0x5125bf){if(_0x5125bf){_0x5125bf[_0xdfe9('0x27')]['interface']=util[_0xdfe9('0x61')]('SIP/%s',_0x506033[_0xdfe9('0x5b')]['name']);_0x5125bf[_0xdfe9('0x27')]['channel']=_0xeed839['channel'];_0x5125bf['message'][_0xdfe9('0x78')]=_0xeed839[_0xdfe9('0x77')];_0x5125bf[_0xdfe9('0x27')][_0xdfe9('0x79')]=_0xdfe9('0x33');respondWithRpcPromise(_0xdfe9('0x7a'),'EventManager',{'event':_0xdfe9('0x7d'),'message':_0x5125bf[_0xdfe9('0x27')]},client9002);return _0xeed839;}return null;})[_0xdfe9('0x22')](respondWithResult(_0x568e2b,null))[_0xdfe9('0x29')](handleError(_0x568e2b,null));};exports[_0xdfe9('0x7e')]=function(_0x125874,_0x54d9db){var _0x17972b;return db['FaxMessage'][_0xdfe9('0x7e')](_0x125874[_0xdfe9('0x53')],{})[_0xdfe9('0x22')](function(_0x3d39d1){_0x17972b=_0x3d39d1;return db[_0xdfe9('0x7f')]['findOne']({'where':{'id':_0x17972b[_0xdfe9('0x6a')]}});})[_0xdfe9('0x22')](function(_0x5825a4){if(_['isNil'](_0x5825a4)){return;}else{_0x17972b['fax']=_0x5825a4[_0xdfe9('0x57')];return db[_0xdfe9('0x80')][_0xdfe9('0x81')]({'where':{'id':_0x17972b[_0xdfe9('0x82')]}});}})[_0xdfe9('0x22')](function(_0x12b4c1){return respondWithRpcPromise('SendFax',_0xdfe9('0x83'),{'FaxAccountId':_['isNil'](_0x125874['body'])?undefined:_0x125874[_0xdfe9('0x53')][_0xdfe9('0x84')],'path':_[_0xdfe9('0x85')](_0x12b4c1)?undefined:util[_0xdfe9('0x61')](_0xdfe9('0x86'),_0x12b4c1['basename']),'fax':_[_0xdfe9('0x85')](_0x17972b[_0xdfe9('0x57')])?undefined:_0x17972b['fax'],'AttachmentId':_0x17972b[_0xdfe9('0x82')]},client9002);})[_0xdfe9('0x22')](respondWithResult(_0x54d9db,0xc9))[_0xdfe9('0x29')](handleError(_0x54d9db,null));};exports[_0xdfe9('0x87')]=function(_0x5b2f83,_0x2765f6){var _0xc4026f=path[_0xdfe9('0x88')](config['root'],_0xdfe9('0x89'),_0xdfe9('0x8a'),_0xdfe9('0x8b'));return db['FaxMessage'][_0xdfe9('0x52')]({'where':{'id':_0x5b2f83[_0xdfe9('0x4e')]['id']},'include':[{'model':db['Attachment'],'as':_0xdfe9('0x80')}]})[_0xdfe9('0x22')](handleEntityNotFound(_0x2765f6,null))['then'](function(_0x2dc478){if(_0x2dc478){return _0x2765f6[_0xdfe9('0x87')](path[_0xdfe9('0x88')](_0xc4026f,_0x2dc478[_0xdfe9('0x80')][_0xdfe9('0x8c')]));}})[_0xdfe9('0x29')](handleError(_0x2765f6,null));};
\ No newline at end of file
+var _0xb2ec=['../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','sendStatus','stack','name','index','map','FaxMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','where','pick','filter','VIRTUAL','options','include','findAll','rows','show','includeAll','merge','body','find','params','../../config/logger','fax','readAt','format','user','agent','UserId','get','FaxInteraction','FaxInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','contact','email','interface','SIP/%s','motionChannel','channel','event','accept','EventManager','acceptmessage','fax-interactions','reject','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','ContactId','User','fullname','internal','rejectmessage','create','CmContact','isNil','Attachment','AttachmentId','SendFax','FaxAccountId','download','join','root','server','files','attachments','basename','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xb2ec,0x1ad));var _0xcb2e=function(_0x5df180,_0x253f8a){_0x5df180=_0x5df180-0x0;var _0x3f43dd=_0xb2ec[_0x5df180];return _0x3f43dd;};'use strict';var emlformat=require(_0xcb2e('0x0'));var rimraf=require(_0xcb2e('0x1'));var zipdir=require(_0xcb2e('0x2'));var jsonpatch=require(_0xcb2e('0x3'));var rp=require(_0xcb2e('0x4'));var moment=require(_0xcb2e('0x5'));var BPromise=require(_0xcb2e('0x6'));var Mustache=require(_0xcb2e('0x7'));var util=require(_0xcb2e('0x8'));var path=require(_0xcb2e('0x9'));var sox=require(_0xcb2e('0xa'));var csv=require('to-csv');var ejs=require(_0xcb2e('0xb'));var fs=require('fs');var fs_extra=require(_0xcb2e('0xc'));var _=require('lodash');var squel=require(_0xcb2e('0xd'));var crypto=require(_0xcb2e('0xe'));var jsforce=require(_0xcb2e('0xf'));var deskjs=require(_0xcb2e('0x10'));var toCsv=require('to-csv');var querystring=require(_0xcb2e('0x11'));var Papa=require(_0xcb2e('0x12'));var Redis=require(_0xcb2e('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xcb2e('0x14'));var as=require(_0xcb2e('0x15'));var hardwareService=require(_0xcb2e('0x16'));var logger=require('../../config/logger')(_0xcb2e('0x17'));var utils=require(_0xcb2e('0x18'));var config=require(_0xcb2e('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xcb2e('0x1a'))['db'];config[_0xcb2e('0x1b')]=_[_0xcb2e('0x1c')](config[_0xcb2e('0x1b')],{'host':_0xcb2e('0x1d'),'port':0x18eb});var socket=require(_0xcb2e('0x1e'))(new Redis(config[_0xcb2e('0x1b')]));require(_0xcb2e('0x1f'))[_0xcb2e('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0xcb2e('0x21')][_0xcb2e('0x22')]({'port':0x232c});var client9002=jayson['client'][_0xcb2e('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x6cbae2,_0xe6c6ee,_0x1c6906,_0x1ef35e){return new BPromise(function(_0x4854cc,_0x3cfad6){var _0x1f5cdb=_0x1ef35e||client;return _0x1f5cdb[_0xcb2e('0x23')](_0x6cbae2,_0x1c6906)[_0xcb2e('0x24')](function(_0x3cc95e){logger[_0xcb2e('0x25')](_0xcb2e('0x26'),_0xe6c6ee,'request\x20sent');logger[_0xcb2e('0x27')](_0xcb2e('0x28'),_0xe6c6ee,_0xcb2e('0x29'),JSON[_0xcb2e('0x2a')](_0x3cc95e));if(_0x3cc95e[_0xcb2e('0x2b')]){if(_0x3cc95e['error'][_0xcb2e('0x2c')]===0x1f4){logger['error'](_0xcb2e('0x26'),_0xe6c6ee,_0x3cc95e[_0xcb2e('0x2b')]['message']);return _0x3cfad6(_0x3cc95e[_0xcb2e('0x2b')][_0xcb2e('0x2d')]);}logger['error'](_0xcb2e('0x26'),_0xe6c6ee,_0x3cc95e[_0xcb2e('0x2b')][_0xcb2e('0x2d')]);return _0x4854cc(_0x3cc95e['error'][_0xcb2e('0x2d')]);}else{logger[_0xcb2e('0x25')]('FaxMessage,\x20%s,\x20%s',_0xe6c6ee,'request\x20sent');_0x4854cc(_0x3cc95e[_0xcb2e('0x2e')][_0xcb2e('0x2d')]);}})[_0xcb2e('0x2f')](function(_0x3c2624){logger[_0xcb2e('0x2b')](_0xcb2e('0x26'),_0xe6c6ee,_0x3c2624);_0x3cfad6(_0x3c2624);});});}function respondWithStatusCode(_0x373c02,_0x1840b1){_0x1840b1=_0x1840b1||0xcc;return function(_0x22e010){if(_0x22e010){return _0x373c02['sendStatus'](_0x1840b1);}return _0x373c02[_0xcb2e('0x30')](_0x1840b1)[_0xcb2e('0x31')]();};}function respondWithResult(_0x13833d,_0x529837){_0x529837=_0x529837||0xc8;return function(_0x4ce98b){if(_0x4ce98b){return _0x13833d[_0xcb2e('0x30')](_0x529837)[_0xcb2e('0x32')](_0x4ce98b);}};}function respondWithFilteredResult(_0x16ce74,_0x40b5fc){return function(_0x41c2eb){if(_0x41c2eb){var _0x1c4c8a=typeof _0x40b5fc[_0xcb2e('0x33')]===_0xcb2e('0x34')&&typeof _0x40b5fc[_0xcb2e('0x35')]===_0xcb2e('0x34');var _0x153eb0=_0x41c2eb[_0xcb2e('0x36')];var _0x14d83b=_0x1c4c8a?0x0:_0x40b5fc[_0xcb2e('0x33')];var _0x391f8b=_0x1c4c8a?_0x41c2eb['count']:_0x40b5fc[_0xcb2e('0x33')]+_0x40b5fc[_0xcb2e('0x35')];var _0x2d5b5a;if(_0x391f8b>=_0x153eb0){_0x391f8b=_0x153eb0;_0x2d5b5a=0xc8;}else{_0x2d5b5a=0xce;}_0x16ce74['status'](_0x2d5b5a);return _0x16ce74[_0xcb2e('0x37')](_0xcb2e('0x38'),_0x14d83b+'-'+_0x391f8b+'/'+_0x153eb0)[_0xcb2e('0x32')](_0x41c2eb);}return null;};}function patchUpdates(_0x1730fb){return function(_0x17e629){try{jsonpatch[_0xcb2e('0x39')](_0x17e629,_0x1730fb,!![]);}catch(_0x29a19a){return BPromise['reject'](_0x29a19a);}return _0x17e629[_0xcb2e('0x3a')]();};}function saveUpdates(_0x2dbeec,_0x41473d){return function(_0x210b62){if(_0x210b62){return _0x210b62[_0xcb2e('0x3b')](_0x2dbeec)[_0xcb2e('0x24')](function(_0x4fedd4){return _0x4fedd4;});}return null;};}function removeEntity(_0x1bd0d1,_0x1ef837){return function(_0x4787b1){if(_0x4787b1){return _0x4787b1[_0xcb2e('0x3c')]()[_0xcb2e('0x24')](function(){_0x1bd0d1[_0xcb2e('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1af292,_0x4e15c4){return function(_0x39ba85){if(!_0x39ba85){_0x1af292[_0xcb2e('0x3d')](0x194);}return _0x39ba85;};}function handleError(_0x4999be,_0x819db0){_0x819db0=_0x819db0||0x1f4;return function(_0x496ed3){logger[_0xcb2e('0x2b')](_0x496ed3[_0xcb2e('0x3e')]);if(_0x496ed3[_0xcb2e('0x3f')]){delete _0x496ed3[_0xcb2e('0x3f')];}_0x4999be[_0xcb2e('0x30')](_0x819db0)['send'](_0x496ed3);};}exports[_0xcb2e('0x40')]=function(_0x5ccbb3,_0x523dae){var _0x534d1e={},_0x1a1bb3={},_0x4fdc99={'count':0x0,'rows':[]};var _0x337e10=_[_0xcb2e('0x41')](db[_0xcb2e('0x42')][_0xcb2e('0x43')],function(_0x4ea658){return{'name':_0x4ea658[_0xcb2e('0x44')],'type':_0x4ea658[_0xcb2e('0x45')][_0xcb2e('0x46')]};});_0x1a1bb3[_0xcb2e('0x47')]=_[_0xcb2e('0x41')](_0x337e10,'name');_0x1a1bb3[_0xcb2e('0x48')]=_[_0xcb2e('0x49')](_0x5ccbb3[_0xcb2e('0x48')]);_0x1a1bb3[_0xcb2e('0x4a')]=_[_0xcb2e('0x4b')](_0x1a1bb3['model'],_0x1a1bb3[_0xcb2e('0x48')]);_0x534d1e[_0xcb2e('0x4c')]=_['intersection'](_0x1a1bb3[_0xcb2e('0x47')],qs['fields'](_0x5ccbb3[_0xcb2e('0x48')][_0xcb2e('0x4d')]));_0x534d1e['attributes']=_0x534d1e[_0xcb2e('0x4c')][_0xcb2e('0x4e')]?_0x534d1e[_0xcb2e('0x4c')]:_0x1a1bb3['model'];if(!_0x5ccbb3[_0xcb2e('0x48')]['hasOwnProperty'](_0xcb2e('0x4f'))){_0x534d1e[_0xcb2e('0x35')]=qs[_0xcb2e('0x35')](_0x5ccbb3[_0xcb2e('0x48')][_0xcb2e('0x35')]);_0x534d1e['offset']=qs[_0xcb2e('0x33')](_0x5ccbb3[_0xcb2e('0x48')][_0xcb2e('0x33')]);}_0x534d1e[_0xcb2e('0x50')]=qs['sort'](_0x5ccbb3['query']['sort']);_0x534d1e[_0xcb2e('0x51')]=qs[_0xcb2e('0x4a')](_[_0xcb2e('0x52')](_0x5ccbb3[_0xcb2e('0x48')],_0x1a1bb3[_0xcb2e('0x4a')]),_0x337e10);if(_0x5ccbb3[_0xcb2e('0x48')][_0xcb2e('0x53')]){_0x534d1e['where']=_['merge'](_0x534d1e[_0xcb2e('0x51')],{'$or':_[_0xcb2e('0x41')](_0x337e10,function(_0x3828d3){if(_0x3828d3[_0xcb2e('0x45')]!==_0xcb2e('0x54')){var _0x1ddc6f={};_0x1ddc6f[_0x3828d3[_0xcb2e('0x3f')]]={'$like':'%'+_0x5ccbb3[_0xcb2e('0x48')][_0xcb2e('0x53')]+'%'};return _0x1ddc6f;}})});}_0x534d1e=_['merge']({},_0x534d1e,_0x5ccbb3[_0xcb2e('0x55')]);var _0x56038c={'where':_0x534d1e[_0xcb2e('0x51')]};return db['FaxMessage'][_0xcb2e('0x36')](_0x56038c)[_0xcb2e('0x24')](function(_0xf14946){_0x4fdc99[_0xcb2e('0x36')]=_0xf14946;if(_0x5ccbb3['query']['includeAll']){_0x534d1e[_0xcb2e('0x56')]=[{'all':!![]}];}return db['FaxMessage'][_0xcb2e('0x57')](_0x534d1e);})[_0xcb2e('0x24')](function(_0x1b9e7b){_0x4fdc99[_0xcb2e('0x58')]=_0x1b9e7b;return _0x4fdc99;})[_0xcb2e('0x24')](respondWithFilteredResult(_0x523dae,_0x534d1e))[_0xcb2e('0x2f')](handleError(_0x523dae,null));};exports[_0xcb2e('0x59')]=function(_0x5dce21,_0x49d3d0){var _0x191f64={'raw':!![],'where':{'id':_0x5dce21['params']['id']}},_0x735a4e={};_0x735a4e[_0xcb2e('0x47')]=_['keys'](db[_0xcb2e('0x42')][_0xcb2e('0x43')]);_0x735a4e[_0xcb2e('0x48')]=_[_0xcb2e('0x49')](_0x5dce21['query']);_0x735a4e[_0xcb2e('0x4a')]=_[_0xcb2e('0x4b')](_0x735a4e[_0xcb2e('0x47')],_0x735a4e['query']);_0x191f64[_0xcb2e('0x4c')]=_['intersection'](_0x735a4e['model'],qs[_0xcb2e('0x4d')](_0x5dce21[_0xcb2e('0x48')][_0xcb2e('0x4d')]));_0x191f64[_0xcb2e('0x4c')]=_0x191f64['attributes'][_0xcb2e('0x4e')]?_0x191f64[_0xcb2e('0x4c')]:_0x735a4e[_0xcb2e('0x47')];if(_0x5dce21[_0xcb2e('0x48')][_0xcb2e('0x5a')]){_0x191f64[_0xcb2e('0x56')]=[{'all':!![]}];}_0x191f64=_[_0xcb2e('0x5b')]({},_0x191f64,_0x5dce21[_0xcb2e('0x55')]);return db['FaxMessage']['find'](_0x191f64)[_0xcb2e('0x24')](handleEntityNotFound(_0x49d3d0,null))['then'](respondWithResult(_0x49d3d0,null))['catch'](handleError(_0x49d3d0,null));};exports['update']=function(_0x55fd0e,_0x535f4b){if(_0x55fd0e['body']['id']){delete _0x55fd0e[_0xcb2e('0x5c')]['id'];}return db[_0xcb2e('0x42')][_0xcb2e('0x5d')]({'where':{'id':_0x55fd0e[_0xcb2e('0x5e')]['id']}})['then'](handleEntityNotFound(_0x535f4b,null))[_0xcb2e('0x24')](saveUpdates(_0x55fd0e['body'],null))['then'](respondWithResult(_0x535f4b,null))[_0xcb2e('0x2f')](handleError(_0x535f4b,null));};exports[_0xcb2e('0x3c')]=function(_0x22d831,_0x353896){return db['FaxMessage'][_0xcb2e('0x5d')]({'where':{'id':_0x22d831[_0xcb2e('0x5e')]['id']}})[_0xcb2e('0x24')](handleEntityNotFound(_0x353896,null))[_0xcb2e('0x24')](removeEntity(_0x353896,null))[_0xcb2e('0x2f')](handleError(_0x353896,null));};exports['describe']=function(_0x42aecd,_0x3ff541){return db['FaxMessage']['describe']()[_0xcb2e('0x24')](respondWithResult(_0x3ff541,null))[_0xcb2e('0x2f')](handleError(_0x3ff541,null));};var interaction_log=require(_0xcb2e('0x5f'))('fax-interactions');exports['accept']=function(_0x413d2d,_0xa95d3a,_0x3c135e){var _0x3b7433={'agent':{},'channel':_0xcb2e('0x60')};if(_0x413d2d[_0xcb2e('0x5c')]['id']){delete _0x413d2d['body']['id'];}_0x413d2d[_0xcb2e('0x5c')]['read']=!![];_0x413d2d[_0xcb2e('0x5c')][_0xcb2e('0x61')]=moment()[_0xcb2e('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0x413d2d[_0xcb2e('0x5c')]['UserId']=_0x413d2d[_0xcb2e('0x5c')]['UserId']||_0x413d2d[_0xcb2e('0x63')]['id'];_0x3b7433[_0xcb2e('0x64')]['id']=_0x413d2d[_0xcb2e('0x5c')][_0xcb2e('0x65')];return db[_0xcb2e('0x42')][_0xcb2e('0x5d')]({'where':{'id':_0x413d2d[_0xcb2e('0x5e')]['id'],'UserId':null}})[_0xcb2e('0x24')](handleEntityNotFound(_0xa95d3a,null))[_0xcb2e('0x24')](saveUpdates(_0x413d2d[_0xcb2e('0x5c')],null))[_0xcb2e('0x24')](function(_0x7b3753){if(_0x7b3753){_0x3b7433['message']=_0x7b3753[_0xcb2e('0x66')]({'plain':!![]});return db[_0xcb2e('0x67')][_0xcb2e('0x5d')]({'where':{'id':_0x7b3753[_0xcb2e('0x68')]}});}return null;})[_0xcb2e('0x24')](handleEntityNotFound(_0xa95d3a,null))['then'](function(_0x288cf6){if(_0x288cf6){return _0x288cf6[_0xcb2e('0x3b')]({'UserId':_0x413d2d['body'][_0xcb2e('0x65')],'read1stAt':_['isNil'](_0x288cf6[_0xcb2e('0x69')])?moment()[_0xcb2e('0x62')](_0xcb2e('0x6a')):undefined});}return null;})[_0xcb2e('0x24')](function(_0x3b0bdf){if(_0x3b0bdf){_0x3b7433['interaction']=_0x3b0bdf[_0xcb2e('0x66')]({'plain':!![]});interaction_log[_0xcb2e('0x25')](_0xcb2e('0x6b'),_0x413d2d[_0xcb2e('0x63')]['id'],_0x413d2d[_0xcb2e('0x63')][_0xcb2e('0x3f')],_0x413d2d[_0xcb2e('0x63')][_0xcb2e('0x6c')],_0x3b7433[_0xcb2e('0x6d')]['id'],_0x413d2d[_0xcb2e('0x5c')]?JSON[_0xcb2e('0x2a')](_0x413d2d[_0xcb2e('0x5c')]):'null');return respondWithRpcPromise(_0xcb2e('0x6e'),_0xcb2e('0x6f'),_0x3b7433);}return null;})[_0xcb2e('0x24')](function(_0x23ce6c){var _0x2c8f5d=_0xcb2e('0x70')+_0x23ce6c[_0xcb2e('0x2d')]['ContactId'];return db[_0xcb2e('0x71')][_0xcb2e('0x48')](_0x2c8f5d,{'type':db['Sequelize'][_0xcb2e('0x72')][_0xcb2e('0x73')],'raw':!![]})[_0xcb2e('0x24')](function(_0x359878){return _0x359878;});})[_0xcb2e('0x24')](function(_0x287536){if(_0x287536){_0x3b7433[_0xcb2e('0x2d')][_0xcb2e('0x74')]=_0x287536[0x0];if(!_0x413d2d[_0xcb2e('0x5c')][_0xcb2e('0x65')])return;return db['User'][_0xcb2e('0x5d')]({'where':{'id':_0x413d2d[_0xcb2e('0x5c')][_0xcb2e('0x65')],'role':_0xcb2e('0x64')},'attributes':['id',_0xcb2e('0x3f'),'fullname',_0xcb2e('0x75'),'internal'],'raw':!![]});}return null;})[_0xcb2e('0x24')](function(_0x30ab58){if(!_0x30ab58)return null;_0x3b7433[_0xcb2e('0x2d')][_0xcb2e('0x64')]=_0x30ab58;return _0x3b7433;})[_0xcb2e('0x24')](function(_0x159315){if(_0x159315){if(_0x413d2d[_0xcb2e('0x5c')]['manual']){_0x3b7433['message'][_0xcb2e('0x76')]=util['format'](_0xcb2e('0x77'),_0x413d2d[_0xcb2e('0x63')][_0xcb2e('0x3f')]);_0x3b7433['message']['channel']=_0x3b7433['channel'];_0x3b7433['message'][_0xcb2e('0x78')]=_0x3b7433[_0xcb2e('0x79')];_0x3b7433['message'][_0xcb2e('0x7a')]=_0xcb2e('0x7b');return respondWithRpcPromise(_0xcb2e('0x7c'),_0xcb2e('0x7c'),{'event':_0xcb2e('0x7d'),'message':_0x3b7433['message']},client9002)[_0xcb2e('0x24')](function(){return _0x3b7433;});}return _0x3b7433;}return null;})[_0xcb2e('0x24')](respondWithResult(_0xa95d3a,null))[_0xcb2e('0x2f')](handleError(_0xa95d3a,null));};var interaction_log=require(_0xcb2e('0x5f'))(_0xcb2e('0x7e'));exports[_0xcb2e('0x7f')]=function(_0x1072c7,_0x48c1ea,_0x15ffb8){var _0x24f46a={'agent':{},'channel':_0xcb2e('0x60')};if(_0x1072c7[_0xcb2e('0x5c')]['id']){delete _0x1072c7[_0xcb2e('0x5c')]['id'];}_0x1072c7[_0xcb2e('0x5c')][_0xcb2e('0x65')]=_0x1072c7['body']['UserId']||_0x1072c7[_0xcb2e('0x63')]['id'];_0x24f46a[_0xcb2e('0x64')]['id']=_0x1072c7['body'][_0xcb2e('0x65')];return db['FaxMessage'][_0xcb2e('0x5d')]({'where':{'id':_0x1072c7[_0xcb2e('0x5e')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x48c1ea,null))[_0xcb2e('0x24')](function(_0x5db8c7){if(_0x5db8c7){_0x24f46a[_0xcb2e('0x2d')]=_0x5db8c7['get']({'plain':!![]});return db[_0xcb2e('0x67')][_0xcb2e('0x5d')]({'where':{'id':_0x5db8c7['FaxInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x48c1ea,null))[_0xcb2e('0x24')](function(_0x76a723){if(_0x76a723){_0x24f46a[_0xcb2e('0x6d')]=_0x76a723[_0xcb2e('0x66')]({'plain':!![]});interaction_log[_0xcb2e('0x25')](_0xcb2e('0x80'),_0x1072c7[_0xcb2e('0x63')]['id'],_0x1072c7[_0xcb2e('0x63')][_0xcb2e('0x3f')],_0x1072c7[_0xcb2e('0x63')][_0xcb2e('0x6c')],_0x24f46a[_0xcb2e('0x6d')]['id'],_0x1072c7['body']?JSON['stringify'](_0x1072c7[_0xcb2e('0x5c')]):_0xcb2e('0x81'));return respondWithRpcPromise(_0xcb2e('0x82'),_0xcb2e('0x83'),_0x24f46a);}return null;})[_0xcb2e('0x24')](function(_0x372db4){var _0x442671=_0xcb2e('0x70')+_0x372db4['message'][_0xcb2e('0x84')];return db[_0xcb2e('0x71')][_0xcb2e('0x48')](_0x442671,{'type':db['Sequelize'][_0xcb2e('0x72')][_0xcb2e('0x73')],'raw':!![]})[_0xcb2e('0x24')](function(_0x353d90){return _0x353d90;});})['then'](function(_0x345d31){if(_0x345d31){_0x24f46a['message']['contact']=_0x345d31[0x0];if(!_0x1072c7[_0xcb2e('0x5c')][_0xcb2e('0x65')])return;return db[_0xcb2e('0x85')][_0xcb2e('0x5d')]({'where':{'id':_0x1072c7[_0xcb2e('0x5c')][_0xcb2e('0x65')],'role':'agent'},'attributes':['id',_0xcb2e('0x3f'),_0xcb2e('0x86'),'email',_0xcb2e('0x87')],'raw':!![]});}return null;})[_0xcb2e('0x24')](function(_0x452d81){if(!_0x452d81)return null;_0x24f46a[_0xcb2e('0x2d')][_0xcb2e('0x64')]=_0x452d81;return _0x24f46a;})[_0xcb2e('0x24')](function(_0x1c35c6){if(_0x1c35c6){_0x1c35c6[_0xcb2e('0x2d')][_0xcb2e('0x76')]=util[_0xcb2e('0x62')](_0xcb2e('0x77'),_0x1072c7['user'][_0xcb2e('0x3f')]);_0x1c35c6['message'][_0xcb2e('0x79')]=_0x24f46a[_0xcb2e('0x79')];_0x1c35c6[_0xcb2e('0x2d')]['motionChannel']=_0x24f46a[_0xcb2e('0x79')];_0x1c35c6[_0xcb2e('0x2d')][_0xcb2e('0x7a')]=_0xcb2e('0x7f');respondWithRpcPromise(_0xcb2e('0x7c'),'EventManager',{'event':_0xcb2e('0x88'),'message':_0x1c35c6['message']},client9002);return _0x24f46a;}return null;})[_0xcb2e('0x24')](respondWithResult(_0x48c1ea,null))['catch'](handleError(_0x48c1ea,null));};exports[_0xcb2e('0x89')]=function(_0x9177a2,_0xe9ec8a){var _0x10a979;return db[_0xcb2e('0x42')][_0xcb2e('0x89')](_0x9177a2[_0xcb2e('0x5c')],{})[_0xcb2e('0x24')](function(_0x2ad0f0){_0x10a979=_0x2ad0f0;return db[_0xcb2e('0x8a')]['findOne']({'where':{'id':_0x10a979[_0xcb2e('0x84')]}});})[_0xcb2e('0x24')](function(_0x3ac668){if(_[_0xcb2e('0x8b')](_0x3ac668)){return;}else{_0x10a979[_0xcb2e('0x60')]=_0x3ac668['fax'];return db[_0xcb2e('0x8c')]['findOne']({'where':{'id':_0x10a979[_0xcb2e('0x8d')]}});}})['then'](function(_0x5e2038){return respondWithRpcPromise(_0xcb2e('0x8e'),_0xcb2e('0x8e'),{'FaxAccountId':_['isNil'](_0x9177a2[_0xcb2e('0x5c')])?undefined:_0x9177a2[_0xcb2e('0x5c')][_0xcb2e('0x8f')],'path':_['isNil'](_0x5e2038)?undefined:util[_0xcb2e('0x62')]('/var/opt/motion2/server/files/attachments/%s',_0x5e2038['basename']),'fax':_[_0xcb2e('0x8b')](_0x10a979['fax'])?undefined:_0x10a979['fax'],'AttachmentId':_0x10a979[_0xcb2e('0x8d')]},client9002);})[_0xcb2e('0x24')](respondWithResult(_0xe9ec8a,0xc9))[_0xcb2e('0x2f')](handleError(_0xe9ec8a,null));};exports[_0xcb2e('0x90')]=function(_0x21b74c,_0x29dbd3){var _0x28c21e=path[_0xcb2e('0x91')](config[_0xcb2e('0x92')],_0xcb2e('0x93'),_0xcb2e('0x94'),_0xcb2e('0x95'));return db[_0xcb2e('0x42')][_0xcb2e('0x5d')]({'where':{'id':_0x21b74c[_0xcb2e('0x5e')]['id']},'include':[{'model':db['Attachment'],'as':'Attachment'}]})[_0xcb2e('0x24')](handleEntityNotFound(_0x29dbd3,null))[_0xcb2e('0x24')](function(_0x240894){if(_0x240894){return _0x29dbd3['download'](path[_0xcb2e('0x91')](_0x28c21e,_0x240894[_0xcb2e('0x8c')][_0xcb2e('0x96')]));}})[_0xcb2e('0x2f')](handleError(_0x29dbd3,null));};
\ No newline at end of file
index 29aedad..f2e6e55 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa7ee=['exports','events','FaxMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0xa7ee,0x159));var _0xea7e=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xa7ee[_0x55e08b];return _0xd1a7ff;};'use strict';var EventEmitter=require(_0xea7e('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0xea7e('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xea7e('0x2')](0x0);var events={'afterCreate':_0xea7e('0x3'),'afterUpdate':_0xea7e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x547937){return function(_0x1a88ef,_0x5ef5bd,_0x2439f9){FaxMessageEvents[_0xea7e('0x5')](_0x547937+':'+_0x1a88ef['id'],_0x1a88ef);FaxMessageEvents[_0xea7e('0x5')](_0x547937,_0x1a88ef);_0x2439f9(null);};}for(var e in events){if(events[_0xea7e('0x6')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0xea7e('0x7')]=FaxMessageEvents;
\ No newline at end of file
+var _0xcac3=['hasOwnProperty','hook','exports','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','emit'];(function(_0x2c250d,_0x2c76ac){var _0x2c29fb=function(_0x5583ac){while(--_0x5583ac){_0x2c250d['push'](_0x2c250d['shift']());}};_0x2c29fb(++_0x2c76ac);}(_0xcac3,0x193));var _0x3cac=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xcac3[_0x411add];return _0x238242;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x3cac('0x0'))['db'][_0x3cac('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x3cac('0x2')](0x0);var events={'afterCreate':_0x3cac('0x3'),'afterUpdate':_0x3cac('0x4'),'afterDestroy':_0x3cac('0x5')};function emitEvent(_0x40033c){return function(_0xce6bcd,_0x2d7790,_0x346c24){FaxMessageEvents[_0x3cac('0x6')](_0x40033c+':'+_0xce6bcd['id'],_0xce6bcd);FaxMessageEvents[_0x3cac('0x6')](_0x40033c,_0xce6bcd);_0x346c24(null);};}for(var e in events){if(events[_0x3cac('0x7')](e)){var event=events[e];FaxMessage[_0x3cac('0x8')](e,emitEvent(event));}}module[_0x3cac('0x9')]=FaxMessageEvents;
\ No newline at end of file
index e22eacb..c336e5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e34=['then','createdAt','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','exports','define','FaxMessage','fax_messages','fti_fax_messages','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId'];(function(_0x3f6c60,_0x486af8){var _0x2bbe6a=function(_0x25c875){while(--_0x25c875){_0x3f6c60['push'](_0x3f6c60['shift']());}};_0x2bbe6a(++_0x486af8);}(_0x1e34,0x1e0));var _0x41e3=function(_0x240bdd,_0x52054e){_0x240bdd=_0x240bdd-0x0;var _0x17f6f7=_0x1e34[_0x240bdd];return _0x17f6f7;};'use strict';var _=require(_0x41e3('0x0'));var util=require(_0x41e3('0x1'));var logger=require(_0x41e3('0x2'))(_0x41e3('0x3'));var moment=require('moment');var BPromise=require(_0x41e3('0x4'));var rp=require(_0x41e3('0x5'));var fs=require('fs');var path=require(_0x41e3('0x6'));var rimraf=require(_0x41e3('0x7'));var config=require('../../config/environment');var attributes=require('./faxMessage.attributes');module[_0x41e3('0x8')]=function(_0x18f1fa,_0x2170cf){return _0x18f1fa[_0x41e3('0x9')](_0x41e3('0xa'),attributes,{'tableName':_0x41e3('0xb'),'paranoid':![],'indexes':[{'name':_0x41e3('0xc'),'fields':['body'],'type':_0x41e3('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2703c9,_0xfe6312,_0x3efc2b){var _0x295051=_0x18f1fa[_0x41e3('0xe')];var _0x2080df=_0x2703c9[_0x41e3('0xf')]({'plain':!![]});if(_0x2080df[_0x41e3('0x10')][_0x41e3('0x11')]()==='in'||_0x2080df[_0x41e3('0x10')][_0x41e3('0x11')]()==='out'&&!_0x2080df[_0x41e3('0x12')]&&!_[_0x41e3('0x13')](_0x2080df[_0x41e3('0x14')])){_0x295051[_0x41e3('0x15')][_0x41e3('0x16')]({'where':{'id':_0x2080df[_0x41e3('0x17')]}})[_0x41e3('0x18')](function(_0x552266){if(_0x552266){_0x552266['update']({'lastMsgAt':_0x2080df[_0x41e3('0x19')],'lastMsgDirection':_0x2080df[_0x41e3('0x10')][_0x41e3('0x11')]()});}})['catch'](function(_0x5b215a){console['error'](_0x5b215a);});}_0x3efc2b();}},'charset':_0x41e3('0x1a'),'collate':_0x41e3('0x1b')});};
\ No newline at end of file
+var _0x695c=['./faxMessage.attributes','exports','define','FaxMessage','fax_messages','FULLTEXT','models','direction','toLowerCase','out','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','createdAt','error','utf8mb4','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x5be273,_0x53d0d9){var _0x3333e1=function(_0x22eafa){while(--_0x22eafa){_0x5be273['push'](_0x5be273['shift']());}};_0x3333e1(++_0x53d0d9);}(_0x695c,0xc2));var _0xc695=function(_0x166943,_0x27092c){_0x166943=_0x166943-0x0;var _0x4138c3=_0x695c[_0x166943];return _0x4138c3;};'use strict';var _=require('lodash');var util=require(_0xc695('0x0'));var logger=require(_0xc695('0x1'))('api');var moment=require(_0xc695('0x2'));var BPromise=require('bluebird');var rp=require(_0xc695('0x3'));var fs=require('fs');var path=require(_0xc695('0x4'));var rimraf=require(_0xc695('0x5'));var config=require('../../config/environment');var attributes=require(_0xc695('0x6'));module[_0xc695('0x7')]=function(_0x323e64,_0x239a82){return _0x323e64[_0xc695('0x8')](_0xc695('0x9'),attributes,{'tableName':_0xc695('0xa'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':['body'],'type':_0xc695('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x87cda7,_0x122fd6,_0x519c1a){var _0x456918=_0x323e64[_0xc695('0xc')];var _0x356417=_0x87cda7['get']({'plain':!![]});if(_0x356417[_0xc695('0xd')][_0xc695('0xe')]()==='in'||_0x356417[_0xc695('0xd')][_0xc695('0xe')]()===_0xc695('0xf')&&!_0x356417['secret']&&!_[_0xc695('0x10')](_0x356417[_0xc695('0x11')])){_0x456918[_0xc695('0x12')][_0xc695('0x13')]({'where':{'id':_0x356417[_0xc695('0x14')]}})[_0xc695('0x15')](function(_0x647e83){if(_0x647e83){_0x647e83['update']({'lastMsgAt':_0x356417[_0xc695('0x16')],'lastMsgDirection':_0x356417[_0xc695('0xd')][_0xc695('0xe')]()});}})['catch'](function(_0xb2e684){console[_0xc695('0x17')](_0xb2e684);});}_0x519c1a();}},'charset':_0xc695('0x18'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index fdf961b..fdf45ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b84=['CreateFaxMessage','FaxMessage','create','body','options','raw','stringify','UpdateFaxMessage','attributes','catch','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','http','defaults','localhost','./faxMessage.socket','register','request','then','info','request\x20sent','debug','error','message','FaxMessage,\x20%s,\x20%s','result'];(function(_0x47909c,_0xd75b59){var _0x565c35=function(_0x2b1382){while(--_0x2b1382){_0x47909c['push'](_0x47909c['shift']());}};_0x565c35(++_0xd75b59);}(_0x4b84,0x1cc));var _0x44b8=function(_0x3f00ee,_0x1d1673){_0x3f00ee=_0x3f00ee-0x0;var _0x18a07e=_0x4b84[_0x3f00ee];return _0x18a07e;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x44b8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x44b8('0x3'));var logger=require(_0x44b8('0x4'))(_0x44b8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x44b8('0x6')]({'port':0x232a});config['redis']=_[_0x44b8('0x7')](config['redis'],{'host':_0x44b8('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x44b8('0x9'))[_0x44b8('0xa')](socket);function respondWithRpcPromise(_0x30ebc3,_0x48a371,_0xc650ec){return new BPromise(function(_0x2cc74b,_0x4315f6){return client[_0x44b8('0xb')](_0x30ebc3,_0xc650ec)[_0x44b8('0xc')](function(_0x37e471){logger[_0x44b8('0xd')]('FaxMessage,\x20%s,\x20%s',_0x48a371,_0x44b8('0xe'));logger[_0x44b8('0xf')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x48a371,_0x44b8('0xe'),JSON['stringify'](_0x37e471));if(_0x37e471[_0x44b8('0x10')]){if(_0x37e471[_0x44b8('0x10')]['code']===0x1f4){logger[_0x44b8('0x10')]('FaxMessage,\x20%s,\x20%s',_0x48a371,_0x37e471['error'][_0x44b8('0x11')]);return _0x4315f6(_0x37e471[_0x44b8('0x10')][_0x44b8('0x11')]);}logger[_0x44b8('0x10')]('FaxMessage,\x20%s,\x20%s',_0x48a371,_0x37e471['error']['message']);return _0x2cc74b(_0x37e471[_0x44b8('0x10')]['message']);}else{logger[_0x44b8('0xd')](_0x44b8('0x12'),_0x48a371,'request\x20sent');_0x2cc74b(_0x37e471[_0x44b8('0x13')][_0x44b8('0x11')]);}})['catch'](function(_0x89bc30){logger[_0x44b8('0x10')]('FaxMessage,\x20%s,\x20%s',_0x48a371,_0x89bc30);_0x4315f6(_0x89bc30);});});}exports[_0x44b8('0x14')]=function(_0x8b4301){var _0xebfe79=this;return new Promise(function(_0x235bdc,_0x102ef9){return db[_0x44b8('0x15')][_0x44b8('0x16')](_0x8b4301[_0x44b8('0x17')],{'raw':_0x8b4301[_0x44b8('0x18')]?_0x8b4301[_0x44b8('0x18')][_0x44b8('0x19')]===undefined?!![]:![]:!![]})[_0x44b8('0xc')](function(_0x48327e){logger[_0x44b8('0xd')](_0x44b8('0x14'),_0x8b4301);logger[_0x44b8('0xf')](_0x44b8('0x14'),_0x8b4301,JSON[_0x44b8('0x1a')](_0x48327e));_0x235bdc(_0x48327e);})['catch'](function(_0x402497){logger['error'](_0x44b8('0x14'),_0x402497[_0x44b8('0x11')],_0x8b4301);_0x102ef9(_0xebfe79[_0x44b8('0x10')](0x1f4,_0x402497[_0x44b8('0x11')]));});});};exports[_0x44b8('0x1b')]=function(_0x59acbc){var _0x474f01=this;return new Promise(function(_0x502acf,_0x41d673){return db[_0x44b8('0x15')]['update'](_0x59acbc[_0x44b8('0x17')],{'raw':_0x59acbc[_0x44b8('0x18')]?_0x59acbc[_0x44b8('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59acbc[_0x44b8('0x18')]?_0x59acbc[_0x44b8('0x18')]['where']||null:null,'attributes':_0x59acbc[_0x44b8('0x18')]?_0x59acbc['options'][_0x44b8('0x1c')]||null:null,'limit':_0x59acbc['options']?_0x59acbc['options']['limit']||null:null})[_0x44b8('0xc')](function(_0x29b18d){logger[_0x44b8('0xd')](_0x44b8('0x1b'),_0x59acbc);logger[_0x44b8('0xf')](_0x44b8('0x1b'),_0x59acbc,JSON[_0x44b8('0x1a')](_0x29b18d));_0x502acf(_0x29b18d);})[_0x44b8('0x1d')](function(_0xd1d320){logger[_0x44b8('0x10')](_0x44b8('0x1b'),_0xd1d320[_0x44b8('0x11')],_0x59acbc);_0x41d673(_0x474f01[_0x44b8('0x10')](0x1f4,_0xd1d320['message']));});});};
\ No newline at end of file
+var _0xeec6=['FaxMessage','create','body','options','then','catch','UpdateFaxMessage','update','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','CreateFaxMessage'];(function(_0x4b604c,_0x47486f){var _0x3d5fc0=function(_0x213673){while(--_0x213673){_0x4b604c['push'](_0x4b604c['shift']());}};_0x3d5fc0(++_0x47486f);}(_0xeec6,0x1c2));var _0x6eec=function(_0x2803dc,_0x1cdaf1){_0x2803dc=_0x2803dc-0x0;var _0x552ae4=_0xeec6[_0x2803dc];return _0x552ae4;};'use strict';var _=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var moment=require(_0x6eec('0x2'));var BPromise=require(_0x6eec('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6eec('0x4'));var db=require(_0x6eec('0x5'))['db'];var utils=require(_0x6eec('0x6'));var logger=require(_0x6eec('0x7'))(_0x6eec('0x8'));var config=require(_0x6eec('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6eec('0xa')][_0x6eec('0xb')]({'port':0x232a});config['redis']=_[_0x6eec('0xc')](config[_0x6eec('0xd')],{'host':_0x6eec('0xe'),'port':0x18eb});var socket=require(_0x6eec('0xf'))(new Redis(config['redis']));require(_0x6eec('0x10'))[_0x6eec('0x11')](socket);function respondWithRpcPromise(_0x1c774d,_0x49ad4c,_0x595dd4){return new BPromise(function(_0x5e8aba,_0x295cae){return client[_0x6eec('0x12')](_0x1c774d,_0x595dd4)['then'](function(_0x4b8de1){logger[_0x6eec('0x13')]('FaxMessage,\x20%s,\x20%s',_0x49ad4c,_0x6eec('0x14'));logger[_0x6eec('0x15')](_0x6eec('0x16'),_0x49ad4c,_0x6eec('0x14'),JSON[_0x6eec('0x17')](_0x4b8de1));if(_0x4b8de1['error']){if(_0x4b8de1[_0x6eec('0x18')][_0x6eec('0x19')]===0x1f4){logger[_0x6eec('0x18')](_0x6eec('0x1a'),_0x49ad4c,_0x4b8de1[_0x6eec('0x18')][_0x6eec('0x1b')]);return _0x295cae(_0x4b8de1[_0x6eec('0x18')][_0x6eec('0x1b')]);}logger[_0x6eec('0x18')](_0x6eec('0x1a'),_0x49ad4c,_0x4b8de1['error'][_0x6eec('0x1b')]);return _0x5e8aba(_0x4b8de1['error'][_0x6eec('0x1b')]);}else{logger[_0x6eec('0x13')]('FaxMessage,\x20%s,\x20%s',_0x49ad4c,_0x6eec('0x14'));_0x5e8aba(_0x4b8de1[_0x6eec('0x1c')][_0x6eec('0x1b')]);}})['catch'](function(_0x87f3be){logger[_0x6eec('0x18')](_0x6eec('0x1a'),_0x49ad4c,_0x87f3be);_0x295cae(_0x87f3be);});});}exports[_0x6eec('0x1d')]=function(_0xd86135){var _0x1761f4=this;return new Promise(function(_0x536429,_0x328693){return db[_0x6eec('0x1e')][_0x6eec('0x1f')](_0xd86135[_0x6eec('0x20')],{'raw':_0xd86135[_0x6eec('0x21')]?_0xd86135[_0x6eec('0x21')]['raw']===undefined?!![]:![]:!![]})[_0x6eec('0x22')](function(_0x852d08){logger[_0x6eec('0x13')](_0x6eec('0x1d'),_0xd86135);logger[_0x6eec('0x15')](_0x6eec('0x1d'),_0xd86135,JSON['stringify'](_0x852d08));_0x536429(_0x852d08);})[_0x6eec('0x23')](function(_0x2ad14b){logger[_0x6eec('0x18')](_0x6eec('0x1d'),_0x2ad14b[_0x6eec('0x1b')],_0xd86135);_0x328693(_0x1761f4[_0x6eec('0x18')](0x1f4,_0x2ad14b[_0x6eec('0x1b')]));});});};exports[_0x6eec('0x24')]=function(_0x316317){var _0x58f95c=this;return new Promise(function(_0x1d750c,_0x44b31c){return db[_0x6eec('0x1e')][_0x6eec('0x25')](_0x316317['body'],{'raw':_0x316317[_0x6eec('0x21')]?_0x316317[_0x6eec('0x21')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x316317['options']?_0x316317[_0x6eec('0x21')]['where']||null:null,'attributes':_0x316317[_0x6eec('0x21')]?_0x316317[_0x6eec('0x21')][_0x6eec('0x26')]||null:null,'limit':_0x316317[_0x6eec('0x21')]?_0x316317[_0x6eec('0x21')][_0x6eec('0x27')]||null:null})[_0x6eec('0x22')](function(_0x33e4a1){logger[_0x6eec('0x13')](_0x6eec('0x24'),_0x316317);logger['debug'](_0x6eec('0x24'),_0x316317,JSON['stringify'](_0x33e4a1));_0x1d750c(_0x33e4a1);})[_0x6eec('0x23')](function(_0x125bfc){logger[_0x6eec('0x18')]('UpdateFaxMessage',_0x125bfc['message'],_0x316317);_0x44b31c(_0x58f95c['error'](0x1f4,_0x125bfc[_0x6eec('0x1b')]));});});};
\ No newline at end of file
index b3cb9f8..f9b3001 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5481=['save','remove','update','emit','register','length','faxMessage:','./faxMessage.events'];(function(_0x30f272,_0x401f2d){var _0x1969ce=function(_0x9129ee){while(--_0x9129ee){_0x30f272['push'](_0x30f272['shift']());}};_0x1969ce(++_0x401f2d);}(_0x5481,0x13f));var _0x1548=function(_0x247147,_0x5744c9){_0x247147=_0x247147-0x0;var _0x1e26a9=_0x5481[_0x247147];return _0x1e26a9;};'use strict';var FaxMessageEvents=require(_0x1548('0x0'));var events=[_0x1548('0x1'),_0x1548('0x2'),_0x1548('0x3')];function createListener(_0x2fb4fe,_0x252a28){return function(_0x793a1c){_0x252a28[_0x1548('0x4')](_0x2fb4fe,_0x793a1c);};}function removeListener(_0x39af0e,_0x19130c){return function(){FaxMessageEvents['removeListener'](_0x39af0e,_0x19130c);};}exports[_0x1548('0x5')]=function(_0x47a2df){for(var _0x5696c2=0x0,_0x3c548c=events[_0x1548('0x6')];_0x5696c2<_0x3c548c;_0x5696c2++){var _0x4ea9fc=events[_0x5696c2];var _0x514741=createListener(_0x1548('0x7')+_0x4ea9fc,_0x47a2df);FaxMessageEvents['on'](_0x4ea9fc,_0x514741);}};
\ No newline at end of file
+var _0x53b3=['removeListener','register','./faxMessage.events','save','remove','update','emit'];(function(_0x506d83,_0x1899e9){var _0x335e8b=function(_0x4a7044){while(--_0x4a7044){_0x506d83['push'](_0x506d83['shift']());}};_0x335e8b(++_0x1899e9);}(_0x53b3,0x1f3));var _0x353b=function(_0x7e45ed,_0x2aaf0c){_0x7e45ed=_0x7e45ed-0x0;var _0xaf5391=_0x53b3[_0x7e45ed];return _0xaf5391;};'use strict';var FaxMessageEvents=require(_0x353b('0x0'));var events=[_0x353b('0x1'),_0x353b('0x2'),_0x353b('0x3')];function createListener(_0x191d47,_0x1be7cb){return function(_0x1990f6){_0x1be7cb[_0x353b('0x4')](_0x191d47,_0x1990f6);};}function removeListener(_0x2fd9d8,_0x25a7ae){return function(){FaxMessageEvents[_0x353b('0x5')](_0x2fd9d8,_0x25a7ae);};}exports[_0x353b('0x6')]=function(_0x76dde7){for(var _0x1be706=0x0,_0x2dcdb1=events['length'];_0x1be706<_0x2dcdb1;_0x1be706++){var _0x122753=events[_0x1be706];var _0x5265f5=createListener('faxMessage:'+_0x122753,_0x76dde7);FaxMessageEvents['on'](_0x122753,_0x5265f5);}};
\ No newline at end of file
index 1bc9e91..c8f9864 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x702d=['get','index','/describe','describe','/:id','isAuthenticated','show','/:id/download','download','post','tracked','create','put','update','/:id/accept','accept','reject','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x144cf0,_0x2455ae){var _0x16dde8=function(_0x558141){while(--_0x558141){_0x144cf0['push'](_0x144cf0['shift']());}};_0x16dde8(++_0x2455ae);}(_0x702d,0x147));var _0xd702=function(_0x92f0c,_0x53b894){_0x92f0c=_0x92f0c-0x0;var _0x445b83=_0x702d[_0x92f0c];return _0x445b83;};'use strict';var multer=require(_0xd702('0x0'));var util=require(_0xd702('0x1'));var path=require(_0xd702('0x2'));var timeout=require(_0xd702('0x3'));var express=require(_0xd702('0x4'));var router=express['Router']();var fs_extra=require(_0xd702('0x5'));var auth=require(_0xd702('0x6'));var interaction=require(_0xd702('0x7'));var config=require(_0xd702('0x8'));var controller=require('./faxMessage.controller');router[_0xd702('0x9')]('/',auth['isAuthenticated'](),controller[_0xd702('0xa')]);router[_0xd702('0x9')](_0xd702('0xb'),auth['isAuthenticated'](),controller[_0xd702('0xc')]);router['get'](_0xd702('0xd'),auth[_0xd702('0xe')](),controller[_0xd702('0xf')]);router[_0xd702('0x9')](_0xd702('0x10'),auth[_0xd702('0xe')](),controller[_0xd702('0x11')]);router[_0xd702('0x12')]('/',auth[_0xd702('0xe')](),interaction[_0xd702('0x13')]('fax','faxmessage:create'),controller[_0xd702('0x14')]);router[_0xd702('0x15')](_0xd702('0xd'),auth['isAuthenticated'](),controller[_0xd702('0x16')]);router[_0xd702('0x15')](_0xd702('0x17'),auth[_0xd702('0xe')](),controller[_0xd702('0x18')]);router[_0xd702('0x15')]('/:id/reject',auth[_0xd702('0xe')](),controller[_0xd702('0x19')]);router['delete'](_0xd702('0xd'),auth['isAuthenticated'](),controller[_0xd702('0x1a')]);module[_0xd702('0x1b')]=router;
\ No newline at end of file
+var _0xaa88=['describe','get','show','download','post','fax','faxmessage:create','put','/:id','/:id/accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','index','/describe','isAuthenticated'];(function(_0x4d05a0,_0x53aa7e){var _0x4c999c=function(_0x358867){while(--_0x358867){_0x4d05a0['push'](_0x4d05a0['shift']());}};_0x4c999c(++_0x53aa7e);}(_0xaa88,0x137));var _0x8aa8=function(_0x55821d,_0x27a22e){_0x55821d=_0x55821d-0x0;var _0x58ea8a=_0xaa88[_0x55821d];return _0x58ea8a;};'use strict';var multer=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var path=require(_0x8aa8('0x2'));var timeout=require(_0x8aa8('0x3'));var express=require('express');var router=express[_0x8aa8('0x4')]();var fs_extra=require(_0x8aa8('0x5'));var auth=require(_0x8aa8('0x6'));var interaction=require(_0x8aa8('0x7'));var config=require(_0x8aa8('0x8'));var controller=require(_0x8aa8('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x8aa8('0xa')]);router['get'](_0x8aa8('0xb'),auth[_0x8aa8('0xc')](),controller[_0x8aa8('0xd')]);router[_0x8aa8('0xe')]('/:id',auth[_0x8aa8('0xc')](),controller[_0x8aa8('0xf')]);router[_0x8aa8('0xe')]('/:id/download',auth[_0x8aa8('0xc')](),controller[_0x8aa8('0x10')]);router[_0x8aa8('0x11')]('/',auth[_0x8aa8('0xc')](),interaction['tracked'](_0x8aa8('0x12'),_0x8aa8('0x13')),controller['create']);router[_0x8aa8('0x14')](_0x8aa8('0x15'),auth[_0x8aa8('0xc')](),controller['update']);router[_0x8aa8('0x14')](_0x8aa8('0x16'),auth[_0x8aa8('0xc')](),controller['accept']);router[_0x8aa8('0x14')]('/:id/reject',auth['isAuthenticated'](),controller[_0x8aa8('0x17')]);router[_0x8aa8('0x18')](_0x8aa8('0x15'),auth[_0x8aa8('0xc')](),controller[_0x8aa8('0x19')]);module[_0x8aa8('0x1a')]=router;
\ No newline at end of file
index 9817a14..b8e5b8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6478=['exports','STRING','name','INTEGER','rrmemory','beepall','roundrobin','sequelize'];(function(_0x289a67,_0x1e5a3c){var _0x572b49=function(_0x22e036){while(--_0x22e036){_0x289a67['push'](_0x289a67['shift']());}};_0x572b49(++_0x1e5a3c);}(_0x6478,0x1e7));var _0x8647=function(_0xb0975b,_0x93b0d6){_0xb0975b=_0xb0975b-0x0;var _0x320d30=_0x6478[_0xb0975b];return _0x320d30;};'use strict';var Sequelize=require(_0x8647('0x0'));module[_0x8647('0x1')]={'name':{'type':Sequelize[_0x8647('0x2')],'unique':_0x8647('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8647('0x2')]},'timeout':{'type':Sequelize[_0x8647('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x8647('0x5'),_0x8647('0x6'),_0x8647('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x8647('0x4')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xd477=['exports','STRING','name','ENUM','beepall','roundrobin','sequelize'];(function(_0x2a142f,_0x2c074f){var _0x48e52b=function(_0x22e7a1){while(--_0x22e7a1){_0x2a142f['push'](_0x2a142f['shift']());}};_0x48e52b(++_0x2c074f);}(_0xd477,0xdf));var _0x7d47=function(_0x155506,_0x202f81){_0x155506=_0x155506-0x0;var _0x14b973=_0xd477[_0x155506];return _0x14b973;};'use strict';var Sequelize=require(_0x7d47('0x0'));module[_0x7d47('0x1')]={'name':{'type':Sequelize[_0x7d47('0x2')],'unique':_0x7d47('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7d47('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7d47('0x4')]('rrmemory',_0x7d47('0x5'),_0x7d47('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 3a89cba..dcd5b1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce80=['addAgents','omit','spread','isArray','findOne','getAgents','rimraf','request-promise','bluebird','mustache','util','path','to-csv','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../mysqldb','redis','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','get','FaxQueues','UserProfileResource','end','error','stack','name','index','map','FaxQueue','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','include','findAll','show','params','includeAll','options','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','UserFaxQueue','FaxQueueId','filter','User','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','rows','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','userFaxQueue:save','removeTeams','select','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','SELECT','every','TeamId','includes','all','union','compact','value','removeAgents','forEach','emit','userFaxQueue:remove'];(function(_0x1dc630,_0x2e5472){var _0x287da3=function(_0x362647){while(--_0x362647){_0x1dc630['push'](_0x1dc630['shift']());}};_0x287da3(++_0x2e5472);}(_0xce80,0x116));var _0x0ce8=function(_0x1bcde8,_0x52c25e){_0x1bcde8=_0x1bcde8-0x0;var _0x284478=_0xce80[_0x1bcde8];return _0x284478;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0ce8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0ce8('0x1'));var moment=require('moment');var BPromise=require(_0x0ce8('0x2'));var Mustache=require(_0x0ce8('0x3'));var util=require(_0x0ce8('0x4'));var path=require(_0x0ce8('0x5'));var sox=require('sox');var csv=require(_0x0ce8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0ce8('0x7'));var squel=require(_0x0ce8('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0ce8('0x9'));var toCsv=require(_0x0ce8('0x6'));var querystring=require('querystring');var Papa=require(_0x0ce8('0xa'));var Redis=require(_0x0ce8('0xb'));var authService=require(_0x0ce8('0xc'));var qs=require(_0x0ce8('0xd'));var as=require(_0x0ce8('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0ce8('0xf'));var licenseUtil=require('../../config/license/util');var db=require(_0x0ce8('0x10'))['db'];config[_0x0ce8('0x11')]=_['defaults'](config[_0x0ce8('0x11')],{'host':'localhost','port':0x18eb});var socket=require(_0x0ce8('0x12'))(new Redis(config[_0x0ce8('0x11')]));require(_0x0ce8('0x13'))[_0x0ce8('0x14')](socket);function respondWithStatusCode(_0x96519,_0x2cc2ca){_0x2cc2ca=_0x2cc2ca||0xcc;return function(_0x10e9a1){if(_0x10e9a1){return _0x96519[_0x0ce8('0x15')](_0x2cc2ca);}return _0x96519[_0x0ce8('0x16')](_0x2cc2ca)['end']();};}function respondWithResult(_0x8d8410,_0x2c456b){_0x2c456b=_0x2c456b||0xc8;return function(_0x5ae672){if(_0x5ae672){return _0x8d8410['status'](_0x2c456b)[_0x0ce8('0x17')](_0x5ae672);}};}function respondWithFilteredResult(_0x3cba0d,_0x56c7f9){return function(_0x229c62){if(_0x229c62){var _0x76b56a=typeof _0x56c7f9[_0x0ce8('0x18')]===_0x0ce8('0x19')&&typeof _0x56c7f9['limit']==='undefined';var _0x4d1c10=_0x229c62[_0x0ce8('0x1a')];var _0xaf57d8=_0x76b56a?0x0:_0x56c7f9[_0x0ce8('0x18')];var _0x28920c=_0x76b56a?_0x229c62['count']:_0x56c7f9['offset']+_0x56c7f9[_0x0ce8('0x1b')];var _0x1ad03f;if(_0x28920c>=_0x4d1c10){_0x28920c=_0x4d1c10;_0x1ad03f=0xc8;}else{_0x1ad03f=0xce;}_0x3cba0d[_0x0ce8('0x16')](_0x1ad03f);return _0x3cba0d[_0x0ce8('0x1c')](_0x0ce8('0x1d'),_0xaf57d8+'-'+_0x28920c+'/'+_0x4d1c10)['json'](_0x229c62);}return null;};}function patchUpdates(_0xa811ee){return function(_0x5e1741){try{jsonpatch['apply'](_0x5e1741,_0xa811ee,!![]);}catch(_0x2596e3){return BPromise[_0x0ce8('0x1e')](_0x2596e3);}return _0x5e1741['save']();};}function saveUpdates(_0x65f5bf,_0x5a70e7){return function(_0x58ac91){if(_0x58ac91){return _0x58ac91[_0x0ce8('0x1f')](_0x65f5bf)[_0x0ce8('0x20')](function(_0x18fc48){return _0x18fc48;});}return null;};}function removeEntity(_0x41f33e,_0x4445cb){return function(_0x7d1d03){if(_0x7d1d03){return _0x7d1d03[_0x0ce8('0x21')]()[_0x0ce8('0x20')](function(){var _0x1db591=_0x7d1d03[_0x0ce8('0x22')]({'plain':!![]});var _0x5374db=_0x0ce8('0x23');return db[_0x0ce8('0x24')][_0x0ce8('0x21')]({'where':{'type':_0x5374db,'resourceId':_0x1db591['id']}})[_0x0ce8('0x20')](function(){return _0x7d1d03;});})['then'](function(){_0x41f33e['status'](0xcc)[_0x0ce8('0x25')]();});}};}function handleEntityNotFound(_0x5f2d18,_0x5519ab){return function(_0x350d4c){if(!_0x350d4c){_0x5f2d18['sendStatus'](0x194);}return _0x350d4c;};}function handleError(_0x2df24e,_0x1a8926){_0x1a8926=_0x1a8926||0x1f4;return function(_0x2aa5ea){logger[_0x0ce8('0x26')](_0x2aa5ea[_0x0ce8('0x27')]);if(_0x2aa5ea[_0x0ce8('0x28')]){delete _0x2aa5ea[_0x0ce8('0x28')];}_0x2df24e[_0x0ce8('0x16')](_0x1a8926)['send'](_0x2aa5ea);};}exports[_0x0ce8('0x29')]=function(_0x4a4bdc,_0x13f647){var _0x581573={},_0x50bbdd={},_0x2047da={'count':0x0,'rows':[]};var _0x1a2e18=_[_0x0ce8('0x2a')](db[_0x0ce8('0x2b')][_0x0ce8('0x2c')],function(_0x5a55b7){return{'name':_0x5a55b7[_0x0ce8('0x2d')],'type':_0x5a55b7[_0x0ce8('0x2e')][_0x0ce8('0x2f')]};});_0x50bbdd['model']=_[_0x0ce8('0x2a')](_0x1a2e18,_0x0ce8('0x28'));_0x50bbdd[_0x0ce8('0x30')]=_[_0x0ce8('0x31')](_0x4a4bdc[_0x0ce8('0x30')]);_0x50bbdd[_0x0ce8('0x32')]=_[_0x0ce8('0x33')](_0x50bbdd[_0x0ce8('0x34')],_0x50bbdd[_0x0ce8('0x30')]);_0x581573[_0x0ce8('0x35')]=_[_0x0ce8('0x33')](_0x50bbdd['model'],qs[_0x0ce8('0x36')](_0x4a4bdc[_0x0ce8('0x30')]['fields']));_0x581573['attributes']=_0x581573['attributes'][_0x0ce8('0x37')]?_0x581573['attributes']:_0x50bbdd['model'];if(!_0x4a4bdc[_0x0ce8('0x30')][_0x0ce8('0x38')](_0x0ce8('0x39'))){_0x581573[_0x0ce8('0x1b')]=qs['limit'](_0x4a4bdc[_0x0ce8('0x30')]['limit']);_0x581573[_0x0ce8('0x18')]=qs[_0x0ce8('0x18')](_0x4a4bdc[_0x0ce8('0x30')]['offset']);}_0x581573[_0x0ce8('0x3a')]=qs['sort'](_0x4a4bdc[_0x0ce8('0x30')][_0x0ce8('0x3b')]);_0x581573[_0x0ce8('0x3c')]=qs['filters'](_[_0x0ce8('0x3d')](_0x4a4bdc[_0x0ce8('0x30')],_0x50bbdd[_0x0ce8('0x32')]),_0x1a2e18);if(_0x4a4bdc[_0x0ce8('0x30')]['filter']){_0x581573[_0x0ce8('0x3c')]=_[_0x0ce8('0x3e')](_0x581573['where'],{'$or':_[_0x0ce8('0x2a')](_0x1a2e18,function(_0x2c9f4d){if(_0x2c9f4d[_0x0ce8('0x2e')]!==_0x0ce8('0x3f')){var _0x2732a3={};_0x2732a3[_0x2c9f4d[_0x0ce8('0x28')]]={'$like':'%'+_0x4a4bdc[_0x0ce8('0x30')]['filter']+'%'};return _0x2732a3;}})});}_0x581573=_[_0x0ce8('0x3e')]({},_0x581573,_0x4a4bdc['options']);var _0x356639={'where':_0x581573[_0x0ce8('0x3c')]};return db[_0x0ce8('0x2b')]['count'](_0x356639)[_0x0ce8('0x20')](function(_0x46c435){_0x2047da[_0x0ce8('0x1a')]=_0x46c435;if(_0x4a4bdc[_0x0ce8('0x30')]['includeAll']){_0x581573[_0x0ce8('0x40')]=[{'all':!![]}];}return db[_0x0ce8('0x2b')][_0x0ce8('0x41')](_0x581573);})[_0x0ce8('0x20')](function(_0x42fde3){_0x2047da['rows']=_0x42fde3;return _0x2047da;})['then'](respondWithFilteredResult(_0x13f647,_0x581573))['catch'](handleError(_0x13f647,null));};exports[_0x0ce8('0x42')]=function(_0x5e4770,_0x5f0e03){var _0x4ddf4d={'raw':!![],'where':{'id':_0x5e4770[_0x0ce8('0x43')]['id']}},_0x5b6200={};_0x5b6200[_0x0ce8('0x34')]=_[_0x0ce8('0x31')](db[_0x0ce8('0x2b')][_0x0ce8('0x2c')]);_0x5b6200[_0x0ce8('0x30')]=_[_0x0ce8('0x31')](_0x5e4770[_0x0ce8('0x30')]);_0x5b6200['filters']=_[_0x0ce8('0x33')](_0x5b6200['model'],_0x5b6200[_0x0ce8('0x30')]);_0x4ddf4d['attributes']=_['intersection'](_0x5b6200[_0x0ce8('0x34')],qs[_0x0ce8('0x36')](_0x5e4770[_0x0ce8('0x30')][_0x0ce8('0x36')]));_0x4ddf4d[_0x0ce8('0x35')]=_0x4ddf4d[_0x0ce8('0x35')]['length']?_0x4ddf4d[_0x0ce8('0x35')]:_0x5b6200[_0x0ce8('0x34')];if(_0x5e4770[_0x0ce8('0x30')][_0x0ce8('0x44')]){_0x4ddf4d[_0x0ce8('0x40')]=[{'all':!![]}];}_0x4ddf4d=_['merge']({},_0x4ddf4d,_0x5e4770[_0x0ce8('0x45')]);return db[_0x0ce8('0x2b')][_0x0ce8('0x46')](_0x4ddf4d)[_0x0ce8('0x20')](handleEntityNotFound(_0x5f0e03,null))[_0x0ce8('0x20')](respondWithResult(_0x5f0e03,null))[_0x0ce8('0x47')](handleError(_0x5f0e03,null));};exports[_0x0ce8('0x48')]=function(_0x5ab731,_0x1b0025){return db['FaxQueue'][_0x0ce8('0x48')](_0x5ab731['body'],{})[_0x0ce8('0x20')](function(_0x365d83){var _0x13956c=_0x5ab731[_0x0ce8('0x49')][_0x0ce8('0x22')]({'plain':!![]});if(!_0x13956c)throw new Error(_0x0ce8('0x4a'));if(_0x13956c[_0x0ce8('0x4b')]===_0x0ce8('0x49')){var _0x462d2e=_0x365d83[_0x0ce8('0x22')]({'plain':!![]});var _0x42ed55='FaxQueues';return db[_0x0ce8('0x4c')][_0x0ce8('0x46')]({'where':{'name':_0x42ed55,'userProfileId':_0x13956c[_0x0ce8('0x4d')]},'raw':!![]})[_0x0ce8('0x20')](function(_0xf2a349){if(_0xf2a349&&_0xf2a349['autoAssociation']===0x0){return db[_0x0ce8('0x24')][_0x0ce8('0x48')]({'name':_0x462d2e[_0x0ce8('0x28')],'resourceId':_0x462d2e['id'],'type':_0xf2a349['name'],'sectionId':_0xf2a349['id']},{})[_0x0ce8('0x20')](function(){return _0x365d83;});}else{return _0x365d83;}})[_0x0ce8('0x47')](function(_0x5ec251){logger[_0x0ce8('0x26')](_0x0ce8('0x4e'),_0x5ec251);throw _0x5ec251;});}return _0x365d83;})['then'](respondWithResult(_0x1b0025,0xc9))[_0x0ce8('0x47')](handleError(_0x1b0025,null));};exports[_0x0ce8('0x1f')]=function(_0x2aad8b,_0x2aad78){if(_0x2aad8b[_0x0ce8('0x4f')]['id']){delete _0x2aad8b[_0x0ce8('0x4f')]['id'];}return db[_0x0ce8('0x2b')][_0x0ce8('0x46')]({'where':{'id':_0x2aad8b[_0x0ce8('0x43')]['id']}})[_0x0ce8('0x20')](handleEntityNotFound(_0x2aad78,null))[_0x0ce8('0x20')](saveUpdates(_0x2aad8b[_0x0ce8('0x4f')],null))[_0x0ce8('0x20')](respondWithResult(_0x2aad78,null))['catch'](handleError(_0x2aad78,null));};exports[_0x0ce8('0x21')]=function(_0x628aad,_0x302e2e){return db[_0x0ce8('0x2b')]['find']({'where':{'id':_0x628aad[_0x0ce8('0x43')]['id']}})['then'](handleEntityNotFound(_0x302e2e,null))[_0x0ce8('0x20')](removeEntity(_0x302e2e,null))[_0x0ce8('0x47')](handleError(_0x302e2e,null));};exports[_0x0ce8('0x50')]=function(_0x4cbf56,_0x3c4e53){return db[_0x0ce8('0x2b')][_0x0ce8('0x50')]()['then'](respondWithResult(_0x3c4e53,null))[_0x0ce8('0x47')](handleError(_0x3c4e53,null));};exports[_0x0ce8('0x51')]=function(_0x16b259,_0x48540d,_0x57fddd){var _0x225d31={'raw':!![],'where':{}},_0x14d5c1={},_0x3de005;return db[_0x0ce8('0x2b')]['findOne']({'where':{'id':_0x16b259['params']['id']}})[_0x0ce8('0x20')](handleEntityNotFound(_0x48540d,null))[_0x0ce8('0x20')](function(_0x4168ba){if(_0x4168ba){_0x3de005=_0x4168ba['get']({'plain':!![]});_0x14d5c1[_0x0ce8('0x34')]=_['keys'](db[_0x0ce8('0x52')][_0x0ce8('0x2c')]);_0x14d5c1[_0x0ce8('0x30')]=_[_0x0ce8('0x31')](_0x16b259[_0x0ce8('0x30')]);_0x14d5c1[_0x0ce8('0x32')]=_['intersection'](_0x14d5c1[_0x0ce8('0x34')],_0x14d5c1[_0x0ce8('0x30')]);_0x225d31[_0x0ce8('0x35')]=_['intersection'](_0x14d5c1['model'],qs['fields'](_0x16b259['query'][_0x0ce8('0x36')]));_0x225d31[_0x0ce8('0x35')]=_0x225d31[_0x0ce8('0x35')][_0x0ce8('0x37')]?_0x225d31['attributes']:_0x14d5c1['model'];if(!_0x16b259[_0x0ce8('0x30')]['hasOwnProperty'](_0x0ce8('0x39'))){_0x225d31[_0x0ce8('0x1b')]=qs[_0x0ce8('0x1b')](_0x16b259[_0x0ce8('0x30')][_0x0ce8('0x1b')]);_0x225d31[_0x0ce8('0x18')]=qs['offset'](_0x16b259[_0x0ce8('0x30')][_0x0ce8('0x18')]);}_0x225d31[_0x0ce8('0x3a')]=qs['sort'](_0x16b259[_0x0ce8('0x30')]['sort']);_0x225d31['where']=qs['filters'](_['pick'](_0x16b259[_0x0ce8('0x30')],_0x14d5c1[_0x0ce8('0x32')]));_0x225d31[_0x0ce8('0x3c')][_0x0ce8('0x53')]=_0x4168ba['id'];if(_0x16b259[_0x0ce8('0x30')][_0x0ce8('0x54')]){_0x225d31['where']=_[_0x0ce8('0x3e')](_0x225d31[_0x0ce8('0x3c')],{'$or':_['map'](_0x225d31[_0x0ce8('0x35')],function(_0xbf811a){var _0x1856e6={};_0x1856e6[_0xbf811a]={'$like':'%'+_0x16b259[_0x0ce8('0x30')][_0x0ce8('0x54')]+'%'};return _0x1856e6;})});}_0x225d31=_['merge']({},_0x225d31,_0x16b259[_0x0ce8('0x45')]);return db[_0x0ce8('0x52')]['findAll'](_0x225d31);}})[_0x0ce8('0x20')](function(_0x4334fc){if(_0x4334fc){return db[_0x0ce8('0x55')][_0x0ce8('0x56')]({'where':{'id':_['map'](_0x4334fc,_0x0ce8('0x57')),'role':_0x0ce8('0x58')},'attributes':['id',_0x0ce8('0x28'),_0x0ce8('0x59'),_0x0ce8('0x5a'),_0x0ce8('0x5b')]});}})['then'](function(_0x53c124){if(_0x53c124){return{'count':_0x53c124[_0x0ce8('0x1a')],'rows':_[_0x0ce8('0x2a')](_0x53c124[_0x0ce8('0x5c')],function(_0x464c77){return{'membername':_0x464c77[_0x0ce8('0x28')],'UserId':_0x464c77['id'],'queue_name':_0x3de005[_0x0ce8('0x28')],'FaxQueueId':_0x3de005['id'],'interface':util['format'](_0x0ce8('0x5d'),_0x0ce8('0x5e'),_0x464c77['name']),'penalty':0x0,'paused':_0x464c77[_0x0ce8('0x59')],'createdAt':_0x464c77[_0x0ce8('0x5b')],'updatedAt':_0x464c77['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x0ce8('0x20')](respondWithFilteredResult(_0x48540d,_0x225d31))[_0x0ce8('0x47')](handleError(_0x48540d,null));};exports[_0x0ce8('0x5f')]=function(_0x5d2bc5,_0x35aa7c,_0x46702d){var _0x387324={};var _0x470952={};var _0x1eef2f;var _0x4af477;return db[_0x0ce8('0x2b')]['findOne']({'where':{'id':_0x5d2bc5[_0x0ce8('0x43')]['id']}})[_0x0ce8('0x20')](handleEntityNotFound(_0x35aa7c,null))['then'](function(_0x254fdf){if(_0x254fdf){_0x1eef2f=_0x254fdf;_0x470952[_0x0ce8('0x34')]=_[_0x0ce8('0x31')](db[_0x0ce8('0x60')][_0x0ce8('0x2c')]);_0x470952[_0x0ce8('0x30')]=_['keys'](_0x5d2bc5['query']);_0x470952['filters']=_[_0x0ce8('0x33')](_0x470952[_0x0ce8('0x34')],_0x470952[_0x0ce8('0x30')]);_0x387324[_0x0ce8('0x35')]=_[_0x0ce8('0x33')](_0x470952[_0x0ce8('0x34')],qs[_0x0ce8('0x36')](_0x5d2bc5[_0x0ce8('0x30')][_0x0ce8('0x36')]));_0x387324[_0x0ce8('0x35')]=_0x387324[_0x0ce8('0x35')][_0x0ce8('0x37')]?_0x387324['attributes']:_0x470952[_0x0ce8('0x34')];_0x387324[_0x0ce8('0x3a')]=qs['sort'](_0x5d2bc5[_0x0ce8('0x30')][_0x0ce8('0x3b')]);_0x387324[_0x0ce8('0x3c')]=qs[_0x0ce8('0x32')](_[_0x0ce8('0x3d')](_0x5d2bc5[_0x0ce8('0x30')],_0x470952['filters']));if(_0x5d2bc5[_0x0ce8('0x30')][_0x0ce8('0x54')]){_0x387324[_0x0ce8('0x3c')]=_['merge'](_0x387324[_0x0ce8('0x3c')],{'$or':_[_0x0ce8('0x2a')](_0x387324[_0x0ce8('0x35')],function(_0x59d545){var _0xcceb01={};_0xcceb01[_0x59d545]={'$like':'%'+_0x5d2bc5[_0x0ce8('0x30')][_0x0ce8('0x54')]+'%'};return _0xcceb01;})});}_0x387324=_[_0x0ce8('0x3e')]({},_0x387324,_0x5d2bc5['options']);return _0x1eef2f[_0x0ce8('0x5f')](_0x387324);}})['then'](function(_0x2346ec){if(_0x2346ec){_0x4af477=_0x2346ec['length'];if(!_0x5d2bc5[_0x0ce8('0x30')][_0x0ce8('0x38')](_0x0ce8('0x39'))){_0x387324[_0x0ce8('0x1b')]=qs[_0x0ce8('0x1b')](_0x5d2bc5['query'][_0x0ce8('0x1b')]);_0x387324[_0x0ce8('0x18')]=qs[_0x0ce8('0x18')](_0x5d2bc5[_0x0ce8('0x30')][_0x0ce8('0x18')]);}return _0x1eef2f[_0x0ce8('0x5f')](_0x387324);}})[_0x0ce8('0x20')](function(_0x3d22f9){if(_0x3d22f9){return _0x3d22f9?{'count':_0x4af477,'rows':_0x3d22f9}:null;}})[_0x0ce8('0x20')](respondWithResult(_0x35aa7c,null))[_0x0ce8('0x47')](handleError(_0x35aa7c,null));};exports[_0x0ce8('0x61')]=function(_0x41a1e7,_0x41d87a,_0x4c8b3b){var _0x39da7c=_0x41a1e7[_0x0ce8('0x4f')][_0x0ce8('0x62')];return db['Team'][_0x0ce8('0x41')]({'where':{'id':_0x39da7c},'attributes':['id'],'include':[{'model':db[_0x0ce8('0x55')],'as':_0x0ce8('0x63'),'attributes':['id',_0x0ce8('0x28'),_0x0ce8('0x64'),_0x0ce8('0x65'),_0x0ce8('0x66')],'raw':!![]}]})[_0x0ce8('0x20')](function(_0x16f535){if(_0x16f535){var _0x2191c8=_[_0x0ce8('0x67')](_0x16f535,function(_0x2a712c){var _0x59c50a=_0x2a712c[_0x0ce8('0x22')]({'plain':!![]});return _0x59c50a[_0x0ce8('0x63')];});return db['FaxQueue'][_0x0ce8('0x46')]({'where':{'id':_0x41a1e7[_0x0ce8('0x43')]['id']}})['then'](function(_0x42c9e2){return db['sequelize'][_0x0ce8('0x68')](function(_0xf40858){return _0x42c9e2['addTeams'](_0x39da7c,{'transaction':_0xf40858})[_0x0ce8('0x20')](function(){return BPromise[_0x0ce8('0x69')](_0x2191c8,function(_0x3ea9d6){return db[_0x0ce8('0x52')][_0x0ce8('0x6a')]({'where':{'UserId':_0x3ea9d6['id'],'FaxQueueId':_0x41a1e7[_0x0ce8('0x43')]['id']},'transaction':_0xf40858});});})[_0x0ce8('0x20')](function(){_0x2191c8['forEach'](function(_0xf46d5a){socket['emit'](_0x0ce8('0x6b'),{'UserId':_0xf46d5a['id'],'FaxQueueId':_0x42c9e2['id']});});});});});}})['then'](respondWithStatusCode(_0x41d87a,null))[_0x0ce8('0x47')](handleError(_0x41d87a,null));};exports[_0x0ce8('0x6c')]=function(_0x7dddc,_0x3f64f,_0x2052cb){return db[_0x0ce8('0x60')]['findAll']({'where':{'id':_0x7dddc[_0x0ce8('0x30')][_0x0ce8('0x62')]},'attributes':['id'],'include':[{'model':db[_0x0ce8('0x55')],'as':_0x0ce8('0x63'),'attributes':['id'],'raw':!![]}]})[_0x0ce8('0x20')](handleEntityNotFound(_0x3f64f,null))[_0x0ce8('0x20')](function(_0x3c3ee4){var _0x271772=_[_0x0ce8('0x2a')](_0x3c3ee4,'id');var _0xab7211=[];var _0x35c1d0=[];var _0x399b0f=squel[_0x0ce8('0x6d')]();_0x399b0f['field']('tq.TeamId')['from']('team_has_fax_queues','tq')[_0x0ce8('0x6e')](_0x0ce8('0x6f'),'ut',_0x0ce8('0x70'))['where'](_0x0ce8('0x71'),_0x7dddc[_0x0ce8('0x43')]['id']);for(var _0x5e1a8d=0x0;_0x5e1a8d<_0x3c3ee4[_0x0ce8('0x37')];_0x5e1a8d+=0x1){let _0x417e9a=_0x3c3ee4[_0x5e1a8d];for(var _0x277c08=0x0;_0x277c08<_0x417e9a[_0x0ce8('0x63')]['length'];_0x277c08+=0x1){let _0x288366=_0x417e9a[_0x0ce8('0x63')][_0x277c08];var _0x14b6b5=_0x399b0f[_0x0ce8('0x72')]();_0x14b6b5[_0x0ce8('0x3c')](_0x0ce8('0x73'),_0x288366['id']);_0x35c1d0[_0x0ce8('0x74')](db[_0x0ce8('0x75')]['query'](_0x14b6b5['toString'](),{'type':db['sequelize']['QueryTypes'][_0x0ce8('0x76')]})[_0x0ce8('0x20')](function(_0x3077d9){if(_0x3077d9[_0x0ce8('0x37')]===0x1){return _0x288366['id'];}else{var _0x45fe40=_[_0x0ce8('0x77')](_[_0x0ce8('0x2a')](_0x3077d9,_0x0ce8('0x78')),function(_0x5d2c03){return _[_0x0ce8('0x79')](_0x271772,_0x5d2c03);});if(_0x45fe40){return _0x288366['id'];}}}));}}return BPromise[_0x0ce8('0x7a')](_0x35c1d0)['then'](function(_0x561593){_0xab7211=_(_0xab7211)[_0x0ce8('0x7b')](_0x561593)[_0x0ce8('0x7c')]()[_0x0ce8('0x7d')]();return db['FaxQueue'][_0x0ce8('0x46')]({'where':{'id':_0x7dddc[_0x0ce8('0x43')]['id']}})[_0x0ce8('0x20')](function(_0x15f378){return db[_0x0ce8('0x75')][_0x0ce8('0x68')](function(_0x1a99c2){return _0x15f378['removeTeams'](_0x7dddc[_0x0ce8('0x30')][_0x0ce8('0x62')],{'transaction':_0x1a99c2})[_0x0ce8('0x20')](function(){if(!_['isEmpty'](_0xab7211)){return _0x15f378[_0x0ce8('0x7e')](_0xab7211,{'transaction':_0x1a99c2});}})[_0x0ce8('0x20')](function(){_0xab7211[_0x0ce8('0x7f')](function(_0x307931){socket[_0x0ce8('0x80')](_0x0ce8('0x81'),{'UserId':_0x307931,'FaxQueueId':_0x15f378['id']});});});});});});})[_0x0ce8('0x20')](respondWithStatusCode(_0x3f64f,null))[_0x0ce8('0x47')](handleError(_0x3f64f,null));};exports[_0x0ce8('0x82')]=function(_0x306be4,_0x5e730b,_0x564d5b){return db[_0x0ce8('0x2b')][_0x0ce8('0x46')]({'where':{'id':_0x306be4[_0x0ce8('0x43')]['id']}})[_0x0ce8('0x20')](handleEntityNotFound(_0x5e730b,null))[_0x0ce8('0x20')](function(_0x4b9a5d){if(_0x4b9a5d){return _0x4b9a5d[_0x0ce8('0x82')](_0x306be4['body'][_0x0ce8('0x62')],_[_0x0ce8('0x83')](_0x306be4[_0x0ce8('0x4f')],[_0x0ce8('0x62'),'id'])||{})[_0x0ce8('0x84')](function(_0x10cac1){for(var _0x1faf25=0x0;_0x1faf25<_0x306be4[_0x0ce8('0x4f')][_0x0ce8('0x62')][_0x0ce8('0x37')];_0x1faf25+=0x1){socket[_0x0ce8('0x80')](_0x0ce8('0x6b'),{'UserId':Number(_0x306be4[_0x0ce8('0x4f')][_0x0ce8('0x62')][_0x1faf25]),'FaxQueueId':Number(_0x306be4['params']['id'])});}return _0x10cac1;});}})[_0x0ce8('0x20')](respondWithResult(_0x5e730b,null))['catch'](handleError(_0x5e730b,null));};exports['removeAgents']=function(_0x3fddf6,_0x5eac8e,_0x5a1081){return db['FaxQueue']['find']({'where':{'id':_0x3fddf6['params']['id']}})[_0x0ce8('0x20')](handleEntityNotFound(_0x5eac8e,null))[_0x0ce8('0x20')](function(_0x3c1339){if(_0x3c1339){return _0x3c1339[_0x0ce8('0x7e')](_0x3fddf6['query']['ids'])[_0x0ce8('0x20')](function(){if(_[_0x0ce8('0x85')](_0x3fddf6[_0x0ce8('0x30')][_0x0ce8('0x62')])){for(var _0x325b36=0x0;_0x325b36<_0x3fddf6[_0x0ce8('0x30')][_0x0ce8('0x62')][_0x0ce8('0x37')];_0x325b36+=0x1){socket[_0x0ce8('0x80')](_0x0ce8('0x81'),{'UserId':Number(_0x3fddf6[_0x0ce8('0x30')][_0x0ce8('0x62')][_0x325b36]),'FaxQueueId':Number(_0x3fddf6[_0x0ce8('0x43')]['id'])});}}else{socket['emit'](_0x0ce8('0x81'),{'UserId':Number(_0x3fddf6[_0x0ce8('0x30')][_0x0ce8('0x62')]),'FaxQueueId':Number(_0x3fddf6[_0x0ce8('0x43')]['id'])});}});}})[_0x0ce8('0x20')](respondWithStatusCode(_0x5eac8e,null))[_0x0ce8('0x47')](handleError(_0x5eac8e,null));};exports['getAgents']=function(_0x1bef12,_0x40cf73,_0x1d02b1){var _0x5e0dac={};var _0x1c99a3={};var _0x3b81cb;var _0x717238;return db[_0x0ce8('0x2b')][_0x0ce8('0x86')]({'where':{'id':_0x1bef12[_0x0ce8('0x43')]['id']}})[_0x0ce8('0x20')](handleEntityNotFound(_0x40cf73,null))['then'](function(_0x14542c){if(_0x14542c){_0x3b81cb=_0x14542c;_0x1c99a3[_0x0ce8('0x34')]=_['keys'](db['User'][_0x0ce8('0x2c')]);_0x1c99a3[_0x0ce8('0x30')]=_['keys'](_0x1bef12[_0x0ce8('0x30')]);_0x1c99a3[_0x0ce8('0x32')]=_[_0x0ce8('0x33')](_0x1c99a3['model'],_0x1c99a3[_0x0ce8('0x30')]);_0x5e0dac[_0x0ce8('0x35')]=_[_0x0ce8('0x33')](_0x1c99a3[_0x0ce8('0x34')],qs['fields'](_0x1bef12['query']['fields']));_0x5e0dac[_0x0ce8('0x35')]=_0x5e0dac[_0x0ce8('0x35')][_0x0ce8('0x37')]?_0x5e0dac[_0x0ce8('0x35')]:_0x1c99a3[_0x0ce8('0x34')];_0x5e0dac[_0x0ce8('0x3a')]=qs['sort'](_0x1bef12['query'][_0x0ce8('0x3b')]);_0x5e0dac[_0x0ce8('0x3c')]=qs[_0x0ce8('0x32')](_[_0x0ce8('0x3d')](_0x1bef12[_0x0ce8('0x30')],_0x1c99a3[_0x0ce8('0x32')]));if(_0x1bef12[_0x0ce8('0x30')][_0x0ce8('0x54')]){_0x5e0dac[_0x0ce8('0x3c')]=_[_0x0ce8('0x3e')](_0x5e0dac[_0x0ce8('0x3c')],{'$or':_[_0x0ce8('0x2a')](_0x5e0dac['attributes'],function(_0x1f0048){var _0x1fdd41={};_0x1fdd41[_0x1f0048]={'$like':'%'+_0x1bef12[_0x0ce8('0x30')][_0x0ce8('0x54')]+'%'};return _0x1fdd41;})});}_0x5e0dac=_[_0x0ce8('0x3e')]({},_0x5e0dac,_0x1bef12[_0x0ce8('0x45')]);return _0x3b81cb[_0x0ce8('0x87')](_0x5e0dac);}})[_0x0ce8('0x20')](function(_0x203142){if(_0x203142){_0x717238=_0x203142[_0x0ce8('0x37')];if(!_0x1bef12['query'][_0x0ce8('0x38')]('nolimit')){_0x5e0dac[_0x0ce8('0x1b')]=qs[_0x0ce8('0x1b')](_0x1bef12[_0x0ce8('0x30')][_0x0ce8('0x1b')]);_0x5e0dac['offset']=qs[_0x0ce8('0x18')](_0x1bef12[_0x0ce8('0x30')][_0x0ce8('0x18')]);}return _0x3b81cb[_0x0ce8('0x87')](_0x5e0dac);}})[_0x0ce8('0x20')](function(_0x34f8c7){if(_0x34f8c7){return _0x34f8c7?{'count':_0x717238,'rows':_0x34f8c7}:null;}})[_0x0ce8('0x20')](respondWithResult(_0x40cf73,null))['catch'](handleError(_0x40cf73,null));};
\ No newline at end of file
+var _0x06f1=['findAll','rows','catch','show','params','keys','find','create','body','user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','UserId','faxPause','createdAt','format','%s/%s','SIP','getTeams','Team','rawAttributes','addTeams','ids','User','Agents','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','all','union','value','isEmpty','userFaxQueue:remove','addAgents','omit','removeAgents','getAgents','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','end','error','stack','name','send','map','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','FaxQueue','includeAll','include'];(function(_0x5b2615,_0x46d317){var _0x40b94d=function(_0xe5dc8f){while(--_0xe5dc8f){_0x5b2615['push'](_0x5b2615['shift']());}};_0x40b94d(++_0x46d317);}(_0x06f1,0x159));var _0x106f=function(_0x4b6a27,_0x4486d5){_0x4b6a27=_0x4b6a27-0x0;var _0x3511b3=_0x06f1[_0x4b6a27];return _0x3511b3;};'use strict';var emlformat=require(_0x106f('0x0'));var rimraf=require(_0x106f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x106f('0x2'));var rp=require(_0x106f('0x3'));var moment=require(_0x106f('0x4'));var BPromise=require(_0x106f('0x5'));var Mustache=require(_0x106f('0x6'));var util=require(_0x106f('0x7'));var path=require(_0x106f('0x8'));var sox=require('sox');var csv=require(_0x106f('0x9'));var ejs=require(_0x106f('0xa'));var fs=require('fs');var fs_extra=require(_0x106f('0xb'));var _=require(_0x106f('0xc'));var squel=require(_0x106f('0xd'));var crypto=require('crypto');var jsforce=require(_0x106f('0xe'));var deskjs=require(_0x106f('0xf'));var toCsv=require(_0x106f('0x9'));var querystring=require(_0x106f('0x10'));var Papa=require(_0x106f('0x11'));var Redis=require(_0x106f('0x12'));var authService=require(_0x106f('0x13'));var qs=require(_0x106f('0x14'));var as=require(_0x106f('0x15'));var hardwareService=require(_0x106f('0x16'));var logger=require(_0x106f('0x17'))(_0x106f('0x18'));var utils=require('../../config/utils');var config=require(_0x106f('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x106f('0x1a'))['db'];config[_0x106f('0x1b')]=_[_0x106f('0x1c')](config[_0x106f('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x106f('0x1d'))(new Redis(config[_0x106f('0x1b')]));require('./faxQueue.socket')[_0x106f('0x1e')](socket);function respondWithStatusCode(_0x13e5d6,_0xd0fbc9){_0xd0fbc9=_0xd0fbc9||0xcc;return function(_0x4ba1f8){if(_0x4ba1f8){return _0x13e5d6[_0x106f('0x1f')](_0xd0fbc9);}return _0x13e5d6['status'](_0xd0fbc9)['end']();};}function respondWithResult(_0x924b17,_0x329c79){_0x329c79=_0x329c79||0xc8;return function(_0xabda41){if(_0xabda41){return _0x924b17[_0x106f('0x20')](_0x329c79)[_0x106f('0x21')](_0xabda41);}};}function respondWithFilteredResult(_0x2d2458,_0x41c329){return function(_0xb48c71){if(_0xb48c71){var _0x5dade8=typeof _0x41c329['offset']===_0x106f('0x22')&&typeof _0x41c329['limit']===_0x106f('0x22');var _0x167263=_0xb48c71[_0x106f('0x23')];var _0x4b1d90=_0x5dade8?0x0:_0x41c329[_0x106f('0x24')];var _0x162b1f=_0x5dade8?_0xb48c71[_0x106f('0x23')]:_0x41c329[_0x106f('0x24')]+_0x41c329[_0x106f('0x25')];var _0x4cc41d;if(_0x162b1f>=_0x167263){_0x162b1f=_0x167263;_0x4cc41d=0xc8;}else{_0x4cc41d=0xce;}_0x2d2458['status'](_0x4cc41d);return _0x2d2458[_0x106f('0x26')](_0x106f('0x27'),_0x4b1d90+'-'+_0x162b1f+'/'+_0x167263)[_0x106f('0x21')](_0xb48c71);}return null;};}function patchUpdates(_0x1d3184){return function(_0x20568d){try{jsonpatch[_0x106f('0x28')](_0x20568d,_0x1d3184,!![]);}catch(_0x1981f4){return BPromise[_0x106f('0x29')](_0x1981f4);}return _0x20568d[_0x106f('0x2a')]();};}function saveUpdates(_0x140b8f,_0x95c2a7){return function(_0x5e89c0){if(_0x5e89c0){return _0x5e89c0[_0x106f('0x2b')](_0x140b8f)[_0x106f('0x2c')](function(_0xbdfdfa){return _0xbdfdfa;});}return null;};}function removeEntity(_0x1b47d8,_0x748551){return function(_0x8e5639){if(_0x8e5639){return _0x8e5639[_0x106f('0x2d')]()[_0x106f('0x2c')](function(){var _0x238526=_0x8e5639['get']({'plain':!![]});var _0x3c0947='FaxQueues';return db[_0x106f('0x2e')][_0x106f('0x2d')]({'where':{'type':_0x3c0947,'resourceId':_0x238526['id']}})[_0x106f('0x2c')](function(){return _0x8e5639;});})['then'](function(){_0x1b47d8[_0x106f('0x20')](0xcc)[_0x106f('0x2f')]();});}};}function handleEntityNotFound(_0x11f1cf,_0x4280eb){return function(_0x5eba56){if(!_0x5eba56){_0x11f1cf[_0x106f('0x1f')](0x194);}return _0x5eba56;};}function handleError(_0x14ccc5,_0x42639e){_0x42639e=_0x42639e||0x1f4;return function(_0x326344){logger[_0x106f('0x30')](_0x326344[_0x106f('0x31')]);if(_0x326344[_0x106f('0x32')]){delete _0x326344['name'];}_0x14ccc5[_0x106f('0x20')](_0x42639e)[_0x106f('0x33')](_0x326344);};}exports['index']=function(_0x56f4da,_0xbb95de){var _0x177697={},_0x17ee6e={},_0x588897={'count':0x0,'rows':[]};var _0x539c19=_[_0x106f('0x34')](db['FaxQueue']['rawAttributes'],function(_0x2137be){return{'name':_0x2137be[_0x106f('0x35')],'type':_0x2137be[_0x106f('0x36')][_0x106f('0x37')]};});_0x17ee6e[_0x106f('0x38')]=_[_0x106f('0x34')](_0x539c19,_0x106f('0x32'));_0x17ee6e[_0x106f('0x39')]=_['keys'](_0x56f4da['query']);_0x17ee6e[_0x106f('0x3a')]=_['intersection'](_0x17ee6e[_0x106f('0x38')],_0x17ee6e[_0x106f('0x39')]);_0x177697[_0x106f('0x3b')]=_[_0x106f('0x3c')](_0x17ee6e[_0x106f('0x38')],qs[_0x106f('0x3d')](_0x56f4da[_0x106f('0x39')][_0x106f('0x3d')]));_0x177697['attributes']=_0x177697[_0x106f('0x3b')][_0x106f('0x3e')]?_0x177697[_0x106f('0x3b')]:_0x17ee6e['model'];if(!_0x56f4da[_0x106f('0x39')][_0x106f('0x3f')](_0x106f('0x40'))){_0x177697[_0x106f('0x25')]=qs['limit'](_0x56f4da[_0x106f('0x39')][_0x106f('0x25')]);_0x177697['offset']=qs[_0x106f('0x24')](_0x56f4da[_0x106f('0x39')][_0x106f('0x24')]);}_0x177697[_0x106f('0x41')]=qs[_0x106f('0x42')](_0x56f4da['query'][_0x106f('0x42')]);_0x177697['where']=qs[_0x106f('0x3a')](_[_0x106f('0x43')](_0x56f4da[_0x106f('0x39')],_0x17ee6e[_0x106f('0x3a')]),_0x539c19);if(_0x56f4da['query'][_0x106f('0x44')]){_0x177697[_0x106f('0x45')]=_[_0x106f('0x46')](_0x177697[_0x106f('0x45')],{'$or':_[_0x106f('0x34')](_0x539c19,function(_0x33561e){if(_0x33561e[_0x106f('0x36')]!=='VIRTUAL'){var _0x3bbfb7={};_0x3bbfb7[_0x33561e['name']]={'$like':'%'+_0x56f4da[_0x106f('0x39')]['filter']+'%'};return _0x3bbfb7;}})});}_0x177697=_[_0x106f('0x46')]({},_0x177697,_0x56f4da[_0x106f('0x47')]);var _0x5ae786={'where':_0x177697[_0x106f('0x45')]};return db[_0x106f('0x48')][_0x106f('0x23')](_0x5ae786)[_0x106f('0x2c')](function(_0x31e77c){_0x588897[_0x106f('0x23')]=_0x31e77c;if(_0x56f4da[_0x106f('0x39')][_0x106f('0x49')]){_0x177697[_0x106f('0x4a')]=[{'all':!![]}];}return db[_0x106f('0x48')][_0x106f('0x4b')](_0x177697);})[_0x106f('0x2c')](function(_0x33f8bb){_0x588897[_0x106f('0x4c')]=_0x33f8bb;return _0x588897;})[_0x106f('0x2c')](respondWithFilteredResult(_0xbb95de,_0x177697))[_0x106f('0x4d')](handleError(_0xbb95de,null));};exports[_0x106f('0x4e')]=function(_0x45ade3,_0x305d5a){var _0xa44fcf={'raw':!![],'where':{'id':_0x45ade3[_0x106f('0x4f')]['id']}},_0x45ee2={};_0x45ee2[_0x106f('0x38')]=_['keys'](db[_0x106f('0x48')]['rawAttributes']);_0x45ee2[_0x106f('0x39')]=_[_0x106f('0x50')](_0x45ade3['query']);_0x45ee2[_0x106f('0x3a')]=_['intersection'](_0x45ee2[_0x106f('0x38')],_0x45ee2['query']);_0xa44fcf[_0x106f('0x3b')]=_[_0x106f('0x3c')](_0x45ee2['model'],qs[_0x106f('0x3d')](_0x45ade3[_0x106f('0x39')]['fields']));_0xa44fcf[_0x106f('0x3b')]=_0xa44fcf[_0x106f('0x3b')]['length']?_0xa44fcf[_0x106f('0x3b')]:_0x45ee2[_0x106f('0x38')];if(_0x45ade3[_0x106f('0x39')][_0x106f('0x49')]){_0xa44fcf[_0x106f('0x4a')]=[{'all':!![]}];}_0xa44fcf=_[_0x106f('0x46')]({},_0xa44fcf,_0x45ade3[_0x106f('0x47')]);return db[_0x106f('0x48')][_0x106f('0x51')](_0xa44fcf)[_0x106f('0x2c')](handleEntityNotFound(_0x305d5a,null))[_0x106f('0x2c')](respondWithResult(_0x305d5a,null))['catch'](handleError(_0x305d5a,null));};exports[_0x106f('0x52')]=function(_0x54ccd1,_0x4c6531){return db[_0x106f('0x48')][_0x106f('0x52')](_0x54ccd1[_0x106f('0x53')],{})[_0x106f('0x2c')](function(_0x5ec05e){var _0x314134=_0x54ccd1[_0x106f('0x54')]['get']({'plain':!![]});if(!_0x314134)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x314134[_0x106f('0x55')]===_0x106f('0x54')){var _0x5f1a1e=_0x5ec05e[_0x106f('0x56')]({'plain':!![]});var _0x502c0d='FaxQueues';return db[_0x106f('0x57')]['find']({'where':{'name':_0x502c0d,'userProfileId':_0x314134[_0x106f('0x58')]},'raw':!![]})['then'](function(_0x580f6a){if(_0x580f6a&&_0x580f6a[_0x106f('0x59')]===0x0){return db[_0x106f('0x2e')][_0x106f('0x52')]({'name':_0x5f1a1e[_0x106f('0x32')],'resourceId':_0x5f1a1e['id'],'type':_0x580f6a['name'],'sectionId':_0x580f6a['id']},{})['then'](function(){return _0x5ec05e;});}else{return _0x5ec05e;}})['catch'](function(_0x4a8f29){logger[_0x106f('0x30')](_0x106f('0x5a'),_0x4a8f29);throw _0x4a8f29;});}return _0x5ec05e;})[_0x106f('0x2c')](respondWithResult(_0x4c6531,0xc9))[_0x106f('0x4d')](handleError(_0x4c6531,null));};exports[_0x106f('0x2b')]=function(_0xc3596b,_0x56ac90){if(_0xc3596b['body']['id']){delete _0xc3596b['body']['id'];}return db[_0x106f('0x48')]['find']({'where':{'id':_0xc3596b[_0x106f('0x4f')]['id']}})[_0x106f('0x2c')](handleEntityNotFound(_0x56ac90,null))[_0x106f('0x2c')](saveUpdates(_0xc3596b[_0x106f('0x53')],null))['then'](respondWithResult(_0x56ac90,null))[_0x106f('0x4d')](handleError(_0x56ac90,null));};exports[_0x106f('0x2d')]=function(_0x307ac4,_0x9ff3fe){return db[_0x106f('0x48')][_0x106f('0x51')]({'where':{'id':_0x307ac4[_0x106f('0x4f')]['id']}})[_0x106f('0x2c')](handleEntityNotFound(_0x9ff3fe,null))[_0x106f('0x2c')](removeEntity(_0x9ff3fe,null))[_0x106f('0x4d')](handleError(_0x9ff3fe,null));};exports[_0x106f('0x5b')]=function(_0x3c4166,_0x255613){return db[_0x106f('0x48')]['describe']()[_0x106f('0x2c')](respondWithResult(_0x255613,null))[_0x106f('0x4d')](handleError(_0x255613,null));};exports[_0x106f('0x5c')]=function(_0x171f8a,_0x39f8f4,_0x2b0717){var _0x89e8aa={'raw':!![],'where':{}},_0x472826={},_0x3eb528;return db[_0x106f('0x48')][_0x106f('0x5d')]({'where':{'id':_0x171f8a[_0x106f('0x4f')]['id']}})[_0x106f('0x2c')](handleEntityNotFound(_0x39f8f4,null))[_0x106f('0x2c')](function(_0xf6a89e){if(_0xf6a89e){_0x3eb528=_0xf6a89e['get']({'plain':!![]});_0x472826[_0x106f('0x38')]=_[_0x106f('0x50')](db[_0x106f('0x5e')]['rawAttributes']);_0x472826[_0x106f('0x39')]=_['keys'](_0x171f8a[_0x106f('0x39')]);_0x472826[_0x106f('0x3a')]=_[_0x106f('0x3c')](_0x472826[_0x106f('0x38')],_0x472826['query']);_0x89e8aa['attributes']=_[_0x106f('0x3c')](_0x472826[_0x106f('0x38')],qs['fields'](_0x171f8a[_0x106f('0x39')][_0x106f('0x3d')]));_0x89e8aa[_0x106f('0x3b')]=_0x89e8aa[_0x106f('0x3b')][_0x106f('0x3e')]?_0x89e8aa[_0x106f('0x3b')]:_0x472826[_0x106f('0x38')];if(!_0x171f8a[_0x106f('0x39')][_0x106f('0x3f')](_0x106f('0x40'))){_0x89e8aa['limit']=qs[_0x106f('0x25')](_0x171f8a[_0x106f('0x39')][_0x106f('0x25')]);_0x89e8aa[_0x106f('0x24')]=qs[_0x106f('0x24')](_0x171f8a['query'][_0x106f('0x24')]);}_0x89e8aa[_0x106f('0x41')]=qs[_0x106f('0x42')](_0x171f8a[_0x106f('0x39')][_0x106f('0x42')]);_0x89e8aa['where']=qs[_0x106f('0x3a')](_[_0x106f('0x43')](_0x171f8a[_0x106f('0x39')],_0x472826['filters']));_0x89e8aa['where']['FaxQueueId']=_0xf6a89e['id'];if(_0x171f8a[_0x106f('0x39')][_0x106f('0x44')]){_0x89e8aa[_0x106f('0x45')]=_['merge'](_0x89e8aa[_0x106f('0x45')],{'$or':_[_0x106f('0x34')](_0x89e8aa[_0x106f('0x3b')],function(_0x1c8cc4){var _0x7b692f={};_0x7b692f[_0x1c8cc4]={'$like':'%'+_0x171f8a[_0x106f('0x39')][_0x106f('0x44')]+'%'};return _0x7b692f;})});}_0x89e8aa=_[_0x106f('0x46')]({},_0x89e8aa,_0x171f8a['options']);return db[_0x106f('0x5e')][_0x106f('0x4b')](_0x89e8aa);}})[_0x106f('0x2c')](function(_0x394df0){if(_0x394df0){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0x394df0,_0x106f('0x5f')),'role':'agent'},'attributes':['id','name',_0x106f('0x60'),'updatedAt',_0x106f('0x61')]});}})[_0x106f('0x2c')](function(_0x2b13ec){if(_0x2b13ec){return{'count':_0x2b13ec['count'],'rows':_[_0x106f('0x34')](_0x2b13ec[_0x106f('0x4c')],function(_0x93ff32){return{'membername':_0x93ff32[_0x106f('0x32')],'UserId':_0x93ff32['id'],'queue_name':_0x3eb528['name'],'FaxQueueId':_0x3eb528['id'],'interface':util[_0x106f('0x62')](_0x106f('0x63'),_0x106f('0x64'),_0x93ff32['name']),'penalty':0x0,'paused':_0x93ff32[_0x106f('0x60')],'createdAt':_0x93ff32[_0x106f('0x61')],'updatedAt':_0x93ff32['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x106f('0x2c')](respondWithFilteredResult(_0x39f8f4,_0x89e8aa))[_0x106f('0x4d')](handleError(_0x39f8f4,null));};exports[_0x106f('0x65')]=function(_0x42a715,_0x48adce,_0x56ef9c){var _0x3bbb9d={};var _0x5b83df={};var _0x28e221;var _0x5eedb1;return db[_0x106f('0x48')]['findOne']({'where':{'id':_0x42a715[_0x106f('0x4f')]['id']}})[_0x106f('0x2c')](handleEntityNotFound(_0x48adce,null))['then'](function(_0x349462){if(_0x349462){_0x28e221=_0x349462;_0x5b83df[_0x106f('0x38')]=_[_0x106f('0x50')](db[_0x106f('0x66')][_0x106f('0x67')]);_0x5b83df[_0x106f('0x39')]=_[_0x106f('0x50')](_0x42a715[_0x106f('0x39')]);_0x5b83df[_0x106f('0x3a')]=_[_0x106f('0x3c')](_0x5b83df[_0x106f('0x38')],_0x5b83df[_0x106f('0x39')]);_0x3bbb9d[_0x106f('0x3b')]=_['intersection'](_0x5b83df['model'],qs[_0x106f('0x3d')](_0x42a715['query'][_0x106f('0x3d')]));_0x3bbb9d[_0x106f('0x3b')]=_0x3bbb9d[_0x106f('0x3b')][_0x106f('0x3e')]?_0x3bbb9d['attributes']:_0x5b83df[_0x106f('0x38')];_0x3bbb9d[_0x106f('0x41')]=qs[_0x106f('0x42')](_0x42a715[_0x106f('0x39')]['sort']);_0x3bbb9d[_0x106f('0x45')]=qs[_0x106f('0x3a')](_[_0x106f('0x43')](_0x42a715['query'],_0x5b83df[_0x106f('0x3a')]));if(_0x42a715[_0x106f('0x39')][_0x106f('0x44')]){_0x3bbb9d['where']=_['merge'](_0x3bbb9d[_0x106f('0x45')],{'$or':_['map'](_0x3bbb9d['attributes'],function(_0x3e6969){var _0x18cd37={};_0x18cd37[_0x3e6969]={'$like':'%'+_0x42a715[_0x106f('0x39')][_0x106f('0x44')]+'%'};return _0x18cd37;})});}_0x3bbb9d=_[_0x106f('0x46')]({},_0x3bbb9d,_0x42a715['options']);return _0x28e221[_0x106f('0x65')](_0x3bbb9d);}})[_0x106f('0x2c')](function(_0x29b9da){if(_0x29b9da){_0x5eedb1=_0x29b9da[_0x106f('0x3e')];if(!_0x42a715['query'][_0x106f('0x3f')](_0x106f('0x40'))){_0x3bbb9d[_0x106f('0x25')]=qs[_0x106f('0x25')](_0x42a715['query']['limit']);_0x3bbb9d['offset']=qs[_0x106f('0x24')](_0x42a715['query'][_0x106f('0x24')]);}return _0x28e221[_0x106f('0x65')](_0x3bbb9d);}})[_0x106f('0x2c')](function(_0x18fd11){if(_0x18fd11){return _0x18fd11?{'count':_0x5eedb1,'rows':_0x18fd11}:null;}})['then'](respondWithResult(_0x48adce,null))[_0x106f('0x4d')](handleError(_0x48adce,null));};exports[_0x106f('0x68')]=function(_0x2020a4,_0x535795,_0x48b91a){var _0x1f6d78=_0x2020a4['body'][_0x106f('0x69')];return db[_0x106f('0x66')][_0x106f('0x4b')]({'where':{'id':_0x1f6d78},'attributes':['id'],'include':[{'model':db[_0x106f('0x6a')],'as':_0x106f('0x6b'),'attributes':['id',_0x106f('0x32'),'online','voicePause',_0x106f('0x6c')],'raw':!![]}]})[_0x106f('0x2c')](function(_0x14572d){if(_0x14572d){var _0x1917ab=_[_0x106f('0x6d')](_0x14572d,function(_0x45025f){var _0x3275f3=_0x45025f[_0x106f('0x56')]({'plain':!![]});return _0x3275f3[_0x106f('0x6b')];});return db[_0x106f('0x48')][_0x106f('0x51')]({'where':{'id':_0x2020a4[_0x106f('0x4f')]['id']}})[_0x106f('0x2c')](function(_0x24b2b2){return db[_0x106f('0x6e')]['transaction'](function(_0x503f0c){return _0x24b2b2['addTeams'](_0x1f6d78,{'transaction':_0x503f0c})[_0x106f('0x2c')](function(){return BPromise[_0x106f('0x6f')](_0x1917ab,function(_0x3cc9bd){return db[_0x106f('0x5e')][_0x106f('0x70')]({'where':{'UserId':_0x3cc9bd['id'],'FaxQueueId':_0x2020a4[_0x106f('0x4f')]['id']},'transaction':_0x503f0c});});})[_0x106f('0x2c')](function(){_0x1917ab[_0x106f('0x71')](function(_0x23099d){socket[_0x106f('0x72')](_0x106f('0x73'),{'UserId':_0x23099d['id'],'FaxQueueId':_0x24b2b2['id']});});});});});}})[_0x106f('0x2c')](respondWithStatusCode(_0x535795,null))[_0x106f('0x4d')](handleError(_0x535795,null));};exports[_0x106f('0x74')]=function(_0x42de30,_0x546d38,_0x263bfd){return db[_0x106f('0x66')][_0x106f('0x4b')]({'where':{'id':_0x42de30[_0x106f('0x39')]['ids']},'attributes':['id'],'include':[{'model':db[_0x106f('0x6a')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x106f('0x2c')](handleEntityNotFound(_0x546d38,null))[_0x106f('0x2c')](function(_0x2a1e51){var _0xa28d76=_[_0x106f('0x34')](_0x2a1e51,'id');var _0x500314=[];var _0x3f265d=[];var _0x262413=squel[_0x106f('0x75')]();_0x262413[_0x106f('0x76')](_0x106f('0x77'))[_0x106f('0x78')](_0x106f('0x79'),'tq')['join'](_0x106f('0x7a'),'ut',_0x106f('0x7b'))[_0x106f('0x45')](_0x106f('0x7c'),_0x42de30[_0x106f('0x4f')]['id']);for(var _0x3dea31=0x0;_0x3dea31<_0x2a1e51[_0x106f('0x3e')];_0x3dea31+=0x1){let _0x4be792=_0x2a1e51[_0x3dea31];for(var _0x494ade=0x0;_0x494ade<_0x4be792[_0x106f('0x6b')][_0x106f('0x3e')];_0x494ade+=0x1){let _0x392705=_0x4be792[_0x106f('0x6b')][_0x494ade];var _0x358bd1=_0x262413['clone']();_0x358bd1[_0x106f('0x45')](_0x106f('0x7d'),_0x392705['id']);_0x3f265d['push'](db[_0x106f('0x6e')][_0x106f('0x39')](_0x358bd1[_0x106f('0x7e')](),{'type':db[_0x106f('0x6e')][_0x106f('0x7f')][_0x106f('0x80')]})[_0x106f('0x2c')](function(_0x2db481){if(_0x2db481[_0x106f('0x3e')]===0x1){return _0x392705['id'];}else{var _0x4ddcca=_[_0x106f('0x81')](_[_0x106f('0x34')](_0x2db481,'TeamId'),function(_0x184bfe){return _[_0x106f('0x82')](_0xa28d76,_0x184bfe);});if(_0x4ddcca){return _0x392705['id'];}}}));}}return BPromise[_0x106f('0x83')](_0x3f265d)[_0x106f('0x2c')](function(_0x308fab){_0x500314=_(_0x500314)[_0x106f('0x84')](_0x308fab)['compact']()[_0x106f('0x85')]();return db[_0x106f('0x48')][_0x106f('0x51')]({'where':{'id':_0x42de30['params']['id']}})[_0x106f('0x2c')](function(_0x1f2af6){return db['sequelize']['transaction'](function(_0x8bf7c1){return _0x1f2af6['removeTeams'](_0x42de30['query'][_0x106f('0x69')],{'transaction':_0x8bf7c1})[_0x106f('0x2c')](function(){if(!_[_0x106f('0x86')](_0x500314)){return _0x1f2af6['removeAgents'](_0x500314,{'transaction':_0x8bf7c1});}})[_0x106f('0x2c')](function(){_0x500314[_0x106f('0x71')](function(_0x3b72de){socket[_0x106f('0x72')](_0x106f('0x87'),{'UserId':_0x3b72de,'FaxQueueId':_0x1f2af6['id']});});});});});});})['then'](respondWithStatusCode(_0x546d38,null))[_0x106f('0x4d')](handleError(_0x546d38,null));};exports['addAgents']=function(_0x20564d,_0x23a24c,_0x42c367){return db[_0x106f('0x48')][_0x106f('0x51')]({'where':{'id':_0x20564d[_0x106f('0x4f')]['id']}})[_0x106f('0x2c')](handleEntityNotFound(_0x23a24c,null))[_0x106f('0x2c')](function(_0x356a7e){if(_0x356a7e){return _0x356a7e[_0x106f('0x88')](_0x20564d[_0x106f('0x53')][_0x106f('0x69')],_[_0x106f('0x89')](_0x20564d[_0x106f('0x53')],[_0x106f('0x69'),'id'])||{})['spread'](function(_0xdd4e0a){for(var _0x4d00fe=0x0;_0x4d00fe<_0x20564d[_0x106f('0x53')]['ids'][_0x106f('0x3e')];_0x4d00fe+=0x1){socket[_0x106f('0x72')](_0x106f('0x73'),{'UserId':Number(_0x20564d[_0x106f('0x53')][_0x106f('0x69')][_0x4d00fe]),'FaxQueueId':Number(_0x20564d['params']['id'])});}return _0xdd4e0a;});}})['then'](respondWithResult(_0x23a24c,null))[_0x106f('0x4d')](handleError(_0x23a24c,null));};exports[_0x106f('0x8a')]=function(_0x32febd,_0x1ae9fc,_0xabe5a8){return db[_0x106f('0x48')][_0x106f('0x51')]({'where':{'id':_0x32febd[_0x106f('0x4f')]['id']}})[_0x106f('0x2c')](handleEntityNotFound(_0x1ae9fc,null))[_0x106f('0x2c')](function(_0x39e04e){if(_0x39e04e){return _0x39e04e[_0x106f('0x8a')](_0x32febd[_0x106f('0x39')][_0x106f('0x69')])[_0x106f('0x2c')](function(){if(_['isArray'](_0x32febd['query']['ids'])){for(var _0x1274bc=0x0;_0x1274bc<_0x32febd[_0x106f('0x39')][_0x106f('0x69')][_0x106f('0x3e')];_0x1274bc+=0x1){socket[_0x106f('0x72')](_0x106f('0x87'),{'UserId':Number(_0x32febd[_0x106f('0x39')][_0x106f('0x69')][_0x1274bc]),'FaxQueueId':Number(_0x32febd[_0x106f('0x4f')]['id'])});}}else{socket[_0x106f('0x72')](_0x106f('0x87'),{'UserId':Number(_0x32febd[_0x106f('0x39')]['ids']),'FaxQueueId':Number(_0x32febd['params']['id'])});}});}})['then'](respondWithStatusCode(_0x1ae9fc,null))[_0x106f('0x4d')](handleError(_0x1ae9fc,null));};exports[_0x106f('0x8b')]=function(_0x37cd1c,_0x14bcab,_0x4a4927){var _0x2c61e9={};var _0x8412a1={};var _0x2ebe9c;var _0x5ec174;return db['FaxQueue'][_0x106f('0x5d')]({'where':{'id':_0x37cd1c[_0x106f('0x4f')]['id']}})[_0x106f('0x2c')](handleEntityNotFound(_0x14bcab,null))[_0x106f('0x2c')](function(_0x49a0a9){if(_0x49a0a9){_0x2ebe9c=_0x49a0a9;_0x8412a1['model']=_[_0x106f('0x50')](db[_0x106f('0x6a')][_0x106f('0x67')]);_0x8412a1[_0x106f('0x39')]=_[_0x106f('0x50')](_0x37cd1c['query']);_0x8412a1[_0x106f('0x3a')]=_[_0x106f('0x3c')](_0x8412a1[_0x106f('0x38')],_0x8412a1[_0x106f('0x39')]);_0x2c61e9[_0x106f('0x3b')]=_[_0x106f('0x3c')](_0x8412a1[_0x106f('0x38')],qs[_0x106f('0x3d')](_0x37cd1c[_0x106f('0x39')][_0x106f('0x3d')]));_0x2c61e9[_0x106f('0x3b')]=_0x2c61e9[_0x106f('0x3b')][_0x106f('0x3e')]?_0x2c61e9[_0x106f('0x3b')]:_0x8412a1[_0x106f('0x38')];_0x2c61e9[_0x106f('0x41')]=qs[_0x106f('0x42')](_0x37cd1c['query'][_0x106f('0x42')]);_0x2c61e9['where']=qs[_0x106f('0x3a')](_[_0x106f('0x43')](_0x37cd1c[_0x106f('0x39')],_0x8412a1[_0x106f('0x3a')]));if(_0x37cd1c[_0x106f('0x39')][_0x106f('0x44')]){_0x2c61e9[_0x106f('0x45')]=_['merge'](_0x2c61e9[_0x106f('0x45')],{'$or':_['map'](_0x2c61e9[_0x106f('0x3b')],function(_0x297c0c){var _0x1df38c={};_0x1df38c[_0x297c0c]={'$like':'%'+_0x37cd1c[_0x106f('0x39')][_0x106f('0x44')]+'%'};return _0x1df38c;})});}_0x2c61e9=_['merge']({},_0x2c61e9,_0x37cd1c['options']);return _0x2ebe9c[_0x106f('0x8b')](_0x2c61e9);}})['then'](function(_0x523019){if(_0x523019){_0x5ec174=_0x523019['length'];if(!_0x37cd1c['query'][_0x106f('0x3f')](_0x106f('0x40'))){_0x2c61e9[_0x106f('0x25')]=qs[_0x106f('0x25')](_0x37cd1c['query']['limit']);_0x2c61e9['offset']=qs[_0x106f('0x24')](_0x37cd1c[_0x106f('0x39')][_0x106f('0x24')]);}return _0x2ebe9c[_0x106f('0x8b')](_0x2c61e9);}})[_0x106f('0x2c')](function(_0x4af98a){if(_0x4af98a){return _0x4af98a?{'count':_0x5ec174,'rows':_0x4af98a}:null;}})[_0x106f('0x2c')](respondWithResult(_0x14bcab,null))['catch'](handleError(_0x14bcab,null));};
\ No newline at end of file
index 22c55b1..c32d618 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4bf3=['../../mysqldb','FaxQueue','setMaxListeners','update','remove','emit','hook','exports','events'];(function(_0x881599,_0x23f33b){var _0x4e110f=function(_0xfc6af8){while(--_0xfc6af8){_0x881599['push'](_0x881599['shift']());}};_0x4e110f(++_0x23f33b);}(_0x4bf3,0x128));var _0x34bf=function(_0x308d63,_0x2e0d0a){_0x308d63=_0x308d63-0x0;var _0x59c28e=_0x4bf3[_0x308d63];return _0x59c28e;};'use strict';var EventEmitter=require(_0x34bf('0x0'));var FaxQueue=require(_0x34bf('0x1'))['db'][_0x34bf('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x34bf('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x34bf('0x4'),'afterDestroy':_0x34bf('0x5')};function emitEvent(_0x47cef3){return function(_0x2889e4,_0x49e18a,_0x7be46f){FaxQueueEvents['emit'](_0x47cef3+':'+_0x2889e4['id'],_0x2889e4);FaxQueueEvents[_0x34bf('0x6')](_0x47cef3,_0x2889e4);_0x7be46f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0x34bf('0x7')](e,emitEvent(event));}}module[_0x34bf('0x8')]=FaxQueueEvents;
\ No newline at end of file
+var _0x3018=['hasOwnProperty','hook','events','FaxQueue','setMaxListeners','save','update','emit'];(function(_0x3b632f,_0x453380){var _0x10e788=function(_0x2228a4){while(--_0x2228a4){_0x3b632f['push'](_0x3b632f['shift']());}};_0x10e788(++_0x453380);}(_0x3018,0x1aa));var _0x8301=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x3018[_0x13d07a];return _0x5ee0ee;};'use strict';var EventEmitter=require(_0x8301('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0x8301('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x8301('0x2')](0x0);var events={'afterCreate':_0x8301('0x3'),'afterUpdate':_0x8301('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3bc58e){return function(_0x1184e1,_0x5d2475,_0x5cc907){FaxQueueEvents[_0x8301('0x5')](_0x3bc58e+':'+_0x1184e1['id'],_0x1184e1);FaxQueueEvents[_0x8301('0x5')](_0x3bc58e,_0x1184e1);_0x5cc907(null);};}for(var e in events){if(events[_0x8301('0x6')](e)){var event=events[e];FaxQueue[_0x8301('0x7')](e,emitEvent(event));}}module['exports']=FaxQueueEvents;
\ No newline at end of file
index 3b0542a..dafa05e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb372=['bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','fax_queues','util','api'];(function(_0x9f638d,_0x542250){var _0x1d35da=function(_0x2725e4){while(--_0x2725e4){_0x9f638d['push'](_0x9f638d['shift']());}};_0x1d35da(++_0x542250);}(_0xb372,0x1ea));var _0x2b37=function(_0x58f9f0,_0x1b27af){_0x58f9f0=_0x58f9f0-0x0;var _0x42ab78=_0xb372[_0x58f9f0];return _0x42ab78;};'use strict';var _=require('lodash');var util=require(_0x2b37('0x0'));var logger=require('../../config/logger')(_0x2b37('0x1'));var moment=require('moment');var BPromise=require(_0x2b37('0x2'));var rp=require(_0x2b37('0x3'));var fs=require('fs');var path=require(_0x2b37('0x4'));var rimraf=require(_0x2b37('0x5'));var config=require(_0x2b37('0x6'));var attributes=require(_0x2b37('0x7'));module[_0x2b37('0x8')]=function(_0x3fdfe3,_0x40017c){return _0x3fdfe3[_0x2b37('0x9')](_0x2b37('0xa'),attributes,{'tableName':_0x2b37('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x54ea=['FaxQueue','fax_queues','lodash','../../config/logger','api','bluebird','rimraf','../../config/environment','./faxQueue.attributes'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x54ea,0x92));var _0xa54e=function(_0x433cc7,_0x52803c){_0x433cc7=_0x433cc7-0x0;var _0x5862fe=_0x54ea[_0x433cc7];return _0x5862fe;};'use strict';var _=require(_0xa54e('0x0'));var util=require('util');var logger=require(_0xa54e('0x1'))(_0xa54e('0x2'));var moment=require('moment');var BPromise=require(_0xa54e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa54e('0x4'));var config=require(_0xa54e('0x5'));var attributes=require(_0xa54e('0x6'));module['exports']=function(_0x56e51d,_0x5adfa9){return _0x56e51d['define'](_0xa54e('0x7'),attributes,{'tableName':_0xa54e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d65cd08..51a86ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1837=['client','redis','defaults','request','then','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','FaxQueue','findAll','options','where','include','map','model','attributes','GetFaxQueue','stringify','find','ShowFaxQueue','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x18bff2,_0x175c6c){var _0x5d3a2d=function(_0x17f78a){while(--_0x17f78a){_0x18bff2['push'](_0x18bff2['shift']());}};_0x5d3a2d(++_0x175c6c);}(_0x1837,0x168));var _0x7183=function(_0x59dab8,_0x3dfdfc){_0x59dab8=_0x59dab8-0x0;var _0x2dab28=_0x1837[_0x59dab8];return _0x2dab28;};'use strict';var _=require(_0x7183('0x0'));var util=require(_0x7183('0x1'));var moment=require(_0x7183('0x2'));var BPromise=require(_0x7183('0x3'));var rs=require(_0x7183('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7183('0x5'))['db'];var utils=require(_0x7183('0x6'));var logger=require(_0x7183('0x7'))('rpc');var config=require(_0x7183('0x8'));var jayson=require(_0x7183('0x9'));var client=jayson[_0x7183('0xa')]['http']({'port':0x232a});config[_0x7183('0xb')]=_[_0x7183('0xc')](config[_0x7183('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxQueue.socket')['register'](socket);function respondWithRpcPromise(_0x148663,_0x3fe75f,_0x28865b){return new BPromise(function(_0x1a24bb,_0x4e2892){return client[_0x7183('0xd')](_0x148663,_0x28865b)[_0x7183('0xe')](function(_0x3f91b6){logger['info'](_0x7183('0xf'),_0x3fe75f,_0x7183('0x10'));logger[_0x7183('0x11')](_0x7183('0x12'),_0x3fe75f,_0x7183('0x10'),JSON['stringify'](_0x3f91b6));if(_0x3f91b6[_0x7183('0x13')]){if(_0x3f91b6[_0x7183('0x13')][_0x7183('0x14')]===0x1f4){logger[_0x7183('0x13')](_0x7183('0xf'),_0x3fe75f,_0x3f91b6['error'][_0x7183('0x15')]);return _0x4e2892(_0x3f91b6[_0x7183('0x13')][_0x7183('0x15')]);}logger[_0x7183('0x13')](_0x7183('0xf'),_0x3fe75f,_0x3f91b6[_0x7183('0x13')]['message']);return _0x1a24bb(_0x3f91b6[_0x7183('0x13')][_0x7183('0x15')]);}else{logger[_0x7183('0x16')](_0x7183('0xf'),_0x3fe75f,_0x7183('0x10'));_0x1a24bb(_0x3f91b6[_0x7183('0x17')][_0x7183('0x15')]);}})[_0x7183('0x18')](function(_0xc78fe2){logger[_0x7183('0x13')](_0x7183('0xf'),_0x3fe75f,_0xc78fe2);_0x4e2892(_0xc78fe2);});});}exports['GetFaxQueue']=function(_0x58f1ed){var _0x16c5bd=this;return new Promise(function(_0x29d5dd,_0x562ed1){return db[_0x7183('0x19')][_0x7183('0x1a')]({'raw':_0x58f1ed[_0x7183('0x1b')]?_0x58f1ed[_0x7183('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x58f1ed[_0x7183('0x1b')]?_0x58f1ed[_0x7183('0x1b')][_0x7183('0x1c')]||null:null,'attributes':_0x58f1ed[_0x7183('0x1b')]?_0x58f1ed[_0x7183('0x1b')]['attributes']||null:null,'limit':_0x58f1ed[_0x7183('0x1b')]?_0x58f1ed['options']['limit']||null:null,'include':_0x58f1ed[_0x7183('0x1b')]?_0x58f1ed[_0x7183('0x1b')][_0x7183('0x1d')]?_[_0x7183('0x1e')](_0x58f1ed[_0x7183('0x1b')]['include'],function(_0x153831){return{'model':db[_0x153831[_0x7183('0x1f')]],'as':_0x153831['as'],'attributes':_0x153831[_0x7183('0x20')],'include':_0x153831[_0x7183('0x1d')]?_[_0x7183('0x1e')](_0x153831['include'],function(_0x5747a8){return{'model':db[_0x5747a8[_0x7183('0x1f')]],'as':_0x5747a8['as'],'attributes':_0x5747a8[_0x7183('0x20')],'include':_0x5747a8['include']?_[_0x7183('0x1e')](_0x5747a8[_0x7183('0x1d')],function(_0x33b00a){return{'model':db[_0x33b00a[_0x7183('0x1f')]],'as':_0x33b00a['as'],'attributes':_0x33b00a['attributes']};}):[]};}):[]};}):[]:[]})[_0x7183('0xe')](function(_0x52b169){logger['info'](_0x7183('0x21'),_0x58f1ed);logger[_0x7183('0x11')]('GetFaxQueue',_0x58f1ed,JSON[_0x7183('0x22')](_0x52b169));_0x29d5dd(_0x52b169);})[_0x7183('0x18')](function(_0x13bb20){logger[_0x7183('0x13')](_0x7183('0x21'),_0x13bb20[_0x7183('0x15')],_0x58f1ed);_0x562ed1(_0x16c5bd[_0x7183('0x13')](0x1f4,_0x13bb20['message']));});});};exports['ShowFaxQueue']=function(_0x4d4877){var _0x227d62=this;return new Promise(function(_0x3dbcea,_0x1febec){return db['FaxQueue'][_0x7183('0x23')]({'raw':_0x4d4877[_0x7183('0x1b')]?_0x4d4877['options']['raw']===undefined?!![]:![]:!![],'where':_0x4d4877[_0x7183('0x1b')]?_0x4d4877[_0x7183('0x1b')][_0x7183('0x1c')]||null:null,'attributes':_0x4d4877['options']?_0x4d4877[_0x7183('0x1b')][_0x7183('0x20')]||null:null,'include':_0x4d4877[_0x7183('0x1b')]?_0x4d4877['options'][_0x7183('0x1d')]?_['map'](_0x4d4877['options'][_0x7183('0x1d')],function(_0x50bde2){return{'model':db[_0x50bde2['model']],'as':_0x50bde2['as'],'attributes':_0x50bde2[_0x7183('0x20')],'include':_0x50bde2[_0x7183('0x1d')]?_[_0x7183('0x1e')](_0x50bde2[_0x7183('0x1d')],function(_0xe6e0c3){return{'model':db[_0xe6e0c3['model']],'as':_0xe6e0c3['as'],'attributes':_0xe6e0c3[_0x7183('0x20')],'include':_0xe6e0c3[_0x7183('0x1d')]?_['map'](_0xe6e0c3[_0x7183('0x1d')],function(_0x354c2b){return{'model':db[_0x354c2b[_0x7183('0x1f')]],'as':_0x354c2b['as'],'attributes':_0x354c2b[_0x7183('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xdc586e){logger[_0x7183('0x16')]('ShowFaxQueue',_0x4d4877);logger['debug'](_0x7183('0x24'),_0x4d4877,JSON['stringify'](_0xdc586e));_0x3dbcea(_0xdc586e);})[_0x7183('0x18')](function(_0x5fa8cc){logger['error']('ShowFaxQueue',_0x5fa8cc[_0x7183('0x15')],_0x4d4877);_0x1febec(_0x227d62[_0x7183('0x13')](0x1f4,_0x5fa8cc[_0x7183('0x15')]));});});};
\ No newline at end of file
+var _0xb44e=['register','request','then','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','FaxQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetFaxQueue','debug','ShowFaxQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./faxQueue.socket'];(function(_0x412e27,_0x20a978){var _0x53da42=function(_0x43cae5){while(--_0x43cae5){_0x412e27['push'](_0x412e27['shift']());}};_0x53da42(++_0x20a978);}(_0xb44e,0x1bd));var _0xeb44=function(_0x258fb0,_0x5362dc){_0x258fb0=_0x258fb0-0x0;var _0x4d1afe=_0xb44e[_0x258fb0];return _0x4d1afe;};'use strict';var _=require(_0xeb44('0x0'));var util=require(_0xeb44('0x1'));var moment=require(_0xeb44('0x2'));var BPromise=require(_0xeb44('0x3'));var rs=require(_0xeb44('0x4'));var fs=require('fs');var Redis=require(_0xeb44('0x5'));var db=require(_0xeb44('0x6'))['db'];var utils=require(_0xeb44('0x7'));var logger=require(_0xeb44('0x8'))('rpc');var config=require(_0xeb44('0x9'));var jayson=require(_0xeb44('0xa'));var client=jayson[_0xeb44('0xb')][_0xeb44('0xc')]({'port':0x232a});config['redis']=_[_0xeb44('0xd')](config[_0xeb44('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0xeb44('0xf'))(new Redis(config['redis']));require(_0xeb44('0x10'))[_0xeb44('0x11')](socket);function respondWithRpcPromise(_0x9386a0,_0x4fc67f,_0x7c43b1){return new BPromise(function(_0xa67183,_0x70173){return client[_0xeb44('0x12')](_0x9386a0,_0x7c43b1)[_0xeb44('0x13')](function(_0x50c37e){logger['info'](_0xeb44('0x14'),_0x4fc67f,_0xeb44('0x15'));logger['debug'](_0xeb44('0x16'),_0x4fc67f,_0xeb44('0x15'),JSON[_0xeb44('0x17')](_0x50c37e));if(_0x50c37e[_0xeb44('0x18')]){if(_0x50c37e['error'][_0xeb44('0x19')]===0x1f4){logger[_0xeb44('0x18')](_0xeb44('0x14'),_0x4fc67f,_0x50c37e['error'][_0xeb44('0x1a')]);return _0x70173(_0x50c37e[_0xeb44('0x18')][_0xeb44('0x1a')]);}logger[_0xeb44('0x18')](_0xeb44('0x14'),_0x4fc67f,_0x50c37e[_0xeb44('0x18')][_0xeb44('0x1a')]);return _0xa67183(_0x50c37e[_0xeb44('0x18')][_0xeb44('0x1a')]);}else{logger[_0xeb44('0x1b')](_0xeb44('0x14'),_0x4fc67f,_0xeb44('0x15'));_0xa67183(_0x50c37e['result'][_0xeb44('0x1a')]);}})['catch'](function(_0x4c1d04){logger['error']('FaxQueue,\x20%s,\x20%s',_0x4fc67f,_0x4c1d04);_0x70173(_0x4c1d04);});});}exports['GetFaxQueue']=function(_0x3f811c){var _0x2fe4c0=this;return new Promise(function(_0x1104bf,_0x5aa146){return db[_0xeb44('0x1c')][_0xeb44('0x1d')]({'raw':_0x3f811c['options']?_0x3f811c[_0xeb44('0x1e')][_0xeb44('0x1f')]===undefined?!![]:![]:!![],'where':_0x3f811c[_0xeb44('0x1e')]?_0x3f811c[_0xeb44('0x1e')][_0xeb44('0x20')]||null:null,'attributes':_0x3f811c['options']?_0x3f811c[_0xeb44('0x1e')][_0xeb44('0x21')]||null:null,'limit':_0x3f811c[_0xeb44('0x1e')]?_0x3f811c[_0xeb44('0x1e')][_0xeb44('0x22')]||null:null,'include':_0x3f811c['options']?_0x3f811c[_0xeb44('0x1e')][_0xeb44('0x23')]?_[_0xeb44('0x24')](_0x3f811c[_0xeb44('0x1e')][_0xeb44('0x23')],function(_0x318a00){return{'model':db[_0x318a00[_0xeb44('0x25')]],'as':_0x318a00['as'],'attributes':_0x318a00[_0xeb44('0x21')],'include':_0x318a00[_0xeb44('0x23')]?_[_0xeb44('0x24')](_0x318a00[_0xeb44('0x23')],function(_0x2d57f8){return{'model':db[_0x2d57f8[_0xeb44('0x25')]],'as':_0x2d57f8['as'],'attributes':_0x2d57f8[_0xeb44('0x21')],'include':_0x2d57f8[_0xeb44('0x23')]?_[_0xeb44('0x24')](_0x2d57f8['include'],function(_0x3e67a0){return{'model':db[_0x3e67a0['model']],'as':_0x3e67a0['as'],'attributes':_0x3e67a0['attributes']};}):[]};}):[]};}):[]:[]})[_0xeb44('0x13')](function(_0x2dca61){logger['info'](_0xeb44('0x26'),_0x3f811c);logger[_0xeb44('0x27')](_0xeb44('0x26'),_0x3f811c,JSON[_0xeb44('0x17')](_0x2dca61));_0x1104bf(_0x2dca61);})['catch'](function(_0x4f3499){logger[_0xeb44('0x18')](_0xeb44('0x26'),_0x4f3499[_0xeb44('0x1a')],_0x3f811c);_0x5aa146(_0x2fe4c0[_0xeb44('0x18')](0x1f4,_0x4f3499['message']));});});};exports[_0xeb44('0x28')]=function(_0x3dfd99){var _0x302d46=this;return new Promise(function(_0x1fe907,_0x314593){return db[_0xeb44('0x1c')][_0xeb44('0x29')]({'raw':_0x3dfd99['options']?_0x3dfd99['options']['raw']===undefined?!![]:![]:!![],'where':_0x3dfd99[_0xeb44('0x1e')]?_0x3dfd99[_0xeb44('0x1e')][_0xeb44('0x20')]||null:null,'attributes':_0x3dfd99[_0xeb44('0x1e')]?_0x3dfd99[_0xeb44('0x1e')][_0xeb44('0x21')]||null:null,'include':_0x3dfd99['options']?_0x3dfd99[_0xeb44('0x1e')]['include']?_[_0xeb44('0x24')](_0x3dfd99[_0xeb44('0x1e')]['include'],function(_0x22cc81){return{'model':db[_0x22cc81[_0xeb44('0x25')]],'as':_0x22cc81['as'],'attributes':_0x22cc81[_0xeb44('0x21')],'include':_0x22cc81[_0xeb44('0x23')]?_[_0xeb44('0x24')](_0x22cc81['include'],function(_0xe1c9ac){return{'model':db[_0xe1c9ac[_0xeb44('0x25')]],'as':_0xe1c9ac['as'],'attributes':_0xe1c9ac[_0xeb44('0x21')],'include':_0xe1c9ac['include']?_[_0xeb44('0x24')](_0xe1c9ac[_0xeb44('0x23')],function(_0x1a65d5){return{'model':db[_0x1a65d5['model']],'as':_0x1a65d5['as'],'attributes':_0x1a65d5[_0xeb44('0x21')]};}):[]};}):[]};}):[]:[]})[_0xeb44('0x13')](function(_0x1dd5ed){logger[_0xeb44('0x1b')]('ShowFaxQueue',_0x3dfd99);logger[_0xeb44('0x27')]('ShowFaxQueue',_0x3dfd99,JSON[_0xeb44('0x17')](_0x1dd5ed));_0x1fe907(_0x1dd5ed);})['catch'](function(_0x24d99b){logger[_0xeb44('0x18')](_0xeb44('0x28'),_0x24d99b[_0xeb44('0x1a')],_0x3dfd99);_0x314593(_0x302d46['error'](0x1f4,_0x24d99b[_0xeb44('0x1a')]));});});};
\ No newline at end of file
index 439fde5..539ed0b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5da4=['register','length','faxQueue:','./faxQueue.events','save','remove','update','emit','removeListener'];(function(_0x2500e1,_0x5f38e3){var _0x159478=function(_0x2dd1c1){while(--_0x2dd1c1){_0x2500e1['push'](_0x2500e1['shift']());}};_0x159478(++_0x5f38e3);}(_0x5da4,0x174));var _0x45da=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5da4[_0x3dd15e];return _0x231fd0;};'use strict';var FaxQueueEvents=require(_0x45da('0x0'));var events=[_0x45da('0x1'),_0x45da('0x2'),_0x45da('0x3')];function createListener(_0x347e42,_0x100a57){return function(_0x50be1b){_0x100a57[_0x45da('0x4')](_0x347e42,_0x50be1b);};}function removeListener(_0x50feb6,_0x2d5904){return function(){FaxQueueEvents[_0x45da('0x5')](_0x50feb6,_0x2d5904);};}exports[_0x45da('0x6')]=function(_0x41ecc4){for(var _0x1025e7=0x0,_0x18561a=events[_0x45da('0x7')];_0x1025e7<_0x18561a;_0x1025e7++){var _0x1260ec=events[_0x1025e7];var _0x20378b=createListener(_0x45da('0x8')+_0x1260ec,_0x41ecc4);FaxQueueEvents['on'](_0x1260ec,_0x20378b);}};
\ No newline at end of file
+var _0xbb7c=['length','faxQueue:','./faxQueue.events','save','remove','update','removeListener','register'];(function(_0xfa317c,_0x20e7b2){var _0x378737=function(_0x2f5764){while(--_0x2f5764){_0xfa317c['push'](_0xfa317c['shift']());}};_0x378737(++_0x20e7b2);}(_0xbb7c,0x17a));var _0xcbb7=function(_0x233bf3,_0x5be1fb){_0x233bf3=_0x233bf3-0x0;var _0x189505=_0xbb7c[_0x233bf3];return _0x189505;};'use strict';var FaxQueueEvents=require(_0xcbb7('0x0'));var events=[_0xcbb7('0x1'),_0xcbb7('0x2'),_0xcbb7('0x3')];function createListener(_0x24eb21,_0x3dbf5c){return function(_0x3ef54f){_0x3dbf5c['emit'](_0x24eb21,_0x3ef54f);};}function removeListener(_0x17a717,_0x44e3e3){return function(){FaxQueueEvents[_0xcbb7('0x4')](_0x17a717,_0x44e3e3);};}exports[_0xcbb7('0x5')]=function(_0x397075){for(var _0x3824f5=0x0,_0x3f359e=events[_0xcbb7('0x6')];_0x3824f5<_0x3f359e;_0x3824f5++){var _0x56f5ea=events[_0x3824f5];var _0x316c06=createListener(_0xcbb7('0x7')+_0x56f5ea,_0x397075);FaxQueueEvents['on'](_0x56f5ea,_0x316c06);}};
\ No newline at end of file
index 01f7bba..0a9de8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9505=['create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./faxQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','/:id/teams','/:id/users','getAgents','post'];(function(_0x18a4f7,_0x3f915c){var _0x368cf3=function(_0x173245){while(--_0x173245){_0x18a4f7['push'](_0x18a4f7['shift']());}};_0x368cf3(++_0x3f915c);}(_0x9505,0x1e5));var _0x5950=function(_0x2b5682,_0x21963b){_0x2b5682=_0x2b5682-0x0;var _0x331f84=_0x9505[_0x2b5682];return _0x331f84;};'use strict';var multer=require(_0x5950('0x0'));var util=require(_0x5950('0x1'));var path=require('path');var timeout=require(_0x5950('0x2'));var express=require(_0x5950('0x3'));var router=express[_0x5950('0x4')]();var fs_extra=require(_0x5950('0x5'));var auth=require(_0x5950('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5950('0x7'));router[_0x5950('0x8')]('/',auth[_0x5950('0x9')](),controller[_0x5950('0xa')]);router['get']('/describe',auth[_0x5950('0x9')](),controller[_0x5950('0xb')]);router[_0x5950('0x8')](_0x5950('0xc'),auth[_0x5950('0x9')](),controller[_0x5950('0xd')]);router[_0x5950('0x8')](_0x5950('0xe'),auth[_0x5950('0x9')](),controller['getMembers']);router[_0x5950('0x8')](_0x5950('0xf'),auth['isAuthenticated'](),controller['getTeams']);router[_0x5950('0x8')](_0x5950('0x10'),auth[_0x5950('0x9')](),controller[_0x5950('0x11')]);router[_0x5950('0x12')]('/',auth[_0x5950('0x9')](),controller[_0x5950('0x13')]);router[_0x5950('0x12')](_0x5950('0xf'),auth[_0x5950('0x9')](),controller[_0x5950('0x14')]);router[_0x5950('0x12')](_0x5950('0x10'),auth[_0x5950('0x9')](),controller[_0x5950('0x15')]);router[_0x5950('0x16')](_0x5950('0xc'),auth[_0x5950('0x9')](),controller[_0x5950('0x17')]);router[_0x5950('0x18')](_0x5950('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0x5950('0x18')](_0x5950('0xf'),auth[_0x5950('0x9')](),controller[_0x5950('0x19')]);router[_0x5950('0x18')]('/:id/users',auth['isAuthenticated'](),controller[_0x5950('0x1a')]);module[_0x5950('0x1b')]=router;
\ No newline at end of file
+var _0x32f4=['/:id/teams','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','/describe','show','/:id/members','/:id/users','getAgents','post','create','addTeams','addAgents','/:id','update','delete','destroy'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x32f4,0x154));var _0x432f=function(_0x1d6a6c,_0x1f0fca){_0x1d6a6c=_0x1d6a6c-0x0;var _0x320a67=_0x32f4[_0x1d6a6c];return _0x320a67;};'use strict';var multer=require(_0x432f('0x0'));var util=require(_0x432f('0x1'));var path=require(_0x432f('0x2'));var timeout=require(_0x432f('0x3'));var express=require('express');var router=express[_0x432f('0x4')]();var fs_extra=require(_0x432f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x432f('0x6'));var config=require(_0x432f('0x7'));var controller=require(_0x432f('0x8'));router[_0x432f('0x9')]('/',auth[_0x432f('0xa')](),controller['index']);router['get'](_0x432f('0xb'),auth[_0x432f('0xa')](),controller['describe']);router[_0x432f('0x9')]('/:id',auth[_0x432f('0xa')](),controller[_0x432f('0xc')]);router[_0x432f('0x9')](_0x432f('0xd'),auth[_0x432f('0xa')](),controller['getMembers']);router[_0x432f('0x9')]('/:id/teams',auth[_0x432f('0xa')](),controller['getTeams']);router[_0x432f('0x9')](_0x432f('0xe'),auth['isAuthenticated'](),controller[_0x432f('0xf')]);router[_0x432f('0x10')]('/',auth['isAuthenticated'](),controller[_0x432f('0x11')]);router[_0x432f('0x10')]('/:id/teams',auth['isAuthenticated'](),controller[_0x432f('0x12')]);router[_0x432f('0x10')](_0x432f('0xe'),auth[_0x432f('0xa')](),controller[_0x432f('0x13')]);router['put'](_0x432f('0x14'),auth[_0x432f('0xa')](),controller[_0x432f('0x15')]);router[_0x432f('0x16')]('/:id',auth[_0x432f('0xa')](),controller[_0x432f('0x17')]);router[_0x432f('0x16')](_0x432f('0x18'),auth[_0x432f('0xa')](),controller[_0x432f('0x19')]);router['delete'](_0x432f('0xe'),auth['isAuthenticated'](),controller[_0x432f('0x1a')]);module[_0x432f('0x1b')]=router;
\ No newline at end of file
index 7d5a5ac..5c0505f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8466=['DATE','moment','sequelize','STRING'];(function(_0x5933f8,_0x17d2e4){var _0x8c0caf=function(_0x2a5c07){while(--_0x2a5c07){_0x5933f8['push'](_0x5933f8['shift']());}};_0x8c0caf(++_0x17d2e4);}(_0x8466,0x139));var _0x6846=function(_0x15b317,_0x5454af){_0x15b317=_0x15b317-0x0;var _0x2245b4=_0x8466[_0x15b317];return _0x2245b4;};'use strict';var moment=require(_0x6846('0x0'));var Sequelize=require(_0x6846('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x6846('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x6846('0x3')]},'acceptAt':{'type':Sequelize[_0x6846('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x643d=['exports','DATE','sequelize'];(function(_0x2c41fc,_0x21b69a){var _0x17a299=function(_0x5e64b5){while(--_0x5e64b5){_0x2c41fc['push'](_0x2c41fc['shift']());}};_0x17a299(++_0x21b69a);}(_0x643d,0x1df));var _0xd643=function(_0x4e502e,_0x2a7c94){_0x4e502e=_0x4e502e-0x0;var _0x25c957=_0x643d[_0x4e502e];return _0x25c957;};'use strict';var moment=require('moment');var Sequelize=require(_0xd643('0x0'));module[_0xd643('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xd643('0x2')]},'leaveAt':{'type':Sequelize[_0xd643('0x2')]},'acceptAt':{'type':Sequelize[_0xd643('0x2')]},'exitAt':{'type':Sequelize[_0xd643('0x2')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 9dab1aa..df80329 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc112=['rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','set','Content-Range','reject','save','update','destroy','then','sendStatus','error','stack','send','index','map','FaxQueueReport','rawAttributes','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','name','count','rows','catch','show','params','keys','includeAll','options','find','create','body','describe','eml-format'];(function(_0x2ec534,_0x252dce){var _0x3c9ea3=function(_0x158b8e){while(--_0x158b8e){_0x2ec534['push'](_0x2ec534['shift']());}};_0x3c9ea3(++_0x252dce);}(_0xc112,0xec));var _0x2c11=function(_0x2ad844,_0x48b021){_0x2ad844=_0x2ad844-0x0;var _0x495981=_0xc112[_0x2ad844];return _0x495981;};'use strict';var emlformat=require(_0x2c11('0x0'));var rimraf=require(_0x2c11('0x1'));var zipdir=require(_0x2c11('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2c11('0x3'));var moment=require(_0x2c11('0x4'));var BPromise=require(_0x2c11('0x5'));var Mustache=require(_0x2c11('0x6'));var util=require(_0x2c11('0x7'));var path=require(_0x2c11('0x8'));var sox=require(_0x2c11('0x9'));var csv=require(_0x2c11('0xa'));var ejs=require(_0x2c11('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2c11('0xc'));var crypto=require(_0x2c11('0xd'));var jsforce=require(_0x2c11('0xe'));var deskjs=require(_0x2c11('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2c11('0x10'));var Papa=require(_0x2c11('0x11'));var Redis=require('ioredis');var authService=require(_0x2c11('0x12'));var qs=require(_0x2c11('0x13'));var as=require(_0x2c11('0x14'));var hardwareService=require(_0x2c11('0x15'));var logger=require(_0x2c11('0x16'))('api');var utils=require(_0x2c11('0x17'));var config=require(_0x2c11('0x18'));var licenseUtil=require(_0x2c11('0x19'));var db=require(_0x2c11('0x1a'))['db'];function respondWithStatusCode(_0x3c08ad,_0x913a3e){_0x913a3e=_0x913a3e||0xcc;return function(_0x3c522d){if(_0x3c522d){return _0x3c08ad['sendStatus'](_0x913a3e);}return _0x3c08ad[_0x2c11('0x1b')](_0x913a3e)[_0x2c11('0x1c')]();};}function respondWithResult(_0x3b9fd3,_0x3f8c82){_0x3f8c82=_0x3f8c82||0xc8;return function(_0x11e3ac){if(_0x11e3ac){return _0x3b9fd3[_0x2c11('0x1b')](_0x3f8c82)[_0x2c11('0x1d')](_0x11e3ac);}};}function respondWithFilteredResult(_0x9ff302,_0xc33bbf){return function(_0x3c97d4){if(_0x3c97d4){var _0x19808f=typeof _0xc33bbf['offset']===_0x2c11('0x1e')&&typeof _0xc33bbf[_0x2c11('0x1f')]===_0x2c11('0x1e');var _0x5bfd4a=_0x3c97d4['count'];var _0x89a56=_0x19808f?0x0:_0xc33bbf[_0x2c11('0x20')];var _0x3988d7=_0x19808f?_0x3c97d4['count']:_0xc33bbf[_0x2c11('0x20')]+_0xc33bbf['limit'];var _0x1bf204;if(_0x3988d7>=_0x5bfd4a){_0x3988d7=_0x5bfd4a;_0x1bf204=0xc8;}else{_0x1bf204=0xce;}_0x9ff302[_0x2c11('0x1b')](_0x1bf204);return _0x9ff302[_0x2c11('0x21')](_0x2c11('0x22'),_0x89a56+'-'+_0x3988d7+'/'+_0x5bfd4a)[_0x2c11('0x1d')](_0x3c97d4);}return null;};}function patchUpdates(_0x340424){return function(_0x48c0a6){try{jsonpatch['apply'](_0x48c0a6,_0x340424,!![]);}catch(_0x506577){return BPromise[_0x2c11('0x23')](_0x506577);}return _0x48c0a6[_0x2c11('0x24')]();};}function saveUpdates(_0x20e812,_0xdcb060){return function(_0x34ca91){if(_0x34ca91){return _0x34ca91[_0x2c11('0x25')](_0x20e812)['then'](function(_0x195960){return _0x195960;});}return null;};}function removeEntity(_0x2339bf,_0x45b96f){return function(_0x6f0764){if(_0x6f0764){return _0x6f0764[_0x2c11('0x26')]()[_0x2c11('0x27')](function(){_0x2339bf[_0x2c11('0x1b')](0xcc)[_0x2c11('0x1c')]();});}};}function handleEntityNotFound(_0x107983,_0x4167d6){return function(_0x55dcce){if(!_0x55dcce){_0x107983[_0x2c11('0x28')](0x194);}return _0x55dcce;};}function handleError(_0x287a9a,_0x20e000){_0x20e000=_0x20e000||0x1f4;return function(_0x308da8){logger[_0x2c11('0x29')](_0x308da8[_0x2c11('0x2a')]);if(_0x308da8['name']){delete _0x308da8['name'];}_0x287a9a[_0x2c11('0x1b')](_0x20e000)[_0x2c11('0x2b')](_0x308da8);};}exports[_0x2c11('0x2c')]=function(_0x39caa5,_0x200803){var _0x202c4c={},_0x2a494f={},_0x558b69={'count':0x0,'rows':[]};var _0x4c13e1=_[_0x2c11('0x2d')](db[_0x2c11('0x2e')][_0x2c11('0x2f')],function(_0x29e598){return{'name':_0x29e598['fieldName'],'type':_0x29e598['type'][_0x2c11('0x30')]};});_0x2a494f[_0x2c11('0x31')]=_[_0x2c11('0x2d')](_0x4c13e1,'name');_0x2a494f['query']=_['keys'](_0x39caa5[_0x2c11('0x32')]);_0x2a494f[_0x2c11('0x33')]=_[_0x2c11('0x34')](_0x2a494f[_0x2c11('0x31')],_0x2a494f[_0x2c11('0x32')]);_0x202c4c['attributes']=_[_0x2c11('0x34')](_0x2a494f[_0x2c11('0x31')],qs['fields'](_0x39caa5[_0x2c11('0x32')][_0x2c11('0x35')]));_0x202c4c[_0x2c11('0x36')]=_0x202c4c[_0x2c11('0x36')][_0x2c11('0x37')]?_0x202c4c['attributes']:_0x2a494f[_0x2c11('0x31')];if(!_0x39caa5[_0x2c11('0x32')][_0x2c11('0x38')](_0x2c11('0x39'))){_0x202c4c[_0x2c11('0x1f')]=qs[_0x2c11('0x1f')](_0x39caa5[_0x2c11('0x32')][_0x2c11('0x1f')]);_0x202c4c[_0x2c11('0x20')]=qs[_0x2c11('0x20')](_0x39caa5[_0x2c11('0x32')][_0x2c11('0x20')]);}_0x202c4c[_0x2c11('0x3a')]=qs[_0x2c11('0x3b')](_0x39caa5['query'][_0x2c11('0x3b')]);_0x202c4c[_0x2c11('0x3c')]=qs[_0x2c11('0x33')](_[_0x2c11('0x3d')](_0x39caa5[_0x2c11('0x32')],_0x2a494f[_0x2c11('0x33')]),_0x4c13e1);if(_0x39caa5['query'][_0x2c11('0x3e')]){_0x202c4c['where']=_[_0x2c11('0x3f')](_0x202c4c[_0x2c11('0x3c')],{'$or':_[_0x2c11('0x2d')](_0x4c13e1,function(_0x412d29){if(_0x412d29[_0x2c11('0x40')]!==_0x2c11('0x41')){var _0x5c5538={};_0x5c5538[_0x412d29[_0x2c11('0x42')]]={'$like':'%'+_0x39caa5[_0x2c11('0x32')][_0x2c11('0x3e')]+'%'};return _0x5c5538;}})});}_0x202c4c=_[_0x2c11('0x3f')]({},_0x202c4c,_0x39caa5['options']);var _0x2a02d7={'where':_0x202c4c[_0x2c11('0x3c')]};return db[_0x2c11('0x2e')][_0x2c11('0x43')](_0x2a02d7)[_0x2c11('0x27')](function(_0x4c6396){_0x558b69['count']=_0x4c6396;if(_0x39caa5[_0x2c11('0x32')]['includeAll']){_0x202c4c['include']=[{'all':!![]}];}return db[_0x2c11('0x2e')]['findAll'](_0x202c4c);})[_0x2c11('0x27')](function(_0x7de814){_0x558b69[_0x2c11('0x44')]=_0x7de814;return _0x558b69;})[_0x2c11('0x27')](respondWithFilteredResult(_0x200803,_0x202c4c))[_0x2c11('0x45')](handleError(_0x200803,null));};exports[_0x2c11('0x46')]=function(_0x11a599,_0x10526e){var _0x42200b={'raw':!![],'where':{'id':_0x11a599[_0x2c11('0x47')]['id']}},_0x54756f={};_0x54756f[_0x2c11('0x31')]=_[_0x2c11('0x48')](db[_0x2c11('0x2e')]['rawAttributes']);_0x54756f[_0x2c11('0x32')]=_[_0x2c11('0x48')](_0x11a599[_0x2c11('0x32')]);_0x54756f['filters']=_[_0x2c11('0x34')](_0x54756f['model'],_0x54756f['query']);_0x42200b[_0x2c11('0x36')]=_['intersection'](_0x54756f[_0x2c11('0x31')],qs['fields'](_0x11a599[_0x2c11('0x32')][_0x2c11('0x35')]));_0x42200b[_0x2c11('0x36')]=_0x42200b['attributes']['length']?_0x42200b[_0x2c11('0x36')]:_0x54756f[_0x2c11('0x31')];if(_0x11a599[_0x2c11('0x32')][_0x2c11('0x49')]){_0x42200b['include']=[{'all':!![]}];}_0x42200b=_['merge']({},_0x42200b,_0x11a599[_0x2c11('0x4a')]);return db['FaxQueueReport'][_0x2c11('0x4b')](_0x42200b)[_0x2c11('0x27')](handleEntityNotFound(_0x10526e,null))[_0x2c11('0x27')](respondWithResult(_0x10526e,null))[_0x2c11('0x45')](handleError(_0x10526e,null));};exports[_0x2c11('0x4c')]=function(_0x4df987,_0x10e955){return db['FaxQueueReport'][_0x2c11('0x4c')](_0x4df987[_0x2c11('0x4d')],{})[_0x2c11('0x27')](respondWithResult(_0x10e955,0xc9))[_0x2c11('0x45')](handleError(_0x10e955,null));};exports[_0x2c11('0x25')]=function(_0x45aaec,_0x28a00f){if(_0x45aaec[_0x2c11('0x4d')]['id']){delete _0x45aaec[_0x2c11('0x4d')]['id'];}return db[_0x2c11('0x2e')][_0x2c11('0x4b')]({'where':{'id':_0x45aaec['params']['id']}})[_0x2c11('0x27')](handleEntityNotFound(_0x28a00f,null))[_0x2c11('0x27')](saveUpdates(_0x45aaec['body'],null))[_0x2c11('0x27')](respondWithResult(_0x28a00f,null))[_0x2c11('0x45')](handleError(_0x28a00f,null));};exports[_0x2c11('0x26')]=function(_0x313675,_0x138c6c){return db[_0x2c11('0x2e')][_0x2c11('0x4b')]({'where':{'id':_0x313675[_0x2c11('0x47')]['id']}})[_0x2c11('0x27')](handleEntityNotFound(_0x138c6c,null))[_0x2c11('0x27')](removeEntity(_0x138c6c,null))['catch'](handleError(_0x138c6c,null));};exports['describe']=function(_0x12acf5,_0x5d84e1){return db[_0x2c11('0x2e')][_0x2c11('0x4e')]()[_0x2c11('0x27')](respondWithResult(_0x5d84e1,null))[_0x2c11('0x45')](handleError(_0x5d84e1,null));};
\ No newline at end of file
+var _0xf3dc=['merge','includeAll','rows','catch','show','include','options','find','create','body','update','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','save','then','destroy','error','stack','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','key','keys','filters','intersection','model','attributes','fields','length','query','hasOwnProperty','nolimit','order','sort','pick','filter','type','VIRTUAL'];(function(_0x2197dc,_0x485043){var _0x31963e=function(_0x4747e5){while(--_0x4747e5){_0x2197dc['push'](_0x2197dc['shift']());}};_0x31963e(++_0x485043);}(_0xf3dc,0x9c));var _0xcf3d=function(_0x158da6,_0x3cb06d){_0x158da6=_0x158da6-0x0;var _0x429c30=_0xf3dc[_0x158da6];return _0x429c30;};'use strict';var emlformat=require(_0xcf3d('0x0'));var rimraf=require(_0xcf3d('0x1'));var zipdir=require(_0xcf3d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcf3d('0x3'));var moment=require(_0xcf3d('0x4'));var BPromise=require(_0xcf3d('0x5'));var Mustache=require(_0xcf3d('0x6'));var util=require(_0xcf3d('0x7'));var path=require(_0xcf3d('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xcf3d('0x9'));var jsforce=require(_0xcf3d('0xa'));var deskjs=require(_0xcf3d('0xb'));var toCsv=require(_0xcf3d('0xc'));var querystring=require(_0xcf3d('0xd'));var Papa=require(_0xcf3d('0xe'));var Redis=require(_0xcf3d('0xf'));var authService=require(_0xcf3d('0x10'));var qs=require(_0xcf3d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xcf3d('0x12'));var utils=require('../../config/utils');var config=require(_0xcf3d('0x13'));var licenseUtil=require(_0xcf3d('0x14'));var db=require(_0xcf3d('0x15'))['db'];function respondWithStatusCode(_0x16d627,_0x449322){_0x449322=_0x449322||0xcc;return function(_0xe6d631){if(_0xe6d631){return _0x16d627[_0xcf3d('0x16')](_0x449322);}return _0x16d627[_0xcf3d('0x17')](_0x449322)[_0xcf3d('0x18')]();};}function respondWithResult(_0x4f16f2,_0x5432b7){_0x5432b7=_0x5432b7||0xc8;return function(_0x119e66){if(_0x119e66){return _0x4f16f2[_0xcf3d('0x17')](_0x5432b7)[_0xcf3d('0x19')](_0x119e66);}};}function respondWithFilteredResult(_0x238386,_0x253210){return function(_0x2b401e){if(_0x2b401e){var _0x196b1f=typeof _0x253210[_0xcf3d('0x1a')]===_0xcf3d('0x1b')&&typeof _0x253210[_0xcf3d('0x1c')]==='undefined';var _0x5e5f18=_0x2b401e[_0xcf3d('0x1d')];var _0x22fd74=_0x196b1f?0x0:_0x253210['offset'];var _0x3272e3=_0x196b1f?_0x2b401e[_0xcf3d('0x1d')]:_0x253210[_0xcf3d('0x1a')]+_0x253210[_0xcf3d('0x1c')];var _0x369c7a;if(_0x3272e3>=_0x5e5f18){_0x3272e3=_0x5e5f18;_0x369c7a=0xc8;}else{_0x369c7a=0xce;}_0x238386['status'](_0x369c7a);return _0x238386['set']('Content-Range',_0x22fd74+'-'+_0x3272e3+'/'+_0x5e5f18)['json'](_0x2b401e);}return null;};}function patchUpdates(_0x32dfe0){return function(_0x5d828b){try{jsonpatch[_0xcf3d('0x1e')](_0x5d828b,_0x32dfe0,!![]);}catch(_0x5dcaa2){return BPromise['reject'](_0x5dcaa2);}return _0x5d828b[_0xcf3d('0x1f')]();};}function saveUpdates(_0xb19c1a,_0x1e515b){return function(_0x1ef058){if(_0x1ef058){return _0x1ef058['update'](_0xb19c1a)[_0xcf3d('0x20')](function(_0x3b6c8f){return _0x3b6c8f;});}return null;};}function removeEntity(_0x329728,_0x78a3c7){return function(_0x40dce9){if(_0x40dce9){return _0x40dce9[_0xcf3d('0x21')]()['then'](function(){_0x329728['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f49f0,_0xa9f01c){return function(_0x38fd44){if(!_0x38fd44){_0x2f49f0[_0xcf3d('0x16')](0x194);}return _0x38fd44;};}function handleError(_0x23c287,_0x3ceb68){_0x3ceb68=_0x3ceb68||0x1f4;return function(_0xa32d3c){logger[_0xcf3d('0x22')](_0xa32d3c[_0xcf3d('0x23')]);if(_0xa32d3c[_0xcf3d('0x24')]){delete _0xa32d3c[_0xcf3d('0x24')];}_0x23c287[_0xcf3d('0x17')](_0x3ceb68)[_0xcf3d('0x25')](_0xa32d3c);};}exports[_0xcf3d('0x26')]=function(_0x33f41f,_0x5771a4){var _0x1b4fc7={},_0x45a224={},_0x5e89a4={'count':0x0,'rows':[]};var _0x26df0f=_[_0xcf3d('0x27')](db[_0xcf3d('0x28')][_0xcf3d('0x29')],function(_0x2c2cd9){return{'name':_0x2c2cd9[_0xcf3d('0x2a')],'type':_0x2c2cd9['type'][_0xcf3d('0x2b')]};});_0x45a224['model']=_[_0xcf3d('0x27')](_0x26df0f,_0xcf3d('0x24'));_0x45a224['query']=_[_0xcf3d('0x2c')](_0x33f41f['query']);_0x45a224[_0xcf3d('0x2d')]=_[_0xcf3d('0x2e')](_0x45a224[_0xcf3d('0x2f')],_0x45a224['query']);_0x1b4fc7[_0xcf3d('0x30')]=_[_0xcf3d('0x2e')](_0x45a224[_0xcf3d('0x2f')],qs[_0xcf3d('0x31')](_0x33f41f['query'][_0xcf3d('0x31')]));_0x1b4fc7[_0xcf3d('0x30')]=_0x1b4fc7[_0xcf3d('0x30')][_0xcf3d('0x32')]?_0x1b4fc7['attributes']:_0x45a224[_0xcf3d('0x2f')];if(!_0x33f41f[_0xcf3d('0x33')][_0xcf3d('0x34')](_0xcf3d('0x35'))){_0x1b4fc7[_0xcf3d('0x1c')]=qs[_0xcf3d('0x1c')](_0x33f41f['query'][_0xcf3d('0x1c')]);_0x1b4fc7[_0xcf3d('0x1a')]=qs[_0xcf3d('0x1a')](_0x33f41f[_0xcf3d('0x33')][_0xcf3d('0x1a')]);}_0x1b4fc7[_0xcf3d('0x36')]=qs[_0xcf3d('0x37')](_0x33f41f[_0xcf3d('0x33')][_0xcf3d('0x37')]);_0x1b4fc7['where']=qs[_0xcf3d('0x2d')](_[_0xcf3d('0x38')](_0x33f41f[_0xcf3d('0x33')],_0x45a224[_0xcf3d('0x2d')]),_0x26df0f);if(_0x33f41f[_0xcf3d('0x33')][_0xcf3d('0x39')]){_0x1b4fc7['where']=_['merge'](_0x1b4fc7['where'],{'$or':_['map'](_0x26df0f,function(_0x4a1be9){if(_0x4a1be9[_0xcf3d('0x3a')]!==_0xcf3d('0x3b')){var _0x1b6ac4={};_0x1b6ac4[_0x4a1be9['name']]={'$like':'%'+_0x33f41f[_0xcf3d('0x33')][_0xcf3d('0x39')]+'%'};return _0x1b6ac4;}})});}_0x1b4fc7=_[_0xcf3d('0x3c')]({},_0x1b4fc7,_0x33f41f['options']);var _0x10012d={'where':_0x1b4fc7['where']};return db[_0xcf3d('0x28')][_0xcf3d('0x1d')](_0x10012d)[_0xcf3d('0x20')](function(_0x2238a8){_0x5e89a4[_0xcf3d('0x1d')]=_0x2238a8;if(_0x33f41f[_0xcf3d('0x33')][_0xcf3d('0x3d')]){_0x1b4fc7['include']=[{'all':!![]}];}return db[_0xcf3d('0x28')]['findAll'](_0x1b4fc7);})[_0xcf3d('0x20')](function(_0x12b9d5){_0x5e89a4[_0xcf3d('0x3e')]=_0x12b9d5;return _0x5e89a4;})['then'](respondWithFilteredResult(_0x5771a4,_0x1b4fc7))[_0xcf3d('0x3f')](handleError(_0x5771a4,null));};exports[_0xcf3d('0x40')]=function(_0x13ca2e,_0x13545b){var _0x3e5738={'raw':!![],'where':{'id':_0x13ca2e['params']['id']}},_0x57a6f0={};_0x57a6f0[_0xcf3d('0x2f')]=_['keys'](db[_0xcf3d('0x28')][_0xcf3d('0x29')]);_0x57a6f0[_0xcf3d('0x33')]=_[_0xcf3d('0x2c')](_0x13ca2e[_0xcf3d('0x33')]);_0x57a6f0['filters']=_[_0xcf3d('0x2e')](_0x57a6f0[_0xcf3d('0x2f')],_0x57a6f0[_0xcf3d('0x33')]);_0x3e5738[_0xcf3d('0x30')]=_[_0xcf3d('0x2e')](_0x57a6f0[_0xcf3d('0x2f')],qs[_0xcf3d('0x31')](_0x13ca2e['query'][_0xcf3d('0x31')]));_0x3e5738['attributes']=_0x3e5738[_0xcf3d('0x30')][_0xcf3d('0x32')]?_0x3e5738['attributes']:_0x57a6f0['model'];if(_0x13ca2e[_0xcf3d('0x33')][_0xcf3d('0x3d')]){_0x3e5738[_0xcf3d('0x41')]=[{'all':!![]}];}_0x3e5738=_[_0xcf3d('0x3c')]({},_0x3e5738,_0x13ca2e[_0xcf3d('0x42')]);return db[_0xcf3d('0x28')][_0xcf3d('0x43')](_0x3e5738)[_0xcf3d('0x20')](handleEntityNotFound(_0x13545b,null))[_0xcf3d('0x20')](respondWithResult(_0x13545b,null))['catch'](handleError(_0x13545b,null));};exports[_0xcf3d('0x44')]=function(_0x2f2e88,_0x3201fc){return db[_0xcf3d('0x28')]['create'](_0x2f2e88[_0xcf3d('0x45')],{})[_0xcf3d('0x20')](respondWithResult(_0x3201fc,0xc9))[_0xcf3d('0x3f')](handleError(_0x3201fc,null));};exports[_0xcf3d('0x46')]=function(_0x532c82,_0x1298ce){if(_0x532c82[_0xcf3d('0x45')]['id']){delete _0x532c82[_0xcf3d('0x45')]['id'];}return db[_0xcf3d('0x28')][_0xcf3d('0x43')]({'where':{'id':_0x532c82['params']['id']}})[_0xcf3d('0x20')](handleEntityNotFound(_0x1298ce,null))[_0xcf3d('0x20')](saveUpdates(_0x532c82[_0xcf3d('0x45')],null))[_0xcf3d('0x20')](respondWithResult(_0x1298ce,null))[_0xcf3d('0x3f')](handleError(_0x1298ce,null));};exports['destroy']=function(_0x4198e6,_0x3caf27){return db[_0xcf3d('0x28')]['find']({'where':{'id':_0x4198e6[_0xcf3d('0x47')]['id']}})[_0xcf3d('0x20')](handleEntityNotFound(_0x3caf27,null))['then'](removeEntity(_0x3caf27,null))[_0xcf3d('0x3f')](handleError(_0x3caf27,null));};exports['describe']=function(_0xd11e6e,_0x3ac3cc){return db[_0xcf3d('0x28')]['describe']()[_0xcf3d('0x20')](respondWithResult(_0x3ac3cc,null))[_0xcf3d('0x3f')](handleError(_0x3ac3cc,null));};
\ No newline at end of file
index caf1243..7621913 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(_0x1f8129,_0x55e233){var _0x4e987f=function(_0x39a5c5){while(--_0x39a5c5){_0x1f8129['push'](_0x1f8129['shift']());}};_0x4e987f(++_0x55e233);}(_0x1261,0x144));var _0x1126=function(_0x323bf6,_0x19aed6){_0x323bf6=_0x323bf6-0x0;var _0x18da88=_0x1261[_0x323bf6];return _0x18da88;};'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 _0xe14b=['bluebird','path','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','moment'];(function(_0x48f58f,_0x3a9b8c){var _0x307523=function(_0x39b455){while(--_0x39b455){_0x48f58f['push'](_0x48f58f['shift']());}};_0x307523(++_0x3a9b8c);}(_0xe14b,0x93));var _0xbe14=function(_0x2e628b,_0x5acaa4){_0x2e628b=_0x2e628b-0x0;var _0x56ae77=_0xe14b[_0x2e628b];return _0x56ae77;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 8a55a58..70c7df7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca5d=['lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','FaxQueueReport','create','body','options','raw','CreateFaxQueueReport','catch','UpdateFaxQueueReport','where','attributes','limit'];(function(_0x9bd3c1,_0x11dc72){var _0x33aa72=function(_0xc67824){while(--_0xc67824){_0x9bd3c1['push'](_0x9bd3c1['shift']());}};_0x33aa72(++_0x11dc72);}(_0xca5d,0x1ce));var _0xdca5=function(_0x3240c9,_0x89845d){_0x3240c9=_0x3240c9-0x0;var _0x1f90e7=_0xca5d[_0x3240c9];return _0x1f90e7;};'use strict';var _=require(_0xdca5('0x0'));var util=require('util');var moment=require(_0xdca5('0x1'));var BPromise=require(_0xdca5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdca5('0x3'));var db=require(_0xdca5('0x4'))['db'];var utils=require(_0xdca5('0x5'));var logger=require(_0xdca5('0x6'))(_0xdca5('0x7'));var config=require(_0xdca5('0x8'));var jayson=require(_0xdca5('0x9'));var client=jayson[_0xdca5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58ea6d,_0x3a8f4a,_0x23e270){return new BPromise(function(_0x2d60ad,_0x22804a){return client[_0xdca5('0xb')](_0x58ea6d,_0x23e270)[_0xdca5('0xc')](function(_0x46d5e2){logger[_0xdca5('0xd')](_0xdca5('0xe'),_0x3a8f4a,_0xdca5('0xf'));logger[_0xdca5('0x10')](_0xdca5('0x11'),_0x3a8f4a,_0xdca5('0xf'),JSON[_0xdca5('0x12')](_0x46d5e2));if(_0x46d5e2[_0xdca5('0x13')]){if(_0x46d5e2[_0xdca5('0x13')]['code']===0x1f4){logger[_0xdca5('0x13')](_0xdca5('0xe'),_0x3a8f4a,_0x46d5e2['error'][_0xdca5('0x14')]);return _0x22804a(_0x46d5e2['error'][_0xdca5('0x14')]);}logger['error'](_0xdca5('0xe'),_0x3a8f4a,_0x46d5e2[_0xdca5('0x13')][_0xdca5('0x14')]);return _0x2d60ad(_0x46d5e2['error'][_0xdca5('0x14')]);}else{logger['info'](_0xdca5('0xe'),_0x3a8f4a,_0xdca5('0xf'));_0x2d60ad(_0x46d5e2[_0xdca5('0x15')]['message']);}})['catch'](function(_0xf270ab){logger[_0xdca5('0x13')](_0xdca5('0xe'),_0x3a8f4a,_0xf270ab);_0x22804a(_0xf270ab);});});}exports['CreateFaxQueueReport']=function(_0x3ae6cc){var _0x1617ee=this;return new Promise(function(_0x26ecef,_0x4705b1){return db[_0xdca5('0x16')][_0xdca5('0x17')](_0x3ae6cc[_0xdca5('0x18')],{'raw':_0x3ae6cc[_0xdca5('0x19')]?_0x3ae6cc[_0xdca5('0x19')][_0xdca5('0x1a')]===undefined?!![]:![]:!![]})[_0xdca5('0xc')](function(_0x3b822d){logger[_0xdca5('0xd')](_0xdca5('0x1b'),_0x3ae6cc);logger['debug'](_0xdca5('0x1b'),_0x3ae6cc,JSON[_0xdca5('0x12')](_0x3b822d));_0x26ecef(_0x3b822d);})[_0xdca5('0x1c')](function(_0x229ccd){logger[_0xdca5('0x13')](_0xdca5('0x1b'),_0x229ccd['message'],_0x3ae6cc);_0x4705b1(_0x1617ee[_0xdca5('0x13')](0x1f4,_0x229ccd[_0xdca5('0x14')]));});});};exports[_0xdca5('0x1d')]=function(_0x5378b3){var _0x7b5dc2=this;return new Promise(function(_0x38a26d,_0x4d3a18){return db[_0xdca5('0x16')]['update'](_0x5378b3['body'],{'raw':_0x5378b3[_0xdca5('0x19')]?_0x5378b3[_0xdca5('0x19')][_0xdca5('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5378b3[_0xdca5('0x19')]?_0x5378b3['options'][_0xdca5('0x1e')]||null:null,'attributes':_0x5378b3[_0xdca5('0x19')]?_0x5378b3[_0xdca5('0x19')][_0xdca5('0x1f')]||null:null,'limit':_0x5378b3[_0xdca5('0x19')]?_0x5378b3[_0xdca5('0x19')][_0xdca5('0x20')]||null:null})[_0xdca5('0xc')](function(_0x4857fd){logger['info'](_0xdca5('0x1d'),_0x5378b3);logger[_0xdca5('0x10')](_0xdca5('0x1d'),_0x5378b3,JSON['stringify'](_0x4857fd));_0x38a26d(_0x4857fd);})['catch'](function(_0x5775f4){logger[_0xdca5('0x13')](_0xdca5('0x1d'),_0x5775f4[_0xdca5('0x14')],_0x5378b3);_0x4d3a18(_0x7b5dc2['error'](0x1f4,_0x5775f4[_0xdca5('0x14')]));});});};
\ No newline at end of file
+var _0xfe7a=['lodash','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','body','options','raw','CreateFaxQueueReport','UpdateFaxQueueReport','FaxQueueReport','update','where','attributes','limit'];(function(_0xe9de93,_0x367011){var _0x373799=function(_0x1cee50){while(--_0x1cee50){_0xe9de93['push'](_0xe9de93['shift']());}};_0x373799(++_0x367011);}(_0xfe7a,0x140));var _0xafe7=function(_0x3bf975,_0x5a749b){_0x3bf975=_0x3bf975-0x0;var _0x5af02d=_0xfe7a[_0x3bf975];return _0x5af02d;};'use strict';var _=require(_0xafe7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xafe7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xafe7('0x2'));var db=require(_0xafe7('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xafe7('0x4'));var config=require(_0xafe7('0x5'));var jayson=require(_0xafe7('0x6'));var client=jayson[_0xafe7('0x7')][_0xafe7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2f96f6,_0x2be6eb,_0x2414ab){return new BPromise(function(_0x46c162,_0x414c56){return client[_0xafe7('0x9')](_0x2f96f6,_0x2414ab)[_0xafe7('0xa')](function(_0x2f9232){logger[_0xafe7('0xb')](_0xafe7('0xc'),_0x2be6eb,_0xafe7('0xd'));logger[_0xafe7('0xe')](_0xafe7('0xf'),_0x2be6eb,_0xafe7('0xd'),JSON[_0xafe7('0x10')](_0x2f9232));if(_0x2f9232[_0xafe7('0x11')]){if(_0x2f9232['error'][_0xafe7('0x12')]===0x1f4){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x2be6eb,_0x2f9232['error'][_0xafe7('0x13')]);return _0x414c56(_0x2f9232[_0xafe7('0x11')][_0xafe7('0x13')]);}logger[_0xafe7('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0x2be6eb,_0x2f9232[_0xafe7('0x11')][_0xafe7('0x13')]);return _0x46c162(_0x2f9232[_0xafe7('0x11')][_0xafe7('0x13')]);}else{logger[_0xafe7('0xb')]('FaxQueueReport,\x20%s,\x20%s',_0x2be6eb,'request\x20sent');_0x46c162(_0x2f9232[_0xafe7('0x14')]['message']);}})[_0xafe7('0x15')](function(_0x1b80b9){logger[_0xafe7('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0x2be6eb,_0x1b80b9);_0x414c56(_0x1b80b9);});});}exports['CreateFaxQueueReport']=function(_0x225ca8){var _0x96b2a9=this;return new Promise(function(_0x2ab947,_0x5aa9cf){return db['FaxQueueReport']['create'](_0x225ca8[_0xafe7('0x16')],{'raw':_0x225ca8[_0xafe7('0x17')]?_0x225ca8[_0xafe7('0x17')][_0xafe7('0x18')]===undefined?!![]:![]:!![]})[_0xafe7('0xa')](function(_0x4e5cd5){logger['info']('CreateFaxQueueReport',_0x225ca8);logger[_0xafe7('0xe')](_0xafe7('0x19'),_0x225ca8,JSON[_0xafe7('0x10')](_0x4e5cd5));_0x2ab947(_0x4e5cd5);})['catch'](function(_0x45ecc0){logger[_0xafe7('0x11')](_0xafe7('0x19'),_0x45ecc0['message'],_0x225ca8);_0x5aa9cf(_0x96b2a9[_0xafe7('0x11')](0x1f4,_0x45ecc0[_0xafe7('0x13')]));});});};exports[_0xafe7('0x1a')]=function(_0xf2c329){var _0x58d808=this;return new Promise(function(_0x42871d,_0x427673){return db[_0xafe7('0x1b')][_0xafe7('0x1c')](_0xf2c329[_0xafe7('0x16')],{'raw':_0xf2c329[_0xafe7('0x17')]?_0xf2c329['options'][_0xafe7('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf2c329[_0xafe7('0x17')]?_0xf2c329[_0xafe7('0x17')][_0xafe7('0x1d')]||null:null,'attributes':_0xf2c329[_0xafe7('0x17')]?_0xf2c329[_0xafe7('0x17')][_0xafe7('0x1e')]||null:null,'limit':_0xf2c329[_0xafe7('0x17')]?_0xf2c329[_0xafe7('0x17')][_0xafe7('0x1f')]||null:null})[_0xafe7('0xa')](function(_0x569ab2){logger[_0xafe7('0xb')](_0xafe7('0x1a'),_0xf2c329);logger[_0xafe7('0xe')](_0xafe7('0x1a'),_0xf2c329,JSON[_0xafe7('0x10')](_0x569ab2));_0x42871d(_0x569ab2);})['catch'](function(_0x4c02ae){logger[_0xafe7('0x11')](_0xafe7('0x1a'),_0x4c02ae[_0xafe7('0x13')],_0xf2c329);_0x427673(_0x58d808['error'](0x1f4,_0x4c02ae[_0xafe7('0x13')]));});});};
\ No newline at end of file
index 040732b..cbe77e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc398=['/:id','post','create','put','update','delete','destroy','multer','path','express','Router','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x5a392e,_0x720a74){var _0x29cf38=function(_0x5d149e){while(--_0x5d149e){_0x5a392e['push'](_0x5a392e['shift']());}};_0x29cf38(++_0x720a74);}(_0xc398,0x15d));var _0x8c39=function(_0x9307ea,_0x38968a){_0x9307ea=_0x9307ea-0x0;var _0x295554=_0xc398[_0x9307ea];return _0x295554;};'use strict';var multer=require(_0x8c39('0x0'));var util=require('util');var path=require(_0x8c39('0x1'));var timeout=require('connect-timeout');var express=require(_0x8c39('0x2'));var router=express[_0x8c39('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8c39('0x4'));var config=require(_0x8c39('0x5'));var controller=require(_0x8c39('0x6'));router[_0x8c39('0x7')]('/',auth[_0x8c39('0x8')](),controller[_0x8c39('0x9')]);router[_0x8c39('0x7')](_0x8c39('0xa'),auth['isAuthenticated'](),controller[_0x8c39('0xb')]);router[_0x8c39('0x7')](_0x8c39('0xc'),auth[_0x8c39('0x8')](),controller['show']);router[_0x8c39('0xd')]('/',auth[_0x8c39('0x8')](),controller[_0x8c39('0xe')]);router[_0x8c39('0xf')]('/:id',auth[_0x8c39('0x8')](),controller[_0x8c39('0x10')]);router[_0x8c39('0x11')](_0x8c39('0xc'),auth[_0x8c39('0x8')](),controller[_0x8c39('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x4b0e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','/describe','isAuthenticated','describe','/:id','post','create','put','update','delete','exports','multer','path','connect-timeout','express'];(function(_0x1314d4,_0xb0b16d){var _0x584ba5=function(_0x394269){while(--_0x394269){_0x1314d4['push'](_0x1314d4['shift']());}};_0x584ba5(++_0xb0b16d);}(_0x4b0e,0xf8));var _0xe4b0=function(_0x3c98fe,_0x55bf8b){_0x3c98fe=_0x3c98fe-0x0;var _0x91bea0=_0x4b0e[_0x3c98fe];return _0x91bea0;};'use strict';var multer=require(_0xe4b0('0x0'));var util=require('util');var path=require(_0xe4b0('0x1'));var timeout=require(_0xe4b0('0x2'));var express=require(_0xe4b0('0x3'));var router=express[_0xe4b0('0x4')]();var fs_extra=require(_0xe4b0('0x5'));var auth=require(_0xe4b0('0x6'));var interaction=require(_0xe4b0('0x7'));var config=require(_0xe4b0('0x8'));var controller=require(_0xe4b0('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xe4b0('0xa')](_0xe4b0('0xb'),auth[_0xe4b0('0xc')](),controller[_0xe4b0('0xd')]);router[_0xe4b0('0xa')](_0xe4b0('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xe4b0('0xf')]('/',auth[_0xe4b0('0xc')](),controller[_0xe4b0('0x10')]);router[_0xe4b0('0x11')](_0xe4b0('0xe'),auth[_0xe4b0('0xc')](),controller[_0xe4b0('0x12')]);router[_0xe4b0('0x13')](_0xe4b0('0xe'),auth[_0xe4b0('0xc')](),controller['destroy']);module[_0xe4b0('0x14')]=router;
\ No newline at end of file
index 5295b16..7951497 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0xf6fc32,_0x175c5e){var _0x32a988=function(_0x42f16f){while(--_0x42f16f){_0xf6fc32['push'](_0xf6fc32['shift']());}};_0x32a988(++_0x175c5e);}(_0x4b84,0x1cc));var _0x44b8=function(_0x2c1dcd,_0x350452){_0x2c1dcd=_0x2c1dcd-0x0;var _0x158ce5=_0x4b84[_0x2c1dcd];return _0x158ce5;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x3702aa,_0x431114){var _0xee2d76=function(_0x476a83){while(--_0x476a83){_0x3702aa['push'](_0x3702aa['shift']());}};_0xee2d76(++_0x431114);}(_0xf4eb,0xec));var _0xbf4e=function(_0x3ca6bc,_0x4b1767){_0x3ca6bc=_0x3ca6bc-0x0;var _0x1f3372=_0xf4eb[_0x3ca6bc];return _0x1f3372;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}};
\ No newline at end of file
index 86db6aa..1e80b90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa08=['error','stack','send','index','map','FaxTransferReport','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','include','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','save','update','then'];(function(_0x37b236,_0x4620b8){var _0xb51036=function(_0x63dedd){while(--_0x63dedd){_0x37b236['push'](_0x37b236['shift']());}};_0xb51036(++_0x4620b8);}(_0xfa08,0xbc));var _0x8fa0=function(_0xb31201,_0x378868){_0xb31201=_0xb31201-0x0;var _0x408d55=_0xfa08[_0xb31201];return _0x408d55;};'use strict';var emlformat=require(_0x8fa0('0x0'));var rimraf=require(_0x8fa0('0x1'));var zipdir=require(_0x8fa0('0x2'));var jsonpatch=require(_0x8fa0('0x3'));var rp=require('request-promise');var moment=require(_0x8fa0('0x4'));var BPromise=require(_0x8fa0('0x5'));var Mustache=require(_0x8fa0('0x6'));var util=require(_0x8fa0('0x7'));var path=require(_0x8fa0('0x8'));var sox=require(_0x8fa0('0x9'));var csv=require(_0x8fa0('0xa'));var ejs=require(_0x8fa0('0xb'));var fs=require('fs');var fs_extra=require(_0x8fa0('0xc'));var _=require(_0x8fa0('0xd'));var squel=require('squel');var crypto=require(_0x8fa0('0xe'));var jsforce=require(_0x8fa0('0xf'));var deskjs=require(_0x8fa0('0x10'));var toCsv=require('to-csv');var querystring=require(_0x8fa0('0x11'));var Papa=require(_0x8fa0('0x12'));var Redis=require('ioredis');var authService=require(_0x8fa0('0x13'));var qs=require(_0x8fa0('0x14'));var as=require(_0x8fa0('0x15'));var hardwareService=require(_0x8fa0('0x16'));var logger=require(_0x8fa0('0x17'))(_0x8fa0('0x18'));var utils=require(_0x8fa0('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8fa0('0x1a'))['db'];function respondWithStatusCode(_0x4af615,_0x3557d0){_0x3557d0=_0x3557d0||0xcc;return function(_0x3f5364){if(_0x3f5364){return _0x4af615[_0x8fa0('0x1b')](_0x3557d0);}return _0x4af615[_0x8fa0('0x1c')](_0x3557d0)[_0x8fa0('0x1d')]();};}function respondWithResult(_0x43d7db,_0x4a638f){_0x4a638f=_0x4a638f||0xc8;return function(_0xc4913){if(_0xc4913){return _0x43d7db[_0x8fa0('0x1c')](_0x4a638f)[_0x8fa0('0x1e')](_0xc4913);}};}function respondWithFilteredResult(_0x3c7af5,_0x5a936f){return function(_0x24502d){if(_0x24502d){var _0x1ef4e0=typeof _0x5a936f[_0x8fa0('0x1f')]===_0x8fa0('0x20')&&typeof _0x5a936f[_0x8fa0('0x21')]===_0x8fa0('0x20');var _0x3550dd=_0x24502d['count'];var _0x4e6e22=_0x1ef4e0?0x0:_0x5a936f[_0x8fa0('0x1f')];var _0x2ec3d7=_0x1ef4e0?_0x24502d['count']:_0x5a936f['offset']+_0x5a936f[_0x8fa0('0x21')];var _0x111107;if(_0x2ec3d7>=_0x3550dd){_0x2ec3d7=_0x3550dd;_0x111107=0xc8;}else{_0x111107=0xce;}_0x3c7af5[_0x8fa0('0x1c')](_0x111107);return _0x3c7af5['set']('Content-Range',_0x4e6e22+'-'+_0x2ec3d7+'/'+_0x3550dd)['json'](_0x24502d);}return null;};}function patchUpdates(_0x3be53b){return function(_0x23e34b){try{jsonpatch['apply'](_0x23e34b,_0x3be53b,!![]);}catch(_0x101a75){return BPromise['reject'](_0x101a75);}return _0x23e34b[_0x8fa0('0x22')]();};}function saveUpdates(_0x30fc90,_0x49b5c7){return function(_0x3b892e){if(_0x3b892e){return _0x3b892e[_0x8fa0('0x23')](_0x30fc90)[_0x8fa0('0x24')](function(_0x518335){return _0x518335;});}return null;};}function removeEntity(_0x1611c1,_0x18e3f4){return function(_0x17b79a){if(_0x17b79a){return _0x17b79a['destroy']()[_0x8fa0('0x24')](function(){_0x1611c1[_0x8fa0('0x1c')](0xcc)[_0x8fa0('0x1d')]();});}};}function handleEntityNotFound(_0x269aed,_0x6c111b){return function(_0x3af6ea){if(!_0x3af6ea){_0x269aed[_0x8fa0('0x1b')](0x194);}return _0x3af6ea;};}function handleError(_0x379df2,_0x196081){_0x196081=_0x196081||0x1f4;return function(_0x3e8115){logger[_0x8fa0('0x25')](_0x3e8115[_0x8fa0('0x26')]);if(_0x3e8115['name']){delete _0x3e8115['name'];}_0x379df2[_0x8fa0('0x1c')](_0x196081)[_0x8fa0('0x27')](_0x3e8115);};}exports[_0x8fa0('0x28')]=function(_0x57ff81,_0x579453){var _0x2b6023={},_0xd890e4={},_0x4eabae={'count':0x0,'rows':[]};var _0x188f91=_[_0x8fa0('0x29')](db[_0x8fa0('0x2a')][_0x8fa0('0x2b')],function(_0x495d8d){return{'name':_0x495d8d[_0x8fa0('0x2c')],'type':_0x495d8d[_0x8fa0('0x2d')][_0x8fa0('0x2e')]};});_0xd890e4[_0x8fa0('0x2f')]=_['map'](_0x188f91,_0x8fa0('0x30'));_0xd890e4[_0x8fa0('0x31')]=_[_0x8fa0('0x32')](_0x57ff81[_0x8fa0('0x31')]);_0xd890e4[_0x8fa0('0x33')]=_[_0x8fa0('0x34')](_0xd890e4[_0x8fa0('0x2f')],_0xd890e4[_0x8fa0('0x31')]);_0x2b6023[_0x8fa0('0x35')]=_[_0x8fa0('0x34')](_0xd890e4['model'],qs[_0x8fa0('0x36')](_0x57ff81[_0x8fa0('0x31')]['fields']));_0x2b6023[_0x8fa0('0x35')]=_0x2b6023[_0x8fa0('0x35')][_0x8fa0('0x37')]?_0x2b6023[_0x8fa0('0x35')]:_0xd890e4[_0x8fa0('0x2f')];if(!_0x57ff81[_0x8fa0('0x31')][_0x8fa0('0x38')](_0x8fa0('0x39'))){_0x2b6023[_0x8fa0('0x21')]=qs[_0x8fa0('0x21')](_0x57ff81[_0x8fa0('0x31')][_0x8fa0('0x21')]);_0x2b6023[_0x8fa0('0x1f')]=qs[_0x8fa0('0x1f')](_0x57ff81[_0x8fa0('0x31')]['offset']);}_0x2b6023[_0x8fa0('0x3a')]=qs['sort'](_0x57ff81['query'][_0x8fa0('0x3b')]);_0x2b6023[_0x8fa0('0x3c')]=qs[_0x8fa0('0x33')](_[_0x8fa0('0x3d')](_0x57ff81[_0x8fa0('0x31')],_0xd890e4[_0x8fa0('0x33')]),_0x188f91);if(_0x57ff81[_0x8fa0('0x31')][_0x8fa0('0x3e')]){_0x2b6023[_0x8fa0('0x3c')]=_[_0x8fa0('0x3f')](_0x2b6023[_0x8fa0('0x3c')],{'$or':_[_0x8fa0('0x29')](_0x188f91,function(_0x51ce2e){if(_0x51ce2e[_0x8fa0('0x2d')]!=='VIRTUAL'){var _0x3ffeea={};_0x3ffeea[_0x51ce2e[_0x8fa0('0x30')]]={'$like':'%'+_0x57ff81['query']['filter']+'%'};return _0x3ffeea;}})});}_0x2b6023=_[_0x8fa0('0x3f')]({},_0x2b6023,_0x57ff81[_0x8fa0('0x40')]);var _0x315a28={'where':_0x2b6023[_0x8fa0('0x3c')]};return db[_0x8fa0('0x2a')][_0x8fa0('0x41')](_0x315a28)['then'](function(_0x5ddf07){_0x4eabae[_0x8fa0('0x41')]=_0x5ddf07;if(_0x57ff81[_0x8fa0('0x31')]['includeAll']){_0x2b6023[_0x8fa0('0x42')]=[{'all':!![]}];}return db['FaxTransferReport']['findAll'](_0x2b6023);})[_0x8fa0('0x24')](function(_0x27129f){_0x4eabae['rows']=_0x27129f;return _0x4eabae;})['then'](respondWithFilteredResult(_0x579453,_0x2b6023))[_0x8fa0('0x43')](handleError(_0x579453,null));};exports[_0x8fa0('0x44')]=function(_0x3d94a8,_0x263960){var _0x431f2e={'raw':!![],'where':{'id':_0x3d94a8[_0x8fa0('0x45')]['id']}},_0x2c0941={};_0x2c0941[_0x8fa0('0x2f')]=_['keys'](db[_0x8fa0('0x2a')][_0x8fa0('0x2b')]);_0x2c0941[_0x8fa0('0x31')]=_[_0x8fa0('0x32')](_0x3d94a8['query']);_0x2c0941['filters']=_[_0x8fa0('0x34')](_0x2c0941['model'],_0x2c0941[_0x8fa0('0x31')]);_0x431f2e['attributes']=_[_0x8fa0('0x34')](_0x2c0941[_0x8fa0('0x2f')],qs['fields'](_0x3d94a8[_0x8fa0('0x31')][_0x8fa0('0x36')]));_0x431f2e[_0x8fa0('0x35')]=_0x431f2e['attributes'][_0x8fa0('0x37')]?_0x431f2e[_0x8fa0('0x35')]:_0x2c0941[_0x8fa0('0x2f')];if(_0x3d94a8[_0x8fa0('0x31')]['includeAll']){_0x431f2e['include']=[{'all':!![]}];}_0x431f2e=_['merge']({},_0x431f2e,_0x3d94a8[_0x8fa0('0x40')]);return db['FaxTransferReport'][_0x8fa0('0x46')](_0x431f2e)[_0x8fa0('0x24')](handleEntityNotFound(_0x263960,null))[_0x8fa0('0x24')](respondWithResult(_0x263960,null))[_0x8fa0('0x43')](handleError(_0x263960,null));};exports[_0x8fa0('0x47')]=function(_0x4480e8,_0x5d325a){return db[_0x8fa0('0x2a')][_0x8fa0('0x47')](_0x4480e8[_0x8fa0('0x48')],{})[_0x8fa0('0x24')](respondWithResult(_0x5d325a,0xc9))['catch'](handleError(_0x5d325a,null));};exports[_0x8fa0('0x23')]=function(_0x37e139,_0x2fb0a1){if(_0x37e139[_0x8fa0('0x48')]['id']){delete _0x37e139[_0x8fa0('0x48')]['id'];}return db[_0x8fa0('0x2a')][_0x8fa0('0x46')]({'where':{'id':_0x37e139[_0x8fa0('0x45')]['id']}})[_0x8fa0('0x24')](handleEntityNotFound(_0x2fb0a1,null))[_0x8fa0('0x24')](saveUpdates(_0x37e139[_0x8fa0('0x48')],null))[_0x8fa0('0x24')](respondWithResult(_0x2fb0a1,null))[_0x8fa0('0x43')](handleError(_0x2fb0a1,null));};exports[_0x8fa0('0x49')]=function(_0x3d3832,_0x48c21f){return db['FaxTransferReport'][_0x8fa0('0x46')]({'where':{'id':_0x3d3832['params']['id']}})[_0x8fa0('0x24')](handleEntityNotFound(_0x48c21f,null))[_0x8fa0('0x24')](removeEntity(_0x48c21f,null))['catch'](handleError(_0x48c21f,null));};exports[_0x8fa0('0x4a')]=function(_0x493583,_0x134c5b){return db[_0x8fa0('0x2a')][_0x8fa0('0x4a')]()[_0x8fa0('0x24')](respondWithResult(_0x134c5b,null))[_0x8fa0('0x43')](handleError(_0x134c5b,null));};
\ No newline at end of file
+var _0x1ced=['status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','FaxTransferReport','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','lodash','squel','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','sendStatus'];(function(_0xc483c0,_0x49432e){var _0x1732e9=function(_0x4aa9df){while(--_0x4aa9df){_0xc483c0['push'](_0xc483c0['shift']());}};_0x1732e9(++_0x49432e);}(_0x1ced,0x75));var _0xd1ce=function(_0x81ac6c,_0x1cf87c){_0x81ac6c=_0x81ac6c-0x0;var _0x442c04=_0x1ced[_0x81ac6c];return _0x442c04;};'use strict';var emlformat=require(_0xd1ce('0x0'));var rimraf=require(_0xd1ce('0x1'));var zipdir=require(_0xd1ce('0x2'));var jsonpatch=require(_0xd1ce('0x3'));var rp=require('request-promise');var moment=require(_0xd1ce('0x4'));var BPromise=require(_0xd1ce('0x5'));var Mustache=require(_0xd1ce('0x6'));var util=require(_0xd1ce('0x7'));var path=require(_0xd1ce('0x8'));var sox=require(_0xd1ce('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd1ce('0xa'));var squel=require(_0xd1ce('0xb'));var crypto=require('crypto');var jsforce=require(_0xd1ce('0xc'));var deskjs=require(_0xd1ce('0xd'));var toCsv=require(_0xd1ce('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd1ce('0xf'));var authService=require(_0xd1ce('0x10'));var qs=require(_0xd1ce('0x11'));var as=require(_0xd1ce('0x12'));var hardwareService=require(_0xd1ce('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xd1ce('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xd1ce('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ba03f,_0xa6ac5b){_0xa6ac5b=_0xa6ac5b||0xcc;return function(_0x478843){if(_0x478843){return _0x1ba03f[_0xd1ce('0x16')](_0xa6ac5b);}return _0x1ba03f[_0xd1ce('0x17')](_0xa6ac5b)[_0xd1ce('0x18')]();};}function respondWithResult(_0x3d7b7f,_0x4e4c2a){_0x4e4c2a=_0x4e4c2a||0xc8;return function(_0x25d0c4){if(_0x25d0c4){return _0x3d7b7f[_0xd1ce('0x17')](_0x4e4c2a)[_0xd1ce('0x19')](_0x25d0c4);}};}function respondWithFilteredResult(_0x7bbf45,_0x358159){return function(_0x7cac4c){if(_0x7cac4c){var _0x4907cd=typeof _0x358159[_0xd1ce('0x1a')]===_0xd1ce('0x1b')&&typeof _0x358159[_0xd1ce('0x1c')]===_0xd1ce('0x1b');var _0x4bd429=_0x7cac4c[_0xd1ce('0x1d')];var _0xc21c45=_0x4907cd?0x0:_0x358159[_0xd1ce('0x1a')];var _0x10a1b3=_0x4907cd?_0x7cac4c[_0xd1ce('0x1d')]:_0x358159['offset']+_0x358159[_0xd1ce('0x1c')];var _0x27c1c6;if(_0x10a1b3>=_0x4bd429){_0x10a1b3=_0x4bd429;_0x27c1c6=0xc8;}else{_0x27c1c6=0xce;}_0x7bbf45[_0xd1ce('0x17')](_0x27c1c6);return _0x7bbf45['set'](_0xd1ce('0x1e'),_0xc21c45+'-'+_0x10a1b3+'/'+_0x4bd429)['json'](_0x7cac4c);}return null;};}function patchUpdates(_0x39f0f6){return function(_0x247c6b){try{jsonpatch[_0xd1ce('0x1f')](_0x247c6b,_0x39f0f6,!![]);}catch(_0x4edeb7){return BPromise[_0xd1ce('0x20')](_0x4edeb7);}return _0x247c6b[_0xd1ce('0x21')]();};}function saveUpdates(_0x4b829e,_0x3b7d21){return function(_0x1a9ed1){if(_0x1a9ed1){return _0x1a9ed1[_0xd1ce('0x22')](_0x4b829e)[_0xd1ce('0x23')](function(_0x2cf79f){return _0x2cf79f;});}return null;};}function removeEntity(_0x5c17bc,_0x1df37d){return function(_0x345b62){if(_0x345b62){return _0x345b62[_0xd1ce('0x24')]()[_0xd1ce('0x23')](function(){_0x5c17bc[_0xd1ce('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb8e69c,_0x21df9b){return function(_0x11d3a7){if(!_0x11d3a7){_0xb8e69c[_0xd1ce('0x16')](0x194);}return _0x11d3a7;};}function handleError(_0x24b1b8,_0x25744b){_0x25744b=_0x25744b||0x1f4;return function(_0x3d0272){logger[_0xd1ce('0x25')](_0x3d0272[_0xd1ce('0x26')]);if(_0x3d0272['name']){delete _0x3d0272[_0xd1ce('0x27')];}_0x24b1b8['status'](_0x25744b)['send'](_0x3d0272);};}exports[_0xd1ce('0x28')]=function(_0x109532,_0x95928e){var _0x4deb19={},_0x41cd2a={},_0x3321c3={'count':0x0,'rows':[]};var _0x3ca28d=_['map'](db[_0xd1ce('0x29')][_0xd1ce('0x2a')],function(_0x4cc88a){return{'name':_0x4cc88a['fieldName'],'type':_0x4cc88a[_0xd1ce('0x2b')][_0xd1ce('0x2c')]};});_0x41cd2a[_0xd1ce('0x2d')]=_[_0xd1ce('0x2e')](_0x3ca28d,_0xd1ce('0x27'));_0x41cd2a[_0xd1ce('0x2f')]=_[_0xd1ce('0x30')](_0x109532[_0xd1ce('0x2f')]);_0x41cd2a[_0xd1ce('0x31')]=_[_0xd1ce('0x32')](_0x41cd2a[_0xd1ce('0x2d')],_0x41cd2a[_0xd1ce('0x2f')]);_0x4deb19[_0xd1ce('0x33')]=_[_0xd1ce('0x32')](_0x41cd2a[_0xd1ce('0x2d')],qs['fields'](_0x109532[_0xd1ce('0x2f')][_0xd1ce('0x34')]));_0x4deb19[_0xd1ce('0x33')]=_0x4deb19['attributes'][_0xd1ce('0x35')]?_0x4deb19[_0xd1ce('0x33')]:_0x41cd2a[_0xd1ce('0x2d')];if(!_0x109532[_0xd1ce('0x2f')]['hasOwnProperty']('nolimit')){_0x4deb19[_0xd1ce('0x1c')]=qs[_0xd1ce('0x1c')](_0x109532[_0xd1ce('0x2f')]['limit']);_0x4deb19[_0xd1ce('0x1a')]=qs[_0xd1ce('0x1a')](_0x109532[_0xd1ce('0x2f')]['offset']);}_0x4deb19['order']=qs[_0xd1ce('0x36')](_0x109532[_0xd1ce('0x2f')][_0xd1ce('0x36')]);_0x4deb19[_0xd1ce('0x37')]=qs['filters'](_[_0xd1ce('0x38')](_0x109532['query'],_0x41cd2a[_0xd1ce('0x31')]),_0x3ca28d);if(_0x109532[_0xd1ce('0x2f')][_0xd1ce('0x39')]){_0x4deb19[_0xd1ce('0x37')]=_[_0xd1ce('0x3a')](_0x4deb19[_0xd1ce('0x37')],{'$or':_[_0xd1ce('0x2e')](_0x3ca28d,function(_0x43933a){if(_0x43933a[_0xd1ce('0x2b')]!=='VIRTUAL'){var _0x730777={};_0x730777[_0x43933a['name']]={'$like':'%'+_0x109532[_0xd1ce('0x2f')][_0xd1ce('0x39')]+'%'};return _0x730777;}})});}_0x4deb19=_['merge']({},_0x4deb19,_0x109532[_0xd1ce('0x3b')]);var _0x20de30={'where':_0x4deb19['where']};return db[_0xd1ce('0x29')][_0xd1ce('0x1d')](_0x20de30)[_0xd1ce('0x23')](function(_0x1f4412){_0x3321c3[_0xd1ce('0x1d')]=_0x1f4412;if(_0x109532[_0xd1ce('0x2f')]['includeAll']){_0x4deb19[_0xd1ce('0x3c')]=[{'all':!![]}];}return db['FaxTransferReport'][_0xd1ce('0x3d')](_0x4deb19);})[_0xd1ce('0x23')](function(_0xce1a70){_0x3321c3[_0xd1ce('0x3e')]=_0xce1a70;return _0x3321c3;})[_0xd1ce('0x23')](respondWithFilteredResult(_0x95928e,_0x4deb19))[_0xd1ce('0x3f')](handleError(_0x95928e,null));};exports[_0xd1ce('0x40')]=function(_0xe8dd31,_0x200613){var _0x112213={'raw':!![],'where':{'id':_0xe8dd31['params']['id']}},_0x88b01a={};_0x88b01a['model']=_['keys'](db[_0xd1ce('0x29')][_0xd1ce('0x2a')]);_0x88b01a[_0xd1ce('0x2f')]=_['keys'](_0xe8dd31[_0xd1ce('0x2f')]);_0x88b01a[_0xd1ce('0x31')]=_['intersection'](_0x88b01a['model'],_0x88b01a['query']);_0x112213['attributes']=_[_0xd1ce('0x32')](_0x88b01a[_0xd1ce('0x2d')],qs[_0xd1ce('0x34')](_0xe8dd31[_0xd1ce('0x2f')][_0xd1ce('0x34')]));_0x112213[_0xd1ce('0x33')]=_0x112213['attributes'][_0xd1ce('0x35')]?_0x112213[_0xd1ce('0x33')]:_0x88b01a[_0xd1ce('0x2d')];if(_0xe8dd31['query'][_0xd1ce('0x41')]){_0x112213[_0xd1ce('0x3c')]=[{'all':!![]}];}_0x112213=_['merge']({},_0x112213,_0xe8dd31[_0xd1ce('0x3b')]);return db[_0xd1ce('0x29')][_0xd1ce('0x42')](_0x112213)['then'](handleEntityNotFound(_0x200613,null))[_0xd1ce('0x23')](respondWithResult(_0x200613,null))['catch'](handleError(_0x200613,null));};exports[_0xd1ce('0x43')]=function(_0x1a06c3,_0x4f37ad){return db[_0xd1ce('0x29')][_0xd1ce('0x43')](_0x1a06c3[_0xd1ce('0x44')],{})[_0xd1ce('0x23')](respondWithResult(_0x4f37ad,0xc9))[_0xd1ce('0x3f')](handleError(_0x4f37ad,null));};exports[_0xd1ce('0x22')]=function(_0x54defa,_0x298431){if(_0x54defa[_0xd1ce('0x44')]['id']){delete _0x54defa[_0xd1ce('0x44')]['id'];}return db[_0xd1ce('0x29')][_0xd1ce('0x42')]({'where':{'id':_0x54defa['params']['id']}})['then'](handleEntityNotFound(_0x298431,null))[_0xd1ce('0x23')](saveUpdates(_0x54defa['body'],null))[_0xd1ce('0x23')](respondWithResult(_0x298431,null))['catch'](handleError(_0x298431,null));};exports[_0xd1ce('0x24')]=function(_0x3437fe,_0x1c3a1f){return db[_0xd1ce('0x29')][_0xd1ce('0x42')]({'where':{'id':_0x3437fe['params']['id']}})['then'](handleEntityNotFound(_0x1c3a1f,null))[_0xd1ce('0x23')](removeEntity(_0x1c3a1f,null))['catch'](handleError(_0x1c3a1f,null));};exports['describe']=function(_0x5c2170,_0x46a56d){return db[_0xd1ce('0x29')][_0xd1ce('0x45')]()[_0xd1ce('0x23')](respondWithResult(_0x46a56d,null))[_0xd1ce('0x3f')](handleError(_0x46a56d,null));};
\ No newline at end of file
index 106f866..80b2d15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6eb9=['FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define'];(function(_0x35d3a8,_0x44406a){var _0x182378=function(_0x298e0b){while(--_0x298e0b){_0x35d3a8['push'](_0x35d3a8['shift']());}};_0x182378(++_0x44406a);}(_0x6eb9,0x1ed));var _0x96eb=function(_0x181e2d,_0x4ccf91){_0x181e2d=_0x181e2d-0x0;var _0x231d54=_0x6eb9[_0x181e2d];return _0x231d54;};'use strict';var _=require(_0x96eb('0x0'));var util=require(_0x96eb('0x1'));var logger=require('../../config/logger')(_0x96eb('0x2'));var moment=require(_0x96eb('0x3'));var BPromise=require('bluebird');var rp=require(_0x96eb('0x4'));var fs=require('fs');var path=require(_0x96eb('0x5'));var rimraf=require(_0x96eb('0x6'));var config=require(_0x96eb('0x7'));var attributes=require(_0x96eb('0x8'));module[_0x96eb('0x9')]=function(_0x320ae0,_0x32842d){return _0x320ae0[_0x96eb('0xa')](_0x96eb('0xb'),attributes,{'tableName':_0x96eb('0xc'),'paranoid':![],'indexes':[{'name':_0x96eb('0xd'),'fields':[_0x96eb('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8546=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','util','../../config/logger','api'];(function(_0x1fcb4b,_0x2c5fdf){var _0x36bba5=function(_0x48159e){while(--_0x48159e){_0x1fcb4b['push'](_0x1fcb4b['shift']());}};_0x36bba5(++_0x2c5fdf);}(_0x8546,0x75));var _0x6854=function(_0x1de11a,_0x44662e){_0x1de11a=_0x1de11a-0x0;var _0x3291e6=_0x8546[_0x1de11a];return _0x3291e6;};'use strict';var _=require('lodash');var util=require(_0x6854('0x0'));var logger=require(_0x6854('0x1'))(_0x6854('0x2'));var moment=require(_0x6854('0x3'));var BPromise=require(_0x6854('0x4'));var rp=require(_0x6854('0x5'));var fs=require('fs');var path=require(_0x6854('0x6'));var rimraf=require(_0x6854('0x7'));var config=require(_0x6854('0x8'));var attributes=require(_0x6854('0x9'));module[_0x6854('0xa')]=function(_0x43765f,_0x38ab8f){return _0x43765f[_0x6854('0xb')](_0x6854('0xc'),attributes,{'tableName':_0x6854('0xd'),'paranoid':![],'indexes':[{'name':_0x6854('0xe'),'fields':[_0x6854('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index 5fc22ea..75b664a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba6b=['http','request','then','info','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxTransferReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0xf79bae,_0x263b2a){var _0x5d2cb7=function(_0x27c86b){while(--_0x27c86b){_0xf79bae['push'](_0xf79bae['shift']());}};_0x5d2cb7(++_0x263b2a);}(_0xba6b,0x19e));var _0xbba6=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xba6b[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require('lodash');var util=require(_0xbba6('0x0'));var moment=require(_0xbba6('0x1'));var BPromise=require(_0xbba6('0x2'));var rs=require(_0xbba6('0x3'));var fs=require('fs');var Redis=require(_0xbba6('0x4'));var db=require(_0xbba6('0x5'))['db'];var utils=require(_0xbba6('0x6'));var logger=require(_0xbba6('0x7'))(_0xbba6('0x8'));var config=require('../../config/environment');var jayson=require(_0xbba6('0x9'));var client=jayson[_0xbba6('0xa')][_0xbba6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b2c9a,_0x2eba3e,_0x5726d7){return new BPromise(function(_0x541548,_0x55c92f){return client[_0xbba6('0xc')](_0x4b2c9a,_0x5726d7)[_0xbba6('0xd')](function(_0x424f9a){logger[_0xbba6('0xe')]('FaxTransferReport,\x20%s,\x20%s',_0x2eba3e,_0xbba6('0xf'));logger[_0xbba6('0x10')](_0xbba6('0x11'),_0x2eba3e,_0xbba6('0xf'),JSON[_0xbba6('0x12')](_0x424f9a));if(_0x424f9a[_0xbba6('0x13')]){if(_0x424f9a['error'][_0xbba6('0x14')]===0x1f4){logger[_0xbba6('0x13')](_0xbba6('0x15'),_0x2eba3e,_0x424f9a[_0xbba6('0x13')]['message']);return _0x55c92f(_0x424f9a[_0xbba6('0x13')]['message']);}logger['error'](_0xbba6('0x15'),_0x2eba3e,_0x424f9a[_0xbba6('0x13')][_0xbba6('0x16')]);return _0x541548(_0x424f9a['error'][_0xbba6('0x16')]);}else{logger[_0xbba6('0xe')]('FaxTransferReport,\x20%s,\x20%s',_0x2eba3e,_0xbba6('0xf'));_0x541548(_0x424f9a[_0xbba6('0x17')][_0xbba6('0x16')]);}})[_0xbba6('0x18')](function(_0x23e5a9){logger[_0xbba6('0x13')]('FaxTransferReport,\x20%s,\x20%s',_0x2eba3e,_0x23e5a9);_0x55c92f(_0x23e5a9);});});}
\ No newline at end of file
+var _0x0363=['client','http','request','info','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','FaxTransferReport,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise'];(function(_0x7778d4,_0x46a3f3){var _0xa90661=function(_0x279cbd){while(--_0x279cbd){_0x7778d4['push'](_0x7778d4['shift']());}};_0xa90661(++_0x46a3f3);}(_0x0363,0x1ef));var _0x3036=function(_0x1e32ec,_0x253bdf){_0x1e32ec=_0x1e32ec-0x0;var _0x1b8295=_0x0363[_0x1e32ec];return _0x1b8295;};'use strict';var _=require('lodash');var util=require(_0x3036('0x0'));var moment=require(_0x3036('0x1'));var BPromise=require(_0x3036('0x2'));var rs=require(_0x3036('0x3'));var fs=require('fs');var Redis=require(_0x3036('0x4'));var db=require(_0x3036('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3036('0x6'));var config=require(_0x3036('0x7'));var jayson=require(_0x3036('0x8'));var client=jayson[_0x3036('0x9')][_0x3036('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d09c0,_0x193ad8,_0x33dda5){return new BPromise(function(_0x20b7ff,_0x180e7c){return client[_0x3036('0xb')](_0x1d09c0,_0x33dda5)['then'](function(_0x580519){logger[_0x3036('0xc')]('FaxTransferReport,\x20%s,\x20%s',_0x193ad8,_0x3036('0xd'));logger[_0x3036('0xe')](_0x3036('0xf'),_0x193ad8,'request\x20sent',JSON[_0x3036('0x10')](_0x580519));if(_0x580519['error']){if(_0x580519[_0x3036('0x11')]['code']===0x1f4){logger[_0x3036('0x11')](_0x3036('0x12'),_0x193ad8,_0x580519['error'][_0x3036('0x13')]);return _0x180e7c(_0x580519[_0x3036('0x11')][_0x3036('0x13')]);}logger[_0x3036('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x193ad8,_0x580519['error'][_0x3036('0x13')]);return _0x20b7ff(_0x580519['error'][_0x3036('0x13')]);}else{logger['info'](_0x3036('0x12'),_0x193ad8,'request\x20sent');_0x20b7ff(_0x580519['result'][_0x3036('0x13')]);}})[_0x3036('0x14')](function(_0x41d03f){logger[_0x3036('0x11')](_0x3036('0x12'),_0x193ad8,_0x41d03f);_0x180e7c(_0x41d03f);});});}
\ No newline at end of file
index 1387384..3d82808 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6fda=['isAuthenticated','create','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','/:id','show','post'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0x6fda,0xfb));var _0xa6fd=function(_0x4fd221,_0x30d3ed){_0x4fd221=_0x4fd221-0x0;var _0x2587b8=_0x6fda[_0x4fd221];return _0x2587b8;};'use strict';var multer=require(_0xa6fd('0x0'));var util=require(_0xa6fd('0x1'));var path=require(_0xa6fd('0x2'));var timeout=require(_0xa6fd('0x3'));var express=require(_0xa6fd('0x4'));var router=express['Router']();var fs_extra=require(_0xa6fd('0x5'));var auth=require(_0xa6fd('0x6'));var interaction=require(_0xa6fd('0x7'));var config=require(_0xa6fd('0x8'));var controller=require('./faxTransferReport.controller');router[_0xa6fd('0x9')]('/',auth['isAuthenticated'](),controller[_0xa6fd('0xa')]);router[_0xa6fd('0x9')](_0xa6fd('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xa6fd('0x9')](_0xa6fd('0xc'),auth['isAuthenticated'](),controller[_0xa6fd('0xd')]);router[_0xa6fd('0xe')]('/',auth[_0xa6fd('0xf')](),controller[_0xa6fd('0x10')]);router['put']('/:id',auth[_0xa6fd('0xf')](),controller['update']);router[_0xa6fd('0x11')]('/:id',auth[_0xa6fd('0xf')](),controller['destroy']);module[_0xa6fd('0x12')]=router;
\ No newline at end of file
+var _0x81d0=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./faxTransferReport.controller','isAuthenticated','get','describe','show','post','create','put','update','delete','/:id','destroy'];(function(_0x30f9d2,_0xac9471){var _0x2ad3a4=function(_0x26393b){while(--_0x26393b){_0x30f9d2['push'](_0x30f9d2['shift']());}};_0x2ad3a4(++_0xac9471);}(_0x81d0,0x72));var _0x081d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x81d0[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x081d('0x0'));var path=require(_0x081d('0x1'));var timeout=require(_0x081d('0x2'));var express=require('express');var router=express[_0x081d('0x3')]();var fs_extra=require(_0x081d('0x4'));var auth=require(_0x081d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x081d('0x6'));var controller=require(_0x081d('0x7'));router['get']('/',auth[_0x081d('0x8')](),controller['index']);router[_0x081d('0x9')]('/describe',auth[_0x081d('0x8')](),controller[_0x081d('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x081d('0xb')]);router[_0x081d('0xc')]('/',auth[_0x081d('0x8')](),controller[_0x081d('0xd')]);router[_0x081d('0xe')]('/:id',auth[_0x081d('0x8')](),controller[_0x081d('0xf')]);router[_0x081d('0x10')](_0x081d('0x11'),auth['isAuthenticated'](),controller[_0x081d('0x12')]);module['exports']=router;
\ No newline at end of file
index d45460d..65f370d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfed8=['index','/:id','show','/:id/configurations','getConfigurations','post','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated'];(function(_0x85a4d9,_0x985697){var _0x72f03a=function(_0x14af35){while(--_0x14af35){_0x85a4d9['push'](_0x85a4d9['shift']());}};_0x72f03a(++_0x985697);}(_0xfed8,0x1ab));var _0x8fed=function(_0x4118b7,_0x134093){_0x4118b7=_0x4118b7-0x0;var _0x322b43=_0xfed8[_0x4118b7];return _0x322b43;};'use strict';var multer=require(_0x8fed('0x0'));var util=require(_0x8fed('0x1'));var path=require(_0x8fed('0x2'));var timeout=require(_0x8fed('0x3'));var express=require(_0x8fed('0x4'));var router=express[_0x8fed('0x5')]();var fs_extra=require(_0x8fed('0x6'));var auth=require(_0x8fed('0x7'));var interaction=require(_0x8fed('0x8'));var config=require(_0x8fed('0x9'));var controller=require(_0x8fed('0xa'));router[_0x8fed('0xb')]('/',auth[_0x8fed('0xc')](),controller[_0x8fed('0xd')]);router[_0x8fed('0xb')](_0x8fed('0xe'),auth[_0x8fed('0xc')](),controller[_0x8fed('0xf')]);router['get'](_0x8fed('0x10'),auth[_0x8fed('0xc')](),controller[_0x8fed('0x11')]);router['get']('/:id/fields',auth[_0x8fed('0xc')](),controller['getFields']);router['post']('/',auth[_0x8fed('0xc')](),controller['create']);router[_0x8fed('0x12')](_0x8fed('0x10'),auth[_0x8fed('0xc')](),controller['addConfiguration']);router[_0x8fed('0x13')](_0x8fed('0xe'),auth['isAuthenticated'](),controller[_0x8fed('0x14')]);router['delete'](_0x8fed('0xe'),auth[_0x8fed('0xc')](),controller[_0x8fed('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0xce05=['get','isAuthenticated','getConfigurations','getFields','post','create','/:id/configurations','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','fs-extra','../../components/interaction/service','../../config/environment','./intDeskAccount.controller'];(function(_0x483b0f,_0x19ea9e){var _0xc4d824=function(_0x894131){while(--_0x894131){_0x483b0f['push'](_0x483b0f['shift']());}};_0xc4d824(++_0x19ea9e);}(_0xce05,0xd6));var _0x5ce0=function(_0x2d3393,_0x299503){_0x2d3393=_0x2d3393-0x0;var _0x55c0db=_0xce05[_0x2d3393];return _0x55c0db;};'use strict';var multer=require(_0x5ce0('0x0'));var util=require(_0x5ce0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x5ce0('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x5ce0('0x3'));var config=require(_0x5ce0('0x4'));var controller=require(_0x5ce0('0x5'));router[_0x5ce0('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5ce0('0x6')]('/:id',auth[_0x5ce0('0x7')](),controller['show']);router[_0x5ce0('0x6')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x5ce0('0x8')]);router[_0x5ce0('0x6')]('/:id/fields',auth['isAuthenticated'](),controller[_0x5ce0('0x9')]);router[_0x5ce0('0xa')]('/',auth[_0x5ce0('0x7')](),controller[_0x5ce0('0xb')]);router[_0x5ce0('0xa')](_0x5ce0('0xc'),auth[_0x5ce0('0x7')](),controller[_0x5ce0('0xd')]);router[_0x5ce0('0xe')](_0x5ce0('0xf'),auth[_0x5ce0('0x7')](),controller[_0x5ce0('0x10')]);router[_0x5ce0('0x11')](_0x5ce0('0xf'),auth[_0x5ce0('0x7')](),controller[_0x5ce0('0x12')]);module[_0x5ce0('0x13')]=router;
\ No newline at end of file
index 6236ff0..1d32127 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4330=['newTab','exports','STRING','basic','integrationTab'];(function(_0x1caf99,_0x9a7868){var _0x49328b=function(_0x5ebc61){while(--_0x5ebc61){_0x1caf99['push'](_0x1caf99['shift']());}};_0x49328b(++_0x9a7868);}(_0x4330,0x15f));var _0x0433=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x4330[_0xae7c2f];return _0x5d7001;};'use strict';var Sequelize=require('sequelize');module[_0x0433('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0433('0x1')]},'username':{'type':Sequelize[_0x0433('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize['ENUM'](_0x0433('0x2')),'defaultValue':_0x0433('0x2')},'password':{'type':Sequelize[_0x0433('0x1')]},'consumerKey':{'type':Sequelize[_0x0433('0x1')]},'consumerSecret':{'type':Sequelize[_0x0433('0x1')]},'token':{'type':Sequelize[_0x0433('0x1')]},'tokenSecret':{'type':Sequelize[_0x0433('0x1')]},'serverUrl':{'type':Sequelize[_0x0433('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0433('0x3'),_0x0433('0x4')),'defaultValue':_0x0433('0x3')}};
\ No newline at end of file
+var _0x24c0=['ENUM','integrationTab','newTab','sequelize','exports','STRING','basic'];(function(_0x22e870,_0x4ecf1f){var _0x2b7acb=function(_0x251348){while(--_0x251348){_0x22e870['push'](_0x22e870['shift']());}};_0x2b7acb(++_0x4ecf1f);}(_0x24c0,0x88));var _0x024c=function(_0x399bb9,_0x3aafa8){_0x399bb9=_0x399bb9-0x0;var _0x2c53be=_0x24c0[_0x399bb9];return _0x2c53be;};'use strict';var Sequelize=require(_0x024c('0x0'));module[_0x024c('0x1')]={'name':{'type':Sequelize[_0x024c('0x2')]},'description':{'type':Sequelize[_0x024c('0x2')]},'username':{'type':Sequelize[_0x024c('0x2')]},'remoteUri':{'type':Sequelize[_0x024c('0x2')]},'authType':{'type':Sequelize['ENUM'](_0x024c('0x3')),'defaultValue':_0x024c('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x024c('0x2')]},'consumerSecret':{'type':Sequelize[_0x024c('0x2')]},'token':{'type':Sequelize[_0x024c('0x2')]},'tokenSecret':{'type':Sequelize[_0x024c('0x2')]},'serverUrl':{'type':Sequelize[_0x024c('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x024c('0x4')](_0x024c('0x5'),_0x024c('0x6')),'defaultValue':_0x024c('0x5')}};
\ No newline at end of file
index 3c9c7ba..30e931b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1949=['sort','where','merge','filter','includeAll','include','findAll','rows','catch','params','rawAttributes','fields','options','find','create','body','destroy','getConfigurations','findOne','DeskConfiguration','pick','AccountId','channel','Descriptions','getDescriptions','Subjects','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','slice','substring','GET','format','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','base64','concat','entries','label','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','name','send','index','map','DeskAccount','fieldName','type','key','query','keys','filters','model','attributes','intersection','length','hasOwnProperty','nolimit','order'];(function(_0x56211a,_0x27b0f2){var _0x56df1c=function(_0x5195ac){while(--_0x5195ac){_0x56211a['push'](_0x56211a['shift']());}};_0x56df1c(++_0x27b0f2);}(_0x1949,0x191));var _0x9194=function(_0x3efe90,_0x5bfeca){_0x3efe90=_0x3efe90-0x0;var _0x4c7286=_0x1949[_0x3efe90];return _0x4c7286;};'use strict';var emlformat=require(_0x9194('0x0'));var rimraf=require(_0x9194('0x1'));var zipdir=require(_0x9194('0x2'));var jsonpatch=require(_0x9194('0x3'));var rp=require(_0x9194('0x4'));var moment=require(_0x9194('0x5'));var BPromise=require(_0x9194('0x6'));var Mustache=require(_0x9194('0x7'));var util=require(_0x9194('0x8'));var path=require(_0x9194('0x9'));var sox=require('sox');var csv=require(_0x9194('0xa'));var ejs=require(_0x9194('0xb'));var fs=require('fs');var fs_extra=require(_0x9194('0xc'));var _=require(_0x9194('0xd'));var squel=require(_0x9194('0xe'));var crypto=require(_0x9194('0xf'));var jsforce=require(_0x9194('0x10'));var deskjs=require(_0x9194('0x11'));var toCsv=require(_0x9194('0xa'));var querystring=require(_0x9194('0x12'));var Papa=require(_0x9194('0x13'));var Redis=require('ioredis');var authService=require(_0x9194('0x14'));var qs=require(_0x9194('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9194('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x9194('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9194('0x18'))['db'];var integrations=require(_0x9194('0x19'));function respondWithStatusCode(_0x1bb1fc,_0x40426e){_0x40426e=_0x40426e||0xcc;return function(_0x4f4056){if(_0x4f4056){return _0x1bb1fc[_0x9194('0x1a')](_0x40426e);}return _0x1bb1fc[_0x9194('0x1b')](_0x40426e)[_0x9194('0x1c')]();};}function respondWithResult(_0x201e69,_0x4ebf16){_0x4ebf16=_0x4ebf16||0xc8;return function(_0x39c190){if(_0x39c190){return _0x201e69[_0x9194('0x1b')](_0x4ebf16)[_0x9194('0x1d')](_0x39c190);}};}function respondWithFilteredResult(_0x934625,_0x19b9cc){return function(_0x4530c3){if(_0x4530c3){var _0x206316=typeof _0x19b9cc[_0x9194('0x1e')]===_0x9194('0x1f')&&typeof _0x19b9cc[_0x9194('0x20')]==='undefined';var _0x38f7b9=_0x4530c3[_0x9194('0x21')];var _0x4b1eff=_0x206316?0x0:_0x19b9cc[_0x9194('0x1e')];var _0x73b99d=_0x206316?_0x4530c3[_0x9194('0x21')]:_0x19b9cc['offset']+_0x19b9cc[_0x9194('0x20')];var _0x53ffc4;if(_0x73b99d>=_0x38f7b9){_0x73b99d=_0x38f7b9;_0x53ffc4=0xc8;}else{_0x53ffc4=0xce;}_0x934625[_0x9194('0x1b')](_0x53ffc4);return _0x934625[_0x9194('0x22')](_0x9194('0x23'),_0x4b1eff+'-'+_0x73b99d+'/'+_0x38f7b9)[_0x9194('0x1d')](_0x4530c3);}return null;};}function patchUpdates(_0x1e6822){return function(_0x1f57cd){try{jsonpatch[_0x9194('0x24')](_0x1f57cd,_0x1e6822,!![]);}catch(_0x484bcd){return BPromise[_0x9194('0x25')](_0x484bcd);}return _0x1f57cd[_0x9194('0x26')]();};}function saveUpdates(_0x308512,_0x1c61a1){return function(_0x2c91c5){if(_0x2c91c5){return _0x2c91c5[_0x9194('0x27')](_0x308512)[_0x9194('0x28')](function(_0x49932a){return _0x49932a;});}return null;};}function removeEntity(_0x44e365,_0x5d4b3d){return function(_0x2db8f0){if(_0x2db8f0){return _0x2db8f0['destroy']()['then'](function(){_0x44e365[_0x9194('0x1b')](0xcc)[_0x9194('0x1c')]();});}};}function handleEntityNotFound(_0x2a2cc7,_0xc6186b){return function(_0x2c9613){if(!_0x2c9613){_0x2a2cc7['sendStatus'](0x194);}return _0x2c9613;};}function handleError(_0x43755c,_0x413206){_0x413206=_0x413206||0x1f4;return function(_0x4390cb){logger['error'](_0x4390cb['stack']);if(_0x4390cb['name']){delete _0x4390cb[_0x9194('0x29')];}_0x43755c['status'](_0x413206)[_0x9194('0x2a')](_0x4390cb);};}exports[_0x9194('0x2b')]=function(_0x536858,_0x3a6d4d){var _0x3c13ac={},_0x59f309={},_0x39dc9c={'count':0x0,'rows':[]};var _0x59f984=_[_0x9194('0x2c')](db[_0x9194('0x2d')]['rawAttributes'],function(_0xfc9b10){return{'name':_0xfc9b10[_0x9194('0x2e')],'type':_0xfc9b10[_0x9194('0x2f')][_0x9194('0x30')]};});_0x59f309['model']=_[_0x9194('0x2c')](_0x59f984,_0x9194('0x29'));_0x59f309[_0x9194('0x31')]=_[_0x9194('0x32')](_0x536858[_0x9194('0x31')]);_0x59f309[_0x9194('0x33')]=_['intersection'](_0x59f309[_0x9194('0x34')],_0x59f309[_0x9194('0x31')]);_0x3c13ac[_0x9194('0x35')]=_[_0x9194('0x36')](_0x59f309['model'],qs['fields'](_0x536858[_0x9194('0x31')]['fields']));_0x3c13ac['attributes']=_0x3c13ac[_0x9194('0x35')][_0x9194('0x37')]?_0x3c13ac[_0x9194('0x35')]:_0x59f309[_0x9194('0x34')];if(!_0x536858[_0x9194('0x31')][_0x9194('0x38')](_0x9194('0x39'))){_0x3c13ac[_0x9194('0x20')]=qs['limit'](_0x536858[_0x9194('0x31')][_0x9194('0x20')]);_0x3c13ac[_0x9194('0x1e')]=qs['offset'](_0x536858[_0x9194('0x31')]['offset']);}_0x3c13ac[_0x9194('0x3a')]=qs[_0x9194('0x3b')](_0x536858[_0x9194('0x31')][_0x9194('0x3b')]);_0x3c13ac['where']=qs[_0x9194('0x33')](_['pick'](_0x536858[_0x9194('0x31')],_0x59f309[_0x9194('0x33')]),_0x59f984);if(_0x536858[_0x9194('0x31')]['filter']){_0x3c13ac[_0x9194('0x3c')]=_[_0x9194('0x3d')](_0x3c13ac['where'],{'$or':_[_0x9194('0x2c')](_0x59f984,function(_0x5e08b2){if(_0x5e08b2[_0x9194('0x2f')]!=='VIRTUAL'){var _0x1a992e={};_0x1a992e[_0x5e08b2[_0x9194('0x29')]]={'$like':'%'+_0x536858['query'][_0x9194('0x3e')]+'%'};return _0x1a992e;}})});}_0x3c13ac=_[_0x9194('0x3d')]({},_0x3c13ac,_0x536858['options']);var _0x1d3925={'where':_0x3c13ac[_0x9194('0x3c')]};return db[_0x9194('0x2d')][_0x9194('0x21')](_0x1d3925)[_0x9194('0x28')](function(_0xb061a1){_0x39dc9c['count']=_0xb061a1;if(_0x536858[_0x9194('0x31')][_0x9194('0x3f')]){_0x3c13ac[_0x9194('0x40')]=[{'all':!![]}];}return db[_0x9194('0x2d')][_0x9194('0x41')](_0x3c13ac);})[_0x9194('0x28')](function(_0x393e16){_0x39dc9c[_0x9194('0x42')]=_0x393e16;return _0x39dc9c;})[_0x9194('0x28')](respondWithFilteredResult(_0x3a6d4d,_0x3c13ac))[_0x9194('0x43')](handleError(_0x3a6d4d,null));};exports['show']=function(_0x200e34,_0x282999){var _0x284386={'raw':![],'where':{'id':_0x200e34[_0x9194('0x44')]['id']}},_0x518a05={};_0x518a05[_0x9194('0x34')]=_['keys'](db[_0x9194('0x2d')][_0x9194('0x45')]);_0x518a05[_0x9194('0x31')]=_[_0x9194('0x32')](_0x200e34[_0x9194('0x31')]);_0x518a05[_0x9194('0x33')]=_[_0x9194('0x36')](_0x518a05['model'],_0x518a05['query']);_0x284386['attributes']=_[_0x9194('0x36')](_0x518a05[_0x9194('0x34')],qs[_0x9194('0x46')](_0x200e34[_0x9194('0x31')][_0x9194('0x46')]));_0x284386[_0x9194('0x35')]=_0x284386[_0x9194('0x35')]['length']?_0x284386[_0x9194('0x35')]:_0x518a05[_0x9194('0x34')];if(_0x200e34[_0x9194('0x31')][_0x9194('0x3f')]){_0x284386['include']=[{'all':!![]}];}_0x284386=_['merge']({},_0x284386,_0x200e34[_0x9194('0x47')]);return db[_0x9194('0x2d')][_0x9194('0x48')](_0x284386)[_0x9194('0x28')](handleEntityNotFound(_0x282999,null))['then'](respondWithResult(_0x282999,null))[_0x9194('0x43')](handleError(_0x282999,null));};exports['create']=function(_0x12fe13,_0x1f7c95){return db[_0x9194('0x2d')][_0x9194('0x49')](_0x12fe13[_0x9194('0x4a')],{})[_0x9194('0x28')](respondWithResult(_0x1f7c95,0xc9))[_0x9194('0x43')](handleError(_0x1f7c95,null));};exports[_0x9194('0x27')]=function(_0x3dfec6,_0x13c6e6){if(_0x3dfec6['body']['id']){delete _0x3dfec6[_0x9194('0x4a')]['id'];}return db[_0x9194('0x2d')][_0x9194('0x48')]({'where':{'id':_0x3dfec6['params']['id']}})[_0x9194('0x28')](handleEntityNotFound(_0x13c6e6,null))[_0x9194('0x28')](saveUpdates(_0x3dfec6[_0x9194('0x4a')],null))[_0x9194('0x28')](respondWithResult(_0x13c6e6,null))[_0x9194('0x43')](handleError(_0x13c6e6,null));};exports[_0x9194('0x4b')]=function(_0x5951eb,_0x151aa0){return db['DeskAccount'][_0x9194('0x48')]({'where':{'id':_0x5951eb[_0x9194('0x44')]['id']}})[_0x9194('0x28')](handleEntityNotFound(_0x151aa0,null))[_0x9194('0x28')](removeEntity(_0x151aa0,null))['catch'](handleError(_0x151aa0,null));};exports[_0x9194('0x4c')]=function(_0x509804,_0x1a4ebe,_0x5df046){var _0x2e52eb={};var _0x5e1566={};var _0xea1784;var _0x258aa4;return db['DeskAccount'][_0x9194('0x4d')]({'where':{'id':_0x509804[_0x9194('0x44')]['id']}})['then'](handleEntityNotFound(_0x1a4ebe,null))[_0x9194('0x28')](function(_0x4a569c){if(_0x4a569c){_0xea1784=_0x4a569c;_0x5e1566[_0x9194('0x34')]=_[_0x9194('0x32')](db[_0x9194('0x4e')][_0x9194('0x45')]);_0x5e1566[_0x9194('0x31')]=_[_0x9194('0x32')](_0x509804[_0x9194('0x31')]);_0x5e1566[_0x9194('0x33')]=_['intersection'](_0x5e1566['model'],_0x5e1566[_0x9194('0x31')]);_0x2e52eb['attributes']=_[_0x9194('0x36')](_0x5e1566[_0x9194('0x34')],qs[_0x9194('0x46')](_0x509804[_0x9194('0x31')][_0x9194('0x46')]));_0x2e52eb[_0x9194('0x35')]=_0x2e52eb[_0x9194('0x35')][_0x9194('0x37')]?_0x2e52eb[_0x9194('0x35')]:_0x5e1566[_0x9194('0x34')];_0x2e52eb[_0x9194('0x3a')]=qs[_0x9194('0x3b')](_0x509804[_0x9194('0x31')][_0x9194('0x3b')]);_0x2e52eb[_0x9194('0x3c')]=qs[_0x9194('0x33')](_[_0x9194('0x4f')](_0x509804[_0x9194('0x31')],_0x5e1566['filters']));if(_0x509804[_0x9194('0x31')][_0x9194('0x3e')]){_0x2e52eb[_0x9194('0x3c')]=_[_0x9194('0x3d')](_0x2e52eb['where'],{'$or':_[_0x9194('0x2c')](_0x2e52eb['attributes'],function(_0x439cb7){var _0x9c8e1f={};_0x9c8e1f[_0x439cb7]={'$like':'%'+_0x509804[_0x9194('0x31')][_0x9194('0x3e')]+'%'};return _0x9c8e1f;})});}_0x2e52eb=_[_0x9194('0x3d')]({},_0x2e52eb,_0x509804[_0x9194('0x47')]);return _0xea1784[_0x9194('0x4c')](_0x2e52eb);}})[_0x9194('0x28')](function(_0x41043d){if(_0x41043d){_0x258aa4=_0x41043d[_0x9194('0x37')];if(!_0x509804[_0x9194('0x31')][_0x9194('0x38')](_0x9194('0x39'))){_0x2e52eb[_0x9194('0x20')]=qs[_0x9194('0x20')](_0x509804['query'][_0x9194('0x20')]);_0x2e52eb[_0x9194('0x1e')]=qs[_0x9194('0x1e')](_0x509804[_0x9194('0x31')][_0x9194('0x1e')]);}return _0xea1784[_0x9194('0x4c')](_0x2e52eb);}})['then'](function(_0x347abe){if(_0x347abe){return _0x347abe?{'count':_0x258aa4,'rows':_0x347abe}:null;}})['then'](respondWithResult(_0x1a4ebe,null))['catch'](handleError(_0x1a4ebe,null));};exports['addConfiguration']=function(_0x5ec085,_0x2f2fc6,_0x2c3265){if(_0x5ec085[_0x9194('0x4a')]['id']){delete _0x5ec085[_0x9194('0x4a')]['id'];}return db['DeskAccount'][_0x9194('0x4d')]({'where':{'id':_0x5ec085['params']['id']}})['then'](handleEntityNotFound(_0x2f2fc6,null))[_0x9194('0x28')](function(_0x335a8b){if(_0x335a8b){_0x5ec085[_0x9194('0x4a')][_0x9194('0x50')]=_0x335a8b['id'];_0x5ec085[_0x9194('0x4a')]['Subjects']=integrations['getSubjects'](_0x5ec085[_0x9194('0x4a')][_0x9194('0x51')],_0x5ec085['body'][_0x9194('0x2f')]);_0x5ec085[_0x9194('0x4a')][_0x9194('0x52')]=integrations[_0x9194('0x53')](_0x5ec085['body'][_0x9194('0x51')],_0x5ec085[_0x9194('0x4a')]['type']);return db[_0x9194('0x4e')]['create'](_0x5ec085[_0x9194('0x4a')],{'include':[{'model':db['DeskField'],'as':_0x9194('0x54')},{'model':db[_0x9194('0x55')],'as':_0x9194('0x52')}]});}return null;})[_0x9194('0x28')](respondWithResult(_0x2f2fc6,null))[_0x9194('0x43')](handleError(_0x2f2fc6,null));};exports[_0x9194('0x56')]=function(_0x48a591,_0x2fd5f4,_0x48f7be){var _0x1144b3=[{'name':_0x9194('0x57'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x26728a='';return db[_0x9194('0x2d')][_0x9194('0x4d')]({'where':{'id':_0x48a591[_0x9194('0x44')]['id']},'attributes':['id',_0x9194('0x58'),_0x9194('0x59'),_0x9194('0x5a'),_0x9194('0x5b'),_0x9194('0x5c'),_0x9194('0x5d'),_0x9194('0x5e'),_0x9194('0x5f')]})['then'](handleEntityNotFound(_0x2fd5f4,null))[_0x9194('0x28')](function(_0x1654a3){if(_0x1654a3){_0x26728a=_0x1654a3[_0x9194('0x58')];var _0x159bb7=_0x26728a[_0x9194('0x60')](-0x1);if(_0x159bb7==='/'){_0x26728a=_0x26728a[_0x9194('0x61')](0x0,_0x26728a['lastIndexOf'](_0x159bb7));}var _0x5ba137={'method':_0x9194('0x62'),'uri':util[_0x9194('0x63')]('%s/custom_fields',_0x26728a),'headers':{'Content-Type':'application/json','Accept':_0x9194('0x64')},'json':!![]};if(_0x1654a3[_0x9194('0x59')]===_0x9194('0x65')){_0x5ba137[_0x9194('0x66')][_0x9194('0x67')]=util[_0x9194('0x63')](_0x9194('0x68'),new Buffer(util[_0x9194('0x63')](_0x9194('0x69'),_0x1654a3[_0x9194('0x5a')],_0x1654a3[_0x9194('0x5b')]))['toString'](_0x9194('0x6a')));}return rp(_0x5ba137)['then'](function(_0x58e69e){return _0x1144b3[_0x9194('0x6b')](_['map'](_0x58e69e['_embedded'][_0x9194('0x6c')],function(_0x5cdb39){return{'id':_0x5cdb39['name'],'name':_0x5cdb39['name'],'type':_0x5cdb39[_0x9194('0x2f')],'active':_0x5cdb39['active'],'label':_0x5cdb39[_0x9194('0x6d')],'custom':!![]};}));});}})['then'](function(_0x4ca588){return{'count':_0x4ca588[_0x9194('0x37')],'rows':_0x4ca588};})[_0x9194('0x28')](respondWithResult(_0x2fd5f4,null))[_0x9194('0x43')](function(_0x16a478){var _0x4c5688=_0x48a591[_0x9194('0x31')]['test']?0x1f4:_0x16a478[_0x9194('0x6e')]||0x1f4;logger[_0x9194('0x6f')](_0x9194('0x70'),'getFields',_0x4c5688,JSON['stringify'](_0x16a478));delete _0x16a478['name'];if(_0x4c5688===0x191){_0x4c5688=0x190;}_0x2fd5f4[_0x9194('0x1b')](_0x4c5688)[_0x9194('0x2a')](_0x48a591[_0x9194('0x31')][_0x9194('0x71')]?{'message':_0x9194('0x72'),'statusCode':_0x16a478[_0x9194('0x6e')]}:_0x16a478);});};
\ No newline at end of file
+var _0xd7ea=['substring','lastIndexOf','format','%s/custom_fields','application/json','basic','headers','Basic\x20%s','%s:%s','password','toString','base64','_embedded','entries','label','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','params','catch','create','body','find','getConfigurations','findOne','DeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','DeskField','getFields','priority','remoteUri','authType','username','consumerKey','token','tokenSecret','slice'];(function(_0x29c2db,_0x32e5ac){var _0x2e27ed=function(_0x330e1e){while(--_0x330e1e){_0x29c2db['push'](_0x29c2db['shift']());}};_0x2e27ed(++_0x32e5ac);}(_0xd7ea,0x86));var _0xad7e=function(_0x1d006a,_0x2812b5){_0x1d006a=_0x1d006a-0x0;var _0x20a76b=_0xd7ea[_0x1d006a];return _0x20a76b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xad7e('0x0'));var zipdir=require(_0xad7e('0x1'));var jsonpatch=require(_0xad7e('0x2'));var rp=require(_0xad7e('0x3'));var moment=require(_0xad7e('0x4'));var BPromise=require(_0xad7e('0x5'));var Mustache=require(_0xad7e('0x6'));var util=require(_0xad7e('0x7'));var path=require(_0xad7e('0x8'));var sox=require(_0xad7e('0x9'));var csv=require(_0xad7e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xad7e('0xb'));var _=require('lodash');var squel=require(_0xad7e('0xc'));var crypto=require('crypto');var jsforce=require(_0xad7e('0xd'));var deskjs=require(_0xad7e('0xe'));var toCsv=require('to-csv');var querystring=require(_0xad7e('0xf'));var Papa=require(_0xad7e('0x10'));var Redis=require('ioredis');var authService=require(_0xad7e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xad7e('0x12'));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(_0xad7e('0x13'));var db=require(_0xad7e('0x14'))['db'];var integrations=require(_0xad7e('0x15'));function respondWithStatusCode(_0x3d6288,_0x3da350){_0x3da350=_0x3da350||0xcc;return function(_0x5e3557){if(_0x5e3557){return _0x3d6288[_0xad7e('0x16')](_0x3da350);}return _0x3d6288[_0xad7e('0x17')](_0x3da350)[_0xad7e('0x18')]();};}function respondWithResult(_0x3717db,_0x184d58){_0x184d58=_0x184d58||0xc8;return function(_0x580a03){if(_0x580a03){return _0x3717db[_0xad7e('0x17')](_0x184d58)['json'](_0x580a03);}};}function respondWithFilteredResult(_0x19b64f,_0x59d85b){return function(_0x22a649){if(_0x22a649){var _0x24c762=typeof _0x59d85b[_0xad7e('0x19')]===_0xad7e('0x1a')&&typeof _0x59d85b['limit']===_0xad7e('0x1a');var _0x3eeb3b=_0x22a649['count'];var _0x3d867a=_0x24c762?0x0:_0x59d85b['offset'];var _0x48d1fe=_0x24c762?_0x22a649[_0xad7e('0x1b')]:_0x59d85b['offset']+_0x59d85b[_0xad7e('0x1c')];var _0x57f8a0;if(_0x48d1fe>=_0x3eeb3b){_0x48d1fe=_0x3eeb3b;_0x57f8a0=0xc8;}else{_0x57f8a0=0xce;}_0x19b64f['status'](_0x57f8a0);return _0x19b64f[_0xad7e('0x1d')]('Content-Range',_0x3d867a+'-'+_0x48d1fe+'/'+_0x3eeb3b)[_0xad7e('0x1e')](_0x22a649);}return null;};}function patchUpdates(_0x1a288f){return function(_0x47e5e4){try{jsonpatch[_0xad7e('0x1f')](_0x47e5e4,_0x1a288f,!![]);}catch(_0x432962){return BPromise[_0xad7e('0x20')](_0x432962);}return _0x47e5e4[_0xad7e('0x21')]();};}function saveUpdates(_0x4ca3ef,_0x19b364){return function(_0x1a764f){if(_0x1a764f){return _0x1a764f[_0xad7e('0x22')](_0x4ca3ef)[_0xad7e('0x23')](function(_0x4b2717){return _0x4b2717;});}return null;};}function removeEntity(_0x36b445,_0x172777){return function(_0x1d96f4){if(_0x1d96f4){return _0x1d96f4[_0xad7e('0x24')]()[_0xad7e('0x23')](function(){_0x36b445[_0xad7e('0x17')](0xcc)[_0xad7e('0x18')]();});}};}function handleEntityNotFound(_0x403b46,_0x23e7fa){return function(_0x6750a3){if(!_0x6750a3){_0x403b46[_0xad7e('0x16')](0x194);}return _0x6750a3;};}function handleError(_0x10a05b,_0x22fb00){_0x22fb00=_0x22fb00||0x1f4;return function(_0x4f8c7b){logger['error'](_0x4f8c7b[_0xad7e('0x25')]);if(_0x4f8c7b['name']){delete _0x4f8c7b[_0xad7e('0x26')];}_0x10a05b[_0xad7e('0x17')](_0x22fb00)[_0xad7e('0x27')](_0x4f8c7b);};}exports[_0xad7e('0x28')]=function(_0x2ebcab,_0x180658){var _0x3b8651={},_0x5af48a={},_0x4f6429={'count':0x0,'rows':[]};var _0x431a3c=_[_0xad7e('0x29')](db[_0xad7e('0x2a')][_0xad7e('0x2b')],function(_0x3550d0){return{'name':_0x3550d0[_0xad7e('0x2c')],'type':_0x3550d0[_0xad7e('0x2d')][_0xad7e('0x2e')]};});_0x5af48a[_0xad7e('0x2f')]=_[_0xad7e('0x29')](_0x431a3c,_0xad7e('0x26'));_0x5af48a[_0xad7e('0x30')]=_[_0xad7e('0x31')](_0x2ebcab['query']);_0x5af48a[_0xad7e('0x32')]=_[_0xad7e('0x33')](_0x5af48a['model'],_0x5af48a[_0xad7e('0x30')]);_0x3b8651[_0xad7e('0x34')]=_[_0xad7e('0x33')](_0x5af48a[_0xad7e('0x2f')],qs[_0xad7e('0x35')](_0x2ebcab['query']['fields']));_0x3b8651[_0xad7e('0x34')]=_0x3b8651[_0xad7e('0x34')][_0xad7e('0x36')]?_0x3b8651[_0xad7e('0x34')]:_0x5af48a[_0xad7e('0x2f')];if(!_0x2ebcab[_0xad7e('0x30')][_0xad7e('0x37')](_0xad7e('0x38'))){_0x3b8651[_0xad7e('0x1c')]=qs[_0xad7e('0x1c')](_0x2ebcab[_0xad7e('0x30')][_0xad7e('0x1c')]);_0x3b8651[_0xad7e('0x19')]=qs['offset'](_0x2ebcab[_0xad7e('0x30')][_0xad7e('0x19')]);}_0x3b8651[_0xad7e('0x39')]=qs[_0xad7e('0x3a')](_0x2ebcab[_0xad7e('0x30')][_0xad7e('0x3a')]);_0x3b8651[_0xad7e('0x3b')]=qs['filters'](_[_0xad7e('0x3c')](_0x2ebcab[_0xad7e('0x30')],_0x5af48a['filters']),_0x431a3c);if(_0x2ebcab[_0xad7e('0x30')]['filter']){_0x3b8651[_0xad7e('0x3b')]=_[_0xad7e('0x3d')](_0x3b8651[_0xad7e('0x3b')],{'$or':_['map'](_0x431a3c,function(_0x42a548){if(_0x42a548[_0xad7e('0x2d')]!==_0xad7e('0x3e')){var _0x1ba87b={};_0x1ba87b[_0x42a548['name']]={'$like':'%'+_0x2ebcab[_0xad7e('0x30')][_0xad7e('0x3f')]+'%'};return _0x1ba87b;}})});}_0x3b8651=_['merge']({},_0x3b8651,_0x2ebcab[_0xad7e('0x40')]);var _0x53264c={'where':_0x3b8651[_0xad7e('0x3b')]};return db[_0xad7e('0x2a')][_0xad7e('0x1b')](_0x53264c)['then'](function(_0x1b7ec6){_0x4f6429[_0xad7e('0x1b')]=_0x1b7ec6;if(_0x2ebcab[_0xad7e('0x30')][_0xad7e('0x41')]){_0x3b8651['include']=[{'all':!![]}];}return db['DeskAccount'][_0xad7e('0x42')](_0x3b8651);})[_0xad7e('0x23')](function(_0x1926d4){_0x4f6429[_0xad7e('0x43')]=_0x1926d4;return _0x4f6429;})[_0xad7e('0x23')](respondWithFilteredResult(_0x180658,_0x3b8651))['catch'](handleError(_0x180658,null));};exports['show']=function(_0x4d015b,_0x5d0c71){var _0x11353a={'raw':![],'where':{'id':_0x4d015b[_0xad7e('0x44')]['id']}},_0x1bd891={};_0x1bd891[_0xad7e('0x2f')]=_[_0xad7e('0x31')](db[_0xad7e('0x2a')][_0xad7e('0x2b')]);_0x1bd891['query']=_[_0xad7e('0x31')](_0x4d015b[_0xad7e('0x30')]);_0x1bd891[_0xad7e('0x32')]=_[_0xad7e('0x33')](_0x1bd891['model'],_0x1bd891[_0xad7e('0x30')]);_0x11353a[_0xad7e('0x34')]=_['intersection'](_0x1bd891[_0xad7e('0x2f')],qs[_0xad7e('0x35')](_0x4d015b[_0xad7e('0x30')][_0xad7e('0x35')]));_0x11353a[_0xad7e('0x34')]=_0x11353a[_0xad7e('0x34')][_0xad7e('0x36')]?_0x11353a[_0xad7e('0x34')]:_0x1bd891[_0xad7e('0x2f')];if(_0x4d015b[_0xad7e('0x30')][_0xad7e('0x41')]){_0x11353a['include']=[{'all':!![]}];}_0x11353a=_[_0xad7e('0x3d')]({},_0x11353a,_0x4d015b[_0xad7e('0x40')]);return db[_0xad7e('0x2a')]['find'](_0x11353a)[_0xad7e('0x23')](handleEntityNotFound(_0x5d0c71,null))[_0xad7e('0x23')](respondWithResult(_0x5d0c71,null))[_0xad7e('0x45')](handleError(_0x5d0c71,null));};exports[_0xad7e('0x46')]=function(_0x3b565a,_0x5cba65){return db[_0xad7e('0x2a')][_0xad7e('0x46')](_0x3b565a['body'],{})[_0xad7e('0x23')](respondWithResult(_0x5cba65,0xc9))[_0xad7e('0x45')](handleError(_0x5cba65,null));};exports[_0xad7e('0x22')]=function(_0x12cd9f,_0x3ceb80){if(_0x12cd9f[_0xad7e('0x47')]['id']){delete _0x12cd9f['body']['id'];}return db[_0xad7e('0x2a')]['find']({'where':{'id':_0x12cd9f[_0xad7e('0x44')]['id']}})[_0xad7e('0x23')](handleEntityNotFound(_0x3ceb80,null))[_0xad7e('0x23')](saveUpdates(_0x12cd9f[_0xad7e('0x47')],null))[_0xad7e('0x23')](respondWithResult(_0x3ceb80,null))[_0xad7e('0x45')](handleError(_0x3ceb80,null));};exports[_0xad7e('0x24')]=function(_0x54ac61,_0x42f7f3){return db['DeskAccount'][_0xad7e('0x48')]({'where':{'id':_0x54ac61[_0xad7e('0x44')]['id']}})[_0xad7e('0x23')](handleEntityNotFound(_0x42f7f3,null))[_0xad7e('0x23')](removeEntity(_0x42f7f3,null))['catch'](handleError(_0x42f7f3,null));};exports[_0xad7e('0x49')]=function(_0x3a67ed,_0x36b08d,_0x5d9e70){var _0x740bd0={};var _0x47821b={};var _0x5a4d1d;var _0x328ef4;return db['DeskAccount'][_0xad7e('0x4a')]({'where':{'id':_0x3a67ed[_0xad7e('0x44')]['id']}})[_0xad7e('0x23')](handleEntityNotFound(_0x36b08d,null))[_0xad7e('0x23')](function(_0x3080e4){if(_0x3080e4){_0x5a4d1d=_0x3080e4;_0x47821b[_0xad7e('0x2f')]=_[_0xad7e('0x31')](db[_0xad7e('0x4b')]['rawAttributes']);_0x47821b[_0xad7e('0x30')]=_[_0xad7e('0x31')](_0x3a67ed[_0xad7e('0x30')]);_0x47821b[_0xad7e('0x32')]=_['intersection'](_0x47821b[_0xad7e('0x2f')],_0x47821b[_0xad7e('0x30')]);_0x740bd0[_0xad7e('0x34')]=_['intersection'](_0x47821b[_0xad7e('0x2f')],qs['fields'](_0x3a67ed[_0xad7e('0x30')][_0xad7e('0x35')]));_0x740bd0['attributes']=_0x740bd0[_0xad7e('0x34')][_0xad7e('0x36')]?_0x740bd0['attributes']:_0x47821b[_0xad7e('0x2f')];_0x740bd0[_0xad7e('0x39')]=qs[_0xad7e('0x3a')](_0x3a67ed[_0xad7e('0x30')]['sort']);_0x740bd0[_0xad7e('0x3b')]=qs[_0xad7e('0x32')](_[_0xad7e('0x3c')](_0x3a67ed[_0xad7e('0x30')],_0x47821b[_0xad7e('0x32')]));if(_0x3a67ed[_0xad7e('0x30')][_0xad7e('0x3f')]){_0x740bd0['where']=_[_0xad7e('0x3d')](_0x740bd0[_0xad7e('0x3b')],{'$or':_[_0xad7e('0x29')](_0x740bd0[_0xad7e('0x34')],function(_0x1dac34){var _0x332d2d={};_0x332d2d[_0x1dac34]={'$like':'%'+_0x3a67ed[_0xad7e('0x30')]['filter']+'%'};return _0x332d2d;})});}_0x740bd0=_[_0xad7e('0x3d')]({},_0x740bd0,_0x3a67ed[_0xad7e('0x40')]);return _0x5a4d1d[_0xad7e('0x49')](_0x740bd0);}})[_0xad7e('0x23')](function(_0x51a87e){if(_0x51a87e){_0x328ef4=_0x51a87e[_0xad7e('0x36')];if(!_0x3a67ed[_0xad7e('0x30')][_0xad7e('0x37')](_0xad7e('0x38'))){_0x740bd0[_0xad7e('0x1c')]=qs['limit'](_0x3a67ed['query'][_0xad7e('0x1c')]);_0x740bd0['offset']=qs['offset'](_0x3a67ed[_0xad7e('0x30')]['offset']);}return _0x5a4d1d[_0xad7e('0x49')](_0x740bd0);}})[_0xad7e('0x23')](function(_0x3299c7){if(_0x3299c7){return _0x3299c7?{'count':_0x328ef4,'rows':_0x3299c7}:null;}})[_0xad7e('0x23')](respondWithResult(_0x36b08d,null))[_0xad7e('0x45')](handleError(_0x36b08d,null));};exports[_0xad7e('0x4c')]=function(_0xe54a88,_0x2898ac,_0x389e9d){if(_0xe54a88['body']['id']){delete _0xe54a88[_0xad7e('0x47')]['id'];}return db[_0xad7e('0x2a')][_0xad7e('0x4a')]({'where':{'id':_0xe54a88[_0xad7e('0x44')]['id']}})[_0xad7e('0x23')](handleEntityNotFound(_0x2898ac,null))[_0xad7e('0x23')](function(_0x30681a){if(_0x30681a){_0xe54a88['body'][_0xad7e('0x4d')]=_0x30681a['id'];_0xe54a88[_0xad7e('0x47')][_0xad7e('0x4e')]=integrations[_0xad7e('0x4f')](_0xe54a88[_0xad7e('0x47')][_0xad7e('0x50')],_0xe54a88[_0xad7e('0x47')][_0xad7e('0x2d')]);_0xe54a88[_0xad7e('0x47')][_0xad7e('0x51')]=integrations['getDescriptions'](_0xe54a88[_0xad7e('0x47')][_0xad7e('0x50')],_0xe54a88[_0xad7e('0x47')][_0xad7e('0x2d')]);return db[_0xad7e('0x4b')][_0xad7e('0x46')](_0xe54a88[_0xad7e('0x47')],{'include':[{'model':db[_0xad7e('0x52')],'as':_0xad7e('0x4e')},{'model':db[_0xad7e('0x52')],'as':_0xad7e('0x51')}]});}return null;})[_0xad7e('0x23')](respondWithResult(_0x2898ac,null))[_0xad7e('0x45')](handleError(_0x2898ac,null));};exports[_0xad7e('0x53')]=function(_0x13fafa,_0x388ea9,_0x2213cb){var _0x44f87f=[{'name':_0xad7e('0x54'),'label':_0xad7e('0x54'),'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 _0x1843c2='';return db[_0xad7e('0x2a')][_0xad7e('0x4a')]({'where':{'id':_0x13fafa[_0xad7e('0x44')]['id']},'attributes':['id',_0xad7e('0x55'),_0xad7e('0x56'),_0xad7e('0x57'),'password',_0xad7e('0x58'),'consumerSecret',_0xad7e('0x59'),_0xad7e('0x5a')]})['then'](handleEntityNotFound(_0x388ea9,null))[_0xad7e('0x23')](function(_0x36ab01){if(_0x36ab01){_0x1843c2=_0x36ab01[_0xad7e('0x55')];var _0x4344e9=_0x1843c2[_0xad7e('0x5b')](-0x1);if(_0x4344e9==='/'){_0x1843c2=_0x1843c2[_0xad7e('0x5c')](0x0,_0x1843c2[_0xad7e('0x5d')](_0x4344e9));}var _0x220f98={'method':'GET','uri':util[_0xad7e('0x5e')](_0xad7e('0x5f'),_0x1843c2),'headers':{'Content-Type':_0xad7e('0x60'),'Accept':'application/json'},'json':!![]};if(_0x36ab01[_0xad7e('0x56')]===_0xad7e('0x61')){_0x220f98[_0xad7e('0x62')]['Authorization']=util[_0xad7e('0x5e')](_0xad7e('0x63'),new Buffer(util['format'](_0xad7e('0x64'),_0x36ab01[_0xad7e('0x57')],_0x36ab01[_0xad7e('0x65')]))[_0xad7e('0x66')](_0xad7e('0x67')));}return rp(_0x220f98)['then'](function(_0x549f08){return _0x44f87f['concat'](_[_0xad7e('0x29')](_0x549f08[_0xad7e('0x68')][_0xad7e('0x69')],function(_0x8ad075){return{'id':_0x8ad075[_0xad7e('0x26')],'name':_0x8ad075[_0xad7e('0x26')],'type':_0x8ad075[_0xad7e('0x2d')],'active':_0x8ad075['active'],'label':_0x8ad075[_0xad7e('0x6a')],'custom':!![]};}));});}})[_0xad7e('0x23')](function(_0x68f42e){return{'count':_0x68f42e[_0xad7e('0x36')],'rows':_0x68f42e};})[_0xad7e('0x23')](respondWithResult(_0x388ea9,null))[_0xad7e('0x45')](function(_0x47c0e9){var _0x228a5a=_0x13fafa['query'][_0xad7e('0x6b')]?0x1f4:_0x47c0e9[_0xad7e('0x6c')]||0x1f4;logger[_0xad7e('0x6d')](_0xad7e('0x6e'),'getFields',_0x228a5a,JSON[_0xad7e('0x6f')](_0x47c0e9));delete _0x47c0e9[_0xad7e('0x26')];if(_0x228a5a===0x191){_0x228a5a=0x190;}_0x388ea9[_0xad7e('0x17')](_0x228a5a)[_0xad7e('0x27')](_0x13fafa[_0xad7e('0x30')]['test']?{'message':_0xad7e('0x70'),'statusCode':_0x47c0e9[_0xad7e('0x6c')]}:_0x47c0e9);});};
\ No newline at end of file
index 8030953..a0126d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x52aa=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','DeskAccount','int_desk_accounts','lodash'];(function(_0x3da23e,_0x33a629){var _0x4d6be2=function(_0x4afd67){while(--_0x4afd67){_0x3da23e['push'](_0x3da23e['shift']());}};_0x4d6be2(++_0x33a629);}(_0x52aa,0x107));var _0xa52a=function(_0x4aa600,_0x43f6af){_0x4aa600=_0x4aa600-0x0;var _0x4cc78f=_0x52aa[_0x4aa600];return _0x4cc78f;};'use strict';var _=require(_0xa52a('0x0'));var util=require(_0xa52a('0x1'));var logger=require(_0xa52a('0x2'))('api');var moment=require(_0xa52a('0x3'));var BPromise=require('bluebird');var rp=require(_0xa52a('0x4'));var fs=require('fs');var path=require(_0xa52a('0x5'));var rimraf=require(_0xa52a('0x6'));var config=require(_0xa52a('0x7'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0xa52a('0x8'));module[_0xa52a('0x9')]=function(_0x39b6bd,_0x38c252){return _0x39b6bd['define'](_0xa52a('0xa'),attributes,{'tableName':_0xa52a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0f9d=['api','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0x0f9d,0x1e7));var _0xd0f9=function(_0x3d5df9,_0x5b3623){_0x3d5df9=_0x3d5df9-0x0;var _0x50ba39=_0x0f9d[_0x3d5df9];return _0x50ba39;};'use strict';var _=require(_0xd0f9('0x0'));var util=require(_0xd0f9('0x1'));var logger=require(_0xd0f9('0x2'))(_0xd0f9('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd0f9('0x4'));var fs=require('fs');var path=require(_0xd0f9('0x5'));var rimraf=require(_0xd0f9('0x6'));var config=require(_0xd0f9('0x7'));var attributes=require(_0xd0f9('0x8'));var integrations=require(_0xd0f9('0x9'));module[_0xd0f9('0xa')]=function(_0x37ea2f,_0x3fc082){return _0x37ea2f[_0xd0f9('0xb')](_0xd0f9('0xc'),attributes,{'tableName':_0xd0f9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1a4d885..dec9dc4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2985=['error','code','message','result','catch','DeskAccount','findAll','options','raw','where','include','map','model','attributes','GetDeskAccount','debug','ShowDeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4485bc,_0x166040){var _0x53bd26=function(_0x2d8805){while(--_0x2d8805){_0x4485bc['push'](_0x4485bc['shift']());}};_0x53bd26(++_0x166040);}(_0x2985,0x10e));var _0x5298=function(_0x4b94e3,_0xb3692a){_0x4b94e3=_0x4b94e3-0x0;var _0x3b59d8=_0x2985[_0x4b94e3];return _0x3b59d8;};'use strict';var _=require(_0x5298('0x0'));var util=require(_0x5298('0x1'));var moment=require(_0x5298('0x2'));var BPromise=require(_0x5298('0x3'));var rs=require(_0x5298('0x4'));var fs=require('fs');var Redis=require(_0x5298('0x5'));var db=require(_0x5298('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5298('0x7'))(_0x5298('0x8'));var config=require(_0x5298('0x9'));var jayson=require(_0x5298('0xa'));var client=jayson[_0x5298('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x418d3c,_0x44bad1,_0x52fcb9){return new BPromise(function(_0x551de9,_0x238d2e){return client['request'](_0x418d3c,_0x52fcb9)[_0x5298('0xc')](function(_0x4b7606){logger[_0x5298('0xd')](_0x5298('0xe'),_0x44bad1,_0x5298('0xf'));logger['debug'](_0x5298('0x10'),_0x44bad1,'request\x20sent',JSON[_0x5298('0x11')](_0x4b7606));if(_0x4b7606['error']){if(_0x4b7606[_0x5298('0x12')][_0x5298('0x13')]===0x1f4){logger[_0x5298('0x12')](_0x5298('0xe'),_0x44bad1,_0x4b7606[_0x5298('0x12')]['message']);return _0x238d2e(_0x4b7606[_0x5298('0x12')][_0x5298('0x14')]);}logger[_0x5298('0x12')]('DeskAccount,\x20%s,\x20%s',_0x44bad1,_0x4b7606[_0x5298('0x12')][_0x5298('0x14')]);return _0x551de9(_0x4b7606[_0x5298('0x12')]['message']);}else{logger[_0x5298('0xd')](_0x5298('0xe'),_0x44bad1,'request\x20sent');_0x551de9(_0x4b7606[_0x5298('0x15')][_0x5298('0x14')]);}})[_0x5298('0x16')](function(_0x4df082){logger[_0x5298('0x12')](_0x5298('0xe'),_0x44bad1,_0x4df082);_0x238d2e(_0x4df082);});});}exports['GetDeskAccount']=function(_0x3944f1){var _0x8e4aab=this;return new Promise(function(_0x1bff11,_0x151415){return db[_0x5298('0x17')][_0x5298('0x18')]({'raw':_0x3944f1[_0x5298('0x19')]?_0x3944f1[_0x5298('0x19')][_0x5298('0x1a')]===undefined?!![]:![]:!![],'where':_0x3944f1[_0x5298('0x19')]?_0x3944f1[_0x5298('0x19')][_0x5298('0x1b')]||null:null,'attributes':_0x3944f1[_0x5298('0x19')]?_0x3944f1[_0x5298('0x19')]['attributes']||null:null,'limit':_0x3944f1[_0x5298('0x19')]?_0x3944f1[_0x5298('0x19')]['limit']||null:null,'include':_0x3944f1[_0x5298('0x19')]?_0x3944f1[_0x5298('0x19')][_0x5298('0x1c')]?_[_0x5298('0x1d')](_0x3944f1['options'][_0x5298('0x1c')],function(_0x40f3d6){return{'model':db[_0x40f3d6[_0x5298('0x1e')]],'as':_0x40f3d6['as'],'attributes':_0x40f3d6[_0x5298('0x1f')],'include':_0x40f3d6['include']?_[_0x5298('0x1d')](_0x40f3d6['include'],function(_0x5a2b83){return{'model':db[_0x5a2b83['model']],'as':_0x5a2b83['as'],'attributes':_0x5a2b83[_0x5298('0x1f')],'include':_0x5a2b83[_0x5298('0x1c')]?_[_0x5298('0x1d')](_0x5a2b83['include'],function(_0x2417df){return{'model':db[_0x2417df[_0x5298('0x1e')]],'as':_0x2417df['as'],'attributes':_0x2417df[_0x5298('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x27b265){logger[_0x5298('0xd')](_0x5298('0x20'),_0x3944f1);logger[_0x5298('0x21')](_0x5298('0x20'),_0x3944f1,JSON[_0x5298('0x11')](_0x27b265));_0x1bff11(_0x27b265);})[_0x5298('0x16')](function(_0x38ff26){logger['error'](_0x5298('0x20'),_0x38ff26[_0x5298('0x14')],_0x3944f1);_0x151415(_0x8e4aab[_0x5298('0x12')](0x1f4,_0x38ff26[_0x5298('0x14')]));});});};exports[_0x5298('0x22')]=function(_0x198b50){var _0x56a0ed=this;return new Promise(function(_0x17bd8f,_0x58a141){return db['DeskAccount'][_0x5298('0x23')]({'raw':_0x198b50[_0x5298('0x19')]?_0x198b50[_0x5298('0x19')][_0x5298('0x1a')]===undefined?!![]:![]:!![],'where':_0x198b50[_0x5298('0x19')]?_0x198b50[_0x5298('0x19')][_0x5298('0x1b')]||null:null,'attributes':_0x198b50[_0x5298('0x19')]?_0x198b50[_0x5298('0x19')]['attributes']||null:null,'include':_0x198b50[_0x5298('0x19')]?_0x198b50[_0x5298('0x19')][_0x5298('0x1c')]?_[_0x5298('0x1d')](_0x198b50[_0x5298('0x19')][_0x5298('0x1c')],function(_0x20a33f){return{'model':db[_0x20a33f['model']],'as':_0x20a33f['as'],'attributes':_0x20a33f[_0x5298('0x1f')],'include':_0x20a33f[_0x5298('0x1c')]?_['map'](_0x20a33f[_0x5298('0x1c')],function(_0x58c979){return{'model':db[_0x58c979['model']],'as':_0x58c979['as'],'attributes':_0x58c979['attributes'],'include':_0x58c979[_0x5298('0x1c')]?_[_0x5298('0x1d')](_0x58c979[_0x5298('0x1c')],function(_0xde8cba){return{'model':db[_0xde8cba['model']],'as':_0xde8cba['as'],'attributes':_0xde8cba[_0x5298('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5298('0xc')](function(_0x46b6f1){logger[_0x5298('0xd')](_0x5298('0x22'),_0x198b50);logger[_0x5298('0x21')](_0x5298('0x22'),_0x198b50,JSON[_0x5298('0x11')](_0x46b6f1));_0x17bd8f(_0x46b6f1);})[_0x5298('0x16')](function(_0x366245){logger[_0x5298('0x12')](_0x5298('0x22'),_0x366245['message'],_0x198b50);_0x58a141(_0x56a0ed[_0x5298('0x12')](0x1f4,_0x366245[_0x5298('0x14')]));});});};
\ No newline at end of file
+var _0x35e6=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','DeskAccount','findAll','options','where','attributes','limit','include','map','model','GetDeskAccount','ShowDeskAccount','find','lodash','util','moment'];(function(_0x26108,_0xe06e0e){var _0xf7dab1=function(_0x5d9ad8){while(--_0x5d9ad8){_0x26108['push'](_0x26108['shift']());}};_0xf7dab1(++_0xe06e0e);}(_0x35e6,0x81));var _0x635e=function(_0x24a88e,_0x22a0b8){_0x24a88e=_0x24a88e-0x0;var _0x232cbb=_0x35e6[_0x24a88e];return _0x232cbb;};'use strict';var _=require(_0x635e('0x0'));var util=require(_0x635e('0x1'));var moment=require(_0x635e('0x2'));var BPromise=require(_0x635e('0x3'));var rs=require(_0x635e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x635e('0x5'))['db'];var utils=require(_0x635e('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x635e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x635e('0x8')][_0x635e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e06b7,_0x45ba56,_0x280c18){return new BPromise(function(_0x9deaed,_0x3bd1ec){return client[_0x635e('0xa')](_0x4e06b7,_0x280c18)[_0x635e('0xb')](function(_0x53e2d7){logger['info'](_0x635e('0xc'),_0x45ba56,_0x635e('0xd'));logger[_0x635e('0xe')](_0x635e('0xf'),_0x45ba56,'request\x20sent',JSON[_0x635e('0x10')](_0x53e2d7));if(_0x53e2d7[_0x635e('0x11')]){if(_0x53e2d7[_0x635e('0x11')]['code']===0x1f4){logger['error'](_0x635e('0xc'),_0x45ba56,_0x53e2d7[_0x635e('0x11')][_0x635e('0x12')]);return _0x3bd1ec(_0x53e2d7[_0x635e('0x11')][_0x635e('0x12')]);}logger[_0x635e('0x11')](_0x635e('0xc'),_0x45ba56,_0x53e2d7['error'][_0x635e('0x12')]);return _0x9deaed(_0x53e2d7[_0x635e('0x11')][_0x635e('0x12')]);}else{logger[_0x635e('0x13')](_0x635e('0xc'),_0x45ba56,'request\x20sent');_0x9deaed(_0x53e2d7['result'][_0x635e('0x12')]);}})[_0x635e('0x14')](function(_0x671818){logger['error'](_0x635e('0xc'),_0x45ba56,_0x671818);_0x3bd1ec(_0x671818);});});}exports['GetDeskAccount']=function(_0x2167bf){var _0x259d83=this;return new Promise(function(_0x59e8ac,_0x3450d4){return db[_0x635e('0x15')][_0x635e('0x16')]({'raw':_0x2167bf[_0x635e('0x17')]?_0x2167bf[_0x635e('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2167bf['options']?_0x2167bf[_0x635e('0x17')][_0x635e('0x18')]||null:null,'attributes':_0x2167bf['options']?_0x2167bf['options'][_0x635e('0x19')]||null:null,'limit':_0x2167bf[_0x635e('0x17')]?_0x2167bf[_0x635e('0x17')][_0x635e('0x1a')]||null:null,'include':_0x2167bf[_0x635e('0x17')]?_0x2167bf['options'][_0x635e('0x1b')]?_[_0x635e('0x1c')](_0x2167bf['options'][_0x635e('0x1b')],function(_0x8643c5){return{'model':db[_0x8643c5['model']],'as':_0x8643c5['as'],'attributes':_0x8643c5[_0x635e('0x19')],'include':_0x8643c5[_0x635e('0x1b')]?_[_0x635e('0x1c')](_0x8643c5[_0x635e('0x1b')],function(_0x57cb51){return{'model':db[_0x57cb51[_0x635e('0x1d')]],'as':_0x57cb51['as'],'attributes':_0x57cb51[_0x635e('0x19')],'include':_0x57cb51[_0x635e('0x1b')]?_[_0x635e('0x1c')](_0x57cb51[_0x635e('0x1b')],function(_0x551502){return{'model':db[_0x551502['model']],'as':_0x551502['as'],'attributes':_0x551502[_0x635e('0x19')]};}):[]};}):[]};}):[]:[]})[_0x635e('0xb')](function(_0x2df6af){logger[_0x635e('0x13')]('GetDeskAccount',_0x2167bf);logger[_0x635e('0xe')](_0x635e('0x1e'),_0x2167bf,JSON[_0x635e('0x10')](_0x2df6af));_0x59e8ac(_0x2df6af);})['catch'](function(_0x13cee6){logger['error'](_0x635e('0x1e'),_0x13cee6[_0x635e('0x12')],_0x2167bf);_0x3450d4(_0x259d83[_0x635e('0x11')](0x1f4,_0x13cee6[_0x635e('0x12')]));});});};exports[_0x635e('0x1f')]=function(_0x44e678){var _0x469e6e=this;return new Promise(function(_0x51846f,_0x28e292){return db[_0x635e('0x15')][_0x635e('0x20')]({'raw':_0x44e678[_0x635e('0x17')]?_0x44e678['options']['raw']===undefined?!![]:![]:!![],'where':_0x44e678['options']?_0x44e678[_0x635e('0x17')][_0x635e('0x18')]||null:null,'attributes':_0x44e678[_0x635e('0x17')]?_0x44e678[_0x635e('0x17')][_0x635e('0x19')]||null:null,'include':_0x44e678[_0x635e('0x17')]?_0x44e678['options']['include']?_[_0x635e('0x1c')](_0x44e678['options'][_0x635e('0x1b')],function(_0x47f9df){return{'model':db[_0x47f9df[_0x635e('0x1d')]],'as':_0x47f9df['as'],'attributes':_0x47f9df[_0x635e('0x19')],'include':_0x47f9df[_0x635e('0x1b')]?_['map'](_0x47f9df[_0x635e('0x1b')],function(_0x4eacde){return{'model':db[_0x4eacde[_0x635e('0x1d')]],'as':_0x4eacde['as'],'attributes':_0x4eacde[_0x635e('0x19')],'include':_0x4eacde[_0x635e('0x1b')]?_[_0x635e('0x1c')](_0x4eacde['include'],function(_0x318a7a){return{'model':db[_0x318a7a[_0x635e('0x1d')]],'as':_0x318a7a['as'],'attributes':_0x318a7a['attributes']};}):[]};}):[]};}):[]:[]})[_0x635e('0xb')](function(_0x2a5634){logger[_0x635e('0x13')](_0x635e('0x1f'),_0x44e678);logger[_0x635e('0xe')](_0x635e('0x1f'),_0x44e678,JSON[_0x635e('0x10')](_0x2a5634));_0x51846f(_0x2a5634);})[_0x635e('0x14')](function(_0x264248){logger[_0x635e('0x11')](_0x635e('0x1f'),_0x264248[_0x635e('0x12')],_0x44e678);_0x28e292(_0x469e6e[_0x635e('0x11')](0x1f4,_0x264248[_0x635e('0x12')]));});});};
\ No newline at end of file
index 27a2579..67dd3ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x1d8d6f,_0xf1519f){var _0x3c1ef2=function(_0xe92bfd){while(--_0xe92bfd){_0x1d8d6f['push'](_0x1d8d6f['shift']());}};_0x3c1ef2(++_0xf1519f);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/fields',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/descriptions',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller['destroy']);module[_0x7995('0x1a')]=router;
\ No newline at end of file
+var _0x3e74=['show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','getTags','post','/:id/tags','setTags','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x422569,_0xbf158a){var _0x34f785=function(_0x5df30a){while(--_0x5df30a){_0x422569['push'](_0x422569['shift']());}};_0x34f785(++_0xbf158a);}(_0x3e74,0x175));var _0x43e7=function(_0x42c4dd,_0x50a644){_0x42c4dd=_0x42c4dd-0x0;var _0x1d75f0=_0x3e74[_0x42c4dd];return _0x1d75f0;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/subjects',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/tags',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0x13'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router['put']('/:id',auth[_0x43e7('0x8')](),controller[_0x43e7('0x15')]);router[_0x43e7('0x16')](_0x43e7('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x43e7('0x17')]=router;
\ No newline at end of file
index 9f730b4..52b5283 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81fc=['exports','STRING','sequelize'];(function(_0x776457,_0x30f89b){var _0x232786=function(_0x45f15b){while(--_0x45f15b){_0x776457['push'](_0x776457['shift']());}};_0x232786(++_0x30f89b);}(_0x81fc,0x137));var _0xc81f=function(_0xedd27f,_0x1ad79e){_0xedd27f=_0xedd27f-0x0;var _0x26001e=_0x81fc[_0xedd27f];return _0x26001e;};'use strict';var Sequelize=require(_0xc81f('0x0'));module[_0xc81f('0x1')]={'name':{'type':Sequelize[_0xc81f('0x2')]},'description':{'type':Sequelize[_0xc81f('0x2')]}};
\ No newline at end of file
+var _0xf6db=['STRING','sequelize','exports'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xf6db,0x130));var _0xbf6d=function(_0x12b683,_0x124186){_0x12b683=_0x12b683-0x0;var _0xfb150b=_0xf6db[_0x12b683];return _0xfb150b;};'use strict';var Sequelize=require(_0xbf6d('0x0'));module[_0xbf6d('0x1')]={'name':{'type':Sequelize[_0xbf6d('0x2')]},'description':{'type':Sequelize[_0xbf6d('0x2')]}};
\ No newline at end of file
index 2c66168..4a82243 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x64de=['getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','DeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','merge','includeAll','include','findAll','rows','catch','show','intersection','options','find','create','body','params','pick','filter','getFields','nolimit','getSubjects','getDescriptions','findOne','DeskField'];(function(_0x2aa3ed,_0x21bb61){var _0x4e0881=function(_0x581164){while(--_0x581164){_0x2aa3ed['push'](_0x2aa3ed['shift']());}};_0x4e0881(++_0x21bb61);}(_0x64de,0x158));var _0xe64d=function(_0x1192c5,_0x399de4){_0x1192c5=_0x1192c5-0x0;var _0x1632dc=_0x64de[_0x1192c5];return _0x1632dc;};'use strict';var emlformat=require(_0xe64d('0x0'));var rimraf=require(_0xe64d('0x1'));var zipdir=require(_0xe64d('0x2'));var jsonpatch=require(_0xe64d('0x3'));var rp=require(_0xe64d('0x4'));var moment=require(_0xe64d('0x5'));var BPromise=require(_0xe64d('0x6'));var Mustache=require('mustache');var util=require(_0xe64d('0x7'));var path=require(_0xe64d('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe64d('0x9'));var fs=require('fs');var fs_extra=require(_0xe64d('0xa'));var _=require('lodash');var squel=require(_0xe64d('0xb'));var crypto=require(_0xe64d('0xc'));var jsforce=require(_0xe64d('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe64d('0xe'));var authService=require(_0xe64d('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xe64d('0x10'));var hardwareService=require(_0xe64d('0x11'));var logger=require(_0xe64d('0x12'))('api');var utils=require(_0xe64d('0x13'));var config=require(_0xe64d('0x14'));var licenseUtil=require(_0xe64d('0x15'));var db=require(_0xe64d('0x16'))['db'];function respondWithStatusCode(_0x3c5470,_0xd8b548){_0xd8b548=_0xd8b548||0xcc;return function(_0x11ab6){if(_0x11ab6){return _0x3c5470[_0xe64d('0x17')](_0xd8b548);}return _0x3c5470[_0xe64d('0x18')](_0xd8b548)[_0xe64d('0x19')]();};}function respondWithResult(_0x2de5b8,_0x520b32){_0x520b32=_0x520b32||0xc8;return function(_0x3e2a40){if(_0x3e2a40){return _0x2de5b8[_0xe64d('0x18')](_0x520b32)[_0xe64d('0x1a')](_0x3e2a40);}};}function respondWithFilteredResult(_0x32e20b,_0x1e1471){return function(_0x4e0ef5){if(_0x4e0ef5){var _0x113010=typeof _0x1e1471[_0xe64d('0x1b')]===_0xe64d('0x1c')&&typeof _0x1e1471['limit']===_0xe64d('0x1c');var _0x55ad96=_0x4e0ef5[_0xe64d('0x1d')];var _0x1af262=_0x113010?0x0:_0x1e1471['offset'];var _0x534252=_0x113010?_0x4e0ef5[_0xe64d('0x1d')]:_0x1e1471[_0xe64d('0x1b')]+_0x1e1471[_0xe64d('0x1e')];var _0x42626f;if(_0x534252>=_0x55ad96){_0x534252=_0x55ad96;_0x42626f=0xc8;}else{_0x42626f=0xce;}_0x32e20b[_0xe64d('0x18')](_0x42626f);return _0x32e20b[_0xe64d('0x1f')](_0xe64d('0x20'),_0x1af262+'-'+_0x534252+'/'+_0x55ad96)[_0xe64d('0x1a')](_0x4e0ef5);}return null;};}function patchUpdates(_0x3345ef){return function(_0x56a70e){try{jsonpatch[_0xe64d('0x21')](_0x56a70e,_0x3345ef,!![]);}catch(_0x61e13f){return BPromise[_0xe64d('0x22')](_0x61e13f);}return _0x56a70e[_0xe64d('0x23')]();};}function saveUpdates(_0x1d7918,_0x1e437f){return function(_0x551a6c){if(_0x551a6c){return _0x551a6c[_0xe64d('0x24')](_0x1d7918)['then'](function(_0x1ec548){return _0x1ec548;});}return null;};}function removeEntity(_0x361976,_0x5d25df){return function(_0x4c1ba9){if(_0x4c1ba9){return _0x4c1ba9[_0xe64d('0x25')]()[_0xe64d('0x26')](function(){_0x361976[_0xe64d('0x18')](0xcc)[_0xe64d('0x19')]();});}};}function handleEntityNotFound(_0x2fb3ea,_0x5cf9fe){return function(_0x44f1b9){if(!_0x44f1b9){_0x2fb3ea[_0xe64d('0x17')](0x194);}return _0x44f1b9;};}function handleError(_0x252f5b,_0xf29efb){_0xf29efb=_0xf29efb||0x1f4;return function(_0x459dbc){logger[_0xe64d('0x27')](_0x459dbc[_0xe64d('0x28')]);if(_0x459dbc[_0xe64d('0x29')]){delete _0x459dbc['name'];}_0x252f5b[_0xe64d('0x18')](_0xf29efb)[_0xe64d('0x2a')](_0x459dbc);};}exports['index']=function(_0x4c9f5c,_0x552e5b){var _0x1c4355={},_0xac1631={},_0x5a7997={'count':0x0,'rows':[]};var _0x526e22=_[_0xe64d('0x2b')](db[_0xe64d('0x2c')][_0xe64d('0x2d')],function(_0x488b70){return{'name':_0x488b70[_0xe64d('0x2e')],'type':_0x488b70[_0xe64d('0x2f')][_0xe64d('0x30')]};});_0xac1631[_0xe64d('0x31')]=_['map'](_0x526e22,_0xe64d('0x29'));_0xac1631[_0xe64d('0x32')]=_[_0xe64d('0x33')](_0x4c9f5c[_0xe64d('0x32')]);_0xac1631[_0xe64d('0x34')]=_['intersection'](_0xac1631['model'],_0xac1631[_0xe64d('0x32')]);_0x1c4355[_0xe64d('0x35')]=_['intersection'](_0xac1631[_0xe64d('0x31')],qs['fields'](_0x4c9f5c[_0xe64d('0x32')][_0xe64d('0x36')]));_0x1c4355[_0xe64d('0x35')]=_0x1c4355[_0xe64d('0x35')][_0xe64d('0x37')]?_0x1c4355[_0xe64d('0x35')]:_0xac1631['model'];if(!_0x4c9f5c['query'][_0xe64d('0x38')]('nolimit')){_0x1c4355['limit']=qs['limit'](_0x4c9f5c['query']['limit']);_0x1c4355[_0xe64d('0x1b')]=qs[_0xe64d('0x1b')](_0x4c9f5c[_0xe64d('0x32')][_0xe64d('0x1b')]);}_0x1c4355[_0xe64d('0x39')]=qs['sort'](_0x4c9f5c[_0xe64d('0x32')][_0xe64d('0x3a')]);_0x1c4355[_0xe64d('0x3b')]=qs[_0xe64d('0x34')](_['pick'](_0x4c9f5c[_0xe64d('0x32')],_0xac1631[_0xe64d('0x34')]),_0x526e22);if(_0x4c9f5c[_0xe64d('0x32')]['filter']){_0x1c4355[_0xe64d('0x3b')]=_[_0xe64d('0x3c')](_0x1c4355[_0xe64d('0x3b')],{'$or':_[_0xe64d('0x2b')](_0x526e22,function(_0x283327){if(_0x283327[_0xe64d('0x2f')]!=='VIRTUAL'){var _0x23f07d={};_0x23f07d[_0x283327[_0xe64d('0x29')]]={'$like':'%'+_0x4c9f5c[_0xe64d('0x32')]['filter']+'%'};return _0x23f07d;}})});}_0x1c4355=_[_0xe64d('0x3c')]({},_0x1c4355,_0x4c9f5c['options']);var _0x5eb149={'where':_0x1c4355[_0xe64d('0x3b')]};return db[_0xe64d('0x2c')][_0xe64d('0x1d')](_0x5eb149)[_0xe64d('0x26')](function(_0x963d38){_0x5a7997[_0xe64d('0x1d')]=_0x963d38;if(_0x4c9f5c[_0xe64d('0x32')][_0xe64d('0x3d')]){_0x1c4355[_0xe64d('0x3e')]=[{'all':!![]}];}return db[_0xe64d('0x2c')][_0xe64d('0x3f')](_0x1c4355);})['then'](function(_0x10bdd0){_0x5a7997[_0xe64d('0x40')]=_0x10bdd0;return _0x5a7997;})[_0xe64d('0x26')](respondWithFilteredResult(_0x552e5b,_0x1c4355))[_0xe64d('0x41')](handleError(_0x552e5b,null));};exports[_0xe64d('0x42')]=function(_0x4e31b2,_0x56b0d5){var _0x476b56={'raw':![],'where':{'id':_0x4e31b2['params']['id']}},_0x5d03d7={};_0x5d03d7['model']=_[_0xe64d('0x33')](db[_0xe64d('0x2c')][_0xe64d('0x2d')]);_0x5d03d7[_0xe64d('0x32')]=_[_0xe64d('0x33')](_0x4e31b2[_0xe64d('0x32')]);_0x5d03d7['filters']=_[_0xe64d('0x43')](_0x5d03d7[_0xe64d('0x31')],_0x5d03d7[_0xe64d('0x32')]);_0x476b56['attributes']=_[_0xe64d('0x43')](_0x5d03d7[_0xe64d('0x31')],qs['fields'](_0x4e31b2[_0xe64d('0x32')][_0xe64d('0x36')]));_0x476b56['attributes']=_0x476b56[_0xe64d('0x35')][_0xe64d('0x37')]?_0x476b56[_0xe64d('0x35')]:_0x5d03d7[_0xe64d('0x31')];if(_0x4e31b2[_0xe64d('0x32')][_0xe64d('0x3d')]){_0x476b56[_0xe64d('0x3e')]=[{'all':!![]}];}_0x476b56=_['merge']({},_0x476b56,_0x4e31b2[_0xe64d('0x44')]);return db['DeskConfiguration'][_0xe64d('0x45')](_0x476b56)[_0xe64d('0x26')](handleEntityNotFound(_0x56b0d5,null))['then'](respondWithResult(_0x56b0d5,null))[_0xe64d('0x41')](handleError(_0x56b0d5,null));};exports[_0xe64d('0x46')]=function(_0x2524a6,_0x368c81){return db[_0xe64d('0x2c')][_0xe64d('0x46')](_0x2524a6[_0xe64d('0x47')],{})[_0xe64d('0x26')](respondWithResult(_0x368c81,0xc9))[_0xe64d('0x41')](handleError(_0x368c81,null));};exports['update']=function(_0x34378f,_0x36fe94){if(_0x34378f[_0xe64d('0x47')]['id']){delete _0x34378f[_0xe64d('0x47')]['id'];}return db[_0xe64d('0x2c')]['find']({'where':{'id':_0x34378f[_0xe64d('0x48')]['id']}})['then'](handleEntityNotFound(_0x36fe94,null))['then'](saveUpdates(_0x34378f[_0xe64d('0x47')],null))[_0xe64d('0x26')](respondWithResult(_0x36fe94,null))['catch'](handleError(_0x36fe94,null));};exports[_0xe64d('0x25')]=function(_0x4d8a3e,_0x57fbfc){return db[_0xe64d('0x2c')][_0xe64d('0x45')]({'where':{'id':_0x4d8a3e['params']['id']}})[_0xe64d('0x26')](handleEntityNotFound(_0x57fbfc,null))[_0xe64d('0x26')](removeEntity(_0x57fbfc,null))[_0xe64d('0x41')](handleError(_0x57fbfc,null));};exports['getFields']=function(_0x1936eb,_0x133cbd,_0x2b6b97){var _0x3b1f96={};var _0x4df8e5={};var _0x4c0ad0;var _0x1af5ab;return db[_0xe64d('0x2c')]['findOne']({'where':{'id':_0x1936eb[_0xe64d('0x48')]['id']}})['then'](handleEntityNotFound(_0x133cbd,null))[_0xe64d('0x26')](function(_0x3bc3f6){if(_0x3bc3f6){_0x4c0ad0=_0x3bc3f6;_0x4df8e5[_0xe64d('0x31')]=_[_0xe64d('0x33')](db['DeskField']['rawAttributes']);_0x4df8e5[_0xe64d('0x32')]=_['keys'](_0x1936eb[_0xe64d('0x32')]);_0x4df8e5[_0xe64d('0x34')]=_[_0xe64d('0x43')](_0x4df8e5[_0xe64d('0x31')],_0x4df8e5['query']);_0x3b1f96[_0xe64d('0x35')]=_[_0xe64d('0x43')](_0x4df8e5['model'],qs['fields'](_0x1936eb['query']['fields']));_0x3b1f96[_0xe64d('0x35')]=_0x3b1f96[_0xe64d('0x35')]['length']?_0x3b1f96['attributes']:_0x4df8e5[_0xe64d('0x31')];_0x3b1f96[_0xe64d('0x39')]=qs[_0xe64d('0x3a')](_0x1936eb[_0xe64d('0x32')][_0xe64d('0x3a')]);_0x3b1f96[_0xe64d('0x3b')]=qs[_0xe64d('0x34')](_[_0xe64d('0x49')](_0x1936eb[_0xe64d('0x32')],_0x4df8e5[_0xe64d('0x34')]));if(_0x1936eb[_0xe64d('0x32')][_0xe64d('0x4a')]){_0x3b1f96[_0xe64d('0x3b')]=_[_0xe64d('0x3c')](_0x3b1f96[_0xe64d('0x3b')],{'$or':_['map'](_0x3b1f96['attributes'],function(_0x240f5b){var _0x3a8238={};_0x3a8238[_0x240f5b]={'$like':'%'+_0x1936eb[_0xe64d('0x32')][_0xe64d('0x4a')]+'%'};return _0x3a8238;})});}_0x3b1f96=_[_0xe64d('0x3c')]({},_0x3b1f96,_0x1936eb[_0xe64d('0x44')]);return _0x4c0ad0[_0xe64d('0x4b')](_0x3b1f96);}})[_0xe64d('0x26')](function(_0x312c77){if(_0x312c77){_0x1af5ab=_0x312c77[_0xe64d('0x37')];if(!_0x1936eb[_0xe64d('0x32')][_0xe64d('0x38')](_0xe64d('0x4c'))){_0x3b1f96[_0xe64d('0x1e')]=qs['limit'](_0x1936eb[_0xe64d('0x32')]['limit']);_0x3b1f96['offset']=qs[_0xe64d('0x1b')](_0x1936eb[_0xe64d('0x32')][_0xe64d('0x1b')]);}return _0x4c0ad0['getFields'](_0x3b1f96);}})['then'](function(_0x271de7){if(_0x271de7){return _0x271de7?{'count':_0x1af5ab,'rows':_0x271de7}:null;}})[_0xe64d('0x26')](respondWithResult(_0x133cbd,null))[_0xe64d('0x41')](handleError(_0x133cbd,null));};exports['getSubjects']=function(_0x2de3db,_0x286079,_0x5ac3be){var _0x56f481={};var _0x3d29e1={};var _0x2ea348;var _0x363fc2;return db[_0xe64d('0x2c')]['findOne']({'where':{'id':_0x2de3db[_0xe64d('0x48')]['id']}})[_0xe64d('0x26')](handleEntityNotFound(_0x286079,null))[_0xe64d('0x26')](function(_0x249674){if(_0x249674){_0x2ea348=_0x249674;_0x3d29e1[_0xe64d('0x31')]=_['keys'](db['DeskField'][_0xe64d('0x2d')]);_0x3d29e1[_0xe64d('0x32')]=_[_0xe64d('0x33')](_0x2de3db['query']);_0x3d29e1['filters']=_[_0xe64d('0x43')](_0x3d29e1[_0xe64d('0x31')],_0x3d29e1[_0xe64d('0x32')]);_0x56f481[_0xe64d('0x35')]=_[_0xe64d('0x43')](_0x3d29e1[_0xe64d('0x31')],qs['fields'](_0x2de3db[_0xe64d('0x32')][_0xe64d('0x36')]));_0x56f481[_0xe64d('0x35')]=_0x56f481[_0xe64d('0x35')][_0xe64d('0x37')]?_0x56f481[_0xe64d('0x35')]:_0x3d29e1['model'];_0x56f481[_0xe64d('0x39')]=qs['sort'](_0x2de3db[_0xe64d('0x32')][_0xe64d('0x3a')]);_0x56f481[_0xe64d('0x3b')]=qs[_0xe64d('0x34')](_[_0xe64d('0x49')](_0x2de3db[_0xe64d('0x32')],_0x3d29e1[_0xe64d('0x34')]));if(_0x2de3db['query'][_0xe64d('0x4a')]){_0x56f481[_0xe64d('0x3b')]=_[_0xe64d('0x3c')](_0x56f481[_0xe64d('0x3b')],{'$or':_['map'](_0x56f481[_0xe64d('0x35')],function(_0x182f96){var _0x18b834={};_0x18b834[_0x182f96]={'$like':'%'+_0x2de3db[_0xe64d('0x32')][_0xe64d('0x4a')]+'%'};return _0x18b834;})});}_0x56f481=_[_0xe64d('0x3c')]({},_0x56f481,_0x2de3db[_0xe64d('0x44')]);return _0x2ea348[_0xe64d('0x4d')](_0x56f481);}})[_0xe64d('0x26')](function(_0x288f7f){if(_0x288f7f){_0x363fc2=_0x288f7f['length'];if(!_0x2de3db[_0xe64d('0x32')][_0xe64d('0x38')](_0xe64d('0x4c'))){_0x56f481[_0xe64d('0x1e')]=qs[_0xe64d('0x1e')](_0x2de3db['query'][_0xe64d('0x1e')]);_0x56f481[_0xe64d('0x1b')]=qs[_0xe64d('0x1b')](_0x2de3db[_0xe64d('0x32')][_0xe64d('0x1b')]);}return _0x2ea348[_0xe64d('0x4d')](_0x56f481);}})[_0xe64d('0x26')](function(_0x5f37ae){if(_0x5f37ae){return _0x5f37ae?{'count':_0x363fc2,'rows':_0x5f37ae}:null;}})[_0xe64d('0x26')](respondWithResult(_0x286079,null))[_0xe64d('0x41')](handleError(_0x286079,null));};exports[_0xe64d('0x4e')]=function(_0x2c5810,_0x167c7e,_0x2a84cc){var _0x2e2ac2={};var _0x3f84c7={};var _0x583cc6;var _0x58050b;return db[_0xe64d('0x2c')][_0xe64d('0x4f')]({'where':{'id':_0x2c5810[_0xe64d('0x48')]['id']}})[_0xe64d('0x26')](handleEntityNotFound(_0x167c7e,null))[_0xe64d('0x26')](function(_0x393cbf){if(_0x393cbf){_0x583cc6=_0x393cbf;_0x3f84c7[_0xe64d('0x31')]=_[_0xe64d('0x33')](db[_0xe64d('0x50')][_0xe64d('0x2d')]);_0x3f84c7['query']=_['keys'](_0x2c5810[_0xe64d('0x32')]);_0x3f84c7[_0xe64d('0x34')]=_[_0xe64d('0x43')](_0x3f84c7[_0xe64d('0x31')],_0x3f84c7[_0xe64d('0x32')]);_0x2e2ac2[_0xe64d('0x35')]=_[_0xe64d('0x43')](_0x3f84c7['model'],qs[_0xe64d('0x36')](_0x2c5810[_0xe64d('0x32')][_0xe64d('0x36')]));_0x2e2ac2[_0xe64d('0x35')]=_0x2e2ac2[_0xe64d('0x35')][_0xe64d('0x37')]?_0x2e2ac2[_0xe64d('0x35')]:_0x3f84c7[_0xe64d('0x31')];_0x2e2ac2['order']=qs['sort'](_0x2c5810[_0xe64d('0x32')][_0xe64d('0x3a')]);_0x2e2ac2[_0xe64d('0x3b')]=qs[_0xe64d('0x34')](_[_0xe64d('0x49')](_0x2c5810[_0xe64d('0x32')],_0x3f84c7[_0xe64d('0x34')]));if(_0x2c5810[_0xe64d('0x32')]['filter']){_0x2e2ac2['where']=_['merge'](_0x2e2ac2[_0xe64d('0x3b')],{'$or':_['map'](_0x2e2ac2[_0xe64d('0x35')],function(_0x316406){var _0x28e60f={};_0x28e60f[_0x316406]={'$like':'%'+_0x2c5810[_0xe64d('0x32')][_0xe64d('0x4a')]+'%'};return _0x28e60f;})});}_0x2e2ac2=_[_0xe64d('0x3c')]({},_0x2e2ac2,_0x2c5810[_0xe64d('0x44')]);return _0x583cc6['getDescriptions'](_0x2e2ac2);}})[_0xe64d('0x26')](function(_0x57ee0d){if(_0x57ee0d){_0x58050b=_0x57ee0d[_0xe64d('0x37')];if(!_0x2c5810[_0xe64d('0x32')]['hasOwnProperty'](_0xe64d('0x4c'))){_0x2e2ac2['limit']=qs[_0xe64d('0x1e')](_0x2c5810['query'][_0xe64d('0x1e')]);_0x2e2ac2[_0xe64d('0x1b')]=qs[_0xe64d('0x1b')](_0x2c5810[_0xe64d('0x32')][_0xe64d('0x1b')]);}return _0x583cc6[_0xe64d('0x4e')](_0x2e2ac2);}})[_0xe64d('0x26')](function(_0x419a6e){if(_0x419a6e){return _0x419a6e?{'count':_0x58050b,'rows':_0x419a6e}:null;}})['then'](respondWithResult(_0x167c7e,null))[_0xe64d('0x41')](handleError(_0x167c7e,null));};exports[_0xe64d('0x51')]=function(_0x288e73,_0x299d7e,_0x5a4840){var _0xacf72c={};var _0xd603f5={};var _0x3c9368;var _0x1fe442;return db[_0xe64d('0x2c')][_0xe64d('0x4f')]({'where':{'id':_0x288e73['params']['id']}})[_0xe64d('0x26')](handleEntityNotFound(_0x299d7e,null))[_0xe64d('0x26')](function(_0x2c9cdb){if(_0x2c9cdb){_0x3c9368=_0x2c9cdb;_0xd603f5['model']=_[_0xe64d('0x33')](db[_0xe64d('0x52')][_0xe64d('0x2d')]);_0xd603f5[_0xe64d('0x32')]=_['keys'](_0x288e73['query']);_0xd603f5[_0xe64d('0x34')]=_['intersection'](_0xd603f5[_0xe64d('0x31')],_0xd603f5[_0xe64d('0x32')]);_0xacf72c['attributes']=_[_0xe64d('0x43')](_0xd603f5[_0xe64d('0x31')],qs[_0xe64d('0x36')](_0x288e73[_0xe64d('0x32')]['fields']));_0xacf72c[_0xe64d('0x35')]=_0xacf72c[_0xe64d('0x35')]['length']?_0xacf72c['attributes']:_0xd603f5[_0xe64d('0x31')];_0xacf72c[_0xe64d('0x39')]=qs[_0xe64d('0x3a')](_0x288e73[_0xe64d('0x32')][_0xe64d('0x3a')]);_0xacf72c['where']=qs['filters'](_[_0xe64d('0x49')](_0x288e73[_0xe64d('0x32')],_0xd603f5[_0xe64d('0x34')]));if(_0x288e73[_0xe64d('0x32')][_0xe64d('0x4a')]){_0xacf72c[_0xe64d('0x3b')]=_[_0xe64d('0x3c')](_0xacf72c[_0xe64d('0x3b')],{'$or':_[_0xe64d('0x2b')](_0xacf72c[_0xe64d('0x35')],function(_0x985bba){var _0x4cb318={};_0x4cb318[_0x985bba]={'$like':'%'+_0x288e73['query'][_0xe64d('0x4a')]+'%'};return _0x4cb318;})});}_0xacf72c=_[_0xe64d('0x3c')]({},_0xacf72c,_0x288e73[_0xe64d('0x44')]);return _0x3c9368[_0xe64d('0x51')](_0xacf72c);}})['then'](function(_0x461f02){if(_0x461f02){_0x1fe442=_0x461f02[_0xe64d('0x37')];if(!_0x288e73[_0xe64d('0x32')][_0xe64d('0x38')](_0xe64d('0x4c'))){_0xacf72c[_0xe64d('0x1e')]=qs[_0xe64d('0x1e')](_0x288e73['query'][_0xe64d('0x1e')]);_0xacf72c[_0xe64d('0x1b')]=qs[_0xe64d('0x1b')](_0x288e73['query']['offset']);}return _0x3c9368[_0xe64d('0x51')](_0xacf72c);}})[_0xe64d('0x26')](function(_0x1f2ac9){if(_0x1f2ac9){return _0x1f2ac9?{'count':_0x1fe442,'rows':_0x1f2ac9}:null;}})['then'](respondWithResult(_0x299d7e,null))[_0xe64d('0x41')](handleError(_0x299d7e,null));};exports['setTags']=function(_0x563859,_0x35d33f,_0xe1235d){if(_0x563859['body']['id']){delete _0x563859['body']['id'];}return db[_0xe64d('0x2c')]['findOne']({'where':{'id':_0x563859[_0xe64d('0x48')]['id']}})[_0xe64d('0x26')](handleEntityNotFound(_0x35d33f,null))['then'](function(_0x552d61){if(_0x552d61){return _0x552d61[_0xe64d('0x53')](_0x563859[_0xe64d('0x47')][_0xe64d('0x54')]||[]);}return null;})[_0xe64d('0x26')](respondWithResult(_0x35d33f,null))[_0xe64d('0x41')](handleError(_0x35d33f,null));};
\ No newline at end of file
+var _0xe36c=['includeAll','findAll','rows','catch','params','include','find','create','destroy','findOne','DeskField','pick','length','nolimit','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','body','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','sendStatus','name','send','DeskConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options'];(function(_0x4a428e,_0x22a692){var _0x18240e=function(_0x4682f7){while(--_0x4682f7){_0x4a428e['push'](_0x4a428e['shift']());}};_0x18240e(++_0x22a692);}(_0xe36c,0x16e));var _0xce36=function(_0x11acbd,_0x17a0e2){_0x11acbd=_0x11acbd-0x0;var _0x251622=_0xe36c[_0x11acbd];return _0x251622;};'use strict';var emlformat=require(_0xce36('0x0'));var rimraf=require(_0xce36('0x1'));var zipdir=require(_0xce36('0x2'));var jsonpatch=require(_0xce36('0x3'));var rp=require(_0xce36('0x4'));var moment=require('moment');var BPromise=require(_0xce36('0x5'));var Mustache=require(_0xce36('0x6'));var util=require(_0xce36('0x7'));var path=require(_0xce36('0x8'));var sox=require('sox');var csv=require(_0xce36('0x9'));var ejs=require(_0xce36('0xa'));var fs=require('fs');var fs_extra=require(_0xce36('0xb'));var _=require(_0xce36('0xc'));var squel=require(_0xce36('0xd'));var crypto=require(_0xce36('0xe'));var jsforce=require(_0xce36('0xf'));var deskjs=require(_0xce36('0x10'));var toCsv=require(_0xce36('0x9'));var querystring=require('querystring');var Papa=require(_0xce36('0x11'));var Redis=require(_0xce36('0x12'));var authService=require(_0xce36('0x13'));var qs=require(_0xce36('0x14'));var as=require(_0xce36('0x15'));var hardwareService=require(_0xce36('0x16'));var logger=require(_0xce36('0x17'))(_0xce36('0x18'));var utils=require(_0xce36('0x19'));var config=require(_0xce36('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xce36('0x1b'))['db'];function respondWithStatusCode(_0x452093,_0x3b24f3){_0x3b24f3=_0x3b24f3||0xcc;return function(_0x5c8c88){if(_0x5c8c88){return _0x452093['sendStatus'](_0x3b24f3);}return _0x452093[_0xce36('0x1c')](_0x3b24f3)['end']();};}function respondWithResult(_0x581f03,_0x320be6){_0x320be6=_0x320be6||0xc8;return function(_0x4a5b81){if(_0x4a5b81){return _0x581f03[_0xce36('0x1c')](_0x320be6)[_0xce36('0x1d')](_0x4a5b81);}};}function respondWithFilteredResult(_0xfc9646,_0x5d4b02){return function(_0x5ed534){if(_0x5ed534){var _0x5f1336=typeof _0x5d4b02[_0xce36('0x1e')]===_0xce36('0x1f')&&typeof _0x5d4b02[_0xce36('0x20')]===_0xce36('0x1f');var _0x9d236d=_0x5ed534[_0xce36('0x21')];var _0x50628b=_0x5f1336?0x0:_0x5d4b02[_0xce36('0x1e')];var _0x459218=_0x5f1336?_0x5ed534['count']:_0x5d4b02[_0xce36('0x1e')]+_0x5d4b02[_0xce36('0x20')];var _0xeeeb94;if(_0x459218>=_0x9d236d){_0x459218=_0x9d236d;_0xeeeb94=0xc8;}else{_0xeeeb94=0xce;}_0xfc9646[_0xce36('0x1c')](_0xeeeb94);return _0xfc9646['set'](_0xce36('0x22'),_0x50628b+'-'+_0x459218+'/'+_0x9d236d)[_0xce36('0x1d')](_0x5ed534);}return null;};}function patchUpdates(_0x35bcfe){return function(_0x86063d){try{jsonpatch[_0xce36('0x23')](_0x86063d,_0x35bcfe,!![]);}catch(_0x1e9f35){return BPromise[_0xce36('0x24')](_0x1e9f35);}return _0x86063d[_0xce36('0x25')]();};}function saveUpdates(_0x45c899,_0x4918fd){return function(_0x3cdff5){if(_0x3cdff5){return _0x3cdff5[_0xce36('0x26')](_0x45c899)[_0xce36('0x27')](function(_0x15cb85){return _0x15cb85;});}return null;};}function removeEntity(_0x4152e7,_0x1f212d){return function(_0x175025){if(_0x175025){return _0x175025['destroy']()['then'](function(){_0x4152e7[_0xce36('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5509ec,_0x57f4ca){return function(_0x59096a){if(!_0x59096a){_0x5509ec[_0xce36('0x28')](0x194);}return _0x59096a;};}function handleError(_0x17d6f6,_0x16336c){_0x16336c=_0x16336c||0x1f4;return function(_0x4da67a){logger['error'](_0x4da67a['stack']);if(_0x4da67a[_0xce36('0x29')]){delete _0x4da67a[_0xce36('0x29')];}_0x17d6f6[_0xce36('0x1c')](_0x16336c)[_0xce36('0x2a')](_0x4da67a);};}exports['index']=function(_0xd08bbd,_0x56d59d){var _0x37cf98={},_0x54c840={},_0x3dd6b8={'count':0x0,'rows':[]};var _0x227365=_['map'](db[_0xce36('0x2b')][_0xce36('0x2c')],function(_0x5a07c2){return{'name':_0x5a07c2[_0xce36('0x2d')],'type':_0x5a07c2[_0xce36('0x2e')][_0xce36('0x2f')]};});_0x54c840[_0xce36('0x30')]=_[_0xce36('0x31')](_0x227365,_0xce36('0x29'));_0x54c840[_0xce36('0x32')]=_[_0xce36('0x33')](_0xd08bbd[_0xce36('0x32')]);_0x54c840[_0xce36('0x34')]=_[_0xce36('0x35')](_0x54c840[_0xce36('0x30')],_0x54c840[_0xce36('0x32')]);_0x37cf98['attributes']=_[_0xce36('0x35')](_0x54c840[_0xce36('0x30')],qs[_0xce36('0x36')](_0xd08bbd[_0xce36('0x32')][_0xce36('0x36')]));_0x37cf98[_0xce36('0x37')]=_0x37cf98['attributes']['length']?_0x37cf98[_0xce36('0x37')]:_0x54c840[_0xce36('0x30')];if(!_0xd08bbd[_0xce36('0x32')][_0xce36('0x38')]('nolimit')){_0x37cf98['limit']=qs[_0xce36('0x20')](_0xd08bbd['query'][_0xce36('0x20')]);_0x37cf98[_0xce36('0x1e')]=qs[_0xce36('0x1e')](_0xd08bbd['query'][_0xce36('0x1e')]);}_0x37cf98[_0xce36('0x39')]=qs[_0xce36('0x3a')](_0xd08bbd[_0xce36('0x32')]['sort']);_0x37cf98[_0xce36('0x3b')]=qs[_0xce36('0x34')](_['pick'](_0xd08bbd['query'],_0x54c840[_0xce36('0x34')]),_0x227365);if(_0xd08bbd[_0xce36('0x32')][_0xce36('0x3c')]){_0x37cf98[_0xce36('0x3b')]=_[_0xce36('0x3d')](_0x37cf98[_0xce36('0x3b')],{'$or':_['map'](_0x227365,function(_0x40d8a9){if(_0x40d8a9[_0xce36('0x2e')]!==_0xce36('0x3e')){var _0x4afa67={};_0x4afa67[_0x40d8a9[_0xce36('0x29')]]={'$like':'%'+_0xd08bbd[_0xce36('0x32')][_0xce36('0x3c')]+'%'};return _0x4afa67;}})});}_0x37cf98=_[_0xce36('0x3d')]({},_0x37cf98,_0xd08bbd[_0xce36('0x3f')]);var _0x498e56={'where':_0x37cf98[_0xce36('0x3b')]};return db['DeskConfiguration'][_0xce36('0x21')](_0x498e56)[_0xce36('0x27')](function(_0x350c0a){_0x3dd6b8[_0xce36('0x21')]=_0x350c0a;if(_0xd08bbd[_0xce36('0x32')][_0xce36('0x40')]){_0x37cf98['include']=[{'all':!![]}];}return db[_0xce36('0x2b')][_0xce36('0x41')](_0x37cf98);})[_0xce36('0x27')](function(_0x313562){_0x3dd6b8[_0xce36('0x42')]=_0x313562;return _0x3dd6b8;})['then'](respondWithFilteredResult(_0x56d59d,_0x37cf98))[_0xce36('0x43')](handleError(_0x56d59d,null));};exports['show']=function(_0xc6515b,_0x46166f){var _0x283365={'raw':![],'where':{'id':_0xc6515b[_0xce36('0x44')]['id']}},_0x1c4fb7={};_0x1c4fb7[_0xce36('0x30')]=_[_0xce36('0x33')](db[_0xce36('0x2b')]['rawAttributes']);_0x1c4fb7[_0xce36('0x32')]=_[_0xce36('0x33')](_0xc6515b['query']);_0x1c4fb7[_0xce36('0x34')]=_[_0xce36('0x35')](_0x1c4fb7['model'],_0x1c4fb7[_0xce36('0x32')]);_0x283365['attributes']=_[_0xce36('0x35')](_0x1c4fb7[_0xce36('0x30')],qs['fields'](_0xc6515b['query'][_0xce36('0x36')]));_0x283365[_0xce36('0x37')]=_0x283365[_0xce36('0x37')]['length']?_0x283365[_0xce36('0x37')]:_0x1c4fb7[_0xce36('0x30')];if(_0xc6515b[_0xce36('0x32')][_0xce36('0x40')]){_0x283365[_0xce36('0x45')]=[{'all':!![]}];}_0x283365=_[_0xce36('0x3d')]({},_0x283365,_0xc6515b['options']);return db[_0xce36('0x2b')][_0xce36('0x46')](_0x283365)[_0xce36('0x27')](handleEntityNotFound(_0x46166f,null))[_0xce36('0x27')](respondWithResult(_0x46166f,null))[_0xce36('0x43')](handleError(_0x46166f,null));};exports[_0xce36('0x47')]=function(_0x1a159c,_0x189fee){return db[_0xce36('0x2b')][_0xce36('0x47')](_0x1a159c['body'],{})[_0xce36('0x27')](respondWithResult(_0x189fee,0xc9))[_0xce36('0x43')](handleError(_0x189fee,null));};exports[_0xce36('0x26')]=function(_0x3b287d,_0x836cd7){if(_0x3b287d['body']['id']){delete _0x3b287d['body']['id'];}return db[_0xce36('0x2b')][_0xce36('0x46')]({'where':{'id':_0x3b287d[_0xce36('0x44')]['id']}})[_0xce36('0x27')](handleEntityNotFound(_0x836cd7,null))[_0xce36('0x27')](saveUpdates(_0x3b287d['body'],null))[_0xce36('0x27')](respondWithResult(_0x836cd7,null))[_0xce36('0x43')](handleError(_0x836cd7,null));};exports[_0xce36('0x48')]=function(_0x14f059,_0x384911){return db[_0xce36('0x2b')][_0xce36('0x46')]({'where':{'id':_0x14f059[_0xce36('0x44')]['id']}})[_0xce36('0x27')](handleEntityNotFound(_0x384911,null))[_0xce36('0x27')](removeEntity(_0x384911,null))[_0xce36('0x43')](handleError(_0x384911,null));};exports['getFields']=function(_0x35b2b5,_0x1bbafc,_0x461c0e){var _0x3c0a0d={};var _0x2d9b9d={};var _0x3e1346;var _0xc30538;return db[_0xce36('0x2b')][_0xce36('0x49')]({'where':{'id':_0x35b2b5[_0xce36('0x44')]['id']}})[_0xce36('0x27')](handleEntityNotFound(_0x1bbafc,null))['then'](function(_0x22bb75){if(_0x22bb75){_0x3e1346=_0x22bb75;_0x2d9b9d[_0xce36('0x30')]=_['keys'](db[_0xce36('0x4a')][_0xce36('0x2c')]);_0x2d9b9d[_0xce36('0x32')]=_['keys'](_0x35b2b5[_0xce36('0x32')]);_0x2d9b9d[_0xce36('0x34')]=_[_0xce36('0x35')](_0x2d9b9d[_0xce36('0x30')],_0x2d9b9d[_0xce36('0x32')]);_0x3c0a0d[_0xce36('0x37')]=_[_0xce36('0x35')](_0x2d9b9d[_0xce36('0x30')],qs[_0xce36('0x36')](_0x35b2b5[_0xce36('0x32')][_0xce36('0x36')]));_0x3c0a0d[_0xce36('0x37')]=_0x3c0a0d['attributes']['length']?_0x3c0a0d[_0xce36('0x37')]:_0x2d9b9d[_0xce36('0x30')];_0x3c0a0d[_0xce36('0x39')]=qs['sort'](_0x35b2b5['query'][_0xce36('0x3a')]);_0x3c0a0d[_0xce36('0x3b')]=qs[_0xce36('0x34')](_[_0xce36('0x4b')](_0x35b2b5['query'],_0x2d9b9d['filters']));if(_0x35b2b5[_0xce36('0x32')][_0xce36('0x3c')]){_0x3c0a0d[_0xce36('0x3b')]=_[_0xce36('0x3d')](_0x3c0a0d['where'],{'$or':_['map'](_0x3c0a0d[_0xce36('0x37')],function(_0x36c423){var _0x399968={};_0x399968[_0x36c423]={'$like':'%'+_0x35b2b5[_0xce36('0x32')]['filter']+'%'};return _0x399968;})});}_0x3c0a0d=_[_0xce36('0x3d')]({},_0x3c0a0d,_0x35b2b5[_0xce36('0x3f')]);return _0x3e1346['getFields'](_0x3c0a0d);}})[_0xce36('0x27')](function(_0x3793cb){if(_0x3793cb){_0xc30538=_0x3793cb[_0xce36('0x4c')];if(!_0x35b2b5[_0xce36('0x32')][_0xce36('0x38')](_0xce36('0x4d'))){_0x3c0a0d[_0xce36('0x20')]=qs[_0xce36('0x20')](_0x35b2b5[_0xce36('0x32')][_0xce36('0x20')]);_0x3c0a0d[_0xce36('0x1e')]=qs['offset'](_0x35b2b5['query'][_0xce36('0x1e')]);}return _0x3e1346[_0xce36('0x4e')](_0x3c0a0d);}})[_0xce36('0x27')](function(_0x310ccc){if(_0x310ccc){return _0x310ccc?{'count':_0xc30538,'rows':_0x310ccc}:null;}})[_0xce36('0x27')](respondWithResult(_0x1bbafc,null))[_0xce36('0x43')](handleError(_0x1bbafc,null));};exports[_0xce36('0x4f')]=function(_0x252b26,_0x5da92f,_0x1cef0f){var _0x55f6ac={};var _0x5c144b={};var _0x15681a;var _0x2d41e3;return db[_0xce36('0x2b')]['findOne']({'where':{'id':_0x252b26[_0xce36('0x44')]['id']}})[_0xce36('0x27')](handleEntityNotFound(_0x5da92f,null))[_0xce36('0x27')](function(_0x1c7770){if(_0x1c7770){_0x15681a=_0x1c7770;_0x5c144b[_0xce36('0x30')]=_[_0xce36('0x33')](db[_0xce36('0x4a')][_0xce36('0x2c')]);_0x5c144b[_0xce36('0x32')]=_[_0xce36('0x33')](_0x252b26[_0xce36('0x32')]);_0x5c144b[_0xce36('0x34')]=_[_0xce36('0x35')](_0x5c144b[_0xce36('0x30')],_0x5c144b['query']);_0x55f6ac['attributes']=_[_0xce36('0x35')](_0x5c144b[_0xce36('0x30')],qs[_0xce36('0x36')](_0x252b26[_0xce36('0x32')][_0xce36('0x36')]));_0x55f6ac[_0xce36('0x37')]=_0x55f6ac['attributes'][_0xce36('0x4c')]?_0x55f6ac['attributes']:_0x5c144b[_0xce36('0x30')];_0x55f6ac[_0xce36('0x39')]=qs['sort'](_0x252b26[_0xce36('0x32')][_0xce36('0x3a')]);_0x55f6ac['where']=qs[_0xce36('0x34')](_[_0xce36('0x4b')](_0x252b26[_0xce36('0x32')],_0x5c144b[_0xce36('0x34')]));if(_0x252b26[_0xce36('0x32')][_0xce36('0x3c')]){_0x55f6ac[_0xce36('0x3b')]=_[_0xce36('0x3d')](_0x55f6ac[_0xce36('0x3b')],{'$or':_[_0xce36('0x31')](_0x55f6ac[_0xce36('0x37')],function(_0x4fde56){var _0x446b78={};_0x446b78[_0x4fde56]={'$like':'%'+_0x252b26[_0xce36('0x32')]['filter']+'%'};return _0x446b78;})});}_0x55f6ac=_[_0xce36('0x3d')]({},_0x55f6ac,_0x252b26['options']);return _0x15681a[_0xce36('0x4f')](_0x55f6ac);}})[_0xce36('0x27')](function(_0x4974fc){if(_0x4974fc){_0x2d41e3=_0x4974fc['length'];if(!_0x252b26[_0xce36('0x32')]['hasOwnProperty'](_0xce36('0x4d'))){_0x55f6ac[_0xce36('0x20')]=qs[_0xce36('0x20')](_0x252b26[_0xce36('0x32')][_0xce36('0x20')]);_0x55f6ac[_0xce36('0x1e')]=qs[_0xce36('0x1e')](_0x252b26['query'][_0xce36('0x1e')]);}return _0x15681a[_0xce36('0x4f')](_0x55f6ac);}})[_0xce36('0x27')](function(_0x89aa91){if(_0x89aa91){return _0x89aa91?{'count':_0x2d41e3,'rows':_0x89aa91}:null;}})[_0xce36('0x27')](respondWithResult(_0x5da92f,null))[_0xce36('0x43')](handleError(_0x5da92f,null));};exports['getDescriptions']=function(_0x543b4f,_0x1157e3,_0x42262c){var _0x2ddee2={};var _0x577c20={};var _0x38bd7f;var _0x11021b;return db['DeskConfiguration']['findOne']({'where':{'id':_0x543b4f[_0xce36('0x44')]['id']}})[_0xce36('0x27')](handleEntityNotFound(_0x1157e3,null))['then'](function(_0x2bf390){if(_0x2bf390){_0x38bd7f=_0x2bf390;_0x577c20[_0xce36('0x30')]=_[_0xce36('0x33')](db[_0xce36('0x4a')][_0xce36('0x2c')]);_0x577c20[_0xce36('0x32')]=_[_0xce36('0x33')](_0x543b4f[_0xce36('0x32')]);_0x577c20[_0xce36('0x34')]=_['intersection'](_0x577c20[_0xce36('0x30')],_0x577c20['query']);_0x2ddee2['attributes']=_['intersection'](_0x577c20['model'],qs[_0xce36('0x36')](_0x543b4f[_0xce36('0x32')][_0xce36('0x36')]));_0x2ddee2[_0xce36('0x37')]=_0x2ddee2[_0xce36('0x37')][_0xce36('0x4c')]?_0x2ddee2['attributes']:_0x577c20[_0xce36('0x30')];_0x2ddee2['order']=qs['sort'](_0x543b4f[_0xce36('0x32')][_0xce36('0x3a')]);_0x2ddee2[_0xce36('0x3b')]=qs[_0xce36('0x34')](_[_0xce36('0x4b')](_0x543b4f[_0xce36('0x32')],_0x577c20['filters']));if(_0x543b4f[_0xce36('0x32')][_0xce36('0x3c')]){_0x2ddee2[_0xce36('0x3b')]=_[_0xce36('0x3d')](_0x2ddee2[_0xce36('0x3b')],{'$or':_[_0xce36('0x31')](_0x2ddee2[_0xce36('0x37')],function(_0x267a8a){var _0x2fa358={};_0x2fa358[_0x267a8a]={'$like':'%'+_0x543b4f['query'][_0xce36('0x3c')]+'%'};return _0x2fa358;})});}_0x2ddee2=_['merge']({},_0x2ddee2,_0x543b4f['options']);return _0x38bd7f['getDescriptions'](_0x2ddee2);}})[_0xce36('0x27')](function(_0x37494a){if(_0x37494a){_0x11021b=_0x37494a[_0xce36('0x4c')];if(!_0x543b4f[_0xce36('0x32')][_0xce36('0x38')](_0xce36('0x4d'))){_0x2ddee2[_0xce36('0x20')]=qs['limit'](_0x543b4f[_0xce36('0x32')][_0xce36('0x20')]);_0x2ddee2[_0xce36('0x1e')]=qs[_0xce36('0x1e')](_0x543b4f['query'][_0xce36('0x1e')]);}return _0x38bd7f[_0xce36('0x50')](_0x2ddee2);}})[_0xce36('0x27')](function(_0x502126){if(_0x502126){return _0x502126?{'count':_0x11021b,'rows':_0x502126}:null;}})['then'](respondWithResult(_0x1157e3,null))['catch'](handleError(_0x1157e3,null));};exports[_0xce36('0x51')]=function(_0x470f1f,_0x1e4c78,_0x3cda57){var _0x1fea1c={};var _0x24c23f={};var _0x3f74a6;var _0x488ef9;return db[_0xce36('0x2b')][_0xce36('0x49')]({'where':{'id':_0x470f1f['params']['id']}})['then'](handleEntityNotFound(_0x1e4c78,null))[_0xce36('0x27')](function(_0x37a3f4){if(_0x37a3f4){_0x3f74a6=_0x37a3f4;_0x24c23f[_0xce36('0x30')]=_[_0xce36('0x33')](db[_0xce36('0x52')][_0xce36('0x2c')]);_0x24c23f[_0xce36('0x32')]=_['keys'](_0x470f1f['query']);_0x24c23f[_0xce36('0x34')]=_[_0xce36('0x35')](_0x24c23f[_0xce36('0x30')],_0x24c23f[_0xce36('0x32')]);_0x1fea1c[_0xce36('0x37')]=_[_0xce36('0x35')](_0x24c23f[_0xce36('0x30')],qs[_0xce36('0x36')](_0x470f1f[_0xce36('0x32')][_0xce36('0x36')]));_0x1fea1c['attributes']=_0x1fea1c[_0xce36('0x37')]['length']?_0x1fea1c['attributes']:_0x24c23f[_0xce36('0x30')];_0x1fea1c[_0xce36('0x39')]=qs['sort'](_0x470f1f[_0xce36('0x32')][_0xce36('0x3a')]);_0x1fea1c['where']=qs[_0xce36('0x34')](_[_0xce36('0x4b')](_0x470f1f[_0xce36('0x32')],_0x24c23f['filters']));if(_0x470f1f[_0xce36('0x32')]['filter']){_0x1fea1c['where']=_['merge'](_0x1fea1c['where'],{'$or':_['map'](_0x1fea1c[_0xce36('0x37')],function(_0x121621){var _0x542a19={};_0x542a19[_0x121621]={'$like':'%'+_0x470f1f[_0xce36('0x32')][_0xce36('0x3c')]+'%'};return _0x542a19;})});}_0x1fea1c=_[_0xce36('0x3d')]({},_0x1fea1c,_0x470f1f[_0xce36('0x3f')]);return _0x3f74a6[_0xce36('0x51')](_0x1fea1c);}})['then'](function(_0x23f862){if(_0x23f862){_0x488ef9=_0x23f862[_0xce36('0x4c')];if(!_0x470f1f['query']['hasOwnProperty']('nolimit')){_0x1fea1c[_0xce36('0x20')]=qs['limit'](_0x470f1f[_0xce36('0x32')]['limit']);_0x1fea1c[_0xce36('0x1e')]=qs[_0xce36('0x1e')](_0x470f1f[_0xce36('0x32')][_0xce36('0x1e')]);}return _0x3f74a6[_0xce36('0x51')](_0x1fea1c);}})[_0xce36('0x27')](function(_0x167a59){if(_0x167a59){return _0x167a59?{'count':_0x488ef9,'rows':_0x167a59}:null;}})['then'](respondWithResult(_0x1e4c78,null))[_0xce36('0x43')](handleError(_0x1e4c78,null));};exports[_0xce36('0x53')]=function(_0x2a551f,_0x152767,_0x40e191){if(_0x2a551f[_0xce36('0x54')]['id']){delete _0x2a551f[_0xce36('0x54')]['id'];}return db['DeskConfiguration']['findOne']({'where':{'id':_0x2a551f[_0xce36('0x44')]['id']}})[_0xce36('0x27')](handleEntityNotFound(_0x152767,null))[_0xce36('0x27')](function(_0x45db8c){if(_0x45db8c){return _0x45db8c[_0xce36('0x53')](_0x2a551f[_0xce36('0x54')][_0xce36('0x55')]||[]);}return null;})['then'](respondWithResult(_0x152767,null))['catch'](handleError(_0x152767,null));};
\ No newline at end of file
index 9efb065..a9b82f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x56dc=['int_desk_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','DeskConfiguration'];(function(_0x482830,_0xec8452){var _0x257e07=function(_0x1ea818){while(--_0x1ea818){_0x482830['push'](_0x482830['shift']());}};_0x257e07(++_0xec8452);}(_0x56dc,0xfd));var _0xc56d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x56dc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc56d('0x0'));var util=require('util');var logger=require(_0xc56d('0x1'))(_0xc56d('0x2'));var moment=require(_0xc56d('0x3'));var BPromise=require(_0xc56d('0x4'));var rp=require(_0xc56d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc56d('0x6'));var config=require(_0xc56d('0x7'));var attributes=require(_0xc56d('0x8'));module[_0xc56d('0x9')]=function(_0x3eb4ed,_0x3e68f4){return _0x3eb4ed['define'](_0xc56d('0xa'),attributes,{'tableName':_0xc56d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9d29=['path','rimraf','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x114d88,_0x43fe95){var _0x48c996=function(_0x132925){while(--_0x132925){_0x114d88['push'](_0x114d88['shift']());}};_0x48c996(++_0x43fe95);}(_0x9d29,0xa1));var _0x99d2=function(_0x592eeb,_0x10ef82){_0x592eeb=_0x592eeb-0x0;var _0x3ea777=_0x9d29[_0x592eeb];return _0x3ea777;};'use strict';var _=require(_0x99d2('0x0'));var util=require(_0x99d2('0x1'));var logger=require(_0x99d2('0x2'))(_0x99d2('0x3'));var moment=require(_0x99d2('0x4'));var BPromise=require(_0x99d2('0x5'));var rp=require(_0x99d2('0x6'));var fs=require('fs');var path=require(_0x99d2('0x7'));var rimraf=require(_0x99d2('0x8'));var config=require('../../config/environment');var attributes=require(_0x99d2('0x9'));module[_0x99d2('0xa')]=function(_0x2510ca,_0x45c734){return _0x2510ca[_0x99d2('0xb')](_0x99d2('0xc'),attributes,{'tableName':_0x99d2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 22088e2..069ed4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x583c=['../../config/environment','client','http','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc'];(function(_0x3b1b23,_0x21bccd){var _0x1efc85=function(_0x102a95){while(--_0x102a95){_0x3b1b23['push'](_0x3b1b23['shift']());}};_0x1efc85(++_0x21bccd);}(_0x583c,0x12b));var _0xc583=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0x583c[_0x20ef64];return _0x3707d8;};'use strict';var _=require(_0xc583('0x0'));var util=require(_0xc583('0x1'));var moment=require(_0xc583('0x2'));var BPromise=require(_0xc583('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc583('0x4'));var db=require(_0xc583('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc583('0x6'));var config=require(_0xc583('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc583('0x8')][_0xc583('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2719df,_0x1dd37c,_0x48a8d4){return new BPromise(function(_0x21ed88,_0x26cec0){return client['request'](_0x2719df,_0x48a8d4)[_0xc583('0xa')](function(_0x24ab4f){logger[_0xc583('0xb')](_0xc583('0xc'),_0x1dd37c,_0xc583('0xd'));logger['debug'](_0xc583('0xe'),_0x1dd37c,_0xc583('0xd'),JSON['stringify'](_0x24ab4f));if(_0x24ab4f[_0xc583('0xf')]){if(_0x24ab4f[_0xc583('0xf')]['code']===0x1f4){logger[_0xc583('0xf')](_0xc583('0xc'),_0x1dd37c,_0x24ab4f[_0xc583('0xf')][_0xc583('0x10')]);return _0x26cec0(_0x24ab4f[_0xc583('0xf')][_0xc583('0x10')]);}logger[_0xc583('0xf')](_0xc583('0xc'),_0x1dd37c,_0x24ab4f[_0xc583('0xf')]['message']);return _0x21ed88(_0x24ab4f[_0xc583('0xf')]['message']);}else{logger[_0xc583('0xb')](_0xc583('0xc'),_0x1dd37c,'request\x20sent');_0x21ed88(_0x24ab4f[_0xc583('0x11')][_0xc583('0x10')]);}})['catch'](function(_0x7d1690){logger[_0xc583('0xf')]('DeskConfiguration,\x20%s,\x20%s',_0x1dd37c,_0x7d1690);_0x26cec0(_0x7d1690);});});}
\ No newline at end of file
+var _0x0e26=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','randomstring','ioredis'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x0e26,0x12c));var _0x60e2=function(_0x3852fb,_0x7ecbe9){_0x3852fb=_0x3852fb-0x0;var _0x4785c9=_0x0e26[_0x3852fb];return _0x4785c9;};'use strict';var _=require(_0x60e2('0x0'));var util=require(_0x60e2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x60e2('0x2'));var fs=require('fs');var Redis=require(_0x60e2('0x3'));var db=require(_0x60e2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x60e2('0x5'))(_0x60e2('0x6'));var config=require(_0x60e2('0x7'));var jayson=require(_0x60e2('0x8'));var client=jayson[_0x60e2('0x9')][_0x60e2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2abfbf,_0x2211b3,_0x36d92f){return new BPromise(function(_0x458a6d,_0x1a8a8d){return client['request'](_0x2abfbf,_0x36d92f)['then'](function(_0x3b33bf){logger[_0x60e2('0xb')](_0x60e2('0xc'),_0x2211b3,_0x60e2('0xd'));logger['debug'](_0x60e2('0xe'),_0x2211b3,_0x60e2('0xd'),JSON[_0x60e2('0xf')](_0x3b33bf));if(_0x3b33bf[_0x60e2('0x10')]){if(_0x3b33bf['error']['code']===0x1f4){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x2211b3,_0x3b33bf['error']['message']);return _0x1a8a8d(_0x3b33bf[_0x60e2('0x10')]['message']);}logger[_0x60e2('0x10')](_0x60e2('0xc'),_0x2211b3,_0x3b33bf['error'][_0x60e2('0x11')]);return _0x458a6d(_0x3b33bf[_0x60e2('0x10')][_0x60e2('0x11')]);}else{logger[_0x60e2('0xb')]('DeskConfiguration,\x20%s,\x20%s',_0x2211b3,_0x60e2('0xd'));_0x458a6d(_0x3b33bf['result']['message']);}})[_0x60e2('0x12')](function(_0x1b1a2e){logger['error'](_0x60e2('0xc'),_0x2211b3,_0x1b1a2e);_0x1a8a8d(_0x1b1a2e);});});}
\ No newline at end of file
index d85ce8b..fb2ff58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf9f6=['create','put','update','delete','destroy','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskField.controller','isAuthenticated','get','/:id','show'];(function(_0xea3af8,_0x4d4bda){var _0x26795f=function(_0x334173){while(--_0x334173){_0xea3af8['push'](_0xea3af8['shift']());}};_0x26795f(++_0x4d4bda);}(_0xf9f6,0x1a5));var _0x6f9f=function(_0x2f2360,_0x151089){_0x2f2360=_0x2f2360-0x0;var _0x1cc8d3=_0xf9f6[_0x2f2360];return _0x1cc8d3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6f9f('0x0'));var timeout=require(_0x6f9f('0x1'));var express=require('express');var router=express[_0x6f9f('0x2')]();var fs_extra=require(_0x6f9f('0x3'));var auth=require(_0x6f9f('0x4'));var interaction=require(_0x6f9f('0x5'));var config=require('../../config/environment');var controller=require(_0x6f9f('0x6'));router['get']('/',auth[_0x6f9f('0x7')](),controller['index']);router[_0x6f9f('0x8')](_0x6f9f('0x9'),auth[_0x6f9f('0x7')](),controller[_0x6f9f('0xa')]);router['post']('/',auth[_0x6f9f('0x7')](),controller[_0x6f9f('0xb')]);router[_0x6f9f('0xc')](_0x6f9f('0x9'),auth[_0x6f9f('0x7')](),controller[_0x6f9f('0xd')]);router[_0x6f9f('0xe')](_0x6f9f('0x9'),auth[_0x6f9f('0x7')](),controller[_0x6f9f('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0xd497=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskField.controller','get','isAuthenticated','index','/:id','show','post','put','update','destroy'];(function(_0xcc7c77,_0x1ae076){var _0x1e031c=function(_0x103b6b){while(--_0x103b6b){_0xcc7c77['push'](_0xcc7c77['shift']());}};_0x1e031c(++_0x1ae076);}(_0xd497,0x170));var _0x7d49=function(_0x24f3a2,_0xc02264){_0x24f3a2=_0x24f3a2-0x0;var _0x245c4d=_0xd497[_0x24f3a2];return _0x245c4d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7d49('0x0'));var timeout=require(_0x7d49('0x1'));var express=require(_0x7d49('0x2'));var router=express['Router']();var fs_extra=require(_0x7d49('0x3'));var auth=require(_0x7d49('0x4'));var interaction=require(_0x7d49('0x5'));var config=require('../../config/environment');var controller=require(_0x7d49('0x6'));router[_0x7d49('0x7')]('/',auth[_0x7d49('0x8')](),controller[_0x7d49('0x9')]);router[_0x7d49('0x7')](_0x7d49('0xa'),auth['isAuthenticated'](),controller[_0x7d49('0xb')]);router[_0x7d49('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7d49('0xd')](_0x7d49('0xa'),auth[_0x7d49('0x8')](),controller[_0x7d49('0xe')]);router['delete'](_0x7d49('0xa'),auth[_0x7d49('0x8')](),controller[_0x7d49('0xf')]);module['exports']=router;
\ No newline at end of file
index 7c84668..8b3e552 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3c6=['customVariable','STRING','variable','ENUM','string'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0xa3c6,0x99));var _0x6a3c=function(_0x2c1c04,_0x252f5c){_0x2c1c04=_0x2c1c04-0x0;var _0x56028e=_0xa3c6[_0x2c1c04];return _0x56028e;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x6a3c('0x0')](_0x6a3c('0x1'),'variable',_0x6a3c('0x2'),'keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x6a3c('0x3')]},'key':{'type':Sequelize[_0x6a3c('0x3')]},'keyType':{'type':Sequelize['ENUM'](_0x6a3c('0x1'),_0x6a3c('0x4'),_0x6a3c('0x2'))},'keyContent':{'type':Sequelize[_0x6a3c('0x3')]},'idField':{'type':Sequelize[_0x6a3c('0x3')]},'nameField':{'type':Sequelize[_0x6a3c('0x3')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6a3c('0x3')]}};
\ No newline at end of file
+var _0x95ca=['keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x1abab2,_0x408bd3){var _0x53d957=function(_0x4d7997){while(--_0x4d7997){_0x1abab2['push'](_0x1abab2['shift']());}};_0x53d957(++_0x408bd3);}(_0x95ca,0x144));var _0xa95c=function(_0x155a5c,_0x80cbed){_0x155a5c=_0x155a5c-0x0;var _0x45a9fb=_0x95ca[_0x155a5c];return _0x45a9fb;};'use strict';var Sequelize=require(_0xa95c('0x0'));module[_0xa95c('0x1')]={'type':{'type':Sequelize[_0xa95c('0x2')](_0xa95c('0x3'),_0xa95c('0x4'),_0xa95c('0x5'),_0xa95c('0x6'),_0xa95c('0x7')),'defaultValue':_0xa95c('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xa95c('0x3'),'variable',_0xa95c('0x5'))},'keyContent':{'type':Sequelize[_0xa95c('0x8')]},'idField':{'type':Sequelize[_0xa95c('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xa95c('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa95c('0x8')]}};
\ No newline at end of file
index 4c7998a..e9d65b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8cc=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','reject','update','then','destroy','error','stack','name','send','index','map','DeskField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','order','sort','where','pick','merge','VIRTUAL','filter','findAll','rows','show','params','length','includeAll','include','options','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x58233f,_0x144e81){var _0x3df776=function(_0x288de8){while(--_0x288de8){_0x58233f['push'](_0x58233f['shift']());}};_0x3df776(++_0x144e81);}(_0xf8cc,0x1e4));var _0xcf8c=function(_0x3f9962,_0x5442ea){_0x3f9962=_0x3f9962-0x0;var _0x4891e1=_0xf8cc[_0x3f9962];return _0x4891e1;};'use strict';var emlformat=require(_0xcf8c('0x0'));var rimraf=require(_0xcf8c('0x1'));var zipdir=require(_0xcf8c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcf8c('0x3'));var moment=require(_0xcf8c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcf8c('0x5'));var util=require(_0xcf8c('0x6'));var path=require(_0xcf8c('0x7'));var sox=require(_0xcf8c('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xcf8c('0x9'));var jsforce=require(_0xcf8c('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xcf8c('0xb'));var querystring=require(_0xcf8c('0xc'));var Papa=require('papaparse');var Redis=require(_0xcf8c('0xd'));var authService=require(_0xcf8c('0xe'));var qs=require(_0xcf8c('0xf'));var as=require(_0xcf8c('0x10'));var hardwareService=require(_0xcf8c('0x11'));var logger=require(_0xcf8c('0x12'))(_0xcf8c('0x13'));var utils=require(_0xcf8c('0x14'));var config=require(_0xcf8c('0x15'));var licenseUtil=require(_0xcf8c('0x16'));var db=require(_0xcf8c('0x17'))['db'];function respondWithStatusCode(_0x3b702f,_0x21dd72){_0x21dd72=_0x21dd72||0xcc;return function(_0x303938){if(_0x303938){return _0x3b702f[_0xcf8c('0x18')](_0x21dd72);}return _0x3b702f['status'](_0x21dd72)[_0xcf8c('0x19')]();};}function respondWithResult(_0x1582de,_0x3b25fb){_0x3b25fb=_0x3b25fb||0xc8;return function(_0x69df54){if(_0x69df54){return _0x1582de[_0xcf8c('0x1a')](_0x3b25fb)[_0xcf8c('0x1b')](_0x69df54);}};}function respondWithFilteredResult(_0x59319f,_0x35c41e){return function(_0x3c151e){if(_0x3c151e){var _0x2bb2b9=typeof _0x35c41e[_0xcf8c('0x1c')]===_0xcf8c('0x1d')&&typeof _0x35c41e['limit']===_0xcf8c('0x1d');var _0xa4cc7f=_0x3c151e[_0xcf8c('0x1e')];var _0xc0e422=_0x2bb2b9?0x0:_0x35c41e['offset'];var _0x4399ef=_0x2bb2b9?_0x3c151e[_0xcf8c('0x1e')]:_0x35c41e['offset']+_0x35c41e[_0xcf8c('0x1f')];var _0x3e81de;if(_0x4399ef>=_0xa4cc7f){_0x4399ef=_0xa4cc7f;_0x3e81de=0xc8;}else{_0x3e81de=0xce;}_0x59319f[_0xcf8c('0x1a')](_0x3e81de);return _0x59319f[_0xcf8c('0x20')]('Content-Range',_0xc0e422+'-'+_0x4399ef+'/'+_0xa4cc7f)[_0xcf8c('0x1b')](_0x3c151e);}return null;};}function patchUpdates(_0x24ebcc){return function(_0x11d4c2){try{jsonpatch['apply'](_0x11d4c2,_0x24ebcc,!![]);}catch(_0x2e6e16){return BPromise[_0xcf8c('0x21')](_0x2e6e16);}return _0x11d4c2['save']();};}function saveUpdates(_0x23f2bc,_0x36f085){return function(_0x582f49){if(_0x582f49){return _0x582f49[_0xcf8c('0x22')](_0x23f2bc)[_0xcf8c('0x23')](function(_0x1e1631){return _0x1e1631;});}return null;};}function removeEntity(_0x1c47ef,_0x29d370){return function(_0x5d7eb3){if(_0x5d7eb3){return _0x5d7eb3[_0xcf8c('0x24')]()['then'](function(){_0x1c47ef[_0xcf8c('0x1a')](0xcc)[_0xcf8c('0x19')]();});}};}function handleEntityNotFound(_0x4e5ad6,_0x5e38c6){return function(_0x220399){if(!_0x220399){_0x4e5ad6[_0xcf8c('0x18')](0x194);}return _0x220399;};}function handleError(_0x12e944,_0x1c3800){_0x1c3800=_0x1c3800||0x1f4;return function(_0x3280ed){logger[_0xcf8c('0x25')](_0x3280ed[_0xcf8c('0x26')]);if(_0x3280ed[_0xcf8c('0x27')]){delete _0x3280ed[_0xcf8c('0x27')];}_0x12e944[_0xcf8c('0x1a')](_0x1c3800)[_0xcf8c('0x28')](_0x3280ed);};}exports[_0xcf8c('0x29')]=function(_0x44a947,_0x2b0888){var _0xe6dd5e={},_0x5ddd37={},_0x4bf702={'count':0x0,'rows':[]};var _0xf93ad5=_[_0xcf8c('0x2a')](db[_0xcf8c('0x2b')][_0xcf8c('0x2c')],function(_0x3b51b5){return{'name':_0x3b51b5[_0xcf8c('0x2d')],'type':_0x3b51b5[_0xcf8c('0x2e')]['key']};});_0x5ddd37[_0xcf8c('0x2f')]=_[_0xcf8c('0x2a')](_0xf93ad5,_0xcf8c('0x27'));_0x5ddd37[_0xcf8c('0x30')]=_[_0xcf8c('0x31')](_0x44a947['query']);_0x5ddd37[_0xcf8c('0x32')]=_[_0xcf8c('0x33')](_0x5ddd37[_0xcf8c('0x2f')],_0x5ddd37[_0xcf8c('0x30')]);_0xe6dd5e[_0xcf8c('0x34')]=_[_0xcf8c('0x33')](_0x5ddd37[_0xcf8c('0x2f')],qs['fields'](_0x44a947[_0xcf8c('0x30')]['fields']));_0xe6dd5e[_0xcf8c('0x34')]=_0xe6dd5e[_0xcf8c('0x34')]['length']?_0xe6dd5e[_0xcf8c('0x34')]:_0x5ddd37[_0xcf8c('0x2f')];if(!_0x44a947[_0xcf8c('0x30')]['hasOwnProperty']('nolimit')){_0xe6dd5e['limit']=qs[_0xcf8c('0x1f')](_0x44a947[_0xcf8c('0x30')][_0xcf8c('0x1f')]);_0xe6dd5e[_0xcf8c('0x1c')]=qs[_0xcf8c('0x1c')](_0x44a947[_0xcf8c('0x30')][_0xcf8c('0x1c')]);}_0xe6dd5e[_0xcf8c('0x35')]=qs['sort'](_0x44a947[_0xcf8c('0x30')][_0xcf8c('0x36')]);_0xe6dd5e[_0xcf8c('0x37')]=qs[_0xcf8c('0x32')](_[_0xcf8c('0x38')](_0x44a947[_0xcf8c('0x30')],_0x5ddd37[_0xcf8c('0x32')]),_0xf93ad5);if(_0x44a947[_0xcf8c('0x30')]['filter']){_0xe6dd5e['where']=_[_0xcf8c('0x39')](_0xe6dd5e[_0xcf8c('0x37')],{'$or':_['map'](_0xf93ad5,function(_0x3f3b7c){if(_0x3f3b7c[_0xcf8c('0x2e')]!==_0xcf8c('0x3a')){var _0x2d218d={};_0x2d218d[_0x3f3b7c['name']]={'$like':'%'+_0x44a947[_0xcf8c('0x30')][_0xcf8c('0x3b')]+'%'};return _0x2d218d;}})});}_0xe6dd5e=_['merge']({},_0xe6dd5e,_0x44a947['options']);var _0x12504d={'where':_0xe6dd5e[_0xcf8c('0x37')]};return db[_0xcf8c('0x2b')][_0xcf8c('0x1e')](_0x12504d)[_0xcf8c('0x23')](function(_0x4c6f74){_0x4bf702['count']=_0x4c6f74;if(_0x44a947[_0xcf8c('0x30')]['includeAll']){_0xe6dd5e['include']=[{'all':!![]}];}return db[_0xcf8c('0x2b')][_0xcf8c('0x3c')](_0xe6dd5e);})[_0xcf8c('0x23')](function(_0xbfc65e){_0x4bf702[_0xcf8c('0x3d')]=_0xbfc65e;return _0x4bf702;})[_0xcf8c('0x23')](respondWithFilteredResult(_0x2b0888,_0xe6dd5e))['catch'](handleError(_0x2b0888,null));};exports[_0xcf8c('0x3e')]=function(_0x52895f,_0x32934e){var _0x7b46f6={'raw':!![],'where':{'id':_0x52895f[_0xcf8c('0x3f')]['id']}},_0x3ead56={};_0x3ead56[_0xcf8c('0x2f')]=_[_0xcf8c('0x31')](db['DeskField']['rawAttributes']);_0x3ead56[_0xcf8c('0x30')]=_[_0xcf8c('0x31')](_0x52895f['query']);_0x3ead56[_0xcf8c('0x32')]=_['intersection'](_0x3ead56[_0xcf8c('0x2f')],_0x3ead56[_0xcf8c('0x30')]);_0x7b46f6[_0xcf8c('0x34')]=_[_0xcf8c('0x33')](_0x3ead56[_0xcf8c('0x2f')],qs['fields'](_0x52895f[_0xcf8c('0x30')]['fields']));_0x7b46f6[_0xcf8c('0x34')]=_0x7b46f6[_0xcf8c('0x34')][_0xcf8c('0x40')]?_0x7b46f6[_0xcf8c('0x34')]:_0x3ead56['model'];if(_0x52895f[_0xcf8c('0x30')][_0xcf8c('0x41')]){_0x7b46f6[_0xcf8c('0x42')]=[{'all':!![]}];}_0x7b46f6=_['merge']({},_0x7b46f6,_0x52895f[_0xcf8c('0x43')]);return db[_0xcf8c('0x2b')][_0xcf8c('0x44')](_0x7b46f6)['then'](handleEntityNotFound(_0x32934e,null))[_0xcf8c('0x23')](respondWithResult(_0x32934e,null))[_0xcf8c('0x45')](handleError(_0x32934e,null));};exports[_0xcf8c('0x46')]=function(_0x2eec2e,_0x181baa){return db[_0xcf8c('0x2b')][_0xcf8c('0x46')](_0x2eec2e['body'],{})[_0xcf8c('0x23')](respondWithResult(_0x181baa,0xc9))['catch'](handleError(_0x181baa,null));};exports[_0xcf8c('0x22')]=function(_0x19c420,_0x5a91f4){if(_0x19c420[_0xcf8c('0x47')]['id']){delete _0x19c420[_0xcf8c('0x47')]['id'];}return db[_0xcf8c('0x2b')][_0xcf8c('0x44')]({'where':{'id':_0x19c420['params']['id']}})['then'](handleEntityNotFound(_0x5a91f4,null))[_0xcf8c('0x23')](saveUpdates(_0x19c420[_0xcf8c('0x47')],null))['then'](respondWithResult(_0x5a91f4,null))[_0xcf8c('0x45')](handleError(_0x5a91f4,null));};exports[_0xcf8c('0x24')]=function(_0x1c76e1,_0x2be72a){return db['DeskField']['find']({'where':{'id':_0x1c76e1[_0xcf8c('0x3f')]['id']}})[_0xcf8c('0x23')](handleEntityNotFound(_0x2be72a,null))[_0xcf8c('0x23')](removeEntity(_0x2be72a,null))[_0xcf8c('0x45')](handleError(_0x2be72a,null));};
\ No newline at end of file
+var _0x737d=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','save','then','destroy','end','error','stack','name','send','index','map','DeskField','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','update','eml-format','rimraf','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs'];(function(_0x166d93,_0x301f09){var _0xba708=function(_0x349bf7){while(--_0x349bf7){_0x166d93['push'](_0x166d93['shift']());}};_0xba708(++_0x301f09);}(_0x737d,0xbc));var _0xd737=function(_0x3e1b6f,_0x3068e5){_0x3e1b6f=_0x3e1b6f-0x0;var _0x502338=_0x737d[_0x3e1b6f];return _0x502338;};'use strict';var emlformat=require(_0xd737('0x0'));var rimraf=require(_0xd737('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd737('0x2'));var Mustache=require('mustache');var util=require(_0xd737('0x3'));var path=require('path');var sox=require(_0xd737('0x4'));var csv=require(_0xd737('0x5'));var ejs=require(_0xd737('0x6'));var fs=require('fs');var fs_extra=require(_0xd737('0x7'));var _=require(_0xd737('0x8'));var squel=require(_0xd737('0x9'));var crypto=require(_0xd737('0xa'));var jsforce=require(_0xd737('0xb'));var deskjs=require(_0xd737('0xc'));var toCsv=require(_0xd737('0x5'));var querystring=require('querystring');var Papa=require(_0xd737('0xd'));var Redis=require(_0xd737('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd737('0xf'));var as=require(_0xd737('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd737('0x11'))(_0xd737('0x12'));var utils=require('../../config/utils');var config=require(_0xd737('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xd737('0x14'))['db'];function respondWithStatusCode(_0x326f9c,_0x497076){_0x497076=_0x497076||0xcc;return function(_0x5bf94c){if(_0x5bf94c){return _0x326f9c[_0xd737('0x15')](_0x497076);}return _0x326f9c[_0xd737('0x16')](_0x497076)['end']();};}function respondWithResult(_0x11c3ed,_0xe9f7be){_0xe9f7be=_0xe9f7be||0xc8;return function(_0x3c3c11){if(_0x3c3c11){return _0x11c3ed[_0xd737('0x16')](_0xe9f7be)[_0xd737('0x17')](_0x3c3c11);}};}function respondWithFilteredResult(_0x1b1fc1,_0x3dc72f){return function(_0x24e8b6){if(_0x24e8b6){var _0x573b6f=typeof _0x3dc72f['offset']===_0xd737('0x18')&&typeof _0x3dc72f[_0xd737('0x19')]===_0xd737('0x18');var _0x3d15ba=_0x24e8b6[_0xd737('0x1a')];var _0x39401d=_0x573b6f?0x0:_0x3dc72f[_0xd737('0x1b')];var _0x1f6fa1=_0x573b6f?_0x24e8b6['count']:_0x3dc72f['offset']+_0x3dc72f[_0xd737('0x19')];var _0x49e47a;if(_0x1f6fa1>=_0x3d15ba){_0x1f6fa1=_0x3d15ba;_0x49e47a=0xc8;}else{_0x49e47a=0xce;}_0x1b1fc1['status'](_0x49e47a);return _0x1b1fc1['set']('Content-Range',_0x39401d+'-'+_0x1f6fa1+'/'+_0x3d15ba)[_0xd737('0x17')](_0x24e8b6);}return null;};}function patchUpdates(_0x2ec215){return function(_0x27ec71){try{jsonpatch['apply'](_0x27ec71,_0x2ec215,!![]);}catch(_0x45ac85){return BPromise['reject'](_0x45ac85);}return _0x27ec71[_0xd737('0x1c')]();};}function saveUpdates(_0xaba5de,_0x187bad){return function(_0x2056ae){if(_0x2056ae){return _0x2056ae['update'](_0xaba5de)[_0xd737('0x1d')](function(_0x51ec9f){return _0x51ec9f;});}return null;};}function removeEntity(_0x19ad6d,_0x48a116){return function(_0x31f308){if(_0x31f308){return _0x31f308[_0xd737('0x1e')]()[_0xd737('0x1d')](function(){_0x19ad6d[_0xd737('0x16')](0xcc)[_0xd737('0x1f')]();});}};}function handleEntityNotFound(_0x507029,_0x594e7c){return function(_0x24c6ca){if(!_0x24c6ca){_0x507029[_0xd737('0x15')](0x194);}return _0x24c6ca;};}function handleError(_0x500c68,_0x2641da){_0x2641da=_0x2641da||0x1f4;return function(_0x45aa95){logger[_0xd737('0x20')](_0x45aa95[_0xd737('0x21')]);if(_0x45aa95[_0xd737('0x22')]){delete _0x45aa95[_0xd737('0x22')];}_0x500c68['status'](_0x2641da)[_0xd737('0x23')](_0x45aa95);};}exports[_0xd737('0x24')]=function(_0x20650b,_0x2213f7){var _0x5b6bf7={},_0x53029a={},_0x286c94={'count':0x0,'rows':[]};var _0x484cb4=_[_0xd737('0x25')](db[_0xd737('0x26')]['rawAttributes'],function(_0x2174d1){return{'name':_0x2174d1[_0xd737('0x27')],'type':_0x2174d1[_0xd737('0x28')][_0xd737('0x29')]};});_0x53029a[_0xd737('0x2a')]=_[_0xd737('0x25')](_0x484cb4,'name');_0x53029a[_0xd737('0x2b')]=_[_0xd737('0x2c')](_0x20650b[_0xd737('0x2b')]);_0x53029a[_0xd737('0x2d')]=_[_0xd737('0x2e')](_0x53029a['model'],_0x53029a['query']);_0x5b6bf7['attributes']=_['intersection'](_0x53029a[_0xd737('0x2a')],qs['fields'](_0x20650b[_0xd737('0x2b')][_0xd737('0x2f')]));_0x5b6bf7['attributes']=_0x5b6bf7[_0xd737('0x30')]['length']?_0x5b6bf7[_0xd737('0x30')]:_0x53029a[_0xd737('0x2a')];if(!_0x20650b[_0xd737('0x2b')][_0xd737('0x31')](_0xd737('0x32'))){_0x5b6bf7[_0xd737('0x19')]=qs['limit'](_0x20650b[_0xd737('0x2b')][_0xd737('0x19')]);_0x5b6bf7[_0xd737('0x1b')]=qs[_0xd737('0x1b')](_0x20650b[_0xd737('0x2b')][_0xd737('0x1b')]);}_0x5b6bf7[_0xd737('0x33')]=qs[_0xd737('0x34')](_0x20650b['query'][_0xd737('0x34')]);_0x5b6bf7['where']=qs['filters'](_[_0xd737('0x35')](_0x20650b[_0xd737('0x2b')],_0x53029a[_0xd737('0x2d')]),_0x484cb4);if(_0x20650b[_0xd737('0x2b')]['filter']){_0x5b6bf7[_0xd737('0x36')]=_[_0xd737('0x37')](_0x5b6bf7[_0xd737('0x36')],{'$or':_[_0xd737('0x25')](_0x484cb4,function(_0x13f089){if(_0x13f089[_0xd737('0x28')]!==_0xd737('0x38')){var _0x58f248={};_0x58f248[_0x13f089[_0xd737('0x22')]]={'$like':'%'+_0x20650b['query']['filter']+'%'};return _0x58f248;}})});}_0x5b6bf7=_['merge']({},_0x5b6bf7,_0x20650b[_0xd737('0x39')]);var _0x272ac4={'where':_0x5b6bf7[_0xd737('0x36')]};return db['DeskField']['count'](_0x272ac4)[_0xd737('0x1d')](function(_0xbecece){_0x286c94[_0xd737('0x1a')]=_0xbecece;if(_0x20650b[_0xd737('0x2b')][_0xd737('0x3a')]){_0x5b6bf7[_0xd737('0x3b')]=[{'all':!![]}];}return db[_0xd737('0x26')][_0xd737('0x3c')](_0x5b6bf7);})[_0xd737('0x1d')](function(_0x1585d1){_0x286c94[_0xd737('0x3d')]=_0x1585d1;return _0x286c94;})[_0xd737('0x1d')](respondWithFilteredResult(_0x2213f7,_0x5b6bf7))[_0xd737('0x3e')](handleError(_0x2213f7,null));};exports['show']=function(_0xb3bf0c,_0x2e1dbb){var _0x10c30c={'raw':!![],'where':{'id':_0xb3bf0c[_0xd737('0x3f')]['id']}},_0x5d2f6f={};_0x5d2f6f[_0xd737('0x2a')]=_[_0xd737('0x2c')](db[_0xd737('0x26')]['rawAttributes']);_0x5d2f6f['query']=_[_0xd737('0x2c')](_0xb3bf0c[_0xd737('0x2b')]);_0x5d2f6f[_0xd737('0x2d')]=_['intersection'](_0x5d2f6f[_0xd737('0x2a')],_0x5d2f6f[_0xd737('0x2b')]);_0x10c30c[_0xd737('0x30')]=_[_0xd737('0x2e')](_0x5d2f6f[_0xd737('0x2a')],qs[_0xd737('0x2f')](_0xb3bf0c[_0xd737('0x2b')]['fields']));_0x10c30c['attributes']=_0x10c30c[_0xd737('0x30')]['length']?_0x10c30c[_0xd737('0x30')]:_0x5d2f6f[_0xd737('0x2a')];if(_0xb3bf0c[_0xd737('0x2b')]['includeAll']){_0x10c30c[_0xd737('0x3b')]=[{'all':!![]}];}_0x10c30c=_['merge']({},_0x10c30c,_0xb3bf0c[_0xd737('0x39')]);return db['DeskField'][_0xd737('0x40')](_0x10c30c)[_0xd737('0x1d')](handleEntityNotFound(_0x2e1dbb,null))['then'](respondWithResult(_0x2e1dbb,null))['catch'](handleError(_0x2e1dbb,null));};exports[_0xd737('0x41')]=function(_0x1898de,_0x219575){return db[_0xd737('0x26')][_0xd737('0x41')](_0x1898de[_0xd737('0x42')],{})['then'](respondWithResult(_0x219575,0xc9))[_0xd737('0x3e')](handleError(_0x219575,null));};exports[_0xd737('0x43')]=function(_0x1fc2cf,_0xfcc5c5){if(_0x1fc2cf[_0xd737('0x42')]['id']){delete _0x1fc2cf['body']['id'];}return db[_0xd737('0x26')]['find']({'where':{'id':_0x1fc2cf[_0xd737('0x3f')]['id']}})['then'](handleEntityNotFound(_0xfcc5c5,null))[_0xd737('0x1d')](saveUpdates(_0x1fc2cf['body'],null))[_0xd737('0x1d')](respondWithResult(_0xfcc5c5,null))[_0xd737('0x3e')](handleError(_0xfcc5c5,null));};exports[_0xd737('0x1e')]=function(_0x27424e,_0x3897b9){return db[_0xd737('0x26')][_0xd737('0x40')]({'where':{'id':_0x27424e[_0xd737('0x3f')]['id']}})[_0xd737('0x1d')](handleEntityNotFound(_0x3897b9,null))[_0xd737('0x1d')](removeEntity(_0x3897b9,null))[_0xd737('0x3e')](handleError(_0x3897b9,null));};
\ No newline at end of file
index 5a69597..770812d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b73=['../../config/environment','./intDeskField.attributes','define','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xf43cb,_0x465374){var _0x14e869=function(_0x454719){while(--_0x454719){_0xf43cb['push'](_0xf43cb['shift']());}};_0x14e869(++_0x465374);}(_0x7b73,0xf8));var _0x37b7=function(_0x23dda5,_0x221860){_0x23dda5=_0x23dda5-0x0;var _0x32c24e=_0x7b73[_0x23dda5];return _0x32c24e;};'use strict';var _=require('lodash');var util=require(_0x37b7('0x0'));var logger=require(_0x37b7('0x1'))(_0x37b7('0x2'));var moment=require(_0x37b7('0x3'));var BPromise=require(_0x37b7('0x4'));var rp=require(_0x37b7('0x5'));var fs=require('fs');var path=require(_0x37b7('0x6'));var rimraf=require(_0x37b7('0x7'));var config=require(_0x37b7('0x8'));var attributes=require(_0x37b7('0x9'));module['exports']=function(_0x94d68b,_0x298835){return _0x94d68b[_0x37b7('0xa')](_0x37b7('0xb'),attributes,{'tableName':_0x37b7('0xc'),'paranoid':![],'indexes':[{'name':_0x37b7('0xd'),'fields':[_0x37b7('0xe'),_0x37b7('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb228=['idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','DeskField','desk_unique_index'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb228,0x110));var _0x8b22=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xb228[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0x8b22('0x0'));var util=require(_0x8b22('0x1'));var logger=require(_0x8b22('0x2'))(_0x8b22('0x3'));var moment=require(_0x8b22('0x4'));var BPromise=require(_0x8b22('0x5'));var rp=require(_0x8b22('0x6'));var fs=require('fs');var path=require(_0x8b22('0x7'));var rimraf=require('rimraf');var config=require(_0x8b22('0x8'));var attributes=require('./intDeskField.attributes');module[_0x8b22('0x9')]=function(_0x28732b,_0x42b539){return _0x28732b[_0x8b22('0xa')](_0x8b22('0xb'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x8b22('0xc'),'fields':[_0x8b22('0xd'),_0x8b22('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 8c510f8..cb27982 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd3e=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','util'];(function(_0x8ead78,_0xb37179){var _0x54b3a4=function(_0x4203ce){while(--_0x4203ce){_0x8ead78['push'](_0x8ead78['shift']());}};_0x54b3a4(++_0xb37179);}(_0xfd3e,0xaf));var _0xefd3=function(_0x5da90b,_0x1073c0){_0x5da90b=_0x5da90b-0x0;var _0x67003=_0xfd3e[_0x5da90b];return _0x67003;};'use strict';var _=require('lodash');var util=require(_0xefd3('0x0'));var moment=require(_0xefd3('0x1'));var BPromise=require(_0xefd3('0x2'));var rs=require(_0xefd3('0x3'));var fs=require('fs');var Redis=require(_0xefd3('0x4'));var db=require(_0xefd3('0x5'))['db'];var utils=require(_0xefd3('0x6'));var logger=require(_0xefd3('0x7'))(_0xefd3('0x8'));var config=require(_0xefd3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xefd3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b8439,_0x18f6d4,_0x4cccd1){return new BPromise(function(_0x170b3b,_0x4956df){return client[_0xefd3('0xb')](_0x5b8439,_0x4cccd1)[_0xefd3('0xc')](function(_0x1d19dd){logger[_0xefd3('0xd')](_0xefd3('0xe'),_0x18f6d4,_0xefd3('0xf'));logger[_0xefd3('0x10')]('DeskField,\x20%s,\x20%s,\x20%s',_0x18f6d4,_0xefd3('0xf'),JSON[_0xefd3('0x11')](_0x1d19dd));if(_0x1d19dd['error']){if(_0x1d19dd['error']['code']===0x1f4){logger[_0xefd3('0x12')](_0xefd3('0xe'),_0x18f6d4,_0x1d19dd['error']['message']);return _0x4956df(_0x1d19dd['error'][_0xefd3('0x13')]);}logger[_0xefd3('0x12')]('DeskField,\x20%s,\x20%s',_0x18f6d4,_0x1d19dd[_0xefd3('0x12')][_0xefd3('0x13')]);return _0x170b3b(_0x1d19dd[_0xefd3('0x12')][_0xefd3('0x13')]);}else{logger[_0xefd3('0xd')](_0xefd3('0xe'),_0x18f6d4,'request\x20sent');_0x170b3b(_0x1d19dd[_0xefd3('0x14')][_0xefd3('0x13')]);}})[_0xefd3('0x15')](function(_0x439f96){logger[_0xefd3('0x12')](_0xefd3('0xe'),_0x18f6d4,_0x439f96);_0x4956df(_0x439f96);});});}
\ No newline at end of file
+var _0x39cd=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','DeskField,\x20%s,\x20%s','debug','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','util','moment','bluebird','randomstring','ioredis'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x39cd,0x175));var _0xd39c=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x39cd[_0x599f41];return _0x2e4d58;};'use strict';var _=require('lodash');var util=require(_0xd39c('0x0'));var moment=require(_0xd39c('0x1'));var BPromise=require(_0xd39c('0x2'));var rs=require(_0xd39c('0x3'));var fs=require('fs');var Redis=require(_0xd39c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd39c('0x5'));var logger=require(_0xd39c('0x6'))(_0xd39c('0x7'));var config=require(_0xd39c('0x8'));var jayson=require(_0xd39c('0x9'));var client=jayson[_0xd39c('0xa')][_0xd39c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x408e88,_0xbdbda0,_0x261101){return new BPromise(function(_0x2b324a,_0x922a32){return client['request'](_0x408e88,_0x261101)['then'](function(_0x4b3484){logger['info'](_0xd39c('0xc'),_0xbdbda0,'request\x20sent');logger[_0xd39c('0xd')](_0xd39c('0xe'),_0xbdbda0,_0xd39c('0xf'),JSON[_0xd39c('0x10')](_0x4b3484));if(_0x4b3484[_0xd39c('0x11')]){if(_0x4b3484[_0xd39c('0x11')]['code']===0x1f4){logger[_0xd39c('0x11')](_0xd39c('0xc'),_0xbdbda0,_0x4b3484['error'][_0xd39c('0x12')]);return _0x922a32(_0x4b3484[_0xd39c('0x11')][_0xd39c('0x12')]);}logger[_0xd39c('0x11')]('DeskField,\x20%s,\x20%s',_0xbdbda0,_0x4b3484['error'][_0xd39c('0x12')]);return _0x2b324a(_0x4b3484['error'][_0xd39c('0x12')]);}else{logger[_0xd39c('0x13')](_0xd39c('0xc'),_0xbdbda0,'request\x20sent');_0x2b324a(_0x4b3484[_0xd39c('0x14')][_0xd39c('0x12')]);}})['catch'](function(_0xc0add7){logger['error'](_0xd39c('0xc'),_0xbdbda0,_0xc0add7);_0x922a32(_0xc0add7);});});}
\ No newline at end of file
index 8f047bb..bb0e8f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfda6=['/:id','/:id/configurations','getFields','post','create','addConfiguration','put','update','destroy','multer','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x184e10,_0x5737aa){var _0x561e61=function(_0x4f6639){while(--_0x4f6639){_0x184e10['push'](_0x184e10['shift']());}};_0x561e61(++_0x5737aa);}(_0xfda6,0x190));var _0x6fda=function(_0x4fc185,_0x42e72a){_0x4fc185=_0x4fc185-0x0;var _0x3f9d43=_0xfda6[_0x4fc185];return _0x3f9d43;};'use strict';var multer=require(_0x6fda('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6fda('0x1'));var router=express[_0x6fda('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6fda('0x3'));var config=require(_0x6fda('0x4'));var controller=require('./intDynamics365Account.controller');router[_0x6fda('0x5')]('/',auth[_0x6fda('0x6')](),controller[_0x6fda('0x7')]);router[_0x6fda('0x5')](_0x6fda('0x8'),auth[_0x6fda('0x6')](),controller['show']);router[_0x6fda('0x5')](_0x6fda('0x9'),auth[_0x6fda('0x6')](),controller['getConfigurations']);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0x6fda('0xa')]);router[_0x6fda('0xb')]('/',auth[_0x6fda('0x6')](),controller[_0x6fda('0xc')]);router[_0x6fda('0xb')]('/:id/configurations',auth[_0x6fda('0x6')](),controller[_0x6fda('0xd')]);router[_0x6fda('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x6fda('0xf')]);router['delete']('/:id',auth[_0x6fda('0x6')](),controller[_0x6fda('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0xa01b=['show','/:id/configurations','getConfigurations','getFields','post','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x57add2,_0x4f2b7d){var _0x4e3670=function(_0x3311b){while(--_0x3311b){_0x57add2['push'](_0x57add2['shift']());}};_0x4e3670(++_0x4f2b7d);}(_0xa01b,0x173));var _0xba01=function(_0xb59c65,_0x25e5ae){_0xb59c65=_0xb59c65-0x0;var _0x264ae5=_0xa01b[_0xb59c65];return _0x264ae5;};'use strict';var multer=require(_0xba01('0x0'));var util=require(_0xba01('0x1'));var path=require(_0xba01('0x2'));var timeout=require(_0xba01('0x3'));var express=require(_0xba01('0x4'));var router=express[_0xba01('0x5')]();var fs_extra=require(_0xba01('0x6'));var auth=require(_0xba01('0x7'));var interaction=require(_0xba01('0x8'));var config=require(_0xba01('0x9'));var controller=require('./intDynamics365Account.controller');router[_0xba01('0xa')]('/',auth[_0xba01('0xb')](),controller[_0xba01('0xc')]);router[_0xba01('0xa')]('/:id',auth[_0xba01('0xb')](),controller[_0xba01('0xd')]);router[_0xba01('0xa')](_0xba01('0xe'),auth[_0xba01('0xb')](),controller[_0xba01('0xf')]);router[_0xba01('0xa')]('/:id/fields',auth[_0xba01('0xb')](),controller[_0xba01('0x10')]);router[_0xba01('0x11')]('/',auth[_0xba01('0xb')](),controller[_0xba01('0x12')]);router[_0xba01('0x11')](_0xba01('0xe'),auth['isAuthenticated'](),controller['addConfiguration']);router['put'](_0xba01('0x13'),auth['isAuthenticated'](),controller[_0xba01('0x14')]);router[_0xba01('0x15')](_0xba01('0x13'),auth[_0xba01('0xb')](),controller[_0xba01('0x16')]);module[_0xba01('0x17')]=router;
\ No newline at end of file
index 0948f01..7eed859 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x873a=['STRING','BOOLEAN','sequelize','exports'];(function(_0x4db1d8,_0x3a673f){var _0x2a8f8c=function(_0x251ce0){while(--_0x251ce0){_0x4db1d8['push'](_0x4db1d8['shift']());}};_0x2a8f8c(++_0x3a673f);}(_0x873a,0x1c2));var _0xa873=function(_0x3d9c04,_0x984f36){_0x3d9c04=_0x3d9c04-0x0;var _0x3a8f74=_0x873a[_0x3d9c04];return _0x3a8f74;};'use strict';var Sequelize=require(_0xa873('0x0'));module[_0xa873('0x1')]={'name':{'type':Sequelize[_0xa873('0x2')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xa873('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xa873('0x2')]},'clientSecret':{'type':Sequelize[_0xa873('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xa873('0x2')]},'modernAuthentication':{'type':Sequelize[_0xa873('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xb138=['sequelize','exports','STRING'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0xb138,0x1dd));var _0x8b13=function(_0x707427,_0x474925){_0x707427=_0x707427-0x0;var _0x9d9a79=_0xb138[_0x707427];return _0x9d9a79;};'use strict';var Sequelize=require(_0x8b13('0x0'));module[_0x8b13('0x1')]={'name':{'type':Sequelize[_0x8b13('0x2')]},'username':{'type':Sequelize[_0x8b13('0x2')]},'password':{'type':Sequelize[_0x8b13('0x2')]},'remoteUri':{'type':Sequelize[_0x8b13('0x2')]},'tenantId':{'type':Sequelize[_0x8b13('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x8b13('0x2')]},'serverUrl':{'type':Sequelize[_0x8b13('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8b13('0x2')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
index 1df9415..2c543fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc3b7=['../../config/logger','api','../../mysqldb','../../components/integrations/configuration','json','offset','undefined','limit','count','status','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','map','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','includeAll','include','rows','show','params','options','Dynamics365Account','catch','create','body','find','getConfigurations','findOne','Dynamics365Configuration','pick','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','Dynamics365Field','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','PhoneCall','title','customerid','subject','regardingobjectid','directioncode','actualserviceunits','billedserviceunits','contactidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridtype','customeridyominame','emailaddress','entityimage_timestamp','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responsiblecontactidname','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','subjectidname','ticketnumber','timezoneruleversionnumber','traversedpath','versionnumber','username','password','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data7','access_token','data5','remoteUri','POST','https://login.microsoftonline.com/','/oauth2/token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','remove','LogicalName','@odata.type','PicklistAttributeMetadata','push','all','forEach','isNil','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','concat','statusCode','test','Wrong\x20credentials',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','FalseOption',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','DisplayName','util','lodash','../../components/parsers/qs'];(function(_0x366e51,_0x3a0178){var _0x4e23e3=function(_0x7ecebe){while(--_0x7ecebe){_0x366e51['push'](_0x366e51['shift']());}};_0x4e23e3(++_0x3a0178);}(_0xc3b7,0xb4));var _0x7c3b=function(_0x7965f8,_0x543450){_0x7965f8=_0x7965f8-0x0;var _0x3ceea6=_0xc3b7[_0x7965f8];return _0x3ceea6;};'use strict';var rp=require('request-promise');var util=require(_0x7c3b('0x0'));var _=require(_0x7c3b('0x1'));var qs=require(_0x7c3b('0x2'));var logger=require(_0x7c3b('0x3'))(_0x7c3b('0x4'));var db=require(_0x7c3b('0x5'))['db'];var integrations=require(_0x7c3b('0x6'));function respondWithResult(_0x363234,_0xd931d7){_0xd931d7=_0xd931d7||0xc8;return function(_0x4989f7){if(_0x4989f7){return _0x363234['status'](_0xd931d7)[_0x7c3b('0x7')](_0x4989f7);}};}function respondWithFilteredResult(_0x40ef6a,_0x208213){return function(_0x1bc2d8){if(_0x1bc2d8){var _0x47d9a7=typeof _0x208213[_0x7c3b('0x8')]===_0x7c3b('0x9')&&typeof _0x208213[_0x7c3b('0xa')]===_0x7c3b('0x9');var _0x1ddba3=_0x1bc2d8[_0x7c3b('0xb')];var _0x23f373=_0x47d9a7?0x0:_0x208213[_0x7c3b('0x8')];var _0xeb699f=_0x47d9a7?_0x1bc2d8[_0x7c3b('0xb')]:_0x208213[_0x7c3b('0x8')]+_0x208213[_0x7c3b('0xa')];var _0x160e68;if(_0xeb699f>=_0x1ddba3){_0xeb699f=_0x1ddba3;_0x160e68=0xc8;}else{_0x160e68=0xce;}_0x40ef6a[_0x7c3b('0xc')](_0x160e68);return _0x40ef6a['set'](_0x7c3b('0xd'),_0x23f373+'-'+_0xeb699f+'/'+_0x1ddba3)[_0x7c3b('0x7')](_0x1bc2d8);}return null;};}function saveUpdates(_0x4c7871){return function(_0x896ec3){if(_0x896ec3){return _0x896ec3[_0x7c3b('0xe')](_0x4c7871)[_0x7c3b('0xf')](function(_0x5a4512){return _0x5a4512;});}return null;};}function removeEntity(_0x1ea1d1){return function(_0x2fe0d8){if(_0x2fe0d8){return _0x2fe0d8[_0x7c3b('0x10')]()[_0x7c3b('0xf')](function(){_0x1ea1d1['status'](0xcc)[_0x7c3b('0x11')]();});}};}function handleEntityNotFound(_0x1bff9a){return function(_0x508f5c){if(!_0x508f5c){_0x1bff9a[_0x7c3b('0x12')](0x194);}return _0x508f5c;};}function handleError(_0x128f02,_0x42c1f6){_0x42c1f6=_0x42c1f6||0x1f4;return function(_0xd3991c){logger[_0x7c3b('0x13')](_0xd3991c[_0x7c3b('0x14')]);if(_0xd3991c['name']){delete _0xd3991c[_0x7c3b('0x15')];}_0x128f02['status'](_0x42c1f6)[_0x7c3b('0x16')](_0xd3991c);};}exports['index']=function(_0x144f5f,_0x4f5048){var _0x24fcce={},_0x7ef72d={},_0x173d80={'count':0x0,'rows':[]};var _0x92aafd=_[_0x7c3b('0x17')](db['Dynamics365Account'][_0x7c3b('0x18')],function(_0x3db3f9){return{'name':_0x3db3f9['fieldName'],'type':_0x3db3f9[_0x7c3b('0x19')]['key']};});_0x7ef72d[_0x7c3b('0x1a')]=_[_0x7c3b('0x17')](_0x92aafd,_0x7c3b('0x15'));_0x7ef72d[_0x7c3b('0x1b')]=_[_0x7c3b('0x1c')](_0x144f5f[_0x7c3b('0x1b')]);_0x7ef72d[_0x7c3b('0x1d')]=_['intersection'](_0x7ef72d['model'],_0x7ef72d['query']);_0x24fcce[_0x7c3b('0x1e')]=_[_0x7c3b('0x1f')](_0x7ef72d[_0x7c3b('0x1a')],qs[_0x7c3b('0x20')](_0x144f5f[_0x7c3b('0x1b')]['fields']));_0x24fcce[_0x7c3b('0x1e')]=_0x24fcce['attributes'][_0x7c3b('0x21')]?_0x24fcce[_0x7c3b('0x1e')]:_0x7ef72d['model'];if(!_0x144f5f[_0x7c3b('0x1b')][_0x7c3b('0x22')](_0x7c3b('0x23'))){_0x24fcce[_0x7c3b('0xa')]=qs['limit'](_0x144f5f[_0x7c3b('0x1b')]['limit']);_0x24fcce[_0x7c3b('0x8')]=qs['offset'](_0x144f5f[_0x7c3b('0x1b')]['offset']);}_0x24fcce[_0x7c3b('0x24')]=qs[_0x7c3b('0x25')](_0x144f5f['query'][_0x7c3b('0x25')]);_0x24fcce[_0x7c3b('0x26')]=qs[_0x7c3b('0x1d')](_['pick'](_0x144f5f[_0x7c3b('0x1b')],_0x7ef72d[_0x7c3b('0x1d')]),_0x92aafd);if(_0x144f5f[_0x7c3b('0x1b')]['filter']){_0x24fcce['where']=_['merge'](_0x24fcce[_0x7c3b('0x26')],{'$or':_['map'](_0x92aafd,function(_0x547dfc){if(_0x547dfc[_0x7c3b('0x19')]!=='VIRTUAL'){var _0x79efe3={};_0x79efe3[_0x547dfc[_0x7c3b('0x15')]]={'$like':'%'+_0x144f5f[_0x7c3b('0x1b')][_0x7c3b('0x27')]+'%'};return _0x79efe3;}})});}_0x24fcce=_[_0x7c3b('0x28')]({},_0x24fcce,_0x144f5f['options']);var _0x74e585={'where':_0x24fcce[_0x7c3b('0x26')]};return db['Dynamics365Account'][_0x7c3b('0xb')](_0x74e585)[_0x7c3b('0xf')](function(_0x4a3190){_0x173d80['count']=_0x4a3190;if(_0x144f5f['query'][_0x7c3b('0x29')]){_0x24fcce[_0x7c3b('0x2a')]=[{'all':!![]}];}return db['Dynamics365Account']['findAll'](_0x24fcce);})[_0x7c3b('0xf')](function(_0x185662){_0x173d80[_0x7c3b('0x2b')]=_0x185662;return _0x173d80;})['then'](respondWithFilteredResult(_0x4f5048,_0x24fcce))['catch'](handleError(_0x4f5048,null));};exports[_0x7c3b('0x2c')]=function(_0x34dab6,_0x35a452){var _0x15b3c6={'raw':![],'where':{'id':_0x34dab6[_0x7c3b('0x2d')]['id']}},_0x2dce0e={};_0x2dce0e['model']=_[_0x7c3b('0x1c')](db['Dynamics365Account'][_0x7c3b('0x18')]);_0x2dce0e[_0x7c3b('0x1b')]=_[_0x7c3b('0x1c')](_0x34dab6[_0x7c3b('0x1b')]);_0x2dce0e['filters']=_[_0x7c3b('0x1f')](_0x2dce0e[_0x7c3b('0x1a')],_0x2dce0e[_0x7c3b('0x1b')]);_0x15b3c6[_0x7c3b('0x1e')]=_[_0x7c3b('0x1f')](_0x2dce0e[_0x7c3b('0x1a')],qs[_0x7c3b('0x20')](_0x34dab6[_0x7c3b('0x1b')]['fields']));_0x15b3c6[_0x7c3b('0x1e')]=_0x15b3c6[_0x7c3b('0x1e')]['length']?_0x15b3c6['attributes']:_0x2dce0e[_0x7c3b('0x1a')];if(_0x34dab6[_0x7c3b('0x1b')][_0x7c3b('0x29')]){_0x15b3c6[_0x7c3b('0x2a')]=[{'all':!![]}];}_0x15b3c6=_[_0x7c3b('0x28')]({},_0x15b3c6,_0x34dab6[_0x7c3b('0x2e')]);return db[_0x7c3b('0x2f')]['find'](_0x15b3c6)[_0x7c3b('0xf')](handleEntityNotFound(_0x35a452,null))[_0x7c3b('0xf')](respondWithResult(_0x35a452,null))[_0x7c3b('0x30')](handleError(_0x35a452,null));};exports[_0x7c3b('0x31')]=function(_0x2213f9,_0x2ed7fa){return db['Dynamics365Account']['create'](_0x2213f9[_0x7c3b('0x32')],{})[_0x7c3b('0xf')](respondWithResult(_0x2ed7fa,0xc9))[_0x7c3b('0x30')](handleError(_0x2ed7fa,null));};exports['update']=function(_0x4bc2a1,_0x28fbaa){if(_0x4bc2a1[_0x7c3b('0x32')]['id']){delete _0x4bc2a1['body']['id'];}return db[_0x7c3b('0x2f')]['find']({'where':{'id':_0x4bc2a1['params']['id']}})[_0x7c3b('0xf')](handleEntityNotFound(_0x28fbaa,null))[_0x7c3b('0xf')](saveUpdates(_0x4bc2a1[_0x7c3b('0x32')],null))[_0x7c3b('0xf')](respondWithResult(_0x28fbaa,null))[_0x7c3b('0x30')](handleError(_0x28fbaa,null));};exports[_0x7c3b('0x10')]=function(_0x5e096c,_0x40e3bb){return db[_0x7c3b('0x2f')][_0x7c3b('0x33')]({'where':{'id':_0x5e096c[_0x7c3b('0x2d')]['id']}})[_0x7c3b('0xf')](handleEntityNotFound(_0x40e3bb,null))[_0x7c3b('0xf')](removeEntity(_0x40e3bb,null))[_0x7c3b('0x30')](handleError(_0x40e3bb,null));};exports[_0x7c3b('0x34')]=function(_0xf8b449,_0x353b83){var _0x3a01ab={};var _0x31f313={};var _0x303fbd;var _0x40798d;return db[_0x7c3b('0x2f')][_0x7c3b('0x35')]({'where':{'id':_0xf8b449[_0x7c3b('0x2d')]['id']}})[_0x7c3b('0xf')](handleEntityNotFound(_0x353b83,null))[_0x7c3b('0xf')](function(_0x5571db){if(_0x5571db){_0x303fbd=_0x5571db;_0x31f313[_0x7c3b('0x1a')]=_[_0x7c3b('0x1c')](db[_0x7c3b('0x36')][_0x7c3b('0x18')]);_0x31f313[_0x7c3b('0x1b')]=_['keys'](_0xf8b449[_0x7c3b('0x1b')]);_0x31f313[_0x7c3b('0x1d')]=_[_0x7c3b('0x1f')](_0x31f313[_0x7c3b('0x1a')],_0x31f313[_0x7c3b('0x1b')]);_0x3a01ab['attributes']=_[_0x7c3b('0x1f')](_0x31f313['model'],qs['fields'](_0xf8b449[_0x7c3b('0x1b')][_0x7c3b('0x20')]));_0x3a01ab[_0x7c3b('0x1e')]=_0x3a01ab[_0x7c3b('0x1e')][_0x7c3b('0x21')]?_0x3a01ab[_0x7c3b('0x1e')]:_0x31f313[_0x7c3b('0x1a')];_0x3a01ab[_0x7c3b('0x24')]=qs[_0x7c3b('0x25')](_0xf8b449[_0x7c3b('0x1b')]['sort']);_0x3a01ab[_0x7c3b('0x26')]=qs[_0x7c3b('0x1d')](_[_0x7c3b('0x37')](_0xf8b449[_0x7c3b('0x1b')],_0x31f313[_0x7c3b('0x1d')]));if(_0xf8b449[_0x7c3b('0x1b')][_0x7c3b('0x27')]){_0x3a01ab[_0x7c3b('0x26')]=_[_0x7c3b('0x28')](_0x3a01ab[_0x7c3b('0x26')],{'$or':_['map'](_0x3a01ab[_0x7c3b('0x1e')],function(_0xcea59){var _0x14d785={};_0x14d785[_0xcea59]={'$like':'%'+_0xf8b449['query'][_0x7c3b('0x27')]+'%'};return _0x14d785;})});}_0x3a01ab=_[_0x7c3b('0x28')]({},_0x3a01ab,_0xf8b449[_0x7c3b('0x2e')]);return _0x303fbd[_0x7c3b('0x34')](_0x3a01ab);}})['then'](function(_0x37f046){if(_0x37f046){_0x40798d=_0x37f046[_0x7c3b('0x21')];if(!_0xf8b449['query'][_0x7c3b('0x22')]('nolimit')){_0x3a01ab[_0x7c3b('0xa')]=qs[_0x7c3b('0xa')](_0xf8b449[_0x7c3b('0x1b')]['limit']);_0x3a01ab['offset']=qs['offset'](_0xf8b449[_0x7c3b('0x1b')][_0x7c3b('0x8')]);}return _0x303fbd['getConfigurations'](_0x3a01ab);}})['then'](function(_0x40824e){if(_0x40824e){return _0x40824e?{'count':_0x40798d,'rows':_0x40824e}:null;}})[_0x7c3b('0xf')](respondWithResult(_0x353b83,null))[_0x7c3b('0x30')](handleError(_0x353b83,null));};exports['addConfiguration']=function(_0x1f7a5c,_0x3fc8a3){if(_0x1f7a5c['body']['id']){delete _0x1f7a5c[_0x7c3b('0x32')]['id'];}return db['Dynamics365Account'][_0x7c3b('0x35')]({'where':{'id':_0x1f7a5c[_0x7c3b('0x2d')]['id']}})[_0x7c3b('0xf')](handleEntityNotFound(_0x3fc8a3,null))[_0x7c3b('0xf')](function(_0x482033){if(_0x482033){_0x1f7a5c[_0x7c3b('0x32')][_0x7c3b('0x38')]=_0x482033['id'];_0x1f7a5c[_0x7c3b('0x32')][_0x7c3b('0x39')]=integrations[_0x7c3b('0x3a')](_0x1f7a5c['body']['channel'],_0x1f7a5c[_0x7c3b('0x32')][_0x7c3b('0x19')]);_0x1f7a5c[_0x7c3b('0x32')][_0x7c3b('0x3b')]=integrations[_0x7c3b('0x3c')](_0x1f7a5c[_0x7c3b('0x32')][_0x7c3b('0x3d')],_0x1f7a5c[_0x7c3b('0x32')][_0x7c3b('0x19')]);return db[_0x7c3b('0x36')][_0x7c3b('0x31')](_0x1f7a5c[_0x7c3b('0x32')],{'include':[{'model':db['Dynamics365Field'],'as':'Subjects'},{'model':db[_0x7c3b('0x3e')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x3fc8a3,null))[_0x7c3b('0x30')](handleError(_0x3fc8a3,null));};function sanitizeRemoteUri(_0x1554d1){var _0x17398e=_0x1554d1['slice'](-0x1);if(_0x17398e==='/')return _0x1554d1[_0x7c3b('0x3f')](0x0,_0x1554d1[_0x7c3b('0x40')](_0x17398e));return _0x1554d1;}function getWebApiUrl(_0x11625a){return util[_0x7c3b('0x41')](_0x7c3b('0x42'),_0x11625a);}exports[_0x7c3b('0x43')]=function(_0x41d134,_0x1671cb){var _0x24f8b2=_0x41d134[_0x7c3b('0x1b')][_0x7c3b('0x44')];var _0x51c140=_0x24f8b2===_0x7c3b('0x45')?_0x7c3b('0x46'):_0x7c3b('0x47');var _0x1ddaae='';var _0x464c71='';var _0x2c8c8f='';var _0x53500e='';var _0xa0586='';var _0x19f04d='';var _0x6db91e='';var _0x5a0bee='';var _0x2320a9=[_0x7c3b('0x48'),'description',_0x7c3b('0x49'),'ownerid','caseorigincode',_0x7c3b('0x4a'),'phonenumber',_0x7c3b('0x4b'),_0x7c3b('0x4c'),'phonecall_activity_parties'];var _0x5caaee=['accountidname','accountidyominame',_0x7c3b('0x4d'),_0x7c3b('0x4e'),_0x7c3b('0x4f'),'contactidyominame','contractdetailidname',_0x7c3b('0x50'),_0x7c3b('0x51'),_0x7c3b('0x52'),'createdbyname','createdbyyominame',_0x7c3b('0x53'),_0x7c3b('0x54'),_0x7c3b('0x55'),'customeridname',_0x7c3b('0x56'),_0x7c3b('0x57'),_0x7c3b('0x58'),'entitlementidname',_0x7c3b('0x59'),'entityimage_url',_0x7c3b('0x5a'),_0x7c3b('0x5b'),_0x7c3b('0x5c'),_0x7c3b('0x5d'),_0x7c3b('0x5e'),_0x7c3b('0x5f'),_0x7c3b('0x60'),_0x7c3b('0x61'),_0x7c3b('0x62'),_0x7c3b('0x63'),_0x7c3b('0x64'),'modifiedbyname',_0x7c3b('0x65'),'modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame',_0x7c3b('0x66'),_0x7c3b('0x67'),_0x7c3b('0x68'),_0x7c3b('0x69'),_0x7c3b('0x6a'),_0x7c3b('0x6b'),'owneridtype',_0x7c3b('0x6c'),_0x7c3b('0x6d'),_0x7c3b('0x6e'),_0x7c3b('0x6f'),_0x7c3b('0x70'),_0x7c3b('0x71'),_0x7c3b('0x72'),_0x7c3b('0x73'),_0x7c3b('0x74'),'responseby',_0x7c3b('0x75'),'responsiblecontactidyominame',_0x7c3b('0x76'),_0x7c3b('0x77'),_0x7c3b('0x78'),_0x7c3b('0x79'),_0x7c3b('0x7a'),'statuscode',_0x7c3b('0x7b'),_0x7c3b('0x7c'),_0x7c3b('0x7d'),'transactioncurrencyidname',_0x7c3b('0x7e'),'utcconversiontimezonecode',_0x7c3b('0x7f')];var _0x29a766=_0x2320a9['concat'](_0x5caaee);return db[_0x7c3b('0x2f')][_0x7c3b('0x35')]({'where':{'id':_0x41d134[_0x7c3b('0x2d')]['id']},'attributes':['id',_0x7c3b('0x80'),_0x7c3b('0x81'),'remoteUri',_0x7c3b('0x82'),_0x7c3b('0x83'),_0x7c3b('0x84'),_0x7c3b('0x85')],'include':[{'model':db[_0x7c3b('0x86')],'as':_0x7c3b('0x86'),'attributes':['id','data5',_0x7c3b('0x87')]}]})[_0x7c3b('0xf')](handleEntityNotFound(_0x1671cb,null))[_0x7c3b('0xf')](function(_0x402d64){if(_0x402d64){if(_0x402d64[_0x7c3b('0x85')]){_0x402d64[_0x7c3b('0x88')]=_0x402d64[_0x7c3b('0x86')][_0x7c3b('0x89')];_0x5a0bee=sanitizeRemoteUri(_0x402d64['CloudProvider'][_0x7c3b('0x87')]);_0x6db91e=getWebApiUrl(_0x5a0bee);return _0x402d64;}_0x5a0bee=sanitizeRemoteUri(_0x402d64[_0x7c3b('0x8a')]);_0x6db91e=getWebApiUrl(_0x5a0bee);var _0x24fa0c={'method':_0x7c3b('0x8b'),'uri':_0x7c3b('0x8c')+_0x402d64['tenantId']+_0x7c3b('0x8d'),'form':{'client_id':_0x402d64['clientId'],'resource':_0x5a0bee,'username':_0x402d64['username'],'password':_0x402d64[_0x7c3b('0x81')],'grant_type':'password','client_secret':_0x402d64['clientSecret']},'json':!![]};return rp(_0x24fa0c);}})[_0x7c3b('0xf')](function(_0x28e6b6){_0x19f04d=_0x28e6b6[_0x7c3b('0x88')];var _0x41b6a4={'method':'GET','uri':encodeURI(_0x6db91e+_0x7c3b('0x8e')+_0x51c140+'\x27'),'headers':{'Authorization':_0x7c3b('0x8f')+_0x19f04d,'If-None-Match':null,'OData-Version':_0x7c3b('0x90')},'json':!![]};return rp(_0x41b6a4);})[_0x7c3b('0xf')](function(_0x5e3c8e){var _0x4f5da9=_0x5e3c8e[_0x7c3b('0x91')][0x0];var _0x2cbd1d=_0x4f5da9[_0x7c3b('0x92')];var _0x359b59={'method':_0x7c3b('0x93'),'uri':_0x6db91e+_0x7c3b('0x94')+_0x2cbd1d+_0x7c3b('0x95'),'headers':{'Authorization':_0x7c3b('0x8f')+_0x19f04d,'If-None-Match':null,'OData-Version':_0x7c3b('0x90')},'json':!![]};return rp(_0x359b59);})[_0x7c3b('0xf')](function(_0x13ef2c){_0x1ddaae=_0x13ef2c;_0x464c71=_0x1ddaae['Attributes'];_0x464c71=_[_0x7c3b('0x96')](_0x464c71,function(_0x10b32d){return!_0x29a766['includes'](_0x10b32d[_0x7c3b('0x97')]);});var _0x188ec2=[];var _0x5ca8ca=[];_0x464c71['forEach'](function(_0x37df13){if(_0x37df13[_0x7c3b('0x98')]){var _0x455b69=_0x37df13[_0x7c3b('0x98')][_0x7c3b('0x3f')](_0x37df13[_0x7c3b('0x98')][_0x7c3b('0x40')]('.')+0x1);if(_0x455b69===_0x7c3b('0x99')){_0x188ec2[_0x7c3b('0x9a')](getSelectList(_0x6db91e,_0x24f8b2,_0x5ca8ca,_0x1ddaae[_0x7c3b('0x92')],_0x37df13['MetadataId'],_0x19f04d));}}});return Promise[_0x7c3b('0x9b')](_0x188ec2);})[_0x7c3b('0xf')](function(_0x14a63e){_0x2c8c8f=_0x14a63e[0x0];var _0x1b18af=[];var _0x33ec39=[];_0x464c71[_0x7c3b('0x9c')](function(_0x412b40){if(!_[_0x7c3b('0x9d')](_0x412b40[_0x7c3b('0x98')])){var _0x384668=_0x412b40[_0x7c3b('0x98')][_0x7c3b('0x3f')](_0x412b40['@odata.type']['lastIndexOf']('.')+0x1);if(_0x384668==='BooleanAttributeMetadata'){_0x1b18af[_0x7c3b('0x9a')](getBooleanList(_0x6db91e,_0x24f8b2,_0x33ec39,_0x1ddaae[_0x7c3b('0x92')],_0x412b40['MetadataId'],_0x19f04d));}}});return Promise[_0x7c3b('0x9b')](_0x1b18af);})['then'](function(_0x280184){_0x53500e=_0x280184[0x0];var _0x38f99f=[];var _0x2ae289=[];_0x464c71[_0x7c3b('0x9c')](function(_0x309493){if(_0x309493[_0x7c3b('0x98')]){var _0x7f0fd7=_0x309493[_0x7c3b('0x98')]['substring'](_0x309493[_0x7c3b('0x98')][_0x7c3b('0x40')]('.')+0x1);if(_0x7f0fd7===_0x7c3b('0x9e')||_0x7f0fd7===_0x7c3b('0x9f')||_0x7f0fd7===_0x7c3b('0xa0')||_0x7f0fd7===_0x7c3b('0xa1')||_0x7f0fd7===_0x7c3b('0xa2')||_0x7f0fd7===_0x7c3b('0xa3')||_0x7f0fd7===_0x7c3b('0xa4')||_0x7f0fd7===_0x7c3b('0xa5')||_0x7f0fd7==='StateAttributeMetadata'||_0x7f0fd7==='DecimalAttributeMetadata'){_0x38f99f['push'](getInputList(_0x6db91e,_0x24f8b2,_0x7f0fd7,_0x2ae289,_0x1ddaae['MetadataId'],_0x309493['MetadataId'],_0x19f04d));}}});return Promise[_0x7c3b('0x9b')](_0x38f99f);})[_0x7c3b('0xf')](function(_0x4948bb){_0xa0586=_0x4948bb[0x0];var _0x3e3875=_0x2c8c8f['concat'](_0x53500e)[_0x7c3b('0xa6')](_0xa0586);var _0x1acbcc={'count':_0x3e3875[_0x7c3b('0x21')],'rows':_0x3e3875};return _0x1acbcc;})[_0x7c3b('0xf')](respondWithResult(_0x1671cb,null))[_0x7c3b('0x30')](function(_0x6c7d42){var _0x41d4a5=_0x41d134[_0x7c3b('0x1b')]['test']?0x1f4:_0x6c7d42[_0x7c3b('0xa7')]||0x1f4;logger[_0x7c3b('0x13')](_0x6c7d42[_0x7c3b('0x14')]);delete _0x6c7d42[_0x7c3b('0x15')];if(_0x41d4a5===0x191){_0x41d4a5=0x190;}_0x1671cb['status'](_0x41d4a5)[_0x7c3b('0x16')](_0x41d134[_0x7c3b('0x1b')][_0x7c3b('0xa8')]?{'message':_0x7c3b('0xa9'),'statusCode':_0x6c7d42['statusCode']}:_0x6c7d42);});};function getSelectList(_0x5045d4,_0x3d33bc,_0x4b12af,_0xa37739,_0x32080,_0x588397){var _0x15ba7e={'method':_0x7c3b('0x93'),'uri':_0x5045d4+'EntityDefinitions('+_0xa37739+_0x7c3b('0xaa')+_0x32080+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x7c3b('0xab'),'headers':{'Authorization':'Bearer\x20'+_0x588397,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x15ba7e)['then'](function(_0x332142){var _0x55b29c=[];var _0x5e1cbc=_0x332142[_0x7c3b('0xac')][_0x7c3b('0xad')];_0x5e1cbc[_0x7c3b('0x9c')](function(_0x14fd39){_0x55b29c[_0x7c3b('0x9a')]({'name':_0x14fd39[_0x7c3b('0xae')][_0x7c3b('0xaf')][_0x7c3b('0xae')],'value':String(_0x14fd39[_0x7c3b('0xb0')])});});var _0x2123fd={'id':_0x3d33bc+'_'+_0x332142[_0x7c3b('0x97')],'name':_0x332142['DisplayName'][_0x7c3b('0xaf')]['Label'],'custom':![],'options':_0x55b29c};_0x4b12af[_0x7c3b('0x9a')](_0x2123fd);return _0x4b12af;});}function getBooleanList(_0x2f7177,_0x1f8862,_0x20f1a8,_0x2d7301,_0x1972eb,_0x5b0bb1){var _0x44fa75={'method':'GET','uri':_0x2f7177+_0x7c3b('0x94')+_0x2d7301+_0x7c3b('0xaa')+_0x1972eb+_0x7c3b('0xb1'),'headers':{'Authorization':_0x7c3b('0x8f')+_0x5b0bb1,'If-None-Match':null,'OData-Version':_0x7c3b('0x90')},'json':!![]};return rp(_0x44fa75)[_0x7c3b('0xf')](function(_0xab3a7d){var _0x5b1163=[];_0x5b1163[_0x7c3b('0x9a')]({'name':_0xab3a7d[_0x7c3b('0xac')][_0x7c3b('0xb2')][_0x7c3b('0xae')]['UserLocalizedLabel']['Label'],'value':'true'},{'name':_0xab3a7d[_0x7c3b('0xac')][_0x7c3b('0xb3')][_0x7c3b('0xae')]['UserLocalizedLabel'][_0x7c3b('0xae')],'value':'false'});var _0x4bd861={'id':_0x1f8862+'_'+_0xab3a7d['LogicalName'],'name':_0xab3a7d['DisplayName'][_0x7c3b('0xaf')][_0x7c3b('0xae')],'custom':![],'options':_0x5b1163};_0x20f1a8[_0x7c3b('0x9a')](_0x4bd861);return _0x20f1a8;});}function getInputList(_0x12bab2,_0x110de4,_0x17b6a2,_0x5a8c18,_0x5cadbc,_0x1f3f94,_0x47913d){var _0x360c63={'method':'GET','uri':_0x12bab2+_0x7c3b('0x94')+_0x5cadbc+')/Attributes('+_0x1f3f94+_0x7c3b('0xb4')+_0x17b6a2+_0x7c3b('0xb5'),'headers':{'Authorization':'Bearer\x20'+_0x47913d,'If-None-Match':null,'OData-Version':_0x7c3b('0x90')},'json':!![]};return rp(_0x360c63)['then'](function(_0x11c644){var _0x8e0881={'id':_0x110de4+'_'+_0x11c644[_0x7c3b('0x97')],'name':_0x11c644[_0x7c3b('0xb6')][_0x7c3b('0xaf')]?_0x11c644[_0x7c3b('0xb6')][_0x7c3b('0xaf')][_0x7c3b('0xae')]:_0x11c644[_0x7c3b('0x97')],'custom':![],'options':[]};_0x5a8c18[_0x7c3b('0x9a')](_0x8e0881);return _0x5a8c18;});}
\ No newline at end of file
+var _0xc639=[')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','true','LogicalName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','lodash','../../components/parsers/qs','api','../../components/integrations/configuration','undefined','offset','count','limit','status','set','Content-Range','json','destroy','sendStatus','error','stack','name','send','index','Dynamics365Account','fieldName','type','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','map','VIRTUAL','options','then','includeAll','include','findAll','catch','show','params','keys','find','create','body','update','getConfigurations','findOne','Dynamics365Configuration','rawAttributes','AccountId','Subjects','channel','Descriptions','getDescriptions','Dynamics365Field','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','ticketType','Incident','title','description','customerid','subject','phonenumber','directioncode','accountidyominame','actualserviceunits','billedserviceunits','contactidyominame','contractidname','createdbyexternalpartyyominame','createdbyname','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','importsequencenumber','kbarticleidname','lastonholdtime','masteridname','modifiedbyname','modifiedon','modifiedonbehalfbyyominame','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridname','owneridyominame','primarycontactidname','prioritycodename','productidname','resolveby','resolvebykpiidname','responseby','responsiblecontactidyominame','sentimentvalue','slainvokedidname','statecode','statuscode','subjectidname','ticketnumber','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientSecret','modernAuthentication','CloudProvider','data5','data7','access_token','POST','https://login.microsoftonline.com/','/oauth2/token','clientId','GET','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','statusCode','test'];(function(_0x2b137d,_0x4a889e){var _0x1ab024=function(_0x491b43){while(--_0x491b43){_0x2b137d['push'](_0x2b137d['shift']());}};_0x1ab024(++_0x4a889e);}(_0xc639,0xc0));var _0x9c63=function(_0x2d556e,_0x326e4b){_0x2d556e=_0x2d556e-0x0;var _0x220d34=_0xc639[_0x2d556e];return _0x220d34;};'use strict';var rp=require(_0x9c63('0x0'));var util=require('util');var _=require(_0x9c63('0x1'));var qs=require(_0x9c63('0x2'));var logger=require('../../config/logger')(_0x9c63('0x3'));var db=require('../../mysqldb')['db'];var integrations=require(_0x9c63('0x4'));function respondWithResult(_0xcfcfcf,_0x24bfde){_0x24bfde=_0x24bfde||0xc8;return function(_0x297191){if(_0x297191){return _0xcfcfcf['status'](_0x24bfde)['json'](_0x297191);}};}function respondWithFilteredResult(_0x37a3b8,_0x308cf3){return function(_0x1b9365){if(_0x1b9365){var _0x490321=typeof _0x308cf3['offset']==='undefined'&&typeof _0x308cf3['limit']===_0x9c63('0x5');var _0x376245=_0x1b9365['count'];var _0x2f1a80=_0x490321?0x0:_0x308cf3[_0x9c63('0x6')];var _0xb30290=_0x490321?_0x1b9365[_0x9c63('0x7')]:_0x308cf3[_0x9c63('0x6')]+_0x308cf3[_0x9c63('0x8')];var _0x3b9e4e;if(_0xb30290>=_0x376245){_0xb30290=_0x376245;_0x3b9e4e=0xc8;}else{_0x3b9e4e=0xce;}_0x37a3b8[_0x9c63('0x9')](_0x3b9e4e);return _0x37a3b8[_0x9c63('0xa')](_0x9c63('0xb'),_0x2f1a80+'-'+_0xb30290+'/'+_0x376245)[_0x9c63('0xc')](_0x1b9365);}return null;};}function saveUpdates(_0x460d50){return function(_0x4050c9){if(_0x4050c9){return _0x4050c9['update'](_0x460d50)['then'](function(_0x26547d){return _0x26547d;});}return null;};}function removeEntity(_0x3c0759){return function(_0xc504e8){if(_0xc504e8){return _0xc504e8[_0x9c63('0xd')]()['then'](function(){_0x3c0759[_0x9c63('0x9')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34c290){return function(_0x4817f8){if(!_0x4817f8){_0x34c290[_0x9c63('0xe')](0x194);}return _0x4817f8;};}function handleError(_0x5ee28a,_0x4abbc8){_0x4abbc8=_0x4abbc8||0x1f4;return function(_0xc0f75c){logger[_0x9c63('0xf')](_0xc0f75c[_0x9c63('0x10')]);if(_0xc0f75c[_0x9c63('0x11')]){delete _0xc0f75c[_0x9c63('0x11')];}_0x5ee28a[_0x9c63('0x9')](_0x4abbc8)[_0x9c63('0x12')](_0xc0f75c);};}exports[_0x9c63('0x13')]=function(_0x66f11e,_0x46d59b){var _0x3f872c={},_0x5ea744={},_0x44e3cd={'count':0x0,'rows':[]};var _0x24e8c2=_['map'](db[_0x9c63('0x14')]['rawAttributes'],function(_0x2a97f7){return{'name':_0x2a97f7[_0x9c63('0x15')],'type':_0x2a97f7[_0x9c63('0x16')]['key']};});_0x5ea744['model']=_['map'](_0x24e8c2,_0x9c63('0x11'));_0x5ea744[_0x9c63('0x17')]=_['keys'](_0x66f11e['query']);_0x5ea744['filters']=_[_0x9c63('0x18')](_0x5ea744[_0x9c63('0x19')],_0x5ea744[_0x9c63('0x17')]);_0x3f872c[_0x9c63('0x1a')]=_[_0x9c63('0x18')](_0x5ea744['model'],qs[_0x9c63('0x1b')](_0x66f11e[_0x9c63('0x17')][_0x9c63('0x1b')]));_0x3f872c['attributes']=_0x3f872c[_0x9c63('0x1a')][_0x9c63('0x1c')]?_0x3f872c[_0x9c63('0x1a')]:_0x5ea744[_0x9c63('0x19')];if(!_0x66f11e[_0x9c63('0x17')][_0x9c63('0x1d')](_0x9c63('0x1e'))){_0x3f872c[_0x9c63('0x8')]=qs[_0x9c63('0x8')](_0x66f11e[_0x9c63('0x17')][_0x9c63('0x8')]);_0x3f872c[_0x9c63('0x6')]=qs[_0x9c63('0x6')](_0x66f11e[_0x9c63('0x17')][_0x9c63('0x6')]);}_0x3f872c[_0x9c63('0x1f')]=qs['sort'](_0x66f11e['query'][_0x9c63('0x20')]);_0x3f872c['where']=qs[_0x9c63('0x21')](_[_0x9c63('0x22')](_0x66f11e[_0x9c63('0x17')],_0x5ea744[_0x9c63('0x21')]),_0x24e8c2);if(_0x66f11e[_0x9c63('0x17')][_0x9c63('0x23')]){_0x3f872c['where']=_[_0x9c63('0x24')](_0x3f872c[_0x9c63('0x25')],{'$or':_[_0x9c63('0x26')](_0x24e8c2,function(_0x2f701f){if(_0x2f701f['type']!==_0x9c63('0x27')){var _0x3c475e={};_0x3c475e[_0x2f701f[_0x9c63('0x11')]]={'$like':'%'+_0x66f11e[_0x9c63('0x17')][_0x9c63('0x23')]+'%'};return _0x3c475e;}})});}_0x3f872c=_[_0x9c63('0x24')]({},_0x3f872c,_0x66f11e[_0x9c63('0x28')]);var _0x1a2a88={'where':_0x3f872c[_0x9c63('0x25')]};return db[_0x9c63('0x14')][_0x9c63('0x7')](_0x1a2a88)[_0x9c63('0x29')](function(_0x3c26c5){_0x44e3cd['count']=_0x3c26c5;if(_0x66f11e[_0x9c63('0x17')][_0x9c63('0x2a')]){_0x3f872c[_0x9c63('0x2b')]=[{'all':!![]}];}return db[_0x9c63('0x14')][_0x9c63('0x2c')](_0x3f872c);})[_0x9c63('0x29')](function(_0x3b5af6){_0x44e3cd['rows']=_0x3b5af6;return _0x44e3cd;})[_0x9c63('0x29')](respondWithFilteredResult(_0x46d59b,_0x3f872c))[_0x9c63('0x2d')](handleError(_0x46d59b,null));};exports[_0x9c63('0x2e')]=function(_0x47085e,_0x3e953e){var _0x34c5ec={'raw':![],'where':{'id':_0x47085e[_0x9c63('0x2f')]['id']}},_0x575ea3={};_0x575ea3[_0x9c63('0x19')]=_[_0x9c63('0x30')](db['Dynamics365Account']['rawAttributes']);_0x575ea3[_0x9c63('0x17')]=_['keys'](_0x47085e[_0x9c63('0x17')]);_0x575ea3[_0x9c63('0x21')]=_[_0x9c63('0x18')](_0x575ea3[_0x9c63('0x19')],_0x575ea3[_0x9c63('0x17')]);_0x34c5ec[_0x9c63('0x1a')]=_['intersection'](_0x575ea3['model'],qs[_0x9c63('0x1b')](_0x47085e[_0x9c63('0x17')][_0x9c63('0x1b')]));_0x34c5ec[_0x9c63('0x1a')]=_0x34c5ec[_0x9c63('0x1a')]['length']?_0x34c5ec[_0x9c63('0x1a')]:_0x575ea3[_0x9c63('0x19')];if(_0x47085e[_0x9c63('0x17')][_0x9c63('0x2a')]){_0x34c5ec['include']=[{'all':!![]}];}_0x34c5ec=_[_0x9c63('0x24')]({},_0x34c5ec,_0x47085e[_0x9c63('0x28')]);return db[_0x9c63('0x14')][_0x9c63('0x31')](_0x34c5ec)['then'](handleEntityNotFound(_0x3e953e,null))['then'](respondWithResult(_0x3e953e,null))[_0x9c63('0x2d')](handleError(_0x3e953e,null));};exports['create']=function(_0x202df4,_0x491688){return db[_0x9c63('0x14')][_0x9c63('0x32')](_0x202df4[_0x9c63('0x33')],{})[_0x9c63('0x29')](respondWithResult(_0x491688,0xc9))['catch'](handleError(_0x491688,null));};exports[_0x9c63('0x34')]=function(_0x179c41,_0x40a512){if(_0x179c41[_0x9c63('0x33')]['id']){delete _0x179c41[_0x9c63('0x33')]['id'];}return db[_0x9c63('0x14')][_0x9c63('0x31')]({'where':{'id':_0x179c41[_0x9c63('0x2f')]['id']}})[_0x9c63('0x29')](handleEntityNotFound(_0x40a512,null))[_0x9c63('0x29')](saveUpdates(_0x179c41['body'],null))[_0x9c63('0x29')](respondWithResult(_0x40a512,null))['catch'](handleError(_0x40a512,null));};exports[_0x9c63('0xd')]=function(_0x3c17a7,_0x548174){return db[_0x9c63('0x14')]['find']({'where':{'id':_0x3c17a7[_0x9c63('0x2f')]['id']}})['then'](handleEntityNotFound(_0x548174,null))['then'](removeEntity(_0x548174,null))[_0x9c63('0x2d')](handleError(_0x548174,null));};exports[_0x9c63('0x35')]=function(_0x49551e,_0x1d8949){var _0x5a9d61={};var _0x1fa2a0={};var _0x505c7d;var _0x437a72;return db[_0x9c63('0x14')][_0x9c63('0x36')]({'where':{'id':_0x49551e['params']['id']}})[_0x9c63('0x29')](handleEntityNotFound(_0x1d8949,null))[_0x9c63('0x29')](function(_0x4f1a8b){if(_0x4f1a8b){_0x505c7d=_0x4f1a8b;_0x1fa2a0[_0x9c63('0x19')]=_[_0x9c63('0x30')](db[_0x9c63('0x37')][_0x9c63('0x38')]);_0x1fa2a0[_0x9c63('0x17')]=_[_0x9c63('0x30')](_0x49551e[_0x9c63('0x17')]);_0x1fa2a0[_0x9c63('0x21')]=_['intersection'](_0x1fa2a0[_0x9c63('0x19')],_0x1fa2a0[_0x9c63('0x17')]);_0x5a9d61[_0x9c63('0x1a')]=_[_0x9c63('0x18')](_0x1fa2a0[_0x9c63('0x19')],qs[_0x9c63('0x1b')](_0x49551e[_0x9c63('0x17')][_0x9c63('0x1b')]));_0x5a9d61[_0x9c63('0x1a')]=_0x5a9d61[_0x9c63('0x1a')][_0x9c63('0x1c')]?_0x5a9d61[_0x9c63('0x1a')]:_0x1fa2a0[_0x9c63('0x19')];_0x5a9d61[_0x9c63('0x1f')]=qs[_0x9c63('0x20')](_0x49551e['query']['sort']);_0x5a9d61['where']=qs[_0x9c63('0x21')](_['pick'](_0x49551e[_0x9c63('0x17')],_0x1fa2a0['filters']));if(_0x49551e[_0x9c63('0x17')][_0x9c63('0x23')]){_0x5a9d61[_0x9c63('0x25')]=_[_0x9c63('0x24')](_0x5a9d61[_0x9c63('0x25')],{'$or':_[_0x9c63('0x26')](_0x5a9d61[_0x9c63('0x1a')],function(_0x57d778){var _0x26bfec={};_0x26bfec[_0x57d778]={'$like':'%'+_0x49551e['query'][_0x9c63('0x23')]+'%'};return _0x26bfec;})});}_0x5a9d61=_[_0x9c63('0x24')]({},_0x5a9d61,_0x49551e['options']);return _0x505c7d[_0x9c63('0x35')](_0x5a9d61);}})[_0x9c63('0x29')](function(_0x360bd1){if(_0x360bd1){_0x437a72=_0x360bd1['length'];if(!_0x49551e[_0x9c63('0x17')][_0x9c63('0x1d')](_0x9c63('0x1e'))){_0x5a9d61[_0x9c63('0x8')]=qs[_0x9c63('0x8')](_0x49551e[_0x9c63('0x17')][_0x9c63('0x8')]);_0x5a9d61[_0x9c63('0x6')]=qs[_0x9c63('0x6')](_0x49551e[_0x9c63('0x17')]['offset']);}return _0x505c7d[_0x9c63('0x35')](_0x5a9d61);}})['then'](function(_0x40f789){if(_0x40f789){return _0x40f789?{'count':_0x437a72,'rows':_0x40f789}:null;}})['then'](respondWithResult(_0x1d8949,null))[_0x9c63('0x2d')](handleError(_0x1d8949,null));};exports['addConfiguration']=function(_0x592a45,_0x239cf0){if(_0x592a45['body']['id']){delete _0x592a45['body']['id'];}return db[_0x9c63('0x14')][_0x9c63('0x36')]({'where':{'id':_0x592a45['params']['id']}})[_0x9c63('0x29')](handleEntityNotFound(_0x239cf0,null))[_0x9c63('0x29')](function(_0x571ff5){if(_0x571ff5){_0x592a45[_0x9c63('0x33')][_0x9c63('0x39')]=_0x571ff5['id'];_0x592a45[_0x9c63('0x33')][_0x9c63('0x3a')]=integrations['getSubjects'](_0x592a45[_0x9c63('0x33')][_0x9c63('0x3b')],_0x592a45['body']['type']);_0x592a45[_0x9c63('0x33')][_0x9c63('0x3c')]=integrations[_0x9c63('0x3d')](_0x592a45['body']['channel'],_0x592a45['body'][_0x9c63('0x16')]);return db['Dynamics365Configuration'][_0x9c63('0x32')](_0x592a45[_0x9c63('0x33')],{'include':[{'model':db[_0x9c63('0x3e')],'as':_0x9c63('0x3a')},{'model':db['Dynamics365Field'],'as':_0x9c63('0x3c')}]});}return null;})[_0x9c63('0x29')](respondWithResult(_0x239cf0,null))['catch'](handleError(_0x239cf0,null));};function sanitizeRemoteUri(_0x35bb5d){var _0x6bb9ec=_0x35bb5d[_0x9c63('0x3f')](-0x1);if(_0x6bb9ec==='/')return _0x35bb5d[_0x9c63('0x40')](0x0,_0x35bb5d[_0x9c63('0x41')](_0x6bb9ec));return _0x35bb5d;}function getWebApiUrl(_0x30c6d9){return util[_0x9c63('0x42')](_0x9c63('0x43'),_0x30c6d9);}exports['getFields']=function(_0x103ec8,_0x2ebb04){var _0x259563=_0x103ec8[_0x9c63('0x17')][_0x9c63('0x44')];var _0x5666b0=_0x259563==='incident'?_0x9c63('0x45'):'PhoneCall';var _0x197691='';var _0x2d4d80='';var _0x47f11e='';var _0x283ad2='';var _0x21bf45='';var _0x17f97b='';var _0x332b89='';var _0x812bc1='';var _0x256f3f=[_0x9c63('0x46'),_0x9c63('0x47'),_0x9c63('0x48'),'ownerid','caseorigincode',_0x9c63('0x49'),_0x9c63('0x4a'),'regardingobjectid',_0x9c63('0x4b'),'phonecall_activity_parties'];var _0x3f1e47=['accountidname',_0x9c63('0x4c'),_0x9c63('0x4d'),_0x9c63('0x4e'),'contactidname',_0x9c63('0x4f'),'contractdetailidname',_0x9c63('0x50'),'createdbyexternalpartyname',_0x9c63('0x51'),_0x9c63('0x52'),'createdbyyominame',_0x9c63('0x53'),_0x9c63('0x54'),_0x9c63('0x55'),_0x9c63('0x56'),_0x9c63('0x57'),_0x9c63('0x58'),'emailaddress',_0x9c63('0x59'),_0x9c63('0x5a'),_0x9c63('0x5b'),_0x9c63('0x5c'),_0x9c63('0x5d'),_0x9c63('0x5e'),'followupby',_0x9c63('0x5f'),'influencescore',_0x9c63('0x60'),_0x9c63('0x61'),_0x9c63('0x62'),'modifiedbyexternalpartyname','modifiedbyexternalpartyyominame',_0x9c63('0x63'),'modifiedbyyominame',_0x9c63('0x64'),'modifiedonbehalfbyname',_0x9c63('0x65'),'msdyn_incidenttypename',_0x9c63('0x66'),'numberofchildincidents',_0x9c63('0x67'),_0x9c63('0x68'),_0x9c63('0x69'),'owneridtype',_0x9c63('0x6a'),'parentcaseidname',_0x9c63('0x6b'),'primarycontactidyominame',_0x9c63('0x6c'),_0x9c63('0x6d'),'productserialnumber',_0x9c63('0x6e'),_0x9c63('0x6f'),_0x9c63('0x70'),'responsiblecontactidname',_0x9c63('0x71'),_0x9c63('0x72'),_0x9c63('0x73'),'slaname','socialprofileidname',_0x9c63('0x74'),_0x9c63('0x75'),_0x9c63('0x76'),_0x9c63('0x77'),'timezoneruleversionnumber','transactioncurrencyidname','traversedpath',_0x9c63('0x78'),_0x9c63('0x79')];var _0x450cb9=_0x256f3f[_0x9c63('0x7a')](_0x3f1e47);return db[_0x9c63('0x14')]['findOne']({'where':{'id':_0x103ec8['params']['id']},'attributes':['id',_0x9c63('0x7b'),_0x9c63('0x7c'),_0x9c63('0x7d'),_0x9c63('0x7e'),'clientId',_0x9c63('0x7f'),_0x9c63('0x80')],'include':[{'model':db[_0x9c63('0x81')],'as':'CloudProvider','attributes':['id',_0x9c63('0x82'),_0x9c63('0x83')]}]})[_0x9c63('0x29')](handleEntityNotFound(_0x2ebb04,null))['then'](function(_0x195732){if(_0x195732){if(_0x195732[_0x9c63('0x80')]){_0x195732[_0x9c63('0x84')]=_0x195732[_0x9c63('0x81')][_0x9c63('0x82')];_0x812bc1=sanitizeRemoteUri(_0x195732[_0x9c63('0x81')]['data7']);_0x332b89=getWebApiUrl(_0x812bc1);return _0x195732;}_0x812bc1=sanitizeRemoteUri(_0x195732['remoteUri']);_0x332b89=getWebApiUrl(_0x812bc1);var _0x2a20cd={'method':_0x9c63('0x85'),'uri':_0x9c63('0x86')+_0x195732[_0x9c63('0x7e')]+_0x9c63('0x87'),'form':{'client_id':_0x195732[_0x9c63('0x88')],'resource':_0x812bc1,'username':_0x195732[_0x9c63('0x7b')],'password':_0x195732[_0x9c63('0x7c')],'grant_type':_0x9c63('0x7c'),'client_secret':_0x195732['clientSecret']},'json':!![]};return rp(_0x2a20cd);}})[_0x9c63('0x29')](function(_0x3734dc){_0x17f97b=_0x3734dc[_0x9c63('0x84')];var _0x20e27e={'method':_0x9c63('0x89'),'uri':encodeURI(_0x332b89+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x5666b0+'\x27'),'headers':{'Authorization':_0x9c63('0x8a')+_0x17f97b,'If-None-Match':null,'OData-Version':_0x9c63('0x8b')},'json':!![]};return rp(_0x20e27e);})[_0x9c63('0x29')](function(_0x418d7e){var _0x449c0b=_0x418d7e[_0x9c63('0x8c')][0x0];var _0x8da5aa=_0x449c0b[_0x9c63('0x8d')];var _0x2a766c={'method':'GET','uri':_0x332b89+_0x9c63('0x8e')+_0x8da5aa+_0x9c63('0x8f'),'headers':{'Authorization':_0x9c63('0x8a')+_0x17f97b,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2a766c);})[_0x9c63('0x29')](function(_0x13b69f){_0x197691=_0x13b69f;_0x2d4d80=_0x197691[_0x9c63('0x90')];_0x2d4d80=_[_0x9c63('0x91')](_0x2d4d80,function(_0x3edb35){return!_0x450cb9['includes'](_0x3edb35['LogicalName']);});var _0x307ce6=[];var _0x20abd9=[];_0x2d4d80[_0x9c63('0x92')](function(_0x4374bb){if(_0x4374bb[_0x9c63('0x93')]){var _0x46b4d0=_0x4374bb[_0x9c63('0x93')][_0x9c63('0x40')](_0x4374bb[_0x9c63('0x93')][_0x9c63('0x41')]('.')+0x1);if(_0x46b4d0===_0x9c63('0x94')){_0x307ce6[_0x9c63('0x95')](getSelectList(_0x332b89,_0x259563,_0x20abd9,_0x197691[_0x9c63('0x8d')],_0x4374bb[_0x9c63('0x8d')],_0x17f97b));}}});return Promise[_0x9c63('0x96')](_0x307ce6);})[_0x9c63('0x29')](function(_0x1f5e5d){_0x47f11e=_0x1f5e5d[0x0];var _0x5e6ba7=[];var _0x4bd80e=[];_0x2d4d80[_0x9c63('0x92')](function(_0x499285){if(!_[_0x9c63('0x97')](_0x499285[_0x9c63('0x93')])){var _0xbf8ec5=_0x499285[_0x9c63('0x93')]['substring'](_0x499285['@odata.type'][_0x9c63('0x41')]('.')+0x1);if(_0xbf8ec5===_0x9c63('0x98')){_0x5e6ba7[_0x9c63('0x95')](getBooleanList(_0x332b89,_0x259563,_0x4bd80e,_0x197691[_0x9c63('0x8d')],_0x499285[_0x9c63('0x8d')],_0x17f97b));}}});return Promise['all'](_0x5e6ba7);})[_0x9c63('0x29')](function(_0x2fda3a){_0x283ad2=_0x2fda3a[0x0];var _0x5c0752=[];var _0x15e27e=[];_0x2d4d80[_0x9c63('0x92')](function(_0x56e8ef){if(_0x56e8ef[_0x9c63('0x93')]){var _0x2f7b04=_0x56e8ef[_0x9c63('0x93')]['substring'](_0x56e8ef[_0x9c63('0x93')][_0x9c63('0x41')]('.')+0x1);if(_0x2f7b04===_0x9c63('0x99')||_0x2f7b04===_0x9c63('0x9a')||_0x2f7b04==='BigIntAttributeMetadata'||_0x2f7b04===_0x9c63('0x9b')||_0x2f7b04==='MemoAttributeMetadata'||_0x2f7b04===_0x9c63('0x9c')||_0x2f7b04==='StatusAttributeMetadata'||_0x2f7b04===_0x9c63('0x9d')||_0x2f7b04===_0x9c63('0x9e')||_0x2f7b04===_0x9c63('0x9f')){_0x5c0752['push'](getInputList(_0x332b89,_0x259563,_0x2f7b04,_0x15e27e,_0x197691[_0x9c63('0x8d')],_0x56e8ef[_0x9c63('0x8d')],_0x17f97b));}}});return Promise[_0x9c63('0x96')](_0x5c0752);})[_0x9c63('0x29')](function(_0x38aac6){_0x21bf45=_0x38aac6[0x0];var _0x22c463=_0x47f11e['concat'](_0x283ad2)[_0x9c63('0x7a')](_0x21bf45);var _0x4b4cbd={'count':_0x22c463['length'],'rows':_0x22c463};return _0x4b4cbd;})[_0x9c63('0x29')](respondWithResult(_0x2ebb04,null))[_0x9c63('0x2d')](function(_0x990614){var _0x5c871d=_0x103ec8[_0x9c63('0x17')]['test']?0x1f4:_0x990614[_0x9c63('0xa0')]||0x1f4;logger['error'](_0x990614[_0x9c63('0x10')]);delete _0x990614[_0x9c63('0x11')];if(_0x5c871d===0x191){_0x5c871d=0x190;}_0x2ebb04['status'](_0x5c871d)[_0x9c63('0x12')](_0x103ec8['query'][_0x9c63('0xa1')]?{'message':'Wrong\x20credentials','statusCode':_0x990614[_0x9c63('0xa0')]}:_0x990614);});};function getSelectList(_0xef8f83,_0x543420,_0x2e9e1d,_0x3eb1e8,_0x52b7e3,_0x572fa0){var _0x470fb6={'method':_0x9c63('0x89'),'uri':_0xef8f83+_0x9c63('0x8e')+_0x3eb1e8+_0x9c63('0xa2')+_0x52b7e3+_0x9c63('0xa3')+_0x9c63('0xa4'),'headers':{'Authorization':_0x9c63('0x8a')+_0x572fa0,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x470fb6)['then'](function(_0x3cfb1b){var _0x1d3e02=[];var _0x5968aa=_0x3cfb1b['OptionSet'][_0x9c63('0xa5')];_0x5968aa[_0x9c63('0x92')](function(_0x43f418){_0x1d3e02[_0x9c63('0x95')]({'name':_0x43f418[_0x9c63('0xa6')][_0x9c63('0xa7')][_0x9c63('0xa6')],'value':String(_0x43f418[_0x9c63('0xa8')])});});var _0x4c9a4e={'id':_0x543420+'_'+_0x3cfb1b['LogicalName'],'name':_0x3cfb1b[_0x9c63('0xa9')][_0x9c63('0xa7')][_0x9c63('0xa6')],'custom':![],'options':_0x1d3e02};_0x2e9e1d['push'](_0x4c9a4e);return _0x2e9e1d;});}function getBooleanList(_0x2e6c39,_0x35f867,_0x22ca75,_0x4d4d7c,_0xe5c12d,_0x4130a9){var _0x2b47d9={'method':_0x9c63('0x89'),'uri':_0x2e6c39+_0x9c63('0x8e')+_0x4d4d7c+')/Attributes('+_0xe5c12d+_0x9c63('0xaa'),'headers':{'Authorization':'Bearer\x20'+_0x4130a9,'If-None-Match':null,'OData-Version':_0x9c63('0x8b')},'json':!![]};return rp(_0x2b47d9)[_0x9c63('0x29')](function(_0x782f2d){var _0x31e8c8=[];_0x31e8c8[_0x9c63('0x95')]({'name':_0x782f2d[_0x9c63('0xab')][_0x9c63('0xac')][_0x9c63('0xa6')][_0x9c63('0xa7')]['Label'],'value':_0x9c63('0xad')},{'name':_0x782f2d[_0x9c63('0xab')]['FalseOption'][_0x9c63('0xa6')][_0x9c63('0xa7')]['Label'],'value':'false'});var _0x1e4b4c={'id':_0x35f867+'_'+_0x782f2d[_0x9c63('0xae')],'name':_0x782f2d[_0x9c63('0xa9')][_0x9c63('0xa7')][_0x9c63('0xa6')],'custom':![],'options':_0x31e8c8};_0x22ca75[_0x9c63('0x95')](_0x1e4b4c);return _0x22ca75;});}function getInputList(_0x457854,_0x429f79,_0x3ed505,_0x4b032e,_0x457bf5,_0x208267,_0x3721d1){var _0x336fc4={'method':_0x9c63('0x89'),'uri':_0x457854+_0x9c63('0x8e')+_0x457bf5+_0x9c63('0xa2')+_0x208267+_0x9c63('0xaf')+_0x3ed505+_0x9c63('0xb0'),'headers':{'Authorization':_0x9c63('0x8a')+_0x3721d1,'If-None-Match':null,'OData-Version':_0x9c63('0x8b')},'json':!![]};return rp(_0x336fc4)[_0x9c63('0x29')](function(_0x192c95){var _0x2465a7={'id':_0x429f79+'_'+_0x192c95[_0x9c63('0xae')],'name':_0x192c95[_0x9c63('0xa9')][_0x9c63('0xa7')]?_0x192c95['DisplayName'][_0x9c63('0xa7')][_0x9c63('0xa6')]:_0x192c95[_0x9c63('0xae')],'custom':![],'options':[]};_0x4b032e[_0x9c63('0x95')](_0x2465a7);return _0x4b032e;});}
\ No newline at end of file
index 02e47ee..57d9c65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x20082f,_0x6f6ccb){var _0x3fe444=function(_0x1dd168){while(--_0x1dd168){_0x20082f['push'](_0x20082f['shift']());}};_0x3fe444(++_0x6f6ccb);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0x4bacb6,_0x2b299d){var _0x58c029=function(_0x2faaf5){while(--_0x2faaf5){_0x4bacb6['push'](_0x4bacb6['shift']());}};_0x58c029(++_0x2b299d);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));var integrations=require(_0x3071('0x8'));module[_0x3071('0x9')]=function(_0x41cf76,_0x1d3dd6){return _0x41cf76[_0x3071('0xa')](_0x3071('0xb'),attributes,{'tableName':_0x3071('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e187684..d5856fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x83c4=['findAll','options','raw','where','attributes','limit','include','map','model','then','GetDynamics365Account','ShowDynamics365Account','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Dynamics365Account'];(function(_0x164570,_0x387a73){var _0x26a206=function(_0x5b88e2){while(--_0x5b88e2){_0x164570['push'](_0x164570['shift']());}};_0x26a206(++_0x387a73);}(_0x83c4,0x1ee));var _0x483c=function(_0x3fdc4c,_0x42ec50){_0x3fdc4c=_0x3fdc4c-0x0;var _0x206e98=_0x83c4[_0x3fdc4c];return _0x206e98;};'use strict';var _=require(_0x483c('0x0'));var util=require(_0x483c('0x1'));var moment=require(_0x483c('0x2'));var BPromise=require(_0x483c('0x3'));var rs=require(_0x483c('0x4'));var fs=require('fs');var Redis=require(_0x483c('0x5'));var db=require(_0x483c('0x6'))['db'];var utils=require(_0x483c('0x7'));var logger=require(_0x483c('0x8'))(_0x483c('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x483c('0xa')][_0x483c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x41f6db,_0x3831fa,_0xc64651){return new BPromise(function(_0x582407,_0xa511ff){return client[_0x483c('0xc')](_0x41f6db,_0xc64651)['then'](function(_0x5bf856){logger[_0x483c('0xd')](_0x483c('0xe'),_0x3831fa,_0x483c('0xf'));logger[_0x483c('0x10')](_0x483c('0x11'),_0x3831fa,_0x483c('0xf'),JSON[_0x483c('0x12')](_0x5bf856));if(_0x5bf856['error']){if(_0x5bf856[_0x483c('0x13')]['code']===0x1f4){logger[_0x483c('0x13')](_0x483c('0xe'),_0x3831fa,_0x5bf856['error'][_0x483c('0x14')]);return _0xa511ff(_0x5bf856[_0x483c('0x13')][_0x483c('0x14')]);}logger[_0x483c('0x13')](_0x483c('0xe'),_0x3831fa,_0x5bf856['error'][_0x483c('0x14')]);return _0x582407(_0x5bf856['error']['message']);}else{logger[_0x483c('0xd')](_0x483c('0xe'),_0x3831fa,'request\x20sent');_0x582407(_0x5bf856[_0x483c('0x15')][_0x483c('0x14')]);}})[_0x483c('0x16')](function(_0x59e210){logger[_0x483c('0x13')](_0x483c('0xe'),_0x3831fa,_0x59e210);_0xa511ff(_0x59e210);});});}exports['GetDynamics365Account']=function(_0x29fda2){var _0x1b8b54=this;return new Promise(function(_0x3f05bc,_0x44eec0){return db[_0x483c('0x17')][_0x483c('0x18')]({'raw':_0x29fda2[_0x483c('0x19')]?_0x29fda2[_0x483c('0x19')][_0x483c('0x1a')]===undefined?!![]:![]:!![],'where':_0x29fda2[_0x483c('0x19')]?_0x29fda2[_0x483c('0x19')][_0x483c('0x1b')]||null:null,'attributes':_0x29fda2[_0x483c('0x19')]?_0x29fda2['options'][_0x483c('0x1c')]||null:null,'limit':_0x29fda2[_0x483c('0x19')]?_0x29fda2[_0x483c('0x19')][_0x483c('0x1d')]||null:null,'include':_0x29fda2[_0x483c('0x19')]?_0x29fda2['options'][_0x483c('0x1e')]?_[_0x483c('0x1f')](_0x29fda2[_0x483c('0x19')]['include'],function(_0x405ab7){return{'model':db[_0x405ab7[_0x483c('0x20')]],'as':_0x405ab7['as'],'attributes':_0x405ab7[_0x483c('0x1c')],'include':_0x405ab7['include']?_['map'](_0x405ab7[_0x483c('0x1e')],function(_0x51c87b){return{'model':db[_0x51c87b[_0x483c('0x20')]],'as':_0x51c87b['as'],'attributes':_0x51c87b['attributes'],'include':_0x51c87b[_0x483c('0x1e')]?_[_0x483c('0x1f')](_0x51c87b[_0x483c('0x1e')],function(_0x12e96a){return{'model':db[_0x12e96a[_0x483c('0x20')]],'as':_0x12e96a['as'],'attributes':_0x12e96a[_0x483c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x483c('0x21')](function(_0x1527fa){logger[_0x483c('0xd')](_0x483c('0x22'),_0x29fda2);logger['debug'](_0x483c('0x22'),_0x29fda2,JSON['stringify'](_0x1527fa));_0x3f05bc(_0x1527fa);})[_0x483c('0x16')](function(_0x514887){logger[_0x483c('0x13')](_0x483c('0x22'),_0x514887[_0x483c('0x14')],_0x29fda2);_0x44eec0(_0x1b8b54[_0x483c('0x13')](0x1f4,_0x514887[_0x483c('0x14')]));});});};exports[_0x483c('0x23')]=function(_0x39deb8){var _0x375e65=this;return new Promise(function(_0x3ccb86,_0x41b481){return db[_0x483c('0x17')][_0x483c('0x24')]({'raw':_0x39deb8['options']?_0x39deb8[_0x483c('0x19')][_0x483c('0x1a')]===undefined?!![]:![]:!![],'where':_0x39deb8[_0x483c('0x19')]?_0x39deb8[_0x483c('0x19')][_0x483c('0x1b')]||null:null,'attributes':_0x39deb8[_0x483c('0x19')]?_0x39deb8[_0x483c('0x19')]['attributes']||null:null,'include':_0x39deb8[_0x483c('0x19')]?_0x39deb8[_0x483c('0x19')][_0x483c('0x1e')]?_[_0x483c('0x1f')](_0x39deb8['options'][_0x483c('0x1e')],function(_0x4e20e7){return{'model':db[_0x4e20e7[_0x483c('0x20')]],'as':_0x4e20e7['as'],'attributes':_0x4e20e7['attributes'],'include':_0x4e20e7['include']?_[_0x483c('0x1f')](_0x4e20e7[_0x483c('0x1e')],function(_0x531547){return{'model':db[_0x531547[_0x483c('0x20')]],'as':_0x531547['as'],'attributes':_0x531547['attributes'],'include':_0x531547[_0x483c('0x1e')]?_[_0x483c('0x1f')](_0x531547[_0x483c('0x1e')],function(_0x1cd8d5){return{'model':db[_0x1cd8d5[_0x483c('0x20')]],'as':_0x1cd8d5['as'],'attributes':_0x1cd8d5[_0x483c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x483c('0x21')](function(_0x4038d7){logger[_0x483c('0xd')](_0x483c('0x23'),_0x39deb8);logger['debug'](_0x483c('0x23'),_0x39deb8,JSON[_0x483c('0x12')](_0x4038d7));_0x3ccb86(_0x4038d7);})[_0x483c('0x16')](function(_0x8ed25){logger[_0x483c('0x13')](_0x483c('0x23'),_0x8ed25[_0x483c('0x14')],_0x39deb8);_0x41b481(_0x375e65[_0x483c('0x13')](0x1f4,_0x8ed25['message']));});});};
\ No newline at end of file
+var _0x9dd9=['ShowDynamics365Account','raw','where','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetDynamics365Account','Dynamics365Account','options','attributes','include','map','model'];(function(_0x3c49b8,_0x2f888a){var _0x57e565=function(_0x1e48a4){while(--_0x1e48a4){_0x3c49b8['push'](_0x3c49b8['shift']());}};_0x57e565(++_0x2f888a);}(_0x9dd9,0x1a3));var _0x99dd=function(_0x347d10,_0x55841c){_0x347d10=_0x347d10-0x0;var _0x49ab3f=_0x9dd9[_0x347d10];return _0x49ab3f;};'use strict';var _=require(_0x99dd('0x0'));var util=require(_0x99dd('0x1'));var moment=require('moment');var BPromise=require(_0x99dd('0x2'));var rs=require(_0x99dd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x99dd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x99dd('0x5'))('rpc');var config=require(_0x99dd('0x6'));var jayson=require(_0x99dd('0x7'));var client=jayson[_0x99dd('0x8')][_0x99dd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5913c0,_0x71bf5e,_0x4e18c7){return new BPromise(function(_0x24b986,_0x21d43f){return client[_0x99dd('0xa')](_0x5913c0,_0x4e18c7)[_0x99dd('0xb')](function(_0x554d85){logger[_0x99dd('0xc')](_0x99dd('0xd'),_0x71bf5e,_0x99dd('0xe'));logger[_0x99dd('0xf')](_0x99dd('0x10'),_0x71bf5e,'request\x20sent',JSON[_0x99dd('0x11')](_0x554d85));if(_0x554d85[_0x99dd('0x12')]){if(_0x554d85['error']['code']===0x1f4){logger['error'](_0x99dd('0xd'),_0x71bf5e,_0x554d85[_0x99dd('0x12')][_0x99dd('0x13')]);return _0x21d43f(_0x554d85[_0x99dd('0x12')][_0x99dd('0x13')]);}logger[_0x99dd('0x12')](_0x99dd('0xd'),_0x71bf5e,_0x554d85[_0x99dd('0x12')][_0x99dd('0x13')]);return _0x24b986(_0x554d85[_0x99dd('0x12')][_0x99dd('0x13')]);}else{logger[_0x99dd('0xc')](_0x99dd('0xd'),_0x71bf5e,_0x99dd('0xe'));_0x24b986(_0x554d85[_0x99dd('0x14')][_0x99dd('0x13')]);}})[_0x99dd('0x15')](function(_0x16303f){logger['error'](_0x99dd('0xd'),_0x71bf5e,_0x16303f);_0x21d43f(_0x16303f);});});}exports[_0x99dd('0x16')]=function(_0x2cfc4e){var _0x164837=this;return new Promise(function(_0x13510d,_0x5a1807){return db[_0x99dd('0x17')]['findAll']({'raw':_0x2cfc4e[_0x99dd('0x18')]?_0x2cfc4e[_0x99dd('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x2cfc4e[_0x99dd('0x18')]?_0x2cfc4e[_0x99dd('0x18')]['where']||null:null,'attributes':_0x2cfc4e['options']?_0x2cfc4e[_0x99dd('0x18')][_0x99dd('0x19')]||null:null,'limit':_0x2cfc4e[_0x99dd('0x18')]?_0x2cfc4e['options']['limit']||null:null,'include':_0x2cfc4e[_0x99dd('0x18')]?_0x2cfc4e[_0x99dd('0x18')][_0x99dd('0x1a')]?_[_0x99dd('0x1b')](_0x2cfc4e[_0x99dd('0x18')]['include'],function(_0x73273f){return{'model':db[_0x73273f[_0x99dd('0x1c')]],'as':_0x73273f['as'],'attributes':_0x73273f['attributes'],'include':_0x73273f['include']?_['map'](_0x73273f[_0x99dd('0x1a')],function(_0x1699b7){return{'model':db[_0x1699b7['model']],'as':_0x1699b7['as'],'attributes':_0x1699b7[_0x99dd('0x19')],'include':_0x1699b7[_0x99dd('0x1a')]?_['map'](_0x1699b7[_0x99dd('0x1a')],function(_0xde2c97){return{'model':db[_0xde2c97[_0x99dd('0x1c')]],'as':_0xde2c97['as'],'attributes':_0xde2c97['attributes']};}):[]};}):[]};}):[]:[]})[_0x99dd('0xb')](function(_0x2fffa4){logger[_0x99dd('0xc')](_0x99dd('0x16'),_0x2cfc4e);logger[_0x99dd('0xf')](_0x99dd('0x16'),_0x2cfc4e,JSON[_0x99dd('0x11')](_0x2fffa4));_0x13510d(_0x2fffa4);})['catch'](function(_0x357c47){logger[_0x99dd('0x12')](_0x99dd('0x16'),_0x357c47[_0x99dd('0x13')],_0x2cfc4e);_0x5a1807(_0x164837[_0x99dd('0x12')](0x1f4,_0x357c47[_0x99dd('0x13')]));});});};exports[_0x99dd('0x1d')]=function(_0x3ef08d){var _0x4b552c=this;return new Promise(function(_0x2eac27,_0xff6d1f){return db[_0x99dd('0x17')]['find']({'raw':_0x3ef08d[_0x99dd('0x18')]?_0x3ef08d[_0x99dd('0x18')][_0x99dd('0x1e')]===undefined?!![]:![]:!![],'where':_0x3ef08d[_0x99dd('0x18')]?_0x3ef08d['options'][_0x99dd('0x1f')]||null:null,'attributes':_0x3ef08d[_0x99dd('0x18')]?_0x3ef08d['options']['attributes']||null:null,'include':_0x3ef08d[_0x99dd('0x18')]?_0x3ef08d[_0x99dd('0x18')]['include']?_[_0x99dd('0x1b')](_0x3ef08d['options'][_0x99dd('0x1a')],function(_0x4d5dab){return{'model':db[_0x4d5dab[_0x99dd('0x1c')]],'as':_0x4d5dab['as'],'attributes':_0x4d5dab['attributes'],'include':_0x4d5dab[_0x99dd('0x1a')]?_['map'](_0x4d5dab[_0x99dd('0x1a')],function(_0x3b3f8b){return{'model':db[_0x3b3f8b[_0x99dd('0x1c')]],'as':_0x3b3f8b['as'],'attributes':_0x3b3f8b[_0x99dd('0x19')],'include':_0x3b3f8b[_0x99dd('0x1a')]?_['map'](_0x3b3f8b[_0x99dd('0x1a')],function(_0xb22db3){return{'model':db[_0xb22db3['model']],'as':_0xb22db3['as'],'attributes':_0xb22db3[_0x99dd('0x19')]};}):[]};}):[]};}):[]:[]})[_0x99dd('0xb')](function(_0x354e26){logger['info'](_0x99dd('0x1d'),_0x3ef08d);logger[_0x99dd('0xf')](_0x99dd('0x1d'),_0x3ef08d,JSON[_0x99dd('0x11')](_0x354e26));_0x2eac27(_0x354e26);})['catch'](function(_0x4eb332){logger[_0x99dd('0x12')]('ShowDynamics365Account',_0x4eb332[_0x99dd('0x13')],_0x3ef08d);_0xff6d1f(_0x4b552c[_0x99dd('0x12')](0x1f4,_0x4eb332[_0x99dd('0x13')]));});});};
\ No newline at end of file
index 4f7b87f..14beb3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x56a4=['create','put','/:id','update','destroy','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post'];(function(_0x49f8c2,_0x5166b7){var _0x3e63ec=function(_0x575c26){while(--_0x575c26){_0x49f8c2['push'](_0x49f8c2['shift']());}};_0x3e63ec(++_0x5166b7);}(_0x56a4,0x73));var _0x456a=function(_0x2c8d85,_0x590fef){_0x2c8d85=_0x2c8d85-0x0;var _0x277ef4=_0x56a4[_0x2c8d85];return _0x277ef4;};'use strict';var multer=require('multer');var util=require(_0x456a('0x0'));var path=require(_0x456a('0x1'));var timeout=require(_0x456a('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x456a('0x3'));var auth=require(_0x456a('0x4'));var interaction=require(_0x456a('0x5'));var config=require(_0x456a('0x6'));var controller=require(_0x456a('0x7'));router[_0x456a('0x8')]('/',auth[_0x456a('0x9')](),controller[_0x456a('0xa')]);router['get']('/:id',auth[_0x456a('0x9')](),controller['show']);router['get'](_0x456a('0xb'),auth['isAuthenticated'](),controller[_0x456a('0xc')]);router[_0x456a('0x8')](_0x456a('0xd'),auth[_0x456a('0x9')](),controller[_0x456a('0xe')]);router['get'](_0x456a('0xf'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x456a('0x10')]('/',auth[_0x456a('0x9')](),controller[_0x456a('0x11')]);router[_0x456a('0x12')](_0x456a('0x13'),auth[_0x456a('0x9')](),controller[_0x456a('0x14')]);router['delete'](_0x456a('0x13'),auth['isAuthenticated'](),controller[_0x456a('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0xeae7=['./intDynamics365Configuration.controller','get','/:id','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2a45ad,_0x3a70ed){var _0x20c4c8=function(_0x4db723){while(--_0x4db723){_0x2a45ad['push'](_0x2a45ad['shift']());}};_0x20c4c8(++_0x3a70ed);}(_0xeae7,0x1a1));var _0x7eae=function(_0x265003,_0xf0f023){_0x265003=_0x265003-0x0;var _0x33c743=_0xeae7[_0x265003];return _0x33c743;};'use strict';var multer=require('multer');var util=require(_0x7eae('0x0'));var path=require(_0x7eae('0x1'));var timeout=require(_0x7eae('0x2'));var express=require('express');var router=express[_0x7eae('0x3')]();var fs_extra=require(_0x7eae('0x4'));var auth=require(_0x7eae('0x5'));var interaction=require(_0x7eae('0x6'));var config=require(_0x7eae('0x7'));var controller=require(_0x7eae('0x8'));router[_0x7eae('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7eae('0x9')](_0x7eae('0xa'),auth['isAuthenticated'](),controller[_0x7eae('0xb')]);router['get'](_0x7eae('0xc'),auth[_0x7eae('0xd')](),controller[_0x7eae('0xe')]);router[_0x7eae('0x9')](_0x7eae('0xf'),auth[_0x7eae('0xd')](),controller[_0x7eae('0x10')]);router[_0x7eae('0x9')](_0x7eae('0x11'),auth[_0x7eae('0xd')](),controller[_0x7eae('0x12')]);router[_0x7eae('0x13')]('/',auth[_0x7eae('0xd')](),controller['create']);router[_0x7eae('0x14')](_0x7eae('0xa'),auth[_0x7eae('0xd')](),controller[_0x7eae('0x15')]);router[_0x7eae('0x16')](_0x7eae('0xa'),auth['isAuthenticated'](),controller[_0x7eae('0x17')]);module[_0x7eae('0x18')]=router;
\ No newline at end of file
index 6f3cfc1..2b33647 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b7f=['exports','STRING','ENUM','phonecall','contact','sequelize'];(function(_0x3153a2,_0x495ce2){var _0x133ff9=function(_0x5370d9){while(--_0x5370d9){_0x3153a2['push'](_0x3153a2['shift']());}};_0x133ff9(++_0x495ce2);}(_0x7b7f,0x6b));var _0xf7b7=function(_0x754ab4,_0x56daa7){_0x754ab4=_0x754ab4-0x0;var _0x34079a=_0x7b7f[_0x754ab4];return _0x34079a;};'use strict';var Sequelize=require(_0xf7b7('0x0'));module[_0xf7b7('0x1')]={'name':{'type':Sequelize[_0xf7b7('0x2')]},'description':{'type':Sequelize[_0xf7b7('0x2')]},'ticketType':{'type':Sequelize[_0xf7b7('0x3')]('incident',_0xf7b7('0x4')),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize[_0xf7b7('0x3')](_0xf7b7('0x5'),'nothing'),'defaultValue':_0xf7b7('0x5'),'allowNull':![]}};
\ No newline at end of file
+var _0x4c69=['STRING','ENUM','incident','contact','nothing','exports'];(function(_0x5be6b0,_0x10b9fc){var _0x2f34db=function(_0x4e85e8){while(--_0x4e85e8){_0x5be6b0['push'](_0x5be6b0['shift']());}};_0x2f34db(++_0x10b9fc);}(_0x4c69,0xb3));var _0x94c6=function(_0x564886,_0x3b136d){_0x564886=_0x564886-0x0;var _0x46703e=_0x4c69[_0x564886];return _0x46703e;};'use strict';var Sequelize=require('sequelize');module[_0x94c6('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x94c6('0x1')]},'ticketType':{'type':Sequelize[_0x94c6('0x2')](_0x94c6('0x3'),'phonecall'),'defaultValue':_0x94c6('0x3')},'moduleCreate':{'type':Sequelize[_0x94c6('0x2')](_0x94c6('0x4'),_0x94c6('0x5')),'defaultValue':_0x94c6('0x4'),'allowNull':![]}};
\ No newline at end of file
index 961d33b..673804a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6dd0=['path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','save','update','then','end','stack','name','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','filter','options','includeAll','include','rows','show','params','merge','find','catch','create','body','sort','pick','getFields','getSubjects','findOne','Dynamics365Field','getDescriptions','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x5008a5,_0x3fc733){var _0x26f1d4=function(_0x4d2d70){while(--_0x4d2d70){_0x5008a5['push'](_0x5008a5['shift']());}};_0x26f1d4(++_0x3fc733);}(_0x6dd0,0x17c));var _0x06dd=function(_0x6f87cc,_0x5a7350){_0x6f87cc=_0x6f87cc-0x0;var _0x232d03=_0x6dd0[_0x6f87cc];return _0x232d03;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x06dd('0x0'));var jsonpatch=require(_0x06dd('0x1'));var rp=require(_0x06dd('0x2'));var moment=require(_0x06dd('0x3'));var BPromise=require(_0x06dd('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x06dd('0x5'));var sox=require('sox');var csv=require(_0x06dd('0x6'));var ejs=require(_0x06dd('0x7'));var fs=require('fs');var fs_extra=require(_0x06dd('0x8'));var _=require(_0x06dd('0x9'));var squel=require(_0x06dd('0xa'));var crypto=require(_0x06dd('0xb'));var jsforce=require(_0x06dd('0xc'));var deskjs=require(_0x06dd('0xd'));var toCsv=require(_0x06dd('0x6'));var querystring=require(_0x06dd('0xe'));var Papa=require(_0x06dd('0xf'));var Redis=require(_0x06dd('0x10'));var authService=require(_0x06dd('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x06dd('0x12'));var logger=require(_0x06dd('0x13'))(_0x06dd('0x14'));var utils=require(_0x06dd('0x15'));var config=require(_0x06dd('0x16'));var licenseUtil=require(_0x06dd('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b299c,_0x2b7817){_0x2b7817=_0x2b7817||0xcc;return function(_0x9faef0){if(_0x9faef0){return _0x4b299c[_0x06dd('0x18')](_0x2b7817);}return _0x4b299c['status'](_0x2b7817)['end']();};}function respondWithResult(_0x454879,_0x3638a0){_0x3638a0=_0x3638a0||0xc8;return function(_0x5168d7){if(_0x5168d7){return _0x454879[_0x06dd('0x19')](_0x3638a0)[_0x06dd('0x1a')](_0x5168d7);}};}function respondWithFilteredResult(_0x26f2ac,_0x28a62e){return function(_0x11e6a1){if(_0x11e6a1){var _0x3a0522=typeof _0x28a62e['offset']===_0x06dd('0x1b')&&typeof _0x28a62e[_0x06dd('0x1c')]===_0x06dd('0x1b');var _0x31209f=_0x11e6a1[_0x06dd('0x1d')];var _0xa1762f=_0x3a0522?0x0:_0x28a62e[_0x06dd('0x1e')];var _0x28fb90=_0x3a0522?_0x11e6a1[_0x06dd('0x1d')]:_0x28a62e[_0x06dd('0x1e')]+_0x28a62e[_0x06dd('0x1c')];var _0x34a1f4;if(_0x28fb90>=_0x31209f){_0x28fb90=_0x31209f;_0x34a1f4=0xc8;}else{_0x34a1f4=0xce;}_0x26f2ac[_0x06dd('0x19')](_0x34a1f4);return _0x26f2ac[_0x06dd('0x1f')](_0x06dd('0x20'),_0xa1762f+'-'+_0x28fb90+'/'+_0x31209f)[_0x06dd('0x1a')](_0x11e6a1);}return null;};}function patchUpdates(_0x39be2e){return function(_0x4273a9){try{jsonpatch['apply'](_0x4273a9,_0x39be2e,!![]);}catch(_0x51bfca){return BPromise['reject'](_0x51bfca);}return _0x4273a9[_0x06dd('0x21')]();};}function saveUpdates(_0x4227a3,_0x1a69ff){return function(_0x5b175b){if(_0x5b175b){return _0x5b175b[_0x06dd('0x22')](_0x4227a3)[_0x06dd('0x23')](function(_0x33057a){return _0x33057a;});}return null;};}function removeEntity(_0x4f4041,_0x3461ae){return function(_0x58c54e){if(_0x58c54e){return _0x58c54e['destroy']()[_0x06dd('0x23')](function(){_0x4f4041['status'](0xcc)[_0x06dd('0x24')]();});}};}function handleEntityNotFound(_0x3c5776,_0x881ac4){return function(_0x4c4539){if(!_0x4c4539){_0x3c5776['sendStatus'](0x194);}return _0x4c4539;};}function handleError(_0x2b5e20,_0x8e0ca3){_0x8e0ca3=_0x8e0ca3||0x1f4;return function(_0x3693e4){logger['error'](_0x3693e4[_0x06dd('0x25')]);if(_0x3693e4['name']){delete _0x3693e4[_0x06dd('0x26')];}_0x2b5e20[_0x06dd('0x19')](_0x8e0ca3)['send'](_0x3693e4);};}exports[_0x06dd('0x27')]=function(_0x49e2d7,_0x1c6806){var _0x445095={},_0x38d786={},_0xe3a8fd={'count':0x0,'rows':[]};var _0x33667b=_[_0x06dd('0x28')](db[_0x06dd('0x29')][_0x06dd('0x2a')],function(_0x57a868){return{'name':_0x57a868[_0x06dd('0x2b')],'type':_0x57a868[_0x06dd('0x2c')][_0x06dd('0x2d')]};});_0x38d786[_0x06dd('0x2e')]=_[_0x06dd('0x28')](_0x33667b,_0x06dd('0x26'));_0x38d786[_0x06dd('0x2f')]=_[_0x06dd('0x30')](_0x49e2d7['query']);_0x38d786[_0x06dd('0x31')]=_[_0x06dd('0x32')](_0x38d786[_0x06dd('0x2e')],_0x38d786[_0x06dd('0x2f')]);_0x445095['attributes']=_[_0x06dd('0x32')](_0x38d786['model'],qs[_0x06dd('0x33')](_0x49e2d7[_0x06dd('0x2f')][_0x06dd('0x33')]));_0x445095[_0x06dd('0x34')]=_0x445095[_0x06dd('0x34')][_0x06dd('0x35')]?_0x445095[_0x06dd('0x34')]:_0x38d786[_0x06dd('0x2e')];if(!_0x49e2d7[_0x06dd('0x2f')][_0x06dd('0x36')](_0x06dd('0x37'))){_0x445095['limit']=qs['limit'](_0x49e2d7[_0x06dd('0x2f')][_0x06dd('0x1c')]);_0x445095[_0x06dd('0x1e')]=qs[_0x06dd('0x1e')](_0x49e2d7[_0x06dd('0x2f')][_0x06dd('0x1e')]);}_0x445095[_0x06dd('0x38')]=qs['sort'](_0x49e2d7['query']['sort']);_0x445095[_0x06dd('0x39')]=qs[_0x06dd('0x31')](_['pick'](_0x49e2d7[_0x06dd('0x2f')],_0x38d786['filters']),_0x33667b);if(_0x49e2d7[_0x06dd('0x2f')][_0x06dd('0x3a')]){_0x445095['where']=_['merge'](_0x445095['where'],{'$or':_['map'](_0x33667b,function(_0x266f18){if(_0x266f18['type']!=='VIRTUAL'){var _0x3db1f1={};_0x3db1f1[_0x266f18[_0x06dd('0x26')]]={'$like':'%'+_0x49e2d7[_0x06dd('0x2f')][_0x06dd('0x3a')]+'%'};return _0x3db1f1;}})});}_0x445095=_['merge']({},_0x445095,_0x49e2d7[_0x06dd('0x3b')]);var _0x3a6f65={'where':_0x445095[_0x06dd('0x39')]};return db[_0x06dd('0x29')][_0x06dd('0x1d')](_0x3a6f65)[_0x06dd('0x23')](function(_0x724558){_0xe3a8fd[_0x06dd('0x1d')]=_0x724558;if(_0x49e2d7[_0x06dd('0x2f')][_0x06dd('0x3c')]){_0x445095[_0x06dd('0x3d')]=[{'all':!![]}];}return db[_0x06dd('0x29')]['findAll'](_0x445095);})[_0x06dd('0x23')](function(_0x35df3b){_0xe3a8fd[_0x06dd('0x3e')]=_0x35df3b;return _0xe3a8fd;})[_0x06dd('0x23')](respondWithFilteredResult(_0x1c6806,_0x445095))['catch'](handleError(_0x1c6806,null));};exports[_0x06dd('0x3f')]=function(_0x33c5e3,_0x50d062){var _0x5abc08={'raw':![],'where':{'id':_0x33c5e3[_0x06dd('0x40')]['id']}},_0x69cee8={};_0x69cee8[_0x06dd('0x2e')]=_[_0x06dd('0x30')](db['Dynamics365Configuration']['rawAttributes']);_0x69cee8[_0x06dd('0x2f')]=_[_0x06dd('0x30')](_0x33c5e3[_0x06dd('0x2f')]);_0x69cee8[_0x06dd('0x31')]=_[_0x06dd('0x32')](_0x69cee8[_0x06dd('0x2e')],_0x69cee8['query']);_0x5abc08[_0x06dd('0x34')]=_[_0x06dd('0x32')](_0x69cee8['model'],qs[_0x06dd('0x33')](_0x33c5e3[_0x06dd('0x2f')][_0x06dd('0x33')]));_0x5abc08['attributes']=_0x5abc08[_0x06dd('0x34')]['length']?_0x5abc08[_0x06dd('0x34')]:_0x69cee8[_0x06dd('0x2e')];if(_0x33c5e3[_0x06dd('0x2f')]['includeAll']){_0x5abc08[_0x06dd('0x3d')]=[{'all':!![]}];}_0x5abc08=_[_0x06dd('0x41')]({},_0x5abc08,_0x33c5e3['options']);return db[_0x06dd('0x29')][_0x06dd('0x42')](_0x5abc08)[_0x06dd('0x23')](handleEntityNotFound(_0x50d062,null))[_0x06dd('0x23')](respondWithResult(_0x50d062,null))[_0x06dd('0x43')](handleError(_0x50d062,null));};exports[_0x06dd('0x44')]=function(_0x199773,_0x58d707){return db[_0x06dd('0x29')][_0x06dd('0x44')](_0x199773[_0x06dd('0x45')],{})[_0x06dd('0x23')](respondWithResult(_0x58d707,0xc9))['catch'](handleError(_0x58d707,null));};exports[_0x06dd('0x22')]=function(_0x34e33c,_0x16f479){if(_0x34e33c[_0x06dd('0x45')]['id']){delete _0x34e33c[_0x06dd('0x45')]['id'];}return db[_0x06dd('0x29')][_0x06dd('0x42')]({'where':{'id':_0x34e33c[_0x06dd('0x40')]['id']}})['then'](handleEntityNotFound(_0x16f479,null))['then'](saveUpdates(_0x34e33c[_0x06dd('0x45')],null))[_0x06dd('0x23')](respondWithResult(_0x16f479,null))[_0x06dd('0x43')](handleError(_0x16f479,null));};exports['destroy']=function(_0x1cf62b,_0xfc7260){return db['Dynamics365Configuration'][_0x06dd('0x42')]({'where':{'id':_0x1cf62b[_0x06dd('0x40')]['id']}})['then'](handleEntityNotFound(_0xfc7260,null))[_0x06dd('0x23')](removeEntity(_0xfc7260,null))[_0x06dd('0x43')](handleError(_0xfc7260,null));};exports['getFields']=function(_0x46ccb1,_0x4b05db,_0x45a78c){var _0x1d7684={};var _0x432fe6={};var _0x14b812;var _0x2ec1b0;return db[_0x06dd('0x29')]['findOne']({'where':{'id':_0x46ccb1['params']['id']}})[_0x06dd('0x23')](handleEntityNotFound(_0x4b05db,null))[_0x06dd('0x23')](function(_0x469d20){if(_0x469d20){_0x14b812=_0x469d20;_0x432fe6[_0x06dd('0x2e')]=_[_0x06dd('0x30')](db['Dynamics365Field'][_0x06dd('0x2a')]);_0x432fe6[_0x06dd('0x2f')]=_[_0x06dd('0x30')](_0x46ccb1['query']);_0x432fe6[_0x06dd('0x31')]=_[_0x06dd('0x32')](_0x432fe6[_0x06dd('0x2e')],_0x432fe6[_0x06dd('0x2f')]);_0x1d7684[_0x06dd('0x34')]=_['intersection'](_0x432fe6[_0x06dd('0x2e')],qs['fields'](_0x46ccb1[_0x06dd('0x2f')][_0x06dd('0x33')]));_0x1d7684[_0x06dd('0x34')]=_0x1d7684[_0x06dd('0x34')][_0x06dd('0x35')]?_0x1d7684[_0x06dd('0x34')]:_0x432fe6[_0x06dd('0x2e')];_0x1d7684[_0x06dd('0x38')]=qs[_0x06dd('0x46')](_0x46ccb1['query'][_0x06dd('0x46')]);_0x1d7684['where']=qs[_0x06dd('0x31')](_[_0x06dd('0x47')](_0x46ccb1['query'],_0x432fe6[_0x06dd('0x31')]));if(_0x46ccb1[_0x06dd('0x2f')][_0x06dd('0x3a')]){_0x1d7684['where']=_[_0x06dd('0x41')](_0x1d7684[_0x06dd('0x39')],{'$or':_[_0x06dd('0x28')](_0x1d7684[_0x06dd('0x34')],function(_0x19e93c){var _0x54c1d4={};_0x54c1d4[_0x19e93c]={'$like':'%'+_0x46ccb1['query'][_0x06dd('0x3a')]+'%'};return _0x54c1d4;})});}_0x1d7684=_[_0x06dd('0x41')]({},_0x1d7684,_0x46ccb1[_0x06dd('0x3b')]);return _0x14b812[_0x06dd('0x48')](_0x1d7684);}})[_0x06dd('0x23')](function(_0x26d215){if(_0x26d215){_0x2ec1b0=_0x26d215[_0x06dd('0x35')];if(!_0x46ccb1[_0x06dd('0x2f')][_0x06dd('0x36')](_0x06dd('0x37'))){_0x1d7684[_0x06dd('0x1c')]=qs['limit'](_0x46ccb1[_0x06dd('0x2f')]['limit']);_0x1d7684[_0x06dd('0x1e')]=qs['offset'](_0x46ccb1[_0x06dd('0x2f')][_0x06dd('0x1e')]);}return _0x14b812['getFields'](_0x1d7684);}})[_0x06dd('0x23')](function(_0x555605){if(_0x555605){return _0x555605?{'count':_0x2ec1b0,'rows':_0x555605}:null;}})[_0x06dd('0x23')](respondWithResult(_0x4b05db,null))[_0x06dd('0x43')](handleError(_0x4b05db,null));};exports[_0x06dd('0x49')]=function(_0x169859,_0x40ef93,_0x59acd7){var _0x126077={};var _0x57c3aa={};var _0x4d7065;var _0x2698b8;return db[_0x06dd('0x29')][_0x06dd('0x4a')]({'where':{'id':_0x169859[_0x06dd('0x40')]['id']}})['then'](handleEntityNotFound(_0x40ef93,null))[_0x06dd('0x23')](function(_0x2012cd){if(_0x2012cd){_0x4d7065=_0x2012cd;_0x57c3aa['model']=_[_0x06dd('0x30')](db[_0x06dd('0x4b')][_0x06dd('0x2a')]);_0x57c3aa[_0x06dd('0x2f')]=_[_0x06dd('0x30')](_0x169859[_0x06dd('0x2f')]);_0x57c3aa[_0x06dd('0x31')]=_[_0x06dd('0x32')](_0x57c3aa[_0x06dd('0x2e')],_0x57c3aa[_0x06dd('0x2f')]);_0x126077[_0x06dd('0x34')]=_[_0x06dd('0x32')](_0x57c3aa[_0x06dd('0x2e')],qs[_0x06dd('0x33')](_0x169859[_0x06dd('0x2f')][_0x06dd('0x33')]));_0x126077['attributes']=_0x126077[_0x06dd('0x34')][_0x06dd('0x35')]?_0x126077['attributes']:_0x57c3aa[_0x06dd('0x2e')];_0x126077['order']=qs[_0x06dd('0x46')](_0x169859['query'][_0x06dd('0x46')]);_0x126077['where']=qs[_0x06dd('0x31')](_[_0x06dd('0x47')](_0x169859[_0x06dd('0x2f')],_0x57c3aa[_0x06dd('0x31')]));if(_0x169859[_0x06dd('0x2f')][_0x06dd('0x3a')]){_0x126077[_0x06dd('0x39')]=_[_0x06dd('0x41')](_0x126077[_0x06dd('0x39')],{'$or':_[_0x06dd('0x28')](_0x126077[_0x06dd('0x34')],function(_0x523475){var _0x249a9a={};_0x249a9a[_0x523475]={'$like':'%'+_0x169859['query'][_0x06dd('0x3a')]+'%'};return _0x249a9a;})});}_0x126077=_[_0x06dd('0x41')]({},_0x126077,_0x169859[_0x06dd('0x3b')]);return _0x4d7065[_0x06dd('0x49')](_0x126077);}})[_0x06dd('0x23')](function(_0x3c1f71){if(_0x3c1f71){_0x2698b8=_0x3c1f71['length'];if(!_0x169859[_0x06dd('0x2f')]['hasOwnProperty'](_0x06dd('0x37'))){_0x126077['limit']=qs['limit'](_0x169859[_0x06dd('0x2f')][_0x06dd('0x1c')]);_0x126077['offset']=qs[_0x06dd('0x1e')](_0x169859[_0x06dd('0x2f')]['offset']);}return _0x4d7065[_0x06dd('0x49')](_0x126077);}})[_0x06dd('0x23')](function(_0x416c9d){if(_0x416c9d){return _0x416c9d?{'count':_0x2698b8,'rows':_0x416c9d}:null;}})[_0x06dd('0x23')](respondWithResult(_0x40ef93,null))[_0x06dd('0x43')](handleError(_0x40ef93,null));};exports[_0x06dd('0x4c')]=function(_0x43e40f,_0x337b8b,_0x3cf2fc){var _0x230311={};var _0x510a17={};var _0xe14678;var _0xa8aa6c;return db[_0x06dd('0x29')]['findOne']({'where':{'id':_0x43e40f[_0x06dd('0x40')]['id']}})[_0x06dd('0x23')](handleEntityNotFound(_0x337b8b,null))[_0x06dd('0x23')](function(_0x5cbbac){if(_0x5cbbac){_0xe14678=_0x5cbbac;_0x510a17[_0x06dd('0x2e')]=_[_0x06dd('0x30')](db[_0x06dd('0x4b')][_0x06dd('0x2a')]);_0x510a17[_0x06dd('0x2f')]=_[_0x06dd('0x30')](_0x43e40f[_0x06dd('0x2f')]);_0x510a17[_0x06dd('0x31')]=_[_0x06dd('0x32')](_0x510a17['model'],_0x510a17[_0x06dd('0x2f')]);_0x230311[_0x06dd('0x34')]=_[_0x06dd('0x32')](_0x510a17[_0x06dd('0x2e')],qs[_0x06dd('0x33')](_0x43e40f[_0x06dd('0x2f')]['fields']));_0x230311[_0x06dd('0x34')]=_0x230311[_0x06dd('0x34')][_0x06dd('0x35')]?_0x230311[_0x06dd('0x34')]:_0x510a17[_0x06dd('0x2e')];_0x230311['order']=qs[_0x06dd('0x46')](_0x43e40f[_0x06dd('0x2f')][_0x06dd('0x46')]);_0x230311[_0x06dd('0x39')]=qs[_0x06dd('0x31')](_[_0x06dd('0x47')](_0x43e40f[_0x06dd('0x2f')],_0x510a17[_0x06dd('0x31')]));if(_0x43e40f[_0x06dd('0x2f')]['filter']){_0x230311[_0x06dd('0x39')]=_['merge'](_0x230311[_0x06dd('0x39')],{'$or':_[_0x06dd('0x28')](_0x230311[_0x06dd('0x34')],function(_0x5a0a38){var _0xdd4136={};_0xdd4136[_0x5a0a38]={'$like':'%'+_0x43e40f['query'][_0x06dd('0x3a')]+'%'};return _0xdd4136;})});}_0x230311=_[_0x06dd('0x41')]({},_0x230311,_0x43e40f[_0x06dd('0x3b')]);return _0xe14678[_0x06dd('0x4c')](_0x230311);}})[_0x06dd('0x23')](function(_0x2e42c4){if(_0x2e42c4){_0xa8aa6c=_0x2e42c4[_0x06dd('0x35')];if(!_0x43e40f['query'][_0x06dd('0x36')](_0x06dd('0x37'))){_0x230311[_0x06dd('0x1c')]=qs[_0x06dd('0x1c')](_0x43e40f['query'][_0x06dd('0x1c')]);_0x230311[_0x06dd('0x1e')]=qs[_0x06dd('0x1e')](_0x43e40f[_0x06dd('0x2f')][_0x06dd('0x1e')]);}return _0xe14678[_0x06dd('0x4c')](_0x230311);}})[_0x06dd('0x23')](function(_0x503a46){if(_0x503a46){return _0x503a46?{'count':_0xa8aa6c,'rows':_0x503a46}:null;}})[_0x06dd('0x23')](respondWithResult(_0x337b8b,null))[_0x06dd('0x43')](handleError(_0x337b8b,null));};
\ No newline at end of file
+var _0x7803=['to-csv','fs-extra','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','apply','update','then','destroy','end','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','fields','attributes','length','model','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','Dynamics365Configuration','includeAll','include','findAll','rows','catch','show','params','create','body','find','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird'];(function(_0x168e45,_0x1932a2){var _0x2bfbbd=function(_0x2b6d84){while(--_0x2b6d84){_0x168e45['push'](_0x168e45['shift']());}};_0x2bfbbd(++_0x1932a2);}(_0x7803,0x1eb));var _0x3780=function(_0x30e35b,_0x10009a){_0x30e35b=_0x30e35b-0x0;var _0x36d2bd=_0x7803[_0x30e35b];return _0x36d2bd;};'use strict';var emlformat=require(_0x3780('0x0'));var rimraf=require(_0x3780('0x1'));var zipdir=require(_0x3780('0x2'));var jsonpatch=require(_0x3780('0x3'));var rp=require(_0x3780('0x4'));var moment=require('moment');var BPromise=require(_0x3780('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x3780('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3780('0x7'));var _=require('lodash');var squel=require(_0x3780('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3780('0x6'));var querystring=require(_0x3780('0x9'));var Papa=require(_0x3780('0xa'));var Redis=require(_0x3780('0xb'));var authService=require(_0x3780('0xc'));var qs=require(_0x3780('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3780('0xe'));var logger=require(_0x3780('0xf'))(_0x3780('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3780('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2603f5,_0x57ec25){_0x57ec25=_0x57ec25||0xcc;return function(_0x566630){if(_0x566630){return _0x2603f5[_0x3780('0x12')](_0x57ec25);}return _0x2603f5[_0x3780('0x13')](_0x57ec25)['end']();};}function respondWithResult(_0x3a50de,_0x46c284){_0x46c284=_0x46c284||0xc8;return function(_0x27482e){if(_0x27482e){return _0x3a50de[_0x3780('0x13')](_0x46c284)[_0x3780('0x14')](_0x27482e);}};}function respondWithFilteredResult(_0x40babf,_0x578b42){return function(_0x1eae05){if(_0x1eae05){var _0x2ad4d9=typeof _0x578b42[_0x3780('0x15')]===_0x3780('0x16')&&typeof _0x578b42['limit']===_0x3780('0x16');var _0x49b4e4=_0x1eae05[_0x3780('0x17')];var _0x1bc43c=_0x2ad4d9?0x0:_0x578b42['offset'];var _0x4c72c4=_0x2ad4d9?_0x1eae05[_0x3780('0x17')]:_0x578b42[_0x3780('0x15')]+_0x578b42[_0x3780('0x18')];var _0x41a359;if(_0x4c72c4>=_0x49b4e4){_0x4c72c4=_0x49b4e4;_0x41a359=0xc8;}else{_0x41a359=0xce;}_0x40babf[_0x3780('0x13')](_0x41a359);return _0x40babf[_0x3780('0x19')]('Content-Range',_0x1bc43c+'-'+_0x4c72c4+'/'+_0x49b4e4)['json'](_0x1eae05);}return null;};}function patchUpdates(_0x3a7589){return function(_0x36f57e){try{jsonpatch[_0x3780('0x1a')](_0x36f57e,_0x3a7589,!![]);}catch(_0x2ff2ed){return BPromise['reject'](_0x2ff2ed);}return _0x36f57e['save']();};}function saveUpdates(_0x3a8165,_0x25002c){return function(_0x2000de){if(_0x2000de){return _0x2000de[_0x3780('0x1b')](_0x3a8165)[_0x3780('0x1c')](function(_0x563f5d){return _0x563f5d;});}return null;};}function removeEntity(_0x335cfc,_0x14bf2d){return function(_0x3a85a9){if(_0x3a85a9){return _0x3a85a9[_0x3780('0x1d')]()[_0x3780('0x1c')](function(){_0x335cfc['status'](0xcc)[_0x3780('0x1e')]();});}};}function handleEntityNotFound(_0x3d2e70,_0xf1d2ef){return function(_0x5f33cc){if(!_0x5f33cc){_0x3d2e70[_0x3780('0x12')](0x194);}return _0x5f33cc;};}function handleError(_0x1b33c0,_0x55a2df){_0x55a2df=_0x55a2df||0x1f4;return function(_0x477479){logger['error'](_0x477479['stack']);if(_0x477479['name']){delete _0x477479[_0x3780('0x1f')];}_0x1b33c0[_0x3780('0x13')](_0x55a2df)[_0x3780('0x20')](_0x477479);};}exports[_0x3780('0x21')]=function(_0x5c01e1,_0x1b45f4){var _0x5a201b={},_0xa5c4d2={},_0x13c201={'count':0x0,'rows':[]};var _0xe189a8=_[_0x3780('0x22')](db['Dynamics365Configuration'][_0x3780('0x23')],function(_0x4386f9){return{'name':_0x4386f9[_0x3780('0x24')],'type':_0x4386f9[_0x3780('0x25')]['key']};});_0xa5c4d2['model']=_[_0x3780('0x22')](_0xe189a8,'name');_0xa5c4d2[_0x3780('0x26')]=_[_0x3780('0x27')](_0x5c01e1['query']);_0xa5c4d2[_0x3780('0x28')]=_[_0x3780('0x29')](_0xa5c4d2['model'],_0xa5c4d2[_0x3780('0x26')]);_0x5a201b['attributes']=_[_0x3780('0x29')](_0xa5c4d2['model'],qs['fields'](_0x5c01e1[_0x3780('0x26')][_0x3780('0x2a')]));_0x5a201b[_0x3780('0x2b')]=_0x5a201b[_0x3780('0x2b')][_0x3780('0x2c')]?_0x5a201b[_0x3780('0x2b')]:_0xa5c4d2[_0x3780('0x2d')];if(!_0x5c01e1[_0x3780('0x26')][_0x3780('0x2e')]('nolimit')){_0x5a201b[_0x3780('0x18')]=qs['limit'](_0x5c01e1['query'][_0x3780('0x18')]);_0x5a201b['offset']=qs[_0x3780('0x15')](_0x5c01e1[_0x3780('0x26')][_0x3780('0x15')]);}_0x5a201b[_0x3780('0x2f')]=qs[_0x3780('0x30')](_0x5c01e1[_0x3780('0x26')][_0x3780('0x30')]);_0x5a201b['where']=qs[_0x3780('0x28')](_[_0x3780('0x31')](_0x5c01e1[_0x3780('0x26')],_0xa5c4d2[_0x3780('0x28')]),_0xe189a8);if(_0x5c01e1[_0x3780('0x26')][_0x3780('0x32')]){_0x5a201b[_0x3780('0x33')]=_[_0x3780('0x34')](_0x5a201b[_0x3780('0x33')],{'$or':_[_0x3780('0x22')](_0xe189a8,function(_0x69ce65){if(_0x69ce65[_0x3780('0x25')]!==_0x3780('0x35')){var _0xc45a00={};_0xc45a00[_0x69ce65[_0x3780('0x1f')]]={'$like':'%'+_0x5c01e1[_0x3780('0x26')][_0x3780('0x32')]+'%'};return _0xc45a00;}})});}_0x5a201b=_[_0x3780('0x34')]({},_0x5a201b,_0x5c01e1[_0x3780('0x36')]);var _0x807bb3={'where':_0x5a201b[_0x3780('0x33')]};return db[_0x3780('0x37')]['count'](_0x807bb3)[_0x3780('0x1c')](function(_0x162da6){_0x13c201['count']=_0x162da6;if(_0x5c01e1[_0x3780('0x26')][_0x3780('0x38')]){_0x5a201b[_0x3780('0x39')]=[{'all':!![]}];}return db[_0x3780('0x37')][_0x3780('0x3a')](_0x5a201b);})['then'](function(_0x2158bd){_0x13c201[_0x3780('0x3b')]=_0x2158bd;return _0x13c201;})['then'](respondWithFilteredResult(_0x1b45f4,_0x5a201b))[_0x3780('0x3c')](handleError(_0x1b45f4,null));};exports[_0x3780('0x3d')]=function(_0x46b0a3,_0x4c5573){var _0x48bcd3={'raw':![],'where':{'id':_0x46b0a3[_0x3780('0x3e')]['id']}},_0x3a3993={};_0x3a3993['model']=_[_0x3780('0x27')](db[_0x3780('0x37')][_0x3780('0x23')]);_0x3a3993[_0x3780('0x26')]=_['keys'](_0x46b0a3[_0x3780('0x26')]);_0x3a3993[_0x3780('0x28')]=_['intersection'](_0x3a3993[_0x3780('0x2d')],_0x3a3993['query']);_0x48bcd3[_0x3780('0x2b')]=_[_0x3780('0x29')](_0x3a3993[_0x3780('0x2d')],qs[_0x3780('0x2a')](_0x46b0a3[_0x3780('0x26')]['fields']));_0x48bcd3[_0x3780('0x2b')]=_0x48bcd3[_0x3780('0x2b')]['length']?_0x48bcd3[_0x3780('0x2b')]:_0x3a3993['model'];if(_0x46b0a3['query'][_0x3780('0x38')]){_0x48bcd3[_0x3780('0x39')]=[{'all':!![]}];}_0x48bcd3=_[_0x3780('0x34')]({},_0x48bcd3,_0x46b0a3['options']);return db[_0x3780('0x37')]['find'](_0x48bcd3)[_0x3780('0x1c')](handleEntityNotFound(_0x4c5573,null))['then'](respondWithResult(_0x4c5573,null))[_0x3780('0x3c')](handleError(_0x4c5573,null));};exports[_0x3780('0x3f')]=function(_0x3e7ccd,_0x14c639){return db[_0x3780('0x37')][_0x3780('0x3f')](_0x3e7ccd[_0x3780('0x40')],{})['then'](respondWithResult(_0x14c639,0xc9))[_0x3780('0x3c')](handleError(_0x14c639,null));};exports[_0x3780('0x1b')]=function(_0x5b9be3,_0x29b48b){if(_0x5b9be3[_0x3780('0x40')]['id']){delete _0x5b9be3[_0x3780('0x40')]['id'];}return db[_0x3780('0x37')]['find']({'where':{'id':_0x5b9be3[_0x3780('0x3e')]['id']}})['then'](handleEntityNotFound(_0x29b48b,null))[_0x3780('0x1c')](saveUpdates(_0x5b9be3[_0x3780('0x40')],null))[_0x3780('0x1c')](respondWithResult(_0x29b48b,null))[_0x3780('0x3c')](handleError(_0x29b48b,null));};exports['destroy']=function(_0x1a0886,_0x594144){return db[_0x3780('0x37')][_0x3780('0x41')]({'where':{'id':_0x1a0886[_0x3780('0x3e')]['id']}})[_0x3780('0x1c')](handleEntityNotFound(_0x594144,null))[_0x3780('0x1c')](removeEntity(_0x594144,null))[_0x3780('0x3c')](handleError(_0x594144,null));};exports[_0x3780('0x42')]=function(_0x24c842,_0x349f14,_0x21b04a){var _0x21f25d={};var _0x42edf2={};var _0x4d937b;var _0x4db550;return db[_0x3780('0x37')][_0x3780('0x43')]({'where':{'id':_0x24c842['params']['id']}})[_0x3780('0x1c')](handleEntityNotFound(_0x349f14,null))[_0x3780('0x1c')](function(_0x118d9d){if(_0x118d9d){_0x4d937b=_0x118d9d;_0x42edf2[_0x3780('0x2d')]=_[_0x3780('0x27')](db[_0x3780('0x44')][_0x3780('0x23')]);_0x42edf2[_0x3780('0x26')]=_[_0x3780('0x27')](_0x24c842[_0x3780('0x26')]);_0x42edf2[_0x3780('0x28')]=_[_0x3780('0x29')](_0x42edf2[_0x3780('0x2d')],_0x42edf2[_0x3780('0x26')]);_0x21f25d[_0x3780('0x2b')]=_[_0x3780('0x29')](_0x42edf2[_0x3780('0x2d')],qs['fields'](_0x24c842[_0x3780('0x26')][_0x3780('0x2a')]));_0x21f25d[_0x3780('0x2b')]=_0x21f25d[_0x3780('0x2b')][_0x3780('0x2c')]?_0x21f25d['attributes']:_0x42edf2['model'];_0x21f25d['order']=qs['sort'](_0x24c842[_0x3780('0x26')][_0x3780('0x30')]);_0x21f25d[_0x3780('0x33')]=qs[_0x3780('0x28')](_[_0x3780('0x31')](_0x24c842[_0x3780('0x26')],_0x42edf2['filters']));if(_0x24c842[_0x3780('0x26')][_0x3780('0x32')]){_0x21f25d[_0x3780('0x33')]=_['merge'](_0x21f25d[_0x3780('0x33')],{'$or':_['map'](_0x21f25d[_0x3780('0x2b')],function(_0x3dca33){var _0x5349b5={};_0x5349b5[_0x3dca33]={'$like':'%'+_0x24c842[_0x3780('0x26')]['filter']+'%'};return _0x5349b5;})});}_0x21f25d=_[_0x3780('0x34')]({},_0x21f25d,_0x24c842['options']);return _0x4d937b['getFields'](_0x21f25d);}})['then'](function(_0x15e1f6){if(_0x15e1f6){_0x4db550=_0x15e1f6['length'];if(!_0x24c842['query'][_0x3780('0x2e')]('nolimit')){_0x21f25d[_0x3780('0x18')]=qs[_0x3780('0x18')](_0x24c842['query'][_0x3780('0x18')]);_0x21f25d['offset']=qs['offset'](_0x24c842[_0x3780('0x26')][_0x3780('0x15')]);}return _0x4d937b[_0x3780('0x42')](_0x21f25d);}})[_0x3780('0x1c')](function(_0x3277b8){if(_0x3277b8){return _0x3277b8?{'count':_0x4db550,'rows':_0x3277b8}:null;}})[_0x3780('0x1c')](respondWithResult(_0x349f14,null))[_0x3780('0x3c')](handleError(_0x349f14,null));};exports['getSubjects']=function(_0x536edc,_0x319e12,_0x51b458){var _0x2b300f={};var _0x5e8157={};var _0x5ee9e1;var _0x2e188f;return db[_0x3780('0x37')][_0x3780('0x43')]({'where':{'id':_0x536edc[_0x3780('0x3e')]['id']}})[_0x3780('0x1c')](handleEntityNotFound(_0x319e12,null))[_0x3780('0x1c')](function(_0x5a23cc){if(_0x5a23cc){_0x5ee9e1=_0x5a23cc;_0x5e8157['model']=_[_0x3780('0x27')](db[_0x3780('0x44')]['rawAttributes']);_0x5e8157[_0x3780('0x26')]=_[_0x3780('0x27')](_0x536edc[_0x3780('0x26')]);_0x5e8157[_0x3780('0x28')]=_[_0x3780('0x29')](_0x5e8157[_0x3780('0x2d')],_0x5e8157['query']);_0x2b300f[_0x3780('0x2b')]=_[_0x3780('0x29')](_0x5e8157[_0x3780('0x2d')],qs['fields'](_0x536edc['query']['fields']));_0x2b300f[_0x3780('0x2b')]=_0x2b300f[_0x3780('0x2b')][_0x3780('0x2c')]?_0x2b300f[_0x3780('0x2b')]:_0x5e8157[_0x3780('0x2d')];_0x2b300f[_0x3780('0x2f')]=qs['sort'](_0x536edc['query'][_0x3780('0x30')]);_0x2b300f[_0x3780('0x33')]=qs[_0x3780('0x28')](_['pick'](_0x536edc[_0x3780('0x26')],_0x5e8157[_0x3780('0x28')]));if(_0x536edc[_0x3780('0x26')][_0x3780('0x32')]){_0x2b300f['where']=_['merge'](_0x2b300f[_0x3780('0x33')],{'$or':_[_0x3780('0x22')](_0x2b300f[_0x3780('0x2b')],function(_0x48d7a9){var _0x312fb6={};_0x312fb6[_0x48d7a9]={'$like':'%'+_0x536edc[_0x3780('0x26')][_0x3780('0x32')]+'%'};return _0x312fb6;})});}_0x2b300f=_[_0x3780('0x34')]({},_0x2b300f,_0x536edc[_0x3780('0x36')]);return _0x5ee9e1[_0x3780('0x45')](_0x2b300f);}})['then'](function(_0x2ccb78){if(_0x2ccb78){_0x2e188f=_0x2ccb78[_0x3780('0x2c')];if(!_0x536edc[_0x3780('0x26')]['hasOwnProperty']('nolimit')){_0x2b300f[_0x3780('0x18')]=qs[_0x3780('0x18')](_0x536edc['query'][_0x3780('0x18')]);_0x2b300f[_0x3780('0x15')]=qs[_0x3780('0x15')](_0x536edc['query'][_0x3780('0x15')]);}return _0x5ee9e1[_0x3780('0x45')](_0x2b300f);}})[_0x3780('0x1c')](function(_0x527580){if(_0x527580){return _0x527580?{'count':_0x2e188f,'rows':_0x527580}:null;}})[_0x3780('0x1c')](respondWithResult(_0x319e12,null))[_0x3780('0x3c')](handleError(_0x319e12,null));};exports[_0x3780('0x46')]=function(_0x15a357,_0x1f4fd3,_0x159c53){var _0x58e359={};var _0x52ab56={};var _0x4f8183;var _0x2c1e88;return db[_0x3780('0x37')][_0x3780('0x43')]({'where':{'id':_0x15a357[_0x3780('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1f4fd3,null))[_0x3780('0x1c')](function(_0x328fd9){if(_0x328fd9){_0x4f8183=_0x328fd9;_0x52ab56[_0x3780('0x2d')]=_[_0x3780('0x27')](db[_0x3780('0x44')][_0x3780('0x23')]);_0x52ab56[_0x3780('0x26')]=_[_0x3780('0x27')](_0x15a357[_0x3780('0x26')]);_0x52ab56[_0x3780('0x28')]=_[_0x3780('0x29')](_0x52ab56[_0x3780('0x2d')],_0x52ab56[_0x3780('0x26')]);_0x58e359['attributes']=_[_0x3780('0x29')](_0x52ab56[_0x3780('0x2d')],qs[_0x3780('0x2a')](_0x15a357[_0x3780('0x26')]['fields']));_0x58e359[_0x3780('0x2b')]=_0x58e359[_0x3780('0x2b')][_0x3780('0x2c')]?_0x58e359['attributes']:_0x52ab56[_0x3780('0x2d')];_0x58e359[_0x3780('0x2f')]=qs[_0x3780('0x30')](_0x15a357[_0x3780('0x26')][_0x3780('0x30')]);_0x58e359[_0x3780('0x33')]=qs['filters'](_[_0x3780('0x31')](_0x15a357[_0x3780('0x26')],_0x52ab56['filters']));if(_0x15a357[_0x3780('0x26')][_0x3780('0x32')]){_0x58e359[_0x3780('0x33')]=_[_0x3780('0x34')](_0x58e359[_0x3780('0x33')],{'$or':_[_0x3780('0x22')](_0x58e359['attributes'],function(_0x5d336f){var _0x49b892={};_0x49b892[_0x5d336f]={'$like':'%'+_0x15a357[_0x3780('0x26')][_0x3780('0x32')]+'%'};return _0x49b892;})});}_0x58e359=_[_0x3780('0x34')]({},_0x58e359,_0x15a357[_0x3780('0x36')]);return _0x4f8183[_0x3780('0x46')](_0x58e359);}})['then'](function(_0x1c0d7e){if(_0x1c0d7e){_0x2c1e88=_0x1c0d7e[_0x3780('0x2c')];if(!_0x15a357['query'][_0x3780('0x2e')]('nolimit')){_0x58e359[_0x3780('0x18')]=qs[_0x3780('0x18')](_0x15a357['query'][_0x3780('0x18')]);_0x58e359[_0x3780('0x15')]=qs[_0x3780('0x15')](_0x15a357[_0x3780('0x26')][_0x3780('0x15')]);}return _0x4f8183[_0x3780('0x46')](_0x58e359);}})[_0x3780('0x1c')](function(_0x265c74){if(_0x265c74){return _0x265c74?{'count':_0x2c1e88,'rows':_0x265c74}:null;}})[_0x3780('0x1c')](respondWithResult(_0x1f4fd3,null))[_0x3780('0x3c')](handleError(_0x1f4fd3,null));};
\ No newline at end of file
index dcfe0c4..aff7ed7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a19=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0x9a19,0x114));var _0x99a1=function(_0x474d97,_0x5909ce){_0x474d97=_0x474d97-0x0;var _0x1edf25=_0x9a19[_0x474d97];return _0x1edf25;};'use strict';var _=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var logger=require(_0x99a1('0x2'))('api');var moment=require(_0x99a1('0x3'));var BPromise=require(_0x99a1('0x4'));var rp=require(_0x99a1('0x5'));var fs=require('fs');var path=require(_0x99a1('0x6'));var rimraf=require(_0x99a1('0x7'));var config=require(_0x99a1('0x8'));var attributes=require(_0x99a1('0x9'));module[_0x99a1('0xa')]=function(_0x3eff4a,_0xff0240){return _0x3eff4a[_0x99a1('0xb')]('Dynamics365Configuration',attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbec5=['request-promise','path','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','api','moment','bluebird'];(function(_0x23f035,_0x9cf5ed){var _0x5c2375=function(_0x7f7438){while(--_0x7f7438){_0x23f035['push'](_0x23f035['shift']());}};_0x5c2375(++_0x9cf5ed);}(_0xbec5,0xe5));var _0x5bec=function(_0x2b2b33,_0x56606f){_0x2b2b33=_0x2b2b33-0x0;var _0x229157=_0xbec5[_0x2b2b33];return _0x229157;};'use strict';var _=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var logger=require('../../config/logger')(_0x5bec('0x2'));var moment=require(_0x5bec('0x3'));var BPromise=require(_0x5bec('0x4'));var rp=require(_0x5bec('0x5'));var fs=require('fs');var path=require(_0x5bec('0x6'));var rimraf=require('rimraf');var config=require(_0x5bec('0x7'));var attributes=require(_0x5bec('0x8'));module[_0x5bec('0x9')]=function(_0x4aaac6,_0x3ed67a){return _0x4aaac6[_0x5bec('0xa')](_0x5bec('0xb'),attributes,{'tableName':_0x5bec('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a36d751..efc3df6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8fe8=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0x8fe8,0xaa));var _0x88fe=function(_0x12c35f,_0x45a1d3){_0x12c35f=_0x12c35f-0x0;var _0x2d02cc=_0x8fe8[_0x12c35f];return _0x2d02cc;};'use strict';var _=require(_0x88fe('0x0'));var util=require(_0x88fe('0x1'));var moment=require(_0x88fe('0x2'));var BPromise=require(_0x88fe('0x3'));var rs=require(_0x88fe('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x88fe('0x5'))['db'];var utils=require(_0x88fe('0x6'));var logger=require(_0x88fe('0x7'))(_0x88fe('0x8'));var config=require(_0x88fe('0x9'));var jayson=require(_0x88fe('0xa'));var client=jayson['client'][_0x88fe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x409a39,_0x18e9c3,_0x3f3684){return new BPromise(function(_0xfe39ee,_0x564a54){return client[_0x88fe('0xc')](_0x409a39,_0x3f3684)[_0x88fe('0xd')](function(_0x23286b){logger[_0x88fe('0xe')](_0x88fe('0xf'),_0x18e9c3,_0x88fe('0x10'));logger[_0x88fe('0x11')](_0x88fe('0x12'),_0x18e9c3,_0x88fe('0x10'),JSON[_0x88fe('0x13')](_0x23286b));if(_0x23286b[_0x88fe('0x14')]){if(_0x23286b[_0x88fe('0x14')][_0x88fe('0x15')]===0x1f4){logger[_0x88fe('0x14')](_0x88fe('0xf'),_0x18e9c3,_0x23286b[_0x88fe('0x14')]['message']);return _0x564a54(_0x23286b[_0x88fe('0x14')]['message']);}logger[_0x88fe('0x14')](_0x88fe('0xf'),_0x18e9c3,_0x23286b[_0x88fe('0x14')][_0x88fe('0x16')]);return _0xfe39ee(_0x23286b['error'][_0x88fe('0x16')]);}else{logger[_0x88fe('0xe')](_0x88fe('0xf'),_0x18e9c3,_0x88fe('0x10'));_0xfe39ee(_0x23286b[_0x88fe('0x17')][_0x88fe('0x16')]);}})[_0x88fe('0x18')](function(_0x137c9a){logger[_0x88fe('0x14')](_0x88fe('0xf'),_0x18e9c3,_0x137c9a);_0x564a54(_0x137c9a);});});}
\ No newline at end of file
+var _0x2183=['info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2183,0xca));var _0x3218=function(_0x387db2,_0x6d0d67){_0x387db2=_0x387db2-0x0;var _0x19ad42=_0x2183[_0x387db2];return _0x19ad42;};'use strict';var _=require('lodash');var util=require(_0x3218('0x0'));var moment=require(_0x3218('0x1'));var BPromise=require(_0x3218('0x2'));var rs=require(_0x3218('0x3'));var fs=require('fs');var Redis=require(_0x3218('0x4'));var db=require(_0x3218('0x5'))['db'];var utils=require(_0x3218('0x6'));var logger=require(_0x3218('0x7'))('rpc');var config=require(_0x3218('0x8'));var jayson=require(_0x3218('0x9'));var client=jayson[_0x3218('0xa')][_0x3218('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36fdfc,_0x29295a,_0x2e8984){return new BPromise(function(_0x5d1bad,_0x1fa8e7){return client[_0x3218('0xc')](_0x36fdfc,_0x2e8984)[_0x3218('0xd')](function(_0x17ad68){logger[_0x3218('0xe')](_0x3218('0xf'),_0x29295a,_0x3218('0x10'));logger[_0x3218('0x11')](_0x3218('0x12'),_0x29295a,_0x3218('0x10'),JSON[_0x3218('0x13')](_0x17ad68));if(_0x17ad68[_0x3218('0x14')]){if(_0x17ad68[_0x3218('0x14')]['code']===0x1f4){logger['error'](_0x3218('0xf'),_0x29295a,_0x17ad68[_0x3218('0x14')][_0x3218('0x15')]);return _0x1fa8e7(_0x17ad68[_0x3218('0x14')]['message']);}logger[_0x3218('0x14')](_0x3218('0xf'),_0x29295a,_0x17ad68[_0x3218('0x14')]['message']);return _0x5d1bad(_0x17ad68[_0x3218('0x14')][_0x3218('0x15')]);}else{logger[_0x3218('0xe')](_0x3218('0xf'),_0x29295a,_0x3218('0x10'));_0x5d1bad(_0x17ad68[_0x3218('0x16')][_0x3218('0x15')]);}})[_0x3218('0x17')](function(_0x595a55){logger[_0x3218('0x14')](_0x3218('0xf'),_0x29295a,_0x595a55);_0x1fa8e7(_0x595a55);});});}
\ No newline at end of file
index cf83215..fc5d587 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x152b=['put','update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','post','create'];(function(_0x4993c1,_0x26418a){var _0x42d0ce=function(_0x2c8170){while(--_0x2c8170){_0x4993c1['push'](_0x4993c1['shift']());}};_0x42d0ce(++_0x26418a);}(_0x152b,0x194));var _0xb152=function(_0x14e9f0,_0x287f90){_0x14e9f0=_0x14e9f0-0x0;var _0xa63f7e=_0x152b[_0x14e9f0];return _0xa63f7e;};'use strict';var multer=require(_0xb152('0x0'));var util=require(_0xb152('0x1'));var path=require(_0xb152('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb152('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb152('0x4'));var interaction=require(_0xb152('0x5'));var config=require(_0xb152('0x6'));var controller=require(_0xb152('0x7'));router[_0xb152('0x8')]('/',auth[_0xb152('0x9')](),controller[_0xb152('0xa')]);router[_0xb152('0x8')](_0xb152('0xb'),auth[_0xb152('0x9')](),controller['show']);router[_0xb152('0xc')]('/',auth[_0xb152('0x9')](),controller[_0xb152('0xd')]);router[_0xb152('0xe')](_0xb152('0xb'),auth[_0xb152('0x9')](),controller[_0xb152('0xf')]);router[_0xb152('0x10')](_0xb152('0xb'),auth[_0xb152('0x9')](),controller[_0xb152('0x11')]);module[_0xb152('0x12')]=router;
\ No newline at end of file
+var _0xb18f=['./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb18f,0x76));var _0xfb18=function(_0x4624b9,_0x19cfad){_0x4624b9=_0x4624b9-0x0;var _0x53d0fa=_0xb18f[_0x4624b9];return _0x53d0fa;};'use strict';var multer=require('multer');var util=require(_0xfb18('0x0'));var path=require('path');var timeout=require(_0xfb18('0x1'));var express=require(_0xfb18('0x2'));var router=express[_0xfb18('0x3')]();var fs_extra=require(_0xfb18('0x4'));var auth=require(_0xfb18('0x5'));var interaction=require(_0xfb18('0x6'));var config=require(_0xfb18('0x7'));var controller=require(_0xfb18('0x8'));router[_0xfb18('0x9')]('/',auth[_0xfb18('0xa')](),controller[_0xfb18('0xb')]);router['get'](_0xfb18('0xc'),auth[_0xfb18('0xa')](),controller[_0xfb18('0xd')]);router[_0xfb18('0xe')]('/',auth[_0xfb18('0xa')](),controller[_0xfb18('0xf')]);router[_0xfb18('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xfb18('0x11')]);router[_0xfb18('0x12')](_0xfb18('0xc'),auth[_0xfb18('0xa')](),controller[_0xfb18('0x13')]);module[_0xfb18('0x14')]=router;
\ No newline at end of file
index c56a0bc..6fd513f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68e1=['ENUM','string','customVariable','picklist','STRING','variable','BOOLEAN','sequelize','exports'];(function(_0x4223e6,_0x4c2a39){var _0x5c8b62=function(_0x28b444){while(--_0x28b444){_0x4223e6['push'](_0x4223e6['shift']());}};_0x5c8b62(++_0x4c2a39);}(_0x68e1,0x18a));var _0x168e=function(_0x46baea,_0x2c204d){_0x46baea=_0x46baea-0x0;var _0x577f75=_0x68e1[_0x46baea];return _0x577f75;};'use strict';var Sequelize=require(_0x168e('0x0'));module[_0x168e('0x1')]={'type':{'type':Sequelize[_0x168e('0x2')](_0x168e('0x3'),'variable',_0x168e('0x4'),'keyValue',_0x168e('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x168e('0x6')]},'key':{'type':Sequelize[_0x168e('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0x168e('0x7'),_0x168e('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x168e('0x6')]},'nameField':{'type':Sequelize[_0x168e('0x6')]},'customField':{'type':Sequelize[_0x168e('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x168e('0x6')]}};
\ No newline at end of file
+var _0xda68=['string','variable','customVariable','keyValue','picklist','STRING','ENUM','sequelize'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xda68,0x17f));var _0x8da6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xda68[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x8da6('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x8da6('0x1'),_0x8da6('0x2'),_0x8da6('0x3'),_0x8da6('0x4'),_0x8da6('0x5')),'defaultValue':_0x8da6('0x1')},'content':{'type':Sequelize[_0x8da6('0x6')]},'key':{'type':Sequelize[_0x8da6('0x6')]},'keyType':{'type':Sequelize[_0x8da6('0x7')](_0x8da6('0x1'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x8da6('0x6')]},'nameField':{'type':Sequelize[_0x8da6('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8da6('0x6')]}};
\ No newline at end of file
index 6a5ac72..0e6d118 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf5fe=['merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','filters','find','create','body','params','eml-format','rimraf','request-promise','moment','bluebird','util','ejs','crypto','jsforce','to-csv','papaparse','ioredis','../../config/logger','api','../../config/utils','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','map','Dynamics365Field','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where'];(function(_0x486008,_0x2b2d05){var _0x2fefc7=function(_0x4177fe){while(--_0x4177fe){_0x486008['push'](_0x486008['shift']());}};_0x2fefc7(++_0x2b2d05);}(_0xf5fe,0x194));var _0xef5f=function(_0x3c9d62,_0x34edcd){_0x3c9d62=_0x3c9d62-0x0;var _0x5e9629=_0xf5fe[_0x3c9d62];return _0x5e9629;};'use strict';var emlformat=require(_0xef5f('0x0'));var rimraf=require(_0xef5f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xef5f('0x2'));var moment=require(_0xef5f('0x3'));var BPromise=require(_0xef5f('0x4'));var Mustache=require('mustache');var util=require(_0xef5f('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xef5f('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xef5f('0x7'));var jsforce=require(_0xef5f('0x8'));var deskjs=require('desk.js');var toCsv=require(_0xef5f('0x9'));var querystring=require('querystring');var Papa=require(_0xef5f('0xa'));var Redis=require(_0xef5f('0xb'));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(_0xef5f('0xc'))(_0xef5f('0xd'));var utils=require(_0xef5f('0xe'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xef5f('0xf'))['db'];function respondWithStatusCode(_0x47002b,_0x932986){_0x932986=_0x932986||0xcc;return function(_0x525502){if(_0x525502){return _0x47002b['sendStatus'](_0x932986);}return _0x47002b['status'](_0x932986)[_0xef5f('0x10')]();};}function respondWithResult(_0x131fca,_0x3cd570){_0x3cd570=_0x3cd570||0xc8;return function(_0x220fb8){if(_0x220fb8){return _0x131fca[_0xef5f('0x11')](_0x3cd570)[_0xef5f('0x12')](_0x220fb8);}};}function respondWithFilteredResult(_0x55292a,_0x32bbe8){return function(_0x5d9b08){if(_0x5d9b08){var _0x4dd0f2=typeof _0x32bbe8[_0xef5f('0x13')]==='undefined'&&typeof _0x32bbe8['limit']===_0xef5f('0x14');var _0x3d5dde=_0x5d9b08['count'];var _0x2be596=_0x4dd0f2?0x0:_0x32bbe8[_0xef5f('0x13')];var _0x5bd110=_0x4dd0f2?_0x5d9b08[_0xef5f('0x15')]:_0x32bbe8[_0xef5f('0x13')]+_0x32bbe8[_0xef5f('0x16')];var _0x1a96b3;if(_0x5bd110>=_0x3d5dde){_0x5bd110=_0x3d5dde;_0x1a96b3=0xc8;}else{_0x1a96b3=0xce;}_0x55292a[_0xef5f('0x11')](_0x1a96b3);return _0x55292a[_0xef5f('0x17')](_0xef5f('0x18'),_0x2be596+'-'+_0x5bd110+'/'+_0x3d5dde)[_0xef5f('0x12')](_0x5d9b08);}return null;};}function patchUpdates(_0x60958a){return function(_0x2691d7){try{jsonpatch[_0xef5f('0x19')](_0x2691d7,_0x60958a,!![]);}catch(_0x1e1749){return BPromise[_0xef5f('0x1a')](_0x1e1749);}return _0x2691d7[_0xef5f('0x1b')]();};}function saveUpdates(_0x52e4e3,_0x5a00ff){return function(_0x15cdb6){if(_0x15cdb6){return _0x15cdb6[_0xef5f('0x1c')](_0x52e4e3)['then'](function(_0x5e5507){return _0x5e5507;});}return null;};}function removeEntity(_0x1b1f01,_0x245eae){return function(_0x103838){if(_0x103838){return _0x103838['destroy']()[_0xef5f('0x1d')](function(){_0x1b1f01['status'](0xcc)[_0xef5f('0x10')]();});}};}function handleEntityNotFound(_0x5d1b4e,_0x5e2cc4){return function(_0x3c4e65){if(!_0x3c4e65){_0x5d1b4e[_0xef5f('0x1e')](0x194);}return _0x3c4e65;};}function handleError(_0x4763bb,_0x3d4000){_0x3d4000=_0x3d4000||0x1f4;return function(_0x23df61){logger[_0xef5f('0x1f')](_0x23df61[_0xef5f('0x20')]);if(_0x23df61[_0xef5f('0x21')]){delete _0x23df61[_0xef5f('0x21')];}_0x4763bb[_0xef5f('0x11')](_0x3d4000)[_0xef5f('0x22')](_0x23df61);};}exports['index']=function(_0x41be7c,_0x259618){var _0x3c1f15={},_0x93ce8d={},_0x4f4531={'count':0x0,'rows':[]};var _0x15c457=_[_0xef5f('0x23')](db[_0xef5f('0x24')]['rawAttributes'],function(_0x5a1e07){return{'name':_0x5a1e07[_0xef5f('0x25')],'type':_0x5a1e07[_0xef5f('0x26')][_0xef5f('0x27')]};});_0x93ce8d[_0xef5f('0x28')]=_[_0xef5f('0x23')](_0x15c457,_0xef5f('0x21'));_0x93ce8d['query']=_[_0xef5f('0x29')](_0x41be7c[_0xef5f('0x2a')]);_0x93ce8d['filters']=_[_0xef5f('0x2b')](_0x93ce8d[_0xef5f('0x28')],_0x93ce8d['query']);_0x3c1f15[_0xef5f('0x2c')]=_[_0xef5f('0x2b')](_0x93ce8d[_0xef5f('0x28')],qs[_0xef5f('0x2d')](_0x41be7c[_0xef5f('0x2a')]['fields']));_0x3c1f15['attributes']=_0x3c1f15['attributes'][_0xef5f('0x2e')]?_0x3c1f15['attributes']:_0x93ce8d[_0xef5f('0x28')];if(!_0x41be7c['query'][_0xef5f('0x2f')](_0xef5f('0x30'))){_0x3c1f15[_0xef5f('0x16')]=qs['limit'](_0x41be7c[_0xef5f('0x2a')][_0xef5f('0x16')]);_0x3c1f15[_0xef5f('0x13')]=qs[_0xef5f('0x13')](_0x41be7c[_0xef5f('0x2a')][_0xef5f('0x13')]);}_0x3c1f15['order']=qs[_0xef5f('0x31')](_0x41be7c[_0xef5f('0x2a')][_0xef5f('0x31')]);_0x3c1f15[_0xef5f('0x32')]=qs['filters'](_['pick'](_0x41be7c[_0xef5f('0x2a')],_0x93ce8d['filters']),_0x15c457);if(_0x41be7c[_0xef5f('0x2a')]['filter']){_0x3c1f15['where']=_[_0xef5f('0x33')](_0x3c1f15[_0xef5f('0x32')],{'$or':_[_0xef5f('0x23')](_0x15c457,function(_0x27d0d4){if(_0x27d0d4[_0xef5f('0x26')]!=='VIRTUAL'){var _0x118aad={};_0x118aad[_0x27d0d4[_0xef5f('0x21')]]={'$like':'%'+_0x41be7c[_0xef5f('0x2a')]['filter']+'%'};return _0x118aad;}})});}_0x3c1f15=_[_0xef5f('0x33')]({},_0x3c1f15,_0x41be7c[_0xef5f('0x34')]);var _0x2af8c4={'where':_0x3c1f15[_0xef5f('0x32')]};return db['Dynamics365Field']['count'](_0x2af8c4)['then'](function(_0x1443e4){_0x4f4531[_0xef5f('0x15')]=_0x1443e4;if(_0x41be7c['query'][_0xef5f('0x35')]){_0x3c1f15[_0xef5f('0x36')]=[{'all':!![]}];}return db[_0xef5f('0x24')][_0xef5f('0x37')](_0x3c1f15);})[_0xef5f('0x1d')](function(_0x3587b5){_0x4f4531[_0xef5f('0x38')]=_0x3587b5;return _0x4f4531;})[_0xef5f('0x1d')](respondWithFilteredResult(_0x259618,_0x3c1f15))[_0xef5f('0x39')](handleError(_0x259618,null));};exports[_0xef5f('0x3a')]=function(_0x6f430e,_0x164847){var _0x5da71c={'raw':!![],'where':{'id':_0x6f430e['params']['id']}},_0x52b41c={};_0x52b41c['model']=_['keys'](db[_0xef5f('0x24')][_0xef5f('0x3b')]);_0x52b41c[_0xef5f('0x2a')]=_[_0xef5f('0x29')](_0x6f430e[_0xef5f('0x2a')]);_0x52b41c[_0xef5f('0x3c')]=_['intersection'](_0x52b41c[_0xef5f('0x28')],_0x52b41c[_0xef5f('0x2a')]);_0x5da71c[_0xef5f('0x2c')]=_[_0xef5f('0x2b')](_0x52b41c[_0xef5f('0x28')],qs[_0xef5f('0x2d')](_0x6f430e[_0xef5f('0x2a')][_0xef5f('0x2d')]));_0x5da71c[_0xef5f('0x2c')]=_0x5da71c[_0xef5f('0x2c')]['length']?_0x5da71c[_0xef5f('0x2c')]:_0x52b41c[_0xef5f('0x28')];if(_0x6f430e[_0xef5f('0x2a')][_0xef5f('0x35')]){_0x5da71c[_0xef5f('0x36')]=[{'all':!![]}];}_0x5da71c=_[_0xef5f('0x33')]({},_0x5da71c,_0x6f430e[_0xef5f('0x34')]);return db[_0xef5f('0x24')][_0xef5f('0x3d')](_0x5da71c)[_0xef5f('0x1d')](handleEntityNotFound(_0x164847,null))['then'](respondWithResult(_0x164847,null))[_0xef5f('0x39')](handleError(_0x164847,null));};exports[_0xef5f('0x3e')]=function(_0x787ed0,_0x2c521e){return db['Dynamics365Field'][_0xef5f('0x3e')](_0x787ed0[_0xef5f('0x3f')],{})[_0xef5f('0x1d')](respondWithResult(_0x2c521e,0xc9))['catch'](handleError(_0x2c521e,null));};exports[_0xef5f('0x1c')]=function(_0x1f87e6,_0x1d3319){if(_0x1f87e6[_0xef5f('0x3f')]['id']){delete _0x1f87e6[_0xef5f('0x3f')]['id'];}return db[_0xef5f('0x24')]['find']({'where':{'id':_0x1f87e6[_0xef5f('0x40')]['id']}})[_0xef5f('0x1d')](handleEntityNotFound(_0x1d3319,null))['then'](saveUpdates(_0x1f87e6[_0xef5f('0x3f')],null))[_0xef5f('0x1d')](respondWithResult(_0x1d3319,null))['catch'](handleError(_0x1d3319,null));};exports['destroy']=function(_0x18cfef,_0x5d35bd){return db['Dynamics365Field'][_0xef5f('0x3d')]({'where':{'id':_0x18cfef[_0xef5f('0x40')]['id']}})['then'](handleEntityNotFound(_0x5d35bd,null))[_0xef5f('0x1d')](removeEntity(_0x5d35bd,null))['catch'](handleError(_0x5d35bd,null));};
\ No newline at end of file
+var _0x96bc=['count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','map','Dynamics365Field','fieldName','key','model','query','filters','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','includeAll','include','findAll','rows','catch','params','rawAttributes','keys','attributes','options','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit'];(function(_0x4bebfc,_0x53172d){var _0x7a5063=function(_0x1b83dc){while(--_0x1b83dc){_0x4bebfc['push'](_0x4bebfc['shift']());}};_0x7a5063(++_0x53172d);}(_0x96bc,0x1e8));var _0xc96b=function(_0x412103,_0x103c45){_0x412103=_0x412103-0x0;var _0xe6df1a=_0x96bc[_0x412103];return _0xe6df1a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc96b('0x0'));var zipdir=require(_0xc96b('0x1'));var jsonpatch=require(_0xc96b('0x2'));var rp=require(_0xc96b('0x3'));var moment=require(_0xc96b('0x4'));var BPromise=require(_0xc96b('0x5'));var Mustache=require(_0xc96b('0x6'));var util=require(_0xc96b('0x7'));var path=require(_0xc96b('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc96b('0x9'));var fs=require('fs');var fs_extra=require(_0xc96b('0xa'));var _=require(_0xc96b('0xb'));var squel=require('squel');var crypto=require(_0xc96b('0xc'));var jsforce=require(_0xc96b('0xd'));var deskjs=require(_0xc96b('0xe'));var toCsv=require(_0xc96b('0xf'));var querystring=require('querystring');var Papa=require(_0xc96b('0x10'));var Redis=require(_0xc96b('0x11'));var authService=require(_0xc96b('0x12'));var qs=require(_0xc96b('0x13'));var as=require(_0xc96b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc96b('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc96b('0x16'));var db=require(_0xc96b('0x17'))['db'];function respondWithStatusCode(_0x2fa8f7,_0x444139){_0x444139=_0x444139||0xcc;return function(_0x4d1aeb){if(_0x4d1aeb){return _0x2fa8f7[_0xc96b('0x18')](_0x444139);}return _0x2fa8f7[_0xc96b('0x19')](_0x444139)['end']();};}function respondWithResult(_0x694b83,_0x17087c){_0x17087c=_0x17087c||0xc8;return function(_0xe4d587){if(_0xe4d587){return _0x694b83[_0xc96b('0x19')](_0x17087c)[_0xc96b('0x1a')](_0xe4d587);}};}function respondWithFilteredResult(_0x5479ab,_0x452446){return function(_0x30051b){if(_0x30051b){var _0x4a0b65=typeof _0x452446[_0xc96b('0x1b')]===_0xc96b('0x1c')&&typeof _0x452446[_0xc96b('0x1d')]==='undefined';var _0x6d201a=_0x30051b['count'];var _0x4f0ace=_0x4a0b65?0x0:_0x452446[_0xc96b('0x1b')];var _0x41026a=_0x4a0b65?_0x30051b[_0xc96b('0x1e')]:_0x452446[_0xc96b('0x1b')]+_0x452446[_0xc96b('0x1d')];var _0x3dbb97;if(_0x41026a>=_0x6d201a){_0x41026a=_0x6d201a;_0x3dbb97=0xc8;}else{_0x3dbb97=0xce;}_0x5479ab['status'](_0x3dbb97);return _0x5479ab[_0xc96b('0x1f')](_0xc96b('0x20'),_0x4f0ace+'-'+_0x41026a+'/'+_0x6d201a)[_0xc96b('0x1a')](_0x30051b);}return null;};}function patchUpdates(_0x97afd){return function(_0x363ff9){try{jsonpatch[_0xc96b('0x21')](_0x363ff9,_0x97afd,!![]);}catch(_0x3b0ad0){return BPromise[_0xc96b('0x22')](_0x3b0ad0);}return _0x363ff9[_0xc96b('0x23')]();};}function saveUpdates(_0x35a9e7,_0x275a6e){return function(_0x3b4a42){if(_0x3b4a42){return _0x3b4a42['update'](_0x35a9e7)[_0xc96b('0x24')](function(_0x43e13a){return _0x43e13a;});}return null;};}function removeEntity(_0x1c5266,_0x40efbd){return function(_0xf38fe8){if(_0xf38fe8){return _0xf38fe8[_0xc96b('0x25')]()['then'](function(){_0x1c5266[_0xc96b('0x19')](0xcc)[_0xc96b('0x26')]();});}};}function handleEntityNotFound(_0x1e2677,_0x29bd16){return function(_0x585469){if(!_0x585469){_0x1e2677[_0xc96b('0x18')](0x194);}return _0x585469;};}function handleError(_0xdde3ae,_0x170935){_0x170935=_0x170935||0x1f4;return function(_0x380c77){logger[_0xc96b('0x27')](_0x380c77[_0xc96b('0x28')]);if(_0x380c77['name']){delete _0x380c77[_0xc96b('0x29')];}_0xdde3ae[_0xc96b('0x19')](_0x170935)[_0xc96b('0x2a')](_0x380c77);};}exports['index']=function(_0x37db1a,_0x50f4f3){var _0x50124c={},_0x3b67a3={},_0x1317fe={'count':0x0,'rows':[]};var _0x561bc7=_[_0xc96b('0x2b')](db[_0xc96b('0x2c')]['rawAttributes'],function(_0x348df4){return{'name':_0x348df4[_0xc96b('0x2d')],'type':_0x348df4['type'][_0xc96b('0x2e')]};});_0x3b67a3[_0xc96b('0x2f')]=_[_0xc96b('0x2b')](_0x561bc7,_0xc96b('0x29'));_0x3b67a3[_0xc96b('0x30')]=_['keys'](_0x37db1a[_0xc96b('0x30')]);_0x3b67a3[_0xc96b('0x31')]=_[_0xc96b('0x32')](_0x3b67a3[_0xc96b('0x2f')],_0x3b67a3['query']);_0x50124c['attributes']=_['intersection'](_0x3b67a3[_0xc96b('0x2f')],qs[_0xc96b('0x33')](_0x37db1a['query'][_0xc96b('0x33')]));_0x50124c['attributes']=_0x50124c['attributes']['length']?_0x50124c['attributes']:_0x3b67a3[_0xc96b('0x2f')];if(!_0x37db1a[_0xc96b('0x30')][_0xc96b('0x34')](_0xc96b('0x35'))){_0x50124c[_0xc96b('0x1d')]=qs['limit'](_0x37db1a[_0xc96b('0x30')][_0xc96b('0x1d')]);_0x50124c[_0xc96b('0x1b')]=qs[_0xc96b('0x1b')](_0x37db1a[_0xc96b('0x30')][_0xc96b('0x1b')]);}_0x50124c[_0xc96b('0x36')]=qs[_0xc96b('0x37')](_0x37db1a[_0xc96b('0x30')]['sort']);_0x50124c[_0xc96b('0x38')]=qs[_0xc96b('0x31')](_[_0xc96b('0x39')](_0x37db1a[_0xc96b('0x30')],_0x3b67a3[_0xc96b('0x31')]),_0x561bc7);if(_0x37db1a['query']['filter']){_0x50124c[_0xc96b('0x38')]=_[_0xc96b('0x3a')](_0x50124c['where'],{'$or':_[_0xc96b('0x2b')](_0x561bc7,function(_0x412246){if(_0x412246[_0xc96b('0x3b')]!=='VIRTUAL'){var _0x1b94c6={};_0x1b94c6[_0x412246[_0xc96b('0x29')]]={'$like':'%'+_0x37db1a[_0xc96b('0x30')][_0xc96b('0x3c')]+'%'};return _0x1b94c6;}})});}_0x50124c=_[_0xc96b('0x3a')]({},_0x50124c,_0x37db1a['options']);var _0x23d800={'where':_0x50124c[_0xc96b('0x38')]};return db[_0xc96b('0x2c')][_0xc96b('0x1e')](_0x23d800)[_0xc96b('0x24')](function(_0x1647f5){_0x1317fe[_0xc96b('0x1e')]=_0x1647f5;if(_0x37db1a['query'][_0xc96b('0x3d')]){_0x50124c[_0xc96b('0x3e')]=[{'all':!![]}];}return db[_0xc96b('0x2c')][_0xc96b('0x3f')](_0x50124c);})[_0xc96b('0x24')](function(_0xbbc5c8){_0x1317fe[_0xc96b('0x40')]=_0xbbc5c8;return _0x1317fe;})[_0xc96b('0x24')](respondWithFilteredResult(_0x50f4f3,_0x50124c))[_0xc96b('0x41')](handleError(_0x50f4f3,null));};exports['show']=function(_0x58822a,_0x1179e2){var _0x235dc1={'raw':!![],'where':{'id':_0x58822a[_0xc96b('0x42')]['id']}},_0x4b2436={};_0x4b2436[_0xc96b('0x2f')]=_['keys'](db[_0xc96b('0x2c')][_0xc96b('0x43')]);_0x4b2436[_0xc96b('0x30')]=_[_0xc96b('0x44')](_0x58822a[_0xc96b('0x30')]);_0x4b2436[_0xc96b('0x31')]=_[_0xc96b('0x32')](_0x4b2436['model'],_0x4b2436['query']);_0x235dc1[_0xc96b('0x45')]=_[_0xc96b('0x32')](_0x4b2436[_0xc96b('0x2f')],qs[_0xc96b('0x33')](_0x58822a['query'][_0xc96b('0x33')]));_0x235dc1['attributes']=_0x235dc1[_0xc96b('0x45')]['length']?_0x235dc1[_0xc96b('0x45')]:_0x4b2436['model'];if(_0x58822a['query'][_0xc96b('0x3d')]){_0x235dc1[_0xc96b('0x3e')]=[{'all':!![]}];}_0x235dc1=_[_0xc96b('0x3a')]({},_0x235dc1,_0x58822a[_0xc96b('0x46')]);return db[_0xc96b('0x2c')]['find'](_0x235dc1)[_0xc96b('0x24')](handleEntityNotFound(_0x1179e2,null))[_0xc96b('0x24')](respondWithResult(_0x1179e2,null))[_0xc96b('0x41')](handleError(_0x1179e2,null));};exports[_0xc96b('0x47')]=function(_0xa7b435,_0x3b8b76){return db['Dynamics365Field'][_0xc96b('0x47')](_0xa7b435[_0xc96b('0x48')],{})[_0xc96b('0x24')](respondWithResult(_0x3b8b76,0xc9))[_0xc96b('0x41')](handleError(_0x3b8b76,null));};exports['update']=function(_0x56f01e,_0x52243c){if(_0x56f01e['body']['id']){delete _0x56f01e[_0xc96b('0x48')]['id'];}return db[_0xc96b('0x2c')][_0xc96b('0x49')]({'where':{'id':_0x56f01e[_0xc96b('0x42')]['id']}})[_0xc96b('0x24')](handleEntityNotFound(_0x52243c,null))[_0xc96b('0x24')](saveUpdates(_0x56f01e['body'],null))['then'](respondWithResult(_0x52243c,null))[_0xc96b('0x41')](handleError(_0x52243c,null));};exports[_0xc96b('0x25')]=function(_0x2c1d26,_0xdcf6e6){return db[_0xc96b('0x2c')][_0xc96b('0x49')]({'where':{'id':_0x2c1d26[_0xc96b('0x42')]['id']}})[_0xc96b('0x24')](handleEntityNotFound(_0xdcf6e6,null))[_0xc96b('0x24')](removeEntity(_0xdcf6e6,null))[_0xc96b('0x41')](handleError(_0xdcf6e6,null));};
\ No newline at end of file
index e2fe0d4..a097104 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x389c=['../../config/environment','./intDynamics365Field.attributes','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x389c,0x127));var _0xc389=function(_0x559b81,_0x4e6519){_0x559b81=_0x559b81-0x0;var _0x3cd2f1=_0x389c[_0x559b81];return _0x3cd2f1;};'use strict';var _=require(_0xc389('0x0'));var util=require(_0xc389('0x1'));var logger=require(_0xc389('0x2'))(_0xc389('0x3'));var moment=require('moment');var BPromise=require(_0xc389('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc389('0x5'));var attributes=require(_0xc389('0x6'));module['exports']=function(_0x597a49,_0x12d129){return _0x597a49['define'](_0xc389('0x7'),attributes,{'tableName':_0xc389('0x8'),'paranoid':![],'indexes':[{'name':_0xc389('0x9'),'fields':[_0xc389('0xa'),_0xc389('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc392=['path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','int_dynamics365_fields','dynamics365_unique_index','idField','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5db657,_0x2f40b3){var _0x2d6e70=function(_0x358ed2){while(--_0x358ed2){_0x5db657['push'](_0x5db657['shift']());}};_0x2d6e70(++_0x2f40b3);}(_0xc392,0x99));var _0x2c39=function(_0x2acfa9,_0x2732ef){_0x2acfa9=_0x2acfa9-0x0;var _0x12f2c3=_0xc392[_0x2acfa9];return _0x12f2c3;};'use strict';var _=require(_0x2c39('0x0'));var util=require(_0x2c39('0x1'));var logger=require(_0x2c39('0x2'))(_0x2c39('0x3'));var moment=require(_0x2c39('0x4'));var BPromise=require(_0x2c39('0x5'));var rp=require(_0x2c39('0x6'));var fs=require('fs');var path=require(_0x2c39('0x7'));var rimraf=require(_0x2c39('0x8'));var config=require(_0x2c39('0x9'));var attributes=require(_0x2c39('0xa'));module[_0x2c39('0xb')]=function(_0xec1fec,_0x348db7){return _0xec1fec[_0x2c39('0xc')]('Dynamics365Field',attributes,{'tableName':_0x2c39('0xd'),'paranoid':![],'indexes':[{'name':_0x2c39('0xe'),'fields':[_0x2c39('0xf'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 7a50870..c649bab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ec1=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x2ec1,0x176));var _0x12ec=function(_0x10d618,_0x1f1c82){_0x10d618=_0x10d618-0x0;var _0x57d044=_0x2ec1[_0x10d618];return _0x57d044;};'use strict';var _=require(_0x12ec('0x0'));var util=require(_0x12ec('0x1'));var moment=require(_0x12ec('0x2'));var BPromise=require(_0x12ec('0x3'));var rs=require(_0x12ec('0x4'));var fs=require('fs');var Redis=require(_0x12ec('0x5'));var db=require(_0x12ec('0x6'))['db'];var utils=require(_0x12ec('0x7'));var logger=require(_0x12ec('0x8'))(_0x12ec('0x9'));var config=require(_0x12ec('0xa'));var jayson=require(_0x12ec('0xb'));var client=jayson[_0x12ec('0xc')][_0x12ec('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x128b72,_0x52661a,_0x25bfe1){return new BPromise(function(_0x3c7c60,_0x3e61ef){return client[_0x12ec('0xe')](_0x128b72,_0x25bfe1)[_0x12ec('0xf')](function(_0x213820){logger[_0x12ec('0x10')](_0x12ec('0x11'),_0x52661a,'request\x20sent');logger['debug'](_0x12ec('0x12'),_0x52661a,_0x12ec('0x13'),JSON[_0x12ec('0x14')](_0x213820));if(_0x213820[_0x12ec('0x15')]){if(_0x213820[_0x12ec('0x15')][_0x12ec('0x16')]===0x1f4){logger[_0x12ec('0x15')](_0x12ec('0x11'),_0x52661a,_0x213820['error'][_0x12ec('0x17')]);return _0x3e61ef(_0x213820[_0x12ec('0x15')]['message']);}logger[_0x12ec('0x15')](_0x12ec('0x11'),_0x52661a,_0x213820[_0x12ec('0x15')][_0x12ec('0x17')]);return _0x3c7c60(_0x213820[_0x12ec('0x15')]['message']);}else{logger[_0x12ec('0x10')](_0x12ec('0x11'),_0x52661a,_0x12ec('0x13'));_0x3c7c60(_0x213820['result'][_0x12ec('0x17')]);}})[_0x12ec('0x18')](function(_0x59b871){logger[_0x12ec('0x15')]('Dynamics365Field,\x20%s,\x20%s',_0x52661a,_0x59b871);_0x3e61ef(_0x59b871);});});}
\ No newline at end of file
+var _0x059e=['request\x20sent','stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s'];(function(_0x15b12d,_0x5c02c3){var _0x50e24f=function(_0x3fc3e9){while(--_0x3fc3e9){_0x15b12d['push'](_0x15b12d['shift']());}};_0x50e24f(++_0x5c02c3);}(_0x059e,0x1bf));var _0xe059=function(_0x4ce11c,_0x3ec1b1){_0x4ce11c=_0x4ce11c-0x0;var _0x31c79a=_0x059e[_0x4ce11c];return _0x31c79a;};'use strict';var _=require(_0xe059('0x0'));var util=require('util');var moment=require(_0xe059('0x1'));var BPromise=require(_0xe059('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe059('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe059('0x4'));var logger=require(_0xe059('0x5'))(_0xe059('0x6'));var config=require(_0xe059('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe059('0x8')][_0xe059('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d3954,_0x2fbe99,_0x5d8d2c){return new BPromise(function(_0x1403e0,_0x5246f2){return client[_0xe059('0xa')](_0x1d3954,_0x5d8d2c)['then'](function(_0x2e8823){logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x2fbe99,'request\x20sent');logger[_0xe059('0xb')](_0xe059('0xc'),_0x2fbe99,_0xe059('0xd'),JSON[_0xe059('0xe')](_0x2e8823));if(_0x2e8823[_0xe059('0xf')]){if(_0x2e8823[_0xe059('0xf')][_0xe059('0x10')]===0x1f4){logger[_0xe059('0xf')](_0xe059('0x11'),_0x2fbe99,_0x2e8823[_0xe059('0xf')][_0xe059('0x12')]);return _0x5246f2(_0x2e8823['error']['message']);}logger[_0xe059('0xf')](_0xe059('0x11'),_0x2fbe99,_0x2e8823[_0xe059('0xf')]['message']);return _0x1403e0(_0x2e8823['error']['message']);}else{logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x2fbe99,_0xe059('0xd'));_0x1403e0(_0x2e8823['result'][_0xe059('0x12')]);}})[_0xe059('0x13')](function(_0x5066fd){logger[_0xe059('0xf')](_0xe059('0x11'),_0x2fbe99,_0x5066fd);_0x5246f2(_0x5066fd);});});}
\ No newline at end of file
index c0141f0..401dc41 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x362b=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','show','getFields','post','/:id/configurations','addConfiguration','put','/:id','update','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x362b,0x182));var _0xb362=function(_0x4a5a7e,_0x24b373){_0x4a5a7e=_0x4a5a7e-0x0;var _0x4edc4d=_0x362b[_0x4a5a7e];return _0x4edc4d;};'use strict';var multer=require(_0xb362('0x0'));var util=require(_0xb362('0x1'));var path=require(_0xb362('0x2'));var timeout=require(_0xb362('0x3'));var express=require(_0xb362('0x4'));var router=express['Router']();var fs_extra=require(_0xb362('0x5'));var auth=require(_0xb362('0x6'));var interaction=require(_0xb362('0x7'));var config=require(_0xb362('0x8'));var controller=require(_0xb362('0x9'));router[_0xb362('0xa')]('/',auth[_0xb362('0xb')](),controller[_0xb362('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xb362('0xd')]);router[_0xb362('0xa')]('/:id/configurations',auth[_0xb362('0xb')](),controller['getConfigurations']);router[_0xb362('0xa')]('/:id/fields',auth[_0xb362('0xb')](),controller[_0xb362('0xe')]);router[_0xb362('0xf')]('/',auth[_0xb362('0xb')](),controller['create']);router[_0xb362('0xf')](_0xb362('0x10'),auth[_0xb362('0xb')](),controller[_0xb362('0x11')]);router[_0xb362('0x12')](_0xb362('0x13'),auth[_0xb362('0xb')](),controller[_0xb362('0x14')]);router[_0xb362('0x15')](_0xb362('0x13'),auth['isAuthenticated'](),controller[_0xb362('0x16')]);module[_0xb362('0x17')]=router;
\ No newline at end of file
+var _0xfd16=['path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','index','/:id','show','/:id/configurations','isAuthenticated','/:id/fields','getFields','post','addConfiguration','put','update','exports','multer','util'];(function(_0x559528,_0x455857){var _0x567e33=function(_0xbc0b9f){while(--_0xbc0b9f){_0x559528['push'](_0x559528['shift']());}};_0x567e33(++_0x455857);}(_0xfd16,0x124));var _0x6fd1=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xfd16[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0x6fd1('0x0'));var util=require(_0x6fd1('0x1'));var path=require(_0x6fd1('0x2'));var timeout=require(_0x6fd1('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6fd1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6fd1('0x5'));var config=require(_0x6fd1('0x6'));var controller=require(_0x6fd1('0x7'));router[_0x6fd1('0x8')]('/',auth['isAuthenticated'](),controller[_0x6fd1('0x9')]);router[_0x6fd1('0x8')](_0x6fd1('0xa'),auth['isAuthenticated'](),controller[_0x6fd1('0xb')]);router['get'](_0x6fd1('0xc'),auth[_0x6fd1('0xd')](),controller['getConfigurations']);router['get'](_0x6fd1('0xe'),auth[_0x6fd1('0xd')](),controller[_0x6fd1('0xf')]);router[_0x6fd1('0x10')]('/',auth[_0x6fd1('0xd')](),controller['create']);router[_0x6fd1('0x10')](_0x6fd1('0xc'),auth[_0x6fd1('0xd')](),controller[_0x6fd1('0x11')]);router[_0x6fd1('0x12')](_0x6fd1('0xa'),auth['isAuthenticated'](),controller[_0x6fd1('0x13')]);router['delete']('/:id',auth[_0x6fd1('0xd')](),controller['destroy']);module[_0x6fd1('0x14')]=router;
\ No newline at end of file
index 8707a62..f631e05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5204=['exports','STRING','username','sequelize'];(function(_0xe4617e,_0x44d7d6){var _0x3392b7=function(_0x1748f9){while(--_0x1748f9){_0xe4617e['push'](_0xe4617e['shift']());}};_0x3392b7(++_0x44d7d6);}(_0x5204,0xdf));var _0x4520=function(_0x119d25,_0x588c8){_0x119d25=_0x119d25-0x0;var _0x39cf30=_0x5204[_0x119d25];return _0x39cf30;};'use strict';var Sequelize=require(_0x4520('0x0'));module[_0x4520('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4520('0x2')]},'username':{'type':Sequelize[_0x4520('0x2')],'unique':_0x4520('0x3')},'apiKey':{'type':Sequelize[_0x4520('0x2')]},'remoteUri':{'type':Sequelize[_0x4520('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x4520('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xb145=['STRING','username','remoteUri','exports'];(function(_0x4a80f6,_0x3d43ad){var _0x5bc762=function(_0x1ad68a){while(--_0x1ad68a){_0x4a80f6['push'](_0x4a80f6['shift']());}};_0x5bc762(++_0x3d43ad);}(_0xb145,0xa3));var _0x5b14=function(_0x2ee6dd,_0x2a0b52){_0x2ee6dd=_0x2ee6dd-0x0;var _0x110c3f=_0xb145[_0x2ee6dd];return _0x110c3f;};'use strict';var Sequelize=require('sequelize');module[_0x5b14('0x0')]={'name':{'type':Sequelize[_0x5b14('0x1')]},'description':{'type':Sequelize[_0x5b14('0x1')]},'username':{'type':Sequelize[_0x5b14('0x1')],'unique':_0x5b14('0x2')},'apiKey':{'type':Sequelize[_0x5b14('0x1')]},'remoteUri':{'type':Sequelize[_0x5b14('0x1')],'unique':_0x5b14('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index 4bb432d..9cbf972 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04b8=['lodash','squel','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','../../components/integrations/configuration','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','end','stack','name','send','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','options','includeAll','FreshdeskAccount','findAll','rows','catch','keys','include','find','create','body','params','getConfigurations','findOne','FreshdeskConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','FreshdeskField','Descriptions','getFields','remoteUri','apiKey','slice','substring','GET','%s/%s','api/v2/ticket_fields','format','Basic\x20%s','%s:X','base64','requester','subject','agent','description','priority','group','source','ticket_type','remove','includes','custom_text','custom_dropdown','label','default','choices','statusCode','error','stringify','test','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra'];(function(_0x332099,_0x2c55e8){var _0x4f28a9=function(_0x1f5894){while(--_0x1f5894){_0x332099['push'](_0x332099['shift']());}};_0x4f28a9(++_0x2c55e8);}(_0x04b8,0x159));var _0x804b=function(_0x2c3f08,_0x380f2b){_0x2c3f08=_0x2c3f08-0x0;var _0x4ea2ab=_0x04b8[_0x2c3f08];return _0x4ea2ab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x804b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x804b('0x1'));var rp=require(_0x804b('0x2'));var moment=require('moment');var BPromise=require(_0x804b('0x3'));var Mustache=require(_0x804b('0x4'));var util=require('util');var path=require(_0x804b('0x5'));var sox=require(_0x804b('0x6'));var csv=require(_0x804b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x804b('0x8'));var _=require(_0x804b('0x9'));var squel=require(_0x804b('0xa'));var crypto=require('crypto');var jsforce=require(_0x804b('0xb'));var deskjs=require(_0x804b('0xc'));var toCsv=require('to-csv');var querystring=require(_0x804b('0xd'));var Papa=require(_0x804b('0xe'));var Redis=require(_0x804b('0xf'));var authService=require(_0x804b('0x10'));var qs=require(_0x804b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x804b('0x12'));var logger=require(_0x804b('0x13'))(_0x804b('0x14'));var utils=require(_0x804b('0x15'));var config=require(_0x804b('0x16'));var licenseUtil=require(_0x804b('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x804b('0x18'));function respondWithStatusCode(_0x5303cc,_0x23ee57){_0x23ee57=_0x23ee57||0xcc;return function(_0x3a2702){if(_0x3a2702){return _0x5303cc[_0x804b('0x19')](_0x23ee57);}return _0x5303cc[_0x804b('0x1a')](_0x23ee57)['end']();};}function respondWithResult(_0x215825,_0x1b01a7){_0x1b01a7=_0x1b01a7||0xc8;return function(_0x274bb8){if(_0x274bb8){return _0x215825[_0x804b('0x1a')](_0x1b01a7)['json'](_0x274bb8);}};}function respondWithFilteredResult(_0x2fd593,_0x8ccbe0){return function(_0x5e1cfe){if(_0x5e1cfe){var _0x3c5986=typeof _0x8ccbe0['offset']===_0x804b('0x1b')&&typeof _0x8ccbe0[_0x804b('0x1c')]===_0x804b('0x1b');var _0x1760f8=_0x5e1cfe[_0x804b('0x1d')];var _0x5a0a82=_0x3c5986?0x0:_0x8ccbe0[_0x804b('0x1e')];var _0x50b4fe=_0x3c5986?_0x5e1cfe[_0x804b('0x1d')]:_0x8ccbe0[_0x804b('0x1e')]+_0x8ccbe0[_0x804b('0x1c')];var _0x469251;if(_0x50b4fe>=_0x1760f8){_0x50b4fe=_0x1760f8;_0x469251=0xc8;}else{_0x469251=0xce;}_0x2fd593['status'](_0x469251);return _0x2fd593[_0x804b('0x1f')](_0x804b('0x20'),_0x5a0a82+'-'+_0x50b4fe+'/'+_0x1760f8)[_0x804b('0x21')](_0x5e1cfe);}return null;};}function patchUpdates(_0x11eaf6){return function(_0x27844b){try{jsonpatch[_0x804b('0x22')](_0x27844b,_0x11eaf6,!![]);}catch(_0x3241a0){return BPromise[_0x804b('0x23')](_0x3241a0);}return _0x27844b[_0x804b('0x24')]();};}function saveUpdates(_0x2b7271,_0x1acc48){return function(_0x5a968b){if(_0x5a968b){return _0x5a968b[_0x804b('0x25')](_0x2b7271)[_0x804b('0x26')](function(_0x5585f8){return _0x5585f8;});}return null;};}function removeEntity(_0x44a921,_0x367024){return function(_0x115b8f){if(_0x115b8f){return _0x115b8f[_0x804b('0x27')]()[_0x804b('0x26')](function(){_0x44a921['status'](0xcc)[_0x804b('0x28')]();});}};}function handleEntityNotFound(_0x7d9c33,_0x4e7266){return function(_0x12b6a6){if(!_0x12b6a6){_0x7d9c33[_0x804b('0x19')](0x194);}return _0x12b6a6;};}function handleError(_0x1117a5,_0x27d5ec){_0x27d5ec=_0x27d5ec||0x1f4;return function(_0x2d88da){logger['error'](_0x2d88da[_0x804b('0x29')]);if(_0x2d88da[_0x804b('0x2a')]){delete _0x2d88da[_0x804b('0x2a')];}_0x1117a5[_0x804b('0x1a')](_0x27d5ec)[_0x804b('0x2b')](_0x2d88da);};}exports['index']=function(_0x3eb531,_0x2931ff){var _0x410871={},_0x5c7026={},_0x3dbd41={'count':0x0,'rows':[]};var _0x407357=_[_0x804b('0x2c')](db['FreshdeskAccount'][_0x804b('0x2d')],function(_0x471c04){return{'name':_0x471c04['fieldName'],'type':_0x471c04[_0x804b('0x2e')][_0x804b('0x2f')]};});_0x5c7026[_0x804b('0x30')]=_[_0x804b('0x2c')](_0x407357,_0x804b('0x2a'));_0x5c7026[_0x804b('0x31')]=_['keys'](_0x3eb531[_0x804b('0x31')]);_0x5c7026[_0x804b('0x32')]=_[_0x804b('0x33')](_0x5c7026[_0x804b('0x30')],_0x5c7026[_0x804b('0x31')]);_0x410871[_0x804b('0x34')]=_[_0x804b('0x33')](_0x5c7026[_0x804b('0x30')],qs[_0x804b('0x35')](_0x3eb531[_0x804b('0x31')][_0x804b('0x35')]));_0x410871[_0x804b('0x34')]=_0x410871[_0x804b('0x34')][_0x804b('0x36')]?_0x410871[_0x804b('0x34')]:_0x5c7026[_0x804b('0x30')];if(!_0x3eb531[_0x804b('0x31')][_0x804b('0x37')](_0x804b('0x38'))){_0x410871[_0x804b('0x1c')]=qs[_0x804b('0x1c')](_0x3eb531[_0x804b('0x31')][_0x804b('0x1c')]);_0x410871[_0x804b('0x1e')]=qs[_0x804b('0x1e')](_0x3eb531['query']['offset']);}_0x410871['order']=qs[_0x804b('0x39')](_0x3eb531[_0x804b('0x31')][_0x804b('0x39')]);_0x410871['where']=qs['filters'](_['pick'](_0x3eb531[_0x804b('0x31')],_0x5c7026[_0x804b('0x32')]),_0x407357);if(_0x3eb531[_0x804b('0x31')][_0x804b('0x3a')]){_0x410871[_0x804b('0x3b')]=_[_0x804b('0x3c')](_0x410871[_0x804b('0x3b')],{'$or':_[_0x804b('0x2c')](_0x407357,function(_0x27ba88){if(_0x27ba88[_0x804b('0x2e')]!==_0x804b('0x3d')){var _0x22a3fa={};_0x22a3fa[_0x27ba88[_0x804b('0x2a')]]={'$like':'%'+_0x3eb531['query'][_0x804b('0x3a')]+'%'};return _0x22a3fa;}})});}_0x410871=_[_0x804b('0x3c')]({},_0x410871,_0x3eb531[_0x804b('0x3e')]);var _0x3d6d8a={'where':_0x410871[_0x804b('0x3b')]};return db['FreshdeskAccount']['count'](_0x3d6d8a)[_0x804b('0x26')](function(_0x2afafd){_0x3dbd41[_0x804b('0x1d')]=_0x2afafd;if(_0x3eb531['query'][_0x804b('0x3f')]){_0x410871['include']=[{'all':!![]}];}return db[_0x804b('0x40')][_0x804b('0x41')](_0x410871);})[_0x804b('0x26')](function(_0x304710){_0x3dbd41[_0x804b('0x42')]=_0x304710;return _0x3dbd41;})[_0x804b('0x26')](respondWithFilteredResult(_0x2931ff,_0x410871))[_0x804b('0x43')](handleError(_0x2931ff,null));};exports['show']=function(_0x17972a,_0x1c0363){var _0x1dcec8={'raw':![],'where':{'id':_0x17972a['params']['id']}},_0x1d25f6={};_0x1d25f6[_0x804b('0x30')]=_[_0x804b('0x44')](db[_0x804b('0x40')][_0x804b('0x2d')]);_0x1d25f6[_0x804b('0x31')]=_[_0x804b('0x44')](_0x17972a[_0x804b('0x31')]);_0x1d25f6[_0x804b('0x32')]=_['intersection'](_0x1d25f6[_0x804b('0x30')],_0x1d25f6['query']);_0x1dcec8['attributes']=_['intersection'](_0x1d25f6[_0x804b('0x30')],qs['fields'](_0x17972a[_0x804b('0x31')][_0x804b('0x35')]));_0x1dcec8[_0x804b('0x34')]=_0x1dcec8[_0x804b('0x34')]['length']?_0x1dcec8[_0x804b('0x34')]:_0x1d25f6[_0x804b('0x30')];if(_0x17972a[_0x804b('0x31')]['includeAll']){_0x1dcec8[_0x804b('0x45')]=[{'all':!![]}];}_0x1dcec8=_[_0x804b('0x3c')]({},_0x1dcec8,_0x17972a[_0x804b('0x3e')]);return db['FreshdeskAccount'][_0x804b('0x46')](_0x1dcec8)[_0x804b('0x26')](handleEntityNotFound(_0x1c0363,null))[_0x804b('0x26')](respondWithResult(_0x1c0363,null))[_0x804b('0x43')](handleError(_0x1c0363,null));};exports[_0x804b('0x47')]=function(_0x3a39f5,_0x392bc0){return db[_0x804b('0x40')][_0x804b('0x47')](_0x3a39f5[_0x804b('0x48')],{})[_0x804b('0x26')](respondWithResult(_0x392bc0,0xc9))[_0x804b('0x43')](handleError(_0x392bc0,null));};exports[_0x804b('0x25')]=function(_0x2c1796,_0x578e92){if(_0x2c1796['body']['id']){delete _0x2c1796[_0x804b('0x48')]['id'];}return db[_0x804b('0x40')][_0x804b('0x46')]({'where':{'id':_0x2c1796[_0x804b('0x49')]['id']}})[_0x804b('0x26')](handleEntityNotFound(_0x578e92,null))['then'](saveUpdates(_0x2c1796[_0x804b('0x48')],null))[_0x804b('0x26')](respondWithResult(_0x578e92,null))[_0x804b('0x43')](handleError(_0x578e92,null));};exports[_0x804b('0x27')]=function(_0x47247c,_0x111e3f){return db['FreshdeskAccount']['find']({'where':{'id':_0x47247c[_0x804b('0x49')]['id']}})[_0x804b('0x26')](handleEntityNotFound(_0x111e3f,null))['then'](removeEntity(_0x111e3f,null))['catch'](handleError(_0x111e3f,null));};exports[_0x804b('0x4a')]=function(_0x3d56bb,_0x4a5068,_0x4efe2a){var _0x164c5d={};var _0x38c2c0={};var _0x54cc99;var _0x2756de;return db['FreshdeskAccount'][_0x804b('0x4b')]({'where':{'id':_0x3d56bb['params']['id']}})[_0x804b('0x26')](handleEntityNotFound(_0x4a5068,null))[_0x804b('0x26')](function(_0x47c835){if(_0x47c835){_0x54cc99=_0x47c835;_0x38c2c0[_0x804b('0x30')]=_['keys'](db[_0x804b('0x4c')][_0x804b('0x2d')]);_0x38c2c0[_0x804b('0x31')]=_[_0x804b('0x44')](_0x3d56bb[_0x804b('0x31')]);_0x38c2c0[_0x804b('0x32')]=_[_0x804b('0x33')](_0x38c2c0[_0x804b('0x30')],_0x38c2c0[_0x804b('0x31')]);_0x164c5d[_0x804b('0x34')]=_['intersection'](_0x38c2c0['model'],qs[_0x804b('0x35')](_0x3d56bb['query']['fields']));_0x164c5d[_0x804b('0x34')]=_0x164c5d[_0x804b('0x34')][_0x804b('0x36')]?_0x164c5d[_0x804b('0x34')]:_0x38c2c0['model'];_0x164c5d['order']=qs[_0x804b('0x39')](_0x3d56bb[_0x804b('0x31')][_0x804b('0x39')]);_0x164c5d[_0x804b('0x3b')]=qs[_0x804b('0x32')](_[_0x804b('0x4d')](_0x3d56bb[_0x804b('0x31')],_0x38c2c0[_0x804b('0x32')]));if(_0x3d56bb[_0x804b('0x31')][_0x804b('0x3a')]){_0x164c5d[_0x804b('0x3b')]=_[_0x804b('0x3c')](_0x164c5d[_0x804b('0x3b')],{'$or':_[_0x804b('0x2c')](_0x164c5d[_0x804b('0x34')],function(_0x3d98a2){var _0x524291={};_0x524291[_0x3d98a2]={'$like':'%'+_0x3d56bb[_0x804b('0x31')][_0x804b('0x3a')]+'%'};return _0x524291;})});}_0x164c5d=_['merge']({},_0x164c5d,_0x3d56bb[_0x804b('0x3e')]);return _0x54cc99[_0x804b('0x4a')](_0x164c5d);}})[_0x804b('0x26')](function(_0x2576a4){if(_0x2576a4){_0x2756de=_0x2576a4['length'];if(!_0x3d56bb[_0x804b('0x31')][_0x804b('0x37')]('nolimit')){_0x164c5d[_0x804b('0x1c')]=qs[_0x804b('0x1c')](_0x3d56bb[_0x804b('0x31')]['limit']);_0x164c5d[_0x804b('0x1e')]=qs[_0x804b('0x1e')](_0x3d56bb[_0x804b('0x31')][_0x804b('0x1e')]);}return _0x54cc99[_0x804b('0x4a')](_0x164c5d);}})['then'](function(_0xb08c4e){if(_0xb08c4e){return _0xb08c4e?{'count':_0x2756de,'rows':_0xb08c4e}:null;}})[_0x804b('0x26')](respondWithResult(_0x4a5068,null))[_0x804b('0x43')](handleError(_0x4a5068,null));};exports[_0x804b('0x4e')]=function(_0x5dcc63,_0x4f8a81,_0x183796){if(_0x5dcc63['body']['id']){delete _0x5dcc63[_0x804b('0x48')]['id'];}return db[_0x804b('0x40')][_0x804b('0x4b')]({'where':{'id':_0x5dcc63[_0x804b('0x49')]['id']}})[_0x804b('0x26')](handleEntityNotFound(_0x4f8a81,null))['then'](function(_0x27f06c){if(_0x27f06c){_0x5dcc63[_0x804b('0x48')][_0x804b('0x4f')]=_0x27f06c['id'];_0x5dcc63['body'][_0x804b('0x50')]=integrations[_0x804b('0x51')](_0x5dcc63['body'][_0x804b('0x52')],_0x5dcc63['body'][_0x804b('0x2e')]);_0x5dcc63[_0x804b('0x48')]['Descriptions']=integrations[_0x804b('0x53')](_0x5dcc63[_0x804b('0x48')][_0x804b('0x52')],_0x5dcc63['body'][_0x804b('0x2e')]);return db['FreshdeskConfiguration'][_0x804b('0x47')](_0x5dcc63[_0x804b('0x48')],{'include':[{'model':db[_0x804b('0x54')],'as':_0x804b('0x50')},{'model':db['FreshdeskField'],'as':_0x804b('0x55')}]});}return null;})[_0x804b('0x26')](respondWithResult(_0x4f8a81,null))[_0x804b('0x43')](handleError(_0x4f8a81,null));};exports[_0x804b('0x56')]=function(_0x17e21c,_0x1bb4ec,_0x5b3b79){var _0x39ed3c='';return db[_0x804b('0x40')]['findOne']({'where':{'id':_0x17e21c[_0x804b('0x49')]['id']},'attributes':['id',_0x804b('0x57'),_0x804b('0x58')]})[_0x804b('0x26')](handleEntityNotFound(_0x1bb4ec,null))['then'](function(_0x335c63){if(_0x335c63){_0x39ed3c=_0x335c63[_0x804b('0x57')];var _0x5a2ced=_0x39ed3c[_0x804b('0x59')](-0x1);if(_0x5a2ced==='/'){_0x39ed3c=_0x39ed3c[_0x804b('0x5a')](0x0,_0x39ed3c['lastIndexOf'](_0x5a2ced));}return rp({'method':_0x804b('0x5b'),'uri':util['format'](_0x804b('0x5c'),_0x39ed3c,_0x804b('0x5d')),'headers':{'Authorization':util[_0x804b('0x5e')](_0x804b('0x5f'),new Buffer(util[_0x804b('0x5e')](_0x804b('0x60'),_0x335c63[_0x804b('0x58')]))['toString'](_0x804b('0x61')))},'json':!![]});}})['then'](function(_0x18fdd5){if(_0x18fdd5){var _0x2d955e=[_0x804b('0x62'),_0x804b('0x63'),_0x804b('0x64'),_0x804b('0x65'),_0x804b('0x1a'),_0x804b('0x66'),_0x804b('0x67'),_0x804b('0x68'),_0x804b('0x69'),'group','company'];_[_0x804b('0x6a')](_0x18fdd5,function(_0x383553){return _0x2d955e[_0x804b('0x6b')](_0x383553[_0x804b('0x2a')])||!_0x383553['default']&&_0x383553[_0x804b('0x2e')]!==_0x804b('0x6c')&&_0x383553[_0x804b('0x2e')]!==_0x804b('0x6d');});return{'count':_0x18fdd5[_0x804b('0x36')],'rows':_[_0x804b('0x2c')](_0x18fdd5,function(_0x1a9efe){return{'id':_0x1a9efe[_0x804b('0x2a')],'name':_0x1a9efe[_0x804b('0x6e')],'custom':!_0x1a9efe[_0x804b('0x6f')],'options':_0x1a9efe['choices']?_['map'](_0x1a9efe[_0x804b('0x70')],function(_0x2c45de){return{'name':_['capitalize'](_0x2c45de),'value':_0x2c45de};}):[]};})};}})[_0x804b('0x26')](respondWithResult(_0x1bb4ec,null))[_0x804b('0x43')](function(_0x585d7c){var _0x345bf7=_0x17e21c['query']['test']?0x1f4:_0x585d7c[_0x804b('0x71')]||0x1f4;logger[_0x804b('0x72')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x345bf7,JSON[_0x804b('0x73')](_0x585d7c));delete _0x585d7c[_0x804b('0x2a')];if(_0x345bf7===0x191){_0x345bf7=0x190;}_0x1bb4ec['status'](_0x345bf7)[_0x804b('0x2b')](_0x17e21c['query'][_0x804b('0x74')]?{'message':_0x804b('0x75'),'statusCode':_0x585d7c[_0x804b('0x71')]}:_0x585d7c);});};
\ No newline at end of file
+var _0x39c4=['destroy','findOne','FreshdeskConfiguration','Subjects','getDescriptions','channel','FreshdeskField','Descriptions','getFields','remoteUri','apiKey','slice','substring','GET','%s/%s','format','toString','base64','requester','subject','agent','priority','group','source','ticket_type','remove','includes','default','custom_text','custom_dropdown','label','choices','test','getFields,\x20%s,\x20%s,\x20%s','stringify','statusCode','rimraf','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','update','error','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','then','rows','catch','show','params','keys','includeAll','find','create','body'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x39c4,0x174));var _0x439c=function(_0x530bd6,_0x581369){_0x530bd6=_0x530bd6-0x0;var _0x35d553=_0x39c4[_0x530bd6];return _0x35d553;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x439c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x439c('0x1'));var moment=require(_0x439c('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x439c('0x3'));var path=require(_0x439c('0x4'));var sox=require(_0x439c('0x5'));var csv=require(_0x439c('0x6'));var ejs=require(_0x439c('0x7'));var fs=require('fs');var fs_extra=require(_0x439c('0x8'));var _=require(_0x439c('0x9'));var squel=require(_0x439c('0xa'));var crypto=require(_0x439c('0xb'));var jsforce=require(_0x439c('0xc'));var deskjs=require(_0x439c('0xd'));var toCsv=require(_0x439c('0x6'));var querystring=require(_0x439c('0xe'));var Papa=require(_0x439c('0xf'));var Redis=require(_0x439c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x439c('0x11'));var as=require(_0x439c('0x12'));var hardwareService=require(_0x439c('0x13'));var logger=require(_0x439c('0x14'))(_0x439c('0x15'));var utils=require(_0x439c('0x16'));var config=require(_0x439c('0x17'));var licenseUtil=require(_0x439c('0x18'));var db=require(_0x439c('0x19'))['db'];var integrations=require(_0x439c('0x1a'));function respondWithStatusCode(_0x305154,_0x2bd89){_0x2bd89=_0x2bd89||0xcc;return function(_0x518179){if(_0x518179){return _0x305154[_0x439c('0x1b')](_0x2bd89);}return _0x305154['status'](_0x2bd89)['end']();};}function respondWithResult(_0x1e367a,_0x47182e){_0x47182e=_0x47182e||0xc8;return function(_0x486451){if(_0x486451){return _0x1e367a[_0x439c('0x1c')](_0x47182e)[_0x439c('0x1d')](_0x486451);}};}function respondWithFilteredResult(_0x5b8898,_0x4f5b71){return function(_0x38d60d){if(_0x38d60d){var _0x5478b4=typeof _0x4f5b71[_0x439c('0x1e')]===_0x439c('0x1f')&&typeof _0x4f5b71[_0x439c('0x20')]==='undefined';var _0x33aeb1=_0x38d60d[_0x439c('0x21')];var _0x4635e7=_0x5478b4?0x0:_0x4f5b71[_0x439c('0x1e')];var _0x569a31=_0x5478b4?_0x38d60d[_0x439c('0x21')]:_0x4f5b71[_0x439c('0x1e')]+_0x4f5b71[_0x439c('0x20')];var _0x52fe98;if(_0x569a31>=_0x33aeb1){_0x569a31=_0x33aeb1;_0x52fe98=0xc8;}else{_0x52fe98=0xce;}_0x5b8898[_0x439c('0x1c')](_0x52fe98);return _0x5b8898['set']('Content-Range',_0x4635e7+'-'+_0x569a31+'/'+_0x33aeb1)[_0x439c('0x1d')](_0x38d60d);}return null;};}function patchUpdates(_0x5c6214){return function(_0x22d8e0){try{jsonpatch[_0x439c('0x22')](_0x22d8e0,_0x5c6214,!![]);}catch(_0x29958c){return BPromise[_0x439c('0x23')](_0x29958c);}return _0x22d8e0[_0x439c('0x24')]();};}function saveUpdates(_0x7cdb81,_0x193883){return function(_0x373f19){if(_0x373f19){return _0x373f19[_0x439c('0x25')](_0x7cdb81)['then'](function(_0x1b83b2){return _0x1b83b2;});}return null;};}function removeEntity(_0x1f8ef6,_0x49c1e3){return function(_0x222ccd){if(_0x222ccd){return _0x222ccd['destroy']()['then'](function(){_0x1f8ef6[_0x439c('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b3109,_0x467338){return function(_0x349d75){if(!_0x349d75){_0x2b3109[_0x439c('0x1b')](0x194);}return _0x349d75;};}function handleError(_0x390e59,_0x48cbf3){_0x48cbf3=_0x48cbf3||0x1f4;return function(_0x557dae){logger[_0x439c('0x26')](_0x557dae['stack']);if(_0x557dae[_0x439c('0x27')]){delete _0x557dae['name'];}_0x390e59[_0x439c('0x1c')](_0x48cbf3)[_0x439c('0x28')](_0x557dae);};}exports[_0x439c('0x29')]=function(_0x2f670b,_0x518b94){var _0x17ecfa={},_0x1fa033={},_0x291ab0={'count':0x0,'rows':[]};var _0x1ae717=_[_0x439c('0x2a')](db[_0x439c('0x2b')][_0x439c('0x2c')],function(_0x387833){return{'name':_0x387833[_0x439c('0x2d')],'type':_0x387833[_0x439c('0x2e')][_0x439c('0x2f')]};});_0x1fa033[_0x439c('0x30')]=_[_0x439c('0x2a')](_0x1ae717,_0x439c('0x27'));_0x1fa033['query']=_['keys'](_0x2f670b[_0x439c('0x31')]);_0x1fa033[_0x439c('0x32')]=_['intersection'](_0x1fa033[_0x439c('0x30')],_0x1fa033[_0x439c('0x31')]);_0x17ecfa[_0x439c('0x33')]=_[_0x439c('0x34')](_0x1fa033[_0x439c('0x30')],qs['fields'](_0x2f670b[_0x439c('0x31')][_0x439c('0x35')]));_0x17ecfa['attributes']=_0x17ecfa[_0x439c('0x33')][_0x439c('0x36')]?_0x17ecfa[_0x439c('0x33')]:_0x1fa033[_0x439c('0x30')];if(!_0x2f670b[_0x439c('0x31')][_0x439c('0x37')](_0x439c('0x38'))){_0x17ecfa[_0x439c('0x20')]=qs[_0x439c('0x20')](_0x2f670b[_0x439c('0x31')][_0x439c('0x20')]);_0x17ecfa['offset']=qs[_0x439c('0x1e')](_0x2f670b['query'][_0x439c('0x1e')]);}_0x17ecfa[_0x439c('0x39')]=qs['sort'](_0x2f670b[_0x439c('0x31')][_0x439c('0x3a')]);_0x17ecfa['where']=qs['filters'](_[_0x439c('0x3b')](_0x2f670b['query'],_0x1fa033[_0x439c('0x32')]),_0x1ae717);if(_0x2f670b['query'][_0x439c('0x3c')]){_0x17ecfa[_0x439c('0x3d')]=_[_0x439c('0x3e')](_0x17ecfa[_0x439c('0x3d')],{'$or':_[_0x439c('0x2a')](_0x1ae717,function(_0x31ef6d){if(_0x31ef6d['type']!==_0x439c('0x3f')){var _0x47ac85={};_0x47ac85[_0x31ef6d[_0x439c('0x27')]]={'$like':'%'+_0x2f670b['query'][_0x439c('0x3c')]+'%'};return _0x47ac85;}})});}_0x17ecfa=_[_0x439c('0x3e')]({},_0x17ecfa,_0x2f670b[_0x439c('0x40')]);var _0x1a8d93={'where':_0x17ecfa[_0x439c('0x3d')]};return db[_0x439c('0x2b')][_0x439c('0x21')](_0x1a8d93)['then'](function(_0x5d3e22){_0x291ab0[_0x439c('0x21')]=_0x5d3e22;if(_0x2f670b[_0x439c('0x31')]['includeAll']){_0x17ecfa[_0x439c('0x41')]=[{'all':!![]}];}return db['FreshdeskAccount']['findAll'](_0x17ecfa);})[_0x439c('0x42')](function(_0xa44162){_0x291ab0[_0x439c('0x43')]=_0xa44162;return _0x291ab0;})[_0x439c('0x42')](respondWithFilteredResult(_0x518b94,_0x17ecfa))[_0x439c('0x44')](handleError(_0x518b94,null));};exports[_0x439c('0x45')]=function(_0x3873bb,_0x5b31d8){var _0x340e07={'raw':![],'where':{'id':_0x3873bb[_0x439c('0x46')]['id']}},_0x45b24f={};_0x45b24f[_0x439c('0x30')]=_[_0x439c('0x47')](db['FreshdeskAccount'][_0x439c('0x2c')]);_0x45b24f[_0x439c('0x31')]=_[_0x439c('0x47')](_0x3873bb[_0x439c('0x31')]);_0x45b24f['filters']=_[_0x439c('0x34')](_0x45b24f[_0x439c('0x30')],_0x45b24f['query']);_0x340e07['attributes']=_['intersection'](_0x45b24f['model'],qs[_0x439c('0x35')](_0x3873bb['query']['fields']));_0x340e07[_0x439c('0x33')]=_0x340e07[_0x439c('0x33')]['length']?_0x340e07[_0x439c('0x33')]:_0x45b24f[_0x439c('0x30')];if(_0x3873bb[_0x439c('0x31')][_0x439c('0x48')]){_0x340e07[_0x439c('0x41')]=[{'all':!![]}];}_0x340e07=_['merge']({},_0x340e07,_0x3873bb[_0x439c('0x40')]);return db[_0x439c('0x2b')][_0x439c('0x49')](_0x340e07)[_0x439c('0x42')](handleEntityNotFound(_0x5b31d8,null))[_0x439c('0x42')](respondWithResult(_0x5b31d8,null))[_0x439c('0x44')](handleError(_0x5b31d8,null));};exports[_0x439c('0x4a')]=function(_0x2a090b,_0x12e102){return db[_0x439c('0x2b')][_0x439c('0x4a')](_0x2a090b[_0x439c('0x4b')],{})['then'](respondWithResult(_0x12e102,0xc9))[_0x439c('0x44')](handleError(_0x12e102,null));};exports[_0x439c('0x25')]=function(_0x180d0c,_0x4a5c56){if(_0x180d0c[_0x439c('0x4b')]['id']){delete _0x180d0c[_0x439c('0x4b')]['id'];}return db[_0x439c('0x2b')][_0x439c('0x49')]({'where':{'id':_0x180d0c[_0x439c('0x46')]['id']}})['then'](handleEntityNotFound(_0x4a5c56,null))[_0x439c('0x42')](saveUpdates(_0x180d0c[_0x439c('0x4b')],null))[_0x439c('0x42')](respondWithResult(_0x4a5c56,null))[_0x439c('0x44')](handleError(_0x4a5c56,null));};exports[_0x439c('0x4c')]=function(_0x198648,_0x5dfebc){return db[_0x439c('0x2b')][_0x439c('0x49')]({'where':{'id':_0x198648[_0x439c('0x46')]['id']}})['then'](handleEntityNotFound(_0x5dfebc,null))[_0x439c('0x42')](removeEntity(_0x5dfebc,null))[_0x439c('0x44')](handleError(_0x5dfebc,null));};exports['getConfigurations']=function(_0x44919e,_0x5f1844,_0x565d5f){var _0x204cbf={};var _0x348847={};var _0x43ebf5;var _0x57e81e;return db[_0x439c('0x2b')][_0x439c('0x4d')]({'where':{'id':_0x44919e[_0x439c('0x46')]['id']}})[_0x439c('0x42')](handleEntityNotFound(_0x5f1844,null))['then'](function(_0x4d3f8c){if(_0x4d3f8c){_0x43ebf5=_0x4d3f8c;_0x348847['model']=_[_0x439c('0x47')](db[_0x439c('0x4e')]['rawAttributes']);_0x348847[_0x439c('0x31')]=_[_0x439c('0x47')](_0x44919e[_0x439c('0x31')]);_0x348847[_0x439c('0x32')]=_['intersection'](_0x348847[_0x439c('0x30')],_0x348847[_0x439c('0x31')]);_0x204cbf[_0x439c('0x33')]=_[_0x439c('0x34')](_0x348847['model'],qs[_0x439c('0x35')](_0x44919e[_0x439c('0x31')][_0x439c('0x35')]));_0x204cbf[_0x439c('0x33')]=_0x204cbf[_0x439c('0x33')][_0x439c('0x36')]?_0x204cbf['attributes']:_0x348847[_0x439c('0x30')];_0x204cbf[_0x439c('0x39')]=qs[_0x439c('0x3a')](_0x44919e[_0x439c('0x31')][_0x439c('0x3a')]);_0x204cbf[_0x439c('0x3d')]=qs[_0x439c('0x32')](_['pick'](_0x44919e[_0x439c('0x31')],_0x348847['filters']));if(_0x44919e[_0x439c('0x31')][_0x439c('0x3c')]){_0x204cbf[_0x439c('0x3d')]=_['merge'](_0x204cbf['where'],{'$or':_[_0x439c('0x2a')](_0x204cbf['attributes'],function(_0x16723e){var _0x37ddd4={};_0x37ddd4[_0x16723e]={'$like':'%'+_0x44919e[_0x439c('0x31')][_0x439c('0x3c')]+'%'};return _0x37ddd4;})});}_0x204cbf=_[_0x439c('0x3e')]({},_0x204cbf,_0x44919e[_0x439c('0x40')]);return _0x43ebf5['getConfigurations'](_0x204cbf);}})['then'](function(_0xbeacc1){if(_0xbeacc1){_0x57e81e=_0xbeacc1[_0x439c('0x36')];if(!_0x44919e[_0x439c('0x31')]['hasOwnProperty'](_0x439c('0x38'))){_0x204cbf[_0x439c('0x20')]=qs[_0x439c('0x20')](_0x44919e['query'][_0x439c('0x20')]);_0x204cbf[_0x439c('0x1e')]=qs[_0x439c('0x1e')](_0x44919e[_0x439c('0x31')][_0x439c('0x1e')]);}return _0x43ebf5['getConfigurations'](_0x204cbf);}})[_0x439c('0x42')](function(_0x481481){if(_0x481481){return _0x481481?{'count':_0x57e81e,'rows':_0x481481}:null;}})[_0x439c('0x42')](respondWithResult(_0x5f1844,null))[_0x439c('0x44')](handleError(_0x5f1844,null));};exports['addConfiguration']=function(_0x2aa589,_0x5bb5c4,_0x950a8e){if(_0x2aa589[_0x439c('0x4b')]['id']){delete _0x2aa589[_0x439c('0x4b')]['id'];}return db[_0x439c('0x2b')][_0x439c('0x4d')]({'where':{'id':_0x2aa589[_0x439c('0x46')]['id']}})[_0x439c('0x42')](handleEntityNotFound(_0x5bb5c4,null))[_0x439c('0x42')](function(_0x59bd8d){if(_0x59bd8d){_0x2aa589['body']['AccountId']=_0x59bd8d['id'];_0x2aa589[_0x439c('0x4b')][_0x439c('0x4f')]=integrations['getSubjects'](_0x2aa589['body']['channel'],_0x2aa589[_0x439c('0x4b')][_0x439c('0x2e')]);_0x2aa589['body']['Descriptions']=integrations[_0x439c('0x50')](_0x2aa589[_0x439c('0x4b')][_0x439c('0x51')],_0x2aa589[_0x439c('0x4b')][_0x439c('0x2e')]);return db[_0x439c('0x4e')]['create'](_0x2aa589[_0x439c('0x4b')],{'include':[{'model':db['FreshdeskField'],'as':_0x439c('0x4f')},{'model':db[_0x439c('0x52')],'as':_0x439c('0x53')}]});}return null;})[_0x439c('0x42')](respondWithResult(_0x5bb5c4,null))[_0x439c('0x44')](handleError(_0x5bb5c4,null));};exports[_0x439c('0x54')]=function(_0x338905,_0x1ddd58,_0x4543f8){var _0x3406ab='';return db[_0x439c('0x2b')][_0x439c('0x4d')]({'where':{'id':_0x338905[_0x439c('0x46')]['id']},'attributes':['id',_0x439c('0x55'),_0x439c('0x56')]})[_0x439c('0x42')](handleEntityNotFound(_0x1ddd58,null))[_0x439c('0x42')](function(_0xd3fdb0){if(_0xd3fdb0){_0x3406ab=_0xd3fdb0['remoteUri'];var _0x2c3a7f=_0x3406ab[_0x439c('0x57')](-0x1);if(_0x2c3a7f==='/'){_0x3406ab=_0x3406ab[_0x439c('0x58')](0x0,_0x3406ab['lastIndexOf'](_0x2c3a7f));}return rp({'method':_0x439c('0x59'),'uri':util['format'](_0x439c('0x5a'),_0x3406ab,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x439c('0x5b')]('Basic\x20%s',new Buffer(util[_0x439c('0x5b')]('%s:X',_0xd3fdb0['apiKey']))[_0x439c('0x5c')](_0x439c('0x5d')))},'json':!![]});}})[_0x439c('0x42')](function(_0x89692a){if(_0x89692a){var _0x357c9a=[_0x439c('0x5e'),_0x439c('0x5f'),_0x439c('0x60'),'description',_0x439c('0x1c'),_0x439c('0x61'),_0x439c('0x62'),_0x439c('0x63'),_0x439c('0x64'),_0x439c('0x62'),'company'];_[_0x439c('0x65')](_0x89692a,function(_0x593615){return _0x357c9a[_0x439c('0x66')](_0x593615['name'])||!_0x593615[_0x439c('0x67')]&&_0x593615[_0x439c('0x2e')]!==_0x439c('0x68')&&_0x593615[_0x439c('0x2e')]!==_0x439c('0x69');});return{'count':_0x89692a[_0x439c('0x36')],'rows':_[_0x439c('0x2a')](_0x89692a,function(_0x34e57f){return{'id':_0x34e57f[_0x439c('0x27')],'name':_0x34e57f[_0x439c('0x6a')],'custom':!_0x34e57f[_0x439c('0x67')],'options':_0x34e57f[_0x439c('0x6b')]?_['map'](_0x34e57f['choices'],function(_0x3fbf0b){return{'name':_['capitalize'](_0x3fbf0b),'value':_0x3fbf0b};}):[]};})};}})['then'](respondWithResult(_0x1ddd58,null))['catch'](function(_0x3c14be){var _0x11fdae=_0x338905[_0x439c('0x31')][_0x439c('0x6c')]?0x1f4:_0x3c14be['statusCode']||0x1f4;logger['error'](_0x439c('0x6d'),_0x439c('0x54'),_0x11fdae,JSON[_0x439c('0x6e')](_0x3c14be));delete _0x3c14be[_0x439c('0x27')];if(_0x11fdae===0x191){_0x11fdae=0x190;}_0x1ddd58[_0x439c('0x1c')](_0x11fdae)[_0x439c('0x28')](_0x338905['query'][_0x439c('0x6c')]?{'message':'Wrong\x20credentials','statusCode':_0x3c14be[_0x439c('0x6f')]}:_0x3c14be);});};
\ No newline at end of file
index cd59ede..10ee4da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c54=['path','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x1b973e,_0x462bf2){var _0x1ee092=function(_0x2cc0f8){while(--_0x2cc0f8){_0x1b973e['push'](_0x1b973e['shift']());}};_0x1ee092(++_0x462bf2);}(_0x2c54,0xae));var _0x42c5=function(_0x14e02b,_0x4369b8){_0x14e02b=_0x14e02b-0x0;var _0x18ef93=_0x2c54[_0x14e02b];return _0x18ef93;};'use strict';var _=require(_0x42c5('0x0'));var util=require(_0x42c5('0x1'));var logger=require(_0x42c5('0x2'))(_0x42c5('0x3'));var moment=require(_0x42c5('0x4'));var BPromise=require('bluebird');var rp=require(_0x42c5('0x5'));var fs=require('fs');var path=require(_0x42c5('0x6'));var rimraf=require('rimraf');var config=require(_0x42c5('0x7'));var attributes=require(_0x42c5('0x8'));var integrations=require(_0x42c5('0x9'));module[_0x42c5('0xa')]=function(_0x46f9f9,_0x28bd80){return _0x46f9f9[_0x42c5('0xb')]('FreshdeskAccount',attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf696=['../../config/environment','../../components/integrations/configuration','exports','FreshdeskAccount','int_freshdesk_accounts','util','../../config/logger','moment','request-promise','rimraf'];(function(_0x21b757,_0x5d1f1e){var _0x1b5ad0=function(_0x47f180){while(--_0x47f180){_0x21b757['push'](_0x21b757['shift']());}};_0x1b5ad0(++_0x5d1f1e);}(_0xf696,0x159));var _0x6f69=function(_0x256a81,_0x19b734){_0x256a81=_0x256a81-0x0;var _0x1215ec=_0xf696[_0x256a81];return _0x1215ec;};'use strict';var _=require('lodash');var util=require(_0x6f69('0x0'));var logger=require(_0x6f69('0x1'))('api');var moment=require(_0x6f69('0x2'));var BPromise=require('bluebird');var rp=require(_0x6f69('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6f69('0x4'));var config=require(_0x6f69('0x5'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x6f69('0x6'));module[_0x6f69('0x7')]=function(_0x3989c3,_0x509791){return _0x3989c3['define'](_0x6f69('0x8'),attributes,{'tableName':_0x6f69('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e3fd6e9..ead9905 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x679d=['GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowFreshdeskAccount','find','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','FreshdeskAccount,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x2aa30f,_0x31e0c1){var _0x153192=function(_0x15bcfc){while(--_0x15bcfc){_0x2aa30f['push'](_0x2aa30f['shift']());}};_0x153192(++_0x31e0c1);}(_0x679d,0xfb));var _0xd679=function(_0x5215b2,_0x4b87f2){_0x5215b2=_0x5215b2-0x0;var _0x301264=_0x679d[_0x5215b2];return _0x301264;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd679('0x0'));var BPromise=require(_0xd679('0x1'));var rs=require(_0xd679('0x2'));var fs=require('fs');var Redis=require(_0xd679('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd679('0x4'));var logger=require(_0xd679('0x5'))('rpc');var config=require(_0xd679('0x6'));var jayson=require(_0xd679('0x7'));var client=jayson[_0xd679('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ea7ca,_0x28ae5f,_0x5caa75){return new BPromise(function(_0xfcf706,_0x3769fa){return client[_0xd679('0x9')](_0x2ea7ca,_0x5caa75)[_0xd679('0xa')](function(_0x4334dc){logger[_0xd679('0xb')](_0xd679('0xc'),_0x28ae5f,'request\x20sent');logger[_0xd679('0xd')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x28ae5f,'request\x20sent',JSON[_0xd679('0xe')](_0x4334dc));if(_0x4334dc[_0xd679('0xf')]){if(_0x4334dc[_0xd679('0xf')][_0xd679('0x10')]===0x1f4){logger[_0xd679('0xf')](_0xd679('0xc'),_0x28ae5f,_0x4334dc[_0xd679('0xf')]['message']);return _0x3769fa(_0x4334dc['error']['message']);}logger[_0xd679('0xf')](_0xd679('0xc'),_0x28ae5f,_0x4334dc['error'][_0xd679('0x11')]);return _0xfcf706(_0x4334dc[_0xd679('0xf')][_0xd679('0x11')]);}else{logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x28ae5f,_0xd679('0x12'));_0xfcf706(_0x4334dc[_0xd679('0x13')][_0xd679('0x11')]);}})[_0xd679('0x14')](function(_0xcefc9d){logger[_0xd679('0xf')](_0xd679('0xc'),_0x28ae5f,_0xcefc9d);_0x3769fa(_0xcefc9d);});});}exports[_0xd679('0x15')]=function(_0x10bc01){var _0x4b1a00=this;return new Promise(function(_0x3e43c9,_0x319bea){return db[_0xd679('0x16')][_0xd679('0x17')]({'raw':_0x10bc01['options']?_0x10bc01[_0xd679('0x18')][_0xd679('0x19')]===undefined?!![]:![]:!![],'where':_0x10bc01[_0xd679('0x18')]?_0x10bc01[_0xd679('0x18')][_0xd679('0x1a')]||null:null,'attributes':_0x10bc01['options']?_0x10bc01['options'][_0xd679('0x1b')]||null:null,'limit':_0x10bc01[_0xd679('0x18')]?_0x10bc01['options'][_0xd679('0x1c')]||null:null,'include':_0x10bc01[_0xd679('0x18')]?_0x10bc01[_0xd679('0x18')][_0xd679('0x1d')]?_[_0xd679('0x1e')](_0x10bc01[_0xd679('0x18')][_0xd679('0x1d')],function(_0x318352){return{'model':db[_0x318352[_0xd679('0x1f')]],'as':_0x318352['as'],'attributes':_0x318352['attributes'],'include':_0x318352['include']?_[_0xd679('0x1e')](_0x318352[_0xd679('0x1d')],function(_0x33952a){return{'model':db[_0x33952a['model']],'as':_0x33952a['as'],'attributes':_0x33952a[_0xd679('0x1b')],'include':_0x33952a['include']?_[_0xd679('0x1e')](_0x33952a[_0xd679('0x1d')],function(_0xd40a6a){return{'model':db[_0xd40a6a[_0xd679('0x1f')]],'as':_0xd40a6a['as'],'attributes':_0xd40a6a['attributes']};}):[]};}):[]};}):[]:[]})[_0xd679('0xa')](function(_0x2af02a){logger[_0xd679('0xb')](_0xd679('0x15'),_0x10bc01);logger[_0xd679('0xd')](_0xd679('0x15'),_0x10bc01,JSON[_0xd679('0xe')](_0x2af02a));_0x3e43c9(_0x2af02a);})['catch'](function(_0x3266f7){logger[_0xd679('0xf')](_0xd679('0x15'),_0x3266f7[_0xd679('0x11')],_0x10bc01);_0x319bea(_0x4b1a00[_0xd679('0xf')](0x1f4,_0x3266f7[_0xd679('0x11')]));});});};exports[_0xd679('0x20')]=function(_0x2fa036){var _0x2717d9=this;return new Promise(function(_0x501b2f,_0x168292){return db[_0xd679('0x16')][_0xd679('0x21')]({'raw':_0x2fa036[_0xd679('0x18')]?_0x2fa036[_0xd679('0x18')][_0xd679('0x19')]===undefined?!![]:![]:!![],'where':_0x2fa036[_0xd679('0x18')]?_0x2fa036[_0xd679('0x18')][_0xd679('0x1a')]||null:null,'attributes':_0x2fa036[_0xd679('0x18')]?_0x2fa036[_0xd679('0x18')][_0xd679('0x1b')]||null:null,'include':_0x2fa036[_0xd679('0x18')]?_0x2fa036[_0xd679('0x18')][_0xd679('0x1d')]?_[_0xd679('0x1e')](_0x2fa036['options'][_0xd679('0x1d')],function(_0x3cffcb){return{'model':db[_0x3cffcb['model']],'as':_0x3cffcb['as'],'attributes':_0x3cffcb[_0xd679('0x1b')],'include':_0x3cffcb[_0xd679('0x1d')]?_[_0xd679('0x1e')](_0x3cffcb[_0xd679('0x1d')],function(_0x5a718d){return{'model':db[_0x5a718d[_0xd679('0x1f')]],'as':_0x5a718d['as'],'attributes':_0x5a718d['attributes'],'include':_0x5a718d[_0xd679('0x1d')]?_['map'](_0x5a718d[_0xd679('0x1d')],function(_0x50a718){return{'model':db[_0x50a718[_0xd679('0x1f')]],'as':_0x50a718['as'],'attributes':_0x50a718[_0xd679('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd679('0xa')](function(_0x1564c9){logger[_0xd679('0xb')](_0xd679('0x20'),_0x2fa036);logger[_0xd679('0xd')]('ShowFreshdeskAccount',_0x2fa036,JSON['stringify'](_0x1564c9));_0x501b2f(_0x1564c9);})[_0xd679('0x14')](function(_0x11d2ad){logger[_0xd679('0xf')](_0xd679('0x20'),_0x11d2ad[_0xd679('0x11')],_0x2fa036);_0x168292(_0x2717d9['error'](0x1f4,_0x11d2ad['message']));});});};
\ No newline at end of file
+var _0xa812=['FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','find','info','ShowFreshdeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2773d4,_0x20afb9){var _0x1fb03a=function(_0x4a653b){while(--_0x4a653b){_0x2773d4['push'](_0x2773d4['shift']());}};_0x1fb03a(++_0x20afb9);}(_0xa812,0x19c));var _0x2a81=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xa812[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0x2a81('0x0'));var util=require(_0x2a81('0x1'));var moment=require(_0x2a81('0x2'));var BPromise=require(_0x2a81('0x3'));var rs=require(_0x2a81('0x4'));var fs=require('fs');var Redis=require(_0x2a81('0x5'));var db=require(_0x2a81('0x6'))['db'];var utils=require(_0x2a81('0x7'));var logger=require(_0x2a81('0x8'))(_0x2a81('0x9'));var config=require(_0x2a81('0xa'));var jayson=require(_0x2a81('0xb'));var client=jayson[_0x2a81('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x533acf,_0x1e7424,_0x22f72c){return new BPromise(function(_0xecbe51,_0x57a9c3){return client[_0x2a81('0xd')](_0x533acf,_0x22f72c)['then'](function(_0x373ab1){logger['info'](_0x2a81('0xe'),_0x1e7424,_0x2a81('0xf'));logger[_0x2a81('0x10')](_0x2a81('0x11'),_0x1e7424,'request\x20sent',JSON[_0x2a81('0x12')](_0x373ab1));if(_0x373ab1[_0x2a81('0x13')]){if(_0x373ab1['error'][_0x2a81('0x14')]===0x1f4){logger[_0x2a81('0x13')](_0x2a81('0xe'),_0x1e7424,_0x373ab1[_0x2a81('0x13')][_0x2a81('0x15')]);return _0x57a9c3(_0x373ab1[_0x2a81('0x13')][_0x2a81('0x15')]);}logger[_0x2a81('0x13')](_0x2a81('0xe'),_0x1e7424,_0x373ab1['error']['message']);return _0xecbe51(_0x373ab1[_0x2a81('0x13')]['message']);}else{logger['info'](_0x2a81('0xe'),_0x1e7424,_0x2a81('0xf'));_0xecbe51(_0x373ab1[_0x2a81('0x16')][_0x2a81('0x15')]);}})[_0x2a81('0x17')](function(_0x85e303){logger[_0x2a81('0x13')](_0x2a81('0xe'),_0x1e7424,_0x85e303);_0x57a9c3(_0x85e303);});});}exports[_0x2a81('0x18')]=function(_0x26a53f){var _0x508471=this;return new Promise(function(_0x317871,_0x3febd4){return db[_0x2a81('0x19')][_0x2a81('0x1a')]({'raw':_0x26a53f['options']?_0x26a53f[_0x2a81('0x1b')][_0x2a81('0x1c')]===undefined?!![]:![]:!![],'where':_0x26a53f[_0x2a81('0x1b')]?_0x26a53f['options'][_0x2a81('0x1d')]||null:null,'attributes':_0x26a53f['options']?_0x26a53f[_0x2a81('0x1b')][_0x2a81('0x1e')]||null:null,'limit':_0x26a53f[_0x2a81('0x1b')]?_0x26a53f[_0x2a81('0x1b')][_0x2a81('0x1f')]||null:null,'include':_0x26a53f[_0x2a81('0x1b')]?_0x26a53f[_0x2a81('0x1b')][_0x2a81('0x20')]?_[_0x2a81('0x21')](_0x26a53f[_0x2a81('0x1b')][_0x2a81('0x20')],function(_0x53ae36){return{'model':db[_0x53ae36[_0x2a81('0x22')]],'as':_0x53ae36['as'],'attributes':_0x53ae36[_0x2a81('0x1e')],'include':_0x53ae36[_0x2a81('0x20')]?_[_0x2a81('0x21')](_0x53ae36[_0x2a81('0x20')],function(_0x5c4442){return{'model':db[_0x5c4442['model']],'as':_0x5c4442['as'],'attributes':_0x5c4442[_0x2a81('0x1e')],'include':_0x5c4442[_0x2a81('0x20')]?_[_0x2a81('0x21')](_0x5c4442[_0x2a81('0x20')],function(_0x530ebe){return{'model':db[_0x530ebe['model']],'as':_0x530ebe['as'],'attributes':_0x530ebe[_0x2a81('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2a81('0x23')](function(_0x259257){logger['info'](_0x2a81('0x18'),_0x26a53f);logger[_0x2a81('0x10')](_0x2a81('0x18'),_0x26a53f,JSON[_0x2a81('0x12')](_0x259257));_0x317871(_0x259257);})['catch'](function(_0x355b7f){logger['error']('GetFreshdeskAccount',_0x355b7f[_0x2a81('0x15')],_0x26a53f);_0x3febd4(_0x508471[_0x2a81('0x13')](0x1f4,_0x355b7f[_0x2a81('0x15')]));});});};exports['ShowFreshdeskAccount']=function(_0x4cb4df){var _0x4f372c=this;return new Promise(function(_0xa03eb0,_0x19292a){return db[_0x2a81('0x19')][_0x2a81('0x24')]({'raw':_0x4cb4df[_0x2a81('0x1b')]?_0x4cb4df['options'][_0x2a81('0x1c')]===undefined?!![]:![]:!![],'where':_0x4cb4df[_0x2a81('0x1b')]?_0x4cb4df[_0x2a81('0x1b')][_0x2a81('0x1d')]||null:null,'attributes':_0x4cb4df['options']?_0x4cb4df[_0x2a81('0x1b')][_0x2a81('0x1e')]||null:null,'include':_0x4cb4df[_0x2a81('0x1b')]?_0x4cb4df['options'][_0x2a81('0x20')]?_['map'](_0x4cb4df[_0x2a81('0x1b')][_0x2a81('0x20')],function(_0x14358e){return{'model':db[_0x14358e[_0x2a81('0x22')]],'as':_0x14358e['as'],'attributes':_0x14358e[_0x2a81('0x1e')],'include':_0x14358e[_0x2a81('0x20')]?_['map'](_0x14358e[_0x2a81('0x20')],function(_0x523e04){return{'model':db[_0x523e04[_0x2a81('0x22')]],'as':_0x523e04['as'],'attributes':_0x523e04[_0x2a81('0x1e')],'include':_0x523e04[_0x2a81('0x20')]?_[_0x2a81('0x21')](_0x523e04['include'],function(_0x131482){return{'model':db[_0x131482[_0x2a81('0x22')]],'as':_0x131482['as'],'attributes':_0x131482[_0x2a81('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2a81('0x23')](function(_0x1348f9){logger[_0x2a81('0x25')]('ShowFreshdeskAccount',_0x4cb4df);logger[_0x2a81('0x10')](_0x2a81('0x26'),_0x4cb4df,JSON[_0x2a81('0x12')](_0x1348f9));_0xa03eb0(_0x1348f9);})[_0x2a81('0x17')](function(_0x3dd0cd){logger[_0x2a81('0x13')]('ShowFreshdeskAccount',_0x3dd0cd[_0x2a81('0x15')],_0x4cb4df);_0x19292a(_0x4f372c['error'](0x1f4,_0x3dd0cd['message']));});});};
\ No newline at end of file
index 362c56c..f31772d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x642a=['delete','destroy','multer','util','path','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getFields','getSubjects','getDescriptions','/:id/tags','post','setTags','put','update'];(function(_0x40c916,_0xfdad5c){var _0xefd6a=function(_0x410e5f){while(--_0x410e5f){_0x40c916['push'](_0x40c916['shift']());}};_0xefd6a(++_0xfdad5c);}(_0x642a,0x1d0));var _0xa642=function(_0x257b5f,_0x99b366){_0x257b5f=_0x257b5f-0x0;var _0x17e2e1=_0x642a[_0x257b5f];return _0x17e2e1;};'use strict';var multer=require(_0xa642('0x0'));var util=require(_0xa642('0x1'));var path=require(_0xa642('0x2'));var timeout=require('connect-timeout');var express=require(_0xa642('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa642('0x4'));var config=require(_0xa642('0x5'));var controller=require('./intFreshdeskConfiguration.controller');router[_0xa642('0x6')]('/',auth[_0xa642('0x7')](),controller[_0xa642('0x8')]);router[_0xa642('0x6')](_0xa642('0x9'),auth[_0xa642('0x7')](),controller[_0xa642('0xa')]);router[_0xa642('0x6')]('/:id/fields',auth['isAuthenticated'](),controller[_0xa642('0xb')]);router[_0xa642('0x6')]('/:id/subjects',auth[_0xa642('0x7')](),controller[_0xa642('0xc')]);router[_0xa642('0x6')]('/:id/descriptions',auth[_0xa642('0x7')](),controller[_0xa642('0xd')]);router['get'](_0xa642('0xe'),auth[_0xa642('0x7')](),controller['getTags']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xa642('0xf')](_0xa642('0xe'),auth[_0xa642('0x7')](),controller[_0xa642('0x10')]);router[_0xa642('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xa642('0x12')]);router[_0xa642('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xa642('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x5322=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','/:id/tags','post','create','setTags','put','update','delete','destroy','exports','multer','util','express'];(function(_0x4454d8,_0x3fa471){var _0x31b77c=function(_0x11778d){while(--_0x11778d){_0x4454d8['push'](_0x4454d8['shift']());}};_0x31b77c(++_0x3fa471);}(_0x5322,0x93));var _0x2532=function(_0x2085f3,_0x50105b){_0x2085f3=_0x2085f3-0x0;var _0x384e3c=_0x5322[_0x2085f3];return _0x384e3c;};'use strict';var multer=require(_0x2532('0x0'));var util=require(_0x2532('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2532('0x2'));var router=express[_0x2532('0x3')]();var fs_extra=require(_0x2532('0x4'));var auth=require(_0x2532('0x5'));var interaction=require(_0x2532('0x6'));var config=require('../../config/environment');var controller=require(_0x2532('0x7'));router[_0x2532('0x8')]('/',auth[_0x2532('0x9')](),controller['index']);router[_0x2532('0x8')](_0x2532('0xa'),auth[_0x2532('0x9')](),controller[_0x2532('0xb')]);router[_0x2532('0x8')](_0x2532('0xc'),auth[_0x2532('0x9')](),controller[_0x2532('0xd')]);router[_0x2532('0x8')](_0x2532('0xe'),auth['isAuthenticated'](),controller['getSubjects']);router['get'](_0x2532('0xf'),auth[_0x2532('0x9')](),controller['getDescriptions']);router[_0x2532('0x8')](_0x2532('0x10'),auth[_0x2532('0x9')](),controller['getTags']);router[_0x2532('0x11')]('/',auth[_0x2532('0x9')](),controller[_0x2532('0x12')]);router[_0x2532('0x11')](_0x2532('0x10'),auth['isAuthenticated'](),controller[_0x2532('0x13')]);router[_0x2532('0x14')](_0x2532('0xa'),auth[_0x2532('0x9')](),controller[_0x2532('0x15')]);router[_0x2532('0x16')]('/:id',auth[_0x2532('0x9')](),controller[_0x2532('0x17')]);module[_0x2532('0x18')]=router;
\ No newline at end of file
index 0d5da11..f8f1df0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc455=['STRING','sequelize'];(function(_0x5bc9d4,_0x6d6a47){var _0x6ef0ff=function(_0x39c79e){while(--_0x39c79e){_0x5bc9d4['push'](_0x5bc9d4['shift']());}};_0x6ef0ff(++_0x6d6a47);}(_0xc455,0x169));var _0x5c45=function(_0x3a63dd,_0x275e94){_0x3a63dd=_0x3a63dd-0x0;var _0x2a2d24=_0xc455[_0x3a63dd];return _0x2a2d24;};'use strict';var Sequelize=require(_0x5c45('0x0'));module['exports']={'name':{'type':Sequelize[_0x5c45('0x1')]},'description':{'type':Sequelize[_0x5c45('0x1')]}};
\ No newline at end of file
+var _0x74c5=['exports','sequelize'];(function(_0x3bd155,_0x4dcc6d){var _0x3fa222=function(_0x35d9c2){while(--_0x35d9c2){_0x3bd155['push'](_0x3bd155['shift']());}};_0x3fa222(++_0x4dcc6d);}(_0x74c5,0xed));var _0x574c=function(_0x5e9a69,_0x40c0ec){_0x5e9a69=_0x5e9a69-0x0;var _0x5979c8=_0x74c5[_0x5e9a69];return _0x5979c8;};'use strict';var Sequelize=require(_0x574c('0x0'));module[_0x574c('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 6b9505f..a554b89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1bf0=['params','keys','filters','options','find','create','body','getFields','FreshdeskField','sort','pick','hasOwnProperty','nolimit','getSubjects','findOne','getDescriptions','Tag','getTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','index','map','rawAttributes','model','query','intersection','attributes','fields','length','order','where','filter','merge','VIRTUAL','FreshdeskConfiguration','includeAll','include','findAll','rows','catch','show'];(function(_0x22d7f6,_0x4b2551){var _0x3e80c1=function(_0xdfeb80){while(--_0xdfeb80){_0x22d7f6['push'](_0x22d7f6['shift']());}};_0x3e80c1(++_0x4b2551);}(_0x1bf0,0x1b2));var _0x01bf=function(_0x5bed8d,_0x418dd7){_0x5bed8d=_0x5bed8d-0x0;var _0x310f6f=_0x1bf0[_0x5bed8d];return _0x310f6f;};'use strict';var emlformat=require(_0x01bf('0x0'));var rimraf=require(_0x01bf('0x1'));var zipdir=require(_0x01bf('0x2'));var jsonpatch=require(_0x01bf('0x3'));var rp=require(_0x01bf('0x4'));var moment=require(_0x01bf('0x5'));var BPromise=require(_0x01bf('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x01bf('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x01bf('0x8'));var fs=require('fs');var fs_extra=require(_0x01bf('0x9'));var _=require(_0x01bf('0xa'));var squel=require(_0x01bf('0xb'));var crypto=require(_0x01bf('0xc'));var jsforce=require(_0x01bf('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x01bf('0xe'));var querystring=require('querystring');var Papa=require(_0x01bf('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x01bf('0x10'));var as=require(_0x01bf('0x11'));var hardwareService=require(_0x01bf('0x12'));var logger=require(_0x01bf('0x13'))(_0x01bf('0x14'));var utils=require(_0x01bf('0x15'));var config=require(_0x01bf('0x16'));var licenseUtil=require(_0x01bf('0x17'));var db=require(_0x01bf('0x18'))['db'];function respondWithStatusCode(_0x212036,_0x2067bd){_0x2067bd=_0x2067bd||0xcc;return function(_0x52d2e9){if(_0x52d2e9){return _0x212036['sendStatus'](_0x2067bd);}return _0x212036[_0x01bf('0x19')](_0x2067bd)[_0x01bf('0x1a')]();};}function respondWithResult(_0x5e2ff7,_0xc516c6){_0xc516c6=_0xc516c6||0xc8;return function(_0xf61d97){if(_0xf61d97){return _0x5e2ff7[_0x01bf('0x19')](_0xc516c6)[_0x01bf('0x1b')](_0xf61d97);}};}function respondWithFilteredResult(_0x195d60,_0x495285){return function(_0x4ecf65){if(_0x4ecf65){var _0x2980ec=typeof _0x495285['offset']==='undefined'&&typeof _0x495285['limit']===_0x01bf('0x1c');var _0x2dfb55=_0x4ecf65['count'];var _0x301acd=_0x2980ec?0x0:_0x495285[_0x01bf('0x1d')];var _0x46b8db=_0x2980ec?_0x4ecf65[_0x01bf('0x1e')]:_0x495285[_0x01bf('0x1d')]+_0x495285[_0x01bf('0x1f')];var _0x554a84;if(_0x46b8db>=_0x2dfb55){_0x46b8db=_0x2dfb55;_0x554a84=0xc8;}else{_0x554a84=0xce;}_0x195d60['status'](_0x554a84);return _0x195d60[_0x01bf('0x20')](_0x01bf('0x21'),_0x301acd+'-'+_0x46b8db+'/'+_0x2dfb55)[_0x01bf('0x1b')](_0x4ecf65);}return null;};}function patchUpdates(_0x22e39b){return function(_0x771df9){try{jsonpatch[_0x01bf('0x22')](_0x771df9,_0x22e39b,!![]);}catch(_0x176dea){return BPromise[_0x01bf('0x23')](_0x176dea);}return _0x771df9[_0x01bf('0x24')]();};}function saveUpdates(_0x40139d,_0x1698f2){return function(_0x27b2ff){if(_0x27b2ff){return _0x27b2ff[_0x01bf('0x25')](_0x40139d)[_0x01bf('0x26')](function(_0x26011a){return _0x26011a;});}return null;};}function removeEntity(_0x5fbd4c,_0x2b1185){return function(_0x575a00){if(_0x575a00){return _0x575a00[_0x01bf('0x27')]()[_0x01bf('0x26')](function(){_0x5fbd4c[_0x01bf('0x19')](0xcc)[_0x01bf('0x1a')]();});}};}function handleEntityNotFound(_0x26da08,_0x2071fb){return function(_0x24c9ad){if(!_0x24c9ad){_0x26da08[_0x01bf('0x28')](0x194);}return _0x24c9ad;};}function handleError(_0xe930b1,_0x3f103d){_0x3f103d=_0x3f103d||0x1f4;return function(_0x28ae59){logger[_0x01bf('0x29')](_0x28ae59['stack']);if(_0x28ae59[_0x01bf('0x2a')]){delete _0x28ae59[_0x01bf('0x2a')];}_0xe930b1[_0x01bf('0x19')](_0x3f103d)['send'](_0x28ae59);};}exports[_0x01bf('0x2b')]=function(_0x5448bb,_0xe76510){var _0x5e3eda={},_0x4b732e={},_0x306dda={'count':0x0,'rows':[]};var _0x3c9d78=_[_0x01bf('0x2c')](db['FreshdeskConfiguration'][_0x01bf('0x2d')],function(_0x3412b5){return{'name':_0x3412b5['fieldName'],'type':_0x3412b5['type']['key']};});_0x4b732e[_0x01bf('0x2e')]=_['map'](_0x3c9d78,_0x01bf('0x2a'));_0x4b732e[_0x01bf('0x2f')]=_['keys'](_0x5448bb[_0x01bf('0x2f')]);_0x4b732e['filters']=_[_0x01bf('0x30')](_0x4b732e[_0x01bf('0x2e')],_0x4b732e[_0x01bf('0x2f')]);_0x5e3eda[_0x01bf('0x31')]=_[_0x01bf('0x30')](_0x4b732e[_0x01bf('0x2e')],qs[_0x01bf('0x32')](_0x5448bb[_0x01bf('0x2f')][_0x01bf('0x32')]));_0x5e3eda[_0x01bf('0x31')]=_0x5e3eda[_0x01bf('0x31')][_0x01bf('0x33')]?_0x5e3eda['attributes']:_0x4b732e[_0x01bf('0x2e')];if(!_0x5448bb[_0x01bf('0x2f')]['hasOwnProperty']('nolimit')){_0x5e3eda[_0x01bf('0x1f')]=qs['limit'](_0x5448bb[_0x01bf('0x2f')][_0x01bf('0x1f')]);_0x5e3eda[_0x01bf('0x1d')]=qs[_0x01bf('0x1d')](_0x5448bb['query'][_0x01bf('0x1d')]);}_0x5e3eda[_0x01bf('0x34')]=qs['sort'](_0x5448bb['query']['sort']);_0x5e3eda[_0x01bf('0x35')]=qs['filters'](_['pick'](_0x5448bb[_0x01bf('0x2f')],_0x4b732e['filters']),_0x3c9d78);if(_0x5448bb['query'][_0x01bf('0x36')]){_0x5e3eda[_0x01bf('0x35')]=_[_0x01bf('0x37')](_0x5e3eda[_0x01bf('0x35')],{'$or':_[_0x01bf('0x2c')](_0x3c9d78,function(_0x5724a9){if(_0x5724a9['type']!==_0x01bf('0x38')){var _0x3cc62a={};_0x3cc62a[_0x5724a9[_0x01bf('0x2a')]]={'$like':'%'+_0x5448bb[_0x01bf('0x2f')]['filter']+'%'};return _0x3cc62a;}})});}_0x5e3eda=_[_0x01bf('0x37')]({},_0x5e3eda,_0x5448bb['options']);var _0x2aee90={'where':_0x5e3eda[_0x01bf('0x35')]};return db[_0x01bf('0x39')][_0x01bf('0x1e')](_0x2aee90)[_0x01bf('0x26')](function(_0x368682){_0x306dda[_0x01bf('0x1e')]=_0x368682;if(_0x5448bb['query'][_0x01bf('0x3a')]){_0x5e3eda[_0x01bf('0x3b')]=[{'all':!![]}];}return db[_0x01bf('0x39')][_0x01bf('0x3c')](_0x5e3eda);})[_0x01bf('0x26')](function(_0x38df3a){_0x306dda[_0x01bf('0x3d')]=_0x38df3a;return _0x306dda;})['then'](respondWithFilteredResult(_0xe76510,_0x5e3eda))[_0x01bf('0x3e')](handleError(_0xe76510,null));};exports[_0x01bf('0x3f')]=function(_0x485efb,_0x28b461){var _0x1edc6f={'raw':![],'where':{'id':_0x485efb[_0x01bf('0x40')]['id']}},_0x302791={};_0x302791[_0x01bf('0x2e')]=_[_0x01bf('0x41')](db[_0x01bf('0x39')]['rawAttributes']);_0x302791['query']=_[_0x01bf('0x41')](_0x485efb['query']);_0x302791[_0x01bf('0x42')]=_[_0x01bf('0x30')](_0x302791[_0x01bf('0x2e')],_0x302791[_0x01bf('0x2f')]);_0x1edc6f[_0x01bf('0x31')]=_['intersection'](_0x302791['model'],qs['fields'](_0x485efb[_0x01bf('0x2f')][_0x01bf('0x32')]));_0x1edc6f[_0x01bf('0x31')]=_0x1edc6f[_0x01bf('0x31')][_0x01bf('0x33')]?_0x1edc6f[_0x01bf('0x31')]:_0x302791[_0x01bf('0x2e')];if(_0x485efb[_0x01bf('0x2f')]['includeAll']){_0x1edc6f['include']=[{'all':!![]}];}_0x1edc6f=_['merge']({},_0x1edc6f,_0x485efb[_0x01bf('0x43')]);return db[_0x01bf('0x39')][_0x01bf('0x44')](_0x1edc6f)[_0x01bf('0x26')](handleEntityNotFound(_0x28b461,null))[_0x01bf('0x26')](respondWithResult(_0x28b461,null))[_0x01bf('0x3e')](handleError(_0x28b461,null));};exports[_0x01bf('0x45')]=function(_0x2a16c6,_0x48a1bf){return db[_0x01bf('0x39')]['create'](_0x2a16c6[_0x01bf('0x46')],{})[_0x01bf('0x26')](respondWithResult(_0x48a1bf,0xc9))[_0x01bf('0x3e')](handleError(_0x48a1bf,null));};exports[_0x01bf('0x25')]=function(_0x198633,_0x59c4c4){if(_0x198633[_0x01bf('0x46')]['id']){delete _0x198633[_0x01bf('0x46')]['id'];}return db[_0x01bf('0x39')]['find']({'where':{'id':_0x198633[_0x01bf('0x40')]['id']}})['then'](handleEntityNotFound(_0x59c4c4,null))[_0x01bf('0x26')](saveUpdates(_0x198633['body'],null))['then'](respondWithResult(_0x59c4c4,null))[_0x01bf('0x3e')](handleError(_0x59c4c4,null));};exports[_0x01bf('0x27')]=function(_0x222d35,_0x341580){return db[_0x01bf('0x39')]['find']({'where':{'id':_0x222d35[_0x01bf('0x40')]['id']}})[_0x01bf('0x26')](handleEntityNotFound(_0x341580,null))[_0x01bf('0x26')](removeEntity(_0x341580,null))[_0x01bf('0x3e')](handleError(_0x341580,null));};exports[_0x01bf('0x47')]=function(_0x293cb6,_0x474714,_0x5f124a){var _0x52fc6e={};var _0x21a1a2={};var _0x2739d1;var _0x3a8d98;return db[_0x01bf('0x39')]['findOne']({'where':{'id':_0x293cb6['params']['id']}})[_0x01bf('0x26')](handleEntityNotFound(_0x474714,null))[_0x01bf('0x26')](function(_0x49f2e2){if(_0x49f2e2){_0x2739d1=_0x49f2e2;_0x21a1a2[_0x01bf('0x2e')]=_[_0x01bf('0x41')](db[_0x01bf('0x48')][_0x01bf('0x2d')]);_0x21a1a2[_0x01bf('0x2f')]=_[_0x01bf('0x41')](_0x293cb6['query']);_0x21a1a2[_0x01bf('0x42')]=_['intersection'](_0x21a1a2[_0x01bf('0x2e')],_0x21a1a2[_0x01bf('0x2f')]);_0x52fc6e[_0x01bf('0x31')]=_[_0x01bf('0x30')](_0x21a1a2[_0x01bf('0x2e')],qs[_0x01bf('0x32')](_0x293cb6[_0x01bf('0x2f')][_0x01bf('0x32')]));_0x52fc6e['attributes']=_0x52fc6e[_0x01bf('0x31')][_0x01bf('0x33')]?_0x52fc6e[_0x01bf('0x31')]:_0x21a1a2[_0x01bf('0x2e')];_0x52fc6e[_0x01bf('0x34')]=qs[_0x01bf('0x49')](_0x293cb6[_0x01bf('0x2f')]['sort']);_0x52fc6e[_0x01bf('0x35')]=qs[_0x01bf('0x42')](_[_0x01bf('0x4a')](_0x293cb6[_0x01bf('0x2f')],_0x21a1a2[_0x01bf('0x42')]));if(_0x293cb6[_0x01bf('0x2f')][_0x01bf('0x36')]){_0x52fc6e[_0x01bf('0x35')]=_[_0x01bf('0x37')](_0x52fc6e[_0x01bf('0x35')],{'$or':_[_0x01bf('0x2c')](_0x52fc6e['attributes'],function(_0x5335ec){var _0x1f0809={};_0x1f0809[_0x5335ec]={'$like':'%'+_0x293cb6[_0x01bf('0x2f')]['filter']+'%'};return _0x1f0809;})});}_0x52fc6e=_[_0x01bf('0x37')]({},_0x52fc6e,_0x293cb6['options']);return _0x2739d1[_0x01bf('0x47')](_0x52fc6e);}})[_0x01bf('0x26')](function(_0x2ef91e){if(_0x2ef91e){_0x3a8d98=_0x2ef91e[_0x01bf('0x33')];if(!_0x293cb6['query'][_0x01bf('0x4b')](_0x01bf('0x4c'))){_0x52fc6e['limit']=qs['limit'](_0x293cb6['query'][_0x01bf('0x1f')]);_0x52fc6e['offset']=qs[_0x01bf('0x1d')](_0x293cb6[_0x01bf('0x2f')][_0x01bf('0x1d')]);}return _0x2739d1[_0x01bf('0x47')](_0x52fc6e);}})['then'](function(_0xbdaadf){if(_0xbdaadf){return _0xbdaadf?{'count':_0x3a8d98,'rows':_0xbdaadf}:null;}})[_0x01bf('0x26')](respondWithResult(_0x474714,null))['catch'](handleError(_0x474714,null));};exports[_0x01bf('0x4d')]=function(_0x1c518a,_0x2a758b,_0x37e2ab){var _0x1ff47e={};var _0x998aa0={};var _0x322c6e;var _0x37a849;return db[_0x01bf('0x39')][_0x01bf('0x4e')]({'where':{'id':_0x1c518a[_0x01bf('0x40')]['id']}})['then'](handleEntityNotFound(_0x2a758b,null))['then'](function(_0x2f592f){if(_0x2f592f){_0x322c6e=_0x2f592f;_0x998aa0[_0x01bf('0x2e')]=_[_0x01bf('0x41')](db[_0x01bf('0x48')][_0x01bf('0x2d')]);_0x998aa0[_0x01bf('0x2f')]=_[_0x01bf('0x41')](_0x1c518a[_0x01bf('0x2f')]);_0x998aa0[_0x01bf('0x42')]=_['intersection'](_0x998aa0[_0x01bf('0x2e')],_0x998aa0[_0x01bf('0x2f')]);_0x1ff47e[_0x01bf('0x31')]=_[_0x01bf('0x30')](_0x998aa0[_0x01bf('0x2e')],qs[_0x01bf('0x32')](_0x1c518a[_0x01bf('0x2f')][_0x01bf('0x32')]));_0x1ff47e[_0x01bf('0x31')]=_0x1ff47e[_0x01bf('0x31')][_0x01bf('0x33')]?_0x1ff47e[_0x01bf('0x31')]:_0x998aa0[_0x01bf('0x2e')];_0x1ff47e[_0x01bf('0x34')]=qs[_0x01bf('0x49')](_0x1c518a[_0x01bf('0x2f')][_0x01bf('0x49')]);_0x1ff47e['where']=qs['filters'](_[_0x01bf('0x4a')](_0x1c518a[_0x01bf('0x2f')],_0x998aa0[_0x01bf('0x42')]));if(_0x1c518a[_0x01bf('0x2f')][_0x01bf('0x36')]){_0x1ff47e['where']=_[_0x01bf('0x37')](_0x1ff47e['where'],{'$or':_[_0x01bf('0x2c')](_0x1ff47e[_0x01bf('0x31')],function(_0x50d480){var _0x2c8a1b={};_0x2c8a1b[_0x50d480]={'$like':'%'+_0x1c518a[_0x01bf('0x2f')]['filter']+'%'};return _0x2c8a1b;})});}_0x1ff47e=_[_0x01bf('0x37')]({},_0x1ff47e,_0x1c518a[_0x01bf('0x43')]);return _0x322c6e[_0x01bf('0x4d')](_0x1ff47e);}})[_0x01bf('0x26')](function(_0x29359c){if(_0x29359c){_0x37a849=_0x29359c[_0x01bf('0x33')];if(!_0x1c518a[_0x01bf('0x2f')]['hasOwnProperty'](_0x01bf('0x4c'))){_0x1ff47e['limit']=qs[_0x01bf('0x1f')](_0x1c518a['query'][_0x01bf('0x1f')]);_0x1ff47e[_0x01bf('0x1d')]=qs['offset'](_0x1c518a[_0x01bf('0x2f')]['offset']);}return _0x322c6e[_0x01bf('0x4d')](_0x1ff47e);}})['then'](function(_0x5c1b1d){if(_0x5c1b1d){return _0x5c1b1d?{'count':_0x37a849,'rows':_0x5c1b1d}:null;}})[_0x01bf('0x26')](respondWithResult(_0x2a758b,null))[_0x01bf('0x3e')](handleError(_0x2a758b,null));};exports['getDescriptions']=function(_0x145698,_0x2059b6,_0x545378){var _0x4bba5e={};var _0x2ce4e2={};var _0x4fafef;var _0x34c8f6;return db['FreshdeskConfiguration'][_0x01bf('0x4e')]({'where':{'id':_0x145698['params']['id']}})['then'](handleEntityNotFound(_0x2059b6,null))[_0x01bf('0x26')](function(_0x37ec9e){if(_0x37ec9e){_0x4fafef=_0x37ec9e;_0x2ce4e2['model']=_[_0x01bf('0x41')](db[_0x01bf('0x48')]['rawAttributes']);_0x2ce4e2[_0x01bf('0x2f')]=_[_0x01bf('0x41')](_0x145698[_0x01bf('0x2f')]);_0x2ce4e2[_0x01bf('0x42')]=_['intersection'](_0x2ce4e2[_0x01bf('0x2e')],_0x2ce4e2[_0x01bf('0x2f')]);_0x4bba5e['attributes']=_[_0x01bf('0x30')](_0x2ce4e2[_0x01bf('0x2e')],qs[_0x01bf('0x32')](_0x145698[_0x01bf('0x2f')]['fields']));_0x4bba5e['attributes']=_0x4bba5e[_0x01bf('0x31')][_0x01bf('0x33')]?_0x4bba5e[_0x01bf('0x31')]:_0x2ce4e2['model'];_0x4bba5e[_0x01bf('0x34')]=qs[_0x01bf('0x49')](_0x145698[_0x01bf('0x2f')][_0x01bf('0x49')]);_0x4bba5e['where']=qs[_0x01bf('0x42')](_['pick'](_0x145698[_0x01bf('0x2f')],_0x2ce4e2[_0x01bf('0x42')]));if(_0x145698[_0x01bf('0x2f')]['filter']){_0x4bba5e['where']=_[_0x01bf('0x37')](_0x4bba5e['where'],{'$or':_['map'](_0x4bba5e[_0x01bf('0x31')],function(_0x23a5b0){var _0x50bb44={};_0x50bb44[_0x23a5b0]={'$like':'%'+_0x145698['query'][_0x01bf('0x36')]+'%'};return _0x50bb44;})});}_0x4bba5e=_[_0x01bf('0x37')]({},_0x4bba5e,_0x145698[_0x01bf('0x43')]);return _0x4fafef[_0x01bf('0x4f')](_0x4bba5e);}})[_0x01bf('0x26')](function(_0x459cc1){if(_0x459cc1){_0x34c8f6=_0x459cc1['length'];if(!_0x145698[_0x01bf('0x2f')][_0x01bf('0x4b')](_0x01bf('0x4c'))){_0x4bba5e['limit']=qs['limit'](_0x145698[_0x01bf('0x2f')][_0x01bf('0x1f')]);_0x4bba5e[_0x01bf('0x1d')]=qs[_0x01bf('0x1d')](_0x145698['query'][_0x01bf('0x1d')]);}return _0x4fafef['getDescriptions'](_0x4bba5e);}})[_0x01bf('0x26')](function(_0x27fb77){if(_0x27fb77){return _0x27fb77?{'count':_0x34c8f6,'rows':_0x27fb77}:null;}})[_0x01bf('0x26')](respondWithResult(_0x2059b6,null))[_0x01bf('0x3e')](handleError(_0x2059b6,null));};exports['getTags']=function(_0x5b2f09,_0x11f414,_0x2dc830){var _0x1c8698={};var _0x17d5ab={};var _0x241eef;var _0x58a398;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x5b2f09[_0x01bf('0x40')]['id']}})[_0x01bf('0x26')](handleEntityNotFound(_0x11f414,null))[_0x01bf('0x26')](function(_0xb941be){if(_0xb941be){_0x241eef=_0xb941be;_0x17d5ab[_0x01bf('0x2e')]=_[_0x01bf('0x41')](db[_0x01bf('0x50')][_0x01bf('0x2d')]);_0x17d5ab[_0x01bf('0x2f')]=_[_0x01bf('0x41')](_0x5b2f09[_0x01bf('0x2f')]);_0x17d5ab['filters']=_[_0x01bf('0x30')](_0x17d5ab[_0x01bf('0x2e')],_0x17d5ab['query']);_0x1c8698[_0x01bf('0x31')]=_['intersection'](_0x17d5ab['model'],qs[_0x01bf('0x32')](_0x5b2f09[_0x01bf('0x2f')][_0x01bf('0x32')]));_0x1c8698[_0x01bf('0x31')]=_0x1c8698[_0x01bf('0x31')][_0x01bf('0x33')]?_0x1c8698[_0x01bf('0x31')]:_0x17d5ab['model'];_0x1c8698[_0x01bf('0x34')]=qs['sort'](_0x5b2f09['query'][_0x01bf('0x49')]);_0x1c8698[_0x01bf('0x35')]=qs[_0x01bf('0x42')](_[_0x01bf('0x4a')](_0x5b2f09[_0x01bf('0x2f')],_0x17d5ab['filters']));if(_0x5b2f09['query'][_0x01bf('0x36')]){_0x1c8698[_0x01bf('0x35')]=_[_0x01bf('0x37')](_0x1c8698[_0x01bf('0x35')],{'$or':_[_0x01bf('0x2c')](_0x1c8698['attributes'],function(_0x224c9e){var _0x39c9e7={};_0x39c9e7[_0x224c9e]={'$like':'%'+_0x5b2f09[_0x01bf('0x2f')][_0x01bf('0x36')]+'%'};return _0x39c9e7;})});}_0x1c8698=_['merge']({},_0x1c8698,_0x5b2f09[_0x01bf('0x43')]);return _0x241eef[_0x01bf('0x51')](_0x1c8698);}})[_0x01bf('0x26')](function(_0x3c57ba){if(_0x3c57ba){_0x58a398=_0x3c57ba[_0x01bf('0x33')];if(!_0x5b2f09['query'][_0x01bf('0x4b')]('nolimit')){_0x1c8698[_0x01bf('0x1f')]=qs[_0x01bf('0x1f')](_0x5b2f09[_0x01bf('0x2f')][_0x01bf('0x1f')]);_0x1c8698[_0x01bf('0x1d')]=qs['offset'](_0x5b2f09[_0x01bf('0x2f')][_0x01bf('0x1d')]);}return _0x241eef[_0x01bf('0x51')](_0x1c8698);}})[_0x01bf('0x26')](function(_0x55a3c3){if(_0x55a3c3){return _0x55a3c3?{'count':_0x58a398,'rows':_0x55a3c3}:null;}})[_0x01bf('0x26')](respondWithResult(_0x11f414,null))[_0x01bf('0x3e')](handleError(_0x11f414,null));};exports['setTags']=function(_0x43c7d3,_0x52bb11,_0x332e1f){if(_0x43c7d3['body']['id']){delete _0x43c7d3[_0x01bf('0x46')]['id'];}return db[_0x01bf('0x39')][_0x01bf('0x4e')]({'where':{'id':_0x43c7d3[_0x01bf('0x40')]['id']}})[_0x01bf('0x26')](handleEntityNotFound(_0x52bb11,null))['then'](function(_0x5b3e55){if(_0x5b3e55){return _0x5b3e55['setTags'](_0x43c7d3[_0x01bf('0x46')][_0x01bf('0x52')]||[]);}return null;})[_0x01bf('0x26')](respondWithResult(_0x52bb11,null))['catch'](handleError(_0x52bb11,null));};
\ No newline at end of file
+var _0x8088=['where','pick','filter','merge','VIRTUAL','options','include','findAll','then','catch','show','keys','rawAttributes','length','find','create','body','params','getFields','findOne','FreshdeskField','nolimit','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','moment','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','end','status','json','offset','limit','undefined','count','set','save','destroy','sendStatus','error','stack','name','send','map','FreshdeskConfiguration','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort'];(function(_0x1a52eb,_0x487e0a){var _0x7d91b8=function(_0x1b647e){while(--_0x1b647e){_0x1a52eb['push'](_0x1a52eb['shift']());}};_0x7d91b8(++_0x487e0a);}(_0x8088,0x1ea));var _0x8808=function(_0x53dabd,_0x30a157){_0x53dabd=_0x53dabd-0x0;var _0x36983b=_0x8088[_0x53dabd];return _0x36983b;};'use strict';var emlformat=require(_0x8808('0x0'));var rimraf=require(_0x8808('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8808('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x8808('0x3'));var sox=require(_0x8808('0x4'));var csv=require('to-csv');var ejs=require(_0x8808('0x5'));var fs=require('fs');var fs_extra=require(_0x8808('0x6'));var _=require('lodash');var squel=require(_0x8808('0x7'));var crypto=require(_0x8808('0x8'));var jsforce=require(_0x8808('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x8808('0xa'));var querystring=require(_0x8808('0xb'));var Papa=require(_0x8808('0xc'));var Redis=require(_0x8808('0xd'));var authService=require(_0x8808('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x8808('0xf'));var hardwareService=require(_0x8808('0x10'));var logger=require(_0x8808('0x11'))(_0x8808('0x12'));var utils=require('../../config/utils');var config=require(_0x8808('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x8808('0x14'))['db'];function respondWithStatusCode(_0x5f2137,_0x1c8d19){_0x1c8d19=_0x1c8d19||0xcc;return function(_0x4ec84f){if(_0x4ec84f){return _0x5f2137['sendStatus'](_0x1c8d19);}return _0x5f2137['status'](_0x1c8d19)[_0x8808('0x15')]();};}function respondWithResult(_0x5b6c6e,_0x538eee){_0x538eee=_0x538eee||0xc8;return function(_0x5944c4){if(_0x5944c4){return _0x5b6c6e[_0x8808('0x16')](_0x538eee)[_0x8808('0x17')](_0x5944c4);}};}function respondWithFilteredResult(_0x2111d2,_0x2aa73d){return function(_0x4eb998){if(_0x4eb998){var _0x133af0=typeof _0x2aa73d[_0x8808('0x18')]==='undefined'&&typeof _0x2aa73d[_0x8808('0x19')]===_0x8808('0x1a');var _0x5195ba=_0x4eb998[_0x8808('0x1b')];var _0x4d2b51=_0x133af0?0x0:_0x2aa73d[_0x8808('0x18')];var _0x3f1a6d=_0x133af0?_0x4eb998[_0x8808('0x1b')]:_0x2aa73d[_0x8808('0x18')]+_0x2aa73d[_0x8808('0x19')];var _0x5ce938;if(_0x3f1a6d>=_0x5195ba){_0x3f1a6d=_0x5195ba;_0x5ce938=0xc8;}else{_0x5ce938=0xce;}_0x2111d2[_0x8808('0x16')](_0x5ce938);return _0x2111d2[_0x8808('0x1c')]('Content-Range',_0x4d2b51+'-'+_0x3f1a6d+'/'+_0x5195ba)[_0x8808('0x17')](_0x4eb998);}return null;};}function patchUpdates(_0x163cf8){return function(_0x37f1f7){try{jsonpatch['apply'](_0x37f1f7,_0x163cf8,!![]);}catch(_0xddec1f){return BPromise['reject'](_0xddec1f);}return _0x37f1f7[_0x8808('0x1d')]();};}function saveUpdates(_0x5f6d16,_0x49bfa3){return function(_0x1926b1){if(_0x1926b1){return _0x1926b1['update'](_0x5f6d16)['then'](function(_0x459c39){return _0x459c39;});}return null;};}function removeEntity(_0x1608f9,_0x307f6f){return function(_0x4f5254){if(_0x4f5254){return _0x4f5254[_0x8808('0x1e')]()['then'](function(){_0x1608f9[_0x8808('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27aa4e,_0x52202e){return function(_0xcf21d3){if(!_0xcf21d3){_0x27aa4e[_0x8808('0x1f')](0x194);}return _0xcf21d3;};}function handleError(_0x4d7cef,_0x437c57){_0x437c57=_0x437c57||0x1f4;return function(_0x164f4f){logger[_0x8808('0x20')](_0x164f4f[_0x8808('0x21')]);if(_0x164f4f[_0x8808('0x22')]){delete _0x164f4f[_0x8808('0x22')];}_0x4d7cef[_0x8808('0x16')](_0x437c57)[_0x8808('0x23')](_0x164f4f);};}exports['index']=function(_0x69709f,_0x4c8df6){var _0x152f71={},_0x2b76c2={},_0x1f3a13={'count':0x0,'rows':[]};var _0x3dbdc8=_[_0x8808('0x24')](db[_0x8808('0x25')]['rawAttributes'],function(_0x589d5d){return{'name':_0x589d5d[_0x8808('0x26')],'type':_0x589d5d[_0x8808('0x27')]['key']};});_0x2b76c2[_0x8808('0x28')]=_[_0x8808('0x24')](_0x3dbdc8,'name');_0x2b76c2[_0x8808('0x29')]=_['keys'](_0x69709f[_0x8808('0x29')]);_0x2b76c2[_0x8808('0x2a')]=_[_0x8808('0x2b')](_0x2b76c2[_0x8808('0x28')],_0x2b76c2[_0x8808('0x29')]);_0x152f71[_0x8808('0x2c')]=_['intersection'](_0x2b76c2[_0x8808('0x28')],qs[_0x8808('0x2d')](_0x69709f[_0x8808('0x29')][_0x8808('0x2d')]));_0x152f71['attributes']=_0x152f71[_0x8808('0x2c')]['length']?_0x152f71[_0x8808('0x2c')]:_0x2b76c2['model'];if(!_0x69709f[_0x8808('0x29')][_0x8808('0x2e')]('nolimit')){_0x152f71[_0x8808('0x19')]=qs['limit'](_0x69709f['query']['limit']);_0x152f71[_0x8808('0x18')]=qs[_0x8808('0x18')](_0x69709f[_0x8808('0x29')][_0x8808('0x18')]);}_0x152f71[_0x8808('0x2f')]=qs['sort'](_0x69709f[_0x8808('0x29')][_0x8808('0x30')]);_0x152f71[_0x8808('0x31')]=qs[_0x8808('0x2a')](_[_0x8808('0x32')](_0x69709f[_0x8808('0x29')],_0x2b76c2[_0x8808('0x2a')]),_0x3dbdc8);if(_0x69709f[_0x8808('0x29')][_0x8808('0x33')]){_0x152f71[_0x8808('0x31')]=_[_0x8808('0x34')](_0x152f71[_0x8808('0x31')],{'$or':_['map'](_0x3dbdc8,function(_0x550942){if(_0x550942[_0x8808('0x27')]!==_0x8808('0x35')){var _0x17d6ad={};_0x17d6ad[_0x550942[_0x8808('0x22')]]={'$like':'%'+_0x69709f[_0x8808('0x29')][_0x8808('0x33')]+'%'};return _0x17d6ad;}})});}_0x152f71=_['merge']({},_0x152f71,_0x69709f[_0x8808('0x36')]);var _0xce7f08={'where':_0x152f71['where']};return db[_0x8808('0x25')][_0x8808('0x1b')](_0xce7f08)['then'](function(_0x2f31cf){_0x1f3a13[_0x8808('0x1b')]=_0x2f31cf;if(_0x69709f[_0x8808('0x29')]['includeAll']){_0x152f71[_0x8808('0x37')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x8808('0x38')](_0x152f71);})[_0x8808('0x39')](function(_0x204d0a){_0x1f3a13['rows']=_0x204d0a;return _0x1f3a13;})['then'](respondWithFilteredResult(_0x4c8df6,_0x152f71))[_0x8808('0x3a')](handleError(_0x4c8df6,null));};exports[_0x8808('0x3b')]=function(_0x285271,_0x5e433c){var _0x24e9a6={'raw':![],'where':{'id':_0x285271['params']['id']}},_0x5a6fae={};_0x5a6fae['model']=_[_0x8808('0x3c')](db['FreshdeskConfiguration'][_0x8808('0x3d')]);_0x5a6fae[_0x8808('0x29')]=_[_0x8808('0x3c')](_0x285271[_0x8808('0x29')]);_0x5a6fae[_0x8808('0x2a')]=_[_0x8808('0x2b')](_0x5a6fae[_0x8808('0x28')],_0x5a6fae['query']);_0x24e9a6['attributes']=_['intersection'](_0x5a6fae[_0x8808('0x28')],qs[_0x8808('0x2d')](_0x285271['query'][_0x8808('0x2d')]));_0x24e9a6['attributes']=_0x24e9a6[_0x8808('0x2c')][_0x8808('0x3e')]?_0x24e9a6[_0x8808('0x2c')]:_0x5a6fae['model'];if(_0x285271[_0x8808('0x29')]['includeAll']){_0x24e9a6[_0x8808('0x37')]=[{'all':!![]}];}_0x24e9a6=_[_0x8808('0x34')]({},_0x24e9a6,_0x285271['options']);return db['FreshdeskConfiguration'][_0x8808('0x3f')](_0x24e9a6)[_0x8808('0x39')](handleEntityNotFound(_0x5e433c,null))[_0x8808('0x39')](respondWithResult(_0x5e433c,null))[_0x8808('0x3a')](handleError(_0x5e433c,null));};exports[_0x8808('0x40')]=function(_0xd81c69,_0x248035){return db[_0x8808('0x25')][_0x8808('0x40')](_0xd81c69['body'],{})[_0x8808('0x39')](respondWithResult(_0x248035,0xc9))[_0x8808('0x3a')](handleError(_0x248035,null));};exports['update']=function(_0x31d146,_0xdaaa0e){if(_0x31d146[_0x8808('0x41')]['id']){delete _0x31d146[_0x8808('0x41')]['id'];}return db[_0x8808('0x25')][_0x8808('0x3f')]({'where':{'id':_0x31d146[_0x8808('0x42')]['id']}})['then'](handleEntityNotFound(_0xdaaa0e,null))[_0x8808('0x39')](saveUpdates(_0x31d146['body'],null))[_0x8808('0x39')](respondWithResult(_0xdaaa0e,null))[_0x8808('0x3a')](handleError(_0xdaaa0e,null));};exports[_0x8808('0x1e')]=function(_0x2fb958,_0x343ccc){return db[_0x8808('0x25')][_0x8808('0x3f')]({'where':{'id':_0x2fb958[_0x8808('0x42')]['id']}})[_0x8808('0x39')](handleEntityNotFound(_0x343ccc,null))[_0x8808('0x39')](removeEntity(_0x343ccc,null))['catch'](handleError(_0x343ccc,null));};exports[_0x8808('0x43')]=function(_0xe56f01,_0x132d42,_0x1da436){var _0x7a3989={};var _0x18465c={};var _0xdba8e9;var _0x4ccafa;return db[_0x8808('0x25')][_0x8808('0x44')]({'where':{'id':_0xe56f01[_0x8808('0x42')]['id']}})['then'](handleEntityNotFound(_0x132d42,null))['then'](function(_0xe7d498){if(_0xe7d498){_0xdba8e9=_0xe7d498;_0x18465c[_0x8808('0x28')]=_[_0x8808('0x3c')](db[_0x8808('0x45')][_0x8808('0x3d')]);_0x18465c[_0x8808('0x29')]=_[_0x8808('0x3c')](_0xe56f01['query']);_0x18465c[_0x8808('0x2a')]=_[_0x8808('0x2b')](_0x18465c[_0x8808('0x28')],_0x18465c[_0x8808('0x29')]);_0x7a3989[_0x8808('0x2c')]=_[_0x8808('0x2b')](_0x18465c[_0x8808('0x28')],qs[_0x8808('0x2d')](_0xe56f01[_0x8808('0x29')][_0x8808('0x2d')]));_0x7a3989['attributes']=_0x7a3989[_0x8808('0x2c')]['length']?_0x7a3989['attributes']:_0x18465c[_0x8808('0x28')];_0x7a3989['order']=qs[_0x8808('0x30')](_0xe56f01[_0x8808('0x29')]['sort']);_0x7a3989['where']=qs['filters'](_[_0x8808('0x32')](_0xe56f01[_0x8808('0x29')],_0x18465c[_0x8808('0x2a')]));if(_0xe56f01['query']['filter']){_0x7a3989[_0x8808('0x31')]=_['merge'](_0x7a3989[_0x8808('0x31')],{'$or':_[_0x8808('0x24')](_0x7a3989[_0x8808('0x2c')],function(_0x16abc7){var _0x4360a1={};_0x4360a1[_0x16abc7]={'$like':'%'+_0xe56f01[_0x8808('0x29')][_0x8808('0x33')]+'%'};return _0x4360a1;})});}_0x7a3989=_[_0x8808('0x34')]({},_0x7a3989,_0xe56f01['options']);return _0xdba8e9[_0x8808('0x43')](_0x7a3989);}})[_0x8808('0x39')](function(_0x40ba77){if(_0x40ba77){_0x4ccafa=_0x40ba77[_0x8808('0x3e')];if(!_0xe56f01['query'][_0x8808('0x2e')](_0x8808('0x46'))){_0x7a3989[_0x8808('0x19')]=qs[_0x8808('0x19')](_0xe56f01[_0x8808('0x29')][_0x8808('0x19')]);_0x7a3989[_0x8808('0x18')]=qs['offset'](_0xe56f01[_0x8808('0x29')]['offset']);}return _0xdba8e9['getFields'](_0x7a3989);}})['then'](function(_0x31a887){if(_0x31a887){return _0x31a887?{'count':_0x4ccafa,'rows':_0x31a887}:null;}})['then'](respondWithResult(_0x132d42,null))['catch'](handleError(_0x132d42,null));};exports[_0x8808('0x47')]=function(_0x26e220,_0xb74dd0,_0x4e9045){var _0x52d61a={};var _0x8457fd={};var _0x252e37;var _0x136501;return db[_0x8808('0x25')][_0x8808('0x44')]({'where':{'id':_0x26e220[_0x8808('0x42')]['id']}})[_0x8808('0x39')](handleEntityNotFound(_0xb74dd0,null))[_0x8808('0x39')](function(_0x39f6b1){if(_0x39f6b1){_0x252e37=_0x39f6b1;_0x8457fd[_0x8808('0x28')]=_[_0x8808('0x3c')](db[_0x8808('0x45')][_0x8808('0x3d')]);_0x8457fd[_0x8808('0x29')]=_['keys'](_0x26e220[_0x8808('0x29')]);_0x8457fd[_0x8808('0x2a')]=_[_0x8808('0x2b')](_0x8457fd[_0x8808('0x28')],_0x8457fd[_0x8808('0x29')]);_0x52d61a[_0x8808('0x2c')]=_[_0x8808('0x2b')](_0x8457fd[_0x8808('0x28')],qs[_0x8808('0x2d')](_0x26e220[_0x8808('0x29')][_0x8808('0x2d')]));_0x52d61a[_0x8808('0x2c')]=_0x52d61a[_0x8808('0x2c')]['length']?_0x52d61a[_0x8808('0x2c')]:_0x8457fd[_0x8808('0x28')];_0x52d61a[_0x8808('0x2f')]=qs[_0x8808('0x30')](_0x26e220['query'][_0x8808('0x30')]);_0x52d61a[_0x8808('0x31')]=qs['filters'](_[_0x8808('0x32')](_0x26e220[_0x8808('0x29')],_0x8457fd['filters']));if(_0x26e220[_0x8808('0x29')]['filter']){_0x52d61a[_0x8808('0x31')]=_[_0x8808('0x34')](_0x52d61a[_0x8808('0x31')],{'$or':_['map'](_0x52d61a[_0x8808('0x2c')],function(_0x12b76c){var _0x467502={};_0x467502[_0x12b76c]={'$like':'%'+_0x26e220['query'][_0x8808('0x33')]+'%'};return _0x467502;})});}_0x52d61a=_['merge']({},_0x52d61a,_0x26e220[_0x8808('0x36')]);return _0x252e37[_0x8808('0x47')](_0x52d61a);}})[_0x8808('0x39')](function(_0x4bd398){if(_0x4bd398){_0x136501=_0x4bd398['length'];if(!_0x26e220['query'][_0x8808('0x2e')]('nolimit')){_0x52d61a[_0x8808('0x19')]=qs[_0x8808('0x19')](_0x26e220[_0x8808('0x29')][_0x8808('0x19')]);_0x52d61a[_0x8808('0x18')]=qs['offset'](_0x26e220[_0x8808('0x29')][_0x8808('0x18')]);}return _0x252e37['getSubjects'](_0x52d61a);}})[_0x8808('0x39')](function(_0x2fe850){if(_0x2fe850){return _0x2fe850?{'count':_0x136501,'rows':_0x2fe850}:null;}})[_0x8808('0x39')](respondWithResult(_0xb74dd0,null))['catch'](handleError(_0xb74dd0,null));};exports[_0x8808('0x48')]=function(_0x4de973,_0x1edb74,_0x5eeffe){var _0x3a9003={};var _0x181a8c={};var _0x3506ba;var _0x48e4c3;return db[_0x8808('0x25')][_0x8808('0x44')]({'where':{'id':_0x4de973[_0x8808('0x42')]['id']}})[_0x8808('0x39')](handleEntityNotFound(_0x1edb74,null))[_0x8808('0x39')](function(_0x45088f){if(_0x45088f){_0x3506ba=_0x45088f;_0x181a8c[_0x8808('0x28')]=_[_0x8808('0x3c')](db[_0x8808('0x45')]['rawAttributes']);_0x181a8c['query']=_[_0x8808('0x3c')](_0x4de973['query']);_0x181a8c[_0x8808('0x2a')]=_[_0x8808('0x2b')](_0x181a8c[_0x8808('0x28')],_0x181a8c[_0x8808('0x29')]);_0x3a9003['attributes']=_[_0x8808('0x2b')](_0x181a8c[_0x8808('0x28')],qs['fields'](_0x4de973[_0x8808('0x29')][_0x8808('0x2d')]));_0x3a9003[_0x8808('0x2c')]=_0x3a9003[_0x8808('0x2c')]['length']?_0x3a9003['attributes']:_0x181a8c[_0x8808('0x28')];_0x3a9003[_0x8808('0x2f')]=qs[_0x8808('0x30')](_0x4de973[_0x8808('0x29')][_0x8808('0x30')]);_0x3a9003['where']=qs[_0x8808('0x2a')](_[_0x8808('0x32')](_0x4de973[_0x8808('0x29')],_0x181a8c[_0x8808('0x2a')]));if(_0x4de973[_0x8808('0x29')][_0x8808('0x33')]){_0x3a9003['where']=_[_0x8808('0x34')](_0x3a9003['where'],{'$or':_[_0x8808('0x24')](_0x3a9003[_0x8808('0x2c')],function(_0x1adcb8){var _0x3210bd={};_0x3210bd[_0x1adcb8]={'$like':'%'+_0x4de973['query'][_0x8808('0x33')]+'%'};return _0x3210bd;})});}_0x3a9003=_[_0x8808('0x34')]({},_0x3a9003,_0x4de973[_0x8808('0x36')]);return _0x3506ba[_0x8808('0x48')](_0x3a9003);}})['then'](function(_0x86a172){if(_0x86a172){_0x48e4c3=_0x86a172[_0x8808('0x3e')];if(!_0x4de973[_0x8808('0x29')][_0x8808('0x2e')](_0x8808('0x46'))){_0x3a9003['limit']=qs[_0x8808('0x19')](_0x4de973[_0x8808('0x29')]['limit']);_0x3a9003[_0x8808('0x18')]=qs[_0x8808('0x18')](_0x4de973['query'][_0x8808('0x18')]);}return _0x3506ba[_0x8808('0x48')](_0x3a9003);}})[_0x8808('0x39')](function(_0x15020a){if(_0x15020a){return _0x15020a?{'count':_0x48e4c3,'rows':_0x15020a}:null;}})['then'](respondWithResult(_0x1edb74,null))[_0x8808('0x3a')](handleError(_0x1edb74,null));};exports[_0x8808('0x49')]=function(_0x13de61,_0x4eaf15,_0x78aa28){var _0x430173={};var _0x58b6f8={};var _0x56d85c;var _0x459c2d;return db[_0x8808('0x25')]['findOne']({'where':{'id':_0x13de61[_0x8808('0x42')]['id']}})[_0x8808('0x39')](handleEntityNotFound(_0x4eaf15,null))[_0x8808('0x39')](function(_0x407b23){if(_0x407b23){_0x56d85c=_0x407b23;_0x58b6f8[_0x8808('0x28')]=_[_0x8808('0x3c')](db[_0x8808('0x4a')][_0x8808('0x3d')]);_0x58b6f8[_0x8808('0x29')]=_['keys'](_0x13de61['query']);_0x58b6f8[_0x8808('0x2a')]=_[_0x8808('0x2b')](_0x58b6f8[_0x8808('0x28')],_0x58b6f8[_0x8808('0x29')]);_0x430173[_0x8808('0x2c')]=_[_0x8808('0x2b')](_0x58b6f8[_0x8808('0x28')],qs[_0x8808('0x2d')](_0x13de61['query'][_0x8808('0x2d')]));_0x430173[_0x8808('0x2c')]=_0x430173[_0x8808('0x2c')]['length']?_0x430173['attributes']:_0x58b6f8['model'];_0x430173[_0x8808('0x2f')]=qs[_0x8808('0x30')](_0x13de61[_0x8808('0x29')][_0x8808('0x30')]);_0x430173['where']=qs['filters'](_[_0x8808('0x32')](_0x13de61[_0x8808('0x29')],_0x58b6f8[_0x8808('0x2a')]));if(_0x13de61[_0x8808('0x29')][_0x8808('0x33')]){_0x430173[_0x8808('0x31')]=_[_0x8808('0x34')](_0x430173['where'],{'$or':_[_0x8808('0x24')](_0x430173[_0x8808('0x2c')],function(_0x33b04f){var _0x33dc2d={};_0x33dc2d[_0x33b04f]={'$like':'%'+_0x13de61['query']['filter']+'%'};return _0x33dc2d;})});}_0x430173=_[_0x8808('0x34')]({},_0x430173,_0x13de61[_0x8808('0x36')]);return _0x56d85c['getTags'](_0x430173);}})[_0x8808('0x39')](function(_0xf3313d){if(_0xf3313d){_0x459c2d=_0xf3313d[_0x8808('0x3e')];if(!_0x13de61[_0x8808('0x29')][_0x8808('0x2e')](_0x8808('0x46'))){_0x430173[_0x8808('0x19')]=qs[_0x8808('0x19')](_0x13de61[_0x8808('0x29')][_0x8808('0x19')]);_0x430173['offset']=qs[_0x8808('0x18')](_0x13de61['query'][_0x8808('0x18')]);}return _0x56d85c[_0x8808('0x49')](_0x430173);}})[_0x8808('0x39')](function(_0x2e8862){if(_0x2e8862){return _0x2e8862?{'count':_0x459c2d,'rows':_0x2e8862}:null;}})[_0x8808('0x39')](respondWithResult(_0x4eaf15,null))[_0x8808('0x3a')](handleError(_0x4eaf15,null));};exports[_0x8808('0x4b')]=function(_0x42b5a4,_0x47646c,_0x2dcfe1){if(_0x42b5a4[_0x8808('0x41')]['id']){delete _0x42b5a4[_0x8808('0x41')]['id'];}return db['FreshdeskConfiguration'][_0x8808('0x44')]({'where':{'id':_0x42b5a4[_0x8808('0x42')]['id']}})[_0x8808('0x39')](handleEntityNotFound(_0x47646c,null))[_0x8808('0x39')](function(_0x5c23a9){if(_0x5c23a9){return _0x5c23a9[_0x8808('0x4b')](_0x42b5a4['body'][_0x8808('0x4c')]||[]);}return null;})[_0x8808('0x39')](respondWithResult(_0x47646c,null))[_0x8808('0x3a')](handleError(_0x47646c,null));};
\ No newline at end of file
index c466dc1..74604e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33c4=['../../config/environment','./intFreshdeskConfiguration.attributes','exports','FreshdeskConfiguration','int_freshdesk_configurations','api','moment'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x33c4,0x12b));var _0x433c=function(_0x53a76c,_0x1bbef1){_0x53a76c=_0x53a76c-0x0;var _0x34dd68=_0x33c4[_0x53a76c];return _0x34dd68;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x433c('0x0'));var moment=require(_0x433c('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x433c('0x2'));var attributes=require(_0x433c('0x3'));module[_0x433c('0x4')]=function(_0x56994a,_0x3421c0){return _0x56994a['define'](_0x433c('0x5'),attributes,{'tableName':_0x433c('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x294d=['FreshdeskConfiguration','int_freshdesk_configurations','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x2e6b4a,_0x361771){var _0x55464b=function(_0x18ad26){while(--_0x18ad26){_0x2e6b4a['push'](_0x2e6b4a['shift']());}};_0x55464b(++_0x361771);}(_0x294d,0xdf));var _0xd294=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x294d[_0x1694f5];return _0x5b4321;};'use strict';var _=require('lodash');var util=require(_0xd294('0x0'));var logger=require(_0xd294('0x1'))(_0xd294('0x2'));var moment=require(_0xd294('0x3'));var BPromise=require(_0xd294('0x4'));var rp=require(_0xd294('0x5'));var fs=require('fs');var path=require(_0xd294('0x6'));var rimraf=require(_0xd294('0x7'));var config=require(_0xd294('0x8'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0xd294('0x9')]=function(_0x2f774c,_0x255e7d){return _0x2f774c[_0xd294('0xa')](_0xd294('0xb'),attributes,{'tableName':_0xd294('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d87f877..28890b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b4b=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','lodash','bluebird','randomstring','ioredis'];(function(_0x540ec8,_0x37345d){var _0x146386=function(_0x25b610){while(--_0x25b610){_0x540ec8['push'](_0x540ec8['shift']());}};_0x146386(++_0x37345d);}(_0x1b4b,0x1df));var _0xb1b4=function(_0x58c7a7,_0x20527c){_0x58c7a7=_0x58c7a7-0x0;var _0x1ce296=_0x1b4b[_0x58c7a7];return _0x1ce296;};'use strict';var _=require(_0xb1b4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb1b4('0x1'));var rs=require(_0xb1b4('0x2'));var fs=require('fs');var Redis=require(_0xb1b4('0x3'));var db=require(_0xb1b4('0x4'))['db'];var utils=require(_0xb1b4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xb1b4('0x6'));var jayson=require(_0xb1b4('0x7'));var client=jayson[_0xb1b4('0x8')][_0xb1b4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x56159e,_0x2aba9b,_0x6fe494){return new BPromise(function(_0x15a9c1,_0x88a6e1){return client[_0xb1b4('0xa')](_0x56159e,_0x6fe494)[_0xb1b4('0xb')](function(_0x23c13c){logger['info'](_0xb1b4('0xc'),_0x2aba9b,'request\x20sent');logger[_0xb1b4('0xd')](_0xb1b4('0xe'),_0x2aba9b,_0xb1b4('0xf'),JSON['stringify'](_0x23c13c));if(_0x23c13c[_0xb1b4('0x10')]){if(_0x23c13c[_0xb1b4('0x10')]['code']===0x1f4){logger[_0xb1b4('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x2aba9b,_0x23c13c[_0xb1b4('0x10')][_0xb1b4('0x11')]);return _0x88a6e1(_0x23c13c[_0xb1b4('0x10')]['message']);}logger[_0xb1b4('0x10')](_0xb1b4('0xc'),_0x2aba9b,_0x23c13c[_0xb1b4('0x10')]['message']);return _0x15a9c1(_0x23c13c[_0xb1b4('0x10')]['message']);}else{logger[_0xb1b4('0x12')](_0xb1b4('0xc'),_0x2aba9b,_0xb1b4('0xf'));_0x15a9c1(_0x23c13c[_0xb1b4('0x13')][_0xb1b4('0x11')]);}})[_0xb1b4('0x14')](function(_0x488209){logger[_0xb1b4('0x10')](_0xb1b4('0xc'),_0x2aba9b,_0x488209);_0x88a6e1(_0x488209);});});}
\ No newline at end of file
+var _0x24e3=['FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x54897a,_0x301444){var _0x712026=function(_0x5e366a){while(--_0x5e366a){_0x54897a['push'](_0x54897a['shift']());}};_0x712026(++_0x301444);}(_0x24e3,0xaa));var _0x324e=function(_0xbb9282,_0x1c97c9){_0xbb9282=_0xbb9282-0x0;var _0x568cef=_0x24e3[_0xbb9282];return _0x568cef;};'use strict';var _=require(_0x324e('0x0'));var util=require(_0x324e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x324e('0x2'));var fs=require('fs');var Redis=require(_0x324e('0x3'));var db=require(_0x324e('0x4'))['db'];var utils=require(_0x324e('0x5'));var logger=require(_0x324e('0x6'))(_0x324e('0x7'));var config=require(_0x324e('0x8'));var jayson=require(_0x324e('0x9'));var client=jayson[_0x324e('0xa')][_0x324e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1754ce,_0x53371d,_0x4b6e22){return new BPromise(function(_0x3f0ae0,_0x31096c){return client['request'](_0x1754ce,_0x4b6e22)[_0x324e('0xc')](function(_0x2a9b50){logger[_0x324e('0xd')](_0x324e('0xe'),_0x53371d,_0x324e('0xf'));logger[_0x324e('0x10')](_0x324e('0x11'),_0x53371d,_0x324e('0xf'),JSON[_0x324e('0x12')](_0x2a9b50));if(_0x2a9b50[_0x324e('0x13')]){if(_0x2a9b50[_0x324e('0x13')][_0x324e('0x14')]===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x53371d,_0x2a9b50[_0x324e('0x13')][_0x324e('0x15')]);return _0x31096c(_0x2a9b50[_0x324e('0x13')][_0x324e('0x15')]);}logger[_0x324e('0x13')](_0x324e('0xe'),_0x53371d,_0x2a9b50[_0x324e('0x13')]['message']);return _0x3f0ae0(_0x2a9b50[_0x324e('0x13')]['message']);}else{logger[_0x324e('0xd')](_0x324e('0xe'),_0x53371d,_0x324e('0xf'));_0x3f0ae0(_0x2a9b50['result']['message']);}})[_0x324e('0x16')](function(_0x1f28ff){logger['error'](_0x324e('0xe'),_0x53371d,_0x1f28ff);_0x31096c(_0x1f28ff);});});}
\ No newline at end of file
index 0cd1e6a..5f6d33c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb42=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','post','create','put','update'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xcb42,0x190));var _0x2cb4=function(_0x1f4e10,_0x1db2a1){_0x1f4e10=_0x1f4e10-0x0;var _0x4c9c4d=_0xcb42[_0x1f4e10];return _0x4c9c4d;};'use strict';var multer=require(_0x2cb4('0x0'));var util=require(_0x2cb4('0x1'));var path=require(_0x2cb4('0x2'));var timeout=require(_0x2cb4('0x3'));var express=require(_0x2cb4('0x4'));var router=express[_0x2cb4('0x5')]();var fs_extra=require(_0x2cb4('0x6'));var auth=require(_0x2cb4('0x7'));var interaction=require(_0x2cb4('0x8'));var config=require('../../config/environment');var controller=require(_0x2cb4('0x9'));router[_0x2cb4('0xa')]('/',auth[_0x2cb4('0xb')](),controller[_0x2cb4('0xc')]);router[_0x2cb4('0xa')](_0x2cb4('0xd'),auth[_0x2cb4('0xb')](),controller['show']);router[_0x2cb4('0xe')]('/',auth['isAuthenticated'](),controller[_0x2cb4('0xf')]);router[_0x2cb4('0x10')](_0x2cb4('0xd'),auth['isAuthenticated'](),controller[_0x2cb4('0x11')]);router['delete'](_0x2cb4('0xd'),auth[_0x2cb4('0xb')](),controller['destroy']);module[_0x2cb4('0x12')]=router;
\ No newline at end of file
+var _0xcbf4=['Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','post','update','delete','destroy','exports','multer','util','path','express'];(function(_0xc6e313,_0x3b42be){var _0x4faafc=function(_0x2ff2bc){while(--_0x2ff2bc){_0xc6e313['push'](_0xc6e313['shift']());}};_0x4faafc(++_0x3b42be);}(_0xcbf4,0x18c));var _0x4cbf=function(_0x213903,_0x2878ac){_0x213903=_0x213903-0x0;var _0x36f19d=_0xcbf4[_0x213903];return _0x36f19d;};'use strict';var multer=require(_0x4cbf('0x0'));var util=require(_0x4cbf('0x1'));var path=require(_0x4cbf('0x2'));var timeout=require('connect-timeout');var express=require(_0x4cbf('0x3'));var router=express[_0x4cbf('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4cbf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4cbf('0x6'));var controller=require('./intFreshdeskField.controller');router[_0x4cbf('0x7')]('/',auth[_0x4cbf('0x8')](),controller[_0x4cbf('0x9')]);router[_0x4cbf('0x7')](_0x4cbf('0xa'),auth[_0x4cbf('0x8')](),controller['show']);router[_0x4cbf('0xb')]('/',auth[_0x4cbf('0x8')](),controller['create']);router['put'](_0x4cbf('0xa'),auth[_0x4cbf('0x8')](),controller[_0x4cbf('0xc')]);router[_0x4cbf('0xd')](_0x4cbf('0xa'),auth[_0x4cbf('0x8')](),controller[_0x4cbf('0xe')]);module[_0x4cbf('0xf')]=router;
\ No newline at end of file
index b736651..9840683 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0786=['STRING','variable','BOOLEAN','ENUM','string','customVariable','keyValue','picklist'];(function(_0x54895d,_0x13556e){var _0x14b70e=function(_0x9d79ec){while(--_0x9d79ec){_0x54895d['push'](_0x54895d['shift']());}};_0x14b70e(++_0x13556e);}(_0x0786,0x17b));var _0x6078=function(_0x39aedf,_0x2f5df8){_0x39aedf=_0x39aedf-0x0;var _0x39356c=_0x0786[_0x39aedf];return _0x39356c;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x6078('0x0')](_0x6078('0x1'),'variable',_0x6078('0x2'),_0x6078('0x3'),_0x6078('0x4')),'defaultValue':_0x6078('0x1')},'content':{'type':Sequelize[_0x6078('0x5')]},'key':{'type':Sequelize[_0x6078('0x5')]},'keyType':{'type':Sequelize[_0x6078('0x0')](_0x6078('0x1'),_0x6078('0x6'),_0x6078('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x6078('0x5')]},'nameField':{'type':Sequelize[_0x6078('0x5')]},'customField':{'type':Sequelize[_0x6078('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x9327=['picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x5c279d,_0x430085){var _0x490a0d=function(_0x253119){while(--_0x253119){_0x5c279d['push'](_0x5c279d['shift']());}};_0x490a0d(++_0x430085);}(_0x9327,0x18f));var _0x7932=function(_0x183671,_0x3257de){_0x183671=_0x183671-0x0;var _0x1b7345=_0x9327[_0x183671];return _0x1b7345;};'use strict';var Sequelize=require(_0x7932('0x0'));module[_0x7932('0x1')]={'type':{'type':Sequelize[_0x7932('0x2')](_0x7932('0x3'),_0x7932('0x4'),_0x7932('0x5'),'keyValue',_0x7932('0x6')),'defaultValue':_0x7932('0x3')},'content':{'type':Sequelize[_0x7932('0x7')]},'key':{'type':Sequelize[_0x7932('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x7932('0x3'),_0x7932('0x4'),_0x7932('0x5'))},'keyContent':{'type':Sequelize[_0x7932('0x7')]},'idField':{'type':Sequelize[_0x7932('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x7932('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7932('0x7')]}};
\ No newline at end of file
index 6266218..788cb79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bc6=['crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','FreshdeskField','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','catch','show','params','rawAttributes','fields','find','create','body','eml-format','rimraf','zip-dir','mustache','path','sox','ejs','fs-extra','lodash','squel'];(function(_0x4f36f7,_0x196ba2){var _0x17bbca=function(_0x581de8){while(--_0x581de8){_0x4f36f7['push'](_0x4f36f7['shift']());}};_0x17bbca(++_0x196ba2);}(_0x2bc6,0x163));var _0x62bc=function(_0x60831,_0x1df549){_0x60831=_0x60831-0x0;var _0x81e704=_0x2bc6[_0x60831];return _0x81e704;};'use strict';var emlformat=require(_0x62bc('0x0'));var rimraf=require(_0x62bc('0x1'));var zipdir=require(_0x62bc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x62bc('0x3'));var util=require('util');var path=require(_0x62bc('0x4'));var sox=require(_0x62bc('0x5'));var csv=require('to-csv');var ejs=require(_0x62bc('0x6'));var fs=require('fs');var fs_extra=require(_0x62bc('0x7'));var _=require(_0x62bc('0x8'));var squel=require(_0x62bc('0x9'));var crypto=require(_0x62bc('0xa'));var jsforce=require(_0x62bc('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x62bc('0xc'));var querystring=require(_0x62bc('0xd'));var Papa=require(_0x62bc('0xe'));var Redis=require(_0x62bc('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x62bc('0x10'));var as=require(_0x62bc('0x11'));var hardwareService=require(_0x62bc('0x12'));var logger=require('../../config/logger')(_0x62bc('0x13'));var utils=require(_0x62bc('0x14'));var config=require(_0x62bc('0x15'));var licenseUtil=require(_0x62bc('0x16'));var db=require(_0x62bc('0x17'))['db'];function respondWithStatusCode(_0x2a9309,_0x414a08){_0x414a08=_0x414a08||0xcc;return function(_0x4f92f7){if(_0x4f92f7){return _0x2a9309[_0x62bc('0x18')](_0x414a08);}return _0x2a9309[_0x62bc('0x19')](_0x414a08)['end']();};}function respondWithResult(_0x314358,_0x10230f){_0x10230f=_0x10230f||0xc8;return function(_0xc14ac9){if(_0xc14ac9){return _0x314358['status'](_0x10230f)[_0x62bc('0x1a')](_0xc14ac9);}};}function respondWithFilteredResult(_0x94b649,_0x56eade){return function(_0x515c80){if(_0x515c80){var _0x39c5e0=typeof _0x56eade[_0x62bc('0x1b')]==='undefined'&&typeof _0x56eade[_0x62bc('0x1c')]===_0x62bc('0x1d');var _0xc1211c=_0x515c80[_0x62bc('0x1e')];var _0xc95407=_0x39c5e0?0x0:_0x56eade[_0x62bc('0x1b')];var _0x1d3d8f=_0x39c5e0?_0x515c80[_0x62bc('0x1e')]:_0x56eade[_0x62bc('0x1b')]+_0x56eade['limit'];var _0x5dd6f0;if(_0x1d3d8f>=_0xc1211c){_0x1d3d8f=_0xc1211c;_0x5dd6f0=0xc8;}else{_0x5dd6f0=0xce;}_0x94b649[_0x62bc('0x19')](_0x5dd6f0);return _0x94b649[_0x62bc('0x1f')](_0x62bc('0x20'),_0xc95407+'-'+_0x1d3d8f+'/'+_0xc1211c)['json'](_0x515c80);}return null;};}function patchUpdates(_0x380621){return function(_0x495f99){try{jsonpatch[_0x62bc('0x21')](_0x495f99,_0x380621,!![]);}catch(_0x37ab87){return BPromise[_0x62bc('0x22')](_0x37ab87);}return _0x495f99['save']();};}function saveUpdates(_0x3b8644,_0x28757d){return function(_0xae87bf){if(_0xae87bf){return _0xae87bf[_0x62bc('0x23')](_0x3b8644)[_0x62bc('0x24')](function(_0x3b2eb0){return _0x3b2eb0;});}return null;};}function removeEntity(_0x5b2e16,_0x70e428){return function(_0xb0d0fb){if(_0xb0d0fb){return _0xb0d0fb[_0x62bc('0x25')]()[_0x62bc('0x24')](function(){_0x5b2e16[_0x62bc('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52ca86,_0xcd4b0){return function(_0x58e76a){if(!_0x58e76a){_0x52ca86[_0x62bc('0x18')](0x194);}return _0x58e76a;};}function handleError(_0x36af97,_0x1e046d){_0x1e046d=_0x1e046d||0x1f4;return function(_0x4a72d6){logger[_0x62bc('0x26')](_0x4a72d6[_0x62bc('0x27')]);if(_0x4a72d6[_0x62bc('0x28')]){delete _0x4a72d6['name'];}_0x36af97['status'](_0x1e046d)[_0x62bc('0x29')](_0x4a72d6);};}exports[_0x62bc('0x2a')]=function(_0x23817c,_0x4df640){var _0x4313ba={},_0x1f2985={},_0x44600f={'count':0x0,'rows':[]};var _0x444267=_['map'](db[_0x62bc('0x2b')]['rawAttributes'],function(_0x26701b){return{'name':_0x26701b[_0x62bc('0x2c')],'type':_0x26701b[_0x62bc('0x2d')][_0x62bc('0x2e')]};});_0x1f2985[_0x62bc('0x2f')]=_[_0x62bc('0x30')](_0x444267,_0x62bc('0x28'));_0x1f2985[_0x62bc('0x31')]=_[_0x62bc('0x32')](_0x23817c[_0x62bc('0x31')]);_0x1f2985[_0x62bc('0x33')]=_[_0x62bc('0x34')](_0x1f2985[_0x62bc('0x2f')],_0x1f2985[_0x62bc('0x31')]);_0x4313ba[_0x62bc('0x35')]=_[_0x62bc('0x34')](_0x1f2985[_0x62bc('0x2f')],qs['fields'](_0x23817c[_0x62bc('0x31')]['fields']));_0x4313ba['attributes']=_0x4313ba[_0x62bc('0x35')]['length']?_0x4313ba['attributes']:_0x1f2985['model'];if(!_0x23817c[_0x62bc('0x31')][_0x62bc('0x36')](_0x62bc('0x37'))){_0x4313ba['limit']=qs['limit'](_0x23817c['query'][_0x62bc('0x1c')]);_0x4313ba[_0x62bc('0x1b')]=qs['offset'](_0x23817c['query'][_0x62bc('0x1b')]);}_0x4313ba[_0x62bc('0x38')]=qs[_0x62bc('0x39')](_0x23817c['query'][_0x62bc('0x39')]);_0x4313ba[_0x62bc('0x3a')]=qs[_0x62bc('0x33')](_[_0x62bc('0x3b')](_0x23817c['query'],_0x1f2985[_0x62bc('0x33')]),_0x444267);if(_0x23817c[_0x62bc('0x31')]['filter']){_0x4313ba[_0x62bc('0x3a')]=_[_0x62bc('0x3c')](_0x4313ba[_0x62bc('0x3a')],{'$or':_[_0x62bc('0x30')](_0x444267,function(_0x599aed){if(_0x599aed[_0x62bc('0x2d')]!=='VIRTUAL'){var _0x38230a={};_0x38230a[_0x599aed[_0x62bc('0x28')]]={'$like':'%'+_0x23817c[_0x62bc('0x31')][_0x62bc('0x3d')]+'%'};return _0x38230a;}})});}_0x4313ba=_['merge']({},_0x4313ba,_0x23817c[_0x62bc('0x3e')]);var _0x5c806b={'where':_0x4313ba[_0x62bc('0x3a')]};return db[_0x62bc('0x2b')][_0x62bc('0x1e')](_0x5c806b)[_0x62bc('0x24')](function(_0x9011f2){_0x44600f[_0x62bc('0x1e')]=_0x9011f2;if(_0x23817c[_0x62bc('0x31')][_0x62bc('0x3f')]){_0x4313ba[_0x62bc('0x40')]=[{'all':!![]}];}return db['FreshdeskField']['findAll'](_0x4313ba);})[_0x62bc('0x24')](function(_0x400779){_0x44600f['rows']=_0x400779;return _0x44600f;})[_0x62bc('0x24')](respondWithFilteredResult(_0x4df640,_0x4313ba))[_0x62bc('0x41')](handleError(_0x4df640,null));};exports[_0x62bc('0x42')]=function(_0xedc9f3,_0xbd8c7e){var _0x5f3752={'raw':!![],'where':{'id':_0xedc9f3[_0x62bc('0x43')]['id']}},_0x3bf043={};_0x3bf043['model']=_['keys'](db[_0x62bc('0x2b')][_0x62bc('0x44')]);_0x3bf043[_0x62bc('0x31')]=_['keys'](_0xedc9f3[_0x62bc('0x31')]);_0x3bf043[_0x62bc('0x33')]=_[_0x62bc('0x34')](_0x3bf043[_0x62bc('0x2f')],_0x3bf043[_0x62bc('0x31')]);_0x5f3752[_0x62bc('0x35')]=_['intersection'](_0x3bf043[_0x62bc('0x2f')],qs['fields'](_0xedc9f3[_0x62bc('0x31')][_0x62bc('0x45')]));_0x5f3752[_0x62bc('0x35')]=_0x5f3752['attributes']['length']?_0x5f3752['attributes']:_0x3bf043[_0x62bc('0x2f')];if(_0xedc9f3['query'][_0x62bc('0x3f')]){_0x5f3752[_0x62bc('0x40')]=[{'all':!![]}];}_0x5f3752=_['merge']({},_0x5f3752,_0xedc9f3['options']);return db['FreshdeskField'][_0x62bc('0x46')](_0x5f3752)[_0x62bc('0x24')](handleEntityNotFound(_0xbd8c7e,null))[_0x62bc('0x24')](respondWithResult(_0xbd8c7e,null))[_0x62bc('0x41')](handleError(_0xbd8c7e,null));};exports[_0x62bc('0x47')]=function(_0x49389f,_0x3834b2){return db[_0x62bc('0x2b')]['create'](_0x49389f[_0x62bc('0x48')],{})['then'](respondWithResult(_0x3834b2,0xc9))[_0x62bc('0x41')](handleError(_0x3834b2,null));};exports[_0x62bc('0x23')]=function(_0x17e0ec,_0xca6190){if(_0x17e0ec[_0x62bc('0x48')]['id']){delete _0x17e0ec[_0x62bc('0x48')]['id'];}return db[_0x62bc('0x2b')]['find']({'where':{'id':_0x17e0ec[_0x62bc('0x43')]['id']}})[_0x62bc('0x24')](handleEntityNotFound(_0xca6190,null))['then'](saveUpdates(_0x17e0ec[_0x62bc('0x48')],null))['then'](respondWithResult(_0xca6190,null))[_0x62bc('0x41')](handleError(_0xca6190,null));};exports[_0x62bc('0x25')]=function(_0x4bec08,_0x6c2969){return db[_0x62bc('0x2b')][_0x62bc('0x46')]({'where':{'id':_0x4bec08['params']['id']}})[_0x62bc('0x24')](handleEntityNotFound(_0x6c2969,null))[_0x62bc('0x24')](removeEntity(_0x6c2969,null))[_0x62bc('0x41')](handleError(_0x6c2969,null));};
\ No newline at end of file
+var _0x3a25=['end','error','stack','name','send','index','map','FreshdeskField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy'];(function(_0xd63aca,_0x41c031){var _0x27d0ef=function(_0x25c1c7){while(--_0x25c1c7){_0xd63aca['push'](_0xd63aca['shift']());}};_0x27d0ef(++_0x41c031);}(_0x3a25,0x15d));var _0x53a2=function(_0x41096d,_0x211c7a){_0x41096d=_0x41096d-0x0;var _0x525faa=_0x3a25[_0x41096d];return _0x525faa;};'use strict';var emlformat=require(_0x53a2('0x0'));var rimraf=require(_0x53a2('0x1'));var zipdir=require(_0x53a2('0x2'));var jsonpatch=require(_0x53a2('0x3'));var rp=require(_0x53a2('0x4'));var moment=require(_0x53a2('0x5'));var BPromise=require(_0x53a2('0x6'));var Mustache=require(_0x53a2('0x7'));var util=require(_0x53a2('0x8'));var path=require(_0x53a2('0x9'));var sox=require(_0x53a2('0xa'));var csv=require(_0x53a2('0xb'));var ejs=require(_0x53a2('0xc'));var fs=require('fs');var fs_extra=require(_0x53a2('0xd'));var _=require(_0x53a2('0xe'));var squel=require('squel');var crypto=require(_0x53a2('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x53a2('0x10'));var toCsv=require(_0x53a2('0xb'));var querystring=require(_0x53a2('0x11'));var Papa=require(_0x53a2('0x12'));var Redis=require(_0x53a2('0x13'));var authService=require(_0x53a2('0x14'));var qs=require(_0x53a2('0x15'));var as=require(_0x53a2('0x16'));var hardwareService=require(_0x53a2('0x17'));var logger=require(_0x53a2('0x18'))('api');var utils=require('../../config/utils');var config=require(_0x53a2('0x19'));var licenseUtil=require(_0x53a2('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x564ca9,_0x47881a){_0x47881a=_0x47881a||0xcc;return function(_0x410370){if(_0x410370){return _0x564ca9[_0x53a2('0x1b')](_0x47881a);}return _0x564ca9[_0x53a2('0x1c')](_0x47881a)['end']();};}function respondWithResult(_0x58070c,_0x4e2228){_0x4e2228=_0x4e2228||0xc8;return function(_0x9c14b7){if(_0x9c14b7){return _0x58070c[_0x53a2('0x1c')](_0x4e2228)[_0x53a2('0x1d')](_0x9c14b7);}};}function respondWithFilteredResult(_0xf9b589,_0x4d3a40){return function(_0x1779ef){if(_0x1779ef){var _0x3343d3=typeof _0x4d3a40[_0x53a2('0x1e')]===_0x53a2('0x1f')&&typeof _0x4d3a40[_0x53a2('0x20')]==='undefined';var _0x485c4d=_0x1779ef[_0x53a2('0x21')];var _0x446b71=_0x3343d3?0x0:_0x4d3a40[_0x53a2('0x1e')];var _0x104fb6=_0x3343d3?_0x1779ef[_0x53a2('0x21')]:_0x4d3a40[_0x53a2('0x1e')]+_0x4d3a40['limit'];var _0x589666;if(_0x104fb6>=_0x485c4d){_0x104fb6=_0x485c4d;_0x589666=0xc8;}else{_0x589666=0xce;}_0xf9b589[_0x53a2('0x1c')](_0x589666);return _0xf9b589[_0x53a2('0x22')]('Content-Range',_0x446b71+'-'+_0x104fb6+'/'+_0x485c4d)[_0x53a2('0x1d')](_0x1779ef);}return null;};}function patchUpdates(_0x3fb15b){return function(_0x3efc90){try{jsonpatch[_0x53a2('0x23')](_0x3efc90,_0x3fb15b,!![]);}catch(_0x503e9b){return BPromise[_0x53a2('0x24')](_0x503e9b);}return _0x3efc90[_0x53a2('0x25')]();};}function saveUpdates(_0xd9693c,_0x2cda68){return function(_0x42df19){if(_0x42df19){return _0x42df19[_0x53a2('0x26')](_0xd9693c)[_0x53a2('0x27')](function(_0x3a769d){return _0x3a769d;});}return null;};}function removeEntity(_0x4a1a34,_0x579b10){return function(_0x473042){if(_0x473042){return _0x473042[_0x53a2('0x28')]()[_0x53a2('0x27')](function(){_0x4a1a34[_0x53a2('0x1c')](0xcc)[_0x53a2('0x29')]();});}};}function handleEntityNotFound(_0xa39167,_0x4b26a8){return function(_0x2dfa00){if(!_0x2dfa00){_0xa39167[_0x53a2('0x1b')](0x194);}return _0x2dfa00;};}function handleError(_0x111420,_0x397340){_0x397340=_0x397340||0x1f4;return function(_0x323c8a){logger[_0x53a2('0x2a')](_0x323c8a[_0x53a2('0x2b')]);if(_0x323c8a[_0x53a2('0x2c')]){delete _0x323c8a[_0x53a2('0x2c')];}_0x111420[_0x53a2('0x1c')](_0x397340)[_0x53a2('0x2d')](_0x323c8a);};}exports[_0x53a2('0x2e')]=function(_0x262eba,_0x469b0f){var _0x2a6428={},_0xf12019={},_0x437916={'count':0x0,'rows':[]};var _0x5a84de=_[_0x53a2('0x2f')](db[_0x53a2('0x30')][_0x53a2('0x31')],function(_0x23374b){return{'name':_0x23374b[_0x53a2('0x32')],'type':_0x23374b[_0x53a2('0x33')][_0x53a2('0x34')]};});_0xf12019[_0x53a2('0x35')]=_[_0x53a2('0x2f')](_0x5a84de,_0x53a2('0x2c'));_0xf12019[_0x53a2('0x36')]=_['keys'](_0x262eba[_0x53a2('0x36')]);_0xf12019[_0x53a2('0x37')]=_[_0x53a2('0x38')](_0xf12019[_0x53a2('0x35')],_0xf12019[_0x53a2('0x36')]);_0x2a6428[_0x53a2('0x39')]=_[_0x53a2('0x38')](_0xf12019[_0x53a2('0x35')],qs['fields'](_0x262eba[_0x53a2('0x36')][_0x53a2('0x3a')]));_0x2a6428[_0x53a2('0x39')]=_0x2a6428[_0x53a2('0x39')]['length']?_0x2a6428[_0x53a2('0x39')]:_0xf12019[_0x53a2('0x35')];if(!_0x262eba[_0x53a2('0x36')][_0x53a2('0x3b')](_0x53a2('0x3c'))){_0x2a6428[_0x53a2('0x20')]=qs['limit'](_0x262eba[_0x53a2('0x36')][_0x53a2('0x20')]);_0x2a6428[_0x53a2('0x1e')]=qs['offset'](_0x262eba[_0x53a2('0x36')]['offset']);}_0x2a6428[_0x53a2('0x3d')]=qs[_0x53a2('0x3e')](_0x262eba[_0x53a2('0x36')]['sort']);_0x2a6428['where']=qs[_0x53a2('0x37')](_['pick'](_0x262eba[_0x53a2('0x36')],_0xf12019[_0x53a2('0x37')]),_0x5a84de);if(_0x262eba[_0x53a2('0x36')][_0x53a2('0x3f')]){_0x2a6428[_0x53a2('0x40')]=_[_0x53a2('0x41')](_0x2a6428['where'],{'$or':_[_0x53a2('0x2f')](_0x5a84de,function(_0x1252ee){if(_0x1252ee['type']!=='VIRTUAL'){var _0x31e0b1={};_0x31e0b1[_0x1252ee['name']]={'$like':'%'+_0x262eba[_0x53a2('0x36')][_0x53a2('0x3f')]+'%'};return _0x31e0b1;}})});}_0x2a6428=_['merge']({},_0x2a6428,_0x262eba[_0x53a2('0x42')]);var _0x19d28e={'where':_0x2a6428[_0x53a2('0x40')]};return db[_0x53a2('0x30')][_0x53a2('0x21')](_0x19d28e)['then'](function(_0xf02fa){_0x437916[_0x53a2('0x21')]=_0xf02fa;if(_0x262eba['query'][_0x53a2('0x43')]){_0x2a6428[_0x53a2('0x44')]=[{'all':!![]}];}return db['FreshdeskField'][_0x53a2('0x45')](_0x2a6428);})['then'](function(_0xd5bcc8){_0x437916[_0x53a2('0x46')]=_0xd5bcc8;return _0x437916;})[_0x53a2('0x27')](respondWithFilteredResult(_0x469b0f,_0x2a6428))[_0x53a2('0x47')](handleError(_0x469b0f,null));};exports[_0x53a2('0x48')]=function(_0x1aa002,_0x524b6a){var _0x71a339={'raw':!![],'where':{'id':_0x1aa002[_0x53a2('0x49')]['id']}},_0x33238d={};_0x33238d[_0x53a2('0x35')]=_[_0x53a2('0x4a')](db[_0x53a2('0x30')][_0x53a2('0x31')]);_0x33238d[_0x53a2('0x36')]=_[_0x53a2('0x4a')](_0x1aa002[_0x53a2('0x36')]);_0x33238d[_0x53a2('0x37')]=_[_0x53a2('0x38')](_0x33238d[_0x53a2('0x35')],_0x33238d[_0x53a2('0x36')]);_0x71a339[_0x53a2('0x39')]=_[_0x53a2('0x38')](_0x33238d['model'],qs[_0x53a2('0x3a')](_0x1aa002[_0x53a2('0x36')]['fields']));_0x71a339['attributes']=_0x71a339[_0x53a2('0x39')]['length']?_0x71a339['attributes']:_0x33238d[_0x53a2('0x35')];if(_0x1aa002[_0x53a2('0x36')][_0x53a2('0x43')]){_0x71a339[_0x53a2('0x44')]=[{'all':!![]}];}_0x71a339=_['merge']({},_0x71a339,_0x1aa002['options']);return db['FreshdeskField'][_0x53a2('0x4b')](_0x71a339)['then'](handleEntityNotFound(_0x524b6a,null))['then'](respondWithResult(_0x524b6a,null))[_0x53a2('0x47')](handleError(_0x524b6a,null));};exports[_0x53a2('0x4c')]=function(_0x3a384e,_0x32a6fd){return db[_0x53a2('0x30')]['create'](_0x3a384e[_0x53a2('0x4d')],{})['then'](respondWithResult(_0x32a6fd,0xc9))[_0x53a2('0x47')](handleError(_0x32a6fd,null));};exports[_0x53a2('0x26')]=function(_0x5baa46,_0x35fb2b){if(_0x5baa46[_0x53a2('0x4d')]['id']){delete _0x5baa46[_0x53a2('0x4d')]['id'];}return db[_0x53a2('0x30')][_0x53a2('0x4b')]({'where':{'id':_0x5baa46[_0x53a2('0x49')]['id']}})[_0x53a2('0x27')](handleEntityNotFound(_0x35fb2b,null))['then'](saveUpdates(_0x5baa46[_0x53a2('0x4d')],null))[_0x53a2('0x27')](respondWithResult(_0x35fb2b,null))[_0x53a2('0x47')](handleError(_0x35fb2b,null));};exports['destroy']=function(_0x36df41,_0x71dbbf){return db[_0x53a2('0x30')][_0x53a2('0x4b')]({'where':{'id':_0x36df41[_0x53a2('0x49')]['id']}})['then'](handleEntityNotFound(_0x71dbbf,null))['then'](removeEntity(_0x71dbbf,null))[_0x53a2('0x47')](handleError(_0x71dbbf,null));};
\ No newline at end of file
index 5b710ba..4a5a1a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd29e=['define','idField','FieldId','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x9dedba,_0x448b89){var _0x2d30b7=function(_0x49182b){while(--_0x49182b){_0x9dedba['push'](_0x9dedba['shift']());}};_0x2d30b7(++_0x448b89);}(_0xd29e,0x1a7));var _0xed29=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd29e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xed29('0x0'));var logger=require(_0xed29('0x1'))(_0xed29('0x2'));var moment=require(_0xed29('0x3'));var BPromise=require(_0xed29('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xed29('0x5'));var rimraf=require(_0xed29('0x6'));var config=require(_0xed29('0x7'));var attributes=require('./intFreshdeskField.attributes');module[_0xed29('0x8')]=function(_0x1cd7de,_0x3b1660){return _0x1cd7de[_0xed29('0x9')]('FreshdeskField',attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0xed29('0xa'),_0xed29('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x710f=['freshdesk_unique_index','idField','FieldId','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0x710f,0xc7));var _0xf710=function(_0x1a879a,_0x9b85e6){_0x1a879a=_0x1a879a-0x0;var _0x28a778=_0x710f[_0x1a879a];return _0x28a778;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xf710('0x0'));var moment=require(_0xf710('0x1'));var BPromise=require(_0xf710('0x2'));var rp=require(_0xf710('0x3'));var fs=require('fs');var path=require(_0xf710('0x4'));var rimraf=require(_0xf710('0x5'));var config=require(_0xf710('0x6'));var attributes=require(_0xf710('0x7'));module[_0xf710('0x8')]=function(_0xc0125b,_0x341356){return _0xc0125b[_0xf710('0x9')](_0xf710('0xa'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0xf710('0xb'),'fields':[_0xf710('0xc'),_0xf710('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index fd968c5..de63094 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8008=['client','http','request','info','FreshdeskField,\x20%s,\x20%s','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2d7c9e,_0x4cfaa9){var _0x5398b9=function(_0x24839e){while(--_0x24839e){_0x2d7c9e['push'](_0x2d7c9e['shift']());}};_0x5398b9(++_0x4cfaa9);}(_0x8008,0x1d3));var _0x8800=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8008[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x8800('0x0'));var moment=require('moment');var BPromise=require(_0x8800('0x1'));var rs=require(_0x8800('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8800('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x8800('0x4'))(_0x8800('0x5'));var config=require(_0x8800('0x6'));var jayson=require(_0x8800('0x7'));var client=jayson[_0x8800('0x8')][_0x8800('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x13fd0a,_0x5de5a1,_0x57f79d){return new BPromise(function(_0x1fc953,_0x491140){return client[_0x8800('0xa')](_0x13fd0a,_0x57f79d)['then'](function(_0x4589de){logger[_0x8800('0xb')](_0x8800('0xc'),_0x5de5a1,'request\x20sent');logger[_0x8800('0xd')](_0x8800('0xe'),_0x5de5a1,'request\x20sent',JSON['stringify'](_0x4589de));if(_0x4589de[_0x8800('0xf')]){if(_0x4589de[_0x8800('0xf')]['code']===0x1f4){logger[_0x8800('0xf')](_0x8800('0xc'),_0x5de5a1,_0x4589de[_0x8800('0xf')][_0x8800('0x10')]);return _0x491140(_0x4589de[_0x8800('0xf')][_0x8800('0x10')]);}logger[_0x8800('0xf')](_0x8800('0xc'),_0x5de5a1,_0x4589de[_0x8800('0xf')]['message']);return _0x1fc953(_0x4589de[_0x8800('0xf')][_0x8800('0x10')]);}else{logger[_0x8800('0xb')](_0x8800('0xc'),_0x5de5a1,_0x8800('0x11'));_0x1fc953(_0x4589de[_0x8800('0x12')]['message']);}})['catch'](function(_0x461ed1){logger['error'](_0x8800('0xc'),_0x5de5a1,_0x461ed1);_0x491140(_0x461ed1);});});}
\ No newline at end of file
+var _0x594c=['FreshdeskField,\x20%s,\x20%s','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','util','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x13f5db,_0x2ff224){var _0x467ee3=function(_0x8c4b79){while(--_0x8c4b79){_0x13f5db['push'](_0x13f5db['shift']());}};_0x467ee3(++_0x2ff224);}(_0x594c,0x1d0));var _0xc594=function(_0x318a90,_0x232c87){_0x318a90=_0x318a90-0x0;var _0x45efd1=_0x594c[_0x318a90];return _0x45efd1;};'use strict';var _=require('lodash');var util=require(_0xc594('0x0'));var moment=require('moment');var BPromise=require(_0xc594('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc594('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc594('0x3'))('rpc');var config=require(_0xc594('0x4'));var jayson=require(_0xc594('0x5'));var client=jayson[_0xc594('0x6')][_0xc594('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x13c9f0,_0x531c60,_0x2e4300){return new BPromise(function(_0xa5588f,_0x3eaa3b){return client[_0xc594('0x8')](_0x13c9f0,_0x2e4300)[_0xc594('0x9')](function(_0x1d884c){logger[_0xc594('0xa')](_0xc594('0xb'),_0x531c60,'request\x20sent');logger[_0xc594('0xc')](_0xc594('0xd'),_0x531c60,'request\x20sent',JSON[_0xc594('0xe')](_0x1d884c));if(_0x1d884c[_0xc594('0xf')]){if(_0x1d884c[_0xc594('0xf')][_0xc594('0x10')]===0x1f4){logger[_0xc594('0xf')](_0xc594('0xb'),_0x531c60,_0x1d884c[_0xc594('0xf')][_0xc594('0x11')]);return _0x3eaa3b(_0x1d884c[_0xc594('0xf')]['message']);}logger[_0xc594('0xf')](_0xc594('0xb'),_0x531c60,_0x1d884c[_0xc594('0xf')][_0xc594('0x11')]);return _0xa5588f(_0x1d884c[_0xc594('0xf')][_0xc594('0x11')]);}else{logger['info'](_0xc594('0xb'),_0x531c60,_0xc594('0x12'));_0xa5588f(_0x1d884c['result'][_0xc594('0x11')]);}})['catch'](function(_0x46f2bb){logger[_0xc594('0xf')](_0xc594('0xb'),_0x531c60,_0x46f2bb);_0x3eaa3b(_0x46f2bb);});});}
\ No newline at end of file
index d1c2acc..0bc1fc4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb9be=['isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0x44425c,_0x278574){var _0x566013=function(_0x19e485){while(--_0x19e485){_0x44425c['push'](_0x44425c['shift']());}};_0x566013(++_0x278574);}(_0xb9be,0xc5));var _0xeb9b=function(_0x4bd950,_0x184ed5){_0x4bd950=_0x4bd950-0x0;var _0x5dc59a=_0xb9be[_0x4bd950];return _0x5dc59a;};'use strict';var multer=require(_0xeb9b('0x0'));var util=require(_0xeb9b('0x1'));var path=require(_0xeb9b('0x2'));var timeout=require(_0xeb9b('0x3'));var express=require(_0xeb9b('0x4'));var router=express[_0xeb9b('0x5')]();var fs_extra=require(_0xeb9b('0x6'));var auth=require(_0xeb9b('0x7'));var interaction=require(_0xeb9b('0x8'));var config=require('../../config/environment');var controller=require('./intFreshsalesAccount.controller');router[_0xeb9b('0x9')]('/',auth[_0xeb9b('0xa')](),controller[_0xeb9b('0xb')]);router['get'](_0xeb9b('0xc'),auth[_0xeb9b('0xa')](),controller[_0xeb9b('0xd')]);router[_0xeb9b('0x9')](_0xeb9b('0xe'),auth[_0xeb9b('0xa')](),controller[_0xeb9b('0xf')]);router[_0xeb9b('0x9')](_0xeb9b('0x10'),auth['isAuthenticated'](),controller[_0xeb9b('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0xeb9b('0x12')]);router[_0xeb9b('0x13')]('/:id/configurations',auth[_0xeb9b('0xa')](),controller[_0xeb9b('0x14')]);router[_0xeb9b('0x15')](_0xeb9b('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xeb9b('0xc'),auth[_0xeb9b('0xa')](),controller[_0xeb9b('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0xc788=['getConfigurations','post','addConfiguration','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations'];(function(_0x7b0928,_0x1df855){var _0x4dcd5b=function(_0x4b0b6b){while(--_0x4b0b6b){_0x7b0928['push'](_0x7b0928['shift']());}};_0x4dcd5b(++_0x1df855);}(_0xc788,0xc4));var _0x8c78=function(_0x393bf5,_0x225cac){_0x393bf5=_0x393bf5-0x0;var _0xcb023=_0xc788[_0x393bf5];return _0xcb023;};'use strict';var multer=require(_0x8c78('0x0'));var util=require(_0x8c78('0x1'));var path=require(_0x8c78('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8c78('0x3')]();var fs_extra=require(_0x8c78('0x4'));var auth=require(_0x8c78('0x5'));var interaction=require(_0x8c78('0x6'));var config=require(_0x8c78('0x7'));var controller=require('./intFreshsalesAccount.controller');router[_0x8c78('0x8')]('/',auth[_0x8c78('0x9')](),controller[_0x8c78('0xa')]);router[_0x8c78('0x8')](_0x8c78('0xb'),auth['isAuthenticated'](),controller[_0x8c78('0xc')]);router[_0x8c78('0x8')](_0x8c78('0xd'),auth[_0x8c78('0x9')](),controller[_0x8c78('0xe')]);router[_0x8c78('0x8')]('/:id/fields',auth[_0x8c78('0x9')](),controller['getFields']);router[_0x8c78('0xf')]('/',auth[_0x8c78('0x9')](),controller['create']);router[_0x8c78('0xf')](_0x8c78('0xd'),auth['isAuthenticated'](),controller[_0x8c78('0x10')]);router['put']('/:id',auth[_0x8c78('0x9')](),controller[_0x8c78('0x11')]);router[_0x8c78('0x12')](_0x8c78('0xb'),auth[_0x8c78('0x9')](),controller[_0x8c78('0x13')]);module[_0x8c78('0x14')]=router;
\ No newline at end of file
index fce7cbb..bafc95f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef0f=['sequelize','STRING','remoteUri'];(function(_0xc2d00d,_0x3e3da4){var _0x18e28e=function(_0x9bde85){while(--_0x9bde85){_0xc2d00d['push'](_0xc2d00d['shift']());}};_0x18e28e(++_0x3e3da4);}(_0xef0f,0x168));var _0xfef0=function(_0x3faab7,_0xa89bbb){_0x3faab7=_0x3faab7-0x0;var _0x264f40=_0xef0f[_0x3faab7];return _0x264f40;};'use strict';var Sequelize=require(_0xfef0('0x0'));module['exports']={'name':{'type':Sequelize[_0xfef0('0x1')]},'description':{'type':Sequelize[_0xfef0('0x1')]},'username':{'type':Sequelize[_0xfef0('0x1')],'unique':'username'},'apiKey':{'type':Sequelize[_0xfef0('0x1')]},'remoteUri':{'type':Sequelize[_0xfef0('0x1')],'unique':_0xfef0('0x2')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0x0424=['username','STRING'];(function(_0x5dcd95,_0x1e72d4){var _0x271b17=function(_0x57b81b){while(--_0x57b81b){_0x5dcd95['push'](_0x5dcd95['shift']());}};_0x271b17(++_0x1e72d4);}(_0x0424,0x159));var _0x4042=function(_0x206096,_0x1c6cfd){_0x206096=_0x206096-0x0;var _0x3f3b50=_0x0424[_0x206096];return _0x3f3b50;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4042('0x0')]},'description':{'type':Sequelize[_0x4042('0x0')]},'username':{'type':Sequelize[_0x4042('0x0')],'unique':_0x4042('0x1')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x4042('0x0')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index 37718a1..9948269 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc218=['../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','map','FreshsalesAccount','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','include','rows','catch','show','params','keys','includeAll','find','create','update','body','getConfigurations','FreshsalesConfiguration','addConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s%s','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb'];(function(_0x4bacb6,_0x2b299d){var _0x58c029=function(_0x2faaf5){while(--_0x2faaf5){_0x4bacb6['push'](_0x4bacb6['shift']());}};_0x58c029(++_0x2b299d);}(_0xc218,0xb8));var _0x8c21=function(_0x15750b,_0x6df906){_0x15750b=_0x15750b-0x0;var _0xbe3696=_0xc218[_0x15750b];return _0xbe3696;};'use strict';var emlformat=require(_0x8c21('0x0'));var rimraf=require(_0x8c21('0x1'));var zipdir=require(_0x8c21('0x2'));var jsonpatch=require(_0x8c21('0x3'));var rp=require(_0x8c21('0x4'));var moment=require(_0x8c21('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8c21('0x6'));var util=require(_0x8c21('0x7'));var path=require(_0x8c21('0x8'));var sox=require('sox');var csv=require(_0x8c21('0x9'));var ejs=require(_0x8c21('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8c21('0xb'));var squel=require('squel');var crypto=require(_0x8c21('0xc'));var jsforce=require(_0x8c21('0xd'));var deskjs=require(_0x8c21('0xe'));var toCsv=require(_0x8c21('0x9'));var querystring=require(_0x8c21('0xf'));var Papa=require('papaparse');var Redis=require(_0x8c21('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8c21('0x11'));var as=require(_0x8c21('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8c21('0x13'));var utils=require('../../config/utils');var config=require(_0x8c21('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x8c21('0x15'))['db'];var integrations=require(_0x8c21('0x16'));function respondWithStatusCode(_0x3bbe1c,_0x4b0e8b){_0x4b0e8b=_0x4b0e8b||0xcc;return function(_0x3fbcd9){if(_0x3fbcd9){return _0x3bbe1c[_0x8c21('0x17')](_0x4b0e8b);}return _0x3bbe1c[_0x8c21('0x18')](_0x4b0e8b)[_0x8c21('0x19')]();};}function respondWithResult(_0x1fa2f8,_0x2ae179){_0x2ae179=_0x2ae179||0xc8;return function(_0x51392d){if(_0x51392d){return _0x1fa2f8[_0x8c21('0x18')](_0x2ae179)[_0x8c21('0x1a')](_0x51392d);}};}function respondWithFilteredResult(_0xd8387c,_0x4d3573){return function(_0x4d0df2){if(_0x4d0df2){var _0x304cdf=typeof _0x4d3573[_0x8c21('0x1b')]==='undefined'&&typeof _0x4d3573[_0x8c21('0x1c')]==='undefined';var _0x43a6a1=_0x4d0df2[_0x8c21('0x1d')];var _0x59526a=_0x304cdf?0x0:_0x4d3573[_0x8c21('0x1b')];var _0x261619=_0x304cdf?_0x4d0df2['count']:_0x4d3573['offset']+_0x4d3573['limit'];var _0x13b5f7;if(_0x261619>=_0x43a6a1){_0x261619=_0x43a6a1;_0x13b5f7=0xc8;}else{_0x13b5f7=0xce;}_0xd8387c[_0x8c21('0x18')](_0x13b5f7);return _0xd8387c[_0x8c21('0x1e')](_0x8c21('0x1f'),_0x59526a+'-'+_0x261619+'/'+_0x43a6a1)[_0x8c21('0x1a')](_0x4d0df2);}return null;};}function patchUpdates(_0x3b1bb8){return function(_0xd0a87){try{jsonpatch[_0x8c21('0x20')](_0xd0a87,_0x3b1bb8,!![]);}catch(_0x40404e){return BPromise[_0x8c21('0x21')](_0x40404e);}return _0xd0a87[_0x8c21('0x22')]();};}function saveUpdates(_0x161fb3,_0x365e2c){return function(_0x18f70f){if(_0x18f70f){return _0x18f70f['update'](_0x161fb3)['then'](function(_0x1d4da7){return _0x1d4da7;});}return null;};}function removeEntity(_0x3a995a,_0x58583){return function(_0x3d21ac){if(_0x3d21ac){return _0x3d21ac[_0x8c21('0x23')]()[_0x8c21('0x24')](function(){_0x3a995a[_0x8c21('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x237f7e,_0x3f8c8b){return function(_0x44c38b){if(!_0x44c38b){_0x237f7e['sendStatus'](0x194);}return _0x44c38b;};}function handleError(_0x2ff660,_0x12d3b7){_0x12d3b7=_0x12d3b7||0x1f4;return function(_0x28720d){logger[_0x8c21('0x25')](_0x28720d[_0x8c21('0x26')]);if(_0x28720d[_0x8c21('0x27')]){delete _0x28720d[_0x8c21('0x27')];}_0x2ff660['status'](_0x12d3b7)[_0x8c21('0x28')](_0x28720d);};}exports['index']=function(_0x8495ba,_0x5e327a){var _0x34e11e={},_0x3f07e8={},_0x28ed92={'count':0x0,'rows':[]};var _0x403114=_[_0x8c21('0x29')](db[_0x8c21('0x2a')][_0x8c21('0x2b')],function(_0x476236){return{'name':_0x476236[_0x8c21('0x2c')],'type':_0x476236['type'][_0x8c21('0x2d')]};});_0x3f07e8[_0x8c21('0x2e')]=_[_0x8c21('0x29')](_0x403114,_0x8c21('0x27'));_0x3f07e8[_0x8c21('0x2f')]=_['keys'](_0x8495ba[_0x8c21('0x2f')]);_0x3f07e8[_0x8c21('0x30')]=_[_0x8c21('0x31')](_0x3f07e8[_0x8c21('0x2e')],_0x3f07e8[_0x8c21('0x2f')]);_0x34e11e[_0x8c21('0x32')]=_[_0x8c21('0x31')](_0x3f07e8['model'],qs[_0x8c21('0x33')](_0x8495ba['query'][_0x8c21('0x33')]));_0x34e11e[_0x8c21('0x32')]=_0x34e11e[_0x8c21('0x32')][_0x8c21('0x34')]?_0x34e11e[_0x8c21('0x32')]:_0x3f07e8[_0x8c21('0x2e')];if(!_0x8495ba['query'][_0x8c21('0x35')](_0x8c21('0x36'))){_0x34e11e['limit']=qs['limit'](_0x8495ba[_0x8c21('0x2f')][_0x8c21('0x1c')]);_0x34e11e['offset']=qs[_0x8c21('0x1b')](_0x8495ba[_0x8c21('0x2f')][_0x8c21('0x1b')]);}_0x34e11e[_0x8c21('0x37')]=qs[_0x8c21('0x38')](_0x8495ba['query'][_0x8c21('0x38')]);_0x34e11e['where']=qs['filters'](_[_0x8c21('0x39')](_0x8495ba[_0x8c21('0x2f')],_0x3f07e8['filters']),_0x403114);if(_0x8495ba[_0x8c21('0x2f')][_0x8c21('0x3a')]){_0x34e11e[_0x8c21('0x3b')]=_[_0x8c21('0x3c')](_0x34e11e[_0x8c21('0x3b')],{'$or':_[_0x8c21('0x29')](_0x403114,function(_0x404fea){if(_0x404fea[_0x8c21('0x3d')]!==_0x8c21('0x3e')){var _0x3baf76={};_0x3baf76[_0x404fea[_0x8c21('0x27')]]={'$like':'%'+_0x8495ba['query']['filter']+'%'};return _0x3baf76;}})});}_0x34e11e=_['merge']({},_0x34e11e,_0x8495ba[_0x8c21('0x3f')]);var _0x4310d5={'where':_0x34e11e[_0x8c21('0x3b')]};return db[_0x8c21('0x2a')][_0x8c21('0x1d')](_0x4310d5)[_0x8c21('0x24')](function(_0x3f1c88){_0x28ed92[_0x8c21('0x1d')]=_0x3f1c88;if(_0x8495ba[_0x8c21('0x2f')]['includeAll']){_0x34e11e[_0x8c21('0x40')]=[{'all':!![]}];}return db[_0x8c21('0x2a')]['findAll'](_0x34e11e);})[_0x8c21('0x24')](function(_0xca61e9){_0x28ed92[_0x8c21('0x41')]=_0xca61e9;return _0x28ed92;})[_0x8c21('0x24')](respondWithFilteredResult(_0x5e327a,_0x34e11e))[_0x8c21('0x42')](handleError(_0x5e327a,null));};exports[_0x8c21('0x43')]=function(_0x6f654,_0x2514de){var _0x48152a={'raw':![],'where':{'id':_0x6f654[_0x8c21('0x44')]['id']}},_0x56088a={};_0x56088a[_0x8c21('0x2e')]=_[_0x8c21('0x45')](db[_0x8c21('0x2a')][_0x8c21('0x2b')]);_0x56088a['query']=_['keys'](_0x6f654['query']);_0x56088a[_0x8c21('0x30')]=_[_0x8c21('0x31')](_0x56088a[_0x8c21('0x2e')],_0x56088a[_0x8c21('0x2f')]);_0x48152a['attributes']=_['intersection'](_0x56088a[_0x8c21('0x2e')],qs[_0x8c21('0x33')](_0x6f654['query'][_0x8c21('0x33')]));_0x48152a['attributes']=_0x48152a[_0x8c21('0x32')]['length']?_0x48152a[_0x8c21('0x32')]:_0x56088a[_0x8c21('0x2e')];if(_0x6f654[_0x8c21('0x2f')][_0x8c21('0x46')]){_0x48152a[_0x8c21('0x40')]=[{'all':!![]}];}_0x48152a=_[_0x8c21('0x3c')]({},_0x48152a,_0x6f654[_0x8c21('0x3f')]);return db[_0x8c21('0x2a')][_0x8c21('0x47')](_0x48152a)[_0x8c21('0x24')](handleEntityNotFound(_0x2514de,null))[_0x8c21('0x24')](respondWithResult(_0x2514de,null))[_0x8c21('0x42')](handleError(_0x2514de,null));};exports['create']=function(_0x2034d3,_0x4266e6){return db[_0x8c21('0x2a')][_0x8c21('0x48')](_0x2034d3['body'],{})['then'](respondWithResult(_0x4266e6,0xc9))['catch'](handleError(_0x4266e6,null));};exports[_0x8c21('0x49')]=function(_0x30fa8a,_0x529b11){if(_0x30fa8a[_0x8c21('0x4a')]['id']){delete _0x30fa8a[_0x8c21('0x4a')]['id'];}return db[_0x8c21('0x2a')][_0x8c21('0x47')]({'where':{'id':_0x30fa8a[_0x8c21('0x44')]['id']}})[_0x8c21('0x24')](handleEntityNotFound(_0x529b11,null))[_0x8c21('0x24')](saveUpdates(_0x30fa8a[_0x8c21('0x4a')],null))['then'](respondWithResult(_0x529b11,null))['catch'](handleError(_0x529b11,null));};exports[_0x8c21('0x23')]=function(_0x637ee4,_0xb354dd){return db[_0x8c21('0x2a')][_0x8c21('0x47')]({'where':{'id':_0x637ee4['params']['id']}})[_0x8c21('0x24')](handleEntityNotFound(_0xb354dd,null))['then'](removeEntity(_0xb354dd,null))['catch'](handleError(_0xb354dd,null));};exports[_0x8c21('0x4b')]=function(_0x20ff74,_0x517767,_0xb75826){var _0x4be863={};var _0x20e81a={};var _0x1f9348;var _0x24dd5b;return db[_0x8c21('0x2a')]['findOne']({'where':{'id':_0x20ff74[_0x8c21('0x44')]['id']}})[_0x8c21('0x24')](handleEntityNotFound(_0x517767,null))[_0x8c21('0x24')](function(_0x3934f7){if(_0x3934f7){_0x1f9348=_0x3934f7;_0x20e81a[_0x8c21('0x2e')]=_[_0x8c21('0x45')](db[_0x8c21('0x4c')][_0x8c21('0x2b')]);_0x20e81a[_0x8c21('0x2f')]=_[_0x8c21('0x45')](_0x20ff74[_0x8c21('0x2f')]);_0x20e81a[_0x8c21('0x30')]=_[_0x8c21('0x31')](_0x20e81a[_0x8c21('0x2e')],_0x20e81a[_0x8c21('0x2f')]);_0x4be863['attributes']=_[_0x8c21('0x31')](_0x20e81a[_0x8c21('0x2e')],qs[_0x8c21('0x33')](_0x20ff74[_0x8c21('0x2f')][_0x8c21('0x33')]));_0x4be863[_0x8c21('0x32')]=_0x4be863[_0x8c21('0x32')][_0x8c21('0x34')]?_0x4be863['attributes']:_0x20e81a[_0x8c21('0x2e')];_0x4be863['order']=qs[_0x8c21('0x38')](_0x20ff74[_0x8c21('0x2f')]['sort']);_0x4be863[_0x8c21('0x3b')]=qs[_0x8c21('0x30')](_['pick'](_0x20ff74[_0x8c21('0x2f')],_0x20e81a[_0x8c21('0x30')]));if(_0x20ff74[_0x8c21('0x2f')][_0x8c21('0x3a')]){_0x4be863['where']=_['merge'](_0x4be863[_0x8c21('0x3b')],{'$or':_[_0x8c21('0x29')](_0x4be863[_0x8c21('0x32')],function(_0x22e338){var _0x3fa31e={};_0x3fa31e[_0x22e338]={'$like':'%'+_0x20ff74[_0x8c21('0x2f')]['filter']+'%'};return _0x3fa31e;})});}_0x4be863=_[_0x8c21('0x3c')]({},_0x4be863,_0x20ff74[_0x8c21('0x3f')]);return _0x1f9348[_0x8c21('0x4b')](_0x4be863);}})[_0x8c21('0x24')](function(_0x77c193){if(_0x77c193){_0x24dd5b=_0x77c193[_0x8c21('0x34')];if(!_0x20ff74[_0x8c21('0x2f')]['hasOwnProperty'](_0x8c21('0x36'))){_0x4be863[_0x8c21('0x1c')]=qs[_0x8c21('0x1c')](_0x20ff74['query']['limit']);_0x4be863[_0x8c21('0x1b')]=qs['offset'](_0x20ff74[_0x8c21('0x2f')][_0x8c21('0x1b')]);}return _0x1f9348[_0x8c21('0x4b')](_0x4be863);}})[_0x8c21('0x24')](function(_0x4aa6bb){if(_0x4aa6bb){return _0x4aa6bb?{'count':_0x24dd5b,'rows':_0x4aa6bb}:null;}})['then'](respondWithResult(_0x517767,null))[_0x8c21('0x42')](handleError(_0x517767,null));};exports[_0x8c21('0x4d')]=function(_0x35e136,_0x3ca23b,_0x192a2a){if(_0x35e136[_0x8c21('0x4a')]['id']){delete _0x35e136[_0x8c21('0x4a')]['id'];}return db[_0x8c21('0x2a')][_0x8c21('0x4e')]({'where':{'id':_0x35e136[_0x8c21('0x44')]['id']}})['then'](handleEntityNotFound(_0x3ca23b,null))[_0x8c21('0x24')](function(_0x2aee83){if(_0x2aee83){_0x35e136[_0x8c21('0x4a')]['AccountId']=_0x2aee83['id'];_0x35e136['body'][_0x8c21('0x4f')]=integrations[_0x8c21('0x50')](_0x35e136[_0x8c21('0x4a')][_0x8c21('0x51')],_0x35e136[_0x8c21('0x4a')]['type']);_0x35e136[_0x8c21('0x4a')][_0x8c21('0x52')]=integrations[_0x8c21('0x53')](_0x35e136['body'][_0x8c21('0x51')],_0x35e136[_0x8c21('0x4a')][_0x8c21('0x3d')]);return db[_0x8c21('0x4c')]['create'](_0x35e136['body'],{'include':[{'model':db[_0x8c21('0x54')],'as':'Subjects'},{'model':db[_0x8c21('0x54')],'as':_0x8c21('0x52')}]});}return null;})[_0x8c21('0x24')](respondWithResult(_0x3ca23b,null))[_0x8c21('0x42')](handleError(_0x3ca23b,null));};exports[_0x8c21('0x55')]=function(_0x35ec68,_0x40fe11,_0x20f8bb){var _0x175528='';var _0xc3d349='';return db['FreshsalesAccount'][_0x8c21('0x4e')]({'where':{'id':_0x35ec68[_0x8c21('0x44')]['id']},'attributes':['id',_0x8c21('0x56'),_0x8c21('0x57'),_0x8c21('0x58')]})['then'](handleEntityNotFound(_0x40fe11,null))[_0x8c21('0x24')](function(_0x4711ac){if(_0x4711ac){_0xc3d349=_0x4711ac[_0x8c21('0x56')];_0x175528=_0x4711ac[_0x8c21('0x57')];var _0x4e8234=_0x4711ac[_0x8c21('0x57')][_0x8c21('0x59')](-0x1);if(_0x4e8234==='/'){_0x175528=_0x175528[_0x8c21('0x5a')](0x0,_0x175528[_0x8c21('0x5b')](_0x4e8234));}return rp({'method':_0x8c21('0x5c'),'uri':util[_0x8c21('0x5d')](_0x8c21('0x5e'),_0x175528,'/api/selector/owners'),'headers':{'Authorization':'Token\x20token='+_0x4711ac['apiKey']},'json':!![]});}})[_0x8c21('0x24')](function(_0x3c6ea9){if(_0x3c6ea9){var _0x4e264b=_0x3c6ea9[_0x8c21('0x5f')];var _0x550297=![];var _0xa3b233=null;for(_0xa3b233=0x0;_0xa3b233<_0x4e264b[_0x8c21('0x34')];_0xa3b233++){if(_0x4e264b[_0xa3b233][_0x8c21('0x60')]===_0xc3d349){_0x550297=!![];}}if(_0x550297){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x8c21('0x61')});}}})[_0x8c21('0x24')](respondWithResult(_0x40fe11,null))[_0x8c21('0x42')](function(_0x236556){var _0x44a542=_0x35ec68[_0x8c21('0x2f')][_0x8c21('0x62')]?0x1f4:_0x236556[_0x8c21('0x63')]||0x1f4;logger['error'](_0x8c21('0x64'),'getFields',_0x44a542,JSON[_0x8c21('0x65')](_0x236556));delete _0x236556[_0x8c21('0x27')];if(_0x44a542===0x191){_0x44a542=0x190;}_0x40fe11['status'](_0x44a542)[_0x8c21('0x28')](_0x35ec68[_0x8c21('0x2f')][_0x8c21('0x62')]?{'message':_0x8c21('0x66'),'statusCode':_0x236556[_0x8c21('0x63')]}:_0x236556);});};
\ No newline at end of file
+var _0xaa3e=['substring','GET','%s%s','Token\x20token=','users','email','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','error','name','send','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','then','includeAll','include','findAll','rows','catch','params','find','create','body','findOne','FreshsalesConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','FreshsalesField','getFields','username','apiKey','remoteUri','slice'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xaa3e,0x140));var _0xeaa3=function(_0x4dd479,_0x26d87a){_0x4dd479=_0x4dd479-0x0;var _0x1b6807=_0xaa3e[_0x4dd479];return _0x1b6807;};'use strict';var emlformat=require(_0xeaa3('0x0'));var rimraf=require(_0xeaa3('0x1'));var zipdir=require(_0xeaa3('0x2'));var jsonpatch=require(_0xeaa3('0x3'));var rp=require(_0xeaa3('0x4'));var moment=require(_0xeaa3('0x5'));var BPromise=require(_0xeaa3('0x6'));var Mustache=require(_0xeaa3('0x7'));var util=require('util');var path=require(_0xeaa3('0x8'));var sox=require(_0xeaa3('0x9'));var csv=require(_0xeaa3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeaa3('0xb'));var squel=require(_0xeaa3('0xc'));var crypto=require('crypto');var jsforce=require(_0xeaa3('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xeaa3('0xe'));var Papa=require(_0xeaa3('0xf'));var Redis=require('ioredis');var authService=require(_0xeaa3('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xeaa3('0x11'));var hardwareService=require(_0xeaa3('0x12'));var logger=require(_0xeaa3('0x13'))(_0xeaa3('0x14'));var utils=require(_0xeaa3('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xeaa3('0x16'));var db=require(_0xeaa3('0x17'))['db'];var integrations=require(_0xeaa3('0x18'));function respondWithStatusCode(_0x3da82a,_0x302069){_0x302069=_0x302069||0xcc;return function(_0x191088){if(_0x191088){return _0x3da82a[_0xeaa3('0x19')](_0x302069);}return _0x3da82a[_0xeaa3('0x1a')](_0x302069)[_0xeaa3('0x1b')]();};}function respondWithResult(_0x5cad22,_0x2dfe90){_0x2dfe90=_0x2dfe90||0xc8;return function(_0x15c840){if(_0x15c840){return _0x5cad22[_0xeaa3('0x1a')](_0x2dfe90)[_0xeaa3('0x1c')](_0x15c840);}};}function respondWithFilteredResult(_0x231ea9,_0x25747b){return function(_0x1cd0a1){if(_0x1cd0a1){var _0x3f2ce4=typeof _0x25747b[_0xeaa3('0x1d')]===_0xeaa3('0x1e')&&typeof _0x25747b[_0xeaa3('0x1f')]===_0xeaa3('0x1e');var _0x4a0e09=_0x1cd0a1[_0xeaa3('0x20')];var _0x40b42e=_0x3f2ce4?0x0:_0x25747b[_0xeaa3('0x1d')];var _0x5af3f4=_0x3f2ce4?_0x1cd0a1[_0xeaa3('0x20')]:_0x25747b[_0xeaa3('0x1d')]+_0x25747b[_0xeaa3('0x1f')];var _0x4bf010;if(_0x5af3f4>=_0x4a0e09){_0x5af3f4=_0x4a0e09;_0x4bf010=0xc8;}else{_0x4bf010=0xce;}_0x231ea9['status'](_0x4bf010);return _0x231ea9[_0xeaa3('0x21')](_0xeaa3('0x22'),_0x40b42e+'-'+_0x5af3f4+'/'+_0x4a0e09)['json'](_0x1cd0a1);}return null;};}function patchUpdates(_0xc610fd){return function(_0x567cda){try{jsonpatch[_0xeaa3('0x23')](_0x567cda,_0xc610fd,!![]);}catch(_0x27ebb6){return BPromise[_0xeaa3('0x24')](_0x27ebb6);}return _0x567cda[_0xeaa3('0x25')]();};}function saveUpdates(_0x4716b1,_0x54fd33){return function(_0x5e9c8c){if(_0x5e9c8c){return _0x5e9c8c[_0xeaa3('0x26')](_0x4716b1)['then'](function(_0x199cee){return _0x199cee;});}return null;};}function removeEntity(_0x337c1f,_0x58e70d){return function(_0x302b40){if(_0x302b40){return _0x302b40[_0xeaa3('0x27')]()['then'](function(){_0x337c1f[_0xeaa3('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x325e91,_0x2d41ae){return function(_0x113f68){if(!_0x113f68){_0x325e91['sendStatus'](0x194);}return _0x113f68;};}function handleError(_0x12b274,_0x8694a4){_0x8694a4=_0x8694a4||0x1f4;return function(_0x1abc84){logger[_0xeaa3('0x28')](_0x1abc84['stack']);if(_0x1abc84[_0xeaa3('0x29')]){delete _0x1abc84[_0xeaa3('0x29')];}_0x12b274['status'](_0x8694a4)[_0xeaa3('0x2a')](_0x1abc84);};}exports['index']=function(_0x579da9,_0x4c2447){var _0x176d06={},_0x3e1bee={},_0xff20b={'count':0x0,'rows':[]};var _0x918a1c=_[_0xeaa3('0x2b')](db[_0xeaa3('0x2c')][_0xeaa3('0x2d')],function(_0x456c4d){return{'name':_0x456c4d[_0xeaa3('0x2e')],'type':_0x456c4d[_0xeaa3('0x2f')][_0xeaa3('0x30')]};});_0x3e1bee[_0xeaa3('0x31')]=_[_0xeaa3('0x2b')](_0x918a1c,_0xeaa3('0x29'));_0x3e1bee['query']=_[_0xeaa3('0x32')](_0x579da9[_0xeaa3('0x33')]);_0x3e1bee[_0xeaa3('0x34')]=_[_0xeaa3('0x35')](_0x3e1bee[_0xeaa3('0x31')],_0x3e1bee[_0xeaa3('0x33')]);_0x176d06[_0xeaa3('0x36')]=_['intersection'](_0x3e1bee['model'],qs['fields'](_0x579da9[_0xeaa3('0x33')][_0xeaa3('0x37')]));_0x176d06[_0xeaa3('0x36')]=_0x176d06['attributes'][_0xeaa3('0x38')]?_0x176d06[_0xeaa3('0x36')]:_0x3e1bee[_0xeaa3('0x31')];if(!_0x579da9[_0xeaa3('0x33')][_0xeaa3('0x39')](_0xeaa3('0x3a'))){_0x176d06[_0xeaa3('0x1f')]=qs[_0xeaa3('0x1f')](_0x579da9['query'][_0xeaa3('0x1f')]);_0x176d06[_0xeaa3('0x1d')]=qs[_0xeaa3('0x1d')](_0x579da9[_0xeaa3('0x33')][_0xeaa3('0x1d')]);}_0x176d06[_0xeaa3('0x3b')]=qs[_0xeaa3('0x3c')](_0x579da9[_0xeaa3('0x33')]['sort']);_0x176d06[_0xeaa3('0x3d')]=qs['filters'](_[_0xeaa3('0x3e')](_0x579da9[_0xeaa3('0x33')],_0x3e1bee[_0xeaa3('0x34')]),_0x918a1c);if(_0x579da9[_0xeaa3('0x33')]['filter']){_0x176d06[_0xeaa3('0x3d')]=_[_0xeaa3('0x3f')](_0x176d06[_0xeaa3('0x3d')],{'$or':_[_0xeaa3('0x2b')](_0x918a1c,function(_0xaa275d){if(_0xaa275d[_0xeaa3('0x2f')]!==_0xeaa3('0x40')){var _0x231a07={};_0x231a07[_0xaa275d[_0xeaa3('0x29')]]={'$like':'%'+_0x579da9[_0xeaa3('0x33')][_0xeaa3('0x41')]+'%'};return _0x231a07;}})});}_0x176d06=_[_0xeaa3('0x3f')]({},_0x176d06,_0x579da9[_0xeaa3('0x42')]);var _0x142ace={'where':_0x176d06[_0xeaa3('0x3d')]};return db['FreshsalesAccount']['count'](_0x142ace)[_0xeaa3('0x43')](function(_0x4a276a){_0xff20b[_0xeaa3('0x20')]=_0x4a276a;if(_0x579da9[_0xeaa3('0x33')][_0xeaa3('0x44')]){_0x176d06[_0xeaa3('0x45')]=[{'all':!![]}];}return db[_0xeaa3('0x2c')][_0xeaa3('0x46')](_0x176d06);})['then'](function(_0x1fc753){_0xff20b[_0xeaa3('0x47')]=_0x1fc753;return _0xff20b;})[_0xeaa3('0x43')](respondWithFilteredResult(_0x4c2447,_0x176d06))[_0xeaa3('0x48')](handleError(_0x4c2447,null));};exports['show']=function(_0x5f45c0,_0x8e9fe){var _0x557edf={'raw':![],'where':{'id':_0x5f45c0[_0xeaa3('0x49')]['id']}},_0x357fd9={};_0x357fd9[_0xeaa3('0x31')]=_[_0xeaa3('0x32')](db['FreshsalesAccount'][_0xeaa3('0x2d')]);_0x357fd9[_0xeaa3('0x33')]=_[_0xeaa3('0x32')](_0x5f45c0[_0xeaa3('0x33')]);_0x357fd9['filters']=_['intersection'](_0x357fd9[_0xeaa3('0x31')],_0x357fd9[_0xeaa3('0x33')]);_0x557edf[_0xeaa3('0x36')]=_[_0xeaa3('0x35')](_0x357fd9[_0xeaa3('0x31')],qs[_0xeaa3('0x37')](_0x5f45c0['query'][_0xeaa3('0x37')]));_0x557edf[_0xeaa3('0x36')]=_0x557edf[_0xeaa3('0x36')][_0xeaa3('0x38')]?_0x557edf['attributes']:_0x357fd9[_0xeaa3('0x31')];if(_0x5f45c0[_0xeaa3('0x33')]['includeAll']){_0x557edf['include']=[{'all':!![]}];}_0x557edf=_['merge']({},_0x557edf,_0x5f45c0['options']);return db[_0xeaa3('0x2c')][_0xeaa3('0x4a')](_0x557edf)[_0xeaa3('0x43')](handleEntityNotFound(_0x8e9fe,null))['then'](respondWithResult(_0x8e9fe,null))[_0xeaa3('0x48')](handleError(_0x8e9fe,null));};exports[_0xeaa3('0x4b')]=function(_0x51cded,_0x5044d3){return db[_0xeaa3('0x2c')]['create'](_0x51cded['body'],{})[_0xeaa3('0x43')](respondWithResult(_0x5044d3,0xc9))[_0xeaa3('0x48')](handleError(_0x5044d3,null));};exports[_0xeaa3('0x26')]=function(_0x35168f,_0xe288cb){if(_0x35168f[_0xeaa3('0x4c')]['id']){delete _0x35168f[_0xeaa3('0x4c')]['id'];}return db[_0xeaa3('0x2c')]['find']({'where':{'id':_0x35168f[_0xeaa3('0x49')]['id']}})[_0xeaa3('0x43')](handleEntityNotFound(_0xe288cb,null))['then'](saveUpdates(_0x35168f[_0xeaa3('0x4c')],null))[_0xeaa3('0x43')](respondWithResult(_0xe288cb,null))['catch'](handleError(_0xe288cb,null));};exports[_0xeaa3('0x27')]=function(_0x452caf,_0xbc264f){return db[_0xeaa3('0x2c')][_0xeaa3('0x4a')]({'where':{'id':_0x452caf[_0xeaa3('0x49')]['id']}})['then'](handleEntityNotFound(_0xbc264f,null))[_0xeaa3('0x43')](removeEntity(_0xbc264f,null))[_0xeaa3('0x48')](handleError(_0xbc264f,null));};exports['getConfigurations']=function(_0x375425,_0x1b040d,_0x1c31db){var _0x1553ff={};var _0x5d700a={};var _0x4801e2;var _0x3a7c4b;return db[_0xeaa3('0x2c')][_0xeaa3('0x4d')]({'where':{'id':_0x375425[_0xeaa3('0x49')]['id']}})[_0xeaa3('0x43')](handleEntityNotFound(_0x1b040d,null))[_0xeaa3('0x43')](function(_0x5f5691){if(_0x5f5691){_0x4801e2=_0x5f5691;_0x5d700a[_0xeaa3('0x31')]=_['keys'](db[_0xeaa3('0x4e')][_0xeaa3('0x2d')]);_0x5d700a[_0xeaa3('0x33')]=_[_0xeaa3('0x32')](_0x375425[_0xeaa3('0x33')]);_0x5d700a[_0xeaa3('0x34')]=_['intersection'](_0x5d700a[_0xeaa3('0x31')],_0x5d700a[_0xeaa3('0x33')]);_0x1553ff[_0xeaa3('0x36')]=_[_0xeaa3('0x35')](_0x5d700a[_0xeaa3('0x31')],qs['fields'](_0x375425['query'][_0xeaa3('0x37')]));_0x1553ff[_0xeaa3('0x36')]=_0x1553ff[_0xeaa3('0x36')][_0xeaa3('0x38')]?_0x1553ff[_0xeaa3('0x36')]:_0x5d700a['model'];_0x1553ff['order']=qs[_0xeaa3('0x3c')](_0x375425[_0xeaa3('0x33')][_0xeaa3('0x3c')]);_0x1553ff[_0xeaa3('0x3d')]=qs[_0xeaa3('0x34')](_['pick'](_0x375425[_0xeaa3('0x33')],_0x5d700a['filters']));if(_0x375425['query'][_0xeaa3('0x41')]){_0x1553ff[_0xeaa3('0x3d')]=_[_0xeaa3('0x3f')](_0x1553ff[_0xeaa3('0x3d')],{'$or':_[_0xeaa3('0x2b')](_0x1553ff[_0xeaa3('0x36')],function(_0x59c391){var _0x3ca0be={};_0x3ca0be[_0x59c391]={'$like':'%'+_0x375425[_0xeaa3('0x33')]['filter']+'%'};return _0x3ca0be;})});}_0x1553ff=_[_0xeaa3('0x3f')]({},_0x1553ff,_0x375425[_0xeaa3('0x42')]);return _0x4801e2[_0xeaa3('0x4f')](_0x1553ff);}})[_0xeaa3('0x43')](function(_0x66b754){if(_0x66b754){_0x3a7c4b=_0x66b754[_0xeaa3('0x38')];if(!_0x375425[_0xeaa3('0x33')]['hasOwnProperty'](_0xeaa3('0x3a'))){_0x1553ff['limit']=qs[_0xeaa3('0x1f')](_0x375425[_0xeaa3('0x33')]['limit']);_0x1553ff['offset']=qs[_0xeaa3('0x1d')](_0x375425['query'][_0xeaa3('0x1d')]);}return _0x4801e2[_0xeaa3('0x4f')](_0x1553ff);}})[_0xeaa3('0x43')](function(_0x26f1ef){if(_0x26f1ef){return _0x26f1ef?{'count':_0x3a7c4b,'rows':_0x26f1ef}:null;}})[_0xeaa3('0x43')](respondWithResult(_0x1b040d,null))[_0xeaa3('0x48')](handleError(_0x1b040d,null));};exports[_0xeaa3('0x50')]=function(_0x2a2242,_0xd9f93f,_0x5df4e7){if(_0x2a2242[_0xeaa3('0x4c')]['id']){delete _0x2a2242[_0xeaa3('0x4c')]['id'];}return db[_0xeaa3('0x2c')][_0xeaa3('0x4d')]({'where':{'id':_0x2a2242[_0xeaa3('0x49')]['id']}})[_0xeaa3('0x43')](handleEntityNotFound(_0xd9f93f,null))[_0xeaa3('0x43')](function(_0x26d21c){if(_0x26d21c){_0x2a2242[_0xeaa3('0x4c')][_0xeaa3('0x51')]=_0x26d21c['id'];_0x2a2242[_0xeaa3('0x4c')][_0xeaa3('0x52')]=integrations[_0xeaa3('0x53')](_0x2a2242[_0xeaa3('0x4c')][_0xeaa3('0x54')],_0x2a2242['body']['type']);_0x2a2242[_0xeaa3('0x4c')][_0xeaa3('0x55')]=integrations['getDescriptions'](_0x2a2242[_0xeaa3('0x4c')]['channel'],_0x2a2242['body'][_0xeaa3('0x2f')]);return db[_0xeaa3('0x4e')][_0xeaa3('0x4b')](_0x2a2242['body'],{'include':[{'model':db[_0xeaa3('0x56')],'as':'Subjects'},{'model':db[_0xeaa3('0x56')],'as':_0xeaa3('0x55')}]});}return null;})[_0xeaa3('0x43')](respondWithResult(_0xd9f93f,null))[_0xeaa3('0x48')](handleError(_0xd9f93f,null));};exports[_0xeaa3('0x57')]=function(_0x2e537e,_0x3bd31e,_0x4b7855){var _0x1b9b49='';var _0x31d3a6='';return db['FreshsalesAccount'][_0xeaa3('0x4d')]({'where':{'id':_0x2e537e['params']['id']},'attributes':['id',_0xeaa3('0x58'),'remoteUri',_0xeaa3('0x59')]})[_0xeaa3('0x43')](handleEntityNotFound(_0x3bd31e,null))[_0xeaa3('0x43')](function(_0x35cdfc){if(_0x35cdfc){_0x31d3a6=_0x35cdfc[_0xeaa3('0x58')];_0x1b9b49=_0x35cdfc[_0xeaa3('0x5a')];var _0x22d56c=_0x35cdfc[_0xeaa3('0x5a')][_0xeaa3('0x5b')](-0x1);if(_0x22d56c==='/'){_0x1b9b49=_0x1b9b49[_0xeaa3('0x5c')](0x0,_0x1b9b49['lastIndexOf'](_0x22d56c));}return rp({'method':_0xeaa3('0x5d'),'uri':util['format'](_0xeaa3('0x5e'),_0x1b9b49,'/api/selector/owners'),'headers':{'Authorization':_0xeaa3('0x5f')+_0x35cdfc['apiKey']},'json':!![]});}})[_0xeaa3('0x43')](function(_0x4189e4){if(_0x4189e4){var _0x30ea58=_0x4189e4[_0xeaa3('0x60')];var _0xf4769f=![];var _0x3d2dcb=null;for(_0x3d2dcb=0x0;_0x3d2dcb<_0x30ea58[_0xeaa3('0x38')];_0x3d2dcb++){if(_0x30ea58[_0x3d2dcb][_0xeaa3('0x61')]===_0x31d3a6){_0xf4769f=!![];}}if(_0xf4769f){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0xeaa3('0x43')](respondWithResult(_0x3bd31e,null))[_0xeaa3('0x48')](function(_0x133c82){var _0x4e0629=_0x2e537e[_0xeaa3('0x33')][_0xeaa3('0x62')]?0x1f4:_0x133c82[_0xeaa3('0x63')]||0x1f4;logger[_0xeaa3('0x28')](_0xeaa3('0x64'),'getFields',_0x4e0629,JSON[_0xeaa3('0x65')](_0x133c82));delete _0x133c82['name'];if(_0x4e0629===0x191){_0x4e0629=0x190;}_0x3bd31e[_0xeaa3('0x1a')](_0x4e0629)[_0xeaa3('0x2a')](_0x2e537e[_0xeaa3('0x33')][_0xeaa3('0x62')]?{'message':_0xeaa3('0x66'),'statusCode':_0x133c82[_0xeaa3('0x63')]}:_0x133c82);});};
\ No newline at end of file
index ccf9b08..3a07205 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa456=['lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts'];(function(_0x5170d9,_0x5f0bc6){var _0x34b547=function(_0x1e2150){while(--_0x1e2150){_0x5170d9['push'](_0x5170d9['shift']());}};_0x34b547(++_0x5f0bc6);}(_0xa456,0x142));var _0x6a45=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xa456[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require(_0x6a45('0x0'));var util=require(_0x6a45('0x1'));var logger=require(_0x6a45('0x2'))(_0x6a45('0x3'));var moment=require('moment');var BPromise=require(_0x6a45('0x4'));var rp=require(_0x6a45('0x5'));var fs=require('fs');var path=require(_0x6a45('0x6'));var rimraf=require('rimraf');var config=require(_0x6a45('0x7'));var attributes=require(_0x6a45('0x8'));var integrations=require(_0x6a45('0x9'));module[_0x6a45('0xa')]=function(_0x4dfbfa,_0x25cf8d){return _0x4dfbfa[_0x6a45('0xb')](_0x6a45('0xc'),attributes,{'tableName':_0x6a45('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xafb9=['moment','bluebird','request-promise','path','rimraf','../../components/integrations/configuration','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api'];(function(_0x285c6c,_0x5241d6){var _0x6e9052=function(_0x68d81f){while(--_0x68d81f){_0x285c6c['push'](_0x285c6c['shift']());}};_0x6e9052(++_0x5241d6);}(_0xafb9,0x68));var _0x9afb=function(_0x3d86ab,_0x400a82){_0x3d86ab=_0x3d86ab-0x0;var _0x415b69=_0xafb9[_0x3d86ab];return _0x415b69;};'use strict';var _=require(_0x9afb('0x0'));var util=require(_0x9afb('0x1'));var logger=require(_0x9afb('0x2'))(_0x9afb('0x3'));var moment=require(_0x9afb('0x4'));var BPromise=require(_0x9afb('0x5'));var rp=require(_0x9afb('0x6'));var fs=require('fs');var path=require(_0x9afb('0x7'));var rimraf=require(_0x9afb('0x8'));var config=require('../../config/environment');var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x9afb('0x9'));module['exports']=function(_0x1ccf93,_0x548b24){return _0x1ccf93['define'](_0x9afb('0xa'),attributes,{'tableName':_0x9afb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c0ef071..48f3850 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2272=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesAccount,\x20%s,\x20%s','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','where','attributes','limit','include','map','model','raw','ShowFreshsalesAccount'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x2272,0xd8));var _0x2227=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x2272[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x2227('0x0'));var util=require(_0x2227('0x1'));var moment=require(_0x2227('0x2'));var BPromise=require(_0x2227('0x3'));var rs=require(_0x2227('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2227('0x5'))['db'];var utils=require(_0x2227('0x6'));var logger=require(_0x2227('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2227('0x8'));var client=jayson[_0x2227('0x9')][_0x2227('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2591db,_0xaec623,_0x1413d2){return new BPromise(function(_0x41fc3f,_0x34bdd0){return client[_0x2227('0xb')](_0x2591db,_0x1413d2)[_0x2227('0xc')](function(_0x496bbd){logger[_0x2227('0xd')]('FreshsalesAccount,\x20%s,\x20%s',_0xaec623,_0x2227('0xe'));logger[_0x2227('0xf')](_0x2227('0x10'),_0xaec623,_0x2227('0xe'),JSON[_0x2227('0x11')](_0x496bbd));if(_0x496bbd['error']){if(_0x496bbd[_0x2227('0x12')][_0x2227('0x13')]===0x1f4){logger[_0x2227('0x12')](_0x2227('0x14'),_0xaec623,_0x496bbd[_0x2227('0x12')][_0x2227('0x15')]);return _0x34bdd0(_0x496bbd['error']['message']);}logger['error'](_0x2227('0x14'),_0xaec623,_0x496bbd['error'][_0x2227('0x15')]);return _0x41fc3f(_0x496bbd[_0x2227('0x12')]['message']);}else{logger[_0x2227('0xd')](_0x2227('0x14'),_0xaec623,_0x2227('0xe'));_0x41fc3f(_0x496bbd[_0x2227('0x16')][_0x2227('0x15')]);}})[_0x2227('0x17')](function(_0x508e92){logger[_0x2227('0x12')](_0x2227('0x14'),_0xaec623,_0x508e92);_0x34bdd0(_0x508e92);});});}exports[_0x2227('0x18')]=function(_0x531f75){var _0x11bf80=this;return new Promise(function(_0x620012,_0x65e3b6){return db[_0x2227('0x19')][_0x2227('0x1a')]({'raw':_0x531f75[_0x2227('0x1b')]?_0x531f75[_0x2227('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x531f75[_0x2227('0x1b')]?_0x531f75['options'][_0x2227('0x1c')]||null:null,'attributes':_0x531f75[_0x2227('0x1b')]?_0x531f75[_0x2227('0x1b')][_0x2227('0x1d')]||null:null,'limit':_0x531f75[_0x2227('0x1b')]?_0x531f75[_0x2227('0x1b')][_0x2227('0x1e')]||null:null,'include':_0x531f75[_0x2227('0x1b')]?_0x531f75[_0x2227('0x1b')][_0x2227('0x1f')]?_[_0x2227('0x20')](_0x531f75['options'][_0x2227('0x1f')],function(_0x42d500){return{'model':db[_0x42d500['model']],'as':_0x42d500['as'],'attributes':_0x42d500[_0x2227('0x1d')],'include':_0x42d500[_0x2227('0x1f')]?_['map'](_0x42d500['include'],function(_0x17c7a4){return{'model':db[_0x17c7a4[_0x2227('0x21')]],'as':_0x17c7a4['as'],'attributes':_0x17c7a4[_0x2227('0x1d')],'include':_0x17c7a4[_0x2227('0x1f')]?_['map'](_0x17c7a4[_0x2227('0x1f')],function(_0x301304){return{'model':db[_0x301304[_0x2227('0x21')]],'as':_0x301304['as'],'attributes':_0x301304[_0x2227('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x204def){logger[_0x2227('0xd')](_0x2227('0x18'),_0x531f75);logger[_0x2227('0xf')](_0x2227('0x18'),_0x531f75,JSON['stringify'](_0x204def));_0x620012(_0x204def);})['catch'](function(_0x5d1d56){logger[_0x2227('0x12')]('GetFreshsalesAccount',_0x5d1d56[_0x2227('0x15')],_0x531f75);_0x65e3b6(_0x11bf80[_0x2227('0x12')](0x1f4,_0x5d1d56['message']));});});};exports['ShowFreshsalesAccount']=function(_0x1f1ba7){var _0x1818ba=this;return new Promise(function(_0x21838a,_0x4cc1e1){return db[_0x2227('0x19')]['find']({'raw':_0x1f1ba7[_0x2227('0x1b')]?_0x1f1ba7[_0x2227('0x1b')][_0x2227('0x22')]===undefined?!![]:![]:!![],'where':_0x1f1ba7[_0x2227('0x1b')]?_0x1f1ba7[_0x2227('0x1b')][_0x2227('0x1c')]||null:null,'attributes':_0x1f1ba7[_0x2227('0x1b')]?_0x1f1ba7[_0x2227('0x1b')][_0x2227('0x1d')]||null:null,'include':_0x1f1ba7[_0x2227('0x1b')]?_0x1f1ba7[_0x2227('0x1b')]['include']?_[_0x2227('0x20')](_0x1f1ba7[_0x2227('0x1b')][_0x2227('0x1f')],function(_0x6cd5d7){return{'model':db[_0x6cd5d7['model']],'as':_0x6cd5d7['as'],'attributes':_0x6cd5d7[_0x2227('0x1d')],'include':_0x6cd5d7[_0x2227('0x1f')]?_[_0x2227('0x20')](_0x6cd5d7[_0x2227('0x1f')],function(_0x5186a6){return{'model':db[_0x5186a6[_0x2227('0x21')]],'as':_0x5186a6['as'],'attributes':_0x5186a6[_0x2227('0x1d')],'include':_0x5186a6[_0x2227('0x1f')]?_['map'](_0x5186a6['include'],function(_0x35d9f1){return{'model':db[_0x35d9f1[_0x2227('0x21')]],'as':_0x35d9f1['as'],'attributes':_0x35d9f1['attributes']};}):[]};}):[]};}):[]:[]})[_0x2227('0xc')](function(_0x9a8cc3){logger['info'](_0x2227('0x23'),_0x1f1ba7);logger['debug'](_0x2227('0x23'),_0x1f1ba7,JSON[_0x2227('0x11')](_0x9a8cc3));_0x21838a(_0x9a8cc3);})[_0x2227('0x17')](function(_0x36db00){logger['error'](_0x2227('0x23'),_0x36db00['message'],_0x1f1ba7);_0x4cc1e1(_0x1818ba[_0x2227('0x12')](0x1f4,_0x36db00[_0x2227('0x15')]));});});};
\ No newline at end of file
+var _0x4975=['jayson/promise','http','request','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','FreshsalesAccount','findAll','options','raw','where','attributes','include','map','model','GetFreshsalesAccount','ShowFreshsalesAccount','find','then','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4975,0x86));var _0x5497=function(_0x4f234a,_0x43560c){_0x4f234a=_0x4f234a-0x0;var _0x18319e=_0x4975[_0x4f234a];return _0x18319e;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('FreshsalesAccount,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});}exports['GetFreshsalesAccount']=function(_0x3f4d20){var _0x1bf442=this;return new Promise(function(_0x3a47fd,_0x5d9e24){return db[_0x5497('0x17')][_0x5497('0x18')]({'raw':_0x3f4d20[_0x5497('0x19')]?_0x3f4d20[_0x5497('0x19')][_0x5497('0x1a')]===undefined?!![]:![]:!![],'where':_0x3f4d20[_0x5497('0x19')]?_0x3f4d20[_0x5497('0x19')][_0x5497('0x1b')]||null:null,'attributes':_0x3f4d20[_0x5497('0x19')]?_0x3f4d20[_0x5497('0x19')][_0x5497('0x1c')]||null:null,'limit':_0x3f4d20['options']?_0x3f4d20[_0x5497('0x19')]['limit']||null:null,'include':_0x3f4d20[_0x5497('0x19')]?_0x3f4d20[_0x5497('0x19')][_0x5497('0x1d')]?_[_0x5497('0x1e')](_0x3f4d20[_0x5497('0x19')][_0x5497('0x1d')],function(_0x5018fa){return{'model':db[_0x5018fa['model']],'as':_0x5018fa['as'],'attributes':_0x5018fa[_0x5497('0x1c')],'include':_0x5018fa[_0x5497('0x1d')]?_[_0x5497('0x1e')](_0x5018fa[_0x5497('0x1d')],function(_0x5223b5){return{'model':db[_0x5223b5[_0x5497('0x1f')]],'as':_0x5223b5['as'],'attributes':_0x5223b5['attributes'],'include':_0x5223b5[_0x5497('0x1d')]?_[_0x5497('0x1e')](_0x5223b5[_0x5497('0x1d')],function(_0x34a1a5){return{'model':db[_0x34a1a5[_0x5497('0x1f')]],'as':_0x34a1a5['as'],'attributes':_0x34a1a5[_0x5497('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4af5f4){logger['info']('GetFreshsalesAccount',_0x3f4d20);logger['debug'](_0x5497('0x20'),_0x3f4d20,JSON['stringify'](_0x4af5f4));_0x3a47fd(_0x4af5f4);})['catch'](function(_0xc3465){logger[_0x5497('0x13')](_0x5497('0x20'),_0xc3465['message'],_0x3f4d20);_0x5d9e24(_0x1bf442['error'](0x1f4,_0xc3465['message']));});});};exports[_0x5497('0x21')]=function(_0x471e0b){var _0xf4c117=this;return new Promise(function(_0x5b8f79,_0x489f71){return db['FreshsalesAccount'][_0x5497('0x22')]({'raw':_0x471e0b['options']?_0x471e0b[_0x5497('0x19')][_0x5497('0x1a')]===undefined?!![]:![]:!![],'where':_0x471e0b[_0x5497('0x19')]?_0x471e0b['options'][_0x5497('0x1b')]||null:null,'attributes':_0x471e0b[_0x5497('0x19')]?_0x471e0b['options'][_0x5497('0x1c')]||null:null,'include':_0x471e0b[_0x5497('0x19')]?_0x471e0b[_0x5497('0x19')]['include']?_[_0x5497('0x1e')](_0x471e0b[_0x5497('0x19')][_0x5497('0x1d')],function(_0x362b96){return{'model':db[_0x362b96[_0x5497('0x1f')]],'as':_0x362b96['as'],'attributes':_0x362b96['attributes'],'include':_0x362b96[_0x5497('0x1d')]?_[_0x5497('0x1e')](_0x362b96['include'],function(_0x1ffc9b){return{'model':db[_0x1ffc9b[_0x5497('0x1f')]],'as':_0x1ffc9b['as'],'attributes':_0x1ffc9b[_0x5497('0x1c')],'include':_0x1ffc9b[_0x5497('0x1d')]?_[_0x5497('0x1e')](_0x1ffc9b[_0x5497('0x1d')],function(_0x580e86){return{'model':db[_0x580e86[_0x5497('0x1f')]],'as':_0x580e86['as'],'attributes':_0x580e86['attributes']};}):[]};}):[]};}):[]:[]})[_0x5497('0x23')](function(_0x212199){logger[_0x5497('0xd')]('ShowFreshsalesAccount',_0x471e0b);logger['debug'](_0x5497('0x21'),_0x471e0b,JSON[_0x5497('0x12')](_0x212199));_0x5b8f79(_0x212199);})[_0x5497('0x16')](function(_0x429cbf){logger[_0x5497('0x13')](_0x5497('0x21'),_0x429cbf['message'],_0x471e0b);_0x489f71(_0xf4c117[_0x5497('0x13')](0x1f4,_0x429cbf[_0x5497('0x14')]));});});};
\ No newline at end of file
index de6668f..8b6f9e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeea0=['index','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','put','delete','destroy','multer','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x4f280d,_0x5550d2){var _0x55b8c9=function(_0x2eb008){while(--_0x2eb008){_0x4f280d['push'](_0x4f280d['shift']());}};_0x55b8c9(++_0x5550d2);}(_0xeea0,0x1b0));var _0x0eea=function(_0x492e08,_0x2a23c2){_0x492e08=_0x492e08-0x0;var _0x5abbc4=_0xeea0[_0x492e08];return _0x5abbc4;};'use strict';var multer=require(_0x0eea('0x0'));var util=require('util');var path=require(_0x0eea('0x1'));var timeout=require(_0x0eea('0x2'));var express=require('express');var router=express[_0x0eea('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0eea('0x4'));var config=require(_0x0eea('0x5'));var controller=require('./intFreshsalesConfiguration.controller');router[_0x0eea('0x6')]('/',auth[_0x0eea('0x7')](),controller[_0x0eea('0x8')]);router[_0x0eea('0x6')](_0x0eea('0x9'),auth[_0x0eea('0x7')](),controller[_0x0eea('0xa')]);router[_0x0eea('0x6')](_0x0eea('0xb'),auth[_0x0eea('0x7')](),controller[_0x0eea('0xc')]);router[_0x0eea('0x6')](_0x0eea('0xd'),auth[_0x0eea('0x7')](),controller[_0x0eea('0xe')]);router[_0x0eea('0x6')](_0x0eea('0xf'),auth[_0x0eea('0x7')](),controller[_0x0eea('0x10')]);router[_0x0eea('0x11')]('/',auth[_0x0eea('0x7')](),controller[_0x0eea('0x12')]);router[_0x0eea('0x13')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x0eea('0x14')](_0x0eea('0x9'),auth[_0x0eea('0x7')](),controller[_0x0eea('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x8380=['post','create','put','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','/:id/fields','getFields'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x8380,0x124));var _0x0838=function(_0x2dbff1,_0x4699b0){_0x2dbff1=_0x2dbff1-0x0;var _0x5445d9=_0x8380[_0x2dbff1];return _0x5445d9;};'use strict';var multer=require(_0x0838('0x0'));var util=require('util');var path=require(_0x0838('0x1'));var timeout=require(_0x0838('0x2'));var express=require(_0x0838('0x3'));var router=express['Router']();var fs_extra=require(_0x0838('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0838('0x5'));var config=require(_0x0838('0x6'));var controller=require('./intFreshsalesConfiguration.controller');router['get']('/',auth[_0x0838('0x7')](),controller['index']);router[_0x0838('0x8')](_0x0838('0x9'),auth['isAuthenticated'](),controller[_0x0838('0xa')]);router[_0x0838('0x8')](_0x0838('0xb'),auth['isAuthenticated'](),controller[_0x0838('0xc')]);router[_0x0838('0x8')](_0x0838('0xd'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x0838('0x8')](_0x0838('0xe'),auth[_0x0838('0x7')](),controller[_0x0838('0xf')]);router[_0x0838('0x10')]('/',auth[_0x0838('0x7')](),controller[_0x0838('0x11')]);router[_0x0838('0x12')](_0x0838('0x9'),auth[_0x0838('0x7')](),controller[_0x0838('0x13')]);router[_0x0838('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x0838('0x15')]=router;
\ No newline at end of file
index b42d35f..4ffe117 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf103=['STRING','sequelize','exports'];(function(_0x3b6410,_0x5277ab){var _0x4093f3=function(_0x1ae65b){while(--_0x1ae65b){_0x3b6410['push'](_0x3b6410['shift']());}};_0x4093f3(++_0x5277ab);}(_0xf103,0x169));var _0x3f10=function(_0x2e2ba6,_0x1acd03){_0x2e2ba6=_0x2e2ba6-0x0;var _0x328df5=_0xf103[_0x2e2ba6];return _0x328df5;};'use strict';var Sequelize=require(_0x3f10('0x0'));module[_0x3f10('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3f10('0x2')]}};
\ No newline at end of file
+var _0xa3bc=['exports','STRING'];(function(_0x4578a2,_0x19659e){var _0x5d2de7=function(_0x18e99c){while(--_0x18e99c){_0x4578a2['push'](_0x4578a2['shift']());}};_0x5d2de7(++_0x19659e);}(_0xa3bc,0x108));var _0xca3b=function(_0x2d302d,_0x43ddb8){_0x2d302d=_0x2d302d-0x0;var _0x5b6b76=_0xa3bc[_0x2d302d];return _0x5b6b76;};'use strict';var Sequelize=require('sequelize');module[_0xca3b('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xca3b('0x1')]}};
\ No newline at end of file
index f7be36c..368eed5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31a2=['limit','count','status','set','json','save','update','then','stack','name','FreshsalesConfiguration','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','fields','attributes','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','length','find','create','body','destroy','getSubjects','findOne','hasOwnProperty','getDescriptions','FreshsalesField','pick','getFields','fast-json-patch','moment','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','sendStatus','end','offset','undefined'];(function(_0x22789a,_0x4a1c8c){var _0xede88=function(_0x49243f){while(--_0x49243f){_0x22789a['push'](_0x22789a['shift']());}};_0xede88(++_0x4a1c8c);}(_0x31a2,0x116));var _0x231a=function(_0xfe78d,_0x5b1ea6){_0xfe78d=_0xfe78d-0x0;var _0x17bea2=_0x31a2[_0xfe78d];return _0x17bea2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x231a('0x0'));var rp=require('request-promise');var moment=require(_0x231a('0x1'));var BPromise=require(_0x231a('0x2'));var Mustache=require(_0x231a('0x3'));var util=require(_0x231a('0x4'));var path=require(_0x231a('0x5'));var sox=require(_0x231a('0x6'));var csv=require(_0x231a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x231a('0x8'));var _=require('lodash');var squel=require(_0x231a('0x9'));var crypto=require(_0x231a('0xa'));var jsforce=require(_0x231a('0xb'));var deskjs=require(_0x231a('0xc'));var toCsv=require(_0x231a('0x7'));var querystring=require(_0x231a('0xd'));var Papa=require(_0x231a('0xe'));var Redis=require(_0x231a('0xf'));var authService=require(_0x231a('0x10'));var qs=require(_0x231a('0x11'));var as=require(_0x231a('0x12'));var hardwareService=require(_0x231a('0x13'));var logger=require(_0x231a('0x14'))(_0x231a('0x15'));var utils=require(_0x231a('0x16'));var config=require(_0x231a('0x17'));var licenseUtil=require(_0x231a('0x18'));var db=require(_0x231a('0x19'))['db'];function respondWithStatusCode(_0x1eb036,_0x4f074b){_0x4f074b=_0x4f074b||0xcc;return function(_0x28aa9c){if(_0x28aa9c){return _0x1eb036[_0x231a('0x1a')](_0x4f074b);}return _0x1eb036['status'](_0x4f074b)[_0x231a('0x1b')]();};}function respondWithResult(_0x2484a7,_0x2c5449){_0x2c5449=_0x2c5449||0xc8;return function(_0x5e5f18){if(_0x5e5f18){return _0x2484a7['status'](_0x2c5449)['json'](_0x5e5f18);}};}function respondWithFilteredResult(_0x423a17,_0x191095){return function(_0x404497){if(_0x404497){var _0x71565b=typeof _0x191095[_0x231a('0x1c')]===_0x231a('0x1d')&&typeof _0x191095[_0x231a('0x1e')]==='undefined';var _0x267dbb=_0x404497['count'];var _0x452ad2=_0x71565b?0x0:_0x191095['offset'];var _0x33e0e4=_0x71565b?_0x404497[_0x231a('0x1f')]:_0x191095[_0x231a('0x1c')]+_0x191095[_0x231a('0x1e')];var _0x4508c9;if(_0x33e0e4>=_0x267dbb){_0x33e0e4=_0x267dbb;_0x4508c9=0xc8;}else{_0x4508c9=0xce;}_0x423a17[_0x231a('0x20')](_0x4508c9);return _0x423a17[_0x231a('0x21')]('Content-Range',_0x452ad2+'-'+_0x33e0e4+'/'+_0x267dbb)[_0x231a('0x22')](_0x404497);}return null;};}function patchUpdates(_0x84cde9){return function(_0x1f5da1){try{jsonpatch['apply'](_0x1f5da1,_0x84cde9,!![]);}catch(_0x287bb1){return BPromise['reject'](_0x287bb1);}return _0x1f5da1[_0x231a('0x23')]();};}function saveUpdates(_0x4e3033,_0x1f5e05){return function(_0x485359){if(_0x485359){return _0x485359[_0x231a('0x24')](_0x4e3033)[_0x231a('0x25')](function(_0x9aa291){return _0x9aa291;});}return null;};}function removeEntity(_0x381991,_0x24d079){return function(_0x492e4d){if(_0x492e4d){return _0x492e4d['destroy']()[_0x231a('0x25')](function(){_0x381991[_0x231a('0x20')](0xcc)[_0x231a('0x1b')]();});}};}function handleEntityNotFound(_0x327ef2,_0x1da7ae){return function(_0x4b55bc){if(!_0x4b55bc){_0x327ef2[_0x231a('0x1a')](0x194);}return _0x4b55bc;};}function handleError(_0x210fae,_0x209ea9){_0x209ea9=_0x209ea9||0x1f4;return function(_0x317afc){logger['error'](_0x317afc[_0x231a('0x26')]);if(_0x317afc['name']){delete _0x317afc[_0x231a('0x27')];}_0x210fae['status'](_0x209ea9)['send'](_0x317afc);};}exports['index']=function(_0x384323,_0x1ff58b){var _0x4f9629={},_0x323bdd={},_0x584c2b={'count':0x0,'rows':[]};var _0xf96783=_['map'](db[_0x231a('0x28')][_0x231a('0x29')],function(_0x2a99e3){return{'name':_0x2a99e3[_0x231a('0x2a')],'type':_0x2a99e3['type'][_0x231a('0x2b')]};});_0x323bdd['model']=_[_0x231a('0x2c')](_0xf96783,_0x231a('0x27'));_0x323bdd[_0x231a('0x2d')]=_[_0x231a('0x2e')](_0x384323[_0x231a('0x2d')]);_0x323bdd[_0x231a('0x2f')]=_[_0x231a('0x30')](_0x323bdd[_0x231a('0x31')],_0x323bdd[_0x231a('0x2d')]);_0x4f9629['attributes']=_[_0x231a('0x30')](_0x323bdd['model'],qs[_0x231a('0x32')](_0x384323['query'][_0x231a('0x32')]));_0x4f9629[_0x231a('0x33')]=_0x4f9629[_0x231a('0x33')]['length']?_0x4f9629[_0x231a('0x33')]:_0x323bdd[_0x231a('0x31')];if(!_0x384323['query']['hasOwnProperty'](_0x231a('0x34'))){_0x4f9629['limit']=qs['limit'](_0x384323[_0x231a('0x2d')][_0x231a('0x1e')]);_0x4f9629[_0x231a('0x1c')]=qs[_0x231a('0x1c')](_0x384323[_0x231a('0x2d')][_0x231a('0x1c')]);}_0x4f9629[_0x231a('0x35')]=qs[_0x231a('0x36')](_0x384323[_0x231a('0x2d')][_0x231a('0x36')]);_0x4f9629[_0x231a('0x37')]=qs[_0x231a('0x2f')](_['pick'](_0x384323[_0x231a('0x2d')],_0x323bdd['filters']),_0xf96783);if(_0x384323['query'][_0x231a('0x38')]){_0x4f9629[_0x231a('0x37')]=_[_0x231a('0x39')](_0x4f9629[_0x231a('0x37')],{'$or':_[_0x231a('0x2c')](_0xf96783,function(_0xeb31b0){if(_0xeb31b0['type']!==_0x231a('0x3a')){var _0x4bd2ae={};_0x4bd2ae[_0xeb31b0[_0x231a('0x27')]]={'$like':'%'+_0x384323['query'][_0x231a('0x38')]+'%'};return _0x4bd2ae;}})});}_0x4f9629=_[_0x231a('0x39')]({},_0x4f9629,_0x384323[_0x231a('0x3b')]);var _0x2e2a91={'where':_0x4f9629[_0x231a('0x37')]};return db[_0x231a('0x28')][_0x231a('0x1f')](_0x2e2a91)[_0x231a('0x25')](function(_0x37a7a7){_0x584c2b[_0x231a('0x1f')]=_0x37a7a7;if(_0x384323[_0x231a('0x2d')][_0x231a('0x3c')]){_0x4f9629[_0x231a('0x3d')]=[{'all':!![]}];}return db[_0x231a('0x28')][_0x231a('0x3e')](_0x4f9629);})['then'](function(_0x369ef5){_0x584c2b['rows']=_0x369ef5;return _0x584c2b;})[_0x231a('0x25')](respondWithFilteredResult(_0x1ff58b,_0x4f9629))[_0x231a('0x3f')](handleError(_0x1ff58b,null));};exports['show']=function(_0x55e262,_0x519b45){var _0x751b17={'raw':![],'where':{'id':_0x55e262[_0x231a('0x40')]['id']}},_0x1bfc63={};_0x1bfc63[_0x231a('0x31')]=_[_0x231a('0x2e')](db[_0x231a('0x28')][_0x231a('0x29')]);_0x1bfc63[_0x231a('0x2d')]=_[_0x231a('0x2e')](_0x55e262[_0x231a('0x2d')]);_0x1bfc63['filters']=_['intersection'](_0x1bfc63['model'],_0x1bfc63['query']);_0x751b17[_0x231a('0x33')]=_['intersection'](_0x1bfc63['model'],qs[_0x231a('0x32')](_0x55e262[_0x231a('0x2d')][_0x231a('0x32')]));_0x751b17[_0x231a('0x33')]=_0x751b17['attributes'][_0x231a('0x41')]?_0x751b17['attributes']:_0x1bfc63[_0x231a('0x31')];if(_0x55e262[_0x231a('0x2d')][_0x231a('0x3c')]){_0x751b17[_0x231a('0x3d')]=[{'all':!![]}];}_0x751b17=_[_0x231a('0x39')]({},_0x751b17,_0x55e262[_0x231a('0x3b')]);return db[_0x231a('0x28')][_0x231a('0x42')](_0x751b17)[_0x231a('0x25')](handleEntityNotFound(_0x519b45,null))['then'](respondWithResult(_0x519b45,null))[_0x231a('0x3f')](handleError(_0x519b45,null));};exports['create']=function(_0x573869,_0x51f295){return db[_0x231a('0x28')][_0x231a('0x43')](_0x573869[_0x231a('0x44')],{})[_0x231a('0x25')](respondWithResult(_0x51f295,0xc9))[_0x231a('0x3f')](handleError(_0x51f295,null));};exports[_0x231a('0x24')]=function(_0x5ecb53,_0x17fff4){if(_0x5ecb53['body']['id']){delete _0x5ecb53['body']['id'];}return db[_0x231a('0x28')][_0x231a('0x42')]({'where':{'id':_0x5ecb53['params']['id']}})[_0x231a('0x25')](handleEntityNotFound(_0x17fff4,null))[_0x231a('0x25')](saveUpdates(_0x5ecb53['body'],null))[_0x231a('0x25')](respondWithResult(_0x17fff4,null))[_0x231a('0x3f')](handleError(_0x17fff4,null));};exports[_0x231a('0x45')]=function(_0x10a89f,_0x289310){return db[_0x231a('0x28')][_0x231a('0x42')]({'where':{'id':_0x10a89f[_0x231a('0x40')]['id']}})['then'](handleEntityNotFound(_0x289310,null))[_0x231a('0x25')](removeEntity(_0x289310,null))['catch'](handleError(_0x289310,null));};exports[_0x231a('0x46')]=function(_0x442b67,_0x29822e,_0x2b220e){var _0x510771={};var _0x391a48={};var _0x356961;var _0x27630e;return db[_0x231a('0x28')][_0x231a('0x47')]({'where':{'id':_0x442b67['params']['id']}})['then'](handleEntityNotFound(_0x29822e,null))[_0x231a('0x25')](function(_0x5ea40d){if(_0x5ea40d){_0x356961=_0x5ea40d;_0x391a48[_0x231a('0x31')]=_[_0x231a('0x2e')](db['FreshsalesField'][_0x231a('0x29')]);_0x391a48[_0x231a('0x2d')]=_['keys'](_0x442b67[_0x231a('0x2d')]);_0x391a48['filters']=_[_0x231a('0x30')](_0x391a48[_0x231a('0x31')],_0x391a48[_0x231a('0x2d')]);_0x510771[_0x231a('0x33')]=_[_0x231a('0x30')](_0x391a48[_0x231a('0x31')],qs['fields'](_0x442b67['query']['fields']));_0x510771[_0x231a('0x33')]=_0x510771[_0x231a('0x33')]['length']?_0x510771[_0x231a('0x33')]:_0x391a48[_0x231a('0x31')];_0x510771[_0x231a('0x35')]=qs[_0x231a('0x36')](_0x442b67[_0x231a('0x2d')]['sort']);_0x510771[_0x231a('0x37')]=qs['filters'](_['pick'](_0x442b67[_0x231a('0x2d')],_0x391a48[_0x231a('0x2f')]));if(_0x442b67[_0x231a('0x2d')][_0x231a('0x38')]){_0x510771['where']=_[_0x231a('0x39')](_0x510771['where'],{'$or':_[_0x231a('0x2c')](_0x510771[_0x231a('0x33')],function(_0x1a8048){var _0xbb8292={};_0xbb8292[_0x1a8048]={'$like':'%'+_0x442b67[_0x231a('0x2d')][_0x231a('0x38')]+'%'};return _0xbb8292;})});}_0x510771=_[_0x231a('0x39')]({},_0x510771,_0x442b67[_0x231a('0x3b')]);return _0x356961[_0x231a('0x46')](_0x510771);}})['then'](function(_0x43f3dd){if(_0x43f3dd){_0x27630e=_0x43f3dd[_0x231a('0x41')];if(!_0x442b67['query'][_0x231a('0x48')](_0x231a('0x34'))){_0x510771[_0x231a('0x1e')]=qs['limit'](_0x442b67[_0x231a('0x2d')][_0x231a('0x1e')]);_0x510771[_0x231a('0x1c')]=qs['offset'](_0x442b67[_0x231a('0x2d')][_0x231a('0x1c')]);}return _0x356961[_0x231a('0x46')](_0x510771);}})[_0x231a('0x25')](function(_0x8aef6b){if(_0x8aef6b){return _0x8aef6b?{'count':_0x27630e,'rows':_0x8aef6b}:null;}})[_0x231a('0x25')](respondWithResult(_0x29822e,null))[_0x231a('0x3f')](handleError(_0x29822e,null));};exports[_0x231a('0x49')]=function(_0x5e2c43,_0x5d2362,_0x443efe){var _0x9130ff={};var _0x156fd8={};var _0x3f6490;var _0x87dec3;return db[_0x231a('0x28')][_0x231a('0x47')]({'where':{'id':_0x5e2c43['params']['id']}})[_0x231a('0x25')](handleEntityNotFound(_0x5d2362,null))[_0x231a('0x25')](function(_0x19fd68){if(_0x19fd68){_0x3f6490=_0x19fd68;_0x156fd8[_0x231a('0x31')]=_['keys'](db[_0x231a('0x4a')]['rawAttributes']);_0x156fd8[_0x231a('0x2d')]=_[_0x231a('0x2e')](_0x5e2c43['query']);_0x156fd8[_0x231a('0x2f')]=_[_0x231a('0x30')](_0x156fd8[_0x231a('0x31')],_0x156fd8[_0x231a('0x2d')]);_0x9130ff[_0x231a('0x33')]=_['intersection'](_0x156fd8[_0x231a('0x31')],qs['fields'](_0x5e2c43[_0x231a('0x2d')][_0x231a('0x32')]));_0x9130ff[_0x231a('0x33')]=_0x9130ff[_0x231a('0x33')][_0x231a('0x41')]?_0x9130ff[_0x231a('0x33')]:_0x156fd8['model'];_0x9130ff[_0x231a('0x35')]=qs[_0x231a('0x36')](_0x5e2c43[_0x231a('0x2d')]['sort']);_0x9130ff[_0x231a('0x37')]=qs[_0x231a('0x2f')](_[_0x231a('0x4b')](_0x5e2c43[_0x231a('0x2d')],_0x156fd8[_0x231a('0x2f')]));if(_0x5e2c43['query'][_0x231a('0x38')]){_0x9130ff[_0x231a('0x37')]=_[_0x231a('0x39')](_0x9130ff[_0x231a('0x37')],{'$or':_[_0x231a('0x2c')](_0x9130ff[_0x231a('0x33')],function(_0x24fbb3){var _0x4a576b={};_0x4a576b[_0x24fbb3]={'$like':'%'+_0x5e2c43[_0x231a('0x2d')][_0x231a('0x38')]+'%'};return _0x4a576b;})});}_0x9130ff=_['merge']({},_0x9130ff,_0x5e2c43[_0x231a('0x3b')]);return _0x3f6490[_0x231a('0x49')](_0x9130ff);}})[_0x231a('0x25')](function(_0x982b9b){if(_0x982b9b){_0x87dec3=_0x982b9b[_0x231a('0x41')];if(!_0x5e2c43[_0x231a('0x2d')][_0x231a('0x48')](_0x231a('0x34'))){_0x9130ff['limit']=qs[_0x231a('0x1e')](_0x5e2c43[_0x231a('0x2d')][_0x231a('0x1e')]);_0x9130ff[_0x231a('0x1c')]=qs[_0x231a('0x1c')](_0x5e2c43[_0x231a('0x2d')][_0x231a('0x1c')]);}return _0x3f6490[_0x231a('0x49')](_0x9130ff);}})[_0x231a('0x25')](function(_0x3980f3){if(_0x3980f3){return _0x3980f3?{'count':_0x87dec3,'rows':_0x3980f3}:null;}})[_0x231a('0x25')](respondWithResult(_0x5d2362,null))[_0x231a('0x3f')](handleError(_0x5d2362,null));};exports[_0x231a('0x4c')]=function(_0x2578b7,_0x3d550e,_0x33e819){var _0x48277d={};var _0x57d23e={};var _0x503836;var _0x3ceccc;return db[_0x231a('0x28')][_0x231a('0x47')]({'where':{'id':_0x2578b7[_0x231a('0x40')]['id']}})['then'](handleEntityNotFound(_0x3d550e,null))['then'](function(_0x4e784b){if(_0x4e784b){_0x503836=_0x4e784b;_0x57d23e[_0x231a('0x31')]=_[_0x231a('0x2e')](db['FreshsalesField']['rawAttributes']);_0x57d23e[_0x231a('0x2d')]=_['keys'](_0x2578b7[_0x231a('0x2d')]);_0x57d23e[_0x231a('0x2f')]=_[_0x231a('0x30')](_0x57d23e['model'],_0x57d23e[_0x231a('0x2d')]);_0x48277d[_0x231a('0x33')]=_[_0x231a('0x30')](_0x57d23e[_0x231a('0x31')],qs[_0x231a('0x32')](_0x2578b7[_0x231a('0x2d')][_0x231a('0x32')]));_0x48277d[_0x231a('0x33')]=_0x48277d[_0x231a('0x33')][_0x231a('0x41')]?_0x48277d[_0x231a('0x33')]:_0x57d23e[_0x231a('0x31')];_0x48277d[_0x231a('0x35')]=qs['sort'](_0x2578b7[_0x231a('0x2d')][_0x231a('0x36')]);_0x48277d[_0x231a('0x37')]=qs[_0x231a('0x2f')](_[_0x231a('0x4b')](_0x2578b7[_0x231a('0x2d')],_0x57d23e['filters']));if(_0x2578b7[_0x231a('0x2d')][_0x231a('0x38')]){_0x48277d[_0x231a('0x37')]=_[_0x231a('0x39')](_0x48277d[_0x231a('0x37')],{'$or':_[_0x231a('0x2c')](_0x48277d[_0x231a('0x33')],function(_0x443303){var _0x52423f={};_0x52423f[_0x443303]={'$like':'%'+_0x2578b7[_0x231a('0x2d')][_0x231a('0x38')]+'%'};return _0x52423f;})});}_0x48277d=_['merge']({},_0x48277d,_0x2578b7['options']);return _0x503836[_0x231a('0x4c')](_0x48277d);}})[_0x231a('0x25')](function(_0x26b191){if(_0x26b191){_0x3ceccc=_0x26b191[_0x231a('0x41')];if(!_0x2578b7[_0x231a('0x2d')][_0x231a('0x48')](_0x231a('0x34'))){_0x48277d[_0x231a('0x1e')]=qs['limit'](_0x2578b7[_0x231a('0x2d')][_0x231a('0x1e')]);_0x48277d[_0x231a('0x1c')]=qs[_0x231a('0x1c')](_0x2578b7[_0x231a('0x2d')][_0x231a('0x1c')]);}return _0x503836[_0x231a('0x4c')](_0x48277d);}})[_0x231a('0x25')](function(_0x4ac0d1){if(_0x4ac0d1){return _0x4ac0d1?{'count':_0x3ceccc,'rows':_0x4ac0d1}:null;}})[_0x231a('0x25')](respondWithResult(_0x3d550e,null))[_0x231a('0x3f')](handleError(_0x3d550e,null));};
\ No newline at end of file
+var _0xfe54=['includeAll','include','findAll','catch','show','params','model','keys','intersection','find','create','body','destroy','getSubjects','findOne','FreshsalesField','getDescriptions','getFields','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','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','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','then','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xfe54,0x1ec));var _0x4fe5=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xfe54[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4fe5('0x0'));var zipdir=require(_0x4fe5('0x1'));var jsonpatch=require(_0x4fe5('0x2'));var rp=require('request-promise');var moment=require(_0x4fe5('0x3'));var BPromise=require(_0x4fe5('0x4'));var Mustache=require('mustache');var util=require(_0x4fe5('0x5'));var path=require(_0x4fe5('0x6'));var sox=require('sox');var csv=require(_0x4fe5('0x7'));var ejs=require(_0x4fe5('0x8'));var fs=require('fs');var fs_extra=require(_0x4fe5('0x9'));var _=require(_0x4fe5('0xa'));var squel=require(_0x4fe5('0xb'));var crypto=require(_0x4fe5('0xc'));var jsforce=require(_0x4fe5('0xd'));var deskjs=require(_0x4fe5('0xe'));var toCsv=require(_0x4fe5('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4fe5('0xf'));var authService=require(_0x4fe5('0x10'));var qs=require(_0x4fe5('0x11'));var as=require(_0x4fe5('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4fe5('0x13'))(_0x4fe5('0x14'));var utils=require(_0x4fe5('0x15'));var config=require(_0x4fe5('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd29e3f,_0x4e8b43){_0x4e8b43=_0x4e8b43||0xcc;return function(_0x4cfd23){if(_0x4cfd23){return _0xd29e3f[_0x4fe5('0x17')](_0x4e8b43);}return _0xd29e3f[_0x4fe5('0x18')](_0x4e8b43)[_0x4fe5('0x19')]();};}function respondWithResult(_0x203547,_0x5aec26){_0x5aec26=_0x5aec26||0xc8;return function(_0x5c47fc){if(_0x5c47fc){return _0x203547[_0x4fe5('0x18')](_0x5aec26)['json'](_0x5c47fc);}};}function respondWithFilteredResult(_0x293ed0,_0xa302bb){return function(_0x2fbd2e){if(_0x2fbd2e){var _0x2e40b6=typeof _0xa302bb[_0x4fe5('0x1a')]===_0x4fe5('0x1b')&&typeof _0xa302bb['limit']===_0x4fe5('0x1b');var _0x284cee=_0x2fbd2e[_0x4fe5('0x1c')];var _0x1907b9=_0x2e40b6?0x0:_0xa302bb[_0x4fe5('0x1a')];var _0x1b2194=_0x2e40b6?_0x2fbd2e[_0x4fe5('0x1c')]:_0xa302bb['offset']+_0xa302bb[_0x4fe5('0x1d')];var _0x47f96c;if(_0x1b2194>=_0x284cee){_0x1b2194=_0x284cee;_0x47f96c=0xc8;}else{_0x47f96c=0xce;}_0x293ed0[_0x4fe5('0x18')](_0x47f96c);return _0x293ed0['set'](_0x4fe5('0x1e'),_0x1907b9+'-'+_0x1b2194+'/'+_0x284cee)[_0x4fe5('0x1f')](_0x2fbd2e);}return null;};}function patchUpdates(_0x19fc8e){return function(_0x299fe7){try{jsonpatch[_0x4fe5('0x20')](_0x299fe7,_0x19fc8e,!![]);}catch(_0x46d0f1){return BPromise[_0x4fe5('0x21')](_0x46d0f1);}return _0x299fe7[_0x4fe5('0x22')]();};}function saveUpdates(_0x5973bb,_0x57349b){return function(_0x5582b9){if(_0x5582b9){return _0x5582b9[_0x4fe5('0x23')](_0x5973bb)[_0x4fe5('0x24')](function(_0x4d8466){return _0x4d8466;});}return null;};}function removeEntity(_0x53e014,_0x520487){return function(_0x3ed197){if(_0x3ed197){return _0x3ed197['destroy']()[_0x4fe5('0x24')](function(){_0x53e014['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xd19ec,_0x43a678){return function(_0x3adb64){if(!_0x3adb64){_0xd19ec[_0x4fe5('0x17')](0x194);}return _0x3adb64;};}function handleError(_0x4f66d3,_0x1abe8c){_0x1abe8c=_0x1abe8c||0x1f4;return function(_0x5cf7d8){logger['error'](_0x5cf7d8[_0x4fe5('0x25')]);if(_0x5cf7d8[_0x4fe5('0x26')]){delete _0x5cf7d8[_0x4fe5('0x26')];}_0x4f66d3[_0x4fe5('0x18')](_0x1abe8c)[_0x4fe5('0x27')](_0x5cf7d8);};}exports[_0x4fe5('0x28')]=function(_0x24c072,_0x56b9d7){var _0xcf572a={},_0x4dbb09={},_0x1b0674={'count':0x0,'rows':[]};var _0x1eb4c9=_[_0x4fe5('0x29')](db[_0x4fe5('0x2a')][_0x4fe5('0x2b')],function(_0x522c47){return{'name':_0x522c47[_0x4fe5('0x2c')],'type':_0x522c47[_0x4fe5('0x2d')][_0x4fe5('0x2e')]};});_0x4dbb09['model']=_['map'](_0x1eb4c9,'name');_0x4dbb09[_0x4fe5('0x2f')]=_['keys'](_0x24c072[_0x4fe5('0x2f')]);_0x4dbb09[_0x4fe5('0x30')]=_['intersection'](_0x4dbb09['model'],_0x4dbb09[_0x4fe5('0x2f')]);_0xcf572a[_0x4fe5('0x31')]=_['intersection'](_0x4dbb09['model'],qs[_0x4fe5('0x32')](_0x24c072[_0x4fe5('0x2f')][_0x4fe5('0x32')]));_0xcf572a[_0x4fe5('0x31')]=_0xcf572a[_0x4fe5('0x31')][_0x4fe5('0x33')]?_0xcf572a[_0x4fe5('0x31')]:_0x4dbb09['model'];if(!_0x24c072[_0x4fe5('0x2f')][_0x4fe5('0x34')](_0x4fe5('0x35'))){_0xcf572a[_0x4fe5('0x1d')]=qs[_0x4fe5('0x1d')](_0x24c072[_0x4fe5('0x2f')][_0x4fe5('0x1d')]);_0xcf572a[_0x4fe5('0x1a')]=qs[_0x4fe5('0x1a')](_0x24c072[_0x4fe5('0x2f')][_0x4fe5('0x1a')]);}_0xcf572a[_0x4fe5('0x36')]=qs[_0x4fe5('0x37')](_0x24c072[_0x4fe5('0x2f')][_0x4fe5('0x37')]);_0xcf572a[_0x4fe5('0x38')]=qs[_0x4fe5('0x30')](_[_0x4fe5('0x39')](_0x24c072[_0x4fe5('0x2f')],_0x4dbb09['filters']),_0x1eb4c9);if(_0x24c072[_0x4fe5('0x2f')][_0x4fe5('0x3a')]){_0xcf572a[_0x4fe5('0x38')]=_[_0x4fe5('0x3b')](_0xcf572a[_0x4fe5('0x38')],{'$or':_[_0x4fe5('0x29')](_0x1eb4c9,function(_0x304d9a){if(_0x304d9a[_0x4fe5('0x2d')]!=='VIRTUAL'){var _0x36ec13={};_0x36ec13[_0x304d9a[_0x4fe5('0x26')]]={'$like':'%'+_0x24c072[_0x4fe5('0x2f')][_0x4fe5('0x3a')]+'%'};return _0x36ec13;}})});}_0xcf572a=_['merge']({},_0xcf572a,_0x24c072[_0x4fe5('0x3c')]);var _0x4fb98d={'where':_0xcf572a[_0x4fe5('0x38')]};return db[_0x4fe5('0x2a')][_0x4fe5('0x1c')](_0x4fb98d)[_0x4fe5('0x24')](function(_0x2cca9d){_0x1b0674[_0x4fe5('0x1c')]=_0x2cca9d;if(_0x24c072[_0x4fe5('0x2f')][_0x4fe5('0x3d')]){_0xcf572a[_0x4fe5('0x3e')]=[{'all':!![]}];}return db[_0x4fe5('0x2a')][_0x4fe5('0x3f')](_0xcf572a);})[_0x4fe5('0x24')](function(_0x108eca){_0x1b0674['rows']=_0x108eca;return _0x1b0674;})[_0x4fe5('0x24')](respondWithFilteredResult(_0x56b9d7,_0xcf572a))[_0x4fe5('0x40')](handleError(_0x56b9d7,null));};exports[_0x4fe5('0x41')]=function(_0x23cef2,_0x5154cc){var _0x3b450c={'raw':![],'where':{'id':_0x23cef2[_0x4fe5('0x42')]['id']}},_0x13b460={};_0x13b460[_0x4fe5('0x43')]=_[_0x4fe5('0x44')](db[_0x4fe5('0x2a')][_0x4fe5('0x2b')]);_0x13b460[_0x4fe5('0x2f')]=_[_0x4fe5('0x44')](_0x23cef2[_0x4fe5('0x2f')]);_0x13b460['filters']=_[_0x4fe5('0x45')](_0x13b460[_0x4fe5('0x43')],_0x13b460[_0x4fe5('0x2f')]);_0x3b450c['attributes']=_[_0x4fe5('0x45')](_0x13b460[_0x4fe5('0x43')],qs[_0x4fe5('0x32')](_0x23cef2[_0x4fe5('0x2f')]['fields']));_0x3b450c['attributes']=_0x3b450c[_0x4fe5('0x31')][_0x4fe5('0x33')]?_0x3b450c[_0x4fe5('0x31')]:_0x13b460[_0x4fe5('0x43')];if(_0x23cef2[_0x4fe5('0x2f')]['includeAll']){_0x3b450c['include']=[{'all':!![]}];}_0x3b450c=_[_0x4fe5('0x3b')]({},_0x3b450c,_0x23cef2['options']);return db[_0x4fe5('0x2a')][_0x4fe5('0x46')](_0x3b450c)[_0x4fe5('0x24')](handleEntityNotFound(_0x5154cc,null))[_0x4fe5('0x24')](respondWithResult(_0x5154cc,null))['catch'](handleError(_0x5154cc,null));};exports[_0x4fe5('0x47')]=function(_0xfa3a24,_0x25b73b){return db[_0x4fe5('0x2a')][_0x4fe5('0x47')](_0xfa3a24[_0x4fe5('0x48')],{})[_0x4fe5('0x24')](respondWithResult(_0x25b73b,0xc9))['catch'](handleError(_0x25b73b,null));};exports['update']=function(_0x5ef868,_0x30a6ae){if(_0x5ef868[_0x4fe5('0x48')]['id']){delete _0x5ef868[_0x4fe5('0x48')]['id'];}return db[_0x4fe5('0x2a')]['find']({'where':{'id':_0x5ef868['params']['id']}})[_0x4fe5('0x24')](handleEntityNotFound(_0x30a6ae,null))[_0x4fe5('0x24')](saveUpdates(_0x5ef868[_0x4fe5('0x48')],null))['then'](respondWithResult(_0x30a6ae,null))[_0x4fe5('0x40')](handleError(_0x30a6ae,null));};exports[_0x4fe5('0x49')]=function(_0x4dc760,_0x58a101){return db[_0x4fe5('0x2a')]['find']({'where':{'id':_0x4dc760[_0x4fe5('0x42')]['id']}})[_0x4fe5('0x24')](handleEntityNotFound(_0x58a101,null))['then'](removeEntity(_0x58a101,null))[_0x4fe5('0x40')](handleError(_0x58a101,null));};exports[_0x4fe5('0x4a')]=function(_0x19db59,_0x8e635f,_0x422d8f){var _0x470b34={};var _0x2bc6e0={};var _0x3106bb;var _0x2580f9;return db['FreshsalesConfiguration'][_0x4fe5('0x4b')]({'where':{'id':_0x19db59['params']['id']}})['then'](handleEntityNotFound(_0x8e635f,null))[_0x4fe5('0x24')](function(_0x213ecc){if(_0x213ecc){_0x3106bb=_0x213ecc;_0x2bc6e0['model']=_[_0x4fe5('0x44')](db[_0x4fe5('0x4c')][_0x4fe5('0x2b')]);_0x2bc6e0[_0x4fe5('0x2f')]=_[_0x4fe5('0x44')](_0x19db59['query']);_0x2bc6e0[_0x4fe5('0x30')]=_[_0x4fe5('0x45')](_0x2bc6e0[_0x4fe5('0x43')],_0x2bc6e0[_0x4fe5('0x2f')]);_0x470b34[_0x4fe5('0x31')]=_[_0x4fe5('0x45')](_0x2bc6e0[_0x4fe5('0x43')],qs[_0x4fe5('0x32')](_0x19db59[_0x4fe5('0x2f')]['fields']));_0x470b34[_0x4fe5('0x31')]=_0x470b34[_0x4fe5('0x31')][_0x4fe5('0x33')]?_0x470b34[_0x4fe5('0x31')]:_0x2bc6e0['model'];_0x470b34[_0x4fe5('0x36')]=qs[_0x4fe5('0x37')](_0x19db59[_0x4fe5('0x2f')][_0x4fe5('0x37')]);_0x470b34[_0x4fe5('0x38')]=qs[_0x4fe5('0x30')](_[_0x4fe5('0x39')](_0x19db59[_0x4fe5('0x2f')],_0x2bc6e0[_0x4fe5('0x30')]));if(_0x19db59[_0x4fe5('0x2f')][_0x4fe5('0x3a')]){_0x470b34[_0x4fe5('0x38')]=_['merge'](_0x470b34['where'],{'$or':_[_0x4fe5('0x29')](_0x470b34[_0x4fe5('0x31')],function(_0x2ea62e){var _0x1cb922={};_0x1cb922[_0x2ea62e]={'$like':'%'+_0x19db59[_0x4fe5('0x2f')][_0x4fe5('0x3a')]+'%'};return _0x1cb922;})});}_0x470b34=_[_0x4fe5('0x3b')]({},_0x470b34,_0x19db59['options']);return _0x3106bb[_0x4fe5('0x4a')](_0x470b34);}})[_0x4fe5('0x24')](function(_0xf434c4){if(_0xf434c4){_0x2580f9=_0xf434c4[_0x4fe5('0x33')];if(!_0x19db59[_0x4fe5('0x2f')]['hasOwnProperty'](_0x4fe5('0x35'))){_0x470b34['limit']=qs[_0x4fe5('0x1d')](_0x19db59[_0x4fe5('0x2f')][_0x4fe5('0x1d')]);_0x470b34['offset']=qs[_0x4fe5('0x1a')](_0x19db59['query'][_0x4fe5('0x1a')]);}return _0x3106bb[_0x4fe5('0x4a')](_0x470b34);}})[_0x4fe5('0x24')](function(_0x1b73b5){if(_0x1b73b5){return _0x1b73b5?{'count':_0x2580f9,'rows':_0x1b73b5}:null;}})[_0x4fe5('0x24')](respondWithResult(_0x8e635f,null))[_0x4fe5('0x40')](handleError(_0x8e635f,null));};exports['getDescriptions']=function(_0x3ab103,_0x5a6322,_0x323f01){var _0x498ac9={};var _0x5947a1={};var _0x48c144;var _0x58d98e;return db[_0x4fe5('0x2a')][_0x4fe5('0x4b')]({'where':{'id':_0x3ab103[_0x4fe5('0x42')]['id']}})[_0x4fe5('0x24')](handleEntityNotFound(_0x5a6322,null))[_0x4fe5('0x24')](function(_0x5f34bf){if(_0x5f34bf){_0x48c144=_0x5f34bf;_0x5947a1['model']=_['keys'](db[_0x4fe5('0x4c')][_0x4fe5('0x2b')]);_0x5947a1['query']=_[_0x4fe5('0x44')](_0x3ab103['query']);_0x5947a1[_0x4fe5('0x30')]=_['intersection'](_0x5947a1['model'],_0x5947a1['query']);_0x498ac9[_0x4fe5('0x31')]=_[_0x4fe5('0x45')](_0x5947a1[_0x4fe5('0x43')],qs[_0x4fe5('0x32')](_0x3ab103[_0x4fe5('0x2f')][_0x4fe5('0x32')]));_0x498ac9[_0x4fe5('0x31')]=_0x498ac9[_0x4fe5('0x31')][_0x4fe5('0x33')]?_0x498ac9[_0x4fe5('0x31')]:_0x5947a1['model'];_0x498ac9[_0x4fe5('0x36')]=qs[_0x4fe5('0x37')](_0x3ab103['query'][_0x4fe5('0x37')]);_0x498ac9[_0x4fe5('0x38')]=qs[_0x4fe5('0x30')](_['pick'](_0x3ab103[_0x4fe5('0x2f')],_0x5947a1[_0x4fe5('0x30')]));if(_0x3ab103[_0x4fe5('0x2f')]['filter']){_0x498ac9['where']=_[_0x4fe5('0x3b')](_0x498ac9[_0x4fe5('0x38')],{'$or':_['map'](_0x498ac9[_0x4fe5('0x31')],function(_0x5c8aee){var _0x3d6788={};_0x3d6788[_0x5c8aee]={'$like':'%'+_0x3ab103[_0x4fe5('0x2f')][_0x4fe5('0x3a')]+'%'};return _0x3d6788;})});}_0x498ac9=_['merge']({},_0x498ac9,_0x3ab103[_0x4fe5('0x3c')]);return _0x48c144[_0x4fe5('0x4d')](_0x498ac9);}})[_0x4fe5('0x24')](function(_0x500322){if(_0x500322){_0x58d98e=_0x500322['length'];if(!_0x3ab103['query'][_0x4fe5('0x34')](_0x4fe5('0x35'))){_0x498ac9[_0x4fe5('0x1d')]=qs[_0x4fe5('0x1d')](_0x3ab103[_0x4fe5('0x2f')][_0x4fe5('0x1d')]);_0x498ac9[_0x4fe5('0x1a')]=qs[_0x4fe5('0x1a')](_0x3ab103[_0x4fe5('0x2f')][_0x4fe5('0x1a')]);}return _0x48c144['getDescriptions'](_0x498ac9);}})[_0x4fe5('0x24')](function(_0x258deb){if(_0x258deb){return _0x258deb?{'count':_0x58d98e,'rows':_0x258deb}:null;}})['then'](respondWithResult(_0x5a6322,null))[_0x4fe5('0x40')](handleError(_0x5a6322,null));};exports[_0x4fe5('0x4e')]=function(_0x71d917,_0x186cef,_0x507a34){var _0xd839ef={};var _0x4a6b8e={};var _0x377905;var _0x36b4d9;return db[_0x4fe5('0x2a')][_0x4fe5('0x4b')]({'where':{'id':_0x71d917[_0x4fe5('0x42')]['id']}})['then'](handleEntityNotFound(_0x186cef,null))[_0x4fe5('0x24')](function(_0x27810b){if(_0x27810b){_0x377905=_0x27810b;_0x4a6b8e[_0x4fe5('0x43')]=_[_0x4fe5('0x44')](db[_0x4fe5('0x4c')][_0x4fe5('0x2b')]);_0x4a6b8e[_0x4fe5('0x2f')]=_[_0x4fe5('0x44')](_0x71d917[_0x4fe5('0x2f')]);_0x4a6b8e[_0x4fe5('0x30')]=_[_0x4fe5('0x45')](_0x4a6b8e['model'],_0x4a6b8e[_0x4fe5('0x2f')]);_0xd839ef['attributes']=_['intersection'](_0x4a6b8e[_0x4fe5('0x43')],qs[_0x4fe5('0x32')](_0x71d917['query'][_0x4fe5('0x32')]));_0xd839ef[_0x4fe5('0x31')]=_0xd839ef[_0x4fe5('0x31')][_0x4fe5('0x33')]?_0xd839ef[_0x4fe5('0x31')]:_0x4a6b8e[_0x4fe5('0x43')];_0xd839ef[_0x4fe5('0x36')]=qs[_0x4fe5('0x37')](_0x71d917['query']['sort']);_0xd839ef[_0x4fe5('0x38')]=qs[_0x4fe5('0x30')](_[_0x4fe5('0x39')](_0x71d917[_0x4fe5('0x2f')],_0x4a6b8e[_0x4fe5('0x30')]));if(_0x71d917['query']['filter']){_0xd839ef[_0x4fe5('0x38')]=_[_0x4fe5('0x3b')](_0xd839ef['where'],{'$or':_['map'](_0xd839ef['attributes'],function(_0x241ac1){var _0xb4c229={};_0xb4c229[_0x241ac1]={'$like':'%'+_0x71d917[_0x4fe5('0x2f')][_0x4fe5('0x3a')]+'%'};return _0xb4c229;})});}_0xd839ef=_[_0x4fe5('0x3b')]({},_0xd839ef,_0x71d917[_0x4fe5('0x3c')]);return _0x377905[_0x4fe5('0x4e')](_0xd839ef);}})[_0x4fe5('0x24')](function(_0x32e2be){if(_0x32e2be){_0x36b4d9=_0x32e2be[_0x4fe5('0x33')];if(!_0x71d917['query']['hasOwnProperty']('nolimit')){_0xd839ef[_0x4fe5('0x1d')]=qs[_0x4fe5('0x1d')](_0x71d917[_0x4fe5('0x2f')][_0x4fe5('0x1d')]);_0xd839ef[_0x4fe5('0x1a')]=qs[_0x4fe5('0x1a')](_0x71d917['query']['offset']);}return _0x377905[_0x4fe5('0x4e')](_0xd839ef);}})[_0x4fe5('0x24')](function(_0x3a96bb){if(_0x3a96bb){return _0x3a96bb?{'count':_0x36b4d9,'rows':_0x3a96bb}:null;}})[_0x4fe5('0x24')](respondWithResult(_0x186cef,null))['catch'](handleError(_0x186cef,null));};
\ No newline at end of file
index 1b675c5..b6fcfa9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8cd=['request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3c9268,_0x1a0c1f){var _0x4c62e5=function(_0x1d79c0){while(--_0x1d79c0){_0x3c9268['push'](_0x3c9268['shift']());}};_0x4c62e5(++_0x1a0c1f);}(_0xd8cd,0x1b7));var _0xdd8c=function(_0x3ea0a6,_0x40bad){_0x3ea0a6=_0x3ea0a6-0x0;var _0x969952=_0xd8cd[_0x3ea0a6];return _0x969952;};'use strict';var _=require(_0xdd8c('0x0'));var util=require(_0xdd8c('0x1'));var logger=require(_0xdd8c('0x2'))('api');var moment=require(_0xdd8c('0x3'));var BPromise=require(_0xdd8c('0x4'));var rp=require(_0xdd8c('0x5'));var fs=require('fs');var path=require(_0xdd8c('0x6'));var rimraf=require(_0xdd8c('0x7'));var config=require(_0xdd8c('0x8'));var attributes=require(_0xdd8c('0x9'));module['exports']=function(_0x5a2c1a,_0x391cd1){return _0x5a2c1a['define'](_0xdd8c('0xa'),attributes,{'tableName':_0xdd8c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd855=['util','../../config/logger','api','moment','request-promise','path','../../config/environment','./intFreshsalesConfiguration.attributes','define','int_freshsales_configurations','lodash'];(function(_0x20e5c3,_0x41470c){var _0x401520=function(_0x37f246){while(--_0x37f246){_0x20e5c3['push'](_0x20e5c3['shift']());}};_0x401520(++_0x41470c);}(_0xd855,0x180));var _0x5d85=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd855[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x5d85('0x0'));var util=require(_0x5d85('0x1'));var logger=require(_0x5d85('0x2'))(_0x5d85('0x3'));var moment=require(_0x5d85('0x4'));var BPromise=require('bluebird');var rp=require(_0x5d85('0x5'));var fs=require('fs');var path=require(_0x5d85('0x6'));var rimraf=require('rimraf');var config=require(_0x5d85('0x7'));var attributes=require(_0x5d85('0x8'));module['exports']=function(_0x42d2fc,_0x348207){return _0x42d2fc[_0x5d85('0x9')]('FreshsalesConfiguration',attributes,{'tableName':_0x5d85('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index df26f92..68fc248 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8d7=['info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','debug','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message'];(function(_0x57caf8,_0x2287fa){var _0x24e03e=function(_0x822ad8){while(--_0x822ad8){_0x57caf8['push'](_0x57caf8['shift']());}};_0x24e03e(++_0x2287fa);}(_0xd8d7,0x10b));var _0x7d8d=function(_0x5d7227,_0x12aebe){_0x5d7227=_0x5d7227-0x0;var _0x15ac55=_0xd8d7[_0x5d7227];return _0x15ac55;};'use strict';var _=require(_0x7d8d('0x0'));var util=require(_0x7d8d('0x1'));var moment=require(_0x7d8d('0x2'));var BPromise=require(_0x7d8d('0x3'));var rs=require(_0x7d8d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7d8d('0x5'))['db'];var utils=require(_0x7d8d('0x6'));var logger=require(_0x7d8d('0x7'))(_0x7d8d('0x8'));var config=require('../../config/environment');var jayson=require(_0x7d8d('0x9'));var client=jayson[_0x7d8d('0xa')][_0x7d8d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x468d2a,_0x2d7e26,_0x2225a2){return new BPromise(function(_0x5a7408,_0x479d2a){return client[_0x7d8d('0xc')](_0x468d2a,_0x2225a2)[_0x7d8d('0xd')](function(_0x2704d9){logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x2d7e26,'request\x20sent');logger[_0x7d8d('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x2d7e26,'request\x20sent',JSON['stringify'](_0x2704d9));if(_0x2704d9[_0x7d8d('0xf')]){if(_0x2704d9['error'][_0x7d8d('0x10')]===0x1f4){logger[_0x7d8d('0xf')](_0x7d8d('0x11'),_0x2d7e26,_0x2704d9[_0x7d8d('0xf')][_0x7d8d('0x12')]);return _0x479d2a(_0x2704d9[_0x7d8d('0xf')][_0x7d8d('0x12')]);}logger[_0x7d8d('0xf')](_0x7d8d('0x11'),_0x2d7e26,_0x2704d9[_0x7d8d('0xf')][_0x7d8d('0x12')]);return _0x5a7408(_0x2704d9[_0x7d8d('0xf')]['message']);}else{logger[_0x7d8d('0x13')](_0x7d8d('0x11'),_0x2d7e26,'request\x20sent');_0x5a7408(_0x2704d9[_0x7d8d('0x14')][_0x7d8d('0x12')]);}})[_0x7d8d('0x15')](function(_0x105392){logger['error'](_0x7d8d('0x11'),_0x2d7e26,_0x105392);_0x479d2a(_0x105392);});});}
\ No newline at end of file
+var _0xbb25=['request\x20sent','stringify','error','FreshsalesConfiguration,\x20%s,\x20%s','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x29ebb8,_0x51d0d8){var _0x10c623=function(_0x6266c2){while(--_0x6266c2){_0x29ebb8['push'](_0x29ebb8['shift']());}};_0x10c623(++_0x51d0d8);}(_0xbb25,0x1a9));var _0x5bb2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbb25[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x5bb2('0x0'));var rs=require(_0x5bb2('0x1'));var fs=require('fs');var Redis=require(_0x5bb2('0x2'));var db=require(_0x5bb2('0x3'))['db'];var utils=require(_0x5bb2('0x4'));var logger=require(_0x5bb2('0x5'))(_0x5bb2('0x6'));var config=require(_0x5bb2('0x7'));var jayson=require(_0x5bb2('0x8'));var client=jayson[_0x5bb2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x240f2e,_0x174ace,_0x2e0a62){return new BPromise(function(_0x214891,_0x1eaed6){return client[_0x5bb2('0xa')](_0x240f2e,_0x2e0a62)[_0x5bb2('0xb')](function(_0x116d74){logger[_0x5bb2('0xc')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x174ace,'request\x20sent');logger[_0x5bb2('0xd')](_0x5bb2('0xe'),_0x174ace,_0x5bb2('0xf'),JSON[_0x5bb2('0x10')](_0x116d74));if(_0x116d74[_0x5bb2('0x11')]){if(_0x116d74['error']['code']===0x1f4){logger[_0x5bb2('0x11')](_0x5bb2('0x12'),_0x174ace,_0x116d74['error'][_0x5bb2('0x13')]);return _0x1eaed6(_0x116d74[_0x5bb2('0x11')]['message']);}logger['error'](_0x5bb2('0x12'),_0x174ace,_0x116d74[_0x5bb2('0x11')][_0x5bb2('0x13')]);return _0x214891(_0x116d74[_0x5bb2('0x11')][_0x5bb2('0x13')]);}else{logger[_0x5bb2('0xc')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x174ace,_0x5bb2('0xf'));_0x214891(_0x116d74[_0x5bb2('0x14')]['message']);}})[_0x5bb2('0x15')](function(_0x4e1cd0){logger[_0x5bb2('0x11')](_0x5bb2('0x12'),_0x174ace,_0x4e1cd0);_0x1eaed6(_0x4e1cd0);});});}
\ No newline at end of file
index d42e55e..72f4461 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x121d=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','show','create','update'];(function(_0x4338d1,_0x25f589){var _0x2b495e=function(_0x5a347e){while(--_0x5a347e){_0x4338d1['push'](_0x4338d1['shift']());}};_0x2b495e(++_0x25f589);}(_0x121d,0xea));var _0xd121=function(_0x593d6f,_0xb8a964){_0x593d6f=_0x593d6f-0x0;var _0x40b630=_0x121d[_0x593d6f];return _0x40b630;};'use strict';var multer=require(_0xd121('0x0'));var util=require(_0xd121('0x1'));var path=require(_0xd121('0x2'));var timeout=require(_0xd121('0x3'));var express=require(_0xd121('0x4'));var router=express[_0xd121('0x5')]();var fs_extra=require(_0xd121('0x6'));var auth=require(_0xd121('0x7'));var interaction=require(_0xd121('0x8'));var config=require(_0xd121('0x9'));var controller=require(_0xd121('0xa'));router[_0xd121('0xb')]('/',auth[_0xd121('0xc')](),controller[_0xd121('0xd')]);router['get'](_0xd121('0xe'),auth['isAuthenticated'](),controller[_0xd121('0xf')]);router['post']('/',auth[_0xd121('0xc')](),controller[_0xd121('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xd121('0x11')]);router[_0xd121('0x12')](_0xd121('0xe'),auth[_0xd121('0xc')](),controller[_0xd121('0x13')]);module[_0xd121('0x14')]=router;
\ No newline at end of file
+var _0xee5b=['/:id','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','create','put'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0xee5b,0x1f4));var _0xbee5=function(_0x197764,_0x2ce0a3){_0x197764=_0x197764-0x0;var _0x1f5632=_0xee5b[_0x197764];return _0x1f5632;};'use strict';var multer=require(_0xbee5('0x0'));var util=require('util');var path=require(_0xbee5('0x1'));var timeout=require(_0xbee5('0x2'));var express=require('express');var router=express[_0xbee5('0x3')]();var fs_extra=require(_0xbee5('0x4'));var auth=require(_0xbee5('0x5'));var interaction=require(_0xbee5('0x6'));var config=require('../../config/environment');var controller=require('./intFreshsalesField.controller');router[_0xbee5('0x7')]('/',auth[_0xbee5('0x8')](),controller[_0xbee5('0x9')]);router[_0xbee5('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xbee5('0xa')]);router[_0xbee5('0xb')](_0xbee5('0xc'),auth[_0xbee5('0x8')](),controller['update']);router[_0xbee5('0xd')](_0xbee5('0xc'),auth[_0xbee5('0x8')](),controller[_0xbee5('0xe')]);module[_0xbee5('0xf')]=router;
\ No newline at end of file
index e8f3cfd..1a67523 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa67c=['sequelize','exports','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x55dcf6,_0x45e8d2){var _0x5f0b8d=function(_0xb86855){while(--_0xb86855){_0x55dcf6['push'](_0x55dcf6['shift']());}};_0x5f0b8d(++_0x45e8d2);}(_0xa67c,0x156));var _0xca67=function(_0x19741f,_0x3a28be){_0x19741f=_0x19741f-0x0;var _0x3d8ff7=_0xa67c[_0x19741f];return _0x3d8ff7;};'use strict';var Sequelize=require(_0xca67('0x0'));module[_0xca67('0x1')]={'type':{'type':Sequelize['ENUM'](_0xca67('0x2'),_0xca67('0x3'),_0xca67('0x4'),_0xca67('0x5'),_0xca67('0x6')),'defaultValue':_0xca67('0x2')},'content':{'type':Sequelize[_0xca67('0x7')]},'key':{'type':Sequelize[_0xca67('0x7')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0xca67('0x4'))},'keyContent':{'type':Sequelize[_0xca67('0x7')]},'idField':{'type':Sequelize[_0xca67('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xca67('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xca67('0x7')]}};
\ No newline at end of file
+var _0x1ff2=['sequelize','exports','ENUM','variable','keyValue','picklist','string','STRING','customVariable','BOOLEAN'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x1ff2,0x8c));var _0x21ff=function(_0xdbf6e2,_0x58ecab){_0xdbf6e2=_0xdbf6e2-0x0;var _0x179eda=_0x1ff2[_0xdbf6e2];return _0x179eda;};'use strict';var Sequelize=require(_0x21ff('0x0'));module[_0x21ff('0x1')]={'type':{'type':Sequelize[_0x21ff('0x2')]('string',_0x21ff('0x3'),'customVariable',_0x21ff('0x4'),_0x21ff('0x5')),'defaultValue':_0x21ff('0x6')},'content':{'type':Sequelize[_0x21ff('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x21ff('0x2')](_0x21ff('0x6'),_0x21ff('0x3'),_0x21ff('0x8'))},'keyContent':{'type':Sequelize[_0x21ff('0x7')]},'idField':{'type':Sequelize[_0x21ff('0x7')]},'nameField':{'type':Sequelize[_0x21ff('0x7')]},'customField':{'type':Sequelize[_0x21ff('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x21ff('0x7')]}};
\ No newline at end of file
index be20016..d8b11d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd497=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','FreshsalesField','includeAll','include','findAll','catch','show','params','merge','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../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','save','update','destroy','then','error','stack','name','send','index','map'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xd497,0x67));var _0x7d49=function(_0x58d706,_0x40ddcb){_0x58d706=_0x58d706-0x0;var _0xba4ab9=_0xd497[_0x58d706];return _0xba4ab9;};'use strict';var emlformat=require(_0x7d49('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7d49('0x1'));var jsonpatch=require(_0x7d49('0x2'));var rp=require(_0x7d49('0x3'));var moment=require('moment');var BPromise=require(_0x7d49('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x7d49('0x5'));var ejs=require(_0x7d49('0x6'));var fs=require('fs');var fs_extra=require(_0x7d49('0x7'));var _=require('lodash');var squel=require(_0x7d49('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7d49('0x9'));var toCsv=require(_0x7d49('0x5'));var querystring=require(_0x7d49('0xa'));var Papa=require(_0x7d49('0xb'));var Redis=require(_0x7d49('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7d49('0xd'));var hardwareService=require(_0x7d49('0xe'));var logger=require(_0x7d49('0xf'))(_0x7d49('0x10'));var utils=require(_0x7d49('0x11'));var config=require(_0x7d49('0x12'));var licenseUtil=require(_0x7d49('0x13'));var db=require(_0x7d49('0x14'))['db'];function respondWithStatusCode(_0x1f84ba,_0x1f15c9){_0x1f15c9=_0x1f15c9||0xcc;return function(_0x63580b){if(_0x63580b){return _0x1f84ba[_0x7d49('0x15')](_0x1f15c9);}return _0x1f84ba[_0x7d49('0x16')](_0x1f15c9)[_0x7d49('0x17')]();};}function respondWithResult(_0x4abbee,_0x2dca0d){_0x2dca0d=_0x2dca0d||0xc8;return function(_0x5705c3){if(_0x5705c3){return _0x4abbee[_0x7d49('0x16')](_0x2dca0d)[_0x7d49('0x18')](_0x5705c3);}};}function respondWithFilteredResult(_0x5664f1,_0x54279e){return function(_0x24ccf6){if(_0x24ccf6){var _0x2639b7=typeof _0x54279e[_0x7d49('0x19')]==='undefined'&&typeof _0x54279e[_0x7d49('0x1a')]===_0x7d49('0x1b');var _0x2a26b0=_0x24ccf6['count'];var _0x1db3b1=_0x2639b7?0x0:_0x54279e[_0x7d49('0x19')];var _0x52b4e9=_0x2639b7?_0x24ccf6[_0x7d49('0x1c')]:_0x54279e[_0x7d49('0x19')]+_0x54279e[_0x7d49('0x1a')];var _0x46de1d;if(_0x52b4e9>=_0x2a26b0){_0x52b4e9=_0x2a26b0;_0x46de1d=0xc8;}else{_0x46de1d=0xce;}_0x5664f1[_0x7d49('0x16')](_0x46de1d);return _0x5664f1[_0x7d49('0x1d')](_0x7d49('0x1e'),_0x1db3b1+'-'+_0x52b4e9+'/'+_0x2a26b0)[_0x7d49('0x18')](_0x24ccf6);}return null;};}function patchUpdates(_0x22f87f){return function(_0x24d9a0){try{jsonpatch['apply'](_0x24d9a0,_0x22f87f,!![]);}catch(_0x222597){return BPromise['reject'](_0x222597);}return _0x24d9a0[_0x7d49('0x1f')]();};}function saveUpdates(_0xd395e7,_0x5f0396){return function(_0x23c48e){if(_0x23c48e){return _0x23c48e[_0x7d49('0x20')](_0xd395e7)['then'](function(_0x394513){return _0x394513;});}return null;};}function removeEntity(_0x240ae8,_0x304c2f){return function(_0x45b2e4){if(_0x45b2e4){return _0x45b2e4[_0x7d49('0x21')]()[_0x7d49('0x22')](function(){_0x240ae8[_0x7d49('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9bc2c8,_0xba9737){return function(_0x449e9f){if(!_0x449e9f){_0x9bc2c8[_0x7d49('0x15')](0x194);}return _0x449e9f;};}function handleError(_0x2b544b,_0x7d1d58){_0x7d1d58=_0x7d1d58||0x1f4;return function(_0x221981){logger[_0x7d49('0x23')](_0x221981[_0x7d49('0x24')]);if(_0x221981[_0x7d49('0x25')]){delete _0x221981[_0x7d49('0x25')];}_0x2b544b[_0x7d49('0x16')](_0x7d1d58)[_0x7d49('0x26')](_0x221981);};}exports[_0x7d49('0x27')]=function(_0x53fbe1,_0x52adc8){var _0x1bc054={},_0x16b2e7={},_0x4011f6={'count':0x0,'rows':[]};var _0x406549=_[_0x7d49('0x28')](db['FreshsalesField'][_0x7d49('0x29')],function(_0x1293f4){return{'name':_0x1293f4[_0x7d49('0x2a')],'type':_0x1293f4[_0x7d49('0x2b')][_0x7d49('0x2c')]};});_0x16b2e7[_0x7d49('0x2d')]=_[_0x7d49('0x28')](_0x406549,_0x7d49('0x25'));_0x16b2e7[_0x7d49('0x2e')]=_[_0x7d49('0x2f')](_0x53fbe1['query']);_0x16b2e7[_0x7d49('0x30')]=_[_0x7d49('0x31')](_0x16b2e7['model'],_0x16b2e7[_0x7d49('0x2e')]);_0x1bc054[_0x7d49('0x32')]=_['intersection'](_0x16b2e7[_0x7d49('0x2d')],qs[_0x7d49('0x33')](_0x53fbe1[_0x7d49('0x2e')][_0x7d49('0x33')]));_0x1bc054[_0x7d49('0x32')]=_0x1bc054[_0x7d49('0x32')][_0x7d49('0x34')]?_0x1bc054[_0x7d49('0x32')]:_0x16b2e7[_0x7d49('0x2d')];if(!_0x53fbe1[_0x7d49('0x2e')]['hasOwnProperty'](_0x7d49('0x35'))){_0x1bc054[_0x7d49('0x1a')]=qs[_0x7d49('0x1a')](_0x53fbe1[_0x7d49('0x2e')][_0x7d49('0x1a')]);_0x1bc054[_0x7d49('0x19')]=qs[_0x7d49('0x19')](_0x53fbe1['query'][_0x7d49('0x19')]);}_0x1bc054[_0x7d49('0x36')]=qs['sort'](_0x53fbe1[_0x7d49('0x2e')][_0x7d49('0x37')]);_0x1bc054[_0x7d49('0x38')]=qs[_0x7d49('0x30')](_[_0x7d49('0x39')](_0x53fbe1[_0x7d49('0x2e')],_0x16b2e7[_0x7d49('0x30')]),_0x406549);if(_0x53fbe1[_0x7d49('0x2e')][_0x7d49('0x3a')]){_0x1bc054['where']=_['merge'](_0x1bc054['where'],{'$or':_['map'](_0x406549,function(_0x24e46f){if(_0x24e46f[_0x7d49('0x2b')]!==_0x7d49('0x3b')){var _0x3d3949={};_0x3d3949[_0x24e46f['name']]={'$like':'%'+_0x53fbe1[_0x7d49('0x2e')]['filter']+'%'};return _0x3d3949;}})});}_0x1bc054=_['merge']({},_0x1bc054,_0x53fbe1[_0x7d49('0x3c')]);var _0x347fbd={'where':_0x1bc054[_0x7d49('0x38')]};return db[_0x7d49('0x3d')]['count'](_0x347fbd)[_0x7d49('0x22')](function(_0x2141ab){_0x4011f6[_0x7d49('0x1c')]=_0x2141ab;if(_0x53fbe1[_0x7d49('0x2e')][_0x7d49('0x3e')]){_0x1bc054[_0x7d49('0x3f')]=[{'all':!![]}];}return db[_0x7d49('0x3d')][_0x7d49('0x40')](_0x1bc054);})[_0x7d49('0x22')](function(_0x167f45){_0x4011f6['rows']=_0x167f45;return _0x4011f6;})[_0x7d49('0x22')](respondWithFilteredResult(_0x52adc8,_0x1bc054))[_0x7d49('0x41')](handleError(_0x52adc8,null));};exports[_0x7d49('0x42')]=function(_0x418cba,_0x423c75){var _0x184402={'raw':!![],'where':{'id':_0x418cba[_0x7d49('0x43')]['id']}},_0x5817b1={};_0x5817b1[_0x7d49('0x2d')]=_[_0x7d49('0x2f')](db[_0x7d49('0x3d')][_0x7d49('0x29')]);_0x5817b1[_0x7d49('0x2e')]=_[_0x7d49('0x2f')](_0x418cba['query']);_0x5817b1[_0x7d49('0x30')]=_[_0x7d49('0x31')](_0x5817b1[_0x7d49('0x2d')],_0x5817b1[_0x7d49('0x2e')]);_0x184402[_0x7d49('0x32')]=_[_0x7d49('0x31')](_0x5817b1[_0x7d49('0x2d')],qs[_0x7d49('0x33')](_0x418cba[_0x7d49('0x2e')][_0x7d49('0x33')]));_0x184402[_0x7d49('0x32')]=_0x184402['attributes']['length']?_0x184402[_0x7d49('0x32')]:_0x5817b1[_0x7d49('0x2d')];if(_0x418cba[_0x7d49('0x2e')][_0x7d49('0x3e')]){_0x184402[_0x7d49('0x3f')]=[{'all':!![]}];}_0x184402=_[_0x7d49('0x44')]({},_0x184402,_0x418cba[_0x7d49('0x3c')]);return db['FreshsalesField'][_0x7d49('0x45')](_0x184402)[_0x7d49('0x22')](handleEntityNotFound(_0x423c75,null))['then'](respondWithResult(_0x423c75,null))[_0x7d49('0x41')](handleError(_0x423c75,null));};exports[_0x7d49('0x46')]=function(_0x285d0d,_0x59d731){return db['FreshsalesField'][_0x7d49('0x46')](_0x285d0d[_0x7d49('0x47')],{})[_0x7d49('0x22')](respondWithResult(_0x59d731,0xc9))[_0x7d49('0x41')](handleError(_0x59d731,null));};exports[_0x7d49('0x20')]=function(_0x4b892f,_0xe1c72e){if(_0x4b892f[_0x7d49('0x47')]['id']){delete _0x4b892f[_0x7d49('0x47')]['id'];}return db[_0x7d49('0x3d')][_0x7d49('0x45')]({'where':{'id':_0x4b892f[_0x7d49('0x43')]['id']}})[_0x7d49('0x22')](handleEntityNotFound(_0xe1c72e,null))[_0x7d49('0x22')](saveUpdates(_0x4b892f[_0x7d49('0x47')],null))[_0x7d49('0x22')](respondWithResult(_0xe1c72e,null))['catch'](handleError(_0xe1c72e,null));};exports[_0x7d49('0x21')]=function(_0x10d139,_0x38097b){return db[_0x7d49('0x3d')]['find']({'where':{'id':_0x10d139['params']['id']}})['then'](handleEntityNotFound(_0x38097b,null))['then'](removeEntity(_0x38097b,null))[_0x7d49('0x41')](handleError(_0x38097b,null));};
\ No newline at end of file
+var _0x04b0=['then','end','error','stack','name','index','map','FreshsalesField','rawAttributes','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','include','rows','show','options','catch','create','body','find','params','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','save','update'];(function(_0x317257,_0x1677dc){var _0x1f235d=function(_0xda0ccf){while(--_0xda0ccf){_0x317257['push'](_0x317257['shift']());}};_0x1f235d(++_0x1677dc);}(_0x04b0,0x13b));var _0x004b=function(_0x12c485,_0x16f68d){_0x12c485=_0x12c485-0x0;var _0x197017=_0x04b0[_0x12c485];return _0x197017;};'use strict';var emlformat=require(_0x004b('0x0'));var rimraf=require(_0x004b('0x1'));var zipdir=require(_0x004b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x004b('0x3'));var moment=require(_0x004b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x004b('0x5'));var util=require('util');var path=require(_0x004b('0x6'));var sox=require(_0x004b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x004b('0x8'));var _=require(_0x004b('0x9'));var squel=require(_0x004b('0xa'));var crypto=require(_0x004b('0xb'));var jsforce=require(_0x004b('0xc'));var deskjs=require(_0x004b('0xd'));var toCsv=require(_0x004b('0xe'));var querystring=require(_0x004b('0xf'));var Papa=require('papaparse');var Redis=require(_0x004b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x004b('0x11'));var as=require(_0x004b('0x12'));var hardwareService=require(_0x004b('0x13'));var logger=require('../../config/logger')(_0x004b('0x14'));var utils=require(_0x004b('0x15'));var config=require(_0x004b('0x16'));var licenseUtil=require(_0x004b('0x17'));var db=require(_0x004b('0x18'))['db'];function respondWithStatusCode(_0x5a8c45,_0x3e8d3f){_0x3e8d3f=_0x3e8d3f||0xcc;return function(_0x594d4f){if(_0x594d4f){return _0x5a8c45[_0x004b('0x19')](_0x3e8d3f);}return _0x5a8c45[_0x004b('0x1a')](_0x3e8d3f)['end']();};}function respondWithResult(_0x122b9d,_0x2e12bb){_0x2e12bb=_0x2e12bb||0xc8;return function(_0x44f56a){if(_0x44f56a){return _0x122b9d[_0x004b('0x1a')](_0x2e12bb)[_0x004b('0x1b')](_0x44f56a);}};}function respondWithFilteredResult(_0x487523,_0xabfe9e){return function(_0x8c4263){if(_0x8c4263){var _0x490dad=typeof _0xabfe9e[_0x004b('0x1c')]===_0x004b('0x1d')&&typeof _0xabfe9e[_0x004b('0x1e')]===_0x004b('0x1d');var _0x38dccd=_0x8c4263[_0x004b('0x1f')];var _0x9ff181=_0x490dad?0x0:_0xabfe9e[_0x004b('0x1c')];var _0x294600=_0x490dad?_0x8c4263[_0x004b('0x1f')]:_0xabfe9e[_0x004b('0x1c')]+_0xabfe9e[_0x004b('0x1e')];var _0x388749;if(_0x294600>=_0x38dccd){_0x294600=_0x38dccd;_0x388749=0xc8;}else{_0x388749=0xce;}_0x487523[_0x004b('0x1a')](_0x388749);return _0x487523['set']('Content-Range',_0x9ff181+'-'+_0x294600+'/'+_0x38dccd)['json'](_0x8c4263);}return null;};}function patchUpdates(_0x952ff9){return function(_0x5110d3){try{jsonpatch[_0x004b('0x20')](_0x5110d3,_0x952ff9,!![]);}catch(_0x2d9147){return BPromise['reject'](_0x2d9147);}return _0x5110d3[_0x004b('0x21')]();};}function saveUpdates(_0x407f4e,_0x514182){return function(_0x3c536d){if(_0x3c536d){return _0x3c536d[_0x004b('0x22')](_0x407f4e)[_0x004b('0x23')](function(_0x1111b4){return _0x1111b4;});}return null;};}function removeEntity(_0x15de4b,_0x2bbd61){return function(_0x4c4f11){if(_0x4c4f11){return _0x4c4f11['destroy']()['then'](function(){_0x15de4b['status'](0xcc)[_0x004b('0x24')]();});}};}function handleEntityNotFound(_0x1d068d,_0x2491fc){return function(_0x84a007){if(!_0x84a007){_0x1d068d[_0x004b('0x19')](0x194);}return _0x84a007;};}function handleError(_0x31c60e,_0xfefb59){_0xfefb59=_0xfefb59||0x1f4;return function(_0x13f8d3){logger[_0x004b('0x25')](_0x13f8d3[_0x004b('0x26')]);if(_0x13f8d3[_0x004b('0x27')]){delete _0x13f8d3[_0x004b('0x27')];}_0x31c60e[_0x004b('0x1a')](_0xfefb59)['send'](_0x13f8d3);};}exports[_0x004b('0x28')]=function(_0x116a54,_0x4f472c){var _0x25b7be={},_0x81ec1c={},_0x213a54={'count':0x0,'rows':[]};var _0xdf10e6=_[_0x004b('0x29')](db[_0x004b('0x2a')][_0x004b('0x2b')],function(_0x4fe445){return{'name':_0x4fe445['fieldName'],'type':_0x4fe445[_0x004b('0x2c')]['key']};});_0x81ec1c[_0x004b('0x2d')]=_[_0x004b('0x29')](_0xdf10e6,'name');_0x81ec1c['query']=_[_0x004b('0x2e')](_0x116a54[_0x004b('0x2f')]);_0x81ec1c[_0x004b('0x30')]=_[_0x004b('0x31')](_0x81ec1c[_0x004b('0x2d')],_0x81ec1c[_0x004b('0x2f')]);_0x25b7be[_0x004b('0x32')]=_[_0x004b('0x31')](_0x81ec1c[_0x004b('0x2d')],qs[_0x004b('0x33')](_0x116a54[_0x004b('0x2f')][_0x004b('0x33')]));_0x25b7be['attributes']=_0x25b7be[_0x004b('0x32')][_0x004b('0x34')]?_0x25b7be[_0x004b('0x32')]:_0x81ec1c[_0x004b('0x2d')];if(!_0x116a54['query'][_0x004b('0x35')](_0x004b('0x36'))){_0x25b7be[_0x004b('0x1e')]=qs[_0x004b('0x1e')](_0x116a54[_0x004b('0x2f')][_0x004b('0x1e')]);_0x25b7be[_0x004b('0x1c')]=qs['offset'](_0x116a54['query'][_0x004b('0x1c')]);}_0x25b7be['order']=qs[_0x004b('0x37')](_0x116a54[_0x004b('0x2f')][_0x004b('0x37')]);_0x25b7be[_0x004b('0x38')]=qs['filters'](_[_0x004b('0x39')](_0x116a54[_0x004b('0x2f')],_0x81ec1c[_0x004b('0x30')]),_0xdf10e6);if(_0x116a54[_0x004b('0x2f')][_0x004b('0x3a')]){_0x25b7be[_0x004b('0x38')]=_[_0x004b('0x3b')](_0x25b7be['where'],{'$or':_[_0x004b('0x29')](_0xdf10e6,function(_0x48b853){if(_0x48b853[_0x004b('0x2c')]!==_0x004b('0x3c')){var _0x7f7b49={};_0x7f7b49[_0x48b853[_0x004b('0x27')]]={'$like':'%'+_0x116a54[_0x004b('0x2f')][_0x004b('0x3a')]+'%'};return _0x7f7b49;}})});}_0x25b7be=_[_0x004b('0x3b')]({},_0x25b7be,_0x116a54['options']);var _0x46ccc7={'where':_0x25b7be[_0x004b('0x38')]};return db[_0x004b('0x2a')][_0x004b('0x1f')](_0x46ccc7)['then'](function(_0x3e6672){_0x213a54[_0x004b('0x1f')]=_0x3e6672;if(_0x116a54[_0x004b('0x2f')]['includeAll']){_0x25b7be[_0x004b('0x3d')]=[{'all':!![]}];}return db[_0x004b('0x2a')]['findAll'](_0x25b7be);})[_0x004b('0x23')](function(_0x5d962c){_0x213a54[_0x004b('0x3e')]=_0x5d962c;return _0x213a54;})['then'](respondWithFilteredResult(_0x4f472c,_0x25b7be))['catch'](handleError(_0x4f472c,null));};exports[_0x004b('0x3f')]=function(_0x13635d,_0x396705){var _0x2514ab={'raw':!![],'where':{'id':_0x13635d['params']['id']}},_0x502312={};_0x502312[_0x004b('0x2d')]=_[_0x004b('0x2e')](db[_0x004b('0x2a')][_0x004b('0x2b')]);_0x502312[_0x004b('0x2f')]=_[_0x004b('0x2e')](_0x13635d['query']);_0x502312[_0x004b('0x30')]=_[_0x004b('0x31')](_0x502312[_0x004b('0x2d')],_0x502312[_0x004b('0x2f')]);_0x2514ab[_0x004b('0x32')]=_[_0x004b('0x31')](_0x502312[_0x004b('0x2d')],qs['fields'](_0x13635d[_0x004b('0x2f')][_0x004b('0x33')]));_0x2514ab[_0x004b('0x32')]=_0x2514ab['attributes'][_0x004b('0x34')]?_0x2514ab[_0x004b('0x32')]:_0x502312[_0x004b('0x2d')];if(_0x13635d['query']['includeAll']){_0x2514ab[_0x004b('0x3d')]=[{'all':!![]}];}_0x2514ab=_[_0x004b('0x3b')]({},_0x2514ab,_0x13635d[_0x004b('0x40')]);return db[_0x004b('0x2a')]['find'](_0x2514ab)['then'](handleEntityNotFound(_0x396705,null))[_0x004b('0x23')](respondWithResult(_0x396705,null))[_0x004b('0x41')](handleError(_0x396705,null));};exports['create']=function(_0x34a819,_0x28cdc6){return db[_0x004b('0x2a')][_0x004b('0x42')](_0x34a819[_0x004b('0x43')],{})['then'](respondWithResult(_0x28cdc6,0xc9))[_0x004b('0x41')](handleError(_0x28cdc6,null));};exports['update']=function(_0x59076a,_0x9a20ff){if(_0x59076a[_0x004b('0x43')]['id']){delete _0x59076a[_0x004b('0x43')]['id'];}return db[_0x004b('0x2a')][_0x004b('0x44')]({'where':{'id':_0x59076a[_0x004b('0x45')]['id']}})[_0x004b('0x23')](handleEntityNotFound(_0x9a20ff,null))[_0x004b('0x23')](saveUpdates(_0x59076a[_0x004b('0x43')],null))[_0x004b('0x23')](respondWithResult(_0x9a20ff,null))['catch'](handleError(_0x9a20ff,null));};exports['destroy']=function(_0xedf2bd,_0x1f5e9d){return db['FreshsalesField'][_0x004b('0x44')]({'where':{'id':_0xedf2bd[_0x004b('0x45')]['id']}})[_0x004b('0x23')](handleEntityNotFound(_0x1f5e9d,null))[_0x004b('0x23')](removeEntity(_0x1f5e9d,null))['catch'](handleError(_0x1f5e9d,null));};
\ No newline at end of file
index e5c88ce..6be10b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fc2=['../../config/environment','./intFreshsalesField.attributes','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0xdd83e4,_0x356cca){var _0x5c9bfc=function(_0x1ae86d){while(--_0x1ae86d){_0xdd83e4['push'](_0xdd83e4['shift']());}};_0x5c9bfc(++_0x356cca);}(_0x4fc2,0x111));var _0x24fc=function(_0x3150ab,_0x5645da){_0x3150ab=_0x3150ab-0x0;var _0x1d30d8=_0x4fc2[_0x3150ab];return _0x1d30d8;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var logger=require(_0x24fc('0x2'))(_0x24fc('0x3'));var moment=require('moment');var BPromise=require(_0x24fc('0x4'));var rp=require(_0x24fc('0x5'));var fs=require('fs');var path=require(_0x24fc('0x6'));var rimraf=require('rimraf');var config=require(_0x24fc('0x7'));var attributes=require(_0x24fc('0x8'));module['exports']=function(_0x26fcc6,_0x12d602){return _0x26fcc6['define'](_0x24fc('0x9'),attributes,{'tableName':_0x24fc('0xa'),'paranoid':![],'indexes':[{'name':_0x24fc('0xb'),'fields':[_0x24fc('0xc'),_0x24fc('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x881e=['rimraf','../../config/environment','./intFreshsalesField.attributes','FreshsalesField','int_freshsales_fields','freshsales_unique_index','../../config/logger','api','bluebird','path'];(function(_0x2db253,_0x2f6ac6){var _0x5a854a=function(_0x52654f){while(--_0x52654f){_0x2db253['push'](_0x2db253['shift']());}};_0x5a854a(++_0x2f6ac6);}(_0x881e,0x146));var _0xe881=function(_0x2dbcaf,_0x20a548){_0x2dbcaf=_0x2dbcaf-0x0;var _0x2b0ecf=_0x881e[_0x2dbcaf];return _0x2b0ecf;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe881('0x0'))(_0xe881('0x1'));var moment=require('moment');var BPromise=require(_0xe881('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe881('0x3'));var rimraf=require(_0xe881('0x4'));var config=require(_0xe881('0x5'));var attributes=require(_0xe881('0x6'));module['exports']=function(_0x1d9bc0,_0xa4fe06){return _0x1d9bc0['define'](_0xe881('0x7'),attributes,{'tableName':_0xe881('0x8'),'paranoid':![],'indexes':[{'name':_0xe881('0x9'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index fb9ddf0..89dfbdf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31f0=['../../config/environment','request','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x27cfdc,_0x484964){var _0x3a5be2=function(_0x2173b5){while(--_0x2173b5){_0x27cfdc['push'](_0x27cfdc['shift']());}};_0x3a5be2(++_0x484964);}(_0x31f0,0xb7));var _0x031f=function(_0x5891af,_0x2a8424){_0x5891af=_0x5891af-0x0;var _0x239d7f=_0x31f0[_0x5891af];return _0x239d7f;};'use strict';var _=require(_0x031f('0x0'));var util=require('util');var moment=require(_0x031f('0x1'));var BPromise=require('bluebird');var rs=require(_0x031f('0x2'));var fs=require('fs');var Redis=require(_0x031f('0x3'));var db=require(_0x031f('0x4'))['db'];var utils=require(_0x031f('0x5'));var logger=require('../../config/logger')(_0x031f('0x6'));var config=require(_0x031f('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3dc98e,_0x487e65,_0x365f59){return new BPromise(function(_0x4300b4,_0x2569b6){return client[_0x031f('0x8')](_0x3dc98e,_0x365f59)['then'](function(_0x2e5624){logger[_0x031f('0x9')](_0x031f('0xa'),_0x487e65,_0x031f('0xb'));logger[_0x031f('0xc')](_0x031f('0xd'),_0x487e65,_0x031f('0xb'),JSON[_0x031f('0xe')](_0x2e5624));if(_0x2e5624['error']){if(_0x2e5624[_0x031f('0xf')][_0x031f('0x10')]===0x1f4){logger[_0x031f('0xf')](_0x031f('0xa'),_0x487e65,_0x2e5624[_0x031f('0xf')][_0x031f('0x11')]);return _0x2569b6(_0x2e5624[_0x031f('0xf')]['message']);}logger[_0x031f('0xf')](_0x031f('0xa'),_0x487e65,_0x2e5624[_0x031f('0xf')][_0x031f('0x11')]);return _0x4300b4(_0x2e5624[_0x031f('0xf')]['message']);}else{logger['info'](_0x031f('0xa'),_0x487e65,_0x031f('0xb'));_0x4300b4(_0x2e5624[_0x031f('0x12')][_0x031f('0x11')]);}})['catch'](function(_0x1dc4a7){logger[_0x031f('0xf')]('FreshsalesField,\x20%s,\x20%s',_0x487e65,_0x1dc4a7);_0x2569b6(_0x1dc4a7);});});}
\ No newline at end of file
+var _0x814b=['info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\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(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x814b,0x1a2));var _0xb814=function(_0x57fcc0,_0x585004){_0x57fcc0=_0x57fcc0-0x0;var _0x5270df=_0x814b[_0x57fcc0];return _0x5270df;};'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')]('FreshsalesField,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}
\ No newline at end of file
index e87513a..7aebf00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x504004,_0x4b9ffc){var _0x13594c=function(_0x535ac2){while(--_0x535ac2){_0x504004['push'](_0x504004['shift']());}};_0x13594c(++_0x4b9ffc);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router;
\ No newline at end of file
+var _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(_0xe00729,_0x2334e2){var _0x7a86e7=function(_0x19755f){while(--_0x19755f){_0xe00729['push'](_0xe00729['shift']());}};_0x7a86e7(++_0x2334e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/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 88ead7f..d532d37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e6e=['ENUM','integrationTab','sequelize','exports','STRING','username'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x5e6e,0x74));var _0xe5e6=function(_0x56856c,_0x5bfc0c){_0x56856c=_0x56856c-0x0;var _0x2daf4c=_0x5e6e[_0x56856c];return _0x2daf4c;};'use strict';var Sequelize=require(_0xe5e6('0x0'));module[_0xe5e6('0x1')]={'name':{'type':Sequelize[_0xe5e6('0x2')]},'description':{'type':Sequelize[_0xe5e6('0x2')]},'username':{'type':Sequelize[_0xe5e6('0x2')],'unique':_0xe5e6('0x3')},'remoteUri':{'type':Sequelize[_0xe5e6('0x2')]},'password':{'type':Sequelize[_0xe5e6('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xe5e6('0x2')]},'securityToken':{'type':Sequelize[_0xe5e6('0x2')]},'serverUrl':{'type':Sequelize[_0xe5e6('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xe5e6('0x4')](_0xe5e6('0x5'),'newTab'),'defaultValue':_0xe5e6('0x5')}};
\ No newline at end of file
+var _0xde1a=['newTab','exports','STRING','username','ENUM','integrationTab'];(function(_0x5b2809,_0x48b226){var _0x572dee=function(_0x4b3e82){while(--_0x4b3e82){_0x5b2809['push'](_0x5b2809['shift']());}};_0x572dee(++_0x48b226);}(_0xde1a,0xfd));var _0xade1=function(_0x29d199,_0x846d87){_0x29d199=_0x29d199-0x0;var _0x2d2d9a=_0xde1a[_0x29d199];return _0x2d2d9a;};'use strict';var Sequelize=require('sequelize');module[_0xade1('0x0')]={'name':{'type':Sequelize[_0xade1('0x1')]},'description':{'type':Sequelize[_0xade1('0x1')]},'username':{'type':Sequelize[_0xade1('0x1')],'unique':_0xade1('0x2')},'remoteUri':{'type':Sequelize[_0xade1('0x1')]},'password':{'type':Sequelize[_0xade1('0x1')]},'clientId':{'type':Sequelize[_0xade1('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0xade1('0x1')]},'serverUrl':{'type':Sequelize[_0xade1('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xade1('0x3')](_0xade1('0x4'),_0xade1('0x5')),'defaultValue':_0xade1('0x4')}};
\ No newline at end of file
index 4705f14..37fde07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a1a=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','SalesforceAccount','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','getConfigurations','findOne','SalesforceConfiguration','sort','AccountId','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','clientSecret','username','remoteUri','slice','substring','Connection','login','password','concat','isNil','ticketType','sobject','describe','IsRecurrence','Description','string','int','boolean','email','textarea','phone','remove','includes','label','custom','picklistValues','value','True','true','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','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'];(function(_0x4d189e,_0x2c0a04){var _0x1b36df=function(_0x2d386c){while(--_0x2d386c){_0x4d189e['push'](_0x4d189e['shift']());}};_0x1b36df(++_0x2c0a04);}(_0x7a1a,0x1da));var _0xa7a1=function(_0x333928,_0x20e19e){_0x333928=_0x333928-0x0;var _0x1ed238=_0x7a1a[_0x333928];return _0x1ed238;};'use strict';var emlformat=require(_0xa7a1('0x0'));var rimraf=require(_0xa7a1('0x1'));var zipdir=require(_0xa7a1('0x2'));var jsonpatch=require(_0xa7a1('0x3'));var rp=require(_0xa7a1('0x4'));var moment=require(_0xa7a1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa7a1('0x6'));var util=require(_0xa7a1('0x7'));var path=require(_0xa7a1('0x8'));var sox=require(_0xa7a1('0x9'));var csv=require(_0xa7a1('0xa'));var ejs=require(_0xa7a1('0xb'));var fs=require('fs');var fs_extra=require(_0xa7a1('0xc'));var _=require(_0xa7a1('0xd'));var squel=require(_0xa7a1('0xe'));var crypto=require(_0xa7a1('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xa7a1('0x10'));var toCsv=require(_0xa7a1('0xa'));var querystring=require(_0xa7a1('0x11'));var Papa=require('papaparse');var Redis=require(_0xa7a1('0x12'));var authService=require(_0xa7a1('0x13'));var qs=require(_0xa7a1('0x14'));var as=require(_0xa7a1('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa7a1('0x16'))(_0xa7a1('0x17'));var utils=require('../../config/utils');var config=require(_0xa7a1('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xa7a1('0x19'))['db'];var integrations=require(_0xa7a1('0x1a'));function respondWithStatusCode(_0x2f704c,_0x32cbd0){_0x32cbd0=_0x32cbd0||0xcc;return function(_0x28b03a){if(_0x28b03a){return _0x2f704c[_0xa7a1('0x1b')](_0x32cbd0);}return _0x2f704c['status'](_0x32cbd0)['end']();};}function respondWithResult(_0x41de1a,_0x5a954a){_0x5a954a=_0x5a954a||0xc8;return function(_0x2fb392){if(_0x2fb392){return _0x41de1a[_0xa7a1('0x1c')](_0x5a954a)[_0xa7a1('0x1d')](_0x2fb392);}};}function respondWithFilteredResult(_0x5eba14,_0x2ffbad){return function(_0x4abe07){if(_0x4abe07){var _0x100f6c=typeof _0x2ffbad['offset']===_0xa7a1('0x1e')&&typeof _0x2ffbad[_0xa7a1('0x1f')]===_0xa7a1('0x1e');var _0x16e7f4=_0x4abe07['count'];var _0x3cfb67=_0x100f6c?0x0:_0x2ffbad[_0xa7a1('0x20')];var _0x3fb0b0=_0x100f6c?_0x4abe07[_0xa7a1('0x21')]:_0x2ffbad[_0xa7a1('0x20')]+_0x2ffbad[_0xa7a1('0x1f')];var _0x12bc20;if(_0x3fb0b0>=_0x16e7f4){_0x3fb0b0=_0x16e7f4;_0x12bc20=0xc8;}else{_0x12bc20=0xce;}_0x5eba14[_0xa7a1('0x1c')](_0x12bc20);return _0x5eba14[_0xa7a1('0x22')](_0xa7a1('0x23'),_0x3cfb67+'-'+_0x3fb0b0+'/'+_0x16e7f4)[_0xa7a1('0x1d')](_0x4abe07);}return null;};}function patchUpdates(_0x5d92e7){return function(_0x236595){try{jsonpatch[_0xa7a1('0x24')](_0x236595,_0x5d92e7,!![]);}catch(_0x5f18ae){return BPromise[_0xa7a1('0x25')](_0x5f18ae);}return _0x236595[_0xa7a1('0x26')]();};}function saveUpdates(_0x35e019,_0x34a41a){return function(_0x41e744){if(_0x41e744){return _0x41e744[_0xa7a1('0x27')](_0x35e019)[_0xa7a1('0x28')](function(_0x380e21){return _0x380e21;});}return null;};}function removeEntity(_0x276ccd,_0x5cc4a6){return function(_0x4ebcd7){if(_0x4ebcd7){return _0x4ebcd7['destroy']()['then'](function(){_0x276ccd[_0xa7a1('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16aa59,_0x9db080){return function(_0x20f03c){if(!_0x20f03c){_0x16aa59[_0xa7a1('0x1b')](0x194);}return _0x20f03c;};}function handleError(_0x21e1d1,_0x1df8b9){_0x1df8b9=_0x1df8b9||0x1f4;return function(_0x4aef6f){logger[_0xa7a1('0x29')](_0x4aef6f[_0xa7a1('0x2a')]);if(_0x4aef6f[_0xa7a1('0x2b')]){delete _0x4aef6f['name'];}_0x21e1d1[_0xa7a1('0x1c')](_0x1df8b9)[_0xa7a1('0x2c')](_0x4aef6f);};}exports[_0xa7a1('0x2d')]=function(_0x1b4ab8,_0x514273){var _0x5764dc={},_0x4f4e5f={},_0xa92183={'count':0x0,'rows':[]};var _0x476169=_['map'](db[_0xa7a1('0x2e')][_0xa7a1('0x2f')],function(_0x32c217){return{'name':_0x32c217[_0xa7a1('0x30')],'type':_0x32c217[_0xa7a1('0x31')]['key']};});_0x4f4e5f[_0xa7a1('0x32')]=_[_0xa7a1('0x33')](_0x476169,_0xa7a1('0x2b'));_0x4f4e5f[_0xa7a1('0x34')]=_[_0xa7a1('0x35')](_0x1b4ab8[_0xa7a1('0x34')]);_0x4f4e5f[_0xa7a1('0x36')]=_[_0xa7a1('0x37')](_0x4f4e5f[_0xa7a1('0x32')],_0x4f4e5f['query']);_0x5764dc[_0xa7a1('0x38')]=_[_0xa7a1('0x37')](_0x4f4e5f[_0xa7a1('0x32')],qs[_0xa7a1('0x39')](_0x1b4ab8['query']['fields']));_0x5764dc[_0xa7a1('0x38')]=_0x5764dc['attributes'][_0xa7a1('0x3a')]?_0x5764dc[_0xa7a1('0x38')]:_0x4f4e5f[_0xa7a1('0x32')];if(!_0x1b4ab8['query'][_0xa7a1('0x3b')](_0xa7a1('0x3c'))){_0x5764dc[_0xa7a1('0x1f')]=qs[_0xa7a1('0x1f')](_0x1b4ab8[_0xa7a1('0x34')][_0xa7a1('0x1f')]);_0x5764dc[_0xa7a1('0x20')]=qs[_0xa7a1('0x20')](_0x1b4ab8[_0xa7a1('0x34')][_0xa7a1('0x20')]);}_0x5764dc[_0xa7a1('0x3d')]=qs['sort'](_0x1b4ab8[_0xa7a1('0x34')]['sort']);_0x5764dc[_0xa7a1('0x3e')]=qs['filters'](_['pick'](_0x1b4ab8[_0xa7a1('0x34')],_0x4f4e5f['filters']),_0x476169);if(_0x1b4ab8[_0xa7a1('0x34')][_0xa7a1('0x3f')]){_0x5764dc[_0xa7a1('0x3e')]=_[_0xa7a1('0x40')](_0x5764dc[_0xa7a1('0x3e')],{'$or':_[_0xa7a1('0x33')](_0x476169,function(_0x5afcf8){if(_0x5afcf8['type']!==_0xa7a1('0x41')){var _0x4600c6={};_0x4600c6[_0x5afcf8[_0xa7a1('0x2b')]]={'$like':'%'+_0x1b4ab8['query'][_0xa7a1('0x3f')]+'%'};return _0x4600c6;}})});}_0x5764dc=_[_0xa7a1('0x40')]({},_0x5764dc,_0x1b4ab8[_0xa7a1('0x42')]);var _0x472561={'where':_0x5764dc[_0xa7a1('0x3e')]};return db[_0xa7a1('0x2e')][_0xa7a1('0x21')](_0x472561)['then'](function(_0x8aa1fd){_0xa92183['count']=_0x8aa1fd;if(_0x1b4ab8[_0xa7a1('0x34')][_0xa7a1('0x43')]){_0x5764dc[_0xa7a1('0x44')]=[{'all':!![]}];}return db['SalesforceAccount'][_0xa7a1('0x45')](_0x5764dc);})[_0xa7a1('0x28')](function(_0x219c0b){_0xa92183[_0xa7a1('0x46')]=_0x219c0b;return _0xa92183;})[_0xa7a1('0x28')](respondWithFilteredResult(_0x514273,_0x5764dc))[_0xa7a1('0x47')](handleError(_0x514273,null));};exports[_0xa7a1('0x48')]=function(_0x2673e3,_0x4f63a4){var _0x471638={'raw':![],'where':{'id':_0x2673e3[_0xa7a1('0x49')]['id']}},_0x17310b={};_0x17310b[_0xa7a1('0x32')]=_[_0xa7a1('0x35')](db[_0xa7a1('0x2e')][_0xa7a1('0x2f')]);_0x17310b['query']=_['keys'](_0x2673e3[_0xa7a1('0x34')]);_0x17310b[_0xa7a1('0x36')]=_['intersection'](_0x17310b[_0xa7a1('0x32')],_0x17310b['query']);_0x471638['attributes']=_[_0xa7a1('0x37')](_0x17310b['model'],qs[_0xa7a1('0x39')](_0x2673e3['query'][_0xa7a1('0x39')]));_0x471638['attributes']=_0x471638['attributes']['length']?_0x471638['attributes']:_0x17310b[_0xa7a1('0x32')];if(_0x2673e3[_0xa7a1('0x34')]['includeAll']){_0x471638['include']=[{'all':!![]}];}_0x471638=_['merge']({},_0x471638,_0x2673e3[_0xa7a1('0x42')]);return db[_0xa7a1('0x2e')][_0xa7a1('0x4a')](_0x471638)['then'](handleEntityNotFound(_0x4f63a4,null))[_0xa7a1('0x28')](respondWithResult(_0x4f63a4,null))[_0xa7a1('0x47')](handleError(_0x4f63a4,null));};exports[_0xa7a1('0x4b')]=function(_0x595d80,_0x4cd6b3){return db['SalesforceAccount']['create'](_0x595d80[_0xa7a1('0x4c')],{})[_0xa7a1('0x28')](respondWithResult(_0x4cd6b3,0xc9))['catch'](handleError(_0x4cd6b3,null));};exports[_0xa7a1('0x27')]=function(_0x6d5967,_0xbb8b8d){if(_0x6d5967['body']['id']){delete _0x6d5967[_0xa7a1('0x4c')]['id'];}return db[_0xa7a1('0x2e')]['find']({'where':{'id':_0x6d5967[_0xa7a1('0x49')]['id']}})[_0xa7a1('0x28')](handleEntityNotFound(_0xbb8b8d,null))[_0xa7a1('0x28')](saveUpdates(_0x6d5967[_0xa7a1('0x4c')],null))[_0xa7a1('0x28')](respondWithResult(_0xbb8b8d,null))[_0xa7a1('0x47')](handleError(_0xbb8b8d,null));};exports[_0xa7a1('0x4d')]=function(_0x34d1d8,_0x5c8084){return db['SalesforceAccount'][_0xa7a1('0x4a')]({'where':{'id':_0x34d1d8[_0xa7a1('0x49')]['id']}})['then'](handleEntityNotFound(_0x5c8084,null))[_0xa7a1('0x28')](removeEntity(_0x5c8084,null))['catch'](handleError(_0x5c8084,null));};exports[_0xa7a1('0x4e')]=function(_0x3bcb14,_0x4e88f7,_0x192718){var _0x417198={};var _0x2858ca={};var _0x35475b;var _0x5afc69;return db[_0xa7a1('0x2e')][_0xa7a1('0x4f')]({'where':{'id':_0x3bcb14[_0xa7a1('0x49')]['id']}})['then'](handleEntityNotFound(_0x4e88f7,null))[_0xa7a1('0x28')](function(_0x198e7e){if(_0x198e7e){_0x35475b=_0x198e7e;_0x2858ca['model']=_[_0xa7a1('0x35')](db[_0xa7a1('0x50')][_0xa7a1('0x2f')]);_0x2858ca[_0xa7a1('0x34')]=_['keys'](_0x3bcb14[_0xa7a1('0x34')]);_0x2858ca['filters']=_[_0xa7a1('0x37')](_0x2858ca[_0xa7a1('0x32')],_0x2858ca['query']);_0x417198[_0xa7a1('0x38')]=_[_0xa7a1('0x37')](_0x2858ca[_0xa7a1('0x32')],qs[_0xa7a1('0x39')](_0x3bcb14[_0xa7a1('0x34')]['fields']));_0x417198[_0xa7a1('0x38')]=_0x417198[_0xa7a1('0x38')][_0xa7a1('0x3a')]?_0x417198[_0xa7a1('0x38')]:_0x2858ca[_0xa7a1('0x32')];_0x417198[_0xa7a1('0x3d')]=qs[_0xa7a1('0x51')](_0x3bcb14['query'][_0xa7a1('0x51')]);_0x417198['where']=qs[_0xa7a1('0x36')](_['pick'](_0x3bcb14[_0xa7a1('0x34')],_0x2858ca['filters']));if(_0x3bcb14[_0xa7a1('0x34')][_0xa7a1('0x3f')]){_0x417198[_0xa7a1('0x3e')]=_[_0xa7a1('0x40')](_0x417198[_0xa7a1('0x3e')],{'$or':_[_0xa7a1('0x33')](_0x417198[_0xa7a1('0x38')],function(_0x405047){var _0xfb676b={};_0xfb676b[_0x405047]={'$like':'%'+_0x3bcb14[_0xa7a1('0x34')]['filter']+'%'};return _0xfb676b;})});}_0x417198=_[_0xa7a1('0x40')]({},_0x417198,_0x3bcb14['options']);return _0x35475b['getConfigurations'](_0x417198);}})[_0xa7a1('0x28')](function(_0xfbb745){if(_0xfbb745){_0x5afc69=_0xfbb745['length'];if(!_0x3bcb14['query']['hasOwnProperty']('nolimit')){_0x417198[_0xa7a1('0x1f')]=qs[_0xa7a1('0x1f')](_0x3bcb14[_0xa7a1('0x34')][_0xa7a1('0x1f')]);_0x417198[_0xa7a1('0x20')]=qs[_0xa7a1('0x20')](_0x3bcb14[_0xa7a1('0x34')]['offset']);}return _0x35475b['getConfigurations'](_0x417198);}})[_0xa7a1('0x28')](function(_0x332ec2){if(_0x332ec2){return _0x332ec2?{'count':_0x5afc69,'rows':_0x332ec2}:null;}})['then'](respondWithResult(_0x4e88f7,null))[_0xa7a1('0x47')](handleError(_0x4e88f7,null));};exports['addConfiguration']=function(_0x146e87,_0x461b69,_0x3188a2){if(_0x146e87[_0xa7a1('0x4c')]['id']){delete _0x146e87['body']['id'];}return db[_0xa7a1('0x2e')][_0xa7a1('0x4f')]({'where':{'id':_0x146e87['params']['id']}})['then'](handleEntityNotFound(_0x461b69,null))['then'](function(_0x4945b0){if(_0x4945b0){_0x146e87[_0xa7a1('0x4c')][_0xa7a1('0x52')]=_0x4945b0['id'];_0x146e87[_0xa7a1('0x4c')]['Subjects']=integrations[_0xa7a1('0x53')](_0x146e87[_0xa7a1('0x4c')][_0xa7a1('0x54')],_0x146e87['body'][_0xa7a1('0x31')]);_0x146e87['body'][_0xa7a1('0x55')]=integrations[_0xa7a1('0x56')](_0x146e87['body'][_0xa7a1('0x54')],_0x146e87[_0xa7a1('0x4c')]['type']);return db[_0xa7a1('0x50')]['create'](_0x146e87[_0xa7a1('0x4c')],{'include':[{'model':db[_0xa7a1('0x57')],'as':'Subjects'},{'model':db['SalesforceField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x461b69,null))[_0xa7a1('0x47')](handleError(_0x461b69,null));};exports['getFields']=function(_0x51589e,_0x13ce92,_0x4a5a0b){var _0x49a9c1;var _0x213995='';var _0x4cec17='Task';return db[_0xa7a1('0x2e')][_0xa7a1('0x4f')]({'where':{'id':_0x51589e[_0xa7a1('0x49')]['id']},'attributes':['id','remoteUri','clientId',_0xa7a1('0x58'),_0xa7a1('0x59'),'password','securityToken']})[_0xa7a1('0x28')](handleEntityNotFound(_0x13ce92,null))[_0xa7a1('0x28')](function(_0x1c4cf9){if(_0x1c4cf9){_0x213995=_0x1c4cf9[_0xa7a1('0x5a')];var _0x535f23=_0x213995[_0xa7a1('0x5b')](-0x1);if(_0x535f23==='/'){_0x213995=_0x213995[_0xa7a1('0x5c')](0x0,_0x213995['lastIndexOf'](_0x535f23));}_0x49a9c1=new jsforce[(_0xa7a1('0x5d'))]({'oauth2':{'loginUrl':_0x213995,'clientId':_0x1c4cf9['clientId'],'clientSecret':_0x1c4cf9[_0xa7a1('0x58')]}});return _0x49a9c1[_0xa7a1('0x5e')](_0x1c4cf9[_0xa7a1('0x59')],_0x1c4cf9[_0xa7a1('0x5f')][_0xa7a1('0x60')](_0x1c4cf9['securityToken']));}})['then'](function(_0x21744a){if(_0x21744a){if(!_[_0xa7a1('0x61')](_0x51589e[_0xa7a1('0x34')][_0xa7a1('0x62')])){_0x4cec17=_0x51589e[_0xa7a1('0x34')][_0xa7a1('0x62')];}return _0x49a9c1[_0xa7a1('0x63')](_0x4cec17)[_0xa7a1('0x64')]();}})[_0xa7a1('0x28')](function(_0x36d7c7){var _0x160f40=['OwnerId','ActivityDate','IsReminderSet',_0xa7a1('0x65'),'Subject',_0xa7a1('0x66')];var _0x4c3315=[_0xa7a1('0x67'),_0xa7a1('0x68'),'picklist',_0xa7a1('0x69'),_0xa7a1('0x6a'),_0xa7a1('0x6b'),_0xa7a1('0x6c')];if(_0x36d7c7){_[_0xa7a1('0x6d')](_0x36d7c7['fields'],function(_0x19501e){return _0x160f40[_0xa7a1('0x6e')](_0x19501e[_0xa7a1('0x2b')])||!_0x4c3315[_0xa7a1('0x6e')](_0x19501e[_0xa7a1('0x31')]);});return{'count':_0x36d7c7['fields'][_0xa7a1('0x3a')],'rows':_[_0xa7a1('0x33')](_0x36d7c7[_0xa7a1('0x39')],function(_0x7f8260){return{'id':_0x7f8260[_0xa7a1('0x2b')],'name':_0x7f8260[_0xa7a1('0x6f')],'custom':_0x7f8260[_0xa7a1('0x70')],'options':_0x7f8260[_0xa7a1('0x71')]['length']>0x0?_[_0xa7a1('0x33')](_0x7f8260[_0xa7a1('0x71')],function(_0x2c8a1f){return{'name':_0x2c8a1f[_0xa7a1('0x6f')],'value':_0x2c8a1f[_0xa7a1('0x72')]};}):_0x7f8260[_0xa7a1('0x31')]=='boolean'?[{'name':_0xa7a1('0x73'),'value':_0xa7a1('0x74')},{'name':'False','value':_0xa7a1('0x75')}]:[]};})};}})[_0xa7a1('0x28')](respondWithResult(_0x13ce92,null))['catch'](function(_0x2dd0f8){var _0x2c2b14=_0x51589e['query'][_0xa7a1('0x76')]?0x1f4:_0x2dd0f8[_0xa7a1('0x77')]||0x1f4;logger[_0xa7a1('0x29')](_0xa7a1('0x78'),'getFields',_0x2c2b14,JSON[_0xa7a1('0x79')](_0x2dd0f8));delete _0x2dd0f8[_0xa7a1('0x2b')];if(_0x2c2b14===0x191){_0x2c2b14=0x190;}_0x13ce92[_0xa7a1('0x1c')](_0x2c2b14)['send'](_0x51589e[_0xa7a1('0x34')]['test']?{'message':_0xa7a1('0x7a'),'statusCode':_0x2dd0f8['statusCode']}:_0x2dd0f8);});};
\ No newline at end of file
+var _0x970d=['length','include','find','catch','create','body','destroy','findOne','SalesforceConfiguration','getConfigurations','nolimit','addConfiguration','channel','Descriptions','getDescriptions','SalesforceField','Subjects','getFields','Task','remoteUri','clientId','slice','substring','lastIndexOf','Connection','login','username','concat','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Description','string','int','picklist','boolean','email','textarea','phone','includes','label','custom','picklistValues','value','True','False','false','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','SalesforceAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','params','rawAttributes'];(function(_0x1fdcf8,_0x3723be){var _0x288a9e=function(_0x1ec459){while(--_0x1ec459){_0x1fdcf8['push'](_0x1fdcf8['shift']());}};_0x288a9e(++_0x3723be);}(_0x970d,0x132));var _0xd970=function(_0x219fa0,_0x18b239){_0x219fa0=_0x219fa0-0x0;var _0xc603fb=_0x970d[_0x219fa0];return _0xc603fb;};'use strict';var emlformat=require(_0xd970('0x0'));var rimraf=require(_0xd970('0x1'));var zipdir=require(_0xd970('0x2'));var jsonpatch=require(_0xd970('0x3'));var rp=require('request-promise');var moment=require(_0xd970('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd970('0x5'));var path=require(_0xd970('0x6'));var sox=require(_0xd970('0x7'));var csv=require(_0xd970('0x8'));var ejs=require(_0xd970('0x9'));var fs=require('fs');var fs_extra=require(_0xd970('0xa'));var _=require(_0xd970('0xb'));var squel=require(_0xd970('0xc'));var crypto=require('crypto');var jsforce=require(_0xd970('0xd'));var deskjs=require(_0xd970('0xe'));var toCsv=require(_0xd970('0x8'));var querystring=require(_0xd970('0xf'));var Papa=require(_0xd970('0x10'));var Redis=require(_0xd970('0x11'));var authService=require(_0xd970('0x12'));var qs=require(_0xd970('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd970('0x14'));var logger=require('../../config/logger')(_0xd970('0x15'));var utils=require('../../config/utils');var config=require(_0xd970('0x16'));var licenseUtil=require(_0xd970('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xd970('0x18'));function respondWithStatusCode(_0x37b96a,_0x494228){_0x494228=_0x494228||0xcc;return function(_0x14f6e8){if(_0x14f6e8){return _0x37b96a[_0xd970('0x19')](_0x494228);}return _0x37b96a[_0xd970('0x1a')](_0x494228)[_0xd970('0x1b')]();};}function respondWithResult(_0x975839,_0x34f0df){_0x34f0df=_0x34f0df||0xc8;return function(_0x22b1f2){if(_0x22b1f2){return _0x975839[_0xd970('0x1a')](_0x34f0df)[_0xd970('0x1c')](_0x22b1f2);}};}function respondWithFilteredResult(_0x1d608b,_0x5d6804){return function(_0x12409c){if(_0x12409c){var _0x111ef8=typeof _0x5d6804['offset']===_0xd970('0x1d')&&typeof _0x5d6804[_0xd970('0x1e')]===_0xd970('0x1d');var _0x21e4a2=_0x12409c[_0xd970('0x1f')];var _0x468042=_0x111ef8?0x0:_0x5d6804['offset'];var _0x50f522=_0x111ef8?_0x12409c['count']:_0x5d6804[_0xd970('0x20')]+_0x5d6804[_0xd970('0x1e')];var _0xea4539;if(_0x50f522>=_0x21e4a2){_0x50f522=_0x21e4a2;_0xea4539=0xc8;}else{_0xea4539=0xce;}_0x1d608b['status'](_0xea4539);return _0x1d608b['set'](_0xd970('0x21'),_0x468042+'-'+_0x50f522+'/'+_0x21e4a2)[_0xd970('0x1c')](_0x12409c);}return null;};}function patchUpdates(_0x371ebb){return function(_0x835903){try{jsonpatch[_0xd970('0x22')](_0x835903,_0x371ebb,!![]);}catch(_0x275e9a){return BPromise[_0xd970('0x23')](_0x275e9a);}return _0x835903[_0xd970('0x24')]();};}function saveUpdates(_0xd67f45,_0x498e51){return function(_0x195f54){if(_0x195f54){return _0x195f54[_0xd970('0x25')](_0xd67f45)[_0xd970('0x26')](function(_0xc8963e){return _0xc8963e;});}return null;};}function removeEntity(_0x3e9b49,_0x1c30fe){return function(_0x23b2ff){if(_0x23b2ff){return _0x23b2ff['destroy']()['then'](function(){_0x3e9b49[_0xd970('0x1a')](0xcc)[_0xd970('0x1b')]();});}};}function handleEntityNotFound(_0x2d37a1,_0x2be50c){return function(_0x8da3d2){if(!_0x8da3d2){_0x2d37a1[_0xd970('0x19')](0x194);}return _0x8da3d2;};}function handleError(_0x480ce9,_0x193dc2){_0x193dc2=_0x193dc2||0x1f4;return function(_0x2ab46e){logger[_0xd970('0x27')](_0x2ab46e[_0xd970('0x28')]);if(_0x2ab46e[_0xd970('0x29')]){delete _0x2ab46e['name'];}_0x480ce9[_0xd970('0x1a')](_0x193dc2)[_0xd970('0x2a')](_0x2ab46e);};}exports[_0xd970('0x2b')]=function(_0x5ee36a,_0x2357b0){var _0x1aa9e6={},_0x3a35ac={},_0x56ccee={'count':0x0,'rows':[]};var _0x48200b=_[_0xd970('0x2c')](db[_0xd970('0x2d')]['rawAttributes'],function(_0x4221e8){return{'name':_0x4221e8[_0xd970('0x2e')],'type':_0x4221e8[_0xd970('0x2f')][_0xd970('0x30')]};});_0x3a35ac[_0xd970('0x31')]=_['map'](_0x48200b,_0xd970('0x29'));_0x3a35ac[_0xd970('0x32')]=_[_0xd970('0x33')](_0x5ee36a[_0xd970('0x32')]);_0x3a35ac[_0xd970('0x34')]=_[_0xd970('0x35')](_0x3a35ac[_0xd970('0x31')],_0x3a35ac[_0xd970('0x32')]);_0x1aa9e6[_0xd970('0x36')]=_[_0xd970('0x35')](_0x3a35ac[_0xd970('0x31')],qs['fields'](_0x5ee36a['query'][_0xd970('0x37')]));_0x1aa9e6['attributes']=_0x1aa9e6[_0xd970('0x36')]['length']?_0x1aa9e6[_0xd970('0x36')]:_0x3a35ac[_0xd970('0x31')];if(!_0x5ee36a[_0xd970('0x32')]['hasOwnProperty']('nolimit')){_0x1aa9e6[_0xd970('0x1e')]=qs['limit'](_0x5ee36a[_0xd970('0x32')][_0xd970('0x1e')]);_0x1aa9e6[_0xd970('0x20')]=qs[_0xd970('0x20')](_0x5ee36a[_0xd970('0x32')][_0xd970('0x20')]);}_0x1aa9e6[_0xd970('0x38')]=qs[_0xd970('0x39')](_0x5ee36a[_0xd970('0x32')]['sort']);_0x1aa9e6['where']=qs[_0xd970('0x34')](_[_0xd970('0x3a')](_0x5ee36a[_0xd970('0x32')],_0x3a35ac[_0xd970('0x34')]),_0x48200b);if(_0x5ee36a[_0xd970('0x32')][_0xd970('0x3b')]){_0x1aa9e6[_0xd970('0x3c')]=_[_0xd970('0x3d')](_0x1aa9e6[_0xd970('0x3c')],{'$or':_['map'](_0x48200b,function(_0xc42625){if(_0xc42625[_0xd970('0x2f')]!==_0xd970('0x3e')){var _0x2aa68d={};_0x2aa68d[_0xc42625[_0xd970('0x29')]]={'$like':'%'+_0x5ee36a[_0xd970('0x32')][_0xd970('0x3b')]+'%'};return _0x2aa68d;}})});}_0x1aa9e6=_[_0xd970('0x3d')]({},_0x1aa9e6,_0x5ee36a[_0xd970('0x3f')]);var _0x2c5a23={'where':_0x1aa9e6[_0xd970('0x3c')]};return db[_0xd970('0x2d')][_0xd970('0x1f')](_0x2c5a23)[_0xd970('0x26')](function(_0x4790cb){_0x56ccee[_0xd970('0x1f')]=_0x4790cb;if(_0x5ee36a[_0xd970('0x32')][_0xd970('0x40')]){_0x1aa9e6['include']=[{'all':!![]}];}return db[_0xd970('0x2d')][_0xd970('0x41')](_0x1aa9e6);})[_0xd970('0x26')](function(_0x1f48f5){_0x56ccee[_0xd970('0x42')]=_0x1f48f5;return _0x56ccee;})[_0xd970('0x26')](respondWithFilteredResult(_0x2357b0,_0x1aa9e6))['catch'](handleError(_0x2357b0,null));};exports['show']=function(_0x3cc300,_0x307684){var _0x2f1d58={'raw':![],'where':{'id':_0x3cc300[_0xd970('0x43')]['id']}},_0xab8284={};_0xab8284['model']=_[_0xd970('0x33')](db['SalesforceAccount'][_0xd970('0x44')]);_0xab8284[_0xd970('0x32')]=_[_0xd970('0x33')](_0x3cc300['query']);_0xab8284[_0xd970('0x34')]=_['intersection'](_0xab8284['model'],_0xab8284[_0xd970('0x32')]);_0x2f1d58[_0xd970('0x36')]=_[_0xd970('0x35')](_0xab8284[_0xd970('0x31')],qs[_0xd970('0x37')](_0x3cc300[_0xd970('0x32')][_0xd970('0x37')]));_0x2f1d58[_0xd970('0x36')]=_0x2f1d58['attributes'][_0xd970('0x45')]?_0x2f1d58['attributes']:_0xab8284[_0xd970('0x31')];if(_0x3cc300[_0xd970('0x32')][_0xd970('0x40')]){_0x2f1d58[_0xd970('0x46')]=[{'all':!![]}];}_0x2f1d58=_[_0xd970('0x3d')]({},_0x2f1d58,_0x3cc300['options']);return db[_0xd970('0x2d')][_0xd970('0x47')](_0x2f1d58)[_0xd970('0x26')](handleEntityNotFound(_0x307684,null))['then'](respondWithResult(_0x307684,null))[_0xd970('0x48')](handleError(_0x307684,null));};exports[_0xd970('0x49')]=function(_0x2b90c4,_0x27343d){return db[_0xd970('0x2d')][_0xd970('0x49')](_0x2b90c4['body'],{})['then'](respondWithResult(_0x27343d,0xc9))[_0xd970('0x48')](handleError(_0x27343d,null));};exports[_0xd970('0x25')]=function(_0x4d5a86,_0x3b56ab){if(_0x4d5a86['body']['id']){delete _0x4d5a86[_0xd970('0x4a')]['id'];}return db[_0xd970('0x2d')][_0xd970('0x47')]({'where':{'id':_0x4d5a86[_0xd970('0x43')]['id']}})[_0xd970('0x26')](handleEntityNotFound(_0x3b56ab,null))['then'](saveUpdates(_0x4d5a86[_0xd970('0x4a')],null))[_0xd970('0x26')](respondWithResult(_0x3b56ab,null))['catch'](handleError(_0x3b56ab,null));};exports[_0xd970('0x4b')]=function(_0x215a9a,_0x365741){return db[_0xd970('0x2d')]['find']({'where':{'id':_0x215a9a[_0xd970('0x43')]['id']}})['then'](handleEntityNotFound(_0x365741,null))['then'](removeEntity(_0x365741,null))[_0xd970('0x48')](handleError(_0x365741,null));};exports['getConfigurations']=function(_0x41180b,_0x3178be,_0xf03673){var _0x2be1cc={};var _0x38ab21={};var _0x28e197;var _0x81b83;return db[_0xd970('0x2d')][_0xd970('0x4c')]({'where':{'id':_0x41180b[_0xd970('0x43')]['id']}})[_0xd970('0x26')](handleEntityNotFound(_0x3178be,null))[_0xd970('0x26')](function(_0x9a0eee){if(_0x9a0eee){_0x28e197=_0x9a0eee;_0x38ab21[_0xd970('0x31')]=_[_0xd970('0x33')](db[_0xd970('0x4d')][_0xd970('0x44')]);_0x38ab21['query']=_[_0xd970('0x33')](_0x41180b['query']);_0x38ab21[_0xd970('0x34')]=_['intersection'](_0x38ab21[_0xd970('0x31')],_0x38ab21[_0xd970('0x32')]);_0x2be1cc['attributes']=_[_0xd970('0x35')](_0x38ab21[_0xd970('0x31')],qs[_0xd970('0x37')](_0x41180b['query'][_0xd970('0x37')]));_0x2be1cc[_0xd970('0x36')]=_0x2be1cc[_0xd970('0x36')][_0xd970('0x45')]?_0x2be1cc['attributes']:_0x38ab21[_0xd970('0x31')];_0x2be1cc[_0xd970('0x38')]=qs[_0xd970('0x39')](_0x41180b[_0xd970('0x32')][_0xd970('0x39')]);_0x2be1cc[_0xd970('0x3c')]=qs[_0xd970('0x34')](_[_0xd970('0x3a')](_0x41180b[_0xd970('0x32')],_0x38ab21[_0xd970('0x34')]));if(_0x41180b['query'][_0xd970('0x3b')]){_0x2be1cc[_0xd970('0x3c')]=_['merge'](_0x2be1cc[_0xd970('0x3c')],{'$or':_['map'](_0x2be1cc[_0xd970('0x36')],function(_0x122a81){var _0x6d7e1a={};_0x6d7e1a[_0x122a81]={'$like':'%'+_0x41180b[_0xd970('0x32')][_0xd970('0x3b')]+'%'};return _0x6d7e1a;})});}_0x2be1cc=_[_0xd970('0x3d')]({},_0x2be1cc,_0x41180b[_0xd970('0x3f')]);return _0x28e197[_0xd970('0x4e')](_0x2be1cc);}})[_0xd970('0x26')](function(_0xc30339){if(_0xc30339){_0x81b83=_0xc30339[_0xd970('0x45')];if(!_0x41180b[_0xd970('0x32')]['hasOwnProperty'](_0xd970('0x4f'))){_0x2be1cc[_0xd970('0x1e')]=qs[_0xd970('0x1e')](_0x41180b[_0xd970('0x32')][_0xd970('0x1e')]);_0x2be1cc['offset']=qs[_0xd970('0x20')](_0x41180b[_0xd970('0x32')][_0xd970('0x20')]);}return _0x28e197[_0xd970('0x4e')](_0x2be1cc);}})[_0xd970('0x26')](function(_0x4b4575){if(_0x4b4575){return _0x4b4575?{'count':_0x81b83,'rows':_0x4b4575}:null;}})[_0xd970('0x26')](respondWithResult(_0x3178be,null))['catch'](handleError(_0x3178be,null));};exports[_0xd970('0x50')]=function(_0xfef84c,_0x1847c9,_0x5ae933){if(_0xfef84c[_0xd970('0x4a')]['id']){delete _0xfef84c[_0xd970('0x4a')]['id'];}return db[_0xd970('0x2d')][_0xd970('0x4c')]({'where':{'id':_0xfef84c['params']['id']}})[_0xd970('0x26')](handleEntityNotFound(_0x1847c9,null))[_0xd970('0x26')](function(_0x4ae6b0){if(_0x4ae6b0){_0xfef84c['body']['AccountId']=_0x4ae6b0['id'];_0xfef84c[_0xd970('0x4a')]['Subjects']=integrations['getSubjects'](_0xfef84c[_0xd970('0x4a')][_0xd970('0x51')],_0xfef84c[_0xd970('0x4a')][_0xd970('0x2f')]);_0xfef84c[_0xd970('0x4a')][_0xd970('0x52')]=integrations[_0xd970('0x53')](_0xfef84c[_0xd970('0x4a')][_0xd970('0x51')],_0xfef84c[_0xd970('0x4a')][_0xd970('0x2f')]);return db['SalesforceConfiguration'][_0xd970('0x49')](_0xfef84c[_0xd970('0x4a')],{'include':[{'model':db[_0xd970('0x54')],'as':_0xd970('0x55')},{'model':db[_0xd970('0x54')],'as':_0xd970('0x52')}]});}return null;})[_0xd970('0x26')](respondWithResult(_0x1847c9,null))[_0xd970('0x48')](handleError(_0x1847c9,null));};exports[_0xd970('0x56')]=function(_0x4aa346,_0x53dff6,_0x5694ff){var _0x4cdea2;var _0x22b0c7='';var _0x599dec=_0xd970('0x57');return db[_0xd970('0x2d')][_0xd970('0x4c')]({'where':{'id':_0x4aa346[_0xd970('0x43')]['id']},'attributes':['id',_0xd970('0x58'),_0xd970('0x59'),'clientSecret','username','password','securityToken']})['then'](handleEntityNotFound(_0x53dff6,null))[_0xd970('0x26')](function(_0x41096a){if(_0x41096a){_0x22b0c7=_0x41096a[_0xd970('0x58')];var _0x5a3c54=_0x22b0c7[_0xd970('0x5a')](-0x1);if(_0x5a3c54==='/'){_0x22b0c7=_0x22b0c7[_0xd970('0x5b')](0x0,_0x22b0c7[_0xd970('0x5c')](_0x5a3c54));}_0x4cdea2=new jsforce[(_0xd970('0x5d'))]({'oauth2':{'loginUrl':_0x22b0c7,'clientId':_0x41096a[_0xd970('0x59')],'clientSecret':_0x41096a['clientSecret']}});return _0x4cdea2[_0xd970('0x5e')](_0x41096a[_0xd970('0x5f')],_0x41096a['password'][_0xd970('0x60')](_0x41096a['securityToken']));}})[_0xd970('0x26')](function(_0x559e3b){if(_0x559e3b){if(!_['isNil'](_0x4aa346['query'][_0xd970('0x61')])){_0x599dec=_0x4aa346['query'][_0xd970('0x61')];}return _0x4cdea2[_0xd970('0x62')](_0x599dec)[_0xd970('0x63')]();}})[_0xd970('0x26')](function(_0x272844){var _0x17e8bb=[_0xd970('0x64'),_0xd970('0x65'),_0xd970('0x66'),_0xd970('0x67'),'Subject',_0xd970('0x68')];var _0x1aed41=[_0xd970('0x69'),_0xd970('0x6a'),_0xd970('0x6b'),_0xd970('0x6c'),_0xd970('0x6d'),_0xd970('0x6e'),_0xd970('0x6f')];if(_0x272844){_['remove'](_0x272844[_0xd970('0x37')],function(_0x3f4aa0){return _0x17e8bb[_0xd970('0x70')](_0x3f4aa0[_0xd970('0x29')])||!_0x1aed41[_0xd970('0x70')](_0x3f4aa0[_0xd970('0x2f')]);});return{'count':_0x272844[_0xd970('0x37')][_0xd970('0x45')],'rows':_['map'](_0x272844['fields'],function(_0x1ea8f8){return{'id':_0x1ea8f8['name'],'name':_0x1ea8f8[_0xd970('0x71')],'custom':_0x1ea8f8[_0xd970('0x72')],'options':_0x1ea8f8[_0xd970('0x73')][_0xd970('0x45')]>0x0?_[_0xd970('0x2c')](_0x1ea8f8['picklistValues'],function(_0xde0101){return{'name':_0xde0101['label'],'value':_0xde0101[_0xd970('0x74')]};}):_0x1ea8f8['type']=='boolean'?[{'name':_0xd970('0x75'),'value':'true'},{'name':_0xd970('0x76'),'value':_0xd970('0x77')}]:[]};})};}})['then'](respondWithResult(_0x53dff6,null))['catch'](function(_0x527319){var _0x25c719=_0x4aa346[_0xd970('0x32')]['test']?0x1f4:_0x527319[_0xd970('0x78')]||0x1f4;logger[_0xd970('0x27')](_0xd970('0x79'),'getFields',_0x25c719,JSON[_0xd970('0x7a')](_0x527319));delete _0x527319[_0xd970('0x29')];if(_0x25c719===0x191){_0x25c719=0x190;}_0x53dff6['status'](_0x25c719)[_0xd970('0x2a')](_0x4aa346[_0xd970('0x32')][_0xd970('0x7b')]?{'message':_0xd970('0x7c'),'statusCode':_0x527319['statusCode']}:_0x527319);});};
\ No newline at end of file
index 2193f9e..0f6317a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1fa7=['request-promise','rimraf','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','util','../../config/logger','bluebird'];(function(_0x29e722,_0x33e8a7){var _0x5231ca=function(_0xdeada8){while(--_0xdeada8){_0x29e722['push'](_0x29e722['shift']());}};_0x5231ca(++_0x33e8a7);}(_0x1fa7,0x151));var _0x71fa=function(_0x59fa03,_0xb6b538){_0x59fa03=_0x59fa03-0x0;var _0x3e59ec=_0x1fa7[_0x59fa03];return _0x3e59ec;};'use strict';var _=require('lodash');var util=require(_0x71fa('0x0'));var logger=require(_0x71fa('0x1'))('api');var moment=require('moment');var BPromise=require(_0x71fa('0x2'));var rp=require(_0x71fa('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x71fa('0x4'));var config=require('../../config/environment');var attributes=require(_0x71fa('0x5'));var integrations=require(_0x71fa('0x6'));module[_0x71fa('0x7')]=function(_0x53b7a9,_0xa06ae9){return _0x53b7a9[_0x71fa('0x8')](_0x71fa('0x9'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x79c7=['rimraf','exports','define','int_salesforce_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x315b50,_0x7025f2){var _0x4d426f=function(_0x3767cd){while(--_0x3767cd){_0x315b50['push'](_0x315b50['shift']());}};_0x4d426f(++_0x7025f2);}(_0x79c7,0x154));var _0x779c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x79c7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x779c('0x0'));var util=require(_0x779c('0x1'));var logger=require(_0x779c('0x2'))(_0x779c('0x3'));var moment=require(_0x779c('0x4'));var BPromise=require(_0x779c('0x5'));var rp=require(_0x779c('0x6'));var fs=require('fs');var path=require(_0x779c('0x7'));var rimraf=require(_0x779c('0x8'));var config=require('../../config/environment');var attributes=require('./intSalesforceAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x779c('0x9')]=function(_0x48ff3c,_0x564f48){return _0x48ff3c[_0x779c('0xa')]('SalesforceAccount',attributes,{'tableName':_0x779c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9b2e032..ae7e406 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfefc=['map','model','ShowSalesforceAccount','raw','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','attributes','limit','include'];(function(_0x212dad,_0xb862ef){var _0x4fea3f=function(_0x31664b){while(--_0x31664b){_0x212dad['push'](_0x212dad['shift']());}};_0x4fea3f(++_0xb862ef);}(_0xfefc,0xfa));var _0xcfef=function(_0x3ce70e,_0x158f22){_0x3ce70e=_0x3ce70e-0x0;var _0x5e627c=_0xfefc[_0x3ce70e];return _0x5e627c;};'use strict';var _=require(_0xcfef('0x0'));var util=require(_0xcfef('0x1'));var moment=require(_0xcfef('0x2'));var BPromise=require(_0xcfef('0x3'));var rs=require(_0xcfef('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcfef('0x5'))['db'];var utils=require(_0xcfef('0x6'));var logger=require(_0xcfef('0x7'))(_0xcfef('0x8'));var config=require('../../config/environment');var jayson=require(_0xcfef('0x9'));var client=jayson['client'][_0xcfef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f825b,_0x570a61,_0x1075c8){return new BPromise(function(_0x5ab970,_0x5e378f){return client[_0xcfef('0xb')](_0x3f825b,_0x1075c8)[_0xcfef('0xc')](function(_0x38ea43){logger[_0xcfef('0xd')](_0xcfef('0xe'),_0x570a61,_0xcfef('0xf'));logger[_0xcfef('0x10')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x570a61,'request\x20sent',JSON[_0xcfef('0x11')](_0x38ea43));if(_0x38ea43[_0xcfef('0x12')]){if(_0x38ea43[_0xcfef('0x12')][_0xcfef('0x13')]===0x1f4){logger[_0xcfef('0x12')](_0xcfef('0xe'),_0x570a61,_0x38ea43['error']['message']);return _0x5e378f(_0x38ea43[_0xcfef('0x12')]['message']);}logger['error'](_0xcfef('0xe'),_0x570a61,_0x38ea43['error'][_0xcfef('0x14')]);return _0x5ab970(_0x38ea43[_0xcfef('0x12')][_0xcfef('0x14')]);}else{logger[_0xcfef('0xd')](_0xcfef('0xe'),_0x570a61,'request\x20sent');_0x5ab970(_0x38ea43[_0xcfef('0x15')]['message']);}})[_0xcfef('0x16')](function(_0x543dcb){logger[_0xcfef('0x12')](_0xcfef('0xe'),_0x570a61,_0x543dcb);_0x5e378f(_0x543dcb);});});}exports[_0xcfef('0x17')]=function(_0x3cbd49){var _0x108cbf=this;return new Promise(function(_0x73dd4,_0x199dc0){return db[_0xcfef('0x18')][_0xcfef('0x19')]({'raw':_0x3cbd49[_0xcfef('0x1a')]?_0x3cbd49[_0xcfef('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x3cbd49[_0xcfef('0x1a')]?_0x3cbd49['options']['where']||null:null,'attributes':_0x3cbd49['options']?_0x3cbd49[_0xcfef('0x1a')][_0xcfef('0x1b')]||null:null,'limit':_0x3cbd49[_0xcfef('0x1a')]?_0x3cbd49['options'][_0xcfef('0x1c')]||null:null,'include':_0x3cbd49[_0xcfef('0x1a')]?_0x3cbd49[_0xcfef('0x1a')][_0xcfef('0x1d')]?_[_0xcfef('0x1e')](_0x3cbd49[_0xcfef('0x1a')][_0xcfef('0x1d')],function(_0x1894df){return{'model':db[_0x1894df[_0xcfef('0x1f')]],'as':_0x1894df['as'],'attributes':_0x1894df['attributes'],'include':_0x1894df['include']?_[_0xcfef('0x1e')](_0x1894df[_0xcfef('0x1d')],function(_0x2b1499){return{'model':db[_0x2b1499[_0xcfef('0x1f')]],'as':_0x2b1499['as'],'attributes':_0x2b1499['attributes'],'include':_0x2b1499[_0xcfef('0x1d')]?_[_0xcfef('0x1e')](_0x2b1499[_0xcfef('0x1d')],function(_0x2e5f5c){return{'model':db[_0x2e5f5c['model']],'as':_0x2e5f5c['as'],'attributes':_0x2e5f5c[_0xcfef('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x56393e){logger[_0xcfef('0xd')](_0xcfef('0x17'),_0x3cbd49);logger[_0xcfef('0x10')](_0xcfef('0x17'),_0x3cbd49,JSON[_0xcfef('0x11')](_0x56393e));_0x73dd4(_0x56393e);})[_0xcfef('0x16')](function(_0x2eb43b){logger[_0xcfef('0x12')](_0xcfef('0x17'),_0x2eb43b[_0xcfef('0x14')],_0x3cbd49);_0x199dc0(_0x108cbf[_0xcfef('0x12')](0x1f4,_0x2eb43b[_0xcfef('0x14')]));});});};exports[_0xcfef('0x20')]=function(_0x21caed){var _0x14b756=this;return new Promise(function(_0xb3be48,_0xdb77ac){return db[_0xcfef('0x18')]['find']({'raw':_0x21caed[_0xcfef('0x1a')]?_0x21caed['options'][_0xcfef('0x21')]===undefined?!![]:![]:!![],'where':_0x21caed[_0xcfef('0x1a')]?_0x21caed[_0xcfef('0x1a')][_0xcfef('0x22')]||null:null,'attributes':_0x21caed[_0xcfef('0x1a')]?_0x21caed['options'][_0xcfef('0x1b')]||null:null,'include':_0x21caed[_0xcfef('0x1a')]?_0x21caed[_0xcfef('0x1a')][_0xcfef('0x1d')]?_['map'](_0x21caed['options'][_0xcfef('0x1d')],function(_0x24f7e3){return{'model':db[_0x24f7e3['model']],'as':_0x24f7e3['as'],'attributes':_0x24f7e3[_0xcfef('0x1b')],'include':_0x24f7e3['include']?_[_0xcfef('0x1e')](_0x24f7e3[_0xcfef('0x1d')],function(_0x3169d5){return{'model':db[_0x3169d5[_0xcfef('0x1f')]],'as':_0x3169d5['as'],'attributes':_0x3169d5[_0xcfef('0x1b')],'include':_0x3169d5[_0xcfef('0x1d')]?_[_0xcfef('0x1e')](_0x3169d5['include'],function(_0x4fb2ba){return{'model':db[_0x4fb2ba[_0xcfef('0x1f')]],'as':_0x4fb2ba['as'],'attributes':_0x4fb2ba[_0xcfef('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xcfef('0xc')](function(_0x561eaf){logger[_0xcfef('0xd')](_0xcfef('0x20'),_0x21caed);logger['debug']('ShowSalesforceAccount',_0x21caed,JSON['stringify'](_0x561eaf));_0xb3be48(_0x561eaf);})[_0xcfef('0x16')](function(_0x3c36dd){logger['error'](_0xcfef('0x20'),_0x3c36dd[_0xcfef('0x14')],_0x21caed);_0xdb77ac(_0x14b756[_0xcfef('0x12')](0x1f4,_0x3c36dd['message']));});});};
\ No newline at end of file
+var _0x7d51=['map','model','attributes','ShowSalesforceAccount','SalesforceAccount','find','util','moment','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSalesforceAccount','findAll','options','raw','where','limit','include'];(function(_0x472c6f,_0x55ac13){var _0x1ad694=function(_0x52b893){while(--_0x52b893){_0x472c6f['push'](_0x472c6f['shift']());}};_0x1ad694(++_0x55ac13);}(_0x7d51,0xb0));var _0x17d5=function(_0x1a5e62,_0x3fbb21){_0x1a5e62=_0x1a5e62-0x0;var _0x4dc206=_0x7d51[_0x1a5e62];return _0x4dc206;};'use strict';var _=require('lodash');var util=require(_0x17d5('0x0'));var moment=require(_0x17d5('0x1'));var BPromise=require(_0x17d5('0x2'));var rs=require(_0x17d5('0x3'));var fs=require('fs');var Redis=require(_0x17d5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x17d5('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x17d5('0x6'));var client=jayson['client'][_0x17d5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x952496,_0x836635,_0x4e3f26){return new BPromise(function(_0x411206,_0xc6cfae){return client[_0x17d5('0x8')](_0x952496,_0x4e3f26)[_0x17d5('0x9')](function(_0x659c18){logger[_0x17d5('0xa')](_0x17d5('0xb'),_0x836635,_0x17d5('0xc'));logger[_0x17d5('0xd')](_0x17d5('0xe'),_0x836635,_0x17d5('0xc'),JSON[_0x17d5('0xf')](_0x659c18));if(_0x659c18[_0x17d5('0x10')]){if(_0x659c18[_0x17d5('0x10')][_0x17d5('0x11')]===0x1f4){logger[_0x17d5('0x10')](_0x17d5('0xb'),_0x836635,_0x659c18[_0x17d5('0x10')]['message']);return _0xc6cfae(_0x659c18[_0x17d5('0x10')][_0x17d5('0x12')]);}logger[_0x17d5('0x10')](_0x17d5('0xb'),_0x836635,_0x659c18[_0x17d5('0x10')][_0x17d5('0x12')]);return _0x411206(_0x659c18[_0x17d5('0x10')][_0x17d5('0x12')]);}else{logger[_0x17d5('0xa')](_0x17d5('0xb'),_0x836635,_0x17d5('0xc'));_0x411206(_0x659c18[_0x17d5('0x13')][_0x17d5('0x12')]);}})[_0x17d5('0x14')](function(_0x1933cd){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x836635,_0x1933cd);_0xc6cfae(_0x1933cd);});});}exports[_0x17d5('0x15')]=function(_0x38c146){var _0xdfc612=this;return new Promise(function(_0x45d238,_0x3137cb){return db['SalesforceAccount'][_0x17d5('0x16')]({'raw':_0x38c146[_0x17d5('0x17')]?_0x38c146[_0x17d5('0x17')][_0x17d5('0x18')]===undefined?!![]:![]:!![],'where':_0x38c146['options']?_0x38c146[_0x17d5('0x17')][_0x17d5('0x19')]||null:null,'attributes':_0x38c146['options']?_0x38c146[_0x17d5('0x17')]['attributes']||null:null,'limit':_0x38c146[_0x17d5('0x17')]?_0x38c146[_0x17d5('0x17')][_0x17d5('0x1a')]||null:null,'include':_0x38c146[_0x17d5('0x17')]?_0x38c146[_0x17d5('0x17')][_0x17d5('0x1b')]?_[_0x17d5('0x1c')](_0x38c146[_0x17d5('0x17')][_0x17d5('0x1b')],function(_0x21ae51){return{'model':db[_0x21ae51[_0x17d5('0x1d')]],'as':_0x21ae51['as'],'attributes':_0x21ae51[_0x17d5('0x1e')],'include':_0x21ae51[_0x17d5('0x1b')]?_['map'](_0x21ae51[_0x17d5('0x1b')],function(_0x304295){return{'model':db[_0x304295[_0x17d5('0x1d')]],'as':_0x304295['as'],'attributes':_0x304295['attributes'],'include':_0x304295[_0x17d5('0x1b')]?_[_0x17d5('0x1c')](_0x304295[_0x17d5('0x1b')],function(_0x24de35){return{'model':db[_0x24de35['model']],'as':_0x24de35['as'],'attributes':_0x24de35[_0x17d5('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d7d74){logger[_0x17d5('0xa')](_0x17d5('0x15'),_0x38c146);logger['debug']('GetSalesforceAccount',_0x38c146,JSON[_0x17d5('0xf')](_0x2d7d74));_0x45d238(_0x2d7d74);})[_0x17d5('0x14')](function(_0x4f18d1){logger['error'](_0x17d5('0x15'),_0x4f18d1['message'],_0x38c146);_0x3137cb(_0xdfc612[_0x17d5('0x10')](0x1f4,_0x4f18d1[_0x17d5('0x12')]));});});};exports[_0x17d5('0x1f')]=function(_0x1a0eeb){var _0x58b94d=this;return new Promise(function(_0x1d4a7e,_0x31958b){return db[_0x17d5('0x20')][_0x17d5('0x21')]({'raw':_0x1a0eeb[_0x17d5('0x17')]?_0x1a0eeb[_0x17d5('0x17')][_0x17d5('0x18')]===undefined?!![]:![]:!![],'where':_0x1a0eeb[_0x17d5('0x17')]?_0x1a0eeb[_0x17d5('0x17')]['where']||null:null,'attributes':_0x1a0eeb['options']?_0x1a0eeb[_0x17d5('0x17')][_0x17d5('0x1e')]||null:null,'include':_0x1a0eeb['options']?_0x1a0eeb[_0x17d5('0x17')]['include']?_['map'](_0x1a0eeb[_0x17d5('0x17')][_0x17d5('0x1b')],function(_0xbd6590){return{'model':db[_0xbd6590[_0x17d5('0x1d')]],'as':_0xbd6590['as'],'attributes':_0xbd6590[_0x17d5('0x1e')],'include':_0xbd6590[_0x17d5('0x1b')]?_[_0x17d5('0x1c')](_0xbd6590[_0x17d5('0x1b')],function(_0x53e292){return{'model':db[_0x53e292[_0x17d5('0x1d')]],'as':_0x53e292['as'],'attributes':_0x53e292['attributes'],'include':_0x53e292[_0x17d5('0x1b')]?_[_0x17d5('0x1c')](_0x53e292[_0x17d5('0x1b')],function(_0x2c18d2){return{'model':db[_0x2c18d2['model']],'as':_0x2c18d2['as'],'attributes':_0x2c18d2['attributes']};}):[]};}):[]};}):[]:[]})[_0x17d5('0x9')](function(_0x38bea8){logger[_0x17d5('0xa')](_0x17d5('0x1f'),_0x1a0eeb);logger[_0x17d5('0xd')](_0x17d5('0x1f'),_0x1a0eeb,JSON[_0x17d5('0xf')](_0x38bea8));_0x1d4a7e(_0x38bea8);})[_0x17d5('0x14')](function(_0x25c545){logger[_0x17d5('0x10')]('ShowSalesforceAccount',_0x25c545[_0x17d5('0x12')],_0x1a0eeb);_0x31958b(_0x58b94d['error'](0x1f4,_0x25c545[_0x17d5('0x12')]));});});};
\ No newline at end of file
index 86c1c03..cd6d46c 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(_0x20f4fb,_0x2318a1){var _0x3051a2=function(_0xb5ae14){while(--_0xb5ae14){_0x20f4fb['push'](_0x20f4fb['shift']());}};_0x3051a2(++_0x2318a1);}(_0xadb5,0xad));var _0x5adb=function(_0x4a83b5,_0x5ba619){_0x4a83b5=_0x4a83b5-0x0;var _0x37c9ee=_0xadb5[_0x4a83b5];return _0x37c9ee;};'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(_0x2fa203,_0x5c4e2a){var _0x31dd84=function(_0x4c49c6){while(--_0x4c49c6){_0x2fa203['push'](_0x2fa203['shift']());}};_0x31dd84(++_0x5c4e2a);}(_0x5f66,0x1a0));var _0x65f6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5f66[_0x19e35c];return _0x3e1fe8;};'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 176ebb7..551c3e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb74=['Task','Case','contact_lead','contact','lead','account_contact_lead','nothing','sequelize','exports','STRING','ENUM'];(function(_0x29441b,_0x2d83b5){var _0x32460b=function(_0x426a4b){while(--_0x426a4b){_0x29441b['push'](_0x29441b['shift']());}};_0x32460b(++_0x2d83b5);}(_0xeb74,0xe3));var _0x4eb7=function(_0x241166,_0x20014e){_0x241166=_0x241166-0x0;var _0x32c379=_0xeb74[_0x241166];return _0x32c379;};'use strict';var Sequelize=require(_0x4eb7('0x0'));module[_0x4eb7('0x1')]={'name':{'type':Sequelize[_0x4eb7('0x2')]},'description':{'type':Sequelize[_0x4eb7('0x2')]},'ticketType':{'type':Sequelize[_0x4eb7('0x3')](_0x4eb7('0x4'),_0x4eb7('0x5')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0x4eb7('0x3')](_0x4eb7('0x6'),_0x4eb7('0x7'),_0x4eb7('0x8'),_0x4eb7('0x9'),'account'),'defaultValue':_0x4eb7('0x6')},'moduleCreate':{'type':Sequelize['ENUM'](_0x4eb7('0xa'),_0x4eb7('0x7'),'lead','account'),'defaultValue':_0x4eb7('0x8')},'leadId':{'type':Sequelize[_0x4eb7('0x2')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0x4eb7('0x2')]},'additionalSearchLead':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x6959=['lead','sequelize','STRING','ENUM','Task','contact','account'];(function(_0x1c35b1,_0x16fc80){var _0x4b001f=function(_0x3d252d){while(--_0x3d252d){_0x1c35b1['push'](_0x1c35b1['shift']());}};_0x4b001f(++_0x16fc80);}(_0x6959,0x119));var _0x9695=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6959[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x9695('0x0'));module['exports']={'name':{'type':Sequelize[_0x9695('0x1')]},'description':{'type':Sequelize[_0x9695('0x1')]},'ticketType':{'type':Sequelize[_0x9695('0x2')](_0x9695('0x3'),'Case'),'defaultValue':_0x9695('0x3')},'moduleSearch':{'type':Sequelize[_0x9695('0x2')]('contact_lead','contact','lead','account_contact_lead','account'),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize['ENUM']('nothing',_0x9695('0x4'),'lead',_0x9695('0x5')),'defaultValue':_0x9695('0x6')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0x9695('0x1')]},'additionalSearchContact':{'type':Sequelize[_0x9695('0x1')]},'additionalSearchLead':{'type':Sequelize[_0x9695('0x1')]}};
\ No newline at end of file
index c4283e7..1330b86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b69=['query','keys','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','SalesforceConfiguration','findAll','rows','catch','show','options','create','body','update','find','params','getFields','findOne','SalesforceField','hasOwnProperty','nolimit','getSubjects','order','getDescriptions','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','set','Content-Range','json','apply','reject','save','then','destroy','end','stack','name','index','map','rawAttributes','type','key','model'];(function(_0x8ca8ae,_0x30fac3){var _0x2817bb=function(_0x20eb93){while(--_0x20eb93){_0x8ca8ae['push'](_0x8ca8ae['shift']());}};_0x2817bb(++_0x30fac3);}(_0x6b69,0x113));var _0x96b6=function(_0x599ff0,_0x256780){_0x599ff0=_0x599ff0-0x0;var _0x5c48a5=_0x6b69[_0x599ff0];return _0x5c48a5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x96b6('0x0'));var zipdir=require(_0x96b6('0x1'));var jsonpatch=require(_0x96b6('0x2'));var rp=require('request-promise');var moment=require(_0x96b6('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x96b6('0x4'));var path=require(_0x96b6('0x5'));var sox=require(_0x96b6('0x6'));var csv=require(_0x96b6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x96b6('0x8'));var _=require(_0x96b6('0x9'));var squel=require('squel');var crypto=require(_0x96b6('0xa'));var jsforce=require(_0x96b6('0xb'));var deskjs=require(_0x96b6('0xc'));var toCsv=require('to-csv');var querystring=require(_0x96b6('0xd'));var Papa=require(_0x96b6('0xe'));var Redis=require(_0x96b6('0xf'));var authService=require(_0x96b6('0x10'));var qs=require(_0x96b6('0x11'));var as=require(_0x96b6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x96b6('0x13'));var config=require(_0x96b6('0x14'));var licenseUtil=require(_0x96b6('0x15'));var db=require(_0x96b6('0x16'))['db'];function respondWithStatusCode(_0x56bc7e,_0xdcb2e4){_0xdcb2e4=_0xdcb2e4||0xcc;return function(_0x3d65ef){if(_0x3d65ef){return _0x56bc7e[_0x96b6('0x17')](_0xdcb2e4);}return _0x56bc7e[_0x96b6('0x18')](_0xdcb2e4)['end']();};}function respondWithResult(_0x1c582d,_0x3fc9b1){_0x3fc9b1=_0x3fc9b1||0xc8;return function(_0x3a91d1){if(_0x3a91d1){return _0x1c582d[_0x96b6('0x18')](_0x3fc9b1)['json'](_0x3a91d1);}};}function respondWithFilteredResult(_0x55a010,_0x36191d){return function(_0x594b8f){if(_0x594b8f){var _0x2c81a0=typeof _0x36191d[_0x96b6('0x19')]==='undefined'&&typeof _0x36191d[_0x96b6('0x1a')]===_0x96b6('0x1b');var _0x312ea7=_0x594b8f['count'];var _0x55d4bc=_0x2c81a0?0x0:_0x36191d[_0x96b6('0x19')];var _0x498881=_0x2c81a0?_0x594b8f['count']:_0x36191d[_0x96b6('0x19')]+_0x36191d[_0x96b6('0x1a')];var _0x25c662;if(_0x498881>=_0x312ea7){_0x498881=_0x312ea7;_0x25c662=0xc8;}else{_0x25c662=0xce;}_0x55a010[_0x96b6('0x18')](_0x25c662);return _0x55a010[_0x96b6('0x1c')](_0x96b6('0x1d'),_0x55d4bc+'-'+_0x498881+'/'+_0x312ea7)[_0x96b6('0x1e')](_0x594b8f);}return null;};}function patchUpdates(_0x1678ce){return function(_0xeee6a0){try{jsonpatch[_0x96b6('0x1f')](_0xeee6a0,_0x1678ce,!![]);}catch(_0x14f9e0){return BPromise[_0x96b6('0x20')](_0x14f9e0);}return _0xeee6a0[_0x96b6('0x21')]();};}function saveUpdates(_0x184d8b,_0x2c66e5){return function(_0x37d69d){if(_0x37d69d){return _0x37d69d['update'](_0x184d8b)[_0x96b6('0x22')](function(_0x1e2ae1){return _0x1e2ae1;});}return null;};}function removeEntity(_0x528e0b,_0x519ba8){return function(_0x46f3a3){if(_0x46f3a3){return _0x46f3a3[_0x96b6('0x23')]()[_0x96b6('0x22')](function(){_0x528e0b[_0x96b6('0x18')](0xcc)[_0x96b6('0x24')]();});}};}function handleEntityNotFound(_0x43e072,_0x3fb88e){return function(_0x451571){if(!_0x451571){_0x43e072[_0x96b6('0x17')](0x194);}return _0x451571;};}function handleError(_0x24441f,_0x512fe9){_0x512fe9=_0x512fe9||0x1f4;return function(_0x383320){logger['error'](_0x383320[_0x96b6('0x25')]);if(_0x383320['name']){delete _0x383320[_0x96b6('0x26')];}_0x24441f[_0x96b6('0x18')](_0x512fe9)['send'](_0x383320);};}exports[_0x96b6('0x27')]=function(_0x25f967,_0xfe0048){var _0x2d7d2f={},_0x150f42={},_0x22d072={'count':0x0,'rows':[]};var _0x970a98=_[_0x96b6('0x28')](db['SalesforceConfiguration'][_0x96b6('0x29')],function(_0x1b00db){return{'name':_0x1b00db['fieldName'],'type':_0x1b00db[_0x96b6('0x2a')][_0x96b6('0x2b')]};});_0x150f42[_0x96b6('0x2c')]=_[_0x96b6('0x28')](_0x970a98,_0x96b6('0x26'));_0x150f42[_0x96b6('0x2d')]=_[_0x96b6('0x2e')](_0x25f967[_0x96b6('0x2d')]);_0x150f42[_0x96b6('0x2f')]=_[_0x96b6('0x30')](_0x150f42[_0x96b6('0x2c')],_0x150f42[_0x96b6('0x2d')]);_0x2d7d2f[_0x96b6('0x31')]=_[_0x96b6('0x30')](_0x150f42[_0x96b6('0x2c')],qs[_0x96b6('0x32')](_0x25f967[_0x96b6('0x2d')][_0x96b6('0x32')]));_0x2d7d2f[_0x96b6('0x31')]=_0x2d7d2f[_0x96b6('0x31')][_0x96b6('0x33')]?_0x2d7d2f['attributes']:_0x150f42[_0x96b6('0x2c')];if(!_0x25f967[_0x96b6('0x2d')]['hasOwnProperty']('nolimit')){_0x2d7d2f['limit']=qs[_0x96b6('0x1a')](_0x25f967[_0x96b6('0x2d')]['limit']);_0x2d7d2f['offset']=qs['offset'](_0x25f967[_0x96b6('0x2d')][_0x96b6('0x19')]);}_0x2d7d2f['order']=qs[_0x96b6('0x34')](_0x25f967[_0x96b6('0x2d')][_0x96b6('0x34')]);_0x2d7d2f[_0x96b6('0x35')]=qs[_0x96b6('0x2f')](_[_0x96b6('0x36')](_0x25f967[_0x96b6('0x2d')],_0x150f42[_0x96b6('0x2f')]),_0x970a98);if(_0x25f967[_0x96b6('0x2d')][_0x96b6('0x37')]){_0x2d7d2f[_0x96b6('0x35')]=_[_0x96b6('0x38')](_0x2d7d2f[_0x96b6('0x35')],{'$or':_['map'](_0x970a98,function(_0x5899b9){if(_0x5899b9[_0x96b6('0x2a')]!==_0x96b6('0x39')){var _0x2da78d={};_0x2da78d[_0x5899b9['name']]={'$like':'%'+_0x25f967[_0x96b6('0x2d')][_0x96b6('0x37')]+'%'};return _0x2da78d;}})});}_0x2d7d2f=_[_0x96b6('0x38')]({},_0x2d7d2f,_0x25f967['options']);var _0x2ed72a={'where':_0x2d7d2f['where']};return db['SalesforceConfiguration'][_0x96b6('0x3a')](_0x2ed72a)[_0x96b6('0x22')](function(_0x3e6721){_0x22d072['count']=_0x3e6721;if(_0x25f967[_0x96b6('0x2d')][_0x96b6('0x3b')]){_0x2d7d2f[_0x96b6('0x3c')]=[{'all':!![]}];}return db[_0x96b6('0x3d')][_0x96b6('0x3e')](_0x2d7d2f);})[_0x96b6('0x22')](function(_0x380f28){_0x22d072[_0x96b6('0x3f')]=_0x380f28;return _0x22d072;})[_0x96b6('0x22')](respondWithFilteredResult(_0xfe0048,_0x2d7d2f))[_0x96b6('0x40')](handleError(_0xfe0048,null));};exports[_0x96b6('0x41')]=function(_0x390e5d,_0x4deaff){var _0x1d1db0={'raw':![],'where':{'id':_0x390e5d['params']['id']}},_0x5089f2={};_0x5089f2[_0x96b6('0x2c')]=_['keys'](db[_0x96b6('0x3d')][_0x96b6('0x29')]);_0x5089f2['query']=_[_0x96b6('0x2e')](_0x390e5d[_0x96b6('0x2d')]);_0x5089f2[_0x96b6('0x2f')]=_[_0x96b6('0x30')](_0x5089f2[_0x96b6('0x2c')],_0x5089f2[_0x96b6('0x2d')]);_0x1d1db0['attributes']=_['intersection'](_0x5089f2['model'],qs[_0x96b6('0x32')](_0x390e5d[_0x96b6('0x2d')][_0x96b6('0x32')]));_0x1d1db0[_0x96b6('0x31')]=_0x1d1db0[_0x96b6('0x31')]['length']?_0x1d1db0['attributes']:_0x5089f2[_0x96b6('0x2c')];if(_0x390e5d['query']['includeAll']){_0x1d1db0[_0x96b6('0x3c')]=[{'all':!![]}];}_0x1d1db0=_['merge']({},_0x1d1db0,_0x390e5d[_0x96b6('0x42')]);return db['SalesforceConfiguration']['find'](_0x1d1db0)[_0x96b6('0x22')](handleEntityNotFound(_0x4deaff,null))[_0x96b6('0x22')](respondWithResult(_0x4deaff,null))[_0x96b6('0x40')](handleError(_0x4deaff,null));};exports['create']=function(_0x20803d,_0x3a0aa0){return db[_0x96b6('0x3d')][_0x96b6('0x43')](_0x20803d[_0x96b6('0x44')],{})['then'](respondWithResult(_0x3a0aa0,0xc9))[_0x96b6('0x40')](handleError(_0x3a0aa0,null));};exports[_0x96b6('0x45')]=function(_0x4ac72c,_0x457a3b){if(_0x4ac72c[_0x96b6('0x44')]['id']){delete _0x4ac72c[_0x96b6('0x44')]['id'];}return db['SalesforceConfiguration'][_0x96b6('0x46')]({'where':{'id':_0x4ac72c[_0x96b6('0x47')]['id']}})['then'](handleEntityNotFound(_0x457a3b,null))['then'](saveUpdates(_0x4ac72c[_0x96b6('0x44')],null))[_0x96b6('0x22')](respondWithResult(_0x457a3b,null))[_0x96b6('0x40')](handleError(_0x457a3b,null));};exports[_0x96b6('0x23')]=function(_0x2b9b53,_0x2608e4){return db[_0x96b6('0x3d')][_0x96b6('0x46')]({'where':{'id':_0x2b9b53[_0x96b6('0x47')]['id']}})[_0x96b6('0x22')](handleEntityNotFound(_0x2608e4,null))['then'](removeEntity(_0x2608e4,null))[_0x96b6('0x40')](handleError(_0x2608e4,null));};exports[_0x96b6('0x48')]=function(_0x5415f9,_0x378ca4,_0x13bbf0){var _0x46109e={};var _0x370b55={};var _0x4debc0;var _0x410c71;return db[_0x96b6('0x3d')][_0x96b6('0x49')]({'where':{'id':_0x5415f9[_0x96b6('0x47')]['id']}})[_0x96b6('0x22')](handleEntityNotFound(_0x378ca4,null))[_0x96b6('0x22')](function(_0x5f2192){if(_0x5f2192){_0x4debc0=_0x5f2192;_0x370b55[_0x96b6('0x2c')]=_[_0x96b6('0x2e')](db[_0x96b6('0x4a')]['rawAttributes']);_0x370b55['query']=_[_0x96b6('0x2e')](_0x5415f9[_0x96b6('0x2d')]);_0x370b55[_0x96b6('0x2f')]=_['intersection'](_0x370b55[_0x96b6('0x2c')],_0x370b55[_0x96b6('0x2d')]);_0x46109e['attributes']=_[_0x96b6('0x30')](_0x370b55['model'],qs[_0x96b6('0x32')](_0x5415f9[_0x96b6('0x2d')][_0x96b6('0x32')]));_0x46109e[_0x96b6('0x31')]=_0x46109e[_0x96b6('0x31')][_0x96b6('0x33')]?_0x46109e[_0x96b6('0x31')]:_0x370b55[_0x96b6('0x2c')];_0x46109e['order']=qs[_0x96b6('0x34')](_0x5415f9[_0x96b6('0x2d')]['sort']);_0x46109e['where']=qs[_0x96b6('0x2f')](_[_0x96b6('0x36')](_0x5415f9[_0x96b6('0x2d')],_0x370b55[_0x96b6('0x2f')]));if(_0x5415f9[_0x96b6('0x2d')][_0x96b6('0x37')]){_0x46109e[_0x96b6('0x35')]=_[_0x96b6('0x38')](_0x46109e['where'],{'$or':_[_0x96b6('0x28')](_0x46109e['attributes'],function(_0x3f2c6c){var _0x1146a5={};_0x1146a5[_0x3f2c6c]={'$like':'%'+_0x5415f9[_0x96b6('0x2d')][_0x96b6('0x37')]+'%'};return _0x1146a5;})});}_0x46109e=_[_0x96b6('0x38')]({},_0x46109e,_0x5415f9['options']);return _0x4debc0[_0x96b6('0x48')](_0x46109e);}})[_0x96b6('0x22')](function(_0x4b4066){if(_0x4b4066){_0x410c71=_0x4b4066[_0x96b6('0x33')];if(!_0x5415f9[_0x96b6('0x2d')][_0x96b6('0x4b')](_0x96b6('0x4c'))){_0x46109e['limit']=qs[_0x96b6('0x1a')](_0x5415f9[_0x96b6('0x2d')][_0x96b6('0x1a')]);_0x46109e[_0x96b6('0x19')]=qs[_0x96b6('0x19')](_0x5415f9[_0x96b6('0x2d')][_0x96b6('0x19')]);}return _0x4debc0[_0x96b6('0x48')](_0x46109e);}})['then'](function(_0x2eefaf){if(_0x2eefaf){return _0x2eefaf?{'count':_0x410c71,'rows':_0x2eefaf}:null;}})[_0x96b6('0x22')](respondWithResult(_0x378ca4,null))[_0x96b6('0x40')](handleError(_0x378ca4,null));};exports[_0x96b6('0x4d')]=function(_0x47c880,_0x545786,_0x136b52){var _0x283f7a={};var _0x49292a={};var _0x4b4ae3;var _0x1561d7;return db[_0x96b6('0x3d')]['findOne']({'where':{'id':_0x47c880[_0x96b6('0x47')]['id']}})[_0x96b6('0x22')](handleEntityNotFound(_0x545786,null))[_0x96b6('0x22')](function(_0x71c63b){if(_0x71c63b){_0x4b4ae3=_0x71c63b;_0x49292a['model']=_[_0x96b6('0x2e')](db['SalesforceField']['rawAttributes']);_0x49292a[_0x96b6('0x2d')]=_[_0x96b6('0x2e')](_0x47c880['query']);_0x49292a[_0x96b6('0x2f')]=_[_0x96b6('0x30')](_0x49292a[_0x96b6('0x2c')],_0x49292a[_0x96b6('0x2d')]);_0x283f7a[_0x96b6('0x31')]=_[_0x96b6('0x30')](_0x49292a[_0x96b6('0x2c')],qs['fields'](_0x47c880[_0x96b6('0x2d')][_0x96b6('0x32')]));_0x283f7a[_0x96b6('0x31')]=_0x283f7a[_0x96b6('0x31')][_0x96b6('0x33')]?_0x283f7a[_0x96b6('0x31')]:_0x49292a[_0x96b6('0x2c')];_0x283f7a[_0x96b6('0x4e')]=qs[_0x96b6('0x34')](_0x47c880['query']['sort']);_0x283f7a[_0x96b6('0x35')]=qs[_0x96b6('0x2f')](_[_0x96b6('0x36')](_0x47c880[_0x96b6('0x2d')],_0x49292a[_0x96b6('0x2f')]));if(_0x47c880[_0x96b6('0x2d')][_0x96b6('0x37')]){_0x283f7a[_0x96b6('0x35')]=_['merge'](_0x283f7a[_0x96b6('0x35')],{'$or':_[_0x96b6('0x28')](_0x283f7a[_0x96b6('0x31')],function(_0x486255){var _0x13d90f={};_0x13d90f[_0x486255]={'$like':'%'+_0x47c880[_0x96b6('0x2d')]['filter']+'%'};return _0x13d90f;})});}_0x283f7a=_['merge']({},_0x283f7a,_0x47c880[_0x96b6('0x42')]);return _0x4b4ae3['getSubjects'](_0x283f7a);}})[_0x96b6('0x22')](function(_0x36dde6){if(_0x36dde6){_0x1561d7=_0x36dde6[_0x96b6('0x33')];if(!_0x47c880[_0x96b6('0x2d')][_0x96b6('0x4b')](_0x96b6('0x4c'))){_0x283f7a[_0x96b6('0x1a')]=qs[_0x96b6('0x1a')](_0x47c880[_0x96b6('0x2d')]['limit']);_0x283f7a[_0x96b6('0x19')]=qs['offset'](_0x47c880['query'][_0x96b6('0x19')]);}return _0x4b4ae3['getSubjects'](_0x283f7a);}})[_0x96b6('0x22')](function(_0x4ebcfd){if(_0x4ebcfd){return _0x4ebcfd?{'count':_0x1561d7,'rows':_0x4ebcfd}:null;}})[_0x96b6('0x22')](respondWithResult(_0x545786,null))[_0x96b6('0x40')](handleError(_0x545786,null));};exports['getDescriptions']=function(_0x142bdd,_0x12529e,_0x357089){var _0x24e438={};var _0x37b935={};var _0x2a04d9;var _0x45e22f;return db[_0x96b6('0x3d')][_0x96b6('0x49')]({'where':{'id':_0x142bdd[_0x96b6('0x47')]['id']}})[_0x96b6('0x22')](handleEntityNotFound(_0x12529e,null))[_0x96b6('0x22')](function(_0x14cb4c){if(_0x14cb4c){_0x2a04d9=_0x14cb4c;_0x37b935[_0x96b6('0x2c')]=_[_0x96b6('0x2e')](db[_0x96b6('0x4a')]['rawAttributes']);_0x37b935['query']=_[_0x96b6('0x2e')](_0x142bdd[_0x96b6('0x2d')]);_0x37b935[_0x96b6('0x2f')]=_[_0x96b6('0x30')](_0x37b935['model'],_0x37b935[_0x96b6('0x2d')]);_0x24e438[_0x96b6('0x31')]=_[_0x96b6('0x30')](_0x37b935[_0x96b6('0x2c')],qs[_0x96b6('0x32')](_0x142bdd[_0x96b6('0x2d')]['fields']));_0x24e438[_0x96b6('0x31')]=_0x24e438[_0x96b6('0x31')]['length']?_0x24e438[_0x96b6('0x31')]:_0x37b935[_0x96b6('0x2c')];_0x24e438['order']=qs[_0x96b6('0x34')](_0x142bdd['query'][_0x96b6('0x34')]);_0x24e438[_0x96b6('0x35')]=qs[_0x96b6('0x2f')](_['pick'](_0x142bdd[_0x96b6('0x2d')],_0x37b935[_0x96b6('0x2f')]));if(_0x142bdd[_0x96b6('0x2d')]['filter']){_0x24e438['where']=_['merge'](_0x24e438['where'],{'$or':_[_0x96b6('0x28')](_0x24e438['attributes'],function(_0xca1f25){var _0x537add={};_0x537add[_0xca1f25]={'$like':'%'+_0x142bdd[_0x96b6('0x2d')]['filter']+'%'};return _0x537add;})});}_0x24e438=_['merge']({},_0x24e438,_0x142bdd['options']);return _0x2a04d9[_0x96b6('0x4f')](_0x24e438);}})[_0x96b6('0x22')](function(_0x32bae2){if(_0x32bae2){_0x45e22f=_0x32bae2[_0x96b6('0x33')];if(!_0x142bdd[_0x96b6('0x2d')]['hasOwnProperty'](_0x96b6('0x4c'))){_0x24e438['limit']=qs[_0x96b6('0x1a')](_0x142bdd[_0x96b6('0x2d')]['limit']);_0x24e438['offset']=qs[_0x96b6('0x19')](_0x142bdd[_0x96b6('0x2d')]['offset']);}return _0x2a04d9[_0x96b6('0x4f')](_0x24e438);}})['then'](function(_0x1d5f1a){if(_0x1d5f1a){return _0x1d5f1a?{'count':_0x45e22f,'rows':_0x1d5f1a}:null;}})[_0x96b6('0x22')](respondWithResult(_0x12529e,null))[_0x96b6('0x40')](handleError(_0x12529e,null));};
\ No newline at end of file
+var _0xfc26=['reject','save','then','destroy','stack','name','send','index','SalesforceConfiguration','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','params','catch','create','body','update','find','getFields','findOne','SalesforceField','rawAttributes','order','hasOwnProperty','getSubjects','getDescriptions','eml-format','zip-dir','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','undefined','limit','count','offset','apply'];(function(_0x1f4946,_0x21e173){var _0x1852de=function(_0x4f4268){while(--_0x4f4268){_0x1f4946['push'](_0x1f4946['shift']());}};_0x1852de(++_0x21e173);}(_0xfc26,0x115));var _0x6fc2=function(_0x382e89,_0x4768c0){_0x382e89=_0x382e89-0x0;var _0x3a1318=_0xfc26[_0x382e89];return _0x3a1318;};'use strict';var emlformat=require(_0x6fc2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6fc2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6fc2('0x2'));var moment=require(_0x6fc2('0x3'));var BPromise=require(_0x6fc2('0x4'));var Mustache=require('mustache');var util=require(_0x6fc2('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x6fc2('0x6'));var ejs=require(_0x6fc2('0x7'));var fs=require('fs');var fs_extra=require(_0x6fc2('0x8'));var _=require('lodash');var squel=require(_0x6fc2('0x9'));var crypto=require(_0x6fc2('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x6fc2('0xb'));var toCsv=require(_0x6fc2('0x6'));var querystring=require(_0x6fc2('0xc'));var Papa=require(_0x6fc2('0xd'));var Redis=require(_0x6fc2('0xe'));var authService=require(_0x6fc2('0xf'));var qs=require(_0x6fc2('0x10'));var as=require(_0x6fc2('0x11'));var hardwareService=require(_0x6fc2('0x12'));var logger=require(_0x6fc2('0x13'))(_0x6fc2('0x14'));var utils=require(_0x6fc2('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c534f,_0x587887){_0x587887=_0x587887||0xcc;return function(_0x135565){if(_0x135565){return _0x1c534f[_0x6fc2('0x16')](_0x587887);}return _0x1c534f[_0x6fc2('0x17')](_0x587887)[_0x6fc2('0x18')]();};}function respondWithResult(_0x1654a7,_0x843643){_0x843643=_0x843643||0xc8;return function(_0x3b2144){if(_0x3b2144){return _0x1654a7['status'](_0x843643)[_0x6fc2('0x19')](_0x3b2144);}};}function respondWithFilteredResult(_0x4f6d4f,_0xe02662){return function(_0x48dde2){if(_0x48dde2){var _0x294bd0=typeof _0xe02662['offset']===_0x6fc2('0x1a')&&typeof _0xe02662[_0x6fc2('0x1b')]===_0x6fc2('0x1a');var _0x3a6012=_0x48dde2['count'];var _0x2e6918=_0x294bd0?0x0:_0xe02662['offset'];var _0x36c57e=_0x294bd0?_0x48dde2[_0x6fc2('0x1c')]:_0xe02662[_0x6fc2('0x1d')]+_0xe02662[_0x6fc2('0x1b')];var _0x496286;if(_0x36c57e>=_0x3a6012){_0x36c57e=_0x3a6012;_0x496286=0xc8;}else{_0x496286=0xce;}_0x4f6d4f[_0x6fc2('0x17')](_0x496286);return _0x4f6d4f['set']('Content-Range',_0x2e6918+'-'+_0x36c57e+'/'+_0x3a6012)['json'](_0x48dde2);}return null;};}function patchUpdates(_0x813b96){return function(_0x518fd6){try{jsonpatch[_0x6fc2('0x1e')](_0x518fd6,_0x813b96,!![]);}catch(_0x2f2e30){return BPromise[_0x6fc2('0x1f')](_0x2f2e30);}return _0x518fd6[_0x6fc2('0x20')]();};}function saveUpdates(_0x320566,_0x3888f5){return function(_0x1d4dd5){if(_0x1d4dd5){return _0x1d4dd5['update'](_0x320566)[_0x6fc2('0x21')](function(_0x3abde9){return _0x3abde9;});}return null;};}function removeEntity(_0x30581f,_0x37a9ae){return function(_0x103b58){if(_0x103b58){return _0x103b58[_0x6fc2('0x22')]()[_0x6fc2('0x21')](function(){_0x30581f[_0x6fc2('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f4ba5,_0x40faaf){return function(_0x25f7c5){if(!_0x25f7c5){_0x4f4ba5[_0x6fc2('0x16')](0x194);}return _0x25f7c5;};}function handleError(_0x232c79,_0x31c2d2){_0x31c2d2=_0x31c2d2||0x1f4;return function(_0x34a572){logger['error'](_0x34a572[_0x6fc2('0x23')]);if(_0x34a572[_0x6fc2('0x24')]){delete _0x34a572[_0x6fc2('0x24')];}_0x232c79[_0x6fc2('0x17')](_0x31c2d2)[_0x6fc2('0x25')](_0x34a572);};}exports[_0x6fc2('0x26')]=function(_0x55dd3f,_0x30e3f5){var _0x16dc71={},_0xfb5907={},_0xd7fcc2={'count':0x0,'rows':[]};var _0x433d02=_['map'](db[_0x6fc2('0x27')]['rawAttributes'],function(_0x51023f){return{'name':_0x51023f[_0x6fc2('0x28')],'type':_0x51023f[_0x6fc2('0x29')][_0x6fc2('0x2a')]};});_0xfb5907[_0x6fc2('0x2b')]=_[_0x6fc2('0x2c')](_0x433d02,_0x6fc2('0x24'));_0xfb5907[_0x6fc2('0x2d')]=_[_0x6fc2('0x2e')](_0x55dd3f[_0x6fc2('0x2d')]);_0xfb5907[_0x6fc2('0x2f')]=_[_0x6fc2('0x30')](_0xfb5907['model'],_0xfb5907[_0x6fc2('0x2d')]);_0x16dc71['attributes']=_[_0x6fc2('0x30')](_0xfb5907[_0x6fc2('0x2b')],qs[_0x6fc2('0x31')](_0x55dd3f[_0x6fc2('0x2d')][_0x6fc2('0x31')]));_0x16dc71[_0x6fc2('0x32')]=_0x16dc71[_0x6fc2('0x32')][_0x6fc2('0x33')]?_0x16dc71['attributes']:_0xfb5907[_0x6fc2('0x2b')];if(!_0x55dd3f['query']['hasOwnProperty'](_0x6fc2('0x34'))){_0x16dc71[_0x6fc2('0x1b')]=qs[_0x6fc2('0x1b')](_0x55dd3f['query']['limit']);_0x16dc71[_0x6fc2('0x1d')]=qs[_0x6fc2('0x1d')](_0x55dd3f[_0x6fc2('0x2d')][_0x6fc2('0x1d')]);}_0x16dc71['order']=qs['sort'](_0x55dd3f[_0x6fc2('0x2d')][_0x6fc2('0x35')]);_0x16dc71[_0x6fc2('0x36')]=qs['filters'](_[_0x6fc2('0x37')](_0x55dd3f['query'],_0xfb5907[_0x6fc2('0x2f')]),_0x433d02);if(_0x55dd3f[_0x6fc2('0x2d')][_0x6fc2('0x38')]){_0x16dc71[_0x6fc2('0x36')]=_[_0x6fc2('0x39')](_0x16dc71[_0x6fc2('0x36')],{'$or':_[_0x6fc2('0x2c')](_0x433d02,function(_0x272cc2){if(_0x272cc2[_0x6fc2('0x29')]!==_0x6fc2('0x3a')){var _0x22c2e5={};_0x22c2e5[_0x272cc2[_0x6fc2('0x24')]]={'$like':'%'+_0x55dd3f[_0x6fc2('0x2d')][_0x6fc2('0x38')]+'%'};return _0x22c2e5;}})});}_0x16dc71=_[_0x6fc2('0x39')]({},_0x16dc71,_0x55dd3f[_0x6fc2('0x3b')]);var _0x480b3c={'where':_0x16dc71['where']};return db[_0x6fc2('0x27')][_0x6fc2('0x1c')](_0x480b3c)[_0x6fc2('0x21')](function(_0x4c47e9){_0xd7fcc2[_0x6fc2('0x1c')]=_0x4c47e9;if(_0x55dd3f['query'][_0x6fc2('0x3c')]){_0x16dc71[_0x6fc2('0x3d')]=[{'all':!![]}];}return db[_0x6fc2('0x27')][_0x6fc2('0x3e')](_0x16dc71);})[_0x6fc2('0x21')](function(_0x53557b){_0xd7fcc2['rows']=_0x53557b;return _0xd7fcc2;})[_0x6fc2('0x21')](respondWithFilteredResult(_0x30e3f5,_0x16dc71))['catch'](handleError(_0x30e3f5,null));};exports['show']=function(_0x1f7c5b,_0x1de3f3){var _0x415106={'raw':![],'where':{'id':_0x1f7c5b[_0x6fc2('0x3f')]['id']}},_0x459ad3={};_0x459ad3[_0x6fc2('0x2b')]=_['keys'](db[_0x6fc2('0x27')]['rawAttributes']);_0x459ad3['query']=_[_0x6fc2('0x2e')](_0x1f7c5b['query']);_0x459ad3[_0x6fc2('0x2f')]=_[_0x6fc2('0x30')](_0x459ad3['model'],_0x459ad3[_0x6fc2('0x2d')]);_0x415106['attributes']=_[_0x6fc2('0x30')](_0x459ad3[_0x6fc2('0x2b')],qs['fields'](_0x1f7c5b[_0x6fc2('0x2d')][_0x6fc2('0x31')]));_0x415106[_0x6fc2('0x32')]=_0x415106[_0x6fc2('0x32')][_0x6fc2('0x33')]?_0x415106[_0x6fc2('0x32')]:_0x459ad3[_0x6fc2('0x2b')];if(_0x1f7c5b[_0x6fc2('0x2d')][_0x6fc2('0x3c')]){_0x415106[_0x6fc2('0x3d')]=[{'all':!![]}];}_0x415106=_['merge']({},_0x415106,_0x1f7c5b[_0x6fc2('0x3b')]);return db[_0x6fc2('0x27')]['find'](_0x415106)['then'](handleEntityNotFound(_0x1de3f3,null))['then'](respondWithResult(_0x1de3f3,null))[_0x6fc2('0x40')](handleError(_0x1de3f3,null));};exports[_0x6fc2('0x41')]=function(_0x43070f,_0x378a11){return db['SalesforceConfiguration']['create'](_0x43070f[_0x6fc2('0x42')],{})[_0x6fc2('0x21')](respondWithResult(_0x378a11,0xc9))['catch'](handleError(_0x378a11,null));};exports[_0x6fc2('0x43')]=function(_0x433235,_0x1b6501){if(_0x433235['body']['id']){delete _0x433235[_0x6fc2('0x42')]['id'];}return db['SalesforceConfiguration'][_0x6fc2('0x44')]({'where':{'id':_0x433235[_0x6fc2('0x3f')]['id']}})[_0x6fc2('0x21')](handleEntityNotFound(_0x1b6501,null))[_0x6fc2('0x21')](saveUpdates(_0x433235[_0x6fc2('0x42')],null))[_0x6fc2('0x21')](respondWithResult(_0x1b6501,null))[_0x6fc2('0x40')](handleError(_0x1b6501,null));};exports['destroy']=function(_0x3c3ae1,_0x782231){return db['SalesforceConfiguration']['find']({'where':{'id':_0x3c3ae1[_0x6fc2('0x3f')]['id']}})[_0x6fc2('0x21')](handleEntityNotFound(_0x782231,null))[_0x6fc2('0x21')](removeEntity(_0x782231,null))['catch'](handleError(_0x782231,null));};exports[_0x6fc2('0x45')]=function(_0xb05758,_0x544233,_0x517f72){var _0x286230={};var _0x521244={};var _0x4305b4;var _0x45c694;return db[_0x6fc2('0x27')][_0x6fc2('0x46')]({'where':{'id':_0xb05758[_0x6fc2('0x3f')]['id']}})['then'](handleEntityNotFound(_0x544233,null))[_0x6fc2('0x21')](function(_0x508898){if(_0x508898){_0x4305b4=_0x508898;_0x521244['model']=_['keys'](db[_0x6fc2('0x47')][_0x6fc2('0x48')]);_0x521244[_0x6fc2('0x2d')]=_[_0x6fc2('0x2e')](_0xb05758[_0x6fc2('0x2d')]);_0x521244[_0x6fc2('0x2f')]=_['intersection'](_0x521244[_0x6fc2('0x2b')],_0x521244[_0x6fc2('0x2d')]);_0x286230[_0x6fc2('0x32')]=_['intersection'](_0x521244[_0x6fc2('0x2b')],qs[_0x6fc2('0x31')](_0xb05758[_0x6fc2('0x2d')][_0x6fc2('0x31')]));_0x286230[_0x6fc2('0x32')]=_0x286230[_0x6fc2('0x32')]['length']?_0x286230[_0x6fc2('0x32')]:_0x521244[_0x6fc2('0x2b')];_0x286230[_0x6fc2('0x49')]=qs[_0x6fc2('0x35')](_0xb05758[_0x6fc2('0x2d')][_0x6fc2('0x35')]);_0x286230[_0x6fc2('0x36')]=qs['filters'](_[_0x6fc2('0x37')](_0xb05758['query'],_0x521244['filters']));if(_0xb05758[_0x6fc2('0x2d')][_0x6fc2('0x38')]){_0x286230[_0x6fc2('0x36')]=_[_0x6fc2('0x39')](_0x286230[_0x6fc2('0x36')],{'$or':_[_0x6fc2('0x2c')](_0x286230[_0x6fc2('0x32')],function(_0x54ab2d){var _0x4a670e={};_0x4a670e[_0x54ab2d]={'$like':'%'+_0xb05758[_0x6fc2('0x2d')][_0x6fc2('0x38')]+'%'};return _0x4a670e;})});}_0x286230=_[_0x6fc2('0x39')]({},_0x286230,_0xb05758[_0x6fc2('0x3b')]);return _0x4305b4['getFields'](_0x286230);}})[_0x6fc2('0x21')](function(_0x43afcd){if(_0x43afcd){_0x45c694=_0x43afcd[_0x6fc2('0x33')];if(!_0xb05758['query'][_0x6fc2('0x4a')](_0x6fc2('0x34'))){_0x286230[_0x6fc2('0x1b')]=qs[_0x6fc2('0x1b')](_0xb05758[_0x6fc2('0x2d')][_0x6fc2('0x1b')]);_0x286230[_0x6fc2('0x1d')]=qs['offset'](_0xb05758[_0x6fc2('0x2d')]['offset']);}return _0x4305b4[_0x6fc2('0x45')](_0x286230);}})[_0x6fc2('0x21')](function(_0x2d70c1){if(_0x2d70c1){return _0x2d70c1?{'count':_0x45c694,'rows':_0x2d70c1}:null;}})[_0x6fc2('0x21')](respondWithResult(_0x544233,null))[_0x6fc2('0x40')](handleError(_0x544233,null));};exports[_0x6fc2('0x4b')]=function(_0x3bd3b0,_0x39773f,_0x586a10){var _0x428018={};var _0xeda06d={};var _0x4a18e8;var _0x107a00;return db[_0x6fc2('0x27')]['findOne']({'where':{'id':_0x3bd3b0[_0x6fc2('0x3f')]['id']}})['then'](handleEntityNotFound(_0x39773f,null))[_0x6fc2('0x21')](function(_0x22ac7a){if(_0x22ac7a){_0x4a18e8=_0x22ac7a;_0xeda06d[_0x6fc2('0x2b')]=_[_0x6fc2('0x2e')](db[_0x6fc2('0x47')]['rawAttributes']);_0xeda06d[_0x6fc2('0x2d')]=_[_0x6fc2('0x2e')](_0x3bd3b0[_0x6fc2('0x2d')]);_0xeda06d['filters']=_['intersection'](_0xeda06d['model'],_0xeda06d[_0x6fc2('0x2d')]);_0x428018[_0x6fc2('0x32')]=_['intersection'](_0xeda06d[_0x6fc2('0x2b')],qs['fields'](_0x3bd3b0[_0x6fc2('0x2d')][_0x6fc2('0x31')]));_0x428018['attributes']=_0x428018[_0x6fc2('0x32')][_0x6fc2('0x33')]?_0x428018[_0x6fc2('0x32')]:_0xeda06d[_0x6fc2('0x2b')];_0x428018[_0x6fc2('0x49')]=qs['sort'](_0x3bd3b0[_0x6fc2('0x2d')]['sort']);_0x428018[_0x6fc2('0x36')]=qs['filters'](_[_0x6fc2('0x37')](_0x3bd3b0['query'],_0xeda06d[_0x6fc2('0x2f')]));if(_0x3bd3b0[_0x6fc2('0x2d')]['filter']){_0x428018[_0x6fc2('0x36')]=_[_0x6fc2('0x39')](_0x428018[_0x6fc2('0x36')],{'$or':_['map'](_0x428018['attributes'],function(_0x1959a0){var _0x41cfa6={};_0x41cfa6[_0x1959a0]={'$like':'%'+_0x3bd3b0[_0x6fc2('0x2d')][_0x6fc2('0x38')]+'%'};return _0x41cfa6;})});}_0x428018=_[_0x6fc2('0x39')]({},_0x428018,_0x3bd3b0[_0x6fc2('0x3b')]);return _0x4a18e8[_0x6fc2('0x4b')](_0x428018);}})[_0x6fc2('0x21')](function(_0x1da611){if(_0x1da611){_0x107a00=_0x1da611[_0x6fc2('0x33')];if(!_0x3bd3b0[_0x6fc2('0x2d')][_0x6fc2('0x4a')](_0x6fc2('0x34'))){_0x428018['limit']=qs[_0x6fc2('0x1b')](_0x3bd3b0[_0x6fc2('0x2d')][_0x6fc2('0x1b')]);_0x428018[_0x6fc2('0x1d')]=qs[_0x6fc2('0x1d')](_0x3bd3b0[_0x6fc2('0x2d')][_0x6fc2('0x1d')]);}return _0x4a18e8[_0x6fc2('0x4b')](_0x428018);}})[_0x6fc2('0x21')](function(_0x11d473){if(_0x11d473){return _0x11d473?{'count':_0x107a00,'rows':_0x11d473}:null;}})['then'](respondWithResult(_0x39773f,null))[_0x6fc2('0x40')](handleError(_0x39773f,null));};exports[_0x6fc2('0x4c')]=function(_0x205756,_0x5818ff,_0x495c33){var _0x262fc9={};var _0x52b23b={};var _0x20563b;var _0x17da7e;return db[_0x6fc2('0x27')]['findOne']({'where':{'id':_0x205756['params']['id']}})[_0x6fc2('0x21')](handleEntityNotFound(_0x5818ff,null))['then'](function(_0x17c793){if(_0x17c793){_0x20563b=_0x17c793;_0x52b23b[_0x6fc2('0x2b')]=_['keys'](db[_0x6fc2('0x47')][_0x6fc2('0x48')]);_0x52b23b[_0x6fc2('0x2d')]=_[_0x6fc2('0x2e')](_0x205756[_0x6fc2('0x2d')]);_0x52b23b['filters']=_['intersection'](_0x52b23b[_0x6fc2('0x2b')],_0x52b23b['query']);_0x262fc9['attributes']=_[_0x6fc2('0x30')](_0x52b23b[_0x6fc2('0x2b')],qs['fields'](_0x205756['query'][_0x6fc2('0x31')]));_0x262fc9[_0x6fc2('0x32')]=_0x262fc9[_0x6fc2('0x32')]['length']?_0x262fc9[_0x6fc2('0x32')]:_0x52b23b[_0x6fc2('0x2b')];_0x262fc9[_0x6fc2('0x49')]=qs['sort'](_0x205756['query'][_0x6fc2('0x35')]);_0x262fc9[_0x6fc2('0x36')]=qs[_0x6fc2('0x2f')](_[_0x6fc2('0x37')](_0x205756[_0x6fc2('0x2d')],_0x52b23b['filters']));if(_0x205756[_0x6fc2('0x2d')]['filter']){_0x262fc9[_0x6fc2('0x36')]=_['merge'](_0x262fc9[_0x6fc2('0x36')],{'$or':_[_0x6fc2('0x2c')](_0x262fc9[_0x6fc2('0x32')],function(_0x53ec00){var _0x2cc91e={};_0x2cc91e[_0x53ec00]={'$like':'%'+_0x205756[_0x6fc2('0x2d')][_0x6fc2('0x38')]+'%'};return _0x2cc91e;})});}_0x262fc9=_[_0x6fc2('0x39')]({},_0x262fc9,_0x205756[_0x6fc2('0x3b')]);return _0x20563b[_0x6fc2('0x4c')](_0x262fc9);}})[_0x6fc2('0x21')](function(_0x2d9d52){if(_0x2d9d52){_0x17da7e=_0x2d9d52['length'];if(!_0x205756['query'][_0x6fc2('0x4a')](_0x6fc2('0x34'))){_0x262fc9[_0x6fc2('0x1b')]=qs[_0x6fc2('0x1b')](_0x205756[_0x6fc2('0x2d')][_0x6fc2('0x1b')]);_0x262fc9['offset']=qs[_0x6fc2('0x1d')](_0x205756[_0x6fc2('0x2d')][_0x6fc2('0x1d')]);}return _0x20563b[_0x6fc2('0x4c')](_0x262fc9);}})[_0x6fc2('0x21')](function(_0x389f94){if(_0x389f94){return _0x389f94?{'count':_0x17da7e,'rows':_0x389f94}:null;}})[_0x6fc2('0x21')](respondWithResult(_0x5818ff,null))['catch'](handleError(_0x5818ff,null));};
\ No newline at end of file
index cd66d15..c1c2774 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a08=['SalesforceConfiguration','int_salesforce_configurations','api','bluebird','request-promise','path','../../config/environment','./intSalesforceConfiguration.attributes','exports'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x6a08,0xfe));var _0x86a0=function(_0x2637ac,_0x377857){_0x2637ac=_0x2637ac-0x0;var _0x4a5758=_0x6a08[_0x2637ac];return _0x4a5758;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x86a0('0x0'));var moment=require('moment');var BPromise=require(_0x86a0('0x1'));var rp=require(_0x86a0('0x2'));var fs=require('fs');var path=require(_0x86a0('0x3'));var rimraf=require('rimraf');var config=require(_0x86a0('0x4'));var attributes=require(_0x86a0('0x5'));module[_0x86a0('0x6')]=function(_0x59d740,_0x549c2b){return _0x59d740['define'](_0x86a0('0x7'),attributes,{'tableName':_0x86a0('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3f32=['api','moment','bluebird','request-promise','./intSalesforceConfiguration.attributes','define','SalesforceConfiguration','int_salesforce_configurations','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3f32,0x6b));var _0x23f3=function(_0x33a5ec,_0x10c014){_0x33a5ec=_0x33a5ec-0x0;var _0x38f89c=_0x3f32[_0x33a5ec];return _0x38f89c;};'use strict';var _=require(_0x23f3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x23f3('0x1'));var moment=require(_0x23f3('0x2'));var BPromise=require(_0x23f3('0x3'));var rp=require(_0x23f3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x23f3('0x5'));module['exports']=function(_0x264e96,_0x46957c){return _0x264e96[_0x23f3('0x6')](_0x23f3('0x7'),attributes,{'tableName':_0x23f3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1abbc60..0653cf2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c60=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','request','info','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','randomstring'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x9c60,0xd8));var _0x09c6=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x9c60[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0x09c6('0x0'));var util=require(_0x09c6('0x1'));var moment=require(_0x09c6('0x2'));var BPromise=require('bluebird');var rs=require(_0x09c6('0x3'));var fs=require('fs');var Redis=require(_0x09c6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x09c6('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x09c6('0x6'));var jayson=require(_0x09c6('0x7'));var client=jayson[_0x09c6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0545,_0x4bf87e,_0x4d3f97){return new BPromise(function(_0x273ebe,_0x351496){return client[_0x09c6('0x9')](_0x2c0545,_0x4d3f97)['then'](function(_0x145fa6){logger[_0x09c6('0xa')](_0x09c6('0xb'),_0x4bf87e,'request\x20sent');logger[_0x09c6('0xc')](_0x09c6('0xd'),_0x4bf87e,_0x09c6('0xe'),JSON[_0x09c6('0xf')](_0x145fa6));if(_0x145fa6[_0x09c6('0x10')]){if(_0x145fa6[_0x09c6('0x10')]['code']===0x1f4){logger[_0x09c6('0x10')](_0x09c6('0xb'),_0x4bf87e,_0x145fa6['error'][_0x09c6('0x11')]);return _0x351496(_0x145fa6[_0x09c6('0x10')][_0x09c6('0x11')]);}logger[_0x09c6('0x10')](_0x09c6('0xb'),_0x4bf87e,_0x145fa6[_0x09c6('0x10')]['message']);return _0x273ebe(_0x145fa6[_0x09c6('0x10')]['message']);}else{logger[_0x09c6('0xa')](_0x09c6('0xb'),_0x4bf87e,_0x09c6('0xe'));_0x273ebe(_0x145fa6[_0x09c6('0x12')][_0x09c6('0x11')]);}})[_0x09c6('0x13')](function(_0x5dcdff){logger[_0x09c6('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x4bf87e,_0x5dcdff);_0x351496(_0x5dcdff);});});}
\ No newline at end of file
+var _0xe4be=['debug','request\x20sent','stringify','error','code','result','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SalesforceConfiguration,\x20%s,\x20%s'];(function(_0x1b341c,_0x3300f8){var _0x28944b=function(_0x47b422){while(--_0x47b422){_0x1b341c['push'](_0x1b341c['shift']());}};_0x28944b(++_0x3300f8);}(_0xe4be,0x157));var _0xee4b=function(_0x37ad10,_0x53beb2){_0x37ad10=_0x37ad10-0x0;var _0x535615=_0xe4be[_0x37ad10];return _0x535615;};'use strict';var _=require(_0xee4b('0x0'));var util=require(_0xee4b('0x1'));var moment=require(_0xee4b('0x2'));var BPromise=require(_0xee4b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee4b('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xee4b('0x5'))(_0xee4b('0x6'));var config=require(_0xee4b('0x7'));var jayson=require(_0xee4b('0x8'));var client=jayson[_0xee4b('0x9')][_0xee4b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ab8f5,_0x5de651,_0xd5c23b){return new BPromise(function(_0xd51ea2,_0xcc0f45){return client[_0xee4b('0xb')](_0x5ab8f5,_0xd5c23b)['then'](function(_0x501c05){logger[_0xee4b('0xc')](_0xee4b('0xd'),_0x5de651,'request\x20sent');logger[_0xee4b('0xe')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x5de651,_0xee4b('0xf'),JSON[_0xee4b('0x10')](_0x501c05));if(_0x501c05[_0xee4b('0x11')]){if(_0x501c05[_0xee4b('0x11')][_0xee4b('0x12')]===0x1f4){logger[_0xee4b('0x11')](_0xee4b('0xd'),_0x5de651,_0x501c05[_0xee4b('0x11')]['message']);return _0xcc0f45(_0x501c05[_0xee4b('0x11')]['message']);}logger[_0xee4b('0x11')](_0xee4b('0xd'),_0x5de651,_0x501c05[_0xee4b('0x11')]['message']);return _0xd51ea2(_0x501c05['error']['message']);}else{logger[_0xee4b('0xc')](_0xee4b('0xd'),_0x5de651,'request\x20sent');_0xd51ea2(_0x501c05[_0xee4b('0x13')]['message']);}})[_0xee4b('0x14')](function(_0x1073cc){logger[_0xee4b('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5de651,_0x1073cc);_0xcc0f45(_0x1073cc);});});}
\ No newline at end of file
index 0f8d0b4..dcbcf66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb574=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceField.controller','isAuthenticated','index','get','/:id','show','post','create','put','update'];(function(_0x474d72,_0x29a688){var _0x2b7b59=function(_0x5f4aa1){while(--_0x5f4aa1){_0x474d72['push'](_0x474d72['shift']());}};_0x2b7b59(++_0x29a688);}(_0xb574,0x192));var _0x4b57=function(_0x59652d,_0x222fcf){_0x59652d=_0x59652d-0x0;var _0x38f879=_0xb574[_0x59652d];return _0x38f879;};'use strict';var multer=require(_0x4b57('0x0'));var util=require(_0x4b57('0x1'));var path=require(_0x4b57('0x2'));var timeout=require(_0x4b57('0x3'));var express=require('express');var router=express[_0x4b57('0x4')]();var fs_extra=require(_0x4b57('0x5'));var auth=require(_0x4b57('0x6'));var interaction=require(_0x4b57('0x7'));var config=require('../../config/environment');var controller=require(_0x4b57('0x8'));router['get']('/',auth[_0x4b57('0x9')](),controller[_0x4b57('0xa')]);router[_0x4b57('0xb')](_0x4b57('0xc'),auth['isAuthenticated'](),controller[_0x4b57('0xd')]);router[_0x4b57('0xe')]('/',auth['isAuthenticated'](),controller[_0x4b57('0xf')]);router[_0x4b57('0x10')]('/:id',auth[_0x4b57('0x9')](),controller[_0x4b57('0x11')]);router['delete']('/:id',auth[_0x4b57('0x9')](),controller[_0x4b57('0x12')]);module[_0x4b57('0x13')]=router;
\ No newline at end of file
+var _0x7514=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','multer','path','connect-timeout','express'];(function(_0x5ad9c8,_0x1d2d1b){var _0x1f1acc=function(_0x5bbe5e){while(--_0x5bbe5e){_0x5ad9c8['push'](_0x5ad9c8['shift']());}};_0x1f1acc(++_0x1d2d1b);}(_0x7514,0x9c));var _0x4751=function(_0xa8179,_0x55de83){_0xa8179=_0xa8179-0x0;var _0x2f54e3=_0x7514[_0xa8179];return _0x2f54e3;};'use strict';var multer=require(_0x4751('0x0'));var util=require('util');var path=require(_0x4751('0x1'));var timeout=require(_0x4751('0x2'));var express=require(_0x4751('0x3'));var router=express[_0x4751('0x4')]();var fs_extra=require(_0x4751('0x5'));var auth=require(_0x4751('0x6'));var interaction=require(_0x4751('0x7'));var config=require(_0x4751('0x8'));var controller=require('./intSalesforceField.controller');router[_0x4751('0x9')]('/',auth['isAuthenticated'](),controller[_0x4751('0xa')]);router['get'](_0x4751('0xb'),auth[_0x4751('0xc')](),controller[_0x4751('0xd')]);router[_0x4751('0xe')]('/',auth[_0x4751('0xc')](),controller[_0x4751('0xf')]);router[_0x4751('0x10')](_0x4751('0xb'),auth[_0x4751('0xc')](),controller[_0x4751('0x11')]);router[_0x4751('0x12')](_0x4751('0xb'),auth['isAuthenticated'](),controller[_0x4751('0x13')]);module['exports']=router;
\ No newline at end of file
index eb31128..1fe9ca2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf15f=['variable','customVariable','keyValue','picklist','STRING','ENUM','string','sequelize','exports'];(function(_0x562c58,_0x52335c){var _0x2c24c3=function(_0x370c27){while(--_0x370c27){_0x562c58['push'](_0x562c58['shift']());}};_0x2c24c3(++_0x52335c);}(_0xf15f,0x139));var _0xff15=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xf15f[_0x138adb];return _0x1b27f2;};'use strict';var Sequelize=require(_0xff15('0x0'));module[_0xff15('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xff15('0x2'),_0xff15('0x3'),_0xff15('0x4'),_0xff15('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xff15('0x6')]},'keyType':{'type':Sequelize[_0xff15('0x7')](_0xff15('0x8'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xff15('0x6')]},'variableName':{'type':Sequelize[_0xff15('0x6')]}};
\ No newline at end of file
+var _0x27be=['picklist','STRING','string','sequelize','exports','ENUM','variable','customVariable','keyValue'];(function(_0x41d70c,_0x578927){var _0x5e92e9=function(_0x12e344){while(--_0x12e344){_0x41d70c['push'](_0x41d70c['shift']());}};_0x5e92e9(++_0x578927);}(_0x27be,0x11a));var _0xe27b=function(_0x1f1bf8,_0x48c57d){_0x1f1bf8=_0x1f1bf8-0x0;var _0xcefd99=_0x27be[_0x1f1bf8];return _0xcefd99;};'use strict';var Sequelize=require(_0xe27b('0x0'));module[_0xe27b('0x1')]={'type':{'type':Sequelize[_0xe27b('0x2')]('string',_0xe27b('0x3'),_0xe27b('0x4'),_0xe27b('0x5'),_0xe27b('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xe27b('0x7')]},'key':{'type':Sequelize[_0xe27b('0x7')]},'keyType':{'type':Sequelize[_0xe27b('0x2')](_0xe27b('0x8'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0xe27b('0x7')]}};
\ No newline at end of file
index 99a8d85..d9de27c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae3e=['where','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','fields','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','index','map','SalesforceField','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','filter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xae3e,0xf6));var _0xeae3=function(_0x56e2ed,_0x1c4781){_0x56e2ed=_0x56e2ed-0x0;var _0x5237b2=_0xae3e[_0x56e2ed];return _0x5237b2;};'use strict';var emlformat=require(_0xeae3('0x0'));var rimraf=require(_0xeae3('0x1'));var zipdir=require(_0xeae3('0x2'));var jsonpatch=require(_0xeae3('0x3'));var rp=require(_0xeae3('0x4'));var moment=require('moment');var BPromise=require(_0xeae3('0x5'));var Mustache=require(_0xeae3('0x6'));var util=require(_0xeae3('0x7'));var path=require(_0xeae3('0x8'));var sox=require(_0xeae3('0x9'));var csv=require('to-csv');var ejs=require(_0xeae3('0xa'));var fs=require('fs');var fs_extra=require(_0xeae3('0xb'));var _=require(_0xeae3('0xc'));var squel=require(_0xeae3('0xd'));var crypto=require(_0xeae3('0xe'));var jsforce=require(_0xeae3('0xf'));var deskjs=require(_0xeae3('0x10'));var toCsv=require(_0xeae3('0x11'));var querystring=require(_0xeae3('0x12'));var Papa=require('papaparse');var Redis=require(_0xeae3('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xeae3('0x14'));var as=require(_0xeae3('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeae3('0x16'))(_0xeae3('0x17'));var utils=require(_0xeae3('0x18'));var config=require(_0xeae3('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5f4861,_0x3e61a5){_0x3e61a5=_0x3e61a5||0xcc;return function(_0x4d8bde){if(_0x4d8bde){return _0x5f4861[_0xeae3('0x1a')](_0x3e61a5);}return _0x5f4861[_0xeae3('0x1b')](_0x3e61a5)['end']();};}function respondWithResult(_0x5f35f2,_0x25a8a9){_0x25a8a9=_0x25a8a9||0xc8;return function(_0x3dade4){if(_0x3dade4){return _0x5f35f2[_0xeae3('0x1b')](_0x25a8a9)[_0xeae3('0x1c')](_0x3dade4);}};}function respondWithFilteredResult(_0x1d6642,_0x2c2d3f){return function(_0x581f55){if(_0x581f55){var _0x2e0f42=typeof _0x2c2d3f[_0xeae3('0x1d')]==='undefined'&&typeof _0x2c2d3f['limit']===_0xeae3('0x1e');var _0x437152=_0x581f55['count'];var _0x1f0292=_0x2e0f42?0x0:_0x2c2d3f['offset'];var _0x271765=_0x2e0f42?_0x581f55[_0xeae3('0x1f')]:_0x2c2d3f[_0xeae3('0x1d')]+_0x2c2d3f[_0xeae3('0x20')];var _0x33b6a3;if(_0x271765>=_0x437152){_0x271765=_0x437152;_0x33b6a3=0xc8;}else{_0x33b6a3=0xce;}_0x1d6642['status'](_0x33b6a3);return _0x1d6642[_0xeae3('0x21')](_0xeae3('0x22'),_0x1f0292+'-'+_0x271765+'/'+_0x437152)['json'](_0x581f55);}return null;};}function patchUpdates(_0x53f910){return function(_0x1efc57){try{jsonpatch[_0xeae3('0x23')](_0x1efc57,_0x53f910,!![]);}catch(_0x37ac24){return BPromise[_0xeae3('0x24')](_0x37ac24);}return _0x1efc57['save']();};}function saveUpdates(_0x115f29,_0x2d240f){return function(_0xfd1a93){if(_0xfd1a93){return _0xfd1a93[_0xeae3('0x25')](_0x115f29)[_0xeae3('0x26')](function(_0x5331e7){return _0x5331e7;});}return null;};}function removeEntity(_0x32a3b4,_0x51b453){return function(_0x5dab71){if(_0x5dab71){return _0x5dab71[_0xeae3('0x27')]()[_0xeae3('0x26')](function(){_0x32a3b4[_0xeae3('0x1b')](0xcc)[_0xeae3('0x28')]();});}};}function handleEntityNotFound(_0x57a580,_0x1f5c91){return function(_0xb2556f){if(!_0xb2556f){_0x57a580[_0xeae3('0x1a')](0x194);}return _0xb2556f;};}function handleError(_0x211653,_0x32a37f){_0x32a37f=_0x32a37f||0x1f4;return function(_0x170a72){logger[_0xeae3('0x29')](_0x170a72[_0xeae3('0x2a')]);if(_0x170a72[_0xeae3('0x2b')]){delete _0x170a72[_0xeae3('0x2b')];}_0x211653['status'](_0x32a37f)['send'](_0x170a72);};}exports[_0xeae3('0x2c')]=function(_0x211a13,_0x7d9ec9){var _0x1a7cc1={},_0x449129={},_0x161e08={'count':0x0,'rows':[]};var _0x48ee71=_[_0xeae3('0x2d')](db[_0xeae3('0x2e')][_0xeae3('0x2f')],function(_0x57ee8f){return{'name':_0x57ee8f[_0xeae3('0x30')],'type':_0x57ee8f['type'][_0xeae3('0x31')]};});_0x449129[_0xeae3('0x32')]=_[_0xeae3('0x2d')](_0x48ee71,_0xeae3('0x2b'));_0x449129[_0xeae3('0x33')]=_[_0xeae3('0x34')](_0x211a13[_0xeae3('0x33')]);_0x449129[_0xeae3('0x35')]=_[_0xeae3('0x36')](_0x449129[_0xeae3('0x32')],_0x449129['query']);_0x1a7cc1[_0xeae3('0x37')]=_['intersection'](_0x449129[_0xeae3('0x32')],qs['fields'](_0x211a13['query']['fields']));_0x1a7cc1[_0xeae3('0x37')]=_0x1a7cc1[_0xeae3('0x37')][_0xeae3('0x38')]?_0x1a7cc1['attributes']:_0x449129[_0xeae3('0x32')];if(!_0x211a13[_0xeae3('0x33')][_0xeae3('0x39')](_0xeae3('0x3a'))){_0x1a7cc1['limit']=qs[_0xeae3('0x20')](_0x211a13[_0xeae3('0x33')][_0xeae3('0x20')]);_0x1a7cc1[_0xeae3('0x1d')]=qs[_0xeae3('0x1d')](_0x211a13['query'][_0xeae3('0x1d')]);}_0x1a7cc1[_0xeae3('0x3b')]=qs[_0xeae3('0x3c')](_0x211a13[_0xeae3('0x33')][_0xeae3('0x3c')]);_0x1a7cc1['where']=qs[_0xeae3('0x35')](_['pick'](_0x211a13['query'],_0x449129[_0xeae3('0x35')]),_0x48ee71);if(_0x211a13['query'][_0xeae3('0x3d')]){_0x1a7cc1[_0xeae3('0x3e')]=_['merge'](_0x1a7cc1[_0xeae3('0x3e')],{'$or':_[_0xeae3('0x2d')](_0x48ee71,function(_0x2d5c88){if(_0x2d5c88[_0xeae3('0x3f')]!==_0xeae3('0x40')){var _0xb81fdc={};_0xb81fdc[_0x2d5c88[_0xeae3('0x2b')]]={'$like':'%'+_0x211a13['query']['filter']+'%'};return _0xb81fdc;}})});}_0x1a7cc1=_[_0xeae3('0x41')]({},_0x1a7cc1,_0x211a13[_0xeae3('0x42')]);var _0x1cb7f1={'where':_0x1a7cc1['where']};return db[_0xeae3('0x2e')][_0xeae3('0x1f')](_0x1cb7f1)[_0xeae3('0x26')](function(_0x5d6f14){_0x161e08[_0xeae3('0x1f')]=_0x5d6f14;if(_0x211a13[_0xeae3('0x33')][_0xeae3('0x43')]){_0x1a7cc1[_0xeae3('0x44')]=[{'all':!![]}];}return db[_0xeae3('0x2e')][_0xeae3('0x45')](_0x1a7cc1);})[_0xeae3('0x26')](function(_0x5b4dfb){_0x161e08[_0xeae3('0x46')]=_0x5b4dfb;return _0x161e08;})[_0xeae3('0x26')](respondWithFilteredResult(_0x7d9ec9,_0x1a7cc1))[_0xeae3('0x47')](handleError(_0x7d9ec9,null));};exports[_0xeae3('0x48')]=function(_0x58de05,_0x52e8a0){var _0x700513={'raw':!![],'where':{'id':_0x58de05['params']['id']}},_0x1d1ded={};_0x1d1ded[_0xeae3('0x32')]=_[_0xeae3('0x34')](db['SalesforceField']['rawAttributes']);_0x1d1ded['query']=_[_0xeae3('0x34')](_0x58de05[_0xeae3('0x33')]);_0x1d1ded[_0xeae3('0x35')]=_[_0xeae3('0x36')](_0x1d1ded[_0xeae3('0x32')],_0x1d1ded[_0xeae3('0x33')]);_0x700513[_0xeae3('0x37')]=_[_0xeae3('0x36')](_0x1d1ded[_0xeae3('0x32')],qs[_0xeae3('0x49')](_0x58de05[_0xeae3('0x33')][_0xeae3('0x49')]));_0x700513['attributes']=_0x700513[_0xeae3('0x37')]['length']?_0x700513[_0xeae3('0x37')]:_0x1d1ded[_0xeae3('0x32')];if(_0x58de05[_0xeae3('0x33')][_0xeae3('0x43')]){_0x700513['include']=[{'all':!![]}];}_0x700513=_[_0xeae3('0x41')]({},_0x700513,_0x58de05['options']);return db[_0xeae3('0x2e')]['find'](_0x700513)[_0xeae3('0x26')](handleEntityNotFound(_0x52e8a0,null))[_0xeae3('0x26')](respondWithResult(_0x52e8a0,null))[_0xeae3('0x47')](handleError(_0x52e8a0,null));};exports[_0xeae3('0x4a')]=function(_0x1c2be5,_0x182aa8){return db['SalesforceField'][_0xeae3('0x4a')](_0x1c2be5[_0xeae3('0x4b')],{})['then'](respondWithResult(_0x182aa8,0xc9))[_0xeae3('0x47')](handleError(_0x182aa8,null));};exports['update']=function(_0x175446,_0x1b6cd7){if(_0x175446['body']['id']){delete _0x175446[_0xeae3('0x4b')]['id'];}return db['SalesforceField']['find']({'where':{'id':_0x175446[_0xeae3('0x4c')]['id']}})[_0xeae3('0x26')](handleEntityNotFound(_0x1b6cd7,null))[_0xeae3('0x26')](saveUpdates(_0x175446['body'],null))[_0xeae3('0x26')](respondWithResult(_0x1b6cd7,null))[_0xeae3('0x47')](handleError(_0x1b6cd7,null));};exports['destroy']=function(_0x2ca6c0,_0x5dbe25){return db[_0xeae3('0x2e')]['find']({'where':{'id':_0x2ca6c0[_0xeae3('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5dbe25,null))[_0xeae3('0x26')](removeEntity(_0x5dbe25,null))[_0xeae3('0x47')](handleError(_0x5dbe25,null));};
\ No newline at end of file
+var _0x99b1=['include','rows','show','params','keys','rawAttributes','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','limit','count','offset','Content-Range','apply','reject','update','then','destroy','error','stack','index','map','SalesforceField','fieldName','type','key','model','name','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll'];(function(_0x4858bc,_0x176641){var _0x5f2e11=function(_0x45866b){while(--_0x45866b){_0x4858bc['push'](_0x4858bc['shift']());}};_0x5f2e11(++_0x176641);}(_0x99b1,0xe8));var _0x199b=function(_0x1286cf,_0x1a2d19){_0x1286cf=_0x1286cf-0x0;var _0x59c7ba=_0x99b1[_0x1286cf];return _0x59c7ba;};'use strict';var emlformat=require(_0x199b('0x0'));var rimraf=require(_0x199b('0x1'));var zipdir=require(_0x199b('0x2'));var jsonpatch=require(_0x199b('0x3'));var rp=require(_0x199b('0x4'));var moment=require('moment');var BPromise=require(_0x199b('0x5'));var Mustache=require(_0x199b('0x6'));var util=require(_0x199b('0x7'));var path=require(_0x199b('0x8'));var sox=require('sox');var csv=require(_0x199b('0x9'));var ejs=require(_0x199b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x199b('0xb'));var squel=require(_0x199b('0xc'));var crypto=require('crypto');var jsforce=require(_0x199b('0xd'));var deskjs=require(_0x199b('0xe'));var toCsv=require(_0x199b('0x9'));var querystring=require('querystring');var Papa=require(_0x199b('0xf'));var Redis=require(_0x199b('0x10'));var authService=require(_0x199b('0x11'));var qs=require(_0x199b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x199b('0x13'));var logger=require(_0x199b('0x14'))(_0x199b('0x15'));var utils=require(_0x199b('0x16'));var config=require(_0x199b('0x17'));var licenseUtil=require(_0x199b('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30d71e,_0x1b58d0){_0x1b58d0=_0x1b58d0||0xcc;return function(_0x25f8be){if(_0x25f8be){return _0x30d71e[_0x199b('0x19')](_0x1b58d0);}return _0x30d71e[_0x199b('0x1a')](_0x1b58d0)[_0x199b('0x1b')]();};}function respondWithResult(_0x4995cb,_0x2e9b70){_0x2e9b70=_0x2e9b70||0xc8;return function(_0x591571){if(_0x591571){return _0x4995cb[_0x199b('0x1a')](_0x2e9b70)['json'](_0x591571);}};}function respondWithFilteredResult(_0x391fad,_0x55f02b){return function(_0x109621){if(_0x109621){var _0x20a644=typeof _0x55f02b['offset']==='undefined'&&typeof _0x55f02b[_0x199b('0x1c')]==='undefined';var _0xdf9b3c=_0x109621[_0x199b('0x1d')];var _0x46734f=_0x20a644?0x0:_0x55f02b[_0x199b('0x1e')];var _0xd563ec=_0x20a644?_0x109621[_0x199b('0x1d')]:_0x55f02b[_0x199b('0x1e')]+_0x55f02b[_0x199b('0x1c')];var _0x294d5a;if(_0xd563ec>=_0xdf9b3c){_0xd563ec=_0xdf9b3c;_0x294d5a=0xc8;}else{_0x294d5a=0xce;}_0x391fad[_0x199b('0x1a')](_0x294d5a);return _0x391fad['set'](_0x199b('0x1f'),_0x46734f+'-'+_0xd563ec+'/'+_0xdf9b3c)['json'](_0x109621);}return null;};}function patchUpdates(_0x2e5428){return function(_0x550e7e){try{jsonpatch[_0x199b('0x20')](_0x550e7e,_0x2e5428,!![]);}catch(_0x147188){return BPromise[_0x199b('0x21')](_0x147188);}return _0x550e7e['save']();};}function saveUpdates(_0x3a70b6,_0xdb1dcb){return function(_0x14e8b5){if(_0x14e8b5){return _0x14e8b5[_0x199b('0x22')](_0x3a70b6)[_0x199b('0x23')](function(_0x3c6410){return _0x3c6410;});}return null;};}function removeEntity(_0x140e6f,_0x375113){return function(_0x33ca94){if(_0x33ca94){return _0x33ca94[_0x199b('0x24')]()[_0x199b('0x23')](function(){_0x140e6f['status'](0xcc)[_0x199b('0x1b')]();});}};}function handleEntityNotFound(_0x14d5d4,_0x46be5b){return function(_0x5c439a){if(!_0x5c439a){_0x14d5d4[_0x199b('0x19')](0x194);}return _0x5c439a;};}function handleError(_0x53741a,_0x2a87ca){_0x2a87ca=_0x2a87ca||0x1f4;return function(_0x8bd193){logger[_0x199b('0x25')](_0x8bd193[_0x199b('0x26')]);if(_0x8bd193['name']){delete _0x8bd193['name'];}_0x53741a['status'](_0x2a87ca)['send'](_0x8bd193);};}exports[_0x199b('0x27')]=function(_0x34a63f,_0x285bd1){var _0x108aea={},_0x4f60ed={},_0x577cd0={'count':0x0,'rows':[]};var _0x5be1f9=_[_0x199b('0x28')](db[_0x199b('0x29')]['rawAttributes'],function(_0x4183e9){return{'name':_0x4183e9[_0x199b('0x2a')],'type':_0x4183e9[_0x199b('0x2b')][_0x199b('0x2c')]};});_0x4f60ed[_0x199b('0x2d')]=_[_0x199b('0x28')](_0x5be1f9,_0x199b('0x2e'));_0x4f60ed[_0x199b('0x2f')]=_['keys'](_0x34a63f[_0x199b('0x2f')]);_0x4f60ed[_0x199b('0x30')]=_['intersection'](_0x4f60ed[_0x199b('0x2d')],_0x4f60ed[_0x199b('0x2f')]);_0x108aea[_0x199b('0x31')]=_[_0x199b('0x32')](_0x4f60ed['model'],qs[_0x199b('0x33')](_0x34a63f['query'][_0x199b('0x33')]));_0x108aea[_0x199b('0x31')]=_0x108aea[_0x199b('0x31')][_0x199b('0x34')]?_0x108aea['attributes']:_0x4f60ed[_0x199b('0x2d')];if(!_0x34a63f[_0x199b('0x2f')][_0x199b('0x35')](_0x199b('0x36'))){_0x108aea['limit']=qs['limit'](_0x34a63f['query'][_0x199b('0x1c')]);_0x108aea[_0x199b('0x1e')]=qs[_0x199b('0x1e')](_0x34a63f['query'][_0x199b('0x1e')]);}_0x108aea[_0x199b('0x37')]=qs[_0x199b('0x38')](_0x34a63f[_0x199b('0x2f')][_0x199b('0x38')]);_0x108aea[_0x199b('0x39')]=qs[_0x199b('0x30')](_[_0x199b('0x3a')](_0x34a63f['query'],_0x4f60ed[_0x199b('0x30')]),_0x5be1f9);if(_0x34a63f[_0x199b('0x2f')][_0x199b('0x3b')]){_0x108aea[_0x199b('0x39')]=_[_0x199b('0x3c')](_0x108aea[_0x199b('0x39')],{'$or':_['map'](_0x5be1f9,function(_0x4d61ab){if(_0x4d61ab[_0x199b('0x2b')]!==_0x199b('0x3d')){var _0x4a1854={};_0x4a1854[_0x4d61ab['name']]={'$like':'%'+_0x34a63f[_0x199b('0x2f')][_0x199b('0x3b')]+'%'};return _0x4a1854;}})});}_0x108aea=_[_0x199b('0x3c')]({},_0x108aea,_0x34a63f[_0x199b('0x3e')]);var _0x30eef2={'where':_0x108aea[_0x199b('0x39')]};return db[_0x199b('0x29')][_0x199b('0x1d')](_0x30eef2)[_0x199b('0x23')](function(_0x3ff219){_0x577cd0[_0x199b('0x1d')]=_0x3ff219;if(_0x34a63f[_0x199b('0x2f')][_0x199b('0x3f')]){_0x108aea[_0x199b('0x40')]=[{'all':!![]}];}return db['SalesforceField']['findAll'](_0x108aea);})['then'](function(_0x4bf6e9){_0x577cd0[_0x199b('0x41')]=_0x4bf6e9;return _0x577cd0;})['then'](respondWithFilteredResult(_0x285bd1,_0x108aea))['catch'](handleError(_0x285bd1,null));};exports[_0x199b('0x42')]=function(_0x57ee1e,_0x41ca6a){var _0x44f833={'raw':!![],'where':{'id':_0x57ee1e[_0x199b('0x43')]['id']}},_0x365b0c={};_0x365b0c[_0x199b('0x2d')]=_[_0x199b('0x44')](db['SalesforceField'][_0x199b('0x45')]);_0x365b0c[_0x199b('0x2f')]=_['keys'](_0x57ee1e[_0x199b('0x2f')]);_0x365b0c[_0x199b('0x30')]=_[_0x199b('0x32')](_0x365b0c['model'],_0x365b0c[_0x199b('0x2f')]);_0x44f833[_0x199b('0x31')]=_[_0x199b('0x32')](_0x365b0c['model'],qs[_0x199b('0x33')](_0x57ee1e[_0x199b('0x2f')][_0x199b('0x33')]));_0x44f833[_0x199b('0x31')]=_0x44f833['attributes'][_0x199b('0x34')]?_0x44f833[_0x199b('0x31')]:_0x365b0c[_0x199b('0x2d')];if(_0x57ee1e[_0x199b('0x2f')][_0x199b('0x3f')]){_0x44f833['include']=[{'all':!![]}];}_0x44f833=_['merge']({},_0x44f833,_0x57ee1e[_0x199b('0x3e')]);return db[_0x199b('0x29')][_0x199b('0x46')](_0x44f833)[_0x199b('0x23')](handleEntityNotFound(_0x41ca6a,null))['then'](respondWithResult(_0x41ca6a,null))[_0x199b('0x47')](handleError(_0x41ca6a,null));};exports[_0x199b('0x48')]=function(_0x3e1840,_0x171ff0){return db[_0x199b('0x29')][_0x199b('0x48')](_0x3e1840['body'],{})[_0x199b('0x23')](respondWithResult(_0x171ff0,0xc9))['catch'](handleError(_0x171ff0,null));};exports[_0x199b('0x22')]=function(_0xe5c230,_0x471b7f){if(_0xe5c230['body']['id']){delete _0xe5c230[_0x199b('0x49')]['id'];}return db['SalesforceField'][_0x199b('0x46')]({'where':{'id':_0xe5c230[_0x199b('0x43')]['id']}})[_0x199b('0x23')](handleEntityNotFound(_0x471b7f,null))[_0x199b('0x23')](saveUpdates(_0xe5c230[_0x199b('0x49')],null))['then'](respondWithResult(_0x471b7f,null))[_0x199b('0x47')](handleError(_0x471b7f,null));};exports[_0x199b('0x24')]=function(_0xb09f55,_0x130eb4){return db[_0x199b('0x29')][_0x199b('0x46')]({'where':{'id':_0xb09f55[_0x199b('0x43')]['id']}})[_0x199b('0x23')](handleEntityNotFound(_0x130eb4,null))['then'](removeEntity(_0x130eb4,null))[_0x199b('0x47')](handleError(_0x130eb4,null));};
\ No newline at end of file
index b9a11a0..248d484 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0127=['request-promise','path','rimraf','../../config/environment','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','lodash','../../config/logger','api','bluebird'];(function(_0xf57493,_0x23ce3f){var _0x2b8da5=function(_0x4a4da0){while(--_0x4a4da0){_0xf57493['push'](_0xf57493['shift']());}};_0x2b8da5(++_0x23ce3f);}(_0x0127,0x18f));var _0x7012=function(_0x259635,_0x4aa6da){_0x259635=_0x259635-0x0;var _0x2cd118=_0x0127[_0x259635];return _0x2cd118;};'use strict';var _=require(_0x7012('0x0'));var util=require('util');var logger=require(_0x7012('0x1'))(_0x7012('0x2'));var moment=require('moment');var BPromise=require(_0x7012('0x3'));var rp=require(_0x7012('0x4'));var fs=require('fs');var path=require(_0x7012('0x5'));var rimraf=require(_0x7012('0x6'));var config=require(_0x7012('0x7'));var attributes=require('./intSalesforceField.attributes');module[_0x7012('0x8')]=function(_0x207ca6,_0x56a732){return _0x207ca6[_0x7012('0x9')](_0x7012('0xa'),attributes,{'tableName':_0x7012('0xb'),'paranoid':![],'indexes':[{'name':_0x7012('0xc'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2d00=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSalesforceField.attributes','define','idField','FieldId','lodash','util','../../config/logger'];(function(_0x220afa,_0xf5f6cc){var _0x1b79d1=function(_0x178a39){while(--_0x178a39){_0x220afa['push'](_0x220afa['shift']());}};_0x1b79d1(++_0xf5f6cc);}(_0x2d00,0xda));var _0x02d0=function(_0x26f59e,_0x2a3009){_0x26f59e=_0x26f59e-0x0;var _0x8b6265=_0x2d00[_0x26f59e];return _0x8b6265;};'use strict';var _=require(_0x02d0('0x0'));var util=require(_0x02d0('0x1'));var logger=require(_0x02d0('0x2'))(_0x02d0('0x3'));var moment=require(_0x02d0('0x4'));var BPromise=require(_0x02d0('0x5'));var rp=require(_0x02d0('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x02d0('0x7'));var config=require(_0x02d0('0x8'));var attributes=require(_0x02d0('0x9'));module['exports']=function(_0x659737,_0x3134b7){return _0x659737[_0x02d0('0xa')]('SalesforceField',attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x02d0('0xb'),_0x02d0('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 38f2db0..7476b6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95a2=['error','message','catch','lodash','bluebird','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0x95a2,0xc9));var _0x295a=function(_0x1e9424,_0x191cba){_0x1e9424=_0x1e9424-0x0;var _0x1bd96c=_0x95a2[_0x1e9424];return _0x1bd96c;};'use strict';var _=require(_0x295a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x295a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x295a('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x295a('0x3'))(_0x295a('0x4'));var config=require('../../config/environment');var jayson=require(_0x295a('0x5'));var client=jayson[_0x295a('0x6')][_0x295a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2f3246,_0x5af410,_0x536c71){return new BPromise(function(_0x27d548,_0x22fe09){return client[_0x295a('0x8')](_0x2f3246,_0x536c71)[_0x295a('0x9')](function(_0x8c4af8){logger[_0x295a('0xa')](_0x295a('0xb'),_0x5af410,_0x295a('0xc'));logger[_0x295a('0xd')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x5af410,_0x295a('0xc'),JSON[_0x295a('0xe')](_0x8c4af8));if(_0x8c4af8[_0x295a('0xf')]){if(_0x8c4af8[_0x295a('0xf')]['code']===0x1f4){logger['error'](_0x295a('0xb'),_0x5af410,_0x8c4af8[_0x295a('0xf')][_0x295a('0x10')]);return _0x22fe09(_0x8c4af8['error'][_0x295a('0x10')]);}logger[_0x295a('0xf')](_0x295a('0xb'),_0x5af410,_0x8c4af8['error'][_0x295a('0x10')]);return _0x27d548(_0x8c4af8[_0x295a('0xf')][_0x295a('0x10')]);}else{logger[_0x295a('0xa')](_0x295a('0xb'),_0x5af410,'request\x20sent');_0x27d548(_0x8c4af8['result']['message']);}})[_0x295a('0x11')](function(_0x311898){logger[_0x295a('0xf')](_0x295a('0xb'),_0x5af410,_0x311898);_0x22fe09(_0x311898);});});}
\ No newline at end of file
+var _0x51af=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','SalesforceField,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x339d37,_0xcd8448){var _0x4b027e=function(_0x5a5bbf){while(--_0x5a5bbf){_0x339d37['push'](_0x339d37['shift']());}};_0x4b027e(++_0xcd8448);}(_0x51af,0x68));var _0xf51a=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x51af[_0x4d613c];return _0x301fe3;};'use strict';var _=require(_0xf51a('0x0'));var util=require(_0xf51a('0x1'));var moment=require(_0xf51a('0x2'));var BPromise=require('bluebird');var rs=require(_0xf51a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf51a('0x4'))['db'];var utils=require(_0xf51a('0x5'));var logger=require(_0xf51a('0x6'))(_0xf51a('0x7'));var config=require(_0xf51a('0x8'));var jayson=require(_0xf51a('0x9'));var client=jayson[_0xf51a('0xa')][_0xf51a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2b022f,_0x1ff36c,_0x59eed0){return new BPromise(function(_0x53fc52,_0x3c68f9){return client[_0xf51a('0xc')](_0x2b022f,_0x59eed0)[_0xf51a('0xd')](function(_0x12bc4f){logger[_0xf51a('0xe')]('SalesforceField,\x20%s,\x20%s',_0x1ff36c,_0xf51a('0xf'));logger[_0xf51a('0x10')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x1ff36c,_0xf51a('0xf'),JSON[_0xf51a('0x11')](_0x12bc4f));if(_0x12bc4f[_0xf51a('0x12')]){if(_0x12bc4f[_0xf51a('0x12')]['code']===0x1f4){logger['error'](_0xf51a('0x13'),_0x1ff36c,_0x12bc4f['error'][_0xf51a('0x14')]);return _0x3c68f9(_0x12bc4f[_0xf51a('0x12')][_0xf51a('0x14')]);}logger[_0xf51a('0x12')]('SalesforceField,\x20%s,\x20%s',_0x1ff36c,_0x12bc4f['error'][_0xf51a('0x14')]);return _0x53fc52(_0x12bc4f[_0xf51a('0x12')]['message']);}else{logger[_0xf51a('0xe')](_0xf51a('0x13'),_0x1ff36c,_0xf51a('0xf'));_0x53fc52(_0x12bc4f[_0xf51a('0x15')]['message']);}})['catch'](function(_0x2bf6bf){logger[_0xf51a('0x12')](_0xf51a('0x13'),_0x1ff36c,_0x2bf6bf);_0x3c68f9(_0x2bf6bf);});});}
\ No newline at end of file
index ce9ffbd..77d237b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a62=['/:id/fields','getFields','post','/:id/configurations','/:id','delete','exports','util','path','express','Router','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','show','getConfigurations'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x9a62,0x1bc));var _0x29a6=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x9a62[_0x57b54c];return _0x59cc19;};'use strict';var multer=require('multer');var util=require(_0x29a6('0x0'));var path=require(_0x29a6('0x1'));var timeout=require('connect-timeout');var express=require(_0x29a6('0x2'));var router=express[_0x29a6('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x29a6('0x4'));var config=require(_0x29a6('0x5'));var controller=require(_0x29a6('0x6'));router[_0x29a6('0x7')]('/',auth[_0x29a6('0x8')](),controller[_0x29a6('0x9')]);router[_0x29a6('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x29a6('0xa')]);router[_0x29a6('0x7')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x29a6('0xb')]);router[_0x29a6('0x7')](_0x29a6('0xc'),auth[_0x29a6('0x8')](),controller[_0x29a6('0xd')]);router[_0x29a6('0xe')]('/',auth[_0x29a6('0x8')](),controller['create']);router[_0x29a6('0xe')](_0x29a6('0xf'),auth['isAuthenticated'](),controller['addConfiguration']);router['put'](_0x29a6('0x10'),auth[_0x29a6('0x8')](),controller['update']);router[_0x29a6('0x11')](_0x29a6('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x29a6('0x12')]=router;
\ No newline at end of file
+var _0x23c5=['/:id/fields','post','/:id/configurations','addConfiguration','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','index','/:id','isAuthenticated','show','getConfigurations'];(function(_0x43d24b,_0x4d6f93){var _0x27e1fd=function(_0xd5a887){while(--_0xd5a887){_0x43d24b['push'](_0x43d24b['shift']());}};_0x27e1fd(++_0x4d6f93);}(_0x23c5,0x128));var _0x523c=function(_0x421e09,_0x52df6e){_0x421e09=_0x421e09-0x0;var _0x247f37=_0x23c5[_0x421e09];return _0x247f37;};'use strict';var multer=require(_0x523c('0x0'));var util=require(_0x523c('0x1'));var path=require(_0x523c('0x2'));var timeout=require('connect-timeout');var express=require(_0x523c('0x3'));var router=express[_0x523c('0x4')]();var fs_extra=require(_0x523c('0x5'));var auth=require(_0x523c('0x6'));var interaction=require(_0x523c('0x7'));var config=require(_0x523c('0x8'));var controller=require(_0x523c('0x9'));router[_0x523c('0xa')]('/',auth['isAuthenticated'](),controller[_0x523c('0xb')]);router[_0x523c('0xa')](_0x523c('0xc'),auth[_0x523c('0xd')](),controller[_0x523c('0xe')]);router[_0x523c('0xa')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x523c('0xf')]);router[_0x523c('0xa')](_0x523c('0x10'),auth[_0x523c('0xd')](),controller['getFields']);router[_0x523c('0x11')]('/',auth[_0x523c('0xd')](),controller['create']);router[_0x523c('0x11')](_0x523c('0x12'),auth[_0x523c('0xd')](),controller[_0x523c('0x13')]);router[_0x523c('0x14')](_0x523c('0xc'),auth[_0x523c('0xd')](),controller[_0x523c('0x15')]);router[_0x523c('0x16')](_0x523c('0xc'),auth[_0x523c('0xd')](),controller[_0x523c('0x17')]);module['exports']=router;
\ No newline at end of file
index 0bfee82..0f58a0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7451=['exports','STRING','username','remoteUri','sequelize'];(function(_0x14b00b,_0x2d9ba9){var _0x3260b3=function(_0x2b67f4){while(--_0x2b67f4){_0x14b00b['push'](_0x14b00b['shift']());}};_0x3260b3(++_0x2d9ba9);}(_0x7451,0xbd));var _0x1745=function(_0x3edf38,_0x2c0b0d){_0x3edf38=_0x3edf38-0x0;var _0x4d3ec1=_0x7451[_0x3edf38];return _0x4d3ec1;};'use strict';var Sequelize=require(_0x1745('0x0'));module[_0x1745('0x1')]={'name':{'type':Sequelize[_0x1745('0x2')]},'description':{'type':Sequelize[_0x1745('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x1745('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x1745('0x2')]},'remoteUri':{'type':Sequelize[_0x1745('0x2')],'unique':_0x1745('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0x0e41=['STRING','remoteUri','sequelize'];(function(_0x53016f,_0x326ed7){var _0x35590d=function(_0x3e96c1){while(--_0x3e96c1){_0x53016f['push'](_0x53016f['shift']());}};_0x35590d(++_0x326ed7);}(_0x0e41,0x68));var _0x10e4=function(_0x375bfa,_0x59456f){_0x375bfa=_0x375bfa-0x0;var _0x4c41fa=_0x0e41[_0x375bfa];return _0x4c41fa;};'use strict';var Sequelize=require(_0x10e4('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x10e4('0x1')]},'username':{'type':Sequelize[_0x10e4('0x1')],'unique':'username'},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x10e4('0x1')]},'remoteUri':{'type':Sequelize[_0x10e4('0x1')],'unique':_0x10e4('0x2')},'serverUrl':{'type':Sequelize[_0x10e4('0x1')],'allowNull':![]}};
\ No newline at end of file
index fd637a6..ec9a1a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4df7=['problem_id','company','activity_due','assigned_to','severity','comments','sla_due','approval','comments_and_work_notes','sys_mod_count','escalation','upon_approval','correlation_id','category','username','email','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','password','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','includes','forEach','internalType','label','push','all','TCL:\x20_object','remove','concat','ServiceNow\x20error:\x20','test','boolean','True','true','GET','inactive','false','value','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','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/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','update','then','error','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','findOne','ServicenowConfiguration','length','pick','getConfigurations','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','hold_reason','knowledge','close_code','incident_state','made_sla','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','opened_by','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','resolved_at','approval_set','subcategory','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','notify','sys_class_name','closed_by','parent_incident','sys_id','contact_type','reopened_by'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4df7,0xe3));var _0x74df=function(_0x323ced,_0x481bf0){_0x323ced=_0x323ced-0x0;var _0x545bec=_0x4df7[_0x323ced];return _0x545bec;};'use strict';var emlformat=require(_0x74df('0x0'));var rimraf=require(_0x74df('0x1'));var zipdir=require(_0x74df('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x74df('0x3'));var moment=require(_0x74df('0x4'));var BPromise=require(_0x74df('0x5'));var Mustache=require(_0x74df('0x6'));var util=require(_0x74df('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x74df('0x8'));var ejs=require(_0x74df('0x9'));var fs=require('fs');var fs_extra=require(_0x74df('0xa'));var _=require(_0x74df('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x74df('0xc'));var deskjs=require(_0x74df('0xd'));var toCsv=require(_0x74df('0x8'));var querystring=require(_0x74df('0xe'));var Papa=require(_0x74df('0xf'));var Redis=require(_0x74df('0x10'));var authService=require(_0x74df('0x11'));var qs=require(_0x74df('0x12'));var as=require(_0x74df('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x74df('0x14'))('api');var utils=require(_0x74df('0x15'));var config=require(_0x74df('0x16'));var licenseUtil=require(_0x74df('0x17'));var db=require(_0x74df('0x18'))['db'];var integrations=require(_0x74df('0x19'));function respondWithStatusCode(_0x233f62,_0x139f7e){_0x139f7e=_0x139f7e||0xcc;return function(_0x50b51a){if(_0x50b51a){return _0x233f62[_0x74df('0x1a')](_0x139f7e);}return _0x233f62[_0x74df('0x1b')](_0x139f7e)[_0x74df('0x1c')]();};}function respondWithResult(_0x31d711,_0x2af94f){_0x2af94f=_0x2af94f||0xc8;return function(_0x13ab51){if(_0x13ab51){return _0x31d711[_0x74df('0x1b')](_0x2af94f)[_0x74df('0x1d')](_0x13ab51);}};}function respondWithFilteredResult(_0x3e79af,_0x1311de){return function(_0x1d7354){if(_0x1d7354){var _0x1649e7=typeof _0x1311de[_0x74df('0x1e')]===_0x74df('0x1f')&&typeof _0x1311de[_0x74df('0x20')]===_0x74df('0x1f');var _0x51b785=_0x1d7354[_0x74df('0x21')];var _0x2a32ea=_0x1649e7?0x0:_0x1311de[_0x74df('0x1e')];var _0x4e1db4=_0x1649e7?_0x1d7354[_0x74df('0x21')]:_0x1311de['offset']+_0x1311de[_0x74df('0x20')];var _0x42e7eb;if(_0x4e1db4>=_0x51b785){_0x4e1db4=_0x51b785;_0x42e7eb=0xc8;}else{_0x42e7eb=0xce;}_0x3e79af[_0x74df('0x1b')](_0x42e7eb);return _0x3e79af[_0x74df('0x22')]('Content-Range',_0x2a32ea+'-'+_0x4e1db4+'/'+_0x51b785)[_0x74df('0x1d')](_0x1d7354);}return null;};}function patchUpdates(_0x5215cd){return function(_0x3593cc){try{jsonpatch['apply'](_0x3593cc,_0x5215cd,!![]);}catch(_0x10d7b1){return BPromise[_0x74df('0x23')](_0x10d7b1);}return _0x3593cc['save']();};}function saveUpdates(_0x461db9,_0x24e1fa){return function(_0xf36b46){if(_0xf36b46){return _0xf36b46[_0x74df('0x24')](_0x461db9)['then'](function(_0x561416){return _0x561416;});}return null;};}function removeEntity(_0x1ec5a1,_0x593d98){return function(_0x26ad4e){if(_0x26ad4e){return _0x26ad4e['destroy']()[_0x74df('0x25')](function(){_0x1ec5a1[_0x74df('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8fe3ce,_0x2dbcf3){return function(_0x51dc0b){if(!_0x51dc0b){_0x8fe3ce['sendStatus'](0x194);}return _0x51dc0b;};}function handleError(_0x58a8d6,_0x4f83b3){_0x4f83b3=_0x4f83b3||0x1f4;return function(_0x53e542){logger[_0x74df('0x26')](_0x53e542[_0x74df('0x27')]);if(_0x53e542[_0x74df('0x28')]){delete _0x53e542[_0x74df('0x28')];}_0x58a8d6[_0x74df('0x1b')](_0x4f83b3)[_0x74df('0x29')](_0x53e542);};}exports[_0x74df('0x2a')]=function(_0x95d293,_0x68da27){var _0x225e68={},_0xaf39a6={},_0x31f035={'count':0x0,'rows':[]};var _0x4292b9=_[_0x74df('0x2b')](db[_0x74df('0x2c')][_0x74df('0x2d')],function(_0x48547b){return{'name':_0x48547b[_0x74df('0x2e')],'type':_0x48547b[_0x74df('0x2f')][_0x74df('0x30')]};});_0xaf39a6[_0x74df('0x31')]=_[_0x74df('0x2b')](_0x4292b9,_0x74df('0x28'));_0xaf39a6[_0x74df('0x32')]=_[_0x74df('0x33')](_0x95d293[_0x74df('0x32')]);_0xaf39a6['filters']=_[_0x74df('0x34')](_0xaf39a6[_0x74df('0x31')],_0xaf39a6['query']);_0x225e68[_0x74df('0x35')]=_[_0x74df('0x34')](_0xaf39a6[_0x74df('0x31')],qs[_0x74df('0x36')](_0x95d293[_0x74df('0x32')][_0x74df('0x36')]));_0x225e68['attributes']=_0x225e68[_0x74df('0x35')]['length']?_0x225e68[_0x74df('0x35')]:_0xaf39a6[_0x74df('0x31')];if(!_0x95d293[_0x74df('0x32')][_0x74df('0x37')](_0x74df('0x38'))){_0x225e68[_0x74df('0x20')]=qs['limit'](_0x95d293[_0x74df('0x32')][_0x74df('0x20')]);_0x225e68[_0x74df('0x1e')]=qs[_0x74df('0x1e')](_0x95d293['query'][_0x74df('0x1e')]);}_0x225e68[_0x74df('0x39')]=qs['sort'](_0x95d293['query'][_0x74df('0x3a')]);_0x225e68[_0x74df('0x3b')]=qs[_0x74df('0x3c')](_['pick'](_0x95d293[_0x74df('0x32')],_0xaf39a6[_0x74df('0x3c')]),_0x4292b9);if(_0x95d293['query'][_0x74df('0x3d')]){_0x225e68[_0x74df('0x3b')]=_[_0x74df('0x3e')](_0x225e68[_0x74df('0x3b')],{'$or':_[_0x74df('0x2b')](_0x4292b9,function(_0x2433de){if(_0x2433de[_0x74df('0x2f')]!==_0x74df('0x3f')){var _0x1449c7={};_0x1449c7[_0x2433de[_0x74df('0x28')]]={'$like':'%'+_0x95d293[_0x74df('0x32')][_0x74df('0x3d')]+'%'};return _0x1449c7;}})});}_0x225e68=_[_0x74df('0x3e')]({},_0x225e68,_0x95d293[_0x74df('0x40')]);var _0x5cd585={'where':_0x225e68['where']};return db[_0x74df('0x2c')][_0x74df('0x21')](_0x5cd585)[_0x74df('0x25')](function(_0x5d3d65){_0x31f035['count']=_0x5d3d65;if(_0x95d293[_0x74df('0x32')][_0x74df('0x41')]){_0x225e68[_0x74df('0x42')]=[{'all':!![]}];}return db[_0x74df('0x2c')][_0x74df('0x43')](_0x225e68);})[_0x74df('0x25')](function(_0x3b9441){_0x31f035[_0x74df('0x44')]=_0x3b9441;return _0x31f035;})[_0x74df('0x25')](respondWithFilteredResult(_0x68da27,_0x225e68))[_0x74df('0x45')](handleError(_0x68da27,null));};exports[_0x74df('0x46')]=function(_0x1ec7ee,_0x2c19da){var _0x195382={'raw':![],'where':{'id':_0x1ec7ee[_0x74df('0x47')]['id']}},_0xa1188e={};_0xa1188e[_0x74df('0x31')]=_[_0x74df('0x33')](db[_0x74df('0x2c')][_0x74df('0x2d')]);_0xa1188e[_0x74df('0x32')]=_['keys'](_0x1ec7ee['query']);_0xa1188e[_0x74df('0x3c')]=_[_0x74df('0x34')](_0xa1188e[_0x74df('0x31')],_0xa1188e[_0x74df('0x32')]);_0x195382[_0x74df('0x35')]=_['intersection'](_0xa1188e[_0x74df('0x31')],qs['fields'](_0x1ec7ee[_0x74df('0x32')][_0x74df('0x36')]));_0x195382[_0x74df('0x35')]=_0x195382[_0x74df('0x35')]['length']?_0x195382[_0x74df('0x35')]:_0xa1188e[_0x74df('0x31')];if(_0x1ec7ee['query']['includeAll']){_0x195382[_0x74df('0x42')]=[{'all':!![]}];}_0x195382=_['merge']({},_0x195382,_0x1ec7ee[_0x74df('0x40')]);return db[_0x74df('0x2c')][_0x74df('0x48')](_0x195382)[_0x74df('0x25')](handleEntityNotFound(_0x2c19da,null))['then'](respondWithResult(_0x2c19da,null))[_0x74df('0x45')](handleError(_0x2c19da,null));};exports[_0x74df('0x49')]=function(_0x305578,_0x5e62a3){return db[_0x74df('0x2c')][_0x74df('0x49')](_0x305578['body'],{})['then'](respondWithResult(_0x5e62a3,0xc9))[_0x74df('0x45')](handleError(_0x5e62a3,null));};exports[_0x74df('0x24')]=function(_0x244311,_0x4c0bd4){if(_0x244311[_0x74df('0x4a')]['id']){delete _0x244311[_0x74df('0x4a')]['id'];}return db[_0x74df('0x2c')][_0x74df('0x48')]({'where':{'id':_0x244311[_0x74df('0x47')]['id']}})[_0x74df('0x25')](handleEntityNotFound(_0x4c0bd4,null))[_0x74df('0x25')](saveUpdates(_0x244311['body'],null))[_0x74df('0x25')](respondWithResult(_0x4c0bd4,null))['catch'](handleError(_0x4c0bd4,null));};exports['destroy']=function(_0x33dbe6,_0xbd7072){return db[_0x74df('0x2c')][_0x74df('0x48')]({'where':{'id':_0x33dbe6[_0x74df('0x47')]['id']}})[_0x74df('0x25')](handleEntityNotFound(_0xbd7072,null))[_0x74df('0x25')](removeEntity(_0xbd7072,null))['catch'](handleError(_0xbd7072,null));};exports['getConfigurations']=function(_0x5a9060,_0x51f370,_0x26d47f){var _0x4a1bdf={};var _0x467e94={};var _0xaca94d;var _0xb3fdda;return db['ServicenowAccount'][_0x74df('0x4b')]({'where':{'id':_0x5a9060[_0x74df('0x47')]['id']}})['then'](handleEntityNotFound(_0x51f370,null))[_0x74df('0x25')](function(_0x1da8be){if(_0x1da8be){_0xaca94d=_0x1da8be;_0x467e94[_0x74df('0x31')]=_['keys'](db[_0x74df('0x4c')]['rawAttributes']);_0x467e94['query']=_['keys'](_0x5a9060[_0x74df('0x32')]);_0x467e94[_0x74df('0x3c')]=_[_0x74df('0x34')](_0x467e94[_0x74df('0x31')],_0x467e94['query']);_0x4a1bdf[_0x74df('0x35')]=_['intersection'](_0x467e94[_0x74df('0x31')],qs['fields'](_0x5a9060['query']['fields']));_0x4a1bdf[_0x74df('0x35')]=_0x4a1bdf[_0x74df('0x35')][_0x74df('0x4d')]?_0x4a1bdf[_0x74df('0x35')]:_0x467e94[_0x74df('0x31')];_0x4a1bdf['order']=qs[_0x74df('0x3a')](_0x5a9060['query'][_0x74df('0x3a')]);_0x4a1bdf['where']=qs[_0x74df('0x3c')](_[_0x74df('0x4e')](_0x5a9060[_0x74df('0x32')],_0x467e94[_0x74df('0x3c')]));if(_0x5a9060['query'][_0x74df('0x3d')]){_0x4a1bdf[_0x74df('0x3b')]=_[_0x74df('0x3e')](_0x4a1bdf[_0x74df('0x3b')],{'$or':_[_0x74df('0x2b')](_0x4a1bdf[_0x74df('0x35')],function(_0x2e5e87){var _0x43eaed={};_0x43eaed[_0x2e5e87]={'$like':'%'+_0x5a9060['query'][_0x74df('0x3d')]+'%'};return _0x43eaed;})});}_0x4a1bdf=_[_0x74df('0x3e')]({},_0x4a1bdf,_0x5a9060[_0x74df('0x40')]);return _0xaca94d['getConfigurations'](_0x4a1bdf);}})['then'](function(_0xe6d0bf){if(_0xe6d0bf){_0xb3fdda=_0xe6d0bf[_0x74df('0x4d')];if(!_0x5a9060['query'][_0x74df('0x37')](_0x74df('0x38'))){_0x4a1bdf[_0x74df('0x20')]=qs[_0x74df('0x20')](_0x5a9060[_0x74df('0x32')][_0x74df('0x20')]);_0x4a1bdf['offset']=qs[_0x74df('0x1e')](_0x5a9060[_0x74df('0x32')]['offset']);}return _0xaca94d[_0x74df('0x4f')](_0x4a1bdf);}})['then'](function(_0x44c488){if(_0x44c488){return _0x44c488?{'count':_0xb3fdda,'rows':_0x44c488}:null;}})[_0x74df('0x25')](respondWithResult(_0x51f370,null))[_0x74df('0x45')](handleError(_0x51f370,null));};exports[_0x74df('0x50')]=function(_0x465f8f,_0x71bf0e,_0x5e5daf){if(_0x465f8f[_0x74df('0x4a')]['id']){delete _0x465f8f[_0x74df('0x4a')]['id'];}return db[_0x74df('0x2c')][_0x74df('0x4b')]({'where':{'id':_0x465f8f[_0x74df('0x47')]['id']}})[_0x74df('0x25')](handleEntityNotFound(_0x71bf0e,null))['then'](function(_0x4fe35c){if(_0x4fe35c){_0x465f8f['body'][_0x74df('0x51')]=_0x4fe35c['id'];_0x465f8f[_0x74df('0x4a')][_0x74df('0x52')]=integrations['getSubjects'](_0x465f8f[_0x74df('0x4a')][_0x74df('0x53')],_0x465f8f[_0x74df('0x4a')]['type']);_0x465f8f[_0x74df('0x4a')][_0x74df('0x54')]=integrations[_0x74df('0x55')](_0x465f8f[_0x74df('0x4a')][_0x74df('0x53')],_0x465f8f['body']['type']);return db['ServicenowConfiguration'][_0x74df('0x49')](_0x465f8f[_0x74df('0x4a')],{'include':[{'model':db[_0x74df('0x56')],'as':'Subjects'},{'model':db['ServicenowField'],'as':_0x74df('0x54')}]});}return null;})[_0x74df('0x25')](respondWithResult(_0x71bf0e,null))['catch'](handleError(_0x71bf0e,null));};exports[_0x74df('0x57')]=function(_0xbe4ec8,_0x52a966,_0x311a21){var _0x2c8d44=['made_sla',_0x74df('0x58'),_0x74df('0x59'),'subcategory',_0x74df('0x5a'),'notify',_0x74df('0x5b'),'severity','category'];var _0x483596=['parent',_0x74df('0x5c'),_0x74df('0x5d'),_0x74df('0x5e'),_0x74df('0x5f'),_0x74df('0x60'),_0x74df('0x61'),'hold_reason','approval_history','number','resolved_by','sys_updated_by',_0x74df('0x62'),'user_input',_0x74df('0x63'),_0x74df('0x64'),_0x74df('0x65'),_0x74df('0x66'),'knowledge',_0x74df('0x39'),_0x74df('0x67'),_0x74df('0x68'),_0x74df('0x69'),_0x74df('0x6a'),_0x74df('0x6b'),'active','work_notes_list','business_service','priority',_0x74df('0x6c'),_0x74df('0x6d'),_0x74df('0x6e'),_0x74df('0x6f'),_0x74df('0x70'),_0x74df('0x71'),_0x74df('0x72'),_0x74df('0x73'),'reopened_time',_0x74df('0x74'),'caller_id',_0x74df('0x75'),_0x74df('0x76'),'work_notes',_0x74df('0x77'),_0x74df('0x5a'),_0x74df('0x78'),_0x74df('0x79'),_0x74df('0x7a'),_0x74df('0x7b'),_0x74df('0x7c'),_0x74df('0x7d'),_0x74df('0x7e'),_0x74df('0x7f'),_0x74df('0x80'),_0x74df('0x81'),'close_notes',_0x74df('0x82'),'follow_up',_0x74df('0x83'),_0x74df('0x84'),_0x74df('0x85'),_0x74df('0x86'),'incident_state','urgency',_0x74df('0x87'),_0x74df('0x88'),'reassignment_count',_0x74df('0x89'),_0x74df('0x8a'),_0x74df('0x8b'),_0x74df('0x8c'),_0x74df('0x8d'),_0x74df('0x8e'),_0x74df('0x8f'),'due_date',_0x74df('0x90'),'reopen_count','sys_tags',_0x74df('0x91'),_0x74df('0x92'),_0x74df('0x93'),'location',_0x74df('0x94')];var _0x44042c='';var _0x763d3a='';var _0x1a5d86=[];var _0x3cbca3='';var _0x48b2c9='';var _0x2285d8=[];var _0x32dedc='';var _0x32d42c='';var _0x7aa319={};var _0x50906e='';return db['ServicenowAccount'][_0x74df('0x4b')]({'where':{'id':_0xbe4ec8[_0x74df('0x47')]['id']},'attributes':['id',_0x74df('0x95'),'password',_0x74df('0x96'),_0x74df('0x97'),'serverUrl']})[_0x74df('0x25')](handleEntityNotFound(_0x52a966,null))[_0x74df('0x25')](function(_0x58dd42){if(_0x58dd42){_0x50906e=_0x58dd42['remoteUri'];var _0xc7dc07=_0x50906e[_0x74df('0x98')](-0x1);if(_0xc7dc07==='/'){_0x50906e=_0x50906e[_0x74df('0x99')](0x0,_0x50906e[_0x74df('0x9a')](_0xc7dc07));}_0x32d42c=util[_0x74df('0x9b')](_0x74df('0x9c'),_0x50906e);_0x32dedc=util['format']('%s/api/now/table/',_0x50906e);_0x7aa319={'user':_0x58dd42['username'],'pass':_0x58dd42[_0x74df('0x9d')]};var _0xe2ebad={'method':'GET','uri':_0x32d42c+_0x74df('0x9e'),'auth':_0x7aa319,'json':!![]};return rp(_0xe2ebad);}})[_0x74df('0x25')](function(_0x38f0b9){if(_0x38f0b9[_0x74df('0x9f')][_0x74df('0x4d')]>0x0){_0x44042c=_0x38f0b9[_0x74df('0x9f')];}console[_0x74df('0xa0')](_0x74df('0xa1'),_0x44042c);_0x2285d8=[];_0x763d3a=Object[_0x74df('0xa2')]([],_0x44042c);_['remove'](_0x763d3a,function(_0x89f1da){return!_0x2c8d44[_0x74df('0xa3')](_0x89f1da[_0x74df('0x28')]);});_0x763d3a[_0x74df('0xa4')](function(_0x4abe9a){var _0x61bc89=createFieldObject(_0x32dedc,_0x7aa319,_0x4abe9a[_0x74df('0xa5')],_0x4abe9a[_0x74df('0x28')],_0x4abe9a[_0x74df('0xa6')],![]);_0x2285d8[_0x74df('0xa7')](_0x61bc89);});return Promise[_0x74df('0xa8')](_0x2285d8);})[_0x74df('0x25')](function(_0x3700ee){_0x1a5d86=_0x3700ee;_0x3cbca3=Object[_0x74df('0xa2')]([],_0x44042c);console[_0x74df('0xa0')](_0x74df('0xa9'),_0x44042c);_[_0x74df('0xaa')](_0x3cbca3,function(_0x7fb059){return _0x483596['includes'](_0x7fb059[_0x74df('0x28')]);});console[_0x74df('0xa0')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x3cbca3);_0x2285d8=[];_0x3cbca3[_0x74df('0xa4')](function(_0x195dba){var _0x25be82=createFieldObject(_0x32dedc,_0x7aa319,_0x195dba[_0x74df('0xa5')],_0x195dba['name'],_0x195dba[_0x74df('0xa6')],!![]);_0x2285d8[_0x74df('0xa7')](_0x25be82);});return Promise[_0x74df('0xa8')](_0x2285d8);})[_0x74df('0x25')](function(_0x42df3e){_0x48b2c9=_0x42df3e;var _0xe7ba2e=_0x1a5d86[_0x74df('0xab')](_0x48b2c9);return{'count':_0xe7ba2e[_0x74df('0x4d')],'rows':_0xe7ba2e};})['then'](respondWithResult(_0x52a966,null))[_0x74df('0x45')](function(_0x37f723){console['log'](_0x74df('0xac')+_0x37f723);var _0x5ac366=_0xbe4ec8[_0x74df('0x32')][_0x74df('0xad')]?0x1f4:_0x37f723['statusCode']||0x1f4;logger[_0x74df('0x26')](_0x37f723[_0x74df('0x27')]);delete _0x37f723[_0x74df('0x28')];if(_0x5ac366===0x191){_0x5ac366=0x190;}_0x52a966[_0x74df('0x1b')](_0x5ac366)['send'](_0xbe4ec8[_0x74df('0x32')][_0x74df('0xad')]?{'message':'Wrong\x20credentials','statusCode':_0x37f723['statusCode']}:_0x37f723);});};function createFieldObject(_0x153c99,_0x179d96,_0x30bf6b,_0x17a416,_0x529449,_0x3cfa20){return new Promise(function(_0x116e89,_0x197680){var _0x2e6430={'id':_0x17a416,'name':_0x529449,'custom':_0x3cfa20};if(_0x30bf6b===_0x74df('0xae')){_0x2e6430[_0x74df('0x40')]=[{'name':_0x74df('0xaf'),'value':_0x74df('0xb0')},{'name':'False','value':'false'}];_0x116e89(_0x2e6430);}else{var _0xa46c41={'method':_0x74df('0xb1'),'uri':_0x153c99+'sys_choice?sysparm_query=name=incident^element='+_0x17a416,'auth':_0x179d96,'json':!![]};return rp(_0xa46c41)[_0x74df('0x25')](function(_0x4b9a0a){var _0x398f20=[];if(_0x4b9a0a['result'][_0x74df('0x4d')]>0x0){_0x4b9a0a[_0x74df('0x9f')][_0x74df('0xa4')](function(_0x296552){if(_0x296552[_0x74df('0xb2')]===_0x74df('0xb3')){var _0x12e0de={'name':_0x296552[_0x74df('0xa6')],'value':_0x296552[_0x74df('0xb4')]};_0x398f20['push'](_0x12e0de);}});}_0x2e6430[_0x74df('0x40')]=_0x398f20;if(_0x2e6430[_0x74df('0x40')][_0x74df('0x4d')]>0x0){_0x116e89(_0x2e6430);}else{if(_0x3cfa20==![]){_0x116e89();}else{_0x116e89(_0x2e6430);}}});}});}
\ No newline at end of file
+var _0x2ea0=['assign','TCL:\x20_object','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','concat','test','statusCode','stack','Wrong\x20credentials','boolean','true','False','forEach','inactive','false','value','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','error','name','send','index','map','ServicenowAccount','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','sort','where','pick','filter','type','merge','options','includeAll','findAll','rows','catch','show','rawAttributes','include','create','body','update','find','params','destroy','findOne','ServicenowConfiguration','order','getConfigurations','hasOwnProperty','nolimit','AccountId','Subjects','getSubjects','Descriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','notify','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','delivery_plan','active','business_service','priority','rfc','time_worked','expected_start','business_duration','work_end','reopened_time','resolved_at','caller_id','work_notes','short_description','close_code','correlation_display','delivery_task','work_start','assignment_group','business_stc','description','calendar_duration','close_notes','closed_by','follow_up','sys_id','reopened_by','incident_state','urgency','problem_id','reassignment_count','activity_due','assigned_to','severity','comments','sla_due','comments_and_work_notes','due_date','sys_mod_count','sys_tags','escalation','upon_approval','location','username','password','remoteUri','slice','substring','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','includes','internalType','push','all'];(function(_0x374c82,_0x52998f){var _0x1ae6ae=function(_0x4a077c){while(--_0x4a077c){_0x374c82['push'](_0x374c82['shift']());}};_0x1ae6ae(++_0x52998f);}(_0x2ea0,0x189));var _0x02ea=function(_0x264ca3,_0x65b645){_0x264ca3=_0x264ca3-0x0;var _0x156d1e=_0x2ea0[_0x264ca3];return _0x156d1e;};'use strict';var emlformat=require(_0x02ea('0x0'));var rimraf=require(_0x02ea('0x1'));var zipdir=require(_0x02ea('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x02ea('0x3'));var moment=require(_0x02ea('0x4'));var BPromise=require(_0x02ea('0x5'));var Mustache=require(_0x02ea('0x6'));var util=require('util');var path=require(_0x02ea('0x7'));var sox=require(_0x02ea('0x8'));var csv=require('to-csv');var ejs=require(_0x02ea('0x9'));var fs=require('fs');var fs_extra=require(_0x02ea('0xa'));var _=require('lodash');var squel=require(_0x02ea('0xb'));var crypto=require(_0x02ea('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x02ea('0xd'));var toCsv=require(_0x02ea('0xe'));var querystring=require(_0x02ea('0xf'));var Papa=require(_0x02ea('0x10'));var Redis=require(_0x02ea('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x02ea('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x02ea('0x13'));var logger=require(_0x02ea('0x14'))(_0x02ea('0x15'));var utils=require(_0x02ea('0x16'));var config=require(_0x02ea('0x17'));var licenseUtil=require(_0x02ea('0x18'));var db=require(_0x02ea('0x19'))['db'];var integrations=require(_0x02ea('0x1a'));function respondWithStatusCode(_0x27ec5a,_0x201edd){_0x201edd=_0x201edd||0xcc;return function(_0x1303d9){if(_0x1303d9){return _0x27ec5a[_0x02ea('0x1b')](_0x201edd);}return _0x27ec5a[_0x02ea('0x1c')](_0x201edd)[_0x02ea('0x1d')]();};}function respondWithResult(_0x356c55,_0x3e2f27){_0x3e2f27=_0x3e2f27||0xc8;return function(_0x5d8dbc){if(_0x5d8dbc){return _0x356c55[_0x02ea('0x1c')](_0x3e2f27)[_0x02ea('0x1e')](_0x5d8dbc);}};}function respondWithFilteredResult(_0x5a7a5a,_0x568a27){return function(_0x57181d){if(_0x57181d){var _0x441d58=typeof _0x568a27[_0x02ea('0x1f')]===_0x02ea('0x20')&&typeof _0x568a27['limit']===_0x02ea('0x20');var _0x484db4=_0x57181d[_0x02ea('0x21')];var _0x459558=_0x441d58?0x0:_0x568a27[_0x02ea('0x1f')];var _0x100120=_0x441d58?_0x57181d[_0x02ea('0x21')]:_0x568a27[_0x02ea('0x1f')]+_0x568a27[_0x02ea('0x22')];var _0x24b615;if(_0x100120>=_0x484db4){_0x100120=_0x484db4;_0x24b615=0xc8;}else{_0x24b615=0xce;}_0x5a7a5a[_0x02ea('0x1c')](_0x24b615);return _0x5a7a5a[_0x02ea('0x23')](_0x02ea('0x24'),_0x459558+'-'+_0x100120+'/'+_0x484db4)[_0x02ea('0x1e')](_0x57181d);}return null;};}function patchUpdates(_0x42aad0){return function(_0x510e02){try{jsonpatch[_0x02ea('0x25')](_0x510e02,_0x42aad0,!![]);}catch(_0x325137){return BPromise[_0x02ea('0x26')](_0x325137);}return _0x510e02[_0x02ea('0x27')]();};}function saveUpdates(_0x57bd16,_0x40170a){return function(_0x5884b0){if(_0x5884b0){return _0x5884b0['update'](_0x57bd16)[_0x02ea('0x28')](function(_0x2f0795){return _0x2f0795;});}return null;};}function removeEntity(_0x401fd1,_0x51fca2){return function(_0x3574de){if(_0x3574de){return _0x3574de['destroy']()[_0x02ea('0x28')](function(){_0x401fd1[_0x02ea('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x349902,_0x3b98fc){return function(_0x4aa312){if(!_0x4aa312){_0x349902[_0x02ea('0x1b')](0x194);}return _0x4aa312;};}function handleError(_0x322f74,_0xcde122){_0xcde122=_0xcde122||0x1f4;return function(_0x421393){logger[_0x02ea('0x29')](_0x421393['stack']);if(_0x421393[_0x02ea('0x2a')]){delete _0x421393['name'];}_0x322f74[_0x02ea('0x1c')](_0xcde122)[_0x02ea('0x2b')](_0x421393);};}exports[_0x02ea('0x2c')]=function(_0x3e10ff,_0xc46b41){var _0x35beb1={},_0x4db78f={},_0x20d511={'count':0x0,'rows':[]};var _0x2a61cd=_[_0x02ea('0x2d')](db[_0x02ea('0x2e')]['rawAttributes'],function(_0xa5d965){return{'name':_0xa5d965[_0x02ea('0x2f')],'type':_0xa5d965['type'][_0x02ea('0x30')]};});_0x4db78f[_0x02ea('0x31')]=_[_0x02ea('0x2d')](_0x2a61cd,_0x02ea('0x2a'));_0x4db78f[_0x02ea('0x32')]=_[_0x02ea('0x33')](_0x3e10ff[_0x02ea('0x32')]);_0x4db78f[_0x02ea('0x34')]=_['intersection'](_0x4db78f[_0x02ea('0x31')],_0x4db78f['query']);_0x35beb1['attributes']=_[_0x02ea('0x35')](_0x4db78f[_0x02ea('0x31')],qs[_0x02ea('0x36')](_0x3e10ff[_0x02ea('0x32')]['fields']));_0x35beb1['attributes']=_0x35beb1[_0x02ea('0x37')][_0x02ea('0x38')]?_0x35beb1[_0x02ea('0x37')]:_0x4db78f[_0x02ea('0x31')];if(!_0x3e10ff[_0x02ea('0x32')]['hasOwnProperty']('nolimit')){_0x35beb1[_0x02ea('0x22')]=qs[_0x02ea('0x22')](_0x3e10ff['query'][_0x02ea('0x22')]);_0x35beb1['offset']=qs[_0x02ea('0x1f')](_0x3e10ff[_0x02ea('0x32')][_0x02ea('0x1f')]);}_0x35beb1['order']=qs[_0x02ea('0x39')](_0x3e10ff['query']['sort']);_0x35beb1[_0x02ea('0x3a')]=qs['filters'](_[_0x02ea('0x3b')](_0x3e10ff[_0x02ea('0x32')],_0x4db78f[_0x02ea('0x34')]),_0x2a61cd);if(_0x3e10ff['query'][_0x02ea('0x3c')]){_0x35beb1[_0x02ea('0x3a')]=_['merge'](_0x35beb1[_0x02ea('0x3a')],{'$or':_[_0x02ea('0x2d')](_0x2a61cd,function(_0x33aa5c){if(_0x33aa5c[_0x02ea('0x3d')]!=='VIRTUAL'){var _0x274879={};_0x274879[_0x33aa5c[_0x02ea('0x2a')]]={'$like':'%'+_0x3e10ff[_0x02ea('0x32')][_0x02ea('0x3c')]+'%'};return _0x274879;}})});}_0x35beb1=_[_0x02ea('0x3e')]({},_0x35beb1,_0x3e10ff[_0x02ea('0x3f')]);var _0x5c1634={'where':_0x35beb1[_0x02ea('0x3a')]};return db[_0x02ea('0x2e')]['count'](_0x5c1634)['then'](function(_0x1c95af){_0x20d511[_0x02ea('0x21')]=_0x1c95af;if(_0x3e10ff[_0x02ea('0x32')][_0x02ea('0x40')]){_0x35beb1['include']=[{'all':!![]}];}return db[_0x02ea('0x2e')][_0x02ea('0x41')](_0x35beb1);})['then'](function(_0x14a1ab){_0x20d511[_0x02ea('0x42')]=_0x14a1ab;return _0x20d511;})[_0x02ea('0x28')](respondWithFilteredResult(_0xc46b41,_0x35beb1))[_0x02ea('0x43')](handleError(_0xc46b41,null));};exports[_0x02ea('0x44')]=function(_0x1f6346,_0x371b1a){var _0x4dda45={'raw':![],'where':{'id':_0x1f6346['params']['id']}},_0xccf3be={};_0xccf3be[_0x02ea('0x31')]=_[_0x02ea('0x33')](db[_0x02ea('0x2e')][_0x02ea('0x45')]);_0xccf3be[_0x02ea('0x32')]=_[_0x02ea('0x33')](_0x1f6346[_0x02ea('0x32')]);_0xccf3be['filters']=_['intersection'](_0xccf3be[_0x02ea('0x31')],_0xccf3be[_0x02ea('0x32')]);_0x4dda45['attributes']=_[_0x02ea('0x35')](_0xccf3be['model'],qs[_0x02ea('0x36')](_0x1f6346[_0x02ea('0x32')]['fields']));_0x4dda45[_0x02ea('0x37')]=_0x4dda45[_0x02ea('0x37')][_0x02ea('0x38')]?_0x4dda45[_0x02ea('0x37')]:_0xccf3be[_0x02ea('0x31')];if(_0x1f6346[_0x02ea('0x32')][_0x02ea('0x40')]){_0x4dda45[_0x02ea('0x46')]=[{'all':!![]}];}_0x4dda45=_[_0x02ea('0x3e')]({},_0x4dda45,_0x1f6346[_0x02ea('0x3f')]);return db['ServicenowAccount']['find'](_0x4dda45)['then'](handleEntityNotFound(_0x371b1a,null))[_0x02ea('0x28')](respondWithResult(_0x371b1a,null))[_0x02ea('0x43')](handleError(_0x371b1a,null));};exports[_0x02ea('0x47')]=function(_0x3c1af6,_0x39553c){return db[_0x02ea('0x2e')][_0x02ea('0x47')](_0x3c1af6[_0x02ea('0x48')],{})[_0x02ea('0x28')](respondWithResult(_0x39553c,0xc9))[_0x02ea('0x43')](handleError(_0x39553c,null));};exports[_0x02ea('0x49')]=function(_0x39b813,_0x140c74){if(_0x39b813[_0x02ea('0x48')]['id']){delete _0x39b813['body']['id'];}return db[_0x02ea('0x2e')][_0x02ea('0x4a')]({'where':{'id':_0x39b813[_0x02ea('0x4b')]['id']}})[_0x02ea('0x28')](handleEntityNotFound(_0x140c74,null))[_0x02ea('0x28')](saveUpdates(_0x39b813[_0x02ea('0x48')],null))[_0x02ea('0x28')](respondWithResult(_0x140c74,null))[_0x02ea('0x43')](handleError(_0x140c74,null));};exports[_0x02ea('0x4c')]=function(_0x24a66a,_0x55d98c){return db[_0x02ea('0x2e')]['find']({'where':{'id':_0x24a66a[_0x02ea('0x4b')]['id']}})[_0x02ea('0x28')](handleEntityNotFound(_0x55d98c,null))['then'](removeEntity(_0x55d98c,null))[_0x02ea('0x43')](handleError(_0x55d98c,null));};exports['getConfigurations']=function(_0x5e9ee2,_0x2ab450,_0x1dd4d3){var _0x29b36c={};var _0x3c2542={};var _0x3d327d;var _0x35308d;return db['ServicenowAccount'][_0x02ea('0x4d')]({'where':{'id':_0x5e9ee2[_0x02ea('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2ab450,null))[_0x02ea('0x28')](function(_0x305212){if(_0x305212){_0x3d327d=_0x305212;_0x3c2542[_0x02ea('0x31')]=_['keys'](db[_0x02ea('0x4e')]['rawAttributes']);_0x3c2542['query']=_[_0x02ea('0x33')](_0x5e9ee2[_0x02ea('0x32')]);_0x3c2542[_0x02ea('0x34')]=_[_0x02ea('0x35')](_0x3c2542[_0x02ea('0x31')],_0x3c2542[_0x02ea('0x32')]);_0x29b36c[_0x02ea('0x37')]=_[_0x02ea('0x35')](_0x3c2542[_0x02ea('0x31')],qs[_0x02ea('0x36')](_0x5e9ee2['query'][_0x02ea('0x36')]));_0x29b36c[_0x02ea('0x37')]=_0x29b36c[_0x02ea('0x37')]['length']?_0x29b36c['attributes']:_0x3c2542['model'];_0x29b36c[_0x02ea('0x4f')]=qs[_0x02ea('0x39')](_0x5e9ee2[_0x02ea('0x32')][_0x02ea('0x39')]);_0x29b36c['where']=qs['filters'](_[_0x02ea('0x3b')](_0x5e9ee2[_0x02ea('0x32')],_0x3c2542[_0x02ea('0x34')]));if(_0x5e9ee2[_0x02ea('0x32')]['filter']){_0x29b36c[_0x02ea('0x3a')]=_[_0x02ea('0x3e')](_0x29b36c[_0x02ea('0x3a')],{'$or':_[_0x02ea('0x2d')](_0x29b36c[_0x02ea('0x37')],function(_0x79b167){var _0x387b1a={};_0x387b1a[_0x79b167]={'$like':'%'+_0x5e9ee2[_0x02ea('0x32')][_0x02ea('0x3c')]+'%'};return _0x387b1a;})});}_0x29b36c=_[_0x02ea('0x3e')]({},_0x29b36c,_0x5e9ee2[_0x02ea('0x3f')]);return _0x3d327d[_0x02ea('0x50')](_0x29b36c);}})[_0x02ea('0x28')](function(_0x2ad0e7){if(_0x2ad0e7){_0x35308d=_0x2ad0e7[_0x02ea('0x38')];if(!_0x5e9ee2[_0x02ea('0x32')][_0x02ea('0x51')](_0x02ea('0x52'))){_0x29b36c['limit']=qs['limit'](_0x5e9ee2['query'][_0x02ea('0x22')]);_0x29b36c['offset']=qs[_0x02ea('0x1f')](_0x5e9ee2[_0x02ea('0x32')][_0x02ea('0x1f')]);}return _0x3d327d['getConfigurations'](_0x29b36c);}})['then'](function(_0x26d866){if(_0x26d866){return _0x26d866?{'count':_0x35308d,'rows':_0x26d866}:null;}})[_0x02ea('0x28')](respondWithResult(_0x2ab450,null))['catch'](handleError(_0x2ab450,null));};exports['addConfiguration']=function(_0x5430c0,_0x110044,_0x497ae9){if(_0x5430c0[_0x02ea('0x48')]['id']){delete _0x5430c0[_0x02ea('0x48')]['id'];}return db[_0x02ea('0x2e')][_0x02ea('0x4d')]({'where':{'id':_0x5430c0[_0x02ea('0x4b')]['id']}})['then'](handleEntityNotFound(_0x110044,null))['then'](function(_0x4d76c2){if(_0x4d76c2){_0x5430c0['body'][_0x02ea('0x53')]=_0x4d76c2['id'];_0x5430c0[_0x02ea('0x48')][_0x02ea('0x54')]=integrations[_0x02ea('0x55')](_0x5430c0[_0x02ea('0x48')]['channel'],_0x5430c0['body'][_0x02ea('0x3d')]);_0x5430c0[_0x02ea('0x48')][_0x02ea('0x56')]=integrations['getDescriptions'](_0x5430c0['body']['channel'],_0x5430c0[_0x02ea('0x48')][_0x02ea('0x3d')]);return db[_0x02ea('0x4e')]['create'](_0x5430c0[_0x02ea('0x48')],{'include':[{'model':db[_0x02ea('0x57')],'as':_0x02ea('0x54')},{'model':db[_0x02ea('0x57')],'as':_0x02ea('0x56')}]});}return null;})[_0x02ea('0x28')](respondWithResult(_0x110044,null))[_0x02ea('0x43')](handleError(_0x110044,null));};exports[_0x02ea('0x58')]=function(_0xcc7dc4,_0x14998e,_0x4f48e0){var _0x18aa15=[_0x02ea('0x59'),_0x02ea('0x5a'),_0x02ea('0x5b'),'subcategory','close_code',_0x02ea('0x5c'),'incident_state','severity',_0x02ea('0x5d')];var _0x18fe98=[_0x02ea('0x5e'),_0x02ea('0x59'),_0x02ea('0x5f'),_0x02ea('0x60'),_0x02ea('0x61'),_0x02ea('0x62'),_0x02ea('0x63'),_0x02ea('0x5a'),_0x02ea('0x64'),_0x02ea('0x65'),_0x02ea('0x66'),_0x02ea('0x67'),_0x02ea('0x68'),_0x02ea('0x69'),_0x02ea('0x6a'),_0x02ea('0x6b'),_0x02ea('0x6c'),_0x02ea('0x6d'),_0x02ea('0x5b'),'order',_0x02ea('0x6e'),_0x02ea('0x6f'),'cmdb_ci',_0x02ea('0x70'),'impact',_0x02ea('0x71'),'work_notes_list',_0x02ea('0x72'),_0x02ea('0x73'),'sys_domain_path',_0x02ea('0x74'),_0x02ea('0x75'),_0x02ea('0x76'),'opened_at',_0x02ea('0x77'),'group_list',_0x02ea('0x78'),_0x02ea('0x79'),_0x02ea('0x7a'),_0x02ea('0x7b'),'approval_set','subcategory',_0x02ea('0x7c'),_0x02ea('0x7d'),_0x02ea('0x7e'),_0x02ea('0x7f'),_0x02ea('0x80'),_0x02ea('0x81'),_0x02ea('0x82'),_0x02ea('0x83'),'additional_assignee_list',_0x02ea('0x84'),_0x02ea('0x85'),_0x02ea('0x5c'),'sys_class_name',_0x02ea('0x86'),_0x02ea('0x87'),_0x02ea('0x88'),'parent_incident',_0x02ea('0x89'),'contact_type',_0x02ea('0x8a'),_0x02ea('0x8b'),_0x02ea('0x8c'),_0x02ea('0x8d'),'company',_0x02ea('0x8e'),_0x02ea('0x8f'),_0x02ea('0x90'),_0x02ea('0x91'),_0x02ea('0x92'),_0x02ea('0x93'),'approval',_0x02ea('0x94'),_0x02ea('0x95'),_0x02ea('0x96'),'reopen_count',_0x02ea('0x97'),_0x02ea('0x98'),_0x02ea('0x99'),'correlation_id',_0x02ea('0x9a'),_0x02ea('0x5d')];var _0x15caf7='';var _0x6ca6c9='';var _0x3cfd93=[];var _0x31428a='';var _0x1d7360='';var _0x528d7f=[];var _0x141d85='';var _0x4cce9e='';var _0xe7a662={};var _0x2d28fe='';return db[_0x02ea('0x2e')][_0x02ea('0x4d')]({'where':{'id':_0xcc7dc4[_0x02ea('0x4b')]['id']},'attributes':['id',_0x02ea('0x9b'),_0x02ea('0x9c'),'email',_0x02ea('0x9d'),'serverUrl']})['then'](handleEntityNotFound(_0x14998e,null))[_0x02ea('0x28')](function(_0x559fc3){if(_0x559fc3){_0x2d28fe=_0x559fc3['remoteUri'];var _0x22fb4f=_0x2d28fe[_0x02ea('0x9e')](-0x1);if(_0x22fb4f==='/'){_0x2d28fe=_0x2d28fe[_0x02ea('0x9f')](0x0,_0x2d28fe['lastIndexOf'](_0x22fb4f));}_0x4cce9e=util[_0x02ea('0xa0')]('%s/api/now/doc/table/schema/',_0x2d28fe);_0x141d85=util[_0x02ea('0xa0')](_0x02ea('0xa1'),_0x2d28fe);_0xe7a662={'user':_0x559fc3[_0x02ea('0x9b')],'pass':_0x559fc3[_0x02ea('0x9c')]};var _0x213937={'method':_0x02ea('0xa2'),'uri':_0x4cce9e+_0x02ea('0xa3'),'auth':_0xe7a662,'json':!![]};return rp(_0x213937);}})['then'](function(_0x175244){if(_0x175244[_0x02ea('0xa4')]['length']>0x0){_0x15caf7=_0x175244[_0x02ea('0xa4')];}console[_0x02ea('0xa5')](_0x02ea('0xa6'),_0x15caf7);_0x528d7f=[];_0x6ca6c9=Object['assign']([],_0x15caf7);_['remove'](_0x6ca6c9,function(_0x5e4ac3){return!_0x18aa15[_0x02ea('0xa7')](_0x5e4ac3[_0x02ea('0x2a')]);});_0x6ca6c9['forEach'](function(_0x532ffb){var _0x209c6f=createFieldObject(_0x141d85,_0xe7a662,_0x532ffb[_0x02ea('0xa8')],_0x532ffb[_0x02ea('0x2a')],_0x532ffb['label'],![]);_0x528d7f[_0x02ea('0xa9')](_0x209c6f);});return Promise[_0x02ea('0xaa')](_0x528d7f);})[_0x02ea('0x28')](function(_0x311c7d){_0x3cfd93=_0x311c7d;_0x31428a=Object[_0x02ea('0xab')]([],_0x15caf7);console[_0x02ea('0xa5')](_0x02ea('0xac'),_0x15caf7);_[_0x02ea('0xad')](_0x31428a,function(_0xb4d4e){return _0x18fe98['includes'](_0xb4d4e[_0x02ea('0x2a')]);});console[_0x02ea('0xa5')](_0x02ea('0xae'),_0x31428a);_0x528d7f=[];_0x31428a['forEach'](function(_0x32e87a){var _0x2eb690=createFieldObject(_0x141d85,_0xe7a662,_0x32e87a['internalType'],_0x32e87a[_0x02ea('0x2a')],_0x32e87a[_0x02ea('0xaf')],!![]);_0x528d7f['push'](_0x2eb690);});return Promise['all'](_0x528d7f);})[_0x02ea('0x28')](function(_0x910812){_0x1d7360=_0x910812;var _0x2e9e01=_0x3cfd93[_0x02ea('0xb0')](_0x1d7360);return{'count':_0x2e9e01['length'],'rows':_0x2e9e01};})['then'](respondWithResult(_0x14998e,null))[_0x02ea('0x43')](function(_0x3a554f){console['log']('ServiceNow\x20error:\x20'+_0x3a554f);var _0x148e96=_0xcc7dc4[_0x02ea('0x32')][_0x02ea('0xb1')]?0x1f4:_0x3a554f[_0x02ea('0xb2')]||0x1f4;logger[_0x02ea('0x29')](_0x3a554f[_0x02ea('0xb3')]);delete _0x3a554f[_0x02ea('0x2a')];if(_0x148e96===0x191){_0x148e96=0x190;}_0x14998e[_0x02ea('0x1c')](_0x148e96)[_0x02ea('0x2b')](_0xcc7dc4[_0x02ea('0x32')]['test']?{'message':_0x02ea('0xb4'),'statusCode':_0x3a554f['statusCode']}:_0x3a554f);});};function createFieldObject(_0x127db4,_0x3ba7f3,_0x450b56,_0x4ee9c9,_0x1b90c3,_0x190450){return new Promise(function(_0x2eda70,_0x56b872){var _0x431b9f={'id':_0x4ee9c9,'name':_0x1b90c3,'custom':_0x190450};if(_0x450b56===_0x02ea('0xb5')){_0x431b9f[_0x02ea('0x3f')]=[{'name':'True','value':_0x02ea('0xb6')},{'name':_0x02ea('0xb7'),'value':'false'}];_0x2eda70(_0x431b9f);}else{var _0x5b4594={'method':_0x02ea('0xa2'),'uri':_0x127db4+'sys_choice?sysparm_query=name=incident^element='+_0x4ee9c9,'auth':_0x3ba7f3,'json':!![]};return rp(_0x5b4594)[_0x02ea('0x28')](function(_0x11c2d9){var _0x217fc1=[];if(_0x11c2d9[_0x02ea('0xa4')][_0x02ea('0x38')]>0x0){_0x11c2d9[_0x02ea('0xa4')][_0x02ea('0xb8')](function(_0x2971a9){if(_0x2971a9[_0x02ea('0xb9')]===_0x02ea('0xba')){var _0x410096={'name':_0x2971a9[_0x02ea('0xaf')],'value':_0x2971a9[_0x02ea('0xbb')]};_0x217fc1[_0x02ea('0xa9')](_0x410096);}});}_0x431b9f[_0x02ea('0x3f')]=_0x217fc1;if(_0x431b9f[_0x02ea('0x3f')]['length']>0x0){_0x2eda70(_0x431b9f);}else{if(_0x190450==![]){_0x2eda70();}else{_0x2eda70(_0x431b9f);}}});}});}
\ No newline at end of file
index 0d81221..e4a2dda 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','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','util'];(function(_0x42b64c,_0xc7abd8){var _0x58e7e6=function(_0x48b324){while(--_0x48b324){_0x42b64c['push'](_0x42b64c['shift']());}};_0x58e7e6(++_0xc7abd8);}(_0x814b,0x1a2));var _0xb814=function(_0x27638d,_0x4094db){_0x27638d=_0x27638d-0x0;var _0x35da35=_0x814b[_0x27638d];return _0x35da35;};'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'));var integrations=require(_0xb814('0xa'));module[_0xb814('0xb')]=function(_0x53e507,_0x3b0829){return _0x53e507[_0xb814('0xc')]('ServicenowAccount',attributes,{'tableName':_0xb814('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7da7=['../../config/environment','../../components/integrations/configuration','exports','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','bluebird','request-promise','rimraf'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x7da7,0x10d));var _0x77da=function(_0x46cf00,_0x457a43){_0x46cf00=_0x46cf00-0x0;var _0x3974dc=_0x7da7[_0x46cf00];return _0x3974dc;};'use strict';var _=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var logger=require(_0x77da('0x2'))('api');var moment=require('moment');var BPromise=require(_0x77da('0x3'));var rp=require(_0x77da('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x77da('0x5'));var config=require(_0x77da('0x6'));var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0x77da('0x7'));module[_0x77da('0x8')]=function(_0x47da81,_0x30afe0){return _0x47da81['define'](_0x77da('0x9'),attributes,{'tableName':_0x77da('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6df88a0..4654729 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb763=['request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ServicenowAccount','findAll','options','where','include','map','model','attributes','GetServicenowAccount','stringify','find','ShowServicenowAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xb763,0x117));var _0x3b76=function(_0x2217e1,_0x2c94c4){_0x2217e1=_0x2217e1-0x0;var _0x6582f5=_0xb763[_0x2217e1];return _0x6582f5;};'use strict';var _=require(_0x3b76('0x0'));var util=require(_0x3b76('0x1'));var moment=require(_0x3b76('0x2'));var BPromise=require(_0x3b76('0x3'));var rs=require(_0x3b76('0x4'));var fs=require('fs');var Redis=require(_0x3b76('0x5'));var db=require(_0x3b76('0x6'))['db'];var utils=require(_0x3b76('0x7'));var logger=require(_0x3b76('0x8'))(_0x3b76('0x9'));var config=require(_0x3b76('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x3b76('0xb')][_0x3b76('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x192809,_0x229e11,_0x35aaed){return new BPromise(function(_0x458c9c,_0xff2965){return client[_0x3b76('0xd')](_0x192809,_0x35aaed)[_0x3b76('0xe')](function(_0x53e65c){logger[_0x3b76('0xf')](_0x3b76('0x10'),_0x229e11,_0x3b76('0x11'));logger[_0x3b76('0x12')](_0x3b76('0x13'),_0x229e11,'request\x20sent',JSON['stringify'](_0x53e65c));if(_0x53e65c[_0x3b76('0x14')]){if(_0x53e65c[_0x3b76('0x14')][_0x3b76('0x15')]===0x1f4){logger[_0x3b76('0x14')](_0x3b76('0x10'),_0x229e11,_0x53e65c[_0x3b76('0x14')][_0x3b76('0x16')]);return _0xff2965(_0x53e65c[_0x3b76('0x14')][_0x3b76('0x16')]);}logger['error'](_0x3b76('0x10'),_0x229e11,_0x53e65c[_0x3b76('0x14')][_0x3b76('0x16')]);return _0x458c9c(_0x53e65c[_0x3b76('0x14')][_0x3b76('0x16')]);}else{logger[_0x3b76('0xf')](_0x3b76('0x10'),_0x229e11,_0x3b76('0x11'));_0x458c9c(_0x53e65c[_0x3b76('0x17')]['message']);}})[_0x3b76('0x18')](function(_0x18a7e7){logger[_0x3b76('0x14')](_0x3b76('0x10'),_0x229e11,_0x18a7e7);_0xff2965(_0x18a7e7);});});}exports['GetServicenowAccount']=function(_0x14c1e5){var _0x2e6460=this;return new Promise(function(_0x2c7c66,_0x1fa8e0){return db[_0x3b76('0x19')][_0x3b76('0x1a')]({'raw':_0x14c1e5[_0x3b76('0x1b')]?_0x14c1e5[_0x3b76('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x14c1e5['options']?_0x14c1e5[_0x3b76('0x1b')][_0x3b76('0x1c')]||null:null,'attributes':_0x14c1e5[_0x3b76('0x1b')]?_0x14c1e5['options']['attributes']||null:null,'limit':_0x14c1e5[_0x3b76('0x1b')]?_0x14c1e5[_0x3b76('0x1b')]['limit']||null:null,'include':_0x14c1e5[_0x3b76('0x1b')]?_0x14c1e5[_0x3b76('0x1b')][_0x3b76('0x1d')]?_[_0x3b76('0x1e')](_0x14c1e5['options'][_0x3b76('0x1d')],function(_0x2f02b3){return{'model':db[_0x2f02b3[_0x3b76('0x1f')]],'as':_0x2f02b3['as'],'attributes':_0x2f02b3['attributes'],'include':_0x2f02b3[_0x3b76('0x1d')]?_[_0x3b76('0x1e')](_0x2f02b3[_0x3b76('0x1d')],function(_0xdfe146){return{'model':db[_0xdfe146[_0x3b76('0x1f')]],'as':_0xdfe146['as'],'attributes':_0xdfe146[_0x3b76('0x20')],'include':_0xdfe146[_0x3b76('0x1d')]?_[_0x3b76('0x1e')](_0xdfe146['include'],function(_0x259978){return{'model':db[_0x259978[_0x3b76('0x1f')]],'as':_0x259978['as'],'attributes':_0x259978[_0x3b76('0x20')]};}):[]};}):[]};}):[]:[]})[_0x3b76('0xe')](function(_0x1ce2f0){logger[_0x3b76('0xf')]('GetServicenowAccount',_0x14c1e5);logger[_0x3b76('0x12')](_0x3b76('0x21'),_0x14c1e5,JSON[_0x3b76('0x22')](_0x1ce2f0));_0x2c7c66(_0x1ce2f0);})[_0x3b76('0x18')](function(_0x1d8805){logger['error'](_0x3b76('0x21'),_0x1d8805['message'],_0x14c1e5);_0x1fa8e0(_0x2e6460[_0x3b76('0x14')](0x1f4,_0x1d8805[_0x3b76('0x16')]));});});};exports['ShowServicenowAccount']=function(_0x392964){var _0x593fd8=this;return new Promise(function(_0x440e85,_0xede63d){return db[_0x3b76('0x19')][_0x3b76('0x23')]({'raw':_0x392964[_0x3b76('0x1b')]?_0x392964[_0x3b76('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x392964[_0x3b76('0x1b')]?_0x392964['options'][_0x3b76('0x1c')]||null:null,'attributes':_0x392964[_0x3b76('0x1b')]?_0x392964['options'][_0x3b76('0x20')]||null:null,'include':_0x392964[_0x3b76('0x1b')]?_0x392964[_0x3b76('0x1b')][_0x3b76('0x1d')]?_[_0x3b76('0x1e')](_0x392964[_0x3b76('0x1b')][_0x3b76('0x1d')],function(_0x45d270){return{'model':db[_0x45d270['model']],'as':_0x45d270['as'],'attributes':_0x45d270['attributes'],'include':_0x45d270[_0x3b76('0x1d')]?_[_0x3b76('0x1e')](_0x45d270[_0x3b76('0x1d')],function(_0x10398e){return{'model':db[_0x10398e['model']],'as':_0x10398e['as'],'attributes':_0x10398e[_0x3b76('0x20')],'include':_0x10398e[_0x3b76('0x1d')]?_[_0x3b76('0x1e')](_0x10398e['include'],function(_0x5a95e7){return{'model':db[_0x5a95e7['model']],'as':_0x5a95e7['as'],'attributes':_0x5a95e7[_0x3b76('0x20')]};}):[]};}):[]};}):[]:[]})[_0x3b76('0xe')](function(_0x249ed4){logger['info']('ShowServicenowAccount',_0x392964);logger['debug'](_0x3b76('0x24'),_0x392964,JSON[_0x3b76('0x22')](_0x249ed4));_0x440e85(_0x249ed4);})[_0x3b76('0x18')](function(_0x9f3a75){logger[_0x3b76('0x14')](_0x3b76('0x24'),_0x9f3a75[_0x3b76('0x16')],_0x392964);_0xede63d(_0x593fd8[_0x3b76('0x14')](0x1f4,_0x9f3a75['message']));});});};
\ No newline at end of file
+var _0x82ca=['request','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetServicenowAccount','findAll','options','raw','attributes','limit','include','map','model','ServicenowAccount','find','where','ShowServicenowAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x237415,_0x2e412a){var _0x1bcd83=function(_0x107c04){while(--_0x107c04){_0x237415['push'](_0x237415['shift']());}};_0x1bcd83(++_0x2e412a);}(_0x82ca,0xb6));var _0xa82c=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x82ca[_0x13ea00];return _0x1f7347;};'use strict';var _=require(_0xa82c('0x0'));var util=require(_0xa82c('0x1'));var moment=require('moment');var BPromise=require(_0xa82c('0x2'));var rs=require(_0xa82c('0x3'));var fs=require('fs');var Redis=require(_0xa82c('0x4'));var db=require(_0xa82c('0x5'))['db'];var utils=require(_0xa82c('0x6'));var logger=require(_0xa82c('0x7'))(_0xa82c('0x8'));var config=require(_0xa82c('0x9'));var jayson=require(_0xa82c('0xa'));var client=jayson[_0xa82c('0xb')][_0xa82c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x662c6a,_0x5a330f,_0x3d5c9a){return new BPromise(function(_0x288ca3,_0x5391c4){return client[_0xa82c('0xd')](_0x662c6a,_0x3d5c9a)[_0xa82c('0xe')](function(_0x181f0a){logger['info'](_0xa82c('0xf'),_0x5a330f,_0xa82c('0x10'));logger[_0xa82c('0x11')](_0xa82c('0x12'),_0x5a330f,_0xa82c('0x10'),JSON[_0xa82c('0x13')](_0x181f0a));if(_0x181f0a[_0xa82c('0x14')]){if(_0x181f0a[_0xa82c('0x14')][_0xa82c('0x15')]===0x1f4){logger[_0xa82c('0x14')]('ServicenowAccount,\x20%s,\x20%s',_0x5a330f,_0x181f0a[_0xa82c('0x14')][_0xa82c('0x16')]);return _0x5391c4(_0x181f0a[_0xa82c('0x14')][_0xa82c('0x16')]);}logger[_0xa82c('0x14')](_0xa82c('0xf'),_0x5a330f,_0x181f0a[_0xa82c('0x14')][_0xa82c('0x16')]);return _0x288ca3(_0x181f0a['error']['message']);}else{logger[_0xa82c('0x17')]('ServicenowAccount,\x20%s,\x20%s',_0x5a330f,_0xa82c('0x10'));_0x288ca3(_0x181f0a[_0xa82c('0x18')][_0xa82c('0x16')]);}})[_0xa82c('0x19')](function(_0x530902){logger[_0xa82c('0x14')]('ServicenowAccount,\x20%s,\x20%s',_0x5a330f,_0x530902);_0x5391c4(_0x530902);});});}exports[_0xa82c('0x1a')]=function(_0x39dc97){var _0x1d76ea=this;return new Promise(function(_0x3f3b0d,_0x2cf9d0){return db['ServicenowAccount'][_0xa82c('0x1b')]({'raw':_0x39dc97['options']?_0x39dc97[_0xa82c('0x1c')][_0xa82c('0x1d')]===undefined?!![]:![]:!![],'where':_0x39dc97[_0xa82c('0x1c')]?_0x39dc97[_0xa82c('0x1c')]['where']||null:null,'attributes':_0x39dc97[_0xa82c('0x1c')]?_0x39dc97[_0xa82c('0x1c')][_0xa82c('0x1e')]||null:null,'limit':_0x39dc97[_0xa82c('0x1c')]?_0x39dc97[_0xa82c('0x1c')][_0xa82c('0x1f')]||null:null,'include':_0x39dc97['options']?_0x39dc97[_0xa82c('0x1c')][_0xa82c('0x20')]?_[_0xa82c('0x21')](_0x39dc97[_0xa82c('0x1c')]['include'],function(_0x95311){return{'model':db[_0x95311[_0xa82c('0x22')]],'as':_0x95311['as'],'attributes':_0x95311[_0xa82c('0x1e')],'include':_0x95311[_0xa82c('0x20')]?_[_0xa82c('0x21')](_0x95311[_0xa82c('0x20')],function(_0x1d5127){return{'model':db[_0x1d5127[_0xa82c('0x22')]],'as':_0x1d5127['as'],'attributes':_0x1d5127[_0xa82c('0x1e')],'include':_0x1d5127['include']?_[_0xa82c('0x21')](_0x1d5127[_0xa82c('0x20')],function(_0x5d0f1f){return{'model':db[_0x5d0f1f[_0xa82c('0x22')]],'as':_0x5d0f1f['as'],'attributes':_0x5d0f1f[_0xa82c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa82c('0xe')](function(_0x1a0b61){logger[_0xa82c('0x17')](_0xa82c('0x1a'),_0x39dc97);logger[_0xa82c('0x11')](_0xa82c('0x1a'),_0x39dc97,JSON[_0xa82c('0x13')](_0x1a0b61));_0x3f3b0d(_0x1a0b61);})[_0xa82c('0x19')](function(_0xe5315){logger[_0xa82c('0x14')]('GetServicenowAccount',_0xe5315[_0xa82c('0x16')],_0x39dc97);_0x2cf9d0(_0x1d76ea[_0xa82c('0x14')](0x1f4,_0xe5315[_0xa82c('0x16')]));});});};exports['ShowServicenowAccount']=function(_0x55fe41){var _0x205705=this;return new Promise(function(_0x58cab9,_0x4827ac){return db[_0xa82c('0x23')][_0xa82c('0x24')]({'raw':_0x55fe41[_0xa82c('0x1c')]?_0x55fe41[_0xa82c('0x1c')][_0xa82c('0x1d')]===undefined?!![]:![]:!![],'where':_0x55fe41['options']?_0x55fe41['options'][_0xa82c('0x25')]||null:null,'attributes':_0x55fe41[_0xa82c('0x1c')]?_0x55fe41['options'][_0xa82c('0x1e')]||null:null,'include':_0x55fe41[_0xa82c('0x1c')]?_0x55fe41['options'][_0xa82c('0x20')]?_['map'](_0x55fe41[_0xa82c('0x1c')][_0xa82c('0x20')],function(_0x38b976){return{'model':db[_0x38b976[_0xa82c('0x22')]],'as':_0x38b976['as'],'attributes':_0x38b976[_0xa82c('0x1e')],'include':_0x38b976[_0xa82c('0x20')]?_[_0xa82c('0x21')](_0x38b976[_0xa82c('0x20')],function(_0x72de88){return{'model':db[_0x72de88[_0xa82c('0x22')]],'as':_0x72de88['as'],'attributes':_0x72de88[_0xa82c('0x1e')],'include':_0x72de88['include']?_[_0xa82c('0x21')](_0x72de88[_0xa82c('0x20')],function(_0x4ad8c4){return{'model':db[_0x4ad8c4[_0xa82c('0x22')]],'as':_0x4ad8c4['as'],'attributes':_0x4ad8c4[_0xa82c('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5d9953){logger[_0xa82c('0x17')](_0xa82c('0x26'),_0x55fe41);logger['debug']('ShowServicenowAccount',_0x55fe41,JSON[_0xa82c('0x13')](_0x5d9953));_0x58cab9(_0x5d9953);})[_0xa82c('0x19')](function(_0x39da30){logger[_0xa82c('0x14')](_0xa82c('0x26'),_0x39da30[_0xa82c('0x16')],_0x55fe41);_0x4827ac(_0x205705['error'](0x1f4,_0x39da30['message']));});});};
\ No newline at end of file
index 733aa6d..9f24c93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bdb=['isAuthenticated','index','get','/:id','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller'];(function(_0x3ad3a6,_0x48b06b){var _0x563f64=function(_0x5c7333){while(--_0x5c7333){_0x3ad3a6['push'](_0x3ad3a6['shift']());}};_0x563f64(++_0x48b06b);}(_0x6bdb,0x10b));var _0xb6bd=function(_0x292760,_0x421487){_0x292760=_0x292760-0x0;var _0x45e771=_0x6bdb[_0x292760];return _0x45e771;};'use strict';var multer=require(_0xb6bd('0x0'));var util=require(_0xb6bd('0x1'));var path=require(_0xb6bd('0x2'));var timeout=require(_0xb6bd('0x3'));var express=require('express');var router=express[_0xb6bd('0x4')]();var fs_extra=require(_0xb6bd('0x5'));var auth=require(_0xb6bd('0x6'));var interaction=require(_0xb6bd('0x7'));var config=require('../../config/environment');var controller=require(_0xb6bd('0x8'));router['get']('/',auth[_0xb6bd('0x9')](),controller[_0xb6bd('0xa')]);router[_0xb6bd('0xb')](_0xb6bd('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xb6bd('0xb')]('/:id/fields',auth['isAuthenticated'](),controller[_0xb6bd('0xd')]);router['get'](_0xb6bd('0xe'),auth[_0xb6bd('0x9')](),controller[_0xb6bd('0xf')]);router[_0xb6bd('0xb')]('/:id/descriptions',auth[_0xb6bd('0x9')](),controller[_0xb6bd('0x10')]);router[_0xb6bd('0x11')]('/',auth[_0xb6bd('0x9')](),controller[_0xb6bd('0x12')]);router[_0xb6bd('0x13')](_0xb6bd('0xc'),auth[_0xb6bd('0x9')](),controller[_0xb6bd('0x14')]);router[_0xb6bd('0x15')](_0xb6bd('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xb6bd('0x16')]=router;
\ No newline at end of file
+var _0x00a2=['delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','isAuthenticated','index','/:id','show','get','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update'];(function(_0x5b3e86,_0x1bdd3a){var _0x5170f6=function(_0xff5c99){while(--_0xff5c99){_0x5b3e86['push'](_0x5b3e86['shift']());}};_0x5170f6(++_0x1bdd3a);}(_0x00a2,0x93));var _0x200a=function(_0x13399f,_0x4bff28){_0x13399f=_0x13399f-0x0;var _0x48f2bb=_0x00a2[_0x13399f];return _0x48f2bb;};'use strict';var multer=require('multer');var util=require(_0x200a('0x0'));var path=require('path');var timeout=require(_0x200a('0x1'));var express=require('express');var router=express[_0x200a('0x2')]();var fs_extra=require(_0x200a('0x3'));var auth=require(_0x200a('0x4'));var interaction=require(_0x200a('0x5'));var config=require(_0x200a('0x6'));var controller=require(_0x200a('0x7'));router['get']('/',auth[_0x200a('0x8')](),controller[_0x200a('0x9')]);router['get'](_0x200a('0xa'),auth['isAuthenticated'](),controller[_0x200a('0xb')]);router[_0x200a('0xc')](_0x200a('0xd'),auth[_0x200a('0x8')](),controller['getFields']);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0x200a('0xe')]);router['get'](_0x200a('0xf'),auth[_0x200a('0x8')](),controller[_0x200a('0x10')]);router[_0x200a('0x11')]('/',auth[_0x200a('0x8')](),controller[_0x200a('0x12')]);router[_0x200a('0x13')](_0x200a('0xa'),auth[_0x200a('0x8')](),controller[_0x200a('0x14')]);router[_0x200a('0x15')](_0x200a('0xa'),auth['isAuthenticated'](),controller[_0x200a('0x16')]);module[_0x200a('0x17')]=router;
\ No newline at end of file
index b28d66b..b4d92d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16f4=['sequelize','exports','STRING'];(function(_0x41cfc0,_0x14d172){var _0x5e304b=function(_0x4ae576){while(--_0x4ae576){_0x41cfc0['push'](_0x41cfc0['shift']());}};_0x5e304b(++_0x14d172);}(_0x16f4,0x171));var _0x416f=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x16f4[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0x416f('0x0'));module[_0x416f('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x416f('0x2')]}};
\ No newline at end of file
+var _0x783e=['sequelize','exports','STRING'];(function(_0xdd2bfa,_0x5bd304){var _0x55397e=function(_0x196f7d){while(--_0x196f7d){_0xdd2bfa['push'](_0xdd2bfa['shift']());}};_0x55397e(++_0x5bd304);}(_0x783e,0xd2));var _0xe783=function(_0x4220e1,_0x1c1b79){_0x4220e1=_0x4220e1-0x0;var _0x242f06=_0x783e[_0x4220e1];return _0x242f06;};'use strict';var Sequelize=require(_0xe783('0x0'));module[_0xe783('0x1')]={'name':{'type':Sequelize[_0xe783('0x2')]},'description':{'type':Sequelize[_0xe783('0x2')]}};
\ No newline at end of file
index 1577a08..f46b5f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc798=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','offset','set','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','type','merge','ServicenowConfiguration','count','includeAll','include','findAll','catch','show','keys','create','body','find','params','getFields','findOne','ServicenowField','filter','options','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x5b04a3,_0xfda4fd){var _0x1adf11=function(_0x9e242a){while(--_0x9e242a){_0x5b04a3['push'](_0x5b04a3['shift']());}};_0x1adf11(++_0xfda4fd);}(_0xc798,0x13a));var _0x8c79=function(_0x292100,_0x5eb58c){_0x292100=_0x292100-0x0;var _0x253f54=_0xc798[_0x292100];return _0x253f54;};'use strict';var emlformat=require(_0x8c79('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8c79('0x1'));var jsonpatch=require(_0x8c79('0x2'));var rp=require(_0x8c79('0x3'));var moment=require(_0x8c79('0x4'));var BPromise=require(_0x8c79('0x5'));var Mustache=require(_0x8c79('0x6'));var util=require('util');var path=require('path');var sox=require(_0x8c79('0x7'));var csv=require(_0x8c79('0x8'));var ejs=require(_0x8c79('0x9'));var fs=require('fs');var fs_extra=require(_0x8c79('0xa'));var _=require(_0x8c79('0xb'));var squel=require(_0x8c79('0xc'));var crypto=require(_0x8c79('0xd'));var jsforce=require(_0x8c79('0xe'));var deskjs=require(_0x8c79('0xf'));var toCsv=require(_0x8c79('0x8'));var querystring=require(_0x8c79('0x10'));var Papa=require(_0x8c79('0x11'));var Redis=require(_0x8c79('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8c79('0x13'));var as=require(_0x8c79('0x14'));var hardwareService=require(_0x8c79('0x15'));var logger=require(_0x8c79('0x16'))('api');var utils=require(_0x8c79('0x17'));var config=require(_0x8c79('0x18'));var licenseUtil=require(_0x8c79('0x19'));var db=require(_0x8c79('0x1a'))['db'];function respondWithStatusCode(_0x48d663,_0x1162e4){_0x1162e4=_0x1162e4||0xcc;return function(_0x5b2468){if(_0x5b2468){return _0x48d663['sendStatus'](_0x1162e4);}return _0x48d663[_0x8c79('0x1b')](_0x1162e4)[_0x8c79('0x1c')]();};}function respondWithResult(_0x4c90f2,_0x12668a){_0x12668a=_0x12668a||0xc8;return function(_0x4d2265){if(_0x4d2265){return _0x4c90f2[_0x8c79('0x1b')](_0x12668a)[_0x8c79('0x1d')](_0x4d2265);}};}function respondWithFilteredResult(_0x2a0280,_0x1d38b7){return function(_0x9ce0b1){if(_0x9ce0b1){var _0x1923bd=typeof _0x1d38b7['offset']==='undefined'&&typeof _0x1d38b7[_0x8c79('0x1e')]===_0x8c79('0x1f');var _0xbcd11f=_0x9ce0b1['count'];var _0x209055=_0x1923bd?0x0:_0x1d38b7['offset'];var _0x443b1d=_0x1923bd?_0x9ce0b1['count']:_0x1d38b7[_0x8c79('0x20')]+_0x1d38b7['limit'];var _0x112c5d;if(_0x443b1d>=_0xbcd11f){_0x443b1d=_0xbcd11f;_0x112c5d=0xc8;}else{_0x112c5d=0xce;}_0x2a0280['status'](_0x112c5d);return _0x2a0280[_0x8c79('0x21')]('Content-Range',_0x209055+'-'+_0x443b1d+'/'+_0xbcd11f)[_0x8c79('0x1d')](_0x9ce0b1);}return null;};}function patchUpdates(_0x3e5044){return function(_0x902407){try{jsonpatch[_0x8c79('0x22')](_0x902407,_0x3e5044,!![]);}catch(_0x411b9a){return BPromise[_0x8c79('0x23')](_0x411b9a);}return _0x902407['save']();};}function saveUpdates(_0x36d4bd,_0x290dcd){return function(_0x551a21){if(_0x551a21){return _0x551a21[_0x8c79('0x24')](_0x36d4bd)[_0x8c79('0x25')](function(_0x2565d5){return _0x2565d5;});}return null;};}function removeEntity(_0x132ae0,_0x5840f5){return function(_0x4393e2){if(_0x4393e2){return _0x4393e2[_0x8c79('0x26')]()[_0x8c79('0x25')](function(){_0x132ae0[_0x8c79('0x1b')](0xcc)[_0x8c79('0x1c')]();});}};}function handleEntityNotFound(_0x490e0a,_0x23baf3){return function(_0x1f6f14){if(!_0x1f6f14){_0x490e0a[_0x8c79('0x27')](0x194);}return _0x1f6f14;};}function handleError(_0x184ad9,_0x3d2d49){_0x3d2d49=_0x3d2d49||0x1f4;return function(_0x5d5686){logger[_0x8c79('0x28')](_0x5d5686[_0x8c79('0x29')]);if(_0x5d5686[_0x8c79('0x2a')]){delete _0x5d5686[_0x8c79('0x2a')];}_0x184ad9[_0x8c79('0x1b')](_0x3d2d49)[_0x8c79('0x2b')](_0x5d5686);};}exports['index']=function(_0x1c15a9,_0x344966){var _0xe9b75b={},_0x3913f2={},_0xc39062={'count':0x0,'rows':[]};var _0x8fc9ee=_[_0x8c79('0x2c')](db['ServicenowConfiguration'][_0x8c79('0x2d')],function(_0x2ff2d5){return{'name':_0x2ff2d5[_0x8c79('0x2e')],'type':_0x2ff2d5['type'][_0x8c79('0x2f')]};});_0x3913f2[_0x8c79('0x30')]=_[_0x8c79('0x2c')](_0x8fc9ee,_0x8c79('0x2a'));_0x3913f2[_0x8c79('0x31')]=_['keys'](_0x1c15a9[_0x8c79('0x31')]);_0x3913f2[_0x8c79('0x32')]=_[_0x8c79('0x33')](_0x3913f2[_0x8c79('0x30')],_0x3913f2['query']);_0xe9b75b[_0x8c79('0x34')]=_[_0x8c79('0x33')](_0x3913f2['model'],qs[_0x8c79('0x35')](_0x1c15a9[_0x8c79('0x31')][_0x8c79('0x35')]));_0xe9b75b[_0x8c79('0x34')]=_0xe9b75b[_0x8c79('0x34')][_0x8c79('0x36')]?_0xe9b75b[_0x8c79('0x34')]:_0x3913f2[_0x8c79('0x30')];if(!_0x1c15a9[_0x8c79('0x31')][_0x8c79('0x37')](_0x8c79('0x38'))){_0xe9b75b[_0x8c79('0x1e')]=qs[_0x8c79('0x1e')](_0x1c15a9[_0x8c79('0x31')]['limit']);_0xe9b75b[_0x8c79('0x20')]=qs[_0x8c79('0x20')](_0x1c15a9[_0x8c79('0x31')]['offset']);}_0xe9b75b[_0x8c79('0x39')]=qs[_0x8c79('0x3a')](_0x1c15a9[_0x8c79('0x31')][_0x8c79('0x3a')]);_0xe9b75b['where']=qs['filters'](_[_0x8c79('0x3b')](_0x1c15a9[_0x8c79('0x31')],_0x3913f2[_0x8c79('0x32')]),_0x8fc9ee);if(_0x1c15a9['query']['filter']){_0xe9b75b[_0x8c79('0x3c')]=_['merge'](_0xe9b75b[_0x8c79('0x3c')],{'$or':_[_0x8c79('0x2c')](_0x8fc9ee,function(_0xcc22c9){if(_0xcc22c9[_0x8c79('0x3d')]!=='VIRTUAL'){var _0x53063c={};_0x53063c[_0xcc22c9[_0x8c79('0x2a')]]={'$like':'%'+_0x1c15a9[_0x8c79('0x31')]['filter']+'%'};return _0x53063c;}})});}_0xe9b75b=_[_0x8c79('0x3e')]({},_0xe9b75b,_0x1c15a9['options']);var _0x5b9263={'where':_0xe9b75b[_0x8c79('0x3c')]};return db[_0x8c79('0x3f')][_0x8c79('0x40')](_0x5b9263)[_0x8c79('0x25')](function(_0x301c4b){_0xc39062[_0x8c79('0x40')]=_0x301c4b;if(_0x1c15a9[_0x8c79('0x31')][_0x8c79('0x41')]){_0xe9b75b[_0x8c79('0x42')]=[{'all':!![]}];}return db[_0x8c79('0x3f')][_0x8c79('0x43')](_0xe9b75b);})[_0x8c79('0x25')](function(_0x5f4ae9){_0xc39062['rows']=_0x5f4ae9;return _0xc39062;})[_0x8c79('0x25')](respondWithFilteredResult(_0x344966,_0xe9b75b))[_0x8c79('0x44')](handleError(_0x344966,null));};exports[_0x8c79('0x45')]=function(_0x6f44c5,_0x4c3901){var _0x3aade2={'raw':![],'where':{'id':_0x6f44c5['params']['id']}},_0x31862f={};_0x31862f[_0x8c79('0x30')]=_['keys'](db[_0x8c79('0x3f')]['rawAttributes']);_0x31862f['query']=_[_0x8c79('0x46')](_0x6f44c5['query']);_0x31862f['filters']=_[_0x8c79('0x33')](_0x31862f[_0x8c79('0x30')],_0x31862f[_0x8c79('0x31')]);_0x3aade2[_0x8c79('0x34')]=_[_0x8c79('0x33')](_0x31862f[_0x8c79('0x30')],qs[_0x8c79('0x35')](_0x6f44c5[_0x8c79('0x31')][_0x8c79('0x35')]));_0x3aade2['attributes']=_0x3aade2['attributes'][_0x8c79('0x36')]?_0x3aade2['attributes']:_0x31862f['model'];if(_0x6f44c5[_0x8c79('0x31')][_0x8c79('0x41')]){_0x3aade2[_0x8c79('0x42')]=[{'all':!![]}];}_0x3aade2=_['merge']({},_0x3aade2,_0x6f44c5['options']);return db[_0x8c79('0x3f')]['find'](_0x3aade2)[_0x8c79('0x25')](handleEntityNotFound(_0x4c3901,null))['then'](respondWithResult(_0x4c3901,null))[_0x8c79('0x44')](handleError(_0x4c3901,null));};exports['create']=function(_0x47329a,_0x3dff08){return db[_0x8c79('0x3f')][_0x8c79('0x47')](_0x47329a[_0x8c79('0x48')],{})[_0x8c79('0x25')](respondWithResult(_0x3dff08,0xc9))[_0x8c79('0x44')](handleError(_0x3dff08,null));};exports[_0x8c79('0x24')]=function(_0x155d46,_0x20b673){if(_0x155d46['body']['id']){delete _0x155d46[_0x8c79('0x48')]['id'];}return db[_0x8c79('0x3f')][_0x8c79('0x49')]({'where':{'id':_0x155d46[_0x8c79('0x4a')]['id']}})[_0x8c79('0x25')](handleEntityNotFound(_0x20b673,null))[_0x8c79('0x25')](saveUpdates(_0x155d46[_0x8c79('0x48')],null))[_0x8c79('0x25')](respondWithResult(_0x20b673,null))[_0x8c79('0x44')](handleError(_0x20b673,null));};exports[_0x8c79('0x26')]=function(_0x1b6a06,_0x447658){return db[_0x8c79('0x3f')]['find']({'where':{'id':_0x1b6a06[_0x8c79('0x4a')]['id']}})[_0x8c79('0x25')](handleEntityNotFound(_0x447658,null))[_0x8c79('0x25')](removeEntity(_0x447658,null))[_0x8c79('0x44')](handleError(_0x447658,null));};exports[_0x8c79('0x4b')]=function(_0x42159f,_0x5113c6,_0x290d65){var _0x3e9e03={};var _0x3077bc={};var _0xa4dc9f;var _0x2ee6ae;return db[_0x8c79('0x3f')][_0x8c79('0x4c')]({'where':{'id':_0x42159f['params']['id']}})[_0x8c79('0x25')](handleEntityNotFound(_0x5113c6,null))[_0x8c79('0x25')](function(_0x217e68){if(_0x217e68){_0xa4dc9f=_0x217e68;_0x3077bc[_0x8c79('0x30')]=_[_0x8c79('0x46')](db[_0x8c79('0x4d')][_0x8c79('0x2d')]);_0x3077bc[_0x8c79('0x31')]=_['keys'](_0x42159f[_0x8c79('0x31')]);_0x3077bc[_0x8c79('0x32')]=_[_0x8c79('0x33')](_0x3077bc[_0x8c79('0x30')],_0x3077bc[_0x8c79('0x31')]);_0x3e9e03[_0x8c79('0x34')]=_[_0x8c79('0x33')](_0x3077bc[_0x8c79('0x30')],qs[_0x8c79('0x35')](_0x42159f['query'][_0x8c79('0x35')]));_0x3e9e03['attributes']=_0x3e9e03['attributes'][_0x8c79('0x36')]?_0x3e9e03[_0x8c79('0x34')]:_0x3077bc[_0x8c79('0x30')];_0x3e9e03[_0x8c79('0x39')]=qs[_0x8c79('0x3a')](_0x42159f[_0x8c79('0x31')][_0x8c79('0x3a')]);_0x3e9e03[_0x8c79('0x3c')]=qs[_0x8c79('0x32')](_['pick'](_0x42159f[_0x8c79('0x31')],_0x3077bc[_0x8c79('0x32')]));if(_0x42159f[_0x8c79('0x31')][_0x8c79('0x4e')]){_0x3e9e03['where']=_['merge'](_0x3e9e03[_0x8c79('0x3c')],{'$or':_[_0x8c79('0x2c')](_0x3e9e03[_0x8c79('0x34')],function(_0x10807b){var _0x572861={};_0x572861[_0x10807b]={'$like':'%'+_0x42159f[_0x8c79('0x31')]['filter']+'%'};return _0x572861;})});}_0x3e9e03=_[_0x8c79('0x3e')]({},_0x3e9e03,_0x42159f[_0x8c79('0x4f')]);return _0xa4dc9f[_0x8c79('0x4b')](_0x3e9e03);}})[_0x8c79('0x25')](function(_0x2b0cd6){if(_0x2b0cd6){_0x2ee6ae=_0x2b0cd6['length'];if(!_0x42159f[_0x8c79('0x31')][_0x8c79('0x37')](_0x8c79('0x38'))){_0x3e9e03[_0x8c79('0x1e')]=qs['limit'](_0x42159f[_0x8c79('0x31')]['limit']);_0x3e9e03[_0x8c79('0x20')]=qs[_0x8c79('0x20')](_0x42159f[_0x8c79('0x31')][_0x8c79('0x20')]);}return _0xa4dc9f[_0x8c79('0x4b')](_0x3e9e03);}})[_0x8c79('0x25')](function(_0x191cde){if(_0x191cde){return _0x191cde?{'count':_0x2ee6ae,'rows':_0x191cde}:null;}})[_0x8c79('0x25')](respondWithResult(_0x5113c6,null))[_0x8c79('0x44')](handleError(_0x5113c6,null));};exports[_0x8c79('0x50')]=function(_0x369226,_0x166685,_0x400457){var _0x3bd201={};var _0xf21b0f={};var _0x17dc40;var _0x4d6e40;return db[_0x8c79('0x3f')][_0x8c79('0x4c')]({'where':{'id':_0x369226[_0x8c79('0x4a')]['id']}})[_0x8c79('0x25')](handleEntityNotFound(_0x166685,null))[_0x8c79('0x25')](function(_0x2a2e6f){if(_0x2a2e6f){_0x17dc40=_0x2a2e6f;_0xf21b0f[_0x8c79('0x30')]=_['keys'](db[_0x8c79('0x4d')][_0x8c79('0x2d')]);_0xf21b0f['query']=_[_0x8c79('0x46')](_0x369226['query']);_0xf21b0f['filters']=_[_0x8c79('0x33')](_0xf21b0f[_0x8c79('0x30')],_0xf21b0f[_0x8c79('0x31')]);_0x3bd201[_0x8c79('0x34')]=_['intersection'](_0xf21b0f[_0x8c79('0x30')],qs['fields'](_0x369226[_0x8c79('0x31')][_0x8c79('0x35')]));_0x3bd201['attributes']=_0x3bd201[_0x8c79('0x34')][_0x8c79('0x36')]?_0x3bd201[_0x8c79('0x34')]:_0xf21b0f[_0x8c79('0x30')];_0x3bd201[_0x8c79('0x39')]=qs[_0x8c79('0x3a')](_0x369226['query'][_0x8c79('0x3a')]);_0x3bd201['where']=qs[_0x8c79('0x32')](_[_0x8c79('0x3b')](_0x369226['query'],_0xf21b0f[_0x8c79('0x32')]));if(_0x369226[_0x8c79('0x31')][_0x8c79('0x4e')]){_0x3bd201[_0x8c79('0x3c')]=_['merge'](_0x3bd201[_0x8c79('0x3c')],{'$or':_['map'](_0x3bd201[_0x8c79('0x34')],function(_0x2e7656){var _0x35d5d3={};_0x35d5d3[_0x2e7656]={'$like':'%'+_0x369226[_0x8c79('0x31')][_0x8c79('0x4e')]+'%'};return _0x35d5d3;})});}_0x3bd201=_[_0x8c79('0x3e')]({},_0x3bd201,_0x369226[_0x8c79('0x4f')]);return _0x17dc40[_0x8c79('0x50')](_0x3bd201);}})[_0x8c79('0x25')](function(_0x4c4d9b){if(_0x4c4d9b){_0x4d6e40=_0x4c4d9b[_0x8c79('0x36')];if(!_0x369226[_0x8c79('0x31')]['hasOwnProperty'](_0x8c79('0x38'))){_0x3bd201[_0x8c79('0x1e')]=qs['limit'](_0x369226[_0x8c79('0x31')]['limit']);_0x3bd201[_0x8c79('0x20')]=qs[_0x8c79('0x20')](_0x369226[_0x8c79('0x31')][_0x8c79('0x20')]);}return _0x17dc40[_0x8c79('0x50')](_0x3bd201);}})['then'](function(_0x353a92){if(_0x353a92){return _0x353a92?{'count':_0x4d6e40,'rows':_0x353a92}:null;}})[_0x8c79('0x25')](respondWithResult(_0x166685,null))['catch'](handleError(_0x166685,null));};exports[_0x8c79('0x51')]=function(_0x335cda,_0x2a38fd,_0x445036){var _0x11920e={};var _0xfeb7fc={};var _0x4b6a52;var _0x360ce3;return db[_0x8c79('0x3f')][_0x8c79('0x4c')]({'where':{'id':_0x335cda[_0x8c79('0x4a')]['id']}})[_0x8c79('0x25')](handleEntityNotFound(_0x2a38fd,null))['then'](function(_0x17da19){if(_0x17da19){_0x4b6a52=_0x17da19;_0xfeb7fc['model']=_[_0x8c79('0x46')](db[_0x8c79('0x4d')]['rawAttributes']);_0xfeb7fc[_0x8c79('0x31')]=_[_0x8c79('0x46')](_0x335cda[_0x8c79('0x31')]);_0xfeb7fc[_0x8c79('0x32')]=_[_0x8c79('0x33')](_0xfeb7fc[_0x8c79('0x30')],_0xfeb7fc[_0x8c79('0x31')]);_0x11920e[_0x8c79('0x34')]=_[_0x8c79('0x33')](_0xfeb7fc['model'],qs['fields'](_0x335cda['query']['fields']));_0x11920e[_0x8c79('0x34')]=_0x11920e[_0x8c79('0x34')][_0x8c79('0x36')]?_0x11920e[_0x8c79('0x34')]:_0xfeb7fc[_0x8c79('0x30')];_0x11920e['order']=qs[_0x8c79('0x3a')](_0x335cda[_0x8c79('0x31')][_0x8c79('0x3a')]);_0x11920e[_0x8c79('0x3c')]=qs[_0x8c79('0x32')](_[_0x8c79('0x3b')](_0x335cda[_0x8c79('0x31')],_0xfeb7fc['filters']));if(_0x335cda['query'][_0x8c79('0x4e')]){_0x11920e[_0x8c79('0x3c')]=_[_0x8c79('0x3e')](_0x11920e[_0x8c79('0x3c')],{'$or':_[_0x8c79('0x2c')](_0x11920e['attributes'],function(_0x5759ec){var _0x14687c={};_0x14687c[_0x5759ec]={'$like':'%'+_0x335cda[_0x8c79('0x31')][_0x8c79('0x4e')]+'%'};return _0x14687c;})});}_0x11920e=_[_0x8c79('0x3e')]({},_0x11920e,_0x335cda['options']);return _0x4b6a52[_0x8c79('0x51')](_0x11920e);}})['then'](function(_0x1cdedc){if(_0x1cdedc){_0x360ce3=_0x1cdedc[_0x8c79('0x36')];if(!_0x335cda['query'][_0x8c79('0x37')]('nolimit')){_0x11920e[_0x8c79('0x1e')]=qs[_0x8c79('0x1e')](_0x335cda[_0x8c79('0x31')][_0x8c79('0x1e')]);_0x11920e['offset']=qs[_0x8c79('0x20')](_0x335cda[_0x8c79('0x31')][_0x8c79('0x20')]);}return _0x4b6a52[_0x8c79('0x51')](_0x11920e);}})['then'](function(_0x1720db){if(_0x1720db){return _0x1720db?{'count':_0x360ce3,'rows':_0x1720db}:null;}})['then'](respondWithResult(_0x2a38fd,null))['catch'](handleError(_0x2a38fd,null));};
\ No newline at end of file
+var _0x75ad=['key','name','query','keys','filters','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','options','where','includeAll','include','findAll','rows','catch','params','intersection','length','create','body','find','findOne','ServicenowField','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x75ad,0x74));var _0xd75a=function(_0x5a2da7,_0x398eff){_0x5a2da7=_0x5a2da7-0x0;var _0x3a851d=_0x75ad[_0x5a2da7];return _0x3a851d;};'use strict';var emlformat=require(_0xd75a('0x0'));var rimraf=require(_0xd75a('0x1'));var zipdir=require(_0xd75a('0x2'));var jsonpatch=require(_0xd75a('0x3'));var rp=require(_0xd75a('0x4'));var moment=require(_0xd75a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd75a('0x6'));var util=require(_0xd75a('0x7'));var path=require(_0xd75a('0x8'));var sox=require(_0xd75a('0x9'));var csv=require(_0xd75a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd75a('0xb'));var _=require(_0xd75a('0xc'));var squel=require('squel');var crypto=require(_0xd75a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd75a('0xe'));var toCsv=require(_0xd75a('0xa'));var querystring=require(_0xd75a('0xf'));var Papa=require(_0xd75a('0x10'));var Redis=require(_0xd75a('0x11'));var authService=require(_0xd75a('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd75a('0x13'));var logger=require(_0xd75a('0x14'))(_0xd75a('0x15'));var utils=require(_0xd75a('0x16'));var config=require(_0xd75a('0x17'));var licenseUtil=require(_0xd75a('0x18'));var db=require(_0xd75a('0x19'))['db'];function respondWithStatusCode(_0x1d6a21,_0x4d59b3){_0x4d59b3=_0x4d59b3||0xcc;return function(_0x176ac3){if(_0x176ac3){return _0x1d6a21[_0xd75a('0x1a')](_0x4d59b3);}return _0x1d6a21[_0xd75a('0x1b')](_0x4d59b3)['end']();};}function respondWithResult(_0x1b9a10,_0x4066c5){_0x4066c5=_0x4066c5||0xc8;return function(_0x28c879){if(_0x28c879){return _0x1b9a10[_0xd75a('0x1b')](_0x4066c5)[_0xd75a('0x1c')](_0x28c879);}};}function respondWithFilteredResult(_0x5a23a5,_0xe10254){return function(_0x344e48){if(_0x344e48){var _0x1541bd=typeof _0xe10254['offset']===_0xd75a('0x1d')&&typeof _0xe10254[_0xd75a('0x1e')]==='undefined';var _0x736e11=_0x344e48[_0xd75a('0x1f')];var _0x4b7dac=_0x1541bd?0x0:_0xe10254[_0xd75a('0x20')];var _0x4cd577=_0x1541bd?_0x344e48[_0xd75a('0x1f')]:_0xe10254['offset']+_0xe10254[_0xd75a('0x1e')];var _0x2bb0b4;if(_0x4cd577>=_0x736e11){_0x4cd577=_0x736e11;_0x2bb0b4=0xc8;}else{_0x2bb0b4=0xce;}_0x5a23a5['status'](_0x2bb0b4);return _0x5a23a5[_0xd75a('0x21')](_0xd75a('0x22'),_0x4b7dac+'-'+_0x4cd577+'/'+_0x736e11)[_0xd75a('0x1c')](_0x344e48);}return null;};}function patchUpdates(_0x331445){return function(_0x1e8872){try{jsonpatch[_0xd75a('0x23')](_0x1e8872,_0x331445,!![]);}catch(_0x12d693){return BPromise[_0xd75a('0x24')](_0x12d693);}return _0x1e8872['save']();};}function saveUpdates(_0x17ab11,_0x18f7ed){return function(_0xc46afd){if(_0xc46afd){return _0xc46afd[_0xd75a('0x25')](_0x17ab11)[_0xd75a('0x26')](function(_0x262db1){return _0x262db1;});}return null;};}function removeEntity(_0x25e321,_0x2b654f){return function(_0x364214){if(_0x364214){return _0x364214[_0xd75a('0x27')]()['then'](function(){_0x25e321[_0xd75a('0x1b')](0xcc)[_0xd75a('0x28')]();});}};}function handleEntityNotFound(_0x151f58,_0x4f8ed9){return function(_0x861f0d){if(!_0x861f0d){_0x151f58[_0xd75a('0x1a')](0x194);}return _0x861f0d;};}function handleError(_0x518cd7,_0x41e8d0){_0x41e8d0=_0x41e8d0||0x1f4;return function(_0x56ac20){logger[_0xd75a('0x29')](_0x56ac20[_0xd75a('0x2a')]);if(_0x56ac20['name']){delete _0x56ac20['name'];}_0x518cd7[_0xd75a('0x1b')](_0x41e8d0)[_0xd75a('0x2b')](_0x56ac20);};}exports[_0xd75a('0x2c')]=function(_0x3eccf8,_0x50cc71){var _0x2b1bd3={},_0x536b65={},_0x117187={'count':0x0,'rows':[]};var _0x322c44=_[_0xd75a('0x2d')](db[_0xd75a('0x2e')][_0xd75a('0x2f')],function(_0x15bad1){return{'name':_0x15bad1[_0xd75a('0x30')],'type':_0x15bad1[_0xd75a('0x31')][_0xd75a('0x32')]};});_0x536b65['model']=_[_0xd75a('0x2d')](_0x322c44,_0xd75a('0x33'));_0x536b65[_0xd75a('0x34')]=_[_0xd75a('0x35')](_0x3eccf8[_0xd75a('0x34')]);_0x536b65[_0xd75a('0x36')]=_['intersection'](_0x536b65[_0xd75a('0x37')],_0x536b65[_0xd75a('0x34')]);_0x2b1bd3[_0xd75a('0x38')]=_['intersection'](_0x536b65[_0xd75a('0x37')],qs[_0xd75a('0x39')](_0x3eccf8['query'][_0xd75a('0x39')]));_0x2b1bd3['attributes']=_0x2b1bd3['attributes']['length']?_0x2b1bd3['attributes']:_0x536b65[_0xd75a('0x37')];if(!_0x3eccf8[_0xd75a('0x34')][_0xd75a('0x3a')](_0xd75a('0x3b'))){_0x2b1bd3[_0xd75a('0x1e')]=qs['limit'](_0x3eccf8[_0xd75a('0x34')][_0xd75a('0x1e')]);_0x2b1bd3[_0xd75a('0x20')]=qs['offset'](_0x3eccf8[_0xd75a('0x34')][_0xd75a('0x20')]);}_0x2b1bd3[_0xd75a('0x3c')]=qs[_0xd75a('0x3d')](_0x3eccf8[_0xd75a('0x34')][_0xd75a('0x3d')]);_0x2b1bd3['where']=qs[_0xd75a('0x36')](_[_0xd75a('0x3e')](_0x3eccf8[_0xd75a('0x34')],_0x536b65[_0xd75a('0x36')]),_0x322c44);if(_0x3eccf8[_0xd75a('0x34')][_0xd75a('0x3f')]){_0x2b1bd3['where']=_[_0xd75a('0x40')](_0x2b1bd3['where'],{'$or':_['map'](_0x322c44,function(_0x19be39){if(_0x19be39[_0xd75a('0x31')]!=='VIRTUAL'){var _0x5243ca={};_0x5243ca[_0x19be39['name']]={'$like':'%'+_0x3eccf8[_0xd75a('0x34')][_0xd75a('0x3f')]+'%'};return _0x5243ca;}})});}_0x2b1bd3=_[_0xd75a('0x40')]({},_0x2b1bd3,_0x3eccf8[_0xd75a('0x41')]);var _0xd22895={'where':_0x2b1bd3[_0xd75a('0x42')]};return db[_0xd75a('0x2e')][_0xd75a('0x1f')](_0xd22895)['then'](function(_0x4aa5c3){_0x117187[_0xd75a('0x1f')]=_0x4aa5c3;if(_0x3eccf8[_0xd75a('0x34')][_0xd75a('0x43')]){_0x2b1bd3[_0xd75a('0x44')]=[{'all':!![]}];}return db[_0xd75a('0x2e')][_0xd75a('0x45')](_0x2b1bd3);})['then'](function(_0x100c9b){_0x117187[_0xd75a('0x46')]=_0x100c9b;return _0x117187;})[_0xd75a('0x26')](respondWithFilteredResult(_0x50cc71,_0x2b1bd3))[_0xd75a('0x47')](handleError(_0x50cc71,null));};exports['show']=function(_0x214707,_0x116bcc){var _0x435f47={'raw':![],'where':{'id':_0x214707[_0xd75a('0x48')]['id']}},_0x54c47e={};_0x54c47e[_0xd75a('0x37')]=_[_0xd75a('0x35')](db[_0xd75a('0x2e')][_0xd75a('0x2f')]);_0x54c47e[_0xd75a('0x34')]=_[_0xd75a('0x35')](_0x214707[_0xd75a('0x34')]);_0x54c47e[_0xd75a('0x36')]=_['intersection'](_0x54c47e[_0xd75a('0x37')],_0x54c47e[_0xd75a('0x34')]);_0x435f47[_0xd75a('0x38')]=_[_0xd75a('0x49')](_0x54c47e[_0xd75a('0x37')],qs['fields'](_0x214707[_0xd75a('0x34')][_0xd75a('0x39')]));_0x435f47[_0xd75a('0x38')]=_0x435f47[_0xd75a('0x38')][_0xd75a('0x4a')]?_0x435f47[_0xd75a('0x38')]:_0x54c47e['model'];if(_0x214707[_0xd75a('0x34')][_0xd75a('0x43')]){_0x435f47[_0xd75a('0x44')]=[{'all':!![]}];}_0x435f47=_[_0xd75a('0x40')]({},_0x435f47,_0x214707[_0xd75a('0x41')]);return db[_0xd75a('0x2e')]['find'](_0x435f47)[_0xd75a('0x26')](handleEntityNotFound(_0x116bcc,null))[_0xd75a('0x26')](respondWithResult(_0x116bcc,null))[_0xd75a('0x47')](handleError(_0x116bcc,null));};exports[_0xd75a('0x4b')]=function(_0x226cfd,_0x4dba48){return db[_0xd75a('0x2e')][_0xd75a('0x4b')](_0x226cfd['body'],{})[_0xd75a('0x26')](respondWithResult(_0x4dba48,0xc9))[_0xd75a('0x47')](handleError(_0x4dba48,null));};exports[_0xd75a('0x25')]=function(_0x5c4ed3,_0x46f9c9){if(_0x5c4ed3[_0xd75a('0x4c')]['id']){delete _0x5c4ed3[_0xd75a('0x4c')]['id'];}return db[_0xd75a('0x2e')][_0xd75a('0x4d')]({'where':{'id':_0x5c4ed3[_0xd75a('0x48')]['id']}})[_0xd75a('0x26')](handleEntityNotFound(_0x46f9c9,null))[_0xd75a('0x26')](saveUpdates(_0x5c4ed3[_0xd75a('0x4c')],null))[_0xd75a('0x26')](respondWithResult(_0x46f9c9,null))[_0xd75a('0x47')](handleError(_0x46f9c9,null));};exports['destroy']=function(_0x29701d,_0x329ff6){return db[_0xd75a('0x2e')]['find']({'where':{'id':_0x29701d['params']['id']}})['then'](handleEntityNotFound(_0x329ff6,null))[_0xd75a('0x26')](removeEntity(_0x329ff6,null))['catch'](handleError(_0x329ff6,null));};exports['getFields']=function(_0xf9a2d1,_0xd056bf,_0x3b973f){var _0x4c1069={};var _0x2db391={};var _0x57bc75;var _0x1ad988;return db[_0xd75a('0x2e')][_0xd75a('0x4e')]({'where':{'id':_0xf9a2d1[_0xd75a('0x48')]['id']}})[_0xd75a('0x26')](handleEntityNotFound(_0xd056bf,null))[_0xd75a('0x26')](function(_0x25dfec){if(_0x25dfec){_0x57bc75=_0x25dfec;_0x2db391[_0xd75a('0x37')]=_[_0xd75a('0x35')](db[_0xd75a('0x4f')][_0xd75a('0x2f')]);_0x2db391[_0xd75a('0x34')]=_[_0xd75a('0x35')](_0xf9a2d1[_0xd75a('0x34')]);_0x2db391['filters']=_[_0xd75a('0x49')](_0x2db391['model'],_0x2db391[_0xd75a('0x34')]);_0x4c1069[_0xd75a('0x38')]=_[_0xd75a('0x49')](_0x2db391[_0xd75a('0x37')],qs[_0xd75a('0x39')](_0xf9a2d1[_0xd75a('0x34')][_0xd75a('0x39')]));_0x4c1069['attributes']=_0x4c1069[_0xd75a('0x38')][_0xd75a('0x4a')]?_0x4c1069['attributes']:_0x2db391[_0xd75a('0x37')];_0x4c1069['order']=qs['sort'](_0xf9a2d1[_0xd75a('0x34')]['sort']);_0x4c1069[_0xd75a('0x42')]=qs[_0xd75a('0x36')](_['pick'](_0xf9a2d1[_0xd75a('0x34')],_0x2db391[_0xd75a('0x36')]));if(_0xf9a2d1[_0xd75a('0x34')][_0xd75a('0x3f')]){_0x4c1069[_0xd75a('0x42')]=_[_0xd75a('0x40')](_0x4c1069[_0xd75a('0x42')],{'$or':_['map'](_0x4c1069[_0xd75a('0x38')],function(_0x507b43){var _0x31a6d7={};_0x31a6d7[_0x507b43]={'$like':'%'+_0xf9a2d1[_0xd75a('0x34')]['filter']+'%'};return _0x31a6d7;})});}_0x4c1069=_[_0xd75a('0x40')]({},_0x4c1069,_0xf9a2d1[_0xd75a('0x41')]);return _0x57bc75[_0xd75a('0x50')](_0x4c1069);}})[_0xd75a('0x26')](function(_0x1a096b){if(_0x1a096b){_0x1ad988=_0x1a096b['length'];if(!_0xf9a2d1['query'][_0xd75a('0x3a')](_0xd75a('0x3b'))){_0x4c1069[_0xd75a('0x1e')]=qs[_0xd75a('0x1e')](_0xf9a2d1[_0xd75a('0x34')]['limit']);_0x4c1069[_0xd75a('0x20')]=qs[_0xd75a('0x20')](_0xf9a2d1[_0xd75a('0x34')]['offset']);}return _0x57bc75[_0xd75a('0x50')](_0x4c1069);}})[_0xd75a('0x26')](function(_0xe4dc92){if(_0xe4dc92){return _0xe4dc92?{'count':_0x1ad988,'rows':_0xe4dc92}:null;}})[_0xd75a('0x26')](respondWithResult(_0xd056bf,null))[_0xd75a('0x47')](handleError(_0xd056bf,null));};exports[_0xd75a('0x51')]=function(_0x399aee,_0x7f2d7e,_0x38b32c){var _0x42912c={};var _0x6a2319={};var _0x57075c;var _0x3deaeb;return db[_0xd75a('0x2e')][_0xd75a('0x4e')]({'where':{'id':_0x399aee[_0xd75a('0x48')]['id']}})[_0xd75a('0x26')](handleEntityNotFound(_0x7f2d7e,null))['then'](function(_0x2dfe84){if(_0x2dfe84){_0x57075c=_0x2dfe84;_0x6a2319['model']=_['keys'](db[_0xd75a('0x4f')][_0xd75a('0x2f')]);_0x6a2319[_0xd75a('0x34')]=_[_0xd75a('0x35')](_0x399aee[_0xd75a('0x34')]);_0x6a2319[_0xd75a('0x36')]=_['intersection'](_0x6a2319[_0xd75a('0x37')],_0x6a2319['query']);_0x42912c[_0xd75a('0x38')]=_[_0xd75a('0x49')](_0x6a2319['model'],qs['fields'](_0x399aee['query']['fields']));_0x42912c[_0xd75a('0x38')]=_0x42912c[_0xd75a('0x38')][_0xd75a('0x4a')]?_0x42912c['attributes']:_0x6a2319[_0xd75a('0x37')];_0x42912c[_0xd75a('0x3c')]=qs['sort'](_0x399aee[_0xd75a('0x34')][_0xd75a('0x3d')]);_0x42912c[_0xd75a('0x42')]=qs[_0xd75a('0x36')](_['pick'](_0x399aee[_0xd75a('0x34')],_0x6a2319[_0xd75a('0x36')]));if(_0x399aee[_0xd75a('0x34')][_0xd75a('0x3f')]){_0x42912c[_0xd75a('0x42')]=_[_0xd75a('0x40')](_0x42912c['where'],{'$or':_[_0xd75a('0x2d')](_0x42912c[_0xd75a('0x38')],function(_0x4d5f13){var _0x288df7={};_0x288df7[_0x4d5f13]={'$like':'%'+_0x399aee['query'][_0xd75a('0x3f')]+'%'};return _0x288df7;})});}_0x42912c=_[_0xd75a('0x40')]({},_0x42912c,_0x399aee[_0xd75a('0x41')]);return _0x57075c[_0xd75a('0x51')](_0x42912c);}})[_0xd75a('0x26')](function(_0x2a5b97){if(_0x2a5b97){_0x3deaeb=_0x2a5b97[_0xd75a('0x4a')];if(!_0x399aee[_0xd75a('0x34')][_0xd75a('0x3a')](_0xd75a('0x3b'))){_0x42912c[_0xd75a('0x1e')]=qs[_0xd75a('0x1e')](_0x399aee['query']['limit']);_0x42912c['offset']=qs[_0xd75a('0x20')](_0x399aee[_0xd75a('0x34')]['offset']);}return _0x57075c[_0xd75a('0x51')](_0x42912c);}})[_0xd75a('0x26')](function(_0x10d138){if(_0x10d138){return _0x10d138?{'count':_0x3deaeb,'rows':_0x10d138}:null;}})['then'](respondWithResult(_0x7f2d7e,null))[_0xd75a('0x47')](handleError(_0x7f2d7e,null));};exports[_0xd75a('0x52')]=function(_0x4335ec,_0x4fc958,_0x35e4f6){var _0x484c01={};var _0x40ab61={};var _0x32cec6;var _0x537588;return db[_0xd75a('0x2e')][_0xd75a('0x4e')]({'where':{'id':_0x4335ec[_0xd75a('0x48')]['id']}})[_0xd75a('0x26')](handleEntityNotFound(_0x4fc958,null))[_0xd75a('0x26')](function(_0x5b5b36){if(_0x5b5b36){_0x32cec6=_0x5b5b36;_0x40ab61['model']=_[_0xd75a('0x35')](db[_0xd75a('0x4f')][_0xd75a('0x2f')]);_0x40ab61['query']=_[_0xd75a('0x35')](_0x4335ec[_0xd75a('0x34')]);_0x40ab61[_0xd75a('0x36')]=_[_0xd75a('0x49')](_0x40ab61[_0xd75a('0x37')],_0x40ab61[_0xd75a('0x34')]);_0x484c01['attributes']=_[_0xd75a('0x49')](_0x40ab61[_0xd75a('0x37')],qs[_0xd75a('0x39')](_0x4335ec[_0xd75a('0x34')][_0xd75a('0x39')]));_0x484c01[_0xd75a('0x38')]=_0x484c01[_0xd75a('0x38')][_0xd75a('0x4a')]?_0x484c01[_0xd75a('0x38')]:_0x40ab61[_0xd75a('0x37')];_0x484c01[_0xd75a('0x3c')]=qs[_0xd75a('0x3d')](_0x4335ec[_0xd75a('0x34')][_0xd75a('0x3d')]);_0x484c01['where']=qs['filters'](_[_0xd75a('0x3e')](_0x4335ec[_0xd75a('0x34')],_0x40ab61[_0xd75a('0x36')]));if(_0x4335ec[_0xd75a('0x34')][_0xd75a('0x3f')]){_0x484c01[_0xd75a('0x42')]=_[_0xd75a('0x40')](_0x484c01['where'],{'$or':_['map'](_0x484c01[_0xd75a('0x38')],function(_0x240626){var _0x1cd662={};_0x1cd662[_0x240626]={'$like':'%'+_0x4335ec[_0xd75a('0x34')][_0xd75a('0x3f')]+'%'};return _0x1cd662;})});}_0x484c01=_['merge']({},_0x484c01,_0x4335ec[_0xd75a('0x41')]);return _0x32cec6[_0xd75a('0x52')](_0x484c01);}})[_0xd75a('0x26')](function(_0x442ab9){if(_0x442ab9){_0x537588=_0x442ab9[_0xd75a('0x4a')];if(!_0x4335ec[_0xd75a('0x34')][_0xd75a('0x3a')]('nolimit')){_0x484c01[_0xd75a('0x1e')]=qs['limit'](_0x4335ec[_0xd75a('0x34')][_0xd75a('0x1e')]);_0x484c01[_0xd75a('0x20')]=qs['offset'](_0x4335ec[_0xd75a('0x34')][_0xd75a('0x20')]);}return _0x32cec6[_0xd75a('0x52')](_0x484c01);}})[_0xd75a('0x26')](function(_0x387add){if(_0x387add){return _0x387add?{'count':_0x537588,'rows':_0x387add}:null;}})[_0xd75a('0x26')](respondWithResult(_0x4fc958,null))[_0xd75a('0x47')](handleError(_0x4fc958,null));};
\ No newline at end of file
index 1f0d085..eb1c51f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa249=['lodash','util','api','moment','request-promise','rimraf','define','ServicenowConfiguration','int_servicenow_configurations'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xa249,0x183));var _0x9a24=function(_0x6d8004,_0x8e020f){_0x6d8004=_0x6d8004-0x0;var _0x222c92=_0xa249[_0x6d8004];return _0x222c92;};'use strict';var _=require(_0x9a24('0x0'));var util=require(_0x9a24('0x1'));var logger=require('../../config/logger')(_0x9a24('0x2'));var moment=require(_0x9a24('0x3'));var BPromise=require('bluebird');var rp=require(_0x9a24('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9a24('0x5'));var config=require('../../config/environment');var attributes=require('./intServicenowConfiguration.attributes');module['exports']=function(_0x1b0728,_0x167980){return _0x1b0728[_0x9a24('0x6')](_0x9a24('0x7'),attributes,{'tableName':_0x9a24('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3014=['define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','api','moment','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x3014,0x1d7));var _0x4301=function(_0x144a96,_0x3287d7){_0x144a96=_0x144a96-0x0;var _0x29de9c=_0x3014[_0x144a96];return _0x29de9c;};'use strict';var _=require(_0x4301('0x0'));var util=require(_0x4301('0x1'));var logger=require('../../config/logger')(_0x4301('0x2'));var moment=require(_0x4301('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4301('0x4'));var rimraf=require(_0x4301('0x5'));var config=require(_0x4301('0x6'));var attributes=require(_0x4301('0x7'));module[_0x4301('0x8')]=function(_0x42ced6,_0x42ac4b){return _0x42ced6[_0x4301('0x9')](_0x4301('0xa'),attributes,{'tableName':_0x4301('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1d1d9d7..e88a7b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc754=['util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x1cfd4e,_0x3a5bfa){var _0x2c7ede=function(_0x5e9c67){while(--_0x5e9c67){_0x1cfd4e['push'](_0x1cfd4e['shift']());}};_0x2c7ede(++_0x3a5bfa);}(_0xc754,0x1e2));var _0x4c75=function(_0x3bb5c9,_0x188595){_0x3bb5c9=_0x3bb5c9-0x0;var _0x34a866=_0xc754[_0x3bb5c9];return _0x34a866;};'use strict';var _=require(_0x4c75('0x0'));var util=require(_0x4c75('0x1'));var moment=require(_0x4c75('0x2'));var BPromise=require(_0x4c75('0x3'));var rs=require(_0x4c75('0x4'));var fs=require('fs');var Redis=require(_0x4c75('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4c75('0x6'))(_0x4c75('0x7'));var config=require('../../config/environment');var jayson=require(_0x4c75('0x8'));var client=jayson['client'][_0x4c75('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xb0ed58,_0x4433fd,_0x5c64d5){return new BPromise(function(_0x479f86,_0x73dd97){return client[_0x4c75('0xa')](_0xb0ed58,_0x5c64d5)[_0x4c75('0xb')](function(_0x373a75){logger[_0x4c75('0xc')](_0x4c75('0xd'),_0x4433fd,_0x4c75('0xe'));logger['debug'](_0x4c75('0xf'),_0x4433fd,'request\x20sent',JSON[_0x4c75('0x10')](_0x373a75));if(_0x373a75['error']){if(_0x373a75[_0x4c75('0x11')][_0x4c75('0x12')]===0x1f4){logger[_0x4c75('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x4433fd,_0x373a75[_0x4c75('0x11')][_0x4c75('0x13')]);return _0x73dd97(_0x373a75[_0x4c75('0x11')][_0x4c75('0x13')]);}logger[_0x4c75('0x11')](_0x4c75('0xd'),_0x4433fd,_0x373a75[_0x4c75('0x11')][_0x4c75('0x13')]);return _0x479f86(_0x373a75['error'][_0x4c75('0x13')]);}else{logger['info'](_0x4c75('0xd'),_0x4433fd,_0x4c75('0xe'));_0x479f86(_0x373a75[_0x4c75('0x14')][_0x4c75('0x13')]);}})['catch'](function(_0x2e4f56){logger[_0x4c75('0x11')](_0x4c75('0xd'),_0x4433fd,_0x2e4f56);_0x73dd97(_0x2e4f56);});});}
\ No newline at end of file
+var _0xa7ee=['info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x22ce0f,_0x4fa686){var _0x2e1917=function(_0x761fbe){while(--_0x761fbe){_0x22ce0f['push'](_0x22ce0f['shift']());}};_0x2e1917(++_0x4fa686);}(_0xa7ee,0x167));var _0xea7e=function(_0x915de9,_0xabf9e5){_0x915de9=_0x915de9-0x0;var _0x274129=_0xa7ee[_0x915de9];return _0x274129;};'use strict';var _=require(_0xea7e('0x0'));var util=require(_0xea7e('0x1'));var moment=require(_0xea7e('0x2'));var BPromise=require(_0xea7e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xea7e('0x4'));var db=require(_0xea7e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xea7e('0x6'))(_0xea7e('0x7'));var config=require(_0xea7e('0x8'));var jayson=require(_0xea7e('0x9'));var client=jayson[_0xea7e('0xa')][_0xea7e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3aadbc,_0x694ad7,_0x442e3f){return new BPromise(function(_0x2cf87e,_0x2e92f7){return client['request'](_0x3aadbc,_0x442e3f)[_0xea7e('0xc')](function(_0x3f70cd){logger['info'](_0xea7e('0xd'),_0x694ad7,_0xea7e('0xe'));logger[_0xea7e('0xf')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x694ad7,_0xea7e('0xe'),JSON[_0xea7e('0x10')](_0x3f70cd));if(_0x3f70cd['error']){if(_0x3f70cd[_0xea7e('0x11')]['code']===0x1f4){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x694ad7,_0x3f70cd[_0xea7e('0x11')][_0xea7e('0x12')]);return _0x2e92f7(_0x3f70cd[_0xea7e('0x11')]['message']);}logger[_0xea7e('0x11')](_0xea7e('0xd'),_0x694ad7,_0x3f70cd[_0xea7e('0x11')][_0xea7e('0x12')]);return _0x2cf87e(_0x3f70cd[_0xea7e('0x11')][_0xea7e('0x12')]);}else{logger[_0xea7e('0x13')]('ServicenowConfiguration,\x20%s,\x20%s',_0x694ad7,_0xea7e('0xe'));_0x2cf87e(_0x3f70cd[_0xea7e('0x14')][_0xea7e('0x12')]);}})['catch'](function(_0x109542){logger['error'](_0xea7e('0xd'),_0x694ad7,_0x109542);_0x2e92f7(_0x109542);});});}
\ No newline at end of file
index 3031df5..6acf3e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c23=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','put','exports','multer','util','connect-timeout','express','Router'];(function(_0x2cd9e8,_0x3520ed){var _0x2f712f=function(_0x769f94){while(--_0x769f94){_0x2cd9e8['push'](_0x2cd9e8['shift']());}};_0x2f712f(++_0x3520ed);}(_0x9c23,0xbe));var _0x39c2=function(_0x54cd98,_0x3029e6){_0x54cd98=_0x54cd98-0x0;var _0x4abd09=_0x9c23[_0x54cd98];return _0x4abd09;};'use strict';var multer=require(_0x39c2('0x0'));var util=require(_0x39c2('0x1'));var path=require('path');var timeout=require(_0x39c2('0x2'));var express=require(_0x39c2('0x3'));var router=express[_0x39c2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x39c2('0x5'));var interaction=require(_0x39c2('0x6'));var config=require(_0x39c2('0x7'));var controller=require('./intServicenowField.controller');router[_0x39c2('0x8')]('/',auth[_0x39c2('0x9')](),controller[_0x39c2('0xa')]);router[_0x39c2('0x8')](_0x39c2('0xb'),auth[_0x39c2('0x9')](),controller[_0x39c2('0xc')]);router['post']('/',auth[_0x39c2('0x9')](),controller['create']);router[_0x39c2('0xd')](_0x39c2('0xb'),auth[_0x39c2('0x9')](),controller['update']);router['delete'](_0x39c2('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x39c2('0xe')]=router;
\ No newline at end of file
+var _0x629e=['post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show'];(function(_0x596e64,_0x4289d9){var _0x204187=function(_0x267b0b){while(--_0x267b0b){_0x596e64['push'](_0x596e64['shift']());}};_0x204187(++_0x4289d9);}(_0x629e,0x126));var _0xe629=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x629e[_0x432682];return _0x463d05;};'use strict';var multer=require(_0xe629('0x0'));var util=require(_0xe629('0x1'));var path=require(_0xe629('0x2'));var timeout=require(_0xe629('0x3'));var express=require('express');var router=express[_0xe629('0x4')]();var fs_extra=require(_0xe629('0x5'));var auth=require(_0xe629('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe629('0x7'));var controller=require('./intServicenowField.controller');router[_0xe629('0x8')]('/',auth[_0xe629('0x9')](),controller['index']);router['get'](_0xe629('0xa'),auth[_0xe629('0x9')](),controller[_0xe629('0xb')]);router[_0xe629('0xc')]('/',auth[_0xe629('0x9')](),controller[_0xe629('0xd')]);router['put'](_0xe629('0xa'),auth[_0xe629('0x9')](),controller[_0xe629('0xe')]);router[_0xe629('0xf')](_0xe629('0xa'),auth['isAuthenticated'](),controller[_0xe629('0x10')]);module[_0xe629('0x11')]=router;
\ No newline at end of file
index 313b24a..8db5ea1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x508a=['BOOLEAN','sequelize','exports','ENUM','string','variable','picklist','STRING','customVariable'];(function(_0x24a2cc,_0x455e1f){var _0x1cf0ad=function(_0x3ad71b){while(--_0x3ad71b){_0x24a2cc['push'](_0x24a2cc['shift']());}};_0x1cf0ad(++_0x455e1f);}(_0x508a,0x1c3));var _0xa508=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x508a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xa508('0x0'));module[_0xa508('0x1')]={'type':{'type':Sequelize[_0xa508('0x2')](_0xa508('0x3'),_0xa508('0x4'),'customVariable','keyValue',_0xa508('0x5')),'defaultValue':_0xa508('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xa508('0x6')]},'keyType':{'type':Sequelize[_0xa508('0x2')]('string',_0xa508('0x4'),_0xa508('0x7'))},'keyContent':{'type':Sequelize[_0xa508('0x6')]},'idField':{'type':Sequelize[_0xa508('0x6')]},'nameField':{'type':Sequelize[_0xa508('0x6')]},'customField':{'type':Sequelize[_0xa508('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa508('0x6')]}};
\ No newline at end of file
+var _0xe51d=['string','variable','customVariable','keyValue','STRING','ENUM'];(function(_0x35e0fd,_0x37f669){var _0x2d423a=function(_0x13300a){while(--_0x13300a){_0x35e0fd['push'](_0x35e0fd['shift']());}};_0x2d423a(++_0x37f669);}(_0xe51d,0x8f));var _0xde51=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe51d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xde51('0x0')](_0xde51('0x1'),_0xde51('0x2'),_0xde51('0x3'),_0xde51('0x4'),'picklist'),'defaultValue':_0xde51('0x1')},'content':{'type':Sequelize[_0xde51('0x5')]},'key':{'type':Sequelize[_0xde51('0x5')]},'keyType':{'type':Sequelize[_0xde51('0x0')](_0xde51('0x1'),_0xde51('0x2'),_0xde51('0x3'))},'keyContent':{'type':Sequelize[_0xde51('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xde51('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 1235d91..9d6258b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf890=['ServicenowField','rawAttributes','fieldName','type','model','attributes','intersection','fields','query','length','order','pick','filters','filter','where','merge','VIRTUAL','options','findAll','rows','show','params','keys','includeAll','include','find','create','body','catch','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xf890,0xb0));var _0x0f89=function(_0x4822fd,_0x399594){_0x4822fd=_0x4822fd-0x0;var _0x57e1d4=_0xf890[_0x4822fd];return _0x57e1d4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0f89('0x0'));var zipdir=require(_0x0f89('0x1'));var jsonpatch=require(_0x0f89('0x2'));var rp=require(_0x0f89('0x3'));var moment=require(_0x0f89('0x4'));var BPromise=require(_0x0f89('0x5'));var Mustache=require(_0x0f89('0x6'));var util=require('util');var path=require(_0x0f89('0x7'));var sox=require(_0x0f89('0x8'));var csv=require('to-csv');var ejs=require(_0x0f89('0x9'));var fs=require('fs');var fs_extra=require(_0x0f89('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0f89('0xb'));var jsforce=require(_0x0f89('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0f89('0xd'));var querystring=require(_0x0f89('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0f89('0xf'));var qs=require(_0x0f89('0x10'));var as=require(_0x0f89('0x11'));var hardwareService=require(_0x0f89('0x12'));var logger=require(_0x0f89('0x13'))('api');var utils=require(_0x0f89('0x14'));var config=require(_0x0f89('0x15'));var licenseUtil=require(_0x0f89('0x16'));var db=require(_0x0f89('0x17'))['db'];function respondWithStatusCode(_0x3187f0,_0x4774b9){_0x4774b9=_0x4774b9||0xcc;return function(_0x84de24){if(_0x84de24){return _0x3187f0['sendStatus'](_0x4774b9);}return _0x3187f0['status'](_0x4774b9)[_0x0f89('0x18')]();};}function respondWithResult(_0xb0cf2,_0x3dad02){_0x3dad02=_0x3dad02||0xc8;return function(_0x14b34e){if(_0x14b34e){return _0xb0cf2[_0x0f89('0x19')](_0x3dad02)[_0x0f89('0x1a')](_0x14b34e);}};}function respondWithFilteredResult(_0x28da62,_0x113f36){return function(_0x9edd77){if(_0x9edd77){var _0x537bb2=typeof _0x113f36[_0x0f89('0x1b')]===_0x0f89('0x1c')&&typeof _0x113f36[_0x0f89('0x1d')]==='undefined';var _0x19ea57=_0x9edd77[_0x0f89('0x1e')];var _0x49dc94=_0x537bb2?0x0:_0x113f36[_0x0f89('0x1b')];var _0x2fd30b=_0x537bb2?_0x9edd77[_0x0f89('0x1e')]:_0x113f36['offset']+_0x113f36[_0x0f89('0x1d')];var _0x168dbd;if(_0x2fd30b>=_0x19ea57){_0x2fd30b=_0x19ea57;_0x168dbd=0xc8;}else{_0x168dbd=0xce;}_0x28da62[_0x0f89('0x19')](_0x168dbd);return _0x28da62['set'](_0x0f89('0x1f'),_0x49dc94+'-'+_0x2fd30b+'/'+_0x19ea57)['json'](_0x9edd77);}return null;};}function patchUpdates(_0x42b11b){return function(_0x4b6dc4){try{jsonpatch[_0x0f89('0x20')](_0x4b6dc4,_0x42b11b,!![]);}catch(_0x77ee68){return BPromise[_0x0f89('0x21')](_0x77ee68);}return _0x4b6dc4[_0x0f89('0x22')]();};}function saveUpdates(_0x21cbf8,_0xb559b6){return function(_0x29995e){if(_0x29995e){return _0x29995e['update'](_0x21cbf8)[_0x0f89('0x23')](function(_0x5c9218){return _0x5c9218;});}return null;};}function removeEntity(_0x1454e9,_0xb46b2e){return function(_0x56e245){if(_0x56e245){return _0x56e245[_0x0f89('0x24')]()['then'](function(){_0x1454e9[_0x0f89('0x19')](0xcc)[_0x0f89('0x18')]();});}};}function handleEntityNotFound(_0xa660a8,_0x4c7ce3){return function(_0x57fe1a){if(!_0x57fe1a){_0xa660a8['sendStatus'](0x194);}return _0x57fe1a;};}function handleError(_0x38074c,_0x122e18){_0x122e18=_0x122e18||0x1f4;return function(_0x409e1a){logger[_0x0f89('0x25')](_0x409e1a[_0x0f89('0x26')]);if(_0x409e1a[_0x0f89('0x27')]){delete _0x409e1a[_0x0f89('0x27')];}_0x38074c[_0x0f89('0x19')](_0x122e18)[_0x0f89('0x28')](_0x409e1a);};}exports[_0x0f89('0x29')]=function(_0x1fa3d5,_0x3c6aa9){var _0x172245={},_0x2e61a1={},_0x4bc021={'count':0x0,'rows':[]};var _0x3271f2=_[_0x0f89('0x2a')](db[_0x0f89('0x2b')][_0x0f89('0x2c')],function(_0x1026d6){return{'name':_0x1026d6[_0x0f89('0x2d')],'type':_0x1026d6[_0x0f89('0x2e')]['key']};});_0x2e61a1[_0x0f89('0x2f')]=_[_0x0f89('0x2a')](_0x3271f2,_0x0f89('0x27'));_0x2e61a1['query']=_['keys'](_0x1fa3d5['query']);_0x2e61a1['filters']=_['intersection'](_0x2e61a1[_0x0f89('0x2f')],_0x2e61a1['query']);_0x172245[_0x0f89('0x30')]=_[_0x0f89('0x31')](_0x2e61a1[_0x0f89('0x2f')],qs[_0x0f89('0x32')](_0x1fa3d5[_0x0f89('0x33')][_0x0f89('0x32')]));_0x172245[_0x0f89('0x30')]=_0x172245['attributes'][_0x0f89('0x34')]?_0x172245[_0x0f89('0x30')]:_0x2e61a1['model'];if(!_0x1fa3d5['query']['hasOwnProperty']('nolimit')){_0x172245['limit']=qs[_0x0f89('0x1d')](_0x1fa3d5[_0x0f89('0x33')][_0x0f89('0x1d')]);_0x172245[_0x0f89('0x1b')]=qs['offset'](_0x1fa3d5[_0x0f89('0x33')][_0x0f89('0x1b')]);}_0x172245[_0x0f89('0x35')]=qs['sort'](_0x1fa3d5[_0x0f89('0x33')]['sort']);_0x172245['where']=qs['filters'](_[_0x0f89('0x36')](_0x1fa3d5['query'],_0x2e61a1[_0x0f89('0x37')]),_0x3271f2);if(_0x1fa3d5[_0x0f89('0x33')][_0x0f89('0x38')]){_0x172245[_0x0f89('0x39')]=_[_0x0f89('0x3a')](_0x172245['where'],{'$or':_[_0x0f89('0x2a')](_0x3271f2,function(_0x123487){if(_0x123487[_0x0f89('0x2e')]!==_0x0f89('0x3b')){var _0x3db325={};_0x3db325[_0x123487[_0x0f89('0x27')]]={'$like':'%'+_0x1fa3d5['query'][_0x0f89('0x38')]+'%'};return _0x3db325;}})});}_0x172245=_[_0x0f89('0x3a')]({},_0x172245,_0x1fa3d5[_0x0f89('0x3c')]);var _0x24d6f9={'where':_0x172245[_0x0f89('0x39')]};return db['ServicenowField']['count'](_0x24d6f9)['then'](function(_0x51d75b){_0x4bc021[_0x0f89('0x1e')]=_0x51d75b;if(_0x1fa3d5['query']['includeAll']){_0x172245['include']=[{'all':!![]}];}return db['ServicenowField'][_0x0f89('0x3d')](_0x172245);})['then'](function(_0x32cb9c){_0x4bc021[_0x0f89('0x3e')]=_0x32cb9c;return _0x4bc021;})[_0x0f89('0x23')](respondWithFilteredResult(_0x3c6aa9,_0x172245))['catch'](handleError(_0x3c6aa9,null));};exports[_0x0f89('0x3f')]=function(_0x3c0492,_0xf92ef9){var _0x3b26f8={'raw':!![],'where':{'id':_0x3c0492[_0x0f89('0x40')]['id']}},_0x4e0c79={};_0x4e0c79[_0x0f89('0x2f')]=_[_0x0f89('0x41')](db[_0x0f89('0x2b')][_0x0f89('0x2c')]);_0x4e0c79[_0x0f89('0x33')]=_['keys'](_0x3c0492[_0x0f89('0x33')]);_0x4e0c79[_0x0f89('0x37')]=_['intersection'](_0x4e0c79['model'],_0x4e0c79[_0x0f89('0x33')]);_0x3b26f8['attributes']=_[_0x0f89('0x31')](_0x4e0c79['model'],qs[_0x0f89('0x32')](_0x3c0492[_0x0f89('0x33')]['fields']));_0x3b26f8['attributes']=_0x3b26f8[_0x0f89('0x30')]['length']?_0x3b26f8[_0x0f89('0x30')]:_0x4e0c79[_0x0f89('0x2f')];if(_0x3c0492[_0x0f89('0x33')][_0x0f89('0x42')]){_0x3b26f8[_0x0f89('0x43')]=[{'all':!![]}];}_0x3b26f8=_['merge']({},_0x3b26f8,_0x3c0492['options']);return db[_0x0f89('0x2b')][_0x0f89('0x44')](_0x3b26f8)['then'](handleEntityNotFound(_0xf92ef9,null))[_0x0f89('0x23')](respondWithResult(_0xf92ef9,null))['catch'](handleError(_0xf92ef9,null));};exports[_0x0f89('0x45')]=function(_0x567f19,_0x26af9b){return db['ServicenowField'][_0x0f89('0x45')](_0x567f19[_0x0f89('0x46')],{})[_0x0f89('0x23')](respondWithResult(_0x26af9b,0xc9))[_0x0f89('0x47')](handleError(_0x26af9b,null));};exports[_0x0f89('0x48')]=function(_0x10ebc4,_0x33ba52){if(_0x10ebc4[_0x0f89('0x46')]['id']){delete _0x10ebc4['body']['id'];}return db[_0x0f89('0x2b')][_0x0f89('0x44')]({'where':{'id':_0x10ebc4[_0x0f89('0x40')]['id']}})[_0x0f89('0x23')](handleEntityNotFound(_0x33ba52,null))['then'](saveUpdates(_0x10ebc4['body'],null))['then'](respondWithResult(_0x33ba52,null))[_0x0f89('0x47')](handleError(_0x33ba52,null));};exports[_0x0f89('0x24')]=function(_0x258e9d,_0xfe3601){return db[_0x0f89('0x2b')]['find']({'where':{'id':_0x258e9d[_0x0f89('0x40')]['id']}})[_0x0f89('0x23')](handleEntityNotFound(_0xfe3601,null))['then'](removeEntity(_0xfe3601,null))['catch'](handleError(_0xfe3601,null));};
\ No newline at end of file
+var _0xa2ac=['error','name','send','map','ServicenowField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','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','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','then','end','sendStatus'];(function(_0x368fd5,_0x288a56){var _0x2df4b5=function(_0x44f1ab){while(--_0x44f1ab){_0x368fd5['push'](_0x368fd5['shift']());}};_0x2df4b5(++_0x288a56);}(_0xa2ac,0x195));var _0xca2a=function(_0x3ab169,_0x147b88){_0x3ab169=_0x3ab169-0x0;var _0x4eeaa3=_0xa2ac[_0x3ab169];return _0x4eeaa3;};'use strict';var emlformat=require(_0xca2a('0x0'));var rimraf=require(_0xca2a('0x1'));var zipdir=require(_0xca2a('0x2'));var jsonpatch=require(_0xca2a('0x3'));var rp=require(_0xca2a('0x4'));var moment=require('moment');var BPromise=require(_0xca2a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xca2a('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xca2a('0x7'));var squel=require('squel');var crypto=require(_0xca2a('0x8'));var jsforce=require(_0xca2a('0x9'));var deskjs=require(_0xca2a('0xa'));var toCsv=require(_0xca2a('0xb'));var querystring=require(_0xca2a('0xc'));var Papa=require(_0xca2a('0xd'));var Redis=require(_0xca2a('0xe'));var authService=require(_0xca2a('0xf'));var qs=require(_0xca2a('0x10'));var as=require(_0xca2a('0x11'));var hardwareService=require(_0xca2a('0x12'));var logger=require(_0xca2a('0x13'))(_0xca2a('0x14'));var utils=require(_0xca2a('0x15'));var config=require(_0xca2a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xca2a('0x17'))['db'];function respondWithStatusCode(_0x44cbd3,_0x297852){_0x297852=_0x297852||0xcc;return function(_0x3fd0e3){if(_0x3fd0e3){return _0x44cbd3['sendStatus'](_0x297852);}return _0x44cbd3[_0xca2a('0x18')](_0x297852)['end']();};}function respondWithResult(_0x36a73b,_0x136455){_0x136455=_0x136455||0xc8;return function(_0x5715ed){if(_0x5715ed){return _0x36a73b[_0xca2a('0x18')](_0x136455)[_0xca2a('0x19')](_0x5715ed);}};}function respondWithFilteredResult(_0x53ded3,_0x18310e){return function(_0x61096e){if(_0x61096e){var _0x2e65e4=typeof _0x18310e[_0xca2a('0x1a')]===_0xca2a('0x1b')&&typeof _0x18310e['limit']==='undefined';var _0x37c7d7=_0x61096e[_0xca2a('0x1c')];var _0x2b9e48=_0x2e65e4?0x0:_0x18310e['offset'];var _0x3786db=_0x2e65e4?_0x61096e['count']:_0x18310e[_0xca2a('0x1a')]+_0x18310e[_0xca2a('0x1d')];var _0x2610b2;if(_0x3786db>=_0x37c7d7){_0x3786db=_0x37c7d7;_0x2610b2=0xc8;}else{_0x2610b2=0xce;}_0x53ded3[_0xca2a('0x18')](_0x2610b2);return _0x53ded3[_0xca2a('0x1e')](_0xca2a('0x1f'),_0x2b9e48+'-'+_0x3786db+'/'+_0x37c7d7)[_0xca2a('0x19')](_0x61096e);}return null;};}function patchUpdates(_0x58065a){return function(_0x4110e2){try{jsonpatch[_0xca2a('0x20')](_0x4110e2,_0x58065a,!![]);}catch(_0x160142){return BPromise[_0xca2a('0x21')](_0x160142);}return _0x4110e2[_0xca2a('0x22')]();};}function saveUpdates(_0x165688,_0x2ba331){return function(_0x5bb96b){if(_0x5bb96b){return _0x5bb96b['update'](_0x165688)['then'](function(_0x31705e){return _0x31705e;});}return null;};}function removeEntity(_0x42ee8f,_0x2c2cd8){return function(_0x4fed92){if(_0x4fed92){return _0x4fed92[_0xca2a('0x23')]()[_0xca2a('0x24')](function(){_0x42ee8f['status'](0xcc)[_0xca2a('0x25')]();});}};}function handleEntityNotFound(_0x52b7d3,_0x387316){return function(_0x5167b0){if(!_0x5167b0){_0x52b7d3[_0xca2a('0x26')](0x194);}return _0x5167b0;};}function handleError(_0x59380c,_0x3aa4cf){_0x3aa4cf=_0x3aa4cf||0x1f4;return function(_0x52a47d){logger[_0xca2a('0x27')](_0x52a47d['stack']);if(_0x52a47d[_0xca2a('0x28')]){delete _0x52a47d[_0xca2a('0x28')];}_0x59380c[_0xca2a('0x18')](_0x3aa4cf)[_0xca2a('0x29')](_0x52a47d);};}exports['index']=function(_0xd048dc,_0x5241e2){var _0x3abd46={},_0x5c943a={},_0x76fb27={'count':0x0,'rows':[]};var _0x117bf8=_[_0xca2a('0x2a')](db[_0xca2a('0x2b')][_0xca2a('0x2c')],function(_0x508274){return{'name':_0x508274[_0xca2a('0x2d')],'type':_0x508274[_0xca2a('0x2e')][_0xca2a('0x2f')]};});_0x5c943a[_0xca2a('0x30')]=_[_0xca2a('0x2a')](_0x117bf8,_0xca2a('0x28'));_0x5c943a[_0xca2a('0x31')]=_[_0xca2a('0x32')](_0xd048dc[_0xca2a('0x31')]);_0x5c943a[_0xca2a('0x33')]=_[_0xca2a('0x34')](_0x5c943a[_0xca2a('0x30')],_0x5c943a['query']);_0x3abd46[_0xca2a('0x35')]=_[_0xca2a('0x34')](_0x5c943a[_0xca2a('0x30')],qs[_0xca2a('0x36')](_0xd048dc[_0xca2a('0x31')][_0xca2a('0x36')]));_0x3abd46['attributes']=_0x3abd46[_0xca2a('0x35')][_0xca2a('0x37')]?_0x3abd46[_0xca2a('0x35')]:_0x5c943a[_0xca2a('0x30')];if(!_0xd048dc[_0xca2a('0x31')][_0xca2a('0x38')]('nolimit')){_0x3abd46[_0xca2a('0x1d')]=qs[_0xca2a('0x1d')](_0xd048dc[_0xca2a('0x31')][_0xca2a('0x1d')]);_0x3abd46['offset']=qs[_0xca2a('0x1a')](_0xd048dc[_0xca2a('0x31')]['offset']);}_0x3abd46[_0xca2a('0x39')]=qs[_0xca2a('0x3a')](_0xd048dc[_0xca2a('0x31')]['sort']);_0x3abd46[_0xca2a('0x3b')]=qs['filters'](_['pick'](_0xd048dc['query'],_0x5c943a['filters']),_0x117bf8);if(_0xd048dc['query']['filter']){_0x3abd46['where']=_[_0xca2a('0x3c')](_0x3abd46[_0xca2a('0x3b')],{'$or':_[_0xca2a('0x2a')](_0x117bf8,function(_0x57eb7b){if(_0x57eb7b['type']!==_0xca2a('0x3d')){var _0x4645a5={};_0x4645a5[_0x57eb7b['name']]={'$like':'%'+_0xd048dc['query'][_0xca2a('0x3e')]+'%'};return _0x4645a5;}})});}_0x3abd46=_[_0xca2a('0x3c')]({},_0x3abd46,_0xd048dc[_0xca2a('0x3f')]);var _0x49eb47={'where':_0x3abd46[_0xca2a('0x3b')]};return db['ServicenowField'][_0xca2a('0x1c')](_0x49eb47)['then'](function(_0x1b3b4f){_0x76fb27[_0xca2a('0x1c')]=_0x1b3b4f;if(_0xd048dc[_0xca2a('0x31')][_0xca2a('0x40')]){_0x3abd46[_0xca2a('0x41')]=[{'all':!![]}];}return db[_0xca2a('0x2b')][_0xca2a('0x42')](_0x3abd46);})[_0xca2a('0x24')](function(_0x23fbe2){_0x76fb27[_0xca2a('0x43')]=_0x23fbe2;return _0x76fb27;})[_0xca2a('0x24')](respondWithFilteredResult(_0x5241e2,_0x3abd46))[_0xca2a('0x44')](handleError(_0x5241e2,null));};exports[_0xca2a('0x45')]=function(_0x2933ea,_0x2b223d){var _0x4c300e={'raw':!![],'where':{'id':_0x2933ea['params']['id']}},_0x5b7c7b={};_0x5b7c7b[_0xca2a('0x30')]=_[_0xca2a('0x32')](db['ServicenowField'][_0xca2a('0x2c')]);_0x5b7c7b['query']=_[_0xca2a('0x32')](_0x2933ea[_0xca2a('0x31')]);_0x5b7c7b[_0xca2a('0x33')]=_[_0xca2a('0x34')](_0x5b7c7b['model'],_0x5b7c7b[_0xca2a('0x31')]);_0x4c300e[_0xca2a('0x35')]=_[_0xca2a('0x34')](_0x5b7c7b[_0xca2a('0x30')],qs['fields'](_0x2933ea[_0xca2a('0x31')]['fields']));_0x4c300e['attributes']=_0x4c300e[_0xca2a('0x35')][_0xca2a('0x37')]?_0x4c300e[_0xca2a('0x35')]:_0x5b7c7b[_0xca2a('0x30')];if(_0x2933ea[_0xca2a('0x31')][_0xca2a('0x40')]){_0x4c300e[_0xca2a('0x41')]=[{'all':!![]}];}_0x4c300e=_[_0xca2a('0x3c')]({},_0x4c300e,_0x2933ea[_0xca2a('0x3f')]);return db[_0xca2a('0x2b')][_0xca2a('0x46')](_0x4c300e)[_0xca2a('0x24')](handleEntityNotFound(_0x2b223d,null))[_0xca2a('0x24')](respondWithResult(_0x2b223d,null))[_0xca2a('0x44')](handleError(_0x2b223d,null));};exports[_0xca2a('0x47')]=function(_0x1771bf,_0x3931db){return db[_0xca2a('0x2b')][_0xca2a('0x47')](_0x1771bf['body'],{})[_0xca2a('0x24')](respondWithResult(_0x3931db,0xc9))[_0xca2a('0x44')](handleError(_0x3931db,null));};exports['update']=function(_0x3944c2,_0x1fa5cc){if(_0x3944c2['body']['id']){delete _0x3944c2[_0xca2a('0x48')]['id'];}return db[_0xca2a('0x2b')][_0xca2a('0x46')]({'where':{'id':_0x3944c2[_0xca2a('0x49')]['id']}})[_0xca2a('0x24')](handleEntityNotFound(_0x1fa5cc,null))[_0xca2a('0x24')](saveUpdates(_0x3944c2[_0xca2a('0x48')],null))[_0xca2a('0x24')](respondWithResult(_0x1fa5cc,null))[_0xca2a('0x44')](handleError(_0x1fa5cc,null));};exports[_0xca2a('0x23')]=function(_0x47affb,_0x29abe8){return db[_0xca2a('0x2b')][_0xca2a('0x46')]({'where':{'id':_0x47affb['params']['id']}})[_0xca2a('0x24')](handleEntityNotFound(_0x29abe8,null))[_0xca2a('0x24')](removeEntity(_0x29abe8,null))['catch'](handleError(_0x29abe8,null));};
\ No newline at end of file
index 7cc980d..a86660e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa0cf=['exports','define','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','path','../../config/environment','./intServicenowField.attributes'];(function(_0x16ba80,_0x344701){var _0x3fd0d1=function(_0x424888){while(--_0x424888){_0x16ba80['push'](_0x16ba80['shift']());}};_0x3fd0d1(++_0x344701);}(_0xa0cf,0x164));var _0xfa0c=function(_0x3a852a,_0xf3f1d3){_0x3a852a=_0x3a852a-0x0;var _0x48c902=_0xa0cf[_0x3a852a];return _0x48c902;};'use strict';var _=require(_0xfa0c('0x0'));var util=require(_0xfa0c('0x1'));var logger=require(_0xfa0c('0x2'))(_0xfa0c('0x3'));var moment=require(_0xfa0c('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfa0c('0x5'));var rimraf=require('rimraf');var config=require(_0xfa0c('0x6'));var attributes=require(_0xfa0c('0x7'));module[_0xfa0c('0x8')]=function(_0x59a554,_0x27d9f7){return _0x59a554[_0xfa0c('0x9')]('ServicenowField',attributes,{'tableName':_0xfa0c('0xa'),'paranoid':![],'indexes':[{'name':_0xfa0c('0xb'),'fields':[_0xfa0c('0xc'),_0xfa0c('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x11cb=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intServicenowField.attributes','exports','define','int_servicenow_fields','servicenow_unique_index','idField','FieldId'];(function(_0x1db35d,_0xb5f691){var _0x22bcc8=function(_0x313a13){while(--_0x313a13){_0x1db35d['push'](_0x1db35d['shift']());}};_0x22bcc8(++_0xb5f691);}(_0x11cb,0xf0));var _0xb11c=function(_0x538819,_0x336dbb){_0x538819=_0x538819-0x0;var _0x2f2b32=_0x11cb[_0x538819];return _0x2f2b32;};'use strict';var _=require(_0xb11c('0x0'));var util=require(_0xb11c('0x1'));var logger=require(_0xb11c('0x2'))(_0xb11c('0x3'));var moment=require('moment');var BPromise=require(_0xb11c('0x4'));var rp=require(_0xb11c('0x5'));var fs=require('fs');var path=require(_0xb11c('0x6'));var rimraf=require(_0xb11c('0x7'));var config=require('../../config/environment');var attributes=require(_0xb11c('0x8'));module[_0xb11c('0x9')]=function(_0x334a09,_0x47fbb6){return _0x334a09[_0xb11c('0xa')]('ServicenowField',attributes,{'tableName':_0xb11c('0xb'),'paranoid':![],'indexes':[{'name':_0xb11c('0xc'),'fields':[_0xb11c('0xd'),_0xb11c('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index dc6024e..5d0ee04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda3f=['rpc','jayson/promise','client','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x5180c3,_0x4b35f7){var _0x55c975=function(_0x4746cb){while(--_0x4746cb){_0x5180c3['push'](_0x5180c3['shift']());}};_0x55c975(++_0x4b35f7);}(_0xda3f,0xec));var _0xfda3=function(_0x524740,_0x261c00){_0x524740=_0x524740-0x0;var _0x25f285=_0xda3f[_0x524740];return _0x25f285;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('ServicenowField,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('ServicenowField,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('ServicenowField,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});}
\ No newline at end of file
+var _0x9ffd=['ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','debug'];(function(_0x5f1c30,_0x280356){var _0x264bce=function(_0x2c45ea){while(--_0x2c45ea){_0x5f1c30['push'](_0x5f1c30['shift']());}};_0x264bce(++_0x280356);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x536913,_0x513125){_0x536913=_0x536913-0x0;var _0xc2980b=_0x9ffd[_0x536913];return _0xc2980b;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var moment=require(_0xd9ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9ff('0x3'));var fs=require('fs');var Redis=require(_0xd9ff('0x4'));var db=require(_0xd9ff('0x5'))['db'];var utils=require(_0xd9ff('0x6'));var logger=require('../../config/logger')(_0xd9ff('0x7'));var config=require(_0xd9ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd9ff('0x9')][_0xd9ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13ea8c,_0x270eb2,_0x45c60a){return new BPromise(function(_0x66282d,_0x13954e){return client[_0xd9ff('0xb')](_0x13ea8c,_0x45c60a)[_0xd9ff('0xc')](function(_0x58e728){logger['info']('ServicenowField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');logger[_0xd9ff('0xd')](_0xd9ff('0xe'),_0x270eb2,_0xd9ff('0xf'),JSON[_0xd9ff('0x10')](_0x58e728));if(_0x58e728[_0xd9ff('0x11')]){if(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x12')]===0x1f4){logger[_0xd9ff('0x11')]('ServicenowField,\x20%s,\x20%s',_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x13954e(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x13')]);}logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x66282d(_0x58e728[_0xd9ff('0x11')]['message']);}else{logger[_0xd9ff('0x15')]('ServicenowField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');_0x66282d(_0x58e728['result']['message']);}})[_0xd9ff('0x16')](function(_0x4f9d6d){logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x4f9d6d);_0x13954e(_0x4f9d6d);});});}
\ No newline at end of file
index bc0e197..eb01394 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x4b7de1,_0x2e12d8){var _0xc908a5=function(_0x2338ce){while(--_0x2338ce){_0x4b7de1['push'](_0x4b7de1['shift']());}};_0xc908a5(++_0x2e12d8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router;
\ No newline at end of file
+var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x169c2f,_0x453fca){var _0x531be5=function(_0x28980f){while(--_0x28980f){_0x169c2f['push'](_0x169c2f['shift']());}};_0x531be5(++_0x453fca);}(_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('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 8052a25..2cf89be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x324268,_0x5e7e2b){var _0x5b823a=function(_0x3053fd){while(--_0x3053fd){_0x324268['push'](_0x324268['shift']());}};_0x5b823a(++_0x5e7e2b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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(_0x335fa0,_0x2f008b){var _0x2e8a1f=function(_0x1ab2d8){while(--_0x1ab2d8){_0x335fa0['push'](_0x335fa0['shift']());}};_0x2e8a1f(++_0x2f008b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'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 f9b4f9e..debb870 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e6d=['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','../../config/logger','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','save','then','destroy','error','name','map','SugarcrmAccount','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','find','create','update','body','findOne','SugarcrmConfiguration','getConfigurations','addConfiguration','Subjects','getSubjects','Descriptions','channel','SugarcrmField','created_by','date_start','duration_hours','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','get_module_fields','JSON','Calls','values','module_fields','remove','value','test','getFields,\x20%s,\x20%s,\x20%s','getFields','send','Wrong\x20credentials','statusCode','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x1fb633,_0x5d645d){var _0x3d2f4e=function(_0x4f0a99){while(--_0x4f0a99){_0x1fb633['push'](_0x1fb633['shift']());}};_0x3d2f4e(++_0x5d645d);}(_0x3e6d,0x15b));var _0xd3e6=function(_0x5b1f44,_0x192318){_0x5b1f44=_0x5b1f44-0x0;var _0xa01133=_0x3e6d[_0x5b1f44];return _0xa01133;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd3e6('0x0'));var zipdir=require(_0xd3e6('0x1'));var jsonpatch=require(_0xd3e6('0x2'));var rp=require(_0xd3e6('0x3'));var moment=require('moment');var BPromise=require(_0xd3e6('0x4'));var Mustache=require(_0xd3e6('0x5'));var util=require(_0xd3e6('0x6'));var path=require(_0xd3e6('0x7'));var sox=require(_0xd3e6('0x8'));var csv=require(_0xd3e6('0x9'));var ejs=require(_0xd3e6('0xa'));var fs=require('fs');var fs_extra=require(_0xd3e6('0xb'));var _=require(_0xd3e6('0xc'));var squel=require(_0xd3e6('0xd'));var crypto=require(_0xd3e6('0xe'));var jsforce=require(_0xd3e6('0xf'));var deskjs=require(_0xd3e6('0x10'));var toCsv=require(_0xd3e6('0x9'));var querystring=require(_0xd3e6('0x11'));var Papa=require(_0xd3e6('0x12'));var Redis=require(_0xd3e6('0x13'));var authService=require(_0xd3e6('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xd3e6('0x15'));var hardwareService=require(_0xd3e6('0x16'));var logger=require(_0xd3e6('0x17'))(_0xd3e6('0x18'));var utils=require('../../config/utils');var config=require(_0xd3e6('0x19'));var licenseUtil=require(_0xd3e6('0x1a'));var db=require('../../mysqldb')['db'];var integrations=require(_0xd3e6('0x1b'));function respondWithStatusCode(_0x12670d,_0x108f90){_0x108f90=_0x108f90||0xcc;return function(_0x2dc620){if(_0x2dc620){return _0x12670d[_0xd3e6('0x1c')](_0x108f90);}return _0x12670d[_0xd3e6('0x1d')](_0x108f90)[_0xd3e6('0x1e')]();};}function respondWithResult(_0xeab246,_0x191481){_0x191481=_0x191481||0xc8;return function(_0x12f138){if(_0x12f138){return _0xeab246[_0xd3e6('0x1d')](_0x191481)['json'](_0x12f138);}};}function respondWithFilteredResult(_0x302439,_0x5b75af){return function(_0x530ebb){if(_0x530ebb){var _0x169184=typeof _0x5b75af[_0xd3e6('0x1f')]===_0xd3e6('0x20')&&typeof _0x5b75af['limit']===_0xd3e6('0x20');var _0x191797=_0x530ebb[_0xd3e6('0x21')];var _0x15c90b=_0x169184?0x0:_0x5b75af[_0xd3e6('0x1f')];var _0x1dfcb1=_0x169184?_0x530ebb[_0xd3e6('0x21')]:_0x5b75af[_0xd3e6('0x1f')]+_0x5b75af[_0xd3e6('0x22')];var _0x187c3f;if(_0x1dfcb1>=_0x191797){_0x1dfcb1=_0x191797;_0x187c3f=0xc8;}else{_0x187c3f=0xce;}_0x302439[_0xd3e6('0x1d')](_0x187c3f);return _0x302439[_0xd3e6('0x23')]('Content-Range',_0x15c90b+'-'+_0x1dfcb1+'/'+_0x191797)[_0xd3e6('0x24')](_0x530ebb);}return null;};}function patchUpdates(_0x35893e){return function(_0x8aaa05){try{jsonpatch[_0xd3e6('0x25')](_0x8aaa05,_0x35893e,!![]);}catch(_0x1add9e){return BPromise['reject'](_0x1add9e);}return _0x8aaa05[_0xd3e6('0x26')]();};}function saveUpdates(_0x362a8f,_0x269844){return function(_0x3dd662){if(_0x3dd662){return _0x3dd662['update'](_0x362a8f)[_0xd3e6('0x27')](function(_0x4f9dd6){return _0x4f9dd6;});}return null;};}function removeEntity(_0x32775c,_0x46e845){return function(_0x5133fb){if(_0x5133fb){return _0x5133fb[_0xd3e6('0x28')]()['then'](function(){_0x32775c[_0xd3e6('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c5e61,_0x560e19){return function(_0x222929){if(!_0x222929){_0x5c5e61['sendStatus'](0x194);}return _0x222929;};}function handleError(_0x531586,_0x4dc500){_0x4dc500=_0x4dc500||0x1f4;return function(_0x226826){logger[_0xd3e6('0x29')](_0x226826['stack']);if(_0x226826[_0xd3e6('0x2a')]){delete _0x226826[_0xd3e6('0x2a')];}_0x531586[_0xd3e6('0x1d')](_0x4dc500)['send'](_0x226826);};}exports['index']=function(_0x1b9eef,_0x455b74){var _0x1ae844={},_0x5d8faa={},_0x4b4eff={'count':0x0,'rows':[]};var _0x4bf0d1=_[_0xd3e6('0x2b')](db[_0xd3e6('0x2c')][_0xd3e6('0x2d')],function(_0x316de9){return{'name':_0x316de9['fieldName'],'type':_0x316de9[_0xd3e6('0x2e')][_0xd3e6('0x2f')]};});_0x5d8faa[_0xd3e6('0x30')]=_[_0xd3e6('0x2b')](_0x4bf0d1,_0xd3e6('0x2a'));_0x5d8faa[_0xd3e6('0x31')]=_[_0xd3e6('0x32')](_0x1b9eef['query']);_0x5d8faa[_0xd3e6('0x33')]=_['intersection'](_0x5d8faa[_0xd3e6('0x30')],_0x5d8faa[_0xd3e6('0x31')]);_0x1ae844[_0xd3e6('0x34')]=_[_0xd3e6('0x35')](_0x5d8faa[_0xd3e6('0x30')],qs['fields'](_0x1b9eef[_0xd3e6('0x31')][_0xd3e6('0x36')]));_0x1ae844['attributes']=_0x1ae844[_0xd3e6('0x34')][_0xd3e6('0x37')]?_0x1ae844[_0xd3e6('0x34')]:_0x5d8faa[_0xd3e6('0x30')];if(!_0x1b9eef[_0xd3e6('0x31')][_0xd3e6('0x38')]('nolimit')){_0x1ae844[_0xd3e6('0x22')]=qs[_0xd3e6('0x22')](_0x1b9eef[_0xd3e6('0x31')][_0xd3e6('0x22')]);_0x1ae844[_0xd3e6('0x1f')]=qs[_0xd3e6('0x1f')](_0x1b9eef[_0xd3e6('0x31')][_0xd3e6('0x1f')]);}_0x1ae844[_0xd3e6('0x39')]=qs[_0xd3e6('0x3a')](_0x1b9eef['query'][_0xd3e6('0x3a')]);_0x1ae844[_0xd3e6('0x3b')]=qs[_0xd3e6('0x33')](_[_0xd3e6('0x3c')](_0x1b9eef[_0xd3e6('0x31')],_0x5d8faa['filters']),_0x4bf0d1);if(_0x1b9eef[_0xd3e6('0x31')][_0xd3e6('0x3d')]){_0x1ae844[_0xd3e6('0x3b')]=_[_0xd3e6('0x3e')](_0x1ae844[_0xd3e6('0x3b')],{'$or':_[_0xd3e6('0x2b')](_0x4bf0d1,function(_0x26e8ae){if(_0x26e8ae[_0xd3e6('0x2e')]!==_0xd3e6('0x3f')){var _0x1e7ca9={};_0x1e7ca9[_0x26e8ae['name']]={'$like':'%'+_0x1b9eef[_0xd3e6('0x31')]['filter']+'%'};return _0x1e7ca9;}})});}_0x1ae844=_[_0xd3e6('0x3e')]({},_0x1ae844,_0x1b9eef[_0xd3e6('0x40')]);var _0x2ebedb={'where':_0x1ae844[_0xd3e6('0x3b')]};return db[_0xd3e6('0x2c')][_0xd3e6('0x21')](_0x2ebedb)[_0xd3e6('0x27')](function(_0x17b036){_0x4b4eff[_0xd3e6('0x21')]=_0x17b036;if(_0x1b9eef['query']['includeAll']){_0x1ae844[_0xd3e6('0x41')]=[{'all':!![]}];}return db[_0xd3e6('0x2c')][_0xd3e6('0x42')](_0x1ae844);})[_0xd3e6('0x27')](function(_0x3e5261){_0x4b4eff['rows']=_0x3e5261;return _0x4b4eff;})['then'](respondWithFilteredResult(_0x455b74,_0x1ae844))[_0xd3e6('0x43')](handleError(_0x455b74,null));};exports[_0xd3e6('0x44')]=function(_0x235f75,_0xfcdb53){var _0x3eaad0={'raw':![],'where':{'id':_0x235f75[_0xd3e6('0x45')]['id']}},_0x5b702d={};_0x5b702d[_0xd3e6('0x30')]=_[_0xd3e6('0x32')](db[_0xd3e6('0x2c')][_0xd3e6('0x2d')]);_0x5b702d[_0xd3e6('0x31')]=_[_0xd3e6('0x32')](_0x235f75[_0xd3e6('0x31')]);_0x5b702d[_0xd3e6('0x33')]=_['intersection'](_0x5b702d['model'],_0x5b702d[_0xd3e6('0x31')]);_0x3eaad0[_0xd3e6('0x34')]=_[_0xd3e6('0x35')](_0x5b702d['model'],qs[_0xd3e6('0x36')](_0x235f75[_0xd3e6('0x31')][_0xd3e6('0x36')]));_0x3eaad0[_0xd3e6('0x34')]=_0x3eaad0[_0xd3e6('0x34')][_0xd3e6('0x37')]?_0x3eaad0['attributes']:_0x5b702d[_0xd3e6('0x30')];if(_0x235f75[_0xd3e6('0x31')]['includeAll']){_0x3eaad0['include']=[{'all':!![]}];}_0x3eaad0=_[_0xd3e6('0x3e')]({},_0x3eaad0,_0x235f75['options']);return db[_0xd3e6('0x2c')][_0xd3e6('0x46')](_0x3eaad0)['then'](handleEntityNotFound(_0xfcdb53,null))['then'](respondWithResult(_0xfcdb53,null))[_0xd3e6('0x43')](handleError(_0xfcdb53,null));};exports[_0xd3e6('0x47')]=function(_0x18455d,_0x2ba8cf){return db[_0xd3e6('0x2c')][_0xd3e6('0x47')](_0x18455d['body'],{})[_0xd3e6('0x27')](respondWithResult(_0x2ba8cf,0xc9))[_0xd3e6('0x43')](handleError(_0x2ba8cf,null));};exports[_0xd3e6('0x48')]=function(_0x3721e1,_0xf87aab){if(_0x3721e1[_0xd3e6('0x49')]['id']){delete _0x3721e1[_0xd3e6('0x49')]['id'];}return db[_0xd3e6('0x2c')][_0xd3e6('0x46')]({'where':{'id':_0x3721e1['params']['id']}})['then'](handleEntityNotFound(_0xf87aab,null))[_0xd3e6('0x27')](saveUpdates(_0x3721e1[_0xd3e6('0x49')],null))['then'](respondWithResult(_0xf87aab,null))[_0xd3e6('0x43')](handleError(_0xf87aab,null));};exports[_0xd3e6('0x28')]=function(_0x16c840,_0xa37dcf){return db[_0xd3e6('0x2c')][_0xd3e6('0x46')]({'where':{'id':_0x16c840[_0xd3e6('0x45')]['id']}})['then'](handleEntityNotFound(_0xa37dcf,null))['then'](removeEntity(_0xa37dcf,null))[_0xd3e6('0x43')](handleError(_0xa37dcf,null));};exports['getConfigurations']=function(_0x333c2c,_0x42e7b5,_0x19b682){var _0x3c69ad={};var _0x9d7d68={};var _0x5432fe;var _0x25437a;return db['SugarcrmAccount'][_0xd3e6('0x4a')]({'where':{'id':_0x333c2c[_0xd3e6('0x45')]['id']}})['then'](handleEntityNotFound(_0x42e7b5,null))['then'](function(_0x3214c5){if(_0x3214c5){_0x5432fe=_0x3214c5;_0x9d7d68[_0xd3e6('0x30')]=_['keys'](db[_0xd3e6('0x4b')][_0xd3e6('0x2d')]);_0x9d7d68['query']=_[_0xd3e6('0x32')](_0x333c2c[_0xd3e6('0x31')]);_0x9d7d68[_0xd3e6('0x33')]=_[_0xd3e6('0x35')](_0x9d7d68[_0xd3e6('0x30')],_0x9d7d68[_0xd3e6('0x31')]);_0x3c69ad['attributes']=_[_0xd3e6('0x35')](_0x9d7d68['model'],qs[_0xd3e6('0x36')](_0x333c2c['query'][_0xd3e6('0x36')]));_0x3c69ad[_0xd3e6('0x34')]=_0x3c69ad[_0xd3e6('0x34')][_0xd3e6('0x37')]?_0x3c69ad[_0xd3e6('0x34')]:_0x9d7d68[_0xd3e6('0x30')];_0x3c69ad[_0xd3e6('0x39')]=qs[_0xd3e6('0x3a')](_0x333c2c[_0xd3e6('0x31')][_0xd3e6('0x3a')]);_0x3c69ad[_0xd3e6('0x3b')]=qs[_0xd3e6('0x33')](_[_0xd3e6('0x3c')](_0x333c2c[_0xd3e6('0x31')],_0x9d7d68[_0xd3e6('0x33')]));if(_0x333c2c[_0xd3e6('0x31')][_0xd3e6('0x3d')]){_0x3c69ad[_0xd3e6('0x3b')]=_['merge'](_0x3c69ad['where'],{'$or':_[_0xd3e6('0x2b')](_0x3c69ad[_0xd3e6('0x34')],function(_0x346831){var _0x9bd5a3={};_0x9bd5a3[_0x346831]={'$like':'%'+_0x333c2c[_0xd3e6('0x31')][_0xd3e6('0x3d')]+'%'};return _0x9bd5a3;})});}_0x3c69ad=_[_0xd3e6('0x3e')]({},_0x3c69ad,_0x333c2c[_0xd3e6('0x40')]);return _0x5432fe[_0xd3e6('0x4c')](_0x3c69ad);}})[_0xd3e6('0x27')](function(_0x2bf4a7){if(_0x2bf4a7){_0x25437a=_0x2bf4a7[_0xd3e6('0x37')];if(!_0x333c2c[_0xd3e6('0x31')]['hasOwnProperty']('nolimit')){_0x3c69ad[_0xd3e6('0x22')]=qs[_0xd3e6('0x22')](_0x333c2c[_0xd3e6('0x31')][_0xd3e6('0x22')]);_0x3c69ad[_0xd3e6('0x1f')]=qs[_0xd3e6('0x1f')](_0x333c2c['query'][_0xd3e6('0x1f')]);}return _0x5432fe[_0xd3e6('0x4c')](_0x3c69ad);}})[_0xd3e6('0x27')](function(_0x353a3d){if(_0x353a3d){return _0x353a3d?{'count':_0x25437a,'rows':_0x353a3d}:null;}})[_0xd3e6('0x27')](respondWithResult(_0x42e7b5,null))['catch'](handleError(_0x42e7b5,null));};exports[_0xd3e6('0x4d')]=function(_0x32b910,_0x2c0274,_0x12c683){if(_0x32b910[_0xd3e6('0x49')]['id']){delete _0x32b910[_0xd3e6('0x49')]['id'];}return db[_0xd3e6('0x2c')][_0xd3e6('0x4a')]({'where':{'id':_0x32b910[_0xd3e6('0x45')]['id']}})['then'](handleEntityNotFound(_0x2c0274,null))[_0xd3e6('0x27')](function(_0x342a4e){if(_0x342a4e){_0x32b910[_0xd3e6('0x49')]['AccountId']=_0x342a4e['id'];_0x32b910[_0xd3e6('0x49')][_0xd3e6('0x4e')]=integrations[_0xd3e6('0x4f')](_0x32b910[_0xd3e6('0x49')]['channel'],_0x32b910[_0xd3e6('0x49')][_0xd3e6('0x2e')]);_0x32b910[_0xd3e6('0x49')][_0xd3e6('0x50')]=integrations['getDescriptions'](_0x32b910[_0xd3e6('0x49')][_0xd3e6('0x51')],_0x32b910['body']['type']);return db['SugarcrmConfiguration'][_0xd3e6('0x47')](_0x32b910[_0xd3e6('0x49')],{'include':[{'model':db['SugarcrmField'],'as':_0xd3e6('0x4e')},{'model':db[_0xd3e6('0x52')],'as':_0xd3e6('0x50')}]});}return null;})[_0xd3e6('0x27')](respondWithResult(_0x2c0274,null))[_0xd3e6('0x43')](handleError(_0x2c0274,null));};exports['getFields']=function(_0x1464d8,_0x23ec54,_0x56140f){var _0x130172='';var _0x2f1c5b=['id',_0xd3e6('0x2a'),'assigned_user_id',_0xd3e6('0x53'),'description',_0xd3e6('0x54'),_0xd3e6('0x55'),'duration_minutes',_0xd3e6('0x56'),_0xd3e6('0x57'),_0xd3e6('0x58'),_0xd3e6('0x59')];return db[_0xd3e6('0x2c')][_0xd3e6('0x4a')]({'where':{'id':_0x1464d8[_0xd3e6('0x45')]['id']},'attributes':['id',_0xd3e6('0x5a'),_0xd3e6('0x5b'),_0xd3e6('0x5c')]})[_0xd3e6('0x27')](handleEntityNotFound(_0x23ec54,null))[_0xd3e6('0x27')](function(_0x258fc2){if(_0x258fc2){_0x130172=_0x258fc2['remoteUri'];var _0x76cb43=_0x130172[_0xd3e6('0x5d')](-0x1);if(_0x76cb43==='/'){_0x130172=_0x130172[_0xd3e6('0x5e')](0x0,_0x130172[_0xd3e6('0x5f')](_0x76cb43));}return rp({'method':_0xd3e6('0x60'),'uri':util[_0xd3e6('0x61')](_0xd3e6('0x62'),_0x130172,_0xd3e6('0x63')),'json':!![],'form':{'method':'login','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xd3e6('0x64')]({'user_auth':{'user_name':_0x258fc2[_0xd3e6('0x5a')],'password':_0x258fc2[_0xd3e6('0x5b')],'encryption':_0xd3e6('0x65')},'application':_0xd3e6('0x66')})}});}})[_0xd3e6('0x27')](function(_0x25c5c8){if(_0x25c5c8&&_0x25c5c8['name']!=='Invalid\x20Login'&&_0x25c5c8[_0xd3e6('0x2a')]!==_0xd3e6('0x67')){return rp({'method':_0xd3e6('0x60'),'uri':util[_0xd3e6('0x61')]('%s%s',_0x130172,_0xd3e6('0x63')),'json':!![],'form':{'method':_0xd3e6('0x68'),'input_type':_0xd3e6('0x69'),'response_type':_0xd3e6('0x69'),'rest_data':JSON['stringify']({'session':_0x25c5c8['id'],'module_name':_0xd3e6('0x6a')})}})[_0xd3e6('0x27')](function(_0x293bb8){if(_0x293bb8){var _0x570895=_[_0xd3e6('0x6b')](_0x293bb8[_0xd3e6('0x6c')]);_[_0xd3e6('0x6d')](_0x570895,function(_0x5d00ba){return _0x2f1c5b['includes'](_0x5d00ba[_0xd3e6('0x2a')]);});return{'count':_0x570895['length'],'rows':_[_0xd3e6('0x2b')](_0x570895,function(_0x393215){return{'id':_0x393215['name'],'name':_0x393215['label'],'custom':_['endsWith'](_0x393215['name'],'_c')?!![]:![],'options':_0x393215[_0xd3e6('0x40')]?_[_0xd3e6('0x2b')](_[_0xd3e6('0x6b')](_0x393215[_0xd3e6('0x40')]),function(_0x2d87a4){return{'name':_0x2d87a4[_0xd3e6('0x6e')],'value':_0x2d87a4['name']};}):[]};})};}})['then'](respondWithResult(_0x23ec54,null))[_0xd3e6('0x43')](function(_0x3fe9b2){var _0x19a2b3=_0x1464d8['query'][_0xd3e6('0x6f')]?0x1f4:_0x3fe9b2['statusCode']||0x1f4;logger['error'](_0xd3e6('0x70'),_0xd3e6('0x71'),_0x19a2b3,JSON[_0xd3e6('0x64')](_0x3fe9b2));delete _0x3fe9b2[_0xd3e6('0x2a')];if(_0x19a2b3===0x191){_0x19a2b3=0x190;}_0x23ec54[_0xd3e6('0x1d')](_0x19a2b3)[_0xd3e6('0x72')](_0x1464d8[_0xd3e6('0x31')][_0xd3e6('0x6f')]?{'message':_0xd3e6('0x73'),'statusCode':_0x3fe9b2[_0xd3e6('0x74')]}:_0x3fe9b2);});}else{var _0x26bffd=0x1f4;_0x23ec54['status'](_0x26bffd)[_0xd3e6('0x72')]({'message':_0xd3e6('0x73'),'statusCode':0x190});}});};
\ No newline at end of file
+var _0xeafe=['includeAll','include','findAll','show','params','rawAttributes','find','catch','findOne','getConfigurations','length','addConfiguration','body','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','create','SugarcrmField','assigned_user_id','created_by','description','date_start','parent_id','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','stringify','PLAIN','Password\x20Expired','get_module_fields','JSON','Calls','values','includes','label','endsWith','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','offset','limit','count','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','SugarcrmAccount','type','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x6fd8ad,_0x597818){var _0x257d21=function(_0x2aad69){while(--_0x2aad69){_0x6fd8ad['push'](_0x6fd8ad['shift']());}};_0x257d21(++_0x597818);}(_0xeafe,0xab));var _0xeeaf=function(_0x1d0f51,_0x34667e){_0x1d0f51=_0x1d0f51-0x0;var _0x2fef1f=_0xeafe[_0x1d0f51];return _0x2fef1f;};'use strict';var emlformat=require(_0xeeaf('0x0'));var rimraf=require(_0xeeaf('0x1'));var zipdir=require(_0xeeaf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xeeaf('0x3'));var moment=require(_0xeeaf('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xeeaf('0x5'));var util=require('util');var path=require(_0xeeaf('0x6'));var sox=require(_0xeeaf('0x7'));var csv=require(_0xeeaf('0x8'));var ejs=require(_0xeeaf('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xeeaf('0xa'));var jsforce=require(_0xeeaf('0xb'));var deskjs=require(_0xeeaf('0xc'));var toCsv=require(_0xeeaf('0x8'));var querystring=require(_0xeeaf('0xd'));var Papa=require(_0xeeaf('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xeeaf('0xf'));var as=require(_0xeeaf('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeeaf('0x11'))(_0xeeaf('0x12'));var utils=require(_0xeeaf('0x13'));var config=require(_0xeeaf('0x14'));var licenseUtil=require(_0xeeaf('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xeeaf('0x16'));function respondWithStatusCode(_0x4f361b,_0x58a0aa){_0x58a0aa=_0x58a0aa||0xcc;return function(_0x2e1dd0){if(_0x2e1dd0){return _0x4f361b[_0xeeaf('0x17')](_0x58a0aa);}return _0x4f361b['status'](_0x58a0aa)[_0xeeaf('0x18')]();};}function respondWithResult(_0x2b8190,_0x2e17d0){_0x2e17d0=_0x2e17d0||0xc8;return function(_0x2c0a8f){if(_0x2c0a8f){return _0x2b8190[_0xeeaf('0x19')](_0x2e17d0)['json'](_0x2c0a8f);}};}function respondWithFilteredResult(_0x298ff2,_0x969bbe){return function(_0x529c96){if(_0x529c96){var _0x2071c9=typeof _0x969bbe[_0xeeaf('0x1a')]==='undefined'&&typeof _0x969bbe[_0xeeaf('0x1b')]==='undefined';var _0x501f1e=_0x529c96[_0xeeaf('0x1c')];var _0x53ad5c=_0x2071c9?0x0:_0x969bbe[_0xeeaf('0x1a')];var _0x17ad84=_0x2071c9?_0x529c96[_0xeeaf('0x1c')]:_0x969bbe[_0xeeaf('0x1a')]+_0x969bbe[_0xeeaf('0x1b')];var _0x5df1c0;if(_0x17ad84>=_0x501f1e){_0x17ad84=_0x501f1e;_0x5df1c0=0xc8;}else{_0x5df1c0=0xce;}_0x298ff2[_0xeeaf('0x19')](_0x5df1c0);return _0x298ff2[_0xeeaf('0x1d')](_0xeeaf('0x1e'),_0x53ad5c+'-'+_0x17ad84+'/'+_0x501f1e)[_0xeeaf('0x1f')](_0x529c96);}return null;};}function patchUpdates(_0xc29c72){return function(_0xb6d638){try{jsonpatch[_0xeeaf('0x20')](_0xb6d638,_0xc29c72,!![]);}catch(_0x515b20){return BPromise['reject'](_0x515b20);}return _0xb6d638[_0xeeaf('0x21')]();};}function saveUpdates(_0xf2b70,_0x32709d){return function(_0x3d3f28){if(_0x3d3f28){return _0x3d3f28[_0xeeaf('0x22')](_0xf2b70)[_0xeeaf('0x23')](function(_0x5a95a6){return _0x5a95a6;});}return null;};}function removeEntity(_0xa5bdf2,_0x28d498){return function(_0x3dcd1d){if(_0x3dcd1d){return _0x3dcd1d[_0xeeaf('0x24')]()[_0xeeaf('0x23')](function(){_0xa5bdf2[_0xeeaf('0x19')](0xcc)[_0xeeaf('0x18')]();});}};}function handleEntityNotFound(_0x23d7b3,_0x35661c){return function(_0x202c73){if(!_0x202c73){_0x23d7b3[_0xeeaf('0x17')](0x194);}return _0x202c73;};}function handleError(_0x42c9e7,_0x489e4e){_0x489e4e=_0x489e4e||0x1f4;return function(_0x54fc69){logger[_0xeeaf('0x25')](_0x54fc69[_0xeeaf('0x26')]);if(_0x54fc69[_0xeeaf('0x27')]){delete _0x54fc69[_0xeeaf('0x27')];}_0x42c9e7[_0xeeaf('0x19')](_0x489e4e)[_0xeeaf('0x28')](_0x54fc69);};}exports[_0xeeaf('0x29')]=function(_0x2205ca,_0x1fcc9e){var _0x28c33f={},_0x58e438={},_0x381f91={'count':0x0,'rows':[]};var _0x586963=_['map'](db[_0xeeaf('0x2a')]['rawAttributes'],function(_0x428353){return{'name':_0x428353['fieldName'],'type':_0x428353[_0xeeaf('0x2b')][_0xeeaf('0x2c')]};});_0x58e438[_0xeeaf('0x2d')]=_[_0xeeaf('0x2e')](_0x586963,_0xeeaf('0x27'));_0x58e438[_0xeeaf('0x2f')]=_[_0xeeaf('0x30')](_0x2205ca[_0xeeaf('0x2f')]);_0x58e438[_0xeeaf('0x31')]=_['intersection'](_0x58e438[_0xeeaf('0x2d')],_0x58e438[_0xeeaf('0x2f')]);_0x28c33f[_0xeeaf('0x32')]=_[_0xeeaf('0x33')](_0x58e438['model'],qs[_0xeeaf('0x34')](_0x2205ca[_0xeeaf('0x2f')]['fields']));_0x28c33f[_0xeeaf('0x32')]=_0x28c33f['attributes']['length']?_0x28c33f[_0xeeaf('0x32')]:_0x58e438[_0xeeaf('0x2d')];if(!_0x2205ca[_0xeeaf('0x2f')][_0xeeaf('0x35')](_0xeeaf('0x36'))){_0x28c33f['limit']=qs[_0xeeaf('0x1b')](_0x2205ca[_0xeeaf('0x2f')][_0xeeaf('0x1b')]);_0x28c33f[_0xeeaf('0x1a')]=qs[_0xeeaf('0x1a')](_0x2205ca[_0xeeaf('0x2f')][_0xeeaf('0x1a')]);}_0x28c33f[_0xeeaf('0x37')]=qs[_0xeeaf('0x38')](_0x2205ca[_0xeeaf('0x2f')]['sort']);_0x28c33f[_0xeeaf('0x39')]=qs[_0xeeaf('0x31')](_[_0xeeaf('0x3a')](_0x2205ca[_0xeeaf('0x2f')],_0x58e438['filters']),_0x586963);if(_0x2205ca[_0xeeaf('0x2f')][_0xeeaf('0x3b')]){_0x28c33f[_0xeeaf('0x39')]=_[_0xeeaf('0x3c')](_0x28c33f[_0xeeaf('0x39')],{'$or':_[_0xeeaf('0x2e')](_0x586963,function(_0x44bd9f){if(_0x44bd9f['type']!==_0xeeaf('0x3d')){var _0x167e0={};_0x167e0[_0x44bd9f[_0xeeaf('0x27')]]={'$like':'%'+_0x2205ca[_0xeeaf('0x2f')]['filter']+'%'};return _0x167e0;}})});}_0x28c33f=_[_0xeeaf('0x3c')]({},_0x28c33f,_0x2205ca[_0xeeaf('0x3e')]);var _0x3af7df={'where':_0x28c33f[_0xeeaf('0x39')]};return db[_0xeeaf('0x2a')][_0xeeaf('0x1c')](_0x3af7df)[_0xeeaf('0x23')](function(_0x24f473){_0x381f91[_0xeeaf('0x1c')]=_0x24f473;if(_0x2205ca[_0xeeaf('0x2f')][_0xeeaf('0x3f')]){_0x28c33f[_0xeeaf('0x40')]=[{'all':!![]}];}return db[_0xeeaf('0x2a')][_0xeeaf('0x41')](_0x28c33f);})[_0xeeaf('0x23')](function(_0x5f02e5){_0x381f91['rows']=_0x5f02e5;return _0x381f91;})[_0xeeaf('0x23')](respondWithFilteredResult(_0x1fcc9e,_0x28c33f))['catch'](handleError(_0x1fcc9e,null));};exports[_0xeeaf('0x42')]=function(_0x5d5e37,_0x23c22e){var _0xb5f88={'raw':![],'where':{'id':_0x5d5e37[_0xeeaf('0x43')]['id']}},_0x1b780a={};_0x1b780a[_0xeeaf('0x2d')]=_['keys'](db[_0xeeaf('0x2a')][_0xeeaf('0x44')]);_0x1b780a[_0xeeaf('0x2f')]=_[_0xeeaf('0x30')](_0x5d5e37[_0xeeaf('0x2f')]);_0x1b780a[_0xeeaf('0x31')]=_[_0xeeaf('0x33')](_0x1b780a[_0xeeaf('0x2d')],_0x1b780a['query']);_0xb5f88[_0xeeaf('0x32')]=_[_0xeeaf('0x33')](_0x1b780a[_0xeeaf('0x2d')],qs['fields'](_0x5d5e37['query']['fields']));_0xb5f88[_0xeeaf('0x32')]=_0xb5f88[_0xeeaf('0x32')]['length']?_0xb5f88[_0xeeaf('0x32')]:_0x1b780a['model'];if(_0x5d5e37[_0xeeaf('0x2f')]['includeAll']){_0xb5f88[_0xeeaf('0x40')]=[{'all':!![]}];}_0xb5f88=_['merge']({},_0xb5f88,_0x5d5e37['options']);return db[_0xeeaf('0x2a')][_0xeeaf('0x45')](_0xb5f88)[_0xeeaf('0x23')](handleEntityNotFound(_0x23c22e,null))[_0xeeaf('0x23')](respondWithResult(_0x23c22e,null))['catch'](handleError(_0x23c22e,null));};exports['create']=function(_0x338095,_0x2bac4e){return db[_0xeeaf('0x2a')]['create'](_0x338095['body'],{})['then'](respondWithResult(_0x2bac4e,0xc9))[_0xeeaf('0x46')](handleError(_0x2bac4e,null));};exports[_0xeeaf('0x22')]=function(_0x46d82c,_0x4d5fce){if(_0x46d82c['body']['id']){delete _0x46d82c['body']['id'];}return db[_0xeeaf('0x2a')][_0xeeaf('0x45')]({'where':{'id':_0x46d82c[_0xeeaf('0x43')]['id']}})[_0xeeaf('0x23')](handleEntityNotFound(_0x4d5fce,null))[_0xeeaf('0x23')](saveUpdates(_0x46d82c['body'],null))[_0xeeaf('0x23')](respondWithResult(_0x4d5fce,null))[_0xeeaf('0x46')](handleError(_0x4d5fce,null));};exports[_0xeeaf('0x24')]=function(_0x1a34b0,_0x34c1fe){return db['SugarcrmAccount'][_0xeeaf('0x45')]({'where':{'id':_0x1a34b0['params']['id']}})[_0xeeaf('0x23')](handleEntityNotFound(_0x34c1fe,null))[_0xeeaf('0x23')](removeEntity(_0x34c1fe,null))[_0xeeaf('0x46')](handleError(_0x34c1fe,null));};exports['getConfigurations']=function(_0x37e54e,_0xc2ef80,_0x18df55){var _0x3195ef={};var _0x5b7a5e={};var _0x3722aa;var _0x59fa6f;return db[_0xeeaf('0x2a')][_0xeeaf('0x47')]({'where':{'id':_0x37e54e[_0xeeaf('0x43')]['id']}})['then'](handleEntityNotFound(_0xc2ef80,null))[_0xeeaf('0x23')](function(_0x16349d){if(_0x16349d){_0x3722aa=_0x16349d;_0x5b7a5e[_0xeeaf('0x2d')]=_['keys'](db['SugarcrmConfiguration']['rawAttributes']);_0x5b7a5e['query']=_[_0xeeaf('0x30')](_0x37e54e[_0xeeaf('0x2f')]);_0x5b7a5e[_0xeeaf('0x31')]=_[_0xeeaf('0x33')](_0x5b7a5e[_0xeeaf('0x2d')],_0x5b7a5e['query']);_0x3195ef['attributes']=_[_0xeeaf('0x33')](_0x5b7a5e[_0xeeaf('0x2d')],qs[_0xeeaf('0x34')](_0x37e54e['query'][_0xeeaf('0x34')]));_0x3195ef[_0xeeaf('0x32')]=_0x3195ef[_0xeeaf('0x32')]['length']?_0x3195ef[_0xeeaf('0x32')]:_0x5b7a5e['model'];_0x3195ef[_0xeeaf('0x37')]=qs[_0xeeaf('0x38')](_0x37e54e[_0xeeaf('0x2f')][_0xeeaf('0x38')]);_0x3195ef[_0xeeaf('0x39')]=qs[_0xeeaf('0x31')](_['pick'](_0x37e54e[_0xeeaf('0x2f')],_0x5b7a5e[_0xeeaf('0x31')]));if(_0x37e54e[_0xeeaf('0x2f')][_0xeeaf('0x3b')]){_0x3195ef[_0xeeaf('0x39')]=_['merge'](_0x3195ef[_0xeeaf('0x39')],{'$or':_['map'](_0x3195ef['attributes'],function(_0x256613){var _0x47fe8b={};_0x47fe8b[_0x256613]={'$like':'%'+_0x37e54e[_0xeeaf('0x2f')]['filter']+'%'};return _0x47fe8b;})});}_0x3195ef=_[_0xeeaf('0x3c')]({},_0x3195ef,_0x37e54e[_0xeeaf('0x3e')]);return _0x3722aa[_0xeeaf('0x48')](_0x3195ef);}})['then'](function(_0x5389ff){if(_0x5389ff){_0x59fa6f=_0x5389ff[_0xeeaf('0x49')];if(!_0x37e54e[_0xeeaf('0x2f')][_0xeeaf('0x35')]('nolimit')){_0x3195ef[_0xeeaf('0x1b')]=qs[_0xeeaf('0x1b')](_0x37e54e[_0xeeaf('0x2f')][_0xeeaf('0x1b')]);_0x3195ef[_0xeeaf('0x1a')]=qs[_0xeeaf('0x1a')](_0x37e54e[_0xeeaf('0x2f')][_0xeeaf('0x1a')]);}return _0x3722aa[_0xeeaf('0x48')](_0x3195ef);}})['then'](function(_0x355867){if(_0x355867){return _0x355867?{'count':_0x59fa6f,'rows':_0x355867}:null;}})[_0xeeaf('0x23')](respondWithResult(_0xc2ef80,null))['catch'](handleError(_0xc2ef80,null));};exports[_0xeeaf('0x4a')]=function(_0x4badb2,_0x3359f8,_0x1f9e85){if(_0x4badb2[_0xeeaf('0x4b')]['id']){delete _0x4badb2[_0xeeaf('0x4b')]['id'];}return db[_0xeeaf('0x2a')]['findOne']({'where':{'id':_0x4badb2[_0xeeaf('0x43')]['id']}})[_0xeeaf('0x23')](handleEntityNotFound(_0x3359f8,null))[_0xeeaf('0x23')](function(_0x25ea4a){if(_0x25ea4a){_0x4badb2[_0xeeaf('0x4b')][_0xeeaf('0x4c')]=_0x25ea4a['id'];_0x4badb2['body'][_0xeeaf('0x4d')]=integrations[_0xeeaf('0x4e')](_0x4badb2[_0xeeaf('0x4b')][_0xeeaf('0x4f')],_0x4badb2[_0xeeaf('0x4b')][_0xeeaf('0x2b')]);_0x4badb2[_0xeeaf('0x4b')][_0xeeaf('0x50')]=integrations[_0xeeaf('0x51')](_0x4badb2[_0xeeaf('0x4b')][_0xeeaf('0x4f')],_0x4badb2['body']['type']);return db['SugarcrmConfiguration'][_0xeeaf('0x52')](_0x4badb2[_0xeeaf('0x4b')],{'include':[{'model':db['SugarcrmField'],'as':_0xeeaf('0x4d')},{'model':db[_0xeeaf('0x53')],'as':'Descriptions'}]});}return null;})[_0xeeaf('0x23')](respondWithResult(_0x3359f8,null))[_0xeeaf('0x46')](handleError(_0x3359f8,null));};exports['getFields']=function(_0x4208bb,_0x3cd70f,_0x6f140d){var _0x252858='';var _0x3da377=['id',_0xeeaf('0x27'),_0xeeaf('0x54'),_0xeeaf('0x55'),_0xeeaf('0x56'),_0xeeaf('0x57'),'duration_hours','duration_minutes',_0xeeaf('0x58'),'parent_type',_0xeeaf('0x59'),_0xeeaf('0x5a')];return db['SugarcrmAccount'][_0xeeaf('0x47')]({'where':{'id':_0x4208bb[_0xeeaf('0x43')]['id']},'attributes':['id',_0xeeaf('0x5b'),_0xeeaf('0x5c'),_0xeeaf('0x5d')]})[_0xeeaf('0x23')](handleEntityNotFound(_0x3cd70f,null))['then'](function(_0x3137b1){if(_0x3137b1){_0x252858=_0x3137b1['remoteUri'];var _0x409b14=_0x252858[_0xeeaf('0x5e')](-0x1);if(_0x409b14==='/'){_0x252858=_0x252858[_0xeeaf('0x5f')](0x0,_0x252858[_0xeeaf('0x60')](_0x409b14));}return rp({'method':_0xeeaf('0x61'),'uri':util[_0xeeaf('0x62')](_0xeeaf('0x63'),_0x252858,_0xeeaf('0x64')),'json':!![],'form':{'method':_0xeeaf('0x65'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xeeaf('0x66')]({'user_auth':{'user_name':_0x3137b1['username'],'password':_0x3137b1[_0xeeaf('0x5c')],'encryption':_0xeeaf('0x67')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0xeeaf('0x23')](function(_0x358ac5){if(_0x358ac5&&_0x358ac5['name']!=='Invalid\x20Login'&&_0x358ac5[_0xeeaf('0x27')]!==_0xeeaf('0x68')){return rp({'method':_0xeeaf('0x61'),'uri':util[_0xeeaf('0x62')](_0xeeaf('0x63'),_0x252858,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xeeaf('0x69'),'input_type':_0xeeaf('0x6a'),'response_type':_0xeeaf('0x6a'),'rest_data':JSON['stringify']({'session':_0x358ac5['id'],'module_name':_0xeeaf('0x6b')})}})['then'](function(_0x42bdaa){if(_0x42bdaa){var _0x14a7d4=_[_0xeeaf('0x6c')](_0x42bdaa['module_fields']);_['remove'](_0x14a7d4,function(_0x28318f){return _0x3da377[_0xeeaf('0x6d')](_0x28318f[_0xeeaf('0x27')]);});return{'count':_0x14a7d4[_0xeeaf('0x49')],'rows':_[_0xeeaf('0x2e')](_0x14a7d4,function(_0x406062){return{'id':_0x406062[_0xeeaf('0x27')],'name':_0x406062[_0xeeaf('0x6e')],'custom':_[_0xeeaf('0x6f')](_0x406062[_0xeeaf('0x27')],'_c')?!![]:![],'options':_0x406062[_0xeeaf('0x3e')]?_[_0xeeaf('0x2e')](_[_0xeeaf('0x6c')](_0x406062[_0xeeaf('0x3e')]),function(_0x9fd839){return{'name':_0x9fd839['value'],'value':_0x9fd839[_0xeeaf('0x27')]};}):[]};})};}})[_0xeeaf('0x23')](respondWithResult(_0x3cd70f,null))[_0xeeaf('0x46')](function(_0x3f84e9){var _0x3c66e9=_0x4208bb[_0xeeaf('0x2f')][_0xeeaf('0x70')]?0x1f4:_0x3f84e9[_0xeeaf('0x71')]||0x1f4;logger[_0xeeaf('0x25')](_0xeeaf('0x72'),_0xeeaf('0x73'),_0x3c66e9,JSON[_0xeeaf('0x66')](_0x3f84e9));delete _0x3f84e9[_0xeeaf('0x27')];if(_0x3c66e9===0x191){_0x3c66e9=0x190;}_0x3cd70f['status'](_0x3c66e9)['send'](_0x4208bb['query']['test']?{'message':_0xeeaf('0x74'),'statusCode':_0x3f84e9[_0xeeaf('0x71')]}:_0x3f84e9);});}else{var _0x335124=0x1f4;_0x3cd70f[_0xeeaf('0x19')](_0x335124)[_0xeeaf('0x28')]({'message':_0xeeaf('0x74'),'statusCode':0x190});}});};
\ No newline at end of file
index 6000370..bbc8cdc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x51eb=['moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','SugarcrmAccount','lodash','util'];(function(_0x1e3ff6,_0x1ec862){var _0x777bbe=function(_0x240838){while(--_0x240838){_0x1e3ff6['push'](_0x1e3ff6['shift']());}};_0x777bbe(++_0x1ec862);}(_0x51eb,0x169));var _0xb51e=function(_0x55098d,_0x7570c1){_0x55098d=_0x55098d-0x0;var _0x1a67d=_0x51eb[_0x55098d];return _0x1a67d;};'use strict';var _=require(_0xb51e('0x0'));var util=require(_0xb51e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb51e('0x2'));var BPromise=require(_0xb51e('0x3'));var rp=require(_0xb51e('0x4'));var fs=require('fs');var path=require(_0xb51e('0x5'));var rimraf=require(_0xb51e('0x6'));var config=require(_0xb51e('0x7'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0xb51e('0x8'));module[_0xb51e('0x9')]=function(_0x3bd399,_0x28ccee){return _0x3bd399['define'](_0xb51e('0xa'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x55a6=['../../components/integrations/configuration','exports','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intSugarcrmAccount.attributes'];(function(_0x38a416,_0x1e2f6b){var _0xa11bee=function(_0x15d8d8){while(--_0x15d8d8){_0x38a416['push'](_0x38a416['shift']());}};_0xa11bee(++_0x1e2f6b);}(_0x55a6,0x74));var _0x655a=function(_0x25bc7b,_0x1584e1){_0x25bc7b=_0x25bc7b-0x0;var _0x3c8d72=_0x55a6[_0x25bc7b];return _0x3c8d72;};'use strict';var _=require(_0x655a('0x0'));var util=require(_0x655a('0x1'));var logger=require(_0x655a('0x2'))(_0x655a('0x3'));var moment=require(_0x655a('0x4'));var BPromise=require(_0x655a('0x5'));var rp=require(_0x655a('0x6'));var fs=require('fs');var path=require(_0x655a('0x7'));var rimraf=require(_0x655a('0x8'));var config=require('../../config/environment');var attributes=require(_0x655a('0x9'));var integrations=require(_0x655a('0xa'));module[_0x655a('0xb')]=function(_0x3be7ff,_0xd5861a){return _0x3be7ff['define'](_0x655a('0xc'),attributes,{'tableName':_0x655a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 067d921..7384838 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4d4=['raw','where','attributes','limit','include','model','map','find','ShowSugarcrmAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options'];(function(_0x3f3ec0,_0x358663){var _0x318626=function(_0x560fee){while(--_0x560fee){_0x3f3ec0['push'](_0x3f3ec0['shift']());}};_0x318626(++_0x358663);}(_0xb4d4,0xe1));var _0x4b4d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb4d4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4b4d('0x0'));var util=require(_0x4b4d('0x1'));var moment=require(_0x4b4d('0x2'));var BPromise=require('bluebird');var rs=require(_0x4b4d('0x3'));var fs=require('fs');var Redis=require(_0x4b4d('0x4'));var db=require(_0x4b4d('0x5'))['db'];var utils=require(_0x4b4d('0x6'));var logger=require('../../config/logger')(_0x4b4d('0x7'));var config=require(_0x4b4d('0x8'));var jayson=require(_0x4b4d('0x9'));var client=jayson[_0x4b4d('0xa')][_0x4b4d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19e9d1,_0x1455c2,_0x3080c0){return new BPromise(function(_0x278eda,_0x44fe61){return client[_0x4b4d('0xc')](_0x19e9d1,_0x3080c0)[_0x4b4d('0xd')](function(_0x3e5cfa){logger[_0x4b4d('0xe')](_0x4b4d('0xf'),_0x1455c2,_0x4b4d('0x10'));logger[_0x4b4d('0x11')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x1455c2,_0x4b4d('0x10'),JSON[_0x4b4d('0x12')](_0x3e5cfa));if(_0x3e5cfa['error']){if(_0x3e5cfa[_0x4b4d('0x13')]['code']===0x1f4){logger[_0x4b4d('0x13')]('SugarcrmAccount,\x20%s,\x20%s',_0x1455c2,_0x3e5cfa[_0x4b4d('0x13')][_0x4b4d('0x14')]);return _0x44fe61(_0x3e5cfa['error'][_0x4b4d('0x14')]);}logger['error'](_0x4b4d('0xf'),_0x1455c2,_0x3e5cfa[_0x4b4d('0x13')][_0x4b4d('0x14')]);return _0x278eda(_0x3e5cfa['error']['message']);}else{logger['info'](_0x4b4d('0xf'),_0x1455c2,_0x4b4d('0x10'));_0x278eda(_0x3e5cfa[_0x4b4d('0x15')]['message']);}})[_0x4b4d('0x16')](function(_0x44edaa){logger[_0x4b4d('0x13')](_0x4b4d('0xf'),_0x1455c2,_0x44edaa);_0x44fe61(_0x44edaa);});});}exports[_0x4b4d('0x17')]=function(_0x56cbf0){var _0x44874c=this;return new Promise(function(_0x226916,_0x426337){return db[_0x4b4d('0x18')][_0x4b4d('0x19')]({'raw':_0x56cbf0[_0x4b4d('0x1a')]?_0x56cbf0[_0x4b4d('0x1a')][_0x4b4d('0x1b')]===undefined?!![]:![]:!![],'where':_0x56cbf0[_0x4b4d('0x1a')]?_0x56cbf0['options'][_0x4b4d('0x1c')]||null:null,'attributes':_0x56cbf0['options']?_0x56cbf0[_0x4b4d('0x1a')][_0x4b4d('0x1d')]||null:null,'limit':_0x56cbf0[_0x4b4d('0x1a')]?_0x56cbf0[_0x4b4d('0x1a')][_0x4b4d('0x1e')]||null:null,'include':_0x56cbf0['options']?_0x56cbf0[_0x4b4d('0x1a')][_0x4b4d('0x1f')]?_['map'](_0x56cbf0[_0x4b4d('0x1a')]['include'],function(_0x2ca490){return{'model':db[_0x2ca490[_0x4b4d('0x20')]],'as':_0x2ca490['as'],'attributes':_0x2ca490[_0x4b4d('0x1d')],'include':_0x2ca490[_0x4b4d('0x1f')]?_[_0x4b4d('0x21')](_0x2ca490[_0x4b4d('0x1f')],function(_0x5caaf1){return{'model':db[_0x5caaf1[_0x4b4d('0x20')]],'as':_0x5caaf1['as'],'attributes':_0x5caaf1[_0x4b4d('0x1d')],'include':_0x5caaf1[_0x4b4d('0x1f')]?_['map'](_0x5caaf1[_0x4b4d('0x1f')],function(_0x1d223e){return{'model':db[_0x1d223e[_0x4b4d('0x20')]],'as':_0x1d223e['as'],'attributes':_0x1d223e[_0x4b4d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x4b4d('0xd')](function(_0x33c339){logger[_0x4b4d('0xe')](_0x4b4d('0x17'),_0x56cbf0);logger['debug'](_0x4b4d('0x17'),_0x56cbf0,JSON['stringify'](_0x33c339));_0x226916(_0x33c339);})[_0x4b4d('0x16')](function(_0x3097a3){logger[_0x4b4d('0x13')](_0x4b4d('0x17'),_0x3097a3[_0x4b4d('0x14')],_0x56cbf0);_0x426337(_0x44874c[_0x4b4d('0x13')](0x1f4,_0x3097a3[_0x4b4d('0x14')]));});});};exports['ShowSugarcrmAccount']=function(_0x2e86fe){var _0x30c090=this;return new Promise(function(_0x304cca,_0x48d9ef){return db[_0x4b4d('0x18')][_0x4b4d('0x22')]({'raw':_0x2e86fe[_0x4b4d('0x1a')]?_0x2e86fe[_0x4b4d('0x1a')][_0x4b4d('0x1b')]===undefined?!![]:![]:!![],'where':_0x2e86fe[_0x4b4d('0x1a')]?_0x2e86fe[_0x4b4d('0x1a')]['where']||null:null,'attributes':_0x2e86fe[_0x4b4d('0x1a')]?_0x2e86fe[_0x4b4d('0x1a')][_0x4b4d('0x1d')]||null:null,'include':_0x2e86fe[_0x4b4d('0x1a')]?_0x2e86fe['options'][_0x4b4d('0x1f')]?_[_0x4b4d('0x21')](_0x2e86fe['options'][_0x4b4d('0x1f')],function(_0x18c3b5){return{'model':db[_0x18c3b5[_0x4b4d('0x20')]],'as':_0x18c3b5['as'],'attributes':_0x18c3b5[_0x4b4d('0x1d')],'include':_0x18c3b5[_0x4b4d('0x1f')]?_[_0x4b4d('0x21')](_0x18c3b5[_0x4b4d('0x1f')],function(_0x121424){return{'model':db[_0x121424[_0x4b4d('0x20')]],'as':_0x121424['as'],'attributes':_0x121424[_0x4b4d('0x1d')],'include':_0x121424[_0x4b4d('0x1f')]?_[_0x4b4d('0x21')](_0x121424[_0x4b4d('0x1f')],function(_0x3dc72e){return{'model':db[_0x3dc72e[_0x4b4d('0x20')]],'as':_0x3dc72e['as'],'attributes':_0x3dc72e[_0x4b4d('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x54882d){logger[_0x4b4d('0xe')](_0x4b4d('0x23'),_0x2e86fe);logger[_0x4b4d('0x11')](_0x4b4d('0x23'),_0x2e86fe,JSON[_0x4b4d('0x12')](_0x54882d));_0x304cca(_0x54882d);})['catch'](function(_0x510ec9){logger[_0x4b4d('0x13')]('ShowSugarcrmAccount',_0x510ec9[_0x4b4d('0x14')],_0x2e86fe);_0x48d9ef(_0x30c090[_0x4b4d('0x13')](0x1f4,_0x510ec9['message']));});});};
\ No newline at end of file
+var _0x4a73=['request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','SugarcrmAccount','findAll','options','raw','attributes','limit','map','include','model','GetSugarcrmAccount','stringify','find','where','ShowSugarcrmAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','request','then','info','SugarcrmAccount,\x20%s,\x20%s'];(function(_0x4372f3,_0x4e9886){var _0x24329d=function(_0x5ec5e6){while(--_0x5ec5e6){_0x4372f3['push'](_0x4372f3['shift']());}};_0x24329d(++_0x4e9886);}(_0x4a73,0x17e));var _0x34a7=function(_0x442416,_0x24a1f7){_0x442416=_0x442416-0x0;var _0x30b798=_0x4a73[_0x442416];return _0x30b798;};'use strict';var _=require(_0x34a7('0x0'));var util=require(_0x34a7('0x1'));var moment=require(_0x34a7('0x2'));var BPromise=require(_0x34a7('0x3'));var rs=require(_0x34a7('0x4'));var fs=require('fs');var Redis=require(_0x34a7('0x5'));var db=require(_0x34a7('0x6'))['db'];var utils=require(_0x34a7('0x7'));var logger=require('../../config/logger')(_0x34a7('0x8'));var config=require(_0x34a7('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xdabac0,_0x1e9925,_0x2a6d16){return new BPromise(function(_0x1efa7a,_0x1d2f43){return client[_0x34a7('0xa')](_0xdabac0,_0x2a6d16)[_0x34a7('0xb')](function(_0x3f1454){logger[_0x34a7('0xc')](_0x34a7('0xd'),_0x1e9925,_0x34a7('0xe'));logger[_0x34a7('0xf')](_0x34a7('0x10'),_0x1e9925,'request\x20sent',JSON['stringify'](_0x3f1454));if(_0x3f1454[_0x34a7('0x11')]){if(_0x3f1454[_0x34a7('0x11')][_0x34a7('0x12')]===0x1f4){logger['error'](_0x34a7('0xd'),_0x1e9925,_0x3f1454[_0x34a7('0x11')]['message']);return _0x1d2f43(_0x3f1454[_0x34a7('0x11')]['message']);}logger[_0x34a7('0x11')](_0x34a7('0xd'),_0x1e9925,_0x3f1454['error'][_0x34a7('0x13')]);return _0x1efa7a(_0x3f1454['error'][_0x34a7('0x13')]);}else{logger[_0x34a7('0xc')](_0x34a7('0xd'),_0x1e9925,_0x34a7('0xe'));_0x1efa7a(_0x3f1454[_0x34a7('0x14')]['message']);}})[_0x34a7('0x15')](function(_0x2b4975){logger[_0x34a7('0x11')](_0x34a7('0xd'),_0x1e9925,_0x2b4975);_0x1d2f43(_0x2b4975);});});}exports['GetSugarcrmAccount']=function(_0x3490c3){var _0x31818f=this;return new Promise(function(_0x5b12fa,_0xe187c6){return db[_0x34a7('0x16')][_0x34a7('0x17')]({'raw':_0x3490c3['options']?_0x3490c3[_0x34a7('0x18')][_0x34a7('0x19')]===undefined?!![]:![]:!![],'where':_0x3490c3[_0x34a7('0x18')]?_0x3490c3['options']['where']||null:null,'attributes':_0x3490c3[_0x34a7('0x18')]?_0x3490c3[_0x34a7('0x18')][_0x34a7('0x1a')]||null:null,'limit':_0x3490c3[_0x34a7('0x18')]?_0x3490c3[_0x34a7('0x18')][_0x34a7('0x1b')]||null:null,'include':_0x3490c3['options']?_0x3490c3[_0x34a7('0x18')]['include']?_[_0x34a7('0x1c')](_0x3490c3[_0x34a7('0x18')][_0x34a7('0x1d')],function(_0x54ac14){return{'model':db[_0x54ac14[_0x34a7('0x1e')]],'as':_0x54ac14['as'],'attributes':_0x54ac14['attributes'],'include':_0x54ac14[_0x34a7('0x1d')]?_[_0x34a7('0x1c')](_0x54ac14[_0x34a7('0x1d')],function(_0xbff083){return{'model':db[_0xbff083[_0x34a7('0x1e')]],'as':_0xbff083['as'],'attributes':_0xbff083['attributes'],'include':_0xbff083[_0x34a7('0x1d')]?_[_0x34a7('0x1c')](_0xbff083[_0x34a7('0x1d')],function(_0x25601c){return{'model':db[_0x25601c['model']],'as':_0x25601c['as'],'attributes':_0x25601c[_0x34a7('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x34a7('0xb')](function(_0x1e086a){logger[_0x34a7('0xc')](_0x34a7('0x1f'),_0x3490c3);logger['debug'](_0x34a7('0x1f'),_0x3490c3,JSON[_0x34a7('0x20')](_0x1e086a));_0x5b12fa(_0x1e086a);})[_0x34a7('0x15')](function(_0x37eb25){logger[_0x34a7('0x11')](_0x34a7('0x1f'),_0x37eb25[_0x34a7('0x13')],_0x3490c3);_0xe187c6(_0x31818f[_0x34a7('0x11')](0x1f4,_0x37eb25[_0x34a7('0x13')]));});});};exports['ShowSugarcrmAccount']=function(_0x24d9f0){var _0x4e5722=this;return new Promise(function(_0x330f6e,_0x284f5b){return db['SugarcrmAccount'][_0x34a7('0x21')]({'raw':_0x24d9f0['options']?_0x24d9f0[_0x34a7('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x24d9f0[_0x34a7('0x18')]?_0x24d9f0[_0x34a7('0x18')][_0x34a7('0x22')]||null:null,'attributes':_0x24d9f0['options']?_0x24d9f0['options'][_0x34a7('0x1a')]||null:null,'include':_0x24d9f0['options']?_0x24d9f0[_0x34a7('0x18')][_0x34a7('0x1d')]?_[_0x34a7('0x1c')](_0x24d9f0[_0x34a7('0x18')][_0x34a7('0x1d')],function(_0x11ac09){return{'model':db[_0x11ac09[_0x34a7('0x1e')]],'as':_0x11ac09['as'],'attributes':_0x11ac09[_0x34a7('0x1a')],'include':_0x11ac09[_0x34a7('0x1d')]?_[_0x34a7('0x1c')](_0x11ac09['include'],function(_0x1e8869){return{'model':db[_0x1e8869[_0x34a7('0x1e')]],'as':_0x1e8869['as'],'attributes':_0x1e8869[_0x34a7('0x1a')],'include':_0x1e8869['include']?_[_0x34a7('0x1c')](_0x1e8869['include'],function(_0x29addd){return{'model':db[_0x29addd['model']],'as':_0x29addd['as'],'attributes':_0x29addd['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e1973){logger[_0x34a7('0xc')]('ShowSugarcrmAccount',_0x24d9f0);logger['debug'](_0x34a7('0x23'),_0x24d9f0,JSON[_0x34a7('0x20')](_0x5e1973));_0x330f6e(_0x5e1973);})[_0x34a7('0x15')](function(_0x105f12){logger[_0x34a7('0x11')]('ShowSugarcrmAccount',_0x105f12[_0x34a7('0x13')],_0x24d9f0);_0x284f5b(_0x4e5722[_0x34a7('0x11')](0x1f4,_0x105f12[_0x34a7('0x13')]));});});};
\ No newline at end of file
index dac2f89..c6e2d62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x302a=['/:id','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','isAuthenticated','index','get','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','update','delete'];(function(_0x17b0d4,_0x377add){var _0x2d02c7=function(_0x56e627){while(--_0x56e627){_0x17b0d4['push'](_0x17b0d4['shift']());}};_0x2d02c7(++_0x377add);}(_0x302a,0x1bd));var _0xa302=function(_0x39bd22,_0x4d8cdb){_0x39bd22=_0x39bd22-0x0;var _0x4e9b55=_0x302a[_0x39bd22];return _0x4e9b55;};'use strict';var multer=require(_0xa302('0x0'));var util=require(_0xa302('0x1'));var path=require(_0xa302('0x2'));var timeout=require('connect-timeout');var express=require(_0xa302('0x3'));var router=express[_0xa302('0x4')]();var fs_extra=require(_0xa302('0x5'));var auth=require(_0xa302('0x6'));var interaction=require(_0xa302('0x7'));var config=require('../../config/environment');var controller=require(_0xa302('0x8'));router['get']('/',auth[_0xa302('0x9')](),controller[_0xa302('0xa')]);router[_0xa302('0xb')]('/:id',auth[_0xa302('0x9')](),controller[_0xa302('0xc')]);router[_0xa302('0xb')](_0xa302('0xd'),auth[_0xa302('0x9')](),controller[_0xa302('0xe')]);router[_0xa302('0xb')](_0xa302('0xf'),auth[_0xa302('0x9')](),controller[_0xa302('0x10')]);router[_0xa302('0xb')]('/:id/descriptions',auth[_0xa302('0x9')](),controller[_0xa302('0x11')]);router[_0xa302('0x12')]('/',auth[_0xa302('0x9')](),controller[_0xa302('0x13')]);router[_0xa302('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xa302('0x15')]);router[_0xa302('0x16')](_0xa302('0x17'),auth[_0xa302('0x9')](),controller[_0xa302('0x18')]);module[_0xa302('0x19')]=router;
\ No newline at end of file
+var _0xae52=['getSubjects','/:id/descriptions','getDescriptions','post','/:id','update','destroy','exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects'];(function(_0x383b01,_0x23f840){var _0x23688d=function(_0x14d689){while(--_0x14d689){_0x383b01['push'](_0x383b01['shift']());}};_0x23688d(++_0x23f840);}(_0xae52,0x12e));var _0x2ae5=function(_0x4c0622,_0x5dacaf){_0x4c0622=_0x4c0622-0x0;var _0x1799d8=_0xae52[_0x4c0622];return _0x1799d8;};'use strict';var multer=require(_0x2ae5('0x0'));var util=require('util');var path=require(_0x2ae5('0x1'));var timeout=require('connect-timeout');var express=require(_0x2ae5('0x2'));var router=express['Router']();var fs_extra=require(_0x2ae5('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2ae5('0x4'));var config=require(_0x2ae5('0x5'));var controller=require('./intSugarcrmConfiguration.controller');router[_0x2ae5('0x6')]('/',auth[_0x2ae5('0x7')](),controller[_0x2ae5('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x2ae5('0x9')]);router[_0x2ae5('0x6')](_0x2ae5('0xa'),auth[_0x2ae5('0x7')](),controller[_0x2ae5('0xb')]);router[_0x2ae5('0x6')](_0x2ae5('0xc'),auth[_0x2ae5('0x7')](),controller[_0x2ae5('0xd')]);router[_0x2ae5('0x6')](_0x2ae5('0xe'),auth[_0x2ae5('0x7')](),controller[_0x2ae5('0xf')]);router[_0x2ae5('0x10')]('/',auth[_0x2ae5('0x7')](),controller['create']);router['put'](_0x2ae5('0x11'),auth[_0x2ae5('0x7')](),controller[_0x2ae5('0x12')]);router['delete'](_0x2ae5('0x11'),auth['isAuthenticated'](),controller[_0x2ae5('0x13')]);module[_0x2ae5('0x14')]=router;
\ No newline at end of file
index 6b20f7f..7c81ec4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbab6=['sequelize','STRING'];(function(_0x340581,_0x102648){var _0x162282=function(_0x17970c){while(--_0x17970c){_0x340581['push'](_0x340581['shift']());}};_0x162282(++_0x102648);}(_0xbab6,0x144));var _0x6bab=function(_0x2237f4,_0x236af6){_0x2237f4=_0x2237f4-0x0;var _0x2d73b0=_0xbab6[_0x2237f4];return _0x2d73b0;};'use strict';var Sequelize=require(_0x6bab('0x0'));module['exports']={'name':{'type':Sequelize[_0x6bab('0x1')]},'description':{'type':Sequelize[_0x6bab('0x1')]}};
\ No newline at end of file
+var _0x51ac=['exports','STRING'];(function(_0x15ff4b,_0x3619c1){var _0x246123=function(_0x421715){while(--_0x421715){_0x15ff4b['push'](_0x15ff4b['shift']());}};_0x246123(++_0x3619c1);}(_0x51ac,0x132));var _0xc51a=function(_0x55e75c,_0x51cb2d){_0x55e75c=_0x55e75c-0x0;var _0x24f4bd=_0x51ac[_0x55e75c];return _0x24f4bd;};'use strict';var Sequelize=require('sequelize');module[_0xc51a('0x0')]={'name':{'type':Sequelize[_0xc51a('0x1')]},'description':{'type':Sequelize[_0xc51a('0x1')]}};
\ No newline at end of file
index 654e11e..9fd86a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe4fb=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','options','SugarcrmConfiguration','includeAll','include','findAll','rows','catch','show','params','fields','length','merge','find','create','body','getFields','findOne','getSubjects','SugarcrmField','getDescriptions','order','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs'];(function(_0x685aa8,_0x36117b){var _0x4090d7=function(_0x29c421){while(--_0x29c421){_0x685aa8['push'](_0x685aa8['shift']());}};_0x4090d7(++_0x36117b);}(_0xe4fb,0x137));var _0xbe4f=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xe4fb[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbe4f('0x0'));var zipdir=require(_0xbe4f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbe4f('0x2'));var moment=require(_0xbe4f('0x3'));var BPromise=require(_0xbe4f('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbe4f('0x5'));var sox=require(_0xbe4f('0x6'));var csv=require(_0xbe4f('0x7'));var ejs=require(_0xbe4f('0x8'));var fs=require('fs');var fs_extra=require(_0xbe4f('0x9'));var _=require(_0xbe4f('0xa'));var squel=require(_0xbe4f('0xb'));var crypto=require(_0xbe4f('0xc'));var jsforce=require(_0xbe4f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xbe4f('0x7'));var querystring=require(_0xbe4f('0xe'));var Papa=require(_0xbe4f('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbe4f('0x10'));var as=require(_0xbe4f('0x11'));var hardwareService=require(_0xbe4f('0x12'));var logger=require(_0xbe4f('0x13'))(_0xbe4f('0x14'));var utils=require(_0xbe4f('0x15'));var config=require(_0xbe4f('0x16'));var licenseUtil=require(_0xbe4f('0x17'));var db=require(_0xbe4f('0x18'))['db'];function respondWithStatusCode(_0x12b372,_0x2dc8c6){_0x2dc8c6=_0x2dc8c6||0xcc;return function(_0x56c204){if(_0x56c204){return _0x12b372[_0xbe4f('0x19')](_0x2dc8c6);}return _0x12b372[_0xbe4f('0x1a')](_0x2dc8c6)['end']();};}function respondWithResult(_0x6bf708,_0x5c59dd){_0x5c59dd=_0x5c59dd||0xc8;return function(_0x3cd8e7){if(_0x3cd8e7){return _0x6bf708['status'](_0x5c59dd)[_0xbe4f('0x1b')](_0x3cd8e7);}};}function respondWithFilteredResult(_0x23a38e,_0x3494bd){return function(_0x235304){if(_0x235304){var _0x29def0=typeof _0x3494bd[_0xbe4f('0x1c')]==='undefined'&&typeof _0x3494bd[_0xbe4f('0x1d')]===_0xbe4f('0x1e');var _0x155348=_0x235304[_0xbe4f('0x1f')];var _0x1a6beb=_0x29def0?0x0:_0x3494bd['offset'];var _0xcd136=_0x29def0?_0x235304['count']:_0x3494bd['offset']+_0x3494bd[_0xbe4f('0x1d')];var _0x33175e;if(_0xcd136>=_0x155348){_0xcd136=_0x155348;_0x33175e=0xc8;}else{_0x33175e=0xce;}_0x23a38e[_0xbe4f('0x1a')](_0x33175e);return _0x23a38e['set'](_0xbe4f('0x20'),_0x1a6beb+'-'+_0xcd136+'/'+_0x155348)[_0xbe4f('0x1b')](_0x235304);}return null;};}function patchUpdates(_0xd7ae13){return function(_0x464d1e){try{jsonpatch[_0xbe4f('0x21')](_0x464d1e,_0xd7ae13,!![]);}catch(_0x325f4e){return BPromise[_0xbe4f('0x22')](_0x325f4e);}return _0x464d1e[_0xbe4f('0x23')]();};}function saveUpdates(_0x14fc38,_0x14bf2e){return function(_0x46ce6a){if(_0x46ce6a){return _0x46ce6a[_0xbe4f('0x24')](_0x14fc38)[_0xbe4f('0x25')](function(_0x461349){return _0x461349;});}return null;};}function removeEntity(_0x10ff70,_0x397724){return function(_0x2cf4b1){if(_0x2cf4b1){return _0x2cf4b1[_0xbe4f('0x26')]()['then'](function(){_0x10ff70[_0xbe4f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27f29d,_0x2f411b){return function(_0x34e5ea){if(!_0x34e5ea){_0x27f29d[_0xbe4f('0x19')](0x194);}return _0x34e5ea;};}function handleError(_0x2bab54,_0x56d690){_0x56d690=_0x56d690||0x1f4;return function(_0x113f47){logger[_0xbe4f('0x27')](_0x113f47[_0xbe4f('0x28')]);if(_0x113f47['name']){delete _0x113f47[_0xbe4f('0x29')];}_0x2bab54[_0xbe4f('0x1a')](_0x56d690)[_0xbe4f('0x2a')](_0x113f47);};}exports[_0xbe4f('0x2b')]=function(_0x2ea87c,_0x1505ab){var _0x313f43={},_0x34b753={},_0x4ea4e2={'count':0x0,'rows':[]};var _0x29d24e=_[_0xbe4f('0x2c')](db['SugarcrmConfiguration'][_0xbe4f('0x2d')],function(_0x9641fe){return{'name':_0x9641fe[_0xbe4f('0x2e')],'type':_0x9641fe[_0xbe4f('0x2f')][_0xbe4f('0x30')]};});_0x34b753[_0xbe4f('0x31')]=_['map'](_0x29d24e,_0xbe4f('0x29'));_0x34b753[_0xbe4f('0x32')]=_[_0xbe4f('0x33')](_0x2ea87c[_0xbe4f('0x32')]);_0x34b753[_0xbe4f('0x34')]=_[_0xbe4f('0x35')](_0x34b753['model'],_0x34b753[_0xbe4f('0x32')]);_0x313f43[_0xbe4f('0x36')]=_['intersection'](_0x34b753[_0xbe4f('0x31')],qs['fields'](_0x2ea87c[_0xbe4f('0x32')]['fields']));_0x313f43[_0xbe4f('0x36')]=_0x313f43[_0xbe4f('0x36')]['length']?_0x313f43[_0xbe4f('0x36')]:_0x34b753['model'];if(!_0x2ea87c[_0xbe4f('0x32')][_0xbe4f('0x37')](_0xbe4f('0x38'))){_0x313f43[_0xbe4f('0x1d')]=qs['limit'](_0x2ea87c['query'][_0xbe4f('0x1d')]);_0x313f43[_0xbe4f('0x1c')]=qs['offset'](_0x2ea87c[_0xbe4f('0x32')]['offset']);}_0x313f43['order']=qs[_0xbe4f('0x39')](_0x2ea87c[_0xbe4f('0x32')][_0xbe4f('0x39')]);_0x313f43[_0xbe4f('0x3a')]=qs[_0xbe4f('0x34')](_[_0xbe4f('0x3b')](_0x2ea87c[_0xbe4f('0x32')],_0x34b753[_0xbe4f('0x34')]),_0x29d24e);if(_0x2ea87c['query'][_0xbe4f('0x3c')]){_0x313f43['where']=_['merge'](_0x313f43[_0xbe4f('0x3a')],{'$or':_[_0xbe4f('0x2c')](_0x29d24e,function(_0x2cf762){if(_0x2cf762[_0xbe4f('0x2f')]!=='VIRTUAL'){var _0x58de93={};_0x58de93[_0x2cf762[_0xbe4f('0x29')]]={'$like':'%'+_0x2ea87c['query'][_0xbe4f('0x3c')]+'%'};return _0x58de93;}})});}_0x313f43=_['merge']({},_0x313f43,_0x2ea87c[_0xbe4f('0x3d')]);var _0xbeac78={'where':_0x313f43[_0xbe4f('0x3a')]};return db[_0xbe4f('0x3e')][_0xbe4f('0x1f')](_0xbeac78)[_0xbe4f('0x25')](function(_0x43f246){_0x4ea4e2['count']=_0x43f246;if(_0x2ea87c[_0xbe4f('0x32')][_0xbe4f('0x3f')]){_0x313f43[_0xbe4f('0x40')]=[{'all':!![]}];}return db[_0xbe4f('0x3e')][_0xbe4f('0x41')](_0x313f43);})[_0xbe4f('0x25')](function(_0x4fe2b1){_0x4ea4e2[_0xbe4f('0x42')]=_0x4fe2b1;return _0x4ea4e2;})[_0xbe4f('0x25')](respondWithFilteredResult(_0x1505ab,_0x313f43))[_0xbe4f('0x43')](handleError(_0x1505ab,null));};exports[_0xbe4f('0x44')]=function(_0x4301c4,_0x55cc09){var _0x5d7534={'raw':![],'where':{'id':_0x4301c4[_0xbe4f('0x45')]['id']}},_0x13acc9={};_0x13acc9[_0xbe4f('0x31')]=_[_0xbe4f('0x33')](db[_0xbe4f('0x3e')][_0xbe4f('0x2d')]);_0x13acc9[_0xbe4f('0x32')]=_[_0xbe4f('0x33')](_0x4301c4[_0xbe4f('0x32')]);_0x13acc9[_0xbe4f('0x34')]=_[_0xbe4f('0x35')](_0x13acc9['model'],_0x13acc9[_0xbe4f('0x32')]);_0x5d7534[_0xbe4f('0x36')]=_[_0xbe4f('0x35')](_0x13acc9['model'],qs[_0xbe4f('0x46')](_0x4301c4[_0xbe4f('0x32')][_0xbe4f('0x46')]));_0x5d7534[_0xbe4f('0x36')]=_0x5d7534[_0xbe4f('0x36')][_0xbe4f('0x47')]?_0x5d7534[_0xbe4f('0x36')]:_0x13acc9[_0xbe4f('0x31')];if(_0x4301c4['query'][_0xbe4f('0x3f')]){_0x5d7534[_0xbe4f('0x40')]=[{'all':!![]}];}_0x5d7534=_[_0xbe4f('0x48')]({},_0x5d7534,_0x4301c4[_0xbe4f('0x3d')]);return db[_0xbe4f('0x3e')][_0xbe4f('0x49')](_0x5d7534)[_0xbe4f('0x25')](handleEntityNotFound(_0x55cc09,null))['then'](respondWithResult(_0x55cc09,null))[_0xbe4f('0x43')](handleError(_0x55cc09,null));};exports[_0xbe4f('0x4a')]=function(_0x49a40,_0x5074ed){return db[_0xbe4f('0x3e')][_0xbe4f('0x4a')](_0x49a40[_0xbe4f('0x4b')],{})[_0xbe4f('0x25')](respondWithResult(_0x5074ed,0xc9))[_0xbe4f('0x43')](handleError(_0x5074ed,null));};exports[_0xbe4f('0x24')]=function(_0x3b517f,_0x36fed5){if(_0x3b517f['body']['id']){delete _0x3b517f['body']['id'];}return db['SugarcrmConfiguration']['find']({'where':{'id':_0x3b517f['params']['id']}})[_0xbe4f('0x25')](handleEntityNotFound(_0x36fed5,null))[_0xbe4f('0x25')](saveUpdates(_0x3b517f[_0xbe4f('0x4b')],null))[_0xbe4f('0x25')](respondWithResult(_0x36fed5,null))[_0xbe4f('0x43')](handleError(_0x36fed5,null));};exports[_0xbe4f('0x26')]=function(_0x309c23,_0x1f5432){return db[_0xbe4f('0x3e')][_0xbe4f('0x49')]({'where':{'id':_0x309c23['params']['id']}})['then'](handleEntityNotFound(_0x1f5432,null))[_0xbe4f('0x25')](removeEntity(_0x1f5432,null))[_0xbe4f('0x43')](handleError(_0x1f5432,null));};exports[_0xbe4f('0x4c')]=function(_0x207b5c,_0x4f312f,_0x2f04ba){var _0xdc437c={};var _0x1b3013={};var _0x40e92e;var _0xd38588;return db[_0xbe4f('0x3e')][_0xbe4f('0x4d')]({'where':{'id':_0x207b5c['params']['id']}})[_0xbe4f('0x25')](handleEntityNotFound(_0x4f312f,null))[_0xbe4f('0x25')](function(_0xa192ca){if(_0xa192ca){_0x40e92e=_0xa192ca;_0x1b3013['model']=_[_0xbe4f('0x33')](db['SugarcrmField'][_0xbe4f('0x2d')]);_0x1b3013[_0xbe4f('0x32')]=_[_0xbe4f('0x33')](_0x207b5c[_0xbe4f('0x32')]);_0x1b3013[_0xbe4f('0x34')]=_[_0xbe4f('0x35')](_0x1b3013[_0xbe4f('0x31')],_0x1b3013['query']);_0xdc437c[_0xbe4f('0x36')]=_[_0xbe4f('0x35')](_0x1b3013[_0xbe4f('0x31')],qs[_0xbe4f('0x46')](_0x207b5c['query'][_0xbe4f('0x46')]));_0xdc437c[_0xbe4f('0x36')]=_0xdc437c[_0xbe4f('0x36')][_0xbe4f('0x47')]?_0xdc437c[_0xbe4f('0x36')]:_0x1b3013[_0xbe4f('0x31')];_0xdc437c['order']=qs['sort'](_0x207b5c[_0xbe4f('0x32')]['sort']);_0xdc437c[_0xbe4f('0x3a')]=qs[_0xbe4f('0x34')](_[_0xbe4f('0x3b')](_0x207b5c[_0xbe4f('0x32')],_0x1b3013['filters']));if(_0x207b5c[_0xbe4f('0x32')][_0xbe4f('0x3c')]){_0xdc437c[_0xbe4f('0x3a')]=_[_0xbe4f('0x48')](_0xdc437c['where'],{'$or':_[_0xbe4f('0x2c')](_0xdc437c['attributes'],function(_0x34c7d7){var _0x20e17d={};_0x20e17d[_0x34c7d7]={'$like':'%'+_0x207b5c['query'][_0xbe4f('0x3c')]+'%'};return _0x20e17d;})});}_0xdc437c=_[_0xbe4f('0x48')]({},_0xdc437c,_0x207b5c[_0xbe4f('0x3d')]);return _0x40e92e[_0xbe4f('0x4c')](_0xdc437c);}})[_0xbe4f('0x25')](function(_0x332948){if(_0x332948){_0xd38588=_0x332948[_0xbe4f('0x47')];if(!_0x207b5c[_0xbe4f('0x32')][_0xbe4f('0x37')](_0xbe4f('0x38'))){_0xdc437c[_0xbe4f('0x1d')]=qs[_0xbe4f('0x1d')](_0x207b5c[_0xbe4f('0x32')]['limit']);_0xdc437c[_0xbe4f('0x1c')]=qs['offset'](_0x207b5c[_0xbe4f('0x32')]['offset']);}return _0x40e92e[_0xbe4f('0x4c')](_0xdc437c);}})[_0xbe4f('0x25')](function(_0x3da367){if(_0x3da367){return _0x3da367?{'count':_0xd38588,'rows':_0x3da367}:null;}})[_0xbe4f('0x25')](respondWithResult(_0x4f312f,null))[_0xbe4f('0x43')](handleError(_0x4f312f,null));};exports[_0xbe4f('0x4e')]=function(_0x1175a6,_0x16a2ff,_0x3797f5){var _0x3339c5={};var _0x4e3564={};var _0x42409;var _0x587d65;return db['SugarcrmConfiguration'][_0xbe4f('0x4d')]({'where':{'id':_0x1175a6['params']['id']}})[_0xbe4f('0x25')](handleEntityNotFound(_0x16a2ff,null))[_0xbe4f('0x25')](function(_0x17732b){if(_0x17732b){_0x42409=_0x17732b;_0x4e3564[_0xbe4f('0x31')]=_[_0xbe4f('0x33')](db[_0xbe4f('0x4f')]['rawAttributes']);_0x4e3564[_0xbe4f('0x32')]=_['keys'](_0x1175a6[_0xbe4f('0x32')]);_0x4e3564[_0xbe4f('0x34')]=_[_0xbe4f('0x35')](_0x4e3564['model'],_0x4e3564['query']);_0x3339c5[_0xbe4f('0x36')]=_[_0xbe4f('0x35')](_0x4e3564[_0xbe4f('0x31')],qs[_0xbe4f('0x46')](_0x1175a6[_0xbe4f('0x32')][_0xbe4f('0x46')]));_0x3339c5[_0xbe4f('0x36')]=_0x3339c5[_0xbe4f('0x36')]['length']?_0x3339c5[_0xbe4f('0x36')]:_0x4e3564[_0xbe4f('0x31')];_0x3339c5['order']=qs[_0xbe4f('0x39')](_0x1175a6[_0xbe4f('0x32')][_0xbe4f('0x39')]);_0x3339c5[_0xbe4f('0x3a')]=qs[_0xbe4f('0x34')](_['pick'](_0x1175a6[_0xbe4f('0x32')],_0x4e3564[_0xbe4f('0x34')]));if(_0x1175a6[_0xbe4f('0x32')][_0xbe4f('0x3c')]){_0x3339c5[_0xbe4f('0x3a')]=_[_0xbe4f('0x48')](_0x3339c5[_0xbe4f('0x3a')],{'$or':_['map'](_0x3339c5[_0xbe4f('0x36')],function(_0x26098e){var _0x497e2a={};_0x497e2a[_0x26098e]={'$like':'%'+_0x1175a6[_0xbe4f('0x32')][_0xbe4f('0x3c')]+'%'};return _0x497e2a;})});}_0x3339c5=_['merge']({},_0x3339c5,_0x1175a6[_0xbe4f('0x3d')]);return _0x42409[_0xbe4f('0x4e')](_0x3339c5);}})[_0xbe4f('0x25')](function(_0x4433a1){if(_0x4433a1){_0x587d65=_0x4433a1[_0xbe4f('0x47')];if(!_0x1175a6[_0xbe4f('0x32')][_0xbe4f('0x37')]('nolimit')){_0x3339c5['limit']=qs[_0xbe4f('0x1d')](_0x1175a6['query'][_0xbe4f('0x1d')]);_0x3339c5['offset']=qs[_0xbe4f('0x1c')](_0x1175a6[_0xbe4f('0x32')][_0xbe4f('0x1c')]);}return _0x42409[_0xbe4f('0x4e')](_0x3339c5);}})[_0xbe4f('0x25')](function(_0x1e11d9){if(_0x1e11d9){return _0x1e11d9?{'count':_0x587d65,'rows':_0x1e11d9}:null;}})[_0xbe4f('0x25')](respondWithResult(_0x16a2ff,null))[_0xbe4f('0x43')](handleError(_0x16a2ff,null));};exports[_0xbe4f('0x50')]=function(_0xabcdf,_0x4675db,_0x2de0b1){var _0x1e518e={};var _0x5329f1={};var _0x1b2b96;var _0x1b81cf;return db[_0xbe4f('0x3e')][_0xbe4f('0x4d')]({'where':{'id':_0xabcdf[_0xbe4f('0x45')]['id']}})[_0xbe4f('0x25')](handleEntityNotFound(_0x4675db,null))[_0xbe4f('0x25')](function(_0x83da70){if(_0x83da70){_0x1b2b96=_0x83da70;_0x5329f1[_0xbe4f('0x31')]=_[_0xbe4f('0x33')](db[_0xbe4f('0x4f')][_0xbe4f('0x2d')]);_0x5329f1[_0xbe4f('0x32')]=_[_0xbe4f('0x33')](_0xabcdf['query']);_0x5329f1[_0xbe4f('0x34')]=_[_0xbe4f('0x35')](_0x5329f1[_0xbe4f('0x31')],_0x5329f1[_0xbe4f('0x32')]);_0x1e518e[_0xbe4f('0x36')]=_[_0xbe4f('0x35')](_0x5329f1['model'],qs[_0xbe4f('0x46')](_0xabcdf[_0xbe4f('0x32')]['fields']));_0x1e518e[_0xbe4f('0x36')]=_0x1e518e[_0xbe4f('0x36')][_0xbe4f('0x47')]?_0x1e518e[_0xbe4f('0x36')]:_0x5329f1[_0xbe4f('0x31')];_0x1e518e[_0xbe4f('0x51')]=qs[_0xbe4f('0x39')](_0xabcdf[_0xbe4f('0x32')][_0xbe4f('0x39')]);_0x1e518e[_0xbe4f('0x3a')]=qs['filters'](_[_0xbe4f('0x3b')](_0xabcdf['query'],_0x5329f1[_0xbe4f('0x34')]));if(_0xabcdf['query'][_0xbe4f('0x3c')]){_0x1e518e[_0xbe4f('0x3a')]=_[_0xbe4f('0x48')](_0x1e518e[_0xbe4f('0x3a')],{'$or':_[_0xbe4f('0x2c')](_0x1e518e[_0xbe4f('0x36')],function(_0x40982f){var _0x11bfb9={};_0x11bfb9[_0x40982f]={'$like':'%'+_0xabcdf[_0xbe4f('0x32')][_0xbe4f('0x3c')]+'%'};return _0x11bfb9;})});}_0x1e518e=_['merge']({},_0x1e518e,_0xabcdf['options']);return _0x1b2b96[_0xbe4f('0x50')](_0x1e518e);}})[_0xbe4f('0x25')](function(_0x584a1a){if(_0x584a1a){_0x1b81cf=_0x584a1a[_0xbe4f('0x47')];if(!_0xabcdf[_0xbe4f('0x32')][_0xbe4f('0x37')]('nolimit')){_0x1e518e[_0xbe4f('0x1d')]=qs[_0xbe4f('0x1d')](_0xabcdf[_0xbe4f('0x32')][_0xbe4f('0x1d')]);_0x1e518e[_0xbe4f('0x1c')]=qs[_0xbe4f('0x1c')](_0xabcdf['query'][_0xbe4f('0x1c')]);}return _0x1b2b96['getDescriptions'](_0x1e518e);}})[_0xbe4f('0x25')](function(_0x281ced){if(_0x281ced){return _0x281ced?{'count':_0x1b81cf,'rows':_0x281ced}:null;}})[_0xbe4f('0x25')](respondWithResult(_0x4675db,null))[_0xbe4f('0x43')](handleError(_0x4675db,null));};
\ No newline at end of file
+var _0x8fd1=['findOne','SugarcrmField','length','order','nolimit','getFields','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','ejs','lodash','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','error','stack','name','send','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','query','filters','model','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','options','include','findAll','rows','show','params','keys','intersection','find','create','body','catch'];(function(_0x6f5da5,_0x1e5d27){var _0x930cf6=function(_0x392e8d){while(--_0x392e8d){_0x6f5da5['push'](_0x6f5da5['shift']());}};_0x930cf6(++_0x1e5d27);}(_0x8fd1,0x17f));var _0x18fd=function(_0x34df4a,_0x209d10){_0x34df4a=_0x34df4a-0x0;var _0x145c69=_0x8fd1[_0x34df4a];return _0x145c69;};'use strict';var emlformat=require(_0x18fd('0x0'));var rimraf=require(_0x18fd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x18fd('0x2'));var rp=require(_0x18fd('0x3'));var moment=require(_0x18fd('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x18fd('0x5'));var util=require(_0x18fd('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x18fd('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x18fd('0x8'));var squel=require('squel');var crypto=require(_0x18fd('0x9'));var jsforce=require(_0x18fd('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x18fd('0xb'));var querystring=require(_0x18fd('0xc'));var Papa=require('papaparse');var Redis=require(_0x18fd('0xd'));var authService=require(_0x18fd('0xe'));var qs=require(_0x18fd('0xf'));var as=require(_0x18fd('0x10'));var hardwareService=require(_0x18fd('0x11'));var logger=require(_0x18fd('0x12'))('api');var utils=require(_0x18fd('0x13'));var config=require(_0x18fd('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x18fd('0x15'))['db'];function respondWithStatusCode(_0x4e4029,_0x428644){_0x428644=_0x428644||0xcc;return function(_0xa29cb3){if(_0xa29cb3){return _0x4e4029['sendStatus'](_0x428644);}return _0x4e4029[_0x18fd('0x16')](_0x428644)['end']();};}function respondWithResult(_0x3800aa,_0x2adbfe){_0x2adbfe=_0x2adbfe||0xc8;return function(_0x234a4f){if(_0x234a4f){return _0x3800aa['status'](_0x2adbfe)[_0x18fd('0x17')](_0x234a4f);}};}function respondWithFilteredResult(_0x249805,_0x3bae08){return function(_0x3545d5){if(_0x3545d5){var _0xa4852a=typeof _0x3bae08[_0x18fd('0x18')]===_0x18fd('0x19')&&typeof _0x3bae08[_0x18fd('0x1a')]==='undefined';var _0xe3fc7a=_0x3545d5['count'];var _0x53d35f=_0xa4852a?0x0:_0x3bae08[_0x18fd('0x18')];var _0x36c919=_0xa4852a?_0x3545d5[_0x18fd('0x1b')]:_0x3bae08[_0x18fd('0x18')]+_0x3bae08[_0x18fd('0x1a')];var _0x376da0;if(_0x36c919>=_0xe3fc7a){_0x36c919=_0xe3fc7a;_0x376da0=0xc8;}else{_0x376da0=0xce;}_0x249805[_0x18fd('0x16')](_0x376da0);return _0x249805[_0x18fd('0x1c')](_0x18fd('0x1d'),_0x53d35f+'-'+_0x36c919+'/'+_0xe3fc7a)[_0x18fd('0x17')](_0x3545d5);}return null;};}function patchUpdates(_0x441a84){return function(_0x2bb42b){try{jsonpatch['apply'](_0x2bb42b,_0x441a84,!![]);}catch(_0x23f7b0){return BPromise[_0x18fd('0x1e')](_0x23f7b0);}return _0x2bb42b[_0x18fd('0x1f')]();};}function saveUpdates(_0x3868db,_0x3478b9){return function(_0x37248a){if(_0x37248a){return _0x37248a['update'](_0x3868db)[_0x18fd('0x20')](function(_0x440366){return _0x440366;});}return null;};}function removeEntity(_0x22fdc4,_0x106791){return function(_0x3e9425){if(_0x3e9425){return _0x3e9425[_0x18fd('0x21')]()[_0x18fd('0x20')](function(){_0x22fdc4[_0x18fd('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2554b6,_0x4b6cd6){return function(_0x2e048f){if(!_0x2e048f){_0x2554b6['sendStatus'](0x194);}return _0x2e048f;};}function handleError(_0x41f2c2,_0x47d846){_0x47d846=_0x47d846||0x1f4;return function(_0x2a5540){logger[_0x18fd('0x22')](_0x2a5540[_0x18fd('0x23')]);if(_0x2a5540[_0x18fd('0x24')]){delete _0x2a5540[_0x18fd('0x24')];}_0x41f2c2[_0x18fd('0x16')](_0x47d846)[_0x18fd('0x25')](_0x2a5540);};}exports['index']=function(_0x5e5592,_0x4f3515){var _0x21955d={},_0x5f5d2e={},_0x2e5b8b={'count':0x0,'rows':[]};var _0x213373=_[_0x18fd('0x26')](db[_0x18fd('0x27')][_0x18fd('0x28')],function(_0x2c7d7f){return{'name':_0x2c7d7f[_0x18fd('0x29')],'type':_0x2c7d7f[_0x18fd('0x2a')][_0x18fd('0x2b')]};});_0x5f5d2e['model']=_[_0x18fd('0x26')](_0x213373,_0x18fd('0x24'));_0x5f5d2e[_0x18fd('0x2c')]=_['keys'](_0x5e5592['query']);_0x5f5d2e[_0x18fd('0x2d')]=_['intersection'](_0x5f5d2e[_0x18fd('0x2e')],_0x5f5d2e[_0x18fd('0x2c')]);_0x21955d[_0x18fd('0x2f')]=_['intersection'](_0x5f5d2e[_0x18fd('0x2e')],qs[_0x18fd('0x30')](_0x5e5592[_0x18fd('0x2c')]['fields']));_0x21955d[_0x18fd('0x2f')]=_0x21955d['attributes']['length']?_0x21955d[_0x18fd('0x2f')]:_0x5f5d2e[_0x18fd('0x2e')];if(!_0x5e5592[_0x18fd('0x2c')][_0x18fd('0x31')]('nolimit')){_0x21955d[_0x18fd('0x1a')]=qs['limit'](_0x5e5592[_0x18fd('0x2c')]['limit']);_0x21955d[_0x18fd('0x18')]=qs[_0x18fd('0x18')](_0x5e5592[_0x18fd('0x2c')]['offset']);}_0x21955d['order']=qs[_0x18fd('0x32')](_0x5e5592[_0x18fd('0x2c')][_0x18fd('0x32')]);_0x21955d[_0x18fd('0x33')]=qs[_0x18fd('0x2d')](_[_0x18fd('0x34')](_0x5e5592[_0x18fd('0x2c')],_0x5f5d2e[_0x18fd('0x2d')]),_0x213373);if(_0x5e5592[_0x18fd('0x2c')][_0x18fd('0x35')]){_0x21955d[_0x18fd('0x33')]=_[_0x18fd('0x36')](_0x21955d[_0x18fd('0x33')],{'$or':_['map'](_0x213373,function(_0x290f1e){if(_0x290f1e[_0x18fd('0x2a')]!=='VIRTUAL'){var _0x573508={};_0x573508[_0x290f1e['name']]={'$like':'%'+_0x5e5592[_0x18fd('0x2c')][_0x18fd('0x35')]+'%'};return _0x573508;}})});}_0x21955d=_['merge']({},_0x21955d,_0x5e5592[_0x18fd('0x37')]);var _0x535a42={'where':_0x21955d[_0x18fd('0x33')]};return db[_0x18fd('0x27')][_0x18fd('0x1b')](_0x535a42)[_0x18fd('0x20')](function(_0x3ff601){_0x2e5b8b['count']=_0x3ff601;if(_0x5e5592[_0x18fd('0x2c')]['includeAll']){_0x21955d[_0x18fd('0x38')]=[{'all':!![]}];}return db[_0x18fd('0x27')][_0x18fd('0x39')](_0x21955d);})[_0x18fd('0x20')](function(_0x37c529){_0x2e5b8b[_0x18fd('0x3a')]=_0x37c529;return _0x2e5b8b;})[_0x18fd('0x20')](respondWithFilteredResult(_0x4f3515,_0x21955d))['catch'](handleError(_0x4f3515,null));};exports[_0x18fd('0x3b')]=function(_0x6d2a4f,_0x163c71){var _0x21ffae={'raw':![],'where':{'id':_0x6d2a4f[_0x18fd('0x3c')]['id']}},_0x48174d={};_0x48174d[_0x18fd('0x2e')]=_[_0x18fd('0x3d')](db[_0x18fd('0x27')]['rawAttributes']);_0x48174d[_0x18fd('0x2c')]=_[_0x18fd('0x3d')](_0x6d2a4f[_0x18fd('0x2c')]);_0x48174d[_0x18fd('0x2d')]=_['intersection'](_0x48174d[_0x18fd('0x2e')],_0x48174d[_0x18fd('0x2c')]);_0x21ffae[_0x18fd('0x2f')]=_[_0x18fd('0x3e')](_0x48174d[_0x18fd('0x2e')],qs['fields'](_0x6d2a4f[_0x18fd('0x2c')][_0x18fd('0x30')]));_0x21ffae[_0x18fd('0x2f')]=_0x21ffae[_0x18fd('0x2f')]['length']?_0x21ffae[_0x18fd('0x2f')]:_0x48174d[_0x18fd('0x2e')];if(_0x6d2a4f[_0x18fd('0x2c')]['includeAll']){_0x21ffae[_0x18fd('0x38')]=[{'all':!![]}];}_0x21ffae=_['merge']({},_0x21ffae,_0x6d2a4f[_0x18fd('0x37')]);return db[_0x18fd('0x27')][_0x18fd('0x3f')](_0x21ffae)['then'](handleEntityNotFound(_0x163c71,null))['then'](respondWithResult(_0x163c71,null))['catch'](handleError(_0x163c71,null));};exports[_0x18fd('0x40')]=function(_0x7fa214,_0x473284){return db['SugarcrmConfiguration'][_0x18fd('0x40')](_0x7fa214[_0x18fd('0x41')],{})[_0x18fd('0x20')](respondWithResult(_0x473284,0xc9))[_0x18fd('0x42')](handleError(_0x473284,null));};exports['update']=function(_0x1a0236,_0xd40c0){if(_0x1a0236[_0x18fd('0x41')]['id']){delete _0x1a0236[_0x18fd('0x41')]['id'];}return db[_0x18fd('0x27')][_0x18fd('0x3f')]({'where':{'id':_0x1a0236[_0x18fd('0x3c')]['id']}})[_0x18fd('0x20')](handleEntityNotFound(_0xd40c0,null))[_0x18fd('0x20')](saveUpdates(_0x1a0236[_0x18fd('0x41')],null))['then'](respondWithResult(_0xd40c0,null))['catch'](handleError(_0xd40c0,null));};exports[_0x18fd('0x21')]=function(_0x31efb,_0x1135ed){return db['SugarcrmConfiguration'][_0x18fd('0x3f')]({'where':{'id':_0x31efb[_0x18fd('0x3c')]['id']}})[_0x18fd('0x20')](handleEntityNotFound(_0x1135ed,null))['then'](removeEntity(_0x1135ed,null))[_0x18fd('0x42')](handleError(_0x1135ed,null));};exports['getFields']=function(_0x225b33,_0x19d353,_0x338d77){var _0x2b363c={};var _0x17bb19={};var _0x23332b;var _0x2c67e0;return db[_0x18fd('0x27')][_0x18fd('0x43')]({'where':{'id':_0x225b33[_0x18fd('0x3c')]['id']}})[_0x18fd('0x20')](handleEntityNotFound(_0x19d353,null))[_0x18fd('0x20')](function(_0x5df7b6){if(_0x5df7b6){_0x23332b=_0x5df7b6;_0x17bb19[_0x18fd('0x2e')]=_['keys'](db[_0x18fd('0x44')][_0x18fd('0x28')]);_0x17bb19[_0x18fd('0x2c')]=_[_0x18fd('0x3d')](_0x225b33[_0x18fd('0x2c')]);_0x17bb19[_0x18fd('0x2d')]=_[_0x18fd('0x3e')](_0x17bb19[_0x18fd('0x2e')],_0x17bb19[_0x18fd('0x2c')]);_0x2b363c['attributes']=_[_0x18fd('0x3e')](_0x17bb19[_0x18fd('0x2e')],qs[_0x18fd('0x30')](_0x225b33['query'][_0x18fd('0x30')]));_0x2b363c['attributes']=_0x2b363c['attributes'][_0x18fd('0x45')]?_0x2b363c['attributes']:_0x17bb19[_0x18fd('0x2e')];_0x2b363c[_0x18fd('0x46')]=qs[_0x18fd('0x32')](_0x225b33[_0x18fd('0x2c')][_0x18fd('0x32')]);_0x2b363c[_0x18fd('0x33')]=qs[_0x18fd('0x2d')](_[_0x18fd('0x34')](_0x225b33[_0x18fd('0x2c')],_0x17bb19[_0x18fd('0x2d')]));if(_0x225b33[_0x18fd('0x2c')][_0x18fd('0x35')]){_0x2b363c[_0x18fd('0x33')]=_[_0x18fd('0x36')](_0x2b363c['where'],{'$or':_['map'](_0x2b363c[_0x18fd('0x2f')],function(_0x4f7b4c){var _0x434757={};_0x434757[_0x4f7b4c]={'$like':'%'+_0x225b33[_0x18fd('0x2c')]['filter']+'%'};return _0x434757;})});}_0x2b363c=_[_0x18fd('0x36')]({},_0x2b363c,_0x225b33[_0x18fd('0x37')]);return _0x23332b['getFields'](_0x2b363c);}})[_0x18fd('0x20')](function(_0x56c02e){if(_0x56c02e){_0x2c67e0=_0x56c02e['length'];if(!_0x225b33[_0x18fd('0x2c')]['hasOwnProperty'](_0x18fd('0x47'))){_0x2b363c[_0x18fd('0x1a')]=qs[_0x18fd('0x1a')](_0x225b33[_0x18fd('0x2c')][_0x18fd('0x1a')]);_0x2b363c[_0x18fd('0x18')]=qs[_0x18fd('0x18')](_0x225b33[_0x18fd('0x2c')]['offset']);}return _0x23332b[_0x18fd('0x48')](_0x2b363c);}})[_0x18fd('0x20')](function(_0x24de53){if(_0x24de53){return _0x24de53?{'count':_0x2c67e0,'rows':_0x24de53}:null;}})[_0x18fd('0x20')](respondWithResult(_0x19d353,null))['catch'](handleError(_0x19d353,null));};exports['getSubjects']=function(_0x502cd8,_0x36efe9,_0x31c834){var _0x42d13d={};var _0x438092={};var _0x24d160;var _0x505da7;return db[_0x18fd('0x27')][_0x18fd('0x43')]({'where':{'id':_0x502cd8[_0x18fd('0x3c')]['id']}})[_0x18fd('0x20')](handleEntityNotFound(_0x36efe9,null))['then'](function(_0x2c2985){if(_0x2c2985){_0x24d160=_0x2c2985;_0x438092[_0x18fd('0x2e')]=_[_0x18fd('0x3d')](db[_0x18fd('0x44')][_0x18fd('0x28')]);_0x438092['query']=_[_0x18fd('0x3d')](_0x502cd8[_0x18fd('0x2c')]);_0x438092[_0x18fd('0x2d')]=_['intersection'](_0x438092['model'],_0x438092[_0x18fd('0x2c')]);_0x42d13d[_0x18fd('0x2f')]=_[_0x18fd('0x3e')](_0x438092[_0x18fd('0x2e')],qs[_0x18fd('0x30')](_0x502cd8['query'][_0x18fd('0x30')]));_0x42d13d['attributes']=_0x42d13d['attributes'][_0x18fd('0x45')]?_0x42d13d[_0x18fd('0x2f')]:_0x438092[_0x18fd('0x2e')];_0x42d13d[_0x18fd('0x46')]=qs[_0x18fd('0x32')](_0x502cd8[_0x18fd('0x2c')][_0x18fd('0x32')]);_0x42d13d['where']=qs[_0x18fd('0x2d')](_['pick'](_0x502cd8[_0x18fd('0x2c')],_0x438092['filters']));if(_0x502cd8['query'][_0x18fd('0x35')]){_0x42d13d[_0x18fd('0x33')]=_[_0x18fd('0x36')](_0x42d13d['where'],{'$or':_[_0x18fd('0x26')](_0x42d13d[_0x18fd('0x2f')],function(_0x1a350f){var _0x3378eb={};_0x3378eb[_0x1a350f]={'$like':'%'+_0x502cd8['query']['filter']+'%'};return _0x3378eb;})});}_0x42d13d=_[_0x18fd('0x36')]({},_0x42d13d,_0x502cd8[_0x18fd('0x37')]);return _0x24d160[_0x18fd('0x49')](_0x42d13d);}})['then'](function(_0x4afade){if(_0x4afade){_0x505da7=_0x4afade[_0x18fd('0x45')];if(!_0x502cd8[_0x18fd('0x2c')][_0x18fd('0x31')](_0x18fd('0x47'))){_0x42d13d[_0x18fd('0x1a')]=qs['limit'](_0x502cd8[_0x18fd('0x2c')][_0x18fd('0x1a')]);_0x42d13d[_0x18fd('0x18')]=qs[_0x18fd('0x18')](_0x502cd8[_0x18fd('0x2c')][_0x18fd('0x18')]);}return _0x24d160[_0x18fd('0x49')](_0x42d13d);}})[_0x18fd('0x20')](function(_0x4f750f){if(_0x4f750f){return _0x4f750f?{'count':_0x505da7,'rows':_0x4f750f}:null;}})[_0x18fd('0x20')](respondWithResult(_0x36efe9,null))[_0x18fd('0x42')](handleError(_0x36efe9,null));};exports[_0x18fd('0x4a')]=function(_0x37fcb3,_0x44efb3,_0x58584a){var _0x1697de={};var _0x3a2afd={};var _0x163f2c;var _0x1bcc63;return db[_0x18fd('0x27')][_0x18fd('0x43')]({'where':{'id':_0x37fcb3['params']['id']}})['then'](handleEntityNotFound(_0x44efb3,null))[_0x18fd('0x20')](function(_0x363d8f){if(_0x363d8f){_0x163f2c=_0x363d8f;_0x3a2afd[_0x18fd('0x2e')]=_[_0x18fd('0x3d')](db[_0x18fd('0x44')][_0x18fd('0x28')]);_0x3a2afd['query']=_[_0x18fd('0x3d')](_0x37fcb3[_0x18fd('0x2c')]);_0x3a2afd[_0x18fd('0x2d')]=_[_0x18fd('0x3e')](_0x3a2afd[_0x18fd('0x2e')],_0x3a2afd['query']);_0x1697de['attributes']=_[_0x18fd('0x3e')](_0x3a2afd['model'],qs[_0x18fd('0x30')](_0x37fcb3[_0x18fd('0x2c')]['fields']));_0x1697de[_0x18fd('0x2f')]=_0x1697de['attributes'][_0x18fd('0x45')]?_0x1697de['attributes']:_0x3a2afd['model'];_0x1697de['order']=qs[_0x18fd('0x32')](_0x37fcb3[_0x18fd('0x2c')][_0x18fd('0x32')]);_0x1697de[_0x18fd('0x33')]=qs['filters'](_[_0x18fd('0x34')](_0x37fcb3[_0x18fd('0x2c')],_0x3a2afd[_0x18fd('0x2d')]));if(_0x37fcb3[_0x18fd('0x2c')][_0x18fd('0x35')]){_0x1697de[_0x18fd('0x33')]=_[_0x18fd('0x36')](_0x1697de[_0x18fd('0x33')],{'$or':_[_0x18fd('0x26')](_0x1697de[_0x18fd('0x2f')],function(_0x23f508){var _0x5aeb14={};_0x5aeb14[_0x23f508]={'$like':'%'+_0x37fcb3['query']['filter']+'%'};return _0x5aeb14;})});}_0x1697de=_['merge']({},_0x1697de,_0x37fcb3['options']);return _0x163f2c['getDescriptions'](_0x1697de);}})[_0x18fd('0x20')](function(_0x2df1c7){if(_0x2df1c7){_0x1bcc63=_0x2df1c7['length'];if(!_0x37fcb3[_0x18fd('0x2c')]['hasOwnProperty'](_0x18fd('0x47'))){_0x1697de['limit']=qs[_0x18fd('0x1a')](_0x37fcb3[_0x18fd('0x2c')][_0x18fd('0x1a')]);_0x1697de[_0x18fd('0x18')]=qs[_0x18fd('0x18')](_0x37fcb3[_0x18fd('0x2c')][_0x18fd('0x18')]);}return _0x163f2c[_0x18fd('0x4a')](_0x1697de);}})[_0x18fd('0x20')](function(_0x3d65fe){if(_0x3d65fe){return _0x3d65fe?{'count':_0x1bcc63,'rows':_0x3d65fe}:null;}})[_0x18fd('0x20')](respondWithResult(_0x44efb3,null))[_0x18fd('0x42')](handleError(_0x44efb3,null));};
\ No newline at end of file
index 7430d34..085e9ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0c9=['request-promise','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','util','../../config/logger','api'];(function(_0x180c4,_0xa3e669){var _0x581985=function(_0x1b7fff){while(--_0x1b7fff){_0x180c4['push'](_0x180c4['shift']());}};_0x581985(++_0xa3e669);}(_0xd0c9,0x189));var _0x9d0c=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0xd0c9[_0x36ed3c];return _0x52a2e0;};'use strict';var _=require('lodash');var util=require(_0x9d0c('0x0'));var logger=require(_0x9d0c('0x1'))(_0x9d0c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9d0c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9d0c('0x4'));var config=require(_0x9d0c('0x5'));var attributes=require(_0x9d0c('0x6'));module[_0x9d0c('0x7')]=function(_0x4a1b72,_0x58a877){return _0x4a1b72[_0x9d0c('0x8')](_0x9d0c('0x9'),attributes,{'tableName':_0x9d0c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x385a=['path','rimraf','../../config/environment','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','api','moment','bluebird','request-promise'];(function(_0x40d73d,_0x2dc57a){var _0xeb82e1=function(_0x301b8b){while(--_0x301b8b){_0x40d73d['push'](_0x40d73d['shift']());}};_0xeb82e1(++_0x2dc57a);}(_0x385a,0xa1));var _0xa385=function(_0x11c47b,_0x4aafc1){_0x11c47b=_0x11c47b-0x0;var _0x170d61=_0x385a[_0x11c47b];return _0x170d61;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xa385('0x0'));var moment=require(_0xa385('0x1'));var BPromise=require(_0xa385('0x2'));var rp=require(_0xa385('0x3'));var fs=require('fs');var path=require(_0xa385('0x4'));var rimraf=require(_0xa385('0x5'));var config=require(_0xa385('0x6'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0xa385('0x7')]=function(_0x11bbe5,_0x481917){return _0x11bbe5[_0xa385('0x8')](_0xa385('0x9'),attributes,{'tableName':_0xa385('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index dbe886e..a46dd12 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49e2=['request','info','request\x20sent','debug','stringify','error','SugarcrmConfiguration,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x43b06b,_0x1929c7){var _0x2c555b=function(_0x30fa8c){while(--_0x30fa8c){_0x43b06b['push'](_0x43b06b['shift']());}};_0x2c555b(++_0x1929c7);}(_0x49e2,0x153));var _0x249e=function(_0x28a0fa,_0x348c5f){_0x28a0fa=_0x28a0fa-0x0;var _0x4235f2=_0x49e2[_0x28a0fa];return _0x4235f2;};'use strict';var _=require(_0x249e('0x0'));var util=require(_0x249e('0x1'));var moment=require(_0x249e('0x2'));var BPromise=require(_0x249e('0x3'));var rs=require(_0x249e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x249e('0x5'))['db'];var utils=require(_0x249e('0x6'));var logger=require(_0x249e('0x7'))(_0x249e('0x8'));var config=require(_0x249e('0x9'));var jayson=require(_0x249e('0xa'));var client=jayson[_0x249e('0xb')][_0x249e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x56cf13,_0xfe680d,_0x416c7f){return new BPromise(function(_0x279867,_0x319c74){return client[_0x249e('0xd')](_0x56cf13,_0x416c7f)['then'](function(_0x395d32){logger[_0x249e('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xfe680d,_0x249e('0xf'));logger[_0x249e('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0xfe680d,_0x249e('0xf'),JSON[_0x249e('0x11')](_0x395d32));if(_0x395d32[_0x249e('0x12')]){if(_0x395d32[_0x249e('0x12')]['code']===0x1f4){logger[_0x249e('0x12')](_0x249e('0x13'),_0xfe680d,_0x395d32[_0x249e('0x12')][_0x249e('0x14')]);return _0x319c74(_0x395d32['error'][_0x249e('0x14')]);}logger[_0x249e('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xfe680d,_0x395d32[_0x249e('0x12')][_0x249e('0x14')]);return _0x279867(_0x395d32['error'][_0x249e('0x14')]);}else{logger[_0x249e('0xe')](_0x249e('0x13'),_0xfe680d,_0x249e('0xf'));_0x279867(_0x395d32[_0x249e('0x15')][_0x249e('0x14')]);}})['catch'](function(_0xaf555b){logger['error'](_0x249e('0x13'),_0xfe680d,_0xaf555b);_0x319c74(_0xaf555b);});});}
\ No newline at end of file
+var _0x0ed6=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x0ed6,0xbf));var _0x60ed=function(_0x4bcf79,_0x300fd4){_0x4bcf79=_0x4bcf79-0x0;var _0xbfd3d7=_0x0ed6[_0x4bcf79];return _0xbfd3d7;};'use strict';var _=require(_0x60ed('0x0'));var util=require('util');var moment=require(_0x60ed('0x1'));var BPromise=require(_0x60ed('0x2'));var rs=require(_0x60ed('0x3'));var fs=require('fs');var Redis=require(_0x60ed('0x4'));var db=require(_0x60ed('0x5'))['db'];var utils=require(_0x60ed('0x6'));var logger=require(_0x60ed('0x7'))(_0x60ed('0x8'));var config=require(_0x60ed('0x9'));var jayson=require(_0x60ed('0xa'));var client=jayson[_0x60ed('0xb')][_0x60ed('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2fdd24,_0x385c8b,_0x189b69){return new BPromise(function(_0x3a3422,_0x2fd899){return client[_0x60ed('0xd')](_0x2fdd24,_0x189b69)[_0x60ed('0xe')](function(_0x420ce8){logger[_0x60ed('0xf')](_0x60ed('0x10'),_0x385c8b,_0x60ed('0x11'));logger['debug'](_0x60ed('0x12'),_0x385c8b,_0x60ed('0x11'),JSON[_0x60ed('0x13')](_0x420ce8));if(_0x420ce8[_0x60ed('0x14')]){if(_0x420ce8[_0x60ed('0x14')]['code']===0x1f4){logger[_0x60ed('0x14')](_0x60ed('0x10'),_0x385c8b,_0x420ce8[_0x60ed('0x14')][_0x60ed('0x15')]);return _0x2fd899(_0x420ce8['error']['message']);}logger['error'](_0x60ed('0x10'),_0x385c8b,_0x420ce8[_0x60ed('0x14')]['message']);return _0x3a3422(_0x420ce8[_0x60ed('0x14')][_0x60ed('0x15')]);}else{logger[_0x60ed('0xf')](_0x60ed('0x10'),_0x385c8b,_0x60ed('0x11'));_0x3a3422(_0x420ce8[_0x60ed('0x16')][_0x60ed('0x15')]);}})[_0x60ed('0x17')](function(_0x990d32){logger[_0x60ed('0x14')](_0x60ed('0x10'),_0x385c8b,_0x990d32);_0x2fd899(_0x990d32);});});}
\ No newline at end of file
index c8e22cd..c53e16f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41f6=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x1b9a07,_0xa530cd){var _0xb6c06e=function(_0x633135){while(--_0x633135){_0x1b9a07['push'](_0x1b9a07['shift']());}};_0xb6c06e(++_0xa530cd);}(_0x41f6,0xfe));var _0x641f=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x41f6[_0x4b055c];return _0x4b62bb;};'use strict';var multer=require(_0x641f('0x0'));var util=require(_0x641f('0x1'));var path=require(_0x641f('0x2'));var timeout=require(_0x641f('0x3'));var express=require(_0x641f('0x4'));var router=express[_0x641f('0x5')]();var fs_extra=require(_0x641f('0x6'));var auth=require(_0x641f('0x7'));var interaction=require(_0x641f('0x8'));var config=require(_0x641f('0x9'));var controller=require('./intSugarcrmField.controller');router[_0x641f('0xa')]('/',auth[_0x641f('0xb')](),controller[_0x641f('0xc')]);router[_0x641f('0xa')](_0x641f('0xd'),auth[_0x641f('0xb')](),controller[_0x641f('0xe')]);router['post']('/',auth[_0x641f('0xb')](),controller[_0x641f('0xf')]);router[_0x641f('0x10')]('/:id',auth[_0x641f('0xb')](),controller[_0x641f('0x11')]);router['delete'](_0x641f('0xd'),auth[_0x641f('0xb')](),controller[_0x641f('0x12')]);module[_0x641f('0x13')]=router;
\ No newline at end of file
+var _0xde23=['util','path','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update'];(function(_0x4c29f9,_0x5bddd4){var _0x4e17b8=function(_0x12e055){while(--_0x12e055){_0x4c29f9['push'](_0x4c29f9['shift']());}};_0x4e17b8(++_0x5bddd4);}(_0xde23,0x12b));var _0x3de2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xde23[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x3de2('0x0'));var path=require(_0x3de2('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x3de2('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x3de2('0x3'));var config=require(_0x3de2('0x4'));var controller=require('./intSugarcrmField.controller');router[_0x3de2('0x5')]('/',auth[_0x3de2('0x6')](),controller[_0x3de2('0x7')]);router[_0x3de2('0x5')](_0x3de2('0x8'),auth[_0x3de2('0x6')](),controller['show']);router[_0x3de2('0x9')]('/',auth[_0x3de2('0x6')](),controller[_0x3de2('0xa')]);router[_0x3de2('0xb')](_0x3de2('0x8'),auth['isAuthenticated'](),controller[_0x3de2('0xc')]);router['delete']('/:id',auth[_0x3de2('0x6')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index e38fc10..e2b8009 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd1=['STRING','sequelize','ENUM','variable','customVariable','keyValue','picklist','string'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0xedd1,0xd9));var _0x1edd=function(_0x34bff6,_0x36f01d){_0x34bff6=_0x34bff6-0x0;var _0x2704ee=_0xedd1[_0x34bff6];return _0x2704ee;};'use strict';var Sequelize=require(_0x1edd('0x0'));module['exports']={'type':{'type':Sequelize[_0x1edd('0x1')]('string',_0x1edd('0x2'),_0x1edd('0x3'),_0x1edd('0x4'),_0x1edd('0x5')),'defaultValue':_0x1edd('0x6')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1edd('0x7')]},'keyType':{'type':Sequelize[_0x1edd('0x1')]('string',_0x1edd('0x2'),_0x1edd('0x3'))},'keyContent':{'type':Sequelize[_0x1edd('0x7')]},'idField':{'type':Sequelize[_0x1edd('0x7')]},'nameField':{'type':Sequelize[_0x1edd('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1edd('0x7')]}};
\ No newline at end of file
+var _0x299c=['keyValue','picklist','STRING','variable','customVariable','BOOLEAN','exports','ENUM','string'];(function(_0x258919,_0x1754e6){var _0xfbd68b=function(_0x3bc3e9){while(--_0x3bc3e9){_0x258919['push'](_0x258919['shift']());}};_0xfbd68b(++_0x1754e6);}(_0x299c,0x114));var _0xc299=function(_0x578a7c,_0x2ce1e0){_0x578a7c=_0x578a7c-0x0;var _0x459157=_0x299c[_0x578a7c];return _0x459157;};'use strict';var Sequelize=require('sequelize');module[_0xc299('0x0')]={'type':{'type':Sequelize[_0xc299('0x1')](_0xc299('0x2'),'variable','customVariable',_0xc299('0x3'),_0xc299('0x4')),'defaultValue':_0xc299('0x2')},'content':{'type':Sequelize[_0xc299('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xc299('0x1')](_0xc299('0x2'),_0xc299('0x6'),_0xc299('0x7'))},'keyContent':{'type':Sequelize[_0xc299('0x5')]},'idField':{'type':Sequelize[_0xc299('0x5')]},'nameField':{'type':Sequelize[_0xc299('0x5')]},'customField':{'type':Sequelize[_0xc299('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc299('0x5')]}};
\ No newline at end of file
index 28cb631..f6773f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf28a=['error','name','index','map','SugarcrmField','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','params','keys','create','body','find','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','end','json','offset','undefined','status','Content-Range','reject','update','then','destroy'];(function(_0x3be658,_0x5b5905){var _0x8382ed=function(_0x361b7d){while(--_0x361b7d){_0x3be658['push'](_0x3be658['shift']());}};_0x8382ed(++_0x5b5905);}(_0xf28a,0x1a9));var _0xaf28=function(_0x54fddf,_0x46a0a1){_0x54fddf=_0x54fddf-0x0;var _0x404503=_0xf28a[_0x54fddf];return _0x404503;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xaf28('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf28('0x1'));var moment=require(_0xaf28('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xaf28('0x3'));var util=require('util');var path=require(_0xaf28('0x4'));var sox=require(_0xaf28('0x5'));var csv=require(_0xaf28('0x6'));var ejs=require(_0xaf28('0x7'));var fs=require('fs');var fs_extra=require(_0xaf28('0x8'));var _=require(_0xaf28('0x9'));var squel=require('squel');var crypto=require(_0xaf28('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xaf28('0xb'));var toCsv=require(_0xaf28('0x6'));var querystring=require('querystring');var Papa=require(_0xaf28('0xc'));var Redis=require(_0xaf28('0xd'));var authService=require(_0xaf28('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaf28('0xf'));var logger=require('../../config/logger')(_0xaf28('0x10'));var utils=require(_0xaf28('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaf28('0x12'))['db'];function respondWithStatusCode(_0x593080,_0x5552b7){_0x5552b7=_0x5552b7||0xcc;return function(_0x2ffaf8){if(_0x2ffaf8){return _0x593080[_0xaf28('0x13')](_0x5552b7);}return _0x593080['status'](_0x5552b7)[_0xaf28('0x14')]();};}function respondWithResult(_0x13ee65,_0x103efa){_0x103efa=_0x103efa||0xc8;return function(_0x240a96){if(_0x240a96){return _0x13ee65['status'](_0x103efa)[_0xaf28('0x15')](_0x240a96);}};}function respondWithFilteredResult(_0x29017d,_0x3d5967){return function(_0x558396){if(_0x558396){var _0x432736=typeof _0x3d5967[_0xaf28('0x16')]===_0xaf28('0x17')&&typeof _0x3d5967['limit']===_0xaf28('0x17');var _0x5ef01a=_0x558396['count'];var _0x11de77=_0x432736?0x0:_0x3d5967[_0xaf28('0x16')];var _0x5b6e07=_0x432736?_0x558396['count']:_0x3d5967[_0xaf28('0x16')]+_0x3d5967['limit'];var _0x47216c;if(_0x5b6e07>=_0x5ef01a){_0x5b6e07=_0x5ef01a;_0x47216c=0xc8;}else{_0x47216c=0xce;}_0x29017d[_0xaf28('0x18')](_0x47216c);return _0x29017d['set'](_0xaf28('0x19'),_0x11de77+'-'+_0x5b6e07+'/'+_0x5ef01a)[_0xaf28('0x15')](_0x558396);}return null;};}function patchUpdates(_0x46f5ec){return function(_0x2fe5f1){try{jsonpatch['apply'](_0x2fe5f1,_0x46f5ec,!![]);}catch(_0x2de676){return BPromise[_0xaf28('0x1a')](_0x2de676);}return _0x2fe5f1['save']();};}function saveUpdates(_0x2608cc,_0xa4983c){return function(_0x3f5ad8){if(_0x3f5ad8){return _0x3f5ad8[_0xaf28('0x1b')](_0x2608cc)[_0xaf28('0x1c')](function(_0x544b65){return _0x544b65;});}return null;};}function removeEntity(_0x71287e,_0x82d490){return function(_0x3522db){if(_0x3522db){return _0x3522db[_0xaf28('0x1d')]()[_0xaf28('0x1c')](function(){_0x71287e[_0xaf28('0x18')](0xcc)[_0xaf28('0x14')]();});}};}function handleEntityNotFound(_0x49d4cc,_0x19ddd1){return function(_0x4128df){if(!_0x4128df){_0x49d4cc[_0xaf28('0x13')](0x194);}return _0x4128df;};}function handleError(_0x597022,_0xbddd61){_0xbddd61=_0xbddd61||0x1f4;return function(_0x33ef5a){logger[_0xaf28('0x1e')](_0x33ef5a['stack']);if(_0x33ef5a['name']){delete _0x33ef5a[_0xaf28('0x1f')];}_0x597022[_0xaf28('0x18')](_0xbddd61)['send'](_0x33ef5a);};}exports[_0xaf28('0x20')]=function(_0x1b4373,_0x5e8c7b){var _0xdeef61={},_0x215377={},_0x112afe={'count':0x0,'rows':[]};var _0x474956=_[_0xaf28('0x21')](db[_0xaf28('0x22')][_0xaf28('0x23')],function(_0x5012a7){return{'name':_0x5012a7['fieldName'],'type':_0x5012a7[_0xaf28('0x24')][_0xaf28('0x25')]};});_0x215377[_0xaf28('0x26')]=_[_0xaf28('0x21')](_0x474956,'name');_0x215377[_0xaf28('0x27')]=_['keys'](_0x1b4373[_0xaf28('0x27')]);_0x215377[_0xaf28('0x28')]=_[_0xaf28('0x29')](_0x215377[_0xaf28('0x26')],_0x215377[_0xaf28('0x27')]);_0xdeef61[_0xaf28('0x2a')]=_['intersection'](_0x215377['model'],qs[_0xaf28('0x2b')](_0x1b4373[_0xaf28('0x27')]['fields']));_0xdeef61[_0xaf28('0x2a')]=_0xdeef61[_0xaf28('0x2a')][_0xaf28('0x2c')]?_0xdeef61['attributes']:_0x215377[_0xaf28('0x26')];if(!_0x1b4373[_0xaf28('0x27')][_0xaf28('0x2d')]('nolimit')){_0xdeef61[_0xaf28('0x2e')]=qs[_0xaf28('0x2e')](_0x1b4373[_0xaf28('0x27')][_0xaf28('0x2e')]);_0xdeef61[_0xaf28('0x16')]=qs[_0xaf28('0x16')](_0x1b4373[_0xaf28('0x27')][_0xaf28('0x16')]);}_0xdeef61['order']=qs[_0xaf28('0x2f')](_0x1b4373['query']['sort']);_0xdeef61[_0xaf28('0x30')]=qs[_0xaf28('0x28')](_[_0xaf28('0x31')](_0x1b4373[_0xaf28('0x27')],_0x215377['filters']),_0x474956);if(_0x1b4373[_0xaf28('0x27')][_0xaf28('0x32')]){_0xdeef61[_0xaf28('0x30')]=_[_0xaf28('0x33')](_0xdeef61[_0xaf28('0x30')],{'$or':_['map'](_0x474956,function(_0x264b01){if(_0x264b01[_0xaf28('0x24')]!==_0xaf28('0x34')){var _0x273ab3={};_0x273ab3[_0x264b01[_0xaf28('0x1f')]]={'$like':'%'+_0x1b4373['query'][_0xaf28('0x32')]+'%'};return _0x273ab3;}})});}_0xdeef61=_[_0xaf28('0x33')]({},_0xdeef61,_0x1b4373[_0xaf28('0x35')]);var _0x238447={'where':_0xdeef61['where']};return db[_0xaf28('0x22')][_0xaf28('0x36')](_0x238447)[_0xaf28('0x1c')](function(_0x9cc15a){_0x112afe[_0xaf28('0x36')]=_0x9cc15a;if(_0x1b4373[_0xaf28('0x27')][_0xaf28('0x37')]){_0xdeef61[_0xaf28('0x38')]=[{'all':!![]}];}return db[_0xaf28('0x22')][_0xaf28('0x39')](_0xdeef61);})[_0xaf28('0x1c')](function(_0x573d75){_0x112afe[_0xaf28('0x3a')]=_0x573d75;return _0x112afe;})[_0xaf28('0x1c')](respondWithFilteredResult(_0x5e8c7b,_0xdeef61))[_0xaf28('0x3b')](handleError(_0x5e8c7b,null));};exports['show']=function(_0x264cf3,_0x584122){var _0xb460ee={'raw':!![],'where':{'id':_0x264cf3[_0xaf28('0x3c')]['id']}},_0x149fac={};_0x149fac[_0xaf28('0x26')]=_[_0xaf28('0x3d')](db[_0xaf28('0x22')][_0xaf28('0x23')]);_0x149fac['query']=_['keys'](_0x264cf3[_0xaf28('0x27')]);_0x149fac[_0xaf28('0x28')]=_[_0xaf28('0x29')](_0x149fac[_0xaf28('0x26')],_0x149fac[_0xaf28('0x27')]);_0xb460ee[_0xaf28('0x2a')]=_[_0xaf28('0x29')](_0x149fac[_0xaf28('0x26')],qs[_0xaf28('0x2b')](_0x264cf3[_0xaf28('0x27')][_0xaf28('0x2b')]));_0xb460ee['attributes']=_0xb460ee['attributes']['length']?_0xb460ee[_0xaf28('0x2a')]:_0x149fac[_0xaf28('0x26')];if(_0x264cf3[_0xaf28('0x27')][_0xaf28('0x37')]){_0xb460ee[_0xaf28('0x38')]=[{'all':!![]}];}_0xb460ee=_[_0xaf28('0x33')]({},_0xb460ee,_0x264cf3['options']);return db[_0xaf28('0x22')]['find'](_0xb460ee)['then'](handleEntityNotFound(_0x584122,null))['then'](respondWithResult(_0x584122,null))[_0xaf28('0x3b')](handleError(_0x584122,null));};exports['create']=function(_0x10ab33,_0x2db91c){return db['SugarcrmField'][_0xaf28('0x3e')](_0x10ab33[_0xaf28('0x3f')],{})[_0xaf28('0x1c')](respondWithResult(_0x2db91c,0xc9))[_0xaf28('0x3b')](handleError(_0x2db91c,null));};exports[_0xaf28('0x1b')]=function(_0x470a13,_0x492b5){if(_0x470a13[_0xaf28('0x3f')]['id']){delete _0x470a13[_0xaf28('0x3f')]['id'];}return db[_0xaf28('0x22')][_0xaf28('0x40')]({'where':{'id':_0x470a13[_0xaf28('0x3c')]['id']}})['then'](handleEntityNotFound(_0x492b5,null))['then'](saveUpdates(_0x470a13['body'],null))[_0xaf28('0x1c')](respondWithResult(_0x492b5,null))['catch'](handleError(_0x492b5,null));};exports[_0xaf28('0x1d')]=function(_0x5a1763,_0x3b5340){return db['SugarcrmField'][_0xaf28('0x40')]({'where':{'id':_0x5a1763[_0xaf28('0x3c')]['id']}})[_0xaf28('0x1c')](handleEntityNotFound(_0x3b5340,null))[_0xaf28('0x1c')](removeEntity(_0x3b5340,null))['catch'](handleError(_0x3b5340,null));};
\ No newline at end of file
+var _0x208e=['merge','VIRTUAL','filter','SugarcrmField','includeAll','findAll','rows','catch','show','params','keys','length','find','create','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','save','then','destroy','error','stack','send','index','map','rawAttributes','fieldName','key','model','name','query','attributes','intersection','fields','hasOwnProperty','sort','pick','filters','where'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0x208e,0x1a8));var _0xe208=function(_0x3feab5,_0x1849cb){_0x3feab5=_0x3feab5-0x0;var _0x4fb9e9=_0x208e[_0x3feab5];return _0x4fb9e9;};'use strict';var emlformat=require(_0xe208('0x0'));var rimraf=require(_0xe208('0x1'));var zipdir=require(_0xe208('0x2'));var jsonpatch=require(_0xe208('0x3'));var rp=require(_0xe208('0x4'));var moment=require('moment');var BPromise=require(_0xe208('0x5'));var Mustache=require(_0xe208('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xe208('0x7'));var ejs=require(_0xe208('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe208('0x9'));var squel=require(_0xe208('0xa'));var crypto=require(_0xe208('0xb'));var jsforce=require(_0xe208('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe208('0x7'));var querystring=require(_0xe208('0xd'));var Papa=require(_0xe208('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe208('0xf'));var hardwareService=require(_0xe208('0x10'));var logger=require(_0xe208('0x11'))('api');var utils=require(_0xe208('0x12'));var config=require(_0xe208('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e1699,_0x2a5083){_0x2a5083=_0x2a5083||0xcc;return function(_0x3939d3){if(_0x3939d3){return _0x5e1699[_0xe208('0x14')](_0x2a5083);}return _0x5e1699[_0xe208('0x15')](_0x2a5083)[_0xe208('0x16')]();};}function respondWithResult(_0x589de3,_0x340734){_0x340734=_0x340734||0xc8;return function(_0x729a17){if(_0x729a17){return _0x589de3[_0xe208('0x15')](_0x340734)[_0xe208('0x17')](_0x729a17);}};}function respondWithFilteredResult(_0x3c72e9,_0x51d212){return function(_0x4cdfed){if(_0x4cdfed){var _0x1270aa=typeof _0x51d212[_0xe208('0x18')]==='undefined'&&typeof _0x51d212[_0xe208('0x19')]==='undefined';var _0x465d65=_0x4cdfed['count'];var _0x5c7766=_0x1270aa?0x0:_0x51d212[_0xe208('0x18')];var _0x22299b=_0x1270aa?_0x4cdfed[_0xe208('0x1a')]:_0x51d212[_0xe208('0x18')]+_0x51d212[_0xe208('0x19')];var _0x55d558;if(_0x22299b>=_0x465d65){_0x22299b=_0x465d65;_0x55d558=0xc8;}else{_0x55d558=0xce;}_0x3c72e9['status'](_0x55d558);return _0x3c72e9['set'](_0xe208('0x1b'),_0x5c7766+'-'+_0x22299b+'/'+_0x465d65)[_0xe208('0x17')](_0x4cdfed);}return null;};}function patchUpdates(_0x34efde){return function(_0x551ef4){try{jsonpatch[_0xe208('0x1c')](_0x551ef4,_0x34efde,!![]);}catch(_0x18b017){return BPromise[_0xe208('0x1d')](_0x18b017);}return _0x551ef4[_0xe208('0x1e')]();};}function saveUpdates(_0xf23c4e,_0x420264){return function(_0x505576){if(_0x505576){return _0x505576['update'](_0xf23c4e)[_0xe208('0x1f')](function(_0x2c9916){return _0x2c9916;});}return null;};}function removeEntity(_0x3b6f42,_0x36732f){return function(_0x5af9ad){if(_0x5af9ad){return _0x5af9ad[_0xe208('0x20')]()[_0xe208('0x1f')](function(){_0x3b6f42[_0xe208('0x15')](0xcc)[_0xe208('0x16')]();});}};}function handleEntityNotFound(_0x5e02db,_0x414643){return function(_0xcf1e03){if(!_0xcf1e03){_0x5e02db['sendStatus'](0x194);}return _0xcf1e03;};}function handleError(_0xc29e78,_0x4fb9a0){_0x4fb9a0=_0x4fb9a0||0x1f4;return function(_0x454afa){logger[_0xe208('0x21')](_0x454afa[_0xe208('0x22')]);if(_0x454afa['name']){delete _0x454afa['name'];}_0xc29e78[_0xe208('0x15')](_0x4fb9a0)[_0xe208('0x23')](_0x454afa);};}exports[_0xe208('0x24')]=function(_0x55e610,_0x495d09){var _0xa22327={},_0x4ddb0c={},_0x295de9={'count':0x0,'rows':[]};var _0x114034=_[_0xe208('0x25')](db['SugarcrmField'][_0xe208('0x26')],function(_0x3ad496){return{'name':_0x3ad496[_0xe208('0x27')],'type':_0x3ad496['type'][_0xe208('0x28')]};});_0x4ddb0c[_0xe208('0x29')]=_[_0xe208('0x25')](_0x114034,_0xe208('0x2a'));_0x4ddb0c['query']=_['keys'](_0x55e610[_0xe208('0x2b')]);_0x4ddb0c['filters']=_['intersection'](_0x4ddb0c[_0xe208('0x29')],_0x4ddb0c[_0xe208('0x2b')]);_0xa22327[_0xe208('0x2c')]=_[_0xe208('0x2d')](_0x4ddb0c['model'],qs[_0xe208('0x2e')](_0x55e610[_0xe208('0x2b')][_0xe208('0x2e')]));_0xa22327[_0xe208('0x2c')]=_0xa22327[_0xe208('0x2c')]['length']?_0xa22327[_0xe208('0x2c')]:_0x4ddb0c[_0xe208('0x29')];if(!_0x55e610[_0xe208('0x2b')][_0xe208('0x2f')]('nolimit')){_0xa22327[_0xe208('0x19')]=qs[_0xe208('0x19')](_0x55e610[_0xe208('0x2b')][_0xe208('0x19')]);_0xa22327[_0xe208('0x18')]=qs[_0xe208('0x18')](_0x55e610[_0xe208('0x2b')][_0xe208('0x18')]);}_0xa22327['order']=qs[_0xe208('0x30')](_0x55e610[_0xe208('0x2b')][_0xe208('0x30')]);_0xa22327['where']=qs['filters'](_[_0xe208('0x31')](_0x55e610[_0xe208('0x2b')],_0x4ddb0c[_0xe208('0x32')]),_0x114034);if(_0x55e610[_0xe208('0x2b')]['filter']){_0xa22327[_0xe208('0x33')]=_[_0xe208('0x34')](_0xa22327[_0xe208('0x33')],{'$or':_[_0xe208('0x25')](_0x114034,function(_0x46ab50){if(_0x46ab50['type']!==_0xe208('0x35')){var _0x1aacd1={};_0x1aacd1[_0x46ab50[_0xe208('0x2a')]]={'$like':'%'+_0x55e610[_0xe208('0x2b')][_0xe208('0x36')]+'%'};return _0x1aacd1;}})});}_0xa22327=_[_0xe208('0x34')]({},_0xa22327,_0x55e610['options']);var _0x2a4fec={'where':_0xa22327[_0xe208('0x33')]};return db[_0xe208('0x37')][_0xe208('0x1a')](_0x2a4fec)[_0xe208('0x1f')](function(_0x3add8e){_0x295de9[_0xe208('0x1a')]=_0x3add8e;if(_0x55e610[_0xe208('0x2b')][_0xe208('0x38')]){_0xa22327['include']=[{'all':!![]}];}return db[_0xe208('0x37')][_0xe208('0x39')](_0xa22327);})[_0xe208('0x1f')](function(_0x28cbbf){_0x295de9[_0xe208('0x3a')]=_0x28cbbf;return _0x295de9;})[_0xe208('0x1f')](respondWithFilteredResult(_0x495d09,_0xa22327))[_0xe208('0x3b')](handleError(_0x495d09,null));};exports[_0xe208('0x3c')]=function(_0x26c299,_0x51e130){var _0x598f2f={'raw':!![],'where':{'id':_0x26c299[_0xe208('0x3d')]['id']}},_0x4ffa7e={};_0x4ffa7e['model']=_[_0xe208('0x3e')](db[_0xe208('0x37')][_0xe208('0x26')]);_0x4ffa7e[_0xe208('0x2b')]=_[_0xe208('0x3e')](_0x26c299[_0xe208('0x2b')]);_0x4ffa7e[_0xe208('0x32')]=_[_0xe208('0x2d')](_0x4ffa7e[_0xe208('0x29')],_0x4ffa7e[_0xe208('0x2b')]);_0x598f2f[_0xe208('0x2c')]=_[_0xe208('0x2d')](_0x4ffa7e[_0xe208('0x29')],qs[_0xe208('0x2e')](_0x26c299['query'][_0xe208('0x2e')]));_0x598f2f[_0xe208('0x2c')]=_0x598f2f[_0xe208('0x2c')][_0xe208('0x3f')]?_0x598f2f[_0xe208('0x2c')]:_0x4ffa7e['model'];if(_0x26c299['query']['includeAll']){_0x598f2f['include']=[{'all':!![]}];}_0x598f2f=_[_0xe208('0x34')]({},_0x598f2f,_0x26c299['options']);return db[_0xe208('0x37')][_0xe208('0x40')](_0x598f2f)[_0xe208('0x1f')](handleEntityNotFound(_0x51e130,null))[_0xe208('0x1f')](respondWithResult(_0x51e130,null))[_0xe208('0x3b')](handleError(_0x51e130,null));};exports[_0xe208('0x41')]=function(_0x5b4693,_0x575e2e){return db[_0xe208('0x37')]['create'](_0x5b4693['body'],{})[_0xe208('0x1f')](respondWithResult(_0x575e2e,0xc9))[_0xe208('0x3b')](handleError(_0x575e2e,null));};exports[_0xe208('0x42')]=function(_0xd59dc9,_0x3bfaf5){if(_0xd59dc9[_0xe208('0x43')]['id']){delete _0xd59dc9[_0xe208('0x43')]['id'];}return db[_0xe208('0x37')]['find']({'where':{'id':_0xd59dc9[_0xe208('0x3d')]['id']}})[_0xe208('0x1f')](handleEntityNotFound(_0x3bfaf5,null))[_0xe208('0x1f')](saveUpdates(_0xd59dc9[_0xe208('0x43')],null))['then'](respondWithResult(_0x3bfaf5,null))[_0xe208('0x3b')](handleError(_0x3bfaf5,null));};exports[_0xe208('0x20')]=function(_0x2a3059,_0x463042){return db[_0xe208('0x37')][_0xe208('0x40')]({'where':{'id':_0x2a3059[_0xe208('0x3d')]['id']}})['then'](handleEntityNotFound(_0x463042,null))[_0xe208('0x1f')](removeEntity(_0x463042,null))[_0xe208('0x3b')](handleError(_0x463042,null));};
\ No newline at end of file
index 34a63da..b8a0e94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0669=['rimraf','../../config/environment','exports','SugarcrmField','int_sugarcrm_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x544099,_0x372b30){var _0x20ab09=function(_0x149613){while(--_0x149613){_0x544099['push'](_0x544099['shift']());}};_0x20ab09(++_0x372b30);}(_0x0669,0x13b));var _0x9066=function(_0x3caeb5,_0x219363){_0x3caeb5=_0x3caeb5-0x0;var _0x5eca7e=_0x0669[_0x3caeb5];return _0x5eca7e;};'use strict';var _=require(_0x9066('0x0'));var util=require(_0x9066('0x1'));var logger=require(_0x9066('0x2'))(_0x9066('0x3'));var moment=require(_0x9066('0x4'));var BPromise=require(_0x9066('0x5'));var rp=require(_0x9066('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9066('0x7'));var config=require(_0x9066('0x8'));var attributes=require('./intSugarcrmField.attributes');module[_0x9066('0x9')]=function(_0x12e362,_0x55e328){return _0x12e362['define'](_0x9066('0xa'),attributes,{'tableName':_0x9066('0xb'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x9066('0xc'),_0x9066('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd0d4=['rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','FieldId','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x2148e1,_0x204076){var _0x13bb77=function(_0x4dd3ef){while(--_0x4dd3ef){_0x2148e1['push'](_0x2148e1['shift']());}};_0x13bb77(++_0x204076);}(_0xd0d4,0xb0));var _0x4d0d=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xd0d4[_0x32f7d7];return _0x133d09;};'use strict';var _=require(_0x4d0d('0x0'));var util=require(_0x4d0d('0x1'));var logger=require(_0x4d0d('0x2'))('api');var moment=require(_0x4d0d('0x3'));var BPromise=require(_0x4d0d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4d0d('0x5'));var rimraf=require(_0x4d0d('0x6'));var config=require(_0x4d0d('0x7'));var attributes=require(_0x4d0d('0x8'));module[_0x4d0d('0x9')]=function(_0x463dbf,_0x27695f){return _0x463dbf[_0x4d0d('0xa')](_0x4d0d('0xb'),attributes,{'tableName':_0x4d0d('0xc'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':['idField',_0x4d0d('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 9b53d64..5762b67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1ef=['then','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request'];(function(_0x21feb4,_0x2ade5e){var _0x15707d=function(_0xa82613){while(--_0xa82613){_0x21feb4['push'](_0x21feb4['shift']());}};_0x15707d(++_0x2ade5e);}(_0xd1ef,0x6d));var _0xfd1e=function(_0x58fe17,_0x32f363){_0x58fe17=_0x58fe17-0x0;var _0x377844=_0xd1ef[_0x58fe17];return _0x377844;};'use strict';var _=require(_0xfd1e('0x0'));var util=require(_0xfd1e('0x1'));var moment=require(_0xfd1e('0x2'));var BPromise=require('bluebird');var rs=require(_0xfd1e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfd1e('0x4'))['db'];var utils=require(_0xfd1e('0x5'));var logger=require(_0xfd1e('0x6'))('rpc');var config=require(_0xfd1e('0x7'));var jayson=require(_0xfd1e('0x8'));var client=jayson[_0xfd1e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x461d01,_0x51ad58,_0x349682){return new BPromise(function(_0x5225bc,_0x5798df){return client[_0xfd1e('0xa')](_0x461d01,_0x349682)[_0xfd1e('0xb')](function(_0x1ecbc1){logger['info'](_0xfd1e('0xc'),_0x51ad58,_0xfd1e('0xd'));logger[_0xfd1e('0xe')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x51ad58,_0xfd1e('0xd'),JSON[_0xfd1e('0xf')](_0x1ecbc1));if(_0x1ecbc1[_0xfd1e('0x10')]){if(_0x1ecbc1[_0xfd1e('0x10')][_0xfd1e('0x11')]===0x1f4){logger['error'](_0xfd1e('0xc'),_0x51ad58,_0x1ecbc1['error']['message']);return _0x5798df(_0x1ecbc1['error'][_0xfd1e('0x12')]);}logger[_0xfd1e('0x10')](_0xfd1e('0xc'),_0x51ad58,_0x1ecbc1['error'][_0xfd1e('0x12')]);return _0x5225bc(_0x1ecbc1['error'][_0xfd1e('0x12')]);}else{logger['info']('SugarcrmField,\x20%s,\x20%s',_0x51ad58,_0xfd1e('0xd'));_0x5225bc(_0x1ecbc1['result'][_0xfd1e('0x12')]);}})[_0xfd1e('0x13')](function(_0x25aed3){logger['error'](_0xfd1e('0xc'),_0x51ad58,_0x25aed3);_0x5798df(_0x25aed3);});});}
\ No newline at end of file
+var _0x09a4=['jayson/promise','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0x09a4,0xfd));var _0x409a=function(_0xdfee9b,_0x3a7164){_0xdfee9b=_0xdfee9b-0x0;var _0x102b13=_0x09a4[_0xdfee9b];return _0x102b13;};'use strict';var _=require(_0x409a('0x0'));var util=require(_0x409a('0x1'));var moment=require(_0x409a('0x2'));var BPromise=require(_0x409a('0x3'));var rs=require(_0x409a('0x4'));var fs=require('fs');var Redis=require(_0x409a('0x5'));var db=require(_0x409a('0x6'))['db'];var utils=require(_0x409a('0x7'));var logger=require(_0x409a('0x8'))(_0x409a('0x9'));var config=require(_0x409a('0xa'));var jayson=require(_0x409a('0xb'));var client=jayson['client'][_0x409a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2d5b8d,_0x3e28bb,_0x31dd0b){return new BPromise(function(_0xb32db,_0x43cc4a){return client[_0x409a('0xd')](_0x2d5b8d,_0x31dd0b)[_0x409a('0xe')](function(_0x4976b0){logger[_0x409a('0xf')](_0x409a('0x10'),_0x3e28bb,_0x409a('0x11'));logger[_0x409a('0x12')](_0x409a('0x13'),_0x3e28bb,_0x409a('0x11'),JSON[_0x409a('0x14')](_0x4976b0));if(_0x4976b0['error']){if(_0x4976b0['error']['code']===0x1f4){logger[_0x409a('0x15')](_0x409a('0x10'),_0x3e28bb,_0x4976b0[_0x409a('0x15')][_0x409a('0x16')]);return _0x43cc4a(_0x4976b0[_0x409a('0x15')][_0x409a('0x16')]);}logger['error']('SugarcrmField,\x20%s,\x20%s',_0x3e28bb,_0x4976b0[_0x409a('0x15')][_0x409a('0x16')]);return _0xb32db(_0x4976b0['error'][_0x409a('0x16')]);}else{logger[_0x409a('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x3e28bb,_0x409a('0x11'));_0xb32db(_0x4976b0[_0x409a('0x17')][_0x409a('0x16')]);}})['catch'](function(_0x220e8e){logger[_0x409a('0x15')](_0x409a('0x10'),_0x3e28bb,_0x220e8e);_0x43cc4a(_0x220e8e);});});}
\ No newline at end of file
index b5e236c..079dfc5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xefe5=['update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./intVtigerAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','post','create','put','/:id'];(function(_0x22fc10,_0x184cca){var _0x1f82ae=function(_0x507735){while(--_0x507735){_0x22fc10['push'](_0x22fc10['shift']());}};_0x1f82ae(++_0x184cca);}(_0xefe5,0xf6));var _0x5efe=function(_0x3d0d8d,_0x58e614){_0x3d0d8d=_0x3d0d8d-0x0;var _0x10f999=_0xefe5[_0x3d0d8d];return _0x10f999;};'use strict';var multer=require(_0x5efe('0x0'));var util=require('util');var path=require(_0x5efe('0x1'));var timeout=require(_0x5efe('0x2'));var express=require('express');var router=express[_0x5efe('0x3')]();var fs_extra=require(_0x5efe('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5efe('0x5'));var config=require('../../config/environment');var controller=require(_0x5efe('0x6'));router[_0x5efe('0x7')]('/',auth[_0x5efe('0x8')](),controller[_0x5efe('0x9')]);router[_0x5efe('0x7')]('/:id',auth[_0x5efe('0x8')](),controller[_0x5efe('0xa')]);router[_0x5efe('0x7')](_0x5efe('0xb'),auth[_0x5efe('0x8')](),controller[_0x5efe('0xc')]);router[_0x5efe('0x7')](_0x5efe('0xd'),auth[_0x5efe('0x8')](),controller['getFields']);router[_0x5efe('0xe')]('/',auth[_0x5efe('0x8')](),controller[_0x5efe('0xf')]);router[_0x5efe('0xe')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router[_0x5efe('0x10')](_0x5efe('0x11'),auth[_0x5efe('0x8')](),controller[_0x5efe('0x12')]);router[_0x5efe('0x13')](_0x5efe('0x11'),auth[_0x5efe('0x8')](),controller[_0x5efe('0x14')]);module[_0x5efe('0x15')]=router;
\ No newline at end of file
+var _0x9ef8=['delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','/:id/configurations','/:id/fields','post','create','addConfiguration'];(function(_0x2930da,_0x297def){var _0x4cbb31=function(_0x4edfb2){while(--_0x4edfb2){_0x2930da['push'](_0x2930da['shift']());}};_0x4cbb31(++_0x297def);}(_0x9ef8,0x17f));var _0x89ef=function(_0x36b400,_0x277ec5){_0x36b400=_0x36b400-0x0;var _0x4d47bf=_0x9ef8[_0x36b400];return _0x4d47bf;};'use strict';var multer=require(_0x89ef('0x0'));var util=require(_0x89ef('0x1'));var path=require('path');var timeout=require(_0x89ef('0x2'));var express=require(_0x89ef('0x3'));var router=express[_0x89ef('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x89ef('0x5'));var interaction=require(_0x89ef('0x6'));var config=require('../../config/environment');var controller=require('./intVtigerAccount.controller');router['get']('/',auth[_0x89ef('0x7')](),controller[_0x89ef('0x8')]);router[_0x89ef('0x9')](_0x89ef('0xa'),auth[_0x89ef('0x7')](),controller[_0x89ef('0xb')]);router[_0x89ef('0x9')](_0x89ef('0xc'),auth[_0x89ef('0x7')](),controller['getConfigurations']);router[_0x89ef('0x9')](_0x89ef('0xd'),auth[_0x89ef('0x7')](),controller['getFields']);router[_0x89ef('0xe')]('/',auth[_0x89ef('0x7')](),controller[_0x89ef('0xf')]);router[_0x89ef('0xe')](_0x89ef('0xc'),auth['isAuthenticated'](),controller[_0x89ef('0x10')]);router['put'](_0x89ef('0xa'),auth[_0x89ef('0x7')](),controller['update']);router[_0x89ef('0x11')](_0x89ef('0xa'),auth[_0x89ef('0x7')](),controller[_0x89ef('0x12')]);module[_0x89ef('0x13')]=router;
\ No newline at end of file
index cc7e84c..1adb3c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44a4=['sequelize','exports','STRING','HelpDesk'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x44a4,0xa0));var _0x444a=function(_0x222cb0,_0x41528a){_0x222cb0=_0x222cb0-0x0;var _0x224068=_0x44a4[_0x222cb0];return _0x224068;};'use strict';var Sequelize=require(_0x444a('0x0'));module[_0x444a('0x1')]={'name':{'type':Sequelize[_0x444a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x444a('0x2')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0x444a('0x2')],'allowNull':![],'defaultValue':_0x444a('0x3')},'remoteUri':{'type':Sequelize[_0x444a('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x444a('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0xdbcb=['sequelize','STRING','HelpDesk'];(function(_0x40e176,_0x2c6c84){var _0x4ac0bd=function(_0x581a71){while(--_0x581a71){_0x40e176['push'](_0x40e176['shift']());}};_0x4ac0bd(++_0x2c6c84);}(_0xdbcb,0x1aa));var _0xbdbc=function(_0x25cc6d,_0x3359d5){_0x25cc6d=_0x25cc6d-0x0;var _0x5188dd=_0xdbcb[_0x25cc6d];return _0x5188dd;};'use strict';var Sequelize=require(_0xbdbc('0x0'));module['exports']={'name':{'type':Sequelize[_0xbdbc('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xbdbc('0x1')]},'username':{'type':Sequelize[_0xbdbc('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xbdbc('0x1')],'allowNull':![],'defaultValue':_0xbdbc('0x2')},'remoteUri':{'type':Sequelize[_0xbdbc('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xbdbc('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xbdbc('0x1')],'allowNull':![]}};
\ No newline at end of file
index 756c3ad..ade6401 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x178e=['result','token','describe','sessionName','autogenerated','reference','owner','remove','includes','editable','false','label','startsWith','cf_','picklistValues','value','test','statusCode','error','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','end','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','findAll','rows','catch','params','include','options','find','create','body','destroy','getConfigurations','VtigerConfiguration','addConfiguration','AccountId','getSubjects','getDescriptions','VtigerField','Subjects','md5','getFields','findOne','username','description','moduleName','accessKey','slice','substring','format','%s/webservice.php','GET','getchallenge','success','POST','login'];(function(_0x374ff1,_0x3ff6fb){var _0x139bce=function(_0x2b1b57){while(--_0x2b1b57){_0x374ff1['push'](_0x374ff1['shift']());}};_0x139bce(++_0x3ff6fb);}(_0x178e,0x8e));var _0xe178=function(_0x1399d6,_0x2c1661){_0x1399d6=_0x1399d6-0x0;var _0x4a9db4=_0x178e[_0x1399d6];return _0x4a9db4;};'use strict';var emlformat=require(_0xe178('0x0'));var rimraf=require(_0xe178('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe178('0x2'));var rp=require(_0xe178('0x3'));var moment=require('moment');var BPromise=require(_0xe178('0x4'));var Mustache=require(_0xe178('0x5'));var util=require(_0xe178('0x6'));var path=require(_0xe178('0x7'));var sox=require(_0xe178('0x8'));var csv=require(_0xe178('0x9'));var ejs=require(_0xe178('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe178('0xb'));var squel=require(_0xe178('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe178('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe178('0xe'));var Papa=require(_0xe178('0xf'));var Redis=require(_0xe178('0x10'));var authService=require(_0xe178('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe178('0x12'));var hardwareService=require(_0xe178('0x13'));var logger=require(_0xe178('0x14'))(_0xe178('0x15'));var utils=require(_0xe178('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe178('0x17'))['db'];var integrations=require(_0xe178('0x18'));function respondWithStatusCode(_0x4f402b,_0x44516d){_0x44516d=_0x44516d||0xcc;return function(_0x432b25){if(_0x432b25){return _0x4f402b[_0xe178('0x19')](_0x44516d);}return _0x4f402b[_0xe178('0x1a')](_0x44516d)['end']();};}function respondWithResult(_0x418829,_0x4cf17d){_0x4cf17d=_0x4cf17d||0xc8;return function(_0x5295b4){if(_0x5295b4){return _0x418829[_0xe178('0x1a')](_0x4cf17d)[_0xe178('0x1b')](_0x5295b4);}};}function respondWithFilteredResult(_0x33c5a8,_0x265e17){return function(_0x4e90cf){if(_0x4e90cf){var _0x5c8aca=typeof _0x265e17[_0xe178('0x1c')]==='undefined'&&typeof _0x265e17['limit']===_0xe178('0x1d');var _0xdd8806=_0x4e90cf[_0xe178('0x1e')];var _0x4b56b5=_0x5c8aca?0x0:_0x265e17['offset'];var _0x3c1924=_0x5c8aca?_0x4e90cf[_0xe178('0x1e')]:_0x265e17[_0xe178('0x1c')]+_0x265e17[_0xe178('0x1f')];var _0x2aab89;if(_0x3c1924>=_0xdd8806){_0x3c1924=_0xdd8806;_0x2aab89=0xc8;}else{_0x2aab89=0xce;}_0x33c5a8[_0xe178('0x1a')](_0x2aab89);return _0x33c5a8['set'](_0xe178('0x20'),_0x4b56b5+'-'+_0x3c1924+'/'+_0xdd8806)[_0xe178('0x1b')](_0x4e90cf);}return null;};}function patchUpdates(_0x5af2da){return function(_0x3f7c26){try{jsonpatch[_0xe178('0x21')](_0x3f7c26,_0x5af2da,!![]);}catch(_0x7805e3){return BPromise[_0xe178('0x22')](_0x7805e3);}return _0x3f7c26['save']();};}function saveUpdates(_0x3ec30e,_0x547b49){return function(_0x17aacb){if(_0x17aacb){return _0x17aacb[_0xe178('0x23')](_0x3ec30e)[_0xe178('0x24')](function(_0x5dd0fe){return _0x5dd0fe;});}return null;};}function removeEntity(_0x4755ce,_0x16e17a){return function(_0x44a618){if(_0x44a618){return _0x44a618['destroy']()[_0xe178('0x24')](function(){_0x4755ce[_0xe178('0x1a')](0xcc)[_0xe178('0x25')]();});}};}function handleEntityNotFound(_0x5a8ba3,_0x2e121e){return function(_0x36bc01){if(!_0x36bc01){_0x5a8ba3[_0xe178('0x19')](0x194);}return _0x36bc01;};}function handleError(_0x116a13,_0x3a25de){_0x3a25de=_0x3a25de||0x1f4;return function(_0x553083){logger['error'](_0x553083[_0xe178('0x26')]);if(_0x553083['name']){delete _0x553083[_0xe178('0x27')];}_0x116a13[_0xe178('0x1a')](_0x3a25de)[_0xe178('0x28')](_0x553083);};}exports[_0xe178('0x29')]=function(_0x60f35,_0x3a2e96){var _0x217fa5={},_0xa6e7d8={},_0x124afc={'count':0x0,'rows':[]};var _0x63ba6d=_[_0xe178('0x2a')](db[_0xe178('0x2b')][_0xe178('0x2c')],function(_0x5c78ad){return{'name':_0x5c78ad[_0xe178('0x2d')],'type':_0x5c78ad[_0xe178('0x2e')][_0xe178('0x2f')]};});_0xa6e7d8[_0xe178('0x30')]=_['map'](_0x63ba6d,_0xe178('0x27'));_0xa6e7d8[_0xe178('0x31')]=_[_0xe178('0x32')](_0x60f35[_0xe178('0x31')]);_0xa6e7d8['filters']=_[_0xe178('0x33')](_0xa6e7d8[_0xe178('0x30')],_0xa6e7d8[_0xe178('0x31')]);_0x217fa5['attributes']=_[_0xe178('0x33')](_0xa6e7d8[_0xe178('0x30')],qs[_0xe178('0x34')](_0x60f35[_0xe178('0x31')][_0xe178('0x34')]));_0x217fa5[_0xe178('0x35')]=_0x217fa5['attributes'][_0xe178('0x36')]?_0x217fa5[_0xe178('0x35')]:_0xa6e7d8[_0xe178('0x30')];if(!_0x60f35[_0xe178('0x31')][_0xe178('0x37')](_0xe178('0x38'))){_0x217fa5['limit']=qs['limit'](_0x60f35[_0xe178('0x31')][_0xe178('0x1f')]);_0x217fa5[_0xe178('0x1c')]=qs[_0xe178('0x1c')](_0x60f35['query'][_0xe178('0x1c')]);}_0x217fa5[_0xe178('0x39')]=qs[_0xe178('0x3a')](_0x60f35[_0xe178('0x31')][_0xe178('0x3a')]);_0x217fa5['where']=qs[_0xe178('0x3b')](_[_0xe178('0x3c')](_0x60f35['query'],_0xa6e7d8[_0xe178('0x3b')]),_0x63ba6d);if(_0x60f35[_0xe178('0x31')][_0xe178('0x3d')]){_0x217fa5[_0xe178('0x3e')]=_[_0xe178('0x3f')](_0x217fa5['where'],{'$or':_[_0xe178('0x2a')](_0x63ba6d,function(_0x46fe86){if(_0x46fe86[_0xe178('0x2e')]!==_0xe178('0x40')){var _0x4a1015={};_0x4a1015[_0x46fe86[_0xe178('0x27')]]={'$like':'%'+_0x60f35[_0xe178('0x31')][_0xe178('0x3d')]+'%'};return _0x4a1015;}})});}_0x217fa5=_['merge']({},_0x217fa5,_0x60f35['options']);var _0x5db2be={'where':_0x217fa5[_0xe178('0x3e')]};return db[_0xe178('0x2b')][_0xe178('0x1e')](_0x5db2be)[_0xe178('0x24')](function(_0x18ce85){_0x124afc[_0xe178('0x1e')]=_0x18ce85;if(_0x60f35[_0xe178('0x31')][_0xe178('0x41')]){_0x217fa5['include']=[{'all':!![]}];}return db['VtigerAccount'][_0xe178('0x42')](_0x217fa5);})[_0xe178('0x24')](function(_0x1d8ca7){_0x124afc[_0xe178('0x43')]=_0x1d8ca7;return _0x124afc;})[_0xe178('0x24')](respondWithFilteredResult(_0x3a2e96,_0x217fa5))[_0xe178('0x44')](handleError(_0x3a2e96,null));};exports['show']=function(_0x5b0b85,_0x3b2b36){var _0x3ee15d={'raw':![],'where':{'id':_0x5b0b85[_0xe178('0x45')]['id']}},_0x2fd2f1={};_0x2fd2f1['model']=_[_0xe178('0x32')](db[_0xe178('0x2b')]['rawAttributes']);_0x2fd2f1[_0xe178('0x31')]=_['keys'](_0x5b0b85[_0xe178('0x31')]);_0x2fd2f1['filters']=_[_0xe178('0x33')](_0x2fd2f1[_0xe178('0x30')],_0x2fd2f1['query']);_0x3ee15d[_0xe178('0x35')]=_[_0xe178('0x33')](_0x2fd2f1[_0xe178('0x30')],qs['fields'](_0x5b0b85[_0xe178('0x31')]['fields']));_0x3ee15d[_0xe178('0x35')]=_0x3ee15d['attributes'][_0xe178('0x36')]?_0x3ee15d[_0xe178('0x35')]:_0x2fd2f1[_0xe178('0x30')];if(_0x5b0b85['query'][_0xe178('0x41')]){_0x3ee15d[_0xe178('0x46')]=[{'all':!![]}];}_0x3ee15d=_[_0xe178('0x3f')]({},_0x3ee15d,_0x5b0b85[_0xe178('0x47')]);return db[_0xe178('0x2b')][_0xe178('0x48')](_0x3ee15d)[_0xe178('0x24')](handleEntityNotFound(_0x3b2b36,null))['then'](respondWithResult(_0x3b2b36,null))[_0xe178('0x44')](handleError(_0x3b2b36,null));};exports[_0xe178('0x49')]=function(_0x52493e,_0x3b577a){return db[_0xe178('0x2b')][_0xe178('0x49')](_0x52493e[_0xe178('0x4a')],{})[_0xe178('0x24')](respondWithResult(_0x3b577a,0xc9))[_0xe178('0x44')](handleError(_0x3b577a,null));};exports[_0xe178('0x23')]=function(_0x5eb2f6,_0x41d572){if(_0x5eb2f6[_0xe178('0x4a')]['id']){delete _0x5eb2f6['body']['id'];}return db[_0xe178('0x2b')][_0xe178('0x48')]({'where':{'id':_0x5eb2f6['params']['id']}})['then'](handleEntityNotFound(_0x41d572,null))['then'](saveUpdates(_0x5eb2f6[_0xe178('0x4a')],null))['then'](respondWithResult(_0x41d572,null))['catch'](handleError(_0x41d572,null));};exports[_0xe178('0x4b')]=function(_0x3894d4,_0x4b5b5d){return db[_0xe178('0x2b')][_0xe178('0x48')]({'where':{'id':_0x3894d4[_0xe178('0x45')]['id']}})[_0xe178('0x24')](handleEntityNotFound(_0x4b5b5d,null))[_0xe178('0x24')](removeEntity(_0x4b5b5d,null))[_0xe178('0x44')](handleError(_0x4b5b5d,null));};exports[_0xe178('0x4c')]=function(_0x4feb8c,_0x4651a1,_0x5ca06c){var _0x332025={};var _0x44f1de={};var _0x482f24;var _0x2f841f;return db[_0xe178('0x2b')]['findOne']({'where':{'id':_0x4feb8c['params']['id']}})[_0xe178('0x24')](handleEntityNotFound(_0x4651a1,null))[_0xe178('0x24')](function(_0x4a90b8){if(_0x4a90b8){_0x482f24=_0x4a90b8;_0x44f1de[_0xe178('0x30')]=_[_0xe178('0x32')](db[_0xe178('0x4d')][_0xe178('0x2c')]);_0x44f1de[_0xe178('0x31')]=_[_0xe178('0x32')](_0x4feb8c[_0xe178('0x31')]);_0x44f1de[_0xe178('0x3b')]=_['intersection'](_0x44f1de[_0xe178('0x30')],_0x44f1de[_0xe178('0x31')]);_0x332025[_0xe178('0x35')]=_[_0xe178('0x33')](_0x44f1de[_0xe178('0x30')],qs[_0xe178('0x34')](_0x4feb8c[_0xe178('0x31')]['fields']));_0x332025['attributes']=_0x332025[_0xe178('0x35')][_0xe178('0x36')]?_0x332025[_0xe178('0x35')]:_0x44f1de['model'];_0x332025[_0xe178('0x39')]=qs[_0xe178('0x3a')](_0x4feb8c[_0xe178('0x31')]['sort']);_0x332025[_0xe178('0x3e')]=qs[_0xe178('0x3b')](_['pick'](_0x4feb8c[_0xe178('0x31')],_0x44f1de['filters']));if(_0x4feb8c[_0xe178('0x31')]['filter']){_0x332025['where']=_['merge'](_0x332025['where'],{'$or':_[_0xe178('0x2a')](_0x332025[_0xe178('0x35')],function(_0x2b081a){var _0x484ad9={};_0x484ad9[_0x2b081a]={'$like':'%'+_0x4feb8c[_0xe178('0x31')]['filter']+'%'};return _0x484ad9;})});}_0x332025=_['merge']({},_0x332025,_0x4feb8c[_0xe178('0x47')]);return _0x482f24[_0xe178('0x4c')](_0x332025);}})['then'](function(_0x306750){if(_0x306750){_0x2f841f=_0x306750[_0xe178('0x36')];if(!_0x4feb8c[_0xe178('0x31')][_0xe178('0x37')](_0xe178('0x38'))){_0x332025[_0xe178('0x1f')]=qs[_0xe178('0x1f')](_0x4feb8c[_0xe178('0x31')][_0xe178('0x1f')]);_0x332025['offset']=qs[_0xe178('0x1c')](_0x4feb8c[_0xe178('0x31')][_0xe178('0x1c')]);}return _0x482f24[_0xe178('0x4c')](_0x332025);}})['then'](function(_0x4537f0){if(_0x4537f0){return _0x4537f0?{'count':_0x2f841f,'rows':_0x4537f0}:null;}})[_0xe178('0x24')](respondWithResult(_0x4651a1,null))[_0xe178('0x44')](handleError(_0x4651a1,null));};exports[_0xe178('0x4e')]=function(_0x34bcdb,_0x12a45e,_0x329e4b){if(_0x34bcdb[_0xe178('0x4a')]['id']){delete _0x34bcdb['body']['id'];}return db[_0xe178('0x2b')]['findOne']({'where':{'id':_0x34bcdb[_0xe178('0x45')]['id']}})[_0xe178('0x24')](handleEntityNotFound(_0x12a45e,null))['then'](function(_0x2bedd4){if(_0x2bedd4){_0x34bcdb['body'][_0xe178('0x4f')]=_0x2bedd4['id'];_0x34bcdb[_0xe178('0x4a')]['Subjects']=integrations[_0xe178('0x50')](_0x34bcdb[_0xe178('0x4a')]['channel'],_0x34bcdb[_0xe178('0x4a')][_0xe178('0x2e')]);_0x34bcdb[_0xe178('0x4a')]['Descriptions']=integrations[_0xe178('0x51')](_0x34bcdb[_0xe178('0x4a')]['channel'],_0x34bcdb['body'][_0xe178('0x2e')]);return db[_0xe178('0x4d')][_0xe178('0x49')](_0x34bcdb[_0xe178('0x4a')],{'include':[{'model':db[_0xe178('0x52')],'as':_0xe178('0x53')},{'model':db[_0xe178('0x52')],'as':'Descriptions'}]});}return null;})[_0xe178('0x24')](respondWithResult(_0x12a45e,null))[_0xe178('0x44')](handleError(_0x12a45e,null));};var md5=require(_0xe178('0x54'));exports[_0xe178('0x55')]=function(_0x4bb0ac,_0x2475e6,_0x48064b){var _0x5bf308=null;var _0x3b236f=null;var _0x4d1270=null;var _0x383f84=null;var _0x13d267='';return db[_0xe178('0x2b')][_0xe178('0x56')]({'where':{'id':_0x4bb0ac[_0xe178('0x45')]['id']},'attributes':['id',_0xe178('0x27'),_0xe178('0x57'),_0xe178('0x58'),_0xe178('0x59'),'remoteUri','serverUrl',_0xe178('0x5a')]})[_0xe178('0x24')](handleEntityNotFound(_0x2475e6,null))[_0xe178('0x24')](function(_0x3f7b52){if(_0x3f7b52){_0x5bf308=_0x3f7b52[_0xe178('0x57')];_0x3b236f=_0x3f7b52['accessKey'];_0x4d1270=_0x3f7b52[_0xe178('0x59')];_0x13d267=_0x3f7b52['remoteUri'];var _0x2b2ba3=_0x13d267[_0xe178('0x5b')](-0x1);if(_0x2b2ba3==='/'){_0x13d267=_0x13d267[_0xe178('0x5c')](0x0,_0x13d267['lastIndexOf'](_0x2b2ba3));}_0x383f84=util[_0xe178('0x5d')](_0xe178('0x5e'),_0x13d267);var _0xb7394b={'method':_0xe178('0x5f'),'uri':_0x383f84,'qs':{'operation':_0xe178('0x60'),'username':_0x3f7b52[_0xe178('0x57')]},'json':!![]};return rp(_0xb7394b);}})['then'](function(_0x36033d){if(_0x36033d[_0xe178('0x61')]){var _0x3d7f17={'method':_0xe178('0x62'),'uri':_0x383f84,'form':{'operation':_0xe178('0x63'),'username':_0x5bf308,'accessKey':md5(_0x36033d[_0xe178('0x64')][_0xe178('0x65')]+_0x3b236f)},'json':!![]};return rp(_0x3d7f17);}})[_0xe178('0x24')](function(_0x257838){if(_0x257838[_0xe178('0x61')]){var _0x36b7f9={'method':_0xe178('0x5f'),'uri':_0x383f84,'qs':{'operation':_0xe178('0x66'),'username':_0x5bf308,'sessionName':_0x257838[_0xe178('0x64')][_0xe178('0x67')],'elementType':_0x4d1270},'json':!![]};return rp(_0x36b7f9);}})[_0xe178('0x24')](function(_0x1dc19e){if(_0x1dc19e['success']){var _0xbe8a89=[_0xe178('0x68'),_0xe178('0x69'),_0xe178('0x6a')];_[_0xe178('0x6b')](_0x1dc19e[_0xe178('0x64')]['fields'],function(_0x18a60e){return _0xbe8a89[_0xe178('0x6c')](_0x18a60e['type'][_0xe178('0x27')]);});_['remove'](_0x1dc19e[_0xe178('0x64')][_0xe178('0x34')],function(_0x46a28a){return _0x46a28a[_0xe178('0x6d')]===_0xe178('0x6e');});return{'count':_0x1dc19e['result'][_0xe178('0x34')]['length'],'rows':_[_0xe178('0x2a')](_0x1dc19e[_0xe178('0x64')]['fields'],function(_0x1ab813){return{'id':_0x1ab813['name'],'name':_0x1ab813[_0xe178('0x6f')],'custom':_[_0xe178('0x70')](_0x1ab813[_0xe178('0x27')],_0xe178('0x71'))?!![]:![],'options':_0x1ab813[_0xe178('0x2e')][_0xe178('0x27')]==='picklist'&&_0x1ab813[_0xe178('0x2e')][_0xe178('0x72')][_0xe178('0x36')]>0x0?_['map'](_0x1ab813[_0xe178('0x2e')][_0xe178('0x72')],function(_0x2c1816){return{'name':_0x2c1816[_0xe178('0x6f')],'value':_0x2c1816[_0xe178('0x73')]};}):[]};})};}})[_0xe178('0x24')](respondWithResult(_0x2475e6,null))['catch'](function(_0x3dce67){console['log']('vTiger\x20error:\x20'+_0x3dce67);var _0x172a61=_0x4bb0ac[_0xe178('0x31')][_0xe178('0x74')]?0x1f4:_0x3dce67[_0xe178('0x75')]||0x1f4;logger[_0xe178('0x76')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x172a61,JSON[_0xe178('0x77')](_0x3dce67));delete _0x3dce67['name'];if(_0x172a61===0x191){_0x172a61=0x190;}_0x2475e6[_0xe178('0x1a')](_0x172a61)[_0xe178('0x28')](_0x4bb0ac[_0xe178('0x31')][_0xe178('0x74')]?{'message':_0xe178('0x78'),'statusCode':_0x3dce67[_0xe178('0x75')]}:_0x3dce67);});};
\ No newline at end of file
+var _0xf4ca=['remoteUri','serverUrl','accessKey','moduleName','slice','substring','lastIndexOf','format','%s/webservice.php','getchallenge','success','POST','result','token','GET','describe','sessionName','autogenerated','remove','includes','editable','false','label','startsWith','cf_','picklistValues','value','log','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','json','offset','limit','count','Content-Range','update','then','destroy','stack','name','send','index','map','VtigerAccount','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','length','order','sort','where','filters','pick','VIRTUAL','filter','includeAll','findAll','rows','show','merge','options','catch','create','body','find','params','getConfigurations','findOne','VtigerConfiguration','hasOwnProperty','nolimit','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','description'];(function(_0x3a2c67,_0x32d339){var _0xeb9da5=function(_0x2acead){while(--_0x2acead){_0x3a2c67['push'](_0x3a2c67['shift']());}};_0xeb9da5(++_0x32d339);}(_0xf4ca,0x17d));var _0xaf4c=function(_0x311492,_0x2ceff1){_0x311492=_0x311492-0x0;var _0x3237c7=_0xf4ca[_0x311492];return _0x3237c7;};'use strict';var emlformat=require(_0xaf4c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaf4c('0x1'));var jsonpatch=require(_0xaf4c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xaf4c('0x3'));var util=require(_0xaf4c('0x4'));var path=require(_0xaf4c('0x5'));var sox=require(_0xaf4c('0x6'));var csv=require(_0xaf4c('0x7'));var ejs=require(_0xaf4c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaf4c('0x9'));var squel=require(_0xaf4c('0xa'));var crypto=require('crypto');var jsforce=require(_0xaf4c('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xaf4c('0x7'));var querystring=require(_0xaf4c('0xc'));var Papa=require(_0xaf4c('0xd'));var Redis=require(_0xaf4c('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xaf4c('0xf'));var as=require(_0xaf4c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xaf4c('0x11'));var utils=require(_0xaf4c('0x12'));var config=require(_0xaf4c('0x13'));var licenseUtil=require(_0xaf4c('0x14'));var db=require(_0xaf4c('0x15'))['db'];var integrations=require(_0xaf4c('0x16'));function respondWithStatusCode(_0x3f5af4,_0x3e0fd2){_0x3e0fd2=_0x3e0fd2||0xcc;return function(_0x292dcc){if(_0x292dcc){return _0x3f5af4['sendStatus'](_0x3e0fd2);}return _0x3f5af4['status'](_0x3e0fd2)[_0xaf4c('0x17')]();};}function respondWithResult(_0x4ce050,_0x4bb97a){_0x4bb97a=_0x4bb97a||0xc8;return function(_0x158348){if(_0x158348){return _0x4ce050[_0xaf4c('0x18')](_0x4bb97a)[_0xaf4c('0x19')](_0x158348);}};}function respondWithFilteredResult(_0x483b70,_0x428854){return function(_0x269a61){if(_0x269a61){var _0x50fb0f=typeof _0x428854[_0xaf4c('0x1a')]==='undefined'&&typeof _0x428854[_0xaf4c('0x1b')]==='undefined';var _0x1d6cce=_0x269a61[_0xaf4c('0x1c')];var _0x16563b=_0x50fb0f?0x0:_0x428854[_0xaf4c('0x1a')];var _0x21fc5b=_0x50fb0f?_0x269a61[_0xaf4c('0x1c')]:_0x428854[_0xaf4c('0x1a')]+_0x428854['limit'];var _0x291047;if(_0x21fc5b>=_0x1d6cce){_0x21fc5b=_0x1d6cce;_0x291047=0xc8;}else{_0x291047=0xce;}_0x483b70[_0xaf4c('0x18')](_0x291047);return _0x483b70['set'](_0xaf4c('0x1d'),_0x16563b+'-'+_0x21fc5b+'/'+_0x1d6cce)[_0xaf4c('0x19')](_0x269a61);}return null;};}function patchUpdates(_0x5144e4){return function(_0x577157){try{jsonpatch['apply'](_0x577157,_0x5144e4,!![]);}catch(_0x1d5989){return BPromise['reject'](_0x1d5989);}return _0x577157['save']();};}function saveUpdates(_0x4fbfa5,_0x2315ed){return function(_0x50e4e3){if(_0x50e4e3){return _0x50e4e3[_0xaf4c('0x1e')](_0x4fbfa5)[_0xaf4c('0x1f')](function(_0x298b83){return _0x298b83;});}return null;};}function removeEntity(_0x20c577,_0x30d764){return function(_0x47a935){if(_0x47a935){return _0x47a935[_0xaf4c('0x20')]()[_0xaf4c('0x1f')](function(){_0x20c577[_0xaf4c('0x18')](0xcc)[_0xaf4c('0x17')]();});}};}function handleEntityNotFound(_0x530967,_0x4f5e0d){return function(_0x251894){if(!_0x251894){_0x530967['sendStatus'](0x194);}return _0x251894;};}function handleError(_0x575dc6,_0x1c6602){_0x1c6602=_0x1c6602||0x1f4;return function(_0xf54e3a){logger['error'](_0xf54e3a[_0xaf4c('0x21')]);if(_0xf54e3a[_0xaf4c('0x22')]){delete _0xf54e3a[_0xaf4c('0x22')];}_0x575dc6['status'](_0x1c6602)[_0xaf4c('0x23')](_0xf54e3a);};}exports[_0xaf4c('0x24')]=function(_0x58b905,_0x2ae548){var _0x53a202={},_0x4d5a27={},_0x5d043e={'count':0x0,'rows':[]};var _0x477942=_[_0xaf4c('0x25')](db[_0xaf4c('0x26')][_0xaf4c('0x27')],function(_0x42034e){return{'name':_0x42034e['fieldName'],'type':_0x42034e[_0xaf4c('0x28')][_0xaf4c('0x29')]};});_0x4d5a27[_0xaf4c('0x2a')]=_[_0xaf4c('0x25')](_0x477942,'name');_0x4d5a27['query']=_[_0xaf4c('0x2b')](_0x58b905[_0xaf4c('0x2c')]);_0x4d5a27['filters']=_[_0xaf4c('0x2d')](_0x4d5a27[_0xaf4c('0x2a')],_0x4d5a27[_0xaf4c('0x2c')]);_0x53a202[_0xaf4c('0x2e')]=_['intersection'](_0x4d5a27[_0xaf4c('0x2a')],qs[_0xaf4c('0x2f')](_0x58b905[_0xaf4c('0x2c')][_0xaf4c('0x2f')]));_0x53a202[_0xaf4c('0x2e')]=_0x53a202['attributes'][_0xaf4c('0x30')]?_0x53a202[_0xaf4c('0x2e')]:_0x4d5a27['model'];if(!_0x58b905['query']['hasOwnProperty']('nolimit')){_0x53a202['limit']=qs[_0xaf4c('0x1b')](_0x58b905[_0xaf4c('0x2c')][_0xaf4c('0x1b')]);_0x53a202[_0xaf4c('0x1a')]=qs[_0xaf4c('0x1a')](_0x58b905[_0xaf4c('0x2c')][_0xaf4c('0x1a')]);}_0x53a202[_0xaf4c('0x31')]=qs[_0xaf4c('0x32')](_0x58b905['query']['sort']);_0x53a202[_0xaf4c('0x33')]=qs[_0xaf4c('0x34')](_[_0xaf4c('0x35')](_0x58b905[_0xaf4c('0x2c')],_0x4d5a27[_0xaf4c('0x34')]),_0x477942);if(_0x58b905['query']['filter']){_0x53a202['where']=_['merge'](_0x53a202[_0xaf4c('0x33')],{'$or':_[_0xaf4c('0x25')](_0x477942,function(_0x43607d){if(_0x43607d['type']!==_0xaf4c('0x36')){var _0x143c5c={};_0x143c5c[_0x43607d['name']]={'$like':'%'+_0x58b905[_0xaf4c('0x2c')][_0xaf4c('0x37')]+'%'};return _0x143c5c;}})});}_0x53a202=_['merge']({},_0x53a202,_0x58b905['options']);var _0x153c9f={'where':_0x53a202[_0xaf4c('0x33')]};return db['VtigerAccount'][_0xaf4c('0x1c')](_0x153c9f)['then'](function(_0xc4bdc6){_0x5d043e['count']=_0xc4bdc6;if(_0x58b905[_0xaf4c('0x2c')][_0xaf4c('0x38')]){_0x53a202['include']=[{'all':!![]}];}return db['VtigerAccount'][_0xaf4c('0x39')](_0x53a202);})['then'](function(_0x19d801){_0x5d043e[_0xaf4c('0x3a')]=_0x19d801;return _0x5d043e;})['then'](respondWithFilteredResult(_0x2ae548,_0x53a202))['catch'](handleError(_0x2ae548,null));};exports[_0xaf4c('0x3b')]=function(_0x430878,_0x1ca046){var _0x4a56c5={'raw':![],'where':{'id':_0x430878['params']['id']}},_0x47249d={};_0x47249d[_0xaf4c('0x2a')]=_['keys'](db[_0xaf4c('0x26')][_0xaf4c('0x27')]);_0x47249d[_0xaf4c('0x2c')]=_['keys'](_0x430878[_0xaf4c('0x2c')]);_0x47249d['filters']=_[_0xaf4c('0x2d')](_0x47249d[_0xaf4c('0x2a')],_0x47249d[_0xaf4c('0x2c')]);_0x4a56c5[_0xaf4c('0x2e')]=_[_0xaf4c('0x2d')](_0x47249d[_0xaf4c('0x2a')],qs[_0xaf4c('0x2f')](_0x430878[_0xaf4c('0x2c')][_0xaf4c('0x2f')]));_0x4a56c5['attributes']=_0x4a56c5[_0xaf4c('0x2e')][_0xaf4c('0x30')]?_0x4a56c5[_0xaf4c('0x2e')]:_0x47249d[_0xaf4c('0x2a')];if(_0x430878[_0xaf4c('0x2c')][_0xaf4c('0x38')]){_0x4a56c5['include']=[{'all':!![]}];}_0x4a56c5=_[_0xaf4c('0x3c')]({},_0x4a56c5,_0x430878[_0xaf4c('0x3d')]);return db[_0xaf4c('0x26')]['find'](_0x4a56c5)[_0xaf4c('0x1f')](handleEntityNotFound(_0x1ca046,null))['then'](respondWithResult(_0x1ca046,null))[_0xaf4c('0x3e')](handleError(_0x1ca046,null));};exports[_0xaf4c('0x3f')]=function(_0xf4696b,_0x5f111b){return db['VtigerAccount'][_0xaf4c('0x3f')](_0xf4696b[_0xaf4c('0x40')],{})[_0xaf4c('0x1f')](respondWithResult(_0x5f111b,0xc9))[_0xaf4c('0x3e')](handleError(_0x5f111b,null));};exports[_0xaf4c('0x1e')]=function(_0x43b453,_0x45175f){if(_0x43b453[_0xaf4c('0x40')]['id']){delete _0x43b453['body']['id'];}return db[_0xaf4c('0x26')][_0xaf4c('0x41')]({'where':{'id':_0x43b453['params']['id']}})[_0xaf4c('0x1f')](handleEntityNotFound(_0x45175f,null))[_0xaf4c('0x1f')](saveUpdates(_0x43b453[_0xaf4c('0x40')],null))['then'](respondWithResult(_0x45175f,null))[_0xaf4c('0x3e')](handleError(_0x45175f,null));};exports[_0xaf4c('0x20')]=function(_0x31c3a8,_0x3b6fdc){return db['VtigerAccount']['find']({'where':{'id':_0x31c3a8[_0xaf4c('0x42')]['id']}})[_0xaf4c('0x1f')](handleEntityNotFound(_0x3b6fdc,null))[_0xaf4c('0x1f')](removeEntity(_0x3b6fdc,null))['catch'](handleError(_0x3b6fdc,null));};exports[_0xaf4c('0x43')]=function(_0x214706,_0x1f3d10,_0x3e9a08){var _0x54ee69={};var _0x1b716b={};var _0x1a908e;var _0xc40be6;return db[_0xaf4c('0x26')][_0xaf4c('0x44')]({'where':{'id':_0x214706[_0xaf4c('0x42')]['id']}})[_0xaf4c('0x1f')](handleEntityNotFound(_0x1f3d10,null))['then'](function(_0x3f0beb){if(_0x3f0beb){_0x1a908e=_0x3f0beb;_0x1b716b[_0xaf4c('0x2a')]=_[_0xaf4c('0x2b')](db[_0xaf4c('0x45')]['rawAttributes']);_0x1b716b[_0xaf4c('0x2c')]=_[_0xaf4c('0x2b')](_0x214706['query']);_0x1b716b[_0xaf4c('0x34')]=_['intersection'](_0x1b716b[_0xaf4c('0x2a')],_0x1b716b[_0xaf4c('0x2c')]);_0x54ee69[_0xaf4c('0x2e')]=_[_0xaf4c('0x2d')](_0x1b716b[_0xaf4c('0x2a')],qs[_0xaf4c('0x2f')](_0x214706['query']['fields']));_0x54ee69[_0xaf4c('0x2e')]=_0x54ee69[_0xaf4c('0x2e')][_0xaf4c('0x30')]?_0x54ee69[_0xaf4c('0x2e')]:_0x1b716b[_0xaf4c('0x2a')];_0x54ee69[_0xaf4c('0x31')]=qs['sort'](_0x214706[_0xaf4c('0x2c')][_0xaf4c('0x32')]);_0x54ee69[_0xaf4c('0x33')]=qs[_0xaf4c('0x34')](_[_0xaf4c('0x35')](_0x214706[_0xaf4c('0x2c')],_0x1b716b[_0xaf4c('0x34')]));if(_0x214706['query'][_0xaf4c('0x37')]){_0x54ee69[_0xaf4c('0x33')]=_[_0xaf4c('0x3c')](_0x54ee69[_0xaf4c('0x33')],{'$or':_[_0xaf4c('0x25')](_0x54ee69[_0xaf4c('0x2e')],function(_0x3db7c5){var _0x47bfaf={};_0x47bfaf[_0x3db7c5]={'$like':'%'+_0x214706[_0xaf4c('0x2c')][_0xaf4c('0x37')]+'%'};return _0x47bfaf;})});}_0x54ee69=_[_0xaf4c('0x3c')]({},_0x54ee69,_0x214706['options']);return _0x1a908e[_0xaf4c('0x43')](_0x54ee69);}})[_0xaf4c('0x1f')](function(_0x324c3b){if(_0x324c3b){_0xc40be6=_0x324c3b[_0xaf4c('0x30')];if(!_0x214706[_0xaf4c('0x2c')][_0xaf4c('0x46')](_0xaf4c('0x47'))){_0x54ee69['limit']=qs[_0xaf4c('0x1b')](_0x214706['query'][_0xaf4c('0x1b')]);_0x54ee69[_0xaf4c('0x1a')]=qs[_0xaf4c('0x1a')](_0x214706[_0xaf4c('0x2c')][_0xaf4c('0x1a')]);}return _0x1a908e[_0xaf4c('0x43')](_0x54ee69);}})[_0xaf4c('0x1f')](function(_0x2bda77){if(_0x2bda77){return _0x2bda77?{'count':_0xc40be6,'rows':_0x2bda77}:null;}})[_0xaf4c('0x1f')](respondWithResult(_0x1f3d10,null))['catch'](handleError(_0x1f3d10,null));};exports['addConfiguration']=function(_0x5bf232,_0x5e4e38,_0xa1bb34){if(_0x5bf232[_0xaf4c('0x40')]['id']){delete _0x5bf232[_0xaf4c('0x40')]['id'];}return db[_0xaf4c('0x26')][_0xaf4c('0x44')]({'where':{'id':_0x5bf232[_0xaf4c('0x42')]['id']}})[_0xaf4c('0x1f')](handleEntityNotFound(_0x5e4e38,null))[_0xaf4c('0x1f')](function(_0x1f726c){if(_0x1f726c){_0x5bf232[_0xaf4c('0x40')][_0xaf4c('0x48')]=_0x1f726c['id'];_0x5bf232[_0xaf4c('0x40')][_0xaf4c('0x49')]=integrations[_0xaf4c('0x4a')](_0x5bf232[_0xaf4c('0x40')][_0xaf4c('0x4b')],_0x5bf232[_0xaf4c('0x40')]['type']);_0x5bf232[_0xaf4c('0x40')][_0xaf4c('0x4c')]=integrations[_0xaf4c('0x4d')](_0x5bf232[_0xaf4c('0x40')]['channel'],_0x5bf232['body'][_0xaf4c('0x28')]);return db[_0xaf4c('0x45')][_0xaf4c('0x3f')](_0x5bf232[_0xaf4c('0x40')],{'include':[{'model':db[_0xaf4c('0x4e')],'as':_0xaf4c('0x49')},{'model':db[_0xaf4c('0x4e')],'as':_0xaf4c('0x4c')}]});}return null;})['then'](respondWithResult(_0x5e4e38,null))[_0xaf4c('0x3e')](handleError(_0x5e4e38,null));};var md5=require(_0xaf4c('0x4f'));exports[_0xaf4c('0x50')]=function(_0x32143d,_0x205197,_0x181340){var _0x4cab5e=null;var _0x1ee1d3=null;var _0x321cfe=null;var _0x100824=null;var _0x464614='';return db[_0xaf4c('0x26')]['findOne']({'where':{'id':_0x32143d[_0xaf4c('0x42')]['id']},'attributes':['id','name',_0xaf4c('0x51'),_0xaf4c('0x52'),'moduleName',_0xaf4c('0x53'),_0xaf4c('0x54'),_0xaf4c('0x55')]})[_0xaf4c('0x1f')](handleEntityNotFound(_0x205197,null))['then'](function(_0x410d8f){if(_0x410d8f){_0x4cab5e=_0x410d8f[_0xaf4c('0x51')];_0x1ee1d3=_0x410d8f[_0xaf4c('0x55')];_0x321cfe=_0x410d8f[_0xaf4c('0x56')];_0x464614=_0x410d8f[_0xaf4c('0x53')];var _0x289674=_0x464614[_0xaf4c('0x57')](-0x1);if(_0x289674==='/'){_0x464614=_0x464614[_0xaf4c('0x58')](0x0,_0x464614[_0xaf4c('0x59')](_0x289674));}_0x100824=util[_0xaf4c('0x5a')](_0xaf4c('0x5b'),_0x464614);var _0x5af4c2={'method':'GET','uri':_0x100824,'qs':{'operation':_0xaf4c('0x5c'),'username':_0x410d8f[_0xaf4c('0x51')]},'json':!![]};return rp(_0x5af4c2);}})[_0xaf4c('0x1f')](function(_0x23d3e0){if(_0x23d3e0[_0xaf4c('0x5d')]){var _0x570b8c={'method':_0xaf4c('0x5e'),'uri':_0x100824,'form':{'operation':'login','username':_0x4cab5e,'accessKey':md5(_0x23d3e0[_0xaf4c('0x5f')][_0xaf4c('0x60')]+_0x1ee1d3)},'json':!![]};return rp(_0x570b8c);}})['then'](function(_0x2dcfea){if(_0x2dcfea['success']){var _0x130e5a={'method':_0xaf4c('0x61'),'uri':_0x100824,'qs':{'operation':_0xaf4c('0x62'),'username':_0x4cab5e,'sessionName':_0x2dcfea[_0xaf4c('0x5f')][_0xaf4c('0x63')],'elementType':_0x321cfe},'json':!![]};return rp(_0x130e5a);}})[_0xaf4c('0x1f')](function(_0x2db576){if(_0x2db576[_0xaf4c('0x5d')]){var _0x2f58a8=[_0xaf4c('0x64'),'reference','owner'];_[_0xaf4c('0x65')](_0x2db576[_0xaf4c('0x5f')][_0xaf4c('0x2f')],function(_0x2135e4){return _0x2f58a8[_0xaf4c('0x66')](_0x2135e4[_0xaf4c('0x28')][_0xaf4c('0x22')]);});_['remove'](_0x2db576[_0xaf4c('0x5f')][_0xaf4c('0x2f')],function(_0x3aa34b){return _0x3aa34b[_0xaf4c('0x67')]===_0xaf4c('0x68');});return{'count':_0x2db576[_0xaf4c('0x5f')][_0xaf4c('0x2f')][_0xaf4c('0x30')],'rows':_[_0xaf4c('0x25')](_0x2db576['result'][_0xaf4c('0x2f')],function(_0x45fef8){return{'id':_0x45fef8['name'],'name':_0x45fef8[_0xaf4c('0x69')],'custom':_[_0xaf4c('0x6a')](_0x45fef8[_0xaf4c('0x22')],_0xaf4c('0x6b'))?!![]:![],'options':_0x45fef8[_0xaf4c('0x28')][_0xaf4c('0x22')]==='picklist'&&_0x45fef8[_0xaf4c('0x28')][_0xaf4c('0x6c')][_0xaf4c('0x30')]>0x0?_[_0xaf4c('0x25')](_0x45fef8[_0xaf4c('0x28')][_0xaf4c('0x6c')],function(_0x32e043){return{'name':_0x32e043[_0xaf4c('0x69')],'value':_0x32e043[_0xaf4c('0x6d')]};}):[]};})};}})[_0xaf4c('0x1f')](respondWithResult(_0x205197,null))[_0xaf4c('0x3e')](function(_0x52a682){console[_0xaf4c('0x6e')]('vTiger\x20error:\x20'+_0x52a682);var _0x463075=_0x32143d[_0xaf4c('0x2c')][_0xaf4c('0x6f')]?0x1f4:_0x52a682[_0xaf4c('0x70')]||0x1f4;logger[_0xaf4c('0x71')](_0xaf4c('0x72'),'getFields',_0x463075,JSON['stringify'](_0x52a682));delete _0x52a682[_0xaf4c('0x22')];if(_0x463075===0x191){_0x463075=0x190;}_0x205197[_0xaf4c('0x18')](_0x463075)[_0xaf4c('0x23')](_0x32143d['query'][_0xaf4c('0x6f')]?{'message':_0xaf4c('0x73'),'statusCode':_0x52a682[_0xaf4c('0x70')]}:_0x52a682);});};
\ No newline at end of file
index 16cafce..f499943 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa342=['exports','define','VtigerAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../components/integrations/configuration'];(function(_0x163040,_0x38a58c){var _0x364667=function(_0x3b104f){while(--_0x3b104f){_0x163040['push'](_0x163040['shift']());}};_0x364667(++_0x38a58c);}(_0xa342,0x1a7));var _0x2a34=function(_0x157ff3,_0x2a79c1){_0x157ff3=_0x157ff3-0x0;var _0x29988c=_0xa342[_0x157ff3];return _0x29988c;};'use strict';var _=require(_0x2a34('0x0'));var util=require(_0x2a34('0x1'));var logger=require(_0x2a34('0x2'))(_0x2a34('0x3'));var moment=require(_0x2a34('0x4'));var BPromise=require(_0x2a34('0x5'));var rp=require(_0x2a34('0x6'));var fs=require('fs');var path=require(_0x2a34('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x2a34('0x8'));module[_0x2a34('0x9')]=function(_0x4d2f4f,_0x873f7c){return _0x4d2f4f[_0x2a34('0xa')](_0x2a34('0xb'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xaa05=['request-promise','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','int_vtiger_accounts','../../config/logger','api','bluebird'];(function(_0xddeac9,_0x2ebf8c){var _0x65fa72=function(_0x795e4f){while(--_0x795e4f){_0xddeac9['push'](_0xddeac9['shift']());}};_0x65fa72(++_0x2ebf8c);}(_0xaa05,0x1bf));var _0x5aa0=function(_0x1e2080,_0x53283b){_0x1e2080=_0x1e2080-0x0;var _0x260111=_0xaa05[_0x1e2080];return _0x260111;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5aa0('0x0'))(_0x5aa0('0x1'));var moment=require('moment');var BPromise=require(_0x5aa0('0x2'));var rp=require(_0x5aa0('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5aa0('0x4'));var attributes=require(_0x5aa0('0x5'));var integrations=require(_0x5aa0('0x6'));module[_0x5aa0('0x7')]=function(_0x220f1e,_0x590717){return _0x220f1e[_0x5aa0('0x8')]('VtigerAccount',attributes,{'tableName':_0x5aa0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 09a63fc..6bd431d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5b5=['GetVtigerAccount','VtigerAccount','options','where','attributes','include','map','model','debug','ShowVtigerAccount','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','VtigerAccount,\x20%s,\x20%s','message','result','catch'];(function(_0x8b3778,_0x4453db){var _0x53bdc8=function(_0x34941b){while(--_0x34941b){_0x8b3778['push'](_0x8b3778['shift']());}};_0x53bdc8(++_0x4453db);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0xe5b5[_0x341e0f];return _0x59555a;};'use strict';var _=require(_0x5e5b('0x0'));var util=require(_0x5e5b('0x1'));var moment=require(_0x5e5b('0x2'));var BPromise=require(_0x5e5b('0x3'));var rs=require(_0x5e5b('0x4'));var fs=require('fs');var Redis=require(_0x5e5b('0x5'));var db=require(_0x5e5b('0x6'))['db'];var utils=require(_0x5e5b('0x7'));var logger=require(_0x5e5b('0x8'))(_0x5e5b('0x9'));var config=require(_0x5e5b('0xa'));var jayson=require(_0x5e5b('0xb'));var client=jayson[_0x5e5b('0xc')][_0x5e5b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x545eb3,_0x29db2c,_0xe089b1){return new BPromise(function(_0xcbd478,_0x258414){return client[_0x5e5b('0xe')](_0x545eb3,_0xe089b1)[_0x5e5b('0xf')](function(_0x3a37db){logger[_0x5e5b('0x10')]('VtigerAccount,\x20%s,\x20%s',_0x29db2c,_0x5e5b('0x11'));logger['debug'](_0x5e5b('0x12'),_0x29db2c,_0x5e5b('0x11'),JSON[_0x5e5b('0x13')](_0x3a37db));if(_0x3a37db[_0x5e5b('0x14')]){if(_0x3a37db['error']['code']===0x1f4){logger['error'](_0x5e5b('0x15'),_0x29db2c,_0x3a37db[_0x5e5b('0x14')][_0x5e5b('0x16')]);return _0x258414(_0x3a37db[_0x5e5b('0x14')][_0x5e5b('0x16')]);}logger[_0x5e5b('0x14')](_0x5e5b('0x15'),_0x29db2c,_0x3a37db['error'][_0x5e5b('0x16')]);return _0xcbd478(_0x3a37db[_0x5e5b('0x14')]['message']);}else{logger[_0x5e5b('0x10')]('VtigerAccount,\x20%s,\x20%s',_0x29db2c,'request\x20sent');_0xcbd478(_0x3a37db[_0x5e5b('0x17')][_0x5e5b('0x16')]);}})[_0x5e5b('0x18')](function(_0x5c7148){logger[_0x5e5b('0x14')]('VtigerAccount,\x20%s,\x20%s',_0x29db2c,_0x5c7148);_0x258414(_0x5c7148);});});}exports[_0x5e5b('0x19')]=function(_0x45a091){var _0x4c5f9a=this;return new Promise(function(_0xe5aa6b,_0x1560e1){return db[_0x5e5b('0x1a')]['findAll']({'raw':_0x45a091[_0x5e5b('0x1b')]?_0x45a091[_0x5e5b('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x45a091[_0x5e5b('0x1b')]?_0x45a091[_0x5e5b('0x1b')][_0x5e5b('0x1c')]||null:null,'attributes':_0x45a091[_0x5e5b('0x1b')]?_0x45a091[_0x5e5b('0x1b')][_0x5e5b('0x1d')]||null:null,'limit':_0x45a091[_0x5e5b('0x1b')]?_0x45a091[_0x5e5b('0x1b')]['limit']||null:null,'include':_0x45a091['options']?_0x45a091[_0x5e5b('0x1b')][_0x5e5b('0x1e')]?_[_0x5e5b('0x1f')](_0x45a091[_0x5e5b('0x1b')][_0x5e5b('0x1e')],function(_0x28cd95){return{'model':db[_0x28cd95[_0x5e5b('0x20')]],'as':_0x28cd95['as'],'attributes':_0x28cd95[_0x5e5b('0x1d')],'include':_0x28cd95[_0x5e5b('0x1e')]?_[_0x5e5b('0x1f')](_0x28cd95[_0x5e5b('0x1e')],function(_0x4da321){return{'model':db[_0x4da321[_0x5e5b('0x20')]],'as':_0x4da321['as'],'attributes':_0x4da321[_0x5e5b('0x1d')],'include':_0x4da321[_0x5e5b('0x1e')]?_['map'](_0x4da321[_0x5e5b('0x1e')],function(_0xdb2863){return{'model':db[_0xdb2863['model']],'as':_0xdb2863['as'],'attributes':_0xdb2863[_0x5e5b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5e5b('0xf')](function(_0x39ce16){logger[_0x5e5b('0x10')](_0x5e5b('0x19'),_0x45a091);logger[_0x5e5b('0x21')](_0x5e5b('0x19'),_0x45a091,JSON[_0x5e5b('0x13')](_0x39ce16));_0xe5aa6b(_0x39ce16);})[_0x5e5b('0x18')](function(_0x42da3b){logger[_0x5e5b('0x14')](_0x5e5b('0x19'),_0x42da3b['message'],_0x45a091);_0x1560e1(_0x4c5f9a['error'](0x1f4,_0x42da3b[_0x5e5b('0x16')]));});});};exports[_0x5e5b('0x22')]=function(_0xb68419){var _0x3dcdab=this;return new Promise(function(_0x12f1ee,_0x4b9be8){return db[_0x5e5b('0x1a')]['find']({'raw':_0xb68419[_0x5e5b('0x1b')]?_0xb68419[_0x5e5b('0x1b')][_0x5e5b('0x23')]===undefined?!![]:![]:!![],'where':_0xb68419[_0x5e5b('0x1b')]?_0xb68419['options'][_0x5e5b('0x1c')]||null:null,'attributes':_0xb68419[_0x5e5b('0x1b')]?_0xb68419['options'][_0x5e5b('0x1d')]||null:null,'include':_0xb68419[_0x5e5b('0x1b')]?_0xb68419[_0x5e5b('0x1b')][_0x5e5b('0x1e')]?_[_0x5e5b('0x1f')](_0xb68419[_0x5e5b('0x1b')][_0x5e5b('0x1e')],function(_0x317451){return{'model':db[_0x317451['model']],'as':_0x317451['as'],'attributes':_0x317451[_0x5e5b('0x1d')],'include':_0x317451[_0x5e5b('0x1e')]?_[_0x5e5b('0x1f')](_0x317451[_0x5e5b('0x1e')],function(_0x7da7a5){return{'model':db[_0x7da7a5[_0x5e5b('0x20')]],'as':_0x7da7a5['as'],'attributes':_0x7da7a5['attributes'],'include':_0x7da7a5['include']?_[_0x5e5b('0x1f')](_0x7da7a5[_0x5e5b('0x1e')],function(_0x8ec651){return{'model':db[_0x8ec651['model']],'as':_0x8ec651['as'],'attributes':_0x8ec651[_0x5e5b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5e5b('0xf')](function(_0x18f5ba){logger[_0x5e5b('0x10')]('ShowVtigerAccount',_0xb68419);logger[_0x5e5b('0x21')](_0x5e5b('0x22'),_0xb68419,JSON['stringify'](_0x18f5ba));_0x12f1ee(_0x18f5ba);})['catch'](function(_0xe9c586){logger[_0x5e5b('0x14')](_0x5e5b('0x22'),_0xe9c586['message'],_0xb68419);_0x4b9be8(_0x3dcdab[_0x5e5b('0x14')](0x1f4,_0xe9c586['message']));});});};
\ No newline at end of file
+var _0xe605=['include','map','model','ShowVtigerAccount','stringify','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe605,0x92));var _0x5e60=function(_0x47493f,_0x4a9a4e){_0x47493f=_0x47493f-0x0;var _0x1e7907=_0xe605[_0x47493f];return _0x1e7907;};'use strict';var _=require(_0x5e60('0x0'));var util=require(_0x5e60('0x1'));var moment=require('moment');var BPromise=require(_0x5e60('0x2'));var rs=require(_0x5e60('0x3'));var fs=require('fs');var Redis=require(_0x5e60('0x4'));var db=require(_0x5e60('0x5'))['db'];var utils=require(_0x5e60('0x6'));var logger=require(_0x5e60('0x7'))(_0x5e60('0x8'));var config=require(_0x5e60('0x9'));var jayson=require(_0x5e60('0xa'));var client=jayson[_0x5e60('0xb')][_0x5e60('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x168a14,_0x4e3501,_0x1c5a6f){return new BPromise(function(_0x55ff5c,_0x593118){return client['request'](_0x168a14,_0x1c5a6f)[_0x5e60('0xd')](function(_0xe93f9c){logger[_0x5e60('0xe')](_0x5e60('0xf'),_0x4e3501,_0x5e60('0x10'));logger[_0x5e60('0x11')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x4e3501,_0x5e60('0x10'),JSON['stringify'](_0xe93f9c));if(_0xe93f9c[_0x5e60('0x12')]){if(_0xe93f9c[_0x5e60('0x12')][_0x5e60('0x13')]===0x1f4){logger['error'](_0x5e60('0xf'),_0x4e3501,_0xe93f9c[_0x5e60('0x12')][_0x5e60('0x14')]);return _0x593118(_0xe93f9c[_0x5e60('0x12')][_0x5e60('0x14')]);}logger[_0x5e60('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x4e3501,_0xe93f9c[_0x5e60('0x12')][_0x5e60('0x14')]);return _0x55ff5c(_0xe93f9c[_0x5e60('0x12')][_0x5e60('0x14')]);}else{logger['info'](_0x5e60('0xf'),_0x4e3501,'request\x20sent');_0x55ff5c(_0xe93f9c[_0x5e60('0x15')][_0x5e60('0x14')]);}})['catch'](function(_0x39be57){logger[_0x5e60('0x12')](_0x5e60('0xf'),_0x4e3501,_0x39be57);_0x593118(_0x39be57);});});}exports[_0x5e60('0x16')]=function(_0x5c485d){var _0xdd0a71=this;return new Promise(function(_0x22d718,_0x52cc15){return db[_0x5e60('0x17')][_0x5e60('0x18')]({'raw':_0x5c485d[_0x5e60('0x19')]?_0x5c485d[_0x5e60('0x19')][_0x5e60('0x1a')]===undefined?!![]:![]:!![],'where':_0x5c485d[_0x5e60('0x19')]?_0x5c485d[_0x5e60('0x19')][_0x5e60('0x1b')]||null:null,'attributes':_0x5c485d[_0x5e60('0x19')]?_0x5c485d[_0x5e60('0x19')][_0x5e60('0x1c')]||null:null,'limit':_0x5c485d['options']?_0x5c485d[_0x5e60('0x19')]['limit']||null:null,'include':_0x5c485d[_0x5e60('0x19')]?_0x5c485d[_0x5e60('0x19')][_0x5e60('0x1d')]?_[_0x5e60('0x1e')](_0x5c485d[_0x5e60('0x19')][_0x5e60('0x1d')],function(_0x2636f1){return{'model':db[_0x2636f1['model']],'as':_0x2636f1['as'],'attributes':_0x2636f1[_0x5e60('0x1c')],'include':_0x2636f1[_0x5e60('0x1d')]?_[_0x5e60('0x1e')](_0x2636f1['include'],function(_0x45cb62){return{'model':db[_0x45cb62[_0x5e60('0x1f')]],'as':_0x45cb62['as'],'attributes':_0x45cb62[_0x5e60('0x1c')],'include':_0x45cb62[_0x5e60('0x1d')]?_['map'](_0x45cb62[_0x5e60('0x1d')],function(_0x5712f7){return{'model':db[_0x5712f7[_0x5e60('0x1f')]],'as':_0x5712f7['as'],'attributes':_0x5712f7[_0x5e60('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x46691f){logger[_0x5e60('0xe')]('GetVtigerAccount',_0x5c485d);logger[_0x5e60('0x11')](_0x5e60('0x16'),_0x5c485d,JSON['stringify'](_0x46691f));_0x22d718(_0x46691f);})['catch'](function(_0x52f668){logger[_0x5e60('0x12')](_0x5e60('0x16'),_0x52f668[_0x5e60('0x14')],_0x5c485d);_0x52cc15(_0xdd0a71[_0x5e60('0x12')](0x1f4,_0x52f668[_0x5e60('0x14')]));});});};exports['ShowVtigerAccount']=function(_0x168ce6){var _0x405461=this;return new Promise(function(_0x4d4b55,_0x11fc87){return db['VtigerAccount']['find']({'raw':_0x168ce6[_0x5e60('0x19')]?_0x168ce6[_0x5e60('0x19')][_0x5e60('0x1a')]===undefined?!![]:![]:!![],'where':_0x168ce6[_0x5e60('0x19')]?_0x168ce6[_0x5e60('0x19')][_0x5e60('0x1b')]||null:null,'attributes':_0x168ce6[_0x5e60('0x19')]?_0x168ce6[_0x5e60('0x19')][_0x5e60('0x1c')]||null:null,'include':_0x168ce6[_0x5e60('0x19')]?_0x168ce6['options'][_0x5e60('0x1d')]?_['map'](_0x168ce6['options'][_0x5e60('0x1d')],function(_0x317206){return{'model':db[_0x317206['model']],'as':_0x317206['as'],'attributes':_0x317206[_0x5e60('0x1c')],'include':_0x317206['include']?_[_0x5e60('0x1e')](_0x317206[_0x5e60('0x1d')],function(_0x2b2426){return{'model':db[_0x2b2426[_0x5e60('0x1f')]],'as':_0x2b2426['as'],'attributes':_0x2b2426[_0x5e60('0x1c')],'include':_0x2b2426[_0x5e60('0x1d')]?_[_0x5e60('0x1e')](_0x2b2426[_0x5e60('0x1d')],function(_0x5b3aa5){return{'model':db[_0x5b3aa5[_0x5e60('0x1f')]],'as':_0x5b3aa5['as'],'attributes':_0x5b3aa5[_0x5e60('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x5e60('0xd')](function(_0x1a3782){logger[_0x5e60('0xe')](_0x5e60('0x20'),_0x168ce6);logger[_0x5e60('0x11')]('ShowVtigerAccount',_0x168ce6,JSON[_0x5e60('0x21')](_0x1a3782));_0x4d4b55(_0x1a3782);})[_0x5e60('0x22')](function(_0x4cba18){logger['error'](_0x5e60('0x20'),_0x4cba18[_0x5e60('0x14')],_0x168ce6);_0x11fc87(_0x405461[_0x5e60('0x12')](0x1f4,_0x4cba18[_0x5e60('0x14')]));});});};
\ No newline at end of file
index c462843..a2891a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6d5=['../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','/:id','destroy','multer','path','connect-timeout','../../components/auth/service'];(function(_0x240c99,_0x28b432){var _0xe0e1a4=function(_0x3b5b28){while(--_0x3b5b28){_0x240c99['push'](_0x240c99['shift']());}};_0xe0e1a4(++_0x28b432);}(_0xd6d5,0x114));var _0x5d6d=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0xd6d5[_0x342700];return _0x53406f;};'use strict';var multer=require(_0x5d6d('0x0'));var util=require('util');var path=require(_0x5d6d('0x1'));var timeout=require(_0x5d6d('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5d6d('0x3'));var interaction=require(_0x5d6d('0x4'));var config=require(_0x5d6d('0x5'));var controller=require(_0x5d6d('0x6'));router[_0x5d6d('0x7')]('/',auth[_0x5d6d('0x8')](),controller[_0x5d6d('0x9')]);router['get']('/:id',auth[_0x5d6d('0x8')](),controller['show']);router['get'](_0x5d6d('0xa'),auth[_0x5d6d('0x8')](),controller[_0x5d6d('0xb')]);router[_0x5d6d('0x7')](_0x5d6d('0xc'),auth[_0x5d6d('0x8')](),controller[_0x5d6d('0xd')]);router[_0x5d6d('0x7')](_0x5d6d('0xe'),auth[_0x5d6d('0x8')](),controller[_0x5d6d('0xf')]);router['post']('/',auth[_0x5d6d('0x8')](),controller[_0x5d6d('0x10')]);router[_0x5d6d('0x11')]('/:id',auth[_0x5d6d('0x8')](),controller['update']);router['delete'](_0x5d6d('0x12'),auth['isAuthenticated'](),controller[_0x5d6d('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x7000=['exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','getSubjects','/:id/descriptions','getDescriptions','create','put','delete'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x7000,0xa1));var _0x0700=function(_0x1bfd25,_0x349005){_0x1bfd25=_0x1bfd25-0x0;var _0x11804d=_0x7000[_0x1bfd25];return _0x11804d;};'use strict';var multer=require('multer');var util=require(_0x0700('0x0'));var path=require(_0x0700('0x1'));var timeout=require(_0x0700('0x2'));var express=require(_0x0700('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0700('0x4'));var interaction=require(_0x0700('0x5'));var config=require('../../config/environment');var controller=require(_0x0700('0x6'));router[_0x0700('0x7')]('/',auth[_0x0700('0x8')](),controller[_0x0700('0x9')]);router[_0x0700('0x7')](_0x0700('0xa'),auth[_0x0700('0x8')](),controller[_0x0700('0xb')]);router['get']('/:id/fields',auth[_0x0700('0x8')](),controller[_0x0700('0xc')]);router['get']('/:id/subjects',auth[_0x0700('0x8')](),controller[_0x0700('0xd')]);router['get'](_0x0700('0xe'),auth[_0x0700('0x8')](),controller[_0x0700('0xf')]);router['post']('/',auth[_0x0700('0x8')](),controller[_0x0700('0x10')]);router[_0x0700('0x11')](_0x0700('0xa'),auth[_0x0700('0x8')](),controller['update']);router[_0x0700('0x12')](_0x0700('0xa'),auth[_0x0700('0x8')](),controller['destroy']);module[_0x0700('0x13')]=router;
\ No newline at end of file
index 3a99174..78e1b4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x85d0=['exports','STRING','sequelize'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x85d0,0x65));var _0x085d=function(_0x4eb03f,_0x3da4e3){_0x4eb03f=_0x4eb03f-0x0;var _0x2d5cf2=_0x85d0[_0x4eb03f];return _0x2d5cf2;};'use strict';var Sequelize=require(_0x085d('0x0'));module[_0x085d('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x085d('0x2')]}};
\ No newline at end of file
+var _0x83f8=['STRING'];(function(_0x1cbcf1,_0x3f9fd9){var _0x3a06f0=function(_0x5425d4){while(--_0x5425d4){_0x1cbcf1['push'](_0x1cbcf1['shift']());}};_0x3a06f0(++_0x3f9fd9);}(_0x83f8,0x186));var _0x883f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x83f8[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x883f('0x0')]},'description':{'type':Sequelize[_0x883f('0x0')]}};
\ No newline at end of file
index 2c2c433..4eae408 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5078=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error','stack','name','send','index','map','VtigerConfiguration','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','length','find','create','body','destroy','getFields','nolimit','getSubjects','VtigerField','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x420b44,_0x1e76c3){var _0x3d0a2c=function(_0x14bcc3){while(--_0x14bcc3){_0x420b44['push'](_0x420b44['shift']());}};_0x3d0a2c(++_0x1e76c3);}(_0x5078,0x126));var _0x8507=function(_0x46121a,_0xd44bc0){_0x46121a=_0x46121a-0x0;var _0x126d1c=_0x5078[_0x46121a];return _0x126d1c;};'use strict';var emlformat=require(_0x8507('0x0'));var rimraf=require(_0x8507('0x1'));var zipdir=require(_0x8507('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8507('0x3'));var moment=require(_0x8507('0x4'));var BPromise=require(_0x8507('0x5'));var Mustache=require(_0x8507('0x6'));var util=require(_0x8507('0x7'));var path=require('path');var sox=require(_0x8507('0x8'));var csv=require(_0x8507('0x9'));var ejs=require(_0x8507('0xa'));var fs=require('fs');var fs_extra=require(_0x8507('0xb'));var _=require('lodash');var squel=require(_0x8507('0xc'));var crypto=require(_0x8507('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8507('0xe'));var Redis=require(_0x8507('0xf'));var authService=require(_0x8507('0x10'));var qs=require(_0x8507('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8507('0x12'));var logger=require(_0x8507('0x13'))('api');var utils=require(_0x8507('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8507('0x15'));var db=require(_0x8507('0x16'))['db'];function respondWithStatusCode(_0x337a62,_0x53f097){_0x53f097=_0x53f097||0xcc;return function(_0x33c817){if(_0x33c817){return _0x337a62['sendStatus'](_0x53f097);}return _0x337a62[_0x8507('0x17')](_0x53f097)[_0x8507('0x18')]();};}function respondWithResult(_0x21a658,_0x31d250){_0x31d250=_0x31d250||0xc8;return function(_0x4837b4){if(_0x4837b4){return _0x21a658[_0x8507('0x17')](_0x31d250)[_0x8507('0x19')](_0x4837b4);}};}function respondWithFilteredResult(_0x4ecd9e,_0x134699){return function(_0x3364a2){if(_0x3364a2){var _0x14f965=typeof _0x134699[_0x8507('0x1a')]===_0x8507('0x1b')&&typeof _0x134699[_0x8507('0x1c')]===_0x8507('0x1b');var _0x104415=_0x3364a2[_0x8507('0x1d')];var _0x5152f0=_0x14f965?0x0:_0x134699[_0x8507('0x1a')];var _0x236632=_0x14f965?_0x3364a2[_0x8507('0x1d')]:_0x134699['offset']+_0x134699[_0x8507('0x1c')];var _0x47abd5;if(_0x236632>=_0x104415){_0x236632=_0x104415;_0x47abd5=0xc8;}else{_0x47abd5=0xce;}_0x4ecd9e['status'](_0x47abd5);return _0x4ecd9e[_0x8507('0x1e')]('Content-Range',_0x5152f0+'-'+_0x236632+'/'+_0x104415)[_0x8507('0x19')](_0x3364a2);}return null;};}function patchUpdates(_0x532f8e){return function(_0x2279e2){try{jsonpatch[_0x8507('0x1f')](_0x2279e2,_0x532f8e,!![]);}catch(_0x183e91){return BPromise[_0x8507('0x20')](_0x183e91);}return _0x2279e2[_0x8507('0x21')]();};}function saveUpdates(_0x14b150,_0x155080){return function(_0x141169){if(_0x141169){return _0x141169[_0x8507('0x22')](_0x14b150)[_0x8507('0x23')](function(_0x24c371){return _0x24c371;});}return null;};}function removeEntity(_0x5144bb,_0x32e676){return function(_0x338887){if(_0x338887){return _0x338887['destroy']()[_0x8507('0x23')](function(){_0x5144bb[_0x8507('0x17')](0xcc)[_0x8507('0x18')]();});}};}function handleEntityNotFound(_0x10ec41,_0x5257e4){return function(_0x16bf79){if(!_0x16bf79){_0x10ec41['sendStatus'](0x194);}return _0x16bf79;};}function handleError(_0x1ab68f,_0x4bcf11){_0x4bcf11=_0x4bcf11||0x1f4;return function(_0x2aa2f9){logger[_0x8507('0x24')](_0x2aa2f9[_0x8507('0x25')]);if(_0x2aa2f9[_0x8507('0x26')]){delete _0x2aa2f9[_0x8507('0x26')];}_0x1ab68f[_0x8507('0x17')](_0x4bcf11)[_0x8507('0x27')](_0x2aa2f9);};}exports[_0x8507('0x28')]=function(_0x1209fe,_0x4fd674){var _0x25118c={},_0x4b65ac={},_0x4d9c2f={'count':0x0,'rows':[]};var _0x959250=_[_0x8507('0x29')](db[_0x8507('0x2a')]['rawAttributes'],function(_0x171bee){return{'name':_0x171bee['fieldName'],'type':_0x171bee[_0x8507('0x2b')][_0x8507('0x2c')]};});_0x4b65ac[_0x8507('0x2d')]=_[_0x8507('0x29')](_0x959250,'name');_0x4b65ac[_0x8507('0x2e')]=_[_0x8507('0x2f')](_0x1209fe[_0x8507('0x2e')]);_0x4b65ac[_0x8507('0x30')]=_[_0x8507('0x31')](_0x4b65ac[_0x8507('0x2d')],_0x4b65ac['query']);_0x25118c[_0x8507('0x32')]=_[_0x8507('0x31')](_0x4b65ac[_0x8507('0x2d')],qs[_0x8507('0x33')](_0x1209fe['query'][_0x8507('0x33')]));_0x25118c[_0x8507('0x32')]=_0x25118c[_0x8507('0x32')]['length']?_0x25118c[_0x8507('0x32')]:_0x4b65ac[_0x8507('0x2d')];if(!_0x1209fe[_0x8507('0x2e')][_0x8507('0x34')]('nolimit')){_0x25118c[_0x8507('0x1c')]=qs[_0x8507('0x1c')](_0x1209fe[_0x8507('0x2e')][_0x8507('0x1c')]);_0x25118c[_0x8507('0x1a')]=qs[_0x8507('0x1a')](_0x1209fe[_0x8507('0x2e')][_0x8507('0x1a')]);}_0x25118c[_0x8507('0x35')]=qs[_0x8507('0x36')](_0x1209fe[_0x8507('0x2e')][_0x8507('0x36')]);_0x25118c['where']=qs[_0x8507('0x30')](_[_0x8507('0x37')](_0x1209fe['query'],_0x4b65ac[_0x8507('0x30')]),_0x959250);if(_0x1209fe[_0x8507('0x2e')][_0x8507('0x38')]){_0x25118c[_0x8507('0x39')]=_[_0x8507('0x3a')](_0x25118c[_0x8507('0x39')],{'$or':_[_0x8507('0x29')](_0x959250,function(_0x489151){if(_0x489151[_0x8507('0x2b')]!==_0x8507('0x3b')){var _0x28c209={};_0x28c209[_0x489151['name']]={'$like':'%'+_0x1209fe[_0x8507('0x2e')][_0x8507('0x38')]+'%'};return _0x28c209;}})});}_0x25118c=_['merge']({},_0x25118c,_0x1209fe[_0x8507('0x3c')]);var _0xc73c={'where':_0x25118c[_0x8507('0x39')]};return db[_0x8507('0x2a')][_0x8507('0x1d')](_0xc73c)[_0x8507('0x23')](function(_0x30bd89){_0x4d9c2f[_0x8507('0x1d')]=_0x30bd89;if(_0x1209fe['query'][_0x8507('0x3d')]){_0x25118c[_0x8507('0x3e')]=[{'all':!![]}];}return db[_0x8507('0x2a')]['findAll'](_0x25118c);})[_0x8507('0x23')](function(_0x5c5484){_0x4d9c2f[_0x8507('0x3f')]=_0x5c5484;return _0x4d9c2f;})[_0x8507('0x23')](respondWithFilteredResult(_0x4fd674,_0x25118c))[_0x8507('0x40')](handleError(_0x4fd674,null));};exports[_0x8507('0x41')]=function(_0x1c97a4,_0xa57877){var _0x21ca4b={'raw':![],'where':{'id':_0x1c97a4[_0x8507('0x42')]['id']}},_0x321d60={};_0x321d60[_0x8507('0x2d')]=_[_0x8507('0x2f')](db['VtigerConfiguration'][_0x8507('0x43')]);_0x321d60[_0x8507('0x2e')]=_[_0x8507('0x2f')](_0x1c97a4[_0x8507('0x2e')]);_0x321d60[_0x8507('0x30')]=_[_0x8507('0x31')](_0x321d60[_0x8507('0x2d')],_0x321d60[_0x8507('0x2e')]);_0x21ca4b[_0x8507('0x32')]=_[_0x8507('0x31')](_0x321d60[_0x8507('0x2d')],qs[_0x8507('0x33')](_0x1c97a4[_0x8507('0x2e')]['fields']));_0x21ca4b[_0x8507('0x32')]=_0x21ca4b[_0x8507('0x32')][_0x8507('0x44')]?_0x21ca4b[_0x8507('0x32')]:_0x321d60['model'];if(_0x1c97a4['query'][_0x8507('0x3d')]){_0x21ca4b['include']=[{'all':!![]}];}_0x21ca4b=_[_0x8507('0x3a')]({},_0x21ca4b,_0x1c97a4[_0x8507('0x3c')]);return db['VtigerConfiguration'][_0x8507('0x45')](_0x21ca4b)[_0x8507('0x23')](handleEntityNotFound(_0xa57877,null))[_0x8507('0x23')](respondWithResult(_0xa57877,null))[_0x8507('0x40')](handleError(_0xa57877,null));};exports['create']=function(_0x5b0315,_0x57ed2a){return db['VtigerConfiguration'][_0x8507('0x46')](_0x5b0315[_0x8507('0x47')],{})['then'](respondWithResult(_0x57ed2a,0xc9))[_0x8507('0x40')](handleError(_0x57ed2a,null));};exports[_0x8507('0x22')]=function(_0x419cce,_0x106519){if(_0x419cce[_0x8507('0x47')]['id']){delete _0x419cce[_0x8507('0x47')]['id'];}return db[_0x8507('0x2a')][_0x8507('0x45')]({'where':{'id':_0x419cce[_0x8507('0x42')]['id']}})[_0x8507('0x23')](handleEntityNotFound(_0x106519,null))[_0x8507('0x23')](saveUpdates(_0x419cce['body'],null))['then'](respondWithResult(_0x106519,null))['catch'](handleError(_0x106519,null));};exports[_0x8507('0x48')]=function(_0x520ee6,_0x401f8a){return db[_0x8507('0x2a')][_0x8507('0x45')]({'where':{'id':_0x520ee6[_0x8507('0x42')]['id']}})[_0x8507('0x23')](handleEntityNotFound(_0x401f8a,null))['then'](removeEntity(_0x401f8a,null))[_0x8507('0x40')](handleError(_0x401f8a,null));};exports[_0x8507('0x49')]=function(_0x3d6428,_0x4eac99,_0x493a92){var _0x43cbb6={};var _0x350ab3={};var _0x39f901;var _0x1ae476;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x3d6428[_0x8507('0x42')]['id']}})[_0x8507('0x23')](handleEntityNotFound(_0x4eac99,null))[_0x8507('0x23')](function(_0x448e68){if(_0x448e68){_0x39f901=_0x448e68;_0x350ab3['model']=_[_0x8507('0x2f')](db['VtigerField'][_0x8507('0x43')]);_0x350ab3[_0x8507('0x2e')]=_[_0x8507('0x2f')](_0x3d6428[_0x8507('0x2e')]);_0x350ab3[_0x8507('0x30')]=_['intersection'](_0x350ab3[_0x8507('0x2d')],_0x350ab3[_0x8507('0x2e')]);_0x43cbb6[_0x8507('0x32')]=_[_0x8507('0x31')](_0x350ab3[_0x8507('0x2d')],qs[_0x8507('0x33')](_0x3d6428['query'][_0x8507('0x33')]));_0x43cbb6[_0x8507('0x32')]=_0x43cbb6[_0x8507('0x32')][_0x8507('0x44')]?_0x43cbb6[_0x8507('0x32')]:_0x350ab3[_0x8507('0x2d')];_0x43cbb6[_0x8507('0x35')]=qs[_0x8507('0x36')](_0x3d6428[_0x8507('0x2e')]['sort']);_0x43cbb6[_0x8507('0x39')]=qs[_0x8507('0x30')](_['pick'](_0x3d6428['query'],_0x350ab3[_0x8507('0x30')]));if(_0x3d6428[_0x8507('0x2e')][_0x8507('0x38')]){_0x43cbb6[_0x8507('0x39')]=_['merge'](_0x43cbb6[_0x8507('0x39')],{'$or':_[_0x8507('0x29')](_0x43cbb6[_0x8507('0x32')],function(_0x272d4e){var _0x3b32e2={};_0x3b32e2[_0x272d4e]={'$like':'%'+_0x3d6428[_0x8507('0x2e')]['filter']+'%'};return _0x3b32e2;})});}_0x43cbb6=_[_0x8507('0x3a')]({},_0x43cbb6,_0x3d6428[_0x8507('0x3c')]);return _0x39f901[_0x8507('0x49')](_0x43cbb6);}})[_0x8507('0x23')](function(_0x5c4fa9){if(_0x5c4fa9){_0x1ae476=_0x5c4fa9['length'];if(!_0x3d6428['query']['hasOwnProperty'](_0x8507('0x4a'))){_0x43cbb6[_0x8507('0x1c')]=qs[_0x8507('0x1c')](_0x3d6428[_0x8507('0x2e')][_0x8507('0x1c')]);_0x43cbb6[_0x8507('0x1a')]=qs['offset'](_0x3d6428['query']['offset']);}return _0x39f901[_0x8507('0x49')](_0x43cbb6);}})[_0x8507('0x23')](function(_0x1100b2){if(_0x1100b2){return _0x1100b2?{'count':_0x1ae476,'rows':_0x1100b2}:null;}})[_0x8507('0x23')](respondWithResult(_0x4eac99,null))[_0x8507('0x40')](handleError(_0x4eac99,null));};exports[_0x8507('0x4b')]=function(_0x2fe8ea,_0x484e4e,_0x2b2aac){var _0x5a3513={};var _0x10cd32={};var _0x2534d4;var _0x24546e;return db[_0x8507('0x2a')]['findOne']({'where':{'id':_0x2fe8ea[_0x8507('0x42')]['id']}})[_0x8507('0x23')](handleEntityNotFound(_0x484e4e,null))[_0x8507('0x23')](function(_0x3f48ad){if(_0x3f48ad){_0x2534d4=_0x3f48ad;_0x10cd32[_0x8507('0x2d')]=_[_0x8507('0x2f')](db[_0x8507('0x4c')][_0x8507('0x43')]);_0x10cd32[_0x8507('0x2e')]=_[_0x8507('0x2f')](_0x2fe8ea[_0x8507('0x2e')]);_0x10cd32[_0x8507('0x30')]=_['intersection'](_0x10cd32['model'],_0x10cd32['query']);_0x5a3513[_0x8507('0x32')]=_[_0x8507('0x31')](_0x10cd32['model'],qs[_0x8507('0x33')](_0x2fe8ea[_0x8507('0x2e')][_0x8507('0x33')]));_0x5a3513[_0x8507('0x32')]=_0x5a3513['attributes'][_0x8507('0x44')]?_0x5a3513['attributes']:_0x10cd32[_0x8507('0x2d')];_0x5a3513[_0x8507('0x35')]=qs[_0x8507('0x36')](_0x2fe8ea[_0x8507('0x2e')]['sort']);_0x5a3513['where']=qs[_0x8507('0x30')](_['pick'](_0x2fe8ea['query'],_0x10cd32['filters']));if(_0x2fe8ea['query']['filter']){_0x5a3513[_0x8507('0x39')]=_[_0x8507('0x3a')](_0x5a3513[_0x8507('0x39')],{'$or':_['map'](_0x5a3513[_0x8507('0x32')],function(_0x1a86b8){var _0x1a9b58={};_0x1a9b58[_0x1a86b8]={'$like':'%'+_0x2fe8ea[_0x8507('0x2e')][_0x8507('0x38')]+'%'};return _0x1a9b58;})});}_0x5a3513=_['merge']({},_0x5a3513,_0x2fe8ea[_0x8507('0x3c')]);return _0x2534d4[_0x8507('0x4b')](_0x5a3513);}})[_0x8507('0x23')](function(_0x14aba4){if(_0x14aba4){_0x24546e=_0x14aba4[_0x8507('0x44')];if(!_0x2fe8ea[_0x8507('0x2e')][_0x8507('0x34')](_0x8507('0x4a'))){_0x5a3513[_0x8507('0x1c')]=qs[_0x8507('0x1c')](_0x2fe8ea[_0x8507('0x2e')]['limit']);_0x5a3513[_0x8507('0x1a')]=qs[_0x8507('0x1a')](_0x2fe8ea['query'][_0x8507('0x1a')]);}return _0x2534d4['getSubjects'](_0x5a3513);}})['then'](function(_0x1dc3a4){if(_0x1dc3a4){return _0x1dc3a4?{'count':_0x24546e,'rows':_0x1dc3a4}:null;}})['then'](respondWithResult(_0x484e4e,null))['catch'](handleError(_0x484e4e,null));};exports[_0x8507('0x4d')]=function(_0x345c9c,_0x3fdd53,_0x4eeda4){var _0x52a2cc={};var _0x2786cf={};var _0x36f40f;var _0x2b118d;return db[_0x8507('0x2a')]['findOne']({'where':{'id':_0x345c9c['params']['id']}})['then'](handleEntityNotFound(_0x3fdd53,null))['then'](function(_0x509325){if(_0x509325){_0x36f40f=_0x509325;_0x2786cf[_0x8507('0x2d')]=_['keys'](db[_0x8507('0x4c')]['rawAttributes']);_0x2786cf[_0x8507('0x2e')]=_[_0x8507('0x2f')](_0x345c9c[_0x8507('0x2e')]);_0x2786cf[_0x8507('0x30')]=_['intersection'](_0x2786cf['model'],_0x2786cf[_0x8507('0x2e')]);_0x52a2cc[_0x8507('0x32')]=_['intersection'](_0x2786cf[_0x8507('0x2d')],qs['fields'](_0x345c9c[_0x8507('0x2e')][_0x8507('0x33')]));_0x52a2cc[_0x8507('0x32')]=_0x52a2cc[_0x8507('0x32')][_0x8507('0x44')]?_0x52a2cc[_0x8507('0x32')]:_0x2786cf['model'];_0x52a2cc[_0x8507('0x35')]=qs['sort'](_0x345c9c[_0x8507('0x2e')][_0x8507('0x36')]);_0x52a2cc[_0x8507('0x39')]=qs[_0x8507('0x30')](_['pick'](_0x345c9c[_0x8507('0x2e')],_0x2786cf[_0x8507('0x30')]));if(_0x345c9c['query'][_0x8507('0x38')]){_0x52a2cc[_0x8507('0x39')]=_[_0x8507('0x3a')](_0x52a2cc[_0x8507('0x39')],{'$or':_[_0x8507('0x29')](_0x52a2cc[_0x8507('0x32')],function(_0x2b9bc0){var _0x26f610={};_0x26f610[_0x2b9bc0]={'$like':'%'+_0x345c9c[_0x8507('0x2e')][_0x8507('0x38')]+'%'};return _0x26f610;})});}_0x52a2cc=_[_0x8507('0x3a')]({},_0x52a2cc,_0x345c9c[_0x8507('0x3c')]);return _0x36f40f[_0x8507('0x4d')](_0x52a2cc);}})[_0x8507('0x23')](function(_0x5557e1){if(_0x5557e1){_0x2b118d=_0x5557e1['length'];if(!_0x345c9c[_0x8507('0x2e')]['hasOwnProperty'](_0x8507('0x4a'))){_0x52a2cc['limit']=qs[_0x8507('0x1c')](_0x345c9c[_0x8507('0x2e')][_0x8507('0x1c')]);_0x52a2cc[_0x8507('0x1a')]=qs[_0x8507('0x1a')](_0x345c9c[_0x8507('0x2e')][_0x8507('0x1a')]);}return _0x36f40f[_0x8507('0x4d')](_0x52a2cc);}})[_0x8507('0x23')](function(_0x26752e){if(_0x26752e){return _0x26752e?{'count':_0x2b118d,'rows':_0x26752e}:null;}})[_0x8507('0x23')](respondWithResult(_0x3fdd53,null))[_0x8507('0x40')](handleError(_0x3fdd53,null));};
\ No newline at end of file
+var _0x8fe9=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','map','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','filters','find','create','body','destroy','getFields','VtigerField','getSubjects','getDescriptions','findOne','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save','update','then','stack','name','send','VtigerConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8fe9,0x15d));var _0x98fe=function(_0x4b784d,_0x5efb2f){_0x4b784d=_0x4b784d-0x0;var _0x2cdeaf=_0x8fe9[_0x4b784d];return _0x2cdeaf;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x98fe('0x0'));var jsonpatch=require(_0x98fe('0x1'));var rp=require(_0x98fe('0x2'));var moment=require('moment');var BPromise=require(_0x98fe('0x3'));var Mustache=require(_0x98fe('0x4'));var util=require(_0x98fe('0x5'));var path=require(_0x98fe('0x6'));var sox=require(_0x98fe('0x7'));var csv=require(_0x98fe('0x8'));var ejs=require(_0x98fe('0x9'));var fs=require('fs');var fs_extra=require(_0x98fe('0xa'));var _=require(_0x98fe('0xb'));var squel=require('squel');var crypto=require(_0x98fe('0xc'));var jsforce=require(_0x98fe('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x98fe('0x8'));var querystring=require(_0x98fe('0xe'));var Papa=require(_0x98fe('0xf'));var Redis=require(_0x98fe('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x98fe('0x11'));var as=require(_0x98fe('0x12'));var hardwareService=require(_0x98fe('0x13'));var logger=require(_0x98fe('0x14'))(_0x98fe('0x15'));var utils=require(_0x98fe('0x16'));var config=require(_0x98fe('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x98fe('0x18'))['db'];function respondWithStatusCode(_0x35d07a,_0x43f76a){_0x43f76a=_0x43f76a||0xcc;return function(_0x2c0c19){if(_0x2c0c19){return _0x35d07a[_0x98fe('0x19')](_0x43f76a);}return _0x35d07a['status'](_0x43f76a)[_0x98fe('0x1a')]();};}function respondWithResult(_0x3548e7,_0x238a2c){_0x238a2c=_0x238a2c||0xc8;return function(_0x54d6be){if(_0x54d6be){return _0x3548e7[_0x98fe('0x1b')](_0x238a2c)[_0x98fe('0x1c')](_0x54d6be);}};}function respondWithFilteredResult(_0x4921cd,_0x5aea33){return function(_0x26bfe1){if(_0x26bfe1){var _0x4f4ab7=typeof _0x5aea33[_0x98fe('0x1d')]===_0x98fe('0x1e')&&typeof _0x5aea33[_0x98fe('0x1f')]===_0x98fe('0x1e');var _0x5118a3=_0x26bfe1['count'];var _0x1d3297=_0x4f4ab7?0x0:_0x5aea33[_0x98fe('0x1d')];var _0x1507f9=_0x4f4ab7?_0x26bfe1[_0x98fe('0x20')]:_0x5aea33[_0x98fe('0x1d')]+_0x5aea33[_0x98fe('0x1f')];var _0x10feec;if(_0x1507f9>=_0x5118a3){_0x1507f9=_0x5118a3;_0x10feec=0xc8;}else{_0x10feec=0xce;}_0x4921cd[_0x98fe('0x1b')](_0x10feec);return _0x4921cd[_0x98fe('0x21')]('Content-Range',_0x1d3297+'-'+_0x1507f9+'/'+_0x5118a3)[_0x98fe('0x1c')](_0x26bfe1);}return null;};}function patchUpdates(_0x50e31c){return function(_0x2a43fc){try{jsonpatch['apply'](_0x2a43fc,_0x50e31c,!![]);}catch(_0x2d5e1c){return BPromise[_0x98fe('0x22')](_0x2d5e1c);}return _0x2a43fc[_0x98fe('0x23')]();};}function saveUpdates(_0x58719f,_0x2ea706){return function(_0x5d27e7){if(_0x5d27e7){return _0x5d27e7[_0x98fe('0x24')](_0x58719f)[_0x98fe('0x25')](function(_0x5d5013){return _0x5d5013;});}return null;};}function removeEntity(_0x405dcf,_0x1f2d98){return function(_0x4dce15){if(_0x4dce15){return _0x4dce15['destroy']()[_0x98fe('0x25')](function(){_0x405dcf[_0x98fe('0x1b')](0xcc)[_0x98fe('0x1a')]();});}};}function handleEntityNotFound(_0x3a84d6,_0xb33b86){return function(_0x183f7e){if(!_0x183f7e){_0x3a84d6[_0x98fe('0x19')](0x194);}return _0x183f7e;};}function handleError(_0x51882a,_0x1f7f9c){_0x1f7f9c=_0x1f7f9c||0x1f4;return function(_0x4b19a1){logger['error'](_0x4b19a1[_0x98fe('0x26')]);if(_0x4b19a1[_0x98fe('0x27')]){delete _0x4b19a1['name'];}_0x51882a['status'](_0x1f7f9c)[_0x98fe('0x28')](_0x4b19a1);};}exports['index']=function(_0xb071f9,_0x389b01){var _0x2c252d={},_0x42af7e={},_0x190d0a={'count':0x0,'rows':[]};var _0x4f2d10=_['map'](db[_0x98fe('0x29')][_0x98fe('0x2a')],function(_0x48d31b){return{'name':_0x48d31b[_0x98fe('0x2b')],'type':_0x48d31b[_0x98fe('0x2c')][_0x98fe('0x2d')]};});_0x42af7e[_0x98fe('0x2e')]=_['map'](_0x4f2d10,_0x98fe('0x27'));_0x42af7e[_0x98fe('0x2f')]=_[_0x98fe('0x30')](_0xb071f9['query']);_0x42af7e['filters']=_[_0x98fe('0x31')](_0x42af7e[_0x98fe('0x2e')],_0x42af7e[_0x98fe('0x2f')]);_0x2c252d[_0x98fe('0x32')]=_[_0x98fe('0x31')](_0x42af7e['model'],qs['fields'](_0xb071f9[_0x98fe('0x2f')][_0x98fe('0x33')]));_0x2c252d[_0x98fe('0x32')]=_0x2c252d[_0x98fe('0x32')][_0x98fe('0x34')]?_0x2c252d[_0x98fe('0x32')]:_0x42af7e[_0x98fe('0x2e')];if(!_0xb071f9[_0x98fe('0x2f')][_0x98fe('0x35')](_0x98fe('0x36'))){_0x2c252d[_0x98fe('0x1f')]=qs[_0x98fe('0x1f')](_0xb071f9[_0x98fe('0x2f')][_0x98fe('0x1f')]);_0x2c252d[_0x98fe('0x1d')]=qs[_0x98fe('0x1d')](_0xb071f9['query']['offset']);}_0x2c252d[_0x98fe('0x37')]=qs['sort'](_0xb071f9[_0x98fe('0x2f')][_0x98fe('0x38')]);_0x2c252d[_0x98fe('0x39')]=qs['filters'](_[_0x98fe('0x3a')](_0xb071f9[_0x98fe('0x2f')],_0x42af7e['filters']),_0x4f2d10);if(_0xb071f9[_0x98fe('0x2f')]['filter']){_0x2c252d[_0x98fe('0x39')]=_['merge'](_0x2c252d['where'],{'$or':_[_0x98fe('0x3b')](_0x4f2d10,function(_0x3e0f34){if(_0x3e0f34[_0x98fe('0x2c')]!=='VIRTUAL'){var _0x178bb8={};_0x178bb8[_0x3e0f34['name']]={'$like':'%'+_0xb071f9[_0x98fe('0x2f')][_0x98fe('0x3c')]+'%'};return _0x178bb8;}})});}_0x2c252d=_[_0x98fe('0x3d')]({},_0x2c252d,_0xb071f9[_0x98fe('0x3e')]);var _0x248937={'where':_0x2c252d['where']};return db['VtigerConfiguration'][_0x98fe('0x20')](_0x248937)[_0x98fe('0x25')](function(_0x180a5a){_0x190d0a[_0x98fe('0x20')]=_0x180a5a;if(_0xb071f9['query'][_0x98fe('0x3f')]){_0x2c252d[_0x98fe('0x40')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0x98fe('0x41')](_0x2c252d);})[_0x98fe('0x25')](function(_0x1f3ef5){_0x190d0a[_0x98fe('0x42')]=_0x1f3ef5;return _0x190d0a;})[_0x98fe('0x25')](respondWithFilteredResult(_0x389b01,_0x2c252d))[_0x98fe('0x43')](handleError(_0x389b01,null));};exports[_0x98fe('0x44')]=function(_0x2a0713,_0x4fa8c2){var _0xee68fc={'raw':![],'where':{'id':_0x2a0713[_0x98fe('0x45')]['id']}},_0x4d602a={};_0x4d602a[_0x98fe('0x2e')]=_[_0x98fe('0x30')](db[_0x98fe('0x29')][_0x98fe('0x2a')]);_0x4d602a[_0x98fe('0x2f')]=_[_0x98fe('0x30')](_0x2a0713[_0x98fe('0x2f')]);_0x4d602a[_0x98fe('0x46')]=_[_0x98fe('0x31')](_0x4d602a['model'],_0x4d602a[_0x98fe('0x2f')]);_0xee68fc[_0x98fe('0x32')]=_[_0x98fe('0x31')](_0x4d602a['model'],qs['fields'](_0x2a0713['query'][_0x98fe('0x33')]));_0xee68fc[_0x98fe('0x32')]=_0xee68fc['attributes'][_0x98fe('0x34')]?_0xee68fc[_0x98fe('0x32')]:_0x4d602a[_0x98fe('0x2e')];if(_0x2a0713['query'][_0x98fe('0x3f')]){_0xee68fc[_0x98fe('0x40')]=[{'all':!![]}];}_0xee68fc=_[_0x98fe('0x3d')]({},_0xee68fc,_0x2a0713[_0x98fe('0x3e')]);return db[_0x98fe('0x29')][_0x98fe('0x47')](_0xee68fc)[_0x98fe('0x25')](handleEntityNotFound(_0x4fa8c2,null))[_0x98fe('0x25')](respondWithResult(_0x4fa8c2,null))[_0x98fe('0x43')](handleError(_0x4fa8c2,null));};exports[_0x98fe('0x48')]=function(_0x1dc608,_0x495a97){return db['VtigerConfiguration'][_0x98fe('0x48')](_0x1dc608[_0x98fe('0x49')],{})[_0x98fe('0x25')](respondWithResult(_0x495a97,0xc9))[_0x98fe('0x43')](handleError(_0x495a97,null));};exports[_0x98fe('0x24')]=function(_0x334c7a,_0x2ed033){if(_0x334c7a[_0x98fe('0x49')]['id']){delete _0x334c7a[_0x98fe('0x49')]['id'];}return db[_0x98fe('0x29')][_0x98fe('0x47')]({'where':{'id':_0x334c7a[_0x98fe('0x45')]['id']}})[_0x98fe('0x25')](handleEntityNotFound(_0x2ed033,null))[_0x98fe('0x25')](saveUpdates(_0x334c7a[_0x98fe('0x49')],null))[_0x98fe('0x25')](respondWithResult(_0x2ed033,null))['catch'](handleError(_0x2ed033,null));};exports[_0x98fe('0x4a')]=function(_0x27a6e4,_0x2fb3e2){return db[_0x98fe('0x29')][_0x98fe('0x47')]({'where':{'id':_0x27a6e4['params']['id']}})[_0x98fe('0x25')](handleEntityNotFound(_0x2fb3e2,null))[_0x98fe('0x25')](removeEntity(_0x2fb3e2,null))['catch'](handleError(_0x2fb3e2,null));};exports[_0x98fe('0x4b')]=function(_0x5406d0,_0x180c7f,_0x1a409a){var _0x3dd36a={};var _0x432974={};var _0x37f2c8;var _0x1eaa1f;return db[_0x98fe('0x29')]['findOne']({'where':{'id':_0x5406d0[_0x98fe('0x45')]['id']}})['then'](handleEntityNotFound(_0x180c7f,null))[_0x98fe('0x25')](function(_0x7ecd7c){if(_0x7ecd7c){_0x37f2c8=_0x7ecd7c;_0x432974['model']=_[_0x98fe('0x30')](db[_0x98fe('0x4c')][_0x98fe('0x2a')]);_0x432974['query']=_[_0x98fe('0x30')](_0x5406d0['query']);_0x432974[_0x98fe('0x46')]=_['intersection'](_0x432974['model'],_0x432974[_0x98fe('0x2f')]);_0x3dd36a['attributes']=_[_0x98fe('0x31')](_0x432974[_0x98fe('0x2e')],qs[_0x98fe('0x33')](_0x5406d0[_0x98fe('0x2f')][_0x98fe('0x33')]));_0x3dd36a['attributes']=_0x3dd36a[_0x98fe('0x32')]['length']?_0x3dd36a[_0x98fe('0x32')]:_0x432974[_0x98fe('0x2e')];_0x3dd36a[_0x98fe('0x37')]=qs[_0x98fe('0x38')](_0x5406d0[_0x98fe('0x2f')]['sort']);_0x3dd36a['where']=qs[_0x98fe('0x46')](_['pick'](_0x5406d0[_0x98fe('0x2f')],_0x432974['filters']));if(_0x5406d0[_0x98fe('0x2f')][_0x98fe('0x3c')]){_0x3dd36a[_0x98fe('0x39')]=_['merge'](_0x3dd36a[_0x98fe('0x39')],{'$or':_[_0x98fe('0x3b')](_0x3dd36a['attributes'],function(_0x51684b){var _0x274783={};_0x274783[_0x51684b]={'$like':'%'+_0x5406d0[_0x98fe('0x2f')][_0x98fe('0x3c')]+'%'};return _0x274783;})});}_0x3dd36a=_[_0x98fe('0x3d')]({},_0x3dd36a,_0x5406d0['options']);return _0x37f2c8['getFields'](_0x3dd36a);}})[_0x98fe('0x25')](function(_0x2cca07){if(_0x2cca07){_0x1eaa1f=_0x2cca07[_0x98fe('0x34')];if(!_0x5406d0[_0x98fe('0x2f')][_0x98fe('0x35')](_0x98fe('0x36'))){_0x3dd36a[_0x98fe('0x1f')]=qs[_0x98fe('0x1f')](_0x5406d0[_0x98fe('0x2f')]['limit']);_0x3dd36a[_0x98fe('0x1d')]=qs[_0x98fe('0x1d')](_0x5406d0[_0x98fe('0x2f')][_0x98fe('0x1d')]);}return _0x37f2c8[_0x98fe('0x4b')](_0x3dd36a);}})[_0x98fe('0x25')](function(_0x32ce90){if(_0x32ce90){return _0x32ce90?{'count':_0x1eaa1f,'rows':_0x32ce90}:null;}})['then'](respondWithResult(_0x180c7f,null))[_0x98fe('0x43')](handleError(_0x180c7f,null));};exports[_0x98fe('0x4d')]=function(_0x12a2c7,_0x399d67,_0x2e114f){var _0x371428={};var _0x2932a8={};var _0x20ce4e;var _0x5d6959;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x12a2c7['params']['id']}})[_0x98fe('0x25')](handleEntityNotFound(_0x399d67,null))[_0x98fe('0x25')](function(_0x3b5c67){if(_0x3b5c67){_0x20ce4e=_0x3b5c67;_0x2932a8['model']=_[_0x98fe('0x30')](db[_0x98fe('0x4c')][_0x98fe('0x2a')]);_0x2932a8['query']=_[_0x98fe('0x30')](_0x12a2c7[_0x98fe('0x2f')]);_0x2932a8[_0x98fe('0x46')]=_[_0x98fe('0x31')](_0x2932a8[_0x98fe('0x2e')],_0x2932a8[_0x98fe('0x2f')]);_0x371428[_0x98fe('0x32')]=_[_0x98fe('0x31')](_0x2932a8[_0x98fe('0x2e')],qs[_0x98fe('0x33')](_0x12a2c7[_0x98fe('0x2f')][_0x98fe('0x33')]));_0x371428[_0x98fe('0x32')]=_0x371428[_0x98fe('0x32')][_0x98fe('0x34')]?_0x371428[_0x98fe('0x32')]:_0x2932a8[_0x98fe('0x2e')];_0x371428[_0x98fe('0x37')]=qs[_0x98fe('0x38')](_0x12a2c7['query'][_0x98fe('0x38')]);_0x371428[_0x98fe('0x39')]=qs[_0x98fe('0x46')](_[_0x98fe('0x3a')](_0x12a2c7[_0x98fe('0x2f')],_0x2932a8[_0x98fe('0x46')]));if(_0x12a2c7['query']['filter']){_0x371428['where']=_[_0x98fe('0x3d')](_0x371428[_0x98fe('0x39')],{'$or':_[_0x98fe('0x3b')](_0x371428[_0x98fe('0x32')],function(_0x5d5ecd){var _0x6104dc={};_0x6104dc[_0x5d5ecd]={'$like':'%'+_0x12a2c7[_0x98fe('0x2f')][_0x98fe('0x3c')]+'%'};return _0x6104dc;})});}_0x371428=_[_0x98fe('0x3d')]({},_0x371428,_0x12a2c7[_0x98fe('0x3e')]);return _0x20ce4e[_0x98fe('0x4d')](_0x371428);}})[_0x98fe('0x25')](function(_0x3e4155){if(_0x3e4155){_0x5d6959=_0x3e4155[_0x98fe('0x34')];if(!_0x12a2c7[_0x98fe('0x2f')][_0x98fe('0x35')](_0x98fe('0x36'))){_0x371428[_0x98fe('0x1f')]=qs['limit'](_0x12a2c7[_0x98fe('0x2f')]['limit']);_0x371428[_0x98fe('0x1d')]=qs[_0x98fe('0x1d')](_0x12a2c7[_0x98fe('0x2f')][_0x98fe('0x1d')]);}return _0x20ce4e['getSubjects'](_0x371428);}})['then'](function(_0x29a252){if(_0x29a252){return _0x29a252?{'count':_0x5d6959,'rows':_0x29a252}:null;}})[_0x98fe('0x25')](respondWithResult(_0x399d67,null))[_0x98fe('0x43')](handleError(_0x399d67,null));};exports[_0x98fe('0x4e')]=function(_0x4d1af0,_0x44d61b,_0x586cff){var _0x14039a={};var _0xc4366b={};var _0x60a96b;var _0x45627b;return db[_0x98fe('0x29')][_0x98fe('0x4f')]({'where':{'id':_0x4d1af0['params']['id']}})[_0x98fe('0x25')](handleEntityNotFound(_0x44d61b,null))['then'](function(_0x2bb393){if(_0x2bb393){_0x60a96b=_0x2bb393;_0xc4366b['model']=_['keys'](db[_0x98fe('0x4c')][_0x98fe('0x2a')]);_0xc4366b[_0x98fe('0x2f')]=_[_0x98fe('0x30')](_0x4d1af0[_0x98fe('0x2f')]);_0xc4366b[_0x98fe('0x46')]=_[_0x98fe('0x31')](_0xc4366b[_0x98fe('0x2e')],_0xc4366b['query']);_0x14039a[_0x98fe('0x32')]=_[_0x98fe('0x31')](_0xc4366b[_0x98fe('0x2e')],qs[_0x98fe('0x33')](_0x4d1af0[_0x98fe('0x2f')][_0x98fe('0x33')]));_0x14039a[_0x98fe('0x32')]=_0x14039a[_0x98fe('0x32')][_0x98fe('0x34')]?_0x14039a[_0x98fe('0x32')]:_0xc4366b['model'];_0x14039a['order']=qs[_0x98fe('0x38')](_0x4d1af0[_0x98fe('0x2f')][_0x98fe('0x38')]);_0x14039a[_0x98fe('0x39')]=qs[_0x98fe('0x46')](_[_0x98fe('0x3a')](_0x4d1af0['query'],_0xc4366b[_0x98fe('0x46')]));if(_0x4d1af0['query']['filter']){_0x14039a[_0x98fe('0x39')]=_[_0x98fe('0x3d')](_0x14039a[_0x98fe('0x39')],{'$or':_['map'](_0x14039a[_0x98fe('0x32')],function(_0x5d02fc){var _0x2598fd={};_0x2598fd[_0x5d02fc]={'$like':'%'+_0x4d1af0[_0x98fe('0x2f')][_0x98fe('0x3c')]+'%'};return _0x2598fd;})});}_0x14039a=_[_0x98fe('0x3d')]({},_0x14039a,_0x4d1af0[_0x98fe('0x3e')]);return _0x60a96b[_0x98fe('0x4e')](_0x14039a);}})[_0x98fe('0x25')](function(_0x279dc4){if(_0x279dc4){_0x45627b=_0x279dc4['length'];if(!_0x4d1af0[_0x98fe('0x2f')][_0x98fe('0x35')]('nolimit')){_0x14039a[_0x98fe('0x1f')]=qs['limit'](_0x4d1af0[_0x98fe('0x2f')][_0x98fe('0x1f')]);_0x14039a['offset']=qs[_0x98fe('0x1d')](_0x4d1af0[_0x98fe('0x2f')][_0x98fe('0x1d')]);}return _0x60a96b[_0x98fe('0x4e')](_0x14039a);}})['then'](function(_0x4caf57){if(_0x4caf57){return _0x4caf57?{'count':_0x45627b,'rows':_0x4caf57}:null;}})[_0x98fe('0x25')](respondWithResult(_0x44d61b,null))['catch'](handleError(_0x44d61b,null));};
\ No newline at end of file
index d0360e9..2f596b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x916d=['exports','VtigerConfiguration','../../config/logger','api','moment','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes'];(function(_0x1cccf1,_0x1360da){var _0x5aa2b4=function(_0x2fe3cb){while(--_0x2fe3cb){_0x1cccf1['push'](_0x1cccf1['shift']());}};_0x5aa2b4(++_0x1360da);}(_0x916d,0x17c));var _0xd916=function(_0x11f654,_0x4c9ff3){_0x11f654=_0x11f654-0x0;var _0x1a662e=_0x916d[_0x11f654];return _0x1a662e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd916('0x0'))(_0xd916('0x1'));var moment=require(_0xd916('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd916('0x3'));var rimraf=require(_0xd916('0x4'));var config=require(_0xd916('0x5'));var attributes=require(_0xd916('0x6'));module[_0xd916('0x7')]=function(_0x463f2b,_0x12c795){return _0x463f2b['define'](_0xd916('0x8'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xaa60=['./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','moment','request-promise','path','rimraf'];(function(_0x31a16f,_0x5eee6f){var _0x5bc5bc=function(_0x408947){while(--_0x408947){_0x31a16f['push'](_0x31a16f['shift']());}};_0x5bc5bc(++_0x5eee6f);}(_0xaa60,0xb9));var _0x0aa6=function(_0x1a656a,_0x59bb0f){_0x1a656a=_0x1a656a-0x0;var _0x5355cb=_0xaa60[_0x1a656a];return _0x5355cb;};'use strict';var _=require(_0x0aa6('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x0aa6('0x1'));var BPromise=require('bluebird');var rp=require(_0x0aa6('0x2'));var fs=require('fs');var path=require(_0x0aa6('0x3'));var rimraf=require(_0x0aa6('0x4'));var config=require('../../config/environment');var attributes=require(_0x0aa6('0x5'));module[_0x0aa6('0x6')]=function(_0x4259be,_0xc3cbd){return _0x4259be[_0x0aa6('0x7')](_0x0aa6('0x8'),attributes,{'tableName':_0x0aa6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3c7625b..e11ea73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf5db=['rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger'];(function(_0x10a3d8,_0x2bda9d){var _0x2b0339=function(_0x4e80a7){while(--_0x4e80a7){_0x10a3d8['push'](_0x10a3d8['shift']());}};_0x2b0339(++_0x2bda9d);}(_0xf5db,0x1c8));var _0xbf5d=function(_0x10130b,_0x30f966){_0x10130b=_0x10130b-0x0;var _0x20dbc8=_0xf5db[_0x10130b];return _0x20dbc8;};'use strict';var _=require(_0xbf5d('0x0'));var util=require(_0xbf5d('0x1'));var moment=require('moment');var BPromise=require(_0xbf5d('0x2'));var rs=require(_0xbf5d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbf5d('0x4'));var logger=require(_0xbf5d('0x5'))(_0xbf5d('0x6'));var config=require('../../config/environment');var jayson=require(_0xbf5d('0x7'));var client=jayson[_0xbf5d('0x8')][_0xbf5d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d8087,_0x236044,_0x109b47){return new BPromise(function(_0x4b2769,_0x52f21d){return client[_0xbf5d('0xa')](_0x4d8087,_0x109b47)[_0xbf5d('0xb')](function(_0x4e6b1b){logger[_0xbf5d('0xc')]('VtigerConfiguration,\x20%s,\x20%s',_0x236044,_0xbf5d('0xd'));logger[_0xbf5d('0xe')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x236044,_0xbf5d('0xd'),JSON[_0xbf5d('0xf')](_0x4e6b1b));if(_0x4e6b1b[_0xbf5d('0x10')]){if(_0x4e6b1b[_0xbf5d('0x10')][_0xbf5d('0x11')]===0x1f4){logger['error'](_0xbf5d('0x12'),_0x236044,_0x4e6b1b[_0xbf5d('0x10')][_0xbf5d('0x13')]);return _0x52f21d(_0x4e6b1b[_0xbf5d('0x10')][_0xbf5d('0x13')]);}logger[_0xbf5d('0x10')](_0xbf5d('0x12'),_0x236044,_0x4e6b1b[_0xbf5d('0x10')]['message']);return _0x4b2769(_0x4e6b1b[_0xbf5d('0x10')]['message']);}else{logger[_0xbf5d('0xc')](_0xbf5d('0x12'),_0x236044,'request\x20sent');_0x4b2769(_0x4e6b1b[_0xbf5d('0x14')][_0xbf5d('0x13')]);}})[_0xbf5d('0x15')](function(_0x27893c){logger[_0xbf5d('0x10')](_0xbf5d('0x12'),_0x236044,_0x27893c);_0x52f21d(_0x27893c);});});}
\ No newline at end of file
+var _0xe120=['VtigerConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','debug','request\x20sent','stringify','error','code'];(function(_0x2dbfe4,_0x196567){var _0x2f3e3d=function(_0x147df8){while(--_0x147df8){_0x2dbfe4['push'](_0x2dbfe4['shift']());}};_0x2f3e3d(++_0x196567);}(_0xe120,0xeb));var _0x0e12=function(_0x3ee301,_0x1761ce){_0x3ee301=_0x3ee301-0x0;var _0x328fe1=_0xe120[_0x3ee301];return _0x328fe1;};'use strict';var _=require(_0x0e12('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0e12('0x1'));var rs=require(_0x0e12('0x2'));var fs=require('fs');var Redis=require(_0x0e12('0x3'));var db=require(_0x0e12('0x4'))['db'];var utils=require(_0x0e12('0x5'));var logger=require(_0x0e12('0x6'))(_0x0e12('0x7'));var config=require(_0x0e12('0x8'));var jayson=require(_0x0e12('0x9'));var client=jayson[_0x0e12('0xa')][_0x0e12('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44fb92,_0x5b4d51,_0x417df0){return new BPromise(function(_0x56f667,_0x2edd2f){return client[_0x0e12('0xc')](_0x44fb92,_0x417df0)['then'](function(_0x2d094a){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x5b4d51,'request\x20sent');logger[_0x0e12('0xd')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x5b4d51,_0x0e12('0xe'),JSON[_0x0e12('0xf')](_0x2d094a));if(_0x2d094a[_0x0e12('0x10')]){if(_0x2d094a[_0x0e12('0x10')][_0x0e12('0x11')]===0x1f4){logger[_0x0e12('0x10')](_0x0e12('0x12'),_0x5b4d51,_0x2d094a[_0x0e12('0x10')]['message']);return _0x2edd2f(_0x2d094a[_0x0e12('0x10')]['message']);}logger[_0x0e12('0x10')](_0x0e12('0x12'),_0x5b4d51,_0x2d094a['error'][_0x0e12('0x13')]);return _0x56f667(_0x2d094a[_0x0e12('0x10')][_0x0e12('0x13')]);}else{logger[_0x0e12('0x14')]('VtigerConfiguration,\x20%s,\x20%s',_0x5b4d51,_0x0e12('0xe'));_0x56f667(_0x2d094a[_0x0e12('0x15')][_0x0e12('0x13')]);}})[_0x0e12('0x16')](function(_0x127e3f){logger[_0x0e12('0x10')](_0x0e12('0x12'),_0x5b4d51,_0x127e3f);_0x2edd2f(_0x127e3f);});});}
\ No newline at end of file
index 2bbee47..395fc3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c36=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','isAuthenticated','index','get','show','post','create','/:id','delete','exports','multer','util','path'];(function(_0x36436d,_0x20292c){var _0x34615d=function(_0x5447af){while(--_0x5447af){_0x36436d['push'](_0x36436d['shift']());}};_0x34615d(++_0x20292c);}(_0x1c36,0x140));var _0x61c3=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x1c36[_0x3d42d8];return _0x27fc41;};'use strict';var multer=require(_0x61c3('0x0'));var util=require(_0x61c3('0x1'));var path=require(_0x61c3('0x2'));var timeout=require(_0x61c3('0x3'));var express=require(_0x61c3('0x4'));var router=express['Router']();var fs_extra=require(_0x61c3('0x5'));var auth=require(_0x61c3('0x6'));var interaction=require(_0x61c3('0x7'));var config=require(_0x61c3('0x8'));var controller=require(_0x61c3('0x9'));router['get']('/',auth[_0x61c3('0xa')](),controller[_0x61c3('0xb')]);router[_0x61c3('0xc')]('/:id',auth[_0x61c3('0xa')](),controller[_0x61c3('0xd')]);router[_0x61c3('0xe')]('/',auth[_0x61c3('0xa')](),controller[_0x61c3('0xf')]);router['put'](_0x61c3('0x10'),auth[_0x61c3('0xa')](),controller['update']);router[_0x61c3('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x61c3('0x12')]=router;
\ No newline at end of file
+var _0xa4fc=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','put','update','delete'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0xa4fc,0x122));var _0xca4f=function(_0x5b93e8,_0x185ab8){_0x5b93e8=_0x5b93e8-0x0;var _0x24ae63=_0xa4fc[_0x5b93e8];return _0x24ae63;};'use strict';var multer=require(_0xca4f('0x0'));var util=require('util');var path=require(_0xca4f('0x1'));var timeout=require(_0xca4f('0x2'));var express=require(_0xca4f('0x3'));var router=express[_0xca4f('0x4')]();var fs_extra=require(_0xca4f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xca4f('0x6'));var config=require(_0xca4f('0x7'));var controller=require(_0xca4f('0x8'));router[_0xca4f('0x9')]('/',auth[_0xca4f('0xa')](),controller[_0xca4f('0xb')]);router[_0xca4f('0x9')](_0xca4f('0xc'),auth[_0xca4f('0xa')](),controller['show']);router['post']('/',auth[_0xca4f('0xa')](),controller['create']);router[_0xca4f('0xd')](_0xca4f('0xc'),auth[_0xca4f('0xa')](),controller[_0xca4f('0xe')]);router[_0xca4f('0xf')](_0xca4f('0xc'),auth[_0xca4f('0xa')](),controller[_0xca4f('0x10')]);module[_0xca4f('0x11')]=router;
\ No newline at end of file
index 11e37e2..eb3cdef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6013=['variable','keyValue','picklist','STRING','string','customVariable','sequelize','exports','ENUM'];(function(_0x4e6ba3,_0x480490){var _0x15afd9=function(_0x1e163a){while(--_0x1e163a){_0x4e6ba3['push'](_0x4e6ba3['shift']());}};_0x15afd9(++_0x480490);}(_0x6013,0xf0));var _0x3601=function(_0x1d5ba8,_0x412a52){_0x1d5ba8=_0x1d5ba8-0x0;var _0x1022a2=_0x6013[_0x1d5ba8];return _0x1022a2;};'use strict';var Sequelize=require(_0x3601('0x0'));module[_0x3601('0x1')]={'type':{'type':Sequelize[_0x3601('0x2')]('string',_0x3601('0x3'),'customVariable',_0x3601('0x4'),_0x3601('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x3601('0x6')]},'keyType':{'type':Sequelize[_0x3601('0x2')](_0x3601('0x7'),_0x3601('0x3'),_0x3601('0x8'))},'keyContent':{'type':Sequelize[_0x3601('0x6')]},'idField':{'type':Sequelize[_0x3601('0x6')]},'nameField':{'type':Sequelize[_0x3601('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3601('0x6')]}};
\ No newline at end of file
+var _0x67b0=['customVariable','keyValue','picklist','STRING','variable','BOOLEAN','sequelize','exports','ENUM'];(function(_0x4f0ae8,_0x2eacd1){var _0x497664=function(_0x3652c1){while(--_0x3652c1){_0x4f0ae8['push'](_0x4f0ae8['shift']());}};_0x497664(++_0x2eacd1);}(_0x67b0,0x102));var _0x067b=function(_0x41c151,_0x42b877){_0x41c151=_0x41c151-0x0;var _0x166a3b=_0x67b0[_0x41c151];return _0x166a3b;};'use strict';var Sequelize=require(_0x067b('0x0'));module[_0x067b('0x1')]={'type':{'type':Sequelize[_0x067b('0x2')]('string','variable',_0x067b('0x3'),_0x067b('0x4'),_0x067b('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x067b('0x6')]},'key':{'type':Sequelize[_0x067b('0x6')]},'keyType':{'type':Sequelize[_0x067b('0x2')]('string',_0x067b('0x7'),_0x067b('0x3'))},'keyContent':{'type':Sequelize[_0x067b('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x067b('0x6')]},'customField':{'type':Sequelize[_0x067b('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x067b('0x6')]}};
\ No newline at end of file
index 21b590d..accce73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c0b=['length','hasOwnProperty','sort','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','find','create','body','catch','update','eml-format','rimraf','zip-dir','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','destroy','error','stack','name','index','map','VtigerField','fieldName','type','key','model','filters','intersection','attributes','query','fields'];(function(_0x52d35a,_0x1ff4c8){var _0x192f20=function(_0x6899ff){while(--_0x6899ff){_0x52d35a['push'](_0x52d35a['shift']());}};_0x192f20(++_0x1ff4c8);}(_0x0c0b,0x13c));var _0xb0c0=function(_0x5f0436,_0x370e13){_0x5f0436=_0x5f0436-0x0;var _0x40c448=_0x0c0b[_0x5f0436];return _0x40c448;};'use strict';var emlformat=require(_0xb0c0('0x0'));var rimraf=require(_0xb0c0('0x1'));var zipdir=require(_0xb0c0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb0c0('0x3'));var util=require('util');var path=require('path');var sox=require(_0xb0c0('0x4'));var csv=require(_0xb0c0('0x5'));var ejs=require(_0xb0c0('0x6'));var fs=require('fs');var fs_extra=require(_0xb0c0('0x7'));var _=require(_0xb0c0('0x8'));var squel=require(_0xb0c0('0x9'));var crypto=require(_0xb0c0('0xa'));var jsforce=require(_0xb0c0('0xb'));var deskjs=require(_0xb0c0('0xc'));var toCsv=require(_0xb0c0('0x5'));var querystring=require(_0xb0c0('0xd'));var Papa=require(_0xb0c0('0xe'));var Redis=require(_0xb0c0('0xf'));var authService=require(_0xb0c0('0x10'));var qs=require(_0xb0c0('0x11'));var as=require(_0xb0c0('0x12'));var hardwareService=require(_0xb0c0('0x13'));var logger=require('../../config/logger')(_0xb0c0('0x14'));var utils=require(_0xb0c0('0x15'));var config=require(_0xb0c0('0x16'));var licenseUtil=require(_0xb0c0('0x17'));var db=require(_0xb0c0('0x18'))['db'];function respondWithStatusCode(_0x183278,_0x4e4582){_0x4e4582=_0x4e4582||0xcc;return function(_0x39b6b6){if(_0x39b6b6){return _0x183278[_0xb0c0('0x19')](_0x4e4582);}return _0x183278[_0xb0c0('0x1a')](_0x4e4582)[_0xb0c0('0x1b')]();};}function respondWithResult(_0xd3eabe,_0x4f9b64){_0x4f9b64=_0x4f9b64||0xc8;return function(_0x4cb5c2){if(_0x4cb5c2){return _0xd3eabe[_0xb0c0('0x1a')](_0x4f9b64)['json'](_0x4cb5c2);}};}function respondWithFilteredResult(_0x5e8a7f,_0x16b8a8){return function(_0x3b0748){if(_0x3b0748){var _0xf78744=typeof _0x16b8a8[_0xb0c0('0x1c')]===_0xb0c0('0x1d')&&typeof _0x16b8a8[_0xb0c0('0x1e')]===_0xb0c0('0x1d');var _0x8a0c79=_0x3b0748[_0xb0c0('0x1f')];var _0x376d7c=_0xf78744?0x0:_0x16b8a8[_0xb0c0('0x1c')];var _0x1758a7=_0xf78744?_0x3b0748[_0xb0c0('0x1f')]:_0x16b8a8['offset']+_0x16b8a8[_0xb0c0('0x1e')];var _0x5826b9;if(_0x1758a7>=_0x8a0c79){_0x1758a7=_0x8a0c79;_0x5826b9=0xc8;}else{_0x5826b9=0xce;}_0x5e8a7f[_0xb0c0('0x1a')](_0x5826b9);return _0x5e8a7f[_0xb0c0('0x20')](_0xb0c0('0x21'),_0x376d7c+'-'+_0x1758a7+'/'+_0x8a0c79)[_0xb0c0('0x22')](_0x3b0748);}return null;};}function patchUpdates(_0x248210){return function(_0x460163){try{jsonpatch['apply'](_0x460163,_0x248210,!![]);}catch(_0x1b6674){return BPromise[_0xb0c0('0x23')](_0x1b6674);}return _0x460163[_0xb0c0('0x24')]();};}function saveUpdates(_0x37e962,_0x34de39){return function(_0x2af5b1){if(_0x2af5b1){return _0x2af5b1['update'](_0x37e962)[_0xb0c0('0x25')](function(_0x16c309){return _0x16c309;});}return null;};}function removeEntity(_0xcd076e,_0x241fe5){return function(_0x42ee41){if(_0x42ee41){return _0x42ee41[_0xb0c0('0x26')]()['then'](function(){_0xcd076e[_0xb0c0('0x1a')](0xcc)[_0xb0c0('0x1b')]();});}};}function handleEntityNotFound(_0x2822bf,_0x1ae404){return function(_0x3e3892){if(!_0x3e3892){_0x2822bf[_0xb0c0('0x19')](0x194);}return _0x3e3892;};}function handleError(_0x56177d,_0x6885a5){_0x6885a5=_0x6885a5||0x1f4;return function(_0x5a8397){logger[_0xb0c0('0x27')](_0x5a8397[_0xb0c0('0x28')]);if(_0x5a8397[_0xb0c0('0x29')]){delete _0x5a8397[_0xb0c0('0x29')];}_0x56177d[_0xb0c0('0x1a')](_0x6885a5)['send'](_0x5a8397);};}exports[_0xb0c0('0x2a')]=function(_0x1b1a8a,_0x5dfb32){var _0x3f45cd={},_0x4e33a6={},_0x19f163={'count':0x0,'rows':[]};var _0x270687=_[_0xb0c0('0x2b')](db[_0xb0c0('0x2c')]['rawAttributes'],function(_0x165462){return{'name':_0x165462[_0xb0c0('0x2d')],'type':_0x165462[_0xb0c0('0x2e')][_0xb0c0('0x2f')]};});_0x4e33a6[_0xb0c0('0x30')]=_[_0xb0c0('0x2b')](_0x270687,'name');_0x4e33a6['query']=_['keys'](_0x1b1a8a['query']);_0x4e33a6[_0xb0c0('0x31')]=_[_0xb0c0('0x32')](_0x4e33a6['model'],_0x4e33a6['query']);_0x3f45cd[_0xb0c0('0x33')]=_[_0xb0c0('0x32')](_0x4e33a6[_0xb0c0('0x30')],qs['fields'](_0x1b1a8a[_0xb0c0('0x34')][_0xb0c0('0x35')]));_0x3f45cd[_0xb0c0('0x33')]=_0x3f45cd[_0xb0c0('0x33')][_0xb0c0('0x36')]?_0x3f45cd['attributes']:_0x4e33a6[_0xb0c0('0x30')];if(!_0x1b1a8a[_0xb0c0('0x34')][_0xb0c0('0x37')]('nolimit')){_0x3f45cd[_0xb0c0('0x1e')]=qs[_0xb0c0('0x1e')](_0x1b1a8a[_0xb0c0('0x34')][_0xb0c0('0x1e')]);_0x3f45cd['offset']=qs[_0xb0c0('0x1c')](_0x1b1a8a[_0xb0c0('0x34')][_0xb0c0('0x1c')]);}_0x3f45cd['order']=qs[_0xb0c0('0x38')](_0x1b1a8a[_0xb0c0('0x34')]['sort']);_0x3f45cd[_0xb0c0('0x39')]=qs[_0xb0c0('0x31')](_['pick'](_0x1b1a8a[_0xb0c0('0x34')],_0x4e33a6[_0xb0c0('0x31')]),_0x270687);if(_0x1b1a8a[_0xb0c0('0x34')]['filter']){_0x3f45cd[_0xb0c0('0x39')]=_['merge'](_0x3f45cd[_0xb0c0('0x39')],{'$or':_[_0xb0c0('0x2b')](_0x270687,function(_0x5d48f2){if(_0x5d48f2[_0xb0c0('0x2e')]!==_0xb0c0('0x3a')){var _0x1d9f96={};_0x1d9f96[_0x5d48f2[_0xb0c0('0x29')]]={'$like':'%'+_0x1b1a8a[_0xb0c0('0x34')]['filter']+'%'};return _0x1d9f96;}})});}_0x3f45cd=_[_0xb0c0('0x3b')]({},_0x3f45cd,_0x1b1a8a[_0xb0c0('0x3c')]);var _0x1ab8b1={'where':_0x3f45cd['where']};return db[_0xb0c0('0x2c')][_0xb0c0('0x1f')](_0x1ab8b1)[_0xb0c0('0x25')](function(_0x13060d){_0x19f163['count']=_0x13060d;if(_0x1b1a8a[_0xb0c0('0x34')][_0xb0c0('0x3d')]){_0x3f45cd[_0xb0c0('0x3e')]=[{'all':!![]}];}return db['VtigerField'][_0xb0c0('0x3f')](_0x3f45cd);})['then'](function(_0x577833){_0x19f163[_0xb0c0('0x40')]=_0x577833;return _0x19f163;})[_0xb0c0('0x25')](respondWithFilteredResult(_0x5dfb32,_0x3f45cd))['catch'](handleError(_0x5dfb32,null));};exports[_0xb0c0('0x41')]=function(_0x143ebd,_0x4589ba){var _0x5b91db={'raw':!![],'where':{'id':_0x143ebd[_0xb0c0('0x42')]['id']}},_0x3082ec={};_0x3082ec[_0xb0c0('0x30')]=_[_0xb0c0('0x43')](db['VtigerField'][_0xb0c0('0x44')]);_0x3082ec['query']=_[_0xb0c0('0x43')](_0x143ebd[_0xb0c0('0x34')]);_0x3082ec[_0xb0c0('0x31')]=_[_0xb0c0('0x32')](_0x3082ec[_0xb0c0('0x30')],_0x3082ec[_0xb0c0('0x34')]);_0x5b91db['attributes']=_[_0xb0c0('0x32')](_0x3082ec[_0xb0c0('0x30')],qs['fields'](_0x143ebd[_0xb0c0('0x34')]['fields']));_0x5b91db['attributes']=_0x5b91db[_0xb0c0('0x33')][_0xb0c0('0x36')]?_0x5b91db['attributes']:_0x3082ec['model'];if(_0x143ebd[_0xb0c0('0x34')][_0xb0c0('0x3d')]){_0x5b91db[_0xb0c0('0x3e')]=[{'all':!![]}];}_0x5b91db=_[_0xb0c0('0x3b')]({},_0x5b91db,_0x143ebd[_0xb0c0('0x3c')]);return db['VtigerField'][_0xb0c0('0x45')](_0x5b91db)[_0xb0c0('0x25')](handleEntityNotFound(_0x4589ba,null))[_0xb0c0('0x25')](respondWithResult(_0x4589ba,null))['catch'](handleError(_0x4589ba,null));};exports[_0xb0c0('0x46')]=function(_0x41c70b,_0x4ac1da){return db[_0xb0c0('0x2c')][_0xb0c0('0x46')](_0x41c70b[_0xb0c0('0x47')],{})[_0xb0c0('0x25')](respondWithResult(_0x4ac1da,0xc9))[_0xb0c0('0x48')](handleError(_0x4ac1da,null));};exports[_0xb0c0('0x49')]=function(_0x9856c9,_0x285800){if(_0x9856c9[_0xb0c0('0x47')]['id']){delete _0x9856c9['body']['id'];}return db[_0xb0c0('0x2c')][_0xb0c0('0x45')]({'where':{'id':_0x9856c9['params']['id']}})[_0xb0c0('0x25')](handleEntityNotFound(_0x285800,null))[_0xb0c0('0x25')](saveUpdates(_0x9856c9[_0xb0c0('0x47')],null))['then'](respondWithResult(_0x285800,null))[_0xb0c0('0x48')](handleError(_0x285800,null));};exports['destroy']=function(_0x1bea64,_0x586fe4){return db[_0xb0c0('0x2c')][_0xb0c0('0x45')]({'where':{'id':_0x1bea64['params']['id']}})[_0xb0c0('0x25')](handleEntityNotFound(_0x586fe4,null))[_0xb0c0('0x25')](removeEntity(_0x586fe4,null))[_0xb0c0('0x48')](handleError(_0x586fe4,null));};
\ No newline at end of file
+var _0x37ba=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','offset','undefined','limit','count','set','reject','update','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','merge','map','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','VtigerField','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x2bb82d,_0x370c78){var _0x353e04=function(_0x4e046a){while(--_0x4e046a){_0x2bb82d['push'](_0x2bb82d['shift']());}};_0x353e04(++_0x370c78);}(_0x37ba,0xc5));var _0xa37b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x37ba[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xa37b('0x0'));var rimraf=require(_0xa37b('0x1'));var zipdir=require(_0xa37b('0x2'));var jsonpatch=require(_0xa37b('0x3'));var rp=require('request-promise');var moment=require(_0xa37b('0x4'));var BPromise=require(_0xa37b('0x5'));var Mustache=require(_0xa37b('0x6'));var util=require(_0xa37b('0x7'));var path=require(_0xa37b('0x8'));var sox=require(_0xa37b('0x9'));var csv=require(_0xa37b('0xa'));var ejs=require(_0xa37b('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa37b('0xc'));var jsforce=require(_0xa37b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa37b('0xa'));var querystring=require(_0xa37b('0xe'));var Papa=require(_0xa37b('0xf'));var Redis=require(_0xa37b('0x10'));var authService=require(_0xa37b('0x11'));var qs=require(_0xa37b('0x12'));var as=require(_0xa37b('0x13'));var hardwareService=require(_0xa37b('0x14'));var logger=require(_0xa37b('0x15'))(_0xa37b('0x16'));var utils=require(_0xa37b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xa37b('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16ea80,_0x5c179e){_0x5c179e=_0x5c179e||0xcc;return function(_0x2a51d6){if(_0x2a51d6){return _0x16ea80['sendStatus'](_0x5c179e);}return _0x16ea80[_0xa37b('0x19')](_0x5c179e)[_0xa37b('0x1a')]();};}function respondWithResult(_0x1b1596,_0x6ab56b){_0x6ab56b=_0x6ab56b||0xc8;return function(_0x170707){if(_0x170707){return _0x1b1596[_0xa37b('0x19')](_0x6ab56b)['json'](_0x170707);}};}function respondWithFilteredResult(_0x38b634,_0x37a9e6){return function(_0x22fe30){if(_0x22fe30){var _0x167c9c=typeof _0x37a9e6[_0xa37b('0x1b')]===_0xa37b('0x1c')&&typeof _0x37a9e6[_0xa37b('0x1d')]===_0xa37b('0x1c');var _0x39f421=_0x22fe30[_0xa37b('0x1e')];var _0x242e4a=_0x167c9c?0x0:_0x37a9e6[_0xa37b('0x1b')];var _0x34e10f=_0x167c9c?_0x22fe30['count']:_0x37a9e6[_0xa37b('0x1b')]+_0x37a9e6[_0xa37b('0x1d')];var _0x341521;if(_0x34e10f>=_0x39f421){_0x34e10f=_0x39f421;_0x341521=0xc8;}else{_0x341521=0xce;}_0x38b634['status'](_0x341521);return _0x38b634[_0xa37b('0x1f')]('Content-Range',_0x242e4a+'-'+_0x34e10f+'/'+_0x39f421)['json'](_0x22fe30);}return null;};}function patchUpdates(_0x4a2577){return function(_0x4ac13c){try{jsonpatch['apply'](_0x4ac13c,_0x4a2577,!![]);}catch(_0x15546d){return BPromise[_0xa37b('0x20')](_0x15546d);}return _0x4ac13c['save']();};}function saveUpdates(_0x50a668,_0x195202){return function(_0x46db54){if(_0x46db54){return _0x46db54[_0xa37b('0x21')](_0x50a668)[_0xa37b('0x22')](function(_0x58d9ce){return _0x58d9ce;});}return null;};}function removeEntity(_0x313f65,_0x1aabad){return function(_0x123d36){if(_0x123d36){return _0x123d36[_0xa37b('0x23')]()[_0xa37b('0x22')](function(){_0x313f65['status'](0xcc)[_0xa37b('0x1a')]();});}};}function handleEntityNotFound(_0x53f7cb,_0x526190){return function(_0x503f67){if(!_0x503f67){_0x53f7cb[_0xa37b('0x24')](0x194);}return _0x503f67;};}function handleError(_0x268983,_0x39b167){_0x39b167=_0x39b167||0x1f4;return function(_0x3671e7){logger[_0xa37b('0x25')](_0x3671e7[_0xa37b('0x26')]);if(_0x3671e7[_0xa37b('0x27')]){delete _0x3671e7[_0xa37b('0x27')];}_0x268983[_0xa37b('0x19')](_0x39b167)[_0xa37b('0x28')](_0x3671e7);};}exports[_0xa37b('0x29')]=function(_0x3284c7,_0x5cf465){var _0x565f24={},_0x42362a={},_0x4f86f6={'count':0x0,'rows':[]};var _0x37a04d=_['map'](db['VtigerField'][_0xa37b('0x2a')],function(_0x30fc25){return{'name':_0x30fc25[_0xa37b('0x2b')],'type':_0x30fc25['type']['key']};});_0x42362a[_0xa37b('0x2c')]=_['map'](_0x37a04d,_0xa37b('0x27'));_0x42362a[_0xa37b('0x2d')]=_[_0xa37b('0x2e')](_0x3284c7['query']);_0x42362a['filters']=_[_0xa37b('0x2f')](_0x42362a[_0xa37b('0x2c')],_0x42362a[_0xa37b('0x2d')]);_0x565f24[_0xa37b('0x30')]=_['intersection'](_0x42362a[_0xa37b('0x2c')],qs[_0xa37b('0x31')](_0x3284c7['query']['fields']));_0x565f24[_0xa37b('0x30')]=_0x565f24['attributes'][_0xa37b('0x32')]?_0x565f24[_0xa37b('0x30')]:_0x42362a[_0xa37b('0x2c')];if(!_0x3284c7[_0xa37b('0x2d')][_0xa37b('0x33')]('nolimit')){_0x565f24[_0xa37b('0x1d')]=qs[_0xa37b('0x1d')](_0x3284c7[_0xa37b('0x2d')]['limit']);_0x565f24['offset']=qs[_0xa37b('0x1b')](_0x3284c7[_0xa37b('0x2d')][_0xa37b('0x1b')]);}_0x565f24['order']=qs[_0xa37b('0x34')](_0x3284c7[_0xa37b('0x2d')][_0xa37b('0x34')]);_0x565f24[_0xa37b('0x35')]=qs[_0xa37b('0x36')](_[_0xa37b('0x37')](_0x3284c7['query'],_0x42362a[_0xa37b('0x36')]),_0x37a04d);if(_0x3284c7[_0xa37b('0x2d')]['filter']){_0x565f24[_0xa37b('0x35')]=_[_0xa37b('0x38')](_0x565f24[_0xa37b('0x35')],{'$or':_[_0xa37b('0x39')](_0x37a04d,function(_0x460983){if(_0x460983[_0xa37b('0x3a')]!==_0xa37b('0x3b')){var _0x2dbdb7={};_0x2dbdb7[_0x460983[_0xa37b('0x27')]]={'$like':'%'+_0x3284c7[_0xa37b('0x2d')]['filter']+'%'};return _0x2dbdb7;}})});}_0x565f24=_[_0xa37b('0x38')]({},_0x565f24,_0x3284c7['options']);var _0x4bd7f6={'where':_0x565f24['where']};return db['VtigerField'][_0xa37b('0x1e')](_0x4bd7f6)[_0xa37b('0x22')](function(_0x2e9374){_0x4f86f6[_0xa37b('0x1e')]=_0x2e9374;if(_0x3284c7[_0xa37b('0x2d')][_0xa37b('0x3c')]){_0x565f24[_0xa37b('0x3d')]=[{'all':!![]}];}return db['VtigerField'][_0xa37b('0x3e')](_0x565f24);})[_0xa37b('0x22')](function(_0x32ca5f){_0x4f86f6[_0xa37b('0x3f')]=_0x32ca5f;return _0x4f86f6;})['then'](respondWithFilteredResult(_0x5cf465,_0x565f24))[_0xa37b('0x40')](handleError(_0x5cf465,null));};exports[_0xa37b('0x41')]=function(_0x451aae,_0x29d44d){var _0xd9ac4a={'raw':!![],'where':{'id':_0x451aae[_0xa37b('0x42')]['id']}},_0x1e10c0={};_0x1e10c0[_0xa37b('0x2c')]=_[_0xa37b('0x2e')](db[_0xa37b('0x43')][_0xa37b('0x2a')]);_0x1e10c0[_0xa37b('0x2d')]=_[_0xa37b('0x2e')](_0x451aae[_0xa37b('0x2d')]);_0x1e10c0[_0xa37b('0x36')]=_['intersection'](_0x1e10c0['model'],_0x1e10c0[_0xa37b('0x2d')]);_0xd9ac4a[_0xa37b('0x30')]=_[_0xa37b('0x2f')](_0x1e10c0[_0xa37b('0x2c')],qs[_0xa37b('0x31')](_0x451aae['query'][_0xa37b('0x31')]));_0xd9ac4a[_0xa37b('0x30')]=_0xd9ac4a[_0xa37b('0x30')][_0xa37b('0x32')]?_0xd9ac4a['attributes']:_0x1e10c0[_0xa37b('0x2c')];if(_0x451aae[_0xa37b('0x2d')]['includeAll']){_0xd9ac4a[_0xa37b('0x3d')]=[{'all':!![]}];}_0xd9ac4a=_[_0xa37b('0x38')]({},_0xd9ac4a,_0x451aae[_0xa37b('0x44')]);return db['VtigerField'][_0xa37b('0x45')](_0xd9ac4a)[_0xa37b('0x22')](handleEntityNotFound(_0x29d44d,null))[_0xa37b('0x22')](respondWithResult(_0x29d44d,null))['catch'](handleError(_0x29d44d,null));};exports[_0xa37b('0x46')]=function(_0xe4b754,_0x3c405f){return db[_0xa37b('0x43')]['create'](_0xe4b754[_0xa37b('0x47')],{})[_0xa37b('0x22')](respondWithResult(_0x3c405f,0xc9))[_0xa37b('0x40')](handleError(_0x3c405f,null));};exports[_0xa37b('0x21')]=function(_0x4d6c96,_0x48160c){if(_0x4d6c96[_0xa37b('0x47')]['id']){delete _0x4d6c96[_0xa37b('0x47')]['id'];}return db[_0xa37b('0x43')][_0xa37b('0x45')]({'where':{'id':_0x4d6c96['params']['id']}})[_0xa37b('0x22')](handleEntityNotFound(_0x48160c,null))[_0xa37b('0x22')](saveUpdates(_0x4d6c96[_0xa37b('0x47')],null))[_0xa37b('0x22')](respondWithResult(_0x48160c,null))[_0xa37b('0x40')](handleError(_0x48160c,null));};exports[_0xa37b('0x23')]=function(_0x119bf2,_0x56e4ab){return db[_0xa37b('0x43')][_0xa37b('0x45')]({'where':{'id':_0x119bf2['params']['id']}})[_0xa37b('0x22')](handleEntityNotFound(_0x56e4ab,null))['then'](removeEntity(_0x56e4ab,null))[_0xa37b('0x40')](handleError(_0x56e4ab,null));};
\ No newline at end of file
index 948e3b1..5fc2367 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeaf4=['../../config/environment','exports','define','int_vtiger_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','path','rimraf'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0xeaf4,0x124));var _0x4eaf=function(_0x207743,_0x42cb95){_0x207743=_0x207743-0x0;var _0x3d2084=_0xeaf4[_0x207743];return _0x3d2084;};'use strict';var _=require(_0x4eaf('0x0'));var util=require(_0x4eaf('0x1'));var logger=require(_0x4eaf('0x2'))(_0x4eaf('0x3'));var moment=require(_0x4eaf('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4eaf('0x5'));var rimraf=require(_0x4eaf('0x6'));var config=require(_0x4eaf('0x7'));var attributes=require('./intVtigerField.attributes');module[_0x4eaf('0x8')]=function(_0x58ec6a,_0x4a1a5f){return _0x58ec6a[_0x4eaf('0x9')]('VtigerField',attributes,{'tableName':_0x4eaf('0xa'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x4eaf('0xb'),_0x4eaf('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf84e=['moment','request-promise','path','rimraf','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','idField','FieldId','lodash','util'];(function(_0x5b419c,_0x4d9fca){var _0x2adfab=function(_0x52b74a){while(--_0x52b74a){_0x5b419c['push'](_0x5b419c['shift']());}};_0x2adfab(++_0x4d9fca);}(_0xf84e,0xe8));var _0xef84=function(_0x436a38,_0x31d62e){_0x436a38=_0x436a38-0x0;var _0x31c8ca=_0xf84e[_0x436a38];return _0x31c8ca;};'use strict';var _=require(_0xef84('0x0'));var util=require(_0xef84('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xef84('0x2'));var BPromise=require('bluebird');var rp=require(_0xef84('0x3'));var fs=require('fs');var path=require(_0xef84('0x4'));var rimraf=require(_0xef84('0x5'));var config=require('../../config/environment');var attributes=require(_0xef84('0x6'));module[_0xef84('0x7')]=function(_0x3e6691,_0x5db9fc){return _0x3e6691[_0xef84('0x8')](_0xef84('0x9'),attributes,{'tableName':_0xef84('0xa'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0xef84('0xb'),_0xef84('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 0fcc7db..83d8e9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x82dc=['VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x82dc,0x126));var _0xc82d=function(_0x1da2ff,_0x5cd5a8){_0x1da2ff=_0x1da2ff-0x0;var _0x2d0305=_0x82dc[_0x1da2ff];return _0x2d0305;};'use strict';var _=require(_0xc82d('0x0'));var util=require(_0xc82d('0x1'));var moment=require('moment');var BPromise=require(_0xc82d('0x2'));var rs=require(_0xc82d('0x3'));var fs=require('fs');var Redis=require(_0xc82d('0x4'));var db=require(_0xc82d('0x5'))['db'];var utils=require(_0xc82d('0x6'));var logger=require(_0xc82d('0x7'))(_0xc82d('0x8'));var config=require(_0xc82d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc82d('0xa')][_0xc82d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2316b6,_0xb287b2,_0x1b19e0){return new BPromise(function(_0x33fb24,_0x173b7a){return client[_0xc82d('0xc')](_0x2316b6,_0x1b19e0)[_0xc82d('0xd')](function(_0x11f342){logger[_0xc82d('0xe')](_0xc82d('0xf'),_0xb287b2,_0xc82d('0x10'));logger[_0xc82d('0x11')](_0xc82d('0x12'),_0xb287b2,_0xc82d('0x10'),JSON[_0xc82d('0x13')](_0x11f342));if(_0x11f342[_0xc82d('0x14')]){if(_0x11f342[_0xc82d('0x14')]['code']===0x1f4){logger[_0xc82d('0x14')](_0xc82d('0xf'),_0xb287b2,_0x11f342[_0xc82d('0x14')][_0xc82d('0x15')]);return _0x173b7a(_0x11f342['error'][_0xc82d('0x15')]);}logger[_0xc82d('0x14')](_0xc82d('0xf'),_0xb287b2,_0x11f342[_0xc82d('0x14')]['message']);return _0x33fb24(_0x11f342[_0xc82d('0x14')]['message']);}else{logger[_0xc82d('0xe')](_0xc82d('0xf'),_0xb287b2,_0xc82d('0x10'));_0x33fb24(_0x11f342[_0xc82d('0x16')][_0xc82d('0x15')]);}})[_0xc82d('0x17')](function(_0x59acb8){logger[_0xc82d('0x14')](_0xc82d('0xf'),_0xb287b2,_0x59acb8);_0x173b7a(_0x59acb8);});});}
\ No newline at end of file
+var _0x1e7d=['info','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','error','code','VtigerField,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http'];(function(_0x25a972,_0x5d2fcd){var _0x24ad56=function(_0x3d0e5f){while(--_0x3d0e5f){_0x25a972['push'](_0x25a972['shift']());}};_0x24ad56(++_0x5d2fcd);}(_0x1e7d,0x100));var _0xd1e7=function(_0x5ea580,_0x2f0627){_0x5ea580=_0x5ea580-0x0;var _0x6ca72b=_0x1e7d[_0x5ea580];return _0x6ca72b;};'use strict';var _=require('lodash');var util=require(_0xd1e7('0x0'));var moment=require(_0xd1e7('0x1'));var BPromise=require(_0xd1e7('0x2'));var rs=require(_0xd1e7('0x3'));var fs=require('fs');var Redis=require(_0xd1e7('0x4'));var db=require(_0xd1e7('0x5'))['db'];var utils=require(_0xd1e7('0x6'));var logger=require(_0xd1e7('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd1e7('0x8'));var client=jayson['client'][_0xd1e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e3251,_0x47d2a6,_0x3413fb){return new BPromise(function(_0x10a914,_0x3bfb0d){return client['request'](_0x1e3251,_0x3413fb)['then'](function(_0x5d786e){logger[_0xd1e7('0xa')]('VtigerField,\x20%s,\x20%s',_0x47d2a6,_0xd1e7('0xb'));logger[_0xd1e7('0xc')](_0xd1e7('0xd'),_0x47d2a6,_0xd1e7('0xb'),JSON['stringify'](_0x5d786e));if(_0x5d786e[_0xd1e7('0xe')]){if(_0x5d786e[_0xd1e7('0xe')][_0xd1e7('0xf')]===0x1f4){logger['error'](_0xd1e7('0x10'),_0x47d2a6,_0x5d786e[_0xd1e7('0xe')][_0xd1e7('0x11')]);return _0x3bfb0d(_0x5d786e[_0xd1e7('0xe')]['message']);}logger['error'](_0xd1e7('0x10'),_0x47d2a6,_0x5d786e[_0xd1e7('0xe')][_0xd1e7('0x11')]);return _0x10a914(_0x5d786e[_0xd1e7('0xe')]['message']);}else{logger['info'](_0xd1e7('0x10'),_0x47d2a6,'request\x20sent');_0x10a914(_0x5d786e['result'][_0xd1e7('0x11')]);}})[_0xd1e7('0x12')](function(_0x56bd81){logger[_0xd1e7('0xe')](_0xd1e7('0x10'),_0x47d2a6,_0x56bd81);_0x3bfb0d(_0x56bd81);});});}
\ No newline at end of file
index dd1550b..7ab3e54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x548f=['Router','fs-extra','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','create','post','addConfiguration','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x5000f5,_0x549e98){var _0x34ca60=function(_0x170996){while(--_0x170996){_0x5000f5['push'](_0x5000f5['shift']());}};_0x34ca60(++_0x549e98);}(_0x548f,0x104));var _0xf548=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x548f[_0x1b6186];return _0x186121;};'use strict';var multer=require(_0xf548('0x0'));var util=require(_0xf548('0x1'));var path=require(_0xf548('0x2'));var timeout=require('connect-timeout');var express=require(_0xf548('0x3'));var router=express[_0xf548('0x4')]();var fs_extra=require(_0xf548('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf548('0x6'));var controller=require(_0xf548('0x7'));router[_0xf548('0x8')]('/',auth[_0xf548('0x9')](),controller[_0xf548('0xa')]);router[_0xf548('0x8')](_0xf548('0xb'),auth['isAuthenticated'](),controller[_0xf548('0xc')]);router[_0xf548('0x8')](_0xf548('0xd'),auth[_0xf548('0x9')](),controller[_0xf548('0xe')]);router[_0xf548('0x8')]('/:id/fields',auth[_0xf548('0x9')](),controller[_0xf548('0xf')]);router['post']('/',auth[_0xf548('0x9')](),controller[_0xf548('0x10')]);router[_0xf548('0x11')](_0xf548('0xd'),auth[_0xf548('0x9')](),controller[_0xf548('0x12')]);router[_0xf548('0x13')](_0xf548('0xb'),auth['isAuthenticated'](),controller[_0xf548('0x14')]);router[_0xf548('0x15')](_0xf548('0xb'),auth[_0xf548('0x9')](),controller[_0xf548('0x16')]);module[_0xf548('0x17')]=router;
\ No newline at end of file
+var _0x745c=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','update','destroy'];(function(_0x31e40f,_0x14f181){var _0x2290fe=function(_0x54eb68){while(--_0x54eb68){_0x31e40f['push'](_0x31e40f['shift']());}};_0x2290fe(++_0x14f181);}(_0x745c,0x1e4));var _0xc745=function(_0x16b1b8,_0x432d03){_0x16b1b8=_0x16b1b8-0x0;var _0x558b1e=_0x745c[_0x16b1b8];return _0x558b1e;};'use strict';var multer=require(_0xc745('0x0'));var util=require(_0xc745('0x1'));var path=require('path');var timeout=require(_0xc745('0x2'));var express=require(_0xc745('0x3'));var router=express[_0xc745('0x4')]();var fs_extra=require(_0xc745('0x5'));var auth=require(_0xc745('0x6'));var interaction=require(_0xc745('0x7'));var config=require(_0xc745('0x8'));var controller=require(_0xc745('0x9'));router[_0xc745('0xa')]('/',auth[_0xc745('0xb')](),controller[_0xc745('0xc')]);router[_0xc745('0xa')](_0xc745('0xd'),auth[_0xc745('0xb')](),controller['show']);router['get']('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0xc745('0xa')](_0xc745('0xe'),auth['isAuthenticated'](),controller[_0xc745('0xf')]);router[_0xc745('0x10')]('/',auth['isAuthenticated'](),controller[_0xc745('0x11')]);router['post'](_0xc745('0x12'),auth[_0xc745('0xb')](),controller[_0xc745('0x13')]);router['put'](_0xc745('0xd'),auth['isAuthenticated'](),controller[_0xc745('0x14')]);router['delete']('/:id',auth[_0xc745('0xb')](),controller[_0xc745('0x15')]);module[_0xc745('0x16')]=router;
\ No newline at end of file
index 9a3c88d..435f0e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6f9=['password','integrationTab','sequelize','exports','STRING','username','remoteUri','ENUM'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0xd6f9,0x1ca));var _0x9d6f=function(_0x99868f,_0xbdb8e7){_0x99868f=_0x99868f-0x0;var _0x27a71b=_0xd6f9[_0x99868f];return _0x27a71b;};'use strict';var Sequelize=require(_0x9d6f('0x0'));module[_0x9d6f('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x9d6f('0x2')],'unique':_0x9d6f('0x3')},'password':{'type':Sequelize[_0x9d6f('0x2')]},'token':{'type':Sequelize[_0x9d6f('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x9d6f('0x4')},'authType':{'type':Sequelize[_0x9d6f('0x5')](_0x9d6f('0x6'),'token'),'defaultValue':_0x9d6f('0x6')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x9d6f('0x7'),'newTab'),'defaultValue':_0x9d6f('0x7')}};
\ No newline at end of file
+var _0x002d=['integrationTab','newTab','sequelize','exports','STRING','username','remoteUri','ENUM','password','token'];(function(_0x591360,_0x3480d2){var _0x499b6a=function(_0x3bfea1){while(--_0x3bfea1){_0x591360['push'](_0x591360['shift']());}};_0x499b6a(++_0x3480d2);}(_0x002d,0xca));var _0xd002=function(_0x1d3ed9,_0x5a9d38){_0x1d3ed9=_0x1d3ed9-0x0;var _0x4a4e71=_0x002d[_0x1d3ed9];return _0x4a4e71;};'use strict';var Sequelize=require(_0xd002('0x0'));module[_0xd002('0x1')]={'name':{'type':Sequelize[_0xd002('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0xd002('0x3')},'password':{'type':Sequelize[_0xd002('0x2')]},'token':{'type':Sequelize[_0xd002('0x2')]},'remoteUri':{'type':Sequelize[_0xd002('0x2')],'unique':_0xd002('0x4')},'authType':{'type':Sequelize[_0xd002('0x5')](_0xd002('0x6'),_0xd002('0x7')),'defaultValue':_0xd002('0x6')},'serverUrl':{'type':Sequelize[_0xd002('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xd002('0x5')](_0xd002('0x8'),_0xd002('0x9')),'defaultValue':_0xd002('0x8')}};
\ No newline at end of file
index f89f127..f6961d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x087b=['nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','catch','params','length','find','create','body','getConfigurations','findOne','ZendeskConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','ZendeskField','getFields','username','password','token','authType','remoteUri','slice','lastIndexOf','GET','format','ticket_fields','headers','Basic\x20%s','toString','base64','Sequelize','Unknown\x20authentication\x20type','description','group','assignee','remove','position','system_field_options','custom_field_options','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','request-promise','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','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ZendeskAccount','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x087b,0x11a));var _0xb087=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x087b[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require(_0xb087('0x0'));var rimraf=require(_0xb087('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb087('0x2'));var moment=require('moment');var BPromise=require(_0xb087('0x3'));var Mustache=require(_0xb087('0x4'));var util=require(_0xb087('0x5'));var path=require(_0xb087('0x6'));var sox=require(_0xb087('0x7'));var csv=require(_0xb087('0x8'));var ejs=require(_0xb087('0x9'));var fs=require('fs');var fs_extra=require(_0xb087('0xa'));var _=require(_0xb087('0xb'));var squel=require(_0xb087('0xc'));var crypto=require(_0xb087('0xd'));var jsforce=require(_0xb087('0xe'));var deskjs=require(_0xb087('0xf'));var toCsv=require(_0xb087('0x8'));var querystring=require(_0xb087('0x10'));var Papa=require(_0xb087('0x11'));var Redis=require(_0xb087('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb087('0x13'));var as=require(_0xb087('0x14'));var hardwareService=require(_0xb087('0x15'));var logger=require(_0xb087('0x16'))(_0xb087('0x17'));var utils=require(_0xb087('0x18'));var config=require(_0xb087('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xb087('0x1a'))['db'];var integrations=require(_0xb087('0x1b'));function respondWithStatusCode(_0x323656,_0x51ceaa){_0x51ceaa=_0x51ceaa||0xcc;return function(_0x3001e3){if(_0x3001e3){return _0x323656[_0xb087('0x1c')](_0x51ceaa);}return _0x323656[_0xb087('0x1d')](_0x51ceaa)[_0xb087('0x1e')]();};}function respondWithResult(_0x11784c,_0x12d0db){_0x12d0db=_0x12d0db||0xc8;return function(_0x5e9757){if(_0x5e9757){return _0x11784c[_0xb087('0x1d')](_0x12d0db)[_0xb087('0x1f')](_0x5e9757);}};}function respondWithFilteredResult(_0x16d0b7,_0x5193a4){return function(_0x43e576){if(_0x43e576){var _0x412b48=typeof _0x5193a4['offset']===_0xb087('0x20')&&typeof _0x5193a4[_0xb087('0x21')]===_0xb087('0x20');var _0x5bb80b=_0x43e576[_0xb087('0x22')];var _0x3c680f=_0x412b48?0x0:_0x5193a4[_0xb087('0x23')];var _0x45d074=_0x412b48?_0x43e576['count']:_0x5193a4[_0xb087('0x23')]+_0x5193a4[_0xb087('0x21')];var _0x10bb5b;if(_0x45d074>=_0x5bb80b){_0x45d074=_0x5bb80b;_0x10bb5b=0xc8;}else{_0x10bb5b=0xce;}_0x16d0b7[_0xb087('0x1d')](_0x10bb5b);return _0x16d0b7['set']('Content-Range',_0x3c680f+'-'+_0x45d074+'/'+_0x5bb80b)['json'](_0x43e576);}return null;};}function patchUpdates(_0x49450a){return function(_0x45a6cf){try{jsonpatch[_0xb087('0x24')](_0x45a6cf,_0x49450a,!![]);}catch(_0x3d0f57){return BPromise[_0xb087('0x25')](_0x3d0f57);}return _0x45a6cf[_0xb087('0x26')]();};}function saveUpdates(_0x258b4c,_0x31ae01){return function(_0x5587f7){if(_0x5587f7){return _0x5587f7[_0xb087('0x27')](_0x258b4c)[_0xb087('0x28')](function(_0x1de654){return _0x1de654;});}return null;};}function removeEntity(_0x1cfb3e,_0x3ad74e){return function(_0x4d9028){if(_0x4d9028){return _0x4d9028[_0xb087('0x29')]()[_0xb087('0x28')](function(){_0x1cfb3e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x50745a,_0x598b99){return function(_0x5a4ee0){if(!_0x5a4ee0){_0x50745a[_0xb087('0x1c')](0x194);}return _0x5a4ee0;};}function handleError(_0x45685d,_0x1d124f){_0x1d124f=_0x1d124f||0x1f4;return function(_0x3ca2df){logger[_0xb087('0x2a')](_0x3ca2df[_0xb087('0x2b')]);if(_0x3ca2df[_0xb087('0x2c')]){delete _0x3ca2df[_0xb087('0x2c')];}_0x45685d[_0xb087('0x1d')](_0x1d124f)[_0xb087('0x2d')](_0x3ca2df);};}exports[_0xb087('0x2e')]=function(_0x31e3e6,_0xb0baf6){var _0x263259={},_0x593b78={},_0x37393a={'count':0x0,'rows':[]};var _0x1335d9=_[_0xb087('0x2f')](db[_0xb087('0x30')][_0xb087('0x31')],function(_0xa6d90c){return{'name':_0xa6d90c[_0xb087('0x32')],'type':_0xa6d90c[_0xb087('0x33')]['key']};});_0x593b78['model']=_[_0xb087('0x2f')](_0x1335d9,_0xb087('0x2c'));_0x593b78['query']=_[_0xb087('0x34')](_0x31e3e6[_0xb087('0x35')]);_0x593b78[_0xb087('0x36')]=_[_0xb087('0x37')](_0x593b78[_0xb087('0x38')],_0x593b78[_0xb087('0x35')]);_0x263259[_0xb087('0x39')]=_[_0xb087('0x37')](_0x593b78[_0xb087('0x38')],qs[_0xb087('0x3a')](_0x31e3e6[_0xb087('0x35')][_0xb087('0x3a')]));_0x263259['attributes']=_0x263259[_0xb087('0x39')]['length']?_0x263259[_0xb087('0x39')]:_0x593b78[_0xb087('0x38')];if(!_0x31e3e6[_0xb087('0x35')][_0xb087('0x3b')](_0xb087('0x3c'))){_0x263259[_0xb087('0x21')]=qs[_0xb087('0x21')](_0x31e3e6[_0xb087('0x35')][_0xb087('0x21')]);_0x263259['offset']=qs['offset'](_0x31e3e6[_0xb087('0x35')][_0xb087('0x23')]);}_0x263259[_0xb087('0x3d')]=qs[_0xb087('0x3e')](_0x31e3e6[_0xb087('0x35')]['sort']);_0x263259[_0xb087('0x3f')]=qs[_0xb087('0x36')](_['pick'](_0x31e3e6['query'],_0x593b78[_0xb087('0x36')]),_0x1335d9);if(_0x31e3e6[_0xb087('0x35')][_0xb087('0x40')]){_0x263259['where']=_[_0xb087('0x41')](_0x263259[_0xb087('0x3f')],{'$or':_[_0xb087('0x2f')](_0x1335d9,function(_0x1ed2c9){if(_0x1ed2c9[_0xb087('0x33')]!=='VIRTUAL'){var _0x7e1315={};_0x7e1315[_0x1ed2c9['name']]={'$like':'%'+_0x31e3e6[_0xb087('0x35')]['filter']+'%'};return _0x7e1315;}})});}_0x263259=_[_0xb087('0x41')]({},_0x263259,_0x31e3e6[_0xb087('0x42')]);var _0x513332={'where':_0x263259[_0xb087('0x3f')]};return db['ZendeskAccount'][_0xb087('0x22')](_0x513332)['then'](function(_0x2d2c74){_0x37393a[_0xb087('0x22')]=_0x2d2c74;if(_0x31e3e6[_0xb087('0x35')][_0xb087('0x43')]){_0x263259[_0xb087('0x44')]=[{'all':!![]}];}return db[_0xb087('0x30')][_0xb087('0x45')](_0x263259);})['then'](function(_0x1625f6){_0x37393a['rows']=_0x1625f6;return _0x37393a;})[_0xb087('0x28')](respondWithFilteredResult(_0xb0baf6,_0x263259))[_0xb087('0x46')](handleError(_0xb0baf6,null));};exports['show']=function(_0xb662bf,_0x45dc6f){var _0x7650c5={'raw':![],'where':{'id':_0xb662bf[_0xb087('0x47')]['id']}},_0x4c33cc={};_0x4c33cc['model']=_[_0xb087('0x34')](db[_0xb087('0x30')]['rawAttributes']);_0x4c33cc[_0xb087('0x35')]=_[_0xb087('0x34')](_0xb662bf['query']);_0x4c33cc[_0xb087('0x36')]=_[_0xb087('0x37')](_0x4c33cc['model'],_0x4c33cc[_0xb087('0x35')]);_0x7650c5[_0xb087('0x39')]=_[_0xb087('0x37')](_0x4c33cc[_0xb087('0x38')],qs['fields'](_0xb662bf['query'][_0xb087('0x3a')]));_0x7650c5[_0xb087('0x39')]=_0x7650c5[_0xb087('0x39')][_0xb087('0x48')]?_0x7650c5[_0xb087('0x39')]:_0x4c33cc[_0xb087('0x38')];if(_0xb662bf['query']['includeAll']){_0x7650c5[_0xb087('0x44')]=[{'all':!![]}];}_0x7650c5=_['merge']({},_0x7650c5,_0xb662bf[_0xb087('0x42')]);return db[_0xb087('0x30')][_0xb087('0x49')](_0x7650c5)[_0xb087('0x28')](handleEntityNotFound(_0x45dc6f,null))['then'](respondWithResult(_0x45dc6f,null))[_0xb087('0x46')](handleError(_0x45dc6f,null));};exports['create']=function(_0x2fe8a0,_0x73413b){return db[_0xb087('0x30')][_0xb087('0x4a')](_0x2fe8a0[_0xb087('0x4b')],{})['then'](respondWithResult(_0x73413b,0xc9))[_0xb087('0x46')](handleError(_0x73413b,null));};exports[_0xb087('0x27')]=function(_0x588d96,_0x4fba31){if(_0x588d96[_0xb087('0x4b')]['id']){delete _0x588d96['body']['id'];}return db['ZendeskAccount'][_0xb087('0x49')]({'where':{'id':_0x588d96[_0xb087('0x47')]['id']}})['then'](handleEntityNotFound(_0x4fba31,null))[_0xb087('0x28')](saveUpdates(_0x588d96[_0xb087('0x4b')],null))[_0xb087('0x28')](respondWithResult(_0x4fba31,null))['catch'](handleError(_0x4fba31,null));};exports['destroy']=function(_0x30cc83,_0x54862a){return db['ZendeskAccount'][_0xb087('0x49')]({'where':{'id':_0x30cc83[_0xb087('0x47')]['id']}})[_0xb087('0x28')](handleEntityNotFound(_0x54862a,null))[_0xb087('0x28')](removeEntity(_0x54862a,null))[_0xb087('0x46')](handleError(_0x54862a,null));};exports[_0xb087('0x4c')]=function(_0xbd849d,_0xfb8827,_0x1fe178){var _0x18d93b={};var _0x47d47c={};var _0x2cfc44;var _0x55e653;return db[_0xb087('0x30')][_0xb087('0x4d')]({'where':{'id':_0xbd849d['params']['id']}})[_0xb087('0x28')](handleEntityNotFound(_0xfb8827,null))[_0xb087('0x28')](function(_0x343830){if(_0x343830){_0x2cfc44=_0x343830;_0x47d47c[_0xb087('0x38')]=_[_0xb087('0x34')](db[_0xb087('0x4e')][_0xb087('0x31')]);_0x47d47c[_0xb087('0x35')]=_[_0xb087('0x34')](_0xbd849d[_0xb087('0x35')]);_0x47d47c[_0xb087('0x36')]=_['intersection'](_0x47d47c[_0xb087('0x38')],_0x47d47c['query']);_0x18d93b[_0xb087('0x39')]=_['intersection'](_0x47d47c[_0xb087('0x38')],qs[_0xb087('0x3a')](_0xbd849d[_0xb087('0x35')][_0xb087('0x3a')]));_0x18d93b[_0xb087('0x39')]=_0x18d93b[_0xb087('0x39')][_0xb087('0x48')]?_0x18d93b[_0xb087('0x39')]:_0x47d47c[_0xb087('0x38')];_0x18d93b[_0xb087('0x3d')]=qs[_0xb087('0x3e')](_0xbd849d[_0xb087('0x35')][_0xb087('0x3e')]);_0x18d93b[_0xb087('0x3f')]=qs[_0xb087('0x36')](_[_0xb087('0x4f')](_0xbd849d[_0xb087('0x35')],_0x47d47c[_0xb087('0x36')]));if(_0xbd849d[_0xb087('0x35')][_0xb087('0x40')]){_0x18d93b[_0xb087('0x3f')]=_[_0xb087('0x41')](_0x18d93b['where'],{'$or':_[_0xb087('0x2f')](_0x18d93b[_0xb087('0x39')],function(_0xe81087){var _0x561c40={};_0x561c40[_0xe81087]={'$like':'%'+_0xbd849d[_0xb087('0x35')][_0xb087('0x40')]+'%'};return _0x561c40;})});}_0x18d93b=_['merge']({},_0x18d93b,_0xbd849d[_0xb087('0x42')]);return _0x2cfc44[_0xb087('0x4c')](_0x18d93b);}})[_0xb087('0x28')](function(_0x596264){if(_0x596264){_0x55e653=_0x596264[_0xb087('0x48')];if(!_0xbd849d[_0xb087('0x35')][_0xb087('0x3b')](_0xb087('0x3c'))){_0x18d93b[_0xb087('0x21')]=qs[_0xb087('0x21')](_0xbd849d[_0xb087('0x35')][_0xb087('0x21')]);_0x18d93b['offset']=qs[_0xb087('0x23')](_0xbd849d[_0xb087('0x35')][_0xb087('0x23')]);}return _0x2cfc44['getConfigurations'](_0x18d93b);}})[_0xb087('0x28')](function(_0x4a26d0){if(_0x4a26d0){return _0x4a26d0?{'count':_0x55e653,'rows':_0x4a26d0}:null;}})['then'](respondWithResult(_0xfb8827,null))[_0xb087('0x46')](handleError(_0xfb8827,null));};exports[_0xb087('0x50')]=function(_0x48c00c,_0x298fdb,_0x524d18){if(_0x48c00c[_0xb087('0x4b')]['id']){delete _0x48c00c[_0xb087('0x4b')]['id'];}return db['ZendeskAccount']['findOne']({'where':{'id':_0x48c00c[_0xb087('0x47')]['id']}})['then'](handleEntityNotFound(_0x298fdb,null))['then'](function(_0x3c97ab){if(_0x3c97ab){_0x48c00c['body'][_0xb087('0x51')]=_0x3c97ab['id'];_0x48c00c['body'][_0xb087('0x52')]=integrations[_0xb087('0x53')](_0x48c00c[_0xb087('0x4b')][_0xb087('0x54')],_0x48c00c[_0xb087('0x4b')][_0xb087('0x33')]);_0x48c00c['body'][_0xb087('0x55')]=integrations['getDescriptions'](_0x48c00c[_0xb087('0x4b')][_0xb087('0x54')],_0x48c00c[_0xb087('0x4b')]['type']);return db[_0xb087('0x4e')]['create'](_0x48c00c[_0xb087('0x4b')],{'include':[{'model':db[_0xb087('0x56')],'as':_0xb087('0x52')},{'model':db[_0xb087('0x56')],'as':_0xb087('0x55')}]});}return null;})[_0xb087('0x28')](respondWithResult(_0x298fdb,null))['catch'](handleError(_0x298fdb,null));};exports[_0xb087('0x57')]=function(_0xd01a6b,_0x4bedbd,_0x25a45f){var _0x58de88='';return db[_0xb087('0x30')][_0xb087('0x4d')]({'where':{'id':_0xd01a6b[_0xb087('0x47')]['id']},'attributes':['id',_0xb087('0x58'),_0xb087('0x59'),_0xb087('0x5a'),_0xb087('0x5b'),_0xb087('0x5c')]})['then'](handleEntityNotFound(_0x4bedbd,null))['then'](function(_0x5c727f){if(_0x5c727f){_0x58de88=_0x5c727f[_0xb087('0x5c')];var _0x5190a4=_0x58de88[_0xb087('0x5d')](-0x1);if(_0x5190a4==='/'){_0x58de88=_0x58de88['substring'](0x0,_0x58de88[_0xb087('0x5e')](_0x5190a4));}var _0x43bf47={'method':_0xb087('0x5f'),'uri':util[_0xb087('0x60')]('%s/%s',_0x58de88,_0xb087('0x61')),'json':!![]};switch(_0x5c727f['authType']){case _0xb087('0x59'):_0x43bf47[_0xb087('0x62')]={'Authorization':util[_0xb087('0x60')](_0xb087('0x63'),new Buffer(util['format']('%s:%s',_0x5c727f[_0xb087('0x58')],_0x5c727f['password']))[_0xb087('0x64')](_0xb087('0x65')))};break;case _0xb087('0x5a'):_0x43bf47[_0xb087('0x62')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0xb087('0x60')]('%s/token:%s',_0x5c727f[_0xb087('0x58')],_0x5c727f[_0xb087('0x5a')]))[_0xb087('0x64')](_0xb087('0x65')))};break;default:throw new db[(_0xb087('0x66'))]['ValidationError'](_0xb087('0x67'));}return rp(_0x43bf47);}})[_0xb087('0x28')](function(_0x5b9c5f){if(_0x5b9c5f){var _0x544ee0=['subject',_0xb087('0x68'),_0xb087('0x69'),_0xb087('0x6a')];_[_0xb087('0x6b')](_0x5b9c5f[_0xb087('0x61')],function(_0x19d7ae){return _0x544ee0['includes'](_0x19d7ae[_0xb087('0x33')]);});return{'count':_0x5b9c5f[_0xb087('0x61')][_0xb087('0x48')],'rows':_[_0xb087('0x2f')](_0x5b9c5f[_0xb087('0x61')],function(_0x3330b2){return{'id':_0x3330b2['id'],'name':_0x3330b2[_0xb087('0x6c')]>0x7?_0x3330b2['title']:_0x3330b2[_0xb087('0x33')],'custom':_0x3330b2[_0xb087('0x6c')]>0x7?!![]:![],'options':_0x3330b2[_0xb087('0x6d')]?_0x3330b2['system_field_options']:_0x3330b2[_0xb087('0x6e')]?_0x3330b2['custom_field_options']:[]};})};}})[_0xb087('0x28')](respondWithResult(_0x4bedbd,null))[_0xb087('0x46')](function(_0x45da69){var _0x267dea=_0xd01a6b[_0xb087('0x35')][_0xb087('0x6f')]?0x1f4:_0x45da69['statusCode']||0x1f4;logger['error'](_0xb087('0x70'),_0xb087('0x57'),_0x267dea,JSON['stringify'](_0x45da69));delete _0x45da69[_0xb087('0x2c')];if(_0x267dea===0x191){_0x267dea=0x190;}_0x4bedbd[_0xb087('0x1d')](_0x267dea)[_0xb087('0x2d')](_0xd01a6b[_0xb087('0x35')][_0xb087('0x6f')]?{'message':_0xb087('0x71'),'statusCode':_0x45da69['statusCode']}:_0x45da69);});};
\ No newline at end of file
+var _0x9ffd=['catch','show','params','rawAttributes','find','create','body','destroy','getConfigurations','ZendeskConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ZendeskField','findOne','username','password','token','authType','substring','lastIndexOf','format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','base64','%s/token:%s','toString','Sequelize','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','send','Wrong\x20credentials','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','update','then','stack','name','index','map','ZendeskAccount','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll'];(function(_0x484141,_0x355fe7){var _0x16f7ef=function(_0x2b2d0d){while(--_0x2b2d0d){_0x484141['push'](_0x484141['shift']());}};_0x16f7ef(++_0x355fe7);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x30b842,_0xcac52b){_0x30b842=_0x30b842-0x0;var _0x37a58b=_0x9ffd[_0x30b842];return _0x37a58b;};'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 hardwareService=require(_0xd9ff('0x13'));var logger=require(_0xd9ff('0x14'))(_0xd9ff('0x15'));var utils=require(_0xd9ff('0x16'));var config=require(_0xd9ff('0x17'));var licenseUtil=require(_0xd9ff('0x18'));var db=require(_0xd9ff('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x47b0d7,_0xaaf7af){_0xaaf7af=_0xaaf7af||0xcc;return function(_0x16a0d9){if(_0x16a0d9){return _0x47b0d7[_0xd9ff('0x1a')](_0xaaf7af);}return _0x47b0d7[_0xd9ff('0x1b')](_0xaaf7af)[_0xd9ff('0x1c')]();};}function respondWithResult(_0x556aa4,_0x2f78c1){_0x2f78c1=_0x2f78c1||0xc8;return function(_0x3c9ace){if(_0x3c9ace){return _0x556aa4['status'](_0x2f78c1)[_0xd9ff('0x1d')](_0x3c9ace);}};}function respondWithFilteredResult(_0x5db010,_0x4ffe54){return function(_0x547e28){if(_0x547e28){var _0x4c5718=typeof _0x4ffe54[_0xd9ff('0x1e')]==='undefined'&&typeof _0x4ffe54[_0xd9ff('0x1f')]===_0xd9ff('0x20');var _0x39c6ce=_0x547e28[_0xd9ff('0x21')];var _0x5f45c4=_0x4c5718?0x0:_0x4ffe54[_0xd9ff('0x1e')];var _0x3ccf15=_0x4c5718?_0x547e28[_0xd9ff('0x21')]:_0x4ffe54[_0xd9ff('0x1e')]+_0x4ffe54[_0xd9ff('0x1f')];var _0x3ea97d;if(_0x3ccf15>=_0x39c6ce){_0x3ccf15=_0x39c6ce;_0x3ea97d=0xc8;}else{_0x3ea97d=0xce;}_0x5db010[_0xd9ff('0x1b')](_0x3ea97d);return _0x5db010[_0xd9ff('0x22')]('Content-Range',_0x5f45c4+'-'+_0x3ccf15+'/'+_0x39c6ce)['json'](_0x547e28);}return null;};}function patchUpdates(_0x264a3d){return function(_0x3eed13){try{jsonpatch['apply'](_0x3eed13,_0x264a3d,!![]);}catch(_0x588151){return BPromise['reject'](_0x588151);}return _0x3eed13['save']();};}function saveUpdates(_0x1f4d9e,_0x58eb5f){return function(_0x4c486a){if(_0x4c486a){return _0x4c486a[_0xd9ff('0x23')](_0x1f4d9e)[_0xd9ff('0x24')](function(_0x9f074e){return _0x9f074e;});}return null;};}function removeEntity(_0x278b66,_0x42a828){return function(_0x4b058a){if(_0x4b058a){return _0x4b058a['destroy']()[_0xd9ff('0x24')](function(){_0x278b66['status'](0xcc)[_0xd9ff('0x1c')]();});}};}function handleEntityNotFound(_0x4d86fe,_0x285002){return function(_0x5d45b3){if(!_0x5d45b3){_0x4d86fe[_0xd9ff('0x1a')](0x194);}return _0x5d45b3;};}function handleError(_0x159e56,_0x2138b4){_0x2138b4=_0x2138b4||0x1f4;return function(_0x2970e8){logger['error'](_0x2970e8[_0xd9ff('0x25')]);if(_0x2970e8[_0xd9ff('0x26')]){delete _0x2970e8[_0xd9ff('0x26')];}_0x159e56[_0xd9ff('0x1b')](_0x2138b4)['send'](_0x2970e8);};}exports[_0xd9ff('0x27')]=function(_0x3792d9,_0x44b5a7){var _0x45fb63={},_0x263d3a={},_0xe516e2={'count':0x0,'rows':[]};var _0x420ffa=_[_0xd9ff('0x28')](db[_0xd9ff('0x29')]['rawAttributes'],function(_0xcea5db){return{'name':_0xcea5db['fieldName'],'type':_0xcea5db[_0xd9ff('0x2a')][_0xd9ff('0x2b')]};});_0x263d3a[_0xd9ff('0x2c')]=_['map'](_0x420ffa,_0xd9ff('0x26'));_0x263d3a[_0xd9ff('0x2d')]=_[_0xd9ff('0x2e')](_0x3792d9[_0xd9ff('0x2d')]);_0x263d3a['filters']=_[_0xd9ff('0x2f')](_0x263d3a['model'],_0x263d3a[_0xd9ff('0x2d')]);_0x45fb63[_0xd9ff('0x30')]=_[_0xd9ff('0x2f')](_0x263d3a[_0xd9ff('0x2c')],qs[_0xd9ff('0x31')](_0x3792d9[_0xd9ff('0x2d')][_0xd9ff('0x31')]));_0x45fb63[_0xd9ff('0x30')]=_0x45fb63[_0xd9ff('0x30')][_0xd9ff('0x32')]?_0x45fb63[_0xd9ff('0x30')]:_0x263d3a[_0xd9ff('0x2c')];if(!_0x3792d9[_0xd9ff('0x2d')][_0xd9ff('0x33')]('nolimit')){_0x45fb63[_0xd9ff('0x1f')]=qs[_0xd9ff('0x1f')](_0x3792d9[_0xd9ff('0x2d')]['limit']);_0x45fb63[_0xd9ff('0x1e')]=qs['offset'](_0x3792d9[_0xd9ff('0x2d')]['offset']);}_0x45fb63[_0xd9ff('0x34')]=qs['sort'](_0x3792d9[_0xd9ff('0x2d')][_0xd9ff('0x35')]);_0x45fb63[_0xd9ff('0x36')]=qs['filters'](_['pick'](_0x3792d9['query'],_0x263d3a[_0xd9ff('0x37')]),_0x420ffa);if(_0x3792d9[_0xd9ff('0x2d')][_0xd9ff('0x38')]){_0x45fb63[_0xd9ff('0x36')]=_[_0xd9ff('0x39')](_0x45fb63[_0xd9ff('0x36')],{'$or':_['map'](_0x420ffa,function(_0x4c00c2){if(_0x4c00c2['type']!==_0xd9ff('0x3a')){var _0x252edc={};_0x252edc[_0x4c00c2[_0xd9ff('0x26')]]={'$like':'%'+_0x3792d9[_0xd9ff('0x2d')]['filter']+'%'};return _0x252edc;}})});}_0x45fb63=_[_0xd9ff('0x39')]({},_0x45fb63,_0x3792d9['options']);var _0x3cff52={'where':_0x45fb63[_0xd9ff('0x36')]};return db[_0xd9ff('0x29')][_0xd9ff('0x21')](_0x3cff52)['then'](function(_0x1e34da){_0xe516e2[_0xd9ff('0x21')]=_0x1e34da;if(_0x3792d9['query'][_0xd9ff('0x3b')]){_0x45fb63[_0xd9ff('0x3c')]=[{'all':!![]}];}return db[_0xd9ff('0x29')][_0xd9ff('0x3d')](_0x45fb63);})[_0xd9ff('0x24')](function(_0x1cc848){_0xe516e2['rows']=_0x1cc848;return _0xe516e2;})[_0xd9ff('0x24')](respondWithFilteredResult(_0x44b5a7,_0x45fb63))[_0xd9ff('0x3e')](handleError(_0x44b5a7,null));};exports[_0xd9ff('0x3f')]=function(_0x39fbbb,_0x472724){var _0x52aab8={'raw':![],'where':{'id':_0x39fbbb[_0xd9ff('0x40')]['id']}},_0x3178cd={};_0x3178cd[_0xd9ff('0x2c')]=_['keys'](db['ZendeskAccount'][_0xd9ff('0x41')]);_0x3178cd[_0xd9ff('0x2d')]=_[_0xd9ff('0x2e')](_0x39fbbb[_0xd9ff('0x2d')]);_0x3178cd[_0xd9ff('0x37')]=_[_0xd9ff('0x2f')](_0x3178cd['model'],_0x3178cd[_0xd9ff('0x2d')]);_0x52aab8[_0xd9ff('0x30')]=_['intersection'](_0x3178cd[_0xd9ff('0x2c')],qs[_0xd9ff('0x31')](_0x39fbbb[_0xd9ff('0x2d')][_0xd9ff('0x31')]));_0x52aab8[_0xd9ff('0x30')]=_0x52aab8['attributes']['length']?_0x52aab8['attributes']:_0x3178cd[_0xd9ff('0x2c')];if(_0x39fbbb['query'][_0xd9ff('0x3b')]){_0x52aab8[_0xd9ff('0x3c')]=[{'all':!![]}];}_0x52aab8=_[_0xd9ff('0x39')]({},_0x52aab8,_0x39fbbb['options']);return db[_0xd9ff('0x29')][_0xd9ff('0x42')](_0x52aab8)['then'](handleEntityNotFound(_0x472724,null))[_0xd9ff('0x24')](respondWithResult(_0x472724,null))[_0xd9ff('0x3e')](handleError(_0x472724,null));};exports[_0xd9ff('0x43')]=function(_0x316854,_0x559101){return db[_0xd9ff('0x29')]['create'](_0x316854[_0xd9ff('0x44')],{})['then'](respondWithResult(_0x559101,0xc9))[_0xd9ff('0x3e')](handleError(_0x559101,null));};exports[_0xd9ff('0x23')]=function(_0x2bf37a,_0x1760c3){if(_0x2bf37a[_0xd9ff('0x44')]['id']){delete _0x2bf37a['body']['id'];}return db[_0xd9ff('0x29')][_0xd9ff('0x42')]({'where':{'id':_0x2bf37a[_0xd9ff('0x40')]['id']}})[_0xd9ff('0x24')](handleEntityNotFound(_0x1760c3,null))['then'](saveUpdates(_0x2bf37a['body'],null))['then'](respondWithResult(_0x1760c3,null))[_0xd9ff('0x3e')](handleError(_0x1760c3,null));};exports[_0xd9ff('0x45')]=function(_0x29c6bd,_0x572618){return db[_0xd9ff('0x29')][_0xd9ff('0x42')]({'where':{'id':_0x29c6bd[_0xd9ff('0x40')]['id']}})[_0xd9ff('0x24')](handleEntityNotFound(_0x572618,null))[_0xd9ff('0x24')](removeEntity(_0x572618,null))[_0xd9ff('0x3e')](handleError(_0x572618,null));};exports[_0xd9ff('0x46')]=function(_0x1e1364,_0x1ad160,_0x10d9d0){var _0x5dcb5={};var _0x3d6143={};var _0x2533d7;var _0x487b07;return db[_0xd9ff('0x29')]['findOne']({'where':{'id':_0x1e1364[_0xd9ff('0x40')]['id']}})['then'](handleEntityNotFound(_0x1ad160,null))[_0xd9ff('0x24')](function(_0x49623d){if(_0x49623d){_0x2533d7=_0x49623d;_0x3d6143[_0xd9ff('0x2c')]=_['keys'](db[_0xd9ff('0x47')]['rawAttributes']);_0x3d6143[_0xd9ff('0x2d')]=_['keys'](_0x1e1364[_0xd9ff('0x2d')]);_0x3d6143['filters']=_[_0xd9ff('0x2f')](_0x3d6143[_0xd9ff('0x2c')],_0x3d6143[_0xd9ff('0x2d')]);_0x5dcb5[_0xd9ff('0x30')]=_['intersection'](_0x3d6143[_0xd9ff('0x2c')],qs[_0xd9ff('0x31')](_0x1e1364[_0xd9ff('0x2d')]['fields']));_0x5dcb5[_0xd9ff('0x30')]=_0x5dcb5[_0xd9ff('0x30')][_0xd9ff('0x32')]?_0x5dcb5[_0xd9ff('0x30')]:_0x3d6143[_0xd9ff('0x2c')];_0x5dcb5['order']=qs[_0xd9ff('0x35')](_0x1e1364[_0xd9ff('0x2d')][_0xd9ff('0x35')]);_0x5dcb5[_0xd9ff('0x36')]=qs[_0xd9ff('0x37')](_[_0xd9ff('0x48')](_0x1e1364[_0xd9ff('0x2d')],_0x3d6143['filters']));if(_0x1e1364[_0xd9ff('0x2d')][_0xd9ff('0x38')]){_0x5dcb5['where']=_[_0xd9ff('0x39')](_0x5dcb5[_0xd9ff('0x36')],{'$or':_['map'](_0x5dcb5[_0xd9ff('0x30')],function(_0x36d5c2){var _0x25d8d1={};_0x25d8d1[_0x36d5c2]={'$like':'%'+_0x1e1364['query']['filter']+'%'};return _0x25d8d1;})});}_0x5dcb5=_[_0xd9ff('0x39')]({},_0x5dcb5,_0x1e1364['options']);return _0x2533d7[_0xd9ff('0x46')](_0x5dcb5);}})[_0xd9ff('0x24')](function(_0x31907e){if(_0x31907e){_0x487b07=_0x31907e[_0xd9ff('0x32')];if(!_0x1e1364['query']['hasOwnProperty']('nolimit')){_0x5dcb5[_0xd9ff('0x1f')]=qs[_0xd9ff('0x1f')](_0x1e1364[_0xd9ff('0x2d')][_0xd9ff('0x1f')]);_0x5dcb5[_0xd9ff('0x1e')]=qs['offset'](_0x1e1364[_0xd9ff('0x2d')]['offset']);}return _0x2533d7[_0xd9ff('0x46')](_0x5dcb5);}})[_0xd9ff('0x24')](function(_0x3f92c3){if(_0x3f92c3){return _0x3f92c3?{'count':_0x487b07,'rows':_0x3f92c3}:null;}})[_0xd9ff('0x24')](respondWithResult(_0x1ad160,null))[_0xd9ff('0x3e')](handleError(_0x1ad160,null));};exports[_0xd9ff('0x49')]=function(_0xed12df,_0xfcafbe,_0x5d633b){if(_0xed12df[_0xd9ff('0x44')]['id']){delete _0xed12df[_0xd9ff('0x44')]['id'];}return db['ZendeskAccount']['findOne']({'where':{'id':_0xed12df[_0xd9ff('0x40')]['id']}})['then'](handleEntityNotFound(_0xfcafbe,null))[_0xd9ff('0x24')](function(_0x34fca4){if(_0x34fca4){_0xed12df['body'][_0xd9ff('0x4a')]=_0x34fca4['id'];_0xed12df[_0xd9ff('0x44')][_0xd9ff('0x4b')]=integrations[_0xd9ff('0x4c')](_0xed12df[_0xd9ff('0x44')]['channel'],_0xed12df[_0xd9ff('0x44')]['type']);_0xed12df['body'][_0xd9ff('0x4d')]=integrations[_0xd9ff('0x4e')](_0xed12df[_0xd9ff('0x44')][_0xd9ff('0x4f')],_0xed12df['body'][_0xd9ff('0x2a')]);return db[_0xd9ff('0x47')][_0xd9ff('0x43')](_0xed12df[_0xd9ff('0x44')],{'include':[{'model':db[_0xd9ff('0x50')],'as':_0xd9ff('0x4b')},{'model':db[_0xd9ff('0x50')],'as':_0xd9ff('0x4d')}]});}return null;})['then'](respondWithResult(_0xfcafbe,null))['catch'](handleError(_0xfcafbe,null));};exports['getFields']=function(_0x275fb9,_0x31db27,_0x514d59){var _0x196670='';return db[_0xd9ff('0x29')][_0xd9ff('0x51')]({'where':{'id':_0x275fb9[_0xd9ff('0x40')]['id']},'attributes':['id',_0xd9ff('0x52'),_0xd9ff('0x53'),_0xd9ff('0x54'),_0xd9ff('0x55'),'remoteUri']})[_0xd9ff('0x24')](handleEntityNotFound(_0x31db27,null))[_0xd9ff('0x24')](function(_0x228413){if(_0x228413){_0x196670=_0x228413['remoteUri'];var _0x14e936=_0x196670['slice'](-0x1);if(_0x14e936==='/'){_0x196670=_0x196670[_0xd9ff('0x56')](0x0,_0x196670[_0xd9ff('0x57')](_0x14e936));}var _0x25ee82={'method':'GET','uri':util[_0xd9ff('0x58')](_0xd9ff('0x59'),_0x196670,_0xd9ff('0x5a')),'json':!![]};switch(_0x228413[_0xd9ff('0x55')]){case'password':_0x25ee82[_0xd9ff('0x5b')]={'Authorization':util[_0xd9ff('0x58')](_0xd9ff('0x5c'),new Buffer(util['format'](_0xd9ff('0x5d'),_0x228413[_0xd9ff('0x52')],_0x228413[_0xd9ff('0x53')]))['toString'](_0xd9ff('0x5e')))};break;case _0xd9ff('0x54'):_0x25ee82[_0xd9ff('0x5b')]={'Authorization':util[_0xd9ff('0x58')](_0xd9ff('0x5c'),new Buffer(util['format'](_0xd9ff('0x5f'),_0x228413[_0xd9ff('0x52')],_0x228413['token']))[_0xd9ff('0x60')](_0xd9ff('0x5e')))};break;default:throw new db[(_0xd9ff('0x61'))]['ValidationError'](_0xd9ff('0x62'));}return rp(_0x25ee82);}})['then'](function(_0x1e46fc){if(_0x1e46fc){var _0x478e0d=[_0xd9ff('0x63'),_0xd9ff('0x64'),_0xd9ff('0x65'),_0xd9ff('0x66')];_[_0xd9ff('0x67')](_0x1e46fc[_0xd9ff('0x5a')],function(_0xda0003){return _0x478e0d[_0xd9ff('0x68')](_0xda0003[_0xd9ff('0x2a')]);});return{'count':_0x1e46fc[_0xd9ff('0x5a')]['length'],'rows':_[_0xd9ff('0x28')](_0x1e46fc[_0xd9ff('0x5a')],function(_0x1f6cb9){return{'id':_0x1f6cb9['id'],'name':_0x1f6cb9[_0xd9ff('0x69')]>0x7?_0x1f6cb9[_0xd9ff('0x6a')]:_0x1f6cb9[_0xd9ff('0x2a')],'custom':_0x1f6cb9['position']>0x7?!![]:![],'options':_0x1f6cb9['system_field_options']?_0x1f6cb9[_0xd9ff('0x6b')]:_0x1f6cb9[_0xd9ff('0x6c')]?_0x1f6cb9[_0xd9ff('0x6c')]:[]};})};}})[_0xd9ff('0x24')](respondWithResult(_0x31db27,null))[_0xd9ff('0x3e')](function(_0x183199){var _0x5b234c=_0x275fb9[_0xd9ff('0x2d')][_0xd9ff('0x6d')]?0x1f4:_0x183199[_0xd9ff('0x6e')]||0x1f4;logger[_0xd9ff('0x6f')](_0xd9ff('0x70'),_0xd9ff('0x71'),_0x5b234c,JSON['stringify'](_0x183199));delete _0x183199[_0xd9ff('0x26')];if(_0x5b234c===0x191){_0x5b234c=0x190;}_0x31db27[_0xd9ff('0x1b')](_0x5b234c)[_0xd9ff('0x72')](_0x275fb9[_0xd9ff('0x2d')][_0xd9ff('0x6d')]?{'message':_0xd9ff('0x73'),'statusCode':_0x183199[_0xd9ff('0x6e')]}:_0x183199);});};
\ No newline at end of file
index d82439a..70f223a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x62b8=['request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','define','int_zendesk_accounts','lodash','../../config/logger','moment','bluebird'];(function(_0x551333,_0x4357a4){var _0xf3965=function(_0x338bba){while(--_0x338bba){_0x551333['push'](_0x551333['shift']());}};_0xf3965(++_0x4357a4);}(_0x62b8,0xf8));var _0x862b=function(_0x1d2bbb,_0x202267){_0x1d2bbb=_0x1d2bbb-0x0;var _0x38082b=_0x62b8[_0x1d2bbb];return _0x38082b;};'use strict';var _=require(_0x862b('0x0'));var util=require('util');var logger=require(_0x862b('0x1'))('api');var moment=require(_0x862b('0x2'));var BPromise=require(_0x862b('0x3'));var rp=require(_0x862b('0x4'));var fs=require('fs');var path=require(_0x862b('0x5'));var rimraf=require(_0x862b('0x6'));var config=require(_0x862b('0x7'));var attributes=require(_0x862b('0x8'));var integrations=require(_0x862b('0x9'));module['exports']=function(_0x2f4b3b,_0x1226fc){return _0x2f4b3b[_0x862b('0xa')]('ZendeskAccount',attributes,{'tableName':_0x862b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9d8c=['../../components/integrations/configuration','exports','define','int_zendesk_accounts','../../config/logger','api','bluebird','path','./intZendeskAccount.attributes'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x9d8c,0x82));var _0xc9d8=function(_0x3f024b,_0x2512a1){_0x3f024b=_0x3f024b-0x0;var _0x4e1eff=_0x9d8c[_0x3f024b];return _0x4e1eff;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc9d8('0x0'))(_0xc9d8('0x1'));var moment=require('moment');var BPromise=require(_0xc9d8('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc9d8('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc9d8('0x4'));var integrations=require(_0xc9d8('0x5'));module[_0xc9d8('0x6')]=function(_0x511b07,_0x1d8cd8){return _0x511b07[_0xc9d8('0x7')]('ZendeskAccount',attributes,{'tableName':_0xc9d8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c477e04..ec9f69b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd23d=['result','GetZendeskAccount','findAll','options','raw','where','attributes','include','model','map','stringify','ShowZendeskAccount','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','message','info'];(function(_0xe07747,_0x34d537){var _0x2820d8=function(_0x23c80b){while(--_0x23c80b){_0xe07747['push'](_0xe07747['shift']());}};_0x2820d8(++_0x34d537);}(_0xd23d,0xed));var _0xdd23=function(_0x1e6b59,_0x5eca5d){_0x1e6b59=_0x1e6b59-0x0;var _0x40d7c5=_0xd23d[_0x1e6b59];return _0x40d7c5;};'use strict';var _=require('lodash');var util=require(_0xdd23('0x0'));var moment=require(_0xdd23('0x1'));var BPromise=require(_0xdd23('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdd23('0x3'));var db=require(_0xdd23('0x4'))['db'];var utils=require(_0xdd23('0x5'));var logger=require(_0xdd23('0x6'))(_0xdd23('0x7'));var config=require(_0xdd23('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xdd23('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5941e8,_0x10c9bb,_0x3aedc1){return new BPromise(function(_0x1622ec,_0x565143){return client[_0xdd23('0xa')](_0x5941e8,_0x3aedc1)[_0xdd23('0xb')](function(_0x3a5ced){logger['info'](_0xdd23('0xc'),_0x10c9bb,_0xdd23('0xd'));logger[_0xdd23('0xe')](_0xdd23('0xf'),_0x10c9bb,_0xdd23('0xd'),JSON['stringify'](_0x3a5ced));if(_0x3a5ced['error']){if(_0x3a5ced[_0xdd23('0x10')]['code']===0x1f4){logger['error'](_0xdd23('0xc'),_0x10c9bb,_0x3a5ced[_0xdd23('0x10')]['message']);return _0x565143(_0x3a5ced[_0xdd23('0x10')]['message']);}logger[_0xdd23('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x10c9bb,_0x3a5ced[_0xdd23('0x10')][_0xdd23('0x11')]);return _0x1622ec(_0x3a5ced[_0xdd23('0x10')]['message']);}else{logger[_0xdd23('0x12')](_0xdd23('0xc'),_0x10c9bb,_0xdd23('0xd'));_0x1622ec(_0x3a5ced[_0xdd23('0x13')][_0xdd23('0x11')]);}})['catch'](function(_0x29d1a9){logger['error'](_0xdd23('0xc'),_0x10c9bb,_0x29d1a9);_0x565143(_0x29d1a9);});});}exports[_0xdd23('0x14')]=function(_0x486d7a){var _0x3ffc95=this;return new Promise(function(_0x784853,_0x493473){return db['ZendeskAccount'][_0xdd23('0x15')]({'raw':_0x486d7a[_0xdd23('0x16')]?_0x486d7a[_0xdd23('0x16')][_0xdd23('0x17')]===undefined?!![]:![]:!![],'where':_0x486d7a['options']?_0x486d7a[_0xdd23('0x16')][_0xdd23('0x18')]||null:null,'attributes':_0x486d7a[_0xdd23('0x16')]?_0x486d7a['options'][_0xdd23('0x19')]||null:null,'limit':_0x486d7a[_0xdd23('0x16')]?_0x486d7a[_0xdd23('0x16')]['limit']||null:null,'include':_0x486d7a['options']?_0x486d7a[_0xdd23('0x16')]['include']?_['map'](_0x486d7a[_0xdd23('0x16')][_0xdd23('0x1a')],function(_0x3b6164){return{'model':db[_0x3b6164[_0xdd23('0x1b')]],'as':_0x3b6164['as'],'attributes':_0x3b6164[_0xdd23('0x19')],'include':_0x3b6164['include']?_[_0xdd23('0x1c')](_0x3b6164[_0xdd23('0x1a')],function(_0x1d79a3){return{'model':db[_0x1d79a3[_0xdd23('0x1b')]],'as':_0x1d79a3['as'],'attributes':_0x1d79a3[_0xdd23('0x19')],'include':_0x1d79a3[_0xdd23('0x1a')]?_[_0xdd23('0x1c')](_0x1d79a3[_0xdd23('0x1a')],function(_0x5e641a){return{'model':db[_0x5e641a[_0xdd23('0x1b')]],'as':_0x5e641a['as'],'attributes':_0x5e641a['attributes']};}):[]};}):[]};}):[]:[]})[_0xdd23('0xb')](function(_0x259a6f){logger[_0xdd23('0x12')]('GetZendeskAccount',_0x486d7a);logger[_0xdd23('0xe')](_0xdd23('0x14'),_0x486d7a,JSON[_0xdd23('0x1d')](_0x259a6f));_0x784853(_0x259a6f);})['catch'](function(_0x461a1a){logger[_0xdd23('0x10')](_0xdd23('0x14'),_0x461a1a['message'],_0x486d7a);_0x493473(_0x3ffc95['error'](0x1f4,_0x461a1a[_0xdd23('0x11')]));});});};exports[_0xdd23('0x1e')]=function(_0xbb73cf){var _0x2afae2=this;return new Promise(function(_0xe4a2af,_0x33f90b){return db['ZendeskAccount']['find']({'raw':_0xbb73cf[_0xdd23('0x16')]?_0xbb73cf['options'][_0xdd23('0x17')]===undefined?!![]:![]:!![],'where':_0xbb73cf[_0xdd23('0x16')]?_0xbb73cf[_0xdd23('0x16')][_0xdd23('0x18')]||null:null,'attributes':_0xbb73cf['options']?_0xbb73cf['options']['attributes']||null:null,'include':_0xbb73cf[_0xdd23('0x16')]?_0xbb73cf['options']['include']?_[_0xdd23('0x1c')](_0xbb73cf[_0xdd23('0x16')]['include'],function(_0x4b7a63){return{'model':db[_0x4b7a63[_0xdd23('0x1b')]],'as':_0x4b7a63['as'],'attributes':_0x4b7a63['attributes'],'include':_0x4b7a63['include']?_[_0xdd23('0x1c')](_0x4b7a63['include'],function(_0x32680d){return{'model':db[_0x32680d[_0xdd23('0x1b')]],'as':_0x32680d['as'],'attributes':_0x32680d[_0xdd23('0x19')],'include':_0x32680d[_0xdd23('0x1a')]?_[_0xdd23('0x1c')](_0x32680d['include'],function(_0x40d21d){return{'model':db[_0x40d21d[_0xdd23('0x1b')]],'as':_0x40d21d['as'],'attributes':_0x40d21d[_0xdd23('0x19')]};}):[]};}):[]};}):[]:[]})[_0xdd23('0xb')](function(_0x25467e){logger[_0xdd23('0x12')]('ShowZendeskAccount',_0xbb73cf);logger[_0xdd23('0xe')](_0xdd23('0x1e'),_0xbb73cf,JSON['stringify'](_0x25467e));_0xe4a2af(_0x25467e);})[_0xdd23('0x1f')](function(_0x271817){logger[_0xdd23('0x10')](_0xdd23('0x1e'),_0x271817['message'],_0xbb73cf);_0x33f90b(_0x2afae2[_0xdd23('0x10')](0x1f4,_0x271817['message']));});});};
\ No newline at end of file
+var _0xf02c=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','ZendeskAccount','findAll','options','attributes','limit','include','map','model','GetZendeskAccount','stringify','ShowZendeskAccount','find','raw','where','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x4a982f,_0x15c9a7){var _0x65fd5f=function(_0x11577e){while(--_0x11577e){_0x4a982f['push'](_0x4a982f['shift']());}};_0x65fd5f(++_0x15c9a7);}(_0xf02c,0x92));var _0xcf02=function(_0x1427d3,_0x5f4cef){_0x1427d3=_0x1427d3-0x0;var _0x20ee8f=_0xf02c[_0x1427d3];return _0x20ee8f;};'use strict';var _=require(_0xcf02('0x0'));var util=require(_0xcf02('0x1'));var moment=require(_0xcf02('0x2'));var BPromise=require(_0xcf02('0x3'));var rs=require(_0xcf02('0x4'));var fs=require('fs');var Redis=require(_0xcf02('0x5'));var db=require(_0xcf02('0x6'))['db'];var utils=require(_0xcf02('0x7'));var logger=require(_0xcf02('0x8'))(_0xcf02('0x9'));var config=require(_0xcf02('0xa'));var jayson=require(_0xcf02('0xb'));var client=jayson[_0xcf02('0xc')][_0xcf02('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3569a1,_0x49ad8e,_0x45745e){return new BPromise(function(_0x56c3db,_0x5a255f){return client['request'](_0x3569a1,_0x45745e)[_0xcf02('0xe')](function(_0x2f1633){logger[_0xcf02('0xf')](_0xcf02('0x10'),_0x49ad8e,'request\x20sent');logger[_0xcf02('0x11')](_0xcf02('0x12'),_0x49ad8e,_0xcf02('0x13'),JSON['stringify'](_0x2f1633));if(_0x2f1633['error']){if(_0x2f1633[_0xcf02('0x14')][_0xcf02('0x15')]===0x1f4){logger[_0xcf02('0x14')](_0xcf02('0x10'),_0x49ad8e,_0x2f1633[_0xcf02('0x14')]['message']);return _0x5a255f(_0x2f1633[_0xcf02('0x14')][_0xcf02('0x16')]);}logger[_0xcf02('0x14')](_0xcf02('0x10'),_0x49ad8e,_0x2f1633[_0xcf02('0x14')][_0xcf02('0x16')]);return _0x56c3db(_0x2f1633[_0xcf02('0x14')]['message']);}else{logger[_0xcf02('0xf')](_0xcf02('0x10'),_0x49ad8e,_0xcf02('0x13'));_0x56c3db(_0x2f1633['result'][_0xcf02('0x16')]);}})[_0xcf02('0x17')](function(_0x59f337){logger[_0xcf02('0x14')]('ZendeskAccount,\x20%s,\x20%s',_0x49ad8e,_0x59f337);_0x5a255f(_0x59f337);});});}exports['GetZendeskAccount']=function(_0x4f3829){var _0x2860fd=this;return new Promise(function(_0x53a97e,_0x29615d){return db[_0xcf02('0x18')][_0xcf02('0x19')]({'raw':_0x4f3829[_0xcf02('0x1a')]?_0x4f3829['options']['raw']===undefined?!![]:![]:!![],'where':_0x4f3829[_0xcf02('0x1a')]?_0x4f3829[_0xcf02('0x1a')]['where']||null:null,'attributes':_0x4f3829[_0xcf02('0x1a')]?_0x4f3829[_0xcf02('0x1a')][_0xcf02('0x1b')]||null:null,'limit':_0x4f3829[_0xcf02('0x1a')]?_0x4f3829['options'][_0xcf02('0x1c')]||null:null,'include':_0x4f3829[_0xcf02('0x1a')]?_0x4f3829[_0xcf02('0x1a')][_0xcf02('0x1d')]?_[_0xcf02('0x1e')](_0x4f3829[_0xcf02('0x1a')][_0xcf02('0x1d')],function(_0x2926b9){return{'model':db[_0x2926b9['model']],'as':_0x2926b9['as'],'attributes':_0x2926b9['attributes'],'include':_0x2926b9['include']?_[_0xcf02('0x1e')](_0x2926b9[_0xcf02('0x1d')],function(_0x2fd260){return{'model':db[_0x2fd260[_0xcf02('0x1f')]],'as':_0x2fd260['as'],'attributes':_0x2fd260[_0xcf02('0x1b')],'include':_0x2fd260[_0xcf02('0x1d')]?_[_0xcf02('0x1e')](_0x2fd260[_0xcf02('0x1d')],function(_0x4ee2b9){return{'model':db[_0x4ee2b9[_0xcf02('0x1f')]],'as':_0x4ee2b9['as'],'attributes':_0x4ee2b9[_0xcf02('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x54716d){logger[_0xcf02('0xf')](_0xcf02('0x20'),_0x4f3829);logger[_0xcf02('0x11')](_0xcf02('0x20'),_0x4f3829,JSON[_0xcf02('0x21')](_0x54716d));_0x53a97e(_0x54716d);})[_0xcf02('0x17')](function(_0x2b8bc6){logger[_0xcf02('0x14')](_0xcf02('0x20'),_0x2b8bc6['message'],_0x4f3829);_0x29615d(_0x2860fd[_0xcf02('0x14')](0x1f4,_0x2b8bc6[_0xcf02('0x16')]));});});};exports[_0xcf02('0x22')]=function(_0x5af4c3){var _0x2bef8e=this;return new Promise(function(_0x320d89,_0x47b633){return db[_0xcf02('0x18')][_0xcf02('0x23')]({'raw':_0x5af4c3['options']?_0x5af4c3[_0xcf02('0x1a')][_0xcf02('0x24')]===undefined?!![]:![]:!![],'where':_0x5af4c3[_0xcf02('0x1a')]?_0x5af4c3[_0xcf02('0x1a')][_0xcf02('0x25')]||null:null,'attributes':_0x5af4c3['options']?_0x5af4c3[_0xcf02('0x1a')][_0xcf02('0x1b')]||null:null,'include':_0x5af4c3[_0xcf02('0x1a')]?_0x5af4c3[_0xcf02('0x1a')][_0xcf02('0x1d')]?_['map'](_0x5af4c3['options'][_0xcf02('0x1d')],function(_0x8c5158){return{'model':db[_0x8c5158[_0xcf02('0x1f')]],'as':_0x8c5158['as'],'attributes':_0x8c5158['attributes'],'include':_0x8c5158['include']?_[_0xcf02('0x1e')](_0x8c5158[_0xcf02('0x1d')],function(_0x259577){return{'model':db[_0x259577[_0xcf02('0x1f')]],'as':_0x259577['as'],'attributes':_0x259577[_0xcf02('0x1b')],'include':_0x259577['include']?_[_0xcf02('0x1e')](_0x259577[_0xcf02('0x1d')],function(_0x11ead1){return{'model':db[_0x11ead1['model']],'as':_0x11ead1['as'],'attributes':_0x11ead1[_0xcf02('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xcf02('0xe')](function(_0xaaab0a){logger[_0xcf02('0xf')](_0xcf02('0x22'),_0x5af4c3);logger['debug'](_0xcf02('0x22'),_0x5af4c3,JSON[_0xcf02('0x21')](_0xaaab0a));_0x320d89(_0xaaab0a);})['catch'](function(_0x3bb89a){logger[_0xcf02('0x14')](_0xcf02('0x22'),_0x3bb89a[_0xcf02('0x16')],_0x5af4c3);_0x47b633(_0x2bef8e['error'](0x1f4,_0x3bb89a[_0xcf02('0x16')]));});});};
\ No newline at end of file
index a34b167..aee3d91 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa571=['util','path','connect-timeout','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','put','update','exports','multer'];(function(_0x2f7e76,_0x1e757b){var _0x4d3c0c=function(_0x19056c){while(--_0x19056c){_0x2f7e76['push'](_0x2f7e76['shift']());}};_0x4d3c0c(++_0x1e757b);}(_0xa571,0x107));var _0x1a57=function(_0x2d8f9f,_0x11263b){_0x2d8f9f=_0x2d8f9f-0x0;var _0x598c52=_0xa571[_0x2d8f9f];return _0x598c52;};'use strict';var multer=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var path=require(_0x1a57('0x2'));var timeout=require(_0x1a57('0x3'));var express=require('express');var router=express[_0x1a57('0x4')]();var fs_extra=require(_0x1a57('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1a57('0x6'));var controller=require('./intZendeskConfiguration.controller');router[_0x1a57('0x7')]('/',auth[_0x1a57('0x8')](),controller[_0x1a57('0x9')]);router[_0x1a57('0x7')](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller['show']);router[_0x1a57('0x7')](_0x1a57('0xb'),auth[_0x1a57('0x8')](),controller['getFields']);router[_0x1a57('0x7')](_0x1a57('0xc'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xd')]);router[_0x1a57('0x7')](_0x1a57('0xe'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xf')]);router['get']('/:id/tags',auth[_0x1a57('0x8')](),controller[_0x1a57('0x10')]);router[_0x1a57('0x11')]('/',auth['isAuthenticated'](),controller[_0x1a57('0x12')]);router[_0x1a57('0x11')]('/:id/tags',auth[_0x1a57('0x8')](),controller['setTags']);router[_0x1a57('0x13')](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller[_0x1a57('0x14')]);router['delete'](_0x1a57('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x1a57('0x15')]=router;
\ No newline at end of file
+var _0x750a=['getTags','post','setTags','put','update','delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','getSubjects','/:id/tags'];(function(_0x3fda20,_0x3be736){var _0x2bf91d=function(_0x1d3dea){while(--_0x1d3dea){_0x3fda20['push'](_0x3fda20['shift']());}};_0x2bf91d(++_0x3be736);}(_0x750a,0x140));var _0xa750=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x750a[_0x3ff085];return _0x2b68c3;};'use strict';var multer=require('multer');var util=require(_0xa750('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa750('0x1'));var router=express[_0xa750('0x2')]();var fs_extra=require(_0xa750('0x3'));var auth=require(_0xa750('0x4'));var interaction=require(_0xa750('0x5'));var config=require(_0xa750('0x6'));var controller=require(_0xa750('0x7'));router[_0xa750('0x8')]('/',auth[_0xa750('0x9')](),controller[_0xa750('0xa')]);router[_0xa750('0x8')](_0xa750('0xb'),auth[_0xa750('0x9')](),controller['show']);router['get'](_0xa750('0xc'),auth['isAuthenticated'](),controller[_0xa750('0xd')]);router[_0xa750('0x8')]('/:id/subjects',auth[_0xa750('0x9')](),controller[_0xa750('0xe')]);router['get']('/:id/descriptions',auth[_0xa750('0x9')](),controller['getDescriptions']);router[_0xa750('0x8')](_0xa750('0xf'),auth['isAuthenticated'](),controller[_0xa750('0x10')]);router[_0xa750('0x11')]('/',auth[_0xa750('0x9')](),controller['create']);router[_0xa750('0x11')](_0xa750('0xf'),auth[_0xa750('0x9')](),controller[_0xa750('0x12')]);router[_0xa750('0x13')](_0xa750('0xb'),auth['isAuthenticated'](),controller[_0xa750('0x14')]);router[_0xa750('0x15')](_0xa750('0xb'),auth['isAuthenticated'](),controller[_0xa750('0x16')]);module[_0xa750('0x17')]=router;
\ No newline at end of file
index 1df0e08..91658ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90d7=['STRING','sequelize'];(function(_0x5c71a3,_0x2bf4cf){var _0x59d1aa=function(_0x2c0073){while(--_0x2c0073){_0x5c71a3['push'](_0x5c71a3['shift']());}};_0x59d1aa(++_0x2bf4cf);}(_0x90d7,0x1d1));var _0x790d=function(_0x13f187,_0x7c2caf){_0x13f187=_0x13f187-0x0;var _0x54c177=_0x90d7[_0x13f187];return _0x54c177;};'use strict';var Sequelize=require(_0x790d('0x0'));module['exports']={'name':{'type':Sequelize[_0x790d('0x1')]},'description':{'type':Sequelize[_0x790d('0x1')]}};
\ No newline at end of file
+var _0xb87b=['STRING','sequelize'];(function(_0x33bc64,_0x4d1e92){var _0x3fdd34=function(_0x4b40a4){while(--_0x4b40a4){_0x33bc64['push'](_0x33bc64['shift']());}};_0x3fdd34(++_0x4d1e92);}(_0xb87b,0x1ed));var _0xbb87=function(_0xb34d5b,_0x284ff4){_0xb34d5b=_0xb34d5b-0x0;var _0x5d0810=_0xb87b[_0xb34d5b];return _0x5d0810;};'use strict';var Sequelize=require(_0xbb87('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb87('0x1')]},'description':{'type':Sequelize[_0xbb87('0x1')]}};
\ No newline at end of file
index 3a52bfc..79fc39c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf274=['include','findAll','rows','show','params','includeAll','find','catch','create','body','update','destroy','getFields','findOne','ZendeskField','order','nolimit','getSubjects','hasOwnProperty','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','sendStatus','error','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','sort','where','pick','filter','VIRTUAL','merge','options'];(function(_0x55e33c,_0x5df279){var _0x5b3286=function(_0x12cf2d){while(--_0x12cf2d){_0x55e33c['push'](_0x55e33c['shift']());}};_0x5b3286(++_0x5df279);}(_0xf274,0xc6));var _0x4f27=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0xf274[_0x17406a];return _0x1501ff;};'use strict';var emlformat=require(_0x4f27('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4f27('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4f27('0x2'));var Mustache=require(_0x4f27('0x3'));var util=require(_0x4f27('0x4'));var path=require(_0x4f27('0x5'));var sox=require(_0x4f27('0x6'));var csv=require(_0x4f27('0x7'));var ejs=require(_0x4f27('0x8'));var fs=require('fs');var fs_extra=require(_0x4f27('0x9'));var _=require(_0x4f27('0xa'));var squel=require('squel');var crypto=require(_0x4f27('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4f27('0xc'));var toCsv=require(_0x4f27('0x7'));var querystring=require(_0x4f27('0xd'));var Papa=require(_0x4f27('0xe'));var Redis=require(_0x4f27('0xf'));var authService=require(_0x4f27('0x10'));var qs=require(_0x4f27('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f27('0x12'));var logger=require(_0x4f27('0x13'))(_0x4f27('0x14'));var utils=require(_0x4f27('0x15'));var config=require(_0x4f27('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x4f27('0x17'))['db'];function respondWithStatusCode(_0x450f4b,_0x175e3d){_0x175e3d=_0x175e3d||0xcc;return function(_0x1cb60d){if(_0x1cb60d){return _0x450f4b['sendStatus'](_0x175e3d);}return _0x450f4b[_0x4f27('0x18')](_0x175e3d)[_0x4f27('0x19')]();};}function respondWithResult(_0x1dee47,_0x53d900){_0x53d900=_0x53d900||0xc8;return function(_0x986740){if(_0x986740){return _0x1dee47['status'](_0x53d900)['json'](_0x986740);}};}function respondWithFilteredResult(_0x156a66,_0xa76390){return function(_0x5f53c1){if(_0x5f53c1){var _0x3b8a4c=typeof _0xa76390[_0x4f27('0x1a')]===_0x4f27('0x1b')&&typeof _0xa76390[_0x4f27('0x1c')]===_0x4f27('0x1b');var _0x419119=_0x5f53c1[_0x4f27('0x1d')];var _0x1ac539=_0x3b8a4c?0x0:_0xa76390['offset'];var _0x5712b1=_0x3b8a4c?_0x5f53c1[_0x4f27('0x1d')]:_0xa76390['offset']+_0xa76390[_0x4f27('0x1c')];var _0x47339e;if(_0x5712b1>=_0x419119){_0x5712b1=_0x419119;_0x47339e=0xc8;}else{_0x47339e=0xce;}_0x156a66[_0x4f27('0x18')](_0x47339e);return _0x156a66[_0x4f27('0x1e')](_0x4f27('0x1f'),_0x1ac539+'-'+_0x5712b1+'/'+_0x419119)[_0x4f27('0x20')](_0x5f53c1);}return null;};}function patchUpdates(_0x337505){return function(_0x30dd52){try{jsonpatch[_0x4f27('0x21')](_0x30dd52,_0x337505,!![]);}catch(_0x22b90a){return BPromise[_0x4f27('0x22')](_0x22b90a);}return _0x30dd52[_0x4f27('0x23')]();};}function saveUpdates(_0x59b07b,_0x2b4c98){return function(_0x296e2d){if(_0x296e2d){return _0x296e2d['update'](_0x59b07b)['then'](function(_0x1072d1){return _0x1072d1;});}return null;};}function removeEntity(_0x45f295,_0x313a6e){return function(_0x4315a4){if(_0x4315a4){return _0x4315a4['destroy']()[_0x4f27('0x24')](function(){_0x45f295[_0x4f27('0x18')](0xcc)[_0x4f27('0x19')]();});}};}function handleEntityNotFound(_0x5167e2,_0x3db009){return function(_0x7469e5){if(!_0x7469e5){_0x5167e2[_0x4f27('0x25')](0x194);}return _0x7469e5;};}function handleError(_0x10282f,_0x521438){_0x521438=_0x521438||0x1f4;return function(_0x456224){logger[_0x4f27('0x26')](_0x456224['stack']);if(_0x456224[_0x4f27('0x27')]){delete _0x456224['name'];}_0x10282f[_0x4f27('0x18')](_0x521438)[_0x4f27('0x28')](_0x456224);};}exports[_0x4f27('0x29')]=function(_0x4cf953,_0x226f1a){var _0x159b8f={},_0x31ea07={},_0x253224={'count':0x0,'rows':[]};var _0x39735f=_[_0x4f27('0x2a')](db[_0x4f27('0x2b')][_0x4f27('0x2c')],function(_0x10658d){return{'name':_0x10658d[_0x4f27('0x2d')],'type':_0x10658d[_0x4f27('0x2e')][_0x4f27('0x2f')]};});_0x31ea07['model']=_[_0x4f27('0x2a')](_0x39735f,_0x4f27('0x27'));_0x31ea07['query']=_[_0x4f27('0x30')](_0x4cf953[_0x4f27('0x31')]);_0x31ea07[_0x4f27('0x32')]=_[_0x4f27('0x33')](_0x31ea07[_0x4f27('0x34')],_0x31ea07[_0x4f27('0x31')]);_0x159b8f[_0x4f27('0x35')]=_[_0x4f27('0x33')](_0x31ea07[_0x4f27('0x34')],qs[_0x4f27('0x36')](_0x4cf953[_0x4f27('0x31')][_0x4f27('0x36')]));_0x159b8f['attributes']=_0x159b8f['attributes'][_0x4f27('0x37')]?_0x159b8f[_0x4f27('0x35')]:_0x31ea07[_0x4f27('0x34')];if(!_0x4cf953[_0x4f27('0x31')]['hasOwnProperty']('nolimit')){_0x159b8f[_0x4f27('0x1c')]=qs[_0x4f27('0x1c')](_0x4cf953[_0x4f27('0x31')][_0x4f27('0x1c')]);_0x159b8f[_0x4f27('0x1a')]=qs['offset'](_0x4cf953[_0x4f27('0x31')][_0x4f27('0x1a')]);}_0x159b8f['order']=qs[_0x4f27('0x38')](_0x4cf953[_0x4f27('0x31')][_0x4f27('0x38')]);_0x159b8f[_0x4f27('0x39')]=qs[_0x4f27('0x32')](_[_0x4f27('0x3a')](_0x4cf953[_0x4f27('0x31')],_0x31ea07[_0x4f27('0x32')]),_0x39735f);if(_0x4cf953['query'][_0x4f27('0x3b')]){_0x159b8f[_0x4f27('0x39')]=_['merge'](_0x159b8f[_0x4f27('0x39')],{'$or':_[_0x4f27('0x2a')](_0x39735f,function(_0x3ab302){if(_0x3ab302[_0x4f27('0x2e')]!==_0x4f27('0x3c')){var _0x3e5c9d={};_0x3e5c9d[_0x3ab302[_0x4f27('0x27')]]={'$like':'%'+_0x4cf953[_0x4f27('0x31')]['filter']+'%'};return _0x3e5c9d;}})});}_0x159b8f=_[_0x4f27('0x3d')]({},_0x159b8f,_0x4cf953[_0x4f27('0x3e')]);var _0x245f4b={'where':_0x159b8f['where']};return db[_0x4f27('0x2b')][_0x4f27('0x1d')](_0x245f4b)[_0x4f27('0x24')](function(_0x390c90){_0x253224[_0x4f27('0x1d')]=_0x390c90;if(_0x4cf953[_0x4f27('0x31')]['includeAll']){_0x159b8f[_0x4f27('0x3f')]=[{'all':!![]}];}return db[_0x4f27('0x2b')][_0x4f27('0x40')](_0x159b8f);})[_0x4f27('0x24')](function(_0x224395){_0x253224[_0x4f27('0x41')]=_0x224395;return _0x253224;})[_0x4f27('0x24')](respondWithFilteredResult(_0x226f1a,_0x159b8f))['catch'](handleError(_0x226f1a,null));};exports[_0x4f27('0x42')]=function(_0xb844ce,_0x29b3aa){var _0x518032={'raw':![],'where':{'id':_0xb844ce[_0x4f27('0x43')]['id']}},_0x122a08={};_0x122a08[_0x4f27('0x34')]=_[_0x4f27('0x30')](db[_0x4f27('0x2b')][_0x4f27('0x2c')]);_0x122a08[_0x4f27('0x31')]=_[_0x4f27('0x30')](_0xb844ce[_0x4f27('0x31')]);_0x122a08[_0x4f27('0x32')]=_[_0x4f27('0x33')](_0x122a08['model'],_0x122a08[_0x4f27('0x31')]);_0x518032[_0x4f27('0x35')]=_['intersection'](_0x122a08['model'],qs[_0x4f27('0x36')](_0xb844ce[_0x4f27('0x31')][_0x4f27('0x36')]));_0x518032['attributes']=_0x518032[_0x4f27('0x35')][_0x4f27('0x37')]?_0x518032['attributes']:_0x122a08[_0x4f27('0x34')];if(_0xb844ce[_0x4f27('0x31')][_0x4f27('0x44')]){_0x518032[_0x4f27('0x3f')]=[{'all':!![]}];}_0x518032=_[_0x4f27('0x3d')]({},_0x518032,_0xb844ce[_0x4f27('0x3e')]);return db[_0x4f27('0x2b')][_0x4f27('0x45')](_0x518032)[_0x4f27('0x24')](handleEntityNotFound(_0x29b3aa,null))[_0x4f27('0x24')](respondWithResult(_0x29b3aa,null))[_0x4f27('0x46')](handleError(_0x29b3aa,null));};exports[_0x4f27('0x47')]=function(_0x3fecfe,_0x3e820a){return db[_0x4f27('0x2b')]['create'](_0x3fecfe[_0x4f27('0x48')],{})[_0x4f27('0x24')](respondWithResult(_0x3e820a,0xc9))['catch'](handleError(_0x3e820a,null));};exports[_0x4f27('0x49')]=function(_0x1a10ae,_0x2295d4){if(_0x1a10ae[_0x4f27('0x48')]['id']){delete _0x1a10ae[_0x4f27('0x48')]['id'];}return db[_0x4f27('0x2b')]['find']({'where':{'id':_0x1a10ae[_0x4f27('0x43')]['id']}})['then'](handleEntityNotFound(_0x2295d4,null))[_0x4f27('0x24')](saveUpdates(_0x1a10ae['body'],null))[_0x4f27('0x24')](respondWithResult(_0x2295d4,null))[_0x4f27('0x46')](handleError(_0x2295d4,null));};exports[_0x4f27('0x4a')]=function(_0xbd4205,_0x54d838){return db['ZendeskConfiguration'][_0x4f27('0x45')]({'where':{'id':_0xbd4205[_0x4f27('0x43')]['id']}})['then'](handleEntityNotFound(_0x54d838,null))[_0x4f27('0x24')](removeEntity(_0x54d838,null))[_0x4f27('0x46')](handleError(_0x54d838,null));};exports[_0x4f27('0x4b')]=function(_0x3594c2,_0xcc544e,_0x510ca9){var _0x488e9d={};var _0x4d44fb={};var _0xb289cf;var _0x288ed3;return db[_0x4f27('0x2b')][_0x4f27('0x4c')]({'where':{'id':_0x3594c2[_0x4f27('0x43')]['id']}})[_0x4f27('0x24')](handleEntityNotFound(_0xcc544e,null))[_0x4f27('0x24')](function(_0x4e3d34){if(_0x4e3d34){_0xb289cf=_0x4e3d34;_0x4d44fb[_0x4f27('0x34')]=_['keys'](db[_0x4f27('0x4d')][_0x4f27('0x2c')]);_0x4d44fb[_0x4f27('0x31')]=_[_0x4f27('0x30')](_0x3594c2['query']);_0x4d44fb['filters']=_[_0x4f27('0x33')](_0x4d44fb['model'],_0x4d44fb[_0x4f27('0x31')]);_0x488e9d['attributes']=_[_0x4f27('0x33')](_0x4d44fb[_0x4f27('0x34')],qs[_0x4f27('0x36')](_0x3594c2[_0x4f27('0x31')][_0x4f27('0x36')]));_0x488e9d[_0x4f27('0x35')]=_0x488e9d[_0x4f27('0x35')][_0x4f27('0x37')]?_0x488e9d['attributes']:_0x4d44fb[_0x4f27('0x34')];_0x488e9d[_0x4f27('0x4e')]=qs[_0x4f27('0x38')](_0x3594c2[_0x4f27('0x31')][_0x4f27('0x38')]);_0x488e9d[_0x4f27('0x39')]=qs[_0x4f27('0x32')](_[_0x4f27('0x3a')](_0x3594c2['query'],_0x4d44fb['filters']));if(_0x3594c2[_0x4f27('0x31')][_0x4f27('0x3b')]){_0x488e9d[_0x4f27('0x39')]=_[_0x4f27('0x3d')](_0x488e9d[_0x4f27('0x39')],{'$or':_[_0x4f27('0x2a')](_0x488e9d['attributes'],function(_0x1f3161){var _0x490cb2={};_0x490cb2[_0x1f3161]={'$like':'%'+_0x3594c2[_0x4f27('0x31')][_0x4f27('0x3b')]+'%'};return _0x490cb2;})});}_0x488e9d=_[_0x4f27('0x3d')]({},_0x488e9d,_0x3594c2[_0x4f27('0x3e')]);return _0xb289cf[_0x4f27('0x4b')](_0x488e9d);}})[_0x4f27('0x24')](function(_0x2c1876){if(_0x2c1876){_0x288ed3=_0x2c1876[_0x4f27('0x37')];if(!_0x3594c2[_0x4f27('0x31')]['hasOwnProperty'](_0x4f27('0x4f'))){_0x488e9d['limit']=qs[_0x4f27('0x1c')](_0x3594c2[_0x4f27('0x31')][_0x4f27('0x1c')]);_0x488e9d['offset']=qs[_0x4f27('0x1a')](_0x3594c2[_0x4f27('0x31')]['offset']);}return _0xb289cf[_0x4f27('0x4b')](_0x488e9d);}})[_0x4f27('0x24')](function(_0x586820){if(_0x586820){return _0x586820?{'count':_0x288ed3,'rows':_0x586820}:null;}})[_0x4f27('0x24')](respondWithResult(_0xcc544e,null))[_0x4f27('0x46')](handleError(_0xcc544e,null));};exports[_0x4f27('0x50')]=function(_0x553dc4,_0x745051,_0x39b071){var _0x12c48c={};var _0x1c087a={};var _0x3dd8cd;var _0x324448;return db[_0x4f27('0x2b')]['findOne']({'where':{'id':_0x553dc4[_0x4f27('0x43')]['id']}})[_0x4f27('0x24')](handleEntityNotFound(_0x745051,null))[_0x4f27('0x24')](function(_0x3deb1d){if(_0x3deb1d){_0x3dd8cd=_0x3deb1d;_0x1c087a[_0x4f27('0x34')]=_[_0x4f27('0x30')](db[_0x4f27('0x4d')][_0x4f27('0x2c')]);_0x1c087a[_0x4f27('0x31')]=_[_0x4f27('0x30')](_0x553dc4[_0x4f27('0x31')]);_0x1c087a[_0x4f27('0x32')]=_[_0x4f27('0x33')](_0x1c087a[_0x4f27('0x34')],_0x1c087a[_0x4f27('0x31')]);_0x12c48c[_0x4f27('0x35')]=_[_0x4f27('0x33')](_0x1c087a[_0x4f27('0x34')],qs[_0x4f27('0x36')](_0x553dc4[_0x4f27('0x31')][_0x4f27('0x36')]));_0x12c48c['attributes']=_0x12c48c[_0x4f27('0x35')][_0x4f27('0x37')]?_0x12c48c[_0x4f27('0x35')]:_0x1c087a['model'];_0x12c48c[_0x4f27('0x4e')]=qs[_0x4f27('0x38')](_0x553dc4[_0x4f27('0x31')][_0x4f27('0x38')]);_0x12c48c[_0x4f27('0x39')]=qs['filters'](_['pick'](_0x553dc4[_0x4f27('0x31')],_0x1c087a[_0x4f27('0x32')]));if(_0x553dc4[_0x4f27('0x31')][_0x4f27('0x3b')]){_0x12c48c['where']=_[_0x4f27('0x3d')](_0x12c48c[_0x4f27('0x39')],{'$or':_[_0x4f27('0x2a')](_0x12c48c[_0x4f27('0x35')],function(_0x4efd4e){var _0x66db00={};_0x66db00[_0x4efd4e]={'$like':'%'+_0x553dc4[_0x4f27('0x31')]['filter']+'%'};return _0x66db00;})});}_0x12c48c=_[_0x4f27('0x3d')]({},_0x12c48c,_0x553dc4[_0x4f27('0x3e')]);return _0x3dd8cd[_0x4f27('0x50')](_0x12c48c);}})['then'](function(_0x4d0435){if(_0x4d0435){_0x324448=_0x4d0435[_0x4f27('0x37')];if(!_0x553dc4[_0x4f27('0x31')][_0x4f27('0x51')](_0x4f27('0x4f'))){_0x12c48c[_0x4f27('0x1c')]=qs[_0x4f27('0x1c')](_0x553dc4[_0x4f27('0x31')]['limit']);_0x12c48c[_0x4f27('0x1a')]=qs['offset'](_0x553dc4[_0x4f27('0x31')][_0x4f27('0x1a')]);}return _0x3dd8cd['getSubjects'](_0x12c48c);}})[_0x4f27('0x24')](function(_0x3d6c13){if(_0x3d6c13){return _0x3d6c13?{'count':_0x324448,'rows':_0x3d6c13}:null;}})[_0x4f27('0x24')](respondWithResult(_0x745051,null))[_0x4f27('0x46')](handleError(_0x745051,null));};exports['getDescriptions']=function(_0x488052,_0x7ccdc4,_0x5a2886){var _0x19a2b1={};var _0x170da1={};var _0x52f77a;var _0x5b11cc;return db[_0x4f27('0x2b')][_0x4f27('0x4c')]({'where':{'id':_0x488052['params']['id']}})['then'](handleEntityNotFound(_0x7ccdc4,null))[_0x4f27('0x24')](function(_0x2bd11a){if(_0x2bd11a){_0x52f77a=_0x2bd11a;_0x170da1[_0x4f27('0x34')]=_['keys'](db['ZendeskField'][_0x4f27('0x2c')]);_0x170da1[_0x4f27('0x31')]=_[_0x4f27('0x30')](_0x488052[_0x4f27('0x31')]);_0x170da1[_0x4f27('0x32')]=_[_0x4f27('0x33')](_0x170da1[_0x4f27('0x34')],_0x170da1[_0x4f27('0x31')]);_0x19a2b1[_0x4f27('0x35')]=_[_0x4f27('0x33')](_0x170da1['model'],qs[_0x4f27('0x36')](_0x488052[_0x4f27('0x31')][_0x4f27('0x36')]));_0x19a2b1['attributes']=_0x19a2b1[_0x4f27('0x35')][_0x4f27('0x37')]?_0x19a2b1['attributes']:_0x170da1[_0x4f27('0x34')];_0x19a2b1[_0x4f27('0x4e')]=qs['sort'](_0x488052['query']['sort']);_0x19a2b1[_0x4f27('0x39')]=qs[_0x4f27('0x32')](_[_0x4f27('0x3a')](_0x488052[_0x4f27('0x31')],_0x170da1[_0x4f27('0x32')]));if(_0x488052[_0x4f27('0x31')]['filter']){_0x19a2b1['where']=_[_0x4f27('0x3d')](_0x19a2b1['where'],{'$or':_['map'](_0x19a2b1[_0x4f27('0x35')],function(_0x3b796a){var _0x432baa={};_0x432baa[_0x3b796a]={'$like':'%'+_0x488052[_0x4f27('0x31')]['filter']+'%'};return _0x432baa;})});}_0x19a2b1=_['merge']({},_0x19a2b1,_0x488052['options']);return _0x52f77a[_0x4f27('0x52')](_0x19a2b1);}})['then'](function(_0x2a85ad){if(_0x2a85ad){_0x5b11cc=_0x2a85ad[_0x4f27('0x37')];if(!_0x488052[_0x4f27('0x31')]['hasOwnProperty'](_0x4f27('0x4f'))){_0x19a2b1[_0x4f27('0x1c')]=qs[_0x4f27('0x1c')](_0x488052[_0x4f27('0x31')][_0x4f27('0x1c')]);_0x19a2b1[_0x4f27('0x1a')]=qs['offset'](_0x488052[_0x4f27('0x31')][_0x4f27('0x1a')]);}return _0x52f77a[_0x4f27('0x52')](_0x19a2b1);}})['then'](function(_0x4bf42e){if(_0x4bf42e){return _0x4bf42e?{'count':_0x5b11cc,'rows':_0x4bf42e}:null;}})['then'](respondWithResult(_0x7ccdc4,null))[_0x4f27('0x46')](handleError(_0x7ccdc4,null));};exports[_0x4f27('0x53')]=function(_0x28e86,_0xb12621,_0x234d6f){var _0x2f40e0={};var _0x44ebbc={};var _0x45b4d0;var _0x5db940;return db[_0x4f27('0x2b')][_0x4f27('0x4c')]({'where':{'id':_0x28e86['params']['id']}})[_0x4f27('0x24')](handleEntityNotFound(_0xb12621,null))['then'](function(_0x11875d){if(_0x11875d){_0x45b4d0=_0x11875d;_0x44ebbc[_0x4f27('0x34')]=_[_0x4f27('0x30')](db[_0x4f27('0x54')][_0x4f27('0x2c')]);_0x44ebbc[_0x4f27('0x31')]=_[_0x4f27('0x30')](_0x28e86['query']);_0x44ebbc[_0x4f27('0x32')]=_['intersection'](_0x44ebbc[_0x4f27('0x34')],_0x44ebbc['query']);_0x2f40e0[_0x4f27('0x35')]=_[_0x4f27('0x33')](_0x44ebbc['model'],qs['fields'](_0x28e86[_0x4f27('0x31')][_0x4f27('0x36')]));_0x2f40e0[_0x4f27('0x35')]=_0x2f40e0[_0x4f27('0x35')][_0x4f27('0x37')]?_0x2f40e0[_0x4f27('0x35')]:_0x44ebbc[_0x4f27('0x34')];_0x2f40e0['order']=qs['sort'](_0x28e86[_0x4f27('0x31')][_0x4f27('0x38')]);_0x2f40e0[_0x4f27('0x39')]=qs[_0x4f27('0x32')](_[_0x4f27('0x3a')](_0x28e86['query'],_0x44ebbc[_0x4f27('0x32')]));if(_0x28e86[_0x4f27('0x31')][_0x4f27('0x3b')]){_0x2f40e0['where']=_[_0x4f27('0x3d')](_0x2f40e0['where'],{'$or':_['map'](_0x2f40e0[_0x4f27('0x35')],function(_0x295505){var _0x3b867f={};_0x3b867f[_0x295505]={'$like':'%'+_0x28e86['query'][_0x4f27('0x3b')]+'%'};return _0x3b867f;})});}_0x2f40e0=_[_0x4f27('0x3d')]({},_0x2f40e0,_0x28e86[_0x4f27('0x3e')]);return _0x45b4d0[_0x4f27('0x53')](_0x2f40e0);}})[_0x4f27('0x24')](function(_0x5d6da2){if(_0x5d6da2){_0x5db940=_0x5d6da2[_0x4f27('0x37')];if(!_0x28e86[_0x4f27('0x31')][_0x4f27('0x51')](_0x4f27('0x4f'))){_0x2f40e0[_0x4f27('0x1c')]=qs[_0x4f27('0x1c')](_0x28e86[_0x4f27('0x31')][_0x4f27('0x1c')]);_0x2f40e0[_0x4f27('0x1a')]=qs[_0x4f27('0x1a')](_0x28e86[_0x4f27('0x31')][_0x4f27('0x1a')]);}return _0x45b4d0[_0x4f27('0x53')](_0x2f40e0);}})[_0x4f27('0x24')](function(_0x2d766e){if(_0x2d766e){return _0x2d766e?{'count':_0x5db940,'rows':_0x2d766e}:null;}})[_0x4f27('0x24')](respondWithResult(_0xb12621,null))[_0x4f27('0x46')](handleError(_0xb12621,null));};exports[_0x4f27('0x55')]=function(_0xa544b0,_0x3f7b54,_0x586138){if(_0xa544b0[_0x4f27('0x48')]['id']){delete _0xa544b0['body']['id'];}return db[_0x4f27('0x2b')]['findOne']({'where':{'id':_0xa544b0[_0x4f27('0x43')]['id']}})[_0x4f27('0x24')](handleEntityNotFound(_0x3f7b54,null))[_0x4f27('0x24')](function(_0x459e29){if(_0x459e29){return _0x459e29[_0x4f27('0x55')](_0xa544b0[_0x4f27('0x48')][_0x4f27('0x56')]||[]);}return null;})[_0x4f27('0x24')](respondWithResult(_0x3f7b54,null))['catch'](handleError(_0x3f7b54,null));};
\ No newline at end of file
+var _0xd589=['index','map','ZendeskConfiguration','fieldName','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','getFields','ZendeskField','hasOwnProperty','findOne','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','request-promise','moment','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','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','update','then','destroy','error','name','send'];(function(_0x3a0deb,_0x2f868d){var _0xd1f46a=function(_0x405fbe){while(--_0x405fbe){_0x3a0deb['push'](_0x3a0deb['shift']());}};_0xd1f46a(++_0x2f868d);}(_0xd589,0x81));var _0x9d58=function(_0x3ca4c7,_0xaa58ce){_0x3ca4c7=_0x3ca4c7-0x0;var _0x4684df=_0xd589[_0x3ca4c7];return _0x4684df;};'use strict';var emlformat=require(_0x9d58('0x0'));var rimraf=require(_0x9d58('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9d58('0x2'));var moment=require(_0x9d58('0x3'));var BPromise=require(_0x9d58('0x4'));var Mustache=require(_0x9d58('0x5'));var util=require(_0x9d58('0x6'));var path=require('path');var sox=require(_0x9d58('0x7'));var csv=require('to-csv');var ejs=require(_0x9d58('0x8'));var fs=require('fs');var fs_extra=require(_0x9d58('0x9'));var _=require(_0x9d58('0xa'));var squel=require(_0x9d58('0xb'));var crypto=require(_0x9d58('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9d58('0xd'));var toCsv=require(_0x9d58('0xe'));var querystring=require(_0x9d58('0xf'));var Papa=require(_0x9d58('0x10'));var Redis=require(_0x9d58('0x11'));var authService=require(_0x9d58('0x12'));var qs=require(_0x9d58('0x13'));var as=require(_0x9d58('0x14'));var hardwareService=require(_0x9d58('0x15'));var logger=require(_0x9d58('0x16'))(_0x9d58('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9d58('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b6246,_0xde6368){_0xde6368=_0xde6368||0xcc;return function(_0x11a23f){if(_0x11a23f){return _0x3b6246[_0x9d58('0x19')](_0xde6368);}return _0x3b6246[_0x9d58('0x1a')](_0xde6368)[_0x9d58('0x1b')]();};}function respondWithResult(_0x1f4ac0,_0x5da640){_0x5da640=_0x5da640||0xc8;return function(_0x554a9b){if(_0x554a9b){return _0x1f4ac0['status'](_0x5da640)[_0x9d58('0x1c')](_0x554a9b);}};}function respondWithFilteredResult(_0x5db90d,_0x71e843){return function(_0x38fc25){if(_0x38fc25){var _0xb76013=typeof _0x71e843['offset']===_0x9d58('0x1d')&&typeof _0x71e843[_0x9d58('0x1e')]===_0x9d58('0x1d');var _0x369b02=_0x38fc25['count'];var _0xe9f20e=_0xb76013?0x0:_0x71e843[_0x9d58('0x1f')];var _0x127d88=_0xb76013?_0x38fc25[_0x9d58('0x20')]:_0x71e843[_0x9d58('0x1f')]+_0x71e843['limit'];var _0x594486;if(_0x127d88>=_0x369b02){_0x127d88=_0x369b02;_0x594486=0xc8;}else{_0x594486=0xce;}_0x5db90d[_0x9d58('0x1a')](_0x594486);return _0x5db90d[_0x9d58('0x21')](_0x9d58('0x22'),_0xe9f20e+'-'+_0x127d88+'/'+_0x369b02)[_0x9d58('0x1c')](_0x38fc25);}return null;};}function patchUpdates(_0x519f51){return function(_0x45ebbf){try{jsonpatch[_0x9d58('0x23')](_0x45ebbf,_0x519f51,!![]);}catch(_0x2c85d1){return BPromise[_0x9d58('0x24')](_0x2c85d1);}return _0x45ebbf['save']();};}function saveUpdates(_0x451dbc,_0x7db1d){return function(_0x3ac3ae){if(_0x3ac3ae){return _0x3ac3ae[_0x9d58('0x25')](_0x451dbc)[_0x9d58('0x26')](function(_0x223abc){return _0x223abc;});}return null;};}function removeEntity(_0x2cbe0e,_0x201a1b){return function(_0x60e69){if(_0x60e69){return _0x60e69[_0x9d58('0x27')]()[_0x9d58('0x26')](function(){_0x2cbe0e['status'](0xcc)[_0x9d58('0x1b')]();});}};}function handleEntityNotFound(_0x3695b1,_0x159c69){return function(_0x293c1b){if(!_0x293c1b){_0x3695b1[_0x9d58('0x19')](0x194);}return _0x293c1b;};}function handleError(_0x5206b3,_0x2f0665){_0x2f0665=_0x2f0665||0x1f4;return function(_0x301ac3){logger[_0x9d58('0x28')](_0x301ac3['stack']);if(_0x301ac3[_0x9d58('0x29')]){delete _0x301ac3[_0x9d58('0x29')];}_0x5206b3['status'](_0x2f0665)[_0x9d58('0x2a')](_0x301ac3);};}exports[_0x9d58('0x2b')]=function(_0x9c8846,_0x5d1f25){var _0x38d05e={},_0x15904e={},_0x5966a3={'count':0x0,'rows':[]};var _0x1c8c3d=_[_0x9d58('0x2c')](db[_0x9d58('0x2d')]['rawAttributes'],function(_0xaa1d25){return{'name':_0xaa1d25[_0x9d58('0x2e')],'type':_0xaa1d25['type'][_0x9d58('0x2f')]};});_0x15904e[_0x9d58('0x30')]=_['map'](_0x1c8c3d,_0x9d58('0x29'));_0x15904e[_0x9d58('0x31')]=_[_0x9d58('0x32')](_0x9c8846['query']);_0x15904e[_0x9d58('0x33')]=_[_0x9d58('0x34')](_0x15904e[_0x9d58('0x30')],_0x15904e[_0x9d58('0x31')]);_0x38d05e['attributes']=_['intersection'](_0x15904e[_0x9d58('0x30')],qs[_0x9d58('0x35')](_0x9c8846[_0x9d58('0x31')][_0x9d58('0x35')]));_0x38d05e[_0x9d58('0x36')]=_0x38d05e[_0x9d58('0x36')]['length']?_0x38d05e['attributes']:_0x15904e[_0x9d58('0x30')];if(!_0x9c8846[_0x9d58('0x31')]['hasOwnProperty'](_0x9d58('0x37'))){_0x38d05e[_0x9d58('0x1e')]=qs[_0x9d58('0x1e')](_0x9c8846[_0x9d58('0x31')][_0x9d58('0x1e')]);_0x38d05e[_0x9d58('0x1f')]=qs[_0x9d58('0x1f')](_0x9c8846[_0x9d58('0x31')][_0x9d58('0x1f')]);}_0x38d05e[_0x9d58('0x38')]=qs[_0x9d58('0x39')](_0x9c8846[_0x9d58('0x31')][_0x9d58('0x39')]);_0x38d05e[_0x9d58('0x3a')]=qs[_0x9d58('0x33')](_[_0x9d58('0x3b')](_0x9c8846[_0x9d58('0x31')],_0x15904e[_0x9d58('0x33')]),_0x1c8c3d);if(_0x9c8846['query'][_0x9d58('0x3c')]){_0x38d05e[_0x9d58('0x3a')]=_[_0x9d58('0x3d')](_0x38d05e['where'],{'$or':_[_0x9d58('0x2c')](_0x1c8c3d,function(_0x18a8a6){if(_0x18a8a6[_0x9d58('0x3e')]!==_0x9d58('0x3f')){var _0x155e06={};_0x155e06[_0x18a8a6['name']]={'$like':'%'+_0x9c8846[_0x9d58('0x31')][_0x9d58('0x3c')]+'%'};return _0x155e06;}})});}_0x38d05e=_[_0x9d58('0x3d')]({},_0x38d05e,_0x9c8846[_0x9d58('0x40')]);var _0x3da1d0={'where':_0x38d05e[_0x9d58('0x3a')]};return db[_0x9d58('0x2d')]['count'](_0x3da1d0)['then'](function(_0x948e21){_0x5966a3[_0x9d58('0x20')]=_0x948e21;if(_0x9c8846[_0x9d58('0x31')][_0x9d58('0x41')]){_0x38d05e[_0x9d58('0x42')]=[{'all':!![]}];}return db[_0x9d58('0x2d')][_0x9d58('0x43')](_0x38d05e);})['then'](function(_0x5e0ac6){_0x5966a3[_0x9d58('0x44')]=_0x5e0ac6;return _0x5966a3;})[_0x9d58('0x26')](respondWithFilteredResult(_0x5d1f25,_0x38d05e))[_0x9d58('0x45')](handleError(_0x5d1f25,null));};exports[_0x9d58('0x46')]=function(_0x4bd148,_0x5e580a){var _0x58ff87={'raw':![],'where':{'id':_0x4bd148[_0x9d58('0x47')]['id']}},_0x344219={};_0x344219[_0x9d58('0x30')]=_[_0x9d58('0x32')](db[_0x9d58('0x2d')][_0x9d58('0x48')]);_0x344219[_0x9d58('0x31')]=_[_0x9d58('0x32')](_0x4bd148['query']);_0x344219[_0x9d58('0x33')]=_['intersection'](_0x344219[_0x9d58('0x30')],_0x344219[_0x9d58('0x31')]);_0x58ff87[_0x9d58('0x36')]=_[_0x9d58('0x34')](_0x344219['model'],qs[_0x9d58('0x35')](_0x4bd148[_0x9d58('0x31')]['fields']));_0x58ff87['attributes']=_0x58ff87[_0x9d58('0x36')][_0x9d58('0x49')]?_0x58ff87[_0x9d58('0x36')]:_0x344219[_0x9d58('0x30')];if(_0x4bd148[_0x9d58('0x31')][_0x9d58('0x41')]){_0x58ff87['include']=[{'all':!![]}];}_0x58ff87=_[_0x9d58('0x3d')]({},_0x58ff87,_0x4bd148[_0x9d58('0x40')]);return db[_0x9d58('0x2d')][_0x9d58('0x4a')](_0x58ff87)['then'](handleEntityNotFound(_0x5e580a,null))[_0x9d58('0x26')](respondWithResult(_0x5e580a,null))[_0x9d58('0x45')](handleError(_0x5e580a,null));};exports[_0x9d58('0x4b')]=function(_0x196293,_0x4dbb4e){return db[_0x9d58('0x2d')][_0x9d58('0x4b')](_0x196293[_0x9d58('0x4c')],{})[_0x9d58('0x26')](respondWithResult(_0x4dbb4e,0xc9))['catch'](handleError(_0x4dbb4e,null));};exports['update']=function(_0xad155b,_0x373a6b){if(_0xad155b[_0x9d58('0x4c')]['id']){delete _0xad155b[_0x9d58('0x4c')]['id'];}return db[_0x9d58('0x2d')][_0x9d58('0x4a')]({'where':{'id':_0xad155b[_0x9d58('0x47')]['id']}})['then'](handleEntityNotFound(_0x373a6b,null))['then'](saveUpdates(_0xad155b[_0x9d58('0x4c')],null))['then'](respondWithResult(_0x373a6b,null))[_0x9d58('0x45')](handleError(_0x373a6b,null));};exports[_0x9d58('0x27')]=function(_0x394a49,_0x21d825){return db[_0x9d58('0x2d')][_0x9d58('0x4a')]({'where':{'id':_0x394a49[_0x9d58('0x47')]['id']}})[_0x9d58('0x26')](handleEntityNotFound(_0x21d825,null))[_0x9d58('0x26')](removeEntity(_0x21d825,null))[_0x9d58('0x45')](handleError(_0x21d825,null));};exports[_0x9d58('0x4d')]=function(_0x46501f,_0x589c3a,_0x455bfb){var _0x19ee42={};var _0x25bfc4={};var _0x47674c;var _0x59d9d6;return db[_0x9d58('0x2d')]['findOne']({'where':{'id':_0x46501f[_0x9d58('0x47')]['id']}})[_0x9d58('0x26')](handleEntityNotFound(_0x589c3a,null))[_0x9d58('0x26')](function(_0x56e978){if(_0x56e978){_0x47674c=_0x56e978;_0x25bfc4[_0x9d58('0x30')]=_[_0x9d58('0x32')](db[_0x9d58('0x4e')][_0x9d58('0x48')]);_0x25bfc4['query']=_[_0x9d58('0x32')](_0x46501f[_0x9d58('0x31')]);_0x25bfc4[_0x9d58('0x33')]=_[_0x9d58('0x34')](_0x25bfc4[_0x9d58('0x30')],_0x25bfc4[_0x9d58('0x31')]);_0x19ee42[_0x9d58('0x36')]=_[_0x9d58('0x34')](_0x25bfc4['model'],qs[_0x9d58('0x35')](_0x46501f['query'][_0x9d58('0x35')]));_0x19ee42[_0x9d58('0x36')]=_0x19ee42['attributes'][_0x9d58('0x49')]?_0x19ee42[_0x9d58('0x36')]:_0x25bfc4[_0x9d58('0x30')];_0x19ee42[_0x9d58('0x38')]=qs[_0x9d58('0x39')](_0x46501f[_0x9d58('0x31')][_0x9d58('0x39')]);_0x19ee42[_0x9d58('0x3a')]=qs[_0x9d58('0x33')](_['pick'](_0x46501f[_0x9d58('0x31')],_0x25bfc4[_0x9d58('0x33')]));if(_0x46501f['query'][_0x9d58('0x3c')]){_0x19ee42['where']=_[_0x9d58('0x3d')](_0x19ee42[_0x9d58('0x3a')],{'$or':_[_0x9d58('0x2c')](_0x19ee42[_0x9d58('0x36')],function(_0x17c5b8){var _0x38fc6e={};_0x38fc6e[_0x17c5b8]={'$like':'%'+_0x46501f['query'][_0x9d58('0x3c')]+'%'};return _0x38fc6e;})});}_0x19ee42=_[_0x9d58('0x3d')]({},_0x19ee42,_0x46501f[_0x9d58('0x40')]);return _0x47674c[_0x9d58('0x4d')](_0x19ee42);}})['then'](function(_0x4e1271){if(_0x4e1271){_0x59d9d6=_0x4e1271[_0x9d58('0x49')];if(!_0x46501f[_0x9d58('0x31')][_0x9d58('0x4f')](_0x9d58('0x37'))){_0x19ee42[_0x9d58('0x1e')]=qs[_0x9d58('0x1e')](_0x46501f[_0x9d58('0x31')][_0x9d58('0x1e')]);_0x19ee42[_0x9d58('0x1f')]=qs['offset'](_0x46501f[_0x9d58('0x31')]['offset']);}return _0x47674c[_0x9d58('0x4d')](_0x19ee42);}})['then'](function(_0x5ae84c){if(_0x5ae84c){return _0x5ae84c?{'count':_0x59d9d6,'rows':_0x5ae84c}:null;}})[_0x9d58('0x26')](respondWithResult(_0x589c3a,null))[_0x9d58('0x45')](handleError(_0x589c3a,null));};exports['getSubjects']=function(_0x3b0618,_0x35cecc,_0x243a93){var _0x133061={};var _0x432f9f={};var _0x483229;var _0xff504b;return db['ZendeskConfiguration'][_0x9d58('0x50')]({'where':{'id':_0x3b0618[_0x9d58('0x47')]['id']}})[_0x9d58('0x26')](handleEntityNotFound(_0x35cecc,null))[_0x9d58('0x26')](function(_0x53b79f){if(_0x53b79f){_0x483229=_0x53b79f;_0x432f9f[_0x9d58('0x30')]=_[_0x9d58('0x32')](db[_0x9d58('0x4e')][_0x9d58('0x48')]);_0x432f9f[_0x9d58('0x31')]=_[_0x9d58('0x32')](_0x3b0618[_0x9d58('0x31')]);_0x432f9f['filters']=_[_0x9d58('0x34')](_0x432f9f[_0x9d58('0x30')],_0x432f9f[_0x9d58('0x31')]);_0x133061['attributes']=_['intersection'](_0x432f9f['model'],qs[_0x9d58('0x35')](_0x3b0618[_0x9d58('0x31')][_0x9d58('0x35')]));_0x133061['attributes']=_0x133061[_0x9d58('0x36')]['length']?_0x133061[_0x9d58('0x36')]:_0x432f9f['model'];_0x133061[_0x9d58('0x38')]=qs[_0x9d58('0x39')](_0x3b0618[_0x9d58('0x31')]['sort']);_0x133061[_0x9d58('0x3a')]=qs[_0x9d58('0x33')](_[_0x9d58('0x3b')](_0x3b0618['query'],_0x432f9f[_0x9d58('0x33')]));if(_0x3b0618[_0x9d58('0x31')][_0x9d58('0x3c')]){_0x133061[_0x9d58('0x3a')]=_[_0x9d58('0x3d')](_0x133061[_0x9d58('0x3a')],{'$or':_[_0x9d58('0x2c')](_0x133061[_0x9d58('0x36')],function(_0x293579){var _0x3fccc2={};_0x3fccc2[_0x293579]={'$like':'%'+_0x3b0618[_0x9d58('0x31')][_0x9d58('0x3c')]+'%'};return _0x3fccc2;})});}_0x133061=_['merge']({},_0x133061,_0x3b0618[_0x9d58('0x40')]);return _0x483229[_0x9d58('0x51')](_0x133061);}})[_0x9d58('0x26')](function(_0x3d6bda){if(_0x3d6bda){_0xff504b=_0x3d6bda[_0x9d58('0x49')];if(!_0x3b0618['query'][_0x9d58('0x4f')](_0x9d58('0x37'))){_0x133061[_0x9d58('0x1e')]=qs['limit'](_0x3b0618[_0x9d58('0x31')][_0x9d58('0x1e')]);_0x133061[_0x9d58('0x1f')]=qs[_0x9d58('0x1f')](_0x3b0618[_0x9d58('0x31')][_0x9d58('0x1f')]);}return _0x483229[_0x9d58('0x51')](_0x133061);}})[_0x9d58('0x26')](function(_0x2b7344){if(_0x2b7344){return _0x2b7344?{'count':_0xff504b,'rows':_0x2b7344}:null;}})[_0x9d58('0x26')](respondWithResult(_0x35cecc,null))[_0x9d58('0x45')](handleError(_0x35cecc,null));};exports['getDescriptions']=function(_0x354179,_0x20a304,_0x51574d){var _0x4a3ead={};var _0x438182={};var _0x5658f4;var _0x1e9613;return db[_0x9d58('0x2d')][_0x9d58('0x50')]({'where':{'id':_0x354179['params']['id']}})[_0x9d58('0x26')](handleEntityNotFound(_0x20a304,null))['then'](function(_0x940ab0){if(_0x940ab0){_0x5658f4=_0x940ab0;_0x438182[_0x9d58('0x30')]=_['keys'](db[_0x9d58('0x4e')][_0x9d58('0x48')]);_0x438182[_0x9d58('0x31')]=_[_0x9d58('0x32')](_0x354179[_0x9d58('0x31')]);_0x438182[_0x9d58('0x33')]=_[_0x9d58('0x34')](_0x438182[_0x9d58('0x30')],_0x438182['query']);_0x4a3ead[_0x9d58('0x36')]=_['intersection'](_0x438182[_0x9d58('0x30')],qs['fields'](_0x354179[_0x9d58('0x31')][_0x9d58('0x35')]));_0x4a3ead[_0x9d58('0x36')]=_0x4a3ead[_0x9d58('0x36')]['length']?_0x4a3ead[_0x9d58('0x36')]:_0x438182['model'];_0x4a3ead['order']=qs['sort'](_0x354179[_0x9d58('0x31')]['sort']);_0x4a3ead[_0x9d58('0x3a')]=qs[_0x9d58('0x33')](_[_0x9d58('0x3b')](_0x354179['query'],_0x438182[_0x9d58('0x33')]));if(_0x354179['query']['filter']){_0x4a3ead[_0x9d58('0x3a')]=_[_0x9d58('0x3d')](_0x4a3ead[_0x9d58('0x3a')],{'$or':_[_0x9d58('0x2c')](_0x4a3ead[_0x9d58('0x36')],function(_0x359845){var _0x31f26f={};_0x31f26f[_0x359845]={'$like':'%'+_0x354179[_0x9d58('0x31')]['filter']+'%'};return _0x31f26f;})});}_0x4a3ead=_[_0x9d58('0x3d')]({},_0x4a3ead,_0x354179['options']);return _0x5658f4[_0x9d58('0x52')](_0x4a3ead);}})[_0x9d58('0x26')](function(_0x1f106d){if(_0x1f106d){_0x1e9613=_0x1f106d[_0x9d58('0x49')];if(!_0x354179[_0x9d58('0x31')][_0x9d58('0x4f')](_0x9d58('0x37'))){_0x4a3ead['limit']=qs[_0x9d58('0x1e')](_0x354179['query'][_0x9d58('0x1e')]);_0x4a3ead[_0x9d58('0x1f')]=qs[_0x9d58('0x1f')](_0x354179[_0x9d58('0x31')][_0x9d58('0x1f')]);}return _0x5658f4[_0x9d58('0x52')](_0x4a3ead);}})['then'](function(_0xeefa2a){if(_0xeefa2a){return _0xeefa2a?{'count':_0x1e9613,'rows':_0xeefa2a}:null;}})[_0x9d58('0x26')](respondWithResult(_0x20a304,null))[_0x9d58('0x45')](handleError(_0x20a304,null));};exports['getTags']=function(_0x29c838,_0x1350b8,_0x799714){var _0x11e13e={};var _0x50dcdf={};var _0x41f480;var _0x531c73;return db[_0x9d58('0x2d')]['findOne']({'where':{'id':_0x29c838['params']['id']}})[_0x9d58('0x26')](handleEntityNotFound(_0x1350b8,null))[_0x9d58('0x26')](function(_0x3f5c87){if(_0x3f5c87){_0x41f480=_0x3f5c87;_0x50dcdf['model']=_[_0x9d58('0x32')](db['Tag']['rawAttributes']);_0x50dcdf[_0x9d58('0x31')]=_[_0x9d58('0x32')](_0x29c838[_0x9d58('0x31')]);_0x50dcdf['filters']=_[_0x9d58('0x34')](_0x50dcdf['model'],_0x50dcdf[_0x9d58('0x31')]);_0x11e13e[_0x9d58('0x36')]=_['intersection'](_0x50dcdf[_0x9d58('0x30')],qs[_0x9d58('0x35')](_0x29c838[_0x9d58('0x31')][_0x9d58('0x35')]));_0x11e13e[_0x9d58('0x36')]=_0x11e13e[_0x9d58('0x36')]['length']?_0x11e13e[_0x9d58('0x36')]:_0x50dcdf[_0x9d58('0x30')];_0x11e13e[_0x9d58('0x38')]=qs[_0x9d58('0x39')](_0x29c838['query']['sort']);_0x11e13e[_0x9d58('0x3a')]=qs[_0x9d58('0x33')](_[_0x9d58('0x3b')](_0x29c838[_0x9d58('0x31')],_0x50dcdf[_0x9d58('0x33')]));if(_0x29c838[_0x9d58('0x31')][_0x9d58('0x3c')]){_0x11e13e[_0x9d58('0x3a')]=_['merge'](_0x11e13e['where'],{'$or':_[_0x9d58('0x2c')](_0x11e13e[_0x9d58('0x36')],function(_0x2630e2){var _0x12b171={};_0x12b171[_0x2630e2]={'$like':'%'+_0x29c838[_0x9d58('0x31')][_0x9d58('0x3c')]+'%'};return _0x12b171;})});}_0x11e13e=_['merge']({},_0x11e13e,_0x29c838[_0x9d58('0x40')]);return _0x41f480[_0x9d58('0x53')](_0x11e13e);}})[_0x9d58('0x26')](function(_0x34586b){if(_0x34586b){_0x531c73=_0x34586b['length'];if(!_0x29c838[_0x9d58('0x31')][_0x9d58('0x4f')](_0x9d58('0x37'))){_0x11e13e[_0x9d58('0x1e')]=qs['limit'](_0x29c838[_0x9d58('0x31')][_0x9d58('0x1e')]);_0x11e13e['offset']=qs[_0x9d58('0x1f')](_0x29c838['query'][_0x9d58('0x1f')]);}return _0x41f480[_0x9d58('0x53')](_0x11e13e);}})['then'](function(_0x56b6b6){if(_0x56b6b6){return _0x56b6b6?{'count':_0x531c73,'rows':_0x56b6b6}:null;}})[_0x9d58('0x26')](respondWithResult(_0x1350b8,null))[_0x9d58('0x45')](handleError(_0x1350b8,null));};exports[_0x9d58('0x54')]=function(_0x1f7c95,_0x3c02b8,_0x5b8b85){if(_0x1f7c95[_0x9d58('0x4c')]['id']){delete _0x1f7c95[_0x9d58('0x4c')]['id'];}return db['ZendeskConfiguration'][_0x9d58('0x50')]({'where':{'id':_0x1f7c95[_0x9d58('0x47')]['id']}})['then'](handleEntityNotFound(_0x3c02b8,null))[_0x9d58('0x26')](function(_0x5e2727){if(_0x5e2727){return _0x5e2727[_0x9d58('0x54')](_0x1f7c95[_0x9d58('0x4c')][_0x9d58('0x55')]||[]);}return null;})[_0x9d58('0x26')](respondWithResult(_0x3c02b8,null))[_0x9d58('0x45')](handleError(_0x3c02b8,null));};
\ No newline at end of file
index f8b45bb..eae2586 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b20=['lodash','util','api','bluebird','request-promise','path','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration'];(function(_0x14ee7b,_0x1d04ae){var _0x4f5e96=function(_0x7f7b0e){while(--_0x7f7b0e){_0x14ee7b['push'](_0x14ee7b['shift']());}};_0x4f5e96(++_0x1d04ae);}(_0x6b20,0xd1));var _0x06b2=function(_0x372d51,_0x1af784){_0x372d51=_0x372d51-0x0;var _0x23816d=_0x6b20[_0x372d51];return _0x23816d;};'use strict';var _=require(_0x06b2('0x0'));var util=require(_0x06b2('0x1'));var logger=require('../../config/logger')(_0x06b2('0x2'));var moment=require('moment');var BPromise=require(_0x06b2('0x3'));var rp=require(_0x06b2('0x4'));var fs=require('fs');var path=require(_0x06b2('0x5'));var rimraf=require('rimraf');var config=require(_0x06b2('0x6'));var attributes=require(_0x06b2('0x7'));module[_0x06b2('0x8')]=function(_0x30d39c,_0x3b792b){return _0x30d39c[_0x06b2('0x9')](_0x06b2('0xa'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb7e7=['ZendeskConfiguration','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes','define'];(function(_0x1965e3,_0x37432d){var _0x10a6e1=function(_0x1bdf2d){while(--_0x1bdf2d){_0x1965e3['push'](_0x1965e3['shift']());}};_0x10a6e1(++_0x37432d);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0xb7e7[_0x1d24eb];return _0x1dc576;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2cb04f8..7044d84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2564=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','message','info','catch'];(function(_0x1c65b3,_0x5233ed){var _0x14e671=function(_0x1c3411){while(--_0x1c3411){_0x1c65b3['push'](_0x1c65b3['shift']());}};_0x14e671(++_0x5233ed);}(_0x2564,0x156));var _0x4256=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2564[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x4256('0x0'));var util=require('util');var moment=require(_0x4256('0x1'));var BPromise=require(_0x4256('0x2'));var rs=require(_0x4256('0x3'));var fs=require('fs');var Redis=require(_0x4256('0x4'));var db=require(_0x4256('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4256('0x6'));var config=require('../../config/environment');var jayson=require(_0x4256('0x7'));var client=jayson[_0x4256('0x8')][_0x4256('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59b54f,_0x5d2a43,_0x2c499c){return new BPromise(function(_0x5d7a47,_0x2cf98f){return client[_0x4256('0xa')](_0x59b54f,_0x2c499c)['then'](function(_0x5eb205){logger['info'](_0x4256('0xb'),_0x5d2a43,_0x4256('0xc'));logger['debug'](_0x4256('0xd'),_0x5d2a43,'request\x20sent',JSON['stringify'](_0x5eb205));if(_0x5eb205['error']){if(_0x5eb205[_0x4256('0xe')]['code']===0x1f4){logger[_0x4256('0xe')](_0x4256('0xb'),_0x5d2a43,_0x5eb205[_0x4256('0xe')][_0x4256('0xf')]);return _0x2cf98f(_0x5eb205[_0x4256('0xe')][_0x4256('0xf')]);}logger[_0x4256('0xe')](_0x4256('0xb'),_0x5d2a43,_0x5eb205['error'][_0x4256('0xf')]);return _0x5d7a47(_0x5eb205[_0x4256('0xe')][_0x4256('0xf')]);}else{logger[_0x4256('0x10')](_0x4256('0xb'),_0x5d2a43,_0x4256('0xc'));_0x5d7a47(_0x5eb205['result']['message']);}})[_0x4256('0x11')](function(_0x27de14){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x5d2a43,_0x27de14);_0x2cf98f(_0x27de14);});});}
\ No newline at end of file
+var _0xbec0=['randomstring','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','catch','lodash','moment'];(function(_0x368ebd,_0x565411){var _0xe3333f=function(_0x2379dd){while(--_0x2379dd){_0x368ebd['push'](_0x368ebd['shift']());}};_0xe3333f(++_0x565411);}(_0xbec0,0x108));var _0x0bec=function(_0x1cfddc,_0x441852){_0x1cfddc=_0x1cfddc-0x0;var _0x54c76c=_0xbec0[_0x1cfddc];return _0x54c76c;};'use strict';var _=require(_0x0bec('0x0'));var util=require('util');var moment=require(_0x0bec('0x1'));var BPromise=require('bluebird');var rs=require(_0x0bec('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0bec('0x3'));var config=require(_0x0bec('0x4'));var jayson=require(_0x0bec('0x5'));var client=jayson[_0x0bec('0x6')][_0x0bec('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x398ccd,_0x2319e6,_0xf3291c){return new BPromise(function(_0x4abee5,_0x5a85ea){return client[_0x0bec('0x8')](_0x398ccd,_0xf3291c)[_0x0bec('0x9')](function(_0x54b1b3){logger[_0x0bec('0xa')](_0x0bec('0xb'),_0x2319e6,'request\x20sent');logger[_0x0bec('0xc')](_0x0bec('0xd'),_0x2319e6,_0x0bec('0xe'),JSON['stringify'](_0x54b1b3));if(_0x54b1b3['error']){if(_0x54b1b3['error'][_0x0bec('0xf')]===0x1f4){logger[_0x0bec('0x10')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2319e6,_0x54b1b3[_0x0bec('0x10')][_0x0bec('0x11')]);return _0x5a85ea(_0x54b1b3[_0x0bec('0x10')][_0x0bec('0x11')]);}logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x2319e6,_0x54b1b3[_0x0bec('0x10')][_0x0bec('0x11')]);return _0x4abee5(_0x54b1b3[_0x0bec('0x10')][_0x0bec('0x11')]);}else{logger[_0x0bec('0xa')](_0x0bec('0xb'),_0x2319e6,_0x0bec('0xe'));_0x4abee5(_0x54b1b3['result'][_0x0bec('0x11')]);}})[_0x0bec('0x12')](function(_0x3b0fbc){logger[_0x0bec('0x10')](_0x0bec('0xb'),_0x2319e6,_0x3b0fbc);_0x5a85ea(_0x3b0fbc);});});}
\ No newline at end of file
index 6eb1e36..baaa1c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb397=['/:id','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','put','update','delete'];(function(_0x537881,_0x3555b0){var _0x19ef90=function(_0x38cbfa){while(--_0x38cbfa){_0x537881['push'](_0x537881['shift']());}};_0x19ef90(++_0x3555b0);}(_0xb397,0x1de));var _0x7b39=function(_0x32d406,_0x1885d2){_0x32d406=_0x32d406-0x0;var _0x32c159=_0xb397[_0x32d406];return _0x32c159;};'use strict';var multer=require(_0x7b39('0x0'));var util=require('util');var path=require(_0x7b39('0x1'));var timeout=require(_0x7b39('0x2'));var express=require(_0x7b39('0x3'));var router=express['Router']();var fs_extra=require(_0x7b39('0x4'));var auth=require(_0x7b39('0x5'));var interaction=require(_0x7b39('0x6'));var config=require(_0x7b39('0x7'));var controller=require('./intZendeskField.controller');router[_0x7b39('0x8')]('/',auth[_0x7b39('0x9')](),controller[_0x7b39('0xa')]);router[_0x7b39('0x8')]('/:id',auth[_0x7b39('0x9')](),controller[_0x7b39('0xb')]);router[_0x7b39('0xc')]('/',auth[_0x7b39('0x9')](),controller['create']);router[_0x7b39('0xd')]('/:id',auth[_0x7b39('0x9')](),controller[_0x7b39('0xe')]);router[_0x7b39('0xf')](_0x7b39('0x10'),auth['isAuthenticated'](),controller[_0x7b39('0x11')]);module[_0x7b39('0x12')]=router;
\ No newline at end of file
+var _0xe0eb=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','show','create','put','delete'];(function(_0x2909c5,_0x3d91b8){var _0x205562=function(_0x570635){while(--_0x570635){_0x2909c5['push'](_0x2909c5['shift']());}};_0x205562(++_0x3d91b8);}(_0xe0eb,0x192));var _0xbe0e=function(_0x38d5b2,_0xe77bf4){_0x38d5b2=_0x38d5b2-0x0;var _0x5b4ba8=_0xe0eb[_0x38d5b2];return _0x5b4ba8;};'use strict';var multer=require(_0xbe0e('0x0'));var util=require(_0xbe0e('0x1'));var path=require(_0xbe0e('0x2'));var timeout=require('connect-timeout');var express=require(_0xbe0e('0x3'));var router=express[_0xbe0e('0x4')]();var fs_extra=require(_0xbe0e('0x5'));var auth=require(_0xbe0e('0x6'));var interaction=require(_0xbe0e('0x7'));var config=require(_0xbe0e('0x8'));var controller=require(_0xbe0e('0x9'));router[_0xbe0e('0xa')]('/',auth[_0xbe0e('0xb')](),controller[_0xbe0e('0xc')]);router[_0xbe0e('0xa')](_0xbe0e('0xd'),auth[_0xbe0e('0xb')](),controller[_0xbe0e('0xe')]);router['post']('/',auth[_0xbe0e('0xb')](),controller[_0xbe0e('0xf')]);router[_0xbe0e('0x10')](_0xbe0e('0xd'),auth[_0xbe0e('0xb')](),controller['update']);router[_0xbe0e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xbe0e('0x12')]);module[_0xbe0e('0x13')]=router;
\ No newline at end of file
index 5814858..66da18a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9132=['variable','BOOLEAN','exports','ENUM','string','customVariable','keyValue','picklist','STRING'];(function(_0x4dbe68,_0x5189cd){var _0x48f2b3=function(_0x485c29){while(--_0x485c29){_0x4dbe68['push'](_0x4dbe68['shift']());}};_0x48f2b3(++_0x5189cd);}(_0x9132,0x1c4));var _0x2913=function(_0xa67f45,_0x2ab37c){_0xa67f45=_0xa67f45-0x0;var _0x5ceb1f=_0x9132[_0xa67f45];return _0x5ceb1f;};'use strict';var Sequelize=require('sequelize');module[_0x2913('0x0')]={'type':{'type':Sequelize[_0x2913('0x1')](_0x2913('0x2'),'variable',_0x2913('0x3'),_0x2913('0x4'),_0x2913('0x5')),'defaultValue':_0x2913('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x2913('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x2913('0x2'),_0x2913('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0x2913('0x6')]},'idField':{'type':Sequelize[_0x2913('0x6')]},'nameField':{'type':Sequelize[_0x2913('0x6')]},'customField':{'type':Sequelize[_0x2913('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x1f15=['STRING','BOOLEAN','sequelize','ENUM','variable','customVariable','keyValue','picklist','string'];(function(_0x1c206c,_0x30bdcf){var _0x188aaa=function(_0x49ff11){while(--_0x49ff11){_0x1c206c['push'](_0x1c206c['shift']());}};_0x188aaa(++_0x30bdcf);}(_0x1f15,0x1a0));var _0x51f1=function(_0x3b1f41,_0x449a99){_0x3b1f41=_0x3b1f41-0x0;var _0x56b82e=_0x1f15[_0x3b1f41];return _0x56b82e;};'use strict';var Sequelize=require(_0x51f1('0x0'));module['exports']={'type':{'type':Sequelize[_0x51f1('0x1')]('string',_0x51f1('0x2'),_0x51f1('0x3'),_0x51f1('0x4'),_0x51f1('0x5')),'defaultValue':_0x51f1('0x6')},'content':{'type':Sequelize[_0x51f1('0x7')]},'key':{'type':Sequelize[_0x51f1('0x7')]},'keyType':{'type':Sequelize[_0x51f1('0x1')](_0x51f1('0x6'),_0x51f1('0x2'),_0x51f1('0x3'))},'keyContent':{'type':Sequelize[_0x51f1('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x51f1('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x51f1('0x7')]}};
\ No newline at end of file
index 8ad9700..03ab364 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4a7=['fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','catch','params','ZendeskField','options','find','create','body','eml-format','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa4a7,0xf9));var _0x7a4a=function(_0x4511b2,_0x39b8d4){_0x4511b2=_0x4511b2-0x0;var _0x24284c=_0xa4a7[_0x4511b2];return _0x24284c;};'use strict';var emlformat=require(_0x7a4a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7a4a('0x1'));var rp=require(_0x7a4a('0x2'));var moment=require('moment');var BPromise=require(_0x7a4a('0x3'));var Mustache=require('mustache');var util=require(_0x7a4a('0x4'));var path=require(_0x7a4a('0x5'));var sox=require(_0x7a4a('0x6'));var csv=require(_0x7a4a('0x7'));var ejs=require(_0x7a4a('0x8'));var fs=require('fs');var fs_extra=require(_0x7a4a('0x9'));var _=require(_0x7a4a('0xa'));var squel=require(_0x7a4a('0xb'));var crypto=require(_0x7a4a('0xc'));var jsforce=require(_0x7a4a('0xd'));var deskjs=require(_0x7a4a('0xe'));var toCsv=require(_0x7a4a('0x7'));var querystring=require(_0x7a4a('0xf'));var Papa=require('papaparse');var Redis=require(_0x7a4a('0x10'));var authService=require(_0x7a4a('0x11'));var qs=require(_0x7a4a('0x12'));var as=require(_0x7a4a('0x13'));var hardwareService=require(_0x7a4a('0x14'));var logger=require(_0x7a4a('0x15'))(_0x7a4a('0x16'));var utils=require('../../config/utils');var config=require(_0x7a4a('0x17'));var licenseUtil=require(_0x7a4a('0x18'));var db=require(_0x7a4a('0x19'))['db'];function respondWithStatusCode(_0x4407b7,_0x35f8e4){_0x35f8e4=_0x35f8e4||0xcc;return function(_0xec1cde){if(_0xec1cde){return _0x4407b7[_0x7a4a('0x1a')](_0x35f8e4);}return _0x4407b7[_0x7a4a('0x1b')](_0x35f8e4)[_0x7a4a('0x1c')]();};}function respondWithResult(_0x2a8197,_0x5c530e){_0x5c530e=_0x5c530e||0xc8;return function(_0x5b7a2e){if(_0x5b7a2e){return _0x2a8197['status'](_0x5c530e)[_0x7a4a('0x1d')](_0x5b7a2e);}};}function respondWithFilteredResult(_0x314468,_0x2e83db){return function(_0x3d26e9){if(_0x3d26e9){var _0x1a9069=typeof _0x2e83db['offset']===_0x7a4a('0x1e')&&typeof _0x2e83db[_0x7a4a('0x1f')]==='undefined';var _0x5e528c=_0x3d26e9[_0x7a4a('0x20')];var _0x2ccba7=_0x1a9069?0x0:_0x2e83db['offset'];var _0x2840ad=_0x1a9069?_0x3d26e9['count']:_0x2e83db[_0x7a4a('0x21')]+_0x2e83db['limit'];var _0x12efe5;if(_0x2840ad>=_0x5e528c){_0x2840ad=_0x5e528c;_0x12efe5=0xc8;}else{_0x12efe5=0xce;}_0x314468['status'](_0x12efe5);return _0x314468[_0x7a4a('0x22')]('Content-Range',_0x2ccba7+'-'+_0x2840ad+'/'+_0x5e528c)[_0x7a4a('0x1d')](_0x3d26e9);}return null;};}function patchUpdates(_0x1c6c79){return function(_0x104a5e){try{jsonpatch[_0x7a4a('0x23')](_0x104a5e,_0x1c6c79,!![]);}catch(_0x3bf1b8){return BPromise[_0x7a4a('0x24')](_0x3bf1b8);}return _0x104a5e[_0x7a4a('0x25')]();};}function saveUpdates(_0x60e526,_0x2bcb60){return function(_0x145d47){if(_0x145d47){return _0x145d47[_0x7a4a('0x26')](_0x60e526)[_0x7a4a('0x27')](function(_0x401649){return _0x401649;});}return null;};}function removeEntity(_0x4c4f31,_0x41c538){return function(_0x36ec6e){if(_0x36ec6e){return _0x36ec6e[_0x7a4a('0x28')]()['then'](function(){_0x4c4f31[_0x7a4a('0x1b')](0xcc)[_0x7a4a('0x1c')]();});}};}function handleEntityNotFound(_0x3a1473,_0x15f714){return function(_0x233a2b){if(!_0x233a2b){_0x3a1473['sendStatus'](0x194);}return _0x233a2b;};}function handleError(_0x74c6a9,_0x19350a){_0x19350a=_0x19350a||0x1f4;return function(_0x445c97){logger[_0x7a4a('0x29')](_0x445c97['stack']);if(_0x445c97[_0x7a4a('0x2a')]){delete _0x445c97[_0x7a4a('0x2a')];}_0x74c6a9['status'](_0x19350a)[_0x7a4a('0x2b')](_0x445c97);};}exports[_0x7a4a('0x2c')]=function(_0x40280f,_0x2879cf){var _0x1a0642={},_0x503a03={},_0x287eeb={'count':0x0,'rows':[]};var _0x14f75d=_[_0x7a4a('0x2d')](db['ZendeskField'][_0x7a4a('0x2e')],function(_0x5888ca){return{'name':_0x5888ca[_0x7a4a('0x2f')],'type':_0x5888ca[_0x7a4a('0x30')]['key']};});_0x503a03[_0x7a4a('0x31')]=_[_0x7a4a('0x2d')](_0x14f75d,_0x7a4a('0x2a'));_0x503a03[_0x7a4a('0x32')]=_[_0x7a4a('0x33')](_0x40280f[_0x7a4a('0x32')]);_0x503a03[_0x7a4a('0x34')]=_[_0x7a4a('0x35')](_0x503a03['model'],_0x503a03[_0x7a4a('0x32')]);_0x1a0642['attributes']=_[_0x7a4a('0x35')](_0x503a03[_0x7a4a('0x31')],qs['fields'](_0x40280f[_0x7a4a('0x32')][_0x7a4a('0x36')]));_0x1a0642[_0x7a4a('0x37')]=_0x1a0642[_0x7a4a('0x37')][_0x7a4a('0x38')]?_0x1a0642[_0x7a4a('0x37')]:_0x503a03[_0x7a4a('0x31')];if(!_0x40280f[_0x7a4a('0x32')]['hasOwnProperty'](_0x7a4a('0x39'))){_0x1a0642[_0x7a4a('0x1f')]=qs[_0x7a4a('0x1f')](_0x40280f[_0x7a4a('0x32')]['limit']);_0x1a0642[_0x7a4a('0x21')]=qs[_0x7a4a('0x21')](_0x40280f[_0x7a4a('0x32')][_0x7a4a('0x21')]);}_0x1a0642[_0x7a4a('0x3a')]=qs[_0x7a4a('0x3b')](_0x40280f['query'][_0x7a4a('0x3b')]);_0x1a0642[_0x7a4a('0x3c')]=qs['filters'](_[_0x7a4a('0x3d')](_0x40280f['query'],_0x503a03[_0x7a4a('0x34')]),_0x14f75d);if(_0x40280f[_0x7a4a('0x32')][_0x7a4a('0x3e')]){_0x1a0642[_0x7a4a('0x3c')]=_[_0x7a4a('0x3f')](_0x1a0642[_0x7a4a('0x3c')],{'$or':_[_0x7a4a('0x2d')](_0x14f75d,function(_0x59e298){if(_0x59e298['type']!=='VIRTUAL'){var _0xcd15ac={};_0xcd15ac[_0x59e298[_0x7a4a('0x2a')]]={'$like':'%'+_0x40280f[_0x7a4a('0x32')][_0x7a4a('0x3e')]+'%'};return _0xcd15ac;}})});}_0x1a0642=_['merge']({},_0x1a0642,_0x40280f['options']);var _0x4ecef1={'where':_0x1a0642['where']};return db['ZendeskField']['count'](_0x4ecef1)[_0x7a4a('0x27')](function(_0x1d03f6){_0x287eeb['count']=_0x1d03f6;if(_0x40280f[_0x7a4a('0x32')][_0x7a4a('0x40')]){_0x1a0642[_0x7a4a('0x41')]=[{'all':!![]}];}return db['ZendeskField'][_0x7a4a('0x42')](_0x1a0642);})[_0x7a4a('0x27')](function(_0x5e7b76){_0x287eeb['rows']=_0x5e7b76;return _0x287eeb;})['then'](respondWithFilteredResult(_0x2879cf,_0x1a0642))[_0x7a4a('0x43')](handleError(_0x2879cf,null));};exports['show']=function(_0x8ae300,_0x372065){var _0x5bd7d5={'raw':!![],'where':{'id':_0x8ae300[_0x7a4a('0x44')]['id']}},_0x4ee76d={};_0x4ee76d[_0x7a4a('0x31')]=_[_0x7a4a('0x33')](db[_0x7a4a('0x45')][_0x7a4a('0x2e')]);_0x4ee76d['query']=_[_0x7a4a('0x33')](_0x8ae300[_0x7a4a('0x32')]);_0x4ee76d[_0x7a4a('0x34')]=_[_0x7a4a('0x35')](_0x4ee76d[_0x7a4a('0x31')],_0x4ee76d[_0x7a4a('0x32')]);_0x5bd7d5[_0x7a4a('0x37')]=_[_0x7a4a('0x35')](_0x4ee76d[_0x7a4a('0x31')],qs['fields'](_0x8ae300[_0x7a4a('0x32')]['fields']));_0x5bd7d5[_0x7a4a('0x37')]=_0x5bd7d5['attributes']['length']?_0x5bd7d5[_0x7a4a('0x37')]:_0x4ee76d[_0x7a4a('0x31')];if(_0x8ae300[_0x7a4a('0x32')][_0x7a4a('0x40')]){_0x5bd7d5[_0x7a4a('0x41')]=[{'all':!![]}];}_0x5bd7d5=_['merge']({},_0x5bd7d5,_0x8ae300[_0x7a4a('0x46')]);return db[_0x7a4a('0x45')][_0x7a4a('0x47')](_0x5bd7d5)[_0x7a4a('0x27')](handleEntityNotFound(_0x372065,null))['then'](respondWithResult(_0x372065,null))[_0x7a4a('0x43')](handleError(_0x372065,null));};exports[_0x7a4a('0x48')]=function(_0x13f6c5,_0x1a61b6){return db[_0x7a4a('0x45')][_0x7a4a('0x48')](_0x13f6c5[_0x7a4a('0x49')],{})['then'](respondWithResult(_0x1a61b6,0xc9))[_0x7a4a('0x43')](handleError(_0x1a61b6,null));};exports['update']=function(_0x3add9d,_0x4b0447){if(_0x3add9d[_0x7a4a('0x49')]['id']){delete _0x3add9d[_0x7a4a('0x49')]['id'];}return db[_0x7a4a('0x45')][_0x7a4a('0x47')]({'where':{'id':_0x3add9d[_0x7a4a('0x44')]['id']}})[_0x7a4a('0x27')](handleEntityNotFound(_0x4b0447,null))[_0x7a4a('0x27')](saveUpdates(_0x3add9d[_0x7a4a('0x49')],null))[_0x7a4a('0x27')](respondWithResult(_0x4b0447,null))[_0x7a4a('0x43')](handleError(_0x4b0447,null));};exports[_0x7a4a('0x28')]=function(_0x3a2ad8,_0x3db6dd){return db['ZendeskField']['find']({'where':{'id':_0x3a2ad8[_0x7a4a('0x44')]['id']}})[_0x7a4a('0x27')](handleEntityNotFound(_0x3db6dd,null))[_0x7a4a('0x27')](removeEntity(_0x3db6dd,null))[_0x7a4a('0x43')](handleError(_0x3db6dd,null));};
\ No newline at end of file
+var _0x39b0=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','findAll','catch','rawAttributes','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ZendeskField','key','model','query'];(function(_0x44a64f,_0x38475c){var _0x52024b=function(_0x2cd055){while(--_0x2cd055){_0x44a64f['push'](_0x44a64f['shift']());}};_0x52024b(++_0x38475c);}(_0x39b0,0x152));var _0x039b=function(_0x5a470f,_0x1ec705){_0x5a470f=_0x5a470f-0x0;var _0x32a1f7=_0x39b0[_0x5a470f];return _0x32a1f7;};'use strict';var emlformat=require(_0x039b('0x0'));var rimraf=require(_0x039b('0x1'));var zipdir=require(_0x039b('0x2'));var jsonpatch=require(_0x039b('0x3'));var rp=require(_0x039b('0x4'));var moment=require(_0x039b('0x5'));var BPromise=require(_0x039b('0x6'));var Mustache=require(_0x039b('0x7'));var util=require(_0x039b('0x8'));var path=require(_0x039b('0x9'));var sox=require(_0x039b('0xa'));var csv=require(_0x039b('0xb'));var ejs=require(_0x039b('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x039b('0xd'));var squel=require(_0x039b('0xe'));var crypto=require(_0x039b('0xf'));var jsforce=require(_0x039b('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x039b('0xb'));var querystring=require(_0x039b('0x11'));var Papa=require('papaparse');var Redis=require(_0x039b('0x12'));var authService=require(_0x039b('0x13'));var qs=require(_0x039b('0x14'));var as=require(_0x039b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x039b('0x16'));var utils=require(_0x039b('0x17'));var config=require(_0x039b('0x18'));var licenseUtil=require(_0x039b('0x19'));var db=require(_0x039b('0x1a'))['db'];function respondWithStatusCode(_0x5ee217,_0x45c31f){_0x45c31f=_0x45c31f||0xcc;return function(_0x59288c){if(_0x59288c){return _0x5ee217[_0x039b('0x1b')](_0x45c31f);}return _0x5ee217[_0x039b('0x1c')](_0x45c31f)[_0x039b('0x1d')]();};}function respondWithResult(_0x52a884,_0x56c1ed){_0x56c1ed=_0x56c1ed||0xc8;return function(_0x5a4e4b){if(_0x5a4e4b){return _0x52a884[_0x039b('0x1c')](_0x56c1ed)[_0x039b('0x1e')](_0x5a4e4b);}};}function respondWithFilteredResult(_0x32642e,_0x97713e){return function(_0x442d7d){if(_0x442d7d){var _0x4fef95=typeof _0x97713e[_0x039b('0x1f')]===_0x039b('0x20')&&typeof _0x97713e[_0x039b('0x21')]===_0x039b('0x20');var _0x1724de=_0x442d7d['count'];var _0x58ca6e=_0x4fef95?0x0:_0x97713e[_0x039b('0x1f')];var _0xa58efc=_0x4fef95?_0x442d7d['count']:_0x97713e[_0x039b('0x1f')]+_0x97713e[_0x039b('0x21')];var _0x2ec459;if(_0xa58efc>=_0x1724de){_0xa58efc=_0x1724de;_0x2ec459=0xc8;}else{_0x2ec459=0xce;}_0x32642e[_0x039b('0x1c')](_0x2ec459);return _0x32642e[_0x039b('0x22')](_0x039b('0x23'),_0x58ca6e+'-'+_0xa58efc+'/'+_0x1724de)[_0x039b('0x1e')](_0x442d7d);}return null;};}function patchUpdates(_0x3a5b56){return function(_0x5609c9){try{jsonpatch[_0x039b('0x24')](_0x5609c9,_0x3a5b56,!![]);}catch(_0x3df483){return BPromise[_0x039b('0x25')](_0x3df483);}return _0x5609c9[_0x039b('0x26')]();};}function saveUpdates(_0x186074,_0x420444){return function(_0x579a75){if(_0x579a75){return _0x579a75[_0x039b('0x27')](_0x186074)[_0x039b('0x28')](function(_0x1ee88b){return _0x1ee88b;});}return null;};}function removeEntity(_0x538424,_0x1c896d){return function(_0x16aee3){if(_0x16aee3){return _0x16aee3[_0x039b('0x29')]()[_0x039b('0x28')](function(){_0x538424[_0x039b('0x1c')](0xcc)[_0x039b('0x1d')]();});}};}function handleEntityNotFound(_0x290a95,_0x4d2b05){return function(_0x5b1dc6){if(!_0x5b1dc6){_0x290a95['sendStatus'](0x194);}return _0x5b1dc6;};}function handleError(_0x1d3d2f,_0x20ffce){_0x20ffce=_0x20ffce||0x1f4;return function(_0x16ec29){logger[_0x039b('0x2a')](_0x16ec29[_0x039b('0x2b')]);if(_0x16ec29[_0x039b('0x2c')]){delete _0x16ec29[_0x039b('0x2c')];}_0x1d3d2f[_0x039b('0x1c')](_0x20ffce)[_0x039b('0x2d')](_0x16ec29);};}exports[_0x039b('0x2e')]=function(_0x591fc0,_0x592d11){var _0x301078={},_0x4a4282={},_0x2756fa={'count':0x0,'rows':[]};var _0x124fdc=_[_0x039b('0x2f')](db[_0x039b('0x30')]['rawAttributes'],function(_0x2dd2c3){return{'name':_0x2dd2c3['fieldName'],'type':_0x2dd2c3['type'][_0x039b('0x31')]};});_0x4a4282[_0x039b('0x32')]=_['map'](_0x124fdc,'name');_0x4a4282[_0x039b('0x33')]=_[_0x039b('0x34')](_0x591fc0[_0x039b('0x33')]);_0x4a4282[_0x039b('0x35')]=_[_0x039b('0x36')](_0x4a4282[_0x039b('0x32')],_0x4a4282[_0x039b('0x33')]);_0x301078[_0x039b('0x37')]=_[_0x039b('0x36')](_0x4a4282[_0x039b('0x32')],qs[_0x039b('0x38')](_0x591fc0['query'][_0x039b('0x38')]));_0x301078[_0x039b('0x37')]=_0x301078['attributes'][_0x039b('0x39')]?_0x301078[_0x039b('0x37')]:_0x4a4282['model'];if(!_0x591fc0[_0x039b('0x33')][_0x039b('0x3a')](_0x039b('0x3b'))){_0x301078[_0x039b('0x21')]=qs[_0x039b('0x21')](_0x591fc0[_0x039b('0x33')][_0x039b('0x21')]);_0x301078[_0x039b('0x1f')]=qs['offset'](_0x591fc0[_0x039b('0x33')][_0x039b('0x1f')]);}_0x301078['order']=qs[_0x039b('0x3c')](_0x591fc0[_0x039b('0x33')][_0x039b('0x3c')]);_0x301078[_0x039b('0x3d')]=qs[_0x039b('0x35')](_[_0x039b('0x3e')](_0x591fc0[_0x039b('0x33')],_0x4a4282[_0x039b('0x35')]),_0x124fdc);if(_0x591fc0[_0x039b('0x33')][_0x039b('0x3f')]){_0x301078['where']=_[_0x039b('0x40')](_0x301078[_0x039b('0x3d')],{'$or':_[_0x039b('0x2f')](_0x124fdc,function(_0x3baaea){if(_0x3baaea[_0x039b('0x41')]!==_0x039b('0x42')){var _0x52ecba={};_0x52ecba[_0x3baaea[_0x039b('0x2c')]]={'$like':'%'+_0x591fc0[_0x039b('0x33')][_0x039b('0x3f')]+'%'};return _0x52ecba;}})});}_0x301078=_['merge']({},_0x301078,_0x591fc0[_0x039b('0x43')]);var _0x1a5ad6={'where':_0x301078[_0x039b('0x3d')]};return db[_0x039b('0x30')]['count'](_0x1a5ad6)[_0x039b('0x28')](function(_0x4a22a6){_0x2756fa[_0x039b('0x44')]=_0x4a22a6;if(_0x591fc0[_0x039b('0x33')][_0x039b('0x45')]){_0x301078[_0x039b('0x46')]=[{'all':!![]}];}return db[_0x039b('0x30')][_0x039b('0x47')](_0x301078);})[_0x039b('0x28')](function(_0x2e74e5){_0x2756fa['rows']=_0x2e74e5;return _0x2756fa;})[_0x039b('0x28')](respondWithFilteredResult(_0x592d11,_0x301078))[_0x039b('0x48')](handleError(_0x592d11,null));};exports['show']=function(_0x453599,_0x460d17){var _0x467462={'raw':!![],'where':{'id':_0x453599['params']['id']}},_0x4b11c9={};_0x4b11c9[_0x039b('0x32')]=_['keys'](db[_0x039b('0x30')][_0x039b('0x49')]);_0x4b11c9[_0x039b('0x33')]=_['keys'](_0x453599[_0x039b('0x33')]);_0x4b11c9['filters']=_[_0x039b('0x36')](_0x4b11c9[_0x039b('0x32')],_0x4b11c9['query']);_0x467462[_0x039b('0x37')]=_['intersection'](_0x4b11c9[_0x039b('0x32')],qs[_0x039b('0x38')](_0x453599[_0x039b('0x33')][_0x039b('0x38')]));_0x467462[_0x039b('0x37')]=_0x467462[_0x039b('0x37')][_0x039b('0x39')]?_0x467462['attributes']:_0x4b11c9['model'];if(_0x453599[_0x039b('0x33')]['includeAll']){_0x467462['include']=[{'all':!![]}];}_0x467462=_[_0x039b('0x40')]({},_0x467462,_0x453599['options']);return db[_0x039b('0x30')]['find'](_0x467462)[_0x039b('0x28')](handleEntityNotFound(_0x460d17,null))[_0x039b('0x28')](respondWithResult(_0x460d17,null))['catch'](handleError(_0x460d17,null));};exports[_0x039b('0x4a')]=function(_0x46f7aa,_0x37e3fe){return db[_0x039b('0x30')]['create'](_0x46f7aa[_0x039b('0x4b')],{})[_0x039b('0x28')](respondWithResult(_0x37e3fe,0xc9))[_0x039b('0x48')](handleError(_0x37e3fe,null));};exports['update']=function(_0xf4ec69,_0x28bb1a){if(_0xf4ec69[_0x039b('0x4b')]['id']){delete _0xf4ec69[_0x039b('0x4b')]['id'];}return db[_0x039b('0x30')][_0x039b('0x4c')]({'where':{'id':_0xf4ec69[_0x039b('0x4d')]['id']}})[_0x039b('0x28')](handleEntityNotFound(_0x28bb1a,null))['then'](saveUpdates(_0xf4ec69['body'],null))[_0x039b('0x28')](respondWithResult(_0x28bb1a,null))[_0x039b('0x48')](handleError(_0x28bb1a,null));};exports['destroy']=function(_0x4d5a69,_0x113f0e){return db['ZendeskField'][_0x039b('0x4c')]({'where':{'id':_0x4d5a69['params']['id']}})[_0x039b('0x28')](handleEntityNotFound(_0x113f0e,null))[_0x039b('0x28')](removeEntity(_0x113f0e,null))[_0x039b('0x48')](handleError(_0x113f0e,null));};
\ No newline at end of file
index c21090f..5d4cd61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4252=['util','moment','bluebird','request-promise','rimraf','../../config/environment','define','ZendeskField','int_zendesk_fields','FieldId','lodash'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x4252,0x11d));var _0x2425=function(_0x4e8a27,_0x30059a){_0x4e8a27=_0x4e8a27-0x0;var _0x2dc5e4=_0x4252[_0x4e8a27];return _0x2dc5e4;};'use strict';var _=require(_0x2425('0x0'));var util=require(_0x2425('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2425('0x2'));var BPromise=require(_0x2425('0x3'));var rp=require(_0x2425('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2425('0x5'));var config=require(_0x2425('0x6'));var attributes=require('./intZendeskField.attributes');module['exports']=function(_0x49202d,_0x43426e){return _0x49202d[_0x2425('0x7')](_0x2425('0x8'),attributes,{'tableName':_0x2425('0x9'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':['idField',_0x2425('0xa')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7931=['api','bluebird','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','int_zendesk_fields','zendesk_unique_index','idField','FieldId','../../config/logger'];(function(_0x5989e9,_0xef6905){var _0xac49f2=function(_0xa5ab7c){while(--_0xa5ab7c){_0x5989e9['push'](_0x5989e9['shift']());}};_0xac49f2(++_0xef6905);}(_0x7931,0x103));var _0x1793=function(_0x148786,_0x75e80e){_0x148786=_0x148786-0x0;var _0x3f2cd5=_0x7931[_0x148786];return _0x3f2cd5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1793('0x0'))(_0x1793('0x1'));var moment=require('moment');var BPromise=require(_0x1793('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1793('0x3'));var rimraf=require(_0x1793('0x4'));var config=require(_0x1793('0x5'));var attributes=require(_0x1793('0x6'));module[_0x1793('0x7')]=function(_0x4d5426,_0x4fc157){return _0x4d5426[_0x1793('0x8')]('ZendeskField',attributes,{'tableName':_0x1793('0x9'),'paranoid':![],'indexes':[{'name':_0x1793('0xa'),'fields':[_0x1793('0xb'),_0x1793('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index d815b62..0804353 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe7c7=['ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','error','ZendeskField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','debug'];(function(_0x43b69d,_0x402b03){var _0x3ee8e2=function(_0x5add10){while(--_0x5add10){_0x43b69d['push'](_0x43b69d['shift']());}};_0x3ee8e2(++_0x402b03);}(_0xe7c7,0x85));var _0x7e7c=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xe7c7[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require(_0x7e7c('0x0'));var util=require(_0x7e7c('0x1'));var moment=require(_0x7e7c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7e7c('0x3'));var db=require(_0x7e7c('0x4'))['db'];var utils=require(_0x7e7c('0x5'));var logger=require(_0x7e7c('0x6'))(_0x7e7c('0x7'));var config=require(_0x7e7c('0x8'));var jayson=require(_0x7e7c('0x9'));var client=jayson[_0x7e7c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f73c8,_0x1eb4b7,_0x3856f1){return new BPromise(function(_0x40c2cb,_0x521354){return client[_0x7e7c('0xb')](_0x3f73c8,_0x3856f1)['then'](function(_0x53972e){logger[_0x7e7c('0xc')]('ZendeskField,\x20%s,\x20%s',_0x1eb4b7,'request\x20sent');logger[_0x7e7c('0xd')](_0x7e7c('0xe'),_0x1eb4b7,_0x7e7c('0xf'),JSON['stringify'](_0x53972e));if(_0x53972e[_0x7e7c('0x10')]){if(_0x53972e[_0x7e7c('0x10')]['code']===0x1f4){logger[_0x7e7c('0x10')](_0x7e7c('0x11'),_0x1eb4b7,_0x53972e[_0x7e7c('0x10')][_0x7e7c('0x12')]);return _0x521354(_0x53972e['error'][_0x7e7c('0x12')]);}logger[_0x7e7c('0x10')]('ZendeskField,\x20%s,\x20%s',_0x1eb4b7,_0x53972e[_0x7e7c('0x10')][_0x7e7c('0x12')]);return _0x40c2cb(_0x53972e[_0x7e7c('0x10')][_0x7e7c('0x12')]);}else{logger[_0x7e7c('0xc')]('ZendeskField,\x20%s,\x20%s',_0x1eb4b7,_0x7e7c('0xf'));_0x40c2cb(_0x53972e[_0x7e7c('0x13')][_0x7e7c('0x12')]);}})[_0x7e7c('0x14')](function(_0x303b7e){logger[_0x7e7c('0x10')](_0x7e7c('0x11'),_0x1eb4b7,_0x303b7e);_0x521354(_0x303b7e);});});}
\ No newline at end of file
+var _0x334d=['debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ZendeskField,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x39fcb0,_0x37e650){var _0x3f01d3=function(_0x28c018){while(--_0x28c018){_0x39fcb0['push'](_0x39fcb0['shift']());}};_0x3f01d3(++_0x37e650);}(_0x334d,0x1a8));var _0xd334=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x334d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd334('0x0'));var util=require('util');var moment=require(_0xd334('0x1'));var BPromise=require(_0xd334('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd334('0x3'))['db'];var utils=require(_0xd334('0x4'));var logger=require(_0xd334('0x5'))(_0xd334('0x6'));var config=require('../../config/environment');var jayson=require(_0xd334('0x7'));var client=jayson[_0xd334('0x8')][_0xd334('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x39fd3b,_0x2e4fdb,_0x5c3b24){return new BPromise(function(_0x1e0139,_0x204798){return client[_0xd334('0xa')](_0x39fd3b,_0x5c3b24)[_0xd334('0xb')](function(_0x32eec3){logger[_0xd334('0xc')]('ZendeskField,\x20%s,\x20%s',_0x2e4fdb,'request\x20sent');logger[_0xd334('0xd')](_0xd334('0xe'),_0x2e4fdb,_0xd334('0xf'),JSON[_0xd334('0x10')](_0x32eec3));if(_0x32eec3[_0xd334('0x11')]){if(_0x32eec3[_0xd334('0x11')][_0xd334('0x12')]===0x1f4){logger[_0xd334('0x11')](_0xd334('0x13'),_0x2e4fdb,_0x32eec3[_0xd334('0x11')][_0xd334('0x14')]);return _0x204798(_0x32eec3[_0xd334('0x11')][_0xd334('0x14')]);}logger['error'](_0xd334('0x13'),_0x2e4fdb,_0x32eec3[_0xd334('0x11')][_0xd334('0x14')]);return _0x1e0139(_0x32eec3[_0xd334('0x11')][_0xd334('0x14')]);}else{logger[_0xd334('0xc')](_0xd334('0x13'),_0x2e4fdb,'request\x20sent');_0x1e0139(_0x32eec3[_0xd334('0x15')][_0xd334('0x14')]);}})[_0xd334('0x16')](function(_0xd8578d){logger[_0xd334('0x11')](_0xd334('0x13'),_0x2e4fdb,_0xd8578d);_0x204798(_0xd8578d);});});}
\ No newline at end of file
index ab805ac..449213d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc9b=['../../components/auth/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0xe8e91,_0x401ca3){var _0x1258fe=function(_0x45ac8a){while(--_0x45ac8a){_0xe8e91['push'](_0xe8e91['shift']());}};_0x1258fe(++_0x401ca3);}(_0xcc9b,0xc0));var _0xbcc9=function(_0x1e9d15,_0x93191d){_0x1e9d15=_0x1e9d15-0x0;var _0xe5fd61=_0xcc9b[_0x1e9d15];return _0xe5fd61;};'use strict';var multer=require(_0xbcc9('0x0'));var util=require(_0xbcc9('0x1'));var path=require(_0xbcc9('0x2'));var timeout=require(_0xbcc9('0x3'));var express=require('express');var router=express[_0xbcc9('0x4')]();var fs_extra=require(_0xbcc9('0x5'));var auth=require(_0xbcc9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbcc9('0x7'));var controller=require(_0xbcc9('0x8'));router[_0xbcc9('0x9')]('/',auth[_0xbcc9('0xa')](),controller[_0xbcc9('0xb')]);router[_0xbcc9('0x9')](_0xbcc9('0xc'),auth['isAuthenticated'](),controller[_0xbcc9('0xd')]);router[_0xbcc9('0x9')](_0xbcc9('0xe'),auth[_0xbcc9('0xa')](),controller['getConfigurations']);router[_0xbcc9('0x9')](_0xbcc9('0xf'),auth['isAuthenticated'](),controller[_0xbcc9('0x10')]);router[_0xbcc9('0x11')]('/',auth['isAuthenticated'](),controller[_0xbcc9('0x12')]);router[_0xbcc9('0x11')](_0xbcc9('0xe'),auth['isAuthenticated'](),controller['addConfiguration']);router['put']('/:id',auth[_0xbcc9('0xa')](),controller[_0xbcc9('0x13')]);router[_0xbcc9('0x14')](_0xbcc9('0xc'),auth[_0xbcc9('0xa')](),controller['destroy']);module[_0xbcc9('0x15')]=router;
\ No newline at end of file
+var _0x1ab4=['index','get','/:id','show','/:id/configurations','getConfigurations','post','create','addConfiguration','put','update','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1ab4,0xbc));var _0x41ab=function(_0x1d3917,_0x5854a2){_0x1d3917=_0x1d3917-0x0;var _0x3ce09c=_0x1ab4[_0x1d3917];return _0x3ce09c;};'use strict';var multer=require(_0x41ab('0x0'));var util=require(_0x41ab('0x1'));var path=require(_0x41ab('0x2'));var timeout=require(_0x41ab('0x3'));var express=require(_0x41ab('0x4'));var router=express[_0x41ab('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x41ab('0x6'));var interaction=require(_0x41ab('0x7'));var config=require('../../config/environment');var controller=require(_0x41ab('0x8'));router['get']('/',auth[_0x41ab('0x9')](),controller[_0x41ab('0xa')]);router[_0x41ab('0xb')](_0x41ab('0xc'),auth[_0x41ab('0x9')](),controller[_0x41ab('0xd')]);router[_0x41ab('0xb')](_0x41ab('0xe'),auth['isAuthenticated'](),controller[_0x41ab('0xf')]);router[_0x41ab('0xb')]('/:id/fields',auth[_0x41ab('0x9')](),controller['getFields']);router[_0x41ab('0x10')]('/',auth[_0x41ab('0x9')](),controller[_0x41ab('0x11')]);router[_0x41ab('0x10')](_0x41ab('0xe'),auth['isAuthenticated'](),controller[_0x41ab('0x12')]);router[_0x41ab('0x13')]('/:id',auth[_0x41ab('0x9')](),controller[_0x41ab('0x14')]);router['delete'](_0x41ab('0xc'),auth[_0x41ab('0x9')](),controller[_0x41ab('0x15')]);module['exports']=router;
\ No newline at end of file
index e41f00b..ed26eea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x153f=['exports','STRING','sequelize'];(function(_0x5a2285,_0x3212d1){var _0x48f6ed=function(_0x322127){while(--_0x322127){_0x5a2285['push'](_0x5a2285['shift']());}};_0x48f6ed(++_0x3212d1);}(_0x153f,0x15b));var _0xf153=function(_0x44791a,_0x9ce5a2){_0x44791a=_0x44791a-0x0;var _0x1d3a32=_0x153f[_0x44791a];return _0x1d3a32;};'use strict';var Sequelize=require(_0xf153('0x0'));module[_0xf153('0x1')]={'name':{'type':Sequelize[_0xf153('0x2')]},'description':{'type':Sequelize[_0xf153('0x2')]},'host':{'type':Sequelize[_0xf153('0x2')]},'zone':{'type':Sequelize[_0xf153('0x2')]},'clientId':{'type':Sequelize[_0xf153('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xf153('0x2')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0xf153('0x2')]}};
\ No newline at end of file
+var _0x9c44=['STRING'];(function(_0x732d54,_0x5708f4){var _0x55e766=function(_0x1e9b2f){while(--_0x1e9b2f){_0x732d54['push'](_0x732d54['shift']());}};_0x55e766(++_0x5708f4);}(_0x9c44,0x178));var _0x49c4=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x9c44[_0x4d613c];return _0x301fe3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x49c4('0x0')]},'description':{'type':Sequelize[_0x49c4('0x0')]},'host':{'type':Sequelize[_0x49c4('0x0')]},'zone':{'type':Sequelize[_0x49c4('0x0')]},'clientId':{'type':Sequelize[_0x49c4('0x0')]},'clientSecret':{'type':Sequelize[_0x49c4('0x0')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x49c4('0x0')]}};
\ No newline at end of file
index ca04095..13cd790 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c65=['options','ZohoAccount','includeAll','include','rows','catch','find','create','update','body','params','getConfigurations','findOne','ZohoConfiguration','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','clientSecret','serverUrl','code','host','com','slice','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Subject','Description','WhoId','Call_Duration','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','custom_field','picklist','pick_list_values','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','destroy','then','error','stack','name','send','index','map','rawAttributes','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6c65,0x141));var _0x56c6=function(_0x2f421,_0x5144c4){_0x2f421=_0x2f421-0x0;var _0x27b4af=_0x6c65[_0x2f421];return _0x27b4af;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x56c6('0x0'));var zipdir=require(_0x56c6('0x1'));var jsonpatch=require(_0x56c6('0x2'));var rp=require(_0x56c6('0x3'));var moment=require(_0x56c6('0x4'));var BPromise=require(_0x56c6('0x5'));var Mustache=require(_0x56c6('0x6'));var util=require('util');var path=require(_0x56c6('0x7'));var sox=require(_0x56c6('0x8'));var csv=require(_0x56c6('0x9'));var ejs=require(_0x56c6('0xa'));var fs=require('fs');var fs_extra=require(_0x56c6('0xb'));var _=require('lodash');var squel=require(_0x56c6('0xc'));var crypto=require(_0x56c6('0xd'));var jsforce=require(_0x56c6('0xe'));var deskjs=require(_0x56c6('0xf'));var toCsv=require(_0x56c6('0x9'));var querystring=require(_0x56c6('0x10'));var Papa=require('papaparse');var Redis=require(_0x56c6('0x11'));var authService=require(_0x56c6('0x12'));var qs=require(_0x56c6('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x56c6('0x14'));var logger=require(_0x56c6('0x15'))(_0x56c6('0x16'));var utils=require(_0x56c6('0x17'));var config=require(_0x56c6('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x56c6('0x19'))['db'];var integrations=require(_0x56c6('0x1a'));function respondWithStatusCode(_0x1bb9be,_0x257541){_0x257541=_0x257541||0xcc;return function(_0x16185c){if(_0x16185c){return _0x1bb9be[_0x56c6('0x1b')](_0x257541);}return _0x1bb9be[_0x56c6('0x1c')](_0x257541)[_0x56c6('0x1d')]();};}function respondWithResult(_0x593fc6,_0x593fa5){_0x593fa5=_0x593fa5||0xc8;return function(_0x2c52d9){if(_0x2c52d9){return _0x593fc6['status'](_0x593fa5)[_0x56c6('0x1e')](_0x2c52d9);}};}function respondWithFilteredResult(_0x441aed,_0x2bd322){return function(_0x195a21){if(_0x195a21){var _0x402e9b=typeof _0x2bd322[_0x56c6('0x1f')]==='undefined'&&typeof _0x2bd322[_0x56c6('0x20')]===_0x56c6('0x21');var _0x39b87c=_0x195a21['count'];var _0xe734d=_0x402e9b?0x0:_0x2bd322[_0x56c6('0x1f')];var _0x65e143=_0x402e9b?_0x195a21[_0x56c6('0x22')]:_0x2bd322[_0x56c6('0x1f')]+_0x2bd322[_0x56c6('0x20')];var _0x4a7738;if(_0x65e143>=_0x39b87c){_0x65e143=_0x39b87c;_0x4a7738=0xc8;}else{_0x4a7738=0xce;}_0x441aed[_0x56c6('0x1c')](_0x4a7738);return _0x441aed[_0x56c6('0x23')]('Content-Range',_0xe734d+'-'+_0x65e143+'/'+_0x39b87c)[_0x56c6('0x1e')](_0x195a21);}return null;};}function patchUpdates(_0xbf3baa){return function(_0x43a277){try{jsonpatch[_0x56c6('0x24')](_0x43a277,_0xbf3baa,!![]);}catch(_0x2595d3){return BPromise[_0x56c6('0x25')](_0x2595d3);}return _0x43a277[_0x56c6('0x26')]();};}function saveUpdates(_0x4f3996,_0x38d9b7){return function(_0x47fc77){if(_0x47fc77){return _0x47fc77['update'](_0x4f3996)['then'](function(_0x25c91d){return _0x25c91d;});}return null;};}function removeEntity(_0x24e17e,_0x25e2fa){return function(_0x243fc4){if(_0x243fc4){return _0x243fc4[_0x56c6('0x27')]()[_0x56c6('0x28')](function(){_0x24e17e[_0x56c6('0x1c')](0xcc)[_0x56c6('0x1d')]();});}};}function handleEntityNotFound(_0x2a0107,_0x210a0e){return function(_0xef867){if(!_0xef867){_0x2a0107[_0x56c6('0x1b')](0x194);}return _0xef867;};}function handleError(_0x5350b9,_0x4abcbc){_0x4abcbc=_0x4abcbc||0x1f4;return function(_0x30a5b4){logger[_0x56c6('0x29')](_0x30a5b4[_0x56c6('0x2a')]);if(_0x30a5b4[_0x56c6('0x2b')]){delete _0x30a5b4[_0x56c6('0x2b')];}_0x5350b9[_0x56c6('0x1c')](_0x4abcbc)[_0x56c6('0x2c')](_0x30a5b4);};}exports[_0x56c6('0x2d')]=function(_0x541194,_0x25cc20){var _0x318e4f={},_0x24b888={},_0x4e12e6={'count':0x0,'rows':[]};var _0x3ed8f5=_[_0x56c6('0x2e')](db['ZohoAccount'][_0x56c6('0x2f')],function(_0x1ed58e){return{'name':_0x1ed58e['fieldName'],'type':_0x1ed58e['type'][_0x56c6('0x30')]};});_0x24b888[_0x56c6('0x31')]=_[_0x56c6('0x2e')](_0x3ed8f5,_0x56c6('0x2b'));_0x24b888['query']=_[_0x56c6('0x32')](_0x541194[_0x56c6('0x33')]);_0x24b888[_0x56c6('0x34')]=_[_0x56c6('0x35')](_0x24b888[_0x56c6('0x31')],_0x24b888[_0x56c6('0x33')]);_0x318e4f['attributes']=_[_0x56c6('0x35')](_0x24b888[_0x56c6('0x31')],qs[_0x56c6('0x36')](_0x541194['query'][_0x56c6('0x36')]));_0x318e4f['attributes']=_0x318e4f[_0x56c6('0x37')][_0x56c6('0x38')]?_0x318e4f[_0x56c6('0x37')]:_0x24b888[_0x56c6('0x31')];if(!_0x541194[_0x56c6('0x33')][_0x56c6('0x39')]('nolimit')){_0x318e4f[_0x56c6('0x20')]=qs['limit'](_0x541194[_0x56c6('0x33')][_0x56c6('0x20')]);_0x318e4f[_0x56c6('0x1f')]=qs['offset'](_0x541194[_0x56c6('0x33')]['offset']);}_0x318e4f[_0x56c6('0x3a')]=qs[_0x56c6('0x3b')](_0x541194[_0x56c6('0x33')]['sort']);_0x318e4f[_0x56c6('0x3c')]=qs[_0x56c6('0x34')](_[_0x56c6('0x3d')](_0x541194[_0x56c6('0x33')],_0x24b888[_0x56c6('0x34')]),_0x3ed8f5);if(_0x541194[_0x56c6('0x33')][_0x56c6('0x3e')]){_0x318e4f[_0x56c6('0x3c')]=_[_0x56c6('0x3f')](_0x318e4f[_0x56c6('0x3c')],{'$or':_[_0x56c6('0x2e')](_0x3ed8f5,function(_0x11773d){if(_0x11773d[_0x56c6('0x40')]!==_0x56c6('0x41')){var _0x169eef={};_0x169eef[_0x11773d[_0x56c6('0x2b')]]={'$like':'%'+_0x541194[_0x56c6('0x33')]['filter']+'%'};return _0x169eef;}})});}_0x318e4f=_[_0x56c6('0x3f')]({},_0x318e4f,_0x541194[_0x56c6('0x42')]);var _0x45a1a0={'where':_0x318e4f['where']};return db[_0x56c6('0x43')][_0x56c6('0x22')](_0x45a1a0)[_0x56c6('0x28')](function(_0x292f52){_0x4e12e6['count']=_0x292f52;if(_0x541194[_0x56c6('0x33')][_0x56c6('0x44')]){_0x318e4f[_0x56c6('0x45')]=[{'all':!![]}];}return db[_0x56c6('0x43')]['findAll'](_0x318e4f);})[_0x56c6('0x28')](function(_0x43cd32){_0x4e12e6[_0x56c6('0x46')]=_0x43cd32;return _0x4e12e6;})[_0x56c6('0x28')](respondWithFilteredResult(_0x25cc20,_0x318e4f))[_0x56c6('0x47')](handleError(_0x25cc20,null));};exports['show']=function(_0x349cfe,_0x4a950d){var _0x5b3844={'raw':![],'where':{'id':_0x349cfe['params']['id']}},_0x3bcd84={};_0x3bcd84[_0x56c6('0x31')]=_['keys'](db[_0x56c6('0x43')][_0x56c6('0x2f')]);_0x3bcd84['query']=_[_0x56c6('0x32')](_0x349cfe[_0x56c6('0x33')]);_0x3bcd84[_0x56c6('0x34')]=_[_0x56c6('0x35')](_0x3bcd84[_0x56c6('0x31')],_0x3bcd84[_0x56c6('0x33')]);_0x5b3844[_0x56c6('0x37')]=_['intersection'](_0x3bcd84[_0x56c6('0x31')],qs[_0x56c6('0x36')](_0x349cfe[_0x56c6('0x33')][_0x56c6('0x36')]));_0x5b3844['attributes']=_0x5b3844['attributes']['length']?_0x5b3844[_0x56c6('0x37')]:_0x3bcd84['model'];if(_0x349cfe[_0x56c6('0x33')][_0x56c6('0x44')]){_0x5b3844[_0x56c6('0x45')]=[{'all':!![]}];}_0x5b3844=_['merge']({},_0x5b3844,_0x349cfe[_0x56c6('0x42')]);return db['ZohoAccount'][_0x56c6('0x48')](_0x5b3844)['then'](handleEntityNotFound(_0x4a950d,null))[_0x56c6('0x28')](respondWithResult(_0x4a950d,null))['catch'](handleError(_0x4a950d,null));};exports[_0x56c6('0x49')]=function(_0x14f919,_0xa84b6a){return db['ZohoAccount']['create'](_0x14f919['body'],{})[_0x56c6('0x28')](respondWithResult(_0xa84b6a,0xc9))['catch'](handleError(_0xa84b6a,null));};exports[_0x56c6('0x4a')]=function(_0x4cd99e,_0x2b6a78){if(_0x4cd99e['body']['id']){delete _0x4cd99e[_0x56c6('0x4b')]['id'];}return db[_0x56c6('0x43')][_0x56c6('0x48')]({'where':{'id':_0x4cd99e[_0x56c6('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2b6a78,null))[_0x56c6('0x28')](saveUpdates(_0x4cd99e[_0x56c6('0x4b')],null))[_0x56c6('0x28')](respondWithResult(_0x2b6a78,null))[_0x56c6('0x47')](handleError(_0x2b6a78,null));};exports['destroy']=function(_0x213aa9,_0x2971f9){return db[_0x56c6('0x43')]['find']({'where':{'id':_0x213aa9['params']['id']}})[_0x56c6('0x28')](handleEntityNotFound(_0x2971f9,null))[_0x56c6('0x28')](removeEntity(_0x2971f9,null))[_0x56c6('0x47')](handleError(_0x2971f9,null));};exports[_0x56c6('0x4d')]=function(_0x18dddb,_0x5871a6,_0x1b1f3f){var _0x28cac0={};var _0x32fd1f={};var _0x933ee5;var _0x3b74cc;return db[_0x56c6('0x43')][_0x56c6('0x4e')]({'where':{'id':_0x18dddb[_0x56c6('0x4c')]['id']}})[_0x56c6('0x28')](handleEntityNotFound(_0x5871a6,null))[_0x56c6('0x28')](function(_0x5d5dd0){if(_0x5d5dd0){_0x933ee5=_0x5d5dd0;_0x32fd1f[_0x56c6('0x31')]=_['keys'](db[_0x56c6('0x4f')][_0x56c6('0x2f')]);_0x32fd1f[_0x56c6('0x33')]=_[_0x56c6('0x32')](_0x18dddb[_0x56c6('0x33')]);_0x32fd1f[_0x56c6('0x34')]=_[_0x56c6('0x35')](_0x32fd1f[_0x56c6('0x31')],_0x32fd1f[_0x56c6('0x33')]);_0x28cac0[_0x56c6('0x37')]=_[_0x56c6('0x35')](_0x32fd1f[_0x56c6('0x31')],qs[_0x56c6('0x36')](_0x18dddb[_0x56c6('0x33')]['fields']));_0x28cac0[_0x56c6('0x37')]=_0x28cac0[_0x56c6('0x37')][_0x56c6('0x38')]?_0x28cac0[_0x56c6('0x37')]:_0x32fd1f[_0x56c6('0x31')];_0x28cac0[_0x56c6('0x3a')]=qs[_0x56c6('0x3b')](_0x18dddb[_0x56c6('0x33')]['sort']);_0x28cac0[_0x56c6('0x3c')]=qs[_0x56c6('0x34')](_[_0x56c6('0x3d')](_0x18dddb[_0x56c6('0x33')],_0x32fd1f[_0x56c6('0x34')]));if(_0x18dddb[_0x56c6('0x33')]['filter']){_0x28cac0[_0x56c6('0x3c')]=_[_0x56c6('0x3f')](_0x28cac0[_0x56c6('0x3c')],{'$or':_[_0x56c6('0x2e')](_0x28cac0['attributes'],function(_0x27df76){var _0x77ac16={};_0x77ac16[_0x27df76]={'$like':'%'+_0x18dddb['query'][_0x56c6('0x3e')]+'%'};return _0x77ac16;})});}_0x28cac0=_[_0x56c6('0x3f')]({},_0x28cac0,_0x18dddb[_0x56c6('0x42')]);return _0x933ee5[_0x56c6('0x4d')](_0x28cac0);}})[_0x56c6('0x28')](function(_0x20387e){if(_0x20387e){_0x3b74cc=_0x20387e[_0x56c6('0x38')];if(!_0x18dddb['query'][_0x56c6('0x39')]('nolimit')){_0x28cac0[_0x56c6('0x20')]=qs[_0x56c6('0x20')](_0x18dddb[_0x56c6('0x33')][_0x56c6('0x20')]);_0x28cac0[_0x56c6('0x1f')]=qs[_0x56c6('0x1f')](_0x18dddb[_0x56c6('0x33')]['offset']);}return _0x933ee5['getConfigurations'](_0x28cac0);}})[_0x56c6('0x28')](function(_0x138931){if(_0x138931){return _0x138931?{'count':_0x3b74cc,'rows':_0x138931}:null;}})['then'](respondWithResult(_0x5871a6,null))[_0x56c6('0x47')](handleError(_0x5871a6,null));};exports[_0x56c6('0x50')]=function(_0x27cd6d,_0x4dc407,_0x4dc5bd){if(_0x27cd6d[_0x56c6('0x4b')]['id']){delete _0x27cd6d[_0x56c6('0x4b')]['id'];}return db[_0x56c6('0x43')]['findOne']({'where':{'id':_0x27cd6d['params']['id']}})['then'](handleEntityNotFound(_0x4dc407,null))['then'](function(_0x1a7855){if(_0x1a7855){_0x27cd6d['body']['AccountId']=_0x1a7855['id'];_0x27cd6d['body'][_0x56c6('0x51')]=integrations[_0x56c6('0x52')](_0x27cd6d['body'][_0x56c6('0x53')],_0x27cd6d[_0x56c6('0x4b')][_0x56c6('0x40')]);_0x27cd6d[_0x56c6('0x4b')][_0x56c6('0x54')]=integrations[_0x56c6('0x55')](_0x27cd6d[_0x56c6('0x4b')][_0x56c6('0x53')],_0x27cd6d[_0x56c6('0x4b')][_0x56c6('0x40')]);return db['ZohoConfiguration'][_0x56c6('0x49')](_0x27cd6d[_0x56c6('0x4b')],{'include':[{'model':db[_0x56c6('0x56')],'as':_0x56c6('0x51')},{'model':db[_0x56c6('0x56')],'as':_0x56c6('0x54')}]});}return null;})[_0x56c6('0x28')](respondWithResult(_0x4dc407,null))[_0x56c6('0x47')](handleError(_0x4dc407,null));};function getAccessToken(_0x33af45){return new Promise(function(_0x221b0e,_0x3fd5de){var _0x2314ec;switch(_0x33af45[_0x56c6('0x57')]){case'US':_0x2314ec='https://accounts.zoho.com';break;case'AU':_0x2314ec=_0x56c6('0x58');break;case'EU':_0x2314ec=_0x56c6('0x59');break;case'IN':_0x2314ec='https://accounts.zoho.in';break;case'CN':_0x2314ec=_0x56c6('0x5a');break;default:_0x2314ec=_0x56c6('0x59');break;}var _0x856ec1={'method':_0x56c6('0x5b'),'uri':_0x2314ec+_0x56c6('0x5c'),'qs':{'refresh_token':_0x33af45[_0x56c6('0x5d')],'client_id':_0x33af45[_0x56c6('0x5e')],'client_secret':_0x33af45['clientSecret'],'grant_type':_0x56c6('0x5f')},'json':!![]};return rp(_0x856ec1)[_0x56c6('0x28')](function(_0x312991){if(_0x312991['access_token']){_0x221b0e(_0x312991[_0x56c6('0x60')]);}else{_0x3fd5de(_0x56c6('0x61'));}})[_0x56c6('0x47')](function(_0x23a4cb){_0x3fd5de(_0x23a4cb);});});}exports[_0x56c6('0x62')]=function(_0xb6925e,_0x1c2827,_0x10af95){var _0x4f6889,_0x398bf0,_0xeca3c1,_0x4d30d0,_0x348bdf;return db[_0x56c6('0x43')][_0x56c6('0x4e')]({'where':{'id':_0xb6925e[_0x56c6('0x4c')]['id']},'attributes':['id','host',_0x56c6('0x57'),'clientId',_0x56c6('0x63'),_0x56c6('0x64'),_0x56c6('0x65'),'refreshToken']})['then'](handleEntityNotFound(_0x1c2827,null))[_0x56c6('0x28')](function(_0x2ff3da){_0x348bdf=_0x2ff3da;_0x4f6889=_0x348bdf[_0x56c6('0x66')];_0x398bf0=_0x4f6889==='zoho.eu'?'eu':_0x56c6('0x67');_0xeca3c1=_0x348bdf[_0x56c6('0x64')];var _0x55673f=_0xeca3c1[_0x56c6('0x68')](-0x1);if(_0x55673f==='/'||_0x55673f==='\x5c'||_0x55673f===':'){_0xeca3c1=_0xeca3c1['substring'](0x0,_0xeca3c1[_0x56c6('0x69')](_0x55673f));}if(!_0x348bdf[_0x56c6('0x5d')]){throw new Error(_0x56c6('0x6a'));}return getAccessToken(_0x348bdf);})[_0x56c6('0x28')](function(_0x1eabdc){if(_0x1eabdc){return rp({'method':'GET','uri':util['format'](_0x56c6('0x6b'),_0x398bf0),'qs':{'module':_0x56c6('0x6c')},'headers':{'Authorization':_0x56c6('0x6d')+_0x1eabdc},'json':!![]});}})[_0x56c6('0x28')](function(_0x2364e3){if(_0x2364e3){if(_0x2364e3[_0x56c6('0x6e')]&&_0x2364e3[_0x56c6('0x6e')][_0x56c6('0x29')]){throw new Error(_0x2364e3[_0x56c6('0x6e')][_0x56c6('0x29')][_0x56c6('0x6f')]);}var _0x13dc14=[];var _0x59fc71=[];var _0x2ad185=['Owner',_0x56c6('0x70'),_0x56c6('0x71'),_0x56c6('0x72'),_0x56c6('0x73'),'Call_Result',_0x56c6('0x74'),_0x56c6('0x75')];_0x59fc71=_[_0x56c6('0x76')](_0x2364e3[_0x56c6('0x36')],function(_0x2fc727){return _0x2ad185[_0x56c6('0x77')](_0x2fc727[_0x56c6('0x78')]);});for(var _0x529ef7=0x0;_0x529ef7<_0x59fc71[_0x56c6('0x38')];_0x529ef7++){if(_0x59fc71[_0x529ef7][_0x56c6('0x79')]===![]){_0x13dc14[_0x56c6('0x7a')]({'id':_0x59fc71[_0x529ef7]['id'],'name':_0x59fc71[_0x529ef7]['display_label'],'custom':_0x59fc71[_0x529ef7][_0x56c6('0x7b')],'options':_0x59fc71[_0x529ef7]['data_type']===_0x56c6('0x7c')&&_0x59fc71[_0x529ef7]['pick_list_values'][_0x56c6('0x38')]>-0x1?_[_0x56c6('0x2e')](_0x59fc71[_0x529ef7][_0x56c6('0x7d')],function(_0x3f2cf6){return{'name':_0x3f2cf6,'value':_0x3f2cf6};}):[]});}}return{'count':_0x13dc14[_0x56c6('0x38')],'rows':_0x13dc14};}else{return{'count':0x0,'rows':[]};}})[_0x56c6('0x28')](respondWithResult(_0x1c2827,null))[_0x56c6('0x47')](function(_0xab190c){var _0x530f1d=_0xb6925e[_0x56c6('0x33')]['test']?0x1f4:_0xab190c['statusCode']||0x1f4;logger[_0x56c6('0x29')](_0x56c6('0x7e'),_0x56c6('0x62'),_0x530f1d,JSON[_0x56c6('0x7f')](_0xab190c));delete _0xab190c[_0x56c6('0x2b')];if(_0x530f1d===0x191){_0x530f1d=0x190;}_0x1c2827[_0x56c6('0x1c')](_0x530f1d)['send'](_0xb6925e[_0x56c6('0x33')]['test']?{'message':_0x56c6('0x80'),'statusCode':_0xab190c['statusCode']}:_0xab190c);});};
\ No newline at end of file
+var _0x0ab1=['create','body','update','params','destroy','getConfigurations','findOne','ZohoConfiguration','pick','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','clientId','serverUrl','code','host','zoho.eu','com','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','response','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields','stringify','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','squel','crypto','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json','offset','limit','count','status','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','rows','catch','ZohoAccount','include','options','find'];(function(_0x2e4ee1,_0x126ca6){var _0x463a2f=function(_0x20b201){while(--_0x20b201){_0x2e4ee1['push'](_0x2e4ee1['shift']());}};_0x463a2f(++_0x126ca6);}(_0x0ab1,0x13f));var _0x10ab=function(_0x335a88,_0x1324a6){_0x335a88=_0x335a88-0x0;var _0x3e1a9e=_0x0ab1[_0x335a88];return _0x3e1a9e;};'use strict';var emlformat=require(_0x10ab('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x10ab('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x10ab('0x2'));var moment=require(_0x10ab('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x10ab('0x4'));var util=require(_0x10ab('0x5'));var path=require(_0x10ab('0x6'));var sox=require(_0x10ab('0x7'));var csv=require(_0x10ab('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x10ab('0x9'));var crypto=require(_0x10ab('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x10ab('0x8'));var querystring=require('querystring');var Papa=require(_0x10ab('0xb'));var Redis=require(_0x10ab('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x10ab('0xd'));var hardwareService=require(_0x10ab('0xe'));var logger=require(_0x10ab('0xf'))(_0x10ab('0x10'));var utils=require(_0x10ab('0x11'));var config=require(_0x10ab('0x12'));var licenseUtil=require(_0x10ab('0x13'));var db=require(_0x10ab('0x14'))['db'];var integrations=require(_0x10ab('0x15'));function respondWithStatusCode(_0x3b35a2,_0x49706a){_0x49706a=_0x49706a||0xcc;return function(_0x4276c4){if(_0x4276c4){return _0x3b35a2[_0x10ab('0x16')](_0x49706a);}return _0x3b35a2['status'](_0x49706a)[_0x10ab('0x17')]();};}function respondWithResult(_0x5bb789,_0x29577c){_0x29577c=_0x29577c||0xc8;return function(_0x5d9412){if(_0x5d9412){return _0x5bb789['status'](_0x29577c)[_0x10ab('0x18')](_0x5d9412);}};}function respondWithFilteredResult(_0x186a00,_0x3ac538){return function(_0x15030e){if(_0x15030e){var _0x7ea84d=typeof _0x3ac538[_0x10ab('0x19')]==='undefined'&&typeof _0x3ac538[_0x10ab('0x1a')]==='undefined';var _0x54fc14=_0x15030e[_0x10ab('0x1b')];var _0x6eec50=_0x7ea84d?0x0:_0x3ac538[_0x10ab('0x19')];var _0x1e4f92=_0x7ea84d?_0x15030e[_0x10ab('0x1b')]:_0x3ac538[_0x10ab('0x19')]+_0x3ac538[_0x10ab('0x1a')];var _0x232f62;if(_0x1e4f92>=_0x54fc14){_0x1e4f92=_0x54fc14;_0x232f62=0xc8;}else{_0x232f62=0xce;}_0x186a00[_0x10ab('0x1c')](_0x232f62);return _0x186a00[_0x10ab('0x1d')](_0x10ab('0x1e'),_0x6eec50+'-'+_0x1e4f92+'/'+_0x54fc14)[_0x10ab('0x18')](_0x15030e);}return null;};}function patchUpdates(_0x331c19){return function(_0x2086f6){try{jsonpatch[_0x10ab('0x1f')](_0x2086f6,_0x331c19,!![]);}catch(_0x8e48e8){return BPromise[_0x10ab('0x20')](_0x8e48e8);}return _0x2086f6[_0x10ab('0x21')]();};}function saveUpdates(_0x5bd78a,_0x507d0b){return function(_0x33ab2d){if(_0x33ab2d){return _0x33ab2d['update'](_0x5bd78a)[_0x10ab('0x22')](function(_0x5f4232){return _0x5f4232;});}return null;};}function removeEntity(_0x411a74,_0x4c6bed){return function(_0x5dc094){if(_0x5dc094){return _0x5dc094['destroy']()['then'](function(){_0x411a74[_0x10ab('0x1c')](0xcc)[_0x10ab('0x17')]();});}};}function handleEntityNotFound(_0x5a359d,_0x3cbc7c){return function(_0x57cdc1){if(!_0x57cdc1){_0x5a359d['sendStatus'](0x194);}return _0x57cdc1;};}function handleError(_0x5b0e18,_0x5cbff6){_0x5cbff6=_0x5cbff6||0x1f4;return function(_0x597b5d){logger[_0x10ab('0x23')](_0x597b5d[_0x10ab('0x24')]);if(_0x597b5d['name']){delete _0x597b5d[_0x10ab('0x25')];}_0x5b0e18['status'](_0x5cbff6)[_0x10ab('0x26')](_0x597b5d);};}exports[_0x10ab('0x27')]=function(_0x332945,_0x4fd93b){var _0x5ed11f={},_0x3c0903={},_0x5dedce={'count':0x0,'rows':[]};var _0x2e86f2=_[_0x10ab('0x28')](db['ZohoAccount'][_0x10ab('0x29')],function(_0x241a67){return{'name':_0x241a67[_0x10ab('0x2a')],'type':_0x241a67[_0x10ab('0x2b')][_0x10ab('0x2c')]};});_0x3c0903[_0x10ab('0x2d')]=_['map'](_0x2e86f2,_0x10ab('0x25'));_0x3c0903[_0x10ab('0x2e')]=_[_0x10ab('0x2f')](_0x332945[_0x10ab('0x2e')]);_0x3c0903[_0x10ab('0x30')]=_['intersection'](_0x3c0903['model'],_0x3c0903[_0x10ab('0x2e')]);_0x5ed11f[_0x10ab('0x31')]=_[_0x10ab('0x32')](_0x3c0903[_0x10ab('0x2d')],qs['fields'](_0x332945[_0x10ab('0x2e')][_0x10ab('0x33')]));_0x5ed11f[_0x10ab('0x31')]=_0x5ed11f[_0x10ab('0x31')][_0x10ab('0x34')]?_0x5ed11f[_0x10ab('0x31')]:_0x3c0903[_0x10ab('0x2d')];if(!_0x332945['query'][_0x10ab('0x35')](_0x10ab('0x36'))){_0x5ed11f[_0x10ab('0x1a')]=qs[_0x10ab('0x1a')](_0x332945[_0x10ab('0x2e')][_0x10ab('0x1a')]);_0x5ed11f[_0x10ab('0x19')]=qs['offset'](_0x332945[_0x10ab('0x2e')]['offset']);}_0x5ed11f[_0x10ab('0x37')]=qs['sort'](_0x332945[_0x10ab('0x2e')][_0x10ab('0x38')]);_0x5ed11f[_0x10ab('0x39')]=qs['filters'](_['pick'](_0x332945[_0x10ab('0x2e')],_0x3c0903[_0x10ab('0x30')]),_0x2e86f2);if(_0x332945[_0x10ab('0x2e')][_0x10ab('0x3a')]){_0x5ed11f['where']=_[_0x10ab('0x3b')](_0x5ed11f['where'],{'$or':_[_0x10ab('0x28')](_0x2e86f2,function(_0xa405e3){if(_0xa405e3['type']!==_0x10ab('0x3c')){var _0x19992b={};_0x19992b[_0xa405e3[_0x10ab('0x25')]]={'$like':'%'+_0x332945['query'][_0x10ab('0x3a')]+'%'};return _0x19992b;}})});}_0x5ed11f=_[_0x10ab('0x3b')]({},_0x5ed11f,_0x332945['options']);var _0x15d84b={'where':_0x5ed11f['where']};return db['ZohoAccount']['count'](_0x15d84b)[_0x10ab('0x22')](function(_0x289648){_0x5dedce[_0x10ab('0x1b')]=_0x289648;if(_0x332945[_0x10ab('0x2e')][_0x10ab('0x3d')]){_0x5ed11f['include']=[{'all':!![]}];}return db['ZohoAccount']['findAll'](_0x5ed11f);})['then'](function(_0x4c92fc){_0x5dedce[_0x10ab('0x3e')]=_0x4c92fc;return _0x5dedce;})['then'](respondWithFilteredResult(_0x4fd93b,_0x5ed11f))[_0x10ab('0x3f')](handleError(_0x4fd93b,null));};exports['show']=function(_0x59e024,_0xe9956){var _0x3dcec2={'raw':![],'where':{'id':_0x59e024['params']['id']}},_0x38bfb4={};_0x38bfb4[_0x10ab('0x2d')]=_['keys'](db[_0x10ab('0x40')][_0x10ab('0x29')]);_0x38bfb4['query']=_[_0x10ab('0x2f')](_0x59e024[_0x10ab('0x2e')]);_0x38bfb4[_0x10ab('0x30')]=_[_0x10ab('0x32')](_0x38bfb4[_0x10ab('0x2d')],_0x38bfb4[_0x10ab('0x2e')]);_0x3dcec2[_0x10ab('0x31')]=_[_0x10ab('0x32')](_0x38bfb4['model'],qs['fields'](_0x59e024[_0x10ab('0x2e')][_0x10ab('0x33')]));_0x3dcec2[_0x10ab('0x31')]=_0x3dcec2[_0x10ab('0x31')]['length']?_0x3dcec2[_0x10ab('0x31')]:_0x38bfb4[_0x10ab('0x2d')];if(_0x59e024[_0x10ab('0x2e')]['includeAll']){_0x3dcec2[_0x10ab('0x41')]=[{'all':!![]}];}_0x3dcec2=_[_0x10ab('0x3b')]({},_0x3dcec2,_0x59e024[_0x10ab('0x42')]);return db['ZohoAccount'][_0x10ab('0x43')](_0x3dcec2)[_0x10ab('0x22')](handleEntityNotFound(_0xe9956,null))[_0x10ab('0x22')](respondWithResult(_0xe9956,null))[_0x10ab('0x3f')](handleError(_0xe9956,null));};exports[_0x10ab('0x44')]=function(_0x45668a,_0x51e80c){return db[_0x10ab('0x40')]['create'](_0x45668a[_0x10ab('0x45')],{})[_0x10ab('0x22')](respondWithResult(_0x51e80c,0xc9))[_0x10ab('0x3f')](handleError(_0x51e80c,null));};exports[_0x10ab('0x46')]=function(_0x37d45f,_0x34795f){if(_0x37d45f[_0x10ab('0x45')]['id']){delete _0x37d45f['body']['id'];}return db[_0x10ab('0x40')]['find']({'where':{'id':_0x37d45f[_0x10ab('0x47')]['id']}})[_0x10ab('0x22')](handleEntityNotFound(_0x34795f,null))[_0x10ab('0x22')](saveUpdates(_0x37d45f[_0x10ab('0x45')],null))['then'](respondWithResult(_0x34795f,null))['catch'](handleError(_0x34795f,null));};exports[_0x10ab('0x48')]=function(_0x18636f,_0x2ab1bd){return db[_0x10ab('0x40')]['find']({'where':{'id':_0x18636f['params']['id']}})[_0x10ab('0x22')](handleEntityNotFound(_0x2ab1bd,null))[_0x10ab('0x22')](removeEntity(_0x2ab1bd,null))[_0x10ab('0x3f')](handleError(_0x2ab1bd,null));};exports[_0x10ab('0x49')]=function(_0xeabb5f,_0x4d4ca0,_0x5548f9){var _0x5d46f3={};var _0x135604={};var _0x5923cc;var _0x39373e;return db[_0x10ab('0x40')][_0x10ab('0x4a')]({'where':{'id':_0xeabb5f[_0x10ab('0x47')]['id']}})[_0x10ab('0x22')](handleEntityNotFound(_0x4d4ca0,null))[_0x10ab('0x22')](function(_0x598040){if(_0x598040){_0x5923cc=_0x598040;_0x135604['model']=_[_0x10ab('0x2f')](db[_0x10ab('0x4b')][_0x10ab('0x29')]);_0x135604[_0x10ab('0x2e')]=_[_0x10ab('0x2f')](_0xeabb5f[_0x10ab('0x2e')]);_0x135604[_0x10ab('0x30')]=_[_0x10ab('0x32')](_0x135604[_0x10ab('0x2d')],_0x135604['query']);_0x5d46f3[_0x10ab('0x31')]=_[_0x10ab('0x32')](_0x135604[_0x10ab('0x2d')],qs[_0x10ab('0x33')](_0xeabb5f[_0x10ab('0x2e')][_0x10ab('0x33')]));_0x5d46f3[_0x10ab('0x31')]=_0x5d46f3['attributes'][_0x10ab('0x34')]?_0x5d46f3[_0x10ab('0x31')]:_0x135604['model'];_0x5d46f3[_0x10ab('0x37')]=qs[_0x10ab('0x38')](_0xeabb5f[_0x10ab('0x2e')][_0x10ab('0x38')]);_0x5d46f3['where']=qs[_0x10ab('0x30')](_[_0x10ab('0x4c')](_0xeabb5f[_0x10ab('0x2e')],_0x135604[_0x10ab('0x30')]));if(_0xeabb5f[_0x10ab('0x2e')][_0x10ab('0x3a')]){_0x5d46f3[_0x10ab('0x39')]=_[_0x10ab('0x3b')](_0x5d46f3[_0x10ab('0x39')],{'$or':_['map'](_0x5d46f3[_0x10ab('0x31')],function(_0x5e08de){var _0x5e1da9={};_0x5e1da9[_0x5e08de]={'$like':'%'+_0xeabb5f[_0x10ab('0x2e')][_0x10ab('0x3a')]+'%'};return _0x5e1da9;})});}_0x5d46f3=_[_0x10ab('0x3b')]({},_0x5d46f3,_0xeabb5f['options']);return _0x5923cc[_0x10ab('0x49')](_0x5d46f3);}})[_0x10ab('0x22')](function(_0x4661dc){if(_0x4661dc){_0x39373e=_0x4661dc[_0x10ab('0x34')];if(!_0xeabb5f['query'][_0x10ab('0x35')](_0x10ab('0x36'))){_0x5d46f3[_0x10ab('0x1a')]=qs[_0x10ab('0x1a')](_0xeabb5f[_0x10ab('0x2e')]['limit']);_0x5d46f3[_0x10ab('0x19')]=qs[_0x10ab('0x19')](_0xeabb5f[_0x10ab('0x2e')][_0x10ab('0x19')]);}return _0x5923cc[_0x10ab('0x49')](_0x5d46f3);}})['then'](function(_0x33a234){if(_0x33a234){return _0x33a234?{'count':_0x39373e,'rows':_0x33a234}:null;}})['then'](respondWithResult(_0x4d4ca0,null))[_0x10ab('0x3f')](handleError(_0x4d4ca0,null));};exports['addConfiguration']=function(_0x43e548,_0x3cb7e7,_0x2fe266){if(_0x43e548[_0x10ab('0x45')]['id']){delete _0x43e548[_0x10ab('0x45')]['id'];}return db[_0x10ab('0x40')][_0x10ab('0x4a')]({'where':{'id':_0x43e548[_0x10ab('0x47')]['id']}})[_0x10ab('0x22')](handleEntityNotFound(_0x3cb7e7,null))[_0x10ab('0x22')](function(_0x3d509c){if(_0x3d509c){_0x43e548[_0x10ab('0x45')]['AccountId']=_0x3d509c['id'];_0x43e548[_0x10ab('0x45')][_0x10ab('0x4d')]=integrations[_0x10ab('0x4e')](_0x43e548['body'][_0x10ab('0x4f')],_0x43e548[_0x10ab('0x45')]['type']);_0x43e548[_0x10ab('0x45')][_0x10ab('0x50')]=integrations[_0x10ab('0x51')](_0x43e548[_0x10ab('0x45')]['channel'],_0x43e548[_0x10ab('0x45')][_0x10ab('0x2b')]);return db[_0x10ab('0x4b')][_0x10ab('0x44')](_0x43e548[_0x10ab('0x45')],{'include':[{'model':db[_0x10ab('0x52')],'as':_0x10ab('0x4d')},{'model':db[_0x10ab('0x52')],'as':_0x10ab('0x50')}]});}return null;})['then'](respondWithResult(_0x3cb7e7,null))[_0x10ab('0x3f')](handleError(_0x3cb7e7,null));};function getAccessToken(_0x4fe550){return new Promise(function(_0x1250c9,_0x1810cb){var _0x5c2538;switch(_0x4fe550[_0x10ab('0x53')]){case'US':_0x5c2538=_0x10ab('0x54');break;case'AU':_0x5c2538=_0x10ab('0x55');break;case'EU':_0x5c2538='https://accounts.zoho.eu';break;case'IN':_0x5c2538=_0x10ab('0x56');break;case'CN':_0x5c2538=_0x10ab('0x57');break;default:_0x5c2538=_0x10ab('0x58');break;}var _0x57efff={'method':_0x10ab('0x59'),'uri':_0x5c2538+_0x10ab('0x5a'),'qs':{'refresh_token':_0x4fe550[_0x10ab('0x5b')],'client_id':_0x4fe550['clientId'],'client_secret':_0x4fe550[_0x10ab('0x5c')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x57efff)[_0x10ab('0x22')](function(_0x4d4d36){if(_0x4d4d36[_0x10ab('0x5d')]){_0x1250c9(_0x4d4d36[_0x10ab('0x5d')]);}else{_0x1810cb(_0x10ab('0x5e'));}})['catch'](function(_0x530338){_0x1810cb(_0x530338);});});}exports['getFields']=function(_0x2cf666,_0x33e940,_0x3ebc92){var _0x78c76a,_0x4a5d11,_0x4b18b9,_0x4558c,_0x3ffc44;return db[_0x10ab('0x40')][_0x10ab('0x4a')]({'where':{'id':_0x2cf666[_0x10ab('0x47')]['id']},'attributes':['id','host','zone',_0x10ab('0x5f'),'clientSecret',_0x10ab('0x60'),_0x10ab('0x61'),'refreshToken']})['then'](handleEntityNotFound(_0x33e940,null))[_0x10ab('0x22')](function(_0x2aa4c6){_0x3ffc44=_0x2aa4c6;_0x78c76a=_0x3ffc44[_0x10ab('0x62')];_0x4a5d11=_0x78c76a===_0x10ab('0x63')?'eu':_0x10ab('0x64');_0x4b18b9=_0x3ffc44[_0x10ab('0x60')];var _0x2ba66d=_0x4b18b9['slice'](-0x1);if(_0x2ba66d==='/'||_0x2ba66d==='\x5c'||_0x2ba66d===':'){_0x4b18b9=_0x4b18b9['substring'](0x0,_0x4b18b9[_0x10ab('0x65')](_0x2ba66d));}if(!_0x3ffc44[_0x10ab('0x5b')]){throw new Error(_0x10ab('0x66'));}return getAccessToken(_0x3ffc44);})[_0x10ab('0x22')](function(_0x42d3bb){if(_0x42d3bb){return rp({'method':'GET','uri':util[_0x10ab('0x67')](_0x10ab('0x68'),_0x4a5d11),'qs':{'module':_0x10ab('0x69')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x42d3bb},'json':!![]});}})[_0x10ab('0x22')](function(_0x1339a6){if(_0x1339a6){if(_0x1339a6[_0x10ab('0x6a')]&&_0x1339a6[_0x10ab('0x6a')][_0x10ab('0x23')]){throw new Error(_0x1339a6[_0x10ab('0x6a')][_0x10ab('0x23')]['message']);}var _0x5d9733=[];var _0x59d71b=[];var _0x115de4=[_0x10ab('0x6b'),_0x10ab('0x6c'),_0x10ab('0x6d'),_0x10ab('0x6e'),_0x10ab('0x6f'),_0x10ab('0x70'),_0x10ab('0x71'),_0x10ab('0x72')];_0x59d71b=_[_0x10ab('0x73')](_0x1339a6[_0x10ab('0x33')],function(_0x3ee00a){return _0x115de4[_0x10ab('0x74')](_0x3ee00a[_0x10ab('0x75')]);});for(var _0x4d46c0=0x0;_0x4d46c0<_0x59d71b[_0x10ab('0x34')];_0x4d46c0++){if(_0x59d71b[_0x4d46c0][_0x10ab('0x76')]===![]){_0x5d9733[_0x10ab('0x77')]({'id':_0x59d71b[_0x4d46c0]['id'],'name':_0x59d71b[_0x4d46c0][_0x10ab('0x78')],'custom':_0x59d71b[_0x4d46c0][_0x10ab('0x79')],'options':_0x59d71b[_0x4d46c0][_0x10ab('0x7a')]===_0x10ab('0x7b')&&_0x59d71b[_0x4d46c0]['pick_list_values']['length']>-0x1?_[_0x10ab('0x28')](_0x59d71b[_0x4d46c0][_0x10ab('0x7c')],function(_0x8ac202){return{'name':_0x8ac202,'value':_0x8ac202};}):[]});}}return{'count':_0x5d9733[_0x10ab('0x34')],'rows':_0x5d9733};}else{return{'count':0x0,'rows':[]};}})[_0x10ab('0x22')](respondWithResult(_0x33e940,null))[_0x10ab('0x3f')](function(_0x37ca97){var _0x39482e=_0x2cf666[_0x10ab('0x2e')][_0x10ab('0x7d')]?0x1f4:_0x37ca97[_0x10ab('0x7e')]||0x1f4;logger[_0x10ab('0x23')]('getFields,\x20%s,\x20%s,\x20%s',_0x10ab('0x7f'),_0x39482e,JSON[_0x10ab('0x80')](_0x37ca97));delete _0x37ca97['name'];if(_0x39482e===0x191){_0x39482e=0x190;}_0x33e940[_0x10ab('0x1c')](_0x39482e)[_0x10ab('0x26')](_0x2cf666[_0x10ab('0x2e')][_0x10ab('0x7d')]?{'message':'Wrong\x20credentials','statusCode':_0x37ca97[_0x10ab('0x7e')]}:_0x37ca97);});};
\ No newline at end of file
index e4c7794..29bcfb1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bc4=['refreshToken','info','format','error','name','inspect','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','lastIndexOf','https://accounts.zoho.eu','then','parse','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','host','slice','substring','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','POST','/oauth/v2/token','authorization_code','code','application/x-www-form-urlencoded','refresh_token'];(function(_0x244227,_0x218546){var _0x5c2bea=function(_0x19280a){while(--_0x19280a){_0x244227['push'](_0x244227['shift']());}};_0x5c2bea(++_0x218546);}(_0x9bc4,0x91));var _0x49bc=function(_0x20fb3f,_0x4ab60d){_0x20fb3f=_0x20fb3f-0x0;var _0x5bb676=_0x9bc4[_0x20fb3f];return _0x5bb676;};'use strict';var _=require(_0x49bc('0x0'));var util=require('util');var logger=require(_0x49bc('0x1'))(_0x49bc('0x2'));var moment=require(_0x49bc('0x3'));var BPromise=require(_0x49bc('0x4'));var rp=require(_0x49bc('0x5'));var fs=require('fs');var path=require(_0x49bc('0x6'));var rimraf=require(_0x49bc('0x7'));var config=require('../../config/environment');var attributes=require(_0x49bc('0x8'));var integrations=require(_0x49bc('0x9'));module[_0x49bc('0xa')]=function(_0xe3deb,_0x174c13){return _0xe3deb[_0x49bc('0xb')](_0x49bc('0xc'),attributes,{'tableName':_0x49bc('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x30b03f,_0x7ed0cf,_0x1fe3e1){if(_0x30b03f[_0x49bc('0xe')](_0x49bc('0xf'))||_0x30b03f['changed'](_0x49bc('0x10'))||_0x30b03f[_0x49bc('0xe')](_0x49bc('0x11'))||_0x30b03f[_0x49bc('0xe')](_0x49bc('0x12'))||_0x30b03f[_0x49bc('0xe')]('code')||_0x30b03f[_0x49bc('0xe')](_0x49bc('0x13'))){var _0x48baab,_0x10cc19;_0x48baab=_0x30b03f[_0x49bc('0x10')];var _0xc5ddf7=_0x48baab[_0x49bc('0x14')](-0x1);if(_0xc5ddf7==='/'||_0xc5ddf7==='\x5c'||_0xc5ddf7===':'){_0x48baab=_0x48baab[_0x49bc('0x15')](0x0,_0x48baab['lastIndexOf'](_0xc5ddf7));}switch(_0x30b03f[_0x49bc('0xf')]){case'US':_0x10cc19=_0x49bc('0x16');break;case'AU':_0x10cc19=_0x49bc('0x17');break;case'IN':_0x10cc19='https://accounts.zoho.in';break;case'CN':_0x10cc19=_0x49bc('0x18');break;default:_0x10cc19='https://accounts.zoho.eu';break;}var _0x57057e={'method':_0x49bc('0x19'),'uri':_0x10cc19+_0x49bc('0x1a'),'form':{'grant_type':_0x49bc('0x1b'),'client_id':_0x30b03f['clientId'],'client_secret':_0x30b03f[_0x49bc('0x12')],'redirect_uri':_0x30b03f[_0x49bc('0x10')],'code':_0x30b03f[_0x49bc('0x1c')]},'headers':{'Content-Type':_0x49bc('0x1d')}};return rp(_0x57057e)['then'](function(_0x44c188){var _0x458423=JSON['parse'](_0x44c188);if(_0x458423[_0x49bc('0x1e')]){_0x30b03f[_0x49bc('0x1f')]=_0x458423[_0x49bc('0x1e')];logger[_0x49bc('0x20')](util[_0x49bc('0x21')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x30b03f['name'],_0x30b03f['id']));}else{logger[_0x49bc('0x22')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x30b03f[_0x49bc('0x23')],_0x30b03f['id']),util[_0x49bc('0x24')](_0x458423,{'showHidden':![],'depth':null}));}return _0x1fe3e1(null,_0x7ed0cf);})[_0x49bc('0x25')](function(_0x15bd12){logger[_0x49bc('0x22')](util[_0x49bc('0x21')](_0x49bc('0x26'),_0x30b03f['name'],_0x30b03f['id']),util[_0x49bc('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x1fe3e1(_0x15bd12);});}else{return _0x1fe3e1(null,_0x7ed0cf);}},'beforeUpdate':function(_0x493280,_0x31f965,_0x5bfd7b){if(_0x493280['changed'](_0x49bc('0xf'))||_0x493280[_0x49bc('0xe')](_0x49bc('0x10'))||_0x493280[_0x49bc('0xe')](_0x49bc('0x11'))||_0x493280[_0x49bc('0xe')](_0x49bc('0x12'))||_0x493280['changed']('code')||_0x493280[_0x49bc('0xe')](_0x49bc('0x13'))){var _0x123df,_0x19d3d1;_0x123df=_0x493280[_0x49bc('0x10')];var _0x3538ea=_0x123df['slice'](-0x1);if(_0x3538ea==='/'||_0x3538ea==='\x5c'||_0x3538ea===':'){_0x123df=_0x123df[_0x49bc('0x15')](0x0,_0x123df[_0x49bc('0x27')](_0x3538ea));}switch(_0x493280[_0x49bc('0xf')]){case'US':_0x19d3d1=_0x49bc('0x16');break;case'AU':_0x19d3d1=_0x49bc('0x17');break;case'IN':_0x19d3d1='https://accounts.zoho.in';break;case'CN':_0x19d3d1='https://accounts.zoho.com.cn';break;default:_0x19d3d1=_0x49bc('0x28');break;}var _0xf848f4={'method':'POST','uri':_0x19d3d1+_0x49bc('0x1a'),'form':{'grant_type':_0x49bc('0x1b'),'client_id':_0x493280[_0x49bc('0x11')],'client_secret':_0x493280['clientSecret'],'redirect_uri':_0x493280[_0x49bc('0x10')],'code':_0x493280[_0x49bc('0x1c')]},'headers':{'Content-Type':_0x49bc('0x1d')}};return rp(_0xf848f4)[_0x49bc('0x29')](function(_0x3708d3){var _0x2bd857=JSON[_0x49bc('0x2a')](_0x3708d3);if(_0x2bd857[_0x49bc('0x1e')]){_0x493280[_0x49bc('0x1f')]=_0x2bd857[_0x49bc('0x1e')];logger['info'](util[_0x49bc('0x21')](_0x49bc('0x2b'),_0x493280[_0x49bc('0x23')],_0x493280['id']));}else{logger[_0x49bc('0x22')](util[_0x49bc('0x21')](_0x49bc('0x26'),_0x493280[_0x49bc('0x23')],_0x493280['id']),util['inspect'](_0x2bd857,{'showHidden':![],'depth':null}));}return _0x5bfd7b(null,_0x31f965);})['catch'](function(_0x317798){logger[_0x49bc('0x22')](util[_0x49bc('0x21')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x493280[_0x49bc('0x23')],_0x493280['id']),util[_0x49bc('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x5bfd7b(_0x317798);});}else{return _0x5bfd7b(null,_0x31f965);}}}});};
\ No newline at end of file
+var _0x4fcf=['inspect','catch','clientId','slice','substring','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','define','changed','zone','serverUrl','clientSecret','code','host','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','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','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d'];(function(_0x7b7793,_0x54c2ba){var _0x596ca9=function(_0xab8c9e){while(--_0xab8c9e){_0x7b7793['push'](_0x7b7793['shift']());}};_0x596ca9(++_0x54c2ba);}(_0x4fcf,0x83));var _0xf4fc=function(_0x1c1435,_0x57eae2){_0x1c1435=_0x1c1435-0x0;var _0x4ec433=_0x4fcf[_0x1c1435];return _0x4ec433;};'use strict';var _=require(_0xf4fc('0x0'));var util=require(_0xf4fc('0x1'));var logger=require(_0xf4fc('0x2'))(_0xf4fc('0x3'));var moment=require(_0xf4fc('0x4'));var BPromise=require('bluebird');var rp=require(_0xf4fc('0x5'));var fs=require('fs');var path=require(_0xf4fc('0x6'));var rimraf=require('rimraf');var config=require(_0xf4fc('0x7'));var attributes=require(_0xf4fc('0x8'));var integrations=require(_0xf4fc('0x9'));module['exports']=function(_0x154604,_0x252c51){return _0x154604[_0xf4fc('0xa')]('ZohoAccount',attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x13f6bf,_0x335eed,_0x3991b4){if(_0x13f6bf[_0xf4fc('0xb')](_0xf4fc('0xc'))||_0x13f6bf['changed'](_0xf4fc('0xd'))||_0x13f6bf['changed']('clientId')||_0x13f6bf[_0xf4fc('0xb')](_0xf4fc('0xe'))||_0x13f6bf[_0xf4fc('0xb')](_0xf4fc('0xf'))||_0x13f6bf[_0xf4fc('0xb')](_0xf4fc('0x10'))){var _0x41d4d0,_0x53fdf4;_0x41d4d0=_0x13f6bf['serverUrl'];var _0x25e77b=_0x41d4d0['slice'](-0x1);if(_0x25e77b==='/'||_0x25e77b==='\x5c'||_0x25e77b===':'){_0x41d4d0=_0x41d4d0['substring'](0x0,_0x41d4d0[_0xf4fc('0x11')](_0x25e77b));}switch(_0x13f6bf['zone']){case'US':_0x53fdf4=_0xf4fc('0x12');break;case'AU':_0x53fdf4=_0xf4fc('0x13');break;case'IN':_0x53fdf4=_0xf4fc('0x14');break;case'CN':_0x53fdf4=_0xf4fc('0x15');break;default:_0x53fdf4=_0xf4fc('0x16');break;}var _0x4b48bd={'method':_0xf4fc('0x17'),'uri':_0x53fdf4+_0xf4fc('0x18'),'form':{'grant_type':_0xf4fc('0x19'),'client_id':_0x13f6bf['clientId'],'client_secret':_0x13f6bf[_0xf4fc('0xe')],'redirect_uri':_0x13f6bf[_0xf4fc('0xd')],'code':_0x13f6bf[_0xf4fc('0xf')]},'headers':{'Content-Type':_0xf4fc('0x1a')}};return rp(_0x4b48bd)[_0xf4fc('0x1b')](function(_0x4d146f){var _0x4cee77=JSON[_0xf4fc('0x1c')](_0x4d146f);if(_0x4cee77[_0xf4fc('0x1d')]){_0x13f6bf[_0xf4fc('0x1e')]=_0x4cee77[_0xf4fc('0x1d')];logger[_0xf4fc('0x1f')](util[_0xf4fc('0x20')](_0xf4fc('0x21'),_0x13f6bf[_0xf4fc('0x22')],_0x13f6bf['id']));}else{logger[_0xf4fc('0x23')](util[_0xf4fc('0x20')](_0xf4fc('0x24'),_0x13f6bf['name'],_0x13f6bf['id']),util[_0xf4fc('0x25')](_0x4cee77,{'showHidden':![],'depth':null}));}return _0x3991b4(null,_0x335eed);})[_0xf4fc('0x26')](function(_0x596b38){logger[_0xf4fc('0x23')](util[_0xf4fc('0x20')](_0xf4fc('0x24'),_0x13f6bf['name'],_0x13f6bf['id']),util[_0xf4fc('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x3991b4(_0x596b38);});}else{return _0x3991b4(null,_0x335eed);}},'beforeUpdate':function(_0x200c41,_0x1ccbdd,_0x4b0277){if(_0x200c41[_0xf4fc('0xb')](_0xf4fc('0xc'))||_0x200c41[_0xf4fc('0xb')](_0xf4fc('0xd'))||_0x200c41['changed'](_0xf4fc('0x27'))||_0x200c41['changed'](_0xf4fc('0xe'))||_0x200c41[_0xf4fc('0xb')]('code')||_0x200c41[_0xf4fc('0xb')](_0xf4fc('0x10'))){var _0x13888e,_0x5018f2;_0x13888e=_0x200c41[_0xf4fc('0xd')];var _0x125d56=_0x13888e[_0xf4fc('0x28')](-0x1);if(_0x125d56==='/'||_0x125d56==='\x5c'||_0x125d56===':'){_0x13888e=_0x13888e[_0xf4fc('0x29')](0x0,_0x13888e['lastIndexOf'](_0x125d56));}switch(_0x200c41[_0xf4fc('0xc')]){case'US':_0x5018f2=_0xf4fc('0x12');break;case'AU':_0x5018f2=_0xf4fc('0x13');break;case'IN':_0x5018f2=_0xf4fc('0x14');break;case'CN':_0x5018f2=_0xf4fc('0x15');break;default:_0x5018f2='https://accounts.zoho.eu';break;}var _0x565ab1={'method':_0xf4fc('0x17'),'uri':_0x5018f2+_0xf4fc('0x18'),'form':{'grant_type':'authorization_code','client_id':_0x200c41['clientId'],'client_secret':_0x200c41[_0xf4fc('0xe')],'redirect_uri':_0x200c41['serverUrl'],'code':_0x200c41[_0xf4fc('0xf')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x565ab1)[_0xf4fc('0x1b')](function(_0x58e05d){var _0x2506e0=JSON['parse'](_0x58e05d);if(_0x2506e0['refresh_token']){_0x200c41['refreshToken']=_0x2506e0['refresh_token'];logger[_0xf4fc('0x1f')](util['format'](_0xf4fc('0x21'),_0x200c41[_0xf4fc('0x22')],_0x200c41['id']));}else{logger['error'](util['format'](_0xf4fc('0x24'),_0x200c41[_0xf4fc('0x22')],_0x200c41['id']),util[_0xf4fc('0x25')](_0x2506e0,{'showHidden':![],'depth':null}));}return _0x4b0277(null,_0x1ccbdd);})[_0xf4fc('0x26')](function(_0x3706c0){logger[_0xf4fc('0x23')](util[_0xf4fc('0x20')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x200c41['name'],_0x200c41['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x4b0277(_0x3706c0);});}else{return _0x4b0277(null,_0x1ccbdd);}}}});};
\ No newline at end of file
index b79e10c..cf245b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x62f1=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','result','GetZohoAccount','findAll','options','raw','where','attributes','include','map','model','ZohoAccount','find','ShowZohoAccount','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x34d188,_0x1c173c){var _0x4e2f6d=function(_0x35cc88){while(--_0x35cc88){_0x34d188['push'](_0x34d188['shift']());}};_0x4e2f6d(++_0x1c173c);}(_0x62f1,0x112));var _0x162f=function(_0x5af1c8,_0x1b88ee){_0x5af1c8=_0x5af1c8-0x0;var _0x3bca4a=_0x62f1[_0x5af1c8];return _0x3bca4a;};'use strict';var _=require(_0x162f('0x0'));var util=require('util');var moment=require(_0x162f('0x1'));var BPromise=require(_0x162f('0x2'));var rs=require(_0x162f('0x3'));var fs=require('fs');var Redis=require(_0x162f('0x4'));var db=require(_0x162f('0x5'))['db'];var utils=require(_0x162f('0x6'));var logger=require(_0x162f('0x7'))(_0x162f('0x8'));var config=require(_0x162f('0x9'));var jayson=require(_0x162f('0xa'));var client=jayson['client'][_0x162f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e763a,_0x593029,_0x2b0c29){return new BPromise(function(_0xbeb77d,_0xcb0ac4){return client['request'](_0x2e763a,_0x2b0c29)[_0x162f('0xc')](function(_0x3d795c){logger[_0x162f('0xd')](_0x162f('0xe'),_0x593029,'request\x20sent');logger[_0x162f('0xf')](_0x162f('0x10'),_0x593029,_0x162f('0x11'),JSON['stringify'](_0x3d795c));if(_0x3d795c['error']){if(_0x3d795c['error'][_0x162f('0x12')]===0x1f4){logger['error'](_0x162f('0xe'),_0x593029,_0x3d795c[_0x162f('0x13')][_0x162f('0x14')]);return _0xcb0ac4(_0x3d795c[_0x162f('0x13')]['message']);}logger[_0x162f('0x13')](_0x162f('0xe'),_0x593029,_0x3d795c[_0x162f('0x13')][_0x162f('0x14')]);return _0xbeb77d(_0x3d795c['error'][_0x162f('0x14')]);}else{logger['info'](_0x162f('0xe'),_0x593029,_0x162f('0x11'));_0xbeb77d(_0x3d795c[_0x162f('0x15')][_0x162f('0x14')]);}})['catch'](function(_0x59e11d){logger[_0x162f('0x13')](_0x162f('0xe'),_0x593029,_0x59e11d);_0xcb0ac4(_0x59e11d);});});}exports[_0x162f('0x16')]=function(_0x1ee433){var _0x45f7ef=this;return new Promise(function(_0x750506,_0x507641){return db['ZohoAccount'][_0x162f('0x17')]({'raw':_0x1ee433['options']?_0x1ee433[_0x162f('0x18')][_0x162f('0x19')]===undefined?!![]:![]:!![],'where':_0x1ee433['options']?_0x1ee433[_0x162f('0x18')][_0x162f('0x1a')]||null:null,'attributes':_0x1ee433['options']?_0x1ee433[_0x162f('0x18')][_0x162f('0x1b')]||null:null,'limit':_0x1ee433[_0x162f('0x18')]?_0x1ee433[_0x162f('0x18')]['limit']||null:null,'include':_0x1ee433[_0x162f('0x18')]?_0x1ee433[_0x162f('0x18')][_0x162f('0x1c')]?_[_0x162f('0x1d')](_0x1ee433[_0x162f('0x18')][_0x162f('0x1c')],function(_0xbcbe11){return{'model':db[_0xbcbe11[_0x162f('0x1e')]],'as':_0xbcbe11['as'],'attributes':_0xbcbe11['attributes'],'include':_0xbcbe11[_0x162f('0x1c')]?_[_0x162f('0x1d')](_0xbcbe11[_0x162f('0x1c')],function(_0x16f5e2){return{'model':db[_0x16f5e2['model']],'as':_0x16f5e2['as'],'attributes':_0x16f5e2[_0x162f('0x1b')],'include':_0x16f5e2['include']?_[_0x162f('0x1d')](_0x16f5e2['include'],function(_0x2cd181){return{'model':db[_0x2cd181['model']],'as':_0x2cd181['as'],'attributes':_0x2cd181[_0x162f('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3e710d){logger[_0x162f('0xd')](_0x162f('0x16'),_0x1ee433);logger['debug']('GetZohoAccount',_0x1ee433,JSON['stringify'](_0x3e710d));_0x750506(_0x3e710d);})['catch'](function(_0x3f9247){logger[_0x162f('0x13')]('GetZohoAccount',_0x3f9247['message'],_0x1ee433);_0x507641(_0x45f7ef['error'](0x1f4,_0x3f9247[_0x162f('0x14')]));});});};exports['ShowZohoAccount']=function(_0x43bb9a){var _0x1f1c3b=this;return new Promise(function(_0x55b224,_0x51e616){return db[_0x162f('0x1f')][_0x162f('0x20')]({'raw':_0x43bb9a[_0x162f('0x18')]?_0x43bb9a['options'][_0x162f('0x19')]===undefined?!![]:![]:!![],'where':_0x43bb9a[_0x162f('0x18')]?_0x43bb9a[_0x162f('0x18')][_0x162f('0x1a')]||null:null,'attributes':_0x43bb9a['options']?_0x43bb9a['options'][_0x162f('0x1b')]||null:null,'include':_0x43bb9a['options']?_0x43bb9a[_0x162f('0x18')]['include']?_['map'](_0x43bb9a['options']['include'],function(_0x3853af){return{'model':db[_0x3853af[_0x162f('0x1e')]],'as':_0x3853af['as'],'attributes':_0x3853af[_0x162f('0x1b')],'include':_0x3853af['include']?_[_0x162f('0x1d')](_0x3853af[_0x162f('0x1c')],function(_0x4e482e){return{'model':db[_0x4e482e[_0x162f('0x1e')]],'as':_0x4e482e['as'],'attributes':_0x4e482e[_0x162f('0x1b')],'include':_0x4e482e[_0x162f('0x1c')]?_['map'](_0x4e482e[_0x162f('0x1c')],function(_0x5941bf){return{'model':db[_0x5941bf[_0x162f('0x1e')]],'as':_0x5941bf['as'],'attributes':_0x5941bf['attributes']};}):[]};}):[]};}):[]:[]})[_0x162f('0xc')](function(_0x510ea7){logger[_0x162f('0xd')](_0x162f('0x21'),_0x43bb9a);logger['debug'](_0x162f('0x21'),_0x43bb9a,JSON['stringify'](_0x510ea7));_0x55b224(_0x510ea7);})[_0x162f('0x22')](function(_0x32909c){logger['error'](_0x162f('0x21'),_0x32909c['message'],_0x43bb9a);_0x51e616(_0x1f1c3b[_0x162f('0x13')](0x1f4,_0x32909c['message']));});});};
\ No newline at end of file
+var _0x5b47=['lodash','util','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowZohoAccount','find'];(function(_0xbba421,_0x81d172){var _0x420880=function(_0x264b93){while(--_0x264b93){_0xbba421['push'](_0xbba421['shift']());}};_0x420880(++_0x81d172);}(_0x5b47,0x120));var _0x75b4=function(_0x50fc52,_0x35762b){_0x50fc52=_0x50fc52-0x0;var _0x245cd8=_0x5b47[_0x50fc52];return _0x245cd8;};'use strict';var _=require(_0x75b4('0x0'));var util=require(_0x75b4('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(_0x75b4('0x2'));var logger=require(_0x75b4('0x3'))(_0x75b4('0x4'));var config=require(_0x75b4('0x5'));var jayson=require(_0x75b4('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x53dcb0,_0x1f1e33,_0x5285bb){return new BPromise(function(_0x16138d,_0x39ff0b){return client[_0x75b4('0x7')](_0x53dcb0,_0x5285bb)[_0x75b4('0x8')](function(_0x127e77){logger[_0x75b4('0x9')](_0x75b4('0xa'),_0x1f1e33,_0x75b4('0xb'));logger[_0x75b4('0xc')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x1f1e33,_0x75b4('0xb'),JSON['stringify'](_0x127e77));if(_0x127e77[_0x75b4('0xd')]){if(_0x127e77[_0x75b4('0xd')][_0x75b4('0xe')]===0x1f4){logger[_0x75b4('0xd')](_0x75b4('0xa'),_0x1f1e33,_0x127e77[_0x75b4('0xd')][_0x75b4('0xf')]);return _0x39ff0b(_0x127e77[_0x75b4('0xd')]['message']);}logger['error']('ZohoAccount,\x20%s,\x20%s',_0x1f1e33,_0x127e77[_0x75b4('0xd')][_0x75b4('0xf')]);return _0x16138d(_0x127e77['error'][_0x75b4('0xf')]);}else{logger[_0x75b4('0x9')](_0x75b4('0xa'),_0x1f1e33,'request\x20sent');_0x16138d(_0x127e77[_0x75b4('0x10')][_0x75b4('0xf')]);}})[_0x75b4('0x11')](function(_0xc7ce4f){logger['error'](_0x75b4('0xa'),_0x1f1e33,_0xc7ce4f);_0x39ff0b(_0xc7ce4f);});});}exports[_0x75b4('0x12')]=function(_0x254063){var _0x7e396d=this;return new Promise(function(_0x33d522,_0x3a1eec){return db[_0x75b4('0x13')][_0x75b4('0x14')]({'raw':_0x254063[_0x75b4('0x15')]?_0x254063[_0x75b4('0x15')][_0x75b4('0x16')]===undefined?!![]:![]:!![],'where':_0x254063[_0x75b4('0x15')]?_0x254063[_0x75b4('0x15')][_0x75b4('0x17')]||null:null,'attributes':_0x254063[_0x75b4('0x15')]?_0x254063[_0x75b4('0x15')][_0x75b4('0x18')]||null:null,'limit':_0x254063[_0x75b4('0x15')]?_0x254063[_0x75b4('0x15')][_0x75b4('0x19')]||null:null,'include':_0x254063[_0x75b4('0x15')]?_0x254063[_0x75b4('0x15')][_0x75b4('0x1a')]?_[_0x75b4('0x1b')](_0x254063['options'][_0x75b4('0x1a')],function(_0x59bab1){return{'model':db[_0x59bab1[_0x75b4('0x1c')]],'as':_0x59bab1['as'],'attributes':_0x59bab1[_0x75b4('0x18')],'include':_0x59bab1[_0x75b4('0x1a')]?_[_0x75b4('0x1b')](_0x59bab1['include'],function(_0x5e0b93){return{'model':db[_0x5e0b93[_0x75b4('0x1c')]],'as':_0x5e0b93['as'],'attributes':_0x5e0b93[_0x75b4('0x18')],'include':_0x5e0b93['include']?_[_0x75b4('0x1b')](_0x5e0b93[_0x75b4('0x1a')],function(_0x5943ec){return{'model':db[_0x5943ec['model']],'as':_0x5943ec['as'],'attributes':_0x5943ec[_0x75b4('0x18')]};}):[]};}):[]};}):[]:[]})[_0x75b4('0x8')](function(_0x5c57c8){logger[_0x75b4('0x9')](_0x75b4('0x12'),_0x254063);logger[_0x75b4('0xc')](_0x75b4('0x12'),_0x254063,JSON[_0x75b4('0x1d')](_0x5c57c8));_0x33d522(_0x5c57c8);})[_0x75b4('0x11')](function(_0x5468eb){logger['error'](_0x75b4('0x12'),_0x5468eb[_0x75b4('0xf')],_0x254063);_0x3a1eec(_0x7e396d[_0x75b4('0xd')](0x1f4,_0x5468eb[_0x75b4('0xf')]));});});};exports[_0x75b4('0x1e')]=function(_0x228d17){var _0x398269=this;return new Promise(function(_0x4bdbac,_0x2912c4){return db[_0x75b4('0x13')][_0x75b4('0x1f')]({'raw':_0x228d17[_0x75b4('0x15')]?_0x228d17[_0x75b4('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x228d17[_0x75b4('0x15')]?_0x228d17['options'][_0x75b4('0x17')]||null:null,'attributes':_0x228d17[_0x75b4('0x15')]?_0x228d17[_0x75b4('0x15')][_0x75b4('0x18')]||null:null,'include':_0x228d17[_0x75b4('0x15')]?_0x228d17[_0x75b4('0x15')]['include']?_[_0x75b4('0x1b')](_0x228d17['options']['include'],function(_0x5e496d){return{'model':db[_0x5e496d[_0x75b4('0x1c')]],'as':_0x5e496d['as'],'attributes':_0x5e496d[_0x75b4('0x18')],'include':_0x5e496d['include']?_['map'](_0x5e496d['include'],function(_0x532724){return{'model':db[_0x532724[_0x75b4('0x1c')]],'as':_0x532724['as'],'attributes':_0x532724[_0x75b4('0x18')],'include':_0x532724['include']?_[_0x75b4('0x1b')](_0x532724[_0x75b4('0x1a')],function(_0x3b0328){return{'model':db[_0x3b0328[_0x75b4('0x1c')]],'as':_0x3b0328['as'],'attributes':_0x3b0328[_0x75b4('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xdbecfc){logger[_0x75b4('0x9')](_0x75b4('0x1e'),_0x228d17);logger[_0x75b4('0xc')](_0x75b4('0x1e'),_0x228d17,JSON[_0x75b4('0x1d')](_0xdbecfc));_0x4bdbac(_0xdbecfc);})[_0x75b4('0x11')](function(_0x45afd3){logger[_0x75b4('0xd')]('ShowZohoAccount',_0x45afd3[_0x75b4('0xf')],_0x228d17);_0x2912c4(_0x398269[_0x75b4('0xd')](0x1f4,_0x45afd3[_0x75b4('0xf')]));});});};
\ No newline at end of file
index 73883fe..a62445a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa506=['isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intZohoConfiguration.controller','get'];(function(_0x602ca8,_0x568e82){var _0x26e8ab=function(_0x3fb700){while(--_0x3fb700){_0x602ca8['push'](_0x602ca8['shift']());}};_0x26e8ab(++_0x568e82);}(_0xa506,0xc6));var _0x6a50=function(_0x52b0a1,_0x6ae1fe){_0x52b0a1=_0x52b0a1-0x0;var _0x2fbdac=_0xa506[_0x52b0a1];return _0x2fbdac;};'use strict';var multer=require('multer');var util=require(_0x6a50('0x0'));var path=require(_0x6a50('0x1'));var timeout=require(_0x6a50('0x2'));var express=require(_0x6a50('0x3'));var router=express[_0x6a50('0x4')]();var fs_extra=require(_0x6a50('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6a50('0x6'));var controller=require(_0x6a50('0x7'));router[_0x6a50('0x8')]('/',auth[_0x6a50('0x9')](),controller[_0x6a50('0xa')]);router[_0x6a50('0x8')](_0x6a50('0xb'),auth[_0x6a50('0x9')](),controller[_0x6a50('0xc')]);router['get'](_0x6a50('0xd'),auth[_0x6a50('0x9')](),controller[_0x6a50('0xe')]);router[_0x6a50('0x8')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x6a50('0xf')]);router[_0x6a50('0x8')](_0x6a50('0x10'),auth[_0x6a50('0x9')](),controller[_0x6a50('0x11')]);router[_0x6a50('0x12')]('/',auth[_0x6a50('0x9')](),controller[_0x6a50('0x13')]);router[_0x6a50('0x14')](_0x6a50('0xb'),auth[_0x6a50('0x9')](),controller[_0x6a50('0x15')]);router['delete'](_0x6a50('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x6a50('0x16')]=router;
\ No newline at end of file
+var _0x4c31=['../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','/:id','update','multer','util','path','Router','fs-extra'];(function(_0x3825a8,_0x2ce1a2){var _0xabc9bc=function(_0x101073){while(--_0x101073){_0x3825a8['push'](_0x3825a8['shift']());}};_0xabc9bc(++_0x2ce1a2);}(_0x4c31,0xd7));var _0x14c3=function(_0x447e0f,_0x55ce13){_0x447e0f=_0x447e0f-0x0;var _0x16d107=_0x4c31[_0x447e0f];return _0x16d107;};'use strict';var multer=require(_0x14c3('0x0'));var util=require(_0x14c3('0x1'));var path=require(_0x14c3('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x14c3('0x3')]();var fs_extra=require(_0x14c3('0x4'));var auth=require(_0x14c3('0x5'));var interaction=require(_0x14c3('0x6'));var config=require(_0x14c3('0x7'));var controller=require('./intZohoConfiguration.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x14c3('0x8')]);router[_0x14c3('0x9')]('/:id',auth[_0x14c3('0xa')](),controller['show']);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0x14c3('0xb')]);router[_0x14c3('0x9')](_0x14c3('0xc'),auth['isAuthenticated'](),controller[_0x14c3('0xd')]);router[_0x14c3('0x9')](_0x14c3('0xe'),auth['isAuthenticated'](),controller[_0x14c3('0xf')]);router[_0x14c3('0x10')]('/',auth['isAuthenticated'](),controller[_0x14c3('0x11')]);router['put'](_0x14c3('0x12'),auth[_0x14c3('0xa')](),controller[_0x14c3('0x13')]);router['delete']('/:id',auth[_0x14c3('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 896c408..717a06e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1618=['exports','STRING','ENUM','contact','nothing','lead','contact_lead','sequelize'];(function(_0x44f669,_0x434270){var _0x32881f=function(_0xbe1975){while(--_0xbe1975){_0x44f669['push'](_0x44f669['shift']());}};_0x32881f(++_0x434270);}(_0x1618,0x7f));var _0x8161=function(_0x20952d,_0x4eddd5){_0x20952d=_0x20952d-0x0;var _0x3b24d5=_0x1618[_0x20952d];return _0x3b24d5;};'use strict';var Sequelize=require(_0x8161('0x0'));module[_0x8161('0x1')]={'name':{'type':Sequelize[_0x8161('0x2')]},'moduleCreate':{'type':Sequelize[_0x8161('0x3')]('lead',_0x8161('0x4'),_0x8161('0x5')),'defaultValue':_0x8161('0x6')},'moduleSearch':{'type':Sequelize[_0x8161('0x3')]('contact_lead','contact','lead'),'defaultValue':_0x8161('0x7')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x045f=['sequelize','exports','STRING','ENUM','lead','nothing','contact_lead','contact'];(function(_0x6bb9,_0x10f2b6){var _0xe3b3bc=function(_0x3438ed){while(--_0x3438ed){_0x6bb9['push'](_0x6bb9['shift']());}};_0xe3b3bc(++_0x10f2b6);}(_0x045f,0x150));var _0xf045=function(_0x3e0ddb,_0x2b875c){_0x3e0ddb=_0x3e0ddb-0x0;var _0x132898=_0x045f[_0x3e0ddb];return _0x132898;};'use strict';var Sequelize=require(_0xf045('0x0'));module[_0xf045('0x1')]={'name':{'type':Sequelize[_0xf045('0x2')]},'moduleCreate':{'type':Sequelize[_0xf045('0x3')](_0xf045('0x4'),'contact',_0xf045('0x5')),'defaultValue':_0xf045('0x4')},'moduleSearch':{'type':Sequelize[_0xf045('0x3')](_0xf045('0x6'),_0xf045('0x7'),_0xf045('0x4')),'defaultValue':_0xf045('0x6')},'description':{'type':Sequelize[_0xf045('0x2')]}};
\ No newline at end of file
index 4105b1b..9716bb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1510=['intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','rows','catch','show','params','includeAll','include','find','create','body','getFields','findOne','ZohoField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','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','../../mysqldb','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x581aae,_0x2b18ee){var _0x539df2=function(_0xbbcb64){while(--_0xbbcb64){_0x581aae['push'](_0x581aae['shift']());}};_0x539df2(++_0x2b18ee);}(_0x1510,0xc9));var _0x0151=function(_0xb09b37,_0x3ba8){_0xb09b37=_0xb09b37-0x0;var _0x471937=_0x1510[_0xb09b37];return _0x471937;};'use strict';var emlformat=require(_0x0151('0x0'));var rimraf=require(_0x0151('0x1'));var zipdir=require(_0x0151('0x2'));var jsonpatch=require(_0x0151('0x3'));var rp=require(_0x0151('0x4'));var moment=require(_0x0151('0x5'));var BPromise=require(_0x0151('0x6'));var Mustache=require(_0x0151('0x7'));var util=require(_0x0151('0x8'));var path=require(_0x0151('0x9'));var sox=require(_0x0151('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0151('0xb'));var _=require(_0x0151('0xc'));var squel=require(_0x0151('0xd'));var crypto=require(_0x0151('0xe'));var jsforce=require(_0x0151('0xf'));var deskjs=require(_0x0151('0x10'));var toCsv=require(_0x0151('0x11'));var querystring=require(_0x0151('0x12'));var Papa=require(_0x0151('0x13'));var Redis=require(_0x0151('0x14'));var authService=require(_0x0151('0x15'));var qs=require(_0x0151('0x16'));var as=require(_0x0151('0x17'));var hardwareService=require(_0x0151('0x18'));var logger=require('../../config/logger')('api');var utils=require(_0x0151('0x19'));var config=require(_0x0151('0x1a'));var licenseUtil=require(_0x0151('0x1b'));var db=require(_0x0151('0x1c'))['db'];function respondWithStatusCode(_0x5a38ee,_0x368ba4){_0x368ba4=_0x368ba4||0xcc;return function(_0x14455f){if(_0x14455f){return _0x5a38ee['sendStatus'](_0x368ba4);}return _0x5a38ee['status'](_0x368ba4)[_0x0151('0x1d')]();};}function respondWithResult(_0x59e5f0,_0x5e8248){_0x5e8248=_0x5e8248||0xc8;return function(_0x3135d7){if(_0x3135d7){return _0x59e5f0[_0x0151('0x1e')](_0x5e8248)['json'](_0x3135d7);}};}function respondWithFilteredResult(_0x408e9f,_0x4c52d7){return function(_0x446874){if(_0x446874){var _0x1ebdcb=typeof _0x4c52d7[_0x0151('0x1f')]==='undefined'&&typeof _0x4c52d7[_0x0151('0x20')]===_0x0151('0x21');var _0x4e9860=_0x446874[_0x0151('0x22')];var _0x40c013=_0x1ebdcb?0x0:_0x4c52d7['offset'];var _0x30ed8c=_0x1ebdcb?_0x446874[_0x0151('0x22')]:_0x4c52d7[_0x0151('0x1f')]+_0x4c52d7['limit'];var _0x11614d;if(_0x30ed8c>=_0x4e9860){_0x30ed8c=_0x4e9860;_0x11614d=0xc8;}else{_0x11614d=0xce;}_0x408e9f[_0x0151('0x1e')](_0x11614d);return _0x408e9f[_0x0151('0x23')](_0x0151('0x24'),_0x40c013+'-'+_0x30ed8c+'/'+_0x4e9860)[_0x0151('0x25')](_0x446874);}return null;};}function patchUpdates(_0xd75e41){return function(_0x1568ff){try{jsonpatch[_0x0151('0x26')](_0x1568ff,_0xd75e41,!![]);}catch(_0x1feb06){return BPromise[_0x0151('0x27')](_0x1feb06);}return _0x1568ff['save']();};}function saveUpdates(_0x35de58,_0x573aca){return function(_0x365a88){if(_0x365a88){return _0x365a88[_0x0151('0x28')](_0x35de58)[_0x0151('0x29')](function(_0x18d78a){return _0x18d78a;});}return null;};}function removeEntity(_0x4816dc,_0x1067f1){return function(_0x1918eb){if(_0x1918eb){return _0x1918eb[_0x0151('0x2a')]()[_0x0151('0x29')](function(){_0x4816dc[_0x0151('0x1e')](0xcc)[_0x0151('0x1d')]();});}};}function handleEntityNotFound(_0x10c4d0,_0x5b8501){return function(_0x3fd5bc){if(!_0x3fd5bc){_0x10c4d0['sendStatus'](0x194);}return _0x3fd5bc;};}function handleError(_0x45ad98,_0x4b61e7){_0x4b61e7=_0x4b61e7||0x1f4;return function(_0x10155f){logger[_0x0151('0x2b')](_0x10155f[_0x0151('0x2c')]);if(_0x10155f[_0x0151('0x2d')]){delete _0x10155f[_0x0151('0x2d')];}_0x45ad98[_0x0151('0x1e')](_0x4b61e7)['send'](_0x10155f);};}exports[_0x0151('0x2e')]=function(_0x291473,_0x27f5f5){var _0x4d2df6={},_0x40a298={},_0x55f57c={'count':0x0,'rows':[]};var _0xcf7918=_[_0x0151('0x2f')](db[_0x0151('0x30')][_0x0151('0x31')],function(_0x5d411f){return{'name':_0x5d411f[_0x0151('0x32')],'type':_0x5d411f[_0x0151('0x33')][_0x0151('0x34')]};});_0x40a298[_0x0151('0x35')]=_[_0x0151('0x2f')](_0xcf7918,_0x0151('0x2d'));_0x40a298[_0x0151('0x36')]=_[_0x0151('0x37')](_0x291473[_0x0151('0x36')]);_0x40a298[_0x0151('0x38')]=_[_0x0151('0x39')](_0x40a298[_0x0151('0x35')],_0x40a298[_0x0151('0x36')]);_0x4d2df6['attributes']=_[_0x0151('0x39')](_0x40a298['model'],qs[_0x0151('0x3a')](_0x291473[_0x0151('0x36')][_0x0151('0x3a')]));_0x4d2df6[_0x0151('0x3b')]=_0x4d2df6[_0x0151('0x3b')][_0x0151('0x3c')]?_0x4d2df6['attributes']:_0x40a298[_0x0151('0x35')];if(!_0x291473[_0x0151('0x36')][_0x0151('0x3d')](_0x0151('0x3e'))){_0x4d2df6[_0x0151('0x20')]=qs['limit'](_0x291473['query'][_0x0151('0x20')]);_0x4d2df6['offset']=qs[_0x0151('0x1f')](_0x291473[_0x0151('0x36')][_0x0151('0x1f')]);}_0x4d2df6[_0x0151('0x3f')]=qs[_0x0151('0x40')](_0x291473[_0x0151('0x36')]['sort']);_0x4d2df6[_0x0151('0x41')]=qs[_0x0151('0x38')](_[_0x0151('0x42')](_0x291473[_0x0151('0x36')],_0x40a298['filters']),_0xcf7918);if(_0x291473[_0x0151('0x36')][_0x0151('0x43')]){_0x4d2df6[_0x0151('0x41')]=_['merge'](_0x4d2df6[_0x0151('0x41')],{'$or':_['map'](_0xcf7918,function(_0x3123a6){if(_0x3123a6[_0x0151('0x33')]!==_0x0151('0x44')){var _0x476244={};_0x476244[_0x3123a6[_0x0151('0x2d')]]={'$like':'%'+_0x291473['query']['filter']+'%'};return _0x476244;}})});}_0x4d2df6=_[_0x0151('0x45')]({},_0x4d2df6,_0x291473[_0x0151('0x46')]);var _0xb88f82={'where':_0x4d2df6[_0x0151('0x41')]};return db[_0x0151('0x30')][_0x0151('0x22')](_0xb88f82)[_0x0151('0x29')](function(_0x27db18){_0x55f57c[_0x0151('0x22')]=_0x27db18;if(_0x291473[_0x0151('0x36')]['includeAll']){_0x4d2df6['include']=[{'all':!![]}];}return db[_0x0151('0x30')][_0x0151('0x47')](_0x4d2df6);})[_0x0151('0x29')](function(_0x5e297e){_0x55f57c[_0x0151('0x48')]=_0x5e297e;return _0x55f57c;})[_0x0151('0x29')](respondWithFilteredResult(_0x27f5f5,_0x4d2df6))[_0x0151('0x49')](handleError(_0x27f5f5,null));};exports[_0x0151('0x4a')]=function(_0x17ee14,_0x22eff9){var _0x30d08b={'raw':![],'where':{'id':_0x17ee14[_0x0151('0x4b')]['id']}},_0x2bd9eb={};_0x2bd9eb[_0x0151('0x35')]=_[_0x0151('0x37')](db['ZohoConfiguration'][_0x0151('0x31')]);_0x2bd9eb[_0x0151('0x36')]=_[_0x0151('0x37')](_0x17ee14['query']);_0x2bd9eb[_0x0151('0x38')]=_[_0x0151('0x39')](_0x2bd9eb[_0x0151('0x35')],_0x2bd9eb[_0x0151('0x36')]);_0x30d08b[_0x0151('0x3b')]=_[_0x0151('0x39')](_0x2bd9eb[_0x0151('0x35')],qs[_0x0151('0x3a')](_0x17ee14[_0x0151('0x36')][_0x0151('0x3a')]));_0x30d08b[_0x0151('0x3b')]=_0x30d08b[_0x0151('0x3b')][_0x0151('0x3c')]?_0x30d08b['attributes']:_0x2bd9eb['model'];if(_0x17ee14[_0x0151('0x36')][_0x0151('0x4c')]){_0x30d08b[_0x0151('0x4d')]=[{'all':!![]}];}_0x30d08b=_[_0x0151('0x45')]({},_0x30d08b,_0x17ee14[_0x0151('0x46')]);return db[_0x0151('0x30')][_0x0151('0x4e')](_0x30d08b)[_0x0151('0x29')](handleEntityNotFound(_0x22eff9,null))[_0x0151('0x29')](respondWithResult(_0x22eff9,null))['catch'](handleError(_0x22eff9,null));};exports[_0x0151('0x4f')]=function(_0x3d2ad3,_0x3970be){return db[_0x0151('0x30')][_0x0151('0x4f')](_0x3d2ad3[_0x0151('0x50')],{})[_0x0151('0x29')](respondWithResult(_0x3970be,0xc9))[_0x0151('0x49')](handleError(_0x3970be,null));};exports[_0x0151('0x28')]=function(_0x59a9e9,_0x18a305){if(_0x59a9e9['body']['id']){delete _0x59a9e9[_0x0151('0x50')]['id'];}return db['ZohoConfiguration'][_0x0151('0x4e')]({'where':{'id':_0x59a9e9[_0x0151('0x4b')]['id']}})['then'](handleEntityNotFound(_0x18a305,null))[_0x0151('0x29')](saveUpdates(_0x59a9e9[_0x0151('0x50')],null))[_0x0151('0x29')](respondWithResult(_0x18a305,null))[_0x0151('0x49')](handleError(_0x18a305,null));};exports[_0x0151('0x2a')]=function(_0x4d87f8,_0x4b0041){return db[_0x0151('0x30')][_0x0151('0x4e')]({'where':{'id':_0x4d87f8[_0x0151('0x4b')]['id']}})[_0x0151('0x29')](handleEntityNotFound(_0x4b0041,null))[_0x0151('0x29')](removeEntity(_0x4b0041,null))[_0x0151('0x49')](handleError(_0x4b0041,null));};exports[_0x0151('0x51')]=function(_0x24000c,_0x13c87b,_0x1d35e4){var _0x2ba5a2={};var _0x3ed558={};var _0x39fc99;var _0x1d60b3;return db['ZohoConfiguration'][_0x0151('0x52')]({'where':{'id':_0x24000c[_0x0151('0x4b')]['id']}})[_0x0151('0x29')](handleEntityNotFound(_0x13c87b,null))['then'](function(_0x3de1e9){if(_0x3de1e9){_0x39fc99=_0x3de1e9;_0x3ed558[_0x0151('0x35')]=_[_0x0151('0x37')](db[_0x0151('0x53')]['rawAttributes']);_0x3ed558[_0x0151('0x36')]=_[_0x0151('0x37')](_0x24000c['query']);_0x3ed558['filters']=_[_0x0151('0x39')](_0x3ed558[_0x0151('0x35')],_0x3ed558['query']);_0x2ba5a2[_0x0151('0x3b')]=_[_0x0151('0x39')](_0x3ed558['model'],qs[_0x0151('0x3a')](_0x24000c[_0x0151('0x36')]['fields']));_0x2ba5a2[_0x0151('0x3b')]=_0x2ba5a2['attributes'][_0x0151('0x3c')]?_0x2ba5a2[_0x0151('0x3b')]:_0x3ed558[_0x0151('0x35')];_0x2ba5a2[_0x0151('0x3f')]=qs[_0x0151('0x40')](_0x24000c[_0x0151('0x36')][_0x0151('0x40')]);_0x2ba5a2[_0x0151('0x41')]=qs[_0x0151('0x38')](_[_0x0151('0x42')](_0x24000c[_0x0151('0x36')],_0x3ed558[_0x0151('0x38')]));if(_0x24000c[_0x0151('0x36')][_0x0151('0x43')]){_0x2ba5a2['where']=_[_0x0151('0x45')](_0x2ba5a2[_0x0151('0x41')],{'$or':_[_0x0151('0x2f')](_0x2ba5a2[_0x0151('0x3b')],function(_0x4315c4){var _0x3d2286={};_0x3d2286[_0x4315c4]={'$like':'%'+_0x24000c[_0x0151('0x36')][_0x0151('0x43')]+'%'};return _0x3d2286;})});}_0x2ba5a2=_[_0x0151('0x45')]({},_0x2ba5a2,_0x24000c['options']);return _0x39fc99[_0x0151('0x51')](_0x2ba5a2);}})[_0x0151('0x29')](function(_0x7f4ff1){if(_0x7f4ff1){_0x1d60b3=_0x7f4ff1[_0x0151('0x3c')];if(!_0x24000c[_0x0151('0x36')][_0x0151('0x3d')]('nolimit')){_0x2ba5a2['limit']=qs[_0x0151('0x20')](_0x24000c[_0x0151('0x36')]['limit']);_0x2ba5a2[_0x0151('0x1f')]=qs[_0x0151('0x1f')](_0x24000c['query'][_0x0151('0x1f')]);}return _0x39fc99['getFields'](_0x2ba5a2);}})['then'](function(_0xd29868){if(_0xd29868){return _0xd29868?{'count':_0x1d60b3,'rows':_0xd29868}:null;}})[_0x0151('0x29')](respondWithResult(_0x13c87b,null))[_0x0151('0x49')](handleError(_0x13c87b,null));};exports[_0x0151('0x54')]=function(_0x1340dd,_0x261f3a,_0x246df5){var _0x4d460b={};var _0x5363c6={};var _0x4e4066;var _0x59305f;return db[_0x0151('0x30')][_0x0151('0x52')]({'where':{'id':_0x1340dd[_0x0151('0x4b')]['id']}})[_0x0151('0x29')](handleEntityNotFound(_0x261f3a,null))['then'](function(_0x406ecf){if(_0x406ecf){_0x4e4066=_0x406ecf;_0x5363c6['model']=_[_0x0151('0x37')](db[_0x0151('0x53')][_0x0151('0x31')]);_0x5363c6[_0x0151('0x36')]=_[_0x0151('0x37')](_0x1340dd[_0x0151('0x36')]);_0x5363c6[_0x0151('0x38')]=_[_0x0151('0x39')](_0x5363c6[_0x0151('0x35')],_0x5363c6[_0x0151('0x36')]);_0x4d460b[_0x0151('0x3b')]=_['intersection'](_0x5363c6[_0x0151('0x35')],qs[_0x0151('0x3a')](_0x1340dd[_0x0151('0x36')][_0x0151('0x3a')]));_0x4d460b['attributes']=_0x4d460b[_0x0151('0x3b')][_0x0151('0x3c')]?_0x4d460b['attributes']:_0x5363c6[_0x0151('0x35')];_0x4d460b['order']=qs[_0x0151('0x40')](_0x1340dd[_0x0151('0x36')][_0x0151('0x40')]);_0x4d460b[_0x0151('0x41')]=qs[_0x0151('0x38')](_['pick'](_0x1340dd[_0x0151('0x36')],_0x5363c6[_0x0151('0x38')]));if(_0x1340dd['query'][_0x0151('0x43')]){_0x4d460b[_0x0151('0x41')]=_[_0x0151('0x45')](_0x4d460b[_0x0151('0x41')],{'$or':_[_0x0151('0x2f')](_0x4d460b['attributes'],function(_0x520545){var _0x1c8fe7={};_0x1c8fe7[_0x520545]={'$like':'%'+_0x1340dd['query'][_0x0151('0x43')]+'%'};return _0x1c8fe7;})});}_0x4d460b=_[_0x0151('0x45')]({},_0x4d460b,_0x1340dd[_0x0151('0x46')]);return _0x4e4066[_0x0151('0x54')](_0x4d460b);}})['then'](function(_0x4756c8){if(_0x4756c8){_0x59305f=_0x4756c8[_0x0151('0x3c')];if(!_0x1340dd['query']['hasOwnProperty'](_0x0151('0x3e'))){_0x4d460b[_0x0151('0x20')]=qs[_0x0151('0x20')](_0x1340dd[_0x0151('0x36')][_0x0151('0x20')]);_0x4d460b[_0x0151('0x1f')]=qs[_0x0151('0x1f')](_0x1340dd[_0x0151('0x36')][_0x0151('0x1f')]);}return _0x4e4066[_0x0151('0x54')](_0x4d460b);}})['then'](function(_0x354739){if(_0x354739){return _0x354739?{'count':_0x59305f,'rows':_0x354739}:null;}})[_0x0151('0x29')](respondWithResult(_0x261f3a,null))[_0x0151('0x49')](handleError(_0x261f3a,null));};exports['getDescriptions']=function(_0x10fb33,_0x360ca4,_0x5c993b){var _0xbc7ab8={};var _0x5a91c7={};var _0x2719b;var _0x35ef6c;return db[_0x0151('0x30')][_0x0151('0x52')]({'where':{'id':_0x10fb33[_0x0151('0x4b')]['id']}})[_0x0151('0x29')](handleEntityNotFound(_0x360ca4,null))['then'](function(_0x157373){if(_0x157373){_0x2719b=_0x157373;_0x5a91c7[_0x0151('0x35')]=_[_0x0151('0x37')](db[_0x0151('0x53')][_0x0151('0x31')]);_0x5a91c7[_0x0151('0x36')]=_['keys'](_0x10fb33[_0x0151('0x36')]);_0x5a91c7[_0x0151('0x38')]=_[_0x0151('0x39')](_0x5a91c7[_0x0151('0x35')],_0x5a91c7[_0x0151('0x36')]);_0xbc7ab8[_0x0151('0x3b')]=_[_0x0151('0x39')](_0x5a91c7[_0x0151('0x35')],qs[_0x0151('0x3a')](_0x10fb33['query'][_0x0151('0x3a')]));_0xbc7ab8[_0x0151('0x3b')]=_0xbc7ab8[_0x0151('0x3b')][_0x0151('0x3c')]?_0xbc7ab8[_0x0151('0x3b')]:_0x5a91c7[_0x0151('0x35')];_0xbc7ab8['order']=qs[_0x0151('0x40')](_0x10fb33[_0x0151('0x36')][_0x0151('0x40')]);_0xbc7ab8[_0x0151('0x41')]=qs[_0x0151('0x38')](_[_0x0151('0x42')](_0x10fb33[_0x0151('0x36')],_0x5a91c7[_0x0151('0x38')]));if(_0x10fb33[_0x0151('0x36')][_0x0151('0x43')]){_0xbc7ab8[_0x0151('0x41')]=_[_0x0151('0x45')](_0xbc7ab8[_0x0151('0x41')],{'$or':_[_0x0151('0x2f')](_0xbc7ab8['attributes'],function(_0x84e9c9){var _0x3243a7={};_0x3243a7[_0x84e9c9]={'$like':'%'+_0x10fb33['query'][_0x0151('0x43')]+'%'};return _0x3243a7;})});}_0xbc7ab8=_[_0x0151('0x45')]({},_0xbc7ab8,_0x10fb33[_0x0151('0x46')]);return _0x2719b[_0x0151('0x55')](_0xbc7ab8);}})[_0x0151('0x29')](function(_0x22b921){if(_0x22b921){_0x35ef6c=_0x22b921[_0x0151('0x3c')];if(!_0x10fb33['query']['hasOwnProperty'](_0x0151('0x3e'))){_0xbc7ab8['limit']=qs[_0x0151('0x20')](_0x10fb33[_0x0151('0x36')][_0x0151('0x20')]);_0xbc7ab8[_0x0151('0x1f')]=qs[_0x0151('0x1f')](_0x10fb33['query'][_0x0151('0x1f')]);}return _0x2719b[_0x0151('0x55')](_0xbc7ab8);}})[_0x0151('0x29')](function(_0x22285b){if(_0x22285b){return _0x22285b?{'count':_0x35ef6c,'rows':_0x22285b}:null;}})[_0x0151('0x29')](respondWithResult(_0x360ca4,null))[_0x0151('0x49')](handleError(_0x360ca4,null));};
\ No newline at end of file
+var _0x33f0=['api','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','stack','name','send','index','map','ZohoConfiguration','key','model','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','body','update','find','getFields','ZohoField','pick','hasOwnProperty','getSubjects','getDescriptions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x271380,_0xd2a558){var _0x34c0ea=function(_0x2262f2){while(--_0x2262f2){_0x271380['push'](_0x271380['shift']());}};_0x34c0ea(++_0xd2a558);}(_0x33f0,0x1de));var _0x033f=function(_0x4eba89,_0x2adaac){_0x4eba89=_0x4eba89-0x0;var _0x91992=_0x33f0[_0x4eba89];return _0x91992;};'use strict';var emlformat=require(_0x033f('0x0'));var rimraf=require(_0x033f('0x1'));var zipdir=require(_0x033f('0x2'));var jsonpatch=require(_0x033f('0x3'));var rp=require(_0x033f('0x4'));var moment=require(_0x033f('0x5'));var BPromise=require(_0x033f('0x6'));var Mustache=require(_0x033f('0x7'));var util=require(_0x033f('0x8'));var path=require(_0x033f('0x9'));var sox=require(_0x033f('0xa'));var csv=require('to-csv');var ejs=require(_0x033f('0xb'));var fs=require('fs');var fs_extra=require(_0x033f('0xc'));var _=require(_0x033f('0xd'));var squel=require(_0x033f('0xe'));var crypto=require(_0x033f('0xf'));var jsforce=require(_0x033f('0x10'));var deskjs=require(_0x033f('0x11'));var toCsv=require(_0x033f('0x12'));var querystring=require('querystring');var Papa=require(_0x033f('0x13'));var Redis=require(_0x033f('0x14'));var authService=require(_0x033f('0x15'));var qs=require(_0x033f('0x16'));var as=require(_0x033f('0x17'));var hardwareService=require(_0x033f('0x18'));var logger=require(_0x033f('0x19'))(_0x033f('0x1a'));var utils=require('../../config/utils');var config=require(_0x033f('0x1b'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28f299,_0xda1578){_0xda1578=_0xda1578||0xcc;return function(_0x3e17c0){if(_0x3e17c0){return _0x28f299[_0x033f('0x1c')](_0xda1578);}return _0x28f299[_0x033f('0x1d')](_0xda1578)[_0x033f('0x1e')]();};}function respondWithResult(_0x596540,_0x2077fd){_0x2077fd=_0x2077fd||0xc8;return function(_0xf3b8f6){if(_0xf3b8f6){return _0x596540['status'](_0x2077fd)[_0x033f('0x1f')](_0xf3b8f6);}};}function respondWithFilteredResult(_0x759a55,_0xabb4a2){return function(_0x1cd498){if(_0x1cd498){var _0x1266b9=typeof _0xabb4a2[_0x033f('0x20')]===_0x033f('0x21')&&typeof _0xabb4a2[_0x033f('0x22')]===_0x033f('0x21');var _0x4841c2=_0x1cd498[_0x033f('0x23')];var _0x47dab1=_0x1266b9?0x0:_0xabb4a2['offset'];var _0x519a5e=_0x1266b9?_0x1cd498[_0x033f('0x23')]:_0xabb4a2[_0x033f('0x20')]+_0xabb4a2[_0x033f('0x22')];var _0x29d0a9;if(_0x519a5e>=_0x4841c2){_0x519a5e=_0x4841c2;_0x29d0a9=0xc8;}else{_0x29d0a9=0xce;}_0x759a55[_0x033f('0x1d')](_0x29d0a9);return _0x759a55[_0x033f('0x24')](_0x033f('0x25'),_0x47dab1+'-'+_0x519a5e+'/'+_0x4841c2)[_0x033f('0x1f')](_0x1cd498);}return null;};}function patchUpdates(_0x2eb05b){return function(_0x335981){try{jsonpatch[_0x033f('0x26')](_0x335981,_0x2eb05b,!![]);}catch(_0x486b83){return BPromise['reject'](_0x486b83);}return _0x335981[_0x033f('0x27')]();};}function saveUpdates(_0x1f17da,_0x4ca499){return function(_0xe88c32){if(_0xe88c32){return _0xe88c32['update'](_0x1f17da)[_0x033f('0x28')](function(_0x3acbe3){return _0x3acbe3;});}return null;};}function removeEntity(_0x5c3dd7,_0xdc4fc0){return function(_0xc55c58){if(_0xc55c58){return _0xc55c58[_0x033f('0x29')]()[_0x033f('0x28')](function(){_0x5c3dd7[_0x033f('0x1d')](0xcc)[_0x033f('0x1e')]();});}};}function handleEntityNotFound(_0x1ba8fa,_0x1c4a66){return function(_0x1f03a4){if(!_0x1f03a4){_0x1ba8fa[_0x033f('0x1c')](0x194);}return _0x1f03a4;};}function handleError(_0x365a34,_0x2d74e8){_0x2d74e8=_0x2d74e8||0x1f4;return function(_0x1dcc12){logger['error'](_0x1dcc12[_0x033f('0x2a')]);if(_0x1dcc12[_0x033f('0x2b')]){delete _0x1dcc12['name'];}_0x365a34[_0x033f('0x1d')](_0x2d74e8)[_0x033f('0x2c')](_0x1dcc12);};}exports[_0x033f('0x2d')]=function(_0x4d8d01,_0x3e8d57){var _0x53e5c9={},_0x45bbee={},_0x23096c={'count':0x0,'rows':[]};var _0x26ff3b=_[_0x033f('0x2e')](db[_0x033f('0x2f')]['rawAttributes'],function(_0x231211){return{'name':_0x231211['fieldName'],'type':_0x231211['type'][_0x033f('0x30')]};});_0x45bbee[_0x033f('0x31')]=_['map'](_0x26ff3b,_0x033f('0x2b'));_0x45bbee[_0x033f('0x32')]=_[_0x033f('0x33')](_0x4d8d01[_0x033f('0x32')]);_0x45bbee[_0x033f('0x34')]=_[_0x033f('0x35')](_0x45bbee[_0x033f('0x31')],_0x45bbee[_0x033f('0x32')]);_0x53e5c9[_0x033f('0x36')]=_[_0x033f('0x35')](_0x45bbee[_0x033f('0x31')],qs['fields'](_0x4d8d01[_0x033f('0x32')]['fields']));_0x53e5c9[_0x033f('0x36')]=_0x53e5c9[_0x033f('0x36')][_0x033f('0x37')]?_0x53e5c9[_0x033f('0x36')]:_0x45bbee[_0x033f('0x31')];if(!_0x4d8d01['query']['hasOwnProperty'](_0x033f('0x38'))){_0x53e5c9[_0x033f('0x22')]=qs[_0x033f('0x22')](_0x4d8d01[_0x033f('0x32')]['limit']);_0x53e5c9[_0x033f('0x20')]=qs[_0x033f('0x20')](_0x4d8d01['query'][_0x033f('0x20')]);}_0x53e5c9[_0x033f('0x39')]=qs['sort'](_0x4d8d01['query'][_0x033f('0x3a')]);_0x53e5c9[_0x033f('0x3b')]=qs[_0x033f('0x34')](_['pick'](_0x4d8d01['query'],_0x45bbee[_0x033f('0x34')]),_0x26ff3b);if(_0x4d8d01['query'][_0x033f('0x3c')]){_0x53e5c9[_0x033f('0x3b')]=_[_0x033f('0x3d')](_0x53e5c9[_0x033f('0x3b')],{'$or':_[_0x033f('0x2e')](_0x26ff3b,function(_0x53ecac){if(_0x53ecac[_0x033f('0x3e')]!==_0x033f('0x3f')){var _0x51f4db={};_0x51f4db[_0x53ecac[_0x033f('0x2b')]]={'$like':'%'+_0x4d8d01[_0x033f('0x32')][_0x033f('0x3c')]+'%'};return _0x51f4db;}})});}_0x53e5c9=_['merge']({},_0x53e5c9,_0x4d8d01[_0x033f('0x40')]);var _0x1e4df9={'where':_0x53e5c9['where']};return db[_0x033f('0x2f')]['count'](_0x1e4df9)['then'](function(_0x59b1ae){_0x23096c[_0x033f('0x23')]=_0x59b1ae;if(_0x4d8d01[_0x033f('0x32')][_0x033f('0x41')]){_0x53e5c9[_0x033f('0x42')]=[{'all':!![]}];}return db[_0x033f('0x2f')][_0x033f('0x43')](_0x53e5c9);})[_0x033f('0x28')](function(_0x2ab69f){_0x23096c[_0x033f('0x44')]=_0x2ab69f;return _0x23096c;})['then'](respondWithFilteredResult(_0x3e8d57,_0x53e5c9))[_0x033f('0x45')](handleError(_0x3e8d57,null));};exports[_0x033f('0x46')]=function(_0x1da73c,_0x537016){var _0x3353c4={'raw':![],'where':{'id':_0x1da73c[_0x033f('0x47')]['id']}},_0x50e49b={};_0x50e49b['model']=_[_0x033f('0x33')](db[_0x033f('0x2f')][_0x033f('0x48')]);_0x50e49b[_0x033f('0x32')]=_['keys'](_0x1da73c[_0x033f('0x32')]);_0x50e49b[_0x033f('0x34')]=_[_0x033f('0x35')](_0x50e49b[_0x033f('0x31')],_0x50e49b[_0x033f('0x32')]);_0x3353c4[_0x033f('0x36')]=_[_0x033f('0x35')](_0x50e49b['model'],qs[_0x033f('0x49')](_0x1da73c[_0x033f('0x32')][_0x033f('0x49')]));_0x3353c4[_0x033f('0x36')]=_0x3353c4[_0x033f('0x36')]['length']?_0x3353c4[_0x033f('0x36')]:_0x50e49b[_0x033f('0x31')];if(_0x1da73c[_0x033f('0x32')]['includeAll']){_0x3353c4[_0x033f('0x42')]=[{'all':!![]}];}_0x3353c4=_['merge']({},_0x3353c4,_0x1da73c[_0x033f('0x40')]);return db[_0x033f('0x2f')]['find'](_0x3353c4)[_0x033f('0x28')](handleEntityNotFound(_0x537016,null))['then'](respondWithResult(_0x537016,null))[_0x033f('0x45')](handleError(_0x537016,null));};exports['create']=function(_0xf5c4ac,_0x147b31){return db[_0x033f('0x2f')]['create'](_0xf5c4ac[_0x033f('0x4a')],{})[_0x033f('0x28')](respondWithResult(_0x147b31,0xc9))[_0x033f('0x45')](handleError(_0x147b31,null));};exports[_0x033f('0x4b')]=function(_0x4576f9,_0x14ed98){if(_0x4576f9[_0x033f('0x4a')]['id']){delete _0x4576f9[_0x033f('0x4a')]['id'];}return db[_0x033f('0x2f')][_0x033f('0x4c')]({'where':{'id':_0x4576f9['params']['id']}})[_0x033f('0x28')](handleEntityNotFound(_0x14ed98,null))[_0x033f('0x28')](saveUpdates(_0x4576f9[_0x033f('0x4a')],null))[_0x033f('0x28')](respondWithResult(_0x14ed98,null))['catch'](handleError(_0x14ed98,null));};exports[_0x033f('0x29')]=function(_0x1bc8ea,_0x3f1b83){return db[_0x033f('0x2f')][_0x033f('0x4c')]({'where':{'id':_0x1bc8ea[_0x033f('0x47')]['id']}})[_0x033f('0x28')](handleEntityNotFound(_0x3f1b83,null))[_0x033f('0x28')](removeEntity(_0x3f1b83,null))[_0x033f('0x45')](handleError(_0x3f1b83,null));};exports[_0x033f('0x4d')]=function(_0x268afd,_0x19e3ce,_0x4316ed){var _0x48e701={};var _0xceefaa={};var _0x2b5feb;var _0x4821d6;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x268afd[_0x033f('0x47')]['id']}})[_0x033f('0x28')](handleEntityNotFound(_0x19e3ce,null))[_0x033f('0x28')](function(_0x34ad7f){if(_0x34ad7f){_0x2b5feb=_0x34ad7f;_0xceefaa[_0x033f('0x31')]=_[_0x033f('0x33')](db[_0x033f('0x4e')]['rawAttributes']);_0xceefaa[_0x033f('0x32')]=_[_0x033f('0x33')](_0x268afd['query']);_0xceefaa[_0x033f('0x34')]=_[_0x033f('0x35')](_0xceefaa['model'],_0xceefaa[_0x033f('0x32')]);_0x48e701[_0x033f('0x36')]=_[_0x033f('0x35')](_0xceefaa[_0x033f('0x31')],qs[_0x033f('0x49')](_0x268afd[_0x033f('0x32')][_0x033f('0x49')]));_0x48e701[_0x033f('0x36')]=_0x48e701[_0x033f('0x36')]['length']?_0x48e701[_0x033f('0x36')]:_0xceefaa[_0x033f('0x31')];_0x48e701[_0x033f('0x39')]=qs[_0x033f('0x3a')](_0x268afd[_0x033f('0x32')][_0x033f('0x3a')]);_0x48e701[_0x033f('0x3b')]=qs['filters'](_[_0x033f('0x4f')](_0x268afd[_0x033f('0x32')],_0xceefaa[_0x033f('0x34')]));if(_0x268afd['query']['filter']){_0x48e701[_0x033f('0x3b')]=_[_0x033f('0x3d')](_0x48e701[_0x033f('0x3b')],{'$or':_[_0x033f('0x2e')](_0x48e701['attributes'],function(_0x115b1a){var _0x29fe79={};_0x29fe79[_0x115b1a]={'$like':'%'+_0x268afd[_0x033f('0x32')]['filter']+'%'};return _0x29fe79;})});}_0x48e701=_[_0x033f('0x3d')]({},_0x48e701,_0x268afd['options']);return _0x2b5feb[_0x033f('0x4d')](_0x48e701);}})['then'](function(_0x15c118){if(_0x15c118){_0x4821d6=_0x15c118[_0x033f('0x37')];if(!_0x268afd[_0x033f('0x32')][_0x033f('0x50')](_0x033f('0x38'))){_0x48e701[_0x033f('0x22')]=qs['limit'](_0x268afd['query'][_0x033f('0x22')]);_0x48e701[_0x033f('0x20')]=qs[_0x033f('0x20')](_0x268afd[_0x033f('0x32')][_0x033f('0x20')]);}return _0x2b5feb[_0x033f('0x4d')](_0x48e701);}})['then'](function(_0x238d15){if(_0x238d15){return _0x238d15?{'count':_0x4821d6,'rows':_0x238d15}:null;}})[_0x033f('0x28')](respondWithResult(_0x19e3ce,null))['catch'](handleError(_0x19e3ce,null));};exports[_0x033f('0x51')]=function(_0x48d378,_0x2d6c13,_0x1415d2){var _0x5bbab9={};var _0x25ee60={};var _0x322d26;var _0x439b15;return db[_0x033f('0x2f')]['findOne']({'where':{'id':_0x48d378['params']['id']}})[_0x033f('0x28')](handleEntityNotFound(_0x2d6c13,null))[_0x033f('0x28')](function(_0x328164){if(_0x328164){_0x322d26=_0x328164;_0x25ee60[_0x033f('0x31')]=_[_0x033f('0x33')](db['ZohoField']['rawAttributes']);_0x25ee60[_0x033f('0x32')]=_[_0x033f('0x33')](_0x48d378[_0x033f('0x32')]);_0x25ee60[_0x033f('0x34')]=_[_0x033f('0x35')](_0x25ee60['model'],_0x25ee60[_0x033f('0x32')]);_0x5bbab9[_0x033f('0x36')]=_[_0x033f('0x35')](_0x25ee60[_0x033f('0x31')],qs['fields'](_0x48d378[_0x033f('0x32')][_0x033f('0x49')]));_0x5bbab9[_0x033f('0x36')]=_0x5bbab9[_0x033f('0x36')]['length']?_0x5bbab9[_0x033f('0x36')]:_0x25ee60[_0x033f('0x31')];_0x5bbab9[_0x033f('0x39')]=qs[_0x033f('0x3a')](_0x48d378[_0x033f('0x32')][_0x033f('0x3a')]);_0x5bbab9[_0x033f('0x3b')]=qs['filters'](_['pick'](_0x48d378[_0x033f('0x32')],_0x25ee60[_0x033f('0x34')]));if(_0x48d378[_0x033f('0x32')]['filter']){_0x5bbab9[_0x033f('0x3b')]=_[_0x033f('0x3d')](_0x5bbab9[_0x033f('0x3b')],{'$or':_[_0x033f('0x2e')](_0x5bbab9[_0x033f('0x36')],function(_0x488236){var _0x23eec8={};_0x23eec8[_0x488236]={'$like':'%'+_0x48d378[_0x033f('0x32')][_0x033f('0x3c')]+'%'};return _0x23eec8;})});}_0x5bbab9=_[_0x033f('0x3d')]({},_0x5bbab9,_0x48d378[_0x033f('0x40')]);return _0x322d26[_0x033f('0x51')](_0x5bbab9);}})[_0x033f('0x28')](function(_0x49b77d){if(_0x49b77d){_0x439b15=_0x49b77d[_0x033f('0x37')];if(!_0x48d378[_0x033f('0x32')][_0x033f('0x50')](_0x033f('0x38'))){_0x5bbab9[_0x033f('0x22')]=qs[_0x033f('0x22')](_0x48d378[_0x033f('0x32')][_0x033f('0x22')]);_0x5bbab9['offset']=qs[_0x033f('0x20')](_0x48d378[_0x033f('0x32')][_0x033f('0x20')]);}return _0x322d26['getSubjects'](_0x5bbab9);}})[_0x033f('0x28')](function(_0x5cfd20){if(_0x5cfd20){return _0x5cfd20?{'count':_0x439b15,'rows':_0x5cfd20}:null;}})[_0x033f('0x28')](respondWithResult(_0x2d6c13,null))[_0x033f('0x45')](handleError(_0x2d6c13,null));};exports[_0x033f('0x52')]=function(_0x309514,_0x45e472,_0x27b9d7){var _0x4b4217={};var _0x566a28={};var _0x41e508;var _0x41eb11;return db[_0x033f('0x2f')][_0x033f('0x53')]({'where':{'id':_0x309514[_0x033f('0x47')]['id']}})[_0x033f('0x28')](handleEntityNotFound(_0x45e472,null))[_0x033f('0x28')](function(_0x297511){if(_0x297511){_0x41e508=_0x297511;_0x566a28['model']=_[_0x033f('0x33')](db[_0x033f('0x4e')]['rawAttributes']);_0x566a28[_0x033f('0x32')]=_[_0x033f('0x33')](_0x309514[_0x033f('0x32')]);_0x566a28[_0x033f('0x34')]=_['intersection'](_0x566a28[_0x033f('0x31')],_0x566a28[_0x033f('0x32')]);_0x4b4217[_0x033f('0x36')]=_[_0x033f('0x35')](_0x566a28[_0x033f('0x31')],qs[_0x033f('0x49')](_0x309514[_0x033f('0x32')][_0x033f('0x49')]));_0x4b4217[_0x033f('0x36')]=_0x4b4217[_0x033f('0x36')]['length']?_0x4b4217[_0x033f('0x36')]:_0x566a28[_0x033f('0x31')];_0x4b4217['order']=qs[_0x033f('0x3a')](_0x309514['query'][_0x033f('0x3a')]);_0x4b4217[_0x033f('0x3b')]=qs[_0x033f('0x34')](_[_0x033f('0x4f')](_0x309514[_0x033f('0x32')],_0x566a28['filters']));if(_0x309514[_0x033f('0x32')][_0x033f('0x3c')]){_0x4b4217[_0x033f('0x3b')]=_['merge'](_0x4b4217[_0x033f('0x3b')],{'$or':_[_0x033f('0x2e')](_0x4b4217[_0x033f('0x36')],function(_0x1dfdbb){var _0x9ceef1={};_0x9ceef1[_0x1dfdbb]={'$like':'%'+_0x309514[_0x033f('0x32')][_0x033f('0x3c')]+'%'};return _0x9ceef1;})});}_0x4b4217=_[_0x033f('0x3d')]({},_0x4b4217,_0x309514[_0x033f('0x40')]);return _0x41e508[_0x033f('0x52')](_0x4b4217);}})['then'](function(_0x1d5433){if(_0x1d5433){_0x41eb11=_0x1d5433[_0x033f('0x37')];if(!_0x309514[_0x033f('0x32')]['hasOwnProperty'](_0x033f('0x38'))){_0x4b4217[_0x033f('0x22')]=qs[_0x033f('0x22')](_0x309514[_0x033f('0x32')][_0x033f('0x22')]);_0x4b4217['offset']=qs[_0x033f('0x20')](_0x309514[_0x033f('0x32')][_0x033f('0x20')]);}return _0x41e508['getDescriptions'](_0x4b4217);}})[_0x033f('0x28')](function(_0x46f4a2){if(_0x46f4a2){return _0x46f4a2?{'count':_0x41eb11,'rows':_0x46f4a2}:null;}})[_0x033f('0x28')](respondWithResult(_0x45e472,null))[_0x033f('0x45')](handleError(_0x45e472,null));};
\ No newline at end of file
index 031d912..4da576a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57fa=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','int_zoho_configurations','util','../../config/logger'];(function(_0x29e7be,_0x326f45){var _0x218009=function(_0x2bebc3){while(--_0x2bebc3){_0x29e7be['push'](_0x29e7be['shift']());}};_0x218009(++_0x326f45);}(_0x57fa,0xe4));var _0xa57f=function(_0x18cffa,_0x514eb4){_0x18cffa=_0x18cffa-0x0;var _0x1fb7a5=_0x57fa[_0x18cffa];return _0x1fb7a5;};'use strict';var _=require('lodash');var util=require(_0xa57f('0x0'));var logger=require(_0xa57f('0x1'))('api');var moment=require(_0xa57f('0x2'));var BPromise=require(_0xa57f('0x3'));var rp=require(_0xa57f('0x4'));var fs=require('fs');var path=require(_0xa57f('0x5'));var rimraf=require(_0xa57f('0x6'));var config=require(_0xa57f('0x7'));var attributes=require(_0xa57f('0x8'));module['exports']=function(_0x65e84f,_0x303fec){return _0x65e84f['define']('ZohoConfiguration',attributes,{'tableName':_0xa57f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc392=['exports','define','ZohoConfiguration','lodash','util','../../config/logger','api','moment','path','../../config/environment','./intZohoConfiguration.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc392,0x19a));var _0x2c39=function(_0x1c09e4,_0x1c9d7d){_0x1c09e4=_0x1c09e4-0x0;var _0x4cdd77=_0xc392[_0x1c09e4];return _0x4cdd77;};'use strict';var _=require(_0x2c39('0x0'));var util=require(_0x2c39('0x1'));var logger=require(_0x2c39('0x2'))(_0x2c39('0x3'));var moment=require(_0x2c39('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2c39('0x5'));var rimraf=require('rimraf');var config=require(_0x2c39('0x6'));var attributes=require(_0x2c39('0x7'));module[_0x2c39('0x8')]=function(_0x2708c3,_0xeb9f2f){return _0x2708c3[_0x2c39('0x9')](_0x2c39('0xa'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1b7e0a7..f81f5df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1360=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request\x20sent','debug','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','info','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x550998,_0x30aff1){var _0x5d2318=function(_0xbd5b59){while(--_0xbd5b59){_0x550998['push'](_0x550998['shift']());}};_0x5d2318(++_0x30aff1);}(_0x1360,0x9a));var _0x0136=function(_0x5600ba,_0xe51f7c){_0x5600ba=_0x5600ba-0x0;var _0x2db0f1=_0x1360[_0x5600ba];return _0x2db0f1;};'use strict';var _=require(_0x0136('0x0'));var util=require(_0x0136('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0136('0x2'));var fs=require('fs');var Redis=require(_0x0136('0x3'));var db=require(_0x0136('0x4'))['db'];var utils=require(_0x0136('0x5'));var logger=require(_0x0136('0x6'))(_0x0136('0x7'));var config=require(_0x0136('0x8'));var jayson=require(_0x0136('0x9'));var client=jayson['client'][_0x0136('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40432d,_0x1f7c24,_0x4bb826){return new BPromise(function(_0x41f113,_0x4d4de9){return client['request'](_0x40432d,_0x4bb826)['then'](function(_0x17c2cb){logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x1f7c24,_0x0136('0xb'));logger[_0x0136('0xc')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x1f7c24,_0x0136('0xb'),JSON[_0x0136('0xd')](_0x17c2cb));if(_0x17c2cb['error']){if(_0x17c2cb[_0x0136('0xe')][_0x0136('0xf')]===0x1f4){logger['error'](_0x0136('0x10'),_0x1f7c24,_0x17c2cb['error'][_0x0136('0x11')]);return _0x4d4de9(_0x17c2cb[_0x0136('0xe')][_0x0136('0x11')]);}logger['error'](_0x0136('0x10'),_0x1f7c24,_0x17c2cb[_0x0136('0xe')][_0x0136('0x11')]);return _0x41f113(_0x17c2cb['error'][_0x0136('0x11')]);}else{logger[_0x0136('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x1f7c24,_0x0136('0xb'));_0x41f113(_0x17c2cb['result']['message']);}})[_0x0136('0x13')](function(_0x332d2e){logger['error'](_0x0136('0x10'),_0x1f7c24,_0x332d2e);_0x4d4de9(_0x332d2e);});});}
\ No newline at end of file
+var _0xa9c6=['../../config/environment','client','http','then','info','ZohoConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x22dd4e,_0x109646){var _0xed19f6=function(_0x207252){while(--_0x207252){_0x22dd4e['push'](_0x22dd4e['shift']());}};_0xed19f6(++_0x109646);}(_0xa9c6,0x16c));var _0x6a9c=function(_0x14c474,_0xbc81aa){_0x14c474=_0x14c474-0x0;var _0x2db629=_0xa9c6[_0x14c474];return _0x2db629;};'use strict';var _=require(_0x6a9c('0x0'));var util=require(_0x6a9c('0x1'));var moment=require(_0x6a9c('0x2'));var BPromise=require(_0x6a9c('0x3'));var rs=require(_0x6a9c('0x4'));var fs=require('fs');var Redis=require(_0x6a9c('0x5'));var db=require(_0x6a9c('0x6'))['db'];var utils=require(_0x6a9c('0x7'));var logger=require(_0x6a9c('0x8'))(_0x6a9c('0x9'));var config=require(_0x6a9c('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x6a9c('0xb')][_0x6a9c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5dc721,_0x1580c3,_0x1f880b){return new BPromise(function(_0x3a4479,_0x48da52){return client['request'](_0x5dc721,_0x1f880b)[_0x6a9c('0xd')](function(_0x2cd043){logger[_0x6a9c('0xe')](_0x6a9c('0xf'),_0x1580c3,'request\x20sent');logger[_0x6a9c('0x10')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x1580c3,_0x6a9c('0x11'),JSON[_0x6a9c('0x12')](_0x2cd043));if(_0x2cd043[_0x6a9c('0x13')]){if(_0x2cd043[_0x6a9c('0x13')]['code']===0x1f4){logger[_0x6a9c('0x13')](_0x6a9c('0xf'),_0x1580c3,_0x2cd043[_0x6a9c('0x13')][_0x6a9c('0x14')]);return _0x48da52(_0x2cd043['error'][_0x6a9c('0x14')]);}logger[_0x6a9c('0x13')](_0x6a9c('0xf'),_0x1580c3,_0x2cd043[_0x6a9c('0x13')][_0x6a9c('0x14')]);return _0x3a4479(_0x2cd043[_0x6a9c('0x13')][_0x6a9c('0x14')]);}else{logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x1580c3,_0x6a9c('0x11'));_0x3a4479(_0x2cd043[_0x6a9c('0x15')][_0x6a9c('0x14')]);}})['catch'](function(_0x4b528e){logger[_0x6a9c('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0x1580c3,_0x4b528e);_0x48da52(_0x4b528e);});});}
\ No newline at end of file
index ace18b1..0684de4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e30=['delete','destroy','exports','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','show','isAuthenticated','create','put','update'];(function(_0x19d7ce,_0x3b6123){var _0x210731=function(_0x3e22b7){while(--_0x3e22b7){_0x19d7ce['push'](_0x19d7ce['shift']());}};_0x210731(++_0x3b6123);}(_0x2e30,0x1e3));var _0x02e3=function(_0x5f2967,_0xd9eaa8){_0x5f2967=_0x5f2967-0x0;var _0x5aa9a7=_0x2e30[_0x5f2967];return _0x5aa9a7;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x02e3('0x0')]();var fs_extra=require(_0x02e3('0x1'));var auth=require(_0x02e3('0x2'));var interaction=require(_0x02e3('0x3'));var config=require(_0x02e3('0x4'));var controller=require('./intZohoField.controller');router[_0x02e3('0x5')]('/',auth['isAuthenticated'](),controller[_0x02e3('0x6')]);router['get'](_0x02e3('0x7'),auth['isAuthenticated'](),controller[_0x02e3('0x8')]);router['post']('/',auth[_0x02e3('0x9')](),controller[_0x02e3('0xa')]);router[_0x02e3('0xb')](_0x02e3('0x7'),auth[_0x02e3('0x9')](),controller[_0x02e3('0xc')]);router[_0x02e3('0xd')](_0x02e3('0x7'),auth[_0x02e3('0x9')](),controller[_0x02e3('0xe')]);module[_0x02e3('0xf')]=router;
\ No newline at end of file
+var _0x48b1=['isAuthenticated','index','/:id','put','update','destroy','exports','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x25890c,_0x5400d2){var _0x182368=function(_0x2d3f47){while(--_0x2d3f47){_0x25890c['push'](_0x25890c['shift']());}};_0x182368(++_0x5400d2);}(_0x48b1,0x1f1));var _0x148b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x48b1[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x148b('0x0'));var express=require('express');var router=express[_0x148b('0x1')]();var fs_extra=require(_0x148b('0x2'));var auth=require(_0x148b('0x3'));var interaction=require(_0x148b('0x4'));var config=require(_0x148b('0x5'));var controller=require('./intZohoField.controller');router[_0x148b('0x6')]('/',auth[_0x148b('0x7')](),controller[_0x148b('0x8')]);router['get'](_0x148b('0x9'),auth[_0x148b('0x7')](),controller['show']);router['post']('/',auth[_0x148b('0x7')](),controller['create']);router[_0x148b('0xa')](_0x148b('0x9'),auth[_0x148b('0x7')](),controller[_0x148b('0xb')]);router['delete'](_0x148b('0x9'),auth[_0x148b('0x7')](),controller[_0x148b('0xc')]);module[_0x148b('0xd')]=router;
\ No newline at end of file
index 54a35ca..e86147e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6236=['keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x4de2a1,_0x48f110){var _0x564460=function(_0x5d7b5){while(--_0x5d7b5){_0x4de2a1['push'](_0x4de2a1['shift']());}};_0x564460(++_0x48f110);}(_0x6236,0x176));var _0x6623=function(_0x9e35e5,_0x4e6b0f){_0x9e35e5=_0x9e35e5-0x0;var _0x22084e=_0x6236[_0x9e35e5];return _0x22084e;};'use strict';var Sequelize=require(_0x6623('0x0'));module[_0x6623('0x1')]={'type':{'type':Sequelize[_0x6623('0x2')](_0x6623('0x3'),_0x6623('0x4'),_0x6623('0x5'),_0x6623('0x6'),_0x6623('0x7')),'defaultValue':_0x6623('0x3')},'content':{'type':Sequelize[_0x6623('0x8')]},'key':{'type':Sequelize[_0x6623('0x8')]},'keyType':{'type':Sequelize[_0x6623('0x2')](_0x6623('0x3'),_0x6623('0x4'),_0x6623('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x6623('0x8')]},'nameField':{'type':Sequelize[_0x6623('0x8')]},'customField':{'type':Sequelize[_0x6623('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x1066=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','picklist'];(function(_0x10a551,_0x3e2f9a){var _0x261da0=function(_0x2e8762){while(--_0x2e8762){_0x10a551['push'](_0x10a551['shift']());}};_0x261da0(++_0x3e2f9a);}(_0x1066,0x1b2));var _0x6106=function(_0x3d7011,_0x47b935){_0x3d7011=_0x3d7011-0x0;var _0x16a147=_0x1066[_0x3d7011];return _0x16a147;};'use strict';var Sequelize=require(_0x6106('0x0'));module[_0x6106('0x1')]={'type':{'type':Sequelize[_0x6106('0x2')](_0x6106('0x3'),_0x6106('0x4'),_0x6106('0x5'),'keyValue',_0x6106('0x6')),'defaultValue':_0x6106('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x6106('0x7')]},'keyType':{'type':Sequelize[_0x6106('0x2')](_0x6106('0x3'),_0x6106('0x4'),_0x6106('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x6106('0x7')]},'nameField':{'type':Sequelize[_0x6106('0x7')]},'customField':{'type':Sequelize[_0x6106('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6106('0x7')]}};
\ No newline at end of file
index b3428cc..c9ce1b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaefa=['keys','filters','fields','attributes','length','nolimit','sort','where','pick','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','intersection','include','find','catch','update','body','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','Content-Range','save','then','destroy','end','error','stack','name','send','index','map','ZohoField','rawAttributes','type','key','model','query'];(function(_0x26f918,_0x30dc61){var _0x496f32=function(_0x5704e8){while(--_0x5704e8){_0x26f918['push'](_0x26f918['shift']());}};_0x496f32(++_0x30dc61);}(_0xaefa,0xf2));var _0xaaef=function(_0x33b40c,_0x46e352){_0x33b40c=_0x33b40c-0x0;var _0xe0a5c2=_0xaefa[_0x33b40c];return _0xe0a5c2;};'use strict';var emlformat=require(_0xaaef('0x0'));var rimraf=require(_0xaaef('0x1'));var zipdir=require(_0xaaef('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xaaef('0x3'));var BPromise=require(_0xaaef('0x4'));var Mustache=require('mustache');var util=require(_0xaaef('0x5'));var path=require(_0xaaef('0x6'));var sox=require(_0xaaef('0x7'));var csv=require(_0xaaef('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaaef('0x9'));var _=require(_0xaaef('0xa'));var squel=require(_0xaaef('0xb'));var crypto=require(_0xaaef('0xc'));var jsforce=require(_0xaaef('0xd'));var deskjs=require(_0xaaef('0xe'));var toCsv=require(_0xaaef('0x8'));var querystring=require(_0xaaef('0xf'));var Papa=require(_0xaaef('0x10'));var Redis=require(_0xaaef('0x11'));var authService=require(_0xaaef('0x12'));var qs=require(_0xaaef('0x13'));var as=require(_0xaaef('0x14'));var hardwareService=require(_0xaaef('0x15'));var logger=require(_0xaaef('0x16'))(_0xaaef('0x17'));var utils=require(_0xaaef('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaaef('0x19'))['db'];function respondWithStatusCode(_0x47e836,_0x1af711){_0x1af711=_0x1af711||0xcc;return function(_0x2c1cbf){if(_0x2c1cbf){return _0x47e836[_0xaaef('0x1a')](_0x1af711);}return _0x47e836['status'](_0x1af711)['end']();};}function respondWithResult(_0x4509d7,_0xfbde67){_0xfbde67=_0xfbde67||0xc8;return function(_0x44e243){if(_0x44e243){return _0x4509d7['status'](_0xfbde67)[_0xaaef('0x1b')](_0x44e243);}};}function respondWithFilteredResult(_0x1e025b,_0x3ce481){return function(_0xb7665e){if(_0xb7665e){var _0x4dc0ac=typeof _0x3ce481[_0xaaef('0x1c')]===_0xaaef('0x1d')&&typeof _0x3ce481[_0xaaef('0x1e')]===_0xaaef('0x1d');var _0x183ec2=_0xb7665e[_0xaaef('0x1f')];var _0x3b7ae3=_0x4dc0ac?0x0:_0x3ce481['offset'];var _0x2e254f=_0x4dc0ac?_0xb7665e[_0xaaef('0x1f')]:_0x3ce481[_0xaaef('0x1c')]+_0x3ce481[_0xaaef('0x1e')];var _0x4b3b78;if(_0x2e254f>=_0x183ec2){_0x2e254f=_0x183ec2;_0x4b3b78=0xc8;}else{_0x4b3b78=0xce;}_0x1e025b[_0xaaef('0x20')](_0x4b3b78);return _0x1e025b['set'](_0xaaef('0x21'),_0x3b7ae3+'-'+_0x2e254f+'/'+_0x183ec2)[_0xaaef('0x1b')](_0xb7665e);}return null;};}function patchUpdates(_0x29bc0d){return function(_0x355a03){try{jsonpatch['apply'](_0x355a03,_0x29bc0d,!![]);}catch(_0x136727){return BPromise['reject'](_0x136727);}return _0x355a03[_0xaaef('0x22')]();};}function saveUpdates(_0x348909,_0x24985e){return function(_0x1fa033){if(_0x1fa033){return _0x1fa033['update'](_0x348909)[_0xaaef('0x23')](function(_0x3e61db){return _0x3e61db;});}return null;};}function removeEntity(_0x1fc303,_0x3efd96){return function(_0x3a81d0){if(_0x3a81d0){return _0x3a81d0[_0xaaef('0x24')]()[_0xaaef('0x23')](function(){_0x1fc303[_0xaaef('0x20')](0xcc)[_0xaaef('0x25')]();});}};}function handleEntityNotFound(_0x294898,_0x4ef237){return function(_0x4cad59){if(!_0x4cad59){_0x294898[_0xaaef('0x1a')](0x194);}return _0x4cad59;};}function handleError(_0x303186,_0xdfcd0a){_0xdfcd0a=_0xdfcd0a||0x1f4;return function(_0x1657a7){logger[_0xaaef('0x26')](_0x1657a7[_0xaaef('0x27')]);if(_0x1657a7[_0xaaef('0x28')]){delete _0x1657a7[_0xaaef('0x28')];}_0x303186['status'](_0xdfcd0a)[_0xaaef('0x29')](_0x1657a7);};}exports[_0xaaef('0x2a')]=function(_0xf28f62,_0x29f721){var _0x4513db={},_0x5b6daf={},_0xaa1e72={'count':0x0,'rows':[]};var _0x54fcec=_[_0xaaef('0x2b')](db[_0xaaef('0x2c')][_0xaaef('0x2d')],function(_0x10956d){return{'name':_0x10956d['fieldName'],'type':_0x10956d[_0xaaef('0x2e')][_0xaaef('0x2f')]};});_0x5b6daf[_0xaaef('0x30')]=_['map'](_0x54fcec,_0xaaef('0x28'));_0x5b6daf[_0xaaef('0x31')]=_[_0xaaef('0x32')](_0xf28f62[_0xaaef('0x31')]);_0x5b6daf[_0xaaef('0x33')]=_['intersection'](_0x5b6daf[_0xaaef('0x30')],_0x5b6daf[_0xaaef('0x31')]);_0x4513db['attributes']=_['intersection'](_0x5b6daf[_0xaaef('0x30')],qs[_0xaaef('0x34')](_0xf28f62[_0xaaef('0x31')][_0xaaef('0x34')]));_0x4513db[_0xaaef('0x35')]=_0x4513db['attributes'][_0xaaef('0x36')]?_0x4513db[_0xaaef('0x35')]:_0x5b6daf[_0xaaef('0x30')];if(!_0xf28f62['query']['hasOwnProperty'](_0xaaef('0x37'))){_0x4513db[_0xaaef('0x1e')]=qs[_0xaaef('0x1e')](_0xf28f62[_0xaaef('0x31')][_0xaaef('0x1e')]);_0x4513db[_0xaaef('0x1c')]=qs[_0xaaef('0x1c')](_0xf28f62[_0xaaef('0x31')][_0xaaef('0x1c')]);}_0x4513db['order']=qs[_0xaaef('0x38')](_0xf28f62[_0xaaef('0x31')][_0xaaef('0x38')]);_0x4513db[_0xaaef('0x39')]=qs[_0xaaef('0x33')](_[_0xaaef('0x3a')](_0xf28f62[_0xaaef('0x31')],_0x5b6daf['filters']),_0x54fcec);if(_0xf28f62[_0xaaef('0x31')]['filter']){_0x4513db['where']=_[_0xaaef('0x3b')](_0x4513db[_0xaaef('0x39')],{'$or':_[_0xaaef('0x2b')](_0x54fcec,function(_0x2333e6){if(_0x2333e6[_0xaaef('0x2e')]!==_0xaaef('0x3c')){var _0x2bdb1a={};_0x2bdb1a[_0x2333e6[_0xaaef('0x28')]]={'$like':'%'+_0xf28f62[_0xaaef('0x31')]['filter']+'%'};return _0x2bdb1a;}})});}_0x4513db=_[_0xaaef('0x3b')]({},_0x4513db,_0xf28f62[_0xaaef('0x3d')]);var _0x3f0ba9={'where':_0x4513db[_0xaaef('0x39')]};return db[_0xaaef('0x2c')][_0xaaef('0x1f')](_0x3f0ba9)[_0xaaef('0x23')](function(_0x5d58f7){_0xaa1e72[_0xaaef('0x1f')]=_0x5d58f7;if(_0xf28f62[_0xaaef('0x31')][_0xaaef('0x3e')]){_0x4513db['include']=[{'all':!![]}];}return db['ZohoField'][_0xaaef('0x3f')](_0x4513db);})[_0xaaef('0x23')](function(_0x1960b4){_0xaa1e72[_0xaaef('0x40')]=_0x1960b4;return _0xaa1e72;})[_0xaaef('0x23')](respondWithFilteredResult(_0x29f721,_0x4513db))['catch'](handleError(_0x29f721,null));};exports[_0xaaef('0x41')]=function(_0x777de3,_0x44800c){var _0x4ae3b8={'raw':!![],'where':{'id':_0x777de3[_0xaaef('0x42')]['id']}},_0x286105={};_0x286105[_0xaaef('0x30')]=_[_0xaaef('0x32')](db[_0xaaef('0x2c')]['rawAttributes']);_0x286105[_0xaaef('0x31')]=_[_0xaaef('0x32')](_0x777de3[_0xaaef('0x31')]);_0x286105['filters']=_[_0xaaef('0x43')](_0x286105['model'],_0x286105[_0xaaef('0x31')]);_0x4ae3b8[_0xaaef('0x35')]=_['intersection'](_0x286105[_0xaaef('0x30')],qs['fields'](_0x777de3[_0xaaef('0x31')][_0xaaef('0x34')]));_0x4ae3b8['attributes']=_0x4ae3b8['attributes'][_0xaaef('0x36')]?_0x4ae3b8[_0xaaef('0x35')]:_0x286105[_0xaaef('0x30')];if(_0x777de3['query'][_0xaaef('0x3e')]){_0x4ae3b8[_0xaaef('0x44')]=[{'all':!![]}];}_0x4ae3b8=_[_0xaaef('0x3b')]({},_0x4ae3b8,_0x777de3[_0xaaef('0x3d')]);return db[_0xaaef('0x2c')][_0xaaef('0x45')](_0x4ae3b8)['then'](handleEntityNotFound(_0x44800c,null))[_0xaaef('0x23')](respondWithResult(_0x44800c,null))[_0xaaef('0x46')](handleError(_0x44800c,null));};exports['create']=function(_0x440d23,_0x3541e8){return db[_0xaaef('0x2c')]['create'](_0x440d23['body'],{})[_0xaaef('0x23')](respondWithResult(_0x3541e8,0xc9))[_0xaaef('0x46')](handleError(_0x3541e8,null));};exports[_0xaaef('0x47')]=function(_0x346d50,_0x526dbe){if(_0x346d50[_0xaaef('0x48')]['id']){delete _0x346d50[_0xaaef('0x48')]['id'];}return db[_0xaaef('0x2c')]['find']({'where':{'id':_0x346d50[_0xaaef('0x42')]['id']}})[_0xaaef('0x23')](handleEntityNotFound(_0x526dbe,null))[_0xaaef('0x23')](saveUpdates(_0x346d50[_0xaaef('0x48')],null))[_0xaaef('0x23')](respondWithResult(_0x526dbe,null))[_0xaaef('0x46')](handleError(_0x526dbe,null));};exports[_0xaaef('0x24')]=function(_0x5ade3d,_0x20082c){return db[_0xaaef('0x2c')][_0xaaef('0x45')]({'where':{'id':_0x5ade3d['params']['id']}})['then'](handleEntityNotFound(_0x20082c,null))[_0xaaef('0x23')](removeEntity(_0x20082c,null))[_0xaaef('0x46')](handleError(_0x20082c,null));};
\ No newline at end of file
+var _0x9666=['zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','undefined','limit','count','offset','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','ZohoField','includeAll','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x9666,0x17a));var _0x6966=function(_0x28e330,_0x1a2878){_0x28e330=_0x28e330-0x0;var _0x513208=_0x9666[_0x28e330];return _0x513208;};'use strict';var emlformat=require(_0x6966('0x0'));var rimraf=require(_0x6966('0x1'));var zipdir=require(_0x6966('0x2'));var jsonpatch=require(_0x6966('0x3'));var rp=require('request-promise');var moment=require(_0x6966('0x4'));var BPromise=require(_0x6966('0x5'));var Mustache=require(_0x6966('0x6'));var util=require('util');var path=require('path');var sox=require(_0x6966('0x7'));var csv=require(_0x6966('0x8'));var ejs=require(_0x6966('0x9'));var fs=require('fs');var fs_extra=require(_0x6966('0xa'));var _=require(_0x6966('0xb'));var squel=require(_0x6966('0xc'));var crypto=require('crypto');var jsforce=require(_0x6966('0xd'));var deskjs=require(_0x6966('0xe'));var toCsv=require(_0x6966('0x8'));var querystring=require('querystring');var Papa=require(_0x6966('0xf'));var Redis=require(_0x6966('0x10'));var authService=require(_0x6966('0x11'));var qs=require(_0x6966('0x12'));var as=require(_0x6966('0x13'));var hardwareService=require(_0x6966('0x14'));var logger=require(_0x6966('0x15'))(_0x6966('0x16'));var utils=require(_0x6966('0x17'));var config=require(_0x6966('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c5272,_0x154c15){_0x154c15=_0x154c15||0xcc;return function(_0x2ce913){if(_0x2ce913){return _0x4c5272[_0x6966('0x19')](_0x154c15);}return _0x4c5272['status'](_0x154c15)['end']();};}function respondWithResult(_0x584bf2,_0x235ba3){_0x235ba3=_0x235ba3||0xc8;return function(_0xbd4ea2){if(_0xbd4ea2){return _0x584bf2[_0x6966('0x1a')](_0x235ba3)[_0x6966('0x1b')](_0xbd4ea2);}};}function respondWithFilteredResult(_0x19428c,_0x48d414){return function(_0x204200){if(_0x204200){var _0x1bf59d=typeof _0x48d414['offset']===_0x6966('0x1c')&&typeof _0x48d414[_0x6966('0x1d')]===_0x6966('0x1c');var _0x529dbd=_0x204200[_0x6966('0x1e')];var _0x4bf5b8=_0x1bf59d?0x0:_0x48d414[_0x6966('0x1f')];var _0x519049=_0x1bf59d?_0x204200['count']:_0x48d414['offset']+_0x48d414[_0x6966('0x1d')];var _0x5eef44;if(_0x519049>=_0x529dbd){_0x519049=_0x529dbd;_0x5eef44=0xc8;}else{_0x5eef44=0xce;}_0x19428c['status'](_0x5eef44);return _0x19428c['set']('Content-Range',_0x4bf5b8+'-'+_0x519049+'/'+_0x529dbd)['json'](_0x204200);}return null;};}function patchUpdates(_0x197c2c){return function(_0x247570){try{jsonpatch[_0x6966('0x20')](_0x247570,_0x197c2c,!![]);}catch(_0x4e8342){return BPromise[_0x6966('0x21')](_0x4e8342);}return _0x247570[_0x6966('0x22')]();};}function saveUpdates(_0x43349b,_0x8c7833){return function(_0x33fc7f){if(_0x33fc7f){return _0x33fc7f[_0x6966('0x23')](_0x43349b)[_0x6966('0x24')](function(_0x2af0b7){return _0x2af0b7;});}return null;};}function removeEntity(_0x3772d7,_0x509631){return function(_0x24af6a){if(_0x24af6a){return _0x24af6a[_0x6966('0x25')]()[_0x6966('0x24')](function(){_0x3772d7[_0x6966('0x1a')](0xcc)[_0x6966('0x26')]();});}};}function handleEntityNotFound(_0x27db0e,_0x44a5df){return function(_0x4e4c30){if(!_0x4e4c30){_0x27db0e[_0x6966('0x19')](0x194);}return _0x4e4c30;};}function handleError(_0x5a7f85,_0x433601){_0x433601=_0x433601||0x1f4;return function(_0x4f7aa2){logger[_0x6966('0x27')](_0x4f7aa2[_0x6966('0x28')]);if(_0x4f7aa2[_0x6966('0x29')]){delete _0x4f7aa2[_0x6966('0x29')];}_0x5a7f85[_0x6966('0x1a')](_0x433601)[_0x6966('0x2a')](_0x4f7aa2);};}exports[_0x6966('0x2b')]=function(_0x1b86a7,_0x2c9fbb){var _0x4a85c7={},_0x270919={},_0x35fdb4={'count':0x0,'rows':[]};var _0x59a8d6=_[_0x6966('0x2c')](db['ZohoField'][_0x6966('0x2d')],function(_0x297c21){return{'name':_0x297c21[_0x6966('0x2e')],'type':_0x297c21[_0x6966('0x2f')][_0x6966('0x30')]};});_0x270919[_0x6966('0x31')]=_[_0x6966('0x2c')](_0x59a8d6,_0x6966('0x29'));_0x270919[_0x6966('0x32')]=_[_0x6966('0x33')](_0x1b86a7[_0x6966('0x32')]);_0x270919[_0x6966('0x34')]=_[_0x6966('0x35')](_0x270919[_0x6966('0x31')],_0x270919[_0x6966('0x32')]);_0x4a85c7[_0x6966('0x36')]=_['intersection'](_0x270919[_0x6966('0x31')],qs['fields'](_0x1b86a7[_0x6966('0x32')][_0x6966('0x37')]));_0x4a85c7[_0x6966('0x36')]=_0x4a85c7[_0x6966('0x36')][_0x6966('0x38')]?_0x4a85c7[_0x6966('0x36')]:_0x270919[_0x6966('0x31')];if(!_0x1b86a7[_0x6966('0x32')][_0x6966('0x39')](_0x6966('0x3a'))){_0x4a85c7['limit']=qs[_0x6966('0x1d')](_0x1b86a7[_0x6966('0x32')][_0x6966('0x1d')]);_0x4a85c7['offset']=qs['offset'](_0x1b86a7[_0x6966('0x32')][_0x6966('0x1f')]);}_0x4a85c7['order']=qs[_0x6966('0x3b')](_0x1b86a7['query']['sort']);_0x4a85c7[_0x6966('0x3c')]=qs[_0x6966('0x34')](_[_0x6966('0x3d')](_0x1b86a7[_0x6966('0x32')],_0x270919['filters']),_0x59a8d6);if(_0x1b86a7[_0x6966('0x32')][_0x6966('0x3e')]){_0x4a85c7[_0x6966('0x3c')]=_[_0x6966('0x3f')](_0x4a85c7[_0x6966('0x3c')],{'$or':_[_0x6966('0x2c')](_0x59a8d6,function(_0x3cb629){if(_0x3cb629[_0x6966('0x2f')]!==_0x6966('0x40')){var _0x112bff={};_0x112bff[_0x3cb629[_0x6966('0x29')]]={'$like':'%'+_0x1b86a7[_0x6966('0x32')][_0x6966('0x3e')]+'%'};return _0x112bff;}})});}_0x4a85c7=_['merge']({},_0x4a85c7,_0x1b86a7[_0x6966('0x41')]);var _0x5c9590={'where':_0x4a85c7['where']};return db[_0x6966('0x42')][_0x6966('0x1e')](_0x5c9590)['then'](function(_0x57949e){_0x35fdb4[_0x6966('0x1e')]=_0x57949e;if(_0x1b86a7[_0x6966('0x32')][_0x6966('0x43')]){_0x4a85c7['include']=[{'all':!![]}];}return db[_0x6966('0x42')][_0x6966('0x44')](_0x4a85c7);})[_0x6966('0x24')](function(_0x6af6a8){_0x35fdb4[_0x6966('0x45')]=_0x6af6a8;return _0x35fdb4;})[_0x6966('0x24')](respondWithFilteredResult(_0x2c9fbb,_0x4a85c7))[_0x6966('0x46')](handleError(_0x2c9fbb,null));};exports[_0x6966('0x47')]=function(_0x1df2cb,_0x5356fc){var _0x49be81={'raw':!![],'where':{'id':_0x1df2cb[_0x6966('0x48')]['id']}},_0x50ec04={};_0x50ec04['model']=_[_0x6966('0x33')](db[_0x6966('0x42')]['rawAttributes']);_0x50ec04[_0x6966('0x32')]=_['keys'](_0x1df2cb[_0x6966('0x32')]);_0x50ec04[_0x6966('0x34')]=_[_0x6966('0x35')](_0x50ec04[_0x6966('0x31')],_0x50ec04[_0x6966('0x32')]);_0x49be81[_0x6966('0x36')]=_[_0x6966('0x35')](_0x50ec04[_0x6966('0x31')],qs[_0x6966('0x37')](_0x1df2cb[_0x6966('0x32')][_0x6966('0x37')]));_0x49be81['attributes']=_0x49be81[_0x6966('0x36')][_0x6966('0x38')]?_0x49be81[_0x6966('0x36')]:_0x50ec04['model'];if(_0x1df2cb[_0x6966('0x32')][_0x6966('0x43')]){_0x49be81['include']=[{'all':!![]}];}_0x49be81=_[_0x6966('0x3f')]({},_0x49be81,_0x1df2cb[_0x6966('0x41')]);return db[_0x6966('0x42')][_0x6966('0x49')](_0x49be81)[_0x6966('0x24')](handleEntityNotFound(_0x5356fc,null))[_0x6966('0x24')](respondWithResult(_0x5356fc,null))[_0x6966('0x46')](handleError(_0x5356fc,null));};exports[_0x6966('0x4a')]=function(_0x3635b8,_0x154d3e){return db['ZohoField'][_0x6966('0x4a')](_0x3635b8['body'],{})[_0x6966('0x24')](respondWithResult(_0x154d3e,0xc9))[_0x6966('0x46')](handleError(_0x154d3e,null));};exports['update']=function(_0x301555,_0x4955b8){if(_0x301555[_0x6966('0x4b')]['id']){delete _0x301555[_0x6966('0x4b')]['id'];}return db[_0x6966('0x42')]['find']({'where':{'id':_0x301555[_0x6966('0x48')]['id']}})['then'](handleEntityNotFound(_0x4955b8,null))[_0x6966('0x24')](saveUpdates(_0x301555[_0x6966('0x4b')],null))[_0x6966('0x24')](respondWithResult(_0x4955b8,null))['catch'](handleError(_0x4955b8,null));};exports['destroy']=function(_0x3422fe,_0x40175c){return db[_0x6966('0x42')][_0x6966('0x49')]({'where':{'id':_0x3422fe[_0x6966('0x48')]['id']}})['then'](handleEntityNotFound(_0x40175c,null))[_0x6966('0x24')](removeEntity(_0x40175c,null))[_0x6966('0x46')](handleError(_0x40175c,null));};
\ No newline at end of file
index 9999212..0dd069f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ace=['request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','FieldId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x190533,_0x530fab){var _0x307aaa=function(_0x16a0fd){while(--_0x16a0fd){_0x190533['push'](_0x190533['shift']());}};_0x307aaa(++_0x530fab);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x34efa6,_0x343fe2){_0x34efa6=_0x34efa6-0x0;var _0x469490=_0x8ace[_0x34efa6];return _0x469490;};'use strict';var _=require(_0xe8ac('0x0'));var util=require(_0xe8ac('0x1'));var logger=require(_0xe8ac('0x2'))(_0xe8ac('0x3'));var moment=require(_0xe8ac('0x4'));var BPromise=require(_0xe8ac('0x5'));var rp=require(_0xe8ac('0x6'));var fs=require('fs');var path=require(_0xe8ac('0x7'));var rimraf=require(_0xe8ac('0x8'));var config=require(_0xe8ac('0x9'));var attributes=require(_0xe8ac('0xa'));module[_0xe8ac('0xb')]=function(_0x170e14,_0x2b48ec){return _0x170e14['define'](_0xe8ac('0xc'),attributes,{'tableName':_0xe8ac('0xd'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':['idField',_0xe8ac('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbbbc=['./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x26e105,_0x821a88){_0x26e105=_0x26e105-0x0;var _0x534f19=_0xbbbc[_0x26e105];return _0x534f19;};'use strict';var _=require(_0xcbbb('0x0'));var util=require(_0xcbbb('0x1'));var logger=require(_0xcbbb('0x2'))(_0xcbbb('0x3'));var moment=require(_0xcbbb('0x4'));var BPromise=require(_0xcbbb('0x5'));var rp=require(_0xcbbb('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcbbb('0x7'));var config=require(_0xcbbb('0x8'));var attributes=require(_0xcbbb('0x9'));module[_0xcbbb('0xa')]=function(_0x43ff05,_0x4978a9){return _0x43ff05[_0xcbbb('0xb')](_0xcbbb('0xc'),attributes,{'tableName':_0xcbbb('0xd'),'paranoid':![],'indexes':[{'name':_0xcbbb('0xe'),'fields':[_0xcbbb('0xf'),_0xcbbb('0x10')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 8b889fd..a32bb5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d47=['request','then','info','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x1d47,0x1ab));var _0x71d4=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x1d47[_0x9df060];return _0x338dfe;};'use strict';var _=require(_0x71d4('0x0'));var util=require(_0x71d4('0x1'));var moment=require('moment');var BPromise=require(_0x71d4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x71d4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x71d4('0x4'));var logger=require(_0x71d4('0x5'))(_0x71d4('0x6'));var config=require(_0x71d4('0x7'));var jayson=require(_0x71d4('0x8'));var client=jayson['client'][_0x71d4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e95ae,_0x45c98f,_0x4d1cd4){return new BPromise(function(_0x4fb5fb,_0x445ea9){return client[_0x71d4('0xa')](_0x3e95ae,_0x4d1cd4)[_0x71d4('0xb')](function(_0x24bbea){logger[_0x71d4('0xc')](_0x71d4('0xd'),_0x45c98f,'request\x20sent');logger[_0x71d4('0xe')](_0x71d4('0xf'),_0x45c98f,_0x71d4('0x10'),JSON[_0x71d4('0x11')](_0x24bbea));if(_0x24bbea[_0x71d4('0x12')]){if(_0x24bbea[_0x71d4('0x12')][_0x71d4('0x13')]===0x1f4){logger[_0x71d4('0x12')](_0x71d4('0xd'),_0x45c98f,_0x24bbea['error'][_0x71d4('0x14')]);return _0x445ea9(_0x24bbea['error'][_0x71d4('0x14')]);}logger[_0x71d4('0x12')](_0x71d4('0xd'),_0x45c98f,_0x24bbea[_0x71d4('0x12')][_0x71d4('0x14')]);return _0x4fb5fb(_0x24bbea[_0x71d4('0x12')]['message']);}else{logger[_0x71d4('0xc')]('ZohoField,\x20%s,\x20%s',_0x45c98f,_0x71d4('0x10'));_0x4fb5fb(_0x24bbea[_0x71d4('0x15')]['message']);}})[_0x71d4('0x16')](function(_0x291267){logger[_0x71d4('0x12')](_0x71d4('0xd'),_0x45c98f,_0x291267);_0x445ea9(_0x291267);});});}
\ No newline at end of file
+var _0x3307=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','error','code','message','ZohoField,\x20%s,\x20%s','result','catch'];(function(_0xc4cfc6,_0x38d4fb){var _0x35f6aa=function(_0x875e54){while(--_0x875e54){_0xc4cfc6['push'](_0xc4cfc6['shift']());}};_0x35f6aa(++_0x38d4fb);}(_0x3307,0x1b8));var _0x7330=function(_0x2bda34,_0x575ff5){_0x2bda34=_0x2bda34-0x0;var _0x166dc9=_0x3307[_0x2bda34];return _0x166dc9;};'use strict';var _=require(_0x7330('0x0'));var util=require(_0x7330('0x1'));var moment=require(_0x7330('0x2'));var BPromise=require(_0x7330('0x3'));var rs=require(_0x7330('0x4'));var fs=require('fs');var Redis=require(_0x7330('0x5'));var db=require(_0x7330('0x6'))['db'];var utils=require(_0x7330('0x7'));var logger=require('../../config/logger')(_0x7330('0x8'));var config=require(_0x7330('0x9'));var jayson=require(_0x7330('0xa'));var client=jayson[_0x7330('0xb')][_0x7330('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5198ea,_0x233453,_0x3042cb){return new BPromise(function(_0x52d313,_0x3f0bf5){return client['request'](_0x5198ea,_0x3042cb)['then'](function(_0x314d4b){logger[_0x7330('0xd')]('ZohoField,\x20%s,\x20%s',_0x233453,_0x7330('0xe'));logger['debug'](_0x7330('0xf'),_0x233453,'request\x20sent',JSON['stringify'](_0x314d4b));if(_0x314d4b[_0x7330('0x10')]){if(_0x314d4b[_0x7330('0x10')][_0x7330('0x11')]===0x1f4){logger[_0x7330('0x10')]('ZohoField,\x20%s,\x20%s',_0x233453,_0x314d4b[_0x7330('0x10')]['message']);return _0x3f0bf5(_0x314d4b[_0x7330('0x10')][_0x7330('0x12')]);}logger['error']('ZohoField,\x20%s,\x20%s',_0x233453,_0x314d4b['error']['message']);return _0x52d313(_0x314d4b[_0x7330('0x10')][_0x7330('0x12')]);}else{logger[_0x7330('0xd')](_0x7330('0x13'),_0x233453,_0x7330('0xe'));_0x52d313(_0x314d4b[_0x7330('0x14')][_0x7330('0x12')]);}})[_0x7330('0x15')](function(_0x59ebcd){logger[_0x7330('0x10')](_0x7330('0x13'),_0x233453,_0x59ebcd);_0x3f0bf5(_0x59ebcd);});});}
\ No newline at end of file
index d2b7bfc..22ba13b 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(_0x434ee7,_0x496bec){var _0xba3439=function(_0x522b54){while(--_0x522b54){_0x434ee7['push'](_0x434ee7['shift']());}};_0xba3439(++_0x496bec);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
+var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x60a80a,_0x890b8a){var _0x44ecd1=function(_0x1b7ed8){while(--_0x1b7ed8){_0x60a80a['push'](_0x60a80a['shift']());}};_0x44ecd1(++_0x890b8a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
index 06f2704..fc5e7e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53d0=['BOOLEAN','state','sequelize','exports','STRING','unique_name_and_version','app.js','INTEGER'];(function(_0x16c1a5,_0x17dfb0){var _0x421b5e=function(_0x2813d2){while(--_0x2813d2){_0x16c1a5['push'](_0x16c1a5['shift']());}};_0x421b5e(++_0x17dfb0);}(_0x53d0,0xaa));var _0x053d=function(_0x9bfd98,_0x4ca203){_0x9bfd98=_0x9bfd98-0x0;var _0x30e1c1=_0x53d0[_0x9bfd98];return _0x30e1c1;};'use strict';var Sequelize=require(_0x053d('0x0'));module[_0x053d('0x1')]={'name':{'type':Sequelize[_0x053d('0x2')],'allowNull':![],'unique':_0x053d('0x3')},'version':{'type':Sequelize[_0x053d('0x2')],'allowNull':![],'unique':_0x053d('0x3')},'main':{'type':Sequelize[_0x053d('0x2')],'defaultValue':_0x053d('0x4')},'filename':{'type':Sequelize[_0x053d('0x2')]},'path':{'type':Sequelize[_0x053d('0x2')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x053d('0x5')]},'active':{'type':Sequelize[_0x053d('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0x053d('0x2')]},'logo':{'type':Sequelize[_0x053d('0x2')]},'state':{'type':Sequelize[_0x053d('0x2')],'unique':_0x053d('0x7')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x053d('0x2')]},'remoteUri':{'type':Sequelize[_0x053d('0x2')]},'link':{'type':Sequelize[_0x053d('0x2')],'defaultValue':'#'}};
\ No newline at end of file
+var _0xb2e7=['sequelize','exports','STRING','unique_name_and_version','app.js','BOOLEAN','state'];(function(_0x3411ce,_0x113e4d){var _0x1451d4=function(_0x1f7325){while(--_0x1f7325){_0x3411ce['push'](_0x3411ce['shift']());}};_0x1451d4(++_0x113e4d);}(_0xb2e7,0x111));var _0x7b2e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb2e7[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x7b2e('0x0'));module[_0x7b2e('0x1')]={'name':{'type':Sequelize[_0x7b2e('0x2')],'allowNull':![],'unique':_0x7b2e('0x3')},'version':{'type':Sequelize[_0x7b2e('0x2')],'allowNull':![],'unique':_0x7b2e('0x3')},'main':{'type':Sequelize['STRING'],'defaultValue':_0x7b2e('0x4')},'filename':{'type':Sequelize[_0x7b2e('0x2')]},'path':{'type':Sequelize[_0x7b2e('0x2')]},'type':{'type':Sequelize[_0x7b2e('0x2')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x7b2e('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x7b2e('0x2')]},'logo':{'type':Sequelize[_0x7b2e('0x2')]},'state':{'type':Sequelize['STRING'],'unique':_0x7b2e('0x6')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x7b2e('0x2')]},'link':{'type':Sequelize[_0x7b2e('0x2')],'defaultValue':'#'}};
\ No newline at end of file
index beb15cf..72dd5f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53ec=['count','set','Content-Range','apply','reject','save','then','sendStatus','name','send','map','Integration','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','rows','show','params','include','find','catch','create','update','body','destroy','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'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x53ec,0x192));var _0xc53e=function(_0x4df671,_0x12b67f){_0x4df671=_0x4df671-0x0;var _0x3f9658=_0x53ec[_0x4df671];return _0x3f9658;};'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);};}exports['index']=function(_0x24a77e,_0x5112d2){var _0x5ce216={},_0x8f0ee6={},_0x6a62b0={'count':0x0,'rows':[]};var _0x42dec1=_[_0xc53e('0x28')](db[_0xc53e('0x29')][_0xc53e('0x2a')],function(_0x3280fe){return{'name':_0x3280fe[_0xc53e('0x2b')],'type':_0x3280fe['type'][_0xc53e('0x2c')]};});_0x8f0ee6[_0xc53e('0x2d')]=_[_0xc53e('0x28')](_0x42dec1,'name');_0x8f0ee6[_0xc53e('0x2e')]=_['keys'](_0x24a77e[_0xc53e('0x2e')]);_0x8f0ee6[_0xc53e('0x2f')]=_['intersection'](_0x8f0ee6['model'],_0x8f0ee6[_0xc53e('0x2e')]);_0x5ce216[_0xc53e('0x30')]=_[_0xc53e('0x31')](_0x8f0ee6[_0xc53e('0x2d')],qs[_0xc53e('0x32')](_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x32')]));_0x5ce216[_0xc53e('0x30')]=_0x5ce216['attributes'][_0xc53e('0x33')]?_0x5ce216[_0xc53e('0x30')]:_0x8f0ee6[_0xc53e('0x2d')];if(!_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x34')](_0xc53e('0x35'))){_0x5ce216[_0xc53e('0x1d')]=qs[_0xc53e('0x1d')](_0x24a77e[_0xc53e('0x2e')]['limit']);_0x5ce216[_0xc53e('0x1b')]=qs['offset'](_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x1b')]);}_0x5ce216['order']=qs[_0xc53e('0x36')](_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x36')]);_0x5ce216['where']=qs[_0xc53e('0x2f')](_[_0xc53e('0x37')](_0x24a77e[_0xc53e('0x2e')],_0x8f0ee6[_0xc53e('0x2f')]),_0x42dec1);if(_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x38')]){_0x5ce216[_0xc53e('0x39')]=_['merge'](_0x5ce216[_0xc53e('0x39')],{'$or':_[_0xc53e('0x28')](_0x42dec1,function(_0x2db711){if(_0x2db711['type']!==_0xc53e('0x3a')){var _0x5e8ab7={};_0x5e8ab7[_0x2db711[_0xc53e('0x26')]]={'$like':'%'+_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x38')]+'%'};return _0x5e8ab7;}})});}_0x5ce216=_[_0xc53e('0x3b')]({},_0x5ce216,_0x24a77e[_0xc53e('0x3c')]);var _0x5507d0={'where':_0x5ce216[_0xc53e('0x39')]};return db[_0xc53e('0x29')]['count'](_0x5507d0)['then'](function(_0x5e9e15){_0x6a62b0['count']=_0x5e9e15;if(_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x3d')]){_0x5ce216['include']=[{'all':!![]}];}return db[_0xc53e('0x29')]['findAll'](_0x5ce216);})['then'](function(_0x53447e){_0x6a62b0[_0xc53e('0x3e')]=_0x53447e;return _0x6a62b0;})['then'](respondWithFilteredResult(_0x5112d2,_0x5ce216))['catch'](handleError(_0x5112d2,null));};exports[_0xc53e('0x3f')]=function(_0x53a82f,_0x422088){var _0x360af9={'raw':![],'where':{'id':_0x53a82f[_0xc53e('0x40')]['id']}},_0x49f204={};_0x49f204[_0xc53e('0x2d')]=_['keys'](db[_0xc53e('0x29')]['rawAttributes']);_0x49f204['query']=_['keys'](_0x53a82f['query']);_0x49f204[_0xc53e('0x2f')]=_[_0xc53e('0x31')](_0x49f204[_0xc53e('0x2d')],_0x49f204['query']);_0x360af9[_0xc53e('0x30')]=_[_0xc53e('0x31')](_0x49f204['model'],qs['fields'](_0x53a82f[_0xc53e('0x2e')][_0xc53e('0x32')]));_0x360af9[_0xc53e('0x30')]=_0x360af9['attributes'][_0xc53e('0x33')]?_0x360af9[_0xc53e('0x30')]:_0x49f204[_0xc53e('0x2d')];if(_0x53a82f[_0xc53e('0x2e')][_0xc53e('0x3d')]){_0x360af9[_0xc53e('0x41')]=[{'all':!![]}];}_0x360af9=_[_0xc53e('0x3b')]({},_0x360af9,_0x53a82f['options']);return db[_0xc53e('0x29')][_0xc53e('0x42')](_0x360af9)[_0xc53e('0x24')](handleEntityNotFound(_0x422088,null))['then'](respondWithResult(_0x422088,null))[_0xc53e('0x43')](handleError(_0x422088,null));};exports[_0xc53e('0x44')]=function(_0x4458c8,_0x15e744){return db[_0xc53e('0x29')][_0xc53e('0x44')](_0x4458c8['body'],{})[_0xc53e('0x24')](respondWithResult(_0x15e744,0xc9))[_0xc53e('0x43')](handleError(_0x15e744,null));};exports[_0xc53e('0x45')]=function(_0x5a6e41,_0x33d45c){if(_0x5a6e41[_0xc53e('0x46')]['id']){delete _0x5a6e41[_0xc53e('0x46')]['id'];}return db[_0xc53e('0x29')][_0xc53e('0x42')]({'where':{'id':_0x5a6e41[_0xc53e('0x40')]['id']}})[_0xc53e('0x24')](handleEntityNotFound(_0x33d45c,null))[_0xc53e('0x24')](saveUpdates(_0x5a6e41[_0xc53e('0x46')],null))[_0xc53e('0x24')](respondWithResult(_0x33d45c,null))['catch'](handleError(_0x33d45c,null));};exports[_0xc53e('0x47')]=function(_0x17cf13,_0x38520c){return db[_0xc53e('0x29')][_0xc53e('0x42')]({'where':{'id':_0x17cf13['params']['id']}})['then'](handleEntityNotFound(_0x38520c,null))[_0xc53e('0x24')](removeEntity(_0x38520c,null))['catch'](handleError(_0x38520c,null));};
\ No newline at end of file
+var _0x66fa=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','type','key','map','query','keys','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','includeAll','include','Integration','findAll','rows','catch','merge','options','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x66fa,0x117));var _0xa66f=function(_0x2ad2b8,_0x4daaa2){_0x2ad2b8=_0x2ad2b8-0x0;var _0x345475=_0x66fa[_0x2ad2b8];return _0x345475;};'use strict';var emlformat=require(_0xa66f('0x0'));var rimraf=require(_0xa66f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa66f('0x2'));var rp=require(_0xa66f('0x3'));var moment=require(_0xa66f('0x4'));var BPromise=require(_0xa66f('0x5'));var Mustache=require(_0xa66f('0x6'));var util=require(_0xa66f('0x7'));var path=require(_0xa66f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa66f('0x9'));var fs=require('fs');var fs_extra=require(_0xa66f('0xa'));var _=require(_0xa66f('0xb'));var squel=require(_0xa66f('0xc'));var crypto=require(_0xa66f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa66f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa66f('0xf'));var Papa=require('papaparse');var Redis=require(_0xa66f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa66f('0x11'));var logger=require(_0xa66f('0x12'))('api');var utils=require(_0xa66f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xa66f('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x251189,_0x14af70){_0x14af70=_0x14af70||0xcc;return function(_0xca12f8){if(_0xca12f8){return _0x251189['sendStatus'](_0x14af70);}return _0x251189['status'](_0x14af70)[_0xa66f('0x15')]();};}function respondWithResult(_0x4e09cf,_0x528427){_0x528427=_0x528427||0xc8;return function(_0x5a7b16){if(_0x5a7b16){return _0x4e09cf[_0xa66f('0x16')](_0x528427)[_0xa66f('0x17')](_0x5a7b16);}};}function respondWithFilteredResult(_0x267129,_0x236d64){return function(_0xd348f9){if(_0xd348f9){var _0x567d4f=typeof _0x236d64['offset']===_0xa66f('0x18')&&typeof _0x236d64[_0xa66f('0x19')]===_0xa66f('0x18');var _0x403f4d=_0xd348f9['count'];var _0x1cbe64=_0x567d4f?0x0:_0x236d64['offset'];var _0x4a28d4=_0x567d4f?_0xd348f9[_0xa66f('0x1a')]:_0x236d64[_0xa66f('0x1b')]+_0x236d64[_0xa66f('0x19')];var _0x355ddc;if(_0x4a28d4>=_0x403f4d){_0x4a28d4=_0x403f4d;_0x355ddc=0xc8;}else{_0x355ddc=0xce;}_0x267129[_0xa66f('0x16')](_0x355ddc);return _0x267129[_0xa66f('0x1c')](_0xa66f('0x1d'),_0x1cbe64+'-'+_0x4a28d4+'/'+_0x403f4d)[_0xa66f('0x17')](_0xd348f9);}return null;};}function patchUpdates(_0x2033a4){return function(_0x2d9602){try{jsonpatch[_0xa66f('0x1e')](_0x2d9602,_0x2033a4,!![]);}catch(_0xbba376){return BPromise[_0xa66f('0x1f')](_0xbba376);}return _0x2d9602[_0xa66f('0x20')]();};}function saveUpdates(_0x82924d,_0x5cd613){return function(_0x27f570){if(_0x27f570){return _0x27f570[_0xa66f('0x21')](_0x82924d)[_0xa66f('0x22')](function(_0x37ee13){return _0x37ee13;});}return null;};}function removeEntity(_0x5cbd82,_0x337602){return function(_0x473822){if(_0x473822){return _0x473822[_0xa66f('0x23')]()[_0xa66f('0x22')](function(){_0x5cbd82['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xed98b9,_0x598942){return function(_0x3a3e4f){if(!_0x3a3e4f){_0xed98b9[_0xa66f('0x24')](0x194);}return _0x3a3e4f;};}function handleError(_0x384164,_0x57da7f){_0x57da7f=_0x57da7f||0x1f4;return function(_0x4683c7){logger[_0xa66f('0x25')](_0x4683c7[_0xa66f('0x26')]);if(_0x4683c7[_0xa66f('0x27')]){delete _0x4683c7[_0xa66f('0x27')];}_0x384164[_0xa66f('0x16')](_0x57da7f)[_0xa66f('0x28')](_0x4683c7);};}exports[_0xa66f('0x29')]=function(_0x20ee67,_0x117d03){var _0x45f71c={},_0x63650b={},_0x42b966={'count':0x0,'rows':[]};var _0xeeb22e=_['map'](db['Integration'][_0xa66f('0x2a')],function(_0x27ceae){return{'name':_0x27ceae['fieldName'],'type':_0x27ceae[_0xa66f('0x2b')][_0xa66f('0x2c')]};});_0x63650b['model']=_[_0xa66f('0x2d')](_0xeeb22e,_0xa66f('0x27'));_0x63650b[_0xa66f('0x2e')]=_[_0xa66f('0x2f')](_0x20ee67[_0xa66f('0x2e')]);_0x63650b['filters']=_[_0xa66f('0x30')](_0x63650b['model'],_0x63650b[_0xa66f('0x2e')]);_0x45f71c[_0xa66f('0x31')]=_[_0xa66f('0x30')](_0x63650b['model'],qs[_0xa66f('0x32')](_0x20ee67[_0xa66f('0x2e')]['fields']));_0x45f71c[_0xa66f('0x31')]=_0x45f71c[_0xa66f('0x31')][_0xa66f('0x33')]?_0x45f71c[_0xa66f('0x31')]:_0x63650b[_0xa66f('0x34')];if(!_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x35')](_0xa66f('0x36'))){_0x45f71c[_0xa66f('0x19')]=qs[_0xa66f('0x19')](_0x20ee67['query'][_0xa66f('0x19')]);_0x45f71c['offset']=qs[_0xa66f('0x1b')](_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x1b')]);}_0x45f71c[_0xa66f('0x37')]=qs[_0xa66f('0x38')](_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x38')]);_0x45f71c[_0xa66f('0x39')]=qs['filters'](_[_0xa66f('0x3a')](_0x20ee67['query'],_0x63650b[_0xa66f('0x3b')]),_0xeeb22e);if(_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x3c')]){_0x45f71c['where']=_['merge'](_0x45f71c[_0xa66f('0x39')],{'$or':_[_0xa66f('0x2d')](_0xeeb22e,function(_0x20b07e){if(_0x20b07e[_0xa66f('0x2b')]!==_0xa66f('0x3d')){var _0x581dca={};_0x581dca[_0x20b07e['name']]={'$like':'%'+_0x20ee67['query'][_0xa66f('0x3c')]+'%'};return _0x581dca;}})});}_0x45f71c=_['merge']({},_0x45f71c,_0x20ee67['options']);var _0x5bf856={'where':_0x45f71c[_0xa66f('0x39')]};return db['Integration'][_0xa66f('0x1a')](_0x5bf856)[_0xa66f('0x22')](function(_0x23a546){_0x42b966[_0xa66f('0x1a')]=_0x23a546;if(_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x3e')]){_0x45f71c[_0xa66f('0x3f')]=[{'all':!![]}];}return db[_0xa66f('0x40')][_0xa66f('0x41')](_0x45f71c);})[_0xa66f('0x22')](function(_0x3a7929){_0x42b966[_0xa66f('0x42')]=_0x3a7929;return _0x42b966;})[_0xa66f('0x22')](respondWithFilteredResult(_0x117d03,_0x45f71c))[_0xa66f('0x43')](handleError(_0x117d03,null));};exports['show']=function(_0x36037c,_0x25c2cb){var _0x58c1f2={'raw':![],'where':{'id':_0x36037c['params']['id']}},_0x248587={};_0x248587[_0xa66f('0x34')]=_[_0xa66f('0x2f')](db['Integration'][_0xa66f('0x2a')]);_0x248587[_0xa66f('0x2e')]=_[_0xa66f('0x2f')](_0x36037c['query']);_0x248587[_0xa66f('0x3b')]=_['intersection'](_0x248587[_0xa66f('0x34')],_0x248587[_0xa66f('0x2e')]);_0x58c1f2[_0xa66f('0x31')]=_[_0xa66f('0x30')](_0x248587[_0xa66f('0x34')],qs[_0xa66f('0x32')](_0x36037c[_0xa66f('0x2e')]['fields']));_0x58c1f2[_0xa66f('0x31')]=_0x58c1f2[_0xa66f('0x31')][_0xa66f('0x33')]?_0x58c1f2[_0xa66f('0x31')]:_0x248587[_0xa66f('0x34')];if(_0x36037c['query']['includeAll']){_0x58c1f2[_0xa66f('0x3f')]=[{'all':!![]}];}_0x58c1f2=_[_0xa66f('0x44')]({},_0x58c1f2,_0x36037c[_0xa66f('0x45')]);return db[_0xa66f('0x40')][_0xa66f('0x46')](_0x58c1f2)[_0xa66f('0x22')](handleEntityNotFound(_0x25c2cb,null))['then'](respondWithResult(_0x25c2cb,null))[_0xa66f('0x43')](handleError(_0x25c2cb,null));};exports[_0xa66f('0x47')]=function(_0x3f9cdd,_0x5651e9){return db['Integration'][_0xa66f('0x47')](_0x3f9cdd[_0xa66f('0x48')],{})[_0xa66f('0x22')](respondWithResult(_0x5651e9,0xc9))['catch'](handleError(_0x5651e9,null));};exports['update']=function(_0x52054e,_0x19e7ce){if(_0x52054e[_0xa66f('0x48')]['id']){delete _0x52054e[_0xa66f('0x48')]['id'];}return db[_0xa66f('0x40')][_0xa66f('0x46')]({'where':{'id':_0x52054e[_0xa66f('0x49')]['id']}})[_0xa66f('0x22')](handleEntityNotFound(_0x19e7ce,null))[_0xa66f('0x22')](saveUpdates(_0x52054e['body'],null))[_0xa66f('0x22')](respondWithResult(_0x19e7ce,null))[_0xa66f('0x43')](handleError(_0x19e7ce,null));};exports[_0xa66f('0x23')]=function(_0x393755,_0x11597b){return db[_0xa66f('0x40')]['find']({'where':{'id':_0x393755[_0xa66f('0x49')]['id']}})[_0xa66f('0x22')](handleEntityNotFound(_0x11597b,null))[_0xa66f('0x22')](removeEntity(_0x11597b,null))[_0xa66f('0x43')](handleError(_0x11597b,null));};
\ No newline at end of file
index 9dea0d4..50718cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb392=['util','../../config/logger','moment','bluebird','path','rimraf','./integration.attributes','exports','define','Integration','integrations','lodash'];(function(_0x1319b6,_0x16ffe7){var _0x42c2ae=function(_0x17be73){while(--_0x17be73){_0x1319b6['push'](_0x1319b6['shift']());}};_0x42c2ae(++_0x16ffe7);}(_0xb392,0x1df));var _0x2b39=function(_0x528e00,_0x593385){_0x528e00=_0x528e00-0x0;var _0x89ccf4=_0xb392[_0x528e00];return _0x89ccf4;};'use strict';var _=require(_0x2b39('0x0'));var util=require(_0x2b39('0x1'));var logger=require(_0x2b39('0x2'))('api');var moment=require(_0x2b39('0x3'));var BPromise=require(_0x2b39('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2b39('0x5'));var rimraf=require(_0x2b39('0x6'));var config=require('../../config/environment');var attributes=require(_0x2b39('0x7'));module[_0x2b39('0x8')]=function(_0x49680a,_0x1c485a){return _0x49680a[_0x2b39('0x9')](_0x2b39('0xa'),attributes,{'tableName':_0x2b39('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xae8e=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','define','Integration','integrations','lodash','util'];(function(_0xd73d53,_0x598443){var _0x560148=function(_0x3c8918){while(--_0x3c8918){_0xd73d53['push'](_0xd73d53['shift']());}};_0x560148(++_0x598443);}(_0xae8e,0x1c6));var _0xeae8=function(_0x48774f,_0x3fd771){_0x48774f=_0x48774f-0x0;var _0x4d5ef2=_0xae8e[_0x48774f];return _0x4d5ef2;};'use strict';var _=require(_0xeae8('0x0'));var util=require(_0xeae8('0x1'));var logger=require(_0xeae8('0x2'))('api');var moment=require(_0xeae8('0x3'));var BPromise=require(_0xeae8('0x4'));var rp=require(_0xeae8('0x5'));var fs=require('fs');var path=require(_0xeae8('0x6'));var rimraf=require('rimraf');var config=require(_0xeae8('0x7'));var attributes=require('./integration.attributes');module[_0xeae8('0x8')]=function(_0x42e31c,_0x56912d){return _0x42e31c[_0xeae8('0x9')](_0xeae8('0xa'),attributes,{'tableName':_0xeae8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7d66831..ebd5c21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f0e=['../../config/environment','jayson/promise','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x37ec20,_0x1c3752){var _0x5b2b4e=function(_0x2ed324){while(--_0x2ed324){_0x37ec20['push'](_0x37ec20['shift']());}};_0x5b2b4e(++_0x1c3752);}(_0x9f0e,0x116));var _0xe9f0=function(_0x4f9601,_0x56c21d){_0x4f9601=_0x4f9601-0x0;var _0x1426e9=_0x9f0e[_0x4f9601];return _0x1426e9;};'use strict';var _=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var moment=require(_0xe9f0('0x2'));var BPromise=require(_0xe9f0('0x3'));var rs=require(_0xe9f0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe9f0('0x5'));var logger=require(_0xe9f0('0x6'))(_0xe9f0('0x7'));var config=require(_0xe9f0('0x8'));var jayson=require(_0xe9f0('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3a17b3,_0x167198,_0xe64a79){return new BPromise(function(_0x4be6a6,_0xf4a256){return client[_0xe9f0('0xa')](_0x3a17b3,_0xe64a79)[_0xe9f0('0xb')](function(_0x3386a8){logger[_0xe9f0('0xc')](_0xe9f0('0xd'),_0x167198,_0xe9f0('0xe'));logger[_0xe9f0('0xf')](_0xe9f0('0x10'),_0x167198,'request\x20sent',JSON[_0xe9f0('0x11')](_0x3386a8));if(_0x3386a8[_0xe9f0('0x12')]){if(_0x3386a8[_0xe9f0('0x12')]['code']===0x1f4){logger[_0xe9f0('0x12')]('Integration,\x20%s,\x20%s',_0x167198,_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);return _0xf4a256(_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);}logger['error'](_0xe9f0('0xd'),_0x167198,_0x3386a8['error'][_0xe9f0('0x13')]);return _0x4be6a6(_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);}else{logger['info'](_0xe9f0('0xd'),_0x167198,_0xe9f0('0xe'));_0x4be6a6(_0x3386a8[_0xe9f0('0x14')]['message']);}})[_0xe9f0('0x15')](function(_0x1e16e0){logger[_0xe9f0('0x12')](_0xe9f0('0xd'),_0x167198,_0x1e16e0);_0xf4a256(_0x1e16e0);});});}
\ No newline at end of file
+var _0x2542=['info','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x5d6b60,_0x347017){var _0x897ab6=function(_0x24810f){while(--_0x24810f){_0x5d6b60['push'](_0x5d6b60['shift']());}};_0x897ab6(++_0x347017);}(_0x2542,0x169));var _0x2254=function(_0x8835b,_0x8be2f3){_0x8835b=_0x8835b-0x0;var _0x4b035c=_0x2542[_0x8835b];return _0x4b035c;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var moment=require(_0x2254('0x2'));var BPromise=require(_0x2254('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2254('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2254('0x5'));var logger=require(_0x2254('0x6'))(_0x2254('0x7'));var config=require(_0x2254('0x8'));var jayson=require(_0x2254('0x9'));var client=jayson['client'][_0x2254('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe8ca50,_0x2ee7ee,_0x3c45ec){return new BPromise(function(_0x1637ad,_0x477b47){return client[_0x2254('0xb')](_0xe8ca50,_0x3c45ec)[_0x2254('0xc')](function(_0xb395da){logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,'request\x20sent');logger[_0x2254('0xf')](_0x2254('0x10'),_0x2ee7ee,_0x2254('0x11'),JSON[_0x2254('0x12')](_0xb395da));if(_0xb395da['error']){if(_0xb395da['error'][_0x2254('0x13')]===0x1f4){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);return _0x477b47(_0xb395da[_0x2254('0x14')]['message']);}logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da['error'][_0x2254('0x15')]);return _0x1637ad(_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);}else{logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,_0x2254('0x11'));_0x1637ad(_0xb395da['result'][_0x2254('0x15')]);}})['catch'](function(_0x327d6d){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0x327d6d);_0x477b47(_0x327d6d);});});}
\ No newline at end of file
index bb317bd..7803d3e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2542=['put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post'];(function(_0x303bfb,_0x4213ce){var _0x5ca9b6=function(_0x179d9d){while(--_0x179d9d){_0x303bfb['push'](_0x303bfb['shift']());}};_0x5ca9b6(++_0x4213ce);}(_0x2542,0x169));var _0x2254=function(_0x2c2d60,_0x1f7ee9){_0x2c2d60=_0x2c2d60-0x0;var _0x3eee5d=_0x2542[_0x2c2d60];return _0x3eee5d;};'use strict';var multer=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var path=require(_0x2254('0x2'));var timeout=require(_0x2254('0x3'));var express=require('express');var router=express[_0x2254('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2254('0x5'));var interaction=require(_0x2254('0x6'));var config=require(_0x2254('0x7'));var controller=require(_0x2254('0x8'));router[_0x2254('0x9')]('/',auth['isAuthenticated'](),controller[_0x2254('0xa')]);router[_0x2254('0x9')](_0x2254('0xb'),auth[_0x2254('0xc')](),controller[_0x2254('0xd')]);router[_0x2254('0x9')](_0x2254('0xe'),auth[_0x2254('0xc')](),controller[_0x2254('0xf')]);router[_0x2254('0x10')]('/',auth[_0x2254('0xc')](),controller['create']);router[_0x2254('0x11')](_0x2254('0xe'),auth[_0x2254('0xc')](),controller[_0x2254('0x12')]);router['delete']('/:id',auth[_0x2254('0xc')](),controller[_0x2254('0x13')]);module[_0x2254('0x14')]=router;
\ No newline at end of file
+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(_0x45ccf6,_0x187595){var _0x140e18=function(_0xf5582f){while(--_0xf5582f){_0x45ccf6['push'](_0x45ccf6['shift']());}};_0x140e18(++_0x187595);}(_0x187d,0x93));var _0xd187=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x187d[_0x5b561d];return _0x431060;};'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
index ade81ea..753666a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4a1=['STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize','exports'];(function(_0x3473ae,_0xb969f7){var _0xab4ae3=function(_0x3b08f0){while(--_0x3b08f0){_0x3473ae['push'](_0x3473ae['shift']());}};_0xab4ae3(++_0xb969f7);}(_0xa4a1,0xbe));var _0x1a4a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa4a1[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x1a4a('0x0'));module[_0x1a4a('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0x1a4a('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x1a4a('0x2')]},'integrationId':{'type':Sequelize[_0x1a4a('0x3')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x1a4a('0x2')]},'calleridnum':{'type':Sequelize[_0x1a4a('0x2')]},'calleridname':{'type':Sequelize[_0x1a4a('0x2')]},'queue':{'type':Sequelize[_0x1a4a('0x2')]},'interface':{'type':Sequelize[_0x1a4a('0x2')]},'membername':{'type':Sequelize[_0x1a4a('0x2')]},'agentcalledAt':{'type':Sequelize[_0x1a4a('0x4')]},'agentconnectAt':{'type':Sequelize[_0x1a4a('0x4')]},'holdtime':{'type':Sequelize[_0x1a4a('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x1a4a('0x4')]},'talktime':{'type':Sequelize[_0x1a4a('0x3')]},'agentacw':{'type':Sequelize[_0x1a4a('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x1a4a('0x3')]},'reason':{'type':Sequelize[_0x1a4a('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x1a4a('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x1a4a('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x1a4a('0x4')]},'lastevent':{'type':Sequelize[_0x1a4a('0x2')]},'channel':{'type':Sequelize[_0x1a4a('0x2')]},'channelstate':{'type':Sequelize[_0x1a4a('0x3')]},'channelstatedesc':{'type':Sequelize[_0x1a4a('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x1a4a('0x2')]},'context':{'type':Sequelize[_0x1a4a('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x1a4a('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x1a4a('0x2')]},'destcalleridname':{'type':Sequelize[_0x1a4a('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x1a4a('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x1a4a('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x1a4a('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x1a4a('0x2')]},'messageId':{'type':Sequelize[_0x1a4a('0x2')]},'inReplyTo':{'type':Sequelize[_0x1a4a('0x2')]},'subject':{'type':Sequelize[_0x1a4a('0x2')]},'from':{'type':Sequelize[_0x1a4a('0x2')]},'to':{'type':Sequelize[_0x1a4a('0x2')]},'cc':{'type':Sequelize[_0x1a4a('0x2')]},'attachment':{'type':Sequelize[_0x1a4a('0x6')]},'html':{'type':Sequelize[_0x1a4a('0x6')]},'text':{'type':Sequelize[_0x1a4a('0x6')]},'status':{'type':Sequelize[_0x1a4a('0x7')](_0x1a4a('0x8'),_0x1a4a('0x9'),_0x1a4a('0xa'),_0x1a4a('0xb'))},'url':{'type':Sequelize[_0x1a4a('0x2')]},'app':{'type':Sequelize[_0x1a4a('0x2')]},'appdata':{'type':Sequelize[_0x1a4a('0x2')]},'projectId':{'type':Sequelize[_0x1a4a('0x3')]}};
\ No newline at end of file
+var _0x6f62=['SENDING','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','SENT'];(function(_0x4fe78a,_0x4215d0){var _0x50423c=function(_0x3b299a){while(--_0x3b299a){_0x4fe78a['push'](_0x4fe78a['shift']());}};_0x50423c(++_0x4215d0);}(_0x6f62,0x12c));var _0x26f6=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x6f62[_0x1b2ff7];return _0x31656a;};'use strict';var Sequelize=require(_0x26f6('0x0'));module[_0x26f6('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0x26f6('0x2')]},'exitStatus':{'type':Sequelize[_0x26f6('0x2')]},'ticketId':{'type':Sequelize[_0x26f6('0x2')]},'integrationId':{'type':Sequelize[_0x26f6('0x3')]},'contacts':{'type':Sequelize[_0x26f6('0x2')]},'uniqueid':{'type':Sequelize[_0x26f6('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x26f6('0x2')]},'interface':{'type':Sequelize[_0x26f6('0x2')]},'membername':{'type':Sequelize[_0x26f6('0x2')]},'agentcalledAt':{'type':Sequelize[_0x26f6('0x4')]},'agentconnectAt':{'type':Sequelize[_0x26f6('0x4')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x26f6('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x26f6('0x4')]},'talktime':{'type':Sequelize[_0x26f6('0x3')]},'agentacw':{'type':Sequelize[_0x26f6('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x26f6('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x26f6('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x26f6('0x4')]},'agentdump':{'type':Sequelize[_0x26f6('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x26f6('0x4')]},'lastevent':{'type':Sequelize[_0x26f6('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x26f6('0x3')]},'channelstatedesc':{'type':Sequelize[_0x26f6('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x26f6('0x2')]},'language':{'type':Sequelize[_0x26f6('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x26f6('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x26f6('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x26f6('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x26f6('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x26f6('0x2')]},'destlanguage':{'type':Sequelize[_0x26f6('0x2')]},'destaccountcode':{'type':Sequelize[_0x26f6('0x2')]},'destcontext':{'type':Sequelize[_0x26f6('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x26f6('0x2')]},'destuniqueid':{'type':Sequelize[_0x26f6('0x2')]},'messageId':{'type':Sequelize[_0x26f6('0x2')]},'inReplyTo':{'type':Sequelize[_0x26f6('0x2')]},'subject':{'type':Sequelize[_0x26f6('0x2')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x26f6('0x2')]},'cc':{'type':Sequelize[_0x26f6('0x2')]},'attachment':{'type':Sequelize[_0x26f6('0x6')]},'html':{'type':Sequelize[_0x26f6('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize['ENUM'](_0x26f6('0x7'),_0x26f6('0x8'),_0x26f6('0x9'),_0x26f6('0xa'))},'url':{'type':Sequelize[_0x26f6('0x2')]},'app':{'type':Sequelize[_0x26f6('0x2')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x26f6('0x3')]}};
\ No newline at end of file
index 8170f49..4c4ebe6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f55=['name','send','IntegrationReport','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','map','type','VIRTUAL','filter','options','includeAll','include','findAll','params','length','find','create','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','apply','reject','save','update','then','destroy','status','error','stack'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x1f55,0x6f));var _0x51f5=function(_0x310f20,_0x37d20e){_0x310f20=_0x310f20-0x0;var _0x7e56f5=_0x1f55[_0x310f20];return _0x7e56f5;};'use strict';var emlformat=require(_0x51f5('0x0'));var rimraf=require(_0x51f5('0x1'));var zipdir=require(_0x51f5('0x2'));var jsonpatch=require(_0x51f5('0x3'));var rp=require(_0x51f5('0x4'));var moment=require(_0x51f5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x51f5('0x6'));var util=require(_0x51f5('0x7'));var path=require('path');var sox=require(_0x51f5('0x8'));var csv=require(_0x51f5('0x9'));var ejs=require(_0x51f5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x51f5('0xb'));var squel=require(_0x51f5('0xc'));var crypto=require(_0x51f5('0xd'));var jsforce=require(_0x51f5('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x51f5('0xf'));var Papa=require(_0x51f5('0x10'));var Redis=require(_0x51f5('0x11'));var authService=require(_0x51f5('0x12'));var qs=require(_0x51f5('0x13'));var as=require(_0x51f5('0x14'));var hardwareService=require(_0x51f5('0x15'));var logger=require(_0x51f5('0x16'))(_0x51f5('0x17'));var utils=require(_0x51f5('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x51f5('0x19'));var db=require(_0x51f5('0x1a'))['db'];function respondWithStatusCode(_0x2c0d39,_0x293b32){_0x293b32=_0x293b32||0xcc;return function(_0x2e3cf6){if(_0x2e3cf6){return _0x2c0d39[_0x51f5('0x1b')](_0x293b32);}return _0x2c0d39['status'](_0x293b32)[_0x51f5('0x1c')]();};}function respondWithResult(_0x3166bf,_0x212f60){_0x212f60=_0x212f60||0xc8;return function(_0x7feedc){if(_0x7feedc){return _0x3166bf['status'](_0x212f60)[_0x51f5('0x1d')](_0x7feedc);}};}function respondWithFilteredResult(_0x13efb9,_0x4edb8f){return function(_0x35beae){if(_0x35beae){var _0x1ad50a=typeof _0x4edb8f[_0x51f5('0x1e')]===_0x51f5('0x1f')&&typeof _0x4edb8f['limit']===_0x51f5('0x1f');var _0x53ecb5=_0x35beae[_0x51f5('0x20')];var _0x239c9c=_0x1ad50a?0x0:_0x4edb8f['offset'];var _0x9c203a=_0x1ad50a?_0x35beae[_0x51f5('0x20')]:_0x4edb8f[_0x51f5('0x1e')]+_0x4edb8f[_0x51f5('0x21')];var _0x2a5cbe;if(_0x9c203a>=_0x53ecb5){_0x9c203a=_0x53ecb5;_0x2a5cbe=0xc8;}else{_0x2a5cbe=0xce;}_0x13efb9['status'](_0x2a5cbe);return _0x13efb9['set']('Content-Range',_0x239c9c+'-'+_0x9c203a+'/'+_0x53ecb5)[_0x51f5('0x1d')](_0x35beae);}return null;};}function patchUpdates(_0x148124){return function(_0x3898dc){try{jsonpatch[_0x51f5('0x22')](_0x3898dc,_0x148124,!![]);}catch(_0x1db6bb){return BPromise[_0x51f5('0x23')](_0x1db6bb);}return _0x3898dc[_0x51f5('0x24')]();};}function saveUpdates(_0x16a2ee,_0x2850a4){return function(_0x5ea896){if(_0x5ea896){return _0x5ea896[_0x51f5('0x25')](_0x16a2ee)[_0x51f5('0x26')](function(_0x24c81c){return _0x24c81c;});}return null;};}function removeEntity(_0x1b0609,_0x51e33d){return function(_0x377cf3){if(_0x377cf3){return _0x377cf3[_0x51f5('0x27')]()[_0x51f5('0x26')](function(){_0x1b0609[_0x51f5('0x28')](0xcc)[_0x51f5('0x1c')]();});}};}function handleEntityNotFound(_0xa4dca,_0x3d46b2){return function(_0x4f46f9){if(!_0x4f46f9){_0xa4dca[_0x51f5('0x1b')](0x194);}return _0x4f46f9;};}function handleError(_0x66d5ec,_0xbf9907){_0xbf9907=_0xbf9907||0x1f4;return function(_0x196e6b){logger[_0x51f5('0x29')](_0x196e6b[_0x51f5('0x2a')]);if(_0x196e6b[_0x51f5('0x2b')]){delete _0x196e6b[_0x51f5('0x2b')];}_0x66d5ec['status'](_0xbf9907)[_0x51f5('0x2c')](_0x196e6b);};}exports['index']=function(_0x47755a,_0x211bda){var _0x5695ba={},_0x4bf2bb={},_0x415b2a={'count':0x0,'rows':[]};var _0x78b938=_['map'](db[_0x51f5('0x2d')][_0x51f5('0x2e')],function(_0x5f33a9){return{'name':_0x5f33a9[_0x51f5('0x2f')],'type':_0x5f33a9['type'][_0x51f5('0x30')]};});_0x4bf2bb['model']=_['map'](_0x78b938,_0x51f5('0x2b'));_0x4bf2bb[_0x51f5('0x31')]=_[_0x51f5('0x32')](_0x47755a[_0x51f5('0x31')]);_0x4bf2bb[_0x51f5('0x33')]=_[_0x51f5('0x34')](_0x4bf2bb[_0x51f5('0x35')],_0x4bf2bb[_0x51f5('0x31')]);_0x5695ba[_0x51f5('0x36')]=_['intersection'](_0x4bf2bb[_0x51f5('0x35')],qs['fields'](_0x47755a[_0x51f5('0x31')][_0x51f5('0x37')]));_0x5695ba[_0x51f5('0x36')]=_0x5695ba[_0x51f5('0x36')]['length']?_0x5695ba['attributes']:_0x4bf2bb['model'];if(!_0x47755a[_0x51f5('0x31')][_0x51f5('0x38')]('nolimit')){_0x5695ba[_0x51f5('0x21')]=qs[_0x51f5('0x21')](_0x47755a[_0x51f5('0x31')][_0x51f5('0x21')]);_0x5695ba['offset']=qs['offset'](_0x47755a[_0x51f5('0x31')]['offset']);}_0x5695ba[_0x51f5('0x39')]=qs[_0x51f5('0x3a')](_0x47755a[_0x51f5('0x31')][_0x51f5('0x3a')]);_0x5695ba[_0x51f5('0x3b')]=qs[_0x51f5('0x33')](_[_0x51f5('0x3c')](_0x47755a['query'],_0x4bf2bb['filters']),_0x78b938);if(_0x47755a[_0x51f5('0x31')]['filter']){_0x5695ba['where']=_[_0x51f5('0x3d')](_0x5695ba[_0x51f5('0x3b')],{'$or':_[_0x51f5('0x3e')](_0x78b938,function(_0x3b425c){if(_0x3b425c[_0x51f5('0x3f')]!==_0x51f5('0x40')){var _0x394683={};_0x394683[_0x3b425c[_0x51f5('0x2b')]]={'$like':'%'+_0x47755a[_0x51f5('0x31')][_0x51f5('0x41')]+'%'};return _0x394683;}})});}_0x5695ba=_[_0x51f5('0x3d')]({},_0x5695ba,_0x47755a[_0x51f5('0x42')]);var _0x509ba0={'where':_0x5695ba[_0x51f5('0x3b')]};return db['IntegrationReport']['count'](_0x509ba0)[_0x51f5('0x26')](function(_0x2bd3c0){_0x415b2a['count']=_0x2bd3c0;if(_0x47755a[_0x51f5('0x31')][_0x51f5('0x43')]){_0x5695ba[_0x51f5('0x44')]=[{'all':!![]}];}return db[_0x51f5('0x2d')][_0x51f5('0x45')](_0x5695ba);})[_0x51f5('0x26')](function(_0x31edb6){_0x415b2a['rows']=_0x31edb6;return _0x415b2a;})[_0x51f5('0x26')](respondWithFilteredResult(_0x211bda,_0x5695ba))['catch'](handleError(_0x211bda,null));};exports['show']=function(_0x3358b4,_0x3e6270){var _0xedeb4f={'raw':![],'where':{'id':_0x3358b4[_0x51f5('0x46')]['id']}},_0x193e6f={};_0x193e6f[_0x51f5('0x35')]=_[_0x51f5('0x32')](db['IntegrationReport'][_0x51f5('0x2e')]);_0x193e6f['query']=_['keys'](_0x3358b4[_0x51f5('0x31')]);_0x193e6f[_0x51f5('0x33')]=_[_0x51f5('0x34')](_0x193e6f[_0x51f5('0x35')],_0x193e6f['query']);_0xedeb4f[_0x51f5('0x36')]=_[_0x51f5('0x34')](_0x193e6f[_0x51f5('0x35')],qs[_0x51f5('0x37')](_0x3358b4['query'][_0x51f5('0x37')]));_0xedeb4f['attributes']=_0xedeb4f[_0x51f5('0x36')][_0x51f5('0x47')]?_0xedeb4f[_0x51f5('0x36')]:_0x193e6f[_0x51f5('0x35')];if(_0x3358b4[_0x51f5('0x31')][_0x51f5('0x43')]){_0xedeb4f['include']=[{'all':!![]}];}_0xedeb4f=_[_0x51f5('0x3d')]({},_0xedeb4f,_0x3358b4[_0x51f5('0x42')]);return db[_0x51f5('0x2d')][_0x51f5('0x48')](_0xedeb4f)[_0x51f5('0x26')](handleEntityNotFound(_0x3e6270,null))[_0x51f5('0x26')](respondWithResult(_0x3e6270,null))['catch'](handleError(_0x3e6270,null));};exports[_0x51f5('0x49')]=function(_0x586056,_0x219842){return db[_0x51f5('0x2d')][_0x51f5('0x49')](_0x586056[_0x51f5('0x4a')],{})['then'](respondWithResult(_0x219842,0xc9))['catch'](handleError(_0x219842,null));};exports[_0x51f5('0x25')]=function(_0x44b728,_0x3f39a7){if(_0x44b728['body']['id']){delete _0x44b728[_0x51f5('0x4a')]['id'];}return db[_0x51f5('0x2d')][_0x51f5('0x48')]({'where':{'id':_0x44b728[_0x51f5('0x46')]['id']}})[_0x51f5('0x26')](handleEntityNotFound(_0x3f39a7,null))[_0x51f5('0x26')](saveUpdates(_0x44b728[_0x51f5('0x4a')],null))[_0x51f5('0x26')](respondWithResult(_0x3f39a7,null))[_0x51f5('0x4b')](handleError(_0x3f39a7,null));};exports[_0x51f5('0x27')]=function(_0x52a9f9,_0x4b9c5d){return db['IntegrationReport'][_0x51f5('0x48')]({'where':{'id':_0x52a9f9[_0x51f5('0x46')]['id']}})['then'](handleEntityNotFound(_0x4b9c5d,null))[_0x51f5('0x26')](removeEntity(_0x4b9c5d,null))[_0x51f5('0x4b')](handleError(_0x4b9c5d,null));};exports[_0x51f5('0x4c')]=function(_0x32c5f2,_0x2b42cb){return db[_0x51f5('0x2d')][_0x51f5('0x4c')]()[_0x51f5('0x26')](respondWithResult(_0x2b42cb,null))[_0x51f5('0x4b')](handleError(_0x2b42cb,null));};
\ No newline at end of file
+var _0xc462=['Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','filters','filter','merge','VIRTUAL','IntegrationReport','includeAll','catch','params','length','options','find','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','offset','undefined','count','status'];(function(_0x39d4a4,_0x561239){var _0x3bf0cc=function(_0x457ba8){while(--_0x457ba8){_0x39d4a4['push'](_0x39d4a4['shift']());}};_0x3bf0cc(++_0x561239);}(_0xc462,0xb6));var _0x2c46=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xc462[_0x5f09c5];return _0x426ad9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2c46('0x0'));var zipdir=require(_0x2c46('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2c46('0x2'));var moment=require(_0x2c46('0x3'));var BPromise=require(_0x2c46('0x4'));var Mustache=require(_0x2c46('0x5'));var util=require(_0x2c46('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x2c46('0x7'));var ejs=require(_0x2c46('0x8'));var fs=require('fs');var fs_extra=require(_0x2c46('0x9'));var _=require(_0x2c46('0xa'));var squel=require('squel');var crypto=require(_0x2c46('0xb'));var jsforce=require(_0x2c46('0xc'));var deskjs=require(_0x2c46('0xd'));var toCsv=require(_0x2c46('0x7'));var querystring=require(_0x2c46('0xe'));var Papa=require(_0x2c46('0xf'));var Redis=require('ioredis');var authService=require(_0x2c46('0x10'));var qs=require(_0x2c46('0x11'));var as=require(_0x2c46('0x12'));var hardwareService=require(_0x2c46('0x13'));var logger=require(_0x2c46('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2c46('0x15'));var db=require(_0x2c46('0x16'))['db'];function respondWithStatusCode(_0x6950bf,_0x59edae){_0x59edae=_0x59edae||0xcc;return function(_0x3bde0b){if(_0x3bde0b){return _0x6950bf[_0x2c46('0x17')](_0x59edae);}return _0x6950bf['status'](_0x59edae)['end']();};}function respondWithResult(_0xb831f3,_0x1d1578){_0x1d1578=_0x1d1578||0xc8;return function(_0x5465c8){if(_0x5465c8){return _0xb831f3['status'](_0x1d1578)['json'](_0x5465c8);}};}function respondWithFilteredResult(_0x17b4cd,_0x5caaa9){return function(_0x540808){if(_0x540808){var _0x53dcd7=typeof _0x5caaa9[_0x2c46('0x18')]==='undefined'&&typeof _0x5caaa9['limit']===_0x2c46('0x19');var _0x43aac8=_0x540808[_0x2c46('0x1a')];var _0xfaae31=_0x53dcd7?0x0:_0x5caaa9[_0x2c46('0x18')];var _0x39a92c=_0x53dcd7?_0x540808['count']:_0x5caaa9[_0x2c46('0x18')]+_0x5caaa9['limit'];var _0x30e3d9;if(_0x39a92c>=_0x43aac8){_0x39a92c=_0x43aac8;_0x30e3d9=0xc8;}else{_0x30e3d9=0xce;}_0x17b4cd[_0x2c46('0x1b')](_0x30e3d9);return _0x17b4cd['set'](_0x2c46('0x1c'),_0xfaae31+'-'+_0x39a92c+'/'+_0x43aac8)['json'](_0x540808);}return null;};}function patchUpdates(_0x4f81ac){return function(_0x5d7a95){try{jsonpatch[_0x2c46('0x1d')](_0x5d7a95,_0x4f81ac,!![]);}catch(_0x113003){return BPromise[_0x2c46('0x1e')](_0x113003);}return _0x5d7a95[_0x2c46('0x1f')]();};}function saveUpdates(_0x1a430c,_0x4d6a58){return function(_0xf2c28c){if(_0xf2c28c){return _0xf2c28c[_0x2c46('0x20')](_0x1a430c)[_0x2c46('0x21')](function(_0x7e8ecd){return _0x7e8ecd;});}return null;};}function removeEntity(_0x34ac94,_0x14ab7e){return function(_0x356dd6){if(_0x356dd6){return _0x356dd6[_0x2c46('0x22')]()[_0x2c46('0x21')](function(){_0x34ac94['status'](0xcc)[_0x2c46('0x23')]();});}};}function handleEntityNotFound(_0x116049,_0x198e9c){return function(_0x4bd43b){if(!_0x4bd43b){_0x116049[_0x2c46('0x17')](0x194);}return _0x4bd43b;};}function handleError(_0xb30a57,_0x1849e8){_0x1849e8=_0x1849e8||0x1f4;return function(_0x3a160f){logger[_0x2c46('0x24')](_0x3a160f[_0x2c46('0x25')]);if(_0x3a160f[_0x2c46('0x26')]){delete _0x3a160f[_0x2c46('0x26')];}_0xb30a57[_0x2c46('0x1b')](_0x1849e8)['send'](_0x3a160f);};}exports[_0x2c46('0x27')]=function(_0x3707f4,_0x2ab248){var _0x1cee8d={},_0x9706ed={},_0x209edf={'count':0x0,'rows':[]};var _0x434f9d=_[_0x2c46('0x28')](db['IntegrationReport'][_0x2c46('0x29')],function(_0x11cf70){return{'name':_0x11cf70[_0x2c46('0x2a')],'type':_0x11cf70[_0x2c46('0x2b')][_0x2c46('0x2c')]};});_0x9706ed[_0x2c46('0x2d')]=_['map'](_0x434f9d,_0x2c46('0x26'));_0x9706ed['query']=_[_0x2c46('0x2e')](_0x3707f4[_0x2c46('0x2f')]);_0x9706ed['filters']=_[_0x2c46('0x30')](_0x9706ed[_0x2c46('0x2d')],_0x9706ed['query']);_0x1cee8d[_0x2c46('0x31')]=_[_0x2c46('0x30')](_0x9706ed[_0x2c46('0x2d')],qs[_0x2c46('0x32')](_0x3707f4[_0x2c46('0x2f')][_0x2c46('0x32')]));_0x1cee8d['attributes']=_0x1cee8d['attributes']['length']?_0x1cee8d[_0x2c46('0x31')]:_0x9706ed[_0x2c46('0x2d')];if(!_0x3707f4['query'][_0x2c46('0x33')]('nolimit')){_0x1cee8d[_0x2c46('0x34')]=qs[_0x2c46('0x34')](_0x3707f4['query'][_0x2c46('0x34')]);_0x1cee8d['offset']=qs[_0x2c46('0x18')](_0x3707f4[_0x2c46('0x2f')][_0x2c46('0x18')]);}_0x1cee8d[_0x2c46('0x35')]=qs[_0x2c46('0x36')](_0x3707f4[_0x2c46('0x2f')]['sort']);_0x1cee8d[_0x2c46('0x37')]=qs[_0x2c46('0x38')](_['pick'](_0x3707f4['query'],_0x9706ed['filters']),_0x434f9d);if(_0x3707f4[_0x2c46('0x2f')][_0x2c46('0x39')]){_0x1cee8d[_0x2c46('0x37')]=_[_0x2c46('0x3a')](_0x1cee8d[_0x2c46('0x37')],{'$or':_[_0x2c46('0x28')](_0x434f9d,function(_0x1efa51){if(_0x1efa51[_0x2c46('0x2b')]!==_0x2c46('0x3b')){var _0x514051={};_0x514051[_0x1efa51[_0x2c46('0x26')]]={'$like':'%'+_0x3707f4[_0x2c46('0x2f')][_0x2c46('0x39')]+'%'};return _0x514051;}})});}_0x1cee8d=_[_0x2c46('0x3a')]({},_0x1cee8d,_0x3707f4['options']);var _0x374dc5={'where':_0x1cee8d[_0x2c46('0x37')]};return db[_0x2c46('0x3c')]['count'](_0x374dc5)[_0x2c46('0x21')](function(_0x41ebc4){_0x209edf[_0x2c46('0x1a')]=_0x41ebc4;if(_0x3707f4[_0x2c46('0x2f')][_0x2c46('0x3d')]){_0x1cee8d['include']=[{'all':!![]}];}return db[_0x2c46('0x3c')]['findAll'](_0x1cee8d);})[_0x2c46('0x21')](function(_0x1b168f){_0x209edf['rows']=_0x1b168f;return _0x209edf;})[_0x2c46('0x21')](respondWithFilteredResult(_0x2ab248,_0x1cee8d))[_0x2c46('0x3e')](handleError(_0x2ab248,null));};exports['show']=function(_0x173666,_0x52ef05){var _0x3f8089={'raw':![],'where':{'id':_0x173666[_0x2c46('0x3f')]['id']}},_0x5e1dee={};_0x5e1dee[_0x2c46('0x2d')]=_[_0x2c46('0x2e')](db[_0x2c46('0x3c')][_0x2c46('0x29')]);_0x5e1dee[_0x2c46('0x2f')]=_['keys'](_0x173666['query']);_0x5e1dee[_0x2c46('0x38')]=_[_0x2c46('0x30')](_0x5e1dee[_0x2c46('0x2d')],_0x5e1dee[_0x2c46('0x2f')]);_0x3f8089[_0x2c46('0x31')]=_[_0x2c46('0x30')](_0x5e1dee[_0x2c46('0x2d')],qs[_0x2c46('0x32')](_0x173666[_0x2c46('0x2f')][_0x2c46('0x32')]));_0x3f8089[_0x2c46('0x31')]=_0x3f8089[_0x2c46('0x31')][_0x2c46('0x40')]?_0x3f8089[_0x2c46('0x31')]:_0x5e1dee['model'];if(_0x173666[_0x2c46('0x2f')][_0x2c46('0x3d')]){_0x3f8089['include']=[{'all':!![]}];}_0x3f8089=_['merge']({},_0x3f8089,_0x173666[_0x2c46('0x41')]);return db[_0x2c46('0x3c')][_0x2c46('0x42')](_0x3f8089)[_0x2c46('0x21')](handleEntityNotFound(_0x52ef05,null))[_0x2c46('0x21')](respondWithResult(_0x52ef05,null))[_0x2c46('0x3e')](handleError(_0x52ef05,null));};exports[_0x2c46('0x43')]=function(_0x38f745,_0x4ccf67){return db[_0x2c46('0x3c')][_0x2c46('0x43')](_0x38f745[_0x2c46('0x44')],{})['then'](respondWithResult(_0x4ccf67,0xc9))[_0x2c46('0x3e')](handleError(_0x4ccf67,null));};exports[_0x2c46('0x20')]=function(_0x514d58,_0x4885a2){if(_0x514d58['body']['id']){delete _0x514d58[_0x2c46('0x44')]['id'];}return db['IntegrationReport'][_0x2c46('0x42')]({'where':{'id':_0x514d58[_0x2c46('0x3f')]['id']}})[_0x2c46('0x21')](handleEntityNotFound(_0x4885a2,null))['then'](saveUpdates(_0x514d58[_0x2c46('0x44')],null))[_0x2c46('0x21')](respondWithResult(_0x4885a2,null))[_0x2c46('0x3e')](handleError(_0x4885a2,null));};exports['destroy']=function(_0x270924,_0x59c6e9){return db[_0x2c46('0x3c')][_0x2c46('0x42')]({'where':{'id':_0x270924['params']['id']}})[_0x2c46('0x21')](handleEntityNotFound(_0x59c6e9,null))['then'](removeEntity(_0x59c6e9,null))['catch'](handleError(_0x59c6e9,null));};exports[_0x2c46('0x45')]=function(_0x57d5c2,_0x11103f){return db[_0x2c46('0x3c')][_0x2c46('0x45')]()['then'](respondWithResult(_0x11103f,null))['catch'](handleError(_0x11103f,null));};
\ No newline at end of file
index 6916ec5..711635d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d75=['define','IntegrationReport','report_integration','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports'];(function(_0x2153d0,_0x372d6f){var _0x57936a=function(_0xfa983b){while(--_0xfa983b){_0x2153d0['push'](_0x2153d0['shift']());}};_0x57936a(++_0x372d6f);}(_0x4d75,0x17c));var _0x54d7=function(_0x4fd31c,_0x2f0cc3){_0x4fd31c=_0x4fd31c-0x0;var _0x39c0bc=_0x4d75[_0x4fd31c];return _0x39c0bc;};'use strict';var _=require(_0x54d7('0x0'));var util=require(_0x54d7('0x1'));var logger=require(_0x54d7('0x2'))('api');var moment=require(_0x54d7('0x3'));var BPromise=require('bluebird');var rp=require(_0x54d7('0x4'));var fs=require('fs');var path=require(_0x54d7('0x5'));var rimraf=require(_0x54d7('0x6'));var config=require(_0x54d7('0x7'));var attributes=require(_0x54d7('0x8'));module[_0x54d7('0x9')]=function(_0x2e426d,_0x2399e6){return _0x2e426d[_0x54d7('0xa')](_0x54d7('0xb'),attributes,{'tableName':_0x54d7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x816b=['./integrationReport.attributes','exports','define','IntegrationReport','report_integration','util','../../config/logger','bluebird','request-promise','path'];(function(_0xcfeff4,_0x3f2e19){var _0xb2fadc=function(_0x4cd013){while(--_0x4cd013){_0xcfeff4['push'](_0xcfeff4['shift']());}};_0xb2fadc(++_0x3f2e19);}(_0x816b,0x145));var _0xb816=function(_0x3b31ab,_0x5f2abb){_0x3b31ab=_0x3b31ab-0x0;var _0xd33ce1=_0x816b[_0x3b31ab];return _0xd33ce1;};'use strict';var _=require('lodash');var util=require(_0xb816('0x0'));var logger=require(_0xb816('0x1'))('api');var moment=require('moment');var BPromise=require(_0xb816('0x2'));var rp=require(_0xb816('0x3'));var fs=require('fs');var path=require(_0xb816('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb816('0x5'));module[_0xb816('0x6')]=function(_0x471925,_0x51eb8b){return _0x471925[_0xb816('0x7')](_0xb816('0x8'),attributes,{'tableName':_0xb816('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c837431..d944618 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0x53ec,0x192));var _0xc53e=function(_0x47b281,_0x25034f){_0x47b281=_0x47b281-0x0;var _0x49abfa=_0x53ec[_0x47b281];return _0x49abfa;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});}
\ No newline at end of file
+var _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x53ec,0x192));var _0xc53e=function(_0x52b0b2,_0xf6dbf9){_0x52b0b2=_0x52b0b2-0x0;var _0x322769=_0x53ec[_0x52b0b2];return _0x322769;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});}
\ No newline at end of file
index b56cb64..6eccf3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00a8=['show','/:id/sub_intervals','getIntervals','post','create','addInterval','addIntervals','put','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x00a8,0xb3));var _0x800a=function(_0x224add,_0x4c053f){_0x224add=_0x224add-0x0;var _0x30cbea=_0x00a8[_0x224add];return _0x30cbea;};'use strict';var multer=require(_0x800a('0x0'));var util=require('util');var path=require(_0x800a('0x1'));var timeout=require(_0x800a('0x2'));var express=require(_0x800a('0x3'));var router=express['Router']();var fs_extra=require(_0x800a('0x4'));var auth=require(_0x800a('0x5'));var interaction=require(_0x800a('0x6'));var config=require(_0x800a('0x7'));var controller=require(_0x800a('0x8'));router[_0x800a('0x9')]('/',auth[_0x800a('0xa')](),controller[_0x800a('0xb')]);router[_0x800a('0x9')](_0x800a('0xc'),auth[_0x800a('0xa')](),controller[_0x800a('0xd')]);router[_0x800a('0x9')](_0x800a('0xe'),auth[_0x800a('0xa')](),controller[_0x800a('0xf')]);router[_0x800a('0x10')]('/',auth[_0x800a('0xa')](),controller[_0x800a('0x11')]);router[_0x800a('0x10')](_0x800a('0xe'),auth['isAuthenticated'](),controller[_0x800a('0x12')]);router[_0x800a('0x10')]('/:id/sub_intervals/create_many',auth['isAuthenticated'](),controller[_0x800a('0x13')]);router[_0x800a('0x14')](_0x800a('0xc'),auth[_0x800a('0xa')](),controller[_0x800a('0x15')]);router[_0x800a('0x16')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x800a('0x17')]=router;
\ No newline at end of file
+var _0x46cb=['../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','/:id/sub_intervals','getIntervals','post','addInterval','/:id/sub_intervals/create_many','put','update','destroy','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1ed406,_0x3b3184){var _0x359b38=function(_0x35dc97){while(--_0x35dc97){_0x1ed406['push'](_0x1ed406['shift']());}};_0x359b38(++_0x3b3184);}(_0x46cb,0xd6));var _0xb46c=function(_0x2d8efc,_0x58e635){_0x2d8efc=_0x2d8efc-0x0;var _0x4a7f2d=_0x46cb[_0x2d8efc];return _0x4a7f2d;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb46c('0x0'));var express=require(_0xb46c('0x1'));var router=express[_0xb46c('0x2')]();var fs_extra=require(_0xb46c('0x3'));var auth=require(_0xb46c('0x4'));var interaction=require(_0xb46c('0x5'));var config=require(_0xb46c('0x6'));var controller=require(_0xb46c('0x7'));router[_0xb46c('0x8')]('/',auth[_0xb46c('0x9')](),controller[_0xb46c('0xa')]);router[_0xb46c('0x8')](_0xb46c('0xb'),auth[_0xb46c('0x9')](),controller['show']);router[_0xb46c('0x8')](_0xb46c('0xc'),auth[_0xb46c('0x9')](),controller[_0xb46c('0xd')]);router[_0xb46c('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xb46c('0xc'),auth[_0xb46c('0x9')](),controller[_0xb46c('0xf')]);router[_0xb46c('0xe')](_0xb46c('0x10'),auth[_0xb46c('0x9')](),controller['addIntervals']);router[_0xb46c('0x11')]('/:id',auth[_0xb46c('0x9')](),controller[_0xb46c('0x12')]);router['delete'](_0xb46c('0xb'),auth[_0xb46c('0x9')](),controller[_0xb46c('0x13')]);module['exports']=router;
\ No newline at end of file
index be50a7b..112228b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb489=['sequelize','exports','STRING'];(function(_0x29b1b8,_0x1ee51a){var _0xcd1de2=function(_0x2ef57d){while(--_0x2ef57d){_0x29b1b8['push'](_0x29b1b8['shift']());}};_0xcd1de2(++_0x1ee51a);}(_0xb489,0x19b));var _0x9b48=function(_0x5df40a,_0x49b3de){_0x5df40a=_0x5df40a-0x0;var _0x37a782=_0xb489[_0x5df40a];return _0x37a782;};'use strict';var Sequelize=require(_0x9b48('0x0'));module[_0x9b48('0x1')]={'name':{'type':Sequelize[_0x9b48('0x2')]},'description':{'type':Sequelize[_0x9b48('0x2')]},'interval':{'type':Sequelize[_0x9b48('0x2')],'allowNull':!![]}};
\ No newline at end of file
+var _0xacd9=['STRING','sequelize','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xacd9,0xb2));var _0x9acd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xacd9[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x9acd('0x0'));module[_0x9acd('0x1')]={'name':{'type':Sequelize[_0x9acd('0x2')]},'description':{'type':Sequelize[_0x9acd('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
index 224f9d6..5693fe3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3118=['hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','findOne','getIntervals','addIntervals','sequelize','transaction','bulkCreate','findAll','eml-format','rimraf','zip-dir','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/extensions/rewrite','sendStatus','status','end','json','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','Intervals','UserProfileResource','error','stack','name','send','index','map','Interval','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x2fd69d,_0xeb1037){var _0x5d5ef3=function(_0xa9ea9e){while(--_0xa9ea9e){_0x2fd69d['push'](_0x2fd69d['shift']());}};_0x5d5ef3(++_0xeb1037);}(_0x3118,0x7e));var _0x8311=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x3118[_0x40220a];return _0x3903cc;};'use strict';var emlformat=require(_0x8311('0x0'));var rimraf=require(_0x8311('0x1'));var zipdir=require(_0x8311('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8311('0x3'));var Mustache=require('mustache');var util=require(_0x8311('0x4'));var path=require(_0x8311('0x5'));var sox=require(_0x8311('0x6'));var csv=require(_0x8311('0x7'));var ejs=require(_0x8311('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8311('0x9'));var squel=require(_0x8311('0xa'));var crypto=require(_0x8311('0xb'));var jsforce=require(_0x8311('0xc'));var deskjs=require(_0x8311('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8311('0xe'));var Papa=require(_0x8311('0xf'));var Redis=require(_0x8311('0x10'));var authService=require(_0x8311('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8311('0x12'));var logger=require(_0x8311('0x13'))(_0x8311('0x14'));var utils=require(_0x8311('0x15'));var config=require(_0x8311('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var extensions=require(_0x8311('0x17'));function respondWithStatusCode(_0x1bcede,_0x5f1b52){_0x5f1b52=_0x5f1b52||0xcc;return function(_0x4b44e4){if(_0x4b44e4){return _0x1bcede[_0x8311('0x18')](_0x5f1b52);}return _0x1bcede[_0x8311('0x19')](_0x5f1b52)[_0x8311('0x1a')]();};}function respondWithResult(_0x47a059,_0x5d4404){_0x5d4404=_0x5d4404||0xc8;return function(_0x5233e5){if(_0x5233e5){return _0x47a059[_0x8311('0x19')](_0x5d4404)[_0x8311('0x1b')](_0x5233e5);}};}function respondWithFilteredResult(_0x220c77,_0x21af86){return function(_0x41a02f){if(_0x41a02f){var _0x3f6157=typeof _0x21af86['offset']==='undefined'&&typeof _0x21af86[_0x8311('0x1c')]==='undefined';var _0x52089d=_0x41a02f[_0x8311('0x1d')];var _0x51ccaa=_0x3f6157?0x0:_0x21af86['offset'];var _0x548850=_0x3f6157?_0x41a02f[_0x8311('0x1d')]:_0x21af86['offset']+_0x21af86[_0x8311('0x1c')];var _0x23c3c3;if(_0x548850>=_0x52089d){_0x548850=_0x52089d;_0x23c3c3=0xc8;}else{_0x23c3c3=0xce;}_0x220c77[_0x8311('0x19')](_0x23c3c3);return _0x220c77['set'](_0x8311('0x1e'),_0x51ccaa+'-'+_0x548850+'/'+_0x52089d)[_0x8311('0x1b')](_0x41a02f);}return null;};}function patchUpdates(_0x82491b){return function(_0x1e1518){try{jsonpatch[_0x8311('0x1f')](_0x1e1518,_0x82491b,!![]);}catch(_0x85cbf6){return BPromise[_0x8311('0x20')](_0x85cbf6);}return _0x1e1518[_0x8311('0x21')]();};}function saveUpdates(_0x18e543,_0x3f8467){return function(_0x5b5c7b){if(_0x5b5c7b){return _0x5b5c7b[_0x8311('0x22')](_0x18e543)[_0x8311('0x23')](function(_0x321324){return _0x321324;});}return null;};}function removeEntity(_0x3c2b39,_0x1323de){return function(_0x249a58){if(_0x249a58){return _0x249a58[_0x8311('0x24')]()[_0x8311('0x23')](function(){var _0x3c8549=_0x249a58[_0x8311('0x25')]({'plain':!![]});var _0xacfe8d=_0x8311('0x26');return db[_0x8311('0x27')][_0x8311('0x24')]({'where':{'type':_0xacfe8d,'resourceId':_0x3c8549['id']}})[_0x8311('0x23')](function(){return _0x249a58;});})[_0x8311('0x23')](function(){_0x3c2b39[_0x8311('0x19')](0xcc)[_0x8311('0x1a')]();});}};}function handleEntityNotFound(_0x158a6d,_0x6c6aeb){return function(_0x5460a9){if(!_0x5460a9){_0x158a6d[_0x8311('0x18')](0x194);}return _0x5460a9;};}function handleError(_0x16d446,_0x49dd67){_0x49dd67=_0x49dd67||0x1f4;return function(_0x30ddc0){logger[_0x8311('0x28')](_0x30ddc0[_0x8311('0x29')]);if(_0x30ddc0[_0x8311('0x2a')]){delete _0x30ddc0['name'];}_0x16d446[_0x8311('0x19')](_0x49dd67)[_0x8311('0x2b')](_0x30ddc0);};}exports[_0x8311('0x2c')]=function(_0x13be26,_0x4a3eaf){var _0x3abc07={},_0x582fab={},_0x1a53e5={'count':0x0,'rows':[]};var _0x542c0e=_[_0x8311('0x2d')](db[_0x8311('0x2e')][_0x8311('0x2f')],function(_0xf1073a){return{'name':_0xf1073a[_0x8311('0x30')],'type':_0xf1073a[_0x8311('0x31')]['key']};});_0x582fab[_0x8311('0x32')]=_['map'](_0x542c0e,'name');_0x582fab[_0x8311('0x33')]=_[_0x8311('0x34')](_0x13be26['query']);_0x582fab[_0x8311('0x35')]=_[_0x8311('0x36')](_0x582fab[_0x8311('0x32')],_0x582fab[_0x8311('0x33')]);_0x3abc07[_0x8311('0x37')]=_['intersection'](_0x582fab[_0x8311('0x32')],qs[_0x8311('0x38')](_0x13be26[_0x8311('0x33')][_0x8311('0x38')]));_0x3abc07[_0x8311('0x37')]=_0x3abc07[_0x8311('0x37')][_0x8311('0x39')]?_0x3abc07[_0x8311('0x37')]:_0x582fab[_0x8311('0x32')];if(!_0x13be26['query'][_0x8311('0x3a')](_0x8311('0x3b'))){_0x3abc07['limit']=qs[_0x8311('0x1c')](_0x13be26[_0x8311('0x33')][_0x8311('0x1c')]);_0x3abc07[_0x8311('0x3c')]=qs[_0x8311('0x3c')](_0x13be26[_0x8311('0x33')][_0x8311('0x3c')]);}_0x3abc07[_0x8311('0x3d')]=qs[_0x8311('0x3e')](_0x13be26[_0x8311('0x33')][_0x8311('0x3e')]);_0x3abc07[_0x8311('0x3f')]=qs['filters'](_[_0x8311('0x40')](_0x13be26[_0x8311('0x33')],_0x582fab[_0x8311('0x35')]),_0x542c0e);if(_0x13be26['query'][_0x8311('0x41')]){_0x3abc07[_0x8311('0x3f')]=_[_0x8311('0x42')](_0x3abc07[_0x8311('0x3f')],{'$or':_[_0x8311('0x2d')](_0x542c0e,function(_0x311452){if(_0x311452['type']!==_0x8311('0x43')){var _0xbdc990={};_0xbdc990[_0x311452[_0x8311('0x2a')]]={'$like':'%'+_0x13be26[_0x8311('0x33')]['filter']+'%'};return _0xbdc990;}})});}_0x3abc07=_[_0x8311('0x42')]({},_0x3abc07,_0x13be26[_0x8311('0x44')]);var _0x40f15e={'where':_0x3abc07[_0x8311('0x3f')]};return db[_0x8311('0x2e')][_0x8311('0x1d')](_0x40f15e)[_0x8311('0x23')](function(_0x7f6baf){_0x1a53e5[_0x8311('0x1d')]=_0x7f6baf;if(_0x13be26[_0x8311('0x33')][_0x8311('0x45')]){_0x3abc07[_0x8311('0x46')]=[{'all':!![]}];}return db[_0x8311('0x2e')]['findAll'](_0x3abc07);})[_0x8311('0x23')](function(_0x20c76b){_0x1a53e5[_0x8311('0x47')]=_0x20c76b;return _0x1a53e5;})[_0x8311('0x23')](respondWithFilteredResult(_0x4a3eaf,_0x3abc07))[_0x8311('0x48')](handleError(_0x4a3eaf,null));};exports[_0x8311('0x49')]=function(_0x12cd34,_0x1ecaeb){var _0x323451={'raw':!![],'where':{'id':_0x12cd34[_0x8311('0x4a')]['id']}},_0x1a29ab={};_0x1a29ab[_0x8311('0x32')]=_['keys'](db[_0x8311('0x2e')][_0x8311('0x2f')]);_0x1a29ab[_0x8311('0x33')]=_[_0x8311('0x34')](_0x12cd34[_0x8311('0x33')]);_0x1a29ab[_0x8311('0x35')]=_[_0x8311('0x36')](_0x1a29ab['model'],_0x1a29ab[_0x8311('0x33')]);_0x323451['attributes']=_[_0x8311('0x36')](_0x1a29ab[_0x8311('0x32')],qs[_0x8311('0x38')](_0x12cd34[_0x8311('0x33')][_0x8311('0x38')]));_0x323451[_0x8311('0x37')]=_0x323451['attributes'][_0x8311('0x39')]?_0x323451['attributes']:_0x1a29ab[_0x8311('0x32')];if(_0x12cd34['query'][_0x8311('0x45')]){_0x323451[_0x8311('0x46')]=[{'all':!![]}];}_0x323451=_[_0x8311('0x42')]({},_0x323451,_0x12cd34[_0x8311('0x44')]);return db['Interval'][_0x8311('0x4b')](_0x323451)['then'](handleEntityNotFound(_0x1ecaeb,null))[_0x8311('0x23')](respondWithResult(_0x1ecaeb,null))[_0x8311('0x48')](handleError(_0x1ecaeb,null));};exports[_0x8311('0x4c')]=function(_0x51fe59,_0x4dd96a){return db[_0x8311('0x2e')][_0x8311('0x4c')](_0x51fe59[_0x8311('0x4d')],{})[_0x8311('0x23')](function(_0x63b09f){var _0x5ea155=_0x51fe59['user'][_0x8311('0x25')]({'plain':!![]});if(!_0x5ea155)throw new Error(_0x8311('0x4e'));if(_0x5ea155['role']===_0x8311('0x4f')){var _0x270a29=_0x63b09f[_0x8311('0x25')]({'plain':!![]});var _0x56540d=_0x8311('0x26');return db[_0x8311('0x50')]['find']({'where':{'name':_0x56540d,'userProfileId':_0x5ea155[_0x8311('0x51')]},'raw':!![]})[_0x8311('0x23')](function(_0x3dadc4){if(_0x3dadc4&&_0x3dadc4['autoAssociation']===0x0){return db[_0x8311('0x27')][_0x8311('0x4c')]({'name':_0x270a29[_0x8311('0x2a')],'resourceId':_0x270a29['id'],'type':_0x3dadc4['name'],'sectionId':_0x3dadc4['id']},{})['then'](function(){return _0x63b09f;});}else{return _0x63b09f;}})[_0x8311('0x48')](function(_0x715036){logger['error'](_0x8311('0x52'),_0x715036);throw _0x715036;});}return _0x63b09f;})[_0x8311('0x23')](respondWithResult(_0x4dd96a,0xc9))['catch'](handleError(_0x4dd96a,null));};exports[_0x8311('0x22')]=function(_0x2432f2,_0x35d44b){if(_0x2432f2[_0x8311('0x4d')]['id']){delete _0x2432f2['body']['id'];}return db['Interval'][_0x8311('0x4b')]({'where':{'id':_0x2432f2[_0x8311('0x4a')]['id']}})[_0x8311('0x23')](handleEntityNotFound(_0x35d44b,null))[_0x8311('0x23')](saveUpdates(_0x2432f2[_0x8311('0x4d')],null))[_0x8311('0x23')](respondWithResult(_0x35d44b,null))[_0x8311('0x48')](handleError(_0x35d44b,null));};exports[_0x8311('0x24')]=function(_0x2bf6db,_0x56df4d){return db[_0x8311('0x2e')][_0x8311('0x4b')]({'where':{'id':_0x2bf6db[_0x8311('0x4a')]['id']}})[_0x8311('0x23')](handleEntityNotFound(_0x56df4d,null))[_0x8311('0x23')](removeEntity(_0x56df4d,null))[_0x8311('0x48')](handleError(_0x56df4d,null));};exports[_0x8311('0x53')]=function(_0x1d3644,_0x2e19d3,_0x1fa75f){if(_0x1d3644['body']['id']){delete _0x1d3644[_0x8311('0x4d')]['id'];}return db[_0x8311('0x2e')][_0x8311('0x4b')]({'where':{'id':_0x1d3644[_0x8311('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2e19d3,null))[_0x8311('0x23')](function(_0x323983){if(_0x323983){_0x1d3644['body'][_0x8311('0x54')]=_0x323983['id'];return db['Interval'][_0x8311('0x4c')](_0x1d3644['body']);}})[_0x8311('0x23')](respondWithResult(_0x2e19d3,null))['catch'](handleError(_0x2e19d3,null));};exports['getIntervals']=function(_0x163858,_0x1bc05b,_0x14dbf0){var _0x3d733e={};var _0x2d13f5={};var _0x51f270;var _0x4da6a4;return db['Interval'][_0x8311('0x55')]({'where':{'id':_0x163858[_0x8311('0x4a')]['id']}})[_0x8311('0x23')](handleEntityNotFound(_0x1bc05b,null))[_0x8311('0x23')](function(_0x52c39e){if(_0x52c39e){_0x51f270=_0x52c39e;_0x2d13f5[_0x8311('0x32')]=_[_0x8311('0x34')](db[_0x8311('0x2e')]['rawAttributes']);_0x2d13f5[_0x8311('0x33')]=_[_0x8311('0x34')](_0x163858[_0x8311('0x33')]);_0x2d13f5['filters']=_['intersection'](_0x2d13f5['model'],_0x2d13f5[_0x8311('0x33')]);_0x3d733e[_0x8311('0x37')]=_['intersection'](_0x2d13f5['model'],qs[_0x8311('0x38')](_0x163858[_0x8311('0x33')][_0x8311('0x38')]));_0x3d733e[_0x8311('0x37')]=_0x3d733e[_0x8311('0x37')][_0x8311('0x39')]?_0x3d733e[_0x8311('0x37')]:_0x2d13f5[_0x8311('0x32')];_0x3d733e['order']=qs['sort'](_0x163858[_0x8311('0x33')][_0x8311('0x3e')]);_0x3d733e[_0x8311('0x3f')]=qs[_0x8311('0x35')](_[_0x8311('0x40')](_0x163858[_0x8311('0x33')],_0x2d13f5[_0x8311('0x35')]));if(_0x163858['query'][_0x8311('0x41')]){_0x3d733e[_0x8311('0x3f')]=_['merge'](_0x3d733e[_0x8311('0x3f')],{'$or':_[_0x8311('0x2d')](_0x3d733e[_0x8311('0x37')],function(_0xd7fc83){var _0x2bdab8={};_0x2bdab8[_0xd7fc83]={'$like':'%'+_0x163858[_0x8311('0x33')][_0x8311('0x41')]+'%'};return _0x2bdab8;})});}_0x3d733e=_['merge']({},_0x3d733e,_0x163858['options']);return _0x51f270['getIntervals'](_0x3d733e);}})[_0x8311('0x23')](function(_0x577730){if(_0x577730){_0x4da6a4=_0x577730[_0x8311('0x39')];if(!_0x163858[_0x8311('0x33')][_0x8311('0x3a')](_0x8311('0x3b'))){_0x3d733e['limit']=qs[_0x8311('0x1c')](_0x163858[_0x8311('0x33')][_0x8311('0x1c')]);_0x3d733e['offset']=qs[_0x8311('0x3c')](_0x163858[_0x8311('0x33')]['offset']);}return _0x51f270[_0x8311('0x56')](_0x3d733e);}})[_0x8311('0x23')](function(_0x199263){if(_0x199263){return _0x199263?{'count':_0x4da6a4,'rows':_0x199263}:null;}})[_0x8311('0x23')](respondWithResult(_0x1bc05b,null))[_0x8311('0x48')](handleError(_0x1bc05b,null));};exports[_0x8311('0x57')]=function(_0xf8af13,_0x1641af,_0x2bf5e3){return db[_0x8311('0x2e')][_0x8311('0x55')]({'where':{'id':_0xf8af13[_0x8311('0x4a')]['id']}})[_0x8311('0x23')](handleEntityNotFound(_0x1641af,null))['then'](function(_0x4bd2ff){if(_0x4bd2ff){return db[_0x8311('0x58')][_0x8311('0x59')](function(_0x149331){return db['Interval'][_0x8311('0x24')]({'where':{'IntervalId':_0xf8af13['params']['id']},'transaction':_0x149331})['then'](function(_0xd76e45){var _0x1d6866=_[_0x8311('0x2d')](_0xf8af13[_0x8311('0x4d')],function(_0x5095fb){delete _0x5095fb['id'];_0x5095fb['IntervalId']=_0xf8af13[_0x8311('0x4a')]['id'];return _0x5095fb;});return db[_0x8311('0x2e')][_0x8311('0x5a')](_0x1d6866,{'transaction':_0x149331});});})[_0x8311('0x23')](function(){return db[_0x8311('0x2e')][_0x8311('0x5b')]({'where':{'IntervalId':_0xf8af13[_0x8311('0x4a')]['id']}});});}})[_0x8311('0x23')](respondWithResult(_0x1641af,null))[_0x8311('0x48')](handleError(_0x1641af,null));};
\ No newline at end of file
+var _0x81c8=['query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','Interval','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','addIntervals','findOne','sequelize','transaction','findAll','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../components/extensions/rewrite','sendStatus','status','end','offset','undefined','count','limit','set','json','save','update','destroy','then','Intervals','UserProfileResource','error','name','send','index','fieldName','type','key','model','map'];(function(_0x4bc732,_0x57d27f){var _0x4e2302=function(_0x3ee898){while(--_0x3ee898){_0x4bc732['push'](_0x4bc732['shift']());}};_0x4e2302(++_0x57d27f);}(_0x81c8,0x18e));var _0x881c=function(_0x399170,_0x58008a){_0x399170=_0x399170-0x0;var _0x27004a=_0x81c8[_0x399170];return _0x27004a;};'use strict';var emlformat=require(_0x881c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x881c('0x1'));var jsonpatch=require(_0x881c('0x2'));var rp=require(_0x881c('0x3'));var moment=require('moment');var BPromise=require(_0x881c('0x4'));var Mustache=require('mustache');var util=require(_0x881c('0x5'));var path=require(_0x881c('0x6'));var sox=require(_0x881c('0x7'));var csv=require(_0x881c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x881c('0x9'));var _=require(_0x881c('0xa'));var squel=require(_0x881c('0xb'));var crypto=require(_0x881c('0xc'));var jsforce=require(_0x881c('0xd'));var deskjs=require(_0x881c('0xe'));var toCsv=require(_0x881c('0x8'));var querystring=require(_0x881c('0xf'));var Papa=require(_0x881c('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x881c('0x11'));var hardwareService=require(_0x881c('0x12'));var logger=require('../../config/logger')(_0x881c('0x13'));var utils=require(_0x881c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x881c('0x15'));var db=require('../../mysqldb')['db'];var extensions=require(_0x881c('0x16'));function respondWithStatusCode(_0x2d2515,_0x56e403){_0x56e403=_0x56e403||0xcc;return function(_0x53a414){if(_0x53a414){return _0x2d2515[_0x881c('0x17')](_0x56e403);}return _0x2d2515[_0x881c('0x18')](_0x56e403)[_0x881c('0x19')]();};}function respondWithResult(_0x4f3ddf,_0x290809){_0x290809=_0x290809||0xc8;return function(_0x199cd1){if(_0x199cd1){return _0x4f3ddf[_0x881c('0x18')](_0x290809)['json'](_0x199cd1);}};}function respondWithFilteredResult(_0x21e013,_0x5397a8){return function(_0x3d4bdf){if(_0x3d4bdf){var _0x1d5067=typeof _0x5397a8[_0x881c('0x1a')]===_0x881c('0x1b')&&typeof _0x5397a8['limit']==='undefined';var _0x1ae45c=_0x3d4bdf[_0x881c('0x1c')];var _0x3e1c52=_0x1d5067?0x0:_0x5397a8[_0x881c('0x1a')];var _0x2262c2=_0x1d5067?_0x3d4bdf[_0x881c('0x1c')]:_0x5397a8[_0x881c('0x1a')]+_0x5397a8[_0x881c('0x1d')];var _0x538322;if(_0x2262c2>=_0x1ae45c){_0x2262c2=_0x1ae45c;_0x538322=0xc8;}else{_0x538322=0xce;}_0x21e013[_0x881c('0x18')](_0x538322);return _0x21e013[_0x881c('0x1e')]('Content-Range',_0x3e1c52+'-'+_0x2262c2+'/'+_0x1ae45c)[_0x881c('0x1f')](_0x3d4bdf);}return null;};}function patchUpdates(_0xb1e273){return function(_0x4a310f){try{jsonpatch['apply'](_0x4a310f,_0xb1e273,!![]);}catch(_0x48f048){return BPromise['reject'](_0x48f048);}return _0x4a310f[_0x881c('0x20')]();};}function saveUpdates(_0x1cadf3,_0x3e018f){return function(_0x12c651){if(_0x12c651){return _0x12c651[_0x881c('0x21')](_0x1cadf3)['then'](function(_0x39f425){return _0x39f425;});}return null;};}function removeEntity(_0x30a593,_0x48ae8f){return function(_0x4365fd){if(_0x4365fd){return _0x4365fd[_0x881c('0x22')]()[_0x881c('0x23')](function(){var _0x34a455=_0x4365fd['get']({'plain':!![]});var _0x2058d1=_0x881c('0x24');return db[_0x881c('0x25')][_0x881c('0x22')]({'where':{'type':_0x2058d1,'resourceId':_0x34a455['id']}})[_0x881c('0x23')](function(){return _0x4365fd;});})[_0x881c('0x23')](function(){_0x30a593[_0x881c('0x18')](0xcc)[_0x881c('0x19')]();});}};}function handleEntityNotFound(_0x215663,_0x47600c){return function(_0x762ec){if(!_0x762ec){_0x215663[_0x881c('0x17')](0x194);}return _0x762ec;};}function handleError(_0x419ac,_0x4f8f4d){_0x4f8f4d=_0x4f8f4d||0x1f4;return function(_0x560883){logger[_0x881c('0x26')](_0x560883['stack']);if(_0x560883[_0x881c('0x27')]){delete _0x560883['name'];}_0x419ac[_0x881c('0x18')](_0x4f8f4d)[_0x881c('0x28')](_0x560883);};}exports[_0x881c('0x29')]=function(_0x1fde3c,_0x28ec74){var _0x27e64a={},_0x31194e={},_0x4d2f0b={'count':0x0,'rows':[]};var _0x5ce1cd=_['map'](db['Interval']['rawAttributes'],function(_0x305ed9){return{'name':_0x305ed9[_0x881c('0x2a')],'type':_0x305ed9[_0x881c('0x2b')][_0x881c('0x2c')]};});_0x31194e[_0x881c('0x2d')]=_[_0x881c('0x2e')](_0x5ce1cd,_0x881c('0x27'));_0x31194e[_0x881c('0x2f')]=_[_0x881c('0x30')](_0x1fde3c[_0x881c('0x2f')]);_0x31194e[_0x881c('0x31')]=_['intersection'](_0x31194e['model'],_0x31194e[_0x881c('0x2f')]);_0x27e64a[_0x881c('0x32')]=_[_0x881c('0x33')](_0x31194e[_0x881c('0x2d')],qs['fields'](_0x1fde3c[_0x881c('0x2f')][_0x881c('0x34')]));_0x27e64a[_0x881c('0x32')]=_0x27e64a[_0x881c('0x32')][_0x881c('0x35')]?_0x27e64a[_0x881c('0x32')]:_0x31194e[_0x881c('0x2d')];if(!_0x1fde3c[_0x881c('0x2f')]['hasOwnProperty'](_0x881c('0x36'))){_0x27e64a[_0x881c('0x1d')]=qs[_0x881c('0x1d')](_0x1fde3c[_0x881c('0x2f')][_0x881c('0x1d')]);_0x27e64a[_0x881c('0x1a')]=qs[_0x881c('0x1a')](_0x1fde3c[_0x881c('0x2f')][_0x881c('0x1a')]);}_0x27e64a[_0x881c('0x37')]=qs[_0x881c('0x38')](_0x1fde3c['query'][_0x881c('0x38')]);_0x27e64a['where']=qs['filters'](_[_0x881c('0x39')](_0x1fde3c[_0x881c('0x2f')],_0x31194e[_0x881c('0x31')]),_0x5ce1cd);if(_0x1fde3c['query'][_0x881c('0x3a')]){_0x27e64a[_0x881c('0x3b')]=_[_0x881c('0x3c')](_0x27e64a['where'],{'$or':_[_0x881c('0x2e')](_0x5ce1cd,function(_0x5d5863){if(_0x5d5863[_0x881c('0x2b')]!==_0x881c('0x3d')){var _0x58d33b={};_0x58d33b[_0x5d5863[_0x881c('0x27')]]={'$like':'%'+_0x1fde3c[_0x881c('0x2f')][_0x881c('0x3a')]+'%'};return _0x58d33b;}})});}_0x27e64a=_[_0x881c('0x3c')]({},_0x27e64a,_0x1fde3c[_0x881c('0x3e')]);var _0x1303c8={'where':_0x27e64a[_0x881c('0x3b')]};return db[_0x881c('0x3f')][_0x881c('0x1c')](_0x1303c8)[_0x881c('0x23')](function(_0xe19a96){_0x4d2f0b['count']=_0xe19a96;if(_0x1fde3c['query'][_0x881c('0x40')]){_0x27e64a[_0x881c('0x41')]=[{'all':!![]}];}return db[_0x881c('0x3f')]['findAll'](_0x27e64a);})[_0x881c('0x23')](function(_0x5a41de){_0x4d2f0b[_0x881c('0x42')]=_0x5a41de;return _0x4d2f0b;})['then'](respondWithFilteredResult(_0x28ec74,_0x27e64a))[_0x881c('0x43')](handleError(_0x28ec74,null));};exports[_0x881c('0x44')]=function(_0x218a1a,_0x17852e){var _0x7eb7c7={'raw':!![],'where':{'id':_0x218a1a[_0x881c('0x45')]['id']}},_0x33bb48={};_0x33bb48[_0x881c('0x2d')]=_['keys'](db[_0x881c('0x3f')][_0x881c('0x46')]);_0x33bb48[_0x881c('0x2f')]=_[_0x881c('0x30')](_0x218a1a[_0x881c('0x2f')]);_0x33bb48[_0x881c('0x31')]=_[_0x881c('0x33')](_0x33bb48[_0x881c('0x2d')],_0x33bb48[_0x881c('0x2f')]);_0x7eb7c7[_0x881c('0x32')]=_[_0x881c('0x33')](_0x33bb48[_0x881c('0x2d')],qs[_0x881c('0x34')](_0x218a1a[_0x881c('0x2f')]['fields']));_0x7eb7c7[_0x881c('0x32')]=_0x7eb7c7[_0x881c('0x32')][_0x881c('0x35')]?_0x7eb7c7[_0x881c('0x32')]:_0x33bb48[_0x881c('0x2d')];if(_0x218a1a['query'][_0x881c('0x40')]){_0x7eb7c7[_0x881c('0x41')]=[{'all':!![]}];}_0x7eb7c7=_[_0x881c('0x3c')]({},_0x7eb7c7,_0x218a1a[_0x881c('0x3e')]);return db['Interval'][_0x881c('0x47')](_0x7eb7c7)[_0x881c('0x23')](handleEntityNotFound(_0x17852e,null))['then'](respondWithResult(_0x17852e,null))[_0x881c('0x43')](handleError(_0x17852e,null));};exports[_0x881c('0x48')]=function(_0x538dc5,_0x43d61c){return db[_0x881c('0x3f')]['create'](_0x538dc5[_0x881c('0x49')],{})['then'](function(_0xa6f9b1){var _0x58ea23=_0x538dc5[_0x881c('0x4a')][_0x881c('0x4b')]({'plain':!![]});if(!_0x58ea23)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x58ea23[_0x881c('0x4c')]===_0x881c('0x4a')){var _0x57fc17=_0xa6f9b1[_0x881c('0x4b')]({'plain':!![]});var _0x17a249=_0x881c('0x24');return db[_0x881c('0x4d')][_0x881c('0x47')]({'where':{'name':_0x17a249,'userProfileId':_0x58ea23[_0x881c('0x4e')]},'raw':!![]})[_0x881c('0x23')](function(_0x95e52e){if(_0x95e52e&&_0x95e52e[_0x881c('0x4f')]===0x0){return db[_0x881c('0x25')][_0x881c('0x48')]({'name':_0x57fc17[_0x881c('0x27')],'resourceId':_0x57fc17['id'],'type':_0x95e52e['name'],'sectionId':_0x95e52e['id']},{})['then'](function(){return _0xa6f9b1;});}else{return _0xa6f9b1;}})[_0x881c('0x43')](function(_0x204e86){logger[_0x881c('0x26')](_0x881c('0x50'),_0x204e86);throw _0x204e86;});}return _0xa6f9b1;})[_0x881c('0x23')](respondWithResult(_0x43d61c,0xc9))[_0x881c('0x43')](handleError(_0x43d61c,null));};exports[_0x881c('0x21')]=function(_0x383305,_0x5a2319){if(_0x383305[_0x881c('0x49')]['id']){delete _0x383305['body']['id'];}return db[_0x881c('0x3f')][_0x881c('0x47')]({'where':{'id':_0x383305[_0x881c('0x45')]['id']}})['then'](handleEntityNotFound(_0x5a2319,null))['then'](saveUpdates(_0x383305[_0x881c('0x49')],null))['then'](respondWithResult(_0x5a2319,null))[_0x881c('0x43')](handleError(_0x5a2319,null));};exports[_0x881c('0x22')]=function(_0x655029,_0x53f2bb){return db[_0x881c('0x3f')][_0x881c('0x47')]({'where':{'id':_0x655029[_0x881c('0x45')]['id']}})['then'](handleEntityNotFound(_0x53f2bb,null))['then'](removeEntity(_0x53f2bb,null))[_0x881c('0x43')](handleError(_0x53f2bb,null));};exports[_0x881c('0x51')]=function(_0x5b15d7,_0x657467,_0x34dd43){if(_0x5b15d7[_0x881c('0x49')]['id']){delete _0x5b15d7[_0x881c('0x49')]['id'];}return db[_0x881c('0x3f')][_0x881c('0x47')]({'where':{'id':_0x5b15d7[_0x881c('0x45')]['id']}})[_0x881c('0x23')](handleEntityNotFound(_0x657467,null))[_0x881c('0x23')](function(_0x355832){if(_0x355832){_0x5b15d7[_0x881c('0x49')][_0x881c('0x52')]=_0x355832['id'];return db[_0x881c('0x3f')]['create'](_0x5b15d7['body']);}})[_0x881c('0x23')](respondWithResult(_0x657467,null))[_0x881c('0x43')](handleError(_0x657467,null));};exports[_0x881c('0x53')]=function(_0x2165f1,_0x3aab46,_0x5c1763){var _0x1ea052={};var _0x4fe8ea={};var _0x38345f;var _0x4f235e;return db[_0x881c('0x3f')]['findOne']({'where':{'id':_0x2165f1[_0x881c('0x45')]['id']}})['then'](handleEntityNotFound(_0x3aab46,null))[_0x881c('0x23')](function(_0x56b744){if(_0x56b744){_0x38345f=_0x56b744;_0x4fe8ea[_0x881c('0x2d')]=_[_0x881c('0x30')](db[_0x881c('0x3f')][_0x881c('0x46')]);_0x4fe8ea['query']=_[_0x881c('0x30')](_0x2165f1[_0x881c('0x2f')]);_0x4fe8ea[_0x881c('0x31')]=_[_0x881c('0x33')](_0x4fe8ea[_0x881c('0x2d')],_0x4fe8ea[_0x881c('0x2f')]);_0x1ea052[_0x881c('0x32')]=_['intersection'](_0x4fe8ea[_0x881c('0x2d')],qs['fields'](_0x2165f1[_0x881c('0x2f')][_0x881c('0x34')]));_0x1ea052[_0x881c('0x32')]=_0x1ea052[_0x881c('0x32')][_0x881c('0x35')]?_0x1ea052[_0x881c('0x32')]:_0x4fe8ea['model'];_0x1ea052[_0x881c('0x37')]=qs[_0x881c('0x38')](_0x2165f1[_0x881c('0x2f')]['sort']);_0x1ea052['where']=qs[_0x881c('0x31')](_[_0x881c('0x39')](_0x2165f1[_0x881c('0x2f')],_0x4fe8ea[_0x881c('0x31')]));if(_0x2165f1[_0x881c('0x2f')]['filter']){_0x1ea052[_0x881c('0x3b')]=_[_0x881c('0x3c')](_0x1ea052['where'],{'$or':_[_0x881c('0x2e')](_0x1ea052['attributes'],function(_0x21d424){var _0x5cdee6={};_0x5cdee6[_0x21d424]={'$like':'%'+_0x2165f1[_0x881c('0x2f')][_0x881c('0x3a')]+'%'};return _0x5cdee6;})});}_0x1ea052=_[_0x881c('0x3c')]({},_0x1ea052,_0x2165f1[_0x881c('0x3e')]);return _0x38345f[_0x881c('0x53')](_0x1ea052);}})[_0x881c('0x23')](function(_0x412901){if(_0x412901){_0x4f235e=_0x412901[_0x881c('0x35')];if(!_0x2165f1[_0x881c('0x2f')]['hasOwnProperty'](_0x881c('0x36'))){_0x1ea052[_0x881c('0x1d')]=qs['limit'](_0x2165f1[_0x881c('0x2f')][_0x881c('0x1d')]);_0x1ea052[_0x881c('0x1a')]=qs['offset'](_0x2165f1[_0x881c('0x2f')][_0x881c('0x1a')]);}return _0x38345f[_0x881c('0x53')](_0x1ea052);}})[_0x881c('0x23')](function(_0x3f6b39){if(_0x3f6b39){return _0x3f6b39?{'count':_0x4f235e,'rows':_0x3f6b39}:null;}})[_0x881c('0x23')](respondWithResult(_0x3aab46,null))[_0x881c('0x43')](handleError(_0x3aab46,null));};exports[_0x881c('0x54')]=function(_0xd248ab,_0x26f8e3,_0x437618){return db[_0x881c('0x3f')][_0x881c('0x55')]({'where':{'id':_0xd248ab['params']['id']}})[_0x881c('0x23')](handleEntityNotFound(_0x26f8e3,null))['then'](function(_0x459fec){if(_0x459fec){return db[_0x881c('0x56')][_0x881c('0x57')](function(_0x1cb520){return db[_0x881c('0x3f')][_0x881c('0x22')]({'where':{'IntervalId':_0xd248ab[_0x881c('0x45')]['id']},'transaction':_0x1cb520})[_0x881c('0x23')](function(_0xb2265a){var _0x3c035c=_['map'](_0xd248ab[_0x881c('0x49')],function(_0x402a9d){delete _0x402a9d['id'];_0x402a9d['IntervalId']=_0xd248ab[_0x881c('0x45')]['id'];return _0x402a9d;});return db['Interval']['bulkCreate'](_0x3c035c,{'transaction':_0x1cb520});});})['then'](function(){return db[_0x881c('0x3f')][_0x881c('0x58')]({'where':{'IntervalId':_0xd248ab[_0x881c('0x45')]['id']}});});}})[_0x881c('0x23')](respondWithResult(_0x26f8e3,null))[_0x881c('0x43')](handleError(_0x26f8e3,null));};
\ No newline at end of file
index e571f3f..4e906d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ca4=['moment','bluebird','request-promise','path','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','rewrite','lodash','util','../../config/logger','api'];(function(_0x404cbe,_0x40d68c){var _0x115c46=function(_0xa32b07){while(--_0xa32b07){_0x404cbe['push'](_0x404cbe['shift']());}};_0x115c46(++_0x40d68c);}(_0x4ca4,0x100));var _0x44ca=function(_0x3fb0b5,_0x24bc0c){_0x3fb0b5=_0x3fb0b5-0x0;var _0xd129e6=_0x4ca4[_0x3fb0b5];return _0xd129e6;};'use strict';var _=require(_0x44ca('0x0'));var util=require(_0x44ca('0x1'));var logger=require(_0x44ca('0x2'))(_0x44ca('0x3'));var moment=require(_0x44ca('0x4'));var BPromise=require(_0x44ca('0x5'));var rp=require(_0x44ca('0x6'));var fs=require('fs');var path=require(_0x44ca('0x7'));var rimraf=require('rimraf');var config=require(_0x44ca('0x8'));var attributes=require(_0x44ca('0x9'));var extensions=require(_0x44ca('0xa'));module[_0x44ca('0xb')]=function(_0x2b87a9,_0x32097f){return _0x2b87a9['define']('Interval',attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x140f00,_0x2d3b55){extensions['rewrite'](_0x2b87a9,_0x140f00);},'afterBulkCreate':function(_0x3c0999,_0x5e3b2b,_0x4b16de){_0x4b16de();extensions[_0x44ca('0xc')](_0x2b87a9,_0x3c0999[0x0]);},'afterUpdate':function(_0x12e21e,_0xe84c65){extensions[_0x44ca('0xc')](_0x2b87a9,_0x12e21e);},'afterDestroy':function(_0x34b004,_0x48c477){extensions['rewrite'](_0x2b87a9,_0x34b004);}}});};
\ No newline at end of file
+var _0xf0ea=['util','bluebird','request-promise','path','rimraf','./interval.attributes','exports','Interval','rewrite'];(function(_0x39ea42,_0x3c1f50){var _0x33f5b7=function(_0x5d8e73){while(--_0x5d8e73){_0x39ea42['push'](_0x39ea42['shift']());}};_0x33f5b7(++_0x3c1f50);}(_0xf0ea,0x10e));var _0xaf0e=function(_0x56a7fa,_0x148f63){_0x56a7fa=_0x56a7fa-0x0;var _0x15c655=_0xf0ea[_0x56a7fa];return _0x15c655;};'use strict';var _=require('lodash');var util=require(_0xaf0e('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xaf0e('0x1'));var rp=require(_0xaf0e('0x2'));var fs=require('fs');var path=require(_0xaf0e('0x3'));var rimraf=require(_0xaf0e('0x4'));var config=require('../../config/environment');var attributes=require(_0xaf0e('0x5'));var extensions=require('../../components/extensions/rewrite');module[_0xaf0e('0x6')]=function(_0x3f71bb,_0x3ba80b){return _0x3f71bb['define'](_0xaf0e('0x7'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5d1235,_0x57285c){extensions[_0xaf0e('0x8')](_0x3f71bb,_0x5d1235);},'afterBulkCreate':function(_0x122fd5,_0x11ff01,_0x3db39f){_0x3db39f();extensions[_0xaf0e('0x8')](_0x3f71bb,_0x122fd5[0x0]);},'afterUpdate':function(_0x1dd6d1,_0x3d8df7){extensions[_0xaf0e('0x8')](_0x3f71bb,_0x1dd6d1);},'afterDestroy':function(_0x53d30d,_0x337a78){extensions['rewrite'](_0x3f71bb,_0x53d30d);}}});};
\ No newline at end of file
index dcd521f..6b48af5 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(_0x5712f8,_0x17156b){var _0x14a364=function(_0x1da9de){while(--_0x1da9de){_0x5712f8['push'](_0x5712f8['shift']());}};_0x14a364(++_0x17156b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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(_0x40ebff,_0x1dd15e){var _0x40122a=function(_0xae6174){while(--_0xae6174){_0x40ebff['push'](_0x40ebff['shift']());}};_0x40122a(++_0x1dd15e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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 1c08b7e..82fa6ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0xa2d5c3,_0x2eee35){var _0x3b231d=function(_0x58571e){while(--_0x58571e){_0xa2d5c3['push'](_0xa2d5c3['shift']());}};_0x3b231d(++_0x2eee35);}(_0xadb5,0xad));var _0x5adb=function(_0x367448,_0x29ae2c){_0x367448=_0x367448-0x0;var _0x311f99=_0xadb5[_0x367448];return _0x311f99;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['send']);module[_0x5adb('0x4')]=router;
\ No newline at end of file
+var _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x9e0381,_0x225aac){var _0xc22c14=function(_0x179bbb){while(--_0x179bbb){_0x9e0381['push'](_0x9e0381['shift']());}};_0xc22c14(++_0x225aac);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3fe223,_0x24e375){_0x3fe223=_0x3fe223-0x0;var _0x41444c=_0x5f2f[_0x3fe223];return _0x41444c;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);module[_0xf5f2('0x7')]=router;
\ No newline at end of file
index b53cbf6..4261d35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0823=['status','write','openIssue','body','headers','connection','remoteAddress','socket','bluebird','https','../../config/logger','api','MOTGUI','Report','\x20from\x20','description','stringify','issuetype','customfield_11500','email','fields','oldToken','newToken','customfield_11503','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','application/json','request','utf8','data','end','statusCode','json','parse','error'];(function(_0x232eb3,_0x262278){var _0x30c6b3=function(_0xc4b6b8){while(--_0xc4b6b8){_0x232eb3['push'](_0x232eb3['shift']());}};_0x30c6b3(++_0x262278);}(_0x0823,0x1aa));var _0x3082=function(_0x4e4315,_0x5d7615){_0x4e4315=_0x4e4315-0x0;var _0x31f97a=_0x0823[_0x4e4315];return _0x31f97a;};'use strict';var BPromise=require(_0x3082('0x0'));var https=require(_0x3082('0x1'));var logger=require(_0x3082('0x2'))(_0x3082('0x3'));var USERNAME='support';var PASSWORD='3eAmWpBVP0';function openIssue(_0xea6239,_0x1821c4){var _0x5b7965={'fields':{'project':{'key':_0xea6239['key']||_0x3082('0x4')},'summary':(_0xea6239['summary']||_0x3082('0x5'))+_0x3082('0x6')+_0xea6239['ip'],'description':_0xea6239[_0x3082('0x7')]||JSON[_0x3082('0x8')](_0xea6239),'issuetype':{'name':_0xea6239[_0x3082('0x9')]||'Bug'}}};_0x5b7965['fields'][_0x3082('0xa')]=_0xea6239[_0x3082('0xb')];_0x5b7965[_0x3082('0xc')]['customfield_11501']=_0xea6239[_0x3082('0xd')];_0x5b7965[_0x3082('0xc')]['customfield_11502']=_0xea6239[_0x3082('0xe')];_0x5b7965[_0x3082('0xc')][_0x3082('0xf')]=_0xea6239['name'];_0x5b7965['fields'][_0x3082('0x10')]=_0xea6239[_0x3082('0x11')];_0x5b7965['fields'][_0x3082('0x12')]=_0xea6239['ip'];var _0x3c2aec={'host':_0x3082('0x13'),'port':0x1bb,'path':_0x3082('0x14'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0x3082('0x15'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)['toString']('base64')}};var _0x663279=JSON[_0x3082('0x8')](_0x5b7965);var _0x2d278e=https[_0x3082('0x16')](_0x3c2aec,function(_0xf77790){_0xf77790['setEncoding'](_0x3082('0x17'));var _0x27532f='';_0xf77790['on'](_0x3082('0x18'),function(_0x1f98bb){_0x27532f+=_0x1f98bb;});_0xf77790['on'](_0x3082('0x19'),function(){if(_0x1821c4){return _0x1821c4['status'](_0xf77790[_0x3082('0x1a')])[_0x3082('0x1b')](JSON[_0x3082('0x1c')](_0x27532f));}});});_0x2d278e['on'](_0x3082('0x1d'),function(_0x4966e0){if(_0x1821c4){return _0x1821c4[_0x3082('0x1e')](0x1f4)[_0x3082('0x1b')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':'api.jira'}]});}});_0x2d278e[_0x3082('0x1f')](_0x663279);_0x2d278e['end']();}exports[_0x3082('0x20')]=openIssue;exports['send']=function(_0x3b897d,_0x3943bb){_0x3b897d[_0x3082('0x21')]['ip']=_0x3b897d[_0x3082('0x22')]['x-forwarded-for']||_0x3b897d[_0x3082('0x23')][_0x3082('0x24')]||_0x3b897d[_0x3082('0x25')][_0x3082('0x24')]||_0x3b897d[_0x3082('0x23')][_0x3082('0x25')][_0x3082('0x24')];return openIssue(_0x3b897d[_0x3082('0x21')],_0x3943bb);};
\ No newline at end of file
+var _0x4baf=['email','fields','customfield_11502','newToken','customfield_11503','customfield_11504','reason','customfield_10102','/rest/api/2/issue','POST','application/json','toString','base64','stringify','request','setEncoding','data','end','status','statusCode','json','parse','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','send','body','x-forwarded-for','remoteAddress','connection','socket','../../config/logger','3eAmWpBVP0','MOTGUI','summary','Report','description','Bug','customfield_11500'];(function(_0x55f979,_0x1c4aae){var _0x4864ca=function(_0xf4ea2c){while(--_0xf4ea2c){_0x55f979['push'](_0x55f979['shift']());}};_0x4864ca(++_0x1c4aae);}(_0x4baf,0x8c));var _0xf4ba=function(_0x26bc42,_0x14dd81){_0x26bc42=_0x26bc42-0x0;var _0x588876=_0x4baf[_0x26bc42];return _0x588876;};'use strict';var BPromise=require('bluebird');var https=require('https');var logger=require(_0xf4ba('0x0'))('api');var USERNAME='support';var PASSWORD=_0xf4ba('0x1');function openIssue(_0x514f04,_0x2103ca){var _0x29af78={'fields':{'project':{'key':_0x514f04['key']||_0xf4ba('0x2')},'summary':(_0x514f04[_0xf4ba('0x3')]||_0xf4ba('0x4'))+'\x20from\x20'+_0x514f04['ip'],'description':_0x514f04[_0xf4ba('0x5')]||JSON['stringify'](_0x514f04),'issuetype':{'name':_0x514f04['issuetype']||_0xf4ba('0x6')}}};_0x29af78['fields'][_0xf4ba('0x7')]=_0x514f04[_0xf4ba('0x8')];_0x29af78['fields']['customfield_11501']=_0x514f04['oldToken'];_0x29af78[_0xf4ba('0x9')][_0xf4ba('0xa')]=_0x514f04[_0xf4ba('0xb')];_0x29af78[_0xf4ba('0x9')][_0xf4ba('0xc')]=_0x514f04['name'];_0x29af78[_0xf4ba('0x9')][_0xf4ba('0xd')]=_0x514f04[_0xf4ba('0xe')];_0x29af78[_0xf4ba('0x9')][_0xf4ba('0xf')]=_0x514f04['ip'];var _0x5e9f54={'host':'track.xcallymotion.com','port':0x1bb,'path':_0xf4ba('0x10'),'method':_0xf4ba('0x11'),'timeout':0x4e20,'headers':{'Content-Type':_0xf4ba('0x12'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0xf4ba('0x13')](_0xf4ba('0x14'))}};var _0x5aaa45=JSON[_0xf4ba('0x15')](_0x29af78);var _0x22fadc=https[_0xf4ba('0x16')](_0x5e9f54,function(_0x5080e3){_0x5080e3[_0xf4ba('0x17')]('utf8');var _0x490047='';_0x5080e3['on'](_0xf4ba('0x18'),function(_0x448b8b){_0x490047+=_0x448b8b;});_0x5080e3['on'](_0xf4ba('0x19'),function(){if(_0x2103ca){return _0x2103ca[_0xf4ba('0x1a')](_0x5080e3[_0xf4ba('0x1b')])[_0xf4ba('0x1c')](JSON[_0xf4ba('0x1d')](_0x490047));}});});_0x22fadc['on']('error',function(_0x236bfd){if(_0x2103ca){return _0x2103ca[_0xf4ba('0x1a')](0x1f4)[_0xf4ba('0x1c')]({'errors':[{'message':_0xf4ba('0x1e'),'type':'api.jira'}]});}});_0x22fadc['write'](_0x5aaa45);_0x22fadc[_0xf4ba('0x19')]();}exports['openIssue']=openIssue;exports[_0xf4ba('0x1f')]=function(_0x1dbdc4,_0x8bb0ec){_0x1dbdc4[_0xf4ba('0x20')]['ip']=_0x1dbdc4['headers'][_0xf4ba('0x21')]||_0x1dbdc4['connection']['remoteAddress']||_0x1dbdc4['socket'][_0xf4ba('0x22')]||_0x1dbdc4[_0xf4ba('0x23')][_0xf4ba('0x24')]['remoteAddress'];return openIssue(_0x1dbdc4[_0xf4ba('0x20')],_0x8bb0ec);};
\ No newline at end of file
index e349abf..0412a6b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update'];(function(_0x485d2a,_0x2a35bf){var _0x4d3af9=function(_0x258c21){while(--_0x258c21){_0x485d2a['push'](_0x485d2a['shift']());}};_0x4d3af9(++_0x2a35bf);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xf')]);router[_0x3071('0x10')](_0x3071('0xd'),auth['isAuthenticated'](),controller[_0x3071('0x11')]);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x6c76=['express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','post','create','update','delete','destroy','multer','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6c76,0x184));var _0x66c7=function(_0x2aa714,_0x28b20d){_0x2aa714=_0x2aa714-0x0;var _0x5d4590=_0x6c76[_0x2aa714];return _0x5d4590;};'use strict';var multer=require(_0x66c7('0x0'));var util=require(_0x66c7('0x1'));var path=require(_0x66c7('0x2'));var timeout=require('connect-timeout');var express=require(_0x66c7('0x3'));var router=express[_0x66c7('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x66c7('0x5'));var config=require(_0x66c7('0x6'));var controller=require('./jscriptyAnswerReport.controller');router[_0x66c7('0x7')]('/',auth[_0x66c7('0x8')](),controller['index']);router[_0x66c7('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x66c7('0x9')]);router[_0x66c7('0x7')](_0x66c7('0xa'),auth['isAuthenticated'](),controller[_0x66c7('0xb')]);router[_0x66c7('0xc')]('/',auth[_0x66c7('0x8')](),controller[_0x66c7('0xd')]);router['put'](_0x66c7('0xa'),auth[_0x66c7('0x8')](),controller[_0x66c7('0xe')]);router[_0x66c7('0xf')](_0x66c7('0xa'),auth[_0x66c7('0x8')](),controller[_0x66c7('0x10')]);module['exports']=router;
\ No newline at end of file
index 7873f17..96022c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x7a54,0x106));var _0x47a5=function(_0x41025d,_0x3c4d3e){_0x41025d=_0x41025d-0x0;var _0x15b8f9=_0x7a54[_0x41025d];return _0x15b8f9;};'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(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x7a54,0x106));var _0x47a5=function(_0x29df8d,_0x42d16f){_0x29df8d=_0x29df8d-0x0;var _0x7c6dfa=_0x7a54[_0x29df8d];return _0x7c6dfa;};'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 0024ab9..dc701d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f94=['JscriptyAnswerReport','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','where','filter','merge','options','include','findAll','rows','catch','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map'];(function(_0x5da1a9,_0x43e3a5){var _0x2e79f5=function(_0x4d9dc6){while(--_0x4d9dc6){_0x5da1a9['push'](_0x5da1a9['shift']());}};_0x2e79f5(++_0x43e3a5);}(_0x7f94,0x65));var _0x47f9=function(_0x5d362e,_0x498dba){_0x5d362e=_0x5d362e-0x0;var _0x1b8baf=_0x7f94[_0x5d362e];return _0x1b8baf;};'use strict';var emlformat=require(_0x47f9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x47f9('0x1'));var jsonpatch=require(_0x47f9('0x2'));var rp=require(_0x47f9('0x3'));var moment=require(_0x47f9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47f9('0x5'));var util=require(_0x47f9('0x6'));var path=require(_0x47f9('0x7'));var sox=require(_0x47f9('0x8'));var csv=require(_0x47f9('0x9'));var ejs=require(_0x47f9('0xa'));var fs=require('fs');var fs_extra=require(_0x47f9('0xb'));var _=require('lodash');var squel=require(_0x47f9('0xc'));var crypto=require(_0x47f9('0xd'));var jsforce=require(_0x47f9('0xe'));var deskjs=require(_0x47f9('0xf'));var toCsv=require(_0x47f9('0x9'));var querystring=require(_0x47f9('0x10'));var Papa=require(_0x47f9('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x47f9('0x12'));var logger=require(_0x47f9('0x13'))(_0x47f9('0x14'));var utils=require(_0x47f9('0x15'));var config=require(_0x47f9('0x16'));var licenseUtil=require(_0x47f9('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a8bac,_0x1002f7){_0x1002f7=_0x1002f7||0xcc;return function(_0x49c33c){if(_0x49c33c){return _0x5a8bac['sendStatus'](_0x1002f7);}return _0x5a8bac['status'](_0x1002f7)[_0x47f9('0x18')]();};}function respondWithResult(_0x43e4db,_0x4d44dd){_0x4d44dd=_0x4d44dd||0xc8;return function(_0x166860){if(_0x166860){return _0x43e4db[_0x47f9('0x19')](_0x4d44dd)[_0x47f9('0x1a')](_0x166860);}};}function respondWithFilteredResult(_0x2a6444,_0x48cc81){return function(_0x3320d1){if(_0x3320d1){var _0x3703e1=typeof _0x48cc81[_0x47f9('0x1b')]===_0x47f9('0x1c')&&typeof _0x48cc81[_0x47f9('0x1d')]==='undefined';var _0x56775f=_0x3320d1['count'];var _0xd80474=_0x3703e1?0x0:_0x48cc81[_0x47f9('0x1b')];var _0x32bb57=_0x3703e1?_0x3320d1[_0x47f9('0x1e')]:_0x48cc81[_0x47f9('0x1b')]+_0x48cc81[_0x47f9('0x1d')];var _0x29700e;if(_0x32bb57>=_0x56775f){_0x32bb57=_0x56775f;_0x29700e=0xc8;}else{_0x29700e=0xce;}_0x2a6444[_0x47f9('0x19')](_0x29700e);return _0x2a6444[_0x47f9('0x1f')](_0x47f9('0x20'),_0xd80474+'-'+_0x32bb57+'/'+_0x56775f)[_0x47f9('0x1a')](_0x3320d1);}return null;};}function patchUpdates(_0x328d14){return function(_0x397dd5){try{jsonpatch['apply'](_0x397dd5,_0x328d14,!![]);}catch(_0x4d35bf){return BPromise[_0x47f9('0x21')](_0x4d35bf);}return _0x397dd5['save']();};}function saveUpdates(_0x2e2b69,_0x29b7f8){return function(_0x2ecf99){if(_0x2ecf99){return _0x2ecf99[_0x47f9('0x22')](_0x2e2b69)[_0x47f9('0x23')](function(_0x11ef91){return _0x11ef91;});}return null;};}function removeEntity(_0x6a49d,_0x3c4778){return function(_0x4fd2b1){if(_0x4fd2b1){return _0x4fd2b1[_0x47f9('0x24')]()[_0x47f9('0x23')](function(){_0x6a49d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x26bd84,_0x4c16e0){return function(_0x76077d){if(!_0x76077d){_0x26bd84['sendStatus'](0x194);}return _0x76077d;};}function handleError(_0x26174a,_0x1a8c4b){_0x1a8c4b=_0x1a8c4b||0x1f4;return function(_0x5dbdda){logger[_0x47f9('0x25')](_0x5dbdda[_0x47f9('0x26')]);if(_0x5dbdda[_0x47f9('0x27')]){delete _0x5dbdda[_0x47f9('0x27')];}_0x26174a[_0x47f9('0x19')](_0x1a8c4b)[_0x47f9('0x28')](_0x5dbdda);};}exports[_0x47f9('0x29')]=function(_0x52927a,_0x53e951){var _0x4c37d2={},_0x481ccb={},_0x1a5b58={'count':0x0,'rows':[]};var _0x5818a6=_[_0x47f9('0x2a')](db[_0x47f9('0x2b')][_0x47f9('0x2c')],function(_0xaf0fea){return{'name':_0xaf0fea[_0x47f9('0x2d')],'type':_0xaf0fea[_0x47f9('0x2e')]['key']};});_0x481ccb['model']=_[_0x47f9('0x2a')](_0x5818a6,_0x47f9('0x27'));_0x481ccb['query']=_[_0x47f9('0x2f')](_0x52927a[_0x47f9('0x30')]);_0x481ccb[_0x47f9('0x31')]=_[_0x47f9('0x32')](_0x481ccb[_0x47f9('0x33')],_0x481ccb[_0x47f9('0x30')]);_0x4c37d2[_0x47f9('0x34')]=_[_0x47f9('0x32')](_0x481ccb[_0x47f9('0x33')],qs[_0x47f9('0x35')](_0x52927a[_0x47f9('0x30')][_0x47f9('0x35')]));_0x4c37d2[_0x47f9('0x34')]=_0x4c37d2['attributes'][_0x47f9('0x36')]?_0x4c37d2[_0x47f9('0x34')]:_0x481ccb['model'];if(!_0x52927a[_0x47f9('0x30')][_0x47f9('0x37')]('nolimit')){_0x4c37d2[_0x47f9('0x1d')]=qs['limit'](_0x52927a[_0x47f9('0x30')][_0x47f9('0x1d')]);_0x4c37d2[_0x47f9('0x1b')]=qs['offset'](_0x52927a[_0x47f9('0x30')][_0x47f9('0x1b')]);}_0x4c37d2[_0x47f9('0x38')]=qs[_0x47f9('0x39')](_0x52927a[_0x47f9('0x30')]['sort']);_0x4c37d2['where']=qs['filters'](_[_0x47f9('0x3a')](_0x52927a[_0x47f9('0x30')],_0x481ccb[_0x47f9('0x31')]),_0x5818a6);if(_0x52927a['query']['filter']){_0x4c37d2[_0x47f9('0x3b')]=_['merge'](_0x4c37d2[_0x47f9('0x3b')],{'$or':_['map'](_0x5818a6,function(_0x563492){if(_0x563492[_0x47f9('0x2e')]!=='VIRTUAL'){var _0xfe4480={};_0xfe4480[_0x563492[_0x47f9('0x27')]]={'$like':'%'+_0x52927a[_0x47f9('0x30')][_0x47f9('0x3c')]+'%'};return _0xfe4480;}})});}_0x4c37d2=_[_0x47f9('0x3d')]({},_0x4c37d2,_0x52927a[_0x47f9('0x3e')]);var _0x27ca33={'where':_0x4c37d2['where']};return db['JscriptyAnswerReport'][_0x47f9('0x1e')](_0x27ca33)[_0x47f9('0x23')](function(_0x118db1){_0x1a5b58[_0x47f9('0x1e')]=_0x118db1;if(_0x52927a[_0x47f9('0x30')]['includeAll']){_0x4c37d2[_0x47f9('0x3f')]=[{'all':!![]}];}return db[_0x47f9('0x2b')][_0x47f9('0x40')](_0x4c37d2);})[_0x47f9('0x23')](function(_0x3128bc){_0x1a5b58[_0x47f9('0x41')]=_0x3128bc;return _0x1a5b58;})[_0x47f9('0x23')](respondWithFilteredResult(_0x53e951,_0x4c37d2))[_0x47f9('0x42')](handleError(_0x53e951,null));};exports['show']=function(_0x311975,_0xc61254){var _0x55443d={'raw':!![],'where':{'id':_0x311975['params']['id']}},_0x587a7f={};_0x587a7f[_0x47f9('0x33')]=_[_0x47f9('0x2f')](db[_0x47f9('0x2b')][_0x47f9('0x2c')]);_0x587a7f[_0x47f9('0x30')]=_[_0x47f9('0x2f')](_0x311975[_0x47f9('0x30')]);_0x587a7f[_0x47f9('0x31')]=_[_0x47f9('0x32')](_0x587a7f[_0x47f9('0x33')],_0x587a7f['query']);_0x55443d['attributes']=_['intersection'](_0x587a7f[_0x47f9('0x33')],qs['fields'](_0x311975[_0x47f9('0x30')][_0x47f9('0x35')]));_0x55443d['attributes']=_0x55443d[_0x47f9('0x34')][_0x47f9('0x36')]?_0x55443d['attributes']:_0x587a7f[_0x47f9('0x33')];if(_0x311975[_0x47f9('0x30')]['includeAll']){_0x55443d[_0x47f9('0x3f')]=[{'all':!![]}];}_0x55443d=_[_0x47f9('0x3d')]({},_0x55443d,_0x311975[_0x47f9('0x3e')]);return db[_0x47f9('0x2b')][_0x47f9('0x43')](_0x55443d)[_0x47f9('0x23')](handleEntityNotFound(_0xc61254,null))[_0x47f9('0x23')](respondWithResult(_0xc61254,null))[_0x47f9('0x42')](handleError(_0xc61254,null));};exports[_0x47f9('0x44')]=function(_0x411695,_0x38d61d){return db[_0x47f9('0x2b')][_0x47f9('0x44')](_0x411695[_0x47f9('0x45')],{})[_0x47f9('0x23')](respondWithResult(_0x38d61d,0xc9))['catch'](handleError(_0x38d61d,null));};exports[_0x47f9('0x22')]=function(_0x1c6e21,_0x58fc09){if(_0x1c6e21[_0x47f9('0x45')]['id']){delete _0x1c6e21[_0x47f9('0x45')]['id'];}return db[_0x47f9('0x2b')]['find']({'where':{'id':_0x1c6e21['params']['id']}})[_0x47f9('0x23')](handleEntityNotFound(_0x58fc09,null))['then'](saveUpdates(_0x1c6e21[_0x47f9('0x45')],null))['then'](respondWithResult(_0x58fc09,null))['catch'](handleError(_0x58fc09,null));};exports[_0x47f9('0x24')]=function(_0x2bd2c7,_0x1b1029){return db[_0x47f9('0x2b')]['find']({'where':{'id':_0x2bd2c7[_0x47f9('0x46')]['id']}})['then'](handleEntityNotFound(_0x1b1029,null))['then'](removeEntity(_0x1b1029,null))[_0x47f9('0x42')](handleError(_0x1b1029,null));};exports[_0x47f9('0x47')]=function(_0x43eb5b,_0x3d796c){return db[_0x47f9('0x2b')][_0x47f9('0x47')]()['then'](respondWithResult(_0x3d796c,null))[_0x47f9('0x42')](handleError(_0x3d796c,null));};
\ No newline at end of file
+var _0x3248=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','index','map','JscriptyAnswerReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service'];(function(_0x49348a,_0x2ca546){var _0x209919=function(_0x595087){while(--_0x595087){_0x49348a['push'](_0x49348a['shift']());}};_0x209919(++_0x2ca546);}(_0x3248,0x1b0));var _0x8324=function(_0x443718,_0x4b374f){_0x443718=_0x443718-0x0;var _0x59f77e=_0x3248[_0x443718];return _0x59f77e;};'use strict';var emlformat=require(_0x8324('0x0'));var rimraf=require(_0x8324('0x1'));var zipdir=require(_0x8324('0x2'));var jsonpatch=require(_0x8324('0x3'));var rp=require(_0x8324('0x4'));var moment=require(_0x8324('0x5'));var BPromise=require(_0x8324('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8324('0x7'));var sox=require(_0x8324('0x8'));var csv=require('to-csv');var ejs=require(_0x8324('0x9'));var fs=require('fs');var fs_extra=require(_0x8324('0xa'));var _=require(_0x8324('0xb'));var squel=require(_0x8324('0xc'));var crypto=require(_0x8324('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8324('0xe'));var toCsv=require(_0x8324('0xf'));var querystring=require(_0x8324('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8324('0x11'));var qs=require(_0x8324('0x12'));var as=require(_0x8324('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8324('0x14'))(_0x8324('0x15'));var utils=require(_0x8324('0x16'));var config=require(_0x8324('0x17'));var licenseUtil=require(_0x8324('0x18'));var db=require(_0x8324('0x19'))['db'];function respondWithStatusCode(_0x4f000e,_0x59d3b1){_0x59d3b1=_0x59d3b1||0xcc;return function(_0x55e203){if(_0x55e203){return _0x4f000e[_0x8324('0x1a')](_0x59d3b1);}return _0x4f000e['status'](_0x59d3b1)['end']();};}function respondWithResult(_0x3bb793,_0xdd6c0e){_0xdd6c0e=_0xdd6c0e||0xc8;return function(_0x13131d){if(_0x13131d){return _0x3bb793['status'](_0xdd6c0e)[_0x8324('0x1b')](_0x13131d);}};}function respondWithFilteredResult(_0x1ab2eb,_0xb94f60){return function(_0x578c0d){if(_0x578c0d){var _0x297035=typeof _0xb94f60[_0x8324('0x1c')]===_0x8324('0x1d')&&typeof _0xb94f60[_0x8324('0x1e')]===_0x8324('0x1d');var _0x3f067c=_0x578c0d['count'];var _0x4ef97c=_0x297035?0x0:_0xb94f60[_0x8324('0x1c')];var _0x404d16=_0x297035?_0x578c0d[_0x8324('0x1f')]:_0xb94f60['offset']+_0xb94f60[_0x8324('0x1e')];var _0x19a888;if(_0x404d16>=_0x3f067c){_0x404d16=_0x3f067c;_0x19a888=0xc8;}else{_0x19a888=0xce;}_0x1ab2eb[_0x8324('0x20')](_0x19a888);return _0x1ab2eb[_0x8324('0x21')](_0x8324('0x22'),_0x4ef97c+'-'+_0x404d16+'/'+_0x3f067c)['json'](_0x578c0d);}return null;};}function patchUpdates(_0xbafbed){return function(_0x5e07b5){try{jsonpatch[_0x8324('0x23')](_0x5e07b5,_0xbafbed,!![]);}catch(_0x5aba37){return BPromise[_0x8324('0x24')](_0x5aba37);}return _0x5e07b5['save']();};}function saveUpdates(_0x71f390,_0xb31584){return function(_0xb248c6){if(_0xb248c6){return _0xb248c6[_0x8324('0x25')](_0x71f390)[_0x8324('0x26')](function(_0x354842){return _0x354842;});}return null;};}function removeEntity(_0x44042f,_0x10fc10){return function(_0x2f44f0){if(_0x2f44f0){return _0x2f44f0[_0x8324('0x27')]()[_0x8324('0x26')](function(){_0x44042f[_0x8324('0x20')](0xcc)[_0x8324('0x28')]();});}};}function handleEntityNotFound(_0x38a09a,_0x3904b0){return function(_0x1fd50e){if(!_0x1fd50e){_0x38a09a[_0x8324('0x1a')](0x194);}return _0x1fd50e;};}function handleError(_0x32510a,_0x3a94fe){_0x3a94fe=_0x3a94fe||0x1f4;return function(_0x2b77e4){logger[_0x8324('0x29')](_0x2b77e4[_0x8324('0x2a')]);if(_0x2b77e4[_0x8324('0x2b')]){delete _0x2b77e4[_0x8324('0x2b')];}_0x32510a[_0x8324('0x20')](_0x3a94fe)['send'](_0x2b77e4);};}exports[_0x8324('0x2c')]=function(_0x43e43d,_0x38cae6){var _0x17bda7={},_0x4ee093={},_0x2fda80={'count':0x0,'rows':[]};var _0x268345=_[_0x8324('0x2d')](db[_0x8324('0x2e')][_0x8324('0x2f')],function(_0x7dc4c9){return{'name':_0x7dc4c9[_0x8324('0x30')],'type':_0x7dc4c9['type'][_0x8324('0x31')]};});_0x4ee093[_0x8324('0x32')]=_[_0x8324('0x2d')](_0x268345,_0x8324('0x2b'));_0x4ee093[_0x8324('0x33')]=_[_0x8324('0x34')](_0x43e43d['query']);_0x4ee093[_0x8324('0x35')]=_[_0x8324('0x36')](_0x4ee093['model'],_0x4ee093[_0x8324('0x33')]);_0x17bda7[_0x8324('0x37')]=_[_0x8324('0x36')](_0x4ee093['model'],qs[_0x8324('0x38')](_0x43e43d[_0x8324('0x33')]['fields']));_0x17bda7['attributes']=_0x17bda7[_0x8324('0x37')][_0x8324('0x39')]?_0x17bda7[_0x8324('0x37')]:_0x4ee093['model'];if(!_0x43e43d['query']['hasOwnProperty'](_0x8324('0x3a'))){_0x17bda7[_0x8324('0x1e')]=qs[_0x8324('0x1e')](_0x43e43d[_0x8324('0x33')]['limit']);_0x17bda7[_0x8324('0x1c')]=qs[_0x8324('0x1c')](_0x43e43d[_0x8324('0x33')][_0x8324('0x1c')]);}_0x17bda7['order']=qs[_0x8324('0x3b')](_0x43e43d[_0x8324('0x33')][_0x8324('0x3b')]);_0x17bda7[_0x8324('0x3c')]=qs['filters'](_[_0x8324('0x3d')](_0x43e43d[_0x8324('0x33')],_0x4ee093[_0x8324('0x35')]),_0x268345);if(_0x43e43d[_0x8324('0x33')][_0x8324('0x3e')]){_0x17bda7[_0x8324('0x3c')]=_[_0x8324('0x3f')](_0x17bda7[_0x8324('0x3c')],{'$or':_[_0x8324('0x2d')](_0x268345,function(_0x50097f){if(_0x50097f['type']!=='VIRTUAL'){var _0x127ebf={};_0x127ebf[_0x50097f[_0x8324('0x2b')]]={'$like':'%'+_0x43e43d[_0x8324('0x33')][_0x8324('0x3e')]+'%'};return _0x127ebf;}})});}_0x17bda7=_['merge']({},_0x17bda7,_0x43e43d[_0x8324('0x40')]);var _0x5f2c9d={'where':_0x17bda7[_0x8324('0x3c')]};return db[_0x8324('0x2e')]['count'](_0x5f2c9d)[_0x8324('0x26')](function(_0x21113d){_0x2fda80[_0x8324('0x1f')]=_0x21113d;if(_0x43e43d[_0x8324('0x33')][_0x8324('0x41')]){_0x17bda7[_0x8324('0x42')]=[{'all':!![]}];}return db[_0x8324('0x2e')][_0x8324('0x43')](_0x17bda7);})[_0x8324('0x26')](function(_0x145b52){_0x2fda80[_0x8324('0x44')]=_0x145b52;return _0x2fda80;})[_0x8324('0x26')](respondWithFilteredResult(_0x38cae6,_0x17bda7))[_0x8324('0x45')](handleError(_0x38cae6,null));};exports['show']=function(_0x172b4d,_0x270e95){var _0x587e4c={'raw':!![],'where':{'id':_0x172b4d['params']['id']}},_0x34506c={};_0x34506c[_0x8324('0x32')]=_['keys'](db[_0x8324('0x2e')][_0x8324('0x2f')]);_0x34506c[_0x8324('0x33')]=_[_0x8324('0x34')](_0x172b4d[_0x8324('0x33')]);_0x34506c['filters']=_['intersection'](_0x34506c[_0x8324('0x32')],_0x34506c[_0x8324('0x33')]);_0x587e4c[_0x8324('0x37')]=_[_0x8324('0x36')](_0x34506c['model'],qs[_0x8324('0x38')](_0x172b4d['query'][_0x8324('0x38')]));_0x587e4c[_0x8324('0x37')]=_0x587e4c[_0x8324('0x37')][_0x8324('0x39')]?_0x587e4c['attributes']:_0x34506c[_0x8324('0x32')];if(_0x172b4d['query'][_0x8324('0x41')]){_0x587e4c[_0x8324('0x42')]=[{'all':!![]}];}_0x587e4c=_[_0x8324('0x3f')]({},_0x587e4c,_0x172b4d[_0x8324('0x40')]);return db['JscriptyAnswerReport'][_0x8324('0x46')](_0x587e4c)[_0x8324('0x26')](handleEntityNotFound(_0x270e95,null))[_0x8324('0x26')](respondWithResult(_0x270e95,null))['catch'](handleError(_0x270e95,null));};exports[_0x8324('0x47')]=function(_0x5a4816,_0x226e8c){return db[_0x8324('0x2e')][_0x8324('0x47')](_0x5a4816[_0x8324('0x48')],{})['then'](respondWithResult(_0x226e8c,0xc9))[_0x8324('0x45')](handleError(_0x226e8c,null));};exports[_0x8324('0x25')]=function(_0x119b8c,_0x18f459){if(_0x119b8c[_0x8324('0x48')]['id']){delete _0x119b8c['body']['id'];}return db[_0x8324('0x2e')][_0x8324('0x46')]({'where':{'id':_0x119b8c['params']['id']}})['then'](handleEntityNotFound(_0x18f459,null))[_0x8324('0x26')](saveUpdates(_0x119b8c['body'],null))['then'](respondWithResult(_0x18f459,null))[_0x8324('0x45')](handleError(_0x18f459,null));};exports[_0x8324('0x27')]=function(_0x5ded79,_0x1951e8){return db['JscriptyAnswerReport']['find']({'where':{'id':_0x5ded79[_0x8324('0x49')]['id']}})['then'](handleEntityNotFound(_0x1951e8,null))[_0x8324('0x26')](removeEntity(_0x1951e8,null))[_0x8324('0x45')](handleError(_0x1951e8,null));};exports[_0x8324('0x4a')]=function(_0x32a8f5,_0x4c2b56){return db[_0x8324('0x2e')][_0x8324('0x4a')]()[_0x8324('0x26')](respondWithResult(_0x4c2b56,null))[_0x8324('0x45')](handleError(_0x4c2b56,null));};
\ No newline at end of file
index 90596f5..4d64c05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5696=['report_jscripty_answers','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','JscriptyAnswerReport'];(function(_0x52eaf4,_0x4d0da0){var _0xb96aba=function(_0x28fde2){while(--_0x28fde2){_0x52eaf4['push'](_0x52eaf4['shift']());}};_0xb96aba(++_0x4d0da0);}(_0x5696,0xf3));var _0x6569=function(_0x395e94,_0x198877){_0x395e94=_0x395e94-0x0;var _0x919c71=_0x5696[_0x395e94];return _0x919c71;};'use strict';var _=require('lodash');var util=require(_0x6569('0x0'));var logger=require(_0x6569('0x1'))('api');var moment=require(_0x6569('0x2'));var BPromise=require(_0x6569('0x3'));var rp=require(_0x6569('0x4'));var fs=require('fs');var path=require(_0x6569('0x5'));var rimraf=require(_0x6569('0x6'));var config=require(_0x6569('0x7'));var attributes=require('./jscriptyAnswerReport.attributes');module['exports']=function(_0x2b4e94,_0x50b4ce){return _0x2b4e94[_0x6569('0x8')](_0x6569('0x9'),attributes,{'tableName':_0x6569('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x68f9=['moment','request-promise','path','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','report_jscripty_answers','lodash','util'];(function(_0x2d137d,_0x4efbca){var _0x3ee3c9=function(_0x131609){while(--_0x131609){_0x2d137d['push'](_0x2d137d['shift']());}};_0x3ee3c9(++_0x4efbca);}(_0x68f9,0x94));var _0x968f=function(_0x3fce52,_0x50baee){_0x3fce52=_0x3fce52-0x0;var _0x2a6691=_0x68f9[_0x3fce52];return _0x2a6691;};'use strict';var _=require(_0x968f('0x0'));var util=require(_0x968f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x968f('0x2'));var BPromise=require('bluebird');var rp=require(_0x968f('0x3'));var fs=require('fs');var path=require(_0x968f('0x4'));var rimraf=require('rimraf');var config=require(_0x968f('0x5'));var attributes=require(_0x968f('0x6'));module[_0x968f('0x7')]=function(_0x106db4,_0x2c68b9){return _0x106db4[_0x968f('0x8')]('JscriptyAnswerReport',attributes,{'tableName':_0x968f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f4144a5..0e6cc05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb5a=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x183b97,_0x2d297c){var _0x629cf7=function(_0x4ffd24){while(--_0x4ffd24){_0x183b97['push'](_0x183b97['shift']());}};_0x629cf7(++_0x2d297c);}(_0xdb5a,0x1c1));var _0xadb5=function(_0x1e6e56,_0x2ecb79){_0x1e6e56=_0x1e6e56-0x0;var _0x265bd7=_0xdb5a[_0x1e6e56];return _0x265bd7;};'use strict';var _=require(_0xadb5('0x0'));var util=require(_0xadb5('0x1'));var moment=require(_0xadb5('0x2'));var BPromise=require(_0xadb5('0x3'));var rs=require(_0xadb5('0x4'));var fs=require('fs');var Redis=require(_0xadb5('0x5'));var db=require(_0xadb5('0x6'))['db'];var utils=require(_0xadb5('0x7'));var logger=require('../../config/logger')(_0xadb5('0x8'));var config=require(_0xadb5('0x9'));var jayson=require(_0xadb5('0xa'));var client=jayson[_0xadb5('0xb')][_0xadb5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xb69788,_0x4c0320,_0x1361d2){return new BPromise(function(_0x4265b9,_0x293aa0){return client[_0xadb5('0xd')](_0xb69788,_0x1361d2)['then'](function(_0x3bf68a){logger['info'](_0xadb5('0xe'),_0x4c0320,_0xadb5('0xf'));logger[_0xadb5('0x10')](_0xadb5('0x11'),_0x4c0320,_0xadb5('0xf'),JSON[_0xadb5('0x12')](_0x3bf68a));if(_0x3bf68a[_0xadb5('0x13')]){if(_0x3bf68a[_0xadb5('0x13')][_0xadb5('0x14')]===0x1f4){logger[_0xadb5('0x13')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x4c0320,_0x3bf68a[_0xadb5('0x13')]['message']);return _0x293aa0(_0x3bf68a[_0xadb5('0x13')][_0xadb5('0x15')]);}logger[_0xadb5('0x13')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x4c0320,_0x3bf68a[_0xadb5('0x13')]['message']);return _0x4265b9(_0x3bf68a[_0xadb5('0x13')]['message']);}else{logger[_0xadb5('0x16')](_0xadb5('0xe'),_0x4c0320,_0xadb5('0xf'));_0x4265b9(_0x3bf68a[_0xadb5('0x17')][_0xadb5('0x15')]);}})['catch'](function(_0x207786){logger[_0xadb5('0x13')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x4c0320,_0x207786);_0x293aa0(_0x207786);});});}
\ No newline at end of file
+var _0x9ff8=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s'];(function(_0x2f4b05,_0x385e23){var _0x310efe=function(_0x27f183){while(--_0x27f183){_0x2f4b05['push'](_0x2f4b05['shift']());}};_0x310efe(++_0x385e23);}(_0x9ff8,0x6a));var _0x89ff=function(_0x495128,_0xb89dbb){_0x495128=_0x495128-0x0;var _0x17ee2b=_0x9ff8[_0x495128];return _0x17ee2b;};'use strict';var _=require(_0x89ff('0x0'));var util=require(_0x89ff('0x1'));var moment=require(_0x89ff('0x2'));var BPromise=require(_0x89ff('0x3'));var rs=require(_0x89ff('0x4'));var fs=require('fs');var Redis=require(_0x89ff('0x5'));var db=require(_0x89ff('0x6'))['db'];var utils=require(_0x89ff('0x7'));var logger=require('../../config/logger')(_0x89ff('0x8'));var config=require('../../config/environment');var jayson=require(_0x89ff('0x9'));var client=jayson[_0x89ff('0xa')][_0x89ff('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x453ed4,_0x1a2a82,_0x1aa3fb){return new BPromise(function(_0x3db4b7,_0x5b9707){return client[_0x89ff('0xc')](_0x453ed4,_0x1aa3fb)[_0x89ff('0xd')](function(_0x56f5c5){logger[_0x89ff('0xe')](_0x89ff('0xf'),_0x1a2a82,_0x89ff('0x10'));logger[_0x89ff('0x11')](_0x89ff('0x12'),_0x1a2a82,_0x89ff('0x10'),JSON[_0x89ff('0x13')](_0x56f5c5));if(_0x56f5c5[_0x89ff('0x14')]){if(_0x56f5c5[_0x89ff('0x14')][_0x89ff('0x15')]===0x1f4){logger[_0x89ff('0x14')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x1a2a82,_0x56f5c5[_0x89ff('0x14')]['message']);return _0x5b9707(_0x56f5c5[_0x89ff('0x14')][_0x89ff('0x16')]);}logger[_0x89ff('0x14')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x1a2a82,_0x56f5c5[_0x89ff('0x14')][_0x89ff('0x16')]);return _0x3db4b7(_0x56f5c5[_0x89ff('0x14')]['message']);}else{logger[_0x89ff('0xe')](_0x89ff('0xf'),_0x1a2a82,_0x89ff('0x10'));_0x3db4b7(_0x56f5c5[_0x89ff('0x17')]['message']);}})[_0x89ff('0x18')](function(_0x330de4){logger['error'](_0x89ff('0xf'),_0x1a2a82,_0x330de4);_0x5b9707(_0x330de4);});});}
\ No newline at end of file
index 3eb5b44..f22e83b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d13=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','getSummary','post','/:id/clone','clone','put','update','delete','destroy','exports'];(function(_0x24f2a7,_0xdf7c26){var _0x5c4310=function(_0x37d86c){while(--_0x37d86c){_0x24f2a7['push'](_0x24f2a7['shift']());}};_0x5c4310(++_0xdf7c26);}(_0x3d13,0x1e6));var _0x33d1=function(_0x4d01f6,_0x20b3a4){_0x4d01f6=_0x4d01f6-0x0;var _0x41ffe3=_0x3d13[_0x4d01f6];return _0x41ffe3;};'use strict';var multer=require(_0x33d1('0x0'));var util=require(_0x33d1('0x1'));var path=require('path');var timeout=require(_0x33d1('0x2'));var express=require(_0x33d1('0x3'));var router=express[_0x33d1('0x4')]();var fs_extra=require(_0x33d1('0x5'));var auth=require(_0x33d1('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x33d1('0x7'));router[_0x33d1('0x8')]('/',auth[_0x33d1('0x9')](),controller[_0x33d1('0xa')]);router[_0x33d1('0x8')](_0x33d1('0xb'),auth[_0x33d1('0x9')](),controller[_0x33d1('0xc')]);router['get'](_0x33d1('0xd'),auth[_0x33d1('0x9')](),controller[_0x33d1('0xe')]);router[_0x33d1('0x8')](_0x33d1('0xf'),auth[_0x33d1('0x9')](),controller[_0x33d1('0x10')]);router['get'](_0x33d1('0x11'),auth[_0x33d1('0x9')](),timeout('30s'),controller[_0x33d1('0x12')]);router['post']('/',auth[_0x33d1('0x9')](),controller['create']);router[_0x33d1('0x13')](_0x33d1('0x14'),auth['isAuthenticated'](),controller[_0x33d1('0x15')]);router[_0x33d1('0x16')](_0x33d1('0xb'),auth[_0x33d1('0x9')](),controller[_0x33d1('0x17')]);router[_0x33d1('0x18')](_0x33d1('0xb'),auth[_0x33d1('0x9')](),controller[_0x33d1('0x19')]);module[_0x33d1('0x1a')]=router;
\ No newline at end of file
+var _0x457b=['getAnswers','/:id/summary','30s','post','create','/:id/clone','update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./jscriptyProject.controller','isAuthenticated','index','get','/:id','/:id/sessions'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x457b,0x17e));var _0xb457=function(_0x268530,_0x3c699d){_0x268530=_0x268530-0x0;var _0x159370=_0x457b[_0x268530];return _0x159370;};'use strict';var multer=require(_0xb457('0x0'));var util=require(_0xb457('0x1'));var path=require(_0xb457('0x2'));var timeout=require(_0xb457('0x3'));var express=require(_0xb457('0x4'));var router=express[_0xb457('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb457('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb457('0x7'));var controller=require(_0xb457('0x8'));router['get']('/',auth[_0xb457('0x9')](),controller[_0xb457('0xa')]);router[_0xb457('0xb')](_0xb457('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0xb457('0xd'),auth[_0xb457('0x9')](),controller['getSessions']);router['get']('/:id/answers',auth['isAuthenticated'](),controller[_0xb457('0xe')]);router[_0xb457('0xb')](_0xb457('0xf'),auth[_0xb457('0x9')](),timeout(_0xb457('0x10')),controller['getSummary']);router[_0xb457('0x11')]('/',auth['isAuthenticated'](),controller[_0xb457('0x12')]);router[_0xb457('0x11')](_0xb457('0x13'),auth['isAuthenticated'](),controller['clone']);router['put'](_0xb457('0xc'),auth['isAuthenticated'](),controller[_0xb457('0x14')]);router[_0xb457('0x15')](_0xb457('0xc'),auth[_0xb457('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 9912128..299531c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcccc=['name','TEXT','long','formData','stringify','setDataValue','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcccc,0xce));var _0xcccc=function(_0x4bfd95,_0x1c3b3b){_0x4bfd95=_0x4bfd95-0x0;var _0x1484cd=_0xcccc[_0x4bfd95];return _0x1484cd;};'use strict';var Sequelize=require(_0xcccc('0x0'));var _=require(_0xcccc('0x1'));var util=require(_0xcccc('0x2'));module['exports']={'name':{'type':Sequelize[_0xcccc('0x3')],'unique':_0xcccc('0x4')},'description':{'type':Sequelize[_0xcccc('0x3')]},'formData':{'type':Sequelize[_0xcccc('0x5')](_0xcccc('0x6')),'set':function(_0x1c6ed4){if(_['isObjectLike'](_0x1c6ed4)){this['setDataValue'](_0xcccc('0x7'),JSON[_0xcccc('0x8')](_0x1c6ed4));}else if(_['isString'](_0x1c6ed4)){this[_0xcccc('0x9')](_0xcccc('0x7'),_0x1c6ed4);}else{this[_0xcccc('0x9')]('formData',util['format'](_0xcccc('0xa'),this[_0xcccc('0xb')](_0xcccc('0x4'))||'',this[_0xcccc('0xb')](_0xcccc('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xcccc('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xcc3c=['formData','stringify','isString','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','name','description','BOOLEAN','sequelize','lodash','util','exports','STRING','isObjectLike'];(function(_0x29f476,_0x2db883){var _0x18ded1=function(_0x221cc6){while(--_0x221cc6){_0x29f476['push'](_0x29f476['shift']());}};_0x18ded1(++_0x2db883);}(_0xcc3c,0x1ba));var _0xccc3=function(_0x377b88,_0x24bc71){_0x377b88=_0x377b88-0x0;var _0x1f5ced=_0xcc3c[_0x377b88];return _0x1f5ced;};'use strict';var Sequelize=require(_0xccc3('0x0'));var _=require(_0xccc3('0x1'));var util=require(_0xccc3('0x2'));module[_0xccc3('0x3')]={'name':{'type':Sequelize[_0xccc3('0x4')],'unique':'name'},'description':{'type':Sequelize[_0xccc3('0x4')]},'formData':{'type':Sequelize['TEXT']('long'),'set':function(_0x427751){if(_[_0xccc3('0x5')](_0x427751)){this['setDataValue'](_0xccc3('0x6'),JSON[_0xccc3('0x7')](_0x427751));}else if(_[_0xccc3('0x8')](_0x427751)){this[_0xccc3('0x9')](_0xccc3('0x6'),_0x427751);}else{this[_0xccc3('0x9')](_0xccc3('0x6'),util[_0xccc3('0xa')](_0xccc3('0xb'),this[_0xccc3('0xc')](_0xccc3('0xd'))||'',this[_0xccc3('0xc')](_0xccc3('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xccc3('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xccc3('0xf')],'defaultValue':![]}};
\ No newline at end of file
index fea208e..f2120c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0999=['replace','getSummary','starttime','startTime','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','push','isEmpty','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','text/csv','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','Projects','UserProfileResource','end','error','stack','name','send','map','rawAttributes','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','filters','merge','VIRTUAL','filter','options','JscriptyProject','includeAll','include','params','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','body','omit','update','getSessions','findOne','JscriptySessionReport','pick','ProjectId','findAll','rows','JscriptyAnswerReport','nolimit','number','fromCharCode','indexOf','toString'];(function(_0x178a9c,_0x562a28){var _0x3fd933=function(_0x37a0e2){while(--_0x37a0e2){_0x178a9c['push'](_0x178a9c['shift']());}};_0x3fd933(++_0x562a28);}(_0x0999,0x85));var _0x9099=function(_0x199b1f,_0x4ed849){_0x199b1f=_0x199b1f-0x0;var _0x267ac9=_0x0999[_0x199b1f];return _0x267ac9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9099('0x0'));var zipdir=require(_0x9099('0x1'));var jsonpatch=require(_0x9099('0x2'));var rp=require(_0x9099('0x3'));var moment=require(_0x9099('0x4'));var BPromise=require(_0x9099('0x5'));var Mustache=require(_0x9099('0x6'));var util=require(_0x9099('0x7'));var path=require(_0x9099('0x8'));var sox=require(_0x9099('0x9'));var csv=require(_0x9099('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9099('0xb'));var _=require(_0x9099('0xc'));var squel=require('squel');var crypto=require(_0x9099('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9099('0xa'));var querystring=require(_0x9099('0xe'));var Papa=require('papaparse');var Redis=require(_0x9099('0xf'));var authService=require(_0x9099('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9099('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9099('0x12'))(_0x9099('0x13'));var utils=require(_0x9099('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x9099('0x15'));var db=require(_0x9099('0x16'))['db'];function respondWithStatusCode(_0xaf38f0,_0x59e806){_0x59e806=_0x59e806||0xcc;return function(_0x159346){if(_0x159346){return _0xaf38f0[_0x9099('0x17')](_0x59e806);}return _0xaf38f0[_0x9099('0x18')](_0x59e806)['end']();};}function respondWithResult(_0x5bb453,_0x298d04){_0x298d04=_0x298d04||0xc8;return function(_0x4d3233){if(_0x4d3233){return _0x5bb453[_0x9099('0x18')](_0x298d04)['json'](_0x4d3233);}};}function respondWithFilteredResult(_0x359cc4,_0x4c55dc){return function(_0x3548e8){if(_0x3548e8){var _0x1867a0=typeof _0x4c55dc[_0x9099('0x19')]===_0x9099('0x1a')&&typeof _0x4c55dc[_0x9099('0x1b')]===_0x9099('0x1a');var _0xc2094a=_0x3548e8[_0x9099('0x1c')];var _0x993bb9=_0x1867a0?0x0:_0x4c55dc[_0x9099('0x19')];var _0x563325=_0x1867a0?_0x3548e8['count']:_0x4c55dc[_0x9099('0x19')]+_0x4c55dc[_0x9099('0x1b')];var _0x490f05;if(_0x563325>=_0xc2094a){_0x563325=_0xc2094a;_0x490f05=0xc8;}else{_0x490f05=0xce;}_0x359cc4[_0x9099('0x18')](_0x490f05);return _0x359cc4[_0x9099('0x1d')](_0x9099('0x1e'),_0x993bb9+'-'+_0x563325+'/'+_0xc2094a)['json'](_0x3548e8);}return null;};}function patchUpdates(_0x5e962d){return function(_0x23c1b6){try{jsonpatch[_0x9099('0x1f')](_0x23c1b6,_0x5e962d,!![]);}catch(_0xbb444d){return BPromise[_0x9099('0x20')](_0xbb444d);}return _0x23c1b6[_0x9099('0x21')]();};}function saveUpdates(_0x305826,_0x23e12){return function(_0x53aa89){if(_0x53aa89){return _0x53aa89['update'](_0x305826)[_0x9099('0x22')](function(_0x5a2b7f){return _0x5a2b7f;});}return null;};}function removeEntity(_0xe12a3c,_0x22f4b3){return function(_0x281cb0){if(_0x281cb0){return _0x281cb0[_0x9099('0x23')]()[_0x9099('0x22')](function(){var _0x34c616=_0x281cb0[_0x9099('0x24')]({'plain':!![]});var _0x387688=_0x9099('0x25');return db[_0x9099('0x26')]['destroy']({'where':{'type':_0x387688,'resourceId':_0x34c616['id']}})['then'](function(){return _0x281cb0;});})[_0x9099('0x22')](function(){_0xe12a3c[_0x9099('0x18')](0xcc)[_0x9099('0x27')]();});}};}function handleEntityNotFound(_0x28777f,_0x22a652){return function(_0x326cd1){if(!_0x326cd1){_0x28777f[_0x9099('0x17')](0x194);}return _0x326cd1;};}function handleError(_0xf1eae6,_0x49e9c0){_0x49e9c0=_0x49e9c0||0x1f4;return function(_0xe677c0){logger[_0x9099('0x28')](_0xe677c0[_0x9099('0x29')]);if(_0xe677c0['name']){delete _0xe677c0[_0x9099('0x2a')];}_0xf1eae6[_0x9099('0x18')](_0x49e9c0)[_0x9099('0x2b')](_0xe677c0);};}exports['index']=function(_0x4c7e93,_0x33b831){var _0x165092={},_0x4cc428={},_0xdc3c9c={'count':0x0,'rows':[]};var _0x77e9d8=_[_0x9099('0x2c')](db['JscriptyProject'][_0x9099('0x2d')],function(_0x11f38a){return{'name':_0x11f38a['fieldName'],'type':_0x11f38a['type'][_0x9099('0x2e')]};});_0x4cc428['model']=_[_0x9099('0x2c')](_0x77e9d8,_0x9099('0x2a'));_0x4cc428[_0x9099('0x2f')]=_[_0x9099('0x30')](_0x4c7e93[_0x9099('0x2f')]);_0x4cc428['filters']=_[_0x9099('0x31')](_0x4cc428[_0x9099('0x32')],_0x4cc428[_0x9099('0x2f')]);_0x165092[_0x9099('0x33')]=_['intersection'](_0x4cc428[_0x9099('0x32')],qs[_0x9099('0x34')](_0x4c7e93[_0x9099('0x2f')][_0x9099('0x34')]));_0x165092[_0x9099('0x33')]=_0x165092[_0x9099('0x33')]['length']?_0x165092['attributes']:_0x4cc428[_0x9099('0x32')];if(!_0x4c7e93[_0x9099('0x2f')][_0x9099('0x35')]('nolimit')){_0x165092['limit']=qs['limit'](_0x4c7e93[_0x9099('0x2f')][_0x9099('0x1b')]);_0x165092[_0x9099('0x19')]=qs['offset'](_0x4c7e93[_0x9099('0x2f')]['offset']);}_0x165092[_0x9099('0x36')]=qs[_0x9099('0x37')](_0x4c7e93[_0x9099('0x2f')][_0x9099('0x37')]);_0x165092[_0x9099('0x38')]=qs[_0x9099('0x39')](_['pick'](_0x4c7e93[_0x9099('0x2f')],_0x4cc428[_0x9099('0x39')]),_0x77e9d8);if(_0x4c7e93[_0x9099('0x2f')]['filter']){_0x165092['where']=_[_0x9099('0x3a')](_0x165092['where'],{'$or':_[_0x9099('0x2c')](_0x77e9d8,function(_0x477d06){if(_0x477d06['type']!==_0x9099('0x3b')){var _0x35ae8b={};_0x35ae8b[_0x477d06[_0x9099('0x2a')]]={'$like':'%'+_0x4c7e93['query'][_0x9099('0x3c')]+'%'};return _0x35ae8b;}})});}_0x165092=_[_0x9099('0x3a')]({},_0x165092,_0x4c7e93[_0x9099('0x3d')]);var _0x342e9a={'where':_0x165092['where']};return db[_0x9099('0x3e')]['count'](_0x342e9a)[_0x9099('0x22')](function(_0x52244c){_0xdc3c9c['count']=_0x52244c;if(_0x4c7e93[_0x9099('0x2f')][_0x9099('0x3f')]){_0x165092[_0x9099('0x40')]=[{'all':!![]}];}return db[_0x9099('0x3e')]['findAll'](_0x165092);})[_0x9099('0x22')](function(_0x1918ca){_0xdc3c9c['rows']=_0x1918ca;return _0xdc3c9c;})[_0x9099('0x22')](respondWithFilteredResult(_0x33b831,_0x165092))['catch'](handleError(_0x33b831,null));};exports['show']=function(_0x143dff,_0x512c8b){var _0x4f7429={'raw':![],'where':{'id':_0x143dff[_0x9099('0x41')]['id']}},_0x1b63ef={};_0x1b63ef['model']=_[_0x9099('0x30')](db[_0x9099('0x3e')][_0x9099('0x2d')]);_0x1b63ef['query']=_[_0x9099('0x30')](_0x143dff['query']);_0x1b63ef[_0x9099('0x39')]=_[_0x9099('0x31')](_0x1b63ef[_0x9099('0x32')],_0x1b63ef[_0x9099('0x2f')]);_0x4f7429[_0x9099('0x33')]=_[_0x9099('0x31')](_0x1b63ef[_0x9099('0x32')],qs[_0x9099('0x34')](_0x143dff['query'][_0x9099('0x34')]));_0x4f7429[_0x9099('0x33')]=_0x4f7429['attributes'][_0x9099('0x42')]?_0x4f7429[_0x9099('0x33')]:_0x1b63ef['model'];if(_0x143dff[_0x9099('0x2f')][_0x9099('0x3f')]){_0x4f7429[_0x9099('0x40')]=[{'all':!![]}];}_0x4f7429=_[_0x9099('0x3a')]({},_0x4f7429,_0x143dff['options']);return db['JscriptyProject'][_0x9099('0x43')](_0x4f7429)['then'](handleEntityNotFound(_0x512c8b,null))[_0x9099('0x22')](respondWithResult(_0x512c8b,null))['catch'](handleError(_0x512c8b,null));};exports[_0x9099('0x44')]=function(_0xbe9cbc,_0x234da5){return db[_0x9099('0x3e')][_0x9099('0x44')](_0xbe9cbc['body'],{})['then'](function(_0x5086c1){var _0x2b15ed=_0xbe9cbc[_0x9099('0x45')][_0x9099('0x24')]({'plain':!![]});if(!_0x2b15ed)throw new Error(_0x9099('0x46'));if(_0x2b15ed[_0x9099('0x47')]===_0x9099('0x45')){var _0x3de0c1=_0x5086c1[_0x9099('0x24')]({'plain':!![]});var _0x383db5='Projects';return db[_0x9099('0x48')]['find']({'where':{'name':_0x383db5,'userProfileId':_0x2b15ed[_0x9099('0x49')]},'raw':!![]})[_0x9099('0x22')](function(_0x51688f){if(_0x51688f&&_0x51688f[_0x9099('0x4a')]===0x0){return db['UserProfileResource'][_0x9099('0x44')]({'name':_0x3de0c1[_0x9099('0x2a')],'resourceId':_0x3de0c1['id'],'type':_0x51688f[_0x9099('0x2a')],'sectionId':_0x51688f['id']},{})[_0x9099('0x22')](function(){return _0x5086c1;});}else{return _0x5086c1;}})[_0x9099('0x4b')](function(_0x181088){logger[_0x9099('0x28')](_0x9099('0x4c'),_0x181088);throw _0x181088;});}return _0x5086c1;})[_0x9099('0x22')](respondWithResult(_0x234da5,0xc9))[_0x9099('0x4b')](handleError(_0x234da5,null));};exports[_0x9099('0x4d')]=function(_0x42cc30,_0x263412){var _0x4ac885={'where':{'id':_0x42cc30[_0x9099('0x41')]['id']}},_0x49ffb8={};_0x49ffb8['model']=_[_0x9099('0x30')](db[_0x9099('0x3e')][_0x9099('0x2d')]);_0x4ac885[_0x9099('0x33')]=_[_0x9099('0x31')](_0x49ffb8[_0x9099('0x32')],qs[_0x9099('0x34')](_0x42cc30['query'][_0x9099('0x34')]));_0x4ac885['attributes']=_0x4ac885['attributes'][_0x9099('0x42')]?_0x4ac885[_0x9099('0x33')]:_0x49ffb8['model'];if(_0x42cc30[_0x9099('0x2f')][_0x9099('0x3f')]){_0x4ac885[_0x9099('0x40')]=[{'all':!![]}];}_0x4ac885=_[_0x9099('0x3a')]({},_0x4ac885,_0x42cc30[_0x9099('0x3d')]);return db[_0x9099('0x3e')][_0x9099('0x43')](_0x4ac885)[_0x9099('0x22')](handleEntityNotFound(_0x263412,null))[_0x9099('0x22')](function(_0x2fce16){if(_0x2fce16){var _0x425105=_0x2fce16[_0x9099('0x24')]({'plain':!![]});_0x425105=qs['omit'](_0x425105,['id',_0x9099('0x4e'),'updatedAt']);_0x42cc30[_0x9099('0x4f')]=_[_0x9099('0x50')](_0x42cc30[_0x9099('0x4f')],['id',_0x9099('0x4e'),'updatedAt']);return db['JscriptyProject'][_0x9099('0x44')](_[_0x9099('0x3a')](_0x425105,_0x42cc30[_0x9099('0x4f')]),{'include':_0x42cc30['query'][_0x9099('0x3f')]?[{'all':!![]}]:undefined})['then'](function(_0x429773){var _0x396f39=_0x42cc30[_0x9099('0x45')]['get']({'plain':!![]});if(!_0x396f39)throw new Error(_0x9099('0x46'));if(_0x396f39['role']===_0x9099('0x45')){var _0x53bb97=_0x429773[_0x9099('0x24')]({'plain':!![]});var _0x6f09f3=_0x9099('0x25');return db[_0x9099('0x48')][_0x9099('0x43')]({'where':{'name':_0x6f09f3,'userProfileId':_0x396f39[_0x9099('0x49')]},'raw':!![]})['then'](function(_0x3d2096){if(_0x3d2096&&_0x3d2096[_0x9099('0x4a')]===0x0){return db[_0x9099('0x26')][_0x9099('0x44')]({'name':_0x53bb97[_0x9099('0x2a')],'resourceId':_0x53bb97['id'],'type':_0x3d2096[_0x9099('0x2a')],'sectionId':_0x3d2096['id']},{})[_0x9099('0x22')](function(){return _0x429773;});}else{return _0x429773;}})[_0x9099('0x4b')](function(_0x2cb696){logger[_0x9099('0x28')](_0x9099('0x4c'),_0x2cb696);throw _0x2cb696;});}return _0x429773;});}})['then'](respondWithResult(_0x263412,0xc9))[_0x9099('0x4b')](handleError(_0x263412,null));};exports[_0x9099('0x51')]=function(_0x2a4b95,_0x4e852c){if(_0x2a4b95['body']['id']){delete _0x2a4b95[_0x9099('0x4f')]['id'];}return db[_0x9099('0x3e')]['find']({'where':{'id':_0x2a4b95[_0x9099('0x41')]['id']}})['then'](handleEntityNotFound(_0x4e852c,null))[_0x9099('0x22')](saveUpdates(_0x2a4b95['body'],null))[_0x9099('0x22')](respondWithResult(_0x4e852c,null))[_0x9099('0x4b')](handleError(_0x4e852c,null));};exports[_0x9099('0x23')]=function(_0x285b1a,_0x3b2668){return db['JscriptyProject'][_0x9099('0x43')]({'where':{'id':_0x285b1a[_0x9099('0x41')]['id']}})[_0x9099('0x22')](handleEntityNotFound(_0x3b2668,null))[_0x9099('0x22')](removeEntity(_0x3b2668,null))['catch'](handleError(_0x3b2668,null));};exports[_0x9099('0x52')]=function(_0x4c2503,_0x3c7a1e,_0x563c9a){var _0x352d77={'raw':!![],'where':{}};var _0x48b0fa={};var _0x5bf674={'count':0x0,'rows':[]};return db[_0x9099('0x3e')][_0x9099('0x53')]({'where':{'id':_0x4c2503[_0x9099('0x41')]['id']}})[_0x9099('0x22')](handleEntityNotFound(_0x3c7a1e,null))['then'](function(_0x5fbbee){if(_0x5fbbee){_0x48b0fa[_0x9099('0x32')]=_[_0x9099('0x30')](db[_0x9099('0x54')][_0x9099('0x2d')]);_0x48b0fa[_0x9099('0x2f')]=_[_0x9099('0x30')](_0x4c2503[_0x9099('0x2f')]);_0x48b0fa[_0x9099('0x39')]=_[_0x9099('0x31')](_0x48b0fa[_0x9099('0x32')],_0x48b0fa[_0x9099('0x2f')]);_0x352d77['attributes']=_[_0x9099('0x31')](_0x48b0fa[_0x9099('0x32')],qs[_0x9099('0x34')](_0x4c2503[_0x9099('0x2f')]['fields']));_0x352d77[_0x9099('0x33')]=_0x352d77[_0x9099('0x33')][_0x9099('0x42')]?_0x352d77[_0x9099('0x33')]:_0x48b0fa['model'];if(!_0x4c2503[_0x9099('0x2f')][_0x9099('0x35')]('nolimit')){_0x352d77[_0x9099('0x1b')]=qs[_0x9099('0x1b')](_0x4c2503['query'][_0x9099('0x1b')]);_0x352d77[_0x9099('0x19')]=qs[_0x9099('0x19')](_0x4c2503[_0x9099('0x2f')][_0x9099('0x19')]);}_0x352d77[_0x9099('0x36')]=qs[_0x9099('0x37')](_0x4c2503[_0x9099('0x2f')][_0x9099('0x37')]);_0x352d77['where']=qs['filters'](_[_0x9099('0x55')](_0x4c2503[_0x9099('0x2f')],_0x48b0fa['filters']));_0x352d77[_0x9099('0x38')][_0x9099('0x56')]=_0x5fbbee['id'];if(_0x4c2503['query']['filter']){_0x352d77[_0x9099('0x38')]=_[_0x9099('0x3a')](_0x352d77[_0x9099('0x38')],{'$or':_[_0x9099('0x2c')](_0x352d77['attributes'],function(_0x9b5f85){var _0x2e6e27={};_0x2e6e27[_0x9b5f85]={'$like':'%'+_0x4c2503[_0x9099('0x2f')][_0x9099('0x3c')]+'%'};return _0x2e6e27;})});}_0x352d77=_[_0x9099('0x3a')]({},_0x352d77,_0x4c2503[_0x9099('0x3d')]);return db[_0x9099('0x54')][_0x9099('0x1c')]({'where':_0x352d77[_0x9099('0x38')]})['then'](function(_0x1e31ab){_0x5bf674[_0x9099('0x1c')]=_0x1e31ab;if(_0x4c2503[_0x9099('0x2f')][_0x9099('0x3f')]){_0x352d77['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x9099('0x57')](_0x352d77);})[_0x9099('0x22')](function(_0x429106){_0x5bf674[_0x9099('0x58')]=_0x429106;return _0x5bf674;});}})[_0x9099('0x22')](respondWithFilteredResult(_0x3c7a1e,_0x352d77))[_0x9099('0x4b')](handleError(_0x3c7a1e,null));};exports['getAnswers']=function(_0x24b984,_0x549a49,_0x2c7d78){var _0xc0002c={'raw':!![],'where':{}};var _0x51d217={};var _0x3c3c94={'count':0x0,'rows':[]};return db[_0x9099('0x3e')][_0x9099('0x53')]({'where':{'id':_0x24b984['params']['id']}})[_0x9099('0x22')](handleEntityNotFound(_0x549a49,null))['then'](function(_0x2a38ac){if(_0x2a38ac){_0x51d217[_0x9099('0x32')]=_[_0x9099('0x30')](db[_0x9099('0x59')]['rawAttributes']);_0x51d217[_0x9099('0x2f')]=_['keys'](_0x24b984[_0x9099('0x2f')]);_0x51d217[_0x9099('0x39')]=_['intersection'](_0x51d217[_0x9099('0x32')],_0x51d217['query']);_0xc0002c['attributes']=_[_0x9099('0x31')](_0x51d217[_0x9099('0x32')],qs['fields'](_0x24b984['query'][_0x9099('0x34')]));_0xc0002c[_0x9099('0x33')]=_0xc0002c[_0x9099('0x33')][_0x9099('0x42')]?_0xc0002c[_0x9099('0x33')]:_0x51d217[_0x9099('0x32')];if(!_0x24b984[_0x9099('0x2f')][_0x9099('0x35')](_0x9099('0x5a'))){_0xc0002c[_0x9099('0x1b')]=qs[_0x9099('0x1b')](_0x24b984[_0x9099('0x2f')]['limit']);_0xc0002c[_0x9099('0x19')]=qs[_0x9099('0x19')](_0x24b984[_0x9099('0x2f')][_0x9099('0x19')]);}_0xc0002c[_0x9099('0x36')]=qs['sort'](_0x24b984[_0x9099('0x2f')][_0x9099('0x37')]);_0xc0002c[_0x9099('0x38')]=qs[_0x9099('0x39')](_[_0x9099('0x55')](_0x24b984[_0x9099('0x2f')],_0x51d217[_0x9099('0x39')]));_0xc0002c[_0x9099('0x38')][_0x9099('0x56')]=_0x2a38ac['id'];if(_0x24b984[_0x9099('0x2f')][_0x9099('0x3c')]){_0xc0002c[_0x9099('0x38')]=_[_0x9099('0x3a')](_0xc0002c[_0x9099('0x38')],{'$or':_[_0x9099('0x2c')](_0xc0002c[_0x9099('0x33')],function(_0x5c230a){var _0x256896={};_0x256896[_0x5c230a]={'$like':'%'+_0x24b984[_0x9099('0x2f')][_0x9099('0x3c')]+'%'};return _0x256896;})});}_0xc0002c=_['merge']({},_0xc0002c,_0x24b984['options']);return db[_0x9099('0x59')][_0x9099('0x1c')]({'where':_0xc0002c[_0x9099('0x38')]})[_0x9099('0x22')](function(_0x165ee5){_0x3c3c94[_0x9099('0x1c')]=_0x165ee5;if(_0x24b984['query'][_0x9099('0x3f')]){_0xc0002c[_0x9099('0x40')]=[{'all':!![]}];}return db[_0x9099('0x59')][_0x9099('0x57')](_0xc0002c);})['then'](function(_0x154406){_0x3c3c94['rows']=_0x154406;return _0x3c3c94;});}})[_0x9099('0x22')](respondWithFilteredResult(_0x549a49,_0xc0002c))[_0x9099('0x4b')](handleError(_0x549a49,null));};function char(_0x144c52){return _0x9099('0x5b')===typeof _0x144c52?String[_0x9099('0x5c')][_0x9099('0x1f')](null,arguments):_0x144c52;}function needsEncapsulation(_0x2f1285){return!!_0x2f1285&&(_0x2f1285['toString']()[_0x9099('0x5d')](char(0xd))>=0x0||_0x2f1285[_0x9099('0x5e')]()[_0x9099('0x5d')](char(0xa))>=0x0||_0x2f1285[_0x9099('0x5e')]()[_0x9099('0x5d')](char(0x2c))>=0x0||_0x2f1285[_0x9099('0x5e')]()[_0x9099('0x5d')](char(0x22))>=0x0);}function encapsulate(_0x508114){var _0x59421e=char(0x22),_0x25f3ab='\x5c'+char(0x22),_0x4cd168=_0x508114[_0x9099('0x5e')]()[_0x9099('0x5f')](new RegExp(_0x59421e,'g'),_0x25f3ab);return _0x59421e+_0x4cd168+_0x59421e;}exports[_0x9099('0x60')]=function(_0x2d5ef7,_0x55b162,_0x484a1e){var _0x87e61,_0xc15e1f;var _0x4cd330={'where':{'ProjectId':_0x2d5ef7[_0x9099('0x41')]['id']}};if(_0x2d5ef7[_0x9099('0x2f')]['startTime']){_0x4cd330[_0x9099('0x38')][_0x9099('0x61')]=JSON['parse'](_0x2d5ef7[_0x9099('0x2f')][_0x9099('0x62')]);}return db['JscriptySessionReport'][_0x9099('0x57')](_0x4cd330)[_0x9099('0x22')](handleEntityNotFound(_0x55b162,null))[_0x9099('0x22')](function(_0x56cadb){if(_0x56cadb){_0x87e61=_0x56cadb;return db[_0x9099('0x63')][_0x9099('0x57')]({'where':{'SessionId':{'$in':_['map'](_0x87e61,'id')},'ProjectId':_0x2d5ef7[_0x9099('0x41')]['id']},'order':_0x9099('0x64')});}})[_0x9099('0x22')](handleEntityNotFound(_0x55b162,null))['then'](function(_0x425a6c){if(_0x425a6c){_0xc15e1f=_0x425a6c;var _0x3de194={};for(var _0x59381a=0x0,_0x39625e=_0xc15e1f[_0x9099('0x42')];_0x59381a<_0x39625e;_0x59381a++){if(!_0x3de194[_0x9099('0x35')](_0xc15e1f[_0x59381a][_0x9099('0x65')])){_0x3de194[_0xc15e1f[_0x59381a][_0x9099('0x65')]]=needsEncapsulation(_0xc15e1f[_0x59381a][_0x9099('0x66')])?encapsulate(_0xc15e1f[_0x59381a][_0x9099('0x66')]):_0xc15e1f[_0x59381a]['question'];}}var _0x3fe8a8=[],_0x42f375={};for(var _0x40647f=0x0,_0xac6290=_0x87e61[_0x9099('0x42')];_0x40647f<_0xac6290;_0x40647f++){_0x42f375={'ProjectId':_0x2d5ef7['params']['id'],'SessionId':_0x87e61[_0x40647f]['id'],'StartTime':moment(_0x87e61[_0x40647f]['starttime'])[_0x9099('0x67')](_0x9099('0x68'))};for(var _0x49e55b=0x0,_0x29fe46=_0xc15e1f['length'];_0x49e55b<_0x29fe46;_0x49e55b++){if(_0xc15e1f[_0x49e55b][_0x9099('0x69')]==_0x87e61[_0x40647f]['id']&&_0x3de194['hasOwnProperty'](_0xc15e1f[_0x49e55b][_0x9099('0x65')])){_0x42f375[_0x3de194[_0xc15e1f[_0x49e55b]['questionId']]]=_0xc15e1f[_0x49e55b]['answer'];}}for(var _0xb01fd7 in _0x3de194){if(!_0x42f375['hasOwnProperty'](_0x3de194[_0xb01fd7])){_0x42f375[_0x3de194[_0xb01fd7]]=null;}}_0x3fe8a8[_0x9099('0x6a')](_0x42f375);}return _0x3fe8a8;}})['then'](function(_0x136f46){if(!_[_0x9099('0x6b')](_0x136f46)){var _0x285ef2=toCsv(_0x136f46);var _0x2715e1=Date['now']();fs[_0x9099('0x6c')](util[_0x9099('0x67')](_0x9099('0x6d'),_0x2d5ef7[_0x9099('0x41')]['id'],_0x2715e1),_0x285ef2);_0x55b162[_0x9099('0x6e')](_0x9099('0x6f'),'attachment;\x20filename='+util[_0x9099('0x67')](_0x9099('0x70'),_0x2d5ef7[_0x9099('0x41')]['id'],_0x2715e1));_0x55b162['setHeader']('Content-type',_0x9099('0x71'));return _0x55b162['download'](util[_0x9099('0x67')](_0x9099('0x6d'),_0x2d5ef7[_0x9099('0x41')]['id'],_0x2715e1));}else{return _0x55b162[_0x9099('0x17')](0xcc);}})[_0x9099('0x4b')](handleError(_0x55b162,null));};
\ No newline at end of file
+var _0x3a0f=['zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','get','Projects','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','where','merge','VIRTUAL','filter','options','JscriptyProject','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileResource','findOne','JscriptySessionReport','nolimit','order','ProjectId','getAnswers','JscriptyAnswerReport','number','toString','indexOf','replace','starttime','startTime','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','push','now','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','eml-format','rimraf'];(function(_0x41390d,_0x364abe){var _0x11134f=function(_0xf3b836){while(--_0xf3b836){_0x41390d['push'](_0x41390d['shift']());}};_0x11134f(++_0x364abe);}(_0x3a0f,0x75));var _0xf3a0=function(_0x2707f5,_0x154bd2){_0x2707f5=_0x2707f5-0x0;var _0x57969e=_0x3a0f[_0x2707f5];return _0x57969e;};'use strict';var emlformat=require(_0xf3a0('0x0'));var rimraf=require(_0xf3a0('0x1'));var zipdir=require(_0xf3a0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf3a0('0x3'));var moment=require(_0xf3a0('0x4'));var BPromise=require(_0xf3a0('0x5'));var Mustache=require(_0xf3a0('0x6'));var util=require(_0xf3a0('0x7'));var path=require(_0xf3a0('0x8'));var sox=require(_0xf3a0('0x9'));var csv=require(_0xf3a0('0xa'));var ejs=require(_0xf3a0('0xb'));var fs=require('fs');var fs_extra=require(_0xf3a0('0xc'));var _=require(_0xf3a0('0xd'));var squel=require(_0xf3a0('0xe'));var crypto=require(_0xf3a0('0xf'));var jsforce=require(_0xf3a0('0x10'));var deskjs=require(_0xf3a0('0x11'));var toCsv=require(_0xf3a0('0xa'));var querystring=require(_0xf3a0('0x12'));var Papa=require(_0xf3a0('0x13'));var Redis=require('ioredis');var authService=require(_0xf3a0('0x14'));var qs=require(_0xf3a0('0x15'));var as=require(_0xf3a0('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf3a0('0x17'))('api');var utils=require(_0xf3a0('0x18'));var config=require(_0xf3a0('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xf3a0('0x1a'))['db'];function respondWithStatusCode(_0x4fa31b,_0x3a9749){_0x3a9749=_0x3a9749||0xcc;return function(_0xe36fea){if(_0xe36fea){return _0x4fa31b[_0xf3a0('0x1b')](_0x3a9749);}return _0x4fa31b[_0xf3a0('0x1c')](_0x3a9749)['end']();};}function respondWithResult(_0x485974,_0x30fa46){_0x30fa46=_0x30fa46||0xc8;return function(_0x197435){if(_0x197435){return _0x485974['status'](_0x30fa46)[_0xf3a0('0x1d')](_0x197435);}};}function respondWithFilteredResult(_0x449834,_0x225f41){return function(_0x18e8a9){if(_0x18e8a9){var _0x2d3bbc=typeof _0x225f41[_0xf3a0('0x1e')]===_0xf3a0('0x1f')&&typeof _0x225f41['limit']===_0xf3a0('0x1f');var _0x4fb12f=_0x18e8a9[_0xf3a0('0x20')];var _0x3a7ff1=_0x2d3bbc?0x0:_0x225f41[_0xf3a0('0x1e')];var _0x31c702=_0x2d3bbc?_0x18e8a9[_0xf3a0('0x20')]:_0x225f41[_0xf3a0('0x1e')]+_0x225f41[_0xf3a0('0x21')];var _0x3cd931;if(_0x31c702>=_0x4fb12f){_0x31c702=_0x4fb12f;_0x3cd931=0xc8;}else{_0x3cd931=0xce;}_0x449834[_0xf3a0('0x1c')](_0x3cd931);return _0x449834['set'](_0xf3a0('0x22'),_0x3a7ff1+'-'+_0x31c702+'/'+_0x4fb12f)[_0xf3a0('0x1d')](_0x18e8a9);}return null;};}function patchUpdates(_0x184618){return function(_0x2abfe0){try{jsonpatch[_0xf3a0('0x23')](_0x2abfe0,_0x184618,!![]);}catch(_0x4b0b74){return BPromise[_0xf3a0('0x24')](_0x4b0b74);}return _0x2abfe0[_0xf3a0('0x25')]();};}function saveUpdates(_0x4cb172,_0x21aa68){return function(_0x55fc7e){if(_0x55fc7e){return _0x55fc7e[_0xf3a0('0x26')](_0x4cb172)[_0xf3a0('0x27')](function(_0x9c13bd){return _0x9c13bd;});}return null;};}function removeEntity(_0x3a3138,_0x383ff2){return function(_0x476c05){if(_0x476c05){return _0x476c05[_0xf3a0('0x28')]()[_0xf3a0('0x27')](function(){var _0x18f030=_0x476c05[_0xf3a0('0x29')]({'plain':!![]});var _0x3615e7=_0xf3a0('0x2a');return db['UserProfileResource'][_0xf3a0('0x28')]({'where':{'type':_0x3615e7,'resourceId':_0x18f030['id']}})[_0xf3a0('0x27')](function(){return _0x476c05;});})[_0xf3a0('0x27')](function(){_0x3a3138[_0xf3a0('0x1c')](0xcc)[_0xf3a0('0x2b')]();});}};}function handleEntityNotFound(_0x30f704,_0xb22650){return function(_0x596712){if(!_0x596712){_0x30f704['sendStatus'](0x194);}return _0x596712;};}function handleError(_0x195d3c,_0x403ac8){_0x403ac8=_0x403ac8||0x1f4;return function(_0x43599b){logger[_0xf3a0('0x2c')](_0x43599b[_0xf3a0('0x2d')]);if(_0x43599b['name']){delete _0x43599b[_0xf3a0('0x2e')];}_0x195d3c[_0xf3a0('0x1c')](_0x403ac8)[_0xf3a0('0x2f')](_0x43599b);};}exports[_0xf3a0('0x30')]=function(_0x4fbfeb,_0x1e2a50){var _0x321d65={},_0x3cbeaf={},_0x24c5b9={'count':0x0,'rows':[]};var _0x448433=_[_0xf3a0('0x31')](db['JscriptyProject'][_0xf3a0('0x32')],function(_0x303494){return{'name':_0x303494[_0xf3a0('0x33')],'type':_0x303494[_0xf3a0('0x34')]['key']};});_0x3cbeaf[_0xf3a0('0x35')]=_[_0xf3a0('0x31')](_0x448433,_0xf3a0('0x2e'));_0x3cbeaf[_0xf3a0('0x36')]=_[_0xf3a0('0x37')](_0x4fbfeb['query']);_0x3cbeaf[_0xf3a0('0x38')]=_[_0xf3a0('0x39')](_0x3cbeaf[_0xf3a0('0x35')],_0x3cbeaf[_0xf3a0('0x36')]);_0x321d65[_0xf3a0('0x3a')]=_[_0xf3a0('0x39')](_0x3cbeaf[_0xf3a0('0x35')],qs[_0xf3a0('0x3b')](_0x4fbfeb[_0xf3a0('0x36')]['fields']));_0x321d65[_0xf3a0('0x3a')]=_0x321d65[_0xf3a0('0x3a')][_0xf3a0('0x3c')]?_0x321d65[_0xf3a0('0x3a')]:_0x3cbeaf[_0xf3a0('0x35')];if(!_0x4fbfeb[_0xf3a0('0x36')][_0xf3a0('0x3d')]('nolimit')){_0x321d65[_0xf3a0('0x21')]=qs['limit'](_0x4fbfeb['query']['limit']);_0x321d65[_0xf3a0('0x1e')]=qs[_0xf3a0('0x1e')](_0x4fbfeb[_0xf3a0('0x36')][_0xf3a0('0x1e')]);}_0x321d65['order']=qs[_0xf3a0('0x3e')](_0x4fbfeb[_0xf3a0('0x36')][_0xf3a0('0x3e')]);_0x321d65['where']=qs[_0xf3a0('0x38')](_[_0xf3a0('0x3f')](_0x4fbfeb[_0xf3a0('0x36')],_0x3cbeaf['filters']),_0x448433);if(_0x4fbfeb[_0xf3a0('0x36')]['filter']){_0x321d65[_0xf3a0('0x40')]=_[_0xf3a0('0x41')](_0x321d65[_0xf3a0('0x40')],{'$or':_[_0xf3a0('0x31')](_0x448433,function(_0xb125cf){if(_0xb125cf['type']!==_0xf3a0('0x42')){var _0x2ea097={};_0x2ea097[_0xb125cf[_0xf3a0('0x2e')]]={'$like':'%'+_0x4fbfeb[_0xf3a0('0x36')][_0xf3a0('0x43')]+'%'};return _0x2ea097;}})});}_0x321d65=_[_0xf3a0('0x41')]({},_0x321d65,_0x4fbfeb[_0xf3a0('0x44')]);var _0xaf03a1={'where':_0x321d65[_0xf3a0('0x40')]};return db[_0xf3a0('0x45')][_0xf3a0('0x20')](_0xaf03a1)[_0xf3a0('0x27')](function(_0x22f080){_0x24c5b9[_0xf3a0('0x20')]=_0x22f080;if(_0x4fbfeb[_0xf3a0('0x36')][_0xf3a0('0x46')]){_0x321d65[_0xf3a0('0x47')]=[{'all':!![]}];}return db[_0xf3a0('0x45')][_0xf3a0('0x48')](_0x321d65);})[_0xf3a0('0x27')](function(_0x389a2a){_0x24c5b9[_0xf3a0('0x49')]=_0x389a2a;return _0x24c5b9;})[_0xf3a0('0x27')](respondWithFilteredResult(_0x1e2a50,_0x321d65))[_0xf3a0('0x4a')](handleError(_0x1e2a50,null));};exports[_0xf3a0('0x4b')]=function(_0x56bc57,_0x138be2){var _0x2a3247={'raw':![],'where':{'id':_0x56bc57[_0xf3a0('0x4c')]['id']}},_0x15f65d={};_0x15f65d['model']=_[_0xf3a0('0x37')](db['JscriptyProject'][_0xf3a0('0x32')]);_0x15f65d['query']=_['keys'](_0x56bc57[_0xf3a0('0x36')]);_0x15f65d[_0xf3a0('0x38')]=_[_0xf3a0('0x39')](_0x15f65d[_0xf3a0('0x35')],_0x15f65d[_0xf3a0('0x36')]);_0x2a3247[_0xf3a0('0x3a')]=_[_0xf3a0('0x39')](_0x15f65d[_0xf3a0('0x35')],qs[_0xf3a0('0x3b')](_0x56bc57[_0xf3a0('0x36')][_0xf3a0('0x3b')]));_0x2a3247[_0xf3a0('0x3a')]=_0x2a3247[_0xf3a0('0x3a')][_0xf3a0('0x3c')]?_0x2a3247['attributes']:_0x15f65d[_0xf3a0('0x35')];if(_0x56bc57['query'][_0xf3a0('0x46')]){_0x2a3247[_0xf3a0('0x47')]=[{'all':!![]}];}_0x2a3247=_[_0xf3a0('0x41')]({},_0x2a3247,_0x56bc57[_0xf3a0('0x44')]);return db[_0xf3a0('0x45')][_0xf3a0('0x4d')](_0x2a3247)[_0xf3a0('0x27')](handleEntityNotFound(_0x138be2,null))['then'](respondWithResult(_0x138be2,null))[_0xf3a0('0x4a')](handleError(_0x138be2,null));};exports[_0xf3a0('0x4e')]=function(_0x4f4a7b,_0x189861){return db[_0xf3a0('0x45')][_0xf3a0('0x4e')](_0x4f4a7b[_0xf3a0('0x4f')],{})[_0xf3a0('0x27')](function(_0x223dcf){var _0x3746c1=_0x4f4a7b[_0xf3a0('0x50')][_0xf3a0('0x29')]({'plain':!![]});if(!_0x3746c1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3746c1[_0xf3a0('0x51')]===_0xf3a0('0x50')){var _0x4e2eaf=_0x223dcf[_0xf3a0('0x29')]({'plain':!![]});var _0x1c7550=_0xf3a0('0x2a');return db[_0xf3a0('0x52')][_0xf3a0('0x4d')]({'where':{'name':_0x1c7550,'userProfileId':_0x3746c1[_0xf3a0('0x53')]},'raw':!![]})[_0xf3a0('0x27')](function(_0x3dac31){if(_0x3dac31&&_0x3dac31[_0xf3a0('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x4e2eaf['name'],'resourceId':_0x4e2eaf['id'],'type':_0x3dac31[_0xf3a0('0x2e')],'sectionId':_0x3dac31['id']},{})['then'](function(){return _0x223dcf;});}else{return _0x223dcf;}})[_0xf3a0('0x4a')](function(_0x9a3bcc){logger[_0xf3a0('0x2c')](_0xf3a0('0x55'),_0x9a3bcc);throw _0x9a3bcc;});}return _0x223dcf;})[_0xf3a0('0x27')](respondWithResult(_0x189861,0xc9))[_0xf3a0('0x4a')](handleError(_0x189861,null));};exports[_0xf3a0('0x56')]=function(_0x59626f,_0x58f42d){var _0x1ad008={'where':{'id':_0x59626f[_0xf3a0('0x4c')]['id']}},_0xa1a37b={};_0xa1a37b[_0xf3a0('0x35')]=_[_0xf3a0('0x37')](db[_0xf3a0('0x45')]['rawAttributes']);_0x1ad008['attributes']=_['intersection'](_0xa1a37b[_0xf3a0('0x35')],qs[_0xf3a0('0x3b')](_0x59626f['query'][_0xf3a0('0x3b')]));_0x1ad008[_0xf3a0('0x3a')]=_0x1ad008[_0xf3a0('0x3a')][_0xf3a0('0x3c')]?_0x1ad008[_0xf3a0('0x3a')]:_0xa1a37b[_0xf3a0('0x35')];if(_0x59626f['query']['includeAll']){_0x1ad008[_0xf3a0('0x47')]=[{'all':!![]}];}_0x1ad008=_[_0xf3a0('0x41')]({},_0x1ad008,_0x59626f[_0xf3a0('0x44')]);return db[_0xf3a0('0x45')][_0xf3a0('0x4d')](_0x1ad008)[_0xf3a0('0x27')](handleEntityNotFound(_0x58f42d,null))[_0xf3a0('0x27')](function(_0x6e87cf){if(_0x6e87cf){var _0x380cd0=_0x6e87cf[_0xf3a0('0x29')]({'plain':!![]});_0x380cd0=qs[_0xf3a0('0x57')](_0x380cd0,['id',_0xf3a0('0x58'),_0xf3a0('0x59')]);_0x59626f[_0xf3a0('0x4f')]=_[_0xf3a0('0x57')](_0x59626f[_0xf3a0('0x4f')],['id','createdAt',_0xf3a0('0x59')]);return db[_0xf3a0('0x45')][_0xf3a0('0x4e')](_[_0xf3a0('0x41')](_0x380cd0,_0x59626f[_0xf3a0('0x4f')]),{'include':_0x59626f[_0xf3a0('0x36')][_0xf3a0('0x46')]?[{'all':!![]}]:undefined})[_0xf3a0('0x27')](function(_0x2b5bbd){var _0x12b146=_0x59626f[_0xf3a0('0x50')]['get']({'plain':!![]});if(!_0x12b146)throw new Error(_0xf3a0('0x5a'));if(_0x12b146['role']==='user'){var _0x1911ec=_0x2b5bbd[_0xf3a0('0x29')]({'plain':!![]});var _0x19223d='Projects';return db[_0xf3a0('0x52')][_0xf3a0('0x4d')]({'where':{'name':_0x19223d,'userProfileId':_0x12b146[_0xf3a0('0x53')]},'raw':!![]})[_0xf3a0('0x27')](function(_0x3396b6){if(_0x3396b6&&_0x3396b6['autoAssociation']===0x0){return db[_0xf3a0('0x5b')]['create']({'name':_0x1911ec['name'],'resourceId':_0x1911ec['id'],'type':_0x3396b6[_0xf3a0('0x2e')],'sectionId':_0x3396b6['id']},{})[_0xf3a0('0x27')](function(){return _0x2b5bbd;});}else{return _0x2b5bbd;}})[_0xf3a0('0x4a')](function(_0x152695){logger[_0xf3a0('0x2c')](_0xf3a0('0x55'),_0x152695);throw _0x152695;});}return _0x2b5bbd;});}})[_0xf3a0('0x27')](respondWithResult(_0x58f42d,0xc9))[_0xf3a0('0x4a')](handleError(_0x58f42d,null));};exports[_0xf3a0('0x26')]=function(_0x3c6bfa,_0xed6325){if(_0x3c6bfa[_0xf3a0('0x4f')]['id']){delete _0x3c6bfa[_0xf3a0('0x4f')]['id'];}return db[_0xf3a0('0x45')][_0xf3a0('0x4d')]({'where':{'id':_0x3c6bfa[_0xf3a0('0x4c')]['id']}})[_0xf3a0('0x27')](handleEntityNotFound(_0xed6325,null))[_0xf3a0('0x27')](saveUpdates(_0x3c6bfa[_0xf3a0('0x4f')],null))[_0xf3a0('0x27')](respondWithResult(_0xed6325,null))['catch'](handleError(_0xed6325,null));};exports['destroy']=function(_0x7845c7,_0x17cd20){return db[_0xf3a0('0x45')][_0xf3a0('0x4d')]({'where':{'id':_0x7845c7['params']['id']}})[_0xf3a0('0x27')](handleEntityNotFound(_0x17cd20,null))['then'](removeEntity(_0x17cd20,null))[_0xf3a0('0x4a')](handleError(_0x17cd20,null));};exports['getSessions']=function(_0xb65e85,_0x5673c8,_0x41d54c){var _0x381b4f={'raw':!![],'where':{}};var _0x1f869c={};var _0x172aaf={'count':0x0,'rows':[]};return db[_0xf3a0('0x45')][_0xf3a0('0x5c')]({'where':{'id':_0xb65e85[_0xf3a0('0x4c')]['id']}})[_0xf3a0('0x27')](handleEntityNotFound(_0x5673c8,null))[_0xf3a0('0x27')](function(_0xc12891){if(_0xc12891){_0x1f869c[_0xf3a0('0x35')]=_['keys'](db[_0xf3a0('0x5d')][_0xf3a0('0x32')]);_0x1f869c[_0xf3a0('0x36')]=_[_0xf3a0('0x37')](_0xb65e85[_0xf3a0('0x36')]);_0x1f869c[_0xf3a0('0x38')]=_['intersection'](_0x1f869c[_0xf3a0('0x35')],_0x1f869c['query']);_0x381b4f[_0xf3a0('0x3a')]=_[_0xf3a0('0x39')](_0x1f869c[_0xf3a0('0x35')],qs[_0xf3a0('0x3b')](_0xb65e85['query']['fields']));_0x381b4f[_0xf3a0('0x3a')]=_0x381b4f['attributes'][_0xf3a0('0x3c')]?_0x381b4f[_0xf3a0('0x3a')]:_0x1f869c[_0xf3a0('0x35')];if(!_0xb65e85[_0xf3a0('0x36')][_0xf3a0('0x3d')](_0xf3a0('0x5e'))){_0x381b4f[_0xf3a0('0x21')]=qs[_0xf3a0('0x21')](_0xb65e85['query'][_0xf3a0('0x21')]);_0x381b4f[_0xf3a0('0x1e')]=qs[_0xf3a0('0x1e')](_0xb65e85[_0xf3a0('0x36')][_0xf3a0('0x1e')]);}_0x381b4f[_0xf3a0('0x5f')]=qs['sort'](_0xb65e85[_0xf3a0('0x36')][_0xf3a0('0x3e')]);_0x381b4f[_0xf3a0('0x40')]=qs[_0xf3a0('0x38')](_[_0xf3a0('0x3f')](_0xb65e85[_0xf3a0('0x36')],_0x1f869c[_0xf3a0('0x38')]));_0x381b4f[_0xf3a0('0x40')][_0xf3a0('0x60')]=_0xc12891['id'];if(_0xb65e85[_0xf3a0('0x36')][_0xf3a0('0x43')]){_0x381b4f[_0xf3a0('0x40')]=_[_0xf3a0('0x41')](_0x381b4f[_0xf3a0('0x40')],{'$or':_[_0xf3a0('0x31')](_0x381b4f[_0xf3a0('0x3a')],function(_0x12cfea){var _0x27c657={};_0x27c657[_0x12cfea]={'$like':'%'+_0xb65e85[_0xf3a0('0x36')][_0xf3a0('0x43')]+'%'};return _0x27c657;})});}_0x381b4f=_[_0xf3a0('0x41')]({},_0x381b4f,_0xb65e85['options']);return db[_0xf3a0('0x5d')][_0xf3a0('0x20')]({'where':_0x381b4f[_0xf3a0('0x40')]})[_0xf3a0('0x27')](function(_0x59f7aa){_0x172aaf[_0xf3a0('0x20')]=_0x59f7aa;if(_0xb65e85[_0xf3a0('0x36')][_0xf3a0('0x46')]){_0x381b4f['include']=[{'all':!![]}];}return db[_0xf3a0('0x5d')][_0xf3a0('0x48')](_0x381b4f);})[_0xf3a0('0x27')](function(_0x4cd31e){_0x172aaf[_0xf3a0('0x49')]=_0x4cd31e;return _0x172aaf;});}})[_0xf3a0('0x27')](respondWithFilteredResult(_0x5673c8,_0x381b4f))[_0xf3a0('0x4a')](handleError(_0x5673c8,null));};exports[_0xf3a0('0x61')]=function(_0x1bb8c5,_0x4eb9f5,_0x332065){var _0xafc224={'raw':!![],'where':{}};var _0x56b0ad={};var _0x14af35={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xf3a0('0x5c')]({'where':{'id':_0x1bb8c5[_0xf3a0('0x4c')]['id']}})[_0xf3a0('0x27')](handleEntityNotFound(_0x4eb9f5,null))[_0xf3a0('0x27')](function(_0x3a81d1){if(_0x3a81d1){_0x56b0ad[_0xf3a0('0x35')]=_[_0xf3a0('0x37')](db['JscriptyAnswerReport'][_0xf3a0('0x32')]);_0x56b0ad[_0xf3a0('0x36')]=_[_0xf3a0('0x37')](_0x1bb8c5[_0xf3a0('0x36')]);_0x56b0ad[_0xf3a0('0x38')]=_['intersection'](_0x56b0ad['model'],_0x56b0ad['query']);_0xafc224[_0xf3a0('0x3a')]=_[_0xf3a0('0x39')](_0x56b0ad[_0xf3a0('0x35')],qs[_0xf3a0('0x3b')](_0x1bb8c5[_0xf3a0('0x36')][_0xf3a0('0x3b')]));_0xafc224[_0xf3a0('0x3a')]=_0xafc224[_0xf3a0('0x3a')]['length']?_0xafc224[_0xf3a0('0x3a')]:_0x56b0ad[_0xf3a0('0x35')];if(!_0x1bb8c5['query'][_0xf3a0('0x3d')]('nolimit')){_0xafc224[_0xf3a0('0x21')]=qs[_0xf3a0('0x21')](_0x1bb8c5[_0xf3a0('0x36')]['limit']);_0xafc224[_0xf3a0('0x1e')]=qs[_0xf3a0('0x1e')](_0x1bb8c5[_0xf3a0('0x36')][_0xf3a0('0x1e')]);}_0xafc224[_0xf3a0('0x5f')]=qs['sort'](_0x1bb8c5[_0xf3a0('0x36')][_0xf3a0('0x3e')]);_0xafc224[_0xf3a0('0x40')]=qs['filters'](_[_0xf3a0('0x3f')](_0x1bb8c5[_0xf3a0('0x36')],_0x56b0ad[_0xf3a0('0x38')]));_0xafc224[_0xf3a0('0x40')][_0xf3a0('0x60')]=_0x3a81d1['id'];if(_0x1bb8c5[_0xf3a0('0x36')][_0xf3a0('0x43')]){_0xafc224[_0xf3a0('0x40')]=_[_0xf3a0('0x41')](_0xafc224[_0xf3a0('0x40')],{'$or':_[_0xf3a0('0x31')](_0xafc224['attributes'],function(_0x3b6abb){var _0x340560={};_0x340560[_0x3b6abb]={'$like':'%'+_0x1bb8c5[_0xf3a0('0x36')][_0xf3a0('0x43')]+'%'};return _0x340560;})});}_0xafc224=_[_0xf3a0('0x41')]({},_0xafc224,_0x1bb8c5[_0xf3a0('0x44')]);return db['JscriptyAnswerReport'][_0xf3a0('0x20')]({'where':_0xafc224[_0xf3a0('0x40')]})['then'](function(_0x5768de){_0x14af35['count']=_0x5768de;if(_0x1bb8c5[_0xf3a0('0x36')][_0xf3a0('0x46')]){_0xafc224['include']=[{'all':!![]}];}return db[_0xf3a0('0x62')][_0xf3a0('0x48')](_0xafc224);})[_0xf3a0('0x27')](function(_0x510357){_0x14af35[_0xf3a0('0x49')]=_0x510357;return _0x14af35;});}})[_0xf3a0('0x27')](respondWithFilteredResult(_0x4eb9f5,_0xafc224))[_0xf3a0('0x4a')](handleError(_0x4eb9f5,null));};function char(_0x17665a){return _0xf3a0('0x63')===typeof _0x17665a?String['fromCharCode'][_0xf3a0('0x23')](null,arguments):_0x17665a;}function needsEncapsulation(_0xae4df9){return!!_0xae4df9&&(_0xae4df9[_0xf3a0('0x64')]()[_0xf3a0('0x65')](char(0xd))>=0x0||_0xae4df9[_0xf3a0('0x64')]()['indexOf'](char(0xa))>=0x0||_0xae4df9[_0xf3a0('0x64')]()['indexOf'](char(0x2c))>=0x0||_0xae4df9[_0xf3a0('0x64')]()[_0xf3a0('0x65')](char(0x22))>=0x0);}function encapsulate(_0x1d5e5e){var _0x4161ae=char(0x22),_0x2a2a86='\x5c'+char(0x22),_0x5878b8=_0x1d5e5e[_0xf3a0('0x64')]()[_0xf3a0('0x66')](new RegExp(_0x4161ae,'g'),_0x2a2a86);return _0x4161ae+_0x5878b8+_0x4161ae;}exports['getSummary']=function(_0x478e4c,_0x2acbe6,_0x68bab0){var _0x2d7dff,_0x263017;var _0x9a106={'where':{'ProjectId':_0x478e4c[_0xf3a0('0x4c')]['id']}};if(_0x478e4c['query']['startTime']){_0x9a106[_0xf3a0('0x40')][_0xf3a0('0x67')]=JSON['parse'](_0x478e4c[_0xf3a0('0x36')][_0xf3a0('0x68')]);}return db[_0xf3a0('0x5d')][_0xf3a0('0x48')](_0x9a106)[_0xf3a0('0x27')](handleEntityNotFound(_0x2acbe6,null))['then'](function(_0x52ad94){if(_0x52ad94){_0x2d7dff=_0x52ad94;return db['JscriptyQuestionReport'][_0xf3a0('0x48')]({'where':{'SessionId':{'$in':_['map'](_0x2d7dff,'id')},'ProjectId':_0x478e4c[_0xf3a0('0x4c')]['id']},'order':'-createdAt'});}})[_0xf3a0('0x27')](handleEntityNotFound(_0x2acbe6,null))[_0xf3a0('0x27')](function(_0x11a560){if(_0x11a560){_0x263017=_0x11a560;var _0x3d83a7={};for(var _0x5abd99=0x0,_0x489db0=_0x263017[_0xf3a0('0x3c')];_0x5abd99<_0x489db0;_0x5abd99++){if(!_0x3d83a7['hasOwnProperty'](_0x263017[_0x5abd99][_0xf3a0('0x69')])){_0x3d83a7[_0x263017[_0x5abd99]['questionId']]=needsEncapsulation(_0x263017[_0x5abd99]['question'])?encapsulate(_0x263017[_0x5abd99][_0xf3a0('0x6a')]):_0x263017[_0x5abd99][_0xf3a0('0x6a')];}}var _0x535817=[],_0x5c58bf={};for(var _0x59d312=0x0,_0x3ea7b4=_0x2d7dff[_0xf3a0('0x3c')];_0x59d312<_0x3ea7b4;_0x59d312++){_0x5c58bf={'ProjectId':_0x478e4c[_0xf3a0('0x4c')]['id'],'SessionId':_0x2d7dff[_0x59d312]['id'],'StartTime':moment(_0x2d7dff[_0x59d312]['starttime'])[_0xf3a0('0x6b')](_0xf3a0('0x6c'))};for(var _0x16a79b=0x0,_0x1041ca=_0x263017[_0xf3a0('0x3c')];_0x16a79b<_0x1041ca;_0x16a79b++){if(_0x263017[_0x16a79b][_0xf3a0('0x6d')]==_0x2d7dff[_0x59d312]['id']&&_0x3d83a7[_0xf3a0('0x3d')](_0x263017[_0x16a79b]['questionId'])){_0x5c58bf[_0x3d83a7[_0x263017[_0x16a79b][_0xf3a0('0x69')]]]=_0x263017[_0x16a79b]['answer'];}}for(var _0x1b4954 in _0x3d83a7){if(!_0x5c58bf['hasOwnProperty'](_0x3d83a7[_0x1b4954])){_0x5c58bf[_0x3d83a7[_0x1b4954]]=null;}}_0x535817[_0xf3a0('0x6e')](_0x5c58bf);}return _0x535817;}})[_0xf3a0('0x27')](function(_0x1bdd22){if(!_['isEmpty'](_0x1bdd22)){var _0x2b421a=toCsv(_0x1bdd22);var _0x284e8d=Date[_0xf3a0('0x6f')]();fs['writeFileSync'](util[_0xf3a0('0x6b')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x478e4c[_0xf3a0('0x4c')]['id'],_0x284e8d),_0x2b421a);_0x2acbe6[_0xf3a0('0x70')]('Content-disposition',_0xf3a0('0x71')+util[_0xf3a0('0x6b')](_0xf3a0('0x72'),_0x478e4c[_0xf3a0('0x4c')]['id'],_0x284e8d));_0x2acbe6[_0xf3a0('0x70')](_0xf3a0('0x73'),_0xf3a0('0x74'));return _0x2acbe6[_0xf3a0('0x75')](util[_0xf3a0('0x6b')](_0xf3a0('0x76'),_0x478e4c[_0xf3a0('0x4c')]['id'],_0x284e8d));}else{return _0x2acbe6[_0xf3a0('0x1b')](0xcc);}})['catch'](handleError(_0x2acbe6,null));};
\ No newline at end of file
index f899120..2ee59eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x35d0=['moment','bluebird','request-promise','path','rimraf','./jscriptyProject.attributes','exports','JscriptyProject','jscripty_projects','lodash','util','api'];(function(_0x10dfdf,_0x36b623){var _0x4d857d=function(_0x4683ee){while(--_0x4683ee){_0x10dfdf['push'](_0x10dfdf['shift']());}};_0x4d857d(++_0x36b623);}(_0x35d0,0xf9));var _0x035d=function(_0x57cbfb,_0x2de760){_0x57cbfb=_0x57cbfb-0x0;var _0x4cb933=_0x35d0[_0x57cbfb];return _0x4cb933;};'use strict';var _=require(_0x035d('0x0'));var util=require(_0x035d('0x1'));var logger=require('../../config/logger')(_0x035d('0x2'));var moment=require(_0x035d('0x3'));var BPromise=require(_0x035d('0x4'));var rp=require(_0x035d('0x5'));var fs=require('fs');var path=require(_0x035d('0x6'));var rimraf=require(_0x035d('0x7'));var config=require('../../config/environment');var attributes=require(_0x035d('0x8'));module[_0x035d('0x9')]=function(_0x3e6d36,_0x3f5f0d){return _0x3e6d36['define'](_0x035d('0xa'),attributes,{'tableName':_0x035d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd493=['bluebird','rimraf','../../config/environment','define','JscriptyProject','lodash','../../config/logger','api'];(function(_0x24dfc4,_0x48c92f){var _0x49c56a=function(_0x5edf23){while(--_0x5edf23){_0x24dfc4['push'](_0x24dfc4['shift']());}};_0x49c56a(++_0x48c92f);}(_0xd493,0x1bd));var _0x3d49=function(_0x4e07df,_0x5a914b){_0x4e07df=_0x4e07df-0x0;var _0x7b072f=_0xd493[_0x4e07df];return _0x7b072f;};'use strict';var _=require(_0x3d49('0x0'));var util=require('util');var logger=require(_0x3d49('0x1'))(_0x3d49('0x2'));var moment=require('moment');var BPromise=require(_0x3d49('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3d49('0x4'));var config=require(_0x3d49('0x5'));var attributes=require('./jscriptyProject.attributes');module['exports']=function(_0x1550e0,_0x1316f4){return _0x1550e0[_0x3d49('0x6')](_0x3d49('0x7'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a2c8ae7..4a5cf9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bde=['code','message','JscriptyProject,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x431b25,_0x57dee2){var _0x2aafce=function(_0x411225){while(--_0x411225){_0x431b25['push'](_0x431b25['shift']());}};_0x2aafce(++_0x57dee2);}(_0x9bde,0xe1));var _0xe9bd=function(_0xf0c725,_0x358783){_0xf0c725=_0xf0c725-0x0;var _0x16ae66=_0x9bde[_0xf0c725];return _0x16ae66;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var moment=require('moment');var BPromise=require(_0xe9bd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9bd('0x2'));var db=require(_0xe9bd('0x3'))['db'];var utils=require(_0xe9bd('0x4'));var logger=require(_0xe9bd('0x5'))(_0xe9bd('0x6'));var config=require(_0xe9bd('0x7'));var jayson=require(_0xe9bd('0x8'));var client=jayson['client'][_0xe9bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f18fe,_0x22a438,_0xa66ae2){return new BPromise(function(_0x2d5c75,_0x3ef9e3){return client[_0xe9bd('0xa')](_0x5f18fe,_0xa66ae2)[_0xe9bd('0xb')](function(_0x439abc){logger[_0xe9bd('0xc')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,'request\x20sent');logger[_0xe9bd('0xd')](_0xe9bd('0xe'),_0x22a438,_0xe9bd('0xf'),JSON['stringify'](_0x439abc));if(_0x439abc[_0xe9bd('0x10')]){if(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x11')]===0x1f4){logger[_0xe9bd('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,_0x439abc[_0xe9bd('0x10')]['message']);return _0x3ef9e3(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}logger[_0xe9bd('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,_0x439abc['error'][_0xe9bd('0x12')]);return _0x2d5c75(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}else{logger[_0xe9bd('0xc')](_0xe9bd('0x13'),_0x22a438,_0xe9bd('0xf'));_0x2d5c75(_0x439abc[_0xe9bd('0x14')]['message']);}})[_0xe9bd('0x15')](function(_0x464a1b){logger[_0xe9bd('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,_0x464a1b);_0x3ef9e3(_0x464a1b);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\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(_0x107f28,_0x15a3af){var _0x1e3b42=function(_0x57a2bb){while(--_0x57a2bb){_0x107f28['push'](_0x107f28['shift']());}};_0x1e3b42(++_0x15a3af);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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 7d2ad23..6b2f52c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7382=['exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete'];(function(_0x103fe4,_0x24dc3d){var _0x5bc9b5=function(_0x3be394){while(--_0x3be394){_0x103fe4['push'](_0x103fe4['shift']());}};_0x5bc9b5(++_0x24dc3d);}(_0x7382,0x17b));var _0x2738=function(_0x3e80fd,_0x31bfee){_0x3e80fd=_0x3e80fd-0x0;var _0x368900=_0x7382[_0x3e80fd];return _0x368900;};'use strict';var multer=require(_0x2738('0x0'));var util=require(_0x2738('0x1'));var path=require(_0x2738('0x2'));var timeout=require(_0x2738('0x3'));var express=require(_0x2738('0x4'));var router=express[_0x2738('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2738('0x6'));var controller=require(_0x2738('0x7'));router[_0x2738('0x8')]('/',auth[_0x2738('0x9')](),controller[_0x2738('0xa')]);router['get'](_0x2738('0xb'),auth[_0x2738('0x9')](),controller[_0x2738('0xc')]);router[_0x2738('0x8')](_0x2738('0xd'),auth[_0x2738('0x9')](),controller[_0x2738('0xe')]);router[_0x2738('0xf')]('/',auth[_0x2738('0x9')](),controller[_0x2738('0x10')]);router[_0x2738('0x11')]('/:id',auth[_0x2738('0x9')](),controller[_0x2738('0x12')]);router[_0x2738('0x13')](_0x2738('0xd'),auth[_0x2738('0x9')](),controller['destroy']);module[_0x2738('0x14')]=router;
\ No newline at end of file
+var _0x6273=['delete','destroy','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','put','update'];(function(_0x33fcbb,_0x291d0f){var _0x2efe40=function(_0x2e9442){while(--_0x2e9442){_0x33fcbb['push'](_0x33fcbb['shift']());}};_0x2efe40(++_0x291d0f);}(_0x6273,0x9b));var _0x3627=function(_0x2bf56b,_0x47760c){_0x2bf56b=_0x2bf56b-0x0;var _0x6a0d65=_0x6273[_0x2bf56b];return _0x6a0d65;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3627('0x0'));var timeout=require(_0x3627('0x1'));var express=require(_0x3627('0x2'));var router=express['Router']();var fs_extra=require(_0x3627('0x3'));var auth=require(_0x3627('0x4'));var interaction=require(_0x3627('0x5'));var config=require(_0x3627('0x6'));var controller=require('./jscriptyQuestionReport.controller');router[_0x3627('0x7')]('/',auth[_0x3627('0x8')](),controller['index']);router[_0x3627('0x7')](_0x3627('0x9'),auth[_0x3627('0x8')](),controller[_0x3627('0xa')]);router[_0x3627('0x7')](_0x3627('0xb'),auth[_0x3627('0x8')](),controller[_0x3627('0xc')]);router[_0x3627('0xd')]('/',auth[_0x3627('0x8')](),controller['create']);router[_0x3627('0xe')](_0x3627('0xb'),auth[_0x3627('0x8')](),controller[_0x3627('0xf')]);router[_0x3627('0x10')]('/:id',auth[_0x3627('0x8')](),controller[_0x3627('0x11')]);module[_0x3627('0x12')]=router;
\ No newline at end of file
index 8439571..f14bc94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x7a54,0x106));var _0x47a5=function(_0x3228da,_0x586461){_0x3228da=_0x3228da-0x0;var _0x3fc0c3=_0x7a54[_0x3228da];return _0x3fc0c3;};'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(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x7a54,0x106));var _0x47a5=function(_0x4c0cfe,_0x35ad59){_0x4c0cfe=_0x4c0cfe-0x0;var _0x3fd7d0=_0x7a54[_0x4c0cfe];return _0x3fd7d0;};'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 db03b5a..539ca77 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20d6=['undefined','count','limit','Content-Range','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','JscriptyQuestionReport','include','findAll','rows','show','params','find','create','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x2e7cb2,_0x2ef673){var _0xf83533=function(_0x512f4d){while(--_0x512f4d){_0x2e7cb2['push'](_0x2e7cb2['shift']());}};_0xf83533(++_0x2ef673);}(_0x20d6,0x76));var _0x620d=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x20d6[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0x620d('0x0'));var rimraf=require(_0x620d('0x1'));var zipdir=require(_0x620d('0x2'));var jsonpatch=require(_0x620d('0x3'));var rp=require(_0x620d('0x4'));var moment=require(_0x620d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x620d('0x6'));var util=require(_0x620d('0x7'));var path=require('path');var sox=require(_0x620d('0x8'));var csv=require(_0x620d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x620d('0xa'));var _=require(_0x620d('0xb'));var squel=require(_0x620d('0xc'));var crypto=require(_0x620d('0xd'));var jsforce=require(_0x620d('0xe'));var deskjs=require(_0x620d('0xf'));var toCsv=require('to-csv');var querystring=require(_0x620d('0x10'));var Papa=require('papaparse');var Redis=require(_0x620d('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x620d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x620d('0x13'));var utils=require(_0x620d('0x14'));var config=require(_0x620d('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x620d('0x16'))['db'];function respondWithStatusCode(_0x43a7fb,_0x338dbc){_0x338dbc=_0x338dbc||0xcc;return function(_0x18eb0e){if(_0x18eb0e){return _0x43a7fb[_0x620d('0x17')](_0x338dbc);}return _0x43a7fb[_0x620d('0x18')](_0x338dbc)[_0x620d('0x19')]();};}function respondWithResult(_0x44955e,_0x32c8ac){_0x32c8ac=_0x32c8ac||0xc8;return function(_0x2e69d6){if(_0x2e69d6){return _0x44955e[_0x620d('0x18')](_0x32c8ac)[_0x620d('0x1a')](_0x2e69d6);}};}function respondWithFilteredResult(_0x48ec3f,_0x7b04a){return function(_0x27cd5f){if(_0x27cd5f){var _0x433086=typeof _0x7b04a[_0x620d('0x1b')]===_0x620d('0x1c')&&typeof _0x7b04a['limit']===_0x620d('0x1c');var _0x4e8021=_0x27cd5f[_0x620d('0x1d')];var _0x117670=_0x433086?0x0:_0x7b04a[_0x620d('0x1b')];var _0x284e9e=_0x433086?_0x27cd5f['count']:_0x7b04a[_0x620d('0x1b')]+_0x7b04a[_0x620d('0x1e')];var _0x2d744e;if(_0x284e9e>=_0x4e8021){_0x284e9e=_0x4e8021;_0x2d744e=0xc8;}else{_0x2d744e=0xce;}_0x48ec3f['status'](_0x2d744e);return _0x48ec3f['set'](_0x620d('0x1f'),_0x117670+'-'+_0x284e9e+'/'+_0x4e8021)['json'](_0x27cd5f);}return null;};}function patchUpdates(_0x45d4e7){return function(_0x35d08e){try{jsonpatch['apply'](_0x35d08e,_0x45d4e7,!![]);}catch(_0x3f4f79){return BPromise[_0x620d('0x20')](_0x3f4f79);}return _0x35d08e[_0x620d('0x21')]();};}function saveUpdates(_0xb9a29f,_0x3767eb){return function(_0x3f00e4){if(_0x3f00e4){return _0x3f00e4[_0x620d('0x22')](_0xb9a29f)[_0x620d('0x23')](function(_0x286641){return _0x286641;});}return null;};}function removeEntity(_0x1ebba9,_0x4aac2e){return function(_0x28db5a){if(_0x28db5a){return _0x28db5a[_0x620d('0x24')]()[_0x620d('0x23')](function(){_0x1ebba9[_0x620d('0x18')](0xcc)[_0x620d('0x19')]();});}};}function handleEntityNotFound(_0x418f50,_0x2eda8b){return function(_0xa75ea1){if(!_0xa75ea1){_0x418f50[_0x620d('0x17')](0x194);}return _0xa75ea1;};}function handleError(_0x478dfd,_0x3a1229){_0x3a1229=_0x3a1229||0x1f4;return function(_0x5b5ddb){logger[_0x620d('0x25')](_0x5b5ddb[_0x620d('0x26')]);if(_0x5b5ddb[_0x620d('0x27')]){delete _0x5b5ddb[_0x620d('0x27')];}_0x478dfd['status'](_0x3a1229)[_0x620d('0x28')](_0x5b5ddb);};}exports['index']=function(_0x433c48,_0x462122){var _0x6b8c02={},_0x4f14ab={},_0x1d2e98={'count':0x0,'rows':[]};var _0x3255bb=_[_0x620d('0x29')](db['JscriptyQuestionReport'][_0x620d('0x2a')],function(_0x46552b){return{'name':_0x46552b[_0x620d('0x2b')],'type':_0x46552b[_0x620d('0x2c')][_0x620d('0x2d')]};});_0x4f14ab['model']=_['map'](_0x3255bb,_0x620d('0x27'));_0x4f14ab[_0x620d('0x2e')]=_[_0x620d('0x2f')](_0x433c48[_0x620d('0x2e')]);_0x4f14ab[_0x620d('0x30')]=_[_0x620d('0x31')](_0x4f14ab['model'],_0x4f14ab['query']);_0x6b8c02[_0x620d('0x32')]=_[_0x620d('0x31')](_0x4f14ab['model'],qs[_0x620d('0x33')](_0x433c48[_0x620d('0x2e')][_0x620d('0x33')]));_0x6b8c02['attributes']=_0x6b8c02[_0x620d('0x32')][_0x620d('0x34')]?_0x6b8c02['attributes']:_0x4f14ab[_0x620d('0x35')];if(!_0x433c48[_0x620d('0x2e')][_0x620d('0x36')]('nolimit')){_0x6b8c02[_0x620d('0x1e')]=qs[_0x620d('0x1e')](_0x433c48[_0x620d('0x2e')][_0x620d('0x1e')]);_0x6b8c02['offset']=qs[_0x620d('0x1b')](_0x433c48['query']['offset']);}_0x6b8c02[_0x620d('0x37')]=qs[_0x620d('0x38')](_0x433c48[_0x620d('0x2e')][_0x620d('0x38')]);_0x6b8c02[_0x620d('0x39')]=qs[_0x620d('0x30')](_['pick'](_0x433c48[_0x620d('0x2e')],_0x4f14ab[_0x620d('0x30')]),_0x3255bb);if(_0x433c48[_0x620d('0x2e')]['filter']){_0x6b8c02['where']=_[_0x620d('0x3a')](_0x6b8c02['where'],{'$or':_['map'](_0x3255bb,function(_0x4ebff9){if(_0x4ebff9[_0x620d('0x2c')]!==_0x620d('0x3b')){var _0x413007={};_0x413007[_0x4ebff9[_0x620d('0x27')]]={'$like':'%'+_0x433c48[_0x620d('0x2e')][_0x620d('0x3c')]+'%'};return _0x413007;}})});}_0x6b8c02=_[_0x620d('0x3a')]({},_0x6b8c02,_0x433c48[_0x620d('0x3d')]);var _0x25990d={'where':_0x6b8c02[_0x620d('0x39')]};return db[_0x620d('0x3e')][_0x620d('0x1d')](_0x25990d)[_0x620d('0x23')](function(_0x214d98){_0x1d2e98[_0x620d('0x1d')]=_0x214d98;if(_0x433c48['query']['includeAll']){_0x6b8c02[_0x620d('0x3f')]=[{'all':!![]}];}return db[_0x620d('0x3e')][_0x620d('0x40')](_0x6b8c02);})['then'](function(_0x1b081e){_0x1d2e98[_0x620d('0x41')]=_0x1b081e;return _0x1d2e98;})[_0x620d('0x23')](respondWithFilteredResult(_0x462122,_0x6b8c02))['catch'](handleError(_0x462122,null));};exports[_0x620d('0x42')]=function(_0x40f685,_0x187f26){var _0x1968b3={'raw':!![],'where':{'id':_0x40f685[_0x620d('0x43')]['id']}},_0x3f3ad5={};_0x3f3ad5[_0x620d('0x35')]=_['keys'](db[_0x620d('0x3e')][_0x620d('0x2a')]);_0x3f3ad5[_0x620d('0x2e')]=_[_0x620d('0x2f')](_0x40f685[_0x620d('0x2e')]);_0x3f3ad5[_0x620d('0x30')]=_['intersection'](_0x3f3ad5[_0x620d('0x35')],_0x3f3ad5[_0x620d('0x2e')]);_0x1968b3[_0x620d('0x32')]=_[_0x620d('0x31')](_0x3f3ad5[_0x620d('0x35')],qs[_0x620d('0x33')](_0x40f685[_0x620d('0x2e')][_0x620d('0x33')]));_0x1968b3[_0x620d('0x32')]=_0x1968b3['attributes']['length']?_0x1968b3['attributes']:_0x3f3ad5[_0x620d('0x35')];if(_0x40f685[_0x620d('0x2e')]['includeAll']){_0x1968b3[_0x620d('0x3f')]=[{'all':!![]}];}_0x1968b3=_[_0x620d('0x3a')]({},_0x1968b3,_0x40f685[_0x620d('0x3d')]);return db[_0x620d('0x3e')][_0x620d('0x44')](_0x1968b3)[_0x620d('0x23')](handleEntityNotFound(_0x187f26,null))[_0x620d('0x23')](respondWithResult(_0x187f26,null))['catch'](handleError(_0x187f26,null));};exports[_0x620d('0x45')]=function(_0xf3f270,_0x1b65e3){return db['JscriptyQuestionReport'][_0x620d('0x45')](_0xf3f270[_0x620d('0x46')],{})[_0x620d('0x23')](respondWithResult(_0x1b65e3,0xc9))[_0x620d('0x47')](handleError(_0x1b65e3,null));};exports[_0x620d('0x22')]=function(_0x31410f,_0x27077a){if(_0x31410f[_0x620d('0x46')]['id']){delete _0x31410f[_0x620d('0x46')]['id'];}return db[_0x620d('0x3e')][_0x620d('0x44')]({'where':{'id':_0x31410f['params']['id']}})[_0x620d('0x23')](handleEntityNotFound(_0x27077a,null))['then'](saveUpdates(_0x31410f[_0x620d('0x46')],null))[_0x620d('0x23')](respondWithResult(_0x27077a,null))['catch'](handleError(_0x27077a,null));};exports[_0x620d('0x24')]=function(_0x2679ea,_0x138ee5){return db['JscriptyQuestionReport'][_0x620d('0x44')]({'where':{'id':_0x2679ea[_0x620d('0x43')]['id']}})['then'](handleEntityNotFound(_0x138ee5,null))[_0x620d('0x23')](removeEntity(_0x138ee5,null))['catch'](handleError(_0x138ee5,null));};exports[_0x620d('0x48')]=function(_0x197d83,_0xd1e1c1){return db['JscriptyQuestionReport'][_0x620d('0x48')]()['then'](respondWithResult(_0xd1e1c1,null))[_0x620d('0x47')](handleError(_0xd1e1c1,null));};
\ No newline at end of file
+var _0xae37=['stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','JscriptyQuestionReport','includeAll','findAll','show','params','filters','include','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','offset','count','Content-Range','apply','reject','save','update','then','end','error'];(function(_0x40b321,_0x5094f6){var _0x11ee31=function(_0x597d01){while(--_0x597d01){_0x40b321['push'](_0x40b321['shift']());}};_0x11ee31(++_0x5094f6);}(_0xae37,0xc3));var _0x7ae3=function(_0x37d4b1,_0x96ed82){_0x37d4b1=_0x37d4b1-0x0;var _0x25868e=_0xae37[_0x37d4b1];return _0x25868e;};'use strict';var emlformat=require(_0x7ae3('0x0'));var rimraf=require(_0x7ae3('0x1'));var zipdir=require(_0x7ae3('0x2'));var jsonpatch=require(_0x7ae3('0x3'));var rp=require(_0x7ae3('0x4'));var moment=require('moment');var BPromise=require(_0x7ae3('0x5'));var Mustache=require(_0x7ae3('0x6'));var util=require(_0x7ae3('0x7'));var path=require(_0x7ae3('0x8'));var sox=require(_0x7ae3('0x9'));var csv=require(_0x7ae3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7ae3('0xb'));var _=require(_0x7ae3('0xc'));var squel=require('squel');var crypto=require(_0x7ae3('0xd'));var jsforce=require(_0x7ae3('0xe'));var deskjs=require(_0x7ae3('0xf'));var toCsv=require(_0x7ae3('0xa'));var querystring=require(_0x7ae3('0x10'));var Papa=require(_0x7ae3('0x11'));var Redis=require(_0x7ae3('0x12'));var authService=require(_0x7ae3('0x13'));var qs=require(_0x7ae3('0x14'));var as=require(_0x7ae3('0x15'));var hardwareService=require(_0x7ae3('0x16'));var logger=require(_0x7ae3('0x17'))(_0x7ae3('0x18'));var utils=require(_0x7ae3('0x19'));var config=require(_0x7ae3('0x1a'));var licenseUtil=require(_0x7ae3('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2bfd6e,_0x4c9545){_0x4c9545=_0x4c9545||0xcc;return function(_0x1bda8a){if(_0x1bda8a){return _0x2bfd6e[_0x7ae3('0x1c')](_0x4c9545);}return _0x2bfd6e[_0x7ae3('0x1d')](_0x4c9545)['end']();};}function respondWithResult(_0x392062,_0x2f04c7){_0x2f04c7=_0x2f04c7||0xc8;return function(_0x5e09f5){if(_0x5e09f5){return _0x392062[_0x7ae3('0x1d')](_0x2f04c7)[_0x7ae3('0x1e')](_0x5e09f5);}};}function respondWithFilteredResult(_0xd7e883,_0x1fdcaa){return function(_0x5f33b6){if(_0x5f33b6){var _0x4277df=typeof _0x1fdcaa['offset']===_0x7ae3('0x1f')&&typeof _0x1fdcaa['limit']===_0x7ae3('0x1f');var _0x3203ca=_0x5f33b6['count'];var _0xea8ea4=_0x4277df?0x0:_0x1fdcaa[_0x7ae3('0x20')];var _0x3f4d66=_0x4277df?_0x5f33b6[_0x7ae3('0x21')]:_0x1fdcaa[_0x7ae3('0x20')]+_0x1fdcaa['limit'];var _0xf8a129;if(_0x3f4d66>=_0x3203ca){_0x3f4d66=_0x3203ca;_0xf8a129=0xc8;}else{_0xf8a129=0xce;}_0xd7e883[_0x7ae3('0x1d')](_0xf8a129);return _0xd7e883['set'](_0x7ae3('0x22'),_0xea8ea4+'-'+_0x3f4d66+'/'+_0x3203ca)[_0x7ae3('0x1e')](_0x5f33b6);}return null;};}function patchUpdates(_0x5aefed){return function(_0x38290e){try{jsonpatch[_0x7ae3('0x23')](_0x38290e,_0x5aefed,!![]);}catch(_0x396a6e){return BPromise[_0x7ae3('0x24')](_0x396a6e);}return _0x38290e[_0x7ae3('0x25')]();};}function saveUpdates(_0x1a049f,_0x5412f1){return function(_0x389f61){if(_0x389f61){return _0x389f61[_0x7ae3('0x26')](_0x1a049f)[_0x7ae3('0x27')](function(_0x2cd8b7){return _0x2cd8b7;});}return null;};}function removeEntity(_0x248746,_0x2a2abe){return function(_0x2756ed){if(_0x2756ed){return _0x2756ed['destroy']()['then'](function(){_0x248746[_0x7ae3('0x1d')](0xcc)[_0x7ae3('0x28')]();});}};}function handleEntityNotFound(_0x2a0349,_0x13362b){return function(_0x3f7ba3){if(!_0x3f7ba3){_0x2a0349['sendStatus'](0x194);}return _0x3f7ba3;};}function handleError(_0x5461b6,_0x26c64b){_0x26c64b=_0x26c64b||0x1f4;return function(_0x22af74){logger[_0x7ae3('0x29')](_0x22af74[_0x7ae3('0x2a')]);if(_0x22af74[_0x7ae3('0x2b')]){delete _0x22af74['name'];}_0x5461b6['status'](_0x26c64b)['send'](_0x22af74);};}exports[_0x7ae3('0x2c')]=function(_0x5ce098,_0x5d20f6){var _0x2b0805={},_0x572ad4={},_0x363aa3={'count':0x0,'rows':[]};var _0x404079=_[_0x7ae3('0x2d')](db['JscriptyQuestionReport'][_0x7ae3('0x2e')],function(_0x17c643){return{'name':_0x17c643[_0x7ae3('0x2f')],'type':_0x17c643[_0x7ae3('0x30')][_0x7ae3('0x31')]};});_0x572ad4[_0x7ae3('0x32')]=_[_0x7ae3('0x2d')](_0x404079,'name');_0x572ad4[_0x7ae3('0x33')]=_[_0x7ae3('0x34')](_0x5ce098[_0x7ae3('0x33')]);_0x572ad4['filters']=_['intersection'](_0x572ad4[_0x7ae3('0x32')],_0x572ad4['query']);_0x2b0805['attributes']=_[_0x7ae3('0x35')](_0x572ad4['model'],qs[_0x7ae3('0x36')](_0x5ce098[_0x7ae3('0x33')][_0x7ae3('0x36')]));_0x2b0805['attributes']=_0x2b0805[_0x7ae3('0x37')][_0x7ae3('0x38')]?_0x2b0805[_0x7ae3('0x37')]:_0x572ad4[_0x7ae3('0x32')];if(!_0x5ce098[_0x7ae3('0x33')][_0x7ae3('0x39')](_0x7ae3('0x3a'))){_0x2b0805[_0x7ae3('0x3b')]=qs[_0x7ae3('0x3b')](_0x5ce098[_0x7ae3('0x33')][_0x7ae3('0x3b')]);_0x2b0805[_0x7ae3('0x20')]=qs[_0x7ae3('0x20')](_0x5ce098['query']['offset']);}_0x2b0805['order']=qs['sort'](_0x5ce098[_0x7ae3('0x33')][_0x7ae3('0x3c')]);_0x2b0805[_0x7ae3('0x3d')]=qs['filters'](_[_0x7ae3('0x3e')](_0x5ce098[_0x7ae3('0x33')],_0x572ad4['filters']),_0x404079);if(_0x5ce098[_0x7ae3('0x33')][_0x7ae3('0x3f')]){_0x2b0805['where']=_[_0x7ae3('0x40')](_0x2b0805[_0x7ae3('0x3d')],{'$or':_[_0x7ae3('0x2d')](_0x404079,function(_0x267754){if(_0x267754['type']!==_0x7ae3('0x41')){var _0x4f7677={};_0x4f7677[_0x267754[_0x7ae3('0x2b')]]={'$like':'%'+_0x5ce098['query'][_0x7ae3('0x3f')]+'%'};return _0x4f7677;}})});}_0x2b0805=_['merge']({},_0x2b0805,_0x5ce098[_0x7ae3('0x42')]);var _0x289d0c={'where':_0x2b0805[_0x7ae3('0x3d')]};return db[_0x7ae3('0x43')][_0x7ae3('0x21')](_0x289d0c)['then'](function(_0x1d6704){_0x363aa3[_0x7ae3('0x21')]=_0x1d6704;if(_0x5ce098['query'][_0x7ae3('0x44')]){_0x2b0805['include']=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x7ae3('0x45')](_0x2b0805);})[_0x7ae3('0x27')](function(_0xcf5aeb){_0x363aa3['rows']=_0xcf5aeb;return _0x363aa3;})[_0x7ae3('0x27')](respondWithFilteredResult(_0x5d20f6,_0x2b0805))['catch'](handleError(_0x5d20f6,null));};exports[_0x7ae3('0x46')]=function(_0x7c1314,_0x45f4a9){var _0x53f6ba={'raw':!![],'where':{'id':_0x7c1314[_0x7ae3('0x47')]['id']}},_0x591947={};_0x591947['model']=_[_0x7ae3('0x34')](db['JscriptyQuestionReport'][_0x7ae3('0x2e')]);_0x591947[_0x7ae3('0x33')]=_[_0x7ae3('0x34')](_0x7c1314[_0x7ae3('0x33')]);_0x591947[_0x7ae3('0x48')]=_['intersection'](_0x591947[_0x7ae3('0x32')],_0x591947[_0x7ae3('0x33')]);_0x53f6ba[_0x7ae3('0x37')]=_[_0x7ae3('0x35')](_0x591947[_0x7ae3('0x32')],qs['fields'](_0x7c1314[_0x7ae3('0x33')][_0x7ae3('0x36')]));_0x53f6ba[_0x7ae3('0x37')]=_0x53f6ba[_0x7ae3('0x37')][_0x7ae3('0x38')]?_0x53f6ba['attributes']:_0x591947[_0x7ae3('0x32')];if(_0x7c1314[_0x7ae3('0x33')]['includeAll']){_0x53f6ba[_0x7ae3('0x49')]=[{'all':!![]}];}_0x53f6ba=_[_0x7ae3('0x40')]({},_0x53f6ba,_0x7c1314[_0x7ae3('0x42')]);return db[_0x7ae3('0x43')][_0x7ae3('0x4a')](_0x53f6ba)[_0x7ae3('0x27')](handleEntityNotFound(_0x45f4a9,null))[_0x7ae3('0x27')](respondWithResult(_0x45f4a9,null))[_0x7ae3('0x4b')](handleError(_0x45f4a9,null));};exports['create']=function(_0x4f7793,_0x59a6d5){return db[_0x7ae3('0x43')][_0x7ae3('0x4c')](_0x4f7793[_0x7ae3('0x4d')],{})[_0x7ae3('0x27')](respondWithResult(_0x59a6d5,0xc9))[_0x7ae3('0x4b')](handleError(_0x59a6d5,null));};exports[_0x7ae3('0x26')]=function(_0x27b6ee,_0x523b3e){if(_0x27b6ee[_0x7ae3('0x4d')]['id']){delete _0x27b6ee[_0x7ae3('0x4d')]['id'];}return db[_0x7ae3('0x43')][_0x7ae3('0x4a')]({'where':{'id':_0x27b6ee[_0x7ae3('0x47')]['id']}})[_0x7ae3('0x27')](handleEntityNotFound(_0x523b3e,null))['then'](saveUpdates(_0x27b6ee[_0x7ae3('0x4d')],null))['then'](respondWithResult(_0x523b3e,null))[_0x7ae3('0x4b')](handleError(_0x523b3e,null));};exports['destroy']=function(_0x8ee5f,_0x1d415f){return db['JscriptyQuestionReport'][_0x7ae3('0x4a')]({'where':{'id':_0x8ee5f[_0x7ae3('0x47')]['id']}})['then'](handleEntityNotFound(_0x1d415f,null))['then'](removeEntity(_0x1d415f,null))['catch'](handleError(_0x1d415f,null));};exports[_0x7ae3('0x4e')]=function(_0x3b8b6e,_0x3f769f){return db[_0x7ae3('0x43')][_0x7ae3('0x4e')]()['then'](respondWithResult(_0x3f769f,null))[_0x7ae3('0x4b')](handleError(_0x3f769f,null));};
\ No newline at end of file
index 03d078f..a02b444 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fab=['JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./jscriptyQuestionReport.attributes','define'];(function(_0x504f7b,_0x1ac4e0){var _0x2b0904=function(_0x28e51d){while(--_0x28e51d){_0x504f7b['push'](_0x504f7b['shift']());}};_0x2b0904(++_0x1ac4e0);}(_0x4fab,0xdf));var _0xb4fa=function(_0x3e28cd,_0x478d2b){_0x3e28cd=_0x3e28cd-0x0;var _0x262562=_0x4fab[_0x3e28cd];return _0x262562;};'use strict';var _=require(_0xb4fa('0x0'));var util=require(_0xb4fa('0x1'));var logger=require(_0xb4fa('0x2'))(_0xb4fa('0x3'));var moment=require(_0xb4fa('0x4'));var BPromise=require(_0xb4fa('0x5'));var rp=require(_0xb4fa('0x6'));var fs=require('fs');var path=require(_0xb4fa('0x7'));var rimraf=require(_0xb4fa('0x8'));var config=require('../../config/environment');var attributes=require(_0xb4fa('0x9'));module['exports']=function(_0x3c6740,_0x567e57){return _0x3c6740[_0xb4fa('0xa')](_0xb4fa('0xb'),attributes,{'tableName':_0xb4fa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2336=['bluebird','request-promise','path','rimraf','exports','define','report_jscripty_questions','lodash','../../config/logger','moment'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x2336,0x15b));var _0x6233=function(_0x3931d7,_0x34c702){_0x3931d7=_0x3931d7-0x0;var _0x2ec3f3=_0x2336[_0x3931d7];return _0x2ec3f3;};'use strict';var _=require(_0x6233('0x0'));var util=require('util');var logger=require(_0x6233('0x1'))('api');var moment=require(_0x6233('0x2'));var BPromise=require(_0x6233('0x3'));var rp=require(_0x6233('0x4'));var fs=require('fs');var path=require(_0x6233('0x5'));var rimraf=require(_0x6233('0x6'));var config=require('../../config/environment');var attributes=require('./jscriptyQuestionReport.attributes');module[_0x6233('0x7')]=function(_0x45b4a7,_0xabc389){return _0x45b4a7[_0x6233('0x8')]('JscriptyQuestionReport',attributes,{'tableName':_0x6233('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6ca7f5f..0500f96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3261=['moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util'];(function(_0x528d5b,_0x321c99){var _0x16d600=function(_0x180192){while(--_0x180192){_0x528d5b['push'](_0x528d5b['shift']());}};_0x16d600(++_0x321c99);}(_0x3261,0xb2));var _0x1326=function(_0x14e4b7,_0x5a4466){_0x14e4b7=_0x14e4b7-0x0;var _0x286923=_0x3261[_0x14e4b7];return _0x286923;};'use strict';var _=require(_0x1326('0x0'));var util=require(_0x1326('0x1'));var moment=require(_0x1326('0x2'));var BPromise=require('bluebird');var rs=require(_0x1326('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1326('0x4'));var logger=require(_0x1326('0x5'))(_0x1326('0x6'));var config=require(_0x1326('0x7'));var jayson=require(_0x1326('0x8'));var client=jayson[_0x1326('0x9')][_0x1326('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a58d7,_0x42f192,_0x5e18b8){return new BPromise(function(_0x18b892,_0x46365e){return client[_0x1326('0xb')](_0x3a58d7,_0x5e18b8)[_0x1326('0xc')](function(_0x45e1c9){logger[_0x1326('0xd')](_0x1326('0xe'),_0x42f192,'request\x20sent');logger['debug']('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x42f192,_0x1326('0xf'),JSON['stringify'](_0x45e1c9));if(_0x45e1c9[_0x1326('0x10')]){if(_0x45e1c9['error'][_0x1326('0x11')]===0x1f4){logger[_0x1326('0x10')](_0x1326('0xe'),_0x42f192,_0x45e1c9[_0x1326('0x10')][_0x1326('0x12')]);return _0x46365e(_0x45e1c9[_0x1326('0x10')][_0x1326('0x12')]);}logger[_0x1326('0x10')](_0x1326('0xe'),_0x42f192,_0x45e1c9[_0x1326('0x10')]['message']);return _0x18b892(_0x45e1c9[_0x1326('0x10')][_0x1326('0x12')]);}else{logger[_0x1326('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x42f192,_0x1326('0xf'));_0x18b892(_0x45e1c9[_0x1326('0x13')][_0x1326('0x12')]);}})['catch'](function(_0xc2744d){logger[_0x1326('0x10')](_0x1326('0xe'),_0x42f192,_0xc2744d);_0x46365e(_0xc2744d);});});}
\ No newline at end of file
+var _0xb31c=['util','bluebird','ioredis','../../config/environment','http','request','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash'];(function(_0x28ad2a,_0x19cd23){var _0x74ba9d=function(_0x6144b8){while(--_0x6144b8){_0x28ad2a['push'](_0x28ad2a['shift']());}};_0x74ba9d(++_0x19cd23);}(_0xb31c,0x10d));var _0xcb31=function(_0x31b919,_0x3fd64d){_0x31b919=_0x31b919-0x0;var _0x1433af=_0xb31c[_0x31b919];return _0x1433af;};'use strict';var _=require(_0xcb31('0x0'));var util=require(_0xcb31('0x1'));var moment=require('moment');var BPromise=require(_0xcb31('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcb31('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xcb31('0x4'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcb31('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x2ba820,_0x552751,_0x45e3dc){return new BPromise(function(_0x19d0b6,_0x6bd861){return client[_0xcb31('0x6')](_0x2ba820,_0x45e3dc)[_0xcb31('0x7')](function(_0xe8baef){logger['info'](_0xcb31('0x8'),_0x552751,_0xcb31('0x9'));logger[_0xcb31('0xa')](_0xcb31('0xb'),_0x552751,'request\x20sent',JSON['stringify'](_0xe8baef));if(_0xe8baef[_0xcb31('0xc')]){if(_0xe8baef[_0xcb31('0xc')][_0xcb31('0xd')]===0x1f4){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x552751,_0xe8baef[_0xcb31('0xc')][_0xcb31('0xe')]);return _0x6bd861(_0xe8baef['error'][_0xcb31('0xe')]);}logger[_0xcb31('0xc')](_0xcb31('0x8'),_0x552751,_0xe8baef[_0xcb31('0xc')][_0xcb31('0xe')]);return _0x19d0b6(_0xe8baef['error'][_0xcb31('0xe')]);}else{logger[_0xcb31('0xf')](_0xcb31('0x8'),_0x552751,_0xcb31('0x9'));_0x19d0b6(_0xe8baef[_0xcb31('0x10')][_0xcb31('0xe')]);}})[_0xcb31('0x11')](function(_0x1045f7){logger['error'](_0xcb31('0x8'),_0x552751,_0x1045f7);_0x6bd861(_0x1045f7);});});}
\ No newline at end of file
index 23d96d6..fb875c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26d6=['index','describe','show','/:id/questions','post','create','update','delete','/:id','destroy','exports','multer','connect-timeout','express','Router','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated'];(function(_0x1f08c3,_0x155b28){var _0x4f40f5=function(_0x31cf61){while(--_0x31cf61){_0x1f08c3['push'](_0x1f08c3['shift']());}};_0x4f40f5(++_0x155b28);}(_0x26d6,0x128));var _0x626d=function(_0xb03f9,_0x588391){_0xb03f9=_0xb03f9-0x0;var _0x3ec30a=_0x26d6[_0xb03f9];return _0x3ec30a;};'use strict';var multer=require(_0x626d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x626d('0x1'));var express=require(_0x626d('0x2'));var router=express[_0x626d('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x626d('0x4'));var controller=require(_0x626d('0x5'));router[_0x626d('0x6')]('/',auth[_0x626d('0x7')](),controller[_0x626d('0x8')]);router[_0x626d('0x6')]('/describe',auth[_0x626d('0x7')](),controller[_0x626d('0x9')]);router[_0x626d('0x6')]('/:id',auth[_0x626d('0x7')](),controller[_0x626d('0xa')]);router[_0x626d('0x6')](_0x626d('0xb'),auth[_0x626d('0x7')](),controller['getQuestions']);router[_0x626d('0xc')]('/',auth[_0x626d('0x7')](),controller[_0x626d('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x626d('0xe')]);router[_0x626d('0xf')](_0x626d('0x10'),auth[_0x626d('0x7')](),controller[_0x626d('0x11')]);module[_0x626d('0x12')]=router;
\ No newline at end of file
+var _0x7109=['/describe','describe','/:id','show','/:id/questions','getQuestions','post','put','update','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index'];(function(_0x2dd976,_0x1b5dc4){var _0x2265fd=function(_0x270d24){while(--_0x270d24){_0x2dd976['push'](_0x2dd976['shift']());}};_0x2265fd(++_0x1b5dc4);}(_0x7109,0xf1));var _0x9710=function(_0x36909d,_0x2795f1){_0x36909d=_0x36909d-0x0;var _0x1fd29d=_0x7109[_0x36909d];return _0x1fd29d;};'use strict';var multer=require(_0x9710('0x0'));var util=require(_0x9710('0x1'));var path=require(_0x9710('0x2'));var timeout=require('connect-timeout');var express=require(_0x9710('0x3'));var router=express[_0x9710('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9710('0x5'));var interaction=require(_0x9710('0x6'));var config=require(_0x9710('0x7'));var controller=require(_0x9710('0x8'));router[_0x9710('0x9')]('/',auth[_0x9710('0xa')](),controller[_0x9710('0xb')]);router[_0x9710('0x9')](_0x9710('0xc'),auth[_0x9710('0xa')](),controller[_0x9710('0xd')]);router[_0x9710('0x9')](_0x9710('0xe'),auth[_0x9710('0xa')](),controller[_0x9710('0xf')]);router['get'](_0x9710('0x10'),auth[_0x9710('0xa')](),controller[_0x9710('0x11')]);router[_0x9710('0x12')]('/',auth[_0x9710('0xa')](),controller['create']);router[_0x9710('0x13')]('/:id',auth[_0x9710('0xa')](),controller[_0x9710('0x14')]);router[_0x9710('0x15')](_0x9710('0xe'),auth[_0x9710('0xa')](),controller['destroy']);module[_0x9710('0x16')]=router;
\ No newline at end of file
index 03d3b7d..312cb3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f88=['DATE','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize'];(function(_0x46c81d,_0x42a9ca){var _0x33438d=function(_0x5e316e){while(--_0x5e316e){_0x46c81d['push'](_0x46c81d['shift']());}};_0x33438d(++_0x42a9ca);}(_0x1f88,0x1a2));var _0x81f8=function(_0x1748d2,_0x50e8b1){_0x1748d2=_0x1748d2-0x0;var _0x1766cd=_0x1f88[_0x1748d2];return _0x1766cd;};'use strict';var moment=require(_0x81f8('0x0'));var Sequelize=require(_0x81f8('0x1'));module['exports']={'starttime':{'type':Sequelize[_0x81f8('0x2')],'set':function(_0x78d140){this[_0x81f8('0x3')](_0x81f8('0x4'),_0x78d140);this[_0x81f8('0x3')](_0x81f8('0x5'),moment()[_0x81f8('0x6')](_0x81f8('0x7')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x81f8('0x8')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x81f8('0x8')]},'calleridnum':{'type':Sequelize[_0x81f8('0x8')]},'completed':{'type':Sequelize[_0x81f8('0x9')],'defaultValue':![]}};
\ No newline at end of file
+var _0x676c=['format','DATE','STRING','moment','sequelize','exports','setDataValue','starttime','endtime'];(function(_0x3f6ff4,_0xf55569){var _0x1ba6ad=function(_0x473359){while(--_0x473359){_0x3f6ff4['push'](_0x3f6ff4['shift']());}};_0x1ba6ad(++_0xf55569);}(_0x676c,0x198));var _0xc676=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x676c[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xc676('0x0'));var Sequelize=require(_0xc676('0x1'));module[_0xc676('0x2')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x37c5ec){this[_0xc676('0x3')](_0xc676('0x4'),_0x37c5ec);this[_0xc676('0x3')](_0xc676('0x5'),moment()[_0xc676('0x6')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0xc676('0x7')]},'membername':{'type':Sequelize[_0xc676('0x8')]},'projectname':{'type':Sequelize[_0xc676('0x8')]},'queue':{'type':Sequelize[_0xc676('0x8')]},'uniqueid':{'type':Sequelize[_0xc676('0x8')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xc676('0x8')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index 50caa92..9500e09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf5e0=['save','then','error','stack','name','send','map','JscriptySessionReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','rows','show','params','length','includeAll','include','find','catch','create','body','update','destroy','describe','getQuestions','findOne','order','SessionId','JscriptyQuestionReport','findAll','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0xb24b6d,_0x49f15e){var _0xc88ebd=function(_0x310bd5){while(--_0x310bd5){_0xb24b6d['push'](_0xb24b6d['shift']());}};_0xc88ebd(++_0x49f15e);}(_0xf5e0,0x12b));var _0x0f5e=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xf5e0[_0x46e363];return _0x3fb059;};'use strict';var emlformat=require(_0x0f5e('0x0'));var rimraf=require(_0x0f5e('0x1'));var zipdir=require(_0x0f5e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0f5e('0x3'));var BPromise=require(_0x0f5e('0x4'));var Mustache=require(_0x0f5e('0x5'));var util=require(_0x0f5e('0x6'));var path=require(_0x0f5e('0x7'));var sox=require('sox');var csv=require(_0x0f5e('0x8'));var ejs=require(_0x0f5e('0x9'));var fs=require('fs');var fs_extra=require(_0x0f5e('0xa'));var _=require(_0x0f5e('0xb'));var squel=require(_0x0f5e('0xc'));var crypto=require(_0x0f5e('0xd'));var jsforce=require(_0x0f5e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0f5e('0x8'));var querystring=require(_0x0f5e('0xf'));var Papa=require(_0x0f5e('0x10'));var Redis=require(_0x0f5e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0f5e('0x12'));var as=require(_0x0f5e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0f5e('0x14'))(_0x0f5e('0x15'));var utils=require(_0x0f5e('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0f5e('0x17'));var db=require(_0x0f5e('0x18'))['db'];function respondWithStatusCode(_0x516189,_0x3496db){_0x3496db=_0x3496db||0xcc;return function(_0x3cb303){if(_0x3cb303){return _0x516189[_0x0f5e('0x19')](_0x3496db);}return _0x516189[_0x0f5e('0x1a')](_0x3496db)[_0x0f5e('0x1b')]();};}function respondWithResult(_0x20b848,_0x3b6120){_0x3b6120=_0x3b6120||0xc8;return function(_0x521eb5){if(_0x521eb5){return _0x20b848['status'](_0x3b6120)[_0x0f5e('0x1c')](_0x521eb5);}};}function respondWithFilteredResult(_0x14a806,_0x2b1768){return function(_0x45dcd6){if(_0x45dcd6){var _0x4eb6fe=typeof _0x2b1768[_0x0f5e('0x1d')]===_0x0f5e('0x1e')&&typeof _0x2b1768[_0x0f5e('0x1f')]===_0x0f5e('0x1e');var _0x19256a=_0x45dcd6[_0x0f5e('0x20')];var _0x430bed=_0x4eb6fe?0x0:_0x2b1768['offset'];var _0x4dff72=_0x4eb6fe?_0x45dcd6[_0x0f5e('0x20')]:_0x2b1768[_0x0f5e('0x1d')]+_0x2b1768[_0x0f5e('0x1f')];var _0x48e8f7;if(_0x4dff72>=_0x19256a){_0x4dff72=_0x19256a;_0x48e8f7=0xc8;}else{_0x48e8f7=0xce;}_0x14a806[_0x0f5e('0x1a')](_0x48e8f7);return _0x14a806[_0x0f5e('0x21')](_0x0f5e('0x22'),_0x430bed+'-'+_0x4dff72+'/'+_0x19256a)[_0x0f5e('0x1c')](_0x45dcd6);}return null;};}function patchUpdates(_0xec84a4){return function(_0x23f8d3){try{jsonpatch[_0x0f5e('0x23')](_0x23f8d3,_0xec84a4,!![]);}catch(_0x1b5c14){return BPromise[_0x0f5e('0x24')](_0x1b5c14);}return _0x23f8d3[_0x0f5e('0x25')]();};}function saveUpdates(_0x502a66,_0x304c5d){return function(_0x5c05bd){if(_0x5c05bd){return _0x5c05bd['update'](_0x502a66)[_0x0f5e('0x26')](function(_0x4ab3d2){return _0x4ab3d2;});}return null;};}function removeEntity(_0x970bd6,_0x317d43){return function(_0x104f33){if(_0x104f33){return _0x104f33['destroy']()[_0x0f5e('0x26')](function(){_0x970bd6[_0x0f5e('0x1a')](0xcc)[_0x0f5e('0x1b')]();});}};}function handleEntityNotFound(_0x486433,_0x5125a9){return function(_0x2099ec){if(!_0x2099ec){_0x486433[_0x0f5e('0x19')](0x194);}return _0x2099ec;};}function handleError(_0x1321ce,_0x49adfc){_0x49adfc=_0x49adfc||0x1f4;return function(_0x28bc32){logger[_0x0f5e('0x27')](_0x28bc32[_0x0f5e('0x28')]);if(_0x28bc32[_0x0f5e('0x29')]){delete _0x28bc32[_0x0f5e('0x29')];}_0x1321ce[_0x0f5e('0x1a')](_0x49adfc)[_0x0f5e('0x2a')](_0x28bc32);};}exports['index']=function(_0xf5a4a2,_0x353ed9){var _0xecd4ba={},_0x2e2b0b={},_0x34b3d1={'count':0x0,'rows':[]};var _0x5d70d5=_[_0x0f5e('0x2b')](db[_0x0f5e('0x2c')][_0x0f5e('0x2d')],function(_0x23c7b5){return{'name':_0x23c7b5[_0x0f5e('0x2e')],'type':_0x23c7b5[_0x0f5e('0x2f')][_0x0f5e('0x30')]};});_0x2e2b0b['model']=_['map'](_0x5d70d5,_0x0f5e('0x29'));_0x2e2b0b[_0x0f5e('0x31')]=_[_0x0f5e('0x32')](_0xf5a4a2[_0x0f5e('0x31')]);_0x2e2b0b['filters']=_[_0x0f5e('0x33')](_0x2e2b0b[_0x0f5e('0x34')],_0x2e2b0b[_0x0f5e('0x31')]);_0xecd4ba[_0x0f5e('0x35')]=_[_0x0f5e('0x33')](_0x2e2b0b[_0x0f5e('0x34')],qs[_0x0f5e('0x36')](_0xf5a4a2[_0x0f5e('0x31')][_0x0f5e('0x36')]));_0xecd4ba['attributes']=_0xecd4ba['attributes']['length']?_0xecd4ba['attributes']:_0x2e2b0b[_0x0f5e('0x34')];if(!_0xf5a4a2['query'][_0x0f5e('0x37')](_0x0f5e('0x38'))){_0xecd4ba[_0x0f5e('0x1f')]=qs['limit'](_0xf5a4a2[_0x0f5e('0x31')][_0x0f5e('0x1f')]);_0xecd4ba['offset']=qs[_0x0f5e('0x1d')](_0xf5a4a2[_0x0f5e('0x31')][_0x0f5e('0x1d')]);}_0xecd4ba['order']=qs[_0x0f5e('0x39')](_0xf5a4a2['query'][_0x0f5e('0x39')]);_0xecd4ba[_0x0f5e('0x3a')]=qs['filters'](_[_0x0f5e('0x3b')](_0xf5a4a2[_0x0f5e('0x31')],_0x2e2b0b[_0x0f5e('0x3c')]),_0x5d70d5);if(_0xf5a4a2['query'][_0x0f5e('0x3d')]){_0xecd4ba[_0x0f5e('0x3a')]=_[_0x0f5e('0x3e')](_0xecd4ba['where'],{'$or':_[_0x0f5e('0x2b')](_0x5d70d5,function(_0x1624fa){if(_0x1624fa[_0x0f5e('0x2f')]!==_0x0f5e('0x3f')){var _0x208405={};_0x208405[_0x1624fa[_0x0f5e('0x29')]]={'$like':'%'+_0xf5a4a2[_0x0f5e('0x31')][_0x0f5e('0x3d')]+'%'};return _0x208405;}})});}_0xecd4ba=_['merge']({},_0xecd4ba,_0xf5a4a2[_0x0f5e('0x40')]);var _0x2ad994={'where':_0xecd4ba[_0x0f5e('0x3a')]};return db['JscriptySessionReport'][_0x0f5e('0x20')](_0x2ad994)[_0x0f5e('0x26')](function(_0x29b6ff){_0x34b3d1['count']=_0x29b6ff;if(_0xf5a4a2[_0x0f5e('0x31')]['includeAll']){_0xecd4ba['include']=[{'all':!![]}];}return db[_0x0f5e('0x2c')]['findAll'](_0xecd4ba);})['then'](function(_0x2d3815){_0x34b3d1[_0x0f5e('0x41')]=_0x2d3815;return _0x34b3d1;})['then'](respondWithFilteredResult(_0x353ed9,_0xecd4ba))['catch'](handleError(_0x353ed9,null));};exports[_0x0f5e('0x42')]=function(_0x559ff3,_0x464182){var _0x3f2bd8={'raw':!![],'where':{'id':_0x559ff3[_0x0f5e('0x43')]['id']}},_0x466c0d={};_0x466c0d[_0x0f5e('0x34')]=_[_0x0f5e('0x32')](db[_0x0f5e('0x2c')][_0x0f5e('0x2d')]);_0x466c0d['query']=_[_0x0f5e('0x32')](_0x559ff3[_0x0f5e('0x31')]);_0x466c0d[_0x0f5e('0x3c')]=_[_0x0f5e('0x33')](_0x466c0d[_0x0f5e('0x34')],_0x466c0d[_0x0f5e('0x31')]);_0x3f2bd8[_0x0f5e('0x35')]=_[_0x0f5e('0x33')](_0x466c0d[_0x0f5e('0x34')],qs[_0x0f5e('0x36')](_0x559ff3[_0x0f5e('0x31')][_0x0f5e('0x36')]));_0x3f2bd8['attributes']=_0x3f2bd8['attributes'][_0x0f5e('0x44')]?_0x3f2bd8['attributes']:_0x466c0d[_0x0f5e('0x34')];if(_0x559ff3[_0x0f5e('0x31')][_0x0f5e('0x45')]){_0x3f2bd8[_0x0f5e('0x46')]=[{'all':!![]}];}_0x3f2bd8=_[_0x0f5e('0x3e')]({},_0x3f2bd8,_0x559ff3[_0x0f5e('0x40')]);return db['JscriptySessionReport'][_0x0f5e('0x47')](_0x3f2bd8)[_0x0f5e('0x26')](handleEntityNotFound(_0x464182,null))['then'](respondWithResult(_0x464182,null))[_0x0f5e('0x48')](handleError(_0x464182,null));};exports[_0x0f5e('0x49')]=function(_0x56169e,_0x5a6e33){return db[_0x0f5e('0x2c')]['create'](_0x56169e[_0x0f5e('0x4a')],{})['then'](respondWithResult(_0x5a6e33,0xc9))[_0x0f5e('0x48')](handleError(_0x5a6e33,null));};exports[_0x0f5e('0x4b')]=function(_0x2e06e3,_0x5ebb43){if(_0x2e06e3[_0x0f5e('0x4a')]['id']){delete _0x2e06e3[_0x0f5e('0x4a')]['id'];}return db[_0x0f5e('0x2c')][_0x0f5e('0x47')]({'where':{'id':_0x2e06e3['params']['id']}})[_0x0f5e('0x26')](handleEntityNotFound(_0x5ebb43,null))[_0x0f5e('0x26')](saveUpdates(_0x2e06e3[_0x0f5e('0x4a')],null))[_0x0f5e('0x26')](respondWithResult(_0x5ebb43,null))[_0x0f5e('0x48')](handleError(_0x5ebb43,null));};exports[_0x0f5e('0x4c')]=function(_0x5ed306,_0x33859e){return db[_0x0f5e('0x2c')][_0x0f5e('0x47')]({'where':{'id':_0x5ed306[_0x0f5e('0x43')]['id']}})[_0x0f5e('0x26')](handleEntityNotFound(_0x33859e,null))[_0x0f5e('0x26')](removeEntity(_0x33859e,null))[_0x0f5e('0x48')](handleError(_0x33859e,null));};exports[_0x0f5e('0x4d')]=function(_0x5bb27c,_0xd76e4d){return db[_0x0f5e('0x2c')]['describe']()[_0x0f5e('0x26')](respondWithResult(_0xd76e4d,null))[_0x0f5e('0x48')](handleError(_0xd76e4d,null));};exports[_0x0f5e('0x4e')]=function(_0x101d2a,_0xbb867f,_0x24567b){var _0x3f5082={'raw':!![],'where':{}};var _0x1341e2={};var _0x4f45b1={'count':0x0,'rows':[]};return db[_0x0f5e('0x2c')][_0x0f5e('0x4f')]({'where':{'id':_0x101d2a[_0x0f5e('0x43')]['id']}})['then'](handleEntityNotFound(_0xbb867f,null))['then'](function(_0x1536a5){if(_0x1536a5){_0x1341e2[_0x0f5e('0x34')]=_[_0x0f5e('0x32')](db['JscriptyQuestionReport'][_0x0f5e('0x2d')]);_0x1341e2[_0x0f5e('0x31')]=_[_0x0f5e('0x32')](_0x101d2a[_0x0f5e('0x31')]);_0x1341e2[_0x0f5e('0x3c')]=_['intersection'](_0x1341e2[_0x0f5e('0x34')],_0x1341e2[_0x0f5e('0x31')]);_0x3f5082[_0x0f5e('0x35')]=_[_0x0f5e('0x33')](_0x1341e2[_0x0f5e('0x34')],qs[_0x0f5e('0x36')](_0x101d2a[_0x0f5e('0x31')][_0x0f5e('0x36')]));_0x3f5082[_0x0f5e('0x35')]=_0x3f5082[_0x0f5e('0x35')]['length']?_0x3f5082['attributes']:_0x1341e2['model'];if(!_0x101d2a[_0x0f5e('0x31')]['hasOwnProperty'](_0x0f5e('0x38'))){_0x3f5082[_0x0f5e('0x1f')]=qs['limit'](_0x101d2a[_0x0f5e('0x31')][_0x0f5e('0x1f')]);_0x3f5082[_0x0f5e('0x1d')]=qs['offset'](_0x101d2a[_0x0f5e('0x31')][_0x0f5e('0x1d')]);}_0x3f5082[_0x0f5e('0x50')]=qs['sort'](_0x101d2a['query'][_0x0f5e('0x39')]);_0x3f5082[_0x0f5e('0x3a')]=qs[_0x0f5e('0x3c')](_[_0x0f5e('0x3b')](_0x101d2a[_0x0f5e('0x31')],_0x1341e2['filters']));_0x3f5082['where'][_0x0f5e('0x51')]=_0x1536a5['id'];if(_0x101d2a[_0x0f5e('0x31')][_0x0f5e('0x3d')]){_0x3f5082[_0x0f5e('0x3a')]=_[_0x0f5e('0x3e')](_0x3f5082[_0x0f5e('0x3a')],{'$or':_[_0x0f5e('0x2b')](_0x3f5082[_0x0f5e('0x35')],function(_0x2bc2b8){var _0x54f1db={};_0x54f1db[_0x2bc2b8]={'$like':'%'+_0x101d2a[_0x0f5e('0x31')][_0x0f5e('0x3d')]+'%'};return _0x54f1db;})});}_0x3f5082=_['merge']({},_0x3f5082,_0x101d2a[_0x0f5e('0x40')]);return db[_0x0f5e('0x52')][_0x0f5e('0x20')]({'where':_0x3f5082['where']})[_0x0f5e('0x26')](function(_0x28410a){_0x4f45b1[_0x0f5e('0x20')]=_0x28410a;if(_0x101d2a[_0x0f5e('0x31')][_0x0f5e('0x45')]){_0x3f5082[_0x0f5e('0x46')]=[{'all':!![]}];}return db[_0x0f5e('0x52')][_0x0f5e('0x53')](_0x3f5082);})[_0x0f5e('0x26')](function(_0x563516){_0x4f45b1[_0x0f5e('0x41')]=_0x563516;return _0x4f45b1;});}})[_0x0f5e('0x26')](respondWithFilteredResult(_0xbb867f,_0x3f5082))[_0x0f5e('0x48')](handleError(_0xbb867f,null));};
\ No newline at end of file
+var _0xdfc8=['params','length','find','catch','create','body','describe','findOne','JscriptyQuestionReport','order','SessionId','findAll','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','error','stack','name','index','map','JscriptySessionReport','rawAttributes','fieldName','key','model','keys','query','attributes','intersection','fields','hasOwnProperty','sort','where','filters','pick','merge','type','filter','options','includeAll','rows'];(function(_0x32171e,_0x2a2a78){var _0x396dd3=function(_0x3727c7){while(--_0x3727c7){_0x32171e['push'](_0x32171e['shift']());}};_0x396dd3(++_0x2a2a78);}(_0xdfc8,0x138));var _0x8dfc=function(_0x54edca,_0x3d4479){_0x54edca=_0x54edca-0x0;var _0x5bb342=_0xdfc8[_0x54edca];return _0x5bb342;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8dfc('0x0'));var zipdir=require(_0x8dfc('0x1'));var jsonpatch=require(_0x8dfc('0x2'));var rp=require(_0x8dfc('0x3'));var moment=require(_0x8dfc('0x4'));var BPromise=require(_0x8dfc('0x5'));var Mustache=require(_0x8dfc('0x6'));var util=require('util');var path=require(_0x8dfc('0x7'));var sox=require(_0x8dfc('0x8'));var csv=require(_0x8dfc('0x9'));var ejs=require(_0x8dfc('0xa'));var fs=require('fs');var fs_extra=require(_0x8dfc('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8dfc('0xc'));var jsforce=require(_0x8dfc('0xd'));var deskjs=require(_0x8dfc('0xe'));var toCsv=require(_0x8dfc('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8dfc('0xf'));var authService=require(_0x8dfc('0x10'));var qs=require(_0x8dfc('0x11'));var as=require(_0x8dfc('0x12'));var hardwareService=require(_0x8dfc('0x13'));var logger=require(_0x8dfc('0x14'))(_0x8dfc('0x15'));var utils=require(_0x8dfc('0x16'));var config=require(_0x8dfc('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x338e43,_0x23248d){_0x23248d=_0x23248d||0xcc;return function(_0x2ca7a6){if(_0x2ca7a6){return _0x338e43[_0x8dfc('0x18')](_0x23248d);}return _0x338e43[_0x8dfc('0x19')](_0x23248d)['end']();};}function respondWithResult(_0x1359de,_0x836b72){_0x836b72=_0x836b72||0xc8;return function(_0x463fa2){if(_0x463fa2){return _0x1359de[_0x8dfc('0x19')](_0x836b72)[_0x8dfc('0x1a')](_0x463fa2);}};}function respondWithFilteredResult(_0x5b4d0c,_0x59e846){return function(_0x4dedd7){if(_0x4dedd7){var _0x3b2e8c=typeof _0x59e846[_0x8dfc('0x1b')]===_0x8dfc('0x1c')&&typeof _0x59e846[_0x8dfc('0x1d')]===_0x8dfc('0x1c');var _0x5ecd1c=_0x4dedd7[_0x8dfc('0x1e')];var _0x443f4a=_0x3b2e8c?0x0:_0x59e846[_0x8dfc('0x1b')];var _0x768c14=_0x3b2e8c?_0x4dedd7[_0x8dfc('0x1e')]:_0x59e846[_0x8dfc('0x1b')]+_0x59e846[_0x8dfc('0x1d')];var _0x2d2bbc;if(_0x768c14>=_0x5ecd1c){_0x768c14=_0x5ecd1c;_0x2d2bbc=0xc8;}else{_0x2d2bbc=0xce;}_0x5b4d0c[_0x8dfc('0x19')](_0x2d2bbc);return _0x5b4d0c[_0x8dfc('0x1f')](_0x8dfc('0x20'),_0x443f4a+'-'+_0x768c14+'/'+_0x5ecd1c)[_0x8dfc('0x1a')](_0x4dedd7);}return null;};}function patchUpdates(_0x342eaf){return function(_0x2ec2c1){try{jsonpatch[_0x8dfc('0x21')](_0x2ec2c1,_0x342eaf,!![]);}catch(_0x396951){return BPromise['reject'](_0x396951);}return _0x2ec2c1[_0x8dfc('0x22')]();};}function saveUpdates(_0x540838,_0x38fe64){return function(_0x304c4c){if(_0x304c4c){return _0x304c4c['update'](_0x540838)[_0x8dfc('0x23')](function(_0x4d583d){return _0x4d583d;});}return null;};}function removeEntity(_0x1335f5,_0x422317){return function(_0x28bda9){if(_0x28bda9){return _0x28bda9[_0x8dfc('0x24')]()[_0x8dfc('0x23')](function(){_0x1335f5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d18c2,_0x52ae69){return function(_0x3a5a3e){if(!_0x3a5a3e){_0x3d18c2[_0x8dfc('0x18')](0x194);}return _0x3a5a3e;};}function handleError(_0x3c25d0,_0xad04c4){_0xad04c4=_0xad04c4||0x1f4;return function(_0x35ad90){logger[_0x8dfc('0x25')](_0x35ad90[_0x8dfc('0x26')]);if(_0x35ad90['name']){delete _0x35ad90[_0x8dfc('0x27')];}_0x3c25d0[_0x8dfc('0x19')](_0xad04c4)['send'](_0x35ad90);};}exports[_0x8dfc('0x28')]=function(_0x1fa078,_0xcefd34){var _0x469c1f={},_0x1e4a9b={},_0x2fe44e={'count':0x0,'rows':[]};var _0x47f8d6=_[_0x8dfc('0x29')](db[_0x8dfc('0x2a')][_0x8dfc('0x2b')],function(_0x5dc478){return{'name':_0x5dc478[_0x8dfc('0x2c')],'type':_0x5dc478['type'][_0x8dfc('0x2d')]};});_0x1e4a9b[_0x8dfc('0x2e')]=_[_0x8dfc('0x29')](_0x47f8d6,_0x8dfc('0x27'));_0x1e4a9b['query']=_[_0x8dfc('0x2f')](_0x1fa078[_0x8dfc('0x30')]);_0x1e4a9b['filters']=_['intersection'](_0x1e4a9b[_0x8dfc('0x2e')],_0x1e4a9b[_0x8dfc('0x30')]);_0x469c1f[_0x8dfc('0x31')]=_[_0x8dfc('0x32')](_0x1e4a9b['model'],qs[_0x8dfc('0x33')](_0x1fa078[_0x8dfc('0x30')][_0x8dfc('0x33')]));_0x469c1f[_0x8dfc('0x31')]=_0x469c1f[_0x8dfc('0x31')]['length']?_0x469c1f['attributes']:_0x1e4a9b[_0x8dfc('0x2e')];if(!_0x1fa078['query'][_0x8dfc('0x34')]('nolimit')){_0x469c1f[_0x8dfc('0x1d')]=qs[_0x8dfc('0x1d')](_0x1fa078[_0x8dfc('0x30')][_0x8dfc('0x1d')]);_0x469c1f[_0x8dfc('0x1b')]=qs[_0x8dfc('0x1b')](_0x1fa078[_0x8dfc('0x30')][_0x8dfc('0x1b')]);}_0x469c1f['order']=qs[_0x8dfc('0x35')](_0x1fa078[_0x8dfc('0x30')][_0x8dfc('0x35')]);_0x469c1f[_0x8dfc('0x36')]=qs[_0x8dfc('0x37')](_[_0x8dfc('0x38')](_0x1fa078[_0x8dfc('0x30')],_0x1e4a9b[_0x8dfc('0x37')]),_0x47f8d6);if(_0x1fa078[_0x8dfc('0x30')]['filter']){_0x469c1f['where']=_[_0x8dfc('0x39')](_0x469c1f[_0x8dfc('0x36')],{'$or':_[_0x8dfc('0x29')](_0x47f8d6,function(_0x56d3db){if(_0x56d3db[_0x8dfc('0x3a')]!=='VIRTUAL'){var _0x473ab5={};_0x473ab5[_0x56d3db[_0x8dfc('0x27')]]={'$like':'%'+_0x1fa078[_0x8dfc('0x30')][_0x8dfc('0x3b')]+'%'};return _0x473ab5;}})});}_0x469c1f=_[_0x8dfc('0x39')]({},_0x469c1f,_0x1fa078[_0x8dfc('0x3c')]);var _0x1e8635={'where':_0x469c1f['where']};return db[_0x8dfc('0x2a')][_0x8dfc('0x1e')](_0x1e8635)[_0x8dfc('0x23')](function(_0x1c6786){_0x2fe44e[_0x8dfc('0x1e')]=_0x1c6786;if(_0x1fa078[_0x8dfc('0x30')][_0x8dfc('0x3d')]){_0x469c1f['include']=[{'all':!![]}];}return db[_0x8dfc('0x2a')]['findAll'](_0x469c1f);})[_0x8dfc('0x23')](function(_0x51d1f6){_0x2fe44e[_0x8dfc('0x3e')]=_0x51d1f6;return _0x2fe44e;})[_0x8dfc('0x23')](respondWithFilteredResult(_0xcefd34,_0x469c1f))['catch'](handleError(_0xcefd34,null));};exports['show']=function(_0x34a462,_0x2c199a){var _0x3b796e={'raw':!![],'where':{'id':_0x34a462[_0x8dfc('0x3f')]['id']}},_0x5a5a4f={};_0x5a5a4f[_0x8dfc('0x2e')]=_[_0x8dfc('0x2f')](db[_0x8dfc('0x2a')][_0x8dfc('0x2b')]);_0x5a5a4f[_0x8dfc('0x30')]=_['keys'](_0x34a462['query']);_0x5a5a4f[_0x8dfc('0x37')]=_['intersection'](_0x5a5a4f[_0x8dfc('0x2e')],_0x5a5a4f[_0x8dfc('0x30')]);_0x3b796e[_0x8dfc('0x31')]=_[_0x8dfc('0x32')](_0x5a5a4f[_0x8dfc('0x2e')],qs[_0x8dfc('0x33')](_0x34a462['query'][_0x8dfc('0x33')]));_0x3b796e['attributes']=_0x3b796e['attributes'][_0x8dfc('0x40')]?_0x3b796e[_0x8dfc('0x31')]:_0x5a5a4f[_0x8dfc('0x2e')];if(_0x34a462['query']['includeAll']){_0x3b796e['include']=[{'all':!![]}];}_0x3b796e=_[_0x8dfc('0x39')]({},_0x3b796e,_0x34a462[_0x8dfc('0x3c')]);return db[_0x8dfc('0x2a')][_0x8dfc('0x41')](_0x3b796e)[_0x8dfc('0x23')](handleEntityNotFound(_0x2c199a,null))[_0x8dfc('0x23')](respondWithResult(_0x2c199a,null))[_0x8dfc('0x42')](handleError(_0x2c199a,null));};exports[_0x8dfc('0x43')]=function(_0x133b3c,_0x5eae7c){return db[_0x8dfc('0x2a')][_0x8dfc('0x43')](_0x133b3c[_0x8dfc('0x44')],{})[_0x8dfc('0x23')](respondWithResult(_0x5eae7c,0xc9))[_0x8dfc('0x42')](handleError(_0x5eae7c,null));};exports['update']=function(_0x3da783,_0x835ac2){if(_0x3da783[_0x8dfc('0x44')]['id']){delete _0x3da783[_0x8dfc('0x44')]['id'];}return db[_0x8dfc('0x2a')][_0x8dfc('0x41')]({'where':{'id':_0x3da783[_0x8dfc('0x3f')]['id']}})[_0x8dfc('0x23')](handleEntityNotFound(_0x835ac2,null))[_0x8dfc('0x23')](saveUpdates(_0x3da783[_0x8dfc('0x44')],null))['then'](respondWithResult(_0x835ac2,null))[_0x8dfc('0x42')](handleError(_0x835ac2,null));};exports[_0x8dfc('0x24')]=function(_0x45903f,_0x5c626e){return db[_0x8dfc('0x2a')][_0x8dfc('0x41')]({'where':{'id':_0x45903f[_0x8dfc('0x3f')]['id']}})[_0x8dfc('0x23')](handleEntityNotFound(_0x5c626e,null))[_0x8dfc('0x23')](removeEntity(_0x5c626e,null))[_0x8dfc('0x42')](handleError(_0x5c626e,null));};exports[_0x8dfc('0x45')]=function(_0x201fb6,_0x504289){return db['JscriptySessionReport'][_0x8dfc('0x45')]()['then'](respondWithResult(_0x504289,null))[_0x8dfc('0x42')](handleError(_0x504289,null));};exports['getQuestions']=function(_0x453376,_0x3bceb5,_0x17322d){var _0x1f84ea={'raw':!![],'where':{}};var _0x1a3c43={};var _0x3c3641={'count':0x0,'rows':[]};return db[_0x8dfc('0x2a')][_0x8dfc('0x46')]({'where':{'id':_0x453376[_0x8dfc('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3bceb5,null))['then'](function(_0x36b5c4){if(_0x36b5c4){_0x1a3c43[_0x8dfc('0x2e')]=_['keys'](db[_0x8dfc('0x47')][_0x8dfc('0x2b')]);_0x1a3c43['query']=_[_0x8dfc('0x2f')](_0x453376[_0x8dfc('0x30')]);_0x1a3c43[_0x8dfc('0x37')]=_['intersection'](_0x1a3c43[_0x8dfc('0x2e')],_0x1a3c43[_0x8dfc('0x30')]);_0x1f84ea[_0x8dfc('0x31')]=_[_0x8dfc('0x32')](_0x1a3c43[_0x8dfc('0x2e')],qs[_0x8dfc('0x33')](_0x453376[_0x8dfc('0x30')][_0x8dfc('0x33')]));_0x1f84ea[_0x8dfc('0x31')]=_0x1f84ea[_0x8dfc('0x31')][_0x8dfc('0x40')]?_0x1f84ea[_0x8dfc('0x31')]:_0x1a3c43[_0x8dfc('0x2e')];if(!_0x453376[_0x8dfc('0x30')][_0x8dfc('0x34')]('nolimit')){_0x1f84ea[_0x8dfc('0x1d')]=qs['limit'](_0x453376[_0x8dfc('0x30')][_0x8dfc('0x1d')]);_0x1f84ea[_0x8dfc('0x1b')]=qs['offset'](_0x453376[_0x8dfc('0x30')][_0x8dfc('0x1b')]);}_0x1f84ea[_0x8dfc('0x48')]=qs[_0x8dfc('0x35')](_0x453376[_0x8dfc('0x30')]['sort']);_0x1f84ea[_0x8dfc('0x36')]=qs[_0x8dfc('0x37')](_[_0x8dfc('0x38')](_0x453376[_0x8dfc('0x30')],_0x1a3c43['filters']));_0x1f84ea[_0x8dfc('0x36')][_0x8dfc('0x49')]=_0x36b5c4['id'];if(_0x453376['query'][_0x8dfc('0x3b')]){_0x1f84ea[_0x8dfc('0x36')]=_[_0x8dfc('0x39')](_0x1f84ea[_0x8dfc('0x36')],{'$or':_[_0x8dfc('0x29')](_0x1f84ea['attributes'],function(_0x1624df){var _0x1363ce={};_0x1363ce[_0x1624df]={'$like':'%'+_0x453376[_0x8dfc('0x30')][_0x8dfc('0x3b')]+'%'};return _0x1363ce;})});}_0x1f84ea=_[_0x8dfc('0x39')]({},_0x1f84ea,_0x453376[_0x8dfc('0x3c')]);return db[_0x8dfc('0x47')]['count']({'where':_0x1f84ea['where']})[_0x8dfc('0x23')](function(_0x54bd1c){_0x3c3641['count']=_0x54bd1c;if(_0x453376['query']['includeAll']){_0x1f84ea['include']=[{'all':!![]}];}return db[_0x8dfc('0x47')][_0x8dfc('0x4a')](_0x1f84ea);})[_0x8dfc('0x23')](function(_0x4aeb44){_0x3c3641[_0x8dfc('0x3e')]=_0x4aeb44;return _0x3c3641;});}})['then'](respondWithFilteredResult(_0x3bceb5,_0x1f84ea))[_0x8dfc('0x42')](handleError(_0x3bceb5,null));};
\ No newline at end of file
index 499934d..9714141 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f4d=['api','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x0f4d,0x12c));var _0xd0f4=function(_0x34e9bb,_0x539990){_0x34e9bb=_0x34e9bb-0x0;var _0xe00de=_0x0f4d[_0x34e9bb];return _0xe00de;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xd0f4('0x0'));var moment=require('moment');var BPromise=require(_0xd0f4('0x1'));var rp=require(_0xd0f4('0x2'));var fs=require('fs');var path=require(_0xd0f4('0x3'));var rimraf=require(_0xd0f4('0x4'));var config=require(_0xd0f4('0x5'));var attributes=require(_0xd0f4('0x6'));module[_0xd0f4('0x7')]=function(_0x1d9a9d,_0x531f85){return _0x1d9a9d[_0xd0f4('0x8')](_0xd0f4('0x9'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x723e=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','define','JscriptySessionReport','report_jscripty_sessions'];(function(_0xd02def,_0x144f25){var _0x2e8374=function(_0x5ceb35){while(--_0x5ceb35){_0xd02def['push'](_0xd02def['shift']());}};_0x2e8374(++_0x144f25);}(_0x723e,0x179));var _0xe723=function(_0x4cc492,_0x162c85){_0x4cc492=_0x4cc492-0x0;var _0x1f36b9=_0x723e[_0x4cc492];return _0x1f36b9;};'use strict';var _=require('lodash');var util=require(_0xe723('0x0'));var logger=require(_0xe723('0x1'))(_0xe723('0x2'));var moment=require(_0xe723('0x3'));var BPromise=require(_0xe723('0x4'));var rp=require(_0xe723('0x5'));var fs=require('fs');var path=require(_0xe723('0x6'));var rimraf=require(_0xe723('0x7'));var config=require(_0xe723('0x8'));var attributes=require(_0xe723('0x9'));module['exports']=function(_0x32d689,_0x20c13b){return _0x32d689[_0xe723('0xa')](_0xe723('0xb'),attributes,{'tableName':_0xe723('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5ea3225..678c06f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x47c5=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x21de89,_0x367053){var _0x290b7e=function(_0x540704){while(--_0x540704){_0x21de89['push'](_0x21de89['shift']());}};_0x290b7e(++_0x367053);}(_0x47c5,0x165));var _0x547c=function(_0x37b4a1,_0x583392){_0x37b4a1=_0x37b4a1-0x0;var _0x4e968d=_0x47c5[_0x37b4a1];return _0x4e968d;};'use strict';var _=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var moment=require(_0x547c('0x2'));var BPromise=require(_0x547c('0x3'));var rs=require(_0x547c('0x4'));var fs=require('fs');var Redis=require(_0x547c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x547c('0x6'));var logger=require(_0x547c('0x7'))('rpc');var config=require(_0x547c('0x8'));var jayson=require(_0x547c('0x9'));var client=jayson['client'][_0x547c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x439f25,_0x381f2e,_0x10a334){return new BPromise(function(_0x12fb7d,_0x4ef079){return client[_0x547c('0xb')](_0x439f25,_0x10a334)[_0x547c('0xc')](function(_0x10dec9){logger[_0x547c('0xd')](_0x547c('0xe'),_0x381f2e,_0x547c('0xf'));logger[_0x547c('0x10')](_0x547c('0x11'),_0x381f2e,_0x547c('0xf'),JSON[_0x547c('0x12')](_0x10dec9));if(_0x10dec9[_0x547c('0x13')]){if(_0x10dec9['error'][_0x547c('0x14')]===0x1f4){logger[_0x547c('0x13')]('JscriptySessionReport,\x20%s,\x20%s',_0x381f2e,_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);return _0x4ef079(_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);}logger[_0x547c('0x13')](_0x547c('0xe'),_0x381f2e,_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);return _0x12fb7d(_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);}else{logger[_0x547c('0xd')](_0x547c('0xe'),_0x381f2e,_0x547c('0xf'));_0x12fb7d(_0x10dec9[_0x547c('0x16')][_0x547c('0x15')]);}})[_0x547c('0x17')](function(_0x39498d){logger[_0x547c('0x13')]('JscriptySessionReport,\x20%s,\x20%s',_0x381f2e,_0x39498d);_0x4ef079(_0x39498d);});});}
\ No newline at end of file
+var _0x0424=['request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','JscriptySessionReport,\x20%s,\x20%s'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0x0424,0x159));var _0x4042=function(_0x1b515f,_0x52aa6b){_0x1b515f=_0x1b515f-0x0;var _0x66ff73=_0x0424[_0x1b515f];return _0x66ff73;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4042('0x0'));var BPromise=require(_0x4042('0x1'));var rs=require(_0x4042('0x2'));var fs=require('fs');var Redis=require(_0x4042('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4042('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x4042('0x5'));var jayson=require(_0x4042('0x6'));var client=jayson[_0x4042('0x7')][_0x4042('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3abaf1,_0xa5310f,_0x10ec07){return new BPromise(function(_0x5d11bf,_0x509772){return client[_0x4042('0x9')](_0x3abaf1,_0x10ec07)[_0x4042('0xa')](function(_0x103e4a){logger['info'](_0x4042('0xb'),_0xa5310f,_0x4042('0xc'));logger[_0x4042('0xd')](_0x4042('0xe'),_0xa5310f,_0x4042('0xc'),JSON[_0x4042('0xf')](_0x103e4a));if(_0x103e4a[_0x4042('0x10')]){if(_0x103e4a[_0x4042('0x10')]['code']===0x1f4){logger[_0x4042('0x10')](_0x4042('0xb'),_0xa5310f,_0x103e4a['error'][_0x4042('0x11')]);return _0x509772(_0x103e4a[_0x4042('0x10')][_0x4042('0x11')]);}logger[_0x4042('0x10')](_0x4042('0xb'),_0xa5310f,_0x103e4a[_0x4042('0x10')][_0x4042('0x11')]);return _0x5d11bf(_0x103e4a['error'][_0x4042('0x11')]);}else{logger[_0x4042('0x12')]('JscriptySessionReport,\x20%s,\x20%s',_0xa5310f,_0x4042('0xc'));_0x5d11bf(_0x103e4a[_0x4042('0x13')][_0x4042('0x11')]);}})[_0x4042('0x14')](function(_0x31e765){logger[_0x4042('0x10')](_0x4042('0xb'),_0xa5310f,_0x31e765);_0x509772(_0x31e765);});});}
\ No newline at end of file
index aee3a9e..a448ec4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd69=['get','index','put','/:id','isAuthenticated','update','/download_log_file','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4bd231,_0x2caca0){var _0x271d79=function(_0x15ac4f){while(--_0x15ac4f){_0x4bd231['push'](_0x4bd231['shift']());}};_0x271d79(++_0x2caca0);}(_0xdd69,0x160));var _0x9dd6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xdd69[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x9dd6('0x0'));var util=require(_0x9dd6('0x1'));var path=require(_0x9dd6('0x2'));var timeout=require(_0x9dd6('0x3'));var express=require(_0x9dd6('0x4'));var router=express['Router']();var fs_extra=require(_0x9dd6('0x5'));var auth=require(_0x9dd6('0x6'));var interaction=require(_0x9dd6('0x7'));var config=require('../../config/environment');var controller=require('./license.controller');router[_0x9dd6('0x8')]('/',controller[_0x9dd6('0x9')]);router[_0x9dd6('0xa')](_0x9dd6('0xb'),auth[_0x9dd6('0xc')](),controller[_0x9dd6('0xd')]);router['get'](_0x9dd6('0xe'),auth[_0x9dd6('0xc')](),controller['downloadLogFile']);module['exports']=router;
\ No newline at end of file
+var _0x1df5=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','put','/:id','isAuthenticated','update','/download_log_file','downloadLogFile','exports'];(function(_0x5d2b67,_0xdea376){var _0x7000d6=function(_0x3b9f80){while(--_0x3b9f80){_0x5d2b67['push'](_0x5d2b67['shift']());}};_0x7000d6(++_0xdea376);}(_0x1df5,0x100));var _0x51df=function(_0x35f21e,_0x53c54d){_0x35f21e=_0x35f21e-0x0;var _0xbed9d7=_0x1df5[_0x35f21e];return _0xbed9d7;};'use strict';var multer=require(_0x51df('0x0'));var util=require(_0x51df('0x1'));var path=require(_0x51df('0x2'));var timeout=require(_0x51df('0x3'));var express=require('express');var router=express[_0x51df('0x4')]();var fs_extra=require(_0x51df('0x5'));var auth=require(_0x51df('0x6'));var interaction=require(_0x51df('0x7'));var config=require('../../config/environment');var controller=require('./license.controller');router[_0x51df('0x8')]('/',controller['index']);router[_0x51df('0x9')](_0x51df('0xa'),auth[_0x51df('0xb')](),controller[_0x51df('0xc')]);router[_0x51df('0x8')](_0x51df('0xd'),auth[_0x51df('0xb')](),controller[_0x51df('0xe')]);module[_0x51df('0xf')]=router;
\ No newline at end of file
index 4b3a6ab..81616c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7300=['INTEGER','sequelize','exports','STRING'];(function(_0x5504fc,_0x2e161c){var _0xbad34c=function(_0x1f62de){while(--_0x1f62de){_0x5504fc['push'](_0x5504fc['shift']());}};_0xbad34c(++_0x2e161c);}(_0x7300,0xb9));var _0x0730=function(_0x66ee53,_0xf7b3d6){_0x66ee53=_0x66ee53-0x0;var _0x40a0f5=_0x7300[_0x66ee53];return _0x40a0f5;};'use strict';var Sequelize=require(_0x0730('0x0'));module[_0x0730('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0x0730('0x2')]},'data2':{'type':Sequelize[_0x0730('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x0730('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x56a8=['STRING','INTEGER','TEXT'];(function(_0x3b9c02,_0x24655d){var _0x2bc33e=function(_0x5786b7){while(--_0x5786b7){_0x3b9c02['push'](_0x3b9c02['shift']());}};_0x2bc33e(++_0x24655d);}(_0x56a8,0x1ee));var _0x856a=function(_0xaf3910,_0x36fde3){_0xaf3910=_0xaf3910-0x0;var _0x3e70de=_0x56a8[_0xaf3910];return _0x3e70de;};'use strict';var Sequelize=require('sequelize');module['exports']={'license':{'type':Sequelize[_0x856a('0x0')]},'data1':{'type':Sequelize[_0x856a('0x1')]},'data2':{'type':Sequelize[_0x856a('0x1')]},'chatLicenseExceeded':{'type':Sequelize[_0x856a('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 4ca1b73..7c062e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ef1=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','undefined','count','offset','limit','set','Content-Range','json','reject','save','then','destroy','sendStatus','name','model','keys','License','rawAttributes','query','filters','intersection','fields','attributes','length','merge','options','getLicense','catch','body','params','downloadLogFile','license-info.log','join','setHeader','attachment;\x20filename=','Content-Type','text/plain','download','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x16e884,_0x364a0e){var _0x3da2b5=function(_0x19e4e4){while(--_0x19e4e4){_0x16e884['push'](_0x16e884['shift']());}};_0x3da2b5(++_0x364a0e);}(_0x4ef1,0x7a));var _0x14ef=function(_0x383339,_0x3d185b){_0x383339=_0x383339-0x0;var _0x1f5132=_0x4ef1[_0x383339];return _0x1f5132;};'use strict';var emlformat=require(_0x14ef('0x0'));var rimraf=require(_0x14ef('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x14ef('0x2'));var rp=require(_0x14ef('0x3'));var moment=require(_0x14ef('0x4'));var BPromise=require(_0x14ef('0x5'));var Mustache=require(_0x14ef('0x6'));var util=require(_0x14ef('0x7'));var path=require(_0x14ef('0x8'));var sox=require(_0x14ef('0x9'));var csv=require(_0x14ef('0xa'));var ejs=require(_0x14ef('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x14ef('0xc'));var squel=require(_0x14ef('0xd'));var crypto=require(_0x14ef('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x14ef('0xf'));var toCsv=require('to-csv');var querystring=require(_0x14ef('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x14ef('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x14ef('0x12'));var logger=require('../../config/logger')(_0x14ef('0x13'));var utils=require(_0x14ef('0x14'));var config=require(_0x14ef('0x15'));var licenseUtil=require(_0x14ef('0x16'));var db=require(_0x14ef('0x17'))['db'];function respondWithStatusCode(_0x21ee21,_0x410d1e){_0x410d1e=_0x410d1e||0xcc;return function(_0x3658c8){if(_0x3658c8){return _0x21ee21['sendStatus'](_0x410d1e);}return _0x21ee21['status'](_0x410d1e)[_0x14ef('0x18')]();};}function respondWithResult(_0x2c5f26,_0x4e4cb0){_0x4e4cb0=_0x4e4cb0||0xc8;return function(_0x3d93d8){if(_0x3d93d8){return _0x2c5f26[_0x14ef('0x19')](_0x4e4cb0)['json'](_0x3d93d8);}};}function respondWithFilteredResult(_0x28045e,_0x2d6dff){return function(_0x4b8cfa){if(_0x4b8cfa){var _0x23dd6e=typeof _0x2d6dff['offset']===_0x14ef('0x1a')&&typeof _0x2d6dff['limit']===_0x14ef('0x1a');var _0x47c44e=_0x4b8cfa[_0x14ef('0x1b')];var _0xca1c6f=_0x23dd6e?0x0:_0x2d6dff['offset'];var _0x446afb=_0x23dd6e?_0x4b8cfa[_0x14ef('0x1b')]:_0x2d6dff[_0x14ef('0x1c')]+_0x2d6dff[_0x14ef('0x1d')];var _0x97606d;if(_0x446afb>=_0x47c44e){_0x446afb=_0x47c44e;_0x97606d=0xc8;}else{_0x97606d=0xce;}_0x28045e[_0x14ef('0x19')](_0x97606d);return _0x28045e[_0x14ef('0x1e')](_0x14ef('0x1f'),_0xca1c6f+'-'+_0x446afb+'/'+_0x47c44e)[_0x14ef('0x20')](_0x4b8cfa);}return null;};}function patchUpdates(_0x4c716e){return function(_0x9f30ee){try{jsonpatch['apply'](_0x9f30ee,_0x4c716e,!![]);}catch(_0x9753bd){return BPromise[_0x14ef('0x21')](_0x9753bd);}return _0x9f30ee[_0x14ef('0x22')]();};}function saveUpdates(_0x42948d,_0x5b6e27){return function(_0x687b70){if(_0x687b70){return _0x687b70['update'](_0x42948d)[_0x14ef('0x23')](function(_0x3e6cbe){return _0x3e6cbe;});}return null;};}function removeEntity(_0x506be9,_0x11f264){return function(_0x5d09fd){if(_0x5d09fd){return _0x5d09fd[_0x14ef('0x24')]()[_0x14ef('0x23')](function(){_0x506be9[_0x14ef('0x19')](0xcc)[_0x14ef('0x18')]();});}};}function handleEntityNotFound(_0x2b51ea,_0x1b6010){return function(_0x5e03da){if(!_0x5e03da){_0x2b51ea[_0x14ef('0x25')](0x194);}return _0x5e03da;};}function handleError(_0x3f5cef,_0x5420b7){_0x5420b7=_0x5420b7||0x1f4;return function(_0x509756){logger['error'](_0x509756['stack']);if(_0x509756[_0x14ef('0x26')]){delete _0x509756[_0x14ef('0x26')];}_0x3f5cef['status'](_0x5420b7)['send'](_0x509756);};}var utilLicense=require(_0x14ef('0x16'));exports['index']=function(_0xb4daa1,_0x2e9c6c){var _0x16d859={'raw':!![],'where':{'id':0x1}},_0x46d0f0={};_0x46d0f0[_0x14ef('0x27')]=_[_0x14ef('0x28')](db[_0x14ef('0x29')][_0x14ef('0x2a')]);_0x46d0f0[_0x14ef('0x2b')]=_[_0x14ef('0x28')](_0xb4daa1['query']);_0x46d0f0[_0x14ef('0x2c')]=_['intersection'](_0x46d0f0['model'],_0x46d0f0['query']);_0x16d859['attributes']=_[_0x14ef('0x2d')](_0x46d0f0['model'],qs['fields'](_0xb4daa1[_0x14ef('0x2b')][_0x14ef('0x2e')]));_0x16d859[_0x14ef('0x2f')]=_0x16d859[_0x14ef('0x2f')][_0x14ef('0x30')]?_0x16d859[_0x14ef('0x2f')]:_0x46d0f0[_0x14ef('0x27')];_0x16d859=_[_0x14ef('0x31')]({},_0x16d859,_0xb4daa1[_0x14ef('0x32')]);return utilLicense[_0x14ef('0x33')](_0x16d859)[_0x14ef('0x23')](respondWithResult(_0x2e9c6c,null))[_0x14ef('0x34')](handleError(_0x2e9c6c,null));};exports['update']=function(_0xd46ebe,_0x33fc62){if(_0xd46ebe[_0x14ef('0x35')]['id']){delete _0xd46ebe[_0x14ef('0x35')]['id'];}return db['License']['find']({'where':{'id':_0xd46ebe[_0x14ef('0x36')]['id']}})['then'](handleEntityNotFound(_0x33fc62,null))[_0x14ef('0x23')](function(_0x2629a0){var _0x135176=_0x2629a0['get']({'plain':!![]});return utilLicense['checkLicense'](_0x135176,_0xd46ebe[_0x14ef('0x35')]['key']);})[_0x14ef('0x23')](function(_0x9aeed3){if(!_0x9aeed3['demo']){return saveUpdates(_0xd46ebe['body'],null);}return _0x9aeed3;})['then'](respondWithResult(_0x33fc62,null))[_0x14ef('0x34')](handleError(_0x33fc62,null));};exports[_0x14ef('0x37')]=function(_0x4bb09d,_0x33c13f){var _0x2b099a=_0x14ef('0x38');var _0x479643=path[_0x14ef('0x39')]('/var','log','xcally',_0x2b099a);_0x33c13f[_0x14ef('0x3a')]('Content-disposition',_0x14ef('0x3b')+_0x2b099a);_0x33c13f[_0x14ef('0x1e')](_0x14ef('0x3c'),_0x14ef('0x3d'));_0x33c13f[_0x14ef('0x3e')](_0x479643);};
\ No newline at end of file
+var _0x4184=['request-promise','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','update','destroy','then','error','stack','index','model','keys','License','rawAttributes','query','filters','intersection','attributes','fields','length','options','getLicense','catch','body','params','checkLicense','key','demo','downloadLogFile','join','/var','xcally','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','download','eml-format','rimraf'];(function(_0x7762d6,_0x1934b7){var _0x2627c3=function(_0x2fcf01){while(--_0x2fcf01){_0x7762d6['push'](_0x7762d6['shift']());}};_0x2627c3(++_0x1934b7);}(_0x4184,0x80));var _0x4418=function(_0x2ded7a,_0x288919){_0x2ded7a=_0x2ded7a-0x0;var _0xa9d0a0=_0x4184[_0x2ded7a];return _0xa9d0a0;};'use strict';var emlformat=require(_0x4418('0x0'));var rimraf=require(_0x4418('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4418('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4418('0x3'));var util=require('util');var path=require(_0x4418('0x4'));var sox=require('sox');var csv=require(_0x4418('0x5'));var ejs=require(_0x4418('0x6'));var fs=require('fs');var fs_extra=require(_0x4418('0x7'));var _=require(_0x4418('0x8'));var squel=require(_0x4418('0x9'));var crypto=require(_0x4418('0xa'));var jsforce=require(_0x4418('0xb'));var deskjs=require(_0x4418('0xc'));var toCsv=require(_0x4418('0x5'));var querystring=require('querystring');var Papa=require(_0x4418('0xd'));var Redis=require(_0x4418('0xe'));var authService=require(_0x4418('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x4418('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4418('0x11'))('api');var utils=require(_0x4418('0x12'));var config=require(_0x4418('0x13'));var licenseUtil=require(_0x4418('0x14'));var db=require(_0x4418('0x15'))['db'];function respondWithStatusCode(_0x104255,_0x5590f9){_0x5590f9=_0x5590f9||0xcc;return function(_0x2a78bb){if(_0x2a78bb){return _0x104255[_0x4418('0x16')](_0x5590f9);}return _0x104255[_0x4418('0x17')](_0x5590f9)['end']();};}function respondWithResult(_0x4be540,_0x2e2911){_0x2e2911=_0x2e2911||0xc8;return function(_0x4eb5b3){if(_0x4eb5b3){return _0x4be540[_0x4418('0x17')](_0x2e2911)['json'](_0x4eb5b3);}};}function respondWithFilteredResult(_0x887449,_0x11c802){return function(_0x4a874b){if(_0x4a874b){var _0x3cd85c=typeof _0x11c802[_0x4418('0x18')]===_0x4418('0x19')&&typeof _0x11c802[_0x4418('0x1a')]===_0x4418('0x19');var _0x1a1cfc=_0x4a874b['count'];var _0x1976cc=_0x3cd85c?0x0:_0x11c802[_0x4418('0x18')];var _0x324eb6=_0x3cd85c?_0x4a874b[_0x4418('0x1b')]:_0x11c802[_0x4418('0x18')]+_0x11c802[_0x4418('0x1a')];var _0x121f41;if(_0x324eb6>=_0x1a1cfc){_0x324eb6=_0x1a1cfc;_0x121f41=0xc8;}else{_0x121f41=0xce;}_0x887449[_0x4418('0x17')](_0x121f41);return _0x887449[_0x4418('0x1c')]('Content-Range',_0x1976cc+'-'+_0x324eb6+'/'+_0x1a1cfc)[_0x4418('0x1d')](_0x4a874b);}return null;};}function patchUpdates(_0x2e2d6f){return function(_0x569dc3){try{jsonpatch[_0x4418('0x1e')](_0x569dc3,_0x2e2d6f,!![]);}catch(_0x527eb7){return BPromise[_0x4418('0x1f')](_0x527eb7);}return _0x569dc3['save']();};}function saveUpdates(_0xc1fb8d,_0x4de987){return function(_0x3ff757){if(_0x3ff757){return _0x3ff757[_0x4418('0x20')](_0xc1fb8d)['then'](function(_0x3e6a25){return _0x3e6a25;});}return null;};}function removeEntity(_0x15d5e6,_0x28627d){return function(_0x293c64){if(_0x293c64){return _0x293c64[_0x4418('0x21')]()[_0x4418('0x22')](function(){_0x15d5e6[_0x4418('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1250eb,_0x3499f3){return function(_0x4a0980){if(!_0x4a0980){_0x1250eb[_0x4418('0x16')](0x194);}return _0x4a0980;};}function handleError(_0xcf1902,_0x5e2a7e){_0x5e2a7e=_0x5e2a7e||0x1f4;return function(_0x46d461){logger[_0x4418('0x23')](_0x46d461[_0x4418('0x24')]);if(_0x46d461['name']){delete _0x46d461['name'];}_0xcf1902[_0x4418('0x17')](_0x5e2a7e)['send'](_0x46d461);};}var utilLicense=require('../../config/license/util');exports[_0x4418('0x25')]=function(_0x33f728,_0x2e82c0){var _0x51b258={'raw':!![],'where':{'id':0x1}},_0x542664={};_0x542664[_0x4418('0x26')]=_[_0x4418('0x27')](db[_0x4418('0x28')][_0x4418('0x29')]);_0x542664[_0x4418('0x2a')]=_[_0x4418('0x27')](_0x33f728['query']);_0x542664[_0x4418('0x2b')]=_[_0x4418('0x2c')](_0x542664[_0x4418('0x26')],_0x542664[_0x4418('0x2a')]);_0x51b258[_0x4418('0x2d')]=_[_0x4418('0x2c')](_0x542664[_0x4418('0x26')],qs[_0x4418('0x2e')](_0x33f728[_0x4418('0x2a')]['fields']));_0x51b258[_0x4418('0x2d')]=_0x51b258['attributes'][_0x4418('0x2f')]?_0x51b258['attributes']:_0x542664[_0x4418('0x26')];_0x51b258=_['merge']({},_0x51b258,_0x33f728[_0x4418('0x30')]);return utilLicense[_0x4418('0x31')](_0x51b258)['then'](respondWithResult(_0x2e82c0,null))[_0x4418('0x32')](handleError(_0x2e82c0,null));};exports[_0x4418('0x20')]=function(_0x503166,_0x10d22c){if(_0x503166[_0x4418('0x33')]['id']){delete _0x503166['body']['id'];}return db['License']['find']({'where':{'id':_0x503166[_0x4418('0x34')]['id']}})['then'](handleEntityNotFound(_0x10d22c,null))[_0x4418('0x22')](function(_0x5d0f7b){var _0x323006=_0x5d0f7b['get']({'plain':!![]});return utilLicense[_0x4418('0x35')](_0x323006,_0x503166[_0x4418('0x33')][_0x4418('0x36')]);})[_0x4418('0x22')](function(_0x5aa0b2){if(!_0x5aa0b2[_0x4418('0x37')]){return saveUpdates(_0x503166[_0x4418('0x33')],null);}return _0x5aa0b2;})[_0x4418('0x22')](respondWithResult(_0x10d22c,null))['catch'](handleError(_0x10d22c,null));};exports[_0x4418('0x38')]=function(_0x5f2cb5,_0x4cdcc9){var _0x41fc01='license-info.log';var _0x158a06=path[_0x4418('0x39')](_0x4418('0x3a'),'log',_0x4418('0x3b'),_0x41fc01);_0x4cdcc9[_0x4418('0x3c')](_0x4418('0x3d'),_0x4418('0x3e')+_0x41fc01);_0x4cdcc9[_0x4418('0x1c')](_0x4418('0x3f'),'text/plain');_0x4cdcc9[_0x4418('0x40')](_0x158a06);};
\ No newline at end of file
index f421bf5..26e7ae5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd0b=['./license.attributes','exports','define','license','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2132a3,_0x4639e9){var _0x21890c=function(_0x34b73d){while(--_0x34b73d){_0x2132a3['push'](_0x2132a3['shift']());}};_0x21890c(++_0x4639e9);}(_0xdd0b,0x122));var _0xbdd0=function(_0xb4ef7b,_0x3e64f3){_0xb4ef7b=_0xb4ef7b-0x0;var _0x61b25e=_0xdd0b[_0xb4ef7b];return _0x61b25e;};'use strict';var _=require(_0xbdd0('0x0'));var util=require(_0xbdd0('0x1'));var logger=require(_0xbdd0('0x2'))(_0xbdd0('0x3'));var moment=require(_0xbdd0('0x4'));var BPromise=require(_0xbdd0('0x5'));var rp=require(_0xbdd0('0x6'));var fs=require('fs');var path=require(_0xbdd0('0x7'));var rimraf=require(_0xbdd0('0x8'));var config=require('../../config/environment');var attributes=require(_0xbdd0('0x9'));module[_0xbdd0('0xa')]=function(_0x40e749,_0x5e79f1){return _0x40e749[_0xbdd0('0xb')]('License',attributes,{'tableName':_0xbdd0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9261=['License','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./license.attributes','exports','define'];(function(_0x221eb2,_0x2d65bc){var _0x3760ee=function(_0x3a88ee){while(--_0x3a88ee){_0x221eb2['push'](_0x221eb2['shift']());}};_0x3760ee(++_0x2d65bc);}(_0x9261,0x12c));var _0x1926=function(_0x479509,_0x1daf8a){_0x479509=_0x479509-0x0;var _0x382da8=_0x9261[_0x479509];return _0x382da8;};'use strict';var _=require(_0x1926('0x0'));var util=require(_0x1926('0x1'));var logger=require(_0x1926('0x2'))('api');var moment=require(_0x1926('0x3'));var BPromise=require(_0x1926('0x4'));var rp=require(_0x1926('0x5'));var fs=require('fs');var path=require(_0x1926('0x6'));var rimraf=require(_0x1926('0x7'));var config=require(_0x1926('0x8'));var attributes=require(_0x1926('0x9'));module[_0x1926('0xa')]=function(_0x383a00,_0x210cfb){return _0x383a00[_0x1926('0xb')](_0x1926('0xc'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f278261..100988f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe949=['client','http','request','then','info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise'];(function(_0x277649,_0x4d54fd){var _0x5702f7=function(_0x49c6fd){while(--_0x49c6fd){_0x277649['push'](_0x277649['shift']());}};_0x5702f7(++_0x4d54fd);}(_0xe949,0x17e));var _0x9e94=function(_0x14d55f,_0xaa0e97){_0x14d55f=_0x14d55f-0x0;var _0x576412=_0xe949[_0x14d55f];return _0x576412;};'use strict';var _=require(_0x9e94('0x0'));var util=require(_0x9e94('0x1'));var moment=require(_0x9e94('0x2'));var BPromise=require(_0x9e94('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9e94('0x4'));var db=require(_0x9e94('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9e94('0x6'));var config=require(_0x9e94('0x7'));var jayson=require(_0x9e94('0x8'));var client=jayson[_0x9e94('0x9')][_0x9e94('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x14080f,_0x166d17,_0x5242df){return new BPromise(function(_0x1b7c6a,_0x5b456a){return client[_0x9e94('0xb')](_0x14080f,_0x5242df)[_0x9e94('0xc')](function(_0x4c7fdc){logger[_0x9e94('0xd')](_0x9e94('0xe'),_0x166d17,'request\x20sent');logger[_0x9e94('0xf')](_0x9e94('0x10'),_0x166d17,_0x9e94('0x11'),JSON[_0x9e94('0x12')](_0x4c7fdc));if(_0x4c7fdc[_0x9e94('0x13')]){if(_0x4c7fdc['error'][_0x9e94('0x14')]===0x1f4){logger[_0x9e94('0x13')](_0x9e94('0xe'),_0x166d17,_0x4c7fdc[_0x9e94('0x13')][_0x9e94('0x15')]);return _0x5b456a(_0x4c7fdc[_0x9e94('0x13')][_0x9e94('0x15')]);}logger['error'](_0x9e94('0xe'),_0x166d17,_0x4c7fdc[_0x9e94('0x13')][_0x9e94('0x15')]);return _0x1b7c6a(_0x4c7fdc[_0x9e94('0x13')][_0x9e94('0x15')]);}else{logger[_0x9e94('0xd')](_0x9e94('0xe'),_0x166d17,_0x9e94('0x11'));_0x1b7c6a(_0x4c7fdc[_0x9e94('0x16')]['message']);}})['catch'](function(_0x419dc7){logger[_0x9e94('0x13')](_0x9e94('0xe'),_0x166d17,_0x419dc7);_0x5b456a(_0x419dc7);});});}
\ No newline at end of file
+var _0x064a=['request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify','error','code','License,\x20%s,\x20%s','message','result','catch','lodash','util','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x4ad58e,_0x399f26){var _0x50bf23=function(_0xd8a9da){while(--_0xd8a9da){_0x4ad58e['push'](_0x4ad58e['shift']());}};_0x50bf23(++_0x399f26);}(_0x064a,0x1c2));var _0xa064=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x064a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xa064('0x0'));var util=require(_0xa064('0x1'));var moment=require(_0xa064('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(_0xa064('0x3'));var logger=require(_0xa064('0x4'))(_0xa064('0x5'));var config=require(_0xa064('0x6'));var jayson=require(_0xa064('0x7'));var client=jayson[_0xa064('0x8')][_0xa064('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x18d628,_0x3988ee,_0x5bd409){return new BPromise(function(_0x49ae62,_0x1fafb3){return client['request'](_0x18d628,_0x5bd409)[_0xa064('0xa')](function(_0x7392ea){logger[_0xa064('0xb')]('License,\x20%s,\x20%s',_0x3988ee,_0xa064('0xc'));logger['debug'](_0xa064('0xd'),_0x3988ee,_0xa064('0xc'),JSON[_0xa064('0xe')](_0x7392ea));if(_0x7392ea[_0xa064('0xf')]){if(_0x7392ea[_0xa064('0xf')][_0xa064('0x10')]===0x1f4){logger[_0xa064('0xf')](_0xa064('0x11'),_0x3988ee,_0x7392ea['error']['message']);return _0x1fafb3(_0x7392ea[_0xa064('0xf')][_0xa064('0x12')]);}logger['error'](_0xa064('0x11'),_0x3988ee,_0x7392ea[_0xa064('0xf')][_0xa064('0x12')]);return _0x49ae62(_0x7392ea[_0xa064('0xf')][_0xa064('0x12')]);}else{logger[_0xa064('0xb')](_0xa064('0x11'),_0x3988ee,'request\x20sent');_0x49ae62(_0x7392ea[_0xa064('0x13')][_0xa064('0x12')]);}})[_0xa064('0x14')](function(_0x2d356b){logger[_0xa064('0xf')]('License,\x20%s,\x20%s',_0x3988ee,_0x2d356b);_0x1fafb3(_0x2d356b);});});}
\ No newline at end of file
index 795b017..d1de2d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7198=['describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/in_servers','/:id/out_servers','getSmtp','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','verifySmtp','/:id/users','post','addAnswer','create','addImap','/:id/interactions','addInteraction','addApplications','send','addAgents','put','delete','removeDispositions','removeAnswers','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','index','isAuthenticated'];(function(_0x301c34,_0x15701e){var _0x1a8c5a=function(_0x297b4f){while(--_0x297b4f){_0x301c34['push'](_0x301c34['shift']());}};_0x1a8c5a(++_0x15701e);}(_0x7198,0x16e));var _0x8719=function(_0x123772,_0x1508dd){_0x123772=_0x123772-0x0;var _0x4bc86e=_0x7198[_0x123772];return _0x4bc86e;};'use strict';var multer=require(_0x8719('0x0'));var util=require(_0x8719('0x1'));var path=require(_0x8719('0x2'));var timeout=require('connect-timeout');var express=require(_0x8719('0x3'));var router=express['Router']();var fs_extra=require(_0x8719('0x4'));var auth=require(_0x8719('0x5'));var interaction=require(_0x8719('0x6'));var config=require(_0x8719('0x7'));var controller=require(_0x8719('0x8'));router[_0x8719('0x9')]('/',auth['isAuthenticated'](),controller[_0x8719('0xa')]);router[_0x8719('0x9')]('/describe',auth[_0x8719('0xb')](),controller[_0x8719('0xc')]);router[_0x8719('0x9')](_0x8719('0xd'),auth[_0x8719('0xb')](),controller[_0x8719('0xe')]);router[_0x8719('0x9')](_0x8719('0xf'),auth[_0x8719('0xb')](),controller[_0x8719('0x10')]);router['get']('/:id/canned_answers',auth[_0x8719('0xb')](),controller[_0x8719('0x11')]);router[_0x8719('0x9')](_0x8719('0x12'),auth['isAuthenticated'](),controller['getImap']);router['get'](_0x8719('0x13'),auth[_0x8719('0xb')](),controller[_0x8719('0x14')]);router[_0x8719('0x9')]('/:id/interactions',auth[_0x8719('0xb')](),controller[_0x8719('0x15')]);router[_0x8719('0x9')](_0x8719('0x16'),auth[_0x8719('0xb')](),controller[_0x8719('0x17')]);router[_0x8719('0x9')](_0x8719('0x18'),auth[_0x8719('0xb')](),controller[_0x8719('0x19')]);router[_0x8719('0x9')]('/:id/verify',auth[_0x8719('0xb')](),controller[_0x8719('0x1a')]);router['get'](_0x8719('0x1b'),auth[_0x8719('0xb')](),controller['getAgents']);router[_0x8719('0x1c')](_0x8719('0xf'),auth[_0x8719('0xb')](),controller['addDisposition']);router[_0x8719('0x1c')]('/:id/canned_answers',auth[_0x8719('0xb')](),controller[_0x8719('0x1d')]);router[_0x8719('0x1c')]('/',auth['isAuthenticated'](),controller[_0x8719('0x1e')]);router['post'](_0x8719('0x12'),auth[_0x8719('0xb')](),controller[_0x8719('0x1f')]);router[_0x8719('0x1c')]('/:id/out_servers',auth['isAuthenticated'](),controller['addSmtp']);router['post'](_0x8719('0x20'),auth[_0x8719('0xb')](),controller[_0x8719('0x21')]);router[_0x8719('0x1c')](_0x8719('0x16'),auth[_0x8719('0xb')](),controller[_0x8719('0x22')]);router[_0x8719('0x1c')]('/:id/send',auth[_0x8719('0xb')](),controller[_0x8719('0x23')]);router[_0x8719('0x1c')]('/:id/users',auth[_0x8719('0xb')](),controller[_0x8719('0x24')]);router[_0x8719('0x25')](_0x8719('0xd'),auth[_0x8719('0xb')](),controller['update']);router[_0x8719('0x26')](_0x8719('0xf'),auth[_0x8719('0xb')](),controller[_0x8719('0x27')]);router[_0x8719('0x26')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x8719('0x28')]);router[_0x8719('0x26')](_0x8719('0x12'),auth[_0x8719('0xb')](),controller['removeImap']);router[_0x8719('0x26')]('/:id/out_servers',auth[_0x8719('0xb')](),controller['removeSmtp']);router[_0x8719('0x26')]('/:id',auth[_0x8719('0xb')](),controller['destroy']);router[_0x8719('0x26')](_0x8719('0x1b'),auth[_0x8719('0xb')](),controller['removeAgents']);module[_0x8719('0x29')]=router;
\ No newline at end of file
+var _0x3800=['/:id/send','send','/:id/users','addAgents','put','/:id','update','removeDispositions','delete','removeImap','destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/in_servers','getSmtp','/:id/interactions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','post','addDisposition','addAnswer','create','addImap','/:id/out_servers','addInteraction','addApplications'];(function(_0x1349be,_0x50d323){var _0x49c99a=function(_0x59502a){while(--_0x59502a){_0x1349be['push'](_0x1349be['shift']());}};_0x49c99a(++_0x50d323);}(_0x3800,0x1f0));var _0x0380=function(_0x4e5dd4,_0xe3b641){_0x4e5dd4=_0x4e5dd4-0x0;var _0x42b694=_0x3800[_0x4e5dd4];return _0x42b694;};'use strict';var multer=require(_0x0380('0x0'));var util=require(_0x0380('0x1'));var path=require(_0x0380('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x0380('0x3'));var auth=require(_0x0380('0x4'));var interaction=require(_0x0380('0x5'));var config=require(_0x0380('0x6'));var controller=require('./mailAccount.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0380('0x7')]);router[_0x0380('0x8')]('/describe',auth[_0x0380('0x9')](),controller[_0x0380('0xa')]);router['get']('/:id',auth[_0x0380('0x9')](),controller[_0x0380('0xb')]);router['get'](_0x0380('0xc'),auth[_0x0380('0x9')](),controller[_0x0380('0xd')]);router['get'](_0x0380('0xe'),auth[_0x0380('0x9')](),controller['getAnswers']);router[_0x0380('0x8')](_0x0380('0xf'),auth['isAuthenticated'](),controller['getImap']);router[_0x0380('0x8')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0x0380('0x10')]);router['get'](_0x0380('0x11'),auth['isAuthenticated'](),controller['getInteractions']);router[_0x0380('0x8')](_0x0380('0x12'),auth[_0x0380('0x9')](),controller[_0x0380('0x13')]);router[_0x0380('0x8')](_0x0380('0x14'),auth['isAuthenticated'](),controller[_0x0380('0x15')]);router[_0x0380('0x8')](_0x0380('0x16'),auth[_0x0380('0x9')](),controller[_0x0380('0x17')]);router[_0x0380('0x8')]('/:id/users',auth[_0x0380('0x9')](),controller['getAgents']);router[_0x0380('0x18')](_0x0380('0xc'),auth[_0x0380('0x9')](),controller[_0x0380('0x19')]);router['post'](_0x0380('0xe'),auth['isAuthenticated'](),controller[_0x0380('0x1a')]);router['post']('/',auth[_0x0380('0x9')](),controller[_0x0380('0x1b')]);router['post']('/:id/in_servers',auth['isAuthenticated'](),controller[_0x0380('0x1c')]);router[_0x0380('0x18')](_0x0380('0x1d'),auth[_0x0380('0x9')](),controller['addSmtp']);router[_0x0380('0x18')](_0x0380('0x11'),auth['isAuthenticated'](),controller[_0x0380('0x1e')]);router[_0x0380('0x18')]('/:id/applications',auth[_0x0380('0x9')](),controller[_0x0380('0x1f')]);router['post'](_0x0380('0x20'),auth[_0x0380('0x9')](),controller[_0x0380('0x21')]);router[_0x0380('0x18')](_0x0380('0x22'),auth[_0x0380('0x9')](),controller[_0x0380('0x23')]);router[_0x0380('0x24')](_0x0380('0x25'),auth[_0x0380('0x9')](),controller[_0x0380('0x26')]);router['delete'](_0x0380('0xc'),auth['isAuthenticated'](),controller[_0x0380('0x27')]);router['delete'](_0x0380('0xe'),auth[_0x0380('0x9')](),controller['removeAnswers']);router[_0x0380('0x28')](_0x0380('0xf'),auth['isAuthenticated'](),controller[_0x0380('0x29')]);router[_0x0380('0x28')](_0x0380('0x1d'),auth['isAuthenticated'](),controller['removeSmtp']);router[_0x0380('0x28')]('/:id',auth[_0x0380('0x9')](),controller[_0x0380('0x2a')]);router[_0x0380('0x28')](_0x0380('0x22'),auth[_0x0380('0x9')](),controller['removeAgents']);module[_0x0380('0x2b')]=router;
\ No newline at end of file
index 449a38c..c66d6e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc9a=['setDataValue','mandatoryDisposition','ENUM','gmail','hotmail','yahoo','outlook365','getDataValue','provider','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}<br/>Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x2e1c65,_0x594099){var _0x22c7fb=function(_0x934c93){while(--_0x934c93){_0x2e1c65['push'](_0x2e1c65['shift']());}};_0x22c7fb(++_0x594099);}(_0xcc9a,0xa9));var _0xacc9=function(_0x21ab24,_0xabe2f9){_0x21ab24=_0x21ab24-0x0;var _0x3b44b5=_0xcc9a[_0x21ab24];return _0x3b44b5;};'use strict';var Sequelize=require(_0xacc9('0x0'));module[_0xacc9('0x1')]={'description':{'type':Sequelize[_0xacc9('0x2')]},'name':{'type':Sequelize[_0xacc9('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xacc9('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xacc9('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0xacc9('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0xacc9('0x4')]},'markAsUnread':{'type':Sequelize[_0xacc9('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xacc9('0x5')},'fontSize':{'type':Sequelize[_0xacc9('0x6')](0x2)[_0xacc9('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xacc9('0x4')],'defaultValue':function(){return _0xacc9('0x8');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xacc9('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xacc9('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xacc9('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xacc9('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xacc9('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xacc9('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xacc9('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xacc9('0x3')],'defaultValue':![],'comment':_0xacc9('0xa'),'set':function(_0x44abe7){if(!_0x44abe7)this[_0xacc9('0xb')]('mandatoryDispositionPauseId',null);this[_0xacc9('0xb')](_0xacc9('0xc'),_0x44abe7);}},'provider':{'type':Sequelize[_0xacc9('0xd')](_0xacc9('0xe'),_0xacc9('0xf'),_0xacc9('0x10'),_0xacc9('0x11')),'defaultValue':null,'get':function(){if(!this[_0xacc9('0x12')](_0xacc9('0x13')))return'custom';return this[_0xacc9('0x12')](_0xacc9('0x13'));},'set':function(_0x5214a8){if(_0x5214a8==='custom')_0x5214a8=null;return this[_0xacc9('0xb')](_0xacc9('0x13'),_0x5214a8);}}};
\ No newline at end of file
+var _0xc443=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','hotmail','yahoo','outlook365','getDataValue','provider','custom','exports','STRING','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}<br/>Subject\x20:\x20{{message.subject}}','BOOLEAN'];(function(_0x3b348b,_0x1b3d67){var _0x14cc65=function(_0xcd270c){while(--_0xcd270c){_0x3b348b['push'](_0x3b348b['shift']());}};_0x14cc65(++_0x1b3d67);}(_0xc443,0x1db));var _0x3c44=function(_0x4d1d4f,_0x5c8f6e){_0x4d1d4f=_0x4d1d4f-0x0;var _0x4624a0=_0xc443[_0x4d1d4f];return _0x4624a0;};'use strict';var Sequelize=require('sequelize');module[_0x3c44('0x0')]={'description':{'type':Sequelize[_0x3c44('0x1')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x3c44('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x3c44('0x2')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x3c44('0x1')],'allowNull':![],'defaultValue':_0x3c44('0x3')},'fontSize':{'type':Sequelize[_0x3c44('0x4')](0x2)[_0x3c44('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x3c44('0x2')],'defaultValue':function(){return _0x3c44('0x6');}},'notificationSound':{'type':Sequelize[_0x3c44('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3c44('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3c44('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x3c44('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3c44('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3c44('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3c44('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x3c44('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x3c44('0x7')],'defaultValue':![],'comment':_0x3c44('0x9'),'set':function(_0x2285db){if(!_0x2285db)this[_0x3c44('0xa')](_0x3c44('0xb'),null);this[_0x3c44('0xa')](_0x3c44('0xc'),_0x2285db);}},'provider':{'type':Sequelize[_0x3c44('0xd')](_0x3c44('0xe'),_0x3c44('0xf'),_0x3c44('0x10'),_0x3c44('0x11')),'defaultValue':null,'get':function(){if(!this[_0x3c44('0x12')](_0x3c44('0x13')))return _0x3c44('0x14');return this[_0x3c44('0x12')](_0x3c44('0x13'));},'set':function(_0x19662e){if(_0x19662e==='custom')_0x19662e=null;return this[_0x3c44('0xa')](_0x3c44('0x13'),_0x19662e);}}};
\ No newline at end of file
index ae6b4df..4bbcb9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b12=['MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','destroy','MailAccounts','UserProfileResource','stack','name','provider','service','host','Smtp','port','secure','authentication','modernAuthentication','auth','OAuth2','user','CloudProvider','data5','pass','MailServerIn','Imap','MailServerOut','Pause','MailAccount','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','mandatoryDispositionPause','find','body','update','describe','addDisposition','MailAccountId','Disposition','create','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','ListId','active','description','username','password','CloudProviderId','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','getImap','findOne','addImap','setImap','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','Contact','User','Owner','internal','Tag','Tags','tag','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','send','getApplications','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','true','CmList','CmContact','Contacts','DESC','Smtp\x20configuration\x20not\x20found','isNil','from','email','attachments','root','server/files/attachments','basename','List\x20not\x20found','List','defaults','messageId','subject','attach','out','Interaction','verifySmtp','VerifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','moment','bluebird','util','lodash','ioredis','../../components/parsers/qs','api','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','then','info'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x5b12,0xa3));var _0x25b1=function(_0x3f41f4,_0x204d25){_0x3f41f4=_0x3f41f4-0x0;var _0x3046f4=_0x5b12[_0x3f41f4];return _0x3046f4;};'use strict';var moment=require(_0x25b1('0x0'));var BPromise=require(_0x25b1('0x1'));var util=require(_0x25b1('0x2'));var path=require('path');var _=require(_0x25b1('0x3'));var juice=require('juice');var Redis=require(_0x25b1('0x4'));var qs=require(_0x25b1('0x5'));var logger=require('../../config/logger')(_0x25b1('0x6'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x25b1('0x7')]=_['defaults'](config['redis'],{'host':_0x25b1('0x8'),'port':0x18eb});var socket=require(_0x25b1('0x9'))(new Redis(config[_0x25b1('0x7')]));require(_0x25b1('0xa'))[_0x25b1('0xb')](socket);var jayson=require(_0x25b1('0xc'));var client=jayson[_0x25b1('0xd')][_0x25b1('0xe')]({'port':0x232b});function respondWithRpcPromise(_0x5b7224,_0x2b739e,_0x1c28cf,_0x2cee35){return new BPromise(function(_0x34abe5,_0x37822f){var _0x8a71af=_0x2cee35||client;return _0x8a71af[_0x25b1('0xf')](_0x5b7224,_0x1c28cf)[_0x25b1('0x10')](function(_0x90a241){logger[_0x25b1('0x11')](_0x25b1('0x12'),_0x2b739e,_0x25b1('0x13'));logger[_0x25b1('0x14')](_0x25b1('0x15'),_0x2b739e,_0x25b1('0x13'),JSON[_0x25b1('0x16')](_0x90a241));if(_0x90a241['error']){if(_0x90a241[_0x25b1('0x17')][_0x25b1('0x18')]===0x1f4){logger['error'](_0x25b1('0x12'),_0x2b739e,_0x90a241[_0x25b1('0x17')][_0x25b1('0x19')]);return _0x37822f(_0x90a241['error']['message']);}logger[_0x25b1('0x17')]('MailAccount,\x20%s,\x20%s',_0x2b739e,_0x90a241[_0x25b1('0x17')][_0x25b1('0x19')]);return _0x34abe5(_0x90a241[_0x25b1('0x17')][_0x25b1('0x19')]);}else{logger[_0x25b1('0x11')](_0x25b1('0x12'),_0x2b739e,_0x25b1('0x13'));_0x34abe5(_0x90a241[_0x25b1('0x1a')]['message']);}})['catch'](function(_0x42a60e){logger['error'](_0x25b1('0x12'),_0x2b739e,_0x42a60e);_0x37822f(_0x42a60e);});});}function respondWithStatusCode(_0x50ae0f,_0x3bfd7d){_0x3bfd7d=_0x3bfd7d||0xcc;return function(_0x59aa37){if(_0x59aa37){return _0x50ae0f[_0x25b1('0x1b')](_0x3bfd7d);}return _0x50ae0f['status'](_0x3bfd7d)[_0x25b1('0x1c')]();};}function respondWithResult(_0x5b0be0,_0x4e3f48){_0x4e3f48=_0x4e3f48||0xc8;return function(_0x565cfd){if(_0x565cfd){return _0x5b0be0[_0x25b1('0x1d')](_0x4e3f48)[_0x25b1('0x1e')](_0x565cfd);}};}function respondWithFilteredResult(_0x4affba,_0x19bab8){return function(_0x26b555){if(_0x26b555){var _0x1e5915=typeof _0x19bab8[_0x25b1('0x1f')]===_0x25b1('0x20')&&typeof _0x19bab8['limit']===_0x25b1('0x20');var _0x23f20e=_0x26b555[_0x25b1('0x21')];var _0x282187=_0x1e5915?0x0:_0x19bab8[_0x25b1('0x1f')];var _0x1292bf=_0x1e5915?_0x26b555['count']:_0x19bab8[_0x25b1('0x1f')]+_0x19bab8[_0x25b1('0x22')];var _0x3d279f;if(_0x1292bf>=_0x23f20e){_0x1292bf=_0x23f20e;_0x3d279f=0xc8;}else{_0x3d279f=0xce;}_0x4affba['status'](_0x3d279f);return _0x4affba[_0x25b1('0x23')](_0x25b1('0x24'),_0x282187+'-'+_0x1292bf+'/'+_0x23f20e)[_0x25b1('0x1e')](_0x26b555);}return null;};}function saveUpdates(_0x584357){return function(_0x33baed){if(_0x33baed){return _0x33baed['update'](_0x584357)[_0x25b1('0x10')](function(_0x3febb8){return _0x3febb8;});}return null;};}function removeEntity(_0x3a4475){return function(_0x293413){if(_0x293413){return _0x293413[_0x25b1('0x25')]()[_0x25b1('0x10')](function(){var _0x46e429=_0x293413['get']({'plain':!![]});var _0x30d455=_0x25b1('0x26');return db[_0x25b1('0x27')][_0x25b1('0x25')]({'where':{'type':_0x30d455,'resourceId':_0x46e429['id']}})[_0x25b1('0x10')](function(){return _0x293413;});})['then'](function(){_0x3a4475[_0x25b1('0x1d')](0xcc)[_0x25b1('0x1c')]();});}};}function handleEntityNotFound(_0x42441d){return function(_0x1622e8){if(!_0x1622e8){_0x42441d[_0x25b1('0x1b')](0x194);}return _0x1622e8;};}function handleError(_0x5a4234,_0x5cbde5){_0x5cbde5=_0x5cbde5||0x1f4;return function(_0x5c3cf0){logger['error'](_0x5c3cf0[_0x25b1('0x28')]);if(_0x5c3cf0[_0x25b1('0x29')]){delete _0x5c3cf0[_0x25b1('0x29')];}_0x5a4234['status'](_0x5cbde5)['send'](_0x5c3cf0);};}function getSmtpOptions(_0x2e2e57){var _0x282ad7={'id':_0x2e2e57['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2e2e57[_0x25b1('0x2a')]!=='custom'){_0x282ad7[_0x25b1('0x2b')]=_0x2e2e57[_0x25b1('0x2a')];}else{_0x282ad7[_0x25b1('0x2c')]=_0x2e2e57[_0x25b1('0x2d')]['host'];_0x282ad7[_0x25b1('0x2e')]=_0x2e2e57[_0x25b1('0x2d')][_0x25b1('0x2e')];_0x282ad7['secure']=_0x2e2e57['Smtp'][_0x25b1('0x2f')];}if(_0x2e2e57['Smtp'][_0x25b1('0x30')]){if(_0x2e2e57[_0x25b1('0x2d')][_0x25b1('0x31')]){_0x282ad7[_0x25b1('0x32')]={'type':_0x25b1('0x33'),'user':_0x2e2e57[_0x25b1('0x2d')][_0x25b1('0x34')],'accessToken':_0x2e2e57[_0x25b1('0x2d')][_0x25b1('0x35')][_0x25b1('0x36')]};}else{_0x282ad7[_0x25b1('0x32')]={'user':_0x2e2e57[_0x25b1('0x2d')][_0x25b1('0x34')],'pass':_0x2e2e57[_0x25b1('0x2d')][_0x25b1('0x37')]};}}return _0x282ad7;}exports['index']=function(_0x472ed3,_0x3e23f7){var _0x53423d={'include':[{'model':db[_0x25b1('0x38')],'as':_0x25b1('0x39')},{'model':db[_0x25b1('0x3a')],'as':'Smtp'},{'model':db[_0x25b1('0x3b')],'as':'mandatoryDispositionPause'}]},_0x3c7bf2={},_0x39b68e={'count':0x0,'rows':[]};var _0x3cc009=_['map'](db[_0x25b1('0x3c')][_0x25b1('0x3d')],function(_0x1b354e){return{'name':_0x1b354e[_0x25b1('0x3e')],'type':_0x1b354e[_0x25b1('0x3f')][_0x25b1('0x40')]};});_0x3c7bf2[_0x25b1('0x41')]=_[_0x25b1('0x42')](_0x3cc009,_0x25b1('0x29'));_0x3c7bf2['query']=_[_0x25b1('0x43')](_0x472ed3['query']);_0x3c7bf2[_0x25b1('0x44')]=_[_0x25b1('0x45')](_0x3c7bf2['model'],_0x3c7bf2[_0x25b1('0x46')]);_0x53423d[_0x25b1('0x47')]=_[_0x25b1('0x45')](_0x3c7bf2[_0x25b1('0x41')],qs[_0x25b1('0x48')](_0x472ed3[_0x25b1('0x46')][_0x25b1('0x48')]));_0x53423d[_0x25b1('0x47')]=_0x53423d[_0x25b1('0x47')][_0x25b1('0x49')]?_0x53423d[_0x25b1('0x47')]:_0x3c7bf2[_0x25b1('0x41')];if(!_0x472ed3[_0x25b1('0x46')][_0x25b1('0x4a')](_0x25b1('0x4b'))){_0x53423d[_0x25b1('0x22')]=qs[_0x25b1('0x22')](_0x472ed3[_0x25b1('0x46')]['limit']);_0x53423d['offset']=qs['offset'](_0x472ed3[_0x25b1('0x46')]['offset']);}_0x53423d[_0x25b1('0x4c')]=qs['sort'](_0x472ed3[_0x25b1('0x46')][_0x25b1('0x4d')]);_0x53423d[_0x25b1('0x4e')]=qs[_0x25b1('0x44')](_[_0x25b1('0x4f')](_0x472ed3[_0x25b1('0x46')],_0x3c7bf2['filters']),_0x3cc009);if(_0x472ed3[_0x25b1('0x46')][_0x25b1('0x50')]){_0x53423d[_0x25b1('0x4e')]=_[_0x25b1('0x51')](_0x53423d['where'],{'$or':_[_0x25b1('0x42')](_0x3cc009,function(_0x27d8c6){if(_0x27d8c6[_0x25b1('0x3f')]!=='VIRTUAL'){var _0x18eb63={};_0x18eb63[_0x27d8c6['name']]={'$like':'%'+_0x472ed3[_0x25b1('0x46')]['filter']+'%'};return _0x18eb63;}})});}_0x53423d=_['merge']({},_0x53423d,_0x472ed3[_0x25b1('0x52')]);var _0xc5802b={'where':_0x53423d[_0x25b1('0x4e')]};return db[_0x25b1('0x3c')]['count'](_0xc5802b)[_0x25b1('0x10')](function(_0x58e612){_0x39b68e[_0x25b1('0x21')]=_0x58e612;if(_0x472ed3['query'][_0x25b1('0x53')]){_0x53423d[_0x25b1('0x54')]=[{'all':!![]}];}return db[_0x25b1('0x3c')]['findAll'](_0x53423d);})[_0x25b1('0x10')](function(_0x4680f2){_0x39b68e[_0x25b1('0x55')]=_0x4680f2;return _0x39b68e;})[_0x25b1('0x10')](respondWithFilteredResult(_0x3e23f7,_0x53423d))[_0x25b1('0x56')](handleError(_0x3e23f7,null));};exports[_0x25b1('0x57')]=function(_0x59859e,_0x134c64){var _0x133f50={'raw':![],'where':{'id':_0x59859e[_0x25b1('0x58')]['id']},'include':[{'model':db[_0x25b1('0x38')],'as':_0x25b1('0x39')},{'model':db[_0x25b1('0x3a')],'as':_0x25b1('0x2d')},{'model':db[_0x25b1('0x3b')],'as':_0x25b1('0x59')}]},_0x168931={};_0x168931[_0x25b1('0x41')]=_[_0x25b1('0x43')](db[_0x25b1('0x3c')][_0x25b1('0x3d')]);_0x168931[_0x25b1('0x46')]=_[_0x25b1('0x43')](_0x59859e[_0x25b1('0x46')]);_0x168931[_0x25b1('0x44')]=_['intersection'](_0x168931[_0x25b1('0x41')],_0x168931[_0x25b1('0x46')]);_0x133f50[_0x25b1('0x47')]=_[_0x25b1('0x45')](_0x168931[_0x25b1('0x41')],qs[_0x25b1('0x48')](_0x59859e['query'][_0x25b1('0x48')]));_0x133f50[_0x25b1('0x47')]=_0x133f50[_0x25b1('0x47')]['length']?_0x133f50[_0x25b1('0x47')]:_0x168931['model'];if(_0x59859e['query']['includeAll']){_0x133f50['include']=[{'all':!![]}];}_0x133f50=_[_0x25b1('0x51')]({},_0x133f50,_0x59859e['options']);return db[_0x25b1('0x3c')][_0x25b1('0x5a')](_0x133f50)[_0x25b1('0x10')](handleEntityNotFound(_0x134c64,null))[_0x25b1('0x10')](respondWithResult(_0x134c64,null))[_0x25b1('0x56')](handleError(_0x134c64,null));};exports['update']=function(_0xa96040,_0xa9902f){if(_0xa96040[_0x25b1('0x5b')]['id']){delete _0xa96040[_0x25b1('0x5b')]['id'];}if(_0xa96040['body'][_0x25b1('0x39')]){if(!_0xa96040[_0x25b1('0x5b')][_0x25b1('0x39')][_0x25b1('0x31')]){_0xa96040[_0x25b1('0x5b')][_0x25b1('0x39')]['CloudProviderId']=null;}}if(_0xa96040[_0x25b1('0x5b')]['Smtp']){if(!_0xa96040[_0x25b1('0x5b')][_0x25b1('0x2d')]['modernAuthentication']){_0xa96040[_0x25b1('0x5b')][_0x25b1('0x2d')]['CloudProviderId']=null;}}return db[_0x25b1('0x3c')][_0x25b1('0x5a')]({'where':{'id':_0xa96040[_0x25b1('0x58')]['id']},'include':[{'model':db[_0x25b1('0x38')],'as':_0x25b1('0x39')},{'model':db[_0x25b1('0x3a')],'as':_0x25b1('0x2d')},{'model':db[_0x25b1('0x3b')],'as':'mandatoryDispositionPause'}]})[_0x25b1('0x10')](handleEntityNotFound(_0xa9902f,null))[_0x25b1('0x10')](saveUpdates(_0xa96040[_0x25b1('0x5b')],null))[_0x25b1('0x10')](function(_0x1d0ab1){if(_0x1d0ab1&&_0xa96040[_0x25b1('0x5b')][_0x25b1('0x39')]){return db[_0x25b1('0x38')]['update'](_0xa96040[_0x25b1('0x5b')][_0x25b1('0x39')],{'where':{'MailAccountId':_0x1d0ab1['id']}})['then'](function(){return _0x1d0ab1;});}return _0x1d0ab1;})[_0x25b1('0x10')](function(_0x3eea55){if(_0x3eea55&&_0xa96040['body'][_0x25b1('0x2d')]){return db['MailServerOut'][_0x25b1('0x5c')](_0xa96040['body'][_0x25b1('0x2d')],{'where':{'MailAccountId':_0x3eea55['id']}})['then'](function(){return _0x3eea55;});}return _0x3eea55;})[_0x25b1('0x10')](respondWithResult(_0xa9902f,null))[_0x25b1('0x56')](handleError(_0xa9902f,null));};exports[_0x25b1('0x5d')]=function(_0x50bbb7,_0x492533){return db[_0x25b1('0x3c')][_0x25b1('0x5d')]()[_0x25b1('0x10')](respondWithResult(_0x492533,null))[_0x25b1('0x56')](handleError(_0x492533,null));};exports[_0x25b1('0x5e')]=function(_0x15ea73,_0x1ea9be){if(_0x15ea73[_0x25b1('0x5b')]['id']){delete _0x15ea73[_0x25b1('0x5b')]['id'];}return db[_0x25b1('0x3c')][_0x25b1('0x5a')]({'where':{'id':_0x15ea73[_0x25b1('0x58')]['id']}})[_0x25b1('0x10')](handleEntityNotFound(_0x1ea9be,null))[_0x25b1('0x10')](function(_0x1c22c4){if(_0x1c22c4){_0x15ea73[_0x25b1('0x5b')][_0x25b1('0x5f')]=_0x1c22c4['id'];return db[_0x25b1('0x60')][_0x25b1('0x61')](_0x15ea73[_0x25b1('0x5b')]);}})[_0x25b1('0x10')](respondWithResult(_0x1ea9be,null))[_0x25b1('0x56')](handleError(_0x1ea9be,null));};exports['getDispositions']=function(_0x1a3368,_0x4cf4c0){var _0x746cbc={'raw':![],'where':{}};var _0x37cfd6={};var _0x410227={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x1a3368[_0x25b1('0x58')]['id']}})[_0x25b1('0x10')](handleEntityNotFound(_0x4cf4c0,null))['then'](function(_0x371ee0){if(_0x371ee0){_0x37cfd6[_0x25b1('0x41')]=_[_0x25b1('0x43')](db['Disposition'][_0x25b1('0x3d')]);_0x37cfd6[_0x25b1('0x46')]=_[_0x25b1('0x43')](_0x1a3368[_0x25b1('0x46')]);_0x37cfd6['filters']=_[_0x25b1('0x45')](_0x37cfd6[_0x25b1('0x41')],_0x37cfd6[_0x25b1('0x46')]);_0x746cbc[_0x25b1('0x47')]=_[_0x25b1('0x45')](_0x37cfd6[_0x25b1('0x41')],qs['fields'](_0x1a3368[_0x25b1('0x46')][_0x25b1('0x48')]));_0x746cbc['attributes']=_0x746cbc['attributes'][_0x25b1('0x49')]?_0x746cbc[_0x25b1('0x47')]:_0x37cfd6[_0x25b1('0x41')];if(!_0x1a3368[_0x25b1('0x46')][_0x25b1('0x4a')](_0x25b1('0x4b'))){_0x746cbc[_0x25b1('0x22')]=qs['limit'](_0x1a3368[_0x25b1('0x46')][_0x25b1('0x22')]);_0x746cbc[_0x25b1('0x1f')]=qs[_0x25b1('0x1f')](_0x1a3368[_0x25b1('0x46')][_0x25b1('0x1f')]);}_0x746cbc[_0x25b1('0x4c')]=qs['sort'](_0x1a3368[_0x25b1('0x46')][_0x25b1('0x4d')]);_0x746cbc[_0x25b1('0x4e')]=qs[_0x25b1('0x44')](_[_0x25b1('0x4f')](_0x1a3368[_0x25b1('0x46')],_0x37cfd6[_0x25b1('0x44')]));_0x746cbc[_0x25b1('0x4e')][_0x25b1('0x5f')]=_0x371ee0['id'];if(_0x1a3368[_0x25b1('0x46')][_0x25b1('0x50')]){_0x746cbc['where']=_[_0x25b1('0x51')](_0x746cbc[_0x25b1('0x4e')],{'$or':_['map'](_0x746cbc[_0x25b1('0x47')],function(_0x45804b){var _0x3bb8c3={};_0x3bb8c3[_0x45804b]={'$like':'%'+_0x1a3368[_0x25b1('0x46')][_0x25b1('0x50')]+'%'};return _0x3bb8c3;})});}_0x746cbc=_['merge']({},_0x746cbc,_0x1a3368['options']);return db[_0x25b1('0x60')]['count']({'where':_0x746cbc[_0x25b1('0x4e')]})[_0x25b1('0x10')](function(_0x167c48){_0x410227[_0x25b1('0x21')]=_0x167c48;if(_0x1a3368[_0x25b1('0x46')][_0x25b1('0x53')]){_0x746cbc['include']=[{'all':!![]}];}return db[_0x25b1('0x60')][_0x25b1('0x62')](_0x746cbc);})[_0x25b1('0x10')](function(_0x2736c9){_0x410227['rows']=_0x2736c9;return _0x410227;});}})['then'](respondWithFilteredResult(_0x4cf4c0,_0x746cbc))['catch'](handleError(_0x4cf4c0,null));};exports[_0x25b1('0x63')]=function(_0xf8a96e,_0x583b5a){return db['MailAccount'][_0x25b1('0x5a')]({'where':{'id':_0xf8a96e[_0x25b1('0x58')]['id']}})[_0x25b1('0x10')](handleEntityNotFound(_0x583b5a,null))[_0x25b1('0x10')](function(_0x54e1a6){if(_0x54e1a6){return _0x54e1a6[_0x25b1('0x63')](_0xf8a96e[_0x25b1('0x46')][_0x25b1('0x64')]);}})[_0x25b1('0x10')](respondWithStatusCode(_0x583b5a,null))[_0x25b1('0x56')](handleError(_0x583b5a,null));};exports[_0x25b1('0x65')]=function(_0x175c72,_0x2d8a6a){if(_0x175c72['body']['id']){delete _0x175c72['body']['id'];}return db[_0x25b1('0x3c')][_0x25b1('0x5a')]({'where':{'id':_0x175c72['params']['id']}})['then'](handleEntityNotFound(_0x2d8a6a,null))[_0x25b1('0x10')](function(_0x139cb0){if(_0x139cb0){_0x175c72['body'][_0x25b1('0x5f')]=_0x139cb0['id'];return db[_0x25b1('0x66')][_0x25b1('0x61')](_0x175c72[_0x25b1('0x5b')]);}})[_0x25b1('0x10')](respondWithResult(_0x2d8a6a,null))[_0x25b1('0x56')](handleError(_0x2d8a6a,null));};exports[_0x25b1('0x67')]=function(_0x5c8fca,_0x3db302){var _0x151778={'raw':![],'where':{}};var _0x13848a={};var _0x4d99b3={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x5c8fca[_0x25b1('0x58')]['id']}})[_0x25b1('0x10')](handleEntityNotFound(_0x3db302,null))[_0x25b1('0x10')](function(_0x4f02a4){if(_0x4f02a4){_0x13848a['model']=_[_0x25b1('0x43')](db[_0x25b1('0x66')][_0x25b1('0x3d')]);_0x13848a[_0x25b1('0x46')]=_[_0x25b1('0x43')](_0x5c8fca[_0x25b1('0x46')]);_0x13848a[_0x25b1('0x44')]=_[_0x25b1('0x45')](_0x13848a[_0x25b1('0x41')],_0x13848a['query']);_0x151778[_0x25b1('0x47')]=_[_0x25b1('0x45')](_0x13848a['model'],qs['fields'](_0x5c8fca[_0x25b1('0x46')]['fields']));_0x151778[_0x25b1('0x47')]=_0x151778[_0x25b1('0x47')][_0x25b1('0x49')]?_0x151778['attributes']:_0x13848a['model'];if(!_0x5c8fca['query'][_0x25b1('0x4a')](_0x25b1('0x4b'))){_0x151778['limit']=qs[_0x25b1('0x22')](_0x5c8fca[_0x25b1('0x46')][_0x25b1('0x22')]);_0x151778[_0x25b1('0x1f')]=qs[_0x25b1('0x1f')](_0x5c8fca['query'][_0x25b1('0x1f')]);}_0x151778[_0x25b1('0x4c')]=qs['sort'](_0x5c8fca[_0x25b1('0x46')]['sort']);_0x151778[_0x25b1('0x4e')]=qs['filters'](_['pick'](_0x5c8fca[_0x25b1('0x46')],_0x13848a[_0x25b1('0x44')]));_0x151778[_0x25b1('0x4e')][_0x25b1('0x5f')]=_0x4f02a4['id'];if(_0x5c8fca[_0x25b1('0x46')]['filter']){_0x151778['where']=_[_0x25b1('0x51')](_0x151778['where'],{'$or':_[_0x25b1('0x42')](_0x151778[_0x25b1('0x47')],function(_0x25adcd){var _0x4911ad={};_0x4911ad[_0x25adcd]={'$like':'%'+_0x5c8fca[_0x25b1('0x46')]['filter']+'%'};return _0x4911ad;})});}_0x151778=_['merge']({},_0x151778,_0x5c8fca['options']);return db[_0x25b1('0x66')]['count']({'where':_0x151778[_0x25b1('0x4e')]})[_0x25b1('0x10')](function(_0x405ed0){_0x4d99b3[_0x25b1('0x21')]=_0x405ed0;if(_0x5c8fca[_0x25b1('0x46')][_0x25b1('0x53')]){_0x151778[_0x25b1('0x54')]=[{'all':!![]}];}return db[_0x25b1('0x66')][_0x25b1('0x62')](_0x151778);})[_0x25b1('0x10')](function(_0x1f61a8){_0x4d99b3[_0x25b1('0x55')]=_0x1f61a8;return _0x4d99b3;});}})[_0x25b1('0x10')](respondWithFilteredResult(_0x3db302,_0x151778))[_0x25b1('0x56')](handleError(_0x3db302,null));};exports[_0x25b1('0x68')]=function(_0x170661,_0x446212){return db['MailAccount'][_0x25b1('0x5a')]({'where':{'id':_0x170661['params']['id']}})[_0x25b1('0x10')](handleEntityNotFound(_0x446212,null))[_0x25b1('0x10')](function(_0x13555b){if(_0x13555b){return _0x13555b[_0x25b1('0x68')](_0x170661[_0x25b1('0x46')]['ids']);}})[_0x25b1('0x10')](respondWithStatusCode(_0x446212,null))[_0x25b1('0x56')](handleError(_0x446212,null));};exports[_0x25b1('0x61')]=function(_0x5af2b6,_0x339e82){var _0x17463c={'name':_0x5af2b6[_0x25b1('0x5b')][_0x25b1('0x29')],'key':_0x5af2b6['body'][_0x25b1('0x40')],'provider':_0x5af2b6[_0x25b1('0x5b')][_0x25b1('0x2a')]==='custom'?null:_0x5af2b6[_0x25b1('0x5b')][_0x25b1('0x2a')],'email':_0x5af2b6[_0x25b1('0x5b')]['email'],'ListId':_0x5af2b6[_0x25b1('0x5b')][_0x25b1('0x69')],'active':!_['isNil'](_0x5af2b6[_0x25b1('0x5b')][_0x25b1('0x6a')])?_0x5af2b6['body'][_0x25b1('0x6a')]:!![],'description':_0x5af2b6[_0x25b1('0x5b')][_0x25b1('0x6b')]||null,'Imap':{},'Smtp':{}};if(_0x17463c[_0x25b1('0x2a')]){_0x17463c[_0x25b1('0x39')][_0x25b1('0x34')]=_0x17463c['Smtp'][_0x25b1('0x34')]=_0x5af2b6[_0x25b1('0x5b')][_0x25b1('0x6c')];_0x17463c[_0x25b1('0x39')][_0x25b1('0x6d')]=_0x17463c[_0x25b1('0x2d')][_0x25b1('0x37')]=_0x5af2b6[_0x25b1('0x5b')][_0x25b1('0x6d')];if(_0x5af2b6[_0x25b1('0x5b')]['modernAuthentication']){_0x17463c[_0x25b1('0x39')][_0x25b1('0x31')]=_0x17463c['Smtp']['modernAuthentication']=!![];_0x17463c[_0x25b1('0x39')][_0x25b1('0x6e')]=_0x17463c[_0x25b1('0x2d')][_0x25b1('0x6e')]=_0x5af2b6[_0x25b1('0x5b')]['CloudProviderId'];_0x17463c['Imap'][_0x25b1('0x6d')]=_0x17463c[_0x25b1('0x2d')][_0x25b1('0x37')]=null;}else{_0x17463c['Imap']['CloudProviderId']=_0x17463c[_0x25b1('0x2d')][_0x25b1('0x6e')]=null;}_0x17463c[_0x25b1('0x39')]['service']=_0x17463c[_0x25b1('0x2d')][_0x25b1('0x2b')]=null;_0x17463c[_0x25b1('0x39')][_0x25b1('0x2c')]=_0x17463c[_0x25b1('0x2d')][_0x25b1('0x2c')]=null;_0x17463c[_0x25b1('0x39')][_0x25b1('0x2e')]=_0x17463c[_0x25b1('0x2d')]['port']=null;}else{if(_0x5af2b6[_0x25b1('0x5b')][_0x25b1('0x30')]){_0x17463c[_0x25b1('0x39')][_0x25b1('0x34')]=_0x17463c[_0x25b1('0x2d')][_0x25b1('0x34')]=_0x5af2b6[_0x25b1('0x5b')]['username'];_0x17463c[_0x25b1('0x39')]['password']=_0x17463c[_0x25b1('0x2d')][_0x25b1('0x37')]=_0x5af2b6[_0x25b1('0x5b')][_0x25b1('0x6d')];}else{_0x17463c['Imap']['authentication']=_0x17463c[_0x25b1('0x2d')][_0x25b1('0x30')]=![];_0x17463c['Imap']['user']=_0x17463c['Smtp'][_0x25b1('0x34')]=null;_0x17463c[_0x25b1('0x39')][_0x25b1('0x6d')]=_0x17463c[_0x25b1('0x2d')][_0x25b1('0x37')]=null;}_0x17463c[_0x25b1('0x39')][_0x25b1('0x2c')]=_0x5af2b6[_0x25b1('0x5b')][_0x25b1('0x39')][_0x25b1('0x2c')];_0x17463c[_0x25b1('0x39')][_0x25b1('0x2e')]=_0x5af2b6['body'][_0x25b1('0x39')]['port'];_0x17463c[_0x25b1('0x2d')][_0x25b1('0x2c')]=_0x5af2b6[_0x25b1('0x5b')][_0x25b1('0x2d')][_0x25b1('0x2c')];_0x17463c[_0x25b1('0x2d')][_0x25b1('0x2e')]=_0x5af2b6[_0x25b1('0x5b')]['Smtp'][_0x25b1('0x2e')];}return db[_0x25b1('0x3c')][_0x25b1('0x61')](_0x17463c,{'include':[{'model':db[_0x25b1('0x3a')],'as':_0x25b1('0x2d')},{'model':db[_0x25b1('0x38')],'as':_0x25b1('0x39')}]})['then'](function(_0x274746){var _0x217c30=_0x5af2b6[_0x25b1('0x34')][_0x25b1('0x6f')]({'plain':!![]});if(!_0x217c30)throw new Error(_0x25b1('0x70'));if(_0x217c30['role']==='user'){var _0x8f3e8f=_0x274746[_0x25b1('0x6f')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x25b1('0x26'),'userProfileId':_0x217c30[_0x25b1('0x71')]},'raw':!![]})[_0x25b1('0x10')](function(_0x423fe4){if(_0x423fe4&&_0x423fe4[_0x25b1('0x72')]===0x0){return db[_0x25b1('0x27')][_0x25b1('0x61')]({'name':_0x8f3e8f[_0x25b1('0x29')],'resourceId':_0x8f3e8f['id'],'type':_0x423fe4['name'],'sectionId':_0x423fe4['id']},{})[_0x25b1('0x10')](function(){return _0x274746;});}else{return _0x274746;}})['catch'](function(_0x5da7af){logger[_0x25b1('0x17')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5da7af);throw _0x5da7af;});}return _0x274746;})[_0x25b1('0x10')](respondWithResult(_0x339e82,0xc9))[_0x25b1('0x56')](handleError(_0x339e82,null));};exports[_0x25b1('0x73')]=function(_0x143f82,_0x3981fb){return db[_0x25b1('0x3c')][_0x25b1('0x74')]({'where':{'id':_0x143f82['params']['id']}})[_0x25b1('0x10')](handleEntityNotFound(_0x3981fb,null))[_0x25b1('0x10')](function(_0x3f7791){if(_0x3f7791){return _0x3f7791[_0x25b1('0x73')]();}return null;})[_0x25b1('0x10')](respondWithResult(_0x3981fb,null))[_0x25b1('0x56')](handleError(_0x3981fb,null));};exports[_0x25b1('0x75')]=function(_0x1db159,_0x5662d4){if(_0x1db159[_0x25b1('0x5b')]['id']){delete _0x1db159[_0x25b1('0x5b')]['id'];}return db[_0x25b1('0x3c')]['find']({'where':{'id':_0x1db159[_0x25b1('0x58')]['id']}})[_0x25b1('0x10')](handleEntityNotFound(_0x5662d4,null))[_0x25b1('0x10')](function(_0x404cd2){if(_0x404cd2){_0x1db159[_0x25b1('0x5b')]['MailAccountId']=_0x404cd2['id'];return db[_0x25b1('0x38')][_0x25b1('0x61')](_0x1db159[_0x25b1('0x5b')]);}})['then'](respondWithResult(_0x5662d4,null))['catch'](handleError(_0x5662d4,null));};exports['removeImap']=function(_0x74f454,_0x52b8a8){return db[_0x25b1('0x3c')]['findOne']({'where':{'id':_0x74f454[_0x25b1('0x58')]['id']}})[_0x25b1('0x10')](handleEntityNotFound(_0x52b8a8,null))[_0x25b1('0x10')](function(_0x373c98){if(_0x373c98){return _0x373c98[_0x25b1('0x76')](null);}return null;})[_0x25b1('0x10')](respondWithStatusCode(_0x52b8a8,null))[_0x25b1('0x56')](handleError(_0x52b8a8,null));};exports['getSmtp']=function(_0xe484af,_0x4b1fdd){return db[_0x25b1('0x3c')]['findOne']({'where':{'id':_0xe484af[_0x25b1('0x58')]['id']}})[_0x25b1('0x10')](handleEntityNotFound(_0x4b1fdd,null))[_0x25b1('0x10')](function(_0x539133){if(_0x539133){return _0x539133['getSmtp']();}return null;})[_0x25b1('0x10')](respondWithResult(_0x4b1fdd,null))[_0x25b1('0x56')](handleError(_0x4b1fdd,null));};exports[_0x25b1('0x77')]=function(_0x2f3d55,_0x1e0b3c){if(_0x2f3d55['body']['id']){delete _0x2f3d55[_0x25b1('0x5b')]['id'];}return db[_0x25b1('0x3c')]['find']({'where':{'id':_0x2f3d55['params']['id']}})['then'](handleEntityNotFound(_0x1e0b3c,null))[_0x25b1('0x10')](function(_0x5f4356){if(_0x5f4356){_0x2f3d55[_0x25b1('0x5b')][_0x25b1('0x5f')]=_0x5f4356['id'];return db[_0x25b1('0x3a')][_0x25b1('0x61')](_0x2f3d55[_0x25b1('0x5b')]);}})[_0x25b1('0x10')](respondWithResult(_0x1e0b3c,null))[_0x25b1('0x56')](handleError(_0x1e0b3c,null));};exports[_0x25b1('0x78')]=function(_0x47a701,_0x44532b){return db['MailAccount'][_0x25b1('0x74')]({'where':{'id':_0x47a701[_0x25b1('0x58')]['id']}})[_0x25b1('0x10')](handleEntityNotFound(_0x44532b,null))['then'](function(_0xe960f1){if(_0xe960f1){return _0xe960f1[_0x25b1('0x79')](null);}return null;})[_0x25b1('0x10')](respondWithStatusCode(_0x44532b,null))[_0x25b1('0x56')](handleError(_0x44532b,null));};exports[_0x25b1('0x7a')]=function(_0x40df9d,_0x5df67f){return db[_0x25b1('0x7b')][_0x25b1('0x5a')]({'where':{'id':_0x40df9d[_0x25b1('0x58')]['id']}})['then'](handleEntityNotFound(_0x5df67f,null))[_0x25b1('0x10')](function(_0x1ffd8a){if(_0x1ffd8a){return _0x1ffd8a[_0x25b1('0x7a')](_0x40df9d[_0x25b1('0x5b')]['ids'],_[_0x25b1('0x7c')](_0x40df9d[_0x25b1('0x5b')],[_0x25b1('0x64'),'id'])||{});}})[_0x25b1('0x10')](respondWithResult(_0x5df67f,null))[_0x25b1('0x56')](handleError(_0x5df67f,null));};exports[_0x25b1('0x7d')]=function(_0x2cf30c,_0x2e520b){var _0x415a4b={'raw':![],'where':{}};var _0x2e85c0={};var _0x3722cc={'count':0x0,'rows':[]};return db['MailAccount'][_0x25b1('0x74')]({'where':{'id':_0x2cf30c[_0x25b1('0x58')]['id']}})[_0x25b1('0x10')](handleEntityNotFound(_0x2e520b,null))['then'](function(_0x59c798){if(_0x59c798){_0x2e85c0[_0x25b1('0x41')]=_[_0x25b1('0x43')](db['MailInteraction']['rawAttributes']);_0x2e85c0[_0x25b1('0x46')]=_['keys'](_0x2cf30c[_0x25b1('0x46')]);_0x2e85c0[_0x25b1('0x44')]=_[_0x25b1('0x45')](_0x2e85c0[_0x25b1('0x41')],_0x2e85c0[_0x25b1('0x46')]);_0x415a4b['attributes']=_[_0x25b1('0x45')](_0x2e85c0[_0x25b1('0x41')],qs['fields'](_0x2cf30c[_0x25b1('0x46')][_0x25b1('0x48')]));_0x415a4b['attributes']=_0x415a4b[_0x25b1('0x47')]['length']?_0x415a4b[_0x25b1('0x47')]:_0x2e85c0[_0x25b1('0x41')];if(!_0x2cf30c[_0x25b1('0x46')][_0x25b1('0x4a')](_0x25b1('0x4b'))){_0x415a4b[_0x25b1('0x22')]=qs[_0x25b1('0x22')](_0x2cf30c[_0x25b1('0x46')]['limit']);_0x415a4b[_0x25b1('0x1f')]=qs[_0x25b1('0x1f')](_0x2cf30c['query'][_0x25b1('0x1f')]);}_0x415a4b[_0x25b1('0x4c')]=qs[_0x25b1('0x4d')](_0x2cf30c[_0x25b1('0x46')][_0x25b1('0x4d')]);_0x415a4b[_0x25b1('0x4e')]=qs['filters'](_[_0x25b1('0x4f')](_0x2cf30c[_0x25b1('0x46')],_0x2e85c0[_0x25b1('0x44')]));_0x415a4b['where'][_0x25b1('0x5f')]=_0x59c798['id'];if(_0x2cf30c[_0x25b1('0x46')][_0x25b1('0x50')]){_0x415a4b[_0x25b1('0x4e')]=_[_0x25b1('0x51')](_0x415a4b[_0x25b1('0x4e')],{'$or':_['map'](_0x415a4b[_0x25b1('0x47')],function(_0x5d9bc3){var _0x307aa0={};_0x307aa0[_0x5d9bc3]={'$like':'%'+_0x2cf30c['query'][_0x25b1('0x50')]+'%'};return _0x307aa0;})});}_0x415a4b=_[_0x25b1('0x51')]({},_0x415a4b,_0x2cf30c[_0x25b1('0x52')]);return db[_0x25b1('0x7b')]['count']({'where':_0x415a4b[_0x25b1('0x4e')]})[_0x25b1('0x10')](function(_0x2876d6){_0x3722cc[_0x25b1('0x21')]=_0x2876d6;if(_0x2cf30c[_0x25b1('0x46')]['includeAll']){_0x415a4b[_0x25b1('0x54')]=[{'model':db['CmContact'],'as':_0x25b1('0x7e'),'required':![]},{'model':db[_0x25b1('0x7f')],'as':_0x25b1('0x80'),'attributes':[_0x25b1('0x29'),'fullname',_0x25b1('0x81')],'required':![]},{'model':db[_0x25b1('0x82')],'as':_0x25b1('0x83'),'attributes':['id',_0x25b1('0x29'),'color'],'where':_0x2cf30c[_0x25b1('0x46')][_0x25b1('0x84')]?{'id':_0x2cf30c[_0x25b1('0x46')][_0x25b1('0x84')]}:undefined,'required':_0x2cf30c[_0x25b1('0x46')][_0x25b1('0x84')]?!![]:![]}];}return db[_0x25b1('0x7b')][_0x25b1('0x62')](_0x415a4b);})['then'](function(_0xc1f1cb){_0x3722cc[_0x25b1('0x55')]=_0xc1f1cb;return _0x3722cc;});}})[_0x25b1('0x10')](respondWithFilteredResult(_0x2e520b,_0x415a4b))['catch'](handleError(_0x2e520b,null));};exports['addApplications']=function addApplications(_0x282723,_0x19294a){var _0x2a9a49=_0x282723['params']['id'];var _0x2597c2=_0x282723['body'];var _0x579885=0xc8;var _0x44a4cb=null;return db[_0x25b1('0x85')]['transaction']({'isolationLevel':db[_0x25b1('0x85')][_0x25b1('0x86')][_0x25b1('0x87')][_0x25b1('0x88')]},function(_0x1a4a40){return db[_0x25b1('0x3c')][_0x25b1('0x74')]({'where':{'id':_0x2a9a49},'transaction':_0x1a4a40})[_0x25b1('0x10')](function(_0x43b2a9){if(_0x43b2a9){return db[_0x25b1('0x89')]['destroy']({'where':{'MailAccountId':_0x2a9a49},'transaction':_0x1a4a40})[_0x25b1('0x10')](function(){var _0xbfa37d=_[_0x25b1('0x42')](_0x2597c2,function(_0x13ea41){_0x13ea41['MailAccountId']=_0x2a9a49;return _0x13ea41;});return db[_0x25b1('0x89')][_0x25b1('0x8a')](_0xbfa37d,{'transaction':_0x1a4a40});});}else{_0x579885=0x194;_0x44a4cb=[];}});})[_0x25b1('0x10')](function(){if(_0x579885!==0x194){return db[_0x25b1('0x89')][_0x25b1('0x8b')]({'where':{'MailAccountId':_0x2a9a49},'order':_0x25b1('0x8c')})[_0x25b1('0x10')](function(_0x25a019){_0x44a4cb=_0x25a019;});}})['catch'](function(_0x12bfc1){_0x579885=0x1f4;logger[_0x25b1('0x17')](_0x12bfc1[_0x25b1('0x28')]);if(_0x12bfc1[_0x25b1('0x29')]){delete _0x12bfc1[_0x25b1('0x29')];}_0x44a4cb=_0x12bfc1;})['finally'](function(){if(_0x44a4cb===null){_0x19294a['sendStatus'](_0x579885);}else{if(_0x579885===0x1f4){_0x19294a[_0x25b1('0x1d')](_0x579885)[_0x25b1('0x8d')](_0x44a4cb);}else{_0x19294a['status'](_0x579885)[_0x25b1('0x1e')](_0x44a4cb);}}});};exports[_0x25b1('0x8e')]=function(_0x2fc7bb,_0x5a701b){var _0x55af6c={};var _0x1a0c59={};var _0x34eb96;var _0x361f2b;return db['MailAccount'][_0x25b1('0x74')]({'where':{'id':_0x2fc7bb[_0x25b1('0x58')]['id']}})['then'](handleEntityNotFound(_0x5a701b,null))[_0x25b1('0x10')](function(_0x1c86b5){if(_0x1c86b5){_0x34eb96=_0x1c86b5;_0x1a0c59[_0x25b1('0x41')]=_[_0x25b1('0x43')](db[_0x25b1('0x89')][_0x25b1('0x3d')]);_0x1a0c59['query']=_[_0x25b1('0x43')](_0x2fc7bb[_0x25b1('0x46')]);_0x1a0c59['filters']=_['intersection'](_0x1a0c59[_0x25b1('0x41')],_0x1a0c59[_0x25b1('0x46')]);_0x55af6c[_0x25b1('0x47')]=_['intersection'](_0x1a0c59[_0x25b1('0x41')],qs[_0x25b1('0x48')](_0x2fc7bb[_0x25b1('0x46')][_0x25b1('0x48')]));_0x55af6c[_0x25b1('0x47')]=_0x55af6c[_0x25b1('0x47')][_0x25b1('0x49')]?_0x55af6c[_0x25b1('0x47')]:_0x1a0c59[_0x25b1('0x41')];_0x55af6c['order']=qs['sort'](_0x2fc7bb[_0x25b1('0x46')]['sort']);_0x55af6c['where']=qs[_0x25b1('0x44')](_[_0x25b1('0x4f')](_0x2fc7bb[_0x25b1('0x46')],_0x1a0c59['filters']));if(_0x2fc7bb[_0x25b1('0x46')][_0x25b1('0x50')]){_0x55af6c[_0x25b1('0x4e')]=_[_0x25b1('0x51')](_0x55af6c[_0x25b1('0x4e')],{'$or':_[_0x25b1('0x42')](_0x55af6c[_0x25b1('0x47')],function(_0xd07d34){var _0x4c7186={};_0x4c7186[_0xd07d34]={'$like':'%'+_0x2fc7bb['query'][_0x25b1('0x50')]+'%'};return _0x4c7186;})});}_0x55af6c=_[_0x25b1('0x51')]({},_0x55af6c,_0x2fc7bb['options']);return _0x34eb96[_0x25b1('0x8e')](_0x55af6c);}})[_0x25b1('0x10')](function(_0x3bd586){if(_0x3bd586){_0x361f2b=_0x3bd586[_0x25b1('0x49')];if(!_0x2fc7bb['query'][_0x25b1('0x4a')](_0x25b1('0x4b'))){_0x55af6c['limit']=qs[_0x25b1('0x22')](_0x2fc7bb[_0x25b1('0x46')][_0x25b1('0x22')]);_0x55af6c[_0x25b1('0x1f')]=qs[_0x25b1('0x1f')](_0x2fc7bb[_0x25b1('0x46')][_0x25b1('0x1f')]);}return _0x34eb96['getApplications'](_0x55af6c);}})[_0x25b1('0x10')](function(_0x2c0e06){if(_0x2c0e06){return _0x2c0e06?{'count':_0x361f2b,'rows':_0x2c0e06}:null;}})['then'](respondWithResult(_0x5a701b,null))[_0x25b1('0x56')](handleError(_0x5a701b,null));};exports['getMessages']=function(_0x244d2a,_0x579ef0){var _0x33f32a={'raw':!![],'where':{}};var _0x347be8={};var _0x37d46a={'count':0x0,'rows':[]};return db[_0x25b1('0x3c')][_0x25b1('0x74')]({'where':{'id':_0x244d2a[_0x25b1('0x58')]['id']}})[_0x25b1('0x10')](handleEntityNotFound(_0x579ef0,null))[_0x25b1('0x10')](function(_0x5ae736){if(_0x5ae736){_0x347be8[_0x25b1('0x41')]=_['keys'](db[_0x25b1('0x8f')][_0x25b1('0x3d')]);_0x347be8[_0x25b1('0x46')]=_[_0x25b1('0x43')](_0x244d2a[_0x25b1('0x46')]);_0x347be8[_0x25b1('0x44')]=_['intersection'](_0x347be8[_0x25b1('0x41')],_0x347be8[_0x25b1('0x46')]);_0x33f32a[_0x25b1('0x47')]=_['intersection'](_0x347be8[_0x25b1('0x41')],qs[_0x25b1('0x48')](_0x244d2a[_0x25b1('0x46')]['fields']));_0x33f32a[_0x25b1('0x47')]=_0x33f32a[_0x25b1('0x47')]['length']?_0x33f32a[_0x25b1('0x47')]:_0x347be8[_0x25b1('0x41')];if(!_0x244d2a[_0x25b1('0x46')]['hasOwnProperty'](_0x25b1('0x4b'))){_0x33f32a['limit']=qs[_0x25b1('0x22')](_0x244d2a['query'][_0x25b1('0x22')]);_0x33f32a[_0x25b1('0x1f')]=qs[_0x25b1('0x1f')](_0x244d2a[_0x25b1('0x46')][_0x25b1('0x1f')]);}_0x33f32a[_0x25b1('0x4c')]=qs[_0x25b1('0x4d')](_0x244d2a[_0x25b1('0x46')][_0x25b1('0x4d')]);_0x33f32a[_0x25b1('0x4e')]=qs[_0x25b1('0x44')](_['pick'](_0x244d2a[_0x25b1('0x46')],_0x347be8[_0x25b1('0x44')]));_0x33f32a[_0x25b1('0x4e')][_0x25b1('0x5f')]=_0x5ae736['id'];if(_0x244d2a[_0x25b1('0x46')][_0x25b1('0x50')]){_0x33f32a[_0x25b1('0x4e')]=_[_0x25b1('0x51')](_0x33f32a[_0x25b1('0x4e')],{'$or':_[_0x25b1('0x42')](_0x33f32a[_0x25b1('0x47')],function(_0x1e2515){var _0x39e3c8={};_0x39e3c8[_0x1e2515]={'$like':'%'+_0x244d2a[_0x25b1('0x46')][_0x25b1('0x50')]+'%'};return _0x39e3c8;})});}if(_0x244d2a[_0x25b1('0x46')][_0x25b1('0x90')]){var _0x23456b=_0x244d2a['query'][_0x25b1('0x90')][_0x25b1('0x91')](',');var _0x3ce63a={};_0x3ce63a[_0x23456b[0x0]]={'$gte':moment(_0x23456b[0x1])[_0x25b1('0x92')](_0x25b1('0x93'))};_0x33f32a['where']=_[_0x25b1('0x51')](_0x33f32a[_0x25b1('0x4e')],_0x3ce63a);}_0x33f32a=_[_0x25b1('0x51')]({},_0x33f32a,_0x244d2a[_0x25b1('0x52')]);return db[_0x25b1('0x8f')]['count']({'where':_0x33f32a[_0x25b1('0x4e')]})[_0x25b1('0x10')](function(_0x2da082){_0x37d46a[_0x25b1('0x21')]=_0x2da082;if(_0x244d2a[_0x25b1('0x46')][_0x25b1('0x53')]){_0x33f32a[_0x25b1('0x54')]=[{'all':!![]}];}return db['MailMessage'][_0x25b1('0x62')](_0x33f32a);})['then'](function(_0x263b1f){if(_0x244d2a['query']['inlineCss']===_0x25b1('0x94')){for(var _0x49ad3f=0x0;_0x49ad3f<_0x263b1f[_0x25b1('0x49')];_0x49ad3f++){_0x263b1f[_0x49ad3f]['body']=juice(_0x263b1f[_0x49ad3f][_0x25b1('0x5b')]);}}_0x37d46a[_0x25b1('0x55')]=_0x263b1f;return _0x37d46a;});}})[_0x25b1('0x10')](respondWithFilteredResult(_0x579ef0,_0x33f32a))[_0x25b1('0x56')](handleError(_0x579ef0,null));};exports[_0x25b1('0x8d')]=function(_0x2ab73e,_0x11d55e){var _0x59e16b,_0x26df27={},_0x2c36d8;if(_0x2ab73e[_0x25b1('0x5b')]['to']){_0x2c36d8=_0x2ab73e[_0x25b1('0x5b')]['to'][_0x25b1('0x91')](',')[0x0];}return db[_0x25b1('0x3c')][_0x25b1('0x5a')]({'where':{'id':_0x2ab73e[_0x25b1('0x58')]['id']},'include':[{'model':db[_0x25b1('0x95')],'as':'List','include':[{'model':db[_0x25b1('0x96')],'as':_0x25b1('0x97'),'where':{'email':_0x2c36d8},'limit':0x1,'order':[['updatedAt',_0x25b1('0x98')]]}]},{'model':db[_0x25b1('0x3a')],'as':_0x25b1('0x2d'),'raw':!![],'include':[{'model':db[_0x25b1('0x35')],'as':'CloudProvider','raw':!![]}]}]})[_0x25b1('0x10')](handleEntityNotFound(_0x11d55e,null))['then'](function(_0x525fc7){if(!_0x525fc7)return;_0x59e16b=_0x525fc7;if(!_0x525fc7[_0x25b1('0x2d')])throw new Error(_0x25b1('0x99'));if(_[_0x25b1('0x9a')](_0x2ab73e[_0x25b1('0x5b')][_0x25b1('0x9b')])){_0x2ab73e[_0x25b1('0x5b')][_0x25b1('0x9b')]=util[_0x25b1('0x92')]('%s\x20<%s>',_0x525fc7['name'],_0x525fc7[_0x25b1('0x9c')]||_0x525fc7['Smtp']['user']);}if(_0x2ab73e[_0x25b1('0x5b')][_0x25b1('0x9d')]&&_0x2ab73e[_0x25b1('0x5b')][_0x25b1('0x9d')]['length']){for(var _0x7faec4=0x0;_0x7faec4<_0x2ab73e[_0x25b1('0x5b')]['attachments'][_0x25b1('0x49')];_0x7faec4+=0x1){_0x2ab73e['body'][_0x25b1('0x9d')][_0x7faec4]={'filename':_0x2ab73e['body']['attachments'][_0x7faec4][_0x25b1('0x29')],'path':path['join'](config[_0x25b1('0x9e')],_0x25b1('0x9f'),_0x2ab73e[_0x25b1('0x5b')][_0x25b1('0x9d')][_0x7faec4][_0x25b1('0xa0')])};}}var _0x17cba3=getSmtpOptions(_0x525fc7);return respondWithRpcPromise('SendMail','sendMail',{'account':_0x17cba3,'message':_0x2ab73e[_0x25b1('0x5b')]});})[_0x25b1('0x10')](function(_0x541909){if(!_0x541909)return;_0x26df27=_0x541909;if(!_0x59e16b['List'])throw new Error(_0x25b1('0xa1'));if(_0x59e16b['List'][_0x25b1('0x97')][_0x25b1('0x49')])return _0x59e16b[_0x25b1('0xa2')][_0x25b1('0x97')][0x0];return db[_0x25b1('0x96')][_0x25b1('0x61')](_[_0x25b1('0xa3')](_0x2ab73e['body'],{'firstName':_0x2ab73e[_0x25b1('0x5b')]['to'],'email':_0x2ab73e[_0x25b1('0x5b')]['to'],'phone':_0x2ab73e[_0x25b1('0x5b')]['to'],'ListId':_0x59e16b[_0x25b1('0x69')]}));})[_0x25b1('0x10')](function(_0x35de82){if(!_0x35de82)return;var _0x2f6b33={'UserId':_0x2ab73e[_0x25b1('0x34')]['id'],'ContactId':_0x35de82['id'],'MailAccountId':_0x59e16b['id'],'inReplyTo':_0x26df27[_0x25b1('0xa4')],'to':_0x2ab73e[_0x25b1('0x5b')][_0x25b1('0x9b')],'cc':_0x2ab73e[_0x25b1('0x5b')]['cc'],'subject':_0x2ab73e[_0x25b1('0x5b')][_0x25b1('0xa5')],'attach':_0x2ab73e['body'][_0x25b1('0xa6')],'firstMsgDirection':_0x25b1('0xa7'),'lastMsgAt':moment()[_0x25b1('0x92')](_0x25b1('0x93')),'lastMsgDirection':_0x25b1('0xa7'),'Messages':[_[_0x25b1('0x51')](_0x2ab73e[_0x25b1('0x5b')],{'messageId':_0x26df27['messageId'],'sentAt':moment()[_0x25b1('0x92')](_0x25b1('0x93')),'read':!![],'MailAccountId':_0x59e16b['id'],'UserId':_0x2ab73e[_0x25b1('0x34')]['id'],'ContactId':_0x35de82['id']})]};if(_0x2ab73e[_0x25b1('0x5b')][_0x25b1('0xa8')]){_0x2f6b33=_[_0x25b1('0x51')](_0x2f6b33,_0x2ab73e[_0x25b1('0x5b')][_0x25b1('0xa8')]);}return db[_0x25b1('0x7b')]['create'](_0x2f6b33,{'include':[{'model':db['MailMessage'],'as':'Messages'}]});})[_0x25b1('0x10')](respondWithResult(_0x11d55e,null))[_0x25b1('0x56')](handleError(_0x11d55e,null));};exports[_0x25b1('0xa9')]=function(_0x7554ae,_0x3b4218){return db[_0x25b1('0x3c')][_0x25b1('0x5a')]({'where':{'id':_0x7554ae['params']['id']},'include':[{'model':db['MailServerOut'],'as':_0x25b1('0x2d'),'raw':!![],'include':[{'model':db[_0x25b1('0x35')],'as':_0x25b1('0x35'),'raw':!![]}]}]})[_0x25b1('0x10')](handleEntityNotFound(_0x3b4218,null))[_0x25b1('0x10')](function(_0x4b3037){if(!_0x4b3037[_0x25b1('0x2d')])return;var _0x241ce6=getSmtpOptions(_0x4b3037);return respondWithRpcPromise(_0x25b1('0xaa'),'verifySmtp',{'account':_0x241ce6});})['then'](respondWithResult(_0x3b4218,null))[_0x25b1('0x56')](handleError(_0x3b4218,null));};exports['destroy']=function(_0x5e5e90,_0x1039b){return db[_0x25b1('0x3c')][_0x25b1('0x5a')]({'where':{'id':_0x5e5e90[_0x25b1('0x58')]['id']}})[_0x25b1('0x10')](handleEntityNotFound(_0x1039b,null))['then'](function(_0x37bc79){if(_0x37bc79&&_0x37bc79['service']){throw new db['Sequelize'][(_0x25b1('0xab'))](_0x25b1('0xac'));}return _0x37bc79;})['then'](removeEntity(_0x1039b,null))['catch'](handleError(_0x1039b,null));};exports['addAgents']=function(_0x26d301,_0x15f58c){return db[_0x25b1('0x3c')][_0x25b1('0x5a')]({'where':{'id':_0x26d301['params']['id']}})['then'](handleEntityNotFound(_0x15f58c,null))['then'](function(_0x5bd7ce){if(_0x5bd7ce){return _0x5bd7ce[_0x25b1('0xad')](_0x26d301[_0x25b1('0x5b')][_0x25b1('0x64')],_[_0x25b1('0x7c')](_0x26d301[_0x25b1('0x5b')],[_0x25b1('0x64'),'id'])||{})[_0x25b1('0xae')](function(_0x96927d){for(var _0x2f9921=0x0;_0x2f9921<_0x26d301['body'][_0x25b1('0x64')][_0x25b1('0x49')];_0x2f9921+=0x1){socket[_0x25b1('0xaf')](_0x25b1('0xb0'),{'UserId':Number(_0x26d301[_0x25b1('0x5b')][_0x25b1('0x64')][_0x2f9921]),'MailAccountId':Number(_0x26d301['params']['id'])});}return _0x96927d;});}})[_0x25b1('0x10')](respondWithResult(_0x15f58c,null))['catch'](handleError(_0x15f58c,null));};exports['removeAgents']=function(_0x5486be,_0x51e9d5){return db[_0x25b1('0x3c')][_0x25b1('0x5a')]({'where':{'id':_0x5486be[_0x25b1('0x58')]['id']}})[_0x25b1('0x10')](handleEntityNotFound(_0x51e9d5,null))[_0x25b1('0x10')](function(_0x1b9de8){if(_0x1b9de8){return _0x1b9de8[_0x25b1('0xb1')](_0x5486be[_0x25b1('0x46')][_0x25b1('0x64')])[_0x25b1('0x10')](function(){if(_[_0x25b1('0xb2')](_0x5486be[_0x25b1('0x46')][_0x25b1('0x64')])){for(var _0x3e7cb7=0x0;_0x3e7cb7<_0x5486be[_0x25b1('0x46')][_0x25b1('0x64')]['length'];_0x3e7cb7+=0x1){socket[_0x25b1('0xaf')](_0x25b1('0xb3'),{'UserId':Number(_0x5486be[_0x25b1('0x46')][_0x25b1('0x64')][_0x3e7cb7]),'MailAccountId':Number(_0x5486be['params']['id'])});}}else{socket['emit'](_0x25b1('0xb3'),{'UserId':Number(_0x5486be['query'][_0x25b1('0x64')]),'MailAccountId':Number(_0x5486be['params']['id'])});}});}})[_0x25b1('0x10')](respondWithStatusCode(_0x51e9d5,null))[_0x25b1('0x56')](handleError(_0x51e9d5,null));};exports[_0x25b1('0xb4')]=function(_0xaf0af8,_0x2eabbc){var _0x259c69={};var _0x1ab5cc={};var _0x491022;var _0x52f249;return db['MailAccount']['findOne']({'where':{'id':_0xaf0af8[_0x25b1('0x58')]['id']}})[_0x25b1('0x10')](handleEntityNotFound(_0x2eabbc,null))['then'](function(_0x2a2357){if(_0x2a2357){_0x491022=_0x2a2357;_0x1ab5cc[_0x25b1('0x41')]=_[_0x25b1('0x43')](db[_0x25b1('0x7f')][_0x25b1('0x3d')]);_0x1ab5cc[_0x25b1('0x46')]=_['keys'](_0xaf0af8[_0x25b1('0x46')]);_0x1ab5cc['filters']=_[_0x25b1('0x45')](_0x1ab5cc[_0x25b1('0x41')],_0x1ab5cc['query']);_0x259c69[_0x25b1('0x47')]=_['intersection'](_0x1ab5cc[_0x25b1('0x41')],qs[_0x25b1('0x48')](_0xaf0af8[_0x25b1('0x46')][_0x25b1('0x48')]));_0x259c69[_0x25b1('0x47')]=_0x259c69[_0x25b1('0x47')][_0x25b1('0x49')]?_0x259c69[_0x25b1('0x47')]:_0x1ab5cc[_0x25b1('0x41')];_0x259c69[_0x25b1('0x4c')]=qs[_0x25b1('0x4d')](_0xaf0af8[_0x25b1('0x46')][_0x25b1('0x4d')]);_0x259c69[_0x25b1('0x4e')]=qs[_0x25b1('0x44')](_[_0x25b1('0x4f')](_0xaf0af8['query'],_0x1ab5cc[_0x25b1('0x44')]));if(_0xaf0af8[_0x25b1('0x46')]['filter']){_0x259c69[_0x25b1('0x4e')]=_[_0x25b1('0x51')](_0x259c69[_0x25b1('0x4e')],{'$or':_[_0x25b1('0x42')](_0x259c69[_0x25b1('0x47')],function(_0x4c6ecd){var _0xff84a5={};_0xff84a5[_0x4c6ecd]={'$like':'%'+_0xaf0af8['query']['filter']+'%'};return _0xff84a5;})});}_0x259c69=_[_0x25b1('0x51')]({},_0x259c69,_0xaf0af8[_0x25b1('0x52')]);return _0x491022[_0x25b1('0xb4')](_0x259c69);}})[_0x25b1('0x10')](function(_0x543551){if(_0x543551){_0x52f249=_0x543551[_0x25b1('0x49')];if(!_0xaf0af8['query']['hasOwnProperty']('nolimit')){_0x259c69[_0x25b1('0x22')]=qs[_0x25b1('0x22')](_0xaf0af8[_0x25b1('0x46')][_0x25b1('0x22')]);_0x259c69[_0x25b1('0x1f')]=qs[_0x25b1('0x1f')](_0xaf0af8[_0x25b1('0x46')]['offset']);}return _0x491022[_0x25b1('0xb4')](_0x259c69);}})[_0x25b1('0x10')](function(_0x5610db){if(_0x5610db){return _0x5610db?{'count':_0x52f249,'rows':_0x5610db}:null;}})[_0x25b1('0x10')](respondWithResult(_0x2eabbc,null))[_0x25b1('0x56')](handleError(_0x2eabbc,null));};
\ No newline at end of file
+var _0xa44d=['MailAccountId','removeDispositions','ids','addAnswer','CannedAnswer','findOne','rows','removeAnswers','ListId','isNil','active','password','CloudProviderId','username','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','omit','getInteractions','MailInteraction','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','findAndCountAll','priority','finally','json','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','CmContact','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','email','attachments','SendMail','sendMail','List','List\x20not\x20found','messageId','subject','out','Interaction','Messages','verifySmtp','VerifySmtp','ValidationError','addAgents','userMailAccount:save','removeAgents','isArray','getAgents','moment','util','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./mailAccount.socket','jayson/promise','client','http','request','then','info','request\x20sent','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','status','end','offset','undefined','limit','count','set','Content-Range','update','destroy','MailAccounts','UserProfileResource','sendStatus','stack','name','send','provider','custom','service','host','Smtp','port','authentication','auth','OAuth2','user','data5','pass','index','Imap','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','show','options','find','body','modernAuthentication','params','MailServerIn','describe','addDisposition','Disposition','create','order'];(function(_0x39ca2c,_0x366519){var _0x2ac512=function(_0x555f28){while(--_0x555f28){_0x39ca2c['push'](_0x39ca2c['shift']());}};_0x2ac512(++_0x366519);}(_0xa44d,0x1ce));var _0xda44=function(_0x3f3f06,_0x581e5b){_0x3f3f06=_0x3f3f06-0x0;var _0x140feb=_0xa44d[_0x3f3f06];return _0x140feb;};'use strict';var moment=require(_0xda44('0x0'));var BPromise=require('bluebird');var util=require(_0xda44('0x1'));var path=require(_0xda44('0x2'));var _=require(_0xda44('0x3'));var juice=require(_0xda44('0x4'));var Redis=require(_0xda44('0x5'));var qs=require(_0xda44('0x6'));var logger=require(_0xda44('0x7'))(_0xda44('0x8'));var config=require(_0xda44('0x9'));var db=require(_0xda44('0xa'))['db'];config['redis']=_[_0xda44('0xb')](config['redis'],{'host':_0xda44('0xc'),'port':0x18eb});var socket=require(_0xda44('0xd'))(new Redis(config[_0xda44('0xe')]));require(_0xda44('0xf'))['register'](socket);var jayson=require(_0xda44('0x10'));var client=jayson[_0xda44('0x11')][_0xda44('0x12')]({'port':0x232b});function respondWithRpcPromise(_0x1d67f6,_0x3098e7,_0x2196db,_0x492eb7){return new BPromise(function(_0x4bb78b,_0xafba53){var _0x2e9275=_0x492eb7||client;return _0x2e9275[_0xda44('0x13')](_0x1d67f6,_0x2196db)[_0xda44('0x14')](function(_0x4616cb){logger[_0xda44('0x15')]('MailAccount,\x20%s,\x20%s',_0x3098e7,'request\x20sent');logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x3098e7,_0xda44('0x16'),JSON['stringify'](_0x4616cb));if(_0x4616cb[_0xda44('0x17')]){if(_0x4616cb['error'][_0xda44('0x18')]===0x1f4){logger[_0xda44('0x17')](_0xda44('0x19'),_0x3098e7,_0x4616cb[_0xda44('0x17')]['message']);return _0xafba53(_0x4616cb['error'][_0xda44('0x1a')]);}logger[_0xda44('0x17')](_0xda44('0x19'),_0x3098e7,_0x4616cb['error'][_0xda44('0x1a')]);return _0x4bb78b(_0x4616cb[_0xda44('0x17')][_0xda44('0x1a')]);}else{logger[_0xda44('0x15')]('MailAccount,\x20%s,\x20%s',_0x3098e7,_0xda44('0x16'));_0x4bb78b(_0x4616cb[_0xda44('0x1b')][_0xda44('0x1a')]);}})[_0xda44('0x1c')](function(_0x258559){logger['error'](_0xda44('0x19'),_0x3098e7,_0x258559);_0xafba53(_0x258559);});});}function respondWithStatusCode(_0x3a7714,_0x11f8c4){_0x11f8c4=_0x11f8c4||0xcc;return function(_0x4fb975){if(_0x4fb975){return _0x3a7714['sendStatus'](_0x11f8c4);}return _0x3a7714[_0xda44('0x1d')](_0x11f8c4)[_0xda44('0x1e')]();};}function respondWithResult(_0x52d9ef,_0x25548c){_0x25548c=_0x25548c||0xc8;return function(_0x335cc4){if(_0x335cc4){return _0x52d9ef['status'](_0x25548c)['json'](_0x335cc4);}};}function respondWithFilteredResult(_0x394fbf,_0x38fd84){return function(_0x78c85b){if(_0x78c85b){var _0x22684f=typeof _0x38fd84[_0xda44('0x1f')]===_0xda44('0x20')&&typeof _0x38fd84[_0xda44('0x21')]===_0xda44('0x20');var _0x374c8f=_0x78c85b[_0xda44('0x22')];var _0x3b0267=_0x22684f?0x0:_0x38fd84[_0xda44('0x1f')];var _0x4139b3=_0x22684f?_0x78c85b[_0xda44('0x22')]:_0x38fd84[_0xda44('0x1f')]+_0x38fd84['limit'];var _0x477c30;if(_0x4139b3>=_0x374c8f){_0x4139b3=_0x374c8f;_0x477c30=0xc8;}else{_0x477c30=0xce;}_0x394fbf['status'](_0x477c30);return _0x394fbf[_0xda44('0x23')](_0xda44('0x24'),_0x3b0267+'-'+_0x4139b3+'/'+_0x374c8f)['json'](_0x78c85b);}return null;};}function saveUpdates(_0x5ace41){return function(_0x1893f1){if(_0x1893f1){return _0x1893f1[_0xda44('0x25')](_0x5ace41)[_0xda44('0x14')](function(_0x1a4593){return _0x1a4593;});}return null;};}function removeEntity(_0x3e0340){return function(_0xac1ab6){if(_0xac1ab6){return _0xac1ab6[_0xda44('0x26')]()[_0xda44('0x14')](function(){var _0x5efc89=_0xac1ab6['get']({'plain':!![]});var _0x5cebb7=_0xda44('0x27');return db[_0xda44('0x28')][_0xda44('0x26')]({'where':{'type':_0x5cebb7,'resourceId':_0x5efc89['id']}})[_0xda44('0x14')](function(){return _0xac1ab6;});})[_0xda44('0x14')](function(){_0x3e0340[_0xda44('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x326aba){return function(_0x480702){if(!_0x480702){_0x326aba[_0xda44('0x29')](0x194);}return _0x480702;};}function handleError(_0x264eda,_0x178e0a){_0x178e0a=_0x178e0a||0x1f4;return function(_0x1a6212){logger[_0xda44('0x17')](_0x1a6212[_0xda44('0x2a')]);if(_0x1a6212[_0xda44('0x2b')]){delete _0x1a6212[_0xda44('0x2b')];}_0x264eda[_0xda44('0x1d')](_0x178e0a)[_0xda44('0x2c')](_0x1a6212);};}function getSmtpOptions(_0x8ec6e7){var _0xc9d7ee={'id':_0x8ec6e7['id'],'tls':{'rejectUnauthorized':![]}};if(_0x8ec6e7[_0xda44('0x2d')]!==_0xda44('0x2e')){_0xc9d7ee[_0xda44('0x2f')]=_0x8ec6e7['provider'];}else{_0xc9d7ee[_0xda44('0x30')]=_0x8ec6e7[_0xda44('0x31')][_0xda44('0x30')];_0xc9d7ee[_0xda44('0x32')]=_0x8ec6e7[_0xda44('0x31')][_0xda44('0x32')];_0xc9d7ee['secure']=_0x8ec6e7[_0xda44('0x31')]['secure'];}if(_0x8ec6e7['Smtp'][_0xda44('0x33')]){if(_0x8ec6e7['Smtp']['modernAuthentication']){_0xc9d7ee[_0xda44('0x34')]={'type':_0xda44('0x35'),'user':_0x8ec6e7['Smtp'][_0xda44('0x36')],'accessToken':_0x8ec6e7['Smtp']['CloudProvider'][_0xda44('0x37')]};}else{_0xc9d7ee[_0xda44('0x34')]={'user':_0x8ec6e7[_0xda44('0x31')][_0xda44('0x36')],'pass':_0x8ec6e7[_0xda44('0x31')][_0xda44('0x38')]};}}return _0xc9d7ee;}exports[_0xda44('0x39')]=function(_0x54aa71,_0x77b1f1){var _0x3038d3={'include':[{'model':db['MailServerIn'],'as':_0xda44('0x3a')},{'model':db[_0xda44('0x3b')],'as':_0xda44('0x31')},{'model':db[_0xda44('0x3c')],'as':_0xda44('0x3d')}]},_0x301070={},_0x51fbd7={'count':0x0,'rows':[]};var _0x30e895=_[_0xda44('0x3e')](db[_0xda44('0x3f')][_0xda44('0x40')],function(_0x4b8a49){return{'name':_0x4b8a49[_0xda44('0x41')],'type':_0x4b8a49[_0xda44('0x42')][_0xda44('0x43')]};});_0x301070[_0xda44('0x44')]=_['map'](_0x30e895,_0xda44('0x2b'));_0x301070[_0xda44('0x45')]=_[_0xda44('0x46')](_0x54aa71[_0xda44('0x45')]);_0x301070[_0xda44('0x47')]=_[_0xda44('0x48')](_0x301070['model'],_0x301070[_0xda44('0x45')]);_0x3038d3[_0xda44('0x49')]=_[_0xda44('0x48')](_0x301070[_0xda44('0x44')],qs[_0xda44('0x4a')](_0x54aa71[_0xda44('0x45')]['fields']));_0x3038d3[_0xda44('0x49')]=_0x3038d3[_0xda44('0x49')][_0xda44('0x4b')]?_0x3038d3[_0xda44('0x49')]:_0x301070[_0xda44('0x44')];if(!_0x54aa71[_0xda44('0x45')][_0xda44('0x4c')](_0xda44('0x4d'))){_0x3038d3[_0xda44('0x21')]=qs[_0xda44('0x21')](_0x54aa71[_0xda44('0x45')][_0xda44('0x21')]);_0x3038d3[_0xda44('0x1f')]=qs[_0xda44('0x1f')](_0x54aa71['query'][_0xda44('0x1f')]);}_0x3038d3['order']=qs['sort'](_0x54aa71[_0xda44('0x45')][_0xda44('0x4e')]);_0x3038d3[_0xda44('0x4f')]=qs[_0xda44('0x47')](_[_0xda44('0x50')](_0x54aa71[_0xda44('0x45')],_0x301070[_0xda44('0x47')]),_0x30e895);if(_0x54aa71['query']['filter']){_0x3038d3[_0xda44('0x4f')]=_[_0xda44('0x51')](_0x3038d3[_0xda44('0x4f')],{'$or':_[_0xda44('0x3e')](_0x30e895,function(_0xf46110){if(_0xf46110['type']!==_0xda44('0x52')){var _0x171351={};_0x171351[_0xf46110[_0xda44('0x2b')]]={'$like':'%'+_0x54aa71['query'][_0xda44('0x53')]+'%'};return _0x171351;}})});}_0x3038d3=_[_0xda44('0x51')]({},_0x3038d3,_0x54aa71['options']);var _0x2294a2={'where':_0x3038d3['where']};return db[_0xda44('0x3f')][_0xda44('0x22')](_0x2294a2)[_0xda44('0x14')](function(_0x4b9f50){_0x51fbd7[_0xda44('0x22')]=_0x4b9f50;if(_0x54aa71[_0xda44('0x45')][_0xda44('0x54')]){_0x3038d3[_0xda44('0x55')]=[{'all':!![]}];}return db['MailAccount'][_0xda44('0x56')](_0x3038d3);})[_0xda44('0x14')](function(_0x500e88){_0x51fbd7['rows']=_0x500e88;return _0x51fbd7;})[_0xda44('0x14')](respondWithFilteredResult(_0x77b1f1,_0x3038d3))['catch'](handleError(_0x77b1f1,null));};exports[_0xda44('0x57')]=function(_0x5582a2,_0x99bc8f){var _0x20552b={'raw':![],'where':{'id':_0x5582a2['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0xda44('0x3a')},{'model':db[_0xda44('0x3b')],'as':'Smtp'},{'model':db[_0xda44('0x3c')],'as':_0xda44('0x3d')}]},_0x5032df={};_0x5032df['model']=_[_0xda44('0x46')](db[_0xda44('0x3f')][_0xda44('0x40')]);_0x5032df[_0xda44('0x45')]=_['keys'](_0x5582a2['query']);_0x5032df[_0xda44('0x47')]=_[_0xda44('0x48')](_0x5032df[_0xda44('0x44')],_0x5032df[_0xda44('0x45')]);_0x20552b[_0xda44('0x49')]=_[_0xda44('0x48')](_0x5032df[_0xda44('0x44')],qs[_0xda44('0x4a')](_0x5582a2[_0xda44('0x45')][_0xda44('0x4a')]));_0x20552b[_0xda44('0x49')]=_0x20552b['attributes'][_0xda44('0x4b')]?_0x20552b[_0xda44('0x49')]:_0x5032df[_0xda44('0x44')];if(_0x5582a2[_0xda44('0x45')][_0xda44('0x54')]){_0x20552b['include']=[{'all':!![]}];}_0x20552b=_[_0xda44('0x51')]({},_0x20552b,_0x5582a2[_0xda44('0x58')]);return db[_0xda44('0x3f')][_0xda44('0x59')](_0x20552b)[_0xda44('0x14')](handleEntityNotFound(_0x99bc8f,null))['then'](respondWithResult(_0x99bc8f,null))[_0xda44('0x1c')](handleError(_0x99bc8f,null));};exports[_0xda44('0x25')]=function(_0x816ce2,_0x8d0fdd){if(_0x816ce2[_0xda44('0x5a')]['id']){delete _0x816ce2[_0xda44('0x5a')]['id'];}if(_0x816ce2['body']['Imap']){if(!_0x816ce2[_0xda44('0x5a')][_0xda44('0x3a')][_0xda44('0x5b')]){_0x816ce2[_0xda44('0x5a')][_0xda44('0x3a')]['CloudProviderId']=null;}}if(_0x816ce2[_0xda44('0x5a')][_0xda44('0x31')]){if(!_0x816ce2[_0xda44('0x5a')]['Smtp'][_0xda44('0x5b')]){_0x816ce2[_0xda44('0x5a')][_0xda44('0x31')]['CloudProviderId']=null;}}return db[_0xda44('0x3f')][_0xda44('0x59')]({'where':{'id':_0x816ce2[_0xda44('0x5c')]['id']},'include':[{'model':db[_0xda44('0x5d')],'as':_0xda44('0x3a')},{'model':db[_0xda44('0x3b')],'as':_0xda44('0x31')},{'model':db[_0xda44('0x3c')],'as':_0xda44('0x3d')}]})[_0xda44('0x14')](handleEntityNotFound(_0x8d0fdd,null))[_0xda44('0x14')](saveUpdates(_0x816ce2[_0xda44('0x5a')],null))['then'](function(_0x3d40ae){if(_0x3d40ae&&_0x816ce2[_0xda44('0x5a')][_0xda44('0x3a')]){return db[_0xda44('0x5d')][_0xda44('0x25')](_0x816ce2[_0xda44('0x5a')][_0xda44('0x3a')],{'where':{'MailAccountId':_0x3d40ae['id']}})[_0xda44('0x14')](function(){return _0x3d40ae;});}return _0x3d40ae;})[_0xda44('0x14')](function(_0x3fcaf2){if(_0x3fcaf2&&_0x816ce2[_0xda44('0x5a')][_0xda44('0x31')]){return db[_0xda44('0x3b')][_0xda44('0x25')](_0x816ce2['body'][_0xda44('0x31')],{'where':{'MailAccountId':_0x3fcaf2['id']}})[_0xda44('0x14')](function(){return _0x3fcaf2;});}return _0x3fcaf2;})[_0xda44('0x14')](respondWithResult(_0x8d0fdd,null))[_0xda44('0x1c')](handleError(_0x8d0fdd,null));};exports['describe']=function(_0x109f6f,_0x2308ea){return db[_0xda44('0x3f')][_0xda44('0x5e')]()['then'](respondWithResult(_0x2308ea,null))['catch'](handleError(_0x2308ea,null));};exports[_0xda44('0x5f')]=function(_0x1a8a6b,_0x2f1389){if(_0x1a8a6b[_0xda44('0x5a')]['id']){delete _0x1a8a6b[_0xda44('0x5a')]['id'];}return db[_0xda44('0x3f')][_0xda44('0x59')]({'where':{'id':_0x1a8a6b['params']['id']}})[_0xda44('0x14')](handleEntityNotFound(_0x2f1389,null))[_0xda44('0x14')](function(_0x50f15c){if(_0x50f15c){_0x1a8a6b[_0xda44('0x5a')]['MailAccountId']=_0x50f15c['id'];return db[_0xda44('0x60')][_0xda44('0x61')](_0x1a8a6b[_0xda44('0x5a')]);}})[_0xda44('0x14')](respondWithResult(_0x2f1389,null))[_0xda44('0x1c')](handleError(_0x2f1389,null));};exports['getDispositions']=function(_0x138dd7,_0x51b51e){var _0x4458f5={'raw':![],'where':{}};var _0xe57565={};var _0x3de294={'count':0x0,'rows':[]};return db[_0xda44('0x3f')]['findOne']({'where':{'id':_0x138dd7[_0xda44('0x5c')]['id']}})[_0xda44('0x14')](handleEntityNotFound(_0x51b51e,null))[_0xda44('0x14')](function(_0x3406ab){if(_0x3406ab){_0xe57565[_0xda44('0x44')]=_['keys'](db[_0xda44('0x60')][_0xda44('0x40')]);_0xe57565[_0xda44('0x45')]=_[_0xda44('0x46')](_0x138dd7[_0xda44('0x45')]);_0xe57565[_0xda44('0x47')]=_[_0xda44('0x48')](_0xe57565['model'],_0xe57565[_0xda44('0x45')]);_0x4458f5['attributes']=_[_0xda44('0x48')](_0xe57565['model'],qs[_0xda44('0x4a')](_0x138dd7[_0xda44('0x45')][_0xda44('0x4a')]));_0x4458f5['attributes']=_0x4458f5[_0xda44('0x49')][_0xda44('0x4b')]?_0x4458f5['attributes']:_0xe57565[_0xda44('0x44')];if(!_0x138dd7[_0xda44('0x45')][_0xda44('0x4c')](_0xda44('0x4d'))){_0x4458f5[_0xda44('0x21')]=qs[_0xda44('0x21')](_0x138dd7['query']['limit']);_0x4458f5['offset']=qs['offset'](_0x138dd7['query']['offset']);}_0x4458f5[_0xda44('0x62')]=qs[_0xda44('0x4e')](_0x138dd7['query'][_0xda44('0x4e')]);_0x4458f5[_0xda44('0x4f')]=qs['filters'](_[_0xda44('0x50')](_0x138dd7[_0xda44('0x45')],_0xe57565[_0xda44('0x47')]));_0x4458f5['where'][_0xda44('0x63')]=_0x3406ab['id'];if(_0x138dd7[_0xda44('0x45')][_0xda44('0x53')]){_0x4458f5['where']=_['merge'](_0x4458f5[_0xda44('0x4f')],{'$or':_[_0xda44('0x3e')](_0x4458f5['attributes'],function(_0x4c985a){var _0x5e970f={};_0x5e970f[_0x4c985a]={'$like':'%'+_0x138dd7['query']['filter']+'%'};return _0x5e970f;})});}_0x4458f5=_['merge']({},_0x4458f5,_0x138dd7[_0xda44('0x58')]);return db['Disposition']['count']({'where':_0x4458f5[_0xda44('0x4f')]})[_0xda44('0x14')](function(_0x5c7444){_0x3de294[_0xda44('0x22')]=_0x5c7444;if(_0x138dd7['query']['includeAll']){_0x4458f5[_0xda44('0x55')]=[{'all':!![]}];}return db[_0xda44('0x60')][_0xda44('0x56')](_0x4458f5);})[_0xda44('0x14')](function(_0x1c3bc6){_0x3de294['rows']=_0x1c3bc6;return _0x3de294;});}})[_0xda44('0x14')](respondWithFilteredResult(_0x51b51e,_0x4458f5))[_0xda44('0x1c')](handleError(_0x51b51e,null));};exports[_0xda44('0x64')]=function(_0x3ca0b0,_0x1a6023){return db['MailAccount']['find']({'where':{'id':_0x3ca0b0[_0xda44('0x5c')]['id']}})[_0xda44('0x14')](handleEntityNotFound(_0x1a6023,null))[_0xda44('0x14')](function(_0x14a1d2){if(_0x14a1d2){return _0x14a1d2[_0xda44('0x64')](_0x3ca0b0[_0xda44('0x45')][_0xda44('0x65')]);}})[_0xda44('0x14')](respondWithStatusCode(_0x1a6023,null))[_0xda44('0x1c')](handleError(_0x1a6023,null));};exports[_0xda44('0x66')]=function(_0x4b0a05,_0x1cff48){if(_0x4b0a05[_0xda44('0x5a')]['id']){delete _0x4b0a05[_0xda44('0x5a')]['id'];}return db[_0xda44('0x3f')][_0xda44('0x59')]({'where':{'id':_0x4b0a05[_0xda44('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1cff48,null))['then'](function(_0x2a80d3){if(_0x2a80d3){_0x4b0a05[_0xda44('0x5a')]['MailAccountId']=_0x2a80d3['id'];return db[_0xda44('0x67')][_0xda44('0x61')](_0x4b0a05[_0xda44('0x5a')]);}})[_0xda44('0x14')](respondWithResult(_0x1cff48,null))[_0xda44('0x1c')](handleError(_0x1cff48,null));};exports['getAnswers']=function(_0x2bd935,_0x45e467){var _0x2d6af1={'raw':![],'where':{}};var _0x30f9ea={};var _0x2d3e9e={'count':0x0,'rows':[]};return db[_0xda44('0x3f')][_0xda44('0x68')]({'where':{'id':_0x2bd935[_0xda44('0x5c')]['id']}})[_0xda44('0x14')](handleEntityNotFound(_0x45e467,null))[_0xda44('0x14')](function(_0x4833e9){if(_0x4833e9){_0x30f9ea[_0xda44('0x44')]=_[_0xda44('0x46')](db[_0xda44('0x67')]['rawAttributes']);_0x30f9ea[_0xda44('0x45')]=_[_0xda44('0x46')](_0x2bd935[_0xda44('0x45')]);_0x30f9ea[_0xda44('0x47')]=_[_0xda44('0x48')](_0x30f9ea[_0xda44('0x44')],_0x30f9ea[_0xda44('0x45')]);_0x2d6af1[_0xda44('0x49')]=_[_0xda44('0x48')](_0x30f9ea[_0xda44('0x44')],qs[_0xda44('0x4a')](_0x2bd935[_0xda44('0x45')]['fields']));_0x2d6af1['attributes']=_0x2d6af1[_0xda44('0x49')][_0xda44('0x4b')]?_0x2d6af1[_0xda44('0x49')]:_0x30f9ea[_0xda44('0x44')];if(!_0x2bd935[_0xda44('0x45')][_0xda44('0x4c')](_0xda44('0x4d'))){_0x2d6af1[_0xda44('0x21')]=qs[_0xda44('0x21')](_0x2bd935['query']['limit']);_0x2d6af1[_0xda44('0x1f')]=qs[_0xda44('0x1f')](_0x2bd935['query'][_0xda44('0x1f')]);}_0x2d6af1[_0xda44('0x62')]=qs[_0xda44('0x4e')](_0x2bd935[_0xda44('0x45')][_0xda44('0x4e')]);_0x2d6af1['where']=qs['filters'](_[_0xda44('0x50')](_0x2bd935[_0xda44('0x45')],_0x30f9ea['filters']));_0x2d6af1[_0xda44('0x4f')]['MailAccountId']=_0x4833e9['id'];if(_0x2bd935[_0xda44('0x45')][_0xda44('0x53')]){_0x2d6af1[_0xda44('0x4f')]=_[_0xda44('0x51')](_0x2d6af1[_0xda44('0x4f')],{'$or':_['map'](_0x2d6af1[_0xda44('0x49')],function(_0x29deb6){var _0x109d8b={};_0x109d8b[_0x29deb6]={'$like':'%'+_0x2bd935[_0xda44('0x45')][_0xda44('0x53')]+'%'};return _0x109d8b;})});}_0x2d6af1=_['merge']({},_0x2d6af1,_0x2bd935[_0xda44('0x58')]);return db[_0xda44('0x67')]['count']({'where':_0x2d6af1[_0xda44('0x4f')]})[_0xda44('0x14')](function(_0x3829ed){_0x2d3e9e[_0xda44('0x22')]=_0x3829ed;if(_0x2bd935[_0xda44('0x45')][_0xda44('0x54')]){_0x2d6af1[_0xda44('0x55')]=[{'all':!![]}];}return db['CannedAnswer'][_0xda44('0x56')](_0x2d6af1);})[_0xda44('0x14')](function(_0x3417d0){_0x2d3e9e[_0xda44('0x69')]=_0x3417d0;return _0x2d3e9e;});}})[_0xda44('0x14')](respondWithFilteredResult(_0x45e467,_0x2d6af1))[_0xda44('0x1c')](handleError(_0x45e467,null));};exports[_0xda44('0x6a')]=function(_0xd13bbf,_0x4c73f9){return db[_0xda44('0x3f')]['find']({'where':{'id':_0xd13bbf['params']['id']}})[_0xda44('0x14')](handleEntityNotFound(_0x4c73f9,null))[_0xda44('0x14')](function(_0x52948c){if(_0x52948c){return _0x52948c['removeAnswers'](_0xd13bbf[_0xda44('0x45')][_0xda44('0x65')]);}})[_0xda44('0x14')](respondWithStatusCode(_0x4c73f9,null))['catch'](handleError(_0x4c73f9,null));};exports[_0xda44('0x61')]=function(_0x2dff31,_0x165a2d){var _0x3d804a={'name':_0x2dff31[_0xda44('0x5a')][_0xda44('0x2b')],'key':_0x2dff31[_0xda44('0x5a')]['key'],'provider':_0x2dff31[_0xda44('0x5a')][_0xda44('0x2d')]===_0xda44('0x2e')?null:_0x2dff31[_0xda44('0x5a')][_0xda44('0x2d')],'email':_0x2dff31[_0xda44('0x5a')]['email'],'ListId':_0x2dff31['body'][_0xda44('0x6b')],'active':!_[_0xda44('0x6c')](_0x2dff31[_0xda44('0x5a')]['active'])?_0x2dff31[_0xda44('0x5a')][_0xda44('0x6d')]:!![],'description':_0x2dff31[_0xda44('0x5a')]['description']||null,'Imap':{},'Smtp':{}};if(_0x3d804a[_0xda44('0x2d')]){_0x3d804a[_0xda44('0x3a')][_0xda44('0x36')]=_0x3d804a['Smtp'][_0xda44('0x36')]=_0x2dff31[_0xda44('0x5a')]['username'];_0x3d804a[_0xda44('0x3a')][_0xda44('0x6e')]=_0x3d804a[_0xda44('0x31')][_0xda44('0x38')]=_0x2dff31[_0xda44('0x5a')][_0xda44('0x6e')];if(_0x2dff31[_0xda44('0x5a')]['modernAuthentication']){_0x3d804a[_0xda44('0x3a')][_0xda44('0x5b')]=_0x3d804a['Smtp'][_0xda44('0x5b')]=!![];_0x3d804a[_0xda44('0x3a')]['CloudProviderId']=_0x3d804a[_0xda44('0x31')]['CloudProviderId']=_0x2dff31[_0xda44('0x5a')]['CloudProviderId'];_0x3d804a[_0xda44('0x3a')][_0xda44('0x6e')]=_0x3d804a[_0xda44('0x31')][_0xda44('0x38')]=null;}else{_0x3d804a[_0xda44('0x3a')][_0xda44('0x6f')]=_0x3d804a['Smtp'][_0xda44('0x6f')]=null;}_0x3d804a[_0xda44('0x3a')][_0xda44('0x2f')]=_0x3d804a['Smtp']['service']=null;_0x3d804a[_0xda44('0x3a')][_0xda44('0x30')]=_0x3d804a['Smtp'][_0xda44('0x30')]=null;_0x3d804a[_0xda44('0x3a')]['port']=_0x3d804a[_0xda44('0x31')][_0xda44('0x32')]=null;}else{if(_0x2dff31[_0xda44('0x5a')][_0xda44('0x33')]){_0x3d804a['Imap'][_0xda44('0x36')]=_0x3d804a[_0xda44('0x31')][_0xda44('0x36')]=_0x2dff31[_0xda44('0x5a')][_0xda44('0x70')];_0x3d804a[_0xda44('0x3a')]['password']=_0x3d804a[_0xda44('0x31')][_0xda44('0x38')]=_0x2dff31['body']['password'];}else{_0x3d804a[_0xda44('0x3a')][_0xda44('0x33')]=_0x3d804a[_0xda44('0x31')][_0xda44('0x33')]=![];_0x3d804a[_0xda44('0x3a')]['user']=_0x3d804a['Smtp'][_0xda44('0x36')]=null;_0x3d804a[_0xda44('0x3a')][_0xda44('0x6e')]=_0x3d804a[_0xda44('0x31')][_0xda44('0x38')]=null;}_0x3d804a['Imap'][_0xda44('0x30')]=_0x2dff31[_0xda44('0x5a')][_0xda44('0x3a')]['host'];_0x3d804a[_0xda44('0x3a')][_0xda44('0x32')]=_0x2dff31[_0xda44('0x5a')][_0xda44('0x3a')]['port'];_0x3d804a['Smtp']['host']=_0x2dff31['body']['Smtp']['host'];_0x3d804a[_0xda44('0x31')]['port']=_0x2dff31[_0xda44('0x5a')][_0xda44('0x31')]['port'];}return db['MailAccount']['create'](_0x3d804a,{'include':[{'model':db[_0xda44('0x3b')],'as':_0xda44('0x31')},{'model':db[_0xda44('0x5d')],'as':_0xda44('0x3a')}]})[_0xda44('0x14')](function(_0x58d13f){var _0x4e0a3b=_0x2dff31[_0xda44('0x36')][_0xda44('0x71')]({'plain':!![]});if(!_0x4e0a3b)throw new Error(_0xda44('0x72'));if(_0x4e0a3b[_0xda44('0x73')]===_0xda44('0x36')){var _0x3b1be2=_0x58d13f[_0xda44('0x71')]({'plain':!![]});return db['UserProfileSection'][_0xda44('0x59')]({'where':{'name':'MailAccounts','userProfileId':_0x4e0a3b[_0xda44('0x74')]},'raw':!![]})[_0xda44('0x14')](function(_0x1a5fbf){if(_0x1a5fbf&&_0x1a5fbf[_0xda44('0x75')]===0x0){return db[_0xda44('0x28')][_0xda44('0x61')]({'name':_0x3b1be2[_0xda44('0x2b')],'resourceId':_0x3b1be2['id'],'type':_0x1a5fbf[_0xda44('0x2b')],'sectionId':_0x1a5fbf['id']},{})[_0xda44('0x14')](function(){return _0x58d13f;});}else{return _0x58d13f;}})['catch'](function(_0x57e7db){logger['error'](_0xda44('0x76'),_0x57e7db);throw _0x57e7db;});}return _0x58d13f;})[_0xda44('0x14')](respondWithResult(_0x165a2d,0xc9))[_0xda44('0x1c')](handleError(_0x165a2d,null));};exports[_0xda44('0x77')]=function(_0x3cd7ff,_0x2bc1c6){return db[_0xda44('0x3f')][_0xda44('0x68')]({'where':{'id':_0x3cd7ff['params']['id']}})['then'](handleEntityNotFound(_0x2bc1c6,null))[_0xda44('0x14')](function(_0x15b05e){if(_0x15b05e){return _0x15b05e[_0xda44('0x77')]();}return null;})[_0xda44('0x14')](respondWithResult(_0x2bc1c6,null))[_0xda44('0x1c')](handleError(_0x2bc1c6,null));};exports[_0xda44('0x78')]=function(_0x5147c5,_0x4aed7b){if(_0x5147c5[_0xda44('0x5a')]['id']){delete _0x5147c5[_0xda44('0x5a')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x5147c5['params']['id']}})[_0xda44('0x14')](handleEntityNotFound(_0x4aed7b,null))[_0xda44('0x14')](function(_0x2c3acb){if(_0x2c3acb){_0x5147c5[_0xda44('0x5a')]['MailAccountId']=_0x2c3acb['id'];return db[_0xda44('0x5d')][_0xda44('0x61')](_0x5147c5[_0xda44('0x5a')]);}})[_0xda44('0x14')](respondWithResult(_0x4aed7b,null))[_0xda44('0x1c')](handleError(_0x4aed7b,null));};exports[_0xda44('0x79')]=function(_0x484bb9,_0x2e3c2f){return db[_0xda44('0x3f')][_0xda44('0x68')]({'where':{'id':_0x484bb9['params']['id']}})[_0xda44('0x14')](handleEntityNotFound(_0x2e3c2f,null))[_0xda44('0x14')](function(_0xecc098){if(_0xecc098){return _0xecc098[_0xda44('0x7a')](null);}return null;})[_0xda44('0x14')](respondWithStatusCode(_0x2e3c2f,null))[_0xda44('0x1c')](handleError(_0x2e3c2f,null));};exports[_0xda44('0x7b')]=function(_0x994095,_0x302f8d){return db[_0xda44('0x3f')][_0xda44('0x68')]({'where':{'id':_0x994095[_0xda44('0x5c')]['id']}})[_0xda44('0x14')](handleEntityNotFound(_0x302f8d,null))['then'](function(_0x2e88f7){if(_0x2e88f7){return _0x2e88f7[_0xda44('0x7b')]();}return null;})[_0xda44('0x14')](respondWithResult(_0x302f8d,null))[_0xda44('0x1c')](handleError(_0x302f8d,null));};exports[_0xda44('0x7c')]=function(_0xdb463b,_0x333c48){if(_0xdb463b[_0xda44('0x5a')]['id']){delete _0xdb463b[_0xda44('0x5a')]['id'];}return db[_0xda44('0x3f')][_0xda44('0x59')]({'where':{'id':_0xdb463b[_0xda44('0x5c')]['id']}})['then'](handleEntityNotFound(_0x333c48,null))[_0xda44('0x14')](function(_0x5e8ac4){if(_0x5e8ac4){_0xdb463b[_0xda44('0x5a')][_0xda44('0x63')]=_0x5e8ac4['id'];return db[_0xda44('0x3b')][_0xda44('0x61')](_0xdb463b['body']);}})[_0xda44('0x14')](respondWithResult(_0x333c48,null))[_0xda44('0x1c')](handleError(_0x333c48,null));};exports[_0xda44('0x7d')]=function(_0x4decf2,_0x32171a){return db['MailAccount'][_0xda44('0x68')]({'where':{'id':_0x4decf2[_0xda44('0x5c')]['id']}})[_0xda44('0x14')](handleEntityNotFound(_0x32171a,null))[_0xda44('0x14')](function(_0x22e2eb){if(_0x22e2eb){return _0x22e2eb[_0xda44('0x7e')](null);}return null;})['then'](respondWithStatusCode(_0x32171a,null))['catch'](handleError(_0x32171a,null));};exports[_0xda44('0x7f')]=function(_0x88fe67,_0x5c285d){return db['MailInteraction'][_0xda44('0x59')]({'where':{'id':_0x88fe67[_0xda44('0x5c')]['id']}})[_0xda44('0x14')](handleEntityNotFound(_0x5c285d,null))[_0xda44('0x14')](function(_0x5ecbf7){if(_0x5ecbf7){return _0x5ecbf7['addInteraction'](_0x88fe67[_0xda44('0x5a')][_0xda44('0x65')],_[_0xda44('0x80')](_0x88fe67[_0xda44('0x5a')],[_0xda44('0x65'),'id'])||{});}})[_0xda44('0x14')](respondWithResult(_0x5c285d,null))['catch'](handleError(_0x5c285d,null));};exports[_0xda44('0x81')]=function(_0x112070,_0x2e9071){var _0x3a3ea7={'raw':![],'where':{}};var _0x2777c9={};var _0x375537={'count':0x0,'rows':[]};return db[_0xda44('0x3f')][_0xda44('0x68')]({'where':{'id':_0x112070[_0xda44('0x5c')]['id']}})[_0xda44('0x14')](handleEntityNotFound(_0x2e9071,null))[_0xda44('0x14')](function(_0x1f9f8f){if(_0x1f9f8f){_0x2777c9[_0xda44('0x44')]=_[_0xda44('0x46')](db[_0xda44('0x82')][_0xda44('0x40')]);_0x2777c9['query']=_[_0xda44('0x46')](_0x112070['query']);_0x2777c9[_0xda44('0x47')]=_[_0xda44('0x48')](_0x2777c9[_0xda44('0x44')],_0x2777c9[_0xda44('0x45')]);_0x3a3ea7[_0xda44('0x49')]=_['intersection'](_0x2777c9[_0xda44('0x44')],qs[_0xda44('0x4a')](_0x112070[_0xda44('0x45')]['fields']));_0x3a3ea7[_0xda44('0x49')]=_0x3a3ea7[_0xda44('0x49')][_0xda44('0x4b')]?_0x3a3ea7['attributes']:_0x2777c9[_0xda44('0x44')];if(!_0x112070[_0xda44('0x45')][_0xda44('0x4c')](_0xda44('0x4d'))){_0x3a3ea7[_0xda44('0x21')]=qs[_0xda44('0x21')](_0x112070['query']['limit']);_0x3a3ea7[_0xda44('0x1f')]=qs[_0xda44('0x1f')](_0x112070[_0xda44('0x45')][_0xda44('0x1f')]);}_0x3a3ea7[_0xda44('0x62')]=qs[_0xda44('0x4e')](_0x112070['query']['sort']);_0x3a3ea7['where']=qs[_0xda44('0x47')](_['pick'](_0x112070[_0xda44('0x45')],_0x2777c9[_0xda44('0x47')]));_0x3a3ea7[_0xda44('0x4f')][_0xda44('0x63')]=_0x1f9f8f['id'];if(_0x112070[_0xda44('0x45')]['filter']){_0x3a3ea7[_0xda44('0x4f')]=_[_0xda44('0x51')](_0x3a3ea7[_0xda44('0x4f')],{'$or':_[_0xda44('0x3e')](_0x3a3ea7['attributes'],function(_0x8549f2){var _0x529475={};_0x529475[_0x8549f2]={'$like':'%'+_0x112070[_0xda44('0x45')][_0xda44('0x53')]+'%'};return _0x529475;})});}_0x3a3ea7=_[_0xda44('0x51')]({},_0x3a3ea7,_0x112070[_0xda44('0x58')]);return db[_0xda44('0x82')][_0xda44('0x22')]({'where':_0x3a3ea7[_0xda44('0x4f')]})[_0xda44('0x14')](function(_0x2cbf69){_0x375537[_0xda44('0x22')]=_0x2cbf69;if(_0x112070['query'][_0xda44('0x54')]){_0x3a3ea7[_0xda44('0x55')]=[{'model':db['CmContact'],'as':_0xda44('0x83'),'required':![]},{'model':db['User'],'as':_0xda44('0x84'),'attributes':[_0xda44('0x2b'),_0xda44('0x85'),_0xda44('0x86')],'required':![]},{'model':db[_0xda44('0x87')],'as':_0xda44('0x88'),'attributes':['id',_0xda44('0x2b'),_0xda44('0x89')],'where':_0x112070[_0xda44('0x45')][_0xda44('0x8a')]?{'id':_0x112070['query'][_0xda44('0x8a')]}:undefined,'required':_0x112070[_0xda44('0x45')][_0xda44('0x8a')]?!![]:![]}];}return db['MailInteraction'][_0xda44('0x56')](_0x3a3ea7);})[_0xda44('0x14')](function(_0xab7dd6){_0x375537[_0xda44('0x69')]=_0xab7dd6;return _0x375537;});}})['then'](respondWithFilteredResult(_0x2e9071,_0x3a3ea7))[_0xda44('0x1c')](handleError(_0x2e9071,null));};exports[_0xda44('0x8b')]=function addApplications(_0x13e3fb,_0x2c1540){var _0x4fe43c=_0x13e3fb['params']['id'];var _0x4cf235=_0x13e3fb[_0xda44('0x5a')];var _0x5edba3=0xc8;var _0x866dc7=null;return db['sequelize'][_0xda44('0x8c')]({'isolationLevel':db[_0xda44('0x8d')][_0xda44('0x8e')][_0xda44('0x8f')][_0xda44('0x90')]},function(_0x2255e4){return db[_0xda44('0x3f')][_0xda44('0x68')]({'where':{'id':_0x4fe43c},'transaction':_0x2255e4})[_0xda44('0x14')](function(_0x119544){if(_0x119544){return db['MailApplication'][_0xda44('0x26')]({'where':{'MailAccountId':_0x4fe43c},'transaction':_0x2255e4})[_0xda44('0x14')](function(){var _0x300f7f=_[_0xda44('0x3e')](_0x4cf235,function(_0x42ba50){_0x42ba50[_0xda44('0x63')]=_0x4fe43c;return _0x42ba50;});return db[_0xda44('0x91')]['bulkCreate'](_0x300f7f,{'transaction':_0x2255e4});});}else{_0x5edba3=0x194;_0x866dc7=[];}});})['then'](function(){if(_0x5edba3!==0x194){return db[_0xda44('0x91')][_0xda44('0x92')]({'where':{'MailAccountId':_0x4fe43c},'order':_0xda44('0x93')})[_0xda44('0x14')](function(_0xacf990){_0x866dc7=_0xacf990;});}})['catch'](function(_0x368935){_0x5edba3=0x1f4;logger[_0xda44('0x17')](_0x368935[_0xda44('0x2a')]);if(_0x368935[_0xda44('0x2b')]){delete _0x368935[_0xda44('0x2b')];}_0x866dc7=_0x368935;})[_0xda44('0x94')](function(){if(_0x866dc7===null){_0x2c1540['sendStatus'](_0x5edba3);}else{if(_0x5edba3===0x1f4){_0x2c1540[_0xda44('0x1d')](_0x5edba3)[_0xda44('0x2c')](_0x866dc7);}else{_0x2c1540[_0xda44('0x1d')](_0x5edba3)[_0xda44('0x95')](_0x866dc7);}}});};exports['getApplications']=function(_0x1bd613,_0x391726){var _0x3d2b0c={};var _0x42af0b={};var _0x3f4f76;var _0x163bbf;return db[_0xda44('0x3f')][_0xda44('0x68')]({'where':{'id':_0x1bd613['params']['id']}})[_0xda44('0x14')](handleEntityNotFound(_0x391726,null))[_0xda44('0x14')](function(_0x31c83f){if(_0x31c83f){_0x3f4f76=_0x31c83f;_0x42af0b['model']=_[_0xda44('0x46')](db[_0xda44('0x91')][_0xda44('0x40')]);_0x42af0b[_0xda44('0x45')]=_['keys'](_0x1bd613[_0xda44('0x45')]);_0x42af0b[_0xda44('0x47')]=_[_0xda44('0x48')](_0x42af0b['model'],_0x42af0b[_0xda44('0x45')]);_0x3d2b0c[_0xda44('0x49')]=_[_0xda44('0x48')](_0x42af0b[_0xda44('0x44')],qs[_0xda44('0x4a')](_0x1bd613[_0xda44('0x45')]['fields']));_0x3d2b0c['attributes']=_0x3d2b0c['attributes']['length']?_0x3d2b0c['attributes']:_0x42af0b[_0xda44('0x44')];_0x3d2b0c[_0xda44('0x62')]=qs['sort'](_0x1bd613[_0xda44('0x45')][_0xda44('0x4e')]);_0x3d2b0c['where']=qs[_0xda44('0x47')](_[_0xda44('0x50')](_0x1bd613[_0xda44('0x45')],_0x42af0b[_0xda44('0x47')]));if(_0x1bd613[_0xda44('0x45')][_0xda44('0x53')]){_0x3d2b0c[_0xda44('0x4f')]=_[_0xda44('0x51')](_0x3d2b0c['where'],{'$or':_['map'](_0x3d2b0c[_0xda44('0x49')],function(_0xf77626){var _0x36c96d={};_0x36c96d[_0xf77626]={'$like':'%'+_0x1bd613[_0xda44('0x45')][_0xda44('0x53')]+'%'};return _0x36c96d;})});}_0x3d2b0c=_[_0xda44('0x51')]({},_0x3d2b0c,_0x1bd613[_0xda44('0x58')]);return _0x3f4f76['getApplications'](_0x3d2b0c);}})['then'](function(_0x1127d0){if(_0x1127d0){_0x163bbf=_0x1127d0[_0xda44('0x4b')];if(!_0x1bd613[_0xda44('0x45')][_0xda44('0x4c')](_0xda44('0x4d'))){_0x3d2b0c[_0xda44('0x21')]=qs[_0xda44('0x21')](_0x1bd613[_0xda44('0x45')][_0xda44('0x21')]);_0x3d2b0c[_0xda44('0x1f')]=qs['offset'](_0x1bd613[_0xda44('0x45')][_0xda44('0x1f')]);}return _0x3f4f76[_0xda44('0x96')](_0x3d2b0c);}})['then'](function(_0x3150a2){if(_0x3150a2){return _0x3150a2?{'count':_0x163bbf,'rows':_0x3150a2}:null;}})[_0xda44('0x14')](respondWithResult(_0x391726,null))[_0xda44('0x1c')](handleError(_0x391726,null));};exports[_0xda44('0x97')]=function(_0x2d0f09,_0x45e2a4){var _0x6eb85a={'raw':!![],'where':{}};var _0x173f29={};var _0x43ad7c={'count':0x0,'rows':[]};return db[_0xda44('0x3f')][_0xda44('0x68')]({'where':{'id':_0x2d0f09[_0xda44('0x5c')]['id']}})['then'](handleEntityNotFound(_0x45e2a4,null))[_0xda44('0x14')](function(_0x2bdcc6){if(_0x2bdcc6){_0x173f29[_0xda44('0x44')]=_['keys'](db[_0xda44('0x98')][_0xda44('0x40')]);_0x173f29['query']=_[_0xda44('0x46')](_0x2d0f09[_0xda44('0x45')]);_0x173f29[_0xda44('0x47')]=_[_0xda44('0x48')](_0x173f29['model'],_0x173f29[_0xda44('0x45')]);_0x6eb85a['attributes']=_['intersection'](_0x173f29['model'],qs[_0xda44('0x4a')](_0x2d0f09[_0xda44('0x45')]['fields']));_0x6eb85a[_0xda44('0x49')]=_0x6eb85a['attributes']['length']?_0x6eb85a[_0xda44('0x49')]:_0x173f29[_0xda44('0x44')];if(!_0x2d0f09[_0xda44('0x45')][_0xda44('0x4c')](_0xda44('0x4d'))){_0x6eb85a['limit']=qs[_0xda44('0x21')](_0x2d0f09[_0xda44('0x45')]['limit']);_0x6eb85a[_0xda44('0x1f')]=qs[_0xda44('0x1f')](_0x2d0f09[_0xda44('0x45')][_0xda44('0x1f')]);}_0x6eb85a[_0xda44('0x62')]=qs[_0xda44('0x4e')](_0x2d0f09[_0xda44('0x45')][_0xda44('0x4e')]);_0x6eb85a[_0xda44('0x4f')]=qs[_0xda44('0x47')](_[_0xda44('0x50')](_0x2d0f09[_0xda44('0x45')],_0x173f29['filters']));_0x6eb85a[_0xda44('0x4f')][_0xda44('0x63')]=_0x2bdcc6['id'];if(_0x2d0f09['query']['filter']){_0x6eb85a[_0xda44('0x4f')]=_['merge'](_0x6eb85a['where'],{'$or':_[_0xda44('0x3e')](_0x6eb85a[_0xda44('0x49')],function(_0x588c53){var _0x4b8f1d={};_0x4b8f1d[_0x588c53]={'$like':'%'+_0x2d0f09['query'][_0xda44('0x53')]+'%'};return _0x4b8f1d;})});}if(_0x2d0f09[_0xda44('0x45')][_0xda44('0x99')]){var _0xc0f924=_0x2d0f09['query'][_0xda44('0x99')][_0xda44('0x9a')](',');var _0x2bf995={};_0x2bf995[_0xc0f924[0x0]]={'$gte':moment(_0xc0f924[0x1])[_0xda44('0x9b')](_0xda44('0x9c'))};_0x6eb85a[_0xda44('0x4f')]=_['merge'](_0x6eb85a[_0xda44('0x4f')],_0x2bf995);}_0x6eb85a=_[_0xda44('0x51')]({},_0x6eb85a,_0x2d0f09[_0xda44('0x58')]);return db[_0xda44('0x98')][_0xda44('0x22')]({'where':_0x6eb85a[_0xda44('0x4f')]})[_0xda44('0x14')](function(_0x124133){_0x43ad7c[_0xda44('0x22')]=_0x124133;if(_0x2d0f09['query'][_0xda44('0x54')]){_0x6eb85a[_0xda44('0x55')]=[{'all':!![]}];}return db[_0xda44('0x98')][_0xda44('0x56')](_0x6eb85a);})['then'](function(_0x1cea01){if(_0x2d0f09[_0xda44('0x45')][_0xda44('0x9d')]===_0xda44('0x9e')){for(var _0x50f89c=0x0;_0x50f89c<_0x1cea01['length'];_0x50f89c++){_0x1cea01[_0x50f89c][_0xda44('0x5a')]=juice(_0x1cea01[_0x50f89c][_0xda44('0x5a')]);}}_0x43ad7c[_0xda44('0x69')]=_0x1cea01;return _0x43ad7c;});}})[_0xda44('0x14')](respondWithFilteredResult(_0x45e2a4,_0x6eb85a))['catch'](handleError(_0x45e2a4,null));};exports[_0xda44('0x2c')]=function(_0x42e6fb,_0x3b6661){var _0x2d3f84,_0xd7727={},_0x3ccfe0;if(_0x42e6fb[_0xda44('0x5a')]['to']){_0x3ccfe0=_0x42e6fb[_0xda44('0x5a')]['to'][_0xda44('0x9a')](',')[0x0];}return db['MailAccount'][_0xda44('0x59')]({'where':{'id':_0x42e6fb[_0xda44('0x5c')]['id']},'include':[{'model':db[_0xda44('0x9f')],'as':'List','include':[{'model':db[_0xda44('0xa0')],'as':_0xda44('0xa1'),'where':{'email':_0x3ccfe0},'limit':0x1,'order':[[_0xda44('0xa2'),_0xda44('0xa3')]]}]},{'model':db[_0xda44('0x3b')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xda44('0xa4')],'as':_0xda44('0xa4'),'raw':!![]}]}]})[_0xda44('0x14')](handleEntityNotFound(_0x3b6661,null))[_0xda44('0x14')](function(_0x10d026){if(!_0x10d026)return;_0x2d3f84=_0x10d026;if(!_0x10d026[_0xda44('0x31')])throw new Error(_0xda44('0xa5'));if(_[_0xda44('0x6c')](_0x42e6fb[_0xda44('0x5a')][_0xda44('0xa6')])){_0x42e6fb[_0xda44('0x5a')][_0xda44('0xa6')]=util[_0xda44('0x9b')](_0xda44('0xa7'),_0x10d026['name'],_0x10d026[_0xda44('0xa8')]||_0x10d026[_0xda44('0x31')]['user']);}if(_0x42e6fb[_0xda44('0x5a')][_0xda44('0xa9')]&&_0x42e6fb['body'][_0xda44('0xa9')][_0xda44('0x4b')]){for(var _0x3fc38c=0x0;_0x3fc38c<_0x42e6fb[_0xda44('0x5a')]['attachments'][_0xda44('0x4b')];_0x3fc38c+=0x1){_0x42e6fb[_0xda44('0x5a')]['attachments'][_0x3fc38c]={'filename':_0x42e6fb['body'][_0xda44('0xa9')][_0x3fc38c][_0xda44('0x2b')],'path':path['join'](config['root'],'server/files/attachments',_0x42e6fb[_0xda44('0x5a')][_0xda44('0xa9')][_0x3fc38c]['basename'])};}}var _0x3b67ab=getSmtpOptions(_0x10d026);return respondWithRpcPromise(_0xda44('0xaa'),_0xda44('0xab'),{'account':_0x3b67ab,'message':_0x42e6fb[_0xda44('0x5a')]});})[_0xda44('0x14')](function(_0xd14093){if(!_0xd14093)return;_0xd7727=_0xd14093;if(!_0x2d3f84[_0xda44('0xac')])throw new Error(_0xda44('0xad'));if(_0x2d3f84[_0xda44('0xac')][_0xda44('0xa1')]['length'])return _0x2d3f84['List'][_0xda44('0xa1')][0x0];return db[_0xda44('0xa0')]['create'](_['defaults'](_0x42e6fb[_0xda44('0x5a')],{'firstName':_0x42e6fb[_0xda44('0x5a')]['to'],'email':_0x42e6fb[_0xda44('0x5a')]['to'],'phone':_0x42e6fb[_0xda44('0x5a')]['to'],'ListId':_0x2d3f84[_0xda44('0x6b')]}));})[_0xda44('0x14')](function(_0x26c1ac){if(!_0x26c1ac)return;var _0x181fe5={'UserId':_0x42e6fb['user']['id'],'ContactId':_0x26c1ac['id'],'MailAccountId':_0x2d3f84['id'],'inReplyTo':_0xd7727[_0xda44('0xae')],'to':_0x42e6fb[_0xda44('0x5a')][_0xda44('0xa6')],'cc':_0x42e6fb['body']['cc'],'subject':_0x42e6fb[_0xda44('0x5a')][_0xda44('0xaf')],'attach':_0x42e6fb[_0xda44('0x5a')]['attach'],'firstMsgDirection':'out','lastMsgAt':moment()[_0xda44('0x9b')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0xda44('0xb0'),'Messages':[_[_0xda44('0x51')](_0x42e6fb[_0xda44('0x5a')],{'messageId':_0xd7727[_0xda44('0xae')],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x2d3f84['id'],'UserId':_0x42e6fb[_0xda44('0x36')]['id'],'ContactId':_0x26c1ac['id']})]};if(_0x42e6fb[_0xda44('0x5a')][_0xda44('0xb1')]){_0x181fe5=_[_0xda44('0x51')](_0x181fe5,_0x42e6fb[_0xda44('0x5a')][_0xda44('0xb1')]);}return db[_0xda44('0x82')]['create'](_0x181fe5,{'include':[{'model':db[_0xda44('0x98')],'as':_0xda44('0xb2')}]});})['then'](respondWithResult(_0x3b6661,null))[_0xda44('0x1c')](handleError(_0x3b6661,null));};exports[_0xda44('0xb3')]=function(_0x4de4eb,_0x26b448){return db['MailAccount']['find']({'where':{'id':_0x4de4eb['params']['id']},'include':[{'model':db[_0xda44('0x3b')],'as':_0xda44('0x31'),'raw':!![],'include':[{'model':db[_0xda44('0xa4')],'as':_0xda44('0xa4'),'raw':!![]}]}]})[_0xda44('0x14')](handleEntityNotFound(_0x26b448,null))[_0xda44('0x14')](function(_0x393ac2){if(!_0x393ac2['Smtp'])return;var _0x54b540=getSmtpOptions(_0x393ac2);return respondWithRpcPromise(_0xda44('0xb4'),_0xda44('0xb3'),{'account':_0x54b540});})['then'](respondWithResult(_0x26b448,null))[_0xda44('0x1c')](handleError(_0x26b448,null));};exports[_0xda44('0x26')]=function(_0x5a4e98,_0x2072f4){return db[_0xda44('0x3f')][_0xda44('0x59')]({'where':{'id':_0x5a4e98[_0xda44('0x5c')]['id']}})[_0xda44('0x14')](handleEntityNotFound(_0x2072f4,null))[_0xda44('0x14')](function(_0x326b9d){if(_0x326b9d&&_0x326b9d[_0xda44('0x2f')]){throw new db['Sequelize'][(_0xda44('0xb5'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x326b9d;})[_0xda44('0x14')](removeEntity(_0x2072f4,null))[_0xda44('0x1c')](handleError(_0x2072f4,null));};exports['addAgents']=function(_0x5aa67c,_0x146b09){return db[_0xda44('0x3f')]['find']({'where':{'id':_0x5aa67c[_0xda44('0x5c')]['id']}})['then'](handleEntityNotFound(_0x146b09,null))[_0xda44('0x14')](function(_0x5ea79d){if(_0x5ea79d){return _0x5ea79d[_0xda44('0xb6')](_0x5aa67c[_0xda44('0x5a')][_0xda44('0x65')],_[_0xda44('0x80')](_0x5aa67c[_0xda44('0x5a')],[_0xda44('0x65'),'id'])||{})['spread'](function(_0x1c8672){for(var _0x422a57=0x0;_0x422a57<_0x5aa67c[_0xda44('0x5a')]['ids'][_0xda44('0x4b')];_0x422a57+=0x1){socket['emit'](_0xda44('0xb7'),{'UserId':Number(_0x5aa67c['body']['ids'][_0x422a57]),'MailAccountId':Number(_0x5aa67c['params']['id'])});}return _0x1c8672;});}})[_0xda44('0x14')](respondWithResult(_0x146b09,null))[_0xda44('0x1c')](handleError(_0x146b09,null));};exports[_0xda44('0xb8')]=function(_0x3c4e02,_0x3a89e0){return db[_0xda44('0x3f')][_0xda44('0x59')]({'where':{'id':_0x3c4e02[_0xda44('0x5c')]['id']}})[_0xda44('0x14')](handleEntityNotFound(_0x3a89e0,null))['then'](function(_0x3b23b2){if(_0x3b23b2){return _0x3b23b2[_0xda44('0xb8')](_0x3c4e02[_0xda44('0x45')][_0xda44('0x65')])[_0xda44('0x14')](function(){if(_[_0xda44('0xb9')](_0x3c4e02['query'][_0xda44('0x65')])){for(var _0xd559a6=0x0;_0xd559a6<_0x3c4e02[_0xda44('0x45')][_0xda44('0x65')][_0xda44('0x4b')];_0xd559a6+=0x1){socket['emit']('userMailAccount:remove',{'UserId':Number(_0x3c4e02[_0xda44('0x45')]['ids'][_0xd559a6]),'MailAccountId':Number(_0x3c4e02[_0xda44('0x5c')]['id'])});}}else{socket['emit']('userMailAccount:remove',{'UserId':Number(_0x3c4e02[_0xda44('0x45')][_0xda44('0x65')]),'MailAccountId':Number(_0x3c4e02[_0xda44('0x5c')]['id'])});}});}})[_0xda44('0x14')](respondWithStatusCode(_0x3a89e0,null))[_0xda44('0x1c')](handleError(_0x3a89e0,null));};exports['getAgents']=function(_0xf42b4f,_0x8781b){var _0x2d2263={};var _0xe8c37c={};var _0x29fc87;var _0x409ed9;return db[_0xda44('0x3f')][_0xda44('0x68')]({'where':{'id':_0xf42b4f[_0xda44('0x5c')]['id']}})[_0xda44('0x14')](handleEntityNotFound(_0x8781b,null))['then'](function(_0x39743c){if(_0x39743c){_0x29fc87=_0x39743c;_0xe8c37c[_0xda44('0x44')]=_[_0xda44('0x46')](db['User']['rawAttributes']);_0xe8c37c[_0xda44('0x45')]=_[_0xda44('0x46')](_0xf42b4f[_0xda44('0x45')]);_0xe8c37c[_0xda44('0x47')]=_[_0xda44('0x48')](_0xe8c37c['model'],_0xe8c37c[_0xda44('0x45')]);_0x2d2263[_0xda44('0x49')]=_[_0xda44('0x48')](_0xe8c37c[_0xda44('0x44')],qs[_0xda44('0x4a')](_0xf42b4f['query'][_0xda44('0x4a')]));_0x2d2263[_0xda44('0x49')]=_0x2d2263[_0xda44('0x49')][_0xda44('0x4b')]?_0x2d2263['attributes']:_0xe8c37c['model'];_0x2d2263[_0xda44('0x62')]=qs[_0xda44('0x4e')](_0xf42b4f[_0xda44('0x45')]['sort']);_0x2d2263['where']=qs[_0xda44('0x47')](_[_0xda44('0x50')](_0xf42b4f['query'],_0xe8c37c[_0xda44('0x47')]));if(_0xf42b4f[_0xda44('0x45')][_0xda44('0x53')]){_0x2d2263[_0xda44('0x4f')]=_[_0xda44('0x51')](_0x2d2263[_0xda44('0x4f')],{'$or':_[_0xda44('0x3e')](_0x2d2263[_0xda44('0x49')],function(_0x1545ca){var _0x47632b={};_0x47632b[_0x1545ca]={'$like':'%'+_0xf42b4f[_0xda44('0x45')][_0xda44('0x53')]+'%'};return _0x47632b;})});}_0x2d2263=_[_0xda44('0x51')]({},_0x2d2263,_0xf42b4f['options']);return _0x29fc87[_0xda44('0xba')](_0x2d2263);}})['then'](function(_0x49a171){if(_0x49a171){_0x409ed9=_0x49a171[_0xda44('0x4b')];if(!_0xf42b4f[_0xda44('0x45')][_0xda44('0x4c')](_0xda44('0x4d'))){_0x2d2263[_0xda44('0x21')]=qs[_0xda44('0x21')](_0xf42b4f[_0xda44('0x45')][_0xda44('0x21')]);_0x2d2263[_0xda44('0x1f')]=qs[_0xda44('0x1f')](_0xf42b4f[_0xda44('0x45')][_0xda44('0x1f')]);}return _0x29fc87[_0xda44('0xba')](_0x2d2263);}})['then'](function(_0x4876cc){if(_0x4876cc){return _0x4876cc?{'count':_0x409ed9,'rows':_0x4876cc}:null;}})['then'](respondWithResult(_0x8781b,null))['catch'](handleError(_0x8781b,null));};
\ No newline at end of file
index 8e9d256..3f14ad6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0298=['hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','setMaxListeners','save','update','remove','emit'];(function(_0x46800d,_0x588500){var _0x3824cd=function(_0x14b132){while(--_0x14b132){_0x46800d['push'](_0x46800d['shift']());}};_0x3824cd(++_0x588500);}(_0x0298,0x1bb));var _0x8029=function(_0x2e7577,_0xee78c1){_0x2e7577=_0x2e7577-0x0;var _0x364cf3=_0x0298[_0x2e7577];return _0x364cf3;};'use strict';var EventEmitter=require(_0x8029('0x0'));var MailAccount=require(_0x8029('0x1'))['db'][_0x8029('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x8029('0x3')](0x0);var events={'afterCreate':_0x8029('0x4'),'afterUpdate':_0x8029('0x5'),'afterDestroy':_0x8029('0x6')};function emitEvent(_0x5c4fe7){return function(_0x46de94,_0x1df48e,_0x1ad32c){MailAccountEvents[_0x8029('0x7')](_0x5c4fe7+':'+_0x46de94['id'],_0x46de94);MailAccountEvents[_0x8029('0x7')](_0x5c4fe7,_0x46de94);_0x1ad32c(null);};}for(var e in events){if(events[_0x8029('0x8')](e)){var event=events[e];MailAccount[_0x8029('0x9')](e,emitEvent(event));}}module[_0x8029('0xa')]=MailAccountEvents;
\ No newline at end of file
+var _0xc891=['hook','exports','events','setMaxListeners','update','remove','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc891,0x152));var _0x1c89=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xc891[_0x3054be];return _0x3df150;};'use strict';var EventEmitter=require(_0x1c89('0x0'));var MailAccount=require('../../mysqldb')['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x1c89('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1c89('0x2'),'afterDestroy':_0x1c89('0x3')};function emitEvent(_0x44c352){return function(_0x521644,_0x3daf92,_0x3ae4ba){MailAccountEvents[_0x1c89('0x4')](_0x44c352+':'+_0x521644['id'],_0x521644);MailAccountEvents[_0x1c89('0x4')](_0x44c352,_0x521644);_0x3ae4ba(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x1c89('0x5')](e,emitEvent(event));}}module[_0x1c89('0x6')]=MailAccountEvents;
\ No newline at end of file
index d51001e..a0b0569 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3090=['request-promise','path','../../config/environment','exports','MailAccount','util','api','moment'];(function(_0x267f82,_0xb6de9c){var _0x5a7769=function(_0x4bf74f){while(--_0x4bf74f){_0x267f82['push'](_0x267f82['shift']());}};_0x5a7769(++_0xb6de9c);}(_0x3090,0xe5));var _0x0309=function(_0x3c532a,_0x5582db){_0x3c532a=_0x3c532a-0x0;var _0x63508c=_0x3090[_0x3c532a];return _0x63508c;};'use strict';var _=require('lodash');var util=require(_0x0309('0x0'));var logger=require('../../config/logger')(_0x0309('0x1'));var moment=require(_0x0309('0x2'));var BPromise=require('bluebird');var rp=require(_0x0309('0x3'));var fs=require('fs');var path=require(_0x0309('0x4'));var rimraf=require('rimraf');var config=require(_0x0309('0x5'));var attributes=require('./mailAccount.attributes');module[_0x0309('0x6')]=function(_0x5b5caa,_0x3f7d70){return _0x5b5caa['define'](_0x0309('0x7'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x68c5=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailAccount.attributes','exports','define','mail_accounts','lodash','util'];(function(_0x45d80c,_0x35c0ff){var _0x449a98=function(_0x1b5ab7){while(--_0x1b5ab7){_0x45d80c['push'](_0x45d80c['shift']());}};_0x449a98(++_0x35c0ff);}(_0x68c5,0x178));var _0x568c=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x68c5[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x568c('0x0'));var util=require(_0x568c('0x1'));var logger=require(_0x568c('0x2'))(_0x568c('0x3'));var moment=require(_0x568c('0x4'));var BPromise=require(_0x568c('0x5'));var rp=require(_0x568c('0x6'));var fs=require('fs');var path=require(_0x568c('0x7'));var rimraf=require(_0x568c('0x8'));var config=require(_0x568c('0x9'));var attributes=require(_0x568c('0xa'));module[_0x568c('0xb')]=function(_0x26eacf,_0x404bdf){return _0x26eacf[_0x568c('0xc')]('MailAccount',attributes,{'tableName':_0x568c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 07ecf5a..e230a53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe977=['from','account','CmList','DESC','MailApplication','Applications','MailServerOut','Smtp','get','List','applications','list','orderBy','priority','asc','autoclose','close','Contacts','length','ListId','create','contact','messageId','generate','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','subject','interaction','created','originCc','bcc','ChatWebsiteId','originChannel','ChatOfflineMessageId','Attachment','Attachments','User','UserId','agent','*,*,*,*','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./mailAccount.socket','register','request','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','MailAccount,\x20%s,\x20%s','message','info','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','limit','model','attributes','include','map','then','stringify','ShowMailAccount','find','body','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','isNil','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes'];(function(_0x10c6af,_0x1ab68e){var _0xa0dba8=function(_0x4f6a10){while(--_0x4f6a10){_0x10c6af['push'](_0x10c6af['shift']());}};_0xa0dba8(++_0x1ab68e);}(_0xe977,0x100));var _0x7e97=function(_0x588521,_0x11e715){_0x588521=_0x588521-0x0;var _0x314ebc=_0xe977[_0x588521];return _0x314ebc;};'use strict';var _=require(_0x7e97('0x0'));var util=require(_0x7e97('0x1'));var moment=require(_0x7e97('0x2'));var BPromise=require(_0x7e97('0x3'));var rs=require(_0x7e97('0x4'));var fs=require('fs');var Redis=require(_0x7e97('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7e97('0x6'))(_0x7e97('0x7'));var config=require('../../config/environment');var jayson=require(_0x7e97('0x8'));var client=jayson[_0x7e97('0x9')][_0x7e97('0xa')]({'port':0x232c});config[_0x7e97('0xb')]=_[_0x7e97('0xc')](config[_0x7e97('0xb')],{'host':_0x7e97('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7e97('0xb')]));require(_0x7e97('0xe'))[_0x7e97('0xf')](socket);function respondWithRpcPromise(_0x39cad6,_0x19cff4,_0xd95a7a){return new BPromise(function(_0xd0e93c,_0x2e5a4f){return client[_0x7e97('0x10')](_0x39cad6,_0xd95a7a)['then'](function(_0x2726f2){logger['info']('MailAccount,\x20%s,\x20%s',_0x19cff4,_0x7e97('0x11'));logger[_0x7e97('0x12')](_0x7e97('0x13'),_0x19cff4,_0x7e97('0x11'),JSON['stringify'](_0x2726f2));if(_0x2726f2[_0x7e97('0x14')]){if(_0x2726f2['error'][_0x7e97('0x15')]===0x1f4){logger[_0x7e97('0x14')](_0x7e97('0x16'),_0x19cff4,_0x2726f2[_0x7e97('0x14')][_0x7e97('0x17')]);return _0x2e5a4f(_0x2726f2[_0x7e97('0x14')][_0x7e97('0x17')]);}logger[_0x7e97('0x14')](_0x7e97('0x16'),_0x19cff4,_0x2726f2[_0x7e97('0x14')][_0x7e97('0x17')]);return _0xd0e93c(_0x2726f2['error'][_0x7e97('0x17')]);}else{logger[_0x7e97('0x18')](_0x7e97('0x16'),_0x19cff4,'request\x20sent');_0xd0e93c(_0x2726f2[_0x7e97('0x19')][_0x7e97('0x17')]);}})[_0x7e97('0x1a')](function(_0x51cdc6){logger[_0x7e97('0x14')](_0x7e97('0x16'),_0x19cff4,_0x51cdc6);_0x2e5a4f(_0x51cdc6);});});}exports[_0x7e97('0x1b')]=function(_0x4ed5e5){var _0x3c878f=this;return new Promise(function(_0x39ee45,_0x2ed256){return db[_0x7e97('0x1c')][_0x7e97('0x1d')]({'raw':_0x4ed5e5[_0x7e97('0x1e')]?_0x4ed5e5[_0x7e97('0x1e')][_0x7e97('0x1f')]===undefined?!![]:![]:!![],'where':_0x4ed5e5['options']?_0x4ed5e5['options'][_0x7e97('0x20')]||null:null,'attributes':_0x4ed5e5['options']?_0x4ed5e5[_0x7e97('0x1e')]['attributes']||null:null,'limit':_0x4ed5e5[_0x7e97('0x1e')]?_0x4ed5e5[_0x7e97('0x1e')][_0x7e97('0x21')]||null:null,'include':_0x4ed5e5[_0x7e97('0x1e')]?_0x4ed5e5[_0x7e97('0x1e')]['include']?_['map'](_0x4ed5e5[_0x7e97('0x1e')]['include'],function(_0x33245b){return{'model':db[_0x33245b[_0x7e97('0x22')]],'as':_0x33245b['as'],'attributes':_0x33245b[_0x7e97('0x23')],'include':_0x33245b[_0x7e97('0x24')]?_[_0x7e97('0x25')](_0x33245b[_0x7e97('0x24')],function(_0xaf1315){return{'model':db[_0xaf1315[_0x7e97('0x22')]],'as':_0xaf1315['as'],'attributes':_0xaf1315[_0x7e97('0x23')],'include':_0xaf1315[_0x7e97('0x24')]?_[_0x7e97('0x25')](_0xaf1315['include'],function(_0x41b582){return{'model':db[_0x41b582[_0x7e97('0x22')]],'as':_0x41b582['as'],'attributes':_0x41b582[_0x7e97('0x23')]};}):[]};}):[]};}):[]:[]})[_0x7e97('0x26')](function(_0x34df4d){logger[_0x7e97('0x18')](_0x7e97('0x1b'),_0x4ed5e5);logger[_0x7e97('0x12')](_0x7e97('0x1b'),_0x4ed5e5,JSON[_0x7e97('0x27')](_0x34df4d));_0x39ee45(_0x34df4d);})[_0x7e97('0x1a')](function(_0x2c7f3a){logger[_0x7e97('0x14')](_0x7e97('0x1b'),_0x2c7f3a[_0x7e97('0x17')],_0x4ed5e5);_0x2ed256(_0x3c878f[_0x7e97('0x14')](0x1f4,_0x2c7f3a[_0x7e97('0x17')]));});});};exports[_0x7e97('0x28')]=function(_0x3e597f){var _0x2f1026=this;return new Promise(function(_0x150022,_0x143c8c){return db['MailAccount'][_0x7e97('0x29')]({'raw':_0x3e597f[_0x7e97('0x1e')]?_0x3e597f[_0x7e97('0x1e')][_0x7e97('0x1f')]===undefined?!![]:![]:!![],'where':_0x3e597f[_0x7e97('0x1e')]?_0x3e597f[_0x7e97('0x1e')][_0x7e97('0x20')]||null:null,'attributes':_0x3e597f[_0x7e97('0x1e')]?_0x3e597f['options'][_0x7e97('0x23')]||null:null,'include':_0x3e597f['options']?_0x3e597f[_0x7e97('0x1e')]['include']?_[_0x7e97('0x25')](_0x3e597f[_0x7e97('0x1e')][_0x7e97('0x24')],function(_0x7ee17a){return{'model':db[_0x7ee17a[_0x7e97('0x22')]],'as':_0x7ee17a['as'],'attributes':_0x7ee17a[_0x7e97('0x23')],'include':_0x7ee17a['include']?_[_0x7e97('0x25')](_0x7ee17a[_0x7e97('0x24')],function(_0x586f00){return{'model':db[_0x586f00[_0x7e97('0x22')]],'as':_0x586f00['as'],'attributes':_0x586f00[_0x7e97('0x23')],'include':_0x586f00[_0x7e97('0x24')]?_['map'](_0x586f00['include'],function(_0x5bae22){return{'model':db[_0x5bae22[_0x7e97('0x22')]],'as':_0x5bae22['as'],'attributes':_0x5bae22[_0x7e97('0x23')]};}):[]};}):[]};}):[]:[]})[_0x7e97('0x26')](function(_0x3403b5){logger[_0x7e97('0x18')]('ShowMailAccount',_0x3e597f);logger[_0x7e97('0x12')](_0x7e97('0x28'),_0x3e597f,JSON[_0x7e97('0x27')](_0x3403b5));_0x150022(_0x3403b5);})['catch'](function(_0x3fe11c){logger['error']('ShowMailAccount',_0x3fe11c['message'],_0x3e597f);_0x143c8c(_0x2f1026[_0x7e97('0x14')](0x1f4,_0x3fe11c[_0x7e97('0x17')]));});});};exports['NotifyMailAccount']=function(_0x3457eb){var _0x129027=this;return new Promise(function(_0x5e78cc,_0x57029e){var _0x5b638e={'body':_0x3457eb[_0x7e97('0x2a')],'channel':_0x7e97('0x2b')};var _0x59a858=_[_0x7e97('0x2c')](_[_0x7e97('0x2d')](db[_0x7e97('0x2e')][_0x7e97('0x2f')]),[_0x7e97('0x30'),_0x7e97('0x31'),_0x7e97('0x32'),'ListId']);var _0x3a36eb=![];if(_0x3457eb['body']['id']){delete _0x3457eb[_0x7e97('0x2a')]['id'];}if(_[_0x7e97('0x33')](_0x3457eb[_0x7e97('0x2a')]['from'])){return _0x57029e(_0x129027[_0x7e97('0x14')](0x1f4,_0x7e97('0x34')));}if(_['isNil'](_0x3457eb[_0x7e97('0x2a')][_0x7e97('0x2a')])||_0x3457eb[_0x7e97('0x2a')][_0x7e97('0x2a')]===''){return _0x57029e(_0x129027[_0x7e97('0x14')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x7e97('0x33')](_0x3457eb['body'][_0x7e97('0x35')])){return _0x57029e(_0x129027['error'](0x1f4,_0x7e97('0x36')+_0x59a858));}if(!_[_0x7e97('0x37')](_0x59a858,_0x3457eb[_0x7e97('0x2a')][_0x7e97('0x35')])){return _0x57029e(_0x129027[_0x7e97('0x14')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x59a858));}var _0x164ce1={};_0x164ce1[_0x3457eb[_0x7e97('0x2a')]['mapKey']]=_0x3457eb[_0x7e97('0x2a')][_0x7e97('0x38')];return db[_0x7e97('0x1c')]['find']({'where':{'id':_0x3457eb[_0x7e97('0x39')]['id']},'include':[{'model':db[_0x7e97('0x3a')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':_0x164ce1,'limit':0x1,'order':[['updatedAt',_0x7e97('0x3b')]]}]},{'model':db[_0x7e97('0x3c')],'as':_0x7e97('0x3d')},{'model':db[_0x7e97('0x3e')],'as':_0x7e97('0x3f')}]})[_0x7e97('0x26')](function(_0x1d0f28){if(_0x1d0f28&&_0x1d0f28['List']){var _0x568f50=_0x1d0f28[_0x7e97('0x40')]({'plain':!![]});_0x5b638e[_0x7e97('0x39')]=_['omit'](_0x568f50,[_0x7e97('0x3d'),_0x7e97('0x41')]);_0x5b638e[_0x7e97('0x42')]=_0x568f50[_0x7e97('0x3d')];_0x5b638e[_0x7e97('0x43')]=_0x568f50['List'];_0x5b638e[_0x7e97('0x42')]=_[_0x7e97('0x44')](_0x5b638e['applications'],[_0x7e97('0x45')],[_0x7e97('0x46')]);if(_0x5b638e['account']&&_0x5b638e[_0x7e97('0x39')][_0x7e97('0x47')]){_0x5b638e['applications']['push']({'id':0x0,'priority':_0x5b638e['applications']['length']+0x1,'app':_0x7e97('0x48'),'appdata':'autoclose','interval':'*,*,*,*'});}if(_0x5b638e[_0x7e97('0x39')][_0x7e97('0x3d')]){delete _0x5b638e[_0x7e97('0x39')][_0x7e97('0x3d')];}if(_0x5b638e['account'][_0x7e97('0x41')]){delete _0x5b638e[_0x7e97('0x39')][_0x7e97('0x41')];}if(_0x568f50['List'][_0x7e97('0x49')][_0x7e97('0x4a')]){return _0x568f50['List'][_0x7e97('0x49')][0x0];}var _0x46c429=_[_0x7e97('0xc')](_0x3457eb[_0x7e97('0x2a')],{'firstName':_0x3457eb['body'][_0x7e97('0x38')],'ListId':_0x568f50[_0x7e97('0x4b')]});_0x46c429[_0x3457eb[_0x7e97('0x2a')][_0x7e97('0x35')]]=_0x3457eb[_0x7e97('0x2a')][_0x7e97('0x38')];return db['CmContact'][_0x7e97('0x4c')](_0x46c429);}else{throw new Error('List\x20not\x20found');}})[_0x7e97('0x26')](function(_0x1b444c){_0x5b638e[_0x7e97('0x4d')]=_0x1b444c;if(_0x1b444c){if(!_0x3457eb['body'][_0x7e97('0x17')]['messageId']){_0x3457eb['body'][_0x7e97('0x17')][_0x7e97('0x4e')]=rs[_0x7e97('0x4f')]()+'\x20'+_0x3457eb[_0x7e97('0x2a')][_0x7e97('0x17')]['from'];}var _0x278bf0={'ContactId':_0x1b444c['id'],'MailAccountId':_0x3457eb[_0x7e97('0x39')]['id'],'inReplyTo':_0x3457eb[_0x7e97('0x2a')]['message']['messageId'],'to':_0x3457eb['body'][_0x7e97('0x17')][_0x7e97('0x38')],'cc':_0x3457eb['body']['message']['cc'],'subject':_0x3457eb['body'][_0x7e97('0x17')]['subject'],'attach':_0x3457eb['body'][_0x7e97('0x17')][_0x7e97('0x50')],'lastMsgAt':moment()[_0x7e97('0x51')](_0x7e97('0x52')),'lastMsgDirection':'in'};return db[_0x7e97('0x53')]['find']({'where':{'closed':![],'MailAccountId':_0x3457eb['account']['id']},'include':[{'model':db[_0x7e97('0x54')],'as':_0x7e97('0x55'),'attributes':[_0x7e97('0x4e')],'where':{'messageId':_0x3457eb[_0x7e97('0x2a')][_0x7e97('0x17')][_0x7e97('0x56')]}}]})[_0x7e97('0x26')](function(_0x57d1c1){if(_0x57d1c1){return[_0x57d1c1,![]];}return db[_0x7e97('0x53')][_0x7e97('0x4c')](_0x278bf0)[_0x7e97('0x26')](function(_0x4cba2f){return[_0x4cba2f,!![]];});});}else{throw new Error(_0x7e97('0x57'));}})[_0x7e97('0x58')](function(_0x132187,_0x246b11){if(_0x132187){_0x3a36eb=_0x246b11;if(!_0x246b11){return _0x132187['update']({'inReplyTo':_0x3457eb[_0x7e97('0x2a')][_0x7e97('0x17')][_0x7e97('0x4e')],'to':_0x3457eb[_0x7e97('0x2a')][_0x7e97('0x17')]['from'],'cc':_0x3457eb[_0x7e97('0x2a')][_0x7e97('0x17')]['cc'],'subject':_0x3457eb['body']['message'][_0x7e97('0x59')],'attach':_0x132187[_0x7e97('0x50')]?_0x132187[_0x7e97('0x50')]:_0x3457eb['body'][_0x7e97('0x17')][_0x7e97('0x50')],'substatus':null,'substatusAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x7e97('0x51')](_0x7e97('0x52')),'lastMsgDirection':'in'});}else{return _0x132187;}}})['then'](function(_0x3281d9){_0x5b638e['interaction']=_0x3281d9[_0x7e97('0x40')]({'plain':!![]});_0x5b638e[_0x7e97('0x5a')][_0x7e97('0x5b')]=_0x3a36eb;return db['MailMessage']['create']({'body':_0x3457eb['body'][_0x7e97('0x2a')],'MailAccountId':_0x3457eb[_0x7e97('0x39')]['id'],'MailInteractionId':_0x3281d9['id'],'direction':'in','ContactId':_0x5b638e['contact']['id'],'messageId':_0x3457eb[_0x7e97('0x2a')]['message'][_0x7e97('0x4e')],'from':_0x3457eb[_0x7e97('0x2a')][_0x7e97('0x17')][_0x7e97('0x38')],'to':_0x3457eb[_0x7e97('0x2a')]['message']['to'],'cc':_0x3457eb[_0x7e97('0x2a')][_0x7e97('0x17')]['cc'],'subject':_0x3457eb['body'][_0x7e97('0x17')][_0x7e97('0x59')],'attach':_0x3457eb[_0x7e97('0x2a')]['message'][_0x7e97('0x50')],'Attachments':_0x3457eb[_0x7e97('0x2a')][_0x7e97('0x17')]['attachments'],'originTo':_0x3457eb['body'][_0x7e97('0x17')]['originTo'],'originCc':_0x3457eb[_0x7e97('0x2a')][_0x7e97('0x17')][_0x7e97('0x5c')],'bcc':_0x3457eb[_0x7e97('0x2a')][_0x7e97('0x17')][_0x7e97('0x5d')],'ChatWebsiteId':_0x3457eb['body'][_0x7e97('0x17')][_0x7e97('0x5e')]||null,'originChannel':_0x3457eb[_0x7e97('0x2a')][_0x7e97('0x17')][_0x7e97('0x5f')]||'Email','ChatOfflineMessageId':_0x3457eb[_0x7e97('0x2a')]['message'][_0x7e97('0x60')]||null},{'include':[{'model':db[_0x7e97('0x61')],'as':_0x7e97('0x62')}]});})[_0x7e97('0x26')](function(_0x12a296){_0x5b638e[_0x7e97('0x17')]=_0x12a296;if(_0x5b638e[_0x7e97('0x5a')]['UserId']){return db[_0x7e97('0x63')][_0x7e97('0x29')]({'attributes':['id','name'],'where':{'id':_0x5b638e[_0x7e97('0x5a')][_0x7e97('0x64')]}})[_0x7e97('0x26')](function(_0x52b9dd){if(_0x52b9dd){_0x5b638e[_0x7e97('0x42')]['unshift']({'id':0x0,'priority':0x0,'app':_0x7e97('0x65'),'appdata':_0x52b9dd['name']+','+(_0x5b638e[_0x7e97('0x39')]['waitForTheAssignedAgent']||0xa),'interval':_0x7e97('0x66')});}return respondWithRpcPromise('Start',_0x7e97('0x67'),_0x5b638e);});}return respondWithRpcPromise('Start',_0x7e97('0x67'),_0x5b638e);})[_0x7e97('0x26')](function(_0x165e92){_0x5e78cc(_0x165e92);})[_0x7e97('0x1a')](function(_0x819b45){_0x57029e(_0x129027[_0x7e97('0x14')](0x1f4,_0x819b45[_0x7e97('0x17')]));});});};
\ No newline at end of file
+var _0xe8c7=['MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','ShowMailAccount','find','stringify','NotifyMailAccount','body','mail','difference','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','account','CmList','List','Contacts','MailApplication','Applications','Smtp','omit','list','applications','orderBy','priority','asc','autoclose','push','close','*,*,*,*','length','create','contact','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','messageId','inReplyTo','spread','update','interaction','get','created','attachments','originTo','originCc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','MailAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0xe8c7,0x135));var _0x7e8c=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0xe8c7[_0x334841];return _0x5beb4b;};'use strict';var _=require(_0x7e8c('0x0'));var util=require(_0x7e8c('0x1'));var moment=require(_0x7e8c('0x2'));var BPromise=require(_0x7e8c('0x3'));var rs=require(_0x7e8c('0x4'));var fs=require('fs');var Redis=require(_0x7e8c('0x5'));var db=require(_0x7e8c('0x6'))['db'];var utils=require(_0x7e8c('0x7'));var logger=require('../../config/logger')(_0x7e8c('0x8'));var config=require(_0x7e8c('0x9'));var jayson=require(_0x7e8c('0xa'));var client=jayson[_0x7e8c('0xb')][_0x7e8c('0xc')]({'port':0x232c});config[_0x7e8c('0xd')]=_[_0x7e8c('0xe')](config[_0x7e8c('0xd')],{'host':_0x7e8c('0xf'),'port':0x18eb});var socket=require(_0x7e8c('0x10'))(new Redis(config[_0x7e8c('0xd')]));require(_0x7e8c('0x11'))[_0x7e8c('0x12')](socket);function respondWithRpcPromise(_0x128bec,_0x3fbba8,_0x113ea9){return new BPromise(function(_0x25b718,_0x3b6c51){return client['request'](_0x128bec,_0x113ea9)['then'](function(_0x3bc98e){logger['info'](_0x7e8c('0x13'),_0x3fbba8,_0x7e8c('0x14'));logger['debug'](_0x7e8c('0x15'),_0x3fbba8,_0x7e8c('0x14'),JSON['stringify'](_0x3bc98e));if(_0x3bc98e[_0x7e8c('0x16')]){if(_0x3bc98e[_0x7e8c('0x16')][_0x7e8c('0x17')]===0x1f4){logger['error']('MailAccount,\x20%s,\x20%s',_0x3fbba8,_0x3bc98e[_0x7e8c('0x16')][_0x7e8c('0x18')]);return _0x3b6c51(_0x3bc98e['error'][_0x7e8c('0x18')]);}logger[_0x7e8c('0x16')](_0x7e8c('0x13'),_0x3fbba8,_0x3bc98e['error']['message']);return _0x25b718(_0x3bc98e[_0x7e8c('0x16')][_0x7e8c('0x18')]);}else{logger[_0x7e8c('0x19')](_0x7e8c('0x13'),_0x3fbba8,_0x7e8c('0x14'));_0x25b718(_0x3bc98e[_0x7e8c('0x1a')][_0x7e8c('0x18')]);}})[_0x7e8c('0x1b')](function(_0x236193){logger[_0x7e8c('0x16')](_0x7e8c('0x13'),_0x3fbba8,_0x236193);_0x3b6c51(_0x236193);});});}exports[_0x7e8c('0x1c')]=function(_0x397d17){var _0x1a9c04=this;return new Promise(function(_0x59dec1,_0x20b2b4){return db[_0x7e8c('0x1d')][_0x7e8c('0x1e')]({'raw':_0x397d17[_0x7e8c('0x1f')]?_0x397d17[_0x7e8c('0x1f')][_0x7e8c('0x20')]===undefined?!![]:![]:!![],'where':_0x397d17[_0x7e8c('0x1f')]?_0x397d17[_0x7e8c('0x1f')][_0x7e8c('0x21')]||null:null,'attributes':_0x397d17[_0x7e8c('0x1f')]?_0x397d17['options'][_0x7e8c('0x22')]||null:null,'limit':_0x397d17[_0x7e8c('0x1f')]?_0x397d17[_0x7e8c('0x1f')][_0x7e8c('0x23')]||null:null,'include':_0x397d17[_0x7e8c('0x1f')]?_0x397d17[_0x7e8c('0x1f')][_0x7e8c('0x24')]?_[_0x7e8c('0x25')](_0x397d17[_0x7e8c('0x1f')][_0x7e8c('0x24')],function(_0x14e3cc){return{'model':db[_0x14e3cc[_0x7e8c('0x26')]],'as':_0x14e3cc['as'],'attributes':_0x14e3cc[_0x7e8c('0x22')],'include':_0x14e3cc[_0x7e8c('0x24')]?_['map'](_0x14e3cc[_0x7e8c('0x24')],function(_0x2e2941){return{'model':db[_0x2e2941[_0x7e8c('0x26')]],'as':_0x2e2941['as'],'attributes':_0x2e2941['attributes'],'include':_0x2e2941[_0x7e8c('0x24')]?_[_0x7e8c('0x25')](_0x2e2941[_0x7e8c('0x24')],function(_0x2fe2eb){return{'model':db[_0x2fe2eb['model']],'as':_0x2fe2eb['as'],'attributes':_0x2fe2eb[_0x7e8c('0x22')]};}):[]};}):[]};}):[]:[]})[_0x7e8c('0x27')](function(_0x3ee156){logger['info'](_0x7e8c('0x1c'),_0x397d17);logger[_0x7e8c('0x28')](_0x7e8c('0x1c'),_0x397d17,JSON['stringify'](_0x3ee156));_0x59dec1(_0x3ee156);})['catch'](function(_0xfa2087){logger[_0x7e8c('0x16')](_0x7e8c('0x1c'),_0xfa2087[_0x7e8c('0x18')],_0x397d17);_0x20b2b4(_0x1a9c04[_0x7e8c('0x16')](0x1f4,_0xfa2087[_0x7e8c('0x18')]));});});};exports[_0x7e8c('0x29')]=function(_0x1ff32d){var _0x934513=this;return new Promise(function(_0x1ce661,_0x39f371){return db[_0x7e8c('0x1d')][_0x7e8c('0x2a')]({'raw':_0x1ff32d[_0x7e8c('0x1f')]?_0x1ff32d['options'][_0x7e8c('0x20')]===undefined?!![]:![]:!![],'where':_0x1ff32d[_0x7e8c('0x1f')]?_0x1ff32d[_0x7e8c('0x1f')][_0x7e8c('0x21')]||null:null,'attributes':_0x1ff32d['options']?_0x1ff32d['options'][_0x7e8c('0x22')]||null:null,'include':_0x1ff32d[_0x7e8c('0x1f')]?_0x1ff32d[_0x7e8c('0x1f')][_0x7e8c('0x24')]?_['map'](_0x1ff32d['options'][_0x7e8c('0x24')],function(_0xf412f2){return{'model':db[_0xf412f2[_0x7e8c('0x26')]],'as':_0xf412f2['as'],'attributes':_0xf412f2[_0x7e8c('0x22')],'include':_0xf412f2[_0x7e8c('0x24')]?_[_0x7e8c('0x25')](_0xf412f2['include'],function(_0x2c286f){return{'model':db[_0x2c286f[_0x7e8c('0x26')]],'as':_0x2c286f['as'],'attributes':_0x2c286f[_0x7e8c('0x22')],'include':_0x2c286f['include']?_[_0x7e8c('0x25')](_0x2c286f[_0x7e8c('0x24')],function(_0x1c2510){return{'model':db[_0x1c2510[_0x7e8c('0x26')]],'as':_0x1c2510['as'],'attributes':_0x1c2510[_0x7e8c('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x758892){logger['info'](_0x7e8c('0x29'),_0x1ff32d);logger['debug'](_0x7e8c('0x29'),_0x1ff32d,JSON[_0x7e8c('0x2b')](_0x758892));_0x1ce661(_0x758892);})[_0x7e8c('0x1b')](function(_0x4bae12){logger[_0x7e8c('0x16')](_0x7e8c('0x29'),_0x4bae12[_0x7e8c('0x18')],_0x1ff32d);_0x39f371(_0x934513[_0x7e8c('0x16')](0x1f4,_0x4bae12['message']));});});};exports[_0x7e8c('0x2c')]=function(_0x258cc2){var _0x23b53b=this;return new Promise(function(_0x1fcd95,_0x34c4d4){var _0x5b0e47={'body':_0x258cc2[_0x7e8c('0x2d')],'channel':_0x7e8c('0x2e')};var _0x492e02=_[_0x7e8c('0x2f')](_['keys'](db[_0x7e8c('0x30')][_0x7e8c('0x31')]),[_0x7e8c('0x32'),_0x7e8c('0x33'),_0x7e8c('0x34'),_0x7e8c('0x35')]);var _0x2bf93e=![];if(_0x258cc2[_0x7e8c('0x2d')]['id']){delete _0x258cc2[_0x7e8c('0x2d')]['id'];}if(_[_0x7e8c('0x36')](_0x258cc2['body'][_0x7e8c('0x37')])){return _0x34c4d4(_0x23b53b['error'](0x1f4,_0x7e8c('0x38')));}if(_[_0x7e8c('0x36')](_0x258cc2[_0x7e8c('0x2d')][_0x7e8c('0x2d')])||_0x258cc2[_0x7e8c('0x2d')]['body']===''){return _0x34c4d4(_0x23b53b[_0x7e8c('0x16')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0x258cc2[_0x7e8c('0x2d')]['mapKey'])){return _0x34c4d4(_0x23b53b['error'](0x1f4,_0x7e8c('0x39')+_0x492e02));}if(!_['includes'](_0x492e02,_0x258cc2[_0x7e8c('0x2d')]['mapKey'])){return _0x34c4d4(_0x23b53b[_0x7e8c('0x16')](0x1f4,_0x7e8c('0x3a')+_0x492e02));}var _0xd601ef={};_0xd601ef[_0x258cc2[_0x7e8c('0x2d')][_0x7e8c('0x3b')]]=_0x258cc2[_0x7e8c('0x2d')][_0x7e8c('0x37')];return db[_0x7e8c('0x1d')][_0x7e8c('0x2a')]({'where':{'id':_0x258cc2[_0x7e8c('0x3c')]['id']},'include':[{'model':db[_0x7e8c('0x3d')],'as':_0x7e8c('0x3e'),'include':[{'model':db[_0x7e8c('0x30')],'as':_0x7e8c('0x3f'),'where':_0xd601ef,'limit':0x1,'order':[[_0x7e8c('0x33'),'DESC']]}]},{'model':db[_0x7e8c('0x40')],'as':_0x7e8c('0x41')},{'model':db['MailServerOut'],'as':_0x7e8c('0x42')}]})[_0x7e8c('0x27')](function(_0x518e74){if(_0x518e74&&_0x518e74[_0x7e8c('0x3e')]){var _0x1f63e5=_0x518e74['get']({'plain':!![]});_0x5b0e47[_0x7e8c('0x3c')]=_[_0x7e8c('0x43')](_0x1f63e5,[_0x7e8c('0x41'),_0x7e8c('0x3e')]);_0x5b0e47['applications']=_0x1f63e5[_0x7e8c('0x41')];_0x5b0e47[_0x7e8c('0x44')]=_0x1f63e5['List'];_0x5b0e47[_0x7e8c('0x45')]=_[_0x7e8c('0x46')](_0x5b0e47[_0x7e8c('0x45')],[_0x7e8c('0x47')],[_0x7e8c('0x48')]);if(_0x5b0e47[_0x7e8c('0x3c')]&&_0x5b0e47['account'][_0x7e8c('0x49')]){_0x5b0e47[_0x7e8c('0x45')][_0x7e8c('0x4a')]({'id':0x0,'priority':_0x5b0e47[_0x7e8c('0x45')]['length']+0x1,'app':_0x7e8c('0x4b'),'appdata':_0x7e8c('0x49'),'interval':_0x7e8c('0x4c')});}if(_0x5b0e47['account'][_0x7e8c('0x41')]){delete _0x5b0e47[_0x7e8c('0x3c')][_0x7e8c('0x41')];}if(_0x5b0e47[_0x7e8c('0x3c')][_0x7e8c('0x3e')]){delete _0x5b0e47[_0x7e8c('0x3c')][_0x7e8c('0x3e')];}if(_0x1f63e5[_0x7e8c('0x3e')][_0x7e8c('0x3f')][_0x7e8c('0x4d')]){return _0x1f63e5[_0x7e8c('0x3e')][_0x7e8c('0x3f')][0x0];}var _0xb52ea9=_['defaults'](_0x258cc2[_0x7e8c('0x2d')],{'firstName':_0x258cc2[_0x7e8c('0x2d')][_0x7e8c('0x37')],'ListId':_0x1f63e5[_0x7e8c('0x35')]});_0xb52ea9[_0x258cc2[_0x7e8c('0x2d')][_0x7e8c('0x3b')]]=_0x258cc2['body'][_0x7e8c('0x37')];return db[_0x7e8c('0x30')][_0x7e8c('0x4e')](_0xb52ea9);}else{throw new Error('List\x20not\x20found');}})[_0x7e8c('0x27')](function(_0x36f395){_0x5b0e47[_0x7e8c('0x4f')]=_0x36f395;if(_0x36f395){if(!_0x258cc2['body']['message']['messageId']){_0x258cc2[_0x7e8c('0x2d')][_0x7e8c('0x18')]['messageId']=rs[_0x7e8c('0x50')]()+'\x20'+_0x258cc2['body'][_0x7e8c('0x18')]['from'];}var _0x301932={'ContactId':_0x36f395['id'],'MailAccountId':_0x258cc2['account']['id'],'inReplyTo':_0x258cc2[_0x7e8c('0x2d')][_0x7e8c('0x18')]['messageId'],'to':_0x258cc2[_0x7e8c('0x2d')]['message'][_0x7e8c('0x37')],'cc':_0x258cc2[_0x7e8c('0x2d')][_0x7e8c('0x18')]['cc'],'subject':_0x258cc2[_0x7e8c('0x2d')]['message'][_0x7e8c('0x51')],'attach':_0x258cc2[_0x7e8c('0x2d')]['message'][_0x7e8c('0x52')],'lastMsgAt':moment()[_0x7e8c('0x53')](_0x7e8c('0x54')),'lastMsgDirection':'in'};return db[_0x7e8c('0x55')][_0x7e8c('0x2a')]({'where':{'closed':![],'MailAccountId':_0x258cc2[_0x7e8c('0x3c')]['id']},'include':[{'model':db[_0x7e8c('0x56')],'as':'Messages','attributes':[_0x7e8c('0x57')],'where':{'messageId':_0x258cc2[_0x7e8c('0x2d')][_0x7e8c('0x18')][_0x7e8c('0x58')]}}]})['then'](function(_0x164f03){if(_0x164f03){return[_0x164f03,![]];}return db[_0x7e8c('0x55')][_0x7e8c('0x4e')](_0x301932)[_0x7e8c('0x27')](function(_0x35bca8){return[_0x35bca8,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x7e8c('0x59')](function(_0xc6de9a,_0x2f7fe3){if(_0xc6de9a){_0x2bf93e=_0x2f7fe3;if(!_0x2f7fe3){return _0xc6de9a[_0x7e8c('0x5a')]({'inReplyTo':_0x258cc2[_0x7e8c('0x2d')][_0x7e8c('0x18')][_0x7e8c('0x57')],'to':_0x258cc2[_0x7e8c('0x2d')]['message'][_0x7e8c('0x37')],'cc':_0x258cc2[_0x7e8c('0x2d')]['message']['cc'],'subject':_0x258cc2[_0x7e8c('0x2d')][_0x7e8c('0x18')][_0x7e8c('0x51')],'attach':_0xc6de9a[_0x7e8c('0x52')]?_0xc6de9a['attach']:_0x258cc2[_0x7e8c('0x2d')][_0x7e8c('0x18')][_0x7e8c('0x52')],'substatus':null,'substatusAt':moment()[_0x7e8c('0x53')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()['format'](_0x7e8c('0x54')),'lastMsgDirection':'in'});}else{return _0xc6de9a;}}})[_0x7e8c('0x27')](function(_0x49e9ef){_0x5b0e47[_0x7e8c('0x5b')]=_0x49e9ef[_0x7e8c('0x5c')]({'plain':!![]});_0x5b0e47[_0x7e8c('0x5b')][_0x7e8c('0x5d')]=_0x2bf93e;return db[_0x7e8c('0x56')][_0x7e8c('0x4e')]({'body':_0x258cc2[_0x7e8c('0x2d')]['body'],'MailAccountId':_0x258cc2['account']['id'],'MailInteractionId':_0x49e9ef['id'],'direction':'in','ContactId':_0x5b0e47[_0x7e8c('0x4f')]['id'],'messageId':_0x258cc2['body']['message'][_0x7e8c('0x57')],'from':_0x258cc2['body']['message'][_0x7e8c('0x37')],'to':_0x258cc2['body'][_0x7e8c('0x18')]['to'],'cc':_0x258cc2['body']['message']['cc'],'subject':_0x258cc2['body'][_0x7e8c('0x18')][_0x7e8c('0x51')],'attach':_0x258cc2['body']['message'][_0x7e8c('0x52')],'Attachments':_0x258cc2[_0x7e8c('0x2d')][_0x7e8c('0x18')][_0x7e8c('0x5e')],'originTo':_0x258cc2[_0x7e8c('0x2d')]['message'][_0x7e8c('0x5f')],'originCc':_0x258cc2[_0x7e8c('0x2d')]['message'][_0x7e8c('0x60')],'bcc':_0x258cc2['body'][_0x7e8c('0x18')]['bcc'],'ChatWebsiteId':_0x258cc2[_0x7e8c('0x2d')][_0x7e8c('0x18')][_0x7e8c('0x61')]||null,'originChannel':_0x258cc2[_0x7e8c('0x2d')][_0x7e8c('0x18')][_0x7e8c('0x62')]||_0x7e8c('0x63'),'ChatOfflineMessageId':_0x258cc2[_0x7e8c('0x2d')][_0x7e8c('0x18')][_0x7e8c('0x64')]||null},{'include':[{'model':db[_0x7e8c('0x65')],'as':_0x7e8c('0x66')}]});})[_0x7e8c('0x27')](function(_0x2c805e){_0x5b0e47[_0x7e8c('0x18')]=_0x2c805e;if(_0x5b0e47['interaction'][_0x7e8c('0x67')]){return db[_0x7e8c('0x68')][_0x7e8c('0x2a')]({'attributes':['id',_0x7e8c('0x69')],'where':{'id':_0x5b0e47[_0x7e8c('0x5b')]['UserId']}})[_0x7e8c('0x27')](function(_0xf27b3d){if(_0xf27b3d){_0x5b0e47['applications'][_0x7e8c('0x6a')]({'id':0x0,'priority':0x0,'app':_0x7e8c('0x6b'),'appdata':_0xf27b3d[_0x7e8c('0x69')]+','+(_0x5b0e47[_0x7e8c('0x3c')][_0x7e8c('0x6c')]||0xa),'interval':_0x7e8c('0x4c')});}return respondWithRpcPromise(_0x7e8c('0x6d'),'startRouting',_0x5b0e47);});}return respondWithRpcPromise(_0x7e8c('0x6d'),'startRouting',_0x5b0e47);})[_0x7e8c('0x27')](function(_0x47aa76){_0x1fcd95(_0x47aa76);})[_0x7e8c('0x1b')](function(_0xe12d29){_0x34c4d4(_0x23b53b[_0x7e8c('0x16')](0x1f4,_0xe12d29[_0x7e8c('0x18')]));});});};
\ No newline at end of file
index f51d6cf..2987b04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd8f=['emit','removeListener','register','length','mailAccount:','./mailAccount.events','save','remove'];(function(_0x377e84,_0x3f6df7){var _0x355f3c=function(_0x1e023b){while(--_0x1e023b){_0x377e84['push'](_0x377e84['shift']());}};_0x355f3c(++_0x3f6df7);}(_0xdd8f,0x1ad));var _0xfdd8=function(_0x471a06,_0x4e0c8f){_0x471a06=_0x471a06-0x0;var _0x4b7e7a=_0xdd8f[_0x471a06];return _0x4b7e7a;};'use strict';var MailAccountEvents=require(_0xfdd8('0x0'));var events=[_0xfdd8('0x1'),_0xfdd8('0x2'),'update'];function createListener(_0x480a39,_0x1f7c84){return function(_0x4cd27a){_0x1f7c84[_0xfdd8('0x3')](_0x480a39,_0x4cd27a);};}function removeListener(_0x22b4b4,_0x3169bb){return function(){MailAccountEvents[_0xfdd8('0x4')](_0x22b4b4,_0x3169bb);};}exports[_0xfdd8('0x5')]=function(_0x4a7848){for(var _0x5bc9dd=0x0,_0x1ee62c=events[_0xfdd8('0x6')];_0x5bc9dd<_0x1ee62c;_0x5bc9dd++){var _0x2b2cce=events[_0x5bc9dd];var _0x2182e3=createListener(_0xfdd8('0x7')+_0x2b2cce,_0x4a7848);MailAccountEvents['on'](_0x2b2cce,_0x2182e3);}};
\ No newline at end of file
+var _0x349e=['removeListener','length','mailAccount:','./mailAccount.events','save','remove','update','emit'];(function(_0x2f7519,_0x52077a){var _0x3c1434=function(_0x44cb7a){while(--_0x44cb7a){_0x2f7519['push'](_0x2f7519['shift']());}};_0x3c1434(++_0x52077a);}(_0x349e,0xcb));var _0xe349=function(_0x290d9b,_0x5468a4){_0x290d9b=_0x290d9b-0x0;var _0x2ea1f2=_0x349e[_0x290d9b];return _0x2ea1f2;};'use strict';var MailAccountEvents=require(_0xe349('0x0'));var events=[_0xe349('0x1'),_0xe349('0x2'),_0xe349('0x3')];function createListener(_0x299ab0,_0x449746){return function(_0x29d180){_0x449746[_0xe349('0x4')](_0x299ab0,_0x29d180);};}function removeListener(_0x3b09e9,_0x4c6673){return function(){MailAccountEvents[_0xe349('0x5')](_0x3b09e9,_0x4c6673);};}exports['register']=function(_0x55aae6){for(var _0xb21068=0x0,_0x494605=events[_0xe349('0x6')];_0xb21068<_0x494605;_0xb21068++){var _0x6efb47=events[_0xb21068];var _0x535968=createListener(_0xe349('0x7')+_0x6efb47,_0x55aae6);MailAccountEvents['on'](_0x6efb47,_0x535968);}};
\ No newline at end of file
index 2ffd830..92b5e4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e66=['express','fs-extra','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','multer','util'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x9e66,0x16a));var _0x69e6=function(_0xf05500,_0x5b01d0){_0xf05500=_0xf05500-0x0;var _0x35a4c5=_0x9e66[_0xf05500];return _0x35a4c5;};'use strict';var multer=require(_0x69e6('0x0'));var util=require(_0x69e6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x69e6('0x2'));var router=express['Router']();var fs_extra=require(_0x69e6('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x69e6('0x4'));var controller=require(_0x69e6('0x5'));router[_0x69e6('0x6')](_0x69e6('0x7'),auth[_0x69e6('0x8')](),controller[_0x69e6('0x9')]);router[_0x69e6('0xa')](_0x69e6('0x7'),auth['isAuthenticated'](),controller[_0x69e6('0xb')]);router[_0x69e6('0xc')](_0x69e6('0x7'),auth[_0x69e6('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x9dc7=['util','path','connect-timeout','express','fs-extra','../../config/environment','get','/:id','show','put','isAuthenticated','update','delete','destroy','exports'];(function(_0x1645f7,_0x24c2a2){var _0x12c4db=function(_0x466a99){while(--_0x466a99){_0x1645f7['push'](_0x1645f7['shift']());}};_0x12c4db(++_0x24c2a2);}(_0x9dc7,0xff));var _0x79dc=function(_0x536f36,_0x4b9331){_0x536f36=_0x536f36-0x0;var _0x48ac76=_0x9dc7[_0x536f36];return _0x48ac76;};'use strict';var multer=require('multer');var util=require(_0x79dc('0x0'));var path=require(_0x79dc('0x1'));var timeout=require(_0x79dc('0x2'));var express=require(_0x79dc('0x3'));var router=express['Router']();var fs_extra=require(_0x79dc('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x79dc('0x5'));var controller=require('./mailApplication.controller');router[_0x79dc('0x6')](_0x79dc('0x7'),auth['isAuthenticated'](),controller[_0x79dc('0x8')]);router[_0x79dc('0x9')]('/:id',auth[_0x79dc('0xa')](),controller[_0x79dc('0xb')]);router[_0x79dc('0xc')]('/:id',auth[_0x79dc('0xa')](),controller[_0x79dc('0xd')]);module[_0x79dc('0xe')]=router;
\ No newline at end of file
index d682dbc..4edd677 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe25d=['INTEGER','noop','TEXT','*,*,*,*','exports'];(function(_0x136c94,_0x5167ac){var _0x822259=function(_0x5c389b){while(--_0x5c389b){_0x136c94['push'](_0x136c94['shift']());}};_0x822259(++_0x5167ac);}(_0xe25d,0x1e4));var _0xde25=function(_0x510f5e,_0x2f74fd){_0x510f5e=_0x510f5e-0x0;var _0x371841=_0xe25d[_0x510f5e];return _0x371841;};'use strict';var Sequelize=require('sequelize');module[_0xde25('0x0')]={'priority':{'type':Sequelize[_0xde25('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xde25('0x2')},'appdata':{'type':Sequelize[_0xde25('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xde25('0x4')}};
\ No newline at end of file
+var _0x33ee=['INTEGER','STRING','TEXT','*,*,*,*','exports'];(function(_0x1566ed,_0x511c9f){var _0x2eea27=function(_0xd5e3cb){while(--_0xd5e3cb){_0x1566ed['push'](_0x1566ed['shift']());}};_0x2eea27(++_0x511c9f);}(_0x33ee,0x18a));var _0xe33e=function(_0x36c6eb,_0x4fb127){_0x36c6eb=_0x36c6eb-0x0;var _0x30675b=_0x33ee[_0x36c6eb];return _0x30675b;};'use strict';var Sequelize=require('sequelize');module[_0xe33e('0x0')]={'priority':{'type':Sequelize[_0xe33e('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xe33e('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xe33e('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xe33e('0x2')],'defaultValue':_0xe33e('0x4')}};
\ No newline at end of file
index d64db7f..845b25d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['util','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','apply','save','update','then','error','stack','name','send','show','model','keys','MailApplication','query','filters','attributes','intersection','length','includeAll','include','find','catch','body','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache'];(function(_0xd4d369,_0x4f6ad2){var _0x293e5d=function(_0xb0e6a4){while(--_0xb0e6a4){_0xd4d369['push'](_0xd4d369['shift']());}};_0x293e5d(++_0x4f6ad2);}(_0x70e0,0x17b));var _0x070e=function(_0x18ec78,_0x188a5c){_0x18ec78=_0x18ec78-0x0;var _0x471086=_0x70e0[_0x18ec78];return _0x471086;};'use strict';var emlformat=require(_0x070e('0x0'));var rimraf=require(_0x070e('0x1'));var zipdir=require(_0x070e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x070e('0x3'));var BPromise=require(_0x070e('0x4'));var Mustache=require(_0x070e('0x5'));var util=require(_0x070e('0x6'));var path=require('path');var sox=require(_0x070e('0x7'));var csv=require('to-csv');var ejs=require(_0x070e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x070e('0x9'));var jsforce=require(_0x070e('0xa'));var deskjs=require(_0x070e('0xb'));var toCsv=require(_0x070e('0xc'));var querystring=require(_0x070e('0xd'));var Papa=require(_0x070e('0xe'));var Redis=require(_0x070e('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x070e('0x10'));var hardwareService=require(_0x070e('0x11'));var logger=require(_0x070e('0x12'))(_0x070e('0x13'));var utils=require(_0x070e('0x14'));var config=require(_0x070e('0x15'));var licenseUtil=require(_0x070e('0x16'));var db=require(_0x070e('0x17'))['db'];function respondWithStatusCode(_0x39d2b9,_0x5bf079){_0x5bf079=_0x5bf079||0xcc;return function(_0x2930b8){if(_0x2930b8){return _0x39d2b9['sendStatus'](_0x5bf079);}return _0x39d2b9['status'](_0x5bf079)[_0x070e('0x18')]();};}function respondWithResult(_0x56c7ba,_0x4a33d2){_0x4a33d2=_0x4a33d2||0xc8;return function(_0x5bae0f){if(_0x5bae0f){return _0x56c7ba[_0x070e('0x19')](_0x4a33d2)[_0x070e('0x1a')](_0x5bae0f);}};}function respondWithFilteredResult(_0x51d14d,_0x5d3a38){return function(_0x373d86){if(_0x373d86){var _0xeae1a5=typeof _0x5d3a38[_0x070e('0x1b')]===_0x070e('0x1c')&&typeof _0x5d3a38['limit']==='undefined';var _0x17e2e4=_0x373d86[_0x070e('0x1d')];var _0x38f6e6=_0xeae1a5?0x0:_0x5d3a38[_0x070e('0x1b')];var _0x364b3f=_0xeae1a5?_0x373d86['count']:_0x5d3a38[_0x070e('0x1b')]+_0x5d3a38[_0x070e('0x1e')];var _0x1ad3de;if(_0x364b3f>=_0x17e2e4){_0x364b3f=_0x17e2e4;_0x1ad3de=0xc8;}else{_0x1ad3de=0xce;}_0x51d14d[_0x070e('0x19')](_0x1ad3de);return _0x51d14d[_0x070e('0x1f')]('Content-Range',_0x38f6e6+'-'+_0x364b3f+'/'+_0x17e2e4)['json'](_0x373d86);}return null;};}function patchUpdates(_0x4e958f){return function(_0x9907cf){try{jsonpatch[_0x070e('0x20')](_0x9907cf,_0x4e958f,!![]);}catch(_0x20dc60){return BPromise['reject'](_0x20dc60);}return _0x9907cf[_0x070e('0x21')]();};}function saveUpdates(_0x5dc5d2,_0xf8dd5d){return function(_0x3f6985){if(_0x3f6985){return _0x3f6985[_0x070e('0x22')](_0x5dc5d2)[_0x070e('0x23')](function(_0x28a1c3){return _0x28a1c3;});}return null;};}function removeEntity(_0xa86797,_0xe405e){return function(_0x164cdf){if(_0x164cdf){return _0x164cdf['destroy']()[_0x070e('0x23')](function(){_0xa86797[_0x070e('0x19')](0xcc)[_0x070e('0x18')]();});}};}function handleEntityNotFound(_0x503f4d,_0xf17c56){return function(_0x5f3e9d){if(!_0x5f3e9d){_0x503f4d['sendStatus'](0x194);}return _0x5f3e9d;};}function handleError(_0x2ccbd7,_0x25f6e){_0x25f6e=_0x25f6e||0x1f4;return function(_0x41deb1){logger[_0x070e('0x24')](_0x41deb1[_0x070e('0x25')]);if(_0x41deb1['name']){delete _0x41deb1[_0x070e('0x26')];}_0x2ccbd7[_0x070e('0x19')](_0x25f6e)[_0x070e('0x27')](_0x41deb1);};}exports[_0x070e('0x28')]=function(_0x43dd96,_0x28d7f2){var _0x1a1892={'raw':!![],'where':{'id':_0x43dd96['params']['id']}},_0x26373b={};_0x26373b[_0x070e('0x29')]=_[_0x070e('0x2a')](db[_0x070e('0x2b')]['rawAttributes']);_0x26373b['query']=_[_0x070e('0x2a')](_0x43dd96[_0x070e('0x2c')]);_0x26373b[_0x070e('0x2d')]=_['intersection'](_0x26373b[_0x070e('0x29')],_0x26373b[_0x070e('0x2c')]);_0x1a1892[_0x070e('0x2e')]=_[_0x070e('0x2f')](_0x26373b['model'],qs['fields'](_0x43dd96['query']['fields']));_0x1a1892[_0x070e('0x2e')]=_0x1a1892['attributes'][_0x070e('0x30')]?_0x1a1892[_0x070e('0x2e')]:_0x26373b['model'];if(_0x43dd96['query'][_0x070e('0x31')]){_0x1a1892[_0x070e('0x32')]=[{'all':!![]}];}_0x1a1892=_['merge']({},_0x1a1892,_0x43dd96['options']);return db[_0x070e('0x2b')][_0x070e('0x33')](_0x1a1892)[_0x070e('0x23')](handleEntityNotFound(_0x28d7f2,null))[_0x070e('0x23')](respondWithResult(_0x28d7f2,null))[_0x070e('0x34')](handleError(_0x28d7f2,null));};exports['update']=function(_0x482cc2,_0x24d17d){if(_0x482cc2[_0x070e('0x35')]['id']){delete _0x482cc2[_0x070e('0x35')]['id'];}return db[_0x070e('0x2b')][_0x070e('0x33')]({'where':{'id':_0x482cc2['params']['id']}})[_0x070e('0x23')](handleEntityNotFound(_0x24d17d,null))[_0x070e('0x23')](saveUpdates(_0x482cc2['body'],null))[_0x070e('0x23')](respondWithResult(_0x24d17d,null))[_0x070e('0x34')](handleError(_0x24d17d,null));};exports['destroy']=function(_0x4d4ee8,_0x5ddbe9){return db[_0x070e('0x2b')][_0x070e('0x33')]({'where':{'id':_0x4d4ee8[_0x070e('0x36')]['id']}})[_0x070e('0x23')](handleEntityNotFound(_0x5ddbe9,null))[_0x070e('0x23')](removeEntity(_0x5ddbe9,null))['catch'](handleError(_0x5ddbe9,null));};
\ No newline at end of file
+var _0xac4a=['Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','show','params','model','keys','MailApplication','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','catch','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set'];(function(_0x206421,_0x401ff3){var _0x24fdda=function(_0xeb22eb){while(--_0xeb22eb){_0x206421['push'](_0x206421['shift']());}};_0x24fdda(++_0x401ff3);}(_0xac4a,0x13f));var _0xaac4=function(_0x33dc38,_0x1ba5e4){_0x33dc38=_0x33dc38-0x0;var _0x2e8eaa=_0xac4a[_0x33dc38];return _0x2e8eaa;};'use strict';var emlformat=require(_0xaac4('0x0'));var rimraf=require(_0xaac4('0x1'));var zipdir=require(_0xaac4('0x2'));var jsonpatch=require(_0xaac4('0x3'));var rp=require(_0xaac4('0x4'));var moment=require(_0xaac4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaac4('0x6'));var path=require(_0xaac4('0x7'));var sox=require(_0xaac4('0x8'));var csv=require('to-csv');var ejs=require(_0xaac4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaac4('0xa'));var squel=require('squel');var crypto=require(_0xaac4('0xb'));var jsforce=require(_0xaac4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaac4('0xd'));var Papa=require('papaparse');var Redis=require(_0xaac4('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaac4('0xf'));var hardwareService=require(_0xaac4('0x10'));var logger=require(_0xaac4('0x11'))(_0xaac4('0x12'));var utils=require(_0xaac4('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaac4('0x14'))['db'];function respondWithStatusCode(_0x2e2d02,_0x45e512){_0x45e512=_0x45e512||0xcc;return function(_0x5a4801){if(_0x5a4801){return _0x2e2d02[_0xaac4('0x15')](_0x45e512);}return _0x2e2d02[_0xaac4('0x16')](_0x45e512)['end']();};}function respondWithResult(_0xf06b1d,_0x2b20d0){_0x2b20d0=_0x2b20d0||0xc8;return function(_0x46698d){if(_0x46698d){return _0xf06b1d[_0xaac4('0x16')](_0x2b20d0)[_0xaac4('0x17')](_0x46698d);}};}function respondWithFilteredResult(_0x2fbeb7,_0x31b7e5){return function(_0x1df9ae){if(_0x1df9ae){var _0x233278=typeof _0x31b7e5[_0xaac4('0x18')]===_0xaac4('0x19')&&typeof _0x31b7e5[_0xaac4('0x1a')]===_0xaac4('0x19');var _0x52686a=_0x1df9ae[_0xaac4('0x1b')];var _0x52085a=_0x233278?0x0:_0x31b7e5[_0xaac4('0x18')];var _0x5b6fd6=_0x233278?_0x1df9ae[_0xaac4('0x1b')]:_0x31b7e5[_0xaac4('0x18')]+_0x31b7e5[_0xaac4('0x1a')];var _0x271bcb;if(_0x5b6fd6>=_0x52686a){_0x5b6fd6=_0x52686a;_0x271bcb=0xc8;}else{_0x271bcb=0xce;}_0x2fbeb7[_0xaac4('0x16')](_0x271bcb);return _0x2fbeb7[_0xaac4('0x1c')](_0xaac4('0x1d'),_0x52085a+'-'+_0x5b6fd6+'/'+_0x52686a)[_0xaac4('0x17')](_0x1df9ae);}return null;};}function patchUpdates(_0x4166ee){return function(_0x480fb0){try{jsonpatch[_0xaac4('0x1e')](_0x480fb0,_0x4166ee,!![]);}catch(_0x4e1e89){return BPromise[_0xaac4('0x1f')](_0x4e1e89);}return _0x480fb0[_0xaac4('0x20')]();};}function saveUpdates(_0x43625c,_0x477b77){return function(_0x17140f){if(_0x17140f){return _0x17140f[_0xaac4('0x21')](_0x43625c)['then'](function(_0x43ccdc){return _0x43ccdc;});}return null;};}function removeEntity(_0x27a84d,_0x174860){return function(_0x4f10ec){if(_0x4f10ec){return _0x4f10ec[_0xaac4('0x22')]()[_0xaac4('0x23')](function(){_0x27a84d[_0xaac4('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24186b,_0x4f1b65){return function(_0x54203b){if(!_0x54203b){_0x24186b['sendStatus'](0x194);}return _0x54203b;};}function handleError(_0x5a0bb3,_0x22d5a6){_0x22d5a6=_0x22d5a6||0x1f4;return function(_0x17d25f){logger[_0xaac4('0x24')](_0x17d25f[_0xaac4('0x25')]);if(_0x17d25f[_0xaac4('0x26')]){delete _0x17d25f[_0xaac4('0x26')];}_0x5a0bb3[_0xaac4('0x16')](_0x22d5a6)[_0xaac4('0x27')](_0x17d25f);};}exports[_0xaac4('0x28')]=function(_0x386c9b,_0x4d0f5f){var _0x316445={'raw':!![],'where':{'id':_0x386c9b[_0xaac4('0x29')]['id']}},_0x16b33c={};_0x16b33c[_0xaac4('0x2a')]=_[_0xaac4('0x2b')](db[_0xaac4('0x2c')]['rawAttributes']);_0x16b33c[_0xaac4('0x2d')]=_['keys'](_0x386c9b[_0xaac4('0x2d')]);_0x16b33c[_0xaac4('0x2e')]=_[_0xaac4('0x2f')](_0x16b33c[_0xaac4('0x2a')],_0x16b33c['query']);_0x316445['attributes']=_['intersection'](_0x16b33c[_0xaac4('0x2a')],qs[_0xaac4('0x30')](_0x386c9b[_0xaac4('0x2d')][_0xaac4('0x30')]));_0x316445[_0xaac4('0x31')]=_0x316445[_0xaac4('0x31')][_0xaac4('0x32')]?_0x316445[_0xaac4('0x31')]:_0x16b33c[_0xaac4('0x2a')];if(_0x386c9b[_0xaac4('0x2d')][_0xaac4('0x33')]){_0x316445[_0xaac4('0x34')]=[{'all':!![]}];}_0x316445=_[_0xaac4('0x35')]({},_0x316445,_0x386c9b[_0xaac4('0x36')]);return db[_0xaac4('0x2c')]['find'](_0x316445)['then'](handleEntityNotFound(_0x4d0f5f,null))[_0xaac4('0x23')](respondWithResult(_0x4d0f5f,null))[_0xaac4('0x37')](handleError(_0x4d0f5f,null));};exports[_0xaac4('0x21')]=function(_0x5e6080,_0x191d0f){if(_0x5e6080[_0xaac4('0x38')]['id']){delete _0x5e6080[_0xaac4('0x38')]['id'];}return db[_0xaac4('0x2c')][_0xaac4('0x39')]({'where':{'id':_0x5e6080[_0xaac4('0x29')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x191d0f,null))['then'](saveUpdates(_0x5e6080[_0xaac4('0x38')],null))[_0xaac4('0x23')](respondWithResult(_0x191d0f,null))[_0xaac4('0x37')](handleError(_0x191d0f,null));};exports['destroy']=function(_0x36d84a,_0x497e7b){return db['MailApplication'][_0xaac4('0x39')]({'where':{'id':_0x36d84a[_0xaac4('0x29')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x497e7b,null))['then'](removeEntity(_0x497e7b,null))['catch'](handleError(_0x497e7b,null));};
\ No newline at end of file
index c70ba29..bfd4ea4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7bfa=['api','request-promise','rimraf','../../config/environment','./mailApplication.attributes','exports','define','mail_applications','utf8mb4_unicode_ci','lodash'];(function(_0x547f6e,_0x4fe63c){var _0x46f755=function(_0x43eba7){while(--_0x43eba7){_0x547f6e['push'](_0x547f6e['shift']());}};_0x46f755(++_0x4fe63c);}(_0x7bfa,0x1f3));var _0xa7bf=function(_0x3bee55,_0x4e25c8){_0x3bee55=_0x3bee55-0x0;var _0x5649d2=_0x7bfa[_0x3bee55];return _0x5649d2;};'use strict';var _=require(_0xa7bf('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa7bf('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa7bf('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa7bf('0x3'));var config=require(_0xa7bf('0x4'));var attributes=require(_0xa7bf('0x5'));module[_0xa7bf('0x6')]=function(_0x3d0eec,_0x54e065){return _0x3d0eec[_0xa7bf('0x7')]('MailApplication',attributes,{'tableName':_0xa7bf('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xa7bf('0x9')});};
\ No newline at end of file
+var _0x27bc=['utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','define','MailApplication'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x27bc,0x1a6));var _0xc27b=function(_0x16d25a,_0xb360de){_0x16d25a=_0x16d25a-0x0;var _0x25372e=_0x27bc[_0x16d25a];return _0x25372e;};'use strict';var _=require('lodash');var util=require(_0xc27b('0x0'));var logger=require(_0xc27b('0x1'))('api');var moment=require(_0xc27b('0x2'));var BPromise=require(_0xc27b('0x3'));var rp=require(_0xc27b('0x4'));var fs=require('fs');var path=require(_0xc27b('0x5'));var rimraf=require(_0xc27b('0x6'));var config=require('../../config/environment');var attributes=require('./mailApplication.attributes');module[_0xc27b('0x7')]=function(_0x367f10,_0x28e9c7){return _0x367f10[_0xc27b('0x8')](_0xc27b('0x9'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc27b('0xa'),'collate':_0xc27b('0xb')});};
\ No newline at end of file
index 9e6af3c..02854c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbcbc=['limit','debug','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','MailApplication,\x20%s,\x20%s,\x20%s','stringify','code','message','error','result','UpdateMailApplication','MailApplication','update','body','options','raw','where'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbcbc,0x1d4));var _0xcbcb=function(_0x42a200,_0x5216c5){_0x42a200=_0x42a200-0x0;var _0x5c35fa=_0xbcbc[_0x42a200];return _0x5c35fa;};'use strict';var _=require('lodash');var util=require(_0xcbcb('0x0'));var moment=require(_0xcbcb('0x1'));var BPromise=require(_0xcbcb('0x2'));var rs=require(_0xcbcb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcbcb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcbcb('0x5'))(_0xcbcb('0x6'));var config=require(_0xcbcb('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcbcb('0x8')][_0xcbcb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c5d33,_0x45e03c,_0x2f6495){return new BPromise(function(_0x2b6dc2,_0x1f2004){return client[_0xcbcb('0xa')](_0x1c5d33,_0x2f6495)[_0xcbcb('0xb')](function(_0x4e277d){logger[_0xcbcb('0xc')](_0xcbcb('0xd'),_0x45e03c,_0xcbcb('0xe'));logger['debug'](_0xcbcb('0xf'),_0x45e03c,_0xcbcb('0xe'),JSON[_0xcbcb('0x10')](_0x4e277d));if(_0x4e277d['error']){if(_0x4e277d['error'][_0xcbcb('0x11')]===0x1f4){logger['error'](_0xcbcb('0xd'),_0x45e03c,_0x4e277d['error'][_0xcbcb('0x12')]);return _0x1f2004(_0x4e277d[_0xcbcb('0x13')][_0xcbcb('0x12')]);}logger['error']('MailApplication,\x20%s,\x20%s',_0x45e03c,_0x4e277d['error'][_0xcbcb('0x12')]);return _0x2b6dc2(_0x4e277d[_0xcbcb('0x13')][_0xcbcb('0x12')]);}else{logger['info']('MailApplication,\x20%s,\x20%s',_0x45e03c,_0xcbcb('0xe'));_0x2b6dc2(_0x4e277d[_0xcbcb('0x14')][_0xcbcb('0x12')]);}})['catch'](function(_0x370bb6){logger[_0xcbcb('0x13')](_0xcbcb('0xd'),_0x45e03c,_0x370bb6);_0x1f2004(_0x370bb6);});});}exports[_0xcbcb('0x15')]=function(_0x45c386){var _0xa6268b=this;return new Promise(function(_0xb0098b,_0x39e293){return db[_0xcbcb('0x16')][_0xcbcb('0x17')](_0x45c386[_0xcbcb('0x18')],{'raw':_0x45c386[_0xcbcb('0x19')]?_0x45c386[_0xcbcb('0x19')][_0xcbcb('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45c386['options']?_0x45c386[_0xcbcb('0x19')][_0xcbcb('0x1b')]||null:null,'attributes':_0x45c386['options']?_0x45c386[_0xcbcb('0x19')]['attributes']||null:null,'limit':_0x45c386[_0xcbcb('0x19')]?_0x45c386[_0xcbcb('0x19')][_0xcbcb('0x1c')]||null:null})[_0xcbcb('0xb')](function(_0x26e73e){logger[_0xcbcb('0xc')]('UpdateMailApplication',_0x45c386);logger[_0xcbcb('0x1d')](_0xcbcb('0x15'),_0x45c386,JSON[_0xcbcb('0x10')](_0x26e73e));_0xb0098b(_0x26e73e);})[_0xcbcb('0x1e')](function(_0x5704f4){logger[_0xcbcb('0x13')](_0xcbcb('0x15'),_0x5704f4[_0xcbcb('0x12')],_0x45c386);_0x39e293(_0xa6268b[_0xcbcb('0x13')](0x1f4,_0x5704f4[_0xcbcb('0x12')]));});});};
\ No newline at end of file
+var _0x7b8b=['info','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','MailApplication,\x20%s,\x20%s','message','result','catch','UpdateMailApplication','MailApplication','update','body','options','raw','where','attributes','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then'];(function(_0x3b234d,_0x13722b){var _0x5e76a2=function(_0x517edc){while(--_0x517edc){_0x3b234d['push'](_0x3b234d['shift']());}};_0x5e76a2(++_0x13722b);}(_0x7b8b,0xf3));var _0xb7b8=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x7b8b[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require('lodash');var util=require(_0xb7b8('0x0'));var moment=require('moment');var BPromise=require(_0xb7b8('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb7b8('0x2'))['db'];var utils=require(_0xb7b8('0x3'));var logger=require(_0xb7b8('0x4'))('rpc');var config=require(_0xb7b8('0x5'));var jayson=require(_0xb7b8('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1f4ff1,_0x26b091,_0xb30da1){return new BPromise(function(_0x58da49,_0x57e0ae){return client[_0xb7b8('0x7')](_0x1f4ff1,_0xb30da1)[_0xb7b8('0x8')](function(_0x37b6eb){logger[_0xb7b8('0x9')]('MailApplication,\x20%s,\x20%s',_0x26b091,_0xb7b8('0xa'));logger[_0xb7b8('0xb')](_0xb7b8('0xc'),_0x26b091,_0xb7b8('0xa'),JSON[_0xb7b8('0xd')](_0x37b6eb));if(_0x37b6eb[_0xb7b8('0xe')]){if(_0x37b6eb[_0xb7b8('0xe')][_0xb7b8('0xf')]===0x1f4){logger[_0xb7b8('0xe')](_0xb7b8('0x10'),_0x26b091,_0x37b6eb[_0xb7b8('0xe')][_0xb7b8('0x11')]);return _0x57e0ae(_0x37b6eb[_0xb7b8('0xe')][_0xb7b8('0x11')]);}logger['error']('MailApplication,\x20%s,\x20%s',_0x26b091,_0x37b6eb[_0xb7b8('0xe')][_0xb7b8('0x11')]);return _0x58da49(_0x37b6eb[_0xb7b8('0xe')][_0xb7b8('0x11')]);}else{logger['info'](_0xb7b8('0x10'),_0x26b091,_0xb7b8('0xa'));_0x58da49(_0x37b6eb[_0xb7b8('0x12')][_0xb7b8('0x11')]);}})[_0xb7b8('0x13')](function(_0x5b4632){logger[_0xb7b8('0xe')]('MailApplication,\x20%s,\x20%s',_0x26b091,_0x5b4632);_0x57e0ae(_0x5b4632);});});}exports[_0xb7b8('0x14')]=function(_0x5418d2){var _0x25239b=this;return new Promise(function(_0x57eb12,_0x17c2ea){return db[_0xb7b8('0x15')][_0xb7b8('0x16')](_0x5418d2[_0xb7b8('0x17')],{'raw':_0x5418d2[_0xb7b8('0x18')]?_0x5418d2[_0xb7b8('0x18')][_0xb7b8('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5418d2[_0xb7b8('0x18')]?_0x5418d2[_0xb7b8('0x18')][_0xb7b8('0x1a')]||null:null,'attributes':_0x5418d2[_0xb7b8('0x18')]?_0x5418d2['options'][_0xb7b8('0x1b')]||null:null,'limit':_0x5418d2['options']?_0x5418d2[_0xb7b8('0x18')]['limit']||null:null})[_0xb7b8('0x8')](function(_0x24aeac){logger['info']('UpdateMailApplication',_0x5418d2);logger[_0xb7b8('0xb')](_0xb7b8('0x14'),_0x5418d2,JSON[_0xb7b8('0xd')](_0x24aeac));_0x57eb12(_0x24aeac);})[_0xb7b8('0x13')](function(_0x3ed2ff){logger[_0xb7b8('0xe')]('UpdateMailApplication',_0x3ed2ff[_0xb7b8('0x11')],_0x5418d2);_0x17c2ea(_0x25239b[_0xb7b8('0xe')](0x1f4,_0x3ed2ff[_0xb7b8('0x11')]));});});};
\ No newline at end of file
index d66bb14..ba840bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f24=['describe','/:id','show','/:id/messages','getMessages','post','addMessage','tracked','mail','delete','mailinteraction:destroy','/:id/tags','../../components/interaction/service','./mailInteraction.controller','isAuthenticated','get','/describe'];(function(_0x1db81c,_0x5987f4){var _0x5c67b1=function(_0x1b62b4){while(--_0x1b62b4){_0x1db81c['push'](_0x1db81c['shift']());}};_0x5c67b1(++_0x5987f4);}(_0x1f24,0x171));var _0x41f2=function(_0x4cecf8,_0x55d7a0){_0x4cecf8=_0x4cecf8-0x0;var _0x2289ce=_0x1f24[_0x4cecf8];return _0x2289ce;};'use strict';var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x41f2('0x0'));var controller=require(_0x41f2('0x1'));router['get']('/',auth[_0x41f2('0x2')](),controller['index']);router[_0x41f2('0x3')](_0x41f2('0x4'),auth[_0x41f2('0x2')](),controller[_0x41f2('0x5')]);router[_0x41f2('0x3')](_0x41f2('0x6'),auth[_0x41f2('0x2')](),controller[_0x41f2('0x7')]);router[_0x41f2('0x3')](_0x41f2('0x8'),auth['isAuthenticated'](),controller[_0x41f2('0x9')]);router['get']('/:id/download',auth[_0x41f2('0x2')](),controller['download']);router[_0x41f2('0xa')]('/',auth[_0x41f2('0x2')](),controller['create']);router[_0x41f2('0xa')](_0x41f2('0x8'),auth[_0x41f2('0x2')](),controller[_0x41f2('0xb')]);router[_0x41f2('0xa')]('/:id/tags',auth[_0x41f2('0x2')](),interaction[_0x41f2('0xc')](_0x41f2('0xd'),'mailinteraction:addtags'),controller['addTags']);router['put'](_0x41f2('0x6'),auth[_0x41f2('0x2')](),interaction[_0x41f2('0xc')](_0x41f2('0xd'),'mailinteraction:update'),controller['update']);router[_0x41f2('0xe')](_0x41f2('0x6'),auth[_0x41f2('0x2')](),interaction[_0x41f2('0xc')](_0x41f2('0xd'),_0x41f2('0xf')),controller['destroy']);router[_0x41f2('0xe')](_0x41f2('0x10'),auth['isAuthenticated'](),controller['removeTags']);module['exports']=router;
\ No newline at end of file
+var _0xdf7a=['../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','/describe','describe','show','/:id/messages','getMessages','download','post','create','/:id/tags','tracked','mail','addTags','/:id','mailinteraction:update','update','delete','exports','Router'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdf7a,0xa0));var _0xadf7=function(_0x11086d,_0x5207a1){_0x11086d=_0x11086d-0x0;var _0x23a14c=_0xdf7a[_0x11086d];return _0x23a14c;};'use strict';var express=require('express');var router=express[_0xadf7('0x0')]();var auth=require(_0xadf7('0x1'));var interaction=require(_0xadf7('0x2'));var controller=require(_0xadf7('0x3'));router[_0xadf7('0x4')]('/',auth[_0xadf7('0x5')](),controller['index']);router['get'](_0xadf7('0x6'),auth['isAuthenticated'](),controller[_0xadf7('0x7')]);router[_0xadf7('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xadf7('0x8')]);router['get'](_0xadf7('0x9'),auth[_0xadf7('0x5')](),controller[_0xadf7('0xa')]);router[_0xadf7('0x4')]('/:id/download',auth[_0xadf7('0x5')](),controller[_0xadf7('0xb')]);router[_0xadf7('0xc')]('/',auth['isAuthenticated'](),controller[_0xadf7('0xd')]);router[_0xadf7('0xc')](_0xadf7('0x9'),auth[_0xadf7('0x5')](),controller['addMessage']);router[_0xadf7('0xc')](_0xadf7('0xe'),auth[_0xadf7('0x5')](),interaction[_0xadf7('0xf')](_0xadf7('0x10'),'mailinteraction:addtags'),controller[_0xadf7('0x11')]);router['put'](_0xadf7('0x12'),auth[_0xadf7('0x5')](),interaction['tracked'](_0xadf7('0x10'),_0xadf7('0x13')),controller[_0xadf7('0x14')]);router[_0xadf7('0x15')](_0xadf7('0x12'),auth['isAuthenticated'](),interaction[_0xadf7('0xf')](_0xadf7('0x10'),'mailinteraction:destroy'),controller['destroy']);router[_0xadf7('0x15')](_0xadf7('0xe'),auth[_0xadf7('0x5')](),controller['removeTags']);module[_0xadf7('0x16')]=router;
\ No newline at end of file
index 41bde24..c292766 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b29=['exports','BOOLEAN','DATE','STRING','TEXT','long','ENUM','out','sequelize','iconv'];(function(_0x5501d6,_0x16d9a3){var _0x4961fd=function(_0x499a2d){while(--_0x499a2d){_0x5501d6['push'](_0x5501d6['shift']());}};_0x4961fd(++_0x16d9a3);}(_0x1b29,0x116));var _0x91b2=function(_0x26bf35,_0x349ccc){_0x26bf35=_0x26bf35-0x0;var _0x4cf49b=_0x1b29[_0x26bf35];return _0x4cf49b;};'use strict';var Sequelize=require(_0x91b2('0x0'));var iconv=require(_0x91b2('0x1'));module[_0x91b2('0x2')]={'closed':{'type':Sequelize[_0x91b2('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x91b2('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x91b2('0x5')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x91b2('0x6')](_0x91b2('0x7'))},'subject':{'type':Sequelize[_0x91b2('0x6')]()},'attach':{'type':Sequelize[_0x91b2('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0x91b2('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x91b2('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x91b2('0x8')]('in',_0x91b2('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x91b2('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x91b2('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x91b2('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x1f6a=['BOOLEAN','DATE','STRING','TEXT','long','ENUM','out','sequelize'];(function(_0x3ba780,_0x14133a){var _0x45e705=function(_0x2dd8ed){while(--_0x2dd8ed){_0x3ba780['push'](_0x3ba780['shift']());}};_0x45e705(++_0x14133a);}(_0x1f6a,0xd7));var _0xa1f6=function(_0x35c53f,_0xe63aba){_0x35c53f=_0x35c53f-0x0;var _0x2a2772=_0x1f6a[_0x35c53f];return _0x2a2772;};'use strict';var Sequelize=require(_0xa1f6('0x0'));var iconv=require('iconv');module['exports']={'closed':{'type':Sequelize[_0xa1f6('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa1f6('0x2')]},'disposition':{'type':Sequelize[_0xa1f6('0x3')]},'secondDisposition':{'type':Sequelize[_0xa1f6('0x3')]},'thirdDisposition':{'type':Sequelize[_0xa1f6('0x3')]},'note':{'type':Sequelize[_0xa1f6('0x3')]},'inReplyTo':{'type':Sequelize[_0xa1f6('0x3')](0x1fe)},'to':{'type':Sequelize[_0xa1f6('0x3')]},'cc':{'type':Sequelize[_0xa1f6('0x4')](_0xa1f6('0x5'))},'subject':{'type':Sequelize[_0xa1f6('0x4')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xa1f6('0x2')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0xa1f6('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xa1f6('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa1f6('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xa1f6('0x6')]('in',_0xa1f6('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xa1f6('0x1')],'defaultValue':![]}};
\ No newline at end of file
index e2b6c02..1ad3f52 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3595=['i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.createdAt','i.updatedAt','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.to','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','enableEmailPreview','push','rows','show','rawAttributes','include','options','create','body','params','describe','addMessage','ids','omit','getMessages','sort','format','includeAll','findAll','inlineCss','true','addTags','setTags','spread','emit','mailInteractionTags:save','removeTags','download','join','root','files','server','transcript-%d-%s.zip','attachments','Attachment','Attachments','Messages','subject','get','mkdirSync','decode','headers','bcc','Bcc','basename','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','bluebird','util','path','lodash','squel','juice','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','error','name','send','Users','map','fullname','Tags','split','TagIds','MailMessage','findOne','out','plainBody','-id','lastMsgText','trimStart','catch','waiting','talking','answered','unmanaged','total','closed','UserId','MailInteraction','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','select','field','color','tools_tags','u.id','u.fullname','from','user_has_mail_interactions','left_join','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','users','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','expr','parseSearch','search','sqlOperator','conditions','value','having','`\x20=\x200','`\x20>\x200','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?','find','ContactId','buildExpression','text','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','type','start','some','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','DESC','t.id\x20IN\x20?','resolve','role','agent','user'];(function(_0x4769d1,_0x5ed4b5){var _0x2a14cd=function(_0x495c21){while(--_0x495c21){_0x4769d1['push'](_0x4769d1['shift']());}};_0x2a14cd(++_0x5ed4b5);}(_0x3595,0x147));var _0x5359=function(_0x252e4d,_0x1919cf){_0x252e4d=_0x252e4d-0x0;var _0x4812e9=_0x3595[_0x252e4d];return _0x4812e9;};'use strict';var emlformat=require(_0x5359('0x0'));var rimraf=require(_0x5359('0x1'));var zipdir=require(_0x5359('0x2'));var moment=require('moment');var BPromise=require(_0x5359('0x3'));var util=require(_0x5359('0x4'));var path=require(_0x5359('0x5'));var fs=require('fs');var _=require(_0x5359('0x6'));var squel=require(_0x5359('0x7'));var juice=require(_0x5359('0x8'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var as=require(_0x5359('0x9'));var logger=require(_0x5359('0xa'))(_0x5359('0xb'));var config=require(_0x5359('0xc'));var db=require(_0x5359('0xd'))['db'];var htmlEntities=require(_0x5359('0xe'));config[_0x5359('0xf')]=_[_0x5359('0x10')](config[_0x5359('0xf')],{'host':_0x5359('0x11'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailInteraction.socket')['register'](socket);function respondWithStatusCode(_0x1496b5,_0x191cd0){_0x191cd0=_0x191cd0||0xcc;return function(_0x438c47){if(_0x438c47){return _0x1496b5[_0x5359('0x12')](_0x191cd0);}return _0x1496b5[_0x5359('0x13')](_0x191cd0)[_0x5359('0x14')]();};}function respondWithResult(_0x1b6ccb,_0x343282){_0x343282=_0x343282||0xc8;return function(_0xcf081){if(_0xcf081){return _0x1b6ccb[_0x5359('0x13')](_0x343282)[_0x5359('0x15')](_0xcf081);}};}function respondWithFilteredResult(_0x11d06c,_0x3a7e63){return function(_0xb1a895){if(_0xb1a895){var _0x48099c=typeof _0x3a7e63['offset']===_0x5359('0x16')&&typeof _0x3a7e63[_0x5359('0x17')]===_0x5359('0x16');var _0xa146f5=_0xb1a895[_0x5359('0x18')];var _0x44c489=_0x48099c?0x0:_0x3a7e63['offset'];var _0x5399bb=_0x48099c?_0xb1a895[_0x5359('0x18')]:_0x3a7e63[_0x5359('0x19')]+_0x3a7e63['limit'];var _0x10007f;if(_0x5399bb>=_0xa146f5){_0x5399bb=_0xa146f5;_0x10007f=0xc8;}else{_0x10007f=0xce;}_0x11d06c[_0x5359('0x13')](_0x10007f);return _0x11d06c[_0x5359('0x1a')](_0x5359('0x1b'),_0x44c489+'-'+_0x5399bb+'/'+_0xa146f5)['json'](_0xb1a895);}return null;};}function saveUpdates(_0x50d158){return function(_0x5074e8){if(_0x5074e8){return _0x5074e8[_0x5359('0x1c')](_0x50d158)[_0x5359('0x1d')](function(_0x53f00f){return _0x53f00f;});}return null;};}function removeEntity(_0x35e920){return function(_0x211580){if(_0x211580){return _0x211580[_0x5359('0x1e')]()[_0x5359('0x1d')](function(){_0x35e920['status'](0xcc)[_0x5359('0x14')]();});}};}function handleEntityNotFound(_0x2f97d5){return function(_0x57b297){if(!_0x57b297){_0x2f97d5[_0x5359('0x12')](0x194);}return _0x57b297;};}function handleError(_0x27749e,_0x3d3c0c){_0x3d3c0c=_0x3d3c0c||0x1f4;return function(_0x6e93be){logger[_0x5359('0x1f')](_0x6e93be['stack']);if(_0x6e93be['name']){delete _0x6e93be[_0x5359('0x20')];}_0x27749e[_0x5359('0x13')](_0x3d3c0c)[_0x5359('0x21')](_0x6e93be);};}function getInteractionUsers(_0x745547,_0xe8cc42){return new BPromise(function(_0x336442,_0x3b0d2f){try{if(_0xe8cc42[_0x745547['id']]){_0x745547[_0x5359('0x22')]=_[_0x5359('0x23')](_0xe8cc42[_0x745547['id']],function(_0x550881){return{'id':_0x550881['id'],'fullname':_0x550881[_0x5359('0x24')]};});}}catch(_0xbb59f4){_0x3b0d2f(_0xbb59f4);}_0x336442(_0x745547);});}function getInteractionTags(_0x23f192,_0x3753cb){return new BPromise(function(_0x234c96,_0x402bce){try{if(_0x23f192['TagIds']){_0x23f192[_0x5359('0x25')]=[];_0x23f192['TagIds'][_0x5359('0x26')](',')['forEach'](function(_0x1d6810){_0x23f192[_0x5359('0x25')]['push'](_0x3753cb[_0x1d6810]);});}delete _0x23f192[_0x5359('0x27')];}catch(_0x5766e3){_0x402bce(_0x5766e3);}_0x234c96(_0x23f192);});}function getLastMessageText(_0x20cd96){return new BPromise(function(_0x425519,_0x1ac5ac){return db[_0x5359('0x28')][_0x5359('0x29')]({'where':{'$and':[{'MailInteractionId':_0x20cd96['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x5359('0x2a')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x5359('0x2b')],'order':_0x5359('0x2c'),'raw':!![]})[_0x5359('0x1d')](function(_0x310eca){if(_0x310eca&&_0x310eca[_0x5359('0x2b')]){_0x20cd96[_0x5359('0x2d')]=_[_0x5359('0x2e')](_0x310eca[_0x5359('0x2b')]);}_0x425519(_0x20cd96);})[_0x5359('0x2f')](function(_0x62f6bf){_0x1ac5ac(_0x62f6bf);});});}function updateMailInteraction(_0x1981c7,_0x19163d,_0x54f73b,_0x457c6e){return new BPromise(function(_0x101ff9,_0x4c07e0){return getInteractionUsers(_0x1981c7,_0x54f73b)['then'](function(_0x27a9f8){return getInteractionTags(_0x27a9f8,_0x19163d);})[_0x5359('0x1d')](function(_0x2fc0bb){return getStateInteraction(_0x2fc0bb);})[_0x5359('0x1d')](function(_0x4b6fdf){if(_0x457c6e){_0x101ff9(getLastMessageText(_0x4b6fdf));}else{_0x101ff9(_0x4b6fdf);}})[_0x5359('0x2f')](function(_0x546b8b){_0x4c07e0(_0x546b8b);});});}function getStateInteraction(_0x27f663){return new BPromise(function(_0x366c71){_0x27f663[_0x5359('0x30')]=0x0;_0x27f663[_0x5359('0x31')]=0x0;_0x27f663[_0x5359('0x32')]=0x0;_0x27f663[_0x5359('0x33')]=0x0;_0x27f663[_0x5359('0x34')]=0x0;if(!_0x27f663[_0x5359('0x35')]&&!_0x27f663[_0x5359('0x36')]){_0x27f663[_0x5359('0x30')]+=0x1;}if(!_0x27f663[_0x5359('0x35')]&&_0x27f663[_0x5359('0x36')]){_0x27f663['talking']+=0x1;if(_0x27f663['waiting']){_0x27f663['waiting']-=0x1;}}if(_0x27f663[_0x5359('0x35')]&&_0x27f663[_0x5359('0x36')]){_0x27f663['answered']+=0x1;if(_0x27f663['talking']){_0x27f663[_0x5359('0x31')]-=0x1;}}if(_0x27f663[_0x5359('0x35')]&&!_0x27f663[_0x5359('0x36')]){_0x27f663[_0x5359('0x33')]+=0x1;if(_0x27f663[_0x5359('0x30')]){_0x27f663[_0x5359('0x30')]-=0x1;}}_0x27f663['total']+=0x1;_0x366c71(_0x27f663);});}exports['index']=function(_0x29f233,_0x31c835){var _0x264737={},_0x3d3e14={},_0x2b04ac={'count':0x0,'rows':[]};var _0x1a244e=_[_0x5359('0x23')](db[_0x5359('0x37')]['rawAttributes'],function(_0x35b8b6){return{'name':_0x35b8b6['fieldName'],'type':_0x35b8b6['type'][_0x5359('0x38')]};});_0x3d3e14[_0x5359('0x39')]=_[_0x5359('0x23')](_0x1a244e,_0x5359('0x20'));_0x3d3e14[_0x5359('0x3a')]=_[_0x5359('0x3b')](_0x29f233['query']);_0x3d3e14[_0x5359('0x3c')]=_[_0x5359('0x3d')](_0x3d3e14[_0x5359('0x39')],_0x3d3e14[_0x5359('0x3a')]);_0x264737['attributes']=_[_0x5359('0x3d')](_0x3d3e14['model'],qs[_0x5359('0x3e')](_0x29f233[_0x5359('0x3a')][_0x5359('0x3e')]));_0x264737[_0x5359('0x3f')]=_0x264737[_0x5359('0x3f')][_0x5359('0x40')]?_0x264737[_0x5359('0x3f')]:_0x3d3e14[_0x5359('0x39')];if(!_0x29f233[_0x5359('0x3a')][_0x5359('0x41')](_0x5359('0x42'))){_0x264737[_0x5359('0x17')]=qs['limit'](_0x29f233[_0x5359('0x3a')][_0x5359('0x17')]);_0x264737[_0x5359('0x19')]=qs[_0x5359('0x19')](_0x29f233[_0x5359('0x3a')][_0x5359('0x19')]);}_0x264737[_0x5359('0x43')]=qs['sort'](_0x29f233[_0x5359('0x3a')]['sort']);_0x264737[_0x5359('0x44')]=qs[_0x5359('0x3c')](_[_0x5359('0x45')](_0x29f233[_0x5359('0x3a')],_0x3d3e14[_0x5359('0x3c')]),_0x1a244e);var _0x558d19=[];var _0x453ba4=squel[_0x5359('0x46')]()['field']('id')[_0x5359('0x47')](_0x5359('0x20'))[_0x5359('0x47')](_0x5359('0x48'))['from'](_0x5359('0x49'));var _0x25f5e5=squel[_0x5359('0x46')]()[_0x5359('0x47')](_0x5359('0x4a'))[_0x5359('0x47')](_0x5359('0x4b'))[_0x5359('0x47')]('ui.MailInteractionId')[_0x5359('0x4c')](_0x5359('0x4d'),'ui')[_0x5359('0x4e')]('users','u',_0x5359('0x4f'));var _0xc110cc=squel['select']()[_0x5359('0x4c')](_0x5359('0x50'),'i')[_0x5359('0x4e')](_0x5359('0x51'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x5359('0x52'),'o','o.id\x20=\x20i.UserId')['left_join']('mail_accounts','a',_0x5359('0x53'))[_0x5359('0x4e')](_0x5359('0x54'),'me',_0x5359('0x55'))[_0x5359('0x4e')](_0x5359('0x56'),'it','it.MailInteractionId\x20=\x20i.id')[_0x5359('0x4e')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x12e22e=squel[_0x5359('0x57')]();var _0x17a24e=[];var _0x4e5f57=squel[_0x5359('0x57')]();var _0x489e50;if(_0x29f233[_0x5359('0x3a')]['search']){_0x489e50=as[_0x5359('0x58')](_0x29f233['query'][_0x5359('0x59')]);var _0x4765ac=_0x489e50[_0x5359('0x5a')];for(var _0xa713a0=0x0;_0xa713a0<_0x489e50[_0x5359('0x5b')][_0x5359('0x40')];_0xa713a0++){var _0x36225a=_0x489e50['conditions'][_0xa713a0];var _0x2ea012='i';var _0xca8396=_['find'](_0x1a244e,[_0x5359('0x20'),_0x36225a[_0x5359('0x47')]]);if(!_0xca8396){switch(_0x36225a['field']){case'unreadMessages':if(_0x36225a[_0x5359('0x5c')]==0x1){_0xc110cc[_0x5359('0x5d')]('`'+_0x36225a[_0x5359('0x47')]+_0x5359('0x5e'));}else{_0xc110cc[_0x5359('0x5d')]('`'+_0x36225a[_0x5359('0x47')]+_0x5359('0x5f'));}break;case'Contact':if(_0x36225a[_0x5359('0x60')]==='$substring'){if(_0x36225a[_0x5359('0x5c')][_0x5359('0x26')]('\x20')[_0x5359('0x40')]>0x1){_0x12e22e[_0x4765ac](_0x5359('0x61'),qs[_0x5359('0x62')](_0x36225a[_0x5359('0x5c')]),null);}else{var _0x2496f7='%'+_0x36225a['value']+'%';_0x12e22e[_0x4765ac](_0x5359('0x63'),_0x2496f7,_0x2496f7,_0x2496f7);}}else{_0xca8396=_[_0x5359('0x64')](_0x1a244e,['name',_0x5359('0x65')]);_0x36225a[_0x5359('0x47')]=_0x5359('0x65');_0x54eba5=as[_0x5359('0x66')](_0x2ea012,_0xca8396['type'],_0x36225a);_0x12e22e[_0x4765ac](_0x54eba5[_0x5359('0x67')],_0x54eba5[_0x5359('0x5c')]['start'],_0x54eba5[_0x5359('0x5c')][_0x5359('0x14')]);}break;case _0x5359('0x68'):var _0x5a2e8f=_0x36225a[_0x5359('0x5c')][_0x5359('0x26')](',')[_0x5359('0x23')](function(_0x565a2a){return Number(_0x565a2a);});_0x5a2e8f[_0x5359('0x69')](function(_0x468642){_0x4e5f57['or'](_0x5359('0x6a'),'%,'+_0x468642+',%');});_0x17a24e=_[_0x5359('0x6b')](_0x17a24e,_0x5a2e8f);break;case'User':if(_0x36225a[_0x5359('0x60')]===_0x5359('0x6c')){_0x12e22e[_0x4765ac](_0x5359('0x6d'),'%'+_0x36225a[_0x5359('0x5c')]+'%',null);}else{_0xca8396=_[_0x5359('0x64')](_0x1a244e,[_0x5359('0x20'),_0x5359('0x36')]);_0x36225a[_0x5359('0x47')]='UserId';_0x54eba5=as[_0x5359('0x66')](_0x2ea012,_0xca8396[_0x5359('0x6e')],_0x36225a);_0x12e22e[_0x4765ac](_0x54eba5[_0x5359('0x67')],_0x54eba5['value'][_0x5359('0x6f')],_0x54eba5[_0x5359('0x5c')][_0x5359('0x14')]);}break;case _0x5359('0x2b'):_0x54eba5=as[_0x5359('0x66')]('me',null,_0x36225a);_0x12e22e[_0x4765ac](_0x54eba5[_0x5359('0x67')],_0x54eba5[_0x5359('0x5c')]['start'],_0x54eba5[_0x5359('0x5c')][_0x5359('0x14')]);break;}}else{var _0x54eba5=as[_0x5359('0x66')](_0x2ea012,_0xca8396[_0x5359('0x6e')],_0x36225a);_0x12e22e[_0x4765ac](_0x54eba5[_0x5359('0x67')],_0x54eba5['value'][_0x5359('0x6f')],_0x54eba5[_0x5359('0x5c')]['end']);}}}else{var _0x2ed277=_(_0x29f233[_0x5359('0x3a')])[_0x5359('0x3b')]()[_0x5359('0x23')](function(_0x3aaf77){return _[_0x5359('0x70')](_0x1a244e,['name',_0x3aaf77])?_0x3aaf77:undefined;})['compact']()['value']();if(!_[_0x5359('0x71')](_0x2ed277)){_0x2ed277[_0x5359('0x69')](function(_0x4bcd9e){if(_0x4bcd9e===_0x5359('0x72')){_0xc110cc[_0x5359('0x44')](_0x5359('0x73'),[][_0x5359('0x74')](_0x29f233[_0x5359('0x3a')][_0x4bcd9e]));}else if(_0x4bcd9e===_0x5359('0x75')){var _0x56949f=JSON[_0x5359('0x76')](_0x29f233[_0x5359('0x3a')][_0x4bcd9e])[_0x5359('0x77')];var _0x37e613=JSON['parse'](_0x29f233[_0x5359('0x3a')][_0x4bcd9e])[_0x5359('0x78')];_0xc110cc['where'](_0x5359('0x79'),_0x56949f,_0x37e613);}else{if(_0x29f233['query'][_0x4bcd9e]===_0x5359('0x7a')){_0xc110cc['where']('i.'+_0x4bcd9e+_0x5359('0x7b'));}else{_0xc110cc[_0x5359('0x44')]('i.'+_0x4bcd9e+'\x20=\x20?',_0x29f233[_0x5359('0x3a')][_0x4bcd9e]);}}});}if(_0x29f233[_0x5359('0x3a')][_0x5359('0x7c')]){if(_0x29f233[_0x5359('0x3a')][_0x5359('0x7c')]==0x1){_0xc110cc[_0x5359('0x5d')](_0x5359('0x7d'));}else{_0xc110cc['having'](_0x5359('0x7e'));}}if(_0x29f233[_0x5359('0x3a')]['tag']){_0x17a24e=_[_0x5359('0x7f')](_0x29f233['query'][_0x5359('0x80')])?_0x29f233[_0x5359('0x3a')]['tag']:new Array(_0x29f233[_0x5359('0x3a')][_0x5359('0x80')]);_0x17a24e[_0x5359('0x69')](function(_0x44fe6d){_0x4e5f57['or'](_0x5359('0x6a'),'%,'+_0x44fe6d+',%');});}if(_0x29f233[_0x5359('0x3a')][_0x5359('0x81')]){var _0x436a4d=_0x29f233[_0x5359('0x3a')][_0x5359('0x81')][_0x5359('0x82')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x5359('0x83')](_0x436a4d)){_0x12e22e['or'](_0x5359('0x84'),_0x436a4d+'%');}else if(qs['isEmail'](_0x436a4d)){_0x12e22e['or'](_0x5359('0x85'),_0x436a4d+'%');}else{_0x12e22e['or'](_0x5359('0x86'),qs[_0x5359('0x62')](_0x436a4d))['or'](_0x5359('0x87'),qs[_0x5359('0x62')](_0x436a4d));}}}_0xc110cc[_0x5359('0x44')](_0x12e22e);_0xc110cc[_0x5359('0x88')](_0x5359('0x89'));var _0x53c150={'type':db[_0x5359('0x8a')]['QueryTypes'][_0x5359('0x8b')],'raw':!![]};var _0x5853da=_0xc110cc[_0x5359('0x8c')]();_0x5853da[_0x5359('0x47')]('i.id');_0x5853da[_0x5359('0x47')](_0x5359('0x8d'),_0x5359('0x8e'));if(_0x264737['order']){_0x264737[_0x5359('0x43')][_0x5359('0x69')](function(_0x487642){var _0x2decf2=_0x487642[0x0]==='contactName'?_0x487642[0x0]:'i.'+_0x487642[0x0];_0xc110cc[_0x5359('0x43')](_0x2decf2,_0x487642[0x1]===_0x5359('0x8f')?![]:!![]);});}if(!_['isEmpty'](_0x17a24e)){_0xc110cc['having'](_0x4e5f57);_0x5853da[_0x5359('0x44')](_0x5359('0x90'),_0x17a24e);}BPromise[_0x5359('0x91')]()[_0x5359('0x1d')](function(){if(!_0x489e50){if(_0x29f233['query'][_0x5359('0x72')])return;_0x5853da[_0x5359('0x44')]('i.MailAccountId\x20IS\x20NOT\x20NULL');_0xc110cc['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x29f233['user'][_0x5359('0x92')]!==_0x5359('0x93'))return;return _0x29f233[_0x5359('0x94')]['getMailAccounts']({'attributes':['id'],'raw':!![]})[_0x5359('0x1d')](function(_0x51a029){if(_['isEmpty'](_0x51a029)){_0x5853da[_0x5359('0x44')](_0x5359('0x95'));_0xc110cc['where']('i.MailAccountId\x20IS\x20NULL');}else{_0x5853da[_0x5359('0x44')](_0x5359('0x73'),_[_0x5359('0x23')](_0x51a029,'id'));_0xc110cc[_0x5359('0x44')](_0x5359('0x73'),_[_0x5359('0x23')](_0x51a029,'id'));}});})[_0x5359('0x1d')](function(){if(_0x29f233[_0x5359('0x94')][_0x5359('0x92')]===_0x5359('0x93')&&!_0x489e50&&!_0x29f233[_0x5359('0x3a')][_0x5359('0x72')])return[];return db[_0x5359('0x96')]['query'](_0x5853da['toString'](),_0x53c150);})[_0x5359('0x1d')](function(_0x202f64){_0x2b04ac['count']=_0x202f64['length'];if(_0x2b04ac['count']===0x0)return[];return db[_0x5359('0x96')]['query'](_0x453ba4[_0x5359('0x97')](),_0x53c150)[_0x5359('0x1d')](function(_0x11cacf){_0x558d19=_[_0x5359('0x98')](_0x11cacf,'id');_0x53c150=_[_0x5359('0x99')](_0x53c150,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x29f233['query'][_0x5359('0x3e')]){_0x264737[_0x5359('0x3f')][_0x5359('0x69')](function(_0x301eb8){_0xc110cc[_0x5359('0x47')]('i.'+_0x301eb8);});}else{_0xc110cc[_0x5359('0x47')](_0x5359('0x8d'),'unreadMessages');_0xc110cc['field']('a.key',_0x5359('0x9a'));_0xc110cc[_0x5359('0x47')]('a.mandatoryDisposition',_0x5359('0x9b'));_0xc110cc[_0x5359('0x47')](_0x5359('0x9c'),_0x5359('0x9d'));_0xc110cc[_0x5359('0x47')](_0x5359('0x89'));_0xc110cc[_0x5359('0x47')](_0x5359('0x9e'));_0xc110cc[_0x5359('0x47')](_0x5359('0x9f'));_0xc110cc[_0x5359('0x47')]('i.closed');_0xc110cc[_0x5359('0x47')](_0x5359('0xa0'));_0xc110cc[_0x5359('0x47')](_0x5359('0xa1'));_0xc110cc['field'](_0x5359('0xa2'));_0xc110cc['field'](_0x5359('0xa3'));_0xc110cc[_0x5359('0x47')](_0x5359('0xa4'));_0xc110cc[_0x5359('0x47')](_0x5359('0xa5'));_0xc110cc[_0x5359('0x47')](_0x5359('0xa6'));_0xc110cc['field'](_0x5359('0xa7'));_0xc110cc['field']('i.substatus');_0xc110cc[_0x5359('0x47')](_0x5359('0xa8'));_0xc110cc[_0x5359('0x47')]('i.ContactId');_0xc110cc[_0x5359('0x47')](_0x5359('0xa9'));_0xc110cc[_0x5359('0x47')](_0x5359('0xaa'));_0xc110cc[_0x5359('0x47')](_0x5359('0xab'),_0x5359('0xac'));_0xc110cc[_0x5359('0x47')]('c.lastName',_0x5359('0xad'));_0xc110cc[_0x5359('0x47')](_0x5359('0xae'),'Contact.email');_0xc110cc[_0x5359('0x47')]('c.phone',_0x5359('0xaf'));_0xc110cc['field'](_0x5359('0xb0'),_0x5359('0xb1'));_0xc110cc[_0x5359('0x47')](_0x5359('0xb2'),'Contact.fax');_0xc110cc[_0x5359('0x47')](_0x5359('0xb3'),_0x5359('0xb4'));_0xc110cc[_0x5359('0x47')](_0x5359('0xb5'),_0x5359('0xb6'));_0xc110cc[_0x5359('0x47')](_0x5359('0xb7'),_0x5359('0x27'));}if(_0x264737[_0x5359('0x17')])_0xc110cc[_0x5359('0x17')](_0x264737[_0x5359('0x17')]);if(_0x264737['offset'])_0xc110cc[_0x5359('0x19')](_0x264737[_0x5359('0x19')]);return db[_0x5359('0x96')][_0x5359('0x3a')](_0xc110cc[_0x5359('0x97')](),_0x53c150);})[_0x5359('0x1d')](function(_0x6290e3){if(_0x6290e3[_0x5359('0x40')]>0x0)_0x25f5e5[_0x5359('0x44')](_0x5359('0xb8'),_['map'](_0x6290e3,'id'));return db['sequelize'][_0x5359('0x3a')](_0x25f5e5[_0x5359('0x97')](),_0x53c150)[_0x5359('0x1d')](function(_0x510330){var _0x49f415=_[_0x5359('0xb9')](_0x510330,_0x5359('0xba'));var _0x450a9e=[];return db[_0x5359('0xbb')][_0x5359('0x29')]({'attributes':[_0x5359('0xbc')],'raw':!![]})[_0x5359('0x1d')](function(_0x31b11e){var _0x213026=_0x31b11e[_0x5359('0xbc')];_0x6290e3[_0x5359('0x69')](function(_0x3234ae){_0x450a9e[_0x5359('0xbd')](updateMailInteraction(_0x3234ae,_0x558d19,_0x49f415,_0x213026));});return BPromise['all'](_0x450a9e);});});});})[_0x5359('0x1d')](function(_0x22e8c5){_0x2b04ac[_0x5359('0xbe')]=_0x22e8c5;return _0x2b04ac;})[_0x5359('0x1d')](respondWithFilteredResult(_0x31c835,_0x264737))[_0x5359('0x2f')](handleError(_0x31c835,null));};exports[_0x5359('0xbf')]=function(_0x32c2c8,_0x6bf78c){var _0x31ae41={'raw':![],'where':{'id':_0x32c2c8['params']['id']}},_0x32a1dd={};_0x32a1dd['model']=_[_0x5359('0x3b')](db[_0x5359('0x37')][_0x5359('0xc0')]);_0x32a1dd[_0x5359('0x3a')]=_['keys'](_0x32c2c8[_0x5359('0x3a')]);_0x32a1dd[_0x5359('0x3c')]=_[_0x5359('0x3d')](_0x32a1dd['model'],_0x32a1dd[_0x5359('0x3a')]);_0x31ae41[_0x5359('0x3f')]=_[_0x5359('0x3d')](_0x32a1dd['model'],qs['fields'](_0x32c2c8[_0x5359('0x3a')][_0x5359('0x3e')]));_0x31ae41[_0x5359('0x3f')]=_0x31ae41['attributes']['length']?_0x31ae41[_0x5359('0x3f')]:_0x32a1dd[_0x5359('0x39')];if(_0x32c2c8[_0x5359('0x3a')]['includeAll']){_0x31ae41[_0x5359('0xc1')]=[{'all':!![]}];}_0x31ae41=_[_0x5359('0x99')]({},_0x31ae41,_0x32c2c8[_0x5359('0xc2')]);return db[_0x5359('0x37')][_0x5359('0x64')](_0x31ae41)[_0x5359('0x1d')](handleEntityNotFound(_0x6bf78c,null))['then'](respondWithResult(_0x6bf78c,null))[_0x5359('0x2f')](handleError(_0x6bf78c,null));};exports[_0x5359('0xc3')]=function(_0x2678f2,_0x3b764d){return db['MailInteraction']['create'](_0x2678f2[_0x5359('0xc4')],{})[_0x5359('0x1d')](respondWithResult(_0x3b764d,0xc9))[_0x5359('0x2f')](handleError(_0x3b764d,null));};exports[_0x5359('0x1c')]=function(_0x2ac05b,_0x3a0d30){if(_0x2ac05b[_0x5359('0xc4')]['id']){delete _0x2ac05b[_0x5359('0xc4')]['id'];}return db[_0x5359('0x37')][_0x5359('0x64')]({'where':{'id':_0x2ac05b[_0x5359('0xc5')]['id']}})['then'](handleEntityNotFound(_0x3a0d30,null))[_0x5359('0x1d')](saveUpdates(_0x2ac05b[_0x5359('0xc4')],null))[_0x5359('0x1d')](respondWithResult(_0x3a0d30,null))[_0x5359('0x2f')](handleError(_0x3a0d30,null));};exports[_0x5359('0x1e')]=function(_0x19bda2,_0x4c3bb4){return db[_0x5359('0x37')][_0x5359('0x64')]({'where':{'id':_0x19bda2['params']['id']}})[_0x5359('0x1d')](handleEntityNotFound(_0x4c3bb4,null))[_0x5359('0x1d')](removeEntity(_0x4c3bb4,null))['catch'](handleError(_0x4c3bb4,null));};exports[_0x5359('0xc6')]=function(_0x44c1fc,_0x2d90fb){return db[_0x5359('0x37')][_0x5359('0xc6')]()[_0x5359('0x1d')](respondWithResult(_0x2d90fb,null))['catch'](handleError(_0x2d90fb,null));};exports[_0x5359('0xc7')]=function(_0x55eddc,_0x599248){return db[_0x5359('0x28')][_0x5359('0x64')]({'where':{'id':_0x55eddc[_0x5359('0xc5')]['id']}})['then'](handleEntityNotFound(_0x599248,null))[_0x5359('0x1d')](function(_0x35fdd5){if(_0x35fdd5){return _0x35fdd5[_0x5359('0xc7')](_0x55eddc[_0x5359('0xc4')][_0x5359('0xc8')],_[_0x5359('0xc9')](_0x55eddc[_0x5359('0xc4')],[_0x5359('0xc8'),'id'])||{});}})[_0x5359('0x1d')](respondWithResult(_0x599248,null))[_0x5359('0x2f')](handleError(_0x599248,null));};exports[_0x5359('0xca')]=function(_0x246e96,_0x237e1a){var _0xe34610={'raw':![],'where':{}};var _0x3b9a3d={};var _0x59b51f={'count':0x0,'rows':[]};return db['MailInteraction'][_0x5359('0x29')]({'where':{'id':_0x246e96[_0x5359('0xc5')]['id']}})['then'](handleEntityNotFound(_0x237e1a,null))['then'](function(_0x17973b){if(_0x17973b){_0x3b9a3d[_0x5359('0x39')]=_[_0x5359('0x3b')](db[_0x5359('0x28')]['rawAttributes']);_0x3b9a3d[_0x5359('0x3a')]=_[_0x5359('0x3b')](_0x246e96[_0x5359('0x3a')]);_0x3b9a3d[_0x5359('0x3c')]=_[_0x5359('0x3d')](_0x3b9a3d[_0x5359('0x39')],_0x3b9a3d[_0x5359('0x3a')]);_0xe34610['attributes']=_['intersection'](_0x3b9a3d['model'],qs[_0x5359('0x3e')](_0x246e96[_0x5359('0x3a')][_0x5359('0x3e')]));_0xe34610['attributes']=_0xe34610['attributes'][_0x5359('0x40')]?_0xe34610['attributes']:_0x3b9a3d[_0x5359('0x39')];if(!_0x246e96['query']['hasOwnProperty'](_0x5359('0x42'))){_0xe34610[_0x5359('0x17')]=qs[_0x5359('0x17')](_0x246e96[_0x5359('0x3a')][_0x5359('0x17')]);_0xe34610['offset']=qs['offset'](_0x246e96['query']['offset']);}_0xe34610['order']=qs['sort'](_0x246e96[_0x5359('0x3a')][_0x5359('0xcb')]);_0xe34610[_0x5359('0x44')]=qs[_0x5359('0x3c')](_['pick'](_0x246e96[_0x5359('0x3a')],_0x3b9a3d[_0x5359('0x3c')]));_0xe34610[_0x5359('0x44')][_0x5359('0xba')]=_0x17973b['id'];if(_0x246e96[_0x5359('0x3a')][_0x5359('0x81')]){_0xe34610['where']=_[_0x5359('0x99')](_0xe34610[_0x5359('0x44')],{'$or':_['map'](_0xe34610['attributes'],function(_0x5d74e6){var _0x4dcb12={};_0x4dcb12[_0x5d74e6]={'$like':'%'+_0x246e96[_0x5359('0x3a')][_0x5359('0x81')]+'%'};return _0x4dcb12;})});}if(_0x246e96[_0x5359('0x3a')][_0x5359('0x77')]){var _0x1b20ec=_0x246e96[_0x5359('0x3a')][_0x5359('0x77')][_0x5359('0x26')](',');var _0x1932c5={};_0x1932c5[_0x1b20ec[0x0]]={'$gte':moment(_0x1b20ec[0x1])[_0x5359('0xcc')]('YYYY-MM-DD\x20HH:mm:ss')};_0xe34610[_0x5359('0x44')]=_[_0x5359('0x99')](_0xe34610[_0x5359('0x44')],_0x1932c5);}_0xe34610=_[_0x5359('0x99')]({},_0xe34610,_0x246e96[_0x5359('0xc2')]);return db[_0x5359('0x28')][_0x5359('0x18')]({'where':_0xe34610[_0x5359('0x44')]})[_0x5359('0x1d')](function(_0x208fff){_0x59b51f[_0x5359('0x18')]=_0x208fff;if(_0x246e96['query'][_0x5359('0xcd')]){_0xe34610[_0x5359('0xc1')]=[{'all':!![]}];}return db['MailMessage'][_0x5359('0xce')](_0xe34610);})['then'](function(_0x259daa){if(_0x246e96[_0x5359('0x3a')][_0x5359('0xcf')]===_0x5359('0xd0')){for(var _0x5930ac=0x0;_0x5930ac<_0x259daa[_0x5359('0x40')];_0x5930ac++){_0x259daa[_0x5930ac][_0x5359('0xc4')]=juice(_0x259daa[_0x5930ac][_0x5359('0xc4')]);}}_0x59b51f[_0x5359('0xbe')]=_0x259daa;return _0x59b51f;});}})[_0x5359('0x1d')](respondWithFilteredResult(_0x237e1a,_0xe34610))[_0x5359('0x2f')](handleError(_0x237e1a,null));};exports[_0x5359('0xd1')]=function(_0x500409,_0x13ecc3){return db[_0x5359('0x37')]['find']({'where':{'id':_0x500409['params']['id']}})['then'](handleEntityNotFound(_0x13ecc3,null))[_0x5359('0x1d')](function(_0xa24ea2){if(_0xa24ea2){return _0xa24ea2[_0x5359('0xd2')](_0x500409[_0x5359('0xc4')][_0x5359('0xc8')],_[_0x5359('0xc9')](_0x500409[_0x5359('0xc4')],[_0x5359('0xc8'),'id'])||{})[_0x5359('0xd3')](function(){return db[_0x5359('0x68')][_0x5359('0xce')]({'attributes':['id',_0x5359('0x20'),'color'],'where':{'id':_0x500409[_0x5359('0xc4')][_0x5359('0xc8')]}});})['then'](function(_0x219536){socket[_0x5359('0xd4')](_0x5359('0xd5'),{'id':Number(_0x500409[_0x5359('0xc5')]['id']),'tags':_0x219536||[]});return{'id':Number(_0x500409[_0x5359('0xc5')]['id']),'tags':_0x219536||[]};});}})['then'](respondWithResult(_0x13ecc3,null))[_0x5359('0x2f')](handleError(_0x13ecc3,null));};exports['removeTags']=function(_0x432ecf,_0x1c7b8c){return db[_0x5359('0x37')][_0x5359('0x64')]({'where':{'id':_0x432ecf[_0x5359('0xc5')]['id']}})[_0x5359('0x1d')](handleEntityNotFound(_0x1c7b8c,null))[_0x5359('0x1d')](function(_0x47d515){if(_0x47d515){return _0x47d515[_0x5359('0xd6')](_0x432ecf[_0x5359('0x3a')]['ids']);}})[_0x5359('0x1d')](respondWithStatusCode(_0x1c7b8c,null))[_0x5359('0x2f')](handleError(_0x1c7b8c,null));};exports[_0x5359('0xd7')]=function(_0x264024,_0x52a779){var _0x208b51=moment()['unix']()[_0x5359('0x97')]();var _0x6a1a75=path[_0x5359('0xd8')](config[_0x5359('0xd9')],'server',_0x5359('0xda'),'tmp');var _0x24e145=path[_0x5359('0xd8')](config['root'],_0x5359('0xdb'),_0x5359('0xda'),'attachments');var _0x26df00=path[_0x5359('0xd8')](_0x6a1a75,_0x208b51);var _0x38c508=util[_0x5359('0xcc')](_0x5359('0xdc'),_0x264024[_0x5359('0xc5')]['id'],_0x208b51);var _0x51dae2=path[_0x5359('0xd8')](_0x6a1a75,_0x38c508);var _0x2a3da1=[];if(_0x264024[_0x5359('0x3a')][_0x5359('0xdd')]){_0x2a3da1[_0x5359('0xbd')]({'model':db[_0x5359('0xde')],'as':_0x5359('0xdf'),'raw':!![]});}var _0x1288c7=[{'model':db[_0x5359('0x28')],'as':_0x5359('0xe0'),'attributes':['id',_0x5359('0xc4'),'from','to','cc','bcc',_0x5359('0xe1'),_0x5359('0x75')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x2a3da1}];return db[_0x5359('0x37')][_0x5359('0x64')]({'where':{'id':_0x264024['params']['id']},'include':_0x1288c7})['then'](handleEntityNotFound(_0x52a779,null))[_0x5359('0x1d')](function(_0x1f5e8e){if(_0x1f5e8e&&_0x1f5e8e['Messages']){var _0x34d5f2=_0x1f5e8e[_0x5359('0xe2')]({'plain':!![]});fs[_0x5359('0xe3')](_0x26df00);return BPromise['each'](_0x34d5f2[_0x5359('0xe0')],function(_0x30e976,_0x1f4fbb){var _0x394bfd={'from':_0x30e976['from'],'to':_0x30e976['to'],'subject':_0x30e976['subject'],'html':htmlEntities[_0x5359('0xe4')](_0x30e976[_0x5359('0xc4')]),'headers':{'Date':moment(_0x30e976[_0x5359('0x75')])[_0x5359('0xcc')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x30e976['cc']){_0x394bfd[_0x5359('0xe5')]['Cc']=_0x30e976['cc'];}if(_0x30e976[_0x5359('0xe6')]){_0x394bfd['headers'][_0x5359('0xe7')]=_0x30e976[_0x5359('0xe6')];}return new BPromise(function(_0x23a5e5,_0x51d636){if(_0x30e976[_0x5359('0xdf')]){for(var _0x53528f=0x0;_0x53528f<_0x30e976[_0x5359('0xdf')][_0x5359('0x40')];_0x53528f++){var _0x5f07bd=_0x30e976[_0x5359('0xdf')][_0x53528f];var _0x34bbec=path[_0x5359('0xd8')](_0x24e145,_0x5f07bd[_0x5359('0xe8')]);if(fs['existsSync'](_0x34bbec)){_0x394bfd[_0x5359('0xdd')]['push']({'name':_0x5f07bd[_0x5359('0x20')],'contentType':_0x5f07bd[_0x5359('0x6e')],'data':fs[_0x5359('0xe9')](_0x34bbec)});}}}emlformat[_0x5359('0xea')](_0x394bfd,function(_0x3327ea,_0x5ba5b0){if(_0x3327ea)return _0x51d636(_0x3327ea);fs[_0x5359('0xeb')](path[_0x5359('0xd8')](_0x26df00,util[_0x5359('0xcc')](_0x5359('0xec'),_0x1f4fbb)),_0x5ba5b0);return _0x23a5e5(_0x5ba5b0);});});})[_0x5359('0x1d')](function(){return new BPromise(function(_0x3e8b4c,_0x59e59c){zipdir(_0x26df00,{'saveTo':_0x51dae2},function(_0x279974,_0x23ecd9){if(_0x279974)return _0x59e59c(_0x279974);return _0x3e8b4c(_0x23ecd9);});})['then'](function(){return new BPromise(function(_0x293222,_0xcbedca){rimraf(_0x26df00,function(_0x11510b){if(_0x11510b)_0xcbedca(_0x11510b);return _0x293222();});});})['then'](function(){return _0x52a779[_0x5359('0xd7')](_0x51dae2,_0x38c508,function(_0x5253e9){if(!_0x5253e9)fs[_0x5359('0xed')](_0x51dae2);});});});}else{return _0x52a779['sendStatus'](0xc8);}})['catch'](handleError(_0x52a779,null));};
\ No newline at end of file
+var _0xde81=['filter','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','setTags','emit','removeTags','download','unix','join','root','server','tmp','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','bcc','get','each','subject','decode','headers','Bcc','basename','existsSync','readFileSync','build','writeFileSync','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','util','squel','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','sendStatus','status','end','json','undefined','limit','offset','update','then','destroy','error','stack','name','send','Users','map','fullname','TagIds','Tags','forEach','push','MailMessage','findOne','out','plainBody','-id','lastMsgText','trimStart','catch','waiting','answered','unmanaged','total','closed','UserId','talking','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','field','color','from','tools_tags','select','u.id','u.fullname','user_has_mail_interactions','users','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','left_join','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','sqlOperator','conditions','find','having','`\x20=\x200','Contact','operator','value','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','Tag','union','User','$substring','start','some','compact','isEmpty','MailAccountId','where','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','Sequelize','QueryTypes','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','t.id\x20IN\x20?','i.MailAccountId\x20IS\x20NOT\x20NULL','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','user','count','toString','keyBy','merge','MailInteraction','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.subject','i.disposition','i.thirdDisposition','i.substatus','i.to','i.MailAccountId','i.UserId','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','sequelize','groupBy','MailInteractionId','enableEmailPreview','rows','show','params','includeAll','options','create','body','describe','addMessage','ids','getMessages'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xde81,0x109));var _0x1de8=function(_0x52533c,_0x3e9fd7){_0x52533c=_0x52533c-0x0;var _0xafab1a=_0xde81[_0x52533c];return _0xafab1a;};'use strict';var emlformat=require(_0x1de8('0x0'));var rimraf=require(_0x1de8('0x1'));var zipdir=require(_0x1de8('0x2'));var moment=require(_0x1de8('0x3'));var BPromise=require(_0x1de8('0x4'));var util=require(_0x1de8('0x5'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x1de8('0x6'));var juice=require('juice');var Redis=require(_0x1de8('0x7'));var qs=require(_0x1de8('0x8'));var as=require(_0x1de8('0x9'));var logger=require(_0x1de8('0xa'))(_0x1de8('0xb'));var config=require(_0x1de8('0xc'));var db=require(_0x1de8('0xd'))['db'];var htmlEntities=require('html-entities');config['redis']=_[_0x1de8('0xe')](config['redis'],{'host':_0x1de8('0xf'),'port':0x18eb});var socket=require(_0x1de8('0x10'))(new Redis(config[_0x1de8('0x11')]));require('./mailInteraction.socket')[_0x1de8('0x12')](socket);function respondWithStatusCode(_0x14fd0f,_0x7501d){_0x7501d=_0x7501d||0xcc;return function(_0x3ef1e8){if(_0x3ef1e8){return _0x14fd0f[_0x1de8('0x13')](_0x7501d);}return _0x14fd0f[_0x1de8('0x14')](_0x7501d)[_0x1de8('0x15')]();};}function respondWithResult(_0x44af86,_0x17096a){_0x17096a=_0x17096a||0xc8;return function(_0x430fcf){if(_0x430fcf){return _0x44af86['status'](_0x17096a)[_0x1de8('0x16')](_0x430fcf);}};}function respondWithFilteredResult(_0x59cfba,_0x17ee96){return function(_0x2cf750){if(_0x2cf750){var _0x4d0ed6=typeof _0x17ee96['offset']===_0x1de8('0x17')&&typeof _0x17ee96[_0x1de8('0x18')]===_0x1de8('0x17');var _0x1b6ca1=_0x2cf750['count'];var _0x297130=_0x4d0ed6?0x0:_0x17ee96[_0x1de8('0x19')];var _0x407a54=_0x4d0ed6?_0x2cf750['count']:_0x17ee96[_0x1de8('0x19')]+_0x17ee96[_0x1de8('0x18')];var _0x4e0786;if(_0x407a54>=_0x1b6ca1){_0x407a54=_0x1b6ca1;_0x4e0786=0xc8;}else{_0x4e0786=0xce;}_0x59cfba[_0x1de8('0x14')](_0x4e0786);return _0x59cfba['set']('Content-Range',_0x297130+'-'+_0x407a54+'/'+_0x1b6ca1)[_0x1de8('0x16')](_0x2cf750);}return null;};}function saveUpdates(_0x53515e){return function(_0xcf3c69){if(_0xcf3c69){return _0xcf3c69[_0x1de8('0x1a')](_0x53515e)[_0x1de8('0x1b')](function(_0x5030c3){return _0x5030c3;});}return null;};}function removeEntity(_0x3f0a5f){return function(_0x33a9f2){if(_0x33a9f2){return _0x33a9f2[_0x1de8('0x1c')]()[_0x1de8('0x1b')](function(){_0x3f0a5f[_0x1de8('0x14')](0xcc)[_0x1de8('0x15')]();});}};}function handleEntityNotFound(_0x10a4aa){return function(_0x3e2c3e){if(!_0x3e2c3e){_0x10a4aa['sendStatus'](0x194);}return _0x3e2c3e;};}function handleError(_0x9d0996,_0x441fcd){_0x441fcd=_0x441fcd||0x1f4;return function(_0x404696){logger[_0x1de8('0x1d')](_0x404696[_0x1de8('0x1e')]);if(_0x404696[_0x1de8('0x1f')]){delete _0x404696[_0x1de8('0x1f')];}_0x9d0996['status'](_0x441fcd)[_0x1de8('0x20')](_0x404696);};}function getInteractionUsers(_0x5051f6,_0x577847){return new BPromise(function(_0xb6b4ce,_0x4600c7){try{if(_0x577847[_0x5051f6['id']]){_0x5051f6[_0x1de8('0x21')]=_[_0x1de8('0x22')](_0x577847[_0x5051f6['id']],function(_0x3d3ab3){return{'id':_0x3d3ab3['id'],'fullname':_0x3d3ab3[_0x1de8('0x23')]};});}}catch(_0x37cd96){_0x4600c7(_0x37cd96);}_0xb6b4ce(_0x5051f6);});}function getInteractionTags(_0x49f8a6,_0xd68b70){return new BPromise(function(_0x38dfa6,_0x3b2ef5){try{if(_0x49f8a6[_0x1de8('0x24')]){_0x49f8a6[_0x1de8('0x25')]=[];_0x49f8a6['TagIds']['split'](',')[_0x1de8('0x26')](function(_0x10fdf3){_0x49f8a6[_0x1de8('0x25')][_0x1de8('0x27')](_0xd68b70[_0x10fdf3]);});}delete _0x49f8a6['TagIds'];}catch(_0x402467){_0x3b2ef5(_0x402467);}_0x38dfa6(_0x49f8a6);});}function getLastMessageText(_0x2a5409){return new BPromise(function(_0x5bbf52,_0x379935){return db[_0x1de8('0x28')][_0x1de8('0x29')]({'where':{'$and':[{'MailInteractionId':_0x2a5409['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x1de8('0x2a')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x1de8('0x2b')],'order':_0x1de8('0x2c'),'raw':!![]})[_0x1de8('0x1b')](function(_0x13fe75){if(_0x13fe75&&_0x13fe75[_0x1de8('0x2b')]){_0x2a5409[_0x1de8('0x2d')]=_[_0x1de8('0x2e')](_0x13fe75[_0x1de8('0x2b')]);}_0x5bbf52(_0x2a5409);})[_0x1de8('0x2f')](function(_0x3f4888){_0x379935(_0x3f4888);});});}function updateMailInteraction(_0x2ed5a1,_0x55574a,_0x141c5e,_0x2da242){return new BPromise(function(_0x1d18a6,_0xaa5258){return getInteractionUsers(_0x2ed5a1,_0x141c5e)[_0x1de8('0x1b')](function(_0x355549){return getInteractionTags(_0x355549,_0x55574a);})['then'](function(_0x53149a){return getStateInteraction(_0x53149a);})[_0x1de8('0x1b')](function(_0x4411fd){if(_0x2da242){_0x1d18a6(getLastMessageText(_0x4411fd));}else{_0x1d18a6(_0x4411fd);}})[_0x1de8('0x2f')](function(_0x11a3fd){_0xaa5258(_0x11a3fd);});});}function getStateInteraction(_0x1bbae3){return new BPromise(function(_0x5f290b){_0x1bbae3[_0x1de8('0x30')]=0x0;_0x1bbae3['talking']=0x0;_0x1bbae3[_0x1de8('0x31')]=0x0;_0x1bbae3[_0x1de8('0x32')]=0x0;_0x1bbae3[_0x1de8('0x33')]=0x0;if(!_0x1bbae3['closed']&&!_0x1bbae3['UserId']){_0x1bbae3[_0x1de8('0x30')]+=0x1;}if(!_0x1bbae3[_0x1de8('0x34')]&&_0x1bbae3[_0x1de8('0x35')]){_0x1bbae3['talking']+=0x1;if(_0x1bbae3['waiting']){_0x1bbae3[_0x1de8('0x30')]-=0x1;}}if(_0x1bbae3[_0x1de8('0x34')]&&_0x1bbae3[_0x1de8('0x35')]){_0x1bbae3[_0x1de8('0x31')]+=0x1;if(_0x1bbae3['talking']){_0x1bbae3[_0x1de8('0x36')]-=0x1;}}if(_0x1bbae3[_0x1de8('0x34')]&&!_0x1bbae3[_0x1de8('0x35')]){_0x1bbae3[_0x1de8('0x32')]+=0x1;if(_0x1bbae3[_0x1de8('0x30')]){_0x1bbae3[_0x1de8('0x30')]-=0x1;}}_0x1bbae3[_0x1de8('0x33')]+=0x1;_0x5f290b(_0x1bbae3);});}exports['index']=function(_0x17e7df,_0x5bb7e4){var _0x5c1c9a={},_0x40cb75={},_0xda3471={'count':0x0,'rows':[]};var _0x17330e=_[_0x1de8('0x22')](db['MailInteraction'][_0x1de8('0x37')],function(_0x49d243){return{'name':_0x49d243[_0x1de8('0x38')],'type':_0x49d243[_0x1de8('0x39')][_0x1de8('0x3a')]};});_0x40cb75[_0x1de8('0x3b')]=_[_0x1de8('0x22')](_0x17330e,_0x1de8('0x1f'));_0x40cb75[_0x1de8('0x3c')]=_[_0x1de8('0x3d')](_0x17e7df['query']);_0x40cb75['filters']=_[_0x1de8('0x3e')](_0x40cb75['model'],_0x40cb75[_0x1de8('0x3c')]);_0x5c1c9a['attributes']=_[_0x1de8('0x3e')](_0x40cb75['model'],qs[_0x1de8('0x3f')](_0x17e7df[_0x1de8('0x3c')]['fields']));_0x5c1c9a['attributes']=_0x5c1c9a[_0x1de8('0x40')][_0x1de8('0x41')]?_0x5c1c9a[_0x1de8('0x40')]:_0x40cb75[_0x1de8('0x3b')];if(!_0x17e7df[_0x1de8('0x3c')][_0x1de8('0x42')](_0x1de8('0x43'))){_0x5c1c9a[_0x1de8('0x18')]=qs['limit'](_0x17e7df[_0x1de8('0x3c')]['limit']);_0x5c1c9a[_0x1de8('0x19')]=qs[_0x1de8('0x19')](_0x17e7df[_0x1de8('0x3c')]['offset']);}_0x5c1c9a[_0x1de8('0x44')]=qs[_0x1de8('0x45')](_0x17e7df[_0x1de8('0x3c')]['sort']);_0x5c1c9a['where']=qs[_0x1de8('0x46')](_[_0x1de8('0x47')](_0x17e7df[_0x1de8('0x3c')],_0x40cb75[_0x1de8('0x46')]),_0x17330e);var _0x26db41=[];var _0x2270db=squel['select']()['field']('id')[_0x1de8('0x48')]('name')['field'](_0x1de8('0x49'))[_0x1de8('0x4a')](_0x1de8('0x4b'));var _0x5236b5=squel[_0x1de8('0x4c')]()[_0x1de8('0x48')](_0x1de8('0x4d'))['field'](_0x1de8('0x4e'))[_0x1de8('0x48')]('ui.MailInteractionId')['from'](_0x1de8('0x4f'),'ui')['left_join'](_0x1de8('0x50'),'u','u.id\x20=\x20ui.UserId');var _0x1ec82b=squel['select']()['from']('mail_interactions','i')['left_join'](_0x1de8('0x51'),'c',_0x1de8('0x52'))[_0x1de8('0x53')]('users','o',_0x1de8('0x54'))[_0x1de8('0x53')](_0x1de8('0x55'),'a',_0x1de8('0x56'))[_0x1de8('0x53')](_0x1de8('0x57'),'me',_0x1de8('0x58'))['left_join'](_0x1de8('0x59'),'it',_0x1de8('0x5a'))[_0x1de8('0x53')](_0x1de8('0x4b'),'t',_0x1de8('0x5b'));var _0x26c0d9=squel[_0x1de8('0x5c')]();var _0x55b2e5=[];var _0x22a5b0=squel[_0x1de8('0x5c')]();var _0x446eae;if(_0x17e7df[_0x1de8('0x3c')]['search']){_0x446eae=as[_0x1de8('0x5d')](_0x17e7df[_0x1de8('0x3c')]['search']);var _0x3b1ec5=_0x446eae[_0x1de8('0x5e')];for(var _0x2d2d90=0x0;_0x2d2d90<_0x446eae[_0x1de8('0x5f')][_0x1de8('0x41')];_0x2d2d90++){var _0x3b6644=_0x446eae[_0x1de8('0x5f')][_0x2d2d90];var _0x385aa3='i';var _0x510630=_[_0x1de8('0x60')](_0x17330e,[_0x1de8('0x1f'),_0x3b6644[_0x1de8('0x48')]]);if(!_0x510630){switch(_0x3b6644[_0x1de8('0x48')]){case'unreadMessages':if(_0x3b6644['value']==0x1){_0x1ec82b[_0x1de8('0x61')]('`'+_0x3b6644[_0x1de8('0x48')]+_0x1de8('0x62'));}else{_0x1ec82b[_0x1de8('0x61')]('`'+_0x3b6644[_0x1de8('0x48')]+'`\x20>\x200');}break;case _0x1de8('0x63'):if(_0x3b6644[_0x1de8('0x64')]==='$substring'){if(_0x3b6644[_0x1de8('0x65')][_0x1de8('0x66')]('\x20')['length']>0x1){_0x26c0d9[_0x3b1ec5](_0x1de8('0x67'),qs[_0x1de8('0x68')](_0x3b6644[_0x1de8('0x65')]),null);}else{var _0x45f94d='%'+_0x3b6644[_0x1de8('0x65')]+'%';_0x26c0d9[_0x3b1ec5]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x45f94d,_0x45f94d,_0x45f94d);}}else{_0x510630=_['find'](_0x17330e,[_0x1de8('0x1f'),_0x1de8('0x69')]);_0x3b6644[_0x1de8('0x48')]=_0x1de8('0x69');_0x2562cb=as[_0x1de8('0x6a')](_0x385aa3,_0x510630[_0x1de8('0x39')],_0x3b6644);_0x26c0d9[_0x3b1ec5](_0x2562cb[_0x1de8('0x6b')],_0x2562cb[_0x1de8('0x65')]['start'],_0x2562cb[_0x1de8('0x65')][_0x1de8('0x15')]);}break;case _0x1de8('0x6c'):var _0x4e1bd6=_0x3b6644[_0x1de8('0x65')][_0x1de8('0x66')](',')[_0x1de8('0x22')](function(_0x48a74f){return Number(_0x48a74f);});_0x4e1bd6[_0x1de8('0x26')](function(_0xa0f281){_0x22a5b0['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xa0f281+',%');});_0x55b2e5=_[_0x1de8('0x6d')](_0x55b2e5,_0x4e1bd6);break;case _0x1de8('0x6e'):if(_0x3b6644[_0x1de8('0x64')]===_0x1de8('0x6f')){_0x26c0d9[_0x3b1ec5]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x3b6644[_0x1de8('0x65')]+'%',null);}else{_0x510630=_[_0x1de8('0x60')](_0x17330e,[_0x1de8('0x1f'),_0x1de8('0x35')]);_0x3b6644['field']='UserId';_0x2562cb=as[_0x1de8('0x6a')](_0x385aa3,_0x510630[_0x1de8('0x39')],_0x3b6644);_0x26c0d9[_0x3b1ec5](_0x2562cb[_0x1de8('0x6b')],_0x2562cb[_0x1de8('0x65')][_0x1de8('0x70')],_0x2562cb[_0x1de8('0x65')][_0x1de8('0x15')]);}break;case _0x1de8('0x2b'):_0x2562cb=as[_0x1de8('0x6a')]('me',null,_0x3b6644);_0x26c0d9[_0x3b1ec5](_0x2562cb[_0x1de8('0x6b')],_0x2562cb[_0x1de8('0x65')]['start'],_0x2562cb['value'][_0x1de8('0x15')]);break;}}else{var _0x2562cb=as[_0x1de8('0x6a')](_0x385aa3,_0x510630['type'],_0x3b6644);_0x26c0d9[_0x3b1ec5](_0x2562cb[_0x1de8('0x6b')],_0x2562cb[_0x1de8('0x65')][_0x1de8('0x70')],_0x2562cb[_0x1de8('0x65')][_0x1de8('0x15')]);}}}else{var _0xfba5cc=_(_0x17e7df[_0x1de8('0x3c')])[_0x1de8('0x3d')]()[_0x1de8('0x22')](function(_0x2e0aa3){return _[_0x1de8('0x71')](_0x17330e,[_0x1de8('0x1f'),_0x2e0aa3])?_0x2e0aa3:undefined;})[_0x1de8('0x72')]()[_0x1de8('0x65')]();if(!_[_0x1de8('0x73')](_0xfba5cc)){_0xfba5cc['forEach'](function(_0x4c2460){if(_0x4c2460===_0x1de8('0x74')){_0x1ec82b[_0x1de8('0x75')](_0x1de8('0x76'),[][_0x1de8('0x77')](_0x17e7df[_0x1de8('0x3c')][_0x4c2460]));}else if(_0x4c2460===_0x1de8('0x78')){var _0x2cb608=JSON[_0x1de8('0x79')](_0x17e7df[_0x1de8('0x3c')][_0x4c2460])[_0x1de8('0x7a')];var _0x137242=JSON[_0x1de8('0x79')](_0x17e7df[_0x1de8('0x3c')][_0x4c2460])[_0x1de8('0x7b')];_0x1ec82b[_0x1de8('0x75')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2cb608,_0x137242);}else{if(_0x17e7df['query'][_0x4c2460]==='null'){_0x1ec82b['where']('i.'+_0x4c2460+_0x1de8('0x7c'));}else{_0x1ec82b['where']('i.'+_0x4c2460+_0x1de8('0x7d'),_0x17e7df['query'][_0x4c2460]);}}});}if(_0x17e7df['query'][_0x1de8('0x7e')]){if(_0x17e7df[_0x1de8('0x3c')][_0x1de8('0x7e')]==0x1){_0x1ec82b[_0x1de8('0x61')]('`unreadMessages`\x20=\x200');}else{_0x1ec82b[_0x1de8('0x61')](_0x1de8('0x7f'));}}if(_0x17e7df[_0x1de8('0x3c')][_0x1de8('0x80')]){_0x55b2e5=_['isArray'](_0x17e7df[_0x1de8('0x3c')][_0x1de8('0x80')])?_0x17e7df['query'][_0x1de8('0x80')]:new Array(_0x17e7df['query'][_0x1de8('0x80')]);_0x55b2e5[_0x1de8('0x26')](function(_0x4138a6){_0x22a5b0['or'](_0x1de8('0x81'),'%,'+_0x4138a6+',%');});}if(_0x17e7df[_0x1de8('0x3c')]['filter']){var _0x1cbe54=_0x17e7df[_0x1de8('0x3c')]['filter']['replace']('\x5c','\x5c\x5c')[_0x1de8('0x82')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x1cbe54)){_0x26c0d9['or'](_0x1de8('0x83'),_0x1cbe54+'%');}else if(qs[_0x1de8('0x84')](_0x1cbe54)){_0x26c0d9['or'](_0x1de8('0x85'),_0x1cbe54+'%');}else{_0x26c0d9['or'](_0x1de8('0x86'),qs['getFullTextValue'](_0x1cbe54))['or'](_0x1de8('0x87'),qs[_0x1de8('0x68')](_0x1cbe54));}}}_0x1ec82b[_0x1de8('0x75')](_0x26c0d9);_0x1ec82b[_0x1de8('0x88')]('i.id');var _0x9e0bfe={'type':db[_0x1de8('0x89')][_0x1de8('0x8a')]['SELECT'],'raw':!![]};var _0x23cff4=_0x1ec82b[_0x1de8('0x8b')]();_0x23cff4['field'](_0x1de8('0x8c'));_0x23cff4['field'](_0x1de8('0x8d'),_0x1de8('0x8e'));if(_0x5c1c9a[_0x1de8('0x44')]){_0x5c1c9a['order'][_0x1de8('0x26')](function(_0x4303a1){var _0x3bd831=_0x4303a1[0x0]===_0x1de8('0x8f')?_0x4303a1[0x0]:'i.'+_0x4303a1[0x0];_0x1ec82b['order'](_0x3bd831,_0x4303a1[0x1]===_0x1de8('0x90')?![]:!![]);});}if(!_[_0x1de8('0x73')](_0x55b2e5)){_0x1ec82b[_0x1de8('0x61')](_0x22a5b0);_0x23cff4[_0x1de8('0x75')](_0x1de8('0x91'),_0x55b2e5);}BPromise['resolve']()[_0x1de8('0x1b')](function(){if(!_0x446eae){if(_0x17e7df[_0x1de8('0x3c')][_0x1de8('0x74')])return;_0x23cff4['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x1ec82b[_0x1de8('0x75')](_0x1de8('0x92'));return;}if(_0x17e7df['user'][_0x1de8('0x93')]!==_0x1de8('0x94'))return;return _0x17e7df['user'][_0x1de8('0x95')]({'attributes':['id'],'raw':!![]})[_0x1de8('0x1b')](function(_0x4ab28f){if(_[_0x1de8('0x73')](_0x4ab28f)){_0x23cff4['where'](_0x1de8('0x96'));_0x1ec82b[_0x1de8('0x75')](_0x1de8('0x96'));}else{_0x23cff4['where'](_0x1de8('0x76'),_[_0x1de8('0x22')](_0x4ab28f,'id'));_0x1ec82b['where'](_0x1de8('0x76'),_[_0x1de8('0x22')](_0x4ab28f,'id'));}});})[_0x1de8('0x1b')](function(){if(_0x17e7df[_0x1de8('0x97')]['role']===_0x1de8('0x94')&&!_0x446eae&&!_0x17e7df[_0x1de8('0x3c')][_0x1de8('0x74')])return[];return db['sequelize'][_0x1de8('0x3c')](_0x23cff4['toString'](),_0x9e0bfe);})['then'](function(_0x335243){_0xda3471[_0x1de8('0x98')]=_0x335243[_0x1de8('0x41')];if(_0xda3471['count']===0x0)return[];return db['sequelize']['query'](_0x2270db[_0x1de8('0x99')](),_0x9e0bfe)['then'](function(_0x3e32e4){_0x26db41=_[_0x1de8('0x9a')](_0x3e32e4,'id');_0x9e0bfe=_[_0x1de8('0x9b')](_0x9e0bfe,{'model':db[_0x1de8('0x9c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x17e7df[_0x1de8('0x3c')][_0x1de8('0x3f')]){_0x5c1c9a[_0x1de8('0x40')][_0x1de8('0x26')](function(_0x4f52e5){_0x1ec82b[_0x1de8('0x48')]('i.'+_0x4f52e5);});}else{_0x1ec82b[_0x1de8('0x48')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x1de8('0x8e'));_0x1ec82b[_0x1de8('0x48')](_0x1de8('0x9d'),_0x1de8('0x9e'));_0x1ec82b[_0x1de8('0x48')](_0x1de8('0x9f'),_0x1de8('0xa0'));_0x1ec82b[_0x1de8('0x48')]('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');_0x1ec82b[_0x1de8('0x48')](_0x1de8('0x8c'));_0x1ec82b[_0x1de8('0x48')](_0x1de8('0xa1'));_0x1ec82b['field'](_0x1de8('0xa2'));_0x1ec82b[_0x1de8('0x48')]('i.closed');_0x1ec82b['field']('i.closedAt');_0x1ec82b[_0x1de8('0x48')]('i.attach');_0x1ec82b[_0x1de8('0x48')]('i.lastMsgAt');_0x1ec82b[_0x1de8('0x48')]('i.lastMsgDirection');_0x1ec82b[_0x1de8('0x48')](_0x1de8('0xa3'));_0x1ec82b[_0x1de8('0x48')](_0x1de8('0xa4'));_0x1ec82b[_0x1de8('0x48')]('i.secondDisposition');_0x1ec82b[_0x1de8('0x48')](_0x1de8('0xa5'));_0x1ec82b[_0x1de8('0x48')](_0x1de8('0xa6'));_0x1ec82b[_0x1de8('0x48')](_0x1de8('0xa7'));_0x1ec82b[_0x1de8('0x48')]('i.ContactId');_0x1ec82b[_0x1de8('0x48')](_0x1de8('0xa8'));_0x1ec82b[_0x1de8('0x48')](_0x1de8('0xa9'));_0x1ec82b[_0x1de8('0x48')](_0x1de8('0xaa'),'Contact.firstName');_0x1ec82b[_0x1de8('0x48')](_0x1de8('0xab'),_0x1de8('0xac'));_0x1ec82b[_0x1de8('0x48')](_0x1de8('0xad'),_0x1de8('0xae'));_0x1ec82b['field'](_0x1de8('0xaf'),_0x1de8('0xb0'));_0x1ec82b[_0x1de8('0x48')](_0x1de8('0xb1'),'Contact.mobile');_0x1ec82b[_0x1de8('0x48')](_0x1de8('0xb2'),_0x1de8('0xb3'));_0x1ec82b[_0x1de8('0x48')](_0x1de8('0xb4'),_0x1de8('0xb5'));_0x1ec82b[_0x1de8('0x48')](_0x1de8('0xb6'),_0x1de8('0xb7'));_0x1ec82b[_0x1de8('0x48')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x5c1c9a[_0x1de8('0x18')])_0x1ec82b[_0x1de8('0x18')](_0x5c1c9a['limit']);if(_0x5c1c9a[_0x1de8('0x19')])_0x1ec82b[_0x1de8('0x19')](_0x5c1c9a['offset']);return db['sequelize'][_0x1de8('0x3c')](_0x1ec82b[_0x1de8('0x99')](),_0x9e0bfe);})['then'](function(_0x45ba7b){if(_0x45ba7b['length']>0x0)_0x5236b5[_0x1de8('0x75')]('ui.MailInteractionId\x20IN\x20?',_[_0x1de8('0x22')](_0x45ba7b,'id'));return db[_0x1de8('0xb8')]['query'](_0x5236b5['toString'](),_0x9e0bfe)['then'](function(_0x29ab84){var _0xa15d6c=_[_0x1de8('0xb9')](_0x29ab84,_0x1de8('0xba'));var _0xa86f5a=[];return db['Setting'][_0x1de8('0x29')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0x1de8('0x1b')](function(_0x25efca){var _0x38184b=_0x25efca[_0x1de8('0xbb')];_0x45ba7b[_0x1de8('0x26')](function(_0x49e7b2){_0xa86f5a[_0x1de8('0x27')](updateMailInteraction(_0x49e7b2,_0x26db41,_0xa15d6c,_0x38184b));});return BPromise['all'](_0xa86f5a);});});});})[_0x1de8('0x1b')](function(_0x4714d1){_0xda3471[_0x1de8('0xbc')]=_0x4714d1;return _0xda3471;})[_0x1de8('0x1b')](respondWithFilteredResult(_0x5bb7e4,_0x5c1c9a))[_0x1de8('0x2f')](handleError(_0x5bb7e4,null));};exports[_0x1de8('0xbd')]=function(_0x3c3d05,_0x561a27){var _0x413150={'raw':![],'where':{'id':_0x3c3d05[_0x1de8('0xbe')]['id']}},_0x29ace0={};_0x29ace0[_0x1de8('0x3b')]=_['keys'](db[_0x1de8('0x9c')][_0x1de8('0x37')]);_0x29ace0['query']=_[_0x1de8('0x3d')](_0x3c3d05['query']);_0x29ace0['filters']=_[_0x1de8('0x3e')](_0x29ace0[_0x1de8('0x3b')],_0x29ace0[_0x1de8('0x3c')]);_0x413150[_0x1de8('0x40')]=_['intersection'](_0x29ace0['model'],qs[_0x1de8('0x3f')](_0x3c3d05[_0x1de8('0x3c')]['fields']));_0x413150['attributes']=_0x413150['attributes'][_0x1de8('0x41')]?_0x413150[_0x1de8('0x40')]:_0x29ace0[_0x1de8('0x3b')];if(_0x3c3d05[_0x1de8('0x3c')][_0x1de8('0xbf')]){_0x413150['include']=[{'all':!![]}];}_0x413150=_[_0x1de8('0x9b')]({},_0x413150,_0x3c3d05[_0x1de8('0xc0')]);return db[_0x1de8('0x9c')][_0x1de8('0x60')](_0x413150)[_0x1de8('0x1b')](handleEntityNotFound(_0x561a27,null))['then'](respondWithResult(_0x561a27,null))[_0x1de8('0x2f')](handleError(_0x561a27,null));};exports[_0x1de8('0xc1')]=function(_0x5b3064,_0x1130fa){return db[_0x1de8('0x9c')][_0x1de8('0xc1')](_0x5b3064[_0x1de8('0xc2')],{})[_0x1de8('0x1b')](respondWithResult(_0x1130fa,0xc9))[_0x1de8('0x2f')](handleError(_0x1130fa,null));};exports[_0x1de8('0x1a')]=function(_0x436488,_0xfd13f3){if(_0x436488['body']['id']){delete _0x436488['body']['id'];}return db[_0x1de8('0x9c')]['find']({'where':{'id':_0x436488[_0x1de8('0xbe')]['id']}})['then'](handleEntityNotFound(_0xfd13f3,null))[_0x1de8('0x1b')](saveUpdates(_0x436488[_0x1de8('0xc2')],null))[_0x1de8('0x1b')](respondWithResult(_0xfd13f3,null))[_0x1de8('0x2f')](handleError(_0xfd13f3,null));};exports[_0x1de8('0x1c')]=function(_0x2a3d35,_0x38ec75){return db[_0x1de8('0x9c')][_0x1de8('0x60')]({'where':{'id':_0x2a3d35[_0x1de8('0xbe')]['id']}})['then'](handleEntityNotFound(_0x38ec75,null))['then'](removeEntity(_0x38ec75,null))['catch'](handleError(_0x38ec75,null));};exports[_0x1de8('0xc3')]=function(_0x2929f2,_0x504184){return db[_0x1de8('0x9c')][_0x1de8('0xc3')]()[_0x1de8('0x1b')](respondWithResult(_0x504184,null))[_0x1de8('0x2f')](handleError(_0x504184,null));};exports['addMessage']=function(_0xc75661,_0x417024){return db[_0x1de8('0x28')]['find']({'where':{'id':_0xc75661[_0x1de8('0xbe')]['id']}})[_0x1de8('0x1b')](handleEntityNotFound(_0x417024,null))[_0x1de8('0x1b')](function(_0x587c36){if(_0x587c36){return _0x587c36[_0x1de8('0xc4')](_0xc75661[_0x1de8('0xc2')]['ids'],_['omit'](_0xc75661['body'],[_0x1de8('0xc5'),'id'])||{});}})[_0x1de8('0x1b')](respondWithResult(_0x417024,null))[_0x1de8('0x2f')](handleError(_0x417024,null));};exports[_0x1de8('0xc6')]=function(_0xf58c31,_0x327221){var _0x11c671={'raw':![],'where':{}};var _0x1cf9b4={};var _0xa8633e={'count':0x0,'rows':[]};return db[_0x1de8('0x9c')][_0x1de8('0x29')]({'where':{'id':_0xf58c31['params']['id']}})['then'](handleEntityNotFound(_0x327221,null))[_0x1de8('0x1b')](function(_0x5004fa){if(_0x5004fa){_0x1cf9b4[_0x1de8('0x3b')]=_[_0x1de8('0x3d')](db[_0x1de8('0x28')][_0x1de8('0x37')]);_0x1cf9b4[_0x1de8('0x3c')]=_[_0x1de8('0x3d')](_0xf58c31[_0x1de8('0x3c')]);_0x1cf9b4['filters']=_[_0x1de8('0x3e')](_0x1cf9b4[_0x1de8('0x3b')],_0x1cf9b4[_0x1de8('0x3c')]);_0x11c671[_0x1de8('0x40')]=_[_0x1de8('0x3e')](_0x1cf9b4['model'],qs['fields'](_0xf58c31[_0x1de8('0x3c')]['fields']));_0x11c671[_0x1de8('0x40')]=_0x11c671['attributes'][_0x1de8('0x41')]?_0x11c671[_0x1de8('0x40')]:_0x1cf9b4['model'];if(!_0xf58c31[_0x1de8('0x3c')][_0x1de8('0x42')]('nolimit')){_0x11c671['limit']=qs[_0x1de8('0x18')](_0xf58c31['query'][_0x1de8('0x18')]);_0x11c671[_0x1de8('0x19')]=qs['offset'](_0xf58c31[_0x1de8('0x3c')]['offset']);}_0x11c671[_0x1de8('0x44')]=qs[_0x1de8('0x45')](_0xf58c31[_0x1de8('0x3c')][_0x1de8('0x45')]);_0x11c671['where']=qs[_0x1de8('0x46')](_[_0x1de8('0x47')](_0xf58c31['query'],_0x1cf9b4[_0x1de8('0x46')]));_0x11c671[_0x1de8('0x75')][_0x1de8('0xba')]=_0x5004fa['id'];if(_0xf58c31[_0x1de8('0x3c')][_0x1de8('0xc7')]){_0x11c671[_0x1de8('0x75')]=_['merge'](_0x11c671[_0x1de8('0x75')],{'$or':_[_0x1de8('0x22')](_0x11c671[_0x1de8('0x40')],function(_0x76e628){var _0x14c581={};_0x14c581[_0x76e628]={'$like':'%'+_0xf58c31[_0x1de8('0x3c')][_0x1de8('0xc7')]+'%'};return _0x14c581;})});}if(_0xf58c31['query'][_0x1de8('0x7a')]){var _0x4ca8bc=_0xf58c31[_0x1de8('0x3c')][_0x1de8('0x7a')][_0x1de8('0x66')](',');var _0x517ade={};_0x517ade[_0x4ca8bc[0x0]]={'$gte':moment(_0x4ca8bc[0x1])[_0x1de8('0xc8')](_0x1de8('0xc9'))};_0x11c671[_0x1de8('0x75')]=_['merge'](_0x11c671[_0x1de8('0x75')],_0x517ade);}_0x11c671=_[_0x1de8('0x9b')]({},_0x11c671,_0xf58c31[_0x1de8('0xc0')]);return db[_0x1de8('0x28')]['count']({'where':_0x11c671[_0x1de8('0x75')]})[_0x1de8('0x1b')](function(_0x21805d){_0xa8633e[_0x1de8('0x98')]=_0x21805d;if(_0xf58c31[_0x1de8('0x3c')][_0x1de8('0xbf')]){_0x11c671[_0x1de8('0xca')]=[{'all':!![]}];}return db[_0x1de8('0x28')][_0x1de8('0xcb')](_0x11c671);})[_0x1de8('0x1b')](function(_0x247993){if(_0xf58c31[_0x1de8('0x3c')]['inlineCss']==='true'){for(var _0x5ed7c6=0x0;_0x5ed7c6<_0x247993[_0x1de8('0x41')];_0x5ed7c6++){_0x247993[_0x5ed7c6][_0x1de8('0xc2')]=juice(_0x247993[_0x5ed7c6][_0x1de8('0xc2')]);}}_0xa8633e[_0x1de8('0xbc')]=_0x247993;return _0xa8633e;});}})['then'](respondWithFilteredResult(_0x327221,_0x11c671))[_0x1de8('0x2f')](handleError(_0x327221,null));};exports['addTags']=function(_0x598814,_0x5254fa){return db[_0x1de8('0x9c')][_0x1de8('0x60')]({'where':{'id':_0x598814[_0x1de8('0xbe')]['id']}})['then'](handleEntityNotFound(_0x5254fa,null))[_0x1de8('0x1b')](function(_0x1ca40c){if(_0x1ca40c){return _0x1ca40c[_0x1de8('0xcc')](_0x598814[_0x1de8('0xc2')]['ids'],_['omit'](_0x598814['body'],[_0x1de8('0xc5'),'id'])||{})['spread'](function(){return db[_0x1de8('0x6c')][_0x1de8('0xcb')]({'attributes':['id',_0x1de8('0x1f'),_0x1de8('0x49')],'where':{'id':_0x598814['body'][_0x1de8('0xc5')]}});})[_0x1de8('0x1b')](function(_0x482399){socket[_0x1de8('0xcd')]('mailInteractionTags:save',{'id':Number(_0x598814['params']['id']),'tags':_0x482399||[]});return{'id':Number(_0x598814[_0x1de8('0xbe')]['id']),'tags':_0x482399||[]};});}})[_0x1de8('0x1b')](respondWithResult(_0x5254fa,null))['catch'](handleError(_0x5254fa,null));};exports[_0x1de8('0xce')]=function(_0x1765f8,_0xa61cb){return db[_0x1de8('0x9c')][_0x1de8('0x60')]({'where':{'id':_0x1765f8[_0x1de8('0xbe')]['id']}})[_0x1de8('0x1b')](handleEntityNotFound(_0xa61cb,null))[_0x1de8('0x1b')](function(_0x4d02e6){if(_0x4d02e6){return _0x4d02e6[_0x1de8('0xce')](_0x1765f8[_0x1de8('0x3c')][_0x1de8('0xc5')]);}})['then'](respondWithStatusCode(_0xa61cb,null))[_0x1de8('0x2f')](handleError(_0xa61cb,null));};exports[_0x1de8('0xcf')]=function(_0x439a60,_0x155244){var _0x2000d3=moment()[_0x1de8('0xd0')]()[_0x1de8('0x99')]();var _0x50d610=path[_0x1de8('0xd1')](config[_0x1de8('0xd2')],_0x1de8('0xd3'),'files',_0x1de8('0xd4'));var _0x465a60=path[_0x1de8('0xd1')](config[_0x1de8('0xd2')],_0x1de8('0xd3'),_0x1de8('0xd5'),_0x1de8('0xd6'));var _0x3790d9=path['join'](_0x50d610,_0x2000d3);var _0x312d36=util[_0x1de8('0xc8')](_0x1de8('0xd7'),_0x439a60[_0x1de8('0xbe')]['id'],_0x2000d3);var _0x55308c=path['join'](_0x50d610,_0x312d36);var _0x55c84a=[];if(_0x439a60[_0x1de8('0x3c')][_0x1de8('0xd6')]){_0x55c84a[_0x1de8('0x27')]({'model':db[_0x1de8('0xd8')],'as':_0x1de8('0xd9'),'raw':!![]});}var _0x543e69=[{'model':db[_0x1de8('0x28')],'as':_0x1de8('0xda'),'attributes':['id','body',_0x1de8('0x4a'),'to','cc',_0x1de8('0xdb'),'subject','createdAt'],'where':{'secret':![]},'order':qs[_0x1de8('0x45')]('id'),'include':_0x55c84a}];return db[_0x1de8('0x9c')]['find']({'where':{'id':_0x439a60[_0x1de8('0xbe')]['id']},'include':_0x543e69})[_0x1de8('0x1b')](handleEntityNotFound(_0x155244,null))[_0x1de8('0x1b')](function(_0x159aab){if(_0x159aab&&_0x159aab['Messages']){var _0x2f8cd1=_0x159aab[_0x1de8('0xdc')]({'plain':!![]});fs['mkdirSync'](_0x3790d9);return BPromise[_0x1de8('0xdd')](_0x2f8cd1['Messages'],function(_0x638239,_0x27aa57){var _0x185abe={'from':_0x638239[_0x1de8('0x4a')],'to':_0x638239['to'],'subject':_0x638239[_0x1de8('0xde')],'html':htmlEntities[_0x1de8('0xdf')](_0x638239[_0x1de8('0xc2')]),'headers':{'Date':moment(_0x638239[_0x1de8('0x78')])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x638239['cc']){_0x185abe[_0x1de8('0xe0')]['Cc']=_0x638239['cc'];}if(_0x638239[_0x1de8('0xdb')]){_0x185abe['headers'][_0x1de8('0xe1')]=_0x638239[_0x1de8('0xdb')];}return new BPromise(function(_0x22508a,_0x503195){if(_0x638239[_0x1de8('0xd9')]){for(var _0x503b1d=0x0;_0x503b1d<_0x638239[_0x1de8('0xd9')][_0x1de8('0x41')];_0x503b1d++){var _0x4f5f61=_0x638239[_0x1de8('0xd9')][_0x503b1d];var _0x575a9c=path[_0x1de8('0xd1')](_0x465a60,_0x4f5f61[_0x1de8('0xe2')]);if(fs[_0x1de8('0xe3')](_0x575a9c)){_0x185abe[_0x1de8('0xd6')]['push']({'name':_0x4f5f61[_0x1de8('0x1f')],'contentType':_0x4f5f61[_0x1de8('0x39')],'data':fs[_0x1de8('0xe4')](_0x575a9c)});}}}emlformat[_0x1de8('0xe5')](_0x185abe,function(_0x29c094,_0x1e9691){if(_0x29c094)return _0x503195(_0x29c094);fs[_0x1de8('0xe6')](path[_0x1de8('0xd1')](_0x3790d9,util[_0x1de8('0xc8')]('message%d.eml',_0x27aa57)),_0x1e9691);return _0x22508a(_0x1e9691);});});})['then'](function(){return new BPromise(function(_0xe9d119,_0x5e7661){zipdir(_0x3790d9,{'saveTo':_0x55308c},function(_0x2c2f30,_0x41fd75){if(_0x2c2f30)return _0x5e7661(_0x2c2f30);return _0xe9d119(_0x41fd75);});})[_0x1de8('0x1b')](function(){return new BPromise(function(_0x18b2ac,_0x2b9bd1){rimraf(_0x3790d9,function(_0x5f5714){if(_0x5f5714)_0x2b9bd1(_0x5f5714);return _0x18b2ac();});});})[_0x1de8('0x1b')](function(){return _0x155244[_0x1de8('0xcf')](_0x55308c,_0x312d36,function(_0x32f969){if(!_0x32f969)fs[_0x1de8('0xe7')](_0x55308c);});});});}else{return _0x155244[_0x1de8('0x13')](0xc8);}})[_0x1de8('0x2f')](handleError(_0x155244,null));};
\ No newline at end of file
index 23264e3..0581400 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7785=['emit','catch','hasOwnProperty','hook','exports','../../mysqldb','MailMessage','update','getUsers','Users','map','findAll','then','setDataValue','length'];(function(_0x565f03,_0x2fe31f){var _0x5c7449=function(_0x5a736a){while(--_0x5a736a){_0x565f03['push'](_0x565f03['shift']());}};_0x5c7449(++_0x2fe31f);}(_0x7785,0x14f));var _0x5778=function(_0x2c04f6,_0x1f47dd){_0x2c04f6=_0x2c04f6-0x0;var _0x3796b0=_0x7785[_0x2c04f6];return _0x3796b0;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0x5778('0x0'))['db']['MailInteraction'];var MailMessage=require(_0x5778('0x0'))['db'][_0x5778('0x1')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5778('0x2'),'afterDestroy':'remove'};function emitEvent(_0x2d3099){return function(_0x1cc4fc,_0x2684a4,_0x4e73fd){_0x1cc4fc[_0x5778('0x3')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3ae7a0){_0x1cc4fc['setDataValue'](_0x5778('0x4'),_0x3ae7a0[_0x5778('0x5')](function(_0x52d567){return{'id':_0x52d567['id']};}));return MailMessage[_0x5778('0x6')]({'where':{'MailInteractionId':_0x1cc4fc['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5778('0x7')](function(_0x198507){_0x1cc4fc[_0x5778('0x8')]('unreadMessages',_0x198507[_0x5778('0x9')]);MailInteractionEvents[_0x5778('0xa')](_0x2d3099+':'+_0x1cc4fc['id'],_0x1cc4fc);MailInteractionEvents[_0x5778('0xa')](_0x2d3099,_0x1cc4fc);_0x4e73fd(null);})[_0x5778('0xb')](_0x4e73fd(null));};}for(var e in events){if(events[_0x5778('0xc')](e)){var event=events[e];MailInteraction[_0x5778('0xd')](e,emitEvent(event));}}module[_0x5778('0xe')]=MailInteractionEvents;
\ No newline at end of file
+var _0xe0bc=['exports','events','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','getUsers','Users','setDataValue','unreadMessages','length','catch','hasOwnProperty','hook'];(function(_0x453f28,_0x56a40b){var _0x272afc=function(_0x404210){while(--_0x404210){_0x453f28['push'](_0x453f28['shift']());}};_0x272afc(++_0x56a40b);}(_0xe0bc,0x1a1));var _0xce0b=function(_0x1e3303,_0x20e072){_0x1e3303=_0x1e3303-0x0;var _0x2c88dc=_0xe0bc[_0x1e3303];return _0x2c88dc;};'use strict';var EventEmitter=require(_0xce0b('0x0'));var MailInteraction=require(_0xce0b('0x1'))['db']['MailInteraction'];var MailMessage=require(_0xce0b('0x1'))['db'][_0xce0b('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xce0b('0x3')](0x0);var events={'afterCreate':_0xce0b('0x4'),'afterUpdate':_0xce0b('0x5'),'afterDestroy':_0xce0b('0x6')};function emitEvent(_0x18eeae){return function(_0x473862,_0x3ba882,_0x277934){_0x473862[_0xce0b('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3e747b){_0x473862['setDataValue'](_0xce0b('0x8'),_0x3e747b['map'](function(_0x36edf2){return{'id':_0x36edf2['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x473862['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2a1c95){_0x473862[_0xce0b('0x9')](_0xce0b('0xa'),_0x2a1c95[_0xce0b('0xb')]);MailInteractionEvents['emit'](_0x18eeae+':'+_0x473862['id'],_0x473862);MailInteractionEvents['emit'](_0x18eeae,_0x473862);_0x277934(null);})[_0xce0b('0xc')](_0x277934(null));};}for(var e in events){if(events[_0xce0b('0xd')](e)){var event=events[e];MailInteraction[_0xce0b('0xe')](e,emitEvent(event));}}module[_0xce0b('0xf')]=MailInteractionEvents;
\ No newline at end of file
index 1825e10..5c7396c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96b8=['rimraf','../../config/environment','define','fti_mail_interactions','subject','substatus','format','YYYY-MM-DD\x20HH:mm:ss','closedAt','changed','substatusAt','get','closed','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x1ee367,_0x2e5568){var _0x5b51bc=function(_0x549622){while(--_0x549622){_0x1ee367['push'](_0x1ee367['shift']());}};_0x5b51bc(++_0x2e5568);}(_0x96b8,0x1cd));var _0x896b=function(_0x41a60b,_0xc398d){_0x41a60b=_0x41a60b-0x0;var _0x10c95a=_0x96b8[_0x41a60b];return _0x10c95a;};'use strict';var _=require(_0x896b('0x0'));var util=require(_0x896b('0x1'));var logger=require('../../config/logger')(_0x896b('0x2'));var moment=require(_0x896b('0x3'));var BPromise=require(_0x896b('0x4'));var rp=require(_0x896b('0x5'));var fs=require('fs');var path=require(_0x896b('0x6'));var rimraf=require(_0x896b('0x7'));var config=require(_0x896b('0x8'));var attributes=require('./mailInteraction.attributes');module['exports']=function(_0x53f445,_0x10de3d){return _0x53f445[_0x896b('0x9')]('MailInteraction',attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x896b('0xa'),'fields':[_0x896b('0xb'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x47834e,_0x124c07,_0x575999){if(_0x47834e[_0x896b('0xc')]){_0x47834e['substatusAt']=moment()[_0x896b('0xd')](_0x896b('0xe'));}if(_0x47834e['closed']){_0x47834e[_0x896b('0xf')]=moment()[_0x896b('0xd')](_0x896b('0xe'));}_0x575999(null,_0x124c07);},'beforeUpdate':function(_0x149b41,_0x1c79c9,_0x412eea){if(_0x149b41[_0x896b('0x10')]('substatus')){_0x149b41['substatusAt']=_0x149b41['substatus']?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x149b41[_0x896b('0x10')]('closed')){_0x149b41[_0x896b('0xf')]=moment()['format'](_0x896b('0xe'));_0x149b41[_0x896b('0xc')]=null;_0x149b41[_0x896b('0x11')]=null;}_0x412eea(null,_0x149b41);},'afterUpdate':function(_0x20f41b,_0x1520dd,_0x342b6d){var _0x7052a7=_0x53f445['models'];var _0x3dcc6a=_0x20f41b[_0x896b('0x12')]({'plain':!![]});if(_0x3dcc6a[_0x896b('0x13')]){return _0x7052a7[_0x896b('0x14')][_0x896b('0x15')]({'read':!![]},{'where':{'MailInteractionId':_0x3dcc6a['id']}})[_0x896b('0x16')](function(){_0x342b6d();})[_0x896b('0x17')](function(_0x4bf7d6){_0x342b6d(_0x4bf7d6);});}else{_0x342b6d();}}},'charset':_0x896b('0x18'),'collate':_0x896b('0x19')});};
\ No newline at end of file
+var _0x824a=['api','moment','bluebird','request-promise','path','rimraf','./mailInteraction.attributes','define','fti_mail_interactions','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','substatus','get','MailMessage','then','catch','utf8mb4','lodash','util','../../config/logger'];(function(_0x5f4aeb,_0x21a84c){var _0x513c19=function(_0x12fe38){while(--_0x12fe38){_0x5f4aeb['push'](_0x5f4aeb['shift']());}};_0x513c19(++_0x21a84c);}(_0x824a,0x135));var _0xa824=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x824a[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xa824('0x0'));var util=require(_0xa824('0x1'));var logger=require(_0xa824('0x2'))(_0xa824('0x3'));var moment=require(_0xa824('0x4'));var BPromise=require(_0xa824('0x5'));var rp=require(_0xa824('0x6'));var fs=require('fs');var path=require(_0xa824('0x7'));var rimraf=require(_0xa824('0x8'));var config=require('../../config/environment');var attributes=require(_0xa824('0x9'));module['exports']=function(_0x308e04,_0x54d7c5){return _0x308e04[_0xa824('0xa')]('MailInteraction',attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0xa824('0xb'),'fields':['subject','to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4b9f63,_0x41b4bc,_0x22dda0){if(_0x4b9f63['substatus']){_0x4b9f63[_0xa824('0xc')]=moment()[_0xa824('0xd')](_0xa824('0xe'));}if(_0x4b9f63[_0xa824('0xf')]){_0x4b9f63[_0xa824('0x10')]=moment()[_0xa824('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x22dda0(null,_0x41b4bc);},'beforeUpdate':function(_0x2ee6e0,_0x4af28e,_0x43bf06){if(_0x2ee6e0[_0xa824('0x11')](_0xa824('0x12'))){_0x2ee6e0[_0xa824('0xc')]=_0x2ee6e0[_0xa824('0x12')]?moment()[_0xa824('0xd')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x2ee6e0[_0xa824('0x11')](_0xa824('0xf'))){_0x2ee6e0['closedAt']=moment()[_0xa824('0xd')]('YYYY-MM-DD\x20HH:mm:ss');_0x2ee6e0['substatus']=null;_0x2ee6e0[_0xa824('0xc')]=null;}_0x43bf06(null,_0x2ee6e0);},'afterUpdate':function(_0x129abc,_0x40ab1e,_0x21cda4){var _0x385dc7=_0x308e04['models'];var _0x5f5662=_0x129abc[_0xa824('0x13')]({'plain':!![]});if(_0x5f5662[_0xa824('0xf')]){return _0x385dc7[_0xa824('0x14')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x5f5662['id']}})[_0xa824('0x15')](function(){_0x21cda4();})[_0xa824('0x16')](function(_0x4c3cd8){_0x21cda4(_0x4c3cd8);});}else{_0x21cda4();}}},'charset':_0xa824('0x17'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index d982db0..0da0e5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21cd=['catch','AddTagsToMailInteraction','find','addTags','ids','spread','AddTags','lodash','util','bluebird','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','UpdateMailInteraction','update','body','options','raw','where','attributes','limit'];(function(_0x34bf69,_0x35fa1b){var _0x5a9276=function(_0x5a5415){while(--_0x5a5415){_0x34bf69['push'](_0x34bf69['shift']());}};_0x5a9276(++_0x35fa1b);}(_0x21cd,0x14b));var _0xd21c=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x21cd[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xd21c('0x0'));var util=require(_0xd21c('0x1'));var moment=require('moment');var BPromise=require(_0xd21c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd21c('0x3'));var config=require('../../config/environment');var jayson=require(_0xd21c('0x4'));var client=jayson['client'][_0xd21c('0x5')]({'port':0x232a});config[_0xd21c('0x6')]=_[_0xd21c('0x7')](config[_0xd21c('0x6')],{'host':_0xd21c('0x8'),'port':0x18eb});var socket=require(_0xd21c('0x9'))(new Redis(config['redis']));require(_0xd21c('0xa'))['register'](socket);function respondWithRpcPromise(_0x2f2e4a,_0x53e579,_0x43d4b5){return new BPromise(function(_0x8774e2,_0x2495b5){return client[_0xd21c('0xb')](_0x2f2e4a,_0x43d4b5)[_0xd21c('0xc')](function(_0x37f384){logger[_0xd21c('0xd')](_0xd21c('0xe'),_0x53e579,_0xd21c('0xf'));logger[_0xd21c('0x10')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x53e579,'request\x20sent',JSON[_0xd21c('0x11')](_0x37f384));if(_0x37f384['error']){if(_0x37f384[_0xd21c('0x12')][_0xd21c('0x13')]===0x1f4){logger[_0xd21c('0x12')](_0xd21c('0xe'),_0x53e579,_0x37f384[_0xd21c('0x12')]['message']);return _0x2495b5(_0x37f384['error'][_0xd21c('0x14')]);}logger[_0xd21c('0x12')](_0xd21c('0xe'),_0x53e579,_0x37f384[_0xd21c('0x12')][_0xd21c('0x14')]);return _0x8774e2(_0x37f384[_0xd21c('0x12')]['message']);}else{logger[_0xd21c('0xd')](_0xd21c('0xe'),_0x53e579,_0xd21c('0xf'));_0x8774e2(_0x37f384['result'][_0xd21c('0x14')]);}})['catch'](function(_0x145196){logger[_0xd21c('0x12')](_0xd21c('0xe'),_0x53e579,_0x145196);_0x2495b5(_0x145196);});});}exports[_0xd21c('0x15')]=function(_0x4e9f2f){var _0x4e1f5b=this;return new Promise(function(_0x240e4a,_0x7229f1){return db['MailInteraction'][_0xd21c('0x16')](_0x4e9f2f[_0xd21c('0x17')],{'raw':_0x4e9f2f[_0xd21c('0x18')]?_0x4e9f2f[_0xd21c('0x18')][_0xd21c('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e9f2f[_0xd21c('0x18')]?_0x4e9f2f['options'][_0xd21c('0x1a')]||null:null,'attributes':_0x4e9f2f[_0xd21c('0x18')]?_0x4e9f2f[_0xd21c('0x18')][_0xd21c('0x1b')]||null:null,'limit':_0x4e9f2f[_0xd21c('0x18')]?_0x4e9f2f[_0xd21c('0x18')][_0xd21c('0x1c')]||null:null})[_0xd21c('0xc')](function(_0x899091){logger[_0xd21c('0xd')](_0xd21c('0x15'),_0x4e9f2f);logger[_0xd21c('0x10')]('UpdateMailInteraction',_0x4e9f2f,JSON[_0xd21c('0x11')](_0x899091));_0x240e4a(_0x899091);})[_0xd21c('0x1d')](function(_0x1a6d2e){logger['error'](_0xd21c('0x15'),_0x1a6d2e['message'],_0x4e9f2f);_0x7229f1(_0x4e1f5b[_0xd21c('0x12')](0x1f4,_0x1a6d2e['message']));});});};exports[_0xd21c('0x1e')]=function(_0x2c7094){return new Promise(function(_0x14daaa,_0x402ff0){return db['MailInteraction'][_0xd21c('0x1f')]({'where':_0x2c7094[_0xd21c('0x18')]?_0x2c7094[_0xd21c('0x18')][_0xd21c('0x1a')]||null:null})['then'](function(_0x429f36){if(_0x429f36){return _0x429f36[_0xd21c('0x20')](_0x2c7094[_0xd21c('0x17')][_0xd21c('0x21')],_['omit'](_0x2c7094['body'],[_0xd21c('0x21'),'id'])||{});}})[_0xd21c('0x22')](function(_0x46b26){logger[_0xd21c('0xd')](_0xd21c('0x23'),_0x2c7094);logger['debug']('AddTags',_0x2c7094,JSON['stringify'](_0x46b26));_0x14daaa(_0x46b26);})[_0xd21c('0x1d')](function(_0x28cfbc){logger[_0xd21c('0x12')](_0xd21c('0x23'),_0x28cfbc['message'],_0x2c7094);_0x402ff0(_this['error'](0x1f4,_0x28cfbc[_0xd21c('0x14')]));});});};
\ No newline at end of file
+var _0x6863=['body','options','raw','where','attributes','UpdateMailInteraction','find','addTags','ids','omit','AddTags','stringify','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','error','code','MailInteraction,\x20%s,\x20%s','message','info','result','catch','MailInteraction','update'];(function(_0x4932c9,_0x507ae3){var _0x4b5a04=function(_0x488ab4){while(--_0x488ab4){_0x4932c9['push'](_0x4932c9['shift']());}};_0x4b5a04(++_0x507ae3);}(_0x6863,0xd9));var _0x3686=function(_0x46d232,_0x5ac7e5){_0x46d232=_0x46d232-0x0;var _0x52da0f=_0x6863[_0x46d232];return _0x52da0f;};'use strict';var _=require(_0x3686('0x0'));var util=require(_0x3686('0x1'));var moment=require(_0x3686('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3686('0x3'));var db=require(_0x3686('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3686('0x5'))('rpc');var config=require(_0x3686('0x6'));var jayson=require(_0x3686('0x7'));var client=jayson[_0x3686('0x8')]['http']({'port':0x232a});config[_0x3686('0x9')]=_[_0x3686('0xa')](config['redis'],{'host':_0x3686('0xb'),'port':0x18eb});var socket=require(_0x3686('0xc'))(new Redis(config['redis']));require(_0x3686('0xd'))[_0x3686('0xe')](socket);function respondWithRpcPromise(_0x2e2c44,_0x4b439b,_0x354bea){return new BPromise(function(_0x1115b8,_0x2022ad){return client[_0x3686('0xf')](_0x2e2c44,_0x354bea)[_0x3686('0x10')](function(_0x85895b){logger['info']('MailInteraction,\x20%s,\x20%s',_0x4b439b,_0x3686('0x11'));logger[_0x3686('0x12')](_0x3686('0x13'),_0x4b439b,_0x3686('0x11'),JSON['stringify'](_0x85895b));if(_0x85895b[_0x3686('0x14')]){if(_0x85895b[_0x3686('0x14')][_0x3686('0x15')]===0x1f4){logger['error'](_0x3686('0x16'),_0x4b439b,_0x85895b[_0x3686('0x14')][_0x3686('0x17')]);return _0x2022ad(_0x85895b[_0x3686('0x14')][_0x3686('0x17')]);}logger[_0x3686('0x14')]('MailInteraction,\x20%s,\x20%s',_0x4b439b,_0x85895b['error'][_0x3686('0x17')]);return _0x1115b8(_0x85895b[_0x3686('0x14')][_0x3686('0x17')]);}else{logger[_0x3686('0x18')](_0x3686('0x16'),_0x4b439b,_0x3686('0x11'));_0x1115b8(_0x85895b[_0x3686('0x19')][_0x3686('0x17')]);}})[_0x3686('0x1a')](function(_0x11218d){logger['error'](_0x3686('0x16'),_0x4b439b,_0x11218d);_0x2022ad(_0x11218d);});});}exports['UpdateMailInteraction']=function(_0x54bd61){var _0x2395aa=this;return new Promise(function(_0x8b57e5,_0x29b76c){return db[_0x3686('0x1b')][_0x3686('0x1c')](_0x54bd61[_0x3686('0x1d')],{'raw':_0x54bd61[_0x3686('0x1e')]?_0x54bd61['options'][_0x3686('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54bd61[_0x3686('0x1e')]?_0x54bd61[_0x3686('0x1e')][_0x3686('0x20')]||null:null,'attributes':_0x54bd61[_0x3686('0x1e')]?_0x54bd61['options'][_0x3686('0x21')]||null:null,'limit':_0x54bd61[_0x3686('0x1e')]?_0x54bd61[_0x3686('0x1e')]['limit']||null:null})[_0x3686('0x10')](function(_0x12d235){logger['info']('UpdateMailInteraction',_0x54bd61);logger[_0x3686('0x12')]('UpdateMailInteraction',_0x54bd61,JSON['stringify'](_0x12d235));_0x8b57e5(_0x12d235);})[_0x3686('0x1a')](function(_0x27e932){logger[_0x3686('0x14')](_0x3686('0x22'),_0x27e932['message'],_0x54bd61);_0x29b76c(_0x2395aa[_0x3686('0x14')](0x1f4,_0x27e932['message']));});});};exports['AddTagsToMailInteraction']=function(_0x270ebb){return new Promise(function(_0x461031,_0x56896e){return db[_0x3686('0x1b')][_0x3686('0x23')]({'where':_0x270ebb[_0x3686('0x1e')]?_0x270ebb[_0x3686('0x1e')][_0x3686('0x20')]||null:null})[_0x3686('0x10')](function(_0x3d2896){if(_0x3d2896){return _0x3d2896[_0x3686('0x24')](_0x270ebb[_0x3686('0x1d')][_0x3686('0x25')],_[_0x3686('0x26')](_0x270ebb['body'],['ids','id'])||{});}})['spread'](function(_0x8fd570){logger[_0x3686('0x18')](_0x3686('0x27'),_0x270ebb);logger[_0x3686('0x12')]('AddTags',_0x270ebb,JSON[_0x3686('0x28')](_0x8fd570));_0x461031(_0x8fd570);})[_0x3686('0x1a')](function(_0x1638af){logger[_0x3686('0x14')](_0x3686('0x27'),_0x1638af['message'],_0x270ebb);_0x56896e(_this[_0x3686('0x14')](0x1f4,_0x1638af['message']));});});};
\ No newline at end of file
index bd29ff2..630cf84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50cc=['mailInteraction:','./mailInteraction.events','save','remove','update','register','length'];(function(_0x1000e0,_0xf65827){var _0x4ed2ef=function(_0x3e4f49){while(--_0x3e4f49){_0x1000e0['push'](_0x1000e0['shift']());}};_0x4ed2ef(++_0xf65827);}(_0x50cc,0x135));var _0xc50c=function(_0x5e39cd,_0x437856){_0x5e39cd=_0x5e39cd-0x0;var _0x10bd68=_0x50cc[_0x5e39cd];return _0x10bd68;};'use strict';var MailInteractionEvents=require(_0xc50c('0x0'));var events=[_0xc50c('0x1'),_0xc50c('0x2'),_0xc50c('0x3')];function createListener(_0x5e111d,_0xfc4820){return function(_0xc4f70b){_0xfc4820['emit'](_0x5e111d,_0xc4f70b);};}function removeListener(_0x1ef729,_0x21fa28){return function(){MailInteractionEvents['removeListener'](_0x1ef729,_0x21fa28);};}exports[_0xc50c('0x4')]=function(_0x26131a){for(var _0x2f3c1d=0x0,_0x24dca7=events[_0xc50c('0x5')];_0x2f3c1d<_0x24dca7;_0x2f3c1d++){var _0x366144=events[_0x2f3c1d];var _0x4ad576=createListener(_0xc50c('0x6')+_0x366144,_0x26131a);MailInteractionEvents['on'](_0x366144,_0x4ad576);}};
\ No newline at end of file
+var _0x39d4=['removeListener','register','length','mailInteraction:','./mailInteraction.events','save','remove','update','emit'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x39d4,0x1cf));var _0x439d=function(_0x31a3bc,_0x3c63b7){_0x31a3bc=_0x31a3bc-0x0;var _0xa1d6b2=_0x39d4[_0x31a3bc];return _0xa1d6b2;};'use strict';var MailInteractionEvents=require(_0x439d('0x0'));var events=[_0x439d('0x1'),_0x439d('0x2'),_0x439d('0x3')];function createListener(_0x909801,_0x416c28){return function(_0x2ee518){_0x416c28[_0x439d('0x4')](_0x909801,_0x2ee518);};}function removeListener(_0x1fd8ae,_0x43129a){return function(){MailInteractionEvents[_0x439d('0x5')](_0x1fd8ae,_0x43129a);};}exports[_0x439d('0x6')]=function(_0x3cf34a){for(var _0x3030ee=0x0,_0xbfae0d=events[_0x439d('0x7')];_0x3030ee<_0xbfae0d;_0x3030ee++){var _0x1df1d1=events[_0x3030ee];var _0x5762b0=createListener(_0x439d('0x8')+_0x1df1d1,_0x3cf34a);MailInteractionEvents['on'](_0x1df1d1,_0x5762b0);}};
\ No newline at end of file
index d0c7ad1..6bdbc70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21a3=['index','/describe','describe','/:id','show','/:id/download','download','post','tracked','mail','put','update','accept','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./mailMessage.controller','get','isAuthenticated'];(function(_0x3aa97b,_0x56af66){var _0x36857f=function(_0x54e91d){while(--_0x54e91d){_0x3aa97b['push'](_0x3aa97b['shift']());}};_0x36857f(++_0x56af66);}(_0x21a3,0x66));var _0x321a=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x21a3[_0x209941];return _0x1e8729;};'use strict';var multer=require(_0x321a('0x0'));var util=require('util');var path=require(_0x321a('0x1'));var timeout=require(_0x321a('0x2'));var express=require(_0x321a('0x3'));var router=express[_0x321a('0x4')]();var fs_extra=require(_0x321a('0x5'));var auth=require(_0x321a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x321a('0x7'));router[_0x321a('0x8')]('/',auth[_0x321a('0x9')](),controller[_0x321a('0xa')]);router['get'](_0x321a('0xb'),auth[_0x321a('0x9')](),controller[_0x321a('0xc')]);router[_0x321a('0x8')](_0x321a('0xd'),auth[_0x321a('0x9')](),controller[_0x321a('0xe')]);router[_0x321a('0x8')](_0x321a('0xf'),auth[_0x321a('0x9')](),controller[_0x321a('0x10')]);router[_0x321a('0x11')]('/',auth['isAuthenticated'](),interaction[_0x321a('0x12')](_0x321a('0x13'),'mailmessage:create'),controller['create']);router[_0x321a('0x14')]('/:id',auth[_0x321a('0x9')](),controller[_0x321a('0x15')]);router['put']('/:id/accept',auth[_0x321a('0x9')](),controller[_0x321a('0x16')]);router[_0x321a('0x14')](_0x321a('0x17'),auth[_0x321a('0x9')](),controller[_0x321a('0x18')]);router[_0x321a('0x19')](_0x321a('0xd'),auth['isAuthenticated'](),controller[_0x321a('0x1a')]);module[_0x321a('0x1b')]=router;
\ No newline at end of file
+var _0xeda0=['put','update','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','tracked','mail','mailmessage:create','create'];(function(_0x14fed9,_0x5861bd){var _0x5ed498=function(_0x27efab){while(--_0x27efab){_0x14fed9['push'](_0x14fed9['shift']());}};_0x5ed498(++_0x5861bd);}(_0xeda0,0x1d8));var _0x0eda=function(_0x270a52,_0x455c70){_0x270a52=_0x270a52-0x0;var _0x44b21b=_0xeda0[_0x270a52];return _0x44b21b;};'use strict';var multer=require(_0x0eda('0x0'));var util=require(_0x0eda('0x1'));var path=require(_0x0eda('0x2'));var timeout=require('connect-timeout');var express=require(_0x0eda('0x3'));var router=express[_0x0eda('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0eda('0x5'));var config=require(_0x0eda('0x6'));var controller=require('./mailMessage.controller');router[_0x0eda('0x7')]('/',auth[_0x0eda('0x8')](),controller[_0x0eda('0x9')]);router[_0x0eda('0x7')](_0x0eda('0xa'),auth[_0x0eda('0x8')](),controller[_0x0eda('0xb')]);router[_0x0eda('0x7')](_0x0eda('0xc'),auth['isAuthenticated'](),controller[_0x0eda('0xd')]);router[_0x0eda('0x7')](_0x0eda('0xe'),auth[_0x0eda('0x8')](),controller[_0x0eda('0xf')]);router[_0x0eda('0x10')]('/',auth['isAuthenticated'](),interaction[_0x0eda('0x11')](_0x0eda('0x12'),_0x0eda('0x13')),controller[_0x0eda('0x14')]);router[_0x0eda('0x15')](_0x0eda('0xc'),auth['isAuthenticated'](),controller[_0x0eda('0x16')]);router[_0x0eda('0x15')]('/:id/accept',auth['isAuthenticated'](),controller[_0x0eda('0x17')]);router[_0x0eda('0x15')](_0x0eda('0x18'),auth[_0x0eda('0x8')](),controller[_0x0eda('0x19')]);router[_0x0eda('0x1a')](_0x0eda('0xc'),auth[_0x0eda('0x8')](),controller[_0x0eda('0x1b')]);module[_0x0eda('0x1c')]=router;
\ No newline at end of file
index d4b048c..d604e1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9267=['ENUM','out','STRING','DATE','INTEGER','Email','Chat','sequelize','lodash','exports','long','TEXT','medium','BOOLEAN'];(function(_0x5dc2f7,_0x498acb){var _0x376b5b=function(_0x1c82ba){while(--_0x1c82ba){_0x5dc2f7['push'](_0x5dc2f7['shift']());}};_0x376b5b(++_0x498acb);}(_0x9267,0x11f));var _0x7926=function(_0x5ef11e,_0x370ae2){_0x5ef11e=_0x5ef11e-0x0;var _0x4ca2c6=_0x9267[_0x5ef11e];return _0x4ca2c6;};'use strict';var Sequelize=require(_0x7926('0x0'));var _=require(_0x7926('0x1'));module[_0x7926('0x2')]={'body':{'type':Sequelize['TEXT'](_0x7926('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x7926('0x4')](_0x7926('0x5'))},'read':{'type':Sequelize[_0x7926('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7926('0x7')]('in',_0x7926('0x8')),'defaultValue':_0x7926('0x8'),'allowNull':![]},'messageId':{'type':Sequelize[_0x7926('0x9')](0x1fe)},'from':{'type':Sequelize[_0x7926('0x9')]},'to':{'type':Sequelize[_0x7926('0x4')]('long')},'cc':{'type':Sequelize[_0x7926('0x4')](_0x7926('0x3'))},'bcc':{'type':Sequelize[_0x7926('0x4')](_0x7926('0x3'))},'subject':{'type':Sequelize[_0x7926('0x4')]},'sentAt':{'type':Sequelize[_0x7926('0xa')]},'attach':{'type':Sequelize[_0x7926('0xb')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x7926('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x7926('0xa')]},'originTo':{'type':Sequelize[_0x7926('0x4')](_0x7926('0x3'))},'originCc':{'type':Sequelize[_0x7926('0x4')](_0x7926('0x3'))},'originChannel':{'type':Sequelize[_0x7926('0x7')](_0x7926('0xc'),_0x7926('0xd')),'defaultValue':_0x7926('0xc'),'allowNull':![]}};
\ No newline at end of file
+var _0x33af=['DATE','ENUM','Email','Chat','sequelize','lodash','exports','TEXT','long','BOOLEAN','out','STRING'];(function(_0x1bd82b,_0x15afa0){var _0x74c1de=function(_0x582ebd){while(--_0x582ebd){_0x1bd82b['push'](_0x1bd82b['shift']());}};_0x74c1de(++_0x15afa0);}(_0x33af,0x184));var _0xf33a=function(_0x2d2ccc,_0x30f2fe){_0x2d2ccc=_0x2d2ccc-0x0;var _0x54dc55=_0x33af[_0x2d2ccc];return _0x54dc55;};'use strict';var Sequelize=require(_0xf33a('0x0'));var _=require(_0xf33a('0x1'));module[_0xf33a('0x2')]={'body':{'type':Sequelize[_0xf33a('0x3')](_0xf33a('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium')},'read':{'type':Sequelize[_0xf33a('0x5')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xf33a('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xf33a('0x7')](0x1fe)},'from':{'type':Sequelize[_0xf33a('0x7')]},'to':{'type':Sequelize[_0xf33a('0x3')](_0xf33a('0x4'))},'cc':{'type':Sequelize[_0xf33a('0x3')](_0xf33a('0x4'))},'bcc':{'type':Sequelize[_0xf33a('0x3')](_0xf33a('0x4'))},'subject':{'type':Sequelize[_0xf33a('0x3')]},'sentAt':{'type':Sequelize[_0xf33a('0x8')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0xf33a('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0xf33a('0x3')](_0xf33a('0x4'))},'originCc':{'type':Sequelize[_0xf33a('0x3')]('long')},'originChannel':{'type':Sequelize[_0xf33a('0x9')](_0xf33a('0xa'),_0xf33a('0xb')),'defaultValue':_0xf33a('0xa'),'allowNull':![]}};
\ No newline at end of file
index 90a0f14..506a41d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16d1=['null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','rejectMessage','rejectmessage','download','server','files','from','bcc','subject','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','readFileSync','build','eml-format','bluebird','util','ioredis','html-to-text','../../components/parsers/qs','api','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','MailMessage,\x20%s,\x20%s','message','catch','status','json','undefined','count','offset','set','update','end','sendStatus','stack','name','index','map','MailMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','limit','order','where','VIRTUAL','filter','merge','includeAll','include','findAll','rows','show','params','length','body','find','destroy','describe','create','direction','secret','split','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','isNil','host','port','secure','authentication','auth','pass','service','user','attachments','join','root','server/files/attachments','basename','SendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','mail','read','readAt','format','UserId','get','MailInteraction','read1stAt','interaction','role'];(function(_0x1d3577,_0x17a32e){var _0x277d9a=function(_0x4b4144){while(--_0x4b4144){_0x1d3577['push'](_0x1d3577['shift']());}};_0x277d9a(++_0x17a32e);}(_0x16d1,0x155));var _0x116d=function(_0x6b280,_0x291f02){_0x6b280=_0x6b280-0x0;var _0x20ecf2=_0x16d1[_0x6b280];return _0x20ecf2;};'use strict';var emlformat=require(_0x116d('0x0'));var moment=require('moment');var BPromise=require(_0x116d('0x1'));var util=require(_0x116d('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var Redis=require(_0x116d('0x3'));var htmlToText=require(_0x116d('0x4'));var qs=require(_0x116d('0x5'));var logger=require('../../config/logger')(_0x116d('0x6'));var interaction_log=require(_0x116d('0x7'))(_0x116d('0x8'));var config=require(_0x116d('0x9'));var db=require(_0x116d('0xa'))['db'];config[_0x116d('0xb')]=_[_0x116d('0xc')](config['redis'],{'host':_0x116d('0xd'),'port':0x18eb});var socket=require(_0x116d('0xe'))(new Redis(config['redis']));var htmlEntities=require('html-entities');require('./mailMessage.socket')[_0x116d('0xf')](socket);var jayson=require(_0x116d('0x10'));var client=jayson[_0x116d('0x11')]['http']({'port':0x232c});var client9003=jayson[_0x116d('0x11')][_0x116d('0x12')]({'port':0x232b});var client9002=jayson[_0x116d('0x11')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47fea6,_0x4698da,_0x498dc4,_0x1ccc40){return new BPromise(function(_0x501df9,_0x347cb9){var _0x20054a=_0x1ccc40||client;return _0x20054a[_0x116d('0x13')](_0x47fea6,_0x498dc4)[_0x116d('0x14')](function(_0x5088e1){logger[_0x116d('0x15')]('MailMessage,\x20%s,\x20%s',_0x4698da,_0x116d('0x16'));logger[_0x116d('0x17')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x4698da,_0x116d('0x16'),JSON[_0x116d('0x18')](_0x5088e1));if(_0x5088e1[_0x116d('0x19')]){if(_0x5088e1['error'][_0x116d('0x1a')]===0x1f4){logger['error'](_0x116d('0x1b'),_0x4698da,_0x5088e1['error'][_0x116d('0x1c')]);return _0x347cb9(_0x5088e1[_0x116d('0x19')][_0x116d('0x1c')]);}logger[_0x116d('0x19')]('MailMessage,\x20%s,\x20%s',_0x4698da,_0x5088e1[_0x116d('0x19')][_0x116d('0x1c')]);return _0x501df9(_0x5088e1[_0x116d('0x19')][_0x116d('0x1c')]);}else{logger[_0x116d('0x15')](_0x116d('0x1b'),_0x4698da,_0x116d('0x16'));_0x501df9(_0x5088e1['result']['message']);}})[_0x116d('0x1d')](function(_0x1d773e){logger[_0x116d('0x19')](_0x116d('0x1b'),_0x4698da,_0x1d773e);_0x347cb9(_0x1d773e);});});}function respondWithResult(_0x49ea91,_0x45d046){_0x45d046=_0x45d046||0xc8;return function(_0x1c75fa){if(_0x1c75fa){return _0x49ea91[_0x116d('0x1e')](_0x45d046)[_0x116d('0x1f')](_0x1c75fa);}};}function respondWithFilteredResult(_0x3e214f,_0x2b24dc){return function(_0x6d11ba){if(_0x6d11ba){var _0x458539=typeof _0x2b24dc['offset']==='undefined'&&typeof _0x2b24dc['limit']===_0x116d('0x20');var _0x1ff937=_0x6d11ba[_0x116d('0x21')];var _0x485c92=_0x458539?0x0:_0x2b24dc['offset'];var _0xef0a10=_0x458539?_0x6d11ba[_0x116d('0x21')]:_0x2b24dc[_0x116d('0x22')]+_0x2b24dc['limit'];var _0x5d11d1;if(_0xef0a10>=_0x1ff937){_0xef0a10=_0x1ff937;_0x5d11d1=0xc8;}else{_0x5d11d1=0xce;}_0x3e214f['status'](_0x5d11d1);return _0x3e214f[_0x116d('0x23')]('Content-Range',_0x485c92+'-'+_0xef0a10+'/'+_0x1ff937)[_0x116d('0x1f')](_0x6d11ba);}return null;};}function saveUpdates(_0x576c28){return function(_0x2b6e05){if(_0x2b6e05){return _0x2b6e05[_0x116d('0x24')](_0x576c28)['then'](function(_0x5397d0){return _0x5397d0;});}return null;};}function removeEntity(_0x2edfba){return function(_0x5917da){if(_0x5917da){return _0x5917da['destroy']()[_0x116d('0x14')](function(){_0x2edfba['status'](0xcc)[_0x116d('0x25')]();});}};}function handleEntityNotFound(_0x26d1e1){return function(_0x3226a3){if(!_0x3226a3){_0x26d1e1[_0x116d('0x26')](0x194);}return _0x3226a3;};}function handleError(_0xbff188,_0x22631d){_0x22631d=_0x22631d||0x1f4;return function(_0x14c0e1){logger[_0x116d('0x19')](_0x14c0e1[_0x116d('0x27')]);if(_0x14c0e1[_0x116d('0x28')]){delete _0x14c0e1['name'];}_0xbff188[_0x116d('0x1e')](_0x22631d)['send'](_0x14c0e1);};}exports[_0x116d('0x29')]=function(_0x236caa,_0x5f458e){var _0x52b2b9={},_0x551c68={},_0xd7bea4={'count':0x0,'rows':[]};var _0x5e902c=_[_0x116d('0x2a')](db[_0x116d('0x2b')][_0x116d('0x2c')],function(_0x2da14a){return{'name':_0x2da14a[_0x116d('0x2d')],'type':_0x2da14a[_0x116d('0x2e')][_0x116d('0x2f')]};});_0x551c68[_0x116d('0x30')]=_['map'](_0x5e902c,_0x116d('0x28'));_0x551c68[_0x116d('0x31')]=_[_0x116d('0x32')](_0x236caa['query']);_0x551c68[_0x116d('0x33')]=_[_0x116d('0x34')](_0x551c68[_0x116d('0x30')],_0x551c68[_0x116d('0x31')]);_0x52b2b9[_0x116d('0x35')]=_[_0x116d('0x34')](_0x551c68[_0x116d('0x30')],qs[_0x116d('0x36')](_0x236caa[_0x116d('0x31')][_0x116d('0x36')]));_0x52b2b9[_0x116d('0x35')]=_0x52b2b9[_0x116d('0x35')]['length']?_0x52b2b9[_0x116d('0x35')]:_0x551c68['model'];if(!_0x236caa[_0x116d('0x31')]['hasOwnProperty'](_0x116d('0x37'))){_0x52b2b9[_0x116d('0x38')]=qs['limit'](_0x236caa[_0x116d('0x31')][_0x116d('0x38')]);_0x52b2b9[_0x116d('0x22')]=qs[_0x116d('0x22')](_0x236caa[_0x116d('0x31')][_0x116d('0x22')]);}_0x52b2b9[_0x116d('0x39')]=qs['sort'](_0x236caa[_0x116d('0x31')]['sort']);_0x52b2b9[_0x116d('0x3a')]=qs[_0x116d('0x33')](_['pick'](_0x236caa[_0x116d('0x31')],_0x551c68[_0x116d('0x33')]),_0x5e902c);if(_0x236caa['query']['filter']){_0x52b2b9['where']=_['merge'](_0x52b2b9[_0x116d('0x3a')],{'$or':_[_0x116d('0x2a')](_0x5e902c,function(_0x296ed7){if(_0x296ed7[_0x116d('0x2e')]!==_0x116d('0x3b')){var _0x3a225e={};_0x3a225e[_0x296ed7[_0x116d('0x28')]]={'$like':'%'+_0x236caa[_0x116d('0x31')][_0x116d('0x3c')]+'%'};return _0x3a225e;}})});}_0x52b2b9=_[_0x116d('0x3d')]({},_0x52b2b9,_0x236caa['options']);var _0x1fcd0c={'where':_0x52b2b9['where']};return db['MailMessage'][_0x116d('0x21')](_0x1fcd0c)[_0x116d('0x14')](function(_0x5440e1){_0xd7bea4[_0x116d('0x21')]=_0x5440e1;if(_0x236caa['query'][_0x116d('0x3e')]){_0x52b2b9[_0x116d('0x3f')]=[{'all':!![]}];}return db[_0x116d('0x2b')][_0x116d('0x40')](_0x52b2b9);})[_0x116d('0x14')](function(_0x879bd6){_0xd7bea4[_0x116d('0x41')]=_0x879bd6;return _0xd7bea4;})[_0x116d('0x14')](respondWithFilteredResult(_0x5f458e,_0x52b2b9))[_0x116d('0x1d')](handleError(_0x5f458e,null));};exports[_0x116d('0x42')]=function(_0x21c1f3,_0x46824d){var _0x34cb2c={'raw':!![],'where':{'id':_0x21c1f3[_0x116d('0x43')]['id']}},_0xd93970={};_0xd93970[_0x116d('0x30')]=_[_0x116d('0x32')](db['MailMessage']['rawAttributes']);_0xd93970['query']=_[_0x116d('0x32')](_0x21c1f3[_0x116d('0x31')]);_0xd93970[_0x116d('0x33')]=_[_0x116d('0x34')](_0xd93970[_0x116d('0x30')],_0xd93970[_0x116d('0x31')]);_0x34cb2c[_0x116d('0x35')]=_[_0x116d('0x34')](_0xd93970[_0x116d('0x30')],qs['fields'](_0x21c1f3[_0x116d('0x31')][_0x116d('0x36')]));_0x34cb2c[_0x116d('0x35')]=_0x34cb2c[_0x116d('0x35')][_0x116d('0x44')]?_0x34cb2c[_0x116d('0x35')]:_0xd93970[_0x116d('0x30')];if(_0x21c1f3[_0x116d('0x31')][_0x116d('0x3e')]){_0x34cb2c['include']=[{'all':!![]}];}_0x34cb2c=_[_0x116d('0x3d')]({},_0x34cb2c,_0x21c1f3['options']);return db[_0x116d('0x2b')]['find'](_0x34cb2c)[_0x116d('0x14')](handleEntityNotFound(_0x46824d,null))['then'](respondWithResult(_0x46824d,null))['catch'](handleError(_0x46824d,null));};exports[_0x116d('0x24')]=function(_0x33bdff,_0x56e185){if(_0x33bdff[_0x116d('0x45')]['id']){delete _0x33bdff[_0x116d('0x45')]['id'];}return db[_0x116d('0x2b')][_0x116d('0x46')]({'where':{'id':_0x33bdff[_0x116d('0x43')]['id']}})[_0x116d('0x14')](handleEntityNotFound(_0x56e185,null))[_0x116d('0x14')](saveUpdates(_0x33bdff[_0x116d('0x45')],null))[_0x116d('0x14')](respondWithResult(_0x56e185,null))[_0x116d('0x1d')](handleError(_0x56e185,null));};exports[_0x116d('0x47')]=function(_0x5f31f0,_0x4d51b2){return db[_0x116d('0x2b')][_0x116d('0x46')]({'where':{'id':_0x5f31f0[_0x116d('0x43')]['id']}})[_0x116d('0x14')](handleEntityNotFound(_0x4d51b2,null))[_0x116d('0x14')](removeEntity(_0x4d51b2,null))['catch'](handleError(_0x4d51b2,null));};exports['describe']=function(_0x4a9767,_0xa7b4ac){return db[_0x116d('0x2b')][_0x116d('0x48')]()[_0x116d('0x14')](respondWithResult(_0xa7b4ac,null))[_0x116d('0x1d')](handleError(_0xa7b4ac,null));};exports[_0x116d('0x49')]=function(_0x526eef,_0x1514a5){return db[_0x116d('0x2b')][_0x116d('0x49')](_0x526eef['body'])['then'](function(_0x5e944f){if(_0x5e944f){if(_0x5e944f[_0x116d('0x4a')]==='out'&&!_0x5e944f[_0x116d('0x4b')]){var _0x1ace54,_0x57098c,_0x146968;if(_0x526eef['body']['to']){_0x57098c=_0x526eef['body']['to'][_0x116d('0x4c')](',')[0x0];}return db['MailAccount']['findOne']({'where':{'id':_0x5e944f['MailAccountId']},'include':[{'model':db[_0x116d('0x4d')],'as':_0x116d('0x4e'),'include':[{'model':db[_0x116d('0x4f')],'as':_0x116d('0x50'),'where':{'email':_0x57098c},'limit':0x1,'order':[[_0x116d('0x51'),_0x116d('0x52')]]}]},{'model':db[_0x116d('0x53')],'as':'Smtp','raw':!![]}]})[_0x116d('0x14')](function(_0x59bd24){_0x1ace54=_0x59bd24;if(_0x1ace54&&_0x1ace54[_0x116d('0x54')]){var _0x1f81b5={'tls':{'rejectUnauthorized':![]}};if(_[_0x116d('0x55')](_0x1ace54[_0x116d('0x54')]['service'])){_0x1f81b5[_0x116d('0x56')]=_0x1ace54[_0x116d('0x54')][_0x116d('0x56')];_0x1f81b5[_0x116d('0x57')]=_0x1ace54[_0x116d('0x54')][_0x116d('0x57')];_0x1f81b5[_0x116d('0x58')]=_0x1ace54[_0x116d('0x54')][_0x116d('0x58')];if(_0x1ace54[_0x116d('0x54')][_0x116d('0x59')]){_0x1f81b5[_0x116d('0x5a')]={'user':_0x1ace54['Smtp']['user'],'pass':_0x1ace54[_0x116d('0x54')][_0x116d('0x5b')]};}}else{_0x1f81b5['service']=_0x1ace54[_0x116d('0x54')][_0x116d('0x5c')];_0x1f81b5[_0x116d('0x5a')]={'user':_0x1ace54[_0x116d('0x54')][_0x116d('0x5d')],'pass':_0x1ace54[_0x116d('0x54')][_0x116d('0x5b')]};_0x1f81b5['secure']=_0x1ace54[_0x116d('0x54')]['secure'];}if(_0x526eef[_0x116d('0x45')][_0x116d('0x5e')]&&_0x526eef[_0x116d('0x45')][_0x116d('0x5e')][_0x116d('0x44')]){for(var _0x447a3a=0x0;_0x447a3a<_0x526eef[_0x116d('0x45')][_0x116d('0x5e')][_0x116d('0x44')];_0x447a3a+=0x1){_0x526eef[_0x116d('0x45')][_0x116d('0x5e')][_0x447a3a]={'filename':_0x526eef[_0x116d('0x45')][_0x116d('0x5e')][_0x447a3a][_0x116d('0x28')],'path':path[_0x116d('0x5f')](config[_0x116d('0x60')],_0x116d('0x61'),_0x526eef[_0x116d('0x45')][_0x116d('0x5e')][_0x447a3a][_0x116d('0x62')])};}}_0x146968={'account':_0x1f81b5,'message':_0x526eef[_0x116d('0x45')]};return;}})['then'](function(){if(_0x1ace54[_0x116d('0x4e')]){if(_0x1ace54[_0x116d('0x4e')]['Contacts']['length']){return _0x1ace54[_0x116d('0x4e')][_0x116d('0x50')][0x0];}else{return db['CmContact']['create'](_[_0x116d('0xc')](_0x526eef['body'],{'firstName':_0x526eef[_0x116d('0x45')]['to'],'email':_0x526eef[_0x116d('0x45')]['to'],'phone':_0x526eef[_0x116d('0x45')]['to'],'ListId':_0x1ace54['ListId']}));}}else{throw new Error('List\x20not\x20found');}})[_0x116d('0x14')](function(){if(_0x146968){return respondWithRpcPromise(_0x116d('0x63'),'sendMail',_0x146968,client9003)['then'](function(_0x29b087){return _0x5e944f[_0x116d('0x24')]({'read':!![],'messageId':_0x29b087[_0x116d('0x64')],'sentAt':moment()['format'](_0x116d('0x65'))});})[_0x116d('0x1d')](function(_0x10812b){logger['error']('%s',JSON[_0x116d('0x18')](_0x10812b));return _0x5e944f;});}return _0x5e944f;});}return _0x5e944f;}})[_0x116d('0x14')](respondWithResult(_0x1514a5,0xc9))[_0x116d('0x1d')](handleError(_0x1514a5,null));};exports['accept']=function(_0x15c80c,_0x157cc0){var _0x40966c={'agent':{},'channel':_0x116d('0x66')};if(_0x15c80c[_0x116d('0x45')]['id']){delete _0x15c80c['body']['id'];}_0x15c80c[_0x116d('0x45')][_0x116d('0x67')]=!![];_0x15c80c[_0x116d('0x45')][_0x116d('0x68')]=moment()[_0x116d('0x69')]('YYYY-MM-DD\x20HH:mm:ss');_0x15c80c[_0x116d('0x45')][_0x116d('0x6a')]=_0x15c80c[_0x116d('0x45')][_0x116d('0x6a')]||_0x15c80c[_0x116d('0x5d')]['id'];_0x40966c['agent']['id']=_0x15c80c[_0x116d('0x45')]['UserId'];return db[_0x116d('0x2b')][_0x116d('0x46')]({'where':{'id':_0x15c80c['params']['id'],'UserId':null}})[_0x116d('0x14')](handleEntityNotFound(_0x157cc0,null))[_0x116d('0x14')](saveUpdates(_0x15c80c['body'],null))[_0x116d('0x14')](function(_0x39c891){if(_0x39c891){_0x40966c[_0x116d('0x1c')]=_0x39c891[_0x116d('0x6b')]({'plain':!![]});return db[_0x116d('0x6c')][_0x116d('0x46')]({'where':{'id':_0x39c891['MailInteractionId']}});}return null;})[_0x116d('0x14')](handleEntityNotFound(_0x157cc0,null))[_0x116d('0x14')](function(_0x31402c){if(_0x31402c){return _0x31402c[_0x116d('0x24')]({'UserId':_0x15c80c['body'][_0x116d('0x6a')],'read1stAt':_[_0x116d('0x55')](_0x31402c[_0x116d('0x6d')])?moment()['format'](_0x116d('0x65')):undefined});}return null;})[_0x116d('0x14')](function(_0x257f6c){if(_0x257f6c){_0x40966c[_0x116d('0x6e')]=_0x257f6c[_0x116d('0x6b')]({'plain':!![]});interaction_log[_0x116d('0x15')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x15c80c[_0x116d('0x5d')]['id'],_0x15c80c[_0x116d('0x5d')][_0x116d('0x28')],_0x15c80c[_0x116d('0x5d')][_0x116d('0x6f')],_0x40966c[_0x116d('0x6e')]['id'],_0x15c80c[_0x116d('0x45')]?JSON['stringify'](_0x15c80c['body']):_0x116d('0x70'));return respondWithRpcPromise(_0x116d('0x71'),'acceptMessage',_0x40966c);}return null;})[_0x116d('0x14')](function(_0xdeaa20){var _0x1848ae=_0x116d('0x72')+_0xdeaa20[_0x116d('0x1c')][_0x116d('0x73')];return db[_0x116d('0x74')]['query'](_0x1848ae,{'type':db[_0x116d('0x75')][_0x116d('0x76')][_0x116d('0x77')],'raw':!![]})[_0x116d('0x14')](function(_0x4c484c){return _0x4c484c;});})['then'](function(_0x580114){if(_0x580114){_0x40966c[_0x116d('0x1c')][_0x116d('0x78')]=_0x580114[0x0];if(!_0x15c80c[_0x116d('0x45')]['UserId'])return;return db[_0x116d('0x79')][_0x116d('0x46')]({'where':{'id':_0x15c80c[_0x116d('0x45')][_0x116d('0x6a')],'role':_0x116d('0x7a')},'attributes':['id',_0x116d('0x28'),_0x116d('0x7b'),_0x116d('0x7c'),'internal'],'raw':!![]});}return null;})[_0x116d('0x14')](function(_0xb765b4){if(!_0xb765b4)return null;_0x40966c[_0x116d('0x1c')]['agent']=_0xb765b4;return _0x40966c;})['then'](function(_0x28afb5){if(_0x28afb5){if(_0x15c80c[_0x116d('0x45')]['manual']){_0x40966c[_0x116d('0x1c')][_0x116d('0x7d')]=util[_0x116d('0x69')](_0x116d('0x7e'),_0x15c80c['user']['name']);_0x40966c[_0x116d('0x1c')][_0x116d('0x7f')]=_0x40966c[_0x116d('0x7f')];_0x40966c['message'][_0x116d('0x80')]=_0x40966c['channel'];_0x40966c[_0x116d('0x1c')][_0x116d('0x81')]='accept';_0x40966c['message'][_0x116d('0x45')]=htmlToText[_0x116d('0x82')](_0x40966c['message'][_0x116d('0x45')]);return respondWithRpcPromise(_0x116d('0x83'),_0x116d('0x83'),{'event':_0x116d('0x84'),'message':_0x40966c[_0x116d('0x1c')]},client9002)[_0x116d('0x14')](function(){return _0x40966c;});}return _0x40966c;}return null;})[_0x116d('0x14')](respondWithResult(_0x157cc0,null))[_0x116d('0x1d')](handleError(_0x157cc0,null));};exports[_0x116d('0x85')]=function(_0x96de41,_0x1c154f){var _0x4ad1c1={'agent':{},'channel':_0x116d('0x66')};if(_0x96de41[_0x116d('0x45')]['id']){delete _0x96de41[_0x116d('0x45')]['id'];}_0x96de41[_0x116d('0x45')]['UserId']=_0x96de41[_0x116d('0x45')][_0x116d('0x6a')]||_0x96de41[_0x116d('0x5d')]['id'];_0x4ad1c1[_0x116d('0x7a')]['id']=_0x96de41[_0x116d('0x45')]['UserId'];return db['MailMessage'][_0x116d('0x46')]({'where':{'id':_0x96de41['params']['id'],'UserId':null}})[_0x116d('0x14')](handleEntityNotFound(_0x1c154f,null))[_0x116d('0x14')](function(_0x1ec0d7){if(_0x1ec0d7){_0x4ad1c1[_0x116d('0x1c')]=_0x1ec0d7['get']({'plain':!![]});return db[_0x116d('0x6c')][_0x116d('0x46')]({'where':{'id':_0x1ec0d7['MailInteractionId']}});}return null;})[_0x116d('0x14')](handleEntityNotFound(_0x1c154f,null))[_0x116d('0x14')](function(_0x25112b){if(_0x25112b){_0x4ad1c1[_0x116d('0x6e')]=_0x25112b['get']({'plain':!![]});interaction_log[_0x116d('0x15')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x96de41[_0x116d('0x5d')]['id'],_0x96de41['user'][_0x116d('0x28')],_0x96de41[_0x116d('0x5d')]['role'],_0x4ad1c1[_0x116d('0x6e')]['id'],_0x96de41[_0x116d('0x45')]?JSON[_0x116d('0x18')](_0x96de41[_0x116d('0x45')]):_0x116d('0x70'));return respondWithRpcPromise('RejectMessage',_0x116d('0x86'),_0x4ad1c1);}return null;})[_0x116d('0x14')](function(_0x531b34){var _0x4788b6='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x531b34[_0x116d('0x1c')][_0x116d('0x73')];return db[_0x116d('0x74')]['query'](_0x4788b6,{'type':db[_0x116d('0x75')][_0x116d('0x76')]['SELECT'],'raw':!![]})[_0x116d('0x14')](function(_0xa0639e){return _0xa0639e;});})[_0x116d('0x14')](function(_0x3904b2){if(_0x3904b2){_0x4ad1c1[_0x116d('0x1c')][_0x116d('0x78')]=_0x3904b2[0x0];if(!_0x96de41['body'][_0x116d('0x6a')])return;return db[_0x116d('0x79')][_0x116d('0x46')]({'where':{'id':_0x96de41[_0x116d('0x45')][_0x116d('0x6a')],'role':_0x116d('0x7a')},'attributes':['id',_0x116d('0x28'),_0x116d('0x7b'),_0x116d('0x7c'),'internal'],'raw':!![]});}return null;})['then'](function(_0x1ac546){if(!_0x1ac546)return null;_0x4ad1c1[_0x116d('0x1c')][_0x116d('0x7a')]=_0x1ac546;return _0x4ad1c1;})[_0x116d('0x14')](function(_0x3d1583){if(_0x3d1583){_0x3d1583['message'][_0x116d('0x7d')]=util[_0x116d('0x69')]('SIP/%s',_0x96de41[_0x116d('0x5d')][_0x116d('0x28')]);_0x3d1583['message'][_0x116d('0x7f')]=_0x4ad1c1['channel'];_0x3d1583[_0x116d('0x1c')]['motionChannel']=_0x4ad1c1[_0x116d('0x7f')];_0x3d1583[_0x116d('0x1c')]['event']='reject';_0x3d1583[_0x116d('0x1c')]['body']=htmlToText[_0x116d('0x82')](_0x4ad1c1[_0x116d('0x1c')][_0x116d('0x45')]);respondWithRpcPromise('EventManager',_0x116d('0x83'),{'event':_0x116d('0x87'),'message':_0x3d1583['message']},client9002);return _0x4ad1c1;}return null;})[_0x116d('0x14')](respondWithResult(_0x1c154f,null))[_0x116d('0x1d')](handleError(_0x1c154f,null));};exports[_0x116d('0x88')]=function(_0x59f1a5,_0x2f2a84){var _0x3dfe14=moment()['unix']()['toString']();var _0x4748f0=path[_0x116d('0x5f')](config['root'],_0x116d('0x89'),_0x116d('0x8a'),'tmp');var _0x5d5a0d=path[_0x116d('0x5f')](config['root'],'server',_0x116d('0x8a'),'attachments');var _0x33a4fd=util[_0x116d('0x69')]('message-%s.eml',_0x3dfe14);return db['MailMessage'][_0x116d('0x46')]({'where':{'id':_0x59f1a5[_0x116d('0x43')]['id']},'attributes':['id',_0x116d('0x45'),_0x116d('0x8b'),'to','cc',_0x116d('0x8c'),_0x116d('0x8d'),'createdAt'],'include':_0x59f1a5[_0x116d('0x31')][_0x116d('0x5e')]?[{'model':db[_0x116d('0x8e')],'as':_0x116d('0x8f')}]:undefined})['then'](handleEntityNotFound(_0x2f2a84,null))[_0x116d('0x14')](function(_0x5cc1b1){if(_0x5cc1b1){var _0x111f26=_0x5cc1b1;var _0x2ad2af={'from':_0x111f26[_0x116d('0x8b')],'to':_0x111f26['to'],'subject':_0x111f26[_0x116d('0x8d')],'html':htmlEntities['decode'](_0x111f26[_0x116d('0x45')]),'headers':{'Date':moment(_0x111f26['createdAt'])[_0x116d('0x69')](_0x116d('0x90'))},'attachments':[]};if(_0x5cc1b1['cc']){_0x2ad2af[_0x116d('0x91')]['Cc']=_0x5cc1b1['cc'];}if(_0x5cc1b1[_0x116d('0x8c')]){_0x2ad2af[_0x116d('0x91')][_0x116d('0x92')]=_0x5cc1b1[_0x116d('0x8c')];}return new BPromise(function(_0x8fc9e5,_0x45aeca){if(_0x5cc1b1[_0x116d('0x8f')]){for(var _0x3da8cc=0x0;_0x3da8cc<_0x5cc1b1[_0x116d('0x8f')][_0x116d('0x44')];_0x3da8cc++){var _0x4ad9e2=_0x5cc1b1[_0x116d('0x8f')][_0x3da8cc];var _0x1b63ec=path[_0x116d('0x5f')](_0x5d5a0d,_0x4ad9e2[_0x116d('0x62')]);if(fs[_0x116d('0x93')](_0x1b63ec)){_0x2ad2af[_0x116d('0x5e')][_0x116d('0x94')]({'name':_0x4ad9e2[_0x116d('0x28')],'contentType':_0x4ad9e2[_0x116d('0x2e')],'data':fs[_0x116d('0x95')](_0x1b63ec)});}}}emlformat[_0x116d('0x96')](_0x2ad2af,function(_0x274cdb,_0x531289){if(_0x274cdb)return _0x45aeca(_0x274cdb);fs['writeFileSync'](path[_0x116d('0x5f')](_0x4748f0,_0x33a4fd),_0x531289);return _0x8fc9e5(_0x531289);});});}})[_0x116d('0x14')](function(_0x1573d6){if(_0x1573d6){return _0x2f2a84[_0x116d('0x88')](path[_0x116d('0x5f')](_0x4748f0,_0x33a4fd),_0x33a4fd,function(_0x31a964){if(!_0x31a964)fs['unlinkSync'](path[_0x116d('0x5f')](_0x4748f0,_0x33a4fd));});}})[_0x116d('0x1d')](handleError(_0x2f2a84,null));};
\ No newline at end of file
+var _0xa4d4=['List','CmContact','updatedAt','DESC','Smtp','service','host','port','secure','authentication','user','pass','auth','attachments','root','basename','Contacts','ListId','SendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','get','MailInteraction','MailInteractionId','UserId','isNil','read1stAt','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','acceptMessage','ContactId','sequelize','Sequelize','SELECT','contact','User','agent','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','interface','download','join','server','tmp','files','message-%s.eml','bcc','subject','createdAt','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','readFileSync','build','writeFileSync','eml-format','util','path','lodash','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','jayson/promise','client','http','request','then','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','info','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','destroy','end','stack','name','index','map','MailMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','params','find','update','body','describe','create','direction','out','split','MailAccount','findOne','MailAccountId'];(function(_0x19ff9c,_0x4f3863){var _0x271810=function(_0x4aa62b){while(--_0x4aa62b){_0x19ff9c['push'](_0x19ff9c['shift']());}};_0x271810(++_0x4f3863);}(_0xa4d4,0xec));var _0x4a4d=function(_0x3dc00e,_0xce29a6){_0x3dc00e=_0x3dc00e-0x0;var _0x1874f7=_0xa4d4[_0x3dc00e];return _0x1874f7;};'use strict';var emlformat=require(_0x4a4d('0x0'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x4a4d('0x1'));var path=require(_0x4a4d('0x2'));var fs=require('fs');var _=require(_0x4a4d('0x3'));var Redis=require('ioredis');var htmlToText=require(_0x4a4d('0x4'));var qs=require(_0x4a4d('0x5'));var logger=require(_0x4a4d('0x6'))(_0x4a4d('0x7'));var interaction_log=require('../../config/logger')(_0x4a4d('0x8'));var config=require(_0x4a4d('0x9'));var db=require(_0x4a4d('0xa'))['db'];config[_0x4a4d('0xb')]=_[_0x4a4d('0xc')](config[_0x4a4d('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x4a4d('0xd'))(new Redis(config[_0x4a4d('0xb')]));var htmlEntities=require('html-entities');require('./mailMessage.socket')['register'](socket);var jayson=require(_0x4a4d('0xe'));var client=jayson[_0x4a4d('0xf')][_0x4a4d('0x10')]({'port':0x232c});var client9003=jayson[_0x4a4d('0xf')][_0x4a4d('0x10')]({'port':0x232b});var client9002=jayson[_0x4a4d('0xf')][_0x4a4d('0x10')]({'port':0x232a});function respondWithRpcPromise(_0x5a4102,_0x7da824,_0x2762c2,_0x33e152){return new BPromise(function(_0x377878,_0x544e42){var _0x3b7435=_0x33e152||client;return _0x3b7435[_0x4a4d('0x11')](_0x5a4102,_0x2762c2)[_0x4a4d('0x12')](function(_0x37e9dd){logger['info']('MailMessage,\x20%s,\x20%s',_0x7da824,_0x4a4d('0x13'));logger['debug'](_0x4a4d('0x14'),_0x7da824,_0x4a4d('0x13'),JSON[_0x4a4d('0x15')](_0x37e9dd));if(_0x37e9dd[_0x4a4d('0x16')]){if(_0x37e9dd[_0x4a4d('0x16')][_0x4a4d('0x17')]===0x1f4){logger[_0x4a4d('0x16')](_0x4a4d('0x18'),_0x7da824,_0x37e9dd['error'][_0x4a4d('0x19')]);return _0x544e42(_0x37e9dd[_0x4a4d('0x16')]['message']);}logger['error'](_0x4a4d('0x18'),_0x7da824,_0x37e9dd[_0x4a4d('0x16')][_0x4a4d('0x19')]);return _0x377878(_0x37e9dd['error'][_0x4a4d('0x19')]);}else{logger[_0x4a4d('0x1a')](_0x4a4d('0x18'),_0x7da824,_0x4a4d('0x13'));_0x377878(_0x37e9dd[_0x4a4d('0x1b')][_0x4a4d('0x19')]);}})[_0x4a4d('0x1c')](function(_0x525156){logger['error'](_0x4a4d('0x18'),_0x7da824,_0x525156);_0x544e42(_0x525156);});});}function respondWithResult(_0x308425,_0x4fea70){_0x4fea70=_0x4fea70||0xc8;return function(_0x5b7bec){if(_0x5b7bec){return _0x308425[_0x4a4d('0x1d')](_0x4fea70)[_0x4a4d('0x1e')](_0x5b7bec);}};}function respondWithFilteredResult(_0x54314f,_0x2f1c5e){return function(_0x354b63){if(_0x354b63){var _0x1cf79e=typeof _0x2f1c5e[_0x4a4d('0x1f')]===_0x4a4d('0x20')&&typeof _0x2f1c5e[_0x4a4d('0x21')]===_0x4a4d('0x20');var _0x139dc3=_0x354b63[_0x4a4d('0x22')];var _0x9d2903=_0x1cf79e?0x0:_0x2f1c5e[_0x4a4d('0x1f')];var _0x37ce3e=_0x1cf79e?_0x354b63[_0x4a4d('0x22')]:_0x2f1c5e['offset']+_0x2f1c5e[_0x4a4d('0x21')];var _0x4fa997;if(_0x37ce3e>=_0x139dc3){_0x37ce3e=_0x139dc3;_0x4fa997=0xc8;}else{_0x4fa997=0xce;}_0x54314f[_0x4a4d('0x1d')](_0x4fa997);return _0x54314f[_0x4a4d('0x23')](_0x4a4d('0x24'),_0x9d2903+'-'+_0x37ce3e+'/'+_0x139dc3)['json'](_0x354b63);}return null;};}function saveUpdates(_0x5343ba){return function(_0xea4ebb){if(_0xea4ebb){return _0xea4ebb['update'](_0x5343ba)[_0x4a4d('0x12')](function(_0xc1acb6){return _0xc1acb6;});}return null;};}function removeEntity(_0x546c50){return function(_0x4fe954){if(_0x4fe954){return _0x4fe954[_0x4a4d('0x25')]()[_0x4a4d('0x12')](function(){_0x546c50[_0x4a4d('0x1d')](0xcc)[_0x4a4d('0x26')]();});}};}function handleEntityNotFound(_0x2d9617){return function(_0xbc109f){if(!_0xbc109f){_0x2d9617['sendStatus'](0x194);}return _0xbc109f;};}function handleError(_0x460547,_0x8e3fa6){_0x8e3fa6=_0x8e3fa6||0x1f4;return function(_0x1ce11a){logger[_0x4a4d('0x16')](_0x1ce11a[_0x4a4d('0x27')]);if(_0x1ce11a[_0x4a4d('0x28')]){delete _0x1ce11a[_0x4a4d('0x28')];}_0x460547[_0x4a4d('0x1d')](_0x8e3fa6)['send'](_0x1ce11a);};}exports[_0x4a4d('0x29')]=function(_0x47c56f,_0x54af44){var _0x1a5442={},_0x33d1a2={},_0x3b9188={'count':0x0,'rows':[]};var _0x4f0635=_[_0x4a4d('0x2a')](db[_0x4a4d('0x2b')][_0x4a4d('0x2c')],function(_0xc0f89a){return{'name':_0xc0f89a[_0x4a4d('0x2d')],'type':_0xc0f89a[_0x4a4d('0x2e')][_0x4a4d('0x2f')]};});_0x33d1a2['model']=_[_0x4a4d('0x2a')](_0x4f0635,_0x4a4d('0x28'));_0x33d1a2[_0x4a4d('0x30')]=_[_0x4a4d('0x31')](_0x47c56f[_0x4a4d('0x30')]);_0x33d1a2[_0x4a4d('0x32')]=_[_0x4a4d('0x33')](_0x33d1a2[_0x4a4d('0x34')],_0x33d1a2['query']);_0x1a5442[_0x4a4d('0x35')]=_['intersection'](_0x33d1a2[_0x4a4d('0x34')],qs[_0x4a4d('0x36')](_0x47c56f[_0x4a4d('0x30')][_0x4a4d('0x36')]));_0x1a5442['attributes']=_0x1a5442[_0x4a4d('0x35')][_0x4a4d('0x37')]?_0x1a5442[_0x4a4d('0x35')]:_0x33d1a2[_0x4a4d('0x34')];if(!_0x47c56f[_0x4a4d('0x30')][_0x4a4d('0x38')]('nolimit')){_0x1a5442[_0x4a4d('0x21')]=qs[_0x4a4d('0x21')](_0x47c56f[_0x4a4d('0x30')][_0x4a4d('0x21')]);_0x1a5442[_0x4a4d('0x1f')]=qs['offset'](_0x47c56f[_0x4a4d('0x30')][_0x4a4d('0x1f')]);}_0x1a5442[_0x4a4d('0x39')]=qs['sort'](_0x47c56f[_0x4a4d('0x30')][_0x4a4d('0x3a')]);_0x1a5442[_0x4a4d('0x3b')]=qs[_0x4a4d('0x32')](_[_0x4a4d('0x3c')](_0x47c56f['query'],_0x33d1a2[_0x4a4d('0x32')]),_0x4f0635);if(_0x47c56f[_0x4a4d('0x30')][_0x4a4d('0x3d')]){_0x1a5442[_0x4a4d('0x3b')]=_[_0x4a4d('0x3e')](_0x1a5442[_0x4a4d('0x3b')],{'$or':_[_0x4a4d('0x2a')](_0x4f0635,function(_0x3fa434){if(_0x3fa434['type']!==_0x4a4d('0x3f')){var _0x1b93bd={};_0x1b93bd[_0x3fa434[_0x4a4d('0x28')]]={'$like':'%'+_0x47c56f['query']['filter']+'%'};return _0x1b93bd;}})});}_0x1a5442=_[_0x4a4d('0x3e')]({},_0x1a5442,_0x47c56f[_0x4a4d('0x40')]);var _0x5a6782={'where':_0x1a5442[_0x4a4d('0x3b')]};return db[_0x4a4d('0x2b')]['count'](_0x5a6782)[_0x4a4d('0x12')](function(_0x25975b){_0x3b9188[_0x4a4d('0x22')]=_0x25975b;if(_0x47c56f['query']['includeAll']){_0x1a5442[_0x4a4d('0x41')]=[{'all':!![]}];}return db[_0x4a4d('0x2b')]['findAll'](_0x1a5442);})[_0x4a4d('0x12')](function(_0x4938c5){_0x3b9188['rows']=_0x4938c5;return _0x3b9188;})[_0x4a4d('0x12')](respondWithFilteredResult(_0x54af44,_0x1a5442))[_0x4a4d('0x1c')](handleError(_0x54af44,null));};exports['show']=function(_0x56e1b3,_0x4cf1d5){var _0x32a0d0={'raw':!![],'where':{'id':_0x56e1b3[_0x4a4d('0x42')]['id']}},_0x1ff590={};_0x1ff590[_0x4a4d('0x34')]=_[_0x4a4d('0x31')](db[_0x4a4d('0x2b')][_0x4a4d('0x2c')]);_0x1ff590['query']=_[_0x4a4d('0x31')](_0x56e1b3[_0x4a4d('0x30')]);_0x1ff590[_0x4a4d('0x32')]=_[_0x4a4d('0x33')](_0x1ff590[_0x4a4d('0x34')],_0x1ff590[_0x4a4d('0x30')]);_0x32a0d0[_0x4a4d('0x35')]=_[_0x4a4d('0x33')](_0x1ff590[_0x4a4d('0x34')],qs[_0x4a4d('0x36')](_0x56e1b3['query'][_0x4a4d('0x36')]));_0x32a0d0[_0x4a4d('0x35')]=_0x32a0d0[_0x4a4d('0x35')][_0x4a4d('0x37')]?_0x32a0d0[_0x4a4d('0x35')]:_0x1ff590[_0x4a4d('0x34')];if(_0x56e1b3['query']['includeAll']){_0x32a0d0['include']=[{'all':!![]}];}_0x32a0d0=_[_0x4a4d('0x3e')]({},_0x32a0d0,_0x56e1b3[_0x4a4d('0x40')]);return db[_0x4a4d('0x2b')][_0x4a4d('0x43')](_0x32a0d0)[_0x4a4d('0x12')](handleEntityNotFound(_0x4cf1d5,null))[_0x4a4d('0x12')](respondWithResult(_0x4cf1d5,null))[_0x4a4d('0x1c')](handleError(_0x4cf1d5,null));};exports[_0x4a4d('0x44')]=function(_0x323d4c,_0x13280c){if(_0x323d4c[_0x4a4d('0x45')]['id']){delete _0x323d4c['body']['id'];}return db[_0x4a4d('0x2b')][_0x4a4d('0x43')]({'where':{'id':_0x323d4c[_0x4a4d('0x42')]['id']}})[_0x4a4d('0x12')](handleEntityNotFound(_0x13280c,null))[_0x4a4d('0x12')](saveUpdates(_0x323d4c['body'],null))['then'](respondWithResult(_0x13280c,null))[_0x4a4d('0x1c')](handleError(_0x13280c,null));};exports[_0x4a4d('0x25')]=function(_0x1a628e,_0xd4f9a5){return db[_0x4a4d('0x2b')][_0x4a4d('0x43')]({'where':{'id':_0x1a628e[_0x4a4d('0x42')]['id']}})['then'](handleEntityNotFound(_0xd4f9a5,null))[_0x4a4d('0x12')](removeEntity(_0xd4f9a5,null))[_0x4a4d('0x1c')](handleError(_0xd4f9a5,null));};exports[_0x4a4d('0x46')]=function(_0x35aaec,_0x53baa4){return db[_0x4a4d('0x2b')][_0x4a4d('0x46')]()[_0x4a4d('0x12')](respondWithResult(_0x53baa4,null))['catch'](handleError(_0x53baa4,null));};exports[_0x4a4d('0x47')]=function(_0x478e45,_0x31b250){return db[_0x4a4d('0x2b')][_0x4a4d('0x47')](_0x478e45[_0x4a4d('0x45')])['then'](function(_0x300786){if(_0x300786){if(_0x300786[_0x4a4d('0x48')]===_0x4a4d('0x49')&&!_0x300786['secret']){var _0x570264,_0x5ba902,_0x1a2688;if(_0x478e45[_0x4a4d('0x45')]['to']){_0x5ba902=_0x478e45[_0x4a4d('0x45')]['to'][_0x4a4d('0x4a')](',')[0x0];}return db[_0x4a4d('0x4b')][_0x4a4d('0x4c')]({'where':{'id':_0x300786[_0x4a4d('0x4d')]},'include':[{'model':db['CmList'],'as':_0x4a4d('0x4e'),'include':[{'model':db[_0x4a4d('0x4f')],'as':'Contacts','where':{'email':_0x5ba902},'limit':0x1,'order':[[_0x4a4d('0x50'),_0x4a4d('0x51')]]}]},{'model':db['MailServerOut'],'as':_0x4a4d('0x52'),'raw':!![]}]})[_0x4a4d('0x12')](function(_0x133a26){_0x570264=_0x133a26;if(_0x570264&&_0x570264[_0x4a4d('0x52')]){var _0x565c19={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x570264['Smtp'][_0x4a4d('0x53')])){_0x565c19['host']=_0x570264[_0x4a4d('0x52')][_0x4a4d('0x54')];_0x565c19[_0x4a4d('0x55')]=_0x570264['Smtp'][_0x4a4d('0x55')];_0x565c19[_0x4a4d('0x56')]=_0x570264[_0x4a4d('0x52')][_0x4a4d('0x56')];if(_0x570264['Smtp'][_0x4a4d('0x57')]){_0x565c19['auth']={'user':_0x570264[_0x4a4d('0x52')][_0x4a4d('0x58')],'pass':_0x570264[_0x4a4d('0x52')][_0x4a4d('0x59')]};}}else{_0x565c19[_0x4a4d('0x53')]=_0x570264['Smtp'][_0x4a4d('0x53')];_0x565c19[_0x4a4d('0x5a')]={'user':_0x570264[_0x4a4d('0x52')][_0x4a4d('0x58')],'pass':_0x570264[_0x4a4d('0x52')]['pass']};_0x565c19[_0x4a4d('0x56')]=_0x570264[_0x4a4d('0x52')]['secure'];}if(_0x478e45[_0x4a4d('0x45')][_0x4a4d('0x5b')]&&_0x478e45[_0x4a4d('0x45')][_0x4a4d('0x5b')][_0x4a4d('0x37')]){for(var _0x3d2149=0x0;_0x3d2149<_0x478e45[_0x4a4d('0x45')][_0x4a4d('0x5b')][_0x4a4d('0x37')];_0x3d2149+=0x1){_0x478e45[_0x4a4d('0x45')][_0x4a4d('0x5b')][_0x3d2149]={'filename':_0x478e45[_0x4a4d('0x45')][_0x4a4d('0x5b')][_0x3d2149][_0x4a4d('0x28')],'path':path['join'](config[_0x4a4d('0x5c')],'server/files/attachments',_0x478e45[_0x4a4d('0x45')][_0x4a4d('0x5b')][_0x3d2149][_0x4a4d('0x5d')])};}}_0x1a2688={'account':_0x565c19,'message':_0x478e45[_0x4a4d('0x45')]};return;}})[_0x4a4d('0x12')](function(){if(_0x570264['List']){if(_0x570264['List'][_0x4a4d('0x5e')][_0x4a4d('0x37')]){return _0x570264['List'][_0x4a4d('0x5e')][0x0];}else{return db[_0x4a4d('0x4f')][_0x4a4d('0x47')](_['defaults'](_0x478e45[_0x4a4d('0x45')],{'firstName':_0x478e45[_0x4a4d('0x45')]['to'],'email':_0x478e45[_0x4a4d('0x45')]['to'],'phone':_0x478e45['body']['to'],'ListId':_0x570264[_0x4a4d('0x5f')]}));}}else{throw new Error('List\x20not\x20found');}})[_0x4a4d('0x12')](function(){if(_0x1a2688){return respondWithRpcPromise(_0x4a4d('0x60'),'sendMail',_0x1a2688,client9003)[_0x4a4d('0x12')](function(_0xa0a085){return _0x300786[_0x4a4d('0x44')]({'read':!![],'messageId':_0xa0a085[_0x4a4d('0x61')],'sentAt':moment()[_0x4a4d('0x62')](_0x4a4d('0x63'))});})[_0x4a4d('0x1c')](function(_0xddb496){logger[_0x4a4d('0x16')]('%s',JSON[_0x4a4d('0x15')](_0xddb496));return _0x300786;});}return _0x300786;});}return _0x300786;}})[_0x4a4d('0x12')](respondWithResult(_0x31b250,0xc9))[_0x4a4d('0x1c')](handleError(_0x31b250,null));};exports[_0x4a4d('0x64')]=function(_0x1e6b55,_0x58adc0){var _0x20a885={'agent':{},'channel':_0x4a4d('0x65')};if(_0x1e6b55[_0x4a4d('0x45')]['id']){delete _0x1e6b55[_0x4a4d('0x45')]['id'];}_0x1e6b55[_0x4a4d('0x45')][_0x4a4d('0x66')]=!![];_0x1e6b55[_0x4a4d('0x45')]['readAt']=moment()[_0x4a4d('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0x1e6b55[_0x4a4d('0x45')]['UserId']=_0x1e6b55['body']['UserId']||_0x1e6b55[_0x4a4d('0x58')]['id'];_0x20a885['agent']['id']=_0x1e6b55['body']['UserId'];return db[_0x4a4d('0x2b')][_0x4a4d('0x43')]({'where':{'id':_0x1e6b55[_0x4a4d('0x42')]['id'],'UserId':null}})[_0x4a4d('0x12')](handleEntityNotFound(_0x58adc0,null))[_0x4a4d('0x12')](saveUpdates(_0x1e6b55[_0x4a4d('0x45')],null))['then'](function(_0x5490a4){if(_0x5490a4){_0x20a885[_0x4a4d('0x19')]=_0x5490a4[_0x4a4d('0x67')]({'plain':!![]});return db[_0x4a4d('0x68')]['find']({'where':{'id':_0x5490a4[_0x4a4d('0x69')]}});}return null;})[_0x4a4d('0x12')](handleEntityNotFound(_0x58adc0,null))[_0x4a4d('0x12')](function(_0x32d649){if(_0x32d649){return _0x32d649['update']({'UserId':_0x1e6b55[_0x4a4d('0x45')][_0x4a4d('0x6a')],'read1stAt':_[_0x4a4d('0x6b')](_0x32d649[_0x4a4d('0x6c')])?moment()[_0x4a4d('0x62')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x4c269f){if(_0x4c269f){_0x20a885['interaction']=_0x4c269f[_0x4a4d('0x67')]({'plain':!![]});interaction_log[_0x4a4d('0x1a')](_0x4a4d('0x6d'),_0x1e6b55['user']['id'],_0x1e6b55[_0x4a4d('0x58')][_0x4a4d('0x28')],_0x1e6b55['user'][_0x4a4d('0x6e')],_0x20a885[_0x4a4d('0x6f')]['id'],_0x1e6b55[_0x4a4d('0x45')]?JSON[_0x4a4d('0x15')](_0x1e6b55[_0x4a4d('0x45')]):_0x4a4d('0x70'));return respondWithRpcPromise('AcceptMessage',_0x4a4d('0x71'),_0x20a885);}return null;})['then'](function(_0x3de557){var _0x49964e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3de557['message'][_0x4a4d('0x72')];return db[_0x4a4d('0x73')][_0x4a4d('0x30')](_0x49964e,{'type':db[_0x4a4d('0x74')]['QueryTypes'][_0x4a4d('0x75')],'raw':!![]})[_0x4a4d('0x12')](function(_0x20d4bd){return _0x20d4bd;});})[_0x4a4d('0x12')](function(_0x2601b2){if(_0x2601b2){_0x20a885[_0x4a4d('0x19')][_0x4a4d('0x76')]=_0x2601b2[0x0];if(!_0x1e6b55[_0x4a4d('0x45')]['UserId'])return;return db[_0x4a4d('0x77')][_0x4a4d('0x43')]({'where':{'id':_0x1e6b55[_0x4a4d('0x45')][_0x4a4d('0x6a')],'role':_0x4a4d('0x78')},'attributes':['id','name',_0x4a4d('0x79'),_0x4a4d('0x7a'),_0x4a4d('0x7b')],'raw':!![]});}return null;})['then'](function(_0x3b8357){if(!_0x3b8357)return null;_0x20a885[_0x4a4d('0x19')][_0x4a4d('0x78')]=_0x3b8357;return _0x20a885;})[_0x4a4d('0x12')](function(_0x44d653){if(_0x44d653){if(_0x1e6b55['body'][_0x4a4d('0x7c')]){_0x20a885[_0x4a4d('0x19')]['interface']=util['format'](_0x4a4d('0x7d'),_0x1e6b55[_0x4a4d('0x58')][_0x4a4d('0x28')]);_0x20a885['message'][_0x4a4d('0x7e')]=_0x20a885['channel'];_0x20a885[_0x4a4d('0x19')][_0x4a4d('0x7f')]=_0x20a885[_0x4a4d('0x7e')];_0x20a885[_0x4a4d('0x19')][_0x4a4d('0x80')]=_0x4a4d('0x64');_0x20a885[_0x4a4d('0x19')][_0x4a4d('0x45')]=htmlToText[_0x4a4d('0x81')](_0x20a885[_0x4a4d('0x19')][_0x4a4d('0x45')]);return respondWithRpcPromise(_0x4a4d('0x82'),_0x4a4d('0x82'),{'event':_0x4a4d('0x83'),'message':_0x20a885[_0x4a4d('0x19')]},client9002)[_0x4a4d('0x12')](function(){return _0x20a885;});}return _0x20a885;}return null;})[_0x4a4d('0x12')](respondWithResult(_0x58adc0,null))[_0x4a4d('0x1c')](handleError(_0x58adc0,null));};exports[_0x4a4d('0x84')]=function(_0x2f402c,_0xef1a2f){var _0xac744e={'agent':{},'channel':_0x4a4d('0x65')};if(_0x2f402c[_0x4a4d('0x45')]['id']){delete _0x2f402c[_0x4a4d('0x45')]['id'];}_0x2f402c[_0x4a4d('0x45')][_0x4a4d('0x6a')]=_0x2f402c[_0x4a4d('0x45')][_0x4a4d('0x6a')]||_0x2f402c[_0x4a4d('0x58')]['id'];_0xac744e[_0x4a4d('0x78')]['id']=_0x2f402c[_0x4a4d('0x45')][_0x4a4d('0x6a')];return db['MailMessage']['find']({'where':{'id':_0x2f402c[_0x4a4d('0x42')]['id'],'UserId':null}})[_0x4a4d('0x12')](handleEntityNotFound(_0xef1a2f,null))['then'](function(_0x4646c2){if(_0x4646c2){_0xac744e[_0x4a4d('0x19')]=_0x4646c2[_0x4a4d('0x67')]({'plain':!![]});return db[_0x4a4d('0x68')]['find']({'where':{'id':_0x4646c2['MailInteractionId']}});}return null;})[_0x4a4d('0x12')](handleEntityNotFound(_0xef1a2f,null))[_0x4a4d('0x12')](function(_0x9533fc){if(_0x9533fc){_0xac744e[_0x4a4d('0x6f')]=_0x9533fc[_0x4a4d('0x67')]({'plain':!![]});interaction_log[_0x4a4d('0x1a')](_0x4a4d('0x85'),_0x2f402c[_0x4a4d('0x58')]['id'],_0x2f402c['user']['name'],_0x2f402c[_0x4a4d('0x58')][_0x4a4d('0x6e')],_0xac744e['interaction']['id'],_0x2f402c['body']?JSON[_0x4a4d('0x15')](_0x2f402c[_0x4a4d('0x45')]):_0x4a4d('0x70'));return respondWithRpcPromise('RejectMessage',_0x4a4d('0x86'),_0xac744e);}return null;})['then'](function(_0x4ded00){var _0x292dde=_0x4a4d('0x87')+_0x4ded00['message'][_0x4a4d('0x72')];return db['sequelize'][_0x4a4d('0x30')](_0x292dde,{'type':db[_0x4a4d('0x74')][_0x4a4d('0x88')][_0x4a4d('0x75')],'raw':!![]})[_0x4a4d('0x12')](function(_0x3e9825){return _0x3e9825;});})['then'](function(_0x38fb30){if(_0x38fb30){_0xac744e[_0x4a4d('0x19')][_0x4a4d('0x76')]=_0x38fb30[0x0];if(!_0x2f402c[_0x4a4d('0x45')]['UserId'])return;return db[_0x4a4d('0x77')][_0x4a4d('0x43')]({'where':{'id':_0x2f402c[_0x4a4d('0x45')][_0x4a4d('0x6a')],'role':_0x4a4d('0x78')},'attributes':['id',_0x4a4d('0x28'),'fullname','email','internal'],'raw':!![]});}return null;})[_0x4a4d('0x12')](function(_0x3d3739){if(!_0x3d3739)return null;_0xac744e[_0x4a4d('0x19')][_0x4a4d('0x78')]=_0x3d3739;return _0xac744e;})[_0x4a4d('0x12')](function(_0x35e5a1){if(_0x35e5a1){_0x35e5a1['message'][_0x4a4d('0x89')]=util[_0x4a4d('0x62')](_0x4a4d('0x7d'),_0x2f402c[_0x4a4d('0x58')][_0x4a4d('0x28')]);_0x35e5a1['message']['channel']=_0xac744e[_0x4a4d('0x7e')];_0x35e5a1['message']['motionChannel']=_0xac744e[_0x4a4d('0x7e')];_0x35e5a1[_0x4a4d('0x19')]['event']=_0x4a4d('0x84');_0x35e5a1[_0x4a4d('0x19')][_0x4a4d('0x45')]=htmlToText[_0x4a4d('0x81')](_0xac744e[_0x4a4d('0x19')][_0x4a4d('0x45')]);respondWithRpcPromise(_0x4a4d('0x82'),_0x4a4d('0x82'),{'event':'rejectmessage','message':_0x35e5a1[_0x4a4d('0x19')]},client9002);return _0xac744e;}return null;})[_0x4a4d('0x12')](respondWithResult(_0xef1a2f,null))[_0x4a4d('0x1c')](handleError(_0xef1a2f,null));};exports[_0x4a4d('0x8a')]=function(_0x17d45e,_0x35de3a){var _0x37b44b=moment()['unix']()['toString']();var _0x4fa9b2=path[_0x4a4d('0x8b')](config['root'],_0x4a4d('0x8c'),'files',_0x4a4d('0x8d'));var _0x10c6ec=path[_0x4a4d('0x8b')](config[_0x4a4d('0x5c')],_0x4a4d('0x8c'),_0x4a4d('0x8e'),_0x4a4d('0x5b'));var _0xf5b75b=util[_0x4a4d('0x62')](_0x4a4d('0x8f'),_0x37b44b);return db[_0x4a4d('0x2b')][_0x4a4d('0x43')]({'where':{'id':_0x17d45e[_0x4a4d('0x42')]['id']},'attributes':['id','body','from','to','cc',_0x4a4d('0x90'),_0x4a4d('0x91'),_0x4a4d('0x92')],'include':_0x17d45e[_0x4a4d('0x30')][_0x4a4d('0x5b')]?[{'model':db[_0x4a4d('0x93')],'as':_0x4a4d('0x94')}]:undefined})[_0x4a4d('0x12')](handleEntityNotFound(_0x35de3a,null))[_0x4a4d('0x12')](function(_0x5948a4){if(_0x5948a4){var _0x2d5da8=_0x5948a4;var _0x3b7199={'from':_0x2d5da8['from'],'to':_0x2d5da8['to'],'subject':_0x2d5da8['subject'],'html':htmlEntities[_0x4a4d('0x95')](_0x2d5da8[_0x4a4d('0x45')]),'headers':{'Date':moment(_0x2d5da8['createdAt'])[_0x4a4d('0x62')](_0x4a4d('0x96'))},'attachments':[]};if(_0x5948a4['cc']){_0x3b7199[_0x4a4d('0x97')]['Cc']=_0x5948a4['cc'];}if(_0x5948a4['bcc']){_0x3b7199[_0x4a4d('0x97')][_0x4a4d('0x98')]=_0x5948a4[_0x4a4d('0x90')];}return new BPromise(function(_0x32d1e4,_0x343dcd){if(_0x5948a4[_0x4a4d('0x94')]){for(var _0x5676f5=0x0;_0x5676f5<_0x5948a4[_0x4a4d('0x94')]['length'];_0x5676f5++){var _0xc587c2=_0x5948a4[_0x4a4d('0x94')][_0x5676f5];var _0x3c1e06=path[_0x4a4d('0x8b')](_0x10c6ec,_0xc587c2[_0x4a4d('0x5d')]);if(fs[_0x4a4d('0x99')](_0x3c1e06)){_0x3b7199[_0x4a4d('0x5b')]['push']({'name':_0xc587c2[_0x4a4d('0x28')],'contentType':_0xc587c2[_0x4a4d('0x2e')],'data':fs[_0x4a4d('0x9a')](_0x3c1e06)});}}}emlformat[_0x4a4d('0x9b')](_0x3b7199,function(_0x229765,_0x5a09f6){if(_0x229765)return _0x343dcd(_0x229765);fs[_0x4a4d('0x9c')](path[_0x4a4d('0x8b')](_0x4fa9b2,_0xf5b75b),_0x5a09f6);return _0x32d1e4(_0x5a09f6);});});}})['then'](function(_0x21722e){if(_0x21722e){return _0x35de3a[_0x4a4d('0x8a')](path['join'](_0x4fa9b2,_0xf5b75b),_0xf5b75b,function(_0x336704){if(!_0x336704)fs['unlinkSync'](path[_0x4a4d('0x8b')](_0x4fa9b2,_0xf5b75b));});}})['catch'](handleError(_0x35de3a,null));};
\ No newline at end of file
index 32fde79..f7d1801 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf08c=['emit','hasOwnProperty','hook','events','../../mysqldb','MailMessage','setMaxListeners','save','update'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xf08c,0x162));var _0xcf08=function(_0x5dbec8,_0x503c95){_0x5dbec8=_0x5dbec8-0x0;var _0x411fe7=_0xf08c[_0x5dbec8];return _0x411fe7;};'use strict';var EventEmitter=require(_0xcf08('0x0'));var MailMessage=require(_0xcf08('0x1'))['db'][_0xcf08('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xcf08('0x3')](0x0);var events={'afterCreate':_0xcf08('0x4'),'afterUpdate':_0xcf08('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4df87a){return function(_0x5a290c,_0x245417,_0x5eff36){MailMessageEvents[_0xcf08('0x6')](_0x4df87a+':'+_0x5a290c['id'],_0x5a290c);MailMessageEvents[_0xcf08('0x6')](_0x4df87a,_0x5a290c);_0x5eff36(null);};}for(var e in events){if(events[_0xcf08('0x7')](e)){var event=events[e];MailMessage[_0xcf08('0x8')](e,emitEvent(event));}}module['exports']=MailMessageEvents;
\ No newline at end of file
+var _0x1263=['emit','hook','events','../../mysqldb','MailMessage','save','update'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0x1263,0x1a6));var _0x3126=function(_0x1d1d4e,_0x4dbfab){_0x1d1d4e=_0x1d1d4e-0x0;var _0x594fa4=_0x1263[_0x1d1d4e];return _0x594fa4;};'use strict';var EventEmitter=require(_0x3126('0x0'));var MailMessage=require(_0x3126('0x1'))['db'][_0x3126('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3126('0x3'),'afterUpdate':_0x3126('0x4'),'afterDestroy':'remove'};function emitEvent(_0x348100){return function(_0x3288ab,_0x5e7161,_0x300ae9){MailMessageEvents[_0x3126('0x5')](_0x348100+':'+_0x3288ab['id'],_0x3288ab);MailMessageEvents[_0x3126('0x5')](_0x348100,_0x3288ab);_0x300ae9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x3126('0x6')](e,emitEvent(event));}}module['exports']=MailMessageEvents;
\ No newline at end of file
index f557210..d088b00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4fc=['direction','toLowerCase','out','isNil','MailInteraction','findOne','MailInteractionId','then','update','catch','error','utf8mb4','../../config/logger','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','exports','MailMessage','mail_messages','messageId','plainBody','subject','body','get'];(function(_0x3e78f4,_0x5d4c9a){var _0x5ca5eb=function(_0x1161b6){while(--_0x1161b6){_0x3e78f4['push'](_0x3e78f4['shift']());}};_0x5ca5eb(++_0x5d4c9a);}(_0xa4fc,0xae));var _0xca4f=function(_0x466074,_0x4dde3f){_0x466074=_0x466074-0x0;var _0x11b639=_0xa4fc[_0x466074];return _0x11b639;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xca4f('0x0'))('api');var moment=require('moment');var BPromise=require(_0xca4f('0x1'));var rp=require(_0xca4f('0x2'));var htmlToText=require(_0xca4f('0x3'));var fs=require('fs');var path=require(_0xca4f('0x4'));var rimraf=require(_0xca4f('0x5'));var config=require(_0xca4f('0x6'));var attributes=require('./mailMessage.attributes');module[_0xca4f('0x7')]=function(_0x463589,_0x2405eb){return _0x463589['define'](_0xca4f('0x8'),attributes,{'tableName':_0xca4f('0x9'),'paranoid':![],'indexes':[{'name':_0xca4f('0xa'),'fields':['messageId']},{'name':'fti_mail_messages','fields':[_0xca4f('0xb'),_0xca4f('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2d6ddf,_0x2c27c1,_0x3639c5){if(_0x2d6ddf['body']){_0x2d6ddf[_0xca4f('0xb')]=htmlToText['fromString'](_0x2d6ddf[_0xca4f('0xd')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x3639c5(null,_0x2c27c1);},'afterCreate':function(_0x3f8a46,_0x4f16d5,_0x2367bc){var _0xa7874c=_0x463589['models'];var _0x23702a=_0x3f8a46[_0xca4f('0xe')]({'plain':!![]});if(_0x23702a[_0xca4f('0xf')][_0xca4f('0x10')]()==='in'||_0x23702a[_0xca4f('0xf')][_0xca4f('0x10')]()===_0xca4f('0x11')&&!_0x23702a['secret']&&!_[_0xca4f('0x12')](_0x23702a['UserId'])){_0xa7874c[_0xca4f('0x13')][_0xca4f('0x14')]({'where':{'id':_0x23702a[_0xca4f('0x15')]}})[_0xca4f('0x16')](function(_0x439927){if(_0x439927){_0x439927[_0xca4f('0x17')]({'lastMsgAt':_0x23702a['createdAt'],'lastMsgDirection':_0x23702a[_0xca4f('0xf')][_0xca4f('0x10')]()});}})[_0xca4f('0x18')](function(_0x4bf2a7){console[_0xca4f('0x19')](_0x4bf2a7);});}_0x2367bc();}},'charset':_0xca4f('0x1a'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x3e3f=['createdAt','catch','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','./mailMessage.attributes','exports','define','MailMessage','mail_messages','fti_mail_messages','plainBody','FULLTEXT','fromString','body','models','toLowerCase','direction','out','secret','isNil','UserId','findOne','MailInteractionId','then','update'];(function(_0x1c2b60,_0x1217e3){var _0x16f465=function(_0x5c1af4){while(--_0x5c1af4){_0x1c2b60['push'](_0x1c2b60['shift']());}};_0x16f465(++_0x1217e3);}(_0x3e3f,0xbd));var _0xf3e3=function(_0x55d49e,_0x28504f){_0x55d49e=_0x55d49e-0x0;var _0x35741d=_0x3e3f[_0x55d49e];return _0x35741d;};'use strict';var _=require(_0xf3e3('0x0'));var util=require('util');var logger=require(_0xf3e3('0x1'))(_0xf3e3('0x2'));var moment=require(_0xf3e3('0x3'));var BPromise=require(_0xf3e3('0x4'));var rp=require(_0xf3e3('0x5'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require('path');var rimraf=require(_0xf3e3('0x6'));var config=require('../../config/environment');var attributes=require(_0xf3e3('0x7'));module[_0xf3e3('0x8')]=function(_0x450a0c,_0x44774f){return _0x450a0c[_0xf3e3('0x9')](_0xf3e3('0xa'),attributes,{'tableName':_0xf3e3('0xb'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0xf3e3('0xc'),'fields':[_0xf3e3('0xd'),'subject'],'type':_0xf3e3('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xc0313a,_0x43c482,_0x4bc085){if(_0xc0313a['body']){_0xc0313a[_0xf3e3('0xd')]=htmlToText[_0xf3e3('0xf')](_0xc0313a[_0xf3e3('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x4bc085(null,_0x43c482);},'afterCreate':function(_0x251c3c,_0x52448e,_0x3653bd){var _0x55d5e0=_0x450a0c[_0xf3e3('0x11')];var _0x2b603c=_0x251c3c['get']({'plain':!![]});if(_0x2b603c['direction'][_0xf3e3('0x12')]()==='in'||_0x2b603c[_0xf3e3('0x13')][_0xf3e3('0x12')]()===_0xf3e3('0x14')&&!_0x2b603c[_0xf3e3('0x15')]&&!_[_0xf3e3('0x16')](_0x2b603c[_0xf3e3('0x17')])){_0x55d5e0['MailInteraction'][_0xf3e3('0x18')]({'where':{'id':_0x2b603c[_0xf3e3('0x19')]}})[_0xf3e3('0x1a')](function(_0x3779e7){if(_0x3779e7){_0x3779e7[_0xf3e3('0x1b')]({'lastMsgAt':_0x2b603c[_0xf3e3('0x1c')],'lastMsgDirection':_0x2b603c[_0xf3e3('0x13')][_0xf3e3('0x12')]()});}})[_0xf3e3('0x1d')](function(_0x2ac10c){console['error'](_0x2ac10c);});}_0x3653bd();}},'charset':'utf8mb4','collate':_0xf3e3('0x1e')});};
\ No newline at end of file
index 69377ba..86d0a61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xefda=['redis','defaults','socket.io-emitter','./mailMessage.socket','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateMailMessage','MailMessage','create','body','options','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2c753c,_0x3378e7){var _0x23ba20=function(_0xac82d){while(--_0xac82d){_0x2c753c['push'](_0x2c753c['shift']());}};_0x23ba20(++_0x3378e7);}(_0xefda,0x96));var _0xaefd=function(_0x4e897e,_0x5970fe){_0x4e897e=_0x4e897e-0x0;var _0x5d39cc=_0xefda[_0x4e897e];return _0x5d39cc;};'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});config[_0xaefd('0xa')]=_[_0xaefd('0xb')](config[_0xaefd('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xaefd('0xc'))(new Redis(config[_0xaefd('0xa')]));require(_0xaefd('0xd'))['register'](socket);function respondWithRpcPromise(_0x48a255,_0x54a3b1,_0xa6239d){return new BPromise(function(_0x16b36e,_0x20135c){return client[_0xaefd('0xe')](_0x48a255,_0xa6239d)[_0xaefd('0xf')](function(_0x1e00fb){logger[_0xaefd('0x10')](_0xaefd('0x11'),_0x54a3b1,_0xaefd('0x12'));logger[_0xaefd('0x13')](_0xaefd('0x14'),_0x54a3b1,'request\x20sent',JSON[_0xaefd('0x15')](_0x1e00fb));if(_0x1e00fb['error']){if(_0x1e00fb[_0xaefd('0x16')][_0xaefd('0x17')]===0x1f4){logger[_0xaefd('0x16')](_0xaefd('0x11'),_0x54a3b1,_0x1e00fb['error'][_0xaefd('0x18')]);return _0x20135c(_0x1e00fb[_0xaefd('0x16')][_0xaefd('0x18')]);}logger[_0xaefd('0x16')](_0xaefd('0x11'),_0x54a3b1,_0x1e00fb[_0xaefd('0x16')][_0xaefd('0x18')]);return _0x16b36e(_0x1e00fb[_0xaefd('0x16')]['message']);}else{logger[_0xaefd('0x10')](_0xaefd('0x11'),_0x54a3b1,_0xaefd('0x12'));_0x16b36e(_0x1e00fb[_0xaefd('0x19')][_0xaefd('0x18')]);}})[_0xaefd('0x1a')](function(_0x516e84){logger[_0xaefd('0x16')](_0xaefd('0x11'),_0x54a3b1,_0x516e84);_0x20135c(_0x516e84);});});}exports[_0xaefd('0x1b')]=function(_0x1260dd){var _0x45ebf2=this;return new Promise(function(_0x1f302c,_0x5282ed){return db[_0xaefd('0x1c')][_0xaefd('0x1d')](_0x1260dd[_0xaefd('0x1e')],{'raw':_0x1260dd[_0xaefd('0x1f')]?_0x1260dd[_0xaefd('0x1f')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5b9967){logger[_0xaefd('0x10')](_0xaefd('0x1b'),_0x1260dd);logger[_0xaefd('0x13')]('CreateMailMessage',_0x1260dd,JSON[_0xaefd('0x15')](_0x5b9967));_0x1f302c(_0x5b9967);})['catch'](function(_0x3deec8){logger[_0xaefd('0x16')](_0xaefd('0x1b'),_0x3deec8['message'],_0x1260dd);_0x5282ed(_0x45ebf2[_0xaefd('0x16')](0x1f4,_0x3deec8[_0xaefd('0x18')]));});});};
\ No newline at end of file
+var _0x1399=['catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','error','code','message','result','CreateMailMessage','MailMessage','create','body','options','raw','debug','stringify'];(function(_0x470d22,_0x1b6a4f){var _0x3cc44d=function(_0x4a3749){while(--_0x4a3749){_0x470d22['push'](_0x470d22['shift']());}};_0x3cc44d(++_0x1b6a4f);}(_0x1399,0x16c));var _0x9139=function(_0x4a043e,_0x5eae7a){_0x4a043e=_0x4a043e-0x0;var _0x152f7c=_0x1399[_0x4a043e];return _0x152f7c;};'use strict';var _=require(_0x9139('0x0'));var util=require(_0x9139('0x1'));var moment=require('moment');var BPromise=require(_0x9139('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9139('0x3'));var db=require(_0x9139('0x4'))['db'];var utils=require(_0x9139('0x5'));var logger=require(_0x9139('0x6'))(_0x9139('0x7'));var config=require(_0x9139('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9139('0x9')]({'port':0x232a});config[_0x9139('0xa')]=_[_0x9139('0xb')](config['redis'],{'host':_0x9139('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9139('0xd'))[_0x9139('0xe')](socket);function respondWithRpcPromise(_0x4830cd,_0x315de8,_0x1bfa6b){return new BPromise(function(_0x5c90eb,_0x4f7f3a){return client[_0x9139('0xf')](_0x4830cd,_0x1bfa6b)[_0x9139('0x10')](function(_0x23357c){logger[_0x9139('0x11')](_0x9139('0x12'),_0x315de8,'request\x20sent');logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x315de8,_0x9139('0x13'),JSON['stringify'](_0x23357c));if(_0x23357c[_0x9139('0x14')]){if(_0x23357c[_0x9139('0x14')][_0x9139('0x15')]===0x1f4){logger[_0x9139('0x14')]('MailMessage,\x20%s,\x20%s',_0x315de8,_0x23357c[_0x9139('0x14')]['message']);return _0x4f7f3a(_0x23357c['error']['message']);}logger[_0x9139('0x14')](_0x9139('0x12'),_0x315de8,_0x23357c[_0x9139('0x14')][_0x9139('0x16')]);return _0x5c90eb(_0x23357c[_0x9139('0x14')][_0x9139('0x16')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x315de8,_0x9139('0x13'));_0x5c90eb(_0x23357c[_0x9139('0x17')]['message']);}})['catch'](function(_0x30a363){logger[_0x9139('0x14')]('MailMessage,\x20%s,\x20%s',_0x315de8,_0x30a363);_0x4f7f3a(_0x30a363);});});}exports[_0x9139('0x18')]=function(_0x1ef57b){var _0x1a592e=this;return new Promise(function(_0x3c8296,_0xd2eb33){return db[_0x9139('0x19')][_0x9139('0x1a')](_0x1ef57b[_0x9139('0x1b')],{'raw':_0x1ef57b[_0x9139('0x1c')]?_0x1ef57b[_0x9139('0x1c')][_0x9139('0x1d')]===undefined?!![]:![]:!![]})[_0x9139('0x10')](function(_0x5a3e2e){logger[_0x9139('0x11')](_0x9139('0x18'),_0x1ef57b);logger[_0x9139('0x1e')](_0x9139('0x18'),_0x1ef57b,JSON[_0x9139('0x1f')](_0x5a3e2e));_0x3c8296(_0x5a3e2e);})[_0x9139('0x20')](function(_0x4b7fe0){logger[_0x9139('0x14')](_0x9139('0x18'),_0x4b7fe0['message'],_0x1ef57b);_0xd2eb33(_0x1a592e[_0x9139('0x14')](0x1f4,_0x4b7fe0[_0x9139('0x16')]));});});};
\ No newline at end of file
index 8c7defe..28f4f54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3306=['length','mailMessage:','./mailMessage.events','update','emit','removeListener','register'];(function(_0x45bea6,_0x255e51){var _0x1f03c4=function(_0x4be525){while(--_0x4be525){_0x45bea6['push'](_0x45bea6['shift']());}};_0x1f03c4(++_0x255e51);}(_0x3306,0x1ec));var _0x6330=function(_0x28063a,_0x109217){_0x28063a=_0x28063a-0x0;var _0x20ef8d=_0x3306[_0x28063a];return _0x20ef8d;};'use strict';var MailMessageEvents=require(_0x6330('0x0'));var events=['save','remove',_0x6330('0x1')];function createListener(_0x5b6a01,_0x473d5b){return function(_0x59c038){_0x473d5b[_0x6330('0x2')](_0x5b6a01,_0x59c038);};}function removeListener(_0x2d36f3,_0x530d08){return function(){MailMessageEvents[_0x6330('0x3')](_0x2d36f3,_0x530d08);};}exports[_0x6330('0x4')]=function(_0x25b841){for(var _0x17974d=0x0,_0xd06a5c=events[_0x6330('0x5')];_0x17974d<_0xd06a5c;_0x17974d++){var _0x360f97=events[_0x17974d];var _0x3c2e7d=createListener(_0x6330('0x6')+_0x360f97,_0x25b841);MailMessageEvents['on'](_0x360f97,_0x3c2e7d);}};
\ No newline at end of file
+var _0x98d3=['./mailMessage.events','save','update','emit','register','length','mailMessage:'];(function(_0x3642ad,_0x1da836){var _0x3aef94=function(_0x343b86){while(--_0x343b86){_0x3642ad['push'](_0x3642ad['shift']());}};_0x3aef94(++_0x1da836);}(_0x98d3,0x173));var _0x398d=function(_0x2e174b,_0xcf509d){_0x2e174b=_0x2e174b-0x0;var _0x1237a6=_0x98d3[_0x2e174b];return _0x1237a6;};'use strict';var MailMessageEvents=require(_0x398d('0x0'));var events=[_0x398d('0x1'),'remove',_0x398d('0x2')];function createListener(_0x4f5ff0,_0x18da44){return function(_0x48fcf0){_0x18da44[_0x398d('0x3')](_0x4f5ff0,_0x48fcf0);};}function removeListener(_0x41f57c,_0x4f7a58){return function(){MailMessageEvents['removeListener'](_0x41f57c,_0x4f7a58);};}exports[_0x398d('0x4')]=function(_0x25d38f){for(var _0x2c3c4c=0x0,_0x502652=events[_0x398d('0x5')];_0x2c3c4c<_0x502652;_0x2c3c4c++){var _0x391d99=events[_0x2c3c4c];var _0x3029f3=createListener(_0x398d('0x6')+_0x391d99,_0x25d38f);MailMessageEvents['on'](_0x391d99,_0x3029f3);}};
\ No newline at end of file
index 977115f..b4ab302 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f84=['/:id/members','/:id/teams','getTeams','/:id/users','post','create','addTeams','put','/:id','delete','destroy','removeTeams','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./mailQueue.controller','isAuthenticated','index','get'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x2f84,0x85));var _0x42f8=function(_0xc0cfb0,_0x394510){_0xc0cfb0=_0xc0cfb0-0x0;var _0x339e26=_0x2f84[_0xc0cfb0];return _0x339e26;};'use strict';var multer=require(_0x42f8('0x0'));var util=require('util');var path=require(_0x42f8('0x1'));var timeout=require(_0x42f8('0x2'));var express=require(_0x42f8('0x3'));var router=express[_0x42f8('0x4')]();var fs_extra=require(_0x42f8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x42f8('0x6'));var config=require('../../config/environment');var controller=require(_0x42f8('0x7'));router['get']('/',auth[_0x42f8('0x8')](),controller[_0x42f8('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x42f8('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x42f8('0xa')](_0x42f8('0xb'),auth[_0x42f8('0x8')](),controller['getMembers']);router[_0x42f8('0xa')](_0x42f8('0xc'),auth[_0x42f8('0x8')](),controller[_0x42f8('0xd')]);router['get'](_0x42f8('0xe'),auth[_0x42f8('0x8')](),controller['getAgents']);router[_0x42f8('0xf')]('/',auth[_0x42f8('0x8')](),controller[_0x42f8('0x10')]);router['post'](_0x42f8('0xc'),auth[_0x42f8('0x8')](),controller[_0x42f8('0x11')]);router[_0x42f8('0xf')]('/:id/users',auth[_0x42f8('0x8')](),controller['addAgents']);router[_0x42f8('0x12')](_0x42f8('0x13'),auth[_0x42f8('0x8')](),controller['update']);router[_0x42f8('0x14')](_0x42f8('0x13'),auth['isAuthenticated'](),controller[_0x42f8('0x15')]);router['delete'](_0x42f8('0xc'),auth[_0x42f8('0x8')](),controller[_0x42f8('0x16')]);router[_0x42f8('0x14')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0x42f8('0x17')]=router;
\ No newline at end of file
+var _0x60c9=['getAgents','create','post','put','update','delete','removeTeams','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/teams','getTeams','/:id/users'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x60c9,0x1a8));var _0x960c=function(_0x4177ed,_0x5b5ed8){_0x4177ed=_0x4177ed-0x0;var _0x1b5059=_0x60c9[_0x4177ed];return _0x1b5059;};'use strict';var multer=require('multer');var util=require(_0x960c('0x0'));var path=require(_0x960c('0x1'));var timeout=require(_0x960c('0x2'));var express=require('express');var router=express[_0x960c('0x3')]();var fs_extra=require(_0x960c('0x4'));var auth=require(_0x960c('0x5'));var interaction=require(_0x960c('0x6'));var config=require('../../config/environment');var controller=require(_0x960c('0x7'));router[_0x960c('0x8')]('/',auth[_0x960c('0x9')](),controller[_0x960c('0xa')]);router[_0x960c('0x8')](_0x960c('0xb'),auth[_0x960c('0x9')](),controller[_0x960c('0xc')]);router[_0x960c('0x8')](_0x960c('0xd'),auth['isAuthenticated'](),controller[_0x960c('0xe')]);router['get']('/:id/members',auth[_0x960c('0x9')](),controller['getMembers']);router[_0x960c('0x8')](_0x960c('0xf'),auth[_0x960c('0x9')](),controller[_0x960c('0x10')]);router[_0x960c('0x8')](_0x960c('0x11'),auth['isAuthenticated'](),controller[_0x960c('0x12')]);router['post']('/',auth[_0x960c('0x9')](),controller[_0x960c('0x13')]);router[_0x960c('0x14')]('/:id/teams',auth['isAuthenticated'](),controller['addTeams']);router['post'](_0x960c('0x11'),auth[_0x960c('0x9')](),controller['addAgents']);router[_0x960c('0x15')](_0x960c('0xd'),auth[_0x960c('0x9')](),controller[_0x960c('0x16')]);router[_0x960c('0x17')](_0x960c('0xd'),auth['isAuthenticated'](),controller['destroy']);router['delete']('/:id/teams',auth[_0x960c('0x9')](),controller[_0x960c('0x18')]);router[_0x960c('0x17')]('/:id/users',auth[_0x960c('0x9')](),controller['removeAgents']);module[_0x960c('0x19')]=router;
\ No newline at end of file
index fd1e385..0dc6824 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f19=['STRING','name','ENUM','rrmemory','beepall','sequelize'];(function(_0x7c58db,_0x52e0bb){var _0x164a25=function(_0x541476){while(--_0x541476){_0x7c58db['push'](_0x7c58db['shift']());}};_0x164a25(++_0x52e0bb);}(_0x2f19,0x95));var _0x92f1=function(_0x5c1cdc,_0x322014){_0x5c1cdc=_0x5c1cdc-0x0;var _0x2e8317=_0x2f19[_0x5c1cdc];return _0x2e8317;};'use strict';var Sequelize=require(_0x92f1('0x0'));module['exports']={'name':{'type':Sequelize[_0x92f1('0x1')],'unique':_0x92f1('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x92f1('0x3')](_0x92f1('0x4'),_0x92f1('0x5'),'roundrobin')}};
\ No newline at end of file
+var _0x1857=['STRING','name','INTEGER','beepall','roundrobin','sequelize','exports'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x1857,0x1da));var _0x7185=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x1857[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0x7185('0x0'));module[_0x7185('0x1')]={'name':{'type':Sequelize[_0x7185('0x2')],'unique':_0x7185('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7185('0x2')]},'timeout':{'type':Sequelize[_0x7185('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x7185('0x5'),_0x7185('0x6'))}};
\ No newline at end of file
index 536e812..b9b0b2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a6b=['../../config/license/util','../../mysqldb','redis','localhost','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','then','MailQueues','UserProfileResource','end','stack','name','index','map','MailQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','fields','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','describe','getMembers','findOne','UserMailQueue','order','MailQueueId','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','each','findOrCreate','forEach','emit','removeTeams','select','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','transaction','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','userMailQueue:save','isArray','getAgents','eml-format','rimraf','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x16169b,_0x1fe209){var _0x7a7d78=function(_0x5d6fb5){while(--_0x5d6fb5){_0x16169b['push'](_0x16169b['shift']());}};_0x7a7d78(++_0x1fe209);}(_0x1a6b,0x114));var _0xb1a6=function(_0x3f11e2,_0xa43b60){_0x3f11e2=_0x3f11e2-0x0;var _0x513bdf=_0x1a6b[_0x3f11e2];return _0x513bdf;};'use strict';var emlformat=require(_0xb1a6('0x0'));var rimraf=require(_0xb1a6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb1a6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb1a6('0x3'));var util=require(_0xb1a6('0x4'));var path=require(_0xb1a6('0x5'));var sox=require(_0xb1a6('0x6'));var csv=require(_0xb1a6('0x7'));var ejs=require(_0xb1a6('0x8'));var fs=require('fs');var fs_extra=require(_0xb1a6('0x9'));var _=require(_0xb1a6('0xa'));var squel=require(_0xb1a6('0xb'));var crypto=require(_0xb1a6('0xc'));var jsforce=require(_0xb1a6('0xd'));var deskjs=require(_0xb1a6('0xe'));var toCsv=require(_0xb1a6('0x7'));var querystring=require(_0xb1a6('0xf'));var Papa=require(_0xb1a6('0x10'));var Redis=require(_0xb1a6('0x11'));var authService=require(_0xb1a6('0x12'));var qs=require(_0xb1a6('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb1a6('0x14'));var logger=require(_0xb1a6('0x15'))(_0xb1a6('0x16'));var utils=require(_0xb1a6('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xb1a6('0x18'));var db=require(_0xb1a6('0x19'))['db'];config['redis']=_['defaults'](config[_0xb1a6('0x1a')],{'host':_0xb1a6('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb1a6('0x1a')]));require('./mailQueue.socket')['register'](socket);function respondWithStatusCode(_0xad3ed3,_0x2c3ef6){_0x2c3ef6=_0x2c3ef6||0xcc;return function(_0x3bbb31){if(_0x3bbb31){return _0xad3ed3[_0xb1a6('0x1c')](_0x2c3ef6);}return _0xad3ed3[_0xb1a6('0x1d')](_0x2c3ef6)['end']();};}function respondWithResult(_0x4a5bf8,_0x12efa8){_0x12efa8=_0x12efa8||0xc8;return function(_0x40c14b){if(_0x40c14b){return _0x4a5bf8[_0xb1a6('0x1d')](_0x12efa8)[_0xb1a6('0x1e')](_0x40c14b);}};}function respondWithFilteredResult(_0x15403f,_0x3b38f9){return function(_0x102e52){if(_0x102e52){var _0x18e90d=typeof _0x3b38f9[_0xb1a6('0x1f')]===_0xb1a6('0x20')&&typeof _0x3b38f9['limit']===_0xb1a6('0x20');var _0x832dba=_0x102e52[_0xb1a6('0x21')];var _0x114e57=_0x18e90d?0x0:_0x3b38f9[_0xb1a6('0x1f')];var _0x2d4e38=_0x18e90d?_0x102e52[_0xb1a6('0x21')]:_0x3b38f9['offset']+_0x3b38f9[_0xb1a6('0x22')];var _0x3cad0d;if(_0x2d4e38>=_0x832dba){_0x2d4e38=_0x832dba;_0x3cad0d=0xc8;}else{_0x3cad0d=0xce;}_0x15403f[_0xb1a6('0x1d')](_0x3cad0d);return _0x15403f[_0xb1a6('0x23')]('Content-Range',_0x114e57+'-'+_0x2d4e38+'/'+_0x832dba)[_0xb1a6('0x1e')](_0x102e52);}return null;};}function patchUpdates(_0x22dc72){return function(_0x163b9f){try{jsonpatch[_0xb1a6('0x24')](_0x163b9f,_0x22dc72,!![]);}catch(_0x359443){return BPromise[_0xb1a6('0x25')](_0x359443);}return _0x163b9f[_0xb1a6('0x26')]();};}function saveUpdates(_0x29d678,_0xea237e){return function(_0x12d83d){if(_0x12d83d){return _0x12d83d['update'](_0x29d678)['then'](function(_0x149307){return _0x149307;});}return null;};}function removeEntity(_0x2454b6,_0x339cf3){return function(_0xa5aee3){if(_0xa5aee3){return _0xa5aee3['destroy']()[_0xb1a6('0x27')](function(){var _0x3ccbb7=_0xa5aee3['get']({'plain':!![]});var _0x131325=_0xb1a6('0x28');return db[_0xb1a6('0x29')]['destroy']({'where':{'type':_0x131325,'resourceId':_0x3ccbb7['id']}})[_0xb1a6('0x27')](function(){return _0xa5aee3;});})['then'](function(){_0x2454b6[_0xb1a6('0x1d')](0xcc)[_0xb1a6('0x2a')]();});}};}function handleEntityNotFound(_0x4841ab,_0x34e9cf){return function(_0x52116c){if(!_0x52116c){_0x4841ab['sendStatus'](0x194);}return _0x52116c;};}function handleError(_0x9a70b0,_0x5419c3){_0x5419c3=_0x5419c3||0x1f4;return function(_0x34fc3a){logger['error'](_0x34fc3a[_0xb1a6('0x2b')]);if(_0x34fc3a[_0xb1a6('0x2c')]){delete _0x34fc3a[_0xb1a6('0x2c')];}_0x9a70b0[_0xb1a6('0x1d')](_0x5419c3)['send'](_0x34fc3a);};}exports[_0xb1a6('0x2d')]=function(_0x2ad6f5,_0x393d20){var _0x54978c={},_0x660d20={},_0x5a892b={'count':0x0,'rows':[]};var _0x4108f2=_[_0xb1a6('0x2e')](db[_0xb1a6('0x2f')][_0xb1a6('0x30')],function(_0x4fbf45){return{'name':_0x4fbf45[_0xb1a6('0x31')],'type':_0x4fbf45[_0xb1a6('0x32')][_0xb1a6('0x33')]};});_0x660d20[_0xb1a6('0x34')]=_[_0xb1a6('0x2e')](_0x4108f2,'name');_0x660d20[_0xb1a6('0x35')]=_[_0xb1a6('0x36')](_0x2ad6f5[_0xb1a6('0x35')]);_0x660d20[_0xb1a6('0x37')]=_[_0xb1a6('0x38')](_0x660d20[_0xb1a6('0x34')],_0x660d20[_0xb1a6('0x35')]);_0x54978c[_0xb1a6('0x39')]=_['intersection'](_0x660d20[_0xb1a6('0x34')],qs['fields'](_0x2ad6f5['query']['fields']));_0x54978c[_0xb1a6('0x39')]=_0x54978c[_0xb1a6('0x39')][_0xb1a6('0x3a')]?_0x54978c[_0xb1a6('0x39')]:_0x660d20[_0xb1a6('0x34')];if(!_0x2ad6f5[_0xb1a6('0x35')][_0xb1a6('0x3b')](_0xb1a6('0x3c'))){_0x54978c[_0xb1a6('0x22')]=qs[_0xb1a6('0x22')](_0x2ad6f5[_0xb1a6('0x35')][_0xb1a6('0x22')]);_0x54978c[_0xb1a6('0x1f')]=qs[_0xb1a6('0x1f')](_0x2ad6f5[_0xb1a6('0x35')][_0xb1a6('0x1f')]);}_0x54978c['order']=qs[_0xb1a6('0x3d')](_0x2ad6f5[_0xb1a6('0x35')][_0xb1a6('0x3d')]);_0x54978c[_0xb1a6('0x3e')]=qs[_0xb1a6('0x37')](_[_0xb1a6('0x3f')](_0x2ad6f5[_0xb1a6('0x35')],_0x660d20[_0xb1a6('0x37')]),_0x4108f2);if(_0x2ad6f5[_0xb1a6('0x35')][_0xb1a6('0x40')]){_0x54978c[_0xb1a6('0x3e')]=_[_0xb1a6('0x41')](_0x54978c[_0xb1a6('0x3e')],{'$or':_[_0xb1a6('0x2e')](_0x4108f2,function(_0x525797){if(_0x525797[_0xb1a6('0x32')]!==_0xb1a6('0x42')){var _0x2a764e={};_0x2a764e[_0x525797[_0xb1a6('0x2c')]]={'$like':'%'+_0x2ad6f5[_0xb1a6('0x35')][_0xb1a6('0x40')]+'%'};return _0x2a764e;}})});}_0x54978c=_[_0xb1a6('0x41')]({},_0x54978c,_0x2ad6f5[_0xb1a6('0x43')]);var _0x60ace={'where':_0x54978c[_0xb1a6('0x3e')]};return db[_0xb1a6('0x2f')]['count'](_0x60ace)['then'](function(_0x25ae26){_0x5a892b['count']=_0x25ae26;if(_0x2ad6f5[_0xb1a6('0x35')][_0xb1a6('0x44')]){_0x54978c[_0xb1a6('0x45')]=[{'all':!![]}];}return db[_0xb1a6('0x2f')][_0xb1a6('0x46')](_0x54978c);})[_0xb1a6('0x27')](function(_0x3779f0){_0x5a892b['rows']=_0x3779f0;return _0x5a892b;})[_0xb1a6('0x27')](respondWithFilteredResult(_0x393d20,_0x54978c))[_0xb1a6('0x47')](handleError(_0x393d20,null));};exports[_0xb1a6('0x48')]=function(_0x206960,_0x49cbd6){var _0x7987e4={'raw':!![],'where':{'id':_0x206960[_0xb1a6('0x49')]['id']}},_0x565ab4={};_0x565ab4[_0xb1a6('0x34')]=_[_0xb1a6('0x36')](db['MailQueue'][_0xb1a6('0x30')]);_0x565ab4[_0xb1a6('0x35')]=_[_0xb1a6('0x36')](_0x206960[_0xb1a6('0x35')]);_0x565ab4[_0xb1a6('0x37')]=_[_0xb1a6('0x38')](_0x565ab4[_0xb1a6('0x34')],_0x565ab4[_0xb1a6('0x35')]);_0x7987e4[_0xb1a6('0x39')]=_['intersection'](_0x565ab4[_0xb1a6('0x34')],qs[_0xb1a6('0x4a')](_0x206960[_0xb1a6('0x35')][_0xb1a6('0x4a')]));_0x7987e4[_0xb1a6('0x39')]=_0x7987e4[_0xb1a6('0x39')][_0xb1a6('0x3a')]?_0x7987e4[_0xb1a6('0x39')]:_0x565ab4['model'];if(_0x206960[_0xb1a6('0x35')]['includeAll']){_0x7987e4[_0xb1a6('0x45')]=[{'all':!![]}];}_0x7987e4=_[_0xb1a6('0x41')]({},_0x7987e4,_0x206960[_0xb1a6('0x43')]);return db[_0xb1a6('0x2f')]['find'](_0x7987e4)['then'](handleEntityNotFound(_0x49cbd6,null))[_0xb1a6('0x27')](respondWithResult(_0x49cbd6,null))[_0xb1a6('0x47')](handleError(_0x49cbd6,null));};exports[_0xb1a6('0x4b')]=function(_0x1eb113,_0x3aeab0){return db[_0xb1a6('0x2f')][_0xb1a6('0x4b')](_0x1eb113[_0xb1a6('0x4c')],{})[_0xb1a6('0x27')](function(_0x55990f){var _0x4d1b55=_0x1eb113[_0xb1a6('0x4d')][_0xb1a6('0x4e')]({'plain':!![]});if(!_0x4d1b55)throw new Error(_0xb1a6('0x4f'));if(_0x4d1b55[_0xb1a6('0x50')]===_0xb1a6('0x4d')){var _0x237f2f=_0x55990f[_0xb1a6('0x4e')]({'plain':!![]});var _0x257704=_0xb1a6('0x28');return db[_0xb1a6('0x51')][_0xb1a6('0x52')]({'where':{'name':_0x257704,'userProfileId':_0x4d1b55[_0xb1a6('0x53')]},'raw':!![]})[_0xb1a6('0x27')](function(_0xd9d063){if(_0xd9d063&&_0xd9d063['autoAssociation']===0x0){return db[_0xb1a6('0x29')][_0xb1a6('0x4b')]({'name':_0x237f2f[_0xb1a6('0x2c')],'resourceId':_0x237f2f['id'],'type':_0xd9d063[_0xb1a6('0x2c')],'sectionId':_0xd9d063['id']},{})[_0xb1a6('0x27')](function(){return _0x55990f;});}else{return _0x55990f;}})[_0xb1a6('0x47')](function(_0x236593){logger[_0xb1a6('0x54')](_0xb1a6('0x55'),_0x236593);throw _0x236593;});}return _0x55990f;})['then'](respondWithResult(_0x3aeab0,0xc9))['catch'](handleError(_0x3aeab0,null));};exports[_0xb1a6('0x56')]=function(_0x1a420f,_0x11ad38){if(_0x1a420f[_0xb1a6('0x4c')]['id']){delete _0x1a420f['body']['id'];}return db[_0xb1a6('0x2f')][_0xb1a6('0x52')]({'where':{'id':_0x1a420f[_0xb1a6('0x49')]['id']}})[_0xb1a6('0x27')](handleEntityNotFound(_0x11ad38,null))[_0xb1a6('0x27')](saveUpdates(_0x1a420f['body'],null))[_0xb1a6('0x27')](respondWithResult(_0x11ad38,null))[_0xb1a6('0x47')](handleError(_0x11ad38,null));};exports[_0xb1a6('0x57')]=function(_0x125154,_0x1134da){return db[_0xb1a6('0x2f')][_0xb1a6('0x52')]({'where':{'id':_0x125154[_0xb1a6('0x49')]['id']}})[_0xb1a6('0x27')](handleEntityNotFound(_0x1134da,null))[_0xb1a6('0x27')](removeEntity(_0x1134da,null))[_0xb1a6('0x47')](handleError(_0x1134da,null));};exports[_0xb1a6('0x58')]=function(_0x42132f,_0x3dea7c){return db[_0xb1a6('0x2f')][_0xb1a6('0x58')]()[_0xb1a6('0x27')](respondWithResult(_0x3dea7c,null))['catch'](handleError(_0x3dea7c,null));};exports[_0xb1a6('0x59')]=function(_0x5d6e64,_0x47f89a,_0x3d7bb1){var _0x38d569={'raw':!![],'where':{}},_0x567eb0={},_0x583278;return db['MailQueue'][_0xb1a6('0x5a')]({'where':{'id':_0x5d6e64[_0xb1a6('0x49')]['id']}})[_0xb1a6('0x27')](handleEntityNotFound(_0x47f89a,null))[_0xb1a6('0x27')](function(_0x66efc4){if(_0x66efc4){_0x583278=_0x66efc4[_0xb1a6('0x4e')]({'plain':!![]});_0x567eb0[_0xb1a6('0x34')]=_[_0xb1a6('0x36')](db[_0xb1a6('0x5b')][_0xb1a6('0x30')]);_0x567eb0[_0xb1a6('0x35')]=_['keys'](_0x5d6e64['query']);_0x567eb0[_0xb1a6('0x37')]=_[_0xb1a6('0x38')](_0x567eb0['model'],_0x567eb0[_0xb1a6('0x35')]);_0x38d569['attributes']=_[_0xb1a6('0x38')](_0x567eb0['model'],qs[_0xb1a6('0x4a')](_0x5d6e64['query'][_0xb1a6('0x4a')]));_0x38d569[_0xb1a6('0x39')]=_0x38d569[_0xb1a6('0x39')][_0xb1a6('0x3a')]?_0x38d569['attributes']:_0x567eb0[_0xb1a6('0x34')];if(!_0x5d6e64[_0xb1a6('0x35')][_0xb1a6('0x3b')]('nolimit')){_0x38d569[_0xb1a6('0x22')]=qs[_0xb1a6('0x22')](_0x5d6e64['query'][_0xb1a6('0x22')]);_0x38d569[_0xb1a6('0x1f')]=qs[_0xb1a6('0x1f')](_0x5d6e64['query'][_0xb1a6('0x1f')]);}_0x38d569[_0xb1a6('0x5c')]=qs[_0xb1a6('0x3d')](_0x5d6e64[_0xb1a6('0x35')][_0xb1a6('0x3d')]);_0x38d569[_0xb1a6('0x3e')]=qs['filters'](_[_0xb1a6('0x3f')](_0x5d6e64[_0xb1a6('0x35')],_0x567eb0[_0xb1a6('0x37')]));_0x38d569[_0xb1a6('0x3e')][_0xb1a6('0x5d')]=_0x66efc4['id'];if(_0x5d6e64['query'][_0xb1a6('0x40')]){_0x38d569[_0xb1a6('0x3e')]=_[_0xb1a6('0x41')](_0x38d569['where'],{'$or':_['map'](_0x38d569[_0xb1a6('0x39')],function(_0x37a965){var _0x233c47={};_0x233c47[_0x37a965]={'$like':'%'+_0x5d6e64[_0xb1a6('0x35')][_0xb1a6('0x40')]+'%'};return _0x233c47;})});}_0x38d569=_['merge']({},_0x38d569,_0x5d6e64[_0xb1a6('0x43')]);return db['UserMailQueue'][_0xb1a6('0x46')](_0x38d569);}})[_0xb1a6('0x27')](function(_0x321af9){if(_0x321af9){return db[_0xb1a6('0x5e')][_0xb1a6('0x5f')]({'where':{'id':_[_0xb1a6('0x2e')](_0x321af9,_0xb1a6('0x60')),'role':_0xb1a6('0x61')},'attributes':['id','name',_0xb1a6('0x62'),_0xb1a6('0x63'),_0xb1a6('0x64')]});}})[_0xb1a6('0x27')](function(_0x18aca9){if(_0x18aca9){return{'count':_0x18aca9[_0xb1a6('0x21')],'rows':_[_0xb1a6('0x2e')](_0x18aca9[_0xb1a6('0x65')],function(_0x52fea8){return{'membername':_0x52fea8['name'],'UserId':_0x52fea8['id'],'queue_name':_0x583278[_0xb1a6('0x2c')],'MailQueueId':_0x583278['id'],'interface':util[_0xb1a6('0x66')](_0xb1a6('0x67'),_0xb1a6('0x68'),_0x52fea8[_0xb1a6('0x2c')]),'penalty':0x0,'paused':_0x52fea8['mailPause'],'createdAt':_0x52fea8[_0xb1a6('0x64')],'updatedAt':_0x52fea8['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xb1a6('0x27')](respondWithFilteredResult(_0x47f89a,_0x38d569))[_0xb1a6('0x47')](handleError(_0x47f89a,null));};exports[_0xb1a6('0x69')]=function(_0x46c703,_0x123f86,_0x44e4fb){var _0x4921b8={};var _0x4ea36d={};var _0x5b5008;var _0x4b2622;return db['MailQueue'][_0xb1a6('0x5a')]({'where':{'id':_0x46c703[_0xb1a6('0x49')]['id']}})[_0xb1a6('0x27')](handleEntityNotFound(_0x123f86,null))[_0xb1a6('0x27')](function(_0x5bc8b1){if(_0x5bc8b1){_0x5b5008=_0x5bc8b1;_0x4ea36d['model']=_['keys'](db[_0xb1a6('0x6a')][_0xb1a6('0x30')]);_0x4ea36d[_0xb1a6('0x35')]=_['keys'](_0x46c703[_0xb1a6('0x35')]);_0x4ea36d[_0xb1a6('0x37')]=_[_0xb1a6('0x38')](_0x4ea36d['model'],_0x4ea36d[_0xb1a6('0x35')]);_0x4921b8[_0xb1a6('0x39')]=_['intersection'](_0x4ea36d['model'],qs[_0xb1a6('0x4a')](_0x46c703[_0xb1a6('0x35')][_0xb1a6('0x4a')]));_0x4921b8[_0xb1a6('0x39')]=_0x4921b8[_0xb1a6('0x39')][_0xb1a6('0x3a')]?_0x4921b8['attributes']:_0x4ea36d[_0xb1a6('0x34')];_0x4921b8[_0xb1a6('0x5c')]=qs['sort'](_0x46c703[_0xb1a6('0x35')][_0xb1a6('0x3d')]);_0x4921b8[_0xb1a6('0x3e')]=qs['filters'](_[_0xb1a6('0x3f')](_0x46c703['query'],_0x4ea36d['filters']));if(_0x46c703[_0xb1a6('0x35')][_0xb1a6('0x40')]){_0x4921b8['where']=_[_0xb1a6('0x41')](_0x4921b8[_0xb1a6('0x3e')],{'$or':_['map'](_0x4921b8[_0xb1a6('0x39')],function(_0x45bffe){var _0x1f8b9e={};_0x1f8b9e[_0x45bffe]={'$like':'%'+_0x46c703[_0xb1a6('0x35')][_0xb1a6('0x40')]+'%'};return _0x1f8b9e;})});}_0x4921b8=_[_0xb1a6('0x41')]({},_0x4921b8,_0x46c703[_0xb1a6('0x43')]);return _0x5b5008[_0xb1a6('0x69')](_0x4921b8);}})[_0xb1a6('0x27')](function(_0x30c91f){if(_0x30c91f){_0x4b2622=_0x30c91f[_0xb1a6('0x3a')];if(!_0x46c703['query'][_0xb1a6('0x3b')](_0xb1a6('0x3c'))){_0x4921b8[_0xb1a6('0x22')]=qs[_0xb1a6('0x22')](_0x46c703['query'][_0xb1a6('0x22')]);_0x4921b8['offset']=qs['offset'](_0x46c703[_0xb1a6('0x35')][_0xb1a6('0x1f')]);}return _0x5b5008['getTeams'](_0x4921b8);}})['then'](function(_0x1a32ce){if(_0x1a32ce){return _0x1a32ce?{'count':_0x4b2622,'rows':_0x1a32ce}:null;}})['then'](respondWithResult(_0x123f86,null))['catch'](handleError(_0x123f86,null));};exports[_0xb1a6('0x6b')]=function(_0x3bbea4,_0x17fb44,_0x9c1932){var _0x42b115=_0x3bbea4['body'][_0xb1a6('0x6c')];return db[_0xb1a6('0x6a')][_0xb1a6('0x46')]({'where':{'id':_0x42b115},'attributes':['id'],'include':[{'model':db[_0xb1a6('0x5e')],'as':_0xb1a6('0x6d'),'attributes':['id',_0xb1a6('0x2c'),_0xb1a6('0x6e'),_0xb1a6('0x6f'),'interface'],'raw':!![]}]})['then'](function(_0x517f45){if(_0x517f45){var _0x47ca7a=_[_0xb1a6('0x70')](_0x517f45,function(_0x52e976){var _0x2eedcb=_0x52e976[_0xb1a6('0x4e')]({'plain':!![]});return _0x2eedcb[_0xb1a6('0x6d')];});return db[_0xb1a6('0x2f')][_0xb1a6('0x52')]({'where':{'id':_0x3bbea4[_0xb1a6('0x49')]['id']}})[_0xb1a6('0x27')](function(_0x8fb880){return db[_0xb1a6('0x71')]['transaction'](function(_0x27ee40){return _0x8fb880['addTeams'](_0x42b115,{'transaction':_0x27ee40})[_0xb1a6('0x27')](function(){return BPromise[_0xb1a6('0x72')](_0x47ca7a,function(_0x1c76df){return db[_0xb1a6('0x5b')][_0xb1a6('0x73')]({'where':{'UserId':_0x1c76df['id'],'MailQueueId':_0x3bbea4[_0xb1a6('0x49')]['id']},'transaction':_0x27ee40});});})[_0xb1a6('0x27')](function(){_0x47ca7a[_0xb1a6('0x74')](function(_0x2412e1){socket[_0xb1a6('0x75')]('userMailQueue:save',{'UserId':_0x2412e1['id'],'MailQueueId':_0x8fb880['id']});});});});});}})['then'](respondWithStatusCode(_0x17fb44,null))[_0xb1a6('0x47')](handleError(_0x17fb44,null));};exports[_0xb1a6('0x76')]=function(_0x10fd70,_0x21cbd4,_0x383efa){return db[_0xb1a6('0x6a')][_0xb1a6('0x46')]({'where':{'id':_0x10fd70[_0xb1a6('0x35')][_0xb1a6('0x6c')]},'attributes':['id'],'include':[{'model':db[_0xb1a6('0x5e')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xb1a6('0x27')](handleEntityNotFound(_0x21cbd4,null))[_0xb1a6('0x27')](function(_0x1343d8){var _0x43d527=_[_0xb1a6('0x2e')](_0x1343d8,'id');var _0x1e3668=[];var _0x5644b1=[];var _0x1d95aa=squel[_0xb1a6('0x77')]();_0x1d95aa['field'](_0xb1a6('0x78'))[_0xb1a6('0x79')](_0xb1a6('0x7a'),'tq')[_0xb1a6('0x7b')](_0xb1a6('0x7c'),'ut',_0xb1a6('0x7d'))['where'](_0xb1a6('0x7e'),_0x10fd70[_0xb1a6('0x49')]['id']);for(var _0xe65451=0x0;_0xe65451<_0x1343d8[_0xb1a6('0x3a')];_0xe65451+=0x1){let _0x573d35=_0x1343d8[_0xe65451];for(var _0x4c1f37=0x0;_0x4c1f37<_0x573d35[_0xb1a6('0x6d')]['length'];_0x4c1f37+=0x1){let _0xef9ecf=_0x573d35[_0xb1a6('0x6d')][_0x4c1f37];var _0x29103f=_0x1d95aa[_0xb1a6('0x7f')]();_0x29103f[_0xb1a6('0x3e')](_0xb1a6('0x80'),_0xef9ecf['id']);_0x5644b1[_0xb1a6('0x81')](db[_0xb1a6('0x71')][_0xb1a6('0x35')](_0x29103f[_0xb1a6('0x82')](),{'type':db['sequelize'][_0xb1a6('0x83')][_0xb1a6('0x84')]})[_0xb1a6('0x27')](function(_0x57ee24){if(_0x57ee24[_0xb1a6('0x3a')]===0x1){return _0xef9ecf['id'];}else{var _0x230699=_[_0xb1a6('0x85')](_[_0xb1a6('0x2e')](_0x57ee24,_0xb1a6('0x86')),function(_0x6dfee8){return _[_0xb1a6('0x87')](_0x43d527,_0x6dfee8);});if(_0x230699){return _0xef9ecf['id'];}}}));}}return BPromise[_0xb1a6('0x88')](_0x5644b1)[_0xb1a6('0x27')](function(_0x57f994){_0x1e3668=_(_0x1e3668)[_0xb1a6('0x89')](_0x57f994)[_0xb1a6('0x8a')]()[_0xb1a6('0x8b')]();return db['MailQueue']['find']({'where':{'id':_0x10fd70[_0xb1a6('0x49')]['id']}})[_0xb1a6('0x27')](function(_0x540551){return db['sequelize'][_0xb1a6('0x8c')](function(_0x3a40af){return _0x540551[_0xb1a6('0x76')](_0x10fd70['query'][_0xb1a6('0x6c')],{'transaction':_0x3a40af})[_0xb1a6('0x27')](function(){if(!_[_0xb1a6('0x8d')](_0x1e3668)){return _0x540551[_0xb1a6('0x8e')](_0x1e3668,{'transaction':_0x3a40af});}})[_0xb1a6('0x27')](function(){_0x1e3668[_0xb1a6('0x74')](function(_0x4bf94d){socket[_0xb1a6('0x75')](_0xb1a6('0x8f'),{'UserId':_0x4bf94d,'MailQueueId':_0x540551['id']});});});});});});})[_0xb1a6('0x27')](respondWithStatusCode(_0x21cbd4,null))[_0xb1a6('0x47')](handleError(_0x21cbd4,null));};exports[_0xb1a6('0x90')]=function(_0x1091a5,_0x7d6812,_0x4fb5ea){return db['MailQueue']['find']({'where':{'id':_0x1091a5[_0xb1a6('0x49')]['id']}})[_0xb1a6('0x27')](handleEntityNotFound(_0x7d6812,null))['then'](function(_0x203dac){if(_0x203dac){return _0x203dac[_0xb1a6('0x90')](_0x1091a5['body'][_0xb1a6('0x6c')],_[_0xb1a6('0x91')](_0x1091a5[_0xb1a6('0x4c')],[_0xb1a6('0x6c'),'id'])||{})[_0xb1a6('0x92')](function(_0x38f2f4){for(var _0x4d72c7=0x0;_0x4d72c7<_0x1091a5[_0xb1a6('0x4c')]['ids'][_0xb1a6('0x3a')];_0x4d72c7+=0x1){socket[_0xb1a6('0x75')](_0xb1a6('0x93'),{'UserId':Number(_0x1091a5[_0xb1a6('0x4c')][_0xb1a6('0x6c')][_0x4d72c7]),'MailQueueId':Number(_0x1091a5[_0xb1a6('0x49')]['id'])});}return _0x38f2f4;});}})['then'](respondWithResult(_0x7d6812,null))[_0xb1a6('0x47')](handleError(_0x7d6812,null));};exports['removeAgents']=function(_0x597e6a,_0x545206,_0x533264){return db[_0xb1a6('0x2f')][_0xb1a6('0x52')]({'where':{'id':_0x597e6a[_0xb1a6('0x49')]['id']}})[_0xb1a6('0x27')](handleEntityNotFound(_0x545206,null))[_0xb1a6('0x27')](function(_0x37ec4c){if(_0x37ec4c){return _0x37ec4c['removeAgents'](_0x597e6a[_0xb1a6('0x35')][_0xb1a6('0x6c')])[_0xb1a6('0x27')](function(){if(_[_0xb1a6('0x94')](_0x597e6a[_0xb1a6('0x35')][_0xb1a6('0x6c')])){for(var _0x8b4b2f=0x0;_0x8b4b2f<_0x597e6a[_0xb1a6('0x35')][_0xb1a6('0x6c')][_0xb1a6('0x3a')];_0x8b4b2f+=0x1){socket[_0xb1a6('0x75')](_0xb1a6('0x8f'),{'UserId':Number(_0x597e6a[_0xb1a6('0x35')]['ids'][_0x8b4b2f]),'MailQueueId':Number(_0x597e6a[_0xb1a6('0x49')]['id'])});}}else{socket[_0xb1a6('0x75')](_0xb1a6('0x8f'),{'UserId':Number(_0x597e6a['query'][_0xb1a6('0x6c')]),'MailQueueId':Number(_0x597e6a[_0xb1a6('0x49')]['id'])});}});}})[_0xb1a6('0x27')](respondWithStatusCode(_0x545206,null))[_0xb1a6('0x47')](handleError(_0x545206,null));};exports[_0xb1a6('0x95')]=function(_0x47900e,_0x5ab073,_0x57a208){var _0x16e4e7={};var _0x3ed82f={};var _0x18590f;var _0x5d6684;return db[_0xb1a6('0x2f')][_0xb1a6('0x5a')]({'where':{'id':_0x47900e['params']['id']}})[_0xb1a6('0x27')](handleEntityNotFound(_0x5ab073,null))['then'](function(_0x75d53d){if(_0x75d53d){_0x18590f=_0x75d53d;_0x3ed82f['model']=_[_0xb1a6('0x36')](db[_0xb1a6('0x5e')][_0xb1a6('0x30')]);_0x3ed82f['query']=_[_0xb1a6('0x36')](_0x47900e[_0xb1a6('0x35')]);_0x3ed82f[_0xb1a6('0x37')]=_['intersection'](_0x3ed82f[_0xb1a6('0x34')],_0x3ed82f['query']);_0x16e4e7['attributes']=_[_0xb1a6('0x38')](_0x3ed82f[_0xb1a6('0x34')],qs['fields'](_0x47900e[_0xb1a6('0x35')][_0xb1a6('0x4a')]));_0x16e4e7[_0xb1a6('0x39')]=_0x16e4e7[_0xb1a6('0x39')][_0xb1a6('0x3a')]?_0x16e4e7[_0xb1a6('0x39')]:_0x3ed82f[_0xb1a6('0x34')];_0x16e4e7[_0xb1a6('0x5c')]=qs[_0xb1a6('0x3d')](_0x47900e['query'][_0xb1a6('0x3d')]);_0x16e4e7[_0xb1a6('0x3e')]=qs[_0xb1a6('0x37')](_['pick'](_0x47900e[_0xb1a6('0x35')],_0x3ed82f[_0xb1a6('0x37')]));if(_0x47900e[_0xb1a6('0x35')][_0xb1a6('0x40')]){_0x16e4e7['where']=_[_0xb1a6('0x41')](_0x16e4e7[_0xb1a6('0x3e')],{'$or':_['map'](_0x16e4e7['attributes'],function(_0x5d3aaa){var _0x50e1fa={};_0x50e1fa[_0x5d3aaa]={'$like':'%'+_0x47900e[_0xb1a6('0x35')][_0xb1a6('0x40')]+'%'};return _0x50e1fa;})});}_0x16e4e7=_[_0xb1a6('0x41')]({},_0x16e4e7,_0x47900e[_0xb1a6('0x43')]);return _0x18590f['getAgents'](_0x16e4e7);}})[_0xb1a6('0x27')](function(_0x388542){if(_0x388542){_0x5d6684=_0x388542['length'];if(!_0x47900e[_0xb1a6('0x35')][_0xb1a6('0x3b')](_0xb1a6('0x3c'))){_0x16e4e7['limit']=qs[_0xb1a6('0x22')](_0x47900e[_0xb1a6('0x35')]['limit']);_0x16e4e7['offset']=qs[_0xb1a6('0x1f')](_0x47900e[_0xb1a6('0x35')][_0xb1a6('0x1f')]);}return _0x18590f['getAgents'](_0x16e4e7);}})[_0xb1a6('0x27')](function(_0x4ba5a9){if(_0x4ba5a9){return _0x4ba5a9?{'count':_0x5d6684,'rows':_0x4ba5a9}:null;}})[_0xb1a6('0x27')](respondWithResult(_0x5ab073,null))[_0xb1a6('0x47')](handleError(_0x5ab073,null));};
\ No newline at end of file
+var _0xe1a8=['defaults','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','get','UserProfileResource','error','stack','name','index','map','MailQueue','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','include','findAll','catch','show','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','getMembers','MailQueueId','options','UserMailQueue','User','findAndCountAll','mailPause','updatedAt','rows','format','%s/%s','SIP','createdAt','getTeams','findOne','addTeams','Team','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','removeTeams','ids','select','field','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','union','compact','isEmpty','emit','userMailQueue:remove','addAgents','spread','userMailQueue:save','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','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','redis'];(function(_0x26da89,_0x264785){var _0xc95b7b=function(_0x230e5b){while(--_0x230e5b){_0x26da89['push'](_0x26da89['shift']());}};_0xc95b7b(++_0x264785);}(_0xe1a8,0x6f));var _0x8e1a=function(_0x5ea211,_0x4da2af){_0x5ea211=_0x5ea211-0x0;var _0x12f9c9=_0xe1a8[_0x5ea211];return _0x12f9c9;};'use strict';var emlformat=require(_0x8e1a('0x0'));var rimraf=require(_0x8e1a('0x1'));var zipdir=require(_0x8e1a('0x2'));var jsonpatch=require(_0x8e1a('0x3'));var rp=require(_0x8e1a('0x4'));var moment=require(_0x8e1a('0x5'));var BPromise=require(_0x8e1a('0x6'));var Mustache=require(_0x8e1a('0x7'));var util=require('util');var path=require(_0x8e1a('0x8'));var sox=require('sox');var csv=require(_0x8e1a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8e1a('0xa'));var _=require('lodash');var squel=require(_0x8e1a('0xb'));var crypto=require(_0x8e1a('0xc'));var jsforce=require(_0x8e1a('0xd'));var deskjs=require(_0x8e1a('0xe'));var toCsv=require(_0x8e1a('0x9'));var querystring=require(_0x8e1a('0xf'));var Papa=require('papaparse');var Redis=require(_0x8e1a('0x10'));var authService=require(_0x8e1a('0x11'));var qs=require(_0x8e1a('0x12'));var as=require(_0x8e1a('0x13'));var hardwareService=require(_0x8e1a('0x14'));var logger=require('../../config/logger')(_0x8e1a('0x15'));var utils=require(_0x8e1a('0x16'));var config=require(_0x8e1a('0x17'));var licenseUtil=require(_0x8e1a('0x18'));var db=require('../../mysqldb')['db'];config[_0x8e1a('0x19')]=_[_0x8e1a('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8e1a('0x1b'))(new Redis(config[_0x8e1a('0x19')]));require(_0x8e1a('0x1c'))[_0x8e1a('0x1d')](socket);function respondWithStatusCode(_0x9f86b,_0x282c68){_0x282c68=_0x282c68||0xcc;return function(_0x2aa9a8){if(_0x2aa9a8){return _0x9f86b[_0x8e1a('0x1e')](_0x282c68);}return _0x9f86b[_0x8e1a('0x1f')](_0x282c68)['end']();};}function respondWithResult(_0x2a6a5c,_0x90646d){_0x90646d=_0x90646d||0xc8;return function(_0xbdb82a){if(_0xbdb82a){return _0x2a6a5c[_0x8e1a('0x1f')](_0x90646d)[_0x8e1a('0x20')](_0xbdb82a);}};}function respondWithFilteredResult(_0x4b3578,_0x238cde){return function(_0x2147b6){if(_0x2147b6){var _0x52e183=typeof _0x238cde[_0x8e1a('0x21')]===_0x8e1a('0x22')&&typeof _0x238cde[_0x8e1a('0x23')]===_0x8e1a('0x22');var _0x532089=_0x2147b6['count'];var _0x333287=_0x52e183?0x0:_0x238cde[_0x8e1a('0x21')];var _0x500121=_0x52e183?_0x2147b6[_0x8e1a('0x24')]:_0x238cde[_0x8e1a('0x21')]+_0x238cde[_0x8e1a('0x23')];var _0x3ce109;if(_0x500121>=_0x532089){_0x500121=_0x532089;_0x3ce109=0xc8;}else{_0x3ce109=0xce;}_0x4b3578['status'](_0x3ce109);return _0x4b3578[_0x8e1a('0x25')](_0x8e1a('0x26'),_0x333287+'-'+_0x500121+'/'+_0x532089)[_0x8e1a('0x20')](_0x2147b6);}return null;};}function patchUpdates(_0x494923){return function(_0x159d9a){try{jsonpatch[_0x8e1a('0x27')](_0x159d9a,_0x494923,!![]);}catch(_0x1f54e6){return BPromise[_0x8e1a('0x28')](_0x1f54e6);}return _0x159d9a['save']();};}function saveUpdates(_0x776a9,_0x393850){return function(_0x511923){if(_0x511923){return _0x511923['update'](_0x776a9)[_0x8e1a('0x29')](function(_0x3c6fe8){return _0x3c6fe8;});}return null;};}function removeEntity(_0xd1fac0,_0x5478bc){return function(_0x219ae1){if(_0x219ae1){return _0x219ae1[_0x8e1a('0x2a')]()[_0x8e1a('0x29')](function(){var _0x1af515=_0x219ae1[_0x8e1a('0x2b')]({'plain':!![]});var _0x115d43='MailQueues';return db[_0x8e1a('0x2c')][_0x8e1a('0x2a')]({'where':{'type':_0x115d43,'resourceId':_0x1af515['id']}})[_0x8e1a('0x29')](function(){return _0x219ae1;});})['then'](function(){_0xd1fac0[_0x8e1a('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22d478,_0x376641){return function(_0x5d104c){if(!_0x5d104c){_0x22d478[_0x8e1a('0x1e')](0x194);}return _0x5d104c;};}function handleError(_0x1597d5,_0x109988){_0x109988=_0x109988||0x1f4;return function(_0x2de127){logger[_0x8e1a('0x2d')](_0x2de127[_0x8e1a('0x2e')]);if(_0x2de127[_0x8e1a('0x2f')]){delete _0x2de127['name'];}_0x1597d5[_0x8e1a('0x1f')](_0x109988)['send'](_0x2de127);};}exports[_0x8e1a('0x30')]=function(_0x812345,_0x196a7d){var _0x18ed70={},_0x3ca44f={},_0x190db7={'count':0x0,'rows':[]};var _0xf83704=_[_0x8e1a('0x31')](db[_0x8e1a('0x32')][_0x8e1a('0x33')],function(_0x32470a){return{'name':_0x32470a['fieldName'],'type':_0x32470a[_0x8e1a('0x34')]['key']};});_0x3ca44f['model']=_[_0x8e1a('0x31')](_0xf83704,_0x8e1a('0x2f'));_0x3ca44f[_0x8e1a('0x35')]=_[_0x8e1a('0x36')](_0x812345[_0x8e1a('0x35')]);_0x3ca44f[_0x8e1a('0x37')]=_[_0x8e1a('0x38')](_0x3ca44f[_0x8e1a('0x39')],_0x3ca44f[_0x8e1a('0x35')]);_0x18ed70[_0x8e1a('0x3a')]=_['intersection'](_0x3ca44f[_0x8e1a('0x39')],qs[_0x8e1a('0x3b')](_0x812345[_0x8e1a('0x35')][_0x8e1a('0x3b')]));_0x18ed70['attributes']=_0x18ed70[_0x8e1a('0x3a')][_0x8e1a('0x3c')]?_0x18ed70[_0x8e1a('0x3a')]:_0x3ca44f[_0x8e1a('0x39')];if(!_0x812345['query'][_0x8e1a('0x3d')](_0x8e1a('0x3e'))){_0x18ed70['limit']=qs[_0x8e1a('0x23')](_0x812345[_0x8e1a('0x35')]['limit']);_0x18ed70[_0x8e1a('0x21')]=qs['offset'](_0x812345[_0x8e1a('0x35')][_0x8e1a('0x21')]);}_0x18ed70[_0x8e1a('0x3f')]=qs[_0x8e1a('0x40')](_0x812345[_0x8e1a('0x35')][_0x8e1a('0x40')]);_0x18ed70[_0x8e1a('0x41')]=qs[_0x8e1a('0x37')](_[_0x8e1a('0x42')](_0x812345[_0x8e1a('0x35')],_0x3ca44f[_0x8e1a('0x37')]),_0xf83704);if(_0x812345[_0x8e1a('0x35')]['filter']){_0x18ed70['where']=_[_0x8e1a('0x43')](_0x18ed70[_0x8e1a('0x41')],{'$or':_[_0x8e1a('0x31')](_0xf83704,function(_0x8c3a42){if(_0x8c3a42['type']!==_0x8e1a('0x44')){var _0x56b83d={};_0x56b83d[_0x8c3a42[_0x8e1a('0x2f')]]={'$like':'%'+_0x812345[_0x8e1a('0x35')][_0x8e1a('0x45')]+'%'};return _0x56b83d;}})});}_0x18ed70=_['merge']({},_0x18ed70,_0x812345['options']);var _0x4ed810={'where':_0x18ed70[_0x8e1a('0x41')]};return db[_0x8e1a('0x32')][_0x8e1a('0x24')](_0x4ed810)[_0x8e1a('0x29')](function(_0x38518a){_0x190db7[_0x8e1a('0x24')]=_0x38518a;if(_0x812345[_0x8e1a('0x35')]['includeAll']){_0x18ed70[_0x8e1a('0x46')]=[{'all':!![]}];}return db[_0x8e1a('0x32')][_0x8e1a('0x47')](_0x18ed70);})['then'](function(_0x558c7d){_0x190db7['rows']=_0x558c7d;return _0x190db7;})[_0x8e1a('0x29')](respondWithFilteredResult(_0x196a7d,_0x18ed70))[_0x8e1a('0x48')](handleError(_0x196a7d,null));};exports[_0x8e1a('0x49')]=function(_0x2299b5,_0x15771c){var _0x19c2a6={'raw':!![],'where':{'id':_0x2299b5['params']['id']}},_0x2653bc={};_0x2653bc[_0x8e1a('0x39')]=_[_0x8e1a('0x36')](db[_0x8e1a('0x32')][_0x8e1a('0x33')]);_0x2653bc[_0x8e1a('0x35')]=_[_0x8e1a('0x36')](_0x2299b5[_0x8e1a('0x35')]);_0x2653bc[_0x8e1a('0x37')]=_['intersection'](_0x2653bc[_0x8e1a('0x39')],_0x2653bc[_0x8e1a('0x35')]);_0x19c2a6[_0x8e1a('0x3a')]=_[_0x8e1a('0x38')](_0x2653bc[_0x8e1a('0x39')],qs[_0x8e1a('0x3b')](_0x2299b5['query'][_0x8e1a('0x3b')]));_0x19c2a6[_0x8e1a('0x3a')]=_0x19c2a6[_0x8e1a('0x3a')][_0x8e1a('0x3c')]?_0x19c2a6['attributes']:_0x2653bc[_0x8e1a('0x39')];if(_0x2299b5[_0x8e1a('0x35')][_0x8e1a('0x4a')]){_0x19c2a6[_0x8e1a('0x46')]=[{'all':!![]}];}_0x19c2a6=_[_0x8e1a('0x43')]({},_0x19c2a6,_0x2299b5['options']);return db[_0x8e1a('0x32')]['find'](_0x19c2a6)[_0x8e1a('0x29')](handleEntityNotFound(_0x15771c,null))[_0x8e1a('0x29')](respondWithResult(_0x15771c,null))[_0x8e1a('0x48')](handleError(_0x15771c,null));};exports[_0x8e1a('0x4b')]=function(_0x6ec9d1,_0x3b3667){return db[_0x8e1a('0x32')][_0x8e1a('0x4b')](_0x6ec9d1[_0x8e1a('0x4c')],{})[_0x8e1a('0x29')](function(_0x4e05c6){var _0x56c9c7=_0x6ec9d1[_0x8e1a('0x4d')][_0x8e1a('0x2b')]({'plain':!![]});if(!_0x56c9c7)throw new Error(_0x8e1a('0x4e'));if(_0x56c9c7['role']==='user'){var _0x234054=_0x4e05c6[_0x8e1a('0x2b')]({'plain':!![]});var _0x3c48a6='MailQueues';return db[_0x8e1a('0x4f')][_0x8e1a('0x50')]({'where':{'name':_0x3c48a6,'userProfileId':_0x56c9c7['userProfileId']},'raw':!![]})[_0x8e1a('0x29')](function(_0x37f568){if(_0x37f568&&_0x37f568['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x234054[_0x8e1a('0x2f')],'resourceId':_0x234054['id'],'type':_0x37f568[_0x8e1a('0x2f')],'sectionId':_0x37f568['id']},{})['then'](function(){return _0x4e05c6;});}else{return _0x4e05c6;}})[_0x8e1a('0x48')](function(_0x40e5e5){logger[_0x8e1a('0x2d')](_0x8e1a('0x51'),_0x40e5e5);throw _0x40e5e5;});}return _0x4e05c6;})[_0x8e1a('0x29')](respondWithResult(_0x3b3667,0xc9))[_0x8e1a('0x48')](handleError(_0x3b3667,null));};exports[_0x8e1a('0x52')]=function(_0x17f272,_0x231202){if(_0x17f272[_0x8e1a('0x4c')]['id']){delete _0x17f272[_0x8e1a('0x4c')]['id'];}return db['MailQueue'][_0x8e1a('0x50')]({'where':{'id':_0x17f272['params']['id']}})[_0x8e1a('0x29')](handleEntityNotFound(_0x231202,null))[_0x8e1a('0x29')](saveUpdates(_0x17f272['body'],null))[_0x8e1a('0x29')](respondWithResult(_0x231202,null))[_0x8e1a('0x48')](handleError(_0x231202,null));};exports['destroy']=function(_0x59d970,_0x5c7a83){return db[_0x8e1a('0x32')][_0x8e1a('0x50')]({'where':{'id':_0x59d970[_0x8e1a('0x53')]['id']}})['then'](handleEntityNotFound(_0x5c7a83,null))[_0x8e1a('0x29')](removeEntity(_0x5c7a83,null))[_0x8e1a('0x48')](handleError(_0x5c7a83,null));};exports[_0x8e1a('0x54')]=function(_0x1f4773,_0x17cbfd){return db[_0x8e1a('0x32')][_0x8e1a('0x54')]()[_0x8e1a('0x29')](respondWithResult(_0x17cbfd,null))[_0x8e1a('0x48')](handleError(_0x17cbfd,null));};exports[_0x8e1a('0x55')]=function(_0x5cc37e,_0x50ab52,_0x18bf80){var _0x2a217f={'raw':!![],'where':{}},_0x3bb161={},_0x3d3bcf;return db[_0x8e1a('0x32')]['findOne']({'where':{'id':_0x5cc37e[_0x8e1a('0x53')]['id']}})[_0x8e1a('0x29')](handleEntityNotFound(_0x50ab52,null))[_0x8e1a('0x29')](function(_0x53f738){if(_0x53f738){_0x3d3bcf=_0x53f738['get']({'plain':!![]});_0x3bb161[_0x8e1a('0x39')]=_[_0x8e1a('0x36')](db['UserMailQueue']['rawAttributes']);_0x3bb161[_0x8e1a('0x35')]=_['keys'](_0x5cc37e[_0x8e1a('0x35')]);_0x3bb161['filters']=_['intersection'](_0x3bb161['model'],_0x3bb161['query']);_0x2a217f[_0x8e1a('0x3a')]=_['intersection'](_0x3bb161[_0x8e1a('0x39')],qs[_0x8e1a('0x3b')](_0x5cc37e[_0x8e1a('0x35')][_0x8e1a('0x3b')]));_0x2a217f[_0x8e1a('0x3a')]=_0x2a217f[_0x8e1a('0x3a')][_0x8e1a('0x3c')]?_0x2a217f[_0x8e1a('0x3a')]:_0x3bb161[_0x8e1a('0x39')];if(!_0x5cc37e[_0x8e1a('0x35')][_0x8e1a('0x3d')]('nolimit')){_0x2a217f[_0x8e1a('0x23')]=qs['limit'](_0x5cc37e['query'][_0x8e1a('0x23')]);_0x2a217f[_0x8e1a('0x21')]=qs[_0x8e1a('0x21')](_0x5cc37e[_0x8e1a('0x35')][_0x8e1a('0x21')]);}_0x2a217f[_0x8e1a('0x3f')]=qs['sort'](_0x5cc37e[_0x8e1a('0x35')]['sort']);_0x2a217f['where']=qs['filters'](_['pick'](_0x5cc37e['query'],_0x3bb161['filters']));_0x2a217f[_0x8e1a('0x41')][_0x8e1a('0x56')]=_0x53f738['id'];if(_0x5cc37e[_0x8e1a('0x35')][_0x8e1a('0x45')]){_0x2a217f['where']=_['merge'](_0x2a217f[_0x8e1a('0x41')],{'$or':_[_0x8e1a('0x31')](_0x2a217f['attributes'],function(_0x270b28){var _0x300ac7={};_0x300ac7[_0x270b28]={'$like':'%'+_0x5cc37e[_0x8e1a('0x35')][_0x8e1a('0x45')]+'%'};return _0x300ac7;})});}_0x2a217f=_[_0x8e1a('0x43')]({},_0x2a217f,_0x5cc37e[_0x8e1a('0x57')]);return db[_0x8e1a('0x58')][_0x8e1a('0x47')](_0x2a217f);}})['then'](function(_0x223a7a){if(_0x223a7a){return db[_0x8e1a('0x59')][_0x8e1a('0x5a')]({'where':{'id':_[_0x8e1a('0x31')](_0x223a7a,'UserId'),'role':'agent'},'attributes':['id',_0x8e1a('0x2f'),_0x8e1a('0x5b'),_0x8e1a('0x5c'),'createdAt']});}})[_0x8e1a('0x29')](function(_0x38b2ca){if(_0x38b2ca){return{'count':_0x38b2ca[_0x8e1a('0x24')],'rows':_[_0x8e1a('0x31')](_0x38b2ca[_0x8e1a('0x5d')],function(_0x531f21){return{'membername':_0x531f21['name'],'UserId':_0x531f21['id'],'queue_name':_0x3d3bcf[_0x8e1a('0x2f')],'MailQueueId':_0x3d3bcf['id'],'interface':util[_0x8e1a('0x5e')](_0x8e1a('0x5f'),_0x8e1a('0x60'),_0x531f21[_0x8e1a('0x2f')]),'penalty':0x0,'paused':_0x531f21[_0x8e1a('0x5b')],'createdAt':_0x531f21[_0x8e1a('0x61')],'updatedAt':_0x531f21[_0x8e1a('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8e1a('0x29')](respondWithFilteredResult(_0x50ab52,_0x2a217f))[_0x8e1a('0x48')](handleError(_0x50ab52,null));};exports[_0x8e1a('0x62')]=function(_0x2307c1,_0x263ee5,_0x3a0b61){var _0x323764={};var _0x4c9fda={};var _0x47361d;var _0x3b463c;return db[_0x8e1a('0x32')][_0x8e1a('0x63')]({'where':{'id':_0x2307c1['params']['id']}})[_0x8e1a('0x29')](handleEntityNotFound(_0x263ee5,null))[_0x8e1a('0x29')](function(_0x1ae79d){if(_0x1ae79d){_0x47361d=_0x1ae79d;_0x4c9fda[_0x8e1a('0x39')]=_[_0x8e1a('0x36')](db['Team']['rawAttributes']);_0x4c9fda[_0x8e1a('0x35')]=_[_0x8e1a('0x36')](_0x2307c1[_0x8e1a('0x35')]);_0x4c9fda['filters']=_['intersection'](_0x4c9fda[_0x8e1a('0x39')],_0x4c9fda[_0x8e1a('0x35')]);_0x323764[_0x8e1a('0x3a')]=_[_0x8e1a('0x38')](_0x4c9fda[_0x8e1a('0x39')],qs['fields'](_0x2307c1[_0x8e1a('0x35')][_0x8e1a('0x3b')]));_0x323764[_0x8e1a('0x3a')]=_0x323764['attributes'][_0x8e1a('0x3c')]?_0x323764[_0x8e1a('0x3a')]:_0x4c9fda['model'];_0x323764[_0x8e1a('0x3f')]=qs[_0x8e1a('0x40')](_0x2307c1[_0x8e1a('0x35')][_0x8e1a('0x40')]);_0x323764[_0x8e1a('0x41')]=qs['filters'](_[_0x8e1a('0x42')](_0x2307c1[_0x8e1a('0x35')],_0x4c9fda[_0x8e1a('0x37')]));if(_0x2307c1[_0x8e1a('0x35')][_0x8e1a('0x45')]){_0x323764[_0x8e1a('0x41')]=_['merge'](_0x323764[_0x8e1a('0x41')],{'$or':_[_0x8e1a('0x31')](_0x323764[_0x8e1a('0x3a')],function(_0x519f94){var _0x53bf36={};_0x53bf36[_0x519f94]={'$like':'%'+_0x2307c1[_0x8e1a('0x35')][_0x8e1a('0x45')]+'%'};return _0x53bf36;})});}_0x323764=_[_0x8e1a('0x43')]({},_0x323764,_0x2307c1[_0x8e1a('0x57')]);return _0x47361d[_0x8e1a('0x62')](_0x323764);}})['then'](function(_0x242a19){if(_0x242a19){_0x3b463c=_0x242a19[_0x8e1a('0x3c')];if(!_0x2307c1[_0x8e1a('0x35')][_0x8e1a('0x3d')]('nolimit')){_0x323764['limit']=qs[_0x8e1a('0x23')](_0x2307c1[_0x8e1a('0x35')][_0x8e1a('0x23')]);_0x323764[_0x8e1a('0x21')]=qs[_0x8e1a('0x21')](_0x2307c1[_0x8e1a('0x35')][_0x8e1a('0x21')]);}return _0x47361d[_0x8e1a('0x62')](_0x323764);}})['then'](function(_0x3239a9){if(_0x3239a9){return _0x3239a9?{'count':_0x3b463c,'rows':_0x3239a9}:null;}})[_0x8e1a('0x29')](respondWithResult(_0x263ee5,null))[_0x8e1a('0x48')](handleError(_0x263ee5,null));};exports[_0x8e1a('0x64')]=function(_0x46348d,_0x5a4790,_0x21dafb){var _0x435531=_0x46348d[_0x8e1a('0x4c')]['ids'];return db[_0x8e1a('0x65')][_0x8e1a('0x47')]({'where':{'id':_0x435531},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8e1a('0x66'),'attributes':['id','name',_0x8e1a('0x67'),_0x8e1a('0x68'),_0x8e1a('0x69')],'raw':!![]}]})[_0x8e1a('0x29')](function(_0x140cfd){if(_0x140cfd){var _0x3e94b2=_['flatMap'](_0x140cfd,function(_0x50c97f){var _0x367b66=_0x50c97f[_0x8e1a('0x2b')]({'plain':!![]});return _0x367b66['Agents'];});return db['MailQueue'][_0x8e1a('0x50')]({'where':{'id':_0x46348d[_0x8e1a('0x53')]['id']}})[_0x8e1a('0x29')](function(_0x1c2f56){return db[_0x8e1a('0x6a')][_0x8e1a('0x6b')](function(_0x25b6e2){return _0x1c2f56[_0x8e1a('0x64')](_0x435531,{'transaction':_0x25b6e2})[_0x8e1a('0x29')](function(){return BPromise[_0x8e1a('0x6c')](_0x3e94b2,function(_0x13a204){return db[_0x8e1a('0x58')][_0x8e1a('0x6d')]({'where':{'UserId':_0x13a204['id'],'MailQueueId':_0x46348d[_0x8e1a('0x53')]['id']},'transaction':_0x25b6e2});});})[_0x8e1a('0x29')](function(){_0x3e94b2[_0x8e1a('0x6e')](function(_0x380fe0){socket['emit']('userMailQueue:save',{'UserId':_0x380fe0['id'],'MailQueueId':_0x1c2f56['id']});});});});});}})['then'](respondWithStatusCode(_0x5a4790,null))[_0x8e1a('0x48')](handleError(_0x5a4790,null));};exports[_0x8e1a('0x6f')]=function(_0x3e7c3a,_0x4fcd6b,_0x295c71){return db[_0x8e1a('0x65')][_0x8e1a('0x47')]({'where':{'id':_0x3e7c3a[_0x8e1a('0x35')][_0x8e1a('0x70')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4fcd6b,null))[_0x8e1a('0x29')](function(_0x1d8cca){var _0x159a85=_[_0x8e1a('0x31')](_0x1d8cca,'id');var _0x138a3a=[];var _0x36ec53=[];var _0x34d77e=squel[_0x8e1a('0x71')]();_0x34d77e[_0x8e1a('0x72')]('tq.TeamId')[_0x8e1a('0x73')]('team_has_mail_queues','tq')['join'](_0x8e1a('0x74'),'ut',_0x8e1a('0x75'))['where']('MailQueueId\x20=\x20?',_0x3e7c3a[_0x8e1a('0x53')]['id']);for(var _0x3cbd74=0x0;_0x3cbd74<_0x1d8cca[_0x8e1a('0x3c')];_0x3cbd74+=0x1){let _0x1e70db=_0x1d8cca[_0x3cbd74];for(var _0x243bf8=0x0;_0x243bf8<_0x1e70db[_0x8e1a('0x66')][_0x8e1a('0x3c')];_0x243bf8+=0x1){let _0x57885b=_0x1e70db[_0x8e1a('0x66')][_0x243bf8];var _0x4806dd=_0x34d77e[_0x8e1a('0x76')]();_0x4806dd['where'](_0x8e1a('0x77'),_0x57885b['id']);_0x36ec53[_0x8e1a('0x78')](db[_0x8e1a('0x6a')][_0x8e1a('0x35')](_0x4806dd[_0x8e1a('0x79')](),{'type':db['sequelize'][_0x8e1a('0x7a')][_0x8e1a('0x7b')]})[_0x8e1a('0x29')](function(_0x49d38b){if(_0x49d38b[_0x8e1a('0x3c')]===0x1){return _0x57885b['id'];}else{var _0x3d4c9c=_[_0x8e1a('0x7c')](_[_0x8e1a('0x31')](_0x49d38b,'TeamId'),function(_0x2f578b){return _[_0x8e1a('0x7d')](_0x159a85,_0x2f578b);});if(_0x3d4c9c){return _0x57885b['id'];}}}));}}return BPromise['all'](_0x36ec53)[_0x8e1a('0x29')](function(_0x17dc9b){_0x138a3a=_(_0x138a3a)[_0x8e1a('0x7e')](_0x17dc9b)[_0x8e1a('0x7f')]()['value']();return db[_0x8e1a('0x32')][_0x8e1a('0x50')]({'where':{'id':_0x3e7c3a[_0x8e1a('0x53')]['id']}})[_0x8e1a('0x29')](function(_0x73f6b5){return db[_0x8e1a('0x6a')][_0x8e1a('0x6b')](function(_0x1f69f9){return _0x73f6b5[_0x8e1a('0x6f')](_0x3e7c3a[_0x8e1a('0x35')][_0x8e1a('0x70')],{'transaction':_0x1f69f9})[_0x8e1a('0x29')](function(){if(!_[_0x8e1a('0x80')](_0x138a3a)){return _0x73f6b5['removeAgents'](_0x138a3a,{'transaction':_0x1f69f9});}})[_0x8e1a('0x29')](function(){_0x138a3a[_0x8e1a('0x6e')](function(_0x3021c9){socket[_0x8e1a('0x81')](_0x8e1a('0x82'),{'UserId':_0x3021c9,'MailQueueId':_0x73f6b5['id']});});});});});});})['then'](respondWithStatusCode(_0x4fcd6b,null))[_0x8e1a('0x48')](handleError(_0x4fcd6b,null));};exports[_0x8e1a('0x83')]=function(_0x41b878,_0x5ce1fa,_0x124c59){return db['MailQueue'][_0x8e1a('0x50')]({'where':{'id':_0x41b878[_0x8e1a('0x53')]['id']}})[_0x8e1a('0x29')](handleEntityNotFound(_0x5ce1fa,null))['then'](function(_0x533bc4){if(_0x533bc4){return _0x533bc4[_0x8e1a('0x83')](_0x41b878[_0x8e1a('0x4c')][_0x8e1a('0x70')],_['omit'](_0x41b878[_0x8e1a('0x4c')],[_0x8e1a('0x70'),'id'])||{})[_0x8e1a('0x84')](function(_0x3dd46d){for(var _0x3cddbc=0x0;_0x3cddbc<_0x41b878[_0x8e1a('0x4c')][_0x8e1a('0x70')][_0x8e1a('0x3c')];_0x3cddbc+=0x1){socket[_0x8e1a('0x81')](_0x8e1a('0x85'),{'UserId':Number(_0x41b878[_0x8e1a('0x4c')][_0x8e1a('0x70')][_0x3cddbc]),'MailQueueId':Number(_0x41b878['params']['id'])});}return _0x3dd46d;});}})[_0x8e1a('0x29')](respondWithResult(_0x5ce1fa,null))[_0x8e1a('0x48')](handleError(_0x5ce1fa,null));};exports[_0x8e1a('0x86')]=function(_0x45effd,_0x133f22,_0x3e58f4){return db[_0x8e1a('0x32')]['find']({'where':{'id':_0x45effd['params']['id']}})[_0x8e1a('0x29')](handleEntityNotFound(_0x133f22,null))[_0x8e1a('0x29')](function(_0x3053d2){if(_0x3053d2){return _0x3053d2[_0x8e1a('0x86')](_0x45effd[_0x8e1a('0x35')][_0x8e1a('0x70')])[_0x8e1a('0x29')](function(){if(_[_0x8e1a('0x87')](_0x45effd['query'][_0x8e1a('0x70')])){for(var _0x48d3e8=0x0;_0x48d3e8<_0x45effd[_0x8e1a('0x35')][_0x8e1a('0x70')]['length'];_0x48d3e8+=0x1){socket[_0x8e1a('0x81')](_0x8e1a('0x82'),{'UserId':Number(_0x45effd[_0x8e1a('0x35')][_0x8e1a('0x70')][_0x48d3e8]),'MailQueueId':Number(_0x45effd['params']['id'])});}}else{socket[_0x8e1a('0x81')](_0x8e1a('0x82'),{'UserId':Number(_0x45effd[_0x8e1a('0x35')][_0x8e1a('0x70')]),'MailQueueId':Number(_0x45effd[_0x8e1a('0x53')]['id'])});}});}})[_0x8e1a('0x29')](respondWithStatusCode(_0x133f22,null))['catch'](handleError(_0x133f22,null));};exports[_0x8e1a('0x88')]=function(_0x49038f,_0x1575b9,_0x582d48){var _0x2151e7={};var _0x32d41a={};var _0xaf2a8f;var _0x469b56;return db[_0x8e1a('0x32')][_0x8e1a('0x63')]({'where':{'id':_0x49038f[_0x8e1a('0x53')]['id']}})[_0x8e1a('0x29')](handleEntityNotFound(_0x1575b9,null))[_0x8e1a('0x29')](function(_0xd64742){if(_0xd64742){_0xaf2a8f=_0xd64742;_0x32d41a['model']=_[_0x8e1a('0x36')](db[_0x8e1a('0x59')][_0x8e1a('0x33')]);_0x32d41a[_0x8e1a('0x35')]=_[_0x8e1a('0x36')](_0x49038f[_0x8e1a('0x35')]);_0x32d41a[_0x8e1a('0x37')]=_[_0x8e1a('0x38')](_0x32d41a['model'],_0x32d41a[_0x8e1a('0x35')]);_0x2151e7[_0x8e1a('0x3a')]=_[_0x8e1a('0x38')](_0x32d41a[_0x8e1a('0x39')],qs[_0x8e1a('0x3b')](_0x49038f[_0x8e1a('0x35')]['fields']));_0x2151e7['attributes']=_0x2151e7[_0x8e1a('0x3a')]['length']?_0x2151e7[_0x8e1a('0x3a')]:_0x32d41a[_0x8e1a('0x39')];_0x2151e7[_0x8e1a('0x3f')]=qs[_0x8e1a('0x40')](_0x49038f[_0x8e1a('0x35')][_0x8e1a('0x40')]);_0x2151e7[_0x8e1a('0x41')]=qs[_0x8e1a('0x37')](_[_0x8e1a('0x42')](_0x49038f[_0x8e1a('0x35')],_0x32d41a[_0x8e1a('0x37')]));if(_0x49038f['query'][_0x8e1a('0x45')]){_0x2151e7['where']=_[_0x8e1a('0x43')](_0x2151e7[_0x8e1a('0x41')],{'$or':_[_0x8e1a('0x31')](_0x2151e7[_0x8e1a('0x3a')],function(_0x4b3941){var _0x5e0835={};_0x5e0835[_0x4b3941]={'$like':'%'+_0x49038f[_0x8e1a('0x35')]['filter']+'%'};return _0x5e0835;})});}_0x2151e7=_[_0x8e1a('0x43')]({},_0x2151e7,_0x49038f[_0x8e1a('0x57')]);return _0xaf2a8f['getAgents'](_0x2151e7);}})[_0x8e1a('0x29')](function(_0x19b340){if(_0x19b340){_0x469b56=_0x19b340['length'];if(!_0x49038f[_0x8e1a('0x35')]['hasOwnProperty'](_0x8e1a('0x3e'))){_0x2151e7[_0x8e1a('0x23')]=qs['limit'](_0x49038f[_0x8e1a('0x35')][_0x8e1a('0x23')]);_0x2151e7['offset']=qs[_0x8e1a('0x21')](_0x49038f['query']['offset']);}return _0xaf2a8f['getAgents'](_0x2151e7);}})['then'](function(_0x25138b){if(_0x25138b){return _0x25138b?{'count':_0x469b56,'rows':_0x25138b}:null;}})[_0x8e1a('0x29')](respondWithResult(_0x1575b9,null))[_0x8e1a('0x48')](handleError(_0x1575b9,null));};
\ No newline at end of file
index 4ac2005..7e86f68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x48db=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue'];(function(_0x2ade6f,_0x18d576){var _0x28fa0f=function(_0x4ad67c){while(--_0x4ad67c){_0x2ade6f['push'](_0x2ade6f['shift']());}};_0x28fa0f(++_0x18d576);}(_0x48db,0x183));var _0xb48d=function(_0x707cd,_0x34def9){_0x707cd=_0x707cd-0x0;var _0x29a71c=_0x48db[_0x707cd];return _0x29a71c;};'use strict';var EventEmitter=require(_0xb48d('0x0'));var MailQueue=require(_0xb48d('0x1'))['db'][_0xb48d('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb48d('0x3'),'afterUpdate':_0xb48d('0x4'),'afterDestroy':_0xb48d('0x5')};function emitEvent(_0x6cbd44){return function(_0x342129,_0x3b4274,_0x1de399){MailQueueEvents['emit'](_0x6cbd44+':'+_0x342129['id'],_0x342129);MailQueueEvents[_0xb48d('0x6')](_0x6cbd44,_0x342129);_0x1de399(null);};}for(var e in events){if(events[_0xb48d('0x7')](e)){var event=events[e];MailQueue[_0xb48d('0x8')](e,emitEvent(event));}}module[_0xb48d('0x9')]=MailQueueEvents;
\ No newline at end of file
+var _0x02d4=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','MailQueue','setMaxListeners','update'];(function(_0x5a5e1a,_0x5cb7a5){var _0x34b035=function(_0x4ccb42){while(--_0x4ccb42){_0x5a5e1a['push'](_0x5a5e1a['shift']());}};_0x34b035(++_0x5cb7a5);}(_0x02d4,0x9e));var _0x402d=function(_0x518f25,_0x30e964){_0x518f25=_0x518f25-0x0;var _0x580fb9=_0x02d4[_0x518f25];return _0x580fb9;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x402d('0x0'))['db'][_0x402d('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x402d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x402d('0x3'),'afterDestroy':_0x402d('0x4')};function emitEvent(_0x401f92){return function(_0x5d6192,_0x2ab940,_0x22e2e6){MailQueueEvents[_0x402d('0x5')](_0x401f92+':'+_0x5d6192['id'],_0x5d6192);MailQueueEvents[_0x402d('0x5')](_0x401f92,_0x5d6192);_0x22e2e6(null);};}for(var e in events){if(events[_0x402d('0x6')](e)){var event=events[e];MailQueue[_0x402d('0x7')](e,emitEvent(event));}}module[_0x402d('0x8')]=MailQueueEvents;
\ No newline at end of file
index b72a460..3949cad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4972=['moment','request-promise','rimraf','define','MailQueue','mail_queues','lodash','util','../../config/logger','api'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4972,0x13c));var _0x2497=function(_0xd40421,_0x355203){_0xd40421=_0xd40421-0x0;var _0x1fd436=_0x4972[_0xd40421];return _0x1fd436;};'use strict';var _=require(_0x2497('0x0'));var util=require(_0x2497('0x1'));var logger=require(_0x2497('0x2'))(_0x2497('0x3'));var moment=require(_0x2497('0x4'));var BPromise=require('bluebird');var rp=require(_0x2497('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2497('0x6'));var config=require('../../config/environment');var attributes=require('./mailQueue.attributes');module['exports']=function(_0x1c90ff,_0x347192){return _0x1c90ff[_0x2497('0x7')](_0x2497('0x8'),attributes,{'tableName':_0x2497('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6387=['define','MailQueue','lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./mailQueue.attributes'];(function(_0x3e09f3,_0x52d3de){var _0xa2710=function(_0x1712c7){while(--_0x1712c7){_0x3e09f3['push'](_0x3e09f3['shift']());}};_0xa2710(++_0x52d3de);}(_0x6387,0x1ec));var _0x7638=function(_0x2df0bd,_0x340f8f){_0x2df0bd=_0x2df0bd-0x0;var _0x182503=_0x6387[_0x2df0bd];return _0x182503;};'use strict';var _=require(_0x7638('0x0'));var util=require('util');var logger=require(_0x7638('0x1'))(_0x7638('0x2'));var moment=require(_0x7638('0x3'));var BPromise=require(_0x7638('0x4'));var rp=require(_0x7638('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7638('0x6'));var attributes=require(_0x7638('0x7'));module['exports']=function(_0xf9c2b4,_0x180bf0){return _0xf9c2b4[_0x7638('0x8')](_0x7638('0x9'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3857d16..5a246c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc15e=['moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailQueue.socket','request','then','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','GetMailQueue','MailQueue','options','where','attributes','limit','include','map','model','stringify','catch','raw','ShowMailQueue','lodash','util'];(function(_0x4c184d,_0x4278ab){var _0x23d997=function(_0x22d068){while(--_0x22d068){_0x4c184d['push'](_0x4c184d['shift']());}};_0x23d997(++_0x4278ab);}(_0xc15e,0x154));var _0xec15=function(_0x15d288,_0x2e8e5d){_0x15d288=_0x15d288-0x0;var _0x53b073=_0xc15e[_0x15d288];return _0x53b073;};'use strict';var _=require(_0xec15('0x0'));var util=require(_0xec15('0x1'));var moment=require(_0xec15('0x2'));var BPromise=require(_0xec15('0x3'));var rs=require(_0xec15('0x4'));var fs=require('fs');var Redis=require(_0xec15('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xec15('0x6'))(_0xec15('0x7'));var config=require('../../config/environment');var jayson=require(_0xec15('0x8'));var client=jayson[_0xec15('0x9')][_0xec15('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xec15('0xb')],{'host':_0xec15('0xc'),'port':0x18eb});var socket=require(_0xec15('0xd'))(new Redis(config[_0xec15('0xb')]));require(_0xec15('0xe'))['register'](socket);function respondWithRpcPromise(_0x2e04b5,_0x59a904,_0x41bc04){return new BPromise(function(_0x3df75b,_0x5a16eb){return client[_0xec15('0xf')](_0x2e04b5,_0x41bc04)[_0xec15('0x10')](function(_0x23af9e){logger['info'](_0xec15('0x11'),_0x59a904,'request\x20sent');logger[_0xec15('0x12')](_0xec15('0x13'),_0x59a904,_0xec15('0x14'),JSON['stringify'](_0x23af9e));if(_0x23af9e['error']){if(_0x23af9e[_0xec15('0x15')]['code']===0x1f4){logger[_0xec15('0x15')](_0xec15('0x11'),_0x59a904,_0x23af9e[_0xec15('0x15')]['message']);return _0x5a16eb(_0x23af9e[_0xec15('0x15')][_0xec15('0x16')]);}logger['error']('MailQueue,\x20%s,\x20%s',_0x59a904,_0x23af9e[_0xec15('0x15')]['message']);return _0x3df75b(_0x23af9e[_0xec15('0x15')]['message']);}else{logger[_0xec15('0x17')](_0xec15('0x11'),_0x59a904,_0xec15('0x14'));_0x3df75b(_0x23af9e[_0xec15('0x18')][_0xec15('0x16')]);}})['catch'](function(_0x5f0dcb){logger['error'](_0xec15('0x11'),_0x59a904,_0x5f0dcb);_0x5a16eb(_0x5f0dcb);});});}exports[_0xec15('0x19')]=function(_0x2a9a45){var _0x43f482=this;return new Promise(function(_0x249378,_0x30e276){return db[_0xec15('0x1a')]['findAll']({'raw':_0x2a9a45[_0xec15('0x1b')]?_0x2a9a45[_0xec15('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x2a9a45[_0xec15('0x1b')]?_0x2a9a45['options'][_0xec15('0x1c')]||null:null,'attributes':_0x2a9a45[_0xec15('0x1b')]?_0x2a9a45['options'][_0xec15('0x1d')]||null:null,'limit':_0x2a9a45[_0xec15('0x1b')]?_0x2a9a45[_0xec15('0x1b')][_0xec15('0x1e')]||null:null,'include':_0x2a9a45['options']?_0x2a9a45[_0xec15('0x1b')][_0xec15('0x1f')]?_[_0xec15('0x20')](_0x2a9a45['options'][_0xec15('0x1f')],function(_0x3c2cbc){return{'model':db[_0x3c2cbc[_0xec15('0x21')]],'as':_0x3c2cbc['as'],'attributes':_0x3c2cbc[_0xec15('0x1d')],'include':_0x3c2cbc['include']?_[_0xec15('0x20')](_0x3c2cbc[_0xec15('0x1f')],function(_0x407ffb){return{'model':db[_0x407ffb[_0xec15('0x21')]],'as':_0x407ffb['as'],'attributes':_0x407ffb[_0xec15('0x1d')],'include':_0x407ffb[_0xec15('0x1f')]?_[_0xec15('0x20')](_0x407ffb['include'],function(_0x10ffd3){return{'model':db[_0x10ffd3[_0xec15('0x21')]],'as':_0x10ffd3['as'],'attributes':_0x10ffd3[_0xec15('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x55a205){logger[_0xec15('0x17')](_0xec15('0x19'),_0x2a9a45);logger[_0xec15('0x12')]('GetMailQueue',_0x2a9a45,JSON[_0xec15('0x22')](_0x55a205));_0x249378(_0x55a205);})[_0xec15('0x23')](function(_0x5d8bb3){logger[_0xec15('0x15')](_0xec15('0x19'),_0x5d8bb3['message'],_0x2a9a45);_0x30e276(_0x43f482[_0xec15('0x15')](0x1f4,_0x5d8bb3[_0xec15('0x16')]));});});};exports['ShowMailQueue']=function(_0x53cff4){var _0x453a7f=this;return new Promise(function(_0x310c6a,_0x294dc0){return db['MailQueue']['find']({'raw':_0x53cff4[_0xec15('0x1b')]?_0x53cff4[_0xec15('0x1b')][_0xec15('0x24')]===undefined?!![]:![]:!![],'where':_0x53cff4[_0xec15('0x1b')]?_0x53cff4[_0xec15('0x1b')][_0xec15('0x1c')]||null:null,'attributes':_0x53cff4[_0xec15('0x1b')]?_0x53cff4[_0xec15('0x1b')]['attributes']||null:null,'include':_0x53cff4[_0xec15('0x1b')]?_0x53cff4[_0xec15('0x1b')]['include']?_[_0xec15('0x20')](_0x53cff4[_0xec15('0x1b')][_0xec15('0x1f')],function(_0x26542f){return{'model':db[_0x26542f[_0xec15('0x21')]],'as':_0x26542f['as'],'attributes':_0x26542f[_0xec15('0x1d')],'include':_0x26542f[_0xec15('0x1f')]?_[_0xec15('0x20')](_0x26542f[_0xec15('0x1f')],function(_0x55c487){return{'model':db[_0x55c487[_0xec15('0x21')]],'as':_0x55c487['as'],'attributes':_0x55c487[_0xec15('0x1d')],'include':_0x55c487[_0xec15('0x1f')]?_[_0xec15('0x20')](_0x55c487[_0xec15('0x1f')],function(_0x2bf2c0){return{'model':db[_0x2bf2c0[_0xec15('0x21')]],'as':_0x2bf2c0['as'],'attributes':_0x2bf2c0[_0xec15('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xec15('0x10')](function(_0x3f6487){logger['info'](_0xec15('0x25'),_0x53cff4);logger[_0xec15('0x12')](_0xec15('0x25'),_0x53cff4,JSON[_0xec15('0x22')](_0x3f6487));_0x310c6a(_0x3f6487);})['catch'](function(_0x59fe8f){logger[_0xec15('0x15')](_0xec15('0x25'),_0x59fe8f[_0xec15('0x16')],_0x53cff4);_0x294dc0(_0x453a7f[_0xec15('0x15')](0x1f4,_0x59fe8f['message']));});});};
\ No newline at end of file
+var _0xb235=['localhost','socket.io-emitter','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetMailQueue','MailQueue','findAll','options','where','attributes','limit','include','map','model','catch','ShowMailQueue','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis'];(function(_0x352953,_0x466eff){var _0x8111aa=function(_0x35e07b){while(--_0x35e07b){_0x352953['push'](_0x352953['shift']());}};_0x8111aa(++_0x466eff);}(_0xb235,0x1c1));var _0x5b23=function(_0x2dbbe2,_0x11424b){_0x2dbbe2=_0x2dbbe2-0x0;var _0x2e3147=_0xb235[_0x2dbbe2];return _0x2e3147;};'use strict';var _=require(_0x5b23('0x0'));var util=require(_0x5b23('0x1'));var moment=require('moment');var BPromise=require(_0x5b23('0x2'));var rs=require(_0x5b23('0x3'));var fs=require('fs');var Redis=require(_0x5b23('0x4'));var db=require(_0x5b23('0x5'))['db'];var utils=require(_0x5b23('0x6'));var logger=require(_0x5b23('0x7'))(_0x5b23('0x8'));var config=require('../../config/environment');var jayson=require(_0x5b23('0x9'));var client=jayson[_0x5b23('0xa')][_0x5b23('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x5b23('0xc')],{'host':_0x5b23('0xd'),'port':0x18eb});var socket=require(_0x5b23('0xe'))(new Redis(config[_0x5b23('0xc')]));require(_0x5b23('0xf'))[_0x5b23('0x10')](socket);function respondWithRpcPromise(_0x5098f5,_0x178356,_0x316cdb){return new BPromise(function(_0x53098d,_0x50a0c3){return client[_0x5b23('0x11')](_0x5098f5,_0x316cdb)[_0x5b23('0x12')](function(_0x2e2c93){logger[_0x5b23('0x13')](_0x5b23('0x14'),_0x178356,_0x5b23('0x15'));logger[_0x5b23('0x16')](_0x5b23('0x17'),_0x178356,_0x5b23('0x15'),JSON[_0x5b23('0x18')](_0x2e2c93));if(_0x2e2c93[_0x5b23('0x19')]){if(_0x2e2c93[_0x5b23('0x19')][_0x5b23('0x1a')]===0x1f4){logger[_0x5b23('0x19')](_0x5b23('0x14'),_0x178356,_0x2e2c93[_0x5b23('0x19')][_0x5b23('0x1b')]);return _0x50a0c3(_0x2e2c93[_0x5b23('0x19')]['message']);}logger[_0x5b23('0x19')](_0x5b23('0x14'),_0x178356,_0x2e2c93['error']['message']);return _0x53098d(_0x2e2c93[_0x5b23('0x19')]['message']);}else{logger[_0x5b23('0x13')](_0x5b23('0x14'),_0x178356,_0x5b23('0x15'));_0x53098d(_0x2e2c93[_0x5b23('0x1c')][_0x5b23('0x1b')]);}})['catch'](function(_0x595da5){logger[_0x5b23('0x19')](_0x5b23('0x14'),_0x178356,_0x595da5);_0x50a0c3(_0x595da5);});});}exports[_0x5b23('0x1d')]=function(_0x32cedf){var _0x599e6a=this;return new Promise(function(_0x257239,_0x57d010){return db[_0x5b23('0x1e')][_0x5b23('0x1f')]({'raw':_0x32cedf[_0x5b23('0x20')]?_0x32cedf[_0x5b23('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x32cedf['options']?_0x32cedf[_0x5b23('0x20')][_0x5b23('0x21')]||null:null,'attributes':_0x32cedf[_0x5b23('0x20')]?_0x32cedf[_0x5b23('0x20')][_0x5b23('0x22')]||null:null,'limit':_0x32cedf[_0x5b23('0x20')]?_0x32cedf[_0x5b23('0x20')][_0x5b23('0x23')]||null:null,'include':_0x32cedf[_0x5b23('0x20')]?_0x32cedf[_0x5b23('0x20')][_0x5b23('0x24')]?_[_0x5b23('0x25')](_0x32cedf[_0x5b23('0x20')]['include'],function(_0x5e272c){return{'model':db[_0x5e272c[_0x5b23('0x26')]],'as':_0x5e272c['as'],'attributes':_0x5e272c['attributes'],'include':_0x5e272c['include']?_[_0x5b23('0x25')](_0x5e272c[_0x5b23('0x24')],function(_0x3f0bd1){return{'model':db[_0x3f0bd1[_0x5b23('0x26')]],'as':_0x3f0bd1['as'],'attributes':_0x3f0bd1[_0x5b23('0x22')],'include':_0x3f0bd1[_0x5b23('0x24')]?_['map'](_0x3f0bd1['include'],function(_0x2fec2d){return{'model':db[_0x2fec2d[_0x5b23('0x26')]],'as':_0x2fec2d['as'],'attributes':_0x2fec2d[_0x5b23('0x22')]};}):[]};}):[]};}):[]:[]})[_0x5b23('0x12')](function(_0x3b6764){logger['info'](_0x5b23('0x1d'),_0x32cedf);logger[_0x5b23('0x16')]('GetMailQueue',_0x32cedf,JSON['stringify'](_0x3b6764));_0x257239(_0x3b6764);})[_0x5b23('0x27')](function(_0x22cd94){logger['error']('GetMailQueue',_0x22cd94['message'],_0x32cedf);_0x57d010(_0x599e6a[_0x5b23('0x19')](0x1f4,_0x22cd94[_0x5b23('0x1b')]));});});};exports[_0x5b23('0x28')]=function(_0x171fef){var _0x29232d=this;return new Promise(function(_0x5215e2,_0x2ad7cc){return db['MailQueue'][_0x5b23('0x29')]({'raw':_0x171fef[_0x5b23('0x20')]?_0x171fef['options']['raw']===undefined?!![]:![]:!![],'where':_0x171fef[_0x5b23('0x20')]?_0x171fef['options'][_0x5b23('0x21')]||null:null,'attributes':_0x171fef[_0x5b23('0x20')]?_0x171fef[_0x5b23('0x20')][_0x5b23('0x22')]||null:null,'include':_0x171fef[_0x5b23('0x20')]?_0x171fef['options'][_0x5b23('0x24')]?_[_0x5b23('0x25')](_0x171fef[_0x5b23('0x20')][_0x5b23('0x24')],function(_0x32cfe6){return{'model':db[_0x32cfe6[_0x5b23('0x26')]],'as':_0x32cfe6['as'],'attributes':_0x32cfe6['attributes'],'include':_0x32cfe6[_0x5b23('0x24')]?_[_0x5b23('0x25')](_0x32cfe6[_0x5b23('0x24')],function(_0x2bb130){return{'model':db[_0x2bb130[_0x5b23('0x26')]],'as':_0x2bb130['as'],'attributes':_0x2bb130[_0x5b23('0x22')],'include':_0x2bb130[_0x5b23('0x24')]?_[_0x5b23('0x25')](_0x2bb130[_0x5b23('0x24')],function(_0x5c46b2){return{'model':db[_0x5c46b2[_0x5b23('0x26')]],'as':_0x5c46b2['as'],'attributes':_0x5c46b2[_0x5b23('0x22')]};}):[]};}):[]};}):[]:[]})[_0x5b23('0x12')](function(_0x4374fc){logger['info'](_0x5b23('0x28'),_0x171fef);logger[_0x5b23('0x16')]('ShowMailQueue',_0x171fef,JSON[_0x5b23('0x18')](_0x4374fc));_0x5215e2(_0x4374fc);})[_0x5b23('0x27')](function(_0x35c3bc){logger[_0x5b23('0x19')](_0x5b23('0x28'),_0x35c3bc['message'],_0x171fef);_0x2ad7cc(_0x29232d[_0x5b23('0x19')](0x1f4,_0x35c3bc['message']));});});};
\ No newline at end of file
index ff19b4d..64b2508 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2f4=['save','remove','update','removeListener','register','length','mailQueue:','./mailQueue.events'];(function(_0x40f3e1,_0x13b1ed){var _0x21456f=function(_0x358a0b){while(--_0x358a0b){_0x40f3e1['push'](_0x40f3e1['shift']());}};_0x21456f(++_0x13b1ed);}(_0xc2f4,0x107));var _0x4c2f=function(_0x395718,_0x20322d){_0x395718=_0x395718-0x0;var _0x3028b8=_0xc2f4[_0x395718];return _0x3028b8;};'use strict';var MailQueueEvents=require(_0x4c2f('0x0'));var events=[_0x4c2f('0x1'),_0x4c2f('0x2'),_0x4c2f('0x3')];function createListener(_0x33e2cf,_0x33c0ac){return function(_0x394e8d){_0x33c0ac['emit'](_0x33e2cf,_0x394e8d);};}function removeListener(_0x28de27,_0x1ffed2){return function(){MailQueueEvents[_0x4c2f('0x4')](_0x28de27,_0x1ffed2);};}exports[_0x4c2f('0x5')]=function(_0x3f6878){for(var _0x20c594=0x0,_0x4ea773=events[_0x4c2f('0x6')];_0x20c594<_0x4ea773;_0x20c594++){var _0x4a6e8d=events[_0x20c594];var _0x59212b=createListener(_0x4c2f('0x7')+_0x4a6e8d,_0x3f6878);MailQueueEvents['on'](_0x4a6e8d,_0x59212b);}};
\ No newline at end of file
+var _0xeaf3=['remove','update','emit','removeListener','register','length','mailQueue:'];(function(_0x289330,_0x54f85a){var _0x22d2d0=function(_0x4bdcf9){while(--_0x4bdcf9){_0x289330['push'](_0x289330['shift']());}};_0x22d2d0(++_0x54f85a);}(_0xeaf3,0xcb));var _0x3eaf=function(_0xf4c41b,_0x20a6c8){_0xf4c41b=_0xf4c41b-0x0;var _0xccf5fb=_0xeaf3[_0xf4c41b];return _0xccf5fb;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=['save',_0x3eaf('0x0'),_0x3eaf('0x1')];function createListener(_0x4c3145,_0x4d4479){return function(_0x498bed){_0x4d4479[_0x3eaf('0x2')](_0x4c3145,_0x498bed);};}function removeListener(_0x1242bd,_0x518060){return function(){MailQueueEvents[_0x3eaf('0x3')](_0x1242bd,_0x518060);};}exports[_0x3eaf('0x4')]=function(_0x54d203){for(var _0x52763e=0x0,_0x78ccea=events[_0x3eaf('0x5')];_0x52763e<_0x78ccea;_0x52763e++){var _0x2e569c=events[_0x52763e];var _0x274c8c=createListener(_0x3eaf('0x6')+_0x2e569c,_0x54d203);MailQueueEvents['on'](_0x2e569c,_0x274c8c);}};
\ No newline at end of file
index ee10815..8cecfba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd60b=['show','create','delete','destroy','exports','multer','util','path','express','Router','fs-extra','./mailQueueReport.controller','get','index','/describe','/:id','isAuthenticated'];(function(_0x5a9e44,_0x552f9e){var _0x3ab87f=function(_0x5d08bf){while(--_0x5d08bf){_0x5a9e44['push'](_0x5a9e44['shift']());}};_0x3ab87f(++_0x552f9e);}(_0xd60b,0x115));var _0xbd60=function(_0x5aedd2,_0x528e94){_0x5aedd2=_0x5aedd2-0x0;var _0x340fae=_0xd60b[_0x5aedd2];return _0x340fae;};'use strict';var multer=require(_0xbd60('0x0'));var util=require(_0xbd60('0x1'));var path=require(_0xbd60('0x2'));var timeout=require('connect-timeout');var express=require(_0xbd60('0x3'));var router=express[_0xbd60('0x4')]();var fs_extra=require(_0xbd60('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbd60('0x6'));router[_0xbd60('0x7')]('/',auth['isAuthenticated'](),controller[_0xbd60('0x8')]);router['get'](_0xbd60('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xbd60('0x7')](_0xbd60('0xa'),auth[_0xbd60('0xb')](),controller[_0xbd60('0xc')]);router['post']('/',auth[_0xbd60('0xb')](),controller[_0xbd60('0xd')]);router['put'](_0xbd60('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xbd60('0xe')](_0xbd60('0xa'),auth[_0xbd60('0xb')](),controller[_0xbd60('0xf')]);module[_0xbd60('0x10')]=router;
\ No newline at end of file
+var _0x2f23=['index','/describe','describe','/:id','show','post','create','put','update','exports','util','express','fs-extra','../../components/auth/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated'];(function(_0x397c05,_0x255f68){var _0x3ff361=function(_0x3deec5){while(--_0x3deec5){_0x397c05['push'](_0x397c05['shift']());}};_0x3ff361(++_0x255f68);}(_0x2f23,0x1cc));var _0x32f2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2f23[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x32f2('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x32f2('0x1'));var router=express['Router']();var fs_extra=require(_0x32f2('0x2'));var auth=require(_0x32f2('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x32f2('0x4'));var controller=require(_0x32f2('0x5'));router[_0x32f2('0x6')]('/',auth[_0x32f2('0x7')](),controller[_0x32f2('0x8')]);router[_0x32f2('0x6')](_0x32f2('0x9'),auth[_0x32f2('0x7')](),controller[_0x32f2('0xa')]);router['get'](_0x32f2('0xb'),auth[_0x32f2('0x7')](),controller[_0x32f2('0xc')]);router[_0x32f2('0xd')]('/',auth[_0x32f2('0x7')](),controller[_0x32f2('0xe')]);router[_0x32f2('0xf')](_0x32f2('0xb'),auth[_0x32f2('0x7')](),controller[_0x32f2('0x10')]);router['delete'](_0x32f2('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x32f2('0x11')]=router;
\ No newline at end of file
index ecf9d78..9b5737c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb59=['STRING','DATE','moment','exports'];(function(_0x2368cd,_0x38b20d){var _0x4fad9f=function(_0x52072d){while(--_0x52072d){_0x2368cd['push'](_0x2368cd['shift']());}};_0x4fad9f(++_0x38b20d);}(_0xcb59,0x146));var _0x9cb5=function(_0x318f3c,_0x477a1c){_0x318f3c=_0x318f3c-0x0;var _0x180260=_0xcb59[_0x318f3c];return _0x180260;};'use strict';var moment=require(_0x9cb5('0x0'));var Sequelize=require('sequelize');module[_0x9cb5('0x1')]={'uniqueid':{'type':Sequelize[_0x9cb5('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x9cb5('0x2')]},'joinAt':{'type':Sequelize[_0x9cb5('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x9cb5('0x3')]},'exitAt':{'type':Sequelize[_0x9cb5('0x3')]},'reason':{'type':Sequelize[_0x9cb5('0x2')]}};
\ No newline at end of file
+var _0x809e=['exports','STRING','DATE','moment','sequelize'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0x809e,0x1e8));var _0xe809=function(_0x1284b6,_0x2dae00){_0x1284b6=_0x1284b6-0x0;var _0x58369e=_0x809e[_0x1284b6];return _0x58369e;};'use strict';var moment=require(_0xe809('0x0'));var Sequelize=require(_0xe809('0x1'));module[_0xe809('0x2')]={'uniqueid':{'type':Sequelize[_0xe809('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xe809('0x3')]},'joinAt':{'type':Sequelize[_0xe809('0x4')]},'leaveAt':{'type':Sequelize[_0xe809('0x4')]},'acceptAt':{'type':Sequelize[_0xe809('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xe809('0x3')]}};
\ No newline at end of file
index 62ec039..f54c1c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb3b=['destroy','error','stack','name','send','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','MailQueueReport','rawAttributes','include','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','Content-Range','reject','save','then'];(function(_0x4f3441,_0x40dcf2){var _0x3a33bc=function(_0x26454b){while(--_0x26454b){_0x4f3441['push'](_0x4f3441['shift']());}};_0x3a33bc(++_0x40dcf2);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x290a56,_0x5c540a){_0x290a56=_0x290a56-0x0;var _0x89610=_0xeb3b[_0x290a56];return _0x89610;};'use strict';var emlformat=require(_0xbeb3('0x0'));var rimraf=require(_0xbeb3('0x1'));var zipdir=require(_0xbeb3('0x2'));var jsonpatch=require(_0xbeb3('0x3'));var rp=require(_0xbeb3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbeb3('0x5'));var util=require('util');var path=require(_0xbeb3('0x6'));var sox=require('sox');var csv=require(_0xbeb3('0x7'));var ejs=require(_0xbeb3('0x8'));var fs=require('fs');var fs_extra=require(_0xbeb3('0x9'));var _=require(_0xbeb3('0xa'));var squel=require(_0xbeb3('0xb'));var crypto=require(_0xbeb3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbeb3('0xd'));var toCsv=require(_0xbeb3('0x7'));var querystring=require(_0xbeb3('0xe'));var Papa=require(_0xbeb3('0xf'));var Redis=require(_0xbeb3('0x10'));var authService=require(_0xbeb3('0x11'));var qs=require(_0xbeb3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbeb3('0x13'));var logger=require(_0xbeb3('0x14'))('api');var utils=require(_0xbeb3('0x15'));var config=require(_0xbeb3('0x16'));var licenseUtil=require(_0xbeb3('0x17'));var db=require(_0xbeb3('0x18'))['db'];function respondWithStatusCode(_0x19868e,_0x313296){_0x313296=_0x313296||0xcc;return function(_0x5b9ace){if(_0x5b9ace){return _0x19868e['sendStatus'](_0x313296);}return _0x19868e[_0xbeb3('0x19')](_0x313296)[_0xbeb3('0x1a')]();};}function respondWithResult(_0x5f521b,_0x4dfb28){_0x4dfb28=_0x4dfb28||0xc8;return function(_0xed9879){if(_0xed9879){return _0x5f521b[_0xbeb3('0x19')](_0x4dfb28)[_0xbeb3('0x1b')](_0xed9879);}};}function respondWithFilteredResult(_0x43d58a,_0x26daf2){return function(_0x535836){if(_0x535836){var _0x1aeaee=typeof _0x26daf2['offset']===_0xbeb3('0x1c')&&typeof _0x26daf2['limit']==='undefined';var _0x4f8481=_0x535836[_0xbeb3('0x1d')];var _0x44a4bb=_0x1aeaee?0x0:_0x26daf2[_0xbeb3('0x1e')];var _0x10b15d=_0x1aeaee?_0x535836['count']:_0x26daf2[_0xbeb3('0x1e')]+_0x26daf2[_0xbeb3('0x1f')];var _0xe2cc47;if(_0x10b15d>=_0x4f8481){_0x10b15d=_0x4f8481;_0xe2cc47=0xc8;}else{_0xe2cc47=0xce;}_0x43d58a['status'](_0xe2cc47);return _0x43d58a['set'](_0xbeb3('0x20'),_0x44a4bb+'-'+_0x10b15d+'/'+_0x4f8481)['json'](_0x535836);}return null;};}function patchUpdates(_0x1d917b){return function(_0x50b005){try{jsonpatch['apply'](_0x50b005,_0x1d917b,!![]);}catch(_0xfa2736){return BPromise[_0xbeb3('0x21')](_0xfa2736);}return _0x50b005[_0xbeb3('0x22')]();};}function saveUpdates(_0x4bd89e,_0x301899){return function(_0x18ea0f){if(_0x18ea0f){return _0x18ea0f['update'](_0x4bd89e)[_0xbeb3('0x23')](function(_0x366bdb){return _0x366bdb;});}return null;};}function removeEntity(_0x55a59d,_0xfc384a){return function(_0x278fe4){if(_0x278fe4){return _0x278fe4[_0xbeb3('0x24')]()[_0xbeb3('0x23')](function(){_0x55a59d[_0xbeb3('0x19')](0xcc)[_0xbeb3('0x1a')]();});}};}function handleEntityNotFound(_0x84921a,_0x340581){return function(_0x46fe17){if(!_0x46fe17){_0x84921a['sendStatus'](0x194);}return _0x46fe17;};}function handleError(_0x4e695e,_0x1f36b9){_0x1f36b9=_0x1f36b9||0x1f4;return function(_0x520116){logger[_0xbeb3('0x25')](_0x520116[_0xbeb3('0x26')]);if(_0x520116[_0xbeb3('0x27')]){delete _0x520116[_0xbeb3('0x27')];}_0x4e695e['status'](_0x1f36b9)[_0xbeb3('0x28')](_0x520116);};}exports['index']=function(_0x26cd8f,_0xab301c){var _0x5bd93d={},_0x483198={},_0x9b8f13={'count':0x0,'rows':[]};var _0x585c6f=_['map'](db['MailQueueReport']['rawAttributes'],function(_0xf5dbaf){return{'name':_0xf5dbaf['fieldName'],'type':_0xf5dbaf[_0xbeb3('0x29')][_0xbeb3('0x2a')]};});_0x483198[_0xbeb3('0x2b')]=_[_0xbeb3('0x2c')](_0x585c6f,_0xbeb3('0x27'));_0x483198[_0xbeb3('0x2d')]=_[_0xbeb3('0x2e')](_0x26cd8f[_0xbeb3('0x2d')]);_0x483198[_0xbeb3('0x2f')]=_[_0xbeb3('0x30')](_0x483198['model'],_0x483198[_0xbeb3('0x2d')]);_0x5bd93d[_0xbeb3('0x31')]=_['intersection'](_0x483198[_0xbeb3('0x2b')],qs[_0xbeb3('0x32')](_0x26cd8f[_0xbeb3('0x2d')][_0xbeb3('0x32')]));_0x5bd93d['attributes']=_0x5bd93d[_0xbeb3('0x31')][_0xbeb3('0x33')]?_0x5bd93d[_0xbeb3('0x31')]:_0x483198[_0xbeb3('0x2b')];if(!_0x26cd8f[_0xbeb3('0x2d')][_0xbeb3('0x34')](_0xbeb3('0x35'))){_0x5bd93d[_0xbeb3('0x1f')]=qs[_0xbeb3('0x1f')](_0x26cd8f['query'][_0xbeb3('0x1f')]);_0x5bd93d['offset']=qs[_0xbeb3('0x1e')](_0x26cd8f[_0xbeb3('0x2d')][_0xbeb3('0x1e')]);}_0x5bd93d[_0xbeb3('0x36')]=qs[_0xbeb3('0x37')](_0x26cd8f[_0xbeb3('0x2d')][_0xbeb3('0x37')]);_0x5bd93d[_0xbeb3('0x38')]=qs['filters'](_[_0xbeb3('0x39')](_0x26cd8f['query'],_0x483198['filters']),_0x585c6f);if(_0x26cd8f['query'][_0xbeb3('0x3a')]){_0x5bd93d[_0xbeb3('0x38')]=_[_0xbeb3('0x3b')](_0x5bd93d[_0xbeb3('0x38')],{'$or':_[_0xbeb3('0x2c')](_0x585c6f,function(_0x40f166){if(_0x40f166['type']!==_0xbeb3('0x3c')){var _0x40de8d={};_0x40de8d[_0x40f166[_0xbeb3('0x27')]]={'$like':'%'+_0x26cd8f['query']['filter']+'%'};return _0x40de8d;}})});}_0x5bd93d=_['merge']({},_0x5bd93d,_0x26cd8f[_0xbeb3('0x3d')]);var _0x2a8860={'where':_0x5bd93d[_0xbeb3('0x38')]};return db['MailQueueReport'][_0xbeb3('0x1d')](_0x2a8860)['then'](function(_0x1b6700){_0x9b8f13[_0xbeb3('0x1d')]=_0x1b6700;if(_0x26cd8f[_0xbeb3('0x2d')][_0xbeb3('0x3e')]){_0x5bd93d['include']=[{'all':!![]}];}return db['MailQueueReport'][_0xbeb3('0x3f')](_0x5bd93d);})[_0xbeb3('0x23')](function(_0x3d4262){_0x9b8f13[_0xbeb3('0x40')]=_0x3d4262;return _0x9b8f13;})[_0xbeb3('0x23')](respondWithFilteredResult(_0xab301c,_0x5bd93d))[_0xbeb3('0x41')](handleError(_0xab301c,null));};exports[_0xbeb3('0x42')]=function(_0x4606a6,_0x5758c6){var _0xfcb57f={'raw':!![],'where':{'id':_0x4606a6[_0xbeb3('0x43')]['id']}},_0x39f2d2={};_0x39f2d2[_0xbeb3('0x2b')]=_[_0xbeb3('0x2e')](db[_0xbeb3('0x44')][_0xbeb3('0x45')]);_0x39f2d2['query']=_[_0xbeb3('0x2e')](_0x4606a6[_0xbeb3('0x2d')]);_0x39f2d2[_0xbeb3('0x2f')]=_[_0xbeb3('0x30')](_0x39f2d2[_0xbeb3('0x2b')],_0x39f2d2[_0xbeb3('0x2d')]);_0xfcb57f[_0xbeb3('0x31')]=_[_0xbeb3('0x30')](_0x39f2d2[_0xbeb3('0x2b')],qs[_0xbeb3('0x32')](_0x4606a6[_0xbeb3('0x2d')][_0xbeb3('0x32')]));_0xfcb57f[_0xbeb3('0x31')]=_0xfcb57f['attributes'][_0xbeb3('0x33')]?_0xfcb57f[_0xbeb3('0x31')]:_0x39f2d2[_0xbeb3('0x2b')];if(_0x4606a6['query']['includeAll']){_0xfcb57f[_0xbeb3('0x46')]=[{'all':!![]}];}_0xfcb57f=_[_0xbeb3('0x3b')]({},_0xfcb57f,_0x4606a6[_0xbeb3('0x3d')]);return db[_0xbeb3('0x44')]['find'](_0xfcb57f)[_0xbeb3('0x23')](handleEntityNotFound(_0x5758c6,null))['then'](respondWithResult(_0x5758c6,null))['catch'](handleError(_0x5758c6,null));};exports[_0xbeb3('0x47')]=function(_0x393e60,_0x1ff297){return db[_0xbeb3('0x44')]['create'](_0x393e60[_0xbeb3('0x48')],{})[_0xbeb3('0x23')](respondWithResult(_0x1ff297,0xc9))[_0xbeb3('0x41')](handleError(_0x1ff297,null));};exports['update']=function(_0x3f93ab,_0x58c49f){if(_0x3f93ab['body']['id']){delete _0x3f93ab[_0xbeb3('0x48')]['id'];}return db[_0xbeb3('0x44')][_0xbeb3('0x49')]({'where':{'id':_0x3f93ab['params']['id']}})[_0xbeb3('0x23')](handleEntityNotFound(_0x58c49f,null))[_0xbeb3('0x23')](saveUpdates(_0x3f93ab[_0xbeb3('0x48')],null))['then'](respondWithResult(_0x58c49f,null))[_0xbeb3('0x41')](handleError(_0x58c49f,null));};exports['destroy']=function(_0x39605b,_0x4d8e21){return db[_0xbeb3('0x44')][_0xbeb3('0x49')]({'where':{'id':_0x39605b[_0xbeb3('0x43')]['id']}})[_0xbeb3('0x23')](handleEntityNotFound(_0x4d8e21,null))[_0xbeb3('0x23')](removeEntity(_0x4d8e21,null))[_0xbeb3('0x41')](handleError(_0x4d8e21,null));};exports[_0xbeb3('0x4a')]=function(_0x168434,_0x49fded){return db[_0xbeb3('0x44')][_0xbeb3('0x4a')]()[_0xbeb3('0x23')](respondWithResult(_0x49fded,null))[_0xbeb3('0x41')](handleError(_0x49fded,null));};
\ No newline at end of file
+var _0x1623=['filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','options','MailQueueReport','findAll','rows','catch','show','params','length','find','create','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','apply','save','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x1623,0xab));var _0x3162=function(_0x27bd9f,_0x489238){_0x27bd9f=_0x27bd9f-0x0;var _0x3c2cd2=_0x1623[_0x27bd9f];return _0x3c2cd2;};'use strict';var emlformat=require(_0x3162('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3162('0x1'));var rp=require(_0x3162('0x2'));var moment=require(_0x3162('0x3'));var BPromise=require(_0x3162('0x4'));var Mustache=require(_0x3162('0x5'));var util=require('util');var path=require('path');var sox=require(_0x3162('0x6'));var csv=require('to-csv');var ejs=require(_0x3162('0x7'));var fs=require('fs');var fs_extra=require(_0x3162('0x8'));var _=require('lodash');var squel=require(_0x3162('0x9'));var crypto=require(_0x3162('0xa'));var jsforce=require(_0x3162('0xb'));var deskjs=require(_0x3162('0xc'));var toCsv=require(_0x3162('0xd'));var querystring=require(_0x3162('0xe'));var Papa=require(_0x3162('0xf'));var Redis=require(_0x3162('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3162('0x11'));var hardwareService=require(_0x3162('0x12'));var logger=require(_0x3162('0x13'))(_0x3162('0x14'));var utils=require(_0x3162('0x15'));var config=require(_0x3162('0x16'));var licenseUtil=require(_0x3162('0x17'));var db=require(_0x3162('0x18'))['db'];function respondWithStatusCode(_0x157ab8,_0x4c3625){_0x4c3625=_0x4c3625||0xcc;return function(_0x2d11c5){if(_0x2d11c5){return _0x157ab8['sendStatus'](_0x4c3625);}return _0x157ab8[_0x3162('0x19')](_0x4c3625)[_0x3162('0x1a')]();};}function respondWithResult(_0x49d1ad,_0x4a393a){_0x4a393a=_0x4a393a||0xc8;return function(_0x198764){if(_0x198764){return _0x49d1ad[_0x3162('0x19')](_0x4a393a)[_0x3162('0x1b')](_0x198764);}};}function respondWithFilteredResult(_0x4b8a3b,_0x15e348){return function(_0x3d0bea){if(_0x3d0bea){var _0x2705d1=typeof _0x15e348['offset']===_0x3162('0x1c')&&typeof _0x15e348[_0x3162('0x1d')]===_0x3162('0x1c');var _0xc3ee06=_0x3d0bea[_0x3162('0x1e')];var _0x1eed46=_0x2705d1?0x0:_0x15e348[_0x3162('0x1f')];var _0x4b2bf3=_0x2705d1?_0x3d0bea[_0x3162('0x1e')]:_0x15e348[_0x3162('0x1f')]+_0x15e348[_0x3162('0x1d')];var _0x36ca97;if(_0x4b2bf3>=_0xc3ee06){_0x4b2bf3=_0xc3ee06;_0x36ca97=0xc8;}else{_0x36ca97=0xce;}_0x4b8a3b['status'](_0x36ca97);return _0x4b8a3b[_0x3162('0x20')]('Content-Range',_0x1eed46+'-'+_0x4b2bf3+'/'+_0xc3ee06)['json'](_0x3d0bea);}return null;};}function patchUpdates(_0xa5c62b){return function(_0x3e4d23){try{jsonpatch[_0x3162('0x21')](_0x3e4d23,_0xa5c62b,!![]);}catch(_0x523fab){return BPromise['reject'](_0x523fab);}return _0x3e4d23[_0x3162('0x22')]();};}function saveUpdates(_0x396372,_0x32c051){return function(_0x26c90d){if(_0x26c90d){return _0x26c90d[_0x3162('0x23')](_0x396372)[_0x3162('0x24')](function(_0x52ae25){return _0x52ae25;});}return null;};}function removeEntity(_0x1b2713,_0x5a4994){return function(_0xd283d6){if(_0xd283d6){return _0xd283d6[_0x3162('0x25')]()[_0x3162('0x24')](function(){_0x1b2713[_0x3162('0x19')](0xcc)[_0x3162('0x1a')]();});}};}function handleEntityNotFound(_0x3c543e,_0x30552f){return function(_0x5f8f7){if(!_0x5f8f7){_0x3c543e[_0x3162('0x26')](0x194);}return _0x5f8f7;};}function handleError(_0x356c5d,_0x8fa09f){_0x8fa09f=_0x8fa09f||0x1f4;return function(_0x2f62d7){logger[_0x3162('0x27')](_0x2f62d7['stack']);if(_0x2f62d7[_0x3162('0x28')]){delete _0x2f62d7['name'];}_0x356c5d[_0x3162('0x19')](_0x8fa09f)[_0x3162('0x29')](_0x2f62d7);};}exports[_0x3162('0x2a')]=function(_0x57f567,_0x4903e7){var _0xda0389={},_0xaa1f35={},_0x14df16={'count':0x0,'rows':[]};var _0x399148=_[_0x3162('0x2b')](db['MailQueueReport'][_0x3162('0x2c')],function(_0x4e3cc2){return{'name':_0x4e3cc2[_0x3162('0x2d')],'type':_0x4e3cc2[_0x3162('0x2e')][_0x3162('0x2f')]};});_0xaa1f35[_0x3162('0x30')]=_[_0x3162('0x2b')](_0x399148,_0x3162('0x28'));_0xaa1f35[_0x3162('0x31')]=_[_0x3162('0x32')](_0x57f567['query']);_0xaa1f35[_0x3162('0x33')]=_[_0x3162('0x34')](_0xaa1f35['model'],_0xaa1f35[_0x3162('0x31')]);_0xda0389[_0x3162('0x35')]=_['intersection'](_0xaa1f35['model'],qs[_0x3162('0x36')](_0x57f567['query'][_0x3162('0x36')]));_0xda0389[_0x3162('0x35')]=_0xda0389[_0x3162('0x35')]['length']?_0xda0389['attributes']:_0xaa1f35[_0x3162('0x30')];if(!_0x57f567[_0x3162('0x31')]['hasOwnProperty'](_0x3162('0x37'))){_0xda0389['limit']=qs[_0x3162('0x1d')](_0x57f567[_0x3162('0x31')][_0x3162('0x1d')]);_0xda0389[_0x3162('0x1f')]=qs[_0x3162('0x1f')](_0x57f567[_0x3162('0x31')][_0x3162('0x1f')]);}_0xda0389[_0x3162('0x38')]=qs[_0x3162('0x39')](_0x57f567[_0x3162('0x31')][_0x3162('0x39')]);_0xda0389['where']=qs[_0x3162('0x33')](_[_0x3162('0x3a')](_0x57f567[_0x3162('0x31')],_0xaa1f35['filters']),_0x399148);if(_0x57f567['query'][_0x3162('0x3b')]){_0xda0389[_0x3162('0x3c')]=_[_0x3162('0x3d')](_0xda0389[_0x3162('0x3c')],{'$or':_['map'](_0x399148,function(_0x4186b6){if(_0x4186b6['type']!=='VIRTUAL'){var _0x5dee49={};_0x5dee49[_0x4186b6[_0x3162('0x28')]]={'$like':'%'+_0x57f567[_0x3162('0x31')][_0x3162('0x3b')]+'%'};return _0x5dee49;}})});}_0xda0389=_['merge']({},_0xda0389,_0x57f567[_0x3162('0x3e')]);var _0x2ce9c6={'where':_0xda0389[_0x3162('0x3c')]};return db[_0x3162('0x3f')][_0x3162('0x1e')](_0x2ce9c6)['then'](function(_0x5447d6){_0x14df16[_0x3162('0x1e')]=_0x5447d6;if(_0x57f567[_0x3162('0x31')]['includeAll']){_0xda0389['include']=[{'all':!![]}];}return db[_0x3162('0x3f')][_0x3162('0x40')](_0xda0389);})[_0x3162('0x24')](function(_0x4883ac){_0x14df16[_0x3162('0x41')]=_0x4883ac;return _0x14df16;})[_0x3162('0x24')](respondWithFilteredResult(_0x4903e7,_0xda0389))[_0x3162('0x42')](handleError(_0x4903e7,null));};exports[_0x3162('0x43')]=function(_0x534708,_0x2617d3){var _0x282e3e={'raw':!![],'where':{'id':_0x534708[_0x3162('0x44')]['id']}},_0x522cce={};_0x522cce[_0x3162('0x30')]=_['keys'](db[_0x3162('0x3f')][_0x3162('0x2c')]);_0x522cce['query']=_[_0x3162('0x32')](_0x534708['query']);_0x522cce[_0x3162('0x33')]=_[_0x3162('0x34')](_0x522cce[_0x3162('0x30')],_0x522cce[_0x3162('0x31')]);_0x282e3e[_0x3162('0x35')]=_[_0x3162('0x34')](_0x522cce['model'],qs[_0x3162('0x36')](_0x534708[_0x3162('0x31')][_0x3162('0x36')]));_0x282e3e['attributes']=_0x282e3e[_0x3162('0x35')][_0x3162('0x45')]?_0x282e3e['attributes']:_0x522cce[_0x3162('0x30')];if(_0x534708['query']['includeAll']){_0x282e3e['include']=[{'all':!![]}];}_0x282e3e=_[_0x3162('0x3d')]({},_0x282e3e,_0x534708[_0x3162('0x3e')]);return db[_0x3162('0x3f')][_0x3162('0x46')](_0x282e3e)[_0x3162('0x24')](handleEntityNotFound(_0x2617d3,null))[_0x3162('0x24')](respondWithResult(_0x2617d3,null))[_0x3162('0x42')](handleError(_0x2617d3,null));};exports[_0x3162('0x47')]=function(_0x3d2958,_0x28865c){return db[_0x3162('0x3f')][_0x3162('0x47')](_0x3d2958[_0x3162('0x48')],{})['then'](respondWithResult(_0x28865c,0xc9))[_0x3162('0x42')](handleError(_0x28865c,null));};exports['update']=function(_0x4f1dde,_0x12d791){if(_0x4f1dde[_0x3162('0x48')]['id']){delete _0x4f1dde[_0x3162('0x48')]['id'];}return db[_0x3162('0x3f')]['find']({'where':{'id':_0x4f1dde[_0x3162('0x44')]['id']}})['then'](handleEntityNotFound(_0x12d791,null))[_0x3162('0x24')](saveUpdates(_0x4f1dde[_0x3162('0x48')],null))['then'](respondWithResult(_0x12d791,null))[_0x3162('0x42')](handleError(_0x12d791,null));};exports['destroy']=function(_0x516599,_0x13e7c4){return db[_0x3162('0x3f')][_0x3162('0x46')]({'where':{'id':_0x516599[_0x3162('0x44')]['id']}})[_0x3162('0x24')](handleEntityNotFound(_0x13e7c4,null))[_0x3162('0x24')](removeEntity(_0x13e7c4,null))[_0x3162('0x42')](handleError(_0x13e7c4,null));};exports[_0x3162('0x49')]=function(_0x554a03,_0x48b81d){return db['MailQueueReport'][_0x3162('0x49')]()[_0x3162('0x24')](respondWithResult(_0x48b81d,null))[_0x3162('0x42')](handleError(_0x48b81d,null));};
\ No newline at end of file
index f377d2f..8bf7162 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x513f=['MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./mailQueueReport.attributes','exports'];(function(_0x5a33c5,_0x39882e){var _0x3851e9=function(_0xe9eb4a){while(--_0xe9eb4a){_0x5a33c5['push'](_0x5a33c5['shift']());}};_0x3851e9(++_0x39882e);}(_0x513f,0x85));var _0xf513=function(_0x5af655,_0x14b952){_0x5af655=_0x5af655-0x0;var _0x1604e4=_0x513f[_0x5af655];return _0x1604e4;};'use strict';var _=require(_0xf513('0x0'));var util=require(_0xf513('0x1'));var logger=require(_0xf513('0x2'))(_0xf513('0x3'));var moment=require('moment');var BPromise=require(_0xf513('0x4'));var rp=require(_0xf513('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf513('0x6'));var config=require(_0xf513('0x7'));var attributes=require(_0xf513('0x8'));module[_0xf513('0x9')]=function(_0x350872,_0x2e7e0b){return _0x350872['define'](_0xf513('0xa'),attributes,{'tableName':_0xf513('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xf513('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x352d=['rimraf','../../config/environment','./mailQueueReport.attributes','exports','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','api','request-promise'];(function(_0x48326a,_0x8cfa0c){var _0x466709=function(_0x5ab1b7){while(--_0x5ab1b7){_0x48326a['push'](_0x48326a['shift']());}};_0x466709(++_0x8cfa0c);}(_0x352d,0x133));var _0xd352=function(_0x5e50d3,_0x442d1e){_0x5e50d3=_0x5e50d3-0x0;var _0x5228d4=_0x352d[_0x5e50d3];return _0x5228d4;};'use strict';var _=require(_0xd352('0x0'));var util=require(_0xd352('0x1'));var logger=require(_0xd352('0x2'))(_0xd352('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd352('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd352('0x5'));var config=require(_0xd352('0x6'));var attributes=require(_0xd352('0x7'));module[_0xd352('0x8')]=function(_0x27954c,_0x242ed2){return _0x27954c['define'](_0xd352('0x9'),attributes,{'tableName':_0xd352('0xa'),'paranoid':![],'indexes':[{'name':_0xd352('0xb'),'fields':[_0xd352('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 72355dc..e6e94c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['options','raw','UpdateMailQueueReport','where','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateMailQueueReport','MailQueueReport','body'];(function(_0x2ed92f,_0x54091f){var _0x26ff04=function(_0x5ed317){while(--_0x5ed317){_0x2ed92f['push'](_0x2ed92f['shift']());}};_0x26ff04(++_0x54091f);}(_0x2ef3,0xba));var _0x32ef=function(_0x230793,_0x1a47b1){_0x230793=_0x230793-0x0;var _0x10ea01=_0x2ef3[_0x230793];return _0x10ea01;};'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')]('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['create'](_0x1a9476[_0x32ef('0x17')],{'raw':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![]})[_0x32ef('0xb')](function(_0x3aec05){logger['info'](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x3aec05));_0x57863c(_0x3aec05);})['catch'](function(_0x1af371){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x1af371['message'],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x1af371[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1a')]=function(_0x225feb){var _0x478bef=this;return new Promise(function(_0x59585f,_0x19ea6){return db['MailQueueReport']['update'](_0x225feb[_0x32ef('0x17')],{'raw':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1b')]||null:null,'attributes':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1c')]||null:null,'limit':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')]['limit']||null:null})[_0x32ef('0xb')](function(_0x2f5d06){logger['info'](_0x32ef('0x1a'),_0x225feb);logger[_0x32ef('0x1d')](_0x32ef('0x1a'),_0x225feb,JSON[_0x32ef('0x10')](_0x2f5d06));_0x59585f(_0x2f5d06);})['catch'](function(_0x10e38c){logger[_0x32ef('0x11')](_0x32ef('0x1a'),_0x10e38c[_0x32ef('0x13')],_0x225feb);_0x19ea6(_0x478bef[_0x32ef('0x11')](0x1f4,_0x10e38c[_0x32ef('0x13')]));});});};
\ No newline at end of file
+var _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0x546fe3,_0x459fae){var _0x2b0a96=function(_0x164127){while(--_0x164127){_0x546fe3['push'](_0x546fe3['shift']());}};_0x2b0a96(++_0x459fae);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xc4aa[_0x3511d3];return _0x5d6321;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});};
\ No newline at end of file
index 4df963a..5f59e89 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(_0x2ac992,_0x37c877){var _0x223c9d=function(_0x2d4865){while(--_0x2d4865){_0x2ac992['push'](_0x2ac992['shift']());}};_0x223c9d(++_0x37c877);}(_0x9c44,0x178));var _0x49c4=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x9c44[_0x3ab51d];return _0x29a04e;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3aa7ab,_0x44a2c5){var _0x466604=function(_0x5e07be){while(--_0x5e07be){_0x3aa7ab['push'](_0x3aa7ab['shift']());}};_0x466604(++_0x44a2c5);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
index 42d4610..a348ba2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53db=['STRING','BOOLEAN','INTEGER','INBOX','sequelize','exports'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x53db,0x1c6));var _0xb53d=function(_0x225bf9,_0x1671a9){_0x225bf9=_0x225bf9-0x0;var _0x119315=_0x53db[_0x225bf9];return _0x119315;};'use strict';var Sequelize=require(_0xb53d('0x0'));module[_0xb53d('0x1')]={'description':{'type':Sequelize[_0xb53d('0x2')]},'host':{'type':Sequelize[_0xb53d('0x2')]},'authentication':{'type':Sequelize[_0xb53d('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xb53d('0x4')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xb53d('0x2')],'defaultValue':_0xb53d('0x5')},'connTimeout':{'type':Sequelize[_0xb53d('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xb53d('0x4')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xe148=['STRING','INTEGER','BOOLEAN','exports'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xe148,0x183));var _0x8e14=function(_0x13843f,_0x50422d){_0x13843f=_0x13843f-0x0;var _0x1063ae=_0xe148[_0x13843f];return _0x1063ae;};'use strict';var Sequelize=require('sequelize');module[_0x8e14('0x0')]={'description':{'type':Sequelize[_0x8e14('0x1')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x8e14('0x1')]},'port':{'type':Sequelize[_0x8e14('0x2')]},'tls':{'type':Sequelize[_0x8e14('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x8e14('0x2')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x8e14('0x2')],'defaultValue':0x5},'service':{'type':Sequelize[_0x8e14('0x1')]},'modernAuthentication':{'type':Sequelize[_0x8e14('0x3')],'defaultValue':![]}};
\ No newline at end of file
index 12c4471..f77706a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc822=['rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','util','api','moment','path'];(function(_0x488380,_0xfbd584){var _0x4fbf93=function(_0x321849){while(--_0x321849){_0x488380['push'](_0x488380['shift']());}};_0x4fbf93(++_0xfbd584);}(_0xc822,0x19f));var _0x2c82=function(_0x3c7d53,_0x2826d0){_0x3c7d53=_0x3c7d53-0x0;var _0x2c8387=_0xc822[_0x3c7d53];return _0x2c8387;};'use strict';var _=require(_0x2c82('0x0'));var util=require(_0x2c82('0x1'));var logger=require('../../config/logger')(_0x2c82('0x2'));var moment=require(_0x2c82('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2c82('0x4'));var rimraf=require(_0x2c82('0x5'));var config=require(_0x2c82('0x6'));var attributes=require(_0x2c82('0x7'));module[_0x2c82('0x8')]=function(_0x1f2a12,_0x2cee3d){return _0x1f2a12[_0x2c82('0x9')](_0x2c82('0xa'),attributes,{'tableName':_0x2c82('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc3d6=['../../config/environment','./mailServerIn.attributes','exports','define','mail_servers_in','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x431e74,_0x521450){var _0x205cb4=function(_0x19f6db){while(--_0x19f6db){_0x431e74['push'](_0x431e74['shift']());}};_0x205cb4(++_0x521450);}(_0xc3d6,0x1f1));var _0x6c3d=function(_0x39268c,_0x523449){_0x39268c=_0x39268c-0x0;var _0x20fd81=_0xc3d6[_0x39268c];return _0x20fd81;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6c3d('0x0'))(_0x6c3d('0x1'));var moment=require(_0x6c3d('0x2'));var BPromise=require(_0x6c3d('0x3'));var rp=require(_0x6c3d('0x4'));var fs=require('fs');var path=require(_0x6c3d('0x5'));var rimraf=require(_0x6c3d('0x6'));var config=require(_0x6c3d('0x7'));var attributes=require(_0x6c3d('0x8'));module[_0x6c3d('0x9')]=function(_0x500cb3,_0x45f94e){return _0x500cb3[_0x6c3d('0xa')]('MailServerIn',attributes,{'tableName':_0x6c3d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3e49728..eba5334 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59e0=['request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','MailServerIn','options','attributes','limit','include','map','model','GetMailServerIn','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x59e0,0x1f4));var _0x059e=function(_0x515a51,_0x7abdbc){_0x515a51=_0x515a51-0x0;var _0x39f1a3=_0x59e0[_0x515a51];return _0x39f1a3;};'use strict';var _=require('lodash');var util=require(_0x059e('0x0'));var moment=require(_0x059e('0x1'));var BPromise=require(_0x059e('0x2'));var rs=require(_0x059e('0x3'));var fs=require('fs');var Redis=require(_0x059e('0x4'));var db=require(_0x059e('0x5'))['db'];var utils=require(_0x059e('0x6'));var logger=require(_0x059e('0x7'))(_0x059e('0x8'));var config=require(_0x059e('0x9'));var jayson=require(_0x059e('0xa'));var client=jayson[_0x059e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33c735,_0x13ed91,_0x5523b9){return new BPromise(function(_0x5424c0,_0x15aa18){return client[_0x059e('0xc')](_0x33c735,_0x5523b9)[_0x059e('0xd')](function(_0x1b146c){logger[_0x059e('0xe')](_0x059e('0xf'),_0x13ed91,_0x059e('0x10'));logger[_0x059e('0x11')](_0x059e('0x12'),_0x13ed91,_0x059e('0x10'),JSON[_0x059e('0x13')](_0x1b146c));if(_0x1b146c['error']){if(_0x1b146c[_0x059e('0x14')][_0x059e('0x15')]===0x1f4){logger[_0x059e('0x14')](_0x059e('0xf'),_0x13ed91,_0x1b146c['error']['message']);return _0x15aa18(_0x1b146c[_0x059e('0x14')]['message']);}logger[_0x059e('0x14')]('MailServerIn,\x20%s,\x20%s',_0x13ed91,_0x1b146c[_0x059e('0x14')][_0x059e('0x16')]);return _0x5424c0(_0x1b146c[_0x059e('0x14')][_0x059e('0x16')]);}else{logger[_0x059e('0xe')](_0x059e('0xf'),_0x13ed91,_0x059e('0x10'));_0x5424c0(_0x1b146c['result'][_0x059e('0x16')]);}})[_0x059e('0x17')](function(_0x46277c){logger['error']('MailServerIn,\x20%s,\x20%s',_0x13ed91,_0x46277c);_0x15aa18(_0x46277c);});});}exports['GetMailServerIn']=function(_0x4f42d0){var _0x84f528=this;return new Promise(function(_0x259c16,_0x1318f5){return db[_0x059e('0x18')]['findAll']({'raw':_0x4f42d0[_0x059e('0x19')]?_0x4f42d0[_0x059e('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4f42d0[_0x059e('0x19')]?_0x4f42d0[_0x059e('0x19')]['where']||null:null,'attributes':_0x4f42d0[_0x059e('0x19')]?_0x4f42d0[_0x059e('0x19')][_0x059e('0x1a')]||null:null,'limit':_0x4f42d0[_0x059e('0x19')]?_0x4f42d0[_0x059e('0x19')][_0x059e('0x1b')]||null:null,'include':_0x4f42d0[_0x059e('0x19')]?_0x4f42d0[_0x059e('0x19')][_0x059e('0x1c')]?_[_0x059e('0x1d')](_0x4f42d0[_0x059e('0x19')]['include'],function(_0x5f4412){return{'model':db[_0x5f4412[_0x059e('0x1e')]],'as':_0x5f4412['as'],'attributes':_0x5f4412[_0x059e('0x1a')],'include':_0x5f4412['include']?_[_0x059e('0x1d')](_0x5f4412['include'],function(_0x4b7c60){return{'model':db[_0x4b7c60[_0x059e('0x1e')]],'as':_0x4b7c60['as'],'attributes':_0x4b7c60['attributes'],'include':_0x4b7c60['include']?_[_0x059e('0x1d')](_0x4b7c60[_0x059e('0x1c')],function(_0x1ced76){return{'model':db[_0x1ced76[_0x059e('0x1e')]],'as':_0x1ced76['as'],'attributes':_0x1ced76[_0x059e('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2af7e2){logger[_0x059e('0xe')]('GetMailServerIn',_0x4f42d0);logger['debug'](_0x059e('0x1f'),_0x4f42d0,JSON[_0x059e('0x13')](_0x2af7e2));_0x259c16(_0x2af7e2);})['catch'](function(_0xba1b2f){logger[_0x059e('0x14')](_0x059e('0x1f'),_0xba1b2f[_0x059e('0x16')],_0x4f42d0);_0x1318f5(_0x84f528[_0x059e('0x14')](0x1f4,_0xba1b2f[_0x059e('0x16')]));});});};
\ No newline at end of file
+var _0xa2ab=['info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','MailServerIn','options','where','attributes','include','map','model','then','GetMailServerIn','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x1d0ec5,_0x1632e8){var _0x378d84=function(_0xc78d4b){while(--_0xc78d4b){_0x1d0ec5['push'](_0x1d0ec5['shift']());}};_0x378d84(++_0x1632e8);}(_0xa2ab,0xa7));var _0xba2a=function(_0x8ca72f,_0x2ccb6d){_0x8ca72f=_0x8ca72f-0x0;var _0x501ace=_0xa2ab[_0x8ca72f];return _0x501ace;};'use strict';var _=require(_0xba2a('0x0'));var util=require(_0xba2a('0x1'));var moment=require(_0xba2a('0x2'));var BPromise=require('bluebird');var rs=require(_0xba2a('0x3'));var fs=require('fs');var Redis=require(_0xba2a('0x4'));var db=require(_0xba2a('0x5'))['db'];var utils=require(_0xba2a('0x6'));var logger=require(_0xba2a('0x7'))(_0xba2a('0x8'));var config=require(_0xba2a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xba2a('0xa')][_0xba2a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3eb9f9,_0x4c8719,_0xd09a60){return new BPromise(function(_0xf818d1,_0x2a40c6){return client[_0xba2a('0xc')](_0x3eb9f9,_0xd09a60)['then'](function(_0xb2ff17){logger[_0xba2a('0xd')](_0xba2a('0xe'),_0x4c8719,_0xba2a('0xf'));logger[_0xba2a('0x10')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x4c8719,_0xba2a('0xf'),JSON[_0xba2a('0x11')](_0xb2ff17));if(_0xb2ff17[_0xba2a('0x12')]){if(_0xb2ff17[_0xba2a('0x12')]['code']===0x1f4){logger[_0xba2a('0x12')](_0xba2a('0xe'),_0x4c8719,_0xb2ff17[_0xba2a('0x12')][_0xba2a('0x13')]);return _0x2a40c6(_0xb2ff17[_0xba2a('0x12')]['message']);}logger[_0xba2a('0x12')](_0xba2a('0xe'),_0x4c8719,_0xb2ff17[_0xba2a('0x12')][_0xba2a('0x13')]);return _0xf818d1(_0xb2ff17['error'][_0xba2a('0x13')]);}else{logger[_0xba2a('0xd')](_0xba2a('0xe'),_0x4c8719,_0xba2a('0xf'));_0xf818d1(_0xb2ff17['result'][_0xba2a('0x13')]);}})[_0xba2a('0x14')](function(_0x4b37e4){logger[_0xba2a('0x12')]('MailServerIn,\x20%s,\x20%s',_0x4c8719,_0x4b37e4);_0x2a40c6(_0x4b37e4);});});}exports['GetMailServerIn']=function(_0x559c6e){var _0x283846=this;return new Promise(function(_0xa56be8,_0x20225e){return db[_0xba2a('0x15')]['findAll']({'raw':_0x559c6e[_0xba2a('0x16')]?_0x559c6e[_0xba2a('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x559c6e[_0xba2a('0x16')]?_0x559c6e['options'][_0xba2a('0x17')]||null:null,'attributes':_0x559c6e[_0xba2a('0x16')]?_0x559c6e[_0xba2a('0x16')][_0xba2a('0x18')]||null:null,'limit':_0x559c6e[_0xba2a('0x16')]?_0x559c6e[_0xba2a('0x16')]['limit']||null:null,'include':_0x559c6e[_0xba2a('0x16')]?_0x559c6e[_0xba2a('0x16')][_0xba2a('0x19')]?_[_0xba2a('0x1a')](_0x559c6e[_0xba2a('0x16')]['include'],function(_0xdfbf5c){return{'model':db[_0xdfbf5c[_0xba2a('0x1b')]],'as':_0xdfbf5c['as'],'attributes':_0xdfbf5c[_0xba2a('0x18')],'include':_0xdfbf5c[_0xba2a('0x19')]?_[_0xba2a('0x1a')](_0xdfbf5c[_0xba2a('0x19')],function(_0x24ee7d){return{'model':db[_0x24ee7d[_0xba2a('0x1b')]],'as':_0x24ee7d['as'],'attributes':_0x24ee7d['attributes'],'include':_0x24ee7d[_0xba2a('0x19')]?_[_0xba2a('0x1a')](_0x24ee7d[_0xba2a('0x19')],function(_0x2a001c){return{'model':db[_0x2a001c['model']],'as':_0x2a001c['as'],'attributes':_0x2a001c[_0xba2a('0x18')]};}):[]};}):[]};}):[]:[]})[_0xba2a('0x1c')](function(_0x2af93a){logger['info']('GetMailServerIn',_0x559c6e);logger[_0xba2a('0x10')](_0xba2a('0x1d'),_0x559c6e,JSON[_0xba2a('0x11')](_0x2af93a));_0xa56be8(_0x2af93a);})[_0xba2a('0x14')](function(_0x3aa95a){logger[_0xba2a('0x12')](_0xba2a('0x1d'),_0x3aa95a[_0xba2a('0x13')],_0x559c6e);_0x20225e(_0x283846[_0xba2a('0x12')](0x1f4,_0x3aa95a[_0xba2a('0x13')]));});});};
\ No newline at end of file
index 2ea4478..b46d2a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('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 _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(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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 93f8315..622285c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4213=['exports','STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x1fc1f9,_0x454fb2){var _0x4987ca=function(_0x5e90dd){while(--_0x5e90dd){_0x1fc1f9['push'](_0x1fc1f9['shift']());}};_0x4987ca(++_0x454fb2);}(_0x4213,0x77));var _0x3421=function(_0x400a1d,_0x4cde7a){_0x400a1d=_0x400a1d-0x0;var _0x406ef0=_0x4213[_0x400a1d];return _0x406ef0;};'use strict';var Sequelize=require(_0x3421('0x0'));module[_0x3421('0x1')]={'description':{'type':Sequelize[_0x3421('0x2')]},'host':{'type':Sequelize[_0x3421('0x2')]},'user':{'type':Sequelize[_0x3421('0x2')]},'pass':{'type':Sequelize[_0x3421('0x2')]},'port':{'type':Sequelize[_0x3421('0x3')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x3421('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x3421('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x1775=['STRING','INTEGER','BOOLEAN','exports'];(function(_0x436521,_0x4939e6){var _0x1981c4=function(_0x1979c8){while(--_0x1979c8){_0x436521['push'](_0x436521['shift']());}};_0x1981c4(++_0x4939e6);}(_0x1775,0x1db));var _0x5177=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x1775[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');module[_0x5177('0x0')]={'description':{'type':Sequelize[_0x5177('0x1')]},'host':{'type':Sequelize[_0x5177('0x1')]},'user':{'type':Sequelize[_0x5177('0x1')]},'pass':{'type':Sequelize[_0x5177('0x1')]},'port':{'type':Sequelize[_0x5177('0x2')]},'secure':{'type':Sequelize[_0x5177('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x5177('0x1')]},'authentication':{'type':Sequelize[_0x5177('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x5177('0x3')],'defaultValue':![]}};
\ No newline at end of file
index 380b8a3..c3c6b10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2c2=['create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','end','error','stack','name','send','index','map','MailServerOut','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','type','options','findAll','rows','catch','show','params','keys','length','includeAll','merge'];(function(_0x3370c4,_0x4a4410){var _0xfa0050=function(_0x45118c){while(--_0x45118c){_0x3370c4['push'](_0x3370c4['shift']());}};_0xfa0050(++_0x4a4410);}(_0xe2c2,0x16a));var _0x2e2c=function(_0x4c3090,_0x1b2aa7){_0x4c3090=_0x4c3090-0x0;var _0x35eb38=_0xe2c2[_0x4c3090];return _0x35eb38;};'use strict';var emlformat=require(_0x2e2c('0x0'));var rimraf=require(_0x2e2c('0x1'));var zipdir=require(_0x2e2c('0x2'));var jsonpatch=require(_0x2e2c('0x3'));var rp=require('request-promise');var moment=require(_0x2e2c('0x4'));var BPromise=require(_0x2e2c('0x5'));var Mustache=require(_0x2e2c('0x6'));var util=require(_0x2e2c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x2e2c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2e2c('0x9'));var _=require(_0x2e2c('0xa'));var squel=require(_0x2e2c('0xb'));var crypto=require(_0x2e2c('0xc'));var jsforce=require(_0x2e2c('0xd'));var deskjs=require(_0x2e2c('0xe'));var toCsv=require(_0x2e2c('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2e2c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2e2c('0x10'));var as=require(_0x2e2c('0x11'));var hardwareService=require(_0x2e2c('0x12'));var logger=require(_0x2e2c('0x13'))(_0x2e2c('0x14'));var utils=require(_0x2e2c('0x15'));var config=require(_0x2e2c('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x2e2c('0x17'))['db'];function respondWithStatusCode(_0x91832c,_0x4340d5){_0x4340d5=_0x4340d5||0xcc;return function(_0x1cd8e5){if(_0x1cd8e5){return _0x91832c[_0x2e2c('0x18')](_0x4340d5);}return _0x91832c[_0x2e2c('0x19')](_0x4340d5)['end']();};}function respondWithResult(_0x565f2f,_0x2677cd){_0x2677cd=_0x2677cd||0xc8;return function(_0x365b37){if(_0x365b37){return _0x565f2f[_0x2e2c('0x19')](_0x2677cd)[_0x2e2c('0x1a')](_0x365b37);}};}function respondWithFilteredResult(_0x2ec42c,_0x54eaf6){return function(_0xc7bff5){if(_0xc7bff5){var _0x119d12=typeof _0x54eaf6[_0x2e2c('0x1b')]===_0x2e2c('0x1c')&&typeof _0x54eaf6[_0x2e2c('0x1d')]===_0x2e2c('0x1c');var _0x4fd735=_0xc7bff5[_0x2e2c('0x1e')];var _0x5ea86f=_0x119d12?0x0:_0x54eaf6[_0x2e2c('0x1b')];var _0x8af228=_0x119d12?_0xc7bff5[_0x2e2c('0x1e')]:_0x54eaf6[_0x2e2c('0x1b')]+_0x54eaf6[_0x2e2c('0x1d')];var _0x1f5f7d;if(_0x8af228>=_0x4fd735){_0x8af228=_0x4fd735;_0x1f5f7d=0xc8;}else{_0x1f5f7d=0xce;}_0x2ec42c[_0x2e2c('0x19')](_0x1f5f7d);return _0x2ec42c[_0x2e2c('0x1f')](_0x2e2c('0x20'),_0x5ea86f+'-'+_0x8af228+'/'+_0x4fd735)[_0x2e2c('0x1a')](_0xc7bff5);}return null;};}function patchUpdates(_0x400255){return function(_0xb2c5e6){try{jsonpatch['apply'](_0xb2c5e6,_0x400255,!![]);}catch(_0x2705c0){return BPromise[_0x2e2c('0x21')](_0x2705c0);}return _0xb2c5e6[_0x2e2c('0x22')]();};}function saveUpdates(_0x34157f,_0x3076d3){return function(_0x1eb92b){if(_0x1eb92b){return _0x1eb92b[_0x2e2c('0x23')](_0x34157f)[_0x2e2c('0x24')](function(_0x3def70){return _0x3def70;});}return null;};}function removeEntity(_0xbac6db,_0xbb1d37){return function(_0x5cd053){if(_0x5cd053){return _0x5cd053['destroy']()['then'](function(){_0xbac6db[_0x2e2c('0x19')](0xcc)[_0x2e2c('0x25')]();});}};}function handleEntityNotFound(_0x1fc4aa,_0x2aee77){return function(_0x56b6e5){if(!_0x56b6e5){_0x1fc4aa['sendStatus'](0x194);}return _0x56b6e5;};}function handleError(_0x2bae3e,_0x13e09c){_0x13e09c=_0x13e09c||0x1f4;return function(_0x3fb2e1){logger[_0x2e2c('0x26')](_0x3fb2e1[_0x2e2c('0x27')]);if(_0x3fb2e1[_0x2e2c('0x28')]){delete _0x3fb2e1[_0x2e2c('0x28')];}_0x2bae3e['status'](_0x13e09c)[_0x2e2c('0x29')](_0x3fb2e1);};}exports[_0x2e2c('0x2a')]=function(_0x524236,_0x59c744){var _0x550ca7={},_0x345eb8={},_0xf1c6aa={'count':0x0,'rows':[]};var _0x30c038=_[_0x2e2c('0x2b')](db[_0x2e2c('0x2c')]['rawAttributes'],function(_0x42988e){return{'name':_0x42988e[_0x2e2c('0x2d')],'type':_0x42988e['type'][_0x2e2c('0x2e')]};});_0x345eb8[_0x2e2c('0x2f')]=_[_0x2e2c('0x2b')](_0x30c038,_0x2e2c('0x28'));_0x345eb8[_0x2e2c('0x30')]=_['keys'](_0x524236[_0x2e2c('0x30')]);_0x345eb8[_0x2e2c('0x31')]=_[_0x2e2c('0x32')](_0x345eb8['model'],_0x345eb8['query']);_0x550ca7['attributes']=_[_0x2e2c('0x32')](_0x345eb8[_0x2e2c('0x2f')],qs[_0x2e2c('0x33')](_0x524236[_0x2e2c('0x30')][_0x2e2c('0x33')]));_0x550ca7['attributes']=_0x550ca7[_0x2e2c('0x34')]['length']?_0x550ca7[_0x2e2c('0x34')]:_0x345eb8[_0x2e2c('0x2f')];if(!_0x524236[_0x2e2c('0x30')][_0x2e2c('0x35')](_0x2e2c('0x36'))){_0x550ca7['limit']=qs['limit'](_0x524236[_0x2e2c('0x30')][_0x2e2c('0x1d')]);_0x550ca7['offset']=qs[_0x2e2c('0x1b')](_0x524236[_0x2e2c('0x30')][_0x2e2c('0x1b')]);}_0x550ca7['order']=qs[_0x2e2c('0x37')](_0x524236[_0x2e2c('0x30')][_0x2e2c('0x37')]);_0x550ca7[_0x2e2c('0x38')]=qs[_0x2e2c('0x31')](_[_0x2e2c('0x39')](_0x524236[_0x2e2c('0x30')],_0x345eb8['filters']),_0x30c038);if(_0x524236['query'][_0x2e2c('0x3a')]){_0x550ca7[_0x2e2c('0x38')]=_['merge'](_0x550ca7[_0x2e2c('0x38')],{'$or':_['map'](_0x30c038,function(_0x405957){if(_0x405957[_0x2e2c('0x3b')]!=='VIRTUAL'){var _0x1c72ed={};_0x1c72ed[_0x405957[_0x2e2c('0x28')]]={'$like':'%'+_0x524236[_0x2e2c('0x30')][_0x2e2c('0x3a')]+'%'};return _0x1c72ed;}})});}_0x550ca7=_['merge']({},_0x550ca7,_0x524236[_0x2e2c('0x3c')]);var _0x292caa={'where':_0x550ca7[_0x2e2c('0x38')]};return db[_0x2e2c('0x2c')]['count'](_0x292caa)['then'](function(_0x4d29a8){_0xf1c6aa['count']=_0x4d29a8;if(_0x524236[_0x2e2c('0x30')]['includeAll']){_0x550ca7['include']=[{'all':!![]}];}return db['MailServerOut'][_0x2e2c('0x3d')](_0x550ca7);})[_0x2e2c('0x24')](function(_0x152a53){_0xf1c6aa[_0x2e2c('0x3e')]=_0x152a53;return _0xf1c6aa;})['then'](respondWithFilteredResult(_0x59c744,_0x550ca7))[_0x2e2c('0x3f')](handleError(_0x59c744,null));};exports[_0x2e2c('0x40')]=function(_0x5f1f6c,_0x17cfe5){var _0x3ae50b={'raw':!![],'where':{'id':_0x5f1f6c[_0x2e2c('0x41')]['id']}},_0x403ab8={};_0x403ab8[_0x2e2c('0x2f')]=_[_0x2e2c('0x42')](db[_0x2e2c('0x2c')]['rawAttributes']);_0x403ab8[_0x2e2c('0x30')]=_[_0x2e2c('0x42')](_0x5f1f6c[_0x2e2c('0x30')]);_0x403ab8[_0x2e2c('0x31')]=_[_0x2e2c('0x32')](_0x403ab8[_0x2e2c('0x2f')],_0x403ab8[_0x2e2c('0x30')]);_0x3ae50b[_0x2e2c('0x34')]=_[_0x2e2c('0x32')](_0x403ab8[_0x2e2c('0x2f')],qs[_0x2e2c('0x33')](_0x5f1f6c[_0x2e2c('0x30')][_0x2e2c('0x33')]));_0x3ae50b[_0x2e2c('0x34')]=_0x3ae50b[_0x2e2c('0x34')][_0x2e2c('0x43')]?_0x3ae50b[_0x2e2c('0x34')]:_0x403ab8['model'];if(_0x5f1f6c[_0x2e2c('0x30')][_0x2e2c('0x44')]){_0x3ae50b['include']=[{'all':!![]}];}_0x3ae50b=_[_0x2e2c('0x45')]({},_0x3ae50b,_0x5f1f6c['options']);return db['MailServerOut']['find'](_0x3ae50b)[_0x2e2c('0x24')](handleEntityNotFound(_0x17cfe5,null))['then'](respondWithResult(_0x17cfe5,null))[_0x2e2c('0x3f')](handleError(_0x17cfe5,null));};exports['create']=function(_0x25c689,_0x525bf6){return db['MailServerOut'][_0x2e2c('0x46')](_0x25c689[_0x2e2c('0x47')],{})[_0x2e2c('0x24')](respondWithResult(_0x525bf6,0xc9))[_0x2e2c('0x3f')](handleError(_0x525bf6,null));};exports[_0x2e2c('0x23')]=function(_0x293c5c,_0x5eaecd){if(_0x293c5c[_0x2e2c('0x47')]['id']){delete _0x293c5c[_0x2e2c('0x47')]['id'];}return db['MailServerOut']['find']({'where':{'id':_0x293c5c[_0x2e2c('0x41')]['id']}})['then'](handleEntityNotFound(_0x5eaecd,null))[_0x2e2c('0x24')](saveUpdates(_0x293c5c['body'],null))[_0x2e2c('0x24')](respondWithResult(_0x5eaecd,null))[_0x2e2c('0x3f')](handleError(_0x5eaecd,null));};exports['destroy']=function(_0x3af921,_0x120270){return db[_0x2e2c('0x2c')]['find']({'where':{'id':_0x3af921[_0x2e2c('0x41')]['id']}})['then'](handleEntityNotFound(_0x120270,null))[_0x2e2c('0x24')](removeEntity(_0x120270,null))['catch'](handleError(_0x120270,null));};
\ No newline at end of file
+var _0xb469=['apply','reject','update','then','destroy','error','stack','name','send','index','MailServerOut','rawAttributes','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','map','options','includeAll','rows','catch','show','keys','include','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','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','sendStatus','status','end','json','limit','offset','count','set','Content-Range'];(function(_0x2d120a,_0x5e4d33){var _0x205747=function(_0x3530de){while(--_0x3530de){_0x2d120a['push'](_0x2d120a['shift']());}};_0x205747(++_0x5e4d33);}(_0xb469,0x10d));var _0x9b46=function(_0x762290,_0x4b67af){_0x762290=_0x762290-0x0;var _0x398c13=_0xb469[_0x762290];return _0x398c13;};'use strict';var emlformat=require(_0x9b46('0x0'));var rimraf=require(_0x9b46('0x1'));var zipdir=require(_0x9b46('0x2'));var jsonpatch=require(_0x9b46('0x3'));var rp=require(_0x9b46('0x4'));var moment=require(_0x9b46('0x5'));var BPromise=require(_0x9b46('0x6'));var Mustache=require(_0x9b46('0x7'));var util=require('util');var path=require(_0x9b46('0x8'));var sox=require(_0x9b46('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9b46('0xa'));var _=require(_0x9b46('0xb'));var squel=require(_0x9b46('0xc'));var crypto=require(_0x9b46('0xd'));var jsforce=require(_0x9b46('0xe'));var deskjs=require(_0x9b46('0xf'));var toCsv=require(_0x9b46('0x10'));var querystring=require('querystring');var Papa=require(_0x9b46('0x11'));var Redis=require(_0x9b46('0x12'));var authService=require(_0x9b46('0x13'));var qs=require(_0x9b46('0x14'));var as=require(_0x9b46('0x15'));var hardwareService=require(_0x9b46('0x16'));var logger=require('../../config/logger')(_0x9b46('0x17'));var utils=require(_0x9b46('0x18'));var config=require(_0x9b46('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x530a2c,_0x5e5a8a){_0x5e5a8a=_0x5e5a8a||0xcc;return function(_0xd3a00b){if(_0xd3a00b){return _0x530a2c[_0x9b46('0x1a')](_0x5e5a8a);}return _0x530a2c[_0x9b46('0x1b')](_0x5e5a8a)[_0x9b46('0x1c')]();};}function respondWithResult(_0x569656,_0x1caf0f){_0x1caf0f=_0x1caf0f||0xc8;return function(_0x4ff6fa){if(_0x4ff6fa){return _0x569656[_0x9b46('0x1b')](_0x1caf0f)[_0x9b46('0x1d')](_0x4ff6fa);}};}function respondWithFilteredResult(_0x24602c,_0x406117){return function(_0x83971){if(_0x83971){var _0xea608a=typeof _0x406117['offset']==='undefined'&&typeof _0x406117[_0x9b46('0x1e')]==='undefined';var _0x99fbc8=_0x83971['count'];var _0x4e57a4=_0xea608a?0x0:_0x406117[_0x9b46('0x1f')];var _0x337bef=_0xea608a?_0x83971[_0x9b46('0x20')]:_0x406117[_0x9b46('0x1f')]+_0x406117['limit'];var _0x32f7f0;if(_0x337bef>=_0x99fbc8){_0x337bef=_0x99fbc8;_0x32f7f0=0xc8;}else{_0x32f7f0=0xce;}_0x24602c[_0x9b46('0x1b')](_0x32f7f0);return _0x24602c[_0x9b46('0x21')](_0x9b46('0x22'),_0x4e57a4+'-'+_0x337bef+'/'+_0x99fbc8)['json'](_0x83971);}return null;};}function patchUpdates(_0x23cd49){return function(_0x41a876){try{jsonpatch[_0x9b46('0x23')](_0x41a876,_0x23cd49,!![]);}catch(_0x45244a){return BPromise[_0x9b46('0x24')](_0x45244a);}return _0x41a876['save']();};}function saveUpdates(_0xcb9f08,_0x52f8e6){return function(_0x5047ad){if(_0x5047ad){return _0x5047ad[_0x9b46('0x25')](_0xcb9f08)[_0x9b46('0x26')](function(_0x3d5f89){return _0x3d5f89;});}return null;};}function removeEntity(_0x119b71,_0x3ee9c9){return function(_0x29c842){if(_0x29c842){return _0x29c842[_0x9b46('0x27')]()[_0x9b46('0x26')](function(){_0x119b71[_0x9b46('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x493e58,_0x345c58){return function(_0x34074d){if(!_0x34074d){_0x493e58['sendStatus'](0x194);}return _0x34074d;};}function handleError(_0x7614ee,_0x3f54d1){_0x3f54d1=_0x3f54d1||0x1f4;return function(_0x557ec3){logger[_0x9b46('0x28')](_0x557ec3[_0x9b46('0x29')]);if(_0x557ec3[_0x9b46('0x2a')]){delete _0x557ec3[_0x9b46('0x2a')];}_0x7614ee[_0x9b46('0x1b')](_0x3f54d1)[_0x9b46('0x2b')](_0x557ec3);};}exports[_0x9b46('0x2c')]=function(_0x55d17e,_0x3d977c){var _0x35801f={},_0x56f359={},_0xfe4ab={'count':0x0,'rows':[]};var _0x313a0b=_['map'](db[_0x9b46('0x2d')][_0x9b46('0x2e')],function(_0x4d6cfd){return{'name':_0x4d6cfd[_0x9b46('0x2f')],'type':_0x4d6cfd[_0x9b46('0x30')][_0x9b46('0x31')]};});_0x56f359['model']=_['map'](_0x313a0b,'name');_0x56f359['query']=_['keys'](_0x55d17e[_0x9b46('0x32')]);_0x56f359['filters']=_['intersection'](_0x56f359[_0x9b46('0x33')],_0x56f359[_0x9b46('0x32')]);_0x35801f[_0x9b46('0x34')]=_[_0x9b46('0x35')](_0x56f359[_0x9b46('0x33')],qs['fields'](_0x55d17e[_0x9b46('0x32')][_0x9b46('0x36')]));_0x35801f[_0x9b46('0x34')]=_0x35801f['attributes'][_0x9b46('0x37')]?_0x35801f['attributes']:_0x56f359[_0x9b46('0x33')];if(!_0x55d17e[_0x9b46('0x32')][_0x9b46('0x38')]('nolimit')){_0x35801f[_0x9b46('0x1e')]=qs[_0x9b46('0x1e')](_0x55d17e[_0x9b46('0x32')]['limit']);_0x35801f[_0x9b46('0x1f')]=qs[_0x9b46('0x1f')](_0x55d17e[_0x9b46('0x32')][_0x9b46('0x1f')]);}_0x35801f[_0x9b46('0x39')]=qs['sort'](_0x55d17e[_0x9b46('0x32')][_0x9b46('0x3a')]);_0x35801f[_0x9b46('0x3b')]=qs[_0x9b46('0x3c')](_[_0x9b46('0x3d')](_0x55d17e[_0x9b46('0x32')],_0x56f359[_0x9b46('0x3c')]),_0x313a0b);if(_0x55d17e[_0x9b46('0x32')][_0x9b46('0x3e')]){_0x35801f['where']=_[_0x9b46('0x3f')](_0x35801f['where'],{'$or':_[_0x9b46('0x40')](_0x313a0b,function(_0x58b047){if(_0x58b047['type']!=='VIRTUAL'){var _0xc9e5bb={};_0xc9e5bb[_0x58b047['name']]={'$like':'%'+_0x55d17e[_0x9b46('0x32')][_0x9b46('0x3e')]+'%'};return _0xc9e5bb;}})});}_0x35801f=_[_0x9b46('0x3f')]({},_0x35801f,_0x55d17e[_0x9b46('0x41')]);var _0x4077f2={'where':_0x35801f[_0x9b46('0x3b')]};return db['MailServerOut']['count'](_0x4077f2)[_0x9b46('0x26')](function(_0xf99a0e){_0xfe4ab[_0x9b46('0x20')]=_0xf99a0e;if(_0x55d17e[_0x9b46('0x32')][_0x9b46('0x42')]){_0x35801f['include']=[{'all':!![]}];}return db['MailServerOut']['findAll'](_0x35801f);})['then'](function(_0x2a3662){_0xfe4ab[_0x9b46('0x43')]=_0x2a3662;return _0xfe4ab;})['then'](respondWithFilteredResult(_0x3d977c,_0x35801f))[_0x9b46('0x44')](handleError(_0x3d977c,null));};exports[_0x9b46('0x45')]=function(_0x1bff52,_0x45bfc7){var _0x1e020a={'raw':!![],'where':{'id':_0x1bff52['params']['id']}},_0x1f6102={};_0x1f6102['model']=_[_0x9b46('0x46')](db[_0x9b46('0x2d')][_0x9b46('0x2e')]);_0x1f6102['query']=_['keys'](_0x1bff52['query']);_0x1f6102[_0x9b46('0x3c')]=_[_0x9b46('0x35')](_0x1f6102[_0x9b46('0x33')],_0x1f6102['query']);_0x1e020a[_0x9b46('0x34')]=_[_0x9b46('0x35')](_0x1f6102[_0x9b46('0x33')],qs[_0x9b46('0x36')](_0x1bff52['query']['fields']));_0x1e020a[_0x9b46('0x34')]=_0x1e020a[_0x9b46('0x34')][_0x9b46('0x37')]?_0x1e020a[_0x9b46('0x34')]:_0x1f6102['model'];if(_0x1bff52[_0x9b46('0x32')][_0x9b46('0x42')]){_0x1e020a[_0x9b46('0x47')]=[{'all':!![]}];}_0x1e020a=_[_0x9b46('0x3f')]({},_0x1e020a,_0x1bff52['options']);return db[_0x9b46('0x2d')]['find'](_0x1e020a)[_0x9b46('0x26')](handleEntityNotFound(_0x45bfc7,null))[_0x9b46('0x26')](respondWithResult(_0x45bfc7,null))[_0x9b46('0x44')](handleError(_0x45bfc7,null));};exports['create']=function(_0x2a3a60,_0x59bf5a){return db[_0x9b46('0x2d')][_0x9b46('0x48')](_0x2a3a60[_0x9b46('0x49')],{})[_0x9b46('0x26')](respondWithResult(_0x59bf5a,0xc9))['catch'](handleError(_0x59bf5a,null));};exports[_0x9b46('0x25')]=function(_0xba8e30,_0x18d58b){if(_0xba8e30[_0x9b46('0x49')]['id']){delete _0xba8e30[_0x9b46('0x49')]['id'];}return db[_0x9b46('0x2d')][_0x9b46('0x4a')]({'where':{'id':_0xba8e30[_0x9b46('0x4b')]['id']}})[_0x9b46('0x26')](handleEntityNotFound(_0x18d58b,null))[_0x9b46('0x26')](saveUpdates(_0xba8e30[_0x9b46('0x49')],null))[_0x9b46('0x26')](respondWithResult(_0x18d58b,null))['catch'](handleError(_0x18d58b,null));};exports[_0x9b46('0x27')]=function(_0x59d3e7,_0x5e22d7){return db[_0x9b46('0x2d')][_0x9b46('0x4a')]({'where':{'id':_0x59d3e7[_0x9b46('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5e22d7,null))[_0x9b46('0x26')](removeEntity(_0x5e22d7,null))['catch'](handleError(_0x5e22d7,null));};
\ No newline at end of file
index 3c46969..8821789 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee29=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','lodash','util'];(function(_0x43b5d5,_0x9b910a){var _0x11fc85=function(_0x3d6602){while(--_0x3d6602){_0x43b5d5['push'](_0x43b5d5['shift']());}};_0x11fc85(++_0x9b910a);}(_0xee29,0xb4));var _0x9ee2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xee29[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9ee2('0x0'));var util=require(_0x9ee2('0x1'));var logger=require(_0x9ee2('0x2'))(_0x9ee2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9ee2('0x4'));var fs=require('fs');var path=require(_0x9ee2('0x5'));var rimraf=require(_0x9ee2('0x6'));var config=require(_0x9ee2('0x7'));var attributes=require(_0x9ee2('0x8'));module[_0x9ee2('0x9')]=function(_0x225e80,_0x36075a){return _0x225e80[_0x9ee2('0xa')](_0x9ee2('0xb'),attributes,{'tableName':_0x9ee2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x890d=['exports','define','mail_servers_out','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x4f4293,_0x23b779){var _0x37decc=function(_0x8e5bf6){while(--_0x8e5bf6){_0x4f4293['push'](_0x4f4293['shift']());}};_0x37decc(++_0x23b779);}(_0x890d,0x6f));var _0xd890=function(_0x446836,_0x19becf){_0x446836=_0x446836-0x0;var _0x4f0793=_0x890d[_0x446836];return _0x4f0793;};'use strict';var _=require(_0xd890('0x0'));var util=require(_0xd890('0x1'));var logger=require(_0xd890('0x2'))(_0xd890('0x3'));var moment=require(_0xd890('0x4'));var BPromise=require(_0xd890('0x5'));var rp=require(_0xd890('0x6'));var fs=require('fs');var path=require(_0xd890('0x7'));var rimraf=require('rimraf');var config=require(_0xd890('0x8'));var attributes=require('./mailServerOut.attributes');module[_0xd890('0x9')]=function(_0x43bc4f,_0x5df6e7){return _0x43bc4f[_0xd890('0xa')]('MailServerOut',attributes,{'tableName':_0xd890('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 36ba3f2..7b03b52 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1261=['then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x2b5e45,_0x417b0d){var _0xee63d7=function(_0x1a8cf2){while(--_0x1a8cf2){_0x2b5e45['push'](_0x2b5e45['shift']());}};_0xee63d7(++_0x417b0d);}(_0x1261,0x144));var _0x1126=function(_0x1bc445,_0x2d6fe0){_0x1bc445=_0x1bc445-0x0;var _0x589e6b=_0x1261[_0x1bc445];return _0x589e6b;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailServerOut,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
+var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x90b590,_0x424da0){var _0x5efc2f=function(_0x415ba6){while(--_0x415ba6){_0x90b590['push'](_0x90b590['shift']());}};_0x5efc2f(++_0x424da0);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1844f1,_0x14d2bd){_0x1844f1=_0x1844f1-0x0;var _0x59f3c3=_0x5f2f[_0x1844f1];return _0x59f3c3;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
index cb89e43..c10a238 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe934=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./mailSubstatus.controller','get','isAuthenticated','/describe','describe','show','create','put','/:id','update','delete','destroy','multer','util'];(function(_0x30730f,_0x3639f1){var _0x2d33cf=function(_0x33a8db){while(--_0x33a8db){_0x30730f['push'](_0x30730f['shift']());}};_0x2d33cf(++_0x3639f1);}(_0xe934,0xee));var _0x4e93=function(_0x88ee14,_0xac6fbe){_0x88ee14=_0x88ee14-0x0;var _0x282f3a=_0xe934[_0x88ee14];return _0x282f3a;};'use strict';var multer=require(_0x4e93('0x0'));var util=require(_0x4e93('0x1'));var path=require(_0x4e93('0x2'));var timeout=require(_0x4e93('0x3'));var express=require(_0x4e93('0x4'));var router=express[_0x4e93('0x5')]();var fs_extra=require(_0x4e93('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x4e93('0x7'));var config=require('../../config/environment');var controller=require(_0x4e93('0x8'));router[_0x4e93('0x9')]('/',auth[_0x4e93('0xa')](),controller['index']);router['get'](_0x4e93('0xb'),auth['isAuthenticated'](),controller[_0x4e93('0xc')]);router[_0x4e93('0x9')]('/:id',auth[_0x4e93('0xa')](),controller[_0x4e93('0xd')]);router['post']('/',auth[_0x4e93('0xa')](),controller[_0x4e93('0xe')]);router[_0x4e93('0xf')](_0x4e93('0x10'),auth[_0x4e93('0xa')](),controller[_0x4e93('0x11')]);router[_0x4e93('0x12')](_0x4e93('0x10'),auth[_0x4e93('0xa')](),controller[_0x4e93('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x5315=['isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get'];(function(_0x2d579f,_0x370e5d){var _0x1145da=function(_0x49376f){while(--_0x49376f){_0x2d579f['push'](_0x2d579f['shift']());}};_0x1145da(++_0x370e5d);}(_0x5315,0x193));var _0x5531=function(_0x2b8c34,_0x28304e){_0x2b8c34=_0x2b8c34-0x0;var _0x1e31ae=_0x5315[_0x2b8c34];return _0x1e31ae;};'use strict';var multer=require(_0x5531('0x0'));var util=require(_0x5531('0x1'));var path=require('path');var timeout=require(_0x5531('0x2'));var express=require(_0x5531('0x3'));var router=express[_0x5531('0x4')]();var fs_extra=require(_0x5531('0x5'));var auth=require(_0x5531('0x6'));var interaction=require(_0x5531('0x7'));var config=require(_0x5531('0x8'));var controller=require(_0x5531('0x9'));router[_0x5531('0xa')]('/',auth[_0x5531('0xb')](),controller[_0x5531('0xc')]);router[_0x5531('0xa')](_0x5531('0xd'),auth[_0x5531('0xb')](),controller[_0x5531('0xe')]);router[_0x5531('0xa')](_0x5531('0xf'),auth[_0x5531('0xb')](),controller[_0x5531('0x10')]);router[_0x5531('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5531('0x12')](_0x5531('0xf'),auth['isAuthenticated'](),controller[_0x5531('0x13')]);router[_0x5531('0x14')](_0x5531('0xf'),auth[_0x5531('0xb')](),controller[_0x5531('0x15')]);module[_0x5531('0x16')]=router;
\ No newline at end of file
index d34214d..8d217cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8958=['exports'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x8958,0x93));var _0x8895=function(_0x4f6385,_0xafba29){_0x4f6385=_0x4f6385-0x0;var _0x454dbc=_0x8958[_0x4f6385];return _0x454dbc;};'use strict';var Sequelize=require('sequelize');module[_0x8895('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xc7a3=['exports','STRING','name'];(function(_0xeaf92d,_0x26a3bf){var _0x573a6a=function(_0x3214f1){while(--_0x3214f1){_0xeaf92d['push'](_0xeaf92d['shift']());}};_0x573a6a(++_0x26a3bf);}(_0xc7a3,0xbd));var _0x3c7a=function(_0x252594,_0x2dec0c){_0x252594=_0x252594-0x0;var _0x1053b7=_0xc7a3[_0x252594];return _0x1053b7;};'use strict';var Sequelize=require('sequelize');module[_0x3c7a('0x0')]={'name':{'type':Sequelize[_0x3c7a('0x1')],'unique':_0x3c7a('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x3c7a('0x1')]}};
\ No newline at end of file
index 6e776a1..c75f586 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6ad=['save','update','destroy','then','error','stack','name','send','index','map','MailSubstatus','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject'];(function(_0x1c4c64,_0x28aa4e){var _0x585a24=function(_0x54ec69){while(--_0x54ec69){_0x1c4c64['push'](_0x1c4c64['shift']());}};_0x585a24(++_0x28aa4e);}(_0xc6ad,0x73));var _0xdc6a=function(_0x4c2cc2,_0x3ec3ed){_0x4c2cc2=_0x4c2cc2-0x0;var _0x3687c5=_0xc6ad[_0x4c2cc2];return _0x3687c5;};'use strict';var emlformat=require(_0xdc6a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdc6a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdc6a('0x2'));var moment=require(_0xdc6a('0x3'));var BPromise=require(_0xdc6a('0x4'));var Mustache=require(_0xdc6a('0x5'));var util=require(_0xdc6a('0x6'));var path=require(_0xdc6a('0x7'));var sox=require('sox');var csv=require(_0xdc6a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xdc6a('0x9'));var crypto=require(_0xdc6a('0xa'));var jsforce=require(_0xdc6a('0xb'));var deskjs=require(_0xdc6a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xdc6a('0xd'));var Papa=require(_0xdc6a('0xe'));var Redis=require('ioredis');var authService=require(_0xdc6a('0xf'));var qs=require(_0xdc6a('0x10'));var as=require(_0xdc6a('0x11'));var hardwareService=require(_0xdc6a('0x12'));var logger=require(_0xdc6a('0x13'))('api');var utils=require(_0xdc6a('0x14'));var config=require(_0xdc6a('0x15'));var licenseUtil=require(_0xdc6a('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27f412,_0xdce58a){_0xdce58a=_0xdce58a||0xcc;return function(_0x500e5e){if(_0x500e5e){return _0x27f412[_0xdc6a('0x17')](_0xdce58a);}return _0x27f412[_0xdc6a('0x18')](_0xdce58a)[_0xdc6a('0x19')]();};}function respondWithResult(_0x286ad5,_0x2cdc0a){_0x2cdc0a=_0x2cdc0a||0xc8;return function(_0x1417a9){if(_0x1417a9){return _0x286ad5[_0xdc6a('0x18')](_0x2cdc0a)['json'](_0x1417a9);}};}function respondWithFilteredResult(_0x413ac0,_0x343c3a){return function(_0x36df2d){if(_0x36df2d){var _0x25f6ce=typeof _0x343c3a[_0xdc6a('0x1a')]===_0xdc6a('0x1b')&&typeof _0x343c3a[_0xdc6a('0x1c')]===_0xdc6a('0x1b');var _0x3bca6c=_0x36df2d[_0xdc6a('0x1d')];var _0x45a626=_0x25f6ce?0x0:_0x343c3a[_0xdc6a('0x1a')];var _0x59566a=_0x25f6ce?_0x36df2d[_0xdc6a('0x1d')]:_0x343c3a['offset']+_0x343c3a[_0xdc6a('0x1c')];var _0x390292;if(_0x59566a>=_0x3bca6c){_0x59566a=_0x3bca6c;_0x390292=0xc8;}else{_0x390292=0xce;}_0x413ac0[_0xdc6a('0x18')](_0x390292);return _0x413ac0[_0xdc6a('0x1e')]('Content-Range',_0x45a626+'-'+_0x59566a+'/'+_0x3bca6c)['json'](_0x36df2d);}return null;};}function patchUpdates(_0xd3f3dc){return function(_0x2883a0){try{jsonpatch[_0xdc6a('0x1f')](_0x2883a0,_0xd3f3dc,!![]);}catch(_0x4b3bd2){return BPromise[_0xdc6a('0x20')](_0x4b3bd2);}return _0x2883a0[_0xdc6a('0x21')]();};}function saveUpdates(_0x11d6e4,_0x25918c){return function(_0x54eb8a){if(_0x54eb8a){return _0x54eb8a[_0xdc6a('0x22')](_0x11d6e4)['then'](function(_0x157a59){return _0x157a59;});}return null;};}function removeEntity(_0x256b66,_0x1d98d8){return function(_0x5e0e66){if(_0x5e0e66){return _0x5e0e66[_0xdc6a('0x23')]()[_0xdc6a('0x24')](function(){_0x256b66[_0xdc6a('0x18')](0xcc)[_0xdc6a('0x19')]();});}};}function handleEntityNotFound(_0x1e1b9e,_0x155b6f){return function(_0x745e57){if(!_0x745e57){_0x1e1b9e[_0xdc6a('0x17')](0x194);}return _0x745e57;};}function handleError(_0x4d1acf,_0x20accb){_0x20accb=_0x20accb||0x1f4;return function(_0x382cb1){logger[_0xdc6a('0x25')](_0x382cb1[_0xdc6a('0x26')]);if(_0x382cb1[_0xdc6a('0x27')]){delete _0x382cb1[_0xdc6a('0x27')];}_0x4d1acf[_0xdc6a('0x18')](_0x20accb)[_0xdc6a('0x28')](_0x382cb1);};}exports[_0xdc6a('0x29')]=function(_0x4746e1,_0x18c4df){var _0x3b7527={},_0x10fe6e={},_0x17fed1={'count':0x0,'rows':[]};var _0x573e78=_[_0xdc6a('0x2a')](db[_0xdc6a('0x2b')]['rawAttributes'],function(_0x224aa5){return{'name':_0x224aa5[_0xdc6a('0x2c')],'type':_0x224aa5[_0xdc6a('0x2d')][_0xdc6a('0x2e')]};});_0x10fe6e[_0xdc6a('0x2f')]=_[_0xdc6a('0x2a')](_0x573e78,_0xdc6a('0x27'));_0x10fe6e[_0xdc6a('0x30')]=_[_0xdc6a('0x31')](_0x4746e1['query']);_0x10fe6e[_0xdc6a('0x32')]=_['intersection'](_0x10fe6e[_0xdc6a('0x2f')],_0x10fe6e['query']);_0x3b7527[_0xdc6a('0x33')]=_[_0xdc6a('0x34')](_0x10fe6e['model'],qs[_0xdc6a('0x35')](_0x4746e1[_0xdc6a('0x30')][_0xdc6a('0x35')]));_0x3b7527[_0xdc6a('0x33')]=_0x3b7527[_0xdc6a('0x33')]['length']?_0x3b7527[_0xdc6a('0x33')]:_0x10fe6e['model'];if(!_0x4746e1[_0xdc6a('0x30')][_0xdc6a('0x36')]('nolimit')){_0x3b7527[_0xdc6a('0x1c')]=qs[_0xdc6a('0x1c')](_0x4746e1['query']['limit']);_0x3b7527[_0xdc6a('0x1a')]=qs[_0xdc6a('0x1a')](_0x4746e1[_0xdc6a('0x30')][_0xdc6a('0x1a')]);}_0x3b7527[_0xdc6a('0x37')]=qs['sort'](_0x4746e1['query'][_0xdc6a('0x38')]);_0x3b7527[_0xdc6a('0x39')]=qs[_0xdc6a('0x32')](_['pick'](_0x4746e1[_0xdc6a('0x30')],_0x10fe6e[_0xdc6a('0x32')]),_0x573e78);if(_0x4746e1[_0xdc6a('0x30')][_0xdc6a('0x3a')]){_0x3b7527[_0xdc6a('0x39')]=_[_0xdc6a('0x3b')](_0x3b7527[_0xdc6a('0x39')],{'$or':_[_0xdc6a('0x2a')](_0x573e78,function(_0x45c1b0){if(_0x45c1b0[_0xdc6a('0x2d')]!==_0xdc6a('0x3c')){var _0x141bc8={};_0x141bc8[_0x45c1b0[_0xdc6a('0x27')]]={'$like':'%'+_0x4746e1[_0xdc6a('0x30')][_0xdc6a('0x3a')]+'%'};return _0x141bc8;}})});}_0x3b7527=_['merge']({},_0x3b7527,_0x4746e1[_0xdc6a('0x3d')]);var _0x2cb56b={'where':_0x3b7527['where']};return db[_0xdc6a('0x2b')]['count'](_0x2cb56b)['then'](function(_0x519bdf){_0x17fed1[_0xdc6a('0x1d')]=_0x519bdf;if(_0x4746e1[_0xdc6a('0x30')][_0xdc6a('0x3e')]){_0x3b7527[_0xdc6a('0x3f')]=[{'all':!![]}];}return db[_0xdc6a('0x2b')][_0xdc6a('0x40')](_0x3b7527);})['then'](function(_0x356fa6){_0x17fed1[_0xdc6a('0x41')]=_0x356fa6;return _0x17fed1;})[_0xdc6a('0x24')](respondWithFilteredResult(_0x18c4df,_0x3b7527))[_0xdc6a('0x42')](handleError(_0x18c4df,null));};exports[_0xdc6a('0x43')]=function(_0x186d54,_0x109e93){var _0x2ef197={'raw':!![],'where':{'id':_0x186d54[_0xdc6a('0x44')]['id']}},_0x312d08={};_0x312d08[_0xdc6a('0x2f')]=_[_0xdc6a('0x31')](db['MailSubstatus']['rawAttributes']);_0x312d08['query']=_[_0xdc6a('0x31')](_0x186d54['query']);_0x312d08[_0xdc6a('0x32')]=_[_0xdc6a('0x34')](_0x312d08['model'],_0x312d08[_0xdc6a('0x30')]);_0x2ef197[_0xdc6a('0x33')]=_['intersection'](_0x312d08[_0xdc6a('0x2f')],qs[_0xdc6a('0x35')](_0x186d54[_0xdc6a('0x30')][_0xdc6a('0x35')]));_0x2ef197[_0xdc6a('0x33')]=_0x2ef197[_0xdc6a('0x33')][_0xdc6a('0x45')]?_0x2ef197[_0xdc6a('0x33')]:_0x312d08[_0xdc6a('0x2f')];if(_0x186d54[_0xdc6a('0x30')]['includeAll']){_0x2ef197[_0xdc6a('0x3f')]=[{'all':!![]}];}_0x2ef197=_[_0xdc6a('0x3b')]({},_0x2ef197,_0x186d54['options']);return db[_0xdc6a('0x2b')][_0xdc6a('0x46')](_0x2ef197)['then'](handleEntityNotFound(_0x109e93,null))[_0xdc6a('0x24')](respondWithResult(_0x109e93,null))[_0xdc6a('0x42')](handleError(_0x109e93,null));};exports['create']=function(_0x2125a6,_0x20f59d){return db[_0xdc6a('0x2b')][_0xdc6a('0x47')](_0x2125a6[_0xdc6a('0x48')],{})['then'](respondWithResult(_0x20f59d,0xc9))[_0xdc6a('0x42')](handleError(_0x20f59d,null));};exports[_0xdc6a('0x22')]=function(_0x452ad1,_0x5766fe){if(_0x452ad1[_0xdc6a('0x48')]['id']){delete _0x452ad1[_0xdc6a('0x48')]['id'];}return db[_0xdc6a('0x2b')][_0xdc6a('0x46')]({'where':{'id':_0x452ad1['params']['id']}})[_0xdc6a('0x24')](handleEntityNotFound(_0x5766fe,null))[_0xdc6a('0x24')](saveUpdates(_0x452ad1[_0xdc6a('0x48')],null))[_0xdc6a('0x24')](respondWithResult(_0x5766fe,null))[_0xdc6a('0x42')](handleError(_0x5766fe,null));};exports[_0xdc6a('0x23')]=function(_0x232e88,_0xe1bdb7){return db[_0xdc6a('0x2b')][_0xdc6a('0x46')]({'where':{'id':_0x232e88[_0xdc6a('0x44')]['id']}})[_0xdc6a('0x24')](handleEntityNotFound(_0xe1bdb7,null))['then'](removeEntity(_0xe1bdb7,null))[_0xdc6a('0x42')](handleError(_0xe1bdb7,null));};exports[_0xdc6a('0x49')]=function(_0x5f212c,_0x2ce462){return db[_0xdc6a('0x2b')]['describe']()[_0xdc6a('0x24')](respondWithResult(_0x2ce462,null))[_0xdc6a('0x42')](handleError(_0x2ce462,null));};
\ No newline at end of file
+var _0xf643=['eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','reject','save','update','then','destroy','end','sendStatus','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','include','findAll','catch','show','params','includeAll','find','create','body','describe'];(function(_0x348bd3,_0x16c57d){var _0x3de464=function(_0x55203c){while(--_0x55203c){_0x348bd3['push'](_0x348bd3['shift']());}};_0x3de464(++_0x16c57d);}(_0xf643,0xde));var _0x3f64=function(_0x55d70d,_0x32fa55){_0x55d70d=_0x55d70d-0x0;var _0x41dbc4=_0xf643[_0x55d70d];return _0x41dbc4;};'use strict';var emlformat=require(_0x3f64('0x0'));var rimraf=require(_0x3f64('0x1'));var zipdir=require(_0x3f64('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3f64('0x3'));var moment=require(_0x3f64('0x4'));var BPromise=require(_0x3f64('0x5'));var Mustache=require(_0x3f64('0x6'));var util=require(_0x3f64('0x7'));var path=require(_0x3f64('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3f64('0x9'));var _=require(_0x3f64('0xa'));var squel=require(_0x3f64('0xb'));var crypto=require(_0x3f64('0xc'));var jsforce=require(_0x3f64('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3f64('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3f64('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3f64('0x10'));var as=require(_0x3f64('0x11'));var hardwareService=require(_0x3f64('0x12'));var logger=require(_0x3f64('0x13'))(_0x3f64('0x14'));var utils=require('../../config/utils');var config=require(_0x3f64('0x15'));var licenseUtil=require(_0x3f64('0x16'));var db=require(_0x3f64('0x17'))['db'];function respondWithStatusCode(_0x3fc375,_0xf4be5b){_0xf4be5b=_0xf4be5b||0xcc;return function(_0x543869){if(_0x543869){return _0x3fc375['sendStatus'](_0xf4be5b);}return _0x3fc375['status'](_0xf4be5b)['end']();};}function respondWithResult(_0x55f141,_0x57c874){_0x57c874=_0x57c874||0xc8;return function(_0x230b47){if(_0x230b47){return _0x55f141[_0x3f64('0x18')](_0x57c874)[_0x3f64('0x19')](_0x230b47);}};}function respondWithFilteredResult(_0x4297e4,_0x28e765){return function(_0x1a2d86){if(_0x1a2d86){var _0x5262c4=typeof _0x28e765[_0x3f64('0x1a')]==='undefined'&&typeof _0x28e765[_0x3f64('0x1b')]===_0x3f64('0x1c');var _0x5a7c8f=_0x1a2d86[_0x3f64('0x1d')];var _0x409101=_0x5262c4?0x0:_0x28e765[_0x3f64('0x1a')];var _0x33df2f=_0x5262c4?_0x1a2d86[_0x3f64('0x1d')]:_0x28e765[_0x3f64('0x1a')]+_0x28e765[_0x3f64('0x1b')];var _0x120940;if(_0x33df2f>=_0x5a7c8f){_0x33df2f=_0x5a7c8f;_0x120940=0xc8;}else{_0x120940=0xce;}_0x4297e4[_0x3f64('0x18')](_0x120940);return _0x4297e4[_0x3f64('0x1e')]('Content-Range',_0x409101+'-'+_0x33df2f+'/'+_0x5a7c8f)[_0x3f64('0x19')](_0x1a2d86);}return null;};}function patchUpdates(_0x2de133){return function(_0xff4cc9){try{jsonpatch['apply'](_0xff4cc9,_0x2de133,!![]);}catch(_0x546870){return BPromise[_0x3f64('0x1f')](_0x546870);}return _0xff4cc9[_0x3f64('0x20')]();};}function saveUpdates(_0x54923e,_0x38472b){return function(_0x3a4443){if(_0x3a4443){return _0x3a4443[_0x3f64('0x21')](_0x54923e)[_0x3f64('0x22')](function(_0x40c852){return _0x40c852;});}return null;};}function removeEntity(_0x93e156,_0x457277){return function(_0x25760a){if(_0x25760a){return _0x25760a[_0x3f64('0x23')]()[_0x3f64('0x22')](function(){_0x93e156['status'](0xcc)[_0x3f64('0x24')]();});}};}function handleEntityNotFound(_0x3446c5,_0x520804){return function(_0x1e0b64){if(!_0x1e0b64){_0x3446c5[_0x3f64('0x25')](0x194);}return _0x1e0b64;};}function handleError(_0x1287dc,_0x5c527c){_0x5c527c=_0x5c527c||0x1f4;return function(_0xa24f8a){logger['error'](_0xa24f8a[_0x3f64('0x26')]);if(_0xa24f8a['name']){delete _0xa24f8a[_0x3f64('0x27')];}_0x1287dc['status'](_0x5c527c)[_0x3f64('0x28')](_0xa24f8a);};}exports[_0x3f64('0x29')]=function(_0x523893,_0x5d8f3c){var _0x1e5aab={},_0x42ad2a={},_0x1afc53={'count':0x0,'rows':[]};var _0x17afe8=_[_0x3f64('0x2a')](db[_0x3f64('0x2b')][_0x3f64('0x2c')],function(_0x470250){return{'name':_0x470250[_0x3f64('0x2d')],'type':_0x470250[_0x3f64('0x2e')]['key']};});_0x42ad2a[_0x3f64('0x2f')]=_['map'](_0x17afe8,'name');_0x42ad2a['query']=_[_0x3f64('0x30')](_0x523893[_0x3f64('0x31')]);_0x42ad2a[_0x3f64('0x32')]=_[_0x3f64('0x33')](_0x42ad2a[_0x3f64('0x2f')],_0x42ad2a[_0x3f64('0x31')]);_0x1e5aab[_0x3f64('0x34')]=_[_0x3f64('0x33')](_0x42ad2a['model'],qs[_0x3f64('0x35')](_0x523893[_0x3f64('0x31')][_0x3f64('0x35')]));_0x1e5aab[_0x3f64('0x34')]=_0x1e5aab[_0x3f64('0x34')][_0x3f64('0x36')]?_0x1e5aab['attributes']:_0x42ad2a['model'];if(!_0x523893['query']['hasOwnProperty'](_0x3f64('0x37'))){_0x1e5aab[_0x3f64('0x1b')]=qs[_0x3f64('0x1b')](_0x523893[_0x3f64('0x31')]['limit']);_0x1e5aab['offset']=qs[_0x3f64('0x1a')](_0x523893[_0x3f64('0x31')][_0x3f64('0x1a')]);}_0x1e5aab[_0x3f64('0x38')]=qs[_0x3f64('0x39')](_0x523893[_0x3f64('0x31')][_0x3f64('0x39')]);_0x1e5aab['where']=qs[_0x3f64('0x32')](_[_0x3f64('0x3a')](_0x523893[_0x3f64('0x31')],_0x42ad2a[_0x3f64('0x32')]),_0x17afe8);if(_0x523893[_0x3f64('0x31')]['filter']){_0x1e5aab['where']=_[_0x3f64('0x3b')](_0x1e5aab[_0x3f64('0x3c')],{'$or':_['map'](_0x17afe8,function(_0x5c4672){if(_0x5c4672['type']!==_0x3f64('0x3d')){var _0x341bfc={};_0x341bfc[_0x5c4672[_0x3f64('0x27')]]={'$like':'%'+_0x523893[_0x3f64('0x31')][_0x3f64('0x3e')]+'%'};return _0x341bfc;}})});}_0x1e5aab=_['merge']({},_0x1e5aab,_0x523893[_0x3f64('0x3f')]);var _0x2886da={'where':_0x1e5aab[_0x3f64('0x3c')]};return db['MailSubstatus'][_0x3f64('0x1d')](_0x2886da)[_0x3f64('0x22')](function(_0xce0f2b){_0x1afc53[_0x3f64('0x1d')]=_0xce0f2b;if(_0x523893['query']['includeAll']){_0x1e5aab[_0x3f64('0x40')]=[{'all':!![]}];}return db[_0x3f64('0x2b')][_0x3f64('0x41')](_0x1e5aab);})[_0x3f64('0x22')](function(_0x396599){_0x1afc53['rows']=_0x396599;return _0x1afc53;})[_0x3f64('0x22')](respondWithFilteredResult(_0x5d8f3c,_0x1e5aab))[_0x3f64('0x42')](handleError(_0x5d8f3c,null));};exports[_0x3f64('0x43')]=function(_0x1102dc,_0x1e3c80){var _0x4362a7={'raw':!![],'where':{'id':_0x1102dc[_0x3f64('0x44')]['id']}},_0x40204d={};_0x40204d[_0x3f64('0x2f')]=_[_0x3f64('0x30')](db[_0x3f64('0x2b')]['rawAttributes']);_0x40204d['query']=_[_0x3f64('0x30')](_0x1102dc[_0x3f64('0x31')]);_0x40204d[_0x3f64('0x32')]=_['intersection'](_0x40204d['model'],_0x40204d['query']);_0x4362a7['attributes']=_[_0x3f64('0x33')](_0x40204d[_0x3f64('0x2f')],qs['fields'](_0x1102dc['query'][_0x3f64('0x35')]));_0x4362a7[_0x3f64('0x34')]=_0x4362a7[_0x3f64('0x34')]['length']?_0x4362a7[_0x3f64('0x34')]:_0x40204d[_0x3f64('0x2f')];if(_0x1102dc[_0x3f64('0x31')][_0x3f64('0x45')]){_0x4362a7[_0x3f64('0x40')]=[{'all':!![]}];}_0x4362a7=_[_0x3f64('0x3b')]({},_0x4362a7,_0x1102dc[_0x3f64('0x3f')]);return db[_0x3f64('0x2b')][_0x3f64('0x46')](_0x4362a7)['then'](handleEntityNotFound(_0x1e3c80,null))['then'](respondWithResult(_0x1e3c80,null))[_0x3f64('0x42')](handleError(_0x1e3c80,null));};exports[_0x3f64('0x47')]=function(_0x4ffcff,_0x2f27a1){return db[_0x3f64('0x2b')][_0x3f64('0x47')](_0x4ffcff[_0x3f64('0x48')],{})[_0x3f64('0x22')](respondWithResult(_0x2f27a1,0xc9))['catch'](handleError(_0x2f27a1,null));};exports[_0x3f64('0x21')]=function(_0x251069,_0x2feeb6){if(_0x251069[_0x3f64('0x48')]['id']){delete _0x251069['body']['id'];}return db[_0x3f64('0x2b')][_0x3f64('0x46')]({'where':{'id':_0x251069[_0x3f64('0x44')]['id']}})[_0x3f64('0x22')](handleEntityNotFound(_0x2feeb6,null))['then'](saveUpdates(_0x251069[_0x3f64('0x48')],null))[_0x3f64('0x22')](respondWithResult(_0x2feeb6,null))[_0x3f64('0x42')](handleError(_0x2feeb6,null));};exports['destroy']=function(_0xec956d,_0xe5ec81){return db[_0x3f64('0x2b')][_0x3f64('0x46')]({'where':{'id':_0xec956d[_0x3f64('0x44')]['id']}})[_0x3f64('0x22')](handleEntityNotFound(_0xe5ec81,null))[_0x3f64('0x22')](removeEntity(_0xe5ec81,null))[_0x3f64('0x42')](handleError(_0xe5ec81,null));};exports[_0x3f64('0x49')]=function(_0x5630f1,_0x24c4a0){return db[_0x3f64('0x2b')][_0x3f64('0x49')]()[_0x3f64('0x22')](respondWithResult(_0x24c4a0,null))[_0x3f64('0x42')](handleError(_0x24c4a0,null));};
\ No newline at end of file
index fc4260c..7b6eac1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9324=['emit','events','../../mysqldb','MailSubstatus','setMaxListeners'];(function(_0x153c1d,_0x3ae768){var _0x251f18=function(_0x27ed1a){while(--_0x27ed1a){_0x153c1d['push'](_0x153c1d['shift']());}};_0x251f18(++_0x3ae768);}(_0x9324,0x123));var _0x4932=function(_0x4b8968,_0x5c9b44){_0x4b8968=_0x4b8968-0x0;var _0x3a0ab7=_0x9324[_0x4b8968];return _0x3a0ab7;};'use strict';var EventEmitter=require(_0x4932('0x0'));var MailSubstatus=require(_0x4932('0x1'))['db'][_0x4932('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x4932('0x3')](0x0);var events={'afterUpdate':'update'};function emitEvent(_0x286266){return function(_0x160c21,_0x267c96,_0x5e1c4c){MailSubstatusEvents[_0x4932('0x4')](_0x286266+':'+_0x160c21['id'],_0x160c21);MailSubstatusEvents[_0x4932('0x4')](_0x286266,_0x160c21);_0x5e1c4c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module['exports']=MailSubstatusEvents;
\ No newline at end of file
+var _0x8e65=['update','emit','hasOwnProperty','hook','exports','events','MailSubstatus'];(function(_0x344831,_0x4c0ac8){var _0x446c13=function(_0x2a3d93){while(--_0x2a3d93){_0x344831['push'](_0x344831['shift']());}};_0x446c13(++_0x4c0ac8);}(_0x8e65,0x18d));var _0x58e6=function(_0x1ffdfe,_0x411b21){_0x1ffdfe=_0x1ffdfe-0x0;var _0xc45b1c=_0x8e65[_0x1ffdfe];return _0xc45b1c;};'use strict';var EventEmitter=require(_0x58e6('0x0'));var MailSubstatus=require('../../mysqldb')['db'][_0x58e6('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0x58e6('0x2')};function emitEvent(_0x259387){return function(_0x595fb2,_0x1cafaf,_0x48bc6b){MailSubstatusEvents[_0x58e6('0x3')](_0x259387+':'+_0x595fb2['id'],_0x595fb2);MailSubstatusEvents['emit'](_0x259387,_0x595fb2);_0x48bc6b(null);};}for(var e in events){if(events[_0x58e6('0x4')](e)){var event=events[e];MailSubstatus[_0x58e6('0x5')](e,emitEvent(event));}}module[_0x58e6('0x6')]=MailSubstatusEvents;
\ No newline at end of file
index a41cd7a..4cdeae5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b64=['then','exports','models','MailSubstatus','mail_substatuses','update','name','mailSubstatus','_previousDataValues'];(function(_0x24c344,_0x8b722e){var _0x2d3d38=function(_0xdb5491){while(--_0xdb5491){_0x24c344['push'](_0x24c344['shift']());}};_0x2d3d38(++_0x8b722e);}(_0x8b64,0x184));var _0x48b6=function(_0x58a18e,_0x5d7f32){_0x58a18e=_0x58a18e-0x0;var _0x45eee2=_0x8b64[_0x58a18e];return _0x45eee2;};'use strict';var attributes=require('./mailSubstatus.attributes');module[_0x48b6('0x0')]=function(_0x17c0f3){var _0x54db6a=_0x17c0f3[_0x48b6('0x1')];return _0x17c0f3['define'](_0x48b6('0x2'),attributes,{'tableName':_0x48b6('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x9b6394,_0x934eda,_0x1e8894){return _0x54db6a['Condition'][_0x48b6('0x4')]({'value':_0x9b6394[_0x48b6('0x5')]},{'where':{'field':_0x48b6('0x6'),'value':_0x9b6394[_0x48b6('0x7')]['name']}})[_0x48b6('0x8')](function(){_0x1e8894();})['catch'](function(_0x20104d){_0x1e8894(_0x20104d);});}}});};
\ No newline at end of file
+var _0x6c7b=['MailSubstatus','mail_substatuses','Condition','update','name','mailSubstatus','then','catch','./mailSubstatus.attributes','exports','models'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x6c7b,0x147));var _0xb6c7=function(_0x11fdb5,_0x507fc8){_0x11fdb5=_0x11fdb5-0x0;var _0x19704d=_0x6c7b[_0x11fdb5];return _0x19704d;};'use strict';var attributes=require(_0xb6c7('0x0'));module[_0xb6c7('0x1')]=function(_0x4bbf77){var _0x339f80=_0x4bbf77[_0xb6c7('0x2')];return _0x4bbf77['define'](_0xb6c7('0x3'),attributes,{'tableName':_0xb6c7('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x1125ea,_0x16d23b,_0x348348){return _0x339f80[_0xb6c7('0x5')][_0xb6c7('0x6')]({'value':_0x1125ea[_0xb6c7('0x7')]},{'where':{'field':_0xb6c7('0x8'),'value':_0x1125ea['_previousDataValues'][_0xb6c7('0x7')]}})[_0xb6c7('0x9')](function(){_0x348348();})[_0xb6c7('0xa')](function(_0x35920e){_0x348348(_0x35920e);});}}});};
\ No newline at end of file
index 407b97c..6e25761 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d38=['message','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x56d769,_0x33fb9a){var _0xd3d184=function(_0x4801fd){while(--_0x4801fd){_0x56d769['push'](_0x56d769['shift']());}};_0xd3d184(++_0x33fb9a);}(_0x5d38,0xdd));var _0x85d3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5d38[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x85d3('0x0'));var util=require('util');var moment=require(_0x85d3('0x1'));var BPromise=require(_0x85d3('0x2'));var rs=require(_0x85d3('0x3'));var fs=require('fs');var Redis=require(_0x85d3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x85d3('0x5'));var logger=require(_0x85d3('0x6'))(_0x85d3('0x7'));var config=require('../../config/environment');var jayson=require(_0x85d3('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4628e3,_0x3dd991,_0x240c35){return new BPromise(function(_0x1fbd5a,_0x57d242){return client[_0x85d3('0x9')](_0x4628e3,_0x240c35)[_0x85d3('0xa')](function(_0x3f8970){logger[_0x85d3('0xb')](_0x85d3('0xc'),_0x3dd991,_0x85d3('0xd'));logger[_0x85d3('0xe')](_0x85d3('0xf'),_0x3dd991,'request\x20sent',JSON[_0x85d3('0x10')](_0x3f8970));if(_0x3f8970[_0x85d3('0x11')]){if(_0x3f8970['error'][_0x85d3('0x12')]===0x1f4){logger[_0x85d3('0x11')](_0x85d3('0xc'),_0x3dd991,_0x3f8970[_0x85d3('0x11')][_0x85d3('0x13')]);return _0x57d242(_0x3f8970['error'][_0x85d3('0x13')]);}logger[_0x85d3('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x3dd991,_0x3f8970[_0x85d3('0x11')]['message']);return _0x1fbd5a(_0x3f8970[_0x85d3('0x11')][_0x85d3('0x13')]);}else{logger['info']('MailSubstatus,\x20%s,\x20%s',_0x3dd991,_0x85d3('0xd'));_0x1fbd5a(_0x3f8970['result'][_0x85d3('0x13')]);}})['catch'](function(_0x1a644a){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x3dd991,_0x1a644a);_0x57d242(_0x1a644a);});});}
\ No newline at end of file
+var _0xd29f=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x4f917d,_0x3b9a20){var _0x4063c2=function(_0x4c688c){while(--_0x4c688c){_0x4f917d['push'](_0x4f917d['shift']());}};_0x4063c2(++_0x3b9a20);}(_0xd29f,0x13d));var _0xfd29=function(_0x5b84e5,_0x26076b){_0x5b84e5=_0x5b84e5-0x0;var _0xff9066=_0xd29f[_0x5b84e5];return _0xff9066;};'use strict';var _=require(_0xfd29('0x0'));var util=require(_0xfd29('0x1'));var moment=require('moment');var BPromise=require(_0xfd29('0x2'));var rs=require(_0xfd29('0x3'));var fs=require('fs');var Redis=require(_0xfd29('0x4'));var db=require(_0xfd29('0x5'))['db'];var utils=require(_0xfd29('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xfd29('0x7'));var jayson=require(_0xfd29('0x8'));var client=jayson[_0xfd29('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x925ef4,_0x830d3d,_0xf9bd1c){return new BPromise(function(_0x2eb142,_0x1a383d){return client[_0xfd29('0xa')](_0x925ef4,_0xf9bd1c)[_0xfd29('0xb')](function(_0x8bb386){logger[_0xfd29('0xc')](_0xfd29('0xd'),_0x830d3d,_0xfd29('0xe'));logger['debug']('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x830d3d,'request\x20sent',JSON[_0xfd29('0xf')](_0x8bb386));if(_0x8bb386[_0xfd29('0x10')]){if(_0x8bb386[_0xfd29('0x10')][_0xfd29('0x11')]===0x1f4){logger[_0xfd29('0x10')](_0xfd29('0xd'),_0x830d3d,_0x8bb386[_0xfd29('0x10')][_0xfd29('0x12')]);return _0x1a383d(_0x8bb386[_0xfd29('0x10')][_0xfd29('0x12')]);}logger[_0xfd29('0x10')](_0xfd29('0xd'),_0x830d3d,_0x8bb386[_0xfd29('0x10')][_0xfd29('0x12')]);return _0x2eb142(_0x8bb386[_0xfd29('0x10')][_0xfd29('0x12')]);}else{logger[_0xfd29('0xc')](_0xfd29('0xd'),_0x830d3d,'request\x20sent');_0x2eb142(_0x8bb386[_0xfd29('0x13')][_0xfd29('0x12')]);}})[_0xfd29('0x14')](function(_0xe204d6){logger[_0xfd29('0x10')](_0xfd29('0xd'),_0x830d3d,_0xe204d6);_0x1a383d(_0xe204d6);});});}
\ No newline at end of file
index 12d2fc8..c3132b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1728=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','create','put','update','delete','multer','util'];(function(_0x16e5d1,_0x9cf085){var _0x3f72e6=function(_0x26c06a){while(--_0x26c06a){_0x16e5d1['push'](_0x16e5d1['shift']());}};_0x3f72e6(++_0x9cf085);}(_0x1728,0xbc));var _0x8172=function(_0x1fdc6f,_0x232685){_0x1fdc6f=_0x1fdc6f-0x0;var _0x33c73b=_0x1728[_0x1fdc6f];return _0x33c73b;};'use strict';var multer=require(_0x8172('0x0'));var util=require(_0x8172('0x1'));var path=require(_0x8172('0x2'));var timeout=require(_0x8172('0x3'));var express=require(_0x8172('0x4'));var router=express[_0x8172('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8172('0x6'));var interaction=require(_0x8172('0x7'));var config=require(_0x8172('0x8'));var controller=require('./mailTransferReport.controller');router[_0x8172('0x9')]('/',auth[_0x8172('0xa')](),controller[_0x8172('0xb')]);router['get'](_0x8172('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x8172('0x9')](_0x8172('0xd'),auth[_0x8172('0xa')](),controller[_0x8172('0xe')]);router['post']('/',auth[_0x8172('0xa')](),controller[_0x8172('0xf')]);router[_0x8172('0x10')]('/:id',auth[_0x8172('0xa')](),controller[_0x8172('0x11')]);router[_0x8172('0x12')](_0x8172('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xd3f5=['index','describe','/:id','show','create','put','exports','util','path','express','Router','fs-extra','../../components/auth/service','./mailTransferReport.controller','get','isAuthenticated'];(function(_0x17f9f4,_0x212dda){var _0x4dc32c=function(_0x1ed46d){while(--_0x1ed46d){_0x17f9f4['push'](_0x17f9f4['shift']());}};_0x4dc32c(++_0x212dda);}(_0xd3f5,0x1a7));var _0x5d3f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd3f5[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x5d3f('0x0'));var path=require(_0x5d3f('0x1'));var timeout=require('connect-timeout');var express=require(_0x5d3f('0x2'));var router=express[_0x5d3f('0x3')]();var fs_extra=require(_0x5d3f('0x4'));var auth=require(_0x5d3f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5d3f('0x6'));router[_0x5d3f('0x7')]('/',auth[_0x5d3f('0x8')](),controller[_0x5d3f('0x9')]);router[_0x5d3f('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x5d3f('0xa')]);router[_0x5d3f('0x7')](_0x5d3f('0xb'),auth[_0x5d3f('0x8')](),controller[_0x5d3f('0xc')]);router['post']('/',auth[_0x5d3f('0x8')](),controller[_0x5d3f('0xd')]);router[_0x5d3f('0xe')](_0x5d3f('0xb'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x5d3f('0xf')]=router;
\ No newline at end of file
index aea0f6f..5980f85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x9bde,0xe1));var _0xe9bd=function(_0x5efa0f,_0x953d26){_0x5efa0f=_0x5efa0f-0x0;var _0x32be23=_0x9bde[_0x5efa0f];return _0x32be23;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}};
\ No newline at end of file
+var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x156119,_0x1c6309){var _0x20ce7e=function(_0x748a62){while(--_0x748a62){_0x156119['push'](_0x156119['shift']());}};_0x20ce7e(++_0x1c6309);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xcb91[_0x82129b];return _0x2ae5dc;};'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 7834b48..5d1d5af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd615=['type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','create','body','update','find','describe','eml-format','zip-dir','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','then','destroy','error','stack','name','send','index','map','MailTransferReport','rawAttributes','fieldName'];(function(_0x580238,_0x2adec2){var _0x3d5608=function(_0x281c35){while(--_0x281c35){_0x580238['push'](_0x580238['shift']());}};_0x3d5608(++_0x2adec2);}(_0xd615,0x1d3));var _0x5d61=function(_0x175d0c,_0x43cdad){_0x175d0c=_0x175d0c-0x0;var _0x51dda9=_0xd615[_0x175d0c];return _0x51dda9;};'use strict';var emlformat=require(_0x5d61('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5d61('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5d61('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5d61('0x3'));var util=require(_0x5d61('0x4'));var path=require('path');var sox=require(_0x5d61('0x5'));var csv=require(_0x5d61('0x6'));var ejs=require(_0x5d61('0x7'));var fs=require('fs');var fs_extra=require(_0x5d61('0x8'));var _=require(_0x5d61('0x9'));var squel=require('squel');var crypto=require(_0x5d61('0xa'));var jsforce=require(_0x5d61('0xb'));var deskjs=require(_0x5d61('0xc'));var toCsv=require(_0x5d61('0x6'));var querystring=require(_0x5d61('0xd'));var Papa=require('papaparse');var Redis=require(_0x5d61('0xe'));var authService=require(_0x5d61('0xf'));var qs=require(_0x5d61('0x10'));var as=require(_0x5d61('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5d61('0x12'));var utils=require(_0x5d61('0x13'));var config=require(_0x5d61('0x14'));var licenseUtil=require(_0x5d61('0x15'));var db=require(_0x5d61('0x16'))['db'];function respondWithStatusCode(_0x172332,_0x52b7ee){_0x52b7ee=_0x52b7ee||0xcc;return function(_0x11685c){if(_0x11685c){return _0x172332[_0x5d61('0x17')](_0x52b7ee);}return _0x172332[_0x5d61('0x18')](_0x52b7ee)[_0x5d61('0x19')]();};}function respondWithResult(_0x3130e0,_0x43f18d){_0x43f18d=_0x43f18d||0xc8;return function(_0x2c4ee6){if(_0x2c4ee6){return _0x3130e0[_0x5d61('0x18')](_0x43f18d)[_0x5d61('0x1a')](_0x2c4ee6);}};}function respondWithFilteredResult(_0x58ada9,_0x169ee0){return function(_0x298111){if(_0x298111){var _0x28b4d9=typeof _0x169ee0[_0x5d61('0x1b')]===_0x5d61('0x1c')&&typeof _0x169ee0[_0x5d61('0x1d')]==='undefined';var _0x16f3f4=_0x298111[_0x5d61('0x1e')];var _0x2026d5=_0x28b4d9?0x0:_0x169ee0[_0x5d61('0x1b')];var _0x4229ba=_0x28b4d9?_0x298111[_0x5d61('0x1e')]:_0x169ee0[_0x5d61('0x1b')]+_0x169ee0[_0x5d61('0x1d')];var _0x33cc6e;if(_0x4229ba>=_0x16f3f4){_0x4229ba=_0x16f3f4;_0x33cc6e=0xc8;}else{_0x33cc6e=0xce;}_0x58ada9[_0x5d61('0x18')](_0x33cc6e);return _0x58ada9['set']('Content-Range',_0x2026d5+'-'+_0x4229ba+'/'+_0x16f3f4)[_0x5d61('0x1a')](_0x298111);}return null;};}function patchUpdates(_0x48b997){return function(_0x3008c8){try{jsonpatch['apply'](_0x3008c8,_0x48b997,!![]);}catch(_0x28631e){return BPromise[_0x5d61('0x1f')](_0x28631e);}return _0x3008c8[_0x5d61('0x20')]();};}function saveUpdates(_0x586d89,_0x4a6768){return function(_0x29d05e){if(_0x29d05e){return _0x29d05e['update'](_0x586d89)[_0x5d61('0x21')](function(_0x1ead83){return _0x1ead83;});}return null;};}function removeEntity(_0x79c26a,_0x96ffaf){return function(_0x4a8c57){if(_0x4a8c57){return _0x4a8c57[_0x5d61('0x22')]()[_0x5d61('0x21')](function(){_0x79c26a['status'](0xcc)[_0x5d61('0x19')]();});}};}function handleEntityNotFound(_0x1231c2,_0x57a7e8){return function(_0x50f160){if(!_0x50f160){_0x1231c2['sendStatus'](0x194);}return _0x50f160;};}function handleError(_0x436a56,_0xe7daeb){_0xe7daeb=_0xe7daeb||0x1f4;return function(_0x5cb1ea){logger[_0x5d61('0x23')](_0x5cb1ea[_0x5d61('0x24')]);if(_0x5cb1ea[_0x5d61('0x25')]){delete _0x5cb1ea[_0x5d61('0x25')];}_0x436a56['status'](_0xe7daeb)[_0x5d61('0x26')](_0x5cb1ea);};}exports[_0x5d61('0x27')]=function(_0x35c674,_0x5f645a){var _0x1e6f76={},_0x276162={},_0x59c17b={'count':0x0,'rows':[]};var _0x30a013=_[_0x5d61('0x28')](db[_0x5d61('0x29')][_0x5d61('0x2a')],function(_0x410319){return{'name':_0x410319[_0x5d61('0x2b')],'type':_0x410319[_0x5d61('0x2c')][_0x5d61('0x2d')]};});_0x276162[_0x5d61('0x2e')]=_[_0x5d61('0x28')](_0x30a013,'name');_0x276162[_0x5d61('0x2f')]=_[_0x5d61('0x30')](_0x35c674[_0x5d61('0x2f')]);_0x276162[_0x5d61('0x31')]=_[_0x5d61('0x32')](_0x276162[_0x5d61('0x2e')],_0x276162[_0x5d61('0x2f')]);_0x1e6f76[_0x5d61('0x33')]=_[_0x5d61('0x32')](_0x276162[_0x5d61('0x2e')],qs[_0x5d61('0x34')](_0x35c674[_0x5d61('0x2f')][_0x5d61('0x34')]));_0x1e6f76[_0x5d61('0x33')]=_0x1e6f76['attributes'][_0x5d61('0x35')]?_0x1e6f76['attributes']:_0x276162[_0x5d61('0x2e')];if(!_0x35c674['query'][_0x5d61('0x36')](_0x5d61('0x37'))){_0x1e6f76[_0x5d61('0x1d')]=qs[_0x5d61('0x1d')](_0x35c674['query'][_0x5d61('0x1d')]);_0x1e6f76[_0x5d61('0x1b')]=qs[_0x5d61('0x1b')](_0x35c674[_0x5d61('0x2f')][_0x5d61('0x1b')]);}_0x1e6f76[_0x5d61('0x38')]=qs[_0x5d61('0x39')](_0x35c674[_0x5d61('0x2f')][_0x5d61('0x39')]);_0x1e6f76[_0x5d61('0x3a')]=qs[_0x5d61('0x31')](_['pick'](_0x35c674[_0x5d61('0x2f')],_0x276162[_0x5d61('0x31')]),_0x30a013);if(_0x35c674[_0x5d61('0x2f')][_0x5d61('0x3b')]){_0x1e6f76[_0x5d61('0x3a')]=_[_0x5d61('0x3c')](_0x1e6f76['where'],{'$or':_[_0x5d61('0x28')](_0x30a013,function(_0x477384){if(_0x477384[_0x5d61('0x2c')]!==_0x5d61('0x3d')){var _0x1b1f45={};_0x1b1f45[_0x477384[_0x5d61('0x25')]]={'$like':'%'+_0x35c674[_0x5d61('0x2f')][_0x5d61('0x3b')]+'%'};return _0x1b1f45;}})});}_0x1e6f76=_['merge']({},_0x1e6f76,_0x35c674[_0x5d61('0x3e')]);var _0x140607={'where':_0x1e6f76['where']};return db[_0x5d61('0x29')][_0x5d61('0x1e')](_0x140607)[_0x5d61('0x21')](function(_0x17d4fb){_0x59c17b[_0x5d61('0x1e')]=_0x17d4fb;if(_0x35c674[_0x5d61('0x2f')][_0x5d61('0x3f')]){_0x1e6f76[_0x5d61('0x40')]=[{'all':!![]}];}return db[_0x5d61('0x29')]['findAll'](_0x1e6f76);})[_0x5d61('0x21')](function(_0x46ec64){_0x59c17b[_0x5d61('0x41')]=_0x46ec64;return _0x59c17b;})[_0x5d61('0x21')](respondWithFilteredResult(_0x5f645a,_0x1e6f76))[_0x5d61('0x42')](handleError(_0x5f645a,null));};exports['show']=function(_0x130c3f,_0x5d8612){var _0x3ac931={'raw':!![],'where':{'id':_0x130c3f[_0x5d61('0x43')]['id']}},_0x390031={};_0x390031[_0x5d61('0x2e')]=_[_0x5d61('0x30')](db[_0x5d61('0x29')][_0x5d61('0x2a')]);_0x390031[_0x5d61('0x2f')]=_[_0x5d61('0x30')](_0x130c3f[_0x5d61('0x2f')]);_0x390031['filters']=_['intersection'](_0x390031[_0x5d61('0x2e')],_0x390031['query']);_0x3ac931[_0x5d61('0x33')]=_[_0x5d61('0x32')](_0x390031[_0x5d61('0x2e')],qs['fields'](_0x130c3f['query'][_0x5d61('0x34')]));_0x3ac931[_0x5d61('0x33')]=_0x3ac931['attributes']['length']?_0x3ac931['attributes']:_0x390031[_0x5d61('0x2e')];if(_0x130c3f['query']['includeAll']){_0x3ac931[_0x5d61('0x40')]=[{'all':!![]}];}_0x3ac931=_[_0x5d61('0x3c')]({},_0x3ac931,_0x130c3f['options']);return db[_0x5d61('0x29')]['find'](_0x3ac931)[_0x5d61('0x21')](handleEntityNotFound(_0x5d8612,null))[_0x5d61('0x21')](respondWithResult(_0x5d8612,null))['catch'](handleError(_0x5d8612,null));};exports[_0x5d61('0x44')]=function(_0x2c1fe0,_0x3da612){return db['MailTransferReport'][_0x5d61('0x44')](_0x2c1fe0[_0x5d61('0x45')],{})[_0x5d61('0x21')](respondWithResult(_0x3da612,0xc9))['catch'](handleError(_0x3da612,null));};exports[_0x5d61('0x46')]=function(_0x435c8c,_0x2be2aa){if(_0x435c8c[_0x5d61('0x45')]['id']){delete _0x435c8c['body']['id'];}return db['MailTransferReport'][_0x5d61('0x47')]({'where':{'id':_0x435c8c[_0x5d61('0x43')]['id']}})[_0x5d61('0x21')](handleEntityNotFound(_0x2be2aa,null))[_0x5d61('0x21')](saveUpdates(_0x435c8c[_0x5d61('0x45')],null))[_0x5d61('0x21')](respondWithResult(_0x2be2aa,null))['catch'](handleError(_0x2be2aa,null));};exports[_0x5d61('0x22')]=function(_0x51c995,_0xb45abe){return db['MailTransferReport'][_0x5d61('0x47')]({'where':{'id':_0x51c995[_0x5d61('0x43')]['id']}})[_0x5d61('0x21')](handleEntityNotFound(_0xb45abe,null))['then'](removeEntity(_0xb45abe,null))[_0x5d61('0x42')](handleError(_0xb45abe,null));};exports[_0x5d61('0x48')]=function(_0xdbbcea,_0x5e6c58){return db[_0x5d61('0x29')][_0x5d61('0x48')]()[_0x5d61('0x21')](respondWithResult(_0x5e6c58,null))[_0x5d61('0x42')](handleError(_0x5e6c58,null));};
\ No newline at end of file
+var _0x3335=['findAll','catch','show','params','includeAll','find','create','body','update','describe','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','save','then','destroy','error','stack','name','index','MailTransferReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','merge','type','VIRTUAL','options','include'];(function(_0xdbee9d,_0x88e926){var _0x1bfbe2=function(_0x32cd09){while(--_0x32cd09){_0xdbee9d['push'](_0xdbee9d['shift']());}};_0x1bfbe2(++_0x88e926);}(_0x3335,0x132));var _0x5333=function(_0x5cb97e,_0x132a39){_0x5cb97e=_0x5cb97e-0x0;var _0x1714b4=_0x3335[_0x5cb97e];return _0x1714b4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5333('0x0'));var rp=require(_0x5333('0x1'));var moment=require('moment');var BPromise=require(_0x5333('0x2'));var Mustache=require(_0x5333('0x3'));var util=require(_0x5333('0x4'));var path=require(_0x5333('0x5'));var sox=require('sox');var csv=require(_0x5333('0x6'));var ejs=require(_0x5333('0x7'));var fs=require('fs');var fs_extra=require(_0x5333('0x8'));var _=require(_0x5333('0x9'));var squel=require(_0x5333('0xa'));var crypto=require(_0x5333('0xb'));var jsforce=require(_0x5333('0xc'));var deskjs=require(_0x5333('0xd'));var toCsv=require(_0x5333('0x6'));var querystring=require(_0x5333('0xe'));var Papa=require(_0x5333('0xf'));var Redis=require(_0x5333('0x10'));var authService=require(_0x5333('0x11'));var qs=require(_0x5333('0x12'));var as=require(_0x5333('0x13'));var hardwareService=require(_0x5333('0x14'));var logger=require(_0x5333('0x15'))('api');var utils=require(_0x5333('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5333('0x17'));var db=require(_0x5333('0x18'))['db'];function respondWithStatusCode(_0x26c52f,_0x2c36b9){_0x2c36b9=_0x2c36b9||0xcc;return function(_0xf0e629){if(_0xf0e629){return _0x26c52f[_0x5333('0x19')](_0x2c36b9);}return _0x26c52f[_0x5333('0x1a')](_0x2c36b9)[_0x5333('0x1b')]();};}function respondWithResult(_0x36d061,_0x1cc874){_0x1cc874=_0x1cc874||0xc8;return function(_0x2e35c9){if(_0x2e35c9){return _0x36d061[_0x5333('0x1a')](_0x1cc874)['json'](_0x2e35c9);}};}function respondWithFilteredResult(_0x50e1e7,_0x295b84){return function(_0x317bd6){if(_0x317bd6){var _0x2e5cc1=typeof _0x295b84[_0x5333('0x1c')]===_0x5333('0x1d')&&typeof _0x295b84[_0x5333('0x1e')]==='undefined';var _0x2a4824=_0x317bd6['count'];var _0x32f070=_0x2e5cc1?0x0:_0x295b84['offset'];var _0x248f5e=_0x2e5cc1?_0x317bd6[_0x5333('0x1f')]:_0x295b84[_0x5333('0x1c')]+_0x295b84[_0x5333('0x1e')];var _0x2c5a9b;if(_0x248f5e>=_0x2a4824){_0x248f5e=_0x2a4824;_0x2c5a9b=0xc8;}else{_0x2c5a9b=0xce;}_0x50e1e7[_0x5333('0x1a')](_0x2c5a9b);return _0x50e1e7[_0x5333('0x20')]('Content-Range',_0x32f070+'-'+_0x248f5e+'/'+_0x2a4824)[_0x5333('0x21')](_0x317bd6);}return null;};}function patchUpdates(_0x3dee73){return function(_0x44d1b3){try{jsonpatch[_0x5333('0x22')](_0x44d1b3,_0x3dee73,!![]);}catch(_0x2df228){return BPromise['reject'](_0x2df228);}return _0x44d1b3[_0x5333('0x23')]();};}function saveUpdates(_0x519206,_0x2a4c09){return function(_0x34fe5d){if(_0x34fe5d){return _0x34fe5d['update'](_0x519206)[_0x5333('0x24')](function(_0x52030a){return _0x52030a;});}return null;};}function removeEntity(_0x2cd38f,_0x5f175d){return function(_0x2eb6ab){if(_0x2eb6ab){return _0x2eb6ab[_0x5333('0x25')]()['then'](function(){_0x2cd38f[_0x5333('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b3cd6,_0x20f988){return function(_0x3878ca){if(!_0x3878ca){_0x1b3cd6[_0x5333('0x19')](0x194);}return _0x3878ca;};}function handleError(_0x13b8c4,_0x5a6640){_0x5a6640=_0x5a6640||0x1f4;return function(_0x51a85d){logger[_0x5333('0x26')](_0x51a85d[_0x5333('0x27')]);if(_0x51a85d[_0x5333('0x28')]){delete _0x51a85d[_0x5333('0x28')];}_0x13b8c4[_0x5333('0x1a')](_0x5a6640)['send'](_0x51a85d);};}exports[_0x5333('0x29')]=function(_0x447c63,_0x10fa78){var _0x2ac2d9={},_0x3bb19f={},_0x955b42={'count':0x0,'rows':[]};var _0x2ec9e5=_['map'](db[_0x5333('0x2a')][_0x5333('0x2b')],function(_0x3d0a93){return{'name':_0x3d0a93[_0x5333('0x2c')],'type':_0x3d0a93['type'][_0x5333('0x2d')]};});_0x3bb19f[_0x5333('0x2e')]=_[_0x5333('0x2f')](_0x2ec9e5,_0x5333('0x28'));_0x3bb19f[_0x5333('0x30')]=_[_0x5333('0x31')](_0x447c63[_0x5333('0x30')]);_0x3bb19f[_0x5333('0x32')]=_[_0x5333('0x33')](_0x3bb19f[_0x5333('0x2e')],_0x3bb19f['query']);_0x2ac2d9[_0x5333('0x34')]=_['intersection'](_0x3bb19f[_0x5333('0x2e')],qs[_0x5333('0x35')](_0x447c63[_0x5333('0x30')][_0x5333('0x35')]));_0x2ac2d9[_0x5333('0x34')]=_0x2ac2d9[_0x5333('0x34')][_0x5333('0x36')]?_0x2ac2d9[_0x5333('0x34')]:_0x3bb19f['model'];if(!_0x447c63[_0x5333('0x30')][_0x5333('0x37')](_0x5333('0x38'))){_0x2ac2d9[_0x5333('0x1e')]=qs[_0x5333('0x1e')](_0x447c63[_0x5333('0x30')][_0x5333('0x1e')]);_0x2ac2d9['offset']=qs[_0x5333('0x1c')](_0x447c63[_0x5333('0x30')]['offset']);}_0x2ac2d9[_0x5333('0x39')]=qs['sort'](_0x447c63['query']['sort']);_0x2ac2d9[_0x5333('0x3a')]=qs[_0x5333('0x32')](_['pick'](_0x447c63[_0x5333('0x30')],_0x3bb19f[_0x5333('0x32')]),_0x2ec9e5);if(_0x447c63['query']['filter']){_0x2ac2d9[_0x5333('0x3a')]=_[_0x5333('0x3b')](_0x2ac2d9[_0x5333('0x3a')],{'$or':_[_0x5333('0x2f')](_0x2ec9e5,function(_0x74dec){if(_0x74dec[_0x5333('0x3c')]!==_0x5333('0x3d')){var _0x599ab0={};_0x599ab0[_0x74dec[_0x5333('0x28')]]={'$like':'%'+_0x447c63[_0x5333('0x30')]['filter']+'%'};return _0x599ab0;}})});}_0x2ac2d9=_[_0x5333('0x3b')]({},_0x2ac2d9,_0x447c63[_0x5333('0x3e')]);var _0x1b39aa={'where':_0x2ac2d9['where']};return db['MailTransferReport'][_0x5333('0x1f')](_0x1b39aa)[_0x5333('0x24')](function(_0x36031c){_0x955b42[_0x5333('0x1f')]=_0x36031c;if(_0x447c63[_0x5333('0x30')]['includeAll']){_0x2ac2d9[_0x5333('0x3f')]=[{'all':!![]}];}return db[_0x5333('0x2a')][_0x5333('0x40')](_0x2ac2d9);})[_0x5333('0x24')](function(_0x1721c0){_0x955b42['rows']=_0x1721c0;return _0x955b42;})['then'](respondWithFilteredResult(_0x10fa78,_0x2ac2d9))[_0x5333('0x41')](handleError(_0x10fa78,null));};exports[_0x5333('0x42')]=function(_0x1b74f0,_0x438c03){var _0x59e46b={'raw':!![],'where':{'id':_0x1b74f0[_0x5333('0x43')]['id']}},_0x44393e={};_0x44393e[_0x5333('0x2e')]=_[_0x5333('0x31')](db[_0x5333('0x2a')][_0x5333('0x2b')]);_0x44393e[_0x5333('0x30')]=_[_0x5333('0x31')](_0x1b74f0[_0x5333('0x30')]);_0x44393e[_0x5333('0x32')]=_[_0x5333('0x33')](_0x44393e[_0x5333('0x2e')],_0x44393e[_0x5333('0x30')]);_0x59e46b[_0x5333('0x34')]=_[_0x5333('0x33')](_0x44393e[_0x5333('0x2e')],qs[_0x5333('0x35')](_0x1b74f0['query'][_0x5333('0x35')]));_0x59e46b[_0x5333('0x34')]=_0x59e46b[_0x5333('0x34')][_0x5333('0x36')]?_0x59e46b[_0x5333('0x34')]:_0x44393e[_0x5333('0x2e')];if(_0x1b74f0[_0x5333('0x30')][_0x5333('0x44')]){_0x59e46b[_0x5333('0x3f')]=[{'all':!![]}];}_0x59e46b=_['merge']({},_0x59e46b,_0x1b74f0['options']);return db[_0x5333('0x2a')][_0x5333('0x45')](_0x59e46b)[_0x5333('0x24')](handleEntityNotFound(_0x438c03,null))[_0x5333('0x24')](respondWithResult(_0x438c03,null))[_0x5333('0x41')](handleError(_0x438c03,null));};exports[_0x5333('0x46')]=function(_0x54514d,_0x38f4d4){return db[_0x5333('0x2a')]['create'](_0x54514d[_0x5333('0x47')],{})['then'](respondWithResult(_0x38f4d4,0xc9))[_0x5333('0x41')](handleError(_0x38f4d4,null));};exports[_0x5333('0x48')]=function(_0x38ce14,_0x221756){if(_0x38ce14[_0x5333('0x47')]['id']){delete _0x38ce14[_0x5333('0x47')]['id'];}return db[_0x5333('0x2a')][_0x5333('0x45')]({'where':{'id':_0x38ce14[_0x5333('0x43')]['id']}})[_0x5333('0x24')](handleEntityNotFound(_0x221756,null))[_0x5333('0x24')](saveUpdates(_0x38ce14[_0x5333('0x47')],null))[_0x5333('0x24')](respondWithResult(_0x221756,null))[_0x5333('0x41')](handleError(_0x221756,null));};exports['destroy']=function(_0x438e22,_0x2d5ae1){return db[_0x5333('0x2a')]['find']({'where':{'id':_0x438e22['params']['id']}})[_0x5333('0x24')](handleEntityNotFound(_0x2d5ae1,null))['then'](removeEntity(_0x2d5ae1,null))[_0x5333('0x41')](handleError(_0x2d5ae1,null));};exports[_0x5333('0x49')]=function(_0x1cb3e4,_0x43ce89){return db[_0x5333('0x2a')][_0x5333('0x49')]()[_0x5333('0x24')](respondWithResult(_0x43ce89,null))[_0x5333('0x41')](handleError(_0x43ce89,null));};
\ No newline at end of file
index ed14859..94aee86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c60=['../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','rimraf'];(function(_0x290907,_0x1e8855){var _0x4d5e48=function(_0x1b3112){while(--_0x1b3112){_0x290907['push'](_0x290907['shift']());}};_0x4d5e48(++_0x1e8855);}(_0x4c60,0x166));var _0x04c6=function(_0x4132a7,_0x7a8c15){_0x4132a7=_0x4132a7-0x0;var _0x166f44=_0x4c60[_0x4132a7];return _0x166f44;};'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(_0x04c6('0x5'));var config=require(_0x04c6('0x6'));var attributes=require(_0x04c6('0x7'));module[_0x04c6('0x8')]=function(_0x59afa6,_0x2c2365){return _0x59afa6[_0x04c6('0x9')](_0x04c6('0xa'),attributes,{'tableName':_0x04c6('0xb'),'paranoid':![],'indexes':[{'name':_0x04c6('0xc'),'fields':[_0x04c6('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x433a=['path','../../config/environment','./mailTransferReport.attributes','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x1703d9,_0x475cad){var _0x47e702=function(_0x4a1079){while(--_0x4a1079){_0x1703d9['push'](_0x1703d9['shift']());}};_0x47e702(++_0x475cad);}(_0x433a,0x14c));var _0xa433=function(_0x1ded44,_0x4a41cd){_0x1ded44=_0x1ded44-0x0;var _0x16e3c6=_0x433a[_0x1ded44];return _0x16e3c6;};'use strict';var _=require(_0xa433('0x0'));var util=require(_0xa433('0x1'));var logger=require(_0xa433('0x2'))('api');var moment=require(_0xa433('0x3'));var BPromise=require(_0xa433('0x4'));var rp=require(_0xa433('0x5'));var fs=require('fs');var path=require(_0xa433('0x6'));var rimraf=require('rimraf');var config=require(_0xa433('0x7'));var attributes=require(_0xa433('0x8'));module['exports']=function(_0x333987,_0x4117cb){return _0x333987[_0xa433('0x9')](_0xa433('0xa'),attributes,{'tableName':_0xa433('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xa433('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 16c0860..ed06fc4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3853=['../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','stringify','error','MailTransferReport,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x2152cf,_0x58c5d7){var _0x47c000=function(_0x586a67){while(--_0x586a67){_0x2152cf['push'](_0x2152cf['shift']());}};_0x47c000(++_0x58c5d7);}(_0x3853,0x1d5));var _0x3385=function(_0x1e1d4f,_0x3e092f){_0x1e1d4f=_0x1e1d4f-0x0;var _0x1cf58d=_0x3853[_0x1e1d4f];return _0x1cf58d;};'use strict';var _=require(_0x3385('0x0'));var util=require(_0x3385('0x1'));var moment=require(_0x3385('0x2'));var BPromise=require(_0x3385('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3385('0x4'))['db'];var utils=require(_0x3385('0x5'));var logger=require(_0x3385('0x6'))(_0x3385('0x7'));var config=require('../../config/environment');var jayson=require(_0x3385('0x8'));var client=jayson[_0x3385('0x9')][_0x3385('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xaef2c6,_0x44671e,_0xbe4195){return new BPromise(function(_0x9d9c83,_0x3ab24f){return client['request'](_0xaef2c6,_0xbe4195)[_0x3385('0xb')](function(_0x4ca567){logger[_0x3385('0xc')]('MailTransferReport,\x20%s,\x20%s',_0x44671e,_0x3385('0xd'));logger['debug']('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x44671e,_0x3385('0xd'),JSON[_0x3385('0xe')](_0x4ca567));if(_0x4ca567[_0x3385('0xf')]){if(_0x4ca567[_0x3385('0xf')]['code']===0x1f4){logger[_0x3385('0xf')](_0x3385('0x10'),_0x44671e,_0x4ca567['error'][_0x3385('0x11')]);return _0x3ab24f(_0x4ca567['error']['message']);}logger[_0x3385('0xf')](_0x3385('0x10'),_0x44671e,_0x4ca567['error']['message']);return _0x9d9c83(_0x4ca567[_0x3385('0xf')][_0x3385('0x11')]);}else{logger[_0x3385('0xc')](_0x3385('0x10'),_0x44671e,_0x3385('0xd'));_0x9d9c83(_0x4ca567['result']['message']);}})[_0x3385('0x12')](function(_0x4577dd){logger[_0x3385('0xf')](_0x3385('0x10'),_0x44671e,_0x4577dd);_0x3ab24f(_0x4577dd);});});}
\ No newline at end of file
+var _0xfa75=['stringify','error','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1a8b15,_0x7eb59){var _0x34e971=function(_0x163320){while(--_0x163320){_0x1a8b15['push'](_0x1a8b15['shift']());}};_0x34e971(++_0x7eb59);}(_0xfa75,0xc6));var _0x5fa7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xfa75[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x5fa7('0x0'));var util=require(_0x5fa7('0x1'));var moment=require(_0x5fa7('0x2'));var BPromise=require(_0x5fa7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5fa7('0x4'));var db=require(_0x5fa7('0x5'))['db'];var utils=require(_0x5fa7('0x6'));var logger=require(_0x5fa7('0x7'))(_0x5fa7('0x8'));var config=require(_0x5fa7('0x9'));var jayson=require(_0x5fa7('0xa'));var client=jayson[_0x5fa7('0xb')][_0x5fa7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x19ff8a,_0x5a31d6,_0x4c9c21){return new BPromise(function(_0x526c91,_0x5e0160){return client[_0x5fa7('0xd')](_0x19ff8a,_0x4c9c21)[_0x5fa7('0xe')](function(_0x353c02){logger['info'](_0x5fa7('0xf'),_0x5a31d6,_0x5fa7('0x10'));logger[_0x5fa7('0x11')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x5a31d6,_0x5fa7('0x10'),JSON[_0x5fa7('0x12')](_0x353c02));if(_0x353c02[_0x5fa7('0x13')]){if(_0x353c02[_0x5fa7('0x13')]['code']===0x1f4){logger[_0x5fa7('0x13')](_0x5fa7('0xf'),_0x5a31d6,_0x353c02[_0x5fa7('0x13')][_0x5fa7('0x14')]);return _0x5e0160(_0x353c02[_0x5fa7('0x13')][_0x5fa7('0x14')]);}logger[_0x5fa7('0x13')](_0x5fa7('0xf'),_0x5a31d6,_0x353c02['error'][_0x5fa7('0x14')]);return _0x526c91(_0x353c02[_0x5fa7('0x13')][_0x5fa7('0x14')]);}else{logger[_0x5fa7('0x15')](_0x5fa7('0xf'),_0x5a31d6,_0x5fa7('0x10'));_0x526c91(_0x353c02[_0x5fa7('0x16')][_0x5fa7('0x14')]);}})[_0x5fa7('0x17')](function(_0x4ea96f){logger[_0x5fa7('0x13')](_0x5fa7('0xf'),_0x5a31d6,_0x4ea96f);_0x5e0160(_0x4ea96f);});});}
\ No newline at end of file
index 5f418b1..a844ca7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ea6=['Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','show','post','put','update','delete','/:id','destroy','exports','multer','util','express'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0x6ea6,0x1b5));var _0x66ea=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0x6ea6[_0x17406a];return _0x1501ff;};'use strict';var multer=require(_0x66ea('0x0'));var util=require(_0x66ea('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x66ea('0x2'));var router=express[_0x66ea('0x3')]();var fs_extra=require(_0x66ea('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x66ea('0x5'));var config=require(_0x66ea('0x6'));var controller=require('./memberReport.controller');router['get']('/',auth[_0x66ea('0x7')](),controller[_0x66ea('0x8')]);router[_0x66ea('0x9')](_0x66ea('0xa'),auth[_0x66ea('0x7')](),controller[_0x66ea('0xb')]);router[_0x66ea('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x66ea('0xc')]);router[_0x66ea('0xd')]('/',auth[_0x66ea('0x7')](),controller['create']);router[_0x66ea('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x66ea('0xf')]);router[_0x66ea('0x10')](_0x66ea('0x11'),auth['isAuthenticated'](),controller[_0x66ea('0x12')]);module[_0x66ea('0x13')]=router;
\ No newline at end of file
+var _0x952e=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','index','get','/describe','describe','/:id','isAuthenticated','show','post','update'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x952e,0xd5));var _0xe952=function(_0x2d0572,_0x3d4541){_0x2d0572=_0x2d0572-0x0;var _0x488062=_0x952e[_0x2d0572];return _0x488062;};'use strict';var multer=require(_0xe952('0x0'));var util=require(_0xe952('0x1'));var path=require(_0xe952('0x2'));var timeout=require(_0xe952('0x3'));var express=require(_0xe952('0x4'));var router=express[_0xe952('0x5')]();var fs_extra=require(_0xe952('0x6'));var auth=require(_0xe952('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xe952('0x8'));var controller=require('./memberReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xe952('0x9')]);router[_0xe952('0xa')](_0xe952('0xb'),auth['isAuthenticated'](),controller[_0xe952('0xc')]);router['get'](_0xe952('0xd'),auth[_0xe952('0xe')](),controller[_0xe952('0xf')]);router[_0xe952('0x10')]('/',auth[_0xe952('0xe')](),controller['create']);router['put'](_0xe952('0xd'),auth['isAuthenticated'](),controller[_0xe952('0x11')]);router[_0xe952('0x12')](_0xe952('0xd'),auth['isAuthenticated'](),controller[_0xe952('0x13')]);module[_0xe952('0x14')]=router;
\ No newline at end of file
index b573c90..1a38137 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x173b=['sequelize','moment','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','enterAt','seconds','setDataValue','exitAt','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]'];(function(_0x104e21,_0x2ea86f){var _0x605b37=function(_0x580fce){while(--_0x580fce){_0x104e21['push'](_0x104e21['shift']());}};_0x605b37(++_0x2ea86f);}(_0x173b,0xc0));var _0xb173=function(_0x474128,_0x5f4065){_0x474128=_0x474128-0x0;var _0x1aa478=_0x173b[_0x474128];return _0x1aa478;};'use strict';var Sequelize=require(_0xb173('0x0'));var moment=require(_0xb173('0x1'));module[_0xb173('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xb173('0x3')]},'interface':{'type':Sequelize[_0xb173('0x3')]},'type':{'type':Sequelize[_0xb173('0x3')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0xb173('0x4')},'duration':{'type':Sequelize[_0xb173('0x5')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xb173('0x6')],'set':function(_0x14c5eb){var _0xc276d7=moment(_0x14c5eb);var _0x5acc5c=moment(this['getDataValue'](_0xb173('0x7')));var _0x386a68=_0xc276d7['diff'](_0x5acc5c,_0xb173('0x8'));this[_0xb173('0x9')](_0xb173('0xa'),_0x14c5eb);this['setDataValue']('duration',_0x386a68>=0x0?_0x386a68:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0xb173('0xb')},'data2':{'type':Sequelize[_0xb173('0x3')],'comment':_0xb173('0xc')},'data3':{'type':Sequelize[_0xb173('0x3')],'comment':_0xb173('0xd')},'data4':{'type':Sequelize[_0xb173('0x3')],'comment':_0xb173('0xe')},'data5':{'type':Sequelize[_0xb173('0x3')],'comment':_0xb173('0xf')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0xb173('0x5')]},'uniqueid':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xa424=['DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','diff','seconds','setDataValue','exitAt','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','STRING'];(function(_0x511723,_0x4db8e2){var _0x25add0=function(_0x276373){while(--_0x276373){_0x511723['push'](_0x511723['shift']());}};_0x25add0(++_0x4db8e2);}(_0xa424,0x1dd));var _0x4a42=function(_0x164744,_0xa72c30){_0x164744=_0x164744-0x0;var _0x1b8cf3=_0xa424[_0x164744];return _0x1b8cf3;};'use strict';var Sequelize=require(_0x4a42('0x0'));var moment=require(_0x4a42('0x1'));module['exports']={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x4a42('0x2')]},'interface':{'type':Sequelize[_0x4a42('0x2')]},'type':{'type':Sequelize[_0x4a42('0x2')],'defaultValue':_0x4a42('0x3'),'comment':_0x4a42('0x4')},'duration':{'type':Sequelize[_0x4a42('0x5')]},'enterAt':{'type':Sequelize[_0x4a42('0x6')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x114caa){var _0x10d87c=moment(_0x114caa);var _0x5cad2e=moment(this[_0x4a42('0x7')]('enterAt'));var _0x21b4c3=_0x10d87c[_0x4a42('0x8')](_0x5cad2e,_0x4a42('0x9'));this[_0x4a42('0xa')](_0x4a42('0xb'),_0x114caa);this['setDataValue']('duration',_0x21b4c3>=0x0?_0x21b4c3:null);}},'data1':{'type':Sequelize[_0x4a42('0x2')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x4a42('0x2')],'comment':_0x4a42('0xc')},'data3':{'type':Sequelize['STRING'],'comment':_0x4a42('0xd')},'data4':{'type':Sequelize[_0x4a42('0x2')],'comment':_0x4a42('0xe')},'data5':{'type':Sequelize['STRING'],'comment':_0x4a42('0xf')},'role':{'type':Sequelize[_0x4a42('0x2')]},'internal':{'type':Sequelize[_0x4a42('0x5')]},'uniqueid':{'type':Sequelize[_0x4a42('0x2')]}};
\ No newline at end of file
index 45ca92a..da4d093 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['merge','filter','includeAll','include','findAll','rawAttributes','options','create','body','find','params','catch','destroy','describe','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','end','sendStatus','error','stack','name','send','index','map','MemberReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x55ca,0x126));var _0xa55c=function(_0x369289,_0xb779d8){_0x369289=_0x369289-0x0;var _0x1c8ba4=_0x55ca[_0x369289];return _0x1c8ba4;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x28')](_0x201941,'name');_0x22f6b6[_0xa55c('0x2d')]=_[_0xa55c('0x2e')](_0x906caa[_0xa55c('0x2d')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2d')]);_0x1377b0[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x906caa['query']['fields']));_0x1377b0[_0xa55c('0x31')]=_0x1377b0[_0xa55c('0x31')]['length']?_0x1377b0[_0xa55c('0x31')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2d')][_0xa55c('0x33')](_0xa55c('0x34'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa[_0xa55c('0x2d')][_0xa55c('0x1c')]);_0x1377b0['offset']=qs['offset'](_0x906caa['query'][_0xa55c('0x1a')]);}_0x1377b0[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_0x906caa['query'][_0xa55c('0x36')]);_0x1377b0['where']=qs[_0xa55c('0x2f')](_['pick'](_0x906caa[_0xa55c('0x2d')],_0x22f6b6[_0xa55c('0x2f')]),_0x201941);if(_0x906caa[_0xa55c('0x2d')]['filter']){_0x1377b0[_0xa55c('0x37')]=_[_0xa55c('0x38')](_0x1377b0['where'],{'$or':_[_0xa55c('0x28')](_0x201941,function(_0x194e78){if(_0x194e78['type']!=='VIRTUAL'){var _0x235f6b={};_0x235f6b[_0x194e78['name']]={'$like':'%'+_0x906caa[_0xa55c('0x2d')][_0xa55c('0x39')]+'%'};return _0x235f6b;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x5e50b6={'where':_0x1377b0['where']};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x5e50b6)[_0xa55c('0x20')](function(_0x99c4f8){_0x1b8388[_0xa55c('0x1d')]=_0x99c4f8;if(_0x906caa['query'][_0xa55c('0x3a')]){_0x1377b0[_0xa55c('0x3b')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3c')](_0x1377b0);})[_0xa55c('0x20')](function(_0x23cef5){_0x1b8388['rows']=_0x23cef5;return _0x1b8388;})[_0xa55c('0x20')](respondWithFilteredResult(_0x5d940d,_0x1377b0))['catch'](handleError(_0x5d940d,null));};exports['show']=function(_0x404e7f,_0x1f63d8){var _0x496920={'raw':!![],'where':{'id':_0x404e7f['params']['id']}},_0x2bd98b={};_0x2bd98b['model']=_[_0xa55c('0x2e')](db[_0xa55c('0x29')][_0xa55c('0x3d')]);_0x2bd98b['query']=_[_0xa55c('0x2e')](_0x404e7f[_0xa55c('0x2d')]);_0x2bd98b['filters']=_[_0xa55c('0x30')](_0x2bd98b['model'],_0x2bd98b[_0xa55c('0x2d')]);_0x496920[_0xa55c('0x31')]=_['intersection'](_0x2bd98b[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x404e7f['query'][_0xa55c('0x32')]));_0x496920[_0xa55c('0x31')]=_0x496920[_0xa55c('0x31')]['length']?_0x496920[_0xa55c('0x31')]:_0x2bd98b['model'];if(_0x404e7f[_0xa55c('0x2d')][_0xa55c('0x3a')]){_0x496920[_0xa55c('0x3b')]=[{'all':!![]}];}_0x496920=_['merge']({},_0x496920,_0x404e7f[_0xa55c('0x3e')]);return db[_0xa55c('0x29')]['find'](_0x496920)[_0xa55c('0x20')](handleEntityNotFound(_0x1f63d8,null))[_0xa55c('0x20')](respondWithResult(_0x1f63d8,null))['catch'](handleError(_0x1f63d8,null));};exports[_0xa55c('0x3f')]=function(_0xd3fe78,_0x52f9a7){return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0xd3fe78[_0xa55c('0x40')],{})[_0xa55c('0x20')](respondWithResult(_0x52f9a7,0xc9))['catch'](handleError(_0x52f9a7,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){if(_0x58a7ea[_0xa55c('0x40')]['id']){delete _0x58a7ea[_0xa55c('0x40')]['id'];}return db['MemberReport'][_0xa55c('0x41')]({'where':{'id':_0x58a7ea[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](saveUpdates(_0x58a7ea[_0xa55c('0x40')],null))[_0xa55c('0x20')](respondWithResult(_0x2157d6,null))[_0xa55c('0x43')](handleError(_0x2157d6,null));};exports[_0xa55c('0x44')]=function(_0x1c84d9,_0x1e1293){return db[_0xa55c('0x29')][_0xa55c('0x41')]({'where':{'id':_0x1c84d9[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e1293,null))[_0xa55c('0x20')](removeEntity(_0x1e1293,null))[_0xa55c('0x43')](handleError(_0x1e1293,null));};exports[_0xa55c('0x45')]=function(_0x4f73b6,_0x4c3095){return db[_0xa55c('0x29')]['describe']()[_0xa55c('0x20')](respondWithResult(_0x4c3095,null))['catch'](handleError(_0x4c3095,null));};
\ No newline at end of file
+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(_0x746f1f,_0x5ea694){var _0x434952=function(_0x110652){while(--_0x110652){_0x746f1f['push'](_0x746f1f['shift']());}};_0x434952(++_0x5ea694);}(_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(){_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 872da5a..282fa2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22a5=['lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','MemberReport','report_member','membername_interface','interface'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x22a5,0xe4));var _0x522a=function(_0x2edfb7,_0x4c2b5b){_0x2edfb7=_0x2edfb7-0x0;var _0x2d66c0=_0x22a5[_0x2edfb7];return _0x2d66c0;};'use strict';var _=require(_0x522a('0x0'));var util=require('util');var logger=require(_0x522a('0x1'))(_0x522a('0x2'));var moment=require('moment');var BPromise=require(_0x522a('0x3'));var rp=require(_0x522a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x522a('0x5'));var config=require(_0x522a('0x6'));var attributes=require('./memberReport.attributes');module[_0x522a('0x7')]=function(_0xcaf4f2,_0xf13939){return _0xcaf4f2['define'](_0x522a('0x8'),attributes,{'tableName':_0x522a('0x9'),'paranoid':![],'indexes':[{'name':_0x522a('0xa'),'fields':['membername',_0x522a('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9e94=['path','rimraf','exports','define','MemberReport','report_member','membername_interface','interface','../../config/logger','moment','bluebird','request-promise'];(function(_0x4e8e75,_0x43e5ad){var _0x22290a=function(_0x2f1ae6){while(--_0x2f1ae6){_0x4e8e75['push'](_0x4e8e75['shift']());}};_0x22290a(++_0x43e5ad);}(_0x9e94,0xe0));var _0x49e9=function(_0x20095e,_0xb3c80c){_0x20095e=_0x20095e-0x0;var _0x1a2cce=_0x9e94[_0x20095e];return _0x1a2cce;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49e9('0x0'))('api');var moment=require(_0x49e9('0x1'));var BPromise=require(_0x49e9('0x2'));var rp=require(_0x49e9('0x3'));var fs=require('fs');var path=require(_0x49e9('0x4'));var rimraf=require(_0x49e9('0x5'));var config=require('../../config/environment');var attributes=require('./memberReport.attributes');module[_0x49e9('0x6')]=function(_0x50169b,_0x38bf28){return _0x50169b[_0x49e9('0x7')](_0x49e9('0x8'),attributes,{'tableName':_0x49e9('0x9'),'paranoid':![],'indexes':[{'name':_0x49e9('0xa'),'fields':['membername',_0x49e9('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 188ee64..22715f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3dba=['map','model','then','create','CreateMemberReport','UpdateMemberReport','body','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','include'];(function(_0x1452e9,_0x281fce){var _0x3f96c9=function(_0x47de58){while(--_0x47de58){_0x1452e9['push'](_0x1452e9['shift']());}};_0x3f96c9(++_0x281fce);}(_0x3dba,0x73));var _0xa3db=function(_0x249d99,_0x16b584){_0x249d99=_0x249d99-0x0;var _0x5bfb05=_0x3dba[_0x249d99];return _0x5bfb05;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xa3db('0x0'));var rs=require(_0xa3db('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa3db('0x2'))['db'];var utils=require(_0xa3db('0x3'));var logger=require(_0xa3db('0x4'))(_0xa3db('0x5'));var config=require(_0xa3db('0x6'));var jayson=require(_0xa3db('0x7'));var client=jayson[_0xa3db('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5807bb,_0x56b483,_0x4f77df){return new BPromise(function(_0x3357f2,_0x59cda6){return client['request'](_0x5807bb,_0x4f77df)['then'](function(_0x1bda4c){logger[_0xa3db('0x9')](_0xa3db('0xa'),_0x56b483,_0xa3db('0xb'));logger[_0xa3db('0xc')](_0xa3db('0xd'),_0x56b483,_0xa3db('0xb'),JSON[_0xa3db('0xe')](_0x1bda4c));if(_0x1bda4c[_0xa3db('0xf')]){if(_0x1bda4c['error'][_0xa3db('0x10')]===0x1f4){logger[_0xa3db('0xf')](_0xa3db('0xa'),_0x56b483,_0x1bda4c[_0xa3db('0xf')][_0xa3db('0x11')]);return _0x59cda6(_0x1bda4c[_0xa3db('0xf')]['message']);}logger['error'](_0xa3db('0xa'),_0x56b483,_0x1bda4c[_0xa3db('0xf')]['message']);return _0x3357f2(_0x1bda4c[_0xa3db('0xf')][_0xa3db('0x11')]);}else{logger[_0xa3db('0x9')](_0xa3db('0xa'),_0x56b483,_0xa3db('0xb'));_0x3357f2(_0x1bda4c[_0xa3db('0x12')][_0xa3db('0x11')]);}})[_0xa3db('0x13')](function(_0x412708){logger['error']('MemberReport,\x20%s,\x20%s',_0x56b483,_0x412708);_0x59cda6(_0x412708);});});}exports[_0xa3db('0x14')]=function(_0x278c2a){var _0x3f701c=this;return new Promise(function(_0x3f5e3e,_0x5e6db8){return db[_0xa3db('0x15')][_0xa3db('0x16')]({'raw':_0x278c2a[_0xa3db('0x17')]?_0x278c2a[_0xa3db('0x17')][_0xa3db('0x18')]===undefined?!![]:![]:!![],'where':_0x278c2a[_0xa3db('0x17')]?_0x278c2a[_0xa3db('0x17')][_0xa3db('0x19')]||null:null,'attributes':_0x278c2a[_0xa3db('0x17')]?_0x278c2a[_0xa3db('0x17')][_0xa3db('0x1a')]||null:null,'limit':_0x278c2a[_0xa3db('0x17')]?_0x278c2a[_0xa3db('0x17')][_0xa3db('0x1b')]||null:null,'include':_0x278c2a[_0xa3db('0x17')]?_0x278c2a[_0xa3db('0x17')][_0xa3db('0x1c')]?_[_0xa3db('0x1d')](_0x278c2a[_0xa3db('0x17')]['include'],function(_0x3eab0c){return{'model':db[_0x3eab0c['model']],'as':_0x3eab0c['as'],'attributes':_0x3eab0c[_0xa3db('0x1a')],'include':_0x3eab0c[_0xa3db('0x1c')]?_['map'](_0x3eab0c[_0xa3db('0x1c')],function(_0xe0be83){return{'model':db[_0xe0be83[_0xa3db('0x1e')]],'as':_0xe0be83['as'],'attributes':_0xe0be83['attributes'],'include':_0xe0be83[_0xa3db('0x1c')]?_[_0xa3db('0x1d')](_0xe0be83[_0xa3db('0x1c')],function(_0x1f0d0e){return{'model':db[_0x1f0d0e[_0xa3db('0x1e')]],'as':_0x1f0d0e['as'],'attributes':_0x1f0d0e['attributes']};}):[]};}):[]};}):[]:[]})[_0xa3db('0x1f')](function(_0x4697e5){logger[_0xa3db('0x9')](_0xa3db('0x14'),_0x278c2a);logger[_0xa3db('0xc')](_0xa3db('0x14'),_0x278c2a,JSON[_0xa3db('0xe')](_0x4697e5));_0x3f5e3e(_0x4697e5);})[_0xa3db('0x13')](function(_0x19a858){logger[_0xa3db('0xf')]('GetMemberReport',_0x19a858[_0xa3db('0x11')],_0x278c2a);_0x5e6db8(_0x3f701c[_0xa3db('0xf')](0x1f4,_0x19a858[_0xa3db('0x11')]));});});};exports['CreateMemberReport']=function(_0x296f6d){var _0x3b3436=this;return new Promise(function(_0x581e1b,_0x2bc60f){return db[_0xa3db('0x15')][_0xa3db('0x20')](_0x296f6d['body'],{'raw':_0x296f6d[_0xa3db('0x17')]?_0x296f6d[_0xa3db('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x166fed){logger[_0xa3db('0x9')](_0xa3db('0x21'),_0x296f6d);logger[_0xa3db('0xc')](_0xa3db('0x21'),_0x296f6d,JSON[_0xa3db('0xe')](_0x166fed));_0x581e1b(_0x166fed);})[_0xa3db('0x13')](function(_0x273c37){logger['error'](_0xa3db('0x21'),_0x273c37['message'],_0x296f6d);_0x2bc60f(_0x3b3436[_0xa3db('0xf')](0x1f4,_0x273c37[_0xa3db('0x11')]));});});};exports[_0xa3db('0x22')]=function(_0x1d5050){var _0xb5fd8c=this;return new Promise(function(_0xc761f4,_0x44bd04){return db[_0xa3db('0x15')]['update'](_0x1d5050[_0xa3db('0x23')],{'raw':_0x1d5050[_0xa3db('0x17')]?_0x1d5050[_0xa3db('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d5050[_0xa3db('0x17')]?_0x1d5050[_0xa3db('0x17')][_0xa3db('0x19')]||null:null,'attributes':_0x1d5050[_0xa3db('0x17')]?_0x1d5050[_0xa3db('0x17')]['attributes']||null:null,'limit':_0x1d5050[_0xa3db('0x17')]?_0x1d5050['options']['limit']||null:null})[_0xa3db('0x1f')](function(_0x2fca36){logger[_0xa3db('0x9')](_0xa3db('0x22'),_0x1d5050);logger[_0xa3db('0xc')](_0xa3db('0x22'),_0x1d5050,JSON[_0xa3db('0xe')](_0x2fca36));_0xc761f4(_0x2fca36);})[_0xa3db('0x13')](function(_0xe15540){logger[_0xa3db('0xf')](_0xa3db('0x22'),_0xe15540[_0xa3db('0x11')],_0x1d5050);_0x44bd04(_0xb5fd8c['error'](0x1f4,_0xe15540[_0xa3db('0x11')]));});});};
\ No newline at end of file
+var _0x1419=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options','where','include','map','model','attributes','GetMemberReport','CreateMemberReport','MemberReport','create','body','UpdateMemberReport','update','limit','lodash'];(function(_0x4bfac3,_0x58324d){var _0x15f0f2=function(_0xf0c511){while(--_0xf0c511){_0x4bfac3['push'](_0x4bfac3['shift']());}};_0x15f0f2(++_0x58324d);}(_0x1419,0x127));var _0x9141=function(_0x12520a,_0x1b7cae){_0x12520a=_0x12520a-0x0;var _0x4cd1bd=_0x1419[_0x12520a];return _0x4cd1bd;};'use strict';var _=require(_0x9141('0x0'));var util=require(_0x9141('0x1'));var moment=require(_0x9141('0x2'));var BPromise=require(_0x9141('0x3'));var rs=require(_0x9141('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9141('0x5'));var logger=require(_0x9141('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9141('0x7'));var client=jayson[_0x9141('0x8')][_0x9141('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xca1c56,_0x47322a,_0x421631){return new BPromise(function(_0x1db495,_0x2f29fa){return client[_0x9141('0xa')](_0xca1c56,_0x421631)[_0x9141('0xb')](function(_0x582b71){logger[_0x9141('0xc')](_0x9141('0xd'),_0x47322a,_0x9141('0xe'));logger[_0x9141('0xf')](_0x9141('0x10'),_0x47322a,_0x9141('0xe'),JSON[_0x9141('0x11')](_0x582b71));if(_0x582b71[_0x9141('0x12')]){if(_0x582b71[_0x9141('0x12')][_0x9141('0x13')]===0x1f4){logger['error'](_0x9141('0xd'),_0x47322a,_0x582b71[_0x9141('0x12')][_0x9141('0x14')]);return _0x2f29fa(_0x582b71[_0x9141('0x12')][_0x9141('0x14')]);}logger[_0x9141('0x12')]('MemberReport,\x20%s,\x20%s',_0x47322a,_0x582b71['error'][_0x9141('0x14')]);return _0x1db495(_0x582b71[_0x9141('0x12')][_0x9141('0x14')]);}else{logger[_0x9141('0xc')](_0x9141('0xd'),_0x47322a,_0x9141('0xe'));_0x1db495(_0x582b71[_0x9141('0x15')][_0x9141('0x14')]);}})[_0x9141('0x16')](function(_0x48c575){logger[_0x9141('0x12')](_0x9141('0xd'),_0x47322a,_0x48c575);_0x2f29fa(_0x48c575);});});}exports['GetMemberReport']=function(_0x5b4354){var _0x160b5c=this;return new Promise(function(_0x50a578,_0x5c290c){return db['MemberReport']['findAll']({'raw':_0x5b4354[_0x9141('0x17')]?_0x5b4354['options']['raw']===undefined?!![]:![]:!![],'where':_0x5b4354[_0x9141('0x17')]?_0x5b4354['options'][_0x9141('0x18')]||null:null,'attributes':_0x5b4354[_0x9141('0x17')]?_0x5b4354[_0x9141('0x17')]['attributes']||null:null,'limit':_0x5b4354[_0x9141('0x17')]?_0x5b4354['options']['limit']||null:null,'include':_0x5b4354[_0x9141('0x17')]?_0x5b4354[_0x9141('0x17')][_0x9141('0x19')]?_[_0x9141('0x1a')](_0x5b4354[_0x9141('0x17')][_0x9141('0x19')],function(_0x15dd99){return{'model':db[_0x15dd99[_0x9141('0x1b')]],'as':_0x15dd99['as'],'attributes':_0x15dd99[_0x9141('0x1c')],'include':_0x15dd99[_0x9141('0x19')]?_[_0x9141('0x1a')](_0x15dd99[_0x9141('0x19')],function(_0x41dd18){return{'model':db[_0x41dd18[_0x9141('0x1b')]],'as':_0x41dd18['as'],'attributes':_0x41dd18['attributes'],'include':_0x41dd18[_0x9141('0x19')]?_[_0x9141('0x1a')](_0x41dd18[_0x9141('0x19')],function(_0x6b8c68){return{'model':db[_0x6b8c68['model']],'as':_0x6b8c68['as'],'attributes':_0x6b8c68['attributes']};}):[]};}):[]};}):[]:[]})[_0x9141('0xb')](function(_0xd1d009){logger[_0x9141('0xc')](_0x9141('0x1d'),_0x5b4354);logger[_0x9141('0xf')](_0x9141('0x1d'),_0x5b4354,JSON['stringify'](_0xd1d009));_0x50a578(_0xd1d009);})[_0x9141('0x16')](function(_0x275c50){logger['error']('GetMemberReport',_0x275c50[_0x9141('0x14')],_0x5b4354);_0x5c290c(_0x160b5c[_0x9141('0x12')](0x1f4,_0x275c50[_0x9141('0x14')]));});});};exports[_0x9141('0x1e')]=function(_0x1e4f26){var _0x1a57d0=this;return new Promise(function(_0x4de563,_0x26dc15){return db[_0x9141('0x1f')][_0x9141('0x20')](_0x1e4f26[_0x9141('0x21')],{'raw':_0x1e4f26[_0x9141('0x17')]?_0x1e4f26['options']['raw']===undefined?!![]:![]:!![]})[_0x9141('0xb')](function(_0x5a0334){logger[_0x9141('0xc')](_0x9141('0x1e'),_0x1e4f26);logger[_0x9141('0xf')]('CreateMemberReport',_0x1e4f26,JSON['stringify'](_0x5a0334));_0x4de563(_0x5a0334);})[_0x9141('0x16')](function(_0x297b49){logger['error'](_0x9141('0x1e'),_0x297b49[_0x9141('0x14')],_0x1e4f26);_0x26dc15(_0x1a57d0[_0x9141('0x12')](0x1f4,_0x297b49[_0x9141('0x14')]));});});};exports[_0x9141('0x22')]=function(_0x2ebea6){var _0x342342=this;return new Promise(function(_0x37fdf7,_0xe1f71d){return db[_0x9141('0x1f')][_0x9141('0x23')](_0x2ebea6[_0x9141('0x21')],{'raw':_0x2ebea6[_0x9141('0x17')]?_0x2ebea6[_0x9141('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ebea6[_0x9141('0x17')]?_0x2ebea6[_0x9141('0x17')]['where']||null:null,'attributes':_0x2ebea6[_0x9141('0x17')]?_0x2ebea6[_0x9141('0x17')][_0x9141('0x1c')]||null:null,'limit':_0x2ebea6['options']?_0x2ebea6[_0x9141('0x17')][_0x9141('0x24')]||null:null})[_0x9141('0xb')](function(_0x125fab){logger[_0x9141('0xc')](_0x9141('0x22'),_0x2ebea6);logger[_0x9141('0xf')]('UpdateMemberReport',_0x2ebea6,JSON[_0x9141('0x11')](_0x125fab));_0x37fdf7(_0x125fab);})[_0x9141('0x16')](function(_0x5ce96e){logger['error'](_0x9141('0x22'),_0x5ce96e[_0x9141('0x14')],_0x2ebea6);_0xe1f71d(_0x342342[_0x9141('0x12')](0x1f4,_0x5ce96e['message']));});});};
\ No newline at end of file
index aa6de49..504b5d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ee9=['fs-extra','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','connect-timeout','Router'];(function(_0x3998a9,_0x5c840d){var _0x5a8220=function(_0x1cb019){while(--_0x1cb019){_0x3998a9['push'](_0x3998a9['shift']());}};_0x5a8220(++_0x5c840d);}(_0x7ee9,0x115));var _0x97ee=function(_0x1be7fd,_0x51ff5a){_0x1be7fd=_0x1be7fd-0x0;var _0x2f7949=_0x7ee9[_0x1be7fd];return _0x2f7949;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x97ee('0x0'));var express=require('express');var router=express[_0x97ee('0x1')]();var fs_extra=require(_0x97ee('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x97ee('0x3'));var config=require(_0x97ee('0x4'));var controller=require(_0x97ee('0x5'));router[_0x97ee('0x6')]('/',controller[_0x97ee('0x7')]);module[_0x97ee('0x8')]=router;
\ No newline at end of file
+var _0xaf79=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./migration.controller','get'];(function(_0x3c597b,_0x107b8a){var _0x5c0dfe=function(_0x172bf4){while(--_0x172bf4){_0x3c597b['push'](_0x3c597b['shift']());}};_0x5c0dfe(++_0x107b8a);}(_0xaf79,0x82));var _0x9af7=function(_0x1b159d,_0x12dc44){_0x1b159d=_0x1b159d-0x0;var _0x206b10=_0xaf79[_0x1b159d];return _0x206b10;};'use strict';var multer=require('multer');var util=require(_0x9af7('0x0'));var path=require(_0x9af7('0x1'));var timeout=require(_0x9af7('0x2'));var express=require(_0x9af7('0x3'));var router=express[_0x9af7('0x4')]();var fs_extra=require(_0x9af7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9af7('0x6'));var config=require(_0x9af7('0x7'));var controller=require(_0x9af7('0x8'));router[_0x9af7('0x9')]('/',controller['index']);module['exports']=router;
\ No newline at end of file
index df0fd57..b5ab2ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa624=['STRING','version','sequelize','exports'];(function(_0xd28962,_0x5372de){var _0x423363=function(_0x499057){while(--_0x499057){_0xd28962['push'](_0xd28962['shift']());}};_0x423363(++_0x5372de);}(_0xa624,0xee));var _0x4a62=function(_0x367361,_0x311488){_0x367361=_0x367361-0x0;var _0x195d2d=_0xa624[_0x367361];return _0x195d2d;};'use strict';var Sequelize=require(_0x4a62('0x0'));module[_0x4a62('0x1')]={'version':{'type':Sequelize[_0x4a62('0x2')],'unique':_0x4a62('0x3')}};
\ No newline at end of file
+var _0x08b6=['STRING','version','sequelize','exports'];(function(_0x43f881,_0xd6e5a2){var _0x365c14=function(_0x50d386){while(--_0x50d386){_0x43f881['push'](_0x43f881['shift']());}};_0x365c14(++_0xd6e5a2);}(_0x08b6,0x116));var _0x608b=function(_0x174f9c,_0x3b3078){_0x174f9c=_0x174f9c-0x0;var _0x2e7a5e=_0x08b6[_0x174f9c];return _0x2e7a5e;};'use strict';var Sequelize=require(_0x608b('0x0'));module[_0x608b('0x1')]={'version':{'type':Sequelize[_0x608b('0x2')],'unique':_0x608b('0x3')}};
\ No newline at end of file
index fb20dcf..a473998 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8cbe=['findAll','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','save','destroy','then','stack','name','send','index','map','Migration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','VIRTUAL','filter','merge','options','includeAll','include'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x8cbe,0x1a1));var _0xe8cb=function(_0x2a3900,_0x10dcb6){_0x2a3900=_0x2a3900-0x0;var _0x17040f=_0x8cbe[_0x2a3900];return _0x17040f;};'use strict';var emlformat=require(_0xe8cb('0x0'));var rimraf=require(_0xe8cb('0x1'));var zipdir=require(_0xe8cb('0x2'));var jsonpatch=require(_0xe8cb('0x3'));var rp=require(_0xe8cb('0x4'));var moment=require(_0xe8cb('0x5'));var BPromise=require(_0xe8cb('0x6'));var Mustache=require(_0xe8cb('0x7'));var util=require('util');var path=require('path');var sox=require(_0xe8cb('0x8'));var csv=require(_0xe8cb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8cb('0xa'));var _=require(_0xe8cb('0xb'));var squel=require('squel');var crypto=require(_0xe8cb('0xc'));var jsforce=require(_0xe8cb('0xd'));var deskjs=require(_0xe8cb('0xe'));var toCsv=require(_0xe8cb('0x9'));var querystring=require(_0xe8cb('0xf'));var Papa=require(_0xe8cb('0x10'));var Redis=require(_0xe8cb('0x11'));var authService=require(_0xe8cb('0x12'));var qs=require(_0xe8cb('0x13'));var as=require(_0xe8cb('0x14'));var hardwareService=require(_0xe8cb('0x15'));var logger=require('../../config/logger')(_0xe8cb('0x16'));var utils=require('../../config/utils');var config=require(_0xe8cb('0x17'));var licenseUtil=require(_0xe8cb('0x18'));var db=require(_0xe8cb('0x19'))['db'];function respondWithStatusCode(_0x20e4cb,_0x1e03df){_0x1e03df=_0x1e03df||0xcc;return function(_0x442564){if(_0x442564){return _0x20e4cb[_0xe8cb('0x1a')](_0x1e03df);}return _0x20e4cb[_0xe8cb('0x1b')](_0x1e03df)[_0xe8cb('0x1c')]();};}function respondWithResult(_0x53790f,_0x434144){_0x434144=_0x434144||0xc8;return function(_0x5c02ef){if(_0x5c02ef){return _0x53790f['status'](_0x434144)[_0xe8cb('0x1d')](_0x5c02ef);}};}function respondWithFilteredResult(_0x36dba7,_0x33a38c){return function(_0x3fd932){if(_0x3fd932){var _0x712d83=typeof _0x33a38c[_0xe8cb('0x1e')]===_0xe8cb('0x1f')&&typeof _0x33a38c[_0xe8cb('0x20')]===_0xe8cb('0x1f');var _0x34c4d5=_0x3fd932[_0xe8cb('0x21')];var _0x513b19=_0x712d83?0x0:_0x33a38c['offset'];var _0x1f33f8=_0x712d83?_0x3fd932[_0xe8cb('0x21')]:_0x33a38c['offset']+_0x33a38c[_0xe8cb('0x20')];var _0x53a24c;if(_0x1f33f8>=_0x34c4d5){_0x1f33f8=_0x34c4d5;_0x53a24c=0xc8;}else{_0x53a24c=0xce;}_0x36dba7[_0xe8cb('0x1b')](_0x53a24c);return _0x36dba7[_0xe8cb('0x22')]('Content-Range',_0x513b19+'-'+_0x1f33f8+'/'+_0x34c4d5)[_0xe8cb('0x1d')](_0x3fd932);}return null;};}function patchUpdates(_0x27abbe){return function(_0x4374ed){try{jsonpatch['apply'](_0x4374ed,_0x27abbe,!![]);}catch(_0x468e76){return BPromise['reject'](_0x468e76);}return _0x4374ed[_0xe8cb('0x23')]();};}function saveUpdates(_0x5a504f,_0x2c2f3a){return function(_0x21d5dc){if(_0x21d5dc){return _0x21d5dc['update'](_0x5a504f)['then'](function(_0x3fb46b){return _0x3fb46b;});}return null;};}function removeEntity(_0x22ccea,_0x2e2963){return function(_0x2f92a4){if(_0x2f92a4){return _0x2f92a4[_0xe8cb('0x24')]()[_0xe8cb('0x25')](function(){_0x22ccea[_0xe8cb('0x1b')](0xcc)[_0xe8cb('0x1c')]();});}};}function handleEntityNotFound(_0x911e0e,_0x38ebf0){return function(_0x39e0d3){if(!_0x39e0d3){_0x911e0e['sendStatus'](0x194);}return _0x39e0d3;};}function handleError(_0x5aa802,_0x18c0ee){_0x18c0ee=_0x18c0ee||0x1f4;return function(_0x348215){logger['error'](_0x348215[_0xe8cb('0x26')]);if(_0x348215[_0xe8cb('0x27')]){delete _0x348215[_0xe8cb('0x27')];}_0x5aa802['status'](_0x18c0ee)[_0xe8cb('0x28')](_0x348215);};}exports[_0xe8cb('0x29')]=function(_0x3737c2,_0x17b841){var _0x1d742a={},_0x1e39d5={},_0x15b741={'count':0x0,'rows':[]};var _0x364178=_[_0xe8cb('0x2a')](db[_0xe8cb('0x2b')][_0xe8cb('0x2c')],function(_0x33badd){return{'name':_0x33badd[_0xe8cb('0x2d')],'type':_0x33badd[_0xe8cb('0x2e')][_0xe8cb('0x2f')]};});_0x1e39d5[_0xe8cb('0x30')]=_[_0xe8cb('0x2a')](_0x364178,_0xe8cb('0x27'));_0x1e39d5[_0xe8cb('0x31')]=_[_0xe8cb('0x32')](_0x3737c2[_0xe8cb('0x31')]);_0x1e39d5['filters']=_[_0xe8cb('0x33')](_0x1e39d5[_0xe8cb('0x30')],_0x1e39d5[_0xe8cb('0x31')]);_0x1d742a[_0xe8cb('0x34')]=_['intersection'](_0x1e39d5[_0xe8cb('0x30')],qs[_0xe8cb('0x35')](_0x3737c2[_0xe8cb('0x31')][_0xe8cb('0x35')]));_0x1d742a[_0xe8cb('0x34')]=_0x1d742a['attributes'][_0xe8cb('0x36')]?_0x1d742a[_0xe8cb('0x34')]:_0x1e39d5[_0xe8cb('0x30')];if(!_0x3737c2[_0xe8cb('0x31')][_0xe8cb('0x37')]('nolimit')){_0x1d742a['limit']=qs['limit'](_0x3737c2[_0xe8cb('0x31')][_0xe8cb('0x20')]);_0x1d742a[_0xe8cb('0x1e')]=qs[_0xe8cb('0x1e')](_0x3737c2[_0xe8cb('0x31')][_0xe8cb('0x1e')]);}_0x1d742a[_0xe8cb('0x38')]=qs[_0xe8cb('0x39')](_0x3737c2[_0xe8cb('0x31')][_0xe8cb('0x39')]);_0x1d742a[_0xe8cb('0x3a')]=qs[_0xe8cb('0x3b')](_['pick'](_0x3737c2[_0xe8cb('0x31')],_0x1e39d5[_0xe8cb('0x3b')]),_0x364178);if(_0x3737c2[_0xe8cb('0x31')]['filter']){_0x1d742a['where']=_['merge'](_0x1d742a[_0xe8cb('0x3a')],{'$or':_['map'](_0x364178,function(_0x4754f9){if(_0x4754f9[_0xe8cb('0x2e')]!==_0xe8cb('0x3c')){var _0x1f84c3={};_0x1f84c3[_0x4754f9[_0xe8cb('0x27')]]={'$like':'%'+_0x3737c2[_0xe8cb('0x31')][_0xe8cb('0x3d')]+'%'};return _0x1f84c3;}})});}_0x1d742a=_[_0xe8cb('0x3e')]({},_0x1d742a,_0x3737c2[_0xe8cb('0x3f')]);var _0x3e002f={'where':_0x1d742a[_0xe8cb('0x3a')]};return db[_0xe8cb('0x2b')]['count'](_0x3e002f)[_0xe8cb('0x25')](function(_0x40d0b6){_0x15b741[_0xe8cb('0x21')]=_0x40d0b6;if(_0x3737c2[_0xe8cb('0x31')][_0xe8cb('0x40')]){_0x1d742a[_0xe8cb('0x41')]=[{'all':!![]}];}return db['Migration'][_0xe8cb('0x42')](_0x1d742a);})['then'](function(_0x34b612){_0x15b741[_0xe8cb('0x43')]=_0x34b612;return _0x15b741;})[_0xe8cb('0x25')](respondWithFilteredResult(_0x17b841,_0x1d742a))[_0xe8cb('0x44')](handleError(_0x17b841,null));};
\ No newline at end of file
+var _0x0e64=['offset','set','apply','reject','update','then','destroy','error','stack','name','send','index','Migration','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','include','findAll','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count'];(function(_0x1251f4,_0x220d95){var _0x12f5fc=function(_0x19dcbd){while(--_0x19dcbd){_0x1251f4['push'](_0x1251f4['shift']());}};_0x12f5fc(++_0x220d95);}(_0x0e64,0x1c2));var _0x40e6=function(_0xd7a812,_0x1ec9fe){_0xd7a812=_0xd7a812-0x0;var _0x20d352=_0x0e64[_0xd7a812];return _0x20d352;};'use strict';var emlformat=require(_0x40e6('0x0'));var rimraf=require(_0x40e6('0x1'));var zipdir=require(_0x40e6('0x2'));var jsonpatch=require(_0x40e6('0x3'));var rp=require(_0x40e6('0x4'));var moment=require(_0x40e6('0x5'));var BPromise=require(_0x40e6('0x6'));var Mustache=require(_0x40e6('0x7'));var util=require('util');var path=require(_0x40e6('0x8'));var sox=require(_0x40e6('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x40e6('0xa'));var _=require(_0x40e6('0xb'));var squel=require(_0x40e6('0xc'));var crypto=require('crypto');var jsforce=require(_0x40e6('0xd'));var deskjs=require(_0x40e6('0xe'));var toCsv=require(_0x40e6('0xf'));var querystring=require(_0x40e6('0x10'));var Papa=require(_0x40e6('0x11'));var Redis=require(_0x40e6('0x12'));var authService=require(_0x40e6('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x40e6('0x14'));var logger=require(_0x40e6('0x15'))(_0x40e6('0x16'));var utils=require(_0x40e6('0x17'));var config=require(_0x40e6('0x18'));var licenseUtil=require(_0x40e6('0x19'));var db=require(_0x40e6('0x1a'))['db'];function respondWithStatusCode(_0x4f8fd1,_0x256267){_0x256267=_0x256267||0xcc;return function(_0x790479){if(_0x790479){return _0x4f8fd1['sendStatus'](_0x256267);}return _0x4f8fd1['status'](_0x256267)[_0x40e6('0x1b')]();};}function respondWithResult(_0x1d6b10,_0x1924e4){_0x1924e4=_0x1924e4||0xc8;return function(_0x1dfdeb){if(_0x1dfdeb){return _0x1d6b10[_0x40e6('0x1c')](_0x1924e4)[_0x40e6('0x1d')](_0x1dfdeb);}};}function respondWithFilteredResult(_0xf702e2,_0x5ba4f0){return function(_0x11c1ef){if(_0x11c1ef){var _0x3203e1=typeof _0x5ba4f0['offset']===_0x40e6('0x1e')&&typeof _0x5ba4f0[_0x40e6('0x1f')]==='undefined';var _0x312298=_0x11c1ef[_0x40e6('0x20')];var _0x43075e=_0x3203e1?0x0:_0x5ba4f0[_0x40e6('0x21')];var _0xdd028f=_0x3203e1?_0x11c1ef[_0x40e6('0x20')]:_0x5ba4f0['offset']+_0x5ba4f0['limit'];var _0x2ebad8;if(_0xdd028f>=_0x312298){_0xdd028f=_0x312298;_0x2ebad8=0xc8;}else{_0x2ebad8=0xce;}_0xf702e2[_0x40e6('0x1c')](_0x2ebad8);return _0xf702e2[_0x40e6('0x22')]('Content-Range',_0x43075e+'-'+_0xdd028f+'/'+_0x312298)['json'](_0x11c1ef);}return null;};}function patchUpdates(_0x16b1df){return function(_0x1f1889){try{jsonpatch[_0x40e6('0x23')](_0x1f1889,_0x16b1df,!![]);}catch(_0x9ca717){return BPromise[_0x40e6('0x24')](_0x9ca717);}return _0x1f1889['save']();};}function saveUpdates(_0x52caa3,_0x44c0b3){return function(_0x488b1e){if(_0x488b1e){return _0x488b1e[_0x40e6('0x25')](_0x52caa3)[_0x40e6('0x26')](function(_0x1e433e){return _0x1e433e;});}return null;};}function removeEntity(_0x4326f5,_0xd7ce2c){return function(_0x42d13f){if(_0x42d13f){return _0x42d13f[_0x40e6('0x27')]()[_0x40e6('0x26')](function(){_0x4326f5[_0x40e6('0x1c')](0xcc)[_0x40e6('0x1b')]();});}};}function handleEntityNotFound(_0x2a6dd6,_0x13515e){return function(_0x45ad49){if(!_0x45ad49){_0x2a6dd6['sendStatus'](0x194);}return _0x45ad49;};}function handleError(_0x59a7e3,_0x34db7a){_0x34db7a=_0x34db7a||0x1f4;return function(_0x2688ab){logger[_0x40e6('0x28')](_0x2688ab[_0x40e6('0x29')]);if(_0x2688ab[_0x40e6('0x2a')]){delete _0x2688ab[_0x40e6('0x2a')];}_0x59a7e3[_0x40e6('0x1c')](_0x34db7a)[_0x40e6('0x2b')](_0x2688ab);};}exports[_0x40e6('0x2c')]=function(_0x5bb609,_0x1d010e){var _0x1929d5={},_0xa89d29={},_0x31a269={'count':0x0,'rows':[]};var _0x4cc4cf=_['map'](db[_0x40e6('0x2d')]['rawAttributes'],function(_0x4e61b7){return{'name':_0x4e61b7['fieldName'],'type':_0x4e61b7[_0x40e6('0x2e')][_0x40e6('0x2f')]};});_0xa89d29['model']=_[_0x40e6('0x30')](_0x4cc4cf,_0x40e6('0x2a'));_0xa89d29[_0x40e6('0x31')]=_[_0x40e6('0x32')](_0x5bb609[_0x40e6('0x31')]);_0xa89d29[_0x40e6('0x33')]=_[_0x40e6('0x34')](_0xa89d29[_0x40e6('0x35')],_0xa89d29['query']);_0x1929d5['attributes']=_[_0x40e6('0x34')](_0xa89d29[_0x40e6('0x35')],qs['fields'](_0x5bb609['query'][_0x40e6('0x36')]));_0x1929d5[_0x40e6('0x37')]=_0x1929d5['attributes'][_0x40e6('0x38')]?_0x1929d5[_0x40e6('0x37')]:_0xa89d29[_0x40e6('0x35')];if(!_0x5bb609['query']['hasOwnProperty'](_0x40e6('0x39'))){_0x1929d5[_0x40e6('0x1f')]=qs['limit'](_0x5bb609[_0x40e6('0x31')]['limit']);_0x1929d5[_0x40e6('0x21')]=qs['offset'](_0x5bb609[_0x40e6('0x31')]['offset']);}_0x1929d5[_0x40e6('0x3a')]=qs[_0x40e6('0x3b')](_0x5bb609[_0x40e6('0x31')][_0x40e6('0x3b')]);_0x1929d5[_0x40e6('0x3c')]=qs[_0x40e6('0x33')](_[_0x40e6('0x3d')](_0x5bb609['query'],_0xa89d29['filters']),_0x4cc4cf);if(_0x5bb609['query'][_0x40e6('0x3e')]){_0x1929d5[_0x40e6('0x3c')]=_['merge'](_0x1929d5[_0x40e6('0x3c')],{'$or':_[_0x40e6('0x30')](_0x4cc4cf,function(_0x4a55ea){if(_0x4a55ea['type']!==_0x40e6('0x3f')){var _0x45ac54={};_0x45ac54[_0x4a55ea[_0x40e6('0x2a')]]={'$like':'%'+_0x5bb609[_0x40e6('0x31')][_0x40e6('0x3e')]+'%'};return _0x45ac54;}})});}_0x1929d5=_['merge']({},_0x1929d5,_0x5bb609[_0x40e6('0x40')]);var _0x47c984={'where':_0x1929d5['where']};return db[_0x40e6('0x2d')][_0x40e6('0x20')](_0x47c984)['then'](function(_0x25a9be){_0x31a269['count']=_0x25a9be;if(_0x5bb609[_0x40e6('0x31')]['includeAll']){_0x1929d5[_0x40e6('0x41')]=[{'all':!![]}];}return db['Migration'][_0x40e6('0x42')](_0x1929d5);})[_0x40e6('0x26')](function(_0x44d384){_0x31a269[_0x40e6('0x43')]=_0x44d384;return _0x31a269;})['then'](respondWithFilteredResult(_0x1d010e,_0x1929d5))[_0x40e6('0x44')](handleError(_0x1d010e,null));};
\ No newline at end of file
index bfccc61..32b0ae8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdcce=['path','rimraf','../../config/environment','exports','Migration','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x142c34,_0x499542){var _0x547e1d=function(_0x41a9cb){while(--_0x41a9cb){_0x142c34['push'](_0x142c34['shift']());}};_0x547e1d(++_0x499542);}(_0xdcce,0x161));var _0xedcc=function(_0x2418c9,_0x1e350c){_0x2418c9=_0x2418c9-0x0;var _0x23e463=_0xdcce[_0x2418c9];return _0x23e463;};'use strict';var _=require(_0xedcc('0x0'));var util=require(_0xedcc('0x1'));var logger=require(_0xedcc('0x2'))(_0xedcc('0x3'));var moment=require(_0xedcc('0x4'));var BPromise=require(_0xedcc('0x5'));var rp=require(_0xedcc('0x6'));var fs=require('fs');var path=require(_0xedcc('0x7'));var rimraf=require(_0xedcc('0x8'));var config=require(_0xedcc('0x9'));var attributes=require('./migration.attributes');module[_0xedcc('0xa')]=function(_0x26adc4,_0x10275a){return _0x26adc4['define'](_0xedcc('0xb'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8225=['moment','bluebird','request-promise','rimraf','./migration.attributes','exports','define','Migration','migrations','util','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8225,0xa5));var _0x5822=function(_0x2aeba4,_0x47184c){_0x2aeba4=_0x2aeba4-0x0;var _0x3db727=_0x8225[_0x2aeba4];return _0x3db727;};'use strict';var _=require('lodash');var util=require(_0x5822('0x0'));var logger=require(_0x5822('0x1'))(_0x5822('0x2'));var moment=require(_0x5822('0x3'));var BPromise=require(_0x5822('0x4'));var rp=require(_0x5822('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5822('0x6'));var config=require('../../config/environment');var attributes=require(_0x5822('0x7'));module[_0x5822('0x8')]=function(_0x41ee9d,_0x6468e4){return _0x41ee9d[_0x5822('0x9')](_0x5822('0xa'),attributes,{'tableName':_0x5822('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index bbd120d..9b19bbc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1120=['stringify','error','code','message','catch','lodash','util','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s'];(function(_0x20b162,_0x4808b8){var _0x251016=function(_0x5e7dd7){while(--_0x5e7dd7){_0x20b162['push'](_0x20b162['shift']());}};_0x251016(++_0x4808b8);}(_0x1120,0x140));var _0x0112=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x1120[_0x2763f2];return _0x3ef471;};'use strict';var _=require(_0x0112('0x0'));var util=require(_0x0112('0x1'));var moment=require(_0x0112('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(_0x0112('0x3'));var logger=require(_0x0112('0x4'))(_0x0112('0x5'));var config=require(_0x0112('0x6'));var jayson=require(_0x0112('0x7'));var client=jayson[_0x0112('0x8')][_0x0112('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40ad0d,_0x31d67a,_0x444422){return new BPromise(function(_0x2fd18c,_0x1e87af){return client['request'](_0x40ad0d,_0x444422)[_0x0112('0xa')](function(_0x26fd2e){logger[_0x0112('0xb')](_0x0112('0xc'),_0x31d67a,_0x0112('0xd'));logger[_0x0112('0xe')](_0x0112('0xf'),_0x31d67a,'request\x20sent',JSON[_0x0112('0x10')](_0x26fd2e));if(_0x26fd2e[_0x0112('0x11')]){if(_0x26fd2e[_0x0112('0x11')][_0x0112('0x12')]===0x1f4){logger['error'](_0x0112('0xc'),_0x31d67a,_0x26fd2e[_0x0112('0x11')][_0x0112('0x13')]);return _0x1e87af(_0x26fd2e[_0x0112('0x11')]['message']);}logger['error'](_0x0112('0xc'),_0x31d67a,_0x26fd2e['error'][_0x0112('0x13')]);return _0x2fd18c(_0x26fd2e['error'][_0x0112('0x13')]);}else{logger[_0x0112('0xb')](_0x0112('0xc'),_0x31d67a,_0x0112('0xd'));_0x2fd18c(_0x26fd2e['result'][_0x0112('0x13')]);}})[_0x0112('0x14')](function(_0x5ef9fe){logger['error']('Migration,\x20%s,\x20%s',_0x31d67a,_0x5ef9fe);_0x1e87af(_0x5ef9fe);});});}
\ No newline at end of file
+var _0x0f73=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Migration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis'];(function(_0xe391c2,_0x3aff36){var _0x476ab3=function(_0x43b0ac){while(--_0x43b0ac){_0xe391c2['push'](_0xe391c2['shift']());}};_0x476ab3(++_0x3aff36);}(_0x0f73,0x146));var _0x30f7=function(_0x26ad65,_0x226809){_0x26ad65=_0x26ad65-0x0;var _0x5a8df4=_0x0f73[_0x26ad65];return _0x5a8df4;};'use strict';var _=require(_0x30f7('0x0'));var util=require(_0x30f7('0x1'));var moment=require(_0x30f7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x30f7('0x3'));var db=require(_0x30f7('0x4'))['db'];var utils=require(_0x30f7('0x5'));var logger=require(_0x30f7('0x6'))(_0x30f7('0x7'));var config=require('../../config/environment');var jayson=require(_0x30f7('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x38ad1d,_0x1c90cb,_0x2de5e7){return new BPromise(function(_0x7e377e,_0x5c5cf3){return client[_0x30f7('0x9')](_0x38ad1d,_0x2de5e7)[_0x30f7('0xa')](function(_0x5eedb2){logger[_0x30f7('0xb')]('Migration,\x20%s,\x20%s',_0x1c90cb,'request\x20sent');logger[_0x30f7('0xc')](_0x30f7('0xd'),_0x1c90cb,_0x30f7('0xe'),JSON[_0x30f7('0xf')](_0x5eedb2));if(_0x5eedb2['error']){if(_0x5eedb2[_0x30f7('0x10')][_0x30f7('0x11')]===0x1f4){logger['error'](_0x30f7('0x12'),_0x1c90cb,_0x5eedb2[_0x30f7('0x10')][_0x30f7('0x13')]);return _0x5c5cf3(_0x5eedb2['error'][_0x30f7('0x13')]);}logger[_0x30f7('0x10')]('Migration,\x20%s,\x20%s',_0x1c90cb,_0x5eedb2[_0x30f7('0x10')][_0x30f7('0x13')]);return _0x7e377e(_0x5eedb2[_0x30f7('0x10')][_0x30f7('0x13')]);}else{logger[_0x30f7('0xb')]('Migration,\x20%s,\x20%s',_0x1c90cb,'request\x20sent');_0x7e377e(_0x5eedb2[_0x30f7('0x14')][_0x30f7('0x13')]);}})[_0x30f7('0x15')](function(_0x1a5565){logger['error'](_0x30f7('0x12'),_0x1c90cb,_0x1a5565);_0x5c5cf3(_0x1a5565);});});}
\ No newline at end of file
index d7be7e5..927c2e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe6e9=['post','create','put','update','delete','/:id','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./network.controller','get','isAuthenticated','index','show'];(function(_0x34bc8d,_0x34e806){var _0x2554a3=function(_0x586f7c){while(--_0x586f7c){_0x34bc8d['push'](_0x34bc8d['shift']());}};_0x2554a3(++_0x34e806);}(_0xe6e9,0x182));var _0x9e6e=function(_0x3ac75f,_0x6576f0){_0x3ac75f=_0x3ac75f-0x0;var _0x5a35ad=_0xe6e9[_0x3ac75f];return _0x5a35ad;};'use strict';var multer=require(_0x9e6e('0x0'));var util=require(_0x9e6e('0x1'));var path=require(_0x9e6e('0x2'));var timeout=require('connect-timeout');var express=require(_0x9e6e('0x3'));var router=express[_0x9e6e('0x4')]();var fs_extra=require(_0x9e6e('0x5'));var auth=require(_0x9e6e('0x6'));var interaction=require(_0x9e6e('0x7'));var config=require('../../config/environment');var controller=require(_0x9e6e('0x8'));router[_0x9e6e('0x9')]('/',auth[_0x9e6e('0xa')](),controller[_0x9e6e('0xb')]);router[_0x9e6e('0x9')]('/:id',auth[_0x9e6e('0xa')](),controller[_0x9e6e('0xc')]);router[_0x9e6e('0xd')]('/',auth[_0x9e6e('0xa')](),controller[_0x9e6e('0xe')]);router[_0x9e6e('0xf')]('/:id',auth[_0x9e6e('0xa')](),controller[_0x9e6e('0x10')]);router[_0x9e6e('0x11')](_0x9e6e('0x12'),auth['isAuthenticated'](),controller[_0x9e6e('0x13')]);module[_0x9e6e('0x14')]=router;
\ No newline at end of file
+var _0x80e6=['./network.controller','get','isAuthenticated','index','/:id','show','post','create','put','destroy','exports','util','path','express','Router','../../components/auth/service','../../config/environment'];(function(_0x25a8fb,_0x4245c4){var _0x5ed7ba=function(_0x560b27){while(--_0x560b27){_0x25a8fb['push'](_0x25a8fb['shift']());}};_0x5ed7ba(++_0x4245c4);}(_0x80e6,0x1e7));var _0x680e=function(_0x1605bf,_0x99db03){_0x1605bf=_0x1605bf-0x0;var _0x3fe78b=_0x80e6[_0x1605bf];return _0x3fe78b;};'use strict';var multer=require('multer');var util=require(_0x680e('0x0'));var path=require(_0x680e('0x1'));var timeout=require('connect-timeout');var express=require(_0x680e('0x2'));var router=express[_0x680e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x680e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x680e('0x5'));var controller=require(_0x680e('0x6'));router[_0x680e('0x7')]('/',auth[_0x680e('0x8')](),controller[_0x680e('0x9')]);router[_0x680e('0x7')](_0x680e('0xa'),auth[_0x680e('0x8')](),controller[_0x680e('0xb')]);router[_0x680e('0xc')]('/',auth[_0x680e('0x8')](),controller[_0x680e('0xd')]);router[_0x680e('0xe')](_0x680e('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x680e('0xa'),auth[_0x680e('0x8')](),controller[_0x680e('0xf')]);module[_0x680e('0x10')]=router;
\ No newline at end of file
index cbe77cf..2d1ec68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a21=['localnet','externip','stun','STRING','sequelize','exports','ENUM'];(function(_0x1e271f,_0xf14504){var _0x2b2ac5=function(_0x21c3b6){while(--_0x21c3b6){_0x1e271f['push'](_0x1e271f['shift']());}};_0x2b2ac5(++_0xf14504);}(_0x1a21,0x1bd));var _0x11a2=function(_0x329664,_0x130748){_0x329664=_0x329664-0x0;var _0x4e346e=_0x1a21[_0x329664];return _0x4e346e;};'use strict';var Sequelize=require(_0x11a2('0x0'));module[_0x11a2('0x1')]={'type':{'type':Sequelize[_0x11a2('0x2')](_0x11a2('0x3'),_0x11a2('0x4'),_0x11a2('0x5'),'turn')},'value':{'type':Sequelize[_0x11a2('0x6')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x11a2('0x6')]}};
\ No newline at end of file
+var _0xbaad=['localnet','externip','stun','turn','STRING','sequelize','exports','ENUM'];(function(_0x49ee16,_0x16c8c5){var _0x5aa6f6=function(_0x13b95c){while(--_0x13b95c){_0x49ee16['push'](_0x49ee16['shift']());}};_0x5aa6f6(++_0x16c8c5);}(_0xbaad,0x15d));var _0xdbaa=function(_0x14f115,_0x3e9edf){_0x14f115=_0x14f115-0x0;var _0x1d78c8=_0xbaad[_0x14f115];return _0x1d78c8;};'use strict';var Sequelize=require(_0xdbaa('0x0'));module[_0xdbaa('0x1')]={'type':{'type':Sequelize[_0xdbaa('0x2')](_0xdbaa('0x3'),_0xdbaa('0x4'),_0xdbaa('0x5'),_0xdbaa('0x6'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xdbaa('0x7')]},'password':{'type':Sequelize[_0xdbaa('0x7')]}};
\ No newline at end of file
index 0a4578d..0590d73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa6a9=['server/files/templates/turn_multiple.ejs','server/files/templates/network.ejs','format','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','request','then','info','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','code','Network,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','stack','name','send','Network','rawAttributes','fieldName','map','query','keys','filters','intersection','model','attributes','fields','length','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','sequelize','transaction','body','toUpperCase','STUN','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','TURN','readFileSync','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so'];(function(_0x2be026,_0x155521){var _0x38c371=function(_0x155977){while(--_0x155977){_0x2be026['push'](_0x2be026['shift']());}};_0x38c371(++_0x155521);}(_0xa6a9,0x6e));var _0x9a6a=function(_0x4eab61,_0x1a6e6d){_0x4eab61=_0x4eab61-0x0;var _0x342426=_0xa6a9[_0x4eab61];return _0x342426;};'use strict';var emlformat=require(_0x9a6a('0x0'));var rimraf=require(_0x9a6a('0x1'));var zipdir=require(_0x9a6a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9a6a('0x3'));var moment=require(_0x9a6a('0x4'));var BPromise=require(_0x9a6a('0x5'));var Mustache=require(_0x9a6a('0x6'));var util=require('util');var path=require(_0x9a6a('0x7'));var sox=require('sox');var csv=require(_0x9a6a('0x8'));var ejs=require(_0x9a6a('0x9'));var fs=require('fs');var fs_extra=require(_0x9a6a('0xa'));var _=require(_0x9a6a('0xb'));var squel=require('squel');var crypto=require(_0x9a6a('0xc'));var jsforce=require(_0x9a6a('0xd'));var deskjs=require(_0x9a6a('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9a6a('0xf'));var Papa=require('papaparse');var Redis=require(_0x9a6a('0x10'));var authService=require(_0x9a6a('0x11'));var qs=require(_0x9a6a('0x12'));var as=require(_0x9a6a('0x13'));var hardwareService=require(_0x9a6a('0x14'));var logger=require(_0x9a6a('0x15'))(_0x9a6a('0x16'));var utils=require(_0x9a6a('0x17'));var config=require(_0x9a6a('0x18'));var licenseUtil=require(_0x9a6a('0x19'));var db=require('../../mysqldb')['db'];var jayson=require(_0x9a6a('0x1a'));var client=jayson[_0x9a6a('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9471ee,_0x35374e,_0x38a21a,_0x43530e){return new BPromise(function(_0x10e6a6,_0x5b752f){var _0x4ad686=_0x43530e||client;return _0x4ad686[_0x9a6a('0x1c')](_0x9471ee,_0x38a21a)[_0x9a6a('0x1d')](function(_0x19a4c3){logger[_0x9a6a('0x1e')]('Network,\x20%s,\x20%s',_0x35374e,_0x9a6a('0x1f'));logger[_0x9a6a('0x20')](_0x9a6a('0x21'),_0x35374e,_0x9a6a('0x1f'),JSON['stringify'](_0x19a4c3));if(_0x19a4c3[_0x9a6a('0x22')]){if(_0x19a4c3[_0x9a6a('0x22')][_0x9a6a('0x23')]===0x1f4){logger[_0x9a6a('0x22')](_0x9a6a('0x24'),_0x35374e,_0x19a4c3[_0x9a6a('0x22')][_0x9a6a('0x25')]);return _0x5b752f(_0x19a4c3['error'][_0x9a6a('0x25')]);}logger[_0x9a6a('0x22')](_0x9a6a('0x24'),_0x35374e,_0x19a4c3[_0x9a6a('0x22')]['message']);return _0x10e6a6(_0x19a4c3[_0x9a6a('0x22')][_0x9a6a('0x25')]);}else{logger[_0x9a6a('0x1e')](_0x9a6a('0x24'),_0x35374e,'request\x20sent');_0x10e6a6(_0x19a4c3[_0x9a6a('0x26')][_0x9a6a('0x25')]);}})[_0x9a6a('0x27')](function(_0x58ca7f){logger['error'](_0x9a6a('0x24'),_0x35374e,_0x58ca7f);_0x5b752f(_0x58ca7f);});});}function respondWithStatusCode(_0x3d38bd,_0x2f1301){_0x2f1301=_0x2f1301||0xcc;return function(_0x68785b){if(_0x68785b){return _0x3d38bd[_0x9a6a('0x28')](_0x2f1301);}return _0x3d38bd[_0x9a6a('0x29')](_0x2f1301)[_0x9a6a('0x2a')]();};}function respondWithResult(_0x254b2e,_0x321c90){_0x321c90=_0x321c90||0xc8;return function(_0x3b766d){if(_0x3b766d){return _0x254b2e[_0x9a6a('0x29')](_0x321c90)[_0x9a6a('0x2b')](_0x3b766d);}};}function respondWithFilteredResult(_0x1c3b26,_0x504cfd){return function(_0xf2d509){if(_0xf2d509){var _0x523bbf=typeof _0x504cfd[_0x9a6a('0x2c')]===_0x9a6a('0x2d')&&typeof _0x504cfd[_0x9a6a('0x2e')]===_0x9a6a('0x2d');var _0x4abf09=_0xf2d509[_0x9a6a('0x2f')];var _0x4da200=_0x523bbf?0x0:_0x504cfd[_0x9a6a('0x2c')];var _0x5b7be2=_0x523bbf?_0xf2d509[_0x9a6a('0x2f')]:_0x504cfd[_0x9a6a('0x2c')]+_0x504cfd[_0x9a6a('0x2e')];var _0x3af99d;if(_0x5b7be2>=_0x4abf09){_0x5b7be2=_0x4abf09;_0x3af99d=0xc8;}else{_0x3af99d=0xce;}_0x1c3b26['status'](_0x3af99d);return _0x1c3b26['set'](_0x9a6a('0x30'),_0x4da200+'-'+_0x5b7be2+'/'+_0x4abf09)[_0x9a6a('0x2b')](_0xf2d509);}return null;};}function patchUpdates(_0x3891f3){return function(_0x481a69){try{jsonpatch['apply'](_0x481a69,_0x3891f3,!![]);}catch(_0x415158){return BPromise[_0x9a6a('0x31')](_0x415158);}return _0x481a69[_0x9a6a('0x32')]();};}function saveUpdates(_0x4a30d5,_0x3df6f6){return function(_0x31090b){if(_0x31090b){return _0x31090b[_0x9a6a('0x33')](_0x4a30d5)[_0x9a6a('0x1d')](function(_0x3d5813){return _0x3d5813;});}return null;};}function removeEntity(_0x2fcdac,_0x5d8a69){return function(_0x2a6ace){if(_0x2a6ace){return _0x2a6ace[_0x9a6a('0x34')]()['then'](function(){_0x2fcdac[_0x9a6a('0x29')](0xcc)[_0x9a6a('0x2a')]();});}};}function handleEntityNotFound(_0x308e40,_0xee0502){return function(_0x152912){if(!_0x152912){_0x308e40[_0x9a6a('0x28')](0x194);}return _0x152912;};}function handleError(_0x16a965,_0x2b2e59){_0x2b2e59=_0x2b2e59||0x1f4;return function(_0x4bbe05){logger['error'](_0x4bbe05[_0x9a6a('0x35')]);if(_0x4bbe05[_0x9a6a('0x36')]){delete _0x4bbe05[_0x9a6a('0x36')];}_0x16a965[_0x9a6a('0x29')](_0x2b2e59)[_0x9a6a('0x37')](_0x4bbe05);};}exports['index']=function(_0x5f1c84,_0x4d7e16){var _0x233ead={},_0x390682={},_0x705ec3={'count':0x0,'rows':[]};var _0x48a746=_['map'](db[_0x9a6a('0x38')][_0x9a6a('0x39')],function(_0x420ea8){return{'name':_0x420ea8[_0x9a6a('0x3a')],'type':_0x420ea8['type']['key']};});_0x390682['model']=_[_0x9a6a('0x3b')](_0x48a746,'name');_0x390682[_0x9a6a('0x3c')]=_[_0x9a6a('0x3d')](_0x5f1c84[_0x9a6a('0x3c')]);_0x390682[_0x9a6a('0x3e')]=_[_0x9a6a('0x3f')](_0x390682[_0x9a6a('0x40')],_0x390682[_0x9a6a('0x3c')]);_0x233ead[_0x9a6a('0x41')]=_[_0x9a6a('0x3f')](_0x390682[_0x9a6a('0x40')],qs[_0x9a6a('0x42')](_0x5f1c84['query'][_0x9a6a('0x42')]));_0x233ead[_0x9a6a('0x41')]=_0x233ead[_0x9a6a('0x41')][_0x9a6a('0x43')]?_0x233ead['attributes']:_0x390682[_0x9a6a('0x40')];if(!_0x5f1c84['query']['hasOwnProperty']('nolimit')){_0x233ead[_0x9a6a('0x2e')]=qs[_0x9a6a('0x2e')](_0x5f1c84[_0x9a6a('0x3c')][_0x9a6a('0x2e')]);_0x233ead[_0x9a6a('0x2c')]=qs[_0x9a6a('0x2c')](_0x5f1c84[_0x9a6a('0x3c')][_0x9a6a('0x2c')]);}_0x233ead[_0x9a6a('0x44')]=qs[_0x9a6a('0x45')](_0x5f1c84['query'][_0x9a6a('0x45')]);_0x233ead['where']=qs[_0x9a6a('0x3e')](_[_0x9a6a('0x46')](_0x5f1c84[_0x9a6a('0x3c')],_0x390682[_0x9a6a('0x3e')]),_0x48a746);if(_0x5f1c84[_0x9a6a('0x3c')][_0x9a6a('0x47')]){_0x233ead[_0x9a6a('0x48')]=_[_0x9a6a('0x49')](_0x233ead[_0x9a6a('0x48')],{'$or':_[_0x9a6a('0x3b')](_0x48a746,function(_0xd3dd18){if(_0xd3dd18[_0x9a6a('0x4a')]!==_0x9a6a('0x4b')){var _0x57dcab={};_0x57dcab[_0xd3dd18['name']]={'$like':'%'+_0x5f1c84['query'][_0x9a6a('0x47')]+'%'};return _0x57dcab;}})});}_0x233ead=_[_0x9a6a('0x49')]({},_0x233ead,_0x5f1c84[_0x9a6a('0x4c')]);var _0x38e5d7={'where':_0x233ead[_0x9a6a('0x48')]};return db[_0x9a6a('0x38')][_0x9a6a('0x2f')](_0x38e5d7)[_0x9a6a('0x1d')](function(_0x1a01ac){_0x705ec3[_0x9a6a('0x2f')]=_0x1a01ac;if(_0x5f1c84[_0x9a6a('0x3c')][_0x9a6a('0x4d')]){_0x233ead[_0x9a6a('0x4e')]=[{'all':!![]}];}return db[_0x9a6a('0x38')][_0x9a6a('0x4f')](_0x233ead);})[_0x9a6a('0x1d')](function(_0x292ca9){_0x705ec3[_0x9a6a('0x50')]=_0x292ca9;return _0x705ec3;})[_0x9a6a('0x1d')](respondWithFilteredResult(_0x4d7e16,_0x233ead))[_0x9a6a('0x27')](handleError(_0x4d7e16,null));};exports[_0x9a6a('0x51')]=function(_0x99f7fc,_0x116dd8){var _0x7d00cd={'raw':!![],'where':{'id':_0x99f7fc[_0x9a6a('0x52')]['id']}},_0x51d90c={};_0x51d90c[_0x9a6a('0x40')]=_['keys'](db[_0x9a6a('0x38')][_0x9a6a('0x39')]);_0x51d90c['query']=_[_0x9a6a('0x3d')](_0x99f7fc['query']);_0x51d90c[_0x9a6a('0x3e')]=_[_0x9a6a('0x3f')](_0x51d90c[_0x9a6a('0x40')],_0x51d90c['query']);_0x7d00cd[_0x9a6a('0x41')]=_[_0x9a6a('0x3f')](_0x51d90c[_0x9a6a('0x40')],qs[_0x9a6a('0x42')](_0x99f7fc[_0x9a6a('0x3c')][_0x9a6a('0x42')]));_0x7d00cd['attributes']=_0x7d00cd[_0x9a6a('0x41')][_0x9a6a('0x43')]?_0x7d00cd[_0x9a6a('0x41')]:_0x51d90c[_0x9a6a('0x40')];if(_0x99f7fc[_0x9a6a('0x3c')][_0x9a6a('0x4d')]){_0x7d00cd[_0x9a6a('0x4e')]=[{'all':!![]}];}_0x7d00cd=_[_0x9a6a('0x49')]({},_0x7d00cd,_0x99f7fc[_0x9a6a('0x4c')]);return db[_0x9a6a('0x38')][_0x9a6a('0x53')](_0x7d00cd)[_0x9a6a('0x1d')](handleEntityNotFound(_0x116dd8,null))[_0x9a6a('0x1d')](respondWithResult(_0x116dd8,null))[_0x9a6a('0x27')](handleError(_0x116dd8,null));};exports[_0x9a6a('0x54')]=function(_0x222037,_0x36b62f,_0x5cfc8a){var _0x34ea31;return db[_0x9a6a('0x55')][_0x9a6a('0x56')](function(_0x2397e8){return db[_0x9a6a('0x38')][_0x9a6a('0x54')](_0x222037[_0x9a6a('0x57')],{'raw':!![]})[_0x9a6a('0x1d')](function(_0x11961a){_0x34ea31=_0x11961a;return db['Network'][_0x9a6a('0x4f')]({'where':{'type':_0x222037[_0x9a6a('0x57')][_0x9a6a('0x4a')]},'raw':!![]});})['then'](function(_0x38a8b0){if(_0x34ea31[_0x9a6a('0x4a')][_0x9a6a('0x58')]()==_0x9a6a('0x59')){var _0x1b3579=fs['readFileSync'](path[_0x9a6a('0x5a')](config[_0x9a6a('0x5b')],_0x9a6a('0x5c')),_0x9a6a('0x5d'));var _0x314af3=ejs[_0x9a6a('0x5e')](_0x1b3579,{'networks':_0x38a8b0||[]});fs[_0x9a6a('0x5f')](_0x9a6a('0x60'),_0x314af3);return respondWithRpcPromise(_0x9a6a('0x61'),_0x9a6a('0x54'),{'module':'res_stun_monitor.so'});}else if(_0x34ea31[_0x9a6a('0x4a')][_0x9a6a('0x58')]()==_0x9a6a('0x62')){var _0x6a136d=fs[_0x9a6a('0x63')](path[_0x9a6a('0x5a')](config[_0x9a6a('0x5b')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x346269=ejs[_0x9a6a('0x5e')](_0x6a136d,{'networks':_0x38a8b0||[]});fs[_0x9a6a('0x5f')](_0x9a6a('0x64'),_0x346269);return respondWithRpcPromise(_0x9a6a('0x61'),_0x9a6a('0x54'),{'module':_0x9a6a('0x65')});}else{var _0x3164a5=fs[_0x9a6a('0x63')](path[_0x9a6a('0x5a')](config[_0x9a6a('0x5b')],'server/files/templates/network.ejs'),_0x9a6a('0x5d'));var _0x1e1338=ejs[_0x9a6a('0x5e')](_0x3164a5,{'networks':_0x38a8b0||[]});fs[_0x9a6a('0x5f')](util['format'](_0x9a6a('0x66'),_0x222037['body']['type']['toLowerCase']()),_0x1e1338);return respondWithRpcPromise('Reload',_0x9a6a('0x54'),{'module':_0x9a6a('0x67')});}return null;})[_0x9a6a('0x1d')](function(){return _0x34ea31;});})[_0x9a6a('0x1d')](respondWithResult(_0x36b62f,0xc9))[_0x9a6a('0x27')](handleError(_0x36b62f,null));};exports[_0x9a6a('0x33')]=function(_0x96504,_0x36271a,_0x113cd9){var _0x38b5b1;return db[_0x9a6a('0x55')][_0x9a6a('0x56')](function(_0x1e7eaf){return db['Network'][_0x9a6a('0x53')]({'where':{'id':_0x96504['params']['id']}})[_0x9a6a('0x1d')](handleEntityNotFound(_0x36271a,null))['then'](saveUpdates(_0x96504[_0x9a6a('0x57')],null))[_0x9a6a('0x1d')](function(_0xd00fb5){if(_0xd00fb5){_0x38b5b1=_0xd00fb5;return db[_0x9a6a('0x38')]['findAll']({'where':{'type':_0x38b5b1[_0x9a6a('0x4a')]},'raw':!![]});}return null;})[_0x9a6a('0x1d')](function(_0xe88010){if(_0x38b5b1['type'][_0x9a6a('0x58')]()==_0x9a6a('0x59')){var _0x2d25c7=fs[_0x9a6a('0x63')](path[_0x9a6a('0x5a')](config['root'],'server/files/templates/stun_multiple.ejs'),_0x9a6a('0x5d'));var _0x2e2e4b=ejs['render'](_0x2d25c7,{'networks':_0xe88010||[]});fs[_0x9a6a('0x5f')](_0x9a6a('0x60'),_0x2e2e4b);return respondWithRpcPromise(_0x9a6a('0x61'),_0x9a6a('0x33'),{'module':_0x9a6a('0x65')});}else if(_0x38b5b1[_0x9a6a('0x4a')][_0x9a6a('0x58')]()==_0x9a6a('0x62')){var _0x3519ac=fs[_0x9a6a('0x63')](path[_0x9a6a('0x5a')](config['root'],_0x9a6a('0x68')),_0x9a6a('0x5d'));var _0x348117=ejs['render'](_0x3519ac,{'networks':_0xe88010||[]});fs[_0x9a6a('0x5f')](_0x9a6a('0x64'),_0x348117);return respondWithRpcPromise('Reload','update',{'module':_0x9a6a('0x65')});}else{var _0x3d88d3=fs[_0x9a6a('0x63')](path['join'](config[_0x9a6a('0x5b')],_0x9a6a('0x69')),'utf8');var _0x3afd6e=ejs[_0x9a6a('0x5e')](_0x3d88d3,{'networks':_0xe88010||[]});fs[_0x9a6a('0x5f')](util[_0x9a6a('0x6a')]('/etc/asterisk/sip_xcally_%s.conf',_0x96504[_0x9a6a('0x57')][_0x9a6a('0x4a')]['toLowerCase']()),_0x3afd6e);return respondWithRpcPromise(_0x9a6a('0x61'),_0x9a6a('0x33'),{'module':_0x9a6a('0x67')});}return null;})[_0x9a6a('0x1d')](function(_0x47a8e0){if(_0x47a8e0){return _0x38b5b1;}return null;});})['then'](respondWithResult(_0x36271a,null))[_0x9a6a('0x27')](handleError(_0x36271a,null));};exports[_0x9a6a('0x34')]=function(_0x57ba0a,_0x30ab3f,_0x45391d){var _0x28f933;return db[_0x9a6a('0x38')]['find']({'where':{'id':_0x57ba0a[_0x9a6a('0x52')]['id']}})['then'](function(_0x3490f4){_0x28f933=_0x3490f4;return _0x3490f4;})[_0x9a6a('0x1d')](handleEntityNotFound(_0x30ab3f,null))[_0x9a6a('0x1d')](removeEntity(_0x30ab3f,null))['then'](function(){if(_0x28f933){return db[_0x9a6a('0x38')][_0x9a6a('0x4f')]({'where':{'type':_0x28f933['type']},'raw':!![]});}})[_0x9a6a('0x1d')](function(_0xd83fb3){if(_0x28f933[_0x9a6a('0x4a')][_0x9a6a('0x58')]()==_0x9a6a('0x59')){var _0x4d1ffa=fs[_0x9a6a('0x63')](path[_0x9a6a('0x5a')](config[_0x9a6a('0x5b')],_0x9a6a('0x5c')),_0x9a6a('0x5d'));var _0x1b2ca3=ejs['render'](_0x4d1ffa,{'networks':_0xd83fb3||[]});fs[_0x9a6a('0x5f')](_0x9a6a('0x60'),_0x1b2ca3);return respondWithRpcPromise(_0x9a6a('0x61'),_0x9a6a('0x34'),{'module':_0x9a6a('0x65')});}else if(_0x28f933['type'][_0x9a6a('0x58')]()==_0x9a6a('0x62')){var _0x48f564=fs[_0x9a6a('0x63')](path[_0x9a6a('0x5a')](config[_0x9a6a('0x5b')],_0x9a6a('0x68')),'utf8');var _0x2b0717=ejs['render'](_0x48f564,{'networks':_0xd83fb3||[]});fs[_0x9a6a('0x5f')](_0x9a6a('0x64'),_0x2b0717);return respondWithRpcPromise('Reload',_0x9a6a('0x34'),{'module':_0x9a6a('0x65')});}else{var _0x8ef2e2=fs[_0x9a6a('0x63')](path[_0x9a6a('0x5a')](config[_0x9a6a('0x5b')],_0x9a6a('0x69')),_0x9a6a('0x5d'));var _0x3283e3=ejs['render'](_0x8ef2e2,{'networks':_0xd83fb3||[]});fs[_0x9a6a('0x5f')](util['format'](_0x9a6a('0x66'),_0x57ba0a[_0x9a6a('0x57')][_0x9a6a('0x4a')]['toLowerCase']()),_0x3283e3);return respondWithRpcPromise('Reload',_0x9a6a('0x34'),{'module':_0x9a6a('0x67')});}return null;})[_0x9a6a('0x27')](handleError(_0x30ab3f,null));};
\ No newline at end of file
+var _0x6f5a=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','keys','rawAttributes','options','find','create','transaction','body','toUpperCase','STUN','readFileSync','join','render','res_stun_monitor.so','root','server/files/templates/turn_multiple.ejs','utf8','writeFileSync','/etc/asterisk/turn_xcally.conf','Reload','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','params','server/files/templates/stun_multiple.ejs','/etc/asterisk/stun_xcally.conf','chan_sip.so','TURN','toLowerCase','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','message','Network,\x20%s,\x20%s','result','catch','status','end','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','sendStatus','stack','name','send','map','Network','model','query','intersection'];(function(_0x45b57a,_0x550aec){var _0x2dee78=function(_0x29aaf1){while(--_0x29aaf1){_0x45b57a['push'](_0x45b57a['shift']());}};_0x2dee78(++_0x550aec);}(_0x6f5a,0x1cb));var _0xa6f5=function(_0x3cba2a,_0x2ea756){_0x3cba2a=_0x3cba2a-0x0;var _0x1fb136=_0x6f5a[_0x3cba2a];return _0x1fb136;};'use strict';var emlformat=require(_0xa6f5('0x0'));var rimraf=require(_0xa6f5('0x1'));var zipdir=require(_0xa6f5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa6f5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa6f5('0x4'));var util=require(_0xa6f5('0x5'));var path=require(_0xa6f5('0x6'));var sox=require(_0xa6f5('0x7'));var csv=require(_0xa6f5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa6f5('0x9'));var _=require(_0xa6f5('0xa'));var squel=require('squel');var crypto=require(_0xa6f5('0xb'));var jsforce=require(_0xa6f5('0xc'));var deskjs=require(_0xa6f5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa6f5('0xe'));var Redis=require(_0xa6f5('0xf'));var authService=require(_0xa6f5('0x10'));var qs=require(_0xa6f5('0x11'));var as=require(_0xa6f5('0x12'));var hardwareService=require(_0xa6f5('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xa6f5('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa6f5('0x15'))['db'];var jayson=require(_0xa6f5('0x16'));var client=jayson[_0xa6f5('0x17')][_0xa6f5('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x6a4bdb,_0x42dea4,_0x4a86af,_0x20f59a){return new BPromise(function(_0x41b738,_0xee30ad){var _0xe7445=_0x20f59a||client;return _0xe7445[_0xa6f5('0x19')](_0x6a4bdb,_0x4a86af)[_0xa6f5('0x1a')](function(_0x39c2e5){logger[_0xa6f5('0x1b')]('Network,\x20%s,\x20%s',_0x42dea4,_0xa6f5('0x1c'));logger[_0xa6f5('0x1d')]('Network,\x20%s,\x20%s,\x20%s',_0x42dea4,_0xa6f5('0x1c'),JSON[_0xa6f5('0x1e')](_0x39c2e5));if(_0x39c2e5[_0xa6f5('0x1f')]){if(_0x39c2e5[_0xa6f5('0x1f')]['code']===0x1f4){logger['error']('Network,\x20%s,\x20%s',_0x42dea4,_0x39c2e5[_0xa6f5('0x1f')][_0xa6f5('0x20')]);return _0xee30ad(_0x39c2e5[_0xa6f5('0x1f')][_0xa6f5('0x20')]);}logger['error']('Network,\x20%s,\x20%s',_0x42dea4,_0x39c2e5[_0xa6f5('0x1f')][_0xa6f5('0x20')]);return _0x41b738(_0x39c2e5[_0xa6f5('0x1f')][_0xa6f5('0x20')]);}else{logger[_0xa6f5('0x1b')](_0xa6f5('0x21'),_0x42dea4,_0xa6f5('0x1c'));_0x41b738(_0x39c2e5[_0xa6f5('0x22')]['message']);}})[_0xa6f5('0x23')](function(_0x31d54b){logger['error']('Network,\x20%s,\x20%s',_0x42dea4,_0x31d54b);_0xee30ad(_0x31d54b);});});}function respondWithStatusCode(_0x483309,_0x5f4bdb){_0x5f4bdb=_0x5f4bdb||0xcc;return function(_0x16f3f3){if(_0x16f3f3){return _0x483309['sendStatus'](_0x5f4bdb);}return _0x483309[_0xa6f5('0x24')](_0x5f4bdb)[_0xa6f5('0x25')]();};}function respondWithResult(_0x2e8ac2,_0x20b2b1){_0x20b2b1=_0x20b2b1||0xc8;return function(_0x3d9832){if(_0x3d9832){return _0x2e8ac2[_0xa6f5('0x24')](_0x20b2b1)['json'](_0x3d9832);}};}function respondWithFilteredResult(_0x153d0f,_0x36ca86){return function(_0xc7552c){if(_0xc7552c){var _0x1133e9=typeof _0x36ca86[_0xa6f5('0x26')]===_0xa6f5('0x27')&&typeof _0x36ca86[_0xa6f5('0x28')]===_0xa6f5('0x27');var _0x24816e=_0xc7552c['count'];var _0x3bc21e=_0x1133e9?0x0:_0x36ca86['offset'];var _0x232ddb=_0x1133e9?_0xc7552c[_0xa6f5('0x29')]:_0x36ca86[_0xa6f5('0x26')]+_0x36ca86[_0xa6f5('0x28')];var _0x105f13;if(_0x232ddb>=_0x24816e){_0x232ddb=_0x24816e;_0x105f13=0xc8;}else{_0x105f13=0xce;}_0x153d0f[_0xa6f5('0x24')](_0x105f13);return _0x153d0f[_0xa6f5('0x2a')](_0xa6f5('0x2b'),_0x3bc21e+'-'+_0x232ddb+'/'+_0x24816e)['json'](_0xc7552c);}return null;};}function patchUpdates(_0x571d48){return function(_0x418b6a){try{jsonpatch[_0xa6f5('0x2c')](_0x418b6a,_0x571d48,!![]);}catch(_0x31e794){return BPromise['reject'](_0x31e794);}return _0x418b6a['save']();};}function saveUpdates(_0x27970e,_0x87de7d){return function(_0x43b45b){if(_0x43b45b){return _0x43b45b[_0xa6f5('0x2d')](_0x27970e)[_0xa6f5('0x1a')](function(_0x3c577d){return _0x3c577d;});}return null;};}function removeEntity(_0x443e3c,_0x4bfbcf){return function(_0x5a613b){if(_0x5a613b){return _0x5a613b[_0xa6f5('0x2e')]()[_0xa6f5('0x1a')](function(){_0x443e3c[_0xa6f5('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x323c08,_0x489b08){return function(_0x136313){if(!_0x136313){_0x323c08[_0xa6f5('0x2f')](0x194);}return _0x136313;};}function handleError(_0x4440fb,_0x2199f2){_0x2199f2=_0x2199f2||0x1f4;return function(_0x51b7ea){logger[_0xa6f5('0x1f')](_0x51b7ea[_0xa6f5('0x30')]);if(_0x51b7ea[_0xa6f5('0x31')]){delete _0x51b7ea['name'];}_0x4440fb[_0xa6f5('0x24')](_0x2199f2)[_0xa6f5('0x32')](_0x51b7ea);};}exports['index']=function(_0x325bb2,_0x1541e9){var _0xb7180b={},_0x4e7a34={},_0x4758d5={'count':0x0,'rows':[]};var _0xd4a2b6=_[_0xa6f5('0x33')](db[_0xa6f5('0x34')]['rawAttributes'],function(_0x10c656){return{'name':_0x10c656['fieldName'],'type':_0x10c656['type']['key']};});_0x4e7a34[_0xa6f5('0x35')]=_[_0xa6f5('0x33')](_0xd4a2b6,_0xa6f5('0x31'));_0x4e7a34[_0xa6f5('0x36')]=_['keys'](_0x325bb2[_0xa6f5('0x36')]);_0x4e7a34['filters']=_[_0xa6f5('0x37')](_0x4e7a34[_0xa6f5('0x35')],_0x4e7a34[_0xa6f5('0x36')]);_0xb7180b[_0xa6f5('0x38')]=_['intersection'](_0x4e7a34['model'],qs['fields'](_0x325bb2[_0xa6f5('0x36')][_0xa6f5('0x39')]));_0xb7180b[_0xa6f5('0x38')]=_0xb7180b[_0xa6f5('0x38')][_0xa6f5('0x3a')]?_0xb7180b[_0xa6f5('0x38')]:_0x4e7a34[_0xa6f5('0x35')];if(!_0x325bb2['query'][_0xa6f5('0x3b')](_0xa6f5('0x3c'))){_0xb7180b[_0xa6f5('0x28')]=qs[_0xa6f5('0x28')](_0x325bb2[_0xa6f5('0x36')][_0xa6f5('0x28')]);_0xb7180b[_0xa6f5('0x26')]=qs[_0xa6f5('0x26')](_0x325bb2[_0xa6f5('0x36')][_0xa6f5('0x26')]);}_0xb7180b[_0xa6f5('0x3d')]=qs[_0xa6f5('0x3e')](_0x325bb2[_0xa6f5('0x36')][_0xa6f5('0x3e')]);_0xb7180b[_0xa6f5('0x3f')]=qs[_0xa6f5('0x40')](_[_0xa6f5('0x41')](_0x325bb2[_0xa6f5('0x36')],_0x4e7a34[_0xa6f5('0x40')]),_0xd4a2b6);if(_0x325bb2[_0xa6f5('0x36')][_0xa6f5('0x42')]){_0xb7180b[_0xa6f5('0x3f')]=_[_0xa6f5('0x43')](_0xb7180b[_0xa6f5('0x3f')],{'$or':_[_0xa6f5('0x33')](_0xd4a2b6,function(_0x2c30c5){if(_0x2c30c5[_0xa6f5('0x44')]!==_0xa6f5('0x45')){var _0x17f700={};_0x17f700[_0x2c30c5[_0xa6f5('0x31')]]={'$like':'%'+_0x325bb2[_0xa6f5('0x36')][_0xa6f5('0x42')]+'%'};return _0x17f700;}})});}_0xb7180b=_[_0xa6f5('0x43')]({},_0xb7180b,_0x325bb2['options']);var _0x36afee={'where':_0xb7180b[_0xa6f5('0x3f')]};return db[_0xa6f5('0x34')][_0xa6f5('0x29')](_0x36afee)[_0xa6f5('0x1a')](function(_0x4662a5){_0x4758d5[_0xa6f5('0x29')]=_0x4662a5;if(_0x325bb2[_0xa6f5('0x36')][_0xa6f5('0x46')]){_0xb7180b[_0xa6f5('0x47')]=[{'all':!![]}];}return db[_0xa6f5('0x34')][_0xa6f5('0x48')](_0xb7180b);})[_0xa6f5('0x1a')](function(_0x29e847){_0x4758d5[_0xa6f5('0x49')]=_0x29e847;return _0x4758d5;})[_0xa6f5('0x1a')](respondWithFilteredResult(_0x1541e9,_0xb7180b))[_0xa6f5('0x23')](handleError(_0x1541e9,null));};exports[_0xa6f5('0x4a')]=function(_0x3d0814,_0x4ebd96){var _0x294990={'raw':!![],'where':{'id':_0x3d0814['params']['id']}},_0x29c9ba={};_0x29c9ba[_0xa6f5('0x35')]=_[_0xa6f5('0x4b')](db[_0xa6f5('0x34')][_0xa6f5('0x4c')]);_0x29c9ba[_0xa6f5('0x36')]=_['keys'](_0x3d0814[_0xa6f5('0x36')]);_0x29c9ba[_0xa6f5('0x40')]=_[_0xa6f5('0x37')](_0x29c9ba['model'],_0x29c9ba['query']);_0x294990[_0xa6f5('0x38')]=_[_0xa6f5('0x37')](_0x29c9ba[_0xa6f5('0x35')],qs['fields'](_0x3d0814[_0xa6f5('0x36')]['fields']));_0x294990[_0xa6f5('0x38')]=_0x294990['attributes'][_0xa6f5('0x3a')]?_0x294990['attributes']:_0x29c9ba[_0xa6f5('0x35')];if(_0x3d0814['query'][_0xa6f5('0x46')]){_0x294990[_0xa6f5('0x47')]=[{'all':!![]}];}_0x294990=_[_0xa6f5('0x43')]({},_0x294990,_0x3d0814[_0xa6f5('0x4d')]);return db[_0xa6f5('0x34')][_0xa6f5('0x4e')](_0x294990)[_0xa6f5('0x1a')](handleEntityNotFound(_0x4ebd96,null))[_0xa6f5('0x1a')](respondWithResult(_0x4ebd96,null))['catch'](handleError(_0x4ebd96,null));};exports[_0xa6f5('0x4f')]=function(_0x5ba67c,_0x19b63e,_0x1fa707){var _0x14ef05;return db['sequelize'][_0xa6f5('0x50')](function(_0x24c018){return db[_0xa6f5('0x34')][_0xa6f5('0x4f')](_0x5ba67c['body'],{'raw':!![]})[_0xa6f5('0x1a')](function(_0x5e6ac5){_0x14ef05=_0x5e6ac5;return db[_0xa6f5('0x34')][_0xa6f5('0x48')]({'where':{'type':_0x5ba67c[_0xa6f5('0x51')]['type']},'raw':!![]});})[_0xa6f5('0x1a')](function(_0x3ae87d){if(_0x14ef05['type'][_0xa6f5('0x52')]()==_0xa6f5('0x53')){var _0xd2becb=fs[_0xa6f5('0x54')](path[_0xa6f5('0x55')](config['root'],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x4b91e3=ejs[_0xa6f5('0x56')](_0xd2becb,{'networks':_0x3ae87d||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x4b91e3);return respondWithRpcPromise('Reload','create',{'module':_0xa6f5('0x57')});}else if(_0x14ef05['type']['toUpperCase']()=='TURN'){var _0x302f8c=fs[_0xa6f5('0x54')](path[_0xa6f5('0x55')](config[_0xa6f5('0x58')],_0xa6f5('0x59')),_0xa6f5('0x5a'));var _0x58644e=ejs['render'](_0x302f8c,{'networks':_0x3ae87d||[]});fs[_0xa6f5('0x5b')](_0xa6f5('0x5c'),_0x58644e);return respondWithRpcPromise(_0xa6f5('0x5d'),'create',{'module':_0xa6f5('0x57')});}else{var _0x4cc0be=fs['readFileSync'](path[_0xa6f5('0x55')](config[_0xa6f5('0x58')],_0xa6f5('0x5e')),_0xa6f5('0x5a'));var _0x15f947=ejs[_0xa6f5('0x56')](_0x4cc0be,{'networks':_0x3ae87d||[]});fs['writeFileSync'](util[_0xa6f5('0x5f')](_0xa6f5('0x60'),_0x5ba67c[_0xa6f5('0x51')][_0xa6f5('0x44')]['toLowerCase']()),_0x15f947);return respondWithRpcPromise('Reload',_0xa6f5('0x4f'),{'module':'chan_sip.so'});}return null;})[_0xa6f5('0x1a')](function(){return _0x14ef05;});})['then'](respondWithResult(_0x19b63e,0xc9))[_0xa6f5('0x23')](handleError(_0x19b63e,null));};exports[_0xa6f5('0x2d')]=function(_0x4fd7fe,_0x35b0a6,_0x509d5d){var _0x197aad;return db['sequelize']['transaction'](function(_0x1fdd2f){return db[_0xa6f5('0x34')]['find']({'where':{'id':_0x4fd7fe[_0xa6f5('0x61')]['id']}})[_0xa6f5('0x1a')](handleEntityNotFound(_0x35b0a6,null))[_0xa6f5('0x1a')](saveUpdates(_0x4fd7fe[_0xa6f5('0x51')],null))[_0xa6f5('0x1a')](function(_0x149a4c){if(_0x149a4c){_0x197aad=_0x149a4c;return db['Network']['findAll']({'where':{'type':_0x197aad[_0xa6f5('0x44')]},'raw':!![]});}return null;})[_0xa6f5('0x1a')](function(_0x5bcb2d){if(_0x197aad[_0xa6f5('0x44')][_0xa6f5('0x52')]()==_0xa6f5('0x53')){var _0x857a7f=fs['readFileSync'](path[_0xa6f5('0x55')](config['root'],_0xa6f5('0x62')),'utf8');var _0x31c4ac=ejs[_0xa6f5('0x56')](_0x857a7f,{'networks':_0x5bcb2d||[]});fs[_0xa6f5('0x5b')](_0xa6f5('0x63'),_0x31c4ac);return respondWithRpcPromise(_0xa6f5('0x5d'),_0xa6f5('0x2d'),{'module':_0xa6f5('0x57')});}else if(_0x197aad[_0xa6f5('0x44')][_0xa6f5('0x52')]()=='TURN'){var _0x13af4c=fs[_0xa6f5('0x54')](path[_0xa6f5('0x55')](config['root'],_0xa6f5('0x59')),_0xa6f5('0x5a'));var _0x45a481=ejs[_0xa6f5('0x56')](_0x13af4c,{'networks':_0x5bcb2d||[]});fs[_0xa6f5('0x5b')](_0xa6f5('0x5c'),_0x45a481);return respondWithRpcPromise('Reload',_0xa6f5('0x2d'),{'module':_0xa6f5('0x57')});}else{var _0x564abf=fs[_0xa6f5('0x54')](path[_0xa6f5('0x55')](config[_0xa6f5('0x58')],_0xa6f5('0x5e')),_0xa6f5('0x5a'));var _0x4c6776=ejs[_0xa6f5('0x56')](_0x564abf,{'networks':_0x5bcb2d||[]});fs[_0xa6f5('0x5b')](util[_0xa6f5('0x5f')](_0xa6f5('0x60'),_0x4fd7fe['body'][_0xa6f5('0x44')]['toLowerCase']()),_0x4c6776);return respondWithRpcPromise(_0xa6f5('0x5d'),'update',{'module':_0xa6f5('0x64')});}return null;})[_0xa6f5('0x1a')](function(_0x449f9f){if(_0x449f9f){return _0x197aad;}return null;});})['then'](respondWithResult(_0x35b0a6,null))[_0xa6f5('0x23')](handleError(_0x35b0a6,null));};exports[_0xa6f5('0x2e')]=function(_0x181de2,_0x48b943,_0x4916e0){var _0x1d4d13;return db['Network'][_0xa6f5('0x4e')]({'where':{'id':_0x181de2['params']['id']}})['then'](function(_0x1ada06){_0x1d4d13=_0x1ada06;return _0x1ada06;})[_0xa6f5('0x1a')](handleEntityNotFound(_0x48b943,null))[_0xa6f5('0x1a')](removeEntity(_0x48b943,null))[_0xa6f5('0x1a')](function(){if(_0x1d4d13){return db[_0xa6f5('0x34')][_0xa6f5('0x48')]({'where':{'type':_0x1d4d13[_0xa6f5('0x44')]},'raw':!![]});}})[_0xa6f5('0x1a')](function(_0x3060b9){if(_0x1d4d13[_0xa6f5('0x44')][_0xa6f5('0x52')]()=='STUN'){var _0x673c1d=fs[_0xa6f5('0x54')](path[_0xa6f5('0x55')](config[_0xa6f5('0x58')],_0xa6f5('0x62')),'utf8');var _0x1bc57e=ejs[_0xa6f5('0x56')](_0x673c1d,{'networks':_0x3060b9||[]});fs['writeFileSync'](_0xa6f5('0x63'),_0x1bc57e);return respondWithRpcPromise('Reload',_0xa6f5('0x2e'),{'module':'res_stun_monitor.so'});}else if(_0x1d4d13[_0xa6f5('0x44')][_0xa6f5('0x52')]()==_0xa6f5('0x65')){var _0x1352a1=fs[_0xa6f5('0x54')](path[_0xa6f5('0x55')](config[_0xa6f5('0x58')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x4cb470=ejs[_0xa6f5('0x56')](_0x1352a1,{'networks':_0x3060b9||[]});fs['writeFileSync'](_0xa6f5('0x5c'),_0x4cb470);return respondWithRpcPromise(_0xa6f5('0x5d'),_0xa6f5('0x2e'),{'module':_0xa6f5('0x57')});}else{var _0x29a2e7=fs[_0xa6f5('0x54')](path[_0xa6f5('0x55')](config[_0xa6f5('0x58')],_0xa6f5('0x5e')),_0xa6f5('0x5a'));var _0x419868=ejs['render'](_0x29a2e7,{'networks':_0x3060b9||[]});fs[_0xa6f5('0x5b')](util[_0xa6f5('0x5f')](_0xa6f5('0x60'),_0x181de2[_0xa6f5('0x51')][_0xa6f5('0x44')][_0xa6f5('0x66')]()),_0x419868);return respondWithRpcPromise(_0xa6f5('0x5d'),'destroy',{'module':_0xa6f5('0x64')});}return null;})[_0xa6f5('0x23')](handleError(_0x48b943,null));};
\ No newline at end of file
index 580d06f..603967d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa0bc=['request-promise','path','rimraf','../../config/environment','./network.attributes','exports','define','Network','network','util','../../config/logger','moment','bluebird'];(function(_0x5d8db8,_0x50d021){var _0x226fd6=function(_0x3c1b93){while(--_0x3c1b93){_0x5d8db8['push'](_0x5d8db8['shift']());}};_0x226fd6(++_0x50d021);}(_0xa0bc,0x1b6));var _0xca0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0bc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xca0b('0x0'));var logger=require(_0xca0b('0x1'))('api');var moment=require(_0xca0b('0x2'));var BPromise=require(_0xca0b('0x3'));var rp=require(_0xca0b('0x4'));var fs=require('fs');var path=require(_0xca0b('0x5'));var rimraf=require(_0xca0b('0x6'));var config=require(_0xca0b('0x7'));var attributes=require(_0xca0b('0x8'));module[_0xca0b('0x9')]=function(_0x3cb084,_0x1aac00){return _0x3cb084[_0xca0b('0xa')](_0xca0b('0xb'),attributes,{'tableName':_0xca0b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x54f3=['api','moment','bluebird','rimraf','../../config/environment','./network.attributes','Network','network','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x54f3,0x120));var _0x354f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x54f3[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x354f('0x0'));var logger=require(_0x354f('0x1'))(_0x354f('0x2'));var moment=require(_0x354f('0x3'));var BPromise=require(_0x354f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x354f('0x5'));var config=require(_0x354f('0x6'));var attributes=require(_0x354f('0x7'));module['exports']=function(_0x5618ac,_0x234ac6){return _0x5618ac['define'](_0x354f('0x8'),attributes,{'tableName':_0x354f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 651db1c..0f69e0e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0x58591a,_0x22ac5c){_0x58591a=_0x58591a-0x0;var _0x38b91e=_0x7a54[_0x58591a];return _0x38b91e;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
+var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0x46c284,_0x350a66){_0x46c284=_0x46c284-0x0;var _0x174bc7=_0x7a54[_0x46c284];return _0x174bc7;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
index 5526613..7c9b16e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bc0=['/:id/canned_answers','getAnswers','getApplications','getInteractions','/:id/users','getAgents','post','create','addAnswer','/:id/notify','/:id/applications','addApplications','addAgents','/:id/send','send','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','show','/:id/dispositions','getDispositions'];(function(_0x57bf42,_0x47b2d6){var _0x2b2ccc=function(_0xf75d1f){while(--_0xf75d1f){_0x57bf42['push'](_0x57bf42['shift']());}};_0x2b2ccc(++_0x47b2d6);}(_0x2bc0,0x1c5));var _0x02bc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2bc0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x02bc('0x0'));var util=require('util');var path=require(_0x02bc('0x1'));var timeout=require(_0x02bc('0x2'));var express=require(_0x02bc('0x3'));var router=express[_0x02bc('0x4')]();var fs_extra=require(_0x02bc('0x5'));var auth=require(_0x02bc('0x6'));var interaction=require(_0x02bc('0x7'));var config=require('../../config/environment');var controller=require('./openchannelAccount.controller');router['get']('/',auth[_0x02bc('0x8')](),controller[_0x02bc('0x9')]);router[_0x02bc('0xa')](_0x02bc('0xb'),auth[_0x02bc('0x8')](),controller['describe']);router[_0x02bc('0xa')]('/:id',auth[_0x02bc('0x8')](),controller[_0x02bc('0xc')]);router['get'](_0x02bc('0xd'),auth[_0x02bc('0x8')](),controller[_0x02bc('0xe')]);router[_0x02bc('0xa')](_0x02bc('0xf'),auth[_0x02bc('0x8')](),controller[_0x02bc('0x10')]);router[_0x02bc('0xa')]('/:id/applications',auth[_0x02bc('0x8')](),controller[_0x02bc('0x11')]);router['get']('/:id/interactions',auth['isAuthenticated'](),controller[_0x02bc('0x12')]);router[_0x02bc('0xa')](_0x02bc('0x13'),auth[_0x02bc('0x8')](),controller[_0x02bc('0x14')]);router[_0x02bc('0x15')]('/',auth[_0x02bc('0x8')](),controller[_0x02bc('0x16')]);router[_0x02bc('0x15')]('/:id/dispositions',auth[_0x02bc('0x8')](),controller['addDisposition']);router['post'](_0x02bc('0xf'),auth['isAuthenticated'](),controller[_0x02bc('0x17')]);router[_0x02bc('0x15')](_0x02bc('0x18'),controller['notify']);router[_0x02bc('0x15')](_0x02bc('0x19'),auth[_0x02bc('0x8')](),controller[_0x02bc('0x1a')]);router[_0x02bc('0x15')]('/:id/users',auth[_0x02bc('0x8')](),controller[_0x02bc('0x1b')]);router[_0x02bc('0x15')](_0x02bc('0x1c'),auth[_0x02bc('0x8')](),controller[_0x02bc('0x1d')]);router[_0x02bc('0x1e')](_0x02bc('0x1f'),auth[_0x02bc('0x8')](),controller[_0x02bc('0x20')]);router[_0x02bc('0x21')](_0x02bc('0x1f'),auth['isAuthenticated'](),controller[_0x02bc('0x22')]);router['delete'](_0x02bc('0xd'),auth[_0x02bc('0x8')](),controller[_0x02bc('0x23')]);router[_0x02bc('0x21')](_0x02bc('0xf'),auth[_0x02bc('0x8')](),controller[_0x02bc('0x24')]);router['delete'](_0x02bc('0x13'),auth[_0x02bc('0x8')](),controller[_0x02bc('0x25')]);module[_0x02bc('0x26')]=router;
\ No newline at end of file
+var _0x930c=['/:id/interactions','getInteractions','getAgents','post','addDisposition','addAnswer','/:id/notify','notify','addApplications','/:id/send','update','delete','removeDispositions','/:id/users','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelAccount.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers'];(function(_0x1f9900,_0x12b0da){var _0x4da12b=function(_0x198792){while(--_0x198792){_0x1f9900['push'](_0x1f9900['shift']());}};_0x4da12b(++_0x12b0da);}(_0x930c,0x130));var _0xc930=function(_0x2c6147,_0x30daee){_0x2c6147=_0x2c6147-0x0;var _0x4bdee8=_0x930c[_0x2c6147];return _0x4bdee8;};'use strict';var multer=require(_0xc930('0x0'));var util=require(_0xc930('0x1'));var path=require(_0xc930('0x2'));var timeout=require(_0xc930('0x3'));var express=require(_0xc930('0x4'));var router=express[_0xc930('0x5')]();var fs_extra=require(_0xc930('0x6'));var auth=require(_0xc930('0x7'));var interaction=require(_0xc930('0x8'));var config=require('../../config/environment');var controller=require(_0xc930('0x9'));router['get']('/',auth[_0xc930('0xa')](),controller['index']);router[_0xc930('0xb')](_0xc930('0xc'),auth[_0xc930('0xa')](),controller[_0xc930('0xd')]);router[_0xc930('0xb')](_0xc930('0xe'),auth['isAuthenticated'](),controller[_0xc930('0xf')]);router['get'](_0xc930('0x10'),auth[_0xc930('0xa')](),controller[_0xc930('0x11')]);router[_0xc930('0xb')](_0xc930('0x12'),auth[_0xc930('0xa')](),controller[_0xc930('0x13')]);router['get']('/:id/applications',auth[_0xc930('0xa')](),controller['getApplications']);router['get'](_0xc930('0x14'),auth[_0xc930('0xa')](),controller[_0xc930('0x15')]);router['get']('/:id/users',auth[_0xc930('0xa')](),controller[_0xc930('0x16')]);router['post']('/',auth[_0xc930('0xa')](),controller['create']);router[_0xc930('0x17')](_0xc930('0x10'),auth['isAuthenticated'](),controller[_0xc930('0x18')]);router[_0xc930('0x17')](_0xc930('0x12'),auth[_0xc930('0xa')](),controller[_0xc930('0x19')]);router[_0xc930('0x17')](_0xc930('0x1a'),controller[_0xc930('0x1b')]);router[_0xc930('0x17')]('/:id/applications',auth[_0xc930('0xa')](),controller[_0xc930('0x1c')]);router[_0xc930('0x17')]('/:id/users',auth[_0xc930('0xa')](),controller['addAgents']);router[_0xc930('0x17')](_0xc930('0x1d'),auth[_0xc930('0xa')](),controller['send']);router['put']('/:id',auth[_0xc930('0xa')](),controller[_0xc930('0x1e')]);router['delete'](_0xc930('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0xc930('0x1f')](_0xc930('0x10'),auth[_0xc930('0xa')](),controller[_0xc930('0x20')]);router[_0xc930('0x1f')]('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router[_0xc930('0x1f')](_0xc930('0x21'),auth['isAuthenticated'](),controller[_0xc930('0x22')]);module[_0xc930('0x23')]=router;
\ No newline at end of file
index 2ea39ce..4b1b0de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x51d6=['name','generate','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','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','STRING'];(function(_0x2eb5bc,_0x4634c6){var _0x51c7b1=function(_0x1af430){while(--_0x1af430){_0x2eb5bc['push'](_0x2eb5bc['shift']());}};_0x51c7b1(++_0x4634c6);}(_0x51d6,0x17e));var _0x651d=function(_0x2ffb4a,_0x1d400a){_0x2ffb4a=_0x2ffb4a-0x0;var _0xd8c83=_0x51d6[_0x2ffb4a];return _0xd8c83;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x651d('0x0'));module['exports']={'name':{'type':Sequelize[_0x651d('0x1')],'unique':_0x651d('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x651d('0x1')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x651d('0x3')]();}},'replyUri':{'type':Sequelize[_0x651d('0x1')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x651d('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x651d('0x4')],'defaultValue':function(){return _0x651d('0x5');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x651d('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x651d('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x651d('0x1')]},'queueTransfer':{'type':Sequelize[_0x651d('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x651d('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x651d('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x651d('0x7')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x651d('0x6')],'defaultValue':![],'comment':_0x651d('0x8'),'set':function(_0x1dcace){if(!_0x1dcace)this[_0x651d('0x9')](_0x651d('0xa'),null);this['setDataValue'](_0x651d('0xb'),_0x1dcace);}}};
\ No newline at end of file
+var _0xc4d7=['Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','INTEGER','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','exports','STRING','TEXT'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xc4d7,0xcd));var _0x7c4d=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xc4d7[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0x7c4d('0x0'));var rs=require('randomstring');module[_0x7c4d('0x1')]={'name':{'type':Sequelize[_0x7c4d('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x7c4d('0x2')]},'token':{'type':Sequelize[_0x7c4d('0x2')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x7c4d('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x7c4d('0x3')],'defaultValue':function(){return _0x7c4d('0x4');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7c4d('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x7c4d('0x2')]},'queueTransfer':{'type':Sequelize[_0x7c4d('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7c4d('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7c4d('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7c4d('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7c4d('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x7c4d('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x7c4d('0x8'),'set':function(_0xfbbaa2){if(!_0xfbbaa2)this[_0x7c4d('0x9')](_0x7c4d('0xa'),null);this[_0x7c4d('0x9')]('mandatoryDisposition',_0xfbbaa2);}}};
\ No newline at end of file
index 6c647bb..c6b266d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1059=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','merge','options','OpenchannelAccount','findAll','catch','show','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','describe','params','OpenchannelAccountId','Disposition','getDispositions','findOne','includeAll','include','rows','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','openchannel','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','CompanyId','isNil','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','updatedAt','DESC','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','defaults','contact','firstName','lastName','threadId','externalUrl','ContactId','OpenchannelInteraction','spread','messageId','interaction','autoclose','push','close','unmanaged','OpenchannelMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','notify','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','stack','finally','getApplications','getInteractions','Contact','Owner','fullname','Tag','color','tag','addAgents','omit','emit','removeAgents','userOpenchannelAccount:remove','getAgents','ListId','out','Messages','dataValues','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','localhost','socket.io-emitter','register','http','client','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','save','update','get','OpenchannelAccounts','UserProfileResource','destroy','end','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','key','model','query','keys','filters'];(function(_0x5bfb52,_0x57aa84){var _0x20606d=function(_0xf6a55a){while(--_0xf6a55a){_0x5bfb52['push'](_0x5bfb52['shift']());}};_0x20606d(++_0x57aa84);}(_0x1059,0x78));var _0x9105=function(_0x1e3016,_0x1b0043){_0x1e3016=_0x1e3016-0x0;var _0xb274bf=_0x1059[_0x1e3016];return _0xb274bf;};'use strict';var emlformat=require(_0x9105('0x0'));var rimraf=require(_0x9105('0x1'));var zipdir=require(_0x9105('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9105('0x3'));var moment=require(_0x9105('0x4'));var BPromise=require(_0x9105('0x5'));var Mustache=require(_0x9105('0x6'));var util=require(_0x9105('0x7'));var path=require(_0x9105('0x8'));var sox=require(_0x9105('0x9'));var csv=require(_0x9105('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9105('0xb'));var _=require(_0x9105('0xc'));var squel=require('squel');var crypto=require(_0x9105('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9105('0xe'));var toCsv=require(_0x9105('0xa'));var querystring=require(_0x9105('0xf'));var Papa=require(_0x9105('0x10'));var Redis=require(_0x9105('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9105('0x12'));var as=require(_0x9105('0x13'));var hardwareService=require(_0x9105('0x14'));var logger=require(_0x9105('0x15'))(_0x9105('0x16'));var utils=require(_0x9105('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x9105('0x18')],{'host':_0x9105('0x19'),'port':0x18eb});var socket=require(_0x9105('0x1a'))(new Redis(config[_0x9105('0x18')]));require('./openchannelAccount.socket')[_0x9105('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x9105('0x1c')]({'port':0x232c});var client9002=jayson[_0x9105('0x1d')][_0x9105('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x2de17f,_0x1c5ba9,_0x5a7ea0,_0x30316f){return new BPromise(function(_0xc2f712,_0xe84f62){var _0x428953=_0x30316f||client;return _0x428953['request'](_0x2de17f,_0x5a7ea0)[_0x9105('0x1e')](function(_0x5a7dcf){logger[_0x9105('0x1f')](_0x9105('0x20'),_0x1c5ba9,_0x9105('0x21'));logger[_0x9105('0x22')](_0x9105('0x23'),_0x1c5ba9,_0x9105('0x21'),JSON['stringify'](_0x5a7dcf));if(_0x5a7dcf[_0x9105('0x24')]){if(_0x5a7dcf['error'][_0x9105('0x25')]===0x1f4){logger[_0x9105('0x24')](_0x9105('0x20'),_0x1c5ba9,_0x5a7dcf[_0x9105('0x24')][_0x9105('0x26')]);return _0xe84f62(_0x5a7dcf[_0x9105('0x24')][_0x9105('0x26')]);}logger['error'](_0x9105('0x20'),_0x1c5ba9,_0x5a7dcf[_0x9105('0x24')][_0x9105('0x26')]);return _0xc2f712(_0x5a7dcf['error'][_0x9105('0x26')]);}else{logger[_0x9105('0x1f')]('OpenchannelAccount,\x20%s,\x20%s',_0x1c5ba9,_0x9105('0x21'));_0xc2f712(_0x5a7dcf[_0x9105('0x27')][_0x9105('0x26')]);}})['catch'](function(_0x4f8824){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x1c5ba9,_0x4f8824);_0xe84f62(_0x4f8824);});});}function respondWithStatusCode(_0x5e5acf,_0x4f08ad){_0x4f08ad=_0x4f08ad||0xcc;return function(_0x2e4947){if(_0x2e4947){return _0x5e5acf[_0x9105('0x28')](_0x4f08ad);}return _0x5e5acf[_0x9105('0x29')](_0x4f08ad)['end']();};}function respondWithResult(_0xc232fa,_0x5d226b){_0x5d226b=_0x5d226b||0xc8;return function(_0x571cb){if(_0x571cb){return _0xc232fa[_0x9105('0x29')](_0x5d226b)[_0x9105('0x2a')](_0x571cb);}};}function respondWithFilteredResult(_0x4b77af,_0x136a75){return function(_0x2a8df7){if(_0x2a8df7){var _0x5a5071=typeof _0x136a75['offset']===_0x9105('0x2b')&&typeof _0x136a75[_0x9105('0x2c')]===_0x9105('0x2b');var _0x28626e=_0x2a8df7[_0x9105('0x2d')];var _0x50b58e=_0x5a5071?0x0:_0x136a75[_0x9105('0x2e')];var _0x5d9731=_0x5a5071?_0x2a8df7[_0x9105('0x2d')]:_0x136a75[_0x9105('0x2e')]+_0x136a75[_0x9105('0x2c')];var _0x189a22;if(_0x5d9731>=_0x28626e){_0x5d9731=_0x28626e;_0x189a22=0xc8;}else{_0x189a22=0xce;}_0x4b77af[_0x9105('0x29')](_0x189a22);return _0x4b77af[_0x9105('0x2f')]('Content-Range',_0x50b58e+'-'+_0x5d9731+'/'+_0x28626e)[_0x9105('0x2a')](_0x2a8df7);}return null;};}function patchUpdates(_0xef3aeb){return function(_0x1be867){try{jsonpatch[_0x9105('0x30')](_0x1be867,_0xef3aeb,!![]);}catch(_0x13c4ff){return BPromise[_0x9105('0x31')](_0x13c4ff);}return _0x1be867[_0x9105('0x32')]();};}function saveUpdates(_0x530ecd,_0x23bbaa){return function(_0x43e1fb){if(_0x43e1fb){return _0x43e1fb[_0x9105('0x33')](_0x530ecd)['then'](function(_0x59a7f2){return _0x59a7f2;});}return null;};}function removeEntity(_0x576704,_0x3d6b51){return function(_0x47d3a8){if(_0x47d3a8){return _0x47d3a8['destroy']()[_0x9105('0x1e')](function(){var _0x412bc1=_0x47d3a8[_0x9105('0x34')]({'plain':!![]});var _0x47710f=_0x9105('0x35');return db[_0x9105('0x36')][_0x9105('0x37')]({'where':{'type':_0x47710f,'resourceId':_0x412bc1['id']}})[_0x9105('0x1e')](function(){return _0x47d3a8;});})[_0x9105('0x1e')](function(){_0x576704[_0x9105('0x29')](0xcc)[_0x9105('0x38')]();});}};}function handleEntityNotFound(_0x1b2c54,_0x31437c){return function(_0x1a2427){if(!_0x1a2427){_0x1b2c54[_0x9105('0x28')](0x194);}return _0x1a2427;};}function handleError(_0x1d8219,_0x10cf21){_0x10cf21=_0x10cf21||0x1f4;return function(_0x1625c9){logger[_0x9105('0x24')](_0x1625c9['stack']);if(_0x1625c9['name']){delete _0x1625c9[_0x9105('0x39')];}_0x1d8219['status'](_0x10cf21)[_0x9105('0x3a')](_0x1625c9);};}exports[_0x9105('0x3b')]=function(_0x5f1ba8,_0x2ccdfb){var _0x8037ff={'include':[{'model':db[_0x9105('0x3c')],'as':_0x9105('0x3d')}]},_0x358123={},_0x325b48={'count':0x0,'rows':[]};var _0x2bdf33=_[_0x9105('0x3e')](db['OpenchannelAccount'][_0x9105('0x3f')],function(_0x33419a){return{'name':_0x33419a['fieldName'],'type':_0x33419a['type'][_0x9105('0x40')]};});_0x358123[_0x9105('0x41')]=_[_0x9105('0x3e')](_0x2bdf33,'name');_0x358123[_0x9105('0x42')]=_[_0x9105('0x43')](_0x5f1ba8[_0x9105('0x42')]);_0x358123[_0x9105('0x44')]=_[_0x9105('0x45')](_0x358123['model'],_0x358123[_0x9105('0x42')]);_0x8037ff[_0x9105('0x46')]=_[_0x9105('0x45')](_0x358123[_0x9105('0x41')],qs[_0x9105('0x47')](_0x5f1ba8['query'][_0x9105('0x47')]));_0x8037ff[_0x9105('0x46')]=_0x8037ff[_0x9105('0x46')][_0x9105('0x48')]?_0x8037ff[_0x9105('0x46')]:_0x358123['model'];if(!_0x5f1ba8['query'][_0x9105('0x49')](_0x9105('0x4a'))){_0x8037ff[_0x9105('0x2c')]=qs[_0x9105('0x2c')](_0x5f1ba8['query'][_0x9105('0x2c')]);_0x8037ff['offset']=qs[_0x9105('0x2e')](_0x5f1ba8[_0x9105('0x42')]['offset']);}_0x8037ff[_0x9105('0x4b')]=qs[_0x9105('0x4c')](_0x5f1ba8[_0x9105('0x42')][_0x9105('0x4c')]);_0x8037ff[_0x9105('0x4d')]=qs[_0x9105('0x44')](_[_0x9105('0x4e')](_0x5f1ba8[_0x9105('0x42')],_0x358123[_0x9105('0x44')]),_0x2bdf33);if(_0x5f1ba8[_0x9105('0x42')][_0x9105('0x4f')]){_0x8037ff[_0x9105('0x4d')]=_['merge'](_0x8037ff[_0x9105('0x4d')],{'$or':_['map'](_0x2bdf33,function(_0x6b828f){if(_0x6b828f[_0x9105('0x50')]!=='VIRTUAL'){var _0x3a0d9d={};_0x3a0d9d[_0x6b828f[_0x9105('0x39')]]={'$like':'%'+_0x5f1ba8[_0x9105('0x42')][_0x9105('0x4f')]+'%'};return _0x3a0d9d;}})});}_0x8037ff=_[_0x9105('0x51')]({},_0x8037ff,_0x5f1ba8[_0x9105('0x52')]);var _0x3e8e53={'where':_0x8037ff[_0x9105('0x4d')]};return db['OpenchannelAccount'][_0x9105('0x2d')](_0x3e8e53)[_0x9105('0x1e')](function(_0x3fa4b4){_0x325b48[_0x9105('0x2d')]=_0x3fa4b4;if(_0x5f1ba8['query']['includeAll']){_0x8037ff['include']=[{'all':!![]}];}return db[_0x9105('0x53')][_0x9105('0x54')](_0x8037ff);})[_0x9105('0x1e')](function(_0x542c02){_0x325b48['rows']=_0x542c02;return _0x325b48;})['then'](respondWithFilteredResult(_0x2ccdfb,_0x8037ff))[_0x9105('0x55')](handleError(_0x2ccdfb,null));};exports[_0x9105('0x56')]=function(_0x5cc192,_0x5b5ab8){var _0x5c84d3={'raw':![],'where':{'id':_0x5cc192['params']['id']},'include':[{'model':db[_0x9105('0x3c')],'as':'mandatoryDispositionPause'}]},_0x360241={};_0x360241[_0x9105('0x41')]=_[_0x9105('0x43')](db[_0x9105('0x53')][_0x9105('0x3f')]);_0x360241[_0x9105('0x42')]=_[_0x9105('0x43')](_0x5cc192[_0x9105('0x42')]);_0x360241[_0x9105('0x44')]=_[_0x9105('0x45')](_0x360241[_0x9105('0x41')],_0x360241[_0x9105('0x42')]);_0x5c84d3[_0x9105('0x46')]=_['intersection'](_0x360241[_0x9105('0x41')],qs[_0x9105('0x47')](_0x5cc192[_0x9105('0x42')][_0x9105('0x47')]));_0x5c84d3[_0x9105('0x46')]=_0x5c84d3[_0x9105('0x46')]['length']?_0x5c84d3[_0x9105('0x46')]:_0x360241[_0x9105('0x41')];if(_0x5cc192['query']['includeAll']){_0x5c84d3['include']=[{'all':!![]}];}_0x5c84d3=_['merge']({},_0x5c84d3,_0x5cc192['options']);return db[_0x9105('0x53')][_0x9105('0x57')](_0x5c84d3)[_0x9105('0x1e')](handleEntityNotFound(_0x5b5ab8,null))[_0x9105('0x1e')](respondWithResult(_0x5b5ab8,null))['catch'](handleError(_0x5b5ab8,null));};exports[_0x9105('0x58')]=function(_0xf459dc,_0x4ec4e2){return db['OpenchannelAccount'][_0x9105('0x58')](_0xf459dc[_0x9105('0x59')],{})[_0x9105('0x1e')](function(_0x476aa6){var _0x176f19=_0xf459dc['user'][_0x9105('0x34')]({'plain':!![]});if(!_0x176f19)throw new Error(_0x9105('0x5a'));if(_0x176f19[_0x9105('0x5b')]===_0x9105('0x5c')){var _0x198d08=_0x476aa6['get']({'plain':!![]});var _0x291e1d=_0x9105('0x35');return db['UserProfileSection']['find']({'where':{'name':_0x291e1d,'userProfileId':_0x176f19[_0x9105('0x5d')]},'raw':!![]})[_0x9105('0x1e')](function(_0x19a474){if(_0x19a474&&_0x19a474['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x198d08[_0x9105('0x39')],'resourceId':_0x198d08['id'],'type':_0x19a474[_0x9105('0x39')],'sectionId':_0x19a474['id']},{})[_0x9105('0x1e')](function(){return _0x476aa6;});}else{return _0x476aa6;}})['catch'](function(_0x1b3e22){logger[_0x9105('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1b3e22);throw _0x1b3e22;});}return _0x476aa6;})['then'](respondWithResult(_0x4ec4e2,0xc9))[_0x9105('0x55')](handleError(_0x4ec4e2,null));};exports['update']=function(_0x2aca11,_0x2fec43){if(_0x2aca11[_0x9105('0x59')]['id']){delete _0x2aca11['body']['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x2aca11['params']['id']},'include':[{'model':db[_0x9105('0x3c')],'as':_0x9105('0x3d')}]})[_0x9105('0x1e')](handleEntityNotFound(_0x2fec43,null))[_0x9105('0x1e')](saveUpdates(_0x2aca11['body'],null))[_0x9105('0x1e')](respondWithResult(_0x2fec43,null))[_0x9105('0x55')](handleError(_0x2fec43,null));};exports[_0x9105('0x37')]=function(_0x344a14,_0x3882dd){return db[_0x9105('0x53')][_0x9105('0x57')]({'where':{'id':_0x344a14['params']['id']}})[_0x9105('0x1e')](handleEntityNotFound(_0x3882dd,null))[_0x9105('0x1e')](removeEntity(_0x3882dd,null))[_0x9105('0x55')](handleError(_0x3882dd,null));};exports[_0x9105('0x5e')]=function(_0x42fa7a,_0x48130a){return db[_0x9105('0x53')][_0x9105('0x5e')]()[_0x9105('0x1e')](respondWithResult(_0x48130a,null))[_0x9105('0x55')](handleError(_0x48130a,null));};exports['addDisposition']=function(_0x296185,_0x212f2d,_0x4a5609){if(_0x296185[_0x9105('0x59')]['id']){delete _0x296185['body']['id'];}return db[_0x9105('0x53')][_0x9105('0x57')]({'where':{'id':_0x296185[_0x9105('0x5f')]['id']}})[_0x9105('0x1e')](handleEntityNotFound(_0x212f2d,null))[_0x9105('0x1e')](function(_0x399a61){if(_0x399a61){_0x296185[_0x9105('0x59')][_0x9105('0x60')]=_0x399a61['id'];return db[_0x9105('0x61')][_0x9105('0x58')](_0x296185['body']);}})[_0x9105('0x1e')](respondWithResult(_0x212f2d,null))[_0x9105('0x55')](handleError(_0x212f2d,null));};exports[_0x9105('0x62')]=function(_0x58fcce,_0x50690c,_0x19ef35){var _0x4e299d={'raw':![],'where':{}};var _0x11ed07={};var _0x904346={'count':0x0,'rows':[]};return db[_0x9105('0x53')][_0x9105('0x63')]({'where':{'id':_0x58fcce[_0x9105('0x5f')]['id']}})['then'](handleEntityNotFound(_0x50690c,null))['then'](function(_0x45d7a1){if(_0x45d7a1){_0x11ed07[_0x9105('0x41')]=_[_0x9105('0x43')](db[_0x9105('0x61')][_0x9105('0x3f')]);_0x11ed07[_0x9105('0x42')]=_[_0x9105('0x43')](_0x58fcce[_0x9105('0x42')]);_0x11ed07[_0x9105('0x44')]=_['intersection'](_0x11ed07[_0x9105('0x41')],_0x11ed07[_0x9105('0x42')]);_0x4e299d['attributes']=_[_0x9105('0x45')](_0x11ed07['model'],qs[_0x9105('0x47')](_0x58fcce[_0x9105('0x42')][_0x9105('0x47')]));_0x4e299d[_0x9105('0x46')]=_0x4e299d[_0x9105('0x46')][_0x9105('0x48')]?_0x4e299d['attributes']:_0x11ed07[_0x9105('0x41')];if(!_0x58fcce[_0x9105('0x42')][_0x9105('0x49')](_0x9105('0x4a'))){_0x4e299d[_0x9105('0x2c')]=qs[_0x9105('0x2c')](_0x58fcce[_0x9105('0x42')][_0x9105('0x2c')]);_0x4e299d[_0x9105('0x2e')]=qs[_0x9105('0x2e')](_0x58fcce[_0x9105('0x42')]['offset']);}_0x4e299d['order']=qs['sort'](_0x58fcce[_0x9105('0x42')]['sort']);_0x4e299d[_0x9105('0x4d')]=qs[_0x9105('0x44')](_[_0x9105('0x4e')](_0x58fcce[_0x9105('0x42')],_0x11ed07['filters']));_0x4e299d[_0x9105('0x4d')]['OpenchannelAccountId']=_0x45d7a1['id'];if(_0x58fcce['query']['filter']){_0x4e299d[_0x9105('0x4d')]=_[_0x9105('0x51')](_0x4e299d[_0x9105('0x4d')],{'$or':_[_0x9105('0x3e')](_0x4e299d[_0x9105('0x46')],function(_0x5336b8){var _0x41fcd0={};_0x41fcd0[_0x5336b8]={'$like':'%'+_0x58fcce[_0x9105('0x42')]['filter']+'%'};return _0x41fcd0;})});}_0x4e299d=_[_0x9105('0x51')]({},_0x4e299d,_0x58fcce['options']);return db[_0x9105('0x61')][_0x9105('0x2d')]({'where':_0x4e299d[_0x9105('0x4d')]})[_0x9105('0x1e')](function(_0x34d7aa){_0x904346[_0x9105('0x2d')]=_0x34d7aa;if(_0x58fcce[_0x9105('0x42')][_0x9105('0x64')]){_0x4e299d[_0x9105('0x65')]=[{'all':!![]}];}return db[_0x9105('0x61')]['findAll'](_0x4e299d);})[_0x9105('0x1e')](function(_0x4e394a){_0x904346[_0x9105('0x66')]=_0x4e394a;return _0x904346;});}})[_0x9105('0x1e')](respondWithFilteredResult(_0x50690c,_0x4e299d))[_0x9105('0x55')](handleError(_0x50690c,null));};exports[_0x9105('0x67')]=function(_0x532702,_0x51dba0,_0x81d9ac){return db[_0x9105('0x53')][_0x9105('0x57')]({'where':{'id':_0x532702['params']['id']}})[_0x9105('0x1e')](handleEntityNotFound(_0x51dba0,null))[_0x9105('0x1e')](function(_0x5d9fdf){if(_0x5d9fdf){return _0x5d9fdf['removeDispositions'](_0x532702[_0x9105('0x42')][_0x9105('0x68')]);}})[_0x9105('0x1e')](respondWithStatusCode(_0x51dba0,null))[_0x9105('0x55')](handleError(_0x51dba0,null));};exports[_0x9105('0x69')]=function(_0x3aa50d,_0x39c6ca,_0x5e057){if(_0x3aa50d[_0x9105('0x59')]['id']){delete _0x3aa50d[_0x9105('0x59')]['id'];}return db[_0x9105('0x53')]['find']({'where':{'id':_0x3aa50d['params']['id']}})[_0x9105('0x1e')](handleEntityNotFound(_0x39c6ca,null))['then'](function(_0x107a35){if(_0x107a35){_0x3aa50d['body'][_0x9105('0x60')]=_0x107a35['id'];return db['CannedAnswer'][_0x9105('0x58')](_0x3aa50d[_0x9105('0x59')]);}})['then'](respondWithResult(_0x39c6ca,null))[_0x9105('0x55')](handleError(_0x39c6ca,null));};exports[_0x9105('0x6a')]=function(_0x4f99c7,_0x35d636,_0x5dd5b6){var _0x1f5a07={'raw':![],'where':{}};var _0x17ed14={};var _0x190603={'count':0x0,'rows':[]};return db[_0x9105('0x53')][_0x9105('0x63')]({'where':{'id':_0x4f99c7[_0x9105('0x5f')]['id']}})[_0x9105('0x1e')](handleEntityNotFound(_0x35d636,null))[_0x9105('0x1e')](function(_0x59042f){if(_0x59042f){_0x17ed14[_0x9105('0x41')]=_[_0x9105('0x43')](db['CannedAnswer'][_0x9105('0x3f')]);_0x17ed14['query']=_[_0x9105('0x43')](_0x4f99c7['query']);_0x17ed14[_0x9105('0x44')]=_['intersection'](_0x17ed14['model'],_0x17ed14['query']);_0x1f5a07[_0x9105('0x46')]=_['intersection'](_0x17ed14[_0x9105('0x41')],qs['fields'](_0x4f99c7[_0x9105('0x42')]['fields']));_0x1f5a07[_0x9105('0x46')]=_0x1f5a07['attributes'][_0x9105('0x48')]?_0x1f5a07[_0x9105('0x46')]:_0x17ed14[_0x9105('0x41')];if(!_0x4f99c7[_0x9105('0x42')][_0x9105('0x49')](_0x9105('0x4a'))){_0x1f5a07[_0x9105('0x2c')]=qs[_0x9105('0x2c')](_0x4f99c7[_0x9105('0x42')][_0x9105('0x2c')]);_0x1f5a07[_0x9105('0x2e')]=qs[_0x9105('0x2e')](_0x4f99c7['query'][_0x9105('0x2e')]);}_0x1f5a07['order']=qs[_0x9105('0x4c')](_0x4f99c7['query'][_0x9105('0x4c')]);_0x1f5a07['where']=qs[_0x9105('0x44')](_[_0x9105('0x4e')](_0x4f99c7[_0x9105('0x42')],_0x17ed14[_0x9105('0x44')]));_0x1f5a07['where']['OpenchannelAccountId']=_0x59042f['id'];if(_0x4f99c7[_0x9105('0x42')]['filter']){_0x1f5a07[_0x9105('0x4d')]=_['merge'](_0x1f5a07[_0x9105('0x4d')],{'$or':_[_0x9105('0x3e')](_0x1f5a07[_0x9105('0x46')],function(_0x59a99c){var _0x4df559={};_0x4df559[_0x59a99c]={'$like':'%'+_0x4f99c7['query'][_0x9105('0x4f')]+'%'};return _0x4df559;})});}_0x1f5a07=_[_0x9105('0x51')]({},_0x1f5a07,_0x4f99c7[_0x9105('0x52')]);return db['CannedAnswer'][_0x9105('0x2d')]({'where':_0x1f5a07[_0x9105('0x4d')]})['then'](function(_0x718645){_0x190603[_0x9105('0x2d')]=_0x718645;if(_0x4f99c7[_0x9105('0x42')]['includeAll']){_0x1f5a07['include']=[{'all':!![]}];}return db[_0x9105('0x6b')][_0x9105('0x54')](_0x1f5a07);})['then'](function(_0x307dc4){_0x190603[_0x9105('0x66')]=_0x307dc4;return _0x190603;});}})[_0x9105('0x1e')](respondWithFilteredResult(_0x35d636,_0x1f5a07))[_0x9105('0x55')](handleError(_0x35d636,null));};exports[_0x9105('0x6c')]=function(_0x19c838,_0xf4cac7,_0x186f5b){return db[_0x9105('0x53')][_0x9105('0x57')]({'where':{'id':_0x19c838[_0x9105('0x5f')]['id']}})[_0x9105('0x1e')](handleEntityNotFound(_0xf4cac7,null))[_0x9105('0x1e')](function(_0x124c37){if(_0x124c37){return _0x124c37[_0x9105('0x6c')](_0x19c838[_0x9105('0x42')][_0x9105('0x68')]);}})[_0x9105('0x1e')](respondWithStatusCode(_0xf4cac7,null))[_0x9105('0x55')](handleError(_0xf4cac7,null));};exports['notify']=function(_0x447ec6,_0x38ed37,_0x4ae12e){var _0x534020={'body':_0x447ec6[_0x9105('0x59')],'channel':_0x9105('0x6d')};var _0x164d80=[];var _0x2638e6=[];var _0x2365eb={};var _0x5a8a1f=![];return db[_0x9105('0x6e')][_0x9105('0x5e')]()[_0x9105('0x1e')](function(_0xc0378e){if(!_0xc0378e){throw new db['Sequelize'][(_0x9105('0x6f'))](_0x9105('0x70'));}_0x164d80=_[_0x9105('0x71')](_[_0x9105('0x43')](_0xc0378e),[_0x9105('0x72'),'updatedAt']);_0x2638e6=_[_0x9105('0x71')](_[_0x9105('0x43')](_0xc0378e),[_0x9105('0x72'),'updatedAt',_0x9105('0x73'),'ListId']);if(_0x447ec6[_0x9105('0x59')]['id']){delete _0x447ec6[_0x9105('0x59')]['id'];}if(_[_0x9105('0x74')](_0x447ec6['body']['from'])){throw new db[(_0x9105('0x75'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x447ec6[_0x9105('0x59')][_0x9105('0x59')])||_0x447ec6[_0x9105('0x59')]['body']===''){throw new db[(_0x9105('0x75'))][(_0x9105('0x6f'))](_0x9105('0x76'));}if(_[_0x9105('0x74')](_0x447ec6['body'][_0x9105('0x77')])){throw new db[(_0x9105('0x75'))]['ValidationError'](_0x9105('0x78')+_0x2638e6);}if(!_[_0x9105('0x79')](_0x2638e6,_0x447ec6[_0x9105('0x59')][_0x9105('0x77')])){throw new db[(_0x9105('0x75'))][(_0x9105('0x6f'))](_0x9105('0x7a')+_0x2638e6);}_0x2365eb[_0x447ec6['body'][_0x9105('0x77')]]=_0x447ec6['body'][_0x9105('0x7b')];})[_0x9105('0x1e')](function(){return db[_0x9105('0x53')]['find']({'where':{'id':_0x447ec6[_0x9105('0x5f')]['id']},'include':[{'model':db[_0x9105('0x7c')],'as':_0x9105('0x7d'),'include':[{'model':db[_0x9105('0x6e')],'as':_0x9105('0x7e'),'where':_0x2365eb,'limit':0x1,'order':[[_0x9105('0x7f'),_0x9105('0x80')]]}]},{'model':db[_0x9105('0x81')],'as':_0x9105('0x82')}]});})[_0x9105('0x1e')](handleEntityNotFound(_0x38ed37,null))[_0x9105('0x1e')](function(_0x82bf23){if(_0x82bf23&&_0x82bf23['List']){_0x534020[_0x9105('0x83')]=_0x82bf23;_0x534020[_0x9105('0x84')]=_0x82bf23['Applications'];_0x534020[_0x9105('0x85')]=_0x82bf23['List'];_0x534020[_0x9105('0x84')]=_[_0x9105('0x86')](_0x534020[_0x9105('0x84')],[_0x9105('0x87')],['asc']);if(_0x534020['account']['Applications']){delete _0x534020[_0x9105('0x83')][_0x9105('0x82')];}if(_0x534020[_0x9105('0x83')][_0x9105('0x7d')]&&_0x534020['account']['List']['Contacts'][_0x9105('0x48')]){return _0x534020[_0x9105('0x83')][_0x9105('0x7d')][_0x9105('0x7e')][0x0];}var _0x4c50c7=_[_0x9105('0x88')](_0x447ec6[_0x9105('0x59')],{'firstName':_0x447ec6[_0x9105('0x59')][_0x9105('0x7b')],'ListId':_0x82bf23['ListId']});_0x4c50c7[_0x447ec6[_0x9105('0x59')][_0x9105('0x77')]]=_0x447ec6[_0x9105('0x59')][_0x9105('0x7b')];return db['CmContact'][_0x9105('0x58')](_0x4c50c7,{'fields':_0x164d80,'raw':!![]});}})[_0x9105('0x1e')](handleEntityNotFound(_0x38ed37,null))[_0x9105('0x1e')](function(_0xd6174f){_0x534020[_0x9105('0x89')]=_0xd6174f;if(_0xd6174f){var _0x714c51={'ContactId':_0xd6174f['id'],'OpenchannelAccountId':_0x447ec6[_0x9105('0x5f')]['id'],'from':(_0xd6174f[_0x9105('0x8a')]||'')+'\x20'+(_0xd6174f[_0x9105('0x8b')]||'')};var _0xa65e1a={'OpenchannelAccountId':_0x447ec6[_0x9105('0x5f')]['id'],'closed':![]};if(_0x447ec6[_0x9105('0x59')][_0x9105('0x8c')]){_0xa65e1a[_0x9105('0x8c')]=_0x447ec6[_0x9105('0x59')][_0x9105('0x8c')];return db['OpenchannelInteraction'][_0x9105('0x57')]({'where':_0xa65e1a})[_0x9105('0x1e')](function(_0x19aa83){if(_0x19aa83){return[_0x19aa83,![]];}_0x714c51['threadId']=_0x447ec6[_0x9105('0x59')]['threadId'];_0x714c51[_0x9105('0x8d')]=_0x447ec6[_0x9105('0x59')][_0x9105('0x8d')];return db['OpenchannelInteraction'][_0x9105('0x58')](_0x714c51)[_0x9105('0x1e')](function(_0xf31a8a){return[_0xf31a8a,!![]];});});}else{_0xa65e1a['threadId']=null;}_0xa65e1a[_0x9105('0x8e')]=_0xd6174f['id'];return db[_0x9105('0x8f')]['find']({'where':_0xa65e1a})[_0x9105('0x1e')](function(_0x2161dd){if(_0x2161dd){return[_0x2161dd,![]];}return db[_0x9105('0x8f')][_0x9105('0x58')](_0x714c51)[_0x9105('0x1e')](function(_0x429fc3){return[_0x429fc3,!![]];});});}})[_0x9105('0x90')](function(_0x188764,_0x59bb7d){if(_0x188764){_0x5a8a1f=_0x59bb7d;if(!_0x59bb7d){var _0x5c3fbd={'from':(_0x534020[_0x9105('0x89')][_0x9105('0x8a')]||'')+'\x20'+(_0x534020[_0x9105('0x89')][_0x9105('0x8b')]||'')};if(_0x447ec6[_0x9105('0x59')][_0x9105('0x8c')]&&_0x447ec6['body'][_0x9105('0x91')]&&_0x447ec6['body'][_0x9105('0x8c')]!=_0x447ec6['body'][_0x9105('0x91')]){_0x5c3fbd[_0x9105('0x8c')]=_0x447ec6[_0x9105('0x59')][_0x9105('0x91')];}return _0x188764[_0x9105('0x33')](_0x5c3fbd);}else{return _0x188764;}}})['then'](function(_0x173704){_0x534020['interaction']=_0x173704[_0x9105('0x34')]({'plain':!![]});_0x534020[_0x9105('0x92')]['created']=_0x5a8a1f;if(_0x534020[_0x9105('0x92')]['created']){if(_0x534020[_0x9105('0x83')][_0x9105('0x93')]){_0x534020[_0x9105('0x84')][_0x9105('0x94')]({'id':0x0,'priority':_0x534020[_0x9105('0x84')][_0x9105('0x48')]+0x1,'app':_0x9105('0x95'),'appdata':_0x9105('0x96'),'interval':'*,*,*,*'});}}return db[_0x9105('0x97')][_0x9105('0x58')]({'body':_0x447ec6['body'][_0x9105('0x59')],'OpenchannelAccountId':_0x447ec6['params']['id'],'OpenchannelInteractionId':_0x173704['id'],'direction':'in','ContactId':_0x534020[_0x9105('0x89')]['id'],'AttachmentId':_0x447ec6[_0x9105('0x59')]['AttachmentId']});})[_0x9105('0x1e')](function(_0x1c3c3e){_0x534020['message']=_0x1c3c3e;if(_0x534020[_0x9105('0x92')][_0x9105('0x98')]){return db[_0x9105('0x99')][_0x9105('0x57')]({'attributes':['id',_0x9105('0x39')],'where':{'id':_0x534020['interaction'][_0x9105('0x98')]}})[_0x9105('0x1e')](function(_0x2ddaf3){if(_0x2ddaf3){_0x534020['applications'][_0x9105('0x9a')]({'id':0x0,'priority':0x0,'app':_0x9105('0x9b'),'appdata':_0x2ddaf3[_0x9105('0x39')]+','+(_0x534020[_0x9105('0x83')][_0x9105('0x9c')]||0xa),'interval':_0x9105('0x9d')});_0x534020[_0x9105('0x9e')]=![];}return respondWithRpcPromise(_0x9105('0x9f'),'startRouting',_0x534020);});}return respondWithRpcPromise('Start',_0x9105('0xa0'),_0x534020);})[_0x9105('0x1e')](function(_0x247a31){respondWithRpcPromise(_0x9105('0xa1'),_0x9105('0xa1'),{'event':_0x9105('0xa2'),'message':_0x247a31},client9002);return _0x247a31;})[_0x9105('0x1e')](respondWithResult(_0x38ed37,null))[_0x9105('0x55')](handleError(_0x38ed37,null));};exports['addApplications']=function(_0xeee259,_0x384d40){var _0xd3c6eb=_0xeee259['params']['id'];var _0x3aaca2=_0xeee259['body'];var _0x2d4b5a=0xc8;var _0x5da1ed=null;return db['sequelize'][_0x9105('0xa3')]({'isolationLevel':db[_0x9105('0xa4')][_0x9105('0xa5')][_0x9105('0xa6')][_0x9105('0xa7')]},function(_0x14f60e){return db['OpenchannelAccount'][_0x9105('0x63')]({'where':{'id':_0xd3c6eb},'transaction':_0x14f60e})[_0x9105('0x1e')](function(_0x3ee018){if(_0x3ee018){return db['OpenchannelApplication']['destroy']({'where':{'OpenchannelAccountId':_0xd3c6eb},'transaction':_0x14f60e})['then'](function(){var _0x167f9b=_[_0x9105('0x3e')](_0x3aaca2,function(_0x476cc2){_0x476cc2['OpenchannelAccountId']=_0xd3c6eb;return _0x476cc2;});return db['OpenchannelApplication']['bulkCreate'](_0x167f9b,{'transaction':_0x14f60e});});}else{_0x2d4b5a=0x194;_0x5da1ed=[];}});})[_0x9105('0x1e')](function(){if(_0x2d4b5a!==0x194){return db['OpenchannelApplication'][_0x9105('0xa8')]({'where':{'OpenchannelAccountId':_0xd3c6eb},'order':_0x9105('0x87')})['then'](function(_0x4b9926){_0x5da1ed=_0x4b9926;});}})[_0x9105('0x55')](function(_0x2f59ec){_0x2d4b5a=0x1f4;logger[_0x9105('0x24')](_0x2f59ec[_0x9105('0xa9')]);if(_0x2f59ec[_0x9105('0x39')]){delete _0x2f59ec[_0x9105('0x39')];}_0x5da1ed=_0x2f59ec;})[_0x9105('0xaa')](function(){if(_0x5da1ed===null){_0x384d40[_0x9105('0x28')](_0x2d4b5a);}else{if(_0x2d4b5a===0x1f4){_0x384d40['status'](_0x2d4b5a)['send'](_0x5da1ed);}else{_0x384d40[_0x9105('0x29')](_0x2d4b5a)[_0x9105('0x2a')](_0x5da1ed);}}});};exports[_0x9105('0xab')]=function(_0x2569bb,_0x18b4a3,_0x20b4f5){var _0xbba34f={};var _0x3306fa={};var _0x1cb1ec;var _0x3366e0;return db['OpenchannelAccount'][_0x9105('0x63')]({'where':{'id':_0x2569bb[_0x9105('0x5f')]['id']}})[_0x9105('0x1e')](handleEntityNotFound(_0x18b4a3,null))['then'](function(_0x572a82){if(_0x572a82){_0x1cb1ec=_0x572a82;_0x3306fa[_0x9105('0x41')]=_[_0x9105('0x43')](db['OpenchannelApplication'][_0x9105('0x3f')]);_0x3306fa[_0x9105('0x42')]=_[_0x9105('0x43')](_0x2569bb['query']);_0x3306fa[_0x9105('0x44')]=_['intersection'](_0x3306fa[_0x9105('0x41')],_0x3306fa[_0x9105('0x42')]);_0xbba34f['attributes']=_[_0x9105('0x45')](_0x3306fa[_0x9105('0x41')],qs[_0x9105('0x47')](_0x2569bb[_0x9105('0x42')]['fields']));_0xbba34f[_0x9105('0x46')]=_0xbba34f[_0x9105('0x46')]['length']?_0xbba34f[_0x9105('0x46')]:_0x3306fa[_0x9105('0x41')];_0xbba34f[_0x9105('0x4b')]=qs[_0x9105('0x4c')](_0x2569bb['query'][_0x9105('0x4c')]);_0xbba34f['where']=qs[_0x9105('0x44')](_[_0x9105('0x4e')](_0x2569bb[_0x9105('0x42')],_0x3306fa[_0x9105('0x44')]));if(_0x2569bb[_0x9105('0x42')][_0x9105('0x4f')]){_0xbba34f[_0x9105('0x4d')]=_[_0x9105('0x51')](_0xbba34f['where'],{'$or':_[_0x9105('0x3e')](_0xbba34f[_0x9105('0x46')],function(_0x3df311){var _0x5ec14e={};_0x5ec14e[_0x3df311]={'$like':'%'+_0x2569bb['query'][_0x9105('0x4f')]+'%'};return _0x5ec14e;})});}_0xbba34f=_['merge']({},_0xbba34f,_0x2569bb['options']);return _0x1cb1ec[_0x9105('0xab')](_0xbba34f);}})[_0x9105('0x1e')](function(_0x1c0a7e){if(_0x1c0a7e){_0x3366e0=_0x1c0a7e[_0x9105('0x48')];if(!_0x2569bb[_0x9105('0x42')]['hasOwnProperty'](_0x9105('0x4a'))){_0xbba34f[_0x9105('0x2c')]=qs[_0x9105('0x2c')](_0x2569bb['query'][_0x9105('0x2c')]);_0xbba34f[_0x9105('0x2e')]=qs['offset'](_0x2569bb[_0x9105('0x42')][_0x9105('0x2e')]);}return _0x1cb1ec['getApplications'](_0xbba34f);}})[_0x9105('0x1e')](function(_0x55672f){if(_0x55672f){return _0x55672f?{'count':_0x3366e0,'rows':_0x55672f}:null;}})[_0x9105('0x1e')](respondWithResult(_0x18b4a3,null))[_0x9105('0x55')](handleError(_0x18b4a3,null));};exports[_0x9105('0xac')]=function(_0x1a1d10,_0x3da5b4,_0x18cb5e){var _0x51e922={'raw':![],'where':{}};var _0x5e149c={};var _0x4e64b5={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x9105('0x63')]({'where':{'id':_0x1a1d10[_0x9105('0x5f')]['id']}})[_0x9105('0x1e')](handleEntityNotFound(_0x3da5b4,null))['then'](function(_0x465893){if(_0x465893){_0x5e149c[_0x9105('0x41')]=_[_0x9105('0x43')](db[_0x9105('0x8f')][_0x9105('0x3f')]);_0x5e149c['query']=_[_0x9105('0x43')](_0x1a1d10[_0x9105('0x42')]);_0x5e149c[_0x9105('0x44')]=_['intersection'](_0x5e149c['model'],_0x5e149c[_0x9105('0x42')]);_0x51e922['attributes']=_['intersection'](_0x5e149c[_0x9105('0x41')],qs[_0x9105('0x47')](_0x1a1d10['query'][_0x9105('0x47')]));_0x51e922[_0x9105('0x46')]=_0x51e922[_0x9105('0x46')][_0x9105('0x48')]?_0x51e922[_0x9105('0x46')]:_0x5e149c[_0x9105('0x41')];if(!_0x1a1d10['query']['hasOwnProperty'](_0x9105('0x4a'))){_0x51e922[_0x9105('0x2c')]=qs['limit'](_0x1a1d10[_0x9105('0x42')][_0x9105('0x2c')]);_0x51e922[_0x9105('0x2e')]=qs[_0x9105('0x2e')](_0x1a1d10[_0x9105('0x42')][_0x9105('0x2e')]);}_0x51e922[_0x9105('0x4b')]=qs['sort'](_0x1a1d10['query'][_0x9105('0x4c')]);_0x51e922[_0x9105('0x4d')]=qs[_0x9105('0x44')](_[_0x9105('0x4e')](_0x1a1d10[_0x9105('0x42')],_0x5e149c['filters']));_0x51e922['where']['OpenchannelAccountId']=_0x465893['id'];if(_0x1a1d10[_0x9105('0x42')][_0x9105('0x4f')]){_0x51e922['where']=_[_0x9105('0x51')](_0x51e922[_0x9105('0x4d')],{'$or':_[_0x9105('0x3e')](_0x51e922[_0x9105('0x46')],function(_0x2272eb){var _0x61390b={};_0x61390b[_0x2272eb]={'$like':'%'+_0x1a1d10[_0x9105('0x42')][_0x9105('0x4f')]+'%'};return _0x61390b;})});}_0x51e922=_[_0x9105('0x51')]({},_0x51e922,_0x1a1d10[_0x9105('0x52')]);return db[_0x9105('0x8f')][_0x9105('0x2d')]({'where':_0x51e922[_0x9105('0x4d')]})[_0x9105('0x1e')](function(_0x5bab05){_0x4e64b5[_0x9105('0x2d')]=_0x5bab05;if(_0x1a1d10['query'][_0x9105('0x64')]){_0x51e922['include']=[{'model':db[_0x9105('0x6e')],'as':_0x9105('0xad'),'required':![]},{'model':db[_0x9105('0x99')],'as':_0x9105('0xae'),'attributes':[_0x9105('0x39'),_0x9105('0xaf'),'internal'],'required':![]},{'model':db[_0x9105('0xb0')],'as':'Tags','attributes':['id',_0x9105('0x39'),_0x9105('0xb1')],'where':_0x1a1d10[_0x9105('0x42')][_0x9105('0xb2')]?{'id':_0x1a1d10['query'][_0x9105('0xb2')]}:undefined,'required':_0x1a1d10['query'][_0x9105('0xb2')]?!![]:![]}];}return db[_0x9105('0x8f')]['findAll'](_0x51e922);})[_0x9105('0x1e')](function(_0x57cdfb){_0x4e64b5[_0x9105('0x66')]=_0x57cdfb;return _0x4e64b5;});}})[_0x9105('0x1e')](respondWithFilteredResult(_0x3da5b4,_0x51e922))['catch'](handleError(_0x3da5b4,null));};exports['addAgents']=function(_0x4821b6,_0x1fafa6,_0x2099f4){return db[_0x9105('0x53')][_0x9105('0x57')]({'where':{'id':_0x4821b6[_0x9105('0x5f')]['id']}})[_0x9105('0x1e')](handleEntityNotFound(_0x1fafa6,null))[_0x9105('0x1e')](function(_0x10b97a){if(_0x10b97a){return _0x10b97a[_0x9105('0xb3')](_0x4821b6[_0x9105('0x59')][_0x9105('0x68')],_[_0x9105('0xb4')](_0x4821b6[_0x9105('0x59')],['ids','id'])||{})[_0x9105('0x90')](function(_0x1fd2b0){for(var _0xdcdc2f=0x0;_0xdcdc2f<_0x4821b6['body'][_0x9105('0x68')][_0x9105('0x48')];_0xdcdc2f+=0x1){socket[_0x9105('0xb5')]('userOpenchannelAccount:save',{'UserId':Number(_0x4821b6[_0x9105('0x59')][_0x9105('0x68')][_0xdcdc2f]),'OpenchannelAccountId':Number(_0x4821b6['params']['id'])});}return _0x1fd2b0;});}})['then'](respondWithResult(_0x1fafa6,null))[_0x9105('0x55')](handleError(_0x1fafa6,null));};exports['removeAgents']=function(_0x38de48,_0x250f57,_0x131c7c){return db[_0x9105('0x53')]['find']({'where':{'id':_0x38de48[_0x9105('0x5f')]['id']}})[_0x9105('0x1e')](handleEntityNotFound(_0x250f57,null))[_0x9105('0x1e')](function(_0x4b1570){if(_0x4b1570){return _0x4b1570[_0x9105('0xb6')](_0x38de48[_0x9105('0x42')][_0x9105('0x68')])[_0x9105('0x1e')](function(){if(_['isArray'](_0x38de48[_0x9105('0x42')][_0x9105('0x68')])){for(var _0x1545d5=0x0;_0x1545d5<_0x38de48[_0x9105('0x42')][_0x9105('0x68')][_0x9105('0x48')];_0x1545d5+=0x1){socket['emit'](_0x9105('0xb7'),{'UserId':Number(_0x38de48[_0x9105('0x42')]['ids'][_0x1545d5]),'OpenchannelAccountId':Number(_0x38de48['params']['id'])});}}else{socket[_0x9105('0xb5')]('userOpenchannelAccount:remove',{'UserId':Number(_0x38de48[_0x9105('0x42')][_0x9105('0x68')]),'OpenchannelAccountId':Number(_0x38de48[_0x9105('0x5f')]['id'])});}});}})[_0x9105('0x1e')](respondWithStatusCode(_0x250f57,null))[_0x9105('0x55')](handleError(_0x250f57,null));};exports[_0x9105('0xb8')]=function(_0x108333,_0x3ea6f6,_0x107be0){var _0x316e0d={};var _0x2e648d={};var _0x19cd53;var _0x258bf7;return db[_0x9105('0x53')][_0x9105('0x63')]({'where':{'id':_0x108333['params']['id']}})[_0x9105('0x1e')](handleEntityNotFound(_0x3ea6f6,null))[_0x9105('0x1e')](function(_0x101efa){if(_0x101efa){_0x19cd53=_0x101efa;_0x2e648d[_0x9105('0x41')]=_[_0x9105('0x43')](db['User']['rawAttributes']);_0x2e648d[_0x9105('0x42')]=_[_0x9105('0x43')](_0x108333[_0x9105('0x42')]);_0x2e648d[_0x9105('0x44')]=_['intersection'](_0x2e648d[_0x9105('0x41')],_0x2e648d['query']);_0x316e0d[_0x9105('0x46')]=_[_0x9105('0x45')](_0x2e648d[_0x9105('0x41')],qs[_0x9105('0x47')](_0x108333[_0x9105('0x42')][_0x9105('0x47')]));_0x316e0d['attributes']=_0x316e0d[_0x9105('0x46')]['length']?_0x316e0d['attributes']:_0x2e648d[_0x9105('0x41')];_0x316e0d['order']=qs[_0x9105('0x4c')](_0x108333[_0x9105('0x42')][_0x9105('0x4c')]);_0x316e0d['where']=qs[_0x9105('0x44')](_['pick'](_0x108333['query'],_0x2e648d[_0x9105('0x44')]));if(_0x108333[_0x9105('0x42')][_0x9105('0x4f')]){_0x316e0d[_0x9105('0x4d')]=_[_0x9105('0x51')](_0x316e0d['where'],{'$or':_['map'](_0x316e0d[_0x9105('0x46')],function(_0x54ccc1){var _0x2d0206={};_0x2d0206[_0x54ccc1]={'$like':'%'+_0x108333['query'][_0x9105('0x4f')]+'%'};return _0x2d0206;})});}_0x316e0d=_[_0x9105('0x51')]({},_0x316e0d,_0x108333['options']);return _0x19cd53[_0x9105('0xb8')](_0x316e0d);}})[_0x9105('0x1e')](function(_0x3f07a2){if(_0x3f07a2){_0x258bf7=_0x3f07a2[_0x9105('0x48')];if(!_0x108333[_0x9105('0x42')][_0x9105('0x49')](_0x9105('0x4a'))){_0x316e0d[_0x9105('0x2c')]=qs[_0x9105('0x2c')](_0x108333[_0x9105('0x42')][_0x9105('0x2c')]);_0x316e0d[_0x9105('0x2e')]=qs[_0x9105('0x2e')](_0x108333[_0x9105('0x42')][_0x9105('0x2e')]);}return _0x19cd53[_0x9105('0xb8')](_0x316e0d);}})[_0x9105('0x1e')](function(_0x5d0b01){if(_0x5d0b01){return _0x5d0b01?{'count':_0x258bf7,'rows':_0x5d0b01}:null;}})[_0x9105('0x1e')](respondWithResult(_0x3ea6f6,null))['catch'](handleError(_0x3ea6f6,null));};exports[_0x9105('0x3a')]=function(_0x546538,_0x45000f,_0x32caa){var _0x2aa477,_0x477258,_0x5d699b;if(_[_0x9105('0x74')](_0x546538[_0x9105('0x59')]['body'])||_0x546538[_0x9105('0x59')][_0x9105('0x59')]===''){throw new db[(_0x9105('0x75'))][(_0x9105('0x6f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x9105('0x74')](_0x546538[_0x9105('0x59')]['to'])){}_0x2aa477=_0x546538['body']['to'];return db[_0x9105('0x53')][_0x9105('0x63')]({'where':{'id':_0x546538[_0x9105('0x5f')]['id']}})['then'](handleEntityNotFound(_0x45000f,null))['then'](function(_0x8833d3){if(_0x8833d3){return db[_0x9105('0x53')][_0x9105('0x57')]({'where':{'id':_0x8833d3['id']},'include':[{'model':db['CmList'],'as':_0x9105('0x7d'),'include':[{'model':db[_0x9105('0x6e')],'as':_0x9105('0x7e'),'where':{[_0x8833d3['mapKey']]:_0x2aa477},'limit':0x1,'order':[[_0x9105('0x7f'),_0x9105('0x80')]]}]}]})[_0x9105('0x1e')](handleEntityNotFound(_0x45000f,null))[_0x9105('0x1e')](function(_0x2e4646){if(_0x2e4646&&_0x2e4646['List']){_0x477258=_0x2e4646[_0x9105('0x34')]({'plain':!![]});if(_0x477258[_0x9105('0x7d')]&&_0x477258[_0x9105('0x7d')][_0x9105('0x7e')]['length']){return _0x477258[_0x9105('0x7d')][_0x9105('0x7e')][0x0];}return db[_0x9105('0x6e')][_0x9105('0x58')](_[_0x9105('0x88')](_0x546538[_0x9105('0x59')],{'firstName':_0x2aa477,[_0x2e4646['mapKey']]:_0x2aa477,'phone':_0x2aa477,'ListId':_0x477258[_0x9105('0xb9')]}));}})[_0x9105('0x1e')](handleEntityNotFound(_0x45000f,null))['then'](function(_0x1b53eb){if(_0x1b53eb){_0x5d699b=_0x1b53eb;return db[_0x9105('0x8f')][_0x9105('0x57')]({'where':{'ContactId':_0x5d699b['id'],'closed':![],'OpenchannelAccountId':_0x477258['id']}})[_0x9105('0x1e')](function(_0x95369e){if(_0x95369e){return[_0x95369e,![]];}return db[_0x9105('0x8f')]['create']({'UserId':_0x546538['user']['id'],'ContactId':_0x5d699b['id'],'OpenchannelAccountId':_0x477258['id'],'lastMsgDirection':_0x9105('0xba'),'Messages':[_[_0x9105('0x51')](_0x546538[_0x9105('0x59')],{'read':![],'body':_0x546538[_0x9105('0x59')][_0x9105('0x59')],'OpenchannelAccountId':_0x477258['id'],'UserId':_0x546538[_0x9105('0x5c')]['id'],'ContactId':_0x5d699b['id']})]},{'include':[{'model':db[_0x9105('0x97')],'as':_0x9105('0xbb')}]})[_0x9105('0x1e')](function(_0x4fb299){return[_0x4fb299,!![]];});});}})[_0x9105('0x90')](function(_0x111f41,_0x125fa7){if(_0x125fa7){return _0x111f41;}return db[_0x9105('0x97')]['create'](_[_0x9105('0x51')](_0x546538['body'],{'read':![],'body':_0x546538[_0x9105('0x59')][_0x9105('0x59')],'OpenchannelAccountId':_0x477258['id'],'OpenchannelInteractionId':_0x111f41['id'],'UserId':_0x546538[_0x9105('0x5c')]['id'],'ContactId':_0x5d699b['id']}))[_0x9105('0x1e')](function(_0x4794f6){_0x111f41[_0x9105('0xbc')][_0x9105('0xbb')]=[];_0x111f41[_0x9105('0xbc')][_0x9105('0xbb')][_0x9105('0x94')](_0x4794f6[_0x9105('0xbc')]);return _0x111f41;});});}})[_0x9105('0x1e')](respondWithResult(_0x45000f,null))['catch'](handleError(_0x45000f,null));};
\ No newline at end of file
+var _0x6b40=['Owner','fullname','internal','Tag','Tags','color','tag','rows','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','push','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','redis','./openchannelAccount.socket','register','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','status','end','offset','undefined','limit','count','Content-Range','json','reject','save','update','destroy','get','sendStatus','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelAccounts','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','OpenchannelAccountId','getDispositions','findOne','removeDispositions','addAnswer','CannedAnswer','removeAnswers','ids','notify','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','isNil','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','List','CmContact','Contacts','DESC','Applications','applications','orderBy','priority','asc','account','defaults','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','spread','contact','messageId','interaction','created','autoclose','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','ISOLATION_LEVELS','READ_COMMITTED','OpenchannelApplication','bulkCreate','stack','finally','getApplications','getInteractions','Contact','User'];(function(_0x542da8,_0x509c26){var _0x533d7e=function(_0x2a3d04){while(--_0x2a3d04){_0x542da8['push'](_0x542da8['shift']());}};_0x533d7e(++_0x509c26);}(_0x6b40,0x194));var _0x06b4=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x6b40[_0x4b055c];return _0x4b62bb;};'use strict';var emlformat=require(_0x06b4('0x0'));var rimraf=require(_0x06b4('0x1'));var zipdir=require(_0x06b4('0x2'));var jsonpatch=require(_0x06b4('0x3'));var rp=require(_0x06b4('0x4'));var moment=require(_0x06b4('0x5'));var BPromise=require(_0x06b4('0x6'));var Mustache=require('mustache');var util=require(_0x06b4('0x7'));var path=require(_0x06b4('0x8'));var sox=require('sox');var csv=require(_0x06b4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x06b4('0xa'));var _=require(_0x06b4('0xb'));var squel=require(_0x06b4('0xc'));var crypto=require(_0x06b4('0xd'));var jsforce=require(_0x06b4('0xe'));var deskjs=require(_0x06b4('0xf'));var toCsv=require(_0x06b4('0x9'));var querystring=require(_0x06b4('0x10'));var Papa=require(_0x06b4('0x11'));var Redis=require('ioredis');var authService=require(_0x06b4('0x12'));var qs=require(_0x06b4('0x13'));var as=require(_0x06b4('0x14'));var hardwareService=require(_0x06b4('0x15'));var logger=require(_0x06b4('0x16'))('api');var utils=require(_0x06b4('0x17'));var config=require(_0x06b4('0x18'));var licenseUtil=require(_0x06b4('0x19'));var db=require(_0x06b4('0x1a'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x06b4('0x1b'))(new Redis(config[_0x06b4('0x1c')]));require(_0x06b4('0x1d'))[_0x06b4('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x06b4('0x1f')][_0x06b4('0x20')]({'port':0x232c});var client9002=jayson[_0x06b4('0x1f')][_0x06b4('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x29a272,_0x19e574,_0x3f86de,_0x2dd673){return new BPromise(function(_0x1c9624,_0x4bdf0d){var _0x9553ff=_0x2dd673||client;return _0x9553ff[_0x06b4('0x21')](_0x29a272,_0x3f86de)[_0x06b4('0x22')](function(_0xc4c4de){logger[_0x06b4('0x23')](_0x06b4('0x24'),_0x19e574,_0x06b4('0x25'));logger[_0x06b4('0x26')](_0x06b4('0x27'),_0x19e574,'request\x20sent',JSON[_0x06b4('0x28')](_0xc4c4de));if(_0xc4c4de[_0x06b4('0x29')]){if(_0xc4c4de[_0x06b4('0x29')][_0x06b4('0x2a')]===0x1f4){logger[_0x06b4('0x29')](_0x06b4('0x24'),_0x19e574,_0xc4c4de['error'][_0x06b4('0x2b')]);return _0x4bdf0d(_0xc4c4de[_0x06b4('0x29')][_0x06b4('0x2b')]);}logger[_0x06b4('0x29')](_0x06b4('0x24'),_0x19e574,_0xc4c4de[_0x06b4('0x29')][_0x06b4('0x2b')]);return _0x1c9624(_0xc4c4de[_0x06b4('0x29')][_0x06b4('0x2b')]);}else{logger[_0x06b4('0x23')](_0x06b4('0x24'),_0x19e574,_0x06b4('0x25'));_0x1c9624(_0xc4c4de['result'][_0x06b4('0x2b')]);}})['catch'](function(_0x474d17){logger[_0x06b4('0x29')](_0x06b4('0x24'),_0x19e574,_0x474d17);_0x4bdf0d(_0x474d17);});});}function respondWithStatusCode(_0x4a71cf,_0x407fc5){_0x407fc5=_0x407fc5||0xcc;return function(_0x508638){if(_0x508638){return _0x4a71cf['sendStatus'](_0x407fc5);}return _0x4a71cf[_0x06b4('0x2c')](_0x407fc5)[_0x06b4('0x2d')]();};}function respondWithResult(_0x3944de,_0x447656){_0x447656=_0x447656||0xc8;return function(_0x5b87b9){if(_0x5b87b9){return _0x3944de['status'](_0x447656)['json'](_0x5b87b9);}};}function respondWithFilteredResult(_0x45c085,_0x285557){return function(_0x2f730a){if(_0x2f730a){var _0x33ffc2=typeof _0x285557[_0x06b4('0x2e')]===_0x06b4('0x2f')&&typeof _0x285557[_0x06b4('0x30')]==='undefined';var _0x109897=_0x2f730a[_0x06b4('0x31')];var _0x16c746=_0x33ffc2?0x0:_0x285557[_0x06b4('0x2e')];var _0x271058=_0x33ffc2?_0x2f730a['count']:_0x285557[_0x06b4('0x2e')]+_0x285557[_0x06b4('0x30')];var _0x4af5e2;if(_0x271058>=_0x109897){_0x271058=_0x109897;_0x4af5e2=0xc8;}else{_0x4af5e2=0xce;}_0x45c085[_0x06b4('0x2c')](_0x4af5e2);return _0x45c085['set'](_0x06b4('0x32'),_0x16c746+'-'+_0x271058+'/'+_0x109897)[_0x06b4('0x33')](_0x2f730a);}return null;};}function patchUpdates(_0xbc1163){return function(_0x2d36c0){try{jsonpatch['apply'](_0x2d36c0,_0xbc1163,!![]);}catch(_0x3d76c3){return BPromise[_0x06b4('0x34')](_0x3d76c3);}return _0x2d36c0[_0x06b4('0x35')]();};}function saveUpdates(_0x24f3e3,_0x4c36a6){return function(_0x311b65){if(_0x311b65){return _0x311b65[_0x06b4('0x36')](_0x24f3e3)[_0x06b4('0x22')](function(_0x44ca01){return _0x44ca01;});}return null;};}function removeEntity(_0xb9ba4b,_0x4c0cc2){return function(_0x167e14){if(_0x167e14){return _0x167e14[_0x06b4('0x37')]()['then'](function(){var _0x21d160=_0x167e14[_0x06b4('0x38')]({'plain':!![]});var _0x1942f3='OpenchannelAccounts';return db['UserProfileResource']['destroy']({'where':{'type':_0x1942f3,'resourceId':_0x21d160['id']}})[_0x06b4('0x22')](function(){return _0x167e14;});})[_0x06b4('0x22')](function(){_0xb9ba4b[_0x06b4('0x2c')](0xcc)[_0x06b4('0x2d')]();});}};}function handleEntityNotFound(_0x19083b,_0x5d5e86){return function(_0x5cfe1d){if(!_0x5cfe1d){_0x19083b[_0x06b4('0x39')](0x194);}return _0x5cfe1d;};}function handleError(_0x169229,_0x39852f){_0x39852f=_0x39852f||0x1f4;return function(_0x29ec37){logger[_0x06b4('0x29')](_0x29ec37['stack']);if(_0x29ec37[_0x06b4('0x3a')]){delete _0x29ec37[_0x06b4('0x3a')];}_0x169229[_0x06b4('0x2c')](_0x39852f)[_0x06b4('0x3b')](_0x29ec37);};}exports[_0x06b4('0x3c')]=function(_0x5ed503,_0x19121c){var _0x5daefa={'include':[{'model':db[_0x06b4('0x3d')],'as':_0x06b4('0x3e')}]},_0x124be5={},_0x46af91={'count':0x0,'rows':[]};var _0x5c957e=_[_0x06b4('0x3f')](db[_0x06b4('0x40')][_0x06b4('0x41')],function(_0x9949d6){return{'name':_0x9949d6['fieldName'],'type':_0x9949d6['type'][_0x06b4('0x42')]};});_0x124be5[_0x06b4('0x43')]=_[_0x06b4('0x3f')](_0x5c957e,'name');_0x124be5[_0x06b4('0x44')]=_[_0x06b4('0x45')](_0x5ed503[_0x06b4('0x44')]);_0x124be5[_0x06b4('0x46')]=_[_0x06b4('0x47')](_0x124be5['model'],_0x124be5[_0x06b4('0x44')]);_0x5daefa['attributes']=_[_0x06b4('0x47')](_0x124be5[_0x06b4('0x43')],qs[_0x06b4('0x48')](_0x5ed503[_0x06b4('0x44')][_0x06b4('0x48')]));_0x5daefa[_0x06b4('0x49')]=_0x5daefa[_0x06b4('0x49')][_0x06b4('0x4a')]?_0x5daefa[_0x06b4('0x49')]:_0x124be5[_0x06b4('0x43')];if(!_0x5ed503[_0x06b4('0x44')][_0x06b4('0x4b')](_0x06b4('0x4c'))){_0x5daefa[_0x06b4('0x30')]=qs[_0x06b4('0x30')](_0x5ed503[_0x06b4('0x44')][_0x06b4('0x30')]);_0x5daefa[_0x06b4('0x2e')]=qs[_0x06b4('0x2e')](_0x5ed503[_0x06b4('0x44')][_0x06b4('0x2e')]);}_0x5daefa[_0x06b4('0x4d')]=qs[_0x06b4('0x4e')](_0x5ed503[_0x06b4('0x44')]['sort']);_0x5daefa[_0x06b4('0x4f')]=qs[_0x06b4('0x46')](_[_0x06b4('0x50')](_0x5ed503[_0x06b4('0x44')],_0x124be5[_0x06b4('0x46')]),_0x5c957e);if(_0x5ed503['query'][_0x06b4('0x51')]){_0x5daefa[_0x06b4('0x4f')]=_['merge'](_0x5daefa[_0x06b4('0x4f')],{'$or':_[_0x06b4('0x3f')](_0x5c957e,function(_0x17c84c){if(_0x17c84c[_0x06b4('0x52')]!==_0x06b4('0x53')){var _0x2ee492={};_0x2ee492[_0x17c84c[_0x06b4('0x3a')]]={'$like':'%'+_0x5ed503[_0x06b4('0x44')][_0x06b4('0x51')]+'%'};return _0x2ee492;}})});}_0x5daefa=_[_0x06b4('0x54')]({},_0x5daefa,_0x5ed503[_0x06b4('0x55')]);var _0x2a099b={'where':_0x5daefa['where']};return db[_0x06b4('0x40')][_0x06b4('0x31')](_0x2a099b)[_0x06b4('0x22')](function(_0x19f697){_0x46af91[_0x06b4('0x31')]=_0x19f697;if(_0x5ed503[_0x06b4('0x44')][_0x06b4('0x56')]){_0x5daefa[_0x06b4('0x57')]=[{'all':!![]}];}return db[_0x06b4('0x40')][_0x06b4('0x58')](_0x5daefa);})[_0x06b4('0x22')](function(_0x2a98e8){_0x46af91['rows']=_0x2a98e8;return _0x46af91;})[_0x06b4('0x22')](respondWithFilteredResult(_0x19121c,_0x5daefa))[_0x06b4('0x59')](handleError(_0x19121c,null));};exports[_0x06b4('0x5a')]=function(_0xf063ad,_0xcdf37a){var _0x10edeb={'raw':![],'where':{'id':_0xf063ad[_0x06b4('0x5b')]['id']},'include':[{'model':db[_0x06b4('0x3d')],'as':_0x06b4('0x3e')}]},_0x60983c={};_0x60983c[_0x06b4('0x43')]=_[_0x06b4('0x45')](db[_0x06b4('0x40')][_0x06b4('0x41')]);_0x60983c['query']=_['keys'](_0xf063ad[_0x06b4('0x44')]);_0x60983c[_0x06b4('0x46')]=_[_0x06b4('0x47')](_0x60983c[_0x06b4('0x43')],_0x60983c['query']);_0x10edeb['attributes']=_['intersection'](_0x60983c[_0x06b4('0x43')],qs[_0x06b4('0x48')](_0xf063ad['query'][_0x06b4('0x48')]));_0x10edeb[_0x06b4('0x49')]=_0x10edeb['attributes'][_0x06b4('0x4a')]?_0x10edeb[_0x06b4('0x49')]:_0x60983c[_0x06b4('0x43')];if(_0xf063ad[_0x06b4('0x44')][_0x06b4('0x56')]){_0x10edeb[_0x06b4('0x57')]=[{'all':!![]}];}_0x10edeb=_[_0x06b4('0x54')]({},_0x10edeb,_0xf063ad[_0x06b4('0x55')]);return db[_0x06b4('0x40')][_0x06b4('0x5c')](_0x10edeb)[_0x06b4('0x22')](handleEntityNotFound(_0xcdf37a,null))[_0x06b4('0x22')](respondWithResult(_0xcdf37a,null))[_0x06b4('0x59')](handleError(_0xcdf37a,null));};exports['create']=function(_0x2acfa4,_0x1368b7){return db[_0x06b4('0x40')][_0x06b4('0x5d')](_0x2acfa4[_0x06b4('0x5e')],{})['then'](function(_0x36b14e){var _0x3bd32b=_0x2acfa4[_0x06b4('0x5f')][_0x06b4('0x38')]({'plain':!![]});if(!_0x3bd32b)throw new Error(_0x06b4('0x60'));if(_0x3bd32b[_0x06b4('0x61')]==='user'){var _0x21d50a=_0x36b14e[_0x06b4('0x38')]({'plain':!![]});var _0x184db1=_0x06b4('0x62');return db['UserProfileSection'][_0x06b4('0x5c')]({'where':{'name':_0x184db1,'userProfileId':_0x3bd32b['userProfileId']},'raw':!![]})['then'](function(_0x2a858c){if(_0x2a858c&&_0x2a858c[_0x06b4('0x63')]===0x0){return db[_0x06b4('0x64')][_0x06b4('0x5d')]({'name':_0x21d50a[_0x06b4('0x3a')],'resourceId':_0x21d50a['id'],'type':_0x2a858c[_0x06b4('0x3a')],'sectionId':_0x2a858c['id']},{})['then'](function(){return _0x36b14e;});}else{return _0x36b14e;}})[_0x06b4('0x59')](function(_0x1cece4){logger['error'](_0x06b4('0x65'),_0x1cece4);throw _0x1cece4;});}return _0x36b14e;})[_0x06b4('0x22')](respondWithResult(_0x1368b7,0xc9))[_0x06b4('0x59')](handleError(_0x1368b7,null));};exports[_0x06b4('0x36')]=function(_0x126f8f,_0x3014c8){if(_0x126f8f[_0x06b4('0x5e')]['id']){delete _0x126f8f[_0x06b4('0x5e')]['id'];}return db[_0x06b4('0x40')]['find']({'where':{'id':_0x126f8f[_0x06b4('0x5b')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x06b4('0x22')](handleEntityNotFound(_0x3014c8,null))[_0x06b4('0x22')](saveUpdates(_0x126f8f['body'],null))[_0x06b4('0x22')](respondWithResult(_0x3014c8,null))[_0x06b4('0x59')](handleError(_0x3014c8,null));};exports[_0x06b4('0x37')]=function(_0x152d4d,_0x40c552){return db[_0x06b4('0x40')]['find']({'where':{'id':_0x152d4d['params']['id']}})[_0x06b4('0x22')](handleEntityNotFound(_0x40c552,null))[_0x06b4('0x22')](removeEntity(_0x40c552,null))['catch'](handleError(_0x40c552,null));};exports[_0x06b4('0x66')]=function(_0x3efed1,_0x13d5c2){return db['OpenchannelAccount'][_0x06b4('0x66')]()['then'](respondWithResult(_0x13d5c2,null))[_0x06b4('0x59')](handleError(_0x13d5c2,null));};exports['addDisposition']=function(_0x4e09f0,_0x3ffb30,_0x26af00){if(_0x4e09f0[_0x06b4('0x5e')]['id']){delete _0x4e09f0[_0x06b4('0x5e')]['id'];}return db[_0x06b4('0x40')][_0x06b4('0x5c')]({'where':{'id':_0x4e09f0[_0x06b4('0x5b')]['id']}})[_0x06b4('0x22')](handleEntityNotFound(_0x3ffb30,null))[_0x06b4('0x22')](function(_0xb0cf9c){if(_0xb0cf9c){_0x4e09f0[_0x06b4('0x5e')][_0x06b4('0x67')]=_0xb0cf9c['id'];return db['Disposition'][_0x06b4('0x5d')](_0x4e09f0[_0x06b4('0x5e')]);}})['then'](respondWithResult(_0x3ffb30,null))[_0x06b4('0x59')](handleError(_0x3ffb30,null));};exports[_0x06b4('0x68')]=function(_0x4d2a01,_0x151d8e,_0x3d47b5){var _0x991170={'raw':![],'where':{}};var _0x1ca1ab={};var _0x3db54a={'count':0x0,'rows':[]};return db[_0x06b4('0x40')][_0x06b4('0x69')]({'where':{'id':_0x4d2a01[_0x06b4('0x5b')]['id']}})[_0x06b4('0x22')](handleEntityNotFound(_0x151d8e,null))[_0x06b4('0x22')](function(_0xe14f61){if(_0xe14f61){_0x1ca1ab[_0x06b4('0x43')]=_[_0x06b4('0x45')](db['Disposition']['rawAttributes']);_0x1ca1ab[_0x06b4('0x44')]=_['keys'](_0x4d2a01[_0x06b4('0x44')]);_0x1ca1ab[_0x06b4('0x46')]=_[_0x06b4('0x47')](_0x1ca1ab[_0x06b4('0x43')],_0x1ca1ab[_0x06b4('0x44')]);_0x991170['attributes']=_[_0x06b4('0x47')](_0x1ca1ab[_0x06b4('0x43')],qs[_0x06b4('0x48')](_0x4d2a01[_0x06b4('0x44')][_0x06b4('0x48')]));_0x991170[_0x06b4('0x49')]=_0x991170['attributes'][_0x06b4('0x4a')]?_0x991170[_0x06b4('0x49')]:_0x1ca1ab['model'];if(!_0x4d2a01[_0x06b4('0x44')][_0x06b4('0x4b')](_0x06b4('0x4c'))){_0x991170['limit']=qs[_0x06b4('0x30')](_0x4d2a01[_0x06b4('0x44')][_0x06b4('0x30')]);_0x991170['offset']=qs[_0x06b4('0x2e')](_0x4d2a01[_0x06b4('0x44')]['offset']);}_0x991170[_0x06b4('0x4d')]=qs[_0x06b4('0x4e')](_0x4d2a01[_0x06b4('0x44')]['sort']);_0x991170[_0x06b4('0x4f')]=qs[_0x06b4('0x46')](_[_0x06b4('0x50')](_0x4d2a01['query'],_0x1ca1ab[_0x06b4('0x46')]));_0x991170[_0x06b4('0x4f')]['OpenchannelAccountId']=_0xe14f61['id'];if(_0x4d2a01[_0x06b4('0x44')]['filter']){_0x991170[_0x06b4('0x4f')]=_['merge'](_0x991170[_0x06b4('0x4f')],{'$or':_[_0x06b4('0x3f')](_0x991170[_0x06b4('0x49')],function(_0x509377){var _0x3c0aac={};_0x3c0aac[_0x509377]={'$like':'%'+_0x4d2a01['query'][_0x06b4('0x51')]+'%'};return _0x3c0aac;})});}_0x991170=_[_0x06b4('0x54')]({},_0x991170,_0x4d2a01[_0x06b4('0x55')]);return db['Disposition'][_0x06b4('0x31')]({'where':_0x991170[_0x06b4('0x4f')]})[_0x06b4('0x22')](function(_0x302708){_0x3db54a[_0x06b4('0x31')]=_0x302708;if(_0x4d2a01[_0x06b4('0x44')][_0x06b4('0x56')]){_0x991170[_0x06b4('0x57')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x991170);})['then'](function(_0x89bfce){_0x3db54a['rows']=_0x89bfce;return _0x3db54a;});}})['then'](respondWithFilteredResult(_0x151d8e,_0x991170))[_0x06b4('0x59')](handleError(_0x151d8e,null));};exports['removeDispositions']=function(_0x49ee3e,_0x40a7c8,_0x221ff4){return db['OpenchannelAccount'][_0x06b4('0x5c')]({'where':{'id':_0x49ee3e['params']['id']}})['then'](handleEntityNotFound(_0x40a7c8,null))[_0x06b4('0x22')](function(_0x7564eb){if(_0x7564eb){return _0x7564eb[_0x06b4('0x6a')](_0x49ee3e[_0x06b4('0x44')]['ids']);}})[_0x06b4('0x22')](respondWithStatusCode(_0x40a7c8,null))[_0x06b4('0x59')](handleError(_0x40a7c8,null));};exports[_0x06b4('0x6b')]=function(_0x1a207b,_0x165a1b,_0x3012d9){if(_0x1a207b[_0x06b4('0x5e')]['id']){delete _0x1a207b[_0x06b4('0x5e')]['id'];}return db['OpenchannelAccount'][_0x06b4('0x5c')]({'where':{'id':_0x1a207b[_0x06b4('0x5b')]['id']}})[_0x06b4('0x22')](handleEntityNotFound(_0x165a1b,null))[_0x06b4('0x22')](function(_0x334afd){if(_0x334afd){_0x1a207b[_0x06b4('0x5e')][_0x06b4('0x67')]=_0x334afd['id'];return db['CannedAnswer']['create'](_0x1a207b[_0x06b4('0x5e')]);}})[_0x06b4('0x22')](respondWithResult(_0x165a1b,null))[_0x06b4('0x59')](handleError(_0x165a1b,null));};exports['getAnswers']=function(_0x326ed1,_0x589f4d,_0x8725af){var _0x5b52c1={'raw':![],'where':{}};var _0x54505f={};var _0xc8a1c1={'count':0x0,'rows':[]};return db[_0x06b4('0x40')]['findOne']({'where':{'id':_0x326ed1[_0x06b4('0x5b')]['id']}})[_0x06b4('0x22')](handleEntityNotFound(_0x589f4d,null))[_0x06b4('0x22')](function(_0x1e8f99){if(_0x1e8f99){_0x54505f['model']=_['keys'](db['CannedAnswer'][_0x06b4('0x41')]);_0x54505f[_0x06b4('0x44')]=_[_0x06b4('0x45')](_0x326ed1[_0x06b4('0x44')]);_0x54505f[_0x06b4('0x46')]=_[_0x06b4('0x47')](_0x54505f[_0x06b4('0x43')],_0x54505f['query']);_0x5b52c1['attributes']=_['intersection'](_0x54505f[_0x06b4('0x43')],qs[_0x06b4('0x48')](_0x326ed1[_0x06b4('0x44')]['fields']));_0x5b52c1[_0x06b4('0x49')]=_0x5b52c1[_0x06b4('0x49')][_0x06b4('0x4a')]?_0x5b52c1[_0x06b4('0x49')]:_0x54505f[_0x06b4('0x43')];if(!_0x326ed1[_0x06b4('0x44')][_0x06b4('0x4b')](_0x06b4('0x4c'))){_0x5b52c1['limit']=qs[_0x06b4('0x30')](_0x326ed1['query'][_0x06b4('0x30')]);_0x5b52c1[_0x06b4('0x2e')]=qs[_0x06b4('0x2e')](_0x326ed1['query'][_0x06b4('0x2e')]);}_0x5b52c1[_0x06b4('0x4d')]=qs['sort'](_0x326ed1[_0x06b4('0x44')]['sort']);_0x5b52c1[_0x06b4('0x4f')]=qs[_0x06b4('0x46')](_[_0x06b4('0x50')](_0x326ed1['query'],_0x54505f['filters']));_0x5b52c1[_0x06b4('0x4f')]['OpenchannelAccountId']=_0x1e8f99['id'];if(_0x326ed1[_0x06b4('0x44')][_0x06b4('0x51')]){_0x5b52c1['where']=_['merge'](_0x5b52c1[_0x06b4('0x4f')],{'$or':_[_0x06b4('0x3f')](_0x5b52c1['attributes'],function(_0xef2614){var _0x26cd37={};_0x26cd37[_0xef2614]={'$like':'%'+_0x326ed1[_0x06b4('0x44')]['filter']+'%'};return _0x26cd37;})});}_0x5b52c1=_['merge']({},_0x5b52c1,_0x326ed1['options']);return db['CannedAnswer'][_0x06b4('0x31')]({'where':_0x5b52c1[_0x06b4('0x4f')]})[_0x06b4('0x22')](function(_0x3fed8a){_0xc8a1c1[_0x06b4('0x31')]=_0x3fed8a;if(_0x326ed1['query'][_0x06b4('0x56')]){_0x5b52c1[_0x06b4('0x57')]=[{'all':!![]}];}return db[_0x06b4('0x6c')]['findAll'](_0x5b52c1);})['then'](function(_0xfc225a){_0xc8a1c1['rows']=_0xfc225a;return _0xc8a1c1;});}})[_0x06b4('0x22')](respondWithFilteredResult(_0x589f4d,_0x5b52c1))[_0x06b4('0x59')](handleError(_0x589f4d,null));};exports['removeAnswers']=function(_0x2fa82e,_0x1febd2,_0x40d726){return db[_0x06b4('0x40')][_0x06b4('0x5c')]({'where':{'id':_0x2fa82e[_0x06b4('0x5b')]['id']}})[_0x06b4('0x22')](handleEntityNotFound(_0x1febd2,null))[_0x06b4('0x22')](function(_0x2da2c7){if(_0x2da2c7){return _0x2da2c7[_0x06b4('0x6d')](_0x2fa82e[_0x06b4('0x44')][_0x06b4('0x6e')]);}})['then'](respondWithStatusCode(_0x1febd2,null))['catch'](handleError(_0x1febd2,null));};exports[_0x06b4('0x6f')]=function(_0x1c359d,_0x48f05b,_0xdef85){var _0x5ed2fe={'body':_0x1c359d[_0x06b4('0x5e')],'channel':'openchannel'};var _0xac8257=[];var _0x13d927=[];var _0xb1b66e={};var _0x3622d3=![];return db['CmContact'][_0x06b4('0x66')]()['then'](function(_0x490bfd){if(!_0x490bfd){throw new db[(_0x06b4('0x70'))][(_0x06b4('0x71'))](_0x06b4('0x72'));}_0xac8257=_[_0x06b4('0x73')](_['keys'](_0x490bfd),[_0x06b4('0x74'),_0x06b4('0x75')]);_0x13d927=_[_0x06b4('0x73')](_[_0x06b4('0x45')](_0x490bfd),[_0x06b4('0x74'),_0x06b4('0x75'),'CompanyId',_0x06b4('0x76')]);if(_0x1c359d[_0x06b4('0x5e')]['id']){delete _0x1c359d[_0x06b4('0x5e')]['id'];}if(_['isNil'](_0x1c359d[_0x06b4('0x5e')][_0x06b4('0x77')])){throw new db[(_0x06b4('0x70'))][(_0x06b4('0x71'))](_0x06b4('0x78'));}if(_[_0x06b4('0x79')](_0x1c359d['body']['body'])||_0x1c359d[_0x06b4('0x5e')][_0x06b4('0x5e')]===''){throw new db[(_0x06b4('0x70'))][(_0x06b4('0x71'))](_0x06b4('0x7a'));}if(_[_0x06b4('0x79')](_0x1c359d[_0x06b4('0x5e')]['mapKey'])){throw new db['Sequelize'][(_0x06b4('0x71'))](_0x06b4('0x7b')+_0x13d927);}if(!_[_0x06b4('0x7c')](_0x13d927,_0x1c359d[_0x06b4('0x5e')]['mapKey'])){throw new db[(_0x06b4('0x70'))][(_0x06b4('0x71'))](_0x06b4('0x7d')+_0x13d927);}_0xb1b66e[_0x1c359d[_0x06b4('0x5e')][_0x06b4('0x7e')]]=_0x1c359d[_0x06b4('0x5e')]['from'];})[_0x06b4('0x22')](function(){return db['OpenchannelAccount'][_0x06b4('0x5c')]({'where':{'id':_0x1c359d['params']['id']},'include':[{'model':db[_0x06b4('0x7f')],'as':_0x06b4('0x80'),'include':[{'model':db[_0x06b4('0x81')],'as':_0x06b4('0x82'),'where':_0xb1b66e,'limit':0x1,'order':[[_0x06b4('0x75'),_0x06b4('0x83')]]}]},{'model':db['OpenchannelApplication'],'as':_0x06b4('0x84')}]});})[_0x06b4('0x22')](handleEntityNotFound(_0x48f05b,null))[_0x06b4('0x22')](function(_0x5a138c){if(_0x5a138c&&_0x5a138c['List']){_0x5ed2fe['account']=_0x5a138c;_0x5ed2fe['applications']=_0x5a138c['Applications'];_0x5ed2fe['list']=_0x5a138c[_0x06b4('0x80')];_0x5ed2fe[_0x06b4('0x85')]=_[_0x06b4('0x86')](_0x5ed2fe['applications'],[_0x06b4('0x87')],[_0x06b4('0x88')]);if(_0x5ed2fe['account'][_0x06b4('0x84')]){delete _0x5ed2fe['account'][_0x06b4('0x84')];}if(_0x5ed2fe[_0x06b4('0x89')][_0x06b4('0x80')]&&_0x5ed2fe[_0x06b4('0x89')][_0x06b4('0x80')][_0x06b4('0x82')][_0x06b4('0x4a')]){return _0x5ed2fe[_0x06b4('0x89')][_0x06b4('0x80')][_0x06b4('0x82')][0x0];}var _0xc97e8b=_[_0x06b4('0x8a')](_0x1c359d[_0x06b4('0x5e')],{'firstName':_0x1c359d[_0x06b4('0x5e')][_0x06b4('0x77')],'ListId':_0x5a138c[_0x06b4('0x76')]});_0xc97e8b[_0x1c359d[_0x06b4('0x5e')][_0x06b4('0x7e')]]=_0x1c359d['body'][_0x06b4('0x77')];return db[_0x06b4('0x81')][_0x06b4('0x5d')](_0xc97e8b,{'fields':_0xac8257,'raw':!![]});}})[_0x06b4('0x22')](handleEntityNotFound(_0x48f05b,null))[_0x06b4('0x22')](function(_0x2c4b74){_0x5ed2fe['contact']=_0x2c4b74;if(_0x2c4b74){var _0x516891={'ContactId':_0x2c4b74['id'],'OpenchannelAccountId':_0x1c359d['params']['id'],'from':(_0x2c4b74[_0x06b4('0x8b')]||'')+'\x20'+(_0x2c4b74[_0x06b4('0x8c')]||'')};var _0x200ec8={'OpenchannelAccountId':_0x1c359d[_0x06b4('0x5b')]['id'],'closed':![]};if(_0x1c359d[_0x06b4('0x5e')][_0x06b4('0x8d')]){_0x200ec8[_0x06b4('0x8d')]=_0x1c359d[_0x06b4('0x5e')][_0x06b4('0x8d')];return db['OpenchannelInteraction']['find']({'where':_0x200ec8})[_0x06b4('0x22')](function(_0xec4cea){if(_0xec4cea){return[_0xec4cea,![]];}_0x516891[_0x06b4('0x8d')]=_0x1c359d[_0x06b4('0x5e')][_0x06b4('0x8d')];_0x516891[_0x06b4('0x8e')]=_0x1c359d[_0x06b4('0x5e')][_0x06b4('0x8e')];return db[_0x06b4('0x8f')]['create'](_0x516891)['then'](function(_0x3fa462){return[_0x3fa462,!![]];});});}else{_0x200ec8['threadId']=null;}_0x200ec8['ContactId']=_0x2c4b74['id'];return db[_0x06b4('0x8f')][_0x06b4('0x5c')]({'where':_0x200ec8})['then'](function(_0x37e0b1){if(_0x37e0b1){return[_0x37e0b1,![]];}return db['OpenchannelInteraction'][_0x06b4('0x5d')](_0x516891)[_0x06b4('0x22')](function(_0x524afd){return[_0x524afd,!![]];});});}})[_0x06b4('0x90')](function(_0x2214e5,_0x3119c7){if(_0x2214e5){_0x3622d3=_0x3119c7;if(!_0x3119c7){var _0x41bfb5={'from':(_0x5ed2fe['contact']['firstName']||'')+'\x20'+(_0x5ed2fe[_0x06b4('0x91')][_0x06b4('0x8c')]||'')};if(_0x1c359d[_0x06b4('0x5e')]['threadId']&&_0x1c359d[_0x06b4('0x5e')][_0x06b4('0x92')]&&_0x1c359d[_0x06b4('0x5e')][_0x06b4('0x8d')]!=_0x1c359d[_0x06b4('0x5e')][_0x06b4('0x92')]){_0x41bfb5[_0x06b4('0x8d')]=_0x1c359d[_0x06b4('0x5e')]['messageId'];}return _0x2214e5[_0x06b4('0x36')](_0x41bfb5);}else{return _0x2214e5;}}})[_0x06b4('0x22')](function(_0x143e1d){_0x5ed2fe[_0x06b4('0x93')]=_0x143e1d[_0x06b4('0x38')]({'plain':!![]});_0x5ed2fe[_0x06b4('0x93')][_0x06b4('0x94')]=_0x3622d3;if(_0x5ed2fe[_0x06b4('0x93')][_0x06b4('0x94')]){if(_0x5ed2fe[_0x06b4('0x89')][_0x06b4('0x95')]){_0x5ed2fe[_0x06b4('0x85')]['push']({'id':0x0,'priority':_0x5ed2fe[_0x06b4('0x85')][_0x06b4('0x4a')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x06b4('0x96')});}}return db[_0x06b4('0x97')][_0x06b4('0x5d')]({'body':_0x1c359d[_0x06b4('0x5e')][_0x06b4('0x5e')],'OpenchannelAccountId':_0x1c359d[_0x06b4('0x5b')]['id'],'OpenchannelInteractionId':_0x143e1d['id'],'direction':'in','ContactId':_0x5ed2fe[_0x06b4('0x91')]['id'],'AttachmentId':_0x1c359d[_0x06b4('0x5e')][_0x06b4('0x98')]});})[_0x06b4('0x22')](function(_0x30ce9f){_0x5ed2fe[_0x06b4('0x2b')]=_0x30ce9f;if(_0x5ed2fe['interaction'][_0x06b4('0x99')]){return db['User'][_0x06b4('0x5c')]({'attributes':['id',_0x06b4('0x3a')],'where':{'id':_0x5ed2fe[_0x06b4('0x93')]['UserId']}})['then'](function(_0x4d7e85){if(_0x4d7e85){_0x5ed2fe[_0x06b4('0x85')]['unshift']({'id':0x0,'priority':0x0,'app':_0x06b4('0x9a'),'appdata':_0x4d7e85[_0x06b4('0x3a')]+','+(_0x5ed2fe[_0x06b4('0x89')][_0x06b4('0x9b')]||0xa),'interval':_0x06b4('0x96')});_0x5ed2fe[_0x06b4('0x9c')]=![];}return respondWithRpcPromise(_0x06b4('0x9d'),_0x06b4('0x9e'),_0x5ed2fe);});}return respondWithRpcPromise('Start',_0x06b4('0x9e'),_0x5ed2fe);})[_0x06b4('0x22')](function(_0xc4bad2){respondWithRpcPromise('EventManager',_0x06b4('0x9f'),{'event':_0x06b4('0x6f'),'message':_0xc4bad2},client9002);return _0xc4bad2;})['then'](respondWithResult(_0x48f05b,null))[_0x06b4('0x59')](handleError(_0x48f05b,null));};exports[_0x06b4('0xa0')]=function(_0x3b55a0,_0x5c2c43){var _0x548cce=_0x3b55a0[_0x06b4('0x5b')]['id'];var _0x281426=_0x3b55a0['body'];var _0x57c80d=0xc8;var _0x2c862a=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x06b4('0xa1')]['Transaction'][_0x06b4('0xa2')][_0x06b4('0xa3')]},function(_0x5cd033){return db['OpenchannelAccount'][_0x06b4('0x69')]({'where':{'id':_0x548cce},'transaction':_0x5cd033})[_0x06b4('0x22')](function(_0xf6d7cc){if(_0xf6d7cc){return db[_0x06b4('0xa4')][_0x06b4('0x37')]({'where':{'OpenchannelAccountId':_0x548cce},'transaction':_0x5cd033})[_0x06b4('0x22')](function(){var _0x37a872=_['map'](_0x281426,function(_0xe1be4d){_0xe1be4d[_0x06b4('0x67')]=_0x548cce;return _0xe1be4d;});return db[_0x06b4('0xa4')][_0x06b4('0xa5')](_0x37a872,{'transaction':_0x5cd033});});}else{_0x57c80d=0x194;_0x2c862a=[];}});})[_0x06b4('0x22')](function(){if(_0x57c80d!==0x194){return db[_0x06b4('0xa4')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x548cce},'order':'priority'})[_0x06b4('0x22')](function(_0x47971c){_0x2c862a=_0x47971c;});}})['catch'](function(_0x2afd2c){_0x57c80d=0x1f4;logger[_0x06b4('0x29')](_0x2afd2c[_0x06b4('0xa6')]);if(_0x2afd2c[_0x06b4('0x3a')]){delete _0x2afd2c[_0x06b4('0x3a')];}_0x2c862a=_0x2afd2c;})[_0x06b4('0xa7')](function(){if(_0x2c862a===null){_0x5c2c43[_0x06b4('0x39')](_0x57c80d);}else{if(_0x57c80d===0x1f4){_0x5c2c43[_0x06b4('0x2c')](_0x57c80d)[_0x06b4('0x3b')](_0x2c862a);}else{_0x5c2c43[_0x06b4('0x2c')](_0x57c80d)[_0x06b4('0x33')](_0x2c862a);}}});};exports['getApplications']=function(_0x45f95e,_0x558e87,_0x18e33d){var _0x27384a={};var _0x17ea5c={};var _0xa82242;var _0x5660d1;return db[_0x06b4('0x40')][_0x06b4('0x69')]({'where':{'id':_0x45f95e[_0x06b4('0x5b')]['id']}})[_0x06b4('0x22')](handleEntityNotFound(_0x558e87,null))[_0x06b4('0x22')](function(_0x188ca2){if(_0x188ca2){_0xa82242=_0x188ca2;_0x17ea5c['model']=_[_0x06b4('0x45')](db[_0x06b4('0xa4')][_0x06b4('0x41')]);_0x17ea5c[_0x06b4('0x44')]=_[_0x06b4('0x45')](_0x45f95e[_0x06b4('0x44')]);_0x17ea5c[_0x06b4('0x46')]=_[_0x06b4('0x47')](_0x17ea5c['model'],_0x17ea5c[_0x06b4('0x44')]);_0x27384a[_0x06b4('0x49')]=_['intersection'](_0x17ea5c['model'],qs[_0x06b4('0x48')](_0x45f95e[_0x06b4('0x44')][_0x06b4('0x48')]));_0x27384a['attributes']=_0x27384a[_0x06b4('0x49')][_0x06b4('0x4a')]?_0x27384a['attributes']:_0x17ea5c['model'];_0x27384a['order']=qs[_0x06b4('0x4e')](_0x45f95e[_0x06b4('0x44')][_0x06b4('0x4e')]);_0x27384a['where']=qs['filters'](_[_0x06b4('0x50')](_0x45f95e[_0x06b4('0x44')],_0x17ea5c[_0x06b4('0x46')]));if(_0x45f95e[_0x06b4('0x44')][_0x06b4('0x51')]){_0x27384a[_0x06b4('0x4f')]=_['merge'](_0x27384a['where'],{'$or':_[_0x06b4('0x3f')](_0x27384a['attributes'],function(_0xd3456e){var _0x3bb919={};_0x3bb919[_0xd3456e]={'$like':'%'+_0x45f95e[_0x06b4('0x44')][_0x06b4('0x51')]+'%'};return _0x3bb919;})});}_0x27384a=_[_0x06b4('0x54')]({},_0x27384a,_0x45f95e['options']);return _0xa82242[_0x06b4('0xa8')](_0x27384a);}})[_0x06b4('0x22')](function(_0x3e5304){if(_0x3e5304){_0x5660d1=_0x3e5304[_0x06b4('0x4a')];if(!_0x45f95e[_0x06b4('0x44')][_0x06b4('0x4b')](_0x06b4('0x4c'))){_0x27384a[_0x06b4('0x30')]=qs['limit'](_0x45f95e[_0x06b4('0x44')][_0x06b4('0x30')]);_0x27384a['offset']=qs[_0x06b4('0x2e')](_0x45f95e[_0x06b4('0x44')]['offset']);}return _0xa82242['getApplications'](_0x27384a);}})['then'](function(_0x32d2db){if(_0x32d2db){return _0x32d2db?{'count':_0x5660d1,'rows':_0x32d2db}:null;}})[_0x06b4('0x22')](respondWithResult(_0x558e87,null))[_0x06b4('0x59')](handleError(_0x558e87,null));};exports[_0x06b4('0xa9')]=function(_0x31cb81,_0x269fd8,_0x4fd6d2){var _0x57d828={'raw':![],'where':{}};var _0x35184a={};var _0x4ab00c={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x06b4('0x69')]({'where':{'id':_0x31cb81[_0x06b4('0x5b')]['id']}})[_0x06b4('0x22')](handleEntityNotFound(_0x269fd8,null))['then'](function(_0x5e5bcd){if(_0x5e5bcd){_0x35184a[_0x06b4('0x43')]=_[_0x06b4('0x45')](db[_0x06b4('0x8f')][_0x06b4('0x41')]);_0x35184a['query']=_[_0x06b4('0x45')](_0x31cb81[_0x06b4('0x44')]);_0x35184a[_0x06b4('0x46')]=_[_0x06b4('0x47')](_0x35184a['model'],_0x35184a[_0x06b4('0x44')]);_0x57d828['attributes']=_[_0x06b4('0x47')](_0x35184a['model'],qs['fields'](_0x31cb81[_0x06b4('0x44')][_0x06b4('0x48')]));_0x57d828['attributes']=_0x57d828[_0x06b4('0x49')]['length']?_0x57d828[_0x06b4('0x49')]:_0x35184a[_0x06b4('0x43')];if(!_0x31cb81['query'][_0x06b4('0x4b')](_0x06b4('0x4c'))){_0x57d828[_0x06b4('0x30')]=qs[_0x06b4('0x30')](_0x31cb81[_0x06b4('0x44')]['limit']);_0x57d828[_0x06b4('0x2e')]=qs[_0x06b4('0x2e')](_0x31cb81[_0x06b4('0x44')][_0x06b4('0x2e')]);}_0x57d828[_0x06b4('0x4d')]=qs[_0x06b4('0x4e')](_0x31cb81[_0x06b4('0x44')][_0x06b4('0x4e')]);_0x57d828[_0x06b4('0x4f')]=qs[_0x06b4('0x46')](_[_0x06b4('0x50')](_0x31cb81[_0x06b4('0x44')],_0x35184a[_0x06b4('0x46')]));_0x57d828[_0x06b4('0x4f')][_0x06b4('0x67')]=_0x5e5bcd['id'];if(_0x31cb81[_0x06b4('0x44')][_0x06b4('0x51')]){_0x57d828[_0x06b4('0x4f')]=_[_0x06b4('0x54')](_0x57d828[_0x06b4('0x4f')],{'$or':_[_0x06b4('0x3f')](_0x57d828[_0x06b4('0x49')],function(_0x407cca){var _0xfa57ee={};_0xfa57ee[_0x407cca]={'$like':'%'+_0x31cb81['query']['filter']+'%'};return _0xfa57ee;})});}_0x57d828=_['merge']({},_0x57d828,_0x31cb81['options']);return db[_0x06b4('0x8f')][_0x06b4('0x31')]({'where':_0x57d828['where']})['then'](function(_0xd9f5ab){_0x4ab00c[_0x06b4('0x31')]=_0xd9f5ab;if(_0x31cb81['query'][_0x06b4('0x56')]){_0x57d828[_0x06b4('0x57')]=[{'model':db[_0x06b4('0x81')],'as':_0x06b4('0xaa'),'required':![]},{'model':db[_0x06b4('0xab')],'as':_0x06b4('0xac'),'attributes':['name',_0x06b4('0xad'),_0x06b4('0xae')],'required':![]},{'model':db[_0x06b4('0xaf')],'as':_0x06b4('0xb0'),'attributes':['id',_0x06b4('0x3a'),_0x06b4('0xb1')],'where':_0x31cb81['query'][_0x06b4('0xb2')]?{'id':_0x31cb81['query'][_0x06b4('0xb2')]}:undefined,'required':_0x31cb81[_0x06b4('0x44')]['tag']?!![]:![]}];}return db['OpenchannelInteraction']['findAll'](_0x57d828);})['then'](function(_0x391c43){_0x4ab00c[_0x06b4('0xb3')]=_0x391c43;return _0x4ab00c;});}})[_0x06b4('0x22')](respondWithFilteredResult(_0x269fd8,_0x57d828))['catch'](handleError(_0x269fd8,null));};exports[_0x06b4('0xb4')]=function(_0x4521d9,_0x4b68ea,_0xf5087a){return db[_0x06b4('0x40')]['find']({'where':{'id':_0x4521d9['params']['id']}})['then'](handleEntityNotFound(_0x4b68ea,null))[_0x06b4('0x22')](function(_0x3364c8){if(_0x3364c8){return _0x3364c8[_0x06b4('0xb4')](_0x4521d9['body'][_0x06b4('0x6e')],_[_0x06b4('0xb5')](_0x4521d9[_0x06b4('0x5e')],[_0x06b4('0x6e'),'id'])||{})['spread'](function(_0xca6616){for(var _0x25d38b=0x0;_0x25d38b<_0x4521d9[_0x06b4('0x5e')]['ids']['length'];_0x25d38b+=0x1){socket[_0x06b4('0xb6')](_0x06b4('0xb7'),{'UserId':Number(_0x4521d9['body'][_0x06b4('0x6e')][_0x25d38b]),'OpenchannelAccountId':Number(_0x4521d9[_0x06b4('0x5b')]['id'])});}return _0xca6616;});}})[_0x06b4('0x22')](respondWithResult(_0x4b68ea,null))[_0x06b4('0x59')](handleError(_0x4b68ea,null));};exports[_0x06b4('0xb8')]=function(_0x545900,_0x5d0e9f,_0x4b885e){return db[_0x06b4('0x40')][_0x06b4('0x5c')]({'where':{'id':_0x545900['params']['id']}})['then'](handleEntityNotFound(_0x5d0e9f,null))['then'](function(_0xb697d){if(_0xb697d){return _0xb697d[_0x06b4('0xb8')](_0x545900['query'][_0x06b4('0x6e')])[_0x06b4('0x22')](function(){if(_[_0x06b4('0xb9')](_0x545900[_0x06b4('0x44')][_0x06b4('0x6e')])){for(var _0x47384f=0x0;_0x47384f<_0x545900['query']['ids'][_0x06b4('0x4a')];_0x47384f+=0x1){socket[_0x06b4('0xb6')]('userOpenchannelAccount:remove',{'UserId':Number(_0x545900['query'][_0x06b4('0x6e')][_0x47384f]),'OpenchannelAccountId':Number(_0x545900[_0x06b4('0x5b')]['id'])});}}else{socket['emit'](_0x06b4('0xba'),{'UserId':Number(_0x545900[_0x06b4('0x44')][_0x06b4('0x6e')]),'OpenchannelAccountId':Number(_0x545900[_0x06b4('0x5b')]['id'])});}});}})['then'](respondWithStatusCode(_0x5d0e9f,null))[_0x06b4('0x59')](handleError(_0x5d0e9f,null));};exports['getAgents']=function(_0x105a22,_0x3f783d,_0x2ba89c){var _0x4a5bc7={};var _0x4ae4b6={};var _0x2f7bf6;var _0x351509;return db[_0x06b4('0x40')][_0x06b4('0x69')]({'where':{'id':_0x105a22[_0x06b4('0x5b')]['id']}})[_0x06b4('0x22')](handleEntityNotFound(_0x3f783d,null))[_0x06b4('0x22')](function(_0x1b5776){if(_0x1b5776){_0x2f7bf6=_0x1b5776;_0x4ae4b6[_0x06b4('0x43')]=_[_0x06b4('0x45')](db['User'][_0x06b4('0x41')]);_0x4ae4b6['query']=_[_0x06b4('0x45')](_0x105a22[_0x06b4('0x44')]);_0x4ae4b6[_0x06b4('0x46')]=_[_0x06b4('0x47')](_0x4ae4b6[_0x06b4('0x43')],_0x4ae4b6[_0x06b4('0x44')]);_0x4a5bc7[_0x06b4('0x49')]=_[_0x06b4('0x47')](_0x4ae4b6[_0x06b4('0x43')],qs[_0x06b4('0x48')](_0x105a22['query'][_0x06b4('0x48')]));_0x4a5bc7[_0x06b4('0x49')]=_0x4a5bc7[_0x06b4('0x49')][_0x06b4('0x4a')]?_0x4a5bc7[_0x06b4('0x49')]:_0x4ae4b6[_0x06b4('0x43')];_0x4a5bc7[_0x06b4('0x4d')]=qs[_0x06b4('0x4e')](_0x105a22[_0x06b4('0x44')][_0x06b4('0x4e')]);_0x4a5bc7[_0x06b4('0x4f')]=qs[_0x06b4('0x46')](_[_0x06b4('0x50')](_0x105a22[_0x06b4('0x44')],_0x4ae4b6[_0x06b4('0x46')]));if(_0x105a22[_0x06b4('0x44')][_0x06b4('0x51')]){_0x4a5bc7[_0x06b4('0x4f')]=_[_0x06b4('0x54')](_0x4a5bc7[_0x06b4('0x4f')],{'$or':_[_0x06b4('0x3f')](_0x4a5bc7[_0x06b4('0x49')],function(_0x48f3ac){var _0x252baf={};_0x252baf[_0x48f3ac]={'$like':'%'+_0x105a22[_0x06b4('0x44')]['filter']+'%'};return _0x252baf;})});}_0x4a5bc7=_[_0x06b4('0x54')]({},_0x4a5bc7,_0x105a22[_0x06b4('0x55')]);return _0x2f7bf6[_0x06b4('0xbb')](_0x4a5bc7);}})['then'](function(_0x42b9af){if(_0x42b9af){_0x351509=_0x42b9af[_0x06b4('0x4a')];if(!_0x105a22[_0x06b4('0x44')][_0x06b4('0x4b')]('nolimit')){_0x4a5bc7[_0x06b4('0x30')]=qs['limit'](_0x105a22['query']['limit']);_0x4a5bc7['offset']=qs['offset'](_0x105a22[_0x06b4('0x44')][_0x06b4('0x2e')]);}return _0x2f7bf6[_0x06b4('0xbb')](_0x4a5bc7);}})[_0x06b4('0x22')](function(_0x493347){if(_0x493347){return _0x493347?{'count':_0x351509,'rows':_0x493347}:null;}})[_0x06b4('0x22')](respondWithResult(_0x3f783d,null))[_0x06b4('0x59')](handleError(_0x3f783d,null));};exports[_0x06b4('0x3b')]=function(_0x19489f,_0x241ffa,_0x59b2ea){var _0x4da2cf,_0xba4b92,_0x12897d;if(_[_0x06b4('0x79')](_0x19489f['body']['body'])||_0x19489f[_0x06b4('0x5e')][_0x06b4('0x5e')]===''){throw new db[(_0x06b4('0x70'))][(_0x06b4('0x71'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x06b4('0x79')](_0x19489f['body']['to'])){}_0x4da2cf=_0x19489f[_0x06b4('0x5e')]['to'];return db[_0x06b4('0x40')][_0x06b4('0x69')]({'where':{'id':_0x19489f[_0x06b4('0x5b')]['id']}})[_0x06b4('0x22')](handleEntityNotFound(_0x241ffa,null))['then'](function(_0x2c2bc9){if(_0x2c2bc9){return db[_0x06b4('0x40')][_0x06b4('0x5c')]({'where':{'id':_0x2c2bc9['id']},'include':[{'model':db[_0x06b4('0x7f')],'as':_0x06b4('0x80'),'include':[{'model':db[_0x06b4('0x81')],'as':_0x06b4('0x82'),'where':{[_0x2c2bc9['mapKey']]:_0x4da2cf},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x06b4('0x22')](handleEntityNotFound(_0x241ffa,null))[_0x06b4('0x22')](function(_0x3fc9c5){if(_0x3fc9c5&&_0x3fc9c5[_0x06b4('0x80')]){_0xba4b92=_0x3fc9c5[_0x06b4('0x38')]({'plain':!![]});if(_0xba4b92['List']&&_0xba4b92[_0x06b4('0x80')]['Contacts']['length']){return _0xba4b92['List'][_0x06b4('0x82')][0x0];}return db[_0x06b4('0x81')][_0x06b4('0x5d')](_[_0x06b4('0x8a')](_0x19489f[_0x06b4('0x5e')],{'firstName':_0x4da2cf,[_0x3fc9c5['mapKey']]:_0x4da2cf,'phone':_0x4da2cf,'ListId':_0xba4b92[_0x06b4('0x76')]}));}})[_0x06b4('0x22')](handleEntityNotFound(_0x241ffa,null))[_0x06b4('0x22')](function(_0x450ce5){if(_0x450ce5){_0x12897d=_0x450ce5;return db[_0x06b4('0x8f')][_0x06b4('0x5c')]({'where':{'ContactId':_0x12897d['id'],'closed':![],'OpenchannelAccountId':_0xba4b92['id']}})[_0x06b4('0x22')](function(_0x1d05c1){if(_0x1d05c1){return[_0x1d05c1,![]];}return db[_0x06b4('0x8f')][_0x06b4('0x5d')]({'UserId':_0x19489f[_0x06b4('0x5f')]['id'],'ContactId':_0x12897d['id'],'OpenchannelAccountId':_0xba4b92['id'],'lastMsgDirection':_0x06b4('0xbc'),'Messages':[_[_0x06b4('0x54')](_0x19489f['body'],{'read':![],'body':_0x19489f[_0x06b4('0x5e')][_0x06b4('0x5e')],'OpenchannelAccountId':_0xba4b92['id'],'UserId':_0x19489f[_0x06b4('0x5f')]['id'],'ContactId':_0x12897d['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x06b4('0xbd')}]})['then'](function(_0x1d7562){return[_0x1d7562,!![]];});});}})['spread'](function(_0x4c866c,_0x186af5){if(_0x186af5){return _0x4c866c;}return db[_0x06b4('0x97')]['create'](_['merge'](_0x19489f[_0x06b4('0x5e')],{'read':![],'body':_0x19489f[_0x06b4('0x5e')][_0x06b4('0x5e')],'OpenchannelAccountId':_0xba4b92['id'],'OpenchannelInteractionId':_0x4c866c['id'],'UserId':_0x19489f[_0x06b4('0x5f')]['id'],'ContactId':_0x12897d['id']}))[_0x06b4('0x22')](function(_0x2ebc65){_0x4c866c[_0x06b4('0xbe')][_0x06b4('0xbd')]=[];_0x4c866c['dataValues'][_0x06b4('0xbd')][_0x06b4('0xbf')](_0x2ebc65['dataValues']);return _0x4c866c;});});}})[_0x06b4('0x22')](respondWithResult(_0x241ffa,null))[_0x06b4('0x59')](handleError(_0x241ffa,null));};
\ No newline at end of file
index d642ee3..c0fb477 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ea3=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelAccount','setMaxListeners','update'];(function(_0x253f61,_0x1ccb64){var _0x1c0c12=function(_0x2a01c8){while(--_0x2a01c8){_0x253f61['push'](_0x253f61['shift']());}};_0x1c0c12(++_0x1ccb64);}(_0x4ea3,0x70));var _0x34ea=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x4ea3[_0x501510];return _0x1e6ee5;};'use strict';var EventEmitter=require(_0x34ea('0x0'));var OpenchannelAccount=require(_0x34ea('0x1'))['db'][_0x34ea('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x34ea('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x34ea('0x4'),'afterDestroy':'remove'};function emitEvent(_0x269d4c){return function(_0x571f1b,_0x5e5a84,_0x2ce955){OpenchannelAccountEvents[_0x34ea('0x5')](_0x269d4c+':'+_0x571f1b['id'],_0x571f1b);OpenchannelAccountEvents[_0x34ea('0x5')](_0x269d4c,_0x571f1b);_0x2ce955(null);};}for(var e in events){if(events[_0x34ea('0x6')](e)){var event=events[e];OpenchannelAccount[_0x34ea('0x7')](e,emitEvent(event));}}module[_0x34ea('0x8')]=OpenchannelAccountEvents;
\ No newline at end of file
+var _0x9348=['../../mysqldb','OpenchannelAccount','setMaxListeners','save','remove','emit','hasOwnProperty','hook','events'];(function(_0x3a7cd9,_0x2efead){var _0x3abab5=function(_0x4820d7){while(--_0x4820d7){_0x3a7cd9['push'](_0x3a7cd9['shift']());}};_0x3abab5(++_0x2efead);}(_0x9348,0x10d));var _0x8934=function(_0x36f58b,_0x2e27b3){_0x36f58b=_0x36f58b-0x0;var _0x10ebaa=_0x9348[_0x36f58b];return _0x10ebaa;};'use strict';var EventEmitter=require(_0x8934('0x0'));var OpenchannelAccount=require(_0x8934('0x1'))['db'][_0x8934('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x8934('0x3')](0x0);var events={'afterCreate':_0x8934('0x4'),'afterUpdate':'update','afterDestroy':_0x8934('0x5')};function emitEvent(_0x35da0b){return function(_0x5f34d7,_0x34f94c,_0x923aa3){OpenchannelAccountEvents[_0x8934('0x6')](_0x35da0b+':'+_0x5f34d7['id'],_0x5f34d7);OpenchannelAccountEvents[_0x8934('0x6')](_0x35da0b,_0x5f34d7);_0x923aa3(null);};}for(var e in events){if(events[_0x8934('0x7')](e)){var event=events[e];OpenchannelAccount[_0x8934('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents;
\ No newline at end of file
index 143aa2c..b558976 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(_0x1ed2e5,_0x3cdb68){var _0x13be96=function(_0x3e70a5){while(--_0x3e70a5){_0x1ed2e5['push'](_0x1ed2e5['shift']());}};_0x13be96(++_0x3cdb68);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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(_0x18f20d,_0x277751){var _0x393245=function(_0x1a1809){while(--_0x1a1809){_0x18f20d['push'](_0x18f20d['shift']());}};_0x393245(++_0x277751);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5e3eea9..ab777a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4af8=['request','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','defaults','redis','./openchannelAccount.socket'];(function(_0x30c81e,_0x45156e){var _0x53a5a1=function(_0x24ac75){while(--_0x24ac75){_0x30c81e['push'](_0x30c81e['shift']());}};_0x53a5a1(++_0x45156e);}(_0x4af8,0x1ad));var _0x84af=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0x4af8[_0x34021d];return _0x16597b;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x84af('0x0'));var fs=require('fs');var Redis=require(_0x84af('0x1'));var db=require(_0x84af('0x2'))['db'];var utils=require(_0x84af('0x3'));var logger=require('../../config/logger')(_0x84af('0x4'));var config=require(_0x84af('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x84af('0x6')][_0x84af('0x7')]({'port':0x232a});config['redis']=_[_0x84af('0x8')](config[_0x84af('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x84af('0x9')]));require(_0x84af('0xa'))['register'](socket);function respondWithRpcPromise(_0xc9f91b,_0x535556,_0x1623f6){return new BPromise(function(_0x21e634,_0x34aa9e){return client[_0x84af('0xb')](_0xc9f91b,_0x1623f6)['then'](function(_0x31f283){logger['info'](_0x84af('0xc'),_0x535556,_0x84af('0xd'));logger['debug'](_0x84af('0xe'),_0x535556,_0x84af('0xd'),JSON[_0x84af('0xf')](_0x31f283));if(_0x31f283[_0x84af('0x10')]){if(_0x31f283['error'][_0x84af('0x11')]===0x1f4){logger['error'](_0x84af('0xc'),_0x535556,_0x31f283[_0x84af('0x10')]['message']);return _0x34aa9e(_0x31f283[_0x84af('0x10')][_0x84af('0x12')]);}logger['error'](_0x84af('0xc'),_0x535556,_0x31f283['error'][_0x84af('0x12')]);return _0x21e634(_0x31f283[_0x84af('0x10')]['message']);}else{logger['info'](_0x84af('0xc'),_0x535556,_0x84af('0xd'));_0x21e634(_0x31f283[_0x84af('0x13')]['message']);}})['catch'](function(_0x187195){logger[_0x84af('0x10')](_0x84af('0xc'),_0x535556,_0x187195);_0x34aa9e(_0x187195);});});}
\ No newline at end of file
+var _0x39cb=['../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','util','moment','randomstring','ioredis','../../config/utils'];(function(_0x18afca,_0x4219d9){var _0x11603f=function(_0x21d5d1){while(--_0x21d5d1){_0x18afca['push'](_0x18afca['shift']());}};_0x11603f(++_0x4219d9);}(_0x39cb,0x1bd));var _0xb39c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x39cb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xb39c('0x0'));var moment=require(_0xb39c('0x1'));var BPromise=require('bluebird');var rs=require(_0xb39c('0x2'));var fs=require('fs');var Redis=require(_0xb39c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb39c('0x4'));var logger=require(_0xb39c('0x5'))(_0xb39c('0x6'));var config=require(_0xb39c('0x7'));var jayson=require(_0xb39c('0x8'));var client=jayson['client'][_0xb39c('0x9')]({'port':0x232a});config[_0xb39c('0xa')]=_[_0xb39c('0xb')](config[_0xb39c('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb39c('0xa')]));require(_0xb39c('0xc'))[_0xb39c('0xd')](socket);function respondWithRpcPromise(_0x42c6dc,_0x5402b2,_0x4a6f36){return new BPromise(function(_0x5a0dba,_0x1de94f){return client[_0xb39c('0xe')](_0x42c6dc,_0x4a6f36)[_0xb39c('0xf')](function(_0x1088ee){logger[_0xb39c('0x10')](_0xb39c('0x11'),_0x5402b2,_0xb39c('0x12'));logger[_0xb39c('0x13')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x5402b2,_0xb39c('0x12'),JSON[_0xb39c('0x14')](_0x1088ee));if(_0x1088ee[_0xb39c('0x15')]){if(_0x1088ee['error'][_0xb39c('0x16')]===0x1f4){logger[_0xb39c('0x15')](_0xb39c('0x11'),_0x5402b2,_0x1088ee[_0xb39c('0x15')][_0xb39c('0x17')]);return _0x1de94f(_0x1088ee[_0xb39c('0x15')][_0xb39c('0x17')]);}logger['error'](_0xb39c('0x11'),_0x5402b2,_0x1088ee[_0xb39c('0x15')][_0xb39c('0x17')]);return _0x5a0dba(_0x1088ee[_0xb39c('0x15')][_0xb39c('0x17')]);}else{logger[_0xb39c('0x10')](_0xb39c('0x11'),_0x5402b2,_0xb39c('0x12'));_0x5a0dba(_0x1088ee[_0xb39c('0x18')][_0xb39c('0x17')]);}})['catch'](function(_0x1d2f49){logger[_0xb39c('0x15')](_0xb39c('0x11'),_0x5402b2,_0x1d2f49);_0x1de94f(_0x1d2f49);});});}
\ No newline at end of file
index 4148d45..6d2eab5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b87=['remove','update','emit','removeListener','register','length','./openchannelAccount.events','save'];(function(_0x5210cc,_0x1962b3){var _0x3cd900=function(_0x5532eb){while(--_0x5532eb){_0x5210cc['push'](_0x5210cc['shift']());}};_0x3cd900(++_0x1962b3);}(_0x9b87,0x8e));var _0x79b8=function(_0x299979,_0x241cd0){_0x299979=_0x299979-0x0;var _0x139587=_0x9b87[_0x299979];return _0x139587;};'use strict';var OpenchannelAccountEvents=require(_0x79b8('0x0'));var events=[_0x79b8('0x1'),_0x79b8('0x2'),_0x79b8('0x3')];function createListener(_0x77ad5c,_0x4386a6){return function(_0x23b645){_0x4386a6[_0x79b8('0x4')](_0x77ad5c,_0x23b645);};}function removeListener(_0xbc1e74,_0xa65bbc){return function(){OpenchannelAccountEvents[_0x79b8('0x5')](_0xbc1e74,_0xa65bbc);};}exports[_0x79b8('0x6')]=function(_0x3ccc53){for(var _0x2e21b9=0x0,_0x1d2c9f=events[_0x79b8('0x7')];_0x2e21b9<_0x1d2c9f;_0x2e21b9++){var _0x5e10fe=events[_0x2e21b9];var _0x4e0dd8=createListener('openchannelAccount:'+_0x5e10fe,_0x3ccc53);OpenchannelAccountEvents['on'](_0x5e10fe,_0x4e0dd8);}};
\ No newline at end of file
+var _0x8db0=['register','length','openchannelAccount:','./openchannelAccount.events','save','update','emit'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8db0,0x65));var _0x08db=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x8db0[_0x138adb];return _0x1b27f2;};'use strict';var OpenchannelAccountEvents=require(_0x08db('0x0'));var events=[_0x08db('0x1'),'remove',_0x08db('0x2')];function createListener(_0x2ac694,_0x17ccf3){return function(_0x5eb423){_0x17ccf3[_0x08db('0x3')](_0x2ac694,_0x5eb423);};}function removeListener(_0x55e572,_0x4f4614){return function(){OpenchannelAccountEvents['removeListener'](_0x55e572,_0x4f4614);};}exports[_0x08db('0x4')]=function(_0x55af6b){for(var _0x14b0e6=0x0,_0x528139=events[_0x08db('0x5')];_0x14b0e6<_0x528139;_0x14b0e6++){var _0x1ca3d1=events[_0x14b0e6];var _0x16bcc0=createListener(_0x08db('0x6')+_0x1ca3d1,_0x55af6b);OpenchannelAccountEvents['on'](_0x1ca3d1,_0x16bcc0);}};
\ No newline at end of file
index 669d8f4..81ba2ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c2b=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','multer'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x6c2b,0xc7));var _0xb6c2=function(_0xd8a8af,_0x1e93f0){_0xd8a8af=_0xd8a8af-0x0;var _0x5b7278=_0x6c2b[_0xd8a8af];return _0x5b7278;};'use strict';var multer=require(_0xb6c2('0x0'));var util=require(_0xb6c2('0x1'));var path=require(_0xb6c2('0x2'));var timeout=require(_0xb6c2('0x3'));var express=require(_0xb6c2('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb6c2('0x5'));var interaction=require(_0xb6c2('0x6'));var config=require(_0xb6c2('0x7'));var controller=require(_0xb6c2('0x8'));router[_0xb6c2('0x9')]('/',auth['isAuthenticated'](),controller[_0xb6c2('0xa')]);router[_0xb6c2('0x9')](_0xb6c2('0xb'),auth[_0xb6c2('0xc')](),controller[_0xb6c2('0xd')]);router[_0xb6c2('0xe')]('/',auth[_0xb6c2('0xc')](),controller[_0xb6c2('0xf')]);router[_0xb6c2('0x10')](_0xb6c2('0xb'),auth[_0xb6c2('0xc')](),controller[_0xb6c2('0x11')]);router[_0xb6c2('0x12')](_0xb6c2('0xb'),auth['isAuthenticated'](),controller[_0xb6c2('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x28ef=['isAuthenticated','index','/:id','create','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get'];(function(_0x56c95c,_0x249f81){var _0x42079e=function(_0x5ad4b2){while(--_0x5ad4b2){_0x56c95c['push'](_0x56c95c['shift']());}};_0x42079e(++_0x249f81);}(_0x28ef,0x1c9));var _0xf28e=function(_0x5be4a8,_0x4af128){_0x5be4a8=_0x5be4a8-0x0;var _0x4087ea=_0x28ef[_0x5be4a8];return _0x4087ea;};'use strict';var multer=require(_0xf28e('0x0'));var util=require(_0xf28e('0x1'));var path=require(_0xf28e('0x2'));var timeout=require(_0xf28e('0x3'));var express=require('express');var router=express[_0xf28e('0x4')]();var fs_extra=require(_0xf28e('0x5'));var auth=require(_0xf28e('0x6'));var interaction=require(_0xf28e('0x7'));var config=require(_0xf28e('0x8'));var controller=require(_0xf28e('0x9'));router[_0xf28e('0xa')]('/',auth[_0xf28e('0xb')](),controller[_0xf28e('0xc')]);router[_0xf28e('0xa')](_0xf28e('0xd'),auth[_0xf28e('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xf28e('0xe')]);router[_0xf28e('0xf')](_0xf28e('0xd'),auth[_0xf28e('0xb')](),controller[_0xf28e('0x10')]);router['delete']('/:id',auth[_0xf28e('0xb')](),controller['destroy']);module[_0xf28e('0x11')]=router;
\ No newline at end of file
index cb8959e..9eb3226 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a8d=['TEXT','sequelize','exports','STRING','noop'];(function(_0x3873ab,_0x152776){var _0x42f6ed=function(_0x189425){while(--_0x189425){_0x3873ab['push'](_0x3873ab['shift']());}};_0x42f6ed(++_0x152776);}(_0x7a8d,0x114));var _0xd7a8=function(_0xc69c1a,_0x1e81c7){_0xc69c1a=_0xc69c1a-0x0;var _0x5e92e2=_0x7a8d[_0xc69c1a];return _0x5e92e2;};'use strict';var Sequelize=require(_0xd7a8('0x0'));module[_0xd7a8('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xd7a8('0x2')],'allowNull':![],'defaultValue':_0xd7a8('0x3')},'appdata':{'type':Sequelize[_0xd7a8('0x4')]()},'description':{'type':Sequelize[_0xd7a8('0x2')]},'interval':{'type':Sequelize[_0xd7a8('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xef18=['*,*,*,*','sequelize','exports','STRING','noop','TEXT'];(function(_0x53cddb,_0x82243a){var _0x3ec5fb=function(_0x3108a5){while(--_0x3108a5){_0x53cddb['push'](_0x53cddb['shift']());}};_0x3ec5fb(++_0x82243a);}(_0xef18,0xe5));var _0x8ef1=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0xef18[_0x172747];return _0x509692;};'use strict';var Sequelize=require(_0x8ef1('0x0'));module[_0x8ef1('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x8ef1('0x2')],'allowNull':![],'defaultValue':_0x8ef1('0x3')},'appdata':{'type':Sequelize[_0x8ef1('0x4')]()},'description':{'type':Sequelize[_0x8ef1('0x2')]},'interval':{'type':Sequelize[_0x8ef1('0x2')],'defaultValue':_0x8ef1('0x5')}};
\ No newline at end of file
index 20d7401..dd13c7c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d96=['../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','OpenchannelApplication','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','length','options','create','body','find','zip-dir','fast-json-patch','request-promise','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'];(function(_0x4aa5b2,_0xfb9913){var _0x1d8f77=function(_0x1a5609){while(--_0x1a5609){_0x4aa5b2['push'](_0x4aa5b2['shift']());}};_0x1d8f77(++_0xfb9913);}(_0x1d96,0x7f));var _0x61d9=function(_0x5d8ace,_0x111a34){_0x5d8ace=_0x5d8ace-0x0;var _0xd2034e=_0x1d96[_0x5d8ace];return _0xd2034e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x61d9('0x0'));var jsonpatch=require(_0x61d9('0x1'));var rp=require(_0x61d9('0x2'));var moment=require('moment');var BPromise=require(_0x61d9('0x3'));var Mustache=require(_0x61d9('0x4'));var util=require('util');var path=require(_0x61d9('0x5'));var sox=require(_0x61d9('0x6'));var csv=require(_0x61d9('0x7'));var ejs=require(_0x61d9('0x8'));var fs=require('fs');var fs_extra=require(_0x61d9('0x9'));var _=require(_0x61d9('0xa'));var squel=require(_0x61d9('0xb'));var crypto=require(_0x61d9('0xc'));var jsforce=require(_0x61d9('0xd'));var deskjs=require(_0x61d9('0xe'));var toCsv=require(_0x61d9('0x7'));var querystring=require(_0x61d9('0xf'));var Papa=require(_0x61d9('0x10'));var Redis=require('ioredis');var authService=require(_0x61d9('0x11'));var qs=require(_0x61d9('0x12'));var as=require(_0x61d9('0x13'));var hardwareService=require(_0x61d9('0x14'));var logger=require(_0x61d9('0x15'))(_0x61d9('0x16'));var utils=require(_0x61d9('0x17'));var config=require(_0x61d9('0x18'));var licenseUtil=require(_0x61d9('0x19'));var db=require(_0x61d9('0x1a'))['db'];function respondWithStatusCode(_0x4c17be,_0xe88218){_0xe88218=_0xe88218||0xcc;return function(_0x4a36f3){if(_0x4a36f3){return _0x4c17be[_0x61d9('0x1b')](_0xe88218);}return _0x4c17be[_0x61d9('0x1c')](_0xe88218)['end']();};}function respondWithResult(_0x3b8c91,_0x4de125){_0x4de125=_0x4de125||0xc8;return function(_0xe435a3){if(_0xe435a3){return _0x3b8c91['status'](_0x4de125)['json'](_0xe435a3);}};}function respondWithFilteredResult(_0x20c57c,_0x8fecaf){return function(_0x4aa7e4){if(_0x4aa7e4){var _0x1afaa4=typeof _0x8fecaf[_0x61d9('0x1d')]===_0x61d9('0x1e')&&typeof _0x8fecaf['limit']===_0x61d9('0x1e');var _0x40551=_0x4aa7e4[_0x61d9('0x1f')];var _0x381524=_0x1afaa4?0x0:_0x8fecaf[_0x61d9('0x1d')];var _0x4e8aa5=_0x1afaa4?_0x4aa7e4[_0x61d9('0x1f')]:_0x8fecaf[_0x61d9('0x1d')]+_0x8fecaf[_0x61d9('0x20')];var _0x48b050;if(_0x4e8aa5>=_0x40551){_0x4e8aa5=_0x40551;_0x48b050=0xc8;}else{_0x48b050=0xce;}_0x20c57c[_0x61d9('0x1c')](_0x48b050);return _0x20c57c[_0x61d9('0x21')](_0x61d9('0x22'),_0x381524+'-'+_0x4e8aa5+'/'+_0x40551)['json'](_0x4aa7e4);}return null;};}function patchUpdates(_0xefecff){return function(_0x5b9522){try{jsonpatch[_0x61d9('0x23')](_0x5b9522,_0xefecff,!![]);}catch(_0x51c33e){return BPromise[_0x61d9('0x24')](_0x51c33e);}return _0x5b9522['save']();};}function saveUpdates(_0x437bbd,_0x439aa2){return function(_0x4450f5){if(_0x4450f5){return _0x4450f5[_0x61d9('0x25')](_0x437bbd)[_0x61d9('0x26')](function(_0x30e12f){return _0x30e12f;});}return null;};}function removeEntity(_0x4cf2df,_0x18ad52){return function(_0x4229be){if(_0x4229be){return _0x4229be[_0x61d9('0x27')]()['then'](function(){_0x4cf2df[_0x61d9('0x1c')](0xcc)[_0x61d9('0x28')]();});}};}function handleEntityNotFound(_0x5b11a9,_0x3ad1d8){return function(_0x1f8fac){if(!_0x1f8fac){_0x5b11a9[_0x61d9('0x1b')](0x194);}return _0x1f8fac;};}function handleError(_0x2ce7d8,_0x4c95cf){_0x4c95cf=_0x4c95cf||0x1f4;return function(_0x2a8492){logger[_0x61d9('0x29')](_0x2a8492[_0x61d9('0x2a')]);if(_0x2a8492[_0x61d9('0x2b')]){delete _0x2a8492[_0x61d9('0x2b')];}_0x2ce7d8['status'](_0x4c95cf)[_0x61d9('0x2c')](_0x2a8492);};}exports['index']=function(_0x1464bd,_0x216aa7){var _0x264330={},_0x1b0298={},_0x27554a={'count':0x0,'rows':[]};var _0x4007e3=_['map'](db[_0x61d9('0x2d')][_0x61d9('0x2e')],function(_0x55038e){return{'name':_0x55038e[_0x61d9('0x2f')],'type':_0x55038e[_0x61d9('0x30')]['key']};});_0x1b0298[_0x61d9('0x31')]=_['map'](_0x4007e3,'name');_0x1b0298[_0x61d9('0x32')]=_['keys'](_0x1464bd[_0x61d9('0x32')]);_0x1b0298['filters']=_[_0x61d9('0x33')](_0x1b0298[_0x61d9('0x31')],_0x1b0298[_0x61d9('0x32')]);_0x264330[_0x61d9('0x34')]=_[_0x61d9('0x33')](_0x1b0298['model'],qs['fields'](_0x1464bd[_0x61d9('0x32')][_0x61d9('0x35')]));_0x264330['attributes']=_0x264330[_0x61d9('0x34')]['length']?_0x264330[_0x61d9('0x34')]:_0x1b0298[_0x61d9('0x31')];if(!_0x1464bd[_0x61d9('0x32')][_0x61d9('0x36')](_0x61d9('0x37'))){_0x264330[_0x61d9('0x20')]=qs['limit'](_0x1464bd[_0x61d9('0x32')][_0x61d9('0x20')]);_0x264330[_0x61d9('0x1d')]=qs[_0x61d9('0x1d')](_0x1464bd[_0x61d9('0x32')]['offset']);}_0x264330[_0x61d9('0x38')]=qs[_0x61d9('0x39')](_0x1464bd[_0x61d9('0x32')][_0x61d9('0x39')]);_0x264330[_0x61d9('0x3a')]=qs[_0x61d9('0x3b')](_['pick'](_0x1464bd[_0x61d9('0x32')],_0x1b0298[_0x61d9('0x3b')]),_0x4007e3);if(_0x1464bd[_0x61d9('0x32')][_0x61d9('0x3c')]){_0x264330['where']=_[_0x61d9('0x3d')](_0x264330[_0x61d9('0x3a')],{'$or':_['map'](_0x4007e3,function(_0x167bb9){if(_0x167bb9[_0x61d9('0x30')]!==_0x61d9('0x3e')){var _0x590195={};_0x590195[_0x167bb9[_0x61d9('0x2b')]]={'$like':'%'+_0x1464bd[_0x61d9('0x32')][_0x61d9('0x3c')]+'%'};return _0x590195;}})});}_0x264330=_[_0x61d9('0x3d')]({},_0x264330,_0x1464bd['options']);var _0x292872={'where':_0x264330[_0x61d9('0x3a')]};return db[_0x61d9('0x2d')]['count'](_0x292872)[_0x61d9('0x26')](function(_0x38c8f9){_0x27554a[_0x61d9('0x1f')]=_0x38c8f9;if(_0x1464bd[_0x61d9('0x32')][_0x61d9('0x3f')]){_0x264330[_0x61d9('0x40')]=[{'all':!![]}];}return db[_0x61d9('0x2d')][_0x61d9('0x41')](_0x264330);})[_0x61d9('0x26')](function(_0x81123f){_0x27554a[_0x61d9('0x42')]=_0x81123f;return _0x27554a;})[_0x61d9('0x26')](respondWithFilteredResult(_0x216aa7,_0x264330))[_0x61d9('0x43')](handleError(_0x216aa7,null));};exports[_0x61d9('0x44')]=function(_0x307d6f,_0x313f0c){var _0x4e2d22={'raw':!![],'where':{'id':_0x307d6f[_0x61d9('0x45')]['id']}},_0x285a41={};_0x285a41['model']=_[_0x61d9('0x46')](db[_0x61d9('0x2d')]['rawAttributes']);_0x285a41[_0x61d9('0x32')]=_[_0x61d9('0x46')](_0x307d6f[_0x61d9('0x32')]);_0x285a41['filters']=_[_0x61d9('0x33')](_0x285a41['model'],_0x285a41[_0x61d9('0x32')]);_0x4e2d22['attributes']=_[_0x61d9('0x33')](_0x285a41[_0x61d9('0x31')],qs[_0x61d9('0x35')](_0x307d6f[_0x61d9('0x32')]['fields']));_0x4e2d22[_0x61d9('0x34')]=_0x4e2d22[_0x61d9('0x34')][_0x61d9('0x47')]?_0x4e2d22[_0x61d9('0x34')]:_0x285a41[_0x61d9('0x31')];if(_0x307d6f[_0x61d9('0x32')][_0x61d9('0x3f')]){_0x4e2d22[_0x61d9('0x40')]=[{'all':!![]}];}_0x4e2d22=_['merge']({},_0x4e2d22,_0x307d6f[_0x61d9('0x48')]);return db['OpenchannelApplication']['find'](_0x4e2d22)['then'](handleEntityNotFound(_0x313f0c,null))[_0x61d9('0x26')](respondWithResult(_0x313f0c,null))[_0x61d9('0x43')](handleError(_0x313f0c,null));};exports[_0x61d9('0x49')]=function(_0x1fca88,_0x5ef008){return db[_0x61d9('0x2d')][_0x61d9('0x49')](_0x1fca88[_0x61d9('0x4a')],{})[_0x61d9('0x26')](respondWithResult(_0x5ef008,0xc9))[_0x61d9('0x43')](handleError(_0x5ef008,null));};exports[_0x61d9('0x25')]=function(_0x43ca59,_0x38bbf7){if(_0x43ca59[_0x61d9('0x4a')]['id']){delete _0x43ca59['body']['id'];}return db[_0x61d9('0x2d')]['find']({'where':{'id':_0x43ca59[_0x61d9('0x45')]['id']}})['then'](handleEntityNotFound(_0x38bbf7,null))[_0x61d9('0x26')](saveUpdates(_0x43ca59[_0x61d9('0x4a')],null))[_0x61d9('0x26')](respondWithResult(_0x38bbf7,null))[_0x61d9('0x43')](handleError(_0x38bbf7,null));};exports[_0x61d9('0x27')]=function(_0x1d4c87,_0x583246){return db['OpenchannelApplication'][_0x61d9('0x4b')]({'where':{'id':_0x1d4c87[_0x61d9('0x45')]['id']}})[_0x61d9('0x26')](handleEntityNotFound(_0x583246,null))[_0x61d9('0x26')](removeEntity(_0x583246,null))[_0x61d9('0x43')](handleError(_0x583246,null));};
\ No newline at end of file
+var _0xbf45=['offset','limit','undefined','count','set','Content-Range','apply','reject','then','destroy','error','stack','name','index','map','OpenchannelApplication','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','update','body','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','sendStatus','status','end','json'];(function(_0x1d8a15,_0x4acbca){var _0x17b14b=function(_0x52c9e9){while(--_0x52c9e9){_0x1d8a15['push'](_0x1d8a15['shift']());}};_0x17b14b(++_0x4acbca);}(_0xbf45,0x100));var _0x5bf4=function(_0x2eb82b,_0x748422){_0x2eb82b=_0x2eb82b-0x0;var _0x4895e0=_0xbf45[_0x2eb82b];return _0x4895e0;};'use strict';var emlformat=require(_0x5bf4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5bf4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5bf4('0x2'));var moment=require(_0x5bf4('0x3'));var BPromise=require(_0x5bf4('0x4'));var Mustache=require(_0x5bf4('0x5'));var util=require(_0x5bf4('0x6'));var path=require(_0x5bf4('0x7'));var sox=require(_0x5bf4('0x8'));var csv=require(_0x5bf4('0x9'));var ejs=require(_0x5bf4('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5bf4('0xb'));var squel=require(_0x5bf4('0xc'));var crypto=require('crypto');var jsforce=require(_0x5bf4('0xd'));var deskjs=require(_0x5bf4('0xe'));var toCsv=require(_0x5bf4('0x9'));var querystring=require('querystring');var Papa=require(_0x5bf4('0xf'));var Redis=require('ioredis');var authService=require(_0x5bf4('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5bf4('0x11'));var hardwareService=require(_0x5bf4('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5bf4('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3aa350,_0x51933f){_0x51933f=_0x51933f||0xcc;return function(_0x45b8f2){if(_0x45b8f2){return _0x3aa350[_0x5bf4('0x14')](_0x51933f);}return _0x3aa350[_0x5bf4('0x15')](_0x51933f)[_0x5bf4('0x16')]();};}function respondWithResult(_0x7d5708,_0x38efe1){_0x38efe1=_0x38efe1||0xc8;return function(_0x424805){if(_0x424805){return _0x7d5708[_0x5bf4('0x15')](_0x38efe1)[_0x5bf4('0x17')](_0x424805);}};}function respondWithFilteredResult(_0x2a0d46,_0x3f9d63){return function(_0x2de25d){if(_0x2de25d){var _0x200b38=typeof _0x3f9d63[_0x5bf4('0x18')]==='undefined'&&typeof _0x3f9d63[_0x5bf4('0x19')]===_0x5bf4('0x1a');var _0x4ebe9d=_0x2de25d[_0x5bf4('0x1b')];var _0x4858b7=_0x200b38?0x0:_0x3f9d63['offset'];var _0xc1b7db=_0x200b38?_0x2de25d['count']:_0x3f9d63[_0x5bf4('0x18')]+_0x3f9d63[_0x5bf4('0x19')];var _0x39d534;if(_0xc1b7db>=_0x4ebe9d){_0xc1b7db=_0x4ebe9d;_0x39d534=0xc8;}else{_0x39d534=0xce;}_0x2a0d46[_0x5bf4('0x15')](_0x39d534);return _0x2a0d46[_0x5bf4('0x1c')](_0x5bf4('0x1d'),_0x4858b7+'-'+_0xc1b7db+'/'+_0x4ebe9d)[_0x5bf4('0x17')](_0x2de25d);}return null;};}function patchUpdates(_0x27fad8){return function(_0x14667f){try{jsonpatch[_0x5bf4('0x1e')](_0x14667f,_0x27fad8,!![]);}catch(_0x293204){return BPromise[_0x5bf4('0x1f')](_0x293204);}return _0x14667f['save']();};}function saveUpdates(_0x2dce38,_0x2c2f16){return function(_0x241692){if(_0x241692){return _0x241692['update'](_0x2dce38)[_0x5bf4('0x20')](function(_0x39b70f){return _0x39b70f;});}return null;};}function removeEntity(_0xd1a800,_0x28818d){return function(_0x3f68b1){if(_0x3f68b1){return _0x3f68b1[_0x5bf4('0x21')]()['then'](function(){_0xd1a800[_0x5bf4('0x15')](0xcc)[_0x5bf4('0x16')]();});}};}function handleEntityNotFound(_0x375093,_0x501f87){return function(_0x2a8e0e){if(!_0x2a8e0e){_0x375093[_0x5bf4('0x14')](0x194);}return _0x2a8e0e;};}function handleError(_0x3d3238,_0x504934){_0x504934=_0x504934||0x1f4;return function(_0x4c4fbd){logger[_0x5bf4('0x22')](_0x4c4fbd[_0x5bf4('0x23')]);if(_0x4c4fbd[_0x5bf4('0x24')]){delete _0x4c4fbd[_0x5bf4('0x24')];}_0x3d3238[_0x5bf4('0x15')](_0x504934)['send'](_0x4c4fbd);};}exports[_0x5bf4('0x25')]=function(_0x2db70b,_0x466017){var _0x31ca68={},_0xc8a1de={},_0x479e90={'count':0x0,'rows':[]};var _0x2ea259=_[_0x5bf4('0x26')](db[_0x5bf4('0x27')][_0x5bf4('0x28')],function(_0x200740){return{'name':_0x200740['fieldName'],'type':_0x200740[_0x5bf4('0x29')][_0x5bf4('0x2a')]};});_0xc8a1de[_0x5bf4('0x2b')]=_['map'](_0x2ea259,_0x5bf4('0x24'));_0xc8a1de[_0x5bf4('0x2c')]=_[_0x5bf4('0x2d')](_0x2db70b[_0x5bf4('0x2c')]);_0xc8a1de[_0x5bf4('0x2e')]=_['intersection'](_0xc8a1de[_0x5bf4('0x2b')],_0xc8a1de['query']);_0x31ca68[_0x5bf4('0x2f')]=_[_0x5bf4('0x30')](_0xc8a1de[_0x5bf4('0x2b')],qs[_0x5bf4('0x31')](_0x2db70b['query']['fields']));_0x31ca68[_0x5bf4('0x2f')]=_0x31ca68[_0x5bf4('0x2f')][_0x5bf4('0x32')]?_0x31ca68[_0x5bf4('0x2f')]:_0xc8a1de[_0x5bf4('0x2b')];if(!_0x2db70b['query'][_0x5bf4('0x33')]('nolimit')){_0x31ca68[_0x5bf4('0x19')]=qs[_0x5bf4('0x19')](_0x2db70b['query'][_0x5bf4('0x19')]);_0x31ca68[_0x5bf4('0x18')]=qs[_0x5bf4('0x18')](_0x2db70b[_0x5bf4('0x2c')][_0x5bf4('0x18')]);}_0x31ca68['order']=qs['sort'](_0x2db70b[_0x5bf4('0x2c')][_0x5bf4('0x34')]);_0x31ca68[_0x5bf4('0x35')]=qs[_0x5bf4('0x2e')](_[_0x5bf4('0x36')](_0x2db70b['query'],_0xc8a1de[_0x5bf4('0x2e')]),_0x2ea259);if(_0x2db70b[_0x5bf4('0x2c')][_0x5bf4('0x37')]){_0x31ca68[_0x5bf4('0x35')]=_[_0x5bf4('0x38')](_0x31ca68[_0x5bf4('0x35')],{'$or':_[_0x5bf4('0x26')](_0x2ea259,function(_0x596371){if(_0x596371[_0x5bf4('0x29')]!==_0x5bf4('0x39')){var _0x434f76={};_0x434f76[_0x596371[_0x5bf4('0x24')]]={'$like':'%'+_0x2db70b[_0x5bf4('0x2c')][_0x5bf4('0x37')]+'%'};return _0x434f76;}})});}_0x31ca68=_[_0x5bf4('0x38')]({},_0x31ca68,_0x2db70b[_0x5bf4('0x3a')]);var _0x5ea0ea={'where':_0x31ca68[_0x5bf4('0x35')]};return db[_0x5bf4('0x27')][_0x5bf4('0x1b')](_0x5ea0ea)[_0x5bf4('0x20')](function(_0xe521d4){_0x479e90['count']=_0xe521d4;if(_0x2db70b['query'][_0x5bf4('0x3b')]){_0x31ca68[_0x5bf4('0x3c')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0x5bf4('0x3d')](_0x31ca68);})[_0x5bf4('0x20')](function(_0x5962a1){_0x479e90[_0x5bf4('0x3e')]=_0x5962a1;return _0x479e90;})[_0x5bf4('0x20')](respondWithFilteredResult(_0x466017,_0x31ca68))[_0x5bf4('0x3f')](handleError(_0x466017,null));};exports[_0x5bf4('0x40')]=function(_0x1dc574,_0x101d13){var _0x1a9d8d={'raw':!![],'where':{'id':_0x1dc574[_0x5bf4('0x41')]['id']}},_0x53e956={};_0x53e956['model']=_[_0x5bf4('0x2d')](db[_0x5bf4('0x27')][_0x5bf4('0x28')]);_0x53e956[_0x5bf4('0x2c')]=_[_0x5bf4('0x2d')](_0x1dc574[_0x5bf4('0x2c')]);_0x53e956[_0x5bf4('0x2e')]=_[_0x5bf4('0x30')](_0x53e956[_0x5bf4('0x2b')],_0x53e956['query']);_0x1a9d8d[_0x5bf4('0x2f')]=_['intersection'](_0x53e956[_0x5bf4('0x2b')],qs['fields'](_0x1dc574[_0x5bf4('0x2c')][_0x5bf4('0x31')]));_0x1a9d8d[_0x5bf4('0x2f')]=_0x1a9d8d[_0x5bf4('0x2f')][_0x5bf4('0x32')]?_0x1a9d8d['attributes']:_0x53e956[_0x5bf4('0x2b')];if(_0x1dc574[_0x5bf4('0x2c')][_0x5bf4('0x3b')]){_0x1a9d8d[_0x5bf4('0x3c')]=[{'all':!![]}];}_0x1a9d8d=_[_0x5bf4('0x38')]({},_0x1a9d8d,_0x1dc574['options']);return db[_0x5bf4('0x27')][_0x5bf4('0x42')](_0x1a9d8d)[_0x5bf4('0x20')](handleEntityNotFound(_0x101d13,null))[_0x5bf4('0x20')](respondWithResult(_0x101d13,null))[_0x5bf4('0x3f')](handleError(_0x101d13,null));};exports[_0x5bf4('0x43')]=function(_0x8c01e4,_0x5cc44f){return db[_0x5bf4('0x27')][_0x5bf4('0x43')](_0x8c01e4['body'],{})[_0x5bf4('0x20')](respondWithResult(_0x5cc44f,0xc9))[_0x5bf4('0x3f')](handleError(_0x5cc44f,null));};exports[_0x5bf4('0x44')]=function(_0xb50214,_0x111c8e){if(_0xb50214[_0x5bf4('0x45')]['id']){delete _0xb50214[_0x5bf4('0x45')]['id'];}return db[_0x5bf4('0x27')][_0x5bf4('0x42')]({'where':{'id':_0xb50214['params']['id']}})[_0x5bf4('0x20')](handleEntityNotFound(_0x111c8e,null))[_0x5bf4('0x20')](saveUpdates(_0xb50214[_0x5bf4('0x45')],null))[_0x5bf4('0x20')](respondWithResult(_0x111c8e,null))['catch'](handleError(_0x111c8e,null));};exports['destroy']=function(_0x5451e1,_0x3d1152){return db['OpenchannelApplication'][_0x5bf4('0x42')]({'where':{'id':_0x5451e1[_0x5bf4('0x41')]['id']}})['then'](handleEntityNotFound(_0x3d1152,null))[_0x5bf4('0x20')](removeEntity(_0x3d1152,null))[_0x5bf4('0x3f')](handleError(_0x3d1152,null));};
\ No newline at end of file
index 8b9c453..f31b0d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x457b=['../../config/environment','./openchannelApplication.attributes','exports','OpenchannelApplication','utf8mb4','lodash','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x6e1eba,_0x3aa061){var _0x1003f5=function(_0x33ed92){while(--_0x33ed92){_0x6e1eba['push'](_0x6e1eba['shift']());}};_0x1003f5(++_0x3aa061);}(_0x457b,0x1c1));var _0xb457=function(_0x1d4f28,_0x3c34ea){_0x1d4f28=_0x1d4f28-0x0;var _0x43327a=_0x457b[_0x1d4f28];return _0x43327a;};'use strict';var _=require(_0xb457('0x0'));var util=require('util');var logger=require(_0xb457('0x1'))(_0xb457('0x2'));var moment=require(_0xb457('0x3'));var BPromise=require('bluebird');var rp=require(_0xb457('0x4'));var fs=require('fs');var path=require(_0xb457('0x5'));var rimraf=require(_0xb457('0x6'));var config=require(_0xb457('0x7'));var attributes=require(_0xb457('0x8'));module[_0xb457('0x9')]=function(_0x4db4ee,_0x45d13f){return _0x4db4ee['define'](_0xb457('0xa'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb457('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xa08d=['bluebird','path','rimraf','../../config/environment','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4_unicode_ci','util','../../config/logger','api','moment'];(function(_0x295735,_0x33b92e){var _0x4891d0=function(_0xb6674b){while(--_0xb6674b){_0x295735['push'](_0x295735['shift']());}};_0x4891d0(++_0x33b92e);}(_0xa08d,0x7e));var _0xda08=function(_0x124d52,_0x4102d9){_0x124d52=_0x124d52-0x0;var _0x32d926=_0xa08d[_0x124d52];return _0x32d926;};'use strict';var _=require('lodash');var util=require(_0xda08('0x0'));var logger=require(_0xda08('0x1'))(_0xda08('0x2'));var moment=require(_0xda08('0x3'));var BPromise=require(_0xda08('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xda08('0x5'));var rimraf=require(_0xda08('0x6'));var config=require(_0xda08('0x7'));var attributes=require('./openchannelApplication.attributes');module[_0xda08('0x8')]=function(_0x349706,_0x5992b3){return _0x349706[_0xda08('0x9')](_0xda08('0xa'),attributes,{'tableName':_0xda08('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xda08('0xc')});};
\ No newline at end of file
index 5b7c383..9321b8d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x201f=['OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','attributes','limit','stringify','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','client','http','then','info'];(function(_0x277be6,_0x1836d7){var _0x6502d5=function(_0x45d036){while(--_0x45d036){_0x277be6['push'](_0x277be6['shift']());}};_0x6502d5(++_0x1836d7);}(_0x201f,0x66));var _0xf201=function(_0x1276dc,_0x5454ea){_0x1276dc=_0x1276dc-0x0;var _0x4b7bc5=_0x201f[_0x1276dc];return _0x4b7bc5;};'use strict';var _=require(_0xf201('0x0'));var util=require('util');var moment=require(_0xf201('0x1'));var BPromise=require(_0xf201('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf201('0x3'));var db=require(_0xf201('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf201('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf201('0x6')][_0xf201('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x23092a,_0x14f911,_0x17ee23){return new BPromise(function(_0x2b0c7a,_0x168276){return client['request'](_0x23092a,_0x17ee23)[_0xf201('0x8')](function(_0x146611){logger[_0xf201('0x9')](_0xf201('0xa'),_0x14f911,_0xf201('0xb'));logger[_0xf201('0xc')](_0xf201('0xd'),_0x14f911,_0xf201('0xb'),JSON['stringify'](_0x146611));if(_0x146611[_0xf201('0xe')]){if(_0x146611['error'][_0xf201('0xf')]===0x1f4){logger[_0xf201('0xe')](_0xf201('0xa'),_0x14f911,_0x146611[_0xf201('0xe')][_0xf201('0x10')]);return _0x168276(_0x146611[_0xf201('0xe')][_0xf201('0x10')]);}logger[_0xf201('0xe')](_0xf201('0xa'),_0x14f911,_0x146611['error'][_0xf201('0x10')]);return _0x2b0c7a(_0x146611['error'][_0xf201('0x10')]);}else{logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0x14f911,_0xf201('0xb'));_0x2b0c7a(_0x146611[_0xf201('0x11')]['message']);}})[_0xf201('0x12')](function(_0x2ac86f){logger['error'](_0xf201('0xa'),_0x14f911,_0x2ac86f);_0x168276(_0x2ac86f);});});}exports[_0xf201('0x13')]=function(_0x12ff13){var _0x22ceda=this;return new Promise(function(_0x31249f,_0x25ac9a){return db[_0xf201('0x14')][_0xf201('0x15')](_0x12ff13[_0xf201('0x16')],{'raw':_0x12ff13[_0xf201('0x17')]?_0x12ff13[_0xf201('0x17')][_0xf201('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12ff13[_0xf201('0x17')]?_0x12ff13[_0xf201('0x17')]['where']||null:null,'attributes':_0x12ff13[_0xf201('0x17')]?_0x12ff13[_0xf201('0x17')][_0xf201('0x19')]||null:null,'limit':_0x12ff13[_0xf201('0x17')]?_0x12ff13[_0xf201('0x17')][_0xf201('0x1a')]||null:null})['then'](function(_0x1fc9ad){logger['info'](_0xf201('0x13'),_0x12ff13);logger[_0xf201('0xc')](_0xf201('0x13'),_0x12ff13,JSON[_0xf201('0x1b')](_0x1fc9ad));_0x31249f(_0x1fc9ad);})[_0xf201('0x12')](function(_0x50f0a0){logger[_0xf201('0xe')](_0xf201('0x13'),_0x50f0a0[_0xf201('0x10')],_0x12ff13);_0x25ac9a(_0x22ceda[_0xf201('0xe')](0x1f4,_0x50f0a0[_0xf201('0x10')]));});});};
\ No newline at end of file
+var _0x320f=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','OpenchannelApplication,\x20%s,\x20%s','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x1c1ca1,_0x54747c){var _0x1b7483=function(_0x5d47d9){while(--_0x5d47d9){_0x1c1ca1['push'](_0x1c1ca1['shift']());}};_0x1b7483(++_0x54747c);}(_0x320f,0x123));var _0xf320=function(_0x3b2af4,_0x5ef70d){_0x3b2af4=_0x3b2af4-0x0;var _0x276237=_0x320f[_0x3b2af4];return _0x276237;};'use strict';var _=require(_0xf320('0x0'));var util=require(_0xf320('0x1'));var moment=require(_0xf320('0x2'));var BPromise=require(_0xf320('0x3'));var rs=require(_0xf320('0x4'));var fs=require('fs');var Redis=require(_0xf320('0x5'));var db=require(_0xf320('0x6'))['db'];var utils=require(_0xf320('0x7'));var logger=require(_0xf320('0x8'))(_0xf320('0x9'));var config=require(_0xf320('0xa'));var jayson=require(_0xf320('0xb'));var client=jayson[_0xf320('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48d1bd,_0x35f730,_0x38dc35){return new BPromise(function(_0x9f58c0,_0x50af8a){return client[_0xf320('0xd')](_0x48d1bd,_0x38dc35)[_0xf320('0xe')](function(_0x2b39d2){logger['info'](_0xf320('0xf'),_0x35f730,'request\x20sent');logger[_0xf320('0x10')](_0xf320('0x11'),_0x35f730,'request\x20sent',JSON[_0xf320('0x12')](_0x2b39d2));if(_0x2b39d2[_0xf320('0x13')]){if(_0x2b39d2[_0xf320('0x13')][_0xf320('0x14')]===0x1f4){logger[_0xf320('0x13')](_0xf320('0xf'),_0x35f730,_0x2b39d2[_0xf320('0x13')][_0xf320('0x15')]);return _0x50af8a(_0x2b39d2[_0xf320('0x13')][_0xf320('0x15')]);}logger[_0xf320('0x13')]('OpenchannelApplication,\x20%s,\x20%s',_0x35f730,_0x2b39d2[_0xf320('0x13')][_0xf320('0x15')]);return _0x9f58c0(_0x2b39d2[_0xf320('0x13')][_0xf320('0x15')]);}else{logger[_0xf320('0x16')](_0xf320('0xf'),_0x35f730,_0xf320('0x17'));_0x9f58c0(_0x2b39d2['result'][_0xf320('0x15')]);}})[_0xf320('0x18')](function(_0x4d68dd){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x35f730,_0x4d68dd);_0x50af8a(_0x4d68dd);});});}exports[_0xf320('0x19')]=function(_0x415f70){var _0x3ef1fd=this;return new Promise(function(_0xb2290b,_0x2bedb0){return db[_0xf320('0x1a')][_0xf320('0x1b')](_0x415f70[_0xf320('0x1c')],{'raw':_0x415f70[_0xf320('0x1d')]?_0x415f70[_0xf320('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x415f70[_0xf320('0x1d')]?_0x415f70[_0xf320('0x1d')][_0xf320('0x1e')]||null:null,'attributes':_0x415f70[_0xf320('0x1d')]?_0x415f70[_0xf320('0x1d')][_0xf320('0x1f')]||null:null,'limit':_0x415f70['options']?_0x415f70['options'][_0xf320('0x20')]||null:null})[_0xf320('0xe')](function(_0x5f1838){logger[_0xf320('0x16')](_0xf320('0x19'),_0x415f70);logger[_0xf320('0x10')](_0xf320('0x19'),_0x415f70,JSON[_0xf320('0x12')](_0x5f1838));_0xb2290b(_0x5f1838);})[_0xf320('0x18')](function(_0x213f6f){logger[_0xf320('0x13')](_0xf320('0x19'),_0x213f6f[_0xf320('0x15')],_0x415f70);_0x2bedb0(_0x3ef1fd[_0xf320('0x13')](0x1f4,_0x213f6f[_0xf320('0x15')]));});});};
\ No newline at end of file
index 28a0498..045b119 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd70=['isAuthenticated','index','/describe','show','getMessages','download','create','/:id/messages','addMessage','tracked','openchannel','openchannelinteraction:addtags','addTags','put','/:id','openchannelinteraction:update','delete','destroy','/:id/tags','removeTags','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./openchannelInteraction.controller','get'];(function(_0x1352f0,_0x48061a){var _0x3f042d=function(_0x42b0f9){while(--_0x42b0f9){_0x1352f0['push'](_0x1352f0['shift']());}};_0x3f042d(++_0x48061a);}(_0xdd70,0x88));var _0x0dd7=function(_0xd60d29,_0x4a442f){_0xd60d29=_0xd60d29-0x0;var _0x43c806=_0xdd70[_0xd60d29];return _0x43c806;};'use strict';var multer=require(_0x0dd7('0x0'));var util=require('util');var path=require(_0x0dd7('0x1'));var timeout=require(_0x0dd7('0x2'));var express=require(_0x0dd7('0x3'));var router=express[_0x0dd7('0x4')]();var fs_extra=require(_0x0dd7('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0dd7('0x6'));var controller=require(_0x0dd7('0x7'));router[_0x0dd7('0x8')]('/',auth[_0x0dd7('0x9')](),controller[_0x0dd7('0xa')]);router[_0x0dd7('0x8')](_0x0dd7('0xb'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x0dd7('0x9')](),controller[_0x0dd7('0xc')]);router[_0x0dd7('0x8')]('/:id/messages',auth[_0x0dd7('0x9')](),controller[_0x0dd7('0xd')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x0dd7('0xe')]);router['post']('/',auth[_0x0dd7('0x9')](),controller[_0x0dd7('0xf')]);router['post'](_0x0dd7('0x10'),auth[_0x0dd7('0x9')](),controller[_0x0dd7('0x11')]);router['post']('/:id/tags',auth['isAuthenticated'](),interaction[_0x0dd7('0x12')](_0x0dd7('0x13'),_0x0dd7('0x14')),controller[_0x0dd7('0x15')]);router[_0x0dd7('0x16')](_0x0dd7('0x17'),auth['isAuthenticated'](),interaction['tracked']('openchannel',_0x0dd7('0x18')),controller['update']);router[_0x0dd7('0x19')](_0x0dd7('0x17'),auth[_0x0dd7('0x9')](),interaction[_0x0dd7('0x12')]('openchannel','openchannelinteraction:destroy'),controller[_0x0dd7('0x1a')]);router['delete'](_0x0dd7('0x1b'),auth[_0x0dd7('0x9')](),controller[_0x0dd7('0x1c')]);module['exports']=router;
\ No newline at end of file
+var _0x5bcc=['./openchannelInteraction.controller','isAuthenticated','get','/describe','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','openchannel','openchannelinteraction:addtags','addTags','/:id','tracked','openchannelinteraction:update','openchannelinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x1344d6,_0x2181e6){var _0xf45b24=function(_0x2d90c1){while(--_0x2d90c1){_0x1344d6['push'](_0x1344d6['shift']());}};_0xf45b24(++_0x2181e6);}(_0x5bcc,0x137));var _0xc5bc=function(_0x5a94b0,_0x1b5f15){_0x5a94b0=_0x5a94b0-0x0;var _0x2020fd=_0x5bcc[_0x5a94b0];return _0x2020fd;};'use strict';var multer=require(_0xc5bc('0x0'));var util=require(_0xc5bc('0x1'));var path=require(_0xc5bc('0x2'));var timeout=require(_0xc5bc('0x3'));var express=require(_0xc5bc('0x4'));var router=express[_0xc5bc('0x5')]();var fs_extra=require(_0xc5bc('0x6'));var auth=require(_0xc5bc('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xc5bc('0x8'));var controller=require(_0xc5bc('0x9'));router['get']('/',auth[_0xc5bc('0xa')](),controller['index']);router[_0xc5bc('0xb')](_0xc5bc('0xc'),auth[_0xc5bc('0xa')](),controller['describe']);router[_0xc5bc('0xb')]('/:id',auth[_0xc5bc('0xa')](),controller[_0xc5bc('0xd')]);router[_0xc5bc('0xb')](_0xc5bc('0xe'),auth[_0xc5bc('0xa')](),controller[_0xc5bc('0xf')]);router[_0xc5bc('0xb')](_0xc5bc('0x10'),auth[_0xc5bc('0xa')](),controller[_0xc5bc('0x11')]);router[_0xc5bc('0x12')]('/',auth[_0xc5bc('0xa')](),controller['create']);router[_0xc5bc('0x12')](_0xc5bc('0xe'),auth[_0xc5bc('0xa')](),controller[_0xc5bc('0x13')]);router[_0xc5bc('0x12')](_0xc5bc('0x14'),auth[_0xc5bc('0xa')](),interaction['tracked'](_0xc5bc('0x15'),_0xc5bc('0x16')),controller[_0xc5bc('0x17')]);router['put'](_0xc5bc('0x18'),auth[_0xc5bc('0xa')](),interaction[_0xc5bc('0x19')](_0xc5bc('0x15'),_0xc5bc('0x1a')),controller['update']);router['delete'](_0xc5bc('0x18'),auth['isAuthenticated'](),interaction['tracked'](_0xc5bc('0x15'),_0xc5bc('0x1b')),controller[_0xc5bc('0x1c')]);router[_0xc5bc('0x1d')](_0xc5bc('0x14'),auth[_0xc5bc('0xa')](),controller[_0xc5bc('0x1e')]);module[_0xc5bc('0x1f')]=router;
\ No newline at end of file
index 7eda950..1c50385 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd13e=['BOOLEAN','DATE','STRING','sequelize','exports'];(function(_0x1a7586,_0x333c4f){var _0x352a0f=function(_0xd82899){while(--_0xd82899){_0x1a7586['push'](_0x1a7586['shift']());}};_0x352a0f(++_0x333c4f);}(_0xd13e,0x193));var _0xed13=function(_0x1f58b6,_0x58a763){_0x1f58b6=_0x1f58b6-0x0;var _0x310500=_0xd13e[_0x1f58b6];return _0x310500;};'use strict';var Sequelize=require(_0xed13('0x0'));module[_0xed13('0x1')]={'closed':{'type':Sequelize[_0xed13('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xed13('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xed13('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xed13('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0xed13('0x4')]},'externalUrl':{'type':Sequelize[_0xed13('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xed13('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0xed13('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0xa276=['STRING','DATE','ENUM','out','exports','BOOLEAN'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0xa276,0x9a));var _0x6a27=function(_0x7ee0d0,_0x5b992f){_0x7ee0d0=_0x7ee0d0-0x0;var _0x54945b=_0xa276[_0x7ee0d0];return _0x54945b;};'use strict';var Sequelize=require('sequelize');module[_0x6a27('0x0')]={'closed':{'type':Sequelize[_0x6a27('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x6a27('0x2')]},'secondDisposition':{'type':Sequelize[_0x6a27('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x6a27('0x2')]},'read1stAt':{'type':Sequelize[_0x6a27('0x3')]},'threadId':{'type':Sequelize[_0x6a27('0x2')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x6a27('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x6a27('0x4')]('in',_0x6a27('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0x6a27('0x1')],'defaultValue':![]}};
\ No newline at end of file
index b0b7413..6af70e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1f4=['catch','talking','answered','total','closed','waiting','UserId','unmanaged','index','OpenchannelInteraction','fieldName','key','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','left_join','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','value','ContactId','type','text','start','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','keys','some','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','Account.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','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','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?','groupBy','OpenchannelInteractionId','push','all','rows','params','includeAll','include','options','create','body','describe','addMessage','ids','omit','getMessages','findOne','OpenchannelMessage','rawAttributes','format','addTags','spread','emit','openchannelInteractionTags:save','removeTags','root','server','files','join','attachments','CmContact','firstName','lastName','secret','Account','Owner','mkdirSync','N.A.','YYYY-MM-DD\x20HH:mm:ss','disposition','threadId','Private','Messages','Attachment','basename','existsSync','createReadStream','pipe','direction','System','out','renderFile','downloadInteraction.ejs','transcript-','.pdf','Openchannel','createPdfFromHTML','download','log','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','status','end','offset','limit','undefined','count','set','Content-Range','json','save','update','then','destroy','sendStatus','error','name','Users','map','fullname','Tags','TagIds','split','forEach'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc1f4,0xbe));var _0x4c1f=function(_0x1a7a1b,_0x518846){_0x1a7a1b=_0x1a7a1b-0x0;var _0x350750=_0xc1f4[_0x1a7a1b];return _0x350750;};'use strict';var emlformat=require(_0x4c1f('0x0'));var rimraf=require(_0x4c1f('0x1'));var zipdir=require(_0x4c1f('0x2'));var jsonpatch=require(_0x4c1f('0x3'));var rp=require('request-promise');var moment=require(_0x4c1f('0x4'));var BPromise=require(_0x4c1f('0x5'));var Mustache=require(_0x4c1f('0x6'));var util=require(_0x4c1f('0x7'));var path=require(_0x4c1f('0x8'));var sox=require(_0x4c1f('0x9'));var csv=require(_0x4c1f('0xa'));var ejs=require(_0x4c1f('0xb'));var fs=require('fs');var fs_extra=require(_0x4c1f('0xc'));var _=require(_0x4c1f('0xd'));var squel=require(_0x4c1f('0xe'));var crypto=require(_0x4c1f('0xf'));var jsforce=require(_0x4c1f('0x10'));var deskjs=require(_0x4c1f('0x11'));var toCsv=require(_0x4c1f('0xa'));var querystring=require(_0x4c1f('0x12'));var Papa=require(_0x4c1f('0x13'));var Redis=require(_0x4c1f('0x14'));var authService=require(_0x4c1f('0x15'));var qs=require(_0x4c1f('0x16'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x4c1f('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4c1f('0x18'))('api');var utils=require(_0x4c1f('0x19'));var config=require(_0x4c1f('0x1a'));var licenseUtil=require(_0x4c1f('0x1b'));var db=require('../../mysqldb')['db'];config[_0x4c1f('0x1c')]=_[_0x4c1f('0x1d')](config[_0x4c1f('0x1c')],{'host':_0x4c1f('0x1e'),'port':0x18eb});var socket=require(_0x4c1f('0x1f'))(new Redis(config[_0x4c1f('0x1c')]));require(_0x4c1f('0x20'))[_0x4c1f('0x21')](socket);function respondWithStatusCode(_0x59666c,_0x4eff26){_0x4eff26=_0x4eff26||0xcc;return function(_0x3340e9){if(_0x3340e9){return _0x59666c['sendStatus'](_0x4eff26);}return _0x59666c[_0x4c1f('0x22')](_0x4eff26)[_0x4c1f('0x23')]();};}function respondWithResult(_0x46d8c9,_0x13e785){_0x13e785=_0x13e785||0xc8;return function(_0x33a887){if(_0x33a887){return _0x46d8c9[_0x4c1f('0x22')](_0x13e785)['json'](_0x33a887);}};}function respondWithFilteredResult(_0x5a16d1,_0x2edc6a){return function(_0x37d306){if(_0x37d306){var _0x5791dc=typeof _0x2edc6a[_0x4c1f('0x24')]==='undefined'&&typeof _0x2edc6a[_0x4c1f('0x25')]===_0x4c1f('0x26');var _0x13ad76=_0x37d306[_0x4c1f('0x27')];var _0x2bf8d8=_0x5791dc?0x0:_0x2edc6a[_0x4c1f('0x24')];var _0x658081=_0x5791dc?_0x37d306['count']:_0x2edc6a[_0x4c1f('0x24')]+_0x2edc6a['limit'];var _0x25ef28;if(_0x658081>=_0x13ad76){_0x658081=_0x13ad76;_0x25ef28=0xc8;}else{_0x25ef28=0xce;}_0x5a16d1[_0x4c1f('0x22')](_0x25ef28);return _0x5a16d1[_0x4c1f('0x28')](_0x4c1f('0x29'),_0x2bf8d8+'-'+_0x658081+'/'+_0x13ad76)[_0x4c1f('0x2a')](_0x37d306);}return null;};}function patchUpdates(_0x1bd918){return function(_0x57e82c){try{jsonpatch['apply'](_0x57e82c,_0x1bd918,!![]);}catch(_0x4535e8){return BPromise['reject'](_0x4535e8);}return _0x57e82c[_0x4c1f('0x2b')]();};}function saveUpdates(_0x2c62c2,_0x2076f6){return function(_0x2d4927){if(_0x2d4927){return _0x2d4927[_0x4c1f('0x2c')](_0x2c62c2)[_0x4c1f('0x2d')](function(_0x4d3bec){return _0x4d3bec;});}return null;};}function removeEntity(_0x33555d,_0x52a299){return function(_0x8f8041){if(_0x8f8041){return _0x8f8041[_0x4c1f('0x2e')]()['then'](function(){_0x33555d[_0x4c1f('0x22')](0xcc)[_0x4c1f('0x23')]();});}};}function handleEntityNotFound(_0xf45aea,_0x1df345){return function(_0x164a72){if(!_0x164a72){_0xf45aea[_0x4c1f('0x2f')](0x194);}return _0x164a72;};}function handleError(_0x338eaf,_0x2d9d21){_0x2d9d21=_0x2d9d21||0x1f4;return function(_0x1ba048){logger[_0x4c1f('0x30')](_0x1ba048['stack']);if(_0x1ba048[_0x4c1f('0x31')]){delete _0x1ba048['name'];}_0x338eaf['status'](_0x2d9d21)['send'](_0x1ba048);};}function getInteractionUsers(_0x383a20,_0x5ed298){return new BPromise(function(_0x245e69,_0x332ea7){try{if(_0x5ed298[_0x383a20['id']]){_0x383a20[_0x4c1f('0x32')]=_[_0x4c1f('0x33')](_0x5ed298[_0x383a20['id']],function(_0x2919aa){return{'id':_0x2919aa['id'],'fullname':_0x2919aa[_0x4c1f('0x34')]};});}}catch(_0x424bc3){_0x332ea7(_0x424bc3);}_0x245e69(_0x383a20);});}function getInteractionTags(_0x38442d,_0x2dd551){return new BPromise(function(_0x25ebce,_0x33108b){try{if(_0x38442d['TagIds']){_0x38442d[_0x4c1f('0x35')]=[];_0x38442d[_0x4c1f('0x36')][_0x4c1f('0x37')](',')[_0x4c1f('0x38')](function(_0x3b607d){_0x38442d[_0x4c1f('0x35')]['push'](_0x2dd551[_0x3b607d]);});}delete _0x38442d['TagIds'];}catch(_0x18719e){_0x33108b(_0x18719e);}_0x25ebce(_0x38442d);});}function updateOpenchannelInteraction(_0x5087c5,_0x5e14b9,_0x53aca9){return new BPromise(function(_0x3a18ab,_0x4b2b20){return getInteractionUsers(_0x5087c5,_0x53aca9)[_0x4c1f('0x2d')](function(_0x373f86){return getInteractionTags(_0x373f86,_0x5e14b9);})[_0x4c1f('0x2d')](function(_0x5d0b1a){return getStateInteraction(_0x5d0b1a);})[_0x4c1f('0x2d')](function(_0xa67840){_0x3a18ab(_0xa67840);})[_0x4c1f('0x39')](function(_0xc85c93){_0x4b2b20(_0xc85c93);});});}function getStateInteraction(_0x33faac){return new BPromise(function(_0x428de1){_0x33faac['waiting']=0x0;_0x33faac[_0x4c1f('0x3a')]=0x0;_0x33faac[_0x4c1f('0x3b')]=0x0;_0x33faac['unmanaged']=0x0;_0x33faac[_0x4c1f('0x3c')]=0x0;if(!_0x33faac[_0x4c1f('0x3d')]&&!_0x33faac['UserId']){_0x33faac[_0x4c1f('0x3e')]+=0x1;}if(!_0x33faac[_0x4c1f('0x3d')]&&_0x33faac['UserId']){_0x33faac['talking']+=0x1;if(_0x33faac[_0x4c1f('0x3e')]){_0x33faac['waiting']-=0x1;}}if(_0x33faac[_0x4c1f('0x3d')]&&_0x33faac[_0x4c1f('0x3f')]){_0x33faac[_0x4c1f('0x3b')]+=0x1;if(_0x33faac['talking']){_0x33faac[_0x4c1f('0x3a')]-=0x1;}}if(_0x33faac['closed']&&!_0x33faac[_0x4c1f('0x3f')]){_0x33faac[_0x4c1f('0x40')]+=0x1;if(_0x33faac[_0x4c1f('0x3e')]){_0x33faac[_0x4c1f('0x3e')]-=0x1;}}_0x33faac[_0x4c1f('0x3c')]+=0x1;_0x428de1(_0x33faac);});}exports[_0x4c1f('0x41')]=function(_0x47eca0,_0x30066f){var _0x18f471={},_0x4b55ef={},_0x2023b0={'count':0x0,'rows':[]};var _0x4184ec=_[_0x4c1f('0x33')](db[_0x4c1f('0x42')]['rawAttributes'],function(_0x2630ca){return{'name':_0x2630ca[_0x4c1f('0x43')],'type':_0x2630ca['type'][_0x4c1f('0x44')]};});_0x4b55ef['model']=_[_0x4c1f('0x33')](_0x4184ec,'name');_0x4b55ef[_0x4c1f('0x45')]=_['keys'](_0x47eca0[_0x4c1f('0x45')]);_0x4b55ef[_0x4c1f('0x46')]=_[_0x4c1f('0x47')](_0x4b55ef['model'],_0x4b55ef['query']);_0x18f471[_0x4c1f('0x48')]=_['intersection'](_0x4b55ef[_0x4c1f('0x49')],qs[_0x4c1f('0x4a')](_0x47eca0[_0x4c1f('0x45')][_0x4c1f('0x4a')]));_0x18f471[_0x4c1f('0x48')]=_0x18f471[_0x4c1f('0x48')]['length']?_0x18f471[_0x4c1f('0x48')]:_0x4b55ef[_0x4c1f('0x49')];if(!_0x47eca0[_0x4c1f('0x45')][_0x4c1f('0x4b')](_0x4c1f('0x4c'))){_0x18f471[_0x4c1f('0x25')]=qs[_0x4c1f('0x25')](_0x47eca0[_0x4c1f('0x45')][_0x4c1f('0x25')]);_0x18f471[_0x4c1f('0x24')]=qs[_0x4c1f('0x24')](_0x47eca0['query'][_0x4c1f('0x24')]);}_0x18f471[_0x4c1f('0x4d')]=qs[_0x4c1f('0x4e')](_0x47eca0[_0x4c1f('0x45')]['sort']);_0x18f471[_0x4c1f('0x4f')]=qs[_0x4c1f('0x46')](_[_0x4c1f('0x50')](_0x47eca0[_0x4c1f('0x45')],_0x4b55ef[_0x4c1f('0x46')]),_0x4184ec);var _0x32bdcd=[];var _0x3293ce=squel[_0x4c1f('0x51')]()['field']('id')[_0x4c1f('0x52')](_0x4c1f('0x31'))[_0x4c1f('0x52')](_0x4c1f('0x53'))[_0x4c1f('0x54')](_0x4c1f('0x55'));var _0x466eb8=squel[_0x4c1f('0x51')]()[_0x4c1f('0x52')](_0x4c1f('0x56'))[_0x4c1f('0x52')](_0x4c1f('0x57'))[_0x4c1f('0x52')](_0x4c1f('0x58'))[_0x4c1f('0x54')]('user_has_openchannel_interactions','ui')[_0x4c1f('0x59')]('users','u',_0x4c1f('0x5a'));var _0x57ee3f=squel['select']()[_0x4c1f('0x54')](_0x4c1f('0x5b'),'i')[_0x4c1f('0x59')](_0x4c1f('0x5c'),'c',_0x4c1f('0x5d'))[_0x4c1f('0x59')](_0x4c1f('0x5e'),'o','o.id\x20=\x20i.UserId')[_0x4c1f('0x59')](_0x4c1f('0x5f'),'a',_0x4c1f('0x60'))[_0x4c1f('0x59')](_0x4c1f('0x61'),'me',_0x4c1f('0x62'))[_0x4c1f('0x59')](_0x4c1f('0x63'),'it',_0x4c1f('0x64'))[_0x4c1f('0x59')](_0x4c1f('0x55'),'t',_0x4c1f('0x65'));var _0x2f83f0=squel[_0x4c1f('0x66')]();var _0x3a21a3=[];var _0x1c441d=squel[_0x4c1f('0x66')]();var _0x18137f;if(_0x47eca0[_0x4c1f('0x45')][_0x4c1f('0x67')]){_0x18137f=as[_0x4c1f('0x68')](_0x47eca0[_0x4c1f('0x45')][_0x4c1f('0x67')]);var _0xa3487f=_0x18137f['sqlOperator'];for(var _0x3babbf=0x0;_0x3babbf<_0x18137f[_0x4c1f('0x69')]['length'];_0x3babbf++){var _0x4d6a28=_0x18137f[_0x4c1f('0x69')][_0x3babbf];var _0x11775a='i';var _0xc0ff95=_[_0x4c1f('0x6a')](_0x4184ec,[_0x4c1f('0x31'),_0x4d6a28['field']]);if(!_0xc0ff95){switch(_0x4d6a28[_0x4c1f('0x52')]){case'unreadMessages':if(_0x4d6a28['value']==0x1){_0x57ee3f[_0x4c1f('0x6b')]('`'+_0x4d6a28['field']+_0x4c1f('0x6c'));}else{_0x57ee3f['having']('`'+_0x4d6a28[_0x4c1f('0x52')]+_0x4c1f('0x6d'));}break;case _0x4c1f('0x6e'):if(_0x4d6a28[_0x4c1f('0x6f')]===_0x4c1f('0x70')){if(_0x4d6a28['value'][_0x4c1f('0x37')]('\x20')[_0x4c1f('0x71')]>0x1){_0x2f83f0[_0xa3487f](_0x4c1f('0x72'),qs['getFullTextValue'](_0x4d6a28[_0x4c1f('0x73')]),null);}else{var _0x29cb45='%'+_0x4d6a28[_0x4c1f('0x73')]+'%';_0x2f83f0[_0xa3487f]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x29cb45,_0x29cb45,_0x29cb45);}}else{_0xc0ff95=_[_0x4c1f('0x6a')](_0x4184ec,[_0x4c1f('0x31'),_0x4c1f('0x74')]);_0x4d6a28[_0x4c1f('0x52')]='ContactId';_0x205226=as['buildExpression'](_0x11775a,_0xc0ff95[_0x4c1f('0x75')],_0x4d6a28);_0x2f83f0[_0xa3487f](_0x205226[_0x4c1f('0x76')],_0x205226[_0x4c1f('0x73')][_0x4c1f('0x77')],_0x205226[_0x4c1f('0x73')][_0x4c1f('0x23')]);}break;case _0x4c1f('0x78'):var _0x31a53f=_0x4d6a28['value'][_0x4c1f('0x37')](',')[_0x4c1f('0x33')](function(_0x481704){return Number(_0x481704);});_0x31a53f[_0x4c1f('0x38')](function(_0x50090b){_0x1c441d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x50090b+',%');});_0x3a21a3=_[_0x4c1f('0x79')](_0x3a21a3,_0x31a53f);break;case _0x4c1f('0x7a'):if(_0x4d6a28[_0x4c1f('0x6f')]===_0x4c1f('0x70')){_0x2f83f0[_0xa3487f](_0x4c1f('0x7b'),'%'+_0x4d6a28['value']+'%',null);}else{_0xc0ff95=_[_0x4c1f('0x6a')](_0x4184ec,[_0x4c1f('0x31'),_0x4c1f('0x3f')]);_0x4d6a28[_0x4c1f('0x52')]=_0x4c1f('0x3f');_0x205226=as['buildExpression'](_0x11775a,_0xc0ff95[_0x4c1f('0x75')],_0x4d6a28);_0x2f83f0[_0xa3487f](_0x205226['text'],_0x205226[_0x4c1f('0x73')][_0x4c1f('0x77')],_0x205226['value'][_0x4c1f('0x23')]);}break;case'body':_0x205226=as[_0x4c1f('0x7c')]('me',null,_0x4d6a28);_0x2f83f0[_0xa3487f](_0x205226[_0x4c1f('0x76')],_0x205226[_0x4c1f('0x73')]['start'],_0x205226['value']['end']);break;}}else{var _0x205226=as['buildExpression'](_0x11775a,_0xc0ff95[_0x4c1f('0x75')],_0x4d6a28);_0x2f83f0[_0xa3487f](_0x205226['text'],_0x205226['value'][_0x4c1f('0x77')],_0x205226[_0x4c1f('0x73')][_0x4c1f('0x23')]);}}}else{var _0x510cf2=_(_0x47eca0['query'])[_0x4c1f('0x7d')]()[_0x4c1f('0x33')](function(_0x912089){return _[_0x4c1f('0x7e')](_0x4184ec,[_0x4c1f('0x31'),_0x912089])?_0x912089:undefined;})[_0x4c1f('0x7f')]()[_0x4c1f('0x73')]();if(!_[_0x4c1f('0x80')](_0x510cf2)){_0x510cf2['forEach'](function(_0x1a0a9d){if(_0x1a0a9d===_0x4c1f('0x81')){_0x57ee3f[_0x4c1f('0x4f')](_0x4c1f('0x82'),[][_0x4c1f('0x83')](_0x47eca0[_0x4c1f('0x45')][_0x1a0a9d]));}else if(_0x1a0a9d===_0x4c1f('0x84')){var _0x2c7991=JSON[_0x4c1f('0x85')](_0x47eca0[_0x4c1f('0x45')][_0x1a0a9d])[_0x4c1f('0x86')];var _0x4cf036=JSON[_0x4c1f('0x85')](_0x47eca0[_0x4c1f('0x45')][_0x1a0a9d])[_0x4c1f('0x87')];_0x57ee3f[_0x4c1f('0x4f')](_0x4c1f('0x88'),_0x2c7991,_0x4cf036);}else{if(_0x47eca0[_0x4c1f('0x45')][_0x1a0a9d]==='null'){_0x57ee3f['where']('i.'+_0x1a0a9d+_0x4c1f('0x89'));}else{_0x57ee3f[_0x4c1f('0x4f')]('i.'+_0x1a0a9d+_0x4c1f('0x8a'),_0x47eca0[_0x4c1f('0x45')][_0x1a0a9d]);}}});}if(_0x47eca0[_0x4c1f('0x45')][_0x4c1f('0x8b')]){if(_0x47eca0[_0x4c1f('0x45')][_0x4c1f('0x8b')]==0x1){_0x57ee3f[_0x4c1f('0x6b')](_0x4c1f('0x8c'));}else{_0x57ee3f[_0x4c1f('0x6b')]('`unreadMessages`\x20>\x200');}}if(_0x47eca0[_0x4c1f('0x45')][_0x4c1f('0x8d')]){_0x3a21a3=_[_0x4c1f('0x8e')](_0x47eca0[_0x4c1f('0x45')][_0x4c1f('0x8d')])?_0x47eca0[_0x4c1f('0x45')][_0x4c1f('0x8d')]:new Array(_0x47eca0[_0x4c1f('0x45')][_0x4c1f('0x8d')]);_0x3a21a3[_0x4c1f('0x38')](function(_0xcabe4){_0x1c441d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xcabe4+',%');});}if(_0x47eca0[_0x4c1f('0x45')]['filter']){var _0x4b099a=_0x47eca0[_0x4c1f('0x45')][_0x4c1f('0x8f')][_0x4c1f('0x90')]('\x5c','\x5c\x5c')[_0x4c1f('0x90')](/'/g,'\x27\x27');if(qs[_0x4c1f('0x91')](_0x4b099a)){_0x2f83f0['or']('i.id\x20LIKE\x20?',_0x4b099a+'%');}else{_0x2f83f0['or'](_0x4c1f('0x92'),qs[_0x4c1f('0x93')](_0x4b099a))['or'](_0x4c1f('0x94'),_0x4b099a+'%')['or'](_0x4c1f('0x95'),_0x4b099a+'%');}}}_0x57ee3f[_0x4c1f('0x4f')](_0x2f83f0);_0x57ee3f['group'](_0x4c1f('0x96'));var _0x291977={'type':db[_0x4c1f('0x97')][_0x4c1f('0x98')]['SELECT'],'raw':!![]};var _0x19cbd0=_0x57ee3f['clone']();_0x19cbd0[_0x4c1f('0x52')]('i.id');_0x19cbd0[_0x4c1f('0x52')](_0x4c1f('0x99'),_0x4c1f('0x9a'));if(_0x18f471['order']){_0x18f471['order'][_0x4c1f('0x38')](function(_0x104daa){var _0x4d2e4d=_0x104daa[0x0]===_0x4c1f('0x9b')?_0x104daa[0x0]:'i.'+_0x104daa[0x0];_0x57ee3f[_0x4c1f('0x4d')](_0x4d2e4d,_0x104daa[0x1]===_0x4c1f('0x9c')?![]:!![]);});}if(!_[_0x4c1f('0x80')](_0x3a21a3)){_0x57ee3f[_0x4c1f('0x6b')](_0x1c441d);_0x19cbd0[_0x4c1f('0x4f')]('t.id\x20IN\x20?',_0x3a21a3);}BPromise[_0x4c1f('0x9d')]()[_0x4c1f('0x2d')](function(){if(!_0x18137f){if(_0x47eca0[_0x4c1f('0x45')][_0x4c1f('0x81')])return;_0x19cbd0[_0x4c1f('0x4f')](_0x4c1f('0x9e'));_0x57ee3f[_0x4c1f('0x4f')](_0x4c1f('0x9e'));return;}if(_0x47eca0[_0x4c1f('0x9f')][_0x4c1f('0xa0')]!==_0x4c1f('0xa1'))return;return _0x47eca0[_0x4c1f('0x9f')][_0x4c1f('0xa2')]({'attributes':['id'],'raw':!![]})[_0x4c1f('0x2d')](function(_0x34cca4){if(_[_0x4c1f('0x80')](_0x34cca4)){_0x19cbd0['where'](_0x4c1f('0xa3'));_0x57ee3f['where'](_0x4c1f('0xa3'));}else{_0x19cbd0[_0x4c1f('0x4f')](_0x4c1f('0x82'),_[_0x4c1f('0x33')](_0x34cca4,'id'));_0x57ee3f[_0x4c1f('0x4f')](_0x4c1f('0x82'),_[_0x4c1f('0x33')](_0x34cca4,'id'));}});})[_0x4c1f('0x2d')](function(){if(_0x47eca0[_0x4c1f('0x9f')]['role']===_0x4c1f('0xa1')&&!_0x18137f&&!_0x47eca0[_0x4c1f('0x45')][_0x4c1f('0x81')])return[];return db[_0x4c1f('0xa4')][_0x4c1f('0x45')](_0x19cbd0[_0x4c1f('0xa5')](),_0x291977);})['then'](function(_0x3d129b){_0x2023b0[_0x4c1f('0x27')]=_0x3d129b[_0x4c1f('0x71')];if(_0x2023b0['count']===0x0)return[];return db[_0x4c1f('0xa4')]['query'](_0x3293ce['toString'](),_0x291977)[_0x4c1f('0x2d')](function(_0x51d370){_0x32bdcd=_[_0x4c1f('0xa6')](_0x51d370,'id');_0x291977=_[_0x4c1f('0xa7')](_0x291977,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x47eca0[_0x4c1f('0x45')][_0x4c1f('0x4a')]){_0x18f471[_0x4c1f('0x48')]['forEach'](function(_0x502180){_0x57ee3f[_0x4c1f('0x52')]('i.'+_0x502180);});}else{_0x57ee3f['field'](_0x4c1f('0x99'),_0x4c1f('0x9a'));_0x57ee3f[_0x4c1f('0x52')]('a.key',_0x4c1f('0xa8'));_0x57ee3f[_0x4c1f('0x52')]('a.mandatoryDisposition',_0x4c1f('0xa9'));_0x57ee3f[_0x4c1f('0x52')](_0x4c1f('0xaa'),_0x4c1f('0x9b'));_0x57ee3f[_0x4c1f('0x52')](_0x4c1f('0xab'));_0x57ee3f['field']('c.firstName',_0x4c1f('0xac'));_0x57ee3f['field'](_0x4c1f('0xad'),_0x4c1f('0xae'));_0x57ee3f[_0x4c1f('0x52')](_0x4c1f('0xaf'),_0x4c1f('0xb0'));_0x57ee3f[_0x4c1f('0x52')]('c.phone',_0x4c1f('0xb1'));_0x57ee3f[_0x4c1f('0x52')](_0x4c1f('0xb2'),_0x4c1f('0xb3'));_0x57ee3f['field'](_0x4c1f('0xb4'),_0x4c1f('0xb5'));_0x57ee3f[_0x4c1f('0x52')]('o.fullname',_0x4c1f('0xb6'));_0x57ee3f[_0x4c1f('0x52')](_0x4c1f('0xb7'),_0x4c1f('0xb8'));_0x57ee3f[_0x4c1f('0x52')](_0x4c1f('0xb9'),'TagIds');}if(_0x18f471[_0x4c1f('0x25')])_0x57ee3f[_0x4c1f('0x25')](_0x18f471['limit']);if(_0x18f471[_0x4c1f('0x24')])_0x57ee3f[_0x4c1f('0x24')](_0x18f471['offset']);return db[_0x4c1f('0xa4')][_0x4c1f('0x45')](_0x57ee3f['toString'](),_0x291977);})[_0x4c1f('0x2d')](function(_0x3f0d55){if(_0x3f0d55[_0x4c1f('0x71')]>0x0)_0x466eb8[_0x4c1f('0x4f')](_0x4c1f('0xba'),_['map'](_0x3f0d55,'id'));return db['sequelize'][_0x4c1f('0x45')](_0x466eb8['toString'](),_0x291977)['then'](function(_0x2929f6){var _0x3c30d0=_[_0x4c1f('0xbb')](_0x2929f6,_0x4c1f('0xbc'));var _0x27f5bb=[];_0x3f0d55[_0x4c1f('0x38')](function(_0xbc2c89){_0x27f5bb[_0x4c1f('0xbd')](updateOpenchannelInteraction(_0xbc2c89,_0x32bdcd,_0x3c30d0));});return BPromise[_0x4c1f('0xbe')](_0x27f5bb);});});})[_0x4c1f('0x2d')](function(_0x45eafa){_0x2023b0[_0x4c1f('0xbf')]=_0x45eafa;return _0x2023b0;})['then'](respondWithFilteredResult(_0x30066f,_0x18f471))[_0x4c1f('0x39')](handleError(_0x30066f,null));};exports['show']=function(_0x35aa6a,_0x1a5265){var _0x508ead={};if(_0x35aa6a[_0x4c1f('0x45')][_0x4c1f('0x75')]&&_0x35aa6a[_0x4c1f('0x45')][_0x4c1f('0x75')]===_0x4c1f('0x54')){_0x508ead[_0x4c1f('0x54')]=_0x35aa6a[_0x4c1f('0xc0')]['id'];}else{_0x508ead['id']=_0x35aa6a[_0x4c1f('0xc0')]['id'];}var _0x423c90={'raw':![],'where':_0x508ead},_0x1989e3={};_0x1989e3[_0x4c1f('0x49')]=_[_0x4c1f('0x7d')](db[_0x4c1f('0x42')]['rawAttributes']);_0x1989e3[_0x4c1f('0x45')]=_[_0x4c1f('0x7d')](_0x35aa6a[_0x4c1f('0x45')]);_0x1989e3[_0x4c1f('0x46')]=_[_0x4c1f('0x47')](_0x1989e3[_0x4c1f('0x49')],_0x1989e3[_0x4c1f('0x45')]);_0x423c90[_0x4c1f('0x48')]=_['intersection'](_0x1989e3['model'],qs[_0x4c1f('0x4a')](_0x35aa6a[_0x4c1f('0x45')][_0x4c1f('0x4a')]));_0x423c90[_0x4c1f('0x48')]=_0x423c90[_0x4c1f('0x48')][_0x4c1f('0x71')]?_0x423c90['attributes']:_0x1989e3[_0x4c1f('0x49')];if(_0x35aa6a['query'][_0x4c1f('0xc1')]){_0x423c90[_0x4c1f('0xc2')]=[{'all':!![]}];}_0x423c90=_[_0x4c1f('0xa7')]({},_0x423c90,_0x35aa6a[_0x4c1f('0xc3')]);return db[_0x4c1f('0x42')][_0x4c1f('0x6a')](_0x423c90)[_0x4c1f('0x2d')](handleEntityNotFound(_0x1a5265,null))['then'](respondWithResult(_0x1a5265,null))[_0x4c1f('0x39')](handleError(_0x1a5265,null));};exports['create']=function(_0x514810,_0x570a9d){return db[_0x4c1f('0x42')][_0x4c1f('0xc4')](_0x514810[_0x4c1f('0xc5')],{})[_0x4c1f('0x2d')](respondWithResult(_0x570a9d,0xc9))['catch'](handleError(_0x570a9d,null));};exports['update']=function(_0x47fb62,_0x2b4866){if(_0x47fb62[_0x4c1f('0xc5')]['id']){delete _0x47fb62[_0x4c1f('0xc5')]['id'];}return db[_0x4c1f('0x42')][_0x4c1f('0x6a')]({'where':{'id':_0x47fb62[_0x4c1f('0xc0')]['id']}})[_0x4c1f('0x2d')](handleEntityNotFound(_0x2b4866,null))['then'](saveUpdates(_0x47fb62['body'],null))[_0x4c1f('0x2d')](respondWithResult(_0x2b4866,null))[_0x4c1f('0x39')](handleError(_0x2b4866,null));};exports['destroy']=function(_0xb2b9b1,_0x3bc341){return db['OpenchannelInteraction'][_0x4c1f('0x6a')]({'where':{'id':_0xb2b9b1[_0x4c1f('0xc0')]['id']}})[_0x4c1f('0x2d')](handleEntityNotFound(_0x3bc341,null))[_0x4c1f('0x2d')](removeEntity(_0x3bc341,null))['catch'](handleError(_0x3bc341,null));};exports['describe']=function(_0x248525,_0x2b03f4){return db['OpenchannelInteraction'][_0x4c1f('0xc6')]()[_0x4c1f('0x2d')](respondWithResult(_0x2b03f4,null))['catch'](handleError(_0x2b03f4,null));};exports[_0x4c1f('0xc7')]=function(_0x512d16,_0x147007,_0x27290d){return db['OpenchannelMessage']['find']({'where':{'id':_0x512d16[_0x4c1f('0xc0')]['id']}})['then'](handleEntityNotFound(_0x147007,null))[_0x4c1f('0x2d')](function(_0x5ae7e9){if(_0x5ae7e9){return _0x5ae7e9[_0x4c1f('0xc7')](_0x512d16[_0x4c1f('0xc5')][_0x4c1f('0xc8')],_[_0x4c1f('0xc9')](_0x512d16[_0x4c1f('0xc5')],['ids','id'])||{});}})[_0x4c1f('0x2d')](respondWithResult(_0x147007,null))['catch'](handleError(_0x147007,null));};exports[_0x4c1f('0xca')]=function(_0x2ad985,_0x3d096b,_0x16c0d0){var _0x512e7d={'raw':![],'where':{}};var _0x7e9723={};var _0xdfa04f={'count':0x0,'rows':[]};return db[_0x4c1f('0x42')][_0x4c1f('0xcb')]({'where':{'id':_0x2ad985['params']['id']}})[_0x4c1f('0x2d')](handleEntityNotFound(_0x3d096b,null))[_0x4c1f('0x2d')](function(_0x24d3a5){if(_0x24d3a5){_0x7e9723['model']=_[_0x4c1f('0x7d')](db[_0x4c1f('0xcc')][_0x4c1f('0xcd')]);_0x7e9723[_0x4c1f('0x45')]=_[_0x4c1f('0x7d')](_0x2ad985['query']);_0x7e9723[_0x4c1f('0x46')]=_['intersection'](_0x7e9723[_0x4c1f('0x49')],_0x7e9723[_0x4c1f('0x45')]);_0x512e7d[_0x4c1f('0x48')]=_[_0x4c1f('0x47')](_0x7e9723['model'],qs[_0x4c1f('0x4a')](_0x2ad985[_0x4c1f('0x45')][_0x4c1f('0x4a')]));_0x512e7d[_0x4c1f('0x48')]=_0x512e7d['attributes']['length']?_0x512e7d[_0x4c1f('0x48')]:_0x7e9723[_0x4c1f('0x49')];if(!_0x2ad985[_0x4c1f('0x45')][_0x4c1f('0x4b')](_0x4c1f('0x4c'))){_0x512e7d[_0x4c1f('0x25')]=qs[_0x4c1f('0x25')](_0x2ad985[_0x4c1f('0x45')][_0x4c1f('0x25')]);_0x512e7d['offset']=qs[_0x4c1f('0x24')](_0x2ad985['query'][_0x4c1f('0x24')]);}_0x512e7d['order']=qs[_0x4c1f('0x4e')](_0x2ad985[_0x4c1f('0x45')][_0x4c1f('0x4e')]);_0x512e7d['where']=qs[_0x4c1f('0x46')](_[_0x4c1f('0x50')](_0x2ad985[_0x4c1f('0x45')],_0x7e9723[_0x4c1f('0x46')]));_0x512e7d['where']['OpenchannelInteractionId']=_0x24d3a5['id'];if(_0x2ad985['query'][_0x4c1f('0x8f')]){_0x512e7d['where']=_[_0x4c1f('0xa7')](_0x512e7d[_0x4c1f('0x4f')],{'$or':_[_0x4c1f('0x33')](_0x512e7d[_0x4c1f('0x48')],function(_0x3ce7a8){var _0x20bfa0={};_0x20bfa0[_0x3ce7a8]={'$like':'%'+_0x2ad985[_0x4c1f('0x45')][_0x4c1f('0x8f')]+'%'};return _0x20bfa0;})});}if(_0x2ad985[_0x4c1f('0x45')][_0x4c1f('0x86')]){var _0x43c589=_0x2ad985[_0x4c1f('0x45')]['$gte']['split'](',');var _0x349011={};_0x349011[_0x43c589[0x0]]={'$gte':moment(_0x43c589[0x1])[_0x4c1f('0xce')]('YYYY-MM-DD\x20HH:mm:ss')};_0x512e7d[_0x4c1f('0x4f')]=_[_0x4c1f('0xa7')](_0x512e7d[_0x4c1f('0x4f')],_0x349011);}_0x512e7d=_['merge']({},_0x512e7d,_0x2ad985[_0x4c1f('0xc3')]);return db[_0x4c1f('0xcc')]['count']({'where':_0x512e7d[_0x4c1f('0x4f')]})['then'](function(_0x11291b){_0xdfa04f[_0x4c1f('0x27')]=_0x11291b;if(_0x2ad985[_0x4c1f('0x45')][_0x4c1f('0xc1')]){_0x512e7d[_0x4c1f('0xc2')]=[{'all':!![]}];}return db[_0x4c1f('0xcc')]['findAll'](_0x512e7d);})[_0x4c1f('0x2d')](function(_0x4e1cb4){_0xdfa04f[_0x4c1f('0xbf')]=_0x4e1cb4;return _0xdfa04f;});}})['then'](respondWithFilteredResult(_0x3d096b,_0x512e7d))[_0x4c1f('0x39')](handleError(_0x3d096b,null));};exports[_0x4c1f('0xcf')]=function(_0x1acb03,_0xb5b22,_0x45edf7){return db[_0x4c1f('0x42')][_0x4c1f('0x6a')]({'where':{'id':_0x1acb03[_0x4c1f('0xc0')]['id']}})[_0x4c1f('0x2d')](handleEntityNotFound(_0xb5b22,null))['then'](function(_0x4224df){if(_0x4224df){return _0x4224df['setTags'](_0x1acb03['body'][_0x4c1f('0xc8')],_[_0x4c1f('0xc9')](_0x1acb03[_0x4c1f('0xc5')],['ids','id'])||{})[_0x4c1f('0xd0')](function(){return db['Tag']['findAll']({'attributes':['id',_0x4c1f('0x31'),'color'],'where':{'id':_0x1acb03[_0x4c1f('0xc5')][_0x4c1f('0xc8')]}});})[_0x4c1f('0x2d')](function(_0x344249){socket[_0x4c1f('0xd1')](_0x4c1f('0xd2'),{'id':Number(_0x1acb03['params']['id']),'tags':_0x344249||[]});return{'id':Number(_0x1acb03[_0x4c1f('0xc0')]['id']),'tags':_0x344249||[]};});}})['then'](respondWithResult(_0xb5b22,null))[_0x4c1f('0x39')](handleError(_0xb5b22,null));};exports[_0x4c1f('0xd3')]=function(_0x3f22c7,_0x18ed1f,_0x1126d2){return db[_0x4c1f('0x42')][_0x4c1f('0x6a')]({'where':{'id':_0x3f22c7['params']['id']}})['then'](handleEntityNotFound(_0x18ed1f,null))['then'](function(_0x41e92d){if(_0x41e92d){return _0x41e92d['removeTags'](_0x3f22c7[_0x4c1f('0x45')]['ids']);}})[_0x4c1f('0x2d')](respondWithStatusCode(_0x18ed1f,null))[_0x4c1f('0x39')](handleError(_0x18ed1f,null));};exports['download']=function(_0x5e2838,_0x2f5372){var _0x263d00=moment()['unix']()[_0x4c1f('0xa5')]();var _0x5e0ac2=path['join'](config[_0x4c1f('0xd4')],_0x4c1f('0xd5'),_0x4c1f('0xd6'),'tmp');var _0x1b8d44=path[_0x4c1f('0xd7')](config[_0x4c1f('0xd4')],'server',_0x4c1f('0xd6'),_0x4c1f('0xd8'));var _0x371e8d=path['join'](_0x5e0ac2,_0x263d00);var _0x4282c7=util['format']('transcript-%d-%s.zip',_0x5e2838['params']['id'],_0x263d00);var _0x1ab971=path['join'](_0x5e0ac2,_0x4282c7);var _0x253d94=[];_0x253d94[_0x4c1f('0xbd')]({'model':db[_0x4c1f('0x7a')],'as':_0x4c1f('0x7a'),'attributes':['id',_0x4c1f('0x34')],'raw':!![]});_0x253d94['push']({'model':db[_0x4c1f('0xd9')],'as':_0x4c1f('0x6e'),'attributes':['id',_0x4c1f('0xda'),_0x4c1f('0xdb')],'raw':!![]});if(_0x5e2838[_0x4c1f('0x45')][_0x4c1f('0xd8')]){_0x253d94['push']({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x520ca5=[{'model':db['OpenchannelMessage'],'as':'Messages','attributes':['id','body','createdAt','direction',_0x4c1f('0xdc'),_0x4c1f('0x8b')],'include':_0x253d94}];_0x520ca5['push']({'model':db['OpenchannelAccount'],'as':_0x4c1f('0xdd'),'attributes':['id',_0x4c1f('0x31')]});_0x520ca5[_0x4c1f('0xbd')]({'model':db['User'],'as':_0x4c1f('0xde'),'attributes':['id',_0x4c1f('0x34')]});return db[_0x4c1f('0x42')][_0x4c1f('0x6a')]({'where':{'id':_0x5e2838['params']['id']},'include':_0x520ca5})[_0x4c1f('0x2d')](handleEntityNotFound(_0x2f5372,null))[_0x4c1f('0x2d')](function(_0x365a1a){if(_0x365a1a){var _0x1f8f90=_0x365a1a['get']({'plain':!![]});fs[_0x4c1f('0xdf')](_0x371e8d);var _0x28ee72={'channel':'Openchannel','account':_0x1f8f90['Account'][_0x4c1f('0x31')],'agent':_0x1f8f90[_0x4c1f('0xde')]?_0x1f8f90[_0x4c1f('0xde')]['fullname']:_0x4c1f('0xe0'),'createdAt':moment(_0x1f8f90[_0x4c1f('0x84')])[_0x4c1f('0xce')](_0x4c1f('0xe1'))[_0x4c1f('0xa5')](),'closedAt':_0x1f8f90[_0x4c1f('0x3d')]?moment(_0x1f8f90['closedAt'])[_0x4c1f('0xce')](_0x4c1f('0xe1'))[_0x4c1f('0xa5')]():'','disposition':_0x1f8f90[_0x4c1f('0xe2')],'visibility':_0x1f8f90[_0x4c1f('0xe3')]?'Public':_0x4c1f('0xe4'),'messages':_(_0x1f8f90[_0x4c1f('0xe5')])['filter']({'secret':![]})[_0x4c1f('0x33')](function(_0x2ce9af){if(_0x2ce9af['Attachment']){var _0x4db44b=path[_0x4c1f('0xd7')](_0x1b8d44,_0x2ce9af[_0x4c1f('0xe6')][_0x4c1f('0xe7')]);if(fs[_0x4c1f('0xe8')](_0x4db44b)){fs[_0x4c1f('0xe9')](_0x4db44b)[_0x4c1f('0xea')](fs['createWriteStream'](path[_0x4c1f('0xd7')](_0x371e8d,_0x2ce9af['Attachment']['basename'])));}}return{'date':moment(_0x2ce9af[_0x4c1f('0x84')])[_0x4c1f('0xce')](_0x4c1f('0xe1'))[_0x4c1f('0xa5')](),'sender':_0x2ce9af[_0x4c1f('0xeb')]==='out'?_0x2ce9af[_0x4c1f('0x7a')]?_0x2ce9af['User'][_0x4c1f('0x34')]:_0x4c1f('0xec'):_0x2ce9af[_0x4c1f('0x6e')][_0x4c1f('0xda')]+(_0x2ce9af[_0x4c1f('0x6e')][_0x4c1f('0xdb')]?'\x20'+_0x2ce9af[_0x4c1f('0x6e')]['lastName']:''),'body':_0x2ce9af['Attachment']?_0x2ce9af[_0x4c1f('0xe6')]['basename']:_0x2ce9af['body'],'direction':_0x2ce9af[_0x4c1f('0xeb')]===_0x4c1f('0xed')?'A':'C','secret':_0x2ce9af['secret'],'read':_0x2ce9af['read'],'attachment':_0x2ce9af[_0x4c1f('0xe6')]};})[_0x4c1f('0x73')]()};return ejs[_0x4c1f('0xee')](path[_0x4c1f('0xd7')](config[_0x4c1f('0xd4')],_0x4c1f('0xd5'),'views',_0x4c1f('0xef')),{'interaction':_0x28ee72})[_0x4c1f('0x2d')](function(_0x3d53a0){var _0x1f277e=path['join'](_0x371e8d,_0x4c1f('0xf0')+_0x1f8f90['id']+'-'+_0x263d00+_0x4c1f('0xf1'));var _0x5d4bb0={'path':_0x1f277e,'channel':_0x4c1f('0xf2'),'interactionId':_0x1f8f90['id']};return pdf[_0x4c1f('0xf3')](_0x3d53a0,_0x5d4bb0);})[_0x4c1f('0x2d')](function(){return new BPromise(function(_0x4ca76e,_0x1f827a){zipdir(_0x371e8d,{'saveTo':_0x1ab971},function(_0x3a0a72,_0x9b7b68){if(_0x3a0a72)return _0x1f827a(_0x3a0a72);return _0x4ca76e(_0x9b7b68);});})[_0x4c1f('0x2d')](function(){return new BPromise(function(_0x5be585,_0x2c3f5f){rimraf(_0x371e8d,function(_0x34fbe2){if(_0x34fbe2)_0x2c3f5f(_0x34fbe2);return _0x5be585();});});})['then'](function(){return _0x2f5372[_0x4c1f('0xf4')](_0x1ab971,_0x4282c7,function(_0x2230a9){if(_0x2230a9){console[_0x4c1f('0xf5')]('err',_0x2230a9);}else{fs[_0x4c1f('0xf6')](_0x1ab971);}});});});}else{return _0x2f5372[_0x4c1f('0x2f')](0xc8);}})[_0x4c1f('0x39')](handleError(_0x2f5372,null));};
\ No newline at end of file
+var _0x14ce=['isArray','filter','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','getOpenchannelAccounts','isEmpty','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','catch','show','params','keys','includeAll','include','merge','create','body','describe','addMessage','ids','omit','findOne','OpenchannelMessage','options','findAll','setTags','spread','removeTags','download','unix','join','server','files','tmp','attachments','format','transcript-%d-%s.zip','fullname','Contact','firstName','lastName','Attachment','Messages','OpenchannelAccount','Account','get','mkdirSync','Openchannel','Owner','N.A.','closedAt','threadId','Public','existsSync','createReadStream','pipe','createWriteStream','basename','YYYY-MM-DD\x20HH:mm:ss','out','direction','secret','renderFile','root','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','./openchannelInteraction.socket','register','status','end','json','offset','undefined','count','limit','reject','then','destroy','sendStatus','error','name','send','Users','map','TagIds','Tags','split','forEach','push','waiting','unmanaged','total','closed','UserId','talking','index','OpenchannelInteraction','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','tools_tags','u.id','ui.OpenchannelInteractionId','from','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','conditions','find','unreadMessages','value','having','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','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','buildExpression','compact','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag'];(function(_0x283a88,_0x2203f7){var _0x49d7ea=function(_0xc96e6c){while(--_0xc96e6c){_0x283a88['push'](_0x283a88['shift']());}};_0x49d7ea(++_0x2203f7);}(_0x14ce,0x160));var _0xe14c=function(_0x179dae,_0x419d2f){_0x179dae=_0x179dae-0x0;var _0x2dd306=_0x14ce[_0x179dae];return _0x2dd306;};'use strict';var emlformat=require(_0xe14c('0x0'));var rimraf=require(_0xe14c('0x1'));var zipdir=require(_0xe14c('0x2'));var jsonpatch=require(_0xe14c('0x3'));var rp=require(_0xe14c('0x4'));var moment=require(_0xe14c('0x5'));var BPromise=require(_0xe14c('0x6'));var Mustache=require('mustache');var util=require(_0xe14c('0x7'));var path=require('path');var sox=require(_0xe14c('0x8'));var csv=require(_0xe14c('0x9'));var ejs=require(_0xe14c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe14c('0xb'));var squel=require(_0xe14c('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe14c('0xd'));var toCsv=require(_0xe14c('0x9'));var querystring=require(_0xe14c('0xe'));var Papa=require(_0xe14c('0xf'));var Redis=require(_0xe14c('0x10'));var authService=require(_0xe14c('0x11'));var qs=require(_0xe14c('0x12'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xe14c('0x13'));var hardwareService=require(_0xe14c('0x14'));var logger=require('../../config/logger')(_0xe14c('0x15'));var utils=require(_0xe14c('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe14c('0x17'));var db=require(_0xe14c('0x18'))['db'];config['redis']=_[_0xe14c('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe14c('0x1a')]));require(_0xe14c('0x1b'))[_0xe14c('0x1c')](socket);function respondWithStatusCode(_0x2489dc,_0x428743){_0x428743=_0x428743||0xcc;return function(_0xe97e1f){if(_0xe97e1f){return _0x2489dc['sendStatus'](_0x428743);}return _0x2489dc[_0xe14c('0x1d')](_0x428743)[_0xe14c('0x1e')]();};}function respondWithResult(_0x336b28,_0x276a0f){_0x276a0f=_0x276a0f||0xc8;return function(_0x486e1b){if(_0x486e1b){return _0x336b28[_0xe14c('0x1d')](_0x276a0f)[_0xe14c('0x1f')](_0x486e1b);}};}function respondWithFilteredResult(_0x5703fd,_0x23a3d7){return function(_0x47fab4){if(_0x47fab4){var _0xcdb183=typeof _0x23a3d7[_0xe14c('0x20')]===_0xe14c('0x21')&&typeof _0x23a3d7['limit']===_0xe14c('0x21');var _0x4392f8=_0x47fab4[_0xe14c('0x22')];var _0x4a9a03=_0xcdb183?0x0:_0x23a3d7[_0xe14c('0x20')];var _0x34726e=_0xcdb183?_0x47fab4[_0xe14c('0x22')]:_0x23a3d7['offset']+_0x23a3d7[_0xe14c('0x23')];var _0x32a556;if(_0x34726e>=_0x4392f8){_0x34726e=_0x4392f8;_0x32a556=0xc8;}else{_0x32a556=0xce;}_0x5703fd['status'](_0x32a556);return _0x5703fd['set']('Content-Range',_0x4a9a03+'-'+_0x34726e+'/'+_0x4392f8)[_0xe14c('0x1f')](_0x47fab4);}return null;};}function patchUpdates(_0x31b15a){return function(_0x3aa9cc){try{jsonpatch['apply'](_0x3aa9cc,_0x31b15a,!![]);}catch(_0x4710be){return BPromise[_0xe14c('0x24')](_0x4710be);}return _0x3aa9cc['save']();};}function saveUpdates(_0x2b2726,_0x59a463){return function(_0x1018a0){if(_0x1018a0){return _0x1018a0['update'](_0x2b2726)[_0xe14c('0x25')](function(_0x36fe7c){return _0x36fe7c;});}return null;};}function removeEntity(_0x468601,_0x561c0b){return function(_0x1710e8){if(_0x1710e8){return _0x1710e8[_0xe14c('0x26')]()[_0xe14c('0x25')](function(){_0x468601['status'](0xcc)[_0xe14c('0x1e')]();});}};}function handleEntityNotFound(_0x14982b,_0x4e17b2){return function(_0x596953){if(!_0x596953){_0x14982b[_0xe14c('0x27')](0x194);}return _0x596953;};}function handleError(_0x5e1cab,_0x22af75){_0x22af75=_0x22af75||0x1f4;return function(_0x514ac7){logger[_0xe14c('0x28')](_0x514ac7['stack']);if(_0x514ac7[_0xe14c('0x29')]){delete _0x514ac7[_0xe14c('0x29')];}_0x5e1cab[_0xe14c('0x1d')](_0x22af75)[_0xe14c('0x2a')](_0x514ac7);};}function getInteractionUsers(_0x9d7506,_0x132b30){return new BPromise(function(_0x101a39,_0x3aa6d6){try{if(_0x132b30[_0x9d7506['id']]){_0x9d7506[_0xe14c('0x2b')]=_[_0xe14c('0x2c')](_0x132b30[_0x9d7506['id']],function(_0x3817c6){return{'id':_0x3817c6['id'],'fullname':_0x3817c6['fullname']};});}}catch(_0x21ae3a){_0x3aa6d6(_0x21ae3a);}_0x101a39(_0x9d7506);});}function getInteractionTags(_0x5c2c32,_0x2faba6){return new BPromise(function(_0x28be22,_0x23fa1d){try{if(_0x5c2c32[_0xe14c('0x2d')]){_0x5c2c32[_0xe14c('0x2e')]=[];_0x5c2c32['TagIds'][_0xe14c('0x2f')](',')[_0xe14c('0x30')](function(_0x33a46a){_0x5c2c32['Tags'][_0xe14c('0x31')](_0x2faba6[_0x33a46a]);});}delete _0x5c2c32[_0xe14c('0x2d')];}catch(_0x4b9e3e){_0x23fa1d(_0x4b9e3e);}_0x28be22(_0x5c2c32);});}function updateOpenchannelInteraction(_0x3518f7,_0x1961c5,_0x153529){return new BPromise(function(_0x43b27c,_0x3ad4e7){return getInteractionUsers(_0x3518f7,_0x153529)['then'](function(_0x53a272){return getInteractionTags(_0x53a272,_0x1961c5);})['then'](function(_0x2b5461){return getStateInteraction(_0x2b5461);})[_0xe14c('0x25')](function(_0x23a7ef){_0x43b27c(_0x23a7ef);})['catch'](function(_0x145d1b){_0x3ad4e7(_0x145d1b);});});}function getStateInteraction(_0x33a4b9){return new BPromise(function(_0x1f9444){_0x33a4b9[_0xe14c('0x32')]=0x0;_0x33a4b9['talking']=0x0;_0x33a4b9['answered']=0x0;_0x33a4b9[_0xe14c('0x33')]=0x0;_0x33a4b9[_0xe14c('0x34')]=0x0;if(!_0x33a4b9[_0xe14c('0x35')]&&!_0x33a4b9['UserId']){_0x33a4b9['waiting']+=0x1;}if(!_0x33a4b9[_0xe14c('0x35')]&&_0x33a4b9[_0xe14c('0x36')]){_0x33a4b9[_0xe14c('0x37')]+=0x1;if(_0x33a4b9[_0xe14c('0x32')]){_0x33a4b9['waiting']-=0x1;}}if(_0x33a4b9[_0xe14c('0x35')]&&_0x33a4b9[_0xe14c('0x36')]){_0x33a4b9['answered']+=0x1;if(_0x33a4b9[_0xe14c('0x37')]){_0x33a4b9['talking']-=0x1;}}if(_0x33a4b9[_0xe14c('0x35')]&&!_0x33a4b9['UserId']){_0x33a4b9['unmanaged']+=0x1;if(_0x33a4b9['waiting']){_0x33a4b9['waiting']-=0x1;}}_0x33a4b9[_0xe14c('0x34')]+=0x1;_0x1f9444(_0x33a4b9);});}exports[_0xe14c('0x38')]=function(_0x1944b4,_0x34d27b){var _0x4ddfe5={},_0x3f7bf3={},_0x16cd06={'count':0x0,'rows':[]};var _0x140d20=_[_0xe14c('0x2c')](db[_0xe14c('0x39')][_0xe14c('0x3a')],function(_0x30c52b){return{'name':_0x30c52b[_0xe14c('0x3b')],'type':_0x30c52b[_0xe14c('0x3c')]['key']};});_0x3f7bf3[_0xe14c('0x3d')]=_['map'](_0x140d20,_0xe14c('0x29'));_0x3f7bf3[_0xe14c('0x3e')]=_['keys'](_0x1944b4[_0xe14c('0x3e')]);_0x3f7bf3[_0xe14c('0x3f')]=_[_0xe14c('0x40')](_0x3f7bf3[_0xe14c('0x3d')],_0x3f7bf3['query']);_0x4ddfe5[_0xe14c('0x41')]=_[_0xe14c('0x40')](_0x3f7bf3['model'],qs[_0xe14c('0x42')](_0x1944b4[_0xe14c('0x3e')]['fields']));_0x4ddfe5['attributes']=_0x4ddfe5[_0xe14c('0x41')][_0xe14c('0x43')]?_0x4ddfe5[_0xe14c('0x41')]:_0x3f7bf3[_0xe14c('0x3d')];if(!_0x1944b4[_0xe14c('0x3e')][_0xe14c('0x44')](_0xe14c('0x45'))){_0x4ddfe5[_0xe14c('0x23')]=qs[_0xe14c('0x23')](_0x1944b4[_0xe14c('0x3e')][_0xe14c('0x23')]);_0x4ddfe5[_0xe14c('0x20')]=qs[_0xe14c('0x20')](_0x1944b4[_0xe14c('0x3e')][_0xe14c('0x20')]);}_0x4ddfe5['order']=qs[_0xe14c('0x46')](_0x1944b4['query'][_0xe14c('0x46')]);_0x4ddfe5[_0xe14c('0x47')]=qs[_0xe14c('0x3f')](_[_0xe14c('0x48')](_0x1944b4['query'],_0x3f7bf3['filters']),_0x140d20);var _0x450a86=[];var _0x36b5e0=squel[_0xe14c('0x49')]()['field']('id')[_0xe14c('0x4a')]('name')[_0xe14c('0x4a')](_0xe14c('0x4b'))['from'](_0xe14c('0x4c'));var _0x515848=squel[_0xe14c('0x49')]()[_0xe14c('0x4a')](_0xe14c('0x4d'))[_0xe14c('0x4a')]('u.fullname')[_0xe14c('0x4a')](_0xe14c('0x4e'))[_0xe14c('0x4f')](_0xe14c('0x50'),'ui')[_0xe14c('0x51')](_0xe14c('0x52'),'u',_0xe14c('0x53'));var _0x11aaac=squel[_0xe14c('0x49')]()['from'](_0xe14c('0x54'),'i')[_0xe14c('0x51')](_0xe14c('0x55'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xe14c('0x51')](_0xe14c('0x52'),'o','o.id\x20=\x20i.UserId')[_0xe14c('0x51')]('openchannel_accounts','a',_0xe14c('0x56'))['left_join'](_0xe14c('0x57'),'me',_0xe14c('0x58'))[_0xe14c('0x51')](_0xe14c('0x59'),'it',_0xe14c('0x5a'))[_0xe14c('0x51')]('tools_tags','t',_0xe14c('0x5b'));var _0x5414d0=squel['expr']();var _0x5d815c=[];var _0x471553=squel[_0xe14c('0x5c')]();var _0x558109;if(_0x1944b4[_0xe14c('0x3e')]['search']){_0x558109=as[_0xe14c('0x5d')](_0x1944b4[_0xe14c('0x3e')][_0xe14c('0x5e')]);var _0x42c0ec=_0x558109['sqlOperator'];for(var _0x4e5521=0x0;_0x4e5521<_0x558109['conditions']['length'];_0x4e5521++){var _0x1b56e3=_0x558109[_0xe14c('0x5f')][_0x4e5521];var _0x5a9315='i';var _0x4d598f=_[_0xe14c('0x60')](_0x140d20,[_0xe14c('0x29'),_0x1b56e3[_0xe14c('0x4a')]]);if(!_0x4d598f){switch(_0x1b56e3[_0xe14c('0x4a')]){case _0xe14c('0x61'):if(_0x1b56e3[_0xe14c('0x62')]==0x1){_0x11aaac[_0xe14c('0x63')]('`'+_0x1b56e3[_0xe14c('0x4a')]+'`\x20=\x200');}else{_0x11aaac[_0xe14c('0x63')]('`'+_0x1b56e3['field']+'`\x20>\x200');}break;case'Contact':if(_0x1b56e3[_0xe14c('0x64')]===_0xe14c('0x65')){if(_0x1b56e3[_0xe14c('0x62')][_0xe14c('0x2f')]('\x20')[_0xe14c('0x43')]>0x1){_0x5414d0[_0x42c0ec](_0xe14c('0x66'),qs[_0xe14c('0x67')](_0x1b56e3[_0xe14c('0x62')]),null);}else{var _0xb306b8='%'+_0x1b56e3[_0xe14c('0x62')]+'%';_0x5414d0[_0x42c0ec](_0xe14c('0x68'),_0xb306b8,_0xb306b8,_0xb306b8);}}else{_0x4d598f=_[_0xe14c('0x60')](_0x140d20,[_0xe14c('0x29'),_0xe14c('0x69')]);_0x1b56e3[_0xe14c('0x4a')]=_0xe14c('0x69');_0x1701c0=as['buildExpression'](_0x5a9315,_0x4d598f['type'],_0x1b56e3);_0x5414d0[_0x42c0ec](_0x1701c0[_0xe14c('0x6a')],_0x1701c0['value'][_0xe14c('0x6b')],_0x1701c0[_0xe14c('0x62')][_0xe14c('0x1e')]);}break;case _0xe14c('0x6c'):var _0x32deb3=_0x1b56e3[_0xe14c('0x62')]['split'](',')[_0xe14c('0x2c')](function(_0x1831c0){return Number(_0x1831c0);});_0x32deb3[_0xe14c('0x30')](function(_0x5ac22c){_0x471553['or'](_0xe14c('0x6d'),'%,'+_0x5ac22c+',%');});_0x5d815c=_[_0xe14c('0x6e')](_0x5d815c,_0x32deb3);break;case _0xe14c('0x6f'):if(_0x1b56e3[_0xe14c('0x64')]==='$substring'){_0x5414d0[_0x42c0ec]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x1b56e3[_0xe14c('0x62')]+'%',null);}else{_0x4d598f=_[_0xe14c('0x60')](_0x140d20,[_0xe14c('0x29'),'UserId']);_0x1b56e3[_0xe14c('0x4a')]='UserId';_0x1701c0=as[_0xe14c('0x70')](_0x5a9315,_0x4d598f['type'],_0x1b56e3);_0x5414d0[_0x42c0ec](_0x1701c0[_0xe14c('0x6a')],_0x1701c0[_0xe14c('0x62')][_0xe14c('0x6b')],_0x1701c0[_0xe14c('0x62')][_0xe14c('0x1e')]);}break;case'body':_0x1701c0=as[_0xe14c('0x70')]('me',null,_0x1b56e3);_0x5414d0[_0x42c0ec](_0x1701c0[_0xe14c('0x6a')],_0x1701c0['value']['start'],_0x1701c0['value'][_0xe14c('0x1e')]);break;}}else{var _0x1701c0=as['buildExpression'](_0x5a9315,_0x4d598f[_0xe14c('0x3c')],_0x1b56e3);_0x5414d0[_0x42c0ec](_0x1701c0['text'],_0x1701c0[_0xe14c('0x62')][_0xe14c('0x6b')],_0x1701c0['value'][_0xe14c('0x1e')]);}}}else{var _0x29855c=_(_0x1944b4[_0xe14c('0x3e')])['keys']()[_0xe14c('0x2c')](function(_0x42fcee){return _['some'](_0x140d20,[_0xe14c('0x29'),_0x42fcee])?_0x42fcee:undefined;})[_0xe14c('0x71')]()[_0xe14c('0x62')]();if(!_['isEmpty'](_0x29855c)){_0x29855c[_0xe14c('0x30')](function(_0x1d3b14){if(_0x1d3b14===_0xe14c('0x72')){_0x11aaac[_0xe14c('0x47')](_0xe14c('0x73'),[][_0xe14c('0x74')](_0x1944b4['query'][_0x1d3b14]));}else if(_0x1d3b14===_0xe14c('0x75')){var _0x1ce403=JSON[_0xe14c('0x76')](_0x1944b4[_0xe14c('0x3e')][_0x1d3b14])[_0xe14c('0x77')];var _0x18faf1=JSON[_0xe14c('0x76')](_0x1944b4['query'][_0x1d3b14])[_0xe14c('0x78')];_0x11aaac[_0xe14c('0x47')](_0xe14c('0x79'),_0x1ce403,_0x18faf1);}else{if(_0x1944b4[_0xe14c('0x3e')][_0x1d3b14]===_0xe14c('0x7a')){_0x11aaac[_0xe14c('0x47')]('i.'+_0x1d3b14+_0xe14c('0x7b'));}else{_0x11aaac[_0xe14c('0x47')]('i.'+_0x1d3b14+_0xe14c('0x7c'),_0x1944b4[_0xe14c('0x3e')][_0x1d3b14]);}}});}if(_0x1944b4['query'][_0xe14c('0x7d')]){if(_0x1944b4[_0xe14c('0x3e')]['read']==0x1){_0x11aaac[_0xe14c('0x63')](_0xe14c('0x7e'));}else{_0x11aaac[_0xe14c('0x63')]('`unreadMessages`\x20>\x200');}}if(_0x1944b4[_0xe14c('0x3e')][_0xe14c('0x7f')]){_0x5d815c=_[_0xe14c('0x80')](_0x1944b4[_0xe14c('0x3e')]['tag'])?_0x1944b4[_0xe14c('0x3e')][_0xe14c('0x7f')]:new Array(_0x1944b4[_0xe14c('0x3e')]['tag']);_0x5d815c[_0xe14c('0x30')](function(_0x45e8a5){_0x471553['or'](_0xe14c('0x6d'),'%,'+_0x45e8a5+',%');});}if(_0x1944b4[_0xe14c('0x3e')][_0xe14c('0x81')]){var _0x56f197=_0x1944b4[_0xe14c('0x3e')][_0xe14c('0x81')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xe14c('0x82')](_0x56f197)){_0x5414d0['or'](_0xe14c('0x83'),_0x56f197+'%');}else{_0x5414d0['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xe14c('0x67')](_0x56f197))['or']('i.from\x20LIKE\x20?',_0x56f197+'%')['or'](_0xe14c('0x84'),_0x56f197+'%');}}}_0x11aaac[_0xe14c('0x47')](_0x5414d0);_0x11aaac[_0xe14c('0x85')](_0xe14c('0x86'));var _0x20004e={'type':db[_0xe14c('0x87')][_0xe14c('0x88')][_0xe14c('0x89')],'raw':!![]};var _0x2e0eee=_0x11aaac[_0xe14c('0x8a')]();_0x2e0eee['field']('i.id');_0x2e0eee[_0xe14c('0x4a')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x4ddfe5[_0xe14c('0x8b')]){_0x4ddfe5[_0xe14c('0x8b')]['forEach'](function(_0x64b44b){var _0x957862=_0x64b44b[0x0]===_0xe14c('0x8c')?_0x64b44b[0x0]:'i.'+_0x64b44b[0x0];_0x11aaac[_0xe14c('0x8b')](_0x957862,_0x64b44b[0x1]===_0xe14c('0x8d')?![]:!![]);});}if(!_['isEmpty'](_0x5d815c)){_0x11aaac['having'](_0x471553);_0x2e0eee['where'](_0xe14c('0x8e'),_0x5d815c);}BPromise[_0xe14c('0x8f')]()[_0xe14c('0x25')](function(){if(!_0x558109){if(_0x1944b4['query'][_0xe14c('0x72')])return;_0x2e0eee[_0xe14c('0x47')](_0xe14c('0x90'));_0x11aaac[_0xe14c('0x47')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x1944b4[_0xe14c('0x91')][_0xe14c('0x92')]!=='agent')return;return _0x1944b4[_0xe14c('0x91')][_0xe14c('0x93')]({'attributes':['id'],'raw':!![]})[_0xe14c('0x25')](function(_0x786867){if(_[_0xe14c('0x94')](_0x786867)){_0x2e0eee[_0xe14c('0x47')](_0xe14c('0x95'));_0x11aaac['where']('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x2e0eee[_0xe14c('0x47')](_0xe14c('0x73'),_[_0xe14c('0x2c')](_0x786867,'id'));_0x11aaac[_0xe14c('0x47')](_0xe14c('0x73'),_[_0xe14c('0x2c')](_0x786867,'id'));}});})[_0xe14c('0x25')](function(){if(_0x1944b4[_0xe14c('0x91')][_0xe14c('0x92')]==='agent'&&!_0x558109&&!_0x1944b4[_0xe14c('0x3e')]['OpenchannelAccountId'])return[];return db[_0xe14c('0x96')][_0xe14c('0x3e')](_0x2e0eee[_0xe14c('0x97')](),_0x20004e);})[_0xe14c('0x25')](function(_0x7f9ea0){_0x16cd06[_0xe14c('0x22')]=_0x7f9ea0[_0xe14c('0x43')];if(_0x16cd06[_0xe14c('0x22')]===0x0)return[];return db[_0xe14c('0x96')][_0xe14c('0x3e')](_0x36b5e0[_0xe14c('0x97')](),_0x20004e)['then'](function(_0x45cd6a){_0x450a86=_[_0xe14c('0x98')](_0x45cd6a,'id');_0x20004e=_['merge'](_0x20004e,{'model':db[_0xe14c('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1944b4[_0xe14c('0x3e')][_0xe14c('0x42')]){_0x4ddfe5[_0xe14c('0x41')][_0xe14c('0x30')](function(_0x1a2dd7){_0x11aaac[_0xe14c('0x4a')]('i.'+_0x1a2dd7);});}else{_0x11aaac[_0xe14c('0x4a')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xe14c('0x61'));_0x11aaac[_0xe14c('0x4a')](_0xe14c('0x99'),_0xe14c('0x9a'));_0x11aaac[_0xe14c('0x4a')](_0xe14c('0x9b'),_0xe14c('0x9c'));_0x11aaac[_0xe14c('0x4a')](_0xe14c('0x9d'),_0xe14c('0x8c'));_0x11aaac[_0xe14c('0x4a')](_0xe14c('0x9e'));_0x11aaac['field'](_0xe14c('0x9f'),'Contact.firstName');_0x11aaac[_0xe14c('0x4a')]('c.lastName','Contact.lastName');_0x11aaac[_0xe14c('0x4a')](_0xe14c('0xa0'),_0xe14c('0xa1'));_0x11aaac[_0xe14c('0x4a')]('c.phone',_0xe14c('0xa2'));_0x11aaac[_0xe14c('0x4a')](_0xe14c('0xa3'),_0xe14c('0xa4'));_0x11aaac[_0xe14c('0x4a')](_0xe14c('0xa5'),_0xe14c('0xa6'));_0x11aaac[_0xe14c('0x4a')](_0xe14c('0xa7'),_0xe14c('0xa8'));_0x11aaac[_0xe14c('0x4a')](_0xe14c('0xa9'),_0xe14c('0xaa'));_0x11aaac[_0xe14c('0x4a')](_0xe14c('0xab'),_0xe14c('0x2d'));}if(_0x4ddfe5[_0xe14c('0x23')])_0x11aaac[_0xe14c('0x23')](_0x4ddfe5['limit']);if(_0x4ddfe5[_0xe14c('0x20')])_0x11aaac[_0xe14c('0x20')](_0x4ddfe5[_0xe14c('0x20')]);return db[_0xe14c('0x96')][_0xe14c('0x3e')](_0x11aaac[_0xe14c('0x97')](),_0x20004e);})[_0xe14c('0x25')](function(_0x4cb16c){if(_0x4cb16c[_0xe14c('0x43')]>0x0)_0x515848[_0xe14c('0x47')](_0xe14c('0xac'),_[_0xe14c('0x2c')](_0x4cb16c,'id'));return db[_0xe14c('0x96')][_0xe14c('0x3e')](_0x515848[_0xe14c('0x97')](),_0x20004e)[_0xe14c('0x25')](function(_0xda386f){var _0x31ffa3=_[_0xe14c('0xad')](_0xda386f,_0xe14c('0xae'));var _0x5a95cd=[];_0x4cb16c[_0xe14c('0x30')](function(_0x4d4837){_0x5a95cd[_0xe14c('0x31')](updateOpenchannelInteraction(_0x4d4837,_0x450a86,_0x31ffa3));});return BPromise[_0xe14c('0xaf')](_0x5a95cd);});});})[_0xe14c('0x25')](function(_0x45df54){_0x16cd06[_0xe14c('0xb0')]=_0x45df54;return _0x16cd06;})['then'](respondWithFilteredResult(_0x34d27b,_0x4ddfe5))[_0xe14c('0xb1')](handleError(_0x34d27b,null));};exports[_0xe14c('0xb2')]=function(_0x45caab,_0x3c3076){var _0xde4cf6={};if(_0x45caab[_0xe14c('0x3e')]['type']&&_0x45caab[_0xe14c('0x3e')][_0xe14c('0x3c')]===_0xe14c('0x4f')){_0xde4cf6[_0xe14c('0x4f')]=_0x45caab[_0xe14c('0xb3')]['id'];}else{_0xde4cf6['id']=_0x45caab[_0xe14c('0xb3')]['id'];}var _0x14d531={'raw':![],'where':_0xde4cf6},_0x57e085={};_0x57e085[_0xe14c('0x3d')]=_[_0xe14c('0xb4')](db[_0xe14c('0x39')]['rawAttributes']);_0x57e085[_0xe14c('0x3e')]=_['keys'](_0x45caab['query']);_0x57e085[_0xe14c('0x3f')]=_[_0xe14c('0x40')](_0x57e085[_0xe14c('0x3d')],_0x57e085[_0xe14c('0x3e')]);_0x14d531['attributes']=_[_0xe14c('0x40')](_0x57e085[_0xe14c('0x3d')],qs['fields'](_0x45caab[_0xe14c('0x3e')][_0xe14c('0x42')]));_0x14d531[_0xe14c('0x41')]=_0x14d531['attributes'][_0xe14c('0x43')]?_0x14d531['attributes']:_0x57e085[_0xe14c('0x3d')];if(_0x45caab[_0xe14c('0x3e')][_0xe14c('0xb5')]){_0x14d531[_0xe14c('0xb6')]=[{'all':!![]}];}_0x14d531=_[_0xe14c('0xb7')]({},_0x14d531,_0x45caab['options']);return db[_0xe14c('0x39')]['find'](_0x14d531)[_0xe14c('0x25')](handleEntityNotFound(_0x3c3076,null))[_0xe14c('0x25')](respondWithResult(_0x3c3076,null))[_0xe14c('0xb1')](handleError(_0x3c3076,null));};exports[_0xe14c('0xb8')]=function(_0x17bf07,_0x1acc76){return db[_0xe14c('0x39')][_0xe14c('0xb8')](_0x17bf07[_0xe14c('0xb9')],{})['then'](respondWithResult(_0x1acc76,0xc9))[_0xe14c('0xb1')](handleError(_0x1acc76,null));};exports['update']=function(_0x26162e,_0x926acf){if(_0x26162e[_0xe14c('0xb9')]['id']){delete _0x26162e[_0xe14c('0xb9')]['id'];}return db['OpenchannelInteraction'][_0xe14c('0x60')]({'where':{'id':_0x26162e['params']['id']}})['then'](handleEntityNotFound(_0x926acf,null))[_0xe14c('0x25')](saveUpdates(_0x26162e[_0xe14c('0xb9')],null))[_0xe14c('0x25')](respondWithResult(_0x926acf,null))[_0xe14c('0xb1')](handleError(_0x926acf,null));};exports[_0xe14c('0x26')]=function(_0x1abac0,_0x2c86ba){return db[_0xe14c('0x39')][_0xe14c('0x60')]({'where':{'id':_0x1abac0[_0xe14c('0xb3')]['id']}})['then'](handleEntityNotFound(_0x2c86ba,null))[_0xe14c('0x25')](removeEntity(_0x2c86ba,null))[_0xe14c('0xb1')](handleError(_0x2c86ba,null));};exports[_0xe14c('0xba')]=function(_0xd133,_0x16b913){return db[_0xe14c('0x39')][_0xe14c('0xba')]()[_0xe14c('0x25')](respondWithResult(_0x16b913,null))[_0xe14c('0xb1')](handleError(_0x16b913,null));};exports[_0xe14c('0xbb')]=function(_0x987e79,_0x3458f4,_0x4390ac){return db['OpenchannelMessage'][_0xe14c('0x60')]({'where':{'id':_0x987e79[_0xe14c('0xb3')]['id']}})['then'](handleEntityNotFound(_0x3458f4,null))[_0xe14c('0x25')](function(_0x46ec59){if(_0x46ec59){return _0x46ec59[_0xe14c('0xbb')](_0x987e79[_0xe14c('0xb9')][_0xe14c('0xbc')],_[_0xe14c('0xbd')](_0x987e79[_0xe14c('0xb9')],[_0xe14c('0xbc'),'id'])||{});}})[_0xe14c('0x25')](respondWithResult(_0x3458f4,null))[_0xe14c('0xb1')](handleError(_0x3458f4,null));};exports['getMessages']=function(_0x341d42,_0x240e78,_0x358241){var _0x3b06d7={'raw':![],'where':{}};var _0x3af461={};var _0x22eea9={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0xe14c('0xbe')]({'where':{'id':_0x341d42[_0xe14c('0xb3')]['id']}})[_0xe14c('0x25')](handleEntityNotFound(_0x240e78,null))[_0xe14c('0x25')](function(_0x465f15){if(_0x465f15){_0x3af461['model']=_[_0xe14c('0xb4')](db[_0xe14c('0xbf')][_0xe14c('0x3a')]);_0x3af461['query']=_[_0xe14c('0xb4')](_0x341d42[_0xe14c('0x3e')]);_0x3af461[_0xe14c('0x3f')]=_['intersection'](_0x3af461[_0xe14c('0x3d')],_0x3af461['query']);_0x3b06d7[_0xe14c('0x41')]=_[_0xe14c('0x40')](_0x3af461[_0xe14c('0x3d')],qs[_0xe14c('0x42')](_0x341d42[_0xe14c('0x3e')][_0xe14c('0x42')]));_0x3b06d7[_0xe14c('0x41')]=_0x3b06d7['attributes']['length']?_0x3b06d7[_0xe14c('0x41')]:_0x3af461['model'];if(!_0x341d42['query'][_0xe14c('0x44')](_0xe14c('0x45'))){_0x3b06d7[_0xe14c('0x23')]=qs['limit'](_0x341d42[_0xe14c('0x3e')]['limit']);_0x3b06d7[_0xe14c('0x20')]=qs['offset'](_0x341d42[_0xe14c('0x3e')][_0xe14c('0x20')]);}_0x3b06d7[_0xe14c('0x8b')]=qs['sort'](_0x341d42[_0xe14c('0x3e')][_0xe14c('0x46')]);_0x3b06d7[_0xe14c('0x47')]=qs[_0xe14c('0x3f')](_['pick'](_0x341d42['query'],_0x3af461['filters']));_0x3b06d7[_0xe14c('0x47')][_0xe14c('0xae')]=_0x465f15['id'];if(_0x341d42[_0xe14c('0x3e')]['filter']){_0x3b06d7[_0xe14c('0x47')]=_[_0xe14c('0xb7')](_0x3b06d7[_0xe14c('0x47')],{'$or':_['map'](_0x3b06d7[_0xe14c('0x41')],function(_0x3aaa34){var _0x4270e7={};_0x4270e7[_0x3aaa34]={'$like':'%'+_0x341d42[_0xe14c('0x3e')][_0xe14c('0x81')]+'%'};return _0x4270e7;})});}if(_0x341d42[_0xe14c('0x3e')][_0xe14c('0x77')]){var _0x3cedd2=_0x341d42['query'][_0xe14c('0x77')][_0xe14c('0x2f')](',');var _0x4598d3={};_0x4598d3[_0x3cedd2[0x0]]={'$gte':moment(_0x3cedd2[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x3b06d7['where']=_['merge'](_0x3b06d7['where'],_0x4598d3);}_0x3b06d7=_[_0xe14c('0xb7')]({},_0x3b06d7,_0x341d42[_0xe14c('0xc0')]);return db[_0xe14c('0xbf')]['count']({'where':_0x3b06d7[_0xe14c('0x47')]})[_0xe14c('0x25')](function(_0x1ce2b0){_0x22eea9[_0xe14c('0x22')]=_0x1ce2b0;if(_0x341d42['query'][_0xe14c('0xb5')]){_0x3b06d7[_0xe14c('0xb6')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0xe14c('0xc1')](_0x3b06d7);})[_0xe14c('0x25')](function(_0x256db3){_0x22eea9[_0xe14c('0xb0')]=_0x256db3;return _0x22eea9;});}})[_0xe14c('0x25')](respondWithFilteredResult(_0x240e78,_0x3b06d7))[_0xe14c('0xb1')](handleError(_0x240e78,null));};exports['addTags']=function(_0x4dbfb1,_0x2ccf8e,_0x32896e){return db['OpenchannelInteraction']['find']({'where':{'id':_0x4dbfb1['params']['id']}})[_0xe14c('0x25')](handleEntityNotFound(_0x2ccf8e,null))['then'](function(_0x22b7f7){if(_0x22b7f7){return _0x22b7f7[_0xe14c('0xc2')](_0x4dbfb1[_0xe14c('0xb9')][_0xe14c('0xbc')],_[_0xe14c('0xbd')](_0x4dbfb1[_0xe14c('0xb9')],[_0xe14c('0xbc'),'id'])||{})[_0xe14c('0xc3')](function(){return db[_0xe14c('0x6c')][_0xe14c('0xc1')]({'attributes':['id',_0xe14c('0x29'),_0xe14c('0x4b')],'where':{'id':_0x4dbfb1[_0xe14c('0xb9')][_0xe14c('0xbc')]}});})[_0xe14c('0x25')](function(_0x4c1b34){socket['emit']('openchannelInteractionTags:save',{'id':Number(_0x4dbfb1[_0xe14c('0xb3')]['id']),'tags':_0x4c1b34||[]});return{'id':Number(_0x4dbfb1[_0xe14c('0xb3')]['id']),'tags':_0x4c1b34||[]};});}})[_0xe14c('0x25')](respondWithResult(_0x2ccf8e,null))[_0xe14c('0xb1')](handleError(_0x2ccf8e,null));};exports[_0xe14c('0xc4')]=function(_0x39a0f4,_0x456ff1,_0x24e283){return db[_0xe14c('0x39')][_0xe14c('0x60')]({'where':{'id':_0x39a0f4['params']['id']}})[_0xe14c('0x25')](handleEntityNotFound(_0x456ff1,null))[_0xe14c('0x25')](function(_0x221ced){if(_0x221ced){return _0x221ced['removeTags'](_0x39a0f4[_0xe14c('0x3e')][_0xe14c('0xbc')]);}})[_0xe14c('0x25')](respondWithStatusCode(_0x456ff1,null))[_0xe14c('0xb1')](handleError(_0x456ff1,null));};exports[_0xe14c('0xc5')]=function(_0x205e10,_0x1a726e){var _0x8e8a4f=moment()[_0xe14c('0xc6')]()[_0xe14c('0x97')]();var _0x1c777d=path[_0xe14c('0xc7')](config['root'],_0xe14c('0xc8'),_0xe14c('0xc9'),_0xe14c('0xca'));var _0x5bc386=path[_0xe14c('0xc7')](config['root'],_0xe14c('0xc8'),_0xe14c('0xc9'),_0xe14c('0xcb'));var _0x451551=path['join'](_0x1c777d,_0x8e8a4f);var _0x36dd0a=util[_0xe14c('0xcc')](_0xe14c('0xcd'),_0x205e10[_0xe14c('0xb3')]['id'],_0x8e8a4f);var _0x2c6125=path[_0xe14c('0xc7')](_0x1c777d,_0x36dd0a);var _0x155d4f=[];_0x155d4f['push']({'model':db['User'],'as':_0xe14c('0x6f'),'attributes':['id',_0xe14c('0xce')],'raw':!![]});_0x155d4f[_0xe14c('0x31')]({'model':db['CmContact'],'as':_0xe14c('0xcf'),'attributes':['id',_0xe14c('0xd0'),_0xe14c('0xd1')],'raw':!![]});if(_0x205e10[_0xe14c('0x3e')][_0xe14c('0xcb')]){_0x155d4f['push']({'model':db['Attachment'],'as':_0xe14c('0xd2'),'raw':!![]});}var _0x40aa11=[{'model':db[_0xe14c('0xbf')],'as':_0xe14c('0xd3'),'attributes':['id',_0xe14c('0xb9'),_0xe14c('0x75'),'direction','secret','read'],'include':_0x155d4f}];_0x40aa11[_0xe14c('0x31')]({'model':db[_0xe14c('0xd4')],'as':_0xe14c('0xd5'),'attributes':['id',_0xe14c('0x29')]});_0x40aa11[_0xe14c('0x31')]({'model':db[_0xe14c('0x6f')],'as':'Owner','attributes':['id',_0xe14c('0xce')]});return db['OpenchannelInteraction'][_0xe14c('0x60')]({'where':{'id':_0x205e10['params']['id']},'include':_0x40aa11})[_0xe14c('0x25')](handleEntityNotFound(_0x1a726e,null))['then'](function(_0x5767d7){if(_0x5767d7){var _0x54c0ed=_0x5767d7[_0xe14c('0xd6')]({'plain':!![]});fs[_0xe14c('0xd7')](_0x451551);var _0x427c79={'channel':_0xe14c('0xd8'),'account':_0x54c0ed['Account'][_0xe14c('0x29')],'agent':_0x54c0ed[_0xe14c('0xd9')]?_0x54c0ed['Owner'][_0xe14c('0xce')]:_0xe14c('0xda'),'createdAt':moment(_0x54c0ed[_0xe14c('0x75')])[_0xe14c('0xcc')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe14c('0x97')](),'closedAt':_0x54c0ed['closed']?moment(_0x54c0ed[_0xe14c('0xdb')])[_0xe14c('0xcc')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x54c0ed['disposition'],'visibility':_0x54c0ed[_0xe14c('0xdc')]?_0xe14c('0xdd'):'Private','messages':_(_0x54c0ed[_0xe14c('0xd3')])[_0xe14c('0x81')]({'secret':![]})['map'](function(_0x3509e1){if(_0x3509e1[_0xe14c('0xd2')]){var _0x24fb45=path['join'](_0x5bc386,_0x3509e1['Attachment']['basename']);if(fs[_0xe14c('0xde')](_0x24fb45)){fs[_0xe14c('0xdf')](_0x24fb45)[_0xe14c('0xe0')](fs[_0xe14c('0xe1')](path[_0xe14c('0xc7')](_0x451551,_0x3509e1[_0xe14c('0xd2')][_0xe14c('0xe2')])));}}return{'date':moment(_0x3509e1[_0xe14c('0x75')])[_0xe14c('0xcc')](_0xe14c('0xe3'))['toString'](),'sender':_0x3509e1['direction']===_0xe14c('0xe4')?_0x3509e1[_0xe14c('0x6f')]?_0x3509e1['User'][_0xe14c('0xce')]:'System':_0x3509e1[_0xe14c('0xcf')][_0xe14c('0xd0')]+(_0x3509e1[_0xe14c('0xcf')][_0xe14c('0xd1')]?'\x20'+_0x3509e1[_0xe14c('0xcf')]['lastName']:''),'body':_0x3509e1[_0xe14c('0xd2')]?_0x3509e1[_0xe14c('0xd2')][_0xe14c('0xe2')]:_0x3509e1[_0xe14c('0xb9')],'direction':_0x3509e1[_0xe14c('0xe5')]===_0xe14c('0xe4')?'A':'C','secret':_0x3509e1[_0xe14c('0xe6')],'read':_0x3509e1['read'],'attachment':_0x3509e1[_0xe14c('0xd2')]};})['value']()};return ejs[_0xe14c('0xe7')](path['join'](config[_0xe14c('0xe8')],_0xe14c('0xc8'),_0xe14c('0xe9'),_0xe14c('0xea')),{'interaction':_0x427c79})[_0xe14c('0x25')](function(_0x553092){var _0x340891=path[_0xe14c('0xc7')](_0x451551,_0xe14c('0xeb')+_0x54c0ed['id']+'-'+_0x8e8a4f+'.pdf');var _0x4b7015={'path':_0x340891,'channel':'Openchannel','interactionId':_0x54c0ed['id']};return pdf[_0xe14c('0xec')](_0x553092,_0x4b7015);})[_0xe14c('0x25')](function(){return new BPromise(function(_0xc25963,_0x332e77){zipdir(_0x451551,{'saveTo':_0x2c6125},function(_0x8adb0,_0x569c5e){if(_0x8adb0)return _0x332e77(_0x8adb0);return _0xc25963(_0x569c5e);});})[_0xe14c('0x25')](function(){return new BPromise(function(_0x349006,_0x363e15){rimraf(_0x451551,function(_0xf6b99a){if(_0xf6b99a)_0x363e15(_0xf6b99a);return _0x349006();});});})['then'](function(){return _0x1a726e[_0xe14c('0xc5')](_0x2c6125,_0x36dd0a,function(_0x187f45){if(_0x187f45){console[_0xe14c('0xed')](_0xe14c('0xee'),_0x187f45);}else{fs[_0xe14c('0xef')](_0x2c6125);}});});});}else{return _0x1a726e[_0xe14c('0x27')](0xc8);}})[_0xe14c('0xb1')](handleError(_0x1a726e,null));};
\ No newline at end of file
index 362f016..f92aa89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb5a7=['emit','catch','hasOwnProperty','hook','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','length'];(function(_0x222d31,_0x318d60){var _0x1aee51=function(_0x5d3317){while(--_0x5d3317){_0x222d31['push'](_0x222d31['shift']());}};_0x1aee51(++_0x318d60);}(_0xb5a7,0xaf));var _0x7b5a=function(_0x299575,_0x1bed2d){_0x299575=_0x299575-0x0;var _0x56982f=_0xb5a7[_0x299575];return _0x56982f;};'use strict';var EventEmitter=require(_0x7b5a('0x0'));var OpenchannelInteraction=require(_0x7b5a('0x1'))['db'][_0x7b5a('0x2')];var OpenchannelMessage=require(_0x7b5a('0x1'))['db'][_0x7b5a('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x7b5a('0x4')](0x0);var events={'afterCreate':_0x7b5a('0x5'),'afterUpdate':_0x7b5a('0x6'),'afterDestroy':_0x7b5a('0x7')};function emitEvent(_0x50217a){return function(_0x54f482,_0x556276,_0x551b5c){_0x54f482[_0x7b5a('0x8')]({'attributes':['id'],'raw':!![]})[_0x7b5a('0x9')](function(_0x6bb178){_0x54f482[_0x7b5a('0xa')](_0x7b5a('0xb'),_0x6bb178['map'](function(_0x3ac295){return{'id':_0x3ac295['id']};}));return OpenchannelMessage[_0x7b5a('0xc')]({'where':{'OpenchannelInteractionId':_0x54f482['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x1459dd){_0x54f482['setDataValue'](_0x7b5a('0xd'),_0x1459dd[_0x7b5a('0xe')]);OpenchannelInteractionEvents[_0x7b5a('0xf')](_0x50217a+':'+_0x54f482['id'],_0x54f482);OpenchannelInteractionEvents[_0x7b5a('0xf')](_0x50217a,_0x54f482);_0x551b5c(null);})[_0x7b5a('0x10')](_0x551b5c(null));};}for(var e in events){if(events[_0x7b5a('0x11')](e)){var event=events[e];OpenchannelInteraction[_0x7b5a('0x12')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents;
\ No newline at end of file
+var _0xaa13=['Users','map','findAll','then','unreadMessages','length','catch','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','setDataValue'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xaa13,0x14a));var _0x3aa1=function(_0x3d583f,_0x46f709){_0x3d583f=_0x3d583f-0x0;var _0x6dddc3=_0xaa13[_0x3d583f];return _0x6dddc3;};'use strict';var EventEmitter=require(_0x3aa1('0x0'));var OpenchannelInteraction=require(_0x3aa1('0x1'))['db'][_0x3aa1('0x2')];var OpenchannelMessage=require(_0x3aa1('0x1'))['db'][_0x3aa1('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x3aa1('0x4')](0x0);var events={'afterCreate':_0x3aa1('0x5'),'afterUpdate':_0x3aa1('0x6'),'afterDestroy':_0x3aa1('0x7')};function emitEvent(_0x3d681b){return function(_0x153620,_0x53b2be,_0x1af8af){_0x153620[_0x3aa1('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x41bd4c){_0x153620[_0x3aa1('0x9')](_0x3aa1('0xa'),_0x41bd4c[_0x3aa1('0xb')](function(_0x16b5ee){return{'id':_0x16b5ee['id']};}));return OpenchannelMessage[_0x3aa1('0xc')]({'where':{'OpenchannelInteractionId':_0x153620['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3aa1('0xd')](function(_0xe0f34c){_0x153620[_0x3aa1('0x9')](_0x3aa1('0xe'),_0xe0f34c[_0x3aa1('0xf')]);OpenchannelInteractionEvents['emit'](_0x3d681b+':'+_0x153620['id'],_0x153620);OpenchannelInteractionEvents['emit'](_0x3d681b,_0x153620);_0x1af8af(null);})[_0x3aa1('0x10')](_0x1af8af(null));};}for(var e in events){if(events[_0x3aa1('0x11')](e)){var event=events[e];OpenchannelInteraction[_0x3aa1('0x12')](e,emitEvent(event));}}module[_0x3aa1('0x13')]=OpenchannelInteractionEvents;
\ No newline at end of file
index 5554d75..2bfb5eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7485=['openchannel_interactions','changed','closed','closedAt','format','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelInteraction'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0x7485,0x135));var _0x5748=function(_0x13afef,_0x175878){_0x13afef=_0x13afef-0x0;var _0x3dab71=_0x7485[_0x13afef];return _0x3dab71;};'use strict';var _=require(_0x5748('0x0'));var util=require(_0x5748('0x1'));var logger=require('../../config/logger')(_0x5748('0x2'));var moment=require(_0x5748('0x3'));var BPromise=require('bluebird');var rp=require(_0x5748('0x4'));var fs=require('fs');var path=require(_0x5748('0x5'));var rimraf=require(_0x5748('0x6'));var config=require(_0x5748('0x7'));var attributes=require('./openchannelInteraction.attributes');module[_0x5748('0x8')]=function(_0x2f010d,_0x12611c){return _0x2f010d[_0x5748('0x9')](_0x5748('0xa'),attributes,{'tableName':_0x5748('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x505b6d,_0x4757bb,_0x14abb6){if(_0x505b6d[_0x5748('0xc')](_0x5748('0xd'))){_0x505b6d[_0x5748('0xe')]=moment()[_0x5748('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x14abb6(null,_0x505b6d);}}});};
\ No newline at end of file
+var _0x8d8e=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','define','OpenchannelInteraction','openchannel_interactions','utf8mb4_unicode_ci','changed'];(function(_0x20f93d,_0x5a6ca8){var _0x40d78a=function(_0x39866e){while(--_0x39866e){_0x20f93d['push'](_0x20f93d['shift']());}};_0x40d78a(++_0x5a6ca8);}(_0x8d8e,0x15a));var _0xe8d8=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x8d8e[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0xe8d8('0x0'));var util=require('util');var logger=require(_0xe8d8('0x1'))(_0xe8d8('0x2'));var moment=require(_0xe8d8('0x3'));var BPromise=require(_0xe8d8('0x4'));var rp=require(_0xe8d8('0x5'));var fs=require('fs');var path=require(_0xe8d8('0x6'));var rimraf=require(_0xe8d8('0x7'));var config=require(_0xe8d8('0x8'));var attributes=require(_0xe8d8('0x9'));module['exports']=function(_0x271761,_0xa85b9){return _0x271761[_0xe8d8('0xa')](_0xe8d8('0xb'),attributes,{'tableName':_0xe8d8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xe8d8('0xd'),'hooks':{'beforeUpdate':function(_0x58971a,_0x2f80e3,_0x2615e9){if(_0x58971a[_0xe8d8('0xe')](_0xe8d8('0xf'))){_0x58971a[_0xe8d8('0x10')]=moment()[_0xe8d8('0x11')](_0xe8d8('0x12'));}_0x2615e9(null,_0x58971a);}}});};
\ No newline at end of file
index d9ddcdc..bf39f83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3379=['defaults','localhost','register','request','info','request\x20sent','debug','stringify','error','code','OpenchannelInteraction,\x20%s,\x20%s','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','then','AddTagsToOpenchannelInteraction','find','where','ids','omit','AddTags','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','redis'];(function(_0x2a5cb0,_0x4002e9){var _0x24aac8=function(_0x4a4f4c){while(--_0x4a4f4c){_0x2a5cb0['push'](_0x2a5cb0['shift']());}};_0x24aac8(++_0x4002e9);}(_0x3379,0xa2));var _0x9337=function(_0x26c877,_0x2249dd){_0x26c877=_0x26c877-0x0;var _0xff2d29=_0x3379[_0x26c877];return _0xff2d29;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9337('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9337('0x1'));var db=require(_0x9337('0x2'))['db'];var utils=require(_0x9337('0x3'));var logger=require(_0x9337('0x4'))(_0x9337('0x5'));var config=require('../../config/environment');var jayson=require(_0x9337('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0x9337('0x7')]=_[_0x9337('0x8')](config[_0x9337('0x7')],{'host':_0x9337('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9337('0x7')]));require('./openchannelInteraction.socket')[_0x9337('0xa')](socket);function respondWithRpcPromise(_0x2cdf50,_0x27410f,_0x4b4c49){return new BPromise(function(_0x13be18,_0x46486a){return client[_0x9337('0xb')](_0x2cdf50,_0x4b4c49)['then'](function(_0x2f5d55){logger[_0x9337('0xc')]('OpenchannelInteraction,\x20%s,\x20%s',_0x27410f,_0x9337('0xd'));logger[_0x9337('0xe')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x27410f,'request\x20sent',JSON[_0x9337('0xf')](_0x2f5d55));if(_0x2f5d55[_0x9337('0x10')]){if(_0x2f5d55[_0x9337('0x10')][_0x9337('0x11')]===0x1f4){logger['error'](_0x9337('0x12'),_0x27410f,_0x2f5d55[_0x9337('0x10')][_0x9337('0x13')]);return _0x46486a(_0x2f5d55[_0x9337('0x10')]['message']);}logger[_0x9337('0x10')](_0x9337('0x12'),_0x27410f,_0x2f5d55['error']['message']);return _0x13be18(_0x2f5d55[_0x9337('0x10')][_0x9337('0x13')]);}else{logger[_0x9337('0xc')](_0x9337('0x12'),_0x27410f,'request\x20sent');_0x13be18(_0x2f5d55['result'][_0x9337('0x13')]);}})[_0x9337('0x14')](function(_0x402075){logger[_0x9337('0x10')](_0x9337('0x12'),_0x27410f,_0x402075);_0x46486a(_0x402075);});});}exports[_0x9337('0x15')]=function(_0x199946){var _0x20ed30=this;return new Promise(function(_0x2e48e3,_0x221a65){return db[_0x9337('0x16')][_0x9337('0x17')](_0x199946[_0x9337('0x18')],{'raw':_0x199946[_0x9337('0x19')]?_0x199946[_0x9337('0x19')][_0x9337('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x199946['options']?_0x199946[_0x9337('0x19')]['where']||null:null,'attributes':_0x199946[_0x9337('0x19')]?_0x199946[_0x9337('0x19')]['attributes']||null:null,'limit':_0x199946[_0x9337('0x19')]?_0x199946[_0x9337('0x19')]['limit']||null:null})[_0x9337('0x1b')](function(_0x5e2b0a){logger[_0x9337('0xc')](_0x9337('0x15'),_0x199946);logger[_0x9337('0xe')](_0x9337('0x15'),_0x199946,JSON['stringify'](_0x5e2b0a));_0x2e48e3(_0x5e2b0a);})[_0x9337('0x14')](function(_0x1b5e85){logger['error'](_0x9337('0x15'),_0x1b5e85[_0x9337('0x13')],_0x199946);_0x221a65(_0x20ed30['error'](0x1f4,_0x1b5e85[_0x9337('0x13')]));});});};exports[_0x9337('0x1c')]=function(_0x7e7ada){return new Promise(function(_0x2d2248,_0x1108fa){return db[_0x9337('0x16')][_0x9337('0x1d')]({'where':_0x7e7ada[_0x9337('0x19')]?_0x7e7ada[_0x9337('0x19')][_0x9337('0x1e')]||null:null})[_0x9337('0x1b')](function(_0x15f0eb){if(_0x15f0eb){return _0x15f0eb['addTags'](_0x7e7ada[_0x9337('0x18')][_0x9337('0x1f')],_[_0x9337('0x20')](_0x7e7ada[_0x9337('0x18')],[_0x9337('0x1f'),'id'])||{});}})['spread'](function(_0x27e3de){logger['info'](_0x9337('0x21'),_0x7e7ada);logger[_0x9337('0xe')](_0x9337('0x21'),_0x7e7ada,JSON['stringify'](_0x27e3de));_0x2d2248(_0x27e3de);})[_0x9337('0x14')](function(_0x3fdcb4){logger[_0x9337('0x10')](_0x9337('0x21'),_0x3fdcb4[_0x9337('0x13')],_0x7e7ada);_0x1108fa(_this[_0x9337('0x10')](0x1f4,_0x3fdcb4['message']));});});};
\ No newline at end of file
+var _0x785f=['OpenchannelInteraction','find','ids','spread','AddTags','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','UpdateOpenchannelInteraction','body','options','raw','where','attributes','debug','AddTagsToOpenchannelInteraction'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x785f,0x101));var _0xf785=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0x785f[_0xd09668];return _0x68726;};'use strict';var _=require(_0xf785('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf785('0x1'));var rs=require(_0xf785('0x2'));var fs=require('fs');var Redis=require(_0xf785('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf785('0x4'));var logger=require(_0xf785('0x5'))(_0xf785('0x6'));var config=require(_0xf785('0x7'));var jayson=require(_0xf785('0x8'));var client=jayson[_0xf785('0x9')][_0xf785('0xa')]({'port':0x232a});config[_0xf785('0xb')]=_[_0xf785('0xc')](config[_0xf785('0xb')],{'host':_0xf785('0xd'),'port':0x18eb});var socket=require(_0xf785('0xe'))(new Redis(config[_0xf785('0xb')]));require(_0xf785('0xf'))[_0xf785('0x10')](socket);function respondWithRpcPromise(_0x503d44,_0x46eb6d,_0xc23f2d){return new BPromise(function(_0x60acd4,_0x30c339){return client[_0xf785('0x11')](_0x503d44,_0xc23f2d)[_0xf785('0x12')](function(_0x26f589){logger[_0xf785('0x13')](_0xf785('0x14'),_0x46eb6d,'request\x20sent');logger['debug'](_0xf785('0x15'),_0x46eb6d,'request\x20sent',JSON[_0xf785('0x16')](_0x26f589));if(_0x26f589[_0xf785('0x17')]){if(_0x26f589[_0xf785('0x17')][_0xf785('0x18')]===0x1f4){logger[_0xf785('0x17')](_0xf785('0x14'),_0x46eb6d,_0x26f589[_0xf785('0x17')][_0xf785('0x19')]);return _0x30c339(_0x26f589[_0xf785('0x17')]['message']);}logger[_0xf785('0x17')](_0xf785('0x14'),_0x46eb6d,_0x26f589[_0xf785('0x17')]['message']);return _0x60acd4(_0x26f589['error'][_0xf785('0x19')]);}else{logger['info'](_0xf785('0x14'),_0x46eb6d,_0xf785('0x1a'));_0x60acd4(_0x26f589[_0xf785('0x1b')][_0xf785('0x19')]);}})[_0xf785('0x1c')](function(_0x36dd12){logger[_0xf785('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x46eb6d,_0x36dd12);_0x30c339(_0x36dd12);});});}exports[_0xf785('0x1d')]=function(_0x5378af){var _0x3664ca=this;return new Promise(function(_0x690253,_0x89bde7){return db['OpenchannelInteraction']['update'](_0x5378af[_0xf785('0x1e')],{'raw':_0x5378af['options']?_0x5378af[_0xf785('0x1f')][_0xf785('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5378af[_0xf785('0x1f')]?_0x5378af[_0xf785('0x1f')][_0xf785('0x21')]||null:null,'attributes':_0x5378af[_0xf785('0x1f')]?_0x5378af['options'][_0xf785('0x22')]||null:null,'limit':_0x5378af[_0xf785('0x1f')]?_0x5378af['options']['limit']||null:null})['then'](function(_0x5237be){logger[_0xf785('0x13')](_0xf785('0x1d'),_0x5378af);logger[_0xf785('0x23')](_0xf785('0x1d'),_0x5378af,JSON[_0xf785('0x16')](_0x5237be));_0x690253(_0x5237be);})[_0xf785('0x1c')](function(_0x43858f){logger[_0xf785('0x17')]('UpdateOpenchannelInteraction',_0x43858f[_0xf785('0x19')],_0x5378af);_0x89bde7(_0x3664ca[_0xf785('0x17')](0x1f4,_0x43858f[_0xf785('0x19')]));});});};exports[_0xf785('0x24')]=function(_0x2450c6){return new Promise(function(_0x4b7aa2,_0xb915f5){return db[_0xf785('0x25')][_0xf785('0x26')]({'where':_0x2450c6['options']?_0x2450c6[_0xf785('0x1f')][_0xf785('0x21')]||null:null})[_0xf785('0x12')](function(_0xa8d2b2){if(_0xa8d2b2){return _0xa8d2b2['addTags'](_0x2450c6['body'][_0xf785('0x27')],_['omit'](_0x2450c6[_0xf785('0x1e')],['ids','id'])||{});}})[_0xf785('0x28')](function(_0x4561cc){logger[_0xf785('0x13')](_0xf785('0x29'),_0x2450c6);logger[_0xf785('0x23')]('AddTags',_0x2450c6,JSON['stringify'](_0x4561cc));_0x4b7aa2(_0x4561cc);})[_0xf785('0x1c')](function(_0x1a9ad6){logger[_0xf785('0x17')]('AddTags',_0x1a9ad6[_0xf785('0x19')],_0x2450c6);_0xb915f5(_this[_0xf785('0x17')](0x1f4,_0x1a9ad6[_0xf785('0x19')]));});});};
\ No newline at end of file
index 345b332..4802171 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7619=['update','emit','removeListener','openchannelInteraction:','./openchannelInteraction.events','save','remove'];(function(_0x44f750,_0x37c1a1){var _0x5d0120=function(_0x34d7f2){while(--_0x34d7f2){_0x44f750['push'](_0x44f750['shift']());}};_0x5d0120(++_0x37c1a1);}(_0x7619,0xe4));var _0x9761=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7619[_0x3dd15e];return _0x231fd0;};'use strict';var OpenchannelInteractionEvents=require(_0x9761('0x0'));var events=[_0x9761('0x1'),_0x9761('0x2'),_0x9761('0x3')];function createListener(_0x1e58aa,_0xeba687){return function(_0x4a0077){_0xeba687[_0x9761('0x4')](_0x1e58aa,_0x4a0077);};}function removeListener(_0x2640e3,_0x1d3ee7){return function(){OpenchannelInteractionEvents[_0x9761('0x5')](_0x2640e3,_0x1d3ee7);};}exports['register']=function(_0x1844bc){for(var _0x219bb6=0x0,_0x24fc86=events['length'];_0x219bb6<_0x24fc86;_0x219bb6++){var _0x1f3473=events[_0x219bb6];var _0x243f58=createListener(_0x9761('0x6')+_0x1f3473,_0x1844bc);OpenchannelInteractionEvents['on'](_0x1f3473,_0x243f58);}};
\ No newline at end of file
+var _0xf143=['length','openchannelInteraction:','./openchannelInteraction.events','remove','emit','removeListener','register'];(function(_0x2ea177,_0x598fed){var _0x5dc625=function(_0x3cc5f9){while(--_0x3cc5f9){_0x2ea177['push'](_0x2ea177['shift']());}};_0x5dc625(++_0x598fed);}(_0xf143,0x1f3));var _0x3f14=function(_0x46f1a6,_0xc7a582){_0x46f1a6=_0x46f1a6-0x0;var _0x38429a=_0xf143[_0x46f1a6];return _0x38429a;};'use strict';var OpenchannelInteractionEvents=require(_0x3f14('0x0'));var events=['save',_0x3f14('0x1'),'update'];function createListener(_0x5979c9,_0x4546ad){return function(_0x2bd26d){_0x4546ad[_0x3f14('0x2')](_0x5979c9,_0x2bd26d);};}function removeListener(_0x1ad1e1,_0x168107){return function(){OpenchannelInteractionEvents[_0x3f14('0x3')](_0x1ad1e1,_0x168107);};}exports[_0x3f14('0x4')]=function(_0xa53db2){for(var _0x140026=0x0,_0x325b77=events[_0x3f14('0x5')];_0x140026<_0x325b77;_0x140026++){var _0x3777b6=events[_0x140026];var _0x359061=createListener(_0x3f14('0x6')+_0x3777b6,_0xa53db2);OpenchannelInteractionEvents['on'](_0x3777b6,_0x359061);}};
\ No newline at end of file
index f88e55a..3f9087c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','openchannelmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelMessage.controller'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),interaction[_0x3071('0xf')](_0x3071('0x10'),_0x3071('0x11')),controller['create']);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);router[_0x3071('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3071('0x14')]);router['put'](_0x3071('0x15'),auth[_0x3071('0x9')](),controller['reject']);router[_0x3071('0x16')]('/:id',auth[_0x3071('0x9')](),controller[_0x3071('0x17')]);module[_0x3071('0x18')]=router;
\ No newline at end of file
+var _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','create','update','put','/:id/accept','accept','/:id/reject','exports','multer','util','path','express','Router'];(function(_0x64f71,_0x1b749d){var _0x24058c=function(_0x17b087){while(--_0x17b087){_0x64f71['push'](_0x64f71['shift']());}};_0x24058c(++_0x1b749d);}(_0xe706,0xa3));var _0x6e70=function(_0x5459c6,_0x4f3f18){_0x5459c6=_0x5459c6-0x0;var _0x3380e0=_0xe706[_0x5459c6];return _0x3380e0;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),interaction[_0x6e70('0x12')](_0x6e70('0x13'),_0x6e70('0x14')),controller[_0x6e70('0x15')]);router['put']('/:id',auth[_0x6e70('0xb')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x17')](_0x6e70('0x18'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x19')]);router[_0x6e70('0x17')](_0x6e70('0x1a'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0x6e70('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x6e70('0x1b')]=router;
\ No newline at end of file
index 65a8054..dd2f9ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf92=['out','DATE','STRING','TEXT','sequelize','medium','BOOLEAN','ENUM'];(function(_0x35d9cc,_0x5017b8){var _0x120556=function(_0x420f85){while(--_0x420f85){_0x35d9cc['push'](_0x35d9cc['shift']());}};_0x120556(++_0x5017b8);}(_0xdf92,0x10c));var _0x2df9=function(_0x3f5913,_0x1072bb){_0x3f5913=_0x3f5913-0x0;var _0x4ac2e9=_0xdf92[_0x3f5913];return _0x4ac2e9;};'use strict';var Sequelize=require(_0x2df9('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x2df9('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x2df9('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x2df9('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2df9('0x3')]('in',_0x2df9('0x4')),'defaultValue':_0x2df9('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x2df9('0x5')]},'providerName':{'type':Sequelize[_0x2df9('0x6')]},'providerResponse':{'type':Sequelize[_0x2df9('0x7')]}};
\ No newline at end of file
+var _0x34b7=['BOOLEAN','ENUM','out','STRING','TEXT','medium'];(function(_0x4b4b3b,_0x3d20c5){var _0x1b0f70=function(_0x57ca56){while(--_0x57ca56){_0x4b4b3b['push'](_0x4b4b3b['shift']());}};_0x1b0f70(++_0x3d20c5);}(_0x34b7,0x196));var _0x734b=function(_0x38fb0d,_0x52b5db){_0x38fb0d=_0x38fb0d-0x0;var _0x30a5d6=_0x34b7[_0x38fb0d];return _0x30a5d6;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x734b('0x0')](_0x734b('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x734b('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x734b('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x734b('0x3')]('in',_0x734b('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x734b('0x5')]},'providerResponse':{'type':Sequelize[_0x734b('0x0')]}};
\ No newline at end of file
index d999646..ed1920a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe321=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','jayson/promise','client','http','request','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','end','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','VIRTUAL','options','where','includeAll','include','findAll','rows','show','params','find','create','body','describe','openchannel-interactions','accept','openchannel','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','OpenchannelInteraction','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','contact','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT','User','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x157ce5,_0xfa6b87){var _0x359c0c=function(_0x403f22){while(--_0x403f22){_0x157ce5['push'](_0x157ce5['shift']());}};_0x359c0c(++_0xfa6b87);}(_0xe321,0x100));var _0x1e32=function(_0x37d71e,_0x2c53b1){_0x37d71e=_0x37d71e-0x0;var _0x332659=_0xe321[_0x37d71e];return _0x332659;};'use strict';var emlformat=require(_0x1e32('0x0'));var rimraf=require(_0x1e32('0x1'));var zipdir=require(_0x1e32('0x2'));var jsonpatch=require(_0x1e32('0x3'));var rp=require('request-promise');var moment=require(_0x1e32('0x4'));var BPromise=require(_0x1e32('0x5'));var Mustache=require(_0x1e32('0x6'));var util=require('util');var path=require(_0x1e32('0x7'));var sox=require(_0x1e32('0x8'));var csv=require(_0x1e32('0x9'));var ejs=require(_0x1e32('0xa'));var fs=require('fs');var fs_extra=require(_0x1e32('0xb'));var _=require('lodash');var squel=require(_0x1e32('0xc'));var crypto=require(_0x1e32('0xd'));var jsforce=require(_0x1e32('0xe'));var deskjs=require(_0x1e32('0xf'));var toCsv=require(_0x1e32('0x9'));var querystring=require(_0x1e32('0x10'));var Papa=require(_0x1e32('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1e32('0x12'));var as=require(_0x1e32('0x13'));var hardwareService=require(_0x1e32('0x14'));var logger=require(_0x1e32('0x15'))('api');var utils=require(_0x1e32('0x16'));var config=require(_0x1e32('0x17'));var licenseUtil=require(_0x1e32('0x18'));var db=require(_0x1e32('0x19'))['db'];config[_0x1e32('0x1a')]=_[_0x1e32('0x1b')](config[_0x1e32('0x1a')],{'host':_0x1e32('0x1c'),'port':0x18eb});var socket=require(_0x1e32('0x1d'))(new Redis(config['redis']));require(_0x1e32('0x1e'))['register'](socket);var jayson=require(_0x1e32('0x1f'));var client=jayson[_0x1e32('0x20')][_0x1e32('0x21')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x45e9a2,_0x496f6b,_0x405fc3,_0x809485){return new BPromise(function(_0x8ffe87,_0x5bc759){var _0x6ba392=_0x809485||client;return _0x6ba392[_0x1e32('0x22')](_0x45e9a2,_0x405fc3)['then'](function(_0x2669d8){logger['info'](_0x1e32('0x23'),_0x496f6b,_0x1e32('0x24'));logger['debug'](_0x1e32('0x25'),_0x496f6b,'request\x20sent',JSON['stringify'](_0x2669d8));if(_0x2669d8[_0x1e32('0x26')]){if(_0x2669d8['error'][_0x1e32('0x27')]===0x1f4){logger[_0x1e32('0x26')](_0x1e32('0x23'),_0x496f6b,_0x2669d8['error'][_0x1e32('0x28')]);return _0x5bc759(_0x2669d8[_0x1e32('0x26')][_0x1e32('0x28')]);}logger[_0x1e32('0x26')](_0x1e32('0x23'),_0x496f6b,_0x2669d8[_0x1e32('0x26')]['message']);return _0x8ffe87(_0x2669d8[_0x1e32('0x26')]['message']);}else{logger[_0x1e32('0x29')](_0x1e32('0x23'),_0x496f6b,_0x1e32('0x24'));_0x8ffe87(_0x2669d8[_0x1e32('0x2a')][_0x1e32('0x28')]);}})[_0x1e32('0x2b')](function(_0x563008){logger[_0x1e32('0x26')](_0x1e32('0x23'),_0x496f6b,_0x563008);_0x5bc759(_0x563008);});});}function respondWithStatusCode(_0x3f3ed7,_0x4c0e44){_0x4c0e44=_0x4c0e44||0xcc;return function(_0x283e06){if(_0x283e06){return _0x3f3ed7[_0x1e32('0x2c')](_0x4c0e44);}return _0x3f3ed7[_0x1e32('0x2d')](_0x4c0e44)['end']();};}function respondWithResult(_0x450c3e,_0x3578f8){_0x3578f8=_0x3578f8||0xc8;return function(_0x56d998){if(_0x56d998){return _0x450c3e[_0x1e32('0x2d')](_0x3578f8)[_0x1e32('0x2e')](_0x56d998);}};}function respondWithFilteredResult(_0x180267,_0x34487d){return function(_0x4abf04){if(_0x4abf04){var _0x2cbe77=typeof _0x34487d[_0x1e32('0x2f')]===_0x1e32('0x30')&&typeof _0x34487d[_0x1e32('0x31')]===_0x1e32('0x30');var _0x40b8c2=_0x4abf04[_0x1e32('0x32')];var _0x36c6a4=_0x2cbe77?0x0:_0x34487d[_0x1e32('0x2f')];var _0x57da72=_0x2cbe77?_0x4abf04['count']:_0x34487d[_0x1e32('0x2f')]+_0x34487d[_0x1e32('0x31')];var _0x516588;if(_0x57da72>=_0x40b8c2){_0x57da72=_0x40b8c2;_0x516588=0xc8;}else{_0x516588=0xce;}_0x180267[_0x1e32('0x2d')](_0x516588);return _0x180267[_0x1e32('0x33')](_0x1e32('0x34'),_0x36c6a4+'-'+_0x57da72+'/'+_0x40b8c2)[_0x1e32('0x2e')](_0x4abf04);}return null;};}function patchUpdates(_0xb33422){return function(_0x744c3){try{jsonpatch['apply'](_0x744c3,_0xb33422,!![]);}catch(_0x77967a){return BPromise[_0x1e32('0x35')](_0x77967a);}return _0x744c3[_0x1e32('0x36')]();};}function saveUpdates(_0x188a4d,_0x4bac6a){return function(_0x20103c){if(_0x20103c){return _0x20103c[_0x1e32('0x37')](_0x188a4d)['then'](function(_0x49bfe3){return _0x49bfe3;});}return null;};}function removeEntity(_0x55d794,_0x29decc){return function(_0x2c88f9){if(_0x2c88f9){return _0x2c88f9[_0x1e32('0x38')]()[_0x1e32('0x39')](function(){_0x55d794[_0x1e32('0x2d')](0xcc)[_0x1e32('0x3a')]();});}};}function handleEntityNotFound(_0x50515b,_0x16d1a3){return function(_0x3bef4d){if(!_0x3bef4d){_0x50515b[_0x1e32('0x2c')](0x194);}return _0x3bef4d;};}function handleError(_0x15061c,_0x46fe5b){_0x46fe5b=_0x46fe5b||0x1f4;return function(_0x240f02){logger[_0x1e32('0x26')](_0x240f02['stack']);if(_0x240f02['name']){delete _0x240f02[_0x1e32('0x3b')];}_0x15061c[_0x1e32('0x2d')](_0x46fe5b)[_0x1e32('0x3c')](_0x240f02);};}exports[_0x1e32('0x3d')]=function(_0x2fd445,_0x474c85){var _0x160137={},_0x114483={},_0x10b295={'count':0x0,'rows':[]};var _0x1940bc=_[_0x1e32('0x3e')](db[_0x1e32('0x3f')][_0x1e32('0x40')],function(_0x48f190){return{'name':_0x48f190[_0x1e32('0x41')],'type':_0x48f190[_0x1e32('0x42')][_0x1e32('0x43')]};});_0x114483[_0x1e32('0x44')]=_[_0x1e32('0x3e')](_0x1940bc,_0x1e32('0x3b'));_0x114483[_0x1e32('0x45')]=_[_0x1e32('0x46')](_0x2fd445['query']);_0x114483['filters']=_[_0x1e32('0x47')](_0x114483['model'],_0x114483[_0x1e32('0x45')]);_0x160137[_0x1e32('0x48')]=_[_0x1e32('0x47')](_0x114483['model'],qs[_0x1e32('0x49')](_0x2fd445[_0x1e32('0x45')]['fields']));_0x160137[_0x1e32('0x48')]=_0x160137[_0x1e32('0x48')][_0x1e32('0x4a')]?_0x160137[_0x1e32('0x48')]:_0x114483['model'];if(!_0x2fd445[_0x1e32('0x45')][_0x1e32('0x4b')](_0x1e32('0x4c'))){_0x160137[_0x1e32('0x31')]=qs[_0x1e32('0x31')](_0x2fd445['query'][_0x1e32('0x31')]);_0x160137[_0x1e32('0x2f')]=qs[_0x1e32('0x2f')](_0x2fd445[_0x1e32('0x45')][_0x1e32('0x2f')]);}_0x160137[_0x1e32('0x4d')]=qs[_0x1e32('0x4e')](_0x2fd445['query']['sort']);_0x160137['where']=qs[_0x1e32('0x4f')](_[_0x1e32('0x50')](_0x2fd445[_0x1e32('0x45')],_0x114483[_0x1e32('0x4f')]),_0x1940bc);if(_0x2fd445[_0x1e32('0x45')][_0x1e32('0x51')]){_0x160137['where']=_[_0x1e32('0x52')](_0x160137['where'],{'$or':_[_0x1e32('0x3e')](_0x1940bc,function(_0x69b0f2){if(_0x69b0f2[_0x1e32('0x42')]!==_0x1e32('0x53')){var _0x3c4bc1={};_0x3c4bc1[_0x69b0f2['name']]={'$like':'%'+_0x2fd445[_0x1e32('0x45')][_0x1e32('0x51')]+'%'};return _0x3c4bc1;}})});}_0x160137=_['merge']({},_0x160137,_0x2fd445[_0x1e32('0x54')]);var _0x2e735a={'where':_0x160137[_0x1e32('0x55')]};return db[_0x1e32('0x3f')][_0x1e32('0x32')](_0x2e735a)[_0x1e32('0x39')](function(_0x3b3844){_0x10b295[_0x1e32('0x32')]=_0x3b3844;if(_0x2fd445[_0x1e32('0x45')][_0x1e32('0x56')]){_0x160137[_0x1e32('0x57')]=[{'all':!![]}];}return db[_0x1e32('0x3f')][_0x1e32('0x58')](_0x160137);})['then'](function(_0x485f20){_0x10b295[_0x1e32('0x59')]=_0x485f20;return _0x10b295;})['then'](respondWithFilteredResult(_0x474c85,_0x160137))[_0x1e32('0x2b')](handleError(_0x474c85,null));};exports[_0x1e32('0x5a')]=function(_0x202d2f,_0x556a38){var _0x1472a0={'raw':!![],'where':{'id':_0x202d2f[_0x1e32('0x5b')]['id']}},_0x27ae1f={};_0x27ae1f['model']=_['keys'](db[_0x1e32('0x3f')]['rawAttributes']);_0x27ae1f['query']=_[_0x1e32('0x46')](_0x202d2f['query']);_0x27ae1f[_0x1e32('0x4f')]=_['intersection'](_0x27ae1f[_0x1e32('0x44')],_0x27ae1f[_0x1e32('0x45')]);_0x1472a0[_0x1e32('0x48')]=_['intersection'](_0x27ae1f[_0x1e32('0x44')],qs[_0x1e32('0x49')](_0x202d2f['query'][_0x1e32('0x49')]));_0x1472a0['attributes']=_0x1472a0[_0x1e32('0x48')]['length']?_0x1472a0['attributes']:_0x27ae1f[_0x1e32('0x44')];if(_0x202d2f[_0x1e32('0x45')][_0x1e32('0x56')]){_0x1472a0[_0x1e32('0x57')]=[{'all':!![]}];}_0x1472a0=_[_0x1e32('0x52')]({},_0x1472a0,_0x202d2f[_0x1e32('0x54')]);return db[_0x1e32('0x3f')][_0x1e32('0x5c')](_0x1472a0)[_0x1e32('0x39')](handleEntityNotFound(_0x556a38,null))[_0x1e32('0x39')](respondWithResult(_0x556a38,null))[_0x1e32('0x2b')](handleError(_0x556a38,null));};exports[_0x1e32('0x5d')]=function(_0x1e33ae,_0x1fa782){return db[_0x1e32('0x3f')][_0x1e32('0x5d')](_0x1e33ae['body'],{})[_0x1e32('0x39')](respondWithResult(_0x1fa782,0xc9))[_0x1e32('0x2b')](handleError(_0x1fa782,null));};exports['update']=function(_0x921cd,_0x35dee1){if(_0x921cd[_0x1e32('0x5e')]['id']){delete _0x921cd[_0x1e32('0x5e')]['id'];}return db[_0x1e32('0x3f')][_0x1e32('0x5c')]({'where':{'id':_0x921cd[_0x1e32('0x5b')]['id']}})['then'](handleEntityNotFound(_0x35dee1,null))[_0x1e32('0x39')](saveUpdates(_0x921cd[_0x1e32('0x5e')],null))['then'](respondWithResult(_0x35dee1,null))[_0x1e32('0x2b')](handleError(_0x35dee1,null));};exports[_0x1e32('0x38')]=function(_0x2db956,_0x5c22bb){return db[_0x1e32('0x3f')][_0x1e32('0x5c')]({'where':{'id':_0x2db956['params']['id']}})[_0x1e32('0x39')](handleEntityNotFound(_0x5c22bb,null))[_0x1e32('0x39')](removeEntity(_0x5c22bb,null))[_0x1e32('0x2b')](handleError(_0x5c22bb,null));};exports[_0x1e32('0x5f')]=function(_0x506a98,_0x32b1a2){return db['OpenchannelMessage'][_0x1e32('0x5f')]()[_0x1e32('0x39')](respondWithResult(_0x32b1a2,null))['catch'](handleError(_0x32b1a2,null));};var interaction_log=require('../../config/logger')(_0x1e32('0x60'));exports[_0x1e32('0x61')]=function(_0x2914b8,_0x2e39c1,_0x238c27){var _0x1357fa={'agent':{},'channel':_0x1e32('0x62')};if(_0x2914b8['body']['id']){delete _0x2914b8[_0x1e32('0x5e')]['id'];}_0x2914b8['body'][_0x1e32('0x63')]=!![];_0x2914b8[_0x1e32('0x5e')]['readAt']=moment()[_0x1e32('0x64')](_0x1e32('0x65'));_0x2914b8['body'][_0x1e32('0x66')]=_0x2914b8[_0x1e32('0x5e')][_0x1e32('0x66')]||_0x2914b8['user']['id'];_0x1357fa[_0x1e32('0x67')]['id']=_0x2914b8['body'][_0x1e32('0x66')];return db[_0x1e32('0x3f')][_0x1e32('0x5c')]({'where':{'id':_0x2914b8[_0x1e32('0x5b')]['id'],'UserId':null}})[_0x1e32('0x39')](handleEntityNotFound(_0x2e39c1,null))[_0x1e32('0x39')](saveUpdates(_0x2914b8[_0x1e32('0x5e')],null))[_0x1e32('0x39')](function(_0x43b2ac){if(_0x43b2ac){_0x1357fa[_0x1e32('0x28')]=_0x43b2ac[_0x1e32('0x68')]({'plain':!![]});return db[_0x1e32('0x69')][_0x1e32('0x5c')]({'where':{'id':_0x43b2ac['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x2e39c1,null))[_0x1e32('0x39')](function(_0x16e143){if(_0x16e143){return _0x16e143[_0x1e32('0x37')]({'UserId':_0x2914b8[_0x1e32('0x5e')][_0x1e32('0x66')],'read1stAt':_[_0x1e32('0x6a')](_0x16e143[_0x1e32('0x6b')])?moment()[_0x1e32('0x64')](_0x1e32('0x65')):undefined});}return null;})[_0x1e32('0x39')](function(_0x4f56ae){if(_0x4f56ae){_0x1357fa[_0x1e32('0x6c')]=_0x4f56ae[_0x1e32('0x68')]({'plain':!![]});interaction_log[_0x1e32('0x29')](_0x1e32('0x6d'),_0x2914b8[_0x1e32('0x6e')]['id'],_0x2914b8[_0x1e32('0x6e')][_0x1e32('0x3b')],_0x2914b8[_0x1e32('0x6e')][_0x1e32('0x6f')],_0x1357fa[_0x1e32('0x6c')]['id'],_0x2914b8[_0x1e32('0x5e')]?JSON[_0x1e32('0x70')](_0x2914b8[_0x1e32('0x5e')]):_0x1e32('0x71'));return respondWithRpcPromise(_0x1e32('0x72'),_0x1e32('0x73'),_0x1357fa);}return null;})['then'](function(_0x50c1cc){var _0x315b11=_0x1e32('0x74')+_0x50c1cc['message'][_0x1e32('0x75')];return db[_0x1e32('0x76')][_0x1e32('0x45')](_0x315b11,{'type':db[_0x1e32('0x77')]['QueryTypes']['SELECT'],'raw':!![]})[_0x1e32('0x39')](function(_0x46a5e2){return _0x46a5e2;});})[_0x1e32('0x39')](function(_0x1eff7d){if(_0x1eff7d){_0x1357fa[_0x1e32('0x28')][_0x1e32('0x78')]=_0x1eff7d[0x0];if(!_0x2914b8[_0x1e32('0x5e')]['UserId'])return;return db['User'][_0x1e32('0x5c')]({'where':{'id':_0x2914b8[_0x1e32('0x5e')][_0x1e32('0x66')],'role':_0x1e32('0x67')},'attributes':['id',_0x1e32('0x3b'),_0x1e32('0x79'),_0x1e32('0x7a'),_0x1e32('0x7b')],'raw':!![]});}return null;})[_0x1e32('0x39')](function(_0x723cbd){if(!_0x723cbd)return null;_0x1357fa[_0x1e32('0x28')]['agent']=_0x723cbd;return _0x1357fa;})[_0x1e32('0x39')](function(_0x4e6eac){if(_0x4e6eac){if(_0x2914b8['body'][_0x1e32('0x7c')]){_0x1357fa[_0x1e32('0x28')][_0x1e32('0x7d')]=util['format'](_0x1e32('0x7e'),_0x2914b8[_0x1e32('0x6e')][_0x1e32('0x3b')]);_0x1357fa[_0x1e32('0x28')][_0x1e32('0x7f')]=_0x1357fa[_0x1e32('0x7f')];_0x1357fa[_0x1e32('0x28')][_0x1e32('0x80')]=_0x1357fa[_0x1e32('0x7f')];_0x1357fa[_0x1e32('0x28')][_0x1e32('0x81')]=_0x1e32('0x61');return respondWithRpcPromise(_0x1e32('0x82'),_0x1e32('0x82'),{'event':'acceptmessage','message':_0x1357fa[_0x1e32('0x28')]},client9002)[_0x1e32('0x39')](function(){return _0x1357fa;});}return _0x1357fa;}return null;})[_0x1e32('0x39')](respondWithResult(_0x2e39c1,null))['catch'](handleError(_0x2e39c1,null));};var interaction_log=require(_0x1e32('0x15'))('openchannel-interactions');exports['reject']=function(_0x241151,_0x45a713,_0x385f37){var _0x13622f={'agent':{},'channel':_0x1e32('0x62')};if(_0x241151[_0x1e32('0x5e')]['id']){delete _0x241151[_0x1e32('0x5e')]['id'];}_0x241151[_0x1e32('0x5e')]['UserId']=_0x241151['body'][_0x1e32('0x66')]||_0x241151[_0x1e32('0x6e')]['id'];_0x13622f[_0x1e32('0x67')]['id']=_0x241151['body'][_0x1e32('0x66')];return db[_0x1e32('0x3f')][_0x1e32('0x5c')]({'where':{'id':_0x241151[_0x1e32('0x5b')]['id'],'UserId':null}})[_0x1e32('0x39')](handleEntityNotFound(_0x45a713,null))['then'](function(_0x42a638){if(_0x42a638){_0x13622f[_0x1e32('0x28')]=_0x42a638[_0x1e32('0x68')]({'plain':!![]});return db[_0x1e32('0x69')][_0x1e32('0x5c')]({'where':{'id':_0x42a638[_0x1e32('0x83')]}});}return null;})[_0x1e32('0x39')](handleEntityNotFound(_0x45a713,null))[_0x1e32('0x39')](function(_0x2cb9ec){if(_0x2cb9ec){_0x13622f[_0x1e32('0x6c')]=_0x2cb9ec[_0x1e32('0x68')]({'plain':!![]});interaction_log[_0x1e32('0x29')](_0x1e32('0x84'),_0x241151[_0x1e32('0x6e')]['id'],_0x241151[_0x1e32('0x6e')][_0x1e32('0x3b')],_0x241151['user'][_0x1e32('0x6f')],_0x13622f['interaction']['id'],_0x241151['body']?JSON[_0x1e32('0x70')](_0x241151[_0x1e32('0x5e')]):_0x1e32('0x71'));return respondWithRpcPromise(_0x1e32('0x85'),_0x1e32('0x86'),_0x13622f);}return null;})['then'](function(_0x20ebe6){var _0x43cc9a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x20ebe6['message'][_0x1e32('0x75')];return db['sequelize'][_0x1e32('0x45')](_0x43cc9a,{'type':db[_0x1e32('0x77')]['QueryTypes'][_0x1e32('0x87')],'raw':!![]})[_0x1e32('0x39')](function(_0x37f510){return _0x37f510;});})['then'](function(_0x23ec96){if(_0x23ec96){_0x13622f[_0x1e32('0x28')]['contact']=_0x23ec96[0x0];if(!_0x241151[_0x1e32('0x5e')][_0x1e32('0x66')])return;return db[_0x1e32('0x88')][_0x1e32('0x5c')]({'where':{'id':_0x241151[_0x1e32('0x5e')]['UserId'],'role':_0x1e32('0x67')},'attributes':['id',_0x1e32('0x3b'),_0x1e32('0x79'),'email',_0x1e32('0x7b')],'raw':!![]});}return null;})['then'](function(_0x566e32){if(!_0x566e32)return null;_0x13622f[_0x1e32('0x28')][_0x1e32('0x67')]=_0x566e32;return _0x13622f;})[_0x1e32('0x39')](function(_0xcc751d){if(_0xcc751d){_0xcc751d[_0x1e32('0x28')]['interface']=util['format'](_0x1e32('0x7e'),_0x241151['user'][_0x1e32('0x3b')]);_0xcc751d['message']['channel']=_0x13622f['channel'];_0xcc751d[_0x1e32('0x28')]['motionChannel']=_0x13622f['channel'];_0xcc751d[_0x1e32('0x28')][_0x1e32('0x81')]=_0x1e32('0x35');respondWithRpcPromise(_0x1e32('0x82'),_0x1e32('0x82'),{'event':_0x1e32('0x89'),'message':_0xcc751d['message']},client9002);return _0x13622f;}return null;})[_0x1e32('0x39')](respondWithResult(_0x45a713,null))[_0x1e32('0x2b')](handleError(_0x45a713,null));};
\ No newline at end of file
+var _0xfeec=['count','offset','limit','set','Content-Range','apply','save','update','destroy','stack','name','index','OpenchannelMessage','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','keys','find','create','body','params','describe','accept','openchannel','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','isNil','read1stAt','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','contact','User','fullname','internal','manual','interface','SIP/%s','motionChannel','channel','EventManager','acceptmessage','openchannel-interactions','reject','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','ContactId','Sequelize','email','rejectmessage','eml-format','zip-dir','request-promise','bluebird','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','client','http','request','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','sendStatus','end','status','json','undefined'];(function(_0x2242a1,_0x38f44d){var _0x2c298b=function(_0x4f4246){while(--_0x4f4246){_0x2242a1['push'](_0x2242a1['shift']());}};_0x2c298b(++_0x38f44d);}(_0xfeec,0xd9));var _0xcfee=function(_0x589ad2,_0x4f7add){_0x589ad2=_0x589ad2-0x0;var _0x3cc452=_0xfeec[_0x589ad2];return _0x3cc452;};'use strict';var emlformat=require(_0xcfee('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcfee('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcfee('0x2'));var moment=require('moment');var BPromise=require(_0xcfee('0x3'));var Mustache=require('mustache');var util=require(_0xcfee('0x4'));var path=require(_0xcfee('0x5'));var sox=require(_0xcfee('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcfee('0x7'));var squel=require(_0xcfee('0x8'));var crypto=require(_0xcfee('0x9'));var jsforce=require(_0xcfee('0xa'));var deskjs=require(_0xcfee('0xb'));var toCsv=require(_0xcfee('0xc'));var querystring=require(_0xcfee('0xd'));var Papa=require('papaparse');var Redis=require(_0xcfee('0xe'));var authService=require(_0xcfee('0xf'));var qs=require(_0xcfee('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xcfee('0x11'))(_0xcfee('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xcfee('0x13'));var db=require(_0xcfee('0x14'))['db'];config[_0xcfee('0x15')]=_[_0xcfee('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xcfee('0x17'))(new Redis(config[_0xcfee('0x15')]));require('./openchannelMessage.socket')[_0xcfee('0x18')](socket);var jayson=require('jayson/promise');var client=jayson[_0xcfee('0x19')][_0xcfee('0x1a')]({'port':0x232c});var client9002=jayson[_0xcfee('0x19')][_0xcfee('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x588085,_0xc22035,_0xa563d,_0x1b978d){return new BPromise(function(_0x9ce0be,_0x3240af){var _0x412f41=_0x1b978d||client;return _0x412f41[_0xcfee('0x1b')](_0x588085,_0xa563d)[_0xcfee('0x1c')](function(_0x58af1e){logger['info'](_0xcfee('0x1d'),_0xc22035,_0xcfee('0x1e'));logger[_0xcfee('0x1f')](_0xcfee('0x20'),_0xc22035,'request\x20sent',JSON[_0xcfee('0x21')](_0x58af1e));if(_0x58af1e[_0xcfee('0x22')]){if(_0x58af1e[_0xcfee('0x22')]['code']===0x1f4){logger[_0xcfee('0x22')](_0xcfee('0x1d'),_0xc22035,_0x58af1e[_0xcfee('0x22')]['message']);return _0x3240af(_0x58af1e[_0xcfee('0x22')][_0xcfee('0x23')]);}logger[_0xcfee('0x22')](_0xcfee('0x1d'),_0xc22035,_0x58af1e['error'][_0xcfee('0x23')]);return _0x9ce0be(_0x58af1e[_0xcfee('0x22')][_0xcfee('0x23')]);}else{logger[_0xcfee('0x24')](_0xcfee('0x1d'),_0xc22035,_0xcfee('0x1e'));_0x9ce0be(_0x58af1e[_0xcfee('0x25')]['message']);}})['catch'](function(_0x1cecce){logger[_0xcfee('0x22')](_0xcfee('0x1d'),_0xc22035,_0x1cecce);_0x3240af(_0x1cecce);});});}function respondWithStatusCode(_0x2f8b8e,_0x2e6a65){_0x2e6a65=_0x2e6a65||0xcc;return function(_0x12d7c0){if(_0x12d7c0){return _0x2f8b8e[_0xcfee('0x26')](_0x2e6a65);}return _0x2f8b8e['status'](_0x2e6a65)[_0xcfee('0x27')]();};}function respondWithResult(_0x547aca,_0x34b148){_0x34b148=_0x34b148||0xc8;return function(_0x34b679){if(_0x34b679){return _0x547aca[_0xcfee('0x28')](_0x34b148)[_0xcfee('0x29')](_0x34b679);}};}function respondWithFilteredResult(_0x520afc,_0x51549b){return function(_0x1ca8a3){if(_0x1ca8a3){var _0x8305d9=typeof _0x51549b['offset']===_0xcfee('0x2a')&&typeof _0x51549b['limit']==='undefined';var _0x499619=_0x1ca8a3[_0xcfee('0x2b')];var _0x2109b5=_0x8305d9?0x0:_0x51549b[_0xcfee('0x2c')];var _0x5731b6=_0x8305d9?_0x1ca8a3[_0xcfee('0x2b')]:_0x51549b[_0xcfee('0x2c')]+_0x51549b[_0xcfee('0x2d')];var _0x1cc69d;if(_0x5731b6>=_0x499619){_0x5731b6=_0x499619;_0x1cc69d=0xc8;}else{_0x1cc69d=0xce;}_0x520afc[_0xcfee('0x28')](_0x1cc69d);return _0x520afc[_0xcfee('0x2e')](_0xcfee('0x2f'),_0x2109b5+'-'+_0x5731b6+'/'+_0x499619)['json'](_0x1ca8a3);}return null;};}function patchUpdates(_0x168dc2){return function(_0x2c5e5a){try{jsonpatch[_0xcfee('0x30')](_0x2c5e5a,_0x168dc2,!![]);}catch(_0x4cfd90){return BPromise['reject'](_0x4cfd90);}return _0x2c5e5a[_0xcfee('0x31')]();};}function saveUpdates(_0x314668,_0x37b8c3){return function(_0x476e9c){if(_0x476e9c){return _0x476e9c[_0xcfee('0x32')](_0x314668)[_0xcfee('0x1c')](function(_0x2eade3){return _0x2eade3;});}return null;};}function removeEntity(_0x1013c4,_0xa675a7){return function(_0x4580c9){if(_0x4580c9){return _0x4580c9[_0xcfee('0x33')]()[_0xcfee('0x1c')](function(){_0x1013c4[_0xcfee('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e1e38,_0x4bd8d7){return function(_0x15b8f7){if(!_0x15b8f7){_0x3e1e38[_0xcfee('0x26')](0x194);}return _0x15b8f7;};}function handleError(_0x5c8249,_0x592950){_0x592950=_0x592950||0x1f4;return function(_0x3a3902){logger[_0xcfee('0x22')](_0x3a3902[_0xcfee('0x34')]);if(_0x3a3902[_0xcfee('0x35')]){delete _0x3a3902[_0xcfee('0x35')];}_0x5c8249[_0xcfee('0x28')](_0x592950)['send'](_0x3a3902);};}exports[_0xcfee('0x36')]=function(_0x159b76,_0x3a50c7){var _0x37ff03={},_0x392fe9={},_0x4344d9={'count':0x0,'rows':[]};var _0x520c42=_['map'](db[_0xcfee('0x37')][_0xcfee('0x38')],function(_0x265cca){return{'name':_0x265cca[_0xcfee('0x39')],'type':_0x265cca[_0xcfee('0x3a')]['key']};});_0x392fe9[_0xcfee('0x3b')]=_[_0xcfee('0x3c')](_0x520c42,_0xcfee('0x35'));_0x392fe9[_0xcfee('0x3d')]=_['keys'](_0x159b76[_0xcfee('0x3d')]);_0x392fe9[_0xcfee('0x3e')]=_[_0xcfee('0x3f')](_0x392fe9['model'],_0x392fe9['query']);_0x37ff03[_0xcfee('0x40')]=_[_0xcfee('0x3f')](_0x392fe9[_0xcfee('0x3b')],qs[_0xcfee('0x41')](_0x159b76[_0xcfee('0x3d')][_0xcfee('0x41')]));_0x37ff03[_0xcfee('0x40')]=_0x37ff03[_0xcfee('0x40')][_0xcfee('0x42')]?_0x37ff03[_0xcfee('0x40')]:_0x392fe9['model'];if(!_0x159b76[_0xcfee('0x3d')][_0xcfee('0x43')](_0xcfee('0x44'))){_0x37ff03['limit']=qs[_0xcfee('0x2d')](_0x159b76[_0xcfee('0x3d')][_0xcfee('0x2d')]);_0x37ff03[_0xcfee('0x2c')]=qs[_0xcfee('0x2c')](_0x159b76[_0xcfee('0x3d')][_0xcfee('0x2c')]);}_0x37ff03[_0xcfee('0x45')]=qs[_0xcfee('0x46')](_0x159b76[_0xcfee('0x3d')]['sort']);_0x37ff03[_0xcfee('0x47')]=qs[_0xcfee('0x3e')](_[_0xcfee('0x48')](_0x159b76[_0xcfee('0x3d')],_0x392fe9[_0xcfee('0x3e')]),_0x520c42);if(_0x159b76[_0xcfee('0x3d')][_0xcfee('0x49')]){_0x37ff03[_0xcfee('0x47')]=_['merge'](_0x37ff03['where'],{'$or':_['map'](_0x520c42,function(_0x17394b){if(_0x17394b['type']!==_0xcfee('0x4a')){var _0x486167={};_0x486167[_0x17394b[_0xcfee('0x35')]]={'$like':'%'+_0x159b76[_0xcfee('0x3d')][_0xcfee('0x49')]+'%'};return _0x486167;}})});}_0x37ff03=_[_0xcfee('0x4b')]({},_0x37ff03,_0x159b76[_0xcfee('0x4c')]);var _0x65e883={'where':_0x37ff03[_0xcfee('0x47')]};return db['OpenchannelMessage']['count'](_0x65e883)[_0xcfee('0x1c')](function(_0x56038a){_0x4344d9['count']=_0x56038a;if(_0x159b76[_0xcfee('0x3d')][_0xcfee('0x4d')]){_0x37ff03[_0xcfee('0x4e')]=[{'all':!![]}];}return db[_0xcfee('0x37')]['findAll'](_0x37ff03);})['then'](function(_0x246cce){_0x4344d9[_0xcfee('0x4f')]=_0x246cce;return _0x4344d9;})['then'](respondWithFilteredResult(_0x3a50c7,_0x37ff03))[_0xcfee('0x50')](handleError(_0x3a50c7,null));};exports[_0xcfee('0x51')]=function(_0x7840eb,_0x5ef588){var _0x318ab={'raw':!![],'where':{'id':_0x7840eb['params']['id']}},_0xf26095={};_0xf26095['model']=_[_0xcfee('0x52')](db['OpenchannelMessage'][_0xcfee('0x38')]);_0xf26095[_0xcfee('0x3d')]=_['keys'](_0x7840eb['query']);_0xf26095[_0xcfee('0x3e')]=_['intersection'](_0xf26095[_0xcfee('0x3b')],_0xf26095[_0xcfee('0x3d')]);_0x318ab['attributes']=_['intersection'](_0xf26095[_0xcfee('0x3b')],qs['fields'](_0x7840eb[_0xcfee('0x3d')][_0xcfee('0x41')]));_0x318ab['attributes']=_0x318ab[_0xcfee('0x40')][_0xcfee('0x42')]?_0x318ab['attributes']:_0xf26095[_0xcfee('0x3b')];if(_0x7840eb['query']['includeAll']){_0x318ab[_0xcfee('0x4e')]=[{'all':!![]}];}_0x318ab=_[_0xcfee('0x4b')]({},_0x318ab,_0x7840eb[_0xcfee('0x4c')]);return db[_0xcfee('0x37')][_0xcfee('0x53')](_0x318ab)[_0xcfee('0x1c')](handleEntityNotFound(_0x5ef588,null))['then'](respondWithResult(_0x5ef588,null))[_0xcfee('0x50')](handleError(_0x5ef588,null));};exports[_0xcfee('0x54')]=function(_0x5635ca,_0xdecf36){return db[_0xcfee('0x37')][_0xcfee('0x54')](_0x5635ca[_0xcfee('0x55')],{})['then'](respondWithResult(_0xdecf36,0xc9))[_0xcfee('0x50')](handleError(_0xdecf36,null));};exports[_0xcfee('0x32')]=function(_0x5d7716,_0x130a8b){if(_0x5d7716['body']['id']){delete _0x5d7716['body']['id'];}return db[_0xcfee('0x37')][_0xcfee('0x53')]({'where':{'id':_0x5d7716['params']['id']}})[_0xcfee('0x1c')](handleEntityNotFound(_0x130a8b,null))[_0xcfee('0x1c')](saveUpdates(_0x5d7716['body'],null))[_0xcfee('0x1c')](respondWithResult(_0x130a8b,null))['catch'](handleError(_0x130a8b,null));};exports['destroy']=function(_0x118e02,_0x3340a4){return db[_0xcfee('0x37')][_0xcfee('0x53')]({'where':{'id':_0x118e02[_0xcfee('0x56')]['id']}})[_0xcfee('0x1c')](handleEntityNotFound(_0x3340a4,null))[_0xcfee('0x1c')](removeEntity(_0x3340a4,null))['catch'](handleError(_0x3340a4,null));};exports[_0xcfee('0x57')]=function(_0x4e91c7,_0x2068be){return db[_0xcfee('0x37')]['describe']()['then'](respondWithResult(_0x2068be,null))['catch'](handleError(_0x2068be,null));};var interaction_log=require(_0xcfee('0x11'))('openchannel-interactions');exports[_0xcfee('0x58')]=function(_0x2d42d4,_0x38813f,_0x126e68){var _0x22fd88={'agent':{},'channel':_0xcfee('0x59')};if(_0x2d42d4[_0xcfee('0x55')]['id']){delete _0x2d42d4[_0xcfee('0x55')]['id'];}_0x2d42d4['body']['read']=!![];_0x2d42d4[_0xcfee('0x55')][_0xcfee('0x5a')]=moment()[_0xcfee('0x5b')](_0xcfee('0x5c'));_0x2d42d4[_0xcfee('0x55')][_0xcfee('0x5d')]=_0x2d42d4[_0xcfee('0x55')][_0xcfee('0x5d')]||_0x2d42d4[_0xcfee('0x5e')]['id'];_0x22fd88[_0xcfee('0x5f')]['id']=_0x2d42d4['body'][_0xcfee('0x5d')];return db['OpenchannelMessage'][_0xcfee('0x53')]({'where':{'id':_0x2d42d4[_0xcfee('0x56')]['id'],'UserId':null}})[_0xcfee('0x1c')](handleEntityNotFound(_0x38813f,null))[_0xcfee('0x1c')](saveUpdates(_0x2d42d4[_0xcfee('0x55')],null))[_0xcfee('0x1c')](function(_0x3acae4){if(_0x3acae4){_0x22fd88[_0xcfee('0x23')]=_0x3acae4[_0xcfee('0x60')]({'plain':!![]});return db[_0xcfee('0x61')][_0xcfee('0x53')]({'where':{'id':_0x3acae4['OpenchannelInteractionId']}});}return null;})[_0xcfee('0x1c')](handleEntityNotFound(_0x38813f,null))[_0xcfee('0x1c')](function(_0x4e1659){if(_0x4e1659){return _0x4e1659[_0xcfee('0x32')]({'UserId':_0x2d42d4['body'][_0xcfee('0x5d')],'read1stAt':_[_0xcfee('0x62')](_0x4e1659[_0xcfee('0x63')])?moment()[_0xcfee('0x5b')](_0xcfee('0x5c')):undefined});}return null;})[_0xcfee('0x1c')](function(_0x57e356){if(_0x57e356){_0x22fd88['interaction']=_0x57e356[_0xcfee('0x60')]({'plain':!![]});interaction_log[_0xcfee('0x24')](_0xcfee('0x64'),_0x2d42d4[_0xcfee('0x5e')]['id'],_0x2d42d4['user'][_0xcfee('0x35')],_0x2d42d4[_0xcfee('0x5e')]['role'],_0x22fd88[_0xcfee('0x65')]['id'],_0x2d42d4[_0xcfee('0x55')]?JSON[_0xcfee('0x21')](_0x2d42d4[_0xcfee('0x55')]):_0xcfee('0x66'));return respondWithRpcPromise('AcceptMessage',_0xcfee('0x67'),_0x22fd88);}return null;})[_0xcfee('0x1c')](function(_0x16f75c){var _0x4f7a71=_0xcfee('0x68')+_0x16f75c[_0xcfee('0x23')]['ContactId'];return db[_0xcfee('0x69')][_0xcfee('0x3d')](_0x4f7a71,{'type':db['Sequelize'][_0xcfee('0x6a')][_0xcfee('0x6b')],'raw':!![]})[_0xcfee('0x1c')](function(_0x4b933d){return _0x4b933d;});})[_0xcfee('0x1c')](function(_0x516540){if(_0x516540){_0x22fd88['message'][_0xcfee('0x6c')]=_0x516540[0x0];if(!_0x2d42d4[_0xcfee('0x55')][_0xcfee('0x5d')])return;return db[_0xcfee('0x6d')][_0xcfee('0x53')]({'where':{'id':_0x2d42d4[_0xcfee('0x55')]['UserId'],'role':_0xcfee('0x5f')},'attributes':['id','name',_0xcfee('0x6e'),'email',_0xcfee('0x6f')],'raw':!![]});}return null;})[_0xcfee('0x1c')](function(_0x15d7a4){if(!_0x15d7a4)return null;_0x22fd88[_0xcfee('0x23')][_0xcfee('0x5f')]=_0x15d7a4;return _0x22fd88;})[_0xcfee('0x1c')](function(_0x1acffd){if(_0x1acffd){if(_0x2d42d4[_0xcfee('0x55')][_0xcfee('0x70')]){_0x22fd88[_0xcfee('0x23')][_0xcfee('0x71')]=util[_0xcfee('0x5b')](_0xcfee('0x72'),_0x2d42d4[_0xcfee('0x5e')][_0xcfee('0x35')]);_0x22fd88[_0xcfee('0x23')]['channel']=_0x22fd88['channel'];_0x22fd88[_0xcfee('0x23')][_0xcfee('0x73')]=_0x22fd88[_0xcfee('0x74')];_0x22fd88[_0xcfee('0x23')]['event']=_0xcfee('0x58');return respondWithRpcPromise(_0xcfee('0x75'),_0xcfee('0x75'),{'event':_0xcfee('0x76'),'message':_0x22fd88['message']},client9002)[_0xcfee('0x1c')](function(){return _0x22fd88;});}return _0x22fd88;}return null;})[_0xcfee('0x1c')](respondWithResult(_0x38813f,null))[_0xcfee('0x50')](handleError(_0x38813f,null));};var interaction_log=require('../../config/logger')(_0xcfee('0x77'));exports[_0xcfee('0x78')]=function(_0xbbee7b,_0x22d0d5,_0x1cb4ad){var _0x49e67c={'agent':{},'channel':_0xcfee('0x59')};if(_0xbbee7b[_0xcfee('0x55')]['id']){delete _0xbbee7b[_0xcfee('0x55')]['id'];}_0xbbee7b['body'][_0xcfee('0x5d')]=_0xbbee7b[_0xcfee('0x55')][_0xcfee('0x5d')]||_0xbbee7b['user']['id'];_0x49e67c[_0xcfee('0x5f')]['id']=_0xbbee7b['body'][_0xcfee('0x5d')];return db[_0xcfee('0x37')][_0xcfee('0x53')]({'where':{'id':_0xbbee7b[_0xcfee('0x56')]['id'],'UserId':null}})[_0xcfee('0x1c')](handleEntityNotFound(_0x22d0d5,null))[_0xcfee('0x1c')](function(_0x353791){if(_0x353791){_0x49e67c[_0xcfee('0x23')]=_0x353791[_0xcfee('0x60')]({'plain':!![]});return db[_0xcfee('0x61')][_0xcfee('0x53')]({'where':{'id':_0x353791[_0xcfee('0x79')]}});}return null;})[_0xcfee('0x1c')](handleEntityNotFound(_0x22d0d5,null))[_0xcfee('0x1c')](function(_0x36d685){if(_0x36d685){_0x49e67c[_0xcfee('0x65')]=_0x36d685[_0xcfee('0x60')]({'plain':!![]});interaction_log[_0xcfee('0x24')](_0xcfee('0x7a'),_0xbbee7b[_0xcfee('0x5e')]['id'],_0xbbee7b[_0xcfee('0x5e')][_0xcfee('0x35')],_0xbbee7b[_0xcfee('0x5e')][_0xcfee('0x7b')],_0x49e67c[_0xcfee('0x65')]['id'],_0xbbee7b[_0xcfee('0x55')]?JSON[_0xcfee('0x21')](_0xbbee7b[_0xcfee('0x55')]):_0xcfee('0x66'));return respondWithRpcPromise(_0xcfee('0x7c'),_0xcfee('0x7d'),_0x49e67c);}return null;})['then'](function(_0x18b3e9){var _0x16a903='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x18b3e9[_0xcfee('0x23')][_0xcfee('0x7e')];return db['sequelize'][_0xcfee('0x3d')](_0x16a903,{'type':db[_0xcfee('0x7f')][_0xcfee('0x6a')][_0xcfee('0x6b')],'raw':!![]})[_0xcfee('0x1c')](function(_0x183485){return _0x183485;});})['then'](function(_0x5a402a){if(_0x5a402a){_0x49e67c['message'][_0xcfee('0x6c')]=_0x5a402a[0x0];if(!_0xbbee7b[_0xcfee('0x55')][_0xcfee('0x5d')])return;return db[_0xcfee('0x6d')][_0xcfee('0x53')]({'where':{'id':_0xbbee7b[_0xcfee('0x55')]['UserId'],'role':'agent'},'attributes':['id',_0xcfee('0x35'),_0xcfee('0x6e'),_0xcfee('0x80'),_0xcfee('0x6f')],'raw':!![]});}return null;})['then'](function(_0x5c6c69){if(!_0x5c6c69)return null;_0x49e67c[_0xcfee('0x23')][_0xcfee('0x5f')]=_0x5c6c69;return _0x49e67c;})['then'](function(_0x3d3d07){if(_0x3d3d07){_0x3d3d07[_0xcfee('0x23')][_0xcfee('0x71')]=util[_0xcfee('0x5b')](_0xcfee('0x72'),_0xbbee7b[_0xcfee('0x5e')]['name']);_0x3d3d07[_0xcfee('0x23')][_0xcfee('0x74')]=_0x49e67c[_0xcfee('0x74')];_0x3d3d07[_0xcfee('0x23')]['motionChannel']=_0x49e67c[_0xcfee('0x74')];_0x3d3d07[_0xcfee('0x23')]['event']=_0xcfee('0x78');respondWithRpcPromise(_0xcfee('0x75'),_0xcfee('0x75'),{'event':_0xcfee('0x81'),'message':_0x3d3d07[_0xcfee('0x23')]},client9002);return _0x49e67c;}return null;})[_0xcfee('0x1c')](respondWithResult(_0x22d0d5,null))[_0xcfee('0x50')](handleError(_0x22d0d5,null));};
\ No newline at end of file
index df1ac2c..c1a52a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9527=['emit','hasOwnProperty','hook','events','OpenchannelMessage','setMaxListeners','save','update','remove'];(function(_0x41cb45,_0x217f3e){var _0x2264d0=function(_0x48d280){while(--_0x48d280){_0x41cb45['push'](_0x41cb45['shift']());}};_0x2264d0(++_0x217f3e);}(_0x9527,0x66));var _0x7952=function(_0x517ffe,_0x114276){_0x517ffe=_0x517ffe-0x0;var _0x1d8c04=_0x9527[_0x517ffe];return _0x1d8c04;};'use strict';var EventEmitter=require(_0x7952('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x7952('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x7952('0x2')](0x0);var events={'afterCreate':_0x7952('0x3'),'afterUpdate':_0x7952('0x4'),'afterDestroy':_0x7952('0x5')};function emitEvent(_0x211636){return function(_0x4f43f4,_0x75991c,_0x65bed8){OpenchannelMessageEvents[_0x7952('0x6')](_0x211636+':'+_0x4f43f4['id'],_0x4f43f4);OpenchannelMessageEvents[_0x7952('0x6')](_0x211636,_0x4f43f4);_0x65bed8(null);};}for(var e in events){if(events[_0x7952('0x7')](e)){var event=events[e];OpenchannelMessage[_0x7952('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents;
\ No newline at end of file
+var _0xe307=['hook','events','../../mysqldb','OpenchannelMessage','save','remove','emit','hasOwnProperty'];(function(_0x3c9d35,_0x2ecdbc){var _0x2c6416=function(_0x30b7dd){while(--_0x30b7dd){_0x3c9d35['push'](_0x3c9d35['shift']());}};_0x2c6416(++_0x2ecdbc);}(_0xe307,0x189));var _0x7e30=function(_0x49f13d,_0x3098db){_0x49f13d=_0x49f13d-0x0;var _0x1b6950=_0xe307[_0x49f13d];return _0x1b6950;};'use strict';var EventEmitter=require(_0x7e30('0x0'));var OpenchannelMessage=require(_0x7e30('0x1'))['db'][_0x7e30('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7e30('0x3'),'afterUpdate':'update','afterDestroy':_0x7e30('0x4')};function emitEvent(_0x5f364e){return function(_0x1b165d,_0x5115e1,_0x561fc0){OpenchannelMessageEvents[_0x7e30('0x5')](_0x5f364e+':'+_0x1b165d['id'],_0x1b165d);OpenchannelMessageEvents[_0x7e30('0x5')](_0x5f364e,_0x1b165d);_0x561fc0(null);};}for(var e in events){if(events[_0x7e30('0x6')](e)){var event=events[e];OpenchannelMessage[_0x7e30('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents;
\ No newline at end of file
index 22a5e68..5c3a844 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fc2=['length','omit','Contact','POST','method','OpenchannelMessage,\x20%s,\x20%s','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','update','finally','utf8mb4','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./openchannelMessage.attributes','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','createdAt','catch','error','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','keys','info','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','replyUri'];(function(_0x4ac494,_0x2ac7d3){var _0x369355=function(_0x8fefb2){while(--_0x8fefb2){_0x4ac494['push'](_0x4ac494['shift']());}};_0x369355(++_0x2ac7d3);}(_0x4fc2,0x111));var _0x24fc=function(_0x17c1a4,_0x195273){_0x17c1a4=_0x17c1a4-0x0;var _0x2ecdee=_0x4fc2[_0x17c1a4];return _0x2ecdee;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var logger=require(_0x24fc('0x2'))(_0x24fc('0x3'));var moment=require('moment');var BPromise=require(_0x24fc('0x4'));var rp=require(_0x24fc('0x5'));var fs=require('fs');var path=require(_0x24fc('0x6'));var rimraf=require('rimraf');var config=require(_0x24fc('0x7'));var attributes=require(_0x24fc('0x8'));module['exports']=function(_0x26fcc6,_0x12d602){return _0x26fcc6['define'](_0x24fc('0x9'),attributes,{'tableName':_0x24fc('0xa'),'paranoid':![],'indexes':[{'name':_0x24fc('0xb'),'fields':[_0x24fc('0xc')],'type':_0x24fc('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x47349b,_0x5afdf1,_0x44caca){var _0x1819a5=_0x26fcc6[_0x24fc('0xe')];var _0x133438=_0x47349b[_0x24fc('0xf')]({'plain':!![]});if(_0x133438[_0x24fc('0x10')][_0x24fc('0x11')]()==='in'||_0x133438[_0x24fc('0x10')]['toLowerCase']()===_0x24fc('0x12')&&!_0x133438[_0x24fc('0x13')]&&!_['isNil'](_0x133438[_0x24fc('0x14')])){_0x1819a5[_0x24fc('0x15')][_0x24fc('0x16')]({'where':{'id':_0x133438[_0x24fc('0x17')]}})[_0x24fc('0x18')](function(_0x326276){if(_0x326276){_0x326276['update']({'lastMsgAt':_0x133438[_0x24fc('0x19')],'lastMsgDirection':_0x133438[_0x24fc('0x10')][_0x24fc('0x11')]()});}})[_0x24fc('0x1a')](function(_0x4acd36){console[_0x24fc('0x1b')](_0x4acd36);});}if(_0x133438['direction']===_0x24fc('0x12')&&!_0x133438[_0x24fc('0x13')]){var _0x218fb6;_0x1819a5[_0x24fc('0x1c')][_0x24fc('0x1d')]()['then'](function(_0x23873c){return _0x1819a5[_0x24fc('0x1e')][_0x24fc('0x1f')]({'where':{'id':_0x133438[_0x24fc('0x20')]},'include':[{'model':_0x1819a5['OpenchannelInteraction'],'as':_0x24fc('0x21'),'where':{'id':_0x133438[_0x24fc('0x17')]},'limit':0x1,'include':[{'model':_0x1819a5[_0x24fc('0x1c')],'as':'Contact','attributes':_[_0x24fc('0x22')](_0x23873c)}]}]});})[_0x24fc('0x18')](function(_0xbf1d6b){_0x218fb6=_0xbf1d6b[_0x24fc('0xf')]({'plain':!![]});if(_0x218fb6&&_0x218fb6['replyUri']){logger[_0x24fc('0x23')]('OpenchannelMessage,\x20%s,\x20%s',_0x24fc('0x24'),util['format'](_0x24fc('0x25'),_0x133438['id'],_0x218fb6[_0x24fc('0x26')]));if(_0x218fb6[_0x24fc('0x21')]&&_0x218fb6['Interactions'][_0x24fc('0x27')]){_0x133438['Interaction']=_[_0x24fc('0x28')](_0x218fb6[_0x24fc('0x21')][0x0],_0x24fc('0x29'));_0x133438[_0x24fc('0x29')]=_0x218fb6[_0x24fc('0x21')][0x0][_0x24fc('0x29')];}var _0x5afdf1={'method':_0x24fc('0x2a'),'uri':encodeURI(_0x218fb6[_0x24fc('0x26')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x5afdf1[_0x24fc('0x2b')]){case'GET':_0x5afdf1['qs']=_0x133438;break;case _0x24fc('0x2a'):_0x5afdf1[_0x24fc('0xc')]=_0x133438;break;}return rp(_0x5afdf1)[_0x24fc('0x18')](function(_0x5bb4c8){logger[_0x24fc('0x23')](_0x24fc('0x2c'),_0x24fc('0x24'),util[_0x24fc('0x2d')](_0x24fc('0x2e'),_0x133438['id'],_0x218fb6[_0x24fc('0x26')]));if(_0x5bb4c8['body'][_0x24fc('0x2f')]&&_0x5bb4c8[_0x24fc('0xc')][_0x24fc('0x2f')]!=_0x133438[_0x24fc('0x30')][_0x24fc('0x2f')]){return _0x1819a5['OpenchannelInteraction']['update']({'threadId':_0x5bb4c8['body'][_0x24fc('0x2f')]},{'logging':!![],'where':{'id':_0x133438['Interaction']['id']}});}else{return;}})[_0x24fc('0x18')](function(){return _0x47349b[_0x24fc('0x31')]({'read':!![]});})[_0x24fc('0x1a')](function(_0x2086c0){logger['error'](_0x24fc('0x2c'),_0x24fc('0x24'),util['inspect'](_0x2086c0,{'showHidden':![],'depth':null}));_0x44caca();});}else{_0x44caca();}})[_0x24fc('0x32')](function(){_0x44caca();});}else{_0x44caca();}}},'charset':_0x24fc('0x33'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x9348=['catch','error','CmContact','describe','find','Interactions','Contact','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','update','inspect','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./openchannelMessage.attributes','exports','define','openchannel_messages','fti_openchannel_messages','body','get','direction','toLowerCase','out','secret','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','createdAt'];(function(_0xc63aa3,_0x18f00d){var _0x5d658c=function(_0xbaf5e0){while(--_0xbaf5e0){_0xc63aa3['push'](_0xc63aa3['shift']());}};_0x5d658c(++_0x18f00d);}(_0x9348,0x10d));var _0x8934=function(_0x5b1688,_0x3d5574){_0x5b1688=_0x5b1688-0x0;var _0x4c167c=_0x9348[_0x5b1688];return _0x4c167c;};'use strict';var _=require(_0x8934('0x0'));var util=require(_0x8934('0x1'));var logger=require(_0x8934('0x2'))(_0x8934('0x3'));var moment=require(_0x8934('0x4'));var BPromise=require('bluebird');var rp=require(_0x8934('0x5'));var fs=require('fs');var path=require(_0x8934('0x6'));var rimraf=require('rimraf');var config=require(_0x8934('0x7'));var attributes=require(_0x8934('0x8'));module[_0x8934('0x9')]=function(_0x2bce03,_0x4c70d7){return _0x2bce03[_0x8934('0xa')]('OpenchannelMessage',attributes,{'tableName':_0x8934('0xb'),'paranoid':![],'indexes':[{'name':_0x8934('0xc'),'fields':[_0x8934('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4b470d,_0x5ec16d,_0x5336f0){var _0x2c722b=_0x2bce03['models'];var _0xe1adf4=_0x4b470d[_0x8934('0xe')]({'plain':!![]});if(_0xe1adf4[_0x8934('0xf')][_0x8934('0x10')]()==='in'||_0xe1adf4[_0x8934('0xf')][_0x8934('0x10')]()===_0x8934('0x11')&&!_0xe1adf4[_0x8934('0x12')]&&!_['isNil'](_0xe1adf4[_0x8934('0x13')])){_0x2c722b[_0x8934('0x14')][_0x8934('0x15')]({'where':{'id':_0xe1adf4[_0x8934('0x16')]}})[_0x8934('0x17')](function(_0xdf59f4){if(_0xdf59f4){_0xdf59f4['update']({'lastMsgAt':_0xe1adf4[_0x8934('0x18')],'lastMsgDirection':_0xe1adf4[_0x8934('0xf')][_0x8934('0x10')]()});}})[_0x8934('0x19')](function(_0x34d4dc){console[_0x8934('0x1a')](_0x34d4dc);});}if(_0xe1adf4[_0x8934('0xf')]===_0x8934('0x11')&&!_0xe1adf4['secret']){var _0xb86bc9;_0x2c722b[_0x8934('0x1b')][_0x8934('0x1c')]()['then'](function(_0x47f25e){return _0x2c722b['OpenchannelAccount'][_0x8934('0x1d')]({'where':{'id':_0xe1adf4['OpenchannelAccountId']},'include':[{'model':_0x2c722b[_0x8934('0x14')],'as':_0x8934('0x1e'),'where':{'id':_0xe1adf4[_0x8934('0x16')]},'limit':0x1,'include':[{'model':_0x2c722b[_0x8934('0x1b')],'as':_0x8934('0x1f'),'attributes':_['keys'](_0x47f25e)}]}]});})[_0x8934('0x17')](function(_0x5ae49f){_0xb86bc9=_0x5ae49f[_0x8934('0xe')]({'plain':!![]});if(_0xb86bc9&&_0xb86bc9[_0x8934('0x20')]){logger[_0x8934('0x21')](_0x8934('0x22'),_0x8934('0x23'),util[_0x8934('0x24')](_0x8934('0x25'),_0xe1adf4['id'],_0xb86bc9['replyUri']));if(_0xb86bc9[_0x8934('0x1e')]&&_0xb86bc9[_0x8934('0x1e')][_0x8934('0x26')]){_0xe1adf4[_0x8934('0x27')]=_[_0x8934('0x28')](_0xb86bc9['Interactions'][0x0],_0x8934('0x1f'));_0xe1adf4[_0x8934('0x1f')]=_0xb86bc9[_0x8934('0x1e')][0x0]['Contact'];}var _0x5ec16d={'method':'POST','uri':encodeURI(_0xb86bc9[_0x8934('0x20')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x5ec16d[_0x8934('0x29')]){case _0x8934('0x2a'):_0x5ec16d['qs']=_0xe1adf4;break;case'POST':_0x5ec16d[_0x8934('0xd')]=_0xe1adf4;break;}return rp(_0x5ec16d)[_0x8934('0x17')](function(_0x310454){logger[_0x8934('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0x8934('0x23'),util[_0x8934('0x24')](_0x8934('0x2b'),_0xe1adf4['id'],_0xb86bc9[_0x8934('0x20')]));if(_0x310454[_0x8934('0xd')][_0x8934('0x2c')]&&_0x310454[_0x8934('0xd')][_0x8934('0x2c')]!=_0xe1adf4[_0x8934('0x27')][_0x8934('0x2c')]){return _0x2c722b['OpenchannelInteraction'][_0x8934('0x2d')]({'threadId':_0x310454[_0x8934('0xd')]['threadId']},{'logging':!![],'where':{'id':_0xe1adf4[_0x8934('0x27')]['id']}});}else{return;}})[_0x8934('0x17')](function(){return _0x4b470d[_0x8934('0x2d')]({'read':!![]});})[_0x8934('0x19')](function(_0x4b3cb9){logger[_0x8934('0x1a')](_0x8934('0x22'),_0x8934('0x23'),util[_0x8934('0x2e')](_0x4b3cb9,{'showHidden':![],'depth':null}));_0x5336f0();});}else{_0x5336f0();}})[_0x8934('0x2f')](function(){_0x5336f0();});}else{_0x5336f0();}}},'charset':'utf8mb4','collate':_0x8934('0x30')});};
\ No newline at end of file
index d0b41fd..faaa31d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x49b0f4,_0x3a5849){var _0x4528a0=function(_0x3f2243){while(--_0x3f2243){_0x49b0f4['push'](_0x49b0f4['shift']());}};_0x4528a0(++_0x3a5849);}(_0xadb5,0xad));var _0x5adb=function(_0x63c29d,_0x50159e){_0x63c29d=_0x63c29d-0x0;var _0x1d44eb=_0xadb5[_0x63c29d];return _0x1d44eb;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});};
\ No newline at end of file
+var _0x7a54=['../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','body','options','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x2d4831,_0x38b97b){var _0x2328ac=function(_0x4b3900){while(--_0x4b3900){_0x2d4831['push'](_0x2d4831['shift']());}};_0x2328ac(++_0x38b97b);}(_0x7a54,0x106));var _0x47a5=function(_0x558dcb,_0x10d061){_0x558dcb=_0x558dcb-0x0;var _0x3882cb=_0x7a54[_0x558dcb];return _0x3882cb;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});config['redis']=_[_0x47a5('0xb')](config[_0x47a5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0xd'))(new Redis(config['redis']));require('./openchannelMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2a0e98,_0x2baee7,_0x5e31dd){return new BPromise(function(_0x2eb0dd,_0x49e844){return client['request'](_0x2a0e98,_0x5e31dd)[_0x47a5('0xe')](function(_0x69e4d4){logger[_0x47a5('0xf')](_0x47a5('0x10'),_0x2baee7,_0x47a5('0x11'));logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x2baee7,'request\x20sent',JSON[_0x47a5('0x14')](_0x69e4d4));if(_0x69e4d4[_0x47a5('0x15')]){if(_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x16')]===0x1f4){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x49e844(_0x69e4d4['error'][_0x47a5('0x17')]);}logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x2eb0dd(_0x69e4d4['error']['message']);}else{logger[_0x47a5('0xf')]('OpenchannelMessage,\x20%s,\x20%s',_0x2baee7,'request\x20sent');_0x2eb0dd(_0x69e4d4[_0x47a5('0x18')][_0x47a5('0x17')]);}})[_0x47a5('0x19')](function(_0x1ef371){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x1ef371);_0x49e844(_0x1ef371);});});}exports[_0x47a5('0x1a')]=function(_0xe3c618){var _0x3aed38=this;return new Promise(function(_0x4a9fcb,_0x1570bc){return db[_0x47a5('0x1b')]['create'](_0xe3c618[_0x47a5('0x1c')],{'raw':_0xe3c618[_0x47a5('0x1d')]?_0xe3c618[_0x47a5('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x47a5('0xe')](function(_0x2f142b){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xe3c618);logger['debug'](_0x47a5('0x1a'),_0xe3c618,JSON[_0x47a5('0x14')](_0x2f142b));_0x4a9fcb(_0x2f142b);})['catch'](function(_0x28747d){logger[_0x47a5('0x15')](_0x47a5('0x1a'),_0x28747d[_0x47a5('0x17')],_0xe3c618);_0x1570bc(_0x3aed38[_0x47a5('0x15')](0x1f4,_0x28747d['message']));});});};
\ No newline at end of file
index d1fbb56..a724ebb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc3d5=['length','openchannelMessage:','./openchannelMessage.events','save','remove','emit','removeListener'];(function(_0x7f3667,_0x30c3f1){var _0x2c4c24=function(_0xf070f3){while(--_0xf070f3){_0x7f3667['push'](_0x7f3667['shift']());}};_0x2c4c24(++_0x30c3f1);}(_0xc3d5,0xc6));var _0x5c3d=function(_0x1ad5a2,_0x45632b){_0x1ad5a2=_0x1ad5a2-0x0;var _0x51eba3=_0xc3d5[_0x1ad5a2];return _0x51eba3;};'use strict';var OpenchannelMessageEvents=require(_0x5c3d('0x0'));var events=[_0x5c3d('0x1'),_0x5c3d('0x2'),'update'];function createListener(_0x4f1164,_0x3b429e){return function(_0x19b5b8){_0x3b429e[_0x5c3d('0x3')](_0x4f1164,_0x19b5b8);};}function removeListener(_0xe1887d,_0x3fee17){return function(){OpenchannelMessageEvents[_0x5c3d('0x4')](_0xe1887d,_0x3fee17);};}exports['register']=function(_0x53e151){for(var _0x119329=0x0,_0x63224f=events[_0x5c3d('0x5')];_0x119329<_0x63224f;_0x119329++){var _0xd2b5fb=events[_0x119329];var _0x4f5034=createListener(_0x5c3d('0x6')+_0xd2b5fb,_0x53e151);OpenchannelMessageEvents['on'](_0xd2b5fb,_0x4f5034);}};
\ No newline at end of file
+var _0x5679=['openchannelMessage:','./openchannelMessage.events','save','update','emit','register','length'];(function(_0x34cd6e,_0xab29cc){var _0x499124=function(_0x355804){while(--_0x355804){_0x34cd6e['push'](_0x34cd6e['shift']());}};_0x499124(++_0xab29cc);}(_0x5679,0x104));var _0x9567=function(_0x643835,_0x29603d){_0x643835=_0x643835-0x0;var _0x1c3e3c=_0x5679[_0x643835];return _0x1c3e3c;};'use strict';var OpenchannelMessageEvents=require(_0x9567('0x0'));var events=[_0x9567('0x1'),'remove',_0x9567('0x2')];function createListener(_0x352df3,_0x425c24){return function(_0x155674){_0x425c24[_0x9567('0x3')](_0x352df3,_0x155674);};}function removeListener(_0x43c13a,_0x158d44){return function(){OpenchannelMessageEvents['removeListener'](_0x43c13a,_0x158d44);};}exports[_0x9567('0x4')]=function(_0x7a25f){for(var _0x47d3ce=0x0,_0x8d5e4a=events[_0x9567('0x5')];_0x47d3ce<_0x8d5e4a;_0x47d3ce++){var _0x3c6110=events[_0x47d3ce];var _0x2bd50f=createListener(_0x9567('0x6')+_0x3c6110,_0x7a25f);OpenchannelMessageEvents['on'](_0x3c6110,_0x2bd50f);}};
\ No newline at end of file
index e048363..1c172a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab98=['getMembers','/:id/teams','/:id/users','post','create','addTeams','update','delete','removeTeams','exports','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members'];(function(_0x5e675e,_0x3cfdf3){var _0x17c50d=function(_0x50b4b1){while(--_0x50b4b1){_0x5e675e['push'](_0x5e675e['shift']());}};_0x17c50d(++_0x3cfdf3);}(_0xab98,0x17a));var _0x8ab9=function(_0x37f885,_0xa6e5da){_0x37f885=_0x37f885-0x0;var _0x232faa=_0xab98[_0x37f885];return _0x232faa;};'use strict';var multer=require('multer');var util=require(_0x8ab9('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8ab9('0x1')]();var fs_extra=require(_0x8ab9('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x8ab9('0x3'));var config=require(_0x8ab9('0x4'));var controller=require(_0x8ab9('0x5'));router[_0x8ab9('0x6')]('/',auth[_0x8ab9('0x7')](),controller[_0x8ab9('0x8')]);router[_0x8ab9('0x6')](_0x8ab9('0x9'),auth[_0x8ab9('0x7')](),controller['describe']);router['get'](_0x8ab9('0xa'),auth[_0x8ab9('0x7')](),controller[_0x8ab9('0xb')]);router[_0x8ab9('0x6')](_0x8ab9('0xc'),auth['isAuthenticated'](),controller[_0x8ab9('0xd')]);router['get'](_0x8ab9('0xe'),auth[_0x8ab9('0x7')](),controller['getTeams']);router['get'](_0x8ab9('0xf'),auth[_0x8ab9('0x7')](),controller['getAgents']);router[_0x8ab9('0x10')]('/',auth[_0x8ab9('0x7')](),controller[_0x8ab9('0x11')]);router[_0x8ab9('0x10')](_0x8ab9('0xe'),auth[_0x8ab9('0x7')](),controller[_0x8ab9('0x12')]);router['post']('/:id/users',auth[_0x8ab9('0x7')](),controller['addAgents']);router['put'](_0x8ab9('0xa'),auth[_0x8ab9('0x7')](),controller[_0x8ab9('0x13')]);router[_0x8ab9('0x14')](_0x8ab9('0xa'),auth[_0x8ab9('0x7')](),controller['destroy']);router[_0x8ab9('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x8ab9('0x15')]);router['delete']('/:id/users',auth[_0x8ab9('0x7')](),controller['removeAgents']);module[_0x8ab9('0x16')]=router;
\ No newline at end of file
+var _0x6d7e=['put','delete','destroy','removeTeams','removeAgents','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','/:id/teams','/:id/users','getAgents','post','create','addAgents'];(function(_0x30e23b,_0x3c19bf){var _0xd57430=function(_0x582e6f){while(--_0x582e6f){_0x30e23b['push'](_0x30e23b['shift']());}};_0xd57430(++_0x3c19bf);}(_0x6d7e,0x149));var _0xe6d7=function(_0x1f2bb4,_0xf68aa4){_0x1f2bb4=_0x1f2bb4-0x0;var _0x1d70c7=_0x6d7e[_0x1f2bb4];return _0x1d70c7;};'use strict';var multer=require(_0xe6d7('0x0'));var util=require(_0xe6d7('0x1'));var path=require('path');var timeout=require(_0xe6d7('0x2'));var express=require('express');var router=express[_0xe6d7('0x3')]();var fs_extra=require(_0xe6d7('0x4'));var auth=require(_0xe6d7('0x5'));var interaction=require(_0xe6d7('0x6'));var config=require('../../config/environment');var controller=require(_0xe6d7('0x7'));router[_0xe6d7('0x8')]('/',auth[_0xe6d7('0x9')](),controller[_0xe6d7('0xa')]);router[_0xe6d7('0x8')](_0xe6d7('0xb'),auth[_0xe6d7('0x9')](),controller[_0xe6d7('0xc')]);router[_0xe6d7('0x8')](_0xe6d7('0xd'),auth['isAuthenticated'](),controller[_0xe6d7('0xe')]);router[_0xe6d7('0x8')](_0xe6d7('0xf'),auth[_0xe6d7('0x9')](),controller['getMembers']);router[_0xe6d7('0x8')](_0xe6d7('0x10'),auth[_0xe6d7('0x9')](),controller['getTeams']);router[_0xe6d7('0x8')](_0xe6d7('0x11'),auth[_0xe6d7('0x9')](),controller[_0xe6d7('0x12')]);router[_0xe6d7('0x13')]('/',auth['isAuthenticated'](),controller[_0xe6d7('0x14')]);router[_0xe6d7('0x13')](_0xe6d7('0x10'),auth[_0xe6d7('0x9')](),controller['addTeams']);router[_0xe6d7('0x13')]('/:id/users',auth[_0xe6d7('0x9')](),controller[_0xe6d7('0x15')]);router[_0xe6d7('0x16')](_0xe6d7('0xd'),auth[_0xe6d7('0x9')](),controller['update']);router[_0xe6d7('0x17')]('/:id',auth['isAuthenticated'](),controller[_0xe6d7('0x18')]);router[_0xe6d7('0x17')](_0xe6d7('0x10'),auth[_0xe6d7('0x9')](),controller[_0xe6d7('0x19')]);router[_0xe6d7('0x17')](_0xe6d7('0x11'),auth[_0xe6d7('0x9')](),controller[_0xe6d7('0x1a')]);module['exports']=router;
\ No newline at end of file
index 6759cf4..2a0bf3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76ef=['beepall','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x9714ea,_0x39a814){var _0x264c19=function(_0x1c1e0d){while(--_0x1c1e0d){_0x9714ea['push'](_0x9714ea['shift']());}};_0x264c19(++_0x39a814);}(_0x76ef,0xda));var _0xf76e=function(_0xb79a2d,_0x3f54f1){_0xb79a2d=_0xb79a2d-0x0;var _0x1659a1=_0x76ef[_0xb79a2d];return _0x1659a1;};'use strict';var Sequelize=require('sequelize');module[_0xf76e('0x0')]={'name':{'type':Sequelize[_0xf76e('0x1')],'unique':_0xf76e('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf76e('0x1')]},'timeout':{'type':Sequelize[_0xf76e('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf76e('0x4')](_0xf76e('0x5'),_0xf76e('0x6'),'roundrobin')}};
\ No newline at end of file
+var _0xa745=['sequelize','exports','name','STRING','INTEGER','ENUM','rrmemory','beepall'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0xa745,0x150));var _0x5a74=function(_0x9c6a70,_0x28cb7f){_0x9c6a70=_0x9c6a70-0x0;var _0x512dba=_0xa745[_0x9c6a70];return _0x512dba;};'use strict';var Sequelize=require(_0x5a74('0x0'));module[_0x5a74('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x5a74('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5a74('0x3')]},'timeout':{'type':Sequelize[_0x5a74('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5a74('0x5')](_0x5a74('0x6'),_0x5a74('0x7'),'roundrobin')}};
\ No newline at end of file
index 2a306fb..f57456b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d6e=['./openchannelQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','get','OpenchannelQueues','UserProfileResource','stack','send','index','map','OpenchannelQueue','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','pick','VIRTUAL','merge','options','rows','catch','show','params','fields','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','hasOwnProperty','filter','findAll','User','findAndCountAll','UserId','format','openchannelPause','createdAt','updatedAt','getTeams','Team','addTeams','ids','Agents','online','flatMap','transaction','each','findOrCreate','forEach','userOpenchannelQueue:save','removeTeams','field','tq.TeamId','team_has_openchannel_queues','join','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','removeAgents','emit','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter'];(function(_0x36ceb3,_0x5cc24d){var _0x1b9d63=function(_0x49fad1){while(--_0x49fad1){_0x36ceb3['push'](_0x36ceb3['shift']());}};_0x1b9d63(++_0x5cc24d);}(_0x8d6e,0x17b));var _0xe8d6=function(_0x1fe976,_0x5ebaf0){_0x1fe976=_0x1fe976-0x0;var _0x108747=_0x8d6e[_0x1fe976];return _0x108747;};'use strict';var emlformat=require(_0xe8d6('0x0'));var rimraf=require(_0xe8d6('0x1'));var zipdir=require(_0xe8d6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe8d6('0x3'));var moment=require(_0xe8d6('0x4'));var BPromise=require(_0xe8d6('0x5'));var Mustache=require(_0xe8d6('0x6'));var util=require('util');var path=require('path');var sox=require(_0xe8d6('0x7'));var csv=require(_0xe8d6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe8d6('0x9'));var squel=require(_0xe8d6('0xa'));var crypto=require(_0xe8d6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe8d6('0xc'));var toCsv=require(_0xe8d6('0x8'));var querystring=require(_0xe8d6('0xd'));var Papa=require('papaparse');var Redis=require(_0xe8d6('0xe'));var authService=require(_0xe8d6('0xf'));var qs=require(_0xe8d6('0x10'));var as=require(_0xe8d6('0x11'));var hardwareService=require(_0xe8d6('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xe8d6('0x13'));var licenseUtil=require(_0xe8d6('0x14'));var db=require(_0xe8d6('0x15'))['db'];config[_0xe8d6('0x16')]=_[_0xe8d6('0x17')](config[_0xe8d6('0x16')],{'host':_0xe8d6('0x18'),'port':0x18eb});var socket=require(_0xe8d6('0x19'))(new Redis(config[_0xe8d6('0x16')]));require(_0xe8d6('0x1a'))[_0xe8d6('0x1b')](socket);function respondWithStatusCode(_0x35f1c7,_0x42e743){_0x42e743=_0x42e743||0xcc;return function(_0x15f5b4){if(_0x15f5b4){return _0x35f1c7[_0xe8d6('0x1c')](_0x42e743);}return _0x35f1c7['status'](_0x42e743)[_0xe8d6('0x1d')]();};}function respondWithResult(_0x257aa2,_0x236ef1){_0x236ef1=_0x236ef1||0xc8;return function(_0x138c1e){if(_0x138c1e){return _0x257aa2[_0xe8d6('0x1e')](_0x236ef1)[_0xe8d6('0x1f')](_0x138c1e);}};}function respondWithFilteredResult(_0x5320ad,_0x452a1e){return function(_0x22cb0f){if(_0x22cb0f){var _0x554862=typeof _0x452a1e[_0xe8d6('0x20')]===_0xe8d6('0x21')&&typeof _0x452a1e[_0xe8d6('0x22')]==='undefined';var _0x52ca84=_0x22cb0f[_0xe8d6('0x23')];var _0x266e25=_0x554862?0x0:_0x452a1e[_0xe8d6('0x20')];var _0x57db3b=_0x554862?_0x22cb0f['count']:_0x452a1e[_0xe8d6('0x20')]+_0x452a1e[_0xe8d6('0x22')];var _0x23ca14;if(_0x57db3b>=_0x52ca84){_0x57db3b=_0x52ca84;_0x23ca14=0xc8;}else{_0x23ca14=0xce;}_0x5320ad[_0xe8d6('0x1e')](_0x23ca14);return _0x5320ad['set'](_0xe8d6('0x24'),_0x266e25+'-'+_0x57db3b+'/'+_0x52ca84)[_0xe8d6('0x1f')](_0x22cb0f);}return null;};}function patchUpdates(_0x4433fd){return function(_0x17da9e){try{jsonpatch[_0xe8d6('0x25')](_0x17da9e,_0x4433fd,!![]);}catch(_0x2dad05){return BPromise[_0xe8d6('0x26')](_0x2dad05);}return _0x17da9e['save']();};}function saveUpdates(_0x2c985a,_0x3529b8){return function(_0x32ca99){if(_0x32ca99){return _0x32ca99[_0xe8d6('0x27')](_0x2c985a)[_0xe8d6('0x28')](function(_0x2fe211){return _0x2fe211;});}return null;};}function removeEntity(_0x2113e4,_0x3efcae){return function(_0x12d13b){if(_0x12d13b){return _0x12d13b[_0xe8d6('0x29')]()[_0xe8d6('0x28')](function(){var _0x10bfbd=_0x12d13b[_0xe8d6('0x2a')]({'plain':!![]});var _0x261e89=_0xe8d6('0x2b');return db[_0xe8d6('0x2c')][_0xe8d6('0x29')]({'where':{'type':_0x261e89,'resourceId':_0x10bfbd['id']}})[_0xe8d6('0x28')](function(){return _0x12d13b;});})['then'](function(){_0x2113e4[_0xe8d6('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x291625,_0x116121){return function(_0x206510){if(!_0x206510){_0x291625[_0xe8d6('0x1c')](0x194);}return _0x206510;};}function handleError(_0x2bed65,_0x1f4d65){_0x1f4d65=_0x1f4d65||0x1f4;return function(_0xe8b2de){logger['error'](_0xe8b2de[_0xe8d6('0x2d')]);if(_0xe8b2de['name']){delete _0xe8b2de['name'];}_0x2bed65[_0xe8d6('0x1e')](_0x1f4d65)[_0xe8d6('0x2e')](_0xe8b2de);};}exports[_0xe8d6('0x2f')]=function(_0x38b999,_0xe01910){var _0x14cb67={},_0x220ca0={},_0x349035={'count':0x0,'rows':[]};var _0x58ee11=_[_0xe8d6('0x30')](db[_0xe8d6('0x31')][_0xe8d6('0x32')],function(_0x23c332){return{'name':_0x23c332[_0xe8d6('0x33')],'type':_0x23c332['type'][_0xe8d6('0x34')]};});_0x220ca0[_0xe8d6('0x35')]=_['map'](_0x58ee11,_0xe8d6('0x36'));_0x220ca0[_0xe8d6('0x37')]=_[_0xe8d6('0x38')](_0x38b999[_0xe8d6('0x37')]);_0x220ca0[_0xe8d6('0x39')]=_[_0xe8d6('0x3a')](_0x220ca0[_0xe8d6('0x35')],_0x220ca0[_0xe8d6('0x37')]);_0x14cb67[_0xe8d6('0x3b')]=_[_0xe8d6('0x3a')](_0x220ca0[_0xe8d6('0x35')],qs['fields'](_0x38b999[_0xe8d6('0x37')]['fields']));_0x14cb67[_0xe8d6('0x3b')]=_0x14cb67[_0xe8d6('0x3b')][_0xe8d6('0x3c')]?_0x14cb67[_0xe8d6('0x3b')]:_0x220ca0['model'];if(!_0x38b999[_0xe8d6('0x37')]['hasOwnProperty'](_0xe8d6('0x3d'))){_0x14cb67[_0xe8d6('0x22')]=qs[_0xe8d6('0x22')](_0x38b999[_0xe8d6('0x37')][_0xe8d6('0x22')]);_0x14cb67[_0xe8d6('0x20')]=qs[_0xe8d6('0x20')](_0x38b999['query'][_0xe8d6('0x20')]);}_0x14cb67[_0xe8d6('0x3e')]=qs['sort'](_0x38b999[_0xe8d6('0x37')][_0xe8d6('0x3f')]);_0x14cb67[_0xe8d6('0x40')]=qs[_0xe8d6('0x39')](_[_0xe8d6('0x41')](_0x38b999[_0xe8d6('0x37')],_0x220ca0[_0xe8d6('0x39')]),_0x58ee11);if(_0x38b999[_0xe8d6('0x37')]['filter']){_0x14cb67[_0xe8d6('0x40')]=_['merge'](_0x14cb67[_0xe8d6('0x40')],{'$or':_[_0xe8d6('0x30')](_0x58ee11,function(_0x372108){if(_0x372108['type']!==_0xe8d6('0x42')){var _0x503781={};_0x503781[_0x372108[_0xe8d6('0x36')]]={'$like':'%'+_0x38b999['query']['filter']+'%'};return _0x503781;}})});}_0x14cb67=_[_0xe8d6('0x43')]({},_0x14cb67,_0x38b999[_0xe8d6('0x44')]);var _0x446aae={'where':_0x14cb67['where']};return db[_0xe8d6('0x31')][_0xe8d6('0x23')](_0x446aae)[_0xe8d6('0x28')](function(_0x133c3b){_0x349035[_0xe8d6('0x23')]=_0x133c3b;if(_0x38b999[_0xe8d6('0x37')]['includeAll']){_0x14cb67['include']=[{'all':!![]}];}return db[_0xe8d6('0x31')]['findAll'](_0x14cb67);})[_0xe8d6('0x28')](function(_0x15be52){_0x349035[_0xe8d6('0x45')]=_0x15be52;return _0x349035;})['then'](respondWithFilteredResult(_0xe01910,_0x14cb67))[_0xe8d6('0x46')](handleError(_0xe01910,null));};exports[_0xe8d6('0x47')]=function(_0x143852,_0x320332){var _0x136b69={'raw':!![],'where':{'id':_0x143852[_0xe8d6('0x48')]['id']}},_0x7bd96={};_0x7bd96[_0xe8d6('0x35')]=_[_0xe8d6('0x38')](db[_0xe8d6('0x31')][_0xe8d6('0x32')]);_0x7bd96[_0xe8d6('0x37')]=_[_0xe8d6('0x38')](_0x143852[_0xe8d6('0x37')]);_0x7bd96[_0xe8d6('0x39')]=_[_0xe8d6('0x3a')](_0x7bd96['model'],_0x7bd96[_0xe8d6('0x37')]);_0x136b69[_0xe8d6('0x3b')]=_[_0xe8d6('0x3a')](_0x7bd96[_0xe8d6('0x35')],qs[_0xe8d6('0x49')](_0x143852[_0xe8d6('0x37')][_0xe8d6('0x49')]));_0x136b69['attributes']=_0x136b69[_0xe8d6('0x3b')]['length']?_0x136b69[_0xe8d6('0x3b')]:_0x7bd96['model'];if(_0x143852['query'][_0xe8d6('0x4a')]){_0x136b69['include']=[{'all':!![]}];}_0x136b69=_['merge']({},_0x136b69,_0x143852['options']);return db['OpenchannelQueue'][_0xe8d6('0x4b')](_0x136b69)[_0xe8d6('0x28')](handleEntityNotFound(_0x320332,null))[_0xe8d6('0x28')](respondWithResult(_0x320332,null))[_0xe8d6('0x46')](handleError(_0x320332,null));};exports[_0xe8d6('0x4c')]=function(_0x58e79d,_0x536052){return db[_0xe8d6('0x31')][_0xe8d6('0x4c')](_0x58e79d[_0xe8d6('0x4d')],{})[_0xe8d6('0x28')](function(_0x484fa6){var _0x49a693=_0x58e79d['user']['get']({'plain':!![]});if(!_0x49a693)throw new Error(_0xe8d6('0x4e'));if(_0x49a693['role']===_0xe8d6('0x4f')){var _0x6c0727=_0x484fa6[_0xe8d6('0x2a')]({'plain':!![]});var _0x2f4dea='OpenchannelQueues';return db['UserProfileSection'][_0xe8d6('0x4b')]({'where':{'name':_0x2f4dea,'userProfileId':_0x49a693['userProfileId']},'raw':!![]})[_0xe8d6('0x28')](function(_0x23c4df){if(_0x23c4df&&_0x23c4df[_0xe8d6('0x50')]===0x0){return db[_0xe8d6('0x2c')][_0xe8d6('0x4c')]({'name':_0x6c0727[_0xe8d6('0x36')],'resourceId':_0x6c0727['id'],'type':_0x23c4df[_0xe8d6('0x36')],'sectionId':_0x23c4df['id']},{})[_0xe8d6('0x28')](function(){return _0x484fa6;});}else{return _0x484fa6;}})[_0xe8d6('0x46')](function(_0x44c6d1){logger['error'](_0xe8d6('0x51'),_0x44c6d1);throw _0x44c6d1;});}return _0x484fa6;})['then'](respondWithResult(_0x536052,0xc9))['catch'](handleError(_0x536052,null));};exports[_0xe8d6('0x27')]=function(_0x9dd225,_0x2ab9b8){if(_0x9dd225['body']['id']){delete _0x9dd225[_0xe8d6('0x4d')]['id'];}return db[_0xe8d6('0x31')][_0xe8d6('0x4b')]({'where':{'id':_0x9dd225[_0xe8d6('0x48')]['id']}})[_0xe8d6('0x28')](handleEntityNotFound(_0x2ab9b8,null))[_0xe8d6('0x28')](saveUpdates(_0x9dd225['body'],null))['then'](respondWithResult(_0x2ab9b8,null))[_0xe8d6('0x46')](handleError(_0x2ab9b8,null));};exports[_0xe8d6('0x29')]=function(_0x1afc6d,_0x3e5df0){return db['OpenchannelQueue'][_0xe8d6('0x4b')]({'where':{'id':_0x1afc6d[_0xe8d6('0x48')]['id']}})[_0xe8d6('0x28')](handleEntityNotFound(_0x3e5df0,null))[_0xe8d6('0x28')](removeEntity(_0x3e5df0,null))[_0xe8d6('0x46')](handleError(_0x3e5df0,null));};exports[_0xe8d6('0x52')]=function(_0x1f8d97,_0xe1670e){return db[_0xe8d6('0x31')]['describe']()['then'](respondWithResult(_0xe1670e,null))[_0xe8d6('0x46')](handleError(_0xe1670e,null));};exports[_0xe8d6('0x53')]=function(_0xb5583e,_0x36498f,_0x3209f5){var _0x152749={'raw':!![],'where':{}},_0x11a340={},_0x5ddf29;return db[_0xe8d6('0x31')][_0xe8d6('0x54')]({'where':{'id':_0xb5583e[_0xe8d6('0x48')]['id']}})[_0xe8d6('0x28')](handleEntityNotFound(_0x36498f,null))[_0xe8d6('0x28')](function(_0x3386d5){if(_0x3386d5){_0x5ddf29=_0x3386d5['get']({'plain':!![]});_0x11a340[_0xe8d6('0x35')]=_[_0xe8d6('0x38')](db[_0xe8d6('0x55')][_0xe8d6('0x32')]);_0x11a340['query']=_[_0xe8d6('0x38')](_0xb5583e[_0xe8d6('0x37')]);_0x11a340[_0xe8d6('0x39')]=_[_0xe8d6('0x3a')](_0x11a340['model'],_0x11a340[_0xe8d6('0x37')]);_0x152749['attributes']=_['intersection'](_0x11a340['model'],qs[_0xe8d6('0x49')](_0xb5583e[_0xe8d6('0x37')][_0xe8d6('0x49')]));_0x152749['attributes']=_0x152749[_0xe8d6('0x3b')][_0xe8d6('0x3c')]?_0x152749[_0xe8d6('0x3b')]:_0x11a340['model'];if(!_0xb5583e[_0xe8d6('0x37')][_0xe8d6('0x56')](_0xe8d6('0x3d'))){_0x152749[_0xe8d6('0x22')]=qs[_0xe8d6('0x22')](_0xb5583e['query']['limit']);_0x152749[_0xe8d6('0x20')]=qs[_0xe8d6('0x20')](_0xb5583e[_0xe8d6('0x37')]['offset']);}_0x152749['order']=qs['sort'](_0xb5583e['query'][_0xe8d6('0x3f')]);_0x152749['where']=qs[_0xe8d6('0x39')](_['pick'](_0xb5583e['query'],_0x11a340['filters']));_0x152749[_0xe8d6('0x40')]['OpenchannelQueueId']=_0x3386d5['id'];if(_0xb5583e['query'][_0xe8d6('0x57')]){_0x152749['where']=_[_0xe8d6('0x43')](_0x152749[_0xe8d6('0x40')],{'$or':_['map'](_0x152749[_0xe8d6('0x3b')],function(_0x1f4aac){var _0x471792={};_0x471792[_0x1f4aac]={'$like':'%'+_0xb5583e[_0xe8d6('0x37')][_0xe8d6('0x57')]+'%'};return _0x471792;})});}_0x152749=_[_0xe8d6('0x43')]({},_0x152749,_0xb5583e[_0xe8d6('0x44')]);return db[_0xe8d6('0x55')][_0xe8d6('0x58')](_0x152749);}})['then'](function(_0x54babe){if(_0x54babe){return db[_0xe8d6('0x59')][_0xe8d6('0x5a')]({'where':{'id':_[_0xe8d6('0x30')](_0x54babe,_0xe8d6('0x5b')),'role':'agent'},'attributes':['id',_0xe8d6('0x36'),'openchannelPause','updatedAt','createdAt']});}})['then'](function(_0x1438c1){if(_0x1438c1){return{'count':_0x1438c1[_0xe8d6('0x23')],'rows':_[_0xe8d6('0x30')](_0x1438c1[_0xe8d6('0x45')],function(_0x964f30){return{'membername':_0x964f30[_0xe8d6('0x36')],'UserId':_0x964f30['id'],'queue_name':_0x5ddf29[_0xe8d6('0x36')],'OpenchannelQueueId':_0x5ddf29['id'],'interface':util[_0xe8d6('0x5c')]('%s/%s','SIP',_0x964f30['name']),'penalty':0x0,'paused':_0x964f30[_0xe8d6('0x5d')],'createdAt':_0x964f30[_0xe8d6('0x5e')],'updatedAt':_0x964f30[_0xe8d6('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe8d6('0x28')](respondWithFilteredResult(_0x36498f,_0x152749))[_0xe8d6('0x46')](handleError(_0x36498f,null));};exports[_0xe8d6('0x60')]=function(_0x339afd,_0x34cd0b,_0x26cc5b){var _0x3bcac2={};var _0x1fab7a={};var _0x1213a9;var _0x4c5896;return db[_0xe8d6('0x31')]['findOne']({'where':{'id':_0x339afd[_0xe8d6('0x48')]['id']}})[_0xe8d6('0x28')](handleEntityNotFound(_0x34cd0b,null))[_0xe8d6('0x28')](function(_0x30fe57){if(_0x30fe57){_0x1213a9=_0x30fe57;_0x1fab7a[_0xe8d6('0x35')]=_[_0xe8d6('0x38')](db[_0xe8d6('0x61')]['rawAttributes']);_0x1fab7a[_0xe8d6('0x37')]=_[_0xe8d6('0x38')](_0x339afd['query']);_0x1fab7a[_0xe8d6('0x39')]=_[_0xe8d6('0x3a')](_0x1fab7a[_0xe8d6('0x35')],_0x1fab7a['query']);_0x3bcac2[_0xe8d6('0x3b')]=_['intersection'](_0x1fab7a[_0xe8d6('0x35')],qs['fields'](_0x339afd[_0xe8d6('0x37')]['fields']));_0x3bcac2[_0xe8d6('0x3b')]=_0x3bcac2[_0xe8d6('0x3b')][_0xe8d6('0x3c')]?_0x3bcac2[_0xe8d6('0x3b')]:_0x1fab7a[_0xe8d6('0x35')];_0x3bcac2[_0xe8d6('0x3e')]=qs[_0xe8d6('0x3f')](_0x339afd[_0xe8d6('0x37')][_0xe8d6('0x3f')]);_0x3bcac2[_0xe8d6('0x40')]=qs[_0xe8d6('0x39')](_['pick'](_0x339afd[_0xe8d6('0x37')],_0x1fab7a[_0xe8d6('0x39')]));if(_0x339afd['query'][_0xe8d6('0x57')]){_0x3bcac2[_0xe8d6('0x40')]=_[_0xe8d6('0x43')](_0x3bcac2[_0xe8d6('0x40')],{'$or':_[_0xe8d6('0x30')](_0x3bcac2[_0xe8d6('0x3b')],function(_0x46039e){var _0x3f0cee={};_0x3f0cee[_0x46039e]={'$like':'%'+_0x339afd['query']['filter']+'%'};return _0x3f0cee;})});}_0x3bcac2=_[_0xe8d6('0x43')]({},_0x3bcac2,_0x339afd[_0xe8d6('0x44')]);return _0x1213a9[_0xe8d6('0x60')](_0x3bcac2);}})['then'](function(_0x2a86ed){if(_0x2a86ed){_0x4c5896=_0x2a86ed[_0xe8d6('0x3c')];if(!_0x339afd[_0xe8d6('0x37')][_0xe8d6('0x56')](_0xe8d6('0x3d'))){_0x3bcac2[_0xe8d6('0x22')]=qs[_0xe8d6('0x22')](_0x339afd[_0xe8d6('0x37')][_0xe8d6('0x22')]);_0x3bcac2[_0xe8d6('0x20')]=qs['offset'](_0x339afd['query'][_0xe8d6('0x20')]);}return _0x1213a9[_0xe8d6('0x60')](_0x3bcac2);}})[_0xe8d6('0x28')](function(_0x2cdf41){if(_0x2cdf41){return _0x2cdf41?{'count':_0x4c5896,'rows':_0x2cdf41}:null;}})[_0xe8d6('0x28')](respondWithResult(_0x34cd0b,null))[_0xe8d6('0x46')](handleError(_0x34cd0b,null));};exports[_0xe8d6('0x62')]=function(_0x2ca038,_0x3b481a,_0x4a9be0){var _0x160884=_0x2ca038[_0xe8d6('0x4d')][_0xe8d6('0x63')];return db[_0xe8d6('0x61')]['findAll']({'where':{'id':_0x160884},'attributes':['id'],'include':[{'model':db[_0xe8d6('0x59')],'as':_0xe8d6('0x64'),'attributes':['id',_0xe8d6('0x36'),_0xe8d6('0x65'),'voicePause','interface'],'raw':!![]}]})[_0xe8d6('0x28')](function(_0x27b406){if(_0x27b406){var _0xcbb0bc=_[_0xe8d6('0x66')](_0x27b406,function(_0x1b363f){var _0x28dbbd=_0x1b363f[_0xe8d6('0x2a')]({'plain':!![]});return _0x28dbbd[_0xe8d6('0x64')];});return db[_0xe8d6('0x31')][_0xe8d6('0x4b')]({'where':{'id':_0x2ca038[_0xe8d6('0x48')]['id']}})[_0xe8d6('0x28')](function(_0x13b976){return db['sequelize'][_0xe8d6('0x67')](function(_0x25a02e){return _0x13b976[_0xe8d6('0x62')](_0x160884,{'transaction':_0x25a02e})['then'](function(){return BPromise[_0xe8d6('0x68')](_0xcbb0bc,function(_0x3d3a9e){return db[_0xe8d6('0x55')][_0xe8d6('0x69')]({'where':{'UserId':_0x3d3a9e['id'],'OpenchannelQueueId':_0x2ca038['params']['id']},'transaction':_0x25a02e});});})['then'](function(){_0xcbb0bc[_0xe8d6('0x6a')](function(_0x160f77){socket['emit'](_0xe8d6('0x6b'),{'UserId':_0x160f77['id'],'OpenchannelQueueId':_0x13b976['id']});});});});});}})[_0xe8d6('0x28')](respondWithStatusCode(_0x3b481a,null))['catch'](handleError(_0x3b481a,null));};exports[_0xe8d6('0x6c')]=function(_0x48b0ea,_0x5db07d,_0x449241){return db['Team'][_0xe8d6('0x58')]({'where':{'id':_0x48b0ea['query'][_0xe8d6('0x63')]},'attributes':['id'],'include':[{'model':db[_0xe8d6('0x59')],'as':_0xe8d6('0x64'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5db07d,null))['then'](function(_0x13717c){var _0x52d770=_[_0xe8d6('0x30')](_0x13717c,'id');var _0x476236=[];var _0x4968af=[];var _0x38332a=squel['select']();_0x38332a[_0xe8d6('0x6d')](_0xe8d6('0x6e'))['from'](_0xe8d6('0x6f'),'tq')[_0xe8d6('0x70')]('user_has_teams','ut',_0xe8d6('0x71'))[_0xe8d6('0x40')]('OpenchannelQueueId\x20=\x20?',_0x48b0ea[_0xe8d6('0x48')]['id']);for(var _0x9da6ca=0x0;_0x9da6ca<_0x13717c['length'];_0x9da6ca+=0x1){let _0x24fcda=_0x13717c[_0x9da6ca];for(var _0x4aac9d=0x0;_0x4aac9d<_0x24fcda[_0xe8d6('0x64')][_0xe8d6('0x3c')];_0x4aac9d+=0x1){let _0x51771e=_0x24fcda['Agents'][_0x4aac9d];var _0x2e0f25=_0x38332a['clone']();_0x2e0f25[_0xe8d6('0x40')](_0xe8d6('0x72'),_0x51771e['id']);_0x4968af[_0xe8d6('0x73')](db[_0xe8d6('0x74')][_0xe8d6('0x37')](_0x2e0f25[_0xe8d6('0x75')](),{'type':db[_0xe8d6('0x74')][_0xe8d6('0x76')][_0xe8d6('0x77')]})[_0xe8d6('0x28')](function(_0x55e517){if(_0x55e517[_0xe8d6('0x3c')]===0x1){return _0x51771e['id'];}else{var _0x368579=_[_0xe8d6('0x78')](_[_0xe8d6('0x30')](_0x55e517,_0xe8d6('0x79')),function(_0x5776bf){return _[_0xe8d6('0x7a')](_0x52d770,_0x5776bf);});if(_0x368579){return _0x51771e['id'];}}}));}}return BPromise[_0xe8d6('0x7b')](_0x4968af)[_0xe8d6('0x28')](function(_0x2e9a1c){_0x476236=_(_0x476236)[_0xe8d6('0x7c')](_0x2e9a1c)[_0xe8d6('0x7d')]()[_0xe8d6('0x7e')]();return db[_0xe8d6('0x31')][_0xe8d6('0x4b')]({'where':{'id':_0x48b0ea[_0xe8d6('0x48')]['id']}})[_0xe8d6('0x28')](function(_0x31e5a2){return db[_0xe8d6('0x74')][_0xe8d6('0x67')](function(_0x518017){return _0x31e5a2[_0xe8d6('0x6c')](_0x48b0ea['query']['ids'],{'transaction':_0x518017})[_0xe8d6('0x28')](function(){if(!_['isEmpty'](_0x476236)){return _0x31e5a2[_0xe8d6('0x7f')](_0x476236,{'transaction':_0x518017});}})[_0xe8d6('0x28')](function(){_0x476236[_0xe8d6('0x6a')](function(_0x314992){socket[_0xe8d6('0x80')](_0xe8d6('0x81'),{'UserId':_0x314992,'OpenchannelQueueId':_0x31e5a2['id']});});});});});});})[_0xe8d6('0x28')](respondWithStatusCode(_0x5db07d,null))[_0xe8d6('0x46')](handleError(_0x5db07d,null));};exports[_0xe8d6('0x82')]=function(_0x1300ef,_0x58a989,_0x43adb7){return db[_0xe8d6('0x31')][_0xe8d6('0x4b')]({'where':{'id':_0x1300ef['params']['id']}})['then'](handleEntityNotFound(_0x58a989,null))[_0xe8d6('0x28')](function(_0x5ef91f){if(_0x5ef91f){return _0x5ef91f[_0xe8d6('0x82')](_0x1300ef[_0xe8d6('0x4d')]['ids'],_[_0xe8d6('0x83')](_0x1300ef[_0xe8d6('0x4d')],['ids','id'])||{})[_0xe8d6('0x84')](function(_0x24e50d){for(var _0x1062fa=0x0;_0x1062fa<_0x1300ef[_0xe8d6('0x4d')]['ids']['length'];_0x1062fa+=0x1){socket[_0xe8d6('0x80')](_0xe8d6('0x6b'),{'UserId':Number(_0x1300ef[_0xe8d6('0x4d')][_0xe8d6('0x63')][_0x1062fa]),'OpenchannelQueueId':Number(_0x1300ef[_0xe8d6('0x48')]['id'])});}return _0x24e50d;});}})[_0xe8d6('0x28')](respondWithResult(_0x58a989,null))[_0xe8d6('0x46')](handleError(_0x58a989,null));};exports[_0xe8d6('0x7f')]=function(_0x3de050,_0x40e653,_0x27136a){return db[_0xe8d6('0x31')]['find']({'where':{'id':_0x3de050[_0xe8d6('0x48')]['id']}})['then'](handleEntityNotFound(_0x40e653,null))[_0xe8d6('0x28')](function(_0x2d6e50){if(_0x2d6e50){return _0x2d6e50[_0xe8d6('0x7f')](_0x3de050['query'][_0xe8d6('0x63')])[_0xe8d6('0x28')](function(){if(_[_0xe8d6('0x85')](_0x3de050[_0xe8d6('0x37')][_0xe8d6('0x63')])){for(var _0x20eed2=0x0;_0x20eed2<_0x3de050['query'][_0xe8d6('0x63')][_0xe8d6('0x3c')];_0x20eed2+=0x1){socket[_0xe8d6('0x80')](_0xe8d6('0x81'),{'UserId':Number(_0x3de050[_0xe8d6('0x37')][_0xe8d6('0x63')][_0x20eed2]),'OpenchannelQueueId':Number(_0x3de050[_0xe8d6('0x48')]['id'])});}}else{socket['emit'](_0xe8d6('0x81'),{'UserId':Number(_0x3de050[_0xe8d6('0x37')][_0xe8d6('0x63')]),'OpenchannelQueueId':Number(_0x3de050['params']['id'])});}});}})['then'](respondWithStatusCode(_0x40e653,null))['catch'](handleError(_0x40e653,null));};exports[_0xe8d6('0x86')]=function(_0x504205,_0x4ceb5e,_0x5c0de9){var _0x4721cb={};var _0x741778={};var _0x12bd41;var _0x2cc8d6;return db[_0xe8d6('0x31')][_0xe8d6('0x54')]({'where':{'id':_0x504205[_0xe8d6('0x48')]['id']}})[_0xe8d6('0x28')](handleEntityNotFound(_0x4ceb5e,null))[_0xe8d6('0x28')](function(_0x294da7){if(_0x294da7){_0x12bd41=_0x294da7;_0x741778[_0xe8d6('0x35')]=_[_0xe8d6('0x38')](db[_0xe8d6('0x59')][_0xe8d6('0x32')]);_0x741778[_0xe8d6('0x37')]=_[_0xe8d6('0x38')](_0x504205[_0xe8d6('0x37')]);_0x741778[_0xe8d6('0x39')]=_[_0xe8d6('0x3a')](_0x741778[_0xe8d6('0x35')],_0x741778[_0xe8d6('0x37')]);_0x4721cb[_0xe8d6('0x3b')]=_[_0xe8d6('0x3a')](_0x741778['model'],qs[_0xe8d6('0x49')](_0x504205[_0xe8d6('0x37')][_0xe8d6('0x49')]));_0x4721cb[_0xe8d6('0x3b')]=_0x4721cb[_0xe8d6('0x3b')][_0xe8d6('0x3c')]?_0x4721cb[_0xe8d6('0x3b')]:_0x741778[_0xe8d6('0x35')];_0x4721cb[_0xe8d6('0x3e')]=qs[_0xe8d6('0x3f')](_0x504205[_0xe8d6('0x37')][_0xe8d6('0x3f')]);_0x4721cb[_0xe8d6('0x40')]=qs[_0xe8d6('0x39')](_[_0xe8d6('0x41')](_0x504205[_0xe8d6('0x37')],_0x741778['filters']));if(_0x504205['query']['filter']){_0x4721cb[_0xe8d6('0x40')]=_[_0xe8d6('0x43')](_0x4721cb[_0xe8d6('0x40')],{'$or':_[_0xe8d6('0x30')](_0x4721cb[_0xe8d6('0x3b')],function(_0xe13fba){var _0xf104e8={};_0xf104e8[_0xe13fba]={'$like':'%'+_0x504205[_0xe8d6('0x37')][_0xe8d6('0x57')]+'%'};return _0xf104e8;})});}_0x4721cb=_[_0xe8d6('0x43')]({},_0x4721cb,_0x504205['options']);return _0x12bd41[_0xe8d6('0x86')](_0x4721cb);}})[_0xe8d6('0x28')](function(_0x56baca){if(_0x56baca){_0x2cc8d6=_0x56baca[_0xe8d6('0x3c')];if(!_0x504205[_0xe8d6('0x37')][_0xe8d6('0x56')](_0xe8d6('0x3d'))){_0x4721cb['limit']=qs[_0xe8d6('0x22')](_0x504205[_0xe8d6('0x37')][_0xe8d6('0x22')]);_0x4721cb['offset']=qs[_0xe8d6('0x20')](_0x504205[_0xe8d6('0x37')][_0xe8d6('0x20')]);}return _0x12bd41[_0xe8d6('0x86')](_0x4721cb);}})['then'](function(_0x4c687e){if(_0x4c687e){return _0x4c687e?{'count':_0x2cc8d6,'rows':_0x4c687e}:null;}})[_0xe8d6('0x28')](respondWithResult(_0x4ceb5e,null))[_0xe8d6('0x46')](handleError(_0x4ceb5e,null));};
\ No newline at end of file
+var _0xa825=['to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','save','update','then','destroy','get','OpenchannelQueues','UserProfileResource','error','name','index','map','OpenchannelQueue','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','length','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','describe','getMembers','findOne','UserOpenchannelQueue','findAndCountAll','UserId','openchannelPause','updatedAt','createdAt','format','getTeams','Team','addTeams','User','online','voicePause','flatMap','Agents','transaction','each','forEach','emit','userOpenchannelQueue:save','ids','select','field','join','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','nolimit','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa825,0x83));var _0x5a82=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa825[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5a82('0x0'));var zipdir=require(_0x5a82('0x1'));var jsonpatch=require(_0x5a82('0x2'));var rp=require(_0x5a82('0x3'));var moment=require(_0x5a82('0x4'));var BPromise=require(_0x5a82('0x5'));var Mustache=require(_0x5a82('0x6'));var util=require(_0x5a82('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x5a82('0x8'));var ejs=require(_0x5a82('0x9'));var fs=require('fs');var fs_extra=require(_0x5a82('0xa'));var _=require(_0x5a82('0xb'));var squel=require('squel');var crypto=require(_0x5a82('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5a82('0xd'));var toCsv=require(_0x5a82('0x8'));var querystring=require(_0x5a82('0xe'));var Papa=require('papaparse');var Redis=require(_0x5a82('0xf'));var authService=require(_0x5a82('0x10'));var qs=require(_0x5a82('0x11'));var as=require(_0x5a82('0x12'));var hardwareService=require(_0x5a82('0x13'));var logger=require(_0x5a82('0x14'))(_0x5a82('0x15'));var utils=require(_0x5a82('0x16'));var config=require(_0x5a82('0x17'));var licenseUtil=require(_0x5a82('0x18'));var db=require(_0x5a82('0x19'))['db'];config[_0x5a82('0x1a')]=_[_0x5a82('0x1b')](config[_0x5a82('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x5a82('0x1c'))(new Redis(config[_0x5a82('0x1a')]));require('./openchannelQueue.socket')[_0x5a82('0x1d')](socket);function respondWithStatusCode(_0x42d1b3,_0x49bcdc){_0x49bcdc=_0x49bcdc||0xcc;return function(_0x5a949d){if(_0x5a949d){return _0x42d1b3[_0x5a82('0x1e')](_0x49bcdc);}return _0x42d1b3['status'](_0x49bcdc)[_0x5a82('0x1f')]();};}function respondWithResult(_0x487f3f,_0x6782e6){_0x6782e6=_0x6782e6||0xc8;return function(_0x527c91){if(_0x527c91){return _0x487f3f['status'](_0x6782e6)[_0x5a82('0x20')](_0x527c91);}};}function respondWithFilteredResult(_0x1f2fd2,_0x382d3e){return function(_0x3322ff){if(_0x3322ff){var _0x594f04=typeof _0x382d3e[_0x5a82('0x21')]===_0x5a82('0x22')&&typeof _0x382d3e[_0x5a82('0x23')]===_0x5a82('0x22');var _0x9f0bb2=_0x3322ff[_0x5a82('0x24')];var _0x34ff6f=_0x594f04?0x0:_0x382d3e[_0x5a82('0x21')];var _0xa85de4=_0x594f04?_0x3322ff['count']:_0x382d3e[_0x5a82('0x21')]+_0x382d3e[_0x5a82('0x23')];var _0x178475;if(_0xa85de4>=_0x9f0bb2){_0xa85de4=_0x9f0bb2;_0x178475=0xc8;}else{_0x178475=0xce;}_0x1f2fd2[_0x5a82('0x25')](_0x178475);return _0x1f2fd2['set'](_0x5a82('0x26'),_0x34ff6f+'-'+_0xa85de4+'/'+_0x9f0bb2)['json'](_0x3322ff);}return null;};}function patchUpdates(_0x52085f){return function(_0x3b107b){try{jsonpatch[_0x5a82('0x27')](_0x3b107b,_0x52085f,!![]);}catch(_0x3142f3){return BPromise['reject'](_0x3142f3);}return _0x3b107b[_0x5a82('0x28')]();};}function saveUpdates(_0xba6ccb,_0x3bc911){return function(_0x93f44b){if(_0x93f44b){return _0x93f44b[_0x5a82('0x29')](_0xba6ccb)[_0x5a82('0x2a')](function(_0x13f9fc){return _0x13f9fc;});}return null;};}function removeEntity(_0x51d298,_0x472be6){return function(_0x52d107){if(_0x52d107){return _0x52d107[_0x5a82('0x2b')]()[_0x5a82('0x2a')](function(){var _0x44f499=_0x52d107[_0x5a82('0x2c')]({'plain':!![]});var _0x2fc294=_0x5a82('0x2d');return db[_0x5a82('0x2e')][_0x5a82('0x2b')]({'where':{'type':_0x2fc294,'resourceId':_0x44f499['id']}})[_0x5a82('0x2a')](function(){return _0x52d107;});})[_0x5a82('0x2a')](function(){_0x51d298['status'](0xcc)[_0x5a82('0x1f')]();});}};}function handleEntityNotFound(_0x1000cf,_0x4a47b1){return function(_0x1ea1f4){if(!_0x1ea1f4){_0x1000cf[_0x5a82('0x1e')](0x194);}return _0x1ea1f4;};}function handleError(_0x3fc7e7,_0x42781d){_0x42781d=_0x42781d||0x1f4;return function(_0xe4c65b){logger[_0x5a82('0x2f')](_0xe4c65b['stack']);if(_0xe4c65b[_0x5a82('0x30')]){delete _0xe4c65b[_0x5a82('0x30')];}_0x3fc7e7[_0x5a82('0x25')](_0x42781d)['send'](_0xe4c65b);};}exports[_0x5a82('0x31')]=function(_0x294b12,_0x11a1be){var _0x425f3b={},_0x4358ee={},_0x15496c={'count':0x0,'rows':[]};var _0x82f1cf=_[_0x5a82('0x32')](db[_0x5a82('0x33')][_0x5a82('0x34')],function(_0x274f88){return{'name':_0x274f88[_0x5a82('0x35')],'type':_0x274f88[_0x5a82('0x36')]['key']};});_0x4358ee[_0x5a82('0x37')]=_['map'](_0x82f1cf,_0x5a82('0x30'));_0x4358ee[_0x5a82('0x38')]=_[_0x5a82('0x39')](_0x294b12[_0x5a82('0x38')]);_0x4358ee['filters']=_[_0x5a82('0x3a')](_0x4358ee[_0x5a82('0x37')],_0x4358ee['query']);_0x425f3b[_0x5a82('0x3b')]=_[_0x5a82('0x3a')](_0x4358ee['model'],qs[_0x5a82('0x3c')](_0x294b12[_0x5a82('0x38')][_0x5a82('0x3c')]));_0x425f3b[_0x5a82('0x3b')]=_0x425f3b[_0x5a82('0x3b')]['length']?_0x425f3b[_0x5a82('0x3b')]:_0x4358ee[_0x5a82('0x37')];if(!_0x294b12[_0x5a82('0x38')][_0x5a82('0x3d')]('nolimit')){_0x425f3b[_0x5a82('0x23')]=qs[_0x5a82('0x23')](_0x294b12[_0x5a82('0x38')][_0x5a82('0x23')]);_0x425f3b[_0x5a82('0x21')]=qs[_0x5a82('0x21')](_0x294b12[_0x5a82('0x38')][_0x5a82('0x21')]);}_0x425f3b[_0x5a82('0x3e')]=qs[_0x5a82('0x3f')](_0x294b12['query'][_0x5a82('0x3f')]);_0x425f3b[_0x5a82('0x40')]=qs[_0x5a82('0x41')](_[_0x5a82('0x42')](_0x294b12[_0x5a82('0x38')],_0x4358ee[_0x5a82('0x41')]),_0x82f1cf);if(_0x294b12[_0x5a82('0x38')][_0x5a82('0x43')]){_0x425f3b['where']=_[_0x5a82('0x44')](_0x425f3b[_0x5a82('0x40')],{'$or':_[_0x5a82('0x32')](_0x82f1cf,function(_0x274cc3){if(_0x274cc3[_0x5a82('0x36')]!==_0x5a82('0x45')){var _0x3bd793={};_0x3bd793[_0x274cc3['name']]={'$like':'%'+_0x294b12['query'][_0x5a82('0x43')]+'%'};return _0x3bd793;}})});}_0x425f3b=_[_0x5a82('0x44')]({},_0x425f3b,_0x294b12['options']);var _0x1337a9={'where':_0x425f3b[_0x5a82('0x40')]};return db['OpenchannelQueue'][_0x5a82('0x24')](_0x1337a9)['then'](function(_0x3f29fb){_0x15496c[_0x5a82('0x24')]=_0x3f29fb;if(_0x294b12[_0x5a82('0x38')][_0x5a82('0x46')]){_0x425f3b[_0x5a82('0x47')]=[{'all':!![]}];}return db[_0x5a82('0x33')][_0x5a82('0x48')](_0x425f3b);})[_0x5a82('0x2a')](function(_0x2f0b54){_0x15496c[_0x5a82('0x49')]=_0x2f0b54;return _0x15496c;})[_0x5a82('0x2a')](respondWithFilteredResult(_0x11a1be,_0x425f3b))['catch'](handleError(_0x11a1be,null));};exports[_0x5a82('0x4a')]=function(_0x480fc5,_0x5d3756){var _0x2af955={'raw':!![],'where':{'id':_0x480fc5[_0x5a82('0x4b')]['id']}},_0x529eec={};_0x529eec[_0x5a82('0x37')]=_['keys'](db[_0x5a82('0x33')]['rawAttributes']);_0x529eec[_0x5a82('0x38')]=_[_0x5a82('0x39')](_0x480fc5['query']);_0x529eec[_0x5a82('0x41')]=_[_0x5a82('0x3a')](_0x529eec[_0x5a82('0x37')],_0x529eec[_0x5a82('0x38')]);_0x2af955[_0x5a82('0x3b')]=_[_0x5a82('0x3a')](_0x529eec[_0x5a82('0x37')],qs[_0x5a82('0x3c')](_0x480fc5[_0x5a82('0x38')][_0x5a82('0x3c')]));_0x2af955[_0x5a82('0x3b')]=_0x2af955['attributes'][_0x5a82('0x4c')]?_0x2af955[_0x5a82('0x3b')]:_0x529eec[_0x5a82('0x37')];if(_0x480fc5[_0x5a82('0x38')][_0x5a82('0x46')]){_0x2af955['include']=[{'all':!![]}];}_0x2af955=_[_0x5a82('0x44')]({},_0x2af955,_0x480fc5[_0x5a82('0x4d')]);return db['OpenchannelQueue']['find'](_0x2af955)['then'](handleEntityNotFound(_0x5d3756,null))[_0x5a82('0x2a')](respondWithResult(_0x5d3756,null))[_0x5a82('0x4e')](handleError(_0x5d3756,null));};exports[_0x5a82('0x4f')]=function(_0x4fd66a,_0x2fabf8){return db[_0x5a82('0x33')][_0x5a82('0x4f')](_0x4fd66a[_0x5a82('0x50')],{})['then'](function(_0x22a780){var _0x594e0f=_0x4fd66a[_0x5a82('0x51')]['get']({'plain':!![]});if(!_0x594e0f)throw new Error(_0x5a82('0x52'));if(_0x594e0f['role']===_0x5a82('0x51')){var _0x409455=_0x22a780['get']({'plain':!![]});var _0x53f379=_0x5a82('0x2d');return db[_0x5a82('0x53')][_0x5a82('0x54')]({'where':{'name':_0x53f379,'userProfileId':_0x594e0f[_0x5a82('0x55')]},'raw':!![]})[_0x5a82('0x2a')](function(_0x2f4e69){if(_0x2f4e69&&_0x2f4e69[_0x5a82('0x56')]===0x0){return db[_0x5a82('0x2e')][_0x5a82('0x4f')]({'name':_0x409455[_0x5a82('0x30')],'resourceId':_0x409455['id'],'type':_0x2f4e69['name'],'sectionId':_0x2f4e69['id']},{})[_0x5a82('0x2a')](function(){return _0x22a780;});}else{return _0x22a780;}})['catch'](function(_0x1e446b){logger[_0x5a82('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1e446b);throw _0x1e446b;});}return _0x22a780;})[_0x5a82('0x2a')](respondWithResult(_0x2fabf8,0xc9))[_0x5a82('0x4e')](handleError(_0x2fabf8,null));};exports[_0x5a82('0x29')]=function(_0x3f5ff5,_0x5895a9){if(_0x3f5ff5[_0x5a82('0x50')]['id']){delete _0x3f5ff5[_0x5a82('0x50')]['id'];}return db[_0x5a82('0x33')]['find']({'where':{'id':_0x3f5ff5[_0x5a82('0x4b')]['id']}})[_0x5a82('0x2a')](handleEntityNotFound(_0x5895a9,null))['then'](saveUpdates(_0x3f5ff5[_0x5a82('0x50')],null))[_0x5a82('0x2a')](respondWithResult(_0x5895a9,null))[_0x5a82('0x4e')](handleError(_0x5895a9,null));};exports['destroy']=function(_0x5a8ddc,_0x38aad3){return db['OpenchannelQueue'][_0x5a82('0x54')]({'where':{'id':_0x5a8ddc[_0x5a82('0x4b')]['id']}})[_0x5a82('0x2a')](handleEntityNotFound(_0x38aad3,null))[_0x5a82('0x2a')](removeEntity(_0x38aad3,null))[_0x5a82('0x4e')](handleError(_0x38aad3,null));};exports[_0x5a82('0x57')]=function(_0x20714f,_0x1d0398){return db['OpenchannelQueue'][_0x5a82('0x57')]()['then'](respondWithResult(_0x1d0398,null))[_0x5a82('0x4e')](handleError(_0x1d0398,null));};exports[_0x5a82('0x58')]=function(_0x55a9d6,_0x4cbd02,_0x1a8a08){var _0x5250d1={'raw':!![],'where':{}},_0x23033e={},_0x356847;return db[_0x5a82('0x33')][_0x5a82('0x59')]({'where':{'id':_0x55a9d6[_0x5a82('0x4b')]['id']}})[_0x5a82('0x2a')](handleEntityNotFound(_0x4cbd02,null))[_0x5a82('0x2a')](function(_0x64d889){if(_0x64d889){_0x356847=_0x64d889[_0x5a82('0x2c')]({'plain':!![]});_0x23033e[_0x5a82('0x37')]=_[_0x5a82('0x39')](db[_0x5a82('0x5a')][_0x5a82('0x34')]);_0x23033e[_0x5a82('0x38')]=_[_0x5a82('0x39')](_0x55a9d6['query']);_0x23033e[_0x5a82('0x41')]=_[_0x5a82('0x3a')](_0x23033e[_0x5a82('0x37')],_0x23033e[_0x5a82('0x38')]);_0x5250d1[_0x5a82('0x3b')]=_['intersection'](_0x23033e['model'],qs[_0x5a82('0x3c')](_0x55a9d6[_0x5a82('0x38')][_0x5a82('0x3c')]));_0x5250d1[_0x5a82('0x3b')]=_0x5250d1[_0x5a82('0x3b')]['length']?_0x5250d1['attributes']:_0x23033e['model'];if(!_0x55a9d6['query']['hasOwnProperty']('nolimit')){_0x5250d1[_0x5a82('0x23')]=qs[_0x5a82('0x23')](_0x55a9d6[_0x5a82('0x38')]['limit']);_0x5250d1['offset']=qs[_0x5a82('0x21')](_0x55a9d6['query']['offset']);}_0x5250d1['order']=qs[_0x5a82('0x3f')](_0x55a9d6[_0x5a82('0x38')][_0x5a82('0x3f')]);_0x5250d1[_0x5a82('0x40')]=qs[_0x5a82('0x41')](_['pick'](_0x55a9d6[_0x5a82('0x38')],_0x23033e[_0x5a82('0x41')]));_0x5250d1['where']['OpenchannelQueueId']=_0x64d889['id'];if(_0x55a9d6[_0x5a82('0x38')][_0x5a82('0x43')]){_0x5250d1['where']=_['merge'](_0x5250d1[_0x5a82('0x40')],{'$or':_['map'](_0x5250d1[_0x5a82('0x3b')],function(_0x3733ec){var _0x20f964={};_0x20f964[_0x3733ec]={'$like':'%'+_0x55a9d6[_0x5a82('0x38')]['filter']+'%'};return _0x20f964;})});}_0x5250d1=_[_0x5a82('0x44')]({},_0x5250d1,_0x55a9d6[_0x5a82('0x4d')]);return db[_0x5a82('0x5a')][_0x5a82('0x48')](_0x5250d1);}})[_0x5a82('0x2a')](function(_0x23974f){if(_0x23974f){return db['User'][_0x5a82('0x5b')]({'where':{'id':_[_0x5a82('0x32')](_0x23974f,_0x5a82('0x5c')),'role':'agent'},'attributes':['id',_0x5a82('0x30'),_0x5a82('0x5d'),_0x5a82('0x5e'),_0x5a82('0x5f')]});}})[_0x5a82('0x2a')](function(_0xed849a){if(_0xed849a){return{'count':_0xed849a[_0x5a82('0x24')],'rows':_[_0x5a82('0x32')](_0xed849a['rows'],function(_0x50f992){return{'membername':_0x50f992[_0x5a82('0x30')],'UserId':_0x50f992['id'],'queue_name':_0x356847[_0x5a82('0x30')],'OpenchannelQueueId':_0x356847['id'],'interface':util[_0x5a82('0x60')]('%s/%s','SIP',_0x50f992[_0x5a82('0x30')]),'penalty':0x0,'paused':_0x50f992[_0x5a82('0x5d')],'createdAt':_0x50f992[_0x5a82('0x5f')],'updatedAt':_0x50f992[_0x5a82('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4cbd02,_0x5250d1))['catch'](handleError(_0x4cbd02,null));};exports[_0x5a82('0x61')]=function(_0x5b11d7,_0x4575f4,_0x6bfdaf){var _0x4538a0={};var _0x986d85={};var _0x3e5069;var _0x2c102d;return db[_0x5a82('0x33')][_0x5a82('0x59')]({'where':{'id':_0x5b11d7['params']['id']}})['then'](handleEntityNotFound(_0x4575f4,null))[_0x5a82('0x2a')](function(_0x25e459){if(_0x25e459){_0x3e5069=_0x25e459;_0x986d85['model']=_[_0x5a82('0x39')](db[_0x5a82('0x62')][_0x5a82('0x34')]);_0x986d85[_0x5a82('0x38')]=_[_0x5a82('0x39')](_0x5b11d7[_0x5a82('0x38')]);_0x986d85[_0x5a82('0x41')]=_[_0x5a82('0x3a')](_0x986d85['model'],_0x986d85['query']);_0x4538a0['attributes']=_[_0x5a82('0x3a')](_0x986d85['model'],qs[_0x5a82('0x3c')](_0x5b11d7[_0x5a82('0x38')]['fields']));_0x4538a0[_0x5a82('0x3b')]=_0x4538a0['attributes'][_0x5a82('0x4c')]?_0x4538a0['attributes']:_0x986d85[_0x5a82('0x37')];_0x4538a0[_0x5a82('0x3e')]=qs['sort'](_0x5b11d7[_0x5a82('0x38')][_0x5a82('0x3f')]);_0x4538a0[_0x5a82('0x40')]=qs[_0x5a82('0x41')](_[_0x5a82('0x42')](_0x5b11d7[_0x5a82('0x38')],_0x986d85[_0x5a82('0x41')]));if(_0x5b11d7[_0x5a82('0x38')][_0x5a82('0x43')]){_0x4538a0[_0x5a82('0x40')]=_[_0x5a82('0x44')](_0x4538a0[_0x5a82('0x40')],{'$or':_[_0x5a82('0x32')](_0x4538a0[_0x5a82('0x3b')],function(_0x543e42){var _0x4e8d3f={};_0x4e8d3f[_0x543e42]={'$like':'%'+_0x5b11d7[_0x5a82('0x38')]['filter']+'%'};return _0x4e8d3f;})});}_0x4538a0=_[_0x5a82('0x44')]({},_0x4538a0,_0x5b11d7[_0x5a82('0x4d')]);return _0x3e5069[_0x5a82('0x61')](_0x4538a0);}})[_0x5a82('0x2a')](function(_0x61bbb3){if(_0x61bbb3){_0x2c102d=_0x61bbb3['length'];if(!_0x5b11d7[_0x5a82('0x38')][_0x5a82('0x3d')]('nolimit')){_0x4538a0[_0x5a82('0x23')]=qs[_0x5a82('0x23')](_0x5b11d7[_0x5a82('0x38')][_0x5a82('0x23')]);_0x4538a0[_0x5a82('0x21')]=qs[_0x5a82('0x21')](_0x5b11d7[_0x5a82('0x38')]['offset']);}return _0x3e5069[_0x5a82('0x61')](_0x4538a0);}})['then'](function(_0x49bf03){if(_0x49bf03){return _0x49bf03?{'count':_0x2c102d,'rows':_0x49bf03}:null;}})[_0x5a82('0x2a')](respondWithResult(_0x4575f4,null))[_0x5a82('0x4e')](handleError(_0x4575f4,null));};exports[_0x5a82('0x63')]=function(_0x4c2e8e,_0x316620,_0x4d64fe){var _0x412c9b=_0x4c2e8e[_0x5a82('0x50')]['ids'];return db[_0x5a82('0x62')][_0x5a82('0x48')]({'where':{'id':_0x412c9b},'attributes':['id'],'include':[{'model':db[_0x5a82('0x64')],'as':'Agents','attributes':['id',_0x5a82('0x30'),_0x5a82('0x65'),_0x5a82('0x66'),'interface'],'raw':!![]}]})[_0x5a82('0x2a')](function(_0x1cfdd7){if(_0x1cfdd7){var _0x430c9b=_[_0x5a82('0x67')](_0x1cfdd7,function(_0x142f2a){var _0x17673f=_0x142f2a[_0x5a82('0x2c')]({'plain':!![]});return _0x17673f[_0x5a82('0x68')];});return db[_0x5a82('0x33')][_0x5a82('0x54')]({'where':{'id':_0x4c2e8e[_0x5a82('0x4b')]['id']}})[_0x5a82('0x2a')](function(_0x17fd77){return db['sequelize'][_0x5a82('0x69')](function(_0x50f8cf){return _0x17fd77['addTeams'](_0x412c9b,{'transaction':_0x50f8cf})['then'](function(){return BPromise[_0x5a82('0x6a')](_0x430c9b,function(_0x46c857){return db[_0x5a82('0x5a')]['findOrCreate']({'where':{'UserId':_0x46c857['id'],'OpenchannelQueueId':_0x4c2e8e[_0x5a82('0x4b')]['id']},'transaction':_0x50f8cf});});})['then'](function(){_0x430c9b[_0x5a82('0x6b')](function(_0x58282b){socket[_0x5a82('0x6c')](_0x5a82('0x6d'),{'UserId':_0x58282b['id'],'OpenchannelQueueId':_0x17fd77['id']});});});});});}})['then'](respondWithStatusCode(_0x316620,null))[_0x5a82('0x4e')](handleError(_0x316620,null));};exports['removeTeams']=function(_0x41489a,_0x2a8665,_0x2a7682){return db[_0x5a82('0x62')][_0x5a82('0x48')]({'where':{'id':_0x41489a['query'][_0x5a82('0x6e')]},'attributes':['id'],'include':[{'model':db[_0x5a82('0x64')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x5a82('0x2a')](handleEntityNotFound(_0x2a8665,null))[_0x5a82('0x2a')](function(_0x2d0676){var _0x235165=_[_0x5a82('0x32')](_0x2d0676,'id');var _0x58d013=[];var _0x53f65b=[];var _0x37602a=squel[_0x5a82('0x6f')]();_0x37602a[_0x5a82('0x70')]('tq.TeamId')['from']('team_has_openchannel_queues','tq')[_0x5a82('0x71')]('user_has_teams','ut',_0x5a82('0x72'))['where'](_0x5a82('0x73'),_0x41489a[_0x5a82('0x4b')]['id']);for(var _0x34723d=0x0;_0x34723d<_0x2d0676[_0x5a82('0x4c')];_0x34723d+=0x1){let _0x3b1beb=_0x2d0676[_0x34723d];for(var _0x53539b=0x0;_0x53539b<_0x3b1beb['Agents']['length'];_0x53539b+=0x1){let _0x3d3471=_0x3b1beb[_0x5a82('0x68')][_0x53539b];var _0x412245=_0x37602a[_0x5a82('0x74')]();_0x412245['where'](_0x5a82('0x75'),_0x3d3471['id']);_0x53f65b['push'](db[_0x5a82('0x76')]['query'](_0x412245[_0x5a82('0x77')](),{'type':db['sequelize'][_0x5a82('0x78')][_0x5a82('0x79')]})[_0x5a82('0x2a')](function(_0x4caf17){if(_0x4caf17['length']===0x1){return _0x3d3471['id'];}else{var _0xfdd882=_[_0x5a82('0x7a')](_[_0x5a82('0x32')](_0x4caf17,_0x5a82('0x7b')),function(_0xfd6db2){return _[_0x5a82('0x7c')](_0x235165,_0xfd6db2);});if(_0xfdd882){return _0x3d3471['id'];}}}));}}return BPromise[_0x5a82('0x7d')](_0x53f65b)['then'](function(_0x519635){_0x58d013=_(_0x58d013)[_0x5a82('0x7e')](_0x519635)[_0x5a82('0x7f')]()[_0x5a82('0x80')]();return db[_0x5a82('0x33')][_0x5a82('0x54')]({'where':{'id':_0x41489a[_0x5a82('0x4b')]['id']}})['then'](function(_0x14868a){return db[_0x5a82('0x76')][_0x5a82('0x69')](function(_0x54635b){return _0x14868a[_0x5a82('0x81')](_0x41489a[_0x5a82('0x38')]['ids'],{'transaction':_0x54635b})[_0x5a82('0x2a')](function(){if(!_[_0x5a82('0x82')](_0x58d013)){return _0x14868a[_0x5a82('0x83')](_0x58d013,{'transaction':_0x54635b});}})[_0x5a82('0x2a')](function(){_0x58d013['forEach'](function(_0x3554cf){socket['emit'](_0x5a82('0x84'),{'UserId':_0x3554cf,'OpenchannelQueueId':_0x14868a['id']});});});});});});})[_0x5a82('0x2a')](respondWithStatusCode(_0x2a8665,null))[_0x5a82('0x4e')](handleError(_0x2a8665,null));};exports[_0x5a82('0x85')]=function(_0x4af94b,_0x45c400,_0x3983cf){return db[_0x5a82('0x33')]['find']({'where':{'id':_0x4af94b['params']['id']}})[_0x5a82('0x2a')](handleEntityNotFound(_0x45c400,null))['then'](function(_0x593291){if(_0x593291){return _0x593291[_0x5a82('0x85')](_0x4af94b[_0x5a82('0x50')][_0x5a82('0x6e')],_[_0x5a82('0x86')](_0x4af94b[_0x5a82('0x50')],[_0x5a82('0x6e'),'id'])||{})[_0x5a82('0x87')](function(_0x389883){for(var _0xc24275=0x0;_0xc24275<_0x4af94b[_0x5a82('0x50')][_0x5a82('0x6e')][_0x5a82('0x4c')];_0xc24275+=0x1){socket[_0x5a82('0x6c')](_0x5a82('0x6d'),{'UserId':Number(_0x4af94b['body'][_0x5a82('0x6e')][_0xc24275]),'OpenchannelQueueId':Number(_0x4af94b[_0x5a82('0x4b')]['id'])});}return _0x389883;});}})['then'](respondWithResult(_0x45c400,null))[_0x5a82('0x4e')](handleError(_0x45c400,null));};exports[_0x5a82('0x83')]=function(_0x5c3235,_0x5597b3,_0x1d915f){return db[_0x5a82('0x33')][_0x5a82('0x54')]({'where':{'id':_0x5c3235[_0x5a82('0x4b')]['id']}})[_0x5a82('0x2a')](handleEntityNotFound(_0x5597b3,null))[_0x5a82('0x2a')](function(_0x54a750){if(_0x54a750){return _0x54a750[_0x5a82('0x83')](_0x5c3235['query'][_0x5a82('0x6e')])[_0x5a82('0x2a')](function(){if(_[_0x5a82('0x88')](_0x5c3235[_0x5a82('0x38')][_0x5a82('0x6e')])){for(var _0x5e2eb6=0x0;_0x5e2eb6<_0x5c3235[_0x5a82('0x38')]['ids']['length'];_0x5e2eb6+=0x1){socket[_0x5a82('0x6c')](_0x5a82('0x84'),{'UserId':Number(_0x5c3235[_0x5a82('0x38')][_0x5a82('0x6e')][_0x5e2eb6]),'OpenchannelQueueId':Number(_0x5c3235[_0x5a82('0x4b')]['id'])});}}else{socket[_0x5a82('0x6c')]('userOpenchannelQueue:remove',{'UserId':Number(_0x5c3235[_0x5a82('0x38')][_0x5a82('0x6e')]),'OpenchannelQueueId':Number(_0x5c3235[_0x5a82('0x4b')]['id'])});}});}})[_0x5a82('0x2a')](respondWithStatusCode(_0x5597b3,null))[_0x5a82('0x4e')](handleError(_0x5597b3,null));};exports[_0x5a82('0x89')]=function(_0x3cb0b8,_0x53e943,_0x93a059){var _0x35df48={};var _0x511449={};var _0x12ac2c;var _0x35d4c0;return db['OpenchannelQueue'][_0x5a82('0x59')]({'where':{'id':_0x3cb0b8['params']['id']}})[_0x5a82('0x2a')](handleEntityNotFound(_0x53e943,null))[_0x5a82('0x2a')](function(_0x4bc3c7){if(_0x4bc3c7){_0x12ac2c=_0x4bc3c7;_0x511449[_0x5a82('0x37')]=_[_0x5a82('0x39')](db['User']['rawAttributes']);_0x511449[_0x5a82('0x38')]=_[_0x5a82('0x39')](_0x3cb0b8['query']);_0x511449['filters']=_[_0x5a82('0x3a')](_0x511449[_0x5a82('0x37')],_0x511449[_0x5a82('0x38')]);_0x35df48[_0x5a82('0x3b')]=_[_0x5a82('0x3a')](_0x511449[_0x5a82('0x37')],qs[_0x5a82('0x3c')](_0x3cb0b8['query'][_0x5a82('0x3c')]));_0x35df48[_0x5a82('0x3b')]=_0x35df48[_0x5a82('0x3b')][_0x5a82('0x4c')]?_0x35df48[_0x5a82('0x3b')]:_0x511449[_0x5a82('0x37')];_0x35df48[_0x5a82('0x3e')]=qs['sort'](_0x3cb0b8[_0x5a82('0x38')][_0x5a82('0x3f')]);_0x35df48['where']=qs[_0x5a82('0x41')](_[_0x5a82('0x42')](_0x3cb0b8[_0x5a82('0x38')],_0x511449[_0x5a82('0x41')]));if(_0x3cb0b8[_0x5a82('0x38')][_0x5a82('0x43')]){_0x35df48[_0x5a82('0x40')]=_[_0x5a82('0x44')](_0x35df48[_0x5a82('0x40')],{'$or':_[_0x5a82('0x32')](_0x35df48[_0x5a82('0x3b')],function(_0x13368d){var _0x54cfaa={};_0x54cfaa[_0x13368d]={'$like':'%'+_0x3cb0b8['query'][_0x5a82('0x43')]+'%'};return _0x54cfaa;})});}_0x35df48=_[_0x5a82('0x44')]({},_0x35df48,_0x3cb0b8[_0x5a82('0x4d')]);return _0x12ac2c[_0x5a82('0x89')](_0x35df48);}})[_0x5a82('0x2a')](function(_0x51035f){if(_0x51035f){_0x35d4c0=_0x51035f[_0x5a82('0x4c')];if(!_0x3cb0b8[_0x5a82('0x38')][_0x5a82('0x3d')](_0x5a82('0x8a'))){_0x35df48[_0x5a82('0x23')]=qs[_0x5a82('0x23')](_0x3cb0b8['query'][_0x5a82('0x23')]);_0x35df48[_0x5a82('0x21')]=qs[_0x5a82('0x21')](_0x3cb0b8[_0x5a82('0x38')]['offset']);}return _0x12ac2c['getAgents'](_0x35df48);}})[_0x5a82('0x2a')](function(_0x45502e){if(_0x45502e){return _0x45502e?{'count':_0x35d4c0,'rows':_0x45502e}:null;}})[_0x5a82('0x2a')](respondWithResult(_0x53e943,null))[_0x5a82('0x4e')](handleError(_0x53e943,null));};
\ No newline at end of file
index 550f1c9..89f62d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2fd0=['../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','events'];(function(_0x31004a,_0x2c2f0e){var _0x3db1f4=function(_0x232dbc){while(--_0x232dbc){_0x31004a['push'](_0x31004a['shift']());}};_0x3db1f4(++_0x2c2f0e);}(_0x2fd0,0x1ca));var _0x02fd=function(_0x32917a,_0x3559ea){_0x32917a=_0x32917a-0x0;var _0x1881e1=_0x2fd0[_0x32917a];return _0x1881e1;};'use strict';var EventEmitter=require(_0x02fd('0x0'));var OpenchannelQueue=require(_0x02fd('0x1'))['db'][_0x02fd('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x02fd('0x3')](0x0);var events={'afterCreate':_0x02fd('0x4'),'afterUpdate':_0x02fd('0x5'),'afterDestroy':_0x02fd('0x6')};function emitEvent(_0x5b0f29){return function(_0x1721ec,_0x5b8edd,_0x4d4716){OpenchannelQueueEvents[_0x02fd('0x7')](_0x5b0f29+':'+_0x1721ec['id'],_0x1721ec);OpenchannelQueueEvents['emit'](_0x5b0f29,_0x1721ec);_0x4d4716(null);};}for(var e in events){if(events[_0x02fd('0x8')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents;
\ No newline at end of file
+var _0x1f92=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','OpenchannelQueue','setMaxListeners'];(function(_0x5df5e1,_0x3e0305){var _0x2fffd3=function(_0x532a7c){while(--_0x532a7c){_0x5df5e1['push'](_0x5df5e1['shift']());}};_0x2fffd3(++_0x3e0305);}(_0x1f92,0x7f));var _0x21f9=function(_0x270bf5,_0x59f3c4){_0x270bf5=_0x270bf5-0x0;var _0x2bbffc=_0x1f92[_0x270bf5];return _0x2bbffc;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x21f9('0x0'))['db'][_0x21f9('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x21f9('0x2')](0x0);var events={'afterCreate':_0x21f9('0x3'),'afterUpdate':_0x21f9('0x4'),'afterDestroy':_0x21f9('0x5')};function emitEvent(_0x58ce52){return function(_0x15a08d,_0x7adab8,_0x5a9942){OpenchannelQueueEvents[_0x21f9('0x6')](_0x58ce52+':'+_0x15a08d['id'],_0x15a08d);OpenchannelQueueEvents[_0x21f9('0x6')](_0x58ce52,_0x15a08d);_0x5a9942(null);};}for(var e in events){if(events[_0x21f9('0x7')](e)){var event=events[e];OpenchannelQueue[_0x21f9('0x8')](e,emitEvent(event));}}module[_0x21f9('0x9')]=OpenchannelQueueEvents;
\ No newline at end of file
index 38fcc9d..18940f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xebfc=['request-promise','rimraf','./openchannelQueue.attributes','define','OpenchannelQueue','openchannel_queues','lodash','../../config/logger','moment'];(function(_0x3621c8,_0x269f7b){var _0x3c05e2=function(_0x48350d){while(--_0x48350d){_0x3621c8['push'](_0x3621c8['shift']());}};_0x3c05e2(++_0x269f7b);}(_0xebfc,0x9f));var _0xcebf=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0xebfc[_0x5a3cf0];return _0x5a64ee;};'use strict';var _=require(_0xcebf('0x0'));var util=require('util');var logger=require(_0xcebf('0x1'))('api');var moment=require(_0xcebf('0x2'));var BPromise=require('bluebird');var rp=require(_0xcebf('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcebf('0x4'));var config=require('../../config/environment');var attributes=require(_0xcebf('0x5'));module['exports']=function(_0x319f7d,_0x593821){return _0x319f7d[_0xcebf('0x6')](_0xcebf('0x7'),attributes,{'tableName':_0xcebf('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd2d7=['OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./openchannelQueue.attributes','exports','define'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xd2d7,0x91));var _0x7d2d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd2d7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7d2d('0x0'));var util=require(_0x7d2d('0x1'));var logger=require(_0x7d2d('0x2'))(_0x7d2d('0x3'));var moment=require(_0x7d2d('0x4'));var BPromise=require(_0x7d2d('0x5'));var rp=require(_0x7d2d('0x6'));var fs=require('fs');var path=require(_0x7d2d('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7d2d('0x8'));module[_0x7d2d('0x9')]=function(_0x2252c3,_0x2acf45){return _0x2252c3[_0x7d2d('0xa')](_0x7d2d('0xb'),attributes,{'tableName':_0x7d2d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 04a7445..93bf1fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ed6=['GetOpenchannelQueue','OpenchannelQueue','findAll','options','where','limit','include','map','model','attributes','then','info','find','raw','debug','ShowOpenchannelQueue','stringify','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','redis','./openchannelQueue.socket','register','request','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x487ab4,_0x1e24e8){var _0x3bef77=function(_0x5ce664){while(--_0x5ce664){_0x487ab4['push'](_0x487ab4['shift']());}};_0x3bef77(++_0x1e24e8);}(_0x2ed6,0x18b));var _0x62ed=function(_0x127de9,_0x5854ff){_0x127de9=_0x127de9-0x0;var _0x17acde=_0x2ed6[_0x127de9];return _0x17acde;};'use strict';var _=require('lodash');var util=require(_0x62ed('0x0'));var moment=require('moment');var BPromise=require(_0x62ed('0x1'));var rs=require(_0x62ed('0x2'));var fs=require('fs');var Redis=require(_0x62ed('0x3'));var db=require(_0x62ed('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x62ed('0x5'))(_0x62ed('0x6'));var config=require(_0x62ed('0x7'));var jayson=require(_0x62ed('0x8'));var client=jayson[_0x62ed('0x9')][_0x62ed('0xa')]({'port':0x232a});config['redis']=_[_0x62ed('0xb')](config['redis'],{'host':_0x62ed('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x62ed('0xd')]));require(_0x62ed('0xe'))[_0x62ed('0xf')](socket);function respondWithRpcPromise(_0x4b1c52,_0x52328c,_0x32114e){return new BPromise(function(_0x357725,_0x55b05f){return client[_0x62ed('0x10')](_0x4b1c52,_0x32114e)['then'](function(_0xf8e650){logger['info'](_0x62ed('0x11'),_0x52328c,_0x62ed('0x12'));logger['debug'](_0x62ed('0x13'),_0x52328c,_0x62ed('0x12'),JSON['stringify'](_0xf8e650));if(_0xf8e650[_0x62ed('0x14')]){if(_0xf8e650[_0x62ed('0x14')][_0x62ed('0x15')]===0x1f4){logger[_0x62ed('0x14')](_0x62ed('0x11'),_0x52328c,_0xf8e650[_0x62ed('0x14')][_0x62ed('0x16')]);return _0x55b05f(_0xf8e650[_0x62ed('0x14')][_0x62ed('0x16')]);}logger[_0x62ed('0x14')](_0x62ed('0x11'),_0x52328c,_0xf8e650[_0x62ed('0x14')][_0x62ed('0x16')]);return _0x357725(_0xf8e650[_0x62ed('0x14')][_0x62ed('0x16')]);}else{logger['info'](_0x62ed('0x11'),_0x52328c,'request\x20sent');_0x357725(_0xf8e650[_0x62ed('0x17')]['message']);}})[_0x62ed('0x18')](function(_0x3ecf30){logger[_0x62ed('0x14')](_0x62ed('0x11'),_0x52328c,_0x3ecf30);_0x55b05f(_0x3ecf30);});});}exports[_0x62ed('0x19')]=function(_0x4a9223){var _0x47fa79=this;return new Promise(function(_0x7921d4,_0x2c6268){return db[_0x62ed('0x1a')][_0x62ed('0x1b')]({'raw':_0x4a9223[_0x62ed('0x1c')]?_0x4a9223[_0x62ed('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x4a9223[_0x62ed('0x1c')]?_0x4a9223[_0x62ed('0x1c')][_0x62ed('0x1d')]||null:null,'attributes':_0x4a9223['options']?_0x4a9223[_0x62ed('0x1c')]['attributes']||null:null,'limit':_0x4a9223[_0x62ed('0x1c')]?_0x4a9223[_0x62ed('0x1c')][_0x62ed('0x1e')]||null:null,'include':_0x4a9223[_0x62ed('0x1c')]?_0x4a9223['options'][_0x62ed('0x1f')]?_[_0x62ed('0x20')](_0x4a9223['options']['include'],function(_0x471055){return{'model':db[_0x471055[_0x62ed('0x21')]],'as':_0x471055['as'],'attributes':_0x471055[_0x62ed('0x22')],'include':_0x471055[_0x62ed('0x1f')]?_[_0x62ed('0x20')](_0x471055[_0x62ed('0x1f')],function(_0x207578){return{'model':db[_0x207578[_0x62ed('0x21')]],'as':_0x207578['as'],'attributes':_0x207578['attributes'],'include':_0x207578[_0x62ed('0x1f')]?_['map'](_0x207578['include'],function(_0x550f08){return{'model':db[_0x550f08[_0x62ed('0x21')]],'as':_0x550f08['as'],'attributes':_0x550f08[_0x62ed('0x22')]};}):[]};}):[]};}):[]:[]})[_0x62ed('0x23')](function(_0xcfd9f0){logger[_0x62ed('0x24')](_0x62ed('0x19'),_0x4a9223);logger['debug'](_0x62ed('0x19'),_0x4a9223,JSON['stringify'](_0xcfd9f0));_0x7921d4(_0xcfd9f0);})['catch'](function(_0x1da464){logger[_0x62ed('0x14')](_0x62ed('0x19'),_0x1da464[_0x62ed('0x16')],_0x4a9223);_0x2c6268(_0x47fa79[_0x62ed('0x14')](0x1f4,_0x1da464[_0x62ed('0x16')]));});});};exports['ShowOpenchannelQueue']=function(_0x2b2079){var _0x381d2b=this;return new Promise(function(_0x5d4a53,_0x43f26a){return db[_0x62ed('0x1a')][_0x62ed('0x25')]({'raw':_0x2b2079[_0x62ed('0x1c')]?_0x2b2079[_0x62ed('0x1c')][_0x62ed('0x26')]===undefined?!![]:![]:!![],'where':_0x2b2079[_0x62ed('0x1c')]?_0x2b2079[_0x62ed('0x1c')]['where']||null:null,'attributes':_0x2b2079[_0x62ed('0x1c')]?_0x2b2079['options']['attributes']||null:null,'include':_0x2b2079[_0x62ed('0x1c')]?_0x2b2079[_0x62ed('0x1c')][_0x62ed('0x1f')]?_['map'](_0x2b2079['options'][_0x62ed('0x1f')],function(_0xa482dc){return{'model':db[_0xa482dc[_0x62ed('0x21')]],'as':_0xa482dc['as'],'attributes':_0xa482dc[_0x62ed('0x22')],'include':_0xa482dc[_0x62ed('0x1f')]?_[_0x62ed('0x20')](_0xa482dc[_0x62ed('0x1f')],function(_0x4d05a6){return{'model':db[_0x4d05a6[_0x62ed('0x21')]],'as':_0x4d05a6['as'],'attributes':_0x4d05a6[_0x62ed('0x22')],'include':_0x4d05a6[_0x62ed('0x1f')]?_['map'](_0x4d05a6[_0x62ed('0x1f')],function(_0x58c2ec){return{'model':db[_0x58c2ec[_0x62ed('0x21')]],'as':_0x58c2ec['as'],'attributes':_0x58c2ec[_0x62ed('0x22')]};}):[]};}):[]};}):[]:[]})[_0x62ed('0x23')](function(_0x35c504){logger[_0x62ed('0x24')]('ShowOpenchannelQueue',_0x2b2079);logger[_0x62ed('0x27')](_0x62ed('0x28'),_0x2b2079,JSON[_0x62ed('0x29')](_0x35c504));_0x5d4a53(_0x35c504);})[_0x62ed('0x18')](function(_0x2e620f){logger['error']('ShowOpenchannelQueue',_0x2e620f[_0x62ed('0x16')],_0x2b2079);_0x43f26a(_0x381d2b['error'](0x1f4,_0x2e620f[_0x62ed('0x16')]));});});};
\ No newline at end of file
+var _0xec3e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./openchannelQueue.socket','then','info','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','where','include','map','model','attributes','find','raw','ShowOpenchannelQueue','lodash','util','moment','bluebird','randomstring'];(function(_0x196c32,_0x181622){var _0x4fef49=function(_0x45ed98){while(--_0x45ed98){_0x196c32['push'](_0x196c32['shift']());}};_0x4fef49(++_0x181622);}(_0xec3e,0x18b));var _0xeec3=function(_0x3741c3,_0x517884){_0x3741c3=_0x3741c3-0x0;var _0x11a8aa=_0xec3e[_0x3741c3];return _0x11a8aa;};'use strict';var _=require(_0xeec3('0x0'));var util=require(_0xeec3('0x1'));var moment=require(_0xeec3('0x2'));var BPromise=require(_0xeec3('0x3'));var rs=require(_0xeec3('0x4'));var fs=require('fs');var Redis=require(_0xeec3('0x5'));var db=require(_0xeec3('0x6'))['db'];var utils=require(_0xeec3('0x7'));var logger=require(_0xeec3('0x8'))(_0xeec3('0x9'));var config=require('../../config/environment');var jayson=require(_0xeec3('0xa'));var client=jayson[_0xeec3('0xb')][_0xeec3('0xc')]({'port':0x232a});config[_0xeec3('0xd')]=_[_0xeec3('0xe')](config[_0xeec3('0xd')],{'host':_0xeec3('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xeec3('0x10'))['register'](socket);function respondWithRpcPromise(_0x3233af,_0x5d2ae7,_0x553bc5){return new BPromise(function(_0x133068,_0x47985d){return client['request'](_0x3233af,_0x553bc5)[_0xeec3('0x11')](function(_0x11486f){logger[_0xeec3('0x12')](_0xeec3('0x13'),_0x5d2ae7,'request\x20sent');logger[_0xeec3('0x14')](_0xeec3('0x15'),_0x5d2ae7,_0xeec3('0x16'),JSON[_0xeec3('0x17')](_0x11486f));if(_0x11486f[_0xeec3('0x18')]){if(_0x11486f[_0xeec3('0x18')][_0xeec3('0x19')]===0x1f4){logger[_0xeec3('0x18')](_0xeec3('0x13'),_0x5d2ae7,_0x11486f[_0xeec3('0x18')][_0xeec3('0x1a')]);return _0x47985d(_0x11486f['error']['message']);}logger['error'](_0xeec3('0x13'),_0x5d2ae7,_0x11486f['error']['message']);return _0x133068(_0x11486f[_0xeec3('0x18')][_0xeec3('0x1a')]);}else{logger['info'](_0xeec3('0x13'),_0x5d2ae7,_0xeec3('0x16'));_0x133068(_0x11486f['result']['message']);}})[_0xeec3('0x1b')](function(_0xb518ff){logger[_0xeec3('0x18')](_0xeec3('0x13'),_0x5d2ae7,_0xb518ff);_0x47985d(_0xb518ff);});});}exports[_0xeec3('0x1c')]=function(_0x23af75){var _0x2955b3=this;return new Promise(function(_0x28a054,_0x1cf2b2){return db[_0xeec3('0x1d')][_0xeec3('0x1e')]({'raw':_0x23af75[_0xeec3('0x1f')]?_0x23af75[_0xeec3('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x23af75[_0xeec3('0x1f')]?_0x23af75[_0xeec3('0x1f')][_0xeec3('0x20')]||null:null,'attributes':_0x23af75[_0xeec3('0x1f')]?_0x23af75[_0xeec3('0x1f')]['attributes']||null:null,'limit':_0x23af75[_0xeec3('0x1f')]?_0x23af75[_0xeec3('0x1f')]['limit']||null:null,'include':_0x23af75['options']?_0x23af75[_0xeec3('0x1f')][_0xeec3('0x21')]?_[_0xeec3('0x22')](_0x23af75['options'][_0xeec3('0x21')],function(_0xb3f273){return{'model':db[_0xb3f273[_0xeec3('0x23')]],'as':_0xb3f273['as'],'attributes':_0xb3f273['attributes'],'include':_0xb3f273[_0xeec3('0x21')]?_['map'](_0xb3f273[_0xeec3('0x21')],function(_0xa9b273){return{'model':db[_0xa9b273[_0xeec3('0x23')]],'as':_0xa9b273['as'],'attributes':_0xa9b273[_0xeec3('0x24')],'include':_0xa9b273[_0xeec3('0x21')]?_[_0xeec3('0x22')](_0xa9b273[_0xeec3('0x21')],function(_0xed6af7){return{'model':db[_0xed6af7[_0xeec3('0x23')]],'as':_0xed6af7['as'],'attributes':_0xed6af7['attributes']};}):[]};}):[]};}):[]:[]})[_0xeec3('0x11')](function(_0xe851d8){logger['info']('GetOpenchannelQueue',_0x23af75);logger[_0xeec3('0x14')](_0xeec3('0x1c'),_0x23af75,JSON[_0xeec3('0x17')](_0xe851d8));_0x28a054(_0xe851d8);})['catch'](function(_0x9b3c97){logger['error']('GetOpenchannelQueue',_0x9b3c97[_0xeec3('0x1a')],_0x23af75);_0x1cf2b2(_0x2955b3['error'](0x1f4,_0x9b3c97[_0xeec3('0x1a')]));});});};exports['ShowOpenchannelQueue']=function(_0x2ed562){var _0xed6540=this;return new Promise(function(_0xc1add6,_0x477b17){return db[_0xeec3('0x1d')][_0xeec3('0x25')]({'raw':_0x2ed562[_0xeec3('0x1f')]?_0x2ed562[_0xeec3('0x1f')][_0xeec3('0x26')]===undefined?!![]:![]:!![],'where':_0x2ed562['options']?_0x2ed562[_0xeec3('0x1f')][_0xeec3('0x20')]||null:null,'attributes':_0x2ed562[_0xeec3('0x1f')]?_0x2ed562[_0xeec3('0x1f')]['attributes']||null:null,'include':_0x2ed562[_0xeec3('0x1f')]?_0x2ed562['options'][_0xeec3('0x21')]?_[_0xeec3('0x22')](_0x2ed562['options'][_0xeec3('0x21')],function(_0x1e5741){return{'model':db[_0x1e5741[_0xeec3('0x23')]],'as':_0x1e5741['as'],'attributes':_0x1e5741[_0xeec3('0x24')],'include':_0x1e5741[_0xeec3('0x21')]?_[_0xeec3('0x22')](_0x1e5741[_0xeec3('0x21')],function(_0x18fc5d){return{'model':db[_0x18fc5d[_0xeec3('0x23')]],'as':_0x18fc5d['as'],'attributes':_0x18fc5d[_0xeec3('0x24')],'include':_0x18fc5d[_0xeec3('0x21')]?_[_0xeec3('0x22')](_0x18fc5d[_0xeec3('0x21')],function(_0x3a6106){return{'model':db[_0x3a6106[_0xeec3('0x23')]],'as':_0x3a6106['as'],'attributes':_0x3a6106[_0xeec3('0x24')]};}):[]};}):[]};}):[]:[]})[_0xeec3('0x11')](function(_0x1c92fb){logger[_0xeec3('0x12')](_0xeec3('0x27'),_0x2ed562);logger[_0xeec3('0x14')]('ShowOpenchannelQueue',_0x2ed562,JSON[_0xeec3('0x17')](_0x1c92fb));_0xc1add6(_0x1c92fb);})['catch'](function(_0x21c15b){logger[_0xeec3('0x18')](_0xeec3('0x27'),_0x21c15b[_0xeec3('0x1a')],_0x2ed562);_0x477b17(_0xed6540[_0xeec3('0x18')](0x1f4,_0x21c15b[_0xeec3('0x1a')]));});});};
\ No newline at end of file
index 498d102..a9aac62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0650=['removeListener','register','length','./openchannelQueue.events','remove','update'];(function(_0x416a33,_0x2d7af0){var _0x2f82e2=function(_0x20387b){while(--_0x20387b){_0x416a33['push'](_0x416a33['shift']());}};_0x2f82e2(++_0x2d7af0);}(_0x0650,0x81));var _0x0065=function(_0x3f958c,_0x368f68){_0x3f958c=_0x3f958c-0x0;var _0x1c42e3=_0x0650[_0x3f958c];return _0x1c42e3;};'use strict';var OpenchannelQueueEvents=require(_0x0065('0x0'));var events=['save',_0x0065('0x1'),_0x0065('0x2')];function createListener(_0x577849,_0x3dfd1e){return function(_0x37b7ca){_0x3dfd1e['emit'](_0x577849,_0x37b7ca);};}function removeListener(_0x3cab4d,_0x4a976a){return function(){OpenchannelQueueEvents[_0x0065('0x3')](_0x3cab4d,_0x4a976a);};}exports[_0x0065('0x4')]=function(_0x560426){for(var _0x306f2d=0x0,_0x1c2c83=events[_0x0065('0x5')];_0x306f2d<_0x1c2c83;_0x306f2d++){var _0x1a4756=events[_0x306f2d];var _0x350766=createListener('openchannelQueue:'+_0x1a4756,_0x560426);OpenchannelQueueEvents['on'](_0x1a4756,_0x350766);}};
\ No newline at end of file
+var _0x8b75=['save','remove','update','emit','removeListener','length','openchannelQueue:','./openchannelQueue.events'];(function(_0x5d16a9,_0x205326){var _0x3beb90=function(_0x2d0802){while(--_0x2d0802){_0x5d16a9['push'](_0x5d16a9['shift']());}};_0x3beb90(++_0x205326);}(_0x8b75,0xb7));var _0x58b7=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0x8b75[_0xbe200f];return _0x192597;};'use strict';var OpenchannelQueueEvents=require(_0x58b7('0x0'));var events=[_0x58b7('0x1'),_0x58b7('0x2'),_0x58b7('0x3')];function createListener(_0x45da79,_0x10f61c){return function(_0x423717){_0x10f61c[_0x58b7('0x4')](_0x45da79,_0x423717);};}function removeListener(_0x630cf2,_0x4a5166){return function(){OpenchannelQueueEvents[_0x58b7('0x5')](_0x630cf2,_0x4a5166);};}exports['register']=function(_0x107bd7){for(var _0x371d89=0x0,_0x2626b7=events[_0x58b7('0x6')];_0x371d89<_0x2626b7;_0x371d89++){var _0x4b66da=events[_0x371d89];var _0x598566=createListener(_0x58b7('0x7')+_0x4b66da,_0x107bd7);OpenchannelQueueEvents['on'](_0x4b66da,_0x598566);}};
\ No newline at end of file
index 7966ca7..04383c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3eab=['destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueueReport.controller','get','index','/describe','isAuthenticated','show','post','create','put','/:id','update','delete'];(function(_0x2aa6c6,_0x4c33df){var _0x17ee57=function(_0x53fdb6){while(--_0x53fdb6){_0x2aa6c6['push'](_0x2aa6c6['shift']());}};_0x17ee57(++_0x4c33df);}(_0x3eab,0x113));var _0xb3ea=function(_0x1ff163,_0x23bda1){_0x1ff163=_0x1ff163-0x0;var _0x4700d4=_0x3eab[_0x1ff163];return _0x4700d4;};'use strict';var multer=require(_0xb3ea('0x0'));var util=require(_0xb3ea('0x1'));var path=require('path');var timeout=require(_0xb3ea('0x2'));var express=require(_0xb3ea('0x3'));var router=express['Router']();var fs_extra=require(_0xb3ea('0x4'));var auth=require(_0xb3ea('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb3ea('0x6'));var controller=require(_0xb3ea('0x7'));router[_0xb3ea('0x8')]('/',auth['isAuthenticated'](),controller[_0xb3ea('0x9')]);router[_0xb3ea('0x8')](_0xb3ea('0xa'),auth[_0xb3ea('0xb')](),controller['describe']);router[_0xb3ea('0x8')]('/:id',auth[_0xb3ea('0xb')](),controller[_0xb3ea('0xc')]);router[_0xb3ea('0xd')]('/',auth['isAuthenticated'](),controller[_0xb3ea('0xe')]);router[_0xb3ea('0xf')](_0xb3ea('0x10'),auth['isAuthenticated'](),controller[_0xb3ea('0x11')]);router[_0xb3ea('0x12')](_0xb3ea('0x10'),auth[_0xb3ea('0xb')](),controller[_0xb3ea('0x13')]);module[_0xb3ea('0x14')]=router;
\ No newline at end of file
+var _0xadd0=['exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','post','put','delete','destroy'];(function(_0x51d71a,_0x596fda){var _0xff01f1=function(_0x30480f){while(--_0x30480f){_0x51d71a['push'](_0x51d71a['shift']());}};_0xff01f1(++_0x596fda);}(_0xadd0,0x131));var _0x0add=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xadd0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0add('0x0'));var util=require(_0x0add('0x1'));var path=require(_0x0add('0x2'));var timeout=require('connect-timeout');var express=require(_0x0add('0x3'));var router=express['Router']();var fs_extra=require(_0x0add('0x4'));var auth=require(_0x0add('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0add('0x6'));var controller=require('./openchannelQueueReport.controller');router[_0x0add('0x7')]('/',auth['isAuthenticated'](),controller[_0x0add('0x8')]);router[_0x0add('0x7')](_0x0add('0x9'),auth[_0x0add('0xa')](),controller[_0x0add('0xb')]);router['get'](_0x0add('0xc'),auth[_0x0add('0xa')](),controller[_0x0add('0xd')]);router[_0x0add('0xe')]('/',auth[_0x0add('0xa')](),controller['create']);router[_0x0add('0xf')]('/:id',auth[_0x0add('0xa')](),controller['update']);router[_0x0add('0x10')](_0x0add('0xc'),auth[_0x0add('0xa')](),controller[_0x0add('0x11')]);module[_0x0add('0x12')]=router;
\ No newline at end of file
index 0253198..35a007b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e9d=['sequelize','exports','STRING','DATE','moment'];(function(_0x3bf7e5,_0x1ff1d9){var _0x476e81=function(_0x5c18e3){while(--_0x5c18e3){_0x3bf7e5['push'](_0x3bf7e5['shift']());}};_0x476e81(++_0x1ff1d9);}(_0x7e9d,0xbd));var _0xd7e9=function(_0x50546a,_0x32d0a4){_0x50546a=_0x50546a-0x0;var _0x8942db=_0x7e9d[_0x50546a];return _0x8942db;};'use strict';var moment=require(_0xd7e9('0x0'));var Sequelize=require(_0xd7e9('0x1'));module[_0xd7e9('0x2')]={'uniqueid':{'type':Sequelize[_0xd7e9('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xd7e9('0x4')]},'leaveAt':{'type':Sequelize[_0xd7e9('0x4')]},'acceptAt':{'type':Sequelize[_0xd7e9('0x4')]},'exitAt':{'type':Sequelize[_0xd7e9('0x4')]},'reason':{'type':Sequelize[_0xd7e9('0x3')]}};
\ No newline at end of file
+var _0x4c7b=['moment','exports','STRING','DATE'];(function(_0x172a95,_0xd2c1f4){var _0x56250a=function(_0x4f2336){while(--_0x4f2336){_0x172a95['push'](_0x172a95['shift']());}};_0x56250a(++_0xd2c1f4);}(_0x4c7b,0x128));var _0xb4c7=function(_0x304c35,_0x18ad71){_0x304c35=_0x304c35-0x0;var _0x4e2163=_0x4c7b[_0x304c35];return _0x4e2163;};'use strict';var moment=require(_0xb4c7('0x0'));var Sequelize=require('sequelize');module[_0xb4c7('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xb4c7('0x2')]},'joinAt':{'type':Sequelize[_0xb4c7('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xb4c7('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xb4c7('0x2')]}};
\ No newline at end of file
index 443e9db..462e706 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d44=['sox','ejs','fs-extra','lodash','squel','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','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','OpenchannelQueueReport','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x27315c,_0x56cd84){var _0x28e029=function(_0x4c2c02){while(--_0x4c2c02){_0x27315c['push'](_0x27315c['shift']());}};_0x28e029(++_0x56cd84);}(_0x8d44,0xe1));var _0x48d4=function(_0x4b17cb,_0x89f41e){_0x4b17cb=_0x4b17cb-0x0;var _0x10f452=_0x8d44[_0x4b17cb];return _0x10f452;};'use strict';var emlformat=require(_0x48d4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x48d4('0x1'));var jsonpatch=require(_0x48d4('0x2'));var rp=require(_0x48d4('0x3'));var moment=require(_0x48d4('0x4'));var BPromise=require(_0x48d4('0x5'));var Mustache=require(_0x48d4('0x6'));var util=require(_0x48d4('0x7'));var path=require(_0x48d4('0x8'));var sox=require(_0x48d4('0x9'));var csv=require('to-csv');var ejs=require(_0x48d4('0xa'));var fs=require('fs');var fs_extra=require(_0x48d4('0xb'));var _=require(_0x48d4('0xc'));var squel=require(_0x48d4('0xd'));var crypto=require(_0x48d4('0xe'));var jsforce=require(_0x48d4('0xf'));var deskjs=require(_0x48d4('0x10'));var toCsv=require(_0x48d4('0x11'));var querystring=require(_0x48d4('0x12'));var Papa=require('papaparse');var Redis=require(_0x48d4('0x13'));var authService=require(_0x48d4('0x14'));var qs=require(_0x48d4('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x48d4('0x16'));var logger=require('../../config/logger')(_0x48d4('0x17'));var utils=require(_0x48d4('0x18'));var config=require(_0x48d4('0x19'));var licenseUtil=require(_0x48d4('0x1a'));var db=require(_0x48d4('0x1b'))['db'];function respondWithStatusCode(_0x571116,_0x494ec7){_0x494ec7=_0x494ec7||0xcc;return function(_0x160ca8){if(_0x160ca8){return _0x571116['sendStatus'](_0x494ec7);}return _0x571116[_0x48d4('0x1c')](_0x494ec7)[_0x48d4('0x1d')]();};}function respondWithResult(_0x6377c0,_0x302661){_0x302661=_0x302661||0xc8;return function(_0x152b25){if(_0x152b25){return _0x6377c0[_0x48d4('0x1c')](_0x302661)['json'](_0x152b25);}};}function respondWithFilteredResult(_0x418127,_0x32b7cd){return function(_0x566a20){if(_0x566a20){var _0x1a594c=typeof _0x32b7cd['offset']===_0x48d4('0x1e')&&typeof _0x32b7cd[_0x48d4('0x1f')]==='undefined';var _0x153ac7=_0x566a20[_0x48d4('0x20')];var _0x49bbed=_0x1a594c?0x0:_0x32b7cd[_0x48d4('0x21')];var _0x5d6c64=_0x1a594c?_0x566a20[_0x48d4('0x20')]:_0x32b7cd['offset']+_0x32b7cd[_0x48d4('0x1f')];var _0x275ab9;if(_0x5d6c64>=_0x153ac7){_0x5d6c64=_0x153ac7;_0x275ab9=0xc8;}else{_0x275ab9=0xce;}_0x418127['status'](_0x275ab9);return _0x418127[_0x48d4('0x22')](_0x48d4('0x23'),_0x49bbed+'-'+_0x5d6c64+'/'+_0x153ac7)[_0x48d4('0x24')](_0x566a20);}return null;};}function patchUpdates(_0x285660){return function(_0x4fdfee){try{jsonpatch[_0x48d4('0x25')](_0x4fdfee,_0x285660,!![]);}catch(_0x2feda4){return BPromise[_0x48d4('0x26')](_0x2feda4);}return _0x4fdfee['save']();};}function saveUpdates(_0x431504,_0x129854){return function(_0x1f8db8){if(_0x1f8db8){return _0x1f8db8[_0x48d4('0x27')](_0x431504)[_0x48d4('0x28')](function(_0xf465f2){return _0xf465f2;});}return null;};}function removeEntity(_0x2f2391,_0xab4c84){return function(_0xd141de){if(_0xd141de){return _0xd141de[_0x48d4('0x29')]()[_0x48d4('0x28')](function(){_0x2f2391['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x17c66e,_0x5e84fc){return function(_0x3edd1e){if(!_0x3edd1e){_0x17c66e[_0x48d4('0x2a')](0x194);}return _0x3edd1e;};}function handleError(_0x22c876,_0x3f88a5){_0x3f88a5=_0x3f88a5||0x1f4;return function(_0x242242){logger[_0x48d4('0x2b')](_0x242242[_0x48d4('0x2c')]);if(_0x242242[_0x48d4('0x2d')]){delete _0x242242[_0x48d4('0x2d')];}_0x22c876[_0x48d4('0x1c')](_0x3f88a5)[_0x48d4('0x2e')](_0x242242);};}exports[_0x48d4('0x2f')]=function(_0x370286,_0x5d66b8){var _0x271618={},_0x27938a={},_0x51fa12={'count':0x0,'rows':[]};var _0x365450=_[_0x48d4('0x30')](db[_0x48d4('0x31')]['rawAttributes'],function(_0x53f621){return{'name':_0x53f621[_0x48d4('0x32')],'type':_0x53f621[_0x48d4('0x33')][_0x48d4('0x34')]};});_0x27938a[_0x48d4('0x35')]=_[_0x48d4('0x30')](_0x365450,'name');_0x27938a[_0x48d4('0x36')]=_[_0x48d4('0x37')](_0x370286[_0x48d4('0x36')]);_0x27938a['filters']=_['intersection'](_0x27938a[_0x48d4('0x35')],_0x27938a[_0x48d4('0x36')]);_0x271618[_0x48d4('0x38')]=_[_0x48d4('0x39')](_0x27938a[_0x48d4('0x35')],qs[_0x48d4('0x3a')](_0x370286[_0x48d4('0x36')][_0x48d4('0x3a')]));_0x271618[_0x48d4('0x38')]=_0x271618['attributes'][_0x48d4('0x3b')]?_0x271618[_0x48d4('0x38')]:_0x27938a[_0x48d4('0x35')];if(!_0x370286[_0x48d4('0x36')]['hasOwnProperty']('nolimit')){_0x271618[_0x48d4('0x1f')]=qs[_0x48d4('0x1f')](_0x370286['query'][_0x48d4('0x1f')]);_0x271618[_0x48d4('0x21')]=qs[_0x48d4('0x21')](_0x370286['query']['offset']);}_0x271618[_0x48d4('0x3c')]=qs['sort'](_0x370286[_0x48d4('0x36')][_0x48d4('0x3d')]);_0x271618['where']=qs['filters'](_['pick'](_0x370286[_0x48d4('0x36')],_0x27938a[_0x48d4('0x3e')]),_0x365450);if(_0x370286[_0x48d4('0x36')][_0x48d4('0x3f')]){_0x271618[_0x48d4('0x40')]=_[_0x48d4('0x41')](_0x271618[_0x48d4('0x40')],{'$or':_[_0x48d4('0x30')](_0x365450,function(_0x512161){if(_0x512161[_0x48d4('0x33')]!==_0x48d4('0x42')){var _0x1e1571={};_0x1e1571[_0x512161[_0x48d4('0x2d')]]={'$like':'%'+_0x370286[_0x48d4('0x36')][_0x48d4('0x3f')]+'%'};return _0x1e1571;}})});}_0x271618=_[_0x48d4('0x41')]({},_0x271618,_0x370286[_0x48d4('0x43')]);var _0x4104b4={'where':_0x271618[_0x48d4('0x40')]};return db[_0x48d4('0x31')][_0x48d4('0x20')](_0x4104b4)[_0x48d4('0x28')](function(_0xa8ef85){_0x51fa12['count']=_0xa8ef85;if(_0x370286[_0x48d4('0x36')][_0x48d4('0x44')]){_0x271618[_0x48d4('0x45')]=[{'all':!![]}];}return db[_0x48d4('0x31')][_0x48d4('0x46')](_0x271618);})[_0x48d4('0x28')](function(_0xd81ae1){_0x51fa12[_0x48d4('0x47')]=_0xd81ae1;return _0x51fa12;})['then'](respondWithFilteredResult(_0x5d66b8,_0x271618))[_0x48d4('0x48')](handleError(_0x5d66b8,null));};exports['show']=function(_0x16431b,_0x1a3f5b){var _0x501dcc={'raw':!![],'where':{'id':_0x16431b['params']['id']}},_0x2f013a={};_0x2f013a[_0x48d4('0x35')]=_[_0x48d4('0x37')](db[_0x48d4('0x31')]['rawAttributes']);_0x2f013a[_0x48d4('0x36')]=_[_0x48d4('0x37')](_0x16431b[_0x48d4('0x36')]);_0x2f013a['filters']=_['intersection'](_0x2f013a['model'],_0x2f013a[_0x48d4('0x36')]);_0x501dcc[_0x48d4('0x38')]=_['intersection'](_0x2f013a['model'],qs[_0x48d4('0x3a')](_0x16431b[_0x48d4('0x36')]['fields']));_0x501dcc[_0x48d4('0x38')]=_0x501dcc[_0x48d4('0x38')]['length']?_0x501dcc[_0x48d4('0x38')]:_0x2f013a[_0x48d4('0x35')];if(_0x16431b['query'][_0x48d4('0x44')]){_0x501dcc['include']=[{'all':!![]}];}_0x501dcc=_[_0x48d4('0x41')]({},_0x501dcc,_0x16431b['options']);return db['OpenchannelQueueReport'][_0x48d4('0x49')](_0x501dcc)[_0x48d4('0x28')](handleEntityNotFound(_0x1a3f5b,null))['then'](respondWithResult(_0x1a3f5b,null))[_0x48d4('0x48')](handleError(_0x1a3f5b,null));};exports['create']=function(_0x3b5c4d,_0x46f00e){return db[_0x48d4('0x31')][_0x48d4('0x4a')](_0x3b5c4d[_0x48d4('0x4b')],{})[_0x48d4('0x28')](respondWithResult(_0x46f00e,0xc9))['catch'](handleError(_0x46f00e,null));};exports['update']=function(_0x133828,_0x48ec1f){if(_0x133828[_0x48d4('0x4b')]['id']){delete _0x133828[_0x48d4('0x4b')]['id'];}return db[_0x48d4('0x31')]['find']({'where':{'id':_0x133828[_0x48d4('0x4c')]['id']}})['then'](handleEntityNotFound(_0x48ec1f,null))[_0x48d4('0x28')](saveUpdates(_0x133828['body'],null))['then'](respondWithResult(_0x48ec1f,null))[_0x48d4('0x48')](handleError(_0x48ec1f,null));};exports[_0x48d4('0x29')]=function(_0x5c5620,_0x2297db){return db[_0x48d4('0x31')][_0x48d4('0x49')]({'where':{'id':_0x5c5620[_0x48d4('0x4c')]['id']}})[_0x48d4('0x28')](handleEntityNotFound(_0x2297db,null))[_0x48d4('0x28')](removeEntity(_0x2297db,null))[_0x48d4('0x48')](handleError(_0x2297db,null));};exports[_0x48d4('0x4d')]=function(_0x217139,_0x58a26e){return db['OpenchannelQueueReport']['describe']()[_0x48d4('0x28')](respondWithResult(_0x58a26e,null))[_0x48d4('0x48')](handleError(_0x58a26e,null));};
\ No newline at end of file
+var _0x5b24=['limit','count','set','Content-Range','apply','update','then','error','stack','name','send','map','OpenchannelQueueReport','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','find','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x4f8a62,_0x1ca563){var _0x54994e=function(_0x49d0c8){while(--_0x49d0c8){_0x4f8a62['push'](_0x4f8a62['shift']());}};_0x54994e(++_0x1ca563);}(_0x5b24,0x153));var _0x45b2=function(_0x5d9295,_0x5f5bc6){_0x5d9295=_0x5d9295-0x0;var _0x4f2534=_0x5b24[_0x5d9295];return _0x4f2534;};'use strict';var emlformat=require(_0x45b2('0x0'));var rimraf=require(_0x45b2('0x1'));var zipdir=require(_0x45b2('0x2'));var jsonpatch=require(_0x45b2('0x3'));var rp=require(_0x45b2('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x45b2('0x5'));var util=require(_0x45b2('0x6'));var path=require(_0x45b2('0x7'));var sox=require(_0x45b2('0x8'));var csv=require('to-csv');var ejs=require(_0x45b2('0x9'));var fs=require('fs');var fs_extra=require(_0x45b2('0xa'));var _=require(_0x45b2('0xb'));var squel=require(_0x45b2('0xc'));var crypto=require('crypto');var jsforce=require(_0x45b2('0xd'));var deskjs=require(_0x45b2('0xe'));var toCsv=require('to-csv');var querystring=require(_0x45b2('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x45b2('0x10'));var qs=require(_0x45b2('0x11'));var as=require(_0x45b2('0x12'));var hardwareService=require(_0x45b2('0x13'));var logger=require(_0x45b2('0x14'))(_0x45b2('0x15'));var utils=require('../../config/utils');var config=require(_0x45b2('0x16'));var licenseUtil=require(_0x45b2('0x17'));var db=require(_0x45b2('0x18'))['db'];function respondWithStatusCode(_0x2d92b0,_0x1536e8){_0x1536e8=_0x1536e8||0xcc;return function(_0x2482f6){if(_0x2482f6){return _0x2d92b0[_0x45b2('0x19')](_0x1536e8);}return _0x2d92b0[_0x45b2('0x1a')](_0x1536e8)[_0x45b2('0x1b')]();};}function respondWithResult(_0x4b46af,_0x3a1153){_0x3a1153=_0x3a1153||0xc8;return function(_0x3836a7){if(_0x3836a7){return _0x4b46af[_0x45b2('0x1a')](_0x3a1153)[_0x45b2('0x1c')](_0x3836a7);}};}function respondWithFilteredResult(_0x1ff0ff,_0x4859b6){return function(_0xab198c){if(_0xab198c){var _0x100f5c=typeof _0x4859b6[_0x45b2('0x1d')]===_0x45b2('0x1e')&&typeof _0x4859b6[_0x45b2('0x1f')]===_0x45b2('0x1e');var _0x1c78fd=_0xab198c[_0x45b2('0x20')];var _0x24062f=_0x100f5c?0x0:_0x4859b6['offset'];var _0x397526=_0x100f5c?_0xab198c[_0x45b2('0x20')]:_0x4859b6[_0x45b2('0x1d')]+_0x4859b6[_0x45b2('0x1f')];var _0x49c94d;if(_0x397526>=_0x1c78fd){_0x397526=_0x1c78fd;_0x49c94d=0xc8;}else{_0x49c94d=0xce;}_0x1ff0ff[_0x45b2('0x1a')](_0x49c94d);return _0x1ff0ff[_0x45b2('0x21')](_0x45b2('0x22'),_0x24062f+'-'+_0x397526+'/'+_0x1c78fd)[_0x45b2('0x1c')](_0xab198c);}return null;};}function patchUpdates(_0x57caa1){return function(_0x10f57b){try{jsonpatch[_0x45b2('0x23')](_0x10f57b,_0x57caa1,!![]);}catch(_0x2b7b61){return BPromise['reject'](_0x2b7b61);}return _0x10f57b['save']();};}function saveUpdates(_0x50f169,_0x551bd0){return function(_0x5f1dd8){if(_0x5f1dd8){return _0x5f1dd8[_0x45b2('0x24')](_0x50f169)[_0x45b2('0x25')](function(_0x537d40){return _0x537d40;});}return null;};}function removeEntity(_0x119640,_0x2cb192){return function(_0x3e962a){if(_0x3e962a){return _0x3e962a['destroy']()[_0x45b2('0x25')](function(){_0x119640[_0x45b2('0x1a')](0xcc)[_0x45b2('0x1b')]();});}};}function handleEntityNotFound(_0x35ed37,_0x3a67bf){return function(_0x20114a){if(!_0x20114a){_0x35ed37['sendStatus'](0x194);}return _0x20114a;};}function handleError(_0x1b8f2a,_0x351021){_0x351021=_0x351021||0x1f4;return function(_0x5907b8){logger[_0x45b2('0x26')](_0x5907b8[_0x45b2('0x27')]);if(_0x5907b8[_0x45b2('0x28')]){delete _0x5907b8[_0x45b2('0x28')];}_0x1b8f2a[_0x45b2('0x1a')](_0x351021)[_0x45b2('0x29')](_0x5907b8);};}exports['index']=function(_0x2f67fd,_0x4dfadc){var _0x59cc88={},_0x4843e0={},_0x39fcec={'count':0x0,'rows':[]};var _0xbe1dc6=_[_0x45b2('0x2a')](db[_0x45b2('0x2b')]['rawAttributes'],function(_0x796285){return{'name':_0x796285['fieldName'],'type':_0x796285[_0x45b2('0x2c')][_0x45b2('0x2d')]};});_0x4843e0[_0x45b2('0x2e')]=_[_0x45b2('0x2a')](_0xbe1dc6,_0x45b2('0x28'));_0x4843e0['query']=_[_0x45b2('0x2f')](_0x2f67fd['query']);_0x4843e0[_0x45b2('0x30')]=_[_0x45b2('0x31')](_0x4843e0[_0x45b2('0x2e')],_0x4843e0[_0x45b2('0x32')]);_0x59cc88[_0x45b2('0x33')]=_[_0x45b2('0x31')](_0x4843e0[_0x45b2('0x2e')],qs[_0x45b2('0x34')](_0x2f67fd[_0x45b2('0x32')]['fields']));_0x59cc88[_0x45b2('0x33')]=_0x59cc88['attributes'][_0x45b2('0x35')]?_0x59cc88['attributes']:_0x4843e0['model'];if(!_0x2f67fd[_0x45b2('0x32')][_0x45b2('0x36')](_0x45b2('0x37'))){_0x59cc88['limit']=qs['limit'](_0x2f67fd['query'][_0x45b2('0x1f')]);_0x59cc88[_0x45b2('0x1d')]=qs['offset'](_0x2f67fd[_0x45b2('0x32')]['offset']);}_0x59cc88[_0x45b2('0x38')]=qs['sort'](_0x2f67fd[_0x45b2('0x32')][_0x45b2('0x39')]);_0x59cc88[_0x45b2('0x3a')]=qs[_0x45b2('0x30')](_['pick'](_0x2f67fd['query'],_0x4843e0[_0x45b2('0x30')]),_0xbe1dc6);if(_0x2f67fd['query'][_0x45b2('0x3b')]){_0x59cc88[_0x45b2('0x3a')]=_[_0x45b2('0x3c')](_0x59cc88[_0x45b2('0x3a')],{'$or':_[_0x45b2('0x2a')](_0xbe1dc6,function(_0x558494){if(_0x558494[_0x45b2('0x2c')]!==_0x45b2('0x3d')){var _0x23009b={};_0x23009b[_0x558494[_0x45b2('0x28')]]={'$like':'%'+_0x2f67fd[_0x45b2('0x32')][_0x45b2('0x3b')]+'%'};return _0x23009b;}})});}_0x59cc88=_[_0x45b2('0x3c')]({},_0x59cc88,_0x2f67fd[_0x45b2('0x3e')]);var _0x309a7c={'where':_0x59cc88[_0x45b2('0x3a')]};return db[_0x45b2('0x2b')][_0x45b2('0x20')](_0x309a7c)[_0x45b2('0x25')](function(_0x25bfb5){_0x39fcec[_0x45b2('0x20')]=_0x25bfb5;if(_0x2f67fd[_0x45b2('0x32')][_0x45b2('0x3f')]){_0x59cc88[_0x45b2('0x40')]=[{'all':!![]}];}return db['OpenchannelQueueReport']['findAll'](_0x59cc88);})[_0x45b2('0x25')](function(_0x41dd76){_0x39fcec[_0x45b2('0x41')]=_0x41dd76;return _0x39fcec;})[_0x45b2('0x25')](respondWithFilteredResult(_0x4dfadc,_0x59cc88))[_0x45b2('0x42')](handleError(_0x4dfadc,null));};exports[_0x45b2('0x43')]=function(_0x432ec7,_0x2430fc){var _0x527ac0={'raw':!![],'where':{'id':_0x432ec7['params']['id']}},_0x3cac33={};_0x3cac33[_0x45b2('0x2e')]=_['keys'](db[_0x45b2('0x2b')]['rawAttributes']);_0x3cac33[_0x45b2('0x32')]=_['keys'](_0x432ec7['query']);_0x3cac33[_0x45b2('0x30')]=_[_0x45b2('0x31')](_0x3cac33[_0x45b2('0x2e')],_0x3cac33['query']);_0x527ac0[_0x45b2('0x33')]=_[_0x45b2('0x31')](_0x3cac33[_0x45b2('0x2e')],qs[_0x45b2('0x34')](_0x432ec7[_0x45b2('0x32')][_0x45b2('0x34')]));_0x527ac0[_0x45b2('0x33')]=_0x527ac0['attributes'][_0x45b2('0x35')]?_0x527ac0['attributes']:_0x3cac33[_0x45b2('0x2e')];if(_0x432ec7[_0x45b2('0x32')][_0x45b2('0x3f')]){_0x527ac0['include']=[{'all':!![]}];}_0x527ac0=_[_0x45b2('0x3c')]({},_0x527ac0,_0x432ec7[_0x45b2('0x3e')]);return db[_0x45b2('0x2b')][_0x45b2('0x44')](_0x527ac0)[_0x45b2('0x25')](handleEntityNotFound(_0x2430fc,null))[_0x45b2('0x25')](respondWithResult(_0x2430fc,null))[_0x45b2('0x42')](handleError(_0x2430fc,null));};exports[_0x45b2('0x45')]=function(_0x3188e2,_0x13b295){return db[_0x45b2('0x2b')][_0x45b2('0x45')](_0x3188e2[_0x45b2('0x46')],{})[_0x45b2('0x25')](respondWithResult(_0x13b295,0xc9))['catch'](handleError(_0x13b295,null));};exports[_0x45b2('0x24')]=function(_0x4ac5b6,_0x1c2151){if(_0x4ac5b6['body']['id']){delete _0x4ac5b6[_0x45b2('0x46')]['id'];}return db[_0x45b2('0x2b')][_0x45b2('0x44')]({'where':{'id':_0x4ac5b6[_0x45b2('0x47')]['id']}})['then'](handleEntityNotFound(_0x1c2151,null))[_0x45b2('0x25')](saveUpdates(_0x4ac5b6[_0x45b2('0x46')],null))['then'](respondWithResult(_0x1c2151,null))[_0x45b2('0x42')](handleError(_0x1c2151,null));};exports[_0x45b2('0x48')]=function(_0x1f47a2,_0x477a57){return db['OpenchannelQueueReport'][_0x45b2('0x44')]({'where':{'id':_0x1f47a2[_0x45b2('0x47')]['id']}})['then'](handleEntityNotFound(_0x477a57,null))[_0x45b2('0x25')](removeEntity(_0x477a57,null))[_0x45b2('0x42')](handleError(_0x477a57,null));};exports[_0x45b2('0x49')]=function(_0x2c467d,_0xee6e78){return db[_0x45b2('0x2b')][_0x45b2('0x49')]()[_0x45b2('0x25')](respondWithResult(_0xee6e78,null))[_0x45b2('0x42')](handleError(_0xee6e78,null));};
\ No newline at end of file
index 3151a13..dbeec67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x496426,_0x2c2411){var _0x486679=function(_0x4cc751){while(--_0x4cc751){_0x496426['push'](_0x496426['shift']());}};_0x486679(++_0x2c2411);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0xc4aa[_0x1b2ff7];return _0x31656a;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe14b=['bluebird','path','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','moment'];(function(_0x425d62,_0x58df5d){var _0x6aa13c=function(_0x1bf7c3){while(--_0x1bf7c3){_0x425d62['push'](_0x425d62['shift']());}};_0x6aa13c(++_0x58df5d);}(_0xe14b,0x93));var _0xbe14=function(_0x58015f,_0x4efe8c){_0x58015f=_0x58015f-0x0;var _0x2cba76=_0xe14b[_0x58015f];return _0x2cba76;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 24d3da2..4feaca2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab40=['OpenchannelQueueReport','create','body','options','then','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','raw','attributes','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch'];(function(_0x4ed95d,_0x18bf4b){var _0x184d02=function(_0x371333){while(--_0x371333){_0x4ed95d['push'](_0x4ed95d['shift']());}};_0x184d02(++_0x18bf4b);}(_0xab40,0xcd));var _0x0ab4=function(_0x4dbed2,_0x56fa4e){_0x4dbed2=_0x4dbed2-0x0;var _0x502b9f=_0xab40[_0x4dbed2];return _0x502b9f;};'use strict';var _=require(_0x0ab4('0x0'));var util=require(_0x0ab4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0ab4('0x2'));var db=require(_0x0ab4('0x3'))['db'];var utils=require(_0x0ab4('0x4'));var logger=require(_0x0ab4('0x5'))(_0x0ab4('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0ab4('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10d92b,_0x46d16a,_0x11e99f){return new BPromise(function(_0x6d135d,_0x4cf8de){return client['request'](_0x10d92b,_0x11e99f)['then'](function(_0x24271e){logger[_0x0ab4('0x8')](_0x0ab4('0x9'),_0x46d16a,_0x0ab4('0xa'));logger[_0x0ab4('0xb')](_0x0ab4('0xc'),_0x46d16a,_0x0ab4('0xa'),JSON[_0x0ab4('0xd')](_0x24271e));if(_0x24271e['error']){if(_0x24271e['error'][_0x0ab4('0xe')]===0x1f4){logger['error'](_0x0ab4('0x9'),_0x46d16a,_0x24271e[_0x0ab4('0xf')][_0x0ab4('0x10')]);return _0x4cf8de(_0x24271e[_0x0ab4('0xf')][_0x0ab4('0x10')]);}logger[_0x0ab4('0xf')](_0x0ab4('0x9'),_0x46d16a,_0x24271e[_0x0ab4('0xf')][_0x0ab4('0x10')]);return _0x6d135d(_0x24271e[_0x0ab4('0xf')][_0x0ab4('0x10')]);}else{logger[_0x0ab4('0x8')](_0x0ab4('0x9'),_0x46d16a,_0x0ab4('0xa'));_0x6d135d(_0x24271e[_0x0ab4('0x11')][_0x0ab4('0x10')]);}})[_0x0ab4('0x12')](function(_0x2bdda7){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x46d16a,_0x2bdda7);_0x4cf8de(_0x2bdda7);});});}exports['CreateOpenchannelQueueReport']=function(_0x17422f){var _0x30d5df=this;return new Promise(function(_0x2f50d2,_0x53723c){return db[_0x0ab4('0x13')][_0x0ab4('0x14')](_0x17422f[_0x0ab4('0x15')],{'raw':_0x17422f[_0x0ab4('0x16')]?_0x17422f['options']['raw']===undefined?!![]:![]:!![]})[_0x0ab4('0x17')](function(_0x5b1ed5){logger[_0x0ab4('0x8')](_0x0ab4('0x18'),_0x17422f);logger['debug'](_0x0ab4('0x18'),_0x17422f,JSON[_0x0ab4('0xd')](_0x5b1ed5));_0x2f50d2(_0x5b1ed5);})[_0x0ab4('0x12')](function(_0x1d5c14){logger[_0x0ab4('0xf')]('CreateOpenchannelQueueReport',_0x1d5c14['message'],_0x17422f);_0x53723c(_0x30d5df[_0x0ab4('0xf')](0x1f4,_0x1d5c14[_0x0ab4('0x10')]));});});};exports[_0x0ab4('0x19')]=function(_0x13c882){var _0x4e4b80=this;return new Promise(function(_0x42d2dd,_0x3caa9d){return db[_0x0ab4('0x13')]['update'](_0x13c882['body'],{'raw':_0x13c882[_0x0ab4('0x16')]?_0x13c882[_0x0ab4('0x16')][_0x0ab4('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13c882['options']?_0x13c882['options']['where']||null:null,'attributes':_0x13c882[_0x0ab4('0x16')]?_0x13c882['options'][_0x0ab4('0x1b')]||null:null,'limit':_0x13c882[_0x0ab4('0x16')]?_0x13c882['options']['limit']||null:null})['then'](function(_0x3d38a4){logger[_0x0ab4('0x8')](_0x0ab4('0x19'),_0x13c882);logger[_0x0ab4('0xb')](_0x0ab4('0x19'),_0x13c882,JSON['stringify'](_0x3d38a4));_0x42d2dd(_0x3d38a4);})['catch'](function(_0x580d56){logger[_0x0ab4('0xf')](_0x0ab4('0x19'),_0x580d56[_0x0ab4('0x10')],_0x13c882);_0x3caa9d(_0x4e4b80[_0x0ab4('0xf')](0x1f4,_0x580d56[_0x0ab4('0x10')]));});});};
\ No newline at end of file
+var _0x1775=['info','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','body','options','raw','UpdateOpenchannelQueueReport','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x5cc8b9,_0x20e3c3){var _0x58892e=function(_0x87457a){while(--_0x87457a){_0x5cc8b9['push'](_0x5cc8b9['shift']());}};_0x58892e(++_0x20e3c3);}(_0x1775,0x1db));var _0x5177=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x1775[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x5177('0x0'));var moment=require(_0x5177('0x1'));var BPromise=require(_0x5177('0x2'));var rs=require(_0x5177('0x3'));var fs=require('fs');var Redis=require(_0x5177('0x4'));var db=require(_0x5177('0x5'))['db'];var utils=require(_0x5177('0x6'));var logger=require(_0x5177('0x7'))(_0x5177('0x8'));var config=require(_0x5177('0x9'));var jayson=require(_0x5177('0xa'));var client=jayson[_0x5177('0xb')][_0x5177('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ac1c6,_0x300b43,_0x245c12){return new BPromise(function(_0x363611,_0x3ce288){return client[_0x5177('0xd')](_0x2ac1c6,_0x245c12)[_0x5177('0xe')](function(_0x2c23d8){logger[_0x5177('0xf')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x300b43,'request\x20sent');logger[_0x5177('0x10')](_0x5177('0x11'),_0x300b43,_0x5177('0x12'),JSON[_0x5177('0x13')](_0x2c23d8));if(_0x2c23d8[_0x5177('0x14')]){if(_0x2c23d8['error'][_0x5177('0x15')]===0x1f4){logger[_0x5177('0x14')](_0x5177('0x16'),_0x300b43,_0x2c23d8[_0x5177('0x14')][_0x5177('0x17')]);return _0x3ce288(_0x2c23d8[_0x5177('0x14')][_0x5177('0x17')]);}logger[_0x5177('0x14')](_0x5177('0x16'),_0x300b43,_0x2c23d8[_0x5177('0x14')][_0x5177('0x17')]);return _0x363611(_0x2c23d8[_0x5177('0x14')][_0x5177('0x17')]);}else{logger[_0x5177('0xf')](_0x5177('0x16'),_0x300b43,_0x5177('0x12'));_0x363611(_0x2c23d8[_0x5177('0x18')][_0x5177('0x17')]);}})[_0x5177('0x19')](function(_0x50ce2c){logger[_0x5177('0x14')](_0x5177('0x16'),_0x300b43,_0x50ce2c);_0x3ce288(_0x50ce2c);});});}exports[_0x5177('0x1a')]=function(_0x1b4102){var _0x5f5bd4=this;return new Promise(function(_0x3e6944,_0x2ebf91){return db[_0x5177('0x1b')]['create'](_0x1b4102[_0x5177('0x1c')],{'raw':_0x1b4102['options']?_0x1b4102[_0x5177('0x1d')][_0x5177('0x1e')]===undefined?!![]:![]:!![]})[_0x5177('0xe')](function(_0x27b732){logger[_0x5177('0xf')](_0x5177('0x1a'),_0x1b4102);logger[_0x5177('0x10')](_0x5177('0x1a'),_0x1b4102,JSON[_0x5177('0x13')](_0x27b732));_0x3e6944(_0x27b732);})[_0x5177('0x19')](function(_0x23dad2){logger[_0x5177('0x14')]('CreateOpenchannelQueueReport',_0x23dad2[_0x5177('0x17')],_0x1b4102);_0x2ebf91(_0x5f5bd4['error'](0x1f4,_0x23dad2[_0x5177('0x17')]));});});};exports[_0x5177('0x1f')]=function(_0x3b39b5){var _0x2d51d0=this;return new Promise(function(_0x4bc8e2,_0x2503ef){return db['OpenchannelQueueReport']['update'](_0x3b39b5[_0x5177('0x1c')],{'raw':_0x3b39b5[_0x5177('0x1d')]?_0x3b39b5['options'][_0x5177('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b39b5['options']?_0x3b39b5[_0x5177('0x1d')][_0x5177('0x20')]||null:null,'attributes':_0x3b39b5['options']?_0x3b39b5[_0x5177('0x1d')][_0x5177('0x21')]||null:null,'limit':_0x3b39b5[_0x5177('0x1d')]?_0x3b39b5[_0x5177('0x1d')][_0x5177('0x22')]||null:null})[_0x5177('0xe')](function(_0x5577bb){logger['info'](_0x5177('0x1f'),_0x3b39b5);logger[_0x5177('0x10')](_0x5177('0x1f'),_0x3b39b5,JSON[_0x5177('0x13')](_0x5577bb));_0x4bc8e2(_0x5577bb);})[_0x5177('0x19')](function(_0x8134f9){logger[_0x5177('0x14')](_0x5177('0x1f'),_0x8134f9['message'],_0x3b39b5);_0x2503ef(_0x2d51d0[_0x5177('0x14')](0x1f4,_0x8134f9[_0x5177('0x17')]));});});};
\ No newline at end of file
index 80d0d39..38f35e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8956=['isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get'];(function(_0x42c6f1,_0x338d7b){var _0x3c7398=function(_0x151494){while(--_0x151494){_0x42c6f1['push'](_0x42c6f1['shift']());}};_0x3c7398(++_0x338d7b);}(_0x8956,0x1c0));var _0x6895=function(_0x2d53fe,_0x39539f){_0x2d53fe=_0x2d53fe-0x0;var _0x12552f=_0x8956[_0x2d53fe];return _0x12552f;};'use strict';var multer=require(_0x6895('0x0'));var util=require(_0x6895('0x1'));var path=require(_0x6895('0x2'));var timeout=require(_0x6895('0x3'));var express=require(_0x6895('0x4'));var router=express[_0x6895('0x5')]();var fs_extra=require(_0x6895('0x6'));var auth=require(_0x6895('0x7'));var interaction=require(_0x6895('0x8'));var config=require(_0x6895('0x9'));var controller=require(_0x6895('0xa'));router[_0x6895('0xb')]('/',auth[_0x6895('0xc')](),controller[_0x6895('0xd')]);router[_0x6895('0xb')](_0x6895('0xe'),auth[_0x6895('0xc')](),controller[_0x6895('0xf')]);router['get'](_0x6895('0x10'),auth[_0x6895('0xc')](),controller[_0x6895('0x11')]);router['post']('/',auth[_0x6895('0xc')](),controller[_0x6895('0x12')]);router[_0x6895('0x13')](_0x6895('0x10'),auth[_0x6895('0xc')](),controller[_0x6895('0x14')]);router[_0x6895('0x15')]('/:id',auth[_0x6895('0xc')](),controller['destroy']);module[_0x6895('0x16')]=router;
\ No newline at end of file
+var _0x1609=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','exports'];(function(_0x22e050,_0x810ef6){var _0x2d9a36=function(_0x3c8a34){while(--_0x3c8a34){_0x22e050['push'](_0x22e050['shift']());}};_0x2d9a36(++_0x810ef6);}(_0x1609,0x1e3));var _0x9160=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x1609[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x9160('0x0'));var util=require(_0x9160('0x1'));var path=require(_0x9160('0x2'));var timeout=require(_0x9160('0x3'));var express=require('express');var router=express[_0x9160('0x4')]();var fs_extra=require(_0x9160('0x5'));var auth=require(_0x9160('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9160('0x7'));var controller=require('./openchannelTransferReport.controller');router[_0x9160('0x8')]('/',auth[_0x9160('0x9')](),controller[_0x9160('0xa')]);router[_0x9160('0x8')](_0x9160('0xb'),auth[_0x9160('0x9')](),controller[_0x9160('0xc')]);router['get'](_0x9160('0xd'),auth[_0x9160('0x9')](),controller[_0x9160('0xe')]);router[_0x9160('0xf')]('/',auth['isAuthenticated'](),controller[_0x9160('0x10')]);router['put'](_0x9160('0xd'),auth[_0x9160('0x9')](),controller[_0x9160('0x11')]);router[_0x9160('0x12')](_0x9160('0xd'),auth[_0x9160('0x9')](),controller[_0x9160('0x13')]);module[_0x9160('0x14')]=router;
\ No newline at end of file
index e1d0eb5..8f1e56c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x425716,_0x3e9d1c){var _0x2d39af=function(_0x1febc1){while(--_0x1febc1){_0x425716['push'](_0x425716['shift']());}};_0x2d39af(++_0x3e9d1c);}(_0x9bde,0xe1));var _0xe9bd=function(_0x7693a,_0x2cb180){_0x7693a=_0x7693a-0x0;var _0x4271ab=_0x9bde[_0x7693a];return _0x4271ab;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}};
\ No newline at end of file
+var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x1ef4fb,_0x1d7a2e){var _0x913e66=function(_0x1549cc){while(--_0x1549cc){_0x1ef4fb['push'](_0x1ef4fb['shift']());}};_0x913e66(++_0x1d7a2e);}(_0x00bb,0x1d8));var _0xb00b=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x00bb[_0xc6be3a];return _0x56a310;};'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
index 9d297f5..4110b9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe01b=['key','keys','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','include','OpenchannelTransferReport','rows','catch','params','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type'];(function(_0x999b85,_0x1edc2b){var _0x1d7124=function(_0x59cd29){while(--_0x59cd29){_0x999b85['push'](_0x999b85['shift']());}};_0x1d7124(++_0x1edc2b);}(_0xe01b,0x1e9));var _0xbe01=function(_0x2a5099,_0x329e92){_0x2a5099=_0x2a5099-0x0;var _0x2802f1=_0xe01b[_0x2a5099];return _0x2802f1;};'use strict';var emlformat=require(_0xbe01('0x0'));var rimraf=require(_0xbe01('0x1'));var zipdir=require(_0xbe01('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbe01('0x3'));var moment=require(_0xbe01('0x4'));var BPromise=require(_0xbe01('0x5'));var Mustache=require(_0xbe01('0x6'));var util=require(_0xbe01('0x7'));var path=require(_0xbe01('0x8'));var sox=require(_0xbe01('0x9'));var csv=require(_0xbe01('0xa'));var ejs=require(_0xbe01('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbe01('0xc'));var crypto=require(_0xbe01('0xd'));var jsforce=require(_0xbe01('0xe'));var deskjs=require(_0xbe01('0xf'));var toCsv=require(_0xbe01('0xa'));var querystring=require(_0xbe01('0x10'));var Papa=require('papaparse');var Redis=require(_0xbe01('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xbe01('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe01('0x13'));var logger=require(_0xbe01('0x14'))(_0xbe01('0x15'));var utils=require(_0xbe01('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbe01('0x17'));var db=require(_0xbe01('0x18'))['db'];function respondWithStatusCode(_0x525df6,_0xc13ec7){_0xc13ec7=_0xc13ec7||0xcc;return function(_0x4b6d90){if(_0x4b6d90){return _0x525df6['sendStatus'](_0xc13ec7);}return _0x525df6['status'](_0xc13ec7)[_0xbe01('0x19')]();};}function respondWithResult(_0x36ba05,_0x669c7f){_0x669c7f=_0x669c7f||0xc8;return function(_0x57d743){if(_0x57d743){return _0x36ba05[_0xbe01('0x1a')](_0x669c7f)[_0xbe01('0x1b')](_0x57d743);}};}function respondWithFilteredResult(_0x1a1d2f,_0x5c881e){return function(_0x354a0b){if(_0x354a0b){var _0x230332=typeof _0x5c881e['offset']===_0xbe01('0x1c')&&typeof _0x5c881e[_0xbe01('0x1d')]==='undefined';var _0x22a1cd=_0x354a0b['count'];var _0xfd5a21=_0x230332?0x0:_0x5c881e[_0xbe01('0x1e')];var _0x37c1eb=_0x230332?_0x354a0b[_0xbe01('0x1f')]:_0x5c881e[_0xbe01('0x1e')]+_0x5c881e[_0xbe01('0x1d')];var _0x5b70a1;if(_0x37c1eb>=_0x22a1cd){_0x37c1eb=_0x22a1cd;_0x5b70a1=0xc8;}else{_0x5b70a1=0xce;}_0x1a1d2f[_0xbe01('0x1a')](_0x5b70a1);return _0x1a1d2f[_0xbe01('0x20')](_0xbe01('0x21'),_0xfd5a21+'-'+_0x37c1eb+'/'+_0x22a1cd)[_0xbe01('0x1b')](_0x354a0b);}return null;};}function patchUpdates(_0x5158dc){return function(_0xf67669){try{jsonpatch[_0xbe01('0x22')](_0xf67669,_0x5158dc,!![]);}catch(_0x28c066){return BPromise[_0xbe01('0x23')](_0x28c066);}return _0xf67669[_0xbe01('0x24')]();};}function saveUpdates(_0x56993b,_0x212182){return function(_0x45ce0b){if(_0x45ce0b){return _0x45ce0b[_0xbe01('0x25')](_0x56993b)[_0xbe01('0x26')](function(_0x3b9d2f){return _0x3b9d2f;});}return null;};}function removeEntity(_0x174279,_0x3c6a99){return function(_0x5cef29){if(_0x5cef29){return _0x5cef29[_0xbe01('0x27')]()[_0xbe01('0x26')](function(){_0x174279[_0xbe01('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15c1e0,_0x26c457){return function(_0x387a39){if(!_0x387a39){_0x15c1e0[_0xbe01('0x28')](0x194);}return _0x387a39;};}function handleError(_0x5007d8,_0x552e59){_0x552e59=_0x552e59||0x1f4;return function(_0x41638a){logger[_0xbe01('0x29')](_0x41638a[_0xbe01('0x2a')]);if(_0x41638a[_0xbe01('0x2b')]){delete _0x41638a[_0xbe01('0x2b')];}_0x5007d8['status'](_0x552e59)[_0xbe01('0x2c')](_0x41638a);};}exports[_0xbe01('0x2d')]=function(_0x1a1e65,_0x1b7654){var _0xa8c0d9={},_0x1a609d={},_0x4bdbfb={'count':0x0,'rows':[]};var _0xa4d815=_[_0xbe01('0x2e')](db['OpenchannelTransferReport'][_0xbe01('0x2f')],function(_0x51d4ff){return{'name':_0x51d4ff[_0xbe01('0x30')],'type':_0x51d4ff[_0xbe01('0x31')][_0xbe01('0x32')]};});_0x1a609d['model']=_[_0xbe01('0x2e')](_0xa4d815,'name');_0x1a609d['query']=_[_0xbe01('0x33')](_0x1a1e65[_0xbe01('0x34')]);_0x1a609d['filters']=_[_0xbe01('0x35')](_0x1a609d['model'],_0x1a609d[_0xbe01('0x34')]);_0xa8c0d9[_0xbe01('0x36')]=_[_0xbe01('0x35')](_0x1a609d[_0xbe01('0x37')],qs[_0xbe01('0x38')](_0x1a1e65['query'][_0xbe01('0x38')]));_0xa8c0d9[_0xbe01('0x36')]=_0xa8c0d9[_0xbe01('0x36')][_0xbe01('0x39')]?_0xa8c0d9['attributes']:_0x1a609d[_0xbe01('0x37')];if(!_0x1a1e65[_0xbe01('0x34')][_0xbe01('0x3a')](_0xbe01('0x3b'))){_0xa8c0d9['limit']=qs['limit'](_0x1a1e65[_0xbe01('0x34')][_0xbe01('0x1d')]);_0xa8c0d9[_0xbe01('0x1e')]=qs[_0xbe01('0x1e')](_0x1a1e65[_0xbe01('0x34')][_0xbe01('0x1e')]);}_0xa8c0d9['order']=qs[_0xbe01('0x3c')](_0x1a1e65[_0xbe01('0x34')][_0xbe01('0x3c')]);_0xa8c0d9[_0xbe01('0x3d')]=qs[_0xbe01('0x3e')](_['pick'](_0x1a1e65['query'],_0x1a609d[_0xbe01('0x3e')]),_0xa4d815);if(_0x1a1e65[_0xbe01('0x34')][_0xbe01('0x3f')]){_0xa8c0d9[_0xbe01('0x3d')]=_[_0xbe01('0x40')](_0xa8c0d9['where'],{'$or':_['map'](_0xa4d815,function(_0x4cdd00){if(_0x4cdd00[_0xbe01('0x31')]!==_0xbe01('0x41')){var _0x383f0a={};_0x383f0a[_0x4cdd00[_0xbe01('0x2b')]]={'$like':'%'+_0x1a1e65[_0xbe01('0x34')][_0xbe01('0x3f')]+'%'};return _0x383f0a;}})});}_0xa8c0d9=_[_0xbe01('0x40')]({},_0xa8c0d9,_0x1a1e65[_0xbe01('0x42')]);var _0x1d5a99={'where':_0xa8c0d9['where']};return db['OpenchannelTransferReport'][_0xbe01('0x1f')](_0x1d5a99)['then'](function(_0x5abd38){_0x4bdbfb[_0xbe01('0x1f')]=_0x5abd38;if(_0x1a1e65['query']['includeAll']){_0xa8c0d9[_0xbe01('0x43')]=[{'all':!![]}];}return db[_0xbe01('0x44')]['findAll'](_0xa8c0d9);})['then'](function(_0x6f1827){_0x4bdbfb[_0xbe01('0x45')]=_0x6f1827;return _0x4bdbfb;})[_0xbe01('0x26')](respondWithFilteredResult(_0x1b7654,_0xa8c0d9))[_0xbe01('0x46')](handleError(_0x1b7654,null));};exports['show']=function(_0x8015da,_0x53b25f){var _0x3ec3d4={'raw':!![],'where':{'id':_0x8015da[_0xbe01('0x47')]['id']}},_0x289524={};_0x289524[_0xbe01('0x37')]=_['keys'](db['OpenchannelTransferReport']['rawAttributes']);_0x289524[_0xbe01('0x34')]=_[_0xbe01('0x33')](_0x8015da[_0xbe01('0x34')]);_0x289524[_0xbe01('0x3e')]=_['intersection'](_0x289524[_0xbe01('0x37')],_0x289524['query']);_0x3ec3d4[_0xbe01('0x36')]=_['intersection'](_0x289524[_0xbe01('0x37')],qs[_0xbe01('0x38')](_0x8015da[_0xbe01('0x34')][_0xbe01('0x38')]));_0x3ec3d4['attributes']=_0x3ec3d4[_0xbe01('0x36')][_0xbe01('0x39')]?_0x3ec3d4['attributes']:_0x289524[_0xbe01('0x37')];if(_0x8015da[_0xbe01('0x34')][_0xbe01('0x48')]){_0x3ec3d4[_0xbe01('0x43')]=[{'all':!![]}];}_0x3ec3d4=_[_0xbe01('0x40')]({},_0x3ec3d4,_0x8015da[_0xbe01('0x42')]);return db['OpenchannelTransferReport'][_0xbe01('0x49')](_0x3ec3d4)[_0xbe01('0x26')](handleEntityNotFound(_0x53b25f,null))['then'](respondWithResult(_0x53b25f,null))[_0xbe01('0x46')](handleError(_0x53b25f,null));};exports[_0xbe01('0x4a')]=function(_0x51312d,_0x5a7dae){return db[_0xbe01('0x44')][_0xbe01('0x4a')](_0x51312d[_0xbe01('0x4b')],{})[_0xbe01('0x26')](respondWithResult(_0x5a7dae,0xc9))[_0xbe01('0x46')](handleError(_0x5a7dae,null));};exports[_0xbe01('0x25')]=function(_0x2a2928,_0x6de137){if(_0x2a2928[_0xbe01('0x4b')]['id']){delete _0x2a2928[_0xbe01('0x4b')]['id'];}return db[_0xbe01('0x44')][_0xbe01('0x49')]({'where':{'id':_0x2a2928['params']['id']}})['then'](handleEntityNotFound(_0x6de137,null))[_0xbe01('0x26')](saveUpdates(_0x2a2928[_0xbe01('0x4b')],null))[_0xbe01('0x26')](respondWithResult(_0x6de137,null))[_0xbe01('0x46')](handleError(_0x6de137,null));};exports[_0xbe01('0x27')]=function(_0x40afc4,_0x2cf672){return db['OpenchannelTransferReport'][_0xbe01('0x49')]({'where':{'id':_0x40afc4[_0xbe01('0x47')]['id']}})[_0xbe01('0x26')](handleEntityNotFound(_0x2cf672,null))[_0xbe01('0x26')](removeEntity(_0x2cf672,null))[_0xbe01('0x46')](handleError(_0x2cf672,null));};exports[_0xbe01('0x4c')]=function(_0x306d8b,_0xf2ecf6){return db[_0xbe01('0x44')][_0xbe01('0x4c')]()[_0xbe01('0x26')](respondWithResult(_0xf2ecf6,null))[_0xbe01('0x46')](handleError(_0xf2ecf6,null));};
\ No newline at end of file
+var _0x8278=['type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','OpenchannelTransferReport','fieldName'];(function(_0x37ae26,_0x2ecd70){var _0x1b1902=function(_0x5a6ae0){while(--_0x5a6ae0){_0x37ae26['push'](_0x37ae26['shift']());}};_0x1b1902(++_0x2ecd70);}(_0x8278,0x1e5));var _0x8827=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8278[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x8827('0x0'));var rimraf=require(_0x8827('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8827('0x2'));var BPromise=require(_0x8827('0x3'));var Mustache=require(_0x8827('0x4'));var util=require(_0x8827('0x5'));var path=require('path');var sox=require(_0x8827('0x6'));var csv=require(_0x8827('0x7'));var ejs=require(_0x8827('0x8'));var fs=require('fs');var fs_extra=require(_0x8827('0x9'));var _=require(_0x8827('0xa'));var squel=require(_0x8827('0xb'));var crypto=require(_0x8827('0xc'));var jsforce=require(_0x8827('0xd'));var deskjs=require(_0x8827('0xe'));var toCsv=require(_0x8827('0x7'));var querystring=require(_0x8827('0xf'));var Papa=require(_0x8827('0x10'));var Redis=require(_0x8827('0x11'));var authService=require(_0x8827('0x12'));var qs=require(_0x8827('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8827('0x14'))(_0x8827('0x15'));var utils=require('../../config/utils');var config=require(_0x8827('0x16'));var licenseUtil=require(_0x8827('0x17'));var db=require(_0x8827('0x18'))['db'];function respondWithStatusCode(_0x45200d,_0x3eb83d){_0x3eb83d=_0x3eb83d||0xcc;return function(_0xf57f09){if(_0xf57f09){return _0x45200d[_0x8827('0x19')](_0x3eb83d);}return _0x45200d[_0x8827('0x1a')](_0x3eb83d)[_0x8827('0x1b')]();};}function respondWithResult(_0x3fdf70,_0xcf4cef){_0xcf4cef=_0xcf4cef||0xc8;return function(_0x33088f){if(_0x33088f){return _0x3fdf70[_0x8827('0x1a')](_0xcf4cef)[_0x8827('0x1c')](_0x33088f);}};}function respondWithFilteredResult(_0x21cfe9,_0xdec788){return function(_0x35cfa6){if(_0x35cfa6){var _0xaf0bf1=typeof _0xdec788[_0x8827('0x1d')]===_0x8827('0x1e')&&typeof _0xdec788['limit']===_0x8827('0x1e');var _0x40b5c5=_0x35cfa6[_0x8827('0x1f')];var _0x4d5f6e=_0xaf0bf1?0x0:_0xdec788[_0x8827('0x1d')];var _0x391d98=_0xaf0bf1?_0x35cfa6[_0x8827('0x1f')]:_0xdec788[_0x8827('0x1d')]+_0xdec788[_0x8827('0x20')];var _0x33fa4f;if(_0x391d98>=_0x40b5c5){_0x391d98=_0x40b5c5;_0x33fa4f=0xc8;}else{_0x33fa4f=0xce;}_0x21cfe9[_0x8827('0x1a')](_0x33fa4f);return _0x21cfe9['set'](_0x8827('0x21'),_0x4d5f6e+'-'+_0x391d98+'/'+_0x40b5c5)[_0x8827('0x1c')](_0x35cfa6);}return null;};}function patchUpdates(_0x4cc938){return function(_0x5077b3){try{jsonpatch['apply'](_0x5077b3,_0x4cc938,!![]);}catch(_0x472732){return BPromise[_0x8827('0x22')](_0x472732);}return _0x5077b3[_0x8827('0x23')]();};}function saveUpdates(_0x113f3f,_0xf60fb2){return function(_0x3466ae){if(_0x3466ae){return _0x3466ae[_0x8827('0x24')](_0x113f3f)[_0x8827('0x25')](function(_0x1ae411){return _0x1ae411;});}return null;};}function removeEntity(_0xd07ac9,_0x404667){return function(_0x56dd1f){if(_0x56dd1f){return _0x56dd1f[_0x8827('0x26')]()[_0x8827('0x25')](function(){_0xd07ac9[_0x8827('0x1a')](0xcc)[_0x8827('0x1b')]();});}};}function handleEntityNotFound(_0x1b7640,_0x55f1c9){return function(_0x24a83c){if(!_0x24a83c){_0x1b7640['sendStatus'](0x194);}return _0x24a83c;};}function handleError(_0x610349,_0x5972a2){_0x5972a2=_0x5972a2||0x1f4;return function(_0x1b316e){logger[_0x8827('0x27')](_0x1b316e[_0x8827('0x28')]);if(_0x1b316e[_0x8827('0x29')]){delete _0x1b316e[_0x8827('0x29')];}_0x610349[_0x8827('0x1a')](_0x5972a2)[_0x8827('0x2a')](_0x1b316e);};}exports[_0x8827('0x2b')]=function(_0x1639c0,_0x11dcf6){var _0x305b28={},_0x2dd11d={},_0x4f3981={'count':0x0,'rows':[]};var _0x5b0de8=_[_0x8827('0x2c')](db[_0x8827('0x2d')]['rawAttributes'],function(_0x93af3e){return{'name':_0x93af3e[_0x8827('0x2e')],'type':_0x93af3e[_0x8827('0x2f')][_0x8827('0x30')]};});_0x2dd11d['model']=_['map'](_0x5b0de8,_0x8827('0x29'));_0x2dd11d[_0x8827('0x31')]=_[_0x8827('0x32')](_0x1639c0[_0x8827('0x31')]);_0x2dd11d[_0x8827('0x33')]=_[_0x8827('0x34')](_0x2dd11d[_0x8827('0x35')],_0x2dd11d['query']);_0x305b28['attributes']=_[_0x8827('0x34')](_0x2dd11d[_0x8827('0x35')],qs[_0x8827('0x36')](_0x1639c0[_0x8827('0x31')][_0x8827('0x36')]));_0x305b28[_0x8827('0x37')]=_0x305b28['attributes'][_0x8827('0x38')]?_0x305b28['attributes']:_0x2dd11d[_0x8827('0x35')];if(!_0x1639c0[_0x8827('0x31')][_0x8827('0x39')](_0x8827('0x3a'))){_0x305b28['limit']=qs[_0x8827('0x20')](_0x1639c0[_0x8827('0x31')][_0x8827('0x20')]);_0x305b28[_0x8827('0x1d')]=qs['offset'](_0x1639c0[_0x8827('0x31')][_0x8827('0x1d')]);}_0x305b28[_0x8827('0x3b')]=qs[_0x8827('0x3c')](_0x1639c0[_0x8827('0x31')][_0x8827('0x3c')]);_0x305b28[_0x8827('0x3d')]=qs[_0x8827('0x33')](_[_0x8827('0x3e')](_0x1639c0['query'],_0x2dd11d['filters']),_0x5b0de8);if(_0x1639c0[_0x8827('0x31')][_0x8827('0x3f')]){_0x305b28[_0x8827('0x3d')]=_['merge'](_0x305b28[_0x8827('0x3d')],{'$or':_[_0x8827('0x2c')](_0x5b0de8,function(_0x379683){if(_0x379683[_0x8827('0x2f')]!==_0x8827('0x40')){var _0x2ef6f1={};_0x2ef6f1[_0x379683[_0x8827('0x29')]]={'$like':'%'+_0x1639c0[_0x8827('0x31')][_0x8827('0x3f')]+'%'};return _0x2ef6f1;}})});}_0x305b28=_[_0x8827('0x41')]({},_0x305b28,_0x1639c0[_0x8827('0x42')]);var _0x188ae8={'where':_0x305b28[_0x8827('0x3d')]};return db[_0x8827('0x2d')][_0x8827('0x1f')](_0x188ae8)[_0x8827('0x25')](function(_0x31a144){_0x4f3981['count']=_0x31a144;if(_0x1639c0['query']['includeAll']){_0x305b28['include']=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x8827('0x43')](_0x305b28);})[_0x8827('0x25')](function(_0x1b84b8){_0x4f3981[_0x8827('0x44')]=_0x1b84b8;return _0x4f3981;})['then'](respondWithFilteredResult(_0x11dcf6,_0x305b28))[_0x8827('0x45')](handleError(_0x11dcf6,null));};exports[_0x8827('0x46')]=function(_0x143040,_0xab306c){var _0x3af7f9={'raw':!![],'where':{'id':_0x143040[_0x8827('0x47')]['id']}},_0x2391a3={};_0x2391a3['model']=_[_0x8827('0x32')](db[_0x8827('0x2d')]['rawAttributes']);_0x2391a3[_0x8827('0x31')]=_['keys'](_0x143040[_0x8827('0x31')]);_0x2391a3['filters']=_[_0x8827('0x34')](_0x2391a3[_0x8827('0x35')],_0x2391a3[_0x8827('0x31')]);_0x3af7f9[_0x8827('0x37')]=_[_0x8827('0x34')](_0x2391a3[_0x8827('0x35')],qs[_0x8827('0x36')](_0x143040[_0x8827('0x31')]['fields']));_0x3af7f9['attributes']=_0x3af7f9[_0x8827('0x37')]['length']?_0x3af7f9['attributes']:_0x2391a3[_0x8827('0x35')];if(_0x143040[_0x8827('0x31')]['includeAll']){_0x3af7f9['include']=[{'all':!![]}];}_0x3af7f9=_[_0x8827('0x41')]({},_0x3af7f9,_0x143040['options']);return db[_0x8827('0x2d')][_0x8827('0x48')](_0x3af7f9)['then'](handleEntityNotFound(_0xab306c,null))[_0x8827('0x25')](respondWithResult(_0xab306c,null))[_0x8827('0x45')](handleError(_0xab306c,null));};exports[_0x8827('0x49')]=function(_0x461074,_0x27e868){return db[_0x8827('0x2d')][_0x8827('0x49')](_0x461074['body'],{})[_0x8827('0x25')](respondWithResult(_0x27e868,0xc9))[_0x8827('0x45')](handleError(_0x27e868,null));};exports[_0x8827('0x24')]=function(_0x2829e6,_0x1331b7){if(_0x2829e6[_0x8827('0x4a')]['id']){delete _0x2829e6['body']['id'];}return db[_0x8827('0x2d')][_0x8827('0x48')]({'where':{'id':_0x2829e6[_0x8827('0x47')]['id']}})[_0x8827('0x25')](handleEntityNotFound(_0x1331b7,null))['then'](saveUpdates(_0x2829e6['body'],null))[_0x8827('0x25')](respondWithResult(_0x1331b7,null))[_0x8827('0x45')](handleError(_0x1331b7,null));};exports['destroy']=function(_0x594dbf,_0x20b450){return db[_0x8827('0x2d')][_0x8827('0x48')]({'where':{'id':_0x594dbf['params']['id']}})[_0x8827('0x25')](handleEntityNotFound(_0x20b450,null))['then'](removeEntity(_0x20b450,null))[_0x8827('0x45')](handleError(_0x20b450,null));};exports['describe']=function(_0x67d248,_0x52d79d){return db[_0x8827('0x2d')][_0x8827('0x4b')]()[_0x8827('0x25')](respondWithResult(_0x52d79d,null))[_0x8827('0x45')](handleError(_0x52d79d,null));};
\ No newline at end of file
index 101ea7e..9c4c819 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6d4=['./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x4d22c0,_0x2a3e7b){var _0x1b2417=function(_0x5d16ea){while(--_0x5d16ea){_0x4d22c0['push'](_0x4d22c0['shift']());}};_0x1b2417(++_0x2a3e7b);}(_0xb6d4,0x171));var _0x4b6d=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xb6d4[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x4b6d('0x0'));var util=require(_0x4b6d('0x1'));var logger=require(_0x4b6d('0x2'))(_0x4b6d('0x3'));var moment=require(_0x4b6d('0x4'));var BPromise=require(_0x4b6d('0x5'));var rp=require(_0x4b6d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4b6d('0x7'));var attributes=require(_0x4b6d('0x8'));module[_0x4b6d('0x9')]=function(_0x56928f,_0x2b70a5){return _0x56928f[_0x4b6d('0xa')](_0x4b6d('0xb'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x4b6d('0xc'),'fields':[_0x4b6d('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbdd7=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','define','OpenchannelTransferReport','uniqueid','lodash','util','../../config/logger','api'];(function(_0xfcec2b,_0x10c217){var _0x53104c=function(_0x1f33c8){while(--_0x1f33c8){_0xfcec2b['push'](_0xfcec2b['shift']());}};_0x53104c(++_0x10c217);}(_0xbdd7,0xa4));var _0x7bdd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbdd7[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7bdd('0x0'));var util=require(_0x7bdd('0x1'));var logger=require(_0x7bdd('0x2'))(_0x7bdd('0x3'));var moment=require(_0x7bdd('0x4'));var BPromise=require(_0x7bdd('0x5'));var rp=require(_0x7bdd('0x6'));var fs=require('fs');var path=require(_0x7bdd('0x7'));var rimraf=require(_0x7bdd('0x8'));var config=require(_0x7bdd('0x9'));var attributes=require(_0x7bdd('0xa'));module['exports']=function(_0x440e97,_0x52b82c){return _0x440e97[_0x7bdd('0xb')](_0x7bdd('0xc'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x7bdd('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index db9ea3a..c8258e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e65=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','OpenchannelTransferReport,\x20%s,\x20%s','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0xcafc2c,_0xe250ce){var _0x338d5b=function(_0x44ef20){while(--_0x44ef20){_0xcafc2c['push'](_0xcafc2c['shift']());}};_0x338d5b(++_0xe250ce);}(_0x2e65,0x193));var _0x52e6=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0x2e65[_0x3305de];return _0x3b5a84;};'use strict';var _=require(_0x52e6('0x0'));var util=require(_0x52e6('0x1'));var moment=require(_0x52e6('0x2'));var BPromise=require(_0x52e6('0x3'));var rs=require(_0x52e6('0x4'));var fs=require('fs');var Redis=require(_0x52e6('0x5'));var db=require(_0x52e6('0x6'))['db'];var utils=require(_0x52e6('0x7'));var logger=require('../../config/logger')(_0x52e6('0x8'));var config=require(_0x52e6('0x9'));var jayson=require(_0x52e6('0xa'));var client=jayson[_0x52e6('0xb')][_0x52e6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x116651,_0x15e4af,_0x1401a3){return new BPromise(function(_0x27f270,_0x2ab17e){return client['request'](_0x116651,_0x1401a3)[_0x52e6('0xd')](function(_0x1db169){logger['info'](_0x52e6('0xe'),_0x15e4af,'request\x20sent');logger['debug'](_0x52e6('0xf'),_0x15e4af,_0x52e6('0x10'),JSON[_0x52e6('0x11')](_0x1db169));if(_0x1db169[_0x52e6('0x12')]){if(_0x1db169[_0x52e6('0x12')][_0x52e6('0x13')]===0x1f4){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x15e4af,_0x1db169[_0x52e6('0x12')][_0x52e6('0x14')]);return _0x2ab17e(_0x1db169['error'][_0x52e6('0x14')]);}logger[_0x52e6('0x12')](_0x52e6('0xe'),_0x15e4af,_0x1db169[_0x52e6('0x12')][_0x52e6('0x14')]);return _0x27f270(_0x1db169[_0x52e6('0x12')][_0x52e6('0x14')]);}else{logger[_0x52e6('0x15')](_0x52e6('0xe'),_0x15e4af,_0x52e6('0x10'));_0x27f270(_0x1db169[_0x52e6('0x16')][_0x52e6('0x14')]);}})[_0x52e6('0x17')](function(_0x5c275c){logger['error'](_0x52e6('0xe'),_0x15e4af,_0x5c275c);_0x2ab17e(_0x5c275c);});});}
\ No newline at end of file
+var _0x46fc=['OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x2c602e,_0x1d26f5){var _0x1a2650=function(_0x2370d1){while(--_0x2370d1){_0x2c602e['push'](_0x2c602e['shift']());}};_0x1a2650(++_0x1d26f5);}(_0x46fc,0x103));var _0xc46f=function(_0x1a560b,_0x2b82be){_0x1a560b=_0x1a560b-0x0;var _0x4bc46e=_0x46fc[_0x1a560b];return _0x4bc46e;};'use strict';var _=require(_0xc46f('0x0'));var util=require(_0xc46f('0x1'));var moment=require(_0xc46f('0x2'));var BPromise=require(_0xc46f('0x3'));var rs=require(_0xc46f('0x4'));var fs=require('fs');var Redis=require(_0xc46f('0x5'));var db=require(_0xc46f('0x6'))['db'];var utils=require(_0xc46f('0x7'));var logger=require(_0xc46f('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc46f('0x9'));var client=jayson[_0xc46f('0xa')][_0xc46f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x15904c,_0x1f5ac8,_0x312101){return new BPromise(function(_0x155a10,_0x327019){return client[_0xc46f('0xc')](_0x15904c,_0x312101)[_0xc46f('0xd')](function(_0x1bd18f){logger[_0xc46f('0xe')](_0xc46f('0xf'),_0x1f5ac8,_0xc46f('0x10'));logger['debug'](_0xc46f('0x11'),_0x1f5ac8,_0xc46f('0x10'),JSON[_0xc46f('0x12')](_0x1bd18f));if(_0x1bd18f[_0xc46f('0x13')]){if(_0x1bd18f['error']['code']===0x1f4){logger['error'](_0xc46f('0xf'),_0x1f5ac8,_0x1bd18f[_0xc46f('0x13')]['message']);return _0x327019(_0x1bd18f[_0xc46f('0x13')][_0xc46f('0x14')]);}logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x1f5ac8,_0x1bd18f[_0xc46f('0x13')][_0xc46f('0x14')]);return _0x155a10(_0x1bd18f[_0xc46f('0x13')][_0xc46f('0x14')]);}else{logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x1f5ac8,'request\x20sent');_0x155a10(_0x1bd18f[_0xc46f('0x15')][_0xc46f('0x14')]);}})[_0xc46f('0x16')](function(_0x516238){logger[_0xc46f('0x13')](_0xc46f('0xf'),_0x1f5ac8,_0x516238);_0x327019(_0x516238);});});}
\ No newline at end of file
index 29fa848..8f53f3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41a7=['show','post','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x41a7,0x15d));var _0x741a=function(_0x5f1a6d,_0x15aebc){_0x5f1a6d=_0x5f1a6d-0x0;var _0x1ac4e2=_0x41a7[_0x5f1a6d];return _0x1ac4e2;};'use strict';var multer=require(_0x741a('0x0'));var util=require('util');var path=require(_0x741a('0x1'));var timeout=require(_0x741a('0x2'));var express=require(_0x741a('0x3'));var router=express['Router']();var fs_extra=require(_0x741a('0x4'));var auth=require(_0x741a('0x5'));var interaction=require(_0x741a('0x6'));var config=require(_0x741a('0x7'));var controller=require(_0x741a('0x8'));router[_0x741a('0x9')]('/',auth[_0x741a('0xa')](),controller['index']);router['get']('/:id',auth[_0x741a('0xa')](),controller[_0x741a('0xb')]);router[_0x741a('0xc')]('/',auth[_0x741a('0xa')](),controller[_0x741a('0xd')]);router[_0x741a('0xe')](_0x741a('0xf'),auth[_0x741a('0xa')](),controller[_0x741a('0x10')]);router[_0x741a('0x11')](_0x741a('0xf'),auth[_0x741a('0xa')](),controller[_0x741a('0x12')]);module[_0x741a('0x13')]=router;
\ No newline at end of file
+var _0xab3a=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','/:id','show','post','create'];(function(_0x5cc118,_0x479136){var _0x87ff2b=function(_0x2e3aa7){while(--_0x2e3aa7){_0x5cc118['push'](_0x5cc118['shift']());}};_0x87ff2b(++_0x479136);}(_0xab3a,0x1d3));var _0xaab3=function(_0x593752,_0xfc3827){_0x593752=_0x593752-0x0;var _0x4612be=_0xab3a[_0x593752];return _0x4612be;};'use strict';var multer=require(_0xaab3('0x0'));var util=require(_0xaab3('0x1'));var path=require(_0xaab3('0x2'));var timeout=require(_0xaab3('0x3'));var express=require(_0xaab3('0x4'));var router=express[_0xaab3('0x5')]();var fs_extra=require(_0xaab3('0x6'));var auth=require(_0xaab3('0x7'));var interaction=require(_0xaab3('0x8'));var config=require(_0xaab3('0x9'));var controller=require(_0xaab3('0xa'));router[_0xaab3('0xb')]('/',auth[_0xaab3('0xc')](),controller['index']);router['get'](_0xaab3('0xd'),auth[_0xaab3('0xc')](),controller[_0xaab3('0xe')]);router[_0xaab3('0xf')]('/',auth[_0xaab3('0xc')](),controller[_0xaab3('0x10')]);router[_0xaab3('0x11')](_0xaab3('0xd'),auth[_0xaab3('0xc')](),controller[_0xaab3('0x12')]);router[_0xaab3('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xaab3('0x14')]);module[_0xaab3('0x15')]=router;
\ No newline at end of file
index d163256..0c2846e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x25d3=['exports','STRING','sequelize'];(function(_0x7c2164,_0x478746){var _0x269a0b=function(_0x23ff69){while(--_0x23ff69){_0x7c2164['push'](_0x7c2164['shift']());}};_0x269a0b(++_0x478746);}(_0x25d3,0x1b2));var _0x325d=function(_0xc3b43f,_0x48e31b){_0xc3b43f=_0xc3b43f-0x0;var _0x5e6eb3=_0x25d3[_0xc3b43f];return _0x5e6eb3;};'use strict';var Sequelize=require(_0x325d('0x0'));module[_0x325d('0x1')]={'name':{'type':Sequelize[_0x325d('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x325d('0x2')]}};
\ No newline at end of file
+var _0x5d76=['sequelize','STRING','name'];(function(_0x7f4e26,_0x25d101){var _0xbb398a=function(_0x4d96fe){while(--_0x4d96fe){_0x7f4e26['push'](_0x7f4e26['shift']());}};_0xbb398a(++_0x25d101);}(_0x5d76,0xae));var _0x65d7=function(_0x25208f,_0x795a68){_0x25208f=_0x25208f-0x0;var _0x21626a=_0x5d76[_0x25208f];return _0x21626a;};'use strict';var Sequelize=require(_0x65d7('0x0'));module['exports']={'name':{'type':Sequelize[_0x65d7('0x1')],'unique':_0x65d7('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x65d7('0x1')]}};
\ No newline at end of file
index 099e293..e2c72e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc303=['../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','Pauses','UserProfileResource','error','name','send','index','map','Pause','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','show','params','fields','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse'];(function(_0x1edc02,_0x345635){var _0x3ff4fc=function(_0xa1256c){while(--_0xa1256c){_0x1edc02['push'](_0x1edc02['shift']());}};_0x3ff4fc(++_0x345635);}(_0xc303,0x92));var _0x3c30=function(_0x221ba2,_0x79208){_0x221ba2=_0x221ba2-0x0;var _0x47d08e=_0xc303[_0x221ba2];return _0x47d08e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3c30('0x0'));var zipdir=require(_0x3c30('0x1'));var jsonpatch=require(_0x3c30('0x2'));var rp=require(_0x3c30('0x3'));var moment=require(_0x3c30('0x4'));var BPromise=require(_0x3c30('0x5'));var Mustache=require(_0x3c30('0x6'));var util=require(_0x3c30('0x7'));var path=require('path');var sox=require(_0x3c30('0x8'));var csv=require(_0x3c30('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3c30('0xa'));var _=require(_0x3c30('0xb'));var squel=require(_0x3c30('0xc'));var crypto=require('crypto');var jsforce=require(_0x3c30('0xd'));var deskjs=require(_0x3c30('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3c30('0xf'));var Redis=require('ioredis');var authService=require(_0x3c30('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3c30('0x11'))(_0x3c30('0x12'));var utils=require(_0x3c30('0x13'));var config=require(_0x3c30('0x14'));var licenseUtil=require(_0x3c30('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x245483,_0x5e5328){_0x5e5328=_0x5e5328||0xcc;return function(_0x21c90d){if(_0x21c90d){return _0x245483[_0x3c30('0x16')](_0x5e5328);}return _0x245483[_0x3c30('0x17')](_0x5e5328)[_0x3c30('0x18')]();};}function respondWithResult(_0x44de7e,_0x46c16c){_0x46c16c=_0x46c16c||0xc8;return function(_0xe81bcc){if(_0xe81bcc){return _0x44de7e[_0x3c30('0x17')](_0x46c16c)[_0x3c30('0x19')](_0xe81bcc);}};}function respondWithFilteredResult(_0xa1a346,_0x1a81cd){return function(_0xc5bd0f){if(_0xc5bd0f){var _0x567875=typeof _0x1a81cd['offset']==='undefined'&&typeof _0x1a81cd['limit']==='undefined';var _0x570233=_0xc5bd0f[_0x3c30('0x1a')];var _0x341cea=_0x567875?0x0:_0x1a81cd[_0x3c30('0x1b')];var _0x43a094=_0x567875?_0xc5bd0f[_0x3c30('0x1a')]:_0x1a81cd['offset']+_0x1a81cd[_0x3c30('0x1c')];var _0x4045dd;if(_0x43a094>=_0x570233){_0x43a094=_0x570233;_0x4045dd=0xc8;}else{_0x4045dd=0xce;}_0xa1a346[_0x3c30('0x17')](_0x4045dd);return _0xa1a346[_0x3c30('0x1d')]('Content-Range',_0x341cea+'-'+_0x43a094+'/'+_0x570233)[_0x3c30('0x19')](_0xc5bd0f);}return null;};}function patchUpdates(_0x46f2d6){return function(_0x186146){try{jsonpatch[_0x3c30('0x1e')](_0x186146,_0x46f2d6,!![]);}catch(_0x3650c2){return BPromise[_0x3c30('0x1f')](_0x3650c2);}return _0x186146[_0x3c30('0x20')]();};}function saveUpdates(_0x256255,_0x15eb74){return function(_0x86f859){if(_0x86f859){return _0x86f859[_0x3c30('0x21')](_0x256255)[_0x3c30('0x22')](function(_0x3b9da1){return _0x3b9da1;});}return null;};}function removeEntity(_0x12f9bc,_0xe91806){return function(_0x20aae0){if(_0x20aae0){return _0x20aae0[_0x3c30('0x23')]()['then'](function(){var _0x517e59=_0x20aae0['get']({'plain':!![]});var _0x57d3aa=_0x3c30('0x24');return db[_0x3c30('0x25')]['destroy']({'where':{'type':_0x57d3aa,'resourceId':_0x517e59['id']}})['then'](function(){return _0x20aae0;});})[_0x3c30('0x22')](function(){_0x12f9bc[_0x3c30('0x17')](0xcc)[_0x3c30('0x18')]();});}};}function handleEntityNotFound(_0x35c300,_0xb22b9a){return function(_0x77e27f){if(!_0x77e27f){_0x35c300[_0x3c30('0x16')](0x194);}return _0x77e27f;};}function handleError(_0xd225ae,_0x9c4b46){_0x9c4b46=_0x9c4b46||0x1f4;return function(_0x4b65c0){logger[_0x3c30('0x26')](_0x4b65c0['stack']);if(_0x4b65c0[_0x3c30('0x27')]){delete _0x4b65c0[_0x3c30('0x27')];}_0xd225ae[_0x3c30('0x17')](_0x9c4b46)[_0x3c30('0x28')](_0x4b65c0);};}exports[_0x3c30('0x29')]=function(_0x45400c,_0x34d96a){var _0x5648ba={},_0x26e75e={},_0x6bbd84={'count':0x0,'rows':[]};var _0x4a9e49=_[_0x3c30('0x2a')](db[_0x3c30('0x2b')][_0x3c30('0x2c')],function(_0x4cfd7d){return{'name':_0x4cfd7d[_0x3c30('0x2d')],'type':_0x4cfd7d[_0x3c30('0x2e')][_0x3c30('0x2f')]};});_0x26e75e[_0x3c30('0x30')]=_[_0x3c30('0x2a')](_0x4a9e49,_0x3c30('0x27'));_0x26e75e[_0x3c30('0x31')]=_[_0x3c30('0x32')](_0x45400c[_0x3c30('0x31')]);_0x26e75e[_0x3c30('0x33')]=_[_0x3c30('0x34')](_0x26e75e[_0x3c30('0x30')],_0x26e75e[_0x3c30('0x31')]);_0x5648ba[_0x3c30('0x35')]=_[_0x3c30('0x34')](_0x26e75e['model'],qs['fields'](_0x45400c[_0x3c30('0x31')]['fields']));_0x5648ba[_0x3c30('0x35')]=_0x5648ba[_0x3c30('0x35')][_0x3c30('0x36')]?_0x5648ba[_0x3c30('0x35')]:_0x26e75e[_0x3c30('0x30')];if(!_0x45400c[_0x3c30('0x31')][_0x3c30('0x37')](_0x3c30('0x38'))){_0x5648ba[_0x3c30('0x1c')]=qs[_0x3c30('0x1c')](_0x45400c[_0x3c30('0x31')][_0x3c30('0x1c')]);_0x5648ba[_0x3c30('0x1b')]=qs[_0x3c30('0x1b')](_0x45400c[_0x3c30('0x31')][_0x3c30('0x1b')]);}_0x5648ba['order']=qs[_0x3c30('0x39')](_0x45400c[_0x3c30('0x31')]['sort']);_0x5648ba[_0x3c30('0x3a')]=qs[_0x3c30('0x33')](_[_0x3c30('0x3b')](_0x45400c[_0x3c30('0x31')],_0x26e75e[_0x3c30('0x33')]),_0x4a9e49);if(_0x45400c[_0x3c30('0x31')]['filter']){_0x5648ba[_0x3c30('0x3a')]=_[_0x3c30('0x3c')](_0x5648ba['where'],{'$or':_['map'](_0x4a9e49,function(_0x5a022a){if(_0x5a022a[_0x3c30('0x2e')]!=='VIRTUAL'){var _0xfa7961={};_0xfa7961[_0x5a022a['name']]={'$like':'%'+_0x45400c[_0x3c30('0x31')][_0x3c30('0x3d')]+'%'};return _0xfa7961;}})});}_0x5648ba=_[_0x3c30('0x3c')]({},_0x5648ba,_0x45400c[_0x3c30('0x3e')]);var _0x4f3be6={'where':_0x5648ba['where']};return db['Pause']['count'](_0x4f3be6)['then'](function(_0x4ee078){_0x6bbd84[_0x3c30('0x1a')]=_0x4ee078;if(_0x45400c[_0x3c30('0x31')][_0x3c30('0x3f')]){_0x5648ba[_0x3c30('0x40')]=[{'all':!![]}];}return db[_0x3c30('0x2b')][_0x3c30('0x41')](_0x5648ba);})[_0x3c30('0x22')](function(_0x1c7c1e){_0x6bbd84[_0x3c30('0x42')]=_0x1c7c1e;return _0x6bbd84;})[_0x3c30('0x22')](respondWithFilteredResult(_0x34d96a,_0x5648ba))['catch'](handleError(_0x34d96a,null));};exports[_0x3c30('0x43')]=function(_0x48bd8a,_0x43e8ce){var _0x82561c={'raw':!![],'where':{'id':_0x48bd8a[_0x3c30('0x44')]['id']}},_0x176ae3={};_0x176ae3['model']=_[_0x3c30('0x32')](db[_0x3c30('0x2b')][_0x3c30('0x2c')]);_0x176ae3[_0x3c30('0x31')]=_[_0x3c30('0x32')](_0x48bd8a[_0x3c30('0x31')]);_0x176ae3[_0x3c30('0x33')]=_[_0x3c30('0x34')](_0x176ae3[_0x3c30('0x30')],_0x176ae3[_0x3c30('0x31')]);_0x82561c[_0x3c30('0x35')]=_[_0x3c30('0x34')](_0x176ae3['model'],qs[_0x3c30('0x45')](_0x48bd8a['query'][_0x3c30('0x45')]));_0x82561c[_0x3c30('0x35')]=_0x82561c[_0x3c30('0x35')][_0x3c30('0x36')]?_0x82561c['attributes']:_0x176ae3[_0x3c30('0x30')];if(_0x48bd8a[_0x3c30('0x31')][_0x3c30('0x3f')]){_0x82561c[_0x3c30('0x40')]=[{'all':!![]}];}_0x82561c=_[_0x3c30('0x3c')]({},_0x82561c,_0x48bd8a[_0x3c30('0x3e')]);return db['Pause'][_0x3c30('0x46')](_0x82561c)[_0x3c30('0x22')](handleEntityNotFound(_0x43e8ce,null))[_0x3c30('0x22')](respondWithResult(_0x43e8ce,null))[_0x3c30('0x47')](handleError(_0x43e8ce,null));};exports[_0x3c30('0x48')]=function(_0x3ac8c9,_0xfde392){return db[_0x3c30('0x2b')][_0x3c30('0x48')](_0x3ac8c9[_0x3c30('0x49')],{})['then'](function(_0x29be9c){var _0x1bb87d=_0x3ac8c9[_0x3c30('0x4a')][_0x3c30('0x4b')]({'plain':!![]});if(!_0x1bb87d)throw new Error(_0x3c30('0x4c'));if(_0x1bb87d[_0x3c30('0x4d')]==='user'){var _0x5a2438=_0x29be9c[_0x3c30('0x4b')]({'plain':!![]});var _0x10ff06='Pauses';return db[_0x3c30('0x4e')][_0x3c30('0x46')]({'where':{'name':_0x10ff06,'userProfileId':_0x1bb87d[_0x3c30('0x4f')]},'raw':!![]})[_0x3c30('0x22')](function(_0x28eff3){if(_0x28eff3&&_0x28eff3[_0x3c30('0x50')]===0x0){return db[_0x3c30('0x25')]['create']({'name':_0x5a2438[_0x3c30('0x27')],'resourceId':_0x5a2438['id'],'type':_0x28eff3[_0x3c30('0x27')],'sectionId':_0x28eff3['id']},{})[_0x3c30('0x22')](function(){return _0x29be9c;});}else{return _0x29be9c;}})[_0x3c30('0x47')](function(_0xe4ff50){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xe4ff50);throw _0xe4ff50;});}return _0x29be9c;})[_0x3c30('0x22')](respondWithResult(_0xfde392,0xc9))[_0x3c30('0x47')](handleError(_0xfde392,null));};exports[_0x3c30('0x21')]=function(_0x24d32f,_0x4b38f8){if(_0x24d32f[_0x3c30('0x49')]['id']){delete _0x24d32f[_0x3c30('0x49')]['id'];}return db[_0x3c30('0x2b')][_0x3c30('0x46')]({'where':{'id':_0x24d32f['params']['id']}})[_0x3c30('0x22')](handleEntityNotFound(_0x4b38f8,null))[_0x3c30('0x22')](saveUpdates(_0x24d32f[_0x3c30('0x49')],null))['then'](respondWithResult(_0x4b38f8,null))[_0x3c30('0x47')](handleError(_0x4b38f8,null));};exports['destroy']=function(_0x2f3eaf,_0x4dc4f4){return db[_0x3c30('0x2b')][_0x3c30('0x46')]({'where':{'id':_0x2f3eaf['params']['id']}})[_0x3c30('0x22')](handleEntityNotFound(_0x4dc4f4,null))[_0x3c30('0x22')](removeEntity(_0x4dc4f4,null))['catch'](handleError(_0x4dc4f4,null));};
\ No newline at end of file
+var _0x9195=['Pause','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','type','VIRTUAL','filter','merge','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Pauses','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','update','then','get','destroy','sendStatus','stack','name','send','map'];(function(_0x367c77,_0x54d605){var _0x5efbea=function(_0x280eb1){while(--_0x280eb1){_0x367c77['push'](_0x367c77['shift']());}};_0x5efbea(++_0x54d605);}(_0x9195,0x127));var _0x5919=function(_0x6a1395,_0x37ba0a){_0x6a1395=_0x6a1395-0x0;var _0x8b85d7=_0x9195[_0x6a1395];return _0x8b85d7;};'use strict';var emlformat=require(_0x5919('0x0'));var rimraf=require(_0x5919('0x1'));var zipdir=require(_0x5919('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5919('0x3'));var Mustache=require('mustache');var util=require(_0x5919('0x4'));var path=require(_0x5919('0x5'));var sox=require(_0x5919('0x6'));var csv=require(_0x5919('0x7'));var ejs=require(_0x5919('0x8'));var fs=require('fs');var fs_extra=require(_0x5919('0x9'));var _=require(_0x5919('0xa'));var squel=require(_0x5919('0xb'));var crypto=require(_0x5919('0xc'));var jsforce=require(_0x5919('0xd'));var deskjs=require(_0x5919('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5919('0xf'));var Papa=require('papaparse');var Redis=require(_0x5919('0x10'));var authService=require(_0x5919('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5919('0x12'));var hardwareService=require(_0x5919('0x13'));var logger=require(_0x5919('0x14'))(_0x5919('0x15'));var utils=require(_0x5919('0x16'));var config=require(_0x5919('0x17'));var licenseUtil=require(_0x5919('0x18'));var db=require(_0x5919('0x19'))['db'];function respondWithStatusCode(_0x314131,_0xb49b01){_0xb49b01=_0xb49b01||0xcc;return function(_0x230fe8){if(_0x230fe8){return _0x314131['sendStatus'](_0xb49b01);}return _0x314131['status'](_0xb49b01)[_0x5919('0x1a')]();};}function respondWithResult(_0x104379,_0x5cd82e){_0x5cd82e=_0x5cd82e||0xc8;return function(_0x31e35e){if(_0x31e35e){return _0x104379['status'](_0x5cd82e)[_0x5919('0x1b')](_0x31e35e);}};}function respondWithFilteredResult(_0x4957c2,_0x3101f3){return function(_0x2edefc){if(_0x2edefc){var _0x3106fb=typeof _0x3101f3[_0x5919('0x1c')]===_0x5919('0x1d')&&typeof _0x3101f3[_0x5919('0x1e')]===_0x5919('0x1d');var _0x1a844f=_0x2edefc['count'];var _0x3f33c8=_0x3106fb?0x0:_0x3101f3[_0x5919('0x1c')];var _0x1d729e=_0x3106fb?_0x2edefc[_0x5919('0x1f')]:_0x3101f3[_0x5919('0x1c')]+_0x3101f3[_0x5919('0x1e')];var _0x1d4eb3;if(_0x1d729e>=_0x1a844f){_0x1d729e=_0x1a844f;_0x1d4eb3=0xc8;}else{_0x1d4eb3=0xce;}_0x4957c2[_0x5919('0x20')](_0x1d4eb3);return _0x4957c2[_0x5919('0x21')](_0x5919('0x22'),_0x3f33c8+'-'+_0x1d729e+'/'+_0x1a844f)[_0x5919('0x1b')](_0x2edefc);}return null;};}function patchUpdates(_0x3160db){return function(_0x1da6d8){try{jsonpatch[_0x5919('0x23')](_0x1da6d8,_0x3160db,!![]);}catch(_0x497d88){return BPromise['reject'](_0x497d88);}return _0x1da6d8['save']();};}function saveUpdates(_0x758ea,_0x40bde4){return function(_0x3eb69e){if(_0x3eb69e){return _0x3eb69e[_0x5919('0x24')](_0x758ea)[_0x5919('0x25')](function(_0x4ad012){return _0x4ad012;});}return null;};}function removeEntity(_0x3021c1,_0x1a1530){return function(_0x24af03){if(_0x24af03){return _0x24af03['destroy']()['then'](function(){var _0x28f6d4=_0x24af03[_0x5919('0x26')]({'plain':!![]});var _0x5c4b7f='Pauses';return db['UserProfileResource'][_0x5919('0x27')]({'where':{'type':_0x5c4b7f,'resourceId':_0x28f6d4['id']}})[_0x5919('0x25')](function(){return _0x24af03;});})[_0x5919('0x25')](function(){_0x3021c1['status'](0xcc)[_0x5919('0x1a')]();});}};}function handleEntityNotFound(_0x4fab14,_0x26efaf){return function(_0x291270){if(!_0x291270){_0x4fab14[_0x5919('0x28')](0x194);}return _0x291270;};}function handleError(_0xc383f1,_0x5a0d34){_0x5a0d34=_0x5a0d34||0x1f4;return function(_0x3697bf){logger['error'](_0x3697bf[_0x5919('0x29')]);if(_0x3697bf[_0x5919('0x2a')]){delete _0x3697bf[_0x5919('0x2a')];}_0xc383f1[_0x5919('0x20')](_0x5a0d34)[_0x5919('0x2b')](_0x3697bf);};}exports['index']=function(_0x227fb9,_0x6a05ef){var _0x2407bd={},_0x23f67f={},_0x4af0cb={'count':0x0,'rows':[]};var _0x3a4c50=_[_0x5919('0x2c')](db[_0x5919('0x2d')]['rawAttributes'],function(_0x4f8450){return{'name':_0x4f8450[_0x5919('0x2e')],'type':_0x4f8450['type'][_0x5919('0x2f')]};});_0x23f67f[_0x5919('0x30')]=_[_0x5919('0x2c')](_0x3a4c50,'name');_0x23f67f[_0x5919('0x31')]=_[_0x5919('0x32')](_0x227fb9[_0x5919('0x31')]);_0x23f67f['filters']=_[_0x5919('0x33')](_0x23f67f[_0x5919('0x30')],_0x23f67f[_0x5919('0x31')]);_0x2407bd['attributes']=_[_0x5919('0x33')](_0x23f67f[_0x5919('0x30')],qs[_0x5919('0x34')](_0x227fb9[_0x5919('0x31')][_0x5919('0x34')]));_0x2407bd[_0x5919('0x35')]=_0x2407bd['attributes'][_0x5919('0x36')]?_0x2407bd[_0x5919('0x35')]:_0x23f67f[_0x5919('0x30')];if(!_0x227fb9[_0x5919('0x31')][_0x5919('0x37')](_0x5919('0x38'))){_0x2407bd[_0x5919('0x1e')]=qs[_0x5919('0x1e')](_0x227fb9[_0x5919('0x31')]['limit']);_0x2407bd['offset']=qs[_0x5919('0x1c')](_0x227fb9['query']['offset']);}_0x2407bd[_0x5919('0x39')]=qs[_0x5919('0x3a')](_0x227fb9['query'][_0x5919('0x3a')]);_0x2407bd['where']=qs[_0x5919('0x3b')](_[_0x5919('0x3c')](_0x227fb9[_0x5919('0x31')],_0x23f67f[_0x5919('0x3b')]),_0x3a4c50);if(_0x227fb9['query']['filter']){_0x2407bd[_0x5919('0x3d')]=_['merge'](_0x2407bd[_0x5919('0x3d')],{'$or':_['map'](_0x3a4c50,function(_0x42a688){if(_0x42a688[_0x5919('0x3e')]!==_0x5919('0x3f')){var _0x3c272f={};_0x3c272f[_0x42a688['name']]={'$like':'%'+_0x227fb9[_0x5919('0x31')][_0x5919('0x40')]+'%'};return _0x3c272f;}})});}_0x2407bd=_[_0x5919('0x41')]({},_0x2407bd,_0x227fb9['options']);var _0x5383c={'where':_0x2407bd[_0x5919('0x3d')]};return db[_0x5919('0x2d')]['count'](_0x5383c)[_0x5919('0x25')](function(_0x5725fe){_0x4af0cb[_0x5919('0x1f')]=_0x5725fe;if(_0x227fb9['query'][_0x5919('0x42')]){_0x2407bd[_0x5919('0x43')]=[{'all':!![]}];}return db[_0x5919('0x2d')][_0x5919('0x44')](_0x2407bd);})[_0x5919('0x25')](function(_0x33f952){_0x4af0cb[_0x5919('0x45')]=_0x33f952;return _0x4af0cb;})[_0x5919('0x25')](respondWithFilteredResult(_0x6a05ef,_0x2407bd))[_0x5919('0x46')](handleError(_0x6a05ef,null));};exports[_0x5919('0x47')]=function(_0x2f1ad0,_0x1d9e2b){var _0x2ef131={'raw':!![],'where':{'id':_0x2f1ad0[_0x5919('0x48')]['id']}},_0x450037={};_0x450037[_0x5919('0x30')]=_[_0x5919('0x32')](db[_0x5919('0x2d')][_0x5919('0x49')]);_0x450037[_0x5919('0x31')]=_[_0x5919('0x32')](_0x2f1ad0[_0x5919('0x31')]);_0x450037[_0x5919('0x3b')]=_[_0x5919('0x33')](_0x450037[_0x5919('0x30')],_0x450037[_0x5919('0x31')]);_0x2ef131['attributes']=_[_0x5919('0x33')](_0x450037[_0x5919('0x30')],qs[_0x5919('0x34')](_0x2f1ad0[_0x5919('0x31')][_0x5919('0x34')]));_0x2ef131[_0x5919('0x35')]=_0x2ef131[_0x5919('0x35')][_0x5919('0x36')]?_0x2ef131[_0x5919('0x35')]:_0x450037['model'];if(_0x2f1ad0[_0x5919('0x31')][_0x5919('0x42')]){_0x2ef131[_0x5919('0x43')]=[{'all':!![]}];}_0x2ef131=_[_0x5919('0x41')]({},_0x2ef131,_0x2f1ad0[_0x5919('0x4a')]);return db[_0x5919('0x2d')][_0x5919('0x4b')](_0x2ef131)[_0x5919('0x25')](handleEntityNotFound(_0x1d9e2b,null))['then'](respondWithResult(_0x1d9e2b,null))['catch'](handleError(_0x1d9e2b,null));};exports[_0x5919('0x4c')]=function(_0x56d6f2,_0x361558){return db[_0x5919('0x2d')][_0x5919('0x4c')](_0x56d6f2[_0x5919('0x4d')],{})[_0x5919('0x25')](function(_0x4a9a6c){var _0x1f9f74=_0x56d6f2[_0x5919('0x4e')][_0x5919('0x26')]({'plain':!![]});if(!_0x1f9f74)throw new Error(_0x5919('0x4f'));if(_0x1f9f74['role']==='user'){var _0x1aff74=_0x4a9a6c[_0x5919('0x26')]({'plain':!![]});var _0x257caf=_0x5919('0x50');return db[_0x5919('0x51')][_0x5919('0x4b')]({'where':{'name':_0x257caf,'userProfileId':_0x1f9f74['userProfileId']},'raw':!![]})[_0x5919('0x25')](function(_0x2b1bf4){if(_0x2b1bf4&&_0x2b1bf4[_0x5919('0x52')]===0x0){return db['UserProfileResource'][_0x5919('0x4c')]({'name':_0x1aff74['name'],'resourceId':_0x1aff74['id'],'type':_0x2b1bf4['name'],'sectionId':_0x2b1bf4['id']},{})['then'](function(){return _0x4a9a6c;});}else{return _0x4a9a6c;}})[_0x5919('0x46')](function(_0x33b3ab){logger[_0x5919('0x53')](_0x5919('0x54'),_0x33b3ab);throw _0x33b3ab;});}return _0x4a9a6c;})['then'](respondWithResult(_0x361558,0xc9))[_0x5919('0x46')](handleError(_0x361558,null));};exports[_0x5919('0x24')]=function(_0x3e4740,_0x210fa8){if(_0x3e4740[_0x5919('0x4d')]['id']){delete _0x3e4740[_0x5919('0x4d')]['id'];}return db[_0x5919('0x2d')][_0x5919('0x4b')]({'where':{'id':_0x3e4740[_0x5919('0x48')]['id']}})['then'](handleEntityNotFound(_0x210fa8,null))[_0x5919('0x25')](saveUpdates(_0x3e4740[_0x5919('0x4d')],null))[_0x5919('0x25')](respondWithResult(_0x210fa8,null))['catch'](handleError(_0x210fa8,null));};exports[_0x5919('0x27')]=function(_0x235529,_0x257a1d){return db['Pause']['find']({'where':{'id':_0x235529['params']['id']}})[_0x5919('0x25')](handleEntityNotFound(_0x257a1d,null))['then'](removeEntity(_0x257a1d,null))[_0x5919('0x46')](handleError(_0x257a1d,null));};
\ No newline at end of file
index 78eab70..281e3c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fbe=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x2db025,_0x1cf6de){_0x2db025=_0x2db025-0x0;var _0x47afbe=_0x7fbe[_0x2db025];return _0x47afbe;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));module[_0xe7fb('0x9')]=function(_0x290172,_0x12d1b0){return _0x290172[_0xe7fb('0xa')](_0xe7fb('0xb'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x53ec=['bluebird','path','../../config/environment','./pause.attributes','define','Pause','lodash','util','../../config/logger','api','moment'];(function(_0x1f1804,_0x1537ca){var _0x51aed4=function(_0x271f28){while(--_0x271f28){_0x1f1804['push'](_0x1f1804['shift']());}};_0x51aed4(++_0x1537ca);}(_0x53ec,0x192));var _0xc53e=function(_0x58eb93,_0x3b8263){_0x58eb93=_0x58eb93-0x0;var _0xc0d5c0=_0x53ec[_0x58eb93];return _0xc0d5c0;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4d65589..1c0a2d7 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(_0x5b2458,_0x57161f){var _0x394520=function(_0x32c8b2){while(--_0x32c8b2){_0x5b2458['push'](_0x5b2458['shift']());}};_0x394520(++_0x57161f);}(_0x7a54,0x106));var _0x47a5=function(_0x5e6ea8,_0x2a3750){_0x5e6ea8=_0x5e6ea8-0x0;var _0x496bc5=_0x7a54[_0x5e6ea8];return _0x496bc5;};'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(_0x9c28d,_0x46e01c){var _0x170f82=function(_0x446dc5){while(--_0x446dc5){_0x9c28d['push'](_0x9c28d['shift']());}};_0x170f82(++_0x46e01c);}(_0xb10b,0x12a));var _0xbb10=function(_0x5df780,_0x3460c8){_0x5df780=_0x5df780-0x0;var _0x535f5b=_0xb10b[_0x5df780];return _0x535f5b;};'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 c97f281..185e75a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaba6=['get','webhookGet','isAuthenticated','show','/:id/download','download','diskStorage','root','server/files/plugins','originalname','format','%s-%s%s','basename','extname','now','post','single','file','upload','/webhook','put','/:id','delete','multer','util','fs-extra','../../components/auth/service','../../config/environment','./plugin.controller'];(function(_0x417b61,_0x4cb43f){var _0x1e6921=function(_0x293860){while(--_0x293860){_0x417b61['push'](_0x417b61['shift']());}};_0x1e6921(++_0x4cb43f);}(_0xaba6,0xe2));var _0x6aba=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0xaba6[_0x4dc7b9];return _0x3ab114;};'use strict';var multer=require(_0x6aba('0x0'));var util=require(_0x6aba('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x6aba('0x2'));var auth=require(_0x6aba('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x6aba('0x4'));var controller=require(_0x6aba('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x6aba('0x6')]('/webhook',controller[_0x6aba('0x7')]);router[_0x6aba('0x6')]('/:id',auth[_0x6aba('0x8')](),controller[_0x6aba('0x9')]);router['get'](_0x6aba('0xa'),auth[_0x6aba('0x8')](),controller[_0x6aba('0xb')]);var upload=multer({'storage':multer[_0x6aba('0xc')]({'destination':function(_0xdbc119,_0x4089c6,_0x181426){_0x181426(null,path['join'](config[_0x6aba('0xd')],_0x6aba('0xe')));},'filename':function(_0x43867b,_0x254007,_0x53e604){_0x254007[_0x6aba('0xf')]=_0x254007[_0x6aba('0xf')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x53e604(null,util[_0x6aba('0x10')](_0x6aba('0x11'),path[_0x6aba('0x12')](_0x254007['originalname'],path[_0x6aba('0x13')](_0x254007[_0x6aba('0xf')])),Date[_0x6aba('0x14')](),path['extname'](_0x254007[_0x6aba('0xf')])));}})});router[_0x6aba('0x15')]('/',upload[_0x6aba('0x16')](_0x6aba('0x17')),controller[_0x6aba('0x18')]);router[_0x6aba('0x15')](_0x6aba('0x19'),controller['webhookPost']);router[_0x6aba('0x1a')](_0x6aba('0x1b'),auth[_0x6aba('0x8')](),controller['update']);router[_0x6aba('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0x6aba('0x1c')]);module['exports']=router;
\ No newline at end of file
+var _0x34e5=['%s-%s%s','basename','extname','now','post','upload','webhookPost','put','delete','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','/:id','/:id/download','download','root','server/files/plugins','originalname','replace','format'];(function(_0x291d3f,_0x3ef99f){var _0x242080=function(_0x257705){while(--_0x257705){_0x291d3f['push'](_0x291d3f['shift']());}};_0x242080(++_0x3ef99f);}(_0x34e5,0x172));var _0x534e=function(_0x257961,_0x3e155e){_0x257961=_0x257961-0x0;var _0x3c4c22=_0x34e5[_0x257961];return _0x3c4c22;};'use strict';var multer=require('multer');var util=require(_0x534e('0x0'));var path=require('path');var timeout=require(_0x534e('0x1'));var express=require(_0x534e('0x2'));var router=express[_0x534e('0x3')]();var fs_extra=require(_0x534e('0x4'));var auth=require(_0x534e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x534e('0x6'));var controller=require(_0x534e('0x7'));router[_0x534e('0x8')]('/',auth[_0x534e('0x9')](),controller[_0x534e('0xa')]);router[_0x534e('0x8')](_0x534e('0xb'),controller['webhookGet']);router[_0x534e('0x8')](_0x534e('0xc'),auth[_0x534e('0x9')](),controller['show']);router['get'](_0x534e('0xd'),auth['isAuthenticated'](),controller[_0x534e('0xe')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xb30dd6,_0x310b6d,_0x27561c){_0x27561c(null,path['join'](config[_0x534e('0xf')],_0x534e('0x10')));},'filename':function(_0x73b135,_0x28b8ff,_0x2c4539){_0x28b8ff['originalname']=_0x28b8ff[_0x534e('0x11')][_0x534e('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2c4539(null,util[_0x534e('0x13')](_0x534e('0x14'),path[_0x534e('0x15')](_0x28b8ff[_0x534e('0x11')],path[_0x534e('0x16')](_0x28b8ff[_0x534e('0x11')])),Date[_0x534e('0x17')](),path['extname'](_0x28b8ff[_0x534e('0x11')])));}})});router[_0x534e('0x18')]('/',upload['single']('file'),controller[_0x534e('0x19')]);router[_0x534e('0x18')](_0x534e('0xb'),controller[_0x534e('0x1a')]);router[_0x534e('0x1b')](_0x534e('0xc'),auth[_0x534e('0x9')](),controller['update']);router[_0x534e('0x1c')](_0x534e('0xc'),auth[_0x534e('0x9')](),controller[_0x534e('0x1c')]);module[_0x534e('0x1d')]=router;
\ No newline at end of file
index a35df08..f9cdac3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8bb4=['Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','exports','STRING','ENUM','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN'];(function(_0x112f0f,_0xdecb74){var _0x1b804a=function(_0x14d7ca){while(--_0x14d7ca){_0x112f0f['push'](_0x112f0f['shift']());}};_0x1b804a(++_0xdecb74);}(_0x8bb4,0x68));var _0x48bb=function(_0x1fcabe,_0x31e775){_0x1fcabe=_0x1fcabe-0x0;var _0x1ce1ba=_0x8bb4[_0x1fcabe];return _0x1ce1ba;};'use strict';var Sequelize=require('sequelize');module[_0x48bb('0x0')]={'name':{'type':Sequelize[_0x48bb('0x1')]},'type':{'type':Sequelize[_0x48bb('0x2')]('html','script')},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x48bb('0x3')]},'path':{'type':Sequelize['STRING'],'comment':_0x48bb('0x4')},'active':{'type':Sequelize[_0x48bb('0x5')],'defaultValue':0x0,'comment':_0x48bb('0x6')},'sidebar':{'type':Sequelize[_0x48bb('0x2')]('adminOnly',_0x48bb('0x7'),_0x48bb('0x8'),_0x48bb('0x9')),'defaultValue':_0x48bb('0x8'),'comment':_0x48bb('0xa')},'icon':{'type':Sequelize[_0x48bb('0x1')]},'adminUrl':{'type':Sequelize[_0x48bb('0x1')]},'agentUrl':{'type':Sequelize[_0x48bb('0x1')]},'scriptName':{'type':Sequelize[_0x48bb('0x1')]},'scriptPath':{'type':Sequelize[_0x48bb('0x1')]}};
\ No newline at end of file
+var _0xc186=['sequelize','ENUM','html','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'];(function(_0x162d80,_0x5f11bf){var _0x346ddd=function(_0xbb3502){while(--_0xbb3502){_0x162d80['push'](_0x162d80['shift']());}};_0x346ddd(++_0x5f11bf);}(_0xc186,0xd8));var _0x6c18=function(_0x393875,_0x17e769){_0x393875=_0x393875-0x0;var _0x332f4f=_0xc186[_0x393875];return _0x332f4f;};'use strict';var Sequelize=require(_0x6c18('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x6c18('0x1')](_0x6c18('0x2'),'script')},'description':{'type':Sequelize[_0x6c18('0x3')]},'version':{'type':Sequelize[_0x6c18('0x3')]},'path':{'type':Sequelize[_0x6c18('0x4')],'comment':_0x6c18('0x5')},'active':{'type':Sequelize[_0x6c18('0x6')],'defaultValue':0x0,'comment':_0x6c18('0x7')},'sidebar':{'type':Sequelize[_0x6c18('0x1')](_0x6c18('0x8'),'agentOnly','always',_0x6c18('0x9')),'defaultValue':_0x6c18('0xa'),'comment':_0x6c18('0xb')},'icon':{'type':Sequelize[_0x6c18('0x4')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x6c18('0x4')]},'scriptName':{'type':Sequelize[_0x6c18('0x4')]},'scriptPath':{'type':Sequelize[_0x6c18('0x4')]}};
\ No newline at end of file
index ac60cc6..1efe259 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d17=['sort','where','filters','pick','filter','merge','VIRTUAL','include','findAll','rows','show','params','rawAttributes','length','options','download','find','path','join','root','format','%s.zip','createWriteStream','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','dirname','node_modules/**/*','basename','attachments/**/*','finalize','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','Download\x20completed','info','Temporary\x20file\x20removed','catch','upload','file','filename','server/files/plugins','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','isFile','isDirectory','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','views','Invalid\x20manifest:\x20views\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','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','script','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Plugins','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','\x27PORT\x27\x20parameter\x20not\x20specified','http://localhost:','eml-format','rimraf','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','extract-zip','archiver','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','get','destroy','error','send','index','Plugin','fieldName','type','key','map','name','keys','query','intersection','model','fields','attributes','nolimit','order'];(function(_0x422cd1,_0x4c5ae1){var _0x457936=function(_0x28242c){while(--_0x28242c){_0x422cd1['push'](_0x422cd1['shift']());}};_0x457936(++_0x4c5ae1);}(_0x2d17,0x1dd));var _0x72d1=function(_0x49a41b,_0xa281bb){_0x49a41b=_0x49a41b-0x0;var _0x40e398=_0x2d17[_0x49a41b];return _0x40e398;};'use strict';var emlformat=require(_0x72d1('0x0'));var rimraf=require(_0x72d1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x72d1('0x2'));var Mustache=require(_0x72d1('0x3'));var util=require(_0x72d1('0x4'));var path=require('path');var sox=require(_0x72d1('0x5'));var csv=require('to-csv');var ejs=require(_0x72d1('0x6'));var fs=require('fs');var fs_extra=require(_0x72d1('0x7'));var _=require(_0x72d1('0x8'));var squel=require(_0x72d1('0x9'));var crypto=require(_0x72d1('0xa'));var jsforce=require(_0x72d1('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x72d1('0xc'));var querystring=require(_0x72d1('0xd'));var Papa=require(_0x72d1('0xe'));var extract=require(_0x72d1('0xf'));var rimraf=require(_0x72d1('0x1'));var archiver=require(_0x72d1('0x10'));var Redis=require(_0x72d1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x72d1('0x12'));var as=require(_0x72d1('0x13'));var hardwareService=require(_0x72d1('0x14'));var logger=require(_0x72d1('0x15'))(_0x72d1('0x16'));var utils=require(_0x72d1('0x17'));var config=require(_0x72d1('0x18'));var licenseUtil=require(_0x72d1('0x19'));var db=require(_0x72d1('0x1a'))['db'];config[_0x72d1('0x1b')]=_[_0x72d1('0x1c')](config[_0x72d1('0x1b')],{'host':_0x72d1('0x1d'),'port':0x18eb});var socket=require(_0x72d1('0x1e'))(new Redis(config['redis']));require('./plugin.socket')[_0x72d1('0x1f')](socket);function respondWithStatusCode(_0x4e622a,_0x3bb0f9){_0x3bb0f9=_0x3bb0f9||0xcc;return function(_0x17b499){if(_0x17b499){return _0x4e622a[_0x72d1('0x20')](_0x3bb0f9);}return _0x4e622a['status'](_0x3bb0f9)[_0x72d1('0x21')]();};}function respondWithResult(_0x922820,_0x43bb05){_0x43bb05=_0x43bb05||0xc8;return function(_0x3881ef){if(_0x3881ef){return _0x922820[_0x72d1('0x22')](_0x43bb05)[_0x72d1('0x23')](_0x3881ef);}};}function respondWithFilteredResult(_0x21a486,_0x222505){return function(_0x1c3dac){if(_0x1c3dac){var _0x44b8fd=typeof _0x222505[_0x72d1('0x24')]===_0x72d1('0x25')&&typeof _0x222505['limit']===_0x72d1('0x25');var _0x53f8e3=_0x1c3dac[_0x72d1('0x26')];var _0x4a9d42=_0x44b8fd?0x0:_0x222505[_0x72d1('0x24')];var _0x61ba61=_0x44b8fd?_0x1c3dac[_0x72d1('0x26')]:_0x222505['offset']+_0x222505[_0x72d1('0x27')];var _0x17772d;if(_0x61ba61>=_0x53f8e3){_0x61ba61=_0x53f8e3;_0x17772d=0xc8;}else{_0x17772d=0xce;}_0x21a486['status'](_0x17772d);return _0x21a486[_0x72d1('0x28')](_0x72d1('0x29'),_0x4a9d42+'-'+_0x61ba61+'/'+_0x53f8e3)[_0x72d1('0x23')](_0x1c3dac);}return null;};}function patchUpdates(_0x2aebd9){return function(_0x2ec261){try{jsonpatch[_0x72d1('0x2a')](_0x2ec261,_0x2aebd9,!![]);}catch(_0x52b8b3){return BPromise[_0x72d1('0x2b')](_0x52b8b3);}return _0x2ec261[_0x72d1('0x2c')]();};}function saveUpdates(_0xd3a894,_0x6e7eb9){return function(_0x2b82e5){if(_0x2b82e5){return _0x2b82e5[_0x72d1('0x2d')](_0xd3a894)[_0x72d1('0x2e')](function(_0x18de63){return _0x18de63;});}return null;};}function removeEntity(_0x2ea992,_0xac8e07){return function(_0x2495c6){if(_0x2495c6){return _0x2495c6['destroy']()[_0x72d1('0x2e')](function(){var _0x5842f0=_0x2495c6[_0x72d1('0x2f')]({'plain':!![]});var _0xc6cd06='Plugins';return db['UserProfileResource'][_0x72d1('0x30')]({'where':{'type':_0xc6cd06,'resourceId':_0x5842f0['id']}})[_0x72d1('0x2e')](function(){return _0x2495c6;});})['then'](function(){_0x2ea992[_0x72d1('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44ba60,_0x403540){return function(_0xead793){if(!_0xead793){_0x44ba60[_0x72d1('0x20')](0x194);}return _0xead793;};}function handleError(_0x2914d8,_0x46993b){_0x46993b=_0x46993b||0x1f4;return function(_0x5d052d){logger[_0x72d1('0x31')](_0x5d052d['stack']);if(_0x5d052d['name']){delete _0x5d052d['name'];}_0x2914d8[_0x72d1('0x22')](_0x46993b)[_0x72d1('0x32')](_0x5d052d);};}exports[_0x72d1('0x33')]=function(_0x855f48,_0x6b88e){var _0x28755f={},_0x28cd41={},_0x592576={'count':0x0,'rows':[]};var _0x3ab5d4=_['map'](db[_0x72d1('0x34')]['rawAttributes'],function(_0x28d998){return{'name':_0x28d998[_0x72d1('0x35')],'type':_0x28d998[_0x72d1('0x36')][_0x72d1('0x37')]};});_0x28cd41['model']=_[_0x72d1('0x38')](_0x3ab5d4,_0x72d1('0x39'));_0x28cd41['query']=_[_0x72d1('0x3a')](_0x855f48[_0x72d1('0x3b')]);_0x28cd41['filters']=_[_0x72d1('0x3c')](_0x28cd41['model'],_0x28cd41[_0x72d1('0x3b')]);_0x28755f['attributes']=_['intersection'](_0x28cd41[_0x72d1('0x3d')],qs[_0x72d1('0x3e')](_0x855f48['query'][_0x72d1('0x3e')]));_0x28755f[_0x72d1('0x3f')]=_0x28755f['attributes']['length']?_0x28755f[_0x72d1('0x3f')]:_0x28cd41[_0x72d1('0x3d')];if(!_0x855f48[_0x72d1('0x3b')]['hasOwnProperty'](_0x72d1('0x40'))){_0x28755f[_0x72d1('0x27')]=qs[_0x72d1('0x27')](_0x855f48['query']['limit']);_0x28755f[_0x72d1('0x24')]=qs['offset'](_0x855f48[_0x72d1('0x3b')][_0x72d1('0x24')]);}_0x28755f[_0x72d1('0x41')]=qs[_0x72d1('0x42')](_0x855f48[_0x72d1('0x3b')][_0x72d1('0x42')]);_0x28755f[_0x72d1('0x43')]=qs[_0x72d1('0x44')](_[_0x72d1('0x45')](_0x855f48[_0x72d1('0x3b')],_0x28cd41[_0x72d1('0x44')]),_0x3ab5d4);if(_0x855f48[_0x72d1('0x3b')][_0x72d1('0x46')]){_0x28755f[_0x72d1('0x43')]=_[_0x72d1('0x47')](_0x28755f[_0x72d1('0x43')],{'$or':_[_0x72d1('0x38')](_0x3ab5d4,function(_0x4d684b){if(_0x4d684b[_0x72d1('0x36')]!==_0x72d1('0x48')){var _0x289333={};_0x289333[_0x4d684b[_0x72d1('0x39')]]={'$like':'%'+_0x855f48['query'][_0x72d1('0x46')]+'%'};return _0x289333;}})});}_0x28755f=_[_0x72d1('0x47')]({},_0x28755f,_0x855f48['options']);var _0x24c16a={'where':_0x28755f[_0x72d1('0x43')]};return db[_0x72d1('0x34')][_0x72d1('0x26')](_0x24c16a)[_0x72d1('0x2e')](function(_0x154934){_0x592576[_0x72d1('0x26')]=_0x154934;if(_0x855f48[_0x72d1('0x3b')]['includeAll']){_0x28755f[_0x72d1('0x49')]=[{'all':!![]}];}return db['Plugin'][_0x72d1('0x4a')](_0x28755f);})[_0x72d1('0x2e')](function(_0x15f657){_0x592576[_0x72d1('0x4b')]=_0x15f657;return _0x592576;})[_0x72d1('0x2e')](respondWithFilteredResult(_0x6b88e,_0x28755f))['catch'](handleError(_0x6b88e,null));};exports[_0x72d1('0x4c')]=function(_0xe5d735,_0x4ed235){var _0x3cf5ce={'raw':!![],'where':{'id':_0xe5d735[_0x72d1('0x4d')]['id']}},_0x14c88f={};_0x14c88f[_0x72d1('0x3d')]=_[_0x72d1('0x3a')](db[_0x72d1('0x34')][_0x72d1('0x4e')]);_0x14c88f['query']=_[_0x72d1('0x3a')](_0xe5d735['query']);_0x14c88f['filters']=_['intersection'](_0x14c88f['model'],_0x14c88f[_0x72d1('0x3b')]);_0x3cf5ce[_0x72d1('0x3f')]=_[_0x72d1('0x3c')](_0x14c88f[_0x72d1('0x3d')],qs[_0x72d1('0x3e')](_0xe5d735[_0x72d1('0x3b')]['fields']));_0x3cf5ce[_0x72d1('0x3f')]=_0x3cf5ce[_0x72d1('0x3f')][_0x72d1('0x4f')]?_0x3cf5ce['attributes']:_0x14c88f[_0x72d1('0x3d')];if(_0xe5d735['query']['includeAll']){_0x3cf5ce[_0x72d1('0x49')]=[{'all':!![]}];}_0x3cf5ce=_[_0x72d1('0x47')]({},_0x3cf5ce,_0xe5d735[_0x72d1('0x50')]);return db['Plugin']['find'](_0x3cf5ce)[_0x72d1('0x2e')](handleEntityNotFound(_0x4ed235,null))['then'](respondWithResult(_0x4ed235,null))['catch'](handleError(_0x4ed235,null));};exports[_0x72d1('0x51')]=function(_0x5c40fa,_0x588b5e,_0x774a92){return db['Plugin'][_0x72d1('0x52')]({'where':{'id':_0x5c40fa[_0x72d1('0x4d')]['id']},'attributes':[_0x72d1('0x39'),_0x72d1('0x53')],'raw':!![]})[_0x72d1('0x2e')](handleEntityNotFound(_0x588b5e,null))['then'](function(_0x5cf850){if(_0x5cf850){var _0x4121b2=path[_0x72d1('0x54')](config[_0x72d1('0x55')],'server/files/plugins',util[_0x72d1('0x56')](_0x72d1('0x57'),path['basename'](_0x5cf850[_0x72d1('0x53')])));var _0x2e5ab4=fs[_0x72d1('0x58')](_0x4121b2);var _0x28bb17=archiver('zip',{'zlib':{'level':0x9}});_0x28bb17['on'](_0x72d1('0x59'),function(_0x297906){if(_0x297906[_0x72d1('0x5a')]===_0x72d1('0x5b')){logger[_0x72d1('0x31')](_0x297906);}else{throw new db[(_0x72d1('0x5c'))][(_0x72d1('0x5d'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x28bb17['on'](_0x72d1('0x31'),function(_0x485b8e){throw new db['Sequelize'][(_0x72d1('0x5d'))](_0x72d1('0x5e'));});_0x28bb17[_0x72d1('0x5f')](_0x2e5ab4);_0x28bb17[_0x72d1('0x60')](_0x72d1('0x61'),{'cwd':path[_0x72d1('0x54')](config[_0x72d1('0x55')],'server/files/plugins',path[_0x72d1('0x62')](_0x5cf850[_0x72d1('0x53')])),'ignore':[path[_0x72d1('0x54')](path['basename'](_0x5cf850['path']),_0x72d1('0x63')),path[_0x72d1('0x54')](path[_0x72d1('0x64')](_0x5cf850[_0x72d1('0x53')]),_0x72d1('0x65'))],'nodir':!![]})[_0x72d1('0x66')]();_0x2e5ab4['on']('close',function(){if(!fs[_0x72d1('0x67')](_0x4121b2)){throw new db['Sequelize'][(_0x72d1('0x5d'))](_0x72d1('0x68'));}return _0x588b5e[_0x72d1('0x51')](_0x4121b2,util[_0x72d1('0x56')]('%s.zip',path['basename'](_0x5cf850[_0x72d1('0x53')])),function(_0x4b341d){if(_0x4b341d){throw new db['Sequelize'][(_0x72d1('0x5d'))](_0x72d1('0x69'));}fs['unlinkSync'](_0x4121b2);logger['info'](_0x72d1('0x6a'));logger[_0x72d1('0x6b')](_0x72d1('0x6c'));});});}return null;})[_0x72d1('0x6d')](handleError(_0x588b5e,null));};exports[_0x72d1('0x6e')]=function(_0x4f2557,_0xcc3ebe,_0x2ff11a){var _0x2b7930=path[_0x72d1('0x64')](_0x4f2557[_0x72d1('0x6f')]['filename'],path['extname'](_0x4f2557[_0x72d1('0x6f')][_0x72d1('0x70')]));var _0x4e84e3=path['join'](config[_0x72d1('0x55')],_0x72d1('0x71'),_0x4f2557[_0x72d1('0x6f')]['filename']);var _0x58cb3a=path[_0x72d1('0x54')](config[_0x72d1('0x55')],_0x72d1('0x71'),_0x2b7930);logger[_0x72d1('0x6b')](_0x72d1('0x72'),_0x4e84e3);logger[_0x72d1('0x6b')]('Plugin\x20upload\x20destination:\x20%s',_0x58cb3a);try{fs[_0x72d1('0x73')](_0x4e84e3,parseInt(_0x72d1('0x74'),0x8));extract(_0x4e84e3,{'dir':_0x58cb3a},function(_0x483bbb){if(_0x483bbb){logger['error'](_0x483bbb);handleError(_0x483bbb,!![]);};var _0x5ed77c=fs[_0x72d1('0x75')](_0x58cb3a);if(_0x5ed77c[_0x72d1('0x4f')]>0x1){removeReferences(_0x4e84e3,_0x58cb3a);logger[_0x72d1('0x31')](_0x72d1('0x76'));return _0x2ff11a(new Error(_0x72d1('0x76')));}var _0x1abf32=fs['lstatSync'](path[_0x72d1('0x54')](_0x58cb3a,_0x5ed77c[0x0]));if(_0x1abf32[_0x72d1('0x77')]()){removeReferences(_0x4e84e3,_0x58cb3a);logger[_0x72d1('0x31')](_0x72d1('0x76'));return _0x2ff11a(new Error(_0x72d1('0x76')));}if(_0x1abf32[_0x72d1('0x78')]()){var _0x249619=fs[_0x72d1('0x75')](path['join'](_0x58cb3a,_0x5ed77c[0x0]));if(_0x249619[_0x72d1('0x4f')]===0x0){removeReferences(_0x4e84e3,_0x58cb3a);logger[_0x72d1('0x31')]('Invalid\x20plugin\x20structure');return _0x2ff11a(new Error(_0x72d1('0x76')));}var _0x57dc92=_0x249619['some'](function(_0x1c7abc){return _0x1c7abc===_0x72d1('0x79');});if(!_0x57dc92){return _0x2ff11a(new Error(_0x72d1('0x7a')));}var _0x258855=fs[_0x72d1('0x7b')](path['join'](_0x58cb3a,_0x5ed77c[0x0],_0x72d1('0x79')));var _0x51cc70=JSON['parse'](_0x258855);if(_0x72d1('0x25')==typeof _0x51cc70[_0x72d1('0x39')]){return _0x2ff11a(new Error(_0x72d1('0x7c')));}if(_0x72d1('0x25')==typeof _0x51cc70[_0x72d1('0x36')]){return _0x2ff11a(new Error(_0x72d1('0x7d')));}if('undefined'==typeof _0x51cc70[_0x72d1('0x7e')]){return _0x2ff11a(new Error(_0x72d1('0x7f')));}if(_0x72d1('0x25')==typeof _0x51cc70[_0x72d1('0x80')]){return _0x2ff11a(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x51cc70['type']===_0x72d1('0x81')){if(_0x72d1('0x25')==typeof _0x51cc70[_0x72d1('0x80')][_0x72d1('0x82')]){return _0x2ff11a(new Error(_0x72d1('0x83')));}if(_0x72d1('0x25')==typeof _0x51cc70[_0x72d1('0x80')][_0x72d1('0x82')][_0x72d1('0x84')]&&_0x72d1('0x25')==typeof _0x51cc70[_0x72d1('0x80')][_0x72d1('0x82')][_0x72d1('0x85')]){return _0x2ff11a(new Error(_0x72d1('0x86')));}}else if(_0x51cc70[_0x72d1('0x36')]==='script'){if(_0x72d1('0x25')==typeof _0x51cc70[_0x72d1('0x80')][_0x72d1('0x87')]){return _0x2ff11a(new Error(_0x72d1('0x88')));}if('undefined'==typeof _0x51cc70[_0x72d1('0x80')][_0x72d1('0x89')]){return _0x2ff11a(new Error(_0x72d1('0x8a')));}}else{return _0x2ff11a(new Error(_0x72d1('0x8b')));}var _0x47cb75=_0x51cc70['name'];var _0x48e47b=_0x51cc70[_0x72d1('0x8c')];var _0x37dda3=_0x51cc70[_0x72d1('0x36')];var _0x4b64b=_0x51cc70['sidebar']?_0x51cc70[_0x72d1('0x8d')]:_0x72d1('0x8e');var _0x5bb3c5=_0x51cc70[_0x72d1('0x8f')]?_0x51cc70[_0x72d1('0x8f')]:_0x72d1('0x90');var _0x4e8325='';var _0xa5c07c='';var _0x2c6d65='';var _0x50ab70='';var _0x54433d=_0x51cc70[_0x72d1('0x7e')];if(_0x37dda3==='html'){if('undefined'!=typeof _0x51cc70[_0x72d1('0x80')][_0x72d1('0x82')][_0x72d1('0x84')]){var _0x99520d=_0x51cc70[_0x72d1('0x80')][_0x72d1('0x82')][_0x72d1('0x84')];if(!/^(f|ht)tps?:\/\//i[_0x72d1('0x91')](_0x99520d)){_0x4e8325=path['join'](_0x72d1('0x92'),_0x2b7930,_0x5ed77c[0x0],_0x99520d);}else{_0x4e8325=_0x99520d;}}else{logger['info'](_0x72d1('0x93'));}if('undefined'!=typeof _0x51cc70[_0x72d1('0x80')][_0x72d1('0x82')][_0x72d1('0x85')]){var _0x54cdbd=_0x51cc70[_0x72d1('0x80')]['views'][_0x72d1('0x85')];if(!/^(f|ht)tps?:\/\//i[_0x72d1('0x91')](_0x54cdbd)){_0xa5c07c=path[_0x72d1('0x54')]('plugins',_0x2b7930,_0x5ed77c[0x0],_0x54cdbd);}else{_0xa5c07c=_0x54cdbd;}}else{logger[_0x72d1('0x6b')](_0x72d1('0x94'));}}else if(_0x37dda3===_0x72d1('0x95')){_0x2c6d65=_0x51cc70[_0x72d1('0x80')]['scriptName'];_0x50ab70=_0x51cc70[_0x72d1('0x80')][_0x72d1('0x89')];if(_0x72d1('0x25')!=typeof _0x51cc70[_0x72d1('0x80')]['views']){if(_0x72d1('0x25')!=typeof _0x51cc70[_0x72d1('0x80')][_0x72d1('0x82')][_0x72d1('0x84')]){var _0x99520d=_0x51cc70[_0x72d1('0x80')][_0x72d1('0x82')][_0x72d1('0x84')];if(!/^(f|ht)tps?:\/\//i['test'](_0x99520d)){_0x4e8325=path[_0x72d1('0x54')]('plugins',_0x2b7930,_0x5ed77c[0x0],_0x99520d);}else{_0x4e8325=_0x99520d;}}if(_0x72d1('0x25')!=typeof _0x51cc70[_0x72d1('0x80')][_0x72d1('0x82')][_0x72d1('0x85')]){var _0x54cdbd=_0x51cc70[_0x72d1('0x80')][_0x72d1('0x82')][_0x72d1('0x85')];if(!/^(f|ht)tps?:\/\//i['test'](_0x54cdbd)){_0xa5c07c=path['join'](_0x72d1('0x92'),_0x2b7930,_0x5ed77c[0x0],_0x54cdbd);}else{_0xa5c07c=_0x54cdbd;}}}}var _0x4e4818={'name':_0x47cb75,'description':_0x48e47b,'path':path['join'](_0x2b7930,_0x5ed77c[0x0]),'type':_0x37dda3,'sidebar':_0x4b64b,'icon':_0x5bb3c5,'adminUrl':_0x4e8325,'agentUrl':_0xa5c07c,'scriptName':_0x2c6d65,'scriptPath':_0x50ab70,'version':_0x54433d};removeReferences(_0x4e84e3,null);return db[_0x72d1('0x34')][_0x72d1('0x96')](_0x4e4818)[_0x72d1('0x2e')](function(_0x531754){var _0x24ed60={'role':_0x4f2557[_0x72d1('0x97')][_0x72d1('0x98')],'userProfileId':_0x4f2557['body'][_0x72d1('0x99')]};if(!_0x24ed60)throw new Error(_0x72d1('0x9a'));if(_0x24ed60[_0x72d1('0x98')]===_0x72d1('0x9b')){var _0x55b7e1=_0x531754[_0x72d1('0x2f')]({'plain':!![]});return db[_0x72d1('0x9c')][_0x72d1('0x52')]({'where':{'name':_0x72d1('0x9d'),'userProfileId':_0x24ed60[_0x72d1('0x99')]},'raw':!![]})[_0x72d1('0x2e')](function(_0x3d3e5a){if(_0x3d3e5a&&_0x3d3e5a[_0x72d1('0x9e')]===0x0){return db[_0x72d1('0x9f')][_0x72d1('0x96')]({'name':_0x55b7e1[_0x72d1('0x39')],'resourceId':_0x55b7e1['id'],'type':_0x3d3e5a[_0x72d1('0x39')],'sectionId':_0x3d3e5a['id']},{})[_0x72d1('0x2e')](function(){return _0x531754;});}else{return _0x531754;}})[_0x72d1('0x6d')](function(_0x4085dc){logger[_0x72d1('0x31')](_0x72d1('0xa0'),_0x4085dc);throw _0x4085dc;});}return _0x531754;})[_0x72d1('0x2e')](respondWithResult(_0xcc3ebe,null))[_0x72d1('0x6d')](handleError(_0xcc3ebe,null));}});}catch(_0x1c8ff1){_0xcc3ebe[_0x72d1('0x22')](0x1f4)['send'](_0x1c8ff1);}};function removeReferences(_0x56790d,_0x28c10b){try{if(_0x56790d){fs[_0x72d1('0xa1')](_0x56790d);logger[_0x72d1('0x6b')](_0x72d1('0xa2'));}if(_0x28c10b){rimraf(_0x28c10b,function(){});logger[_0x72d1('0x6b')](_0x72d1('0xa3'));}}catch(_0x322a85){logger[_0x72d1('0x31')](_0x322a85);}}exports[_0x72d1('0x2d')]=function(_0xcfd44a,_0x444847,_0xf96ea2){return db[_0x72d1('0x34')][_0x72d1('0x52')]({'where':{'id':_0xcfd44a[_0x72d1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x444847,null))[_0x72d1('0x2e')](saveUpdates(_0xcfd44a['body'],null))[_0x72d1('0x2e')](respondWithResult(_0x444847,null))[_0x72d1('0x6d')](handleError(_0x444847,null));};exports[_0x72d1('0xa4')]=function(_0x55992f,_0x1ebd28,_0x287f26){return db[_0x72d1('0x34')][_0x72d1('0x52')]({'where':{'id':_0x55992f[_0x72d1('0x4d')]['id']}})['then'](function(_0x574016){if(_0x574016){return _0x574016[_0x72d1('0x30')]();}})[_0x72d1('0x2e')](function(_0x26c481){rimraf(path[_0x72d1('0x54')](config[_0x72d1('0x55')],_0x72d1('0x71'),path[_0x72d1('0x62')](_0x26c481['path'])),function(){});return _0x26c481;})[_0x72d1('0x2e')](handleEntityNotFound(_0x1ebd28,null))[_0x72d1('0x2e')](respondWithStatusCode(_0x1ebd28,null))[_0x72d1('0x6d')](handleError(_0x1ebd28,null));};exports[_0x72d1('0xa5')]=function(_0x1a77c6,_0x453428,_0x26d0e6){return BPromise[_0x72d1('0xa6')]()[_0x72d1('0x2e')](function(){if(!_0x1a77c6[_0x72d1('0x3b')][_0x72d1('0x53')]){throw new Error(_0x72d1('0xa7'));}if(!_0x1a77c6['query'][_0x72d1('0xa8')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x183245=_0x1a77c6[_0x72d1('0x3b')]['hostname']?_0x1a77c6[_0x72d1('0x3b')][_0x72d1('0xa9')]+':'+_0x1a77c6['query'][_0x72d1('0xa8')]:'http://localhost:'+_0x1a77c6[_0x72d1('0x3b')][_0x72d1('0xa8')];var _0x24ac82=_0x1a77c6['query'][_0x72d1('0x23')]?_0x1a77c6[_0x72d1('0x3b')][_0x72d1('0x23')]:!![];var _0x59228f=_0x1a77c6[_0x72d1('0x3b')]['encoding']?_0x1a77c6['query'][_0x72d1('0xaa')]:null;var _0x22f1f9={'method':_0x1a77c6[_0x72d1('0xab')],'uri':util['format'](_0x72d1('0xac'),_0x183245,_0x1a77c6[_0x72d1('0x3b')][_0x72d1('0x53')]),'json':_0x24ac82,'resolveWithFullResponse':!![],'encoding':_0x59228f,'qs':_0x1a77c6[_0x72d1('0x3b')]};if(_0x1a77c6['headers']){_0x22f1f9[_0x72d1('0xad')]=_0x1a77c6[_0x72d1('0xad')];if(_0x22f1f9['headers']['content-length']){delete _0x22f1f9[_0x72d1('0xad')][_0x72d1('0xae')];}}if(_0x22f1f9[_0x72d1('0xad')][_0x72d1('0xaf')]){delete _0x22f1f9[_0x72d1('0xad')][_0x72d1('0xaf')];}return rp(_0x22f1f9);})[_0x72d1('0x2e')](function(_0x1717c3){if(_0x1717c3){_0x453428[_0x72d1('0x28')](_0x1717c3[_0x72d1('0xad')]);logger['info'](_0x1717c3['body']);if(_[_0x72d1('0xb0')](_0x1a77c6[_0x72d1('0x3b')][_0x72d1('0x53')],'download')&&_0x1717c3['statusCode']==0x1f4){return _0x453428['sendStatus'](_0x1717c3[_0x72d1('0xb1')]);}else{return _0x453428['status'](_0x1717c3[_0x72d1('0xb1')])['send'](_0x1717c3[_0x72d1('0x97')]);}}else{return _0x453428[_0x72d1('0x20')](0xc8);}})[_0x72d1('0x6d')](handleError(_0x453428,null));};exports[_0x72d1('0xb2')]=function(_0x4621ee,_0x2c9fdc,_0x2b74ea){return BPromise[_0x72d1('0xa6')]()[_0x72d1('0x2e')](function(){if(!_0x4621ee['query']['path']){throw new Error(_0x72d1('0xa7'));}if(!_0x4621ee[_0x72d1('0x3b')][_0x72d1('0xa8')]){throw new Error(_0x72d1('0xb3'));}var _0x312566=_0x4621ee[_0x72d1('0x3b')][_0x72d1('0xa9')]?_0x4621ee[_0x72d1('0x3b')][_0x72d1('0xa9')]+':'+_0x4621ee[_0x72d1('0x3b')]['port']:_0x72d1('0xb4')+_0x4621ee[_0x72d1('0x3b')][_0x72d1('0xa8')];var _0x108afa=_0x4621ee[_0x72d1('0x3b')][_0x72d1('0x23')]?_0x4621ee['query'][_0x72d1('0x23')]:!![];var _0x57cfc5=_0x4621ee[_0x72d1('0x3b')]['encoding']?_0x4621ee[_0x72d1('0x3b')]['encoding']:null;var _0x7048ba={'method':_0x4621ee[_0x72d1('0xab')],'uri':util['format'](_0x72d1('0xac'),_0x312566,_0x4621ee['query']['path']),'json':_0x108afa,'resolveWithFullResponse':!![],'encoding':_0x57cfc5,'body':_0x4621ee[_0x72d1('0x97')]};if(_0x4621ee['headers']){_0x7048ba[_0x72d1('0xad')]=_0x4621ee[_0x72d1('0xad')];if(_0x7048ba[_0x72d1('0xad')][_0x72d1('0xae')]){delete _0x7048ba[_0x72d1('0xad')]['content-length'];}}if(_0x7048ba[_0x72d1('0xad')][_0x72d1('0xaf')]){delete _0x7048ba[_0x72d1('0xad')][_0x72d1('0xaf')];}return rp(_0x7048ba);})[_0x72d1('0x2e')](function(_0x5b10bb){if(_0x5b10bb){_0x2c9fdc[_0x72d1('0x28')](_0x5b10bb['headers']);logger[_0x72d1('0x6b')](_0x5b10bb[_0x72d1('0x97')]);return _0x2c9fdc[_0x72d1('0x22')](_0x5b10bb[_0x72d1('0xb1')])[_0x72d1('0x32')](_0x5b10bb[_0x72d1('0x97')]);}else{return _0x2c9fdc[_0x72d1('0x20')](0xc8);}})[_0x72d1('0x6d')](handleError(_0x2c9fdc,null));};
\ No newline at end of file
+var _0xfcf6=['Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','Invalid\x20manifest:\x20views\x20missing','parameters','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','http://localhost:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./plugin.socket','register','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','destroy','get','Plugins','UserProfileResource','then','error','stack','name','send','index','map','fieldName','key','model','query','keys','filters','intersection','fields','attributes','nolimit','sort','filter','where','merge','type','VIRTUAL','options','Plugin','includeAll','include','rows','catch','show','params','length','find','download','join','root','server/files/plugins','format','basename','createWriteStream','zip','warning','code','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','dirname','finalize','close','existsSync','Plugin\x20not\x20found','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','filename','extname','file','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json'];(function(_0x5ac780,_0x4668c9){var _0x57d2f1=function(_0xf6905a){while(--_0xf6905a){_0x5ac780['push'](_0x5ac780['shift']());}};_0x57d2f1(++_0x4668c9);}(_0xfcf6,0x195));var _0x6fcf=function(_0x3fea87,_0x5917e4){_0x3fea87=_0x3fea87-0x0;var _0x5c5a53=_0xfcf6[_0x3fea87];return _0x5c5a53;};'use strict';var emlformat=require(_0x6fcf('0x0'));var rimraf=require(_0x6fcf('0x1'));var zipdir=require(_0x6fcf('0x2'));var jsonpatch=require(_0x6fcf('0x3'));var rp=require(_0x6fcf('0x4'));var moment=require(_0x6fcf('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6fcf('0x6'));var path=require(_0x6fcf('0x7'));var sox=require(_0x6fcf('0x8'));var csv=require(_0x6fcf('0x9'));var ejs=require(_0x6fcf('0xa'));var fs=require('fs');var fs_extra=require(_0x6fcf('0xb'));var _=require(_0x6fcf('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6fcf('0xd'));var deskjs=require(_0x6fcf('0xe'));var toCsv=require(_0x6fcf('0x9'));var querystring=require('querystring');var Papa=require(_0x6fcf('0xf'));var extract=require(_0x6fcf('0x10'));var rimraf=require(_0x6fcf('0x1'));var archiver=require(_0x6fcf('0x11'));var Redis=require(_0x6fcf('0x12'));var authService=require(_0x6fcf('0x13'));var qs=require(_0x6fcf('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6fcf('0x15'));var logger=require('../../config/logger')(_0x6fcf('0x16'));var utils=require(_0x6fcf('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6fcf('0x18'));var db=require(_0x6fcf('0x19'))['db'];config[_0x6fcf('0x1a')]=_[_0x6fcf('0x1b')](config[_0x6fcf('0x1a')],{'host':_0x6fcf('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6fcf('0x1d'))[_0x6fcf('0x1e')](socket);function respondWithStatusCode(_0x2ee3c0,_0x22a35a){_0x22a35a=_0x22a35a||0xcc;return function(_0x3fe5be){if(_0x3fe5be){return _0x2ee3c0[_0x6fcf('0x1f')](_0x22a35a);}return _0x2ee3c0['status'](_0x22a35a)[_0x6fcf('0x20')]();};}function respondWithResult(_0x4c271f,_0x185fcb){_0x185fcb=_0x185fcb||0xc8;return function(_0x582d8f){if(_0x582d8f){return _0x4c271f['status'](_0x185fcb)[_0x6fcf('0x21')](_0x582d8f);}};}function respondWithFilteredResult(_0x3180d3,_0x122be4){return function(_0x51f384){if(_0x51f384){var _0x25107b=typeof _0x122be4[_0x6fcf('0x22')]===_0x6fcf('0x23')&&typeof _0x122be4['limit']===_0x6fcf('0x23');var _0x5d4dcf=_0x51f384[_0x6fcf('0x24')];var _0x2016b9=_0x25107b?0x0:_0x122be4[_0x6fcf('0x22')];var _0x4b964e=_0x25107b?_0x51f384[_0x6fcf('0x24')]:_0x122be4['offset']+_0x122be4[_0x6fcf('0x25')];var _0x43b033;if(_0x4b964e>=_0x5d4dcf){_0x4b964e=_0x5d4dcf;_0x43b033=0xc8;}else{_0x43b033=0xce;}_0x3180d3[_0x6fcf('0x26')](_0x43b033);return _0x3180d3[_0x6fcf('0x27')](_0x6fcf('0x28'),_0x2016b9+'-'+_0x4b964e+'/'+_0x5d4dcf)[_0x6fcf('0x21')](_0x51f384);}return null;};}function patchUpdates(_0x1dbb89){return function(_0x57df26){try{jsonpatch[_0x6fcf('0x29')](_0x57df26,_0x1dbb89,!![]);}catch(_0x2624c9){return BPromise[_0x6fcf('0x2a')](_0x2624c9);}return _0x57df26[_0x6fcf('0x2b')]();};}function saveUpdates(_0x2c6a95,_0x31eeb4){return function(_0x5b06b2){if(_0x5b06b2){return _0x5b06b2[_0x6fcf('0x2c')](_0x2c6a95)['then'](function(_0x39e6c6){return _0x39e6c6;});}return null;};}function removeEntity(_0x25d5f4,_0x24da90){return function(_0x28be4a){if(_0x28be4a){return _0x28be4a[_0x6fcf('0x2d')]()['then'](function(){var _0x3d86c5=_0x28be4a[_0x6fcf('0x2e')]({'plain':!![]});var _0x153e92=_0x6fcf('0x2f');return db[_0x6fcf('0x30')]['destroy']({'where':{'type':_0x153e92,'resourceId':_0x3d86c5['id']}})[_0x6fcf('0x31')](function(){return _0x28be4a;});})[_0x6fcf('0x31')](function(){_0x25d5f4['status'](0xcc)[_0x6fcf('0x20')]();});}};}function handleEntityNotFound(_0x174094,_0x4635b7){return function(_0x34fb4d){if(!_0x34fb4d){_0x174094[_0x6fcf('0x1f')](0x194);}return _0x34fb4d;};}function handleError(_0xe57ea6,_0x355259){_0x355259=_0x355259||0x1f4;return function(_0x56e564){logger[_0x6fcf('0x32')](_0x56e564[_0x6fcf('0x33')]);if(_0x56e564['name']){delete _0x56e564[_0x6fcf('0x34')];}_0xe57ea6[_0x6fcf('0x26')](_0x355259)[_0x6fcf('0x35')](_0x56e564);};}exports[_0x6fcf('0x36')]=function(_0x55e073,_0x3ff1b4){var _0x25fe67={},_0x5b71b5={},_0x40d5b4={'count':0x0,'rows':[]};var _0x36d97a=_[_0x6fcf('0x37')](db['Plugin']['rawAttributes'],function(_0xc0f1f1){return{'name':_0xc0f1f1[_0x6fcf('0x38')],'type':_0xc0f1f1['type'][_0x6fcf('0x39')]};});_0x5b71b5[_0x6fcf('0x3a')]=_[_0x6fcf('0x37')](_0x36d97a,_0x6fcf('0x34'));_0x5b71b5[_0x6fcf('0x3b')]=_[_0x6fcf('0x3c')](_0x55e073[_0x6fcf('0x3b')]);_0x5b71b5[_0x6fcf('0x3d')]=_[_0x6fcf('0x3e')](_0x5b71b5['model'],_0x5b71b5[_0x6fcf('0x3b')]);_0x25fe67['attributes']=_[_0x6fcf('0x3e')](_0x5b71b5[_0x6fcf('0x3a')],qs[_0x6fcf('0x3f')](_0x55e073[_0x6fcf('0x3b')]['fields']));_0x25fe67[_0x6fcf('0x40')]=_0x25fe67['attributes']['length']?_0x25fe67[_0x6fcf('0x40')]:_0x5b71b5[_0x6fcf('0x3a')];if(!_0x55e073[_0x6fcf('0x3b')]['hasOwnProperty'](_0x6fcf('0x41'))){_0x25fe67[_0x6fcf('0x25')]=qs[_0x6fcf('0x25')](_0x55e073[_0x6fcf('0x3b')][_0x6fcf('0x25')]);_0x25fe67[_0x6fcf('0x22')]=qs[_0x6fcf('0x22')](_0x55e073['query'][_0x6fcf('0x22')]);}_0x25fe67['order']=qs[_0x6fcf('0x42')](_0x55e073[_0x6fcf('0x3b')][_0x6fcf('0x42')]);_0x25fe67['where']=qs['filters'](_['pick'](_0x55e073[_0x6fcf('0x3b')],_0x5b71b5[_0x6fcf('0x3d')]),_0x36d97a);if(_0x55e073[_0x6fcf('0x3b')][_0x6fcf('0x43')]){_0x25fe67[_0x6fcf('0x44')]=_[_0x6fcf('0x45')](_0x25fe67['where'],{'$or':_['map'](_0x36d97a,function(_0x76fe21){if(_0x76fe21[_0x6fcf('0x46')]!==_0x6fcf('0x47')){var _0x17d7df={};_0x17d7df[_0x76fe21[_0x6fcf('0x34')]]={'$like':'%'+_0x55e073[_0x6fcf('0x3b')][_0x6fcf('0x43')]+'%'};return _0x17d7df;}})});}_0x25fe67=_[_0x6fcf('0x45')]({},_0x25fe67,_0x55e073[_0x6fcf('0x48')]);var _0xe2e849={'where':_0x25fe67[_0x6fcf('0x44')]};return db[_0x6fcf('0x49')][_0x6fcf('0x24')](_0xe2e849)['then'](function(_0x926a41){_0x40d5b4[_0x6fcf('0x24')]=_0x926a41;if(_0x55e073[_0x6fcf('0x3b')][_0x6fcf('0x4a')]){_0x25fe67[_0x6fcf('0x4b')]=[{'all':!![]}];}return db[_0x6fcf('0x49')]['findAll'](_0x25fe67);})[_0x6fcf('0x31')](function(_0x3f697a){_0x40d5b4[_0x6fcf('0x4c')]=_0x3f697a;return _0x40d5b4;})[_0x6fcf('0x31')](respondWithFilteredResult(_0x3ff1b4,_0x25fe67))[_0x6fcf('0x4d')](handleError(_0x3ff1b4,null));};exports[_0x6fcf('0x4e')]=function(_0x2185df,_0x25963b){var _0x58c018={'raw':!![],'where':{'id':_0x2185df[_0x6fcf('0x4f')]['id']}},_0x24cd2d={};_0x24cd2d[_0x6fcf('0x3a')]=_[_0x6fcf('0x3c')](db[_0x6fcf('0x49')]['rawAttributes']);_0x24cd2d[_0x6fcf('0x3b')]=_['keys'](_0x2185df['query']);_0x24cd2d[_0x6fcf('0x3d')]=_['intersection'](_0x24cd2d[_0x6fcf('0x3a')],_0x24cd2d[_0x6fcf('0x3b')]);_0x58c018['attributes']=_['intersection'](_0x24cd2d[_0x6fcf('0x3a')],qs[_0x6fcf('0x3f')](_0x2185df['query']['fields']));_0x58c018['attributes']=_0x58c018[_0x6fcf('0x40')][_0x6fcf('0x50')]?_0x58c018[_0x6fcf('0x40')]:_0x24cd2d[_0x6fcf('0x3a')];if(_0x2185df[_0x6fcf('0x3b')]['includeAll']){_0x58c018[_0x6fcf('0x4b')]=[{'all':!![]}];}_0x58c018=_['merge']({},_0x58c018,_0x2185df['options']);return db['Plugin'][_0x6fcf('0x51')](_0x58c018)[_0x6fcf('0x31')](handleEntityNotFound(_0x25963b,null))[_0x6fcf('0x31')](respondWithResult(_0x25963b,null))[_0x6fcf('0x4d')](handleError(_0x25963b,null));};exports[_0x6fcf('0x52')]=function(_0x385f84,_0xabe8d9,_0x562d6e){return db[_0x6fcf('0x49')][_0x6fcf('0x51')]({'where':{'id':_0x385f84['params']['id']},'attributes':[_0x6fcf('0x34'),_0x6fcf('0x7')],'raw':!![]})[_0x6fcf('0x31')](handleEntityNotFound(_0xabe8d9,null))[_0x6fcf('0x31')](function(_0x56e16b){if(_0x56e16b){var _0x37dbe1=path[_0x6fcf('0x53')](config[_0x6fcf('0x54')],_0x6fcf('0x55'),util[_0x6fcf('0x56')]('%s.zip',path[_0x6fcf('0x57')](_0x56e16b[_0x6fcf('0x7')])));var _0x420435=fs[_0x6fcf('0x58')](_0x37dbe1);var _0x299e38=archiver(_0x6fcf('0x59'),{'zlib':{'level':0x9}});_0x299e38['on'](_0x6fcf('0x5a'),function(_0x22ba5a){if(_0x22ba5a[_0x6fcf('0x5b')]==='ENOENT'){logger[_0x6fcf('0x32')](_0x22ba5a);}else{throw new db[(_0x6fcf('0x5c'))][(_0x6fcf('0x5d'))](_0x6fcf('0x5e'));}});_0x299e38['on'](_0x6fcf('0x32'),function(_0x5c0c7){throw new db[(_0x6fcf('0x5c'))][(_0x6fcf('0x5d'))](_0x6fcf('0x5e'));});_0x299e38[_0x6fcf('0x5f')](_0x420435);_0x299e38[_0x6fcf('0x60')](_0x6fcf('0x61'),{'cwd':path[_0x6fcf('0x53')](config[_0x6fcf('0x54')],'server/files/plugins',path[_0x6fcf('0x62')](_0x56e16b[_0x6fcf('0x7')])),'ignore':[path[_0x6fcf('0x53')](path[_0x6fcf('0x57')](_0x56e16b[_0x6fcf('0x7')]),'node_modules/**/*'),path[_0x6fcf('0x53')](path[_0x6fcf('0x57')](_0x56e16b[_0x6fcf('0x7')]),'attachments/**/*')],'nodir':!![]})[_0x6fcf('0x63')]();_0x420435['on'](_0x6fcf('0x64'),function(){if(!fs[_0x6fcf('0x65')](_0x37dbe1)){throw new db[(_0x6fcf('0x5c'))][(_0x6fcf('0x5d'))](_0x6fcf('0x66'));}return _0xabe8d9[_0x6fcf('0x52')](_0x37dbe1,util[_0x6fcf('0x56')](_0x6fcf('0x67'),path[_0x6fcf('0x57')](_0x56e16b[_0x6fcf('0x7')])),function(_0x47933c){if(_0x47933c){throw new db[(_0x6fcf('0x5c'))][(_0x6fcf('0x5d'))](_0x6fcf('0x68'));}fs[_0x6fcf('0x69')](_0x37dbe1);logger[_0x6fcf('0x6a')](_0x6fcf('0x6b'));logger[_0x6fcf('0x6a')](_0x6fcf('0x6c'));});});}return null;})[_0x6fcf('0x4d')](handleError(_0xabe8d9,null));};exports[_0x6fcf('0x6d')]=function(_0x2df81a,_0x48cbee,_0x489f0c){var _0x5a9aad=path['basename'](_0x2df81a['file'][_0x6fcf('0x6e')],path[_0x6fcf('0x6f')](_0x2df81a[_0x6fcf('0x70')]['filename']));var _0x233191=path[_0x6fcf('0x53')](config[_0x6fcf('0x54')],_0x6fcf('0x55'),_0x2df81a[_0x6fcf('0x70')][_0x6fcf('0x6e')]);var _0x4badc0=path[_0x6fcf('0x53')](config[_0x6fcf('0x54')],'server/files/plugins',_0x5a9aad);logger[_0x6fcf('0x6a')](_0x6fcf('0x71'),_0x233191);logger[_0x6fcf('0x6a')](_0x6fcf('0x72'),_0x4badc0);try{fs[_0x6fcf('0x73')](_0x233191,parseInt('0777',0x8));extract(_0x233191,{'dir':_0x4badc0},function(_0x2cccec){if(_0x2cccec){logger[_0x6fcf('0x32')](_0x2cccec);handleError(_0x2cccec,!![]);};var _0x2961fc=fs[_0x6fcf('0x74')](_0x4badc0);if(_0x2961fc[_0x6fcf('0x50')]>0x1){removeReferences(_0x233191,_0x4badc0);logger[_0x6fcf('0x32')](_0x6fcf('0x75'));return _0x489f0c(new Error(_0x6fcf('0x75')));}var _0x54020a=fs[_0x6fcf('0x76')](path[_0x6fcf('0x53')](_0x4badc0,_0x2961fc[0x0]));if(_0x54020a[_0x6fcf('0x77')]()){removeReferences(_0x233191,_0x4badc0);logger[_0x6fcf('0x32')](_0x6fcf('0x75'));return _0x489f0c(new Error('Invalid\x20plugin\x20structure'));}if(_0x54020a[_0x6fcf('0x78')]()){var _0x1b4f61=fs['readdirSync'](path[_0x6fcf('0x53')](_0x4badc0,_0x2961fc[0x0]));if(_0x1b4f61[_0x6fcf('0x50')]===0x0){removeReferences(_0x233191,_0x4badc0);logger[_0x6fcf('0x32')]('Invalid\x20plugin\x20structure');return _0x489f0c(new Error('Invalid\x20plugin\x20structure'));}var _0xbf1e68=_0x1b4f61[_0x6fcf('0x79')](function(_0x19cd8d){return _0x19cd8d===_0x6fcf('0x7a');});if(!_0xbf1e68){return _0x489f0c(new Error(_0x6fcf('0x7b')));}var _0x39e4fe=fs[_0x6fcf('0x7c')](path[_0x6fcf('0x53')](_0x4badc0,_0x2961fc[0x0],_0x6fcf('0x7a')));var _0x3727c5=JSON['parse'](_0x39e4fe);if(_0x6fcf('0x23')==typeof _0x3727c5['name']){return _0x489f0c(new Error(_0x6fcf('0x7d')));}if(_0x6fcf('0x23')==typeof _0x3727c5['type']){return _0x489f0c(new Error(_0x6fcf('0x7e')));}if('undefined'==typeof _0x3727c5[_0x6fcf('0x7f')]){return _0x489f0c(new Error(_0x6fcf('0x80')));}if('undefined'==typeof _0x3727c5['parameters']){return _0x489f0c(new Error(_0x6fcf('0x81')));}if(_0x3727c5[_0x6fcf('0x46')]===_0x6fcf('0x82')){if(_0x6fcf('0x23')==typeof _0x3727c5['parameters']['views']){return _0x489f0c(new Error(_0x6fcf('0x83')));}if('undefined'==typeof _0x3727c5[_0x6fcf('0x84')][_0x6fcf('0x85')][_0x6fcf('0x86')]&&'undefined'==typeof _0x3727c5[_0x6fcf('0x84')]['views'][_0x6fcf('0x87')]){return _0x489f0c(new Error(_0x6fcf('0x88')));}}else if(_0x3727c5[_0x6fcf('0x46')]===_0x6fcf('0x89')){if(_0x6fcf('0x23')==typeof _0x3727c5['parameters'][_0x6fcf('0x8a')]){return _0x489f0c(new Error(_0x6fcf('0x8b')));}if(_0x6fcf('0x23')==typeof _0x3727c5[_0x6fcf('0x84')][_0x6fcf('0x8c')]){return _0x489f0c(new Error(_0x6fcf('0x8d')));}}else{return _0x489f0c(new Error(_0x6fcf('0x8e')));}var _0x10e2fc=_0x3727c5['name'];var _0x1ebb8e=_0x3727c5[_0x6fcf('0x8f')];var _0x35b668=_0x3727c5[_0x6fcf('0x46')];var _0x4a6c3f=_0x3727c5[_0x6fcf('0x90')]?_0x3727c5[_0x6fcf('0x90')]:_0x6fcf('0x91');var _0x137b99=_0x3727c5['icon']?_0x3727c5[_0x6fcf('0x92')]:_0x6fcf('0x93');var _0x2e8876='';var _0x9fd427='';var _0x527431='';var _0x16d082='';var _0x318001=_0x3727c5[_0x6fcf('0x7f')];if(_0x35b668===_0x6fcf('0x82')){if(_0x6fcf('0x23')!=typeof _0x3727c5['parameters']['views'][_0x6fcf('0x86')]){var _0x4ef529=_0x3727c5[_0x6fcf('0x84')]['views'][_0x6fcf('0x86')];if(!/^(f|ht)tps?:\/\//i[_0x6fcf('0x94')](_0x4ef529)){_0x2e8876=path[_0x6fcf('0x53')](_0x6fcf('0x95'),_0x5a9aad,_0x2961fc[0x0],_0x4ef529);}else{_0x2e8876=_0x4ef529;}}else{logger[_0x6fcf('0x6a')](_0x6fcf('0x96'));}if(_0x6fcf('0x23')!=typeof _0x3727c5['parameters'][_0x6fcf('0x85')]['agent']){var _0x42edf9=_0x3727c5['parameters'][_0x6fcf('0x85')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x42edf9)){_0x9fd427=path[_0x6fcf('0x53')](_0x6fcf('0x95'),_0x5a9aad,_0x2961fc[0x0],_0x42edf9);}else{_0x9fd427=_0x42edf9;}}else{logger[_0x6fcf('0x6a')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x35b668==='script'){_0x527431=_0x3727c5[_0x6fcf('0x84')][_0x6fcf('0x8a')];_0x16d082=_0x3727c5[_0x6fcf('0x84')][_0x6fcf('0x8c')];if('undefined'!=typeof _0x3727c5[_0x6fcf('0x84')][_0x6fcf('0x85')]){if('undefined'!=typeof _0x3727c5[_0x6fcf('0x84')][_0x6fcf('0x85')][_0x6fcf('0x86')]){var _0x4ef529=_0x3727c5[_0x6fcf('0x84')][_0x6fcf('0x85')][_0x6fcf('0x86')];if(!/^(f|ht)tps?:\/\//i[_0x6fcf('0x94')](_0x4ef529)){_0x2e8876=path[_0x6fcf('0x53')](_0x6fcf('0x95'),_0x5a9aad,_0x2961fc[0x0],_0x4ef529);}else{_0x2e8876=_0x4ef529;}}if(_0x6fcf('0x23')!=typeof _0x3727c5[_0x6fcf('0x84')][_0x6fcf('0x85')][_0x6fcf('0x87')]){var _0x42edf9=_0x3727c5['parameters'][_0x6fcf('0x85')][_0x6fcf('0x87')];if(!/^(f|ht)tps?:\/\//i['test'](_0x42edf9)){_0x9fd427=path['join']('plugins',_0x5a9aad,_0x2961fc[0x0],_0x42edf9);}else{_0x9fd427=_0x42edf9;}}}}var _0x54e897={'name':_0x10e2fc,'description':_0x1ebb8e,'path':path['join'](_0x5a9aad,_0x2961fc[0x0]),'type':_0x35b668,'sidebar':_0x4a6c3f,'icon':_0x137b99,'adminUrl':_0x2e8876,'agentUrl':_0x9fd427,'scriptName':_0x527431,'scriptPath':_0x16d082,'version':_0x318001};removeReferences(_0x233191,null);return db[_0x6fcf('0x49')][_0x6fcf('0x97')](_0x54e897)[_0x6fcf('0x31')](function(_0xfd641d){var _0x526cad={'role':_0x2df81a[_0x6fcf('0x98')][_0x6fcf('0x99')],'userProfileId':_0x2df81a[_0x6fcf('0x98')][_0x6fcf('0x9a')]};if(!_0x526cad)throw new Error(_0x6fcf('0x9b'));if(_0x526cad[_0x6fcf('0x99')]==='user'){var _0x27d0c3=_0xfd641d[_0x6fcf('0x2e')]({'plain':!![]});return db[_0x6fcf('0x9c')][_0x6fcf('0x51')]({'where':{'name':_0x6fcf('0x2f'),'userProfileId':_0x526cad[_0x6fcf('0x9a')]},'raw':!![]})['then'](function(_0x9600ad){if(_0x9600ad&&_0x9600ad[_0x6fcf('0x9d')]===0x0){return db['UserProfileResource']['create']({'name':_0x27d0c3[_0x6fcf('0x34')],'resourceId':_0x27d0c3['id'],'type':_0x9600ad[_0x6fcf('0x34')],'sectionId':_0x9600ad['id']},{})[_0x6fcf('0x31')](function(){return _0xfd641d;});}else{return _0xfd641d;}})['catch'](function(_0x37c629){logger['error'](_0x6fcf('0x9e'),_0x37c629);throw _0x37c629;});}return _0xfd641d;})[_0x6fcf('0x31')](respondWithResult(_0x48cbee,null))['catch'](handleError(_0x48cbee,null));}});}catch(_0x2b7f3c){_0x48cbee[_0x6fcf('0x26')](0x1f4)[_0x6fcf('0x35')](_0x2b7f3c);}};function removeReferences(_0x5a6c44,_0x117fe5){try{if(_0x5a6c44){fs[_0x6fcf('0x69')](_0x5a6c44);logger[_0x6fcf('0x6a')]('Zip\x20archive\x20removed');}if(_0x117fe5){rimraf(_0x117fe5,function(){});logger[_0x6fcf('0x6a')]('Extracted\x20folder\x20removed');}}catch(_0x1928c2){logger['error'](_0x1928c2);}}exports['update']=function(_0x20fce6,_0xc71370,_0x185b5c){return db[_0x6fcf('0x49')][_0x6fcf('0x51')]({'where':{'id':_0x20fce6['params']['id']}})['then'](handleEntityNotFound(_0xc71370,null))[_0x6fcf('0x31')](saveUpdates(_0x20fce6['body'],null))[_0x6fcf('0x31')](respondWithResult(_0xc71370,null))[_0x6fcf('0x4d')](handleError(_0xc71370,null));};exports[_0x6fcf('0x9f')]=function(_0x3a5031,_0x15b6ee,_0x259f00){return db[_0x6fcf('0x49')][_0x6fcf('0x51')]({'where':{'id':_0x3a5031[_0x6fcf('0x4f')]['id']}})[_0x6fcf('0x31')](function(_0x5d4761){if(_0x5d4761){return _0x5d4761[_0x6fcf('0x2d')]();}})[_0x6fcf('0x31')](function(_0x517054){rimraf(path[_0x6fcf('0x53')](config['root'],_0x6fcf('0x55'),path['dirname'](_0x517054[_0x6fcf('0x7')])),function(){});return _0x517054;})['then'](handleEntityNotFound(_0x15b6ee,null))[_0x6fcf('0x31')](respondWithStatusCode(_0x15b6ee,null))[_0x6fcf('0x4d')](handleError(_0x15b6ee,null));};exports[_0x6fcf('0xa0')]=function(_0x520808,_0x246b25,_0x4fea93){return BPromise[_0x6fcf('0xa1')]()[_0x6fcf('0x31')](function(){if(!_0x520808[_0x6fcf('0x3b')][_0x6fcf('0x7')]){throw new Error(_0x6fcf('0xa2'));}if(!_0x520808['query']['port']){throw new Error(_0x6fcf('0xa3'));}var _0x11302a=_0x520808[_0x6fcf('0x3b')][_0x6fcf('0xa4')]?_0x520808[_0x6fcf('0x3b')][_0x6fcf('0xa4')]+':'+_0x520808[_0x6fcf('0x3b')]['port']:'http://localhost:'+_0x520808[_0x6fcf('0x3b')][_0x6fcf('0xa5')];var _0x90939c=_0x520808[_0x6fcf('0x3b')][_0x6fcf('0x21')]?_0x520808[_0x6fcf('0x3b')][_0x6fcf('0x21')]:!![];var _0xa37d52=_0x520808[_0x6fcf('0x3b')][_0x6fcf('0xa6')]?_0x520808['query'][_0x6fcf('0xa6')]:null;var _0x21a83c={'method':_0x520808[_0x6fcf('0xa7')],'uri':util[_0x6fcf('0x56')](_0x6fcf('0xa8'),_0x11302a,_0x520808['query'][_0x6fcf('0x7')]),'json':_0x90939c,'resolveWithFullResponse':!![],'encoding':_0xa37d52,'qs':_0x520808[_0x6fcf('0x3b')]};if(_0x520808[_0x6fcf('0xa9')]){_0x21a83c[_0x6fcf('0xa9')]=_0x520808['headers'];if(_0x21a83c[_0x6fcf('0xa9')][_0x6fcf('0xaa')]){delete _0x21a83c[_0x6fcf('0xa9')][_0x6fcf('0xaa')];}}if(_0x21a83c[_0x6fcf('0xa9')]['content-type']){delete _0x21a83c[_0x6fcf('0xa9')][_0x6fcf('0xab')];}return rp(_0x21a83c);})[_0x6fcf('0x31')](function(_0x57b92f){if(_0x57b92f){_0x246b25[_0x6fcf('0x27')](_0x57b92f[_0x6fcf('0xa9')]);logger[_0x6fcf('0x6a')](_0x57b92f['body']);if(_[_0x6fcf('0xac')](_0x520808['query'][_0x6fcf('0x7')],_0x6fcf('0x52'))&&_0x57b92f[_0x6fcf('0xad')]==0x1f4){return _0x246b25[_0x6fcf('0x1f')](_0x57b92f[_0x6fcf('0xad')]);}else{return _0x246b25[_0x6fcf('0x26')](_0x57b92f[_0x6fcf('0xad')])['send'](_0x57b92f[_0x6fcf('0x98')]);}}else{return _0x246b25[_0x6fcf('0x1f')](0xc8);}})[_0x6fcf('0x4d')](handleError(_0x246b25,null));};exports[_0x6fcf('0xae')]=function(_0x486edb,_0x14a0a0,_0x218683){return BPromise[_0x6fcf('0xa1')]()[_0x6fcf('0x31')](function(){if(!_0x486edb[_0x6fcf('0x3b')]['path']){throw new Error(_0x6fcf('0xa2'));}if(!_0x486edb['query'][_0x6fcf('0xa5')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x1d2db0=_0x486edb['query'][_0x6fcf('0xa4')]?_0x486edb['query'][_0x6fcf('0xa4')]+':'+_0x486edb['query']['port']:_0x6fcf('0xaf')+_0x486edb[_0x6fcf('0x3b')][_0x6fcf('0xa5')];var _0x430f81=_0x486edb[_0x6fcf('0x3b')][_0x6fcf('0x21')]?_0x486edb[_0x6fcf('0x3b')]['json']:!![];var _0x326264=_0x486edb[_0x6fcf('0x3b')]['encoding']?_0x486edb[_0x6fcf('0x3b')][_0x6fcf('0xa6')]:null;var _0x3ad986={'method':_0x486edb[_0x6fcf('0xa7')],'uri':util[_0x6fcf('0x56')](_0x6fcf('0xa8'),_0x1d2db0,_0x486edb[_0x6fcf('0x3b')][_0x6fcf('0x7')]),'json':_0x430f81,'resolveWithFullResponse':!![],'encoding':_0x326264,'body':_0x486edb[_0x6fcf('0x98')]};if(_0x486edb[_0x6fcf('0xa9')]){_0x3ad986[_0x6fcf('0xa9')]=_0x486edb[_0x6fcf('0xa9')];if(_0x3ad986[_0x6fcf('0xa9')][_0x6fcf('0xaa')]){delete _0x3ad986[_0x6fcf('0xa9')][_0x6fcf('0xaa')];}}if(_0x3ad986[_0x6fcf('0xa9')][_0x6fcf('0xab')]){delete _0x3ad986[_0x6fcf('0xa9')][_0x6fcf('0xab')];}return rp(_0x3ad986);})[_0x6fcf('0x31')](function(_0x6aa62a){if(_0x6aa62a){_0x14a0a0['set'](_0x6aa62a[_0x6fcf('0xa9')]);logger[_0x6fcf('0x6a')](_0x6aa62a[_0x6fcf('0x98')]);return _0x14a0a0[_0x6fcf('0x26')](_0x6aa62a['statusCode'])[_0x6fcf('0x35')](_0x6aa62a['body']);}else{return _0x14a0a0[_0x6fcf('0x1f')](0xc8);}})['catch'](handleError(_0x14a0a0,null));};
\ No newline at end of file
index bcf5351..9e3d2eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6132=['../../mysqldb','Plugin','setMaxListeners','update','remove','hasOwnProperty','hook','exports','events'];(function(_0x5146bf,_0xd8cb9e){var _0x2d447d=function(_0x3d6c8d){while(--_0x3d6c8d){_0x5146bf['push'](_0x5146bf['shift']());}};_0x2d447d(++_0xd8cb9e);}(_0x6132,0x13a));var _0x2613=function(_0x340857,_0x4031fd){_0x340857=_0x340857-0x0;var _0x2b0268=_0x6132[_0x340857];return _0x2b0268;};'use strict';var EventEmitter=require(_0x2613('0x0'));var Plugin=require(_0x2613('0x1'))['db'][_0x2613('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x2613('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2613('0x4'),'afterDestroy':_0x2613('0x5')};function emitEvent(_0x2890f9){return function(_0x35c979,_0x555746,_0x8d00d8){PluginEvents['emit'](_0x2890f9+':'+_0x35c979['id'],_0x35c979);PluginEvents['emit'](_0x2890f9,_0x35c979);_0x8d00d8(null);};}for(var e in events){if(events[_0x2613('0x6')](e)){var event=events[e];Plugin[_0x2613('0x7')](e,emitEvent(event));}}module[_0x2613('0x8')]=PluginEvents;
\ No newline at end of file
+var _0x2f4a=['events','../../mysqldb','Plugin','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x366e75,_0x533d1d){var _0x3b167b=function(_0x3e9f1d){while(--_0x3e9f1d){_0x366e75['push'](_0x366e75['shift']());}};_0x3b167b(++_0x533d1d);}(_0x2f4a,0x8f));var _0xa2f4=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x2f4a[_0x47e7cb];return _0x2a8874;};'use strict';var EventEmitter=require(_0xa2f4('0x0'));var Plugin=require(_0xa2f4('0x1'))['db'][_0xa2f4('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xa2f4('0x3')](0x0);var events={'afterCreate':_0xa2f4('0x4'),'afterUpdate':_0xa2f4('0x5'),'afterDestroy':_0xa2f4('0x6')};function emitEvent(_0x17ea32){return function(_0x3ba23a,_0x24aaf4,_0x4b22d6){PluginEvents[_0xa2f4('0x7')](_0x17ea32+':'+_0x3ba23a['id'],_0x3ba23a);PluginEvents[_0xa2f4('0x7')](_0x17ea32,_0x3ba23a);_0x4b22d6(null);};}for(var e in events){if(events[_0xa2f4('0x8')](e)){var event=events[e];Plugin[_0xa2f4('0x9')](e,emitEvent(event));}}module[_0xa2f4('0xa')]=PluginEvents;
\ No newline at end of file
index 7caaa39..3f9e155 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc534=['request-promise','rimraf','./plugin.attributes','exports','define','Plugin','plugins','util','../../config/logger','moment','bluebird'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xc534,0x1ca));var _0x4c53=function(_0x4f0e62,_0x28e44f){_0x4f0e62=_0x4f0e62-0x0;var _0x117ab8=_0xc534[_0x4f0e62];return _0x117ab8;};'use strict';var _=require('lodash');var util=require(_0x4c53('0x0'));var logger=require(_0x4c53('0x1'))('api');var moment=require(_0x4c53('0x2'));var BPromise=require(_0x4c53('0x3'));var rp=require(_0x4c53('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4c53('0x5'));var config=require('../../config/environment');var attributes=require(_0x4c53('0x6'));module[_0x4c53('0x7')]=function(_0x424af0,_0x4432cd){return _0x424af0[_0x4c53('0x8')](_0x4c53('0x9'),attributes,{'tableName':_0x4c53('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x28aa=['plugins','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./plugin.attributes','exports','define','Plugin'];(function(_0x265a7f,_0x5ddac4){var _0x6fd9cd=function(_0x19ae46){while(--_0x19ae46){_0x265a7f['push'](_0x265a7f['shift']());}};_0x6fd9cd(++_0x5ddac4);}(_0x28aa,0xf8));var _0xa28a=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0x28aa[_0x5037ab];return _0x512adb;};'use strict';var _=require('lodash');var util=require(_0xa28a('0x0'));var logger=require(_0xa28a('0x1'))(_0xa28a('0x2'));var moment=require(_0xa28a('0x3'));var BPromise=require(_0xa28a('0x4'));var rp=require(_0xa28a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa28a('0x6'));var config=require(_0xa28a('0x7'));var attributes=require(_0xa28a('0x8'));module[_0xa28a('0x9')]=function(_0x526dec,_0x1fbde2){return _0x526dec[_0xa28a('0xa')](_0xa28a('0xb'),attributes,{'tableName':_0xa28a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 77934b0..946e24b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c5f=['message','info','result','catch','CreatePlugin','Plugin','create','body','options','raw','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','then','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x1c5f,0x1ea));var _0xf1c5=function(_0x4ce469,_0x5f0a0e){_0x4ce469=_0x4ce469-0x0;var _0x3a51ce=_0x1c5f[_0x4ce469];return _0x3a51ce;};'use strict';var _=require(_0xf1c5('0x0'));var util=require('util');var moment=require(_0xf1c5('0x1'));var BPromise=require(_0xf1c5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf1c5('0x3'));var db=require(_0xf1c5('0x4'))['db'];var utils=require(_0xf1c5('0x5'));var logger=require(_0xf1c5('0x6'))(_0xf1c5('0x7'));var config=require(_0xf1c5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf1c5('0x9')][_0xf1c5('0xa')]({'port':0x232a});config[_0xf1c5('0xb')]=_[_0xf1c5('0xc')](config[_0xf1c5('0xb')],{'host':_0xf1c5('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf1c5('0xb')]));require('./plugin.socket')['register'](socket);function respondWithRpcPromise(_0x5392ad,_0x4ac52e,_0x3604c8){return new BPromise(function(_0x4b32b2,_0x11553f){return client['request'](_0x5392ad,_0x3604c8)[_0xf1c5('0xe')](function(_0x28d692){logger['info'](_0xf1c5('0xf'),_0x4ac52e,_0xf1c5('0x10'));logger[_0xf1c5('0x11')](_0xf1c5('0x12'),_0x4ac52e,_0xf1c5('0x10'),JSON[_0xf1c5('0x13')](_0x28d692));if(_0x28d692[_0xf1c5('0x14')]){if(_0x28d692['error'][_0xf1c5('0x15')]===0x1f4){logger[_0xf1c5('0x14')]('Plugin,\x20%s,\x20%s',_0x4ac52e,_0x28d692[_0xf1c5('0x14')]['message']);return _0x11553f(_0x28d692['error']['message']);}logger[_0xf1c5('0x14')]('Plugin,\x20%s,\x20%s',_0x4ac52e,_0x28d692[_0xf1c5('0x14')]['message']);return _0x4b32b2(_0x28d692['error'][_0xf1c5('0x16')]);}else{logger[_0xf1c5('0x17')](_0xf1c5('0xf'),_0x4ac52e,'request\x20sent');_0x4b32b2(_0x28d692[_0xf1c5('0x18')][_0xf1c5('0x16')]);}})[_0xf1c5('0x19')](function(_0x3e6b2e){logger[_0xf1c5('0x14')](_0xf1c5('0xf'),_0x4ac52e,_0x3e6b2e);_0x11553f(_0x3e6b2e);});});}exports[_0xf1c5('0x1a')]=function(_0x26e6d1){var _0x2acaa6=this;return new Promise(function(_0x2df623,_0xb7a8c6){return db[_0xf1c5('0x1b')][_0xf1c5('0x1c')](_0x26e6d1[_0xf1c5('0x1d')],{'raw':_0x26e6d1[_0xf1c5('0x1e')]?_0x26e6d1[_0xf1c5('0x1e')][_0xf1c5('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x5e1dee){logger['info'](_0xf1c5('0x1a'),_0x26e6d1);logger[_0xf1c5('0x11')](_0xf1c5('0x1a'),_0x26e6d1,JSON[_0xf1c5('0x13')](_0x5e1dee));_0x2df623(_0x5e1dee);})['catch'](function(_0x23e31b){logger[_0xf1c5('0x14')]('CreatePlugin',_0x23e31b[_0xf1c5('0x16')],_0x26e6d1);_0xb7a8c6(_0x2acaa6[_0xf1c5('0x14')](0x1f4,_0x23e31b[_0xf1c5('0x16')]));});});};
\ No newline at end of file
+var _0xd9ef=['socket.io-emitter','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreatePlugin','Plugin','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis'];(function(_0x5c257e,_0x1542d5){var _0x165a24=function(_0x61c337){while(--_0x61c337){_0x5c257e['push'](_0x5c257e['shift']());}};_0x165a24(++_0x1542d5);}(_0xd9ef,0x133));var _0xfd9e=function(_0x85b14,_0x41e94f){_0x85b14=_0x85b14-0x0;var _0x3239b8=_0xd9ef[_0x85b14];return _0x3239b8;};'use strict';var _=require(_0xfd9e('0x0'));var util=require(_0xfd9e('0x1'));var moment=require(_0xfd9e('0x2'));var BPromise=require(_0xfd9e('0x3'));var rs=require(_0xfd9e('0x4'));var fs=require('fs');var Redis=require(_0xfd9e('0x5'));var db=require(_0xfd9e('0x6'))['db'];var utils=require(_0xfd9e('0x7'));var logger=require('../../config/logger')(_0xfd9e('0x8'));var config=require(_0xfd9e('0x9'));var jayson=require(_0xfd9e('0xa'));var client=jayson[_0xfd9e('0xb')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xfd9e('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xfd9e('0xd'))(new Redis(config[_0xfd9e('0xc')]));require('./plugin.socket')[_0xfd9e('0xe')](socket);function respondWithRpcPromise(_0x1abc1e,_0x3247c5,_0x270334){return new BPromise(function(_0x1d12ea,_0x5d3762){return client[_0xfd9e('0xf')](_0x1abc1e,_0x270334)[_0xfd9e('0x10')](function(_0x43d098){logger[_0xfd9e('0x11')](_0xfd9e('0x12'),_0x3247c5,_0xfd9e('0x13'));logger[_0xfd9e('0x14')](_0xfd9e('0x15'),_0x3247c5,'request\x20sent',JSON[_0xfd9e('0x16')](_0x43d098));if(_0x43d098['error']){if(_0x43d098[_0xfd9e('0x17')][_0xfd9e('0x18')]===0x1f4){logger[_0xfd9e('0x17')](_0xfd9e('0x12'),_0x3247c5,_0x43d098[_0xfd9e('0x17')][_0xfd9e('0x19')]);return _0x5d3762(_0x43d098['error'][_0xfd9e('0x19')]);}logger['error'](_0xfd9e('0x12'),_0x3247c5,_0x43d098[_0xfd9e('0x17')]['message']);return _0x1d12ea(_0x43d098[_0xfd9e('0x17')][_0xfd9e('0x19')]);}else{logger[_0xfd9e('0x11')](_0xfd9e('0x12'),_0x3247c5,_0xfd9e('0x13'));_0x1d12ea(_0x43d098['result']['message']);}})[_0xfd9e('0x1a')](function(_0x31f9c4){logger[_0xfd9e('0x17')](_0xfd9e('0x12'),_0x3247c5,_0x31f9c4);_0x5d3762(_0x31f9c4);});});}exports[_0xfd9e('0x1b')]=function(_0xb3496f){var _0xb6ded8=this;return new Promise(function(_0x5e7879,_0x13e7d7){return db[_0xfd9e('0x1c')]['create'](_0xb3496f[_0xfd9e('0x1d')],{'raw':_0xb3496f[_0xfd9e('0x1e')]?_0xb3496f[_0xfd9e('0x1e')][_0xfd9e('0x1f')]===undefined?!![]:![]:!![]})[_0xfd9e('0x10')](function(_0x133512){logger[_0xfd9e('0x11')](_0xfd9e('0x1b'),_0xb3496f);logger[_0xfd9e('0x14')](_0xfd9e('0x1b'),_0xb3496f,JSON[_0xfd9e('0x16')](_0x133512));_0x5e7879(_0x133512);})[_0xfd9e('0x1a')](function(_0x546427){logger[_0xfd9e('0x17')](_0xfd9e('0x1b'),_0x546427[_0xfd9e('0x19')],_0xb3496f);_0x13e7d7(_0xb6ded8[_0xfd9e('0x17')](0x1f4,_0x546427[_0xfd9e('0x19')]));});});};
\ No newline at end of file
index 360c3ea..37dc4cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0095=['length','plugin:','./plugin.events','save','remove','update','emit','removeListener','register'];(function(_0xaacb2a,_0xa0f70c){var _0x494a8c=function(_0x32ecc0){while(--_0x32ecc0){_0xaacb2a['push'](_0xaacb2a['shift']());}};_0x494a8c(++_0xa0f70c);}(_0x0095,0x107));var _0x5009=function(_0x27f019,_0x160b9f){_0x27f019=_0x27f019-0x0;var _0x38b90d=_0x0095[_0x27f019];return _0x38b90d;};'use strict';var PluginEvents=require(_0x5009('0x0'));var events=[_0x5009('0x1'),_0x5009('0x2'),_0x5009('0x3')];function createListener(_0x45ba9d,_0x113cf5){return function(_0xe1cf0d){_0x113cf5[_0x5009('0x4')](_0x45ba9d,_0xe1cf0d);};}function removeListener(_0x4c96a8,_0x2de263){return function(){PluginEvents[_0x5009('0x5')](_0x4c96a8,_0x2de263);};}exports[_0x5009('0x6')]=function(_0x3b5402){for(var _0x397003=0x0,_0x3799fd=events[_0x5009('0x7')];_0x397003<_0x3799fd;_0x397003++){var _0x50833c=events[_0x397003];var _0x17c41a=createListener(_0x5009('0x8')+_0x50833c,_0x3b5402);PluginEvents['on'](_0x50833c,_0x17c41a);}};
\ No newline at end of file
+var _0x0dcf=['emit','removeListener','length','./plugin.events','save','update'];(function(_0x5277f9,_0x300dfc){var _0x20c80f=function(_0x4f52d7){while(--_0x4f52d7){_0x5277f9['push'](_0x5277f9['shift']());}};_0x20c80f(++_0x300dfc);}(_0x0dcf,0x171));var _0xf0dc=function(_0x51b2cf,_0x1af1ce){_0x51b2cf=_0x51b2cf-0x0;var _0x135cf8=_0x0dcf[_0x51b2cf];return _0x135cf8;};'use strict';var PluginEvents=require(_0xf0dc('0x0'));var events=[_0xf0dc('0x1'),'remove',_0xf0dc('0x2')];function createListener(_0x53070e,_0x57d43b){return function(_0x19b122){_0x57d43b[_0xf0dc('0x3')](_0x53070e,_0x19b122);};}function removeListener(_0x2fee05,_0x592341){return function(){PluginEvents[_0xf0dc('0x4')](_0x2fee05,_0x592341);};}exports['register']=function(_0xf0ef2e){for(var _0x3e0de0=0x0,_0x1aee9d=events[_0xf0dc('0x5')];_0x3e0de0<_0x1aee9d;_0x3e0de0++){var _0x488825=events[_0x3e0de0];var _0x35258a=createListener('plugin:'+_0x488825,_0xf0ef2e);PluginEvents['on'](_0x488825,_0x35258a);}};
\ No newline at end of file
index ab3c9fa..9a385c2 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(_0x2100d0,_0x1ec817){var _0x483071=function(_0x3de2c7){while(--_0x3de2c7){_0x2100d0['push'](_0x2100d0['shift']());}};_0x483071(++_0x1ec817);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'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(_0x334912,_0x4f4a08){var _0xe7b006=function(_0x37b073){while(--_0x37b073){_0x334912['push'](_0x334912['shift']());}};_0xe7b006(++_0x4f4a08);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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 5dad9e4..ba04c57 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e5=['info','error','list','then','reject','motion2','catch','show','describe','params','create','body','script','join','../../files/plugins','cwd','dirname','chdir','start','dump','send','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','Unknown\x20status','destroy','delete','../../config/pm2','api','path','child_process','exec','bluebird','sendStatus','status','name','npm\x20install'];(function(_0x372a8e,_0x16a38d){var _0x39aa2d=function(_0x5e7ba7){while(--_0x5e7ba7){_0x372a8e['push'](_0x372a8e['shift']());}};_0x39aa2d(++_0x16a38d);}(_0x34e5,0x172));var _0x534e=function(_0x2b6a8b,_0x58744a){_0x2b6a8b=_0x2b6a8b-0x0;var _0xa8713a=_0x34e5[_0x2b6a8b];return _0xa8713a;};'use strict';var _=require('lodash');var pm2=require(_0x534e('0x0'));var logger=require('../../config/logger')(_0x534e('0x1'));var path=require(_0x534e('0x2'));var exec=require(_0x534e('0x3'))[_0x534e('0x4')];var BPromise=require(_0x534e('0x5'));function handleEntityNotFound(_0x50b790,_0x11a158){return function(_0x3d8287){if(!_0x3d8287){_0x50b790[_0x534e('0x6')](0x194);;}return _0x3d8287;};}function respondWithResult(_0x117f0c,_0x436a92){_0x436a92=_0x436a92||0xc8;return function(_0x2d0370){if(_0x2d0370){return _0x117f0c[_0x534e('0x7')](_0x436a92)['json'](_0x2d0370);}return null;};}function handleError(_0x24d562,_0x929597){_0x929597=_0x929597||0x1f4;return function(_0xa836bb){logger['error'](_0xa836bb['stack']);if(_0xa836bb[_0x534e('0x8')]){delete _0xa836bb['name'];}_0x24d562[_0x534e('0x7')](_0x929597)['send'](_0xa836bb);};}function execChildProcess(){return new BPromise(function(_0xb30dd6,_0x310b6d){exec(_0x534e('0x9'),function(_0x529726,_0x1b7a5a,_0x229352){logger[_0x534e('0xa')](_0x1b7a5a);logger[_0x534e('0xa')](_0x229352);if(_0x529726){logger[_0x534e('0xb')](_0x529726);return _0x310b6d(_0x529726);}return _0xb30dd6(_0x1b7a5a);});});}exports['index']=function(_0x31d764,_0x23c11c){return pm2[_0x534e('0xc')]()[_0x534e('0xd')](function(_0x359565){if(_0x359565){var _0x478027=_[_0x534e('0xe')](_0x359565,function(_0x17c068){return _0x17c068[_0x534e('0x8')]==='express'||_0x17c068[_0x534e('0x8')]===_0x534e('0xf');});return{'rows':_0x478027,'count':_0x478027['length']};}return null;})['then'](respondWithResult(_0x23c11c,null))[_0x534e('0x10')](handleError(_0x23c11c,null));};exports[_0x534e('0x11')]=function(_0x9297b6,_0x16ad40){return pm2[_0x534e('0x12')](_0x9297b6[_0x534e('0x13')]['id'])[_0x534e('0xd')](respondWithResult(_0x16ad40,null))['then'](handleEntityNotFound(_0x16ad40,null))[_0x534e('0x10')](handleError(_0x16ad40,null));};exports[_0x534e('0x14')]=function(_0x466d74,_0x1bef0a){if(_0x466d74[_0x534e('0x15')]['name']&&_0x466d74[_0x534e('0x15')][_0x534e('0x16')]){var _0x5f9ae9=path[_0x534e('0x17')](__dirname,_0x534e('0x18'),_0x466d74[_0x534e('0x15')][_0x534e('0x16')]);var _0x85188b=process[_0x534e('0x19')]();process['chdir'](path[_0x534e('0x1a')](_0x5f9ae9));return execChildProcess()[_0x534e('0xd')](function(_0x39466c){process[_0x534e('0x1b')](_0x85188b);return pm2[_0x534e('0x1c')]({'name':_0x466d74[_0x534e('0x15')][_0x534e('0x8')],'script':_0x5f9ae9});})[_0x534e('0xd')](function(_0x53a6ef){pm2[_0x534e('0x1d')]();return _0x53a6ef[0x0];})['then'](respondWithResult(_0x1bef0a,0xc9))[_0x534e('0x10')](handleError(_0x1bef0a,null));}else{return _0x1bef0a[_0x534e('0x7')](0x1f4)[_0x534e('0x1e')]({'message':_0x534e('0x1f')});}};exports[_0x534e('0x20')]=function(_0x57b216,_0x743974){if(_0x57b216[_0x534e('0x15')]['id']){delete _0x57b216['body']['id'];}var _0x4bd073={'online':_0x534e('0x21'),'stopped':'stop'};if(_0x4bd073[_0x534e('0x22')](_0x57b216[_0x534e('0x15')][_0x534e('0x7')])){return pm2[_0x4bd073[_0x57b216[_0x534e('0x15')][_0x534e('0x7')]]](_0x57b216[_0x534e('0x13')]['id'])[_0x534e('0xd')](respondWithResult(_0x743974,0xc8))['catch'](handleError(_0x743974,null));}else{return _0x743974['status'](0x1f4)[_0x534e('0x1e')]({'message':_0x534e('0x23')});}};exports[_0x534e('0x24')]=function(_0x2f1c49,_0x423502){if(_0x2f1c49[_0x534e('0x15')]['id']){delete _0x2f1c49[_0x534e('0x15')]['id'];}if(_0x2f1c49[_0x534e('0x13')]['id']){return pm2[_0x534e('0x25')](_0x2f1c49[_0x534e('0x13')]['id'])[_0x534e('0xd')](function(_0x1d6fb1){pm2['dump']();return _0x1d6fb1[0x0];})[_0x534e('0xd')](respondWithResult(_0x423502,null))[_0x534e('0x10')](handleError(_0x423502,null));}else{return _0x423502['status'](0x1f4)[_0x534e('0x1e')]({'message':'Unknown\x20id'});}};
\ No newline at end of file
+var _0x9b9b=['Unknown\x20status','delete','Unknown\x20id','../../config/pm2','path','child_process','exec','bluebird','sendStatus','status','json','name','npm\x20install','info','error','index','list','reject','express','motion2','length','then','show','describe','params','catch','create','body','script','join','../../files/plugins','cwd','chdir','dirname','dump','send','update','restart','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9b9b,0x114));var _0xb9b9=function(_0x3517d9,_0x1e6703){_0x3517d9=_0x3517d9-0x0;var _0x29a2f4=_0x9b9b[_0x3517d9];return _0x29a2f4;};'use strict';var _=require('lodash');var pm2=require(_0xb9b9('0x0'));var logger=require('../../config/logger')('api');var path=require(_0xb9b9('0x1'));var exec=require(_0xb9b9('0x2'))[_0xb9b9('0x3')];var BPromise=require(_0xb9b9('0x4'));function handleEntityNotFound(_0x1d6ab6,_0x43c8ff){return function(_0x23b016){if(!_0x23b016){_0x1d6ab6[_0xb9b9('0x5')](0x194);;}return _0x23b016;};}function respondWithResult(_0x79dd,_0x3d1a95){_0x3d1a95=_0x3d1a95||0xc8;return function(_0x85eec){if(_0x85eec){return _0x79dd[_0xb9b9('0x6')](_0x3d1a95)[_0xb9b9('0x7')](_0x85eec);}return null;};}function handleError(_0x297cb6,_0x222cba){_0x222cba=_0x222cba||0x1f4;return function(_0x319bb8){logger['error'](_0x319bb8['stack']);if(_0x319bb8[_0xb9b9('0x8')]){delete _0x319bb8[_0xb9b9('0x8')];}_0x297cb6[_0xb9b9('0x6')](_0x222cba)['send'](_0x319bb8);};}function execChildProcess(){return new BPromise(function(_0x3949d0,_0x3b6bb9){exec(_0xb9b9('0x9'),function(_0x4d8856,_0x3430a6,_0x277d86){logger[_0xb9b9('0xa')](_0x3430a6);logger[_0xb9b9('0xa')](_0x277d86);if(_0x4d8856){logger[_0xb9b9('0xb')](_0x4d8856);return _0x3b6bb9(_0x4d8856);}return _0x3949d0(_0x3430a6);});});}exports[_0xb9b9('0xc')]=function(_0x5bd18c,_0x539449){return pm2[_0xb9b9('0xd')]()['then'](function(_0xe78d58){if(_0xe78d58){var _0x50e5d6=_[_0xb9b9('0xe')](_0xe78d58,function(_0x23bac9){return _0x23bac9[_0xb9b9('0x8')]===_0xb9b9('0xf')||_0x23bac9[_0xb9b9('0x8')]===_0xb9b9('0x10');});return{'rows':_0x50e5d6,'count':_0x50e5d6[_0xb9b9('0x11')]};}return null;})[_0xb9b9('0x12')](respondWithResult(_0x539449,null))['catch'](handleError(_0x539449,null));};exports[_0xb9b9('0x13')]=function(_0x48d9ae,_0x403a5b){return pm2[_0xb9b9('0x14')](_0x48d9ae[_0xb9b9('0x15')]['id'])[_0xb9b9('0x12')](respondWithResult(_0x403a5b,null))['then'](handleEntityNotFound(_0x403a5b,null))[_0xb9b9('0x16')](handleError(_0x403a5b,null));};exports[_0xb9b9('0x17')]=function(_0x398f3d,_0xb01198){if(_0x398f3d[_0xb9b9('0x18')][_0xb9b9('0x8')]&&_0x398f3d[_0xb9b9('0x18')][_0xb9b9('0x19')]){var _0xb16391=path[_0xb9b9('0x1a')](__dirname,_0xb9b9('0x1b'),_0x398f3d[_0xb9b9('0x18')][_0xb9b9('0x19')]);var _0x4e33a0=process[_0xb9b9('0x1c')]();process[_0xb9b9('0x1d')](path[_0xb9b9('0x1e')](_0xb16391));return execChildProcess()['then'](function(_0x9898bc){process[_0xb9b9('0x1d')](_0x4e33a0);return pm2['start']({'name':_0x398f3d[_0xb9b9('0x18')][_0xb9b9('0x8')],'script':_0xb16391});})[_0xb9b9('0x12')](function(_0x40b801){pm2[_0xb9b9('0x1f')]();return _0x40b801[0x0];})['then'](respondWithResult(_0xb01198,0xc9))['catch'](handleError(_0xb01198,null));}else{return _0xb01198[_0xb9b9('0x6')](0x1f4)[_0xb9b9('0x20')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0xb9b9('0x21')]=function(_0x134ed6,_0x20ffc1){if(_0x134ed6[_0xb9b9('0x18')]['id']){delete _0x134ed6[_0xb9b9('0x18')]['id'];}var _0x54bf18={'online':_0xb9b9('0x22'),'stopped':'stop'};if(_0x54bf18[_0xb9b9('0x23')](_0x134ed6[_0xb9b9('0x18')]['status'])){return pm2[_0x54bf18[_0x134ed6[_0xb9b9('0x18')][_0xb9b9('0x6')]]](_0x134ed6[_0xb9b9('0x15')]['id'])['then'](respondWithResult(_0x20ffc1,0xc8))[_0xb9b9('0x16')](handleError(_0x20ffc1,null));}else{return _0x20ffc1[_0xb9b9('0x6')](0x1f4)[_0xb9b9('0x20')]({'message':_0xb9b9('0x24')});}};exports['destroy']=function(_0xc40dda,_0xdbc1f1){if(_0xc40dda['body']['id']){delete _0xc40dda[_0xb9b9('0x18')]['id'];}if(_0xc40dda[_0xb9b9('0x15')]['id']){return pm2[_0xb9b9('0x25')](_0xc40dda[_0xb9b9('0x15')]['id'])['then'](function(_0xd66ace){pm2[_0xb9b9('0x1f')]();return _0xd66ace[0x0];})[_0xb9b9('0x12')](respondWithResult(_0xdbc1f1,null))[_0xb9b9('0x16')](handleError(_0xdbc1f1,null));}else{return _0xdbc1f1['status'](0x1f4)[_0xb9b9('0x20')]({'message':_0xb9b9('0x26')});}};
\ No newline at end of file
index bda0571..af5e87e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf843=['./realtime.controller','get','/agents','isAuthenticated','/queues','exports','Router','../../components/auth/service'];(function(_0x4557dc,_0x3687b2){var _0x1377aa=function(_0x41c62a){while(--_0x41c62a){_0x4557dc['push'](_0x4557dc['shift']());}};_0x1377aa(++_0x3687b2);}(_0xf843,0xde));var _0x3f84=function(_0xf13a3,_0x5e9294){_0xf13a3=_0xf13a3-0x0;var _0x1d8e97=_0xf843[_0xf13a3];return _0x1d8e97;};'use strict';var express=require('express');var router=express[_0x3f84('0x0')]();var auth=require(_0x3f84('0x1'));var controller=require(_0x3f84('0x2'));router[_0x3f84('0x3')](_0x3f84('0x4'),auth[_0x3f84('0x5')](),controller['getAgents']);router[_0x3f84('0x3')](_0x3f84('0x6'),auth[_0x3f84('0x5')](),controller['getQueues']);module[_0x3f84('0x7')]=router;
\ No newline at end of file
+var _0x0cb2=['/queues','getQueues','exports','express','Router','./realtime.controller','get','/agents','getAgents'];(function(_0x14f5f4,_0x14dc97){var _0x5807eb=function(_0x1e4c95){while(--_0x1e4c95){_0x14f5f4['push'](_0x14f5f4['shift']());}};_0x5807eb(++_0x14dc97);}(_0x0cb2,0x13e));var _0x20cb=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0cb2[_0x20a584];return _0x4b41a8;};'use strict';var express=require(_0x20cb('0x0'));var router=express[_0x20cb('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x20cb('0x2'));router[_0x20cb('0x3')](_0x20cb('0x4'),auth['isAuthenticated'](),controller[_0x20cb('0x5')]);router[_0x20cb('0x3')](_0x20cb('0x6'),auth['isAuthenticated'](),controller[_0x20cb('0x7')]);module[_0x20cb('0x8')]=router;
\ No newline at end of file
index 7fd9300..376a82b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf494=['includes','toLowerCase','type','all','util','lodash','jayson/promise','../../config/logger','api','../../mysqldb','client','http','limit','undefined','count','offset','set','error','stack','name','status','send','request','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','merge','catch','voice','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','waiting','talking','paused','outbound','push','pTalking','dialActive','dialMethod','Trunk','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','get','loggedInDb','loggedIn','available','busy','originated','find','pick','filter','queue','length','some','connectedlinenum','internal','toString','getMembers','UserId','accountcode','online','voiceStatus','User','Queue','Pause','findAll','startCase','agents','idle','unknown','unavailable','isNil','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','pause','chatStatus','mailStatus','smsStatus','whatsappStatus','getAgents','lastPauseAt','address','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','openchannelStatus','openchannelStatusTime','mailStatusTime','smsStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','rawAttributes','fieldName','key','role','agent','query','getOptions','raw','user','userProfileId','sort','UserProfile','getResources','findAndCountAll','rows','omit','globalStatus','globalStatusFilter','pauseTypeFilter','pauseType','getQueues','mail','chat','sms','whatsapp','resolve','channel'];(function(_0x3616bb,_0x86fe00){var _0x1c0994=function(_0x46a1d4){while(--_0x46a1d4){_0x3616bb['push'](_0x3616bb['shift']());}};_0x1c0994(++_0x86fe00);}(_0xf494,0x1c6));var _0x4f49=function(_0xdbc5b2,_0x4d87fe){_0xdbc5b2=_0xdbc5b2-0x0;var _0x46fe49=_0xf494[_0xdbc5b2];return _0x46fe49;};'use strict';var util=require(_0x4f49('0x0'));var _=require(_0x4f49('0x1'));var jayson=require(_0x4f49('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0x4f49('0x3'))(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var amiClient=jayson[_0x4f49('0x6')][_0x4f49('0x7')]({'port':0x232a});var routingClient=jayson[_0x4f49('0x6')][_0x4f49('0x7')]({'port':0x232c});function respondWithFilteredResult(_0x790e8b,_0xc5e778){return function(_0x413530){if(_0x413530){var _0x42b0e8=typeof _0xc5e778['offset']==='undefined'&&typeof _0xc5e778[_0x4f49('0x8')]===_0x4f49('0x9');var _0x31a725=_0x413530[_0x4f49('0xa')];var _0x185174=_0x42b0e8?0x0:_0xc5e778[_0x4f49('0xb')];var _0x151d8c=_0x42b0e8?_0x413530[_0x4f49('0xa')]:_0xc5e778['offset']+_0xc5e778[_0x4f49('0x8')];var _0x411759;if(_0x151d8c>=_0x31a725){_0x151d8c=_0x31a725;_0x411759=0xc8;}else{_0x411759=0xce;}_0x790e8b['status'](_0x411759);return _0x790e8b[_0x4f49('0xc')]('Content-Range',_0x185174+'-'+_0x151d8c+'/'+_0x31a725)['json'](_0x413530);}return null;};}function handleError(_0x4b9cd3,_0x12527d){_0x12527d=_0x12527d||0x1f4;return function(_0x4bf89f){logger[_0x4f49('0xd')](_0x4bf89f[_0x4f49('0xe')]);if(_0x4bf89f[_0x4f49('0xf')]){delete _0x4bf89f[_0x4f49('0xf')];}_0x4b9cd3[_0x4f49('0x10')](_0x12527d)[_0x4f49('0x11')](_0x4bf89f);};}function getRealtimeAgents(){return new Promise(function(_0xfdb477,_0x5c373e){return amiClient[_0x4f49('0x12')](_0x4f49('0x13'),{})[_0x4f49('0x14')](function(_0x5878f4){if(_0x5878f4['error'])throw new Error(_0x4f49('0x15'));var _0x2ecaaa=_0x5878f4[_0x4f49('0x16')];return routingClient['request'](_0x4f49('0x13'),{})[_0x4f49('0x14')](function(_0x4e85df){if(_0x4e85df['error'])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');var _0x560592=_0x4e85df['result'];return _0xfdb477(_[_0x4f49('0x17')]({},_0x2ecaaa,_0x560592));});})[_0x4f49('0x18')](function(_0x1c2d70){_0x5c373e(_0x1c2d70);});});}function getRealtimeQueues(_0x407042,_0x5793ac){return new Promise(function(_0x416893,_0x2aed27){var _0x197a49=_0x5793ac===_0x4f49('0x19')?amiClient:routingClient;return _0x197a49[_0x4f49('0x12')](_['startCase'](_0x5793ac)+_0x4f49('0x1a'),_0x407042)[_0x4f49('0x14')](function(_0x3ae590){if(_0x3ae590['error'])throw new Error(util[_0x4f49('0x1b')](_0x4f49('0x1c'),_0x5793ac));return _0x416893(_0x3ae590[_0x4f49('0x16')]);})[_0x4f49('0x18')](function(_0x9d30aa){_0x2aed27(_0x9d30aa);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x36187b,_0x559d98){return amiClient['request'](_0x4f49('0x1d'),{})[_0x4f49('0x14')](function(_0x4fedbb){if(_0x4fedbb[_0x4f49('0xd')])throw new Error(_0x4f49('0x1e'));return _0x36187b(_0x4fedbb[_0x4f49('0x16')]);})['catch'](function(_0xc54070){_0x559d98(_0xc54070);});});}function initializeQueues(_0x2eed1c,_0x298785,_0x148153,_0xfefbab){var _0x122404=['loggedIn','available',_0x4f49('0x1f'),_0x4f49('0x20'),_0x4f49('0x21')];if(_0x148153==='voice'&&_0xfefbab===_0x4f49('0x22')){_0x122404[_0x4f49('0x23')](_0x4f49('0x24'),'originated','message',_0x4f49('0x25'),_0x4f49('0x26'),_0x4f49('0x27'),'startPredictive',_0x4f49('0x28'),_0x4f49('0x29'),_0x4f49('0x2a'),_0x4f49('0x2b'),_0x4f49('0x2c'),_0x4f49('0x2d'),_0x4f49('0x2e'),_0x4f49('0x2f'),_0x4f49('0x30'),_0x4f49('0x31'),_0x4f49('0x32'),_0x4f49('0x33'),_0x4f49('0x34'),_0x4f49('0x35'),_0x4f49('0x36'));}return _0x2eed1c[_0x4f49('0x37')](function(_0x376a7d){var _0x14ca52=_0x376a7d[_0x4f49('0x38')]({'plain':!![]});_0x14ca52['agents']=[];_0x14ca52[_0x4f49('0x21')]=0x0;_0x14ca52[_0x4f49('0x39')]=0x0;_0x14ca52[_0x4f49('0x3a')]=0x0;_0x14ca52[_0x4f49('0x3b')]=0x0;_0x14ca52[_0x4f49('0x1f')]=0x0;if(_0x148153===_0x4f49('0x19')){_0x14ca52[_0x4f49('0x20')]=0x0;_0x14ca52[_0x4f49('0x3c')]=0x0;if(_0xfefbab===_0x4f49('0x22')){_0x14ca52[_0x4f49('0x24')]=0x0;_0x14ca52[_0x4f49('0x3d')]=0x0;}}var _0x343365=_[_0x4f49('0x3e')](_0x298785,['id',_0x14ca52['id']]);if(_0x343365)_['merge'](_0x14ca52,_[_0x4f49('0x3f')](_0x343365,_0x122404));return _0x14ca52;});}function updateAgentVoiceStatus(_0x27b7a9,_0x36000a,_0x26014f){var _0x1c1e9b=_[_0x4f49('0x40')](_0x26014f,[_0x4f49('0x41'),_0x36000a[_0x4f49('0xf')]]);if(_0x1c1e9b[_0x4f49('0x42')]===0x0)return _0x27b7a9[_0x4f49('0x3c')]=!![];if(_[_0x4f49('0x43')](_0x1c1e9b,[_0x4f49('0x44'),_0x27b7a9[_0x4f49('0x45')][_0x4f49('0x46')]()]))return _0x27b7a9['talking']=!![];if(!_0x27b7a9[_0x4f49('0x20')])return _0x27b7a9[_0x4f49('0x3c')]=!![];}function getVoiceQueueAgents(_0x543605,_0x2b7eed,_0xbf05f3,_0x560938){var _0x29e762=_[_0x4f49('0x3e')](_0x2b7eed,['id',_0x543605['id']]);if(!_0x29e762)return _0x543605;return _0x29e762[_0x4f49('0x47')]({'raw':!![]})[_0x4f49('0x14')](function(_0x3bfe7e){for(var _0x3d5cf2=0x0;_0x3d5cf2<_0x3bfe7e[_0x4f49('0x42')];_0x3d5cf2++){var _0x5d464e=_['find'](_0xbf05f3,['id',_0x3bfe7e[_0x3d5cf2]['UserId']]);if(!_0x5d464e){_0x5d464e={'id':_0x3bfe7e[_0x3d5cf2][_0x4f49('0x48')],'name':_0x3bfe7e[_0x3d5cf2][_0x4f49('0x48')],'accountcode':'','online':![]};}var _0x2e4355={'id':_0x5d464e['id'],'name':_0x5d464e[_0x4f49('0xf')],'internal':_0x5d464e[_0x4f49('0x49')],'online':Boolean(_0x5d464e[_0x4f49('0x4a')]),'paused':Boolean(_0x3bfe7e[_0x3d5cf2][_0x4f49('0x21')])};if(_0x5d464e[_0x4f49('0x4b')]===_0x4f49('0x20'))updateAgentVoiceStatus(_0x2e4355,_0x543605,_0x560938);if(_0x2e4355['online'])_0x543605['loggedInDb']++;if(_0x2e4355[_0x4f49('0x3c')])_0x543605[_0x4f49('0x3c')]++;if(_0x2e4355[_0x4f49('0x21')]&&!_0x2e4355['busy']&&!_0x2e4355[_0x4f49('0x20')])_0x543605['paused']++;_0x543605['agents'][_0x4f49('0x23')](_0x2e4355);}return _0x543605;});}function getQueueAgents(_0x41230e,_0x40eadc,_0x497cb8){var _0x287781=_0x4f49('0x4c')+_['startCase'](_0x497cb8)+_0x4f49('0x4d');var _0x5c7cc7=_0x497cb8+_0x4f49('0x4e');return db[_0x287781][_0x4f49('0x4f')]({'where':{[_[_0x4f49('0x50')](_0x497cb8)+'QueueId']:_0x41230e['id']},'raw':!![]})[_0x4f49('0x14')](function(_0x1e5f0b){for(var _0x33bb04=0x0;_0x33bb04<_0x1e5f0b[_0x4f49('0x42')];_0x33bb04++){var _0x29dfdb=_[_0x4f49('0x3e')](_0x40eadc,['id',_0x1e5f0b[_0x33bb04][_0x4f49('0x48')]]);if(!_0x29dfdb){_0x29dfdb={'id':_0x1e5f0b[_0x33bb04][_0x4f49('0x48')],'name':_0x1e5f0b[_0x33bb04][_0x4f49('0x48')],'online':![],['pauseField']:![]};}var _0x157a55={'id':_0x29dfdb['id'],'name':_0x29dfdb['name'],'online':Boolean(_0x29dfdb[_0x4f49('0x4a')]),'paused':Boolean(_0x29dfdb[_0x5c7cc7])};if(_0x157a55[_0x4f49('0x4a')])_0x41230e['loggedInDb']++;_0x41230e[_0x4f49('0x51')]['push'](_0x157a55);}return _0x41230e;});}function isIdle(_0x132c46){return _0x132c46===_0x4f49('0x52')||_0x132c46===_0x4f49('0x53')||_0x132c46===_0x4f49('0x54')||_0x132c46==='ringing'||_[_0x4f49('0x55')](_0x132c46);}function isAgentPaused(_0x2c426b,_0x37bafa){var _0x973099=[_0x2c426b[_0x4f49('0x56')],_0x2c426b[_0x4f49('0x57')],_0x2c426b[_0x4f49('0x58')],_0x2c426b[_0x4f49('0x59')],_0x2c426b[_0x4f49('0x5a')],_0x2c426b[_0x4f49('0x5b')],_0x2c426b[_0x4f49('0x5c')]];if(!_0x37bafa)return _[_0x4f49('0x5d')](_0x973099);var _0x148031=_[_0x4f49('0x40')](_0x973099);return _0x148031[_0x4f49('0x42')]>0x0&&_0x148031[_0x4f49('0x42')]<_0x973099['length']?!![]:![];}function isAgentIdle(_0x4eadc2){if(_0x4eadc2[_0x4f49('0x4b')]!==_0x4f49('0x52')&&_0x4eadc2[_0x4f49('0x5b')]){_0x4eadc2[_0x4f49('0x4b')]=_0x4f49('0x5e');return![];}return _[_0x4f49('0x5d')]([_0x4eadc2[_0x4f49('0x5f')],_0x4eadc2['faxStatus'],_0x4eadc2[_0x4f49('0x60')],_0x4eadc2['openchannelStatus'],_0x4eadc2[_0x4f49('0x61')],_0x4eadc2[_0x4f49('0x4b')],_0x4eadc2[_0x4f49('0x62')]],isIdle);}function getAgentStatus(_0x1f1c04){var _0x586095=_0x4f49('0x53');if(isAgentPaused(_0x1f1c04))_0x586095='pause';else if(isAgentPaused(_0x1f1c04,!![]))_0x586095='*pause';else if(isAgentIdle(_0x1f1c04))_0x586095=_0x4f49('0x52');else _0x586095=_0x4f49('0x3c');return _0x586095;}exports[_0x4f49('0x63')]=function(_0x26ae33,_0x56375a){var _0x599c51={'count':0x0,'rows':[]},_0xd7f47b={},_0x291a45,_0x5cb187,_0x3941db=['userpic',_0x4f49('0x4a'),'lastLoginAt',_0x4f49('0x64'),'pauseType',_0x4f49('0x64'),_0x4f49('0x45'),_0x4f49('0x65'),_0x4f49('0x56'),_0x4f49('0x59'),_0x4f49('0x58'),_0x4f49('0x5a'),_0x4f49('0x5c'),'faxPause',_0x4f49('0x5b'),'chatCapacity',_0x4f49('0x66'),_0x4f49('0x67'),_0x4f49('0x68'),_0x4f49('0x69'),_0x4f49('0x6a'),_0x4f49('0x6b'),'openchannelCurrentCapacity',_0x4f49('0x6c'),_0x4f49('0x6d'),'whatsappCurrentCapacity','faxCurrentCapacity',_0x4f49('0x5f'),_0x4f49('0x6e'),_0x4f49('0x60'),_0x4f49('0x61'),_0x4f49('0x62'),'faxStatus',_0x4f49('0x4b'),'chatStatusTime',_0x4f49('0x6f'),_0x4f49('0x70'),_0x4f49('0x71'),'whatsappStatusTime',_0x4f49('0x72'),_0x4f49('0x73'),_0x4f49('0x41'),_0x4f49('0x74'),'screenrecording',_0x4f49('0x75'),_0x4f49('0x76'),'routealias'],_0x5b50bc=[_0x4f49('0x56'),_0x4f49('0x59'),_0x4f49('0x58'),_0x4f49('0x5a'),_0x4f49('0x5c'),_0x4f49('0x57'),_0x4f49('0x5b'),_0x4f49('0x4a')];Promise['resolve']()[_0x4f49('0x14')](function(){var _0x3566f2=_[_0x4f49('0x37')](db[_0x4f49('0x4c')][_0x4f49('0x77')],function(_0x26b022){return{'name':_0x26b022[_0x4f49('0x78')],'type':_0x26b022['type'][_0x4f49('0x79')]};});_0x26ae33['query'][_0x4f49('0x7a')]=_0x4f49('0x7b');_0x26ae33[_0x4f49('0x7c')][_0x4f49('0x4a')]=!![];_0xd7f47b=qs[_0x4f49('0x7d')](_0x3566f2,_0x26ae33);_0xd7f47b[_0x4f49('0x7e')]=!![];if(_0x26ae33[_0x4f49('0x7f')][_0x4f49('0x7a')]===_0x4f49('0x7f')){var _0x176a6a={'params':{'id':_0x26ae33['user'][_0x4f49('0x80')]},'query':{'section':_0x4f49('0x13'),'role':_0x4f49('0x7b'),'online':!![],'nolimit':_0x26ae33[_0x4f49('0x7c')]['nolimit'],'sort':_0x26ae33['query'][_0x4f49('0x81')],'filter':_0x26ae33['query'][_0x4f49('0x40')],'raw':!![]}};return db[_0x4f49('0x82')][_0x4f49('0x83')](_0x176a6a);}return db[_0x4f49('0x4c')][_0x4f49('0x84')](_0xd7f47b);})[_0x4f49('0x14')](function(_0x179431){_0x599c51[_0x4f49('0xa')]=_0x179431[_0x4f49('0xa')];_0x291a45=_0x179431[_0x4f49('0x85')];return getRealtimeAgents();})[_0x4f49('0x14')](function(_0x1ba97e){_0x5cb187=_0x1ba97e[_0x4f49('0x85')];return _0x291a45[_0x4f49('0x37')](function(_0x234984){var _0x412d84=_[_0x4f49('0x3e')](_0x5cb187,['id',_0x234984['id']]);if(_0x412d84)_[_0x4f49('0x17')](_0x234984,_[_0x4f49('0x3f')](_[_0x4f49('0x86')](_0x412d84,_0x5b50bc),_0x3941db));_0x234984[_0x4f49('0x87')]=getAgentStatus(_0x234984);return _0x234984;});})[_0x4f49('0x14')](function(_0xf6d04b){if(_0x26ae33[_0x4f49('0x7c')][_0x4f49('0x88')]){var _0x49a79d=_[_0x4f49('0x40')](_0xf6d04b,['globalStatus',_0x26ae33[_0x4f49('0x7c')][_0x4f49('0x88')]]);if(_0x26ae33[_0x4f49('0x7c')][_0x4f49('0x89')]){_0x49a79d=_[_0x4f49('0x40')](_0x49a79d,[_0x4f49('0x8a'),_0x26ae33[_0x4f49('0x7c')][_0x4f49('0x89')]]);}}_0x599c51[_0x4f49('0x85')]=_0x49a79d||_0xf6d04b;return _0x599c51;})['then'](respondWithFilteredResult(_0x56375a,_0xd7f47b))['catch'](handleError(_0x56375a,null));};exports[_0x4f49('0x8b')]=function(_0x592c3c,_0x29b009){var _0x1e6e62=[_0x4f49('0x8c'),_0x4f49('0x8d'),_0x4f49('0x8e'),'openchannel','fax',_0x4f49('0x8f'),_0x4f49('0x19')];var _0x4bdd1b={'count':0x0,'rows':[]},_0x8ba79d={},_0x2dca37,_0x5c824f,_0x24da23,_0x5b88aa,_0x121972;Promise[_0x4f49('0x90')]()['then'](function(){if(_0x592c3c[_0x4f49('0x7c')][_0x4f49('0x91')]){if(!_[_0x4f49('0x92')](_0x1e6e62,_0x592c3c[_0x4f49('0x7c')][_0x4f49('0x91')][_0x4f49('0x93')]()))throw new Error('Invalid\x20channel');_0x2dca37=_0x592c3c[_0x4f49('0x7c')]['channel'][_0x4f49('0x93')]();}var _0x574343=_[_0x4f49('0x50')](_0x2dca37)+'Queue';var _0x29e639=_[_0x4f49('0x37')](db[_0x574343][_0x4f49('0x77')],function(_0x2dbd0f){return{'name':_0x2dbd0f['fieldName'],'type':_0x2dbd0f[_0x4f49('0x94')]['key']};});_0x8ba79d=qs[_0x4f49('0x7d')](_0x29e639,_0x592c3c);if(_0x592c3c['user'][_0x4f49('0x7a')]==='user'){var _0x4938a6={'params':{'id':_0x592c3c[_0x4f49('0x7f')][_0x4f49('0x80')]},'query':{'section':_0x2dca37===_0x4f49('0x19')&&_0x592c3c['query'][_0x4f49('0x94')]===_0x4f49('0x22')?'QueueCampaigns':_['startCase'](_0x2dca37)+'Queues','type':_0x592c3c[_0x4f49('0x7c')][_0x4f49('0x94')],'nolimit':!![],'sort':_0x4f49('0xf'),'filter':_0x592c3c[_0x4f49('0x7c')][_0x4f49('0x40')]}};return db['UserProfile'][_0x4f49('0x83')](_0x4938a6);}return db[_0x574343][_0x4f49('0x84')](_0x8ba79d);})[_0x4f49('0x14')](function(_0x58d07e){_0x4bdd1b[_0x4f49('0xa')]=_0x58d07e[_0x4f49('0xa')];_0x5c824f=_0x58d07e[_0x4f49('0x85')];return getRealtimeQueues(_0x592c3c,_0x2dca37);})[_0x4f49('0x14')](function(_0x5ea6b4){_0x5b88aa=_0x5ea6b4[_0x4f49('0x85')];return getRealtimeAgents();})[_0x4f49('0x14')](function(_0x310480){_0x24da23=_0x310480[_0x4f49('0x85')];if(_0x2dca37!=_0x4f49('0x19'))return;return getRealtimeVoiceQueueChannels();})['then'](function(_0x2409a8){_0x121972=_0x2409a8?_0x2409a8[_0x4f49('0x85')]:[];return initializeQueues(_0x5c824f,_0x5b88aa,_0x2dca37,_0x592c3c['query'][_0x4f49('0x94')]);})['then'](function(_0x351a33){var _0x4d72a0=_0x351a33[_0x4f49('0x37')](function(_0x2702fb){if(_0x2dca37===_0x4f49('0x19'))return getVoiceQueueAgents(_0x2702fb,_0x5c824f,_0x24da23,_0x121972);else return getQueueAgents(_0x2702fb,_0x24da23,_0x2dca37);});return Promise[_0x4f49('0x95')](_0x4d72a0);})[_0x4f49('0x14')](function(_0x538943){_0x4bdd1b[_0x4f49('0x85')]=_0x538943;return _0x4bdd1b;})[_0x4f49('0x14')](respondWithFilteredResult(_0x29b009,_0x8ba79d))[_0x4f49('0x18')](handleError(_0x29b009,null));};
\ No newline at end of file
+var _0x3f8a=['pauseTypeFilter','getQueues','chat','openchannel','whatsapp','channel','includes','toLowerCase','Invalid\x20channel','type','QueueCampaigns','UserProfile','all','util','lodash','jayson/promise','../../components/parsers/qs','api','../../mysqldb','client','http','offset','undefined','limit','count','status','set','Content-Range','json','error','stack','name','request','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','then','merge','catch','startCase','Queues','format','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','available','waiting','paused','outbound','push','pTalking','originated','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','map','get','agents','loggedInDb','voice','talking','find','filter','length','busy','some','connectedlinenum','internal','getMembers','UserId','online','voiceStatus','User','Queue','Pause','findAll','ringing','isNil','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','unknown','*pause','idle','getAgents','lastLoginAt','lastPauseAt','pauseType','chatCapacity','openchannelCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','resolve','rawAttributes','key','role','agent','query','getOptions','raw','user','userProfileId','nolimit','sort','getResources','findAndCountAll','rows','pick','omit','globalStatus','globalStatusFilter'];(function(_0x81add3,_0x5af5f7){var _0xbc4b33=function(_0xeed31e){while(--_0xeed31e){_0x81add3['push'](_0x81add3['shift']());}};_0xbc4b33(++_0x5af5f7);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x474973,_0xb6b5eb){_0x474973=_0x474973-0x0;var _0x99479e=_0x3f8a[_0x474973];return _0x99479e;};'use strict';var util=require(_0xa3f8('0x0'));var _=require(_0xa3f8('0x1'));var jayson=require(_0xa3f8('0x2'));var qs=require(_0xa3f8('0x3'));var logger=require('../../config/logger')(_0xa3f8('0x4'));var db=require(_0xa3f8('0x5'))['db'];var amiClient=jayson[_0xa3f8('0x6')][_0xa3f8('0x7')]({'port':0x232a});var routingClient=jayson[_0xa3f8('0x6')][_0xa3f8('0x7')]({'port':0x232c});function respondWithFilteredResult(_0x39d2e4,_0x471464){return function(_0x1f160a){if(_0x1f160a){var _0xf895d9=typeof _0x471464[_0xa3f8('0x8')]===_0xa3f8('0x9')&&typeof _0x471464[_0xa3f8('0xa')]===_0xa3f8('0x9');var _0x2c89bb=_0x1f160a[_0xa3f8('0xb')];var _0xcdb0d4=_0xf895d9?0x0:_0x471464['offset'];var _0x47496a=_0xf895d9?_0x1f160a[_0xa3f8('0xb')]:_0x471464[_0xa3f8('0x8')]+_0x471464[_0xa3f8('0xa')];var _0x53cf1f;if(_0x47496a>=_0x2c89bb){_0x47496a=_0x2c89bb;_0x53cf1f=0xc8;}else{_0x53cf1f=0xce;}_0x39d2e4[_0xa3f8('0xc')](_0x53cf1f);return _0x39d2e4[_0xa3f8('0xd')](_0xa3f8('0xe'),_0xcdb0d4+'-'+_0x47496a+'/'+_0x2c89bb)[_0xa3f8('0xf')](_0x1f160a);}return null;};}function handleError(_0xd97ac9,_0x2e71a0){_0x2e71a0=_0x2e71a0||0x1f4;return function(_0x1afd01){logger[_0xa3f8('0x10')](_0x1afd01[_0xa3f8('0x11')]);if(_0x1afd01[_0xa3f8('0x12')]){delete _0x1afd01[_0xa3f8('0x12')];}_0xd97ac9[_0xa3f8('0xc')](_0x2e71a0)['send'](_0x1afd01);};}function getRealtimeAgents(){return new Promise(function(_0x2d8f74,_0xe55848){return amiClient[_0xa3f8('0x13')](_0xa3f8('0x14'),{})['then'](function(_0x39c450){if(_0x39c450[_0xa3f8('0x10')])throw new Error(_0xa3f8('0x15'));var _0x8cd130=_0x39c450[_0xa3f8('0x16')];return routingClient[_0xa3f8('0x13')](_0xa3f8('0x14'),{})[_0xa3f8('0x17')](function(_0x2cb49f){if(_0x2cb49f[_0xa3f8('0x10')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');var _0x3ad8cd=_0x2cb49f['result'];return _0x2d8f74(_[_0xa3f8('0x18')]({},_0x8cd130,_0x3ad8cd));});})[_0xa3f8('0x19')](function(_0x191f99){_0xe55848(_0x191f99);});});}function getRealtimeQueues(_0x46042d,_0x5c916e){return new Promise(function(_0x1f0bb8,_0x5b0d57){var _0x43c393=_0x5c916e==='voice'?amiClient:routingClient;return _0x43c393[_0xa3f8('0x13')](_[_0xa3f8('0x1a')](_0x5c916e)+_0xa3f8('0x1b'),_0x46042d)[_0xa3f8('0x17')](function(_0x3a6a57){if(_0x3a6a57[_0xa3f8('0x10')])throw new Error(util[_0xa3f8('0x1c')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x5c916e));return _0x1f0bb8(_0x3a6a57[_0xa3f8('0x16')]);})['catch'](function(_0x3ce57b){_0x5b0d57(_0x3ce57b);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0xa5a697,_0x24985a){return amiClient[_0xa3f8('0x13')](_0xa3f8('0x1d'),{})[_0xa3f8('0x17')](function(_0x6e3cb4){if(_0x6e3cb4[_0xa3f8('0x10')])throw new Error(_0xa3f8('0x1e'));return _0xa5a697(_0x6e3cb4[_0xa3f8('0x16')]);})['catch'](function(_0x1c3358){_0x24985a(_0x1c3358);});});}function initializeQueues(_0x2d29c1,_0x3344ba,_0x5a8fcf,_0x40f5cc){var _0x57f6be=[_0xa3f8('0x1f'),_0xa3f8('0x20'),_0xa3f8('0x21'),'talking',_0xa3f8('0x22')];if(_0x5a8fcf==='voice'&&_0x40f5cc===_0xa3f8('0x23')){_0x57f6be[_0xa3f8('0x24')](_0xa3f8('0x25'),_0xa3f8('0x26'),_0xa3f8('0x27'),_0xa3f8('0x28'),_0xa3f8('0x29'),_0xa3f8('0x2a'),_0xa3f8('0x2b'),_0xa3f8('0x2c'),_0xa3f8('0x2d'),'erlangCallToSecond',_0xa3f8('0x2e'),_0xa3f8('0x2f'),_0xa3f8('0x30'),_0xa3f8('0x31'),_0xa3f8('0x32'),'predictiveIntervalAvailable',_0xa3f8('0x33'),_0xa3f8('0x34'),'predictiveIntervalDroppedCallsTimeout',_0xa3f8('0x35'),_0xa3f8('0x36'),'predictiveIntervalAvgTalktime');}return _0x2d29c1[_0xa3f8('0x37')](function(_0x4ec2ce){var _0x5248c3=_0x4ec2ce[_0xa3f8('0x38')]({'plain':!![]});_0x5248c3[_0xa3f8('0x39')]=[];_0x5248c3['paused']=0x0;_0x5248c3[_0xa3f8('0x3a')]=0x0;_0x5248c3['loggedIn']=0x0;_0x5248c3[_0xa3f8('0x20')]=0x0;_0x5248c3[_0xa3f8('0x21')]=0x0;if(_0x5a8fcf===_0xa3f8('0x3b')){_0x5248c3[_0xa3f8('0x3c')]=0x0;_0x5248c3['busy']=0x0;if(_0x40f5cc===_0xa3f8('0x23')){_0x5248c3['pTalking']=0x0;_0x5248c3[_0xa3f8('0x26')]=0x0;}}var _0x4fbcd7=_[_0xa3f8('0x3d')](_0x3344ba,['id',_0x5248c3['id']]);if(_0x4fbcd7)_['merge'](_0x5248c3,_['pick'](_0x4fbcd7,_0x57f6be));return _0x5248c3;});}function updateAgentVoiceStatus(_0x50c359,_0x362527,_0x1674f1){var _0x1acf4f=_[_0xa3f8('0x3e')](_0x1674f1,['queue',_0x362527[_0xa3f8('0x12')]]);if(_0x1acf4f[_0xa3f8('0x3f')]===0x0)return _0x50c359[_0xa3f8('0x40')]=!![];if(_[_0xa3f8('0x41')](_0x1acf4f,[_0xa3f8('0x42'),_0x50c359[_0xa3f8('0x43')]['toString']()]))return _0x50c359[_0xa3f8('0x3c')]=!![];if(!_0x50c359[_0xa3f8('0x3c')])return _0x50c359[_0xa3f8('0x40')]=!![];}function getVoiceQueueAgents(_0x51de10,_0x941bde,_0x110b23,_0x5ce212){var _0xdc3c67=_['find'](_0x941bde,['id',_0x51de10['id']]);if(!_0xdc3c67)return _0x51de10;return _0xdc3c67[_0xa3f8('0x44')]({'raw':!![]})['then'](function(_0x9ede8d){for(var _0x174182=0x0;_0x174182<_0x9ede8d[_0xa3f8('0x3f')];_0x174182++){var _0x2a77be=_[_0xa3f8('0x3d')](_0x110b23,['id',_0x9ede8d[_0x174182]['UserId']]);if(!_0x2a77be){_0x2a77be={'id':_0x9ede8d[_0x174182][_0xa3f8('0x45')],'name':_0x9ede8d[_0x174182][_0xa3f8('0x45')],'accountcode':'','online':![]};}var _0x4db9c5={'id':_0x2a77be['id'],'name':_0x2a77be[_0xa3f8('0x12')],'internal':_0x2a77be['accountcode'],'online':Boolean(_0x2a77be[_0xa3f8('0x46')]),'paused':Boolean(_0x9ede8d[_0x174182][_0xa3f8('0x22')])};if(_0x2a77be[_0xa3f8('0x47')]===_0xa3f8('0x3c'))updateAgentVoiceStatus(_0x4db9c5,_0x51de10,_0x5ce212);if(_0x4db9c5[_0xa3f8('0x46')])_0x51de10['loggedInDb']++;if(_0x4db9c5[_0xa3f8('0x40')])_0x51de10[_0xa3f8('0x40')]++;if(_0x4db9c5[_0xa3f8('0x22')]&&!_0x4db9c5[_0xa3f8('0x40')]&&!_0x4db9c5[_0xa3f8('0x3c')])_0x51de10['paused']++;_0x51de10[_0xa3f8('0x39')][_0xa3f8('0x24')](_0x4db9c5);}return _0x51de10;});}function getQueueAgents(_0x1328bb,_0x32e371,_0x2a124b){var _0x314dba=_0xa3f8('0x48')+_[_0xa3f8('0x1a')](_0x2a124b)+_0xa3f8('0x49');var _0x3bf454=_0x2a124b+_0xa3f8('0x4a');return db[_0x314dba][_0xa3f8('0x4b')]({'where':{[_[_0xa3f8('0x1a')](_0x2a124b)+'QueueId']:_0x1328bb['id']},'raw':!![]})['then'](function(_0x58ab27){for(var _0x13faa6=0x0;_0x13faa6<_0x58ab27[_0xa3f8('0x3f')];_0x13faa6++){var _0x1dfea0=_[_0xa3f8('0x3d')](_0x32e371,['id',_0x58ab27[_0x13faa6][_0xa3f8('0x45')]]);if(!_0x1dfea0){_0x1dfea0={'id':_0x58ab27[_0x13faa6][_0xa3f8('0x45')],'name':_0x58ab27[_0x13faa6]['UserId'],'online':![],['pauseField']:![]};}var _0x3c872f={'id':_0x1dfea0['id'],'name':_0x1dfea0[_0xa3f8('0x12')],'online':Boolean(_0x1dfea0[_0xa3f8('0x46')]),'paused':Boolean(_0x1dfea0[_0x3bf454])};if(_0x3c872f[_0xa3f8('0x46')])_0x1328bb['loggedInDb']++;_0x1328bb[_0xa3f8('0x39')][_0xa3f8('0x24')](_0x3c872f);}return _0x1328bb;});}function isIdle(_0x3e1286){return _0x3e1286==='idle'||_0x3e1286==='unknown'||_0x3e1286==='unavailable'||_0x3e1286===_0xa3f8('0x4c')||_[_0xa3f8('0x4d')](_0x3e1286);}function isAgentPaused(_0x5a2a7c,_0x2df379){var _0x1f7af7=[_0x5a2a7c[_0xa3f8('0x4e')],_0x5a2a7c[_0xa3f8('0x4f')],_0x5a2a7c[_0xa3f8('0x50')],_0x5a2a7c[_0xa3f8('0x51')],_0x5a2a7c[_0xa3f8('0x52')],_0x5a2a7c[_0xa3f8('0x53')],_0x5a2a7c[_0xa3f8('0x54')]];if(!_0x2df379)return _[_0xa3f8('0x55')](_0x1f7af7);var _0x338554=_[_0xa3f8('0x3e')](_0x1f7af7);return _0x338554[_0xa3f8('0x3f')]>0x0&&_0x338554[_0xa3f8('0x3f')]<_0x1f7af7[_0xa3f8('0x3f')]?!![]:![];}function isAgentIdle(_0x242492){if(_0x242492[_0xa3f8('0x47')]!=='idle'&&_0x242492['voicePause']){_0x242492[_0xa3f8('0x47')]=_0xa3f8('0x56');return![];}return _['every']([_0x242492[_0xa3f8('0x57')],_0x242492[_0xa3f8('0x58')],_0x242492[_0xa3f8('0x59')],_0x242492[_0xa3f8('0x5a')],_0x242492[_0xa3f8('0x5b')],_0x242492[_0xa3f8('0x47')],_0x242492[_0xa3f8('0x5c')]],isIdle);}function getAgentStatus(_0x1cf14f){var _0x1dffab=_0xa3f8('0x5d');if(isAgentPaused(_0x1cf14f))_0x1dffab=_0xa3f8('0x56');else if(isAgentPaused(_0x1cf14f,!![]))_0x1dffab=_0xa3f8('0x5e');else if(isAgentIdle(_0x1cf14f))_0x1dffab=_0xa3f8('0x5f');else _0x1dffab=_0xa3f8('0x40');return _0x1dffab;}exports[_0xa3f8('0x60')]=function(_0x3169d3,_0x542c47){var _0x593614={'count':0x0,'rows':[]},_0xd0628e={},_0x4d31eb,_0x2410aa,_0x372727=['userpic',_0xa3f8('0x46'),_0xa3f8('0x61'),_0xa3f8('0x62'),_0xa3f8('0x63'),'lastPauseAt',_0xa3f8('0x43'),'address',_0xa3f8('0x4e'),_0xa3f8('0x51'),_0xa3f8('0x50'),'smsPause','whatsappPause',_0xa3f8('0x4f'),_0xa3f8('0x53'),_0xa3f8('0x64'),_0xa3f8('0x65'),'mailCapacity',_0xa3f8('0x66'),_0xa3f8('0x67'),_0xa3f8('0x68'),_0xa3f8('0x69'),_0xa3f8('0x6a'),'mailCurrentCapacity','smsCurrentCapacity',_0xa3f8('0x6b'),_0xa3f8('0x6c'),_0xa3f8('0x57'),_0xa3f8('0x5a'),_0xa3f8('0x59'),_0xa3f8('0x5b'),_0xa3f8('0x5c'),'faxStatus','voiceStatus','chatStatusTime',_0xa3f8('0x6d'),_0xa3f8('0x6e'),_0xa3f8('0x6f'),_0xa3f8('0x70'),_0xa3f8('0x71'),_0xa3f8('0x72'),_0xa3f8('0x73'),_0xa3f8('0x74'),'screenrecording',_0xa3f8('0x75'),_0xa3f8('0x76'),_0xa3f8('0x77')],_0x344083=[_0xa3f8('0x4e'),_0xa3f8('0x51'),_0xa3f8('0x50'),_0xa3f8('0x52'),'whatsappPause',_0xa3f8('0x4f'),_0xa3f8('0x53'),'online'];Promise[_0xa3f8('0x78')]()[_0xa3f8('0x17')](function(){var _0x44d566=_[_0xa3f8('0x37')](db[_0xa3f8('0x48')][_0xa3f8('0x79')],function(_0x2ebfaf){return{'name':_0x2ebfaf['fieldName'],'type':_0x2ebfaf['type'][_0xa3f8('0x7a')]};});_0x3169d3['query'][_0xa3f8('0x7b')]=_0xa3f8('0x7c');_0x3169d3[_0xa3f8('0x7d')][_0xa3f8('0x46')]=!![];_0xd0628e=qs[_0xa3f8('0x7e')](_0x44d566,_0x3169d3);_0xd0628e[_0xa3f8('0x7f')]=!![];if(_0x3169d3[_0xa3f8('0x80')][_0xa3f8('0x7b')]===_0xa3f8('0x80')){var _0x235f39={'params':{'id':_0x3169d3[_0xa3f8('0x80')][_0xa3f8('0x81')]},'query':{'section':_0xa3f8('0x14'),'role':'agent','online':!![],'nolimit':_0x3169d3[_0xa3f8('0x7d')][_0xa3f8('0x82')],'sort':_0x3169d3[_0xa3f8('0x7d')][_0xa3f8('0x83')],'filter':_0x3169d3[_0xa3f8('0x7d')][_0xa3f8('0x3e')],'raw':!![]}};return db['UserProfile'][_0xa3f8('0x84')](_0x235f39);}return db[_0xa3f8('0x48')][_0xa3f8('0x85')](_0xd0628e);})[_0xa3f8('0x17')](function(_0x28d359){_0x593614[_0xa3f8('0xb')]=_0x28d359[_0xa3f8('0xb')];_0x4d31eb=_0x28d359[_0xa3f8('0x86')];return getRealtimeAgents();})[_0xa3f8('0x17')](function(_0x33fef6){_0x2410aa=_0x33fef6[_0xa3f8('0x86')];return _0x4d31eb['map'](function(_0x14de37){var _0x1b6343=_['find'](_0x2410aa,['id',_0x14de37['id']]);if(_0x1b6343)_['merge'](_0x14de37,_[_0xa3f8('0x87')](_[_0xa3f8('0x88')](_0x1b6343,_0x344083),_0x372727));_0x14de37[_0xa3f8('0x89')]=getAgentStatus(_0x14de37);return _0x14de37;});})[_0xa3f8('0x17')](function(_0x1563a4){if(_0x3169d3[_0xa3f8('0x7d')][_0xa3f8('0x8a')]){var _0x3614d2=_['filter'](_0x1563a4,[_0xa3f8('0x89'),_0x3169d3[_0xa3f8('0x7d')][_0xa3f8('0x8a')]]);if(_0x3169d3['query'][_0xa3f8('0x8b')]){_0x3614d2=_[_0xa3f8('0x3e')](_0x3614d2,['pauseType',_0x3169d3[_0xa3f8('0x7d')][_0xa3f8('0x8b')]]);}}_0x593614[_0xa3f8('0x86')]=_0x3614d2||_0x1563a4;return _0x593614;})[_0xa3f8('0x17')](respondWithFilteredResult(_0x542c47,_0xd0628e))[_0xa3f8('0x19')](handleError(_0x542c47,null));};exports[_0xa3f8('0x8c')]=function(_0x451278,_0x1de9f3){var _0xaabac4=['mail',_0xa3f8('0x8d'),'sms',_0xa3f8('0x8e'),'fax',_0xa3f8('0x8f'),_0xa3f8('0x3b')];var _0x407986={'count':0x0,'rows':[]},_0x377ccb={},_0x1f7354,_0x54a972,_0x1d7604,_0x3dc8f0,_0x4c6781;Promise[_0xa3f8('0x78')]()[_0xa3f8('0x17')](function(){if(_0x451278[_0xa3f8('0x7d')][_0xa3f8('0x90')]){if(!_[_0xa3f8('0x91')](_0xaabac4,_0x451278[_0xa3f8('0x7d')]['channel'][_0xa3f8('0x92')]()))throw new Error(_0xa3f8('0x93'));_0x1f7354=_0x451278[_0xa3f8('0x7d')]['channel'][_0xa3f8('0x92')]();}var _0x5953f8=_[_0xa3f8('0x1a')](_0x1f7354)+'Queue';var _0x5a9590=_[_0xa3f8('0x37')](db[_0x5953f8]['rawAttributes'],function(_0x2349ba){return{'name':_0x2349ba['fieldName'],'type':_0x2349ba[_0xa3f8('0x94')][_0xa3f8('0x7a')]};});_0x377ccb=qs[_0xa3f8('0x7e')](_0x5a9590,_0x451278);if(_0x451278[_0xa3f8('0x80')]['role']===_0xa3f8('0x80')){var _0x35db48={'params':{'id':_0x451278['user'][_0xa3f8('0x81')]},'query':{'section':_0x1f7354===_0xa3f8('0x3b')&&_0x451278[_0xa3f8('0x7d')][_0xa3f8('0x94')]===_0xa3f8('0x23')?_0xa3f8('0x95'):_[_0xa3f8('0x1a')](_0x1f7354)+_0xa3f8('0x1b'),'type':_0x451278[_0xa3f8('0x7d')][_0xa3f8('0x94')],'nolimit':!![],'sort':'name','filter':_0x451278[_0xa3f8('0x7d')][_0xa3f8('0x3e')]}};return db[_0xa3f8('0x96')][_0xa3f8('0x84')](_0x35db48);}return db[_0x5953f8][_0xa3f8('0x85')](_0x377ccb);})[_0xa3f8('0x17')](function(_0x2f7d14){_0x407986[_0xa3f8('0xb')]=_0x2f7d14[_0xa3f8('0xb')];_0x54a972=_0x2f7d14['rows'];return getRealtimeQueues(_0x451278,_0x1f7354);})[_0xa3f8('0x17')](function(_0x3da7ee){_0x3dc8f0=_0x3da7ee[_0xa3f8('0x86')];return getRealtimeAgents();})[_0xa3f8('0x17')](function(_0x3f4ef3){_0x1d7604=_0x3f4ef3[_0xa3f8('0x86')];if(_0x1f7354!='voice')return;return getRealtimeVoiceQueueChannels();})[_0xa3f8('0x17')](function(_0x3175fc){_0x4c6781=_0x3175fc?_0x3175fc[_0xa3f8('0x86')]:[];return initializeQueues(_0x54a972,_0x3dc8f0,_0x1f7354,_0x451278[_0xa3f8('0x7d')]['type']);})[_0xa3f8('0x17')](function(_0x427830){var _0x3c5091=_0x427830[_0xa3f8('0x37')](function(_0x21e530){if(_0x1f7354===_0xa3f8('0x3b'))return getVoiceQueueAgents(_0x21e530,_0x54a972,_0x1d7604,_0x4c6781);else return getQueueAgents(_0x21e530,_0x1d7604,_0x1f7354);});return Promise[_0xa3f8('0x97')](_0x3c5091);})[_0xa3f8('0x17')](function(_0x23cd5e){_0x407986[_0xa3f8('0x86')]=_0x23cd5e;return _0x407986;})[_0xa3f8('0x17')](respondWithFilteredResult(_0x1de9f3,_0x377ccb))['catch'](handleError(_0x1de9f3,null));};
\ No newline at end of file
index b365471..4b4f4ee 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(_0x3f2621,_0x569366){var _0x43018c=function(_0x441a01){while(--_0x441a01){_0x3f2621['push'](_0x3f2621['shift']());}};_0x43018c(++_0x569366);}(_0x9c44,0x178));var _0x49c4=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x9c44[_0xfae23b];return _0x200640;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
+var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x165c13,_0x31a371){var _0x2bf938=function(_0x45f0f6){while(--_0x45f0f6){_0x165c13['push'](_0x165c13['shift']());}};_0x2bf938(++_0x31a371);}(_0xe706,0xa3));var _0x6e70=function(_0x355141,_0x4ce3bd){_0x355141=_0x355141-0x0;var _0x328382=_0xe706[_0x355141];return _0x328382;};'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 1a280fb..f15986e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x510e=['INTEGER','STRING','DATE','sequelize','exports'];(function(_0x8be9fb,_0x2f90d9){var _0x3b41ac=function(_0x369a8f){while(--_0x369a8f){_0x8be9fb['push'](_0x8be9fb['shift']());}};_0x3b41ac(++_0x2f90d9);}(_0x510e,0x1ed));var _0xe510=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0x510e[_0x1573ea];return _0x51c0e2;};'use strict';var Sequelize=require(_0xe510('0x0'));module[_0xe510('0x1')]={'state':{'type':Sequelize[_0xe510('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xe510('0x3')]},'scheduledat':{'type':Sequelize[_0xe510('0x4')]},'uniqueid':{'type':Sequelize[_0xe510('0x3')]},'starttime':{'type':Sequelize[_0xe510('0x4')]},'responsetime':{'type':Sequelize[_0xe510('0x4')]},'ringtime':{'type':Sequelize[_0xe510('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xe510('0x3')]},'membername':{'type':Sequelize[_0xe510('0x3')]}};
\ No newline at end of file
+var _0xb234=['exports','STRING','DATE','sequelize'];(function(_0x30d8a3,_0x42a6a6){var _0x34644c=function(_0x2dbf16){while(--_0x2dbf16){_0x30d8a3['push'](_0x30d8a3['shift']());}};_0x34644c(++_0x42a6a6);}(_0xb234,0x13f));var _0x4b23=function(_0x26eb2f,_0x1b7135){_0x26eb2f=_0x26eb2f-0x0;var _0x30509d=_0xb234[_0x26eb2f];return _0x30509d;};'use strict';var Sequelize=require(_0x4b23('0x0'));module[_0x4b23('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x4b23('0x2')]},'scheduledat':{'type':Sequelize[_0x4b23('0x3')]},'uniqueid':{'type':Sequelize[_0x4b23('0x2')]},'starttime':{'type':Sequelize[_0x4b23('0x3')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x4b23('0x2')]},'campaigntype':{'type':Sequelize[_0x4b23('0x2')]},'membername':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 99c446e..36075cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc0ba=['bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','moment'];(function(_0xaf1ec4,_0x327f73){var _0x48e0f9=function(_0x3d32a8){while(--_0x3d32a8){_0xaf1ec4['push'](_0xaf1ec4['shift']());}};_0x48e0f9(++_0x327f73);}(_0xc0ba,0xe6));var _0xac0b=function(_0x2ecea0,_0x36a83d){_0x2ecea0=_0x2ecea0-0x0;var _0x17ab22=_0xc0ba[_0x2ecea0];return _0x17ab22;};'use strict';var _=require(_0xac0b('0x0'));var util=require(_0xac0b('0x1'));var logger=require(_0xac0b('0x2'))('api');var moment=require(_0xac0b('0x3'));var BPromise=require(_0xac0b('0x4'));var rp=require(_0xac0b('0x5'));var fs=require('fs');var path=require(_0xac0b('0x6'));var rimraf=require(_0xac0b('0x7'));var config=require(_0xac0b('0x8'));var attributes=require(_0xac0b('0x9'));module[_0xac0b('0xa')]=function(_0x26b2fb,_0x33fde7){return _0x26b2fb['define'](_0xac0b('0xb'),attributes,{'tableName':_0xac0b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2fa5=['ReportAgentPreview','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0xc70e00,_0x3f8327){var _0x5c8f43=function(_0xdd49cd){while(--_0xdd49cd){_0xc70e00['push'](_0xc70e00['shift']());}};_0x5c8f43(++_0x3f8327);}(_0x2fa5,0x169));var _0x52fa=function(_0x449340,_0x2233e1){_0x449340=_0x449340-0x0;var _0x1a188d=_0x2fa5[_0x449340];return _0x1a188d;};'use strict';var _=require('lodash');var util=require(_0x52fa('0x0'));var logger=require(_0x52fa('0x1'))('api');var moment=require(_0x52fa('0x2'));var BPromise=require(_0x52fa('0x3'));var rp=require(_0x52fa('0x4'));var fs=require('fs');var path=require(_0x52fa('0x5'));var rimraf=require(_0x52fa('0x6'));var config=require('../../config/environment');var attributes=require('./reportAgentPreview.attributes');module['exports']=function(_0x5ef89a,_0x2df900){return _0x5ef89a['define'](_0x52fa('0x7'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9cb9070..1acea85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a8a=['catch','CreateReportAgentPreview','create','body','options','raw','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x42b484,_0x2c2c6f){var _0x73a4ed=function(_0xa232a5){while(--_0xa232a5){_0x42b484['push'](_0x42b484['shift']());}};_0x73a4ed(++_0x2c2c6f);}(_0x8a8a,0xae));var _0xa8a8=function(_0x2a4b4c,_0x21781d){_0x2a4b4c=_0x2a4b4c-0x0;var _0x2674f3=_0x8a8a[_0x2a4b4c];return _0x2674f3;};'use strict';var _=require('lodash');var util=require(_0xa8a8('0x0'));var moment=require(_0xa8a8('0x1'));var BPromise=require(_0xa8a8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa8a8('0x3'));var db=require(_0xa8a8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa8a8('0x5'))(_0xa8a8('0x6'));var config=require(_0xa8a8('0x7'));var jayson=require(_0xa8a8('0x8'));var client=jayson[_0xa8a8('0x9')][_0xa8a8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x223132,_0xc943d4,_0x1d0b64){return new BPromise(function(_0x3c752e,_0xc3089){return client['request'](_0x223132,_0x1d0b64)[_0xa8a8('0xb')](function(_0x2a24ac){logger[_0xa8a8('0xc')](_0xa8a8('0xd'),_0xc943d4,_0xa8a8('0xe'));logger[_0xa8a8('0xf')](_0xa8a8('0x10'),_0xc943d4,_0xa8a8('0xe'),JSON[_0xa8a8('0x11')](_0x2a24ac));if(_0x2a24ac['error']){if(_0x2a24ac[_0xa8a8('0x12')][_0xa8a8('0x13')]===0x1f4){logger['error'](_0xa8a8('0xd'),_0xc943d4,_0x2a24ac[_0xa8a8('0x12')][_0xa8a8('0x14')]);return _0xc3089(_0x2a24ac[_0xa8a8('0x12')][_0xa8a8('0x14')]);}logger[_0xa8a8('0x12')](_0xa8a8('0xd'),_0xc943d4,_0x2a24ac[_0xa8a8('0x12')][_0xa8a8('0x14')]);return _0x3c752e(_0x2a24ac[_0xa8a8('0x12')][_0xa8a8('0x14')]);}else{logger[_0xa8a8('0xc')](_0xa8a8('0xd'),_0xc943d4,_0xa8a8('0xe'));_0x3c752e(_0x2a24ac[_0xa8a8('0x15')][_0xa8a8('0x14')]);}})[_0xa8a8('0x16')](function(_0x150c2d){logger[_0xa8a8('0x12')](_0xa8a8('0xd'),_0xc943d4,_0x150c2d);_0xc3089(_0x150c2d);});});}exports[_0xa8a8('0x17')]=function(_0x48074e){var _0x33668a=this;return new Promise(function(_0x2e6da7,_0x43e2c5){return db['ReportAgentPreview'][_0xa8a8('0x18')](_0x48074e[_0xa8a8('0x19')],{'raw':_0x48074e['options']?_0x48074e[_0xa8a8('0x1a')][_0xa8a8('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x1a707a){logger[_0xa8a8('0xc')](_0xa8a8('0x17'),_0x48074e);logger[_0xa8a8('0xf')](_0xa8a8('0x17'),_0x48074e,JSON[_0xa8a8('0x11')](_0x1a707a));_0x2e6da7(_0x1a707a);})[_0xa8a8('0x16')](function(_0x110953){logger[_0xa8a8('0x12')]('CreateReportAgentPreview',_0x110953['message'],_0x48074e);_0x43e2c5(_0x33668a[_0xa8a8('0x12')](0x1f4,_0x110953['message']));});});};
\ No newline at end of file
+var _0xf256=['create','options','raw','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','CreateReportAgentPreview'];(function(_0x21f187,_0x31a75c){var _0xd12ce7=function(_0x660a11){while(--_0x660a11){_0x21f187['push'](_0x21f187['shift']());}};_0xd12ce7(++_0x31a75c);}(_0xf256,0x1cf));var _0x6f25=function(_0x3bc16a,_0x52e844){_0x3bc16a=_0x3bc16a-0x0;var _0x381cae=_0xf256[_0x3bc16a];return _0x381cae;};'use strict';var _=require('lodash');var util=require(_0x6f25('0x0'));var moment=require('moment');var BPromise=require(_0x6f25('0x1'));var rs=require(_0x6f25('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6f25('0x3'))['db'];var utils=require(_0x6f25('0x4'));var logger=require(_0x6f25('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6f25('0x6'));var client=jayson[_0x6f25('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd3db93,_0x36ff54,_0x4ab856){return new BPromise(function(_0x210f08,_0x296edf){return client[_0x6f25('0x8')](_0xd3db93,_0x4ab856)[_0x6f25('0x9')](function(_0x32578c){logger['info'](_0x6f25('0xa'),_0x36ff54,_0x6f25('0xb'));logger['debug']('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x36ff54,_0x6f25('0xb'),JSON[_0x6f25('0xc')](_0x32578c));if(_0x32578c[_0x6f25('0xd')]){if(_0x32578c[_0x6f25('0xd')][_0x6f25('0xe')]===0x1f4){logger[_0x6f25('0xd')](_0x6f25('0xa'),_0x36ff54,_0x32578c[_0x6f25('0xd')][_0x6f25('0xf')]);return _0x296edf(_0x32578c['error'][_0x6f25('0xf')]);}logger[_0x6f25('0xd')](_0x6f25('0xa'),_0x36ff54,_0x32578c[_0x6f25('0xd')]['message']);return _0x210f08(_0x32578c[_0x6f25('0xd')][_0x6f25('0xf')]);}else{logger[_0x6f25('0x10')](_0x6f25('0xa'),_0x36ff54,_0x6f25('0xb'));_0x210f08(_0x32578c[_0x6f25('0x11')][_0x6f25('0xf')]);}})[_0x6f25('0x12')](function(_0x4e9732){logger['error'](_0x6f25('0xa'),_0x36ff54,_0x4e9732);_0x296edf(_0x4e9732);});});}exports[_0x6f25('0x13')]=function(_0x2c2576){var _0x21d6ca=this;return new Promise(function(_0x440c87,_0x2d33c7){return db['ReportAgentPreview'][_0x6f25('0x14')](_0x2c2576['body'],{'raw':_0x2c2576[_0x6f25('0x15')]?_0x2c2576[_0x6f25('0x15')][_0x6f25('0x16')]===undefined?!![]:![]:!![]})[_0x6f25('0x9')](function(_0x35f8b1){logger[_0x6f25('0x10')]('CreateReportAgentPreview',_0x2c2576);logger['debug'](_0x6f25('0x13'),_0x2c2576,JSON[_0x6f25('0xc')](_0x35f8b1));_0x440c87(_0x35f8b1);})['catch'](function(_0x42f940){logger[_0x6f25('0xd')]('CreateReportAgentPreview',_0x42f940['message'],_0x2c2576);_0x2d33c7(_0x21d6ca[_0x6f25('0xd')](0x1f4,_0x42f940[_0x6f25('0xf')]));});});};
\ No newline at end of file
index 768ad8e..1889025 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc611=['/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','queueNotify','mail','/mail/queues/:id','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','whatsapp','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','util','path','express','Router','./rpc.controller','get','/voice/channels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','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','/voice/queues/:id','showVoiceQueues','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','put','/agents/:id/capacity','agentCapacity','/telephones','/trunks','/campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions'];(function(_0x3c12,_0x3d1fbd){var _0x5971fa=function(_0x258c7a){while(--_0x258c7a){_0x3c12['push'](_0x3c12['shift']());}};_0x5971fa(++_0x3d1fbd);}(_0xc611,0xc7));var _0x1c61=function(_0x398f4,_0x4c2bb9){_0x398f4=_0x398f4-0x0;var _0xa205f5=_0xc611[_0x398f4];return _0xa205f5;};'use strict';var multer=require('multer');var util=require(_0x1c61('0x0'));var path=require(_0x1c61('0x1'));var express=require(_0x1c61('0x2'));var router=express[_0x1c61('0x3')]();var auth=require('../../components/auth/service');var controller=require(_0x1c61('0x4'));router[_0x1c61('0x5')](_0x1c61('0x6'),auth['isAuthenticated'](),controller['voiceChannels']);router['get'](_0x1c61('0x7'),auth[_0x1c61('0x8')](),controller[_0x1c61('0x9')]);router['get']('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x1c61('0x8')](),controller[_0x1c61('0xa')]);router[_0x1c61('0x5')](_0x1c61('0xb'),auth['isAuthenticated'](),controller[_0x1c61('0xc')]);router[_0x1c61('0x5')](_0x1c61('0xd'),auth['isAuthenticated'](),controller[_0x1c61('0xe')]);router[_0x1c61('0x5')](_0x1c61('0xf'),auth[_0x1c61('0x8')](),controller[_0x1c61('0x10')]);router[_0x1c61('0x5')](_0x1c61('0x11'),auth['isAuthenticated'](),controller[_0x1c61('0x12')]);router[_0x1c61('0x5')]('/openchannel/queues',auth[_0x1c61('0x8')](),controller[_0x1c61('0x13')]);router['get'](_0x1c61('0x14'),auth[_0x1c61('0x8')](),controller[_0x1c61('0x15')]);router[_0x1c61('0x5')](_0x1c61('0x16'),auth[_0x1c61('0x8')](),controller[_0x1c61('0x17')]);router[_0x1c61('0x5')](_0x1c61('0x18'),auth['isAuthenticated'](),controller[_0x1c61('0x19')]);router[_0x1c61('0x5')]('/voice/queues/preview/:id',auth[_0x1c61('0x8')](),controller[_0x1c61('0x1a')]);router['get'](_0x1c61('0x1b'),auth[_0x1c61('0x8')](),controller[_0x1c61('0x1c')]);router[_0x1c61('0x5')](_0x1c61('0x1d'),auth[_0x1c61('0x8')](),controller[_0x1c61('0x1e')]);router['get'](_0x1c61('0x1f'),auth[_0x1c61('0x8')](),controller[_0x1c61('0x20')]);router[_0x1c61('0x5')](_0x1c61('0x21'),auth[_0x1c61('0x8')](),controller['voiceQueuesChannelRedirect']);router[_0x1c61('0x5')](_0x1c61('0x22'),auth[_0x1c61('0x8')](),controller[_0x1c61('0x23')]);router['put'](_0x1c61('0x22'),auth['isAuthenticated'](),controller[_0x1c61('0x24')]);router[_0x1c61('0x5')](_0x1c61('0x25'),auth[_0x1c61('0x8')](),controller[_0x1c61('0x26')]);router[_0x1c61('0x5')](_0x1c61('0x27'),auth[_0x1c61('0x8')](),controller[_0x1c61('0x28')]);router['get']('/agents',auth[_0x1c61('0x8')](),controller['agents']);router[_0x1c61('0x29')](_0x1c61('0x2a'),auth[_0x1c61('0x8')](),controller[_0x1c61('0x2b')]);router[_0x1c61('0x5')](_0x1c61('0x2c'),auth['isAuthenticated'](),controller['telephones']);router[_0x1c61('0x5')](_0x1c61('0x2d'),auth[_0x1c61('0x8')](),controller['trunks']);router['get'](_0x1c61('0x2e'),auth[_0x1c61('0x8')](),controller['campaigns']);router[_0x1c61('0x5')](_0x1c61('0x2f'),auth[_0x1c61('0x8')](),controller[_0x1c61('0x30')]);router[_0x1c61('0x5')](_0x1c61('0x31'),auth[_0x1c61('0x8')](),controller[_0x1c61('0x32')]);router[_0x1c61('0x5')](_0x1c61('0x33'),auth[_0x1c61('0x8')](),controller[_0x1c61('0x34')]);router[_0x1c61('0x5')](_0x1c61('0x35'),auth[_0x1c61('0x8')](),controller[_0x1c61('0x36')]);router['get'](_0x1c61('0x37'),auth['isAuthenticated'](),controller[_0x1c61('0x38')]);router['get'](_0x1c61('0x39'),auth[_0x1c61('0x8')](),controller[_0x1c61('0x3a')]);router['get'](_0x1c61('0x3b'),auth[_0x1c61('0x8')](),controller[_0x1c61('0x3c')]);router[_0x1c61('0x5')](_0x1c61('0x3d'),auth[_0x1c61('0x8')](),controller[_0x1c61('0x3e')]);router[_0x1c61('0x3f')]('/mail/queues/:id/notify',auth[_0x1c61('0x8')](),controller[_0x1c61('0x40')](_0x1c61('0x41')));router[_0x1c61('0x5')](_0x1c61('0x42'),auth[_0x1c61('0x8')](),controller['showMailQueues']);router[_0x1c61('0x3f')]('/chat/queues/:id/notify',auth[_0x1c61('0x8')](),controller[_0x1c61('0x40')](_0x1c61('0x43')));router['get'](_0x1c61('0x44'),auth[_0x1c61('0x8')](),controller[_0x1c61('0x45')]);router[_0x1c61('0x3f')](_0x1c61('0x46'),auth[_0x1c61('0x8')](),controller[_0x1c61('0x40')](_0x1c61('0x47')));router[_0x1c61('0x5')](_0x1c61('0x48'),auth[_0x1c61('0x8')](),controller[_0x1c61('0x49')]);router[_0x1c61('0x3f')](_0x1c61('0x4a'),auth[_0x1c61('0x8')](),controller[_0x1c61('0x40')](_0x1c61('0x4b')));router['get'](_0x1c61('0x4c'),auth[_0x1c61('0x8')](),controller[_0x1c61('0x4d')]);router[_0x1c61('0x3f')](_0x1c61('0x4e'),auth[_0x1c61('0x8')](),controller['queueNotify']('sms'));router['post'](_0x1c61('0x4f'),auth[_0x1c61('0x8')](),controller['queueNotify'](_0x1c61('0x50')));router[_0x1c61('0x5')]('/sms/queues/:id',auth[_0x1c61('0x8')](),controller['showSmsQueues']);router[_0x1c61('0x5')](_0x1c61('0x51'),auth[_0x1c61('0x8')](),controller[_0x1c61('0x52')]);router[_0x1c61('0x3f')](_0x1c61('0x53'),auth[_0x1c61('0x8')](),controller[_0x1c61('0x54')]);module[_0x1c61('0x55')]=router;
\ No newline at end of file
+var _0x2329=['/agents/:id/notify','agentNotify','exports','multer','Router','../../components/auth/service','get','/voice/channels','isAuthenticated','voiceChannelMixMonitor','voiceChannelStopMixMonitor','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','/telephones','/trunks','trunks','/campaigns','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0x2329,0x198));var _0x9232=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2329[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x9232('0x0'));var util=require('util');var path=require('path');var express=require('express');var router=express[_0x9232('0x1')]();var auth=require(_0x9232('0x2'));var controller=require('./rpc.controller');router[_0x9232('0x3')](_0x9232('0x4'),auth[_0x9232('0x5')](),controller['voiceChannels']);router[_0x9232('0x3')]('/voice/channels/:uniqueid/mixmonitor',auth[_0x9232('0x5')](),controller[_0x9232('0x6')]);router[_0x9232('0x3')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x9232('0x5')](),controller[_0x9232('0x7')]);router[_0x9232('0x3')]('/voice/queues',auth[_0x9232('0x5')](),controller['voiceQueues']);router[_0x9232('0x3')](_0x9232('0x8'),auth[_0x9232('0x5')](),controller[_0x9232('0x9')]);router[_0x9232('0x3')](_0x9232('0xa'),auth[_0x9232('0x5')](),controller[_0x9232('0xb')]);router[_0x9232('0x3')](_0x9232('0xc'),auth[_0x9232('0x5')](),controller[_0x9232('0xd')]);router[_0x9232('0x3')](_0x9232('0xe'),auth[_0x9232('0x5')](),controller[_0x9232('0xf')]);router[_0x9232('0x3')](_0x9232('0x10'),auth['isAuthenticated'](),controller[_0x9232('0x11')]);router[_0x9232('0x3')]('/whatsapp/queues',auth[_0x9232('0x5')](),controller[_0x9232('0x12')]);router[_0x9232('0x3')](_0x9232('0x13'),auth[_0x9232('0x5')](),controller[_0x9232('0x14')]);router[_0x9232('0x3')](_0x9232('0x15'),auth[_0x9232('0x5')](),controller[_0x9232('0x16')]);router[_0x9232('0x3')]('/voice/queues/channels',auth['isAuthenticated'](),controller[_0x9232('0x17')]);router[_0x9232('0x3')](_0x9232('0x18'),auth[_0x9232('0x5')](),controller['voiceQueuesChannel']);router[_0x9232('0x3')](_0x9232('0x19'),auth['isAuthenticated'](),controller[_0x9232('0x1a')]);router[_0x9232('0x3')](_0x9232('0x1b'),auth[_0x9232('0x5')](),controller[_0x9232('0x1c')]);router['get'](_0x9232('0x1d'),auth['isAuthenticated'](),controller[_0x9232('0x1e')]);router[_0x9232('0x1f')]('/voice/queues/:id',auth[_0x9232('0x5')](),controller[_0x9232('0x20')]);router[_0x9232('0x3')](_0x9232('0x21'),auth[_0x9232('0x5')](),controller['outbound']);router[_0x9232('0x3')](_0x9232('0x22'),auth[_0x9232('0x5')](),controller[_0x9232('0x23')]);router[_0x9232('0x3')](_0x9232('0x24'),auth['isAuthenticated'](),controller[_0x9232('0x25')]);router['put'](_0x9232('0x26'),auth[_0x9232('0x5')](),controller['agentCapacity']);router[_0x9232('0x3')](_0x9232('0x27'),auth['isAuthenticated'](),controller['telephones']);router[_0x9232('0x3')](_0x9232('0x28'),auth['isAuthenticated'](),controller[_0x9232('0x29')]);router[_0x9232('0x3')](_0x9232('0x2a'),auth[_0x9232('0x5')](),controller['campaigns']);router[_0x9232('0x3')](_0x9232('0x2b'),auth['isAuthenticated'](),controller[_0x9232('0x2c')]);router[_0x9232('0x3')]('/chat/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x9232('0x2d')]);router[_0x9232('0x3')](_0x9232('0x2e'),auth['isAuthenticated'](),controller[_0x9232('0x2f')]);router[_0x9232('0x3')](_0x9232('0x30'),auth['isAuthenticated'](),controller[_0x9232('0x31')]);router[_0x9232('0x3')]('/openchannel/queues/:id/waitinginteractions',auth[_0x9232('0x5')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x9232('0x3')](_0x9232('0x32'),auth[_0x9232('0x5')](),controller[_0x9232('0x33')]);router[_0x9232('0x3')](_0x9232('0x34'),auth[_0x9232('0x5')](),controller['whatsappQueuesWaitingInteractions']);router['get'](_0x9232('0x35'),auth[_0x9232('0x5')](),controller[_0x9232('0x36')]);router[_0x9232('0x37')](_0x9232('0x38'),auth[_0x9232('0x5')](),controller[_0x9232('0x39')](_0x9232('0x3a')));router['get'](_0x9232('0x3b'),auth[_0x9232('0x5')](),controller[_0x9232('0x3c')]);router[_0x9232('0x37')](_0x9232('0x3d'),auth[_0x9232('0x5')](),controller[_0x9232('0x39')]('chat'));router[_0x9232('0x3')](_0x9232('0x3e'),auth['isAuthenticated'](),controller[_0x9232('0x3f')]);router[_0x9232('0x37')](_0x9232('0x40'),auth[_0x9232('0x5')](),controller[_0x9232('0x39')](_0x9232('0x41')));router['get'](_0x9232('0x42'),auth[_0x9232('0x5')](),controller[_0x9232('0x43')]);router[_0x9232('0x37')](_0x9232('0x44'),auth[_0x9232('0x5')](),controller[_0x9232('0x39')](_0x9232('0x45')));router[_0x9232('0x3')](_0x9232('0x46'),auth[_0x9232('0x5')](),controller[_0x9232('0x47')]);router['post']('/sms/queues/:id/notify',auth['isAuthenticated'](),controller[_0x9232('0x39')]('sms'));router[_0x9232('0x37')](_0x9232('0x48'),auth[_0x9232('0x5')](),controller[_0x9232('0x39')](_0x9232('0x49')));router['get'](_0x9232('0x4a'),auth[_0x9232('0x5')](),controller[_0x9232('0x4b')]);router[_0x9232('0x3')](_0x9232('0x4c'),auth[_0x9232('0x5')](),controller[_0x9232('0x4d')]);router[_0x9232('0x37')](_0x9232('0x4e'),auth['isAuthenticated'](),controller[_0x9232('0x4f')]);module[_0x9232('0x50')]=router;
\ No newline at end of file
index 1841e2a..6208e6d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d17=['whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','capitalize','chat','Website','Queue','\x20Queue\x20not\x20found','Message','findOne','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','QueueId','TransferReport','create','Start','Account','queueTransferTimeout','*,*,*,*','agentNotify','channel','User','Agent\x20not\x20found','agentTransferTimeout','bluebird','moment','../../mysqldb','../../config/logger','api','client','http','code','error','message','result','catch','status','json','sendStatus','stack','name','send','isNil','rows','find','VoiceChannels','then','voiceChannelMixMonitor','VoiceChannelMixMonitor','query','params','voiceChannelStopMixMonitor','merge','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','agents','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','SIP/%s','format','agent','internal','AgentCapacity','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','showChatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','showOpenchannelQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','FaxAccounts','ChatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','queue_id','uniq','value','filter','indexOf','smsQueuesWaitingInteractions'];(function(_0x13c211,_0x1044b0){var _0x2c7adc=function(_0x57f872){while(--_0x57f872){_0x13c211['push'](_0x13c211['shift']());}};_0x2c7adc(++_0x1044b0);}(_0x5d17,0x114));var _0x75d1=function(_0x18afca,_0x4219d9){_0x18afca=_0x18afca-0x0;var _0x11603f=_0x5d17[_0x18afca];return _0x11603f;};'use strict';var BPromise=require(_0x75d1('0x0'));var moment=require(_0x75d1('0x1'));var _=require('lodash');var util=require('util');var db=require(_0x75d1('0x2'))['db'];var logger=require(_0x75d1('0x3'))(_0x75d1('0x4'));var jayson=require('jayson/promise');var amiClient=jayson[_0x75d1('0x5')][_0x75d1('0x6')]({'port':0x232a});var mailClient=jayson[_0x75d1('0x5')][_0x75d1('0x6')]({'port':0x232b});var routingClient=jayson['client'][_0x75d1('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x116a51,_0x5c957a,_0x1ee61b){return new BPromise(function(_0x3a9d5e,_0x105607){var _0xf9f8e=_0x1ee61b?_0x1ee61b:amiClient;return _0xf9f8e['request'](_0x116a51,_0x5c957a)['then'](function(_0x40df40){if(_0x40df40['error']){if(_0x40df40['error'][_0x75d1('0x7')]===0x1f4){return _0x105607(_0x40df40[_0x75d1('0x8')]['message']);}return _0x3a9d5e(_0x40df40[_0x75d1('0x8')][_0x75d1('0x9')]);}else{_0x3a9d5e(_0x40df40[_0x75d1('0xa')]);}})[_0x75d1('0xb')](function(_0x6c1265){_0x105607(_0x6c1265);});});}function respondWithResult(_0xd089cf,_0x49667a){_0x49667a=_0x49667a||0xc8;return function(_0x19e825){if(_0x19e825){return _0xd089cf[_0x75d1('0xc')](_0x49667a)[_0x75d1('0xd')](_0x19e825);}return _0xd089cf[_0x75d1('0xe')](0x194);};}function handleError(_0x49d723,_0x553697){_0x553697=_0x553697||0x1f4;return function(_0x55b8a0){logger[_0x75d1('0x8')](_0x55b8a0[_0x75d1('0xf')]);if(_0x55b8a0[_0x75d1('0x10')]){delete _0x55b8a0['name'];}_0x49d723[_0x75d1('0xc')](_0x553697)[_0x75d1('0x11')](_0x55b8a0);};}function findById(_0x1d30f3){return function(_0x269e82){if(!_[_0x75d1('0x12')](_0x1d30f3)&&!_[_0x75d1('0x12')](_0x269e82)&&!_[_0x75d1('0x12')](_0x269e82[_0x75d1('0x13')])){return _[_0x75d1('0x14')](_0x269e82[_0x75d1('0x13')],function(_0x2c2a6d){return _0x2c2a6d['id']==_0x1d30f3;});}return null;};}exports['voiceChannels']=function(_0x493fff,_0xc6b282){return respondWithRpcPromise(_0x75d1('0x15'),_0x493fff['query'])[_0x75d1('0x16')](respondWithResult(_0xc6b282,null))[_0x75d1('0xb')](handleError(_0xc6b282,null));};exports[_0x75d1('0x17')]=function(_0xf6cc70,_0xa42dbe){return respondWithRpcPromise(_0x75d1('0x18'),_['merge'](_0xf6cc70[_0x75d1('0x19')],_0xf6cc70[_0x75d1('0x1a')]))['then'](respondWithResult(_0xa42dbe,null))[_0x75d1('0xb')](handleError(_0xa42dbe,null));};exports[_0x75d1('0x1b')]=function(_0x526f6c,_0x2c0c21){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0x75d1('0x1c')](_0x526f6c[_0x75d1('0x19')],_0x526f6c[_0x75d1('0x1a')]))['then'](respondWithResult(_0x2c0c21,null))['catch'](handleError(_0x2c0c21,null));};exports[_0x75d1('0x1d')]=function(_0x45b18f,_0x315ce5){return respondWithRpcPromise(_0x75d1('0x1e'),_0x45b18f['query'])[_0x75d1('0x16')](respondWithResult(_0x315ce5,null))[_0x75d1('0xb')](handleError(_0x315ce5,null));};exports[_0x75d1('0x1f')]=function(_0x51138e,_0x54095d){return respondWithRpcPromise('VoiceQueues',_0x51138e[_0x75d1('0x19')])[_0x75d1('0x16')](findById(_0x51138e[_0x75d1('0x1a')]['id']))[_0x75d1('0x16')](respondWithResult(_0x54095d,null))[_0x75d1('0xb')](handleError(_0x54095d,null));};exports['updateVoiceQueue']=function(_0x4d292e,_0x410e16){return respondWithRpcPromise(_0x75d1('0x20'),_['merge'](_0x4d292e[_0x75d1('0x21')],_0x4d292e['params']))[_0x75d1('0x16')](respondWithResult(_0x410e16,null))[_0x75d1('0xb')](handleError(_0x410e16,null));};exports[_0x75d1('0x22')]=function(_0x3fb7b9,_0x36ae86){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x75d1('0x1c')](_0x3fb7b9[_0x75d1('0x19')],_0x3fb7b9[_0x75d1('0x1a')]))[_0x75d1('0x16')](respondWithResult(_0x36ae86,null))['catch'](handleError(_0x36ae86,null));};exports[_0x75d1('0x23')]=function(_0x551824,_0x1b2bbb){return respondWithRpcPromise(_0x75d1('0x24'),_0x551824['query'])[_0x75d1('0x16')](respondWithResult(_0x1b2bbb,null))[_0x75d1('0xb')](handleError(_0x1b2bbb,null));};exports[_0x75d1('0x25')]=function(_0x100a4b,_0x22b190){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x75d1('0x1c')](_0x100a4b[_0x75d1('0x19')],_0x100a4b[_0x75d1('0x1a')]))[_0x75d1('0x16')](respondWithResult(_0x22b190,null))['catch'](handleError(_0x22b190,null));};exports['voiceQueuesChannelHangup']=function(_0x551723,_0x3d9275){return respondWithRpcPromise(_0x75d1('0x26'),_[_0x75d1('0x1c')](_0x551723[_0x75d1('0x19')],_0x551723[_0x75d1('0x1a')]))[_0x75d1('0x16')](respondWithResult(_0x3d9275,null))[_0x75d1('0xb')](handleError(_0x3d9275,null));};exports[_0x75d1('0x27')]=function(_0x433092,_0x534511){return respondWithRpcPromise(_0x75d1('0x28'),_[_0x75d1('0x1c')](_0x433092[_0x75d1('0x19')],_0x433092[_0x75d1('0x1a')]))[_0x75d1('0x16')](respondWithResult(_0x534511,null))['catch'](handleError(_0x534511,null));};exports['outbound']=function(_0x487431,_0x1058b7){return respondWithRpcPromise(_0x75d1('0x29'),_0x487431[_0x75d1('0x19')])[_0x75d1('0x16')](respondWithResult(_0x1058b7,null))[_0x75d1('0xb')](handleError(_0x1058b7,null));};exports[_0x75d1('0x2a')]=function(_0x48f9f3,_0x5553b9){return respondWithRpcPromise('OutboundChannels',_0x48f9f3[_0x75d1('0x19')])['then'](respondWithResult(_0x5553b9,null))['catch'](handleError(_0x5553b9,null));};exports[_0x75d1('0x2b')]=function(_0x21bfd8,_0x45eea3){var _0x46854c;return respondWithRpcPromise('Agents',_0x21bfd8[_0x75d1('0x19')])[_0x75d1('0x16')](function(_0x38bf47){_0x46854c=_0x38bf47;return respondWithRpcPromise(_0x75d1('0x2c'),_0x21bfd8[_0x75d1('0x19')],routingClient);})[_0x75d1('0x16')](function(_0x33df05){return _[_0x75d1('0x1c')]({},_0x33df05,_0x46854c);})[_0x75d1('0x16')](respondWithResult(_0x45eea3,null))[_0x75d1('0xb')](handleError(_0x45eea3,null));};exports[_0x75d1('0x2d')]=function(_0x93922f,_0xe14be9){if(_0x93922f[_0x75d1('0x21')]&&_0x93922f[_0x75d1('0x21')][_0x75d1('0x2e')]&&_0x93922f[_0x75d1('0x2f')]&&_0x93922f[_0x75d1('0x2f')][_0x75d1('0x10')]){for(var _0x2384aa in _0x93922f[_0x75d1('0x21')][_0x75d1('0x2e')]){if(_0x93922f['body']['interaction'][_0x75d1('0x30')](_0x2384aa)){db[_0x75d1('0x31')][_0x75d1('0x32')]({'where':{'channel':_0x2384aa,'membername':_0x93922f[_0x75d1('0x2f')]['name'],'type':_0x75d1('0x33'),'exitAt':null,'uniqueid':_0x93922f[_0x75d1('0x21')][_0x75d1('0x2e')][_0x2384aa]&&_0x93922f[_0x75d1('0x21')]['interaction'][_0x2384aa][_0x75d1('0x34')]?{'$notIn':_0x93922f[_0x75d1('0x21')][_0x75d1('0x2e')][_0x2384aa]}:{'$ne':null}}})[_0x75d1('0x16')](function(_0x5b486d){var _0x34d132=moment()['format'](_0x75d1('0x35'));for(var _0x1d063d=0x0,_0x9bc1ed=_0x5b486d[_0x75d1('0x34')];_0x1d063d<_0x9bc1ed;_0x1d063d+=0x1){_0x5b486d[_0x1d063d][_0x75d1('0x36')]({'exitAt':_0x34d132});}});for(var _0x2137e1=0x0;_0x2137e1<_0x93922f['body'][_0x75d1('0x2e')][_0x2384aa]['length'];_0x2137e1+=0x1){db['MemberReport'][_0x75d1('0x37')]({'where':{'channel':_0x2384aa,'membername':_0x93922f[_0x75d1('0x2f')][_0x75d1('0x10')],'type':_0x75d1('0x33'),'uniqueid':_0x93922f[_0x75d1('0x21')][_0x75d1('0x2e')][_0x2384aa][_0x2137e1],'exitAt':null},'defaults':{'channel':_0x2384aa,'membername':_0x93922f[_0x75d1('0x2f')]['name'],'interface':_['isNil'](_0x93922f[_0x75d1('0x2f')][_0x75d1('0x38')])?util['format'](_0x75d1('0x39'),_0x93922f[_0x75d1('0x2f')][_0x75d1('0x10')]):_0x93922f['user'][_0x75d1('0x38')],'type':_0x75d1('0x33'),'enterAt':moment()[_0x75d1('0x3a')](_0x75d1('0x35')),'role':_0x75d1('0x3b'),'internal':_0x93922f[_0x75d1('0x2f')][_0x75d1('0x3c')],'uniqueid':_0x93922f['body'][_0x75d1('0x2e')][_0x2384aa][_0x2137e1]}});}}}}return respondWithRpcPromise(_0x75d1('0x3d'),{'id':_0x93922f[_0x75d1('0x1a')]['id'],'capacity':_0x93922f[_0x75d1('0x21')][_0x75d1('0x3e')]},routingClient)[_0x75d1('0x16')](respondWithResult(_0xe14be9,null))[_0x75d1('0xb')](handleError(_0xe14be9,null));};exports['telephones']=function(_0x7da202,_0x3af9c5){return respondWithRpcPromise(_0x75d1('0x3f'),_0x7da202['query'])[_0x75d1('0x16')](respondWithResult(_0x3af9c5,null))[_0x75d1('0xb')](handleError(_0x3af9c5,null));};exports[_0x75d1('0x40')]=function(_0x382760,_0x281123){return respondWithRpcPromise(_0x75d1('0x41'),_0x382760['query'])[_0x75d1('0x16')](respondWithResult(_0x281123,null))[_0x75d1('0xb')](handleError(_0x281123,null));};exports[_0x75d1('0x42')]=function(_0x46e665,_0x2e746a){return respondWithRpcPromise(_0x75d1('0x43'),_0x46e665[_0x75d1('0x19')])[_0x75d1('0x16')](respondWithResult(_0x2e746a,null))[_0x75d1('0xb')](handleError(_0x2e746a,null));};exports[_0x75d1('0x44')]=function(_0x1038d2,_0x13050e){return respondWithRpcPromise('ChatQueues',_0x1038d2['query'],routingClient)[_0x75d1('0x16')](respondWithResult(_0x13050e,null))['catch'](handleError(_0x13050e,null));};exports[_0x75d1('0x45')]=function(_0x1e149b,_0x5dcb55){return respondWithRpcPromise(_0x75d1('0x46'),_0x1e149b[_0x75d1('0x19')],routingClient)[_0x75d1('0x16')](findById(_0x1e149b[_0x75d1('0x1a')]['id']))[_0x75d1('0x16')](respondWithResult(_0x5dcb55,null))[_0x75d1('0xb')](handleError(_0x5dcb55,null));};exports[_0x75d1('0x47')]=function(_0x5048ef,_0x3c5da6){return respondWithRpcPromise(_0x75d1('0x48'),_0x5048ef[_0x75d1('0x19')],routingClient)[_0x75d1('0x16')](respondWithResult(_0x3c5da6,null))[_0x75d1('0xb')](handleError(_0x3c5da6,null));};exports[_0x75d1('0x49')]=function(_0x41f98f,_0x3b30fb){return respondWithRpcPromise(_0x75d1('0x48'),_0x41f98f[_0x75d1('0x19')],routingClient)['then'](findById(_0x41f98f['params']['id']))[_0x75d1('0x16')](respondWithResult(_0x3b30fb,null))[_0x75d1('0xb')](handleError(_0x3b30fb,null));};exports[_0x75d1('0x4a')]=function(_0x49d9ca,_0x1d7de1){return respondWithRpcPromise('MailAccounts',_0x49d9ca[_0x75d1('0x19')],mailClient)[_0x75d1('0x16')](respondWithResult(_0x1d7de1,null))[_0x75d1('0xb')](handleError(_0x1d7de1,null));};exports[_0x75d1('0x4b')]=function(_0x5d2219,_0x22ce12){return respondWithRpcPromise('OpenchannelQueues',_0x5d2219['query'],routingClient)[_0x75d1('0x16')](respondWithResult(_0x22ce12,null))[_0x75d1('0xb')](handleError(_0x22ce12,null));};exports[_0x75d1('0x4c')]=function(_0x3c8119,_0x4fd170){return respondWithRpcPromise('OpenchannelQueues',_0x3c8119[_0x75d1('0x19')],routingClient)[_0x75d1('0x16')](findById(_0x3c8119[_0x75d1('0x1a')]['id']))[_0x75d1('0x16')](respondWithResult(_0x4fd170,null))[_0x75d1('0xb')](handleError(_0x4fd170,null));};exports['smsQueues']=function(_0x223db6,_0x44173c){return respondWithRpcPromise(_0x75d1('0x4d'),_0x223db6[_0x75d1('0x19')],routingClient)[_0x75d1('0x16')](respondWithResult(_0x44173c,null))[_0x75d1('0xb')](handleError(_0x44173c,null));};exports[_0x75d1('0x4e')]=function(_0x1092fb,_0x40f50b){return respondWithRpcPromise(_0x75d1('0x4d'),_0x1092fb[_0x75d1('0x19')],routingClient)['then'](findById(_0x1092fb[_0x75d1('0x1a')]['id']))[_0x75d1('0x16')](respondWithResult(_0x40f50b,null))[_0x75d1('0xb')](handleError(_0x40f50b,null));};exports[_0x75d1('0x4f')]=function(_0x3754b1,_0x174fde){return respondWithRpcPromise(_0x75d1('0x50'),_0x3754b1['query'],routingClient)['then'](respondWithResult(_0x174fde,null))[_0x75d1('0xb')](handleError(_0x174fde,null));};exports[_0x75d1('0x51')]=function(_0x6f8ca2,_0x13ddbb){return respondWithRpcPromise(_0x75d1('0x50'),_0x6f8ca2['query'],routingClient)['then'](findById(_0x6f8ca2[_0x75d1('0x1a')]['id']))[_0x75d1('0x16')](respondWithResult(_0x13ddbb,null))['catch'](handleError(_0x13ddbb,null));};exports[_0x75d1('0x52')]=function(_0x29b1f4,_0x25dfa1){return respondWithRpcPromise(_0x75d1('0x53'),_0x29b1f4[_0x75d1('0x19')],routingClient)[_0x75d1('0x16')](respondWithResult(_0x25dfa1,null))['catch'](handleError(_0x25dfa1,null));};exports['showFaxQueues']=function(_0x2c0452,_0x3fad5c){return respondWithRpcPromise('FaxQueues',_0x2c0452[_0x75d1('0x19')],routingClient)['then'](findById(_0x2c0452[_0x75d1('0x1a')]['id']))[_0x75d1('0x16')](respondWithResult(_0x3fad5c,null))[_0x75d1('0xb')](handleError(_0x3fad5c,null));};exports['faxAccounts']=function(_0x254cfe,_0x1f9ac2){return respondWithRpcPromise(_0x75d1('0x54'),_0x254cfe[_0x75d1('0x19')])[_0x75d1('0x16')](respondWithResult(_0x1f9ac2,null))['catch'](handleError(_0x1f9ac2,null));};exports['chatQueuesWaitingInteractions']=function(_0x3785fd,_0x58d20b){return respondWithRpcPromise(_0x75d1('0x55'),_0x3785fd[_0x75d1('0x19')],routingClient)[_0x75d1('0x16')](respondWithResult(_0x58d20b,null))['catch'](handleError(_0x58d20b,null));};exports['mailQueuesWaitingInteractions']=function(_0x2e6849,_0x486977){return respondWithRpcPromise(_0x75d1('0x56'),_0x2e6849[_0x75d1('0x19')],routingClient)[_0x75d1('0x16')](respondWithResult(_0x486977,null))['catch'](handleError(_0x486977,null));};exports[_0x75d1('0x57')]=function(_0x353bec,_0x644ced){return respondWithRpcPromise(_0x75d1('0x58'),_0x353bec[_0x75d1('0x19')],routingClient)[_0x75d1('0x16')](respondWithResult(_0x644ced,null))[_0x75d1('0xb')](handleError(_0x644ced,null));};exports[_0x75d1('0x59')]=function(_0x3af4a7,_0x1ca2ee){return respondWithRpcPromise(_0x75d1('0x58'),_0x3af4a7[_0x75d1('0x19')],routingClient)[_0x75d1('0x16')](function(_0x44ef76){if(_0x3af4a7['query']['type']!==undefined){var _0x410fa1=_(_0x44ef76[_0x75d1('0x13')])['filter']([_0x3af4a7[_0x75d1('0x19')]['type'],_0x3af4a7['params']['id']])['map'](_0x75d1('0x5a'))[_0x75d1('0x5b')]()[_0x75d1('0x5c')]();return _0x44ef76[_0x75d1('0x13')][_0x75d1('0x5d')](function(_0x5d5a72){return _0x410fa1[_0x75d1('0x5e')](_0x5d5a72[_0x75d1('0x5a')])>-0x1;});}else{return _0x44ef76[_0x75d1('0x13')][_0x75d1('0x5d')](function(_0x29960e){return _0x29960e['queue_id']===parseInt(_0x3af4a7[_0x75d1('0x1a')]['id']);});}})['then'](respondWithResult(_0x1ca2ee,null))[_0x75d1('0xb')](handleError(_0x1ca2ee,null));};exports[_0x75d1('0x5f')]=function(_0x3d5355,_0x526d98){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x3d5355['query'],routingClient)[_0x75d1('0x16')](respondWithResult(_0x526d98,null))[_0x75d1('0xb')](handleError(_0x526d98,null));};exports[_0x75d1('0x60')]=function(_0x22caf3,_0x17ec6d){return respondWithRpcPromise(_0x75d1('0x61'),_0x22caf3['query'],routingClient)[_0x75d1('0x16')](respondWithResult(_0x17ec6d,null))[_0x75d1('0xb')](handleError(_0x17ec6d,null));};exports['faxQueuesWaitingInteractions']=function(_0x4eda90,_0x5c16be){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x4eda90['query'],routingClient)[_0x75d1('0x16')](respondWithResult(_0x5c16be,null))['catch'](handleError(_0x5c16be,null));};exports['queueNotify']=function(_0x3f582c){return function(_0x4e546f,_0x451828){var _0x13179c,_0x739cc2;var _0xc939c9=_[_0x75d1('0x62')](_0x3f582c);var _0x1aa806=_0x3f582c===_0x75d1('0x63')?_0x75d1('0x64'):'Account';return db[_0xc939c9+_0x75d1('0x65')]['findOne']({'raw':!![],'where':{'id':_0x4e546f[_0x75d1('0x1a')]['id']}})[_0x75d1('0x16')](function(_0x358c70){if(_['isNil'](_0x358c70)){throw new Error(_0xc939c9+_0x75d1('0x66'));}_0x13179c=_0x358c70;return db[_0xc939c9+_0x75d1('0x67')][_0x75d1('0x68')]({'where':{'id':_0x4e546f[_0x75d1('0x21')][_0x75d1('0x69')]},'include':[{'model':db[_0xc939c9+_0x75d1('0x6a')],'as':_0x75d1('0x6a')},{'model':db[_0xc939c9+_0x1aa806],'as':'Account'}]});})[_0x75d1('0x16')](function(_0x21932b){if(_[_0x75d1('0x12')](_0x21932b)){throw new Error(_0xc939c9+_0x75d1('0x6b'));}_0x739cc2=_0x21932b;return _0x21932b[_0x75d1('0x6c')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x4814d8={'uniqueid':_0x3f582c+'.'+_0x739cc2['id']+'.'+_0x739cc2[_0x75d1('0x6a')]['id'],'FromUserId':_0x4e546f['user']['id'],'type':_0x75d1('0x6d')};_0x4814d8[_0xc939c9+_0x75d1('0x6e')]=_0x739cc2['id'];_0x4814d8[_0xc939c9+_0x75d1('0x6f')]=_0x739cc2[_0x75d1('0x6a')]['id'];_0x4814d8['From'+_0xc939c9+_0x1aa806+'Id']=_0x739cc2['Account']['id'];_0x4814d8['To'+_0xc939c9+_0x75d1('0x70')]=_0x13179c['id'];return db[_0xc939c9+_0x75d1('0x71')][_0x75d1('0x72')](_0x4814d8);})[_0x75d1('0x16')](function(){return respondWithRpcPromise(_0x75d1('0x73'),{'channel':_0x3f582c,'interaction':_0x739cc2['Interaction'],'message':_0x739cc2,'account':_0x739cc2[_0x75d1('0x74')],'applications':[{'id':0x0,'priority':0x1,'app':_0x75d1('0x6d'),'appdata':_0x13179c['name']+','+(_0x739cc2[_0x75d1('0x74')][_0x75d1('0x75')]||0x12c),'interval':_0x75d1('0x76')}]},routingClient);})[_0x75d1('0x16')](respondWithResult(_0x451828,null))[_0x75d1('0xb')](handleError(_0x451828,null));};};exports[_0x75d1('0x77')]=function(_0x54405a,_0x145b7f){var _0x1b026e,_0x39084f;if(_[_0x75d1('0x12')](_0x54405a[_0x75d1('0x21')][_0x75d1('0x78')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x30214e=_0x54405a['body'][_0x75d1('0x78')];var _0x400d3a=_[_0x75d1('0x62')](_0x30214e);var _0x15ac7b=_0x30214e===_0x75d1('0x63')?_0x75d1('0x64'):'Account';return db[_0x75d1('0x79')][_0x75d1('0x68')]({'raw':!![],'where':{'id':_0x54405a[_0x75d1('0x1a')]['id'],'role':'agent'}})[_0x75d1('0x16')](function(_0x4433ff){if(_['isNil'](_0x4433ff)){throw new Error(_0x75d1('0x7a'));}_0x1b026e=_0x4433ff;return db[_0x400d3a+_0x75d1('0x67')][_0x75d1('0x68')]({'where':{'id':_0x54405a[_0x75d1('0x21')][_0x75d1('0x69')]},'include':[{'model':db[_0x400d3a+_0x75d1('0x6a')],'as':_0x75d1('0x6a')},{'model':db[_0x400d3a+_0x15ac7b],'as':_0x75d1('0x74')}]});})[_0x75d1('0x16')](function(_0x57653d){if(_[_0x75d1('0x12')](_0x57653d)){throw new Error(_0x400d3a+_0x75d1('0x6b'));}_0x39084f=_0x57653d;return _0x57653d['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x75d1('0x16')](function(){var _0x2e9cf1={'uniqueid':_0x30214e+'.'+_0x39084f['id']+'.'+_0x39084f['Interaction']['id'],'FromUserId':_0x54405a['user']['id'],'type':_0x75d1('0x6d'),'ToUserId':_0x1b026e['id']};_0x2e9cf1[_0x400d3a+_0x75d1('0x6e')]=_0x39084f['id'];_0x2e9cf1[_0x400d3a+_0x75d1('0x6f')]=_0x39084f[_0x75d1('0x6a')]['id'];_0x2e9cf1['From'+_0x400d3a+_0x15ac7b+'Id']=_0x39084f[_0x75d1('0x74')]['id'];return db[_0x400d3a+'TransferReport'][_0x75d1('0x72')](_0x2e9cf1);})[_0x75d1('0x16')](function(){return respondWithRpcPromise(_0x75d1('0x73'),{'channel':_0x30214e,'interaction':_0x39084f[_0x75d1('0x6a')],'message':_0x39084f,'account':_0x39084f[_0x75d1('0x74')],'applications':[{'id':0x0,'priority':0x1,'app':_0x75d1('0x3b'),'appdata':_0x1b026e[_0x75d1('0x10')]+','+(_0x39084f[_0x75d1('0x74')][_0x75d1('0x7b')]||0x12c),'interval':_0x75d1('0x76')}]},routingClient);})[_0x75d1('0x16')](respondWithResult(_0x145b7f,null))[_0x75d1('0xb')](handleError(_0x145b7f,null));};
\ No newline at end of file
+var _0x98a8=['openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','value','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','findOne','\x20Queue\x20not\x20found','Message','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','QueueId','TransferReport','create','Start','Account','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Website','User','Agent\x20not\x20found','messageId','From','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','client','http','request','then','error','code','result','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','catch','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','updateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','Outbound','OutboundChannels','agents','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','length','YYYY-MM-DD\x20HH:mm:ss','findOrCreate','format','SIP/%s','interface','agent','internal','AgentCapacity','capacity','telephones','trunks','Trunks','campaigns','Campaigns','ChatQueues','showChatQueues','MailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','whatsappQueues','WhatsappQueues','faxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions'];(function(_0x3d1b59,_0x163626){var _0x1da84f=function(_0xf2b0a0){while(--_0xf2b0a0){_0x3d1b59['push'](_0x3d1b59['shift']());}};_0x1da84f(++_0x163626);}(_0x98a8,0x12c));var _0x898a=function(_0x3737a2,_0x3875f3){_0x3737a2=_0x3737a2-0x0;var _0x1f497b=_0x98a8[_0x3737a2];return _0x1f497b;};'use strict';var BPromise=require(_0x898a('0x0'));var moment=require(_0x898a('0x1'));var _=require(_0x898a('0x2'));var util=require(_0x898a('0x3'));var db=require(_0x898a('0x4'))['db'];var logger=require(_0x898a('0x5'))(_0x898a('0x6'));var jayson=require('jayson/promise');var amiClient=jayson[_0x898a('0x7')][_0x898a('0x8')]({'port':0x232a});var mailClient=jayson[_0x898a('0x7')][_0x898a('0x8')]({'port':0x232b});var routingClient=jayson[_0x898a('0x7')]['http']({'port':0x232c});function respondWithRpcPromise(_0x3aadc2,_0x564583,_0xfa8c50){return new BPromise(function(_0x4fbce5,_0x42021d){var _0x283c5=_0xfa8c50?_0xfa8c50:amiClient;return _0x283c5[_0x898a('0x9')](_0x3aadc2,_0x564583)[_0x898a('0xa')](function(_0x3150df){if(_0x3150df[_0x898a('0xb')]){if(_0x3150df[_0x898a('0xb')][_0x898a('0xc')]===0x1f4){return _0x42021d(_0x3150df[_0x898a('0xb')]['message']);}return _0x4fbce5(_0x3150df[_0x898a('0xb')]['message']);}else{_0x4fbce5(_0x3150df[_0x898a('0xd')]);}})['catch'](function(_0x25d7f2){_0x42021d(_0x25d7f2);});});}function respondWithResult(_0x2c76b7,_0x364a23){_0x364a23=_0x364a23||0xc8;return function(_0x5f5e06){if(_0x5f5e06){return _0x2c76b7['status'](_0x364a23)['json'](_0x5f5e06);}return _0x2c76b7[_0x898a('0xe')](0x194);};}function handleError(_0x1f5be4,_0xb24335){_0xb24335=_0xb24335||0x1f4;return function(_0x116fbe){logger[_0x898a('0xb')](_0x116fbe[_0x898a('0xf')]);if(_0x116fbe['name']){delete _0x116fbe[_0x898a('0x10')];}_0x1f5be4['status'](_0xb24335)[_0x898a('0x11')](_0x116fbe);};}function findById(_0x5c96a6){return function(_0x303321){if(!_['isNil'](_0x5c96a6)&&!_[_0x898a('0x12')](_0x303321)&&!_['isNil'](_0x303321[_0x898a('0x13')])){return _[_0x898a('0x14')](_0x303321[_0x898a('0x13')],function(_0x4ddd4d){return _0x4ddd4d['id']==_0x5c96a6;});}return null;};}exports[_0x898a('0x15')]=function(_0x5960e0,_0x54c8f3){return respondWithRpcPromise(_0x898a('0x16'),_0x5960e0[_0x898a('0x17')])['then'](respondWithResult(_0x54c8f3,null))['catch'](handleError(_0x54c8f3,null));};exports[_0x898a('0x18')]=function(_0x26449a,_0x38a8f0){return respondWithRpcPromise(_0x898a('0x19'),_[_0x898a('0x1a')](_0x26449a[_0x898a('0x17')],_0x26449a[_0x898a('0x1b')]))['then'](respondWithResult(_0x38a8f0,null))[_0x898a('0x1c')](handleError(_0x38a8f0,null));};exports[_0x898a('0x1d')]=function(_0x11cae2,_0x3cfd9c){return respondWithRpcPromise(_0x898a('0x1e'),_[_0x898a('0x1a')](_0x11cae2['query'],_0x11cae2[_0x898a('0x1b')]))[_0x898a('0xa')](respondWithResult(_0x3cfd9c,null))[_0x898a('0x1c')](handleError(_0x3cfd9c,null));};exports[_0x898a('0x1f')]=function(_0x3901ab,_0x1426e3){return respondWithRpcPromise('VoiceQueues',_0x3901ab[_0x898a('0x17')])['then'](respondWithResult(_0x1426e3,null))['catch'](handleError(_0x1426e3,null));};exports['showVoiceQueues']=function(_0x3678be,_0x1f4d86){return respondWithRpcPromise(_0x898a('0x20'),_0x3678be[_0x898a('0x17')])[_0x898a('0xa')](findById(_0x3678be[_0x898a('0x1b')]['id']))[_0x898a('0xa')](respondWithResult(_0x1f4d86,null))[_0x898a('0x1c')](handleError(_0x1f4d86,null));};exports[_0x898a('0x21')]=function(_0x58149d,_0x4b3e68){return respondWithRpcPromise('UpdateVoiceQueue',_[_0x898a('0x1a')](_0x58149d[_0x898a('0x22')],_0x58149d[_0x898a('0x1b')]))[_0x898a('0xa')](respondWithResult(_0x4b3e68,null))[_0x898a('0x1c')](handleError(_0x4b3e68,null));};exports[_0x898a('0x23')]=function(_0xe3c983,_0xf74645){return respondWithRpcPromise(_0x898a('0x24'),_[_0x898a('0x1a')](_0xe3c983[_0x898a('0x17')],_0xe3c983[_0x898a('0x1b')]))['then'](respondWithResult(_0xf74645,null))[_0x898a('0x1c')](handleError(_0xf74645,null));};exports[_0x898a('0x25')]=function(_0x26eead,_0x17a980){return respondWithRpcPromise(_0x898a('0x26'),_0x26eead['query'])['then'](respondWithResult(_0x17a980,null))[_0x898a('0x1c')](handleError(_0x17a980,null));};exports[_0x898a('0x27')]=function(_0x1d6d66,_0x4de9bf){return respondWithRpcPromise(_0x898a('0x28'),_[_0x898a('0x1a')](_0x1d6d66[_0x898a('0x17')],_0x1d6d66[_0x898a('0x1b')]))[_0x898a('0xa')](respondWithResult(_0x4de9bf,null))[_0x898a('0x1c')](handleError(_0x4de9bf,null));};exports[_0x898a('0x29')]=function(_0x146f32,_0x50bb4b){return respondWithRpcPromise(_0x898a('0x2a'),_['merge'](_0x146f32['query'],_0x146f32[_0x898a('0x1b')]))['then'](respondWithResult(_0x50bb4b,null))[_0x898a('0x1c')](handleError(_0x50bb4b,null));};exports['voiceQueuesChannelRedirect']=function(_0x37cb11,_0x4f202c){return respondWithRpcPromise(_0x898a('0x2b'),_[_0x898a('0x1a')](_0x37cb11[_0x898a('0x17')],_0x37cb11['params']))['then'](respondWithResult(_0x4f202c,null))['catch'](handleError(_0x4f202c,null));};exports[_0x898a('0x2c')]=function(_0x429c32,_0x5a228f){return respondWithRpcPromise(_0x898a('0x2d'),_0x429c32[_0x898a('0x17')])[_0x898a('0xa')](respondWithResult(_0x5a228f,null))[_0x898a('0x1c')](handleError(_0x5a228f,null));};exports['outboundChannels']=function(_0x4b07bc,_0x3aed01){return respondWithRpcPromise(_0x898a('0x2e'),_0x4b07bc['query'])['then'](respondWithResult(_0x3aed01,null))[_0x898a('0x1c')](handleError(_0x3aed01,null));};exports[_0x898a('0x2f')]=function(_0x181cc8,_0xa45405){var _0x51681f;return respondWithRpcPromise(_0x898a('0x30'),_0x181cc8[_0x898a('0x17')])['then'](function(_0x516b8c){_0x51681f=_0x516b8c;return respondWithRpcPromise('Agents',_0x181cc8[_0x898a('0x17')],routingClient);})[_0x898a('0xa')](function(_0x35d767){return _[_0x898a('0x1a')]({},_0x35d767,_0x51681f);})[_0x898a('0xa')](respondWithResult(_0xa45405,null))[_0x898a('0x1c')](handleError(_0xa45405,null));};exports[_0x898a('0x31')]=function(_0x1432ec,_0x3292c2){if(_0x1432ec[_0x898a('0x22')]&&_0x1432ec[_0x898a('0x22')][_0x898a('0x32')]&&_0x1432ec[_0x898a('0x33')]&&_0x1432ec[_0x898a('0x33')][_0x898a('0x10')]){for(var _0x4c8628 in _0x1432ec[_0x898a('0x22')][_0x898a('0x32')]){if(_0x1432ec[_0x898a('0x22')]['interaction'][_0x898a('0x34')](_0x4c8628)){db[_0x898a('0x35')][_0x898a('0x36')]({'where':{'channel':_0x4c8628,'membername':_0x1432ec[_0x898a('0x33')][_0x898a('0x10')],'type':_0x898a('0x37'),'exitAt':null,'uniqueid':_0x1432ec[_0x898a('0x22')][_0x898a('0x32')][_0x4c8628]&&_0x1432ec['body'][_0x898a('0x32')][_0x4c8628][_0x898a('0x38')]?{'$notIn':_0x1432ec[_0x898a('0x22')][_0x898a('0x32')][_0x4c8628]}:{'$ne':null}}})['then'](function(_0x3d5fba){var _0x152060=moment()['format'](_0x898a('0x39'));for(var _0x4ce00e=0x0,_0x56a40c=_0x3d5fba['length'];_0x4ce00e<_0x56a40c;_0x4ce00e+=0x1){_0x3d5fba[_0x4ce00e]['updateAttributes']({'exitAt':_0x152060});}});for(var _0x322ecc=0x0;_0x322ecc<_0x1432ec['body'][_0x898a('0x32')][_0x4c8628][_0x898a('0x38')];_0x322ecc+=0x1){db['MemberReport'][_0x898a('0x3a')]({'where':{'channel':_0x4c8628,'membername':_0x1432ec[_0x898a('0x33')]['name'],'type':_0x898a('0x37'),'uniqueid':_0x1432ec[_0x898a('0x22')][_0x898a('0x32')][_0x4c8628][_0x322ecc],'exitAt':null},'defaults':{'channel':_0x4c8628,'membername':_0x1432ec[_0x898a('0x33')]['name'],'interface':_[_0x898a('0x12')](_0x1432ec[_0x898a('0x33')]['interface'])?util[_0x898a('0x3b')](_0x898a('0x3c'),_0x1432ec['user'][_0x898a('0x10')]):_0x1432ec['user'][_0x898a('0x3d')],'type':_0x898a('0x37'),'enterAt':moment()[_0x898a('0x3b')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x898a('0x3e'),'internal':_0x1432ec[_0x898a('0x33')][_0x898a('0x3f')],'uniqueid':_0x1432ec[_0x898a('0x22')]['interaction'][_0x4c8628][_0x322ecc]}});}}}}return respondWithRpcPromise(_0x898a('0x40'),{'id':_0x1432ec['params']['id'],'capacity':_0x1432ec[_0x898a('0x22')][_0x898a('0x41')]},routingClient)[_0x898a('0xa')](respondWithResult(_0x3292c2,null))['catch'](handleError(_0x3292c2,null));};exports[_0x898a('0x42')]=function(_0x3c4db0,_0x195ac2){return respondWithRpcPromise('Telephones',_0x3c4db0['query'])[_0x898a('0xa')](respondWithResult(_0x195ac2,null))[_0x898a('0x1c')](handleError(_0x195ac2,null));};exports[_0x898a('0x43')]=function(_0x295f1e,_0x28b8c9){return respondWithRpcPromise(_0x898a('0x44'),_0x295f1e[_0x898a('0x17')])[_0x898a('0xa')](respondWithResult(_0x28b8c9,null))[_0x898a('0x1c')](handleError(_0x28b8c9,null));};exports[_0x898a('0x45')]=function(_0x2382a9,_0x5e9329){return respondWithRpcPromise(_0x898a('0x46'),_0x2382a9[_0x898a('0x17')])['then'](respondWithResult(_0x5e9329,null))[_0x898a('0x1c')](handleError(_0x5e9329,null));};exports['chatQueues']=function(_0x54c44b,_0x15f11e){return respondWithRpcPromise(_0x898a('0x47'),_0x54c44b[_0x898a('0x17')],routingClient)['then'](respondWithResult(_0x15f11e,null))['catch'](handleError(_0x15f11e,null));};exports[_0x898a('0x48')]=function(_0x1f5e4b,_0x515725){return respondWithRpcPromise(_0x898a('0x47'),_0x1f5e4b[_0x898a('0x17')],routingClient)['then'](findById(_0x1f5e4b[_0x898a('0x1b')]['id']))[_0x898a('0xa')](respondWithResult(_0x515725,null))[_0x898a('0x1c')](handleError(_0x515725,null));};exports['mailQueues']=function(_0xf29714,_0x2ef2f1){return respondWithRpcPromise(_0x898a('0x49'),_0xf29714[_0x898a('0x17')],routingClient)[_0x898a('0xa')](respondWithResult(_0x2ef2f1,null))[_0x898a('0x1c')](handleError(_0x2ef2f1,null));};exports['showMailQueues']=function(_0x22a08a,_0x4df5f0){return respondWithRpcPromise(_0x898a('0x49'),_0x22a08a[_0x898a('0x17')],routingClient)[_0x898a('0xa')](findById(_0x22a08a[_0x898a('0x1b')]['id']))[_0x898a('0xa')](respondWithResult(_0x4df5f0,null))[_0x898a('0x1c')](handleError(_0x4df5f0,null));};exports[_0x898a('0x4a')]=function(_0x75ff57,_0x3c761c){return respondWithRpcPromise('MailAccounts',_0x75ff57[_0x898a('0x17')],mailClient)[_0x898a('0xa')](respondWithResult(_0x3c761c,null))[_0x898a('0x1c')](handleError(_0x3c761c,null));};exports[_0x898a('0x4b')]=function(_0x219976,_0x2a1345){return respondWithRpcPromise(_0x898a('0x4c'),_0x219976[_0x898a('0x17')],routingClient)[_0x898a('0xa')](respondWithResult(_0x2a1345,null))[_0x898a('0x1c')](handleError(_0x2a1345,null));};exports[_0x898a('0x4d')]=function(_0x217dda,_0x3331c0){return respondWithRpcPromise(_0x898a('0x4c'),_0x217dda[_0x898a('0x17')],routingClient)['then'](findById(_0x217dda[_0x898a('0x1b')]['id']))[_0x898a('0xa')](respondWithResult(_0x3331c0,null))['catch'](handleError(_0x3331c0,null));};exports[_0x898a('0x4e')]=function(_0x4583a1,_0x5f0944){return respondWithRpcPromise(_0x898a('0x4f'),_0x4583a1[_0x898a('0x17')],routingClient)[_0x898a('0xa')](respondWithResult(_0x5f0944,null))[_0x898a('0x1c')](handleError(_0x5f0944,null));};exports['showSmsQueues']=function(_0xdc0cc4,_0x11def5){return respondWithRpcPromise(_0x898a('0x4f'),_0xdc0cc4[_0x898a('0x17')],routingClient)['then'](findById(_0xdc0cc4[_0x898a('0x1b')]['id']))[_0x898a('0xa')](respondWithResult(_0x11def5,null))['catch'](handleError(_0x11def5,null));};exports[_0x898a('0x50')]=function(_0x3c0bf6,_0x5b7019){return respondWithRpcPromise(_0x898a('0x51'),_0x3c0bf6['query'],routingClient)[_0x898a('0xa')](respondWithResult(_0x5b7019,null))['catch'](handleError(_0x5b7019,null));};exports['showWhatsappQueues']=function(_0x5ed35e,_0xfdd6d8){return respondWithRpcPromise(_0x898a('0x51'),_0x5ed35e[_0x898a('0x17')],routingClient)[_0x898a('0xa')](findById(_0x5ed35e['params']['id']))['then'](respondWithResult(_0xfdd6d8,null))[_0x898a('0x1c')](handleError(_0xfdd6d8,null));};exports[_0x898a('0x52')]=function(_0x1c2661,_0x5dc44e){return respondWithRpcPromise(_0x898a('0x53'),_0x1c2661[_0x898a('0x17')],routingClient)[_0x898a('0xa')](respondWithResult(_0x5dc44e,null))[_0x898a('0x1c')](handleError(_0x5dc44e,null));};exports['showFaxQueues']=function(_0xaac6d4,_0x43bf93){return respondWithRpcPromise('FaxQueues',_0xaac6d4[_0x898a('0x17')],routingClient)[_0x898a('0xa')](findById(_0xaac6d4[_0x898a('0x1b')]['id']))[_0x898a('0xa')](respondWithResult(_0x43bf93,null))[_0x898a('0x1c')](handleError(_0x43bf93,null));};exports[_0x898a('0x54')]=function(_0x3bcc3d,_0x2dc61c){return respondWithRpcPromise(_0x898a('0x55'),_0x3bcc3d[_0x898a('0x17')])[_0x898a('0xa')](respondWithResult(_0x2dc61c,null))[_0x898a('0x1c')](handleError(_0x2dc61c,null));};exports[_0x898a('0x56')]=function(_0x4a7705,_0x2d9a9c){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x4a7705[_0x898a('0x17')],routingClient)[_0x898a('0xa')](respondWithResult(_0x2d9a9c,null))[_0x898a('0x1c')](handleError(_0x2d9a9c,null));};exports['mailQueuesWaitingInteractions']=function(_0x31102d,_0x3f0d9f){return respondWithRpcPromise(_0x898a('0x57'),_0x31102d[_0x898a('0x17')],routingClient)[_0x898a('0xa')](respondWithResult(_0x3f0d9f,null))['catch'](handleError(_0x3f0d9f,null));};exports[_0x898a('0x58')]=function(_0x352ebb,_0x37b1d0){return respondWithRpcPromise(_0x898a('0x59'),_0x352ebb[_0x898a('0x17')],routingClient)['then'](respondWithResult(_0x37b1d0,null))[_0x898a('0x1c')](handleError(_0x37b1d0,null));};exports[_0x898a('0x5a')]=function(_0x474029,_0x37d205){return respondWithRpcPromise(_0x898a('0x59'),_0x474029[_0x898a('0x17')],routingClient)[_0x898a('0xa')](function(_0x1b0c09){if(_0x474029['query'][_0x898a('0x5b')]!==undefined){var _0x4607e1=_(_0x1b0c09['rows'])[_0x898a('0x5c')]([_0x474029['query'][_0x898a('0x5b')],_0x474029['params']['id']])[_0x898a('0x5d')](_0x898a('0x5e'))[_0x898a('0x5f')]()[_0x898a('0x60')]();return _0x1b0c09[_0x898a('0x13')][_0x898a('0x5c')](function(_0x170267){return _0x4607e1[_0x898a('0x61')](_0x170267[_0x898a('0x5e')])>-0x1;});}else{return _0x1b0c09['rows'][_0x898a('0x5c')](function(_0xd627d0){return _0xd627d0[_0x898a('0x5e')]===parseInt(_0x474029[_0x898a('0x1b')]['id']);});}})[_0x898a('0xa')](respondWithResult(_0x37d205,null))[_0x898a('0x1c')](handleError(_0x37d205,null));};exports[_0x898a('0x62')]=function(_0x4bcf85,_0x380f8c){return respondWithRpcPromise(_0x898a('0x63'),_0x4bcf85['query'],routingClient)['then'](respondWithResult(_0x380f8c,null))[_0x898a('0x1c')](handleError(_0x380f8c,null));};exports[_0x898a('0x64')]=function(_0x48e9c2,_0x5710a0){return respondWithRpcPromise(_0x898a('0x65'),_0x48e9c2['query'],routingClient)[_0x898a('0xa')](respondWithResult(_0x5710a0,null))[_0x898a('0x1c')](handleError(_0x5710a0,null));};exports['faxQueuesWaitingInteractions']=function(_0x3f6815,_0x1c782e){return respondWithRpcPromise(_0x898a('0x66'),_0x3f6815[_0x898a('0x17')],routingClient)[_0x898a('0xa')](respondWithResult(_0x1c782e,null))[_0x898a('0x1c')](handleError(_0x1c782e,null));};exports[_0x898a('0x67')]=function(_0x49f8ac){return function(_0x3237e8,_0x1efe1e){var _0x37ee4d,_0x50d978;var _0x27560f=_[_0x898a('0x68')](_0x49f8ac);var _0x5c6247=_0x49f8ac===_0x898a('0x69')?'Website':'Account';return db[_0x27560f+'Queue'][_0x898a('0x6a')]({'raw':!![],'where':{'id':_0x3237e8[_0x898a('0x1b')]['id']}})[_0x898a('0xa')](function(_0x2079d0){if(_[_0x898a('0x12')](_0x2079d0)){throw new Error(_0x27560f+_0x898a('0x6b'));}_0x37ee4d=_0x2079d0;return db[_0x27560f+_0x898a('0x6c')]['findOne']({'where':{'id':_0x3237e8[_0x898a('0x22')]['messageId']},'include':[{'model':db[_0x27560f+_0x898a('0x6d')],'as':_0x898a('0x6d')},{'model':db[_0x27560f+_0x5c6247],'as':'Account'}]});})[_0x898a('0xa')](function(_0x2269fb){if(_[_0x898a('0x12')](_0x2269fb)){throw new Error(_0x27560f+_0x898a('0x6e'));}_0x50d978=_0x2269fb;return _0x2269fb[_0x898a('0x6f')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x5847cb={'uniqueid':_0x49f8ac+'.'+_0x50d978['id']+'.'+_0x50d978['Interaction']['id'],'FromUserId':_0x3237e8[_0x898a('0x33')]['id'],'type':_0x898a('0x70')};_0x5847cb[_0x27560f+_0x898a('0x71')]=_0x50d978['id'];_0x5847cb[_0x27560f+'InteractionId']=_0x50d978[_0x898a('0x6d')]['id'];_0x5847cb['From'+_0x27560f+_0x5c6247+'Id']=_0x50d978['Account']['id'];_0x5847cb['To'+_0x27560f+_0x898a('0x72')]=_0x37ee4d['id'];return db[_0x27560f+_0x898a('0x73')][_0x898a('0x74')](_0x5847cb);})[_0x898a('0xa')](function(){return respondWithRpcPromise(_0x898a('0x75'),{'channel':_0x49f8ac,'interaction':_0x50d978[_0x898a('0x6d')],'message':_0x50d978,'account':_0x50d978[_0x898a('0x76')],'applications':[{'id':0x0,'priority':0x1,'app':_0x898a('0x70'),'appdata':_0x37ee4d[_0x898a('0x10')]+','+(_0x50d978[_0x898a('0x76')][_0x898a('0x77')]||0x12c),'interval':_0x898a('0x78')}]},routingClient);})[_0x898a('0xa')](respondWithResult(_0x1efe1e,null))[_0x898a('0x1c')](handleError(_0x1efe1e,null));};};exports[_0x898a('0x79')]=function(_0x3d9634,_0x54c440){var _0x435689,_0x3eaf3e;if(_[_0x898a('0x12')](_0x3d9634[_0x898a('0x22')][_0x898a('0x7a')])){throw new Error(_0x898a('0x7b'));}var _0xd45b78=_0x3d9634[_0x898a('0x22')][_0x898a('0x7a')];var _0x427eff=_[_0x898a('0x68')](_0xd45b78);var _0x381071=_0xd45b78==='chat'?_0x898a('0x7c'):'Account';return db[_0x898a('0x7d')][_0x898a('0x6a')]({'raw':!![],'where':{'id':_0x3d9634[_0x898a('0x1b')]['id'],'role':'agent'}})[_0x898a('0xa')](function(_0x223775){if(_['isNil'](_0x223775)){throw new Error(_0x898a('0x7e'));}_0x435689=_0x223775;return db[_0x427eff+_0x898a('0x6c')][_0x898a('0x6a')]({'where':{'id':_0x3d9634[_0x898a('0x22')][_0x898a('0x7f')]},'include':[{'model':db[_0x427eff+_0x898a('0x6d')],'as':'Interaction'},{'model':db[_0x427eff+_0x381071],'as':'Account'}]});})[_0x898a('0xa')](function(_0x4b7334){if(_[_0x898a('0x12')](_0x4b7334)){throw new Error(_0x427eff+_0x898a('0x6e'));}_0x3eaf3e=_0x4b7334;return _0x4b7334[_0x898a('0x6f')]({'read':0x0,'readAt':null,'UserId':null});})[_0x898a('0xa')](function(){var _0x13b3f9={'uniqueid':_0xd45b78+'.'+_0x3eaf3e['id']+'.'+_0x3eaf3e[_0x898a('0x6d')]['id'],'FromUserId':_0x3d9634['user']['id'],'type':'queue','ToUserId':_0x435689['id']};_0x13b3f9[_0x427eff+_0x898a('0x71')]=_0x3eaf3e['id'];_0x13b3f9[_0x427eff+'InteractionId']=_0x3eaf3e[_0x898a('0x6d')]['id'];_0x13b3f9[_0x898a('0x80')+_0x427eff+_0x381071+'Id']=_0x3eaf3e['Account']['id'];return db[_0x427eff+_0x898a('0x73')]['create'](_0x13b3f9);})[_0x898a('0xa')](function(){return respondWithRpcPromise(_0x898a('0x75'),{'channel':_0xd45b78,'interaction':_0x3eaf3e[_0x898a('0x6d')],'message':_0x3eaf3e,'account':_0x3eaf3e['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x435689['name']+','+(_0x3eaf3e[_0x898a('0x76')][_0x898a('0x81')]||0x12c),'interval':_0x898a('0x78')}]},routingClient);})[_0x898a('0xa')](respondWithResult(_0x54c440,null))[_0x898a('0x1c')](handleError(_0x54c440,null));};
\ No newline at end of file
index 365d833..a6e8e6e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c9b=['run','create','put','destroy','multer','path','connect-timeout','express','Router','./schedule.controller','get','index','/:id','isAuthenticated','/:id/run'];(function(_0x4cdf42,_0x480f99){var _0x2216ac=function(_0x4ea36c){while(--_0x4ea36c){_0x4cdf42['push'](_0x4cdf42['shift']());}};_0x2216ac(++_0x480f99);}(_0x6c9b,0xe5));var _0xb6c9=function(_0x528f23,_0x213659){_0x528f23=_0x528f23-0x0;var _0x556acd=_0x6c9b[_0x528f23];return _0x556acd;};'use strict';var multer=require(_0xb6c9('0x0'));var util=require('util');var path=require(_0xb6c9('0x1'));var timeout=require(_0xb6c9('0x2'));var express=require(_0xb6c9('0x3'));var router=express[_0xb6c9('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb6c9('0x5'));router[_0xb6c9('0x6')]('/',auth['isAuthenticated'](),controller[_0xb6c9('0x7')]);router['get'](_0xb6c9('0x8'),auth[_0xb6c9('0x9')](),controller['show']);router[_0xb6c9('0x6')](_0xb6c9('0xa'),auth[_0xb6c9('0x9')](),controller[_0xb6c9('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb6c9('0xc')]);router[_0xb6c9('0xd')](_0xb6c9('0x8'),auth[_0xb6c9('0x9')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xb6c9('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x568c=['../../components/interaction/service','../../config/environment','./schedule.controller','index','/:id','isAuthenticated','get','run','post','create','put','update','delete','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x568c,0xf7));var _0xc568=function(_0x310fc1,_0x4360ff){_0x310fc1=_0x310fc1-0x0;var _0x3cbbdb=_0x568c[_0x310fc1];return _0x3cbbdb;};'use strict';var multer=require('multer');var util=require(_0xc568('0x0'));var path=require('path');var timeout=require(_0xc568('0x1'));var express=require(_0xc568('0x2'));var router=express[_0xc568('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc568('0x4'));var interaction=require(_0xc568('0x5'));var config=require(_0xc568('0x6'));var controller=require(_0xc568('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xc568('0x8')]);router['get'](_0xc568('0x9'),auth[_0xc568('0xa')](),controller['show']);router[_0xc568('0xb')]('/:id/run',auth[_0xc568('0xa')](),controller[_0xc568('0xc')]);router[_0xc568('0xd')]('/',auth[_0xc568('0xa')](),controller[_0xc568('0xe')]);router[_0xc568('0xf')](_0xc568('0x9'),auth[_0xc568('0xa')](),controller[_0xc568('0x10')]);router[_0xc568('0x11')](_0xc568('0x9'),auth[_0xc568('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 6a0d2b2..dd0ce47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f40=['minutes','ENUM','csv','pdf','xlsx','default','custom','TEXT','sequelize','STRING','BOOLEAN','DATE','INTEGER','years','quarters','weeks','days','hours'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x2f40,0x1a6));var _0x02f4=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x2f40[_0x134c2e];return _0x2825db;};'use strict';var Sequelize=require(_0x02f4('0x0'));module['exports']={'name':{'type':Sequelize[_0x02f4('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x02f4('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x02f4('0x1')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x02f4('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x02f4('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x02f4('0x5'),_0x02f4('0x6'),'months',_0x02f4('0x7'),_0x02f4('0x8'),_0x02f4('0x9'),_0x02f4('0xa')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0x02f4('0xb')](_0x02f4('0xc'),_0x02f4('0xd'),_0x02f4('0xe')),'allowNull':![],'defaultValue':_0x02f4('0xc')},'type':{'type':Sequelize[_0x02f4('0xb')]('custom',_0x02f4('0xf')),'allowNull':![],'defaultValue':_0x02f4('0x10')},'sendMail':{'type':Sequelize[_0x02f4('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x02f4('0x1')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x02f4('0x11')]},'sendIfEmpty':{'type':Sequelize[_0x02f4('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xbdff=['custom','BOOLEAN','TEXT','sequelize','STRING','DATE','ENUM','years','quarters','hours','minutes','csv','pdf'];(function(_0x42314f,_0x212202){var _0x663c41=function(_0xbbf362){while(--_0xbbf362){_0x42314f['push'](_0x42314f['shift']());}};_0x663c41(++_0x212202);}(_0xbdff,0x114));var _0xfbdf=function(_0x8acd97,_0x4233be){_0x8acd97=_0x8acd97-0x0;var _0x50290c=_0xbdff[_0x8acd97];return _0x50290c;};'use strict';var Sequelize=require(_0xfbdf('0x0'));module['exports']={'name':{'type':Sequelize[_0xfbdf('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xfbdf('0x1')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0xfbdf('0x2')],'allowNull':![]},'endAt':{'type':Sequelize[_0xfbdf('0x2')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xfbdf('0x3')](_0xfbdf('0x4'),_0xfbdf('0x5'),'months','weeks','days',_0xfbdf('0x6'),_0xfbdf('0x7')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize['ENUM'](_0xfbdf('0x8'),_0xfbdf('0x9'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0xfbdf('0x3')](_0xfbdf('0xa'),'default'),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0xfbdf('0xb')],'defaultValue':![]},'email':{'type':Sequelize[_0xfbdf('0x1')]},'cc':{'type':Sequelize[_0xfbdf('0xc')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0xfbdf('0xb')],'defaultValue':!![]}};
\ No newline at end of file
index 5749582..4e41f99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x293a=['attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','length','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','../../config/schedule','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','then','destroy','Scheduler','end','stack','name','send','index','map','Schedule','fieldName','type','key','model','query','filters','intersection'];(function(_0x1252d9,_0xb59816){var _0x76c018=function(_0x52e72c){while(--_0x52e72c){_0x1252d9['push'](_0x1252d9['shift']());}};_0x76c018(++_0xb59816);}(_0x293a,0xc4));var _0xa293=function(_0x135448,_0x4ca19f){_0x135448=_0x135448-0x0;var _0x28389e=_0x293a[_0x135448];return _0x28389e;};'use strict';var emlformat=require(_0xa293('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa293('0x1'));var jsonpatch=require(_0xa293('0x2'));var rp=require(_0xa293('0x3'));var moment=require('moment');var BPromise=require(_0xa293('0x4'));var Mustache=require(_0xa293('0x5'));var util=require('util');var path=require(_0xa293('0x6'));var sox=require(_0xa293('0x7'));var csv=require(_0xa293('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa293('0x9'));var _=require(_0xa293('0xa'));var squel=require(_0xa293('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa293('0xc'));var toCsv=require(_0xa293('0x8'));var querystring=require(_0xa293('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa293('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa293('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0xa293('0x10'));var config=require(_0xa293('0x11'));var licenseUtil=require(_0xa293('0x12'));var db=require(_0xa293('0x13'))['db'];function respondWithStatusCode(_0x3670fd,_0x1ed475){_0x1ed475=_0x1ed475||0xcc;return function(_0x219bcd){if(_0x219bcd){return _0x3670fd[_0xa293('0x14')](_0x1ed475);}return _0x3670fd['status'](_0x1ed475)['end']();};}function respondWithResult(_0x4fe35c,_0x1d95ab){_0x1d95ab=_0x1d95ab||0xc8;return function(_0x38ac47){if(_0x38ac47){return _0x4fe35c[_0xa293('0x15')](_0x1d95ab)[_0xa293('0x16')](_0x38ac47);}};}function respondWithFilteredResult(_0x5048fb,_0x409067){return function(_0x56e7d8){if(_0x56e7d8){var _0x60b7f2=typeof _0x409067[_0xa293('0x17')]===_0xa293('0x18')&&typeof _0x409067[_0xa293('0x19')]===_0xa293('0x18');var _0x3ebf18=_0x56e7d8['count'];var _0x71960f=_0x60b7f2?0x0:_0x409067['offset'];var _0x4bbe7d=_0x60b7f2?_0x56e7d8[_0xa293('0x1a')]:_0x409067[_0xa293('0x17')]+_0x409067[_0xa293('0x19')];var _0x40c1f1;if(_0x4bbe7d>=_0x3ebf18){_0x4bbe7d=_0x3ebf18;_0x40c1f1=0xc8;}else{_0x40c1f1=0xce;}_0x5048fb[_0xa293('0x15')](_0x40c1f1);return _0x5048fb[_0xa293('0x1b')]('Content-Range',_0x71960f+'-'+_0x4bbe7d+'/'+_0x3ebf18)[_0xa293('0x16')](_0x56e7d8);}return null;};}function patchUpdates(_0x497662){return function(_0x1f0161){try{jsonpatch[_0xa293('0x1c')](_0x1f0161,_0x497662,!![]);}catch(_0x5784b8){return BPromise[_0xa293('0x1d')](_0x5784b8);}return _0x1f0161['save']();};}function saveUpdates(_0x58998c,_0x1ae6c5){return function(_0x1794df){if(_0x1794df){return _0x1794df['update'](_0x58998c)[_0xa293('0x1e')](function(_0x1f6329){return _0x1f6329;});}return null;};}function removeEntity(_0xd709fb,_0x1a0982){return function(_0x593313){if(_0x593313){return _0x593313[_0xa293('0x1f')]()[_0xa293('0x1e')](function(){var _0x31875b=_0x593313['get']({'plain':!![]});var _0x12751a=_0xa293('0x20');return db['UserProfileResource'][_0xa293('0x1f')]({'where':{'type':_0x12751a,'resourceId':_0x31875b['id']}})[_0xa293('0x1e')](function(){return _0x593313;});})['then'](function(){_0xd709fb['status'](0xcc)[_0xa293('0x21')]();});}};}function handleEntityNotFound(_0x15d5e0,_0x55fd8e){return function(_0x3a8370){if(!_0x3a8370){_0x15d5e0[_0xa293('0x14')](0x194);}return _0x3a8370;};}function handleError(_0xa7c3a7,_0x7587ab){_0x7587ab=_0x7587ab||0x1f4;return function(_0x5b7bfd){logger['error'](_0x5b7bfd[_0xa293('0x22')]);if(_0x5b7bfd[_0xa293('0x23')]){delete _0x5b7bfd[_0xa293('0x23')];}_0xa7c3a7[_0xa293('0x15')](_0x7587ab)[_0xa293('0x24')](_0x5b7bfd);};}exports[_0xa293('0x25')]=function(_0x3a5fca,_0x40ff4f){var _0x19002a={},_0x198d9b={},_0x557540={'count':0x0,'rows':[]};var _0xcb002=_[_0xa293('0x26')](db[_0xa293('0x27')]['rawAttributes'],function(_0x564362){return{'name':_0x564362[_0xa293('0x28')],'type':_0x564362[_0xa293('0x29')][_0xa293('0x2a')]};});_0x198d9b[_0xa293('0x2b')]=_[_0xa293('0x26')](_0xcb002,_0xa293('0x23'));_0x198d9b[_0xa293('0x2c')]=_['keys'](_0x3a5fca[_0xa293('0x2c')]);_0x198d9b[_0xa293('0x2d')]=_[_0xa293('0x2e')](_0x198d9b['model'],_0x198d9b[_0xa293('0x2c')]);_0x19002a[_0xa293('0x2f')]=_['intersection'](_0x198d9b[_0xa293('0x2b')],qs['fields'](_0x3a5fca[_0xa293('0x2c')][_0xa293('0x30')]));_0x19002a[_0xa293('0x2f')]=_0x19002a[_0xa293('0x2f')]['length']?_0x19002a[_0xa293('0x2f')]:_0x198d9b['model'];if(!_0x3a5fca[_0xa293('0x2c')][_0xa293('0x31')](_0xa293('0x32'))){_0x19002a[_0xa293('0x19')]=qs['limit'](_0x3a5fca[_0xa293('0x2c')][_0xa293('0x19')]);_0x19002a[_0xa293('0x17')]=qs[_0xa293('0x17')](_0x3a5fca[_0xa293('0x2c')][_0xa293('0x17')]);}_0x19002a['order']=qs[_0xa293('0x33')](_0x3a5fca[_0xa293('0x2c')][_0xa293('0x33')]);_0x19002a['where']=qs[_0xa293('0x2d')](_[_0xa293('0x34')](_0x3a5fca['query'],_0x198d9b[_0xa293('0x2d')]),_0xcb002);if(_0x3a5fca['query'][_0xa293('0x35')]){_0x19002a[_0xa293('0x36')]=_[_0xa293('0x37')](_0x19002a[_0xa293('0x36')],{'$or':_[_0xa293('0x26')](_0xcb002,function(_0x3696bc){if(_0x3696bc['type']!==_0xa293('0x38')){var _0xf6a61d={};_0xf6a61d[_0x3696bc[_0xa293('0x23')]]={'$like':'%'+_0x3a5fca['query'][_0xa293('0x35')]+'%'};return _0xf6a61d;}})});}_0x19002a=_[_0xa293('0x37')]({},_0x19002a,_0x3a5fca[_0xa293('0x39')]);var _0x1bdfdf={'where':_0x19002a[_0xa293('0x36')]};return db[_0xa293('0x27')][_0xa293('0x1a')](_0x1bdfdf)[_0xa293('0x1e')](function(_0x279393){_0x557540[_0xa293('0x1a')]=_0x279393;if(_0x3a5fca[_0xa293('0x2c')][_0xa293('0x3a')]){_0x19002a[_0xa293('0x3b')]=[{'all':!![]}];}return db[_0xa293('0x27')][_0xa293('0x3c')](_0x19002a);})[_0xa293('0x1e')](function(_0x459afc){_0x557540[_0xa293('0x3d')]=_0x459afc;return _0x557540;})[_0xa293('0x1e')](respondWithFilteredResult(_0x40ff4f,_0x19002a))['catch'](handleError(_0x40ff4f,null));};exports[_0xa293('0x3e')]=function(_0xd184a9,_0x9edf55){var _0x17586b={'raw':![],'where':{'id':_0xd184a9[_0xa293('0x3f')]['id']}},_0xe24381={};_0xe24381[_0xa293('0x2b')]=_[_0xa293('0x40')](db['Schedule'][_0xa293('0x41')]);_0xe24381[_0xa293('0x2c')]=_[_0xa293('0x40')](_0xd184a9[_0xa293('0x2c')]);_0xe24381[_0xa293('0x2d')]=_[_0xa293('0x2e')](_0xe24381['model'],_0xe24381[_0xa293('0x2c')]);_0x17586b['attributes']=_['intersection'](_0xe24381[_0xa293('0x2b')],qs[_0xa293('0x30')](_0xd184a9[_0xa293('0x2c')][_0xa293('0x30')]));_0x17586b[_0xa293('0x2f')]=_0x17586b[_0xa293('0x2f')][_0xa293('0x42')]?_0x17586b[_0xa293('0x2f')]:_0xe24381[_0xa293('0x2b')];if(_0xd184a9['query'][_0xa293('0x3a')]){_0x17586b[_0xa293('0x3b')]=[{'all':!![]}];}_0x17586b=_['merge']({},_0x17586b,_0xd184a9[_0xa293('0x39')]);return db['Schedule']['find'](_0x17586b)['then'](handleEntityNotFound(_0x9edf55,null))[_0xa293('0x1e')](respondWithResult(_0x9edf55,null))[_0xa293('0x43')](handleError(_0x9edf55,null));};exports['create']=function(_0x3df8ca,_0x2ac9eb){return db[_0xa293('0x27')][_0xa293('0x44')](_0x3df8ca[_0xa293('0x45')],{})[_0xa293('0x1e')](function(_0x5dbaeb){var _0x8af61d=_0x3df8ca[_0xa293('0x46')][_0xa293('0x47')]({'plain':!![]});if(!_0x8af61d)throw new Error(_0xa293('0x48'));if(_0x8af61d[_0xa293('0x49')]===_0xa293('0x46')){var _0x5a9930=_0x5dbaeb[_0xa293('0x47')]({'plain':!![]});var _0x4a60ba='Scheduler';return db[_0xa293('0x4a')][_0xa293('0x4b')]({'where':{'name':_0x4a60ba,'userProfileId':_0x8af61d[_0xa293('0x4c')]},'raw':!![]})[_0xa293('0x1e')](function(_0x24f9ea){if(_0x24f9ea&&_0x24f9ea[_0xa293('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x5a9930[_0xa293('0x23')],'resourceId':_0x5a9930['id'],'type':_0x24f9ea['name'],'sectionId':_0x24f9ea['id']},{})[_0xa293('0x1e')](function(){return _0x5dbaeb;});}else{return _0x5dbaeb;}})[_0xa293('0x43')](function(_0x436389){logger[_0xa293('0x4e')](_0xa293('0x4f'),_0x436389);throw _0x436389;});}return _0x5dbaeb;})[_0xa293('0x1e')](respondWithResult(_0x2ac9eb,0xc9))[_0xa293('0x43')](handleError(_0x2ac9eb,null));};exports['update']=function(_0x54ba2b,_0x130b50){if(_0x54ba2b[_0xa293('0x45')]['id']){delete _0x54ba2b[_0xa293('0x45')]['id'];}return db[_0xa293('0x27')][_0xa293('0x4b')]({'where':{'id':_0x54ba2b[_0xa293('0x3f')]['id']}})[_0xa293('0x1e')](handleEntityNotFound(_0x130b50,null))['then'](saveUpdates(_0x54ba2b[_0xa293('0x45')],null))[_0xa293('0x1e')](respondWithResult(_0x130b50,null))['catch'](handleError(_0x130b50,null));};exports[_0xa293('0x1f')]=function(_0x21c5b3,_0x5e094d){return db['Schedule'][_0xa293('0x4b')]({'where':{'id':_0x21c5b3['params']['id']}})[_0xa293('0x1e')](handleEntityNotFound(_0x5e094d,null))[_0xa293('0x1e')](removeEntity(_0x5e094d,null))['catch'](handleError(_0x5e094d,null));};exports['run']=function(_0x2f2d81,_0x436a9b,_0x548ac1){var _0x456eb2=require(_0xa293('0x50'));return db[_0xa293('0x27')][_0xa293('0x4b')]({'where':{'id':_0x2f2d81[_0xa293('0x3f')]['id']},'raw':!![]})[_0xa293('0x1e')](handleEntityNotFound(_0x436a9b,null))[_0xa293('0x1e')](function(){_0x456eb2['run'](_0x2f2d81[_0xa293('0x3f')]['id']);})[_0xa293('0x1e')](respondWithStatusCode(_0x436a9b,null))[_0xa293('0x43')](handleError(_0x436a9b,null));};
\ No newline at end of file
+var _0x97f8=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','apply','reject','save','update','then','get','destroy','error','stack','name','send','map','Schedule','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','rawAttributes','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Scheduler','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','run','../../config/schedule','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x1ee739,_0x29ae9e){var _0xee5173=function(_0x9078bc){while(--_0x9078bc){_0x1ee739['push'](_0x1ee739['shift']());}};_0xee5173(++_0x29ae9e);}(_0x97f8,0x153));var _0x897f=function(_0x5b0c71,_0x5e8546){_0x5b0c71=_0x5b0c71-0x0;var _0x1409e7=_0x97f8[_0x5b0c71];return _0x1409e7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x897f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x897f('0x1'));var rp=require('request-promise');var moment=require(_0x897f('0x2'));var BPromise=require(_0x897f('0x3'));var Mustache=require(_0x897f('0x4'));var util=require(_0x897f('0x5'));var path=require(_0x897f('0x6'));var sox=require(_0x897f('0x7'));var csv=require(_0x897f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x897f('0x9'));var _=require('lodash');var squel=require(_0x897f('0xa'));var crypto=require(_0x897f('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x897f('0x8'));var querystring=require(_0x897f('0xc'));var Papa=require(_0x897f('0xd'));var Redis=require(_0x897f('0xe'));var authService=require(_0x897f('0xf'));var qs=require(_0x897f('0x10'));var as=require(_0x897f('0x11'));var hardwareService=require(_0x897f('0x12'));var logger=require(_0x897f('0x13'))(_0x897f('0x14'));var utils=require(_0x897f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x897f('0x16'));var db=require(_0x897f('0x17'))['db'];function respondWithStatusCode(_0xfb552,_0x3f20b6){_0x3f20b6=_0x3f20b6||0xcc;return function(_0x40bd65){if(_0x40bd65){return _0xfb552[_0x897f('0x18')](_0x3f20b6);}return _0xfb552[_0x897f('0x19')](_0x3f20b6)[_0x897f('0x1a')]();};}function respondWithResult(_0x2c409c,_0x548168){_0x548168=_0x548168||0xc8;return function(_0x46f977){if(_0x46f977){return _0x2c409c[_0x897f('0x19')](_0x548168)[_0x897f('0x1b')](_0x46f977);}};}function respondWithFilteredResult(_0x4d58d0,_0x2311ed){return function(_0x29b8b0){if(_0x29b8b0){var _0x133663=typeof _0x2311ed['offset']===_0x897f('0x1c')&&typeof _0x2311ed[_0x897f('0x1d')]===_0x897f('0x1c');var _0x37682e=_0x29b8b0['count'];var _0x3a7961=_0x133663?0x0:_0x2311ed[_0x897f('0x1e')];var _0x2bf9ae=_0x133663?_0x29b8b0[_0x897f('0x1f')]:_0x2311ed['offset']+_0x2311ed[_0x897f('0x1d')];var _0x35cc06;if(_0x2bf9ae>=_0x37682e){_0x2bf9ae=_0x37682e;_0x35cc06=0xc8;}else{_0x35cc06=0xce;}_0x4d58d0['status'](_0x35cc06);return _0x4d58d0[_0x897f('0x20')]('Content-Range',_0x3a7961+'-'+_0x2bf9ae+'/'+_0x37682e)[_0x897f('0x1b')](_0x29b8b0);}return null;};}function patchUpdates(_0x4492cd){return function(_0xf797cf){try{jsonpatch[_0x897f('0x21')](_0xf797cf,_0x4492cd,!![]);}catch(_0x1aa81e){return BPromise[_0x897f('0x22')](_0x1aa81e);}return _0xf797cf[_0x897f('0x23')]();};}function saveUpdates(_0x23d1bc,_0x4ca874){return function(_0x4b536d){if(_0x4b536d){return _0x4b536d[_0x897f('0x24')](_0x23d1bc)[_0x897f('0x25')](function(_0x34bed6){return _0x34bed6;});}return null;};}function removeEntity(_0x5de066,_0x4a90c9){return function(_0x3c208d){if(_0x3c208d){return _0x3c208d['destroy']()[_0x897f('0x25')](function(){var _0x4f0506=_0x3c208d[_0x897f('0x26')]({'plain':!![]});var _0x369910='Scheduler';return db['UserProfileResource'][_0x897f('0x27')]({'where':{'type':_0x369910,'resourceId':_0x4f0506['id']}})[_0x897f('0x25')](function(){return _0x3c208d;});})['then'](function(){_0x5de066['status'](0xcc)[_0x897f('0x1a')]();});}};}function handleEntityNotFound(_0x34458f,_0x320768){return function(_0x2bdb2d){if(!_0x2bdb2d){_0x34458f['sendStatus'](0x194);}return _0x2bdb2d;};}function handleError(_0x5e27b5,_0x51e283){_0x51e283=_0x51e283||0x1f4;return function(_0x37ed7b){logger[_0x897f('0x28')](_0x37ed7b[_0x897f('0x29')]);if(_0x37ed7b[_0x897f('0x2a')]){delete _0x37ed7b[_0x897f('0x2a')];}_0x5e27b5[_0x897f('0x19')](_0x51e283)[_0x897f('0x2b')](_0x37ed7b);};}exports['index']=function(_0x1199b8,_0x1ae547){var _0x52f0c8={},_0x1d86a7={},_0x5db7c5={'count':0x0,'rows':[]};var _0x1346ab=_[_0x897f('0x2c')](db[_0x897f('0x2d')]['rawAttributes'],function(_0x3f8e84){return{'name':_0x3f8e84[_0x897f('0x2e')],'type':_0x3f8e84[_0x897f('0x2f')][_0x897f('0x30')]};});_0x1d86a7[_0x897f('0x31')]=_[_0x897f('0x2c')](_0x1346ab,_0x897f('0x2a'));_0x1d86a7[_0x897f('0x32')]=_[_0x897f('0x33')](_0x1199b8['query']);_0x1d86a7['filters']=_[_0x897f('0x34')](_0x1d86a7[_0x897f('0x31')],_0x1d86a7['query']);_0x52f0c8[_0x897f('0x35')]=_[_0x897f('0x34')](_0x1d86a7[_0x897f('0x31')],qs[_0x897f('0x36')](_0x1199b8[_0x897f('0x32')][_0x897f('0x36')]));_0x52f0c8[_0x897f('0x35')]=_0x52f0c8[_0x897f('0x35')][_0x897f('0x37')]?_0x52f0c8[_0x897f('0x35')]:_0x1d86a7[_0x897f('0x31')];if(!_0x1199b8[_0x897f('0x32')][_0x897f('0x38')](_0x897f('0x39'))){_0x52f0c8[_0x897f('0x1d')]=qs['limit'](_0x1199b8['query'][_0x897f('0x1d')]);_0x52f0c8['offset']=qs[_0x897f('0x1e')](_0x1199b8['query'][_0x897f('0x1e')]);}_0x52f0c8[_0x897f('0x3a')]=qs['sort'](_0x1199b8[_0x897f('0x32')][_0x897f('0x3b')]);_0x52f0c8['where']=qs[_0x897f('0x3c')](_[_0x897f('0x3d')](_0x1199b8[_0x897f('0x32')],_0x1d86a7[_0x897f('0x3c')]),_0x1346ab);if(_0x1199b8['query']['filter']){_0x52f0c8[_0x897f('0x3e')]=_[_0x897f('0x3f')](_0x52f0c8[_0x897f('0x3e')],{'$or':_['map'](_0x1346ab,function(_0x1c7ddf){if(_0x1c7ddf[_0x897f('0x2f')]!==_0x897f('0x40')){var _0x18d5fc={};_0x18d5fc[_0x1c7ddf[_0x897f('0x2a')]]={'$like':'%'+_0x1199b8[_0x897f('0x32')][_0x897f('0x41')]+'%'};return _0x18d5fc;}})});}_0x52f0c8=_[_0x897f('0x3f')]({},_0x52f0c8,_0x1199b8['options']);var _0xb47026={'where':_0x52f0c8['where']};return db[_0x897f('0x2d')][_0x897f('0x1f')](_0xb47026)[_0x897f('0x25')](function(_0x520f07){_0x5db7c5[_0x897f('0x1f')]=_0x520f07;if(_0x1199b8['query'][_0x897f('0x42')]){_0x52f0c8['include']=[{'all':!![]}];}return db[_0x897f('0x2d')][_0x897f('0x43')](_0x52f0c8);})[_0x897f('0x25')](function(_0x2c3529){_0x5db7c5[_0x897f('0x44')]=_0x2c3529;return _0x5db7c5;})[_0x897f('0x25')](respondWithFilteredResult(_0x1ae547,_0x52f0c8))[_0x897f('0x45')](handleError(_0x1ae547,null));};exports[_0x897f('0x46')]=function(_0xd3ea23,_0x41647f){var _0x27eced={'raw':![],'where':{'id':_0xd3ea23[_0x897f('0x47')]['id']}},_0x2ac043={};_0x2ac043['model']=_['keys'](db[_0x897f('0x2d')][_0x897f('0x48')]);_0x2ac043[_0x897f('0x32')]=_['keys'](_0xd3ea23[_0x897f('0x32')]);_0x2ac043[_0x897f('0x3c')]=_[_0x897f('0x34')](_0x2ac043[_0x897f('0x31')],_0x2ac043['query']);_0x27eced[_0x897f('0x35')]=_[_0x897f('0x34')](_0x2ac043[_0x897f('0x31')],qs[_0x897f('0x36')](_0xd3ea23['query'][_0x897f('0x36')]));_0x27eced[_0x897f('0x35')]=_0x27eced[_0x897f('0x35')][_0x897f('0x37')]?_0x27eced[_0x897f('0x35')]:_0x2ac043['model'];if(_0xd3ea23[_0x897f('0x32')][_0x897f('0x42')]){_0x27eced[_0x897f('0x49')]=[{'all':!![]}];}_0x27eced=_[_0x897f('0x3f')]({},_0x27eced,_0xd3ea23[_0x897f('0x4a')]);return db[_0x897f('0x2d')][_0x897f('0x4b')](_0x27eced)[_0x897f('0x25')](handleEntityNotFound(_0x41647f,null))[_0x897f('0x25')](respondWithResult(_0x41647f,null))['catch'](handleError(_0x41647f,null));};exports['create']=function(_0x2631a1,_0x1125a2){return db[_0x897f('0x2d')][_0x897f('0x4c')](_0x2631a1['body'],{})[_0x897f('0x25')](function(_0x3ca6a3){var _0x4b9a18=_0x2631a1[_0x897f('0x4d')][_0x897f('0x26')]({'plain':!![]});if(!_0x4b9a18)throw new Error(_0x897f('0x4e'));if(_0x4b9a18[_0x897f('0x4f')]===_0x897f('0x4d')){var _0x31ce14=_0x3ca6a3[_0x897f('0x26')]({'plain':!![]});var _0x4c7031=_0x897f('0x50');return db[_0x897f('0x51')][_0x897f('0x4b')]({'where':{'name':_0x4c7031,'userProfileId':_0x4b9a18[_0x897f('0x52')]},'raw':!![]})[_0x897f('0x25')](function(_0x473b73){if(_0x473b73&&_0x473b73[_0x897f('0x53')]===0x0){return db[_0x897f('0x54')]['create']({'name':_0x31ce14[_0x897f('0x2a')],'resourceId':_0x31ce14['id'],'type':_0x473b73['name'],'sectionId':_0x473b73['id']},{})['then'](function(){return _0x3ca6a3;});}else{return _0x3ca6a3;}})[_0x897f('0x45')](function(_0x1c1be1){logger['error'](_0x897f('0x55'),_0x1c1be1);throw _0x1c1be1;});}return _0x3ca6a3;})['then'](respondWithResult(_0x1125a2,0xc9))[_0x897f('0x45')](handleError(_0x1125a2,null));};exports[_0x897f('0x24')]=function(_0x556a91,_0x4b1881){if(_0x556a91[_0x897f('0x56')]['id']){delete _0x556a91[_0x897f('0x56')]['id'];}return db[_0x897f('0x2d')][_0x897f('0x4b')]({'where':{'id':_0x556a91[_0x897f('0x47')]['id']}})[_0x897f('0x25')](handleEntityNotFound(_0x4b1881,null))['then'](saveUpdates(_0x556a91[_0x897f('0x56')],null))[_0x897f('0x25')](respondWithResult(_0x4b1881,null))[_0x897f('0x45')](handleError(_0x4b1881,null));};exports[_0x897f('0x27')]=function(_0x4144ad,_0x3a9932){return db[_0x897f('0x2d')]['find']({'where':{'id':_0x4144ad[_0x897f('0x47')]['id']}})[_0x897f('0x25')](handleEntityNotFound(_0x3a9932,null))[_0x897f('0x25')](removeEntity(_0x3a9932,null))[_0x897f('0x45')](handleError(_0x3a9932,null));};exports[_0x897f('0x57')]=function(_0x50c35f,_0x3ee569,_0x344a33){var _0x2cf89b=require(_0x897f('0x58'));return db[_0x897f('0x2d')]['find']({'where':{'id':_0x50c35f[_0x897f('0x47')]['id']},'raw':!![]})[_0x897f('0x25')](handleEntityNotFound(_0x3ee569,null))['then'](function(){_0x2cf89b[_0x897f('0x57')](_0x50c35f[_0x897f('0x47')]['id']);})[_0x897f('0x25')](respondWithStatusCode(_0x3ee569,null))[_0x897f('0x45')](handleError(_0x3ee569,null));};
\ No newline at end of file
index 03665c2..4b170b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c48=['./schedule.attributes','exports','define','Schedule','tools_schedules','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x1c5cdf,_0xaad24c){var _0x5f11ff=function(_0x100829){while(--_0x100829){_0x1c5cdf['push'](_0x1c5cdf['shift']());}};_0x5f11ff(++_0xaad24c);}(_0x9c48,0x10d));var _0x89c4=function(_0x237160,_0x1be8ec){_0x237160=_0x237160-0x0;var _0x1b2492=_0x9c48[_0x237160];return _0x1b2492;};'use strict';var _=require('lodash');var util=require(_0x89c4('0x0'));var logger=require(_0x89c4('0x1'))(_0x89c4('0x2'));var moment=require(_0x89c4('0x3'));var BPromise=require(_0x89c4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x89c4('0x5'));var rimraf=require('rimraf');var config=require(_0x89c4('0x6'));var attributes=require(_0x89c4('0x7'));module[_0x89c4('0x8')]=function(_0x5e6168,_0x2f85c6){return _0x5e6168[_0x89c4('0x9')](_0x89c4('0xa'),attributes,{'tableName':_0x89c4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5e42=['lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule'];(function(_0x226812,_0x26324d){var _0x5337a4=function(_0x3946b6){while(--_0x3946b6){_0x226812['push'](_0x226812['shift']());}};_0x5337a4(++_0x26324d);}(_0x5e42,0xb4));var _0x25e4=function(_0x3877c1,_0x238c29){_0x3877c1=_0x3877c1-0x0;var _0x59056a=_0x5e42[_0x3877c1];return _0x59056a;};'use strict';var _=require(_0x25e4('0x0'));var util=require(_0x25e4('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x25e4('0x2'));var BPromise=require(_0x25e4('0x3'));var rp=require(_0x25e4('0x4'));var fs=require('fs');var path=require(_0x25e4('0x5'));var rimraf=require(_0x25e4('0x6'));var config=require(_0x25e4('0x7'));var attributes=require(_0x25e4('0x8'));module[_0x25e4('0x9')]=function(_0x1ddf33,_0x1001df){return _0x1ddf33[_0x25e4('0xa')](_0x25e4('0xb'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d2739bf..03dcac6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x961a=['Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','Schedule,\x20%s,\x20%s'];(function(_0xaee6b0,_0x55f4b2){var _0x498324=function(_0x359d5c){while(--_0x359d5c){_0xaee6b0['push'](_0xaee6b0['shift']());}};_0x498324(++_0x55f4b2);}(_0x961a,0x183));var _0xa961=function(_0x4828c5,_0x1388d4){_0x4828c5=_0x4828c5-0x0;var _0x49ac52=_0x961a[_0x4828c5];return _0x49ac52;};'use strict';var _=require(_0xa961('0x0'));var util=require(_0xa961('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa961('0x2'));var fs=require('fs');var Redis=require(_0xa961('0x3'));var db=require(_0xa961('0x4'))['db'];var utils=require(_0xa961('0x5'));var logger=require('../../config/logger')(_0xa961('0x6'));var config=require(_0xa961('0x7'));var jayson=require(_0xa961('0x8'));var client=jayson[_0xa961('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb60fd2,_0x4d587e,_0x185f79){return new BPromise(function(_0x4c0fed,_0x56bcff){return client['request'](_0xb60fd2,_0x185f79)[_0xa961('0xa')](function(_0x6cf335){logger['info'](_0xa961('0xb'),_0x4d587e,'request\x20sent');logger['debug'](_0xa961('0xc'),_0x4d587e,'request\x20sent',JSON[_0xa961('0xd')](_0x6cf335));if(_0x6cf335[_0xa961('0xe')]){if(_0x6cf335[_0xa961('0xe')][_0xa961('0xf')]===0x1f4){logger[_0xa961('0xe')]('Schedule,\x20%s,\x20%s',_0x4d587e,_0x6cf335[_0xa961('0xe')][_0xa961('0x10')]);return _0x56bcff(_0x6cf335[_0xa961('0xe')][_0xa961('0x10')]);}logger['error']('Schedule,\x20%s,\x20%s',_0x4d587e,_0x6cf335[_0xa961('0xe')][_0xa961('0x10')]);return _0x4c0fed(_0x6cf335[_0xa961('0xe')][_0xa961('0x10')]);}else{logger[_0xa961('0x11')](_0xa961('0xb'),_0x4d587e,_0xa961('0x12'));_0x4c0fed(_0x6cf335[_0xa961('0x13')][_0xa961('0x10')]);}})[_0xa961('0x14')](function(_0xd47b9a){logger[_0xa961('0xe')](_0xa961('0xb'),_0x4d587e,_0xd47b9a);_0x56bcff(_0xd47b9a);});});}
\ No newline at end of file
+var _0x5615=['Schedule,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info'];(function(_0x504c5f,_0x4c9421){var _0x483c8e=function(_0x2a071e){while(--_0x2a071e){_0x504c5f['push'](_0x504c5f['shift']());}};_0x483c8e(++_0x4c9421);}(_0x5615,0x111));var _0x5561=function(_0x191d6d,_0x3db648){_0x191d6d=_0x191d6d-0x0;var _0x7e816b=_0x5615[_0x191d6d];return _0x7e816b;};'use strict';var _=require('lodash');var util=require(_0x5561('0x0'));var moment=require(_0x5561('0x1'));var BPromise=require(_0x5561('0x2'));var rs=require(_0x5561('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5561('0x4'))['db'];var utils=require(_0x5561('0x5'));var logger=require('../../config/logger')(_0x5561('0x6'));var config=require('../../config/environment');var jayson=require(_0x5561('0x7'));var client=jayson[_0x5561('0x8')][_0x5561('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3a91ca,_0x4c48b6,_0x470f95){return new BPromise(function(_0x55f5e7,_0x2984c9){return client[_0x5561('0xa')](_0x3a91ca,_0x470f95)['then'](function(_0x464443){logger[_0x5561('0xb')](_0x5561('0xc'),_0x4c48b6,'request\x20sent');logger['debug']('Schedule,\x20%s,\x20%s,\x20%s',_0x4c48b6,_0x5561('0xd'),JSON[_0x5561('0xe')](_0x464443));if(_0x464443['error']){if(_0x464443[_0x5561('0xf')][_0x5561('0x10')]===0x1f4){logger[_0x5561('0xf')](_0x5561('0xc'),_0x4c48b6,_0x464443['error']['message']);return _0x2984c9(_0x464443[_0x5561('0xf')]['message']);}logger[_0x5561('0xf')](_0x5561('0xc'),_0x4c48b6,_0x464443[_0x5561('0xf')][_0x5561('0x11')]);return _0x55f5e7(_0x464443[_0x5561('0xf')]['message']);}else{logger[_0x5561('0xb')](_0x5561('0xc'),_0x4c48b6,_0x5561('0xd'));_0x55f5e7(_0x464443['result'][_0x5561('0x11')]);}})[_0x5561('0x12')](function(_0x70fe9d){logger[_0x5561('0xf')](_0x5561('0xc'),_0x4c48b6,_0x70fe9d);_0x2984c9(_0x70fe9d);});});}
\ No newline at end of file
index c068cee..c7d5c40 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b79=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','update','delete','destroy'];(function(_0x43c8b8,_0x5e8934){var _0x413be3=function(_0x23969c){while(--_0x23969c){_0x43c8b8['push'](_0x43c8b8['shift']());}};_0x413be3(++_0x5e8934);}(_0x7b79,0x1b6));var _0x97b7=function(_0x30a1c4,_0x156223){_0x30a1c4=_0x30a1c4-0x0;var _0x555e13=_0x7b79[_0x30a1c4];return _0x555e13;};'use strict';var multer=require(_0x97b7('0x0'));var util=require(_0x97b7('0x1'));var path=require(_0x97b7('0x2'));var timeout=require('connect-timeout');var express=require(_0x97b7('0x3'));var router=express[_0x97b7('0x4')]();var fs_extra=require(_0x97b7('0x5'));var auth=require(_0x97b7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x97b7('0x7'));var controller=require(_0x97b7('0x8'));router[_0x97b7('0x9')]('/',auth[_0x97b7('0xa')](),controller[_0x97b7('0xb')]);router[_0x97b7('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x97b7('0xc'),auth[_0x97b7('0xa')](),controller[_0x97b7('0xd')]);router[_0x97b7('0x9')](_0x97b7('0xe'),auth['isAuthenticated'](),controller[_0x97b7('0xf')]);router[_0x97b7('0x10')]('/',auth['isAuthenticated'](),controller[_0x97b7('0x11')]);router[_0x97b7('0x12')]('/:id',auth[_0x97b7('0xa')](),controller[_0x97b7('0x13')]);router[_0x97b7('0x14')]('/:id',auth[_0x97b7('0xa')](),controller[_0x97b7('0x15')]);module[_0x97b7('0x16')]=router;
\ No newline at end of file
+var _0xa0cd=['index','describe','show','/:id/download','download','post','put','/:id','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./screenRecording.controller','get','isAuthenticated'];(function(_0x398d83,_0x3a589c){var _0x523d30=function(_0x5140df){while(--_0x5140df){_0x398d83['push'](_0x398d83['shift']());}};_0x523d30(++_0x3a589c);}(_0xa0cd,0x1d9));var _0xda0c=function(_0x115f82,_0x4ebe3){_0x115f82=_0x115f82-0x0;var _0x52cabb=_0xa0cd[_0x115f82];return _0x52cabb;};'use strict';var multer=require('multer');var util=require(_0xda0c('0x0'));var path=require(_0xda0c('0x1'));var timeout=require(_0xda0c('0x2'));var express=require(_0xda0c('0x3'));var router=express[_0xda0c('0x4')]();var fs_extra=require(_0xda0c('0x5'));var auth=require(_0xda0c('0x6'));var interaction=require(_0xda0c('0x7'));var config=require('../../config/environment');var controller=require(_0xda0c('0x8'));router[_0xda0c('0x9')]('/',auth[_0xda0c('0xa')](),controller[_0xda0c('0xb')]);router[_0xda0c('0x9')]('/describe',auth[_0xda0c('0xa')](),controller[_0xda0c('0xc')]);router[_0xda0c('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xda0c('0xd')]);router['get'](_0xda0c('0xe'),auth[_0xda0c('0xa')](),controller[_0xda0c('0xf')]);router[_0xda0c('0x10')]('/',auth[_0xda0c('0xa')](),controller['create']);router[_0xda0c('0x11')](_0xda0c('0x12'),auth[_0xda0c('0xa')](),controller[_0xda0c('0x13')]);router[_0xda0c('0x14')]('/:id',auth[_0xda0c('0xa')](),controller[_0xda0c('0x15')]);module['exports']=router;
\ No newline at end of file
index 9973abb..8de571b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b12=['setDataValue','INTEGER','subtract','closedAt','duration','DATE','startedAt','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','sequelize','moment','path','exports','getDataValue','value','STRING','replace'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0x5b12,0xa3));var _0x25b1=function(_0x3ba790,_0x1ebb6c){_0x3ba790=_0x3ba790-0x0;var _0x5632a1=_0x5b12[_0x3ba790];return _0x5632a1;};'use strict';var Sequelize=require(_0x25b1('0x0'));var moment=require(_0x25b1('0x1'));var path=require(_0x25b1('0x2'));var config=require('../../config/environment');module[_0x25b1('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x25b1('0x4')](_0x25b1('0x5'))?path['extname'](this[_0x25b1('0x4')]('value')):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x25b1('0x6')]},'value':{'type':Sequelize['STRING'],'set':function(_0x5bb95b){var _0x1f715d=_0x5bb95b[_0x25b1('0x7')](/\\/g,'/');this[_0x25b1('0x8')](_0x25b1('0x5'),_0x1f715d);}},'rating':{'type':Sequelize[_0x25b1('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x25b1('0x9')],'set':function(_0x3346ed){this[_0x25b1('0x8')]('startedAt',moment()[_0x25b1('0xa')](_0x3346ed,'ms'));this[_0x25b1('0x8')](_0x25b1('0xb'),moment());this[_0x25b1('0x8')](_0x25b1('0xc'),_0x3346ed);}},'startedAt':{'type':Sequelize[_0x25b1('0xd')],'get':function(){return moment(this[_0x25b1('0x4')](_0x25b1('0xe')))[_0x25b1('0xf')](_0x25b1('0x10'))[_0x25b1('0x11')]();}},'closedAt':{'type':Sequelize[_0x25b1('0xd')],'get':function(){return moment(this[_0x25b1('0x4')](_0x25b1('0xb')))[_0x25b1('0xf')](_0x25b1('0x10'))['toString']();}},'createdAt':{'type':Sequelize[_0x25b1('0xd')],'get':function(){return moment(this[_0x25b1('0x4')]('createdAt'))[_0x25b1('0xf')](_0x25b1('0x10'))[_0x25b1('0x11')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x25b1('0x12')))['format'](_0x25b1('0x10'))[_0x25b1('0x11')]();}}};
\ No newline at end of file
+var _0x8a87=['../../config/environment','VIRTUAL','getDataValue','value','STRING','replace','INTEGER','setDataValue','startedAt','subtract','closedAt','DATE','MM-DD-YYYY\x20HH:mm','toString','format','createdAt','updatedAt','sequelize'];(function(_0x4f1eec,_0x536335){var _0x5bc7ae=function(_0x4b3e8f){while(--_0x4b3e8f){_0x4f1eec['push'](_0x4f1eec['shift']());}};_0x5bc7ae(++_0x536335);}(_0x8a87,0x6b));var _0x78a8=function(_0x41cfd4,_0x1ed2cc){_0x41cfd4=_0x41cfd4-0x0;var _0x190f48=_0x8a87[_0x41cfd4];return _0x190f48;};'use strict';var Sequelize=require(_0x78a8('0x0'));var moment=require('moment');var path=require('path');var config=require(_0x78a8('0x1'));module['exports']={'format':{'type':Sequelize[_0x78a8('0x2')],'get':function(){return this[_0x78a8('0x3')](_0x78a8('0x4'))?path['extname'](this[_0x78a8('0x3')]('value')):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x78a8('0x5')]},'value':{'type':Sequelize[_0x78a8('0x5')],'set':function(_0x285f95){var _0x1d8888=_0x285f95[_0x78a8('0x6')](/\\/g,'/');this['setDataValue'](_0x78a8('0x4'),_0x1d8888);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x78a8('0x7')],'set':function(_0x48c013){this[_0x78a8('0x8')](_0x78a8('0x9'),moment()[_0x78a8('0xa')](_0x48c013,'ms'));this[_0x78a8('0x8')](_0x78a8('0xb'),moment());this['setDataValue']('duration',_0x48c013);}},'startedAt':{'type':Sequelize[_0x78a8('0xc')],'get':function(){return moment(this[_0x78a8('0x3')](_0x78a8('0x9')))['format'](_0x78a8('0xd'))[_0x78a8('0xe')]();}},'closedAt':{'type':Sequelize[_0x78a8('0xc')],'get':function(){return moment(this[_0x78a8('0x3')]('closedAt'))[_0x78a8('0xf')](_0x78a8('0xd'))[_0x78a8('0xe')]();}},'createdAt':{'type':Sequelize[_0x78a8('0xc')],'get':function(){return moment(this[_0x78a8('0x3')](_0x78a8('0x10')))['format']('MM-DD-YYYY\x20HH:mm')['toString']();}},'updatedAt':{'type':Sequelize[_0x78a8('0xc')],'get':function(){return moment(this[_0x78a8('0x3')](_0x78a8('0x11')))[_0x78a8('0xf')](_0x78a8('0xd'))['toString']();}}};
\ No newline at end of file
index f35e4e1..8ad2f55 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d17=['apply','then','error','name','index','map','rawAttributes','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ScreenRecording','count','includeAll','include','findAll','catch','show','find','create','body','update','duration','closedAt','value','params','describe','../../components/encryptor','uniqueid','join','root','%s.cypher','existsSync','decryptFile','secrets','recording','server/files/screen_recordings','Sequelize','ValidationError','filename','download','extname','unlink','Not\x20found','destroy','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','bluebird','mustache','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','limit','set','Content-Range'];(function(_0x1c0fa3,_0xb3b139){var _0x4ecdd3=function(_0x20dc8f){while(--_0x20dc8f){_0x1c0fa3['push'](_0x1c0fa3['shift']());}};_0x4ecdd3(++_0xb3b139);}(_0x2d17,0x17e));var _0x72d1=function(_0x5b0c63,_0x226eee){_0x5b0c63=_0x5b0c63-0x0;var _0x3946d9=_0x2d17[_0x5b0c63];return _0x3946d9;};'use strict';var emlformat=require(_0x72d1('0x0'));var rimraf=require(_0x72d1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x72d1('0x2'));var rp=require(_0x72d1('0x3'));var moment=require('moment');var BPromise=require(_0x72d1('0x4'));var Mustache=require(_0x72d1('0x5'));var util=require('util');var path=require(_0x72d1('0x6'));var sox=require('sox');var csv=require(_0x72d1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x72d1('0x8'));var _=require(_0x72d1('0x9'));var squel=require('squel');var crypto=require(_0x72d1('0xa'));var jsforce=require(_0x72d1('0xb'));var deskjs=require(_0x72d1('0xc'));var toCsv=require('to-csv');var querystring=require(_0x72d1('0xd'));var Papa=require(_0x72d1('0xe'));var Redis=require(_0x72d1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x72d1('0x10'));var as=require(_0x72d1('0x11'));var hardwareService=require(_0x72d1('0x12'));var logger=require(_0x72d1('0x13'))(_0x72d1('0x14'));var utils=require(_0x72d1('0x15'));var config=require(_0x72d1('0x16'));var licenseUtil=require(_0x72d1('0x17'));var db=require(_0x72d1('0x18'))['db'];function respondWithStatusCode(_0x2f5a78,_0x5ad4df){_0x5ad4df=_0x5ad4df||0xcc;return function(_0x3cd1ae){if(_0x3cd1ae){return _0x2f5a78[_0x72d1('0x19')](_0x5ad4df);}return _0x2f5a78[_0x72d1('0x1a')](_0x5ad4df)[_0x72d1('0x1b')]();};}function respondWithResult(_0x22ac6f,_0x685a27){_0x685a27=_0x685a27||0xc8;return function(_0x143718){if(_0x143718){return _0x22ac6f[_0x72d1('0x1a')](_0x685a27)[_0x72d1('0x1c')](_0x143718);}};}function respondWithFilteredResult(_0x3f190f,_0x21c85e){return function(_0x23a238){if(_0x23a238){var _0x8d458=typeof _0x21c85e['offset']===_0x72d1('0x1d')&&typeof _0x21c85e['limit']===_0x72d1('0x1d');var _0x2c9851=_0x23a238['count'];var _0x1061b7=_0x8d458?0x0:_0x21c85e[_0x72d1('0x1e')];var _0x1ca18d=_0x8d458?_0x23a238['count']:_0x21c85e['offset']+_0x21c85e[_0x72d1('0x1f')];var _0x10d464;if(_0x1ca18d>=_0x2c9851){_0x1ca18d=_0x2c9851;_0x10d464=0xc8;}else{_0x10d464=0xce;}_0x3f190f[_0x72d1('0x1a')](_0x10d464);return _0x3f190f[_0x72d1('0x20')](_0x72d1('0x21'),_0x1061b7+'-'+_0x1ca18d+'/'+_0x2c9851)[_0x72d1('0x1c')](_0x23a238);}return null;};}function patchUpdates(_0x1e2411){return function(_0x5c7982){try{jsonpatch[_0x72d1('0x22')](_0x5c7982,_0x1e2411,!![]);}catch(_0x56e8d3){return BPromise['reject'](_0x56e8d3);}return _0x5c7982['save']();};}function saveUpdates(_0x585243,_0x445985){return function(_0x374602){if(_0x374602){return _0x374602['update'](_0x585243)[_0x72d1('0x23')](function(_0x256dc1){return _0x256dc1;});}return null;};}function removeEntity(_0x492086,_0x1431ee){return function(_0x26fa35){if(_0x26fa35){return _0x26fa35['destroy']()['then'](function(){_0x492086[_0x72d1('0x1a')](0xcc)[_0x72d1('0x1b')]();});}};}function handleEntityNotFound(_0x2f661,_0x2f879f){return function(_0xdf6a69){if(!_0xdf6a69){_0x2f661[_0x72d1('0x19')](0x194);}return _0xdf6a69;};}function handleError(_0x163bec,_0x589f7c){_0x589f7c=_0x589f7c||0x1f4;return function(_0x57ec9e){logger[_0x72d1('0x24')](_0x57ec9e['stack']);if(_0x57ec9e[_0x72d1('0x25')]){delete _0x57ec9e[_0x72d1('0x25')];}_0x163bec[_0x72d1('0x1a')](_0x589f7c)['send'](_0x57ec9e);};}exports[_0x72d1('0x26')]=function(_0x4c4c41,_0x707cd0){var _0x20055f={},_0x32588f={},_0x2cc0c8={'count':0x0,'rows':[]};var _0x51242b=_[_0x72d1('0x27')](db['ScreenRecording'][_0x72d1('0x28')],function(_0x32dc5e){return{'name':_0x32dc5e['fieldName'],'type':_0x32dc5e[_0x72d1('0x29')][_0x72d1('0x2a')]};});_0x32588f[_0x72d1('0x2b')]=_[_0x72d1('0x2c')](_[_0x72d1('0x27')](_0x51242b,'name'),[_0x72d1('0x2d')]);_0x32588f[_0x72d1('0x2e')]=_[_0x72d1('0x2f')](_0x4c4c41['query']);_0x32588f[_0x72d1('0x30')]=_[_0x72d1('0x31')](_0x32588f['model'],_0x32588f[_0x72d1('0x2e')]);_0x20055f[_0x72d1('0x32')]=_[_0x72d1('0x31')](_0x32588f['model'],qs[_0x72d1('0x33')](_0x4c4c41['query'][_0x72d1('0x33')]));_0x20055f[_0x72d1('0x32')]=_0x20055f[_0x72d1('0x32')][_0x72d1('0x34')]?_0x20055f[_0x72d1('0x32')]:_0x32588f[_0x72d1('0x2b')];if(!_0x4c4c41[_0x72d1('0x2e')][_0x72d1('0x35')](_0x72d1('0x36'))){_0x20055f[_0x72d1('0x1f')]=qs[_0x72d1('0x1f')](_0x4c4c41['query'][_0x72d1('0x1f')]);_0x20055f[_0x72d1('0x1e')]=qs[_0x72d1('0x1e')](_0x4c4c41[_0x72d1('0x2e')]['offset']);}_0x20055f[_0x72d1('0x37')]=qs[_0x72d1('0x38')](_0x4c4c41[_0x72d1('0x2e')]['sort']);_0x20055f[_0x72d1('0x39')]=qs[_0x72d1('0x30')](_[_0x72d1('0x3a')](_0x4c4c41['query'],_0x32588f[_0x72d1('0x30')]),_0x51242b);if(_0x4c4c41[_0x72d1('0x2e')][_0x72d1('0x3b')]){_0x20055f['where']=_[_0x72d1('0x3c')](_0x20055f[_0x72d1('0x39')],{'$or':_[_0x72d1('0x27')](_0x51242b,function(_0x14cb3d){if(_0x14cb3d[_0x72d1('0x29')]!==_0x72d1('0x3d')){var _0xd7ec0f={};_0xd7ec0f[_0x14cb3d['name']]={'$like':'%'+_0x4c4c41[_0x72d1('0x2e')][_0x72d1('0x3b')]+'%'};return _0xd7ec0f;}})});}_0x20055f=_[_0x72d1('0x3c')]({},_0x20055f,_0x4c4c41[_0x72d1('0x3e')]);var _0x20fb2f={'where':_0x20055f[_0x72d1('0x39')]};return db[_0x72d1('0x3f')][_0x72d1('0x40')](_0x20fb2f)['then'](function(_0x44d5b2){_0x2cc0c8[_0x72d1('0x40')]=_0x44d5b2;if(_0x4c4c41[_0x72d1('0x2e')][_0x72d1('0x41')]){_0x20055f[_0x72d1('0x42')]=[{'all':!![]}];}return db[_0x72d1('0x3f')][_0x72d1('0x43')](_0x20055f);})[_0x72d1('0x23')](function(_0x5620f0){_0x2cc0c8['rows']=_0x5620f0;return _0x2cc0c8;})[_0x72d1('0x23')](respondWithFilteredResult(_0x707cd0,_0x20055f))[_0x72d1('0x44')](handleError(_0x707cd0,null));};exports[_0x72d1('0x45')]=function(_0x21d361,_0x5a6bc4){var _0x3fe286={'raw':![],'where':{'id':_0x21d361['params']['id']}},_0x3e80e0={};_0x3e80e0[_0x72d1('0x2b')]=_['keys'](db[_0x72d1('0x3f')][_0x72d1('0x28')]);_0x3e80e0['query']=_[_0x72d1('0x2f')](_0x21d361['query']);_0x3e80e0['filters']=_['intersection'](_0x3e80e0[_0x72d1('0x2b')],_0x3e80e0['query']);_0x3fe286[_0x72d1('0x32')]=_[_0x72d1('0x31')](_0x3e80e0[_0x72d1('0x2b')],qs['fields'](_0x21d361['query'][_0x72d1('0x33')]));_0x3fe286['attributes']=_0x3fe286['attributes'][_0x72d1('0x34')]?_0x3fe286[_0x72d1('0x32')]:_0x3e80e0[_0x72d1('0x2b')];if(_0x21d361['query']['includeAll']){_0x3fe286['include']=[{'all':!![]}];}_0x3fe286=_['merge']({},_0x3fe286,_0x21d361[_0x72d1('0x3e')]);return db[_0x72d1('0x3f')][_0x72d1('0x46')](_0x3fe286)[_0x72d1('0x23')](handleEntityNotFound(_0x5a6bc4,null))[_0x72d1('0x23')](respondWithResult(_0x5a6bc4,null))[_0x72d1('0x44')](handleError(_0x5a6bc4,null));};exports[_0x72d1('0x47')]=function(_0x5924c,_0x1e2c11){return db['ScreenRecording'][_0x72d1('0x47')](_0x5924c[_0x72d1('0x48')],{})[_0x72d1('0x23')](respondWithResult(_0x1e2c11,0xc9))['catch'](handleError(_0x1e2c11,null));};exports[_0x72d1('0x49')]=function(_0x29c88f,_0x12ad75){if(_0x29c88f['body']['id']){delete _0x29c88f[_0x72d1('0x48')]['id'];}delete _0x29c88f[_0x72d1('0x48')][_0x72d1('0x4a')];delete _0x29c88f[_0x72d1('0x48')]['createdAt'];delete _0x29c88f['body'][_0x72d1('0x4b')];delete _0x29c88f[_0x72d1('0x48')][_0x72d1('0x4c')];return db['ScreenRecording'][_0x72d1('0x46')]({'where':{'id':_0x29c88f[_0x72d1('0x4d')]['id']}})[_0x72d1('0x23')](handleEntityNotFound(_0x12ad75,null))[_0x72d1('0x23')](saveUpdates(_0x29c88f[_0x72d1('0x48')],null))[_0x72d1('0x23')](respondWithResult(_0x12ad75,null))[_0x72d1('0x44')](handleError(_0x12ad75,null));};exports[_0x72d1('0x4e')]=function(_0x12870c,_0x18f986){return db[_0x72d1('0x3f')]['describe']()[_0x72d1('0x23')](respondWithResult(_0x18f986,null))['catch'](handleError(_0x18f986,null));};exports['download']=function(_0x356196,_0x5f2bba,_0x3c880e){var _0x7e401b=require(_0x72d1('0x4f'));var _0x162248=![];var _0x473a7b={};if(_0x356196[_0x72d1('0x2e')][_0x72d1('0x29')]&&_0x356196[_0x72d1('0x2e')][_0x72d1('0x29')]===_0x72d1('0x50')){_0x473a7b[_0x72d1('0x50')]=_0x356196['params']['id'];}else{_0x473a7b['id']=_0x356196[_0x72d1('0x4d')]['id'];}return db[_0x72d1('0x3f')][_0x72d1('0x46')]({'where':_0x473a7b,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x5f2bba,null))[_0x72d1('0x23')](function(_0x140f0b){if(_0x140f0b){var _0x16e9e7=path[_0x72d1('0x51')](config[_0x72d1('0x52')],'server/files/screen_recordings',_0x140f0b[_0x72d1('0x4c')]);var _0x48f4a7=util[_0x72d1('0x2d')](_0x72d1('0x53'),_0x16e9e7);if(fs[_0x72d1('0x54')](_0x48f4a7)){_0x162248=!![];return _0x7e401b[_0x72d1('0x55')](_0x48f4a7,_0x16e9e7,config[_0x72d1('0x56')][_0x72d1('0x57')])[_0x72d1('0x23')](function(){return _0x140f0b;});}return _0x140f0b;}})[_0x72d1('0x23')](function(_0x384f0a){if(_0x384f0a){var _0x3a2dfe=path[_0x72d1('0x51')](config[_0x72d1('0x52')],_0x72d1('0x58'),_0x384f0a[_0x72d1('0x4c')]);if(!fs[_0x72d1('0x54')](_0x3a2dfe)){throw new db[(_0x72d1('0x59'))][(_0x72d1('0x5a'))]('ScreenRecording\x20not\x20found');}if(_0x384f0a[_0x72d1('0x5b')]){return _0x5f2bba[_0x72d1('0x5c')](_0x3a2dfe,_0x384f0a[_0x72d1('0x5b')]+path[_0x72d1('0x5d')](_0x3a2dfe),function(){if(_0x162248){fs[_0x72d1('0x5e')](_0x3a2dfe);}});}else{return _0x5f2bba[_0x72d1('0x5c')](_0x3a2dfe,function(_0x4e2d85){if(_0x162248){fs[_0x72d1('0x5e')](_0x3a2dfe);}});}}})[_0x72d1('0x44')](function(_0xb05cd9){if(_0xb05cd9['message']==='ScreenRecording\x20not\x20found'){_0x5f2bba[_0x72d1('0x1a')](0x194)['send'](_0x72d1('0x5f'));}else{return handleError(_0x5f2bba,null);}});};exports[_0x72d1('0x60')]=function(_0x201810,_0x41525c){return db[_0x72d1('0x3f')][_0x72d1('0x46')]({'where':{'id':_0x201810[_0x72d1('0x4d')]['id']}})[_0x72d1('0x23')](function(_0x28e42b){if(_['isNil'](_0x28e42b)){throw new ReferenceError('Entity\x20not\x20found');}return _0x28e42b;})[_0x72d1('0x23')](function(_0x1d44f0){var _0x1bd80b=path['join'](config[_0x72d1('0x52')],_0x72d1('0x58'),_0x1d44f0['value']);logger[_0x72d1('0x61')](_0x72d1('0x62'),_0x1bd80b);if(!_[_0x72d1('0x63')](_0x1d44f0[_0x72d1('0x4c')])&&fs[_0x72d1('0x54')](_0x1bd80b)){logger[_0x72d1('0x61')](_0x72d1('0x64')+_0x1bd80b+_0x72d1('0x65'));fs[_0x72d1('0x66')](_0x1bd80b);}_0x1bd80b=_0x1bd80b+_0x72d1('0x67');if(!_[_0x72d1('0x63')](_0x1d44f0[_0x72d1('0x4c')])&&fs['existsSync'](_0x1bd80b)){logger['info'](_0x72d1('0x64')+_0x1bd80b+_0x72d1('0x65'));fs[_0x72d1('0x66')](_0x1bd80b);}return _0x1d44f0;})[_0x72d1('0x23')](function(_0x2ae8c9){if(!_0x2ae8c9)throw new InternalError();return _0x2ae8c9[_0x72d1('0x60')]();})[_0x72d1('0x23')](function(){_0x41525c[_0x72d1('0x1a')](0xcc)['end']();})[_0x72d1('0x44')](handleError(_0x41525c,null));};
\ No newline at end of file
+var _0xb138=['format','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','merge','options','findAll','rows','catch','params','keys','includeAll','include','find','create','body','closedAt','value','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','decryptFile','secrets','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','Entity\x20not\x20found','info','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model'];(function(_0x582ae6,_0x57aa08){var _0x303447=function(_0x158d7b){while(--_0x158d7b){_0x582ae6['push'](_0x582ae6['shift']());}};_0x303447(++_0x57aa08);}(_0xb138,0x1dd));var _0x8b13=function(_0x192fb9,_0x33340b){_0x192fb9=_0x192fb9-0x0;var _0x56e8a4=_0xb138[_0x192fb9];return _0x56e8a4;};'use strict';var emlformat=require(_0x8b13('0x0'));var rimraf=require(_0x8b13('0x1'));var zipdir=require(_0x8b13('0x2'));var jsonpatch=require(_0x8b13('0x3'));var rp=require(_0x8b13('0x4'));var moment=require(_0x8b13('0x5'));var BPromise=require(_0x8b13('0x6'));var Mustache=require('mustache');var util=require(_0x8b13('0x7'));var path=require(_0x8b13('0x8'));var sox=require(_0x8b13('0x9'));var csv=require('to-csv');var ejs=require(_0x8b13('0xa'));var fs=require('fs');var fs_extra=require(_0x8b13('0xb'));var _=require('lodash');var squel=require(_0x8b13('0xc'));var crypto=require(_0x8b13('0xd'));var jsforce=require(_0x8b13('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8b13('0xf'));var querystring=require(_0x8b13('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8b13('0x11'));var qs=require(_0x8b13('0x12'));var as=require(_0x8b13('0x13'));var hardwareService=require(_0x8b13('0x14'));var logger=require(_0x8b13('0x15'))('api');var utils=require(_0x8b13('0x16'));var config=require(_0x8b13('0x17'));var licenseUtil=require(_0x8b13('0x18'));var db=require(_0x8b13('0x19'))['db'];function respondWithStatusCode(_0xb227e0,_0x1893b1){_0x1893b1=_0x1893b1||0xcc;return function(_0x58f97e){if(_0x58f97e){return _0xb227e0['sendStatus'](_0x1893b1);}return _0xb227e0[_0x8b13('0x1a')](_0x1893b1)[_0x8b13('0x1b')]();};}function respondWithResult(_0x5f12b5,_0x51a935){_0x51a935=_0x51a935||0xc8;return function(_0x479773){if(_0x479773){return _0x5f12b5[_0x8b13('0x1a')](_0x51a935)[_0x8b13('0x1c')](_0x479773);}};}function respondWithFilteredResult(_0xf29086,_0x2c615a){return function(_0x13f956){if(_0x13f956){var _0x542357=typeof _0x2c615a[_0x8b13('0x1d')]===_0x8b13('0x1e')&&typeof _0x2c615a[_0x8b13('0x1f')]===_0x8b13('0x1e');var _0x3eed21=_0x13f956[_0x8b13('0x20')];var _0x10fbde=_0x542357?0x0:_0x2c615a[_0x8b13('0x1d')];var _0x4989d3=_0x542357?_0x13f956['count']:_0x2c615a[_0x8b13('0x1d')]+_0x2c615a[_0x8b13('0x1f')];var _0x14a8ac;if(_0x4989d3>=_0x3eed21){_0x4989d3=_0x3eed21;_0x14a8ac=0xc8;}else{_0x14a8ac=0xce;}_0xf29086[_0x8b13('0x1a')](_0x14a8ac);return _0xf29086[_0x8b13('0x21')](_0x8b13('0x22'),_0x10fbde+'-'+_0x4989d3+'/'+_0x3eed21)['json'](_0x13f956);}return null;};}function patchUpdates(_0x1e8a48){return function(_0x3c4d4f){try{jsonpatch[_0x8b13('0x23')](_0x3c4d4f,_0x1e8a48,!![]);}catch(_0x54a309){return BPromise['reject'](_0x54a309);}return _0x3c4d4f[_0x8b13('0x24')]();};}function saveUpdates(_0xcb7621,_0x4f9902){return function(_0x3187ed){if(_0x3187ed){return _0x3187ed[_0x8b13('0x25')](_0xcb7621)[_0x8b13('0x26')](function(_0x213280){return _0x213280;});}return null;};}function removeEntity(_0xc05d5c,_0x583639){return function(_0x339271){if(_0x339271){return _0x339271[_0x8b13('0x27')]()['then'](function(){_0xc05d5c[_0x8b13('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x420772,_0x325d68){return function(_0x54786a){if(!_0x54786a){_0x420772[_0x8b13('0x28')](0x194);}return _0x54786a;};}function handleError(_0x3223d8,_0x4f8e58){_0x4f8e58=_0x4f8e58||0x1f4;return function(_0x134c5e){logger[_0x8b13('0x29')](_0x134c5e[_0x8b13('0x2a')]);if(_0x134c5e[_0x8b13('0x2b')]){delete _0x134c5e[_0x8b13('0x2b')];}_0x3223d8['status'](_0x4f8e58)[_0x8b13('0x2c')](_0x134c5e);};}exports[_0x8b13('0x2d')]=function(_0x3475d8,_0x1511bf){var _0x114b01={},_0x2bb51d={},_0x5ab161={'count':0x0,'rows':[]};var _0x35fdca=_[_0x8b13('0x2e')](db[_0x8b13('0x2f')][_0x8b13('0x30')],function(_0x23fde7){return{'name':_0x23fde7[_0x8b13('0x31')],'type':_0x23fde7[_0x8b13('0x32')][_0x8b13('0x33')]};});_0x2bb51d[_0x8b13('0x34')]=_['differenceBy'](_[_0x8b13('0x2e')](_0x35fdca,_0x8b13('0x2b')),[_0x8b13('0x35')]);_0x2bb51d[_0x8b13('0x36')]=_['keys'](_0x3475d8['query']);_0x2bb51d[_0x8b13('0x37')]=_['intersection'](_0x2bb51d['model'],_0x2bb51d[_0x8b13('0x36')]);_0x114b01['attributes']=_[_0x8b13('0x38')](_0x2bb51d[_0x8b13('0x34')],qs[_0x8b13('0x39')](_0x3475d8[_0x8b13('0x36')][_0x8b13('0x39')]));_0x114b01[_0x8b13('0x3a')]=_0x114b01[_0x8b13('0x3a')][_0x8b13('0x3b')]?_0x114b01[_0x8b13('0x3a')]:_0x2bb51d[_0x8b13('0x34')];if(!_0x3475d8['query'][_0x8b13('0x3c')](_0x8b13('0x3d'))){_0x114b01[_0x8b13('0x1f')]=qs[_0x8b13('0x1f')](_0x3475d8[_0x8b13('0x36')][_0x8b13('0x1f')]);_0x114b01[_0x8b13('0x1d')]=qs[_0x8b13('0x1d')](_0x3475d8['query'][_0x8b13('0x1d')]);}_0x114b01['order']=qs[_0x8b13('0x3e')](_0x3475d8[_0x8b13('0x36')][_0x8b13('0x3e')]);_0x114b01[_0x8b13('0x3f')]=qs[_0x8b13('0x37')](_[_0x8b13('0x40')](_0x3475d8['query'],_0x2bb51d['filters']),_0x35fdca);if(_0x3475d8[_0x8b13('0x36')]['filter']){_0x114b01[_0x8b13('0x3f')]=_['merge'](_0x114b01[_0x8b13('0x3f')],{'$or':_[_0x8b13('0x2e')](_0x35fdca,function(_0x29a359){if(_0x29a359[_0x8b13('0x32')]!==_0x8b13('0x41')){var _0x4e16e7={};_0x4e16e7[_0x29a359['name']]={'$like':'%'+_0x3475d8[_0x8b13('0x36')]['filter']+'%'};return _0x4e16e7;}})});}_0x114b01=_[_0x8b13('0x42')]({},_0x114b01,_0x3475d8[_0x8b13('0x43')]);var _0x4dc268={'where':_0x114b01[_0x8b13('0x3f')]};return db[_0x8b13('0x2f')][_0x8b13('0x20')](_0x4dc268)[_0x8b13('0x26')](function(_0x2f4e7f){_0x5ab161[_0x8b13('0x20')]=_0x2f4e7f;if(_0x3475d8[_0x8b13('0x36')]['includeAll']){_0x114b01['include']=[{'all':!![]}];}return db['ScreenRecording'][_0x8b13('0x44')](_0x114b01);})[_0x8b13('0x26')](function(_0x27cfe5){_0x5ab161[_0x8b13('0x45')]=_0x27cfe5;return _0x5ab161;})[_0x8b13('0x26')](respondWithFilteredResult(_0x1511bf,_0x114b01))[_0x8b13('0x46')](handleError(_0x1511bf,null));};exports['show']=function(_0x4342db,_0x50e535){var _0x13d0ef={'raw':![],'where':{'id':_0x4342db[_0x8b13('0x47')]['id']}},_0x5ce9c8={};_0x5ce9c8[_0x8b13('0x34')]=_[_0x8b13('0x48')](db[_0x8b13('0x2f')][_0x8b13('0x30')]);_0x5ce9c8[_0x8b13('0x36')]=_[_0x8b13('0x48')](_0x4342db['query']);_0x5ce9c8['filters']=_['intersection'](_0x5ce9c8[_0x8b13('0x34')],_0x5ce9c8[_0x8b13('0x36')]);_0x13d0ef[_0x8b13('0x3a')]=_[_0x8b13('0x38')](_0x5ce9c8['model'],qs['fields'](_0x4342db[_0x8b13('0x36')]['fields']));_0x13d0ef[_0x8b13('0x3a')]=_0x13d0ef[_0x8b13('0x3a')][_0x8b13('0x3b')]?_0x13d0ef[_0x8b13('0x3a')]:_0x5ce9c8[_0x8b13('0x34')];if(_0x4342db['query'][_0x8b13('0x49')]){_0x13d0ef[_0x8b13('0x4a')]=[{'all':!![]}];}_0x13d0ef=_[_0x8b13('0x42')]({},_0x13d0ef,_0x4342db[_0x8b13('0x43')]);return db[_0x8b13('0x2f')][_0x8b13('0x4b')](_0x13d0ef)[_0x8b13('0x26')](handleEntityNotFound(_0x50e535,null))[_0x8b13('0x26')](respondWithResult(_0x50e535,null))[_0x8b13('0x46')](handleError(_0x50e535,null));};exports['create']=function(_0x46d096,_0x59d863){return db[_0x8b13('0x2f')][_0x8b13('0x4c')](_0x46d096[_0x8b13('0x4d')],{})['then'](respondWithResult(_0x59d863,0xc9))[_0x8b13('0x46')](handleError(_0x59d863,null));};exports[_0x8b13('0x25')]=function(_0x257107,_0x4129c0){if(_0x257107[_0x8b13('0x4d')]['id']){delete _0x257107[_0x8b13('0x4d')]['id'];}delete _0x257107[_0x8b13('0x4d')]['duration'];delete _0x257107[_0x8b13('0x4d')]['createdAt'];delete _0x257107[_0x8b13('0x4d')][_0x8b13('0x4e')];delete _0x257107[_0x8b13('0x4d')][_0x8b13('0x4f')];return db[_0x8b13('0x2f')][_0x8b13('0x4b')]({'where':{'id':_0x257107[_0x8b13('0x47')]['id']}})[_0x8b13('0x26')](handleEntityNotFound(_0x4129c0,null))[_0x8b13('0x26')](saveUpdates(_0x257107[_0x8b13('0x4d')],null))[_0x8b13('0x26')](respondWithResult(_0x4129c0,null))[_0x8b13('0x46')](handleError(_0x4129c0,null));};exports[_0x8b13('0x50')]=function(_0x2bdfae,_0x42c29d){return db[_0x8b13('0x2f')][_0x8b13('0x50')]()['then'](respondWithResult(_0x42c29d,null))[_0x8b13('0x46')](handleError(_0x42c29d,null));};exports[_0x8b13('0x51')]=function(_0x4c19f6,_0x342fff,_0x328373){var _0x2fc00c=require(_0x8b13('0x52'));var _0x25cb45=![];var _0x12549b={};if(_0x4c19f6[_0x8b13('0x36')][_0x8b13('0x32')]&&_0x4c19f6[_0x8b13('0x36')][_0x8b13('0x32')]===_0x8b13('0x53')){_0x12549b[_0x8b13('0x53')]=_0x4c19f6[_0x8b13('0x47')]['id'];}else{_0x12549b['id']=_0x4c19f6[_0x8b13('0x47')]['id'];}return db[_0x8b13('0x2f')]['find']({'where':_0x12549b,'attributes':['id',_0x8b13('0x4f')],'raw':!![]})[_0x8b13('0x26')](handleEntityNotFound(_0x342fff,null))['then'](function(_0x11e8af){if(_0x11e8af){var _0x73aba5=path[_0x8b13('0x54')](config[_0x8b13('0x55')],_0x8b13('0x56'),_0x11e8af['value']);var _0x1fd105=util[_0x8b13('0x35')](_0x8b13('0x57'),_0x73aba5);if(fs['existsSync'](_0x1fd105)){_0x25cb45=!![];return _0x2fc00c[_0x8b13('0x58')](_0x1fd105,_0x73aba5,config[_0x8b13('0x59')]['recording'])[_0x8b13('0x26')](function(){return _0x11e8af;});}return _0x11e8af;}})[_0x8b13('0x26')](function(_0x475c8d){if(_0x475c8d){var _0xd29067=path['join'](config[_0x8b13('0x55')],_0x8b13('0x56'),_0x475c8d['value']);if(!fs[_0x8b13('0x5a')](_0xd29067)){throw new db[(_0x8b13('0x5b'))][(_0x8b13('0x5c'))](_0x8b13('0x5d'));}if(_0x475c8d['filename']){return _0x342fff[_0x8b13('0x51')](_0xd29067,_0x475c8d[_0x8b13('0x5e')]+path[_0x8b13('0x5f')](_0xd29067),function(){if(_0x25cb45){fs[_0x8b13('0x60')](_0xd29067);}});}else{return _0x342fff[_0x8b13('0x51')](_0xd29067,function(_0x2fff4e){if(_0x25cb45){fs['unlink'](_0xd29067);}});}}})[_0x8b13('0x46')](function(_0x1082d9){if(_0x1082d9[_0x8b13('0x61')]==='ScreenRecording\x20not\x20found'){_0x342fff[_0x8b13('0x1a')](0x194)[_0x8b13('0x2c')](_0x8b13('0x62'));}else{return handleError(_0x342fff,null);}});};exports[_0x8b13('0x27')]=function(_0x4d8f23,_0x59a6b3){return db['ScreenRecording']['find']({'where':{'id':_0x4d8f23['params']['id']}})[_0x8b13('0x26')](function(_0x1bc936){if(_['isNil'](_0x1bc936)){throw new ReferenceError(_0x8b13('0x63'));}return _0x1bc936;})['then'](function(_0x274bad){var _0x2d2fa3=path[_0x8b13('0x54')](config[_0x8b13('0x55')],_0x8b13('0x56'),_0x274bad[_0x8b13('0x4f')]);logger[_0x8b13('0x64')]('cancellazione\x20fisica\x20documento\x20%s',_0x2d2fa3);if(!_[_0x8b13('0x65')](_0x274bad['value'])&&fs[_0x8b13('0x5a')](_0x2d2fa3)){logger[_0x8b13('0x64')](_0x8b13('0x66')+_0x2d2fa3+_0x8b13('0x67'));fs[_0x8b13('0x68')](_0x2d2fa3);}_0x2d2fa3=_0x2d2fa3+_0x8b13('0x69');if(!_[_0x8b13('0x65')](_0x274bad['value'])&&fs[_0x8b13('0x5a')](_0x2d2fa3)){logger['info'](_0x8b13('0x66')+_0x2d2fa3+_0x8b13('0x67'));fs[_0x8b13('0x68')](_0x2d2fa3);}return _0x274bad;})[_0x8b13('0x26')](function(_0x177a64){if(!_0x177a64)throw new InternalError();return _0x177a64['destroy']();})['then'](function(){_0x59a6b3[_0x8b13('0x1a')](0xcc)[_0x8b13('0x1b')]();})['catch'](handleError(_0x59a6b3,null));};
\ No newline at end of file
index 36d8b34..5fc2606 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf313=['screen_recordings','interactionid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xf313,0x7a));var _0x3f31=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xf313[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x3f31('0x0'));var util=require(_0x3f31('0x1'));var logger=require(_0x3f31('0x2'))(_0x3f31('0x3'));var moment=require(_0x3f31('0x4'));var BPromise=require(_0x3f31('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3f31('0x6'));var rimraf=require(_0x3f31('0x7'));var config=require(_0x3f31('0x8'));var attributes=require(_0x3f31('0x9'));module[_0x3f31('0xa')]=function(_0x5416e4,_0x4b8910){return _0x5416e4[_0x3f31('0xb')](_0x3f31('0xc'),attributes,{'tableName':_0x3f31('0xd'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0x3f31('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xed2f=['request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xed2f,0x13a));var _0xfed2=function(_0x284377,_0x14d43e){_0x284377=_0x284377-0x0;var _0x4f86df=_0xed2f[_0x284377];return _0x4f86df;};'use strict';var _=require(_0xfed2('0x0'));var util=require(_0xfed2('0x1'));var logger=require(_0xfed2('0x2'))(_0xfed2('0x3'));var moment=require(_0xfed2('0x4'));var BPromise=require(_0xfed2('0x5'));var rp=require(_0xfed2('0x6'));var fs=require('fs');var path=require(_0xfed2('0x7'));var rimraf=require(_0xfed2('0x8'));var config=require(_0xfed2('0x9'));var attributes=require(_0xfed2('0xa'));module[_0xfed2('0xb')]=function(_0x5b6ade,_0x59b1a5){return _0x5b6ade[_0xfed2('0xc')](_0xfed2('0xd'),attributes,{'tableName':_0xfed2('0xe'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0xfed2('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
index f44b579..d356f88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x942f=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x942f,0xbb));var _0xf942=function(_0x2fe913,_0x40a217){_0x2fe913=_0x2fe913-0x0;var _0x337f9d=_0x942f[_0x2fe913];return _0x337f9d;};'use strict';var _=require(_0xf942('0x0'));var util=require(_0xf942('0x1'));var moment=require(_0xf942('0x2'));var BPromise=require('bluebird');var rs=require(_0xf942('0x3'));var fs=require('fs');var Redis=require(_0xf942('0x4'));var db=require(_0xf942('0x5'))['db'];var utils=require(_0xf942('0x6'));var logger=require(_0xf942('0x7'))(_0xf942('0x8'));var config=require(_0xf942('0x9'));var jayson=require(_0xf942('0xa'));var client=jayson[_0xf942('0xb')][_0xf942('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1e4e94,_0x1010c8,_0x6d616b){return new BPromise(function(_0x33be72,_0x3119c4){return client[_0xf942('0xd')](_0x1e4e94,_0x6d616b)['then'](function(_0x359786){logger[_0xf942('0xe')](_0xf942('0xf'),_0x1010c8,_0xf942('0x10'));logger[_0xf942('0x11')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x1010c8,_0xf942('0x10'),JSON[_0xf942('0x12')](_0x359786));if(_0x359786['error']){if(_0x359786[_0xf942('0x13')]['code']===0x1f4){logger[_0xf942('0x13')](_0xf942('0xf'),_0x1010c8,_0x359786['error'][_0xf942('0x14')]);return _0x3119c4(_0x359786[_0xf942('0x13')]['message']);}logger[_0xf942('0x13')]('ScreenRecording,\x20%s,\x20%s',_0x1010c8,_0x359786[_0xf942('0x13')][_0xf942('0x14')]);return _0x33be72(_0x359786['error'][_0xf942('0x14')]);}else{logger[_0xf942('0xe')](_0xf942('0xf'),_0x1010c8,_0xf942('0x10'));_0x33be72(_0x359786[_0xf942('0x15')][_0xf942('0x14')]);}})[_0xf942('0x16')](function(_0x62fab7){logger[_0xf942('0x13')](_0xf942('0xf'),_0x1010c8,_0x62fab7);_0x3119c4(_0x62fab7);});});}
\ No newline at end of file
+var _0xebc4=['stringify','error','code','ScreenRecording,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3676fc,_0x369252){var _0x305fa1=function(_0x21b996){while(--_0x21b996){_0x3676fc['push'](_0x3676fc['shift']());}};_0x305fa1(++_0x369252);}(_0xebc4,0xfe));var _0x4ebc=function(_0x1f6a76,_0x1d89c0){_0x1f6a76=_0x1f6a76-0x0;var _0x5bd07d=_0xebc4[_0x1f6a76];return _0x5bd07d;};'use strict';var _=require(_0x4ebc('0x0'));var util=require(_0x4ebc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4ebc('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4ebc('0x3'))(_0x4ebc('0x4'));var config=require(_0x4ebc('0x5'));var jayson=require(_0x4ebc('0x6'));var client=jayson['client'][_0x4ebc('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3bd26a,_0x1f62fa,_0x359052){return new BPromise(function(_0x55bee3,_0x53357d){return client[_0x4ebc('0x8')](_0x3bd26a,_0x359052)['then'](function(_0x4529bd){logger[_0x4ebc('0x9')]('ScreenRecording,\x20%s,\x20%s',_0x1f62fa,'request\x20sent');logger['debug'](_0x4ebc('0xa'),_0x1f62fa,_0x4ebc('0xb'),JSON[_0x4ebc('0xc')](_0x4529bd));if(_0x4529bd['error']){if(_0x4529bd[_0x4ebc('0xd')][_0x4ebc('0xe')]===0x1f4){logger[_0x4ebc('0xd')](_0x4ebc('0xf'),_0x1f62fa,_0x4529bd[_0x4ebc('0xd')][_0x4ebc('0x10')]);return _0x53357d(_0x4529bd[_0x4ebc('0xd')][_0x4ebc('0x10')]);}logger['error']('ScreenRecording,\x20%s,\x20%s',_0x1f62fa,_0x4529bd[_0x4ebc('0xd')][_0x4ebc('0x10')]);return _0x55bee3(_0x4529bd[_0x4ebc('0xd')][_0x4ebc('0x10')]);}else{logger[_0x4ebc('0x9')](_0x4ebc('0xf'),_0x1f62fa,'request\x20sent');_0x55bee3(_0x4529bd[_0x4ebc('0x11')]['message']);}})[_0x4ebc('0x12')](function(_0x323d42){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x1f62fa,_0x323d42);_0x53357d(_0x323d42);});});}
\ No newline at end of file
index 2fddcb8..70ef381 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb912=['join','%s%s','logologin','single','file','addLogoLogin','preferred','addPreferred','favicon','/:id','update','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','index','/now','getDate','/:id/logo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','root','server/files/images/logos/','format','extname','originalname','post','addLogo'];(function(_0xec1006,_0x12e16c){var _0x2b47c5=function(_0xf2a404){while(--_0xf2a404){_0xec1006['push'](_0xec1006['shift']());}};_0x2b47c5(++_0x12e16c);}(_0xb912,0x1e5));var _0x2b91=function(_0x4129bb,_0x42d948){_0x4129bb=_0x4129bb-0x0;var _0xc5f17b=_0xb912[_0x4129bb];return _0xc5f17b;};'use strict';var multer=require(_0x2b91('0x0'));var util=require(_0x2b91('0x1'));var path=require(_0x2b91('0x2'));var timeout=require(_0x2b91('0x3'));var express=require(_0x2b91('0x4'));var router=express['Router']();var fs_extra=require(_0x2b91('0x5'));var auth=require(_0x2b91('0x6'));var interaction=require(_0x2b91('0x7'));var config=require(_0x2b91('0x8'));var controller=require(_0x2b91('0x9'));router[_0x2b91('0xa')]('/',auth['isAuthenticated'](),controller[_0x2b91('0xb')]);router[_0x2b91('0xa')](_0x2b91('0xc'),controller[_0x2b91('0xd')]);router[_0x2b91('0xa')]('/:id',controller['show']);router[_0x2b91('0xa')](_0x2b91('0xe'),controller['getLogo']);router[_0x2b91('0xa')](_0x2b91('0xf'),controller[_0x2b91('0x10')]);router[_0x2b91('0xa')](_0x2b91('0x11'),controller[_0x2b91('0x12')]);router['get'](_0x2b91('0x13'),controller[_0x2b91('0x14')]);router[_0x2b91('0xa')](_0x2b91('0x15'),controller[_0x2b91('0x16')]);var upload=multer({'storage':multer[_0x2b91('0x17')]({'destination':function(_0x2f7e37,_0x58a473,_0x43ee8b){_0x43ee8b(null,path['join'](config[_0x2b91('0x18')],_0x2b91('0x19')));},'filename':function(_0x15d8fb,_0x4efd04,_0x390ef2){_0x390ef2(null,util[_0x2b91('0x1a')]('%s%s','logo',path[_0x2b91('0x1b')](_0x4efd04[_0x2b91('0x1c')])));}})});router[_0x2b91('0x1d')](_0x2b91('0xe'),upload['single']('file'),controller[_0x2b91('0x1e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xb97836,_0x4c1922,_0x5a0366){_0x5a0366(null,path[_0x2b91('0x1f')](config['root'],'server/files/images/logos/'));},'filename':function(_0x4f7b7b,_0x49adc4,_0x72f700){_0x72f700(null,util[_0x2b91('0x1a')](_0x2b91('0x20'),_0x2b91('0x21'),path[_0x2b91('0x1b')](_0x49adc4['originalname'])));}})});router[_0x2b91('0x1d')]('/:id/logo_login',upload[_0x2b91('0x22')](_0x2b91('0x23')),controller[_0x2b91('0x24')]);var upload=multer({'storage':multer[_0x2b91('0x17')]({'destination':function(_0x22fa26,_0x57c348,_0x51a583){_0x51a583(null,path[_0x2b91('0x1f')](config[_0x2b91('0x18')],_0x2b91('0x19')));},'filename':function(_0x18b53c,_0x48f516,_0x40bcb0){_0x40bcb0(null,util[_0x2b91('0x1a')]('%s%s',_0x2b91('0x25'),path[_0x2b91('0x1b')](_0x48f516[_0x2b91('0x1c')])));}})});router[_0x2b91('0x1d')](_0x2b91('0x13'),upload[_0x2b91('0x22')](_0x2b91('0x23')),controller[_0x2b91('0x26')]);var upload=multer({'storage':multer[_0x2b91('0x17')]({'destination':function(_0x340f8e,_0x570b7e,_0x4cfe3f){_0x4cfe3f(null,path[_0x2b91('0x1f')](config['root'],_0x2b91('0x19')));},'filename':function(_0x3d0a15,_0x3fe856,_0x3a0f30){_0x3a0f30(null,util['format'](_0x2b91('0x20'),_0x2b91('0x27'),path[_0x2b91('0x1b')](_0x3fe856[_0x2b91('0x1c')])));}})});router[_0x2b91('0x1d')]('/:id/favicon',upload[_0x2b91('0x22')](_0x2b91('0x23')),controller['addFavicon']);router['put'](_0x2b91('0x28'),auth['isAuthenticated'](),controller[_0x2b91('0x29')]);module[_0x2b91('0x2a')]=router;
\ No newline at end of file
+var _0x2819=['../../components/interaction/service','./setting.controller','get','isAuthenticated','index','/now','getDate','/:id','show','/:id/logo','getLogo','getLogoLogin','/:id/gdpr','/:id/preferred','getPreferred','/:id/favicon','diskStorage','root','server/files/images/logos/','originalname','post','file','addLogo','format','%s%s','logologin','extname','/:id/logo_login','single','addLogoLogin','preferred','addPreferred','join','favicon','addFavicon','put','update','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x23a042,_0x169361){var _0x57543a=function(_0x1fccec){while(--_0x1fccec){_0x23a042['push'](_0x23a042['shift']());}};_0x57543a(++_0x169361);}(_0x2819,0x1d4));var _0x9281=function(_0x4303a0,_0xb85b27){_0x4303a0=_0x4303a0-0x0;var _0x3ecb11=_0x2819[_0x4303a0];return _0x3ecb11;};'use strict';var multer=require(_0x9281('0x0'));var util=require('util');var path=require(_0x9281('0x1'));var timeout=require(_0x9281('0x2'));var express=require(_0x9281('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9281('0x4'));var interaction=require(_0x9281('0x5'));var config=require('../../config/environment');var controller=require(_0x9281('0x6'));router[_0x9281('0x7')]('/',auth[_0x9281('0x8')](),controller[_0x9281('0x9')]);router[_0x9281('0x7')](_0x9281('0xa'),controller[_0x9281('0xb')]);router[_0x9281('0x7')](_0x9281('0xc'),controller[_0x9281('0xd')]);router['get'](_0x9281('0xe'),controller[_0x9281('0xf')]);router[_0x9281('0x7')]('/:id/logo_login',controller[_0x9281('0x10')]);router[_0x9281('0x7')](_0x9281('0x11'),controller['gdpr']);router[_0x9281('0x7')](_0x9281('0x12'),controller[_0x9281('0x13')]);router['get'](_0x9281('0x14'),controller['getFavicon']);var upload=multer({'storage':multer[_0x9281('0x15')]({'destination':function(_0x2a3ee6,_0x2acb0c,_0xa2f537){_0xa2f537(null,path['join'](config[_0x9281('0x16')],_0x9281('0x17')));},'filename':function(_0xc7a133,_0x466b2c,_0x292fca){_0x292fca(null,util['format']('%s%s','logo',path['extname'](_0x466b2c[_0x9281('0x18')])));}})});router[_0x9281('0x19')](_0x9281('0xe'),upload['single'](_0x9281('0x1a')),controller[_0x9281('0x1b')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x36f6ac,_0x8d59c2,_0x3d991b){_0x3d991b(null,path['join'](config[_0x9281('0x16')],'server/files/images/logos/'));},'filename':function(_0x5c2cb0,_0xbad69,_0x1ca186){_0x1ca186(null,util[_0x9281('0x1c')](_0x9281('0x1d'),_0x9281('0x1e'),path[_0x9281('0x1f')](_0xbad69['originalname'])));}})});router['post'](_0x9281('0x20'),upload[_0x9281('0x21')](_0x9281('0x1a')),controller[_0x9281('0x22')]);var upload=multer({'storage':multer[_0x9281('0x15')]({'destination':function(_0x531659,_0x5d668c,_0x335868){_0x335868(null,path['join'](config[_0x9281('0x16')],_0x9281('0x17')));},'filename':function(_0x2006d9,_0x5e79c8,_0x10c643){_0x10c643(null,util['format'](_0x9281('0x1d'),_0x9281('0x23'),path['extname'](_0x5e79c8[_0x9281('0x18')])));}})});router[_0x9281('0x19')](_0x9281('0x12'),upload[_0x9281('0x21')](_0x9281('0x1a')),controller[_0x9281('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x159c4a,_0xfe1170,_0x582c96){_0x582c96(null,path[_0x9281('0x25')](config[_0x9281('0x16')],_0x9281('0x17')));},'filename':function(_0x3a2607,_0xeca498,_0x55fec1){_0x55fec1(null,util['format'](_0x9281('0x1d'),_0x9281('0x26'),path['extname'](_0xeca498[_0x9281('0x18')])));}})});router['post']('/:id/favicon',upload['single'](_0x9281('0x1a')),controller[_0x9281('0x27')]);router[_0x9281('0x28')](_0x9281('0xc'),auth[_0x9281('0x8')](),controller[_0x9281('0x29')]);module[_0x9281('0x2a')]=router;
\ No newline at end of file
index 014af63..44d27f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf628=['min_internal','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','exports','INTEGER'];(function(_0x317a6a,_0x390a52){var _0x4d39b8=function(_0x51c496){while(--_0x51c496){_0x317a6a['push'](_0x317a6a['shift']());}};_0x4d39b8(++_0x390a52);}(_0xf628,0x7f));var _0x8f62=function(_0x15a668,_0x9f6e05){_0x15a668=_0x15a668-0x0;var _0x5a1d17=_0xf628[_0x15a668];return _0x5a1d17;};'use strict';var Sequelize=require(_0x8f62('0x0'));module[_0x8f62('0x1')]={'min_internal':{'type':Sequelize[_0x8f62('0x2')](0xb),'unique':_0x8f62('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x8f62('0x4')],'defaultValue':_0x8f62('0x5')},'logo':{'type':Sequelize[_0x8f62('0x4')]},'defaultLogo':{'type':Sequelize[_0x8f62('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x8f62('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x8f62('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x8f62('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x8f62('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x8f62('0x4')]},'turnusername':{'type':Sequelize[_0x8f62('0x4')]},'turnpassword':{'type':Sequelize[_0x8f62('0x4')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x8f62('0x4')],'defaultValue':_0x8f62('0x7')},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize[_0x8f62('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x8f62('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x8f62('0x8')},'chatTimeout':{'type':Sequelize[_0x8f62('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x8f62('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x8f62('0x4')]},'defaultPreferred':{'type':Sequelize[_0x8f62('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x8f62('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x8f62('0x4')]},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x8f62('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0x8f62('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x8f62('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x8f62('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x8f62('0x2')]},'transcribeRegion':{'type':Sequelize[_0x8f62('0x4')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x8f62('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x8f62('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0x8f62('0x4')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x8f62('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x8f62('0x2')](0x2)[_0x8f62('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x8f62('0x2')](0x2)[_0x8f62('0x9')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize['INTEGER'](0x2)[_0x8f62('0x9')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x8f62('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x8f62('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x8f62('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x8f62('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'disabledCookie':{'type':Sequelize[_0x8f62('0x6')],'defaultValue':![]},'limitTabs':{'type':Sequelize['INTEGER'],'defaultValue':0x14}};
\ No newline at end of file
+var _0xa44d=['BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','UNSIGNED','sequelize','INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x1a7536,_0x30c791){var _0x4660d9=function(_0x1db222){while(--_0x1db222){_0x1a7536['push'](_0x1a7536['shift']());}};_0x4660d9(++_0x30c791);}(_0xa44d,0x1ce));var _0xda44=function(_0x3fb9dd,_0x174fff){_0x3fb9dd=_0x3fb9dd-0x0;var _0x20136a=_0xa44d[_0x3fb9dd];return _0x20136a;};'use strict';var Sequelize=require(_0xda44('0x0'));module['exports']={'min_internal':{'type':Sequelize[_0xda44('0x1')](0xb),'unique':_0xda44('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xda44('0x1')](0xb),'unique':_0xda44('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xda44('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xda44('0x4')],'defaultValue':_0xda44('0x5')},'logo':{'type':Sequelize[_0xda44('0x4')]},'defaultLogo':{'type':Sequelize[_0xda44('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xda44('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xda44('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xda44('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xda44('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xda44('0x4')]},'turnaddr':{'type':Sequelize[_0xda44('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize[_0xda44('0x4')]},'pageTitle':{'type':Sequelize[_0xda44('0x4')]},'defaultPageTitle':{'type':Sequelize[_0xda44('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xda44('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xda44('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xda44('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0xda44('0x7')},'enableEmailPreview':{'type':Sequelize[_0xda44('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0xda44('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xda44('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xda44('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xda44('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xda44('0x4')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0xda44('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xda44('0x4')]},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xda44('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xda44('0x4')]},'defaultFavicon':{'type':Sequelize[_0xda44('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xda44('0x1')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xda44('0x1')]},'transcribeRegion':{'type':Sequelize[_0xda44('0x4')]},'sentiment':{'type':Sequelize[_0xda44('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xda44('0x1')]},'sentimentRegion':{'type':Sequelize[_0xda44('0x4')]},'language':{'type':Sequelize[_0xda44('0x4')]},'bucket':{'type':Sequelize[_0xda44('0x4')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xda44('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xda44('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xda44('0x1')](0x2)[_0xda44('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0xda44('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xda44('0x1')](0x2)[_0xda44('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xda44('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xda44('0x1')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0xda44('0x1')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xda44('0x1')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xda44('0x1')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0xda44('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0xda44('0x1')],'defaultValue':0x5},'disabledCookie':{'type':Sequelize[_0xda44('0x6')],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0xda44('0x1')],'defaultValue':0x14}};
\ No newline at end of file
index 18414e5..551fadc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x521c=['jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','Setting','rawAttributes','fieldName','type','model','map','query','keys','attributes','fields','hasOwnProperty','limit','order','sort','where','filters','pick','merge','filter','options','includeAll','include','findAll','rows','show','params','intersection','body','find','addLogo','file','logo','filename','addLogoLogin','loginLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','existsSync','root','toLower','default_logo.svg','upperFirst','join','Sequelize','ValidationError','\x20not\x20found','download','defaultPreferred','defaultFavicon','default_loginLogo.svg','default','gdpr','addPreferred','getPreferred','default_preferred.png','custom','addFavicon','default_favicon.ico','getDate','utcOffset','format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x23b596,_0x52dae8){var _0x461761=function(_0x1fca6a){while(--_0x1fca6a){_0x23b596['push'](_0x23b596['shift']());}};_0x461761(++_0x52dae8);}(_0x521c,0x6b));var _0xc521=function(_0x2afef3,_0x30ac00){_0x2afef3=_0x2afef3-0x0;var _0x251479=_0x521c[_0x2afef3];return _0x251479;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc521('0x0'));var zipdir=require(_0xc521('0x1'));var jsonpatch=require(_0xc521('0x2'));var rp=require('request-promise');var moment=require(_0xc521('0x3'));var BPromise=require(_0xc521('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc521('0x5'));var sox=require(_0xc521('0x6'));var csv=require(_0xc521('0x7'));var ejs=require(_0xc521('0x8'));var fs=require('fs');var fs_extra=require(_0xc521('0x9'));var _=require(_0xc521('0xa'));var squel=require(_0xc521('0xb'));var crypto=require('crypto');var jsforce=require(_0xc521('0xc'));var deskjs=require(_0xc521('0xd'));var toCsv=require(_0xc521('0x7'));var querystring=require(_0xc521('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc521('0xf'));var qs=require(_0xc521('0x10'));var as=require(_0xc521('0x11'));var hardwareService=require(_0xc521('0x12'));var logger=require(_0xc521('0x13'))('api');var utils=require(_0xc521('0x14'));var config=require(_0xc521('0x15'));var licenseUtil=require(_0xc521('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0xc521('0x17'));var client=jayson[_0xc521('0x18')][_0xc521('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x1cffa4,_0x1e5766,_0x39303a,_0x4b7f0b){return new BPromise(function(_0x22b051,_0x4ae970){var _0x417385=_0x4b7f0b||client;return _0x417385[_0xc521('0x1a')](_0x1cffa4,_0x39303a)[_0xc521('0x1b')](function(_0xc5764e){logger[_0xc521('0x1c')](_0xc521('0x1d'),_0x1e5766,_0xc521('0x1e'));logger['debug'](_0xc521('0x1f'),_0x1e5766,_0xc521('0x1e'),JSON[_0xc521('0x20')](_0xc5764e));if(_0xc5764e[_0xc521('0x21')]){if(_0xc5764e[_0xc521('0x21')][_0xc521('0x22')]===0x1f4){logger[_0xc521('0x21')](_0xc521('0x1d'),_0x1e5766,_0xc5764e[_0xc521('0x21')][_0xc521('0x23')]);return _0x4ae970(_0xc5764e[_0xc521('0x21')][_0xc521('0x23')]);}logger[_0xc521('0x21')](_0xc521('0x1d'),_0x1e5766,_0xc5764e[_0xc521('0x21')][_0xc521('0x23')]);return _0x22b051(_0xc5764e[_0xc521('0x21')]['message']);}else{logger['info'](_0xc521('0x1d'),_0x1e5766,_0xc521('0x1e'));_0x22b051(_0xc5764e[_0xc521('0x24')][_0xc521('0x23')]);}})[_0xc521('0x25')](function(_0x302df9){logger['error'](_0xc521('0x1d'),_0x1e5766,_0x302df9);_0x4ae970(_0x302df9);});});}function respondWithStatusCode(_0x4c068d,_0x20f25a){_0x20f25a=_0x20f25a||0xcc;return function(_0x506f2c){if(_0x506f2c){return _0x4c068d['sendStatus'](_0x20f25a);}return _0x4c068d[_0xc521('0x26')](_0x20f25a)[_0xc521('0x27')]();};}function respondWithResult(_0x1df406,_0x4227e5){_0x4227e5=_0x4227e5||0xc8;return function(_0x2732b4){if(_0x2732b4){return _0x1df406[_0xc521('0x26')](_0x4227e5)[_0xc521('0x28')](_0x2732b4);}};}function respondWithFilteredResult(_0x538d37,_0x44dd9d){return function(_0x3696d3){if(_0x3696d3){var _0x3f8a6c=typeof _0x44dd9d[_0xc521('0x29')]===_0xc521('0x2a')&&typeof _0x44dd9d['limit']==='undefined';var _0x19a52d=_0x3696d3[_0xc521('0x2b')];var _0x1a5d01=_0x3f8a6c?0x0:_0x44dd9d[_0xc521('0x29')];var _0x57cef8=_0x3f8a6c?_0x3696d3[_0xc521('0x2b')]:_0x44dd9d['offset']+_0x44dd9d['limit'];var _0x10f904;if(_0x57cef8>=_0x19a52d){_0x57cef8=_0x19a52d;_0x10f904=0xc8;}else{_0x10f904=0xce;}_0x538d37[_0xc521('0x26')](_0x10f904);return _0x538d37['set'](_0xc521('0x2c'),_0x1a5d01+'-'+_0x57cef8+'/'+_0x19a52d)[_0xc521('0x28')](_0x3696d3);}return null;};}function patchUpdates(_0x4bcd32){return function(_0xf78384){try{jsonpatch[_0xc521('0x2d')](_0xf78384,_0x4bcd32,!![]);}catch(_0x155c58){return BPromise[_0xc521('0x2e')](_0x155c58);}return _0xf78384[_0xc521('0x2f')]();};}function saveUpdates(_0x2c319c,_0x197df5){return function(_0x5706bc){if(_0x5706bc){return _0x5706bc[_0xc521('0x30')](_0x2c319c)[_0xc521('0x1b')](function(_0x26500d){return _0x26500d;});}return null;};}function removeEntity(_0x5e1467,_0x247a2e){return function(_0x9e9983){if(_0x9e9983){return _0x9e9983[_0xc521('0x31')]()[_0xc521('0x1b')](function(){_0x5e1467[_0xc521('0x26')](0xcc)[_0xc521('0x27')]();});}};}function handleEntityNotFound(_0x44013d,_0x314560){return function(_0x12254e){if(!_0x12254e){_0x44013d['sendStatus'](0x194);}return _0x12254e;};}function handleError(_0x32330f,_0xc45060){_0xc45060=_0xc45060||0x1f4;return function(_0xed5c4e){logger[_0xc521('0x21')](_0xed5c4e[_0xc521('0x32')]);if(_0xed5c4e['name']){delete _0xed5c4e[_0xc521('0x33')];}_0x32330f[_0xc521('0x26')](_0xc45060)[_0xc521('0x34')](_0xed5c4e);};}exports[_0xc521('0x35')]=function(_0x4a3208,_0x2db32d){var _0x3e76d9={},_0x36ab90={},_0x119a50={'count':0x0,'rows':[]};var _0x2f1602=_['map'](db[_0xc521('0x36')][_0xc521('0x37')],function(_0xb91a00){return{'name':_0xb91a00[_0xc521('0x38')],'type':_0xb91a00[_0xc521('0x39')]['key']};});_0x36ab90[_0xc521('0x3a')]=_[_0xc521('0x3b')](_0x2f1602,_0xc521('0x33'));_0x36ab90[_0xc521('0x3c')]=_[_0xc521('0x3d')](_0x4a3208[_0xc521('0x3c')]);_0x36ab90['filters']=_['intersection'](_0x36ab90[_0xc521('0x3a')],_0x36ab90[_0xc521('0x3c')]);_0x3e76d9[_0xc521('0x3e')]=_['intersection'](_0x36ab90[_0xc521('0x3a')],qs[_0xc521('0x3f')](_0x4a3208['query'][_0xc521('0x3f')]));_0x3e76d9['attributes']=_0x3e76d9[_0xc521('0x3e')]['length']?_0x3e76d9['attributes']:_0x36ab90['model'];if(!_0x4a3208[_0xc521('0x3c')][_0xc521('0x40')]('nolimit')){_0x3e76d9[_0xc521('0x41')]=qs[_0xc521('0x41')](_0x4a3208[_0xc521('0x3c')][_0xc521('0x41')]);_0x3e76d9[_0xc521('0x29')]=qs[_0xc521('0x29')](_0x4a3208[_0xc521('0x3c')][_0xc521('0x29')]);}_0x3e76d9[_0xc521('0x42')]=qs['sort'](_0x4a3208[_0xc521('0x3c')][_0xc521('0x43')]);_0x3e76d9[_0xc521('0x44')]=qs[_0xc521('0x45')](_[_0xc521('0x46')](_0x4a3208['query'],_0x36ab90[_0xc521('0x45')]),_0x2f1602);if(_0x4a3208[_0xc521('0x3c')]['filter']){_0x3e76d9[_0xc521('0x44')]=_[_0xc521('0x47')](_0x3e76d9[_0xc521('0x44')],{'$or':_[_0xc521('0x3b')](_0x2f1602,function(_0x1920d6){if(_0x1920d6['type']!=='VIRTUAL'){var _0x4ead80={};_0x4ead80[_0x1920d6[_0xc521('0x33')]]={'$like':'%'+_0x4a3208[_0xc521('0x3c')][_0xc521('0x48')]+'%'};return _0x4ead80;}})});}_0x3e76d9=_['merge']({},_0x3e76d9,_0x4a3208[_0xc521('0x49')]);var _0x332fc2={'where':_0x3e76d9[_0xc521('0x44')]};return db[_0xc521('0x36')][_0xc521('0x2b')](_0x332fc2)[_0xc521('0x1b')](function(_0x5c965b){_0x119a50[_0xc521('0x2b')]=_0x5c965b;if(_0x4a3208[_0xc521('0x3c')][_0xc521('0x4a')]){_0x3e76d9[_0xc521('0x4b')]=[{'all':!![]}];}return db[_0xc521('0x36')][_0xc521('0x4c')](_0x3e76d9);})[_0xc521('0x1b')](function(_0x40a57c){_0x119a50[_0xc521('0x4d')]=_0x40a57c;return _0x119a50;})[_0xc521('0x1b')](respondWithFilteredResult(_0x2db32d,_0x3e76d9))[_0xc521('0x25')](handleError(_0x2db32d,null));};exports[_0xc521('0x4e')]=function(_0x22bb2b,_0x3306fb){var _0x49571d={'raw':![],'where':{'id':_0x22bb2b[_0xc521('0x4f')]['id']}},_0x9ce2ee={};_0x9ce2ee['model']=_['keys'](db['Setting'][_0xc521('0x37')]);_0x9ce2ee[_0xc521('0x3c')]=_[_0xc521('0x3d')](_0x22bb2b['query']);_0x9ce2ee[_0xc521('0x45')]=_['intersection'](_0x9ce2ee[_0xc521('0x3a')],_0x9ce2ee[_0xc521('0x3c')]);_0x49571d[_0xc521('0x3e')]=_[_0xc521('0x50')](_0x9ce2ee[_0xc521('0x3a')],qs[_0xc521('0x3f')](_0x22bb2b[_0xc521('0x3c')]['fields']));_0x49571d['attributes']=_0x49571d[_0xc521('0x3e')]['length']?_0x49571d['attributes']:_0x9ce2ee[_0xc521('0x3a')];if(_0x22bb2b[_0xc521('0x3c')][_0xc521('0x4a')]){_0x49571d['include']=[{'all':!![]}];}_0x49571d=_['merge']({},_0x49571d,_0x22bb2b[_0xc521('0x49')]);return db[_0xc521('0x36')]['find'](_0x49571d)[_0xc521('0x1b')](handleEntityNotFound(_0x3306fb,null))[_0xc521('0x1b')](respondWithResult(_0x3306fb,null))[_0xc521('0x25')](handleError(_0x3306fb,null));};exports[_0xc521('0x30')]=function(_0x3557a5,_0x33dac7){if(_0x3557a5[_0xc521('0x51')]['id']){delete _0x3557a5[_0xc521('0x51')]['id'];}return db[_0xc521('0x36')][_0xc521('0x52')]({'where':{'id':_0x3557a5[_0xc521('0x4f')]['id']}})['then'](handleEntityNotFound(_0x33dac7,null))[_0xc521('0x1b')](saveUpdates(_0x3557a5[_0xc521('0x51')],null))[_0xc521('0x1b')](respondWithResult(_0x33dac7,null))[_0xc521('0x25')](handleError(_0x33dac7,null));};exports[_0xc521('0x53')]=function(_0x449843,_0x45d389,_0x3d7607){if(_0x449843[_0xc521('0x54')]&&_0x449843[_0xc521('0x54')]['filename']){_0x449843[_0xc521('0x51')][_0xc521('0x55')]=_0x449843[_0xc521('0x54')][_0xc521('0x56')];}return db[_0xc521('0x36')][_0xc521('0x52')]({'where':{'id':_0x449843[_0xc521('0x4f')]['id']}})['then'](handleEntityNotFound(_0x45d389,null))[_0xc521('0x1b')](saveUpdates(_0x449843[_0xc521('0x51')],null))[_0xc521('0x1b')](respondWithResult(_0x45d389,null))['catch'](handleError(_0x45d389,null));};exports[_0xc521('0x57')]=function(_0x102781,_0x4b643b,_0x2a9601){if(_0x102781[_0xc521('0x54')]&&_0x102781[_0xc521('0x54')][_0xc521('0x56')]){_0x102781[_0xc521('0x51')][_0xc521('0x58')]=_0x102781[_0xc521('0x54')][_0xc521('0x56')];}return db['Setting']['find']({'where':{'id':_0x102781['params']['id']}})[_0xc521('0x1b')](handleEntityNotFound(_0x4b643b,null))[_0xc521('0x1b')](saveUpdates(_0x102781['body'],null))['then'](respondWithResult(_0x4b643b,null))[_0xc521('0x25')](handleError(_0x4b643b,null));};var utilLicense=require(_0xc521('0x16'));exports['getLogo']=function(_0x1ad590,_0x4f6658,_0x253419){var _0x21a707=_0xc521('0x59');var _0x476e8e={'custom':![]};return utilLicense[_0xc521('0x5a')]()[_0xc521('0x1b')](function(_0x490c49){if(_0x490c49){_0x476e8e=_0x490c49;}return db[_0xc521('0x36')]['find']({'where':{'id':_0x1ad590['params']['id']},'attributes':[_0xc521('0x55'),_0xc521('0x58'),_0xc521('0x5b'),_0xc521('0x5c'),_0xc521('0x5d'),_0xc521('0x5e'),'defaultPreferred','defaultFavicon'],'raw':!![]});})[_0xc521('0x1b')](handleEntityNotFound(_0x4f6658,null))['then'](function(_0x565140){if(_0x565140){var _0x148f33=_0x565140[_0xc521('0x55')]&&fs[_0xc521('0x5f')](path['join'](config[_0xc521('0x60')],_0x21a707,_[_0xc521('0x61')](_0x565140['logo'])))?path['join'](config[_0xc521('0x60')],_0x21a707,_[_0xc521('0x61')](_0x565140['logo'])):path['join'](config[_0xc521('0x60')],_0x21a707,_['toLower'](_0xc521('0x62')));var _0x21c128='default'+_[_0xc521('0x63')](_0xc521('0x55'));if(_0x565140[_0x21c128]||!_0x476e8e['custom']){_0x148f33=path[_0xc521('0x64')](config[_0xc521('0x60')],_0x21a707,_[_0xc521('0x61')]('default_logo.svg'));}if(!fs[_0xc521('0x5f')](_0x148f33)){throw new db[(_0xc521('0x65'))][(_0xc521('0x66'))](_[_0xc521('0x63')](_0xc521('0x55'))+_0xc521('0x67'));}return _0x4f6658[_0xc521('0x68')](_0x148f33);}})['catch'](handleError(_0x4f6658,null));};var utilLicense=require(_0xc521('0x16'));exports['getLogoLogin']=function(_0x24fd25,_0x588105,_0x47b408){var _0x325581=_0xc521('0x59');var _0x47f39c={'custom':![]};return utilLicense[_0xc521('0x5a')]()[_0xc521('0x1b')](function(_0x3e5acd){if(_0x3e5acd){_0x47f39c=_0x3e5acd;}return db[_0xc521('0x36')][_0xc521('0x52')]({'where':{'id':_0x24fd25[_0xc521('0x4f')]['id']},'attributes':[_0xc521('0x55'),_0xc521('0x58'),_0xc521('0x5b'),_0xc521('0x5c'),_0xc521('0x5d'),_0xc521('0x5e'),_0xc521('0x69'),_0xc521('0x6a')],'raw':!![]});})[_0xc521('0x1b')](handleEntityNotFound(_0x588105,null))[_0xc521('0x1b')](function(_0x409b5d){if(_0x409b5d){var _0x331ba3=_0x409b5d[_0xc521('0x58')]&&fs[_0xc521('0x5f')](path[_0xc521('0x64')](config[_0xc521('0x60')],_0x325581,_[_0xc521('0x61')](_0x409b5d[_0xc521('0x58')])))?path[_0xc521('0x64')](config[_0xc521('0x60')],_0x325581,_[_0xc521('0x61')](_0x409b5d['loginLogo'])):path[_0xc521('0x64')](config[_0xc521('0x60')],_0x325581,_[_0xc521('0x61')](_0xc521('0x6b')));var _0x5e048f=_0xc521('0x6c')+_[_0xc521('0x63')](_0xc521('0x58'));if(_0x409b5d[_0x5e048f]||!_0x47f39c['custom']){_0x331ba3=path[_0xc521('0x64')](config[_0xc521('0x60')],_0x325581,_[_0xc521('0x61')](_0xc521('0x6b')));}if(!fs[_0xc521('0x5f')](_0x331ba3)){throw new db[(_0xc521('0x65'))]['ValidationError'](_['upperFirst'](_0xc521('0x58'))+_0xc521('0x67'));}return _0x588105[_0xc521('0x68')](_0x331ba3);}})[_0xc521('0x25')](handleError(_0x588105,null));};exports[_0xc521('0x6d')]=function(_0x23762d,_0x465a14){return db['Setting'][_0xc521('0x52')]({'where':{'id':_0x23762d[_0xc521('0x4f')]['id']},'attributes':['securePassword']})[_0xc521('0x1b')](respondWithResult(_0x465a14,null))['catch'](handleError(_0x465a14,null));};exports[_0xc521('0x6e')]=function(_0x105ac1,_0x49aa77,_0xf79b0){if(_0x105ac1[_0xc521('0x54')]&&_0x105ac1['file'][_0xc521('0x56')]){_0x105ac1[_0xc521('0x51')]['preferred']=_0x105ac1['file'][_0xc521('0x56')];}return db[_0xc521('0x36')][_0xc521('0x52')]({'where':{'id':_0x105ac1['params']['id']}})['then'](handleEntityNotFound(_0x49aa77,null))[_0xc521('0x1b')](saveUpdates(_0x105ac1[_0xc521('0x51')],null))[_0xc521('0x1b')](respondWithResult(_0x49aa77,null))[_0xc521('0x25')](handleError(_0x49aa77,null));};var utilLicense=require(_0xc521('0x16'));exports[_0xc521('0x6f')]=function(_0xc8df77,_0xfa5166,_0xaf7717){var _0x583a21=_0xc521('0x59');var _0xdd5b09={'custom':![]};return utilLicense[_0xc521('0x5a')]()[_0xc521('0x1b')](function(_0x4a919b){if(_0x4a919b){_0xdd5b09=_0x4a919b;}return db[_0xc521('0x36')][_0xc521('0x52')]({'where':{'id':_0xc8df77[_0xc521('0x4f')]['id']},'attributes':[_0xc521('0x55'),_0xc521('0x58'),_0xc521('0x5b'),_0xc521('0x5c'),_0xc521('0x5d'),'defaultLoginLogo',_0xc521('0x69'),_0xc521('0x6a')],'raw':!![]});})[_0xc521('0x1b')](handleEntityNotFound(_0xfa5166,null))[_0xc521('0x1b')](function(_0xff07bd){if(_0xff07bd){var _0x6235b2=_0xff07bd[_0xc521('0x5b')]&&fs['existsSync'](path[_0xc521('0x64')](config[_0xc521('0x60')],_0x583a21,_[_0xc521('0x61')](_0xff07bd[_0xc521('0x5b')])))?path[_0xc521('0x64')](config[_0xc521('0x60')],_0x583a21,_[_0xc521('0x61')](_0xff07bd['preferred'])):path[_0xc521('0x64')](config['root'],_0x583a21,_[_0xc521('0x61')](_0xc521('0x70')));var _0x8704b3=_0xc521('0x6c')+_[_0xc521('0x63')](_0xc521('0x5b'));if(_0xff07bd[_0x8704b3]||!_0xdd5b09[_0xc521('0x71')]||!_0xdd5b09[_0xc521('0x5b')]){_0x6235b2=path[_0xc521('0x64')](config['root'],_0x583a21,_[_0xc521('0x61')]('default_preferred.png'));}if(!fs[_0xc521('0x5f')](_0x6235b2)){throw new db['Sequelize']['ValidationError'](_[_0xc521('0x63')](_0xc521('0x5b'))+_0xc521('0x67'));}return _0xfa5166['download'](_0x6235b2);}})[_0xc521('0x25')](handleError(_0xfa5166,null));};exports[_0xc521('0x72')]=function(_0x32658a,_0x32ce57,_0x36301c){if(_0x32658a[_0xc521('0x54')]&&_0x32658a[_0xc521('0x54')][_0xc521('0x56')]){_0x32658a[_0xc521('0x51')][_0xc521('0x5c')]=_0x32658a['file']['filename'];}return db['Setting'][_0xc521('0x52')]({'where':{'id':_0x32658a['params']['id']}})[_0xc521('0x1b')](handleEntityNotFound(_0x32ce57,null))[_0xc521('0x1b')](saveUpdates(_0x32658a['body'],null))['then'](respondWithResult(_0x32ce57,null))[_0xc521('0x25')](handleError(_0x32ce57,null));};var utilLicense=require('../../config/license/util');exports['getFavicon']=function(_0x260a33,_0x592d6d,_0x2526f9){var _0x420bcf=_0xc521('0x59');var _0x29a110={'custom':![]};return utilLicense[_0xc521('0x5a')]()[_0xc521('0x1b')](function(_0x1e2e58){if(_0x1e2e58){_0x29a110=_0x1e2e58;}return db['Setting'][_0xc521('0x52')]({'where':{'id':_0x260a33[_0xc521('0x4f')]['id']},'attributes':[_0xc521('0x55'),_0xc521('0x58'),_0xc521('0x5b'),'favicon',_0xc521('0x5d'),_0xc521('0x5e'),_0xc521('0x69'),_0xc521('0x6a')],'raw':!![]});})[_0xc521('0x1b')](handleEntityNotFound(_0x592d6d,null))[_0xc521('0x1b')](function(_0x4cb7f8){if(_0x4cb7f8){var _0x341dcd=_0x4cb7f8['favicon']&&fs[_0xc521('0x5f')](path[_0xc521('0x64')](config[_0xc521('0x60')],_0x420bcf,_[_0xc521('0x61')](_0x4cb7f8[_0xc521('0x5c')])))?path[_0xc521('0x64')](config[_0xc521('0x60')],_0x420bcf,_[_0xc521('0x61')](_0x4cb7f8[_0xc521('0x5c')])):path[_0xc521('0x64')](config[_0xc521('0x60')],_0x420bcf,_['toLower'](_0xc521('0x73')));var _0x392667=_0xc521('0x6c')+_['upperFirst'](_0xc521('0x5c'));if(_0x4cb7f8[_0x392667]||!_0x29a110[_0xc521('0x71')]){_0x341dcd=path[_0xc521('0x64')](config['root'],_0x420bcf,_[_0xc521('0x61')]('default_favicon.ico'));}if(!fs[_0xc521('0x5f')](_0x341dcd)){throw new db[(_0xc521('0x65'))][(_0xc521('0x66'))](_[_0xc521('0x63')](_0xc521('0x5c'))+_0xc521('0x67'));}return _0x592d6d['download'](_0x341dcd);}})[_0xc521('0x25')](handleError(_0x592d6d,null));};exports[_0xc521('0x74')]=function(_0x3924b9,_0x57b546){var _0x4656be={'offset':moment()[_0xc521('0x75')]()};_0x4656be['now']=moment()['utcOffset'](_0x4656be[_0xc521('0x29')])[_0xc521('0x76')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x57b546[_0xc521('0x26')](0xc8)['send'](_0x4656be);};
\ No newline at end of file
+var _0x59c3=['attributes','fields','query','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','findAll','rows','show','params','length','include','merge','find','update','body','addLogo','file','filename','logo','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','join','root','toLower','default_logo.svg','default','upperFirst','existsSync','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','default_loginLogo.svg','addPreferred','default_preferred.png','custom','addFavicon','getFavicon','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','count','set','apply','reject','save','stack','name','send','map','Setting','rawAttributes','type','key','model','keys','filters','intersection'];(function(_0x4b4f24,_0x5654a8){var _0x1c13d4=function(_0x4940bf){while(--_0x4940bf){_0x4b4f24['push'](_0x4b4f24['shift']());}};_0x1c13d4(++_0x5654a8);}(_0x59c3,0x133));var _0x359c=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0x59c3[_0x5e36d1];return _0x950b9e;};'use strict';var emlformat=require(_0x359c('0x0'));var rimraf=require(_0x359c('0x1'));var zipdir=require(_0x359c('0x2'));var jsonpatch=require(_0x359c('0x3'));var rp=require(_0x359c('0x4'));var moment=require(_0x359c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x359c('0x6'));var util=require(_0x359c('0x7'));var path=require(_0x359c('0x8'));var sox=require(_0x359c('0x9'));var csv=require(_0x359c('0xa'));var ejs=require(_0x359c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x359c('0xc'));var squel=require('squel');var crypto=require(_0x359c('0xd'));var jsforce=require(_0x359c('0xe'));var deskjs=require(_0x359c('0xf'));var toCsv=require(_0x359c('0xa'));var querystring=require('querystring');var Papa=require(_0x359c('0x10'));var Redis=require('ioredis');var authService=require(_0x359c('0x11'));var qs=require(_0x359c('0x12'));var as=require(_0x359c('0x13'));var hardwareService=require(_0x359c('0x14'));var logger=require(_0x359c('0x15'))(_0x359c('0x16'));var utils=require('../../config/utils');var config=require(_0x359c('0x17'));var licenseUtil=require(_0x359c('0x18'));var db=require(_0x359c('0x19'))['db'];var jayson=require(_0x359c('0x1a'));var client=jayson[_0x359c('0x1b')][_0x359c('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x1a9d72,_0x246dc1,_0x3a73ca,_0x4413ce){return new BPromise(function(_0x2cf668,_0xd07946){var _0x5a9200=_0x4413ce||client;return _0x5a9200[_0x359c('0x1d')](_0x1a9d72,_0x3a73ca)[_0x359c('0x1e')](function(_0x4d4860){logger[_0x359c('0x1f')](_0x359c('0x20'),_0x246dc1,_0x359c('0x21'));logger[_0x359c('0x22')](_0x359c('0x23'),_0x246dc1,_0x359c('0x21'),JSON[_0x359c('0x24')](_0x4d4860));if(_0x4d4860[_0x359c('0x25')]){if(_0x4d4860[_0x359c('0x25')][_0x359c('0x26')]===0x1f4){logger[_0x359c('0x25')](_0x359c('0x20'),_0x246dc1,_0x4d4860[_0x359c('0x25')][_0x359c('0x27')]);return _0xd07946(_0x4d4860[_0x359c('0x25')][_0x359c('0x27')]);}logger[_0x359c('0x25')](_0x359c('0x20'),_0x246dc1,_0x4d4860['error'][_0x359c('0x27')]);return _0x2cf668(_0x4d4860['error'][_0x359c('0x27')]);}else{logger['info'](_0x359c('0x20'),_0x246dc1,_0x359c('0x21'));_0x2cf668(_0x4d4860[_0x359c('0x28')][_0x359c('0x27')]);}})[_0x359c('0x29')](function(_0x2d90a4){logger[_0x359c('0x25')](_0x359c('0x20'),_0x246dc1,_0x2d90a4);_0xd07946(_0x2d90a4);});});}function respondWithStatusCode(_0x15b7c7,_0x1d29df){_0x1d29df=_0x1d29df||0xcc;return function(_0x3e9cdf){if(_0x3e9cdf){return _0x15b7c7[_0x359c('0x2a')](_0x1d29df);}return _0x15b7c7[_0x359c('0x2b')](_0x1d29df)[_0x359c('0x2c')]();};}function respondWithResult(_0x33318f,_0xf6f24){_0xf6f24=_0xf6f24||0xc8;return function(_0x4fbc28){if(_0x4fbc28){return _0x33318f[_0x359c('0x2b')](_0xf6f24)[_0x359c('0x2d')](_0x4fbc28);}};}function respondWithFilteredResult(_0x35569d,_0x540fc9){return function(_0x1436a8){if(_0x1436a8){var _0x7e9a5b=typeof _0x540fc9[_0x359c('0x2e')]==='undefined'&&typeof _0x540fc9[_0x359c('0x2f')]==='undefined';var _0x450e19=_0x1436a8[_0x359c('0x30')];var _0x1d52ac=_0x7e9a5b?0x0:_0x540fc9[_0x359c('0x2e')];var _0x512fc0=_0x7e9a5b?_0x1436a8[_0x359c('0x30')]:_0x540fc9[_0x359c('0x2e')]+_0x540fc9[_0x359c('0x2f')];var _0x2e8836;if(_0x512fc0>=_0x450e19){_0x512fc0=_0x450e19;_0x2e8836=0xc8;}else{_0x2e8836=0xce;}_0x35569d[_0x359c('0x2b')](_0x2e8836);return _0x35569d[_0x359c('0x31')]('Content-Range',_0x1d52ac+'-'+_0x512fc0+'/'+_0x450e19)['json'](_0x1436a8);}return null;};}function patchUpdates(_0x594392){return function(_0x1aec6c){try{jsonpatch[_0x359c('0x32')](_0x1aec6c,_0x594392,!![]);}catch(_0x575a51){return BPromise[_0x359c('0x33')](_0x575a51);}return _0x1aec6c[_0x359c('0x34')]();};}function saveUpdates(_0x6b6340,_0x36704b){return function(_0x44e313){if(_0x44e313){return _0x44e313['update'](_0x6b6340)[_0x359c('0x1e')](function(_0x166928){return _0x166928;});}return null;};}function removeEntity(_0x333bb,_0x4a3cde){return function(_0x5efaf6){if(_0x5efaf6){return _0x5efaf6['destroy']()[_0x359c('0x1e')](function(){_0x333bb[_0x359c('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10cb00,_0x3a8ca7){return function(_0x1b9355){if(!_0x1b9355){_0x10cb00[_0x359c('0x2a')](0x194);}return _0x1b9355;};}function handleError(_0x155f4a,_0x3c8e4a){_0x3c8e4a=_0x3c8e4a||0x1f4;return function(_0x499a52){logger[_0x359c('0x25')](_0x499a52[_0x359c('0x35')]);if(_0x499a52[_0x359c('0x36')]){delete _0x499a52[_0x359c('0x36')];}_0x155f4a[_0x359c('0x2b')](_0x3c8e4a)[_0x359c('0x37')](_0x499a52);};}exports['index']=function(_0x2bb0b8,_0x56d8d3){var _0x5366e0={},_0x1cf3f8={},_0x476c8c={'count':0x0,'rows':[]};var _0x4db6e7=_[_0x359c('0x38')](db[_0x359c('0x39')][_0x359c('0x3a')],function(_0x207ddb){return{'name':_0x207ddb['fieldName'],'type':_0x207ddb[_0x359c('0x3b')][_0x359c('0x3c')]};});_0x1cf3f8[_0x359c('0x3d')]=_['map'](_0x4db6e7,_0x359c('0x36'));_0x1cf3f8['query']=_[_0x359c('0x3e')](_0x2bb0b8['query']);_0x1cf3f8[_0x359c('0x3f')]=_[_0x359c('0x40')](_0x1cf3f8['model'],_0x1cf3f8['query']);_0x5366e0[_0x359c('0x41')]=_[_0x359c('0x40')](_0x1cf3f8[_0x359c('0x3d')],qs[_0x359c('0x42')](_0x2bb0b8[_0x359c('0x43')][_0x359c('0x42')]));_0x5366e0[_0x359c('0x41')]=_0x5366e0[_0x359c('0x41')]['length']?_0x5366e0[_0x359c('0x41')]:_0x1cf3f8[_0x359c('0x3d')];if(!_0x2bb0b8[_0x359c('0x43')][_0x359c('0x44')](_0x359c('0x45'))){_0x5366e0[_0x359c('0x2f')]=qs[_0x359c('0x2f')](_0x2bb0b8[_0x359c('0x43')][_0x359c('0x2f')]);_0x5366e0['offset']=qs[_0x359c('0x2e')](_0x2bb0b8[_0x359c('0x43')][_0x359c('0x2e')]);}_0x5366e0[_0x359c('0x46')]=qs[_0x359c('0x47')](_0x2bb0b8[_0x359c('0x43')]['sort']);_0x5366e0[_0x359c('0x48')]=qs['filters'](_[_0x359c('0x49')](_0x2bb0b8['query'],_0x1cf3f8['filters']),_0x4db6e7);if(_0x2bb0b8[_0x359c('0x43')][_0x359c('0x4a')]){_0x5366e0[_0x359c('0x48')]=_['merge'](_0x5366e0[_0x359c('0x48')],{'$or':_[_0x359c('0x38')](_0x4db6e7,function(_0x1eeac2){if(_0x1eeac2['type']!==_0x359c('0x4b')){var _0x24412c={};_0x24412c[_0x1eeac2['name']]={'$like':'%'+_0x2bb0b8[_0x359c('0x43')][_0x359c('0x4a')]+'%'};return _0x24412c;}})});}_0x5366e0=_['merge']({},_0x5366e0,_0x2bb0b8[_0x359c('0x4c')]);var _0x2a6afb={'where':_0x5366e0['where']};return db['Setting'][_0x359c('0x30')](_0x2a6afb)[_0x359c('0x1e')](function(_0x10181e){_0x476c8c[_0x359c('0x30')]=_0x10181e;if(_0x2bb0b8['query']['includeAll']){_0x5366e0['include']=[{'all':!![]}];}return db[_0x359c('0x39')][_0x359c('0x4d')](_0x5366e0);})[_0x359c('0x1e')](function(_0x85e034){_0x476c8c[_0x359c('0x4e')]=_0x85e034;return _0x476c8c;})[_0x359c('0x1e')](respondWithFilteredResult(_0x56d8d3,_0x5366e0))[_0x359c('0x29')](handleError(_0x56d8d3,null));};exports[_0x359c('0x4f')]=function(_0x7efc5a,_0x3e061e){var _0x5d332a={'raw':![],'where':{'id':_0x7efc5a[_0x359c('0x50')]['id']}},_0x16a807={};_0x16a807[_0x359c('0x3d')]=_[_0x359c('0x3e')](db[_0x359c('0x39')][_0x359c('0x3a')]);_0x16a807['query']=_['keys'](_0x7efc5a[_0x359c('0x43')]);_0x16a807[_0x359c('0x3f')]=_[_0x359c('0x40')](_0x16a807['model'],_0x16a807[_0x359c('0x43')]);_0x5d332a['attributes']=_['intersection'](_0x16a807[_0x359c('0x3d')],qs[_0x359c('0x42')](_0x7efc5a['query'][_0x359c('0x42')]));_0x5d332a[_0x359c('0x41')]=_0x5d332a['attributes'][_0x359c('0x51')]?_0x5d332a[_0x359c('0x41')]:_0x16a807['model'];if(_0x7efc5a[_0x359c('0x43')]['includeAll']){_0x5d332a[_0x359c('0x52')]=[{'all':!![]}];}_0x5d332a=_[_0x359c('0x53')]({},_0x5d332a,_0x7efc5a[_0x359c('0x4c')]);return db['Setting'][_0x359c('0x54')](_0x5d332a)[_0x359c('0x1e')](handleEntityNotFound(_0x3e061e,null))[_0x359c('0x1e')](respondWithResult(_0x3e061e,null))[_0x359c('0x29')](handleError(_0x3e061e,null));};exports[_0x359c('0x55')]=function(_0xee8cb3,_0x48f39c){if(_0xee8cb3[_0x359c('0x56')]['id']){delete _0xee8cb3[_0x359c('0x56')]['id'];}return db['Setting'][_0x359c('0x54')]({'where':{'id':_0xee8cb3[_0x359c('0x50')]['id']}})[_0x359c('0x1e')](handleEntityNotFound(_0x48f39c,null))[_0x359c('0x1e')](saveUpdates(_0xee8cb3[_0x359c('0x56')],null))[_0x359c('0x1e')](respondWithResult(_0x48f39c,null))['catch'](handleError(_0x48f39c,null));};exports[_0x359c('0x57')]=function(_0x23869b,_0x197d9f,_0x37387b){if(_0x23869b['file']&&_0x23869b[_0x359c('0x58')][_0x359c('0x59')]){_0x23869b['body'][_0x359c('0x5a')]=_0x23869b['file'][_0x359c('0x59')];}return db['Setting']['find']({'where':{'id':_0x23869b[_0x359c('0x50')]['id']}})[_0x359c('0x1e')](handleEntityNotFound(_0x197d9f,null))['then'](saveUpdates(_0x23869b['body'],null))[_0x359c('0x1e')](respondWithResult(_0x197d9f,null))[_0x359c('0x29')](handleError(_0x197d9f,null));};exports['addLogoLogin']=function(_0x563de,_0x509c81,_0x1d18d7){if(_0x563de['file']&&_0x563de['file'][_0x359c('0x59')]){_0x563de[_0x359c('0x56')][_0x359c('0x5b')]=_0x563de[_0x359c('0x58')]['filename'];}return db[_0x359c('0x39')][_0x359c('0x54')]({'where':{'id':_0x563de[_0x359c('0x50')]['id']}})['then'](handleEntityNotFound(_0x509c81,null))[_0x359c('0x1e')](saveUpdates(_0x563de[_0x359c('0x56')],null))[_0x359c('0x1e')](respondWithResult(_0x509c81,null))['catch'](handleError(_0x509c81,null));};var utilLicense=require('../../config/license/util');exports[_0x359c('0x5c')]=function(_0x886c4c,_0x3e9a60,_0x2d8ed9){var _0x4f5278=_0x359c('0x5d');var _0x11dc9b={'custom':![]};return utilLicense[_0x359c('0x5e')]()['then'](function(_0x459d62){if(_0x459d62){_0x11dc9b=_0x459d62;}return db[_0x359c('0x39')][_0x359c('0x54')]({'where':{'id':_0x886c4c[_0x359c('0x50')]['id']},'attributes':[_0x359c('0x5a'),_0x359c('0x5b'),_0x359c('0x5f'),_0x359c('0x60'),_0x359c('0x61'),_0x359c('0x62'),_0x359c('0x63'),_0x359c('0x64')],'raw':!![]});})['then'](handleEntityNotFound(_0x3e9a60,null))[_0x359c('0x1e')](function(_0x16c5c8){if(_0x16c5c8){var _0x303f19=_0x16c5c8[_0x359c('0x5a')]&&fs['existsSync'](path[_0x359c('0x65')](config['root'],_0x4f5278,_['toLower'](_0x16c5c8[_0x359c('0x5a')])))?path[_0x359c('0x65')](config['root'],_0x4f5278,_['toLower'](_0x16c5c8[_0x359c('0x5a')])):path[_0x359c('0x65')](config[_0x359c('0x66')],_0x4f5278,_[_0x359c('0x67')](_0x359c('0x68')));var _0x2f20e7=_0x359c('0x69')+_[_0x359c('0x6a')](_0x359c('0x5a'));if(_0x16c5c8[_0x2f20e7]||!_0x11dc9b['custom']){_0x303f19=path[_0x359c('0x65')](config[_0x359c('0x66')],_0x4f5278,_[_0x359c('0x67')]('default_logo.svg'));}if(!fs[_0x359c('0x6b')](_0x303f19)){throw new db[(_0x359c('0x6c'))][(_0x359c('0x6d'))](_[_0x359c('0x6a')](_0x359c('0x5a'))+_0x359c('0x6e'));}return _0x3e9a60[_0x359c('0x6f')](_0x303f19);}})[_0x359c('0x29')](handleError(_0x3e9a60,null));};var utilLicense=require(_0x359c('0x18'));exports[_0x359c('0x70')]=function(_0x190ac9,_0x10cbbf,_0x252e31){var _0x53851c=_0x359c('0x5d');var _0x4c8a42={'custom':![]};return utilLicense[_0x359c('0x5e')]()[_0x359c('0x1e')](function(_0x549ba6){if(_0x549ba6){_0x4c8a42=_0x549ba6;}return db[_0x359c('0x39')][_0x359c('0x54')]({'where':{'id':_0x190ac9[_0x359c('0x50')]['id']},'attributes':['logo',_0x359c('0x5b'),_0x359c('0x5f'),'favicon',_0x359c('0x61'),_0x359c('0x62'),'defaultPreferred','defaultFavicon'],'raw':!![]});})[_0x359c('0x1e')](handleEntityNotFound(_0x10cbbf,null))[_0x359c('0x1e')](function(_0x541545){if(_0x541545){var _0x2f34dd=_0x541545[_0x359c('0x5b')]&&fs['existsSync'](path[_0x359c('0x65')](config[_0x359c('0x66')],_0x53851c,_[_0x359c('0x67')](_0x541545[_0x359c('0x5b')])))?path[_0x359c('0x65')](config[_0x359c('0x66')],_0x53851c,_[_0x359c('0x67')](_0x541545[_0x359c('0x5b')])):path[_0x359c('0x65')](config[_0x359c('0x66')],_0x53851c,_['toLower'](_0x359c('0x71')));var _0x334a79=_0x359c('0x69')+_[_0x359c('0x6a')]('loginLogo');if(_0x541545[_0x334a79]||!_0x4c8a42['custom']){_0x2f34dd=path[_0x359c('0x65')](config[_0x359c('0x66')],_0x53851c,_[_0x359c('0x67')]('default_loginLogo.svg'));}if(!fs[_0x359c('0x6b')](_0x2f34dd)){throw new db[(_0x359c('0x6c'))][(_0x359c('0x6d'))](_['upperFirst']('loginLogo')+_0x359c('0x6e'));}return _0x10cbbf['download'](_0x2f34dd);}})[_0x359c('0x29')](handleError(_0x10cbbf,null));};exports['gdpr']=function(_0x54dd6b,_0x147ee1){return db[_0x359c('0x39')][_0x359c('0x54')]({'where':{'id':_0x54dd6b[_0x359c('0x50')]['id']},'attributes':['securePassword']})[_0x359c('0x1e')](respondWithResult(_0x147ee1,null))['catch'](handleError(_0x147ee1,null));};exports[_0x359c('0x72')]=function(_0x238b08,_0xdf72dc,_0x384bb1){if(_0x238b08[_0x359c('0x58')]&&_0x238b08[_0x359c('0x58')][_0x359c('0x59')]){_0x238b08[_0x359c('0x56')][_0x359c('0x5f')]=_0x238b08[_0x359c('0x58')][_0x359c('0x59')];}return db[_0x359c('0x39')]['find']({'where':{'id':_0x238b08[_0x359c('0x50')]['id']}})[_0x359c('0x1e')](handleEntityNotFound(_0xdf72dc,null))[_0x359c('0x1e')](saveUpdates(_0x238b08[_0x359c('0x56')],null))[_0x359c('0x1e')](respondWithResult(_0xdf72dc,null))[_0x359c('0x29')](handleError(_0xdf72dc,null));};var utilLicense=require('../../config/license/util');exports['getPreferred']=function(_0xbc9a88,_0x3b88d4,_0x3f279d){var _0x1d17e4='server/files/images/logos';var _0xc15db3={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x58f191){if(_0x58f191){_0xc15db3=_0x58f191;}return db[_0x359c('0x39')][_0x359c('0x54')]({'where':{'id':_0xbc9a88[_0x359c('0x50')]['id']},'attributes':[_0x359c('0x5a'),'loginLogo',_0x359c('0x5f'),'favicon',_0x359c('0x61'),_0x359c('0x62'),_0x359c('0x63'),_0x359c('0x64')],'raw':!![]});})[_0x359c('0x1e')](handleEntityNotFound(_0x3b88d4,null))[_0x359c('0x1e')](function(_0xc22e3c){if(_0xc22e3c){var _0x3e6ced=_0xc22e3c[_0x359c('0x5f')]&&fs[_0x359c('0x6b')](path[_0x359c('0x65')](config[_0x359c('0x66')],_0x1d17e4,_['toLower'](_0xc22e3c[_0x359c('0x5f')])))?path[_0x359c('0x65')](config[_0x359c('0x66')],_0x1d17e4,_[_0x359c('0x67')](_0xc22e3c['preferred'])):path[_0x359c('0x65')](config[_0x359c('0x66')],_0x1d17e4,_[_0x359c('0x67')](_0x359c('0x73')));var _0x2db711=_0x359c('0x69')+_[_0x359c('0x6a')]('preferred');if(_0xc22e3c[_0x2db711]||!_0xc15db3[_0x359c('0x74')]||!_0xc15db3[_0x359c('0x5f')]){_0x3e6ced=path[_0x359c('0x65')](config[_0x359c('0x66')],_0x1d17e4,_['toLower'](_0x359c('0x73')));}if(!fs[_0x359c('0x6b')](_0x3e6ced)){throw new db['Sequelize'][(_0x359c('0x6d'))](_[_0x359c('0x6a')]('preferred')+_0x359c('0x6e'));}return _0x3b88d4[_0x359c('0x6f')](_0x3e6ced);}})[_0x359c('0x29')](handleError(_0x3b88d4,null));};exports[_0x359c('0x75')]=function(_0x234455,_0x4a40f2,_0x610cae){if(_0x234455['file']&&_0x234455[_0x359c('0x58')][_0x359c('0x59')]){_0x234455['body'][_0x359c('0x60')]=_0x234455['file'][_0x359c('0x59')];}return db[_0x359c('0x39')][_0x359c('0x54')]({'where':{'id':_0x234455[_0x359c('0x50')]['id']}})[_0x359c('0x1e')](handleEntityNotFound(_0x4a40f2,null))[_0x359c('0x1e')](saveUpdates(_0x234455[_0x359c('0x56')],null))['then'](respondWithResult(_0x4a40f2,null))[_0x359c('0x29')](handleError(_0x4a40f2,null));};var utilLicense=require(_0x359c('0x18'));exports[_0x359c('0x76')]=function(_0x4c4c5b,_0x395a8c,_0x2bb1db){var _0x424b6e='server/files/images/logos';var _0x5eeae2={'custom':![]};return utilLicense[_0x359c('0x5e')]()[_0x359c('0x1e')](function(_0x264126){if(_0x264126){_0x5eeae2=_0x264126;}return db[_0x359c('0x39')][_0x359c('0x54')]({'where':{'id':_0x4c4c5b[_0x359c('0x50')]['id']},'attributes':['logo','loginLogo',_0x359c('0x5f'),_0x359c('0x60'),_0x359c('0x61'),'defaultLoginLogo',_0x359c('0x63'),_0x359c('0x64')],'raw':!![]});})[_0x359c('0x1e')](handleEntityNotFound(_0x395a8c,null))[_0x359c('0x1e')](function(_0x56fd56){if(_0x56fd56){var _0x477389=_0x56fd56[_0x359c('0x60')]&&fs[_0x359c('0x6b')](path[_0x359c('0x65')](config['root'],_0x424b6e,_['toLower'](_0x56fd56[_0x359c('0x60')])))?path[_0x359c('0x65')](config[_0x359c('0x66')],_0x424b6e,_[_0x359c('0x67')](_0x56fd56[_0x359c('0x60')])):path[_0x359c('0x65')](config[_0x359c('0x66')],_0x424b6e,_['toLower']('default_favicon.ico'));var _0x1a5b01=_0x359c('0x69')+_['upperFirst']('favicon');if(_0x56fd56[_0x1a5b01]||!_0x5eeae2[_0x359c('0x74')]){_0x477389=path['join'](config[_0x359c('0x66')],_0x424b6e,_[_0x359c('0x67')]('default_favicon.ico'));}if(!fs['existsSync'](_0x477389)){throw new db['Sequelize'][(_0x359c('0x6d'))](_[_0x359c('0x6a')]('favicon')+_0x359c('0x6e'));}return _0x395a8c[_0x359c('0x6f')](_0x477389);}})['catch'](handleError(_0x395a8c,null));};exports[_0x359c('0x77')]=function(_0xbf776e,_0x1c8a2d){var _0x590c18={'offset':moment()[_0x359c('0x78')]()};_0x590c18[_0x359c('0x79')]=moment()['utcOffset'](_0x590c18[_0x359c('0x2e')])[_0x359c('0x7a')](_0x359c('0x7b'));return _0x1c8a2d[_0x359c('0x2b')](0xc8)[_0x359c('0x37')](_0x590c18);};
\ No newline at end of file
index b082aad..40f9748 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x380575,_0xc72d46){var _0x15080a=function(_0x5f1ac5){while(--_0x5f1ac5){_0x380575['push'](_0x380575['shift']());}};_0x15080a(++_0xc72d46);}(_0x008c,0x188));var _0xc008=function(_0x5e9e5f,_0x19aeeb){_0x5e9e5f=_0x5e9e5f-0x0;var _0x4944f5=_0x008c[_0x5e9e5f];return _0x4944f5;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Setting',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x34e8=['settings','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports','Setting'];(function(_0x4d0a55,_0x4fb443){var _0x1e28e4=function(_0x1aa110){while(--_0x1aa110){_0x4d0a55['push'](_0x4d0a55['shift']());}};_0x1e28e4(++_0x4fb443);}(_0x34e8,0x12c));var _0x834e=function(_0x268827,_0x4179ba){_0x268827=_0x268827-0x0;var _0x1dd722=_0x34e8[_0x268827];return _0x1dd722;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 601ffdd..1e7a108 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f81=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','ShowSetting','Setting','find','options','attributes','include','map','model','lodash'];(function(_0x316904,_0x1e8b77){var _0xfa9a21=function(_0x2b75ae){while(--_0x2b75ae){_0x316904['push'](_0x316904['shift']());}};_0xfa9a21(++_0x1e8b77);}(_0x5f81,0x1a3));var _0x15f8=function(_0x34e993,_0x483e10){_0x34e993=_0x34e993-0x0;var _0x25d6a5=_0x5f81[_0x34e993];return _0x25d6a5;};'use strict';var _=require(_0x15f8('0x0'));var util=require('util');var moment=require(_0x15f8('0x1'));var BPromise=require(_0x15f8('0x2'));var rs=require(_0x15f8('0x3'));var fs=require('fs');var Redis=require(_0x15f8('0x4'));var db=require(_0x15f8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x15f8('0x6'))(_0x15f8('0x7'));var config=require(_0x15f8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x15f8('0x9')][_0x15f8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52bfa6,_0x3e4382,_0x4ef36e){return new BPromise(function(_0x122d01,_0x3301d1){return client[_0x15f8('0xb')](_0x52bfa6,_0x4ef36e)[_0x15f8('0xc')](function(_0x9cc06e){logger[_0x15f8('0xd')](_0x15f8('0xe'),_0x3e4382,_0x15f8('0xf'));logger[_0x15f8('0x10')]('Setting,\x20%s,\x20%s,\x20%s',_0x3e4382,_0x15f8('0xf'),JSON[_0x15f8('0x11')](_0x9cc06e));if(_0x9cc06e[_0x15f8('0x12')]){if(_0x9cc06e[_0x15f8('0x12')]['code']===0x1f4){logger[_0x15f8('0x12')]('Setting,\x20%s,\x20%s',_0x3e4382,_0x9cc06e['error'][_0x15f8('0x13')]);return _0x3301d1(_0x9cc06e[_0x15f8('0x12')]['message']);}logger[_0x15f8('0x12')](_0x15f8('0xe'),_0x3e4382,_0x9cc06e[_0x15f8('0x12')][_0x15f8('0x13')]);return _0x122d01(_0x9cc06e[_0x15f8('0x12')][_0x15f8('0x13')]);}else{logger[_0x15f8('0xd')](_0x15f8('0xe'),_0x3e4382,_0x15f8('0xf'));_0x122d01(_0x9cc06e[_0x15f8('0x14')][_0x15f8('0x13')]);}})[_0x15f8('0x15')](function(_0x3fa14b){logger[_0x15f8('0x12')](_0x15f8('0xe'),_0x3e4382,_0x3fa14b);_0x3301d1(_0x3fa14b);});});}exports[_0x15f8('0x16')]=function(_0x19b5fb){var _0x1795cc=this;return new Promise(function(_0x15157d,_0x4665e){return db[_0x15f8('0x17')][_0x15f8('0x18')]({'raw':_0x19b5fb[_0x15f8('0x19')]?_0x19b5fb[_0x15f8('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x19b5fb[_0x15f8('0x19')]?_0x19b5fb[_0x15f8('0x19')]['where']||null:null,'attributes':_0x19b5fb[_0x15f8('0x19')]?_0x19b5fb[_0x15f8('0x19')][_0x15f8('0x1a')]||null:null,'include':_0x19b5fb[_0x15f8('0x19')]?_0x19b5fb[_0x15f8('0x19')][_0x15f8('0x1b')]?_['map'](_0x19b5fb[_0x15f8('0x19')][_0x15f8('0x1b')],function(_0x282de9){return{'model':db[_0x282de9['model']],'as':_0x282de9['as'],'attributes':_0x282de9[_0x15f8('0x1a')],'include':_0x282de9['include']?_[_0x15f8('0x1c')](_0x282de9[_0x15f8('0x1b')],function(_0xcb33c8){return{'model':db[_0xcb33c8[_0x15f8('0x1d')]],'as':_0xcb33c8['as'],'attributes':_0xcb33c8['attributes'],'include':_0xcb33c8[_0x15f8('0x1b')]?_['map'](_0xcb33c8[_0x15f8('0x1b')],function(_0x8a266){return{'model':db[_0x8a266[_0x15f8('0x1d')]],'as':_0x8a266['as'],'attributes':_0x8a266[_0x15f8('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x15f8('0xc')](function(_0x35c77a){logger[_0x15f8('0xd')](_0x15f8('0x16'),_0x19b5fb);logger[_0x15f8('0x10')](_0x15f8('0x16'),_0x19b5fb,JSON[_0x15f8('0x11')](_0x35c77a));_0x15157d(_0x35c77a);})[_0x15f8('0x15')](function(_0x1fdf0b){logger[_0x15f8('0x12')](_0x15f8('0x16'),_0x1fdf0b[_0x15f8('0x13')],_0x19b5fb);_0x4665e(_0x1795cc[_0x15f8('0x12')](0x1f4,_0x1fdf0b[_0x15f8('0x13')]));});});};
\ No newline at end of file
+var _0x0f7f=['Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowSetting','Setting','find','options','raw','where','attributes','map','model','include','then','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xbea98c,_0x481a4c){var _0x59d5ab=function(_0x49dff7){while(--_0x49dff7){_0xbea98c['push'](_0xbea98c['shift']());}};_0x59d5ab(++_0x481a4c);}(_0x0f7f,0x13a));var _0xf0f7=function(_0x3cae7d,_0x349b33){_0x3cae7d=_0x3cae7d-0x0;var _0x3c4876=_0x0f7f[_0x3cae7d];return _0x3c4876;};'use strict';var _=require(_0xf0f7('0x0'));var util=require(_0xf0f7('0x1'));var moment=require(_0xf0f7('0x2'));var BPromise=require('bluebird');var rs=require(_0xf0f7('0x3'));var fs=require('fs');var Redis=require(_0xf0f7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf0f7('0x5'));var logger=require(_0xf0f7('0x6'))(_0xf0f7('0x7'));var config=require(_0xf0f7('0x8'));var jayson=require(_0xf0f7('0x9'));var client=jayson[_0xf0f7('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8f9777,_0x5764b5,_0x56b202){return new BPromise(function(_0x11e0b2,_0x56f925){return client[_0xf0f7('0xb')](_0x8f9777,_0x56b202)['then'](function(_0x29a366){logger[_0xf0f7('0xc')](_0xf0f7('0xd'),_0x5764b5,_0xf0f7('0xe'));logger[_0xf0f7('0xf')](_0xf0f7('0x10'),_0x5764b5,_0xf0f7('0xe'),JSON[_0xf0f7('0x11')](_0x29a366));if(_0x29a366[_0xf0f7('0x12')]){if(_0x29a366[_0xf0f7('0x12')]['code']===0x1f4){logger['error'](_0xf0f7('0xd'),_0x5764b5,_0x29a366[_0xf0f7('0x12')]['message']);return _0x56f925(_0x29a366[_0xf0f7('0x12')][_0xf0f7('0x13')]);}logger['error'](_0xf0f7('0xd'),_0x5764b5,_0x29a366[_0xf0f7('0x12')]['message']);return _0x11e0b2(_0x29a366['error'][_0xf0f7('0x13')]);}else{logger[_0xf0f7('0xc')]('Setting,\x20%s,\x20%s',_0x5764b5,_0xf0f7('0xe'));_0x11e0b2(_0x29a366[_0xf0f7('0x14')]['message']);}})[_0xf0f7('0x15')](function(_0x1b05ef){logger[_0xf0f7('0x12')](_0xf0f7('0xd'),_0x5764b5,_0x1b05ef);_0x56f925(_0x1b05ef);});});}exports[_0xf0f7('0x16')]=function(_0x518060){var _0x16a313=this;return new Promise(function(_0x191987,_0x3f806e){return db[_0xf0f7('0x17')][_0xf0f7('0x18')]({'raw':_0x518060[_0xf0f7('0x19')]?_0x518060['options'][_0xf0f7('0x1a')]===undefined?!![]:![]:!![],'where':_0x518060[_0xf0f7('0x19')]?_0x518060[_0xf0f7('0x19')][_0xf0f7('0x1b')]||null:null,'attributes':_0x518060[_0xf0f7('0x19')]?_0x518060[_0xf0f7('0x19')][_0xf0f7('0x1c')]||null:null,'include':_0x518060['options']?_0x518060[_0xf0f7('0x19')]['include']?_[_0xf0f7('0x1d')](_0x518060[_0xf0f7('0x19')]['include'],function(_0x1f825c){return{'model':db[_0x1f825c[_0xf0f7('0x1e')]],'as':_0x1f825c['as'],'attributes':_0x1f825c[_0xf0f7('0x1c')],'include':_0x1f825c[_0xf0f7('0x1f')]?_['map'](_0x1f825c[_0xf0f7('0x1f')],function(_0x46865d){return{'model':db[_0x46865d[_0xf0f7('0x1e')]],'as':_0x46865d['as'],'attributes':_0x46865d[_0xf0f7('0x1c')],'include':_0x46865d[_0xf0f7('0x1f')]?_[_0xf0f7('0x1d')](_0x46865d[_0xf0f7('0x1f')],function(_0x2468f8){return{'model':db[_0x2468f8[_0xf0f7('0x1e')]],'as':_0x2468f8['as'],'attributes':_0x2468f8['attributes']};}):[]};}):[]};}):[]:[]})[_0xf0f7('0x20')](function(_0x36689a){logger[_0xf0f7('0xc')](_0xf0f7('0x16'),_0x518060);logger[_0xf0f7('0xf')](_0xf0f7('0x16'),_0x518060,JSON[_0xf0f7('0x11')](_0x36689a));_0x191987(_0x36689a);})[_0xf0f7('0x15')](function(_0xd4cf1f){logger['error'](_0xf0f7('0x16'),_0xd4cf1f[_0xf0f7('0x13')],_0x518060);_0x3f806e(_0x16a313[_0xf0f7('0x12')](0x1f4,_0xd4cf1f[_0xf0f7('0x13')]));});});};
\ No newline at end of file
index c06d665..ebd2a36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x28de90,_0x2d07a1){var _0x36fe28=function(_0x1b4498){while(--_0x1b4498){_0x28de90['push'](_0x28de90['shift']());}};_0x36fe28(++_0x2d07a1);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x1b2cd4,_0x220d18){_0x1b2cd4=_0x1b2cd4-0x0;var _0x3e2ff5=_0x7fbe[_0x1b2cd4];return _0x3e2ff5;};'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
+var _0x1cb9=['/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/users','post','create','addAnswer','/:id/notify','notify','/:id/applications','/:id/send','/:id/status','status','addAgents','put','update','delete','destroy','removeDispositions','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1cb9,0x14e));var _0x91cb=function(_0x7f8e76,_0x3082c5){_0x7f8e76=_0x7f8e76-0x0;var _0x42f199=_0x1cb9[_0x7f8e76];return _0x42f199;};'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('0x8')](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x8')](_0x91cb('0x11'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x8')]('/:id/applications',auth[_0x91cb('0x9')](),controller[_0x91cb('0x13')]);router['get'](_0x91cb('0x14'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x15')]);router[_0x91cb('0x8')]('/:id/status',controller['statusGet']);router[_0x91cb('0x8')](_0x91cb('0x16'),auth['isAuthenticated'](),controller['getAgents']);router[_0x91cb('0x17')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x18')]);router['post'](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller['addDisposition']);router[_0x91cb('0x17')](_0x91cb('0x11'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x19')]);router['post'](_0x91cb('0x1a'),controller[_0x91cb('0x1b')]);router['post'](_0x91cb('0x1c'),auth['isAuthenticated'](),controller['addApplications']);router[_0x91cb('0x17')](_0x91cb('0x1d'),auth['isAuthenticated'](),controller['send']);router['post'](_0x91cb('0x1e'),controller[_0x91cb('0x1f')]);router[_0x91cb('0x17')](_0x91cb('0x16'),auth['isAuthenticated'](),controller[_0x91cb('0x20')]);router[_0x91cb('0x21')](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0x22')]);router[_0x91cb('0x23')](_0x91cb('0xd'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x24')]);router[_0x91cb('0x23')](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x25')]);router['delete']('/:id/canned_answers',auth[_0x91cb('0x9')](),controller['removeAnswers']);router[_0x91cb('0x23')](_0x91cb('0x16'),auth[_0x91cb('0x9')](),controller['removeAgents']);module[_0x91cb('0x26')]=router;
\ No newline at end of file
index 194efc6..ec7952e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fd4=['infobip','intelepeer','ENUM','BOOLEAN','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','generate','twilio','skebby','connectel','clicksend','clickatell','bandwidth','csc'];(function(_0xc7f23c,_0x2be758){var _0x4b4def=function(_0x1b3aab){while(--_0x1b3aab){_0xc7f23c['push'](_0xc7f23c['shift']());}};_0x4b4def(++_0x2be758);}(_0x5fd4,0x79));var _0x45fd=function(_0x6419cb,_0x22ea7){_0x6419cb=_0x6419cb-0x0;var _0x240703=_0x5fd4[_0x6419cb];return _0x240703;};'use strict';var Sequelize=require(_0x45fd('0x0'));var rs=require('randomstring');module[_0x45fd('0x1')]={'name':{'type':Sequelize[_0x45fd('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x45fd('0x2')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x45fd('0x2')],'defaultValue':function(){return rs[_0x45fd('0x3')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x45fd('0x4'),_0x45fd('0x5'),_0x45fd('0x6'),_0x45fd('0x7'),'plivo',_0x45fd('0x8'),_0x45fd('0x9'),_0x45fd('0xa'),_0x45fd('0xb'),_0x45fd('0xc'))},'accountSid':{'type':Sequelize[_0x45fd('0x2')]},'authId':{'type':Sequelize[_0x45fd('0x2')]},'authToken':{'type':Sequelize[_0x45fd('0x2')]},'smsMethod':{'type':Sequelize[_0x45fd('0xd')]('SI','TI','GP')},'username':{'type':Sequelize[_0x45fd('0x2')]},'password':{'type':Sequelize[_0x45fd('0x2')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0x45fd('0x2')]},'senderString':{'type':Sequelize[_0x45fd('0x2')]},'deliveryReport':{'type':Sequelize[_0x45fd('0xe')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x45fd('0xf');}},'notificationSound':{'type':Sequelize[_0x45fd('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x45fd('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x45fd('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x45fd('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x45fd('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x45fd('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x45fd('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x45fd('0x10')],'comment':_0x45fd('0x11')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x45fd('0x12'),'set':function(_0x5a87d0){if(!_0x5a87d0)this[_0x45fd('0x13')](_0x45fd('0x14'),null);this['setDataValue'](_0x45fd('0x15'),_0x5a87d0);}}};
\ No newline at end of file
+var _0x9984=['STRING','name','skebby','connectel','plivo','clickatell','intelepeer','ENUM','BOOLEAN','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x9984,0xf5));var _0x4998=function(_0x2f398b,_0xa4afdd){_0x2f398b=_0x2f398b-0x0;var _0x36c75a=_0x9984[_0x2f398b];return _0x36c75a;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x4998('0x0'));module[_0x4998('0x1')]={'name':{'type':Sequelize[_0x4998('0x2')],'unique':_0x4998('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x4998('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM']('twilio',_0x4998('0x4'),_0x4998('0x5'),'clicksend',_0x4998('0x6'),_0x4998('0x7'),'bandwidth','csc','infobip',_0x4998('0x8'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0x4998('0x2')]},'authToken':{'type':Sequelize[_0x4998('0x2')]},'smsMethod':{'type':Sequelize[_0x4998('0x9')]('SI','TI','GP')},'username':{'type':Sequelize[_0x4998('0x2')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x4998('0x2')]},'applicationId':{'type':Sequelize[_0x4998('0x2')]},'accountId':{'type':Sequelize[_0x4998('0x2')]},'senderString':{'type':Sequelize[_0x4998('0x2')]},'deliveryReport':{'type':Sequelize[_0x4998('0xa')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x4998('0xb')],'defaultValue':function(){return _0x4998('0xc');}},'notificationSound':{'type':Sequelize[_0x4998('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4998('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4998('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4998('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4998('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x4998('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x4998('0xe')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x4998('0xf'),'set':function(_0x24911b){if(!_0x24911b)this[_0x4998('0x10')](_0x4998('0x11'),null);this[_0x4998('0x10')](_0x4998('0x12'),_0x24911b);}}};
\ No newline at end of file
index cb949c0..1ca2c43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce6f=['skebby_dispatch_id','connectel','requestid','statusInt','status_code','DELIVERED','groupName','intelepeer','redif','skebby','error_code','DELIVERED_TO_GATEWAY','clickatell','message-delivered','DELIVRD','ACCEPTD','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','request','then','info','debug','request\x20sent','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','result','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','SmsAccount','includeAll','include','show','params','rawAttributes','find','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','describe','SmsAccountId','Disposition','create','getDispositions','findOne','keys','findAll','rows','removeDispositions','ids','CannedAnswer','pick','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','twilio','from','Body','messageId','sender','text','clicksend','message_id','plivo','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','fromNumber','replyMessageId','bandwidth','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','CmContact','Contacts','DESC','list','omit','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','SmsMessage','AttachmentId','UserId','agent','Start','startRouting','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect'];(function(_0x441e3a,_0x4fd2b1){var _0x55b3b8=function(_0x55c360){while(--_0x55c360){_0x441e3a['push'](_0x441e3a['shift']());}};_0x55b3b8(++_0x4fd2b1);}(_0xce6f,0x1db));var _0xfce6=function(_0x51dd57,_0x3c8e82){_0x51dd57=_0x51dd57-0x0;var _0x5e169a=_0xce6f[_0x51dd57];return _0x5e169a;};'use strict';var emlformat=require(_0xfce6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfce6('0x1'));var moment=require(_0xfce6('0x2'));var BPromise=require(_0xfce6('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfce6('0x4'));var sox=require(_0xfce6('0x5'));var csv=require(_0xfce6('0x6'));var ejs=require(_0xfce6('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfce6('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfce6('0x9'));var deskjs=require(_0xfce6('0xa'));var toCsv=require(_0xfce6('0x6'));var querystring=require('querystring');var Papa=require(_0xfce6('0xb'));var Redis=require(_0xfce6('0xc'));var authService=require(_0xfce6('0xd'));var qs=require(_0xfce6('0xe'));var as=require(_0xfce6('0xf'));var hardwareService=require(_0xfce6('0x10'));var logger=require(_0xfce6('0x11'))(_0xfce6('0x12'));var utils=require(_0xfce6('0x13'));var config=require(_0xfce6('0x14'));var licenseUtil=require(_0xfce6('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xfce6('0x16')](config[_0xfce6('0x17')],{'host':_0xfce6('0x18'),'port':0x18eb});var socket=require(_0xfce6('0x19'))(new Redis(config['redis']));require('./smsAccount.socket')[_0xfce6('0x1a')](socket);var jayson=require(_0xfce6('0x1b'));var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0xcd265c,_0x5dd1c5,_0x2ed2b4,_0x1c52ff){return new BPromise(function(_0x4fd1b2,_0x591e7a){var _0x4e69e8=_0x1c52ff||client;return _0x4e69e8[_0xfce6('0x1c')](_0xcd265c,_0x2ed2b4)[_0xfce6('0x1d')](function(_0x5d7717){logger[_0xfce6('0x1e')]('SmsAccount,\x20%s,\x20%s',_0x5dd1c5,'request\x20sent');logger[_0xfce6('0x1f')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5dd1c5,_0xfce6('0x20'),JSON[_0xfce6('0x21')](_0x5d7717));if(_0x5d7717[_0xfce6('0x22')]){if(_0x5d7717['error'][_0xfce6('0x23')]===0x1f4){logger[_0xfce6('0x22')](_0xfce6('0x24'),_0x5dd1c5,_0x5d7717['error']['message']);return _0x591e7a(_0x5d7717[_0xfce6('0x22')][_0xfce6('0x25')]);}logger['error'](_0xfce6('0x24'),_0x5dd1c5,_0x5d7717['error'][_0xfce6('0x25')]);return _0x4fd1b2(_0x5d7717[_0xfce6('0x22')][_0xfce6('0x25')]);}else{logger[_0xfce6('0x1e')](_0xfce6('0x24'),_0x5dd1c5,'request\x20sent');_0x4fd1b2(_0x5d7717[_0xfce6('0x26')]['message']);}})['catch'](function(_0x21561e){logger['error'](_0xfce6('0x24'),_0x5dd1c5,_0x21561e);_0x591e7a(_0x21561e);});});}function respondWithStatusCode(_0x3555ea,_0x1900da){_0x1900da=_0x1900da||0xcc;return function(_0x368b90){if(_0x368b90){return _0x3555ea[_0xfce6('0x27')](_0x1900da);}return _0x3555ea[_0xfce6('0x28')](_0x1900da)[_0xfce6('0x29')]();};}function respondWithResult(_0x5e3ce5,_0x16b921){_0x16b921=_0x16b921||0xc8;return function(_0x4361ec){if(_0x4361ec){return _0x5e3ce5[_0xfce6('0x28')](_0x16b921)[_0xfce6('0x2a')](_0x4361ec);}};}function respondWithFilteredResult(_0x6e3c4d,_0x21c5f7){return function(_0x17af9a){if(_0x17af9a){var _0x3fc91b=typeof _0x21c5f7['offset']===_0xfce6('0x2b')&&typeof _0x21c5f7[_0xfce6('0x2c')]===_0xfce6('0x2b');var _0x5eecc1=_0x17af9a[_0xfce6('0x2d')];var _0x38201b=_0x3fc91b?0x0:_0x21c5f7[_0xfce6('0x2e')];var _0x27b9d3=_0x3fc91b?_0x17af9a[_0xfce6('0x2d')]:_0x21c5f7[_0xfce6('0x2e')]+_0x21c5f7[_0xfce6('0x2c')];var _0x2c9db7;if(_0x27b9d3>=_0x5eecc1){_0x27b9d3=_0x5eecc1;_0x2c9db7=0xc8;}else{_0x2c9db7=0xce;}_0x6e3c4d['status'](_0x2c9db7);return _0x6e3c4d[_0xfce6('0x2f')](_0xfce6('0x30'),_0x38201b+'-'+_0x27b9d3+'/'+_0x5eecc1)[_0xfce6('0x2a')](_0x17af9a);}return null;};}function patchUpdates(_0x6565bd){return function(_0x4a93b2){try{jsonpatch[_0xfce6('0x31')](_0x4a93b2,_0x6565bd,!![]);}catch(_0xdef738){return BPromise[_0xfce6('0x32')](_0xdef738);}return _0x4a93b2[_0xfce6('0x33')]();};}function saveUpdates(_0x5da567,_0xb61e14){return function(_0x54d3b1){if(_0x54d3b1){return _0x54d3b1[_0xfce6('0x34')](_0x5da567)['then'](function(_0x4a5bed){return _0x4a5bed;});}return null;};}function removeEntity(_0x16bf89,_0x6a46a){return function(_0x212b7f){if(_0x212b7f){return _0x212b7f[_0xfce6('0x35')]()[_0xfce6('0x1d')](function(){var _0x203f1b=_0x212b7f[_0xfce6('0x36')]({'plain':!![]});var _0x51c1eb=_0xfce6('0x37');return db[_0xfce6('0x38')]['destroy']({'where':{'type':_0x51c1eb,'resourceId':_0x203f1b['id']}})['then'](function(){return _0x212b7f;});})[_0xfce6('0x1d')](function(){_0x16bf89[_0xfce6('0x28')](0xcc)[_0xfce6('0x29')]();});}};}function handleEntityNotFound(_0x1005a8,_0x172264){return function(_0x4e1ae9){if(!_0x4e1ae9){_0x1005a8['sendStatus'](0x194);}return _0x4e1ae9;};}function handleError(_0xb6b79d,_0x556381){_0x556381=_0x556381||0x1f4;return function(_0x41ab6b){logger[_0xfce6('0x22')](_0x41ab6b[_0xfce6('0x39')]);if(_0x41ab6b[_0xfce6('0x3a')]){delete _0x41ab6b[_0xfce6('0x3a')];}_0xb6b79d[_0xfce6('0x28')](_0x556381)[_0xfce6('0x3b')](_0x41ab6b);};}exports[_0xfce6('0x3c')]=function(_0x22c8dd,_0x303a0d){var _0x513fb6={'include':[{'model':db[_0xfce6('0x3d')],'as':_0xfce6('0x3e')}]},_0x2173c4={},_0x5c14a6={'count':0x0,'rows':[]};var _0x159ed0=_['map'](db['SmsAccount']['rawAttributes'],function(_0x512337){return{'name':_0x512337['fieldName'],'type':_0x512337[_0xfce6('0x3f')][_0xfce6('0x40')]};});_0x2173c4[_0xfce6('0x41')]=_['map'](_0x159ed0,_0xfce6('0x3a'));_0x2173c4['query']=_['keys'](_0x22c8dd[_0xfce6('0x42')]);_0x2173c4[_0xfce6('0x43')]=_[_0xfce6('0x44')](_0x2173c4[_0xfce6('0x41')],_0x2173c4[_0xfce6('0x42')]);_0x513fb6[_0xfce6('0x45')]=_['intersection'](_0x2173c4['model'],qs[_0xfce6('0x46')](_0x22c8dd[_0xfce6('0x42')]['fields']));_0x513fb6['attributes']=_0x513fb6['attributes'][_0xfce6('0x47')]?_0x513fb6['attributes']:_0x2173c4[_0xfce6('0x41')];if(!_0x22c8dd[_0xfce6('0x42')][_0xfce6('0x48')](_0xfce6('0x49'))){_0x513fb6['limit']=qs[_0xfce6('0x2c')](_0x22c8dd['query'][_0xfce6('0x2c')]);_0x513fb6['offset']=qs[_0xfce6('0x2e')](_0x22c8dd[_0xfce6('0x42')][_0xfce6('0x2e')]);}_0x513fb6[_0xfce6('0x4a')]=qs[_0xfce6('0x4b')](_0x22c8dd[_0xfce6('0x42')][_0xfce6('0x4b')]);_0x513fb6[_0xfce6('0x4c')]=qs[_0xfce6('0x43')](_['pick'](_0x22c8dd['query'],_0x2173c4[_0xfce6('0x43')]),_0x159ed0);if(_0x22c8dd['query'][_0xfce6('0x4d')]){_0x513fb6[_0xfce6('0x4c')]=_[_0xfce6('0x4e')](_0x513fb6[_0xfce6('0x4c')],{'$or':_[_0xfce6('0x4f')](_0x159ed0,function(_0xb5fc91){if(_0xb5fc91[_0xfce6('0x3f')]!==_0xfce6('0x50')){var _0x9af7cf={};_0x9af7cf[_0xb5fc91['name']]={'$like':'%'+_0x22c8dd[_0xfce6('0x42')][_0xfce6('0x4d')]+'%'};return _0x9af7cf;}})});}_0x513fb6=_[_0xfce6('0x4e')]({},_0x513fb6,_0x22c8dd[_0xfce6('0x51')]);var _0x427599={'where':_0x513fb6[_0xfce6('0x4c')]};return db[_0xfce6('0x52')][_0xfce6('0x2d')](_0x427599)[_0xfce6('0x1d')](function(_0x59ef0f){_0x5c14a6['count']=_0x59ef0f;if(_0x22c8dd[_0xfce6('0x42')][_0xfce6('0x53')]){_0x513fb6[_0xfce6('0x54')]=[{'all':!![]}];}return db['SmsAccount']['findAll'](_0x513fb6);})[_0xfce6('0x1d')](function(_0xecf75a){_0x5c14a6['rows']=_0xecf75a;return _0x5c14a6;})['then'](respondWithFilteredResult(_0x303a0d,_0x513fb6))['catch'](handleError(_0x303a0d,null));};exports[_0xfce6('0x55')]=function(_0x5ab8bf,_0x156089){var _0x5af219={'raw':![],'where':{'id':_0x5ab8bf[_0xfce6('0x56')]['id']},'include':[{'model':db['Pause'],'as':_0xfce6('0x3e')}]},_0x56abef={};_0x56abef['model']=_['keys'](db['SmsAccount'][_0xfce6('0x57')]);_0x56abef[_0xfce6('0x42')]=_['keys'](_0x5ab8bf[_0xfce6('0x42')]);_0x56abef['filters']=_[_0xfce6('0x44')](_0x56abef[_0xfce6('0x41')],_0x56abef[_0xfce6('0x42')]);_0x5af219[_0xfce6('0x45')]=_[_0xfce6('0x44')](_0x56abef[_0xfce6('0x41')],qs['fields'](_0x5ab8bf['query'][_0xfce6('0x46')]));_0x5af219[_0xfce6('0x45')]=_0x5af219[_0xfce6('0x45')][_0xfce6('0x47')]?_0x5af219['attributes']:_0x56abef[_0xfce6('0x41')];if(_0x5ab8bf[_0xfce6('0x42')][_0xfce6('0x53')]){_0x5af219['include']=[{'all':!![]}];}_0x5af219=_[_0xfce6('0x4e')]({},_0x5af219,_0x5ab8bf[_0xfce6('0x51')]);return db[_0xfce6('0x52')][_0xfce6('0x58')](_0x5af219)['then'](handleEntityNotFound(_0x156089,null))[_0xfce6('0x1d')](respondWithResult(_0x156089,null))[_0xfce6('0x59')](handleError(_0x156089,null));};exports['create']=function(_0x501e1f,_0x48254d){return db['SmsAccount']['create'](_0x501e1f[_0xfce6('0x5a')],{})[_0xfce6('0x1d')](function(_0x5d2c60){var _0x2a997b=_0x501e1f[_0xfce6('0x5b')][_0xfce6('0x36')]({'plain':!![]});if(!_0x2a997b)throw new Error(_0xfce6('0x5c'));if(_0x2a997b['role']===_0xfce6('0x5b')){var _0x57321c=_0x5d2c60[_0xfce6('0x36')]({'plain':!![]});var _0x1641db=_0xfce6('0x37');return db['UserProfileSection'][_0xfce6('0x58')]({'where':{'name':_0x1641db,'userProfileId':_0x2a997b[_0xfce6('0x5d')]},'raw':!![]})[_0xfce6('0x1d')](function(_0x20675a){if(_0x20675a&&_0x20675a[_0xfce6('0x5e')]===0x0){return db[_0xfce6('0x38')]['create']({'name':_0x57321c['name'],'resourceId':_0x57321c['id'],'type':_0x20675a[_0xfce6('0x3a')],'sectionId':_0x20675a['id']},{})[_0xfce6('0x1d')](function(){return _0x5d2c60;});}else{return _0x5d2c60;}})[_0xfce6('0x59')](function(_0x32163e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32163e);throw _0x32163e;});}return _0x5d2c60;})['then'](respondWithResult(_0x48254d,0xc9))[_0xfce6('0x59')](handleError(_0x48254d,null));};exports[_0xfce6('0x34')]=function(_0x38d30e,_0x2b3b34){if(_0x38d30e[_0xfce6('0x5a')]['id']){delete _0x38d30e[_0xfce6('0x5a')]['id'];}return db['SmsAccount'][_0xfce6('0x58')]({'where':{'id':_0x38d30e[_0xfce6('0x56')]['id']},'include':[{'model':db['Pause'],'as':_0xfce6('0x3e')}]})[_0xfce6('0x1d')](handleEntityNotFound(_0x2b3b34,null))[_0xfce6('0x1d')](saveUpdates(_0x38d30e[_0xfce6('0x5a')],null))[_0xfce6('0x1d')](respondWithResult(_0x2b3b34,null))[_0xfce6('0x59')](handleError(_0x2b3b34,null));};exports[_0xfce6('0x35')]=function(_0x563061,_0x5775c1){return db['SmsAccount'][_0xfce6('0x58')]({'where':{'id':_0x563061[_0xfce6('0x56')]['id']}})[_0xfce6('0x1d')](handleEntityNotFound(_0x5775c1,null))[_0xfce6('0x1d')](removeEntity(_0x5775c1,null))[_0xfce6('0x59')](handleError(_0x5775c1,null));};exports[_0xfce6('0x5f')]=function(_0xa4043e,_0x5cd4a3){return db[_0xfce6('0x52')]['describe']()[_0xfce6('0x1d')](respondWithResult(_0x5cd4a3,null))[_0xfce6('0x59')](handleError(_0x5cd4a3,null));};exports['addDisposition']=function(_0x28d7d9,_0x15901e,_0x571ad6){if(_0x28d7d9[_0xfce6('0x5a')]['id']){delete _0x28d7d9[_0xfce6('0x5a')]['id'];}return db['SmsAccount'][_0xfce6('0x58')]({'where':{'id':_0x28d7d9[_0xfce6('0x56')]['id']}})[_0xfce6('0x1d')](handleEntityNotFound(_0x15901e,null))[_0xfce6('0x1d')](function(_0x420ebc){if(_0x420ebc){_0x28d7d9['body'][_0xfce6('0x60')]=_0x420ebc['id'];return db[_0xfce6('0x61')][_0xfce6('0x62')](_0x28d7d9['body']);}})[_0xfce6('0x1d')](respondWithResult(_0x15901e,null))['catch'](handleError(_0x15901e,null));};exports[_0xfce6('0x63')]=function(_0x489735,_0x1e2d8d,_0x4ef657){var _0x38b80b={'raw':![],'where':{}};var _0x7d4c29={};var _0x4f74fa={'count':0x0,'rows':[]};return db[_0xfce6('0x52')][_0xfce6('0x64')]({'where':{'id':_0x489735[_0xfce6('0x56')]['id']}})['then'](handleEntityNotFound(_0x1e2d8d,null))[_0xfce6('0x1d')](function(_0x150416){if(_0x150416){_0x7d4c29[_0xfce6('0x41')]=_[_0xfce6('0x65')](db[_0xfce6('0x61')]['rawAttributes']);_0x7d4c29['query']=_[_0xfce6('0x65')](_0x489735['query']);_0x7d4c29['filters']=_[_0xfce6('0x44')](_0x7d4c29[_0xfce6('0x41')],_0x7d4c29[_0xfce6('0x42')]);_0x38b80b['attributes']=_[_0xfce6('0x44')](_0x7d4c29['model'],qs[_0xfce6('0x46')](_0x489735[_0xfce6('0x42')][_0xfce6('0x46')]));_0x38b80b[_0xfce6('0x45')]=_0x38b80b['attributes'][_0xfce6('0x47')]?_0x38b80b[_0xfce6('0x45')]:_0x7d4c29[_0xfce6('0x41')];if(!_0x489735['query'][_0xfce6('0x48')](_0xfce6('0x49'))){_0x38b80b[_0xfce6('0x2c')]=qs['limit'](_0x489735[_0xfce6('0x42')]['limit']);_0x38b80b[_0xfce6('0x2e')]=qs['offset'](_0x489735[_0xfce6('0x42')][_0xfce6('0x2e')]);}_0x38b80b[_0xfce6('0x4a')]=qs['sort'](_0x489735[_0xfce6('0x42')]['sort']);_0x38b80b[_0xfce6('0x4c')]=qs['filters'](_['pick'](_0x489735['query'],_0x7d4c29[_0xfce6('0x43')]));_0x38b80b['where'][_0xfce6('0x60')]=_0x150416['id'];if(_0x489735[_0xfce6('0x42')][_0xfce6('0x4d')]){_0x38b80b['where']=_['merge'](_0x38b80b[_0xfce6('0x4c')],{'$or':_[_0xfce6('0x4f')](_0x38b80b[_0xfce6('0x45')],function(_0x6b66a6){var _0x2c5aed={};_0x2c5aed[_0x6b66a6]={'$like':'%'+_0x489735[_0xfce6('0x42')][_0xfce6('0x4d')]+'%'};return _0x2c5aed;})});}_0x38b80b=_[_0xfce6('0x4e')]({},_0x38b80b,_0x489735[_0xfce6('0x51')]);return db[_0xfce6('0x61')]['count']({'where':_0x38b80b[_0xfce6('0x4c')]})[_0xfce6('0x1d')](function(_0x177017){_0x4f74fa[_0xfce6('0x2d')]=_0x177017;if(_0x489735[_0xfce6('0x42')][_0xfce6('0x53')]){_0x38b80b['include']=[{'all':!![]}];}return db[_0xfce6('0x61')][_0xfce6('0x66')](_0x38b80b);})[_0xfce6('0x1d')](function(_0x2839c6){_0x4f74fa[_0xfce6('0x67')]=_0x2839c6;return _0x4f74fa;});}})[_0xfce6('0x1d')](respondWithFilteredResult(_0x1e2d8d,_0x38b80b))[_0xfce6('0x59')](handleError(_0x1e2d8d,null));};exports[_0xfce6('0x68')]=function(_0x550767,_0x3b930c,_0x183db0){return db[_0xfce6('0x52')][_0xfce6('0x58')]({'where':{'id':_0x550767[_0xfce6('0x56')]['id']}})['then'](handleEntityNotFound(_0x3b930c,null))['then'](function(_0xd9f76){if(_0xd9f76){return _0xd9f76[_0xfce6('0x68')](_0x550767[_0xfce6('0x42')][_0xfce6('0x69')]);}})[_0xfce6('0x1d')](respondWithStatusCode(_0x3b930c,null))[_0xfce6('0x59')](handleError(_0x3b930c,null));};exports['addAnswer']=function(_0x5b1956,_0x4174bb,_0x10dd9a){if(_0x5b1956[_0xfce6('0x5a')]['id']){delete _0x5b1956[_0xfce6('0x5a')]['id'];}return db[_0xfce6('0x52')][_0xfce6('0x58')]({'where':{'id':_0x5b1956[_0xfce6('0x56')]['id']}})['then'](handleEntityNotFound(_0x4174bb,null))['then'](function(_0x2c02f2){if(_0x2c02f2){_0x5b1956[_0xfce6('0x5a')][_0xfce6('0x60')]=_0x2c02f2['id'];return db[_0xfce6('0x6a')][_0xfce6('0x62')](_0x5b1956[_0xfce6('0x5a')]);}})['then'](respondWithResult(_0x4174bb,null))[_0xfce6('0x59')](handleError(_0x4174bb,null));};exports['getAnswers']=function(_0x4ee978,_0x5e3963,_0x3cbf71){var _0x4b374c={'raw':![],'where':{}};var _0x49d5d3={};var _0x46b17f={'count':0x0,'rows':[]};return db['SmsAccount'][_0xfce6('0x64')]({'where':{'id':_0x4ee978[_0xfce6('0x56')]['id']}})[_0xfce6('0x1d')](handleEntityNotFound(_0x5e3963,null))[_0xfce6('0x1d')](function(_0x349ffb){if(_0x349ffb){_0x49d5d3[_0xfce6('0x41')]=_['keys'](db['CannedAnswer'][_0xfce6('0x57')]);_0x49d5d3[_0xfce6('0x42')]=_[_0xfce6('0x65')](_0x4ee978[_0xfce6('0x42')]);_0x49d5d3['filters']=_[_0xfce6('0x44')](_0x49d5d3['model'],_0x49d5d3[_0xfce6('0x42')]);_0x4b374c[_0xfce6('0x45')]=_[_0xfce6('0x44')](_0x49d5d3[_0xfce6('0x41')],qs[_0xfce6('0x46')](_0x4ee978[_0xfce6('0x42')]['fields']));_0x4b374c[_0xfce6('0x45')]=_0x4b374c['attributes'][_0xfce6('0x47')]?_0x4b374c[_0xfce6('0x45')]:_0x49d5d3[_0xfce6('0x41')];if(!_0x4ee978['query'][_0xfce6('0x48')](_0xfce6('0x49'))){_0x4b374c['limit']=qs[_0xfce6('0x2c')](_0x4ee978[_0xfce6('0x42')][_0xfce6('0x2c')]);_0x4b374c['offset']=qs[_0xfce6('0x2e')](_0x4ee978[_0xfce6('0x42')][_0xfce6('0x2e')]);}_0x4b374c['order']=qs[_0xfce6('0x4b')](_0x4ee978[_0xfce6('0x42')][_0xfce6('0x4b')]);_0x4b374c[_0xfce6('0x4c')]=qs[_0xfce6('0x43')](_[_0xfce6('0x6b')](_0x4ee978[_0xfce6('0x42')],_0x49d5d3[_0xfce6('0x43')]));_0x4b374c[_0xfce6('0x4c')]['SmsAccountId']=_0x349ffb['id'];if(_0x4ee978[_0xfce6('0x42')][_0xfce6('0x4d')]){_0x4b374c[_0xfce6('0x4c')]=_[_0xfce6('0x4e')](_0x4b374c[_0xfce6('0x4c')],{'$or':_[_0xfce6('0x4f')](_0x4b374c[_0xfce6('0x45')],function(_0x52a724){var _0x4fb17b={};_0x4fb17b[_0x52a724]={'$like':'%'+_0x4ee978[_0xfce6('0x42')][_0xfce6('0x4d')]+'%'};return _0x4fb17b;})});}_0x4b374c=_[_0xfce6('0x4e')]({},_0x4b374c,_0x4ee978[_0xfce6('0x51')]);return db[_0xfce6('0x6a')][_0xfce6('0x2d')]({'where':_0x4b374c[_0xfce6('0x4c')]})[_0xfce6('0x1d')](function(_0x45dc13){_0x46b17f[_0xfce6('0x2d')]=_0x45dc13;if(_0x4ee978[_0xfce6('0x42')][_0xfce6('0x53')]){_0x4b374c['include']=[{'all':!![]}];}return db[_0xfce6('0x6a')][_0xfce6('0x66')](_0x4b374c);})[_0xfce6('0x1d')](function(_0x3db160){_0x46b17f['rows']=_0x3db160;return _0x46b17f;});}})[_0xfce6('0x1d')](respondWithFilteredResult(_0x5e3963,_0x4b374c))[_0xfce6('0x59')](handleError(_0x5e3963,null));};exports[_0xfce6('0x6c')]=function(_0x932538,_0x457427,_0x2959c4){return db['SmsAccount']['find']({'where':{'id':_0x932538[_0xfce6('0x56')]['id']}})[_0xfce6('0x1d')](handleEntityNotFound(_0x457427,null))[_0xfce6('0x1d')](function(_0x448228){if(_0x448228){return _0x448228[_0xfce6('0x6c')](_0x932538[_0xfce6('0x42')]['ids']);}})[_0xfce6('0x1d')](respondWithStatusCode(_0x457427,null))[_0xfce6('0x59')](handleError(_0x457427,null));};exports[_0xfce6('0x6d')]=function(_0x2d99d8,_0x506292,_0x4bac81){var _0x412792={'channel':_0xfce6('0x6e')};var _0x3490e8=[];var _0xb6b235=[];var _0x41e6f2={};return db['SmsAccount'][_0xfce6('0x58')]({'where':{'id':_0x2d99d8[_0xfce6('0x56')]['id']},'include':[{'model':db[_0xfce6('0x6f')],'as':_0xfce6('0x70')}]})[_0xfce6('0x1d')](handleEntityNotFound(_0x506292,null))[_0xfce6('0x1d')](function(_0x4d4818){_0x412792[_0xfce6('0x71')]=_0x4d4818;_0x412792[_0xfce6('0x72')]=_[_0xfce6('0x73')](_0x4d4818[_0xfce6('0x70')],[_0xfce6('0x74')],[_0xfce6('0x75')]);if(_0x412792[_0xfce6('0x71')][_0xfce6('0x70')]){delete _0x412792[_0xfce6('0x71')][_0xfce6('0x70')];}return db['CmContact']['describe']();})[_0xfce6('0x1d')](function(_0x57699f){if(!_0x57699f){throw new db[(_0xfce6('0x76'))][(_0xfce6('0x77'))]('no\x20available\x20attributes');}_0x3490e8=_[_0xfce6('0x78')](_['keys'](_0x57699f),[_0xfce6('0x79'),_0xfce6('0x7a')]);_0xb6b235=_['difference'](_[_0xfce6('0x65')](_0x57699f),['createdAt',_0xfce6('0x7a'),_0xfce6('0x7b'),'ListId']);_0x412792[_0xfce6('0x5a')]={'mapKey':'mobile'};if(_0x412792[_0xfce6('0x71')][_0xfce6('0x3f')]){switch(_0x412792['account'][_0xfce6('0x3f')]){case _0xfce6('0x7c'):_0x412792['body'][_0xfce6('0x7d')]=_0x2d99d8[_0xfce6('0x5a')]['From'];_0x412792[_0xfce6('0x5a')][_0xfce6('0x5a')]=_0x2d99d8[_0xfce6('0x5a')][_0xfce6('0x7e')];_0x412792[_0xfce6('0x5a')][_0xfce6('0x7f')]=_0x2d99d8['body']['MessageSid'];break;case'skebby':_0x412792[_0xfce6('0x5a')][_0xfce6('0x7d')]='+'+_0x2d99d8[_0xfce6('0x5a')][_0xfce6('0x80')];_0x412792[_0xfce6('0x5a')][_0xfce6('0x5a')]=_0x2d99d8[_0xfce6('0x5a')][_0xfce6('0x81')];break;case'connectel':_0x412792[_0xfce6('0x5a')]['from']=_0x2d99d8['body'][_0xfce6('0x7d')];_0x412792[_0xfce6('0x5a')][_0xfce6('0x5a')]=_0x2d99d8[_0xfce6('0x5a')]['message'];break;case _0xfce6('0x82'):_0x412792[_0xfce6('0x5a')][_0xfce6('0x7d')]=_0x2d99d8[_0xfce6('0x5a')][_0xfce6('0x7d')];_0x412792[_0xfce6('0x5a')]['body']=_0x2d99d8[_0xfce6('0x5a')][_0xfce6('0x5a')];_0x412792[_0xfce6('0x5a')]['messageId']=_0x2d99d8['body'][_0xfce6('0x83')];break;case _0xfce6('0x84'):_0x412792[_0xfce6('0x5a')][_0xfce6('0x7d')]=_0x2d99d8['body']['From'];_0x412792[_0xfce6('0x5a')][_0xfce6('0x5a')]=_0x2d99d8['body']['Text'];_0x412792[_0xfce6('0x5a')][_0xfce6('0x7f')]=_0x2d99d8[_0xfce6('0x5a')][_0xfce6('0x85')];break;case _0xfce6('0x86'):_0x412792[_0xfce6('0x5a')][_0xfce6('0x7d')]='+'+_0x2d99d8['body'][_0xfce6('0x87')][0x0]['from'];_0x412792[_0xfce6('0x5a')][_0xfce6('0x5a')]=_0x2d99d8[_0xfce6('0x5a')]['results'][0x0][_0xfce6('0x81')];_0x412792[_0xfce6('0x5a')][_0xfce6('0x7f')]=_0x2d99d8[_0xfce6('0x5a')][_0xfce6('0x87')][0x0][_0xfce6('0x7f')];break;case _0xfce6('0x88'):_0x412792['body'][_0xfce6('0x7d')]=_0x2d99d8[_0xfce6('0x5a')][_0xfce6('0x89')];_0x412792['body'][_0xfce6('0x5a')]=_0x2d99d8[_0xfce6('0x5a')][_0xfce6('0x8a')][_0xfce6('0x25')];break;case'clickatell':_0x412792[_0xfce6('0x5a')]['from']=_0x2d99d8['body'][_0xfce6('0x8b')];_0x412792['body']['body']=_0x2d99d8[_0xfce6('0x5a')][_0xfce6('0x81')];_0x412792[_0xfce6('0x5a')][_0xfce6('0x7f')]=_0x2d99d8[_0xfce6('0x5a')][_0xfce6('0x8c')];break;case _0xfce6('0x8d'):_0x412792[_0xfce6('0x5a')][_0xfce6('0x7f')]=_0x2d99d8[_0xfce6('0x5a')][0x0][_0xfce6('0x25')]['id'];_0x412792[_0xfce6('0x5a')][_0xfce6('0x7d')]=_0x2d99d8['body'][0x0]['message'][_0xfce6('0x7d')];_0x412792['body'][_0xfce6('0x5a')]=_0x2d99d8[_0xfce6('0x5a')][0x0][_0xfce6('0x25')][_0xfce6('0x81')];break;case'intelepeer':_0x412792[_0xfce6('0x5a')]['from']=_0x2d99d8['body']['from'];_0x412792[_0xfce6('0x5a')][_0xfce6('0x5a')]=_0x2d99d8[_0xfce6('0x5a')]['message'];_0x412792[_0xfce6('0x5a')]['messageId']=_0x2d99d8[_0xfce6('0x5a')][_0xfce6('0x8e')];break;}}if(_0x412792[_0xfce6('0x5a')]['id']){delete _0x412792[_0xfce6('0x5a')]['id'];}if(_[_0xfce6('0x8f')](_0x412792[_0xfce6('0x5a')]['from'])){throw new db['Sequelize']['ValidationError'](_0xfce6('0x90'));}if(_[_0xfce6('0x8f')](_0x412792[_0xfce6('0x5a')][_0xfce6('0x5a')])||_0x412792[_0xfce6('0x5a')][_0xfce6('0x5a')]===''){throw new db['Sequelize'][(_0xfce6('0x77'))](_0xfce6('0x91'));}if(_[_0xfce6('0x8f')](_0x412792[_0xfce6('0x5a')][_0xfce6('0x92')])){throw new db[(_0xfce6('0x76'))][(_0xfce6('0x77'))](_0xfce6('0x93')+_0xb6b235);}if(!_['includes'](_0xb6b235,_0x412792['body'][_0xfce6('0x92')])){throw new db[(_0xfce6('0x76'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xb6b235);}_0x41e6f2[_0x412792[_0xfce6('0x5a')][_0xfce6('0x92')]]=_0x412792['body']['from'];return db[_0xfce6('0x94')][_0xfce6('0x58')]({'where':{'id':_0x412792[_0xfce6('0x71')][_0xfce6('0x95')]},'include':[{'model':db[_0xfce6('0x96')],'as':_0xfce6('0x97'),'where':_0x41e6f2,'limit':0x1,'order':[[_0xfce6('0x7a'),_0xfce6('0x98')]]}]});})[_0xfce6('0x1d')](handleEntityNotFound(_0x506292,null))[_0xfce6('0x1d')](function(_0x49bed3){if(_0x49bed3){_0x412792[_0xfce6('0x99')]=_[_0xfce6('0x9a')](_0x49bed3,['Contacts']);if(_0x49bed3[_0xfce6('0x97')]['length']){return _0x49bed3[_0xfce6('0x97')][0x0];}var _0x4370f8=_[_0xfce6('0x16')](_0x412792['body'],{'firstName':_0x412792[_0xfce6('0x5a')][_0xfce6('0x7d')],'ListId':_0x49bed3['id']});_0x4370f8[_0x412792['body'][_0xfce6('0x92')]]=_0x412792['body']['from'];return db['CmContact']['create'](_0x4370f8,{'fields':_0x3490e8,'raw':!![]});}})['then'](handleEntityNotFound(_0x506292,null))[_0xfce6('0x1d')](function(_0x18fa41){if(_0x18fa41){_0x412792[_0xfce6('0x9b')]=_0x18fa41;var _0x217172={'ContactId':_0x18fa41['id'],'phone':_0x412792[_0xfce6('0x5a')][_0xfce6('0x7d')],'SmsAccountId':_0x2d99d8[_0xfce6('0x56')]['id']};var _0x3bf129={'ContactId':_0x18fa41['id'],'SmsAccountId':_0x2d99d8[_0xfce6('0x56')]['id'],'closed':![]};return db['SmsInteraction']['find']({'where':_0x3bf129})[_0xfce6('0x1d')](function(_0x40ac33){if(_0x40ac33){return[_0x40ac33,![]];}return db[_0xfce6('0x9c')][_0xfce6('0x62')](_0x217172)[_0xfce6('0x1d')](function(_0x17259a){return[_0x17259a,!![]];});});}})[_0xfce6('0x9d')](function(_0x38a17c,_0x57bf58){_0x412792[_0xfce6('0x9e')]=_0x38a17c[_0xfce6('0x36')]({'plain':!![]});_0x412792['interaction'][_0xfce6('0x9f')]=![];if(_0x57bf58){if(_0x412792[_0xfce6('0x71')][_0xfce6('0xa0')]){_0x412792[_0xfce6('0x72')][_0xfce6('0xa1')]({'id':0x0,'priority':_0x412792[_0xfce6('0x72')][_0xfce6('0x47')]+0x1,'app':_0xfce6('0xa2'),'appdata':_0xfce6('0xa3'),'interval':_0xfce6('0xa4')});}_0x412792[_0xfce6('0x9e')]['created']=!![];}return db[_0xfce6('0xa5')][_0xfce6('0x62')]({'phone':_0x412792[_0xfce6('0x5a')][_0xfce6('0x7d')],'messageId':_0x412792[_0xfce6('0x5a')][_0xfce6('0x7f')],'body':_0x412792['body'][_0xfce6('0x5a')],'SmsAccountId':_0x2d99d8[_0xfce6('0x56')]['id'],'SmsInteractionId':_0x38a17c['id'],'direction':'in','ContactId':_0x38a17c['ContactId'],'AttachmentId':_0x412792[_0xfce6('0x5a')][_0xfce6('0xa6')]});})[_0xfce6('0x1d')](function(_0x5730e6){_0x412792[_0xfce6('0x25')]=_0x5730e6;if(_0x412792[_0xfce6('0x9e')]['UserId']){return db['User']['find']({'attributes':['id',_0xfce6('0x3a')],'where':{'id':_0x412792[_0xfce6('0x9e')][_0xfce6('0xa7')]}})[_0xfce6('0x1d')](function(_0x46cd9f){if(_0x46cd9f){_0x412792[_0xfce6('0x72')]['unshift']({'id':0x0,'priority':0x0,'app':_0xfce6('0xa8'),'appdata':_0x46cd9f['name']+','+(_0x412792['account']['waitForTheAssignedAgent']||0xa),'interval':_0xfce6('0xa4')});}return respondWithRpcPromise(_0xfce6('0xa9'),_0xfce6('0xaa'),_0x412792);});}return respondWithRpcPromise(_0xfce6('0xa9'),_0xfce6('0xaa'),_0x412792);})[_0xfce6('0x1d')](function(_0x56b4fe){if(_0x56b4fe){var _0x40b232=0xc8;var _0x632dea='receiveMessage';logger[_0xfce6('0x1e')](_0xfce6('0xab'),_0x632dea,_0x40b232,_0xfce6('0xac'));logger[_0xfce6('0x1f')](_0xfce6('0xad'),_0x632dea,_0x40b232,_0xfce6('0xac'),JSON[_0xfce6('0x21')](_0x56b4fe));if(_0x412792['account'][_0xfce6('0x3f')]===_0xfce6('0x7c')){return _0x506292[_0xfce6('0x28')](_0x40b232)[_0xfce6('0x2f')](_0xfce6('0xae'),_0xfce6('0xaf'))[_0xfce6('0x3b')]('<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>');}else{return _0x506292[_0xfce6('0x28')](_0x40b232)['json'](_0x56b4fe);}}})[_0xfce6('0x59')](handleError(_0x506292,null));};exports[_0xfce6('0xb0')]=function(_0x4a0c1e,_0x1aa128){var _0x1a8963=_0x4a0c1e[_0xfce6('0x56')]['id'];var _0x12f71c=_0x4a0c1e[_0xfce6('0x5a')];var _0x3b043c=0xc8;var _0x3b141c=null;return db[_0xfce6('0xb1')][_0xfce6('0xb2')]({'isolationLevel':db['sequelize'][_0xfce6('0xb3')][_0xfce6('0xb4')][_0xfce6('0xb5')]},function(_0x15f681){return db['SmsAccount']['findOne']({'where':{'id':_0x1a8963},'transaction':_0x15f681})[_0xfce6('0x1d')](function(_0x47caa1){if(_0x47caa1){return db[_0xfce6('0x6f')]['destroy']({'where':{'SmsAccountId':_0x1a8963},'transaction':_0x15f681})['then'](function(){var _0x145f68=_['map'](_0x12f71c,function(_0x58d6ce){_0x58d6ce[_0xfce6('0x60')]=_0x1a8963;return _0x58d6ce;});return db[_0xfce6('0x6f')]['bulkCreate'](_0x145f68,{'transaction':_0x15f681});});}else{_0x3b043c=0x194;_0x3b141c=[];}});})[_0xfce6('0x1d')](function(){if(_0x3b043c!==0x194){return db[_0xfce6('0x6f')][_0xfce6('0xb6')]({'where':{'SmsAccountId':_0x1a8963},'order':'priority'})[_0xfce6('0x1d')](function(_0x3dbb4b){_0x3b141c=_0x3dbb4b;});}})[_0xfce6('0x59')](function(_0x39d9a6){_0x3b043c=0x1f4;logger[_0xfce6('0x22')](_0x39d9a6[_0xfce6('0x39')]);if(_0x39d9a6[_0xfce6('0x3a')]){delete _0x39d9a6['name'];}_0x3b141c=_0x39d9a6;})[_0xfce6('0xb7')](function(){if(_0x3b141c===null){_0x1aa128['sendStatus'](_0x3b043c);}else{if(_0x3b043c===0x1f4){_0x1aa128['status'](_0x3b043c)[_0xfce6('0x3b')](_0x3b141c);}else{_0x1aa128[_0xfce6('0x28')](_0x3b043c)[_0xfce6('0x2a')](_0x3b141c);}}});};exports['getApplications']=function(_0x1a0683,_0x41702d,_0x3fc6ff){var _0x454a72={};var _0x7e70b1={};var _0x50947d;var _0x2f5ab3;return db['SmsAccount'][_0xfce6('0x64')]({'where':{'id':_0x1a0683[_0xfce6('0x56')]['id']}})['then'](handleEntityNotFound(_0x41702d,null))[_0xfce6('0x1d')](function(_0x4583e3){if(_0x4583e3){_0x50947d=_0x4583e3;_0x7e70b1['model']=_[_0xfce6('0x65')](db[_0xfce6('0x6f')]['rawAttributes']);_0x7e70b1[_0xfce6('0x42')]=_[_0xfce6('0x65')](_0x1a0683['query']);_0x7e70b1[_0xfce6('0x43')]=_[_0xfce6('0x44')](_0x7e70b1['model'],_0x7e70b1[_0xfce6('0x42')]);_0x454a72['attributes']=_[_0xfce6('0x44')](_0x7e70b1[_0xfce6('0x41')],qs[_0xfce6('0x46')](_0x1a0683['query'][_0xfce6('0x46')]));_0x454a72[_0xfce6('0x45')]=_0x454a72[_0xfce6('0x45')][_0xfce6('0x47')]?_0x454a72[_0xfce6('0x45')]:_0x7e70b1['model'];_0x454a72[_0xfce6('0x4a')]=qs[_0xfce6('0x4b')](_0x1a0683[_0xfce6('0x42')][_0xfce6('0x4b')]);_0x454a72[_0xfce6('0x4c')]=qs[_0xfce6('0x43')](_[_0xfce6('0x6b')](_0x1a0683[_0xfce6('0x42')],_0x7e70b1[_0xfce6('0x43')]));if(_0x1a0683[_0xfce6('0x42')][_0xfce6('0x4d')]){_0x454a72[_0xfce6('0x4c')]=_[_0xfce6('0x4e')](_0x454a72[_0xfce6('0x4c')],{'$or':_[_0xfce6('0x4f')](_0x454a72['attributes'],function(_0x342c88){var _0x1db5bb={};_0x1db5bb[_0x342c88]={'$like':'%'+_0x1a0683[_0xfce6('0x42')][_0xfce6('0x4d')]+'%'};return _0x1db5bb;})});}_0x454a72=_[_0xfce6('0x4e')]({},_0x454a72,_0x1a0683[_0xfce6('0x51')]);return _0x50947d['getApplications'](_0x454a72);}})[_0xfce6('0x1d')](function(_0x464e75){if(_0x464e75){_0x2f5ab3=_0x464e75['length'];if(!_0x1a0683[_0xfce6('0x42')][_0xfce6('0x48')](_0xfce6('0x49'))){_0x454a72['limit']=qs[_0xfce6('0x2c')](_0x1a0683[_0xfce6('0x42')][_0xfce6('0x2c')]);_0x454a72[_0xfce6('0x2e')]=qs[_0xfce6('0x2e')](_0x1a0683[_0xfce6('0x42')][_0xfce6('0x2e')]);}return _0x50947d['getApplications'](_0x454a72);}})[_0xfce6('0x1d')](function(_0xb6a2cf){if(_0xb6a2cf){return _0xb6a2cf?{'count':_0x2f5ab3,'rows':_0xb6a2cf}:null;}})[_0xfce6('0x1d')](respondWithResult(_0x41702d,null))[_0xfce6('0x59')](handleError(_0x41702d,null));};exports['getInteractions']=function(_0x263884,_0x12729c,_0xff2e3a){var _0x5a3561={'raw':![],'where':{}};var _0x51dbff={};var _0x281ccc={'count':0x0,'rows':[]};return db[_0xfce6('0x52')][_0xfce6('0x64')]({'where':{'id':_0x263884[_0xfce6('0x56')]['id']}})[_0xfce6('0x1d')](handleEntityNotFound(_0x12729c,null))[_0xfce6('0x1d')](function(_0x25995a){if(_0x25995a){_0x51dbff[_0xfce6('0x41')]=_[_0xfce6('0x65')](db[_0xfce6('0x9c')][_0xfce6('0x57')]);_0x51dbff['query']=_[_0xfce6('0x65')](_0x263884['query']);_0x51dbff[_0xfce6('0x43')]=_[_0xfce6('0x44')](_0x51dbff[_0xfce6('0x41')],_0x51dbff[_0xfce6('0x42')]);_0x5a3561[_0xfce6('0x45')]=_[_0xfce6('0x44')](_0x51dbff['model'],qs[_0xfce6('0x46')](_0x263884['query']['fields']));_0x5a3561[_0xfce6('0x45')]=_0x5a3561['attributes'][_0xfce6('0x47')]?_0x5a3561[_0xfce6('0x45')]:_0x51dbff[_0xfce6('0x41')];if(!_0x263884['query'][_0xfce6('0x48')](_0xfce6('0x49'))){_0x5a3561[_0xfce6('0x2c')]=qs[_0xfce6('0x2c')](_0x263884[_0xfce6('0x42')][_0xfce6('0x2c')]);_0x5a3561[_0xfce6('0x2e')]=qs[_0xfce6('0x2e')](_0x263884[_0xfce6('0x42')][_0xfce6('0x2e')]);}_0x5a3561[_0xfce6('0x4a')]=qs[_0xfce6('0x4b')](_0x263884['query'][_0xfce6('0x4b')]);_0x5a3561[_0xfce6('0x4c')]=qs[_0xfce6('0x43')](_[_0xfce6('0x6b')](_0x263884[_0xfce6('0x42')],_0x51dbff[_0xfce6('0x43')]));_0x5a3561['where']['SmsAccountId']=_0x25995a['id'];if(_0x263884[_0xfce6('0x42')][_0xfce6('0x4d')]){_0x5a3561['where']=_[_0xfce6('0x4e')](_0x5a3561[_0xfce6('0x4c')],{'$or':_['map'](_0x5a3561['attributes'],function(_0x2e92b4){var _0x26a166={};_0x26a166[_0x2e92b4]={'$like':'%'+_0x263884[_0xfce6('0x42')][_0xfce6('0x4d')]+'%'};return _0x26a166;})});}_0x5a3561=_[_0xfce6('0x4e')]({},_0x5a3561,_0x263884['options']);return db[_0xfce6('0x9c')][_0xfce6('0x2d')]({'where':_0x5a3561[_0xfce6('0x4c')]})['then'](function(_0x409f59){_0x281ccc[_0xfce6('0x2d')]=_0x409f59;if(_0x263884['query'][_0xfce6('0x53')]){_0x5a3561['include']=[{'model':db[_0xfce6('0x96')],'as':_0xfce6('0xb8'),'required':![]},{'model':db[_0xfce6('0xb9')],'as':_0xfce6('0xba'),'attributes':['name',_0xfce6('0xbb'),_0xfce6('0xbc')],'required':![]},{'model':db[_0xfce6('0xbd')],'as':_0xfce6('0xbe'),'attributes':['id',_0xfce6('0x3a'),_0xfce6('0xbf')],'where':_0x263884[_0xfce6('0x42')][_0xfce6('0xc0')]?{'id':_0x263884['query'][_0xfce6('0xc0')]}:undefined,'required':_0x263884['query'][_0xfce6('0xc0')]?!![]:![]}];}return db[_0xfce6('0x9c')][_0xfce6('0x66')](_0x5a3561);})['then'](function(_0x356a1a){_0x281ccc[_0xfce6('0x67')]=_0x356a1a;return _0x281ccc;});}})['then'](respondWithFilteredResult(_0x12729c,_0x5a3561))[_0xfce6('0x59')](handleError(_0x12729c,null));};exports[_0xfce6('0x3b')]=function(_0x464ca8,_0xc13136,_0x2c7c41){var _0x1056c3,_0xd30679,_0x11336d;if(_[_0xfce6('0x8f')](_0x464ca8[_0xfce6('0x5a')][_0xfce6('0x5a')])||_0x464ca8['body']['body']===''){throw new db[(_0xfce6('0x76'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x464ca8['body']['to'])){throw new db[(_0xfce6('0x76'))][(_0xfce6('0x77'))](_0xfce6('0xc1'));}_0x1056c3=_0x464ca8[_0xfce6('0x5a')]['to'];return db[_0xfce6('0x52')][_0xfce6('0x58')]({'where':{'id':_0x464ca8[_0xfce6('0x56')]['id']},'include':[{'model':db[_0xfce6('0x94')],'as':_0xfce6('0xc2'),'include':[{'model':db[_0xfce6('0x96')],'as':_0xfce6('0x97'),'where':{'mobile':_0x1056c3},'limit':0x1,'order':[[_0xfce6('0x7a'),'DESC']]}]}]})[_0xfce6('0x1d')](handleEntityNotFound(_0xc13136,null))[_0xfce6('0x1d')](function(_0x51311a){if(_0x51311a&&_0x51311a[_0xfce6('0xc2')]){_0xd30679=_0x51311a['get']({'plain':!![]});if(_0xd30679['List']&&_0xd30679[_0xfce6('0xc2')]['Contacts'][_0xfce6('0x47')]){return _0xd30679[_0xfce6('0xc2')][_0xfce6('0x97')][0x0];}return db[_0xfce6('0x96')][_0xfce6('0x62')](_['defaults'](_0x464ca8[_0xfce6('0x5a')],{'firstName':_0x1056c3,'mobile':_0x1056c3,'phone':_0x1056c3,'ListId':_0xd30679[_0xfce6('0x95')]}));}})[_0xfce6('0x1d')](handleEntityNotFound(_0xc13136,null))['then'](function(_0x4bb622){if(_0x4bb622){_0x11336d=_0x4bb622;return db[_0xfce6('0x9c')][_0xfce6('0x58')]({'where':{'ContactId':_0x11336d['id'],'closed':![],'SmsAccountId':_0xd30679['id']}})['then'](function(_0x3e6ec1){if(_0x3e6ec1){return[_0x3e6ec1,![]];}return db['SmsInteraction'][_0xfce6('0x62')]({'UserId':_0x464ca8['user']['id'],'ContactId':_0x11336d['id'],'SmsAccountId':_0xd30679['id'],'phone':_0x1056c3,'firstMsgDirection':_0xfce6('0xc3'),'Messages':[_['merge'](_0x464ca8['body'],{'read':![],'body':_0x464ca8[_0xfce6('0x5a')]['body'],'phone':_0x1056c3,'SmsAccountId':_0xd30679['id'],'UserId':_0x464ca8[_0xfce6('0x5b')]['id'],'ContactId':_0x11336d['id']})]},{'include':[{'model':db[_0xfce6('0xa5')],'as':_0xfce6('0xc4')}]})[_0xfce6('0x1d')](function(_0x5e539b){return[_0x5e539b,!![]];});});}})['spread'](function(_0x46a539,_0x3bb511){if(_0x3bb511){return _0x46a539;}return db[_0xfce6('0xa5')][_0xfce6('0x62')](_[_0xfce6('0x4e')](_0x464ca8[_0xfce6('0x5a')],{'read':![],'body':_0x464ca8['body'][_0xfce6('0x5a')],'phone':_0x1056c3,'SmsAccountId':_0xd30679['id'],'SmsInteractionId':_0x46a539['id'],'UserId':_0x464ca8['user']['id'],'ContactId':_0x11336d['id']}))[_0xfce6('0x1d')](function(_0x2afd83){_0x46a539['dataValues']['Messages']=[];_0x46a539['dataValues'][_0xfce6('0xc4')][_0xfce6('0xa1')](_0x2afd83[_0xfce6('0xc5')]);return _0x46a539;});})[_0xfce6('0x1d')](respondWithResult(_0xc13136,null))['catch'](handleError(_0xc13136,null));};exports['status']=function(_0x2edbcf,_0x2637ea,_0x148afb){if(_0x2edbcf[_0xfce6('0x5a')]['id']){delete _0x2edbcf[_0xfce6('0x5a')]['id'];}var _0xb28bb9,_0x2b77c5,_0x45e775;return db[_0xfce6('0x52')][_0xfce6('0x58')]({'where':{'id':_0x2edbcf[_0xfce6('0x56')]['id']}})[_0xfce6('0x1d')](handleEntityNotFound(_0x2637ea,null))[_0xfce6('0x1d')](function(_0xc1a268){if(_0xc1a268){_0x45e775=_0xc1a268;logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xfce6('0x28'),_0xfce6('0xc6'),_0xc1a268[_0xfce6('0x3f')],util[_0xfce6('0xc7')](_0x2edbcf[_0xfce6('0x5a')],{'showHidden':![],'depth':null}));switch(_0xc1a268[_0xfce6('0x3f')]){case'skebby':if(_0x2edbcf[_0xfce6('0x5a')][_0xfce6('0xc8')]&&_0x2edbcf[_0xfce6('0x5a')][_0xfce6('0x28')]){_0x2b77c5=_0x2edbcf[_0xfce6('0x5a')][_0xfce6('0x28')];return db[_0xfce6('0xa5')][_0xfce6('0x58')]({'where':{'messageId':_0x2edbcf[_0xfce6('0x5a')][_0xfce6('0xc8')]}});}break;case _0xfce6('0xc9'):if(_0x2edbcf['body'][_0xfce6('0xca')]&&_0x2edbcf['body']['statusInt']){_0x2b77c5=_0x2edbcf[_0xfce6('0x5a')][_0xfce6('0xcb')];return db[_0xfce6('0xa5')][_0xfce6('0x58')]({'where':{'messageId':_0x2edbcf[_0xfce6('0x5a')][_0xfce6('0xca')]}});}break;case _0xfce6('0x82'):if(_0x2edbcf[_0xfce6('0x5a')][_0xfce6('0x83')]&&_0x2edbcf[_0xfce6('0x5a')]['status_code']){_0x2b77c5=_0x2edbcf['body'][_0xfce6('0xcc')];return db[_0xfce6('0xa5')][_0xfce6('0x58')]({'where':{'messageId':_0x2edbcf[_0xfce6('0x5a')][_0xfce6('0x83')]}});}break;case _0xfce6('0x86'):var _0x5c892e=_0x2edbcf[_0xfce6('0x5a')][_0xfce6('0x87')][0x0];if(_0x5c892e[_0xfce6('0x7f')]&&_0x5c892e[_0xfce6('0x28')]['groupName']===_0xfce6('0xcd')){_0x2b77c5=_0x5c892e[_0xfce6('0x28')][_0xfce6('0xce')];return db[_0xfce6('0xa5')][_0xfce6('0x58')]({'where':{'messageId':_0x5c892e[_0xfce6('0x7f')]}});}break;case'clickatell':if(_0x2edbcf[_0xfce6('0x5a')]['messageId']&&_0x2edbcf[_0xfce6('0x5a')][_0xfce6('0x28')]){_0x2b77c5=_0x2edbcf[_0xfce6('0x5a')][_0xfce6('0x28')];return db[_0xfce6('0xa5')]['find']({'where':{'messageId':_0x2edbcf[_0xfce6('0x5a')][_0xfce6('0x7f')]}});}break;case _0xfce6('0x8d'):if(_0x2edbcf[_0xfce6('0x5a')][0x0]['message']['id']){_0x2b77c5=_0x2edbcf['body'][0x0][_0xfce6('0x3f')];return db['SmsMessage'][_0xfce6('0x58')]({'where':{'messageId':_0x2edbcf[_0xfce6('0x5a')][0x0][_0xfce6('0x25')]['id']}});}break;case _0xfce6('0xcf'):if(_0x2edbcf[_0xfce6('0x5a')][_0xfce6('0xd0')]&&_0x2edbcf[_0xfce6('0x5a')][_0xfce6('0x28')]){_0x2b77c5=_0x2edbcf[_0xfce6('0x5a')][_0xfce6('0x28')];return db[_0xfce6('0xa5')]['find']({'where':{'messageId':_0x2edbcf['body']['redif']}});}break;}}})[_0xfce6('0x1d')](handleEntityNotFound(_0x2637ea,null))[_0xfce6('0x1d')](function(_0x1c8565){if(_0x1c8565){_0xb28bb9=_0x1c8565;switch(_0x45e775['type']){case _0xfce6('0xd1'):if(_0x2b77c5===_0xfce6('0xcd')){return _0xb28bb9[_0xfce6('0x34')]({'read':!![]});}else{logger[_0xfce6('0x22')](_0xfce6('0xab'),_0xfce6('0x28'),_0xfce6('0xd1'),util['inspect'](_0x2edbcf[_0xfce6('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xfce6('0xc9'):if(_0x2b77c5==='1'){return _0xb28bb9[_0xfce6('0x34')]({'read':!![]});}else{logger['error'](_0xfce6('0xab'),_0xfce6('0x28'),_0xfce6('0xd1'),util[_0xfce6('0xc7')](_0x2edbcf[_0xfce6('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xfce6('0x82'):if(!_0x2edbcf[_0xfce6('0x5a')][_0xfce6('0xd2')]&&_0x2b77c5>=0xc8&&_0x2b77c5<=0xce){return _0xb28bb9[_0xfce6('0x34')]({'read':!![]});}else{logger[_0xfce6('0x22')](_0xfce6('0xab'),_0xfce6('0x28'),'clicksend',util['inspect'](_0x2edbcf[_0xfce6('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xfce6('0x86'):var _0xcf60bf=_0x2edbcf[_0xfce6('0x5a')][_0xfce6('0x87')][0x0];if(_0xcf60bf[_0xfce6('0x28')][_0xfce6('0xce')]===_0xfce6('0xcd')){return _0xb28bb9[_0xfce6('0x34')]({'read':!![]});}else{logger[_0xfce6('0x22')](_0xfce6('0xab'),_0xfce6('0x28'),_0xfce6('0x86'),util[_0xfce6('0xc7')](_0x2edbcf[_0xfce6('0x5a')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x2b77c5==_0xfce6('0xd3')||_0x2b77c5=='RECEIVED_BY_RECIPIENT'){return _0xb28bb9[_0xfce6('0x34')]({'read':!![]});}else{logger[_0xfce6('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xfce6('0x28'),_0xfce6('0xd4'),util[_0xfce6('0xc7')](_0x2edbcf['body'],{'showHidden':![],'depth':null}));}break;case _0xfce6('0x8d'):if(_0x2b77c5==_0xfce6('0xd5')){return _0xb28bb9[_0xfce6('0x34')]({'read':!![]});}else{logger[_0xfce6('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','bandwidth',util[_0xfce6('0xc7')](_0x2edbcf['body'],{'showHidden':![],'depth':null}));}break;case _0xfce6('0xcf'):if(_0x2b77c5===_0xfce6('0xd6')||_0x2b77c5===_0xfce6('0xd7')){return _0xb28bb9['update']({'read':!![]});}else{logger[_0xfce6('0x22')](_0xfce6('0xab'),_0xfce6('0x28'),_0xfce6('0xcf'),util[_0xfce6('0xc7')](_0x2edbcf['body'],{'showHidden':![],'depth':null}));}break;}return _0xb28bb9;}})[_0xfce6('0x1d')](respondWithResult(_0x2637ea,null))[_0xfce6('0x59')](handleError(_0x2637ea,null));};exports['statusGet']=function(_0x4486a5,_0x3929e6,_0xc07240){var _0x3d4748,_0x21c3fc,_0x377083;return db[_0xfce6('0x52')]['find']({'where':{'id':_0x4486a5[_0xfce6('0x56')]['id']}})['then'](handleEntityNotFound(_0x3929e6,null))[_0xfce6('0x1d')](function(_0x521d8f){if(_0x521d8f){_0x377083=_0x521d8f;logger[_0xfce6('0x1f')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xfce6('0x28'),_0xfce6('0xc6'),_0x521d8f[_0xfce6('0x3f')],util[_0xfce6('0xc7')](_0x4486a5[_0xfce6('0x42')],{'showHidden':![],'depth':null}));switch(_0x521d8f[_0xfce6('0x3f')]){case _0xfce6('0x88'):if(_0x4486a5[_0xfce6('0x42')][_0xfce6('0xd8')]&&_0x4486a5[_0xfce6('0x42')][_0xfce6('0xd9')]){_0x21c3fc=_0x4486a5[_0xfce6('0x42')][_0xfce6('0xd9')];return db[_0xfce6('0xa5')]['find']({'where':{'messageId':_0x4486a5[_0xfce6('0x42')]['message-id']}});}break;}}})[_0xfce6('0x1d')](handleEntityNotFound(_0x3929e6,null))[_0xfce6('0x1d')](function(_0x39ba9a){if(_0x39ba9a){_0x3d4748=_0x39ba9a;switch(_0x377083[_0xfce6('0x3f')]){case _0xfce6('0x88'):if(_0x21c3fc==='2'||_0x21c3fc==='6'){return _0x3d4748[_0xfce6('0x34')]({'read':!![]});}else{logger[_0xfce6('0x22')](_0xfce6('0xab'),_0xfce6('0x28'),'csc',util['inspect'](_0x4486a5[_0xfce6('0x42')],{'showHidden':![],'depth':null}));};break;}return _0x3d4748;}})['then'](respondWithResult(_0x3929e6,null))[_0xfce6('0x59')](handleError(_0x3929e6,null));};exports[_0xfce6('0xda')]=function(_0x192706,_0x19d427,_0x42e206){return db[_0xfce6('0x52')][_0xfce6('0x58')]({'where':{'id':_0x192706[_0xfce6('0x56')]['id']}})[_0xfce6('0x1d')](handleEntityNotFound(_0x19d427,null))['then'](function(_0x31b098){if(_0x31b098){return _0x31b098['addAgents'](_0x192706[_0xfce6('0x5a')][_0xfce6('0x69')],_[_0xfce6('0x9a')](_0x192706[_0xfce6('0x5a')],['ids','id'])||{})[_0xfce6('0x9d')](function(_0x4dc569){for(var _0x52f275=0x0;_0x52f275<_0x192706[_0xfce6('0x5a')][_0xfce6('0x69')][_0xfce6('0x47')];_0x52f275+=0x1){socket[_0xfce6('0xdb')](_0xfce6('0xdc'),{'UserId':Number(_0x192706[_0xfce6('0x5a')][_0xfce6('0x69')][_0x52f275]),'SmsAccountId':Number(_0x192706[_0xfce6('0x56')]['id'])});}return _0x4dc569;});}})[_0xfce6('0x1d')](respondWithResult(_0x19d427,null))[_0xfce6('0x59')](handleError(_0x19d427,null));};exports[_0xfce6('0xdd')]=function(_0x2cecd3,_0x5716fe,_0x40aacc){return db[_0xfce6('0x52')][_0xfce6('0x58')]({'where':{'id':_0x2cecd3['params']['id']}})[_0xfce6('0x1d')](handleEntityNotFound(_0x5716fe,null))['then'](function(_0x27d945){if(_0x27d945){return _0x27d945[_0xfce6('0xdd')](_0x2cecd3['query'][_0xfce6('0x69')])[_0xfce6('0x1d')](function(){if(_[_0xfce6('0xde')](_0x2cecd3['query'][_0xfce6('0x69')])){for(var _0x9b50fe=0x0;_0x9b50fe<_0x2cecd3[_0xfce6('0x42')]['ids'][_0xfce6('0x47')];_0x9b50fe+=0x1){socket[_0xfce6('0xdb')](_0xfce6('0xdf'),{'UserId':Number(_0x2cecd3[_0xfce6('0x42')][_0xfce6('0x69')][_0x9b50fe]),'SmsAccountId':Number(_0x2cecd3['params']['id'])});}}else{socket[_0xfce6('0xdb')]('userSmsAccount:remove',{'UserId':Number(_0x2cecd3[_0xfce6('0x42')][_0xfce6('0x69')]),'SmsAccountId':Number(_0x2cecd3['params']['id'])});}});}})[_0xfce6('0x1d')](respondWithStatusCode(_0x5716fe,null))[_0xfce6('0x59')](handleError(_0x5716fe,null));};exports[_0xfce6('0xe0')]=function(_0x4bd1e5,_0x3f64c5,_0x4f90e7){var _0x559dbc={};var _0x5af33c={};var _0x3d1083;var _0x557680;return db[_0xfce6('0x52')][_0xfce6('0x64')]({'where':{'id':_0x4bd1e5[_0xfce6('0x56')]['id']}})[_0xfce6('0x1d')](handleEntityNotFound(_0x3f64c5,null))['then'](function(_0x5c2d5c){if(_0x5c2d5c){_0x3d1083=_0x5c2d5c;_0x5af33c[_0xfce6('0x41')]=_[_0xfce6('0x65')](db['User'][_0xfce6('0x57')]);_0x5af33c['query']=_['keys'](_0x4bd1e5['query']);_0x5af33c['filters']=_[_0xfce6('0x44')](_0x5af33c[_0xfce6('0x41')],_0x5af33c[_0xfce6('0x42')]);_0x559dbc['attributes']=_[_0xfce6('0x44')](_0x5af33c['model'],qs[_0xfce6('0x46')](_0x4bd1e5[_0xfce6('0x42')]['fields']));_0x559dbc[_0xfce6('0x45')]=_0x559dbc[_0xfce6('0x45')][_0xfce6('0x47')]?_0x559dbc[_0xfce6('0x45')]:_0x5af33c[_0xfce6('0x41')];_0x559dbc[_0xfce6('0x4a')]=qs['sort'](_0x4bd1e5['query'][_0xfce6('0x4b')]);_0x559dbc[_0xfce6('0x4c')]=qs['filters'](_[_0xfce6('0x6b')](_0x4bd1e5['query'],_0x5af33c[_0xfce6('0x43')]));if(_0x4bd1e5[_0xfce6('0x42')][_0xfce6('0x4d')]){_0x559dbc[_0xfce6('0x4c')]=_[_0xfce6('0x4e')](_0x559dbc['where'],{'$or':_['map'](_0x559dbc[_0xfce6('0x45')],function(_0x1cfc09){var _0x15a406={};_0x15a406[_0x1cfc09]={'$like':'%'+_0x4bd1e5[_0xfce6('0x42')][_0xfce6('0x4d')]+'%'};return _0x15a406;})});}_0x559dbc=_['merge']({},_0x559dbc,_0x4bd1e5[_0xfce6('0x51')]);return _0x3d1083[_0xfce6('0xe0')](_0x559dbc);}})[_0xfce6('0x1d')](function(_0x1265a0){if(_0x1265a0){_0x557680=_0x1265a0['length'];if(!_0x4bd1e5[_0xfce6('0x42')][_0xfce6('0x48')](_0xfce6('0x49'))){_0x559dbc['limit']=qs[_0xfce6('0x2c')](_0x4bd1e5[_0xfce6('0x42')]['limit']);_0x559dbc['offset']=qs[_0xfce6('0x2e')](_0x4bd1e5['query']['offset']);}return _0x3d1083[_0xfce6('0xe0')](_0x559dbc);}})[_0xfce6('0x1d')](function(_0x5431f8){if(_0x5431f8){return _0x5431f8?{'count':_0x557680,'rows':_0x5431f8}:null;}})[_0xfce6('0x1d')](respondWithResult(_0x3f64c5,null))[_0xfce6('0x59')](handleError(_0x3f64c5,null));};
\ No newline at end of file
+var _0x5c10=['internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','user','out','SmsMessage','dataValues','Messages','received\x20delivery\x20report\x20from','skebby_dispatch_id','connectel','requestid','statusInt','status_code','groupName','redif','inspect','error_code','DELIVERED','DELIVERED_TO_GATEWAY','DELIVRD','statusGet','csc','state','message-id','addAgents','emit','userSmsAccount:save','removeAgents','userSmsAccount:remove','User','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','redis','defaults','localhost','./smsAccount.socket','jayson/promise','client','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','offset','undefined','count','limit','status','Content-Range','json','apply','reject','save','update','destroy','get','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','SmsAccount','fieldName','type','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','keys','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsAccounts','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addDisposition','SmsAccountId','Disposition','findOne','order','findAll','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','priority','CmContact','describe','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','Body','messageId','MessageSid','skebby','sender','text','clicksend','message_id','plivo','Text','MessageUUID','infobip','results','originatingAddress','clickatell','bandwidth','intelepeer','refid','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','contact','SmsInteraction','spread','interaction','autoclose','push','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','agent','Start','startRouting','receiveMessage','entity\x20found','debug','set','Content-Type','text/xml','send','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','Owner'];(function(_0x5e6053,_0x207b6f){var _0x3f423d=function(_0x2921b1){while(--_0x2921b1){_0x5e6053['push'](_0x5e6053['shift']());}};_0x3f423d(++_0x207b6f);}(_0x5c10,0x107));var _0x05c1=function(_0x6871e8,_0x2cf8fd){_0x6871e8=_0x6871e8-0x0;var _0x1dce53=_0x5c10[_0x6871e8];return _0x1dce53;};'use strict';var emlformat=require(_0x05c1('0x0'));var rimraf=require(_0x05c1('0x1'));var zipdir=require(_0x05c1('0x2'));var jsonpatch=require(_0x05c1('0x3'));var rp=require(_0x05c1('0x4'));var moment=require('moment');var BPromise=require(_0x05c1('0x5'));var Mustache=require(_0x05c1('0x6'));var util=require(_0x05c1('0x7'));var path=require('path');var sox=require(_0x05c1('0x8'));var csv=require(_0x05c1('0x9'));var ejs=require(_0x05c1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x05c1('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x05c1('0xc'));var deskjs=require(_0x05c1('0xd'));var toCsv=require(_0x05c1('0x9'));var querystring=require(_0x05c1('0xe'));var Papa=require('papaparse');var Redis=require(_0x05c1('0xf'));var authService=require(_0x05c1('0x10'));var qs=require(_0x05c1('0x11'));var as=require(_0x05c1('0x12'));var hardwareService=require(_0x05c1('0x13'));var logger=require('../../config/logger')(_0x05c1('0x14'));var utils=require('../../config/utils');var config=require(_0x05c1('0x15'));var licenseUtil=require(_0x05c1('0x16'));var db=require('../../mysqldb')['db'];config[_0x05c1('0x17')]=_[_0x05c1('0x18')](config[_0x05c1('0x17')],{'host':_0x05c1('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x05c1('0x17')]));require(_0x05c1('0x1a'))['register'](socket);var jayson=require(_0x05c1('0x1b'));var client=jayson[_0x05c1('0x1c')]['http']({'port':0x232c});function respondWithRpcPromise(_0x2dffcb,_0x2fbe35,_0x44ba4d,_0x2c961b){return new BPromise(function(_0x3fa936,_0x5dfde4){var _0x487c47=_0x2c961b||client;return _0x487c47[_0x05c1('0x1d')](_0x2dffcb,_0x44ba4d)[_0x05c1('0x1e')](function(_0x589c38){logger[_0x05c1('0x1f')](_0x05c1('0x20'),_0x2fbe35,_0x05c1('0x21'));logger['debug'](_0x05c1('0x22'),_0x2fbe35,_0x05c1('0x21'),JSON[_0x05c1('0x23')](_0x589c38));if(_0x589c38[_0x05c1('0x24')]){if(_0x589c38[_0x05c1('0x24')][_0x05c1('0x25')]===0x1f4){logger[_0x05c1('0x24')]('SmsAccount,\x20%s,\x20%s',_0x2fbe35,_0x589c38[_0x05c1('0x24')][_0x05c1('0x26')]);return _0x5dfde4(_0x589c38[_0x05c1('0x24')][_0x05c1('0x26')]);}logger[_0x05c1('0x24')]('SmsAccount,\x20%s,\x20%s',_0x2fbe35,_0x589c38[_0x05c1('0x24')][_0x05c1('0x26')]);return _0x3fa936(_0x589c38[_0x05c1('0x24')][_0x05c1('0x26')]);}else{logger[_0x05c1('0x1f')]('SmsAccount,\x20%s,\x20%s',_0x2fbe35,_0x05c1('0x21'));_0x3fa936(_0x589c38[_0x05c1('0x27')][_0x05c1('0x26')]);}})['catch'](function(_0x400ba0){logger['error'](_0x05c1('0x20'),_0x2fbe35,_0x400ba0);_0x5dfde4(_0x400ba0);});});}function respondWithStatusCode(_0x4decd1,_0x13c079){_0x13c079=_0x13c079||0xcc;return function(_0x4b8b8c){if(_0x4b8b8c){return _0x4decd1[_0x05c1('0x28')](_0x13c079);}return _0x4decd1['status'](_0x13c079)[_0x05c1('0x29')]();};}function respondWithResult(_0x23fc83,_0x32892f){_0x32892f=_0x32892f||0xc8;return function(_0x42bfe4){if(_0x42bfe4){return _0x23fc83['status'](_0x32892f)['json'](_0x42bfe4);}};}function respondWithFilteredResult(_0x5151db,_0x133e57){return function(_0x4c0585){if(_0x4c0585){var _0xf06d2e=typeof _0x133e57[_0x05c1('0x2a')]===_0x05c1('0x2b')&&typeof _0x133e57['limit']===_0x05c1('0x2b');var _0x2682f9=_0x4c0585['count'];var _0x5e566=_0xf06d2e?0x0:_0x133e57['offset'];var _0x427964=_0xf06d2e?_0x4c0585[_0x05c1('0x2c')]:_0x133e57[_0x05c1('0x2a')]+_0x133e57[_0x05c1('0x2d')];var _0x1c8784;if(_0x427964>=_0x2682f9){_0x427964=_0x2682f9;_0x1c8784=0xc8;}else{_0x1c8784=0xce;}_0x5151db[_0x05c1('0x2e')](_0x1c8784);return _0x5151db['set'](_0x05c1('0x2f'),_0x5e566+'-'+_0x427964+'/'+_0x2682f9)[_0x05c1('0x30')](_0x4c0585);}return null;};}function patchUpdates(_0x2229b5){return function(_0x31ba18){try{jsonpatch[_0x05c1('0x31')](_0x31ba18,_0x2229b5,!![]);}catch(_0x5c339b){return BPromise[_0x05c1('0x32')](_0x5c339b);}return _0x31ba18[_0x05c1('0x33')]();};}function saveUpdates(_0x1b4ce2,_0x8bb2bb){return function(_0x236466){if(_0x236466){return _0x236466[_0x05c1('0x34')](_0x1b4ce2)[_0x05c1('0x1e')](function(_0x24fbc6){return _0x24fbc6;});}return null;};}function removeEntity(_0x58621e,_0x522da6){return function(_0x14129f){if(_0x14129f){return _0x14129f[_0x05c1('0x35')]()[_0x05c1('0x1e')](function(){var _0x2aa69a=_0x14129f[_0x05c1('0x36')]({'plain':!![]});var _0x33d6df='SmsAccounts';return db[_0x05c1('0x37')][_0x05c1('0x35')]({'where':{'type':_0x33d6df,'resourceId':_0x2aa69a['id']}})['then'](function(){return _0x14129f;});})[_0x05c1('0x1e')](function(){_0x58621e[_0x05c1('0x2e')](0xcc)[_0x05c1('0x29')]();});}};}function handleEntityNotFound(_0x3878b0,_0x452c22){return function(_0x76bf6){if(!_0x76bf6){_0x3878b0[_0x05c1('0x28')](0x194);}return _0x76bf6;};}function handleError(_0x2cb7d2,_0x3ebf44){_0x3ebf44=_0x3ebf44||0x1f4;return function(_0x2117ce){logger[_0x05c1('0x24')](_0x2117ce[_0x05c1('0x38')]);if(_0x2117ce[_0x05c1('0x39')]){delete _0x2117ce[_0x05c1('0x39')];}_0x2cb7d2[_0x05c1('0x2e')](_0x3ebf44)['send'](_0x2117ce);};}exports[_0x05c1('0x3a')]=function(_0x5e0e86,_0x47857d){var _0x6db60a={'include':[{'model':db[_0x05c1('0x3b')],'as':_0x05c1('0x3c')}]},_0x47f194={},_0x5021c4={'count':0x0,'rows':[]};var _0x51f619=_[_0x05c1('0x3d')](db[_0x05c1('0x3e')]['rawAttributes'],function(_0x595ffd){return{'name':_0x595ffd[_0x05c1('0x3f')],'type':_0x595ffd[_0x05c1('0x40')]['key']};});_0x47f194['model']=_[_0x05c1('0x3d')](_0x51f619,_0x05c1('0x39'));_0x47f194['query']=_['keys'](_0x5e0e86[_0x05c1('0x41')]);_0x47f194[_0x05c1('0x42')]=_[_0x05c1('0x43')](_0x47f194['model'],_0x47f194[_0x05c1('0x41')]);_0x6db60a['attributes']=_['intersection'](_0x47f194[_0x05c1('0x44')],qs[_0x05c1('0x45')](_0x5e0e86[_0x05c1('0x41')][_0x05c1('0x45')]));_0x6db60a[_0x05c1('0x46')]=_0x6db60a[_0x05c1('0x46')][_0x05c1('0x47')]?_0x6db60a[_0x05c1('0x46')]:_0x47f194['model'];if(!_0x5e0e86['query'][_0x05c1('0x48')](_0x05c1('0x49'))){_0x6db60a['limit']=qs[_0x05c1('0x2d')](_0x5e0e86[_0x05c1('0x41')]['limit']);_0x6db60a[_0x05c1('0x2a')]=qs['offset'](_0x5e0e86[_0x05c1('0x41')]['offset']);}_0x6db60a['order']=qs[_0x05c1('0x4a')](_0x5e0e86[_0x05c1('0x41')][_0x05c1('0x4a')]);_0x6db60a[_0x05c1('0x4b')]=qs[_0x05c1('0x42')](_[_0x05c1('0x4c')](_0x5e0e86[_0x05c1('0x41')],_0x47f194['filters']),_0x51f619);if(_0x5e0e86[_0x05c1('0x41')][_0x05c1('0x4d')]){_0x6db60a['where']=_[_0x05c1('0x4e')](_0x6db60a[_0x05c1('0x4b')],{'$or':_[_0x05c1('0x3d')](_0x51f619,function(_0x320374){if(_0x320374[_0x05c1('0x40')]!==_0x05c1('0x4f')){var _0x79733b={};_0x79733b[_0x320374[_0x05c1('0x39')]]={'$like':'%'+_0x5e0e86[_0x05c1('0x41')][_0x05c1('0x4d')]+'%'};return _0x79733b;}})});}_0x6db60a=_[_0x05c1('0x4e')]({},_0x6db60a,_0x5e0e86[_0x05c1('0x50')]);var _0x58874b={'where':_0x6db60a['where']};return db[_0x05c1('0x3e')]['count'](_0x58874b)[_0x05c1('0x1e')](function(_0xd213c8){_0x5021c4[_0x05c1('0x2c')]=_0xd213c8;if(_0x5e0e86['query'][_0x05c1('0x51')]){_0x6db60a[_0x05c1('0x52')]=[{'all':!![]}];}return db['SmsAccount']['findAll'](_0x6db60a);})[_0x05c1('0x1e')](function(_0x2b22e2){_0x5021c4[_0x05c1('0x53')]=_0x2b22e2;return _0x5021c4;})['then'](respondWithFilteredResult(_0x47857d,_0x6db60a))[_0x05c1('0x54')](handleError(_0x47857d,null));};exports[_0x05c1('0x55')]=function(_0x306b80,_0x35857b){var _0x46be8c={'raw':![],'where':{'id':_0x306b80['params']['id']},'include':[{'model':db[_0x05c1('0x3b')],'as':_0x05c1('0x3c')}]},_0x1bb773={};_0x1bb773[_0x05c1('0x44')]=_[_0x05c1('0x56')](db[_0x05c1('0x3e')][_0x05c1('0x57')]);_0x1bb773[_0x05c1('0x41')]=_[_0x05c1('0x56')](_0x306b80['query']);_0x1bb773[_0x05c1('0x42')]=_[_0x05c1('0x43')](_0x1bb773['model'],_0x1bb773[_0x05c1('0x41')]);_0x46be8c[_0x05c1('0x46')]=_['intersection'](_0x1bb773[_0x05c1('0x44')],qs[_0x05c1('0x45')](_0x306b80['query'][_0x05c1('0x45')]));_0x46be8c[_0x05c1('0x46')]=_0x46be8c['attributes'][_0x05c1('0x47')]?_0x46be8c[_0x05c1('0x46')]:_0x1bb773[_0x05c1('0x44')];if(_0x306b80['query'][_0x05c1('0x51')]){_0x46be8c[_0x05c1('0x52')]=[{'all':!![]}];}_0x46be8c=_[_0x05c1('0x4e')]({},_0x46be8c,_0x306b80[_0x05c1('0x50')]);return db[_0x05c1('0x3e')][_0x05c1('0x58')](_0x46be8c)[_0x05c1('0x1e')](handleEntityNotFound(_0x35857b,null))[_0x05c1('0x1e')](respondWithResult(_0x35857b,null))['catch'](handleError(_0x35857b,null));};exports[_0x05c1('0x59')]=function(_0x15cb82,_0x835b76){return db['SmsAccount'][_0x05c1('0x59')](_0x15cb82[_0x05c1('0x5a')],{})[_0x05c1('0x1e')](function(_0x539997){var _0x372484=_0x15cb82['user'][_0x05c1('0x36')]({'plain':!![]});if(!_0x372484)throw new Error(_0x05c1('0x5b'));if(_0x372484[_0x05c1('0x5c')]==='user'){var _0x4f19ba=_0x539997[_0x05c1('0x36')]({'plain':!![]});var _0x97c7ab=_0x05c1('0x5d');return db[_0x05c1('0x5e')][_0x05c1('0x58')]({'where':{'name':_0x97c7ab,'userProfileId':_0x372484['userProfileId']},'raw':!![]})[_0x05c1('0x1e')](function(_0x2b4b01){if(_0x2b4b01&&_0x2b4b01[_0x05c1('0x5f')]===0x0){return db[_0x05c1('0x37')]['create']({'name':_0x4f19ba[_0x05c1('0x39')],'resourceId':_0x4f19ba['id'],'type':_0x2b4b01[_0x05c1('0x39')],'sectionId':_0x2b4b01['id']},{})['then'](function(){return _0x539997;});}else{return _0x539997;}})[_0x05c1('0x54')](function(_0x5680d7){logger[_0x05c1('0x24')](_0x05c1('0x60'),_0x5680d7);throw _0x5680d7;});}return _0x539997;})['then'](respondWithResult(_0x835b76,0xc9))[_0x05c1('0x54')](handleError(_0x835b76,null));};exports[_0x05c1('0x34')]=function(_0x4195ac,_0x1be558){if(_0x4195ac[_0x05c1('0x5a')]['id']){delete _0x4195ac[_0x05c1('0x5a')]['id'];}return db[_0x05c1('0x3e')][_0x05c1('0x58')]({'where':{'id':_0x4195ac[_0x05c1('0x61')]['id']},'include':[{'model':db[_0x05c1('0x3b')],'as':_0x05c1('0x3c')}]})['then'](handleEntityNotFound(_0x1be558,null))[_0x05c1('0x1e')](saveUpdates(_0x4195ac[_0x05c1('0x5a')],null))[_0x05c1('0x1e')](respondWithResult(_0x1be558,null))['catch'](handleError(_0x1be558,null));};exports[_0x05c1('0x35')]=function(_0x48a4ca,_0x2d1873){return db['SmsAccount'][_0x05c1('0x58')]({'where':{'id':_0x48a4ca['params']['id']}})[_0x05c1('0x1e')](handleEntityNotFound(_0x2d1873,null))[_0x05c1('0x1e')](removeEntity(_0x2d1873,null))[_0x05c1('0x54')](handleError(_0x2d1873,null));};exports['describe']=function(_0x3e79b5,_0x25586e){return db[_0x05c1('0x3e')]['describe']()[_0x05c1('0x1e')](respondWithResult(_0x25586e,null))[_0x05c1('0x54')](handleError(_0x25586e,null));};exports[_0x05c1('0x62')]=function(_0x38ab28,_0x3e9bf6,_0x7e68dc){if(_0x38ab28[_0x05c1('0x5a')]['id']){delete _0x38ab28[_0x05c1('0x5a')]['id'];}return db[_0x05c1('0x3e')][_0x05c1('0x58')]({'where':{'id':_0x38ab28[_0x05c1('0x61')]['id']}})[_0x05c1('0x1e')](handleEntityNotFound(_0x3e9bf6,null))[_0x05c1('0x1e')](function(_0x16c772){if(_0x16c772){_0x38ab28['body'][_0x05c1('0x63')]=_0x16c772['id'];return db[_0x05c1('0x64')]['create'](_0x38ab28[_0x05c1('0x5a')]);}})[_0x05c1('0x1e')](respondWithResult(_0x3e9bf6,null))[_0x05c1('0x54')](handleError(_0x3e9bf6,null));};exports['getDispositions']=function(_0x57bfa7,_0x2a0a67,_0x4287dd){var _0x464045={'raw':![],'where':{}};var _0x359d5a={};var _0x400218={'count':0x0,'rows':[]};return db[_0x05c1('0x3e')][_0x05c1('0x65')]({'where':{'id':_0x57bfa7[_0x05c1('0x61')]['id']}})[_0x05c1('0x1e')](handleEntityNotFound(_0x2a0a67,null))[_0x05c1('0x1e')](function(_0x1981a6){if(_0x1981a6){_0x359d5a[_0x05c1('0x44')]=_['keys'](db[_0x05c1('0x64')]['rawAttributes']);_0x359d5a[_0x05c1('0x41')]=_[_0x05c1('0x56')](_0x57bfa7[_0x05c1('0x41')]);_0x359d5a['filters']=_['intersection'](_0x359d5a[_0x05c1('0x44')],_0x359d5a['query']);_0x464045[_0x05c1('0x46')]=_[_0x05c1('0x43')](_0x359d5a['model'],qs[_0x05c1('0x45')](_0x57bfa7[_0x05c1('0x41')][_0x05c1('0x45')]));_0x464045[_0x05c1('0x46')]=_0x464045['attributes'][_0x05c1('0x47')]?_0x464045[_0x05c1('0x46')]:_0x359d5a[_0x05c1('0x44')];if(!_0x57bfa7['query'][_0x05c1('0x48')](_0x05c1('0x49'))){_0x464045['limit']=qs[_0x05c1('0x2d')](_0x57bfa7['query'][_0x05c1('0x2d')]);_0x464045[_0x05c1('0x2a')]=qs['offset'](_0x57bfa7[_0x05c1('0x41')][_0x05c1('0x2a')]);}_0x464045[_0x05c1('0x66')]=qs[_0x05c1('0x4a')](_0x57bfa7[_0x05c1('0x41')][_0x05c1('0x4a')]);_0x464045['where']=qs[_0x05c1('0x42')](_[_0x05c1('0x4c')](_0x57bfa7[_0x05c1('0x41')],_0x359d5a[_0x05c1('0x42')]));_0x464045[_0x05c1('0x4b')]['SmsAccountId']=_0x1981a6['id'];if(_0x57bfa7['query'][_0x05c1('0x4d')]){_0x464045[_0x05c1('0x4b')]=_[_0x05c1('0x4e')](_0x464045[_0x05c1('0x4b')],{'$or':_[_0x05c1('0x3d')](_0x464045[_0x05c1('0x46')],function(_0x319ab4){var _0x3c3134={};_0x3c3134[_0x319ab4]={'$like':'%'+_0x57bfa7[_0x05c1('0x41')][_0x05c1('0x4d')]+'%'};return _0x3c3134;})});}_0x464045=_['merge']({},_0x464045,_0x57bfa7[_0x05c1('0x50')]);return db[_0x05c1('0x64')][_0x05c1('0x2c')]({'where':_0x464045[_0x05c1('0x4b')]})['then'](function(_0x5abad4){_0x400218[_0x05c1('0x2c')]=_0x5abad4;if(_0x57bfa7[_0x05c1('0x41')][_0x05c1('0x51')]){_0x464045[_0x05c1('0x52')]=[{'all':!![]}];}return db[_0x05c1('0x64')][_0x05c1('0x67')](_0x464045);})[_0x05c1('0x1e')](function(_0x35089b){_0x400218['rows']=_0x35089b;return _0x400218;});}})[_0x05c1('0x1e')](respondWithFilteredResult(_0x2a0a67,_0x464045))[_0x05c1('0x54')](handleError(_0x2a0a67,null));};exports[_0x05c1('0x68')]=function(_0x2ca45c,_0x29decf,_0x5d4ee2){return db[_0x05c1('0x3e')]['find']({'where':{'id':_0x2ca45c['params']['id']}})[_0x05c1('0x1e')](handleEntityNotFound(_0x29decf,null))[_0x05c1('0x1e')](function(_0x84322e){if(_0x84322e){return _0x84322e['removeDispositions'](_0x2ca45c[_0x05c1('0x41')][_0x05c1('0x69')]);}})[_0x05c1('0x1e')](respondWithStatusCode(_0x29decf,null))[_0x05c1('0x54')](handleError(_0x29decf,null));};exports[_0x05c1('0x6a')]=function(_0x3b0148,_0x531b6c,_0x1fc07c){if(_0x3b0148[_0x05c1('0x5a')]['id']){delete _0x3b0148[_0x05c1('0x5a')]['id'];}return db['SmsAccount'][_0x05c1('0x58')]({'where':{'id':_0x3b0148[_0x05c1('0x61')]['id']}})[_0x05c1('0x1e')](handleEntityNotFound(_0x531b6c,null))[_0x05c1('0x1e')](function(_0xddc650){if(_0xddc650){_0x3b0148['body'][_0x05c1('0x63')]=_0xddc650['id'];return db['CannedAnswer'][_0x05c1('0x59')](_0x3b0148[_0x05c1('0x5a')]);}})[_0x05c1('0x1e')](respondWithResult(_0x531b6c,null))[_0x05c1('0x54')](handleError(_0x531b6c,null));};exports[_0x05c1('0x6b')]=function(_0x46acbf,_0x7def59,_0x367c9c){var _0x4ffe8d={'raw':![],'where':{}};var _0x11594b={};var _0x516845={'count':0x0,'rows':[]};return db[_0x05c1('0x3e')][_0x05c1('0x65')]({'where':{'id':_0x46acbf[_0x05c1('0x61')]['id']}})['then'](handleEntityNotFound(_0x7def59,null))[_0x05c1('0x1e')](function(_0x448a56){if(_0x448a56){_0x11594b['model']=_['keys'](db[_0x05c1('0x6c')][_0x05c1('0x57')]);_0x11594b[_0x05c1('0x41')]=_[_0x05c1('0x56')](_0x46acbf['query']);_0x11594b[_0x05c1('0x42')]=_[_0x05c1('0x43')](_0x11594b[_0x05c1('0x44')],_0x11594b[_0x05c1('0x41')]);_0x4ffe8d['attributes']=_[_0x05c1('0x43')](_0x11594b[_0x05c1('0x44')],qs[_0x05c1('0x45')](_0x46acbf['query'][_0x05c1('0x45')]));_0x4ffe8d['attributes']=_0x4ffe8d[_0x05c1('0x46')][_0x05c1('0x47')]?_0x4ffe8d[_0x05c1('0x46')]:_0x11594b[_0x05c1('0x44')];if(!_0x46acbf['query'][_0x05c1('0x48')](_0x05c1('0x49'))){_0x4ffe8d[_0x05c1('0x2d')]=qs[_0x05c1('0x2d')](_0x46acbf['query'][_0x05c1('0x2d')]);_0x4ffe8d[_0x05c1('0x2a')]=qs[_0x05c1('0x2a')](_0x46acbf['query'][_0x05c1('0x2a')]);}_0x4ffe8d[_0x05c1('0x66')]=qs[_0x05c1('0x4a')](_0x46acbf[_0x05c1('0x41')][_0x05c1('0x4a')]);_0x4ffe8d[_0x05c1('0x4b')]=qs['filters'](_['pick'](_0x46acbf[_0x05c1('0x41')],_0x11594b[_0x05c1('0x42')]));_0x4ffe8d[_0x05c1('0x4b')]['SmsAccountId']=_0x448a56['id'];if(_0x46acbf[_0x05c1('0x41')][_0x05c1('0x4d')]){_0x4ffe8d[_0x05c1('0x4b')]=_[_0x05c1('0x4e')](_0x4ffe8d[_0x05c1('0x4b')],{'$or':_[_0x05c1('0x3d')](_0x4ffe8d[_0x05c1('0x46')],function(_0x3ee562){var _0x594e19={};_0x594e19[_0x3ee562]={'$like':'%'+_0x46acbf['query'][_0x05c1('0x4d')]+'%'};return _0x594e19;})});}_0x4ffe8d=_['merge']({},_0x4ffe8d,_0x46acbf[_0x05c1('0x50')]);return db['CannedAnswer']['count']({'where':_0x4ffe8d[_0x05c1('0x4b')]})[_0x05c1('0x1e')](function(_0x18d41f){_0x516845[_0x05c1('0x2c')]=_0x18d41f;if(_0x46acbf[_0x05c1('0x41')][_0x05c1('0x51')]){_0x4ffe8d[_0x05c1('0x52')]=[{'all':!![]}];}return db[_0x05c1('0x6c')][_0x05c1('0x67')](_0x4ffe8d);})['then'](function(_0x4abb73){_0x516845[_0x05c1('0x53')]=_0x4abb73;return _0x516845;});}})['then'](respondWithFilteredResult(_0x7def59,_0x4ffe8d))['catch'](handleError(_0x7def59,null));};exports[_0x05c1('0x6d')]=function(_0x2daa26,_0x308cf1,_0x3f5876){return db[_0x05c1('0x3e')][_0x05c1('0x58')]({'where':{'id':_0x2daa26[_0x05c1('0x61')]['id']}})[_0x05c1('0x1e')](handleEntityNotFound(_0x308cf1,null))['then'](function(_0x2b1882){if(_0x2b1882){return _0x2b1882['removeAnswers'](_0x2daa26['query'][_0x05c1('0x69')]);}})[_0x05c1('0x1e')](respondWithStatusCode(_0x308cf1,null))['catch'](handleError(_0x308cf1,null));};exports[_0x05c1('0x6e')]=function(_0x260363,_0x5bf5e8,_0x4ff7fb){var _0xf6dfb5={'channel':_0x05c1('0x6f')};var _0x3f9497=[];var _0x5977ca=[];var _0x3b0dbd={};return db[_0x05c1('0x3e')][_0x05c1('0x58')]({'where':{'id':_0x260363[_0x05c1('0x61')]['id']},'include':[{'model':db[_0x05c1('0x70')],'as':_0x05c1('0x71')}]})[_0x05c1('0x1e')](handleEntityNotFound(_0x5bf5e8,null))[_0x05c1('0x1e')](function(_0x17af38){_0xf6dfb5[_0x05c1('0x72')]=_0x17af38;_0xf6dfb5[_0x05c1('0x73')]=_['orderBy'](_0x17af38[_0x05c1('0x71')],[_0x05c1('0x74')],['asc']);if(_0xf6dfb5[_0x05c1('0x72')]['Applications']){delete _0xf6dfb5[_0x05c1('0x72')][_0x05c1('0x71')];}return db[_0x05c1('0x75')][_0x05c1('0x76')]();})[_0x05c1('0x1e')](function(_0x18820a){if(!_0x18820a){throw new db['Sequelize'][(_0x05c1('0x77'))](_0x05c1('0x78'));}_0x3f9497=_['difference'](_[_0x05c1('0x56')](_0x18820a),[_0x05c1('0x79'),_0x05c1('0x7a')]);_0x5977ca=_['difference'](_[_0x05c1('0x56')](_0x18820a),[_0x05c1('0x79'),_0x05c1('0x7a'),_0x05c1('0x7b'),_0x05c1('0x7c')]);_0xf6dfb5[_0x05c1('0x5a')]={'mapKey':_0x05c1('0x7d')};if(_0xf6dfb5[_0x05c1('0x72')][_0x05c1('0x40')]){switch(_0xf6dfb5[_0x05c1('0x72')][_0x05c1('0x40')]){case _0x05c1('0x7e'):_0xf6dfb5[_0x05c1('0x5a')][_0x05c1('0x7f')]=_0x260363[_0x05c1('0x5a')][_0x05c1('0x80')];_0xf6dfb5[_0x05c1('0x5a')][_0x05c1('0x5a')]=_0x260363['body'][_0x05c1('0x81')];_0xf6dfb5[_0x05c1('0x5a')][_0x05c1('0x82')]=_0x260363[_0x05c1('0x5a')][_0x05c1('0x83')];break;case _0x05c1('0x84'):_0xf6dfb5[_0x05c1('0x5a')][_0x05c1('0x7f')]='+'+_0x260363[_0x05c1('0x5a')][_0x05c1('0x85')];_0xf6dfb5['body'][_0x05c1('0x5a')]=_0x260363[_0x05c1('0x5a')][_0x05c1('0x86')];break;case'connectel':_0xf6dfb5['body'][_0x05c1('0x7f')]=_0x260363[_0x05c1('0x5a')][_0x05c1('0x7f')];_0xf6dfb5[_0x05c1('0x5a')][_0x05c1('0x5a')]=_0x260363[_0x05c1('0x5a')][_0x05c1('0x26')];break;case _0x05c1('0x87'):_0xf6dfb5['body'][_0x05c1('0x7f')]=_0x260363[_0x05c1('0x5a')][_0x05c1('0x7f')];_0xf6dfb5[_0x05c1('0x5a')][_0x05c1('0x5a')]=_0x260363[_0x05c1('0x5a')][_0x05c1('0x5a')];_0xf6dfb5[_0x05c1('0x5a')][_0x05c1('0x82')]=_0x260363[_0x05c1('0x5a')][_0x05c1('0x88')];break;case _0x05c1('0x89'):_0xf6dfb5[_0x05c1('0x5a')]['from']=_0x260363['body']['From'];_0xf6dfb5[_0x05c1('0x5a')][_0x05c1('0x5a')]=_0x260363[_0x05c1('0x5a')][_0x05c1('0x8a')];_0xf6dfb5['body'][_0x05c1('0x82')]=_0x260363[_0x05c1('0x5a')][_0x05c1('0x8b')];break;case _0x05c1('0x8c'):_0xf6dfb5[_0x05c1('0x5a')]['from']='+'+_0x260363[_0x05c1('0x5a')][_0x05c1('0x8d')][0x0][_0x05c1('0x7f')];_0xf6dfb5[_0x05c1('0x5a')][_0x05c1('0x5a')]=_0x260363[_0x05c1('0x5a')]['results'][0x0][_0x05c1('0x86')];_0xf6dfb5[_0x05c1('0x5a')][_0x05c1('0x82')]=_0x260363[_0x05c1('0x5a')]['results'][0x0]['messageId'];break;case'csc':_0xf6dfb5['body'][_0x05c1('0x7f')]=_0x260363[_0x05c1('0x5a')][_0x05c1('0x8e')];_0xf6dfb5[_0x05c1('0x5a')][_0x05c1('0x5a')]=_0x260363[_0x05c1('0x5a')]['segmentedMessage'][_0x05c1('0x26')];break;case _0x05c1('0x8f'):_0xf6dfb5[_0x05c1('0x5a')][_0x05c1('0x7f')]=_0x260363[_0x05c1('0x5a')]['fromNumber'];_0xf6dfb5[_0x05c1('0x5a')][_0x05c1('0x5a')]=_0x260363[_0x05c1('0x5a')][_0x05c1('0x86')];_0xf6dfb5[_0x05c1('0x5a')][_0x05c1('0x82')]=_0x260363[_0x05c1('0x5a')]['replyMessageId'];break;case _0x05c1('0x90'):_0xf6dfb5[_0x05c1('0x5a')][_0x05c1('0x82')]=_0x260363['body'][0x0]['message']['id'];_0xf6dfb5['body']['from']=_0x260363[_0x05c1('0x5a')][0x0][_0x05c1('0x26')]['from'];_0xf6dfb5[_0x05c1('0x5a')][_0x05c1('0x5a')]=_0x260363[_0x05c1('0x5a')][0x0][_0x05c1('0x26')][_0x05c1('0x86')];break;case _0x05c1('0x91'):_0xf6dfb5[_0x05c1('0x5a')][_0x05c1('0x7f')]=_0x260363[_0x05c1('0x5a')]['from'];_0xf6dfb5[_0x05c1('0x5a')][_0x05c1('0x5a')]=_0x260363['body'][_0x05c1('0x26')];_0xf6dfb5[_0x05c1('0x5a')][_0x05c1('0x82')]=_0x260363['body'][_0x05c1('0x92')];break;}}if(_0xf6dfb5[_0x05c1('0x5a')]['id']){delete _0xf6dfb5[_0x05c1('0x5a')]['id'];}if(_[_0x05c1('0x93')](_0xf6dfb5['body'][_0x05c1('0x7f')])){throw new db[(_0x05c1('0x94'))][(_0x05c1('0x77'))](_0x05c1('0x95'));}if(_[_0x05c1('0x93')](_0xf6dfb5[_0x05c1('0x5a')][_0x05c1('0x5a')])||_0xf6dfb5[_0x05c1('0x5a')][_0x05c1('0x5a')]===''){throw new db[(_0x05c1('0x94'))][(_0x05c1('0x77'))](_0x05c1('0x96'));}if(_[_0x05c1('0x93')](_0xf6dfb5[_0x05c1('0x5a')][_0x05c1('0x97')])){throw new db[(_0x05c1('0x94'))][(_0x05c1('0x77'))](_0x05c1('0x98')+_0x5977ca);}if(!_['includes'](_0x5977ca,_0xf6dfb5[_0x05c1('0x5a')]['mapKey'])){throw new db[(_0x05c1('0x94'))][(_0x05c1('0x77'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5977ca);}_0x3b0dbd[_0xf6dfb5[_0x05c1('0x5a')][_0x05c1('0x97')]]=_0xf6dfb5['body'][_0x05c1('0x7f')];return db[_0x05c1('0x99')][_0x05c1('0x58')]({'where':{'id':_0xf6dfb5[_0x05c1('0x72')][_0x05c1('0x7c')]},'include':[{'model':db[_0x05c1('0x75')],'as':_0x05c1('0x9a'),'where':_0x3b0dbd,'limit':0x1,'order':[[_0x05c1('0x7a'),_0x05c1('0x9b')]]}]});})[_0x05c1('0x1e')](handleEntityNotFound(_0x5bf5e8,null))[_0x05c1('0x1e')](function(_0x436cf3){if(_0x436cf3){_0xf6dfb5[_0x05c1('0x9c')]=_['omit'](_0x436cf3,[_0x05c1('0x9a')]);if(_0x436cf3[_0x05c1('0x9a')][_0x05c1('0x47')]){return _0x436cf3[_0x05c1('0x9a')][0x0];}var _0x1ba8a8=_['defaults'](_0xf6dfb5[_0x05c1('0x5a')],{'firstName':_0xf6dfb5['body'][_0x05c1('0x7f')],'ListId':_0x436cf3['id']});_0x1ba8a8[_0xf6dfb5[_0x05c1('0x5a')][_0x05c1('0x97')]]=_0xf6dfb5['body'][_0x05c1('0x7f')];return db[_0x05c1('0x75')][_0x05c1('0x59')](_0x1ba8a8,{'fields':_0x3f9497,'raw':!![]});}})[_0x05c1('0x1e')](handleEntityNotFound(_0x5bf5e8,null))[_0x05c1('0x1e')](function(_0x3d945a){if(_0x3d945a){_0xf6dfb5[_0x05c1('0x9d')]=_0x3d945a;var _0x3da06c={'ContactId':_0x3d945a['id'],'phone':_0xf6dfb5[_0x05c1('0x5a')][_0x05c1('0x7f')],'SmsAccountId':_0x260363[_0x05c1('0x61')]['id']};var _0x28e3a4={'ContactId':_0x3d945a['id'],'SmsAccountId':_0x260363[_0x05c1('0x61')]['id'],'closed':![]};return db[_0x05c1('0x9e')]['find']({'where':_0x28e3a4})[_0x05c1('0x1e')](function(_0x3304f4){if(_0x3304f4){return[_0x3304f4,![]];}return db[_0x05c1('0x9e')][_0x05c1('0x59')](_0x3da06c)[_0x05c1('0x1e')](function(_0x5cdd1d){return[_0x5cdd1d,!![]];});});}})[_0x05c1('0x9f')](function(_0x3fa994,_0x202e0a){_0xf6dfb5['interaction']=_0x3fa994[_0x05c1('0x36')]({'plain':!![]});_0xf6dfb5[_0x05c1('0xa0')]['created']=![];if(_0x202e0a){if(_0xf6dfb5['account'][_0x05c1('0xa1')]){_0xf6dfb5[_0x05c1('0x73')][_0x05c1('0xa2')]({'id':0x0,'priority':_0xf6dfb5[_0x05c1('0x73')][_0x05c1('0x47')]+0x1,'app':'close','appdata':_0x05c1('0xa3'),'interval':_0x05c1('0xa4')});}_0xf6dfb5[_0x05c1('0xa0')]['created']=!![];}return db['SmsMessage']['create']({'phone':_0xf6dfb5[_0x05c1('0x5a')][_0x05c1('0x7f')],'messageId':_0xf6dfb5[_0x05c1('0x5a')][_0x05c1('0x82')],'body':_0xf6dfb5[_0x05c1('0x5a')]['body'],'SmsAccountId':_0x260363['params']['id'],'SmsInteractionId':_0x3fa994['id'],'direction':'in','ContactId':_0x3fa994[_0x05c1('0xa5')],'AttachmentId':_0xf6dfb5[_0x05c1('0x5a')][_0x05c1('0xa6')]});})[_0x05c1('0x1e')](function(_0x434635){_0xf6dfb5[_0x05c1('0x26')]=_0x434635;if(_0xf6dfb5['interaction']['UserId']){return db['User'][_0x05c1('0x58')]({'attributes':['id','name'],'where':{'id':_0xf6dfb5[_0x05c1('0xa0')][_0x05c1('0xa7')]}})[_0x05c1('0x1e')](function(_0x3ab2ff){if(_0x3ab2ff){_0xf6dfb5['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x05c1('0xa8'),'appdata':_0x3ab2ff['name']+','+(_0xf6dfb5[_0x05c1('0x72')]['waitForTheAssignedAgent']||0xa),'interval':_0x05c1('0xa4')});}return respondWithRpcPromise(_0x05c1('0xa9'),'startRouting',_0xf6dfb5);});}return respondWithRpcPromise(_0x05c1('0xa9'),_0x05c1('0xaa'),_0xf6dfb5);})[_0x05c1('0x1e')](function(_0x505e4d){if(_0x505e4d){var _0x34e746=0xc8;var _0x35703f=_0x05c1('0xab');logger[_0x05c1('0x1f')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x35703f,_0x34e746,_0x05c1('0xac'));logger[_0x05c1('0xad')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x35703f,_0x34e746,_0x05c1('0xac'),JSON[_0x05c1('0x23')](_0x505e4d));if(_0xf6dfb5[_0x05c1('0x72')][_0x05c1('0x40')]===_0x05c1('0x7e')){return _0x5bf5e8[_0x05c1('0x2e')](_0x34e746)[_0x05c1('0xae')](_0x05c1('0xaf'),_0x05c1('0xb0'))[_0x05c1('0xb1')](_0x05c1('0xb2'));}else{return _0x5bf5e8['status'](_0x34e746)['json'](_0x505e4d);}}})[_0x05c1('0x54')](handleError(_0x5bf5e8,null));};exports[_0x05c1('0xb3')]=function(_0x34d27e,_0x45f435){var _0x366e4b=_0x34d27e[_0x05c1('0x61')]['id'];var _0x5d2b36=_0x34d27e[_0x05c1('0x5a')];var _0x5d29fa=0xc8;var _0x29da43=null;return db[_0x05c1('0xb4')][_0x05c1('0xb5')]({'isolationLevel':db[_0x05c1('0xb4')][_0x05c1('0xb6')]['ISOLATION_LEVELS'][_0x05c1('0xb7')]},function(_0x2718cd){return db[_0x05c1('0x3e')][_0x05c1('0x65')]({'where':{'id':_0x366e4b},'transaction':_0x2718cd})[_0x05c1('0x1e')](function(_0x9b3881){if(_0x9b3881){return db['SmsApplication']['destroy']({'where':{'SmsAccountId':_0x366e4b},'transaction':_0x2718cd})['then'](function(){var _0x3129b0=_[_0x05c1('0x3d')](_0x5d2b36,function(_0xc63622){_0xc63622[_0x05c1('0x63')]=_0x366e4b;return _0xc63622;});return db['SmsApplication'][_0x05c1('0xb8')](_0x3129b0,{'transaction':_0x2718cd});});}else{_0x5d29fa=0x194;_0x29da43=[];}});})[_0x05c1('0x1e')](function(){if(_0x5d29fa!==0x194){return db[_0x05c1('0x70')][_0x05c1('0xb9')]({'where':{'SmsAccountId':_0x366e4b},'order':_0x05c1('0x74')})[_0x05c1('0x1e')](function(_0x292e5f){_0x29da43=_0x292e5f;});}})[_0x05c1('0x54')](function(_0x3349d8){_0x5d29fa=0x1f4;logger[_0x05c1('0x24')](_0x3349d8[_0x05c1('0x38')]);if(_0x3349d8[_0x05c1('0x39')]){delete _0x3349d8[_0x05c1('0x39')];}_0x29da43=_0x3349d8;})[_0x05c1('0xba')](function(){if(_0x29da43===null){_0x45f435[_0x05c1('0x28')](_0x5d29fa);}else{if(_0x5d29fa===0x1f4){_0x45f435[_0x05c1('0x2e')](_0x5d29fa)['send'](_0x29da43);}else{_0x45f435['status'](_0x5d29fa)['json'](_0x29da43);}}});};exports[_0x05c1('0xbb')]=function(_0x190847,_0x53134a,_0x138f5f){var _0x4c07da={};var _0x197b3a={};var _0x29c996;var _0x2c15cd;return db['SmsAccount']['findOne']({'where':{'id':_0x190847[_0x05c1('0x61')]['id']}})[_0x05c1('0x1e')](handleEntityNotFound(_0x53134a,null))[_0x05c1('0x1e')](function(_0x59c1bd){if(_0x59c1bd){_0x29c996=_0x59c1bd;_0x197b3a[_0x05c1('0x44')]=_[_0x05c1('0x56')](db['SmsApplication'][_0x05c1('0x57')]);_0x197b3a[_0x05c1('0x41')]=_[_0x05c1('0x56')](_0x190847['query']);_0x197b3a['filters']=_['intersection'](_0x197b3a[_0x05c1('0x44')],_0x197b3a[_0x05c1('0x41')]);_0x4c07da[_0x05c1('0x46')]=_[_0x05c1('0x43')](_0x197b3a['model'],qs[_0x05c1('0x45')](_0x190847['query'][_0x05c1('0x45')]));_0x4c07da[_0x05c1('0x46')]=_0x4c07da[_0x05c1('0x46')][_0x05c1('0x47')]?_0x4c07da[_0x05c1('0x46')]:_0x197b3a['model'];_0x4c07da['order']=qs[_0x05c1('0x4a')](_0x190847['query']['sort']);_0x4c07da[_0x05c1('0x4b')]=qs[_0x05c1('0x42')](_[_0x05c1('0x4c')](_0x190847[_0x05c1('0x41')],_0x197b3a[_0x05c1('0x42')]));if(_0x190847['query'][_0x05c1('0x4d')]){_0x4c07da[_0x05c1('0x4b')]=_['merge'](_0x4c07da['where'],{'$or':_[_0x05c1('0x3d')](_0x4c07da[_0x05c1('0x46')],function(_0x694953){var _0x1576e1={};_0x1576e1[_0x694953]={'$like':'%'+_0x190847['query']['filter']+'%'};return _0x1576e1;})});}_0x4c07da=_['merge']({},_0x4c07da,_0x190847[_0x05c1('0x50')]);return _0x29c996['getApplications'](_0x4c07da);}})[_0x05c1('0x1e')](function(_0x121f55){if(_0x121f55){_0x2c15cd=_0x121f55[_0x05c1('0x47')];if(!_0x190847[_0x05c1('0x41')][_0x05c1('0x48')](_0x05c1('0x49'))){_0x4c07da[_0x05c1('0x2d')]=qs[_0x05c1('0x2d')](_0x190847[_0x05c1('0x41')]['limit']);_0x4c07da['offset']=qs[_0x05c1('0x2a')](_0x190847[_0x05c1('0x41')][_0x05c1('0x2a')]);}return _0x29c996[_0x05c1('0xbb')](_0x4c07da);}})['then'](function(_0x156d99){if(_0x156d99){return _0x156d99?{'count':_0x2c15cd,'rows':_0x156d99}:null;}})[_0x05c1('0x1e')](respondWithResult(_0x53134a,null))[_0x05c1('0x54')](handleError(_0x53134a,null));};exports[_0x05c1('0xbc')]=function(_0x453779,_0x5c4597,_0x57f957){var _0x5cb829={'raw':![],'where':{}};var _0x466510={};var _0x51ec9e={'count':0x0,'rows':[]};return db[_0x05c1('0x3e')][_0x05c1('0x65')]({'where':{'id':_0x453779[_0x05c1('0x61')]['id']}})[_0x05c1('0x1e')](handleEntityNotFound(_0x5c4597,null))[_0x05c1('0x1e')](function(_0x877e58){if(_0x877e58){_0x466510[_0x05c1('0x44')]=_['keys'](db[_0x05c1('0x9e')][_0x05c1('0x57')]);_0x466510['query']=_['keys'](_0x453779[_0x05c1('0x41')]);_0x466510['filters']=_['intersection'](_0x466510['model'],_0x466510['query']);_0x5cb829[_0x05c1('0x46')]=_[_0x05c1('0x43')](_0x466510[_0x05c1('0x44')],qs['fields'](_0x453779[_0x05c1('0x41')]['fields']));_0x5cb829[_0x05c1('0x46')]=_0x5cb829[_0x05c1('0x46')]['length']?_0x5cb829[_0x05c1('0x46')]:_0x466510[_0x05c1('0x44')];if(!_0x453779[_0x05c1('0x41')][_0x05c1('0x48')](_0x05c1('0x49'))){_0x5cb829['limit']=qs['limit'](_0x453779['query']['limit']);_0x5cb829[_0x05c1('0x2a')]=qs[_0x05c1('0x2a')](_0x453779['query']['offset']);}_0x5cb829['order']=qs[_0x05c1('0x4a')](_0x453779[_0x05c1('0x41')][_0x05c1('0x4a')]);_0x5cb829[_0x05c1('0x4b')]=qs['filters'](_[_0x05c1('0x4c')](_0x453779[_0x05c1('0x41')],_0x466510[_0x05c1('0x42')]));_0x5cb829[_0x05c1('0x4b')][_0x05c1('0x63')]=_0x877e58['id'];if(_0x453779['query'][_0x05c1('0x4d')]){_0x5cb829['where']=_[_0x05c1('0x4e')](_0x5cb829[_0x05c1('0x4b')],{'$or':_['map'](_0x5cb829[_0x05c1('0x46')],function(_0x57dba4){var _0x571a1f={};_0x571a1f[_0x57dba4]={'$like':'%'+_0x453779[_0x05c1('0x41')]['filter']+'%'};return _0x571a1f;})});}_0x5cb829=_[_0x05c1('0x4e')]({},_0x5cb829,_0x453779[_0x05c1('0x50')]);return db['SmsInteraction'][_0x05c1('0x2c')]({'where':_0x5cb829[_0x05c1('0x4b')]})[_0x05c1('0x1e')](function(_0x22f7c6){_0x51ec9e[_0x05c1('0x2c')]=_0x22f7c6;if(_0x453779[_0x05c1('0x41')]['includeAll']){_0x5cb829['include']=[{'model':db[_0x05c1('0x75')],'as':_0x05c1('0xbd'),'required':![]},{'model':db['User'],'as':_0x05c1('0xbe'),'attributes':[_0x05c1('0x39'),'fullname',_0x05c1('0xbf')],'required':![]},{'model':db[_0x05c1('0xc0')],'as':_0x05c1('0xc1'),'attributes':['id','name',_0x05c1('0xc2')],'where':_0x453779['query'][_0x05c1('0xc3')]?{'id':_0x453779[_0x05c1('0x41')]['tag']}:undefined,'required':_0x453779[_0x05c1('0x41')][_0x05c1('0xc3')]?!![]:![]}];}return db['SmsInteraction'][_0x05c1('0x67')](_0x5cb829);})[_0x05c1('0x1e')](function(_0xcf233d){_0x51ec9e[_0x05c1('0x53')]=_0xcf233d;return _0x51ec9e;});}})[_0x05c1('0x1e')](respondWithFilteredResult(_0x5c4597,_0x5cb829))[_0x05c1('0x54')](handleError(_0x5c4597,null));};exports[_0x05c1('0xb1')]=function(_0x2a802a,_0x1c0f39,_0x26956a){var _0x2c48ea,_0x25b6ec,_0x731d09;if(_[_0x05c1('0x93')](_0x2a802a[_0x05c1('0x5a')]['body'])||_0x2a802a[_0x05c1('0x5a')]['body']===''){throw new db['Sequelize']['ValidationError'](_0x05c1('0x96'));}if(_['isNil'](_0x2a802a['body']['to'])){throw new db[(_0x05c1('0x94'))][(_0x05c1('0x77'))](_0x05c1('0xc4'));}_0x2c48ea=_0x2a802a['body']['to'];return db[_0x05c1('0x3e')][_0x05c1('0x58')]({'where':{'id':_0x2a802a[_0x05c1('0x61')]['id']},'include':[{'model':db[_0x05c1('0x99')],'as':_0x05c1('0xc5'),'include':[{'model':db[_0x05c1('0x75')],'as':'Contacts','where':{'mobile':_0x2c48ea},'limit':0x1,'order':[['updatedAt',_0x05c1('0x9b')]]}]}]})['then'](handleEntityNotFound(_0x1c0f39,null))[_0x05c1('0x1e')](function(_0x11b74f){if(_0x11b74f&&_0x11b74f['List']){_0x25b6ec=_0x11b74f[_0x05c1('0x36')]({'plain':!![]});if(_0x25b6ec[_0x05c1('0xc5')]&&_0x25b6ec[_0x05c1('0xc5')]['Contacts'][_0x05c1('0x47')]){return _0x25b6ec[_0x05c1('0xc5')][_0x05c1('0x9a')][0x0];}return db[_0x05c1('0x75')]['create'](_['defaults'](_0x2a802a[_0x05c1('0x5a')],{'firstName':_0x2c48ea,'mobile':_0x2c48ea,'phone':_0x2c48ea,'ListId':_0x25b6ec[_0x05c1('0x7c')]}));}})[_0x05c1('0x1e')](handleEntityNotFound(_0x1c0f39,null))[_0x05c1('0x1e')](function(_0x56d3b9){if(_0x56d3b9){_0x731d09=_0x56d3b9;return db['SmsInteraction'][_0x05c1('0x58')]({'where':{'ContactId':_0x731d09['id'],'closed':![],'SmsAccountId':_0x25b6ec['id']}})[_0x05c1('0x1e')](function(_0x5091c2){if(_0x5091c2){return[_0x5091c2,![]];}return db[_0x05c1('0x9e')][_0x05c1('0x59')]({'UserId':_0x2a802a[_0x05c1('0xc6')]['id'],'ContactId':_0x731d09['id'],'SmsAccountId':_0x25b6ec['id'],'phone':_0x2c48ea,'firstMsgDirection':_0x05c1('0xc7'),'Messages':[_[_0x05c1('0x4e')](_0x2a802a[_0x05c1('0x5a')],{'read':![],'body':_0x2a802a[_0x05c1('0x5a')][_0x05c1('0x5a')],'phone':_0x2c48ea,'SmsAccountId':_0x25b6ec['id'],'UserId':_0x2a802a['user']['id'],'ContactId':_0x731d09['id']})]},{'include':[{'model':db[_0x05c1('0xc8')],'as':'Messages'}]})[_0x05c1('0x1e')](function(_0x44af41){return[_0x44af41,!![]];});});}})[_0x05c1('0x9f')](function(_0x361eb7,_0x3c816d){if(_0x3c816d){return _0x361eb7;}return db['SmsMessage']['create'](_[_0x05c1('0x4e')](_0x2a802a['body'],{'read':![],'body':_0x2a802a[_0x05c1('0x5a')][_0x05c1('0x5a')],'phone':_0x2c48ea,'SmsAccountId':_0x25b6ec['id'],'SmsInteractionId':_0x361eb7['id'],'UserId':_0x2a802a[_0x05c1('0xc6')]['id'],'ContactId':_0x731d09['id']}))[_0x05c1('0x1e')](function(_0xa8761b){_0x361eb7[_0x05c1('0xc9')][_0x05c1('0xca')]=[];_0x361eb7['dataValues'][_0x05c1('0xca')]['push'](_0xa8761b[_0x05c1('0xc9')]);return _0x361eb7;});})['then'](respondWithResult(_0x1c0f39,null))[_0x05c1('0x54')](handleError(_0x1c0f39,null));};exports[_0x05c1('0x2e')]=function(_0x3bce4d,_0x5acce3,_0x2cf5c0){if(_0x3bce4d[_0x05c1('0x5a')]['id']){delete _0x3bce4d[_0x05c1('0x5a')]['id'];}var _0x4d14f6,_0x3f009b,_0x129d0a;return db[_0x05c1('0x3e')][_0x05c1('0x58')]({'where':{'id':_0x3bce4d[_0x05c1('0x61')]['id']}})[_0x05c1('0x1e')](handleEntityNotFound(_0x5acce3,null))[_0x05c1('0x1e')](function(_0x3b5eee){if(_0x3b5eee){_0x129d0a=_0x3b5eee;logger[_0x05c1('0xad')](_0x05c1('0x22'),'status',_0x05c1('0xcb'),_0x3b5eee['type'],util['inspect'](_0x3bce4d[_0x05c1('0x5a')],{'showHidden':![],'depth':null}));switch(_0x3b5eee[_0x05c1('0x40')]){case _0x05c1('0x84'):if(_0x3bce4d['body'][_0x05c1('0xcc')]&&_0x3bce4d[_0x05c1('0x5a')][_0x05c1('0x2e')]){_0x3f009b=_0x3bce4d[_0x05c1('0x5a')][_0x05c1('0x2e')];return db[_0x05c1('0xc8')][_0x05c1('0x58')]({'where':{'messageId':_0x3bce4d[_0x05c1('0x5a')][_0x05c1('0xcc')]}});}break;case _0x05c1('0xcd'):if(_0x3bce4d[_0x05c1('0x5a')][_0x05c1('0xce')]&&_0x3bce4d[_0x05c1('0x5a')][_0x05c1('0xcf')]){_0x3f009b=_0x3bce4d[_0x05c1('0x5a')][_0x05c1('0xcf')];return db[_0x05c1('0xc8')]['find']({'where':{'messageId':_0x3bce4d[_0x05c1('0x5a')][_0x05c1('0xce')]}});}break;case'clicksend':if(_0x3bce4d[_0x05c1('0x5a')]['message_id']&&_0x3bce4d[_0x05c1('0x5a')]['status_code']){_0x3f009b=_0x3bce4d[_0x05c1('0x5a')][_0x05c1('0xd0')];return db[_0x05c1('0xc8')][_0x05c1('0x58')]({'where':{'messageId':_0x3bce4d[_0x05c1('0x5a')][_0x05c1('0x88')]}});}break;case _0x05c1('0x8c'):var _0x5f45ba=_0x3bce4d[_0x05c1('0x5a')]['results'][0x0];if(_0x5f45ba[_0x05c1('0x82')]&&_0x5f45ba[_0x05c1('0x2e')][_0x05c1('0xd1')]==='DELIVERED'){_0x3f009b=_0x5f45ba[_0x05c1('0x2e')]['groupName'];return db[_0x05c1('0xc8')][_0x05c1('0x58')]({'where':{'messageId':_0x5f45ba[_0x05c1('0x82')]}});}break;case'clickatell':if(_0x3bce4d['body'][_0x05c1('0x82')]&&_0x3bce4d[_0x05c1('0x5a')][_0x05c1('0x2e')]){_0x3f009b=_0x3bce4d['body'][_0x05c1('0x2e')];return db[_0x05c1('0xc8')][_0x05c1('0x58')]({'where':{'messageId':_0x3bce4d[_0x05c1('0x5a')][_0x05c1('0x82')]}});}break;case'bandwidth':if(_0x3bce4d[_0x05c1('0x5a')][0x0]['message']['id']){_0x3f009b=_0x3bce4d[_0x05c1('0x5a')][0x0]['type'];return db[_0x05c1('0xc8')][_0x05c1('0x58')]({'where':{'messageId':_0x3bce4d[_0x05c1('0x5a')][0x0][_0x05c1('0x26')]['id']}});}break;case _0x05c1('0x91'):if(_0x3bce4d['body'][_0x05c1('0xd2')]&&_0x3bce4d[_0x05c1('0x5a')]['status']){_0x3f009b=_0x3bce4d[_0x05c1('0x5a')][_0x05c1('0x2e')];return db['SmsMessage']['find']({'where':{'messageId':_0x3bce4d[_0x05c1('0x5a')]['redif']}});}break;}}})[_0x05c1('0x1e')](handleEntityNotFound(_0x5acce3,null))[_0x05c1('0x1e')](function(_0x37a6c8){if(_0x37a6c8){_0x4d14f6=_0x37a6c8;switch(_0x129d0a[_0x05c1('0x40')]){case _0x05c1('0x84'):if(_0x3f009b==='DELIVERED'){return _0x4d14f6[_0x05c1('0x34')]({'read':!![]});}else{logger['error'](_0x05c1('0x22'),_0x05c1('0x2e'),_0x05c1('0x84'),util[_0x05c1('0xd3')](_0x3bce4d[_0x05c1('0x5a')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x3f009b==='1'){return _0x4d14f6[_0x05c1('0x34')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x05c1('0x2e'),_0x05c1('0x84'),util[_0x05c1('0xd3')](_0x3bce4d[_0x05c1('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x05c1('0x87'):if(!_0x3bce4d[_0x05c1('0x5a')][_0x05c1('0xd4')]&&_0x3f009b>=0xc8&&_0x3f009b<=0xce){return _0x4d14f6['update']({'read':!![]});}else{logger[_0x05c1('0x24')](_0x05c1('0x22'),'status',_0x05c1('0x87'),util[_0x05c1('0xd3')](_0x3bce4d[_0x05c1('0x5a')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x4d7c75=_0x3bce4d[_0x05c1('0x5a')][_0x05c1('0x8d')][0x0];if(_0x4d7c75['status']['groupName']===_0x05c1('0xd5')){return _0x4d14f6[_0x05c1('0x34')]({'read':!![]});}else{logger[_0x05c1('0x24')](_0x05c1('0x22'),'status',_0x05c1('0x8c'),util[_0x05c1('0xd3')](_0x3bce4d[_0x05c1('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x05c1('0x8f'):if(_0x3f009b==_0x05c1('0xd6')||_0x3f009b=='RECEIVED_BY_RECIPIENT'){return _0x4d14f6['update']({'read':!![]});}else{logger['error'](_0x05c1('0x22'),_0x05c1('0x2e'),_0x05c1('0x8f'),util[_0x05c1('0xd3')](_0x3bce4d[_0x05c1('0x5a')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x3f009b=='message-delivered'){return _0x4d14f6[_0x05c1('0x34')]({'read':!![]});}else{logger[_0x05c1('0x24')](_0x05c1('0x22'),_0x05c1('0x2e'),_0x05c1('0x90'),util[_0x05c1('0xd3')](_0x3bce4d[_0x05c1('0x5a')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x3f009b===_0x05c1('0xd7')||_0x3f009b==='ACCEPTD'){return _0x4d14f6['update']({'read':!![]});}else{logger[_0x05c1('0x24')](_0x05c1('0x22'),'status',_0x05c1('0x91'),util[_0x05c1('0xd3')](_0x3bce4d[_0x05c1('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x4d14f6;}})['then'](respondWithResult(_0x5acce3,null))[_0x05c1('0x54')](handleError(_0x5acce3,null));};exports[_0x05c1('0xd8')]=function(_0x35a1d1,_0x2d660f,_0x163079){var _0x1f0a52,_0x17c7c9,_0x5d7086;return db['SmsAccount'][_0x05c1('0x58')]({'where':{'id':_0x35a1d1[_0x05c1('0x61')]['id']}})[_0x05c1('0x1e')](handleEntityNotFound(_0x2d660f,null))[_0x05c1('0x1e')](function(_0x868880){if(_0x868880){_0x5d7086=_0x868880;logger[_0x05c1('0xad')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x05c1('0x2e'),_0x05c1('0xcb'),_0x868880['type'],util['inspect'](_0x35a1d1['query'],{'showHidden':![],'depth':null}));switch(_0x868880['type']){case _0x05c1('0xd9'):if(_0x35a1d1['query']['message-id']&&_0x35a1d1[_0x05c1('0x41')][_0x05c1('0xda')]){_0x17c7c9=_0x35a1d1[_0x05c1('0x41')][_0x05c1('0xda')];return db['SmsMessage']['find']({'where':{'messageId':_0x35a1d1['query'][_0x05c1('0xdb')]}});}break;}}})['then'](handleEntityNotFound(_0x2d660f,null))[_0x05c1('0x1e')](function(_0x2c5ac7){if(_0x2c5ac7){_0x1f0a52=_0x2c5ac7;switch(_0x5d7086['type']){case _0x05c1('0xd9'):if(_0x17c7c9==='2'||_0x17c7c9==='6'){return _0x1f0a52[_0x05c1('0x34')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x05c1('0xd9'),util[_0x05c1('0xd3')](_0x35a1d1['query'],{'showHidden':![],'depth':null}));};break;}return _0x1f0a52;}})['then'](respondWithResult(_0x2d660f,null))['catch'](handleError(_0x2d660f,null));};exports[_0x05c1('0xdc')]=function(_0x347423,_0xa88bf6,_0x337a44){return db[_0x05c1('0x3e')]['find']({'where':{'id':_0x347423['params']['id']}})['then'](handleEntityNotFound(_0xa88bf6,null))[_0x05c1('0x1e')](function(_0x341cc4){if(_0x341cc4){return _0x341cc4[_0x05c1('0xdc')](_0x347423[_0x05c1('0x5a')][_0x05c1('0x69')],_['omit'](_0x347423[_0x05c1('0x5a')],['ids','id'])||{})[_0x05c1('0x9f')](function(_0x423f87){for(var _0x18c64b=0x0;_0x18c64b<_0x347423['body'][_0x05c1('0x69')][_0x05c1('0x47')];_0x18c64b+=0x1){socket[_0x05c1('0xdd')](_0x05c1('0xde'),{'UserId':Number(_0x347423[_0x05c1('0x5a')]['ids'][_0x18c64b]),'SmsAccountId':Number(_0x347423[_0x05c1('0x61')]['id'])});}return _0x423f87;});}})[_0x05c1('0x1e')](respondWithResult(_0xa88bf6,null))['catch'](handleError(_0xa88bf6,null));};exports[_0x05c1('0xdf')]=function(_0x212395,_0x5eb49f,_0x505cf5){return db['SmsAccount'][_0x05c1('0x58')]({'where':{'id':_0x212395['params']['id']}})['then'](handleEntityNotFound(_0x5eb49f,null))[_0x05c1('0x1e')](function(_0x1615e7){if(_0x1615e7){return _0x1615e7[_0x05c1('0xdf')](_0x212395[_0x05c1('0x41')][_0x05c1('0x69')])[_0x05c1('0x1e')](function(){if(_['isArray'](_0x212395[_0x05c1('0x41')][_0x05c1('0x69')])){for(var _0xdd7ec5=0x0;_0xdd7ec5<_0x212395['query']['ids'][_0x05c1('0x47')];_0xdd7ec5+=0x1){socket[_0x05c1('0xdd')]('userSmsAccount:remove',{'UserId':Number(_0x212395[_0x05c1('0x41')][_0x05c1('0x69')][_0xdd7ec5]),'SmsAccountId':Number(_0x212395[_0x05c1('0x61')]['id'])});}}else{socket[_0x05c1('0xdd')](_0x05c1('0xe0'),{'UserId':Number(_0x212395[_0x05c1('0x41')][_0x05c1('0x69')]),'SmsAccountId':Number(_0x212395[_0x05c1('0x61')]['id'])});}});}})[_0x05c1('0x1e')](respondWithStatusCode(_0x5eb49f,null))[_0x05c1('0x54')](handleError(_0x5eb49f,null));};exports['getAgents']=function(_0xa7f170,_0x438622,_0x92a1cc){var _0x4cf178={};var _0x5c0578={};var _0x51b890;var _0x3860a7;return db['SmsAccount'][_0x05c1('0x65')]({'where':{'id':_0xa7f170[_0x05c1('0x61')]['id']}})['then'](handleEntityNotFound(_0x438622,null))[_0x05c1('0x1e')](function(_0x30d431){if(_0x30d431){_0x51b890=_0x30d431;_0x5c0578['model']=_[_0x05c1('0x56')](db[_0x05c1('0xe1')][_0x05c1('0x57')]);_0x5c0578['query']=_[_0x05c1('0x56')](_0xa7f170[_0x05c1('0x41')]);_0x5c0578[_0x05c1('0x42')]=_[_0x05c1('0x43')](_0x5c0578[_0x05c1('0x44')],_0x5c0578[_0x05c1('0x41')]);_0x4cf178[_0x05c1('0x46')]=_[_0x05c1('0x43')](_0x5c0578[_0x05c1('0x44')],qs[_0x05c1('0x45')](_0xa7f170[_0x05c1('0x41')]['fields']));_0x4cf178['attributes']=_0x4cf178[_0x05c1('0x46')][_0x05c1('0x47')]?_0x4cf178[_0x05c1('0x46')]:_0x5c0578[_0x05c1('0x44')];_0x4cf178['order']=qs[_0x05c1('0x4a')](_0xa7f170[_0x05c1('0x41')][_0x05c1('0x4a')]);_0x4cf178['where']=qs[_0x05c1('0x42')](_['pick'](_0xa7f170['query'],_0x5c0578[_0x05c1('0x42')]));if(_0xa7f170[_0x05c1('0x41')][_0x05c1('0x4d')]){_0x4cf178[_0x05c1('0x4b')]=_[_0x05c1('0x4e')](_0x4cf178[_0x05c1('0x4b')],{'$or':_[_0x05c1('0x3d')](_0x4cf178[_0x05c1('0x46')],function(_0x11b142){var _0x207675={};_0x207675[_0x11b142]={'$like':'%'+_0xa7f170['query'][_0x05c1('0x4d')]+'%'};return _0x207675;})});}_0x4cf178=_[_0x05c1('0x4e')]({},_0x4cf178,_0xa7f170['options']);return _0x51b890[_0x05c1('0xe2')](_0x4cf178);}})[_0x05c1('0x1e')](function(_0x57a1cd){if(_0x57a1cd){_0x3860a7=_0x57a1cd[_0x05c1('0x47')];if(!_0xa7f170[_0x05c1('0x41')]['hasOwnProperty'](_0x05c1('0x49'))){_0x4cf178['limit']=qs['limit'](_0xa7f170[_0x05c1('0x41')][_0x05c1('0x2d')]);_0x4cf178[_0x05c1('0x2a')]=qs[_0x05c1('0x2a')](_0xa7f170[_0x05c1('0x41')][_0x05c1('0x2a')]);}return _0x51b890['getAgents'](_0x4cf178);}})[_0x05c1('0x1e')](function(_0x27beb1){if(_0x27beb1){return _0x27beb1?{'count':_0x3860a7,'rows':_0x27beb1}:null;}})[_0x05c1('0x1e')](respondWithResult(_0x438622,null))[_0x05c1('0x54')](handleError(_0x438622,null));};
\ No newline at end of file
index c41ea1f..c8b653f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59bc=['hook','../../mysqldb','SmsAccount','save','update','remove','emit','hasOwnProperty'];(function(_0x5adad9,_0x50ed40){var _0x559177=function(_0x596ad3){while(--_0x596ad3){_0x5adad9['push'](_0x5adad9['shift']());}};_0x559177(++_0x50ed40);}(_0x59bc,0x199));var _0xc59b=function(_0x58b45e,_0x497ecd){_0x58b45e=_0x58b45e-0x0;var _0x47f960=_0x59bc[_0x58b45e];return _0x47f960;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0xc59b('0x0'))['db'][_0xc59b('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc59b('0x2'),'afterUpdate':_0xc59b('0x3'),'afterDestroy':_0xc59b('0x4')};function emitEvent(_0x3b0261){return function(_0x11556e,_0x333ae4,_0x2c6477){SmsAccountEvents[_0xc59b('0x5')](_0x3b0261+':'+_0x11556e['id'],_0x11556e);SmsAccountEvents[_0xc59b('0x5')](_0x3b0261,_0x11556e);_0x2c6477(null);};}for(var e in events){if(events[_0xc59b('0x6')](e)){var event=events[e];SmsAccount[_0xc59b('0x7')](e,emitEvent(event));}}module['exports']=SmsAccountEvents;
\ No newline at end of file
+var _0x2973=['exports','events','../../mysqldb','SmsAccount','save','update','remove','emit','hook'];(function(_0x375072,_0x1ad2ed){var _0x3e82e7=function(_0x2a03ec){while(--_0x2a03ec){_0x375072['push'](_0x375072['shift']());}};_0x3e82e7(++_0x1ad2ed);}(_0x2973,0x17b));var _0x3297=function(_0xce1a87,_0x372c44){_0xce1a87=_0xce1a87-0x0;var _0x26669d=_0x2973[_0xce1a87];return _0x26669d;};'use strict';var EventEmitter=require(_0x3297('0x0'));var SmsAccount=require(_0x3297('0x1'))['db'][_0x3297('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3297('0x3'),'afterUpdate':_0x3297('0x4'),'afterDestroy':_0x3297('0x5')};function emitEvent(_0x187349){return function(_0xe384a8,_0x1f1ee8,_0x33d662){SmsAccountEvents['emit'](_0x187349+':'+_0xe384a8['id'],_0xe384a8);SmsAccountEvents[_0x3297('0x6')](_0x187349,_0xe384a8);_0x33d662(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x3297('0x7')](e,emitEvent(event));}}module[_0x3297('0x8')]=SmsAccountEvents;
\ No newline at end of file
index ea44246..9b7f9cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4940=['path','rimraf','../../config/environment','exports','SmsAccount','sms_accounts','lodash','util','api','bluebird'];(function(_0x5cbbcb,_0x3c2d6b){var _0x2fdbce=function(_0x425e93){while(--_0x425e93){_0x5cbbcb['push'](_0x5cbbcb['shift']());}};_0x2fdbce(++_0x3c2d6b);}(_0x4940,0x15a));var _0x0494=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x4940[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x0494('0x0'));var util=require(_0x0494('0x1'));var logger=require('../../config/logger')(_0x0494('0x2'));var moment=require('moment');var BPromise=require(_0x0494('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0494('0x4'));var rimraf=require(_0x0494('0x5'));var config=require(_0x0494('0x6'));var attributes=require('./smsAccount.attributes');module[_0x0494('0x7')]=function(_0x1c74c5,_0x2b4520){return _0x1c74c5['define'](_0x0494('0x8'),attributes,{'tableName':_0x0494('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x63f0=['moment','request-promise','./smsAccount.attributes','define','SmsAccount','lodash','util','api'];(function(_0x4da196,_0x357dc9){var _0x375df3=function(_0x366603){while(--_0x366603){_0x4da196['push'](_0x4da196['shift']());}};_0x375df3(++_0x357dc9);}(_0x63f0,0xbd));var _0x063f=function(_0x1e2321,_0x3ae1c5){_0x1e2321=_0x1e2321-0x0;var _0x1d346d=_0x63f0[_0x1e2321];return _0x1d346d;};'use strict';var _=require(_0x063f('0x0'));var util=require(_0x063f('0x1'));var logger=require('../../config/logger')(_0x063f('0x2'));var moment=require(_0x063f('0x3'));var BPromise=require('bluebird');var rp=require(_0x063f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x063f('0x5'));module['exports']=function(_0x49d4ed,_0x31ac9c){return _0x49d4ed[_0x063f('0x6')](_0x063f('0x7'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8673b95..affc75f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e9f=['lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','ShowSmsAccount','SmsAccount','find','raw','options','where','attributes','include','map','model'];(function(_0x1f5676,_0x7af959){var _0x339a10=function(_0x2c02b5){while(--_0x2c02b5){_0x1f5676['push'](_0x1f5676['shift']());}};_0x339a10(++_0x7af959);}(_0x3e9f,0x1c8));var _0xf3e9=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x3e9f[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0xf3e9('0x0'));var util=require(_0xf3e9('0x1'));var moment=require('moment');var BPromise=require(_0xf3e9('0x2'));var rs=require(_0xf3e9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf3e9('0x4'))['db'];var utils=require(_0xf3e9('0x5'));var logger=require(_0xf3e9('0x6'))(_0xf3e9('0x7'));var config=require('../../config/environment');var jayson=require(_0xf3e9('0x8'));var client=jayson[_0xf3e9('0x9')]['http']({'port':0x232a});config[_0xf3e9('0xa')]=_[_0xf3e9('0xb')](config[_0xf3e9('0xa')],{'host':_0xf3e9('0xc'),'port':0x18eb});var socket=require(_0xf3e9('0xd'))(new Redis(config['redis']));require(_0xf3e9('0xe'))[_0xf3e9('0xf')](socket);function respondWithRpcPromise(_0x4bae47,_0x3e02f7,_0x1df41e){return new BPromise(function(_0x58169e,_0x2e4eb3){return client[_0xf3e9('0x10')](_0x4bae47,_0x1df41e)[_0xf3e9('0x11')](function(_0x170594){logger[_0xf3e9('0x12')](_0xf3e9('0x13'),_0x3e02f7,'request\x20sent');logger[_0xf3e9('0x14')](_0xf3e9('0x15'),_0x3e02f7,'request\x20sent',JSON[_0xf3e9('0x16')](_0x170594));if(_0x170594[_0xf3e9('0x17')]){if(_0x170594['error'][_0xf3e9('0x18')]===0x1f4){logger['error'](_0xf3e9('0x13'),_0x3e02f7,_0x170594[_0xf3e9('0x17')]['message']);return _0x2e4eb3(_0x170594['error']['message']);}logger[_0xf3e9('0x17')]('SmsAccount,\x20%s,\x20%s',_0x3e02f7,_0x170594[_0xf3e9('0x17')]['message']);return _0x58169e(_0x170594[_0xf3e9('0x17')][_0xf3e9('0x19')]);}else{logger[_0xf3e9('0x12')](_0xf3e9('0x13'),_0x3e02f7,_0xf3e9('0x1a'));_0x58169e(_0x170594['result']['message']);}})[_0xf3e9('0x1b')](function(_0x49cb25){logger[_0xf3e9('0x17')](_0xf3e9('0x13'),_0x3e02f7,_0x49cb25);_0x2e4eb3(_0x49cb25);});});}exports[_0xf3e9('0x1c')]=function(_0x4348de){var _0xda55d9=this;return new Promise(function(_0x1f3ef1,_0x431a93){return db[_0xf3e9('0x1d')][_0xf3e9('0x1e')]({'raw':_0x4348de['options']?_0x4348de['options'][_0xf3e9('0x1f')]===undefined?!![]:![]:!![],'where':_0x4348de['options']?_0x4348de[_0xf3e9('0x20')][_0xf3e9('0x21')]||null:null,'attributes':_0x4348de[_0xf3e9('0x20')]?_0x4348de[_0xf3e9('0x20')][_0xf3e9('0x22')]||null:null,'include':_0x4348de[_0xf3e9('0x20')]?_0x4348de[_0xf3e9('0x20')][_0xf3e9('0x23')]?_[_0xf3e9('0x24')](_0x4348de[_0xf3e9('0x20')][_0xf3e9('0x23')],function(_0x5bf8ee){return{'model':db[_0x5bf8ee[_0xf3e9('0x25')]],'as':_0x5bf8ee['as'],'attributes':_0x5bf8ee[_0xf3e9('0x22')],'include':_0x5bf8ee[_0xf3e9('0x23')]?_[_0xf3e9('0x24')](_0x5bf8ee['include'],function(_0x5cc5be){return{'model':db[_0x5cc5be[_0xf3e9('0x25')]],'as':_0x5cc5be['as'],'attributes':_0x5cc5be['attributes'],'include':_0x5cc5be[_0xf3e9('0x23')]?_[_0xf3e9('0x24')](_0x5cc5be['include'],function(_0x570bdb){return{'model':db[_0x570bdb[_0xf3e9('0x25')]],'as':_0x570bdb['as'],'attributes':_0x570bdb[_0xf3e9('0x22')]};}):[]};}):[]};}):[]:[]})[_0xf3e9('0x11')](function(_0x44e451){logger[_0xf3e9('0x12')](_0xf3e9('0x1c'),_0x4348de);logger['debug'](_0xf3e9('0x1c'),_0x4348de,JSON[_0xf3e9('0x16')](_0x44e451));_0x1f3ef1(_0x44e451);})['catch'](function(_0x5181c5){logger['error'](_0xf3e9('0x1c'),_0x5181c5[_0xf3e9('0x19')],_0x4348de);_0x431a93(_0xda55d9[_0xf3e9('0x17')](0x1f4,_0x5181c5[_0xf3e9('0x19')]));});});};
\ No newline at end of file
+var _0x5080=['client','http','redis','localhost','socket.io-emitter','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','SmsAccount','find','options','raw','where','attributes','include','map','model','ShowSmsAccount','debug','catch','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x482a1c,_0xcecccf){var _0x2dab39=function(_0x314535){while(--_0x314535){_0x482a1c['push'](_0x482a1c['shift']());}};_0x2dab39(++_0xcecccf);}(_0x5080,0xee));var _0x0508=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x5080[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x0508('0x0'));var util=require(_0x0508('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0508('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0508('0x3'));var logger=require(_0x0508('0x4'))(_0x0508('0x5'));var config=require(_0x0508('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x0508('0x7')][_0x0508('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0x0508('0x9')],{'host':_0x0508('0xa'),'port':0x18eb});var socket=require(_0x0508('0xb'))(new Redis(config[_0x0508('0x9')]));require('./smsAccount.socket')[_0x0508('0xc')](socket);function respondWithRpcPromise(_0x1f8ffa,_0x1cc576,_0x5e6125){return new BPromise(function(_0x581410,_0x6aec69){return client[_0x0508('0xd')](_0x1f8ffa,_0x5e6125)[_0x0508('0xe')](function(_0x3944dd){logger[_0x0508('0xf')](_0x0508('0x10'),_0x1cc576,_0x0508('0x11'));logger['debug'](_0x0508('0x12'),_0x1cc576,_0x0508('0x11'),JSON[_0x0508('0x13')](_0x3944dd));if(_0x3944dd['error']){if(_0x3944dd[_0x0508('0x14')]['code']===0x1f4){logger['error'](_0x0508('0x10'),_0x1cc576,_0x3944dd[_0x0508('0x14')]['message']);return _0x6aec69(_0x3944dd['error'][_0x0508('0x15')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x1cc576,_0x3944dd['error'][_0x0508('0x15')]);return _0x581410(_0x3944dd[_0x0508('0x14')][_0x0508('0x15')]);}else{logger[_0x0508('0xf')](_0x0508('0x10'),_0x1cc576,_0x0508('0x11'));_0x581410(_0x3944dd[_0x0508('0x16')][_0x0508('0x15')]);}})['catch'](function(_0x263e6d){logger[_0x0508('0x14')](_0x0508('0x10'),_0x1cc576,_0x263e6d);_0x6aec69(_0x263e6d);});});}exports['ShowSmsAccount']=function(_0x5c0874){var _0x106b58=this;return new Promise(function(_0x51ecf2,_0x3cd2c5){return db[_0x0508('0x17')][_0x0508('0x18')]({'raw':_0x5c0874['options']?_0x5c0874[_0x0508('0x19')][_0x0508('0x1a')]===undefined?!![]:![]:!![],'where':_0x5c0874[_0x0508('0x19')]?_0x5c0874[_0x0508('0x19')][_0x0508('0x1b')]||null:null,'attributes':_0x5c0874[_0x0508('0x19')]?_0x5c0874[_0x0508('0x19')][_0x0508('0x1c')]||null:null,'include':_0x5c0874['options']?_0x5c0874[_0x0508('0x19')][_0x0508('0x1d')]?_[_0x0508('0x1e')](_0x5c0874[_0x0508('0x19')][_0x0508('0x1d')],function(_0x35569e){return{'model':db[_0x35569e[_0x0508('0x1f')]],'as':_0x35569e['as'],'attributes':_0x35569e['attributes'],'include':_0x35569e[_0x0508('0x1d')]?_[_0x0508('0x1e')](_0x35569e[_0x0508('0x1d')],function(_0x4ce8c9){return{'model':db[_0x4ce8c9[_0x0508('0x1f')]],'as':_0x4ce8c9['as'],'attributes':_0x4ce8c9[_0x0508('0x1c')],'include':_0x4ce8c9[_0x0508('0x1d')]?_[_0x0508('0x1e')](_0x4ce8c9[_0x0508('0x1d')],function(_0x5e1902){return{'model':db[_0x5e1902['model']],'as':_0x5e1902['as'],'attributes':_0x5e1902[_0x0508('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0508('0xe')](function(_0x243348){logger[_0x0508('0xf')](_0x0508('0x20'),_0x5c0874);logger[_0x0508('0x21')](_0x0508('0x20'),_0x5c0874,JSON[_0x0508('0x13')](_0x243348));_0x51ecf2(_0x243348);})[_0x0508('0x22')](function(_0x209362){logger[_0x0508('0x14')](_0x0508('0x20'),_0x209362['message'],_0x5c0874);_0x3cd2c5(_0x106b58[_0x0508('0x14')](0x1f4,_0x209362[_0x0508('0x15')]));});});};
\ No newline at end of file
index a5a76e7..d54a9d4 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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'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 1f94098..9f37af3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x374305,_0x3bf2b1){var _0x48f9c6=function(_0x24588a){while(--_0x24588a){_0x374305['push'](_0x374305['shift']());}};_0x48f9c6(++_0x3bf2b1);}(_0x34e8,0x12c));var _0x834e=function(_0x2372fa,_0x529597){_0x2372fa=_0x2372fa-0x0;var _0x540ac7=_0x34e8[_0x2372fa];return _0x540ac7;};'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
+var _0xedd9=['post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x38a79b,_0x3cc87b){var _0xe36b1a=function(_0xeefaa7){while(--_0xeefaa7){_0x38a79b['push'](_0x38a79b['shift']());}};_0xe36b1a(++_0x3cc87b);}(_0xedd9,0xfc));var _0x9edd=function(_0x5af925,_0x17efe7){_0x5af925=_0x5af925-0x0;var _0x2833c0=_0xedd9[_0x5af925];return _0x2833c0;};'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('0xe')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['put'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);module['exports']=router;
\ No newline at end of file
index 2481b90..3fc8cee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf0d3=['noop','*,*,*,*','exports','STRING'];(function(_0x44f3cc,_0x31bc80){var _0x5c1bf5=function(_0x2fbff8){while(--_0x2fbff8){_0x44f3cc['push'](_0x44f3cc['shift']());}};_0x5c1bf5(++_0x31bc80);}(_0xf0d3,0x14e));var _0x3f0d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf0d3[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x3f0d('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x3f0d('0x1')],'allowNull':![],'defaultValue':_0x3f0d('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x3f0d('0x1')]},'interval':{'type':Sequelize[_0x3f0d('0x1')],'defaultValue':_0x3f0d('0x3')}};
\ No newline at end of file
+var _0x7b88=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x437536,_0x923c6e){var _0x518a23=function(_0x9b6bbc){while(--_0x9b6bbc){_0x437536['push'](_0x437536['shift']());}};_0x518a23(++_0x923c6e);}(_0x7b88,0xf0));var _0x87b8=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0x7b88[_0x5cb1af];return _0x8d7940;};'use strict';var Sequelize=require(_0x87b8('0x0'));module[_0x87b8('0x1')]={'priority':{'type':Sequelize[_0x87b8('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x87b8('0x3')],'allowNull':![],'defaultValue':_0x87b8('0x4')},'appdata':{'type':Sequelize[_0x87b8('0x5')]()},'description':{'type':Sequelize[_0x87b8('0x3')]},'interval':{'type':Sequelize[_0x87b8('0x3')],'defaultValue':_0x87b8('0x6')}};
\ No newline at end of file
index b00d8f6..415ef47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x543f=['desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','sendStatus','end','undefined','limit','count','offset','status','json','apply','save','update','destroy','then','error','stack','name','send','index','SmsApplication','rawAttributes','fieldName','model','map','keys','intersection','query','attributes','order','sort','filters','pick','filter','where','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','fields','length','include','merge','find','create','body','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x543f,0x149));var _0xf543=function(_0x37763c,_0x22c781){_0x37763c=_0x37763c-0x0;var _0x9335e0=_0x543f[_0x37763c];return _0x9335e0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf543('0x0'));var jsonpatch=require(_0xf543('0x1'));var rp=require(_0xf543('0x2'));var moment=require(_0xf543('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf543('0x4'));var util=require('util');var path=require(_0xf543('0x5'));var sox=require('sox');var csv=require(_0xf543('0x6'));var ejs=require(_0xf543('0x7'));var fs=require('fs');var fs_extra=require(_0xf543('0x8'));var _=require(_0xf543('0x9'));var squel=require(_0xf543('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf543('0xb'));var toCsv=require('to-csv');var querystring=require(_0xf543('0xc'));var Papa=require(_0xf543('0xd'));var Redis=require(_0xf543('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xf543('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf543('0x10'));var logger=require('../../config/logger')(_0xf543('0x11'));var utils=require(_0xf543('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5217a5,_0x4e7dd9){_0x4e7dd9=_0x4e7dd9||0xcc;return function(_0x37d712){if(_0x37d712){return _0x5217a5[_0xf543('0x13')](_0x4e7dd9);}return _0x5217a5['status'](_0x4e7dd9)[_0xf543('0x14')]();};}function respondWithResult(_0x305768,_0x3299a3){_0x3299a3=_0x3299a3||0xc8;return function(_0x5e564b){if(_0x5e564b){return _0x305768['status'](_0x3299a3)['json'](_0x5e564b);}};}function respondWithFilteredResult(_0x57a93a,_0x4596a6){return function(_0x1cadb5){if(_0x1cadb5){var _0xce4188=typeof _0x4596a6['offset']===_0xf543('0x15')&&typeof _0x4596a6[_0xf543('0x16')]===_0xf543('0x15');var _0x1d3a79=_0x1cadb5[_0xf543('0x17')];var _0x428241=_0xce4188?0x0:_0x4596a6[_0xf543('0x18')];var _0x4fc48f=_0xce4188?_0x1cadb5[_0xf543('0x17')]:_0x4596a6['offset']+_0x4596a6[_0xf543('0x16')];var _0x421b4f;if(_0x4fc48f>=_0x1d3a79){_0x4fc48f=_0x1d3a79;_0x421b4f=0xc8;}else{_0x421b4f=0xce;}_0x57a93a[_0xf543('0x19')](_0x421b4f);return _0x57a93a['set']('Content-Range',_0x428241+'-'+_0x4fc48f+'/'+_0x1d3a79)[_0xf543('0x1a')](_0x1cadb5);}return null;};}function patchUpdates(_0x3b8417){return function(_0xced344){try{jsonpatch[_0xf543('0x1b')](_0xced344,_0x3b8417,!![]);}catch(_0x4f0118){return BPromise['reject'](_0x4f0118);}return _0xced344[_0xf543('0x1c')]();};}function saveUpdates(_0x4c00e1,_0x25934a){return function(_0x1d0617){if(_0x1d0617){return _0x1d0617[_0xf543('0x1d')](_0x4c00e1)['then'](function(_0x1e6c92){return _0x1e6c92;});}return null;};}function removeEntity(_0x3c2beb,_0x4ff482){return function(_0x4c7183){if(_0x4c7183){return _0x4c7183[_0xf543('0x1e')]()[_0xf543('0x1f')](function(){_0x3c2beb[_0xf543('0x19')](0xcc)[_0xf543('0x14')]();});}};}function handleEntityNotFound(_0x523ea0,_0x29617a){return function(_0x42edc9){if(!_0x42edc9){_0x523ea0[_0xf543('0x13')](0x194);}return _0x42edc9;};}function handleError(_0x5ce37f,_0xfcda69){_0xfcda69=_0xfcda69||0x1f4;return function(_0x5a2ef5){logger[_0xf543('0x20')](_0x5a2ef5[_0xf543('0x21')]);if(_0x5a2ef5[_0xf543('0x22')]){delete _0x5a2ef5['name'];}_0x5ce37f['status'](_0xfcda69)[_0xf543('0x23')](_0x5a2ef5);};}exports[_0xf543('0x24')]=function(_0x56d448,_0x3c95f8){var _0x2efb7e={},_0x13d3d8={},_0x2c93b7={'count':0x0,'rows':[]};var _0x567103=_['map'](db[_0xf543('0x25')][_0xf543('0x26')],function(_0x3d1f64){return{'name':_0x3d1f64[_0xf543('0x27')],'type':_0x3d1f64['type']['key']};});_0x13d3d8[_0xf543('0x28')]=_[_0xf543('0x29')](_0x567103,'name');_0x13d3d8['query']=_[_0xf543('0x2a')](_0x56d448['query']);_0x13d3d8['filters']=_[_0xf543('0x2b')](_0x13d3d8[_0xf543('0x28')],_0x13d3d8[_0xf543('0x2c')]);_0x2efb7e[_0xf543('0x2d')]=_[_0xf543('0x2b')](_0x13d3d8[_0xf543('0x28')],qs['fields'](_0x56d448[_0xf543('0x2c')]['fields']));_0x2efb7e['attributes']=_0x2efb7e['attributes']['length']?_0x2efb7e['attributes']:_0x13d3d8[_0xf543('0x28')];if(!_0x56d448[_0xf543('0x2c')]['hasOwnProperty']('nolimit')){_0x2efb7e['limit']=qs['limit'](_0x56d448[_0xf543('0x2c')][_0xf543('0x16')]);_0x2efb7e[_0xf543('0x18')]=qs[_0xf543('0x18')](_0x56d448['query'][_0xf543('0x18')]);}_0x2efb7e[_0xf543('0x2e')]=qs['sort'](_0x56d448[_0xf543('0x2c')][_0xf543('0x2f')]);_0x2efb7e['where']=qs[_0xf543('0x30')](_[_0xf543('0x31')](_0x56d448[_0xf543('0x2c')],_0x13d3d8[_0xf543('0x30')]),_0x567103);if(_0x56d448[_0xf543('0x2c')][_0xf543('0x32')]){_0x2efb7e['where']=_['merge'](_0x2efb7e[_0xf543('0x33')],{'$or':_['map'](_0x567103,function(_0x3b2514){if(_0x3b2514[_0xf543('0x34')]!==_0xf543('0x35')){var _0x22b87f={};_0x22b87f[_0x3b2514[_0xf543('0x22')]]={'$like':'%'+_0x56d448[_0xf543('0x2c')][_0xf543('0x32')]+'%'};return _0x22b87f;}})});}_0x2efb7e=_['merge']({},_0x2efb7e,_0x56d448[_0xf543('0x36')]);var _0x4eb678={'where':_0x2efb7e[_0xf543('0x33')]};return db[_0xf543('0x25')]['count'](_0x4eb678)['then'](function(_0x3e5ee8){_0x2c93b7[_0xf543('0x17')]=_0x3e5ee8;if(_0x56d448[_0xf543('0x2c')][_0xf543('0x37')]){_0x2efb7e['include']=[{'all':!![]}];}return db[_0xf543('0x25')][_0xf543('0x38')](_0x2efb7e);})[_0xf543('0x1f')](function(_0x3c339e){_0x2c93b7[_0xf543('0x39')]=_0x3c339e;return _0x2c93b7;})['then'](respondWithFilteredResult(_0x3c95f8,_0x2efb7e))[_0xf543('0x3a')](handleError(_0x3c95f8,null));};exports[_0xf543('0x3b')]=function(_0x30bae6,_0x205a47){var _0x37f9e7={'raw':!![],'where':{'id':_0x30bae6[_0xf543('0x3c')]['id']}},_0x6bfaa6={};_0x6bfaa6[_0xf543('0x28')]=_[_0xf543('0x2a')](db[_0xf543('0x25')][_0xf543('0x26')]);_0x6bfaa6[_0xf543('0x2c')]=_[_0xf543('0x2a')](_0x30bae6[_0xf543('0x2c')]);_0x6bfaa6[_0xf543('0x30')]=_['intersection'](_0x6bfaa6[_0xf543('0x28')],_0x6bfaa6['query']);_0x37f9e7['attributes']=_[_0xf543('0x2b')](_0x6bfaa6['model'],qs[_0xf543('0x3d')](_0x30bae6['query'][_0xf543('0x3d')]));_0x37f9e7[_0xf543('0x2d')]=_0x37f9e7[_0xf543('0x2d')][_0xf543('0x3e')]?_0x37f9e7[_0xf543('0x2d')]:_0x6bfaa6[_0xf543('0x28')];if(_0x30bae6['query'][_0xf543('0x37')]){_0x37f9e7[_0xf543('0x3f')]=[{'all':!![]}];}_0x37f9e7=_[_0xf543('0x40')]({},_0x37f9e7,_0x30bae6[_0xf543('0x36')]);return db[_0xf543('0x25')][_0xf543('0x41')](_0x37f9e7)[_0xf543('0x1f')](handleEntityNotFound(_0x205a47,null))[_0xf543('0x1f')](respondWithResult(_0x205a47,null))[_0xf543('0x3a')](handleError(_0x205a47,null));};exports[_0xf543('0x42')]=function(_0x4129d0,_0x4a379a){return db[_0xf543('0x25')][_0xf543('0x42')](_0x4129d0['body'],{})['then'](respondWithResult(_0x4a379a,0xc9))['catch'](handleError(_0x4a379a,null));};exports['update']=function(_0x3cb493,_0x3f06cf){if(_0x3cb493[_0xf543('0x43')]['id']){delete _0x3cb493[_0xf543('0x43')]['id'];}return db['SmsApplication'][_0xf543('0x41')]({'where':{'id':_0x3cb493['params']['id']}})[_0xf543('0x1f')](handleEntityNotFound(_0x3f06cf,null))[_0xf543('0x1f')](saveUpdates(_0x3cb493[_0xf543('0x43')],null))[_0xf543('0x1f')](respondWithResult(_0x3f06cf,null))[_0xf543('0x3a')](handleError(_0x3f06cf,null));};exports[_0xf543('0x1e')]=function(_0x2a1767,_0x1d9634){return db[_0xf543('0x25')][_0xf543('0x41')]({'where':{'id':_0x2a1767[_0xf543('0x3c')]['id']}})['then'](handleEntityNotFound(_0x1d9634,null))['then'](removeEntity(_0x1d9634,null))[_0xf543('0x3a')](handleError(_0x1d9634,null));};
\ No newline at end of file
+var _0xe981=['request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','options','includeAll','findAll','rows','catch','show','params','include','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x158ab3,_0x4b5908){var _0x302830=function(_0x19fa14){while(--_0x19fa14){_0x158ab3['push'](_0x158ab3['shift']());}};_0x302830(++_0x4b5908);}(_0xe981,0x178));var _0x1e98=function(_0xd299c3,_0x4ba0f1){_0xd299c3=_0xd299c3-0x0;var _0x376574=_0xe981[_0xd299c3];return _0x376574;};'use strict';var emlformat=require(_0x1e98('0x0'));var rimraf=require(_0x1e98('0x1'));var zipdir=require(_0x1e98('0x2'));var jsonpatch=require(_0x1e98('0x3'));var rp=require(_0x1e98('0x4'));var moment=require(_0x1e98('0x5'));var BPromise=require(_0x1e98('0x6'));var Mustache=require(_0x1e98('0x7'));var util=require('util');var path=require(_0x1e98('0x8'));var sox=require(_0x1e98('0x9'));var csv=require(_0x1e98('0xa'));var ejs=require(_0x1e98('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1e98('0xa'));var querystring=require(_0x1e98('0xc'));var Papa=require(_0x1e98('0xd'));var Redis=require(_0x1e98('0xe'));var authService=require(_0x1e98('0xf'));var qs=require(_0x1e98('0x10'));var as=require(_0x1e98('0x11'));var hardwareService=require(_0x1e98('0x12'));var logger=require(_0x1e98('0x13'))(_0x1e98('0x14'));var utils=require(_0x1e98('0x15'));var config=require(_0x1e98('0x16'));var licenseUtil=require(_0x1e98('0x17'));var db=require(_0x1e98('0x18'))['db'];function respondWithStatusCode(_0x10f313,_0x5a99f3){_0x5a99f3=_0x5a99f3||0xcc;return function(_0x23577e){if(_0x23577e){return _0x10f313[_0x1e98('0x19')](_0x5a99f3);}return _0x10f313['status'](_0x5a99f3)[_0x1e98('0x1a')]();};}function respondWithResult(_0x4bcdff,_0x530ca5){_0x530ca5=_0x530ca5||0xc8;return function(_0x26c2f8){if(_0x26c2f8){return _0x4bcdff[_0x1e98('0x1b')](_0x530ca5)[_0x1e98('0x1c')](_0x26c2f8);}};}function respondWithFilteredResult(_0x1d0dfd,_0x30aaad){return function(_0x154fc0){if(_0x154fc0){var _0x13c9d9=typeof _0x30aaad[_0x1e98('0x1d')]===_0x1e98('0x1e')&&typeof _0x30aaad[_0x1e98('0x1f')]===_0x1e98('0x1e');var _0x346a96=_0x154fc0[_0x1e98('0x20')];var _0x5c9417=_0x13c9d9?0x0:_0x30aaad[_0x1e98('0x1d')];var _0x38ab5d=_0x13c9d9?_0x154fc0[_0x1e98('0x20')]:_0x30aaad[_0x1e98('0x1d')]+_0x30aaad[_0x1e98('0x1f')];var _0x67808b;if(_0x38ab5d>=_0x346a96){_0x38ab5d=_0x346a96;_0x67808b=0xc8;}else{_0x67808b=0xce;}_0x1d0dfd[_0x1e98('0x1b')](_0x67808b);return _0x1d0dfd[_0x1e98('0x21')](_0x1e98('0x22'),_0x5c9417+'-'+_0x38ab5d+'/'+_0x346a96)['json'](_0x154fc0);}return null;};}function patchUpdates(_0x5064d1){return function(_0x2c663c){try{jsonpatch[_0x1e98('0x23')](_0x2c663c,_0x5064d1,!![]);}catch(_0x321c90){return BPromise['reject'](_0x321c90);}return _0x2c663c[_0x1e98('0x24')]();};}function saveUpdates(_0x505db9,_0x2fbb07){return function(_0x171c41){if(_0x171c41){return _0x171c41[_0x1e98('0x25')](_0x505db9)['then'](function(_0x2d25d0){return _0x2d25d0;});}return null;};}function removeEntity(_0xf673da,_0x458cbf){return function(_0x2c3aac){if(_0x2c3aac){return _0x2c3aac[_0x1e98('0x26')]()[_0x1e98('0x27')](function(){_0xf673da[_0x1e98('0x1b')](0xcc)[_0x1e98('0x1a')]();});}};}function handleEntityNotFound(_0x449a18,_0x5b9f85){return function(_0x5a5e50){if(!_0x5a5e50){_0x449a18[_0x1e98('0x19')](0x194);}return _0x5a5e50;};}function handleError(_0x55deb3,_0x271de3){_0x271de3=_0x271de3||0x1f4;return function(_0x41a074){logger[_0x1e98('0x28')](_0x41a074[_0x1e98('0x29')]);if(_0x41a074[_0x1e98('0x2a')]){delete _0x41a074[_0x1e98('0x2a')];}_0x55deb3['status'](_0x271de3)[_0x1e98('0x2b')](_0x41a074);};}exports[_0x1e98('0x2c')]=function(_0x521398,_0x5f0542){var _0x57648c={},_0x1afd2a={},_0x45f293={'count':0x0,'rows':[]};var _0x3a6c16=_[_0x1e98('0x2d')](db[_0x1e98('0x2e')][_0x1e98('0x2f')],function(_0x3b3736){return{'name':_0x3b3736[_0x1e98('0x30')],'type':_0x3b3736[_0x1e98('0x31')][_0x1e98('0x32')]};});_0x1afd2a[_0x1e98('0x33')]=_[_0x1e98('0x2d')](_0x3a6c16,_0x1e98('0x2a'));_0x1afd2a[_0x1e98('0x34')]=_[_0x1e98('0x35')](_0x521398['query']);_0x1afd2a[_0x1e98('0x36')]=_[_0x1e98('0x37')](_0x1afd2a[_0x1e98('0x33')],_0x1afd2a[_0x1e98('0x34')]);_0x57648c[_0x1e98('0x38')]=_[_0x1e98('0x37')](_0x1afd2a[_0x1e98('0x33')],qs['fields'](_0x521398['query'][_0x1e98('0x39')]));_0x57648c[_0x1e98('0x38')]=_0x57648c['attributes'][_0x1e98('0x3a')]?_0x57648c['attributes']:_0x1afd2a['model'];if(!_0x521398['query'][_0x1e98('0x3b')](_0x1e98('0x3c'))){_0x57648c[_0x1e98('0x1f')]=qs['limit'](_0x521398[_0x1e98('0x34')][_0x1e98('0x1f')]);_0x57648c[_0x1e98('0x1d')]=qs[_0x1e98('0x1d')](_0x521398['query'][_0x1e98('0x1d')]);}_0x57648c['order']=qs[_0x1e98('0x3d')](_0x521398[_0x1e98('0x34')][_0x1e98('0x3d')]);_0x57648c[_0x1e98('0x3e')]=qs[_0x1e98('0x36')](_[_0x1e98('0x3f')](_0x521398[_0x1e98('0x34')],_0x1afd2a[_0x1e98('0x36')]),_0x3a6c16);if(_0x521398[_0x1e98('0x34')]['filter']){_0x57648c[_0x1e98('0x3e')]=_[_0x1e98('0x40')](_0x57648c[_0x1e98('0x3e')],{'$or':_['map'](_0x3a6c16,function(_0x9f6877){if(_0x9f6877['type']!=='VIRTUAL'){var _0x4c2719={};_0x4c2719[_0x9f6877[_0x1e98('0x2a')]]={'$like':'%'+_0x521398['query']['filter']+'%'};return _0x4c2719;}})});}_0x57648c=_[_0x1e98('0x40')]({},_0x57648c,_0x521398[_0x1e98('0x41')]);var _0x136610={'where':_0x57648c[_0x1e98('0x3e')]};return db[_0x1e98('0x2e')][_0x1e98('0x20')](_0x136610)[_0x1e98('0x27')](function(_0x325b1c){_0x45f293[_0x1e98('0x20')]=_0x325b1c;if(_0x521398[_0x1e98('0x34')][_0x1e98('0x42')]){_0x57648c['include']=[{'all':!![]}];}return db[_0x1e98('0x2e')][_0x1e98('0x43')](_0x57648c);})[_0x1e98('0x27')](function(_0x1c78fa){_0x45f293[_0x1e98('0x44')]=_0x1c78fa;return _0x45f293;})[_0x1e98('0x27')](respondWithFilteredResult(_0x5f0542,_0x57648c))[_0x1e98('0x45')](handleError(_0x5f0542,null));};exports[_0x1e98('0x46')]=function(_0x5151b5,_0xcf0c04){var _0x255b41={'raw':!![],'where':{'id':_0x5151b5[_0x1e98('0x47')]['id']}},_0x2e4ec3={};_0x2e4ec3['model']=_[_0x1e98('0x35')](db[_0x1e98('0x2e')][_0x1e98('0x2f')]);_0x2e4ec3['query']=_[_0x1e98('0x35')](_0x5151b5[_0x1e98('0x34')]);_0x2e4ec3[_0x1e98('0x36')]=_[_0x1e98('0x37')](_0x2e4ec3['model'],_0x2e4ec3[_0x1e98('0x34')]);_0x255b41[_0x1e98('0x38')]=_[_0x1e98('0x37')](_0x2e4ec3[_0x1e98('0x33')],qs[_0x1e98('0x39')](_0x5151b5[_0x1e98('0x34')][_0x1e98('0x39')]));_0x255b41[_0x1e98('0x38')]=_0x255b41[_0x1e98('0x38')][_0x1e98('0x3a')]?_0x255b41[_0x1e98('0x38')]:_0x2e4ec3[_0x1e98('0x33')];if(_0x5151b5[_0x1e98('0x34')][_0x1e98('0x42')]){_0x255b41[_0x1e98('0x48')]=[{'all':!![]}];}_0x255b41=_[_0x1e98('0x40')]({},_0x255b41,_0x5151b5['options']);return db[_0x1e98('0x2e')]['find'](_0x255b41)[_0x1e98('0x27')](handleEntityNotFound(_0xcf0c04,null))[_0x1e98('0x27')](respondWithResult(_0xcf0c04,null))['catch'](handleError(_0xcf0c04,null));};exports[_0x1e98('0x49')]=function(_0x5377f8,_0x1ad79f){return db[_0x1e98('0x2e')][_0x1e98('0x49')](_0x5377f8[_0x1e98('0x4a')],{})[_0x1e98('0x27')](respondWithResult(_0x1ad79f,0xc9))['catch'](handleError(_0x1ad79f,null));};exports[_0x1e98('0x25')]=function(_0x49a437,_0x598d30){if(_0x49a437[_0x1e98('0x4a')]['id']){delete _0x49a437[_0x1e98('0x4a')]['id'];}return db[_0x1e98('0x2e')][_0x1e98('0x4b')]({'where':{'id':_0x49a437['params']['id']}})[_0x1e98('0x27')](handleEntityNotFound(_0x598d30,null))[_0x1e98('0x27')](saveUpdates(_0x49a437[_0x1e98('0x4a')],null))['then'](respondWithResult(_0x598d30,null))[_0x1e98('0x45')](handleError(_0x598d30,null));};exports[_0x1e98('0x26')]=function(_0x1deb4a,_0x276d94){return db[_0x1e98('0x2e')]['find']({'where':{'id':_0x1deb4a['params']['id']}})['then'](handleEntityNotFound(_0x276d94,null))['then'](removeEntity(_0x276d94,null))[_0x1e98('0x45')](handleError(_0x276d94,null));};
\ No newline at end of file
index fbaa9a3..836973d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5221=['../../config/logger','api','moment','bluebird','path','rimraf','./smsApplication.attributes','exports','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x952e1c,_0x5bb280){var _0x1bceb2=function(_0x5ecc2a){while(--_0x5ecc2a){_0x952e1c['push'](_0x952e1c['shift']());}};_0x1bceb2(++_0x5bb280);}(_0x5221,0x15c));var _0x1522=function(_0x430680,_0x1b34f8){_0x430680=_0x430680-0x0;var _0x4cd673=_0x5221[_0x430680];return _0x4cd673;};'use strict';var _=require(_0x1522('0x0'));var util=require(_0x1522('0x1'));var logger=require(_0x1522('0x2'))(_0x1522('0x3'));var moment=require(_0x1522('0x4'));var BPromise=require(_0x1522('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1522('0x6'));var rimraf=require(_0x1522('0x7'));var config=require('../../config/environment');var attributes=require(_0x1522('0x8'));module[_0x1522('0x9')]=function(_0x504109,_0x2406ac){return _0x504109['define'](_0x1522('0xa'),attributes,{'tableName':_0x1522('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1522('0xc'),'collate':_0x1522('0xd')});};
\ No newline at end of file
+var _0x3965=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0x3965,0x1a2));var _0x5396=function(_0xa04daf,_0x25e602){_0xa04daf=_0xa04daf-0x0;var _0x3f7fa6=_0x3965[_0xa04daf];return _0x3f7fa6;};'use strict';var _=require(_0x5396('0x0'));var util=require(_0x5396('0x1'));var logger=require('../../config/logger')(_0x5396('0x2'));var moment=require(_0x5396('0x3'));var BPromise=require(_0x5396('0x4'));var rp=require(_0x5396('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5396('0x6'));var config=require(_0x5396('0x7'));var attributes=require(_0x5396('0x8'));module[_0x5396('0x9')]=function(_0xd604bb,_0x133bb3){return _0xd604bb[_0x5396('0xa')](_0x5396('0xb'),attributes,{'tableName':_0x5396('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5396('0xd'),'collate':_0x5396('0xe')});};
\ No newline at end of file
index 0f9df13..1b43daa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9fc=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','http','request','then','info','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','SmsApplication,\x20%s,\x20%s','message','result','lodash','util','moment'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0xa9fc,0x19f));var _0xca9f=function(_0xf2f332,_0x299fbf){_0xf2f332=_0xf2f332-0x0;var _0x56cce3=_0xa9fc[_0xf2f332];return _0x56cce3;};'use strict';var _=require(_0xca9f('0x0'));var util=require(_0xca9f('0x1'));var moment=require(_0xca9f('0x2'));var BPromise=require(_0xca9f('0x3'));var rs=require(_0xca9f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xca9f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xca9f('0x6'))(_0xca9f('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xca9f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x48f9ca,_0x39963d,_0x61b1b6){return new BPromise(function(_0x400980,_0xf7ebb1){return client[_0xca9f('0x9')](_0x48f9ca,_0x61b1b6)[_0xca9f('0xa')](function(_0x4713f0){logger[_0xca9f('0xb')]('SmsApplication,\x20%s,\x20%s',_0x39963d,_0xca9f('0xc'));logger[_0xca9f('0xd')](_0xca9f('0xe'),_0x39963d,_0xca9f('0xc'),JSON['stringify'](_0x4713f0));if(_0x4713f0[_0xca9f('0xf')]){if(_0x4713f0[_0xca9f('0xf')]['code']===0x1f4){logger[_0xca9f('0xf')](_0xca9f('0x10'),_0x39963d,_0x4713f0[_0xca9f('0xf')][_0xca9f('0x11')]);return _0xf7ebb1(_0x4713f0[_0xca9f('0xf')][_0xca9f('0x11')]);}logger[_0xca9f('0xf')](_0xca9f('0x10'),_0x39963d,_0x4713f0[_0xca9f('0xf')][_0xca9f('0x11')]);return _0x400980(_0x4713f0['error']['message']);}else{logger[_0xca9f('0xb')]('SmsApplication,\x20%s,\x20%s',_0x39963d,'request\x20sent');_0x400980(_0x4713f0[_0xca9f('0x12')][_0xca9f('0x11')]);}})['catch'](function(_0x4afedf){logger['error'](_0xca9f('0x10'),_0x39963d,_0x4afedf);_0xf7ebb1(_0x4afedf);});});}
\ No newline at end of file
+var _0xa908=['http','then','info','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','SmsApplication,\x20%s,\x20%s','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0xa908,0x1c3));var _0x8a90=function(_0x33e9b5,_0x36fbf1){_0x33e9b5=_0x33e9b5-0x0;var _0x3244c0=_0xa908[_0x33e9b5];return _0x3244c0;};'use strict';var _=require(_0x8a90('0x0'));var util=require('util');var moment=require(_0x8a90('0x1'));var BPromise=require('bluebird');var rs=require(_0x8a90('0x2'));var fs=require('fs');var Redis=require(_0x8a90('0x3'));var db=require(_0x8a90('0x4'))['db'];var utils=require(_0x8a90('0x5'));var logger=require(_0x8a90('0x6'))('rpc');var config=require(_0x8a90('0x7'));var jayson=require(_0x8a90('0x8'));var client=jayson['client'][_0x8a90('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1dc8f9,_0x12d376,_0x3faf88){return new BPromise(function(_0x20f8bf,_0x200f95){return client['request'](_0x1dc8f9,_0x3faf88)[_0x8a90('0xa')](function(_0x485401){logger[_0x8a90('0xb')]('SmsApplication,\x20%s,\x20%s',_0x12d376,_0x8a90('0xc'));logger[_0x8a90('0xd')](_0x8a90('0xe'),_0x12d376,_0x8a90('0xc'),JSON[_0x8a90('0xf')](_0x485401));if(_0x485401[_0x8a90('0x10')]){if(_0x485401[_0x8a90('0x10')]['code']===0x1f4){logger['error'](_0x8a90('0x11'),_0x12d376,_0x485401[_0x8a90('0x10')][_0x8a90('0x12')]);return _0x200f95(_0x485401['error'][_0x8a90('0x12')]);}logger[_0x8a90('0x10')](_0x8a90('0x11'),_0x12d376,_0x485401['error'][_0x8a90('0x12')]);return _0x20f8bf(_0x485401[_0x8a90('0x10')]['message']);}else{logger[_0x8a90('0xb')](_0x8a90('0x11'),_0x12d376,_0x8a90('0xc'));_0x20f8bf(_0x485401[_0x8a90('0x13')]['message']);}})['catch'](function(_0x14db82){logger[_0x8a90('0x10')](_0x8a90('0x11'),_0x12d376,_0x14db82);_0x200f95(_0x14db82);});});}
\ No newline at end of file
index d7e947a..068b6b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5eb8=['smsinteraction:update','update','delete','smsinteraction:destroy','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put'];(function(_0x2b4a29,_0x6211b3){var _0x44bc08=function(_0x54fddb){while(--_0x54fddb){_0x2b4a29['push'](_0x2b4a29['shift']());}};_0x44bc08(++_0x6211b3);}(_0x5eb8,0xb0));var _0x85eb=function(_0x1c0781,_0x4a19f1){_0x1c0781=_0x1c0781-0x0;var _0x1f577e=_0x5eb8[_0x1c0781];return _0x1f577e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var fs_extra=require(_0x85eb('0x4'));var auth=require(_0x85eb('0x5'));var interaction=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var controller=require(_0x85eb('0x8'));router[_0x85eb('0x9')]('/',auth[_0x85eb('0xa')](),controller[_0x85eb('0xb')]);router['get'](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xd')]);router['get'](_0x85eb('0xe'),auth['isAuthenticated'](),controller[_0x85eb('0xf')]);router[_0x85eb('0x9')](_0x85eb('0x10'),auth[_0x85eb('0xa')](),controller[_0x85eb('0x11')]);router[_0x85eb('0x9')](_0x85eb('0x12'),auth['isAuthenticated'](),controller[_0x85eb('0x13')]);router[_0x85eb('0x14')]('/',auth['isAuthenticated'](),controller[_0x85eb('0x15')]);router[_0x85eb('0x14')](_0x85eb('0x10'),auth[_0x85eb('0xa')](),controller['addMessage']);router['post'](_0x85eb('0x16'),auth['isAuthenticated'](),interaction[_0x85eb('0x17')](_0x85eb('0x18'),_0x85eb('0x19')),controller[_0x85eb('0x1a')]);router[_0x85eb('0x1b')]('/:id',auth[_0x85eb('0xa')](),interaction['tracked'](_0x85eb('0x18'),_0x85eb('0x1c')),controller[_0x85eb('0x1d')]);router[_0x85eb('0x1e')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x85eb('0x18'),_0x85eb('0x1f')),controller[_0x85eb('0x20')]);router[_0x85eb('0x1e')](_0x85eb('0x16'),auth[_0x85eb('0xa')](),controller['removeTags']);module[_0x85eb('0x21')]=router;
\ No newline at end of file
+var _0xd4a2=['isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','download','create','post','addMessage','/:id/tags','sms','addTags','put','update','tracked','removeTags','exports','multer','connect-timeout','Router','../../components/auth/service','../../config/environment','./smsInteraction.controller','get'];(function(_0x18207e,_0x13d718){var _0x2afecf=function(_0x21841a){while(--_0x21841a){_0x18207e['push'](_0x18207e['shift']());}};_0x2afecf(++_0x13d718);}(_0xd4a2,0x173));var _0x2d4a=function(_0x13c342,_0x2adffc){_0x13c342=_0x13c342-0x0;var _0x1fe9c2=_0xd4a2[_0x13c342];return _0x1fe9c2;};'use strict';var multer=require(_0x2d4a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2d4a('0x1'));var express=require('express');var router=express[_0x2d4a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x2d4a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x2d4a('0x4'));var controller=require(_0x2d4a('0x5'));router[_0x2d4a('0x6')]('/',auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x8')]);router['get'](_0x2d4a('0x9'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xa')]);router[_0x2d4a('0x6')](_0x2d4a('0xb'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xc')]);router[_0x2d4a('0x6')](_0x2d4a('0xd'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xe')]);router[_0x2d4a('0x6')]('/:id/download',auth['isAuthenticated'](),controller[_0x2d4a('0xf')]);router['post']('/',auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x10')]);router[_0x2d4a('0x11')](_0x2d4a('0xd'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x12')]);router[_0x2d4a('0x11')](_0x2d4a('0x13'),auth['isAuthenticated'](),interaction['tracked'](_0x2d4a('0x14'),'smsinteraction:addtags'),controller[_0x2d4a('0x15')]);router[_0x2d4a('0x16')](_0x2d4a('0xb'),auth[_0x2d4a('0x7')](),interaction['tracked'](_0x2d4a('0x14'),'smsinteraction:update'),controller[_0x2d4a('0x17')]);router['delete'](_0x2d4a('0xb'),auth[_0x2d4a('0x7')](),interaction[_0x2d4a('0x18')](_0x2d4a('0x14'),'smsinteraction:destroy'),controller['destroy']);router['delete'](_0x2d4a('0x13'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x19')]);module[_0x2d4a('0x1a')]=router;
\ No newline at end of file
index 4ffd1d4..10e6686 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb70=['sequelize','moment','exports','DATE','STRING','ENUM','out','BOOLEAN'];(function(_0x47cde9,_0x19d013){var _0x26fdf1=function(_0x32fb69){while(--_0x32fb69){_0x47cde9['push'](_0x47cde9['shift']());}};_0x26fdf1(++_0x19d013);}(_0xdb70,0xa0));var _0x0db7=function(_0x86ba8,_0x31c204){_0x86ba8=_0x86ba8-0x0;var _0x636d08=_0xdb70[_0x86ba8];return _0x636d08;};'use strict';var Sequelize=require(_0x0db7('0x0'));var moment=require(_0x0db7('0x1'));module[_0x0db7('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0db7('0x3')]},'disposition':{'type':Sequelize[_0x0db7('0x4')]},'secondDisposition':{'type':Sequelize[_0x0db7('0x4')]},'thirdDisposition':{'type':Sequelize[_0x0db7('0x4')]},'note':{'type':Sequelize[_0x0db7('0x4')]},'phone':{'type':Sequelize[_0x0db7('0x4')]},'read1stAt':{'type':Sequelize[_0x0db7('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x0db7('0x5')]('in',_0x0db7('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0db7('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x0db7('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x0db7('0x7')],'defaultValue':![]}};
\ No newline at end of file
+var _0xd7c3=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment','exports'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xd7c3,0x1c5));var _0x3d7c=function(_0x4857fe,_0x4eb767){_0x4857fe=_0x4857fe-0x0;var _0x407c6c=_0xd7c3[_0x4857fe];return _0x407c6c;};'use strict';var Sequelize=require(_0x3d7c('0x0'));var moment=require(_0x3d7c('0x1'));module[_0x3d7c('0x2')]={'closed':{'type':Sequelize[_0x3d7c('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3d7c('0x4')]},'disposition':{'type':Sequelize[_0x3d7c('0x5')]},'secondDisposition':{'type':Sequelize[_0x3d7c('0x5')]},'thirdDisposition':{'type':Sequelize[_0x3d7c('0x5')]},'note':{'type':Sequelize[_0x3d7c('0x5')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x3d7c('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x3d7c('0x6')]('in',_0x3d7c('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x3d7c('0x3')],'defaultValue':![]}};
\ No newline at end of file
index c6e0e7d..a33ed84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73b8=['log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','map','fullname','Tags','TagIds','forEach','push','catch','waiting','answered','unmanaged','total','closed','UserId','talking','SmsInteraction','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','tools_tags','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','expr','search','sqlOperator','conditions','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','value','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','type','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?','buildExpression','body','some','compact','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','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','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','SmsAccountId','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','isEmpty','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','c.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','SmsInteractionId','show','params','includeAll','create','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','format','include','rows','addTags','setTags','spread','removeTags','download','unix','join','root','server','files','attachments','transcript-%d-%s.zip','User','CmContact','firstName','lastName','Messages','SmsAccount','Account','Owner','mkdirSync','Sms','N.A.','closedAt','YYYY-MM-DD\x20HH:mm:ss','disposition','direction','out','System','secret','read','renderFile','views','transcript-','.pdf','createPdfFromHTML'];(function(_0xc0790e,_0x4b6705){var _0x377634=function(_0x3c99bc){while(--_0x3c99bc){_0xc0790e['push'](_0xc0790e['shift']());}};_0x377634(++_0x4b6705);}(_0x73b8,0x1db));var _0x873b=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x73b8[_0x9df060];return _0x338dfe;};'use strict';var emlformat=require(_0x873b('0x0'));var rimraf=require(_0x873b('0x1'));var zipdir=require(_0x873b('0x2'));var jsonpatch=require(_0x873b('0x3'));var rp=require(_0x873b('0x4'));var moment=require(_0x873b('0x5'));var BPromise=require(_0x873b('0x6'));var Mustache=require(_0x873b('0x7'));var util=require(_0x873b('0x8'));var path=require(_0x873b('0x9'));var sox=require(_0x873b('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x873b('0xb'));var _=require(_0x873b('0xc'));var squel=require(_0x873b('0xd'));var crypto=require('crypto');var jsforce=require(_0x873b('0xe'));var deskjs=require(_0x873b('0xf'));var toCsv=require(_0x873b('0x10'));var querystring=require('querystring');var Papa=require(_0x873b('0x11'));var Redis=require(_0x873b('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x873b('0x13'));var pdf=require(_0x873b('0x14'));var hardwareService=require(_0x873b('0x15'));var logger=require('../../config/logger')(_0x873b('0x16'));var utils=require(_0x873b('0x17'));var config=require(_0x873b('0x18'));var licenseUtil=require(_0x873b('0x19'));var db=require('../../mysqldb')['db'];config[_0x873b('0x1a')]=_[_0x873b('0x1b')](config['redis'],{'host':_0x873b('0x1c'),'port':0x18eb});var socket=require(_0x873b('0x1d'))(new Redis(config[_0x873b('0x1a')]));require(_0x873b('0x1e'))['register'](socket);function respondWithStatusCode(_0x558e63,_0x5410a4){_0x5410a4=_0x5410a4||0xcc;return function(_0x593ed6){if(_0x593ed6){return _0x558e63[_0x873b('0x1f')](_0x5410a4);}return _0x558e63[_0x873b('0x20')](_0x5410a4)[_0x873b('0x21')]();};}function respondWithResult(_0x4d3e57,_0x45c509){_0x45c509=_0x45c509||0xc8;return function(_0x3f6d3f){if(_0x3f6d3f){return _0x4d3e57[_0x873b('0x20')](_0x45c509)['json'](_0x3f6d3f);}};}function respondWithFilteredResult(_0x1d6835,_0x4cb191){return function(_0x583ce4){if(_0x583ce4){var _0x53dfda=typeof _0x4cb191['offset']===_0x873b('0x22')&&typeof _0x4cb191[_0x873b('0x23')]===_0x873b('0x22');var _0x4220fe=_0x583ce4[_0x873b('0x24')];var _0x5c1b91=_0x53dfda?0x0:_0x4cb191[_0x873b('0x25')];var _0x4d2ac2=_0x53dfda?_0x583ce4[_0x873b('0x24')]:_0x4cb191[_0x873b('0x25')]+_0x4cb191[_0x873b('0x23')];var _0x10e6e2;if(_0x4d2ac2>=_0x4220fe){_0x4d2ac2=_0x4220fe;_0x10e6e2=0xc8;}else{_0x10e6e2=0xce;}_0x1d6835['status'](_0x10e6e2);return _0x1d6835[_0x873b('0x26')](_0x873b('0x27'),_0x5c1b91+'-'+_0x4d2ac2+'/'+_0x4220fe)[_0x873b('0x28')](_0x583ce4);}return null;};}function patchUpdates(_0xe9a939){return function(_0x36081e){try{jsonpatch[_0x873b('0x29')](_0x36081e,_0xe9a939,!![]);}catch(_0x6457e3){return BPromise[_0x873b('0x2a')](_0x6457e3);}return _0x36081e[_0x873b('0x2b')]();};}function saveUpdates(_0x1e4c83,_0x204fe5){return function(_0x5177d6){if(_0x5177d6){return _0x5177d6[_0x873b('0x2c')](_0x1e4c83)[_0x873b('0x2d')](function(_0x2a6053){return _0x2a6053;});}return null;};}function removeEntity(_0x18bec1,_0x5947f3){return function(_0x43514e){if(_0x43514e){return _0x43514e[_0x873b('0x2e')]()[_0x873b('0x2d')](function(){_0x18bec1[_0x873b('0x20')](0xcc)[_0x873b('0x21')]();});}};}function handleEntityNotFound(_0xa9cd1d,_0x215e4d){return function(_0x2e950f){if(!_0x2e950f){_0xa9cd1d['sendStatus'](0x194);}return _0x2e950f;};}function handleError(_0x32ae34,_0x552e63){_0x552e63=_0x552e63||0x1f4;return function(_0x57589b){logger[_0x873b('0x2f')](_0x57589b['stack']);if(_0x57589b[_0x873b('0x30')]){delete _0x57589b['name'];}_0x32ae34[_0x873b('0x20')](_0x552e63)[_0x873b('0x31')](_0x57589b);};}function getInteractionUsers(_0x49d351,_0x44a264){return new BPromise(function(_0x4f79d2,_0x7b484c){try{if(_0x44a264[_0x49d351['id']]){_0x49d351['Users']=_[_0x873b('0x32')](_0x44a264[_0x49d351['id']],function(_0x43d380){return{'id':_0x43d380['id'],'fullname':_0x43d380[_0x873b('0x33')]};});}}catch(_0x11047b){_0x7b484c(_0x11047b);}_0x4f79d2(_0x49d351);});}function getInteractionTags(_0x547a8e,_0x301546){return new BPromise(function(_0x3071e1,_0x3263bc){try{if(_0x547a8e['TagIds']){_0x547a8e[_0x873b('0x34')]=[];_0x547a8e[_0x873b('0x35')]['split'](',')[_0x873b('0x36')](function(_0x274731){_0x547a8e['Tags'][_0x873b('0x37')](_0x301546[_0x274731]);});}delete _0x547a8e[_0x873b('0x35')];}catch(_0x356894){_0x3263bc(_0x356894);}_0x3071e1(_0x547a8e);});}function updateSmsInteraction(_0x53d8d2,_0x1bfe45,_0x34f28e){return new BPromise(function(_0x2556b1,_0x1ac1fd){return getInteractionUsers(_0x53d8d2,_0x34f28e)[_0x873b('0x2d')](function(_0x1d863b){return getInteractionTags(_0x1d863b,_0x1bfe45);})[_0x873b('0x2d')](function(_0x2a8201){return getStateInteraction(_0x2a8201);})[_0x873b('0x2d')](function(_0x39d3fe){_0x2556b1(_0x39d3fe);})[_0x873b('0x38')](function(_0x391bac){_0x1ac1fd(_0x391bac);});});}function getStateInteraction(_0x2eaa37){return new BPromise(function(_0x542e3b){_0x2eaa37[_0x873b('0x39')]=0x0;_0x2eaa37['talking']=0x0;_0x2eaa37[_0x873b('0x3a')]=0x0;_0x2eaa37[_0x873b('0x3b')]=0x0;_0x2eaa37[_0x873b('0x3c')]=0x0;if(!_0x2eaa37[_0x873b('0x3d')]&&!_0x2eaa37['UserId']){_0x2eaa37['waiting']+=0x1;}if(!_0x2eaa37['closed']&&_0x2eaa37[_0x873b('0x3e')]){_0x2eaa37[_0x873b('0x3f')]+=0x1;if(_0x2eaa37['waiting']){_0x2eaa37[_0x873b('0x39')]-=0x1;}}if(_0x2eaa37[_0x873b('0x3d')]&&_0x2eaa37['UserId']){_0x2eaa37[_0x873b('0x3a')]+=0x1;if(_0x2eaa37[_0x873b('0x3f')]){_0x2eaa37[_0x873b('0x3f')]-=0x1;}}if(_0x2eaa37[_0x873b('0x3d')]&&!_0x2eaa37[_0x873b('0x3e')]){_0x2eaa37[_0x873b('0x3b')]+=0x1;if(_0x2eaa37[_0x873b('0x39')]){_0x2eaa37[_0x873b('0x39')]-=0x1;}}_0x2eaa37[_0x873b('0x3c')]+=0x1;_0x542e3b(_0x2eaa37);});}exports['index']=function(_0x23ae10,_0x479e32){var _0x4ec4c2={},_0x63f68f={},_0x2f8b80={'count':0x0,'rows':[]};var _0x575825=_[_0x873b('0x32')](db[_0x873b('0x40')][_0x873b('0x41')],function(_0x15fccc){return{'name':_0x15fccc[_0x873b('0x42')],'type':_0x15fccc['type'][_0x873b('0x43')]};});_0x63f68f['model']=_[_0x873b('0x32')](_0x575825,_0x873b('0x30'));_0x63f68f[_0x873b('0x44')]=_[_0x873b('0x45')](_0x23ae10[_0x873b('0x44')]);_0x63f68f[_0x873b('0x46')]=_['intersection'](_0x63f68f['model'],_0x63f68f[_0x873b('0x44')]);_0x4ec4c2['attributes']=_[_0x873b('0x47')](_0x63f68f[_0x873b('0x48')],qs['fields'](_0x23ae10[_0x873b('0x44')][_0x873b('0x49')]));_0x4ec4c2[_0x873b('0x4a')]=_0x4ec4c2[_0x873b('0x4a')][_0x873b('0x4b')]?_0x4ec4c2[_0x873b('0x4a')]:_0x63f68f[_0x873b('0x48')];if(!_0x23ae10['query'][_0x873b('0x4c')](_0x873b('0x4d'))){_0x4ec4c2[_0x873b('0x23')]=qs['limit'](_0x23ae10['query'][_0x873b('0x23')]);_0x4ec4c2[_0x873b('0x25')]=qs[_0x873b('0x25')](_0x23ae10[_0x873b('0x44')][_0x873b('0x25')]);}_0x4ec4c2['order']=qs[_0x873b('0x4e')](_0x23ae10[_0x873b('0x44')][_0x873b('0x4e')]);_0x4ec4c2[_0x873b('0x4f')]=qs[_0x873b('0x46')](_[_0x873b('0x50')](_0x23ae10['query'],_0x63f68f['filters']),_0x575825);var _0x33aa51=[];var _0x6d6267=squel[_0x873b('0x51')]()[_0x873b('0x52')]('id')['field'](_0x873b('0x30'))['field'](_0x873b('0x53'))[_0x873b('0x54')](_0x873b('0x55'));var _0x4f2c94=squel[_0x873b('0x51')]()[_0x873b('0x52')]('u.id')[_0x873b('0x52')](_0x873b('0x56'))[_0x873b('0x52')](_0x873b('0x57'))[_0x873b('0x54')](_0x873b('0x58'),'ui')[_0x873b('0x59')](_0x873b('0x5a'),'u',_0x873b('0x5b'));var _0x175914=squel['select']()['from']('sms_interactions','i')[_0x873b('0x59')](_0x873b('0x5c'),'c',_0x873b('0x5d'))['left_join'](_0x873b('0x5a'),'o','o.id\x20=\x20i.UserId')[_0x873b('0x59')](_0x873b('0x5e'),'a',_0x873b('0x5f'))[_0x873b('0x59')](_0x873b('0x60'),'me',_0x873b('0x61'))[_0x873b('0x59')](_0x873b('0x62'),'it','it.SmsInteractionId\x20=\x20i.id')[_0x873b('0x59')](_0x873b('0x55'),'t','t.id\x20=\x20it.TagId');var _0x551faf=squel[_0x873b('0x63')]();var _0x372144=[];var _0x1ad7e6=squel[_0x873b('0x63')]();var _0x16e4d6;if(_0x23ae10['query'][_0x873b('0x64')]){_0x16e4d6=as['parseSearch'](_0x23ae10[_0x873b('0x44')]['search']);var _0x5c1ef2=_0x16e4d6[_0x873b('0x65')];for(var _0x5c76c2=0x0;_0x5c76c2<_0x16e4d6[_0x873b('0x66')]['length'];_0x5c76c2++){var _0x53da68=_0x16e4d6[_0x873b('0x66')][_0x5c76c2];var _0x4e53a4='i';var _0x45f2b8=_['find'](_0x575825,[_0x873b('0x30'),_0x53da68['field']]);if(!_0x45f2b8){switch(_0x53da68['field']){case _0x873b('0x67'):if(_0x53da68['value']==0x1){_0x175914[_0x873b('0x68')]('`'+_0x53da68[_0x873b('0x52')]+_0x873b('0x69'));}else{_0x175914[_0x873b('0x68')]('`'+_0x53da68[_0x873b('0x52')]+_0x873b('0x6a'));}break;case _0x873b('0x6b'):if(_0x53da68[_0x873b('0x6c')]==='$substring'){if(_0x53da68[_0x873b('0x6d')][_0x873b('0x6e')]('\x20')[_0x873b('0x4b')]>0x1){_0x551faf[_0x5c1ef2](_0x873b('0x6f'),qs[_0x873b('0x70')](_0x53da68['value']),null);}else{var _0x2145b1='%'+_0x53da68[_0x873b('0x6d')]+'%';_0x551faf[_0x5c1ef2](_0x873b('0x71'),_0x2145b1,_0x2145b1,_0x2145b1);}}else{_0x45f2b8=_[_0x873b('0x72')](_0x575825,[_0x873b('0x30'),_0x873b('0x73')]);_0x53da68[_0x873b('0x52')]=_0x873b('0x73');_0x6783f=as['buildExpression'](_0x4e53a4,_0x45f2b8[_0x873b('0x74')],_0x53da68);_0x551faf[_0x5c1ef2](_0x6783f[_0x873b('0x75')],_0x6783f[_0x873b('0x6d')][_0x873b('0x76')],_0x6783f[_0x873b('0x6d')][_0x873b('0x21')]);}break;case _0x873b('0x77'):var _0x66a2b9=_0x53da68[_0x873b('0x6d')][_0x873b('0x6e')](',')[_0x873b('0x32')](function(_0x52c7fd){return Number(_0x52c7fd);});_0x66a2b9[_0x873b('0x36')](function(_0x1f0b01){_0x1ad7e6['or'](_0x873b('0x78'),'%,'+_0x1f0b01+',%');});_0x372144=_[_0x873b('0x79')](_0x372144,_0x66a2b9);break;case'User':if(_0x53da68[_0x873b('0x6c')]===_0x873b('0x7a')){_0x551faf[_0x5c1ef2](_0x873b('0x7b'),'%'+_0x53da68[_0x873b('0x6d')]+'%',null);}else{_0x45f2b8=_[_0x873b('0x72')](_0x575825,[_0x873b('0x30'),_0x873b('0x3e')]);_0x53da68[_0x873b('0x52')]=_0x873b('0x3e');_0x6783f=as[_0x873b('0x7c')](_0x4e53a4,_0x45f2b8[_0x873b('0x74')],_0x53da68);_0x551faf[_0x5c1ef2](_0x6783f['text'],_0x6783f[_0x873b('0x6d')][_0x873b('0x76')],_0x6783f[_0x873b('0x6d')]['end']);}break;case _0x873b('0x7d'):_0x6783f=as[_0x873b('0x7c')]('me',null,_0x53da68);_0x551faf[_0x5c1ef2](_0x6783f['text'],_0x6783f['value'][_0x873b('0x76')],_0x6783f[_0x873b('0x6d')]['end']);break;}}else{var _0x6783f=as['buildExpression'](_0x4e53a4,_0x45f2b8[_0x873b('0x74')],_0x53da68);_0x551faf[_0x5c1ef2](_0x6783f[_0x873b('0x75')],_0x6783f['value'][_0x873b('0x76')],_0x6783f[_0x873b('0x6d')][_0x873b('0x21')]);}}}else{var _0x135494=_(_0x23ae10[_0x873b('0x44')])[_0x873b('0x45')]()[_0x873b('0x32')](function(_0x35e607){return _[_0x873b('0x7e')](_0x575825,[_0x873b('0x30'),_0x35e607])?_0x35e607:undefined;})[_0x873b('0x7f')]()[_0x873b('0x6d')]();if(!_['isEmpty'](_0x135494)){_0x135494['forEach'](function(_0x1ba750){if(_0x1ba750==='SmsAccountId'){_0x175914['where']('i.SmsAccountId\x20IN\x20?',[][_0x873b('0x80')](_0x23ae10['query'][_0x1ba750]));}else if(_0x1ba750===_0x873b('0x81')){var _0x2007f2=JSON[_0x873b('0x82')](_0x23ae10[_0x873b('0x44')][_0x1ba750])[_0x873b('0x83')];var _0x37039b=JSON['parse'](_0x23ae10['query'][_0x1ba750])[_0x873b('0x84')];_0x175914[_0x873b('0x4f')](_0x873b('0x85'),_0x2007f2,_0x37039b);}else{if(_0x23ae10[_0x873b('0x44')][_0x1ba750]==='null'){_0x175914[_0x873b('0x4f')]('i.'+_0x1ba750+_0x873b('0x86'));}else{_0x175914[_0x873b('0x4f')]('i.'+_0x1ba750+_0x873b('0x87'),_0x23ae10['query'][_0x1ba750]);}}});}if(_0x23ae10[_0x873b('0x44')]['read']){if(_0x23ae10['query']['read']==0x1){_0x175914[_0x873b('0x68')]('`unreadMessages`\x20=\x200');}else{_0x175914[_0x873b('0x68')](_0x873b('0x88'));}}if(_0x23ae10[_0x873b('0x44')]['tag']){_0x372144=_[_0x873b('0x89')](_0x23ae10['query']['tag'])?_0x23ae10['query'][_0x873b('0x8a')]:new Array(_0x23ae10[_0x873b('0x44')][_0x873b('0x8a')]);_0x372144[_0x873b('0x36')](function(_0x215c64){_0x1ad7e6['or'](_0x873b('0x78'),'%,'+_0x215c64+',%');});}if(_0x23ae10[_0x873b('0x44')][_0x873b('0x8b')]){var _0x16c236=_0x23ae10[_0x873b('0x44')][_0x873b('0x8b')][_0x873b('0x8c')]('\x5c','\x5c\x5c')[_0x873b('0x8c')](/'/g,'\x27\x27');if(qs[_0x873b('0x8d')](_0x16c236)){_0x551faf['or']('i.id\x20LIKE\x20?',_0x16c236+'%')['or']('i.phone\x20LIKE\x20?',_0x16c236+'%');}else{_0x551faf['or'](_0x873b('0x8e'),qs[_0x873b('0x70')](_0x16c236))['or'](_0x873b('0x8f'),_0x16c236+'%');}}}_0x175914[_0x873b('0x4f')](_0x551faf);_0x175914[_0x873b('0x90')](_0x873b('0x91'));var _0x36aaad={'type':db[_0x873b('0x92')][_0x873b('0x93')]['SELECT'],'raw':!![]};var _0xbb6625=_0x175914['clone']();_0xbb6625['field'](_0x873b('0x91'));_0xbb6625[_0x873b('0x52')](_0x873b('0x94'),_0x873b('0x67'));if(_0x4ec4c2[_0x873b('0x95')]){_0x4ec4c2['order'][_0x873b('0x36')](function(_0x200deb){var _0x23a9aa=_0x200deb[0x0]===_0x873b('0x96')?_0x200deb[0x0]:'i.'+_0x200deb[0x0];_0x175914[_0x873b('0x95')](_0x23a9aa,_0x200deb[0x1]===_0x873b('0x97')?![]:!![]);});}if(!_['isEmpty'](_0x372144)){_0x175914[_0x873b('0x68')](_0x1ad7e6);_0xbb6625[_0x873b('0x4f')]('t.id\x20IN\x20?',_0x372144);}BPromise['resolve']()[_0x873b('0x2d')](function(){if(!_0x16e4d6){if(_0x23ae10['query'][_0x873b('0x98')])return;_0xbb6625[_0x873b('0x4f')](_0x873b('0x99'));_0x175914[_0x873b('0x4f')](_0x873b('0x99'));return;}if(_0x23ae10[_0x873b('0x9a')][_0x873b('0x9b')]!==_0x873b('0x9c'))return;return _0x23ae10['user'][_0x873b('0x9d')]({'attributes':['id'],'raw':!![]})['then'](function(_0x49fc2e){if(_[_0x873b('0x9e')](_0x49fc2e)){_0xbb6625[_0x873b('0x4f')](_0x873b('0x9f'));_0x175914[_0x873b('0x4f')](_0x873b('0x9f'));}else{_0xbb6625['where']('i.SmsAccountId\x20IN\x20?',_[_0x873b('0x32')](_0x49fc2e,'id'));_0x175914[_0x873b('0x4f')](_0x873b('0xa0'),_['map'](_0x49fc2e,'id'));}});})['then'](function(){if(_0x23ae10[_0x873b('0x9a')][_0x873b('0x9b')]===_0x873b('0x9c')&&!_0x16e4d6&&!_0x23ae10['query'][_0x873b('0x98')])return[];return db[_0x873b('0xa1')][_0x873b('0x44')](_0xbb6625[_0x873b('0xa2')](),_0x36aaad);})[_0x873b('0x2d')](function(_0x91838a){_0x2f8b80[_0x873b('0x24')]=_0x91838a[_0x873b('0x4b')];if(_0x2f8b80[_0x873b('0x24')]===0x0)return[];return db['sequelize'][_0x873b('0x44')](_0x6d6267['toString'](),_0x36aaad)[_0x873b('0x2d')](function(_0x5b8fe1){_0x33aa51=_[_0x873b('0xa3')](_0x5b8fe1,'id');_0x36aaad=_[_0x873b('0xa4')](_0x36aaad,{'model':db[_0x873b('0x40')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x23ae10[_0x873b('0x44')]['fields']){_0x4ec4c2[_0x873b('0x4a')]['forEach'](function(_0x1994c7){_0x175914['field']('i.'+_0x1994c7);});}else{_0x175914[_0x873b('0x52')](_0x873b('0x94'),_0x873b('0x67'));_0x175914['field'](_0x873b('0xa5'),_0x873b('0xa6'));_0x175914[_0x873b('0x52')](_0x873b('0xa7'),'Account.mandatoryDisposition');_0x175914['field'](_0x873b('0xa8'),_0x873b('0x96'));_0x175914[_0x873b('0x52')](_0x873b('0xa9'));_0x175914[_0x873b('0x52')](_0x873b('0xaa'),'Contact.firstName');_0x175914['field'](_0x873b('0xab'),_0x873b('0xac'));_0x175914[_0x873b('0x52')](_0x873b('0xad'),'Contact.email');_0x175914[_0x873b('0x52')](_0x873b('0xae'),'Contact.phone');_0x175914[_0x873b('0x52')](_0x873b('0xaf'),_0x873b('0xb0'));_0x175914[_0x873b('0x52')](_0x873b('0xb1'),_0x873b('0xb2'));_0x175914['field'](_0x873b('0xb3'),'Owner.fullname');_0x175914['field']('o.internal','Owner.internal');_0x175914[_0x873b('0x52')](_0x873b('0xb4'),_0x873b('0x35'));}if(_0x4ec4c2[_0x873b('0x23')])_0x175914[_0x873b('0x23')](_0x4ec4c2[_0x873b('0x23')]);if(_0x4ec4c2[_0x873b('0x25')])_0x175914['offset'](_0x4ec4c2['offset']);return db[_0x873b('0xa1')][_0x873b('0x44')](_0x175914[_0x873b('0xa2')](),_0x36aaad);})[_0x873b('0x2d')](function(_0x2568c1){if(_0x2568c1['length']>0x0)_0x4f2c94[_0x873b('0x4f')](_0x873b('0xb5'),_[_0x873b('0x32')](_0x2568c1,'id'));return db[_0x873b('0xa1')][_0x873b('0x44')](_0x4f2c94[_0x873b('0xa2')](),_0x36aaad)[_0x873b('0x2d')](function(_0x46c955){var _0x49a502=_['groupBy'](_0x46c955,_0x873b('0xb6'));var _0x19f336=[];_0x2568c1[_0x873b('0x36')](function(_0x484fd4){_0x19f336[_0x873b('0x37')](updateSmsInteraction(_0x484fd4,_0x33aa51,_0x49a502));});return BPromise['all'](_0x19f336);});});})[_0x873b('0x2d')](function(_0x52ad65){_0x2f8b80['rows']=_0x52ad65;return _0x2f8b80;})[_0x873b('0x2d')](respondWithFilteredResult(_0x479e32,_0x4ec4c2))[_0x873b('0x38')](handleError(_0x479e32,null));};exports[_0x873b('0xb7')]=function(_0x2540a8,_0x4e8fbb){var _0x190127={'raw':![],'where':{'id':_0x2540a8[_0x873b('0xb8')]['id']}},_0x7203ee={};_0x7203ee[_0x873b('0x48')]=_[_0x873b('0x45')](db['SmsInteraction']['rawAttributes']);_0x7203ee['query']=_['keys'](_0x2540a8[_0x873b('0x44')]);_0x7203ee[_0x873b('0x46')]=_[_0x873b('0x47')](_0x7203ee[_0x873b('0x48')],_0x7203ee[_0x873b('0x44')]);_0x190127[_0x873b('0x4a')]=_['intersection'](_0x7203ee[_0x873b('0x48')],qs['fields'](_0x2540a8['query'][_0x873b('0x49')]));_0x190127['attributes']=_0x190127['attributes']['length']?_0x190127[_0x873b('0x4a')]:_0x7203ee[_0x873b('0x48')];if(_0x2540a8[_0x873b('0x44')][_0x873b('0xb9')]){_0x190127['include']=[{'all':!![]}];}_0x190127=_[_0x873b('0xa4')]({},_0x190127,_0x2540a8['options']);return db[_0x873b('0x40')][_0x873b('0x72')](_0x190127)[_0x873b('0x2d')](handleEntityNotFound(_0x4e8fbb,null))['then'](respondWithResult(_0x4e8fbb,null))[_0x873b('0x38')](handleError(_0x4e8fbb,null));};exports[_0x873b('0xba')]=function(_0x3c6027,_0x401549){return db[_0x873b('0x40')][_0x873b('0xba')](_0x3c6027[_0x873b('0x7d')],{})[_0x873b('0x2d')](respondWithResult(_0x401549,0xc9))[_0x873b('0x38')](handleError(_0x401549,null));};exports[_0x873b('0x2c')]=function(_0x58e566,_0x25df8c){if(_0x58e566['body']['id']){delete _0x58e566['body']['id'];}return db[_0x873b('0x40')][_0x873b('0x72')]({'where':{'id':_0x58e566['params']['id']}})[_0x873b('0x2d')](handleEntityNotFound(_0x25df8c,null))[_0x873b('0x2d')](saveUpdates(_0x58e566['body'],null))[_0x873b('0x2d')](respondWithResult(_0x25df8c,null))[_0x873b('0x38')](handleError(_0x25df8c,null));};exports[_0x873b('0x2e')]=function(_0x3756d1,_0x552602){return db[_0x873b('0x40')][_0x873b('0x72')]({'where':{'id':_0x3756d1['params']['id']}})[_0x873b('0x2d')](handleEntityNotFound(_0x552602,null))[_0x873b('0x2d')](removeEntity(_0x552602,null))[_0x873b('0x38')](handleError(_0x552602,null));};exports[_0x873b('0xbb')]=function(_0x55dddc,_0x14f5bb){return db[_0x873b('0x40')][_0x873b('0xbb')]()[_0x873b('0x2d')](respondWithResult(_0x14f5bb,null))[_0x873b('0x38')](handleError(_0x14f5bb,null));};exports[_0x873b('0xbc')]=function(_0x246690,_0x5d6c67,_0x3367e8){return db[_0x873b('0xbd')][_0x873b('0x72')]({'where':{'id':_0x246690[_0x873b('0xb8')]['id']}})['then'](handleEntityNotFound(_0x5d6c67,null))[_0x873b('0x2d')](function(_0x8a9be9){if(_0x8a9be9){return _0x8a9be9['addMessage'](_0x246690[_0x873b('0x7d')][_0x873b('0xbe')],_[_0x873b('0xbf')](_0x246690[_0x873b('0x7d')],[_0x873b('0xbe'),'id'])||{});}})[_0x873b('0x2d')](respondWithResult(_0x5d6c67,null))['catch'](handleError(_0x5d6c67,null));};exports[_0x873b('0xc0')]=function(_0x43ec9f,_0x43e57f,_0x3b4403){var _0x5253ef={'raw':![],'where':{}};var _0x18eba={};var _0x3f9bc5={'count':0x0,'rows':[]};return db[_0x873b('0x40')][_0x873b('0xc1')]({'where':{'id':_0x43ec9f['params']['id']}})[_0x873b('0x2d')](handleEntityNotFound(_0x43e57f,null))['then'](function(_0x1d0019){if(_0x1d0019){_0x18eba[_0x873b('0x48')]=_[_0x873b('0x45')](db[_0x873b('0xbd')][_0x873b('0x41')]);_0x18eba['query']=_['keys'](_0x43ec9f['query']);_0x18eba[_0x873b('0x46')]=_['intersection'](_0x18eba[_0x873b('0x48')],_0x18eba[_0x873b('0x44')]);_0x5253ef['attributes']=_['intersection'](_0x18eba[_0x873b('0x48')],qs[_0x873b('0x49')](_0x43ec9f[_0x873b('0x44')]['fields']));_0x5253ef[_0x873b('0x4a')]=_0x5253ef[_0x873b('0x4a')][_0x873b('0x4b')]?_0x5253ef[_0x873b('0x4a')]:_0x18eba[_0x873b('0x48')];if(!_0x43ec9f[_0x873b('0x44')]['hasOwnProperty'](_0x873b('0x4d'))){_0x5253ef[_0x873b('0x23')]=qs['limit'](_0x43ec9f['query'][_0x873b('0x23')]);_0x5253ef[_0x873b('0x25')]=qs[_0x873b('0x25')](_0x43ec9f[_0x873b('0x44')][_0x873b('0x25')]);}_0x5253ef[_0x873b('0x95')]=qs[_0x873b('0x4e')](_0x43ec9f[_0x873b('0x44')][_0x873b('0x4e')]);_0x5253ef[_0x873b('0x4f')]=qs[_0x873b('0x46')](_[_0x873b('0x50')](_0x43ec9f[_0x873b('0x44')],_0x18eba[_0x873b('0x46')]));_0x5253ef['where'][_0x873b('0xb6')]=_0x1d0019['id'];if(_0x43ec9f[_0x873b('0x44')][_0x873b('0x8b')]){_0x5253ef['where']=_['merge'](_0x5253ef[_0x873b('0x4f')],{'$or':_[_0x873b('0x32')](_0x5253ef[_0x873b('0x4a')],function(_0x1b6882){var _0x4e3186={};_0x4e3186[_0x1b6882]={'$like':'%'+_0x43ec9f['query']['filter']+'%'};return _0x4e3186;})});}if(_0x43ec9f[_0x873b('0x44')][_0x873b('0x83')]){var _0xabcb5a=_0x43ec9f[_0x873b('0x44')][_0x873b('0x83')]['split'](',');var _0x57e6fd={};_0x57e6fd[_0xabcb5a[0x0]]={'$gte':moment(_0xabcb5a[0x1])[_0x873b('0xc2')]('YYYY-MM-DD\x20HH:mm:ss')};_0x5253ef[_0x873b('0x4f')]=_[_0x873b('0xa4')](_0x5253ef[_0x873b('0x4f')],_0x57e6fd);}_0x5253ef=_[_0x873b('0xa4')]({},_0x5253ef,_0x43ec9f['options']);return db[_0x873b('0xbd')][_0x873b('0x24')]({'where':_0x5253ef['where']})[_0x873b('0x2d')](function(_0x5792e3){_0x3f9bc5['count']=_0x5792e3;if(_0x43ec9f[_0x873b('0x44')][_0x873b('0xb9')]){_0x5253ef[_0x873b('0xc3')]=[{'all':!![]}];}return db[_0x873b('0xbd')]['findAll'](_0x5253ef);})['then'](function(_0xca198d){_0x3f9bc5[_0x873b('0xc4')]=_0xca198d;return _0x3f9bc5;});}})[_0x873b('0x2d')](respondWithFilteredResult(_0x43e57f,_0x5253ef))['catch'](handleError(_0x43e57f,null));};exports[_0x873b('0xc5')]=function(_0x217ec6,_0x1d544c,_0xf1da16){return db[_0x873b('0x40')][_0x873b('0x72')]({'where':{'id':_0x217ec6[_0x873b('0xb8')]['id']}})[_0x873b('0x2d')](handleEntityNotFound(_0x1d544c,null))['then'](function(_0x3d2f0d){if(_0x3d2f0d){return _0x3d2f0d[_0x873b('0xc6')](_0x217ec6[_0x873b('0x7d')][_0x873b('0xbe')],_[_0x873b('0xbf')](_0x217ec6[_0x873b('0x7d')],['ids','id'])||{})[_0x873b('0xc7')](function(){return db[_0x873b('0x77')]['findAll']({'attributes':['id',_0x873b('0x30'),'color'],'where':{'id':_0x217ec6[_0x873b('0x7d')][_0x873b('0xbe')]}});})['then'](function(_0x22a67c){socket['emit']('smsInteractionTags:save',{'id':Number(_0x217ec6[_0x873b('0xb8')]['id']),'tags':_0x22a67c||[]});return{'id':Number(_0x217ec6['params']['id']),'tags':_0x22a67c||[]};});}})[_0x873b('0x2d')](respondWithResult(_0x1d544c,null))[_0x873b('0x38')](handleError(_0x1d544c,null));};exports[_0x873b('0xc8')]=function(_0x4c8aeb,_0x25ec78,_0x32a701){return db[_0x873b('0x40')]['find']({'where':{'id':_0x4c8aeb[_0x873b('0xb8')]['id']}})['then'](handleEntityNotFound(_0x25ec78,null))[_0x873b('0x2d')](function(_0x687a95){if(_0x687a95){return _0x687a95['removeTags'](_0x4c8aeb['query'][_0x873b('0xbe')]);}})[_0x873b('0x2d')](respondWithStatusCode(_0x25ec78,null))[_0x873b('0x38')](handleError(_0x25ec78,null));};exports[_0x873b('0xc9')]=function(_0x2fb4eb,_0x1d6c6a){var _0x3aeb98=moment()[_0x873b('0xca')]()[_0x873b('0xa2')]();var _0x2bde51=path[_0x873b('0xcb')](config[_0x873b('0xcc')],_0x873b('0xcd'),_0x873b('0xce'),'tmp');var _0x449b3e=path['join'](config[_0x873b('0xcc')],'server',_0x873b('0xce'),_0x873b('0xcf'));var _0x3629df=path[_0x873b('0xcb')](_0x2bde51,_0x3aeb98);var _0x3c9a82=util[_0x873b('0xc2')](_0x873b('0xd0'),_0x2fb4eb[_0x873b('0xb8')]['id'],_0x3aeb98);var _0x34ec4f=path[_0x873b('0xcb')](_0x2bde51,_0x3c9a82);var _0x2c5d2d=[];_0x2c5d2d[_0x873b('0x37')]({'model':db['User'],'as':_0x873b('0xd1'),'attributes':['id',_0x873b('0x33')],'raw':!![]});_0x2c5d2d[_0x873b('0x37')]({'model':db[_0x873b('0xd2')],'as':_0x873b('0x6b'),'attributes':['id',_0x873b('0xd3'),_0x873b('0xd4')],'raw':!![]});var _0x1a960a=[{'model':db['SmsMessage'],'as':_0x873b('0xd5'),'attributes':['id',_0x873b('0x7d'),_0x873b('0x81'),'direction','secret','read'],'include':_0x2c5d2d}];_0x1a960a[_0x873b('0x37')]({'model':db[_0x873b('0xd6')],'as':_0x873b('0xd7'),'attributes':['id',_0x873b('0x30')]});_0x1a960a[_0x873b('0x37')]({'model':db['User'],'as':_0x873b('0xd8'),'attributes':['id','fullname']});return db['SmsInteraction']['find']({'where':{'id':_0x2fb4eb[_0x873b('0xb8')]['id']},'include':_0x1a960a})[_0x873b('0x2d')](handleEntityNotFound(_0x1d6c6a,null))[_0x873b('0x2d')](function(_0x3e1e8d){if(_0x3e1e8d){var _0x23c822=_0x3e1e8d['get']({'plain':!![]});fs[_0x873b('0xd9')](_0x3629df);var _0x4f3bdf={'channel':_0x873b('0xda'),'account':_0x23c822[_0x873b('0xd7')][_0x873b('0x30')],'agent':_0x23c822[_0x873b('0xd8')]?_0x23c822[_0x873b('0xd8')]['fullname']:_0x873b('0xdb'),'createdAt':moment(_0x23c822[_0x873b('0x81')])[_0x873b('0xc2')]('YYYY-MM-DD\x20HH:mm:ss')[_0x873b('0xa2')](),'closedAt':_0x23c822[_0x873b('0x3d')]?moment(_0x23c822[_0x873b('0xdc')])['format'](_0x873b('0xdd'))[_0x873b('0xa2')]():'','disposition':_0x23c822[_0x873b('0xde')],'messages':_(_0x23c822[_0x873b('0xd5')])[_0x873b('0x8b')]({'secret':![]})[_0x873b('0x32')](function(_0x28a010){return{'date':moment(_0x28a010[_0x873b('0x81')])[_0x873b('0xc2')]('YYYY-MM-DD\x20HH:mm:ss')[_0x873b('0xa2')](),'sender':_0x28a010[_0x873b('0xdf')]===_0x873b('0xe0')?_0x28a010[_0x873b('0xd1')]?_0x28a010['User'][_0x873b('0x33')]:_0x873b('0xe1'):_0x28a010['Contact'][_0x873b('0xd3')]+(_0x28a010[_0x873b('0x6b')]['lastName']?'\x20'+_0x28a010[_0x873b('0x6b')][_0x873b('0xd4')]:''),'body':_0x28a010[_0x873b('0x7d')],'direction':_0x28a010[_0x873b('0xdf')]===_0x873b('0xe0')?'A':'C','secret':_0x28a010[_0x873b('0xe2')],'read':_0x28a010[_0x873b('0xe3')]};})[_0x873b('0x6d')]()};return ejs[_0x873b('0xe4')](path[_0x873b('0xcb')](config[_0x873b('0xcc')],_0x873b('0xcd'),_0x873b('0xe5'),'downloadInteraction.ejs'),{'interaction':_0x4f3bdf})['then'](function(_0x5ee679){var _0x2d663a=path['join'](_0x3629df,_0x873b('0xe6')+_0x23c822['id']+'-'+_0x3aeb98+_0x873b('0xe7'));var _0x3de601={'path':_0x2d663a,'channel':_0x873b('0xda'),'interactionId':_0x23c822['id']};return pdf[_0x873b('0xe8')](_0x5ee679,_0x3de601);})[_0x873b('0x2d')](function(){return new BPromise(function(_0x30d668,_0x36d3cb){zipdir(_0x3629df,{'saveTo':_0x34ec4f},function(_0x571d31,_0x149222){if(_0x571d31)return _0x36d3cb(_0x571d31);return _0x30d668(_0x149222);});})[_0x873b('0x2d')](function(){return new BPromise(function(_0x310194,_0x1567d2){rimraf(_0x3629df,function(_0x18b832){if(_0x18b832)_0x1567d2(_0x18b832);return _0x310194();});});})[_0x873b('0x2d')](function(){return _0x1d6c6a[_0x873b('0xc9')](_0x34ec4f,_0x3c9a82,function(_0x54bf9b){if(_0x54bf9b){console[_0x873b('0xe9')](_0x873b('0xea'),_0x54bf9b);}else{fs[_0x873b('0xeb')](_0x34ec4f);}});});});}else{return _0x1d6c6a[_0x873b('0x1f')](0xc8);}})[_0x873b('0x38')](handleError(_0x1d6c6a,null));};
\ No newline at end of file
+var _0xb093=['Account','Owner','mkdirSync','Sms','closedAt','disposition','out','System','firstName','transcript-','.pdf','createPdfFromHTML','download','log','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','status','end','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','Users','map','TagIds','Tags','split','forEach','push','talking','answered','unmanaged','total','UserId','closed','waiting','index','rawAttributes','fieldName','key','query','keys','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','color','from','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','u.id\x20=\x20ui.UserId','sms_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','type','some','compact','isEmpty','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\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','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','i.SmsAccountId\x20IS\x20NOT\x20NULL','role','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','agent','SmsAccountId','sequelize','toString','keyBy','merge','SmsInteraction','a.key','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','catch','params','includeAll','include','create','body','describe','addMessage','SmsMessage','ids','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','omit','spread','emit','removeTags','join','root','server','files','tmp','attachments','fullname','CmContact','Contact','lastName','Messages','direction','secret','SmsAccount'];(function(_0x5c1345,_0x40116e){var _0x1c070d=function(_0x1e862f){while(--_0x1e862f){_0x5c1345['push'](_0x5c1345['shift']());}};_0x1c070d(++_0x40116e);}(_0xb093,0xfd));var _0x3b09=function(_0x262588,_0x42d3b6){_0x262588=_0x262588-0x0;var _0x55ae16=_0xb093[_0x262588];return _0x55ae16;};'use strict';var emlformat=require(_0x3b09('0x0'));var rimraf=require(_0x3b09('0x1'));var zipdir=require(_0x3b09('0x2'));var jsonpatch=require(_0x3b09('0x3'));var rp=require(_0x3b09('0x4'));var moment=require('moment');var BPromise=require(_0x3b09('0x5'));var Mustache=require(_0x3b09('0x6'));var util=require(_0x3b09('0x7'));var path=require('path');var sox=require(_0x3b09('0x8'));var csv=require(_0x3b09('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3b09('0xa'));var _=require(_0x3b09('0xb'));var squel=require(_0x3b09('0xc'));var crypto=require(_0x3b09('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3b09('0xe'));var toCsv=require(_0x3b09('0x9'));var querystring=require(_0x3b09('0xf'));var Papa=require(_0x3b09('0x10'));var Redis=require(_0x3b09('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3b09('0x12'));var as=require(_0x3b09('0x13'));var pdf=require(_0x3b09('0x14'));var hardwareService=require(_0x3b09('0x15'));var logger=require(_0x3b09('0x16'))(_0x3b09('0x17'));var utils=require(_0x3b09('0x18'));var config=require(_0x3b09('0x19'));var licenseUtil=require(_0x3b09('0x1a'));var db=require(_0x3b09('0x1b'))['db'];config[_0x3b09('0x1c')]=_[_0x3b09('0x1d')](config[_0x3b09('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x3b09('0x1e'))(new Redis(config[_0x3b09('0x1c')]));require('./smsInteraction.socket')[_0x3b09('0x1f')](socket);function respondWithStatusCode(_0x21a3a6,_0x3dd460){_0x3dd460=_0x3dd460||0xcc;return function(_0xa34f80){if(_0xa34f80){return _0x21a3a6['sendStatus'](_0x3dd460);}return _0x21a3a6[_0x3b09('0x20')](_0x3dd460)[_0x3b09('0x21')]();};}function respondWithResult(_0x409610,_0x468c33){_0x468c33=_0x468c33||0xc8;return function(_0x38cc14){if(_0x38cc14){return _0x409610[_0x3b09('0x20')](_0x468c33)['json'](_0x38cc14);}};}function respondWithFilteredResult(_0x4f7822,_0x42adf5){return function(_0xdefcdb){if(_0xdefcdb){var _0x40640f=typeof _0x42adf5['offset']===_0x3b09('0x22')&&typeof _0x42adf5[_0x3b09('0x23')]===_0x3b09('0x22');var _0x24f7fc=_0xdefcdb[_0x3b09('0x24')];var _0x1b09c2=_0x40640f?0x0:_0x42adf5[_0x3b09('0x25')];var _0x5db86b=_0x40640f?_0xdefcdb[_0x3b09('0x24')]:_0x42adf5[_0x3b09('0x25')]+_0x42adf5[_0x3b09('0x23')];var _0x9f98e1;if(_0x5db86b>=_0x24f7fc){_0x5db86b=_0x24f7fc;_0x9f98e1=0xc8;}else{_0x9f98e1=0xce;}_0x4f7822[_0x3b09('0x20')](_0x9f98e1);return _0x4f7822[_0x3b09('0x26')](_0x3b09('0x27'),_0x1b09c2+'-'+_0x5db86b+'/'+_0x24f7fc)['json'](_0xdefcdb);}return null;};}function patchUpdates(_0x1f404e){return function(_0x54558f){try{jsonpatch[_0x3b09('0x28')](_0x54558f,_0x1f404e,!![]);}catch(_0x20cb68){return BPromise[_0x3b09('0x29')](_0x20cb68);}return _0x54558f[_0x3b09('0x2a')]();};}function saveUpdates(_0x21e02f,_0x11370e){return function(_0x30d58b){if(_0x30d58b){return _0x30d58b[_0x3b09('0x2b')](_0x21e02f)[_0x3b09('0x2c')](function(_0x4d2b9c){return _0x4d2b9c;});}return null;};}function removeEntity(_0x2ba8ca,_0x2d0449){return function(_0x566a1c){if(_0x566a1c){return _0x566a1c[_0x3b09('0x2d')]()[_0x3b09('0x2c')](function(){_0x2ba8ca[_0x3b09('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb41ba0,_0x154bde){return function(_0x271c10){if(!_0x271c10){_0xb41ba0[_0x3b09('0x2e')](0x194);}return _0x271c10;};}function handleError(_0x5680d2,_0x221081){_0x221081=_0x221081||0x1f4;return function(_0x1ea5cb){logger['error'](_0x1ea5cb[_0x3b09('0x2f')]);if(_0x1ea5cb[_0x3b09('0x30')]){delete _0x1ea5cb[_0x3b09('0x30')];}_0x5680d2[_0x3b09('0x20')](_0x221081)[_0x3b09('0x31')](_0x1ea5cb);};}function getInteractionUsers(_0xa610bf,_0x47b148){return new BPromise(function(_0x14beba,_0x1fd95d){try{if(_0x47b148[_0xa610bf['id']]){_0xa610bf[_0x3b09('0x32')]=_[_0x3b09('0x33')](_0x47b148[_0xa610bf['id']],function(_0x19ae22){return{'id':_0x19ae22['id'],'fullname':_0x19ae22['fullname']};});}}catch(_0x536336){_0x1fd95d(_0x536336);}_0x14beba(_0xa610bf);});}function getInteractionTags(_0x2f3999,_0x522996){return new BPromise(function(_0x1ab795,_0x22db81){try{if(_0x2f3999[_0x3b09('0x34')]){_0x2f3999[_0x3b09('0x35')]=[];_0x2f3999[_0x3b09('0x34')][_0x3b09('0x36')](',')[_0x3b09('0x37')](function(_0x3c0b0e){_0x2f3999[_0x3b09('0x35')][_0x3b09('0x38')](_0x522996[_0x3c0b0e]);});}delete _0x2f3999['TagIds'];}catch(_0x4859dd){_0x22db81(_0x4859dd);}_0x1ab795(_0x2f3999);});}function updateSmsInteraction(_0x226f2e,_0x3f7f5,_0x5d2d7c){return new BPromise(function(_0x308402,_0x4b4af0){return getInteractionUsers(_0x226f2e,_0x5d2d7c)['then'](function(_0x3e6b00){return getInteractionTags(_0x3e6b00,_0x3f7f5);})[_0x3b09('0x2c')](function(_0x53b8ab){return getStateInteraction(_0x53b8ab);})[_0x3b09('0x2c')](function(_0x23253b){_0x308402(_0x23253b);})['catch'](function(_0x3a84c9){_0x4b4af0(_0x3a84c9);});});}function getStateInteraction(_0x596562){return new BPromise(function(_0x16f13c){_0x596562['waiting']=0x0;_0x596562[_0x3b09('0x39')]=0x0;_0x596562[_0x3b09('0x3a')]=0x0;_0x596562[_0x3b09('0x3b')]=0x0;_0x596562[_0x3b09('0x3c')]=0x0;if(!_0x596562['closed']&&!_0x596562[_0x3b09('0x3d')]){_0x596562['waiting']+=0x1;}if(!_0x596562[_0x3b09('0x3e')]&&_0x596562[_0x3b09('0x3d')]){_0x596562[_0x3b09('0x39')]+=0x1;if(_0x596562[_0x3b09('0x3f')]){_0x596562[_0x3b09('0x3f')]-=0x1;}}if(_0x596562[_0x3b09('0x3e')]&&_0x596562[_0x3b09('0x3d')]){_0x596562[_0x3b09('0x3a')]+=0x1;if(_0x596562[_0x3b09('0x39')]){_0x596562[_0x3b09('0x39')]-=0x1;}}if(_0x596562[_0x3b09('0x3e')]&&!_0x596562[_0x3b09('0x3d')]){_0x596562[_0x3b09('0x3b')]+=0x1;if(_0x596562[_0x3b09('0x3f')]){_0x596562[_0x3b09('0x3f')]-=0x1;}}_0x596562[_0x3b09('0x3c')]+=0x1;_0x16f13c(_0x596562);});}exports[_0x3b09('0x40')]=function(_0x1c247a,_0x4efcd8){var _0x5bc5e8={},_0x1d1abe={},_0x3cb048={'count':0x0,'rows':[]};var _0x33c53c=_['map'](db['SmsInteraction'][_0x3b09('0x41')],function(_0x1e3981){return{'name':_0x1e3981[_0x3b09('0x42')],'type':_0x1e3981['type'][_0x3b09('0x43')]};});_0x1d1abe['model']=_[_0x3b09('0x33')](_0x33c53c,'name');_0x1d1abe[_0x3b09('0x44')]=_[_0x3b09('0x45')](_0x1c247a[_0x3b09('0x44')]);_0x1d1abe['filters']=_[_0x3b09('0x46')](_0x1d1abe['model'],_0x1d1abe[_0x3b09('0x44')]);_0x5bc5e8[_0x3b09('0x47')]=_[_0x3b09('0x46')](_0x1d1abe['model'],qs[_0x3b09('0x48')](_0x1c247a[_0x3b09('0x44')][_0x3b09('0x48')]));_0x5bc5e8[_0x3b09('0x47')]=_0x5bc5e8[_0x3b09('0x47')][_0x3b09('0x49')]?_0x5bc5e8[_0x3b09('0x47')]:_0x1d1abe[_0x3b09('0x4a')];if(!_0x1c247a[_0x3b09('0x44')][_0x3b09('0x4b')](_0x3b09('0x4c'))){_0x5bc5e8[_0x3b09('0x23')]=qs[_0x3b09('0x23')](_0x1c247a[_0x3b09('0x44')][_0x3b09('0x23')]);_0x5bc5e8[_0x3b09('0x25')]=qs['offset'](_0x1c247a['query'][_0x3b09('0x25')]);}_0x5bc5e8[_0x3b09('0x4d')]=qs[_0x3b09('0x4e')](_0x1c247a[_0x3b09('0x44')][_0x3b09('0x4e')]);_0x5bc5e8[_0x3b09('0x4f')]=qs[_0x3b09('0x50')](_[_0x3b09('0x51')](_0x1c247a['query'],_0x1d1abe[_0x3b09('0x50')]),_0x33c53c);var _0xb5959d=[];var _0x3c591f=squel[_0x3b09('0x52')]()['field']('id')['field']('name')[_0x3b09('0x53')](_0x3b09('0x54'))[_0x3b09('0x55')]('tools_tags');var _0x266c82=squel[_0x3b09('0x52')]()[_0x3b09('0x53')](_0x3b09('0x56'))['field'](_0x3b09('0x57'))[_0x3b09('0x53')](_0x3b09('0x58'))[_0x3b09('0x55')](_0x3b09('0x59'),'ui')[_0x3b09('0x5a')]('users','u',_0x3b09('0x5b'));var _0x3b52cd=squel[_0x3b09('0x52')]()['from'](_0x3b09('0x5c'),'i')['left_join']('cm_contacts','c',_0x3b09('0x5d'))['left_join'](_0x3b09('0x5e'),'o',_0x3b09('0x5f'))[_0x3b09('0x5a')](_0x3b09('0x60'),'a',_0x3b09('0x61'))[_0x3b09('0x5a')](_0x3b09('0x62'),'me',_0x3b09('0x63'))['left_join'](_0x3b09('0x64'),'it',_0x3b09('0x65'))[_0x3b09('0x5a')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x55ac82=squel[_0x3b09('0x66')]();var _0xc02c9e=[];var _0x465415=squel[_0x3b09('0x66')]();var _0xe9091d;if(_0x1c247a[_0x3b09('0x44')]['search']){_0xe9091d=as[_0x3b09('0x67')](_0x1c247a[_0x3b09('0x44')][_0x3b09('0x68')]);var _0x578a01=_0xe9091d[_0x3b09('0x69')];for(var _0x4acee1=0x0;_0x4acee1<_0xe9091d[_0x3b09('0x6a')][_0x3b09('0x49')];_0x4acee1++){var _0x1d3bf4=_0xe9091d['conditions'][_0x4acee1];var _0x3338a7='i';var _0x501037=_[_0x3b09('0x6b')](_0x33c53c,[_0x3b09('0x30'),_0x1d3bf4[_0x3b09('0x53')]]);if(!_0x501037){switch(_0x1d3bf4['field']){case _0x3b09('0x6c'):if(_0x1d3bf4[_0x3b09('0x6d')]==0x1){_0x3b52cd[_0x3b09('0x6e')]('`'+_0x1d3bf4[_0x3b09('0x53')]+_0x3b09('0x6f'));}else{_0x3b52cd[_0x3b09('0x6e')]('`'+_0x1d3bf4[_0x3b09('0x53')]+_0x3b09('0x70'));}break;case'Contact':if(_0x1d3bf4[_0x3b09('0x71')]===_0x3b09('0x72')){if(_0x1d3bf4[_0x3b09('0x6d')][_0x3b09('0x36')]('\x20')['length']>0x1){_0x55ac82[_0x578a01]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x3b09('0x73')](_0x1d3bf4[_0x3b09('0x6d')]),null);}else{var _0x54cf35='%'+_0x1d3bf4[_0x3b09('0x6d')]+'%';_0x55ac82[_0x578a01](_0x3b09('0x74'),_0x54cf35,_0x54cf35,_0x54cf35);}}else{_0x501037=_[_0x3b09('0x6b')](_0x33c53c,[_0x3b09('0x30'),'ContactId']);_0x1d3bf4['field']=_0x3b09('0x75');_0x43648a=as['buildExpression'](_0x3338a7,_0x501037['type'],_0x1d3bf4);_0x55ac82[_0x578a01](_0x43648a[_0x3b09('0x76')],_0x43648a[_0x3b09('0x6d')][_0x3b09('0x77')],_0x43648a['value'][_0x3b09('0x21')]);}break;case _0x3b09('0x78'):var _0x1e5e0b=_0x1d3bf4[_0x3b09('0x6d')][_0x3b09('0x36')](',')[_0x3b09('0x33')](function(_0x3cfee9){return Number(_0x3cfee9);});_0x1e5e0b[_0x3b09('0x37')](function(_0x2eaa5f){_0x465415['or'](_0x3b09('0x79'),'%,'+_0x2eaa5f+',%');});_0xc02c9e=_[_0x3b09('0x7a')](_0xc02c9e,_0x1e5e0b);break;case _0x3b09('0x7b'):if(_0x1d3bf4[_0x3b09('0x71')]===_0x3b09('0x72')){_0x55ac82[_0x578a01](_0x3b09('0x7c'),'%'+_0x1d3bf4[_0x3b09('0x6d')]+'%',null);}else{_0x501037=_[_0x3b09('0x6b')](_0x33c53c,['name','UserId']);_0x1d3bf4[_0x3b09('0x53')]='UserId';_0x43648a=as[_0x3b09('0x7d')](_0x3338a7,_0x501037[_0x3b09('0x7e')],_0x1d3bf4);_0x55ac82[_0x578a01](_0x43648a['text'],_0x43648a[_0x3b09('0x6d')][_0x3b09('0x77')],_0x43648a[_0x3b09('0x6d')][_0x3b09('0x21')]);}break;case'body':_0x43648a=as['buildExpression']('me',null,_0x1d3bf4);_0x55ac82[_0x578a01](_0x43648a[_0x3b09('0x76')],_0x43648a[_0x3b09('0x6d')][_0x3b09('0x77')],_0x43648a[_0x3b09('0x6d')][_0x3b09('0x21')]);break;}}else{var _0x43648a=as[_0x3b09('0x7d')](_0x3338a7,_0x501037[_0x3b09('0x7e')],_0x1d3bf4);_0x55ac82[_0x578a01](_0x43648a[_0x3b09('0x76')],_0x43648a[_0x3b09('0x6d')]['start'],_0x43648a[_0x3b09('0x6d')][_0x3b09('0x21')]);}}}else{var _0x52d030=_(_0x1c247a[_0x3b09('0x44')])[_0x3b09('0x45')]()[_0x3b09('0x33')](function(_0x4120a){return _[_0x3b09('0x7f')](_0x33c53c,['name',_0x4120a])?_0x4120a:undefined;})[_0x3b09('0x80')]()[_0x3b09('0x6d')]();if(!_[_0x3b09('0x81')](_0x52d030)){_0x52d030['forEach'](function(_0x2590f8){if(_0x2590f8==='SmsAccountId'){_0x3b52cd[_0x3b09('0x4f')](_0x3b09('0x82'),[][_0x3b09('0x83')](_0x1c247a[_0x3b09('0x44')][_0x2590f8]));}else if(_0x2590f8===_0x3b09('0x84')){var _0x8a3f2f=JSON[_0x3b09('0x85')](_0x1c247a['query'][_0x2590f8])[_0x3b09('0x86')];var _0x1bb5d4=JSON[_0x3b09('0x85')](_0x1c247a[_0x3b09('0x44')][_0x2590f8])[_0x3b09('0x87')];_0x3b52cd[_0x3b09('0x4f')](_0x3b09('0x88'),_0x8a3f2f,_0x1bb5d4);}else{if(_0x1c247a['query'][_0x2590f8]==='null'){_0x3b52cd[_0x3b09('0x4f')]('i.'+_0x2590f8+_0x3b09('0x89'));}else{_0x3b52cd['where']('i.'+_0x2590f8+_0x3b09('0x8a'),_0x1c247a[_0x3b09('0x44')][_0x2590f8]);}}});}if(_0x1c247a[_0x3b09('0x44')][_0x3b09('0x8b')]){if(_0x1c247a[_0x3b09('0x44')][_0x3b09('0x8b')]==0x1){_0x3b52cd[_0x3b09('0x6e')](_0x3b09('0x8c'));}else{_0x3b52cd[_0x3b09('0x6e')]('`unreadMessages`\x20>\x200');}}if(_0x1c247a[_0x3b09('0x44')][_0x3b09('0x8d')]){_0xc02c9e=_['isArray'](_0x1c247a[_0x3b09('0x44')][_0x3b09('0x8d')])?_0x1c247a[_0x3b09('0x44')][_0x3b09('0x8d')]:new Array(_0x1c247a[_0x3b09('0x44')][_0x3b09('0x8d')]);_0xc02c9e[_0x3b09('0x37')](function(_0x2583ff){_0x465415['or'](_0x3b09('0x79'),'%,'+_0x2583ff+',%');});}if(_0x1c247a[_0x3b09('0x44')][_0x3b09('0x8e')]){var _0x411da2=_0x1c247a[_0x3b09('0x44')]['filter'][_0x3b09('0x8f')]('\x5c','\x5c\x5c')[_0x3b09('0x8f')](/'/g,'\x27\x27');if(qs[_0x3b09('0x90')](_0x411da2)){_0x55ac82['or']('i.id\x20LIKE\x20?',_0x411da2+'%')['or'](_0x3b09('0x91'),_0x411da2+'%');}else{_0x55ac82['or'](_0x3b09('0x92'),qs[_0x3b09('0x73')](_0x411da2))['or'](_0x3b09('0x93'),_0x411da2+'%');}}}_0x3b52cd[_0x3b09('0x4f')](_0x55ac82);_0x3b52cd[_0x3b09('0x94')]('i.id');var _0x190d1e={'type':db[_0x3b09('0x95')][_0x3b09('0x96')][_0x3b09('0x97')],'raw':!![]};var _0x33436a=_0x3b52cd[_0x3b09('0x98')]();_0x33436a[_0x3b09('0x53')](_0x3b09('0x99'));_0x33436a[_0x3b09('0x53')](_0x3b09('0x9a'),_0x3b09('0x6c'));if(_0x5bc5e8[_0x3b09('0x4d')]){_0x5bc5e8[_0x3b09('0x4d')][_0x3b09('0x37')](function(_0xdcdcee){var _0xd521a6=_0xdcdcee[0x0]===_0x3b09('0x9b')?_0xdcdcee[0x0]:'i.'+_0xdcdcee[0x0];_0x3b52cd[_0x3b09('0x4d')](_0xd521a6,_0xdcdcee[0x1]===_0x3b09('0x9c')?![]:!![]);});}if(!_[_0x3b09('0x81')](_0xc02c9e)){_0x3b52cd[_0x3b09('0x6e')](_0x465415);_0x33436a[_0x3b09('0x4f')](_0x3b09('0x9d'),_0xc02c9e);}BPromise['resolve']()['then'](function(){if(!_0xe9091d){if(_0x1c247a['query']['SmsAccountId'])return;_0x33436a[_0x3b09('0x4f')](_0x3b09('0x9e'));_0x3b52cd[_0x3b09('0x4f')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x1c247a['user'][_0x3b09('0x9f')]!=='agent')return;return _0x1c247a[_0x3b09('0xa0')][_0x3b09('0xa1')]({'attributes':['id'],'raw':!![]})[_0x3b09('0x2c')](function(_0x5a7934){if(_[_0x3b09('0x81')](_0x5a7934)){_0x33436a['where'](_0x3b09('0xa2'));_0x3b52cd[_0x3b09('0x4f')](_0x3b09('0xa2'));}else{_0x33436a[_0x3b09('0x4f')](_0x3b09('0x82'),_[_0x3b09('0x33')](_0x5a7934,'id'));_0x3b52cd[_0x3b09('0x4f')](_0x3b09('0x82'),_['map'](_0x5a7934,'id'));}});})['then'](function(){if(_0x1c247a[_0x3b09('0xa0')][_0x3b09('0x9f')]===_0x3b09('0xa3')&&!_0xe9091d&&!_0x1c247a[_0x3b09('0x44')][_0x3b09('0xa4')])return[];return db[_0x3b09('0xa5')][_0x3b09('0x44')](_0x33436a[_0x3b09('0xa6')](),_0x190d1e);})[_0x3b09('0x2c')](function(_0x24fea3){_0x3cb048[_0x3b09('0x24')]=_0x24fea3[_0x3b09('0x49')];if(_0x3cb048[_0x3b09('0x24')]===0x0)return[];return db[_0x3b09('0xa5')][_0x3b09('0x44')](_0x3c591f['toString'](),_0x190d1e)[_0x3b09('0x2c')](function(_0x8d2919){_0xb5959d=_[_0x3b09('0xa7')](_0x8d2919,'id');_0x190d1e=_[_0x3b09('0xa8')](_0x190d1e,{'model':db[_0x3b09('0xa9')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1c247a['query']['fields']){_0x5bc5e8['attributes'][_0x3b09('0x37')](function(_0x24e973){_0x3b52cd[_0x3b09('0x53')]('i.'+_0x24e973);});}else{_0x3b52cd[_0x3b09('0x53')](_0x3b09('0x9a'),_0x3b09('0x6c'));_0x3b52cd['field'](_0x3b09('0xaa'),'Account.key');_0x3b52cd[_0x3b09('0x53')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x3b52cd[_0x3b09('0x53')](_0x3b09('0xab'),_0x3b09('0x9b'));_0x3b52cd[_0x3b09('0x53')](_0x3b09('0xac'));_0x3b52cd[_0x3b09('0x53')](_0x3b09('0xad'),_0x3b09('0xae'));_0x3b52cd['field'](_0x3b09('0xaf'),_0x3b09('0xb0'));_0x3b52cd[_0x3b09('0x53')](_0x3b09('0xb1'),_0x3b09('0xb2'));_0x3b52cd[_0x3b09('0x53')](_0x3b09('0xb3'),_0x3b09('0xb4'));_0x3b52cd[_0x3b09('0x53')](_0x3b09('0xb5'),'Contact.mobile');_0x3b52cd[_0x3b09('0x53')](_0x3b09('0xb6'),_0x3b09('0xb7'));_0x3b52cd[_0x3b09('0x53')](_0x3b09('0xb8'),'Owner.fullname');_0x3b52cd[_0x3b09('0x53')](_0x3b09('0xb9'),_0x3b09('0xba'));_0x3b52cd[_0x3b09('0x53')](_0x3b09('0xbb'),'TagIds');}if(_0x5bc5e8['limit'])_0x3b52cd[_0x3b09('0x23')](_0x5bc5e8[_0x3b09('0x23')]);if(_0x5bc5e8[_0x3b09('0x25')])_0x3b52cd[_0x3b09('0x25')](_0x5bc5e8[_0x3b09('0x25')]);return db['sequelize']['query'](_0x3b52cd[_0x3b09('0xa6')](),_0x190d1e);})[_0x3b09('0x2c')](function(_0x273776){if(_0x273776[_0x3b09('0x49')]>0x0)_0x266c82['where'](_0x3b09('0xbc'),_[_0x3b09('0x33')](_0x273776,'id'));return db['sequelize'][_0x3b09('0x44')](_0x266c82['toString'](),_0x190d1e)[_0x3b09('0x2c')](function(_0x4f9b4f){var _0x549da3=_['groupBy'](_0x4f9b4f,'SmsInteractionId');var _0x131bf7=[];_0x273776['forEach'](function(_0x4da75f){_0x131bf7[_0x3b09('0x38')](updateSmsInteraction(_0x4da75f,_0xb5959d,_0x549da3));});return BPromise['all'](_0x131bf7);});});})['then'](function(_0x793124){_0x3cb048['rows']=_0x793124;return _0x3cb048;})[_0x3b09('0x2c')](respondWithFilteredResult(_0x4efcd8,_0x5bc5e8))[_0x3b09('0xbd')](handleError(_0x4efcd8,null));};exports['show']=function(_0x106226,_0x42e32f){var _0x7df2eb={'raw':![],'where':{'id':_0x106226[_0x3b09('0xbe')]['id']}},_0x541b70={};_0x541b70['model']=_['keys'](db['SmsInteraction']['rawAttributes']);_0x541b70[_0x3b09('0x44')]=_[_0x3b09('0x45')](_0x106226[_0x3b09('0x44')]);_0x541b70[_0x3b09('0x50')]=_['intersection'](_0x541b70[_0x3b09('0x4a')],_0x541b70['query']);_0x7df2eb[_0x3b09('0x47')]=_['intersection'](_0x541b70[_0x3b09('0x4a')],qs[_0x3b09('0x48')](_0x106226[_0x3b09('0x44')][_0x3b09('0x48')]));_0x7df2eb[_0x3b09('0x47')]=_0x7df2eb['attributes'][_0x3b09('0x49')]?_0x7df2eb['attributes']:_0x541b70['model'];if(_0x106226[_0x3b09('0x44')][_0x3b09('0xbf')]){_0x7df2eb[_0x3b09('0xc0')]=[{'all':!![]}];}_0x7df2eb=_[_0x3b09('0xa8')]({},_0x7df2eb,_0x106226['options']);return db[_0x3b09('0xa9')][_0x3b09('0x6b')](_0x7df2eb)['then'](handleEntityNotFound(_0x42e32f,null))['then'](respondWithResult(_0x42e32f,null))[_0x3b09('0xbd')](handleError(_0x42e32f,null));};exports['create']=function(_0xdf856e,_0x105abb){return db[_0x3b09('0xa9')][_0x3b09('0xc1')](_0xdf856e[_0x3b09('0xc2')],{})[_0x3b09('0x2c')](respondWithResult(_0x105abb,0xc9))['catch'](handleError(_0x105abb,null));};exports[_0x3b09('0x2b')]=function(_0x30c3dd,_0x149271){if(_0x30c3dd[_0x3b09('0xc2')]['id']){delete _0x30c3dd[_0x3b09('0xc2')]['id'];}return db[_0x3b09('0xa9')][_0x3b09('0x6b')]({'where':{'id':_0x30c3dd[_0x3b09('0xbe')]['id']}})[_0x3b09('0x2c')](handleEntityNotFound(_0x149271,null))[_0x3b09('0x2c')](saveUpdates(_0x30c3dd[_0x3b09('0xc2')],null))[_0x3b09('0x2c')](respondWithResult(_0x149271,null))[_0x3b09('0xbd')](handleError(_0x149271,null));};exports[_0x3b09('0x2d')]=function(_0x5cf2e7,_0x12ec85){return db[_0x3b09('0xa9')]['find']({'where':{'id':_0x5cf2e7[_0x3b09('0xbe')]['id']}})[_0x3b09('0x2c')](handleEntityNotFound(_0x12ec85,null))[_0x3b09('0x2c')](removeEntity(_0x12ec85,null))[_0x3b09('0xbd')](handleError(_0x12ec85,null));};exports[_0x3b09('0xc3')]=function(_0x4507f9,_0x4c512f){return db['SmsInteraction']['describe']()[_0x3b09('0x2c')](respondWithResult(_0x4c512f,null))['catch'](handleError(_0x4c512f,null));};exports[_0x3b09('0xc4')]=function(_0x4b296d,_0x1b4036,_0x3eafb0){return db[_0x3b09('0xc5')]['find']({'where':{'id':_0x4b296d['params']['id']}})[_0x3b09('0x2c')](handleEntityNotFound(_0x1b4036,null))[_0x3b09('0x2c')](function(_0x4cc939){if(_0x4cc939){return _0x4cc939[_0x3b09('0xc4')](_0x4b296d[_0x3b09('0xc2')][_0x3b09('0xc6')],_['omit'](_0x4b296d[_0x3b09('0xc2')],[_0x3b09('0xc6'),'id'])||{});}})[_0x3b09('0x2c')](respondWithResult(_0x1b4036,null))[_0x3b09('0xbd')](handleError(_0x1b4036,null));};exports['getMessages']=function(_0xd8c338,_0x2cdb42,_0xdadff3){var _0x447992={'raw':![],'where':{}};var _0x3118f5={};var _0x2b1fc9={'count':0x0,'rows':[]};return db[_0x3b09('0xa9')]['findOne']({'where':{'id':_0xd8c338[_0x3b09('0xbe')]['id']}})[_0x3b09('0x2c')](handleEntityNotFound(_0x2cdb42,null))[_0x3b09('0x2c')](function(_0x48f8b3){if(_0x48f8b3){_0x3118f5['model']=_[_0x3b09('0x45')](db[_0x3b09('0xc5')][_0x3b09('0x41')]);_0x3118f5[_0x3b09('0x44')]=_[_0x3b09('0x45')](_0xd8c338[_0x3b09('0x44')]);_0x3118f5[_0x3b09('0x50')]=_[_0x3b09('0x46')](_0x3118f5['model'],_0x3118f5[_0x3b09('0x44')]);_0x447992['attributes']=_[_0x3b09('0x46')](_0x3118f5[_0x3b09('0x4a')],qs['fields'](_0xd8c338[_0x3b09('0x44')][_0x3b09('0x48')]));_0x447992[_0x3b09('0x47')]=_0x447992[_0x3b09('0x47')]['length']?_0x447992[_0x3b09('0x47')]:_0x3118f5[_0x3b09('0x4a')];if(!_0xd8c338['query'][_0x3b09('0x4b')]('nolimit')){_0x447992['limit']=qs['limit'](_0xd8c338['query'][_0x3b09('0x23')]);_0x447992['offset']=qs[_0x3b09('0x25')](_0xd8c338['query'][_0x3b09('0x25')]);}_0x447992[_0x3b09('0x4d')]=qs[_0x3b09('0x4e')](_0xd8c338['query']['sort']);_0x447992['where']=qs[_0x3b09('0x50')](_[_0x3b09('0x51')](_0xd8c338[_0x3b09('0x44')],_0x3118f5[_0x3b09('0x50')]));_0x447992['where']['SmsInteractionId']=_0x48f8b3['id'];if(_0xd8c338[_0x3b09('0x44')][_0x3b09('0x8e')]){_0x447992[_0x3b09('0x4f')]=_['merge'](_0x447992[_0x3b09('0x4f')],{'$or':_['map'](_0x447992['attributes'],function(_0x5dfb15){var _0x2a061c={};_0x2a061c[_0x5dfb15]={'$like':'%'+_0xd8c338[_0x3b09('0x44')][_0x3b09('0x8e')]+'%'};return _0x2a061c;})});}if(_0xd8c338[_0x3b09('0x44')]['$gte']){var _0x3278da=_0xd8c338[_0x3b09('0x44')][_0x3b09('0x86')][_0x3b09('0x36')](',');var _0x124e96={};_0x124e96[_0x3278da[0x0]]={'$gte':moment(_0x3278da[0x1])[_0x3b09('0xc7')](_0x3b09('0xc8'))};_0x447992[_0x3b09('0x4f')]=_[_0x3b09('0xa8')](_0x447992[_0x3b09('0x4f')],_0x124e96);}_0x447992=_[_0x3b09('0xa8')]({},_0x447992,_0xd8c338['options']);return db[_0x3b09('0xc5')][_0x3b09('0x24')]({'where':_0x447992['where']})[_0x3b09('0x2c')](function(_0x253d94){_0x2b1fc9[_0x3b09('0x24')]=_0x253d94;if(_0xd8c338[_0x3b09('0x44')][_0x3b09('0xbf')]){_0x447992['include']=[{'all':!![]}];}return db[_0x3b09('0xc5')][_0x3b09('0xc9')](_0x447992);})[_0x3b09('0x2c')](function(_0x4e23ac){_0x2b1fc9[_0x3b09('0xca')]=_0x4e23ac;return _0x2b1fc9;});}})[_0x3b09('0x2c')](respondWithFilteredResult(_0x2cdb42,_0x447992))[_0x3b09('0xbd')](handleError(_0x2cdb42,null));};exports[_0x3b09('0xcb')]=function(_0x3d8bff,_0x2d36b2,_0x25ea54){return db[_0x3b09('0xa9')]['find']({'where':{'id':_0x3d8bff[_0x3b09('0xbe')]['id']}})[_0x3b09('0x2c')](handleEntityNotFound(_0x2d36b2,null))[_0x3b09('0x2c')](function(_0xbc6b66){if(_0xbc6b66){return _0xbc6b66[_0x3b09('0xcc')](_0x3d8bff['body'][_0x3b09('0xc6')],_[_0x3b09('0xcd')](_0x3d8bff[_0x3b09('0xc2')],[_0x3b09('0xc6'),'id'])||{})[_0x3b09('0xce')](function(){return db[_0x3b09('0x78')][_0x3b09('0xc9')]({'attributes':['id','name',_0x3b09('0x54')],'where':{'id':_0x3d8bff[_0x3b09('0xc2')][_0x3b09('0xc6')]}});})['then'](function(_0x3fa49b){socket[_0x3b09('0xcf')]('smsInteractionTags:save',{'id':Number(_0x3d8bff[_0x3b09('0xbe')]['id']),'tags':_0x3fa49b||[]});return{'id':Number(_0x3d8bff[_0x3b09('0xbe')]['id']),'tags':_0x3fa49b||[]};});}})[_0x3b09('0x2c')](respondWithResult(_0x2d36b2,null))[_0x3b09('0xbd')](handleError(_0x2d36b2,null));};exports['removeTags']=function(_0x122539,_0x518063,_0x3551c0){return db[_0x3b09('0xa9')]['find']({'where':{'id':_0x122539['params']['id']}})[_0x3b09('0x2c')](handleEntityNotFound(_0x518063,null))[_0x3b09('0x2c')](function(_0x998206){if(_0x998206){return _0x998206[_0x3b09('0xd0')](_0x122539[_0x3b09('0x44')]['ids']);}})['then'](respondWithStatusCode(_0x518063,null))['catch'](handleError(_0x518063,null));};exports['download']=function(_0x7ae79c,_0x4f921e){var _0x4a0e02=moment()['unix']()[_0x3b09('0xa6')]();var _0x20f2ec=path[_0x3b09('0xd1')](config[_0x3b09('0xd2')],_0x3b09('0xd3'),_0x3b09('0xd4'),_0x3b09('0xd5'));var _0x20052=path[_0x3b09('0xd1')](config['root'],_0x3b09('0xd3'),_0x3b09('0xd4'),_0x3b09('0xd6'));var _0x5819e7=path[_0x3b09('0xd1')](_0x20f2ec,_0x4a0e02);var _0x23843b=util['format']('transcript-%d-%s.zip',_0x7ae79c[_0x3b09('0xbe')]['id'],_0x4a0e02);var _0x2ae808=path[_0x3b09('0xd1')](_0x20f2ec,_0x23843b);var _0x51079f=[];_0x51079f[_0x3b09('0x38')]({'model':db['User'],'as':_0x3b09('0x7b'),'attributes':['id',_0x3b09('0xd7')],'raw':!![]});_0x51079f[_0x3b09('0x38')]({'model':db[_0x3b09('0xd8')],'as':_0x3b09('0xd9'),'attributes':['id','firstName',_0x3b09('0xda')],'raw':!![]});var _0x352b4a=[{'model':db['SmsMessage'],'as':_0x3b09('0xdb'),'attributes':['id',_0x3b09('0xc2'),_0x3b09('0x84'),_0x3b09('0xdc'),_0x3b09('0xdd'),_0x3b09('0x8b')],'include':_0x51079f}];_0x352b4a['push']({'model':db[_0x3b09('0xde')],'as':_0x3b09('0xdf'),'attributes':['id',_0x3b09('0x30')]});_0x352b4a['push']({'model':db['User'],'as':_0x3b09('0xe0'),'attributes':['id',_0x3b09('0xd7')]});return db[_0x3b09('0xa9')][_0x3b09('0x6b')]({'where':{'id':_0x7ae79c[_0x3b09('0xbe')]['id']},'include':_0x352b4a})[_0x3b09('0x2c')](handleEntityNotFound(_0x4f921e,null))[_0x3b09('0x2c')](function(_0x4ea803){if(_0x4ea803){var _0x2ab5ad=_0x4ea803['get']({'plain':!![]});fs[_0x3b09('0xe1')](_0x5819e7);var _0x41b8f3={'channel':_0x3b09('0xe2'),'account':_0x2ab5ad[_0x3b09('0xdf')][_0x3b09('0x30')],'agent':_0x2ab5ad[_0x3b09('0xe0')]?_0x2ab5ad[_0x3b09('0xe0')]['fullname']:'N.A.','createdAt':moment(_0x2ab5ad[_0x3b09('0x84')])[_0x3b09('0xc7')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x2ab5ad['closed']?moment(_0x2ab5ad[_0x3b09('0xe3')])[_0x3b09('0xc7')](_0x3b09('0xc8'))['toString']():'','disposition':_0x2ab5ad[_0x3b09('0xe4')],'messages':_(_0x2ab5ad[_0x3b09('0xdb')])[_0x3b09('0x8e')]({'secret':![]})[_0x3b09('0x33')](function(_0x4329b2){return{'date':moment(_0x4329b2[_0x3b09('0x84')])['format'](_0x3b09('0xc8'))[_0x3b09('0xa6')](),'sender':_0x4329b2['direction']===_0x3b09('0xe5')?_0x4329b2[_0x3b09('0x7b')]?_0x4329b2[_0x3b09('0x7b')][_0x3b09('0xd7')]:_0x3b09('0xe6'):_0x4329b2[_0x3b09('0xd9')][_0x3b09('0xe7')]+(_0x4329b2[_0x3b09('0xd9')]['lastName']?'\x20'+_0x4329b2[_0x3b09('0xd9')][_0x3b09('0xda')]:''),'body':_0x4329b2[_0x3b09('0xc2')],'direction':_0x4329b2['direction']===_0x3b09('0xe5')?'A':'C','secret':_0x4329b2[_0x3b09('0xdd')],'read':_0x4329b2[_0x3b09('0x8b')]};})[_0x3b09('0x6d')]()};return ejs['renderFile'](path['join'](config[_0x3b09('0xd2')],_0x3b09('0xd3'),'views','downloadInteraction.ejs'),{'interaction':_0x41b8f3})[_0x3b09('0x2c')](function(_0x387876){var _0x57c833=path[_0x3b09('0xd1')](_0x5819e7,_0x3b09('0xe8')+_0x2ab5ad['id']+'-'+_0x4a0e02+_0x3b09('0xe9'));var _0x100d45={'path':_0x57c833,'channel':_0x3b09('0xe2'),'interactionId':_0x2ab5ad['id']};return pdf[_0x3b09('0xea')](_0x387876,_0x100d45);})[_0x3b09('0x2c')](function(){return new BPromise(function(_0x3512df,_0x3c07ab){zipdir(_0x5819e7,{'saveTo':_0x2ae808},function(_0x49c2a3,_0x35e5cd){if(_0x49c2a3)return _0x3c07ab(_0x49c2a3);return _0x3512df(_0x35e5cd);});})[_0x3b09('0x2c')](function(){return new BPromise(function(_0x3a8073,_0x162671){rimraf(_0x5819e7,function(_0x1805f2){if(_0x1805f2)_0x162671(_0x1805f2);return _0x3a8073();});});})['then'](function(){return _0x4f921e[_0x3b09('0xeb')](_0x2ae808,_0x23843b,function(_0x18cf7e){if(_0x18cf7e){console[_0x3b09('0xec')]('err',_0x18cf7e);}else{fs[_0x3b09('0xed')](_0x2ae808);}});});});}else{return _0x4f921e[_0x3b09('0x2e')](0xc8);}})['catch'](handleError(_0x4f921e,null));};
\ No newline at end of file
index 008fe9f..e66369d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3423=['then','setDataValue','Users','map','findAll','catch','hasOwnProperty','exports','SmsInteraction','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','getUsers'];(function(_0xc9f054,_0x39a648){var _0x127f41=function(_0x3f4a04){while(--_0x3f4a04){_0xc9f054['push'](_0xc9f054['shift']());}};_0x127f41(++_0x39a648);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var SmsInteraction=require('../../mysqldb')['db'][_0x3342('0x0')];var SmsMessage=require(_0x3342('0x1'))['db'][_0x3342('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x3342('0x3')](0x0);var events={'afterCreate':_0x3342('0x4'),'afterUpdate':_0x3342('0x5'),'afterDestroy':_0x3342('0x6')};function emitEvent(_0x3c5d8d){return function(_0x3075f8,_0x19206f,_0x467453){_0x3075f8[_0x3342('0x7')]({'attributes':['id'],'raw':!![]})[_0x3342('0x8')](function(_0x420d4b){_0x3075f8[_0x3342('0x9')](_0x3342('0xa'),_0x420d4b[_0x3342('0xb')](function(_0xd9d129){return{'id':_0xd9d129['id']};}));return SmsMessage[_0x3342('0xc')]({'where':{'SmsInteractionId':_0x3075f8['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x582c37){_0x3075f8[_0x3342('0x9')]('unreadMessages',_0x582c37['length']);SmsInteractionEvents['emit'](_0x3c5d8d+':'+_0x3075f8['id'],_0x3075f8);SmsInteractionEvents['emit'](_0x3c5d8d,_0x3075f8);_0x467453(null);})[_0x3342('0xd')](_0x467453(null));};}for(var e in events){if(events[_0x3342('0xe')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x3342('0xf')]=SmsInteractionEvents;
\ No newline at end of file
+var _0x0972=['save','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x5e5505,_0xa98756){var _0x29e715=function(_0x31d652){while(--_0x31d652){_0x5e5505['push'](_0x5e5505['shift']());}};_0x29e715(++_0xa98756);}(_0x0972,0x64));var _0x2097=function(_0x3046dc,_0x4db994){_0x3046dc=_0x3046dc-0x0;var _0x4b25db=_0x0972[_0x3046dc];return _0x4b25db;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x2097('0x0'))['db']['SmsInteraction'];var SmsMessage=require(_0x2097('0x0'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x2097('0x1')](0x0);var events={'afterCreate':_0x2097('0x2'),'afterUpdate':'update','afterDestroy':_0x2097('0x3')};function emitEvent(_0x431d1c){return function(_0xe6fbae,_0x1a7d26,_0x2f84d8){_0xe6fbae[_0x2097('0x4')]({'attributes':['id'],'raw':!![]})[_0x2097('0x5')](function(_0x59739f){_0xe6fbae[_0x2097('0x6')](_0x2097('0x7'),_0x59739f[_0x2097('0x8')](function(_0x1d94e2){return{'id':_0x1d94e2['id']};}));return SmsMessage[_0x2097('0x9')]({'where':{'SmsInteractionId':_0xe6fbae['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2e0024){_0xe6fbae[_0x2097('0x6')](_0x2097('0xa'),_0x2e0024[_0x2097('0xb')]);SmsInteractionEvents[_0x2097('0xc')](_0x431d1c+':'+_0xe6fbae['id'],_0xe6fbae);SmsInteractionEvents[_0x2097('0xc')](_0x431d1c,_0xe6fbae);_0x2f84d8(null);})[_0x2097('0xd')](_0x2f84d8(null));};}for(var e in events){if(events[_0x2097('0xe')](e)){var event=events[e];SmsInteraction[_0x2097('0xf')](e,emitEvent(event));}}module[_0x2097('0x10')]=SmsInteractionEvents;
\ No newline at end of file
index b1b6388..be29dba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f8f=['../../config/environment','exports','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x2fa1ba,_0x376258){var _0x103a96=function(_0x30dfd8){while(--_0x30dfd8){_0x2fa1ba['push'](_0x2fa1ba['shift']());}};_0x103a96(++_0x376258);}(_0x8f8f,0x172));var _0xf8f8=function(_0x5ee3e1,_0x79543){_0x5ee3e1=_0x5ee3e1-0x0;var _0x531784=_0x8f8f[_0x5ee3e1];return _0x531784;};'use strict';var _=require(_0xf8f8('0x0'));var util=require(_0xf8f8('0x1'));var logger=require(_0xf8f8('0x2'))(_0xf8f8('0x3'));var moment=require(_0xf8f8('0x4'));var BPromise=require(_0xf8f8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf8f8('0x6'));var rimraf=require(_0xf8f8('0x7'));var config=require(_0xf8f8('0x8'));var attributes=require('./smsInteraction.attributes');module[_0xf8f8('0x9')]=function(_0x68af76,_0x2bd594){return _0x68af76['define']('SmsInteraction',attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xc0cfaa,_0x2d4148,_0x2c73c2){if(_0xc0cfaa['changed'](_0xf8f8('0xa'))){_0xc0cfaa[_0xf8f8('0xb')]=moment()[_0xf8f8('0xc')](_0xf8f8('0xd'));}_0x2c73c2(null,_0xc0cfaa);}}});};
\ No newline at end of file
+var _0x8dc4=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4987d9,_0x5cfc48){var _0x418098=function(_0x577efb){while(--_0x577efb){_0x4987d9['push'](_0x4987d9['shift']());}};_0x418098(++_0x5cfc48);}(_0x8dc4,0x176));var _0x48dc=function(_0x264166,_0xa8736b){_0x264166=_0x264166-0x0;var _0x1d90e8=_0x8dc4[_0x264166];return _0x1d90e8;};'use strict';var _=require(_0x48dc('0x0'));var util=require(_0x48dc('0x1'));var logger=require(_0x48dc('0x2'))(_0x48dc('0x3'));var moment=require(_0x48dc('0x4'));var BPromise=require(_0x48dc('0x5'));var rp=require(_0x48dc('0x6'));var fs=require('fs');var path=require(_0x48dc('0x7'));var rimraf=require(_0x48dc('0x8'));var config=require('../../config/environment');var attributes=require(_0x48dc('0x9'));module[_0x48dc('0xa')]=function(_0x257ad2,_0x25a9e6){return _0x257ad2[_0x48dc('0xb')](_0x48dc('0xc'),attributes,{'tableName':_0x48dc('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3878b1,_0xcaff1b,_0x4f1309){if(_0x3878b1['changed'](_0x48dc('0xe'))){_0x3878b1[_0x48dc('0xf')]=moment()['format'](_0x48dc('0x10'));}_0x4f1309(null,_0x3878b1);}}});};
\ No newline at end of file
index 1328301..3ce8fff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf53=['register','request','then','info','debug','error','SmsInteraction,\x20%s,\x20%s','message','request\x20sent','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','attributes','limit','stringify','AddTagsToSmsInteraction','ids','omit','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./smsInteraction.socket'];(function(_0x6be029,_0x1ebc18){var _0xe2df60=function(_0x48f7ca){while(--_0x48f7ca){_0x6be029['push'](_0x6be029['shift']());}};_0xe2df60(++_0x1ebc18);}(_0xdf53,0xe5));var _0x3df5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xdf53[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x3df5('0x0'));var util=require(_0x3df5('0x1'));var moment=require(_0x3df5('0x2'));var BPromise=require('bluebird');var rs=require(_0x3df5('0x3'));var fs=require('fs');var Redis=require(_0x3df5('0x4'));var db=require(_0x3df5('0x5'))['db'];var utils=require(_0x3df5('0x6'));var logger=require(_0x3df5('0x7'))(_0x3df5('0x8'));var config=require(_0x3df5('0x9'));var jayson=require(_0x3df5('0xa'));var client=jayson[_0x3df5('0xb')][_0x3df5('0xc')]({'port':0x232a});config[_0x3df5('0xd')]=_[_0x3df5('0xe')](config[_0x3df5('0xd')],{'host':_0x3df5('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3df5('0xd')]));require(_0x3df5('0x10'))[_0x3df5('0x11')](socket);function respondWithRpcPromise(_0x4008e8,_0x32e659,_0x5373cc){return new BPromise(function(_0x1ad03b,_0xe1131a){return client[_0x3df5('0x12')](_0x4008e8,_0x5373cc)[_0x3df5('0x13')](function(_0x51142b){logger[_0x3df5('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x32e659,'request\x20sent');logger[_0x3df5('0x15')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x32e659,'request\x20sent',JSON['stringify'](_0x51142b));if(_0x51142b[_0x3df5('0x16')]){if(_0x51142b[_0x3df5('0x16')]['code']===0x1f4){logger[_0x3df5('0x16')](_0x3df5('0x17'),_0x32e659,_0x51142b[_0x3df5('0x16')][_0x3df5('0x18')]);return _0xe1131a(_0x51142b[_0x3df5('0x16')][_0x3df5('0x18')]);}logger[_0x3df5('0x16')]('SmsInteraction,\x20%s,\x20%s',_0x32e659,_0x51142b[_0x3df5('0x16')][_0x3df5('0x18')]);return _0x1ad03b(_0x51142b['error'][_0x3df5('0x18')]);}else{logger[_0x3df5('0x14')](_0x3df5('0x17'),_0x32e659,_0x3df5('0x19'));_0x1ad03b(_0x51142b[_0x3df5('0x1a')][_0x3df5('0x18')]);}})[_0x3df5('0x1b')](function(_0x142be6){logger[_0x3df5('0x16')](_0x3df5('0x17'),_0x32e659,_0x142be6);_0xe1131a(_0x142be6);});});}exports[_0x3df5('0x1c')]=function(_0x4f4c2d){var _0xa4143c=this;return new Promise(function(_0x3b14ed,_0x465f82){return db[_0x3df5('0x1d')][_0x3df5('0x1e')](_0x4f4c2d[_0x3df5('0x1f')],{'raw':_0x4f4c2d[_0x3df5('0x20')]?_0x4f4c2d[_0x3df5('0x20')][_0x3df5('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f4c2d['options']?_0x4f4c2d[_0x3df5('0x20')]['where']||null:null,'attributes':_0x4f4c2d[_0x3df5('0x20')]?_0x4f4c2d[_0x3df5('0x20')][_0x3df5('0x22')]||null:null,'limit':_0x4f4c2d['options']?_0x4f4c2d[_0x3df5('0x20')][_0x3df5('0x23')]||null:null})[_0x3df5('0x13')](function(_0xabb5c5){logger[_0x3df5('0x14')](_0x3df5('0x1c'),_0x4f4c2d);logger['debug'](_0x3df5('0x1c'),_0x4f4c2d,JSON[_0x3df5('0x24')](_0xabb5c5));_0x3b14ed(_0xabb5c5);})[_0x3df5('0x1b')](function(_0x59c04d){logger[_0x3df5('0x16')](_0x3df5('0x1c'),_0x59c04d[_0x3df5('0x18')],_0x4f4c2d);_0x465f82(_0xa4143c[_0x3df5('0x16')](0x1f4,_0x59c04d['message']));});});};exports[_0x3df5('0x25')]=function(_0x3ac2dd){return new Promise(function(_0x32159d,_0xb55c0b){return db[_0x3df5('0x1d')]['find']({'where':_0x3ac2dd[_0x3df5('0x20')]?_0x3ac2dd['options']['where']||null:null})[_0x3df5('0x13')](function(_0x51565b){if(_0x51565b){return _0x51565b['addTags'](_0x3ac2dd['body'][_0x3df5('0x26')],_[_0x3df5('0x27')](_0x3ac2dd['body'],[_0x3df5('0x26'),'id'])||{});}})['spread'](function(_0x102200){logger[_0x3df5('0x14')](_0x3df5('0x28'),_0x3ac2dd);logger[_0x3df5('0x15')]('AddTags',_0x3ac2dd,JSON[_0x3df5('0x24')](_0x102200));_0x32159d(_0x102200);})['catch'](function(_0x5971e0){logger[_0x3df5('0x16')](_0x3df5('0x28'),_0x5971e0['message'],_0x3ac2dd);_0xb55c0b(_this[_0x3df5('0x16')](0x1f4,_0x5971e0[_0x3df5('0x18')]));});});};
\ No newline at end of file
+var _0x2f30=['client','http','redis','defaults','socket.io-emitter','then','SmsInteraction,\x20%s,\x20%s','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','limit','info','catch','find','addTags','ids','omit','spread','AddTags','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x2f30,0x145));var _0x02f3=function(_0x1f4604,_0x2a1766){_0x1f4604=_0x1f4604-0x0;var _0x116a5c=_0x2f30[_0x1f4604];return _0x116a5c;};'use strict';var _=require('lodash');var util=require(_0x02f3('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x02f3('0x1'));var fs=require('fs');var Redis=require(_0x02f3('0x2'));var db=require(_0x02f3('0x3'))['db'];var utils=require(_0x02f3('0x4'));var logger=require(_0x02f3('0x5'))('rpc');var config=require(_0x02f3('0x6'));var jayson=require(_0x02f3('0x7'));var client=jayson[_0x02f3('0x8')][_0x02f3('0x9')]({'port':0x232a});config[_0x02f3('0xa')]=_[_0x02f3('0xb')](config[_0x02f3('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x02f3('0xc'))(new Redis(config['redis']));require('./smsInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x5ef6af,_0x754cda,_0x36072a){return new BPromise(function(_0x1fc7be,_0x2eddef){return client['request'](_0x5ef6af,_0x36072a)[_0x02f3('0xd')](function(_0x1907eb){logger['info'](_0x02f3('0xe'),_0x754cda,'request\x20sent');logger['debug'](_0x02f3('0xf'),_0x754cda,_0x02f3('0x10'),JSON[_0x02f3('0x11')](_0x1907eb));if(_0x1907eb['error']){if(_0x1907eb[_0x02f3('0x12')][_0x02f3('0x13')]===0x1f4){logger[_0x02f3('0x12')](_0x02f3('0xe'),_0x754cda,_0x1907eb['error'][_0x02f3('0x14')]);return _0x2eddef(_0x1907eb[_0x02f3('0x12')][_0x02f3('0x14')]);}logger['error'](_0x02f3('0xe'),_0x754cda,_0x1907eb['error'][_0x02f3('0x14')]);return _0x1fc7be(_0x1907eb[_0x02f3('0x12')][_0x02f3('0x14')]);}else{logger['info'](_0x02f3('0xe'),_0x754cda,_0x02f3('0x10'));_0x1fc7be(_0x1907eb[_0x02f3('0x15')]['message']);}})['catch'](function(_0x30064e){logger['error'](_0x02f3('0xe'),_0x754cda,_0x30064e);_0x2eddef(_0x30064e);});});}exports[_0x02f3('0x16')]=function(_0xef6c4b){var _0x1bc593=this;return new Promise(function(_0x235124,_0x54207f){return db[_0x02f3('0x17')][_0x02f3('0x18')](_0xef6c4b[_0x02f3('0x19')],{'raw':_0xef6c4b['options']?_0xef6c4b[_0x02f3('0x1a')][_0x02f3('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xef6c4b[_0x02f3('0x1a')]?_0xef6c4b[_0x02f3('0x1a')]['where']||null:null,'attributes':_0xef6c4b[_0x02f3('0x1a')]?_0xef6c4b[_0x02f3('0x1a')]['attributes']||null:null,'limit':_0xef6c4b[_0x02f3('0x1a')]?_0xef6c4b[_0x02f3('0x1a')][_0x02f3('0x1c')]||null:null})[_0x02f3('0xd')](function(_0x192bc5){logger[_0x02f3('0x1d')]('UpdateSmsInteraction',_0xef6c4b);logger['debug'](_0x02f3('0x16'),_0xef6c4b,JSON['stringify'](_0x192bc5));_0x235124(_0x192bc5);})[_0x02f3('0x1e')](function(_0x576d3d){logger[_0x02f3('0x12')](_0x02f3('0x16'),_0x576d3d[_0x02f3('0x14')],_0xef6c4b);_0x54207f(_0x1bc593['error'](0x1f4,_0x576d3d[_0x02f3('0x14')]));});});};exports['AddTagsToSmsInteraction']=function(_0x22f07b){return new Promise(function(_0x308728,_0x41788b){return db[_0x02f3('0x17')][_0x02f3('0x1f')]({'where':_0x22f07b['options']?_0x22f07b[_0x02f3('0x1a')]['where']||null:null})[_0x02f3('0xd')](function(_0x55b208){if(_0x55b208){return _0x55b208[_0x02f3('0x20')](_0x22f07b[_0x02f3('0x19')][_0x02f3('0x21')],_[_0x02f3('0x22')](_0x22f07b['body'],[_0x02f3('0x21'),'id'])||{});}})[_0x02f3('0x23')](function(_0x503586){logger[_0x02f3('0x1d')](_0x02f3('0x24'),_0x22f07b);logger['debug']('AddTags',_0x22f07b,JSON[_0x02f3('0x11')](_0x503586));_0x308728(_0x503586);})[_0x02f3('0x1e')](function(_0x637ebf){logger[_0x02f3('0x12')](_0x02f3('0x24'),_0x637ebf['message'],_0x22f07b);_0x41788b(_this[_0x02f3('0x12')](0x1f4,_0x637ebf[_0x02f3('0x14')]));});});};
\ No newline at end of file
index e601463..2fb571d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe930=['removeListener','smsInteraction:','./smsInteraction.events','update'];(function(_0x3aeec4,_0x5cd3bd){var _0x22d53f=function(_0x198070){while(--_0x198070){_0x3aeec4['push'](_0x3aeec4['shift']());}};_0x22d53f(++_0x5cd3bd);}(_0xe930,0xf2));var _0x0e93=function(_0x58a4fe,_0x11d439){_0x58a4fe=_0x58a4fe-0x0;var _0x697de2=_0xe930[_0x58a4fe];return _0x697de2;};'use strict';var SmsInteractionEvents=require(_0x0e93('0x0'));var events=['save','remove',_0x0e93('0x1')];function createListener(_0x467025,_0x4f629a){return function(_0x2f0fa4){_0x4f629a['emit'](_0x467025,_0x2f0fa4);};}function removeListener(_0x5ed045,_0x4e508f){return function(){SmsInteractionEvents[_0x0e93('0x2')](_0x5ed045,_0x4e508f);};}exports['register']=function(_0x573604){for(var _0x20bc53=0x0,_0x4ca051=events['length'];_0x20bc53<_0x4ca051;_0x20bc53++){var _0x56f794=events[_0x20bc53];var _0x1140fb=createListener(_0x0e93('0x3')+_0x56f794,_0x573604);SmsInteractionEvents['on'](_0x56f794,_0x1140fb);}};
\ No newline at end of file
+var _0xdcca=['emit','removeListener','register','./smsInteraction.events'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xdcca,0x93));var _0xadcc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdcca[_0x3dd15e];return _0x231fd0;};'use strict';var SmsInteractionEvents=require(_0xadcc('0x0'));var events=['save','remove','update'];function createListener(_0x1dda23,_0x264206){return function(_0x3aff8a){_0x264206[_0xadcc('0x1')](_0x1dda23,_0x3aff8a);};}function removeListener(_0x25c127,_0x56fe71){return function(){SmsInteractionEvents[_0xadcc('0x2')](_0x25c127,_0x56fe71);};}exports[_0xadcc('0x3')]=function(_0x414903){for(var _0x1fc8bc=0x0,_0x4483b0=events['length'];_0x1fc8bc<_0x4483b0;_0x1fc8bc++){var _0x467d35=events[_0x1fc8bc];var _0x25e685=createListener('smsInteraction:'+_0x467d35,_0x414903);SmsInteractionEvents['on'](_0x467d35,_0x25e685);}};
\ No newline at end of file
index a635712..266dbc5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x359b=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./smsMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','sms','smsmessage:create','create','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','delete','destroy','multer','util','path'];(function(_0x28919f,_0x425587){var _0x5b2911=function(_0x175428){while(--_0x175428){_0x28919f['push'](_0x28919f['shift']());}};_0x5b2911(++_0x425587);}(_0x359b,0xe5));var _0xb359=function(_0x54b773,_0x1bdbd4){_0x54b773=_0x54b773-0x0;var _0x4c5305=_0x359b[_0x54b773];return _0x4c5305;};'use strict';var multer=require(_0xb359('0x0'));var util=require(_0xb359('0x1'));var path=require(_0xb359('0x2'));var timeout=require(_0xb359('0x3'));var express=require(_0xb359('0x4'));var router=express[_0xb359('0x5')]();var fs_extra=require(_0xb359('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xb359('0x7'));var config=require('../../config/environment');var controller=require(_0xb359('0x8'));router[_0xb359('0x9')]('/',auth['isAuthenticated'](),controller[_0xb359('0xa')]);router[_0xb359('0x9')](_0xb359('0xb'),auth[_0xb359('0xc')](),controller[_0xb359('0xd')]);router[_0xb359('0x9')](_0xb359('0xe'),auth[_0xb359('0xc')](),controller[_0xb359('0xf')]);router[_0xb359('0x10')]('/',auth[_0xb359('0xc')](),interaction['tracked'](_0xb359('0x11'),_0xb359('0x12')),controller[_0xb359('0x13')]);router[_0xb359('0x10')](_0xb359('0x14'),controller[_0xb359('0x15')]);router[_0xb359('0x16')]('/:id',auth[_0xb359('0xc')](),controller[_0xb359('0x17')]);router[_0xb359('0x16')](_0xb359('0x18'),auth[_0xb359('0xc')](),controller[_0xb359('0x19')]);router[_0xb359('0x16')](_0xb359('0x1a'),auth[_0xb359('0xc')](),controller['reject']);router[_0xb359('0x1b')](_0xb359('0xe'),auth[_0xb359('0xc')](),controller[_0xb359('0x1c')]);module['exports']=router;
\ No newline at end of file
+var _0x0b4b=['connect-timeout','Router','../../components/auth/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','sms','create','/:id/status','update','/:id/accept','accept','put','/:id/reject','reject','delete','destroy','multer','path'];(function(_0x554074,_0x2cef1c){var _0x3002e3=function(_0x245e52){while(--_0x245e52){_0x554074['push'](_0x554074['shift']());}};_0x3002e3(++_0x2cef1c);}(_0x0b4b,0x16a));var _0xb0b4=function(_0x20e7e3,_0x1529be){_0x20e7e3=_0x20e7e3-0x0;var _0x14b9de=_0x0b4b[_0x20e7e3];return _0x14b9de;};'use strict';var multer=require(_0xb0b4('0x0'));var util=require('util');var path=require(_0xb0b4('0x1'));var timeout=require(_0xb0b4('0x2'));var express=require('express');var router=express[_0xb0b4('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb0b4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb0b4('0x5'));var controller=require(_0xb0b4('0x6'));router[_0xb0b4('0x7')]('/',auth[_0xb0b4('0x8')](),controller[_0xb0b4('0x9')]);router[_0xb0b4('0x7')](_0xb0b4('0xa'),auth[_0xb0b4('0x8')](),controller[_0xb0b4('0xb')]);router['get'](_0xb0b4('0xc'),auth[_0xb0b4('0x8')](),controller['show']);router[_0xb0b4('0xd')]('/',auth[_0xb0b4('0x8')](),interaction[_0xb0b4('0xe')](_0xb0b4('0xf'),'smsmessage:create'),controller[_0xb0b4('0x10')]);router[_0xb0b4('0xd')](_0xb0b4('0x11'),controller['status']);router['put'](_0xb0b4('0xc'),auth[_0xb0b4('0x8')](),controller[_0xb0b4('0x12')]);router['put'](_0xb0b4('0x13'),auth[_0xb0b4('0x8')](),controller[_0xb0b4('0x14')]);router[_0xb0b4('0x15')](_0xb0b4('0x16'),auth[_0xb0b4('0x8')](),controller[_0xb0b4('0x17')]);router[_0xb0b4('0x18')](_0xb0b4('0xc'),auth[_0xb0b4('0x8')](),controller[_0xb0b4('0x19')]);module['exports']=router;
\ No newline at end of file
index 20f8b5c..c4c10cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd311=['out','STRING','DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x43b06b,_0x1929c7){var _0x2c555b=function(_0x30fa8c){while(--_0x30fa8c){_0x43b06b['push'](_0x43b06b['shift']());}};_0x2c555b(++_0x1929c7);}(_0xd311,0x1aa));var _0x1d31=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd311[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x1d31('0x0'));module[_0x1d31('0x1')]={'body':{'type':Sequelize[_0x1d31('0x2')](_0x1d31('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x1d31('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1d31('0x5')]('in','out'),'defaultValue':_0x1d31('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x1d31('0x7')]},'readAt':{'type':Sequelize[_0x1d31('0x8')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x1d31('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x23b0=['TEXT','medium','BOOLEAN','ENUM','STRING','DATE','exports'];(function(_0x3bb834,_0xeb5e81){var _0x4d0885=function(_0x232748){while(--_0x232748){_0x3bb834['push'](_0x3bb834['shift']());}};_0x4d0885(++_0xeb5e81);}(_0x23b0,0xc3));var _0x023b=function(_0x3167a8,_0x29cf8f){_0x3167a8=_0x3167a8-0x0;var _0x202e4b=_0x23b0[_0x3167a8];return _0x202e4b;};'use strict';var Sequelize=require('sequelize');module[_0x023b('0x0')]={'body':{'type':Sequelize[_0x023b('0x1')](_0x023b('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x023b('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x023b('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x023b('0x5')](0xbe)},'phone':{'type':Sequelize[_0x023b('0x5')]},'readAt':{'type':Sequelize[_0x023b('0x6')]},'secret':{'type':Sequelize[_0x023b('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x023b('0x5')]},'providerResponse':{'type':Sequelize[_0x023b('0x1')]}};
\ No newline at end of file
index ec8ab4e..3e46fd8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd664=['SmsAccountId','inspect','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','results','groupName','DELIVERED','infobip','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','offset','count','limit','Content-Range','json','apply','reject','save','update','destroy','sendStatus','stack','send','index','map','rawAttributes','fieldName','type','key','model','name','keys','filters','intersection','fields','attributes','length','query','sort','pick','filter','where','merge','VIRTUAL','options','SmsMessage','include','rows','catch','show','params','includeAll','create','body','find','describe','accept','sms','read','format','UserId','user','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[SMSMESSAGE: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','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','agent','manual','SIP/%s','channel','motionChannel','event','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','EventManager','rejectmessage'];(function(_0x2f368a,_0x17425a){var _0x416795=function(_0x1b626f){while(--_0x1b626f){_0x2f368a['push'](_0x2f368a['shift']());}};_0x416795(++_0x17425a);}(_0xd664,0xa5));var _0x4d66=function(_0x386691,_0x37bc53){_0x386691=_0x386691-0x0;var _0x34956b=_0xd664[_0x386691];return _0x34956b;};'use strict';var emlformat=require(_0x4d66('0x0'));var rimraf=require(_0x4d66('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4d66('0x2'));var BPromise=require(_0x4d66('0x3'));var Mustache=require('mustache');var util=require(_0x4d66('0x4'));var path=require(_0x4d66('0x5'));var sox=require(_0x4d66('0x6'));var csv=require(_0x4d66('0x7'));var ejs=require(_0x4d66('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4d66('0x9'));var squel=require(_0x4d66('0xa'));var crypto=require(_0x4d66('0xb'));var jsforce=require(_0x4d66('0xc'));var deskjs=require(_0x4d66('0xd'));var toCsv=require(_0x4d66('0x7'));var querystring=require(_0x4d66('0xe'));var Papa=require(_0x4d66('0xf'));var Redis=require(_0x4d66('0x10'));var authService=require(_0x4d66('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4d66('0x12'));var hardwareService=require(_0x4d66('0x13'));var logger=require(_0x4d66('0x14'))(_0x4d66('0x15'));var utils=require(_0x4d66('0x16'));var config=require(_0x4d66('0x17'));var licenseUtil=require(_0x4d66('0x18'));var db=require(_0x4d66('0x19'))['db'];config[_0x4d66('0x1a')]=_[_0x4d66('0x1b')](config[_0x4d66('0x1a')],{'host':_0x4d66('0x1c'),'port':0x18eb});var socket=require(_0x4d66('0x1d'))(new Redis(config[_0x4d66('0x1a')]));require('./smsMessage.socket')[_0x4d66('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x4d66('0x1f')][_0x4d66('0x20')]({'port':0x232c});var client9002=jayson[_0x4d66('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2aaf2b,_0x3d3cda,_0x54ec23,_0x4f0150){return new BPromise(function(_0xbd27f2,_0x1a3df5){var _0x2710f5=_0x4f0150||client;return _0x2710f5['request'](_0x2aaf2b,_0x54ec23)[_0x4d66('0x21')](function(_0x2e5fb3){logger[_0x4d66('0x22')](_0x4d66('0x23'),_0x3d3cda,_0x4d66('0x24'));logger[_0x4d66('0x25')](_0x4d66('0x26'),_0x3d3cda,_0x4d66('0x24'),JSON[_0x4d66('0x27')](_0x2e5fb3));if(_0x2e5fb3['error']){if(_0x2e5fb3[_0x4d66('0x28')][_0x4d66('0x29')]===0x1f4){logger[_0x4d66('0x28')](_0x4d66('0x23'),_0x3d3cda,_0x2e5fb3[_0x4d66('0x28')]['message']);return _0x1a3df5(_0x2e5fb3[_0x4d66('0x28')][_0x4d66('0x2a')]);}logger[_0x4d66('0x28')](_0x4d66('0x23'),_0x3d3cda,_0x2e5fb3['error'][_0x4d66('0x2a')]);return _0xbd27f2(_0x2e5fb3[_0x4d66('0x28')][_0x4d66('0x2a')]);}else{logger[_0x4d66('0x22')]('SmsMessage,\x20%s,\x20%s',_0x3d3cda,_0x4d66('0x24'));_0xbd27f2(_0x2e5fb3[_0x4d66('0x2b')]['message']);}})['catch'](function(_0x3266aa){logger['error'](_0x4d66('0x23'),_0x3d3cda,_0x3266aa);_0x1a3df5(_0x3266aa);});});}function respondWithStatusCode(_0x51760a,_0x5830d4){_0x5830d4=_0x5830d4||0xcc;return function(_0x450d4a){if(_0x450d4a){return _0x51760a['sendStatus'](_0x5830d4);}return _0x51760a[_0x4d66('0x2c')](_0x5830d4)['end']();};}function respondWithResult(_0x112667,_0x25943e){_0x25943e=_0x25943e||0xc8;return function(_0x2c248e){if(_0x2c248e){return _0x112667[_0x4d66('0x2c')](_0x25943e)['json'](_0x2c248e);}};}function respondWithFilteredResult(_0x2fd4ee,_0x766c4f){return function(_0x3e1626){if(_0x3e1626){var _0x1043fa=typeof _0x766c4f[_0x4d66('0x2d')]==='undefined'&&typeof _0x766c4f['limit']==='undefined';var _0x53348e=_0x3e1626['count'];var _0x14abf6=_0x1043fa?0x0:_0x766c4f['offset'];var _0x3d1c3e=_0x1043fa?_0x3e1626[_0x4d66('0x2e')]:_0x766c4f[_0x4d66('0x2d')]+_0x766c4f[_0x4d66('0x2f')];var _0x108add;if(_0x3d1c3e>=_0x53348e){_0x3d1c3e=_0x53348e;_0x108add=0xc8;}else{_0x108add=0xce;}_0x2fd4ee[_0x4d66('0x2c')](_0x108add);return _0x2fd4ee['set'](_0x4d66('0x30'),_0x14abf6+'-'+_0x3d1c3e+'/'+_0x53348e)[_0x4d66('0x31')](_0x3e1626);}return null;};}function patchUpdates(_0x576416){return function(_0x165755){try{jsonpatch[_0x4d66('0x32')](_0x165755,_0x576416,!![]);}catch(_0x240967){return BPromise[_0x4d66('0x33')](_0x240967);}return _0x165755[_0x4d66('0x34')]();};}function saveUpdates(_0x1a0067,_0x3b11a8){return function(_0xc1dc5e){if(_0xc1dc5e){return _0xc1dc5e[_0x4d66('0x35')](_0x1a0067)[_0x4d66('0x21')](function(_0x4b4412){return _0x4b4412;});}return null;};}function removeEntity(_0x27b3a1,_0x3810ab){return function(_0x5415db){if(_0x5415db){return _0x5415db[_0x4d66('0x36')]()['then'](function(){_0x27b3a1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f621c,_0x3290b7){return function(_0x297db6){if(!_0x297db6){_0x1f621c[_0x4d66('0x37')](0x194);}return _0x297db6;};}function handleError(_0x362c92,_0x213582){_0x213582=_0x213582||0x1f4;return function(_0x42badb){logger[_0x4d66('0x28')](_0x42badb[_0x4d66('0x38')]);if(_0x42badb['name']){delete _0x42badb['name'];}_0x362c92['status'](_0x213582)[_0x4d66('0x39')](_0x42badb);};}exports[_0x4d66('0x3a')]=function(_0x1965b3,_0x1390c8){var _0x4ca0fd={},_0x496b2c={},_0x34bcd2={'count':0x0,'rows':[]};var _0x98f08c=_[_0x4d66('0x3b')](db['SmsMessage'][_0x4d66('0x3c')],function(_0x2d4d40){return{'name':_0x2d4d40[_0x4d66('0x3d')],'type':_0x2d4d40[_0x4d66('0x3e')][_0x4d66('0x3f')]};});_0x496b2c[_0x4d66('0x40')]=_[_0x4d66('0x3b')](_0x98f08c,_0x4d66('0x41'));_0x496b2c['query']=_[_0x4d66('0x42')](_0x1965b3['query']);_0x496b2c[_0x4d66('0x43')]=_[_0x4d66('0x44')](_0x496b2c[_0x4d66('0x40')],_0x496b2c['query']);_0x4ca0fd['attributes']=_[_0x4d66('0x44')](_0x496b2c['model'],qs[_0x4d66('0x45')](_0x1965b3['query'][_0x4d66('0x45')]));_0x4ca0fd[_0x4d66('0x46')]=_0x4ca0fd[_0x4d66('0x46')][_0x4d66('0x47')]?_0x4ca0fd[_0x4d66('0x46')]:_0x496b2c[_0x4d66('0x40')];if(!_0x1965b3[_0x4d66('0x48')]['hasOwnProperty']('nolimit')){_0x4ca0fd[_0x4d66('0x2f')]=qs[_0x4d66('0x2f')](_0x1965b3[_0x4d66('0x48')][_0x4d66('0x2f')]);_0x4ca0fd[_0x4d66('0x2d')]=qs['offset'](_0x1965b3[_0x4d66('0x48')][_0x4d66('0x2d')]);}_0x4ca0fd['order']=qs[_0x4d66('0x49')](_0x1965b3[_0x4d66('0x48')]['sort']);_0x4ca0fd['where']=qs[_0x4d66('0x43')](_[_0x4d66('0x4a')](_0x1965b3[_0x4d66('0x48')],_0x496b2c[_0x4d66('0x43')]),_0x98f08c);if(_0x1965b3[_0x4d66('0x48')][_0x4d66('0x4b')]){_0x4ca0fd[_0x4d66('0x4c')]=_[_0x4d66('0x4d')](_0x4ca0fd[_0x4d66('0x4c')],{'$or':_['map'](_0x98f08c,function(_0x11cc47){if(_0x11cc47[_0x4d66('0x3e')]!==_0x4d66('0x4e')){var _0x4f6e71={};_0x4f6e71[_0x11cc47[_0x4d66('0x41')]]={'$like':'%'+_0x1965b3[_0x4d66('0x48')]['filter']+'%'};return _0x4f6e71;}})});}_0x4ca0fd=_[_0x4d66('0x4d')]({},_0x4ca0fd,_0x1965b3[_0x4d66('0x4f')]);var _0x32bdcd={'where':_0x4ca0fd[_0x4d66('0x4c')]};return db[_0x4d66('0x50')]['count'](_0x32bdcd)[_0x4d66('0x21')](function(_0x27ce79){_0x34bcd2[_0x4d66('0x2e')]=_0x27ce79;if(_0x1965b3[_0x4d66('0x48')]['includeAll']){_0x4ca0fd[_0x4d66('0x51')]=[{'all':!![]}];}return db[_0x4d66('0x50')]['findAll'](_0x4ca0fd);})[_0x4d66('0x21')](function(_0x366f26){_0x34bcd2[_0x4d66('0x52')]=_0x366f26;return _0x34bcd2;})[_0x4d66('0x21')](respondWithFilteredResult(_0x1390c8,_0x4ca0fd))[_0x4d66('0x53')](handleError(_0x1390c8,null));};exports[_0x4d66('0x54')]=function(_0x51cc22,_0x4a7971){var _0xba340c={'raw':!![],'where':{'id':_0x51cc22[_0x4d66('0x55')]['id']}},_0x2c8b6a={};_0x2c8b6a['model']=_[_0x4d66('0x42')](db[_0x4d66('0x50')][_0x4d66('0x3c')]);_0x2c8b6a[_0x4d66('0x48')]=_[_0x4d66('0x42')](_0x51cc22[_0x4d66('0x48')]);_0x2c8b6a['filters']=_[_0x4d66('0x44')](_0x2c8b6a[_0x4d66('0x40')],_0x2c8b6a[_0x4d66('0x48')]);_0xba340c[_0x4d66('0x46')]=_[_0x4d66('0x44')](_0x2c8b6a[_0x4d66('0x40')],qs[_0x4d66('0x45')](_0x51cc22['query'][_0x4d66('0x45')]));_0xba340c[_0x4d66('0x46')]=_0xba340c['attributes']['length']?_0xba340c[_0x4d66('0x46')]:_0x2c8b6a[_0x4d66('0x40')];if(_0x51cc22[_0x4d66('0x48')][_0x4d66('0x56')]){_0xba340c['include']=[{'all':!![]}];}_0xba340c=_[_0x4d66('0x4d')]({},_0xba340c,_0x51cc22[_0x4d66('0x4f')]);return db[_0x4d66('0x50')]['find'](_0xba340c)[_0x4d66('0x21')](handleEntityNotFound(_0x4a7971,null))['then'](respondWithResult(_0x4a7971,null))[_0x4d66('0x53')](handleError(_0x4a7971,null));};exports[_0x4d66('0x57')]=function(_0x32f6bc,_0x3550ca){return db[_0x4d66('0x50')][_0x4d66('0x57')](_0x32f6bc[_0x4d66('0x58')],{})[_0x4d66('0x21')](respondWithResult(_0x3550ca,0xc9))[_0x4d66('0x53')](handleError(_0x3550ca,null));};exports[_0x4d66('0x35')]=function(_0x24bf75,_0x3e6490){if(_0x24bf75[_0x4d66('0x58')]['id']){delete _0x24bf75[_0x4d66('0x58')]['id'];}return db[_0x4d66('0x50')][_0x4d66('0x59')]({'where':{'id':_0x24bf75[_0x4d66('0x55')]['id']}})[_0x4d66('0x21')](handleEntityNotFound(_0x3e6490,null))['then'](saveUpdates(_0x24bf75['body'],null))['then'](respondWithResult(_0x3e6490,null))['catch'](handleError(_0x3e6490,null));};exports[_0x4d66('0x36')]=function(_0x22d71b,_0x1654db){return db[_0x4d66('0x50')][_0x4d66('0x59')]({'where':{'id':_0x22d71b[_0x4d66('0x55')]['id']}})['then'](handleEntityNotFound(_0x1654db,null))[_0x4d66('0x21')](removeEntity(_0x1654db,null))[_0x4d66('0x53')](handleError(_0x1654db,null));};exports[_0x4d66('0x5a')]=function(_0x23285d,_0x4af3f4){return db[_0x4d66('0x50')][_0x4d66('0x5a')]()[_0x4d66('0x21')](respondWithResult(_0x4af3f4,null))[_0x4d66('0x53')](handleError(_0x4af3f4,null));};var interaction_log=require('../../config/logger')('sms-interactions');exports[_0x4d66('0x5b')]=function(_0x536849,_0x40ccb4,_0x3d7fa0){var _0x1ed22a={'agent':{},'channel':_0x4d66('0x5c')};if(_0x536849[_0x4d66('0x58')]['id']){delete _0x536849[_0x4d66('0x58')]['id'];}_0x536849[_0x4d66('0x58')][_0x4d66('0x5d')]=!![];_0x536849[_0x4d66('0x58')]['readAt']=moment()[_0x4d66('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x536849[_0x4d66('0x58')][_0x4d66('0x5f')]=_0x536849[_0x4d66('0x58')][_0x4d66('0x5f')]||_0x536849[_0x4d66('0x60')]['id'];_0x1ed22a['agent']['id']=_0x536849[_0x4d66('0x58')][_0x4d66('0x5f')];return db[_0x4d66('0x50')][_0x4d66('0x59')]({'where':{'id':_0x536849['params']['id'],'UserId':null}})[_0x4d66('0x21')](handleEntityNotFound(_0x40ccb4,null))[_0x4d66('0x21')](saveUpdates(_0x536849[_0x4d66('0x58')],null))['then'](function(_0x34490d){if(_0x34490d){_0x1ed22a[_0x4d66('0x2a')]=_0x34490d[_0x4d66('0x61')]({'plain':!![]});return db[_0x4d66('0x62')][_0x4d66('0x59')]({'where':{'id':_0x34490d[_0x4d66('0x63')]}});}return null;})[_0x4d66('0x21')](handleEntityNotFound(_0x40ccb4,null))[_0x4d66('0x21')](function(_0x41f5b1){if(_0x41f5b1){return _0x41f5b1['update']({'UserId':_0x536849[_0x4d66('0x58')][_0x4d66('0x5f')],'read1stAt':_[_0x4d66('0x64')](_0x41f5b1[_0x4d66('0x65')])?moment()[_0x4d66('0x5e')](_0x4d66('0x66')):undefined});}return null;})[_0x4d66('0x21')](function(_0x2b5b40){if(_0x2b5b40){_0x1ed22a[_0x4d66('0x67')]=_0x2b5b40[_0x4d66('0x61')]({'plain':!![]});interaction_log['info'](_0x4d66('0x68'),_0x536849[_0x4d66('0x60')]['id'],_0x536849[_0x4d66('0x60')][_0x4d66('0x41')],_0x536849[_0x4d66('0x60')]['role'],_0x1ed22a['interaction']['id'],_0x536849[_0x4d66('0x58')]?JSON['stringify'](_0x536849[_0x4d66('0x58')]):_0x4d66('0x69'));return respondWithRpcPromise(_0x4d66('0x6a'),_0x4d66('0x6b'),_0x1ed22a);}return null;})[_0x4d66('0x21')](function(_0x4c7e22){var _0x743ccf=_0x4d66('0x6c')+_0x4c7e22[_0x4d66('0x2a')][_0x4d66('0x6d')];return db[_0x4d66('0x6e')][_0x4d66('0x48')](_0x743ccf,{'type':db[_0x4d66('0x6f')][_0x4d66('0x70')][_0x4d66('0x71')],'raw':!![]})[_0x4d66('0x21')](function(_0x39699d){return _0x39699d;});})['then'](function(_0x4b97e4){if(_0x4b97e4){_0x1ed22a[_0x4d66('0x2a')][_0x4d66('0x72')]=_0x4b97e4[0x0];if(!_0x536849[_0x4d66('0x58')][_0x4d66('0x5f')])return;return db[_0x4d66('0x73')][_0x4d66('0x59')]({'where':{'id':_0x536849[_0x4d66('0x58')][_0x4d66('0x5f')],'role':'agent'},'attributes':['id',_0x4d66('0x41'),_0x4d66('0x74'),_0x4d66('0x75'),'internal'],'raw':!![]});}return null;})['then'](function(_0x59acbb){if(!_0x59acbb)return null;_0x1ed22a[_0x4d66('0x2a')][_0x4d66('0x76')]=_0x59acbb;return _0x1ed22a;})[_0x4d66('0x21')](function(_0x2fee39){if(_0x2fee39){if(_0x536849['body'][_0x4d66('0x77')]){_0x1ed22a['message']['interface']=util['format'](_0x4d66('0x78'),_0x536849[_0x4d66('0x60')][_0x4d66('0x41')]);_0x1ed22a[_0x4d66('0x2a')][_0x4d66('0x79')]=_0x1ed22a[_0x4d66('0x79')];_0x1ed22a[_0x4d66('0x2a')][_0x4d66('0x7a')]=_0x1ed22a[_0x4d66('0x79')];_0x1ed22a[_0x4d66('0x2a')][_0x4d66('0x7b')]=_0x4d66('0x5b');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x4d66('0x7c'),'message':_0x1ed22a[_0x4d66('0x2a')]},client9002)[_0x4d66('0x21')](function(){return _0x1ed22a;});}return _0x1ed22a;}return null;})[_0x4d66('0x21')](respondWithResult(_0x40ccb4,null))[_0x4d66('0x53')](handleError(_0x40ccb4,null));};var interaction_log=require('../../config/logger')('sms-interactions');exports['reject']=function(_0x3b89c8,_0x4ff2c0,_0x855d3b){var _0x3e6081={'agent':{},'channel':_0x4d66('0x5c')};if(_0x3b89c8['body']['id']){delete _0x3b89c8[_0x4d66('0x58')]['id'];}_0x3b89c8['body']['UserId']=_0x3b89c8[_0x4d66('0x58')][_0x4d66('0x5f')]||_0x3b89c8[_0x4d66('0x60')]['id'];_0x3e6081[_0x4d66('0x76')]['id']=_0x3b89c8[_0x4d66('0x58')][_0x4d66('0x5f')];return db[_0x4d66('0x50')][_0x4d66('0x59')]({'where':{'id':_0x3b89c8['params']['id'],'UserId':null}})[_0x4d66('0x21')](handleEntityNotFound(_0x4ff2c0,null))[_0x4d66('0x21')](function(_0x5eb3d2){if(_0x5eb3d2){_0x3e6081[_0x4d66('0x2a')]=_0x5eb3d2['get']({'plain':!![]});return db[_0x4d66('0x62')][_0x4d66('0x59')]({'where':{'id':_0x5eb3d2['SmsInteractionId']}});}return null;})[_0x4d66('0x21')](handleEntityNotFound(_0x4ff2c0,null))[_0x4d66('0x21')](function(_0x271319){if(_0x271319){_0x3e6081['interaction']=_0x271319[_0x4d66('0x61')]({'plain':!![]});interaction_log['info'](_0x4d66('0x7d'),_0x3b89c8[_0x4d66('0x60')]['id'],_0x3b89c8[_0x4d66('0x60')][_0x4d66('0x41')],_0x3b89c8[_0x4d66('0x60')][_0x4d66('0x7e')],_0x3e6081['interaction']['id'],_0x3b89c8[_0x4d66('0x58')]?JSON[_0x4d66('0x27')](_0x3b89c8['body']):_0x4d66('0x69'));return respondWithRpcPromise(_0x4d66('0x7f'),_0x4d66('0x80'),_0x3e6081);}return null;})[_0x4d66('0x21')](function(_0x68e79){var _0x597ec0='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x68e79[_0x4d66('0x2a')][_0x4d66('0x6d')];return db[_0x4d66('0x6e')]['query'](_0x597ec0,{'type':db[_0x4d66('0x6f')]['QueryTypes'][_0x4d66('0x71')],'raw':!![]})[_0x4d66('0x21')](function(_0x226132){return _0x226132;});})[_0x4d66('0x21')](function(_0x1b2235){if(_0x1b2235){_0x3e6081[_0x4d66('0x2a')]['contact']=_0x1b2235[0x0];if(!_0x3b89c8[_0x4d66('0x58')][_0x4d66('0x5f')])return;return db[_0x4d66('0x73')][_0x4d66('0x59')]({'where':{'id':_0x3b89c8[_0x4d66('0x58')][_0x4d66('0x5f')],'role':_0x4d66('0x76')},'attributes':['id',_0x4d66('0x41'),'fullname',_0x4d66('0x75'),'internal'],'raw':!![]});}return null;})[_0x4d66('0x21')](function(_0x295889){if(!_0x295889)return null;_0x3e6081[_0x4d66('0x2a')][_0x4d66('0x76')]=_0x295889;return _0x3e6081;})[_0x4d66('0x21')](function(_0x75f236){if(_0x75f236){_0x75f236[_0x4d66('0x2a')]['interface']=util[_0x4d66('0x5e')](_0x4d66('0x78'),_0x3b89c8[_0x4d66('0x60')][_0x4d66('0x41')]);_0x75f236[_0x4d66('0x2a')][_0x4d66('0x79')]=_0x3e6081['channel'];_0x75f236[_0x4d66('0x2a')][_0x4d66('0x7a')]=_0x3e6081['channel'];_0x75f236[_0x4d66('0x2a')][_0x4d66('0x7b')]=_0x4d66('0x33');respondWithRpcPromise(_0x4d66('0x81'),_0x4d66('0x81'),{'event':_0x4d66('0x82'),'message':_0x75f236['message']},client9002);return _0x3e6081;}return null;})['then'](respondWithResult(_0x4ff2c0,null))['catch'](handleError(_0x4ff2c0,null));};exports[_0x4d66('0x2c')]=function(_0x56badc,_0x309016,_0x389860){if(_0x56badc[_0x4d66('0x58')]['id']){delete _0x56badc[_0x4d66('0x58')]['id'];}var _0x155bac;return db['SmsMessage'][_0x4d66('0x59')]({'where':{'id':_0x56badc[_0x4d66('0x55')]['id']}})[_0x4d66('0x21')](handleEntityNotFound(_0x309016,null))[_0x4d66('0x21')](function(_0x3f8841){if(_0x3f8841){_0x155bac=_0x3f8841;return db['SmsAccount'][_0x4d66('0x59')]({'where':{'id':_0x3f8841[_0x4d66('0x83')]}});}})[_0x4d66('0x21')](handleEntityNotFound(_0x309016,null))[_0x4d66('0x21')](function(_0x1ce448){if(_0x1ce448){logger[_0x4d66('0x25')](_0x4d66('0x26'),_0x4d66('0x2c'),'received\x20delivery\x20report\x20from',_0x1ce448[_0x4d66('0x3e')],util[_0x4d66('0x84')](_0x56badc[_0x4d66('0x58')],{'showHidden':![],'depth':null}));switch(_0x1ce448['type']){case'twilio':if(_0x56badc[_0x4d66('0x58')][_0x4d66('0x85')]&&_0x56badc[_0x4d66('0x58')][_0x4d66('0x85')]===_0x155bac[_0x4d66('0x86')]){return _0x155bac[_0x4d66('0x35')]({'read':!![]});}else{logger['error'](_0x4d66('0x87'),'status',_0x4d66('0x88'),util[_0x4d66('0x84')](_0x56badc[_0x4d66('0x58')],{'showHidden':![],'depth':null}));}break;case _0x4d66('0x89'):if(_0x56badc[_0x4d66('0x58')][_0x4d66('0x8a')]&&_0x56badc[_0x4d66('0x58')][_0x4d66('0x8a')]===_0x155bac[_0x4d66('0x86')]&&_[_0x4d66('0x8b')]([_0x4d66('0x8c'),_0x4d66('0x8d')],_0x56badc[_0x4d66('0x58')][_0x4d66('0x8e')])>=0x0){return _0x155bac[_0x4d66('0x35')]({'read':!![]});}else{logger[_0x4d66('0x28')](_0x4d66('0x87'),_0x4d66('0x2c'),_0x4d66('0x8f'),util['inspect'](_0x56badc['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x1c782e=_0x56badc[_0x4d66('0x58')][_0x4d66('0x90')][0x0];if(_0x1c782e[_0x4d66('0x2c')][_0x4d66('0x91')]===_0x4d66('0x92')){return _0x155bac[_0x4d66('0x35')]({'read':!![]});}else{logger[_0x4d66('0x28')](_0x4d66('0x87'),_0x4d66('0x2c'),_0x4d66('0x93'),util[_0x4d66('0x84')](_0x56badc[_0x4d66('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x155bac;}})[_0x4d66('0x21')](respondWithResult(_0x309016,null))['catch'](handleError(_0x309016,null));};
\ No newline at end of file
+var _0x6eaa=['sms-interactions','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','agent','UserId','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','user','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','sms','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','Sequelize','QueryTypes','rejectmessage','SmsAccount','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','twilio','MessageSid','messageId','inspect','plivo','MessageUUID','indexOf','sent','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','DELIVERED','infobip','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','update','destroy','sendStatus','stack','name','index','map','SmsMessage','rawAttributes','fieldName','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','findAll','rows','show','params','includeAll','include','create','body','find','describe'];(function(_0x5a7e7e,_0x14d5ad){var _0x57e099=function(_0x59eb8d){while(--_0x59eb8d){_0x5a7e7e['push'](_0x5a7e7e['shift']());}};_0x57e099(++_0x14d5ad);}(_0x6eaa,0x1ed));var _0xa6ea=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x6eaa[_0x2e4aa2];return _0x5e6092;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa6ea('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa6ea('0x1'));var moment=require(_0xa6ea('0x2'));var BPromise=require(_0xa6ea('0x3'));var Mustache=require(_0xa6ea('0x4'));var util=require('util');var path=require(_0xa6ea('0x5'));var sox=require(_0xa6ea('0x6'));var csv=require(_0xa6ea('0x7'));var ejs=require(_0xa6ea('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa6ea('0x9'));var squel=require(_0xa6ea('0xa'));var crypto=require(_0xa6ea('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa6ea('0xc'));var toCsv=require(_0xa6ea('0x7'));var querystring=require(_0xa6ea('0xd'));var Papa=require('papaparse');var Redis=require(_0xa6ea('0xe'));var authService=require(_0xa6ea('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xa6ea('0x10'));var hardwareService=require(_0xa6ea('0x11'));var logger=require(_0xa6ea('0x12'))(_0xa6ea('0x13'));var utils=require(_0xa6ea('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa6ea('0x15'));var db=require(_0xa6ea('0x16'))['db'];config[_0xa6ea('0x17')]=_[_0xa6ea('0x18')](config['redis'],{'host':_0xa6ea('0x19'),'port':0x18eb});var socket=require(_0xa6ea('0x1a'))(new Redis(config[_0xa6ea('0x17')]));require(_0xa6ea('0x1b'))[_0xa6ea('0x1c')](socket);var jayson=require(_0xa6ea('0x1d'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xa6ea('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x296e86,_0x3c6d08,_0x5530ab,_0x3a9145){return new BPromise(function(_0x2c99c3,_0x3dfe17){var _0x502f47=_0x3a9145||client;return _0x502f47['request'](_0x296e86,_0x5530ab)[_0xa6ea('0x1f')](function(_0x4abaf9){logger[_0xa6ea('0x20')](_0xa6ea('0x21'),_0x3c6d08,_0xa6ea('0x22'));logger[_0xa6ea('0x23')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3c6d08,_0xa6ea('0x22'),JSON[_0xa6ea('0x24')](_0x4abaf9));if(_0x4abaf9[_0xa6ea('0x25')]){if(_0x4abaf9['error'][_0xa6ea('0x26')]===0x1f4){logger['error'](_0xa6ea('0x21'),_0x3c6d08,_0x4abaf9[_0xa6ea('0x25')][_0xa6ea('0x27')]);return _0x3dfe17(_0x4abaf9[_0xa6ea('0x25')]['message']);}logger[_0xa6ea('0x25')]('SmsMessage,\x20%s,\x20%s',_0x3c6d08,_0x4abaf9[_0xa6ea('0x25')][_0xa6ea('0x27')]);return _0x2c99c3(_0x4abaf9['error'][_0xa6ea('0x27')]);}else{logger[_0xa6ea('0x20')](_0xa6ea('0x21'),_0x3c6d08,_0xa6ea('0x22'));_0x2c99c3(_0x4abaf9[_0xa6ea('0x28')]['message']);}})[_0xa6ea('0x29')](function(_0x19e22b){logger[_0xa6ea('0x25')](_0xa6ea('0x21'),_0x3c6d08,_0x19e22b);_0x3dfe17(_0x19e22b);});});}function respondWithStatusCode(_0x354d9b,_0x582f13){_0x582f13=_0x582f13||0xcc;return function(_0x549b13){if(_0x549b13){return _0x354d9b['sendStatus'](_0x582f13);}return _0x354d9b['status'](_0x582f13)[_0xa6ea('0x2a')]();};}function respondWithResult(_0x3dc30c,_0x4061d7){_0x4061d7=_0x4061d7||0xc8;return function(_0x213450){if(_0x213450){return _0x3dc30c[_0xa6ea('0x2b')](_0x4061d7)['json'](_0x213450);}};}function respondWithFilteredResult(_0x5373e4,_0x33704a){return function(_0x90a892){if(_0x90a892){var _0x4099ba=typeof _0x33704a[_0xa6ea('0x2c')]===_0xa6ea('0x2d')&&typeof _0x33704a[_0xa6ea('0x2e')]===_0xa6ea('0x2d');var _0x5bb4a2=_0x90a892['count'];var _0x3965f5=_0x4099ba?0x0:_0x33704a['offset'];var _0x1b3c99=_0x4099ba?_0x90a892[_0xa6ea('0x2f')]:_0x33704a[_0xa6ea('0x2c')]+_0x33704a[_0xa6ea('0x2e')];var _0x55d5bd;if(_0x1b3c99>=_0x5bb4a2){_0x1b3c99=_0x5bb4a2;_0x55d5bd=0xc8;}else{_0x55d5bd=0xce;}_0x5373e4[_0xa6ea('0x2b')](_0x55d5bd);return _0x5373e4[_0xa6ea('0x30')](_0xa6ea('0x31'),_0x3965f5+'-'+_0x1b3c99+'/'+_0x5bb4a2)[_0xa6ea('0x32')](_0x90a892);}return null;};}function patchUpdates(_0x208102){return function(_0x1696a0){try{jsonpatch['apply'](_0x1696a0,_0x208102,!![]);}catch(_0x3f76e7){return BPromise[_0xa6ea('0x33')](_0x3f76e7);}return _0x1696a0['save']();};}function saveUpdates(_0x1db91,_0x7fd33b){return function(_0x4fdd9c){if(_0x4fdd9c){return _0x4fdd9c[_0xa6ea('0x34')](_0x1db91)['then'](function(_0x2c0f0f){return _0x2c0f0f;});}return null;};}function removeEntity(_0x1e735f,_0x44467f){return function(_0x1b7304){if(_0x1b7304){return _0x1b7304[_0xa6ea('0x35')]()['then'](function(){_0x1e735f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x12cbe8,_0x12ca89){return function(_0xb9617){if(!_0xb9617){_0x12cbe8[_0xa6ea('0x36')](0x194);}return _0xb9617;};}function handleError(_0xf0e41d,_0x3a6bef){_0x3a6bef=_0x3a6bef||0x1f4;return function(_0x4ca06b){logger[_0xa6ea('0x25')](_0x4ca06b[_0xa6ea('0x37')]);if(_0x4ca06b[_0xa6ea('0x38')]){delete _0x4ca06b[_0xa6ea('0x38')];}_0xf0e41d[_0xa6ea('0x2b')](_0x3a6bef)['send'](_0x4ca06b);};}exports[_0xa6ea('0x39')]=function(_0x1844da,_0x4ddb47){var _0xac3251={},_0x38ad84={},_0x34f174={'count':0x0,'rows':[]};var _0x47321d=_[_0xa6ea('0x3a')](db[_0xa6ea('0x3b')][_0xa6ea('0x3c')],function(_0x587fcf){return{'name':_0x587fcf[_0xa6ea('0x3d')],'type':_0x587fcf['type'][_0xa6ea('0x3e')]};});_0x38ad84[_0xa6ea('0x3f')]=_[_0xa6ea('0x3a')](_0x47321d,'name');_0x38ad84['query']=_[_0xa6ea('0x40')](_0x1844da[_0xa6ea('0x41')]);_0x38ad84['filters']=_[_0xa6ea('0x42')](_0x38ad84[_0xa6ea('0x3f')],_0x38ad84['query']);_0xac3251['attributes']=_['intersection'](_0x38ad84[_0xa6ea('0x3f')],qs[_0xa6ea('0x43')](_0x1844da['query']['fields']));_0xac3251[_0xa6ea('0x44')]=_0xac3251['attributes'][_0xa6ea('0x45')]?_0xac3251['attributes']:_0x38ad84[_0xa6ea('0x3f')];if(!_0x1844da[_0xa6ea('0x41')][_0xa6ea('0x46')]('nolimit')){_0xac3251[_0xa6ea('0x2e')]=qs[_0xa6ea('0x2e')](_0x1844da['query']['limit']);_0xac3251[_0xa6ea('0x2c')]=qs[_0xa6ea('0x2c')](_0x1844da['query'][_0xa6ea('0x2c')]);}_0xac3251[_0xa6ea('0x47')]=qs[_0xa6ea('0x48')](_0x1844da[_0xa6ea('0x41')][_0xa6ea('0x48')]);_0xac3251[_0xa6ea('0x49')]=qs[_0xa6ea('0x4a')](_[_0xa6ea('0x4b')](_0x1844da[_0xa6ea('0x41')],_0x38ad84[_0xa6ea('0x4a')]),_0x47321d);if(_0x1844da[_0xa6ea('0x41')][_0xa6ea('0x4c')]){_0xac3251[_0xa6ea('0x49')]=_[_0xa6ea('0x4d')](_0xac3251['where'],{'$or':_[_0xa6ea('0x3a')](_0x47321d,function(_0x53936d){if(_0x53936d[_0xa6ea('0x4e')]!==_0xa6ea('0x4f')){var _0x2f8ab3={};_0x2f8ab3[_0x53936d[_0xa6ea('0x38')]]={'$like':'%'+_0x1844da[_0xa6ea('0x41')][_0xa6ea('0x4c')]+'%'};return _0x2f8ab3;}})});}_0xac3251=_[_0xa6ea('0x4d')]({},_0xac3251,_0x1844da[_0xa6ea('0x50')]);var _0x15bf28={'where':_0xac3251[_0xa6ea('0x49')]};return db[_0xa6ea('0x3b')][_0xa6ea('0x2f')](_0x15bf28)[_0xa6ea('0x1f')](function(_0x172169){_0x34f174[_0xa6ea('0x2f')]=_0x172169;if(_0x1844da[_0xa6ea('0x41')]['includeAll']){_0xac3251['include']=[{'all':!![]}];}return db[_0xa6ea('0x3b')][_0xa6ea('0x51')](_0xac3251);})[_0xa6ea('0x1f')](function(_0x301784){_0x34f174[_0xa6ea('0x52')]=_0x301784;return _0x34f174;})[_0xa6ea('0x1f')](respondWithFilteredResult(_0x4ddb47,_0xac3251))[_0xa6ea('0x29')](handleError(_0x4ddb47,null));};exports[_0xa6ea('0x53')]=function(_0x24d2e0,_0x30c7d4){var _0x2de0c5={'raw':!![],'where':{'id':_0x24d2e0[_0xa6ea('0x54')]['id']}},_0x166de8={};_0x166de8[_0xa6ea('0x3f')]=_[_0xa6ea('0x40')](db['SmsMessage'][_0xa6ea('0x3c')]);_0x166de8[_0xa6ea('0x41')]=_['keys'](_0x24d2e0[_0xa6ea('0x41')]);_0x166de8[_0xa6ea('0x4a')]=_['intersection'](_0x166de8[_0xa6ea('0x3f')],_0x166de8[_0xa6ea('0x41')]);_0x2de0c5[_0xa6ea('0x44')]=_['intersection'](_0x166de8[_0xa6ea('0x3f')],qs[_0xa6ea('0x43')](_0x24d2e0[_0xa6ea('0x41')][_0xa6ea('0x43')]));_0x2de0c5[_0xa6ea('0x44')]=_0x2de0c5[_0xa6ea('0x44')][_0xa6ea('0x45')]?_0x2de0c5[_0xa6ea('0x44')]:_0x166de8[_0xa6ea('0x3f')];if(_0x24d2e0['query'][_0xa6ea('0x55')]){_0x2de0c5[_0xa6ea('0x56')]=[{'all':!![]}];}_0x2de0c5=_[_0xa6ea('0x4d')]({},_0x2de0c5,_0x24d2e0[_0xa6ea('0x50')]);return db[_0xa6ea('0x3b')]['find'](_0x2de0c5)['then'](handleEntityNotFound(_0x30c7d4,null))['then'](respondWithResult(_0x30c7d4,null))[_0xa6ea('0x29')](handleError(_0x30c7d4,null));};exports[_0xa6ea('0x57')]=function(_0x18fe2e,_0x33cc12){return db[_0xa6ea('0x3b')]['create'](_0x18fe2e['body'],{})['then'](respondWithResult(_0x33cc12,0xc9))[_0xa6ea('0x29')](handleError(_0x33cc12,null));};exports['update']=function(_0x1e9082,_0xb3171){if(_0x1e9082[_0xa6ea('0x58')]['id']){delete _0x1e9082[_0xa6ea('0x58')]['id'];}return db[_0xa6ea('0x3b')][_0xa6ea('0x59')]({'where':{'id':_0x1e9082['params']['id']}})[_0xa6ea('0x1f')](handleEntityNotFound(_0xb3171,null))[_0xa6ea('0x1f')](saveUpdates(_0x1e9082[_0xa6ea('0x58')],null))[_0xa6ea('0x1f')](respondWithResult(_0xb3171,null))['catch'](handleError(_0xb3171,null));};exports[_0xa6ea('0x35')]=function(_0x5e042a,_0x473b05){return db[_0xa6ea('0x3b')][_0xa6ea('0x59')]({'where':{'id':_0x5e042a[_0xa6ea('0x54')]['id']}})['then'](handleEntityNotFound(_0x473b05,null))[_0xa6ea('0x1f')](removeEntity(_0x473b05,null))['catch'](handleError(_0x473b05,null));};exports[_0xa6ea('0x5a')]=function(_0x5ec593,_0xf0cfe5){return db[_0xa6ea('0x3b')][_0xa6ea('0x5a')]()[_0xa6ea('0x1f')](respondWithResult(_0xf0cfe5,null))[_0xa6ea('0x29')](handleError(_0xf0cfe5,null));};var interaction_log=require(_0xa6ea('0x12'))(_0xa6ea('0x5b'));exports[_0xa6ea('0x5c')]=function(_0x443c7e,_0x1c11a0,_0x1efe26){var _0x182c12={'agent':{},'channel':'sms'};if(_0x443c7e[_0xa6ea('0x58')]['id']){delete _0x443c7e[_0xa6ea('0x58')]['id'];}_0x443c7e[_0xa6ea('0x58')][_0xa6ea('0x5d')]=!![];_0x443c7e[_0xa6ea('0x58')]['readAt']=moment()[_0xa6ea('0x5e')](_0xa6ea('0x5f'));_0x443c7e[_0xa6ea('0x58')]['UserId']=_0x443c7e[_0xa6ea('0x58')]['UserId']||_0x443c7e['user']['id'];_0x182c12[_0xa6ea('0x60')]['id']=_0x443c7e[_0xa6ea('0x58')][_0xa6ea('0x61')];return db['SmsMessage'][_0xa6ea('0x59')]({'where':{'id':_0x443c7e['params']['id'],'UserId':null}})[_0xa6ea('0x1f')](handleEntityNotFound(_0x1c11a0,null))[_0xa6ea('0x1f')](saveUpdates(_0x443c7e[_0xa6ea('0x58')],null))[_0xa6ea('0x1f')](function(_0x5afe0b){if(_0x5afe0b){_0x182c12[_0xa6ea('0x27')]=_0x5afe0b[_0xa6ea('0x62')]({'plain':!![]});return db[_0xa6ea('0x63')][_0xa6ea('0x59')]({'where':{'id':_0x5afe0b[_0xa6ea('0x64')]}});}return null;})[_0xa6ea('0x1f')](handleEntityNotFound(_0x1c11a0,null))[_0xa6ea('0x1f')](function(_0x1ab723){if(_0x1ab723){return _0x1ab723[_0xa6ea('0x34')]({'UserId':_0x443c7e[_0xa6ea('0x58')][_0xa6ea('0x61')],'read1stAt':_[_0xa6ea('0x65')](_0x1ab723[_0xa6ea('0x66')])?moment()['format'](_0xa6ea('0x5f')):undefined});}return null;})[_0xa6ea('0x1f')](function(_0x3011f2){if(_0x3011f2){_0x182c12[_0xa6ea('0x67')]=_0x3011f2[_0xa6ea('0x62')]({'plain':!![]});interaction_log[_0xa6ea('0x20')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x443c7e[_0xa6ea('0x68')]['id'],_0x443c7e[_0xa6ea('0x68')]['name'],_0x443c7e[_0xa6ea('0x68')][_0xa6ea('0x69')],_0x182c12[_0xa6ea('0x67')]['id'],_0x443c7e[_0xa6ea('0x58')]?JSON[_0xa6ea('0x24')](_0x443c7e['body']):'null');return respondWithRpcPromise(_0xa6ea('0x6a'),_0xa6ea('0x6b'),_0x182c12);}return null;})['then'](function(_0x41d4b8){var _0x1869fc=_0xa6ea('0x6c')+_0x41d4b8['message']['ContactId'];return db[_0xa6ea('0x6d')][_0xa6ea('0x41')](_0x1869fc,{'type':db['Sequelize']['QueryTypes'][_0xa6ea('0x6e')],'raw':!![]})['then'](function(_0x56770f){return _0x56770f;});})[_0xa6ea('0x1f')](function(_0xe1a378){if(_0xe1a378){_0x182c12[_0xa6ea('0x27')][_0xa6ea('0x6f')]=_0xe1a378[0x0];if(!_0x443c7e['body'][_0xa6ea('0x61')])return;return db[_0xa6ea('0x70')][_0xa6ea('0x59')]({'where':{'id':_0x443c7e[_0xa6ea('0x58')][_0xa6ea('0x61')],'role':'agent'},'attributes':['id',_0xa6ea('0x38'),_0xa6ea('0x71'),_0xa6ea('0x72'),_0xa6ea('0x73')],'raw':!![]});}return null;})['then'](function(_0xb87229){if(!_0xb87229)return null;_0x182c12[_0xa6ea('0x27')][_0xa6ea('0x60')]=_0xb87229;return _0x182c12;})[_0xa6ea('0x1f')](function(_0x33bf39){if(_0x33bf39){if(_0x443c7e[_0xa6ea('0x58')][_0xa6ea('0x74')]){_0x182c12[_0xa6ea('0x27')][_0xa6ea('0x75')]=util['format'](_0xa6ea('0x76'),_0x443c7e[_0xa6ea('0x68')][_0xa6ea('0x38')]);_0x182c12[_0xa6ea('0x27')][_0xa6ea('0x77')]=_0x182c12[_0xa6ea('0x77')];_0x182c12[_0xa6ea('0x27')]['motionChannel']=_0x182c12[_0xa6ea('0x77')];_0x182c12['message'][_0xa6ea('0x78')]=_0xa6ea('0x5c');return respondWithRpcPromise(_0xa6ea('0x79'),_0xa6ea('0x79'),{'event':_0xa6ea('0x7a'),'message':_0x182c12['message']},client9002)[_0xa6ea('0x1f')](function(){return _0x182c12;});}return _0x182c12;}return null;})['then'](respondWithResult(_0x1c11a0,null))[_0xa6ea('0x29')](handleError(_0x1c11a0,null));};var interaction_log=require(_0xa6ea('0x12'))(_0xa6ea('0x5b'));exports[_0xa6ea('0x33')]=function(_0x66803a,_0x5114d1,_0x30819a){var _0x272efb={'agent':{},'channel':_0xa6ea('0x7b')};if(_0x66803a[_0xa6ea('0x58')]['id']){delete _0x66803a[_0xa6ea('0x58')]['id'];}_0x66803a[_0xa6ea('0x58')][_0xa6ea('0x61')]=_0x66803a[_0xa6ea('0x58')][_0xa6ea('0x61')]||_0x66803a['user']['id'];_0x272efb[_0xa6ea('0x60')]['id']=_0x66803a[_0xa6ea('0x58')]['UserId'];return db[_0xa6ea('0x3b')][_0xa6ea('0x59')]({'where':{'id':_0x66803a[_0xa6ea('0x54')]['id'],'UserId':null}})[_0xa6ea('0x1f')](handleEntityNotFound(_0x5114d1,null))['then'](function(_0x1ab2e2){if(_0x1ab2e2){_0x272efb[_0xa6ea('0x27')]=_0x1ab2e2[_0xa6ea('0x62')]({'plain':!![]});return db[_0xa6ea('0x63')][_0xa6ea('0x59')]({'where':{'id':_0x1ab2e2[_0xa6ea('0x64')]}});}return null;})[_0xa6ea('0x1f')](handleEntityNotFound(_0x5114d1,null))[_0xa6ea('0x1f')](function(_0x190099){if(_0x190099){_0x272efb['interaction']=_0x190099[_0xa6ea('0x62')]({'plain':!![]});interaction_log['info'](_0xa6ea('0x7c'),_0x66803a[_0xa6ea('0x68')]['id'],_0x66803a[_0xa6ea('0x68')][_0xa6ea('0x38')],_0x66803a[_0xa6ea('0x68')][_0xa6ea('0x69')],_0x272efb[_0xa6ea('0x67')]['id'],_0x66803a[_0xa6ea('0x58')]?JSON[_0xa6ea('0x24')](_0x66803a[_0xa6ea('0x58')]):_0xa6ea('0x7d'));return respondWithRpcPromise(_0xa6ea('0x7e'),_0xa6ea('0x7f'),_0x272efb);}return null;})[_0xa6ea('0x1f')](function(_0x3628fc){var _0x27c717=_0xa6ea('0x6c')+_0x3628fc[_0xa6ea('0x27')]['ContactId'];return db[_0xa6ea('0x6d')][_0xa6ea('0x41')](_0x27c717,{'type':db[_0xa6ea('0x80')][_0xa6ea('0x81')][_0xa6ea('0x6e')],'raw':!![]})[_0xa6ea('0x1f')](function(_0x59435f){return _0x59435f;});})['then'](function(_0x17e7c9){if(_0x17e7c9){_0x272efb[_0xa6ea('0x27')][_0xa6ea('0x6f')]=_0x17e7c9[0x0];if(!_0x66803a[_0xa6ea('0x58')][_0xa6ea('0x61')])return;return db[_0xa6ea('0x70')]['find']({'where':{'id':_0x66803a['body'][_0xa6ea('0x61')],'role':_0xa6ea('0x60')},'attributes':['id',_0xa6ea('0x38'),_0xa6ea('0x71'),'email',_0xa6ea('0x73')],'raw':!![]});}return null;})[_0xa6ea('0x1f')](function(_0x293a0a){if(!_0x293a0a)return null;_0x272efb[_0xa6ea('0x27')]['agent']=_0x293a0a;return _0x272efb;})['then'](function(_0x48d9ce){if(_0x48d9ce){_0x48d9ce[_0xa6ea('0x27')][_0xa6ea('0x75')]=util[_0xa6ea('0x5e')](_0xa6ea('0x76'),_0x66803a[_0xa6ea('0x68')][_0xa6ea('0x38')]);_0x48d9ce[_0xa6ea('0x27')][_0xa6ea('0x77')]=_0x272efb[_0xa6ea('0x77')];_0x48d9ce[_0xa6ea('0x27')]['motionChannel']=_0x272efb[_0xa6ea('0x77')];_0x48d9ce[_0xa6ea('0x27')][_0xa6ea('0x78')]=_0xa6ea('0x33');respondWithRpcPromise(_0xa6ea('0x79'),_0xa6ea('0x79'),{'event':_0xa6ea('0x82'),'message':_0x48d9ce['message']},client9002);return _0x272efb;}return null;})[_0xa6ea('0x1f')](respondWithResult(_0x5114d1,null))['catch'](handleError(_0x5114d1,null));};exports['status']=function(_0x5eaa80,_0x10dba4,_0x12f518){if(_0x5eaa80['body']['id']){delete _0x5eaa80['body']['id'];}var _0xfaa998;return db[_0xa6ea('0x3b')]['find']({'where':{'id':_0x5eaa80[_0xa6ea('0x54')]['id']}})['then'](handleEntityNotFound(_0x10dba4,null))['then'](function(_0x492bc1){if(_0x492bc1){_0xfaa998=_0x492bc1;return db[_0xa6ea('0x83')]['find']({'where':{'id':_0x492bc1[_0xa6ea('0x84')]}});}})[_0xa6ea('0x1f')](handleEntityNotFound(_0x10dba4,null))[_0xa6ea('0x1f')](function(_0x453dbc){if(_0x453dbc){logger['debug'](_0xa6ea('0x85'),'status','received\x20delivery\x20report\x20from',_0x453dbc[_0xa6ea('0x4e')],util['inspect'](_0x5eaa80[_0xa6ea('0x58')],{'showHidden':![],'depth':null}));switch(_0x453dbc[_0xa6ea('0x4e')]){case _0xa6ea('0x86'):if(_0x5eaa80[_0xa6ea('0x58')]['MessageSid']&&_0x5eaa80[_0xa6ea('0x58')][_0xa6ea('0x87')]===_0xfaa998[_0xa6ea('0x88')]){return _0xfaa998[_0xa6ea('0x34')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xa6ea('0x2b'),'twilio',util[_0xa6ea('0x89')](_0x5eaa80[_0xa6ea('0x58')],{'showHidden':![],'depth':null}));}break;case _0xa6ea('0x8a'):if(_0x5eaa80[_0xa6ea('0x58')][_0xa6ea('0x8b')]&&_0x5eaa80[_0xa6ea('0x58')][_0xa6ea('0x8b')]===_0xfaa998[_0xa6ea('0x88')]&&_[_0xa6ea('0x8c')]([_0xa6ea('0x8d'),'delivered'],_0x5eaa80[_0xa6ea('0x58')]['Status'])>=0x0){return _0xfaa998[_0xa6ea('0x34')]({'read':!![]});}else{logger[_0xa6ea('0x25')](_0xa6ea('0x8e'),_0xa6ea('0x2b'),_0xa6ea('0x8f'),util[_0xa6ea('0x89')](_0x5eaa80[_0xa6ea('0x58')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x481fff=_0x5eaa80[_0xa6ea('0x58')]['results'][0x0];if(_0x481fff[_0xa6ea('0x2b')]['groupName']===_0xa6ea('0x90')){return _0xfaa998[_0xa6ea('0x34')]({'read':!![]});}else{logger[_0xa6ea('0x25')](_0xa6ea('0x8e'),'status',_0xa6ea('0x91'),util['inspect'](_0x5eaa80[_0xa6ea('0x58')],{'showHidden':![],'depth':null}));}break;}return _0xfaa998;}})[_0xa6ea('0x1f')](respondWithResult(_0x10dba4,null))[_0xa6ea('0x29')](handleError(_0x10dba4,null));};
\ No newline at end of file
index 370b399..db7d439 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2dcd=['hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x134192,_0x36adc5){var _0x3cd080=function(_0x134371){while(--_0x134371){_0x134192['push'](_0x134192['shift']());}};_0x3cd080(++_0x36adc5);}(_0x2dcd,0x124));var _0xd2dc=function(_0x4e697a,_0x56a14b){_0x4e697a=_0x4e697a-0x0;var _0x88850c=_0x2dcd[_0x4e697a];return _0x88850c;};'use strict';var EventEmitter=require(_0xd2dc('0x0'));var SmsMessage=require(_0xd2dc('0x1'))['db'][_0xd2dc('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xd2dc('0x3')](0x0);var events={'afterCreate':_0xd2dc('0x4'),'afterUpdate':'update','afterDestroy':_0xd2dc('0x5')};function emitEvent(_0x43b90e){return function(_0x472933,_0xc07c36,_0xff7ed3){SmsMessageEvents['emit'](_0x43b90e+':'+_0x472933['id'],_0x472933);SmsMessageEvents[_0xd2dc('0x6')](_0x43b90e,_0x472933);_0xff7ed3(null);};}for(var e in events){if(events[_0xd2dc('0x7')](e)){var event=events[e];SmsMessage[_0xd2dc('0x8')](e,emitEvent(event));}}module[_0xd2dc('0x9')]=SmsMessageEvents;
\ No newline at end of file
+var _0x8d48=['events','setMaxListeners','update','remove','emit','hook','exports'];(function(_0x243349,_0x5825de){var _0x3e8e67=function(_0x454849){while(--_0x454849){_0x243349['push'](_0x243349['shift']());}};_0x3e8e67(++_0x5825de);}(_0x8d48,0x15e));var _0x88d4=function(_0x529a0f,_0x328763){_0x529a0f=_0x529a0f-0x0;var _0x187a88=_0x8d48[_0x529a0f];return _0x187a88;};'use strict';var EventEmitter=require(_0x88d4('0x0'));var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x88d4('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x88d4('0x2'),'afterDestroy':_0x88d4('0x3')};function emitEvent(_0x44c79b){return function(_0x1b7afb,_0x34bf6a,_0x93497f){SmsMessageEvents[_0x88d4('0x4')](_0x44c79b+':'+_0x1b7afb['id'],_0x1b7afb);SmsMessageEvents[_0x88d4('0x4')](_0x44c79b,_0x1b7afb);_0x93497f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x88d4('0x5')](e,emitEvent(event));}}module[_0x88d4('0x6')]=SmsMessageEvents;
\ No newline at end of file
index 5cbf266..f370aee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77ab=['isNil','UserId','SmsInteractionId','SmsInteraction','then','update','catch','out','find','SmsAccountId','accountSid','authToken','phone','messages','create','remote','/api/sms/messages/','/status?token=','token','sid','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','sender','login?username=','&password=','GET','split','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','inspect','Missing\x20parameters:\x20authToken','clicksend','username','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','data','queued_count','head','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','IBSSO\x20','read','csc','crypto','apiKey','login','text','timestamp','keys','sort','length','createHash','md5','digest','hex','signature=','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','clickatell','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','toString','bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','application/json','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','messageId','body','FULLTEXT','models','direction','toLowerCase','secret'];(function(_0x301d8,_0x17fae8){var _0x1384de=function(_0x1c5522){while(--_0x1c5522){_0x301d8['push'](_0x301d8['shift']());}};_0x1384de(++_0x17fae8);}(_0x77ab,0x1e6));var _0xb77a=function(_0x490e1e,_0x36157e){_0x490e1e=_0x490e1e-0x0;var _0x491364=_0x77ab[_0x490e1e];return _0x491364;};'use strict';var _=require(_0xb77a('0x0'));var util=require(_0xb77a('0x1'));var logger=require(_0xb77a('0x2'))(_0xb77a('0x3'));var moment=require(_0xb77a('0x4'));var BPromise=require(_0xb77a('0x5'));var rp=require(_0xb77a('0x6'));var fs=require('fs');var path=require(_0xb77a('0x7'));var rimraf=require(_0xb77a('0x8'));var config=require('../../config/environment');var attributes=require('./smsMessage.attributes');module[_0xb77a('0x9')]=function(_0x221983,_0x307d67){return _0x221983[_0xb77a('0xa')]('SmsMessage',attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0xb77a('0xb'),'fields':[_0xb77a('0xb')]},{'name':'fti_sms_messages','fields':[_0xb77a('0xc')],'type':_0xb77a('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x411372,_0x154c2d,_0xc847b1){var _0x5bc70e=_0x221983[_0xb77a('0xe')];var _0x5b1e79=_0x411372['get']({'plain':!![]});if(_0x5b1e79[_0xb77a('0xf')]['toLowerCase']()==='in'||_0x5b1e79[_0xb77a('0xf')][_0xb77a('0x10')]()==='out'&&!_0x5b1e79[_0xb77a('0x11')]&&!_[_0xb77a('0x12')](_0x5b1e79[_0xb77a('0x13')])&&!_[_0xb77a('0x12')](_0x5b1e79[_0xb77a('0x14')])){_0x5bc70e[_0xb77a('0x15')]['findOne']({'where':{'id':_0x5b1e79['SmsInteractionId']}})[_0xb77a('0x16')](function(_0x58e2ba){if(_0x58e2ba){_0x58e2ba[_0xb77a('0x17')]({'lastMsgAt':_0x5b1e79['createdAt'],'lastMsgDirection':_0x5b1e79[_0xb77a('0xf')][_0xb77a('0x10')]()});}})[_0xb77a('0x18')](function(_0x15c43f){console['error'](_0x15c43f);});}if(_0x5b1e79[_0xb77a('0xf')]===_0xb77a('0x19')&&!_0x5b1e79['secret']){var _0x5a4a03;_0x5bc70e['SmsAccount'][_0xb77a('0x1a')]({'where':{'id':_0x5b1e79[_0xb77a('0x1b')]},'raw':!![]})[_0xb77a('0x16')](function(_0x376d4f){_0x5a4a03=_0x376d4f;if(_0x5a4a03&&_0x5a4a03['type']){switch(_0x5a4a03['type']){case'twilio':var _0x49993a=require('twilio');if(_0x5a4a03[_0xb77a('0x1c')]&&_0x5a4a03[_0xb77a('0x1d')]&&_0x5a4a03[_0xb77a('0x1e')]){var _0x13d308=new _0x49993a(_0x5a4a03[_0xb77a('0x1c')],_0x5a4a03['authToken']);_0x13d308[_0xb77a('0x1f')][_0xb77a('0x20')]({'body':_0x5b1e79[_0xb77a('0xc')],'to':_0x5b1e79[_0xb77a('0x1e')],'from':_0x5a4a03['phone'],'statusCallback':_0x5a4a03[_0xb77a('0x21')]+_0xb77a('0x22')+_0x5b1e79['id']+_0xb77a('0x23')+_0x5a4a03[_0xb77a('0x24')]})[_0xb77a('0x16')](function(_0x13b13e){if(_0x13b13e[_0xb77a('0x25')]){return _0x411372['update']({'messageId':_0x13b13e[_0xb77a('0x25')]});}})[_0xb77a('0x18')](function(_0x59e1ad){logger[_0xb77a('0x26')](_0xb77a('0x27'),_0xb77a('0x28'),_0xb77a('0x29'),util['inspect'](_0x59e1ad,{'showHidden':![],'depth':null}));});}else{logger[_0xb77a('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb77a('0x28'),_0xb77a('0x29'),_0xb77a('0x2a'));}break;case _0xb77a('0x2b'):var _0x47c83d=_0xb77a('0x2c');if(_0x5a4a03['username']&&_0x5a4a03[_0xb77a('0x2d')]){var _0x360921={'recipient':[_0x5b1e79[_0xb77a('0x1e')]],'message':_0x5b1e79['body'],'message_type':_0x5a4a03[_0xb77a('0x2e')]};if(_0x5a4a03[_0xb77a('0x2e')]&&_0x5a4a03['smsMethod']!=='SI'){_0x360921[_0xb77a('0x2f')]=_0x5a4a03[_0xb77a('0x1e')];}var _0x472c59={'url':_0x47c83d+_0xb77a('0x30')+_0x5a4a03['username']+_0xb77a('0x31')+_0x5a4a03[_0xb77a('0x2d')],'method':_0xb77a('0x32')};rp(_0x472c59)[_0xb77a('0x16')](function(_0x25bf56){var _0x2dd069=_0x25bf56[_0xb77a('0x33')](';');var _0x116230={'user_key':_0x2dd069[0x0],'session_key':_0x2dd069[0x1]};_0x472c59={'url':_0x47c83d+_0xb77a('0x34'),'method':_0xb77a('0x35'),'headers':{'user_key':_0x116230[_0xb77a('0x36')],'Session_key':_0x116230[_0xb77a('0x37')]},'json':!![],'body':_0x360921};return rp(_0x472c59);})[_0xb77a('0x16')](function(_0x27616c){if(_0x27616c[_0xb77a('0x38')]>=0x1){var _0x24bbf7={'messageId':_0x27616c[_0xb77a('0x39')]};if(_0x5a4a03[_0xb77a('0x2e')]!=='GP'||!_0x5a4a03[_0xb77a('0x3a')]){_0x24bbf7['read']=!![];}return _0x411372[_0xb77a('0x17')](_0x24bbf7);}else{return logger[_0xb77a('0x26')](_0xb77a('0x27'),_0xb77a('0x28'),_0xb77a('0x2b'),util['inspect'](_0x27616c,{'showHidden':![],'depth':null}));}})[_0xb77a('0x18')](function(_0x3710f0){return logger['error'](_0xb77a('0x27'),_0xb77a('0x28'),_0xb77a('0x2b'),util['inspect'](_0x3710f0,{'showHidden':![],'depth':null}));});}else{logger[_0xb77a('0x26')](_0xb77a('0x27'),_0xb77a('0x28'),_0xb77a('0x2b'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xb77a('0x3b'):if(_0x5a4a03[_0xb77a('0x1d')]){var _0x259cfb={'recipient':_0x5b1e79['phone'],'message':_0x5b1e79[_0xb77a('0xc')],'sender':_0x5a4a03[_0xb77a('0x3c')]||_0x5a4a03[_0xb77a('0x1e')],'authorization':_0x5a4a03[_0xb77a('0x1d')]};var _0x154c2d={'method':_0xb77a('0x35'),'uri':_0xb77a('0x3d'),'body':_0x259cfb,'json':!![]};rp(_0x154c2d)[_0xb77a('0x16')](function(_0x29e5f9){var _0x5d5c4a={'messageId':_0x29e5f9['requestid']};if(!_0x5a4a03[_0xb77a('0x3a')]){_0x5d5c4a['read']=!![];}return _0x411372['update'](_0x5d5c4a);})[_0xb77a('0x18')](function(_0x5251e5){logger[_0xb77a('0x26')](_0xb77a('0x27'),_0xb77a('0x28'),_0xb77a('0x3b'),util[_0xb77a('0x3e')](_0x5251e5,{'showHidden':![],'depth':null}));});}else{logger[_0xb77a('0x26')](_0xb77a('0x27'),'afterCreate',_0xb77a('0x3b'),_0xb77a('0x3f'));}break;case _0xb77a('0x40'):if(_0x5a4a03[_0xb77a('0x41')]&&_0x5a4a03[_0xb77a('0x2d')]){var _0x259cfb={'messages':[{'source':_0xb77a('0x42'),'to':_0x5b1e79[_0xb77a('0x1e')],'body':_0x5b1e79[_0xb77a('0xc')],'from':_0x5a4a03[_0xb77a('0x3c')]||_0x5a4a03[_0xb77a('0x1e')]}]};var _0x37e5ab=util[_0xb77a('0x43')](_0xb77a('0x44'),_0x5a4a03[_0xb77a('0x41')],_0x5a4a03[_0xb77a('0x2d')]);var _0x154c2d={'method':_0xb77a('0x35'),'uri':_0xb77a('0x45'),'body':_0x259cfb,'headers':{'Authorization':util[_0xb77a('0x43')](_0xb77a('0x46'),new Buffer(_0x37e5ab)['toString'](_0xb77a('0x47')))},'json':!![]};rp(_0x154c2d)[_0xb77a('0x16')](function(_0x2cf8d5){if(_0x2cf8d5['http_code']>=0xc8&&_0x2cf8d5['http_code']<=0xce){if(_0x2cf8d5[_0xb77a('0x48')]&&_0x2cf8d5['data'][_0xb77a('0x49')]>0x0){var _0xb41a51=_[_0xb77a('0x4a')](_0x2cf8d5[_0xb77a('0x48')][_0xb77a('0x1f')]);var _0xcbb790={'messageId':_0xb41a51[_0xb77a('0x4b')]};if(!_0x5a4a03[_0xb77a('0x3a')]){_0xcbb790['read']=!![];}return _0x411372['update'](_0xcbb790);}else{logger['error'](_0xb77a('0x27'),_0xb77a('0x28'),'clickSend',util[_0xb77a('0x3e')](_0x2cf8d5,{'showHidden':![],'depth':null}));}}else{logger[_0xb77a('0x26')](_0xb77a('0x27'),'afterCreate',_0xb77a('0x4c'),util[_0xb77a('0x3e')](_0x2cf8d5,{'showHidden':![],'depth':null}));}})[_0xb77a('0x18')](function(_0x2bfd18){logger['error'](_0xb77a('0x27'),_0xb77a('0x28'),_0xb77a('0x4c'),util[_0xb77a('0x3e')](_0x2bfd18,{'showHidden':![],'depth':null}));});}else{logger[_0xb77a('0x26')](_0xb77a('0x27'),_0xb77a('0x28'),_0xb77a('0x4c'),_0xb77a('0x4d'));}break;case _0xb77a('0x4e'):if(_0x5a4a03[_0xb77a('0x4f')]&&_0x5a4a03[_0xb77a('0x1d')]){var _0x259cfb={'dst':_0x5b1e79[_0xb77a('0x1e')],'text':_0x5b1e79[_0xb77a('0xc')],'src':_0x5a4a03[_0xb77a('0x3c')]||_0x5a4a03[_0xb77a('0x1e')],'url':_0x5a4a03[_0xb77a('0x21')]+_0xb77a('0x22')+_0x5b1e79['id']+_0xb77a('0x23')+_0x5a4a03[_0xb77a('0x24')]};var _0x37e5ab=util[_0xb77a('0x43')](_0xb77a('0x44'),_0x5a4a03[_0xb77a('0x4f')],_0x5a4a03['authToken']);var _0x154c2d={'method':'POST','uri':util[_0xb77a('0x43')](_0xb77a('0x50'),_0x5a4a03[_0xb77a('0x4f')]),'body':_0x259cfb,'headers':{'Authorization':util[_0xb77a('0x43')](_0xb77a('0x46'),new Buffer(_0x37e5ab)['toString'](_0xb77a('0x47')))},'json':!![]};rp(_0x154c2d)[_0xb77a('0x16')](function(_0x5bdc21){var _0x28d8e6={'messageId':_0x5bdc21[_0xb77a('0x51')][0x0]};return _0x411372[_0xb77a('0x17')](_0x28d8e6);})['catch'](function(_0x204667){logger[_0xb77a('0x26')](_0xb77a('0x27'),_0xb77a('0x28'),'plivo',util[_0xb77a('0x3e')](_0x204667,{'showHidden':![],'depth':null}));});}else{logger[_0xb77a('0x26')](_0xb77a('0x27'),_0xb77a('0x28'),_0xb77a('0x4e'),_0xb77a('0x52'));}break;case _0xb77a('0x53'):if(_0x5a4a03['username']&&_0x5a4a03[_0xb77a('0x2d')]){if(_0x5a4a03['baseUrl']){var _0xbf538c={'method':_0xb77a('0x35'),'uri':_0x5a4a03[_0xb77a('0x54')]+_0xb77a('0x55'),'body':{'username':_0x5a4a03[_0xb77a('0x41')],'password':_0x5a4a03[_0xb77a('0x2d')]},'json':!![]};return rp(_0xbf538c)[_0xb77a('0x16')](function(_0x43a2ad){var _0x2809b1={'method':_0xb77a('0x35'),'uri':_0x5a4a03[_0xb77a('0x54')]+_0xb77a('0x56'),'body':{'messages':[{'from':_0x5a4a03['phone'],'destinations':[{'to':_0x5b1e79['phone']}],'text':_0x5b1e79[_0xb77a('0xc')],'notifyUrl':_0x5a4a03[_0xb77a('0x21')]+_0xb77a('0x22')+_0x5b1e79['id']+_0xb77a('0x23')+_0x5a4a03['token'],'notifyContentType':'application/json','callbackData':_0x5a4a03[_0xb77a('0x1e')]+';'+_0x5b1e79[_0xb77a('0xc')]}]},'headers':{'Authorization':_0xb77a('0x57')+_0x43a2ad['token']},'json':!![]};return rp(_0x2809b1)['then'](function(_0x13ab54){if(_0x13ab54[_0xb77a('0x1f')]){var _0x45c250={'messageId':_0x13ab54[_0xb77a('0x1f')][0x0]['messageId']};if(!_0x5a4a03[_0xb77a('0x3a')]){_0x45c250[_0xb77a('0x58')]=!![];}return _0x411372[_0xb77a('0x17')](_0x45c250);}else{return logger[_0xb77a('0x26')](_0xb77a('0x27'),_0xb77a('0x28'),_0xb77a('0x53'),util[_0xb77a('0x3e')](_0x13ab54,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x1229b1){return logger[_0xb77a('0x26')](_0xb77a('0x27'),_0xb77a('0x28'),_0xb77a('0x53'),util[_0xb77a('0x3e')](_0x1229b1,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xb77a('0x27'),_0xb77a('0x28'),_0xb77a('0x53'),'Missing\x20parameters:\x20base_url');}}else{logger[_0xb77a('0x26')](_0xb77a('0x27'),'afterCreate',_0xb77a('0x53'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xb77a('0x59'):var _0x4a2544=require(_0xb77a('0x5a'));if(_0x5a4a03[_0xb77a('0x5b')]){var _0x1233f3={};_0x1233f3[_0xb77a('0x5c')]=_0x5a4a03[_0xb77a('0x41')];_0x1233f3[_0xb77a('0x1e')]=_0x5b1e79[_0xb77a('0x1e')];_0x1233f3[_0xb77a('0x2f')]=_0x5a4a03[_0xb77a('0x1e')];_0x1233f3[_0xb77a('0x5d')]=_0x5b1e79['body'];_0x1233f3[_0xb77a('0x5e')]=+new Date();var _0x2f1cb5='';var _0x3177c0='';var _0x4a6ecb=Object[_0xb77a('0x5f')](_0x1233f3);_0x4a6ecb[_0xb77a('0x60')]();for(var _0x4f1128=0x0;_0x4f1128<_0x4a6ecb[_0xb77a('0x61')];_0x4f1128++){if(_0x2f1cb5!=''){_0x2f1cb5+='&';}_0x2f1cb5+=_0x4a6ecb[_0x4f1128]+'='+encodeURIComponent(_0x1233f3[_0x4a6ecb[_0x4f1128]]);_0x3177c0+=_0x1233f3[_0x4a6ecb[_0x4f1128]];}_0x3177c0+=_0x5a4a03[_0xb77a('0x5b')];_0x3177c0=_0x4a2544[_0xb77a('0x62')](_0xb77a('0x63'))[_0xb77a('0x17')](_0x3177c0)[_0xb77a('0x64')](_0xb77a('0x65'));if(_0x2f1cb5!==''){_0x2f1cb5+='&';}_0x2f1cb5+=_0xb77a('0x66')+_0x3177c0;var _0x472c59={'method':_0xb77a('0x32'),'uri':_0x5a4a03[_0xb77a('0x54')]+'/external/get/send.php?'+_0x2f1cb5,'json':!![]};return rp(_0x472c59)[_0xb77a('0x16')](function(_0x4dd45f){var _0xe6d5dd=Object[_0xb77a('0x5f')](_0x4dd45f);if(_0x4dd45f[_0xe6d5dd[0x0]]['error']&&parseInt(_0x4dd45f[_0xe6d5dd[0x0]][_0xb77a('0x26')])===0x0){var _0x137636={'messageId':_0x4dd45f[_0xe6d5dd[0x0]]['id_sms']};if(!_0x5a4a03['deliveryReport']){_0x137636[_0xb77a('0x58')]=!![];}return _0x411372['update'](_0x137636);}else{return logger[_0xb77a('0x26')](_0xb77a('0x27'),'afterCreate',_0xb77a('0x59'),util[_0xb77a('0x3e')](_0x4dd45f[_0xb77a('0x26')],{'showHidden':![],'depth':null}));}})[_0xb77a('0x18')](function(_0x491df4){return logger[_0xb77a('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xb77a('0x59'),util['inspect'](_0x491df4,{'showHidden':![],'depth':null}));});}else{logger[_0xb77a('0x26')](_0xb77a('0x27'),_0xb77a('0x28'),_0xb77a('0x59'),_0xb77a('0x67'));}break;case'clickatell':if(_0x5a4a03['apiKey']){var _0x4f9ab1={'method':_0xb77a('0x35'),'uri':_0xb77a('0x68'),'headers':{'Authorization':_0x5a4a03[_0xb77a('0x5b')]},'body':{'content':_0x5b1e79[_0xb77a('0xc')],'to':[_0x5b1e79[_0xb77a('0x1e')]],'from':_0x5a4a03[_0xb77a('0x1e')],'binary':![],'clientMessageId':_0xb77a('0x69'),'charset':_0xb77a('0x6a')},'json':!![]};rp(_0x4f9ab1)[_0xb77a('0x16')](function(_0x450470){if(!_0x450470[_0xb77a('0x26')]){var _0x5a7788={'messageId':_0x450470[_0xb77a('0x1f')][0x0][_0xb77a('0x6b')]};if(!_0x5a4a03[_0xb77a('0x3a')]){_0x5a7788[_0xb77a('0x58')]=!![];}return _0x411372['update'](_0x5a7788);}else{return logger[_0xb77a('0x26')](_0xb77a('0x27'),_0xb77a('0x28'),_0xb77a('0x6c'),util['inspect'](_0x450470['error'],{'showHidden':![],'depth':null}));}})[_0xb77a('0x18')](function(_0x258e47){return logger[_0xb77a('0x26')](_0xb77a('0x27'),_0xb77a('0x28'),'clickatell',util[_0xb77a('0x3e')](_0x258e47,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb77a('0x28'),_0xb77a('0x6c'),_0xb77a('0x67'));}break;case'bandwidth':if(_0x5a4a03[_0xb77a('0x41')]&&_0x5a4a03[_0xb77a('0x2d')]){var _0x37e5ab=util['format']('%s:%s',_0x5a4a03[_0xb77a('0x41')],_0x5a4a03['password']);var _0x154c2d={'method':'POST','uri':_0xb77a('0x6d')+_0x5a4a03[_0xb77a('0x6e')]+_0xb77a('0x6f'),'body':{'to':[_0x5b1e79['phone']],'text':_0x5b1e79[_0xb77a('0xc')],'from':_0x5a4a03['phone'],'applicationId':_0x5a4a03[_0xb77a('0x70')]},'headers':{'Authorization':util[_0xb77a('0x43')](_0xb77a('0x46'),new Buffer(_0x37e5ab)[_0xb77a('0x71')](_0xb77a('0x47')))},'json':!![]};rp(_0x154c2d)[_0xb77a('0x16')](function(_0x5d93f2){if(_0x5d93f2['id']){var _0x11d8ce={'messageId':_0x5d93f2['id']};return _0x411372['update'](_0x11d8ce);}else{logger[_0xb77a('0x26')](_0xb77a('0x27'),_0xb77a('0x28'),_0xb77a('0x72'),util[_0xb77a('0x3e')](_0x5d93f2,{'showHidden':![],'depth':null}));}})[_0xb77a('0x18')](function(_0x29ac47){logger[_0xb77a('0x26')](_0xb77a('0x27'),_0xb77a('0x28'),_0xb77a('0x72'),util[_0xb77a('0x3e')](_0x29ac47,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xb77a('0x72'),_0xb77a('0x4d'));}break;case _0xb77a('0x73'):if(_0x5a4a03[_0xb77a('0x5b')]){var _0x1e0867={};var _0x472c59={'method':_0xb77a('0x35'),'uri':_0xb77a('0x74'),'headers':{'Authorization':_0xb77a('0x75')+_0x5a4a03[_0xb77a('0x5b')],'Content-Type':_0xb77a('0x76')},'body':{'from':_0x5a4a03['phone'],'to':_0x5b1e79[_0xb77a('0x1e')],'text':_0x5b1e79[_0xb77a('0xc')]},'json':!![]};return rp(_0x472c59)[_0xb77a('0x16')](function(_0x4ade9f){if(_0x4ade9f[_0xb77a('0x77')]==0xca){_0x1e0867[_0xb77a('0x78')]=_0x4ade9f;var _0x3ee773={'method':'POST','uri':_0xb77a('0x79'),'headers':{'Authorization':_0xb77a('0x75')+_0x5a4a03[_0xb77a('0x5b')],'Content-Type':_0xb77a('0x76')},'body':{'refid':_0x1e0867['message'][_0xb77a('0x7a')]},'json':!![]};return rp(_0x3ee773)[_0xb77a('0x16')](function(_0x1e950b){_0x1e0867[_0xb77a('0x7b')]=_0x1e950b;var _0x37fde8={'messageId':_0x1e0867['message'][_0xb77a('0x7a')],'read':!![]};return _0x411372[_0xb77a('0x17')](_0x37fde8);});}else{return logger['error'](_0xb77a('0x27'),_0xb77a('0x28'),'intelepeer',util[_0xb77a('0x3e')](_0x4ade9f,{'showHidden':![],'depth':null}));}})[_0xb77a('0x18')](function(_0x259289){return logger[_0xb77a('0x26')](_0xb77a('0x27'),_0xb77a('0x28'),_0xb77a('0x73'),util[_0xb77a('0x3e')](_0x259289,{'showHidden':![],'depth':null}));});}else{return logger[_0xb77a('0x26')](_0xb77a('0x27'),_0xb77a('0x28'),'intelepeer',_0xb77a('0x7c'));}break;}}})[_0xb77a('0x7d')](function(){_0xc847b1();});}else{_0xc847b1();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x92a1=['sms','total_sent','deliveryReport','Missing\x20parameters:\x20username,\x20password','connectel','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','senderString','format','%s:%s','POST','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','data','queued_count','head','message_id','read','clickSend','plivo','authId','/api/sms/messages/','toString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','apiKey','login','text','timestamp','keys','createHash','md5','digest','hex','/external/get/send.php?','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','clickatell','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','rimraf','exports','SmsMessage','sms_messages','messageId','fti_sms_messages','FULLTEXT','models','direction','toLowerCase','out','isNil','UserId','SmsInteractionId','SmsInteraction','findOne','then','update','catch','error','secret','SmsAccount','find','SmsAccountId','type','twilio','authToken','phone','accountSid','messages','create','body','remote','/status?token=','token','sid','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username','password','smsMethod','sender','login?username=','&password=','GET','split'];(function(_0x540d9d,_0x320cbb){var _0x161921=function(_0x4b1730){while(--_0x4b1730){_0x540d9d['push'](_0x540d9d['shift']());}};_0x161921(++_0x320cbb);}(_0x92a1,0xbd));var _0x192a=function(_0x3a47aa,_0x19d90e){_0x3a47aa=_0x3a47aa-0x0;var _0x146448=_0x92a1[_0x3a47aa];return _0x146448;};'use strict';var _=require(_0x192a('0x0'));var util=require(_0x192a('0x1'));var logger=require(_0x192a('0x2'))('api');var moment=require(_0x192a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x192a('0x4'));var config=require('../../config/environment');var attributes=require('./smsMessage.attributes');module[_0x192a('0x5')]=function(_0x20fe89,_0x3412ef){return _0x20fe89['define'](_0x192a('0x6'),attributes,{'tableName':_0x192a('0x7'),'paranoid':![],'indexes':[{'name':_0x192a('0x8'),'fields':[_0x192a('0x8')]},{'name':_0x192a('0x9'),'fields':['body'],'type':_0x192a('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x159621,_0x246ada,_0x8c5968){var _0x2688d9=_0x20fe89[_0x192a('0xb')];var _0xf152d=_0x159621['get']({'plain':!![]});if(_0xf152d[_0x192a('0xc')][_0x192a('0xd')]()==='in'||_0xf152d[_0x192a('0xc')][_0x192a('0xd')]()===_0x192a('0xe')&&!_0xf152d['secret']&&!_[_0x192a('0xf')](_0xf152d[_0x192a('0x10')])&&!_[_0x192a('0xf')](_0xf152d[_0x192a('0x11')])){_0x2688d9[_0x192a('0x12')][_0x192a('0x13')]({'where':{'id':_0xf152d['SmsInteractionId']}})[_0x192a('0x14')](function(_0x1ffa91){if(_0x1ffa91){_0x1ffa91[_0x192a('0x15')]({'lastMsgAt':_0xf152d['createdAt'],'lastMsgDirection':_0xf152d[_0x192a('0xc')][_0x192a('0xd')]()});}})[_0x192a('0x16')](function(_0x3929df){console[_0x192a('0x17')](_0x3929df);});}if(_0xf152d['direction']===_0x192a('0xe')&&!_0xf152d[_0x192a('0x18')]){var _0x4078bb;_0x2688d9[_0x192a('0x19')][_0x192a('0x1a')]({'where':{'id':_0xf152d[_0x192a('0x1b')]},'raw':!![]})[_0x192a('0x14')](function(_0x534ef6){_0x4078bb=_0x534ef6;if(_0x4078bb&&_0x4078bb[_0x192a('0x1c')]){switch(_0x4078bb[_0x192a('0x1c')]){case _0x192a('0x1d'):var _0x416123=require(_0x192a('0x1d'));if(_0x4078bb['accountSid']&&_0x4078bb[_0x192a('0x1e')]&&_0x4078bb[_0x192a('0x1f')]){var _0x5b7e59=new _0x416123(_0x4078bb[_0x192a('0x20')],_0x4078bb[_0x192a('0x1e')]);_0x5b7e59[_0x192a('0x21')][_0x192a('0x22')]({'body':_0xf152d[_0x192a('0x23')],'to':_0xf152d[_0x192a('0x1f')],'from':_0x4078bb[_0x192a('0x1f')],'statusCallback':_0x4078bb[_0x192a('0x24')]+'/api/sms/messages/'+_0xf152d['id']+_0x192a('0x25')+_0x4078bb[_0x192a('0x26')]})[_0x192a('0x14')](function(_0x526f00){if(_0x526f00[_0x192a('0x27')]){return _0x159621[_0x192a('0x15')]({'messageId':_0x526f00[_0x192a('0x27')]});}})['catch'](function(_0xc33311){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x192a('0x28'),'twilio',util[_0x192a('0x29')](_0xc33311,{'showHidden':![],'depth':null}));});}else{logger[_0x192a('0x17')](_0x192a('0x2a'),_0x192a('0x28'),_0x192a('0x1d'),_0x192a('0x2b'));}break;case _0x192a('0x2c'):var _0xb26505='https://api.skebby.it/API/v1.0/REST/';if(_0x4078bb[_0x192a('0x2d')]&&_0x4078bb[_0x192a('0x2e')]){var _0x34782d={'recipient':[_0xf152d[_0x192a('0x1f')]],'message':_0xf152d[_0x192a('0x23')],'message_type':_0x4078bb['smsMethod']};if(_0x4078bb[_0x192a('0x2f')]&&_0x4078bb[_0x192a('0x2f')]!=='SI'){_0x34782d[_0x192a('0x30')]=_0x4078bb[_0x192a('0x1f')];}var _0x4e6389={'url':_0xb26505+_0x192a('0x31')+_0x4078bb[_0x192a('0x2d')]+_0x192a('0x32')+_0x4078bb[_0x192a('0x2e')],'method':_0x192a('0x33')};rp(_0x4e6389)[_0x192a('0x14')](function(_0x3d6b74){var _0x8f099e=_0x3d6b74[_0x192a('0x34')](';');var _0x106db6={'user_key':_0x8f099e[0x0],'session_key':_0x8f099e[0x1]};_0x4e6389={'url':_0xb26505+_0x192a('0x35'),'method':'POST','headers':{'user_key':_0x106db6['user_key'],'Session_key':_0x106db6['session_key']},'json':!![],'body':_0x34782d};return rp(_0x4e6389);})[_0x192a('0x14')](function(_0x1fe4a2){if(_0x1fe4a2[_0x192a('0x36')]>=0x1){var _0x4bc394={'messageId':_0x1fe4a2['internal_order_id']};if(_0x4078bb[_0x192a('0x2f')]!=='GP'||!_0x4078bb[_0x192a('0x37')]){_0x4bc394['read']=!![];}return _0x159621[_0x192a('0x15')](_0x4bc394);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x192a('0x28'),_0x192a('0x2c'),util[_0x192a('0x29')](_0x1fe4a2,{'showHidden':![],'depth':null}));}})[_0x192a('0x16')](function(_0x561c0c){return logger[_0x192a('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x192a('0x28'),_0x192a('0x2c'),util['inspect'](_0x561c0c,{'showHidden':![],'depth':null}));});}else{logger[_0x192a('0x17')](_0x192a('0x2a'),_0x192a('0x28'),_0x192a('0x2c'),_0x192a('0x38'));}break;case _0x192a('0x39'):if(_0x4078bb[_0x192a('0x1e')]){var _0x3e6781={'recipient':_0xf152d[_0x192a('0x1f')],'message':_0xf152d['body'],'sender':_0x4078bb['senderString']||_0x4078bb[_0x192a('0x1f')],'authorization':_0x4078bb[_0x192a('0x1e')]};var _0x246ada={'method':'POST','uri':_0x192a('0x3a'),'body':_0x3e6781,'json':!![]};rp(_0x246ada)[_0x192a('0x14')](function(_0x501c3c){var _0x21b76d={'messageId':_0x501c3c[_0x192a('0x3b')]};if(!_0x4078bb[_0x192a('0x37')]){_0x21b76d['read']=!![];}return _0x159621[_0x192a('0x15')](_0x21b76d);})[_0x192a('0x16')](function(_0x481801){logger[_0x192a('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','connectel',util[_0x192a('0x29')](_0x481801,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x192a('0x2a'),_0x192a('0x28'),_0x192a('0x39'),_0x192a('0x3c'));}break;case'clicksend':if(_0x4078bb[_0x192a('0x2d')]&&_0x4078bb[_0x192a('0x2e')]){var _0x3e6781={'messages':[{'source':_0x192a('0x3d'),'to':_0xf152d[_0x192a('0x1f')],'body':_0xf152d[_0x192a('0x23')],'from':_0x4078bb[_0x192a('0x3e')]||_0x4078bb[_0x192a('0x1f')]}]};var _0x2ab12f=util[_0x192a('0x3f')](_0x192a('0x40'),_0x4078bb[_0x192a('0x2d')],_0x4078bb[_0x192a('0x2e')]);var _0x246ada={'method':_0x192a('0x41'),'uri':_0x192a('0x42'),'body':_0x3e6781,'headers':{'Authorization':util[_0x192a('0x3f')](_0x192a('0x43'),new Buffer(_0x2ab12f)['toString'](_0x192a('0x44')))},'json':!![]};rp(_0x246ada)[_0x192a('0x14')](function(_0x4d96e5){if(_0x4d96e5[_0x192a('0x45')]>=0xc8&&_0x4d96e5['http_code']<=0xce){if(_0x4d96e5[_0x192a('0x46')]&&_0x4d96e5[_0x192a('0x46')][_0x192a('0x47')]>0x0){var _0x5c8d5f=_[_0x192a('0x48')](_0x4d96e5['data']['messages']);var _0x3a7cba={'messageId':_0x5c8d5f[_0x192a('0x49')]};if(!_0x4078bb[_0x192a('0x37')]){_0x3a7cba[_0x192a('0x4a')]=!![];}return _0x159621['update'](_0x3a7cba);}else{logger[_0x192a('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x192a('0x28'),_0x192a('0x4b'),util['inspect'](_0x4d96e5,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x192a('0x2a'),_0x192a('0x28'),_0x192a('0x4b'),util[_0x192a('0x29')](_0x4d96e5,{'showHidden':![],'depth':null}));}})[_0x192a('0x16')](function(_0x5e7d41){logger['error'](_0x192a('0x2a'),'afterCreate',_0x192a('0x4b'),util[_0x192a('0x29')](_0x5e7d41,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x192a('0x2a'),_0x192a('0x28'),_0x192a('0x4b'),_0x192a('0x38'));}break;case _0x192a('0x4c'):if(_0x4078bb[_0x192a('0x4d')]&&_0x4078bb[_0x192a('0x1e')]){var _0x3e6781={'dst':_0xf152d[_0x192a('0x1f')],'text':_0xf152d[_0x192a('0x23')],'src':_0x4078bb[_0x192a('0x3e')]||_0x4078bb['phone'],'url':_0x4078bb[_0x192a('0x24')]+_0x192a('0x4e')+_0xf152d['id']+_0x192a('0x25')+_0x4078bb['token']};var _0x2ab12f=util[_0x192a('0x3f')](_0x192a('0x40'),_0x4078bb[_0x192a('0x4d')],_0x4078bb[_0x192a('0x1e')]);var _0x246ada={'method':_0x192a('0x41'),'uri':util['format']('https://api.plivo.com/v1/Account/%s/Message/',_0x4078bb[_0x192a('0x4d')]),'body':_0x3e6781,'headers':{'Authorization':util[_0x192a('0x3f')]('Basic\x20%s',new Buffer(_0x2ab12f)[_0x192a('0x4f')](_0x192a('0x44')))},'json':!![]};rp(_0x246ada)['then'](function(_0x3b3673){var _0x457b2f={'messageId':_0x3b3673[_0x192a('0x50')][0x0]};return _0x159621[_0x192a('0x15')](_0x457b2f);})[_0x192a('0x16')](function(_0x5e0dc9){logger[_0x192a('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x192a('0x28'),_0x192a('0x4c'),util['inspect'](_0x5e0dc9,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x192a('0x2a'),'afterCreate',_0x192a('0x4c'),_0x192a('0x51'));}break;case _0x192a('0x52'):if(_0x4078bb[_0x192a('0x2d')]&&_0x4078bb[_0x192a('0x2e')]){if(_0x4078bb[_0x192a('0x53')]){var _0x42d909={'method':'POST','uri':_0x4078bb[_0x192a('0x53')]+_0x192a('0x54'),'body':{'username':_0x4078bb['username'],'password':_0x4078bb[_0x192a('0x2e')]},'json':!![]};return rp(_0x42d909)[_0x192a('0x14')](function(_0x228a95){var _0x92470f={'method':_0x192a('0x41'),'uri':_0x4078bb['baseUrl']+_0x192a('0x55'),'body':{'messages':[{'from':_0x4078bb[_0x192a('0x1f')],'destinations':[{'to':_0xf152d['phone']}],'text':_0xf152d['body'],'notifyUrl':_0x4078bb[_0x192a('0x24')]+_0x192a('0x4e')+_0xf152d['id']+'/status?token='+_0x4078bb[_0x192a('0x26')],'notifyContentType':_0x192a('0x56'),'callbackData':_0x4078bb[_0x192a('0x1f')]+';'+_0xf152d['body']}]},'headers':{'Authorization':_0x192a('0x57')+_0x228a95[_0x192a('0x26')]},'json':!![]};return rp(_0x92470f)[_0x192a('0x14')](function(_0x22f0be){if(_0x22f0be[_0x192a('0x21')]){var _0x380cfa={'messageId':_0x22f0be['messages'][0x0][_0x192a('0x8')]};if(!_0x4078bb[_0x192a('0x37')]){_0x380cfa[_0x192a('0x4a')]=!![];}return _0x159621['update'](_0x380cfa);}else{return logger[_0x192a('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x192a('0x28'),_0x192a('0x52'),util['inspect'](_0x22f0be,{'showHidden':![],'depth':null}));}});})[_0x192a('0x16')](function(_0x2651ff){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x192a('0x28'),_0x192a('0x52'),util[_0x192a('0x29')](_0x2651ff,{'showHidden':![],'depth':null}));});}else{logger[_0x192a('0x17')](_0x192a('0x2a'),'afterCreate',_0x192a('0x52'),_0x192a('0x58'));}}else{logger[_0x192a('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','infobip',_0x192a('0x38'));}break;case _0x192a('0x59'):var _0x5ece2c=require('crypto');if(_0x4078bb[_0x192a('0x5a')]){var _0x166449={};_0x166449[_0x192a('0x5b')]=_0x4078bb[_0x192a('0x2d')];_0x166449[_0x192a('0x1f')]=_0xf152d[_0x192a('0x1f')];_0x166449[_0x192a('0x30')]=_0x4078bb['phone'];_0x166449[_0x192a('0x5c')]=_0xf152d[_0x192a('0x23')];_0x166449[_0x192a('0x5d')]=+new Date();var _0x56ca4d='';var _0x5d8adf='';var _0x1b0d70=Object[_0x192a('0x5e')](_0x166449);_0x1b0d70['sort']();for(var _0x433b07=0x0;_0x433b07<_0x1b0d70['length'];_0x433b07++){if(_0x56ca4d!=''){_0x56ca4d+='&';}_0x56ca4d+=_0x1b0d70[_0x433b07]+'='+encodeURIComponent(_0x166449[_0x1b0d70[_0x433b07]]);_0x5d8adf+=_0x166449[_0x1b0d70[_0x433b07]];}_0x5d8adf+=_0x4078bb[_0x192a('0x5a')];_0x5d8adf=_0x5ece2c[_0x192a('0x5f')](_0x192a('0x60'))['update'](_0x5d8adf)[_0x192a('0x61')](_0x192a('0x62'));if(_0x56ca4d!==''){_0x56ca4d+='&';}_0x56ca4d+='signature='+_0x5d8adf;var _0x4e6389={'method':_0x192a('0x33'),'uri':_0x4078bb[_0x192a('0x53')]+_0x192a('0x63')+_0x56ca4d,'json':!![]};return rp(_0x4e6389)[_0x192a('0x14')](function(_0x55591a){var _0x35f03b=Object['keys'](_0x55591a);if(_0x55591a[_0x35f03b[0x0]][_0x192a('0x17')]&&parseInt(_0x55591a[_0x35f03b[0x0]]['error'])===0x0){var _0x4a9c59={'messageId':_0x55591a[_0x35f03b[0x0]]['id_sms']};if(!_0x4078bb[_0x192a('0x37')]){_0x4a9c59['read']=!![];}return _0x159621[_0x192a('0x15')](_0x4a9c59);}else{return logger[_0x192a('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x192a('0x28'),_0x192a('0x59'),util[_0x192a('0x29')](_0x55591a[_0x192a('0x17')],{'showHidden':![],'depth':null}));}})[_0x192a('0x16')](function(_0x11377b){return logger[_0x192a('0x17')](_0x192a('0x2a'),_0x192a('0x28'),'csc',util[_0x192a('0x29')](_0x11377b,{'showHidden':![],'depth':null}));});}else{logger[_0x192a('0x17')](_0x192a('0x2a'),_0x192a('0x28'),_0x192a('0x59'),_0x192a('0x64'));}break;case'clickatell':if(_0x4078bb[_0x192a('0x5a')]){var _0x434d51={'method':_0x192a('0x41'),'uri':_0x192a('0x65'),'headers':{'Authorization':_0x4078bb['apiKey']},'body':{'content':_0xf152d[_0x192a('0x23')],'to':[_0xf152d['phone']],'from':_0x4078bb['phone'],'binary':![],'clientMessageId':_0x192a('0x66'),'charset':_0x192a('0x67')},'json':!![]};rp(_0x434d51)[_0x192a('0x14')](function(_0x41502b){if(!_0x41502b[_0x192a('0x17')]){var _0x258dbe={'messageId':_0x41502b[_0x192a('0x21')][0x0][_0x192a('0x68')]};if(!_0x4078bb['deliveryReport']){_0x258dbe[_0x192a('0x4a')]=!![];}return _0x159621[_0x192a('0x15')](_0x258dbe);}else{return logger[_0x192a('0x17')](_0x192a('0x2a'),_0x192a('0x28'),'clickatell',util[_0x192a('0x29')](_0x41502b[_0x192a('0x17')],{'showHidden':![],'depth':null}));}})[_0x192a('0x16')](function(_0x3c3a47){return logger['error'](_0x192a('0x2a'),_0x192a('0x28'),_0x192a('0x69'),util[_0x192a('0x29')](_0x3c3a47,{'showHidden':![],'depth':null}));});}else{logger[_0x192a('0x17')](_0x192a('0x2a'),_0x192a('0x28'),_0x192a('0x69'),'Missing\x20parameters:\x20apiKey');}break;case'bandwidth':if(_0x4078bb[_0x192a('0x2d')]&&_0x4078bb[_0x192a('0x2e')]){var _0x2ab12f=util[_0x192a('0x3f')](_0x192a('0x40'),_0x4078bb[_0x192a('0x2d')],_0x4078bb[_0x192a('0x2e')]);var _0x246ada={'method':_0x192a('0x41'),'uri':_0x192a('0x6a')+_0x4078bb[_0x192a('0x6b')]+_0x192a('0x6c'),'body':{'to':[_0xf152d['phone']],'text':_0xf152d[_0x192a('0x23')],'from':_0x4078bb[_0x192a('0x1f')],'applicationId':_0x4078bb[_0x192a('0x6d')]},'headers':{'Authorization':util[_0x192a('0x3f')](_0x192a('0x43'),new Buffer(_0x2ab12f)[_0x192a('0x4f')](_0x192a('0x44')))},'json':!![]};rp(_0x246ada)[_0x192a('0x14')](function(_0x3c75dd){if(_0x3c75dd['id']){var _0xc596b={'messageId':_0x3c75dd['id']};return _0x159621['update'](_0xc596b);}else{logger['error'](_0x192a('0x2a'),_0x192a('0x28'),'bandwidth',util[_0x192a('0x29')](_0x3c75dd,{'showHidden':![],'depth':null}));}})[_0x192a('0x16')](function(_0x352545){logger[_0x192a('0x17')](_0x192a('0x2a'),'afterCreate',_0x192a('0x6e'),util['inspect'](_0x352545,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x192a('0x2a'),'afterCreate',_0x192a('0x6e'),_0x192a('0x38'));}break;case _0x192a('0x6f'):if(_0x4078bb[_0x192a('0x5a')]){var _0x59fc9a={};var _0x4e6389={'method':_0x192a('0x41'),'uri':_0x192a('0x70'),'headers':{'Authorization':_0x192a('0x71')+_0x4078bb['apiKey'],'Content-Type':_0x192a('0x56')},'body':{'from':_0x4078bb['phone'],'to':_0xf152d['phone'],'text':_0xf152d[_0x192a('0x23')]},'json':!![]};return rp(_0x4e6389)[_0x192a('0x14')](function(_0x33dbde){if(_0x33dbde[_0x192a('0x72')]==0xca){_0x59fc9a[_0x192a('0x73')]=_0x33dbde;var _0x199374={'method':_0x192a('0x41'),'uri':_0x192a('0x74'),'headers':{'Authorization':'Bearer\x20'+_0x4078bb['apiKey'],'Content-Type':_0x192a('0x56')},'body':{'refid':_0x59fc9a[_0x192a('0x73')][_0x192a('0x75')]},'json':!![]};return rp(_0x199374)['then'](function(_0x15d0e6){_0x59fc9a['status']=_0x15d0e6;var _0xd145dd={'messageId':_0x59fc9a[_0x192a('0x73')][_0x192a('0x75')],'read':!![]};return _0x159621['update'](_0xd145dd);});}else{return logger[_0x192a('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x192a('0x28'),'intelepeer',util[_0x192a('0x29')](_0x33dbde,{'showHidden':![],'depth':null}));}})['catch'](function(_0x59040a){return logger[_0x192a('0x17')](_0x192a('0x2a'),_0x192a('0x28'),_0x192a('0x6f'),util[_0x192a('0x29')](_0x59040a,{'showHidden':![],'depth':null}));});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x192a('0x28'),'intelepeer','Token\x20not\x20received');}break;}}})[_0x192a('0x76')](function(){_0x8c5968();});}else{_0x8c5968();}}},'charset':_0x192a('0x77'),'collate':_0x192a('0x78')});};
\ No newline at end of file
index 0ab2328..c55a62d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe31c=['request\x20sent','debug','error','message','result','catch','CreateSmsMessage','create','options','raw','stringify','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','request','then','info','SmsMessage,\x20%s,\x20%s'];(function(_0x580d90,_0x2dbea3){var _0x29dfc0=function(_0x4523c8){while(--_0x4523c8){_0x580d90['push'](_0x580d90['shift']());}};_0x29dfc0(++_0x2dbea3);}(_0xe31c,0x9c));var _0xce31=function(_0x564924,_0x579f4c){_0x564924=_0x564924-0x0;var _0x39df37=_0xe31c[_0x564924];return _0x39df37;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xce31('0x0'));var BPromise=require(_0xce31('0x1'));var rs=require(_0xce31('0x2'));var fs=require('fs');var Redis=require(_0xce31('0x3'));var db=require(_0xce31('0x4'))['db'];var utils=require(_0xce31('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xce31('0x6'));var jayson=require(_0xce31('0x7'));var client=jayson['client'][_0xce31('0x8')]({'port':0x232a});config[_0xce31('0x9')]=_[_0xce31('0xa')](config[_0xce31('0x9')],{'host':_0xce31('0xb'),'port':0x18eb});var socket=require(_0xce31('0xc'))(new Redis(config[_0xce31('0x9')]));require(_0xce31('0xd'))['register'](socket);function respondWithRpcPromise(_0x502561,_0x4482b7,_0x5f35d2){return new BPromise(function(_0x312ae1,_0x412379){return client[_0xce31('0xe')](_0x502561,_0x5f35d2)[_0xce31('0xf')](function(_0x4d2da0){logger[_0xce31('0x10')](_0xce31('0x11'),_0x4482b7,_0xce31('0x12'));logger[_0xce31('0x13')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4482b7,_0xce31('0x12'),JSON['stringify'](_0x4d2da0));if(_0x4d2da0['error']){if(_0x4d2da0[_0xce31('0x14')]['code']===0x1f4){logger[_0xce31('0x14')]('SmsMessage,\x20%s,\x20%s',_0x4482b7,_0x4d2da0[_0xce31('0x14')][_0xce31('0x15')]);return _0x412379(_0x4d2da0[_0xce31('0x14')][_0xce31('0x15')]);}logger[_0xce31('0x14')](_0xce31('0x11'),_0x4482b7,_0x4d2da0[_0xce31('0x14')][_0xce31('0x15')]);return _0x312ae1(_0x4d2da0[_0xce31('0x14')]['message']);}else{logger[_0xce31('0x10')]('SmsMessage,\x20%s,\x20%s',_0x4482b7,'request\x20sent');_0x312ae1(_0x4d2da0[_0xce31('0x16')]['message']);}})[_0xce31('0x17')](function(_0x50e312){logger[_0xce31('0x14')](_0xce31('0x11'),_0x4482b7,_0x50e312);_0x412379(_0x50e312);});});}exports[_0xce31('0x18')]=function(_0x257357){var _0x11b228=this;return new Promise(function(_0x37f8f3,_0x4c9b02){return db['SmsMessage'][_0xce31('0x19')](_0x257357['body'],{'raw':_0x257357[_0xce31('0x1a')]?_0x257357[_0xce31('0x1a')][_0xce31('0x1b')]===undefined?!![]:![]:!![]})[_0xce31('0xf')](function(_0x9efd28){logger[_0xce31('0x10')](_0xce31('0x18'),_0x257357);logger[_0xce31('0x13')](_0xce31('0x18'),_0x257357,JSON[_0xce31('0x1c')](_0x9efd28));_0x37f8f3(_0x9efd28);})['catch'](function(_0x5da3b3){logger[_0xce31('0x14')](_0xce31('0x18'),_0x5da3b3['message'],_0x257357);_0x4c9b02(_0x11b228[_0xce31('0x14')](0x1f4,_0x5da3b3[_0xce31('0x15')]));});});};
\ No newline at end of file
+var _0xca62=['catch','CreateSmsMessage','SmsMessage','options','raw','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result'];(function(_0x151b2a,_0x2b88b8){var _0x5c2c04=function(_0x1786d0){while(--_0x1786d0){_0x151b2a['push'](_0x151b2a['shift']());}};_0x5c2c04(++_0x2b88b8);}(_0xca62,0x125));var _0x2ca6=function(_0x450498,_0x2d7103){_0x450498=_0x450498-0x0;var _0x2de81e=_0xca62[_0x450498];return _0x2de81e;};'use strict';var _=require(_0x2ca6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2ca6('0x1'));var rs=require(_0x2ca6('0x2'));var fs=require('fs');var Redis=require(_0x2ca6('0x3'));var db=require(_0x2ca6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2ca6('0x5'))(_0x2ca6('0x6'));var config=require(_0x2ca6('0x7'));var jayson=require(_0x2ca6('0x8'));var client=jayson[_0x2ca6('0x9')][_0x2ca6('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x2ca6('0xb')],{'host':_0x2ca6('0xc'),'port':0x18eb});var socket=require(_0x2ca6('0xd'))(new Redis(config[_0x2ca6('0xb')]));require(_0x2ca6('0xe'))[_0x2ca6('0xf')](socket);function respondWithRpcPromise(_0x10afd6,_0x45302c,_0x3205b7){return new BPromise(function(_0x5d2aea,_0x5c3e5d){return client[_0x2ca6('0x10')](_0x10afd6,_0x3205b7)[_0x2ca6('0x11')](function(_0x53983c){logger[_0x2ca6('0x12')](_0x2ca6('0x13'),_0x45302c,'request\x20sent');logger[_0x2ca6('0x14')](_0x2ca6('0x15'),_0x45302c,_0x2ca6('0x16'),JSON[_0x2ca6('0x17')](_0x53983c));if(_0x53983c[_0x2ca6('0x18')]){if(_0x53983c[_0x2ca6('0x18')]['code']===0x1f4){logger[_0x2ca6('0x18')](_0x2ca6('0x13'),_0x45302c,_0x53983c[_0x2ca6('0x18')][_0x2ca6('0x19')]);return _0x5c3e5d(_0x53983c[_0x2ca6('0x18')][_0x2ca6('0x19')]);}logger[_0x2ca6('0x18')](_0x2ca6('0x13'),_0x45302c,_0x53983c['error']['message']);return _0x5d2aea(_0x53983c[_0x2ca6('0x18')][_0x2ca6('0x19')]);}else{logger[_0x2ca6('0x12')](_0x2ca6('0x13'),_0x45302c,_0x2ca6('0x16'));_0x5d2aea(_0x53983c[_0x2ca6('0x1a')][_0x2ca6('0x19')]);}})[_0x2ca6('0x1b')](function(_0x4857cf){logger[_0x2ca6('0x18')]('SmsMessage,\x20%s,\x20%s',_0x45302c,_0x4857cf);_0x5c3e5d(_0x4857cf);});});}exports[_0x2ca6('0x1c')]=function(_0x1e7f67){var _0x5b0240=this;return new Promise(function(_0x30e064,_0x50e6de){return db[_0x2ca6('0x1d')]['create'](_0x1e7f67['body'],{'raw':_0x1e7f67[_0x2ca6('0x1e')]?_0x1e7f67['options'][_0x2ca6('0x1f')]===undefined?!![]:![]:!![]})[_0x2ca6('0x11')](function(_0x356783){logger[_0x2ca6('0x12')]('CreateSmsMessage',_0x1e7f67);logger[_0x2ca6('0x14')](_0x2ca6('0x1c'),_0x1e7f67,JSON[_0x2ca6('0x17')](_0x356783));_0x30e064(_0x356783);})[_0x2ca6('0x1b')](function(_0x14a549){logger['error'](_0x2ca6('0x1c'),_0x14a549['message'],_0x1e7f67);_0x50e6de(_0x5b0240['error'](0x1f4,_0x14a549[_0x2ca6('0x19')]));});});};
\ No newline at end of file
index d3c9ac9..419d51a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54fa=['remove','update','emit','removeListener','smsMessage:','save'];(function(_0x577f24,_0x415e8c){var _0x4b82f7=function(_0x5239f9){while(--_0x5239f9){_0x577f24['push'](_0x577f24['shift']());}};_0x4b82f7(++_0x415e8c);}(_0x54fa,0x101));var _0xa54f=function(_0x115d5b,_0x26aff2){_0x115d5b=_0x115d5b-0x0;var _0x6cfc50=_0x54fa[_0x115d5b];return _0x6cfc50;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0xa54f('0x0'),_0xa54f('0x1'),_0xa54f('0x2')];function createListener(_0x554408,_0x23f278){return function(_0x572efa){_0x23f278[_0xa54f('0x3')](_0x554408,_0x572efa);};}function removeListener(_0x2c517f,_0x2ba941){return function(){SmsMessageEvents[_0xa54f('0x4')](_0x2c517f,_0x2ba941);};}exports['register']=function(_0xf12a31){for(var _0x3e2aa3=0x0,_0x2d1a82=events['length'];_0x3e2aa3<_0x2d1a82;_0x3e2aa3++){var _0x55622e=events[_0x3e2aa3];var _0x45efde=createListener(_0xa54f('0x5')+_0x55622e,_0xf12a31);SmsMessageEvents['on'](_0x55622e,_0x45efde);}};
\ No newline at end of file
+var _0x6d55=['length','save','remove','removeListener','register'];(function(_0x2e07b,_0x4249df){var _0x448d91=function(_0x40002c){while(--_0x40002c){_0x2e07b['push'](_0x2e07b['shift']());}};_0x448d91(++_0x4249df);}(_0x6d55,0x17d));var _0x56d5=function(_0xe5366,_0x32ea05){_0xe5366=_0xe5366-0x0;var _0x3dfd7d=_0x6d55[_0xe5366];return _0x3dfd7d;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x56d5('0x0'),_0x56d5('0x1'),'update'];function createListener(_0x6068b7,_0x495061){return function(_0x5d7905){_0x495061['emit'](_0x6068b7,_0x5d7905);};}function removeListener(_0x2d8321,_0x565f3b){return function(){SmsMessageEvents[_0x56d5('0x2')](_0x2d8321,_0x565f3b);};}exports[_0x56d5('0x3')]=function(_0xa970ed){for(var _0xff73f9=0x0,_0xb41fb6=events[_0x56d5('0x4')];_0xff73f9<_0xb41fb6;_0xff73f9++){var _0x400ec6=events[_0xff73f9];var _0x5b99e1=createListener('smsMessage:'+_0x400ec6,_0xa970ed);SmsMessageEvents['on'](_0x400ec6,_0x5b99e1);}};
\ No newline at end of file
index d81bee5..0662905 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6105=['/:id/users','getAgents','post','create','put','update','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams'];(function(_0x32bf8b,_0x2ac32b){var _0x1e5ef5=function(_0x36acec){while(--_0x36acec){_0x32bf8b['push'](_0x32bf8b['shift']());}};_0x1e5ef5(++_0x2ac32b);}(_0x6105,0x18a));var _0x5610=function(_0x3f6408,_0x132511){_0x3f6408=_0x3f6408-0x0;var _0x37f707=_0x6105[_0x3f6408];return _0x37f707;};'use strict';var multer=require(_0x5610('0x0'));var util=require(_0x5610('0x1'));var path=require(_0x5610('0x2'));var timeout=require(_0x5610('0x3'));var express=require(_0x5610('0x4'));var router=express[_0x5610('0x5')]();var fs_extra=require(_0x5610('0x6'));var auth=require(_0x5610('0x7'));var interaction=require(_0x5610('0x8'));var config=require(_0x5610('0x9'));var controller=require(_0x5610('0xa'));router[_0x5610('0xb')]('/',auth[_0x5610('0xc')](),controller[_0x5610('0xd')]);router[_0x5610('0xb')](_0x5610('0xe'),auth['isAuthenticated'](),controller[_0x5610('0xf')]);router[_0x5610('0xb')](_0x5610('0x10'),auth['isAuthenticated'](),controller[_0x5610('0x11')]);router[_0x5610('0xb')](_0x5610('0x12'),auth[_0x5610('0xc')](),controller[_0x5610('0x13')]);router[_0x5610('0xb')](_0x5610('0x14'),auth[_0x5610('0xc')](),controller[_0x5610('0x15')]);router['get'](_0x5610('0x16'),auth['isAuthenticated'](),controller[_0x5610('0x17')]);router[_0x5610('0x18')]('/',auth['isAuthenticated'](),controller[_0x5610('0x19')]);router['post']('/:id/teams',auth[_0x5610('0xc')](),controller['addTeams']);router['post'](_0x5610('0x16'),auth['isAuthenticated'](),controller['addAgents']);router[_0x5610('0x1a')](_0x5610('0x10'),auth[_0x5610('0xc')](),controller[_0x5610('0x1b')]);router[_0x5610('0x1c')]('/:id',auth[_0x5610('0xc')](),controller['destroy']);router[_0x5610('0x1c')](_0x5610('0x14'),auth['isAuthenticated'](),controller[_0x5610('0x1d')]);router['delete'](_0x5610('0x16'),auth['isAuthenticated'](),controller[_0x5610('0x1e')]);module[_0x5610('0x1f')]=router;
\ No newline at end of file
+var _0x53a2=['addTeams','addAgents','update','delete','destroy','removeAgents','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','/describe','isAuthenticated','/:id','/:id/members','getTeams','/:id/users','post','create','/:id/teams'];(function(_0x842858,_0x3a3ca0){var _0x46c2a2=function(_0x47f795){while(--_0x47f795){_0x842858['push'](_0x842858['shift']());}};_0x46c2a2(++_0x3a3ca0);}(_0x53a2,0x1a7));var _0x253a=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x53a2[_0x55f8b4];return _0x2475f9;};'use strict';var multer=require('multer');var util=require(_0x253a('0x0'));var path=require(_0x253a('0x1'));var timeout=require('connect-timeout');var express=require(_0x253a('0x2'));var router=express[_0x253a('0x3')]();var fs_extra=require(_0x253a('0x4'));var auth=require(_0x253a('0x5'));var interaction=require(_0x253a('0x6'));var config=require(_0x253a('0x7'));var controller=require(_0x253a('0x8'));router[_0x253a('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x253a('0x9')](_0x253a('0xa'),auth[_0x253a('0xb')](),controller['describe']);router['get'](_0x253a('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x253a('0x9')](_0x253a('0xd'),auth[_0x253a('0xb')](),controller['getMembers']);router['get']('/:id/teams',auth[_0x253a('0xb')](),controller[_0x253a('0xe')]);router[_0x253a('0x9')](_0x253a('0xf'),auth[_0x253a('0xb')](),controller['getAgents']);router[_0x253a('0x10')]('/',auth[_0x253a('0xb')](),controller[_0x253a('0x11')]);router['post'](_0x253a('0x12'),auth[_0x253a('0xb')](),controller[_0x253a('0x13')]);router['post'](_0x253a('0xf'),auth[_0x253a('0xb')](),controller[_0x253a('0x14')]);router['put'](_0x253a('0xc'),auth[_0x253a('0xb')](),controller[_0x253a('0x15')]);router[_0x253a('0x16')](_0x253a('0xc'),auth[_0x253a('0xb')](),controller[_0x253a('0x17')]);router[_0x253a('0x16')](_0x253a('0x12'),auth[_0x253a('0xb')](),controller['removeTeams']);router[_0x253a('0x16')](_0x253a('0xf'),auth[_0x253a('0xb')](),controller[_0x253a('0x18')]);module[_0x253a('0x19')]=router;
\ No newline at end of file
index df7adf6..1ea6460 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x873d=['STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','exports','name'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x873d,0x1ce));var _0xd873=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x873d[_0x2be8c2];return _0x97f531;};'use strict';var Sequelize=require('sequelize');module[_0xd873('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xd873('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd873('0x2')]},'timeout':{'type':Sequelize[_0xd873('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd873('0x4')](_0xd873('0x5'),_0xd873('0x6'),_0xd873('0x7'))}};
\ No newline at end of file
+var _0x5526=['INTEGER','ENUM','rrmemory','beepall','roundrobin','exports','STRING','name'];(function(_0x49d6fe,_0x5e2bd5){var _0x234901=function(_0x84d0e6){while(--_0x84d0e6){_0x49d6fe['push'](_0x49d6fe['shift']());}};_0x234901(++_0x5e2bd5);}(_0x5526,0x14d));var _0x6552=function(_0x8ae98b,_0x155f88){_0x8ae98b=_0x8ae98b-0x0;var _0xc30bd4=_0x5526[_0x8ae98b];return _0xc30bd4;};'use strict';var Sequelize=require('sequelize');module[_0x6552('0x0')]={'name':{'type':Sequelize[_0x6552('0x1')],'unique':_0x6552('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6552('0x1')]},'timeout':{'type':Sequelize[_0x6552('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6552('0x4')](_0x6552('0x5'),_0x6552('0x6'),_0x6552('0x7'))}};
\ No newline at end of file
index 044dcc7..d08d901 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbddb=['getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','register','sendStatus','status','end','json','undefined','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','SmsQueues','UserProfileResource','error','stack','name','send','index','map','SmsQueue','rawAttributes','fieldName','type','query','keys','intersection','attributes','model','fields','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','count','include','rows','catch','show','params','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','order','pick','SmsQueueId','findAll','User','findAndCountAll','agent','smsPause','updatedAt','%s/%s','SIP','createdAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','each','forEach','emit','removeTeams','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','TeamId','includes','value','transaction','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','userSmsQueue:save','isArray'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0xbddb,0x11d));var _0xbbdd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbddb[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbbdd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbbdd('0x1'));var rp=require(_0xbbdd('0x2'));var moment=require(_0xbbdd('0x3'));var BPromise=require(_0xbbdd('0x4'));var Mustache=require(_0xbbdd('0x5'));var util=require('util');var path=require('path');var sox=require(_0xbbdd('0x6'));var csv=require(_0xbbdd('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbbdd('0x8'));var _=require(_0xbbdd('0x9'));var squel=require(_0xbbdd('0xa'));var crypto=require(_0xbbdd('0xb'));var jsforce=require(_0xbbdd('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xbbdd('0x7'));var querystring=require(_0xbbdd('0xd'));var Papa=require('papaparse');var Redis=require(_0xbbdd('0xe'));var authService=require(_0xbbdd('0xf'));var qs=require(_0xbbdd('0x10'));var as=require(_0xbbdd('0x11'));var hardwareService=require(_0xbbdd('0x12'));var logger=require(_0xbbdd('0x13'))(_0xbbdd('0x14'));var utils=require(_0xbbdd('0x15'));var config=require(_0xbbdd('0x16'));var licenseUtil=require(_0xbbdd('0x17'));var db=require('../../mysqldb')['db'];config[_0xbbdd('0x18')]=_[_0xbbdd('0x19')](config['redis'],{'host':_0xbbdd('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbbdd('0x18')]));require('./smsQueue.socket')[_0xbbdd('0x1b')](socket);function respondWithStatusCode(_0x16fa3e,_0x3f31e8){_0x3f31e8=_0x3f31e8||0xcc;return function(_0x2da83e){if(_0x2da83e){return _0x16fa3e[_0xbbdd('0x1c')](_0x3f31e8);}return _0x16fa3e[_0xbbdd('0x1d')](_0x3f31e8)[_0xbbdd('0x1e')]();};}function respondWithResult(_0x4332b9,_0x4de8c5){_0x4de8c5=_0x4de8c5||0xc8;return function(_0x315bf5){if(_0x315bf5){return _0x4332b9[_0xbbdd('0x1d')](_0x4de8c5)[_0xbbdd('0x1f')](_0x315bf5);}};}function respondWithFilteredResult(_0x249d96,_0x5be481){return function(_0x2150fa){if(_0x2150fa){var _0x4b6397=typeof _0x5be481['offset']===_0xbbdd('0x20')&&typeof _0x5be481['limit']===_0xbbdd('0x20');var _0x3bcdf1=_0x2150fa['count'];var _0x533800=_0x4b6397?0x0:_0x5be481[_0xbbdd('0x21')];var _0x577142=_0x4b6397?_0x2150fa['count']:_0x5be481[_0xbbdd('0x21')]+_0x5be481[_0xbbdd('0x22')];var _0x27c0e2;if(_0x577142>=_0x3bcdf1){_0x577142=_0x3bcdf1;_0x27c0e2=0xc8;}else{_0x27c0e2=0xce;}_0x249d96[_0xbbdd('0x1d')](_0x27c0e2);return _0x249d96[_0xbbdd('0x23')](_0xbbdd('0x24'),_0x533800+'-'+_0x577142+'/'+_0x3bcdf1)[_0xbbdd('0x1f')](_0x2150fa);}return null;};}function patchUpdates(_0x4619f9){return function(_0x4273b9){try{jsonpatch[_0xbbdd('0x25')](_0x4273b9,_0x4619f9,!![]);}catch(_0x2434ac){return BPromise[_0xbbdd('0x26')](_0x2434ac);}return _0x4273b9[_0xbbdd('0x27')]();};}function saveUpdates(_0x20a142,_0x523791){return function(_0x2bdf53){if(_0x2bdf53){return _0x2bdf53[_0xbbdd('0x28')](_0x20a142)['then'](function(_0x53fc7f){return _0x53fc7f;});}return null;};}function removeEntity(_0xba1e92,_0x36e50d){return function(_0x38ef65){if(_0x38ef65){return _0x38ef65[_0xbbdd('0x29')]()[_0xbbdd('0x2a')](function(){var _0x142938=_0x38ef65[_0xbbdd('0x2b')]({'plain':!![]});var _0x592b81=_0xbbdd('0x2c');return db[_0xbbdd('0x2d')]['destroy']({'where':{'type':_0x592b81,'resourceId':_0x142938['id']}})['then'](function(){return _0x38ef65;});})[_0xbbdd('0x2a')](function(){_0xba1e92['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3bb347,_0x638535){return function(_0x550985){if(!_0x550985){_0x3bb347[_0xbbdd('0x1c')](0x194);}return _0x550985;};}function handleError(_0x5b3ee4,_0x409edd){_0x409edd=_0x409edd||0x1f4;return function(_0x1291c0){logger[_0xbbdd('0x2e')](_0x1291c0[_0xbbdd('0x2f')]);if(_0x1291c0[_0xbbdd('0x30')]){delete _0x1291c0[_0xbbdd('0x30')];}_0x5b3ee4[_0xbbdd('0x1d')](_0x409edd)[_0xbbdd('0x31')](_0x1291c0);};}exports[_0xbbdd('0x32')]=function(_0x5570cc,_0x268649){var _0x42b561={},_0x39371e={},_0x2e0740={'count':0x0,'rows':[]};var _0x1c4ad8=_[_0xbbdd('0x33')](db[_0xbbdd('0x34')][_0xbbdd('0x35')],function(_0x4ffa47){return{'name':_0x4ffa47[_0xbbdd('0x36')],'type':_0x4ffa47[_0xbbdd('0x37')]['key']};});_0x39371e['model']=_['map'](_0x1c4ad8,'name');_0x39371e[_0xbbdd('0x38')]=_[_0xbbdd('0x39')](_0x5570cc[_0xbbdd('0x38')]);_0x39371e['filters']=_[_0xbbdd('0x3a')](_0x39371e['model'],_0x39371e[_0xbbdd('0x38')]);_0x42b561[_0xbbdd('0x3b')]=_[_0xbbdd('0x3a')](_0x39371e[_0xbbdd('0x3c')],qs[_0xbbdd('0x3d')](_0x5570cc[_0xbbdd('0x38')][_0xbbdd('0x3d')]));_0x42b561[_0xbbdd('0x3b')]=_0x42b561[_0xbbdd('0x3b')]['length']?_0x42b561['attributes']:_0x39371e['model'];if(!_0x5570cc[_0xbbdd('0x38')][_0xbbdd('0x3e')](_0xbbdd('0x3f'))){_0x42b561[_0xbbdd('0x22')]=qs[_0xbbdd('0x22')](_0x5570cc[_0xbbdd('0x38')][_0xbbdd('0x22')]);_0x42b561[_0xbbdd('0x21')]=qs[_0xbbdd('0x21')](_0x5570cc[_0xbbdd('0x38')][_0xbbdd('0x21')]);}_0x42b561['order']=qs['sort'](_0x5570cc['query'][_0xbbdd('0x40')]);_0x42b561[_0xbbdd('0x41')]=qs[_0xbbdd('0x42')](_['pick'](_0x5570cc[_0xbbdd('0x38')],_0x39371e[_0xbbdd('0x42')]),_0x1c4ad8);if(_0x5570cc[_0xbbdd('0x38')][_0xbbdd('0x43')]){_0x42b561[_0xbbdd('0x41')]=_[_0xbbdd('0x44')](_0x42b561[_0xbbdd('0x41')],{'$or':_[_0xbbdd('0x33')](_0x1c4ad8,function(_0x493615){if(_0x493615[_0xbbdd('0x37')]!==_0xbbdd('0x45')){var _0x29691d={};_0x29691d[_0x493615[_0xbbdd('0x30')]]={'$like':'%'+_0x5570cc['query'][_0xbbdd('0x43')]+'%'};return _0x29691d;}})});}_0x42b561=_['merge']({},_0x42b561,_0x5570cc[_0xbbdd('0x46')]);var _0x3d08bb={'where':_0x42b561[_0xbbdd('0x41')]};return db[_0xbbdd('0x34')][_0xbbdd('0x47')](_0x3d08bb)[_0xbbdd('0x2a')](function(_0x483f95){_0x2e0740['count']=_0x483f95;if(_0x5570cc[_0xbbdd('0x38')]['includeAll']){_0x42b561[_0xbbdd('0x48')]=[{'all':!![]}];}return db[_0xbbdd('0x34')]['findAll'](_0x42b561);})[_0xbbdd('0x2a')](function(_0x28e3d8){_0x2e0740[_0xbbdd('0x49')]=_0x28e3d8;return _0x2e0740;})[_0xbbdd('0x2a')](respondWithFilteredResult(_0x268649,_0x42b561))[_0xbbdd('0x4a')](handleError(_0x268649,null));};exports[_0xbbdd('0x4b')]=function(_0x442c7d,_0x4638fb){var _0x20d9b5={'raw':!![],'where':{'id':_0x442c7d[_0xbbdd('0x4c')]['id']}},_0x4b3f52={};_0x4b3f52[_0xbbdd('0x3c')]=_[_0xbbdd('0x39')](db[_0xbbdd('0x34')]['rawAttributes']);_0x4b3f52[_0xbbdd('0x38')]=_[_0xbbdd('0x39')](_0x442c7d[_0xbbdd('0x38')]);_0x4b3f52[_0xbbdd('0x42')]=_[_0xbbdd('0x3a')](_0x4b3f52[_0xbbdd('0x3c')],_0x4b3f52['query']);_0x20d9b5[_0xbbdd('0x3b')]=_[_0xbbdd('0x3a')](_0x4b3f52[_0xbbdd('0x3c')],qs[_0xbbdd('0x3d')](_0x442c7d[_0xbbdd('0x38')][_0xbbdd('0x3d')]));_0x20d9b5[_0xbbdd('0x3b')]=_0x20d9b5[_0xbbdd('0x3b')][_0xbbdd('0x4d')]?_0x20d9b5[_0xbbdd('0x3b')]:_0x4b3f52[_0xbbdd('0x3c')];if(_0x442c7d[_0xbbdd('0x38')]['includeAll']){_0x20d9b5[_0xbbdd('0x48')]=[{'all':!![]}];}_0x20d9b5=_['merge']({},_0x20d9b5,_0x442c7d[_0xbbdd('0x46')]);return db[_0xbbdd('0x34')]['find'](_0x20d9b5)[_0xbbdd('0x2a')](handleEntityNotFound(_0x4638fb,null))['then'](respondWithResult(_0x4638fb,null))['catch'](handleError(_0x4638fb,null));};exports[_0xbbdd('0x4e')]=function(_0x341599,_0x495393){return db['SmsQueue'][_0xbbdd('0x4e')](_0x341599[_0xbbdd('0x4f')],{})[_0xbbdd('0x2a')](function(_0x3bd1e2){var _0x50c58b=_0x341599[_0xbbdd('0x50')]['get']({'plain':!![]});if(!_0x50c58b)throw new Error(_0xbbdd('0x51'));if(_0x50c58b[_0xbbdd('0x52')]===_0xbbdd('0x50')){var _0x1c48ec=_0x3bd1e2[_0xbbdd('0x2b')]({'plain':!![]});var _0xce7086=_0xbbdd('0x2c');return db[_0xbbdd('0x53')][_0xbbdd('0x54')]({'where':{'name':_0xce7086,'userProfileId':_0x50c58b['userProfileId']},'raw':!![]})[_0xbbdd('0x2a')](function(_0x56f06c){if(_0x56f06c&&_0x56f06c[_0xbbdd('0x55')]===0x0){return db[_0xbbdd('0x2d')][_0xbbdd('0x4e')]({'name':_0x1c48ec['name'],'resourceId':_0x1c48ec['id'],'type':_0x56f06c[_0xbbdd('0x30')],'sectionId':_0x56f06c['id']},{})[_0xbbdd('0x2a')](function(){return _0x3bd1e2;});}else{return _0x3bd1e2;}})[_0xbbdd('0x4a')](function(_0x4ec136){logger[_0xbbdd('0x2e')](_0xbbdd('0x56'),_0x4ec136);throw _0x4ec136;});}return _0x3bd1e2;})[_0xbbdd('0x2a')](respondWithResult(_0x495393,0xc9))[_0xbbdd('0x4a')](handleError(_0x495393,null));};exports[_0xbbdd('0x28')]=function(_0x3025fe,_0x29aab3){if(_0x3025fe[_0xbbdd('0x4f')]['id']){delete _0x3025fe[_0xbbdd('0x4f')]['id'];}return db[_0xbbdd('0x34')][_0xbbdd('0x54')]({'where':{'id':_0x3025fe[_0xbbdd('0x4c')]['id']}})[_0xbbdd('0x2a')](handleEntityNotFound(_0x29aab3,null))[_0xbbdd('0x2a')](saveUpdates(_0x3025fe[_0xbbdd('0x4f')],null))['then'](respondWithResult(_0x29aab3,null))['catch'](handleError(_0x29aab3,null));};exports[_0xbbdd('0x29')]=function(_0x10c8d3,_0x2031c8){return db[_0xbbdd('0x34')][_0xbbdd('0x54')]({'where':{'id':_0x10c8d3[_0xbbdd('0x4c')]['id']}})[_0xbbdd('0x2a')](handleEntityNotFound(_0x2031c8,null))[_0xbbdd('0x2a')](removeEntity(_0x2031c8,null))[_0xbbdd('0x4a')](handleError(_0x2031c8,null));};exports['describe']=function(_0x2eb369,_0x3208fb){return db[_0xbbdd('0x34')][_0xbbdd('0x57')]()['then'](respondWithResult(_0x3208fb,null))['catch'](handleError(_0x3208fb,null));};exports[_0xbbdd('0x58')]=function(_0x33c26c,_0x294eab,_0x393797){var _0x2ac846={'raw':!![],'where':{}},_0x1a955c={},_0x54d528;return db[_0xbbdd('0x34')][_0xbbdd('0x59')]({'where':{'id':_0x33c26c[_0xbbdd('0x4c')]['id']}})['then'](handleEntityNotFound(_0x294eab,null))['then'](function(_0x34724a){if(_0x34724a){_0x54d528=_0x34724a[_0xbbdd('0x2b')]({'plain':!![]});_0x1a955c[_0xbbdd('0x3c')]=_[_0xbbdd('0x39')](db[_0xbbdd('0x5a')][_0xbbdd('0x35')]);_0x1a955c[_0xbbdd('0x38')]=_[_0xbbdd('0x39')](_0x33c26c[_0xbbdd('0x38')]);_0x1a955c[_0xbbdd('0x42')]=_['intersection'](_0x1a955c['model'],_0x1a955c[_0xbbdd('0x38')]);_0x2ac846[_0xbbdd('0x3b')]=_[_0xbbdd('0x3a')](_0x1a955c['model'],qs['fields'](_0x33c26c[_0xbbdd('0x38')]['fields']));_0x2ac846[_0xbbdd('0x3b')]=_0x2ac846[_0xbbdd('0x3b')][_0xbbdd('0x4d')]?_0x2ac846[_0xbbdd('0x3b')]:_0x1a955c[_0xbbdd('0x3c')];if(!_0x33c26c[_0xbbdd('0x38')][_0xbbdd('0x3e')](_0xbbdd('0x3f'))){_0x2ac846[_0xbbdd('0x22')]=qs[_0xbbdd('0x22')](_0x33c26c[_0xbbdd('0x38')]['limit']);_0x2ac846['offset']=qs['offset'](_0x33c26c['query'][_0xbbdd('0x21')]);}_0x2ac846[_0xbbdd('0x5b')]=qs[_0xbbdd('0x40')](_0x33c26c[_0xbbdd('0x38')][_0xbbdd('0x40')]);_0x2ac846[_0xbbdd('0x41')]=qs[_0xbbdd('0x42')](_[_0xbbdd('0x5c')](_0x33c26c[_0xbbdd('0x38')],_0x1a955c['filters']));_0x2ac846['where'][_0xbbdd('0x5d')]=_0x34724a['id'];if(_0x33c26c[_0xbbdd('0x38')][_0xbbdd('0x43')]){_0x2ac846[_0xbbdd('0x41')]=_['merge'](_0x2ac846[_0xbbdd('0x41')],{'$or':_['map'](_0x2ac846[_0xbbdd('0x3b')],function(_0x332d3){var _0x390b59={};_0x390b59[_0x332d3]={'$like':'%'+_0x33c26c[_0xbbdd('0x38')][_0xbbdd('0x43')]+'%'};return _0x390b59;})});}_0x2ac846=_[_0xbbdd('0x44')]({},_0x2ac846,_0x33c26c[_0xbbdd('0x46')]);return db[_0xbbdd('0x5a')][_0xbbdd('0x5e')](_0x2ac846);}})['then'](function(_0x35e0ab){if(_0x35e0ab){return db[_0xbbdd('0x5f')][_0xbbdd('0x60')]({'where':{'id':_['map'](_0x35e0ab,'UserId'),'role':_0xbbdd('0x61')},'attributes':['id','name',_0xbbdd('0x62'),_0xbbdd('0x63'),'createdAt']});}})[_0xbbdd('0x2a')](function(_0xc3adb0){if(_0xc3adb0){return{'count':_0xc3adb0['count'],'rows':_['map'](_0xc3adb0['rows'],function(_0x682aec){return{'membername':_0x682aec['name'],'UserId':_0x682aec['id'],'queue_name':_0x54d528[_0xbbdd('0x30')],'SmsQueueId':_0x54d528['id'],'interface':util['format'](_0xbbdd('0x64'),_0xbbdd('0x65'),_0x682aec[_0xbbdd('0x30')]),'penalty':0x0,'paused':_0x682aec[_0xbbdd('0x62')],'createdAt':_0x682aec[_0xbbdd('0x66')],'updatedAt':_0x682aec[_0xbbdd('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xbbdd('0x2a')](respondWithFilteredResult(_0x294eab,_0x2ac846))[_0xbbdd('0x4a')](handleError(_0x294eab,null));};exports[_0xbbdd('0x67')]=function(_0x14d654,_0x21bda2,_0x4790bf){var _0x29c393={};var _0x5ab3c6={};var _0x2de98a;var _0x37c7f5;return db[_0xbbdd('0x34')][_0xbbdd('0x59')]({'where':{'id':_0x14d654[_0xbbdd('0x4c')]['id']}})[_0xbbdd('0x2a')](handleEntityNotFound(_0x21bda2,null))['then'](function(_0x3f7f2c){if(_0x3f7f2c){_0x2de98a=_0x3f7f2c;_0x5ab3c6[_0xbbdd('0x3c')]=_[_0xbbdd('0x39')](db[_0xbbdd('0x68')]['rawAttributes']);_0x5ab3c6['query']=_[_0xbbdd('0x39')](_0x14d654[_0xbbdd('0x38')]);_0x5ab3c6[_0xbbdd('0x42')]=_[_0xbbdd('0x3a')](_0x5ab3c6[_0xbbdd('0x3c')],_0x5ab3c6[_0xbbdd('0x38')]);_0x29c393[_0xbbdd('0x3b')]=_[_0xbbdd('0x3a')](_0x5ab3c6[_0xbbdd('0x3c')],qs[_0xbbdd('0x3d')](_0x14d654['query'][_0xbbdd('0x3d')]));_0x29c393[_0xbbdd('0x3b')]=_0x29c393[_0xbbdd('0x3b')][_0xbbdd('0x4d')]?_0x29c393[_0xbbdd('0x3b')]:_0x5ab3c6[_0xbbdd('0x3c')];_0x29c393[_0xbbdd('0x5b')]=qs['sort'](_0x14d654['query'][_0xbbdd('0x40')]);_0x29c393[_0xbbdd('0x41')]=qs[_0xbbdd('0x42')](_[_0xbbdd('0x5c')](_0x14d654[_0xbbdd('0x38')],_0x5ab3c6['filters']));if(_0x14d654['query'][_0xbbdd('0x43')]){_0x29c393[_0xbbdd('0x41')]=_['merge'](_0x29c393[_0xbbdd('0x41')],{'$or':_[_0xbbdd('0x33')](_0x29c393['attributes'],function(_0x58936f){var _0x1e6bf6={};_0x1e6bf6[_0x58936f]={'$like':'%'+_0x14d654['query']['filter']+'%'};return _0x1e6bf6;})});}_0x29c393=_[_0xbbdd('0x44')]({},_0x29c393,_0x14d654[_0xbbdd('0x46')]);return _0x2de98a['getTeams'](_0x29c393);}})[_0xbbdd('0x2a')](function(_0x3380d4){if(_0x3380d4){_0x37c7f5=_0x3380d4['length'];if(!_0x14d654['query'][_0xbbdd('0x3e')]('nolimit')){_0x29c393[_0xbbdd('0x22')]=qs[_0xbbdd('0x22')](_0x14d654[_0xbbdd('0x38')][_0xbbdd('0x22')]);_0x29c393[_0xbbdd('0x21')]=qs[_0xbbdd('0x21')](_0x14d654[_0xbbdd('0x38')][_0xbbdd('0x21')]);}return _0x2de98a[_0xbbdd('0x67')](_0x29c393);}})[_0xbbdd('0x2a')](function(_0x1fb394){if(_0x1fb394){return _0x1fb394?{'count':_0x37c7f5,'rows':_0x1fb394}:null;}})[_0xbbdd('0x2a')](respondWithResult(_0x21bda2,null))['catch'](handleError(_0x21bda2,null));};exports[_0xbbdd('0x69')]=function(_0xe15d02,_0x5d1b1e,_0x137655){var _0x14632c=_0xe15d02[_0xbbdd('0x4f')][_0xbbdd('0x6a')];return db[_0xbbdd('0x68')]['findAll']({'where':{'id':_0x14632c},'attributes':['id'],'include':[{'model':db[_0xbbdd('0x5f')],'as':_0xbbdd('0x6b'),'attributes':['id',_0xbbdd('0x30'),_0xbbdd('0x6c'),_0xbbdd('0x6d'),_0xbbdd('0x6e')],'raw':!![]}]})['then'](function(_0x3bfa5b){if(_0x3bfa5b){var _0x2b136b=_[_0xbbdd('0x6f')](_0x3bfa5b,function(_0x3dcd06){var _0x32d75b=_0x3dcd06['get']({'plain':!![]});return _0x32d75b[_0xbbdd('0x6b')];});return db[_0xbbdd('0x34')][_0xbbdd('0x54')]({'where':{'id':_0xe15d02[_0xbbdd('0x4c')]['id']}})[_0xbbdd('0x2a')](function(_0x2af35f){return db['sequelize']['transaction'](function(_0x10686e){return _0x2af35f[_0xbbdd('0x69')](_0x14632c,{'transaction':_0x10686e})[_0xbbdd('0x2a')](function(){return BPromise[_0xbbdd('0x70')](_0x2b136b,function(_0x5efa82){return db['UserSmsQueue']['findOrCreate']({'where':{'UserId':_0x5efa82['id'],'SmsQueueId':_0xe15d02[_0xbbdd('0x4c')]['id']},'transaction':_0x10686e});});})[_0xbbdd('0x2a')](function(){_0x2b136b[_0xbbdd('0x71')](function(_0x5fdd8f){socket[_0xbbdd('0x72')]('userSmsQueue:save',{'UserId':_0x5fdd8f['id'],'SmsQueueId':_0x2af35f['id']});});});});});}})[_0xbbdd('0x2a')](respondWithStatusCode(_0x5d1b1e,null))['catch'](handleError(_0x5d1b1e,null));};exports[_0xbbdd('0x73')]=function(_0x471d32,_0xbebaf,_0x52f970){return db[_0xbbdd('0x68')][_0xbbdd('0x5e')]({'where':{'id':_0x471d32['query'][_0xbbdd('0x6a')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xbbdd('0x6b'),'attributes':['id'],'raw':!![]}]})[_0xbbdd('0x2a')](handleEntityNotFound(_0xbebaf,null))['then'](function(_0x38f91a){var _0x488f68=_[_0xbbdd('0x33')](_0x38f91a,'id');var _0x71f364=[];var _0x4ea47a=[];var _0x3c88f2=squel['select']();_0x3c88f2['field'](_0xbbdd('0x74'))[_0xbbdd('0x75')]('team_has_sms_queues','tq')[_0xbbdd('0x76')](_0xbbdd('0x77'),'ut',_0xbbdd('0x78'))[_0xbbdd('0x41')](_0xbbdd('0x79'),_0x471d32[_0xbbdd('0x4c')]['id']);for(var _0x4d46bd=0x0;_0x4d46bd<_0x38f91a[_0xbbdd('0x4d')];_0x4d46bd+=0x1){let _0x21cff4=_0x38f91a[_0x4d46bd];for(var _0x417b7e=0x0;_0x417b7e<_0x21cff4[_0xbbdd('0x6b')][_0xbbdd('0x4d')];_0x417b7e+=0x1){let _0x5cab86=_0x21cff4[_0xbbdd('0x6b')][_0x417b7e];var _0xdff4a5=_0x3c88f2[_0xbbdd('0x7a')]();_0xdff4a5[_0xbbdd('0x41')](_0xbbdd('0x7b'),_0x5cab86['id']);_0x4ea47a[_0xbbdd('0x7c')](db[_0xbbdd('0x7d')][_0xbbdd('0x38')](_0xdff4a5['toString'](),{'type':db[_0xbbdd('0x7d')][_0xbbdd('0x7e')][_0xbbdd('0x7f')]})[_0xbbdd('0x2a')](function(_0x1ac674){if(_0x1ac674[_0xbbdd('0x4d')]===0x1){return _0x5cab86['id'];}else{var _0x366bbc=_[_0xbbdd('0x80')](_['map'](_0x1ac674,_0xbbdd('0x81')),function(_0x111ce2){return _[_0xbbdd('0x82')](_0x488f68,_0x111ce2);});if(_0x366bbc){return _0x5cab86['id'];}}}));}}return BPromise['all'](_0x4ea47a)[_0xbbdd('0x2a')](function(_0x50e103){_0x71f364=_(_0x71f364)['union'](_0x50e103)['compact']()[_0xbbdd('0x83')]();return db[_0xbbdd('0x34')]['find']({'where':{'id':_0x471d32[_0xbbdd('0x4c')]['id']}})[_0xbbdd('0x2a')](function(_0x5c4aaa){return db['sequelize'][_0xbbdd('0x84')](function(_0xb8f482){return _0x5c4aaa[_0xbbdd('0x73')](_0x471d32[_0xbbdd('0x38')][_0xbbdd('0x6a')],{'transaction':_0xb8f482})['then'](function(){if(!_[_0xbbdd('0x85')](_0x71f364)){return _0x5c4aaa[_0xbbdd('0x86')](_0x71f364,{'transaction':_0xb8f482});}})[_0xbbdd('0x2a')](function(){_0x71f364[_0xbbdd('0x71')](function(_0x419906){socket[_0xbbdd('0x72')](_0xbbdd('0x87'),{'UserId':_0x419906,'SmsQueueId':_0x5c4aaa['id']});});});});});});})[_0xbbdd('0x2a')](respondWithStatusCode(_0xbebaf,null))['catch'](handleError(_0xbebaf,null));};exports[_0xbbdd('0x88')]=function(_0x10803a,_0x2efccd,_0x44d5a5){return db['SmsQueue'][_0xbbdd('0x54')]({'where':{'id':_0x10803a[_0xbbdd('0x4c')]['id']}})[_0xbbdd('0x2a')](handleEntityNotFound(_0x2efccd,null))['then'](function(_0x1b4a3f){if(_0x1b4a3f){return _0x1b4a3f[_0xbbdd('0x88')](_0x10803a[_0xbbdd('0x4f')]['ids'],_[_0xbbdd('0x89')](_0x10803a[_0xbbdd('0x4f')],[_0xbbdd('0x6a'),'id'])||{})[_0xbbdd('0x8a')](function(_0x15e88d){for(var _0x4c150d=0x0;_0x4c150d<_0x10803a[_0xbbdd('0x4f')][_0xbbdd('0x6a')][_0xbbdd('0x4d')];_0x4c150d+=0x1){socket[_0xbbdd('0x72')](_0xbbdd('0x8b'),{'UserId':Number(_0x10803a[_0xbbdd('0x4f')]['ids'][_0x4c150d]),'SmsQueueId':Number(_0x10803a[_0xbbdd('0x4c')]['id'])});}return _0x15e88d;});}})[_0xbbdd('0x2a')](respondWithResult(_0x2efccd,null))[_0xbbdd('0x4a')](handleError(_0x2efccd,null));};exports[_0xbbdd('0x86')]=function(_0x2acd0a,_0x7bed33,_0x1897a0){return db[_0xbbdd('0x34')]['find']({'where':{'id':_0x2acd0a['params']['id']}})[_0xbbdd('0x2a')](handleEntityNotFound(_0x7bed33,null))['then'](function(_0x3a7b75){if(_0x3a7b75){return _0x3a7b75[_0xbbdd('0x86')](_0x2acd0a[_0xbbdd('0x38')][_0xbbdd('0x6a')])[_0xbbdd('0x2a')](function(){if(_[_0xbbdd('0x8c')](_0x2acd0a[_0xbbdd('0x38')][_0xbbdd('0x6a')])){for(var _0x20b7cf=0x0;_0x20b7cf<_0x2acd0a[_0xbbdd('0x38')][_0xbbdd('0x6a')][_0xbbdd('0x4d')];_0x20b7cf+=0x1){socket['emit'](_0xbbdd('0x87'),{'UserId':Number(_0x2acd0a['query'][_0xbbdd('0x6a')][_0x20b7cf]),'SmsQueueId':Number(_0x2acd0a[_0xbbdd('0x4c')]['id'])});}}else{socket[_0xbbdd('0x72')](_0xbbdd('0x87'),{'UserId':Number(_0x2acd0a[_0xbbdd('0x38')][_0xbbdd('0x6a')]),'SmsQueueId':Number(_0x2acd0a['params']['id'])});}});}})['then'](respondWithStatusCode(_0x7bed33,null))[_0xbbdd('0x4a')](handleError(_0x7bed33,null));};exports[_0xbbdd('0x8d')]=function(_0x4d87aa,_0x38d9b1,_0x12ec30){var _0x16f0a3={};var _0xba6e77={};var _0x5e02dd;var _0x2cd27d;return db[_0xbbdd('0x34')][_0xbbdd('0x59')]({'where':{'id':_0x4d87aa['params']['id']}})[_0xbbdd('0x2a')](handleEntityNotFound(_0x38d9b1,null))[_0xbbdd('0x2a')](function(_0x176430){if(_0x176430){_0x5e02dd=_0x176430;_0xba6e77['model']=_[_0xbbdd('0x39')](db[_0xbbdd('0x5f')][_0xbbdd('0x35')]);_0xba6e77[_0xbbdd('0x38')]=_[_0xbbdd('0x39')](_0x4d87aa[_0xbbdd('0x38')]);_0xba6e77['filters']=_[_0xbbdd('0x3a')](_0xba6e77[_0xbbdd('0x3c')],_0xba6e77[_0xbbdd('0x38')]);_0x16f0a3[_0xbbdd('0x3b')]=_['intersection'](_0xba6e77[_0xbbdd('0x3c')],qs[_0xbbdd('0x3d')](_0x4d87aa[_0xbbdd('0x38')][_0xbbdd('0x3d')]));_0x16f0a3[_0xbbdd('0x3b')]=_0x16f0a3[_0xbbdd('0x3b')][_0xbbdd('0x4d')]?_0x16f0a3[_0xbbdd('0x3b')]:_0xba6e77[_0xbbdd('0x3c')];_0x16f0a3[_0xbbdd('0x5b')]=qs[_0xbbdd('0x40')](_0x4d87aa['query'][_0xbbdd('0x40')]);_0x16f0a3[_0xbbdd('0x41')]=qs[_0xbbdd('0x42')](_[_0xbbdd('0x5c')](_0x4d87aa[_0xbbdd('0x38')],_0xba6e77['filters']));if(_0x4d87aa[_0xbbdd('0x38')]['filter']){_0x16f0a3['where']=_[_0xbbdd('0x44')](_0x16f0a3[_0xbbdd('0x41')],{'$or':_[_0xbbdd('0x33')](_0x16f0a3['attributes'],function(_0x348458){var _0x2b0f9b={};_0x2b0f9b[_0x348458]={'$like':'%'+_0x4d87aa['query'][_0xbbdd('0x43')]+'%'};return _0x2b0f9b;})});}_0x16f0a3=_['merge']({},_0x16f0a3,_0x4d87aa[_0xbbdd('0x46')]);return _0x5e02dd[_0xbbdd('0x8d')](_0x16f0a3);}})[_0xbbdd('0x2a')](function(_0x369d3d){if(_0x369d3d){_0x2cd27d=_0x369d3d['length'];if(!_0x4d87aa[_0xbbdd('0x38')][_0xbbdd('0x3e')](_0xbbdd('0x3f'))){_0x16f0a3[_0xbbdd('0x22')]=qs[_0xbbdd('0x22')](_0x4d87aa['query']['limit']);_0x16f0a3[_0xbbdd('0x21')]=qs[_0xbbdd('0x21')](_0x4d87aa['query']['offset']);}return _0x5e02dd['getAgents'](_0x16f0a3);}})[_0xbbdd('0x2a')](function(_0x2bf927){if(_0x2bf927){return _0x2bf927?{'count':_0x2cd27d,'rows':_0x2bf927}:null;}})[_0xbbdd('0x2a')](respondWithResult(_0x38d9b1,null))[_0xbbdd('0x4a')](handleError(_0x38d9b1,null));};
\ No newline at end of file
+var _0xc8e0=['to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','SmsQueues','UserProfileResource','error','name','map','SmsQueue','rawAttributes','type','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','autoAssociation','body','describe','getMembers','findOne','hasOwnProperty','User','findAndCountAll','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','UserSmsQueue','findOrCreate','emit','userSmsQueue:save','select','field','tq.TeamId','team_has_sms_queues','join','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','all','compact','value','removeTeams','removeAgents','forEach','addAgents','ids','omit','isArray','userSmsQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x2f4a23,_0x54bb64){var _0x231b1b=function(_0x27f20e){while(--_0x27f20e){_0x2f4a23['push'](_0x2f4a23['shift']());}};_0x231b1b(++_0x54bb64);}(_0xc8e0,0x190));var _0x0c8e=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc8e0[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x0c8e('0x0'));var rimraf=require(_0x0c8e('0x1'));var zipdir=require(_0x0c8e('0x2'));var jsonpatch=require(_0x0c8e('0x3'));var rp=require(_0x0c8e('0x4'));var moment=require(_0x0c8e('0x5'));var BPromise=require(_0x0c8e('0x6'));var Mustache=require(_0x0c8e('0x7'));var util=require(_0x0c8e('0x8'));var path=require(_0x0c8e('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0c8e('0xa'));var fs=require('fs');var fs_extra=require(_0x0c8e('0xb'));var _=require(_0x0c8e('0xc'));var squel=require(_0x0c8e('0xd'));var crypto=require(_0x0c8e('0xe'));var jsforce=require(_0x0c8e('0xf'));var deskjs=require(_0x0c8e('0x10'));var toCsv=require(_0x0c8e('0x11'));var querystring=require('querystring');var Papa=require(_0x0c8e('0x12'));var Redis=require(_0x0c8e('0x13'));var authService=require(_0x0c8e('0x14'));var qs=require(_0x0c8e('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0c8e('0x16'));var logger=require(_0x0c8e('0x17'))(_0x0c8e('0x18'));var utils=require('../../config/utils');var config=require(_0x0c8e('0x19'));var licenseUtil=require(_0x0c8e('0x1a'));var db=require(_0x0c8e('0x1b'))['db'];config[_0x0c8e('0x1c')]=_[_0x0c8e('0x1d')](config[_0x0c8e('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x0c8e('0x1e'))(new Redis(config[_0x0c8e('0x1c')]));require(_0x0c8e('0x1f'))[_0x0c8e('0x20')](socket);function respondWithStatusCode(_0x2ea26d,_0x311c92){_0x311c92=_0x311c92||0xcc;return function(_0x146cbb){if(_0x146cbb){return _0x2ea26d[_0x0c8e('0x21')](_0x311c92);}return _0x2ea26d['status'](_0x311c92)[_0x0c8e('0x22')]();};}function respondWithResult(_0x32ad7a,_0x5573ad){_0x5573ad=_0x5573ad||0xc8;return function(_0x473500){if(_0x473500){return _0x32ad7a[_0x0c8e('0x23')](_0x5573ad)[_0x0c8e('0x24')](_0x473500);}};}function respondWithFilteredResult(_0x552266,_0xb61f97){return function(_0x4fe381){if(_0x4fe381){var _0x393124=typeof _0xb61f97[_0x0c8e('0x25')]===_0x0c8e('0x26')&&typeof _0xb61f97[_0x0c8e('0x27')]===_0x0c8e('0x26');var _0x63a3ae=_0x4fe381[_0x0c8e('0x28')];var _0x1ac79c=_0x393124?0x0:_0xb61f97[_0x0c8e('0x25')];var _0x5c9fb4=_0x393124?_0x4fe381['count']:_0xb61f97['offset']+_0xb61f97[_0x0c8e('0x27')];var _0x3685ad;if(_0x5c9fb4>=_0x63a3ae){_0x5c9fb4=_0x63a3ae;_0x3685ad=0xc8;}else{_0x3685ad=0xce;}_0x552266[_0x0c8e('0x23')](_0x3685ad);return _0x552266[_0x0c8e('0x29')](_0x0c8e('0x2a'),_0x1ac79c+'-'+_0x5c9fb4+'/'+_0x63a3ae)[_0x0c8e('0x24')](_0x4fe381);}return null;};}function patchUpdates(_0x3611e0){return function(_0x170322){try{jsonpatch[_0x0c8e('0x2b')](_0x170322,_0x3611e0,!![]);}catch(_0x17f7e5){return BPromise['reject'](_0x17f7e5);}return _0x170322[_0x0c8e('0x2c')]();};}function saveUpdates(_0x5a1682,_0x281a74){return function(_0x481b04){if(_0x481b04){return _0x481b04[_0x0c8e('0x2d')](_0x5a1682)[_0x0c8e('0x2e')](function(_0x5c745b){return _0x5c745b;});}return null;};}function removeEntity(_0x1ec804,_0x4422b8){return function(_0x11fe2e){if(_0x11fe2e){return _0x11fe2e[_0x0c8e('0x2f')]()[_0x0c8e('0x2e')](function(){var _0x167953=_0x11fe2e[_0x0c8e('0x30')]({'plain':!![]});var _0x33d3c9=_0x0c8e('0x31');return db[_0x0c8e('0x32')][_0x0c8e('0x2f')]({'where':{'type':_0x33d3c9,'resourceId':_0x167953['id']}})[_0x0c8e('0x2e')](function(){return _0x11fe2e;});})[_0x0c8e('0x2e')](function(){_0x1ec804[_0x0c8e('0x23')](0xcc)[_0x0c8e('0x22')]();});}};}function handleEntityNotFound(_0x1cdb15,_0x5757d0){return function(_0x94bb7b){if(!_0x94bb7b){_0x1cdb15[_0x0c8e('0x21')](0x194);}return _0x94bb7b;};}function handleError(_0x2e4370,_0x5dd511){_0x5dd511=_0x5dd511||0x1f4;return function(_0x40ce37){logger[_0x0c8e('0x33')](_0x40ce37['stack']);if(_0x40ce37[_0x0c8e('0x34')]){delete _0x40ce37[_0x0c8e('0x34')];}_0x2e4370[_0x0c8e('0x23')](_0x5dd511)['send'](_0x40ce37);};}exports['index']=function(_0x3a16c4,_0x44681e){var _0x60edcd={},_0x1ff4bd={},_0x3da28d={'count':0x0,'rows':[]};var _0x41ec0f=_[_0x0c8e('0x35')](db[_0x0c8e('0x36')][_0x0c8e('0x37')],function(_0x3afd9d){return{'name':_0x3afd9d['fieldName'],'type':_0x3afd9d[_0x0c8e('0x38')]['key']};});_0x1ff4bd[_0x0c8e('0x39')]=_[_0x0c8e('0x35')](_0x41ec0f,_0x0c8e('0x34'));_0x1ff4bd['query']=_[_0x0c8e('0x3a')](_0x3a16c4[_0x0c8e('0x3b')]);_0x1ff4bd[_0x0c8e('0x3c')]=_[_0x0c8e('0x3d')](_0x1ff4bd[_0x0c8e('0x39')],_0x1ff4bd[_0x0c8e('0x3b')]);_0x60edcd[_0x0c8e('0x3e')]=_[_0x0c8e('0x3d')](_0x1ff4bd[_0x0c8e('0x39')],qs[_0x0c8e('0x3f')](_0x3a16c4[_0x0c8e('0x3b')][_0x0c8e('0x3f')]));_0x60edcd[_0x0c8e('0x3e')]=_0x60edcd[_0x0c8e('0x3e')][_0x0c8e('0x40')]?_0x60edcd[_0x0c8e('0x3e')]:_0x1ff4bd['model'];if(!_0x3a16c4[_0x0c8e('0x3b')]['hasOwnProperty'](_0x0c8e('0x41'))){_0x60edcd['limit']=qs[_0x0c8e('0x27')](_0x3a16c4['query']['limit']);_0x60edcd['offset']=qs[_0x0c8e('0x25')](_0x3a16c4[_0x0c8e('0x3b')][_0x0c8e('0x25')]);}_0x60edcd[_0x0c8e('0x42')]=qs[_0x0c8e('0x43')](_0x3a16c4[_0x0c8e('0x3b')]['sort']);_0x60edcd[_0x0c8e('0x44')]=qs[_0x0c8e('0x3c')](_[_0x0c8e('0x45')](_0x3a16c4[_0x0c8e('0x3b')],_0x1ff4bd[_0x0c8e('0x3c')]),_0x41ec0f);if(_0x3a16c4['query'][_0x0c8e('0x46')]){_0x60edcd[_0x0c8e('0x44')]=_[_0x0c8e('0x47')](_0x60edcd[_0x0c8e('0x44')],{'$or':_[_0x0c8e('0x35')](_0x41ec0f,function(_0x164851){if(_0x164851[_0x0c8e('0x38')]!==_0x0c8e('0x48')){var _0x4d786e={};_0x4d786e[_0x164851[_0x0c8e('0x34')]]={'$like':'%'+_0x3a16c4[_0x0c8e('0x3b')]['filter']+'%'};return _0x4d786e;}})});}_0x60edcd=_[_0x0c8e('0x47')]({},_0x60edcd,_0x3a16c4[_0x0c8e('0x49')]);var _0x52153e={'where':_0x60edcd[_0x0c8e('0x44')]};return db[_0x0c8e('0x36')][_0x0c8e('0x28')](_0x52153e)[_0x0c8e('0x2e')](function(_0x2877f5){_0x3da28d[_0x0c8e('0x28')]=_0x2877f5;if(_0x3a16c4[_0x0c8e('0x3b')][_0x0c8e('0x4a')]){_0x60edcd[_0x0c8e('0x4b')]=[{'all':!![]}];}return db[_0x0c8e('0x36')][_0x0c8e('0x4c')](_0x60edcd);})[_0x0c8e('0x2e')](function(_0x2c79ad){_0x3da28d[_0x0c8e('0x4d')]=_0x2c79ad;return _0x3da28d;})['then'](respondWithFilteredResult(_0x44681e,_0x60edcd))[_0x0c8e('0x4e')](handleError(_0x44681e,null));};exports[_0x0c8e('0x4f')]=function(_0x503a61,_0x56b8fe){var _0x3341fb={'raw':!![],'where':{'id':_0x503a61[_0x0c8e('0x50')]['id']}},_0x3f905b={};_0x3f905b['model']=_[_0x0c8e('0x3a')](db[_0x0c8e('0x36')][_0x0c8e('0x37')]);_0x3f905b[_0x0c8e('0x3b')]=_[_0x0c8e('0x3a')](_0x503a61[_0x0c8e('0x3b')]);_0x3f905b[_0x0c8e('0x3c')]=_[_0x0c8e('0x3d')](_0x3f905b[_0x0c8e('0x39')],_0x3f905b['query']);_0x3341fb[_0x0c8e('0x3e')]=_[_0x0c8e('0x3d')](_0x3f905b[_0x0c8e('0x39')],qs[_0x0c8e('0x3f')](_0x503a61['query']['fields']));_0x3341fb[_0x0c8e('0x3e')]=_0x3341fb[_0x0c8e('0x3e')][_0x0c8e('0x40')]?_0x3341fb['attributes']:_0x3f905b['model'];if(_0x503a61[_0x0c8e('0x3b')][_0x0c8e('0x4a')]){_0x3341fb[_0x0c8e('0x4b')]=[{'all':!![]}];}_0x3341fb=_['merge']({},_0x3341fb,_0x503a61[_0x0c8e('0x49')]);return db[_0x0c8e('0x36')]['find'](_0x3341fb)[_0x0c8e('0x2e')](handleEntityNotFound(_0x56b8fe,null))['then'](respondWithResult(_0x56b8fe,null))['catch'](handleError(_0x56b8fe,null));};exports[_0x0c8e('0x51')]=function(_0x4070d9,_0x534961){return db['SmsQueue']['create'](_0x4070d9['body'],{})[_0x0c8e('0x2e')](function(_0x50e47d){var _0x27d761=_0x4070d9[_0x0c8e('0x52')]['get']({'plain':!![]});if(!_0x27d761)throw new Error(_0x0c8e('0x53'));if(_0x27d761['role']===_0x0c8e('0x52')){var _0x4c26a4=_0x50e47d['get']({'plain':!![]});var _0x500737=_0x0c8e('0x31');return db['UserProfileSection'][_0x0c8e('0x54')]({'where':{'name':_0x500737,'userProfileId':_0x27d761[_0x0c8e('0x55')]},'raw':!![]})[_0x0c8e('0x2e')](function(_0x593785){if(_0x593785&&_0x593785[_0x0c8e('0x56')]===0x0){return db[_0x0c8e('0x32')][_0x0c8e('0x51')]({'name':_0x4c26a4[_0x0c8e('0x34')],'resourceId':_0x4c26a4['id'],'type':_0x593785[_0x0c8e('0x34')],'sectionId':_0x593785['id']},{})[_0x0c8e('0x2e')](function(){return _0x50e47d;});}else{return _0x50e47d;}})[_0x0c8e('0x4e')](function(_0x88a795){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x88a795);throw _0x88a795;});}return _0x50e47d;})[_0x0c8e('0x2e')](respondWithResult(_0x534961,0xc9))[_0x0c8e('0x4e')](handleError(_0x534961,null));};exports['update']=function(_0x530232,_0x14947f){if(_0x530232[_0x0c8e('0x57')]['id']){delete _0x530232[_0x0c8e('0x57')]['id'];}return db[_0x0c8e('0x36')][_0x0c8e('0x54')]({'where':{'id':_0x530232[_0x0c8e('0x50')]['id']}})[_0x0c8e('0x2e')](handleEntityNotFound(_0x14947f,null))[_0x0c8e('0x2e')](saveUpdates(_0x530232[_0x0c8e('0x57')],null))['then'](respondWithResult(_0x14947f,null))[_0x0c8e('0x4e')](handleError(_0x14947f,null));};exports[_0x0c8e('0x2f')]=function(_0x53c0d9,_0x3d48f9){return db[_0x0c8e('0x36')][_0x0c8e('0x54')]({'where':{'id':_0x53c0d9['params']['id']}})[_0x0c8e('0x2e')](handleEntityNotFound(_0x3d48f9,null))[_0x0c8e('0x2e')](removeEntity(_0x3d48f9,null))[_0x0c8e('0x4e')](handleError(_0x3d48f9,null));};exports[_0x0c8e('0x58')]=function(_0x19fd2a,_0x1623aa){return db['SmsQueue'][_0x0c8e('0x58')]()[_0x0c8e('0x2e')](respondWithResult(_0x1623aa,null))[_0x0c8e('0x4e')](handleError(_0x1623aa,null));};exports[_0x0c8e('0x59')]=function(_0x506153,_0x5b7bc9,_0x2d847f){var _0x1f6845={'raw':!![],'where':{}},_0x4747a6={},_0x592b3f;return db[_0x0c8e('0x36')][_0x0c8e('0x5a')]({'where':{'id':_0x506153[_0x0c8e('0x50')]['id']}})[_0x0c8e('0x2e')](handleEntityNotFound(_0x5b7bc9,null))[_0x0c8e('0x2e')](function(_0x34380d){if(_0x34380d){_0x592b3f=_0x34380d[_0x0c8e('0x30')]({'plain':!![]});_0x4747a6[_0x0c8e('0x39')]=_[_0x0c8e('0x3a')](db['UserSmsQueue']['rawAttributes']);_0x4747a6[_0x0c8e('0x3b')]=_[_0x0c8e('0x3a')](_0x506153[_0x0c8e('0x3b')]);_0x4747a6[_0x0c8e('0x3c')]=_['intersection'](_0x4747a6[_0x0c8e('0x39')],_0x4747a6[_0x0c8e('0x3b')]);_0x1f6845[_0x0c8e('0x3e')]=_['intersection'](_0x4747a6['model'],qs[_0x0c8e('0x3f')](_0x506153['query']['fields']));_0x1f6845[_0x0c8e('0x3e')]=_0x1f6845[_0x0c8e('0x3e')][_0x0c8e('0x40')]?_0x1f6845[_0x0c8e('0x3e')]:_0x4747a6[_0x0c8e('0x39')];if(!_0x506153[_0x0c8e('0x3b')][_0x0c8e('0x5b')](_0x0c8e('0x41'))){_0x1f6845[_0x0c8e('0x27')]=qs[_0x0c8e('0x27')](_0x506153[_0x0c8e('0x3b')]['limit']);_0x1f6845['offset']=qs[_0x0c8e('0x25')](_0x506153[_0x0c8e('0x3b')]['offset']);}_0x1f6845[_0x0c8e('0x42')]=qs[_0x0c8e('0x43')](_0x506153[_0x0c8e('0x3b')][_0x0c8e('0x43')]);_0x1f6845[_0x0c8e('0x44')]=qs[_0x0c8e('0x3c')](_[_0x0c8e('0x45')](_0x506153[_0x0c8e('0x3b')],_0x4747a6['filters']));_0x1f6845['where']['SmsQueueId']=_0x34380d['id'];if(_0x506153['query'][_0x0c8e('0x46')]){_0x1f6845[_0x0c8e('0x44')]=_[_0x0c8e('0x47')](_0x1f6845['where'],{'$or':_[_0x0c8e('0x35')](_0x1f6845[_0x0c8e('0x3e')],function(_0x54fc64){var _0x5adf5a={};_0x5adf5a[_0x54fc64]={'$like':'%'+_0x506153[_0x0c8e('0x3b')]['filter']+'%'};return _0x5adf5a;})});}_0x1f6845=_[_0x0c8e('0x47')]({},_0x1f6845,_0x506153[_0x0c8e('0x49')]);return db['UserSmsQueue'][_0x0c8e('0x4c')](_0x1f6845);}})[_0x0c8e('0x2e')](function(_0x155c48){if(_0x155c48){return db[_0x0c8e('0x5c')][_0x0c8e('0x5d')]({'where':{'id':_['map'](_0x155c48,'UserId'),'role':_0x0c8e('0x5e')},'attributes':['id','name',_0x0c8e('0x5f'),_0x0c8e('0x60'),_0x0c8e('0x61')]});}})[_0x0c8e('0x2e')](function(_0x393d65){if(_0x393d65){return{'count':_0x393d65[_0x0c8e('0x28')],'rows':_[_0x0c8e('0x35')](_0x393d65[_0x0c8e('0x4d')],function(_0x5b763d){return{'membername':_0x5b763d[_0x0c8e('0x34')],'UserId':_0x5b763d['id'],'queue_name':_0x592b3f[_0x0c8e('0x34')],'SmsQueueId':_0x592b3f['id'],'interface':util[_0x0c8e('0x62')](_0x0c8e('0x63'),_0x0c8e('0x64'),_0x5b763d[_0x0c8e('0x34')]),'penalty':0x0,'paused':_0x5b763d[_0x0c8e('0x5f')],'createdAt':_0x5b763d[_0x0c8e('0x61')],'updatedAt':_0x5b763d[_0x0c8e('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x5b7bc9,_0x1f6845))['catch'](handleError(_0x5b7bc9,null));};exports[_0x0c8e('0x65')]=function(_0x2f9487,_0x3f862c,_0x1e3f8e){var _0x272bee={};var _0x5247ff={};var _0xae0512;var _0x4b0d81;return db['SmsQueue']['findOne']({'where':{'id':_0x2f9487[_0x0c8e('0x50')]['id']}})[_0x0c8e('0x2e')](handleEntityNotFound(_0x3f862c,null))[_0x0c8e('0x2e')](function(_0x173c78){if(_0x173c78){_0xae0512=_0x173c78;_0x5247ff['model']=_['keys'](db[_0x0c8e('0x66')][_0x0c8e('0x37')]);_0x5247ff[_0x0c8e('0x3b')]=_[_0x0c8e('0x3a')](_0x2f9487[_0x0c8e('0x3b')]);_0x5247ff[_0x0c8e('0x3c')]=_[_0x0c8e('0x3d')](_0x5247ff[_0x0c8e('0x39')],_0x5247ff['query']);_0x272bee[_0x0c8e('0x3e')]=_['intersection'](_0x5247ff[_0x0c8e('0x39')],qs['fields'](_0x2f9487[_0x0c8e('0x3b')][_0x0c8e('0x3f')]));_0x272bee[_0x0c8e('0x3e')]=_0x272bee['attributes'][_0x0c8e('0x40')]?_0x272bee['attributes']:_0x5247ff['model'];_0x272bee[_0x0c8e('0x42')]=qs[_0x0c8e('0x43')](_0x2f9487[_0x0c8e('0x3b')][_0x0c8e('0x43')]);_0x272bee[_0x0c8e('0x44')]=qs[_0x0c8e('0x3c')](_[_0x0c8e('0x45')](_0x2f9487[_0x0c8e('0x3b')],_0x5247ff[_0x0c8e('0x3c')]));if(_0x2f9487[_0x0c8e('0x3b')][_0x0c8e('0x46')]){_0x272bee[_0x0c8e('0x44')]=_[_0x0c8e('0x47')](_0x272bee[_0x0c8e('0x44')],{'$or':_['map'](_0x272bee[_0x0c8e('0x3e')],function(_0x4bbf6a){var _0x5e71ff={};_0x5e71ff[_0x4bbf6a]={'$like':'%'+_0x2f9487['query'][_0x0c8e('0x46')]+'%'};return _0x5e71ff;})});}_0x272bee=_[_0x0c8e('0x47')]({},_0x272bee,_0x2f9487['options']);return _0xae0512[_0x0c8e('0x65')](_0x272bee);}})[_0x0c8e('0x2e')](function(_0x489a9d){if(_0x489a9d){_0x4b0d81=_0x489a9d['length'];if(!_0x2f9487['query'][_0x0c8e('0x5b')](_0x0c8e('0x41'))){_0x272bee[_0x0c8e('0x27')]=qs['limit'](_0x2f9487[_0x0c8e('0x3b')][_0x0c8e('0x27')]);_0x272bee[_0x0c8e('0x25')]=qs[_0x0c8e('0x25')](_0x2f9487[_0x0c8e('0x3b')]['offset']);}return _0xae0512[_0x0c8e('0x65')](_0x272bee);}})[_0x0c8e('0x2e')](function(_0x293370){if(_0x293370){return _0x293370?{'count':_0x4b0d81,'rows':_0x293370}:null;}})[_0x0c8e('0x2e')](respondWithResult(_0x3f862c,null))[_0x0c8e('0x4e')](handleError(_0x3f862c,null));};exports[_0x0c8e('0x67')]=function(_0x531813,_0x497b62,_0x36ed10){var _0x58391c=_0x531813[_0x0c8e('0x57')]['ids'];return db[_0x0c8e('0x66')][_0x0c8e('0x4c')]({'where':{'id':_0x58391c},'attributes':['id'],'include':[{'model':db[_0x0c8e('0x5c')],'as':_0x0c8e('0x68'),'attributes':['id',_0x0c8e('0x34'),_0x0c8e('0x69'),_0x0c8e('0x6a'),_0x0c8e('0x6b')],'raw':!![]}]})[_0x0c8e('0x2e')](function(_0x113093){if(_0x113093){var _0x4f63a9=_[_0x0c8e('0x6c')](_0x113093,function(_0x26c1f2){var _0x34bfa6=_0x26c1f2[_0x0c8e('0x30')]({'plain':!![]});return _0x34bfa6[_0x0c8e('0x68')];});return db[_0x0c8e('0x36')]['find']({'where':{'id':_0x531813[_0x0c8e('0x50')]['id']}})[_0x0c8e('0x2e')](function(_0x25d91d){return db[_0x0c8e('0x6d')][_0x0c8e('0x6e')](function(_0x2ca7cf){return _0x25d91d[_0x0c8e('0x67')](_0x58391c,{'transaction':_0x2ca7cf})[_0x0c8e('0x2e')](function(){return BPromise['each'](_0x4f63a9,function(_0x742a13){return db[_0x0c8e('0x6f')][_0x0c8e('0x70')]({'where':{'UserId':_0x742a13['id'],'SmsQueueId':_0x531813['params']['id']},'transaction':_0x2ca7cf});});})[_0x0c8e('0x2e')](function(){_0x4f63a9['forEach'](function(_0x2ff21b){socket[_0x0c8e('0x71')](_0x0c8e('0x72'),{'UserId':_0x2ff21b['id'],'SmsQueueId':_0x25d91d['id']});});});});});}})[_0x0c8e('0x2e')](respondWithStatusCode(_0x497b62,null))[_0x0c8e('0x4e')](handleError(_0x497b62,null));};exports['removeTeams']=function(_0x45b5b0,_0x4c09ad,_0x32a233){return db[_0x0c8e('0x66')][_0x0c8e('0x4c')]({'where':{'id':_0x45b5b0[_0x0c8e('0x3b')]['ids']},'attributes':['id'],'include':[{'model':db[_0x0c8e('0x5c')],'as':_0x0c8e('0x68'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4c09ad,null))[_0x0c8e('0x2e')](function(_0x4b4dac){var _0x1b5eef=_[_0x0c8e('0x35')](_0x4b4dac,'id');var _0x40f616=[];var _0x568341=[];var _0x14668f=squel[_0x0c8e('0x73')]();_0x14668f[_0x0c8e('0x74')](_0x0c8e('0x75'))['from'](_0x0c8e('0x76'),'tq')[_0x0c8e('0x77')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x0c8e('0x44')](_0x0c8e('0x78'),_0x45b5b0[_0x0c8e('0x50')]['id']);for(var _0x3dbbd7=0x0;_0x3dbbd7<_0x4b4dac[_0x0c8e('0x40')];_0x3dbbd7+=0x1){let _0x760b2a=_0x4b4dac[_0x3dbbd7];for(var _0x73e4d0=0x0;_0x73e4d0<_0x760b2a[_0x0c8e('0x68')][_0x0c8e('0x40')];_0x73e4d0+=0x1){let _0x247155=_0x760b2a[_0x0c8e('0x68')][_0x73e4d0];var _0x5e1f3c=_0x14668f[_0x0c8e('0x79')]();_0x5e1f3c['where'](_0x0c8e('0x7a'),_0x247155['id']);_0x568341['push'](db[_0x0c8e('0x6d')][_0x0c8e('0x3b')](_0x5e1f3c[_0x0c8e('0x7b')](),{'type':db['sequelize'][_0x0c8e('0x7c')]['SELECT']})[_0x0c8e('0x2e')](function(_0x20b960){if(_0x20b960[_0x0c8e('0x40')]===0x1){return _0x247155['id'];}else{var _0x3b6f8b=_[_0x0c8e('0x7d')](_[_0x0c8e('0x35')](_0x20b960,_0x0c8e('0x7e')),function(_0xbb0754){return _['includes'](_0x1b5eef,_0xbb0754);});if(_0x3b6f8b){return _0x247155['id'];}}}));}}return BPromise[_0x0c8e('0x7f')](_0x568341)[_0x0c8e('0x2e')](function(_0x41de05){_0x40f616=_(_0x40f616)['union'](_0x41de05)[_0x0c8e('0x80')]()[_0x0c8e('0x81')]();return db[_0x0c8e('0x36')][_0x0c8e('0x54')]({'where':{'id':_0x45b5b0[_0x0c8e('0x50')]['id']}})[_0x0c8e('0x2e')](function(_0x22b9f6){return db[_0x0c8e('0x6d')][_0x0c8e('0x6e')](function(_0x33bcf7){return _0x22b9f6[_0x0c8e('0x82')](_0x45b5b0[_0x0c8e('0x3b')]['ids'],{'transaction':_0x33bcf7})[_0x0c8e('0x2e')](function(){if(!_['isEmpty'](_0x40f616)){return _0x22b9f6[_0x0c8e('0x83')](_0x40f616,{'transaction':_0x33bcf7});}})[_0x0c8e('0x2e')](function(){_0x40f616[_0x0c8e('0x84')](function(_0x3829b0){socket[_0x0c8e('0x71')]('userSmsQueue:remove',{'UserId':_0x3829b0,'SmsQueueId':_0x22b9f6['id']});});});});});});})[_0x0c8e('0x2e')](respondWithStatusCode(_0x4c09ad,null))['catch'](handleError(_0x4c09ad,null));};exports[_0x0c8e('0x85')]=function(_0x189473,_0x169150,_0x563157){return db[_0x0c8e('0x36')][_0x0c8e('0x54')]({'where':{'id':_0x189473[_0x0c8e('0x50')]['id']}})[_0x0c8e('0x2e')](handleEntityNotFound(_0x169150,null))['then'](function(_0x2b3e1c){if(_0x2b3e1c){return _0x2b3e1c[_0x0c8e('0x85')](_0x189473['body'][_0x0c8e('0x86')],_[_0x0c8e('0x87')](_0x189473[_0x0c8e('0x57')],[_0x0c8e('0x86'),'id'])||{})['spread'](function(_0x4c7615){for(var _0x36745d=0x0;_0x36745d<_0x189473['body'][_0x0c8e('0x86')][_0x0c8e('0x40')];_0x36745d+=0x1){socket[_0x0c8e('0x71')](_0x0c8e('0x72'),{'UserId':Number(_0x189473[_0x0c8e('0x57')][_0x0c8e('0x86')][_0x36745d]),'SmsQueueId':Number(_0x189473[_0x0c8e('0x50')]['id'])});}return _0x4c7615;});}})['then'](respondWithResult(_0x169150,null))['catch'](handleError(_0x169150,null));};exports[_0x0c8e('0x83')]=function(_0x1cf292,_0x5b0559,_0x226fc1){return db[_0x0c8e('0x36')][_0x0c8e('0x54')]({'where':{'id':_0x1cf292['params']['id']}})[_0x0c8e('0x2e')](handleEntityNotFound(_0x5b0559,null))['then'](function(_0x5e1cbc){if(_0x5e1cbc){return _0x5e1cbc['removeAgents'](_0x1cf292[_0x0c8e('0x3b')]['ids'])[_0x0c8e('0x2e')](function(){if(_[_0x0c8e('0x88')](_0x1cf292[_0x0c8e('0x3b')][_0x0c8e('0x86')])){for(var _0x3cfa63=0x0;_0x3cfa63<_0x1cf292[_0x0c8e('0x3b')][_0x0c8e('0x86')][_0x0c8e('0x40')];_0x3cfa63+=0x1){socket['emit'](_0x0c8e('0x89'),{'UserId':Number(_0x1cf292[_0x0c8e('0x3b')]['ids'][_0x3cfa63]),'SmsQueueId':Number(_0x1cf292[_0x0c8e('0x50')]['id'])});}}else{socket[_0x0c8e('0x71')](_0x0c8e('0x89'),{'UserId':Number(_0x1cf292[_0x0c8e('0x3b')][_0x0c8e('0x86')]),'SmsQueueId':Number(_0x1cf292[_0x0c8e('0x50')]['id'])});}});}})['then'](respondWithStatusCode(_0x5b0559,null))[_0x0c8e('0x4e')](handleError(_0x5b0559,null));};exports[_0x0c8e('0x8a')]=function(_0x48e5ba,_0x657b68,_0x482378){var _0x580642={};var _0x445b9c={};var _0x4b58ca;var _0x2862e0;return db[_0x0c8e('0x36')]['findOne']({'where':{'id':_0x48e5ba[_0x0c8e('0x50')]['id']}})[_0x0c8e('0x2e')](handleEntityNotFound(_0x657b68,null))['then'](function(_0x288b20){if(_0x288b20){_0x4b58ca=_0x288b20;_0x445b9c['model']=_[_0x0c8e('0x3a')](db[_0x0c8e('0x5c')][_0x0c8e('0x37')]);_0x445b9c[_0x0c8e('0x3b')]=_[_0x0c8e('0x3a')](_0x48e5ba[_0x0c8e('0x3b')]);_0x445b9c[_0x0c8e('0x3c')]=_[_0x0c8e('0x3d')](_0x445b9c[_0x0c8e('0x39')],_0x445b9c[_0x0c8e('0x3b')]);_0x580642[_0x0c8e('0x3e')]=_[_0x0c8e('0x3d')](_0x445b9c[_0x0c8e('0x39')],qs[_0x0c8e('0x3f')](_0x48e5ba[_0x0c8e('0x3b')][_0x0c8e('0x3f')]));_0x580642[_0x0c8e('0x3e')]=_0x580642[_0x0c8e('0x3e')][_0x0c8e('0x40')]?_0x580642[_0x0c8e('0x3e')]:_0x445b9c[_0x0c8e('0x39')];_0x580642[_0x0c8e('0x42')]=qs[_0x0c8e('0x43')](_0x48e5ba[_0x0c8e('0x3b')][_0x0c8e('0x43')]);_0x580642[_0x0c8e('0x44')]=qs[_0x0c8e('0x3c')](_['pick'](_0x48e5ba[_0x0c8e('0x3b')],_0x445b9c[_0x0c8e('0x3c')]));if(_0x48e5ba[_0x0c8e('0x3b')][_0x0c8e('0x46')]){_0x580642[_0x0c8e('0x44')]=_[_0x0c8e('0x47')](_0x580642[_0x0c8e('0x44')],{'$or':_[_0x0c8e('0x35')](_0x580642[_0x0c8e('0x3e')],function(_0x3b9b23){var _0x58efed={};_0x58efed[_0x3b9b23]={'$like':'%'+_0x48e5ba[_0x0c8e('0x3b')]['filter']+'%'};return _0x58efed;})});}_0x580642=_[_0x0c8e('0x47')]({},_0x580642,_0x48e5ba[_0x0c8e('0x49')]);return _0x4b58ca[_0x0c8e('0x8a')](_0x580642);}})[_0x0c8e('0x2e')](function(_0x5296cf){if(_0x5296cf){_0x2862e0=_0x5296cf['length'];if(!_0x48e5ba[_0x0c8e('0x3b')][_0x0c8e('0x5b')](_0x0c8e('0x41'))){_0x580642[_0x0c8e('0x27')]=qs['limit'](_0x48e5ba[_0x0c8e('0x3b')][_0x0c8e('0x27')]);_0x580642[_0x0c8e('0x25')]=qs[_0x0c8e('0x25')](_0x48e5ba[_0x0c8e('0x3b')]['offset']);}return _0x4b58ca[_0x0c8e('0x8a')](_0x580642);}})[_0x0c8e('0x2e')](function(_0xfca998){if(_0xfca998){return _0xfca998?{'count':_0x2862e0,'rows':_0xfca998}:null;}})[_0x0c8e('0x2e')](respondWithResult(_0x657b68,null))[_0x0c8e('0x4e')](handleError(_0x657b68,null));};
\ No newline at end of file
index d8bc4cb..02937ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x351d=['events','../../mysqldb','SmsQueue','update','remove','emit','hasOwnProperty','exports'];(function(_0xce6f11,_0x3c3137){var _0x35b709=function(_0x1755c6){while(--_0x1755c6){_0xce6f11['push'](_0xce6f11['shift']());}};_0x35b709(++_0x3c3137);}(_0x351d,0x158));var _0xd351=function(_0x412125,_0xfda644){_0x412125=_0x412125-0x0;var _0x438593=_0x351d[_0x412125];return _0x438593;};'use strict';var EventEmitter=require(_0xd351('0x0'));var SmsQueue=require(_0xd351('0x1'))['db'][_0xd351('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xd351('0x3'),'afterDestroy':_0xd351('0x4')};function emitEvent(_0x11daa3){return function(_0x1e8e52,_0x3a5e62,_0xcc87bf){SmsQueueEvents[_0xd351('0x5')](_0x11daa3+':'+_0x1e8e52['id'],_0x1e8e52);SmsQueueEvents[_0xd351('0x5')](_0x11daa3,_0x1e8e52);_0xcc87bf(null);};}for(var e in events){if(events[_0xd351('0x6')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0xd351('0x7')]=SmsQueueEvents;
\ No newline at end of file
+var _0x1c93=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x1e6079,_0x16e32a){var _0x69192c=function(_0x3db628){while(--_0x3db628){_0x1e6079['push'](_0x1e6079['shift']());}};_0x69192c(++_0x16e32a);}(_0x1c93,0x1a6));var _0x31c9=function(_0x885042,_0x7ddb67){_0x885042=_0x885042-0x0;var _0x22c8f4=_0x1c93[_0x885042];return _0x22c8f4;};'use strict';var EventEmitter=require(_0x31c9('0x0'));var SmsQueue=require(_0x31c9('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x31c9('0x2')](0x0);var events={'afterCreate':_0x31c9('0x3'),'afterUpdate':_0x31c9('0x4'),'afterDestroy':_0x31c9('0x5')};function emitEvent(_0x5c5937){return function(_0x542306,_0x46749f,_0x28cb42){SmsQueueEvents[_0x31c9('0x6')](_0x5c5937+':'+_0x542306['id'],_0x542306);SmsQueueEvents[_0x31c9('0x6')](_0x5c5937,_0x542306);_0x28cb42(null);};}for(var e in events){if(events[_0x31c9('0x7')](e)){var event=events[e];SmsQueue[_0x31c9('0x8')](e,emitEvent(event));}}module['exports']=SmsQueueEvents;
\ No newline at end of file
index 01c5d24..bb87309 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4892=['util','api','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','define','SmsQueue','sms_queues','lodash'];(function(_0x2795d9,_0x28048c){var _0x4f32d0=function(_0x46b157){while(--_0x46b157){_0x2795d9['push'](_0x2795d9['shift']());}};_0x4f32d0(++_0x28048c);}(_0x4892,0x1ee));var _0x2489=function(_0x5386fa,_0x2c3331){_0x5386fa=_0x5386fa-0x0;var _0x516347=_0x4892[_0x5386fa];return _0x516347;};'use strict';var _=require(_0x2489('0x0'));var util=require(_0x2489('0x1'));var logger=require('../../config/logger')(_0x2489('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2489('0x3'));var fs=require('fs');var path=require(_0x2489('0x4'));var rimraf=require(_0x2489('0x5'));var config=require(_0x2489('0x6'));var attributes=require(_0x2489('0x7'));module['exports']=function(_0x158453,_0x5bcd39){return _0x158453[_0x2489('0x8')](_0x2489('0x9'),attributes,{'tableName':_0x2489('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd43f=['path','rimraf','../../config/environment','./smsQueue.attributes','define','SmsQueue','util','../../config/logger','api','moment','bluebird'];(function(_0x1ee6ff,_0x1790b6){var _0x1a0922=function(_0x3230d5){while(--_0x3230d5){_0x1ee6ff['push'](_0x1ee6ff['shift']());}};_0x1a0922(++_0x1790b6);}(_0xd43f,0xf8));var _0xfd43=function(_0x1dc1ea,_0x44ab67){_0x1dc1ea=_0x1dc1ea-0x0;var _0x44e0e2=_0xd43f[_0x1dc1ea];return _0x44e0e2;};'use strict';var _=require('lodash');var util=require(_0xfd43('0x0'));var logger=require(_0xfd43('0x1'))(_0xfd43('0x2'));var moment=require(_0xfd43('0x3'));var BPromise=require(_0xfd43('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfd43('0x5'));var rimraf=require(_0xfd43('0x6'));var config=require(_0xfd43('0x7'));var attributes=require(_0xfd43('0x8'));module['exports']=function(_0x1cb7de,_0x119971){return _0x1cb7de[_0xfd43('0x9')](_0xfd43('0xa'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6bcb9ef..328f1b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8fe1=['SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','SmsQueue,\x20%s,\x20%s','catch','GetSmsQueue','options','raw','where','attributes','limit','include','map','model','stringify','ShowSmsQueue','SmsQueue','find','then','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','register','info','debug'];(function(_0x48326a,_0x8cfa0c){var _0x466709=function(_0x5ab1b7){while(--_0x5ab1b7){_0x48326a['push'](_0x48326a['shift']());}};_0x466709(++_0x8cfa0c);}(_0x8fe1,0x15d));var _0x18fe=function(_0x401d67,_0xeb1592){_0x401d67=_0x401d67-0x0;var _0x25076b=_0x8fe1[_0x401d67];return _0x25076b;};'use strict';var _=require(_0x18fe('0x0'));var util=require(_0x18fe('0x1'));var moment=require('moment');var BPromise=require(_0x18fe('0x2'));var rs=require(_0x18fe('0x3'));var fs=require('fs');var Redis=require(_0x18fe('0x4'));var db=require(_0x18fe('0x5'))['db'];var utils=require(_0x18fe('0x6'));var logger=require(_0x18fe('0x7'))(_0x18fe('0x8'));var config=require(_0x18fe('0x9'));var jayson=require(_0x18fe('0xa'));var client=jayson['client'][_0x18fe('0xb')]({'port':0x232a});config['redis']=_[_0x18fe('0xc')](config[_0x18fe('0xd')],{'host':_0x18fe('0xe'),'port':0x18eb});var socket=require(_0x18fe('0xf'))(new Redis(config[_0x18fe('0xd')]));require(_0x18fe('0x10'))[_0x18fe('0x11')](socket);function respondWithRpcPromise(_0x31993e,_0x3a1c4,_0x2912f4){return new BPromise(function(_0x5c1149,_0x29993b){return client['request'](_0x31993e,_0x2912f4)['then'](function(_0x4c81cc){logger[_0x18fe('0x12')]('SmsQueue,\x20%s,\x20%s',_0x3a1c4,'request\x20sent');logger[_0x18fe('0x13')](_0x18fe('0x14'),_0x3a1c4,_0x18fe('0x15'),JSON['stringify'](_0x4c81cc));if(_0x4c81cc['error']){if(_0x4c81cc['error'][_0x18fe('0x16')]===0x1f4){logger[_0x18fe('0x17')]('SmsQueue,\x20%s,\x20%s',_0x3a1c4,_0x4c81cc['error']['message']);return _0x29993b(_0x4c81cc[_0x18fe('0x17')][_0x18fe('0x18')]);}logger[_0x18fe('0x17')](_0x18fe('0x19'),_0x3a1c4,_0x4c81cc[_0x18fe('0x17')][_0x18fe('0x18')]);return _0x5c1149(_0x4c81cc[_0x18fe('0x17')][_0x18fe('0x18')]);}else{logger[_0x18fe('0x12')]('SmsQueue,\x20%s,\x20%s',_0x3a1c4,'request\x20sent');_0x5c1149(_0x4c81cc['result'][_0x18fe('0x18')]);}})[_0x18fe('0x1a')](function(_0x432cd9){logger[_0x18fe('0x17')](_0x18fe('0x19'),_0x3a1c4,_0x432cd9);_0x29993b(_0x432cd9);});});}exports[_0x18fe('0x1b')]=function(_0x1c700d){var _0x1dc2a7=this;return new Promise(function(_0x4be3e9,_0x57d902){return db['SmsQueue']['findAll']({'raw':_0x1c700d['options']?_0x1c700d[_0x18fe('0x1c')][_0x18fe('0x1d')]===undefined?!![]:![]:!![],'where':_0x1c700d['options']?_0x1c700d['options'][_0x18fe('0x1e')]||null:null,'attributes':_0x1c700d[_0x18fe('0x1c')]?_0x1c700d[_0x18fe('0x1c')][_0x18fe('0x1f')]||null:null,'limit':_0x1c700d[_0x18fe('0x1c')]?_0x1c700d[_0x18fe('0x1c')][_0x18fe('0x20')]||null:null,'include':_0x1c700d['options']?_0x1c700d[_0x18fe('0x1c')][_0x18fe('0x21')]?_[_0x18fe('0x22')](_0x1c700d[_0x18fe('0x1c')][_0x18fe('0x21')],function(_0x40b51d){return{'model':db[_0x40b51d[_0x18fe('0x23')]],'as':_0x40b51d['as'],'attributes':_0x40b51d[_0x18fe('0x1f')],'include':_0x40b51d[_0x18fe('0x21')]?_[_0x18fe('0x22')](_0x40b51d['include'],function(_0x50510d){return{'model':db[_0x50510d[_0x18fe('0x23')]],'as':_0x50510d['as'],'attributes':_0x50510d[_0x18fe('0x1f')],'include':_0x50510d['include']?_[_0x18fe('0x22')](_0x50510d[_0x18fe('0x21')],function(_0x4dabac){return{'model':db[_0x4dabac['model']],'as':_0x4dabac['as'],'attributes':_0x4dabac['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fbd78){logger['info'](_0x18fe('0x1b'),_0x1c700d);logger[_0x18fe('0x13')](_0x18fe('0x1b'),_0x1c700d,JSON[_0x18fe('0x24')](_0x2fbd78));_0x4be3e9(_0x2fbd78);})[_0x18fe('0x1a')](function(_0x44d089){logger[_0x18fe('0x17')]('GetSmsQueue',_0x44d089[_0x18fe('0x18')],_0x1c700d);_0x57d902(_0x1dc2a7[_0x18fe('0x17')](0x1f4,_0x44d089['message']));});});};exports[_0x18fe('0x25')]=function(_0x3105f3){var _0x5174e0=this;return new Promise(function(_0x1c32ef,_0x581cd6){return db[_0x18fe('0x26')][_0x18fe('0x27')]({'raw':_0x3105f3[_0x18fe('0x1c')]?_0x3105f3[_0x18fe('0x1c')][_0x18fe('0x1d')]===undefined?!![]:![]:!![],'where':_0x3105f3[_0x18fe('0x1c')]?_0x3105f3['options'][_0x18fe('0x1e')]||null:null,'attributes':_0x3105f3['options']?_0x3105f3[_0x18fe('0x1c')][_0x18fe('0x1f')]||null:null,'include':_0x3105f3['options']?_0x3105f3[_0x18fe('0x1c')][_0x18fe('0x21')]?_['map'](_0x3105f3[_0x18fe('0x1c')][_0x18fe('0x21')],function(_0x51897c){return{'model':db[_0x51897c[_0x18fe('0x23')]],'as':_0x51897c['as'],'attributes':_0x51897c[_0x18fe('0x1f')],'include':_0x51897c['include']?_[_0x18fe('0x22')](_0x51897c[_0x18fe('0x21')],function(_0x632a5b){return{'model':db[_0x632a5b['model']],'as':_0x632a5b['as'],'attributes':_0x632a5b['attributes'],'include':_0x632a5b[_0x18fe('0x21')]?_[_0x18fe('0x22')](_0x632a5b[_0x18fe('0x21')],function(_0x49f9d4){return{'model':db[_0x49f9d4[_0x18fe('0x23')]],'as':_0x49f9d4['as'],'attributes':_0x49f9d4['attributes']};}):[]};}):[]};}):[]:[]})[_0x18fe('0x28')](function(_0x7d49f1){logger[_0x18fe('0x12')]('ShowSmsQueue',_0x3105f3);logger['debug']('ShowSmsQueue',_0x3105f3,JSON['stringify'](_0x7d49f1));_0x1c32ef(_0x7d49f1);})[_0x18fe('0x1a')](function(_0x2c7e02){logger['error'](_0x18fe('0x25'),_0x2c7e02['message'],_0x3105f3);_0x581cd6(_0x5174e0[_0x18fe('0x17')](0x1f4,_0x2c7e02[_0x18fe('0x18')]));});});};
\ No newline at end of file
+var _0x2f64=['lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','redis','localhost','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','include','map','model','catch','ShowSmsQueue'];(function(_0x1fe04b,_0x5a5df4){var _0x6e3283=function(_0x38645a){while(--_0x38645a){_0x1fe04b['push'](_0x1fe04b['shift']());}};_0x6e3283(++_0x5a5df4);}(_0x2f64,0xde));var _0x42f6=function(_0x122d66,_0x1052f7){_0x122d66=_0x122d66-0x0;var _0x9f0faa=_0x2f64[_0x122d66];return _0x9f0faa;};'use strict';var _=require(_0x42f6('0x0'));var util=require('util');var moment=require(_0x42f6('0x1'));var BPromise=require(_0x42f6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x42f6('0x3'))['db'];var utils=require(_0x42f6('0x4'));var logger=require(_0x42f6('0x5'))(_0x42f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x42f6('0x7'));var client=jayson['client'][_0x42f6('0x8')]({'port':0x232a});config['redis']=_[_0x42f6('0x9')](config[_0x42f6('0xa')],{'host':_0x42f6('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x42f6('0xa')]));require(_0x42f6('0xc'))[_0x42f6('0xd')](socket);function respondWithRpcPromise(_0x7447e7,_0x1c6cb0,_0x14513c){return new BPromise(function(_0x3c7720,_0x5da088){return client[_0x42f6('0xe')](_0x7447e7,_0x14513c)[_0x42f6('0xf')](function(_0x28e31f){logger[_0x42f6('0x10')](_0x42f6('0x11'),_0x1c6cb0,_0x42f6('0x12'));logger[_0x42f6('0x13')](_0x42f6('0x14'),_0x1c6cb0,_0x42f6('0x12'),JSON[_0x42f6('0x15')](_0x28e31f));if(_0x28e31f[_0x42f6('0x16')]){if(_0x28e31f[_0x42f6('0x16')]['code']===0x1f4){logger[_0x42f6('0x16')](_0x42f6('0x11'),_0x1c6cb0,_0x28e31f['error'][_0x42f6('0x17')]);return _0x5da088(_0x28e31f[_0x42f6('0x16')][_0x42f6('0x17')]);}logger[_0x42f6('0x16')](_0x42f6('0x11'),_0x1c6cb0,_0x28e31f['error']['message']);return _0x3c7720(_0x28e31f['error'][_0x42f6('0x17')]);}else{logger[_0x42f6('0x10')](_0x42f6('0x11'),_0x1c6cb0,_0x42f6('0x12'));_0x3c7720(_0x28e31f[_0x42f6('0x18')]['message']);}})['catch'](function(_0x1c6cf9){logger[_0x42f6('0x16')](_0x42f6('0x11'),_0x1c6cb0,_0x1c6cf9);_0x5da088(_0x1c6cf9);});});}exports[_0x42f6('0x19')]=function(_0x1d8c82){var _0x1ada19=this;return new Promise(function(_0x3af6cb,_0xa0718e){return db[_0x42f6('0x1a')][_0x42f6('0x1b')]({'raw':_0x1d8c82[_0x42f6('0x1c')]?_0x1d8c82['options'][_0x42f6('0x1d')]===undefined?!![]:![]:!![],'where':_0x1d8c82[_0x42f6('0x1c')]?_0x1d8c82['options'][_0x42f6('0x1e')]||null:null,'attributes':_0x1d8c82['options']?_0x1d8c82[_0x42f6('0x1c')][_0x42f6('0x1f')]||null:null,'limit':_0x1d8c82[_0x42f6('0x1c')]?_0x1d8c82[_0x42f6('0x1c')]['limit']||null:null,'include':_0x1d8c82[_0x42f6('0x1c')]?_0x1d8c82[_0x42f6('0x1c')][_0x42f6('0x20')]?_[_0x42f6('0x21')](_0x1d8c82[_0x42f6('0x1c')]['include'],function(_0x50b184){return{'model':db[_0x50b184[_0x42f6('0x22')]],'as':_0x50b184['as'],'attributes':_0x50b184[_0x42f6('0x1f')],'include':_0x50b184[_0x42f6('0x20')]?_[_0x42f6('0x21')](_0x50b184[_0x42f6('0x20')],function(_0x1507f2){return{'model':db[_0x1507f2[_0x42f6('0x22')]],'as':_0x1507f2['as'],'attributes':_0x1507f2['attributes'],'include':_0x1507f2[_0x42f6('0x20')]?_['map'](_0x1507f2[_0x42f6('0x20')],function(_0x434554){return{'model':db[_0x434554[_0x42f6('0x22')]],'as':_0x434554['as'],'attributes':_0x434554[_0x42f6('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x42f6('0xf')](function(_0x3993fa){logger[_0x42f6('0x10')](_0x42f6('0x19'),_0x1d8c82);logger[_0x42f6('0x13')]('GetSmsQueue',_0x1d8c82,JSON[_0x42f6('0x15')](_0x3993fa));_0x3af6cb(_0x3993fa);})[_0x42f6('0x23')](function(_0x2c306d){logger[_0x42f6('0x16')]('GetSmsQueue',_0x2c306d[_0x42f6('0x17')],_0x1d8c82);_0xa0718e(_0x1ada19['error'](0x1f4,_0x2c306d[_0x42f6('0x17')]));});});};exports[_0x42f6('0x24')]=function(_0x43a25f){var _0x17eb2f=this;return new Promise(function(_0x16865a,_0x1fcb88){return db[_0x42f6('0x1a')]['find']({'raw':_0x43a25f[_0x42f6('0x1c')]?_0x43a25f[_0x42f6('0x1c')][_0x42f6('0x1d')]===undefined?!![]:![]:!![],'where':_0x43a25f[_0x42f6('0x1c')]?_0x43a25f[_0x42f6('0x1c')]['where']||null:null,'attributes':_0x43a25f[_0x42f6('0x1c')]?_0x43a25f[_0x42f6('0x1c')][_0x42f6('0x1f')]||null:null,'include':_0x43a25f[_0x42f6('0x1c')]?_0x43a25f[_0x42f6('0x1c')][_0x42f6('0x20')]?_[_0x42f6('0x21')](_0x43a25f[_0x42f6('0x1c')][_0x42f6('0x20')],function(_0x16c2ee){return{'model':db[_0x16c2ee[_0x42f6('0x22')]],'as':_0x16c2ee['as'],'attributes':_0x16c2ee['attributes'],'include':_0x16c2ee[_0x42f6('0x20')]?_[_0x42f6('0x21')](_0x16c2ee[_0x42f6('0x20')],function(_0x1a54de){return{'model':db[_0x1a54de['model']],'as':_0x1a54de['as'],'attributes':_0x1a54de[_0x42f6('0x1f')],'include':_0x1a54de[_0x42f6('0x20')]?_[_0x42f6('0x21')](_0x1a54de[_0x42f6('0x20')],function(_0x574bf7){return{'model':db[_0x574bf7['model']],'as':_0x574bf7['as'],'attributes':_0x574bf7[_0x42f6('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x42f6('0xf')](function(_0x5bbb94){logger['info'](_0x42f6('0x24'),_0x43a25f);logger[_0x42f6('0x13')]('ShowSmsQueue',_0x43a25f,JSON['stringify'](_0x5bbb94));_0x16865a(_0x5bbb94);})[_0x42f6('0x23')](function(_0x1ddcb7){logger[_0x42f6('0x16')](_0x42f6('0x24'),_0x1ddcb7[_0x42f6('0x17')],_0x43a25f);_0x1fcb88(_0x17eb2f[_0x42f6('0x16')](0x1f4,_0x1ddcb7['message']));});});};
\ No newline at end of file
index 62bceee..5c4d4e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x23d7=['save','emit','register','length','smsQueue:','./smsQueue.events'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x23d7,0x6b));var _0x723d=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0x23d7[_0x32b542];return _0x554d54;};'use strict';var SmsQueueEvents=require(_0x723d('0x0'));var events=[_0x723d('0x1'),'remove','update'];function createListener(_0x24fc87,_0x29a00e){return function(_0xe58e0){_0x29a00e[_0x723d('0x2')](_0x24fc87,_0xe58e0);};}function removeListener(_0x5d30e1,_0xc15764){return function(){SmsQueueEvents['removeListener'](_0x5d30e1,_0xc15764);};}exports[_0x723d('0x3')]=function(_0x2f0d2d){for(var _0xd6655c=0x0,_0x4e7e58=events[_0x723d('0x4')];_0xd6655c<_0x4e7e58;_0xd6655c++){var _0x3d2ba3=events[_0xd6655c];var _0x54ab33=createListener(_0x723d('0x5')+_0x3d2ba3,_0x2f0d2d);SmsQueueEvents['on'](_0x3d2ba3,_0x54ab33);}};
\ No newline at end of file
+var _0xf233=['update','removeListener','register','length','smsQueue:','./smsQueue.events','remove'];(function(_0x122be6,_0x3c622a){var _0x3fcb2d=function(_0xf41888){while(--_0xf41888){_0x122be6['push'](_0x122be6['shift']());}};_0x3fcb2d(++_0x3c622a);}(_0xf233,0x14e));var _0x3f23=function(_0x3852bd,_0x198218){_0x3852bd=_0x3852bd-0x0;var _0x5001fb=_0xf233[_0x3852bd];return _0x5001fb;};'use strict';var SmsQueueEvents=require(_0x3f23('0x0'));var events=['save',_0x3f23('0x1'),_0x3f23('0x2')];function createListener(_0x681bcf,_0x2aefae){return function(_0x507741){_0x2aefae['emit'](_0x681bcf,_0x507741);};}function removeListener(_0xb6e5bc,_0xc125e3){return function(){SmsQueueEvents[_0x3f23('0x3')](_0xb6e5bc,_0xc125e3);};}exports[_0x3f23('0x4')]=function(_0x3d4371){for(var _0x40612c=0x0,_0x53443d=events[_0x3f23('0x5')];_0x40612c<_0x53443d;_0x40612c++){var _0x16fe79=events[_0x40612c];var _0x1f5da0=createListener(_0x3f23('0x6')+_0x16fe79,_0x3d4371);SmsQueueEvents['on'](_0x16fe79,_0x1f5da0);}};
\ No newline at end of file
index 09c787a..7a24721 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea44=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','update','delete','destroy'];(function(_0x3f4dd9,_0xe0b819){var _0x31c54a=function(_0x25e6c6){while(--_0x25e6c6){_0x3f4dd9['push'](_0x3f4dd9['shift']());}};_0x31c54a(++_0xe0b819);}(_0xea44,0x1a5));var _0x4ea4=function(_0x38f2c1,_0xb079c3){_0x38f2c1=_0x38f2c1-0x0;var _0x16b118=_0xea44[_0x38f2c1];return _0x16b118;};'use strict';var multer=require(_0x4ea4('0x0'));var util=require(_0x4ea4('0x1'));var path=require(_0x4ea4('0x2'));var timeout=require(_0x4ea4('0x3'));var express=require('express');var router=express[_0x4ea4('0x4')]();var fs_extra=require(_0x4ea4('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4ea4('0x6'));var config=require(_0x4ea4('0x7'));var controller=require(_0x4ea4('0x8'));router[_0x4ea4('0x9')]('/',auth['isAuthenticated'](),controller[_0x4ea4('0xa')]);router[_0x4ea4('0x9')](_0x4ea4('0xb'),auth[_0x4ea4('0xc')](),controller[_0x4ea4('0xd')]);router[_0x4ea4('0x9')](_0x4ea4('0xe'),auth[_0x4ea4('0xc')](),controller[_0x4ea4('0xf')]);router['post']('/',auth[_0x4ea4('0xc')](),controller['create']);router['put'](_0x4ea4('0xe'),auth['isAuthenticated'](),controller[_0x4ea4('0x10')]);router[_0x4ea4('0x11')](_0x4ea4('0xe'),auth[_0x4ea4('0xc')](),controller[_0x4ea4('0x12')]);module[_0x4ea4('0x13')]=router;
\ No newline at end of file
+var _0xabcb=['/:id','post','create','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabcb,0xf9));var _0xbabc=function(_0x386ccb,_0x5be86c){_0x386ccb=_0x386ccb-0x0;var _0x5acbf8=_0xabcb[_0x386ccb];return _0x5acbf8;};'use strict';var multer=require('multer');var util=require(_0xbabc('0x0'));var path=require(_0xbabc('0x1'));var timeout=require(_0xbabc('0x2'));var express=require(_0xbabc('0x3'));var router=express[_0xbabc('0x4')]();var fs_extra=require(_0xbabc('0x5'));var auth=require(_0xbabc('0x6'));var interaction=require(_0xbabc('0x7'));var config=require(_0xbabc('0x8'));var controller=require(_0xbabc('0x9'));router[_0xbabc('0xa')]('/',auth[_0xbabc('0xb')](),controller[_0xbabc('0xc')]);router[_0xbabc('0xa')](_0xbabc('0xd'),auth[_0xbabc('0xb')](),controller[_0xbabc('0xe')]);router[_0xbabc('0xa')](_0xbabc('0xf'),auth[_0xbabc('0xb')](),controller['show']);router[_0xbabc('0x10')]('/',auth[_0xbabc('0xb')](),controller[_0xbabc('0x11')]);router['put'](_0xbabc('0xf'),auth[_0xbabc('0xb')](),controller[_0xbabc('0x12')]);router[_0xbabc('0x13')]('/:id',auth[_0xbabc('0xb')](),controller[_0xbabc('0x14')]);module[_0xbabc('0x15')]=router;
\ No newline at end of file
index 0faf2f4..64dd736 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a45=['exports','STRING','DATE'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0x9a45,0x11d));var _0x59a4=function(_0x5d3467,_0x522183){_0x5d3467=_0x5d3467-0x0;var _0x1b385b=_0x9a45[_0x5d3467];return _0x1b385b;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x59a4('0x0')]={'uniqueid':{'type':Sequelize[_0x59a4('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x59a4('0x1')]},'joinAt':{'type':Sequelize[_0x59a4('0x2')]},'leaveAt':{'type':Sequelize[_0x59a4('0x2')]},'acceptAt':{'type':Sequelize[_0x59a4('0x2')]},'exitAt':{'type':Sequelize[_0x59a4('0x2')]},'reason':{'type':Sequelize[_0x59a4('0x1')]}};
\ No newline at end of file
+var _0xc195=['sequelize','DATE','STRING','moment'];(function(_0x547ff4,_0x416fa1){var _0xe41057=function(_0x1afe63){while(--_0x1afe63){_0x547ff4['push'](_0x547ff4['shift']());}};_0xe41057(++_0x416fa1);}(_0xc195,0x6f));var _0x5c19=function(_0x27c068,_0x342981){_0x27c068=_0x27c068-0x0;var _0xe5a67f=_0xc195[_0x27c068];return _0xe5a67f;};'use strict';var moment=require(_0x5c19('0x0'));var Sequelize=require(_0x5c19('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x5c19('0x2')]},'leaveAt':{'type':Sequelize[_0x5c19('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x5c19('0x3')]}};
\ No newline at end of file
index ac42613..ef92a8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9049=['error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','findAll','catch','show','params','SmsQueueReport','include','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','sendStatus'];(function(_0x5e52f3,_0x28bbd1){var _0xe3edf6=function(_0x482ace){while(--_0x482ace){_0x5e52f3['push'](_0x5e52f3['shift']());}};_0xe3edf6(++_0x28bbd1);}(_0x9049,0x107));var _0x9904=function(_0x5dfd69,_0x19b114){_0x5dfd69=_0x5dfd69-0x0;var _0x583690=_0x9049[_0x5dfd69];return _0x583690;};'use strict';var emlformat=require(_0x9904('0x0'));var rimraf=require(_0x9904('0x1'));var zipdir=require(_0x9904('0x2'));var jsonpatch=require(_0x9904('0x3'));var rp=require(_0x9904('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9904('0x5'));var util=require(_0x9904('0x6'));var path=require('path');var sox=require(_0x9904('0x7'));var csv=require('to-csv');var ejs=require(_0x9904('0x8'));var fs=require('fs');var fs_extra=require(_0x9904('0x9'));var _=require(_0x9904('0xa'));var squel=require(_0x9904('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9904('0xc'));var toCsv=require(_0x9904('0xd'));var querystring=require(_0x9904('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9904('0xf'));var qs=require(_0x9904('0x10'));var as=require(_0x9904('0x11'));var hardwareService=require(_0x9904('0x12'));var logger=require(_0x9904('0x13'))('api');var utils=require(_0x9904('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x9904('0x15'));var db=require(_0x9904('0x16'))['db'];function respondWithStatusCode(_0xbb218e,_0x460863){_0x460863=_0x460863||0xcc;return function(_0x1c6a49){if(_0x1c6a49){return _0xbb218e['sendStatus'](_0x460863);}return _0xbb218e[_0x9904('0x17')](_0x460863)[_0x9904('0x18')]();};}function respondWithResult(_0x350834,_0x220e1d){_0x220e1d=_0x220e1d||0xc8;return function(_0x32afde){if(_0x32afde){return _0x350834[_0x9904('0x17')](_0x220e1d)[_0x9904('0x19')](_0x32afde);}};}function respondWithFilteredResult(_0x46f644,_0x4ecd18){return function(_0x48ad2c){if(_0x48ad2c){var _0x466a50=typeof _0x4ecd18[_0x9904('0x1a')]===_0x9904('0x1b')&&typeof _0x4ecd18[_0x9904('0x1c')]===_0x9904('0x1b');var _0xbc19f0=_0x48ad2c[_0x9904('0x1d')];var _0x181ccf=_0x466a50?0x0:_0x4ecd18['offset'];var _0x124e06=_0x466a50?_0x48ad2c['count']:_0x4ecd18[_0x9904('0x1a')]+_0x4ecd18[_0x9904('0x1c')];var _0x565781;if(_0x124e06>=_0xbc19f0){_0x124e06=_0xbc19f0;_0x565781=0xc8;}else{_0x565781=0xce;}_0x46f644[_0x9904('0x17')](_0x565781);return _0x46f644[_0x9904('0x1e')]('Content-Range',_0x181ccf+'-'+_0x124e06+'/'+_0xbc19f0)[_0x9904('0x19')](_0x48ad2c);}return null;};}function patchUpdates(_0x449d83){return function(_0x5d073c){try{jsonpatch[_0x9904('0x1f')](_0x5d073c,_0x449d83,!![]);}catch(_0x1d5789){return BPromise[_0x9904('0x20')](_0x1d5789);}return _0x5d073c[_0x9904('0x21')]();};}function saveUpdates(_0x516eec,_0x361bd0){return function(_0x4995fb){if(_0x4995fb){return _0x4995fb[_0x9904('0x22')](_0x516eec)[_0x9904('0x23')](function(_0x3addcc){return _0x3addcc;});}return null;};}function removeEntity(_0x341dd1,_0x1a539d){return function(_0x1fd998){if(_0x1fd998){return _0x1fd998['destroy']()['then'](function(){_0x341dd1['status'](0xcc)[_0x9904('0x18')]();});}};}function handleEntityNotFound(_0x8ecc98,_0x2aa064){return function(_0x4ebfe1){if(!_0x4ebfe1){_0x8ecc98[_0x9904('0x24')](0x194);}return _0x4ebfe1;};}function handleError(_0x571e65,_0x5ca20e){_0x5ca20e=_0x5ca20e||0x1f4;return function(_0x5ae0c7){logger[_0x9904('0x25')](_0x5ae0c7[_0x9904('0x26')]);if(_0x5ae0c7[_0x9904('0x27')]){delete _0x5ae0c7[_0x9904('0x27')];}_0x571e65[_0x9904('0x17')](_0x5ca20e)[_0x9904('0x28')](_0x5ae0c7);};}exports[_0x9904('0x29')]=function(_0x147f29,_0x1b1c6a){var _0x203aa6={},_0x39c331={},_0x403879={'count':0x0,'rows':[]};var _0x450ffb=_[_0x9904('0x2a')](db['SmsQueueReport'][_0x9904('0x2b')],function(_0x4326cc){return{'name':_0x4326cc['fieldName'],'type':_0x4326cc[_0x9904('0x2c')][_0x9904('0x2d')]};});_0x39c331[_0x9904('0x2e')]=_[_0x9904('0x2a')](_0x450ffb,_0x9904('0x27'));_0x39c331[_0x9904('0x2f')]=_[_0x9904('0x30')](_0x147f29['query']);_0x39c331[_0x9904('0x31')]=_[_0x9904('0x32')](_0x39c331[_0x9904('0x2e')],_0x39c331[_0x9904('0x2f')]);_0x203aa6[_0x9904('0x33')]=_['intersection'](_0x39c331[_0x9904('0x2e')],qs[_0x9904('0x34')](_0x147f29[_0x9904('0x2f')][_0x9904('0x34')]));_0x203aa6['attributes']=_0x203aa6['attributes'][_0x9904('0x35')]?_0x203aa6[_0x9904('0x33')]:_0x39c331[_0x9904('0x2e')];if(!_0x147f29[_0x9904('0x2f')][_0x9904('0x36')](_0x9904('0x37'))){_0x203aa6[_0x9904('0x1c')]=qs['limit'](_0x147f29[_0x9904('0x2f')][_0x9904('0x1c')]);_0x203aa6[_0x9904('0x1a')]=qs[_0x9904('0x1a')](_0x147f29[_0x9904('0x2f')][_0x9904('0x1a')]);}_0x203aa6[_0x9904('0x38')]=qs[_0x9904('0x39')](_0x147f29[_0x9904('0x2f')][_0x9904('0x39')]);_0x203aa6['where']=qs[_0x9904('0x31')](_[_0x9904('0x3a')](_0x147f29[_0x9904('0x2f')],_0x39c331[_0x9904('0x31')]),_0x450ffb);if(_0x147f29[_0x9904('0x2f')][_0x9904('0x3b')]){_0x203aa6[_0x9904('0x3c')]=_['merge'](_0x203aa6[_0x9904('0x3c')],{'$or':_[_0x9904('0x2a')](_0x450ffb,function(_0x124874){if(_0x124874[_0x9904('0x2c')]!==_0x9904('0x3d')){var _0x590ccc={};_0x590ccc[_0x124874[_0x9904('0x27')]]={'$like':'%'+_0x147f29[_0x9904('0x2f')]['filter']+'%'};return _0x590ccc;}})});}_0x203aa6=_[_0x9904('0x3e')]({},_0x203aa6,_0x147f29['options']);var _0x1e8b0d={'where':_0x203aa6[_0x9904('0x3c')]};return db['SmsQueueReport'][_0x9904('0x1d')](_0x1e8b0d)[_0x9904('0x23')](function(_0x1d4d1a){_0x403879[_0x9904('0x1d')]=_0x1d4d1a;if(_0x147f29[_0x9904('0x2f')]['includeAll']){_0x203aa6['include']=[{'all':!![]}];}return db['SmsQueueReport'][_0x9904('0x3f')](_0x203aa6);})[_0x9904('0x23')](function(_0x15f09a){_0x403879['rows']=_0x15f09a;return _0x403879;})[_0x9904('0x23')](respondWithFilteredResult(_0x1b1c6a,_0x203aa6))[_0x9904('0x40')](handleError(_0x1b1c6a,null));};exports[_0x9904('0x41')]=function(_0x366bca,_0x4d12dc){var _0x5ac14a={'raw':!![],'where':{'id':_0x366bca[_0x9904('0x42')]['id']}},_0x1dfb34={};_0x1dfb34['model']=_['keys'](db[_0x9904('0x43')]['rawAttributes']);_0x1dfb34[_0x9904('0x2f')]=_['keys'](_0x366bca['query']);_0x1dfb34[_0x9904('0x31')]=_[_0x9904('0x32')](_0x1dfb34[_0x9904('0x2e')],_0x1dfb34[_0x9904('0x2f')]);_0x5ac14a[_0x9904('0x33')]=_[_0x9904('0x32')](_0x1dfb34[_0x9904('0x2e')],qs[_0x9904('0x34')](_0x366bca[_0x9904('0x2f')][_0x9904('0x34')]));_0x5ac14a[_0x9904('0x33')]=_0x5ac14a[_0x9904('0x33')][_0x9904('0x35')]?_0x5ac14a[_0x9904('0x33')]:_0x1dfb34[_0x9904('0x2e')];if(_0x366bca[_0x9904('0x2f')]['includeAll']){_0x5ac14a[_0x9904('0x44')]=[{'all':!![]}];}_0x5ac14a=_['merge']({},_0x5ac14a,_0x366bca[_0x9904('0x45')]);return db[_0x9904('0x43')][_0x9904('0x46')](_0x5ac14a)[_0x9904('0x23')](handleEntityNotFound(_0x4d12dc,null))[_0x9904('0x23')](respondWithResult(_0x4d12dc,null))[_0x9904('0x40')](handleError(_0x4d12dc,null));};exports[_0x9904('0x47')]=function(_0x5a178a,_0x4dc42e){return db[_0x9904('0x43')]['create'](_0x5a178a[_0x9904('0x48')],{})['then'](respondWithResult(_0x4dc42e,0xc9))[_0x9904('0x40')](handleError(_0x4dc42e,null));};exports[_0x9904('0x22')]=function(_0x5d6d6f,_0x389d20){if(_0x5d6d6f[_0x9904('0x48')]['id']){delete _0x5d6d6f['body']['id'];}return db[_0x9904('0x43')][_0x9904('0x46')]({'where':{'id':_0x5d6d6f[_0x9904('0x42')]['id']}})['then'](handleEntityNotFound(_0x389d20,null))['then'](saveUpdates(_0x5d6d6f[_0x9904('0x48')],null))[_0x9904('0x23')](respondWithResult(_0x389d20,null))['catch'](handleError(_0x389d20,null));};exports[_0x9904('0x49')]=function(_0x397352,_0x30db8){return db[_0x9904('0x43')]['find']({'where':{'id':_0x397352['params']['id']}})[_0x9904('0x23')](handleEntityNotFound(_0x30db8,null))[_0x9904('0x23')](removeEntity(_0x30db8,null))['catch'](handleError(_0x30db8,null));};exports[_0x9904('0x4a')]=function(_0x275da2,_0x5be829){return db[_0x9904('0x43')]['describe']()[_0x9904('0x23')](respondWithResult(_0x5be829,null))[_0x9904('0x40')](handleError(_0x5be829,null));};
\ No newline at end of file
+var _0xcc65=['nolimit','order','sort','filter','where','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','update','destroy','describe','eml-format','zip-dir','request-promise','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','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','set','Content-Range','json','apply','reject','then','stack','name','send','index','map','SmsQueueReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty'];(function(_0xfe7c86,_0xf1e6f6){var _0x2dfa62=function(_0x2266c7){while(--_0x2266c7){_0xfe7c86['push'](_0xfe7c86['shift']());}};_0x2dfa62(++_0xf1e6f6);}(_0xcc65,0x1eb));var _0x5cc6=function(_0x158e6c,_0xaab4ed){_0x158e6c=_0x158e6c-0x0;var _0x3c26db=_0xcc65[_0x158e6c];return _0x3c26db;};'use strict';var emlformat=require(_0x5cc6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5cc6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5cc6('0x2'));var moment=require('moment');var BPromise=require(_0x5cc6('0x3'));var Mustache=require(_0x5cc6('0x4'));var util=require(_0x5cc6('0x5'));var path=require(_0x5cc6('0x6'));var sox=require(_0x5cc6('0x7'));var csv=require(_0x5cc6('0x8'));var ejs=require(_0x5cc6('0x9'));var fs=require('fs');var fs_extra=require(_0x5cc6('0xa'));var _=require(_0x5cc6('0xb'));var squel=require(_0x5cc6('0xc'));var crypto=require(_0x5cc6('0xd'));var jsforce=require(_0x5cc6('0xe'));var deskjs=require(_0x5cc6('0xf'));var toCsv=require('to-csv');var querystring=require(_0x5cc6('0x10'));var Papa=require(_0x5cc6('0x11'));var Redis=require(_0x5cc6('0x12'));var authService=require(_0x5cc6('0x13'));var qs=require(_0x5cc6('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5cc6('0x15'));var logger=require(_0x5cc6('0x16'))(_0x5cc6('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5cc6('0x18'));var db=require(_0x5cc6('0x19'))['db'];function respondWithStatusCode(_0x34b17c,_0x248187){_0x248187=_0x248187||0xcc;return function(_0x3411e9){if(_0x3411e9){return _0x34b17c[_0x5cc6('0x1a')](_0x248187);}return _0x34b17c[_0x5cc6('0x1b')](_0x248187)[_0x5cc6('0x1c')]();};}function respondWithResult(_0x51a9a8,_0x49251e){_0x49251e=_0x49251e||0xc8;return function(_0x477982){if(_0x477982){return _0x51a9a8[_0x5cc6('0x1b')](_0x49251e)['json'](_0x477982);}};}function respondWithFilteredResult(_0x118eb0,_0x93ac7e){return function(_0x1d0139){if(_0x1d0139){var _0x497b5c=typeof _0x93ac7e['offset']===_0x5cc6('0x1d')&&typeof _0x93ac7e[_0x5cc6('0x1e')]===_0x5cc6('0x1d');var _0x1fc81e=_0x1d0139['count'];var _0x505c63=_0x497b5c?0x0:_0x93ac7e[_0x5cc6('0x1f')];var _0x2595ba=_0x497b5c?_0x1d0139['count']:_0x93ac7e[_0x5cc6('0x1f')]+_0x93ac7e[_0x5cc6('0x1e')];var _0x16fc45;if(_0x2595ba>=_0x1fc81e){_0x2595ba=_0x1fc81e;_0x16fc45=0xc8;}else{_0x16fc45=0xce;}_0x118eb0[_0x5cc6('0x1b')](_0x16fc45);return _0x118eb0[_0x5cc6('0x20')](_0x5cc6('0x21'),_0x505c63+'-'+_0x2595ba+'/'+_0x1fc81e)[_0x5cc6('0x22')](_0x1d0139);}return null;};}function patchUpdates(_0x555ccd){return function(_0x23711c){try{jsonpatch[_0x5cc6('0x23')](_0x23711c,_0x555ccd,!![]);}catch(_0x5c10e1){return BPromise[_0x5cc6('0x24')](_0x5c10e1);}return _0x23711c['save']();};}function saveUpdates(_0x316c06,_0x3e8118){return function(_0x3a3944){if(_0x3a3944){return _0x3a3944['update'](_0x316c06)[_0x5cc6('0x25')](function(_0x5fca71){return _0x5fca71;});}return null;};}function removeEntity(_0x635a86,_0x211377){return function(_0x4fc0ef){if(_0x4fc0ef){return _0x4fc0ef['destroy']()[_0x5cc6('0x25')](function(){_0x635a86[_0x5cc6('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3adacd,_0x24f2f4){return function(_0x52c4fb){if(!_0x52c4fb){_0x3adacd['sendStatus'](0x194);}return _0x52c4fb;};}function handleError(_0x14f8d5,_0x43dde1){_0x43dde1=_0x43dde1||0x1f4;return function(_0x448ea2){logger['error'](_0x448ea2[_0x5cc6('0x26')]);if(_0x448ea2[_0x5cc6('0x27')]){delete _0x448ea2[_0x5cc6('0x27')];}_0x14f8d5[_0x5cc6('0x1b')](_0x43dde1)[_0x5cc6('0x28')](_0x448ea2);};}exports[_0x5cc6('0x29')]=function(_0x5a3dda,_0x515441){var _0x2ca6f5={},_0x4afe5d={},_0x5e37af={'count':0x0,'rows':[]};var _0x4c7874=_[_0x5cc6('0x2a')](db[_0x5cc6('0x2b')]['rawAttributes'],function(_0x3033eb){return{'name':_0x3033eb[_0x5cc6('0x2c')],'type':_0x3033eb[_0x5cc6('0x2d')][_0x5cc6('0x2e')]};});_0x4afe5d[_0x5cc6('0x2f')]=_[_0x5cc6('0x2a')](_0x4c7874,_0x5cc6('0x27'));_0x4afe5d[_0x5cc6('0x30')]=_[_0x5cc6('0x31')](_0x5a3dda[_0x5cc6('0x30')]);_0x4afe5d[_0x5cc6('0x32')]=_['intersection'](_0x4afe5d[_0x5cc6('0x2f')],_0x4afe5d[_0x5cc6('0x30')]);_0x2ca6f5[_0x5cc6('0x33')]=_[_0x5cc6('0x34')](_0x4afe5d[_0x5cc6('0x2f')],qs['fields'](_0x5a3dda[_0x5cc6('0x30')][_0x5cc6('0x35')]));_0x2ca6f5['attributes']=_0x2ca6f5['attributes']['length']?_0x2ca6f5[_0x5cc6('0x33')]:_0x4afe5d[_0x5cc6('0x2f')];if(!_0x5a3dda[_0x5cc6('0x30')][_0x5cc6('0x36')](_0x5cc6('0x37'))){_0x2ca6f5[_0x5cc6('0x1e')]=qs[_0x5cc6('0x1e')](_0x5a3dda[_0x5cc6('0x30')][_0x5cc6('0x1e')]);_0x2ca6f5[_0x5cc6('0x1f')]=qs[_0x5cc6('0x1f')](_0x5a3dda[_0x5cc6('0x30')][_0x5cc6('0x1f')]);}_0x2ca6f5[_0x5cc6('0x38')]=qs[_0x5cc6('0x39')](_0x5a3dda[_0x5cc6('0x30')][_0x5cc6('0x39')]);_0x2ca6f5['where']=qs['filters'](_['pick'](_0x5a3dda[_0x5cc6('0x30')],_0x4afe5d[_0x5cc6('0x32')]),_0x4c7874);if(_0x5a3dda['query'][_0x5cc6('0x3a')]){_0x2ca6f5[_0x5cc6('0x3b')]=_[_0x5cc6('0x3c')](_0x2ca6f5[_0x5cc6('0x3b')],{'$or':_[_0x5cc6('0x2a')](_0x4c7874,function(_0x3571fa){if(_0x3571fa['type']!==_0x5cc6('0x3d')){var _0x218595={};_0x218595[_0x3571fa[_0x5cc6('0x27')]]={'$like':'%'+_0x5a3dda[_0x5cc6('0x30')][_0x5cc6('0x3a')]+'%'};return _0x218595;}})});}_0x2ca6f5=_['merge']({},_0x2ca6f5,_0x5a3dda['options']);var _0x170157={'where':_0x2ca6f5['where']};return db[_0x5cc6('0x2b')][_0x5cc6('0x3e')](_0x170157)[_0x5cc6('0x25')](function(_0x2d6ab6){_0x5e37af[_0x5cc6('0x3e')]=_0x2d6ab6;if(_0x5a3dda[_0x5cc6('0x30')][_0x5cc6('0x3f')]){_0x2ca6f5[_0x5cc6('0x40')]=[{'all':!![]}];}return db[_0x5cc6('0x2b')][_0x5cc6('0x41')](_0x2ca6f5);})[_0x5cc6('0x25')](function(_0x2fe2cf){_0x5e37af[_0x5cc6('0x42')]=_0x2fe2cf;return _0x5e37af;})[_0x5cc6('0x25')](respondWithFilteredResult(_0x515441,_0x2ca6f5))[_0x5cc6('0x43')](handleError(_0x515441,null));};exports[_0x5cc6('0x44')]=function(_0x3b5730,_0x56ccb7){var _0x39be7e={'raw':!![],'where':{'id':_0x3b5730[_0x5cc6('0x45')]['id']}},_0x32f690={};_0x32f690[_0x5cc6('0x2f')]=_['keys'](db[_0x5cc6('0x2b')][_0x5cc6('0x46')]);_0x32f690[_0x5cc6('0x30')]=_[_0x5cc6('0x31')](_0x3b5730[_0x5cc6('0x30')]);_0x32f690[_0x5cc6('0x32')]=_[_0x5cc6('0x34')](_0x32f690[_0x5cc6('0x2f')],_0x32f690[_0x5cc6('0x30')]);_0x39be7e['attributes']=_[_0x5cc6('0x34')](_0x32f690[_0x5cc6('0x2f')],qs['fields'](_0x3b5730[_0x5cc6('0x30')][_0x5cc6('0x35')]));_0x39be7e['attributes']=_0x39be7e[_0x5cc6('0x33')]['length']?_0x39be7e[_0x5cc6('0x33')]:_0x32f690[_0x5cc6('0x2f')];if(_0x3b5730[_0x5cc6('0x30')][_0x5cc6('0x3f')]){_0x39be7e[_0x5cc6('0x40')]=[{'all':!![]}];}_0x39be7e=_[_0x5cc6('0x3c')]({},_0x39be7e,_0x3b5730[_0x5cc6('0x47')]);return db[_0x5cc6('0x2b')][_0x5cc6('0x48')](_0x39be7e)['then'](handleEntityNotFound(_0x56ccb7,null))[_0x5cc6('0x25')](respondWithResult(_0x56ccb7,null))['catch'](handleError(_0x56ccb7,null));};exports['create']=function(_0x578803,_0x116313){return db['SmsQueueReport'][_0x5cc6('0x49')](_0x578803[_0x5cc6('0x4a')],{})[_0x5cc6('0x25')](respondWithResult(_0x116313,0xc9))[_0x5cc6('0x43')](handleError(_0x116313,null));};exports[_0x5cc6('0x4b')]=function(_0x2283cb,_0x6ee3ff){if(_0x2283cb[_0x5cc6('0x4a')]['id']){delete _0x2283cb[_0x5cc6('0x4a')]['id'];}return db[_0x5cc6('0x2b')]['find']({'where':{'id':_0x2283cb['params']['id']}})[_0x5cc6('0x25')](handleEntityNotFound(_0x6ee3ff,null))[_0x5cc6('0x25')](saveUpdates(_0x2283cb[_0x5cc6('0x4a')],null))[_0x5cc6('0x25')](respondWithResult(_0x6ee3ff,null))[_0x5cc6('0x43')](handleError(_0x6ee3ff,null));};exports[_0x5cc6('0x4c')]=function(_0x436f19,_0x228806){return db[_0x5cc6('0x2b')][_0x5cc6('0x48')]({'where':{'id':_0x436f19['params']['id']}})[_0x5cc6('0x25')](handleEntityNotFound(_0x228806,null))['then'](removeEntity(_0x228806,null))[_0x5cc6('0x43')](handleError(_0x228806,null));};exports['describe']=function(_0x1f2d39,_0x4215c1){return db[_0x5cc6('0x2b')][_0x5cc6('0x4d')]()[_0x5cc6('0x25')](respondWithResult(_0x4215c1,null))[_0x5cc6('0x43')](handleError(_0x4215c1,null));};
\ No newline at end of file
index 6b027ec..fa7898a 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(_0x5346b2,_0x4c1259){var _0x3f899c=function(_0x5a01a2){while(--_0x5a01a2){_0x5346b2['push'](_0x5346b2['shift']());}};_0x3f899c(++_0x4c1259);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2f3ecd,_0x57976b){_0x2f3ecd=_0x2f3ecd-0x0;var _0xffdc44=_0xcb91[_0x2f3ecd];return _0xffdc44;};'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 _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x231bb4,_0x2e5f46){var _0x5a3f19=function(_0x3401dc){while(--_0x3401dc){_0x231bb4['push'](_0x231bb4['shift']());}};_0x5a3f19(++_0x2e5f46);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbaf0[_0x5ddb1c];return _0x354adc;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 5eebd93..b481194 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01bb=['catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','debug','update','raw','where','limit','UpdateSmsQueueReport','stringify','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x3e186f,_0x2eb7be){var _0x3595bf=function(_0x5cb578){while(--_0x5cb578){_0x3e186f['push'](_0x3e186f['shift']());}};_0x3595bf(++_0x2eb7be);}(_0x01bb,0x12d));var _0xb01b=function(_0x88302c,_0x3d7390){_0x88302c=_0x88302c-0x0;var _0x2661b1=_0x01bb[_0x88302c];return _0x2661b1;};'use strict';var _=require(_0xb01b('0x0'));var util=require('util');var moment=require(_0xb01b('0x1'));var BPromise=require('bluebird');var rs=require(_0xb01b('0x2'));var fs=require('fs');var Redis=require(_0xb01b('0x3'));var db=require(_0xb01b('0x4'))['db'];var utils=require(_0xb01b('0x5'));var logger=require(_0xb01b('0x6'))(_0xb01b('0x7'));var config=require('../../config/environment');var jayson=require(_0xb01b('0x8'));var client=jayson[_0xb01b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45d06f,_0x3072f4,_0x11772f){return new BPromise(function(_0x5a4c4b,_0x1cefee){return client[_0xb01b('0xa')](_0x45d06f,_0x11772f)[_0xb01b('0xb')](function(_0x142a33){logger[_0xb01b('0xc')](_0xb01b('0xd'),_0x3072f4,_0xb01b('0xe'));logger['debug'](_0xb01b('0xf'),_0x3072f4,'request\x20sent',JSON['stringify'](_0x142a33));if(_0x142a33[_0xb01b('0x10')]){if(_0x142a33['error']['code']===0x1f4){logger['error'](_0xb01b('0xd'),_0x3072f4,_0x142a33[_0xb01b('0x10')][_0xb01b('0x11')]);return _0x1cefee(_0x142a33[_0xb01b('0x10')]['message']);}logger[_0xb01b('0x10')]('SmsQueueReport,\x20%s,\x20%s',_0x3072f4,_0x142a33['error'][_0xb01b('0x11')]);return _0x5a4c4b(_0x142a33['error'][_0xb01b('0x11')]);}else{logger['info'](_0xb01b('0xd'),_0x3072f4,'request\x20sent');_0x5a4c4b(_0x142a33[_0xb01b('0x12')][_0xb01b('0x11')]);}})[_0xb01b('0x13')](function(_0x42c30c){logger[_0xb01b('0x10')](_0xb01b('0xd'),_0x3072f4,_0x42c30c);_0x1cefee(_0x42c30c);});});}exports[_0xb01b('0x14')]=function(_0x4a1189){var _0x2240fa=this;return new Promise(function(_0x56456d,_0x46d139){return db[_0xb01b('0x15')][_0xb01b('0x16')](_0x4a1189[_0xb01b('0x17')],{'raw':_0x4a1189[_0xb01b('0x18')]?_0x4a1189[_0xb01b('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x23c52d){logger['info'](_0xb01b('0x14'),_0x4a1189);logger[_0xb01b('0x19')](_0xb01b('0x14'),_0x4a1189,JSON['stringify'](_0x23c52d));_0x56456d(_0x23c52d);})[_0xb01b('0x13')](function(_0x4e4a02){logger[_0xb01b('0x10')](_0xb01b('0x14'),_0x4e4a02[_0xb01b('0x11')],_0x4a1189);_0x46d139(_0x2240fa[_0xb01b('0x10')](0x1f4,_0x4e4a02['message']));});});};exports['UpdateSmsQueueReport']=function(_0x55a6dc){var _0x114d31=this;return new Promise(function(_0x55c879,_0x891f91){return db[_0xb01b('0x15')][_0xb01b('0x1a')](_0x55a6dc[_0xb01b('0x17')],{'raw':_0x55a6dc[_0xb01b('0x18')]?_0x55a6dc[_0xb01b('0x18')][_0xb01b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55a6dc['options']?_0x55a6dc[_0xb01b('0x18')][_0xb01b('0x1c')]||null:null,'attributes':_0x55a6dc['options']?_0x55a6dc[_0xb01b('0x18')]['attributes']||null:null,'limit':_0x55a6dc[_0xb01b('0x18')]?_0x55a6dc[_0xb01b('0x18')][_0xb01b('0x1d')]||null:null})['then'](function(_0x6b2d8d){logger['info'](_0xb01b('0x1e'),_0x55a6dc);logger[_0xb01b('0x19')](_0xb01b('0x1e'),_0x55a6dc,JSON[_0xb01b('0x1f')](_0x6b2d8d));_0x55c879(_0x6b2d8d);})[_0xb01b('0x13')](function(_0x238f4e){logger[_0xb01b('0x10')](_0xb01b('0x1e'),_0x238f4e[_0xb01b('0x11')],_0x55a6dc);_0x891f91(_0x114d31[_0xb01b('0x10')](0x1f4,_0x238f4e[_0xb01b('0x11')]));});});};
\ No newline at end of file
+var _0x424e=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','info','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsQueueReport,\x20%s,\x20%s','message','request\x20sent','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','then','UpdateSmsQueueReport','update','where','attributes','limit'];(function(_0x2059a5,_0x52f75e){var _0x121e5a=function(_0xb02439){while(--_0xb02439){_0x2059a5['push'](_0x2059a5['shift']());}};_0x121e5a(++_0x52f75e);}(_0x424e,0x88));var _0xe424=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0x424e[_0x456fb1];return _0x4083d6;};'use strict';var _=require('lodash');var util=require(_0xe424('0x0'));var moment=require(_0xe424('0x1'));var BPromise=require(_0xe424('0x2'));var rs=require(_0xe424('0x3'));var fs=require('fs');var Redis=require(_0xe424('0x4'));var db=require(_0xe424('0x5'))['db'];var utils=require(_0xe424('0x6'));var logger=require(_0xe424('0x7'))(_0xe424('0x8'));var config=require(_0xe424('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe424('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7f698e,_0x2b448f,_0x1ce40c){return new BPromise(function(_0x5ebe48,_0x4bc674){return client['request'](_0x7f698e,_0x1ce40c)['then'](function(_0x4b7138){logger[_0xe424('0xb')]('SmsQueueReport,\x20%s,\x20%s',_0x2b448f,'request\x20sent');logger[_0xe424('0xc')](_0xe424('0xd'),_0x2b448f,'request\x20sent',JSON[_0xe424('0xe')](_0x4b7138));if(_0x4b7138['error']){if(_0x4b7138[_0xe424('0xf')][_0xe424('0x10')]===0x1f4){logger[_0xe424('0xf')](_0xe424('0x11'),_0x2b448f,_0x4b7138[_0xe424('0xf')][_0xe424('0x12')]);return _0x4bc674(_0x4b7138['error'][_0xe424('0x12')]);}logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x2b448f,_0x4b7138[_0xe424('0xf')][_0xe424('0x12')]);return _0x5ebe48(_0x4b7138[_0xe424('0xf')][_0xe424('0x12')]);}else{logger[_0xe424('0xb')]('SmsQueueReport,\x20%s,\x20%s',_0x2b448f,_0xe424('0x13'));_0x5ebe48(_0x4b7138[_0xe424('0x14')][_0xe424('0x12')]);}})[_0xe424('0x15')](function(_0x3272fc){logger[_0xe424('0xf')](_0xe424('0x11'),_0x2b448f,_0x3272fc);_0x4bc674(_0x3272fc);});});}exports[_0xe424('0x16')]=function(_0xd12b0c){var _0x5c1ca4=this;return new Promise(function(_0x3756f3,_0x5bf26b){return db[_0xe424('0x17')][_0xe424('0x18')](_0xd12b0c[_0xe424('0x19')],{'raw':_0xd12b0c[_0xe424('0x1a')]?_0xd12b0c[_0xe424('0x1a')][_0xe424('0x1b')]===undefined?!![]:![]:!![]})[_0xe424('0x1c')](function(_0x4554f1){logger['info'](_0xe424('0x16'),_0xd12b0c);logger[_0xe424('0xc')](_0xe424('0x16'),_0xd12b0c,JSON[_0xe424('0xe')](_0x4554f1));_0x3756f3(_0x4554f1);})[_0xe424('0x15')](function(_0x304a5b){logger[_0xe424('0xf')](_0xe424('0x16'),_0x304a5b[_0xe424('0x12')],_0xd12b0c);_0x5bf26b(_0x5c1ca4['error'](0x1f4,_0x304a5b[_0xe424('0x12')]));});});};exports[_0xe424('0x1d')]=function(_0x395451){var _0x1e27c3=this;return new Promise(function(_0x2f9515,_0xaedcdb){return db[_0xe424('0x17')][_0xe424('0x1e')](_0x395451[_0xe424('0x19')],{'raw':_0x395451[_0xe424('0x1a')]?_0x395451[_0xe424('0x1a')][_0xe424('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x395451[_0xe424('0x1a')]?_0x395451[_0xe424('0x1a')][_0xe424('0x1f')]||null:null,'attributes':_0x395451[_0xe424('0x1a')]?_0x395451['options'][_0xe424('0x20')]||null:null,'limit':_0x395451[_0xe424('0x1a')]?_0x395451['options'][_0xe424('0x21')]||null:null})[_0xe424('0x1c')](function(_0x5920dc){logger['info'](_0xe424('0x1d'),_0x395451);logger['debug'](_0xe424('0x1d'),_0x395451,JSON[_0xe424('0xe')](_0x5920dc));_0x2f9515(_0x5920dc);})[_0xe424('0x15')](function(_0x19dba7){logger[_0xe424('0xf')](_0xe424('0x1d'),_0x19dba7['message'],_0x395451);_0xaedcdb(_0x1e27c3[_0xe424('0xf')](0x1f4,_0x19dba7['message']));});});};
\ No newline at end of file
index 9c69eb5..ecd340a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb99=['create','put','update','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../config/environment','./smsTransferReport.controller','isAuthenticated','get','/describe','describe','/:id','show'];(function(_0x53ed97,_0x1b32fd){var _0x5eb20e=function(_0x40fc0a){while(--_0x40fc0a){_0x53ed97['push'](_0x53ed97['shift']());}};_0x5eb20e(++_0x1b32fd);}(_0xcb99,0x8b));var _0x9cb9=function(_0x9fb085,_0x2251a3){_0x9fb085=_0x9fb085-0x0;var _0x400c75=_0xcb99[_0x9fb085];return _0x400c75;};'use strict';var multer=require(_0x9cb9('0x0'));var util=require('util');var path=require(_0x9cb9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9cb9('0x2')]();var fs_extra=require(_0x9cb9('0x3'));var auth=require(_0x9cb9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9cb9('0x5'));var controller=require(_0x9cb9('0x6'));router['get']('/',auth[_0x9cb9('0x7')](),controller['index']);router[_0x9cb9('0x8')](_0x9cb9('0x9'),auth[_0x9cb9('0x7')](),controller[_0x9cb9('0xa')]);router[_0x9cb9('0x8')](_0x9cb9('0xb'),auth[_0x9cb9('0x7')](),controller[_0x9cb9('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9cb9('0xd')]);router[_0x9cb9('0xe')](_0x9cb9('0xb'),auth['isAuthenticated'](),controller[_0x9cb9('0xf')]);router[_0x9cb9('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x9cb9('0x11')]);module[_0x9cb9('0x12')]=router;
\ No newline at end of file
+var _0x4b84=['update','delete','destroy','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/describe','describe','isAuthenticated','show','post','create','put','/:id'];(function(_0x3428b3,_0x4396cc){var _0x4474ad=function(_0x5df2bc){while(--_0x5df2bc){_0x3428b3['push'](_0x3428b3['shift']());}};_0x4474ad(++_0x4396cc);}(_0x4b84,0x1cc));var _0x44b8=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0x4b84[_0x2576d7];return _0x16a08c;};'use strict';var multer=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x44b8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x44b8('0x3'));var interaction=require(_0x44b8('0x4'));var config=require(_0x44b8('0x5'));var controller=require('./smsTransferReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x44b8('0x6')]);router['get'](_0x44b8('0x7'),auth['isAuthenticated'](),controller[_0x44b8('0x8')]);router['get']('/:id',auth[_0x44b8('0x9')](),controller[_0x44b8('0xa')]);router[_0x44b8('0xb')]('/',auth['isAuthenticated'](),controller[_0x44b8('0xc')]);router[_0x44b8('0xd')](_0x44b8('0xe'),auth[_0x44b8('0x9')](),controller[_0x44b8('0xf')]);router[_0x44b8('0x10')](_0x44b8('0xe'),auth['isAuthenticated'](),controller[_0x44b8('0x11')]);module[_0x44b8('0x12')]=router;
\ No newline at end of file
index 4a72097..d1d52a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x41504b,_0x1586f7){var _0x4102f7=function(_0x33b340){while(--_0x33b340){_0x41504b['push'](_0x41504b['shift']());}};_0x4102f7(++_0x1586f7);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x109371,_0x441c8e){_0x109371=_0x109371-0x0;var _0x4fd858=_0xf3cd[_0x109371];return _0x4fd858;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x54d2dc,_0x3ef26f){var _0x2ec83c=function(_0xadd008){while(--_0xadd008){_0x54d2dc['push'](_0x54d2dc['shift']());}};_0x2ec83c(++_0x3ef26f);}(_0xaa88,0x137));var _0x8aa8=function(_0x4629ed,_0x59ef85){_0x4629ed=_0x4629ed-0x0;var _0x52ca04=_0xaa88[_0x4629ed];return _0x52ca04;};'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 618335c..4d81279 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbee5=['attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','update','then','error','stack','name','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields'];(function(_0x37cb29,_0x11cbbe){var _0x4679fc=function(_0x4e46fd){while(--_0x4e46fd){_0x37cb29['push'](_0x37cb29['shift']());}};_0x4679fc(++_0x11cbbe);}(_0xbee5,0x17a));var _0x5bee=function(_0x283d6b,_0x2fb286){_0x283d6b=_0x283d6b-0x0;var _0x21ee6c=_0xbee5[_0x283d6b];return _0x21ee6c;};'use strict';var emlformat=require(_0x5bee('0x0'));var rimraf=require(_0x5bee('0x1'));var zipdir=require(_0x5bee('0x2'));var jsonpatch=require(_0x5bee('0x3'));var rp=require('request-promise');var moment=require(_0x5bee('0x4'));var BPromise=require(_0x5bee('0x5'));var Mustache=require(_0x5bee('0x6'));var util=require(_0x5bee('0x7'));var path=require('path');var sox=require(_0x5bee('0x8'));var csv=require(_0x5bee('0x9'));var ejs=require(_0x5bee('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5bee('0xb'));var squel=require('squel');var crypto=require(_0x5bee('0xc'));var jsforce=require(_0x5bee('0xd'));var deskjs=require(_0x5bee('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5bee('0xf'));var Redis=require('ioredis');var authService=require(_0x5bee('0x10'));var qs=require(_0x5bee('0x11'));var as=require(_0x5bee('0x12'));var hardwareService=require(_0x5bee('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x5bee('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x5bee('0x15'))['db'];function respondWithStatusCode(_0x55a914,_0x4ab827){_0x4ab827=_0x4ab827||0xcc;return function(_0x300764){if(_0x300764){return _0x55a914[_0x5bee('0x16')](_0x4ab827);}return _0x55a914[_0x5bee('0x17')](_0x4ab827)['end']();};}function respondWithResult(_0x134eca,_0x52c663){_0x52c663=_0x52c663||0xc8;return function(_0x33dc91){if(_0x33dc91){return _0x134eca[_0x5bee('0x17')](_0x52c663)['json'](_0x33dc91);}};}function respondWithFilteredResult(_0x370de9,_0x2adc54){return function(_0x10c7c0){if(_0x10c7c0){var _0x12cd90=typeof _0x2adc54[_0x5bee('0x18')]===_0x5bee('0x19')&&typeof _0x2adc54[_0x5bee('0x1a')]==='undefined';var _0x21eb6f=_0x10c7c0[_0x5bee('0x1b')];var _0x2e50d5=_0x12cd90?0x0:_0x2adc54[_0x5bee('0x18')];var _0x177d5d=_0x12cd90?_0x10c7c0[_0x5bee('0x1b')]:_0x2adc54[_0x5bee('0x18')]+_0x2adc54[_0x5bee('0x1a')];var _0x87f2f4;if(_0x177d5d>=_0x21eb6f){_0x177d5d=_0x21eb6f;_0x87f2f4=0xc8;}else{_0x87f2f4=0xce;}_0x370de9[_0x5bee('0x17')](_0x87f2f4);return _0x370de9[_0x5bee('0x1c')]('Content-Range',_0x2e50d5+'-'+_0x177d5d+'/'+_0x21eb6f)[_0x5bee('0x1d')](_0x10c7c0);}return null;};}function patchUpdates(_0xfe40){return function(_0xf0ed06){try{jsonpatch[_0x5bee('0x1e')](_0xf0ed06,_0xfe40,!![]);}catch(_0x278725){return BPromise[_0x5bee('0x1f')](_0x278725);}return _0xf0ed06['save']();};}function saveUpdates(_0x1bdfd5,_0x15a475){return function(_0x5d009e){if(_0x5d009e){return _0x5d009e[_0x5bee('0x20')](_0x1bdfd5)[_0x5bee('0x21')](function(_0x5ccf30){return _0x5ccf30;});}return null;};}function removeEntity(_0x2874f8,_0x57b5cb){return function(_0x191b82){if(_0x191b82){return _0x191b82['destroy']()[_0x5bee('0x21')](function(){_0x2874f8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16fbc8,_0x2624b7){return function(_0x42d361){if(!_0x42d361){_0x16fbc8[_0x5bee('0x16')](0x194);}return _0x42d361;};}function handleError(_0xf3eda3,_0x4d9362){_0x4d9362=_0x4d9362||0x1f4;return function(_0x429c09){logger[_0x5bee('0x22')](_0x429c09[_0x5bee('0x23')]);if(_0x429c09[_0x5bee('0x24')]){delete _0x429c09[_0x5bee('0x24')];}_0xf3eda3[_0x5bee('0x17')](_0x4d9362)['send'](_0x429c09);};}exports['index']=function(_0x4e7dd5,_0x7f8df9){var _0x1ff884={},_0x2d6984={},_0x318ad1={'count':0x0,'rows':[]};var _0x187d2a=_[_0x5bee('0x25')](db[_0x5bee('0x26')][_0x5bee('0x27')],function(_0x51b720){return{'name':_0x51b720[_0x5bee('0x28')],'type':_0x51b720[_0x5bee('0x29')][_0x5bee('0x2a')]};});_0x2d6984[_0x5bee('0x2b')]=_[_0x5bee('0x25')](_0x187d2a,'name');_0x2d6984[_0x5bee('0x2c')]=_['keys'](_0x4e7dd5[_0x5bee('0x2c')]);_0x2d6984[_0x5bee('0x2d')]=_[_0x5bee('0x2e')](_0x2d6984[_0x5bee('0x2b')],_0x2d6984[_0x5bee('0x2c')]);_0x1ff884['attributes']=_[_0x5bee('0x2e')](_0x2d6984['model'],qs[_0x5bee('0x2f')](_0x4e7dd5['query'][_0x5bee('0x2f')]));_0x1ff884[_0x5bee('0x30')]=_0x1ff884[_0x5bee('0x30')][_0x5bee('0x31')]?_0x1ff884[_0x5bee('0x30')]:_0x2d6984['model'];if(!_0x4e7dd5[_0x5bee('0x2c')][_0x5bee('0x32')](_0x5bee('0x33'))){_0x1ff884['limit']=qs[_0x5bee('0x1a')](_0x4e7dd5[_0x5bee('0x2c')][_0x5bee('0x1a')]);_0x1ff884['offset']=qs[_0x5bee('0x18')](_0x4e7dd5[_0x5bee('0x2c')][_0x5bee('0x18')]);}_0x1ff884[_0x5bee('0x34')]=qs[_0x5bee('0x35')](_0x4e7dd5[_0x5bee('0x2c')][_0x5bee('0x35')]);_0x1ff884[_0x5bee('0x36')]=qs['filters'](_['pick'](_0x4e7dd5['query'],_0x2d6984[_0x5bee('0x2d')]),_0x187d2a);if(_0x4e7dd5['query'][_0x5bee('0x37')]){_0x1ff884[_0x5bee('0x36')]=_[_0x5bee('0x38')](_0x1ff884['where'],{'$or':_[_0x5bee('0x25')](_0x187d2a,function(_0x228a35){if(_0x228a35[_0x5bee('0x29')]!==_0x5bee('0x39')){var _0x49bebd={};_0x49bebd[_0x228a35[_0x5bee('0x24')]]={'$like':'%'+_0x4e7dd5['query'][_0x5bee('0x37')]+'%'};return _0x49bebd;}})});}_0x1ff884=_[_0x5bee('0x38')]({},_0x1ff884,_0x4e7dd5[_0x5bee('0x3a')]);var _0x518b0c={'where':_0x1ff884[_0x5bee('0x36')]};return db[_0x5bee('0x26')][_0x5bee('0x1b')](_0x518b0c)[_0x5bee('0x21')](function(_0x3dc12c){_0x318ad1[_0x5bee('0x1b')]=_0x3dc12c;if(_0x4e7dd5[_0x5bee('0x2c')][_0x5bee('0x3b')]){_0x1ff884[_0x5bee('0x3c')]=[{'all':!![]}];}return db[_0x5bee('0x26')][_0x5bee('0x3d')](_0x1ff884);})['then'](function(_0x19f429){_0x318ad1[_0x5bee('0x3e')]=_0x19f429;return _0x318ad1;})[_0x5bee('0x21')](respondWithFilteredResult(_0x7f8df9,_0x1ff884))[_0x5bee('0x3f')](handleError(_0x7f8df9,null));};exports[_0x5bee('0x40')]=function(_0x323e94,_0x35842f){var _0x294e28={'raw':!![],'where':{'id':_0x323e94['params']['id']}},_0x229fb5={};_0x229fb5['model']=_[_0x5bee('0x41')](db[_0x5bee('0x26')][_0x5bee('0x27')]);_0x229fb5[_0x5bee('0x2c')]=_[_0x5bee('0x41')](_0x323e94[_0x5bee('0x2c')]);_0x229fb5[_0x5bee('0x2d')]=_['intersection'](_0x229fb5[_0x5bee('0x2b')],_0x229fb5[_0x5bee('0x2c')]);_0x294e28[_0x5bee('0x30')]=_[_0x5bee('0x2e')](_0x229fb5[_0x5bee('0x2b')],qs[_0x5bee('0x2f')](_0x323e94[_0x5bee('0x2c')][_0x5bee('0x2f')]));_0x294e28[_0x5bee('0x30')]=_0x294e28[_0x5bee('0x30')]['length']?_0x294e28['attributes']:_0x229fb5['model'];if(_0x323e94[_0x5bee('0x2c')]['includeAll']){_0x294e28[_0x5bee('0x3c')]=[{'all':!![]}];}_0x294e28=_[_0x5bee('0x38')]({},_0x294e28,_0x323e94[_0x5bee('0x3a')]);return db[_0x5bee('0x26')][_0x5bee('0x42')](_0x294e28)['then'](handleEntityNotFound(_0x35842f,null))[_0x5bee('0x21')](respondWithResult(_0x35842f,null))[_0x5bee('0x3f')](handleError(_0x35842f,null));};exports['create']=function(_0x14e040,_0x2694bd){return db[_0x5bee('0x26')][_0x5bee('0x43')](_0x14e040[_0x5bee('0x44')],{})[_0x5bee('0x21')](respondWithResult(_0x2694bd,0xc9))['catch'](handleError(_0x2694bd,null));};exports[_0x5bee('0x20')]=function(_0x5f0c91,_0x30b7fe){if(_0x5f0c91[_0x5bee('0x44')]['id']){delete _0x5f0c91[_0x5bee('0x44')]['id'];}return db[_0x5bee('0x26')]['find']({'where':{'id':_0x5f0c91[_0x5bee('0x45')]['id']}})[_0x5bee('0x21')](handleEntityNotFound(_0x30b7fe,null))['then'](saveUpdates(_0x5f0c91[_0x5bee('0x44')],null))[_0x5bee('0x21')](respondWithResult(_0x30b7fe,null))[_0x5bee('0x3f')](handleError(_0x30b7fe,null));};exports['destroy']=function(_0x28f02f,_0x4304f6){return db[_0x5bee('0x26')][_0x5bee('0x42')]({'where':{'id':_0x28f02f[_0x5bee('0x45')]['id']}})['then'](handleEntityNotFound(_0x4304f6,null))[_0x5bee('0x21')](removeEntity(_0x4304f6,null))[_0x5bee('0x3f')](handleError(_0x4304f6,null));};exports[_0x5bee('0x46')]=function(_0x136c08,_0x29e087){return db[_0x5bee('0x26')][_0x5bee('0x46')]()[_0x5bee('0x21')](respondWithResult(_0x29e087,null))[_0x5bee('0x3f')](handleError(_0x29e087,null));};
\ No newline at end of file
+var _0x1323=['keys','query','filters','intersection','fields','attributes','order','sort','where','filter','type','VIRTUAL','name','merge','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','lodash','squel','crypto','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','json','reject','save','update','then','destroy','stack','SmsTransferReport','rawAttributes','fieldName','key','model','map'];(function(_0x228641,_0x25d636){var _0x5d5d78=function(_0x4d5c6c){while(--_0x4d5c6c){_0x228641['push'](_0x228641['shift']());}};_0x5d5d78(++_0x25d636);}(_0x1323,0x1e8));var _0x3132=function(_0x3451c6,_0xe33897){_0x3451c6=_0x3451c6-0x0;var _0x210f29=_0x1323[_0x3451c6];return _0x210f29;};'use strict';var emlformat=require(_0x3132('0x0'));var rimraf=require(_0x3132('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3132('0x2'));var rp=require('request-promise');var moment=require(_0x3132('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3132('0x4'));var util=require(_0x3132('0x5'));var path=require(_0x3132('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3132('0x7'));var squel=require(_0x3132('0x8'));var crypto=require(_0x3132('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3132('0xa'));var querystring=require(_0x3132('0xb'));var Papa=require('papaparse');var Redis=require(_0x3132('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x3132('0xd'));var as=require(_0x3132('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3132('0xf'))('api');var utils=require(_0x3132('0x10'));var config=require(_0x3132('0x11'));var licenseUtil=require(_0x3132('0x12'));var db=require(_0x3132('0x13'))['db'];function respondWithStatusCode(_0x167ccc,_0x4388db){_0x4388db=_0x4388db||0xcc;return function(_0x4e874e){if(_0x4e874e){return _0x167ccc[_0x3132('0x14')](_0x4388db);}return _0x167ccc[_0x3132('0x15')](_0x4388db)['end']();};}function respondWithResult(_0x4b8491,_0x440a29){_0x440a29=_0x440a29||0xc8;return function(_0x3bc444){if(_0x3bc444){return _0x4b8491[_0x3132('0x15')](_0x440a29)['json'](_0x3bc444);}};}function respondWithFilteredResult(_0x1e64ec,_0x4a65d0){return function(_0x151e46){if(_0x151e46){var _0x2adfba=typeof _0x4a65d0[_0x3132('0x16')]===_0x3132('0x17')&&typeof _0x4a65d0['limit']===_0x3132('0x17');var _0x183581=_0x151e46[_0x3132('0x18')];var _0x7d8a06=_0x2adfba?0x0:_0x4a65d0[_0x3132('0x16')];var _0xff86b9=_0x2adfba?_0x151e46['count']:_0x4a65d0['offset']+_0x4a65d0[_0x3132('0x19')];var _0x16ff49;if(_0xff86b9>=_0x183581){_0xff86b9=_0x183581;_0x16ff49=0xc8;}else{_0x16ff49=0xce;}_0x1e64ec[_0x3132('0x15')](_0x16ff49);return _0x1e64ec[_0x3132('0x1a')]('Content-Range',_0x7d8a06+'-'+_0xff86b9+'/'+_0x183581)[_0x3132('0x1b')](_0x151e46);}return null;};}function patchUpdates(_0x17df2e){return function(_0x37ac03){try{jsonpatch['apply'](_0x37ac03,_0x17df2e,!![]);}catch(_0x2790d8){return BPromise[_0x3132('0x1c')](_0x2790d8);}return _0x37ac03[_0x3132('0x1d')]();};}function saveUpdates(_0x4ba838,_0x2acedb){return function(_0x3f0aba){if(_0x3f0aba){return _0x3f0aba[_0x3132('0x1e')](_0x4ba838)[_0x3132('0x1f')](function(_0x5daca1){return _0x5daca1;});}return null;};}function removeEntity(_0x4ff465,_0x13d05c){return function(_0x1ffbb1){if(_0x1ffbb1){return _0x1ffbb1[_0x3132('0x20')]()[_0x3132('0x1f')](function(){_0x4ff465[_0x3132('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c8573,_0x57ad29){return function(_0x20f237){if(!_0x20f237){_0x5c8573[_0x3132('0x14')](0x194);}return _0x20f237;};}function handleError(_0x1a7555,_0xe9ed0e){_0xe9ed0e=_0xe9ed0e||0x1f4;return function(_0x305afd){logger['error'](_0x305afd[_0x3132('0x21')]);if(_0x305afd['name']){delete _0x305afd['name'];}_0x1a7555[_0x3132('0x15')](_0xe9ed0e)['send'](_0x305afd);};}exports['index']=function(_0x47dd95,_0x2447a2){var _0xd32fbf={},_0x259d7a={},_0x5703af={'count':0x0,'rows':[]};var _0x58ca8a=_['map'](db[_0x3132('0x22')][_0x3132('0x23')],function(_0x265b4c){return{'name':_0x265b4c[_0x3132('0x24')],'type':_0x265b4c['type'][_0x3132('0x25')]};});_0x259d7a[_0x3132('0x26')]=_[_0x3132('0x27')](_0x58ca8a,'name');_0x259d7a['query']=_[_0x3132('0x28')](_0x47dd95[_0x3132('0x29')]);_0x259d7a[_0x3132('0x2a')]=_[_0x3132('0x2b')](_0x259d7a['model'],_0x259d7a[_0x3132('0x29')]);_0xd32fbf['attributes']=_[_0x3132('0x2b')](_0x259d7a[_0x3132('0x26')],qs[_0x3132('0x2c')](_0x47dd95[_0x3132('0x29')]['fields']));_0xd32fbf[_0x3132('0x2d')]=_0xd32fbf[_0x3132('0x2d')]['length']?_0xd32fbf[_0x3132('0x2d')]:_0x259d7a['model'];if(!_0x47dd95[_0x3132('0x29')]['hasOwnProperty']('nolimit')){_0xd32fbf[_0x3132('0x19')]=qs['limit'](_0x47dd95[_0x3132('0x29')]['limit']);_0xd32fbf[_0x3132('0x16')]=qs[_0x3132('0x16')](_0x47dd95[_0x3132('0x29')]['offset']);}_0xd32fbf[_0x3132('0x2e')]=qs[_0x3132('0x2f')](_0x47dd95[_0x3132('0x29')]['sort']);_0xd32fbf[_0x3132('0x30')]=qs[_0x3132('0x2a')](_['pick'](_0x47dd95['query'],_0x259d7a[_0x3132('0x2a')]),_0x58ca8a);if(_0x47dd95[_0x3132('0x29')][_0x3132('0x31')]){_0xd32fbf[_0x3132('0x30')]=_['merge'](_0xd32fbf['where'],{'$or':_['map'](_0x58ca8a,function(_0x26c536){if(_0x26c536[_0x3132('0x32')]!==_0x3132('0x33')){var _0x333497={};_0x333497[_0x26c536[_0x3132('0x34')]]={'$like':'%'+_0x47dd95[_0x3132('0x29')][_0x3132('0x31')]+'%'};return _0x333497;}})});}_0xd32fbf=_[_0x3132('0x35')]({},_0xd32fbf,_0x47dd95[_0x3132('0x36')]);var _0x41ec1b={'where':_0xd32fbf[_0x3132('0x30')]};return db[_0x3132('0x22')]['count'](_0x41ec1b)[_0x3132('0x1f')](function(_0x4c006a){_0x5703af[_0x3132('0x18')]=_0x4c006a;if(_0x47dd95['query'][_0x3132('0x37')]){_0xd32fbf[_0x3132('0x38')]=[{'all':!![]}];}return db[_0x3132('0x22')][_0x3132('0x39')](_0xd32fbf);})[_0x3132('0x1f')](function(_0xf51b71){_0x5703af[_0x3132('0x3a')]=_0xf51b71;return _0x5703af;})['then'](respondWithFilteredResult(_0x2447a2,_0xd32fbf))[_0x3132('0x3b')](handleError(_0x2447a2,null));};exports['show']=function(_0x1374d8,_0x3edfda){var _0x3873de={'raw':!![],'where':{'id':_0x1374d8[_0x3132('0x3c')]['id']}},_0x398658={};_0x398658['model']=_['keys'](db['SmsTransferReport'][_0x3132('0x23')]);_0x398658[_0x3132('0x29')]=_['keys'](_0x1374d8[_0x3132('0x29')]);_0x398658[_0x3132('0x2a')]=_['intersection'](_0x398658[_0x3132('0x26')],_0x398658[_0x3132('0x29')]);_0x3873de[_0x3132('0x2d')]=_[_0x3132('0x2b')](_0x398658['model'],qs[_0x3132('0x2c')](_0x1374d8[_0x3132('0x29')][_0x3132('0x2c')]));_0x3873de[_0x3132('0x2d')]=_0x3873de[_0x3132('0x2d')][_0x3132('0x3d')]?_0x3873de['attributes']:_0x398658[_0x3132('0x26')];if(_0x1374d8[_0x3132('0x29')][_0x3132('0x37')]){_0x3873de[_0x3132('0x38')]=[{'all':!![]}];}_0x3873de=_[_0x3132('0x35')]({},_0x3873de,_0x1374d8[_0x3132('0x36')]);return db[_0x3132('0x22')][_0x3132('0x3e')](_0x3873de)[_0x3132('0x1f')](handleEntityNotFound(_0x3edfda,null))['then'](respondWithResult(_0x3edfda,null))[_0x3132('0x3b')](handleError(_0x3edfda,null));};exports[_0x3132('0x3f')]=function(_0xd4533b,_0x330007){return db['SmsTransferReport']['create'](_0xd4533b['body'],{})['then'](respondWithResult(_0x330007,0xc9))[_0x3132('0x3b')](handleError(_0x330007,null));};exports[_0x3132('0x1e')]=function(_0x2b5bde,_0xc324b3){if(_0x2b5bde['body']['id']){delete _0x2b5bde[_0x3132('0x40')]['id'];}return db[_0x3132('0x22')][_0x3132('0x3e')]({'where':{'id':_0x2b5bde[_0x3132('0x3c')]['id']}})[_0x3132('0x1f')](handleEntityNotFound(_0xc324b3,null))[_0x3132('0x1f')](saveUpdates(_0x2b5bde['body'],null))[_0x3132('0x1f')](respondWithResult(_0xc324b3,null))[_0x3132('0x3b')](handleError(_0xc324b3,null));};exports['destroy']=function(_0x1521fc,_0x5b9c58){return db[_0x3132('0x22')][_0x3132('0x3e')]({'where':{'id':_0x1521fc['params']['id']}})[_0x3132('0x1f')](handleEntityNotFound(_0x5b9c58,null))['then'](removeEntity(_0x5b9c58,null))['catch'](handleError(_0x5b9c58,null));};exports[_0x3132('0x41')]=function(_0x4d96b1,_0x100536){return db[_0x3132('0x22')][_0x3132('0x41')]()[_0x3132('0x1f')](respondWithResult(_0x100536,null))[_0x3132('0x3b')](handleError(_0x100536,null));};
\ No newline at end of file
index 4b74cc1..7fc071e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf5a7=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','report_sms_transfer','uniqueid','lodash'];(function(_0x2cec26,_0x67c02){var _0x38d011=function(_0x2baa19){while(--_0x2baa19){_0x2cec26['push'](_0x2cec26['shift']());}};_0x38d011(++_0x67c02);}(_0xf5a7,0x133));var _0x7f5a=function(_0x58767e,_0x5b4c05){_0x58767e=_0x58767e-0x0;var _0x41747b=_0xf5a7[_0x58767e];return _0x41747b;};'use strict';var _=require(_0x7f5a('0x0'));var util=require(_0x7f5a('0x1'));var logger=require('../../config/logger')(_0x7f5a('0x2'));var moment=require(_0x7f5a('0x3'));var BPromise=require(_0x7f5a('0x4'));var rp=require(_0x7f5a('0x5'));var fs=require('fs');var path=require(_0x7f5a('0x6'));var rimraf=require(_0x7f5a('0x7'));var config=require(_0x7f5a('0x8'));var attributes=require(_0x7f5a('0x9'));module[_0x7f5a('0xa')]=function(_0x520bf9,_0x2808f2){return _0x520bf9[_0x7f5a('0xb')]('SmsTransferReport',attributes,{'tableName':_0x7f5a('0xc'),'paranoid':![],'indexes':[{'name':_0x7f5a('0xd'),'fields':[_0x7f5a('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xde17=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','define','SmsTransferReport','report_sms_transfer','uniqueid'];(function(_0x84faf6,_0x4797fd){var _0x155ddb=function(_0x445c18){while(--_0x445c18){_0x84faf6['push'](_0x84faf6['shift']());}};_0x155ddb(++_0x4797fd);}(_0xde17,0x186));var _0x7de1=function(_0x13aa62,_0x40bbcd){_0x13aa62=_0x13aa62-0x0;var _0x1af536=_0xde17[_0x13aa62];return _0x1af536;};'use strict';var _=require(_0x7de1('0x0'));var util=require(_0x7de1('0x1'));var logger=require(_0x7de1('0x2'))(_0x7de1('0x3'));var moment=require(_0x7de1('0x4'));var BPromise=require(_0x7de1('0x5'));var rp=require(_0x7de1('0x6'));var fs=require('fs');var path=require(_0x7de1('0x7'));var rimraf=require(_0x7de1('0x8'));var config=require(_0x7de1('0x9'));var attributes=require(_0x7de1('0xa'));module['exports']=function(_0x268d19,_0x49497d){return _0x268d19[_0x7de1('0xb')](_0x7de1('0xc'),attributes,{'tableName':_0x7de1('0xd'),'paranoid':![],'indexes':[{'name':_0x7de1('0xe'),'fields':[_0x7de1('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index 89b2485..c6a51bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0be3=['catch','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','error','code','message','result'];(function(_0x564c49,_0x199739){var _0x361b1c=function(_0x455505){while(--_0x455505){_0x564c49['push'](_0x564c49['shift']());}};_0x361b1c(++_0x199739);}(_0x0be3,0x9a));var _0x30be=function(_0x1cf7a6,_0x3c2961){_0x1cf7a6=_0x1cf7a6-0x0;var _0x331010=_0x0be3[_0x1cf7a6];return _0x331010;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x30be('0x0'));var BPromise=require(_0x30be('0x1'));var rs=require(_0x30be('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x30be('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x30be('0x4'))(_0x30be('0x5'));var config=require(_0x30be('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x30be('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xdc3ff5,_0x4b45a7,_0x124baf){return new BPromise(function(_0x4207d3,_0x403e5c){return client['request'](_0xdc3ff5,_0x124baf)[_0x30be('0x8')](function(_0x3cc6e7){logger[_0x30be('0x9')](_0x30be('0xa'),_0x4b45a7,'request\x20sent');logger['debug']('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x4b45a7,_0x30be('0xb'),JSON['stringify'](_0x3cc6e7));if(_0x3cc6e7[_0x30be('0xc')]){if(_0x3cc6e7[_0x30be('0xc')][_0x30be('0xd')]===0x1f4){logger[_0x30be('0xc')](_0x30be('0xa'),_0x4b45a7,_0x3cc6e7[_0x30be('0xc')][_0x30be('0xe')]);return _0x403e5c(_0x3cc6e7[_0x30be('0xc')][_0x30be('0xe')]);}logger['error'](_0x30be('0xa'),_0x4b45a7,_0x3cc6e7['error'][_0x30be('0xe')]);return _0x4207d3(_0x3cc6e7[_0x30be('0xc')]['message']);}else{logger[_0x30be('0x9')](_0x30be('0xa'),_0x4b45a7,'request\x20sent');_0x4207d3(_0x3cc6e7[_0x30be('0xf')][_0x30be('0xe')]);}})[_0x30be('0x10')](function(_0x40a4c7){logger[_0x30be('0xc')](_0x30be('0xa'),_0x4b45a7,_0x40a4c7);_0x403e5c(_0x40a4c7);});});}
\ No newline at end of file
+var _0x7d55=['request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','SmsTransferReport,\x20%s,\x20%s','error','message','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7d55,0x1bc));var _0x57d5=function(_0x3e6598,_0x32f41e){_0x3e6598=_0x3e6598-0x0;var _0x5b4036=_0x7d55[_0x3e6598];return _0x5b4036;};'use strict';var _=require(_0x57d5('0x0'));var util=require(_0x57d5('0x1'));var moment=require(_0x57d5('0x2'));var BPromise=require(_0x57d5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x57d5('0x4'))['db'];var utils=require(_0x57d5('0x5'));var logger=require(_0x57d5('0x6'))('rpc');var config=require(_0x57d5('0x7'));var jayson=require(_0x57d5('0x8'));var client=jayson[_0x57d5('0x9')][_0x57d5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4393ed,_0x47282c,_0x599ec5){return new BPromise(function(_0x50bc50,_0x59e164){return client['request'](_0x4393ed,_0x599ec5)[_0x57d5('0xb')](function(_0x1e8e1c){logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x47282c,_0x57d5('0xc'));logger['debug'](_0x57d5('0xd'),_0x47282c,_0x57d5('0xc'),JSON[_0x57d5('0xe')](_0x1e8e1c));if(_0x1e8e1c['error']){if(_0x1e8e1c['error'][_0x57d5('0xf')]===0x1f4){logger['error'](_0x57d5('0x10'),_0x47282c,_0x1e8e1c[_0x57d5('0x11')][_0x57d5('0x12')]);return _0x59e164(_0x1e8e1c[_0x57d5('0x11')][_0x57d5('0x12')]);}logger[_0x57d5('0x11')](_0x57d5('0x10'),_0x47282c,_0x1e8e1c[_0x57d5('0x11')]['message']);return _0x50bc50(_0x1e8e1c['error'][_0x57d5('0x12')]);}else{logger['info'](_0x57d5('0x10'),_0x47282c,_0x57d5('0xc'));_0x50bc50(_0x1e8e1c['result'][_0x57d5('0x12')]);}})['catch'](function(_0x5e99df){logger[_0x57d5('0x11')](_0x57d5('0x10'),_0x47282c,_0x5e99df);_0x59e164(_0x5e99df);});});}
\ No newline at end of file
index 8b93c68..398f927 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0db7=['/:id','show','/:id/download','diskStorage','join','root','originalname','replace','format','extname','now','post','single','file','create','put','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index'];(function(_0x29f26e,_0x43695f){var _0x584aec=function(_0x50d7c0){while(--_0x50d7c0){_0x29f26e['push'](_0x29f26e['shift']());}};_0x584aec(++_0x43695f);}(_0x0db7,0xc0));var _0x70db=function(_0x38823c,_0x24b178){_0x38823c=_0x38823c-0x0;var _0x121672=_0x0db7[_0x38823c];return _0x121672;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x70db('0x0'));var timeout=require(_0x70db('0x1'));var express=require(_0x70db('0x2'));var router=express[_0x70db('0x3')]();var fs_extra=require(_0x70db('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x70db('0x5'));var config=require(_0x70db('0x6'));var controller=require(_0x70db('0x7'));router[_0x70db('0x8')]('/',auth[_0x70db('0x9')](),controller[_0x70db('0xa')]);router[_0x70db('0x8')](_0x70db('0xb'),auth[_0x70db('0x9')](),controller[_0x70db('0xc')]);router[_0x70db('0x8')](_0x70db('0xd'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer[_0x70db('0xe')]({'destination':function(_0x2bfb0b,_0x196958,_0xe5ab99){_0xe5ab99(null,path[_0x70db('0xf')](config[_0x70db('0x10')],'server/files/sounds/original/'));},'filename':function(_0x1c317c,_0x27802a,_0x3d61fa){_0x27802a[_0x70db('0x11')]=_0x27802a[_0x70db('0x11')][_0x70db('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3d61fa(null,util[_0x70db('0x13')]('%s-%s%s',path['basename'](_0x27802a[_0x70db('0x11')],path[_0x70db('0x14')](_0x27802a['originalname'])),Date[_0x70db('0x15')](),path['extname'](_0x27802a[_0x70db('0x11')])));}})});router[_0x70db('0x16')]('/',upload[_0x70db('0x17')](_0x70db('0x18')),controller[_0x70db('0x19')]);router[_0x70db('0x1a')](_0x70db('0xb'),auth[_0x70db('0x9')](),controller['update']);router[_0x70db('0x1b')]('/:id',auth[_0x70db('0x9')](),controller[_0x70db('0x1b')]);module[_0x70db('0x1c')]=router;
\ No newline at end of file
+var _0xf6e9=['create','/:id','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','index','get','/:id/download','isAuthenticated','download','join','root','originalname','replace','extname','now','single','file'];(function(_0x1139d0,_0x41e5f8){var _0xcc01a6=function(_0x504ffa){while(--_0x504ffa){_0x1139d0['push'](_0x1139d0['shift']());}};_0xcc01a6(++_0x41e5f8);}(_0xf6e9,0xa7));var _0x9f6e=function(_0x385637,_0x19b66d){_0x385637=_0x385637-0x0;var _0xa04efe=_0xf6e9[_0x385637];return _0xa04efe;};'use strict';var multer=require(_0x9f6e('0x0'));var util=require(_0x9f6e('0x1'));var path=require(_0x9f6e('0x2'));var timeout=require(_0x9f6e('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9f6e('0x4'));var auth=require(_0x9f6e('0x5'));var interaction=require(_0x9f6e('0x6'));var config=require(_0x9f6e('0x7'));var controller=require(_0x9f6e('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x9f6e('0x9')]);router[_0x9f6e('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x9f6e('0xa')](_0x9f6e('0xb'),auth[_0x9f6e('0xc')](),controller[_0x9f6e('0xd')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x153f8f,_0x50ad3d,_0x1ea4ca){_0x1ea4ca(null,path[_0x9f6e('0xe')](config[_0x9f6e('0xf')],'server/files/sounds/original/'));},'filename':function(_0x53c217,_0x45c3b9,_0x5ad503){_0x45c3b9[_0x9f6e('0x10')]=_0x45c3b9[_0x9f6e('0x10')][_0x9f6e('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5ad503(null,util['format']('%s-%s%s',path['basename'](_0x45c3b9['originalname'],path[_0x9f6e('0x12')](_0x45c3b9[_0x9f6e('0x10')])),Date[_0x9f6e('0x13')](),path[_0x9f6e('0x12')](_0x45c3b9[_0x9f6e('0x10')])));}})});router['post']('/',upload[_0x9f6e('0x14')](_0x9f6e('0x15')),controller[_0x9f6e('0x16')]);router['put'](_0x9f6e('0x17'),auth[_0x9f6e('0xc')](),controller[_0x9f6e('0x18')]);router[_0x9f6e('0x19')]('/:id',auth[_0x9f6e('0xc')](),controller[_0x9f6e('0x19')]);module[_0x9f6e('0x1a')]=router;
\ No newline at end of file
index 7ec392c..a7c004a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcbfd=['STRING','name','FLOAT','BIGINT','INTEGER','exports'];(function(_0x36c6eb,_0x4fb127){var _0x30675b=function(_0x3a788b){while(--_0x3a788b){_0x36c6eb['push'](_0x36c6eb['shift']());}};_0x30675b(++_0x4fb127);}(_0xcbfd,0x6b));var _0xdcbf=function(_0x1abc0e,_0x4393d3){_0x1abc0e=_0x1abc0e-0x0;var _0x5ba0dc=_0xcbfd[_0x1abc0e];return _0x5ba0dc;};'use strict';var Sequelize=require('sequelize');module[_0xdcbf('0x0')]={'name':{'type':Sequelize[_0xdcbf('0x1')],'unique':_0xdcbf('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0xdcbf('0x1')]},'display_name':{'type':Sequelize[_0xdcbf('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0xdcbf('0x1')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0xdcbf('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0xdcbf('0x4')]},'original_sampleRate':{'type':Sequelize[_0xdcbf('0x5')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0xdcbf('0x3')]},'converted_sampleCount':{'type':Sequelize[_0xdcbf('0x4')]},'converted_channelCount':{'type':Sequelize[_0xdcbf('0x5')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xdcbf('0x5')]}};
\ No newline at end of file
+var _0x9a7a=['exports','STRING','INTEGER','BIGINT','FLOAT','sequelize'];(function(_0x487a0b,_0x33c302){var _0x4cb1ba=function(_0x2a3615){while(--_0x2a3615){_0x487a0b['push'](_0x487a0b['shift']());}};_0x4cb1ba(++_0x33c302);}(_0x9a7a,0x16d));var _0xa9a7=function(_0x553145,_0x4f9ab8){_0x553145=_0x553145-0x0;var _0x11cfbd=_0x9a7a[_0x553145];return _0x11cfbd;};'use strict';var Sequelize=require(_0xa9a7('0x0'));module[_0xa9a7('0x1')]={'name':{'type':Sequelize[_0xa9a7('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0xa9a7('0x2')]},'display_name':{'type':Sequelize[_0xa9a7('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0xa9a7('0x2')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0xa9a7('0x3')]},'original_bitRate':{'type':Sequelize[_0xa9a7('0x4')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0xa9a7('0x2')]},'converted_duration':{'type':Sequelize[_0xa9a7('0x5')]},'converted_sampleCount':{'type':Sequelize[_0xa9a7('0x4')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0xa9a7('0x4')]},'converted_sampleRate':{'type':Sequelize[_0xa9a7('0x3')]}};
\ No newline at end of file
index b4257ce..643065a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6075=['Sound\x20upload\x20destination:\x20%s','chmodSync','0777','unlinkSync','src','original_duration','duration','original_sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','sampleRate','dest','sampleCount','converted_channelCount','converted_bitRate','body','role','userProfileId','user','UserProfileSection','autoAssociation','start','description','delete','original_format','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','reject','save','update','destroy','then','get','Sounds','UserProfileResource','error','stack','name','send','index','map','Sound','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','include','rows','show','params','includeAll','options','find','catch','download','converted_format','existsSync','join','root','server/files/sounds/converted','save_name','Sequelize','ValidationError','%s.%s','format','create','basename','originalname','file','filename','extname','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s'];(function(_0x5b3b6a,_0x906f49){var _0x4a9af7=function(_0x435c41){while(--_0x435c41){_0x5b3b6a['push'](_0x5b3b6a['shift']());}};_0x4a9af7(++_0x906f49);}(_0x6075,0x18f));var _0x5607=function(_0x516a83,_0xd0a589){_0x516a83=_0x516a83-0x0;var _0x41caee=_0x6075[_0x516a83];return _0x41caee;};'use strict';var emlformat=require(_0x5607('0x0'));var rimraf=require(_0x5607('0x1'));var zipdir=require(_0x5607('0x2'));var jsonpatch=require(_0x5607('0x3'));var rp=require('request-promise');var moment=require(_0x5607('0x4'));var BPromise=require(_0x5607('0x5'));var Mustache=require(_0x5607('0x6'));var util=require(_0x5607('0x7'));var path=require(_0x5607('0x8'));var sox=require(_0x5607('0x9'));var csv=require(_0x5607('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5607('0xb'));var _=require(_0x5607('0xc'));var squel=require(_0x5607('0xd'));var crypto=require(_0x5607('0xe'));var jsforce=require(_0x5607('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5607('0x10'));var Redis=require(_0x5607('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5607('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5607('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5607('0x14'))['db'];function respondWithStatusCode(_0x2431ad,_0x1ebd7c){_0x1ebd7c=_0x1ebd7c||0xcc;return function(_0x50b6f6){if(_0x50b6f6){return _0x2431ad[_0x5607('0x15')](_0x1ebd7c);}return _0x2431ad[_0x5607('0x16')](_0x1ebd7c)[_0x5607('0x17')]();};}function respondWithResult(_0x354ba2,_0x2c8e71){_0x2c8e71=_0x2c8e71||0xc8;return function(_0x108b62){if(_0x108b62){return _0x354ba2[_0x5607('0x16')](_0x2c8e71)['json'](_0x108b62);}};}function respondWithFilteredResult(_0x465897,_0x1fdfd0){return function(_0x5250f0){if(_0x5250f0){var _0x46de4d=typeof _0x1fdfd0['offset']===_0x5607('0x18')&&typeof _0x1fdfd0[_0x5607('0x19')]===_0x5607('0x18');var _0xa6686c=_0x5250f0[_0x5607('0x1a')];var _0x5f4709=_0x46de4d?0x0:_0x1fdfd0[_0x5607('0x1b')];var _0x2221c8=_0x46de4d?_0x5250f0[_0x5607('0x1a')]:_0x1fdfd0[_0x5607('0x1b')]+_0x1fdfd0[_0x5607('0x19')];var _0x54df31;if(_0x2221c8>=_0xa6686c){_0x2221c8=_0xa6686c;_0x54df31=0xc8;}else{_0x54df31=0xce;}_0x465897[_0x5607('0x16')](_0x54df31);return _0x465897[_0x5607('0x1c')]('Content-Range',_0x5f4709+'-'+_0x2221c8+'/'+_0xa6686c)[_0x5607('0x1d')](_0x5250f0);}return null;};}function patchUpdates(_0x2a402b){return function(_0x3d3e09){try{jsonpatch[_0x5607('0x1e')](_0x3d3e09,_0x2a402b,!![]);}catch(_0xec2517){return BPromise[_0x5607('0x1f')](_0xec2517);}return _0x3d3e09[_0x5607('0x20')]();};}function saveUpdates(_0x2aea84,_0x4464f9){return function(_0x49fa03){if(_0x49fa03){return _0x49fa03[_0x5607('0x21')](_0x2aea84)['then'](function(_0x975644){return _0x975644;});}return null;};}function removeEntity(_0x13f5a1,_0x5d9132){return function(_0x2ec9c1){if(_0x2ec9c1){return _0x2ec9c1[_0x5607('0x22')]()[_0x5607('0x23')](function(){var _0x36bdd3=_0x2ec9c1[_0x5607('0x24')]({'plain':!![]});var _0x589387=_0x5607('0x25');return db[_0x5607('0x26')][_0x5607('0x22')]({'where':{'type':_0x589387,'resourceId':_0x36bdd3['id']}})['then'](function(){return _0x2ec9c1;});})[_0x5607('0x23')](function(){_0x13f5a1[_0x5607('0x16')](0xcc)[_0x5607('0x17')]();});}};}function handleEntityNotFound(_0x3da7aa,_0xdfae60){return function(_0x85d943){if(!_0x85d943){_0x3da7aa[_0x5607('0x15')](0x194);}return _0x85d943;};}function handleError(_0x48a8c9,_0xd1e4a8){_0xd1e4a8=_0xd1e4a8||0x1f4;return function(_0x2390da){logger[_0x5607('0x27')](_0x2390da[_0x5607('0x28')]);if(_0x2390da['name']){delete _0x2390da[_0x5607('0x29')];}_0x48a8c9[_0x5607('0x16')](_0xd1e4a8)[_0x5607('0x2a')](_0x2390da);};}exports[_0x5607('0x2b')]=function(_0x320997,_0x606538){var _0x3e8326={},_0xa38d3f={},_0x488a04={'count':0x0,'rows':[]};var _0x25d178=_[_0x5607('0x2c')](db[_0x5607('0x2d')][_0x5607('0x2e')],function(_0x884429){return{'name':_0x884429[_0x5607('0x2f')],'type':_0x884429[_0x5607('0x30')][_0x5607('0x31')]};});_0xa38d3f[_0x5607('0x32')]=_[_0x5607('0x2c')](_0x25d178,_0x5607('0x29'));_0xa38d3f[_0x5607('0x33')]=_[_0x5607('0x34')](_0x320997[_0x5607('0x33')]);_0xa38d3f[_0x5607('0x35')]=_[_0x5607('0x36')](_0xa38d3f['model'],_0xa38d3f[_0x5607('0x33')]);_0x3e8326[_0x5607('0x37')]=_[_0x5607('0x36')](_0xa38d3f[_0x5607('0x32')],qs[_0x5607('0x38')](_0x320997[_0x5607('0x33')][_0x5607('0x38')]));_0x3e8326['attributes']=_0x3e8326[_0x5607('0x37')][_0x5607('0x39')]?_0x3e8326[_0x5607('0x37')]:_0xa38d3f['model'];if(!_0x320997['query'][_0x5607('0x3a')](_0x5607('0x3b'))){_0x3e8326[_0x5607('0x19')]=qs[_0x5607('0x19')](_0x320997[_0x5607('0x33')]['limit']);_0x3e8326[_0x5607('0x1b')]=qs[_0x5607('0x1b')](_0x320997[_0x5607('0x33')][_0x5607('0x1b')]);}_0x3e8326[_0x5607('0x3c')]=qs[_0x5607('0x3d')](_0x320997[_0x5607('0x33')][_0x5607('0x3d')]);_0x3e8326['where']=qs[_0x5607('0x35')](_[_0x5607('0x3e')](_0x320997[_0x5607('0x33')],_0xa38d3f['filters']),_0x25d178);if(_0x320997[_0x5607('0x33')]['filter']){_0x3e8326[_0x5607('0x3f')]=_[_0x5607('0x40')](_0x3e8326[_0x5607('0x3f')],{'$or':_[_0x5607('0x2c')](_0x25d178,function(_0x3fc6b9){if(_0x3fc6b9[_0x5607('0x30')]!==_0x5607('0x41')){var _0x80c8b1={};_0x80c8b1[_0x3fc6b9[_0x5607('0x29')]]={'$like':'%'+_0x320997['query'][_0x5607('0x42')]+'%'};return _0x80c8b1;}})});}_0x3e8326=_[_0x5607('0x40')]({},_0x3e8326,_0x320997['options']);var _0x6e921d={'where':_0x3e8326['where']};return db[_0x5607('0x2d')]['count'](_0x6e921d)[_0x5607('0x23')](function(_0x5a9e01){_0x488a04['count']=_0x5a9e01;if(_0x320997[_0x5607('0x33')]['includeAll']){_0x3e8326[_0x5607('0x43')]=[{'all':!![]}];}return db[_0x5607('0x2d')]['findAll'](_0x3e8326);})[_0x5607('0x23')](function(_0x3a7c90){_0x488a04[_0x5607('0x44')]=_0x3a7c90;return _0x488a04;})[_0x5607('0x23')](respondWithFilteredResult(_0x606538,_0x3e8326))['catch'](handleError(_0x606538,null));};exports[_0x5607('0x45')]=function(_0x5bf7e,_0x35906a){var _0x1b6c46={'raw':!![],'where':{'id':_0x5bf7e[_0x5607('0x46')]['id']}},_0x4afdd8={};_0x4afdd8[_0x5607('0x32')]=_['keys'](db[_0x5607('0x2d')][_0x5607('0x2e')]);_0x4afdd8[_0x5607('0x33')]=_[_0x5607('0x34')](_0x5bf7e[_0x5607('0x33')]);_0x4afdd8['filters']=_[_0x5607('0x36')](_0x4afdd8[_0x5607('0x32')],_0x4afdd8[_0x5607('0x33')]);_0x1b6c46[_0x5607('0x37')]=_[_0x5607('0x36')](_0x4afdd8[_0x5607('0x32')],qs['fields'](_0x5bf7e['query'][_0x5607('0x38')]));_0x1b6c46[_0x5607('0x37')]=_0x1b6c46[_0x5607('0x37')][_0x5607('0x39')]?_0x1b6c46[_0x5607('0x37')]:_0x4afdd8[_0x5607('0x32')];if(_0x5bf7e['query'][_0x5607('0x47')]){_0x1b6c46[_0x5607('0x43')]=[{'all':!![]}];}_0x1b6c46=_[_0x5607('0x40')]({},_0x1b6c46,_0x5bf7e[_0x5607('0x48')]);return db[_0x5607('0x2d')][_0x5607('0x49')](_0x1b6c46)['then'](handleEntityNotFound(_0x35906a,null))[_0x5607('0x23')](respondWithResult(_0x35906a,null))[_0x5607('0x4a')](handleError(_0x35906a,null));};exports[_0x5607('0x4b')]=function(_0x5b147e,_0x217c14,_0x5c5272){return db['Sound'][_0x5607('0x49')]({'where':{'id':_0x5b147e[_0x5607('0x46')]['id']},'attributes':[_0x5607('0x29'),'save_name',_0x5607('0x4c')],'raw':!![]})[_0x5607('0x23')](handleEntityNotFound(_0x217c14,null))[_0x5607('0x23')](function(_0x219da6){if(_0x219da6){if(!fs[_0x5607('0x4d')](path[_0x5607('0x4e')](config[_0x5607('0x4f')],_0x5607('0x50'),_0x219da6[_0x5607('0x51')]+'.'+_0x219da6[_0x5607('0x4c')]))){throw new db[(_0x5607('0x52'))][(_0x5607('0x53'))]('Sound\x20not\x20found');}return _0x217c14[_0x5607('0x4b')](path['join'](config[_0x5607('0x4f')],'server/files/sounds/converted',util['format'](_0x5607('0x54'),_0x219da6[_0x5607('0x51')],_0x219da6[_0x5607('0x4c')])),util[_0x5607('0x55')]('%s.%s',_0x219da6[_0x5607('0x29')],_0x219da6[_0x5607('0x4c')]));}return null;})[_0x5607('0x4a')](handleError(_0x217c14,null));};exports[_0x5607('0x56')]=function(_0x3c6c7d,_0x1d984c,_0x4703b7){var _0x424972={'name':path[_0x5607('0x57')](_0x3c6c7d['file'][_0x5607('0x58')],path['extname'](_0x3c6c7d[_0x5607('0x59')][_0x5607('0x58')])),'save_name':path[_0x5607('0x57')](_0x3c6c7d[_0x5607('0x59')][_0x5607('0x5a')],path[_0x5607('0x5b')](_0x3c6c7d[_0x5607('0x59')][_0x5607('0x5a')])),'original_format':path['extname'](_0x3c6c7d['file'][_0x5607('0x58')])[_0x5607('0x5c')](0x1),'converted_format':_0x5607('0x5d')};var _0x3cea0e=path[_0x5607('0x4e')](config[_0x5607('0x4f')],_0x5607('0x5e'),_0x3c6c7d['file']['filename']);var _0x184d61=path[_0x5607('0x4e')](config['root'],'server/files/sounds/converted',util['format'](_0x5607('0x54'),path[_0x5607('0x57')](_0x3c6c7d[_0x5607('0x59')][_0x5607('0x5a')],path['extname'](_0x3c6c7d[_0x5607('0x59')][_0x5607('0x5a')])),_0x424972[_0x5607('0x4c')]));logger[_0x5607('0x5f')](_0x5607('0x60'),_0x3cea0e);logger[_0x5607('0x5f')](_0x5607('0x61'),_0x184d61);try{fs[_0x5607('0x62')](_0x3cea0e,parseInt(_0x5607('0x63'),0x8));var _0x44ed2a=sox['transcode'](_0x3cea0e,_0x184d61,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x44ed2a['on'](_0x5607('0x27'),function(_0x5aa349){fs[_0x5607('0x64')](_0x3cea0e);_0x1d984c[_0x5607('0x16')](0x1f4)['send'](_0x5aa349);});_0x44ed2a['on'](_0x5607('0x65'),function(_0x596615){_0x424972[_0x5607('0x66')]=isNaN(_0x596615[_0x5607('0x67')])?null:_0x596615[_0x5607('0x67')]*0x3e8;_0x424972[_0x5607('0x68')]=isNaN(_0x596615['sampleCount'])?null:_0x596615['sampleCount'];_0x424972[_0x5607('0x69')]=isNaN(_0x596615['channelCount'])?null:_0x596615[_0x5607('0x6a')];_0x424972[_0x5607('0x6b')]=isNaN(_0x596615[_0x5607('0x6c')])?null:_0x596615['bitRate'];_0x424972['original_sampleRate']=isNaN(_0x596615['sampleRate'])?null:_0x596615[_0x5607('0x6d')];});_0x44ed2a['on'](_0x5607('0x6e'),function(_0x47f017){_0x424972['converted_duration']=isNaN(_0x47f017['duration'])?null:_0x47f017[_0x5607('0x67')]*0x3e8;_0x424972['converted_sampleCount']=isNaN(_0x47f017['sampleCount'])?null:_0x47f017[_0x5607('0x6f')];_0x424972[_0x5607('0x70')]=isNaN(_0x47f017[_0x5607('0x6a')])?null:_0x47f017[_0x5607('0x6a')];_0x424972[_0x5607('0x71')]=isNaN(_0x47f017[_0x5607('0x6c')])?null:_0x47f017['bitRate'];_0x424972['converted_sampleRate']=isNaN(_0x47f017[_0x5607('0x6d')])?null:_0x47f017[_0x5607('0x6d')];});_0x44ed2a['on']('end',function(){fs[_0x5607('0x62')](_0x184d61,parseInt('0777',0x8));return db[_0x5607('0x2d')][_0x5607('0x56')](_0x424972)[_0x5607('0x23')](function(_0x231e9f){var _0xaa2e9e={'role':_0x3c6c7d[_0x5607('0x72')][_0x5607('0x73')],'userProfileId':_0x3c6c7d[_0x5607('0x72')][_0x5607('0x74')]};if(!_0xaa2e9e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xaa2e9e['role']===_0x5607('0x75')){var _0x48e90d=_0x231e9f[_0x5607('0x24')]({'plain':!![]});return db[_0x5607('0x76')]['find']({'where':{'name':_0x5607('0x25'),'userProfileId':_0xaa2e9e[_0x5607('0x74')]},'raw':!![]})[_0x5607('0x23')](function(_0x2823a4){if(_0x2823a4&&_0x2823a4[_0x5607('0x77')]===0x0){return db[_0x5607('0x26')]['create']({'name':_0x48e90d['name'],'resourceId':_0x48e90d['id'],'type':_0x2823a4[_0x5607('0x29')],'sectionId':_0x2823a4['id']},{})['then'](function(){return _0x231e9f;});}else{return _0x231e9f;}})[_0x5607('0x4a')](function(_0x6aa81c){logger[_0x5607('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x6aa81c);throw _0x6aa81c;});}return _0x231e9f;})[_0x5607('0x23')](respondWithResult(_0x1d984c,null))[_0x5607('0x4a')](handleError(_0x1d984c,null));});_0x44ed2a[_0x5607('0x78')]();}catch(_0x356a8b){_0x1d984c[_0x5607('0x16')](0x1f4)['send'](_0x356a8b);}};exports['update']=function(_0x1c87ca,_0x57036e,_0x115491){return db[_0x5607('0x2d')][_0x5607('0x49')]({'where':{'id':_0x1c87ca[_0x5607('0x46')]['id']}})[_0x5607('0x23')](handleEntityNotFound(_0x57036e,null))[_0x5607('0x23')](saveUpdates(_[_0x5607('0x3e')](_0x1c87ca[_0x5607('0x72')],[_0x5607('0x29'),_0x5607('0x79')]),null))[_0x5607('0x23')](respondWithResult(_0x57036e,null))[_0x5607('0x4a')](handleError(_0x57036e,null));};exports[_0x5607('0x7a')]=function(_0x381233,_0x315d57,_0xabd3c5){return db[_0x5607('0x2d')][_0x5607('0x49')]({'where':{'id':_0x381233[_0x5607('0x46')]['id']}})['then'](function(_0x249ef6){if(_0x249ef6){return _0x249ef6[_0x5607('0x22')]();}})['then'](function(_0x10daf8){var _0x20757a=path[_0x5607('0x4e')](config['root'],_0x5607('0x5e'),util['format'](_0x5607('0x54'),_0x10daf8[_0x5607('0x51')],_0x10daf8[_0x5607('0x7b')]));var _0x43a73a=path[_0x5607('0x4e')](config[_0x5607('0x4f')],_0x5607('0x50'),util[_0x5607('0x55')]('%s.%s',_0x10daf8['save_name'],_0x10daf8[_0x5607('0x4c')]));fs['unlinkSync'](_0x20757a);fs[_0x5607('0x64')](_0x43a73a);return _0x10daf8;})[_0x5607('0x23')](function(_0x24e1d8){if(_0x24e1d8){return _0x315d57[_0x5607('0x16')](0xcc)['end']();}})[_0x5607('0x23')](handleEntityNotFound(_0x315d57,null))[_0x5607('0x4a')](handleError(_0x315d57,null));};
\ No newline at end of file
+var _0xbb67=['UserProfileResource','error','stack','name','index','map','Sound','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','length','find','download','converted_format','existsSync','join','root','server/files/sounds/converted','format','%s.%s','save_name','create','basename','file','extname','originalname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','send','src','duration','original_sampleCount','sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_sampleCount','converted_channelCount','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','delete','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','then','destroy','get','Sounds'];(function(_0x27b726,_0x52fdbe){var _0x1236ee=function(_0x5b8870){while(--_0x5b8870){_0x27b726['push'](_0x27b726['shift']());}};_0x1236ee(++_0x52fdbe);}(_0xbb67,0x147));var _0x7bb6=function(_0x4bee3d,_0x33f8ee){_0x4bee3d=_0x4bee3d-0x0;var _0x377b18=_0xbb67[_0x4bee3d];return _0x377b18;};'use strict';var emlformat=require(_0x7bb6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7bb6('0x1'));var jsonpatch=require(_0x7bb6('0x2'));var rp=require(_0x7bb6('0x3'));var moment=require(_0x7bb6('0x4'));var BPromise=require(_0x7bb6('0x5'));var Mustache=require(_0x7bb6('0x6'));var util=require('util');var path=require(_0x7bb6('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7bb6('0x8'));var _=require(_0x7bb6('0x9'));var squel=require('squel');var crypto=require(_0x7bb6('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x7bb6('0xb'));var toCsv=require(_0x7bb6('0xc'));var querystring=require(_0x7bb6('0xd'));var Papa=require(_0x7bb6('0xe'));var Redis=require(_0x7bb6('0xf'));var authService=require(_0x7bb6('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7bb6('0x11'));var hardwareService=require(_0x7bb6('0x12'));var logger=require(_0x7bb6('0x13'))(_0x7bb6('0x14'));var utils=require(_0x7bb6('0x15'));var config=require(_0x7bb6('0x16'));var licenseUtil=require(_0x7bb6('0x17'));var db=require(_0x7bb6('0x18'))['db'];function respondWithStatusCode(_0x261b2c,_0x5dde6c){_0x5dde6c=_0x5dde6c||0xcc;return function(_0x2ba1c6){if(_0x2ba1c6){return _0x261b2c[_0x7bb6('0x19')](_0x5dde6c);}return _0x261b2c['status'](_0x5dde6c)[_0x7bb6('0x1a')]();};}function respondWithResult(_0x25af49,_0x460bff){_0x460bff=_0x460bff||0xc8;return function(_0x2c7668){if(_0x2c7668){return _0x25af49['status'](_0x460bff)[_0x7bb6('0x1b')](_0x2c7668);}};}function respondWithFilteredResult(_0x25e430,_0x1fb998){return function(_0x412b19){if(_0x412b19){var _0x488e46=typeof _0x1fb998[_0x7bb6('0x1c')]===_0x7bb6('0x1d')&&typeof _0x1fb998[_0x7bb6('0x1e')]===_0x7bb6('0x1d');var _0x4becb8=_0x412b19[_0x7bb6('0x1f')];var _0x1f102f=_0x488e46?0x0:_0x1fb998[_0x7bb6('0x1c')];var _0x45e54c=_0x488e46?_0x412b19['count']:_0x1fb998[_0x7bb6('0x1c')]+_0x1fb998[_0x7bb6('0x1e')];var _0x15963e;if(_0x45e54c>=_0x4becb8){_0x45e54c=_0x4becb8;_0x15963e=0xc8;}else{_0x15963e=0xce;}_0x25e430[_0x7bb6('0x20')](_0x15963e);return _0x25e430[_0x7bb6('0x21')]('Content-Range',_0x1f102f+'-'+_0x45e54c+'/'+_0x4becb8)[_0x7bb6('0x1b')](_0x412b19);}return null;};}function patchUpdates(_0x553363){return function(_0x57d5a0){try{jsonpatch[_0x7bb6('0x22')](_0x57d5a0,_0x553363,!![]);}catch(_0xd99285){return BPromise[_0x7bb6('0x23')](_0xd99285);}return _0x57d5a0[_0x7bb6('0x24')]();};}function saveUpdates(_0x3efd01,_0x324a03){return function(_0x4b307e){if(_0x4b307e){return _0x4b307e[_0x7bb6('0x25')](_0x3efd01)[_0x7bb6('0x26')](function(_0x97efba){return _0x97efba;});}return null;};}function removeEntity(_0x44a21d,_0x438776){return function(_0x4c9529){if(_0x4c9529){return _0x4c9529[_0x7bb6('0x27')]()[_0x7bb6('0x26')](function(){var _0x5060d2=_0x4c9529[_0x7bb6('0x28')]({'plain':!![]});var _0x228c9b=_0x7bb6('0x29');return db[_0x7bb6('0x2a')]['destroy']({'where':{'type':_0x228c9b,'resourceId':_0x5060d2['id']}})['then'](function(){return _0x4c9529;});})[_0x7bb6('0x26')](function(){_0x44a21d[_0x7bb6('0x20')](0xcc)[_0x7bb6('0x1a')]();});}};}function handleEntityNotFound(_0x35dbbf,_0x3b4a13){return function(_0x5c3792){if(!_0x5c3792){_0x35dbbf[_0x7bb6('0x19')](0x194);}return _0x5c3792;};}function handleError(_0x5b44ff,_0x48cf91){_0x48cf91=_0x48cf91||0x1f4;return function(_0xe7ba39){logger[_0x7bb6('0x2b')](_0xe7ba39[_0x7bb6('0x2c')]);if(_0xe7ba39[_0x7bb6('0x2d')]){delete _0xe7ba39[_0x7bb6('0x2d')];}_0x5b44ff[_0x7bb6('0x20')](_0x48cf91)['send'](_0xe7ba39);};}exports[_0x7bb6('0x2e')]=function(_0x3bfd3b,_0x369388){var _0x254ee0={},_0x1ac17e={},_0x8d64ad={'count':0x0,'rows':[]};var _0x4e5dfd=_[_0x7bb6('0x2f')](db[_0x7bb6('0x30')][_0x7bb6('0x31')],function(_0x3d48d6){return{'name':_0x3d48d6[_0x7bb6('0x32')],'type':_0x3d48d6[_0x7bb6('0x33')][_0x7bb6('0x34')]};});_0x1ac17e[_0x7bb6('0x35')]=_['map'](_0x4e5dfd,_0x7bb6('0x2d'));_0x1ac17e[_0x7bb6('0x36')]=_[_0x7bb6('0x37')](_0x3bfd3b[_0x7bb6('0x36')]);_0x1ac17e[_0x7bb6('0x38')]=_[_0x7bb6('0x39')](_0x1ac17e[_0x7bb6('0x35')],_0x1ac17e[_0x7bb6('0x36')]);_0x254ee0[_0x7bb6('0x3a')]=_['intersection'](_0x1ac17e[_0x7bb6('0x35')],qs[_0x7bb6('0x3b')](_0x3bfd3b['query'][_0x7bb6('0x3b')]));_0x254ee0[_0x7bb6('0x3a')]=_0x254ee0[_0x7bb6('0x3a')]['length']?_0x254ee0['attributes']:_0x1ac17e['model'];if(!_0x3bfd3b[_0x7bb6('0x36')][_0x7bb6('0x3c')]('nolimit')){_0x254ee0['limit']=qs[_0x7bb6('0x1e')](_0x3bfd3b[_0x7bb6('0x36')][_0x7bb6('0x1e')]);_0x254ee0[_0x7bb6('0x1c')]=qs[_0x7bb6('0x1c')](_0x3bfd3b[_0x7bb6('0x36')][_0x7bb6('0x1c')]);}_0x254ee0[_0x7bb6('0x3d')]=qs[_0x7bb6('0x3e')](_0x3bfd3b[_0x7bb6('0x36')]['sort']);_0x254ee0[_0x7bb6('0x3f')]=qs[_0x7bb6('0x38')](_[_0x7bb6('0x40')](_0x3bfd3b[_0x7bb6('0x36')],_0x1ac17e['filters']),_0x4e5dfd);if(_0x3bfd3b[_0x7bb6('0x36')][_0x7bb6('0x41')]){_0x254ee0[_0x7bb6('0x3f')]=_[_0x7bb6('0x42')](_0x254ee0['where'],{'$or':_['map'](_0x4e5dfd,function(_0x28325d){if(_0x28325d[_0x7bb6('0x33')]!==_0x7bb6('0x43')){var _0x1174c0={};_0x1174c0[_0x28325d[_0x7bb6('0x2d')]]={'$like':'%'+_0x3bfd3b[_0x7bb6('0x36')][_0x7bb6('0x41')]+'%'};return _0x1174c0;}})});}_0x254ee0=_[_0x7bb6('0x42')]({},_0x254ee0,_0x3bfd3b[_0x7bb6('0x44')]);var _0x3d23f8={'where':_0x254ee0[_0x7bb6('0x3f')]};return db[_0x7bb6('0x30')]['count'](_0x3d23f8)[_0x7bb6('0x26')](function(_0x203c87){_0x8d64ad[_0x7bb6('0x1f')]=_0x203c87;if(_0x3bfd3b[_0x7bb6('0x36')][_0x7bb6('0x45')]){_0x254ee0[_0x7bb6('0x46')]=[{'all':!![]}];}return db[_0x7bb6('0x30')]['findAll'](_0x254ee0);})[_0x7bb6('0x26')](function(_0x33759e){_0x8d64ad[_0x7bb6('0x47')]=_0x33759e;return _0x8d64ad;})[_0x7bb6('0x26')](respondWithFilteredResult(_0x369388,_0x254ee0))[_0x7bb6('0x48')](handleError(_0x369388,null));};exports[_0x7bb6('0x49')]=function(_0x236465,_0x10f279){var _0x2da4c1={'raw':!![],'where':{'id':_0x236465[_0x7bb6('0x4a')]['id']}},_0x4e6494={};_0x4e6494[_0x7bb6('0x35')]=_[_0x7bb6('0x37')](db[_0x7bb6('0x30')][_0x7bb6('0x31')]);_0x4e6494[_0x7bb6('0x36')]=_[_0x7bb6('0x37')](_0x236465['query']);_0x4e6494[_0x7bb6('0x38')]=_[_0x7bb6('0x39')](_0x4e6494[_0x7bb6('0x35')],_0x4e6494[_0x7bb6('0x36')]);_0x2da4c1[_0x7bb6('0x3a')]=_[_0x7bb6('0x39')](_0x4e6494['model'],qs[_0x7bb6('0x3b')](_0x236465['query'][_0x7bb6('0x3b')]));_0x2da4c1[_0x7bb6('0x3a')]=_0x2da4c1[_0x7bb6('0x3a')][_0x7bb6('0x4b')]?_0x2da4c1[_0x7bb6('0x3a')]:_0x4e6494[_0x7bb6('0x35')];if(_0x236465['query']['includeAll']){_0x2da4c1[_0x7bb6('0x46')]=[{'all':!![]}];}_0x2da4c1=_[_0x7bb6('0x42')]({},_0x2da4c1,_0x236465['options']);return db[_0x7bb6('0x30')][_0x7bb6('0x4c')](_0x2da4c1)[_0x7bb6('0x26')](handleEntityNotFound(_0x10f279,null))[_0x7bb6('0x26')](respondWithResult(_0x10f279,null))[_0x7bb6('0x48')](handleError(_0x10f279,null));};exports[_0x7bb6('0x4d')]=function(_0x41af4b,_0x58db5e,_0x133032){return db[_0x7bb6('0x30')][_0x7bb6('0x4c')]({'where':{'id':_0x41af4b[_0x7bb6('0x4a')]['id']},'attributes':[_0x7bb6('0x2d'),'save_name',_0x7bb6('0x4e')],'raw':!![]})[_0x7bb6('0x26')](handleEntityNotFound(_0x58db5e,null))[_0x7bb6('0x26')](function(_0x35bb52){if(_0x35bb52){if(!fs[_0x7bb6('0x4f')](path[_0x7bb6('0x50')](config[_0x7bb6('0x51')],'server/files/sounds/converted',_0x35bb52['save_name']+'.'+_0x35bb52[_0x7bb6('0x4e')]))){throw new db['Sequelize']['ValidationError']('Sound\x20not\x20found');}return _0x58db5e[_0x7bb6('0x4d')](path[_0x7bb6('0x50')](config[_0x7bb6('0x51')],_0x7bb6('0x52'),util[_0x7bb6('0x53')](_0x7bb6('0x54'),_0x35bb52[_0x7bb6('0x55')],_0x35bb52['converted_format'])),util[_0x7bb6('0x53')](_0x7bb6('0x54'),_0x35bb52[_0x7bb6('0x2d')],_0x35bb52[_0x7bb6('0x4e')]));}return null;})['catch'](handleError(_0x58db5e,null));};exports[_0x7bb6('0x56')]=function(_0x417f16,_0x5f2804,_0x5b1fa0){var _0x3beadc={'name':path[_0x7bb6('0x57')](_0x417f16[_0x7bb6('0x58')]['originalname'],path[_0x7bb6('0x59')](_0x417f16[_0x7bb6('0x58')][_0x7bb6('0x5a')])),'save_name':path[_0x7bb6('0x57')](_0x417f16[_0x7bb6('0x58')]['filename'],path[_0x7bb6('0x59')](_0x417f16[_0x7bb6('0x58')][_0x7bb6('0x5b')])),'original_format':path[_0x7bb6('0x59')](_0x417f16[_0x7bb6('0x58')][_0x7bb6('0x5a')])[_0x7bb6('0x5c')](0x1),'converted_format':_0x7bb6('0x5d')};var _0x3fbb8c=path[_0x7bb6('0x50')](config[_0x7bb6('0x51')],_0x7bb6('0x5e'),_0x417f16['file'][_0x7bb6('0x5b')]);var _0x3a764a=path[_0x7bb6('0x50')](config[_0x7bb6('0x51')],_0x7bb6('0x52'),util['format'](_0x7bb6('0x54'),path[_0x7bb6('0x57')](_0x417f16[_0x7bb6('0x58')][_0x7bb6('0x5b')],path[_0x7bb6('0x59')](_0x417f16['file']['filename'])),_0x3beadc[_0x7bb6('0x4e')]));logger[_0x7bb6('0x5f')](_0x7bb6('0x60'),_0x3fbb8c);logger[_0x7bb6('0x5f')](_0x7bb6('0x61'),_0x3a764a);try{fs[_0x7bb6('0x62')](_0x3fbb8c,parseInt(_0x7bb6('0x63'),0x8));var _0x363995=sox[_0x7bb6('0x64')](_0x3fbb8c,_0x3a764a,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x363995['on'](_0x7bb6('0x2b'),function(_0x336a57){fs[_0x7bb6('0x65')](_0x3fbb8c);_0x5f2804[_0x7bb6('0x20')](0x1f4)[_0x7bb6('0x66')](_0x336a57);});_0x363995['on'](_0x7bb6('0x67'),function(_0x4b0f6b){_0x3beadc['original_duration']=isNaN(_0x4b0f6b[_0x7bb6('0x68')])?null:_0x4b0f6b['duration']*0x3e8;_0x3beadc[_0x7bb6('0x69')]=isNaN(_0x4b0f6b[_0x7bb6('0x6a')])?null:_0x4b0f6b[_0x7bb6('0x6a')];_0x3beadc['original_channelCount']=isNaN(_0x4b0f6b[_0x7bb6('0x6b')])?null:_0x4b0f6b[_0x7bb6('0x6b')];_0x3beadc[_0x7bb6('0x6c')]=isNaN(_0x4b0f6b[_0x7bb6('0x6d')])?null:_0x4b0f6b[_0x7bb6('0x6d')];_0x3beadc[_0x7bb6('0x6e')]=isNaN(_0x4b0f6b[_0x7bb6('0x6f')])?null:_0x4b0f6b[_0x7bb6('0x6f')];});_0x363995['on']('dest',function(_0x21b213){_0x3beadc['converted_duration']=isNaN(_0x21b213[_0x7bb6('0x68')])?null:_0x21b213[_0x7bb6('0x68')]*0x3e8;_0x3beadc[_0x7bb6('0x70')]=isNaN(_0x21b213[_0x7bb6('0x6a')])?null:_0x21b213[_0x7bb6('0x6a')];_0x3beadc[_0x7bb6('0x71')]=isNaN(_0x21b213[_0x7bb6('0x6b')])?null:_0x21b213[_0x7bb6('0x6b')];_0x3beadc['converted_bitRate']=isNaN(_0x21b213['bitRate'])?null:_0x21b213[_0x7bb6('0x6d')];_0x3beadc['converted_sampleRate']=isNaN(_0x21b213[_0x7bb6('0x6f')])?null:_0x21b213[_0x7bb6('0x6f')];});_0x363995['on'](_0x7bb6('0x1a'),function(){fs[_0x7bb6('0x62')](_0x3a764a,parseInt(_0x7bb6('0x63'),0x8));return db[_0x7bb6('0x30')][_0x7bb6('0x56')](_0x3beadc)['then'](function(_0x509a7d){var _0x1d49c2={'role':_0x417f16[_0x7bb6('0x72')]['role'],'userProfileId':_0x417f16[_0x7bb6('0x72')][_0x7bb6('0x73')]};if(!_0x1d49c2)throw new Error(_0x7bb6('0x74'));if(_0x1d49c2[_0x7bb6('0x75')]==='user'){var _0x11efc5=_0x509a7d[_0x7bb6('0x28')]({'plain':!![]});return db[_0x7bb6('0x76')][_0x7bb6('0x4c')]({'where':{'name':_0x7bb6('0x29'),'userProfileId':_0x1d49c2[_0x7bb6('0x73')]},'raw':!![]})['then'](function(_0xb29ffe){if(_0xb29ffe&&_0xb29ffe[_0x7bb6('0x77')]===0x0){return db[_0x7bb6('0x2a')][_0x7bb6('0x56')]({'name':_0x11efc5[_0x7bb6('0x2d')],'resourceId':_0x11efc5['id'],'type':_0xb29ffe[_0x7bb6('0x2d')],'sectionId':_0xb29ffe['id']},{})['then'](function(){return _0x509a7d;});}else{return _0x509a7d;}})['catch'](function(_0x29585c){logger['error'](_0x7bb6('0x78'),_0x29585c);throw _0x29585c;});}return _0x509a7d;})['then'](respondWithResult(_0x5f2804,null))['catch'](handleError(_0x5f2804,null));});_0x363995['start']();}catch(_0x347a1d){_0x5f2804[_0x7bb6('0x20')](0x1f4)['send'](_0x347a1d);}};exports['update']=function(_0x1b7db9,_0x50eecd,_0x726fae){return db[_0x7bb6('0x30')][_0x7bb6('0x4c')]({'where':{'id':_0x1b7db9[_0x7bb6('0x4a')]['id']}})[_0x7bb6('0x26')](handleEntityNotFound(_0x50eecd,null))['then'](saveUpdates(_['pick'](_0x1b7db9[_0x7bb6('0x72')],[_0x7bb6('0x2d'),_0x7bb6('0x79')]),null))[_0x7bb6('0x26')](respondWithResult(_0x50eecd,null))[_0x7bb6('0x48')](handleError(_0x50eecd,null));};exports[_0x7bb6('0x7a')]=function(_0x27c59f,_0x4430b9,_0x3b8002){return db[_0x7bb6('0x30')][_0x7bb6('0x4c')]({'where':{'id':_0x27c59f['params']['id']}})[_0x7bb6('0x26')](function(_0x3c898a){if(_0x3c898a){return _0x3c898a[_0x7bb6('0x27')]();}})[_0x7bb6('0x26')](function(_0xbbdc67){var _0x34d844=path['join'](config[_0x7bb6('0x51')],_0x7bb6('0x5e'),util[_0x7bb6('0x53')]('%s.%s',_0xbbdc67[_0x7bb6('0x55')],_0xbbdc67['original_format']));var _0x63d969=path[_0x7bb6('0x50')](config[_0x7bb6('0x51')],'server/files/sounds/converted',util[_0x7bb6('0x53')](_0x7bb6('0x54'),_0xbbdc67['save_name'],_0xbbdc67[_0x7bb6('0x4e')]));fs['unlinkSync'](_0x34d844);fs[_0x7bb6('0x65')](_0x63d969);return _0xbbdc67;})[_0x7bb6('0x26')](function(_0x431fda){if(_0x431fda){return _0x4430b9['status'](0xcc)[_0x7bb6('0x1a')]();}})['then'](handleEntityNotFound(_0x4430b9,null))[_0x7bb6('0x48')](handleError(_0x4430b9,null));};
\ No newline at end of file
index 5a1f103..d76b4fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x095e=['api','moment','bluebird','request-promise','path','../../config/environment','exports','define','util'];(function(_0x2a7379,_0x33cc90){var _0x438974=function(_0x5b38a1){while(--_0x5b38a1){_0x2a7379['push'](_0x2a7379['shift']());}};_0x438974(++_0x33cc90);}(_0x095e,0x13a));var _0xe095=function(_0x35e02c,_0x1fdc73){_0x35e02c=_0x35e02c-0x0;var _0x367a42=_0x095e[_0x35e02c];return _0x367a42;};'use strict';var _=require('lodash');var util=require(_0xe095('0x0'));var logger=require('../../config/logger')(_0xe095('0x1'));var moment=require(_0xe095('0x2'));var BPromise=require(_0xe095('0x3'));var rp=require(_0xe095('0x4'));var fs=require('fs');var path=require(_0xe095('0x5'));var rimraf=require('rimraf');var config=require(_0xe095('0x6'));var attributes=require('./sound.attributes');module[_0xe095('0x7')]=function(_0x35bd0f,_0x43c3f2){return _0x35bd0f[_0xe095('0x8')]('Sound',attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc813=['define','Sound','tools_sounds','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x491f55,_0x4e50f2){var _0x209ab5=function(_0x567243){while(--_0x567243){_0x491f55['push'](_0x491f55['shift']());}};_0x209ab5(++_0x4e50f2);}(_0xc813,0x9f));var _0x3c81=function(_0x5be1d6,_0x52ab2a){_0x5be1d6=_0x5be1d6-0x0;var _0x5d9bd4=_0xc813[_0x5be1d6];return _0x5d9bd4;};'use strict';var _=require('lodash');var util=require(_0x3c81('0x0'));var logger=require(_0x3c81('0x1'))(_0x3c81('0x2'));var moment=require(_0x3c81('0x3'));var BPromise=require(_0x3c81('0x4'));var rp=require(_0x3c81('0x5'));var fs=require('fs');var path=require(_0x3c81('0x6'));var rimraf=require('rimraf');var config=require(_0x3c81('0x7'));var attributes=require('./sound.attributes');module[_0x3c81('0x8')]=function(_0x57d87d,_0x59f53e){return _0x57d87d[_0x3c81('0x9')](_0x3c81('0xa'),attributes,{'tableName':_0x3c81('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f489ca1..19161d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb691=['moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSound','find','options','where','attributes','include','map','model','debug','lodash','util'];(function(_0xd02bb,_0x26e2d0){var _0x1cdf23=function(_0x18fd05){while(--_0x18fd05){_0xd02bb['push'](_0xd02bb['shift']());}};_0x1cdf23(++_0x26e2d0);}(_0xb691,0x153));var _0x1b69=function(_0x34ab65,_0x356d84){_0x34ab65=_0x34ab65-0x0;var _0x31532c=_0xb691[_0x34ab65];return _0x31532c;};'use strict';var _=require(_0x1b69('0x0'));var util=require(_0x1b69('0x1'));var moment=require(_0x1b69('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1b69('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1b69('0x4'));var logger=require(_0x1b69('0x5'))(_0x1b69('0x6'));var config=require(_0x1b69('0x7'));var jayson=require(_0x1b69('0x8'));var client=jayson[_0x1b69('0x9')][_0x1b69('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2475e7,_0x42f30c,_0x2d1e93){return new BPromise(function(_0x53e933,_0x5ee47a){return client[_0x1b69('0xb')](_0x2475e7,_0x2d1e93)[_0x1b69('0xc')](function(_0x24feff){logger[_0x1b69('0xd')](_0x1b69('0xe'),_0x42f30c,_0x1b69('0xf'));logger['debug']('Sound,\x20%s,\x20%s,\x20%s',_0x42f30c,_0x1b69('0xf'),JSON[_0x1b69('0x10')](_0x24feff));if(_0x24feff[_0x1b69('0x11')]){if(_0x24feff[_0x1b69('0x11')][_0x1b69('0x12')]===0x1f4){logger['error'](_0x1b69('0xe'),_0x42f30c,_0x24feff['error']['message']);return _0x5ee47a(_0x24feff[_0x1b69('0x11')][_0x1b69('0x13')]);}logger['error'](_0x1b69('0xe'),_0x42f30c,_0x24feff[_0x1b69('0x11')][_0x1b69('0x13')]);return _0x53e933(_0x24feff[_0x1b69('0x11')][_0x1b69('0x13')]);}else{logger[_0x1b69('0xd')]('Sound,\x20%s,\x20%s',_0x42f30c,'request\x20sent');_0x53e933(_0x24feff[_0x1b69('0x14')][_0x1b69('0x13')]);}})[_0x1b69('0x15')](function(_0x2dac11){logger[_0x1b69('0x11')](_0x1b69('0xe'),_0x42f30c,_0x2dac11);_0x5ee47a(_0x2dac11);});});}exports[_0x1b69('0x16')]=function(_0x274af0){var _0x3be00d=this;return new Promise(function(_0x45e2a3,_0x296feb){return db['Sound'][_0x1b69('0x17')]({'raw':_0x274af0[_0x1b69('0x18')]?_0x274af0[_0x1b69('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x274af0[_0x1b69('0x18')]?_0x274af0['options'][_0x1b69('0x19')]||null:null,'attributes':_0x274af0[_0x1b69('0x18')]?_0x274af0[_0x1b69('0x18')][_0x1b69('0x1a')]||null:null,'include':_0x274af0[_0x1b69('0x18')]?_0x274af0[_0x1b69('0x18')][_0x1b69('0x1b')]?_[_0x1b69('0x1c')](_0x274af0[_0x1b69('0x18')][_0x1b69('0x1b')],function(_0x34b9cc){return{'model':db[_0x34b9cc['model']],'as':_0x34b9cc['as'],'attributes':_0x34b9cc['attributes'],'include':_0x34b9cc[_0x1b69('0x1b')]?_['map'](_0x34b9cc[_0x1b69('0x1b')],function(_0xde0ccc){return{'model':db[_0xde0ccc[_0x1b69('0x1d')]],'as':_0xde0ccc['as'],'attributes':_0xde0ccc['attributes'],'include':_0xde0ccc[_0x1b69('0x1b')]?_[_0x1b69('0x1c')](_0xde0ccc[_0x1b69('0x1b')],function(_0x539fe4){return{'model':db[_0x539fe4[_0x1b69('0x1d')]],'as':_0x539fe4['as'],'attributes':_0x539fe4['attributes']};}):[]};}):[]};}):[]:[]})[_0x1b69('0xc')](function(_0x336b33){logger[_0x1b69('0xd')](_0x1b69('0x16'),_0x274af0);logger[_0x1b69('0x1e')](_0x1b69('0x16'),_0x274af0,JSON[_0x1b69('0x10')](_0x336b33));_0x45e2a3(_0x336b33);})[_0x1b69('0x15')](function(_0x1c50b1){logger['error']('ShowSound',_0x1c50b1[_0x1b69('0x13')],_0x274af0);_0x296feb(_0x3be00d['error'](0x1f4,_0x1c50b1['message']));});});};
\ No newline at end of file
+var _0x24a9=['message','result','catch','Sound','find','options','raw','attributes','map','include','model','then','ShowSound','stringify','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x24a9,0x19a));var _0x924a=function(_0x2ee8a7,_0x4abcd6){_0x2ee8a7=_0x2ee8a7-0x0;var _0x3e5827=_0x24a9[_0x2ee8a7];return _0x3e5827;};'use strict';var _=require(_0x924a('0x0'));var util=require(_0x924a('0x1'));var moment=require(_0x924a('0x2'));var BPromise=require('bluebird');var rs=require(_0x924a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x924a('0x4'))['db'];var utils=require(_0x924a('0x5'));var logger=require(_0x924a('0x6'))(_0x924a('0x7'));var config=require(_0x924a('0x8'));var jayson=require(_0x924a('0x9'));var client=jayson['client'][_0x924a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x304204,_0x40951c,_0x1f82aa){return new BPromise(function(_0x2bfe77,_0x3b5e47){return client[_0x924a('0xb')](_0x304204,_0x1f82aa)['then'](function(_0x12a68b){logger[_0x924a('0xc')](_0x924a('0xd'),_0x40951c,_0x924a('0xe'));logger[_0x924a('0xf')](_0x924a('0x10'),_0x40951c,_0x924a('0xe'),JSON['stringify'](_0x12a68b));if(_0x12a68b[_0x924a('0x11')]){if(_0x12a68b['error'][_0x924a('0x12')]===0x1f4){logger[_0x924a('0x11')]('Sound,\x20%s,\x20%s',_0x40951c,_0x12a68b[_0x924a('0x11')]['message']);return _0x3b5e47(_0x12a68b['error'][_0x924a('0x13')]);}logger[_0x924a('0x11')]('Sound,\x20%s,\x20%s',_0x40951c,_0x12a68b[_0x924a('0x11')][_0x924a('0x13')]);return _0x2bfe77(_0x12a68b[_0x924a('0x11')][_0x924a('0x13')]);}else{logger[_0x924a('0xc')](_0x924a('0xd'),_0x40951c,_0x924a('0xe'));_0x2bfe77(_0x12a68b[_0x924a('0x14')][_0x924a('0x13')]);}})[_0x924a('0x15')](function(_0x573112){logger[_0x924a('0x11')](_0x924a('0xd'),_0x40951c,_0x573112);_0x3b5e47(_0x573112);});});}exports['ShowSound']=function(_0x90559c){var _0x53e880=this;return new Promise(function(_0x59ff0d,_0x1caa77){return db[_0x924a('0x16')][_0x924a('0x17')]({'raw':_0x90559c[_0x924a('0x18')]?_0x90559c[_0x924a('0x18')][_0x924a('0x19')]===undefined?!![]:![]:!![],'where':_0x90559c['options']?_0x90559c['options']['where']||null:null,'attributes':_0x90559c['options']?_0x90559c[_0x924a('0x18')][_0x924a('0x1a')]||null:null,'include':_0x90559c[_0x924a('0x18')]?_0x90559c[_0x924a('0x18')]['include']?_[_0x924a('0x1b')](_0x90559c['options'][_0x924a('0x1c')],function(_0x38c14c){return{'model':db[_0x38c14c['model']],'as':_0x38c14c['as'],'attributes':_0x38c14c['attributes'],'include':_0x38c14c[_0x924a('0x1c')]?_[_0x924a('0x1b')](_0x38c14c[_0x924a('0x1c')],function(_0x5a9a28){return{'model':db[_0x5a9a28[_0x924a('0x1d')]],'as':_0x5a9a28['as'],'attributes':_0x5a9a28['attributes'],'include':_0x5a9a28[_0x924a('0x1c')]?_['map'](_0x5a9a28['include'],function(_0x5e17dc){return{'model':db[_0x5e17dc['model']],'as':_0x5e17dc['as'],'attributes':_0x5e17dc['attributes']};}):[]};}):[]};}):[]:[]})[_0x924a('0x1e')](function(_0x44ccf6){logger[_0x924a('0xc')](_0x924a('0x1f'),_0x90559c);logger[_0x924a('0xf')](_0x924a('0x1f'),_0x90559c,JSON[_0x924a('0x20')](_0x44ccf6));_0x59ff0d(_0x44ccf6);})[_0x924a('0x15')](function(_0x175a20){logger[_0x924a('0x11')](_0x924a('0x1f'),_0x175a20[_0x924a('0x13')],_0x90559c);_0x1caa77(_0x53e880[_0x924a('0x11')](0x1f4,_0x175a20['message']));});});};
\ No newline at end of file
index b4c597f..b5bae80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x235326,_0x251051){var _0x43a1d7=function(_0x1e79d9){while(--_0x1e79d9){_0x235326['push'](_0x235326['shift']());}};_0x43a1d7(++_0x251051);}(_0xda2d,0x102));var _0xdda2=function(_0x5d5090,_0x34c5c7){_0x5d5090=_0x5d5090-0x0;var _0x2a3501=_0xda2d[_0x5d5090];return _0x2a3501;};'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
+var _0x8603=['../../components/interaction/service','./squareMessage.controller','isAuthenticated','index','get','/:id','create','put','update','exports','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x252ef1,_0x2e0041){var _0x25817c=function(_0x243776){while(--_0x243776){_0x252ef1['push'](_0x252ef1['shift']());}};_0x25817c(++_0x2e0041);}(_0x8603,0x190));var _0x3860=function(_0x5c422a,_0x2376e5){_0x5c422a=_0x5c422a-0x0;var _0x6c5b33=_0x8603[_0x5c422a];return _0x6c5b33;};'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['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x3860('0xb')]);router[_0x3860('0xc')]('/:id',auth[_0x3860('0x7')](),controller[_0x3860('0xd')]);router['delete'](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['destroy']);module[_0x3860('0xe')]=router;
\ No newline at end of file
index 020b594..df353fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa028=['out','sequelize','STRING','TEXT','medium'];(function(_0x25db49,_0x28f4f5){var _0x5163ba=function(_0x34b6ec){while(--_0x34b6ec){_0x25db49['push'](_0x25db49['shift']());}};_0x5163ba(++_0x28f4f5);}(_0xa028,0x146));var _0x8a02=function(_0x10a230,_0x448917){_0x10a230=_0x10a230-0x0;var _0x5c78e2=_0xa028[_0x10a230];return _0x5c78e2;};'use strict';var Sequelize=require(_0x8a02('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x8a02('0x1')]},'body':{'type':Sequelize[_0x8a02('0x2')](_0x8a02('0x3')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x8a02('0x4')),'defaultValue':_0x8a02('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0x8a02('0x1')]},'providerResponse':{'type':Sequelize[_0x8a02('0x2')]}};
\ No newline at end of file
+var _0x44a7=['TEXT','medium','ENUM','out','sequelize','exports','STRING'];(function(_0xbfadd5,_0x5b27ef){var _0x2a4c81=function(_0x25d9a7){while(--_0x25d9a7){_0xbfadd5['push'](_0xbfadd5['shift']());}};_0x2a4c81(++_0x5b27ef);}(_0x44a7,0xc1));var _0x744a=function(_0x19d350,_0x3c843f){_0x19d350=_0x19d350-0x0;var _0x3bfc8d=_0x44a7[_0x19d350];return _0x3bfc8d;};'use strict';var Sequelize=require(_0x744a('0x0'));module[_0x744a('0x1')]={'uniqueid':{'type':Sequelize[_0x744a('0x2')]},'body':{'type':Sequelize[_0x744a('0x3')](_0x744a('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x744a('0x5')]('in','out'),'defaultValue':_0x744a('0x6'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x744a('0x3')]}};
\ No newline at end of file
index de4007f..1478469 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2243=['order','sort','where','pick','filter','merge','VIRTUAL','options','include','SquareMessage','rows','catch','params','keys','includeAll','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0x2243,0x13b));var _0x3224=function(_0x1e6557,_0x1e7a7d){_0x1e6557=_0x1e6557-0x0;var _0x5965c2=_0x2243[_0x1e6557];return _0x5965c2;};'use strict';var emlformat=require(_0x3224('0x0'));var rimraf=require(_0x3224('0x1'));var zipdir=require(_0x3224('0x2'));var jsonpatch=require(_0x3224('0x3'));var rp=require(_0x3224('0x4'));var moment=require(_0x3224('0x5'));var BPromise=require(_0x3224('0x6'));var Mustache=require(_0x3224('0x7'));var util=require(_0x3224('0x8'));var path=require(_0x3224('0x9'));var sox=require(_0x3224('0xa'));var csv=require(_0x3224('0xb'));var ejs=require(_0x3224('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3224('0xd'));var squel=require(_0x3224('0xe'));var crypto=require(_0x3224('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x3224('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3224('0x11'));var Redis=require(_0x3224('0x12'));var authService=require(_0x3224('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x3224('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3224('0x15'));var utils=require(_0x3224('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x3224('0x17'));var db=require(_0x3224('0x18'))['db'];function respondWithStatusCode(_0x438944,_0x39e3da){_0x39e3da=_0x39e3da||0xcc;return function(_0x41f41f){if(_0x41f41f){return _0x438944[_0x3224('0x19')](_0x39e3da);}return _0x438944[_0x3224('0x1a')](_0x39e3da)[_0x3224('0x1b')]();};}function respondWithResult(_0x319d11,_0x4fb08b){_0x4fb08b=_0x4fb08b||0xc8;return function(_0x175924){if(_0x175924){return _0x319d11['status'](_0x4fb08b)[_0x3224('0x1c')](_0x175924);}};}function respondWithFilteredResult(_0x5b325c,_0x44b534){return function(_0x37aae7){if(_0x37aae7){var _0x1cb017=typeof _0x44b534['offset']===_0x3224('0x1d')&&typeof _0x44b534[_0x3224('0x1e')]===_0x3224('0x1d');var _0x2b583e=_0x37aae7[_0x3224('0x1f')];var _0x2778e2=_0x1cb017?0x0:_0x44b534[_0x3224('0x20')];var _0x3f3c3c=_0x1cb017?_0x37aae7['count']:_0x44b534[_0x3224('0x20')]+_0x44b534[_0x3224('0x1e')];var _0x3a794f;if(_0x3f3c3c>=_0x2b583e){_0x3f3c3c=_0x2b583e;_0x3a794f=0xc8;}else{_0x3a794f=0xce;}_0x5b325c[_0x3224('0x1a')](_0x3a794f);return _0x5b325c[_0x3224('0x21')](_0x3224('0x22'),_0x2778e2+'-'+_0x3f3c3c+'/'+_0x2b583e)['json'](_0x37aae7);}return null;};}function patchUpdates(_0x43838b){return function(_0x5c0004){try{jsonpatch['apply'](_0x5c0004,_0x43838b,!![]);}catch(_0x2d0ea3){return BPromise[_0x3224('0x23')](_0x2d0ea3);}return _0x5c0004[_0x3224('0x24')]();};}function saveUpdates(_0x24c56b,_0x4ca9ea){return function(_0x2237c2){if(_0x2237c2){return _0x2237c2['update'](_0x24c56b)[_0x3224('0x25')](function(_0x10f3c4){return _0x10f3c4;});}return null;};}function removeEntity(_0x93b9fd,_0x4bb8be){return function(_0x48c8c1){if(_0x48c8c1){return _0x48c8c1[_0x3224('0x26')]()[_0x3224('0x25')](function(){_0x93b9fd[_0x3224('0x1a')](0xcc)[_0x3224('0x1b')]();});}};}function handleEntityNotFound(_0x17e4d2,_0x304bb4){return function(_0x59856f){if(!_0x59856f){_0x17e4d2[_0x3224('0x19')](0x194);}return _0x59856f;};}function handleError(_0x233b89,_0x53fbea){_0x53fbea=_0x53fbea||0x1f4;return function(_0x45a531){logger[_0x3224('0x27')](_0x45a531[_0x3224('0x28')]);if(_0x45a531[_0x3224('0x29')]){delete _0x45a531[_0x3224('0x29')];}_0x233b89[_0x3224('0x1a')](_0x53fbea)[_0x3224('0x2a')](_0x45a531);};}exports['index']=function(_0x2c7388,_0x175d33){var _0x506133={},_0x1b6494={},_0x23081f={'count':0x0,'rows':[]};var _0x3e40be=_[_0x3224('0x2b')](db['SquareMessage'][_0x3224('0x2c')],function(_0xffc18b){return{'name':_0xffc18b[_0x3224('0x2d')],'type':_0xffc18b[_0x3224('0x2e')]['key']};});_0x1b6494[_0x3224('0x2f')]=_[_0x3224('0x2b')](_0x3e40be,_0x3224('0x29'));_0x1b6494['query']=_['keys'](_0x2c7388[_0x3224('0x30')]);_0x1b6494[_0x3224('0x31')]=_[_0x3224('0x32')](_0x1b6494[_0x3224('0x2f')],_0x1b6494[_0x3224('0x30')]);_0x506133[_0x3224('0x33')]=_[_0x3224('0x32')](_0x1b6494[_0x3224('0x2f')],qs[_0x3224('0x34')](_0x2c7388[_0x3224('0x30')]['fields']));_0x506133[_0x3224('0x33')]=_0x506133[_0x3224('0x33')][_0x3224('0x35')]?_0x506133['attributes']:_0x1b6494[_0x3224('0x2f')];if(!_0x2c7388[_0x3224('0x30')][_0x3224('0x36')]('nolimit')){_0x506133[_0x3224('0x1e')]=qs[_0x3224('0x1e')](_0x2c7388[_0x3224('0x30')]['limit']);_0x506133['offset']=qs['offset'](_0x2c7388[_0x3224('0x30')][_0x3224('0x20')]);}_0x506133[_0x3224('0x37')]=qs[_0x3224('0x38')](_0x2c7388[_0x3224('0x30')][_0x3224('0x38')]);_0x506133[_0x3224('0x39')]=qs[_0x3224('0x31')](_[_0x3224('0x3a')](_0x2c7388[_0x3224('0x30')],_0x1b6494[_0x3224('0x31')]),_0x3e40be);if(_0x2c7388[_0x3224('0x30')][_0x3224('0x3b')]){_0x506133[_0x3224('0x39')]=_[_0x3224('0x3c')](_0x506133['where'],{'$or':_[_0x3224('0x2b')](_0x3e40be,function(_0x4b28c4){if(_0x4b28c4[_0x3224('0x2e')]!==_0x3224('0x3d')){var _0x1c2f97={};_0x1c2f97[_0x4b28c4['name']]={'$like':'%'+_0x2c7388[_0x3224('0x30')]['filter']+'%'};return _0x1c2f97;}})});}_0x506133=_[_0x3224('0x3c')]({},_0x506133,_0x2c7388[_0x3224('0x3e')]);var _0x4e6d94={'where':_0x506133[_0x3224('0x39')]};return db['SquareMessage'][_0x3224('0x1f')](_0x4e6d94)[_0x3224('0x25')](function(_0x328209){_0x23081f[_0x3224('0x1f')]=_0x328209;if(_0x2c7388[_0x3224('0x30')]['includeAll']){_0x506133[_0x3224('0x3f')]=[{'all':!![]}];}return db[_0x3224('0x40')]['findAll'](_0x506133);})['then'](function(_0x53f5f7){_0x23081f[_0x3224('0x41')]=_0x53f5f7;return _0x23081f;})[_0x3224('0x25')](respondWithFilteredResult(_0x175d33,_0x506133))[_0x3224('0x42')](handleError(_0x175d33,null));};exports['show']=function(_0x112d5c,_0x44ac1e){var _0x1e6d6e={'raw':!![],'where':{'id':_0x112d5c[_0x3224('0x43')]['id']}},_0x364a89={};_0x364a89[_0x3224('0x2f')]=_[_0x3224('0x44')](db[_0x3224('0x40')][_0x3224('0x2c')]);_0x364a89['query']=_[_0x3224('0x44')](_0x112d5c[_0x3224('0x30')]);_0x364a89['filters']=_[_0x3224('0x32')](_0x364a89['model'],_0x364a89[_0x3224('0x30')]);_0x1e6d6e['attributes']=_[_0x3224('0x32')](_0x364a89['model'],qs[_0x3224('0x34')](_0x112d5c[_0x3224('0x30')][_0x3224('0x34')]));_0x1e6d6e[_0x3224('0x33')]=_0x1e6d6e[_0x3224('0x33')][_0x3224('0x35')]?_0x1e6d6e[_0x3224('0x33')]:_0x364a89['model'];if(_0x112d5c[_0x3224('0x30')][_0x3224('0x45')]){_0x1e6d6e[_0x3224('0x3f')]=[{'all':!![]}];}_0x1e6d6e=_['merge']({},_0x1e6d6e,_0x112d5c['options']);return db[_0x3224('0x40')][_0x3224('0x46')](_0x1e6d6e)[_0x3224('0x25')](handleEntityNotFound(_0x44ac1e,null))[_0x3224('0x25')](respondWithResult(_0x44ac1e,null))[_0x3224('0x42')](handleError(_0x44ac1e,null));};exports[_0x3224('0x47')]=function(_0x563d10,_0x4cd93f){return db[_0x3224('0x40')]['create'](_0x563d10[_0x3224('0x48')],{})[_0x3224('0x25')](respondWithResult(_0x4cd93f,0xc9))['catch'](handleError(_0x4cd93f,null));};exports[_0x3224('0x49')]=function(_0x2543d3,_0x376fb6){if(_0x2543d3['body']['id']){delete _0x2543d3['body']['id'];}return db[_0x3224('0x40')][_0x3224('0x46')]({'where':{'id':_0x2543d3[_0x3224('0x43')]['id']}})[_0x3224('0x25')](handleEntityNotFound(_0x376fb6,null))[_0x3224('0x25')](saveUpdates(_0x2543d3['body'],null))[_0x3224('0x25')](respondWithResult(_0x376fb6,null))[_0x3224('0x42')](handleError(_0x376fb6,null));};exports[_0x3224('0x26')]=function(_0x4e347a,_0x3ee979){return db['SquareMessage'][_0x3224('0x46')]({'where':{'id':_0x4e347a[_0x3224('0x43')]['id']}})[_0x3224('0x25')](handleEntityNotFound(_0x3ee979,null))['then'](removeEntity(_0x3ee979,null))[_0x3224('0x42')](handleError(_0x3ee979,null));};
\ No newline at end of file
+var _0x917d=['mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','nolimit','order','sort','filters','pick','filter','where','merge','options','SquareMessage','includeAll','include','findAll','rows','show','params','catch','create','update','find','body','eml-format','rimraf','fast-json-patch','request-promise','moment'];(function(_0x4adc83,_0x680b89){var _0x1b7d29=function(_0xb64aa0){while(--_0xb64aa0){_0x4adc83['push'](_0x4adc83['shift']());}};_0x1b7d29(++_0x680b89);}(_0x917d,0x17c));var _0xd917=function(_0x533181,_0x465c24){_0x533181=_0x533181-0x0;var _0x57d221=_0x917d[_0x533181];return _0x57d221;};'use strict';var emlformat=require(_0xd917('0x0'));var rimraf=require(_0xd917('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd917('0x2'));var rp=require(_0xd917('0x3'));var moment=require(_0xd917('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd917('0x5'));var util=require(_0xd917('0x6'));var path=require('path');var sox=require(_0xd917('0x7'));var csv=require(_0xd917('0x8'));var ejs=require(_0xd917('0x9'));var fs=require('fs');var fs_extra=require(_0xd917('0xa'));var _=require(_0xd917('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd917('0xc'));var deskjs=require(_0xd917('0xd'));var toCsv=require(_0xd917('0x8'));var querystring=require(_0xd917('0xe'));var Papa=require(_0xd917('0xf'));var Redis=require(_0xd917('0x10'));var authService=require(_0xd917('0x11'));var qs=require(_0xd917('0x12'));var as=require(_0xd917('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd917('0x14'))(_0xd917('0x15'));var utils=require('../../config/utils');var config=require(_0xd917('0x16'));var licenseUtil=require(_0xd917('0x17'));var db=require(_0xd917('0x18'))['db'];function respondWithStatusCode(_0x3bd54b,_0x5ce552){_0x5ce552=_0x5ce552||0xcc;return function(_0x342ddb){if(_0x342ddb){return _0x3bd54b['sendStatus'](_0x5ce552);}return _0x3bd54b[_0xd917('0x19')](_0x5ce552)[_0xd917('0x1a')]();};}function respondWithResult(_0x6cdfa7,_0x5b8eda){_0x5b8eda=_0x5b8eda||0xc8;return function(_0x17b81e){if(_0x17b81e){return _0x6cdfa7[_0xd917('0x19')](_0x5b8eda)[_0xd917('0x1b')](_0x17b81e);}};}function respondWithFilteredResult(_0x193ec0,_0x4d4f8b){return function(_0x5d05b7){if(_0x5d05b7){var _0x5e9c8d=typeof _0x4d4f8b[_0xd917('0x1c')]==='undefined'&&typeof _0x4d4f8b[_0xd917('0x1d')]===_0xd917('0x1e');var _0x4ce3a7=_0x5d05b7[_0xd917('0x1f')];var _0x1cfb52=_0x5e9c8d?0x0:_0x4d4f8b[_0xd917('0x1c')];var _0x18e7cf=_0x5e9c8d?_0x5d05b7[_0xd917('0x1f')]:_0x4d4f8b[_0xd917('0x1c')]+_0x4d4f8b['limit'];var _0xe50f2e;if(_0x18e7cf>=_0x4ce3a7){_0x18e7cf=_0x4ce3a7;_0xe50f2e=0xc8;}else{_0xe50f2e=0xce;}_0x193ec0[_0xd917('0x19')](_0xe50f2e);return _0x193ec0[_0xd917('0x20')](_0xd917('0x21'),_0x1cfb52+'-'+_0x18e7cf+'/'+_0x4ce3a7)['json'](_0x5d05b7);}return null;};}function patchUpdates(_0x2eab97){return function(_0x53c693){try{jsonpatch[_0xd917('0x22')](_0x53c693,_0x2eab97,!![]);}catch(_0x3c10d3){return BPromise[_0xd917('0x23')](_0x3c10d3);}return _0x53c693[_0xd917('0x24')]();};}function saveUpdates(_0x44d518,_0x352a7c){return function(_0x363d7c){if(_0x363d7c){return _0x363d7c['update'](_0x44d518)['then'](function(_0x5748c2){return _0x5748c2;});}return null;};}function removeEntity(_0x16a45a,_0x4628b5){return function(_0x585971){if(_0x585971){return _0x585971['destroy']()[_0xd917('0x25')](function(){_0x16a45a['status'](0xcc)[_0xd917('0x1a')]();});}};}function handleEntityNotFound(_0x505d5e,_0x14b025){return function(_0x1f146a){if(!_0x1f146a){_0x505d5e[_0xd917('0x26')](0x194);}return _0x1f146a;};}function handleError(_0x3d3709,_0x866ed4){_0x866ed4=_0x866ed4||0x1f4;return function(_0x37fe27){logger[_0xd917('0x27')](_0x37fe27[_0xd917('0x28')]);if(_0x37fe27[_0xd917('0x29')]){delete _0x37fe27[_0xd917('0x29')];}_0x3d3709[_0xd917('0x19')](_0x866ed4)[_0xd917('0x2a')](_0x37fe27);};}exports[_0xd917('0x2b')]=function(_0x2f4939,_0x151655){var _0x2632cf={},_0x554322={},_0x46bb6d={'count':0x0,'rows':[]};var _0x28d802=_[_0xd917('0x2c')](db['SquareMessage'][_0xd917('0x2d')],function(_0x1dee51){return{'name':_0x1dee51[_0xd917('0x2e')],'type':_0x1dee51[_0xd917('0x2f')][_0xd917('0x30')]};});_0x554322[_0xd917('0x31')]=_[_0xd917('0x2c')](_0x28d802,_0xd917('0x29'));_0x554322['query']=_[_0xd917('0x32')](_0x2f4939[_0xd917('0x33')]);_0x554322['filters']=_[_0xd917('0x34')](_0x554322[_0xd917('0x31')],_0x554322[_0xd917('0x33')]);_0x2632cf['attributes']=_[_0xd917('0x34')](_0x554322[_0xd917('0x31')],qs[_0xd917('0x35')](_0x2f4939[_0xd917('0x33')][_0xd917('0x35')]));_0x2632cf[_0xd917('0x36')]=_0x2632cf[_0xd917('0x36')][_0xd917('0x37')]?_0x2632cf[_0xd917('0x36')]:_0x554322[_0xd917('0x31')];if(!_0x2f4939[_0xd917('0x33')]['hasOwnProperty'](_0xd917('0x38'))){_0x2632cf[_0xd917('0x1d')]=qs['limit'](_0x2f4939[_0xd917('0x33')][_0xd917('0x1d')]);_0x2632cf[_0xd917('0x1c')]=qs['offset'](_0x2f4939[_0xd917('0x33')][_0xd917('0x1c')]);}_0x2632cf[_0xd917('0x39')]=qs[_0xd917('0x3a')](_0x2f4939[_0xd917('0x33')][_0xd917('0x3a')]);_0x2632cf['where']=qs[_0xd917('0x3b')](_[_0xd917('0x3c')](_0x2f4939[_0xd917('0x33')],_0x554322[_0xd917('0x3b')]),_0x28d802);if(_0x2f4939['query'][_0xd917('0x3d')]){_0x2632cf[_0xd917('0x3e')]=_['merge'](_0x2632cf[_0xd917('0x3e')],{'$or':_[_0xd917('0x2c')](_0x28d802,function(_0x1cc5e5){if(_0x1cc5e5[_0xd917('0x2f')]!=='VIRTUAL'){var _0x129f0b={};_0x129f0b[_0x1cc5e5['name']]={'$like':'%'+_0x2f4939[_0xd917('0x33')][_0xd917('0x3d')]+'%'};return _0x129f0b;}})});}_0x2632cf=_[_0xd917('0x3f')]({},_0x2632cf,_0x2f4939[_0xd917('0x40')]);var _0x4ca586={'where':_0x2632cf[_0xd917('0x3e')]};return db[_0xd917('0x41')][_0xd917('0x1f')](_0x4ca586)[_0xd917('0x25')](function(_0x45e0d8){_0x46bb6d[_0xd917('0x1f')]=_0x45e0d8;if(_0x2f4939[_0xd917('0x33')][_0xd917('0x42')]){_0x2632cf[_0xd917('0x43')]=[{'all':!![]}];}return db[_0xd917('0x41')][_0xd917('0x44')](_0x2632cf);})[_0xd917('0x25')](function(_0x15c211){_0x46bb6d[_0xd917('0x45')]=_0x15c211;return _0x46bb6d;})[_0xd917('0x25')](respondWithFilteredResult(_0x151655,_0x2632cf))['catch'](handleError(_0x151655,null));};exports[_0xd917('0x46')]=function(_0x463b45,_0x3d980b){var _0x59495b={'raw':!![],'where':{'id':_0x463b45[_0xd917('0x47')]['id']}},_0xb7c939={};_0xb7c939[_0xd917('0x31')]=_[_0xd917('0x32')](db[_0xd917('0x41')][_0xd917('0x2d')]);_0xb7c939[_0xd917('0x33')]=_[_0xd917('0x32')](_0x463b45[_0xd917('0x33')]);_0xb7c939[_0xd917('0x3b')]=_[_0xd917('0x34')](_0xb7c939[_0xd917('0x31')],_0xb7c939[_0xd917('0x33')]);_0x59495b[_0xd917('0x36')]=_[_0xd917('0x34')](_0xb7c939[_0xd917('0x31')],qs['fields'](_0x463b45[_0xd917('0x33')][_0xd917('0x35')]));_0x59495b[_0xd917('0x36')]=_0x59495b[_0xd917('0x36')][_0xd917('0x37')]?_0x59495b[_0xd917('0x36')]:_0xb7c939[_0xd917('0x31')];if(_0x463b45[_0xd917('0x33')]['includeAll']){_0x59495b[_0xd917('0x43')]=[{'all':!![]}];}_0x59495b=_[_0xd917('0x3f')]({},_0x59495b,_0x463b45[_0xd917('0x40')]);return db['SquareMessage']['find'](_0x59495b)[_0xd917('0x25')](handleEntityNotFound(_0x3d980b,null))['then'](respondWithResult(_0x3d980b,null))[_0xd917('0x48')](handleError(_0x3d980b,null));};exports[_0xd917('0x49')]=function(_0x4495db,_0x2c1d21){return db[_0xd917('0x41')]['create'](_0x4495db['body'],{})['then'](respondWithResult(_0x2c1d21,0xc9))[_0xd917('0x48')](handleError(_0x2c1d21,null));};exports[_0xd917('0x4a')]=function(_0x520afe,_0x17d3dc){if(_0x520afe['body']['id']){delete _0x520afe['body']['id'];}return db[_0xd917('0x41')][_0xd917('0x4b')]({'where':{'id':_0x520afe['params']['id']}})[_0xd917('0x25')](handleEntityNotFound(_0x17d3dc,null))[_0xd917('0x25')](saveUpdates(_0x520afe[_0xd917('0x4c')],null))[_0xd917('0x25')](respondWithResult(_0x17d3dc,null))[_0xd917('0x48')](handleError(_0x17d3dc,null));};exports['destroy']=function(_0x268a4e,_0x5290fa){return db[_0xd917('0x41')][_0xd917('0x4b')]({'where':{'id':_0x268a4e['params']['id']}})[_0xd917('0x25')](handleEntityNotFound(_0x5290fa,null))[_0xd917('0x25')](removeEntity(_0x5290fa,null))[_0xd917('0x48')](handleError(_0x5290fa,null));};
\ No newline at end of file
index 5bdee35..dc92615 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd9d4=['define','SquareMessage','square_messages','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareMessage.attributes','exports'];(function(_0x2cca56,_0x204717){var _0x156432=function(_0x526e05){while(--_0x526e05){_0x2cca56['push'](_0x2cca56['shift']());}};_0x156432(++_0x204717);}(_0xd9d4,0x15c));var _0x4d9d=function(_0xeff2c3,_0x3a5a82){_0xeff2c3=_0xeff2c3-0x0;var _0x2cade6=_0xd9d4[_0xeff2c3];return _0x2cade6;};'use strict';var _=require(_0x4d9d('0x0'));var util=require(_0x4d9d('0x1'));var logger=require(_0x4d9d('0x2'))(_0x4d9d('0x3'));var moment=require(_0x4d9d('0x4'));var BPromise=require(_0x4d9d('0x5'));var rp=require(_0x4d9d('0x6'));var fs=require('fs');var path=require(_0x4d9d('0x7'));var rimraf=require(_0x4d9d('0x8'));var config=require(_0x4d9d('0x9'));var attributes=require(_0x4d9d('0xa'));module[_0x4d9d('0xb')]=function(_0x1c72f4,_0x475ce2){return _0x1c72f4[_0x4d9d('0xc')](_0x4d9d('0xd'),attributes,{'tableName':_0x4d9d('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1d99=['bluebird','request-promise','path','rimraf','exports','SquareMessage','square_messages','util','../../config/logger','api'];(function(_0x32f6b9,_0x2d4aa9){var _0x267d52=function(_0x10f74f){while(--_0x10f74f){_0x32f6b9['push'](_0x32f6b9['shift']());}};_0x267d52(++_0x2d4aa9);}(_0x1d99,0x179));var _0x91d9=function(_0x5a0bf5,_0x40a1ce){_0x5a0bf5=_0x5a0bf5-0x0;var _0x57fc2c=_0x1d99[_0x5a0bf5];return _0x57fc2c;};'use strict';var _=require('lodash');var util=require(_0x91d9('0x0'));var logger=require(_0x91d9('0x1'))(_0x91d9('0x2'));var moment=require('moment');var BPromise=require(_0x91d9('0x3'));var rp=require(_0x91d9('0x4'));var fs=require('fs');var path=require(_0x91d9('0x5'));var rimraf=require(_0x91d9('0x6'));var config=require('../../config/environment');var attributes=require('./squareMessage.attributes');module[_0x91d9('0x7')]=function(_0x197f89,_0x1dc6e6){return _0x197f89['define'](_0x91d9('0x8'),attributes,{'tableName':_0x91d9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a73a107..eba2b13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa74=['rpc','../../config/environment','jayson/promise','client','http','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateSquareMessage','SquareMessage','body','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger'];(function(_0xf51c06,_0x388e5b){var _0x1d5420=function(_0x5e077b){while(--_0x5e077b){_0xf51c06['push'](_0xf51c06['shift']());}};_0x1d5420(++_0x388e5b);}(_0xfa74,0x122));var _0x4fa7=function(_0x57716a,_0x201182){_0x57716a=_0x57716a-0x0;var _0x246401=_0xfa74[_0x57716a];return _0x246401;};'use strict';var _=require(_0x4fa7('0x0'));var util=require(_0x4fa7('0x1'));var moment=require(_0x4fa7('0x2'));var BPromise=require(_0x4fa7('0x3'));var rs=require(_0x4fa7('0x4'));var fs=require('fs');var Redis=require(_0x4fa7('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4fa7('0x6'))(_0x4fa7('0x7'));var config=require(_0x4fa7('0x8'));var jayson=require(_0x4fa7('0x9'));var client=jayson[_0x4fa7('0xa')][_0x4fa7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x540893,_0x52d253,_0x549f34){return new BPromise(function(_0x148073,_0x35eac2){return client['request'](_0x540893,_0x549f34)['then'](function(_0x16d366){logger['info'](_0x4fa7('0xc'),_0x52d253,_0x4fa7('0xd'));logger[_0x4fa7('0xe')](_0x4fa7('0xf'),_0x52d253,_0x4fa7('0xd'),JSON[_0x4fa7('0x10')](_0x16d366));if(_0x16d366[_0x4fa7('0x11')]){if(_0x16d366[_0x4fa7('0x11')][_0x4fa7('0x12')]===0x1f4){logger[_0x4fa7('0x11')](_0x4fa7('0xc'),_0x52d253,_0x16d366['error']['message']);return _0x35eac2(_0x16d366[_0x4fa7('0x11')]['message']);}logger[_0x4fa7('0x11')]('SquareMessage,\x20%s,\x20%s',_0x52d253,_0x16d366['error'][_0x4fa7('0x13')]);return _0x148073(_0x16d366[_0x4fa7('0x11')][_0x4fa7('0x13')]);}else{logger[_0x4fa7('0x14')](_0x4fa7('0xc'),_0x52d253,_0x4fa7('0xd'));_0x148073(_0x16d366['result'][_0x4fa7('0x13')]);}})[_0x4fa7('0x15')](function(_0x1bc505){logger[_0x4fa7('0x11')](_0x4fa7('0xc'),_0x52d253,_0x1bc505);_0x35eac2(_0x1bc505);});});}exports[_0x4fa7('0x16')]=function(_0x25b596){var _0x4b2ed4=this;return new Promise(function(_0x5ea9cc,_0x590f0e){return db[_0x4fa7('0x17')]['create'](_0x25b596[_0x4fa7('0x18')],{'raw':_0x25b596['options']?_0x25b596['options'][_0x4fa7('0x19')]===undefined?!![]:![]:!![]})[_0x4fa7('0x1a')](function(_0x25831f){logger[_0x4fa7('0x14')](_0x4fa7('0x16'),_0x25b596);logger[_0x4fa7('0xe')](_0x4fa7('0x16'),_0x25b596,JSON['stringify'](_0x25831f));_0x5ea9cc(_0x25831f);})[_0x4fa7('0x15')](function(_0x103933){logger['error'](_0x4fa7('0x16'),_0x103933[_0x4fa7('0x13')],_0x25b596);_0x590f0e(_0x4b2ed4['error'](0x1f4,_0x103933[_0x4fa7('0x13')]));});});};
\ No newline at end of file
+var _0x9eaf=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','SquareMessage,\x20%s,\x20%s,\x20%s','error','message','SquareMessage,\x20%s,\x20%s','request\x20sent','catch','SquareMessage','create','body','options','raw','CreateSquareMessage','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4bb052,_0x14e516){var _0x2b536d=function(_0x182753){while(--_0x182753){_0x4bb052['push'](_0x4bb052['shift']());}};_0x2b536d(++_0x14e516);}(_0x9eaf,0x72));var _0xf9ea=function(_0x3b1126,_0x434359){_0x3b1126=_0x3b1126-0x0;var _0x17a145=_0x9eaf[_0x3b1126];return _0x17a145;};'use strict';var _=require(_0xf9ea('0x0'));var util=require('util');var moment=require(_0xf9ea('0x1'));var BPromise=require(_0xf9ea('0x2'));var rs=require(_0xf9ea('0x3'));var fs=require('fs');var Redis=require(_0xf9ea('0x4'));var db=require(_0xf9ea('0x5'))['db'];var utils=require(_0xf9ea('0x6'));var logger=require(_0xf9ea('0x7'))(_0xf9ea('0x8'));var config=require(_0xf9ea('0x9'));var jayson=require(_0xf9ea('0xa'));var client=jayson[_0xf9ea('0xb')][_0xf9ea('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x101e7a,_0x698654,_0xbe37d7){return new BPromise(function(_0x5c7331,_0x20b2cd){return client[_0xf9ea('0xd')](_0x101e7a,_0xbe37d7)[_0xf9ea('0xe')](function(_0x26a2e2){logger[_0xf9ea('0xf')]('SquareMessage,\x20%s,\x20%s',_0x698654,'request\x20sent');logger[_0xf9ea('0x10')](_0xf9ea('0x11'),_0x698654,'request\x20sent',JSON['stringify'](_0x26a2e2));if(_0x26a2e2[_0xf9ea('0x12')]){if(_0x26a2e2[_0xf9ea('0x12')]['code']===0x1f4){logger[_0xf9ea('0x12')]('SquareMessage,\x20%s,\x20%s',_0x698654,_0x26a2e2[_0xf9ea('0x12')][_0xf9ea('0x13')]);return _0x20b2cd(_0x26a2e2[_0xf9ea('0x12')][_0xf9ea('0x13')]);}logger['error'](_0xf9ea('0x14'),_0x698654,_0x26a2e2['error'][_0xf9ea('0x13')]);return _0x5c7331(_0x26a2e2[_0xf9ea('0x12')]['message']);}else{logger[_0xf9ea('0xf')](_0xf9ea('0x14'),_0x698654,_0xf9ea('0x15'));_0x5c7331(_0x26a2e2['result']['message']);}})[_0xf9ea('0x16')](function(_0x3b960a){logger['error'](_0xf9ea('0x14'),_0x698654,_0x3b960a);_0x20b2cd(_0x3b960a);});});}exports['CreateSquareMessage']=function(_0x541f47){var _0x3d55a2=this;return new Promise(function(_0x2f311f,_0x1260cb){return db[_0xf9ea('0x17')][_0xf9ea('0x18')](_0x541f47[_0xf9ea('0x19')],{'raw':_0x541f47[_0xf9ea('0x1a')]?_0x541f47[_0xf9ea('0x1a')][_0xf9ea('0x1b')]===undefined?!![]:![]:!![]})[_0xf9ea('0xe')](function(_0x103b29){logger[_0xf9ea('0xf')](_0xf9ea('0x1c'),_0x541f47);logger[_0xf9ea('0x10')](_0xf9ea('0x1c'),_0x541f47,JSON[_0xf9ea('0x1d')](_0x103b29));_0x2f311f(_0x103b29);})[_0xf9ea('0x16')](function(_0xf158cb){logger['error'](_0xf9ea('0x1c'),_0xf158cb[_0xf9ea('0x13')],_0x541f47);_0x1260cb(_0x3d55a2[_0xf9ea('0x12')](0x1f4,_0xf158cb[_0xf9ea('0x13')]));});});};
\ No newline at end of file
index be03880..8666602 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c99=['isAuthenticated','show','/:id/test','test','post','create','put','update','destroy','exports','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/:id'];(function(_0x4fb1b8,_0x32d98d){var _0x146c71=function(_0x4bb74e){while(--_0x4bb74e){_0x4fb1b8['push'](_0x4fb1b8['shift']());}};_0x146c71(++_0x32d98d);}(_0x2c99,0xac));var _0x92c9=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x2c99[_0x3511d3];return _0x5d6321;};'use strict';var multer=require('multer');var util=require(_0x92c9('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x92c9('0x1'));var router=express[_0x92c9('0x2')]();var fs_extra=require(_0x92c9('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x92c9('0x4'));var config=require(_0x92c9('0x5'));var controller=require('./squareOdbc.controller');router[_0x92c9('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x92c9('0x6')](_0x92c9('0x7'),auth[_0x92c9('0x8')](),controller[_0x92c9('0x9')]);router[_0x92c9('0x6')](_0x92c9('0xa'),auth['isAuthenticated'](),timeout('15s'),controller[_0x92c9('0xb')]);router[_0x92c9('0xc')]('/',auth['isAuthenticated'](),controller[_0x92c9('0xd')]);router[_0x92c9('0xe')](_0x92c9('0x7'),auth['isAuthenticated'](),controller[_0x92c9('0xf')]);router['delete'](_0x92c9('0x7'),auth[_0x92c9('0x8')](),controller[_0x92c9('0x10')]);module[_0x92c9('0x11')]=router;
\ No newline at end of file
+var _0xdabb=['/:id','/:id/test','isAuthenticated','post','create','put','update','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','index'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xdabb,0x19a));var _0xbdab=function(_0x44989b,_0x1824e8){_0x44989b=_0x44989b-0x0;var _0x1c771c=_0xdabb[_0x44989b];return _0x1c771c;};'use strict';var multer=require('multer');var util=require(_0xbdab('0x0'));var path=require('path');var timeout=require(_0xbdab('0x1'));var express=require('express');var router=express[_0xbdab('0x2')]();var fs_extra=require(_0xbdab('0x3'));var auth=require(_0xbdab('0x4'));var interaction=require(_0xbdab('0x5'));var config=require(_0xbdab('0x6'));var controller=require(_0xbdab('0x7'));router[_0xbdab('0x8')]('/',auth['isAuthenticated'](),controller[_0xbdab('0x9')]);router[_0xbdab('0x8')](_0xbdab('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xbdab('0x8')](_0xbdab('0xb'),auth[_0xbdab('0xc')](),timeout('15s'),controller['test']);router[_0xbdab('0xd')]('/',auth[_0xbdab('0xc')](),controller[_0xbdab('0xe')]);router[_0xbdab('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xbdab('0x10')]);router[_0xbdab('0x11')](_0xbdab('0xa'),auth[_0xbdab('0xc')](),controller[_0xbdab('0x12')]);module[_0xbdab('0x13')]=router;
\ No newline at end of file
index 5c13606..05def5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1185=['name','exports','STRING'];(function(_0x2bb75c,_0x3fde2d){var _0x57f033=function(_0x45444c){while(--_0x45444c){_0x2bb75c['push'](_0x2bb75c['shift']());}};_0x57f033(++_0x3fde2d);}(_0x1185,0x18a));var _0x5118=function(_0x4cf5e,_0x3eb96e){_0x4cf5e=_0x4cf5e-0x0;var _0x189e7b=_0x1185[_0x4cf5e];return _0x189e7b;};'use strict';var Sequelize=require('sequelize');module[_0x5118('0x0')]={'name':{'type':Sequelize[_0x5118('0x1')],'unique':_0x5118('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x5118('0x1')]},'description':{'type':Sequelize[_0x5118('0x1')]}};
\ No newline at end of file
+var _0x7298=['exports','name','STRING'];(function(_0x1bb81b,_0x5e2585){var _0x192346=function(_0x58530a){while(--_0x58530a){_0x1bb81b['push'](_0x1bb81b['shift']());}};_0x192346(++_0x5e2585);}(_0x7298,0x1dd));var _0x8729=function(_0x34a06e,_0x3f8714){_0x34a06e=_0x34a06e-0x0;var _0x19b132=_0x7298[_0x34a06e];return _0x19b132;};'use strict';var Sequelize=require('sequelize');module[_0x8729('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x8729('0x1'),'allowNull':![]},'dsn':{'type':Sequelize[_0x8729('0x2')]},'description':{'type':Sequelize[_0x8729('0x2')]}};
\ No newline at end of file
index 1264b75..a833da1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6828=['name','send','index','map','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','SquareOdbc','includeAll','rows','catch','rawAttributes','length','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','test','dsn','odbc','openSync','rimraf','request-promise','moment','sox','to-csv','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','ODBC','UserProfileResource','error'];(function(_0x198d08,_0x42f1ee){var _0x519bd9=function(_0x332d27){while(--_0x332d27){_0x198d08['push'](_0x198d08['shift']());}};_0x519bd9(++_0x42f1ee);}(_0x6828,0x115));var _0x8682=function(_0x5e14f2,_0x24c2e7){_0x5e14f2=_0x5e14f2-0x0;var _0x5d8a99=_0x6828[_0x5e14f2];return _0x5d8a99;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8682('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8682('0x1'));var moment=require(_0x8682('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x8682('0x3'));var csv=require(_0x8682('0x4'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8682('0x5'));var _=require('lodash');var squel=require(_0x8682('0x6'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8682('0x7'));var toCsv=require(_0x8682('0x4'));var querystring=require(_0x8682('0x8'));var Papa=require(_0x8682('0x9'));var Redis=require(_0x8682('0xa'));var authService=require(_0x8682('0xb'));var qs=require(_0x8682('0xc'));var as=require(_0x8682('0xd'));var hardwareService=require(_0x8682('0xe'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x8682('0xf'));var licenseUtil=require('../../config/license/util');var db=require(_0x8682('0x10'))['db'];function respondWithStatusCode(_0x3781ce,_0x3dec8a){_0x3dec8a=_0x3dec8a||0xcc;return function(_0x4044ce){if(_0x4044ce){return _0x3781ce['sendStatus'](_0x3dec8a);}return _0x3781ce[_0x8682('0x11')](_0x3dec8a)[_0x8682('0x12')]();};}function respondWithResult(_0x290f04,_0x470b73){_0x470b73=_0x470b73||0xc8;return function(_0x279f76){if(_0x279f76){return _0x290f04[_0x8682('0x11')](_0x470b73)[_0x8682('0x13')](_0x279f76);}};}function respondWithFilteredResult(_0x8d977e,_0x3bfc0f){return function(_0x22d980){if(_0x22d980){var _0x2d58e5=typeof _0x3bfc0f[_0x8682('0x14')]===_0x8682('0x15')&&typeof _0x3bfc0f[_0x8682('0x16')]==='undefined';var _0x5d9850=_0x22d980['count'];var _0xb4b41=_0x2d58e5?0x0:_0x3bfc0f[_0x8682('0x14')];var _0x431fa7=_0x2d58e5?_0x22d980[_0x8682('0x17')]:_0x3bfc0f[_0x8682('0x14')]+_0x3bfc0f[_0x8682('0x16')];var _0x415f5b;if(_0x431fa7>=_0x5d9850){_0x431fa7=_0x5d9850;_0x415f5b=0xc8;}else{_0x415f5b=0xce;}_0x8d977e[_0x8682('0x11')](_0x415f5b);return _0x8d977e[_0x8682('0x18')](_0x8682('0x19'),_0xb4b41+'-'+_0x431fa7+'/'+_0x5d9850)[_0x8682('0x13')](_0x22d980);}return null;};}function patchUpdates(_0x5e69cd){return function(_0x2df7a9){try{jsonpatch[_0x8682('0x1a')](_0x2df7a9,_0x5e69cd,!![]);}catch(_0x3f4e07){return BPromise[_0x8682('0x1b')](_0x3f4e07);}return _0x2df7a9[_0x8682('0x1c')]();};}function saveUpdates(_0x5f03a6,_0x4cba3c){return function(_0x2e2e67){if(_0x2e2e67){return _0x2e2e67[_0x8682('0x1d')](_0x5f03a6)[_0x8682('0x1e')](function(_0x9b25dd){return _0x9b25dd;});}return null;};}function removeEntity(_0xb385e7,_0x42bb56){return function(_0x14e7ad){if(_0x14e7ad){return _0x14e7ad[_0x8682('0x1f')]()['then'](function(){var _0x95e6e1=_0x14e7ad['get']({'plain':!![]});var _0x2932c5=_0x8682('0x20');return db[_0x8682('0x21')]['destroy']({'where':{'type':_0x2932c5,'resourceId':_0x95e6e1['id']}})[_0x8682('0x1e')](function(){return _0x14e7ad;});})[_0x8682('0x1e')](function(){_0xb385e7[_0x8682('0x11')](0xcc)[_0x8682('0x12')]();});}};}function handleEntityNotFound(_0x4b5250,_0xa30f9d){return function(_0x366037){if(!_0x366037){_0x4b5250['sendStatus'](0x194);}return _0x366037;};}function handleError(_0x593342,_0x3d0504){_0x3d0504=_0x3d0504||0x1f4;return function(_0x409124){logger[_0x8682('0x22')](_0x409124['stack']);if(_0x409124[_0x8682('0x23')]){delete _0x409124['name'];}_0x593342[_0x8682('0x11')](_0x3d0504)[_0x8682('0x24')](_0x409124);};}exports[_0x8682('0x25')]=function(_0x373aa3,_0x4cca76){var _0x4eb1c9={},_0x57dd03={},_0x3c4341={'count':0x0,'rows':[]};var _0x4053d6=_[_0x8682('0x26')](db['SquareOdbc']['rawAttributes'],function(_0x351c8e){return{'name':_0x351c8e[_0x8682('0x27')],'type':_0x351c8e[_0x8682('0x28')][_0x8682('0x29')]};});_0x57dd03['model']=_[_0x8682('0x26')](_0x4053d6,'name');_0x57dd03[_0x8682('0x2a')]=_[_0x8682('0x2b')](_0x373aa3[_0x8682('0x2a')]);_0x57dd03[_0x8682('0x2c')]=_[_0x8682('0x2d')](_0x57dd03[_0x8682('0x2e')],_0x57dd03[_0x8682('0x2a')]);_0x4eb1c9['attributes']=_[_0x8682('0x2d')](_0x57dd03['model'],qs[_0x8682('0x2f')](_0x373aa3[_0x8682('0x2a')]['fields']));_0x4eb1c9[_0x8682('0x30')]=_0x4eb1c9[_0x8682('0x30')]['length']?_0x4eb1c9[_0x8682('0x30')]:_0x57dd03['model'];if(!_0x373aa3[_0x8682('0x2a')][_0x8682('0x31')]('nolimit')){_0x4eb1c9['limit']=qs[_0x8682('0x16')](_0x373aa3[_0x8682('0x2a')][_0x8682('0x16')]);_0x4eb1c9[_0x8682('0x14')]=qs[_0x8682('0x14')](_0x373aa3['query'][_0x8682('0x14')]);}_0x4eb1c9[_0x8682('0x32')]=qs[_0x8682('0x33')](_0x373aa3[_0x8682('0x2a')]['sort']);_0x4eb1c9[_0x8682('0x34')]=qs[_0x8682('0x2c')](_[_0x8682('0x35')](_0x373aa3[_0x8682('0x2a')],_0x57dd03[_0x8682('0x2c')]),_0x4053d6);if(_0x373aa3[_0x8682('0x2a')]['filter']){_0x4eb1c9[_0x8682('0x34')]=_[_0x8682('0x36')](_0x4eb1c9['where'],{'$or':_[_0x8682('0x26')](_0x4053d6,function(_0xe5a208){if(_0xe5a208[_0x8682('0x28')]!==_0x8682('0x37')){var _0x1cef76={};_0x1cef76[_0xe5a208['name']]={'$like':'%'+_0x373aa3[_0x8682('0x2a')]['filter']+'%'};return _0x1cef76;}})});}_0x4eb1c9=_['merge']({},_0x4eb1c9,_0x373aa3[_0x8682('0x38')]);var _0x80d398={'where':_0x4eb1c9[_0x8682('0x34')]};return db[_0x8682('0x39')][_0x8682('0x17')](_0x80d398)[_0x8682('0x1e')](function(_0x3e8400){_0x3c4341[_0x8682('0x17')]=_0x3e8400;if(_0x373aa3[_0x8682('0x2a')][_0x8682('0x3a')]){_0x4eb1c9['include']=[{'all':!![]}];}return db[_0x8682('0x39')]['findAll'](_0x4eb1c9);})[_0x8682('0x1e')](function(_0x38aa95){_0x3c4341[_0x8682('0x3b')]=_0x38aa95;return _0x3c4341;})['then'](respondWithFilteredResult(_0x4cca76,_0x4eb1c9))[_0x8682('0x3c')](handleError(_0x4cca76,null));};exports['show']=function(_0x397b7b,_0x2d2f56){var _0x2e02e7={'raw':!![],'where':{'id':_0x397b7b['params']['id']}},_0x4d9e6={};_0x4d9e6['model']=_['keys'](db[_0x8682('0x39')][_0x8682('0x3d')]);_0x4d9e6['query']=_[_0x8682('0x2b')](_0x397b7b[_0x8682('0x2a')]);_0x4d9e6[_0x8682('0x2c')]=_['intersection'](_0x4d9e6[_0x8682('0x2e')],_0x4d9e6['query']);_0x2e02e7[_0x8682('0x30')]=_[_0x8682('0x2d')](_0x4d9e6[_0x8682('0x2e')],qs['fields'](_0x397b7b[_0x8682('0x2a')][_0x8682('0x2f')]));_0x2e02e7['attributes']=_0x2e02e7[_0x8682('0x30')][_0x8682('0x3e')]?_0x2e02e7[_0x8682('0x30')]:_0x4d9e6['model'];if(_0x397b7b['query'][_0x8682('0x3a')]){_0x2e02e7[_0x8682('0x3f')]=[{'all':!![]}];}_0x2e02e7=_[_0x8682('0x36')]({},_0x2e02e7,_0x397b7b[_0x8682('0x38')]);return db[_0x8682('0x39')][_0x8682('0x40')](_0x2e02e7)[_0x8682('0x1e')](handleEntityNotFound(_0x2d2f56,null))[_0x8682('0x1e')](respondWithResult(_0x2d2f56,null))[_0x8682('0x3c')](handleError(_0x2d2f56,null));};exports[_0x8682('0x41')]=function(_0x479856,_0x25508f){return db[_0x8682('0x39')][_0x8682('0x41')](_0x479856['body'],{})[_0x8682('0x1e')](function(_0xe9fe02){var _0x47f02c=_0x479856[_0x8682('0x42')]['get']({'plain':!![]});if(!_0x47f02c)throw new Error(_0x8682('0x43'));if(_0x47f02c[_0x8682('0x44')]===_0x8682('0x42')){var _0x4b7877=_0xe9fe02['get']({'plain':!![]});var _0x589713=_0x8682('0x20');return db[_0x8682('0x45')][_0x8682('0x40')]({'where':{'name':_0x589713,'userProfileId':_0x47f02c['userProfileId']},'raw':!![]})[_0x8682('0x1e')](function(_0xa4ff5c){if(_0xa4ff5c&&_0xa4ff5c[_0x8682('0x46')]===0x0){return db[_0x8682('0x21')]['create']({'name':_0x4b7877['name'],'resourceId':_0x4b7877['id'],'type':_0xa4ff5c[_0x8682('0x23')],'sectionId':_0xa4ff5c['id']},{})[_0x8682('0x1e')](function(){return _0xe9fe02;});}else{return _0xe9fe02;}})['catch'](function(_0xf550ed){logger[_0x8682('0x22')](_0x8682('0x47'),_0xf550ed);throw _0xf550ed;});}return _0xe9fe02;})[_0x8682('0x1e')](respondWithResult(_0x25508f,0xc9))[_0x8682('0x3c')](handleError(_0x25508f,null));};exports[_0x8682('0x1d')]=function(_0x4a1cdd,_0x189362){if(_0x4a1cdd['body']['id']){delete _0x4a1cdd[_0x8682('0x48')]['id'];}return db[_0x8682('0x39')]['find']({'where':{'id':_0x4a1cdd[_0x8682('0x49')]['id']}})[_0x8682('0x1e')](handleEntityNotFound(_0x189362,null))['then'](saveUpdates(_0x4a1cdd[_0x8682('0x48')],null))['then'](respondWithResult(_0x189362,null))['catch'](handleError(_0x189362,null));};exports[_0x8682('0x1f')]=function(_0x3a2353,_0xfef441){return db[_0x8682('0x39')]['find']({'where':{'id':_0x3a2353[_0x8682('0x49')]['id']}})[_0x8682('0x1e')](handleEntityNotFound(_0xfef441,null))[_0x8682('0x1e')](removeEntity(_0xfef441,null))[_0x8682('0x3c')](handleError(_0xfef441,null));};exports[_0x8682('0x4a')]=function(_0x849214,_0x524b73,_0xf438c4){var _0x53f432;return db[_0x8682('0x39')]['find']({'where':{'id':_0x849214[_0x8682('0x49')]['id']},'attributes':['id',_0x8682('0x4b')]})[_0x8682('0x1e')](handleEntityNotFound(_0x524b73,null))[_0x8682('0x1e')](function(_0x530a5e){if(_0x530a5e){var _0x6539d1=require(_0x8682('0x4c'))();_0x6539d1[_0x8682('0x4d')](_0x530a5e[_0x8682('0x4b')]);_0x6539d1['closeSync']();return _0x530a5e;}})[_0x8682('0x1e')](respondWithResult(_0x524b73,null))[_0x8682('0x3c')](handleError(_0x524b73,null));};
\ No newline at end of file
+var _0x666f=['filters','pick','filter','merge','SquareOdbc','includeAll','findAll','rows','catch','show','params','keys','include','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ODBC','UserProfileSection','autoAssociation','create','test','dsn','odbc','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x666f,0xcb));var _0xf666=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x666f[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0xf666('0x0'));var rimraf=require(_0xf666('0x1'));var zipdir=require(_0xf666('0x2'));var jsonpatch=require(_0xf666('0x3'));var rp=require(_0xf666('0x4'));var moment=require(_0xf666('0x5'));var BPromise=require(_0xf666('0x6'));var Mustache=require(_0xf666('0x7'));var util=require(_0xf666('0x8'));var path=require(_0xf666('0x9'));var sox=require(_0xf666('0xa'));var csv=require(_0xf666('0xb'));var ejs=require(_0xf666('0xc'));var fs=require('fs');var fs_extra=require(_0xf666('0xd'));var _=require(_0xf666('0xe'));var squel=require('squel');var crypto=require(_0xf666('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xf666('0x10'));var toCsv=require(_0xf666('0xb'));var querystring=require('querystring');var Papa=require(_0xf666('0x11'));var Redis=require(_0xf666('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xf666('0x13'));var as=require(_0xf666('0x14'));var hardwareService=require(_0xf666('0x15'));var logger=require(_0xf666('0x16'))('api');var utils=require(_0xf666('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xf666('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41c2f6,_0x296361){_0x296361=_0x296361||0xcc;return function(_0x5f1ea1){if(_0x5f1ea1){return _0x41c2f6[_0xf666('0x19')](_0x296361);}return _0x41c2f6[_0xf666('0x1a')](_0x296361)[_0xf666('0x1b')]();};}function respondWithResult(_0x2d32c5,_0x4d30dc){_0x4d30dc=_0x4d30dc||0xc8;return function(_0x1c9875){if(_0x1c9875){return _0x2d32c5['status'](_0x4d30dc)[_0xf666('0x1c')](_0x1c9875);}};}function respondWithFilteredResult(_0x392251,_0x2b347d){return function(_0xa81e84){if(_0xa81e84){var _0x20e491=typeof _0x2b347d['offset']==='undefined'&&typeof _0x2b347d[_0xf666('0x1d')]===_0xf666('0x1e');var _0x19a447=_0xa81e84[_0xf666('0x1f')];var _0x45821d=_0x20e491?0x0:_0x2b347d[_0xf666('0x20')];var _0x5391a8=_0x20e491?_0xa81e84['count']:_0x2b347d['offset']+_0x2b347d['limit'];var _0x2be8c8;if(_0x5391a8>=_0x19a447){_0x5391a8=_0x19a447;_0x2be8c8=0xc8;}else{_0x2be8c8=0xce;}_0x392251[_0xf666('0x1a')](_0x2be8c8);return _0x392251[_0xf666('0x21')](_0xf666('0x22'),_0x45821d+'-'+_0x5391a8+'/'+_0x19a447)[_0xf666('0x1c')](_0xa81e84);}return null;};}function patchUpdates(_0x1e7282){return function(_0x5044f5){try{jsonpatch[_0xf666('0x23')](_0x5044f5,_0x1e7282,!![]);}catch(_0x54dce6){return BPromise[_0xf666('0x24')](_0x54dce6);}return _0x5044f5[_0xf666('0x25')]();};}function saveUpdates(_0x5336c1,_0x555313){return function(_0x524215){if(_0x524215){return _0x524215[_0xf666('0x26')](_0x5336c1)[_0xf666('0x27')](function(_0x82d1a5){return _0x82d1a5;});}return null;};}function removeEntity(_0x5de10e,_0x171277){return function(_0x370cbb){if(_0x370cbb){return _0x370cbb[_0xf666('0x28')]()[_0xf666('0x27')](function(){var _0x26c675=_0x370cbb[_0xf666('0x29')]({'plain':!![]});var _0x34f210='ODBC';return db[_0xf666('0x2a')][_0xf666('0x28')]({'where':{'type':_0x34f210,'resourceId':_0x26c675['id']}})[_0xf666('0x27')](function(){return _0x370cbb;});})['then'](function(){_0x5de10e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x73fb32,_0x36128c){return function(_0x51e660){if(!_0x51e660){_0x73fb32[_0xf666('0x19')](0x194);}return _0x51e660;};}function handleError(_0x4f53ce,_0x421067){_0x421067=_0x421067||0x1f4;return function(_0x2fa160){logger[_0xf666('0x2b')](_0x2fa160[_0xf666('0x2c')]);if(_0x2fa160['name']){delete _0x2fa160[_0xf666('0x2d')];}_0x4f53ce['status'](_0x421067)[_0xf666('0x2e')](_0x2fa160);};}exports[_0xf666('0x2f')]=function(_0x3724b8,_0x59f199){var _0x3c6a15={},_0x42bc11={},_0x3cbea8={'count':0x0,'rows':[]};var _0x47b8bf=_[_0xf666('0x30')](db['SquareOdbc'][_0xf666('0x31')],function(_0x297d6f){return{'name':_0x297d6f[_0xf666('0x32')],'type':_0x297d6f[_0xf666('0x33')][_0xf666('0x34')]};});_0x42bc11[_0xf666('0x35')]=_[_0xf666('0x30')](_0x47b8bf,'name');_0x42bc11[_0xf666('0x36')]=_['keys'](_0x3724b8[_0xf666('0x36')]);_0x42bc11['filters']=_[_0xf666('0x37')](_0x42bc11[_0xf666('0x35')],_0x42bc11[_0xf666('0x36')]);_0x3c6a15[_0xf666('0x38')]=_[_0xf666('0x37')](_0x42bc11[_0xf666('0x35')],qs[_0xf666('0x39')](_0x3724b8['query'][_0xf666('0x39')]));_0x3c6a15['attributes']=_0x3c6a15['attributes'][_0xf666('0x3a')]?_0x3c6a15['attributes']:_0x42bc11[_0xf666('0x35')];if(!_0x3724b8[_0xf666('0x36')][_0xf666('0x3b')](_0xf666('0x3c'))){_0x3c6a15[_0xf666('0x1d')]=qs['limit'](_0x3724b8[_0xf666('0x36')][_0xf666('0x1d')]);_0x3c6a15[_0xf666('0x20')]=qs[_0xf666('0x20')](_0x3724b8[_0xf666('0x36')][_0xf666('0x20')]);}_0x3c6a15[_0xf666('0x3d')]=qs[_0xf666('0x3e')](_0x3724b8[_0xf666('0x36')][_0xf666('0x3e')]);_0x3c6a15[_0xf666('0x3f')]=qs[_0xf666('0x40')](_[_0xf666('0x41')](_0x3724b8['query'],_0x42bc11[_0xf666('0x40')]),_0x47b8bf);if(_0x3724b8['query'][_0xf666('0x42')]){_0x3c6a15[_0xf666('0x3f')]=_['merge'](_0x3c6a15[_0xf666('0x3f')],{'$or':_[_0xf666('0x30')](_0x47b8bf,function(_0x3b7fd9){if(_0x3b7fd9[_0xf666('0x33')]!=='VIRTUAL'){var _0x1deec2={};_0x1deec2[_0x3b7fd9['name']]={'$like':'%'+_0x3724b8['query'][_0xf666('0x42')]+'%'};return _0x1deec2;}})});}_0x3c6a15=_[_0xf666('0x43')]({},_0x3c6a15,_0x3724b8['options']);var _0x40597c={'where':_0x3c6a15['where']};return db[_0xf666('0x44')][_0xf666('0x1f')](_0x40597c)[_0xf666('0x27')](function(_0x1e60c6){_0x3cbea8['count']=_0x1e60c6;if(_0x3724b8['query'][_0xf666('0x45')]){_0x3c6a15['include']=[{'all':!![]}];}return db['SquareOdbc'][_0xf666('0x46')](_0x3c6a15);})[_0xf666('0x27')](function(_0xecad9c){_0x3cbea8[_0xf666('0x47')]=_0xecad9c;return _0x3cbea8;})[_0xf666('0x27')](respondWithFilteredResult(_0x59f199,_0x3c6a15))[_0xf666('0x48')](handleError(_0x59f199,null));};exports[_0xf666('0x49')]=function(_0x4a0672,_0x143000){var _0x241008={'raw':!![],'where':{'id':_0x4a0672[_0xf666('0x4a')]['id']}},_0x2c5911={};_0x2c5911[_0xf666('0x35')]=_[_0xf666('0x4b')](db[_0xf666('0x44')]['rawAttributes']);_0x2c5911[_0xf666('0x36')]=_[_0xf666('0x4b')](_0x4a0672['query']);_0x2c5911[_0xf666('0x40')]=_['intersection'](_0x2c5911[_0xf666('0x35')],_0x2c5911[_0xf666('0x36')]);_0x241008[_0xf666('0x38')]=_[_0xf666('0x37')](_0x2c5911[_0xf666('0x35')],qs[_0xf666('0x39')](_0x4a0672[_0xf666('0x36')][_0xf666('0x39')]));_0x241008[_0xf666('0x38')]=_0x241008[_0xf666('0x38')][_0xf666('0x3a')]?_0x241008['attributes']:_0x2c5911[_0xf666('0x35')];if(_0x4a0672[_0xf666('0x36')]['includeAll']){_0x241008[_0xf666('0x4c')]=[{'all':!![]}];}_0x241008=_['merge']({},_0x241008,_0x4a0672[_0xf666('0x4d')]);return db[_0xf666('0x44')][_0xf666('0x4e')](_0x241008)['then'](handleEntityNotFound(_0x143000,null))[_0xf666('0x27')](respondWithResult(_0x143000,null))['catch'](handleError(_0x143000,null));};exports['create']=function(_0x5867ce,_0x179c32){return db[_0xf666('0x44')]['create'](_0x5867ce[_0xf666('0x4f')],{})[_0xf666('0x27')](function(_0x3d520c){var _0x33c086=_0x5867ce[_0xf666('0x50')][_0xf666('0x29')]({'plain':!![]});if(!_0x33c086)throw new Error(_0xf666('0x51'));if(_0x33c086['role']===_0xf666('0x50')){var _0x590a52=_0x3d520c[_0xf666('0x29')]({'plain':!![]});var _0x362752=_0xf666('0x52');return db[_0xf666('0x53')][_0xf666('0x4e')]({'where':{'name':_0x362752,'userProfileId':_0x33c086['userProfileId']},'raw':!![]})[_0xf666('0x27')](function(_0x3dbff2){if(_0x3dbff2&&_0x3dbff2[_0xf666('0x54')]===0x0){return db[_0xf666('0x2a')][_0xf666('0x55')]({'name':_0x590a52['name'],'resourceId':_0x590a52['id'],'type':_0x3dbff2[_0xf666('0x2d')],'sectionId':_0x3dbff2['id']},{})[_0xf666('0x27')](function(){return _0x3d520c;});}else{return _0x3d520c;}})['catch'](function(_0x52017e){logger[_0xf666('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x52017e);throw _0x52017e;});}return _0x3d520c;})[_0xf666('0x27')](respondWithResult(_0x179c32,0xc9))[_0xf666('0x48')](handleError(_0x179c32,null));};exports['update']=function(_0x5e4a57,_0x56e660){if(_0x5e4a57[_0xf666('0x4f')]['id']){delete _0x5e4a57[_0xf666('0x4f')]['id'];}return db[_0xf666('0x44')][_0xf666('0x4e')]({'where':{'id':_0x5e4a57[_0xf666('0x4a')]['id']}})['then'](handleEntityNotFound(_0x56e660,null))['then'](saveUpdates(_0x5e4a57[_0xf666('0x4f')],null))['then'](respondWithResult(_0x56e660,null))[_0xf666('0x48')](handleError(_0x56e660,null));};exports[_0xf666('0x28')]=function(_0x38f9ea,_0x2e7aa3){return db[_0xf666('0x44')][_0xf666('0x4e')]({'where':{'id':_0x38f9ea['params']['id']}})[_0xf666('0x27')](handleEntityNotFound(_0x2e7aa3,null))[_0xf666('0x27')](removeEntity(_0x2e7aa3,null))[_0xf666('0x48')](handleError(_0x2e7aa3,null));};exports[_0xf666('0x56')]=function(_0x1a7cfc,_0x44d3c6,_0x481e0f){var _0x365bf3;return db[_0xf666('0x44')]['find']({'where':{'id':_0x1a7cfc[_0xf666('0x4a')]['id']},'attributes':['id',_0xf666('0x57')]})[_0xf666('0x27')](handleEntityNotFound(_0x44d3c6,null))[_0xf666('0x27')](function(_0x11e3d2){if(_0x11e3d2){var _0x445a53=require(_0xf666('0x58'))();_0x445a53['openSync'](_0x11e3d2[_0xf666('0x57')]);_0x445a53['closeSync']();return _0x11e3d2;}})[_0xf666('0x27')](respondWithResult(_0x44d3c6,null))[_0xf666('0x48')](handleError(_0x44d3c6,null));};
\ No newline at end of file
index b36e80d..375832f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd062=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x5a1e5d,_0x576a82){var _0x3d7dce=function(_0x367dd6){while(--_0x367dd6){_0x5a1e5d['push'](_0x5a1e5d['shift']());}};_0x3d7dce(++_0x576a82);}(_0xd062,0xbb));var _0x2d06=function(_0xbd3a4c,_0x2dec21){_0xbd3a4c=_0xbd3a4c-0x0;var _0x61b7e9=_0xd062[_0xbd3a4c];return _0x61b7e9;};'use strict';var _=require(_0x2d06('0x0'));var util=require(_0x2d06('0x1'));var logger=require(_0x2d06('0x2'))(_0x2d06('0x3'));var moment=require(_0x2d06('0x4'));var BPromise=require('bluebird');var rp=require(_0x2d06('0x5'));var fs=require('fs');var path=require(_0x2d06('0x6'));var rimraf=require(_0x2d06('0x7'));var config=require(_0x2d06('0x8'));var attributes=require('./squareOdbc.attributes');module[_0x2d06('0x9')]=function(_0x1d1d4e,_0x23f2c3){return _0x1d1d4e[_0x2d06('0xa')]('SquareOdbc',attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6c18=['request-promise','path','rimraf','square_odbc','api'];(function(_0xf23728,_0x21be9b){var _0x2c377c=function(_0x2fe0c6){while(--_0x2fe0c6){_0xf23728['push'](_0xf23728['shift']());}};_0x2c377c(++_0x21be9b);}(_0x6c18,0x144));var _0x86c1=function(_0x35ffae,_0x5eff8b){_0x35ffae=_0x35ffae-0x0;var _0x5cecac=_0x6c18[_0x35ffae];return _0x5cecac;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x86c1('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x86c1('0x1'));var fs=require('fs');var path=require(_0x86c1('0x2'));var rimraf=require(_0x86c1('0x3'));var config=require('../../config/environment');var attributes=require('./squareOdbc.attributes');module['exports']=function(_0x5b3ac6,_0x596651){return _0x5b3ac6['define']('SquareOdbc',attributes,{'tableName':_0x86c1('0x4'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 58335c6..a0e61e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf5a9=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','include','map','model','stringify','lodash','util'];(function(_0x6fc393,_0x5c5a66){var _0x4c198f=function(_0x4fcd32){while(--_0x4fcd32){_0x6fc393['push'](_0x6fc393['shift']());}};_0x4c198f(++_0x5c5a66);}(_0xf5a9,0x1ab));var _0x9f5a=function(_0x47dcbc,_0x4e15f3){_0x47dcbc=_0x47dcbc-0x0;var _0x1dde5a=_0xf5a9[_0x47dcbc];return _0x1dde5a;};'use strict';var _=require(_0x9f5a('0x0'));var util=require(_0x9f5a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9f5a('0x2'));var fs=require('fs');var Redis=require(_0x9f5a('0x3'));var db=require(_0x9f5a('0x4'))['db'];var utils=require(_0x9f5a('0x5'));var logger=require(_0x9f5a('0x6'))(_0x9f5a('0x7'));var config=require(_0x9f5a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9f5a('0x9')][_0x9f5a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a9318,_0x431869,_0x361431){return new BPromise(function(_0x75587b,_0x160d9f){return client[_0x9f5a('0xb')](_0x3a9318,_0x361431)[_0x9f5a('0xc')](function(_0x34c95c){logger[_0x9f5a('0xd')](_0x9f5a('0xe'),_0x431869,_0x9f5a('0xf'));logger['debug'](_0x9f5a('0x10'),_0x431869,_0x9f5a('0xf'),JSON['stringify'](_0x34c95c));if(_0x34c95c[_0x9f5a('0x11')]){if(_0x34c95c['error'][_0x9f5a('0x12')]===0x1f4){logger[_0x9f5a('0x11')](_0x9f5a('0xe'),_0x431869,_0x34c95c[_0x9f5a('0x11')][_0x9f5a('0x13')]);return _0x160d9f(_0x34c95c[_0x9f5a('0x11')][_0x9f5a('0x13')]);}logger[_0x9f5a('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x431869,_0x34c95c[_0x9f5a('0x11')]['message']);return _0x75587b(_0x34c95c['error'][_0x9f5a('0x13')]);}else{logger['info']('SquareOdbc,\x20%s,\x20%s',_0x431869,_0x9f5a('0xf'));_0x75587b(_0x34c95c[_0x9f5a('0x14')][_0x9f5a('0x13')]);}})[_0x9f5a('0x15')](function(_0x35303f){logger[_0x9f5a('0x11')](_0x9f5a('0xe'),_0x431869,_0x35303f);_0x160d9f(_0x35303f);});});}exports[_0x9f5a('0x16')]=function(_0x564b06){var _0x1c34d0=this;return new Promise(function(_0xbe6885,_0x5e6289){return db[_0x9f5a('0x17')][_0x9f5a('0x18')]({'raw':_0x564b06[_0x9f5a('0x19')]?_0x564b06['options'][_0x9f5a('0x1a')]===undefined?!![]:![]:!![],'where':_0x564b06[_0x9f5a('0x19')]?_0x564b06[_0x9f5a('0x19')][_0x9f5a('0x1b')]||null:null,'attributes':_0x564b06[_0x9f5a('0x19')]?_0x564b06['options'][_0x9f5a('0x1c')]||null:null,'include':_0x564b06[_0x9f5a('0x19')]?_0x564b06[_0x9f5a('0x19')][_0x9f5a('0x1d')]?_[_0x9f5a('0x1e')](_0x564b06[_0x9f5a('0x19')][_0x9f5a('0x1d')],function(_0x524a71){return{'model':db[_0x524a71[_0x9f5a('0x1f')]],'as':_0x524a71['as'],'attributes':_0x524a71[_0x9f5a('0x1c')],'include':_0x524a71[_0x9f5a('0x1d')]?_[_0x9f5a('0x1e')](_0x524a71[_0x9f5a('0x1d')],function(_0x2cac9a){return{'model':db[_0x2cac9a[_0x9f5a('0x1f')]],'as':_0x2cac9a['as'],'attributes':_0x2cac9a[_0x9f5a('0x1c')],'include':_0x2cac9a[_0x9f5a('0x1d')]?_['map'](_0x2cac9a[_0x9f5a('0x1d')],function(_0x5d9cf2){return{'model':db[_0x5d9cf2[_0x9f5a('0x1f')]],'as':_0x5d9cf2['as'],'attributes':_0x5d9cf2[_0x9f5a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9f5a('0xc')](function(_0x4323ac){logger['info'](_0x9f5a('0x16'),_0x564b06);logger['debug'](_0x9f5a('0x16'),_0x564b06,JSON[_0x9f5a('0x20')](_0x4323ac));_0xbe6885(_0x4323ac);})['catch'](function(_0x59847f){logger[_0x9f5a('0x11')](_0x9f5a('0x16'),_0x59847f[_0x9f5a('0x13')],_0x564b06);_0x5e6289(_0x1c34d0['error'](0x1f4,_0x59847f[_0x9f5a('0x13')]));});});};
\ No newline at end of file
+var _0x6ae0=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','code','error','SquareOdbc,\x20%s,\x20%s','message','result','catch','ShowSquareOdbc','find','options','raw','where','attributes','include','model','map','stringify','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x448feb,_0x151bfe){var _0x2558c8=function(_0x51d555){while(--_0x51d555){_0x448feb['push'](_0x448feb['shift']());}};_0x2558c8(++_0x151bfe);}(_0x6ae0,0xe7));var _0x06ae=function(_0x242619,_0x44c6e2){_0x242619=_0x242619-0x0;var _0x577883=_0x6ae0[_0x242619];return _0x577883;};'use strict';var _=require(_0x06ae('0x0'));var util=require('util');var moment=require(_0x06ae('0x1'));var BPromise=require(_0x06ae('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06ae('0x3'));var db=require(_0x06ae('0x4'))['db'];var utils=require(_0x06ae('0x5'));var logger=require(_0x06ae('0x6'))(_0x06ae('0x7'));var config=require(_0x06ae('0x8'));var jayson=require(_0x06ae('0x9'));var client=jayson[_0x06ae('0xa')][_0x06ae('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a068f,_0x29172b,_0x463211){return new BPromise(function(_0x28f3f4,_0x3dbafc){return client[_0x06ae('0xc')](_0x2a068f,_0x463211)[_0x06ae('0xd')](function(_0x32452c){logger[_0x06ae('0xe')]('SquareOdbc,\x20%s,\x20%s',_0x29172b,_0x06ae('0xf'));logger[_0x06ae('0x10')](_0x06ae('0x11'),_0x29172b,_0x06ae('0xf'),JSON['stringify'](_0x32452c));if(_0x32452c['error']){if(_0x32452c['error'][_0x06ae('0x12')]===0x1f4){logger[_0x06ae('0x13')](_0x06ae('0x14'),_0x29172b,_0x32452c['error'][_0x06ae('0x15')]);return _0x3dbafc(_0x32452c[_0x06ae('0x13')][_0x06ae('0x15')]);}logger[_0x06ae('0x13')](_0x06ae('0x14'),_0x29172b,_0x32452c[_0x06ae('0x13')][_0x06ae('0x15')]);return _0x28f3f4(_0x32452c['error'][_0x06ae('0x15')]);}else{logger[_0x06ae('0xe')](_0x06ae('0x14'),_0x29172b,_0x06ae('0xf'));_0x28f3f4(_0x32452c[_0x06ae('0x16')][_0x06ae('0x15')]);}})[_0x06ae('0x17')](function(_0x2f55a4){logger[_0x06ae('0x13')](_0x06ae('0x14'),_0x29172b,_0x2f55a4);_0x3dbafc(_0x2f55a4);});});}exports[_0x06ae('0x18')]=function(_0xe03d00){var _0x21c7a0=this;return new Promise(function(_0x277a3f,_0x3b2daf){return db['SquareOdbc'][_0x06ae('0x19')]({'raw':_0xe03d00['options']?_0xe03d00[_0x06ae('0x1a')][_0x06ae('0x1b')]===undefined?!![]:![]:!![],'where':_0xe03d00[_0x06ae('0x1a')]?_0xe03d00[_0x06ae('0x1a')][_0x06ae('0x1c')]||null:null,'attributes':_0xe03d00[_0x06ae('0x1a')]?_0xe03d00[_0x06ae('0x1a')][_0x06ae('0x1d')]||null:null,'include':_0xe03d00['options']?_0xe03d00['options']['include']?_['map'](_0xe03d00[_0x06ae('0x1a')][_0x06ae('0x1e')],function(_0x2fe729){return{'model':db[_0x2fe729[_0x06ae('0x1f')]],'as':_0x2fe729['as'],'attributes':_0x2fe729[_0x06ae('0x1d')],'include':_0x2fe729[_0x06ae('0x1e')]?_['map'](_0x2fe729['include'],function(_0x188dfd){return{'model':db[_0x188dfd[_0x06ae('0x1f')]],'as':_0x188dfd['as'],'attributes':_0x188dfd['attributes'],'include':_0x188dfd['include']?_[_0x06ae('0x20')](_0x188dfd[_0x06ae('0x1e')],function(_0x25d778){return{'model':db[_0x25d778['model']],'as':_0x25d778['as'],'attributes':_0x25d778[_0x06ae('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x06ae('0xd')](function(_0x2e43b1){logger['info'](_0x06ae('0x18'),_0xe03d00);logger['debug']('ShowSquareOdbc',_0xe03d00,JSON[_0x06ae('0x21')](_0x2e43b1));_0x277a3f(_0x2e43b1);})[_0x06ae('0x17')](function(_0x391117){logger[_0x06ae('0x13')](_0x06ae('0x18'),_0x391117[_0x06ae('0x15')],_0xe03d00);_0x3b2daf(_0x21c7a0[_0x06ae('0x13')](0x1f4,_0x391117[_0x06ae('0x15')]));});});};
\ No newline at end of file
index 0559d49..44cdda7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9972=['removeUsers','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./squareProject.controller','isAuthenticated','index','get','show','/:id/users','getUsers','create','addUsers','/:id','update','delete'];(function(_0x397dd0,_0x58a7a8){var _0x4188b2=function(_0x173bb7){while(--_0x173bb7){_0x397dd0['push'](_0x397dd0['shift']());}};_0x4188b2(++_0x58a7a8);}(_0x9972,0xaa));var _0x2997=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x9972[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0x2997('0x0'));var util=require(_0x2997('0x1'));var path=require(_0x2997('0x2'));var timeout=require(_0x2997('0x3'));var express=require('express');var router=express[_0x2997('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2997('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2997('0x6'));var controller=require(_0x2997('0x7'));router['get']('/',auth[_0x2997('0x8')](),controller[_0x2997('0x9')]);router[_0x2997('0xa')]('/:id',auth[_0x2997('0x8')](),controller[_0x2997('0xb')]);router[_0x2997('0xa')](_0x2997('0xc'),auth[_0x2997('0x8')](),controller[_0x2997('0xd')]);router['post']('/',auth[_0x2997('0x8')](),controller[_0x2997('0xe')]);router['post'](_0x2997('0xc'),auth['isAuthenticated'](),controller[_0x2997('0xf')]);router['put'](_0x2997('0x10'),auth[_0x2997('0x8')](),controller[_0x2997('0x11')]);router['delete'](_0x2997('0x10'),auth[_0x2997('0x8')](),controller['destroy']);router[_0x2997('0x12')](_0x2997('0xc'),auth[_0x2997('0x8')](),controller[_0x2997('0x13')]);module[_0x2997('0x14')]=router;
\ No newline at end of file
+var _0xe24e=['put','update','delete','destroy','removeUsers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','isAuthenticated','index','get','/:id','/:id/users','getUsers','post','create','addUsers'];(function(_0x3f0a91,_0x4a68e5){var _0x5cc848=function(_0x277ebe){while(--_0x277ebe){_0x3f0a91['push'](_0x3f0a91['shift']());}};_0x5cc848(++_0x4a68e5);}(_0xe24e,0x15f));var _0xee24=function(_0x57db49,_0x288094){_0x57db49=_0x57db49-0x0;var _0xd0636f=_0xe24e[_0x57db49];return _0xd0636f;};'use strict';var multer=require(_0xee24('0x0'));var util=require(_0xee24('0x1'));var path=require(_0xee24('0x2'));var timeout=require(_0xee24('0x3'));var express=require(_0xee24('0x4'));var router=express[_0xee24('0x5')]();var fs_extra=require(_0xee24('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xee24('0x7'));var config=require('../../config/environment');var controller=require('./squareProject.controller');router['get']('/',auth[_0xee24('0x8')](),controller[_0xee24('0x9')]);router[_0xee24('0xa')](_0xee24('0xb'),auth[_0xee24('0x8')](),controller['show']);router[_0xee24('0xa')](_0xee24('0xc'),auth[_0xee24('0x8')](),controller[_0xee24('0xd')]);router[_0xee24('0xe')]('/',auth[_0xee24('0x8')](),controller[_0xee24('0xf')]);router[_0xee24('0xe')]('/:id/users',auth[_0xee24('0x8')](),controller[_0xee24('0x10')]);router[_0xee24('0x11')](_0xee24('0xb'),auth[_0xee24('0x8')](),controller[_0xee24('0x12')]);router[_0xee24('0x13')](_0xee24('0xb'),auth['isAuthenticated'](),controller[_0xee24('0x14')]);router[_0xee24('0x13')](_0xee24('0xc'),auth[_0xee24('0x8')](),controller[_0xee24('0x15')]);module[_0xee24('0x16')]=router;
\ No newline at end of file
index d265e45..3c31deb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd228=['preproduction','toString','utf8','long','production','DATE','sequelize','STRING','name','TEXT','BLOB','getDataValue'];(function(_0x292e86,_0x481e85){var _0x6647f2=function(_0x2e89fe){while(--_0x2e89fe){_0x292e86['push'](_0x292e86['shift']());}};_0x6647f2(++_0x481e85);}(_0xd228,0x1c2));var _0x8d22=function(_0x48168a,_0xf9dfe5){_0x48168a=_0x48168a-0x0;var _0x346d98=_0xd228[_0x48168a];return _0x346d98;};'use strict';var Sequelize=require(_0x8d22('0x0'));module['exports']={'name':{'type':Sequelize[_0x8d22('0x1')],'unique':_0x8d22('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x8d22('0x1')]},'notes':{'type':Sequelize[_0x8d22('0x3')]},'preproduction':{'type':Sequelize[_0x8d22('0x4')]('long'),'get':function(){if(this[_0x8d22('0x5')](_0x8d22('0x6'))){return this['getDataValue'](_0x8d22('0x6'))[_0x8d22('0x7')](_0x8d22('0x8'));}}},'production':{'type':Sequelize[_0x8d22('0x4')](_0x8d22('0x9')),'get':function(){if(this[_0x8d22('0x5')](_0x8d22('0xa'))){return this[_0x8d22('0x5')](_0x8d22('0xa'))[_0x8d22('0x7')](_0x8d22('0x8'));}}},'savedAt':{'type':Sequelize[_0x8d22('0xb')]},'publishedAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
+var _0xe1c7=['preproduction','toString','production','utf8','DATE','sequelize','STRING','name','TEXT','BLOB','long','getDataValue'];(function(_0x5be795,_0x1cb1b8){var _0x4e8a3b=function(_0x5584ef){while(--_0x5584ef){_0x5be795['push'](_0x5be795['shift']());}};_0x4e8a3b(++_0x1cb1b8);}(_0xe1c7,0x71));var _0x7e1c=function(_0x4ed32d,_0x327695){_0x4ed32d=_0x4ed32d-0x0;var _0xf624df=_0xe1c7[_0x4ed32d];return _0xf624df;};'use strict';var Sequelize=require(_0x7e1c('0x0'));module['exports']={'name':{'type':Sequelize[_0x7e1c('0x1')],'unique':_0x7e1c('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0x7e1c('0x3')]},'preproduction':{'type':Sequelize[_0x7e1c('0x4')](_0x7e1c('0x5')),'get':function(){if(this[_0x7e1c('0x6')](_0x7e1c('0x7'))){return this['getDataValue'](_0x7e1c('0x7'))[_0x7e1c('0x8')]('utf8');}}},'production':{'type':Sequelize[_0x7e1c('0x4')](_0x7e1c('0x5')),'get':function(){if(this[_0x7e1c('0x6')]('production')){return this[_0x7e1c('0x6')](_0x7e1c('0x9'))[_0x7e1c('0x8')](_0x7e1c('0xa'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x7e1c('0xb')]}};
\ No newline at end of file
index 645aa91..c0ca506 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1eea=['../../components/parsers/qs','../../config/environment','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','update','then','destroy','UserProfileResource','stringify','error','stack','name','send','net','connect','port','index','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','SquareProject','rows','catch','show','params','keys','include','find','create','user','get','SquareProjects','userProfileId','autoAssociation','body','spread','production','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','lodash','ioredis'];(function(_0x49d07c,_0x4bb3d5){var _0x330da9=function(_0x4cafe4){while(--_0x4cafe4){_0x49d07c['push'](_0x49d07c['shift']());}};_0x330da9(++_0x4bb3d5);}(_0x1eea,0x17a));var _0xa1ee=function(_0x356fe9,_0x4b26a3){_0x356fe9=_0x356fe9-0x0;var _0x87813b=_0x1eea[_0x356fe9];return _0x87813b;};'use strict';var _=require(_0xa1ee('0x0'));var Redis=require(_0xa1ee('0x1'));var qs=require(_0xa1ee('0x2'));var logger=require('../../config/logger')('api');var config=require(_0xa1ee('0x3'));var db=require('../../mysqldb')['db'];config[_0xa1ee('0x4')]=_[_0xa1ee('0x5')](config[_0xa1ee('0x4')],{'host':_0xa1ee('0x6'),'port':0x18eb});var socket=require(_0xa1ee('0x7'))(new Redis(config['redis']));require(_0xa1ee('0x8'))['register'](socket);function respondWithStatusCode(_0x4f5eef,_0xcf0ed7){_0xcf0ed7=_0xcf0ed7||0xcc;return function(_0x17cdfc){if(_0x17cdfc){return _0x4f5eef[_0xa1ee('0x9')](_0xcf0ed7);}return _0x4f5eef[_0xa1ee('0xa')](_0xcf0ed7)[_0xa1ee('0xb')]();};}function respondWithResult(_0x157bc6,_0x581855){_0x581855=_0x581855||0xc8;return function(_0x44979d){if(_0x44979d){return _0x157bc6[_0xa1ee('0xa')](_0x581855)[_0xa1ee('0xc')](_0x44979d);}};}function respondWithFilteredResult(_0x20ec9e,_0x4e2a9f){return function(_0x2c19a7){if(_0x2c19a7){var _0x575e11=typeof _0x4e2a9f[_0xa1ee('0xd')]===_0xa1ee('0xe')&&typeof _0x4e2a9f[_0xa1ee('0xf')]===_0xa1ee('0xe');var _0x100973=_0x2c19a7[_0xa1ee('0x10')];var _0x172461=_0x575e11?0x0:_0x4e2a9f['offset'];var _0x1e1078=_0x575e11?_0x2c19a7[_0xa1ee('0x10')]:_0x4e2a9f[_0xa1ee('0xd')]+_0x4e2a9f[_0xa1ee('0xf')];var _0xb8f6c3;if(_0x1e1078>=_0x100973){_0x1e1078=_0x100973;_0xb8f6c3=0xc8;}else{_0xb8f6c3=0xce;}_0x20ec9e['status'](_0xb8f6c3);return _0x20ec9e[_0xa1ee('0x11')]('Content-Range',_0x172461+'-'+_0x1e1078+'/'+_0x100973)[_0xa1ee('0xc')](_0x2c19a7);}return null;};}function saveUpdates(_0x3968ea){return function(_0x421dd7){if(_0x421dd7){return _0x421dd7[_0xa1ee('0x12')](_0x3968ea)[_0xa1ee('0x13')](function(_0x13a556){return _0x13a556;});}return null;};}function removeEntity(_0x39e7ba){return function(_0x20c622){if(_0x20c622){return _0x20c622[_0xa1ee('0x14')]()[_0xa1ee('0x13')](function(){var _0x593b67=_0x20c622['get']({'plain':!![]});var _0xb90c9d='SquareProjects';return db[_0xa1ee('0x15')]['destroy']({'where':{'type':_0xb90c9d,'resourceId':_0x593b67['id']}})[_0xa1ee('0x13')](function(){return _0x20c622;});})[_0xa1ee('0x13')](function(){return createAgiSocket();})[_0xa1ee('0x13')](function(_0x100389){_0x100389[_0xa1ee('0xb')](JSON[_0xa1ee('0x16')]({'id':_0x20c622['id'],'deleted':!![]}));})[_0xa1ee('0x13')](function(){_0x39e7ba[_0xa1ee('0xa')](0xcc)[_0xa1ee('0xb')]();});}};}function handleEntityNotFound(_0x59023b){return function(_0x575d2c){if(!_0x575d2c){_0x59023b[_0xa1ee('0x9')](0x194);}return _0x575d2c;};}function handleError(_0x369037,_0xac437){_0xac437=_0xac437||0x1f4;return function(_0x5f31df){logger[_0xa1ee('0x17')](_0x5f31df[_0xa1ee('0x18')]);if(_0x5f31df[_0xa1ee('0x19')]){delete _0x5f31df[_0xa1ee('0x19')];}_0x369037['status'](_0xac437)[_0xa1ee('0x1a')](_0x5f31df);};}function createAgiSocket(){try{var _0x535ec6=require(_0xa1ee('0x1b'));var _0x3bc0c5=new _0x535ec6['Socket']();return _0x3bc0c5[_0xa1ee('0x1c')](config['agi'][_0xa1ee('0x1d')]||0x11dd,'127.0.0.1');}catch(_0x540bda){throw _0x540bda;}}exports[_0xa1ee('0x1e')]=function(_0x3ec02d,_0x54db79){var _0x2bf758={},_0x48055d={},_0x25bc1c={'count':0x0,'rows':[]};var _0x4ce31b=_['map'](db['SquareProject'][_0xa1ee('0x1f')],function(_0x420d52){return{'name':_0x420d52[_0xa1ee('0x20')],'type':_0x420d52[_0xa1ee('0x21')][_0xa1ee('0x22')]};});_0x48055d['model']=_['map'](_0x4ce31b,_0xa1ee('0x19'));_0x48055d[_0xa1ee('0x23')]=_['keys'](_0x3ec02d['query']);_0x48055d[_0xa1ee('0x24')]=_[_0xa1ee('0x25')](_0x48055d[_0xa1ee('0x26')],_0x48055d[_0xa1ee('0x23')]);_0x2bf758[_0xa1ee('0x27')]=_[_0xa1ee('0x25')](_0x48055d[_0xa1ee('0x26')],qs[_0xa1ee('0x28')](_0x3ec02d[_0xa1ee('0x23')][_0xa1ee('0x28')]));_0x2bf758[_0xa1ee('0x27')]=_0x2bf758[_0xa1ee('0x27')]['length']?_0x2bf758['attributes']:_0x48055d[_0xa1ee('0x26')];if(!_0x3ec02d[_0xa1ee('0x23')][_0xa1ee('0x29')](_0xa1ee('0x2a'))){_0x2bf758[_0xa1ee('0xf')]=qs[_0xa1ee('0xf')](_0x3ec02d[_0xa1ee('0x23')]['limit']);_0x2bf758[_0xa1ee('0xd')]=qs[_0xa1ee('0xd')](_0x3ec02d['query']['offset']);}_0x2bf758['order']=qs[_0xa1ee('0x2b')](_0x3ec02d[_0xa1ee('0x23')]['sort']);_0x2bf758[_0xa1ee('0x2c')]=qs[_0xa1ee('0x24')](_[_0xa1ee('0x2d')](_0x3ec02d[_0xa1ee('0x23')],_0x48055d[_0xa1ee('0x24')]),_0x4ce31b);if(_0x3ec02d[_0xa1ee('0x23')][_0xa1ee('0x2e')]){_0x2bf758[_0xa1ee('0x2c')]=_[_0xa1ee('0x2f')](_0x2bf758['where'],{'$or':_[_0xa1ee('0x30')](_0x4ce31b,function(_0xd7f68){if(_0xd7f68['type']!==_0xa1ee('0x31')){var _0x44f1c0={};_0x44f1c0[_0xd7f68['name']]={'$like':'%'+_0x3ec02d['query']['filter']+'%'};return _0x44f1c0;}})});}_0x2bf758=_[_0xa1ee('0x2f')]({},_0x2bf758,_0x3ec02d[_0xa1ee('0x32')]);var _0x34099e={'where':_0x2bf758['where']};return db[_0xa1ee('0x33')][_0xa1ee('0x10')](_0x34099e)['then'](function(_0x159025){_0x25bc1c['count']=_0x159025;if(_0x3ec02d[_0xa1ee('0x23')]['includeAll']){_0x2bf758['include']=[{'all':!![]}];}return db['SquareProject']['findAll'](_0x2bf758);})[_0xa1ee('0x13')](function(_0x183261){_0x25bc1c[_0xa1ee('0x34')]=_0x183261;return _0x25bc1c;})['then'](respondWithFilteredResult(_0x54db79,_0x2bf758))[_0xa1ee('0x35')](handleError(_0x54db79,null));};exports[_0xa1ee('0x36')]=function(_0x4f24e1,_0x8f5a39){var _0x4fc185={'raw':![],'where':{'id':_0x4f24e1[_0xa1ee('0x37')]['id']}},_0xe8ba45={};_0xe8ba45[_0xa1ee('0x26')]=_[_0xa1ee('0x38')](db['SquareProject'][_0xa1ee('0x1f')]);_0xe8ba45[_0xa1ee('0x23')]=_[_0xa1ee('0x38')](_0x4f24e1[_0xa1ee('0x23')]);_0xe8ba45[_0xa1ee('0x24')]=_['intersection'](_0xe8ba45['model'],_0xe8ba45[_0xa1ee('0x23')]);_0x4fc185[_0xa1ee('0x27')]=_[_0xa1ee('0x25')](_0xe8ba45[_0xa1ee('0x26')],qs[_0xa1ee('0x28')](_0x4f24e1[_0xa1ee('0x23')][_0xa1ee('0x28')]));_0x4fc185[_0xa1ee('0x27')]=_0x4fc185[_0xa1ee('0x27')]['length']?_0x4fc185[_0xa1ee('0x27')]:_0xe8ba45[_0xa1ee('0x26')];if(_0x4f24e1[_0xa1ee('0x23')]['includeAll']){_0x4fc185[_0xa1ee('0x39')]=[{'all':!![]}];}_0x4fc185=_['merge']({},_0x4fc185,_0x4f24e1[_0xa1ee('0x32')]);return db[_0xa1ee('0x33')][_0xa1ee('0x3a')](_0x4fc185)['then'](handleEntityNotFound(_0x8f5a39,null))['then'](respondWithResult(_0x8f5a39,null))[_0xa1ee('0x35')](handleError(_0x8f5a39,null));};exports[_0xa1ee('0x3b')]=function(_0x307ae6,_0x21f4f0){return db[_0xa1ee('0x33')][_0xa1ee('0x3b')](_0x307ae6['body'],{})[_0xa1ee('0x13')](function(_0x5d9703){var _0x2acd22=_0x307ae6[_0xa1ee('0x3c')][_0xa1ee('0x3d')]({'plain':!![]});if(!_0x2acd22)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2acd22['role']===_0xa1ee('0x3c')){var _0x15abd6=_0x5d9703['get']({'plain':!![]});var _0x981e4b=_0xa1ee('0x3e');return db['UserProfileSection'][_0xa1ee('0x3a')]({'where':{'name':_0x981e4b,'userProfileId':_0x2acd22[_0xa1ee('0x3f')]},'raw':!![]})[_0xa1ee('0x13')](function(_0x2f6139){if(_0x2f6139&&_0x2f6139[_0xa1ee('0x40')]===0x0){return db[_0xa1ee('0x15')][_0xa1ee('0x3b')]({'name':_0x15abd6[_0xa1ee('0x19')],'resourceId':_0x15abd6['id'],'type':_0x2f6139[_0xa1ee('0x19')],'sectionId':_0x2f6139['id']},{})[_0xa1ee('0x13')](function(){return _0x5d9703;});}else{return _0x5d9703;}})[_0xa1ee('0x35')](function(_0x18d96e){logger[_0xa1ee('0x17')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x18d96e);throw _0x18d96e;});}return _0x5d9703;})[_0xa1ee('0x13')](respondWithResult(_0x21f4f0,0xc9))[_0xa1ee('0x35')](handleError(_0x21f4f0,null));};exports[_0xa1ee('0x12')]=function(_0x5d4212,_0x207578){if(_0x5d4212['body']['id']){delete _0x5d4212[_0xa1ee('0x41')]['id'];}return db['SquareProject'][_0xa1ee('0x3a')]({'where':{'id':_0x5d4212['params']['id']}})['then'](handleEntityNotFound(_0x207578,null))['then'](saveUpdates(_0x5d4212[_0xa1ee('0x41')],null))[_0xa1ee('0x13')](function(_0x1558b5){if(!_0x1558b5)return;var _0x2136aa=_0x1558b5[_0xa1ee('0x3d')]({'plain':!![]});return[createAgiSocket(),_0x2136aa];})[_0xa1ee('0x42')](function(_0x672413,_0x3a56a0){_0x672413[_0xa1ee('0xb')](JSON['stringify'](_[_0xa1ee('0x2d')](_0x3a56a0,['id',_0xa1ee('0x19'),_0xa1ee('0x43')])));return _0x3a56a0;})[_0xa1ee('0x13')](respondWithResult(_0x207578,null))['catch'](handleError(_0x207578,null));};exports[_0xa1ee('0x14')]=function(_0x2168fd,_0x4c9e3e){return db['SquareProject']['find']({'where':{'id':_0x2168fd['params']['id']}})[_0xa1ee('0x13')](handleEntityNotFound(_0x4c9e3e,null))[_0xa1ee('0x13')](removeEntity(_0x4c9e3e,null))[_0xa1ee('0x35')](handleError(_0x4c9e3e,null));};exports[_0xa1ee('0x44')]=function(_0x29406f,_0x2859a3){return db[_0xa1ee('0x33')][_0xa1ee('0x3a')]({'where':{'id':_0x29406f[_0xa1ee('0x37')]['id']}})['then'](handleEntityNotFound(_0x2859a3,null))[_0xa1ee('0x13')](function(_0x529d4e){if(_0x529d4e){return _0x529d4e[_0xa1ee('0x44')](_0x29406f[_0xa1ee('0x41')][_0xa1ee('0x45')],_[_0xa1ee('0x46')](_0x29406f[_0xa1ee('0x41')],['ids','id'])||{});}})['then'](respondWithResult(_0x2859a3,null))[_0xa1ee('0x35')](handleError(_0x2859a3,null));};exports[_0xa1ee('0x47')]=function(_0x194c58,_0x2a3ee8){return db[_0xa1ee('0x33')][_0xa1ee('0x3a')]({'where':{'id':_0x194c58['params']['id']}})[_0xa1ee('0x13')](handleEntityNotFound(_0x2a3ee8,null))[_0xa1ee('0x13')](function(_0x136cca){if(_0x136cca){return _0x136cca[_0xa1ee('0x47')](_0x194c58[_0xa1ee('0x23')][_0xa1ee('0x45')])[_0xa1ee('0x13')](function(){if(_[_0xa1ee('0x48')](_0x194c58[_0xa1ee('0x23')]['ids'])){for(var _0x4c9872=0x0;_0x4c9872<_0x194c58[_0xa1ee('0x23')]['ids']['length'];_0x4c9872+=0x1){socket[_0xa1ee('0x49')](_0xa1ee('0x4a'),{'UserId':Number(_0x194c58[_0xa1ee('0x23')][_0xa1ee('0x45')][_0x4c9872]),'SquareProjectId':Number(_0x194c58[_0xa1ee('0x37')]['id'])});}}else{socket[_0xa1ee('0x49')](_0xa1ee('0x4a'),{'UserId':Number(_0x194c58['query'][_0xa1ee('0x45')]),'SquareProjectId':Number(_0x194c58[_0xa1ee('0x37')]['id'])});}});}})[_0xa1ee('0x13')](respondWithStatusCode(_0x2a3ee8,null))[_0xa1ee('0x35')](handleError(_0x2a3ee8,null));};exports[_0xa1ee('0x4b')]=function(_0x264eba,_0x1e0156){var _0x50c628={};var _0x2e2c94={};var _0x393fcc;var _0x413006;return db[_0xa1ee('0x33')]['findOne']({'where':{'id':_0x264eba[_0xa1ee('0x37')]['id']}})['then'](handleEntityNotFound(_0x1e0156,null))[_0xa1ee('0x13')](function(_0x2ee3b2){if(_0x2ee3b2){_0x393fcc=_0x2ee3b2;_0x2e2c94[_0xa1ee('0x26')]=_[_0xa1ee('0x38')](db['User'][_0xa1ee('0x1f')]);_0x2e2c94[_0xa1ee('0x23')]=_[_0xa1ee('0x38')](_0x264eba[_0xa1ee('0x23')]);_0x2e2c94[_0xa1ee('0x24')]=_[_0xa1ee('0x25')](_0x2e2c94[_0xa1ee('0x26')],_0x2e2c94[_0xa1ee('0x23')]);_0x50c628[_0xa1ee('0x27')]=_[_0xa1ee('0x25')](_0x2e2c94[_0xa1ee('0x26')],qs[_0xa1ee('0x28')](_0x264eba[_0xa1ee('0x23')][_0xa1ee('0x28')]));_0x50c628[_0xa1ee('0x27')]=_0x50c628[_0xa1ee('0x27')]['length']?_0x50c628[_0xa1ee('0x27')]:_0x2e2c94[_0xa1ee('0x26')];_0x50c628['order']=qs['sort'](_0x264eba['query'][_0xa1ee('0x2b')]);_0x50c628['where']=qs['filters'](_[_0xa1ee('0x2d')](_0x264eba['query'],_0x2e2c94[_0xa1ee('0x24')]));if(_0x264eba[_0xa1ee('0x23')][_0xa1ee('0x2e')]){_0x50c628['where']=_['merge'](_0x50c628['where'],{'$or':_[_0xa1ee('0x30')](_0x50c628[_0xa1ee('0x27')],function(_0x189569){var _0x104008={};_0x104008[_0x189569]={'$like':'%'+_0x264eba[_0xa1ee('0x23')]['filter']+'%'};return _0x104008;})});}_0x50c628=_['merge']({},_0x50c628,_0x264eba['options']);return _0x393fcc['getUsers'](_0x50c628);}})[_0xa1ee('0x13')](function(_0x3aac09){if(_0x3aac09){_0x413006=_0x3aac09['length'];if(!_0x264eba[_0xa1ee('0x23')][_0xa1ee('0x29')](_0xa1ee('0x2a'))){_0x50c628[_0xa1ee('0xf')]=qs[_0xa1ee('0xf')](_0x264eba[_0xa1ee('0x23')][_0xa1ee('0xf')]);_0x50c628['offset']=qs['offset'](_0x264eba['query'][_0xa1ee('0xd')]);}return _0x393fcc['getUsers'](_0x50c628);}})[_0xa1ee('0x13')](function(_0x3881ee){if(_0x3881ee){return _0x3881ee?{'count':_0x413006,'rows':_0x3881ee}:null;}})[_0xa1ee('0x13')](respondWithResult(_0x1e0156,null))['catch'](handleError(_0x1e0156,null));};
\ No newline at end of file
+var _0xe322=['userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','spread','pick','production','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','findOne','getUsers','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','./squareProject.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','SquareProjects','stringify','error','stack','name','send','net','Socket','port','index','SquareProject','rawAttributes','type','key','model','map','keys','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','params','intersection','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xe322,0x10f));var _0x2e32=function(_0x19b665,_0x59485a){_0x19b665=_0x19b665-0x0;var _0x5b68ff=_0xe322[_0x19b665];return _0x5b68ff;};'use strict';var _=require(_0x2e32('0x0'));var Redis=require(_0x2e32('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x2e32('0x2'))(_0x2e32('0x3'));var config=require(_0x2e32('0x4'));var db=require(_0x2e32('0x5'))['db'];config['redis']=_[_0x2e32('0x6')](config[_0x2e32('0x7')],{'host':_0x2e32('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2e32('0x9'))[_0x2e32('0xa')](socket);function respondWithStatusCode(_0x56305c,_0x18bd11){_0x18bd11=_0x18bd11||0xcc;return function(_0x3f6bd4){if(_0x3f6bd4){return _0x56305c[_0x2e32('0xb')](_0x18bd11);}return _0x56305c[_0x2e32('0xc')](_0x18bd11)[_0x2e32('0xd')]();};}function respondWithResult(_0x3818e3,_0x477c38){_0x477c38=_0x477c38||0xc8;return function(_0x26a62){if(_0x26a62){return _0x3818e3[_0x2e32('0xc')](_0x477c38)[_0x2e32('0xe')](_0x26a62);}};}function respondWithFilteredResult(_0x1dc438,_0x301302){return function(_0x4b8480){if(_0x4b8480){var _0x3fa933=typeof _0x301302[_0x2e32('0xf')]===_0x2e32('0x10')&&typeof _0x301302[_0x2e32('0x11')]==='undefined';var _0x4ff56a=_0x4b8480[_0x2e32('0x12')];var _0x1cfc7a=_0x3fa933?0x0:_0x301302[_0x2e32('0xf')];var _0xaef20c=_0x3fa933?_0x4b8480[_0x2e32('0x12')]:_0x301302[_0x2e32('0xf')]+_0x301302[_0x2e32('0x11')];var _0x269211;if(_0xaef20c>=_0x4ff56a){_0xaef20c=_0x4ff56a;_0x269211=0xc8;}else{_0x269211=0xce;}_0x1dc438['status'](_0x269211);return _0x1dc438[_0x2e32('0x13')](_0x2e32('0x14'),_0x1cfc7a+'-'+_0xaef20c+'/'+_0x4ff56a)[_0x2e32('0xe')](_0x4b8480);}return null;};}function saveUpdates(_0x1ff755){return function(_0x480417){if(_0x480417){return _0x480417[_0x2e32('0x15')](_0x1ff755)['then'](function(_0x23fa74){return _0x23fa74;});}return null;};}function removeEntity(_0x4e360c){return function(_0x13256a){if(_0x13256a){return _0x13256a[_0x2e32('0x16')]()[_0x2e32('0x17')](function(){var _0x32f83f=_0x13256a['get']({'plain':!![]});var _0x59e9fe=_0x2e32('0x18');return db['UserProfileResource'][_0x2e32('0x16')]({'where':{'type':_0x59e9fe,'resourceId':_0x32f83f['id']}})[_0x2e32('0x17')](function(){return _0x13256a;});})[_0x2e32('0x17')](function(){return createAgiSocket();})['then'](function(_0x437ce2){_0x437ce2[_0x2e32('0xd')](JSON[_0x2e32('0x19')]({'id':_0x13256a['id'],'deleted':!![]}));})['then'](function(){_0x4e360c[_0x2e32('0xc')](0xcc)[_0x2e32('0xd')]();});}};}function handleEntityNotFound(_0x195079){return function(_0x446c14){if(!_0x446c14){_0x195079[_0x2e32('0xb')](0x194);}return _0x446c14;};}function handleError(_0x35ac0c,_0x2b73cc){_0x2b73cc=_0x2b73cc||0x1f4;return function(_0x2d193f){logger[_0x2e32('0x1a')](_0x2d193f[_0x2e32('0x1b')]);if(_0x2d193f[_0x2e32('0x1c')]){delete _0x2d193f[_0x2e32('0x1c')];}_0x35ac0c[_0x2e32('0xc')](_0x2b73cc)[_0x2e32('0x1d')](_0x2d193f);};}function createAgiSocket(){try{var _0x4620ab=require(_0x2e32('0x1e'));var _0x1ea10a=new _0x4620ab[(_0x2e32('0x1f'))]();return _0x1ea10a['connect'](config['agi'][_0x2e32('0x20')]||0x11dd,'127.0.0.1');}catch(_0x21a812){throw _0x21a812;}}exports[_0x2e32('0x21')]=function(_0x5c1b7b,_0x47f9f6){var _0x4f937e={},_0x4a79ff={},_0x1aeada={'count':0x0,'rows':[]};var _0xe6061=_['map'](db[_0x2e32('0x22')][_0x2e32('0x23')],function(_0x2036f5){return{'name':_0x2036f5['fieldName'],'type':_0x2036f5[_0x2e32('0x24')][_0x2e32('0x25')]};});_0x4a79ff[_0x2e32('0x26')]=_[_0x2e32('0x27')](_0xe6061,_0x2e32('0x1c'));_0x4a79ff['query']=_[_0x2e32('0x28')](_0x5c1b7b[_0x2e32('0x29')]);_0x4a79ff['filters']=_['intersection'](_0x4a79ff[_0x2e32('0x26')],_0x4a79ff['query']);_0x4f937e['attributes']=_['intersection'](_0x4a79ff[_0x2e32('0x26')],qs[_0x2e32('0x2a')](_0x5c1b7b[_0x2e32('0x29')][_0x2e32('0x2a')]));_0x4f937e[_0x2e32('0x2b')]=_0x4f937e[_0x2e32('0x2b')][_0x2e32('0x2c')]?_0x4f937e[_0x2e32('0x2b')]:_0x4a79ff['model'];if(!_0x5c1b7b[_0x2e32('0x29')][_0x2e32('0x2d')](_0x2e32('0x2e'))){_0x4f937e[_0x2e32('0x11')]=qs[_0x2e32('0x11')](_0x5c1b7b[_0x2e32('0x29')][_0x2e32('0x11')]);_0x4f937e[_0x2e32('0xf')]=qs['offset'](_0x5c1b7b['query'][_0x2e32('0xf')]);}_0x4f937e[_0x2e32('0x2f')]=qs['sort'](_0x5c1b7b[_0x2e32('0x29')][_0x2e32('0x30')]);_0x4f937e[_0x2e32('0x31')]=qs[_0x2e32('0x32')](_['pick'](_0x5c1b7b[_0x2e32('0x29')],_0x4a79ff[_0x2e32('0x32')]),_0xe6061);if(_0x5c1b7b[_0x2e32('0x29')][_0x2e32('0x33')]){_0x4f937e[_0x2e32('0x31')]=_[_0x2e32('0x34')](_0x4f937e['where'],{'$or':_['map'](_0xe6061,function(_0x28cd60){if(_0x28cd60[_0x2e32('0x24')]!=='VIRTUAL'){var _0x4e584b={};_0x4e584b[_0x28cd60['name']]={'$like':'%'+_0x5c1b7b[_0x2e32('0x29')]['filter']+'%'};return _0x4e584b;}})});}_0x4f937e=_[_0x2e32('0x34')]({},_0x4f937e,_0x5c1b7b[_0x2e32('0x35')]);var _0x27817d={'where':_0x4f937e[_0x2e32('0x31')]};return db[_0x2e32('0x22')][_0x2e32('0x12')](_0x27817d)[_0x2e32('0x17')](function(_0x420d1f){_0x1aeada['count']=_0x420d1f;if(_0x5c1b7b[_0x2e32('0x29')][_0x2e32('0x36')]){_0x4f937e[_0x2e32('0x37')]=[{'all':!![]}];}return db[_0x2e32('0x22')][_0x2e32('0x38')](_0x4f937e);})[_0x2e32('0x17')](function(_0x3d0711){_0x1aeada[_0x2e32('0x39')]=_0x3d0711;return _0x1aeada;})[_0x2e32('0x17')](respondWithFilteredResult(_0x47f9f6,_0x4f937e))[_0x2e32('0x3a')](handleError(_0x47f9f6,null));};exports['show']=function(_0x306b61,_0x4b3ba2){var _0x275c41={'raw':![],'where':{'id':_0x306b61[_0x2e32('0x3b')]['id']}},_0x1c8100={};_0x1c8100[_0x2e32('0x26')]=_[_0x2e32('0x28')](db[_0x2e32('0x22')]['rawAttributes']);_0x1c8100[_0x2e32('0x29')]=_[_0x2e32('0x28')](_0x306b61[_0x2e32('0x29')]);_0x1c8100[_0x2e32('0x32')]=_[_0x2e32('0x3c')](_0x1c8100[_0x2e32('0x26')],_0x1c8100[_0x2e32('0x29')]);_0x275c41['attributes']=_[_0x2e32('0x3c')](_0x1c8100[_0x2e32('0x26')],qs[_0x2e32('0x2a')](_0x306b61[_0x2e32('0x29')][_0x2e32('0x2a')]));_0x275c41[_0x2e32('0x2b')]=_0x275c41[_0x2e32('0x2b')][_0x2e32('0x2c')]?_0x275c41[_0x2e32('0x2b')]:_0x1c8100[_0x2e32('0x26')];if(_0x306b61[_0x2e32('0x29')][_0x2e32('0x36')]){_0x275c41[_0x2e32('0x37')]=[{'all':!![]}];}_0x275c41=_['merge']({},_0x275c41,_0x306b61['options']);return db[_0x2e32('0x22')][_0x2e32('0x3d')](_0x275c41)['then'](handleEntityNotFound(_0x4b3ba2,null))[_0x2e32('0x17')](respondWithResult(_0x4b3ba2,null))[_0x2e32('0x3a')](handleError(_0x4b3ba2,null));};exports[_0x2e32('0x3e')]=function(_0x5bb826,_0x155696){return db['SquareProject'][_0x2e32('0x3e')](_0x5bb826[_0x2e32('0x3f')],{})['then'](function(_0x2b7c9c){var _0x369646=_0x5bb826[_0x2e32('0x40')][_0x2e32('0x41')]({'plain':!![]});if(!_0x369646)throw new Error(_0x2e32('0x42'));if(_0x369646[_0x2e32('0x43')]===_0x2e32('0x40')){var _0x27734b=_0x2b7c9c[_0x2e32('0x41')]({'plain':!![]});var _0x44c6a2=_0x2e32('0x18');return db[_0x2e32('0x44')]['find']({'where':{'name':_0x44c6a2,'userProfileId':_0x369646[_0x2e32('0x45')]},'raw':!![]})[_0x2e32('0x17')](function(_0x39e25d){if(_0x39e25d&&_0x39e25d[_0x2e32('0x46')]===0x0){return db[_0x2e32('0x47')][_0x2e32('0x3e')]({'name':_0x27734b[_0x2e32('0x1c')],'resourceId':_0x27734b['id'],'type':_0x39e25d['name'],'sectionId':_0x39e25d['id']},{})[_0x2e32('0x17')](function(){return _0x2b7c9c;});}else{return _0x2b7c9c;}})[_0x2e32('0x3a')](function(_0x5d52dc){logger[_0x2e32('0x1a')](_0x2e32('0x48'),_0x5d52dc);throw _0x5d52dc;});}return _0x2b7c9c;})[_0x2e32('0x17')](respondWithResult(_0x155696,0xc9))[_0x2e32('0x3a')](handleError(_0x155696,null));};exports[_0x2e32('0x15')]=function(_0x42c75f,_0x5e7b39){if(_0x42c75f[_0x2e32('0x3f')]['id']){delete _0x42c75f['body']['id'];}return db['SquareProject'][_0x2e32('0x3d')]({'where':{'id':_0x42c75f[_0x2e32('0x3b')]['id']}})[_0x2e32('0x17')](handleEntityNotFound(_0x5e7b39,null))[_0x2e32('0x17')](saveUpdates(_0x42c75f[_0x2e32('0x3f')],null))[_0x2e32('0x17')](function(_0x236c70){if(!_0x236c70)return;var _0x455ff9=_0x236c70[_0x2e32('0x41')]({'plain':!![]});return[createAgiSocket(),_0x455ff9];})[_0x2e32('0x49')](function(_0x53fcaf,_0x2fdc1d){_0x53fcaf[_0x2e32('0xd')](JSON[_0x2e32('0x19')](_[_0x2e32('0x4a')](_0x2fdc1d,['id',_0x2e32('0x1c'),_0x2e32('0x4b')])));return _0x2fdc1d;})[_0x2e32('0x17')](respondWithResult(_0x5e7b39,null))[_0x2e32('0x3a')](handleError(_0x5e7b39,null));};exports[_0x2e32('0x16')]=function(_0x68c46a,_0x2b730f){return db[_0x2e32('0x22')][_0x2e32('0x3d')]({'where':{'id':_0x68c46a['params']['id']}})[_0x2e32('0x17')](handleEntityNotFound(_0x2b730f,null))[_0x2e32('0x17')](removeEntity(_0x2b730f,null))[_0x2e32('0x3a')](handleError(_0x2b730f,null));};exports[_0x2e32('0x4c')]=function(_0x3ba9bd,_0x53b0c5){return db[_0x2e32('0x22')][_0x2e32('0x3d')]({'where':{'id':_0x3ba9bd[_0x2e32('0x3b')]['id']}})['then'](handleEntityNotFound(_0x53b0c5,null))['then'](function(_0x358f68){if(_0x358f68){return _0x358f68[_0x2e32('0x4c')](_0x3ba9bd[_0x2e32('0x3f')][_0x2e32('0x4d')],_[_0x2e32('0x4e')](_0x3ba9bd[_0x2e32('0x3f')],[_0x2e32('0x4d'),'id'])||{});}})[_0x2e32('0x17')](respondWithResult(_0x53b0c5,null))[_0x2e32('0x3a')](handleError(_0x53b0c5,null));};exports[_0x2e32('0x4f')]=function(_0x209813,_0xedf13e){return db[_0x2e32('0x22')]['find']({'where':{'id':_0x209813[_0x2e32('0x3b')]['id']}})[_0x2e32('0x17')](handleEntityNotFound(_0xedf13e,null))[_0x2e32('0x17')](function(_0x527fdf){if(_0x527fdf){return _0x527fdf[_0x2e32('0x4f')](_0x209813['query']['ids'])['then'](function(){if(_[_0x2e32('0x50')](_0x209813['query'][_0x2e32('0x4d')])){for(var _0x39591b=0x0;_0x39591b<_0x209813[_0x2e32('0x29')][_0x2e32('0x4d')]['length'];_0x39591b+=0x1){socket[_0x2e32('0x51')](_0x2e32('0x52'),{'UserId':Number(_0x209813[_0x2e32('0x29')]['ids'][_0x39591b]),'SquareProjectId':Number(_0x209813['params']['id'])});}}else{socket[_0x2e32('0x51')](_0x2e32('0x52'),{'UserId':Number(_0x209813[_0x2e32('0x29')][_0x2e32('0x4d')]),'SquareProjectId':Number(_0x209813[_0x2e32('0x3b')]['id'])});}});}})['then'](respondWithStatusCode(_0xedf13e,null))[_0x2e32('0x3a')](handleError(_0xedf13e,null));};exports['getUsers']=function(_0x3519c1,_0x4cc32e){var _0x3a7e81={};var _0xdd67fe={};var _0x4d50d3;var _0x1616d6;return db[_0x2e32('0x22')][_0x2e32('0x53')]({'where':{'id':_0x3519c1[_0x2e32('0x3b')]['id']}})['then'](handleEntityNotFound(_0x4cc32e,null))[_0x2e32('0x17')](function(_0x353c5a){if(_0x353c5a){_0x4d50d3=_0x353c5a;_0xdd67fe[_0x2e32('0x26')]=_[_0x2e32('0x28')](db['User'][_0x2e32('0x23')]);_0xdd67fe[_0x2e32('0x29')]=_[_0x2e32('0x28')](_0x3519c1[_0x2e32('0x29')]);_0xdd67fe[_0x2e32('0x32')]=_[_0x2e32('0x3c')](_0xdd67fe[_0x2e32('0x26')],_0xdd67fe[_0x2e32('0x29')]);_0x3a7e81['attributes']=_[_0x2e32('0x3c')](_0xdd67fe[_0x2e32('0x26')],qs[_0x2e32('0x2a')](_0x3519c1[_0x2e32('0x29')][_0x2e32('0x2a')]));_0x3a7e81[_0x2e32('0x2b')]=_0x3a7e81[_0x2e32('0x2b')]['length']?_0x3a7e81[_0x2e32('0x2b')]:_0xdd67fe['model'];_0x3a7e81[_0x2e32('0x2f')]=qs[_0x2e32('0x30')](_0x3519c1[_0x2e32('0x29')][_0x2e32('0x30')]);_0x3a7e81[_0x2e32('0x31')]=qs[_0x2e32('0x32')](_[_0x2e32('0x4a')](_0x3519c1['query'],_0xdd67fe[_0x2e32('0x32')]));if(_0x3519c1[_0x2e32('0x29')][_0x2e32('0x33')]){_0x3a7e81[_0x2e32('0x31')]=_[_0x2e32('0x34')](_0x3a7e81['where'],{'$or':_[_0x2e32('0x27')](_0x3a7e81[_0x2e32('0x2b')],function(_0x45fdce){var _0x354a27={};_0x354a27[_0x45fdce]={'$like':'%'+_0x3519c1[_0x2e32('0x29')][_0x2e32('0x33')]+'%'};return _0x354a27;})});}_0x3a7e81=_[_0x2e32('0x34')]({},_0x3a7e81,_0x3519c1[_0x2e32('0x35')]);return _0x4d50d3[_0x2e32('0x54')](_0x3a7e81);}})[_0x2e32('0x17')](function(_0x4a5af3){if(_0x4a5af3){_0x1616d6=_0x4a5af3[_0x2e32('0x2c')];if(!_0x3519c1[_0x2e32('0x29')][_0x2e32('0x2d')]('nolimit')){_0x3a7e81[_0x2e32('0x11')]=qs['limit'](_0x3519c1[_0x2e32('0x29')][_0x2e32('0x11')]);_0x3a7e81[_0x2e32('0xf')]=qs[_0x2e32('0xf')](_0x3519c1[_0x2e32('0x29')][_0x2e32('0xf')]);}return _0x4d50d3[_0x2e32('0x54')](_0x3a7e81);}})[_0x2e32('0x17')](function(_0x1ad1a7){if(_0x1ad1a7){return _0x1ad1a7?{'count':_0x1616d6,'rows':_0x1ad1a7}:null;}})[_0x2e32('0x17')](respondWithResult(_0x4cc32e,null))[_0x2e32('0x3a')](handleError(_0x4cc32e,null));};
\ No newline at end of file
index 5284b81..992f57d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0eb9=['../../mysqldb','SquareProject','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x45419f,_0x5b3685){var _0x5e3dd9=function(_0xc1cb70){while(--_0xc1cb70){_0x45419f['push'](_0x45419f['shift']());}};_0x5e3dd9(++_0x5b3685);}(_0x0eb9,0x19d));var _0x90eb=function(_0x34d6bd,_0x55b744){_0x34d6bd=_0x34d6bd-0x0;var _0x248396=_0x0eb9[_0x34d6bd];return _0x248396;};'use strict';var EventEmitter=require(_0x90eb('0x0'));var SquareProject=require(_0x90eb('0x1'))['db'][_0x90eb('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x90eb('0x3'),'afterUpdate':_0x90eb('0x4'),'afterDestroy':_0x90eb('0x5')};function emitEvent(_0x486067){return function(_0x17d7a8,_0x1d8093,_0x5d6209){SquareProjectEvents['emit'](_0x486067+':'+_0x17d7a8['id'],_0x17d7a8);SquareProjectEvents[_0x90eb('0x6')](_0x486067,_0x17d7a8);_0x5d6209(null);};}for(var e in events){if(events[_0x90eb('0x7')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x90eb('0x8')]=SquareProjectEvents;
\ No newline at end of file
+var _0x46e6=['update','remove','emit','../../mysqldb','SquareProject','setMaxListeners'];(function(_0x40f09a,_0x3743b6){var _0x2eb96c=function(_0xe6203d){while(--_0xe6203d){_0x40f09a['push'](_0x40f09a['shift']());}};_0x2eb96c(++_0x3743b6);}(_0x46e6,0xdb));var _0x646e=function(_0x27ba38,_0x23866c){_0x27ba38=_0x27ba38-0x0;var _0x5e464a=_0x46e6[_0x27ba38];return _0x5e464a;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x646e('0x0'))['db'][_0x646e('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x646e('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x646e('0x3'),'afterDestroy':_0x646e('0x4')};function emitEvent(_0x2206b2){return function(_0x33cd79,_0x2d1699,_0x4faafd){SquareProjectEvents[_0x646e('0x5')](_0x2206b2+':'+_0x33cd79['id'],_0x33cd79);SquareProjectEvents[_0x646e('0x5')](_0x2206b2,_0x33cd79);_0x4faafd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module['exports']=SquareProjectEvents;
\ No newline at end of file
index ac990f4..06b77e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f2b=['format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','changed'];(function(_0x3043d3,_0x341d57){var _0x40b8b7=function(_0x27d09e){while(--_0x27d09e){_0x3043d3['push'](_0x3043d3['shift']());}};_0x40b8b7(++_0x341d57);}(_0x7f2b,0x121));var _0xb7f2=function(_0x54a846,_0x55a662){_0x54a846=_0x54a846-0x0;var _0x35d610=_0x7f2b[_0x54a846];return _0x35d610;};'use strict';var _=require(_0xb7f2('0x0'));var util=require('util');var logger=require(_0xb7f2('0x1'))(_0xb7f2('0x2'));var moment=require(_0xb7f2('0x3'));var BPromise=require(_0xb7f2('0x4'));var rp=require(_0xb7f2('0x5'));var fs=require('fs');var path=require(_0xb7f2('0x6'));var rimraf=require(_0xb7f2('0x7'));var config=require(_0xb7f2('0x8'));var attributes=require(_0xb7f2('0x9'));module[_0xb7f2('0xa')]=function(_0x3ea4e2,_0xa5b682){return _0x3ea4e2[_0xb7f2('0xb')](_0xb7f2('0xc'),attributes,{'tableName':_0xb7f2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5a36ae,_0x19ccb1,_0x3b27d4){if(_0x5a36ae[_0xb7f2('0xe')]('preproduction')){_0x5a36ae['savedAt']=moment()[_0xb7f2('0xf')](_0xb7f2('0x10'));}if(_0x5a36ae['changed'](_0xb7f2('0x11'))){_0x5a36ae[_0xb7f2('0x12')]=moment()[_0xb7f2('0xf')](_0xb7f2('0x10'));}_0x3b27d4(null,_0x5a36ae);}}});};
\ No newline at end of file
+var _0x6a57=['savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','square_projects','changed'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x6a57,0x137));var _0x76a5=function(_0x308a1d,_0x3d379d){_0x308a1d=_0x308a1d-0x0;var _0x5eb875=_0x6a57[_0x308a1d];return _0x5eb875;};'use strict';var _=require(_0x76a5('0x0'));var util=require(_0x76a5('0x1'));var logger=require('../../config/logger')(_0x76a5('0x2'));var moment=require(_0x76a5('0x3'));var BPromise=require(_0x76a5('0x4'));var rp=require(_0x76a5('0x5'));var fs=require('fs');var path=require(_0x76a5('0x6'));var rimraf=require(_0x76a5('0x7'));var config=require(_0x76a5('0x8'));var attributes=require('./squareProject.attributes');module[_0x76a5('0x9')]=function(_0x36d9a5,_0x49d409){return _0x36d9a5[_0x76a5('0xa')]('SquareProject',attributes,{'tableName':_0x76a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x117d3e,_0xdc58dd,_0x2154cd){if(_0x117d3e[_0x76a5('0xc')]('preproduction')){_0x117d3e[_0x76a5('0xd')]=moment()[_0x76a5('0xe')](_0x76a5('0xf'));}if(_0x117d3e['changed'](_0x76a5('0x10'))){_0x117d3e[_0x76a5('0x11')]=moment()[_0x76a5('0xe')](_0x76a5('0xf'));}_0x2154cd(null,_0x117d3e);}}});};
\ No newline at end of file
index 1086cd2..4111e55 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb71=['./squareProject.socket','register','GetSquareProjects','options','raw','limit','map','include','model','attributes','then','info','debug','stringify','error','message','ShowSquareProject','SquareProject','find','where','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter'];(function(_0x907e97,_0x43eac8){var _0x429387=function(_0x129183){while(--_0x129183){_0x907e97['push'](_0x907e97['shift']());}};_0x429387(++_0x43eac8);}(_0xfb71,0xc9));var _0x1fb7=function(_0x282b9b,_0x4b1562){_0x282b9b=_0x282b9b-0x0;var _0x12282e=_0xfb71[_0x282b9b];return _0x12282e;};'use strict';var _=require(_0x1fb7('0x0'));var Redis=require(_0x1fb7('0x1'));var db=require('../../mysqldb')['db'];var logger=require(_0x1fb7('0x2'))(_0x1fb7('0x3'));var config=require(_0x1fb7('0x4'));config[_0x1fb7('0x5')]=_[_0x1fb7('0x6')](config['redis'],{'host':_0x1fb7('0x7'),'port':0x18eb});var socket=require(_0x1fb7('0x8'))(new Redis(config['redis']));require(_0x1fb7('0x9'))[_0x1fb7('0xa')](socket);exports[_0x1fb7('0xb')]=function(_0x5dc275){var _0x3d6423=this;return new Promise(function(_0x39b25f,_0x546368){return db['SquareProject']['findAll']({'raw':_0x5dc275[_0x1fb7('0xc')]?_0x5dc275[_0x1fb7('0xc')][_0x1fb7('0xd')]===undefined?!![]:![]:!![],'where':_0x5dc275['options']?_0x5dc275[_0x1fb7('0xc')]['where']||null:null,'attributes':_0x5dc275['options']?_0x5dc275['options']['attributes']||null:null,'limit':_0x5dc275[_0x1fb7('0xc')]?_0x5dc275['options'][_0x1fb7('0xe')]||null:null,'include':_0x5dc275['options']?_0x5dc275[_0x1fb7('0xc')]['include']?_[_0x1fb7('0xf')](_0x5dc275[_0x1fb7('0xc')][_0x1fb7('0x10')],function(_0x128aeb){return{'model':db[_0x128aeb[_0x1fb7('0x11')]],'as':_0x128aeb['as'],'attributes':_0x128aeb[_0x1fb7('0x12')],'include':_0x128aeb[_0x1fb7('0x10')]?_[_0x1fb7('0xf')](_0x128aeb[_0x1fb7('0x10')],function(_0x3f5649){return{'model':db[_0x3f5649[_0x1fb7('0x11')]],'as':_0x3f5649['as'],'attributes':_0x3f5649[_0x1fb7('0x12')],'include':_0x3f5649[_0x1fb7('0x10')]?_[_0x1fb7('0xf')](_0x3f5649[_0x1fb7('0x10')],function(_0x1ec682){return{'model':db[_0x1ec682['model']],'as':_0x1ec682['as'],'attributes':_0x1ec682['attributes']};}):[]};}):[]};}):[]:[]})[_0x1fb7('0x13')](function(_0x93dd72){logger[_0x1fb7('0x14')](_0x1fb7('0xb'),_0x5dc275);logger[_0x1fb7('0x15')](_0x1fb7('0xb'),_0x5dc275,JSON[_0x1fb7('0x16')](_0x93dd72));_0x39b25f(_0x93dd72);})['catch'](function(_0xa7ca95){logger[_0x1fb7('0x17')]('GetSquareProjects',_0xa7ca95[_0x1fb7('0x18')],_0x5dc275);_0x546368(_0x3d6423['error'](0x1f4,_0xa7ca95['message']));});});};exports[_0x1fb7('0x19')]=function(_0x253229){var _0x27b15f=this;return new Promise(function(_0x1bb431,_0x351283){return db[_0x1fb7('0x1a')][_0x1fb7('0x1b')]({'raw':_0x253229[_0x1fb7('0xc')]?_0x253229[_0x1fb7('0xc')]['raw']===undefined?!![]:![]:!![],'where':_0x253229[_0x1fb7('0xc')]?_0x253229[_0x1fb7('0xc')][_0x1fb7('0x1c')]||null:null,'attributes':_0x253229[_0x1fb7('0xc')]?_0x253229['options']['attributes']||null:null,'include':_0x253229[_0x1fb7('0xc')]?_0x253229[_0x1fb7('0xc')][_0x1fb7('0x10')]?_['map'](_0x253229['options'][_0x1fb7('0x10')],function(_0x111cb9){return{'model':db[_0x111cb9[_0x1fb7('0x11')]],'as':_0x111cb9['as'],'attributes':_0x111cb9[_0x1fb7('0x12')],'include':_0x111cb9[_0x1fb7('0x10')]?_['map'](_0x111cb9[_0x1fb7('0x10')],function(_0x22ae84){return{'model':db[_0x22ae84[_0x1fb7('0x11')]],'as':_0x22ae84['as'],'attributes':_0x22ae84[_0x1fb7('0x12')],'include':_0x22ae84[_0x1fb7('0x10')]?_[_0x1fb7('0xf')](_0x22ae84[_0x1fb7('0x10')],function(_0x3edaaf){return{'model':db[_0x3edaaf[_0x1fb7('0x11')]],'as':_0x3edaaf['as'],'attributes':_0x3edaaf[_0x1fb7('0x12')]};}):[]};}):[]};}):[]:[]})[_0x1fb7('0x13')](function(_0x37317f){logger[_0x1fb7('0x14')](_0x1fb7('0x19'),_0x253229);logger[_0x1fb7('0x15')](_0x1fb7('0x19'),_0x253229,JSON[_0x1fb7('0x16')](_0x37317f));_0x1bb431(_0x37317f);})[_0x1fb7('0x1d')](function(_0x3e1739){logger[_0x1fb7('0x17')](_0x1fb7('0x19'),_0x3e1739[_0x1fb7('0x18')],_0x253229);_0x351283(_0x27b15f[_0x1fb7('0x17')](0x1f4,_0x3e1739[_0x1fb7('0x18')]));});});};
\ No newline at end of file
+var _0x398d=['options','raw','where','attributes','limit','map','include','model','then','info','debug','GetSquareProjects','stringify','catch','message','ShowSquareProject','find','error','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','localhost','socket.io-emitter','SquareProject','findAll'];(function(_0x478c51,_0x491534){var _0x93d8e=function(_0x36d4f2){while(--_0x36d4f2){_0x478c51['push'](_0x478c51['shift']());}};_0x93d8e(++_0x491534);}(_0x398d,0xf2));var _0xd398=function(_0x52ea6a,_0x69bee6){_0x52ea6a=_0x52ea6a-0x0;var _0x5536e1=_0x398d[_0x52ea6a];return _0x5536e1;};'use strict';var _=require(_0xd398('0x0'));var Redis=require(_0xd398('0x1'));var db=require(_0xd398('0x2'))['db'];var logger=require(_0xd398('0x3'))(_0xd398('0x4'));var config=require(_0xd398('0x5'));config['redis']=_['defaults'](config['redis'],{'host':_0xd398('0x6'),'port':0x18eb});var socket=require(_0xd398('0x7'))(new Redis(config['redis']));require('./squareProject.socket')['register'](socket);exports['GetSquareProjects']=function(_0x4ef174){var _0x2eff56=this;return new Promise(function(_0x34b488,_0x3104d5){return db[_0xd398('0x8')][_0xd398('0x9')]({'raw':_0x4ef174[_0xd398('0xa')]?_0x4ef174[_0xd398('0xa')][_0xd398('0xb')]===undefined?!![]:![]:!![],'where':_0x4ef174[_0xd398('0xa')]?_0x4ef174[_0xd398('0xa')][_0xd398('0xc')]||null:null,'attributes':_0x4ef174['options']?_0x4ef174[_0xd398('0xa')][_0xd398('0xd')]||null:null,'limit':_0x4ef174['options']?_0x4ef174[_0xd398('0xa')][_0xd398('0xe')]||null:null,'include':_0x4ef174[_0xd398('0xa')]?_0x4ef174[_0xd398('0xa')]['include']?_[_0xd398('0xf')](_0x4ef174[_0xd398('0xa')][_0xd398('0x10')],function(_0x4c67dc){return{'model':db[_0x4c67dc[_0xd398('0x11')]],'as':_0x4c67dc['as'],'attributes':_0x4c67dc[_0xd398('0xd')],'include':_0x4c67dc['include']?_[_0xd398('0xf')](_0x4c67dc[_0xd398('0x10')],function(_0x5e3a5b){return{'model':db[_0x5e3a5b[_0xd398('0x11')]],'as':_0x5e3a5b['as'],'attributes':_0x5e3a5b[_0xd398('0xd')],'include':_0x5e3a5b['include']?_['map'](_0x5e3a5b[_0xd398('0x10')],function(_0x422675){return{'model':db[_0x422675[_0xd398('0x11')]],'as':_0x422675['as'],'attributes':_0x422675[_0xd398('0xd')]};}):[]};}):[]};}):[]:[]})[_0xd398('0x12')](function(_0x2a738f){logger[_0xd398('0x13')]('GetSquareProjects',_0x4ef174);logger[_0xd398('0x14')](_0xd398('0x15'),_0x4ef174,JSON[_0xd398('0x16')](_0x2a738f));_0x34b488(_0x2a738f);})[_0xd398('0x17')](function(_0x4c1d49){logger['error'](_0xd398('0x15'),_0x4c1d49[_0xd398('0x18')],_0x4ef174);_0x3104d5(_0x2eff56['error'](0x1f4,_0x4c1d49['message']));});});};exports[_0xd398('0x19')]=function(_0xae587a){var _0x39ad03=this;return new Promise(function(_0x2ee6fc,_0x51502c){return db[_0xd398('0x8')][_0xd398('0x1a')]({'raw':_0xae587a['options']?_0xae587a[_0xd398('0xa')]['raw']===undefined?!![]:![]:!![],'where':_0xae587a[_0xd398('0xa')]?_0xae587a[_0xd398('0xa')][_0xd398('0xc')]||null:null,'attributes':_0xae587a[_0xd398('0xa')]?_0xae587a['options'][_0xd398('0xd')]||null:null,'include':_0xae587a[_0xd398('0xa')]?_0xae587a[_0xd398('0xa')][_0xd398('0x10')]?_['map'](_0xae587a[_0xd398('0xa')][_0xd398('0x10')],function(_0x2f1b70){return{'model':db[_0x2f1b70[_0xd398('0x11')]],'as':_0x2f1b70['as'],'attributes':_0x2f1b70[_0xd398('0xd')],'include':_0x2f1b70[_0xd398('0x10')]?_[_0xd398('0xf')](_0x2f1b70[_0xd398('0x10')],function(_0xcf26ee){return{'model':db[_0xcf26ee[_0xd398('0x11')]],'as':_0xcf26ee['as'],'attributes':_0xcf26ee['attributes'],'include':_0xcf26ee[_0xd398('0x10')]?_[_0xd398('0xf')](_0xcf26ee[_0xd398('0x10')],function(_0x2b56f4){return{'model':db[_0x2b56f4[_0xd398('0x11')]],'as':_0x2b56f4['as'],'attributes':_0x2b56f4['attributes']};}):[]};}):[]};}):[]:[]})[_0xd398('0x12')](function(_0x6cd228){logger[_0xd398('0x13')](_0xd398('0x19'),_0xae587a);logger[_0xd398('0x14')](_0xd398('0x19'),_0xae587a,JSON[_0xd398('0x16')](_0x6cd228));_0x2ee6fc(_0x6cd228);})[_0xd398('0x17')](function(_0x1cddcb){logger[_0xd398('0x1b')]('ShowSquareProject',_0x1cddcb[_0xd398('0x18')],_0xae587a);_0x51502c(_0x39ad03[_0xd398('0x1b')](0x1f4,_0x1cddcb[_0xd398('0x18')]));});});};
\ No newline at end of file
index 7cb8b9a..172fc2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x151e=['length','squareProject:','save','remove','removeListener','register'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x151e,0x15e));var _0xe151=function(_0x497b1e,_0x586379){_0x497b1e=_0x497b1e-0x0;var _0x3f72e1=_0x151e[_0x497b1e];return _0x3f72e1;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0xe151('0x0'),_0xe151('0x1'),'update'];function createListener(_0x34217e,_0x9f478){return function(_0x5519d8){_0x9f478['emit'](_0x34217e,_0x5519d8);};}function removeListener(_0x200e17,_0x265978){return function(){SquareProjectEvents[_0xe151('0x2')](_0x200e17,_0x265978);};}exports[_0xe151('0x3')]=function(_0x569271){for(var _0x593552=0x0,_0x1570ae=events[_0xe151('0x4')];_0x593552<_0x1570ae;_0x593552++){var _0x201ef6=events[_0x593552];var _0x2dc76a=createListener(_0xe151('0x5')+_0x201ef6,_0x569271);SquareProjectEvents['on'](_0x201ef6,_0x2dc76a);}};
\ No newline at end of file
+var _0x5839=['length','squareProject:','./squareProject.events','remove','update','emit','removeListener','register'];(function(_0x4b7975,_0x248178){var _0x25456f=function(_0x25ea42){while(--_0x25ea42){_0x4b7975['push'](_0x4b7975['shift']());}};_0x25456f(++_0x248178);}(_0x5839,0x1d2));var _0x9583=function(_0xde4037,_0x368fcd){_0xde4037=_0xde4037-0x0;var _0x296e14=_0x5839[_0xde4037];return _0x296e14;};'use strict';var SquareProjectEvents=require(_0x9583('0x0'));var events=['save',_0x9583('0x1'),_0x9583('0x2')];function createListener(_0x4f3e8c,_0x11b995){return function(_0x46945f){_0x11b995[_0x9583('0x3')](_0x4f3e8c,_0x46945f);};}function removeListener(_0x29b31f,_0x43e265){return function(){SquareProjectEvents[_0x9583('0x4')](_0x29b31f,_0x43e265);};}exports[_0x9583('0x5')]=function(_0x46159e){for(var _0x35029b=0x0,_0x8eeda7=events[_0x9583('0x6')];_0x35029b<_0x8eeda7;_0x35029b++){var _0x4f1f51=events[_0x35029b];var _0x359257=createListener(_0x9583('0x7')+_0x4f1f51,_0x46159e);SquareProjectEvents['on'](_0x4f1f51,_0x359257);}};
\ No newline at end of file
index 1b1712f..9ad39ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4975=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated','show','/:id/download','download','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x350359,_0x2f5452){var _0x42e6d7=function(_0x70e7c){while(--_0x70e7c){_0x350359['push'](_0x350359['shift']());}};_0x42e6d7(++_0x2f5452);}(_0x4975,0x86));var _0x5497=function(_0x2c555f,_0x46dc9a){_0x2c555f=_0x2c555f-0x0;var _0xbbec9e=_0x4975[_0x2c555f];return _0xbbec9e;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0x11')]('/',auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0x13')](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5497('0x15')]);module[_0x5497('0x16')]=router;
\ No newline at end of file
+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(_0x39f882,_0x286214){var _0x566dce=function(_0x1bea4b){while(--_0x1bea4b){_0x39f882['push'](_0x39f882['shift']());}};_0x566dce(++_0x286214);}(_0x1cb9,0x14e));var _0x91cb=function(_0xf73985,_0x3edc7d){_0xf73985=_0xf73985-0x0;var _0x5ccd5e=_0x1cb9[_0xf73985];return _0x5ccd5e;};'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
index ca10de6..3d884b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98a8=['exports','STRING','VIRTUAL','savePath','substring','lastIndexOf','sequelize'];(function(_0xfd365d,_0x4fc464){var _0xf6cae3=function(_0x5416de){while(--_0x5416de){_0xfd365d['push'](_0xfd365d['shift']());}};_0xf6cae3(++_0x4fc464);}(_0x98a8,0x12c));var _0x898a=function(_0xd3dec4,_0x27995e){_0xd3dec4=_0xd3dec4-0x0;var _0x46ac9d=_0x98a8[_0xd3dec4];return _0x46ac9d;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'uniqueid':{'type':Sequelize[_0x898a('0x2')]},'callerid':{'type':Sequelize[_0x898a('0x2')]},'calleridname':{'type':Sequelize[_0x898a('0x2')]},'context':{'type':Sequelize[_0x898a('0x2')]},'extension':{'type':Sequelize[_0x898a('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x898a('0x2')]},'dnid':{'type':Sequelize[_0x898a('0x2')]},'projectName':{'type':Sequelize[_0x898a('0x2')]},'saveName':{'type':Sequelize[_0x898a('0x2')]},'filename':{'type':Sequelize[_0x898a('0x2')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x898a('0x3')],'get':function(){var _0x564583='';var _0xfa8c50=this['getDataValue'](_0x898a('0x4'));if(_0xfa8c50){_0x564583=_0xfa8c50[_0x898a('0x5')](_0xfa8c50[_0x898a('0x6')]('.'));}return _0x564583;}}};
\ No newline at end of file
+var _0xee14=['VIRTUAL','getDataValue','savePath','substring','STRING'];(function(_0x521dc7,_0x15b2f0){var _0x5bf4db=function(_0x59bb61){while(--_0x59bb61){_0x521dc7['push'](_0x521dc7['shift']());}};_0x5bf4db(++_0x15b2f0);}(_0xee14,0x13a));var _0x4ee1=function(_0x5e86ba,_0x3f1d62){_0x5e86ba=_0x5e86ba-0x0;var _0x2f3173=_0xee14[_0x5e86ba];return _0x2f3173;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x4ee1('0x0')]},'callerid':{'type':Sequelize[_0x4ee1('0x0')]},'calleridname':{'type':Sequelize[_0x4ee1('0x0')]},'context':{'type':Sequelize[_0x4ee1('0x0')]},'extension':{'type':Sequelize[_0x4ee1('0x0')]},'priority':{'type':Sequelize[_0x4ee1('0x0')]},'accountcode':{'type':Sequelize[_0x4ee1('0x0')]},'dnid':{'type':Sequelize[_0x4ee1('0x0')]},'projectName':{'type':Sequelize[_0x4ee1('0x0')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x4ee1('0x0')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x4ee1('0x1')],'get':function(){var _0x3a45a3='';var _0x187656=this[_0x4ee1('0x2')](_0x4ee1('0x3'));if(_0x187656){_0x3a45a3=_0x187656[_0x4ee1('0x4')](_0x187656['lastIndexOf']('.'));}return _0x3a45a3;}}};
\ No newline at end of file
index db30314..2f73b28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d82=['savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','SquareRecording\x20not\x20found','download','extname','unlink','message','destroy','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','SquareRecording','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','../../components/encryptor','uniqueid'];(function(_0x74c392,_0x29cc28){var _0x306791=function(_0x677d58){while(--_0x677d58){_0x74c392['push'](_0x74c392['shift']());}};_0x306791(++_0x29cc28);}(_0x4d82,0xd2));var _0x24d8=function(_0x21d0d7,_0x4c55a3){_0x21d0d7=_0x21d0d7-0x0;var _0x5e725b=_0x4d82[_0x21d0d7];return _0x5e725b;};'use strict';var emlformat=require(_0x24d8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x24d8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x24d8('0x2'));var moment=require(_0x24d8('0x3'));var BPromise=require(_0x24d8('0x4'));var Mustache=require(_0x24d8('0x5'));var util=require(_0x24d8('0x6'));var path=require(_0x24d8('0x7'));var sox=require(_0x24d8('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x24d8('0x9'));var _=require('lodash');var squel=require(_0x24d8('0xa'));var crypto=require(_0x24d8('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x24d8('0xc'));var Papa=require(_0x24d8('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x24d8('0xe'));var hardwareService=require(_0x24d8('0xf'));var logger=require(_0x24d8('0x10'))(_0x24d8('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x24d8('0x12'));var db=require(_0x24d8('0x13'))['db'];function respondWithStatusCode(_0x324a0f,_0x21c3a0){_0x21c3a0=_0x21c3a0||0xcc;return function(_0x24e530){if(_0x24e530){return _0x324a0f[_0x24d8('0x14')](_0x21c3a0);}return _0x324a0f[_0x24d8('0x15')](_0x21c3a0)[_0x24d8('0x16')]();};}function respondWithResult(_0x1244e3,_0x4131a9){_0x4131a9=_0x4131a9||0xc8;return function(_0x37e1df){if(_0x37e1df){return _0x1244e3['status'](_0x4131a9)[_0x24d8('0x17')](_0x37e1df);}};}function respondWithFilteredResult(_0x4f7a8a,_0x2f2daf){return function(_0x20b458){if(_0x20b458){var _0x52fb55=typeof _0x2f2daf[_0x24d8('0x18')]==='undefined'&&typeof _0x2f2daf[_0x24d8('0x19')]==='undefined';var _0x10d141=_0x20b458[_0x24d8('0x1a')];var _0x13b707=_0x52fb55?0x0:_0x2f2daf[_0x24d8('0x18')];var _0x28e90e=_0x52fb55?_0x20b458[_0x24d8('0x1a')]:_0x2f2daf[_0x24d8('0x18')]+_0x2f2daf[_0x24d8('0x19')];var _0xe0bbfd;if(_0x28e90e>=_0x10d141){_0x28e90e=_0x10d141;_0xe0bbfd=0xc8;}else{_0xe0bbfd=0xce;}_0x4f7a8a[_0x24d8('0x15')](_0xe0bbfd);return _0x4f7a8a[_0x24d8('0x1b')](_0x24d8('0x1c'),_0x13b707+'-'+_0x28e90e+'/'+_0x10d141)[_0x24d8('0x17')](_0x20b458);}return null;};}function patchUpdates(_0x313385){return function(_0x49f2f9){try{jsonpatch[_0x24d8('0x1d')](_0x49f2f9,_0x313385,!![]);}catch(_0x5cdc61){return BPromise[_0x24d8('0x1e')](_0x5cdc61);}return _0x49f2f9[_0x24d8('0x1f')]();};}function saveUpdates(_0x31d2c6,_0x721cb9){return function(_0x58277a){if(_0x58277a){return _0x58277a[_0x24d8('0x20')](_0x31d2c6)['then'](function(_0x44e143){return _0x44e143;});}return null;};}function removeEntity(_0x4d99dc,_0x579796){return function(_0x5dbdec){if(_0x5dbdec){return _0x5dbdec['destroy']()[_0x24d8('0x21')](function(){_0x4d99dc[_0x24d8('0x15')](0xcc)[_0x24d8('0x16')]();});}};}function handleEntityNotFound(_0x3ac291,_0x3fb87a){return function(_0x3b03ad){if(!_0x3b03ad){_0x3ac291[_0x24d8('0x14')](0x194);}return _0x3b03ad;};}function handleError(_0x240174,_0x502c9a){_0x502c9a=_0x502c9a||0x1f4;return function(_0xc0eeb0){logger[_0x24d8('0x22')](_0xc0eeb0[_0x24d8('0x23')]);if(_0xc0eeb0[_0x24d8('0x24')]){delete _0xc0eeb0[_0x24d8('0x24')];}_0x240174['status'](_0x502c9a)[_0x24d8('0x25')](_0xc0eeb0);};}exports['index']=function(_0x5786be,_0x21b46d){var _0x5893ac={},_0x196c2f={},_0x234f7f={'count':0x0,'rows':[]};var _0x49ee52=_[_0x24d8('0x26')](db['SquareRecording'][_0x24d8('0x27')],function(_0x8e9daa){return{'name':_0x8e9daa[_0x24d8('0x28')],'type':_0x8e9daa[_0x24d8('0x29')][_0x24d8('0x2a')]};});_0x196c2f[_0x24d8('0x2b')]=_[_0x24d8('0x26')](_0x49ee52,_0x24d8('0x24'));_0x196c2f[_0x24d8('0x2c')]=_[_0x24d8('0x2d')](_0x5786be[_0x24d8('0x2c')]);_0x196c2f[_0x24d8('0x2e')]=_[_0x24d8('0x2f')](_0x196c2f['model'],_0x196c2f[_0x24d8('0x2c')]);_0x5893ac[_0x24d8('0x30')]=_['intersection'](_0x196c2f[_0x24d8('0x2b')],qs[_0x24d8('0x31')](_0x5786be[_0x24d8('0x2c')]['fields']));_0x5893ac[_0x24d8('0x30')]=_0x5893ac[_0x24d8('0x30')]['length']?_0x5893ac['attributes']:_0x196c2f[_0x24d8('0x2b')];if(!_0x5786be[_0x24d8('0x2c')][_0x24d8('0x32')]('nolimit')){_0x5893ac[_0x24d8('0x19')]=qs[_0x24d8('0x19')](_0x5786be['query']['limit']);_0x5893ac[_0x24d8('0x18')]=qs['offset'](_0x5786be['query'][_0x24d8('0x18')]);}_0x5893ac[_0x24d8('0x33')]=qs[_0x24d8('0x34')](_0x5786be['query'][_0x24d8('0x34')]);_0x5893ac[_0x24d8('0x35')]=qs[_0x24d8('0x2e')](_[_0x24d8('0x36')](_0x5786be[_0x24d8('0x2c')],_0x196c2f[_0x24d8('0x2e')]),_0x49ee52);if(_0x5786be[_0x24d8('0x2c')][_0x24d8('0x37')]){_0x5893ac[_0x24d8('0x35')]=_[_0x24d8('0x38')](_0x5893ac[_0x24d8('0x35')],{'$or':_['map'](_0x49ee52,function(_0x3a53a3){if(_0x3a53a3[_0x24d8('0x29')]!=='VIRTUAL'){var _0x5cefb9={};_0x5cefb9[_0x3a53a3[_0x24d8('0x24')]]={'$like':'%'+_0x5786be[_0x24d8('0x2c')][_0x24d8('0x37')]+'%'};return _0x5cefb9;}})});}_0x5893ac=_[_0x24d8('0x38')]({},_0x5893ac,_0x5786be['options']);var _0x29e6f8={'where':_0x5893ac[_0x24d8('0x35')]};return db[_0x24d8('0x39')][_0x24d8('0x1a')](_0x29e6f8)[_0x24d8('0x21')](function(_0x37d357){_0x234f7f[_0x24d8('0x1a')]=_0x37d357;if(_0x5786be['query'][_0x24d8('0x3a')]){_0x5893ac[_0x24d8('0x3b')]=[{'all':!![]}];}return db[_0x24d8('0x39')][_0x24d8('0x3c')](_0x5893ac);})[_0x24d8('0x21')](function(_0x213916){_0x234f7f[_0x24d8('0x3d')]=_0x213916;return _0x234f7f;})[_0x24d8('0x21')](respondWithFilteredResult(_0x21b46d,_0x5893ac))[_0x24d8('0x3e')](handleError(_0x21b46d,null));};exports[_0x24d8('0x3f')]=function(_0x1b95f1,_0xf4a243){var _0x3bb6ee={'raw':!![],'where':{'id':_0x1b95f1[_0x24d8('0x40')]['id']}},_0x4c2fd5={};_0x4c2fd5[_0x24d8('0x2b')]=_[_0x24d8('0x2d')](db[_0x24d8('0x39')][_0x24d8('0x27')]);_0x4c2fd5[_0x24d8('0x2c')]=_[_0x24d8('0x2d')](_0x1b95f1[_0x24d8('0x2c')]);_0x4c2fd5['filters']=_['intersection'](_0x4c2fd5[_0x24d8('0x2b')],_0x4c2fd5[_0x24d8('0x2c')]);_0x3bb6ee['attributes']=_[_0x24d8('0x2f')](_0x4c2fd5[_0x24d8('0x2b')],qs[_0x24d8('0x31')](_0x1b95f1['query'][_0x24d8('0x31')]));_0x3bb6ee['attributes']=_0x3bb6ee[_0x24d8('0x30')][_0x24d8('0x41')]?_0x3bb6ee['attributes']:_0x4c2fd5[_0x24d8('0x2b')];if(_0x1b95f1['query'][_0x24d8('0x3a')]){_0x3bb6ee[_0x24d8('0x3b')]=[{'all':!![]}];}_0x3bb6ee=_[_0x24d8('0x38')]({},_0x3bb6ee,_0x1b95f1[_0x24d8('0x42')]);return db[_0x24d8('0x39')][_0x24d8('0x43')](_0x3bb6ee)[_0x24d8('0x21')](handleEntityNotFound(_0xf4a243,null))[_0x24d8('0x21')](respondWithResult(_0xf4a243,null))[_0x24d8('0x3e')](handleError(_0xf4a243,null));};exports[_0x24d8('0x44')]=function(_0x3932dd,_0x3fe062){return db[_0x24d8('0x39')]['create'](_0x3932dd[_0x24d8('0x45')],{})['then'](respondWithResult(_0x3fe062,0xc9))[_0x24d8('0x3e')](handleError(_0x3fe062,null));};exports[_0x24d8('0x20')]=function(_0x12bbdb,_0x6dcaf6){if(_0x12bbdb['body']['id']){delete _0x12bbdb[_0x24d8('0x45')]['id'];}return db[_0x24d8('0x39')]['find']({'where':{'id':_0x12bbdb['params']['id']}})[_0x24d8('0x21')](handleEntityNotFound(_0x6dcaf6,null))[_0x24d8('0x21')](saveUpdates(_0x12bbdb['body'],null))['then'](respondWithResult(_0x6dcaf6,null))[_0x24d8('0x3e')](handleError(_0x6dcaf6,null));};exports['download']=function(_0x54a581,_0x2200ba,_0x53b5e4){var _0x256310=require(_0x24d8('0x46'));var _0x3062df=![];var _0x4e06f5={};if(_0x54a581[_0x24d8('0x2c')][_0x24d8('0x29')]&&_0x54a581[_0x24d8('0x2c')][_0x24d8('0x29')]===_0x24d8('0x47')){_0x4e06f5['uniqueid']=_0x54a581['params']['id'];}else{_0x4e06f5['id']=_0x54a581[_0x24d8('0x40')]['id'];}return db['SquareRecording']['find']({'where':_0x4e06f5,'attributes':['id',_0x24d8('0x48'),_0x24d8('0x49')],'raw':!![]})[_0x24d8('0x21')](handleEntityNotFound(_0x2200ba,null))['then'](function(_0x4505ea){if(_0x4505ea){var _0x12e50d=_0x4505ea[_0x24d8('0x48')];var _0x4ff72b=util[_0x24d8('0x4a')](_0x24d8('0x4b'),_0x12e50d);if(fs[_0x24d8('0x4c')](_0x4ff72b)){_0x3062df=!![];return _0x256310[_0x24d8('0x4d')](_0x4ff72b,_0x12e50d,config[_0x24d8('0x4e')][_0x24d8('0x4f')])['then'](function(){return _0x4505ea;});}return _0x4505ea;}})['then'](function(_0x1f8ab6){if(_0x1f8ab6){var _0x32370d=_0x1f8ab6['savePath'];if(!fs['existsSync'](_0x32370d)){throw new db[(_0x24d8('0x50'))]['ValidationError'](_0x24d8('0x51'));}if(_0x1f8ab6[_0x24d8('0x49')]){return _0x2200ba[_0x24d8('0x52')](_0x32370d,_0x1f8ab6['filename']+path[_0x24d8('0x53')](_0x32370d),function(){if(_0x3062df){fs[_0x24d8('0x54')](_0x32370d);}});}else{return _0x2200ba[_0x24d8('0x52')](_0x32370d,function(_0x3b9ef7){if(_0x3062df){fs[_0x24d8('0x54')](_0x32370d);}});}}})['catch'](function(_0x3f881e){if(_0x3f881e[_0x24d8('0x55')]===_0x24d8('0x51')){_0x2200ba[_0x24d8('0x15')](0x194)[_0x24d8('0x25')]('Not\x20found');}else{return handleError(_0x2200ba,null);}});};exports[_0x24d8('0x56')]=function(_0xf06191,_0x2a3dd8){return db[_0x24d8('0x39')][_0x24d8('0x43')]({'where':{'id':_0xf06191[_0x24d8('0x40')]['id']}})[_0x24d8('0x21')](function(_0x1df11c){if(_['isNil'](_0x1df11c)){throw new ReferenceError(_0x24d8('0x57'));}return _0x1df11c;})[_0x24d8('0x21')](function(_0x468960){var _0x5853f5=_0x468960[_0x24d8('0x48')];logger['info'](_0x24d8('0x58'),_0x5853f5);if(!_[_0x24d8('0x59')](_0x468960[_0x24d8('0x48')])&&fs[_0x24d8('0x4c')](_0x5853f5)){logger[_0x24d8('0x5a')](_0x24d8('0x5b')+_0x5853f5+_0x24d8('0x5c'));fs['unlinkSync'](_0x5853f5);}_0x5853f5=_0x5853f5+_0x24d8('0x5d');if(!_[_0x24d8('0x59')](_0x468960['savePath'])&&fs[_0x24d8('0x4c')](_0x5853f5)){logger[_0x24d8('0x5a')](_0x24d8('0x5b')+_0x5853f5+_0x24d8('0x5c'));fs['unlinkSync'](_0x5853f5);}return _0x468960;})[_0x24d8('0x21')](function(_0x44b5d6){if(!_0x44b5d6)throw new InternalError();return _0x44b5d6['destroy']();})['then'](function(){_0x2a3dd8[_0x24d8('0x15')](0xcc)[_0x24d8('0x16')]();})[_0x24d8('0x3e')](handleError(_0x2a3dd8,null));};
\ No newline at end of file
+var _0xefc5=['ejs','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','error','name','map','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','rows','show','keys','SquareRecording','length','includeAll','find','catch','body','params','download','uniqueid','savePath','filename','format','%s.cypher','existsSync','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','send','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox'];(function(_0x573fba,_0x2794cd){var _0x26dd1d=function(_0x5a9002){while(--_0x5a9002){_0x573fba['push'](_0x573fba['shift']());}};_0x26dd1d(++_0x2794cd);}(_0xefc5,0xb3));var _0x5efc=function(_0x229128,_0x273558){_0x229128=_0x229128-0x0;var _0x1875b9=_0xefc5[_0x229128];return _0x1875b9;};'use strict';var emlformat=require(_0x5efc('0x0'));var rimraf=require(_0x5efc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5efc('0x2'));var rp=require(_0x5efc('0x3'));var moment=require(_0x5efc('0x4'));var BPromise=require(_0x5efc('0x5'));var Mustache=require(_0x5efc('0x6'));var util=require('util');var path=require(_0x5efc('0x7'));var sox=require(_0x5efc('0x8'));var csv=require('to-csv');var ejs=require(_0x5efc('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5efc('0xa'));var deskjs=require(_0x5efc('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5efc('0xc'));var Papa=require(_0x5efc('0xd'));var Redis=require(_0x5efc('0xe'));var authService=require(_0x5efc('0xf'));var qs=require(_0x5efc('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5efc('0x11'));var logger=require('../../config/logger')(_0x5efc('0x12'));var utils=require(_0x5efc('0x13'));var config=require(_0x5efc('0x14'));var licenseUtil=require(_0x5efc('0x15'));var db=require(_0x5efc('0x16'))['db'];function respondWithStatusCode(_0xf6ac9e,_0x23ce6b){_0x23ce6b=_0x23ce6b||0xcc;return function(_0x27afd6){if(_0x27afd6){return _0xf6ac9e[_0x5efc('0x17')](_0x23ce6b);}return _0xf6ac9e['status'](_0x23ce6b)[_0x5efc('0x18')]();};}function respondWithResult(_0x13846b,_0x3c434d){_0x3c434d=_0x3c434d||0xc8;return function(_0x3e8eed){if(_0x3e8eed){return _0x13846b[_0x5efc('0x19')](_0x3c434d)['json'](_0x3e8eed);}};}function respondWithFilteredResult(_0x16395b,_0x312134){return function(_0xf16815){if(_0xf16815){var _0x4a4781=typeof _0x312134[_0x5efc('0x1a')]===_0x5efc('0x1b')&&typeof _0x312134[_0x5efc('0x1c')]===_0x5efc('0x1b');var _0x6e5f05=_0xf16815['count'];var _0x4f65ed=_0x4a4781?0x0:_0x312134[_0x5efc('0x1a')];var _0x3a74c7=_0x4a4781?_0xf16815[_0x5efc('0x1d')]:_0x312134[_0x5efc('0x1a')]+_0x312134[_0x5efc('0x1c')];var _0x4e7e82;if(_0x3a74c7>=_0x6e5f05){_0x3a74c7=_0x6e5f05;_0x4e7e82=0xc8;}else{_0x4e7e82=0xce;}_0x16395b[_0x5efc('0x19')](_0x4e7e82);return _0x16395b['set'](_0x5efc('0x1e'),_0x4f65ed+'-'+_0x3a74c7+'/'+_0x6e5f05)['json'](_0xf16815);}return null;};}function patchUpdates(_0x4b4cc3){return function(_0x45359a){try{jsonpatch['apply'](_0x45359a,_0x4b4cc3,!![]);}catch(_0x1dfbb2){return BPromise[_0x5efc('0x1f')](_0x1dfbb2);}return _0x45359a[_0x5efc('0x20')]();};}function saveUpdates(_0x117a1b,_0x1f79e6){return function(_0x4fe40c){if(_0x4fe40c){return _0x4fe40c[_0x5efc('0x21')](_0x117a1b)[_0x5efc('0x22')](function(_0x20fb8b){return _0x20fb8b;});}return null;};}function removeEntity(_0x5cbbfe,_0x47fe94){return function(_0x31cd60){if(_0x31cd60){return _0x31cd60[_0x5efc('0x23')]()[_0x5efc('0x22')](function(){_0x5cbbfe['status'](0xcc)[_0x5efc('0x18')]();});}};}function handleEntityNotFound(_0x1f0aa0,_0x231a3e){return function(_0x4a15f3){if(!_0x4a15f3){_0x1f0aa0[_0x5efc('0x17')](0x194);}return _0x4a15f3;};}function handleError(_0x21b99c,_0x5285a5){_0x5285a5=_0x5285a5||0x1f4;return function(_0x259f74){logger[_0x5efc('0x24')](_0x259f74['stack']);if(_0x259f74[_0x5efc('0x25')]){delete _0x259f74['name'];}_0x21b99c[_0x5efc('0x19')](_0x5285a5)['send'](_0x259f74);};}exports['index']=function(_0x1753b3,_0x461c00){var _0x1d6dd7={},_0x4a1a74={},_0x282770={'count':0x0,'rows':[]};var _0x517bd0=_[_0x5efc('0x26')](db['SquareRecording'][_0x5efc('0x27')],function(_0x10b8cf){return{'name':_0x10b8cf[_0x5efc('0x28')],'type':_0x10b8cf[_0x5efc('0x29')]['key']};});_0x4a1a74[_0x5efc('0x2a')]=_[_0x5efc('0x26')](_0x517bd0,_0x5efc('0x25'));_0x4a1a74[_0x5efc('0x2b')]=_['keys'](_0x1753b3['query']);_0x4a1a74['filters']=_[_0x5efc('0x2c')](_0x4a1a74[_0x5efc('0x2a')],_0x4a1a74[_0x5efc('0x2b')]);_0x1d6dd7[_0x5efc('0x2d')]=_['intersection'](_0x4a1a74[_0x5efc('0x2a')],qs[_0x5efc('0x2e')](_0x1753b3[_0x5efc('0x2b')][_0x5efc('0x2e')]));_0x1d6dd7['attributes']=_0x1d6dd7[_0x5efc('0x2d')]['length']?_0x1d6dd7[_0x5efc('0x2d')]:_0x4a1a74['model'];if(!_0x1753b3[_0x5efc('0x2b')][_0x5efc('0x2f')](_0x5efc('0x30'))){_0x1d6dd7['limit']=qs[_0x5efc('0x1c')](_0x1753b3[_0x5efc('0x2b')][_0x5efc('0x1c')]);_0x1d6dd7[_0x5efc('0x1a')]=qs[_0x5efc('0x1a')](_0x1753b3[_0x5efc('0x2b')]['offset']);}_0x1d6dd7[_0x5efc('0x31')]=qs[_0x5efc('0x32')](_0x1753b3[_0x5efc('0x2b')][_0x5efc('0x32')]);_0x1d6dd7[_0x5efc('0x33')]=qs[_0x5efc('0x34')](_[_0x5efc('0x35')](_0x1753b3['query'],_0x4a1a74['filters']),_0x517bd0);if(_0x1753b3[_0x5efc('0x2b')][_0x5efc('0x36')]){_0x1d6dd7[_0x5efc('0x33')]=_[_0x5efc('0x37')](_0x1d6dd7[_0x5efc('0x33')],{'$or':_[_0x5efc('0x26')](_0x517bd0,function(_0x1917e6){if(_0x1917e6[_0x5efc('0x29')]!==_0x5efc('0x38')){var _0x20d0fb={};_0x20d0fb[_0x1917e6['name']]={'$like':'%'+_0x1753b3['query'][_0x5efc('0x36')]+'%'};return _0x20d0fb;}})});}_0x1d6dd7=_['merge']({},_0x1d6dd7,_0x1753b3[_0x5efc('0x39')]);var _0x2a981d={'where':_0x1d6dd7[_0x5efc('0x33')]};return db['SquareRecording'][_0x5efc('0x1d')](_0x2a981d)['then'](function(_0x390685){_0x282770[_0x5efc('0x1d')]=_0x390685;if(_0x1753b3[_0x5efc('0x2b')]['includeAll']){_0x1d6dd7[_0x5efc('0x3a')]=[{'all':!![]}];}return db['SquareRecording']['findAll'](_0x1d6dd7);})['then'](function(_0x5e4572){_0x282770[_0x5efc('0x3b')]=_0x5e4572;return _0x282770;})[_0x5efc('0x22')](respondWithFilteredResult(_0x461c00,_0x1d6dd7))['catch'](handleError(_0x461c00,null));};exports[_0x5efc('0x3c')]=function(_0x30b0c2,_0x1ebb6b){var _0x297df3={'raw':!![],'where':{'id':_0x30b0c2['params']['id']}},_0x42cc4f={};_0x42cc4f[_0x5efc('0x2a')]=_[_0x5efc('0x3d')](db[_0x5efc('0x3e')][_0x5efc('0x27')]);_0x42cc4f['query']=_['keys'](_0x30b0c2[_0x5efc('0x2b')]);_0x42cc4f[_0x5efc('0x34')]=_[_0x5efc('0x2c')](_0x42cc4f[_0x5efc('0x2a')],_0x42cc4f[_0x5efc('0x2b')]);_0x297df3[_0x5efc('0x2d')]=_['intersection'](_0x42cc4f[_0x5efc('0x2a')],qs['fields'](_0x30b0c2[_0x5efc('0x2b')][_0x5efc('0x2e')]));_0x297df3[_0x5efc('0x2d')]=_0x297df3[_0x5efc('0x2d')][_0x5efc('0x3f')]?_0x297df3['attributes']:_0x42cc4f[_0x5efc('0x2a')];if(_0x30b0c2['query'][_0x5efc('0x40')]){_0x297df3['include']=[{'all':!![]}];}_0x297df3=_['merge']({},_0x297df3,_0x30b0c2[_0x5efc('0x39')]);return db[_0x5efc('0x3e')][_0x5efc('0x41')](_0x297df3)[_0x5efc('0x22')](handleEntityNotFound(_0x1ebb6b,null))['then'](respondWithResult(_0x1ebb6b,null))[_0x5efc('0x42')](handleError(_0x1ebb6b,null));};exports['create']=function(_0xfaa8ca,_0x276caa){return db[_0x5efc('0x3e')]['create'](_0xfaa8ca[_0x5efc('0x43')],{})['then'](respondWithResult(_0x276caa,0xc9))[_0x5efc('0x42')](handleError(_0x276caa,null));};exports[_0x5efc('0x21')]=function(_0x19dac3,_0x13a1c6){if(_0x19dac3[_0x5efc('0x43')]['id']){delete _0x19dac3[_0x5efc('0x43')]['id'];}return db['SquareRecording']['find']({'where':{'id':_0x19dac3[_0x5efc('0x44')]['id']}})[_0x5efc('0x22')](handleEntityNotFound(_0x13a1c6,null))[_0x5efc('0x22')](saveUpdates(_0x19dac3[_0x5efc('0x43')],null))[_0x5efc('0x22')](respondWithResult(_0x13a1c6,null))[_0x5efc('0x42')](handleError(_0x13a1c6,null));};exports[_0x5efc('0x45')]=function(_0x546b5f,_0x828b37,_0x1c576e){var _0x56cc65=require('../../components/encryptor');var _0x37b7a3=![];var _0x4b0450={};if(_0x546b5f[_0x5efc('0x2b')][_0x5efc('0x29')]&&_0x546b5f['query'][_0x5efc('0x29')]===_0x5efc('0x46')){_0x4b0450[_0x5efc('0x46')]=_0x546b5f[_0x5efc('0x44')]['id'];}else{_0x4b0450['id']=_0x546b5f[_0x5efc('0x44')]['id'];}return db[_0x5efc('0x3e')][_0x5efc('0x41')]({'where':_0x4b0450,'attributes':['id',_0x5efc('0x47'),_0x5efc('0x48')],'raw':!![]})[_0x5efc('0x22')](handleEntityNotFound(_0x828b37,null))[_0x5efc('0x22')](function(_0x67c805){if(_0x67c805){var _0x5d8c5f=_0x67c805[_0x5efc('0x47')];var _0x46be39=util[_0x5efc('0x49')](_0x5efc('0x4a'),_0x5d8c5f);if(fs[_0x5efc('0x4b')](_0x46be39)){_0x37b7a3=!![];return _0x56cc65['decryptFile'](_0x46be39,_0x5d8c5f,config[_0x5efc('0x4c')][_0x5efc('0x4d')])[_0x5efc('0x22')](function(){return _0x67c805;});}return _0x67c805;}})[_0x5efc('0x22')](function(_0x1594d6){if(_0x1594d6){var _0x4794e0=_0x1594d6[_0x5efc('0x47')];if(!fs[_0x5efc('0x4b')](_0x4794e0)){throw new db[(_0x5efc('0x4e'))][(_0x5efc('0x4f'))](_0x5efc('0x50'));}if(_0x1594d6[_0x5efc('0x48')]){return _0x828b37[_0x5efc('0x45')](_0x4794e0,_0x1594d6[_0x5efc('0x48')]+path[_0x5efc('0x51')](_0x4794e0),function(){if(_0x37b7a3){fs[_0x5efc('0x52')](_0x4794e0);}});}else{return _0x828b37[_0x5efc('0x45')](_0x4794e0,function(_0x1be64a){if(_0x37b7a3){fs[_0x5efc('0x52')](_0x4794e0);}});}}})[_0x5efc('0x42')](function(_0x128ddb){if(_0x128ddb[_0x5efc('0x53')]===_0x5efc('0x50')){_0x828b37['status'](0x194)[_0x5efc('0x54')](_0x5efc('0x55'));}else{return handleError(_0x828b37,null);}});};exports[_0x5efc('0x23')]=function(_0x566699,_0x235946){return db['SquareRecording'][_0x5efc('0x41')]({'where':{'id':_0x566699[_0x5efc('0x44')]['id']}})['then'](function(_0x2ab8f3){if(_[_0x5efc('0x56')](_0x2ab8f3)){throw new ReferenceError(_0x5efc('0x57'));}return _0x2ab8f3;})[_0x5efc('0x22')](function(_0x22bd11){var _0x5cd51d=_0x22bd11['savePath'];logger[_0x5efc('0x58')](_0x5efc('0x59'),_0x5cd51d);if(!_[_0x5efc('0x56')](_0x22bd11[_0x5efc('0x47')])&&fs[_0x5efc('0x4b')](_0x5cd51d)){logger['info'](_0x5efc('0x5a')+_0x5cd51d+_0x5efc('0x5b'));fs[_0x5efc('0x5c')](_0x5cd51d);}_0x5cd51d=_0x5cd51d+_0x5efc('0x5d');if(!_[_0x5efc('0x56')](_0x22bd11[_0x5efc('0x47')])&&fs[_0x5efc('0x4b')](_0x5cd51d)){logger[_0x5efc('0x58')](_0x5efc('0x5a')+_0x5cd51d+_0x5efc('0x5b'));fs['unlinkSync'](_0x5cd51d);}return _0x22bd11;})[_0x5efc('0x22')](function(_0x23b579){if(!_0x23b579)throw new InternalError();return _0x23b579[_0x5efc('0x23')]();})[_0x5efc('0x22')](function(){_0x235946[_0x5efc('0x19')](0xcc)[_0x5efc('0x18')]();})[_0x5efc('0x42')](handleError(_0x235946,null));};
\ No newline at end of file
index cec114f..891821f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29b7=['exports','define','SquareRecording','square_recordings','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./squareRecording.attributes'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0x29b7,0x17d));var _0x729b=function(_0x3a0198,_0xb2c2ca){_0x3a0198=_0x3a0198-0x0;var _0x43bba4=_0x29b7[_0x3a0198];return _0x43bba4;};'use strict';var _=require('lodash');var util=require(_0x729b('0x0'));var logger=require(_0x729b('0x1'))(_0x729b('0x2'));var moment=require(_0x729b('0x3'));var BPromise=require(_0x729b('0x4'));var rp=require(_0x729b('0x5'));var fs=require('fs');var path=require(_0x729b('0x6'));var rimraf=require(_0x729b('0x7'));var config=require('../../config/environment');var attributes=require(_0x729b('0x8'));module[_0x729b('0x9')]=function(_0x47ef25,_0x1fdba3){return _0x47ef25[_0x729b('0xa')](_0x729b('0xb'),attributes,{'tableName':_0x729b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc00b=['moment','request-promise','path','rimraf','../../config/environment','exports','SquareRecording','square_recordings','lodash'];(function(_0x454e6d,_0x1e1f38){var _0x4bc294=function(_0x2c803a){while(--_0x2c803a){_0x454e6d['push'](_0x454e6d['shift']());}};_0x4bc294(++_0x1e1f38);}(_0xc00b,0x1e5));var _0xbc00=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0xc00b[_0x17928f];return _0x500b63;};'use strict';var _=require(_0xbc00('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xbc00('0x1'));var BPromise=require('bluebird');var rp=require(_0xbc00('0x2'));var fs=require('fs');var path=require(_0xbc00('0x3'));var rimraf=require(_0xbc00('0x4'));var config=require(_0xbc00('0x5'));var attributes=require('./squareRecording.attributes');module[_0xbc00('0x6')]=function(_0x5b47bf,_0x1cc85f){return _0x5b47bf['define'](_0xbc00('0x7'),attributes,{'tableName':_0xbc00('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 08626b8..8eb2131 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x712a=['result','catch','CreateSquareRecording','SquareRecording','create','body','options','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x4e69e4,_0xabe029){var _0x516f44=function(_0x1d15fe){while(--_0x1d15fe){_0x4e69e4['push'](_0x4e69e4['shift']());}};_0x516f44(++_0xabe029);}(_0x712a,0x115));var _0xa712=function(_0x86b219,_0x43038f){_0x86b219=_0x86b219-0x0;var _0x1f320c=_0x712a[_0x86b219];return _0x1f320c;};'use strict';var _=require('lodash');var util=require(_0xa712('0x0'));var moment=require(_0xa712('0x1'));var BPromise=require(_0xa712('0x2'));var rs=require(_0xa712('0x3'));var fs=require('fs');var Redis=require(_0xa712('0x4'));var db=require(_0xa712('0x5'))['db'];var utils=require(_0xa712('0x6'));var logger=require('../../config/logger')(_0xa712('0x7'));var config=require(_0xa712('0x8'));var jayson=require(_0xa712('0x9'));var client=jayson[_0xa712('0xa')][_0xa712('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x166fb5,_0x4ec0b6,_0xcef69e){return new BPromise(function(_0x1556ea,_0x1fd3bd){return client[_0xa712('0xc')](_0x166fb5,_0xcef69e)[_0xa712('0xd')](function(_0x394b19){logger['info'](_0xa712('0xe'),_0x4ec0b6,_0xa712('0xf'));logger[_0xa712('0x10')](_0xa712('0x11'),_0x4ec0b6,_0xa712('0xf'),JSON[_0xa712('0x12')](_0x394b19));if(_0x394b19[_0xa712('0x13')]){if(_0x394b19[_0xa712('0x13')][_0xa712('0x14')]===0x1f4){logger['error']('SquareRecording,\x20%s,\x20%s',_0x4ec0b6,_0x394b19['error'][_0xa712('0x15')]);return _0x1fd3bd(_0x394b19[_0xa712('0x13')][_0xa712('0x15')]);}logger[_0xa712('0x13')]('SquareRecording,\x20%s,\x20%s',_0x4ec0b6,_0x394b19[_0xa712('0x13')][_0xa712('0x15')]);return _0x1556ea(_0x394b19['error']['message']);}else{logger[_0xa712('0x16')](_0xa712('0xe'),_0x4ec0b6,_0xa712('0xf'));_0x1556ea(_0x394b19[_0xa712('0x17')]['message']);}})[_0xa712('0x18')](function(_0x1a5c7f){logger[_0xa712('0x13')](_0xa712('0xe'),_0x4ec0b6,_0x1a5c7f);_0x1fd3bd(_0x1a5c7f);});});}exports[_0xa712('0x19')]=function(_0x5c7e20){var _0x38af86=this;return new Promise(function(_0x1297e2,_0x588898){return db[_0xa712('0x1a')][_0xa712('0x1b')](_0x5c7e20[_0xa712('0x1c')],{'raw':_0x5c7e20['options']?_0x5c7e20[_0xa712('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0xa712('0xd')](function(_0x1f8266){logger[_0xa712('0x16')]('CreateSquareRecording',_0x5c7e20);logger[_0xa712('0x10')](_0xa712('0x19'),_0x5c7e20,JSON['stringify'](_0x1f8266));_0x1297e2(_0x1f8266);})['catch'](function(_0x11184c){logger[_0xa712('0x13')]('CreateSquareRecording',_0x11184c[_0xa712('0x15')],_0x5c7e20);_0x588898(_0x38af86[_0xa712('0x13')](0x1f4,_0x11184c[_0xa712('0x15')]));});});};
\ No newline at end of file
+var _0xc3dd=['options','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','debug','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','SquareRecording,\x20%s,\x20%s','message','result','CreateSquareRecording','SquareRecording','create','body'];(function(_0x201d73,_0x2a916b){var _0x5673e1=function(_0x273898){while(--_0x273898){_0x201d73['push'](_0x201d73['shift']());}};_0x5673e1(++_0x2a916b);}(_0xc3dd,0x16e));var _0xdc3d=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xc3dd[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require(_0xdc3d('0x0'));var util=require(_0xdc3d('0x1'));var moment=require(_0xdc3d('0x2'));var BPromise=require(_0xdc3d('0x3'));var rs=require(_0xdc3d('0x4'));var fs=require('fs');var Redis=require(_0xdc3d('0x5'));var db=require(_0xdc3d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xdc3d('0x7'))(_0xdc3d('0x8'));var config=require('../../config/environment');var jayson=require(_0xdc3d('0x9'));var client=jayson[_0xdc3d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54b978,_0x4d7df4,_0x3fc3e4){return new BPromise(function(_0x1f7f35,_0x9c0413){return client[_0xdc3d('0xb')](_0x54b978,_0x3fc3e4)[_0xdc3d('0xc')](function(_0x329cb7){logger[_0xdc3d('0xd')]('SquareRecording,\x20%s,\x20%s',_0x4d7df4,'request\x20sent');logger[_0xdc3d('0xe')](_0xdc3d('0xf'),_0x4d7df4,_0xdc3d('0x10'),JSON[_0xdc3d('0x11')](_0x329cb7));if(_0x329cb7[_0xdc3d('0x12')]){if(_0x329cb7['error']['code']===0x1f4){logger['error'](_0xdc3d('0x13'),_0x4d7df4,_0x329cb7[_0xdc3d('0x12')][_0xdc3d('0x14')]);return _0x9c0413(_0x329cb7[_0xdc3d('0x12')][_0xdc3d('0x14')]);}logger[_0xdc3d('0x12')](_0xdc3d('0x13'),_0x4d7df4,_0x329cb7['error']['message']);return _0x1f7f35(_0x329cb7[_0xdc3d('0x12')]['message']);}else{logger[_0xdc3d('0xd')](_0xdc3d('0x13'),_0x4d7df4,_0xdc3d('0x10'));_0x1f7f35(_0x329cb7[_0xdc3d('0x15')][_0xdc3d('0x14')]);}})['catch'](function(_0xd5c44c){logger['error'](_0xdc3d('0x13'),_0x4d7df4,_0xd5c44c);_0x9c0413(_0xd5c44c);});});}exports[_0xdc3d('0x16')]=function(_0x2d0d45){var _0x19461e=this;return new Promise(function(_0x5699e4,_0x527481){return db[_0xdc3d('0x17')][_0xdc3d('0x18')](_0x2d0d45[_0xdc3d('0x19')],{'raw':_0x2d0d45[_0xdc3d('0x1a')]?_0x2d0d45[_0xdc3d('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x43e43e){logger['info'](_0xdc3d('0x16'),_0x2d0d45);logger['debug'](_0xdc3d('0x16'),_0x2d0d45,JSON[_0xdc3d('0x11')](_0x43e43e));_0x5699e4(_0x43e43e);})[_0xdc3d('0x1b')](function(_0x28c60e){logger['error'](_0xdc3d('0x16'),_0x28c60e[_0xdc3d('0x14')],_0x2d0d45);_0x527481(_0x19461e[_0xdc3d('0x12')](0x1f4,_0x28c60e[_0xdc3d('0x14')]));});});};
\ No newline at end of file
index 5b3088e..8c7b643 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x48e1ec,_0x35f468){var _0x3b33eb=function(_0x507bf9){while(--_0x507bf9){_0x48e1ec['push'](_0x48e1ec['shift']());}};_0x3b33eb(++_0x35f468);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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
+var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x1f53f0,_0x9b7510){var _0x1f4cd2=function(_0x1f8e61){while(--_0x1f8e61){_0x1f53f0['push'](_0x1f53f0['shift']());}};_0x1f4cd2(++_0x9b7510);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xbaf0[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router;
\ No newline at end of file
index e8f9723..758d215 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee41=['STRING','DATE','BOOLEAN','exports'];(function(_0x41ee19,_0x2798ed){var _0x3dbe0e=function(_0x2982f8){while(--_0x2982f8){_0x41ee19['push'](_0x41ee19['shift']());}};_0x3dbe0e(++_0x2798ed);}(_0xee41,0x1bb));var _0x1ee4=function(_0x1f0679,_0x53d43c){_0x1f0679=_0x1f0679-0x0;var _0x3dc3a4=_0xee41[_0x1f0679];return _0x3dc3a4;};'use strict';var Sequelize=require('sequelize');module[_0x1ee4('0x0')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x1ee4('0x1')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x1ee4('0x1')]},'type':{'type':Sequelize[_0x1ee4('0x1')]},'uniqueid':{'type':Sequelize[_0x1ee4('0x1')]},'version':{'type':Sequelize[_0x1ee4('0x1')]},'callerid':{'type':Sequelize[_0x1ee4('0x1')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x1ee4('0x1')]},'callingani2':{'type':Sequelize[_0x1ee4('0x1')]},'callington':{'type':Sequelize[_0x1ee4('0x1')]},'callingtns':{'type':Sequelize[_0x1ee4('0x1')]},'dnid':{'type':Sequelize[_0x1ee4('0x1')]},'rdnis':{'type':Sequelize[_0x1ee4('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x1ee4('0x1')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x1ee4('0x1')]},'accountcode':{'type':Sequelize[_0x1ee4('0x1')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x1ee4('0x2')]},'leaveAt':{'type':Sequelize[_0x1ee4('0x2')]},'bot':{'type':Sequelize[_0x1ee4('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0xc5c3=['exports','STRING','DATE','BOOLEAN','sequelize'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xc5c3,0x1c1));var _0x3c5c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc5c3[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3c5c('0x0'));module[_0x3c5c('0x1')]={'network':{'type':Sequelize[_0x3c5c('0x2')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x3c5c('0x2')]},'channel':{'type':Sequelize[_0x3c5c('0x2')]},'language':{'type':Sequelize[_0x3c5c('0x2')]},'type':{'type':Sequelize[_0x3c5c('0x2')]},'uniqueid':{'type':Sequelize[_0x3c5c('0x2')]},'version':{'type':Sequelize[_0x3c5c('0x2')]},'callerid':{'type':Sequelize[_0x3c5c('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x3c5c('0x2')]},'callingani2':{'type':Sequelize[_0x3c5c('0x2')]},'callington':{'type':Sequelize[_0x3c5c('0x2')]},'callingtns':{'type':Sequelize[_0x3c5c('0x2')]},'dnid':{'type':Sequelize[_0x3c5c('0x2')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x3c5c('0x2')]},'extension':{'type':Sequelize[_0x3c5c('0x2')]},'priority':{'type':Sequelize[_0x3c5c('0x2')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x3c5c('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x3c5c('0x2')]},'joinAt':{'type':Sequelize[_0x3c5c('0x3')]},'leaveAt':{'type':Sequelize[_0x3c5c('0x3')]},'bot':{'type':Sequelize[_0x3c5c('0x4')],'defaultValue':![]}};
\ No newline at end of file
index 51b0158..20223b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeeca=['limit','count','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','where','merge','VIRTUAL','filter','options','includeAll','include','SquareReport','findAll','rows','catch','show','keys','fields','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset'];(function(_0x479509,_0x1daf8a){var _0x382da8=function(_0x39d77c){while(--_0x39d77c){_0x479509['push'](_0x479509['shift']());}};_0x382da8(++_0x1daf8a);}(_0xeeca,0x1a0));var _0xaeec=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xeeca[_0x68c979];return _0x4f0001;};'use strict';var emlformat=require(_0xaeec('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaeec('0x1'));var jsonpatch=require(_0xaeec('0x2'));var rp=require(_0xaeec('0x3'));var moment=require(_0xaeec('0x4'));var BPromise=require(_0xaeec('0x5'));var Mustache=require('mustache');var util=require(_0xaeec('0x6'));var path=require('path');var sox=require(_0xaeec('0x7'));var csv=require(_0xaeec('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaeec('0x9'));var _=require(_0xaeec('0xa'));var squel=require(_0xaeec('0xb'));var crypto=require(_0xaeec('0xc'));var jsforce=require(_0xaeec('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaeec('0x8'));var querystring=require(_0xaeec('0xe'));var Papa=require('papaparse');var Redis=require(_0xaeec('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xaeec('0x10'));var as=require(_0xaeec('0x11'));var hardwareService=require(_0xaeec('0x12'));var logger=require(_0xaeec('0x13'))(_0xaeec('0x14'));var utils=require(_0xaeec('0x15'));var config=require(_0xaeec('0x16'));var licenseUtil=require(_0xaeec('0x17'));var db=require(_0xaeec('0x18'))['db'];function respondWithStatusCode(_0x172c6c,_0x711af9){_0x711af9=_0x711af9||0xcc;return function(_0x47d03f){if(_0x47d03f){return _0x172c6c['sendStatus'](_0x711af9);}return _0x172c6c[_0xaeec('0x19')](_0x711af9)['end']();};}function respondWithResult(_0x35bcf6,_0x3139b){_0x3139b=_0x3139b||0xc8;return function(_0xc31c14){if(_0xc31c14){return _0x35bcf6[_0xaeec('0x19')](_0x3139b)[_0xaeec('0x1a')](_0xc31c14);}};}function respondWithFilteredResult(_0x44b026,_0x536aba){return function(_0x43a236){if(_0x43a236){var _0x429c2b=typeof _0x536aba[_0xaeec('0x1b')]==='undefined'&&typeof _0x536aba[_0xaeec('0x1c')]==='undefined';var _0x1090cf=_0x43a236[_0xaeec('0x1d')];var _0x3a155a=_0x429c2b?0x0:_0x536aba[_0xaeec('0x1b')];var _0x137684=_0x429c2b?_0x43a236[_0xaeec('0x1d')]:_0x536aba[_0xaeec('0x1b')]+_0x536aba['limit'];var _0x509023;if(_0x137684>=_0x1090cf){_0x137684=_0x1090cf;_0x509023=0xc8;}else{_0x509023=0xce;}_0x44b026[_0xaeec('0x19')](_0x509023);return _0x44b026['set'](_0xaeec('0x1e'),_0x3a155a+'-'+_0x137684+'/'+_0x1090cf)[_0xaeec('0x1a')](_0x43a236);}return null;};}function patchUpdates(_0x303eb9){return function(_0x4e7776){try{jsonpatch[_0xaeec('0x1f')](_0x4e7776,_0x303eb9,!![]);}catch(_0x5c7464){return BPromise[_0xaeec('0x20')](_0x5c7464);}return _0x4e7776[_0xaeec('0x21')]();};}function saveUpdates(_0x17e35b,_0xd209d0){return function(_0x13f714){if(_0x13f714){return _0x13f714[_0xaeec('0x22')](_0x17e35b)[_0xaeec('0x23')](function(_0x12c6d2){return _0x12c6d2;});}return null;};}function removeEntity(_0x5f50d9,_0x5e5e43){return function(_0x174fb8){if(_0x174fb8){return _0x174fb8[_0xaeec('0x24')]()['then'](function(){_0x5f50d9[_0xaeec('0x19')](0xcc)[_0xaeec('0x25')]();});}};}function handleEntityNotFound(_0x4687fe,_0x41f6f3){return function(_0x192b04){if(!_0x192b04){_0x4687fe['sendStatus'](0x194);}return _0x192b04;};}function handleError(_0x4fd4fd,_0x133188){_0x133188=_0x133188||0x1f4;return function(_0xf5eb9c){logger['error'](_0xf5eb9c[_0xaeec('0x26')]);if(_0xf5eb9c[_0xaeec('0x27')]){delete _0xf5eb9c['name'];}_0x4fd4fd[_0xaeec('0x19')](_0x133188)[_0xaeec('0x28')](_0xf5eb9c);};}exports['index']=function(_0x3928ee,_0x2eaa01){var _0x4f0eac={},_0x510724={},_0x543f44={'count':0x0,'rows':[]};var _0x5b654b=_[_0xaeec('0x29')](db['SquareReport'][_0xaeec('0x2a')],function(_0x383c13){return{'name':_0x383c13[_0xaeec('0x2b')],'type':_0x383c13[_0xaeec('0x2c')][_0xaeec('0x2d')]};});_0x510724[_0xaeec('0x2e')]=_[_0xaeec('0x29')](_0x5b654b,'name');_0x510724[_0xaeec('0x2f')]=_['keys'](_0x3928ee['query']);_0x510724[_0xaeec('0x30')]=_[_0xaeec('0x31')](_0x510724[_0xaeec('0x2e')],_0x510724[_0xaeec('0x2f')]);_0x4f0eac[_0xaeec('0x32')]=_['intersection'](_0x510724[_0xaeec('0x2e')],qs['fields'](_0x3928ee[_0xaeec('0x2f')]['fields']));_0x4f0eac[_0xaeec('0x32')]=_0x4f0eac[_0xaeec('0x32')][_0xaeec('0x33')]?_0x4f0eac[_0xaeec('0x32')]:_0x510724['model'];if(!_0x3928ee[_0xaeec('0x2f')][_0xaeec('0x34')](_0xaeec('0x35'))){_0x4f0eac[_0xaeec('0x1c')]=qs[_0xaeec('0x1c')](_0x3928ee['query'][_0xaeec('0x1c')]);_0x4f0eac[_0xaeec('0x1b')]=qs[_0xaeec('0x1b')](_0x3928ee[_0xaeec('0x2f')][_0xaeec('0x1b')]);}_0x4f0eac[_0xaeec('0x36')]=qs['sort'](_0x3928ee[_0xaeec('0x2f')]['sort']);_0x4f0eac[_0xaeec('0x37')]=qs[_0xaeec('0x30')](_['pick'](_0x3928ee[_0xaeec('0x2f')],_0x510724['filters']),_0x5b654b);if(_0x3928ee['query']['filter']){_0x4f0eac[_0xaeec('0x37')]=_[_0xaeec('0x38')](_0x4f0eac['where'],{'$or':_['map'](_0x5b654b,function(_0x49d189){if(_0x49d189['type']!==_0xaeec('0x39')){var _0x356396={};_0x356396[_0x49d189['name']]={'$like':'%'+_0x3928ee[_0xaeec('0x2f')][_0xaeec('0x3a')]+'%'};return _0x356396;}})});}_0x4f0eac=_['merge']({},_0x4f0eac,_0x3928ee[_0xaeec('0x3b')]);var _0x277dd6={'where':_0x4f0eac[_0xaeec('0x37')]};return db['SquareReport'][_0xaeec('0x1d')](_0x277dd6)[_0xaeec('0x23')](function(_0x24d79c){_0x543f44['count']=_0x24d79c;if(_0x3928ee[_0xaeec('0x2f')][_0xaeec('0x3c')]){_0x4f0eac[_0xaeec('0x3d')]=[{'all':!![]}];}return db[_0xaeec('0x3e')][_0xaeec('0x3f')](_0x4f0eac);})['then'](function(_0x494dbf){_0x543f44[_0xaeec('0x40')]=_0x494dbf;return _0x543f44;})['then'](respondWithFilteredResult(_0x2eaa01,_0x4f0eac))[_0xaeec('0x41')](handleError(_0x2eaa01,null));};exports[_0xaeec('0x42')]=function(_0x22172d,_0x18f552){var _0x4d8d38={'raw':!![],'where':{'id':_0x22172d['params']['id']}},_0x23da31={};_0x23da31[_0xaeec('0x2e')]=_[_0xaeec('0x43')](db[_0xaeec('0x3e')][_0xaeec('0x2a')]);_0x23da31['query']=_[_0xaeec('0x43')](_0x22172d[_0xaeec('0x2f')]);_0x23da31[_0xaeec('0x30')]=_['intersection'](_0x23da31['model'],_0x23da31[_0xaeec('0x2f')]);_0x4d8d38[_0xaeec('0x32')]=_[_0xaeec('0x31')](_0x23da31[_0xaeec('0x2e')],qs[_0xaeec('0x44')](_0x22172d['query']['fields']));_0x4d8d38['attributes']=_0x4d8d38[_0xaeec('0x32')][_0xaeec('0x33')]?_0x4d8d38['attributes']:_0x23da31[_0xaeec('0x2e')];if(_0x22172d['query'][_0xaeec('0x3c')]){_0x4d8d38[_0xaeec('0x3d')]=[{'all':!![]}];}_0x4d8d38=_[_0xaeec('0x38')]({},_0x4d8d38,_0x22172d[_0xaeec('0x3b')]);return db[_0xaeec('0x3e')][_0xaeec('0x45')](_0x4d8d38)[_0xaeec('0x23')](handleEntityNotFound(_0x18f552,null))['then'](respondWithResult(_0x18f552,null))['catch'](handleError(_0x18f552,null));};exports[_0xaeec('0x46')]=function(_0x29dd0c,_0x24391d){return db[_0xaeec('0x3e')]['create'](_0x29dd0c[_0xaeec('0x47')],{})[_0xaeec('0x23')](respondWithResult(_0x24391d,0xc9))[_0xaeec('0x41')](handleError(_0x24391d,null));};exports['update']=function(_0x28c936,_0x5cfc92){if(_0x28c936[_0xaeec('0x47')]['id']){delete _0x28c936['body']['id'];}return db[_0xaeec('0x3e')]['find']({'where':{'id':_0x28c936[_0xaeec('0x48')]['id']}})[_0xaeec('0x23')](handleEntityNotFound(_0x5cfc92,null))['then'](saveUpdates(_0x28c936['body'],null))[_0xaeec('0x23')](respondWithResult(_0x5cfc92,null))[_0xaeec('0x41')](handleError(_0x5cfc92,null));};exports[_0xaeec('0x24')]=function(_0x13275a,_0x510c5d){return db[_0xaeec('0x3e')][_0xaeec('0x45')]({'where':{'id':_0x13275a[_0xaeec('0x48')]['id']}})['then'](handleEntityNotFound(_0x510c5d,null))['then'](removeEntity(_0x510c5d,null))[_0xaeec('0x41')](handleError(_0x510c5d,null));};exports[_0xaeec('0x49')]=function(_0x51a4cf,_0x5072f3){return db[_0xaeec('0x3e')][_0xaeec('0x49')]()['then'](respondWithResult(_0x5072f3,null))[_0xaeec('0x41')](handleError(_0x5072f3,null));};
\ No newline at end of file
+var _0x43a6=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','error','name','send','type','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','SquareReport','rows','catch','show','params','rawAttributes','length','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x5b25f6,_0x2cacdd){var _0x60071a=function(_0x3d82d4){while(--_0x3d82d4){_0x5b25f6['push'](_0x5b25f6['shift']());}};_0x60071a(++_0x2cacdd);}(_0x43a6,0x1e5));var _0x643a=function(_0x5517c0,_0x358609){_0x5517c0=_0x5517c0-0x0;var _0x33803b=_0x43a6[_0x5517c0];return _0x33803b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x643a('0x0'));var zipdir=require(_0x643a('0x1'));var jsonpatch=require(_0x643a('0x2'));var rp=require(_0x643a('0x3'));var moment=require(_0x643a('0x4'));var BPromise=require(_0x643a('0x5'));var Mustache=require(_0x643a('0x6'));var util=require(_0x643a('0x7'));var path=require(_0x643a('0x8'));var sox=require(_0x643a('0x9'));var csv=require('to-csv');var ejs=require(_0x643a('0xa'));var fs=require('fs');var fs_extra=require(_0x643a('0xb'));var _=require('lodash');var squel=require(_0x643a('0xc'));var crypto=require(_0x643a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x643a('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x643a('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x643a('0x10'));var as=require(_0x643a('0x11'));var hardwareService=require(_0x643a('0x12'));var logger=require(_0x643a('0x13'))('api');var utils=require(_0x643a('0x14'));var config=require(_0x643a('0x15'));var licenseUtil=require(_0x643a('0x16'));var db=require(_0x643a('0x17'))['db'];function respondWithStatusCode(_0x171607,_0x3d7112){_0x3d7112=_0x3d7112||0xcc;return function(_0x58e803){if(_0x58e803){return _0x171607[_0x643a('0x18')](_0x3d7112);}return _0x171607[_0x643a('0x19')](_0x3d7112)[_0x643a('0x1a')]();};}function respondWithResult(_0x2260b6,_0x52a165){_0x52a165=_0x52a165||0xc8;return function(_0x307020){if(_0x307020){return _0x2260b6[_0x643a('0x19')](_0x52a165)[_0x643a('0x1b')](_0x307020);}};}function respondWithFilteredResult(_0x33ca89,_0x57be3a){return function(_0x103c63){if(_0x103c63){var _0x180126=typeof _0x57be3a[_0x643a('0x1c')]==='undefined'&&typeof _0x57be3a['limit']===_0x643a('0x1d');var _0xe7b041=_0x103c63[_0x643a('0x1e')];var _0x41be53=_0x180126?0x0:_0x57be3a[_0x643a('0x1c')];var _0x3aa7e3=_0x180126?_0x103c63['count']:_0x57be3a[_0x643a('0x1c')]+_0x57be3a[_0x643a('0x1f')];var _0x4abd17;if(_0x3aa7e3>=_0xe7b041){_0x3aa7e3=_0xe7b041;_0x4abd17=0xc8;}else{_0x4abd17=0xce;}_0x33ca89[_0x643a('0x19')](_0x4abd17);return _0x33ca89[_0x643a('0x20')](_0x643a('0x21'),_0x41be53+'-'+_0x3aa7e3+'/'+_0xe7b041)[_0x643a('0x1b')](_0x103c63);}return null;};}function patchUpdates(_0x1beaf4){return function(_0xa83a0f){try{jsonpatch[_0x643a('0x22')](_0xa83a0f,_0x1beaf4,!![]);}catch(_0x50fd13){return BPromise[_0x643a('0x23')](_0x50fd13);}return _0xa83a0f['save']();};}function saveUpdates(_0x48a2d2,_0x5e4eee){return function(_0x9ec1ce){if(_0x9ec1ce){return _0x9ec1ce['update'](_0x48a2d2)['then'](function(_0xcb1329){return _0xcb1329;});}return null;};}function removeEntity(_0x19ae5c,_0xea462d){return function(_0x281e39){if(_0x281e39){return _0x281e39['destroy']()[_0x643a('0x24')](function(){_0x19ae5c[_0x643a('0x19')](0xcc)[_0x643a('0x1a')]();});}};}function handleEntityNotFound(_0x1a6c9d,_0x3b12a2){return function(_0x1372fa){if(!_0x1372fa){_0x1a6c9d[_0x643a('0x18')](0x194);}return _0x1372fa;};}function handleError(_0xfd05cb,_0xbc8c50){_0xbc8c50=_0xbc8c50||0x1f4;return function(_0x1d5f91){logger[_0x643a('0x25')](_0x1d5f91['stack']);if(_0x1d5f91[_0x643a('0x26')]){delete _0x1d5f91[_0x643a('0x26')];}_0xfd05cb[_0x643a('0x19')](_0xbc8c50)[_0x643a('0x27')](_0x1d5f91);};}exports['index']=function(_0x403e3d,_0x2abd9e){var _0x2715df={},_0x60b30d={},_0xf9ff65={'count':0x0,'rows':[]};var _0x19e061=_['map'](db['SquareReport']['rawAttributes'],function(_0x4ee16a){return{'name':_0x4ee16a['fieldName'],'type':_0x4ee16a[_0x643a('0x28')][_0x643a('0x29')]};});_0x60b30d[_0x643a('0x2a')]=_[_0x643a('0x2b')](_0x19e061,_0x643a('0x26'));_0x60b30d[_0x643a('0x2c')]=_[_0x643a('0x2d')](_0x403e3d['query']);_0x60b30d[_0x643a('0x2e')]=_[_0x643a('0x2f')](_0x60b30d['model'],_0x60b30d['query']);_0x2715df[_0x643a('0x30')]=_['intersection'](_0x60b30d[_0x643a('0x2a')],qs[_0x643a('0x31')](_0x403e3d[_0x643a('0x2c')][_0x643a('0x31')]));_0x2715df['attributes']=_0x2715df[_0x643a('0x30')]['length']?_0x2715df[_0x643a('0x30')]:_0x60b30d[_0x643a('0x2a')];if(!_0x403e3d['query']['hasOwnProperty'](_0x643a('0x32'))){_0x2715df[_0x643a('0x1f')]=qs[_0x643a('0x1f')](_0x403e3d[_0x643a('0x2c')]['limit']);_0x2715df[_0x643a('0x1c')]=qs['offset'](_0x403e3d[_0x643a('0x2c')][_0x643a('0x1c')]);}_0x2715df['order']=qs[_0x643a('0x33')](_0x403e3d[_0x643a('0x2c')]['sort']);_0x2715df['where']=qs['filters'](_[_0x643a('0x34')](_0x403e3d[_0x643a('0x2c')],_0x60b30d[_0x643a('0x2e')]),_0x19e061);if(_0x403e3d[_0x643a('0x2c')][_0x643a('0x35')]){_0x2715df[_0x643a('0x36')]=_['merge'](_0x2715df[_0x643a('0x36')],{'$or':_[_0x643a('0x2b')](_0x19e061,function(_0x3ff354){if(_0x3ff354[_0x643a('0x28')]!==_0x643a('0x37')){var _0x3de6f2={};_0x3de6f2[_0x3ff354[_0x643a('0x26')]]={'$like':'%'+_0x403e3d[_0x643a('0x2c')][_0x643a('0x35')]+'%'};return _0x3de6f2;}})});}_0x2715df=_[_0x643a('0x38')]({},_0x2715df,_0x403e3d['options']);var _0x58b5bf={'where':_0x2715df[_0x643a('0x36')]};return db['SquareReport'][_0x643a('0x1e')](_0x58b5bf)[_0x643a('0x24')](function(_0x340229){_0xf9ff65[_0x643a('0x1e')]=_0x340229;if(_0x403e3d[_0x643a('0x2c')][_0x643a('0x39')]){_0x2715df[_0x643a('0x3a')]=[{'all':!![]}];}return db[_0x643a('0x3b')]['findAll'](_0x2715df);})[_0x643a('0x24')](function(_0x4b4e63){_0xf9ff65[_0x643a('0x3c')]=_0x4b4e63;return _0xf9ff65;})[_0x643a('0x24')](respondWithFilteredResult(_0x2abd9e,_0x2715df))[_0x643a('0x3d')](handleError(_0x2abd9e,null));};exports[_0x643a('0x3e')]=function(_0x2fd588,_0x59071d){var _0x5477a6={'raw':!![],'where':{'id':_0x2fd588[_0x643a('0x3f')]['id']}},_0x9687f9={};_0x9687f9[_0x643a('0x2a')]=_[_0x643a('0x2d')](db['SquareReport'][_0x643a('0x40')]);_0x9687f9[_0x643a('0x2c')]=_['keys'](_0x2fd588[_0x643a('0x2c')]);_0x9687f9[_0x643a('0x2e')]=_[_0x643a('0x2f')](_0x9687f9['model'],_0x9687f9[_0x643a('0x2c')]);_0x5477a6[_0x643a('0x30')]=_['intersection'](_0x9687f9[_0x643a('0x2a')],qs['fields'](_0x2fd588[_0x643a('0x2c')][_0x643a('0x31')]));_0x5477a6[_0x643a('0x30')]=_0x5477a6[_0x643a('0x30')][_0x643a('0x41')]?_0x5477a6[_0x643a('0x30')]:_0x9687f9[_0x643a('0x2a')];if(_0x2fd588[_0x643a('0x2c')]['includeAll']){_0x5477a6[_0x643a('0x3a')]=[{'all':!![]}];}_0x5477a6=_[_0x643a('0x38')]({},_0x5477a6,_0x2fd588['options']);return db['SquareReport'][_0x643a('0x42')](_0x5477a6)['then'](handleEntityNotFound(_0x59071d,null))[_0x643a('0x24')](respondWithResult(_0x59071d,null))[_0x643a('0x3d')](handleError(_0x59071d,null));};exports[_0x643a('0x43')]=function(_0x5c6fe6,_0xd54108){return db[_0x643a('0x3b')]['create'](_0x5c6fe6[_0x643a('0x44')],{})[_0x643a('0x24')](respondWithResult(_0xd54108,0xc9))['catch'](handleError(_0xd54108,null));};exports[_0x643a('0x45')]=function(_0x5a3ccc,_0x25d5b1){if(_0x5a3ccc[_0x643a('0x44')]['id']){delete _0x5a3ccc[_0x643a('0x44')]['id'];}return db[_0x643a('0x3b')][_0x643a('0x42')]({'where':{'id':_0x5a3ccc[_0x643a('0x3f')]['id']}})[_0x643a('0x24')](handleEntityNotFound(_0x25d5b1,null))[_0x643a('0x24')](saveUpdates(_0x5a3ccc['body'],null))[_0x643a('0x24')](respondWithResult(_0x25d5b1,null))['catch'](handleError(_0x25d5b1,null));};exports[_0x643a('0x46')]=function(_0x6ae83c,_0x254dc9){return db['SquareReport'][_0x643a('0x42')]({'where':{'id':_0x6ae83c[_0x643a('0x3f')]['id']}})['then'](handleEntityNotFound(_0x254dc9,null))[_0x643a('0x24')](removeEntity(_0x254dc9,null))[_0x643a('0x3d')](handleError(_0x254dc9,null));};exports['describe']=function(_0x605e08,_0x46d7cd){return db[_0x643a('0x3b')][_0x643a('0x47')]()[_0x643a('0x24')](respondWithResult(_0x46d7cd,null))[_0x643a('0x3d')](handleError(_0x46d7cd,null));};
\ No newline at end of file
index e098943..5124a3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ce2=['project_name','leaveAt','lodash','api','moment','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname'];(function(_0x5d023f,_0x1a582a){var _0x2f1eba=function(_0xf3a053){while(--_0xf3a053){_0x5d023f['push'](_0x5d023f['shift']());}};_0x2f1eba(++_0x1a582a);}(_0x3ce2,0x1a6));var _0x23ce=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x3ce2[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x23ce('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x23ce('0x1'));var moment=require(_0x23ce('0x2'));var BPromise=require('bluebird');var rp=require(_0x23ce('0x3'));var fs=require('fs');var path=require(_0x23ce('0x4'));var rimraf=require(_0x23ce('0x5'));var config=require(_0x23ce('0x6'));var attributes=require(_0x23ce('0x7'));module[_0x23ce('0x8')]=function(_0x2fefb2,_0x220179){return _0x2fefb2[_0x23ce('0x9')](_0x23ce('0xa'),attributes,{'tableName':_0x23ce('0xb'),'paranoid':![],'indexes':[{'name':_0x23ce('0xc'),'fields':['uniqueid',_0x23ce('0xd')]},{'name':_0x23ce('0xe'),'fields':[_0x23ce('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb4ed=['SquareReport','report_square','uid_pname','uniqueid','leaveAt','util','api','moment','bluebird','request-promise','path','rimraf','./squareReport.attributes','define'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xb4ed,0x101));var _0xdb4e=function(_0x10f6e8,_0x351db6){_0x10f6e8=_0x10f6e8-0x0;var _0x35bb3c=_0xb4ed[_0x10f6e8];return _0x35bb3c;};'use strict';var _=require('lodash');var util=require(_0xdb4e('0x0'));var logger=require('../../config/logger')(_0xdb4e('0x1'));var moment=require(_0xdb4e('0x2'));var BPromise=require(_0xdb4e('0x3'));var rp=require(_0xdb4e('0x4'));var fs=require('fs');var path=require(_0xdb4e('0x5'));var rimraf=require(_0xdb4e('0x6'));var config=require('../../config/environment');var attributes=require(_0xdb4e('0x7'));module['exports']=function(_0x4ffc7b,_0x29fd23){return _0x4ffc7b[_0xdb4e('0x8')](_0xdb4e('0x9'),attributes,{'tableName':_0xdb4e('0xa'),'paranoid':![],'indexes':[{'name':_0xdb4e('0xb'),'fields':[_0xdb4e('0xc'),'project_name']},{'name':_0xdb4e('0xd'),'fields':[_0xdb4e('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 9dab968..a811a9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b04=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','SquareReport,\x20%s,\x20%s','message','result','catch','CreateSquareReport','SquareReport','create','options','UpdateSquareReport','update','body','where','attributes','limit','util'];(function(_0x2891d0,_0x502fe5){var _0x4bba9f=function(_0x5ea772){while(--_0x5ea772){_0x2891d0['push'](_0x2891d0['shift']());}};_0x4bba9f(++_0x502fe5);}(_0x4b04,0xd8));var _0x44b0=function(_0x7f43b9,_0x52048a){_0x7f43b9=_0x7f43b9-0x0;var _0x24781e=_0x4b04[_0x7f43b9];return _0x24781e;};'use strict';var _=require('lodash');var util=require(_0x44b0('0x0'));var moment=require(_0x44b0('0x1'));var BPromise=require(_0x44b0('0x2'));var rs=require(_0x44b0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x44b0('0x4'))['db'];var utils=require(_0x44b0('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x44b0('0x6'));var jayson=require(_0x44b0('0x7'));var client=jayson[_0x44b0('0x8')][_0x44b0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x174ae2,_0x5335db,_0x1ce2eb){return new BPromise(function(_0x15dcf3,_0x4e6246){return client[_0x44b0('0xa')](_0x174ae2,_0x1ce2eb)[_0x44b0('0xb')](function(_0x336846){logger[_0x44b0('0xc')]('SquareReport,\x20%s,\x20%s',_0x5335db,_0x44b0('0xd'));logger[_0x44b0('0xe')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x5335db,_0x44b0('0xd'),JSON[_0x44b0('0xf')](_0x336846));if(_0x336846[_0x44b0('0x10')]){if(_0x336846[_0x44b0('0x10')]['code']===0x1f4){logger[_0x44b0('0x10')](_0x44b0('0x11'),_0x5335db,_0x336846[_0x44b0('0x10')][_0x44b0('0x12')]);return _0x4e6246(_0x336846[_0x44b0('0x10')][_0x44b0('0x12')]);}logger[_0x44b0('0x10')](_0x44b0('0x11'),_0x5335db,_0x336846[_0x44b0('0x10')][_0x44b0('0x12')]);return _0x15dcf3(_0x336846['error'][_0x44b0('0x12')]);}else{logger[_0x44b0('0xc')](_0x44b0('0x11'),_0x5335db,'request\x20sent');_0x15dcf3(_0x336846[_0x44b0('0x13')][_0x44b0('0x12')]);}})[_0x44b0('0x14')](function(_0x13dd0c){logger[_0x44b0('0x10')](_0x44b0('0x11'),_0x5335db,_0x13dd0c);_0x4e6246(_0x13dd0c);});});}exports[_0x44b0('0x15')]=function(_0x3b2e89){var _0x4b08ad=this;return new Promise(function(_0x76b909,_0x3538a4){return db[_0x44b0('0x16')][_0x44b0('0x17')](_0x3b2e89['body'],{'raw':_0x3b2e89[_0x44b0('0x18')]?_0x3b2e89[_0x44b0('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x44b0('0xb')](function(_0x14997d){logger[_0x44b0('0xc')](_0x44b0('0x15'),_0x3b2e89);logger['debug'](_0x44b0('0x15'),_0x3b2e89,JSON[_0x44b0('0xf')](_0x14997d));_0x76b909(_0x14997d);})[_0x44b0('0x14')](function(_0x23a306){logger['error']('CreateSquareReport',_0x23a306['message'],_0x3b2e89);_0x3538a4(_0x4b08ad[_0x44b0('0x10')](0x1f4,_0x23a306[_0x44b0('0x12')]));});});};exports[_0x44b0('0x19')]=function(_0x5031b3){var _0x1d25d0=this;return new Promise(function(_0x5e09b3,_0x51e9ff){return db[_0x44b0('0x16')][_0x44b0('0x1a')](_0x5031b3[_0x44b0('0x1b')],{'raw':_0x5031b3[_0x44b0('0x18')]?_0x5031b3[_0x44b0('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5031b3['options']?_0x5031b3['options'][_0x44b0('0x1c')]||null:null,'attributes':_0x5031b3['options']?_0x5031b3[_0x44b0('0x18')][_0x44b0('0x1d')]||null:null,'limit':_0x5031b3['options']?_0x5031b3[_0x44b0('0x18')][_0x44b0('0x1e')]||null:null})[_0x44b0('0xb')](function(_0x9d207b){logger[_0x44b0('0xc')](_0x44b0('0x19'),_0x5031b3);logger['debug']('UpdateSquareReport',_0x5031b3,JSON[_0x44b0('0xf')](_0x9d207b));_0x5e09b3(_0x9d207b);})['catch'](function(_0x5a5cf7){logger['error']('UpdateSquareReport',_0x5a5cf7[_0x44b0('0x12')],_0x5031b3);_0x51e9ff(_0x1d25d0[_0x44b0('0x10')](0x1f4,_0x5a5cf7[_0x44b0('0x12')]));});});};
\ No newline at end of file
+var _0xa173=['create','body','options','UpdateSquareReport','update','raw','where','attributes','limit','debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareReport,\x20%s,\x20%s','message','info','result','catch','CreateSquareReport','SquareReport'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xa173,0xf1));var _0x3a17=function(_0x39ab59,_0x3a3dc8){_0x39ab59=_0x39ab59-0x0;var _0x4018a6=_0xa173[_0x39ab59];return _0x4018a6;};'use strict';var _=require(_0x3a17('0x0'));var util=require('util');var moment=require(_0x3a17('0x1'));var BPromise=require(_0x3a17('0x2'));var rs=require(_0x3a17('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3a17('0x4'))['db'];var utils=require(_0x3a17('0x5'));var logger=require(_0x3a17('0x6'))('rpc');var config=require(_0x3a17('0x7'));var jayson=require(_0x3a17('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4deb62,_0x4aa940,_0x103bd8){return new BPromise(function(_0x281990,_0xcfc7e3){return client[_0x3a17('0x9')](_0x4deb62,_0x103bd8)[_0x3a17('0xa')](function(_0x307418){logger['info']('SquareReport,\x20%s,\x20%s',_0x4aa940,_0x3a17('0xb'));logger['debug'](_0x3a17('0xc'),_0x4aa940,'request\x20sent',JSON[_0x3a17('0xd')](_0x307418));if(_0x307418[_0x3a17('0xe')]){if(_0x307418[_0x3a17('0xe')][_0x3a17('0xf')]===0x1f4){logger[_0x3a17('0xe')](_0x3a17('0x10'),_0x4aa940,_0x307418[_0x3a17('0xe')][_0x3a17('0x11')]);return _0xcfc7e3(_0x307418[_0x3a17('0xe')]['message']);}logger['error']('SquareReport,\x20%s,\x20%s',_0x4aa940,_0x307418[_0x3a17('0xe')]['message']);return _0x281990(_0x307418[_0x3a17('0xe')]['message']);}else{logger[_0x3a17('0x12')](_0x3a17('0x10'),_0x4aa940,'request\x20sent');_0x281990(_0x307418[_0x3a17('0x13')][_0x3a17('0x11')]);}})[_0x3a17('0x14')](function(_0x49a905){logger[_0x3a17('0xe')](_0x3a17('0x10'),_0x4aa940,_0x49a905);_0xcfc7e3(_0x49a905);});});}exports[_0x3a17('0x15')]=function(_0x2b4db7){var _0x90a758=this;return new Promise(function(_0x2191d4,_0x1076b8){return db[_0x3a17('0x16')][_0x3a17('0x17')](_0x2b4db7[_0x3a17('0x18')],{'raw':_0x2b4db7['options']?_0x2b4db7[_0x3a17('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x350e51){logger['info']('CreateSquareReport',_0x2b4db7);logger['debug'](_0x3a17('0x15'),_0x2b4db7,JSON[_0x3a17('0xd')](_0x350e51));_0x2191d4(_0x350e51);})['catch'](function(_0x64b8e2){logger[_0x3a17('0xe')](_0x3a17('0x15'),_0x64b8e2['message'],_0x2b4db7);_0x1076b8(_0x90a758[_0x3a17('0xe')](0x1f4,_0x64b8e2['message']));});});};exports[_0x3a17('0x1a')]=function(_0x42ac4b){var _0x1993e6=this;return new Promise(function(_0x1021b5,_0x6af290){return db[_0x3a17('0x16')][_0x3a17('0x1b')](_0x42ac4b['body'],{'raw':_0x42ac4b['options']?_0x42ac4b['options'][_0x3a17('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42ac4b['options']?_0x42ac4b[_0x3a17('0x19')][_0x3a17('0x1d')]||null:null,'attributes':_0x42ac4b[_0x3a17('0x19')]?_0x42ac4b[_0x3a17('0x19')][_0x3a17('0x1e')]||null:null,'limit':_0x42ac4b[_0x3a17('0x19')]?_0x42ac4b['options'][_0x3a17('0x1f')]||null:null})[_0x3a17('0xa')](function(_0x599309){logger[_0x3a17('0x12')](_0x3a17('0x1a'),_0x42ac4b);logger[_0x3a17('0x20')](_0x3a17('0x1a'),_0x42ac4b,JSON[_0x3a17('0xd')](_0x599309));_0x1021b5(_0x599309);})['catch'](function(_0x2a88b8){logger['error'](_0x3a17('0x1a'),_0x2a88b8[_0x3a17('0x11')],_0x42ac4b);_0x6af290(_0x1993e6['error'](0x1f4,_0x2a88b8['message']));});});};
\ No newline at end of file
index 4f18b9b..3779d6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b53=['util','path','express','fs-extra','../../components/auth/service','../../config/environment','./squareReportDetail.controller','isAuthenticated','index','get','describe','/:id','show','create','put','update','delete','destroy','exports','multer'];(function(_0x330414,_0x4f3207){var _0x99dbff=function(_0x166f85){while(--_0x166f85){_0x330414['push'](_0x330414['shift']());}};_0x99dbff(++_0x4f3207);}(_0x5b53,0x77));var _0x35b5=function(_0x31f8a0,_0x1e3391){_0x31f8a0=_0x31f8a0-0x0;var _0x319328=_0x5b53[_0x31f8a0];return _0x319328;};'use strict';var multer=require(_0x35b5('0x0'));var util=require(_0x35b5('0x1'));var path=require(_0x35b5('0x2'));var timeout=require('connect-timeout');var express=require(_0x35b5('0x3'));var router=express['Router']();var fs_extra=require(_0x35b5('0x4'));var auth=require(_0x35b5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x35b5('0x6'));var controller=require(_0x35b5('0x7'));router['get']('/',auth[_0x35b5('0x8')](),controller[_0x35b5('0x9')]);router[_0x35b5('0xa')]('/describe',auth[_0x35b5('0x8')](),controller[_0x35b5('0xb')]);router['get'](_0x35b5('0xc'),auth[_0x35b5('0x8')](),controller[_0x35b5('0xd')]);router['post']('/',auth[_0x35b5('0x8')](),controller[_0x35b5('0xe')]);router[_0x35b5('0xf')](_0x35b5('0xc'),auth[_0x35b5('0x8')](),controller[_0x35b5('0x10')]);router[_0x35b5('0x11')](_0x35b5('0xc'),auth[_0x35b5('0x8')](),controller[_0x35b5('0x12')]);module[_0x35b5('0x13')]=router;
\ No newline at end of file
+var _0x173b=['update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x173b,0x163));var _0xb173=function(_0x3b36b4,_0x176034){_0x3b36b4=_0x3b36b4-0x0;var _0x180bca=_0x173b[_0x3b36b4];return _0x180bca;};'use strict';var multer=require(_0xb173('0x0'));var util=require(_0xb173('0x1'));var path=require('path');var timeout=require(_0xb173('0x2'));var express=require(_0xb173('0x3'));var router=express[_0xb173('0x4')]();var fs_extra=require(_0xb173('0x5'));var auth=require(_0xb173('0x6'));var interaction=require(_0xb173('0x7'));var config=require(_0xb173('0x8'));var controller=require(_0xb173('0x9'));router[_0xb173('0xa')]('/',auth[_0xb173('0xb')](),controller[_0xb173('0xc')]);router[_0xb173('0xa')](_0xb173('0xd'),auth['isAuthenticated'](),controller[_0xb173('0xe')]);router[_0xb173('0xa')](_0xb173('0xf'),auth[_0xb173('0xb')](),controller[_0xb173('0x10')]);router[_0xb173('0x11')]('/',auth[_0xb173('0xb')](),controller['create']);router[_0xb173('0x12')](_0xb173('0xf'),auth[_0xb173('0xb')](),controller[_0xb173('0x13')]);router[_0xb173('0x14')](_0xb173('0xf'),auth[_0xb173('0xb')](),controller[_0xb173('0x15')]);module['exports']=router;
\ No newline at end of file
index e0d5c6f..1bb21e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1de0=['STRING','sequelize','exports'];(function(_0x4fa08c,_0x30cac4){var _0x7a920a=function(_0x213fd1){while(--_0x213fd1){_0x4fa08c['push'](_0x4fa08c['shift']());}};_0x7a920a(++_0x30cac4);}(_0x1de0,0x18d));var _0x01de=function(_0xd206ce,_0x3031d2){_0xd206ce=_0xd206ce-0x0;var _0x5b3ec6=_0x1de0[_0xd206ce];return _0x5b3ec6;};'use strict';var Sequelize=require(_0x01de('0x0'));module[_0x01de('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x01de('0x2')]},'callerid':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xba25=['STRING','TEXT','sequelize','exports'];(function(_0x1d2c7b,_0x5d0c14){var _0x4071f4=function(_0x44edbe){while(--_0x44edbe){_0x1d2c7b['push'](_0x1d2c7b['shift']());}};_0x4071f4(++_0x5d0c14);}(_0xba25,0xae));var _0x5ba2=function(_0x5a617d,_0x3512cb){_0x5a617d=_0x5a617d-0x0;var _0x302991=_0xba25[_0x5a617d];return _0x302991;};'use strict';var Sequelize=require(_0x5ba2('0x0'));module[_0x5ba2('0x1')]={'uniqueid':{'type':Sequelize[_0x5ba2('0x2')]},'node':{'type':Sequelize[_0x5ba2('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x5ba2('0x3')]},'project_name':{'type':Sequelize[_0x5ba2('0x2')]},'callerid':{'type':Sequelize[_0x5ba2('0x2')]}};
\ No newline at end of file
index 825d5f3..99cf08a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf54=['merge','VIRTUAL','include','findAll','rows','show','params','includeAll','find','catch','create','body','destroy','describe','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','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','limit','count','offset','set','json','reject','save','update','then','error','stack','name','send','index','map','SquareDetailsReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter'];(function(_0x13f4e1,_0x3d74ff){var _0x1b69cf=function(_0x194531){while(--_0x194531){_0x13f4e1['push'](_0x13f4e1['shift']());}};_0x1b69cf(++_0x3d74ff);}(_0xaf54,0x13e));var _0x4af5=function(_0x2c3a88,_0x48637e){_0x2c3a88=_0x2c3a88-0x0;var _0x4a7925=_0xaf54[_0x2c3a88];return _0x4a7925;};'use strict';var emlformat=require(_0x4af5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4af5('0x1'));var jsonpatch=require(_0x4af5('0x2'));var rp=require(_0x4af5('0x3'));var moment=require('moment');var BPromise=require(_0x4af5('0x4'));var Mustache=require(_0x4af5('0x5'));var util=require(_0x4af5('0x6'));var path=require(_0x4af5('0x7'));var sox=require(_0x4af5('0x8'));var csv=require(_0x4af5('0x9'));var ejs=require(_0x4af5('0xa'));var fs=require('fs');var fs_extra=require(_0x4af5('0xb'));var _=require(_0x4af5('0xc'));var squel=require(_0x4af5('0xd'));var crypto=require(_0x4af5('0xe'));var jsforce=require(_0x4af5('0xf'));var deskjs=require(_0x4af5('0x10'));var toCsv=require(_0x4af5('0x9'));var querystring=require(_0x4af5('0x11'));var Papa=require(_0x4af5('0x12'));var Redis=require(_0x4af5('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4af5('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4af5('0x15'))(_0x4af5('0x16'));var utils=require(_0x4af5('0x17'));var config=require(_0x4af5('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x4af5('0x19'))['db'];function respondWithStatusCode(_0x416790,_0x13350a){_0x13350a=_0x13350a||0xcc;return function(_0x30dee3){if(_0x30dee3){return _0x416790[_0x4af5('0x1a')](_0x13350a);}return _0x416790[_0x4af5('0x1b')](_0x13350a)[_0x4af5('0x1c')]();};}function respondWithResult(_0x4f15a2,_0x2b217e){_0x2b217e=_0x2b217e||0xc8;return function(_0x520540){if(_0x520540){return _0x4f15a2[_0x4af5('0x1b')](_0x2b217e)['json'](_0x520540);}};}function respondWithFilteredResult(_0x953acd,_0x5709ea){return function(_0xb1915e){if(_0xb1915e){var _0x5552ea=typeof _0x5709ea['offset']==='undefined'&&typeof _0x5709ea[_0x4af5('0x1d')]==='undefined';var _0xdadc0d=_0xb1915e[_0x4af5('0x1e')];var _0x445acd=_0x5552ea?0x0:_0x5709ea[_0x4af5('0x1f')];var _0x16853c=_0x5552ea?_0xb1915e['count']:_0x5709ea[_0x4af5('0x1f')]+_0x5709ea[_0x4af5('0x1d')];var _0x212dd7;if(_0x16853c>=_0xdadc0d){_0x16853c=_0xdadc0d;_0x212dd7=0xc8;}else{_0x212dd7=0xce;}_0x953acd[_0x4af5('0x1b')](_0x212dd7);return _0x953acd[_0x4af5('0x20')]('Content-Range',_0x445acd+'-'+_0x16853c+'/'+_0xdadc0d)[_0x4af5('0x21')](_0xb1915e);}return null;};}function patchUpdates(_0x177641){return function(_0x3aa6a5){try{jsonpatch['apply'](_0x3aa6a5,_0x177641,!![]);}catch(_0x1bdab7){return BPromise[_0x4af5('0x22')](_0x1bdab7);}return _0x3aa6a5[_0x4af5('0x23')]();};}function saveUpdates(_0x9f7c7e,_0x9c1910){return function(_0x2691a3){if(_0x2691a3){return _0x2691a3[_0x4af5('0x24')](_0x9f7c7e)[_0x4af5('0x25')](function(_0x383126){return _0x383126;});}return null;};}function removeEntity(_0x3bc819,_0x2079c0){return function(_0x483e3f){if(_0x483e3f){return _0x483e3f['destroy']()[_0x4af5('0x25')](function(){_0x3bc819[_0x4af5('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x564ce6,_0x3d3ab6){return function(_0x5734c0){if(!_0x5734c0){_0x564ce6[_0x4af5('0x1a')](0x194);}return _0x5734c0;};}function handleError(_0xde3940,_0x17e146){_0x17e146=_0x17e146||0x1f4;return function(_0x17bafe){logger[_0x4af5('0x26')](_0x17bafe[_0x4af5('0x27')]);if(_0x17bafe[_0x4af5('0x28')]){delete _0x17bafe[_0x4af5('0x28')];}_0xde3940['status'](_0x17e146)[_0x4af5('0x29')](_0x17bafe);};}exports[_0x4af5('0x2a')]=function(_0x5c1cc7,_0x2bb22e){var _0x4669b2={},_0x2e359c={},_0xca560e={'count':0x0,'rows':[]};var _0x3c9ce3=_[_0x4af5('0x2b')](db[_0x4af5('0x2c')][_0x4af5('0x2d')],function(_0x2ea720){return{'name':_0x2ea720['fieldName'],'type':_0x2ea720[_0x4af5('0x2e')][_0x4af5('0x2f')]};});_0x2e359c[_0x4af5('0x30')]=_[_0x4af5('0x2b')](_0x3c9ce3,'name');_0x2e359c[_0x4af5('0x31')]=_[_0x4af5('0x32')](_0x5c1cc7['query']);_0x2e359c[_0x4af5('0x33')]=_[_0x4af5('0x34')](_0x2e359c['model'],_0x2e359c[_0x4af5('0x31')]);_0x4669b2[_0x4af5('0x35')]=_[_0x4af5('0x34')](_0x2e359c[_0x4af5('0x30')],qs['fields'](_0x5c1cc7[_0x4af5('0x31')][_0x4af5('0x36')]));_0x4669b2[_0x4af5('0x35')]=_0x4669b2[_0x4af5('0x35')][_0x4af5('0x37')]?_0x4669b2['attributes']:_0x2e359c[_0x4af5('0x30')];if(!_0x5c1cc7[_0x4af5('0x31')][_0x4af5('0x38')](_0x4af5('0x39'))){_0x4669b2[_0x4af5('0x1d')]=qs[_0x4af5('0x1d')](_0x5c1cc7[_0x4af5('0x31')]['limit']);_0x4669b2[_0x4af5('0x1f')]=qs[_0x4af5('0x1f')](_0x5c1cc7[_0x4af5('0x31')][_0x4af5('0x1f')]);}_0x4669b2['order']=qs[_0x4af5('0x3a')](_0x5c1cc7[_0x4af5('0x31')]['sort']);_0x4669b2[_0x4af5('0x3b')]=qs[_0x4af5('0x33')](_[_0x4af5('0x3c')](_0x5c1cc7[_0x4af5('0x31')],_0x2e359c[_0x4af5('0x33')]),_0x3c9ce3);if(_0x5c1cc7['query'][_0x4af5('0x3d')]){_0x4669b2[_0x4af5('0x3b')]=_[_0x4af5('0x3e')](_0x4669b2['where'],{'$or':_[_0x4af5('0x2b')](_0x3c9ce3,function(_0x3ce45b){if(_0x3ce45b['type']!==_0x4af5('0x3f')){var _0x313e3a={};_0x313e3a[_0x3ce45b[_0x4af5('0x28')]]={'$like':'%'+_0x5c1cc7[_0x4af5('0x31')][_0x4af5('0x3d')]+'%'};return _0x313e3a;}})});}_0x4669b2=_[_0x4af5('0x3e')]({},_0x4669b2,_0x5c1cc7['options']);var _0x5855f0={'where':_0x4669b2[_0x4af5('0x3b')]};return db[_0x4af5('0x2c')]['count'](_0x5855f0)[_0x4af5('0x25')](function(_0x5da55d){_0xca560e[_0x4af5('0x1e')]=_0x5da55d;if(_0x5c1cc7[_0x4af5('0x31')]['includeAll']){_0x4669b2[_0x4af5('0x40')]=[{'all':!![]}];}return db[_0x4af5('0x2c')][_0x4af5('0x41')](_0x4669b2);})['then'](function(_0x5bce19){_0xca560e[_0x4af5('0x42')]=_0x5bce19;return _0xca560e;})[_0x4af5('0x25')](respondWithFilteredResult(_0x2bb22e,_0x4669b2))['catch'](handleError(_0x2bb22e,null));};exports[_0x4af5('0x43')]=function(_0x35cb61,_0x3d98e9){var _0x3476a3={'raw':!![],'where':{'id':_0x35cb61[_0x4af5('0x44')]['id']}},_0x5be698={};_0x5be698[_0x4af5('0x30')]=_[_0x4af5('0x32')](db[_0x4af5('0x2c')][_0x4af5('0x2d')]);_0x5be698[_0x4af5('0x31')]=_['keys'](_0x35cb61['query']);_0x5be698[_0x4af5('0x33')]=_['intersection'](_0x5be698[_0x4af5('0x30')],_0x5be698[_0x4af5('0x31')]);_0x3476a3[_0x4af5('0x35')]=_[_0x4af5('0x34')](_0x5be698['model'],qs[_0x4af5('0x36')](_0x35cb61['query'][_0x4af5('0x36')]));_0x3476a3[_0x4af5('0x35')]=_0x3476a3['attributes'][_0x4af5('0x37')]?_0x3476a3[_0x4af5('0x35')]:_0x5be698[_0x4af5('0x30')];if(_0x35cb61[_0x4af5('0x31')][_0x4af5('0x45')]){_0x3476a3[_0x4af5('0x40')]=[{'all':!![]}];}_0x3476a3=_[_0x4af5('0x3e')]({},_0x3476a3,_0x35cb61['options']);return db['SquareDetailsReport'][_0x4af5('0x46')](_0x3476a3)['then'](handleEntityNotFound(_0x3d98e9,null))[_0x4af5('0x25')](respondWithResult(_0x3d98e9,null))[_0x4af5('0x47')](handleError(_0x3d98e9,null));};exports['create']=function(_0x3cf906,_0x12e05e){return db[_0x4af5('0x2c')][_0x4af5('0x48')](_0x3cf906['body'],{})[_0x4af5('0x25')](respondWithResult(_0x12e05e,0xc9))[_0x4af5('0x47')](handleError(_0x12e05e,null));};exports['update']=function(_0x5bcbf4,_0x32fecc){if(_0x5bcbf4[_0x4af5('0x49')]['id']){delete _0x5bcbf4['body']['id'];}return db['SquareDetailsReport'][_0x4af5('0x46')]({'where':{'id':_0x5bcbf4[_0x4af5('0x44')]['id']}})[_0x4af5('0x25')](handleEntityNotFound(_0x32fecc,null))[_0x4af5('0x25')](saveUpdates(_0x5bcbf4['body'],null))[_0x4af5('0x25')](respondWithResult(_0x32fecc,null))[_0x4af5('0x47')](handleError(_0x32fecc,null));};exports[_0x4af5('0x4a')]=function(_0x451e85,_0x31530a){return db[_0x4af5('0x2c')][_0x4af5('0x46')]({'where':{'id':_0x451e85[_0x4af5('0x44')]['id']}})[_0x4af5('0x25')](handleEntityNotFound(_0x31530a,null))[_0x4af5('0x25')](removeEntity(_0x31530a,null))[_0x4af5('0x47')](handleError(_0x31530a,null));};exports[_0x4af5('0x4b')]=function(_0x1905ce,_0x4b5229){return db[_0x4af5('0x2c')][_0x4af5('0x4b')]()[_0x4af5('0x25')](respondWithResult(_0x4b5229,null))[_0x4af5('0x47')](handleError(_0x4b5229,null));};
\ No newline at end of file
+var _0x95c7=['set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','SquareDetailsReport','includeAll','include','findAll','rows','catch','show','params','length','merge','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x5ab6a5,_0x4977b1){var _0x3cb85c=function(_0x585e95){while(--_0x585e95){_0x5ab6a5['push'](_0x5ab6a5['shift']());}};_0x3cb85c(++_0x4977b1);}(_0x95c7,0x1a7));var _0x795c=function(_0x2ed36d,_0x36fd89){_0x2ed36d=_0x2ed36d-0x0;var _0x1ebb56=_0x95c7[_0x2ed36d];return _0x1ebb56;};'use strict';var emlformat=require(_0x795c('0x0'));var rimraf=require(_0x795c('0x1'));var zipdir=require(_0x795c('0x2'));var jsonpatch=require(_0x795c('0x3'));var rp=require(_0x795c('0x4'));var moment=require(_0x795c('0x5'));var BPromise=require(_0x795c('0x6'));var Mustache=require(_0x795c('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x795c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x795c('0x9'));var _=require(_0x795c('0xa'));var squel=require('squel');var crypto=require(_0x795c('0xb'));var jsforce=require(_0x795c('0xc'));var deskjs=require(_0x795c('0xd'));var toCsv=require(_0x795c('0x8'));var querystring=require(_0x795c('0xe'));var Papa=require(_0x795c('0xf'));var Redis=require(_0x795c('0x10'));var authService=require(_0x795c('0x11'));var qs=require(_0x795c('0x12'));var as=require(_0x795c('0x13'));var hardwareService=require(_0x795c('0x14'));var logger=require(_0x795c('0x15'))('api');var utils=require(_0x795c('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x795c('0x17'));var db=require(_0x795c('0x18'))['db'];function respondWithStatusCode(_0xf784a8,_0x23ad86){_0x23ad86=_0x23ad86||0xcc;return function(_0x1db4fe){if(_0x1db4fe){return _0xf784a8[_0x795c('0x19')](_0x23ad86);}return _0xf784a8[_0x795c('0x1a')](_0x23ad86)[_0x795c('0x1b')]();};}function respondWithResult(_0x59a582,_0x1867d0){_0x1867d0=_0x1867d0||0xc8;return function(_0x7e3962){if(_0x7e3962){return _0x59a582[_0x795c('0x1a')](_0x1867d0)[_0x795c('0x1c')](_0x7e3962);}};}function respondWithFilteredResult(_0x408883,_0x4803b0){return function(_0x5b88bb){if(_0x5b88bb){var _0x48ce09=typeof _0x4803b0[_0x795c('0x1d')]===_0x795c('0x1e')&&typeof _0x4803b0[_0x795c('0x1f')]===_0x795c('0x1e');var _0x3c8aad=_0x5b88bb[_0x795c('0x20')];var _0x4f4394=_0x48ce09?0x0:_0x4803b0[_0x795c('0x1d')];var _0x5f0f5f=_0x48ce09?_0x5b88bb['count']:_0x4803b0[_0x795c('0x1d')]+_0x4803b0[_0x795c('0x1f')];var _0x5defa3;if(_0x5f0f5f>=_0x3c8aad){_0x5f0f5f=_0x3c8aad;_0x5defa3=0xc8;}else{_0x5defa3=0xce;}_0x408883['status'](_0x5defa3);return _0x408883[_0x795c('0x21')](_0x795c('0x22'),_0x4f4394+'-'+_0x5f0f5f+'/'+_0x3c8aad)[_0x795c('0x1c')](_0x5b88bb);}return null;};}function patchUpdates(_0x57022d){return function(_0x506ef7){try{jsonpatch['apply'](_0x506ef7,_0x57022d,!![]);}catch(_0x27902e){return BPromise[_0x795c('0x23')](_0x27902e);}return _0x506ef7[_0x795c('0x24')]();};}function saveUpdates(_0x345b47,_0x40cbd1){return function(_0x33a167){if(_0x33a167){return _0x33a167[_0x795c('0x25')](_0x345b47)[_0x795c('0x26')](function(_0x4449a3){return _0x4449a3;});}return null;};}function removeEntity(_0x1bef6f,_0x4b88b1){return function(_0x526ca4){if(_0x526ca4){return _0x526ca4[_0x795c('0x27')]()[_0x795c('0x26')](function(){_0x1bef6f['status'](0xcc)[_0x795c('0x1b')]();});}};}function handleEntityNotFound(_0x20f36f,_0x2116ab){return function(_0x366bcd){if(!_0x366bcd){_0x20f36f[_0x795c('0x19')](0x194);}return _0x366bcd;};}function handleError(_0x3f1372,_0x27a755){_0x27a755=_0x27a755||0x1f4;return function(_0x2aa7fc){logger[_0x795c('0x28')](_0x2aa7fc[_0x795c('0x29')]);if(_0x2aa7fc[_0x795c('0x2a')]){delete _0x2aa7fc[_0x795c('0x2a')];}_0x3f1372[_0x795c('0x1a')](_0x27a755)['send'](_0x2aa7fc);};}exports[_0x795c('0x2b')]=function(_0x3e8bc3,_0xb7f5c9){var _0x169c92={},_0x15c143={},_0x21acc6={'count':0x0,'rows':[]};var _0x17eb64=_['map'](db['SquareDetailsReport'][_0x795c('0x2c')],function(_0x521db1){return{'name':_0x521db1[_0x795c('0x2d')],'type':_0x521db1[_0x795c('0x2e')]['key']};});_0x15c143[_0x795c('0x2f')]=_['map'](_0x17eb64,_0x795c('0x2a'));_0x15c143[_0x795c('0x30')]=_[_0x795c('0x31')](_0x3e8bc3[_0x795c('0x30')]);_0x15c143[_0x795c('0x32')]=_[_0x795c('0x33')](_0x15c143['model'],_0x15c143[_0x795c('0x30')]);_0x169c92[_0x795c('0x34')]=_[_0x795c('0x33')](_0x15c143[_0x795c('0x2f')],qs['fields'](_0x3e8bc3[_0x795c('0x30')][_0x795c('0x35')]));_0x169c92['attributes']=_0x169c92['attributes']['length']?_0x169c92['attributes']:_0x15c143['model'];if(!_0x3e8bc3[_0x795c('0x30')][_0x795c('0x36')](_0x795c('0x37'))){_0x169c92[_0x795c('0x1f')]=qs[_0x795c('0x1f')](_0x3e8bc3[_0x795c('0x30')][_0x795c('0x1f')]);_0x169c92[_0x795c('0x1d')]=qs['offset'](_0x3e8bc3['query'][_0x795c('0x1d')]);}_0x169c92['order']=qs[_0x795c('0x38')](_0x3e8bc3['query'][_0x795c('0x38')]);_0x169c92[_0x795c('0x39')]=qs[_0x795c('0x32')](_[_0x795c('0x3a')](_0x3e8bc3[_0x795c('0x30')],_0x15c143['filters']),_0x17eb64);if(_0x3e8bc3[_0x795c('0x30')][_0x795c('0x3b')]){_0x169c92[_0x795c('0x39')]=_['merge'](_0x169c92['where'],{'$or':_['map'](_0x17eb64,function(_0x1f5f5e){if(_0x1f5f5e['type']!==_0x795c('0x3c')){var _0xb98852={};_0xb98852[_0x1f5f5e[_0x795c('0x2a')]]={'$like':'%'+_0x3e8bc3[_0x795c('0x30')][_0x795c('0x3b')]+'%'};return _0xb98852;}})});}_0x169c92=_['merge']({},_0x169c92,_0x3e8bc3['options']);var _0x4c2874={'where':_0x169c92['where']};return db[_0x795c('0x3d')][_0x795c('0x20')](_0x4c2874)[_0x795c('0x26')](function(_0x3eb15a){_0x21acc6[_0x795c('0x20')]=_0x3eb15a;if(_0x3e8bc3['query'][_0x795c('0x3e')]){_0x169c92[_0x795c('0x3f')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0x795c('0x40')](_0x169c92);})['then'](function(_0x27ebd9){_0x21acc6[_0x795c('0x41')]=_0x27ebd9;return _0x21acc6;})[_0x795c('0x26')](respondWithFilteredResult(_0xb7f5c9,_0x169c92))[_0x795c('0x42')](handleError(_0xb7f5c9,null));};exports[_0x795c('0x43')]=function(_0x10955d,_0x54a522){var _0x4a909f={'raw':!![],'where':{'id':_0x10955d[_0x795c('0x44')]['id']}},_0x3db2dd={};_0x3db2dd[_0x795c('0x2f')]=_[_0x795c('0x31')](db[_0x795c('0x3d')][_0x795c('0x2c')]);_0x3db2dd['query']=_['keys'](_0x10955d[_0x795c('0x30')]);_0x3db2dd['filters']=_[_0x795c('0x33')](_0x3db2dd[_0x795c('0x2f')],_0x3db2dd['query']);_0x4a909f[_0x795c('0x34')]=_[_0x795c('0x33')](_0x3db2dd[_0x795c('0x2f')],qs[_0x795c('0x35')](_0x10955d[_0x795c('0x30')][_0x795c('0x35')]));_0x4a909f[_0x795c('0x34')]=_0x4a909f['attributes'][_0x795c('0x45')]?_0x4a909f[_0x795c('0x34')]:_0x3db2dd[_0x795c('0x2f')];if(_0x10955d[_0x795c('0x30')][_0x795c('0x3e')]){_0x4a909f['include']=[{'all':!![]}];}_0x4a909f=_[_0x795c('0x46')]({},_0x4a909f,_0x10955d[_0x795c('0x47')]);return db[_0x795c('0x3d')][_0x795c('0x48')](_0x4a909f)['then'](handleEntityNotFound(_0x54a522,null))[_0x795c('0x26')](respondWithResult(_0x54a522,null))[_0x795c('0x42')](handleError(_0x54a522,null));};exports[_0x795c('0x49')]=function(_0xe8d18e,_0x418960){return db[_0x795c('0x3d')][_0x795c('0x49')](_0xe8d18e[_0x795c('0x4a')],{})[_0x795c('0x26')](respondWithResult(_0x418960,0xc9))[_0x795c('0x42')](handleError(_0x418960,null));};exports[_0x795c('0x25')]=function(_0x56a3f1,_0x43ce4f){if(_0x56a3f1[_0x795c('0x4a')]['id']){delete _0x56a3f1['body']['id'];}return db['SquareDetailsReport'][_0x795c('0x48')]({'where':{'id':_0x56a3f1[_0x795c('0x44')]['id']}})[_0x795c('0x26')](handleEntityNotFound(_0x43ce4f,null))[_0x795c('0x26')](saveUpdates(_0x56a3f1[_0x795c('0x4a')],null))[_0x795c('0x26')](respondWithResult(_0x43ce4f,null))['catch'](handleError(_0x43ce4f,null));};exports[_0x795c('0x27')]=function(_0x2dbd30,_0x49772e){return db[_0x795c('0x3d')][_0x795c('0x48')]({'where':{'id':_0x2dbd30[_0x795c('0x44')]['id']}})[_0x795c('0x26')](handleEntityNotFound(_0x49772e,null))[_0x795c('0x26')](removeEntity(_0x49772e,null))[_0x795c('0x42')](handleError(_0x49772e,null));};exports[_0x795c('0x4b')]=function(_0x14c8a9,_0x1c2ae3){return db[_0x795c('0x3d')][_0x795c('0x4b')]()['then'](respondWithResult(_0x1c2ae3,null))[_0x795c('0x42')](handleError(_0x1c2ae3,null));};
\ No newline at end of file
index c702687..56a9b10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c86=['path','rimraf','./squareReportDetail.attributes','exports','define','SquareDetailsReport','util','api','moment','request-promise'];(function(_0x58c4e6,_0x90e1aa){var _0x5641df=function(_0x2c2837){while(--_0x2c2837){_0x58c4e6['push'](_0x58c4e6['shift']());}};_0x5641df(++_0x90e1aa);}(_0x8c86,0xf6));var _0x68c8=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x8c86[_0x160c73];return _0xd9302;};'use strict';var _=require('lodash');var util=require(_0x68c8('0x0'));var logger=require('../../config/logger')(_0x68c8('0x1'));var moment=require(_0x68c8('0x2'));var BPromise=require('bluebird');var rp=require(_0x68c8('0x3'));var fs=require('fs');var path=require(_0x68c8('0x4'));var rimraf=require(_0x68c8('0x5'));var config=require('../../config/environment');var attributes=require(_0x68c8('0x6'));module[_0x68c8('0x7')]=function(_0x45f8b5,_0x47949d){return _0x45f8b5[_0x68c8('0x8')](_0x68c8('0x9'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7f93=['../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x21a739,_0x27b60a){var _0x32da1f=function(_0x4641c6){while(--_0x4641c6){_0x21a739['push'](_0x21a739['shift']());}};_0x32da1f(++_0x27b60a);}(_0x7f93,0x147));var _0x37f9=function(_0x21c86c,_0x279ba7){_0x21c86c=_0x21c86c-0x0;var _0x22e378=_0x7f93[_0x21c86c];return _0x22e378;};'use strict';var _=require(_0x37f9('0x0'));var util=require(_0x37f9('0x1'));var logger=require(_0x37f9('0x2'))(_0x37f9('0x3'));var moment=require(_0x37f9('0x4'));var BPromise=require(_0x37f9('0x5'));var rp=require(_0x37f9('0x6'));var fs=require('fs');var path=require(_0x37f9('0x7'));var rimraf=require(_0x37f9('0x8'));var config=require(_0x37f9('0x9'));var attributes=require(_0x37f9('0xa'));module[_0x37f9('0xb')]=function(_0x38a0ac,_0x36f582){return _0x38a0ac[_0x37f9('0xc')](_0x37f9('0xd'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0f805b8..476877b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4024=['catch','CreateSquareDetailsReport','SquareDetailsReport','body','options','raw','debug','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client','http','request','info','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareDetailsReport,\x20%s,\x20%s','message','result'];(function(_0x3d27a,_0x31311d){var _0x314fd7=function(_0x20ac55){while(--_0x20ac55){_0x3d27a['push'](_0x3d27a['shift']());}};_0x314fd7(++_0x31311d);}(_0x4024,0x89));var _0x4402=function(_0x5e4151,_0xc1d194){_0x5e4151=_0x5e4151-0x0;var _0x25de8f=_0x4024[_0x5e4151];return _0x25de8f;};'use strict';var _=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var moment=require('moment');var BPromise=require(_0x4402('0x2'));var rs=require(_0x4402('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4402('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4402('0x5'))(_0x4402('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4402('0x7')][_0x4402('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x168acd,_0x4ed77d,_0x3045ae){return new BPromise(function(_0x5d7ca4,_0x5c0b70){return client[_0x4402('0x9')](_0x168acd,_0x3045ae)['then'](function(_0x4d2882){logger[_0x4402('0xa')]('SquareDetailsReport,\x20%s,\x20%s',_0x4ed77d,_0x4402('0xb'));logger['debug'](_0x4402('0xc'),_0x4ed77d,'request\x20sent',JSON[_0x4402('0xd')](_0x4d2882));if(_0x4d2882[_0x4402('0xe')]){if(_0x4d2882['error'][_0x4402('0xf')]===0x1f4){logger[_0x4402('0xe')](_0x4402('0x10'),_0x4ed77d,_0x4d2882['error'][_0x4402('0x11')]);return _0x5c0b70(_0x4d2882[_0x4402('0xe')][_0x4402('0x11')]);}logger[_0x4402('0xe')](_0x4402('0x10'),_0x4ed77d,_0x4d2882[_0x4402('0xe')][_0x4402('0x11')]);return _0x5d7ca4(_0x4d2882[_0x4402('0xe')][_0x4402('0x11')]);}else{logger[_0x4402('0xa')](_0x4402('0x10'),_0x4ed77d,_0x4402('0xb'));_0x5d7ca4(_0x4d2882[_0x4402('0x12')][_0x4402('0x11')]);}})[_0x4402('0x13')](function(_0x30c390){logger[_0x4402('0xe')](_0x4402('0x10'),_0x4ed77d,_0x30c390);_0x5c0b70(_0x30c390);});});}exports[_0x4402('0x14')]=function(_0x231382){var _0x5b127f=this;return new Promise(function(_0x494389,_0x663ab7){return db[_0x4402('0x15')]['create'](_0x231382[_0x4402('0x16')],{'raw':_0x231382[_0x4402('0x17')]?_0x231382['options'][_0x4402('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x55cc8c){logger[_0x4402('0xa')](_0x4402('0x14'),_0x231382);logger[_0x4402('0x19')]('CreateSquareDetailsReport',_0x231382,JSON[_0x4402('0xd')](_0x55cc8c));_0x494389(_0x55cc8c);})['catch'](function(_0x47ab54){logger[_0x4402('0xe')](_0x4402('0x14'),_0x47ab54[_0x4402('0x11')],_0x231382);_0x663ab7(_0x5b127f[_0x4402('0xe')](0x1f4,_0x47ab54[_0x4402('0x11')]));});});};
\ No newline at end of file
+var _0x17a7=['debug','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateSquareDetailsReport','SquareDetailsReport','create','body','options'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x17a7,0xc2));var _0x717a=function(_0x2ac0e9,_0xefff9){_0x2ac0e9=_0x2ac0e9-0x0;var _0x51ef41=_0x17a7[_0x2ac0e9];return _0x51ef41;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x717a('0x0'));var rs=require(_0x717a('0x1'));var fs=require('fs');var Redis=require(_0x717a('0x2'));var db=require(_0x717a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x717a('0x4'))('rpc');var config=require(_0x717a('0x5'));var jayson=require(_0x717a('0x6'));var client=jayson['client'][_0x717a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1ca7a6,_0xd7d2ce,_0x311738){return new BPromise(function(_0x536824,_0x1066d4){return client['request'](_0x1ca7a6,_0x311738)[_0x717a('0x8')](function(_0x567130){logger[_0x717a('0x9')](_0x717a('0xa'),_0xd7d2ce,_0x717a('0xb'));logger['debug']('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0xd7d2ce,_0x717a('0xb'),JSON[_0x717a('0xc')](_0x567130));if(_0x567130[_0x717a('0xd')]){if(_0x567130[_0x717a('0xd')][_0x717a('0xe')]===0x1f4){logger['error'](_0x717a('0xa'),_0xd7d2ce,_0x567130['error'][_0x717a('0xf')]);return _0x1066d4(_0x567130['error']['message']);}logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0xd7d2ce,_0x567130[_0x717a('0xd')]['message']);return _0x536824(_0x567130[_0x717a('0xd')]['message']);}else{logger[_0x717a('0x9')]('SquareDetailsReport,\x20%s,\x20%s',_0xd7d2ce,_0x717a('0xb'));_0x536824(_0x567130[_0x717a('0x10')][_0x717a('0xf')]);}})['catch'](function(_0x186b4d){logger['error'](_0x717a('0xa'),_0xd7d2ce,_0x186b4d);_0x1066d4(_0x186b4d);});});}exports[_0x717a('0x11')]=function(_0x152e10){var _0x8b295=this;return new Promise(function(_0x45dc38,_0x2fe7a7){return db[_0x717a('0x12')][_0x717a('0x13')](_0x152e10[_0x717a('0x14')],{'raw':_0x152e10[_0x717a('0x15')]?_0x152e10['options']['raw']===undefined?!![]:![]:!![]})[_0x717a('0x8')](function(_0x1d7ebd){logger[_0x717a('0x9')](_0x717a('0x11'),_0x152e10);logger[_0x717a('0x16')](_0x717a('0x11'),_0x152e10,JSON[_0x717a('0xc')](_0x1d7ebd));_0x45dc38(_0x1d7ebd);})[_0x717a('0x17')](function(_0x4e95dc){logger[_0x717a('0xd')](_0x717a('0x11'),_0x4e95dc[_0x717a('0xf')],_0x152e10);_0x2fe7a7(_0x8b295[_0x717a('0xd')](0x1f4,_0x4e95dc[_0x717a('0xf')]));});});};
\ No newline at end of file
index d259c2b..916ec11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c36=['../../components/auth/service','./system.controller','isAuthenticated','index','exports','express','Router'];(function(_0xa1d6cd,_0x147f56){var _0x47fd1c=function(_0x5a4c57){while(--_0x5a4c57){_0xa1d6cd['push'](_0xa1d6cd['shift']());}};_0x47fd1c(++_0x147f56);}(_0x4c36,0x1c5));var _0x64c3=function(_0x1c33f8,_0x27759c){_0x1c33f8=_0x1c33f8-0x0;var _0x13ab65=_0x4c36[_0x1c33f8];return _0x13ab65;};'use strict';var express=require(_0x64c3('0x0'));var router=express[_0x64c3('0x1')]();var auth=require(_0x64c3('0x2'));var controller=require(_0x64c3('0x3'));router['get']('/',auth[_0x64c3('0x4')](),controller[_0x64c3('0x5')]);router['get']('/process/:pid/kill',auth['isAuthenticated'](),controller['killProcess']);module[_0x64c3('0x6')]=router;
\ No newline at end of file
+var _0x1beb=['exports','express','../../components/auth/service','./system.controller','get','isAuthenticated','index','/process/:pid/kill','killProcess'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1beb,0x118));var _0xb1be=function(_0x4d0147,_0x75c92e){_0x4d0147=_0x4d0147-0x0;var _0xbf2ad8=_0x1beb[_0x4d0147];return _0xbf2ad8;};'use strict';var express=require(_0xb1be('0x0'));var router=express['Router']();var auth=require(_0xb1be('0x1'));var controller=require(_0xb1be('0x2'));router[_0xb1be('0x3')]('/',auth[_0xb1be('0x4')](),controller[_0xb1be('0x5')]);router[_0xb1be('0x3')](_0xb1be('0x6'),auth[_0xb1be('0x4')](),controller[_0xb1be('0x7')]);module[_0xb1be('0x8')]=router;
\ No newline at end of file
index 139bc19..9294c6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x67d5=['kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','child_process','exec','api','bluebird','lodash','error','inspect','name','status','send','index','then','json','catch','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','indexOf','format','Process\x20with\x20pid\x20%s\x20not\x20found!','pid'];(function(_0x3ec95f,_0x132836){var _0x5d9202=function(_0x33277c){while(--_0x33277c){_0x3ec95f['push'](_0x3ec95f['shift']());}};_0x5d9202(++_0x132836);}(_0x67d5,0x18a));var _0x567d=function(_0x41df46,_0xfd5da1){_0x41df46=_0x41df46-0x0;var _0xe2eb36=_0x67d5[_0x41df46];return _0xe2eb36;};'use strict';var info=require('systeminformation');var exec=require(_0x567d('0x0'))[_0x567d('0x1')];var logger=require('../../config/logger')(_0x567d('0x2'));var util=require('util');var BPromise=require(_0x567d('0x3'));var _=require(_0x567d('0x4'));function handleError(_0x3893d6,_0xedb92a,_0x3d4441){_0xedb92a=_0xedb92a||0x1f4;return function(_0x167cd2){logger[_0x567d('0x5')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x3d4441,_0xedb92a,util[_0x567d('0x6')](_0x167cd2,{'showHidden':![],'depth':null}));delete _0x167cd2[_0x567d('0x7')];_0x3893d6[_0x567d('0x8')](_0xedb92a)[_0x567d('0x9')](_0x167cd2);};}exports[_0x567d('0xa')]=function(_0x27c506,_0x49363a){return info['getAllData']()[_0x567d('0xb')](function(_0x1adfa3){return _0x49363a[_0x567d('0x8')](0xc8)[_0x567d('0xc')](_0x1adfa3);})[_0x567d('0xd')](function(_0x7156fe){return _0x49363a[_0x567d('0x8')](0x1f4)[_0x567d('0xc')](_0x7156fe);});};exports['killProcess']=function(_0xd02cdc,_0x3122ff){var _0x3fba82=[_0x567d('0xe')];return new BPromise(function(_0x53c01d,_0x2e24fc){return exec(util['format'](_0x567d('0xf'),_0xd02cdc[_0x567d('0x10')]['pid']),function(_0x131df2,_0x487a0a,_0x350209){if(_0x131df2){return _0x2e24fc(_0x131df2);}return _0x53c01d(_0x487a0a);});})[_0x567d('0xb')](function(_0x4e6580){var _0x44f935=![];var _0xbdddf7=_0x4e6580[_0x567d('0x11')](/\n/);for(var _0xc1dd98=0x0,_0x1ef31b=_0x3fba82['length'];_0xc1dd98<_0x1ef31b,_0x44f935===![];_0xc1dd98+=0x1){if(_0x4e6580[_0x567d('0x12')](_0x3fba82[_0xc1dd98])>=0x0){_0x44f935=!![];}}if(!_0x44f935){throw new Error(util[_0x567d('0x13')](_0x567d('0x14'),_0xd02cdc['params'][_0x567d('0x15')]));}process[_0x567d('0x16')](_0xd02cdc[_0x567d('0x10')][_0x567d('0x15')],_0x567d('0x17'));return _0x3122ff[_0x567d('0x8')](0xc8)[_0x567d('0xc')]({'message':util['format'](_0x567d('0x18'),_0xd02cdc[_0x567d('0x10')][_0x567d('0x15')])});})['catch'](handleError(_0x3122ff,null,_0x567d('0x19')));};
\ No newline at end of file
+var _0xbe78=['length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','../../config/logger','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','getAllData','then','catch','json','components/import/cm','format','params','pid','split'];(function(_0x19eb45,_0x4d1475){var _0x198d08=function(_0x1d5556){while(--_0x1d5556){_0x19eb45['push'](_0x19eb45['shift']());}};_0x198d08(++_0x4d1475);}(_0xbe78,0x1ec));var _0x8be7=function(_0x3ddd61,_0x2e79e9){_0x3ddd61=_0x3ddd61-0x0;var _0x49712d=_0xbe78[_0x3ddd61];return _0x49712d;};'use strict';var info=require(_0x8be7('0x0'));var exec=require('child_process')['exec'];var logger=require(_0x8be7('0x1'))(_0x8be7('0x2'));var util=require(_0x8be7('0x3'));var BPromise=require(_0x8be7('0x4'));var _=require(_0x8be7('0x5'));function handleError(_0x1c7e60,_0x3e01b7,_0x585673){_0x3e01b7=_0x3e01b7||0x1f4;return function(_0x6b4d75){logger[_0x8be7('0x6')](_0x8be7('0x7'),_0x585673,_0x3e01b7,util[_0x8be7('0x8')](_0x6b4d75,{'showHidden':![],'depth':null}));delete _0x6b4d75[_0x8be7('0x9')];_0x1c7e60[_0x8be7('0xa')](_0x3e01b7)[_0x8be7('0xb')](_0x6b4d75);};}exports['index']=function(_0x64233e,_0x2ac532){return info[_0x8be7('0xc')]()[_0x8be7('0xd')](function(_0x56f992){return _0x2ac532[_0x8be7('0xa')](0xc8)['json'](_0x56f992);})[_0x8be7('0xe')](function(_0x61fbac){return _0x2ac532[_0x8be7('0xa')](0x1f4)[_0x8be7('0xf')](_0x61fbac);});};exports['killProcess']=function(_0x5a4f90,_0x539c32){var _0x59b52b=[_0x8be7('0x10')];return new BPromise(function(_0x250f87,_0x51e5b1){return exec(util[_0x8be7('0x11')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x5a4f90[_0x8be7('0x12')][_0x8be7('0x13')]),function(_0x3acbc0,_0x2c7fd4,_0x5aa004){if(_0x3acbc0){return _0x51e5b1(_0x3acbc0);}return _0x250f87(_0x2c7fd4);});})['then'](function(_0x3e56b9){var _0x1b8378=![];var _0x4debf1=_0x3e56b9[_0x8be7('0x14')](/\n/);for(var _0x39c525=0x0,_0x2f813d=_0x59b52b[_0x8be7('0x15')];_0x39c525<_0x2f813d,_0x1b8378===![];_0x39c525+=0x1){if(_0x3e56b9[_0x8be7('0x16')](_0x59b52b[_0x39c525])>=0x0){_0x1b8378=!![];}}if(!_0x1b8378){throw new Error(util['format'](_0x8be7('0x17'),_0x5a4f90[_0x8be7('0x12')][_0x8be7('0x13')]));}process[_0x8be7('0x18')](_0x5a4f90[_0x8be7('0x12')][_0x8be7('0x13')],_0x8be7('0x19'));return _0x539c32[_0x8be7('0xa')](0xc8)[_0x8be7('0xf')]({'message':util['format'](_0x8be7('0x1a'),_0x5a4f90[_0x8be7('0x12')][_0x8be7('0x13')])});})[_0x8be7('0xe')](handleError(_0x539c32,null,'killProcess'));};
\ No newline at end of file
index 6253394..0c53c5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4689=['show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id'];(function(_0x313820,_0xb7fc83){var _0x31fbd4=function(_0x1eb1ba){while(--_0x1eb1ba){_0x313820['push'](_0x313820['shift']());}};_0x31fbd4(++_0xb7fc83);}(_0x4689,0xf2));var _0x9468=function(_0x36ebc0,_0x5a72bf){_0x36ebc0=_0x36ebc0-0x0;var _0x54642e=_0x4689[_0x36ebc0];return _0x54642e;};'use strict';var multer=require('multer');var util=require(_0x9468('0x0'));var path=require(_0x9468('0x1'));var timeout=require(_0x9468('0x2'));var express=require('express');var router=express[_0x9468('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9468('0x4'));var interaction=require(_0x9468('0x5'));var config=require('../../config/environment');var controller=require('./tag.controller');router[_0x9468('0x6')]('/',auth[_0x9468('0x7')](),controller[_0x9468('0x8')]);router['get'](_0x9468('0x9'),auth[_0x9468('0x7')](),controller[_0x9468('0xa')]);router[_0x9468('0xb')]('/',auth[_0x9468('0x7')](),controller[_0x9468('0xc')]);router[_0x9468('0xd')](_0x9468('0x9'),auth[_0x9468('0x7')](),controller[_0x9468('0xe')]);router[_0x9468('0xf')](_0x9468('0x9'),auth[_0x9468('0x7')](),controller[_0x9468('0x10')]);module[_0x9468('0x11')]=router;
\ No newline at end of file
+var _0x52c1=['../../components/auth/service','../../config/environment','get','isAuthenticated','show','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x10cec4,_0x5b7638){var _0x43c622=function(_0x1f29b7){while(--_0x1f29b7){_0x10cec4['push'](_0x10cec4['shift']());}};_0x43c622(++_0x5b7638);}(_0x52c1,0x1ce));var _0x152c=function(_0x1444af,_0x287c7e){_0x1444af=_0x1444af-0x0;var _0x3830c5=_0x52c1[_0x1444af];return _0x3830c5;};'use strict';var multer=require(_0x152c('0x0'));var util=require(_0x152c('0x1'));var path=require(_0x152c('0x2'));var timeout=require(_0x152c('0x3'));var express=require(_0x152c('0x4'));var router=express[_0x152c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x152c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x152c('0x7'));var controller=require('./tag.controller');router[_0x152c('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x152c('0x8')]('/:id',auth[_0x152c('0x9')](),controller[_0x152c('0xa')]);router[_0x152c('0xb')]('/',auth[_0x152c('0x9')](),controller['create']);router[_0x152c('0xc')](_0x152c('0xd'),auth['isAuthenticated'](),controller[_0x152c('0xe')]);router[_0x152c('0xf')](_0x152c('0xd'),auth[_0x152c('0x9')](),controller[_0x152c('0x10')]);module[_0x152c('0x11')]=router;
\ No newline at end of file
index e2e358a..f804d22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe493=['STRING','name','sequelize','exports'];(function(_0x285612,_0x26fc9c){var _0x2003b1=function(_0x58abc1){while(--_0x58abc1){_0x285612['push'](_0x285612['shift']());}};_0x2003b1(++_0x26fc9c);}(_0xe493,0x7e));var _0x3e49=function(_0xfd4e65,_0x244c77){_0xfd4e65=_0xfd4e65-0x0;var _0x420e8f=_0xe493[_0xfd4e65];return _0x420e8f;};'use strict';var Sequelize=require(_0x3e49('0x0'));module[_0x3e49('0x1')]={'name':{'type':Sequelize[_0x3e49('0x2')],'unique':_0x3e49('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x3e49('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x3e49('0x2')]}};
\ No newline at end of file
+var _0xc06d=['#0091EA','sequelize','exports','STRING','name'];(function(_0x4a61f6,_0x45ff79){var _0x403e83=function(_0x171380){while(--_0x171380){_0x4a61f6['push'](_0x4a61f6['shift']());}};_0x403e83(++_0x45ff79);}(_0xc06d,0x15a));var _0xdc06=function(_0x1cb24e,_0x4bf000){_0x1cb24e=_0x1cb24e-0x0;var _0x56469d=_0xc06d[_0x1cb24e];return _0x56469d;};'use strict';var Sequelize=require(_0xdc06('0x0'));module[_0xdc06('0x1')]={'name':{'type':Sequelize[_0xdc06('0x2')],'unique':_0xdc06('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0xdc06('0x4')},'description':{'type':Sequelize[_0xdc06('0x2')]}};
\ No newline at end of file
index f430ae5..b7d881b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x524a=['rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','count','status','set','Content-Range','apply','reject','save','update','then','Tags','UserProfileResource','destroy','stack','name','index','map','Tag','fieldName','model','query','filters','attributes','intersection','fields','length','limit','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','keys','rawAttributes','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format'];(function(_0x4f6272,_0x53b79c){var _0x1b5ae5=function(_0x3099ef){while(--_0x3099ef){_0x4f6272['push'](_0x4f6272['shift']());}};_0x1b5ae5(++_0x53b79c);}(_0x524a,0xf5));var _0xa524=function(_0x3f66c3,_0x17ad86){_0x3f66c3=_0x3f66c3-0x0;var _0x268e21=_0x524a[_0x3f66c3];return _0x268e21;};'use strict';var emlformat=require(_0xa524('0x0'));var rimraf=require(_0xa524('0x1'));var zipdir=require(_0xa524('0x2'));var jsonpatch=require(_0xa524('0x3'));var rp=require('request-promise');var moment=require(_0xa524('0x4'));var BPromise=require(_0xa524('0x5'));var Mustache=require(_0xa524('0x6'));var util=require('util');var path=require('path');var sox=require(_0xa524('0x7'));var csv=require(_0xa524('0x8'));var ejs=require(_0xa524('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa524('0xa'));var squel=require('squel');var crypto=require(_0xa524('0xb'));var jsforce=require(_0xa524('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa524('0x8'));var querystring=require(_0xa524('0xd'));var Papa=require(_0xa524('0xe'));var Redis=require(_0xa524('0xf'));var authService=require(_0xa524('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa524('0x11'));var hardwareService=require(_0xa524('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xa524('0x13'));var config=require(_0xa524('0x14'));var licenseUtil=require(_0xa524('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55117f,_0x14a0d6){_0x14a0d6=_0x14a0d6||0xcc;return function(_0x4aa46d){if(_0x4aa46d){return _0x55117f[_0xa524('0x16')](_0x14a0d6);}return _0x55117f['status'](_0x14a0d6)[_0xa524('0x17')]();};}function respondWithResult(_0x5c7e6a,_0x75bfe8){_0x75bfe8=_0x75bfe8||0xc8;return function(_0x281137){if(_0x281137){return _0x5c7e6a['status'](_0x75bfe8)[_0xa524('0x18')](_0x281137);}};}function respondWithFilteredResult(_0x15b14c,_0xe85361){return function(_0x1de01e){if(_0x1de01e){var _0x45347f=typeof _0xe85361[_0xa524('0x19')]===_0xa524('0x1a')&&typeof _0xe85361['limit']===_0xa524('0x1a');var _0x3d8494=_0x1de01e[_0xa524('0x1b')];var _0x3d6a0d=_0x45347f?0x0:_0xe85361[_0xa524('0x19')];var _0x805b93=_0x45347f?_0x1de01e[_0xa524('0x1b')]:_0xe85361[_0xa524('0x19')]+_0xe85361['limit'];var _0x304dea;if(_0x805b93>=_0x3d8494){_0x805b93=_0x3d8494;_0x304dea=0xc8;}else{_0x304dea=0xce;}_0x15b14c[_0xa524('0x1c')](_0x304dea);return _0x15b14c[_0xa524('0x1d')](_0xa524('0x1e'),_0x3d6a0d+'-'+_0x805b93+'/'+_0x3d8494)['json'](_0x1de01e);}return null;};}function patchUpdates(_0x5510fa){return function(_0x40f4bd){try{jsonpatch[_0xa524('0x1f')](_0x40f4bd,_0x5510fa,!![]);}catch(_0x21e114){return BPromise[_0xa524('0x20')](_0x21e114);}return _0x40f4bd[_0xa524('0x21')]();};}function saveUpdates(_0x3866e2,_0x4abffe){return function(_0x262eac){if(_0x262eac){return _0x262eac[_0xa524('0x22')](_0x3866e2)[_0xa524('0x23')](function(_0x40fb4b){return _0x40fb4b;});}return null;};}function removeEntity(_0x226784,_0x45cdcc){return function(_0x26e931){if(_0x26e931){return _0x26e931['destroy']()[_0xa524('0x23')](function(){var _0x221bf=_0x26e931['get']({'plain':!![]});var _0x47efb3=_0xa524('0x24');return db[_0xa524('0x25')][_0xa524('0x26')]({'where':{'type':_0x47efb3,'resourceId':_0x221bf['id']}})[_0xa524('0x23')](function(){return _0x26e931;});})[_0xa524('0x23')](function(){_0x226784['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1aeabc,_0x869b22){return function(_0x1582fa){if(!_0x1582fa){_0x1aeabc[_0xa524('0x16')](0x194);}return _0x1582fa;};}function handleError(_0x505c42,_0x1c84c6){_0x1c84c6=_0x1c84c6||0x1f4;return function(_0x32ba03){logger['error'](_0x32ba03[_0xa524('0x27')]);if(_0x32ba03[_0xa524('0x28')]){delete _0x32ba03['name'];}_0x505c42[_0xa524('0x1c')](_0x1c84c6)['send'](_0x32ba03);};}exports[_0xa524('0x29')]=function(_0x38e051,_0x45b846){var _0x238133={},_0x136e83={},_0x1c706b={'count':0x0,'rows':[]};var _0x4f6133=_[_0xa524('0x2a')](db[_0xa524('0x2b')]['rawAttributes'],function(_0x535e41){return{'name':_0x535e41[_0xa524('0x2c')],'type':_0x535e41['type']['key']};});_0x136e83[_0xa524('0x2d')]=_[_0xa524('0x2a')](_0x4f6133,_0xa524('0x28'));_0x136e83[_0xa524('0x2e')]=_['keys'](_0x38e051['query']);_0x136e83[_0xa524('0x2f')]=_['intersection'](_0x136e83['model'],_0x136e83[_0xa524('0x2e')]);_0x238133[_0xa524('0x30')]=_[_0xa524('0x31')](_0x136e83[_0xa524('0x2d')],qs[_0xa524('0x32')](_0x38e051[_0xa524('0x2e')][_0xa524('0x32')]));_0x238133[_0xa524('0x30')]=_0x238133[_0xa524('0x30')][_0xa524('0x33')]?_0x238133[_0xa524('0x30')]:_0x136e83[_0xa524('0x2d')];if(!_0x38e051['query']['hasOwnProperty']('nolimit')){_0x238133[_0xa524('0x34')]=qs[_0xa524('0x34')](_0x38e051['query'][_0xa524('0x34')]);_0x238133['offset']=qs[_0xa524('0x19')](_0x38e051[_0xa524('0x2e')]['offset']);}_0x238133[_0xa524('0x35')]=qs[_0xa524('0x36')](_0x38e051[_0xa524('0x2e')]['sort']);_0x238133[_0xa524('0x37')]=qs[_0xa524('0x2f')](_['pick'](_0x38e051[_0xa524('0x2e')],_0x136e83[_0xa524('0x2f')]),_0x4f6133);if(_0x38e051['query'][_0xa524('0x38')]){_0x238133[_0xa524('0x37')]=_['merge'](_0x238133[_0xa524('0x37')],{'$or':_[_0xa524('0x2a')](_0x4f6133,function(_0x186395){if(_0x186395[_0xa524('0x39')]!==_0xa524('0x3a')){var _0x38f87a={};_0x38f87a[_0x186395[_0xa524('0x28')]]={'$like':'%'+_0x38e051[_0xa524('0x2e')][_0xa524('0x38')]+'%'};return _0x38f87a;}})});}_0x238133=_[_0xa524('0x3b')]({},_0x238133,_0x38e051[_0xa524('0x3c')]);var _0x51cd09={'where':_0x238133[_0xa524('0x37')]};return db['Tag'][_0xa524('0x1b')](_0x51cd09)[_0xa524('0x23')](function(_0x35d92d){_0x1c706b[_0xa524('0x1b')]=_0x35d92d;if(_0x38e051[_0xa524('0x2e')][_0xa524('0x3d')]){_0x238133[_0xa524('0x3e')]=[{'all':!![]}];}return db[_0xa524('0x2b')][_0xa524('0x3f')](_0x238133);})[_0xa524('0x23')](function(_0x4a87d4){_0x1c706b[_0xa524('0x40')]=_0x4a87d4;return _0x1c706b;})[_0xa524('0x23')](respondWithFilteredResult(_0x45b846,_0x238133))['catch'](handleError(_0x45b846,null));};exports[_0xa524('0x41')]=function(_0x3f5564,_0x4885a4){var _0x492851={'raw':!![],'where':{'id':_0x3f5564['params']['id']}},_0x4dff4b={};_0x4dff4b['model']=_[_0xa524('0x42')](db[_0xa524('0x2b')][_0xa524('0x43')]);_0x4dff4b[_0xa524('0x2e')]=_['keys'](_0x3f5564[_0xa524('0x2e')]);_0x4dff4b[_0xa524('0x2f')]=_[_0xa524('0x31')](_0x4dff4b[_0xa524('0x2d')],_0x4dff4b['query']);_0x492851[_0xa524('0x30')]=_[_0xa524('0x31')](_0x4dff4b[_0xa524('0x2d')],qs[_0xa524('0x32')](_0x3f5564[_0xa524('0x2e')]['fields']));_0x492851[_0xa524('0x30')]=_0x492851[_0xa524('0x30')][_0xa524('0x33')]?_0x492851[_0xa524('0x30')]:_0x4dff4b[_0xa524('0x2d')];if(_0x3f5564[_0xa524('0x2e')][_0xa524('0x3d')]){_0x492851[_0xa524('0x3e')]=[{'all':!![]}];}_0x492851=_[_0xa524('0x3b')]({},_0x492851,_0x3f5564['options']);return db['Tag'][_0xa524('0x44')](_0x492851)[_0xa524('0x23')](handleEntityNotFound(_0x4885a4,null))[_0xa524('0x23')](respondWithResult(_0x4885a4,null))[_0xa524('0x45')](handleError(_0x4885a4,null));};exports[_0xa524('0x46')]=function(_0xddc80,_0x56e570){return db[_0xa524('0x2b')][_0xa524('0x46')](_0xddc80[_0xa524('0x47')],{})[_0xa524('0x23')](function(_0x24c7ef){var _0x451bbe=_0xddc80['user'][_0xa524('0x48')]({'plain':!![]});if(!_0x451bbe)throw new Error(_0xa524('0x49'));if(_0x451bbe[_0xa524('0x4a')]===_0xa524('0x4b')){var _0x25ffbd=_0x24c7ef[_0xa524('0x48')]({'plain':!![]});var _0xef18b7=_0xa524('0x24');return db[_0xa524('0x4c')][_0xa524('0x44')]({'where':{'name':_0xef18b7,'userProfileId':_0x451bbe[_0xa524('0x4d')]},'raw':!![]})[_0xa524('0x23')](function(_0x3a374f){if(_0x3a374f&&_0x3a374f[_0xa524('0x4e')]===0x0){return db[_0xa524('0x25')]['create']({'name':_0x25ffbd[_0xa524('0x28')],'resourceId':_0x25ffbd['id'],'type':_0x3a374f[_0xa524('0x28')],'sectionId':_0x3a374f['id']},{})['then'](function(){return _0x24c7ef;});}else{return _0x24c7ef;}})['catch'](function(_0x32844c){logger[_0xa524('0x4f')](_0xa524('0x50'),_0x32844c);throw _0x32844c;});}return _0x24c7ef;})[_0xa524('0x23')](respondWithResult(_0x56e570,0xc9))[_0xa524('0x45')](handleError(_0x56e570,null));};exports[_0xa524('0x22')]=function(_0x121fc5,_0x4e3709){if(_0x121fc5[_0xa524('0x47')]['id']){delete _0x121fc5[_0xa524('0x47')]['id'];}return db[_0xa524('0x2b')][_0xa524('0x44')]({'where':{'id':_0x121fc5[_0xa524('0x51')]['id']}})['then'](handleEntityNotFound(_0x4e3709,null))[_0xa524('0x23')](saveUpdates(_0x121fc5['body'],null))[_0xa524('0x23')](respondWithResult(_0x4e3709,null))[_0xa524('0x45')](handleError(_0x4e3709,null));};exports[_0xa524('0x26')]=function(_0x3f5694,_0x161393){return db[_0xa524('0x2b')][_0xa524('0x44')]({'where':{'id':_0x3f5694['params']['id']}})['then'](handleEntityNotFound(_0x161393,null))[_0xa524('0x23')](removeEntity(_0x161393,null))[_0xa524('0x45')](handleError(_0x161393,null));};
\ No newline at end of file
+var _0x9221=['where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','rows','catch','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','reject','save','update','then','destroy','get','Tags','UserProfileResource','sendStatus','error','stack','name','send','index','map','Tag','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort'];(function(_0x1899c0,_0x1084e7){var _0x3d6142=function(_0x2cf59c){while(--_0x2cf59c){_0x1899c0['push'](_0x1899c0['shift']());}};_0x3d6142(++_0x1084e7);}(_0x9221,0x64));var _0x1922=function(_0x29cb88,_0x36e887){_0x29cb88=_0x29cb88-0x0;var _0x7988a7=_0x9221[_0x29cb88];return _0x7988a7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1922('0x0'));var zipdir=require(_0x1922('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1922('0x2'));var moment=require(_0x1922('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1922('0x4'));var util=require(_0x1922('0x5'));var path=require(_0x1922('0x6'));var sox=require(_0x1922('0x7'));var csv=require(_0x1922('0x8'));var ejs=require(_0x1922('0x9'));var fs=require('fs');var fs_extra=require(_0x1922('0xa'));var _=require('lodash');var squel=require(_0x1922('0xb'));var crypto=require(_0x1922('0xc'));var jsforce=require(_0x1922('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1922('0x8'));var querystring=require('querystring');var Papa=require(_0x1922('0xe'));var Redis=require(_0x1922('0xf'));var authService=require(_0x1922('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x1922('0x11'));var hardwareService=require(_0x1922('0x12'));var logger=require('../../config/logger')(_0x1922('0x13'));var utils=require('../../config/utils');var config=require(_0x1922('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x1922('0x15'))['db'];function respondWithStatusCode(_0x1d7cf5,_0x2db5b9){_0x2db5b9=_0x2db5b9||0xcc;return function(_0x58cfe7){if(_0x58cfe7){return _0x1d7cf5['sendStatus'](_0x2db5b9);}return _0x1d7cf5[_0x1922('0x16')](_0x2db5b9)[_0x1922('0x17')]();};}function respondWithResult(_0x3d1bfb,_0x3116dc){_0x3116dc=_0x3116dc||0xc8;return function(_0x33b35d){if(_0x33b35d){return _0x3d1bfb['status'](_0x3116dc)[_0x1922('0x18')](_0x33b35d);}};}function respondWithFilteredResult(_0x4cb94e,_0x6b9389){return function(_0x474f72){if(_0x474f72){var _0x22e548=typeof _0x6b9389[_0x1922('0x19')]==='undefined'&&typeof _0x6b9389[_0x1922('0x1a')]===_0x1922('0x1b');var _0x2c9ed9=_0x474f72['count'];var _0x482f68=_0x22e548?0x0:_0x6b9389[_0x1922('0x19')];var _0x51acda=_0x22e548?_0x474f72[_0x1922('0x1c')]:_0x6b9389[_0x1922('0x19')]+_0x6b9389['limit'];var _0x4c60f8;if(_0x51acda>=_0x2c9ed9){_0x51acda=_0x2c9ed9;_0x4c60f8=0xc8;}else{_0x4c60f8=0xce;}_0x4cb94e[_0x1922('0x16')](_0x4c60f8);return _0x4cb94e['set'](_0x1922('0x1d'),_0x482f68+'-'+_0x51acda+'/'+_0x2c9ed9)[_0x1922('0x18')](_0x474f72);}return null;};}function patchUpdates(_0x1fb6a4){return function(_0x1803be){try{jsonpatch['apply'](_0x1803be,_0x1fb6a4,!![]);}catch(_0x2f2c49){return BPromise[_0x1922('0x1e')](_0x2f2c49);}return _0x1803be[_0x1922('0x1f')]();};}function saveUpdates(_0x15fd74,_0x554f8b){return function(_0xa5a368){if(_0xa5a368){return _0xa5a368[_0x1922('0x20')](_0x15fd74)[_0x1922('0x21')](function(_0x5ac549){return _0x5ac549;});}return null;};}function removeEntity(_0x29b92f,_0x59368c){return function(_0x547b8c){if(_0x547b8c){return _0x547b8c[_0x1922('0x22')]()[_0x1922('0x21')](function(){var _0xff78a2=_0x547b8c[_0x1922('0x23')]({'plain':!![]});var _0x340a1d=_0x1922('0x24');return db[_0x1922('0x25')][_0x1922('0x22')]({'where':{'type':_0x340a1d,'resourceId':_0xff78a2['id']}})[_0x1922('0x21')](function(){return _0x547b8c;});})[_0x1922('0x21')](function(){_0x29b92f[_0x1922('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3db249,_0x58ebb5){return function(_0x2cd8cd){if(!_0x2cd8cd){_0x3db249[_0x1922('0x26')](0x194);}return _0x2cd8cd;};}function handleError(_0x2e88a7,_0x392cc9){_0x392cc9=_0x392cc9||0x1f4;return function(_0x1bb708){logger[_0x1922('0x27')](_0x1bb708[_0x1922('0x28')]);if(_0x1bb708[_0x1922('0x29')]){delete _0x1bb708[_0x1922('0x29')];}_0x2e88a7['status'](_0x392cc9)[_0x1922('0x2a')](_0x1bb708);};}exports[_0x1922('0x2b')]=function(_0x353c71,_0x2ebb6c){var _0x7c25eb={},_0x545e94={},_0x10f398={'count':0x0,'rows':[]};var _0x39d7d5=_[_0x1922('0x2c')](db[_0x1922('0x2d')][_0x1922('0x2e')],function(_0x474e85){return{'name':_0x474e85[_0x1922('0x2f')],'type':_0x474e85['type'][_0x1922('0x30')]};});_0x545e94[_0x1922('0x31')]=_[_0x1922('0x2c')](_0x39d7d5,_0x1922('0x29'));_0x545e94[_0x1922('0x32')]=_[_0x1922('0x33')](_0x353c71['query']);_0x545e94[_0x1922('0x34')]=_[_0x1922('0x35')](_0x545e94[_0x1922('0x31')],_0x545e94[_0x1922('0x32')]);_0x7c25eb[_0x1922('0x36')]=_[_0x1922('0x35')](_0x545e94[_0x1922('0x31')],qs['fields'](_0x353c71[_0x1922('0x32')][_0x1922('0x37')]));_0x7c25eb[_0x1922('0x36')]=_0x7c25eb[_0x1922('0x36')][_0x1922('0x38')]?_0x7c25eb[_0x1922('0x36')]:_0x545e94['model'];if(!_0x353c71[_0x1922('0x32')][_0x1922('0x39')]('nolimit')){_0x7c25eb[_0x1922('0x1a')]=qs[_0x1922('0x1a')](_0x353c71['query'][_0x1922('0x1a')]);_0x7c25eb[_0x1922('0x19')]=qs[_0x1922('0x19')](_0x353c71['query'][_0x1922('0x19')]);}_0x7c25eb[_0x1922('0x3a')]=qs['sort'](_0x353c71[_0x1922('0x32')][_0x1922('0x3b')]);_0x7c25eb[_0x1922('0x3c')]=qs['filters'](_[_0x1922('0x3d')](_0x353c71['query'],_0x545e94[_0x1922('0x34')]),_0x39d7d5);if(_0x353c71['query']['filter']){_0x7c25eb[_0x1922('0x3c')]=_[_0x1922('0x3e')](_0x7c25eb['where'],{'$or':_[_0x1922('0x2c')](_0x39d7d5,function(_0x447b8e){if(_0x447b8e[_0x1922('0x3f')]!==_0x1922('0x40')){var _0x25d29a={};_0x25d29a[_0x447b8e['name']]={'$like':'%'+_0x353c71['query'][_0x1922('0x41')]+'%'};return _0x25d29a;}})});}_0x7c25eb=_[_0x1922('0x3e')]({},_0x7c25eb,_0x353c71[_0x1922('0x42')]);var _0x1183a7={'where':_0x7c25eb[_0x1922('0x3c')]};return db[_0x1922('0x2d')]['count'](_0x1183a7)[_0x1922('0x21')](function(_0x260ebf){_0x10f398[_0x1922('0x1c')]=_0x260ebf;if(_0x353c71[_0x1922('0x32')][_0x1922('0x43')]){_0x7c25eb[_0x1922('0x44')]=[{'all':!![]}];}return db[_0x1922('0x2d')]['findAll'](_0x7c25eb);})[_0x1922('0x21')](function(_0x1e474b){_0x10f398[_0x1922('0x45')]=_0x1e474b;return _0x10f398;})['then'](respondWithFilteredResult(_0x2ebb6c,_0x7c25eb))[_0x1922('0x46')](handleError(_0x2ebb6c,null));};exports['show']=function(_0x4027e4,_0x461151){var _0x1fce43={'raw':!![],'where':{'id':_0x4027e4[_0x1922('0x47')]['id']}},_0x31e9e6={};_0x31e9e6['model']=_[_0x1922('0x33')](db[_0x1922('0x2d')][_0x1922('0x2e')]);_0x31e9e6[_0x1922('0x32')]=_['keys'](_0x4027e4[_0x1922('0x32')]);_0x31e9e6['filters']=_[_0x1922('0x35')](_0x31e9e6[_0x1922('0x31')],_0x31e9e6[_0x1922('0x32')]);_0x1fce43[_0x1922('0x36')]=_[_0x1922('0x35')](_0x31e9e6[_0x1922('0x31')],qs[_0x1922('0x37')](_0x4027e4['query']['fields']));_0x1fce43['attributes']=_0x1fce43[_0x1922('0x36')][_0x1922('0x38')]?_0x1fce43[_0x1922('0x36')]:_0x31e9e6[_0x1922('0x31')];if(_0x4027e4[_0x1922('0x32')][_0x1922('0x43')]){_0x1fce43[_0x1922('0x44')]=[{'all':!![]}];}_0x1fce43=_[_0x1922('0x3e')]({},_0x1fce43,_0x4027e4['options']);return db[_0x1922('0x2d')][_0x1922('0x48')](_0x1fce43)['then'](handleEntityNotFound(_0x461151,null))[_0x1922('0x21')](respondWithResult(_0x461151,null))[_0x1922('0x46')](handleError(_0x461151,null));};exports[_0x1922('0x49')]=function(_0x1c241b,_0x1e6d2f){return db['Tag']['create'](_0x1c241b['body'],{})[_0x1922('0x21')](function(_0x4dad3e){var _0x5e537c=_0x1c241b[_0x1922('0x4a')][_0x1922('0x23')]({'plain':!![]});if(!_0x5e537c)throw new Error(_0x1922('0x4b'));if(_0x5e537c['role']==='user'){var _0x57a002=_0x4dad3e['get']({'plain':!![]});var _0x2234da=_0x1922('0x24');return db[_0x1922('0x4c')][_0x1922('0x48')]({'where':{'name':_0x2234da,'userProfileId':_0x5e537c['userProfileId']},'raw':!![]})[_0x1922('0x21')](function(_0x245807){if(_0x245807&&_0x245807[_0x1922('0x4d')]===0x0){return db[_0x1922('0x25')]['create']({'name':_0x57a002[_0x1922('0x29')],'resourceId':_0x57a002['id'],'type':_0x245807[_0x1922('0x29')],'sectionId':_0x245807['id']},{})['then'](function(){return _0x4dad3e;});}else{return _0x4dad3e;}})[_0x1922('0x46')](function(_0x1fb6ed){logger[_0x1922('0x27')](_0x1922('0x4e'),_0x1fb6ed);throw _0x1fb6ed;});}return _0x4dad3e;})[_0x1922('0x21')](respondWithResult(_0x1e6d2f,0xc9))[_0x1922('0x46')](handleError(_0x1e6d2f,null));};exports[_0x1922('0x20')]=function(_0x40a324,_0xeb183e){if(_0x40a324[_0x1922('0x4f')]['id']){delete _0x40a324[_0x1922('0x4f')]['id'];}return db[_0x1922('0x2d')][_0x1922('0x48')]({'where':{'id':_0x40a324[_0x1922('0x47')]['id']}})[_0x1922('0x21')](handleEntityNotFound(_0xeb183e,null))['then'](saveUpdates(_0x40a324[_0x1922('0x4f')],null))[_0x1922('0x21')](respondWithResult(_0xeb183e,null))[_0x1922('0x46')](handleError(_0xeb183e,null));};exports[_0x1922('0x22')]=function(_0x4b3836,_0x505472){return db['Tag'][_0x1922('0x48')]({'where':{'id':_0x4b3836[_0x1922('0x47')]['id']}})[_0x1922('0x21')](handleEntityNotFound(_0x505472,null))[_0x1922('0x21')](removeEntity(_0x505472,null))[_0x1922('0x46')](handleError(_0x505472,null));};
\ No newline at end of file
index 8d929fc..c1f23ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e59=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports'];(function(_0x3efc55,_0x12715b){var _0xc4f901=function(_0x2723f5){while(--_0x2723f5){_0x3efc55['push'](_0x3efc55['shift']());}};_0xc4f901(++_0x12715b);}(_0x8e59,0xcf));var _0x98e5=function(_0x591099,_0x4b0ed9){_0x591099=_0x591099-0x0;var _0xfbebb=_0x8e59[_0x591099];return _0xfbebb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x98e5('0x0'))('api');var moment=require(_0x98e5('0x1'));var BPromise=require(_0x98e5('0x2'));var rp=require(_0x98e5('0x3'));var fs=require('fs');var path=require(_0x98e5('0x4'));var rimraf=require(_0x98e5('0x5'));var config=require(_0x98e5('0x6'));var attributes=require(_0x98e5('0x7'));module[_0x98e5('0x8')]=function(_0xa25587,_0x417c5b){return _0xa25587['define']('Tag',attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xef72=['define','Tag','tools_tags','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x362733,_0x46e9fa){var _0x4fccca=function(_0x57289e){while(--_0x57289e){_0x362733['push'](_0x362733['shift']());}};_0x4fccca(++_0x46e9fa);}(_0xef72,0x9f));var _0x2ef7=function(_0x8e6a77,_0x147cf3){_0x8e6a77=_0x8e6a77-0x0;var _0x5b5d19=_0xef72[_0x8e6a77];return _0x5b5d19;};'use strict';var _=require('lodash');var util=require(_0x2ef7('0x0'));var logger=require(_0x2ef7('0x1'))(_0x2ef7('0x2'));var moment=require(_0x2ef7('0x3'));var BPromise=require(_0x2ef7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2ef7('0x5'));var rimraf=require(_0x2ef7('0x6'));var config=require(_0x2ef7('0x7'));var attributes=require('./tag.attributes');module[_0x2ef7('0x8')]=function(_0x2c20c7,_0x426f4c){return _0x2c20c7[_0x2ef7('0x9')](_0x2ef7('0xa'),attributes,{'tableName':_0x2ef7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9469fbd..6a727c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4bc3=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','Tag,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Tag,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x429072,_0x5dbdb4){var _0xdb264e=function(_0x38c973){while(--_0x38c973){_0x429072['push'](_0x429072['shift']());}};_0xdb264e(++_0x5dbdb4);}(_0x4bc3,0x16e));var _0x34bc=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0x4bc3[_0x556bb1];return _0x45455f;};'use strict';var _=require(_0x34bc('0x0'));var util=require(_0x34bc('0x1'));var moment=require('moment');var BPromise=require(_0x34bc('0x2'));var rs=require(_0x34bc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x34bc('0x4'))['db'];var utils=require(_0x34bc('0x5'));var logger=require(_0x34bc('0x6'))(_0x34bc('0x7'));var config=require(_0x34bc('0x8'));var jayson=require(_0x34bc('0x9'));var client=jayson[_0x34bc('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x21451b,_0x50320d,_0x502087){return new BPromise(function(_0x18a01c,_0x474108){return client[_0x34bc('0xb')](_0x21451b,_0x502087)[_0x34bc('0xc')](function(_0x409105){logger[_0x34bc('0xd')]('Tag,\x20%s,\x20%s',_0x50320d,'request\x20sent');logger[_0x34bc('0xe')](_0x34bc('0xf'),_0x50320d,_0x34bc('0x10'),JSON['stringify'](_0x409105));if(_0x409105[_0x34bc('0x11')]){if(_0x409105['error'][_0x34bc('0x12')]===0x1f4){logger[_0x34bc('0x11')](_0x34bc('0x13'),_0x50320d,_0x409105['error'][_0x34bc('0x14')]);return _0x474108(_0x409105['error'][_0x34bc('0x14')]);}logger[_0x34bc('0x11')](_0x34bc('0x13'),_0x50320d,_0x409105['error']['message']);return _0x18a01c(_0x409105[_0x34bc('0x11')]['message']);}else{logger[_0x34bc('0xd')](_0x34bc('0x13'),_0x50320d,_0x34bc('0x10'));_0x18a01c(_0x409105[_0x34bc('0x15')][_0x34bc('0x14')]);}})[_0x34bc('0x16')](function(_0x5e132d){logger['error']('Tag,\x20%s,\x20%s',_0x50320d,_0x5e132d);_0x474108(_0x5e132d);});});}
\ No newline at end of file
+var _0xc368=['client','request','then','request\x20sent','debug','stringify','error','code','Tag,\x20%s,\x20%s','message','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x33520d,_0x4becf5){var _0x45cd53=function(_0x1e97e4){while(--_0x1e97e4){_0x33520d['push'](_0x33520d['shift']());}};_0x45cd53(++_0x4becf5);}(_0xc368,0x7b));var _0x8c36=function(_0x1dbb8c,_0x35f5e3){_0x1dbb8c=_0x1dbb8c-0x0;var _0x2add13=_0xc368[_0x1dbb8c];return _0x2add13;};'use strict';var _=require('lodash');var util=require(_0x8c36('0x0'));var moment=require('moment');var BPromise=require(_0x8c36('0x1'));var rs=require(_0x8c36('0x2'));var fs=require('fs');var Redis=require(_0x8c36('0x3'));var db=require(_0x8c36('0x4'))['db'];var utils=require(_0x8c36('0x5'));var logger=require('../../config/logger')(_0x8c36('0x6'));var config=require(_0x8c36('0x7'));var jayson=require(_0x8c36('0x8'));var client=jayson[_0x8c36('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x554022,_0x8ed437,_0x384867){return new BPromise(function(_0x3e76be,_0x26bad1){return client[_0x8c36('0xa')](_0x554022,_0x384867)[_0x8c36('0xb')](function(_0x569f29){logger['info']('Tag,\x20%s,\x20%s',_0x8ed437,_0x8c36('0xc'));logger[_0x8c36('0xd')]('Tag,\x20%s,\x20%s,\x20%s',_0x8ed437,_0x8c36('0xc'),JSON[_0x8c36('0xe')](_0x569f29));if(_0x569f29[_0x8c36('0xf')]){if(_0x569f29[_0x8c36('0xf')][_0x8c36('0x10')]===0x1f4){logger[_0x8c36('0xf')](_0x8c36('0x11'),_0x8ed437,_0x569f29[_0x8c36('0xf')][_0x8c36('0x12')]);return _0x26bad1(_0x569f29[_0x8c36('0xf')][_0x8c36('0x12')]);}logger[_0x8c36('0xf')](_0x8c36('0x11'),_0x8ed437,_0x569f29[_0x8c36('0xf')]['message']);return _0x3e76be(_0x569f29[_0x8c36('0xf')]['message']);}else{logger[_0x8c36('0x13')](_0x8c36('0x11'),_0x8ed437,_0x8c36('0xc'));_0x3e76be(_0x569f29[_0x8c36('0x14')][_0x8c36('0x12')]);}})[_0x8c36('0x15')](function(_0x3c10eb){logger[_0x8c36('0xf')](_0x8c36('0x11'),_0x8ed437,_0x3c10eb);_0x26bad1(_0x3c10eb);});});}
\ No newline at end of file
index 4a2b9c9..e8fe468 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(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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 6e86974..6b2fdcd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['name','sequelize','STRING'];(function(_0x43af6e,_0xba649d){var _0x568bea=function(_0x30c759){while(--_0x30c759){_0x43af6e['push'](_0x43af6e['shift']());}};_0x568bea(++_0xba649d);}(_0xb10b,0x12a));var _0xbb10=function(_0x170f85,_0x234754){_0x170f85=_0x170f85-0x0;var _0x229661=_0xb10b[_0x170f85];return _0x229661;};'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 _0xb7e7=['STRING','sequelize'];(function(_0x504df1,_0x289598){var _0x1063b5=function(_0x627abd){while(--_0x627abd){_0x504df1['push'](_0x504df1['shift']());}};_0x1063b5(++_0x289598);}(_0xb7e7,0x121));var _0x7b7e=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0xb7e7[_0x424a9a];return _0xa7831c;};'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
index 63de645..db322d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5903=['Queue:remove','UserVoiceQueueRt','UserVoicePrefix','VoicePrefixId','getAgents','hasOwnProperty','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','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/environment','../../config/license/util','../../mysqldb','defaults','redis','./team.socket','register','status','offset','undefined','count','set','Content-Range','json','apply','save','update','then','stack','name','send','Team','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','catch','show','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Teams','UserProfileSection','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','sequelize','Sequelize','QueryTypes','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','end','getQueues','findOne','params','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','addQueues','add','ids','removeQueues','remove','isArray','Voice','Chat','Mail','Openchannel','Whatsapp','transaction','through','QueueId','TeamVoiceQueue','User','findOrCreate','emit','Queue:save','online','voicePause','interface','upsert','isNil','format','SIP/%s','all','addAgents','spread','removeAgents','Sms','Fax'];(function(_0x5576a1,_0x3acf49){var _0x5d2a51=function(_0x365a93){while(--_0x365a93){_0x5576a1['push'](_0x5576a1['shift']());}};_0x5d2a51(++_0x3acf49);}(_0x5903,0x1e3));var _0x3590=function(_0xab649b,_0x1519e9){_0xab649b=_0xab649b-0x0;var _0x3b7584=_0x5903[_0xab649b];return _0x3b7584;};'use strict';var emlformat=require(_0x3590('0x0'));var rimraf=require(_0x3590('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3590('0x2'));var rp=require(_0x3590('0x3'));var moment=require(_0x3590('0x4'));var BPromise=require(_0x3590('0x5'));var Mustache=require(_0x3590('0x6'));var util=require('util');var path=require(_0x3590('0x7'));var sox=require('sox');var csv=require(_0x3590('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3590('0x9'));var _=require(_0x3590('0xa'));var squel=require(_0x3590('0xb'));var crypto=require(_0x3590('0xc'));var jsforce=require(_0x3590('0xd'));var deskjs=require(_0x3590('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3590('0xf'));var Papa=require('papaparse');var Redis=require(_0x3590('0x10'));var authService=require(_0x3590('0x11'));var qs=require(_0x3590('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3590('0x13'));var logger=require(_0x3590('0x14'))(_0x3590('0x15'));var utils=require('../../config/utils');var config=require(_0x3590('0x16'));var licenseUtil=require(_0x3590('0x17'));var db=require(_0x3590('0x18'))['db'];config['redis']=_[_0x3590('0x19')](config[_0x3590('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3590('0x1a')]));require(_0x3590('0x1b'))[_0x3590('0x1c')](socket);function respondWithStatusCode(_0x82f19e,_0x578911){_0x578911=_0x578911||0xcc;return function(_0x4c0d75){if(_0x4c0d75){return _0x82f19e['sendStatus'](_0x578911);}return _0x82f19e[_0x3590('0x1d')](_0x578911)['end']();};}function respondWithResult(_0x1755d3,_0x44a52e){_0x44a52e=_0x44a52e||0xc8;return function(_0x17a925){if(_0x17a925){return _0x1755d3[_0x3590('0x1d')](_0x44a52e)['json'](_0x17a925);}};}function respondWithFilteredResult(_0x5b226c,_0x1f9976){return function(_0x490fdd){if(_0x490fdd){var _0x37945a=typeof _0x1f9976[_0x3590('0x1e')]===_0x3590('0x1f')&&typeof _0x1f9976['limit']===_0x3590('0x1f');var _0x5b6af7=_0x490fdd['count'];var _0x24b4c8=_0x37945a?0x0:_0x1f9976[_0x3590('0x1e')];var _0x1665a0=_0x37945a?_0x490fdd[_0x3590('0x20')]:_0x1f9976['offset']+_0x1f9976['limit'];var _0x59f7b0;if(_0x1665a0>=_0x5b6af7){_0x1665a0=_0x5b6af7;_0x59f7b0=0xc8;}else{_0x59f7b0=0xce;}_0x5b226c[_0x3590('0x1d')](_0x59f7b0);return _0x5b226c[_0x3590('0x21')](_0x3590('0x22'),_0x24b4c8+'-'+_0x1665a0+'/'+_0x5b6af7)[_0x3590('0x23')](_0x490fdd);}return null;};}function patchUpdates(_0x54dc77){return function(_0x2324c1){try{jsonpatch[_0x3590('0x24')](_0x2324c1,_0x54dc77,!![]);}catch(_0x28bcf3){return BPromise['reject'](_0x28bcf3);}return _0x2324c1[_0x3590('0x25')]();};}function saveUpdates(_0x20bd4f,_0xb7bfb8){return function(_0x530e3b){if(_0x530e3b){return _0x530e3b[_0x3590('0x26')](_0x20bd4f)[_0x3590('0x27')](function(_0x361388){return _0x361388;});}return null;};}function handleEntityNotFound(_0x977b31,_0x2304cf){return function(_0x4e16d4){if(!_0x4e16d4){_0x977b31['sendStatus'](0x194);}return _0x4e16d4;};}function handleError(_0x45afcf,_0x292ee9){_0x292ee9=_0x292ee9||0x1f4;return function(_0x1979b2){logger['error'](_0x1979b2[_0x3590('0x28')]);if(_0x1979b2[_0x3590('0x29')]){delete _0x1979b2[_0x3590('0x29')];}_0x45afcf[_0x3590('0x1d')](_0x292ee9)[_0x3590('0x2a')](_0x1979b2);};}exports['index']=function(_0x9bed6d,_0x50e8fb){var _0x17efaf={},_0x3639a6={},_0x1c8328={'count':0x0,'rows':[]};var _0x3c1151=_['map'](db[_0x3590('0x2b')][_0x3590('0x2c')],function(_0x5864a6){return{'name':_0x5864a6[_0x3590('0x2d')],'type':_0x5864a6['type'][_0x3590('0x2e')]};});_0x3639a6[_0x3590('0x2f')]=_[_0x3590('0x30')](_0x3c1151,'name');_0x3639a6[_0x3590('0x31')]=_[_0x3590('0x32')](_0x9bed6d[_0x3590('0x31')]);_0x3639a6[_0x3590('0x33')]=_[_0x3590('0x34')](_0x3639a6[_0x3590('0x2f')],_0x3639a6[_0x3590('0x31')]);_0x17efaf[_0x3590('0x35')]=_[_0x3590('0x34')](_0x3639a6['model'],qs[_0x3590('0x36')](_0x9bed6d[_0x3590('0x31')][_0x3590('0x36')]));_0x17efaf[_0x3590('0x35')]=_0x17efaf['attributes'][_0x3590('0x37')]?_0x17efaf[_0x3590('0x35')]:_0x3639a6[_0x3590('0x2f')];if(!_0x9bed6d[_0x3590('0x31')]['hasOwnProperty'](_0x3590('0x38'))){_0x17efaf['limit']=qs[_0x3590('0x39')](_0x9bed6d[_0x3590('0x31')][_0x3590('0x39')]);_0x17efaf[_0x3590('0x1e')]=qs[_0x3590('0x1e')](_0x9bed6d[_0x3590('0x31')][_0x3590('0x1e')]);}_0x17efaf[_0x3590('0x3a')]=qs[_0x3590('0x3b')](_0x9bed6d[_0x3590('0x31')]['sort']);_0x17efaf[_0x3590('0x3c')]=qs[_0x3590('0x33')](_[_0x3590('0x3d')](_0x9bed6d[_0x3590('0x31')],_0x3639a6[_0x3590('0x33')]),_0x3c1151);if(_0x9bed6d[_0x3590('0x31')][_0x3590('0x3e')]){_0x17efaf[_0x3590('0x3c')]=_[_0x3590('0x3f')](_0x17efaf[_0x3590('0x3c')],{'$or':_['map'](_0x3c1151,function(_0x3eabe9){if(_0x3eabe9[_0x3590('0x40')]!=='VIRTUAL'){var _0x445332={};_0x445332[_0x3eabe9[_0x3590('0x29')]]={'$like':'%'+_0x9bed6d[_0x3590('0x31')][_0x3590('0x3e')]+'%'};return _0x445332;}})});}_0x17efaf=_[_0x3590('0x3f')]({},_0x17efaf,_0x9bed6d[_0x3590('0x41')]);var _0x10fbed={'where':_0x17efaf[_0x3590('0x3c')]};return db[_0x3590('0x2b')][_0x3590('0x20')](_0x10fbed)[_0x3590('0x27')](function(_0x198456){_0x1c8328[_0x3590('0x20')]=_0x198456;if(_0x9bed6d[_0x3590('0x31')][_0x3590('0x42')]){_0x17efaf[_0x3590('0x43')]=[{'all':!![]}];}return db[_0x3590('0x2b')][_0x3590('0x44')](_0x17efaf);})[_0x3590('0x27')](function(_0x5b1b28){_0x1c8328['rows']=_0x5b1b28;return _0x1c8328;})[_0x3590('0x27')](respondWithFilteredResult(_0x50e8fb,_0x17efaf))[_0x3590('0x45')](handleError(_0x50e8fb,null));};exports[_0x3590('0x46')]=function(_0x8a79ad,_0x32e8c6){var _0x39c1a2={'raw':![],'where':{'id':_0x8a79ad['params']['id']}},_0x3eefae={};_0x3eefae[_0x3590('0x2f')]=_[_0x3590('0x32')](db[_0x3590('0x2b')][_0x3590('0x2c')]);_0x3eefae['query']=_[_0x3590('0x32')](_0x8a79ad[_0x3590('0x31')]);_0x3eefae[_0x3590('0x33')]=_['intersection'](_0x3eefae['model'],_0x3eefae[_0x3590('0x31')]);_0x39c1a2[_0x3590('0x35')]=_['intersection'](_0x3eefae['model'],qs['fields'](_0x8a79ad[_0x3590('0x31')]['fields']));_0x39c1a2['attributes']=_0x39c1a2['attributes']['length']?_0x39c1a2[_0x3590('0x35')]:_0x3eefae[_0x3590('0x2f')];if(_0x8a79ad[_0x3590('0x31')][_0x3590('0x42')]){_0x39c1a2[_0x3590('0x43')]=[{'all':!![]}];}_0x39c1a2=_[_0x3590('0x3f')]({},_0x39c1a2,_0x8a79ad[_0x3590('0x41')]);return db[_0x3590('0x2b')][_0x3590('0x47')](_0x39c1a2)[_0x3590('0x27')](handleEntityNotFound(_0x32e8c6,null))['then'](respondWithResult(_0x32e8c6,null))[_0x3590('0x45')](handleError(_0x32e8c6,null));};exports[_0x3590('0x48')]=function(_0x5ef038,_0x295a93){return db['Team']['create'](_0x5ef038['body'],{})['then'](function(_0xcd1188){var _0x15666c=_0x5ef038['user'][_0x3590('0x49')]({'plain':!![]});if(!_0x15666c)throw new Error(_0x3590('0x4a'));if(_0x15666c['role']===_0x3590('0x4b')){var _0xb2d073=_0xcd1188[_0x3590('0x49')]({'plain':!![]});var _0x124a87=_0x3590('0x4c');return db[_0x3590('0x4d')]['find']({'where':{'name':_0x124a87,'userProfileId':_0x15666c['userProfileId']},'raw':!![]})[_0x3590('0x27')](function(_0x641c5e){if(_0x641c5e&&_0x641c5e[_0x3590('0x4e')]===0x0){return db[_0x3590('0x4f')]['create']({'name':_0xb2d073['name'],'resourceId':_0xb2d073['id'],'type':_0x641c5e['name'],'sectionId':_0x641c5e['id']},{})[_0x3590('0x27')](function(){return _0xcd1188;});}else{return _0xcd1188;}})['catch'](function(_0xe27a2c){logger[_0x3590('0x50')](_0x3590('0x51'),_0xe27a2c);throw _0xe27a2c;});}return _0xcd1188;})[_0x3590('0x27')](respondWithResult(_0x295a93,0xc9))[_0x3590('0x45')](handleError(_0x295a93,null));};exports[_0x3590('0x26')]=function(_0x5457c9,_0x2ceb0a){if(_0x5457c9[_0x3590('0x52')]['id']){delete _0x5457c9[_0x3590('0x52')]['id'];}return db[_0x3590('0x2b')][_0x3590('0x47')]({'where':{'id':_0x5457c9['params']['id']}})[_0x3590('0x27')](handleEntityNotFound(_0x2ceb0a,null))[_0x3590('0x27')](saveUpdates(_0x5457c9['body'],null))[_0x3590('0x27')](respondWithResult(_0x2ceb0a,null))[_0x3590('0x45')](handleError(_0x2ceb0a,null));};exports[_0x3590('0x53')]=function(_0x38d385,_0x3b1b73){var _0x5012b4=_0x38d385['params']['id'];var _0x31b2d7=[];return db['sequelize']['transaction'](function(_0x100263){var _0x370a97=_0x3590('0x54')+_0x5012b4;return db['sequelize'][_0x3590('0x31')](_0x370a97,{'type':db['Sequelize']['QueryTypes'][_0x3590('0x55')],'raw':!![],'transaction':_0x100263})[_0x3590('0x27')](function(_0x501136){_0x31b2d7=_['map'](_0x501136,function(_0x1fb6e7){return Number(_0x1fb6e7[_0x3590('0x56')]);});})[_0x3590('0x27')](function(){var _0x1366ca=_0x3590('0x57')+_0x5012b4;return db[_0x3590('0x58')][_0x3590('0x31')](_0x1366ca,{'type':db[_0x3590('0x59')][_0x3590('0x5a')][_0x3590('0x55')],'raw':!![],'transaction':_0x100263});})['then'](function(_0x469a65){var _0x48b074=_[_0x3590('0x30')](_0x469a65,function(_0x492d95){return Number(_0x492d95[_0x3590('0x5b')]);});return db[_0x3590('0x5c')]['destroy']({'where':{'UserId':{'$in':_0x31b2d7},'VoiceQueueId':{'$in':_0x48b074}},'transaction':_0x100263});})[_0x3590('0x27')](function(){var _0x120cf5=_0x3590('0x5d')+_0x5012b4;return db[_0x3590('0x58')]['query'](_0x120cf5,{'type':db[_0x3590('0x59')]['QueryTypes'][_0x3590('0x55')],'raw':!![],'transaction':_0x100263});})[_0x3590('0x27')](function(_0x502347){var _0x3634ae=_[_0x3590('0x30')](_0x502347,function(_0x4dd2e5){return Number(_0x4dd2e5['MailQueueId']);});return db[_0x3590('0x5e')][_0x3590('0x53')]({'where':{'UserId':{'$in':_0x31b2d7},'MailQueueId':{'$in':_0x3634ae}},'transaction':_0x100263});})[_0x3590('0x27')](function(){var _0xaae6f9=_0x3590('0x5f')+_0x5012b4;return db[_0x3590('0x58')][_0x3590('0x31')](_0xaae6f9,{'type':db[_0x3590('0x59')][_0x3590('0x5a')][_0x3590('0x55')],'raw':!![],'transaction':_0x100263});})[_0x3590('0x27')](function(_0x5ccdb6){var _0x2ad6a0=_[_0x3590('0x30')](_0x5ccdb6,function(_0x213a7c){return Number(_0x213a7c[_0x3590('0x60')]);});return db[_0x3590('0x61')][_0x3590('0x53')]({'where':{'UserId':{'$in':_0x31b2d7},'SmsQueueId':{'$in':_0x2ad6a0}},'transaction':_0x100263});})[_0x3590('0x27')](function(){var _0x5a0616=_0x3590('0x62')+_0x5012b4;return db[_0x3590('0x58')][_0x3590('0x31')](_0x5a0616,{'type':db[_0x3590('0x59')][_0x3590('0x5a')][_0x3590('0x55')],'raw':!![],'transaction':_0x100263});})[_0x3590('0x27')](function(_0x2cf666){var _0xeed415=_[_0x3590('0x30')](_0x2cf666,function(_0xf1d257){return Number(_0xf1d257['ChatQueueId']);});return db['UserChatQueue'][_0x3590('0x53')]({'where':{'UserId':{'$in':_0x31b2d7},'ChatQueueId':{'$in':_0xeed415}},'transaction':_0x100263});})[_0x3590('0x27')](function(){var _0x345923=_0x3590('0x63')+_0x5012b4;return db[_0x3590('0x58')][_0x3590('0x31')](_0x345923,{'type':db[_0x3590('0x59')][_0x3590('0x5a')][_0x3590('0x55')],'raw':!![],'transaction':_0x100263});})[_0x3590('0x27')](function(_0x1c4dab){var _0xd41f80=_['map'](_0x1c4dab,function(_0x2d473f){return Number(_0x2d473f[_0x3590('0x64')]);});return db[_0x3590('0x65')][_0x3590('0x53')]({'where':{'UserId':{'$in':_0x31b2d7},'FaxQueueId':{'$in':_0xd41f80}},'transaction':_0x100263});})[_0x3590('0x27')](function(){var _0x13d295=_0x3590('0x66')+_0x5012b4;return db[_0x3590('0x58')][_0x3590('0x31')](_0x13d295,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x100263});})[_0x3590('0x27')](function(_0x193129){var _0x120611=_[_0x3590('0x30')](_0x193129,function(_0x29d756){return Number(_0x29d756[_0x3590('0x67')]);});return db[_0x3590('0x68')]['destroy']({'where':{'UserId':{'$in':_0x31b2d7},'OpenchannelQueueId':{'$in':_0x120611}},'transaction':_0x100263});})[_0x3590('0x27')](function(){var _0x304486=_0x3590('0x69')+_0x5012b4;return db[_0x3590('0x58')][_0x3590('0x31')](_0x304486,{'type':db[_0x3590('0x59')][_0x3590('0x5a')][_0x3590('0x55')],'raw':!![],'transaction':_0x100263});})[_0x3590('0x27')](function(_0x47102b){var _0x392eeb=_[_0x3590('0x30')](_0x47102b,function(_0x32de92){return Number(_0x32de92[_0x3590('0x6a')]);});return db[_0x3590('0x6b')][_0x3590('0x53')]({'where':{'UserId':{'$in':_0x31b2d7},'WhatsappQueueId':{'$in':_0x392eeb}},'transaction':_0x100263});})[_0x3590('0x27')](function(){return db[_0x3590('0x6c')]['find']({'where':{'TeamId':_0x5012b4}});})[_0x3590('0x27')](function(_0x6a02e){if(_0x6a02e===null){return;}return db['UserVoicePrefix'][_0x3590('0x53')]({'where':{'UserId':{'$in':_0x31b2d7},'VoicePrefixId':_0x6a02e['VoicePrefixId']},'transaction':_0x100263});})['then'](function(){return db[_0x3590('0x2b')][_0x3590('0x53')]({'where':{'id':_0x5012b4},'cascade':!![],'transaction':_0x100263});})['then'](function(_0x41d097){if(_0x41d097===0x0){_0x3b1b73['sendStatus'](0x194);}else{return db[_0x3590('0x4f')]['destroy']({'where':{'type':_0x3590('0x4c'),'resourceId':_0x5012b4},'cascade':!![],'transaction':_0x100263})[_0x3590('0x27')](function(){_0x3b1b73[_0x3590('0x1d')](0xcc)[_0x3590('0x6d')]();});}})[_0x3590('0x45')](function(_0x3cf18e){_0x3b1b73[_0x3590('0x1d')](0x1f4)[_0x3590('0x2a')](_0x3cf18e);});});};exports[_0x3590('0x6e')]=function(_0x448a5a,_0x2e757d,_0x5afe0a){return db[_0x3590('0x2b')][_0x3590('0x6f')]({'where':{'id':_0x448a5a[_0x3590('0x70')]['id']}})[_0x3590('0x27')](handleEntityNotFound(_0x2e757d,null))[_0x3590('0x27')](function(_0x1bc8f3){if(!_0x448a5a[_0x3590('0x31')][_0x3590('0x71')]||!utils[_0x3590('0x72')](_0x448a5a[_0x3590('0x31')][_0x3590('0x71')])){throw new db[(_0x3590('0x59'))][(_0x3590('0x73'))](_0x3590('0x74'));}var _0x352dd9={};var _0x2930be={};_0x2930be[_0x3590('0x2f')]=_[_0x3590('0x32')](db[_[_0x3590('0x75')](_0x448a5a[_0x3590('0x31')][_0x3590('0x71')][_0x3590('0x76')]())+_0x3590('0x77')][_0x3590('0x2c')]);_0x2930be[_0x3590('0x31')]=_[_0x3590('0x32')](_0x448a5a[_0x3590('0x31')]);_0x2930be[_0x3590('0x33')]=_[_0x3590('0x34')](_0x2930be[_0x3590('0x2f')],_0x2930be[_0x3590('0x31')]);_0x352dd9['attributes']=_['intersection'](_0x2930be[_0x3590('0x2f')],qs['fields'](_0x448a5a['query'][_0x3590('0x36')]));_0x352dd9[_0x3590('0x35')]=_0x352dd9['attributes']['length']?_0x352dd9[_0x3590('0x35')]:_0x2930be[_0x3590('0x2f')];_0x352dd9[_0x3590('0x39')]=qs[_0x3590('0x39')](_0x448a5a['query'][_0x3590('0x39')]);_0x352dd9[_0x3590('0x1e')]=qs[_0x3590('0x1e')](_0x448a5a[_0x3590('0x31')][_0x3590('0x1e')]);_0x352dd9['order']=qs[_0x3590('0x3b')](_0x448a5a['query'][_0x3590('0x3b')]);_0x352dd9['where']=qs[_0x3590('0x33')](_[_0x3590('0x3d')](_0x448a5a['query'],_0x2930be[_0x3590('0x33')]));_0x352dd9=_[_0x3590('0x3f')]({},_0x352dd9,_0x448a5a[_0x3590('0x41')]);return _0x1bc8f3['get'+_[_0x3590('0x75')](_0x448a5a[_0x3590('0x31')][_0x3590('0x71')][_0x3590('0x76')]())+_0x3590('0x78')](_0x352dd9);})[_0x3590('0x27')](respondWithResult(_0x2e757d,null))[_0x3590('0x45')](handleError(_0x2e757d,null));};exports[_0x3590('0x79')]=function(_0x5edd8b,_0x10cdce,_0x397763){return db[_0x3590('0x2b')][_0x3590('0x6f')]({'where':{'id':_0x5edd8b[_0x3590('0x70')]['id']}})[_0x3590('0x27')](function(_0x271b93){if(_0x271b93){if(!_0x5edd8b[_0x3590('0x52')][_0x3590('0x71')]||!utils[_0x3590('0x72')](_0x5edd8b[_0x3590('0x52')][_0x3590('0x71')])){throw new db[(_0x3590('0x59'))]['ValidationError'](_0x3590('0x74'));}return _0x271b93[_0x3590('0x7a')+_[_0x3590('0x75')](_0x5edd8b['body'][_0x3590('0x71')]['toLowerCase']())+_0x3590('0x78')](_0x5edd8b[_0x3590('0x52')][_0x3590('0x7b')]);}return null;})[_0x3590('0x27')](handleEntityNotFound(_0x10cdce,null))[_0x3590('0x27')](respondWithStatusCode(_0x10cdce,null))[_0x3590('0x45')](handleError(_0x10cdce,null));};exports[_0x3590('0x7c')]=function(_0x40ff4f,_0x5b2e8a,_0x8167d1){return db[_0x3590('0x2b')][_0x3590('0x6f')]({'where':{'id':_0x40ff4f[_0x3590('0x70')]['id']}})[_0x3590('0x27')](function(_0x4494ec){if(_0x4494ec){if(!_0x40ff4f[_0x3590('0x31')]['channel']||!utils['isValidChannel'](_0x40ff4f[_0x3590('0x31')][_0x3590('0x71')])){throw new db['Sequelize'][(_0x3590('0x73'))](_0x3590('0x74'));}return _0x4494ec[_0x3590('0x7d')+_[_0x3590('0x75')](_0x40ff4f[_0x3590('0x31')]['channel'][_0x3590('0x76')]())+_0x3590('0x78')](_0x40ff4f[_0x3590('0x31')][_0x3590('0x7b')]);}return null;})['then'](handleEntityNotFound(_0x5b2e8a,null))[_0x3590('0x27')](respondWithStatusCode(_0x5b2e8a,null))['catch'](handleError(_0x5b2e8a,null));};exports['addAgents']=function(_0x5059db,_0x1300c3){var _0x45f12e=_[_0x3590('0x7e')](_0x5059db['body']['ids'])?_0x5059db[_0x3590('0x52')]['ids']:[_0x5059db[_0x3590('0x52')][_0x3590('0x7b')]];var _0x419fc3=_0x5059db[_0x3590('0x70')]['id'];return db[_0x3590('0x2b')][_0x3590('0x47')]({'where':{'id':_0x419fc3}})[_0x3590('0x27')](handleEntityNotFound(_0x1300c3,null))[_0x3590('0x27')](function(_0x4908bb){if(_0x4908bb){var _0x42c153=[_0x3590('0x7f'),_0x3590('0x80'),_0x3590('0x81'),'Sms','Fax',_0x3590('0x82'),_0x3590('0x83')];return db[_0x3590('0x58')][_0x3590('0x84')](function(_0x1643d5){var _0x4f85d2=_[_0x3590('0x30')](_0x42c153,function(_0x2e1f06){var _0x2121b9={'attributes':['id',_0x3590('0x29')]};if(_0x2e1f06==='Voice'){_0x2121b9[_0x3590('0x85')]={'attributes':['penalty']};}return _0x4908bb['get'+_0x2e1f06+_0x3590('0x78')](_0x2121b9)[_0x3590('0x27')](function(_0x318895){var _0x124065=_[_0x3590('0x30')](_0x318895,function(_0x30ddaa){var _0x272db4=_[_0x3590('0x30')](_0x45f12e,function(_0x4e243d){var _0x1a673d={'where':{'UserId':_0x4e243d,[_0x2e1f06+_0x3590('0x86')]:_0x30ddaa['id']},'transaction':_0x1643d5};if(_0x2e1f06===_0x3590('0x7f')){_0x1a673d[_0x3590('0x19')]={'penalty':_0x30ddaa[_0x3590('0x87')]['penalty']};}return db[_0x3590('0x88')+_0x2e1f06+_0x3590('0x77')][_0x3590('0x89')](_0x1a673d)['then'](function(){socket[_0x3590('0x8a')](_0x3590('0x4b')+_0x2e1f06+_0x3590('0x8b'),{'UserId':_0x4e243d,[_0x2e1f06+_0x3590('0x86')]:_0x30ddaa['id']});if(_0x2e1f06!==_0x3590('0x7f')){return;}return db[_0x3590('0x88')][_0x3590('0x44')]({'where':{'id':_0x45f12e,'online':0x1},'attributes':['id',_0x3590('0x29'),_0x3590('0x8c'),_0x3590('0x8d'),_0x3590('0x8e')],'raw':!![]})['then'](function(_0x1b0074){var _0x123d37=_['map'](_0x1b0074,function(_0x51f643){return db['UserVoiceQueueRt'][_0x3590('0x8f')]({'membername':_0x51f643['name'],'UserId':_0x51f643['id'],'queue_name':_0x30ddaa[_0x3590('0x29')],'VoiceQueueId':_0x30ddaa['id'],'interface':_[_0x3590('0x90')](_0x51f643[_0x3590('0x8e')])?util[_0x3590('0x91')](_0x3590('0x92'),_0x51f643['name']):_0x51f643[_0x3590('0x8e')],'paused':_0x51f643[_0x3590('0x8d')]||![],'penalty':_0x30ddaa[_0x3590('0x87')]['penalty']},{'transaction':_0x1643d5});});return Promise[_0x3590('0x93')](_0x123d37);});});});return Promise[_0x3590('0x93')](_0x272db4);});return Promise['all'](_0x124065);})[_0x3590('0x27')](function(){return db[_0x3590('0x6c')][_0x3590('0x6f')]({'where':{'teamId':_0x419fc3}})['then'](function(_0x3d89e8){if(_0x3d89e8){var _0x5b5da5=_[_0x3590('0x30')](_0x45f12e,function(_0x257ced){db['UserVoicePrefix'][_0x3590('0x8f')]({'UserId':_0x257ced,'VoicePrefixId':_0x3d89e8['VoicePrefixId']});});return Promise[_0x3590('0x93')](_0x5b5da5);}});});});return Promise[_0x3590('0x93')](_0x4f85d2)[_0x3590('0x27')](function(){return _0x4908bb[_0x3590('0x94')](_0x45f12e,{'transaction':_0x1643d5})[_0x3590('0x95')](function(_0x538a96){return _0x538a96;});});});}})[_0x3590('0x27')](respondWithResult(_0x1300c3,null))[_0x3590('0x45')](handleError(_0x1300c3,null));};exports[_0x3590('0x96')]=function(_0x9aecab,_0x229ebc){var _0xf530ac=_['isArray'](_0x9aecab[_0x3590('0x31')][_0x3590('0x7b')])?_0x9aecab[_0x3590('0x31')]['ids']:[_0x9aecab[_0x3590('0x31')]['ids']];var _0xa7d0d=_0x9aecab[_0x3590('0x70')]['id'];return db['Team']['find']({'where':{'id':_0xa7d0d}})[_0x3590('0x27')](handleEntityNotFound(_0x229ebc,null))[_0x3590('0x27')](function(_0x1a9d61){if(_0x1a9d61){var _0x10256b=[_0x3590('0x7f'),_0x3590('0x80'),_0x3590('0x81'),_0x3590('0x97'),_0x3590('0x98'),_0x3590('0x82'),_0x3590('0x83')];return db[_0x3590('0x58')][_0x3590('0x84')](function(_0x49dd34){var _0x385114=_[_0x3590('0x30')](_0x10256b,function(_0x229d85){var _0x58c3e4={'attributes':['id',_0x3590('0x29')]};return _0x1a9d61['get'+_0x229d85+_0x3590('0x78')](_0x58c3e4)[_0x3590('0x27')](function(_0x5d33a1){var _0x405e46=_[_0x3590('0x30')](_0x5d33a1,function(_0x38b963){return _0x38b963[_0x3590('0x96')](_0xf530ac,{'transaction':_0x49dd34})[_0x3590('0x27')](function(){var _0x1909d7=_['map'](_0xf530ac,function(_0x169815){socket['emit'](_0x3590('0x4b')+_0x229d85+_0x3590('0x99'),{'UserId':Number(_0x169815),[_0x229d85+_0x3590('0x86')]:_0x38b963['id']});if(_0x229d85!=='Voice'){return;}return db[_0x3590('0x9a')][_0x3590('0x53')]({'where':{'VoiceQueueId':_0x38b963['id'],'UserId':_0x169815},'transaction':_0x49dd34});});return Promise[_0x3590('0x93')](_0x1909d7);});});return Promise[_0x3590('0x93')](_0x405e46);});});return Promise[_0x3590('0x93')](_0x385114)[_0x3590('0x27')](function(){return _0x1a9d61[_0x3590('0x96')](_0xf530ac,{'transaction':_0x49dd34});})['then'](function(){return db[_0x3590('0x6c')]['findOne']({'where':{'teamId':_0xa7d0d}})[_0x3590('0x27')](function(_0x3503bf){if(_0x3503bf){var _0x148709=_[_0x3590('0x30')](_0xf530ac,function(_0x22d9d7){db[_0x3590('0x9b')][_0x3590('0x53')]({'where':{'UserId':_0x22d9d7,'VoicePrefixId':_0x3503bf[_0x3590('0x9c')]}});});return Promise[_0x3590('0x93')](_0x148709);}});});});}})[_0x3590('0x27')](respondWithStatusCode(_0x229ebc,null))[_0x3590('0x45')](handleError(_0x229ebc,null));};exports[_0x3590('0x9d')]=function(_0x1cf936,_0x4ae356,_0x413270){var _0x58549c={};var _0x2cbb5a={};var _0xe71a7;var _0x2fba47;return db['Team'][_0x3590('0x6f')]({'where':{'id':_0x1cf936[_0x3590('0x70')]['id']}})[_0x3590('0x27')](handleEntityNotFound(_0x4ae356,null))[_0x3590('0x27')](function(_0x2b6afc){if(_0x2b6afc){_0xe71a7=_0x2b6afc;_0x2cbb5a[_0x3590('0x2f')]=_[_0x3590('0x32')](db[_0x3590('0x88')][_0x3590('0x2c')]);_0x2cbb5a['query']=_[_0x3590('0x32')](_0x1cf936[_0x3590('0x31')]);_0x2cbb5a['filters']=_['intersection'](_0x2cbb5a[_0x3590('0x2f')],_0x2cbb5a[_0x3590('0x31')]);_0x58549c[_0x3590('0x35')]=_[_0x3590('0x34')](_0x2cbb5a[_0x3590('0x2f')],qs[_0x3590('0x36')](_0x1cf936[_0x3590('0x31')][_0x3590('0x36')]));_0x58549c['attributes']=_0x58549c['attributes'][_0x3590('0x37')]?_0x58549c[_0x3590('0x35')]:_0x2cbb5a[_0x3590('0x2f')];_0x58549c[_0x3590('0x3a')]=qs[_0x3590('0x3b')](_0x1cf936[_0x3590('0x31')][_0x3590('0x3b')]);_0x58549c[_0x3590('0x3c')]=qs['filters'](_[_0x3590('0x3d')](_0x1cf936['query'],_0x2cbb5a[_0x3590('0x33')]));if(_0x1cf936[_0x3590('0x31')][_0x3590('0x3e')]){_0x58549c[_0x3590('0x3c')]=_[_0x3590('0x3f')](_0x58549c[_0x3590('0x3c')],{'$or':_[_0x3590('0x30')](_0x58549c['attributes'],function(_0x2f756b){var _0x5e529d={};_0x5e529d[_0x2f756b]={'$like':'%'+_0x1cf936[_0x3590('0x31')][_0x3590('0x3e')]+'%'};return _0x5e529d;})});}_0x58549c=_[_0x3590('0x3f')]({},_0x58549c,_0x1cf936[_0x3590('0x41')]);return _0xe71a7[_0x3590('0x9d')](_0x58549c);}})['then'](function(_0x1f51bf){if(_0x1f51bf){_0x2fba47=_0x1f51bf[_0x3590('0x37')];if(!_0x1cf936['query'][_0x3590('0x9e')](_0x3590('0x38'))){_0x58549c[_0x3590('0x39')]=qs['limit'](_0x1cf936['query'][_0x3590('0x39')]);_0x58549c[_0x3590('0x1e')]=qs[_0x3590('0x1e')](_0x1cf936[_0x3590('0x31')][_0x3590('0x1e')]);}return _0xe71a7[_0x3590('0x9d')](_0x58549c);}})['then'](function(_0x2a9be1){if(_0x2a9be1){return _0x2a9be1?{'count':_0x2fba47,'rows':_0x2a9be1}:null;}})[_0x3590('0x27')](respondWithResult(_0x4ae356,null))['catch'](handleError(_0x4ae356,null));};
\ No newline at end of file
+var _0x491c=['length','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','update','destroy','sequelize','transaction','Sequelize','QueryTypes','SELECT','UserId','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','UserVoicePrefix','VoicePrefixId','end','send','getQueues','findOne','channel','ValidationError','Unknown\x20channel','capitalize','pick','toLowerCase','Queues','addQueues','add','ids','removeQueues','addAgents','isArray','Voice','Chat','Mail','Fax','Openchannel','Whatsapp','through','penalty','QueueId','defaults','TeamVoiceQueue','Queue','emit','online','voicePause','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','all','removeAgents','Sms','Queue:remove','TeamVoicePrefix','getAgents','User','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','crypto','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','register','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','sendStatus','error','stack','name','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Team','includeAll','include','findAll','show','params','rawAttributes'];(function(_0x304bf7,_0x4fcafc){var _0x5036cd=function(_0x39e810){while(--_0x39e810){_0x304bf7['push'](_0x304bf7['shift']());}};_0x5036cd(++_0x4fcafc);}(_0x491c,0xf0));var _0xc491=function(_0x431883,_0x50e077){_0x431883=_0x431883-0x0;var _0x44a3ee=_0x491c[_0x431883];return _0x44a3ee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc491('0x0'));var zipdir=require(_0xc491('0x1'));var jsonpatch=require(_0xc491('0x2'));var rp=require(_0xc491('0x3'));var moment=require(_0xc491('0x4'));var BPromise=require(_0xc491('0x5'));var Mustache=require(_0xc491('0x6'));var util=require(_0xc491('0x7'));var path=require('path');var sox=require(_0xc491('0x8'));var csv=require(_0xc491('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc491('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc491('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc491('0xc'));var Papa=require(_0xc491('0xd'));var Redis=require(_0xc491('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc491('0xf'));var hardwareService=require(_0xc491('0x10'));var logger=require(_0xc491('0x11'))(_0xc491('0x12'));var utils=require(_0xc491('0x13'));var config=require(_0xc491('0x14'));var licenseUtil=require(_0xc491('0x15'));var db=require(_0xc491('0x16'))['db'];config[_0xc491('0x17')]=_['defaults'](config['redis'],{'host':_0xc491('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc491('0x17')]));require('./team.socket')[_0xc491('0x19')](socket);function respondWithStatusCode(_0x506997,_0xa8d986){_0xa8d986=_0xa8d986||0xcc;return function(_0x1c7e82){if(_0x1c7e82){return _0x506997['sendStatus'](_0xa8d986);}return _0x506997[_0xc491('0x1a')](_0xa8d986)['end']();};}function respondWithResult(_0x40f37e,_0xfb7fe6){_0xfb7fe6=_0xfb7fe6||0xc8;return function(_0x45a1b6){if(_0x45a1b6){return _0x40f37e[_0xc491('0x1a')](_0xfb7fe6)[_0xc491('0x1b')](_0x45a1b6);}};}function respondWithFilteredResult(_0x4801c5,_0x405120){return function(_0x36bad5){if(_0x36bad5){var _0x41682f=typeof _0x405120[_0xc491('0x1c')]===_0xc491('0x1d')&&typeof _0x405120[_0xc491('0x1e')]===_0xc491('0x1d');var _0x2386a6=_0x36bad5[_0xc491('0x1f')];var _0x5dd266=_0x41682f?0x0:_0x405120[_0xc491('0x1c')];var _0x17a6a1=_0x41682f?_0x36bad5['count']:_0x405120['offset']+_0x405120[_0xc491('0x1e')];var _0x1a3647;if(_0x17a6a1>=_0x2386a6){_0x17a6a1=_0x2386a6;_0x1a3647=0xc8;}else{_0x1a3647=0xce;}_0x4801c5['status'](_0x1a3647);return _0x4801c5['set'](_0xc491('0x20'),_0x5dd266+'-'+_0x17a6a1+'/'+_0x2386a6)[_0xc491('0x1b')](_0x36bad5);}return null;};}function patchUpdates(_0x5d6540){return function(_0x5441bc){try{jsonpatch[_0xc491('0x21')](_0x5441bc,_0x5d6540,!![]);}catch(_0x20d6a5){return BPromise[_0xc491('0x22')](_0x20d6a5);}return _0x5441bc['save']();};}function saveUpdates(_0x19f266,_0x1733ae){return function(_0x17ba46){if(_0x17ba46){return _0x17ba46['update'](_0x19f266)[_0xc491('0x23')](function(_0x573a65){return _0x573a65;});}return null;};}function handleEntityNotFound(_0x3db6cb,_0x161397){return function(_0x7c678a){if(!_0x7c678a){_0x3db6cb[_0xc491('0x24')](0x194);}return _0x7c678a;};}function handleError(_0x1f27de,_0x1287df){_0x1287df=_0x1287df||0x1f4;return function(_0x1be8a3){logger[_0xc491('0x25')](_0x1be8a3[_0xc491('0x26')]);if(_0x1be8a3['name']){delete _0x1be8a3[_0xc491('0x27')];}_0x1f27de[_0xc491('0x1a')](_0x1287df)['send'](_0x1be8a3);};}exports[_0xc491('0x28')]=function(_0x232fec,_0x450d12){var _0x1da815={},_0x4f5b26={},_0x2d2f1f={'count':0x0,'rows':[]};var _0x2e3f3e=_[_0xc491('0x29')](db['Team']['rawAttributes'],function(_0x3fc40e){return{'name':_0x3fc40e[_0xc491('0x2a')],'type':_0x3fc40e[_0xc491('0x2b')][_0xc491('0x2c')]};});_0x4f5b26[_0xc491('0x2d')]=_[_0xc491('0x29')](_0x2e3f3e,_0xc491('0x27'));_0x4f5b26[_0xc491('0x2e')]=_[_0xc491('0x2f')](_0x232fec[_0xc491('0x2e')]);_0x4f5b26[_0xc491('0x30')]=_[_0xc491('0x31')](_0x4f5b26[_0xc491('0x2d')],_0x4f5b26[_0xc491('0x2e')]);_0x1da815[_0xc491('0x32')]=_['intersection'](_0x4f5b26[_0xc491('0x2d')],qs[_0xc491('0x33')](_0x232fec[_0xc491('0x2e')][_0xc491('0x33')]));_0x1da815[_0xc491('0x32')]=_0x1da815[_0xc491('0x32')]['length']?_0x1da815[_0xc491('0x32')]:_0x4f5b26[_0xc491('0x2d')];if(!_0x232fec['query'][_0xc491('0x34')](_0xc491('0x35'))){_0x1da815['limit']=qs['limit'](_0x232fec[_0xc491('0x2e')][_0xc491('0x1e')]);_0x1da815[_0xc491('0x1c')]=qs['offset'](_0x232fec[_0xc491('0x2e')]['offset']);}_0x1da815[_0xc491('0x36')]=qs['sort'](_0x232fec[_0xc491('0x2e')][_0xc491('0x37')]);_0x1da815[_0xc491('0x38')]=qs[_0xc491('0x30')](_['pick'](_0x232fec[_0xc491('0x2e')],_0x4f5b26[_0xc491('0x30')]),_0x2e3f3e);if(_0x232fec[_0xc491('0x2e')][_0xc491('0x39')]){_0x1da815[_0xc491('0x38')]=_[_0xc491('0x3a')](_0x1da815['where'],{'$or':_[_0xc491('0x29')](_0x2e3f3e,function(_0x3d7d58){if(_0x3d7d58[_0xc491('0x2b')]!==_0xc491('0x3b')){var _0x33002b={};_0x33002b[_0x3d7d58[_0xc491('0x27')]]={'$like':'%'+_0x232fec[_0xc491('0x2e')][_0xc491('0x39')]+'%'};return _0x33002b;}})});}_0x1da815=_[_0xc491('0x3a')]({},_0x1da815,_0x232fec[_0xc491('0x3c')]);var _0x1dfa70={'where':_0x1da815[_0xc491('0x38')]};return db[_0xc491('0x3d')][_0xc491('0x1f')](_0x1dfa70)[_0xc491('0x23')](function(_0x2c0504){_0x2d2f1f['count']=_0x2c0504;if(_0x232fec['query'][_0xc491('0x3e')]){_0x1da815[_0xc491('0x3f')]=[{'all':!![]}];}return db['Team'][_0xc491('0x40')](_0x1da815);})[_0xc491('0x23')](function(_0x4ae5e2){_0x2d2f1f['rows']=_0x4ae5e2;return _0x2d2f1f;})[_0xc491('0x23')](respondWithFilteredResult(_0x450d12,_0x1da815))['catch'](handleError(_0x450d12,null));};exports[_0xc491('0x41')]=function(_0x441c07,_0x3d6096){var _0x13ee46={'raw':![],'where':{'id':_0x441c07[_0xc491('0x42')]['id']}},_0x487250={};_0x487250[_0xc491('0x2d')]=_['keys'](db[_0xc491('0x3d')][_0xc491('0x43')]);_0x487250[_0xc491('0x2e')]=_[_0xc491('0x2f')](_0x441c07[_0xc491('0x2e')]);_0x487250[_0xc491('0x30')]=_[_0xc491('0x31')](_0x487250[_0xc491('0x2d')],_0x487250[_0xc491('0x2e')]);_0x13ee46[_0xc491('0x32')]=_['intersection'](_0x487250[_0xc491('0x2d')],qs['fields'](_0x441c07[_0xc491('0x2e')][_0xc491('0x33')]));_0x13ee46[_0xc491('0x32')]=_0x13ee46[_0xc491('0x32')][_0xc491('0x44')]?_0x13ee46['attributes']:_0x487250[_0xc491('0x2d')];if(_0x441c07['query'][_0xc491('0x3e')]){_0x13ee46[_0xc491('0x3f')]=[{'all':!![]}];}_0x13ee46=_[_0xc491('0x3a')]({},_0x13ee46,_0x441c07['options']);return db[_0xc491('0x3d')][_0xc491('0x45')](_0x13ee46)['then'](handleEntityNotFound(_0x3d6096,null))[_0xc491('0x23')](respondWithResult(_0x3d6096,null))[_0xc491('0x46')](handleError(_0x3d6096,null));};exports[_0xc491('0x47')]=function(_0x3d4c6a,_0x4763c5){return db[_0xc491('0x3d')][_0xc491('0x47')](_0x3d4c6a[_0xc491('0x48')],{})['then'](function(_0x1223a7){var _0x36d552=_0x3d4c6a[_0xc491('0x49')][_0xc491('0x4a')]({'plain':!![]});if(!_0x36d552)throw new Error(_0xc491('0x4b'));if(_0x36d552[_0xc491('0x4c')]===_0xc491('0x49')){var _0x26a7ec=_0x1223a7[_0xc491('0x4a')]({'plain':!![]});var _0x808dfc=_0xc491('0x4d');return db[_0xc491('0x4e')][_0xc491('0x45')]({'where':{'name':_0x808dfc,'userProfileId':_0x36d552[_0xc491('0x4f')]},'raw':!![]})[_0xc491('0x23')](function(_0x4911a1){if(_0x4911a1&&_0x4911a1[_0xc491('0x50')]===0x0){return db[_0xc491('0x51')][_0xc491('0x47')]({'name':_0x26a7ec[_0xc491('0x27')],'resourceId':_0x26a7ec['id'],'type':_0x4911a1[_0xc491('0x27')],'sectionId':_0x4911a1['id']},{})['then'](function(){return _0x1223a7;});}else{return _0x1223a7;}})[_0xc491('0x46')](function(_0x271b39){logger[_0xc491('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x271b39);throw _0x271b39;});}return _0x1223a7;})[_0xc491('0x23')](respondWithResult(_0x4763c5,0xc9))[_0xc491('0x46')](handleError(_0x4763c5,null));};exports[_0xc491('0x52')]=function(_0x3eb8c5,_0x18684f){if(_0x3eb8c5[_0xc491('0x48')]['id']){delete _0x3eb8c5[_0xc491('0x48')]['id'];}return db[_0xc491('0x3d')]['find']({'where':{'id':_0x3eb8c5[_0xc491('0x42')]['id']}})[_0xc491('0x23')](handleEntityNotFound(_0x18684f,null))[_0xc491('0x23')](saveUpdates(_0x3eb8c5[_0xc491('0x48')],null))['then'](respondWithResult(_0x18684f,null))[_0xc491('0x46')](handleError(_0x18684f,null));};exports[_0xc491('0x53')]=function(_0x14f05d,_0x515be5){var _0x5c9268=_0x14f05d[_0xc491('0x42')]['id'];var _0x384c41=[];return db[_0xc491('0x54')][_0xc491('0x55')](function(_0x276894){var _0x5887f6='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x5c9268;return db[_0xc491('0x54')]['query'](_0x5887f6,{'type':db[_0xc491('0x56')][_0xc491('0x57')][_0xc491('0x58')],'raw':!![],'transaction':_0x276894})[_0xc491('0x23')](function(_0x5cb336){_0x384c41=_['map'](_0x5cb336,function(_0x23df8a){return Number(_0x23df8a[_0xc491('0x59')]);});})[_0xc491('0x23')](function(){var _0x1797fc='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x5c9268;return db['sequelize'][_0xc491('0x2e')](_0x1797fc,{'type':db['Sequelize'][_0xc491('0x57')][_0xc491('0x58')],'raw':!![],'transaction':_0x276894});})[_0xc491('0x23')](function(_0x2e1afa){var _0x338181=_['map'](_0x2e1afa,function(_0x3a317d){return Number(_0x3a317d[_0xc491('0x5a')]);});return db[_0xc491('0x5b')][_0xc491('0x53')]({'where':{'UserId':{'$in':_0x384c41},'VoiceQueueId':{'$in':_0x338181}},'transaction':_0x276894});})[_0xc491('0x23')](function(){var _0x247d8c=_0xc491('0x5c')+_0x5c9268;return db['sequelize']['query'](_0x247d8c,{'type':db[_0xc491('0x56')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x276894});})[_0xc491('0x23')](function(_0x2c8caa){var _0x46c471=_['map'](_0x2c8caa,function(_0x35a320){return Number(_0x35a320[_0xc491('0x5d')]);});return db[_0xc491('0x5e')][_0xc491('0x53')]({'where':{'UserId':{'$in':_0x384c41},'MailQueueId':{'$in':_0x46c471}},'transaction':_0x276894});})['then'](function(){var _0x1db542='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x5c9268;return db['sequelize'][_0xc491('0x2e')](_0x1db542,{'type':db[_0xc491('0x56')][_0xc491('0x57')][_0xc491('0x58')],'raw':!![],'transaction':_0x276894});})[_0xc491('0x23')](function(_0x1414f5){var _0x45cfbd=_[_0xc491('0x29')](_0x1414f5,function(_0x16e430){return Number(_0x16e430[_0xc491('0x5f')]);});return db[_0xc491('0x60')][_0xc491('0x53')]({'where':{'UserId':{'$in':_0x384c41},'SmsQueueId':{'$in':_0x45cfbd}},'transaction':_0x276894});})[_0xc491('0x23')](function(){var _0x56f79a=_0xc491('0x61')+_0x5c9268;return db[_0xc491('0x54')][_0xc491('0x2e')](_0x56f79a,{'type':db[_0xc491('0x56')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x276894});})[_0xc491('0x23')](function(_0x4eb1ac){var _0x61ab69=_[_0xc491('0x29')](_0x4eb1ac,function(_0x581a52){return Number(_0x581a52[_0xc491('0x62')]);});return db[_0xc491('0x63')]['destroy']({'where':{'UserId':{'$in':_0x384c41},'ChatQueueId':{'$in':_0x61ab69}},'transaction':_0x276894});})[_0xc491('0x23')](function(){var _0x36683f='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x5c9268;return db[_0xc491('0x54')][_0xc491('0x2e')](_0x36683f,{'type':db['Sequelize']['QueryTypes'][_0xc491('0x58')],'raw':!![],'transaction':_0x276894});})[_0xc491('0x23')](function(_0x3241cd){var _0x4450a9=_[_0xc491('0x29')](_0x3241cd,function(_0x28a0bb){return Number(_0x28a0bb[_0xc491('0x64')]);});return db[_0xc491('0x65')][_0xc491('0x53')]({'where':{'UserId':{'$in':_0x384c41},'FaxQueueId':{'$in':_0x4450a9}},'transaction':_0x276894});})[_0xc491('0x23')](function(){var _0x2ba41d=_0xc491('0x66')+_0x5c9268;return db[_0xc491('0x54')][_0xc491('0x2e')](_0x2ba41d,{'type':db[_0xc491('0x56')][_0xc491('0x57')]['SELECT'],'raw':!![],'transaction':_0x276894});})[_0xc491('0x23')](function(_0x5168f4){var _0x280d8c=_[_0xc491('0x29')](_0x5168f4,function(_0x15b18a){return Number(_0x15b18a[_0xc491('0x67')]);});return db[_0xc491('0x68')]['destroy']({'where':{'UserId':{'$in':_0x384c41},'OpenchannelQueueId':{'$in':_0x280d8c}},'transaction':_0x276894});})['then'](function(){var _0x2a83aa=_0xc491('0x69')+_0x5c9268;return db[_0xc491('0x54')][_0xc491('0x2e')](_0x2a83aa,{'type':db[_0xc491('0x56')][_0xc491('0x57')][_0xc491('0x58')],'raw':!![],'transaction':_0x276894});})['then'](function(_0x5db1c2){var _0x20cde8=_['map'](_0x5db1c2,function(_0x24eefe){return Number(_0x24eefe[_0xc491('0x6a')]);});return db[_0xc491('0x6b')]['destroy']({'where':{'UserId':{'$in':_0x384c41},'WhatsappQueueId':{'$in':_0x20cde8}},'transaction':_0x276894});})[_0xc491('0x23')](function(){return db['TeamVoicePrefix']['find']({'where':{'TeamId':_0x5c9268}});})[_0xc491('0x23')](function(_0x3c1d21){if(_0x3c1d21===null){return;}return db[_0xc491('0x6c')][_0xc491('0x53')]({'where':{'UserId':{'$in':_0x384c41},'VoicePrefixId':_0x3c1d21[_0xc491('0x6d')]},'transaction':_0x276894});})[_0xc491('0x23')](function(){return db[_0xc491('0x3d')][_0xc491('0x53')]({'where':{'id':_0x5c9268},'cascade':!![],'transaction':_0x276894});})[_0xc491('0x23')](function(_0xb35e74){if(_0xb35e74===0x0){_0x515be5[_0xc491('0x24')](0x194);}else{return db[_0xc491('0x51')]['destroy']({'where':{'type':_0xc491('0x4d'),'resourceId':_0x5c9268},'cascade':!![],'transaction':_0x276894})[_0xc491('0x23')](function(){_0x515be5[_0xc491('0x1a')](0xcc)[_0xc491('0x6e')]();});}})[_0xc491('0x46')](function(_0xaf255c){_0x515be5[_0xc491('0x1a')](0x1f4)[_0xc491('0x6f')](_0xaf255c);});});};exports[_0xc491('0x70')]=function(_0x3013e3,_0x295239,_0x53ebe1){return db[_0xc491('0x3d')][_0xc491('0x71')]({'where':{'id':_0x3013e3[_0xc491('0x42')]['id']}})['then'](handleEntityNotFound(_0x295239,null))[_0xc491('0x23')](function(_0x4f97ef){if(!_0x3013e3[_0xc491('0x2e')][_0xc491('0x72')]||!utils['isValidChannel'](_0x3013e3['query']['channel'])){throw new db[(_0xc491('0x56'))][(_0xc491('0x73'))](_0xc491('0x74'));}var _0x51d11e={};var _0x127e44={};_0x127e44[_0xc491('0x2d')]=_[_0xc491('0x2f')](db[_[_0xc491('0x75')](_0x3013e3[_0xc491('0x2e')][_0xc491('0x72')]['toLowerCase']())+'Queue']['rawAttributes']);_0x127e44['query']=_['keys'](_0x3013e3['query']);_0x127e44[_0xc491('0x30')]=_[_0xc491('0x31')](_0x127e44[_0xc491('0x2d')],_0x127e44[_0xc491('0x2e')]);_0x51d11e[_0xc491('0x32')]=_[_0xc491('0x31')](_0x127e44[_0xc491('0x2d')],qs[_0xc491('0x33')](_0x3013e3[_0xc491('0x2e')][_0xc491('0x33')]));_0x51d11e['attributes']=_0x51d11e[_0xc491('0x32')][_0xc491('0x44')]?_0x51d11e[_0xc491('0x32')]:_0x127e44[_0xc491('0x2d')];_0x51d11e[_0xc491('0x1e')]=qs[_0xc491('0x1e')](_0x3013e3['query'][_0xc491('0x1e')]);_0x51d11e['offset']=qs['offset'](_0x3013e3['query'][_0xc491('0x1c')]);_0x51d11e[_0xc491('0x36')]=qs[_0xc491('0x37')](_0x3013e3[_0xc491('0x2e')]['sort']);_0x51d11e[_0xc491('0x38')]=qs[_0xc491('0x30')](_[_0xc491('0x76')](_0x3013e3[_0xc491('0x2e')],_0x127e44['filters']));_0x51d11e=_[_0xc491('0x3a')]({},_0x51d11e,_0x3013e3[_0xc491('0x3c')]);return _0x4f97ef[_0xc491('0x4a')+_['capitalize'](_0x3013e3['query'][_0xc491('0x72')][_0xc491('0x77')]())+_0xc491('0x78')](_0x51d11e);})[_0xc491('0x23')](respondWithResult(_0x295239,null))[_0xc491('0x46')](handleError(_0x295239,null));};exports[_0xc491('0x79')]=function(_0x48972b,_0x5df810,_0x5968ae){return db[_0xc491('0x3d')][_0xc491('0x71')]({'where':{'id':_0x48972b[_0xc491('0x42')]['id']}})['then'](function(_0x41c4eb){if(_0x41c4eb){if(!_0x48972b[_0xc491('0x48')][_0xc491('0x72')]||!utils['isValidChannel'](_0x48972b[_0xc491('0x48')]['channel'])){throw new db[(_0xc491('0x56'))][(_0xc491('0x73'))](_0xc491('0x74'));}return _0x41c4eb[_0xc491('0x7a')+_[_0xc491('0x75')](_0x48972b[_0xc491('0x48')][_0xc491('0x72')][_0xc491('0x77')]())+_0xc491('0x78')](_0x48972b['body'][_0xc491('0x7b')]);}return null;})[_0xc491('0x23')](handleEntityNotFound(_0x5df810,null))[_0xc491('0x23')](respondWithStatusCode(_0x5df810,null))[_0xc491('0x46')](handleError(_0x5df810,null));};exports[_0xc491('0x7c')]=function(_0x3a2eb4,_0x31ea6c,_0x42578f){return db[_0xc491('0x3d')][_0xc491('0x71')]({'where':{'id':_0x3a2eb4[_0xc491('0x42')]['id']}})[_0xc491('0x23')](function(_0x307b7f){if(_0x307b7f){if(!_0x3a2eb4['query'][_0xc491('0x72')]||!utils['isValidChannel'](_0x3a2eb4[_0xc491('0x2e')][_0xc491('0x72')])){throw new db['Sequelize'][(_0xc491('0x73'))](_0xc491('0x74'));}return _0x307b7f['remove'+_[_0xc491('0x75')](_0x3a2eb4[_0xc491('0x2e')][_0xc491('0x72')]['toLowerCase']())+'Queues'](_0x3a2eb4['query']['ids']);}return null;})[_0xc491('0x23')](handleEntityNotFound(_0x31ea6c,null))[_0xc491('0x23')](respondWithStatusCode(_0x31ea6c,null))[_0xc491('0x46')](handleError(_0x31ea6c,null));};exports[_0xc491('0x7d')]=function(_0x2782ea,_0x6044cc){var _0x339878=_[_0xc491('0x7e')](_0x2782ea['body'][_0xc491('0x7b')])?_0x2782ea[_0xc491('0x48')][_0xc491('0x7b')]:[_0x2782ea[_0xc491('0x48')][_0xc491('0x7b')]];var _0x3859cb=_0x2782ea[_0xc491('0x42')]['id'];return db[_0xc491('0x3d')][_0xc491('0x45')]({'where':{'id':_0x3859cb}})[_0xc491('0x23')](handleEntityNotFound(_0x6044cc,null))[_0xc491('0x23')](function(_0x1aabd2){if(_0x1aabd2){var _0x305164=[_0xc491('0x7f'),_0xc491('0x80'),_0xc491('0x81'),'Sms',_0xc491('0x82'),_0xc491('0x83'),_0xc491('0x84')];return db[_0xc491('0x54')][_0xc491('0x55')](function(_0x368da9){var _0x18cacb=_['map'](_0x305164,function(_0x1d5345){var _0x537bb1={'attributes':['id','name']};if(_0x1d5345==='Voice'){_0x537bb1[_0xc491('0x85')]={'attributes':[_0xc491('0x86')]};}return _0x1aabd2[_0xc491('0x4a')+_0x1d5345+_0xc491('0x78')](_0x537bb1)[_0xc491('0x23')](function(_0x3f1649){var _0x5c09b2=_[_0xc491('0x29')](_0x3f1649,function(_0x2458f0){var _0x15fefc=_['map'](_0x339878,function(_0x2d2f85){var _0x489316={'where':{'UserId':_0x2d2f85,[_0x1d5345+_0xc491('0x87')]:_0x2458f0['id']},'transaction':_0x368da9};if(_0x1d5345===_0xc491('0x7f')){_0x489316[_0xc491('0x88')]={'penalty':_0x2458f0[_0xc491('0x89')][_0xc491('0x86')]};}return db['User'+_0x1d5345+_0xc491('0x8a')]['findOrCreate'](_0x489316)['then'](function(){socket[_0xc491('0x8b')](_0xc491('0x49')+_0x1d5345+'Queue:save',{'UserId':_0x2d2f85,[_0x1d5345+_0xc491('0x87')]:_0x2458f0['id']});if(_0x1d5345!==_0xc491('0x7f')){return;}return db['User'][_0xc491('0x40')]({'where':{'id':_0x339878,'online':0x1},'attributes':['id','name',_0xc491('0x8c'),_0xc491('0x8d'),'interface'],'raw':!![]})[_0xc491('0x23')](function(_0x551676){var _0x4cd6ae=_['map'](_0x551676,function(_0x17de2b){return db[_0xc491('0x8e')][_0xc491('0x8f')]({'membername':_0x17de2b[_0xc491('0x27')],'UserId':_0x17de2b['id'],'queue_name':_0x2458f0[_0xc491('0x27')],'VoiceQueueId':_0x2458f0['id'],'interface':_[_0xc491('0x90')](_0x17de2b['interface'])?util[_0xc491('0x91')](_0xc491('0x92'),_0x17de2b['name']):_0x17de2b['interface'],'paused':_0x17de2b[_0xc491('0x8d')]||![],'penalty':_0x2458f0[_0xc491('0x89')][_0xc491('0x86')]},{'transaction':_0x368da9});});return Promise[_0xc491('0x93')](_0x4cd6ae);});});});return Promise[_0xc491('0x93')](_0x15fefc);});return Promise['all'](_0x5c09b2);})[_0xc491('0x23')](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x3859cb}})[_0xc491('0x23')](function(_0x1873e5){if(_0x1873e5){var _0x39c9a5=_[_0xc491('0x29')](_0x339878,function(_0x8f6151){db['UserVoicePrefix'][_0xc491('0x8f')]({'UserId':_0x8f6151,'VoicePrefixId':_0x1873e5[_0xc491('0x6d')]});});return Promise[_0xc491('0x93')](_0x39c9a5);}});});});return Promise['all'](_0x18cacb)[_0xc491('0x23')](function(){return _0x1aabd2[_0xc491('0x7d')](_0x339878,{'transaction':_0x368da9})['spread'](function(_0x5aed1c){return _0x5aed1c;});});});}})[_0xc491('0x23')](respondWithResult(_0x6044cc,null))[_0xc491('0x46')](handleError(_0x6044cc,null));};exports[_0xc491('0x94')]=function(_0x2dd952,_0x3c834d){var _0x4a465a=_[_0xc491('0x7e')](_0x2dd952[_0xc491('0x2e')][_0xc491('0x7b')])?_0x2dd952['query']['ids']:[_0x2dd952[_0xc491('0x2e')][_0xc491('0x7b')]];var _0x38e3a2=_0x2dd952[_0xc491('0x42')]['id'];return db[_0xc491('0x3d')][_0xc491('0x45')]({'where':{'id':_0x38e3a2}})[_0xc491('0x23')](handleEntityNotFound(_0x3c834d,null))['then'](function(_0x40b216){if(_0x40b216){var _0x3e9546=[_0xc491('0x7f'),'Chat','Mail',_0xc491('0x95'),'Fax',_0xc491('0x83'),_0xc491('0x84')];return db['sequelize'][_0xc491('0x55')](function(_0x5b90a9){var _0x1d2bb3=_['map'](_0x3e9546,function(_0x282cbf){var _0x518086={'attributes':['id',_0xc491('0x27')]};return _0x40b216[_0xc491('0x4a')+_0x282cbf+_0xc491('0x78')](_0x518086)[_0xc491('0x23')](function(_0x526980){var _0x1da458=_[_0xc491('0x29')](_0x526980,function(_0x41f213){return _0x41f213['removeAgents'](_0x4a465a,{'transaction':_0x5b90a9})['then'](function(){var _0xdfd28e=_[_0xc491('0x29')](_0x4a465a,function(_0x14b5d6){socket[_0xc491('0x8b')](_0xc491('0x49')+_0x282cbf+_0xc491('0x96'),{'UserId':Number(_0x14b5d6),[_0x282cbf+'QueueId']:_0x41f213['id']});if(_0x282cbf!==_0xc491('0x7f')){return;}return db[_0xc491('0x8e')]['destroy']({'where':{'VoiceQueueId':_0x41f213['id'],'UserId':_0x14b5d6},'transaction':_0x5b90a9});});return Promise[_0xc491('0x93')](_0xdfd28e);});});return Promise[_0xc491('0x93')](_0x1da458);});});return Promise[_0xc491('0x93')](_0x1d2bb3)[_0xc491('0x23')](function(){return _0x40b216['removeAgents'](_0x4a465a,{'transaction':_0x5b90a9});})[_0xc491('0x23')](function(){return db[_0xc491('0x97')][_0xc491('0x71')]({'where':{'teamId':_0x38e3a2}})['then'](function(_0x5895c0){if(_0x5895c0){var _0x1f01af=_[_0xc491('0x29')](_0x4a465a,function(_0x758423){db[_0xc491('0x6c')][_0xc491('0x53')]({'where':{'UserId':_0x758423,'VoicePrefixId':_0x5895c0['VoicePrefixId']}});});return Promise['all'](_0x1f01af);}});});});}})['then'](respondWithStatusCode(_0x3c834d,null))[_0xc491('0x46')](handleError(_0x3c834d,null));};exports[_0xc491('0x98')]=function(_0x141da2,_0x22a61e,_0x2bd948){var _0x5b136b={};var _0x4893a7={};var _0x518ba5;var _0x56d570;return db[_0xc491('0x3d')][_0xc491('0x71')]({'where':{'id':_0x141da2[_0xc491('0x42')]['id']}})[_0xc491('0x23')](handleEntityNotFound(_0x22a61e,null))[_0xc491('0x23')](function(_0x51dc5c){if(_0x51dc5c){_0x518ba5=_0x51dc5c;_0x4893a7[_0xc491('0x2d')]=_[_0xc491('0x2f')](db[_0xc491('0x99')][_0xc491('0x43')]);_0x4893a7[_0xc491('0x2e')]=_[_0xc491('0x2f')](_0x141da2[_0xc491('0x2e')]);_0x4893a7[_0xc491('0x30')]=_[_0xc491('0x31')](_0x4893a7[_0xc491('0x2d')],_0x4893a7[_0xc491('0x2e')]);_0x5b136b[_0xc491('0x32')]=_['intersection'](_0x4893a7[_0xc491('0x2d')],qs['fields'](_0x141da2[_0xc491('0x2e')][_0xc491('0x33')]));_0x5b136b[_0xc491('0x32')]=_0x5b136b[_0xc491('0x32')][_0xc491('0x44')]?_0x5b136b['attributes']:_0x4893a7[_0xc491('0x2d')];_0x5b136b[_0xc491('0x36')]=qs[_0xc491('0x37')](_0x141da2[_0xc491('0x2e')][_0xc491('0x37')]);_0x5b136b[_0xc491('0x38')]=qs[_0xc491('0x30')](_['pick'](_0x141da2[_0xc491('0x2e')],_0x4893a7['filters']));if(_0x141da2[_0xc491('0x2e')][_0xc491('0x39')]){_0x5b136b[_0xc491('0x38')]=_['merge'](_0x5b136b['where'],{'$or':_[_0xc491('0x29')](_0x5b136b[_0xc491('0x32')],function(_0x16b4b0){var _0x2b76d4={};_0x2b76d4[_0x16b4b0]={'$like':'%'+_0x141da2[_0xc491('0x2e')]['filter']+'%'};return _0x2b76d4;})});}_0x5b136b=_[_0xc491('0x3a')]({},_0x5b136b,_0x141da2[_0xc491('0x3c')]);return _0x518ba5[_0xc491('0x98')](_0x5b136b);}})[_0xc491('0x23')](function(_0x3004c1){if(_0x3004c1){_0x56d570=_0x3004c1[_0xc491('0x44')];if(!_0x141da2[_0xc491('0x2e')][_0xc491('0x34')]('nolimit')){_0x5b136b[_0xc491('0x1e')]=qs[_0xc491('0x1e')](_0x141da2[_0xc491('0x2e')][_0xc491('0x1e')]);_0x5b136b['offset']=qs[_0xc491('0x1c')](_0x141da2[_0xc491('0x2e')]['offset']);}return _0x518ba5[_0xc491('0x98')](_0x5b136b);}})[_0xc491('0x23')](function(_0x3013fb){if(_0x3013fb){return _0x3013fb?{'count':_0x56d570,'rows':_0x3013fb}:null;}})[_0xc491('0x23')](respondWithResult(_0x22a61e,null))[_0xc491('0x46')](handleError(_0x22a61e,null));};
\ No newline at end of file
index 4950526..ec68902 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b4d=['update','remove','emit','hook','exports','events','../../mysqldb','Team','setMaxListeners','save'];(function(_0x88a3af,_0x18566e){var _0x591e72=function(_0xc4f868){while(--_0xc4f868){_0x88a3af['push'](_0x88a3af['shift']());}};_0x591e72(++_0x18566e);}(_0x9b4d,0xe1));var _0xd9b4=function(_0x3eff40,_0x1cdf9e){_0x3eff40=_0x3eff40-0x0;var _0x4ee4fb=_0x9b4d[_0x3eff40];return _0x4ee4fb;};'use strict';var EventEmitter=require(_0xd9b4('0x0'));var Team=require(_0xd9b4('0x1'))['db'][_0xd9b4('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0xd9b4('0x3')](0x0);var events={'afterCreate':_0xd9b4('0x4'),'afterUpdate':_0xd9b4('0x5'),'afterDestroy':_0xd9b4('0x6')};function emitEvent(_0x33f53b){return function(_0x41fe84,_0x43d785,_0x30c7a3){TeamEvents[_0xd9b4('0x7')](_0x33f53b+':'+_0x41fe84['id'],_0x41fe84);TeamEvents[_0xd9b4('0x7')](_0x33f53b,_0x41fe84);_0x30c7a3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0xd9b4('0x8')](e,emitEvent(event));}}module[_0xd9b4('0x9')]=TeamEvents;
\ No newline at end of file
+var _0xef09=['Team','setMaxListeners','save','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x10d6ca,_0x265cfe){var _0x44cfe1=function(_0x4dfafd){while(--_0x4dfafd){_0x10d6ca['push'](_0x10d6ca['shift']());}};_0x44cfe1(++_0x265cfe);}(_0xef09,0x13e));var _0x9ef0=function(_0x3ae46d,_0x511296){_0x3ae46d=_0x3ae46d-0x0;var _0x52e8f9=_0xef09[_0x3ae46d];return _0x52e8f9;};'use strict';var EventEmitter=require(_0x9ef0('0x0'));var Team=require(_0x9ef0('0x1'))['db'][_0x9ef0('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x9ef0('0x3')](0x0);var events={'afterCreate':_0x9ef0('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5f1817){return function(_0x4bdfe9,_0x123840,_0x5df11){TeamEvents[_0x9ef0('0x5')](_0x5f1817+':'+_0x4bdfe9['id'],_0x4bdfe9);TeamEvents[_0x9ef0('0x5')](_0x5f1817,_0x4bdfe9);_0x5df11(null);};}for(var e in events){if(events[_0x9ef0('0x6')](e)){var event=events[e];Team[_0x9ef0('0x7')](e,emitEvent(event));}}module['exports']=TeamEvents;
\ No newline at end of file
index 6f7e33c..38ffc4f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20c3=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./team.attributes','exports','define','teams','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x20c3,0x1e0));var _0x320c=function(_0x219add,_0x35440b){_0x219add=_0x219add-0x0;var _0xef6fbc=_0x20c3[_0x219add];return _0xef6fbc;};'use strict';var _=require(_0x320c('0x0'));var util=require(_0x320c('0x1'));var logger=require(_0x320c('0x2'))(_0x320c('0x3'));var moment=require(_0x320c('0x4'));var BPromise=require(_0x320c('0x5'));var rp=require(_0x320c('0x6'));var fs=require('fs');var path=require(_0x320c('0x7'));var rimraf=require(_0x320c('0x8'));var config=require('../../config/environment');var attributes=require(_0x320c('0x9'));module[_0x320c('0xa')]=function(_0x5819b9,_0x23df24){return _0x5819b9[_0x320c('0xb')]('Team',attributes,{'tableName':_0x320c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x14db=['bluebird','path','../../config/environment','./team.attributes','exports','define','teams','lodash','util','../../config/logger','api'];(function(_0x57f8c0,_0x136cf6){var _0x117f08=function(_0x426cd4){while(--_0x426cd4){_0x57f8c0['push'](_0x57f8c0['shift']());}};_0x117f08(++_0x136cf6);}(_0x14db,0x1d5));var _0xb14d=function(_0x4927e0,_0x382c25){_0x4927e0=_0x4927e0-0x0;var _0x5d9c9d=_0x14db[_0x4927e0];return _0x5d9c9d;};'use strict';var _=require(_0xb14d('0x0'));var util=require(_0xb14d('0x1'));var logger=require(_0xb14d('0x2'))(_0xb14d('0x3'));var moment=require('moment');var BPromise=require(_0xb14d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb14d('0x5'));var rimraf=require('rimraf');var config=require(_0xb14d('0x6'));var attributes=require(_0xb14d('0x7'));module[_0xb14d('0x8')]=function(_0x3734c4,_0xfe0ba5){return _0x3734c4[_0xb14d('0x9')]('Team',attributes,{'tableName':_0xb14d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 253ad79..64cdde5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x025d=['client','http','redis','localhost','register','request','then','Team,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x368d7f,_0x1a5104){var _0x12754e=function(_0x2b6ae3){while(--_0x2b6ae3){_0x368d7f['push'](_0x368d7f['shift']());}};_0x12754e(++_0x1a5104);}(_0x025d,0x113));var _0xd025=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x025d[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xd025('0x0'));var util=require('util');var moment=require(_0xd025('0x1'));var BPromise=require(_0xd025('0x2'));var rs=require(_0xd025('0x3'));var fs=require('fs');var Redis=require(_0xd025('0x4'));var db=require(_0xd025('0x5'))['db'];var utils=require(_0xd025('0x6'));var logger=require(_0xd025('0x7'))(_0xd025('0x8'));var config=require(_0xd025('0x9'));var jayson=require(_0xd025('0xa'));var client=jayson[_0xd025('0xb')][_0xd025('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0xd025('0xd')],{'host':_0xd025('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd025('0xd')]));require('./team.socket')[_0xd025('0xf')](socket);function respondWithRpcPromise(_0x412be5,_0x1cecc7,_0x5e75da){return new BPromise(function(_0x2a3126,_0x3e1443){return client[_0xd025('0x10')](_0x412be5,_0x5e75da)[_0xd025('0x11')](function(_0x8cc466){logger['info'](_0xd025('0x12'),_0x1cecc7,_0xd025('0x13'));logger['debug']('Team,\x20%s,\x20%s,\x20%s',_0x1cecc7,_0xd025('0x13'),JSON[_0xd025('0x14')](_0x8cc466));if(_0x8cc466[_0xd025('0x15')]){if(_0x8cc466[_0xd025('0x15')][_0xd025('0x16')]===0x1f4){logger['error'](_0xd025('0x12'),_0x1cecc7,_0x8cc466[_0xd025('0x15')][_0xd025('0x17')]);return _0x3e1443(_0x8cc466[_0xd025('0x15')][_0xd025('0x17')]);}logger[_0xd025('0x15')](_0xd025('0x12'),_0x1cecc7,_0x8cc466['error'][_0xd025('0x17')]);return _0x2a3126(_0x8cc466[_0xd025('0x15')][_0xd025('0x17')]);}else{logger['info']('Team,\x20%s,\x20%s',_0x1cecc7,'request\x20sent');_0x2a3126(_0x8cc466[_0xd025('0x18')]['message']);}})[_0xd025('0x19')](function(_0x360e29){logger[_0xd025('0x15')](_0xd025('0x12'),_0x1cecc7,_0x360e29);_0x3e1443(_0x360e29);});});}
\ No newline at end of file
+var _0x7d54=['bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util'];(function(_0x6b7c75,_0xd601fc){var _0x4e1047=function(_0x440a6d){while(--_0x440a6d){_0x6b7c75['push'](_0x6b7c75['shift']());}};_0x4e1047(++_0xd601fc);}(_0x7d54,0x1c1));var _0x47d5=function(_0x2ffc98,_0x5a0140){_0x2ffc98=_0x2ffc98-0x0;var _0x1bb50a=_0x7d54[_0x2ffc98];return _0x1bb50a;};'use strict';var _=require('lodash');var util=require(_0x47d5('0x0'));var moment=require('moment');var BPromise=require(_0x47d5('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x47d5('0x2'))['db'];var utils=require(_0x47d5('0x3'));var logger=require(_0x47d5('0x4'))('rpc');var config=require(_0x47d5('0x5'));var jayson=require(_0x47d5('0x6'));var client=jayson['client'][_0x47d5('0x7')]({'port':0x232a});config[_0x47d5('0x8')]=_[_0x47d5('0x9')](config[_0x47d5('0x8')],{'host':_0x47d5('0xa'),'port':0x18eb});var socket=require(_0x47d5('0xb'))(new Redis(config[_0x47d5('0x8')]));require(_0x47d5('0xc'))[_0x47d5('0xd')](socket);function respondWithRpcPromise(_0x28bca5,_0x3f5c2a,_0x5e924f){return new BPromise(function(_0xa410de,_0x5dccda){return client['request'](_0x28bca5,_0x5e924f)['then'](function(_0x2a47a6){logger['info'](_0x47d5('0xe'),_0x3f5c2a,_0x47d5('0xf'));logger[_0x47d5('0x10')](_0x47d5('0x11'),_0x3f5c2a,_0x47d5('0xf'),JSON[_0x47d5('0x12')](_0x2a47a6));if(_0x2a47a6[_0x47d5('0x13')]){if(_0x2a47a6[_0x47d5('0x13')][_0x47d5('0x14')]===0x1f4){logger[_0x47d5('0x13')](_0x47d5('0xe'),_0x3f5c2a,_0x2a47a6[_0x47d5('0x13')][_0x47d5('0x15')]);return _0x5dccda(_0x2a47a6[_0x47d5('0x13')]['message']);}logger['error']('Team,\x20%s,\x20%s',_0x3f5c2a,_0x2a47a6[_0x47d5('0x13')][_0x47d5('0x15')]);return _0xa410de(_0x2a47a6[_0x47d5('0x13')][_0x47d5('0x15')]);}else{logger[_0x47d5('0x16')](_0x47d5('0xe'),_0x3f5c2a,_0x47d5('0xf'));_0xa410de(_0x2a47a6[_0x47d5('0x17')][_0x47d5('0x15')]);}})[_0x47d5('0x18')](function(_0x12e18f){logger[_0x47d5('0x13')](_0x47d5('0xe'),_0x3f5c2a,_0x12e18f);_0x5dccda(_0x12e18f);});});}
\ No newline at end of file
index 26efbcb..90b3c4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd6a=['length','team:','remove','update'];(function(_0x1360b0,_0x3d59dc){var _0x49c056=function(_0x22dacf){while(--_0x22dacf){_0x1360b0['push'](_0x1360b0['shift']());}};_0x49c056(++_0x3d59dc);}(_0xcd6a,0xbe));var _0xacd6=function(_0xc9fb0f,_0x524da7){_0xc9fb0f=_0xc9fb0f-0x0;var _0x48a8a0=_0xcd6a[_0xc9fb0f];return _0x48a8a0;};'use strict';var TeamEvents=require('./team.events');var events=['save',_0xacd6('0x0'),_0xacd6('0x1')];function createListener(_0x40b9fe,_0x11ae79){return function(_0x4783ec){_0x11ae79['emit'](_0x40b9fe,_0x4783ec);};}function removeListener(_0x2e314a,_0x3ec539){return function(){TeamEvents['removeListener'](_0x2e314a,_0x3ec539);};}exports['register']=function(_0x16dee0){for(var _0x36efb4=0x0,_0x232856=events[_0xacd6('0x2')];_0x36efb4<_0x232856;_0x36efb4++){var _0x9af343=events[_0x36efb4];var _0x85bba=createListener(_0xacd6('0x3')+_0x9af343,_0x16dee0);TeamEvents['on'](_0x9af343,_0x85bba);}};
\ No newline at end of file
+var _0x3fe7=['save','remove','update','emit','removeListener','register','./team.events'];(function(_0xc6b104,_0x1d805a){var _0x1c6fce=function(_0x1bfb3f){while(--_0x1bfb3f){_0xc6b104['push'](_0xc6b104['shift']());}};_0x1c6fce(++_0x1d805a);}(_0x3fe7,0x125));var _0x73fe=function(_0x2b81be,_0x544bdf){_0x2b81be=_0x2b81be-0x0;var _0x8ed4a7=_0x3fe7[_0x2b81be];return _0x8ed4a7;};'use strict';var TeamEvents=require(_0x73fe('0x0'));var events=[_0x73fe('0x1'),_0x73fe('0x2'),_0x73fe('0x3')];function createListener(_0x4d70c0,_0x421c71){return function(_0x498b0e){_0x421c71[_0x73fe('0x4')](_0x4d70c0,_0x498b0e);};}function removeListener(_0x4b7460,_0x509ad5){return function(){TeamEvents[_0x73fe('0x5')](_0x4b7460,_0x509ad5);};}exports[_0x73fe('0x6')]=function(_0x556b87){for(var _0x44df50=0x0,_0x1bf8c8=events['length'];_0x44df50<_0x1bf8c8;_0x44df50++){var _0x1cbbb9=events[_0x44df50];var _0x19bd6f=createListener('team:'+_0x1cbbb9,_0x556b87);TeamEvents['on'](_0x1cbbb9,_0x19bd6f);}};
\ No newline at end of file
index 240d796..18a898b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2d0=['sequelize','exports','INTEGER'];(function(_0xc731bb,_0x5891d4){var _0xfe197d=function(_0x2cd6a7){while(--_0x2cd6a7){_0xc731bb['push'](_0xc731bb['shift']());}};_0xfe197d(++_0x5891d4);}(_0xc2d0,0x9f));var _0x0c2d=function(_0x5aba4f,_0x1afb63){_0x5aba4f=_0x5aba4f-0x0;var _0x10cf5c=_0xc2d0[_0x5aba4f];return _0x10cf5c;};'use strict';var Sequelize=require(_0x0c2d('0x0'));module[_0x0c2d('0x1')]={'TeamId':{'type':Sequelize[_0x0c2d('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x0c2d('0x2')]}};
\ No newline at end of file
+var _0xed65=['exports','INTEGER'];(function(_0x2e6452,_0xe83681){var _0x2f41a0=function(_0x2c3778){while(--_0x2c3778){_0x2e6452['push'](_0x2e6452['shift']());}};_0x2f41a0(++_0xe83681);}(_0xed65,0xd6));var _0x5ed6=function(_0x45f6cb,_0x531af6){_0x45f6cb=_0x45f6cb-0x0;var _0x5b7f93=_0xed65[_0x45f6cb];return _0x5b7f93;};'use strict';var Sequelize=require('sequelize');module[_0x5ed6('0x0')]={'TeamId':{'type':Sequelize[_0x5ed6('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x5ed6('0x1')]}};
\ No newline at end of file
index 3521c23..f977bae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd983=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','TeamVoicePrefix','team_has_voice_prefixes','lodash'];(function(_0xd6bb40,_0x2d113d){var _0x571901=function(_0x4dbbef){while(--_0x4dbbef){_0xd6bb40['push'](_0xd6bb40['shift']());}};_0x571901(++_0x2d113d);}(_0xd983,0x1df));var _0x3d98=function(_0x42f823,_0x3e8144){_0x42f823=_0x42f823-0x0;var _0x33271e=_0xd983[_0x42f823];return _0x33271e;};'use strict';var _=require(_0x3d98('0x0'));var util=require(_0x3d98('0x1'));var logger=require(_0x3d98('0x2'))(_0x3d98('0x3'));var moment=require(_0x3d98('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3d98('0x5'));var rimraf=require(_0x3d98('0x6'));var config=require(_0x3d98('0x7'));var attributes=require(_0x3d98('0x8'));module[_0x3d98('0x9')]=function(_0x3e32c6,_0x394587){return _0x3e32c6['define'](_0x3d98('0xa'),attributes,{'tableName':_0x3d98('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd139=['rimraf','../../config/environment','./teamVoicePrefix.attributes','TeamVoicePrefix','lodash','util','moment','bluebird','request-promise','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd139,0x14e));var _0x9d13=function(_0x1d031e,_0x147ae9){_0x1d031e=_0x1d031e-0x0;var _0x205c30=_0xd139[_0x1d031e];return _0x205c30;};'use strict';var _=require(_0x9d13('0x0'));var util=require(_0x9d13('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9d13('0x2'));var BPromise=require(_0x9d13('0x3'));var rp=require(_0x9d13('0x4'));var fs=require('fs');var path=require(_0x9d13('0x5'));var rimraf=require(_0x9d13('0x6'));var config=require(_0x9d13('0x7'));var attributes=require(_0x9d13('0x8'));module['exports']=function(_0x4c8e60,_0x2918eb){return _0x4c8e60['define'](_0x9d13('0x9'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a887a80..8d6b301 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(_0x426432,_0x1d2527){var _0x17bdb2=function(_0x17f7ff){while(--_0x17f7ff){_0x426432['push'](_0x426432['shift']());}};_0x17bdb2(++_0x1d2527);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1911ed,_0x4e8c73){_0x1911ed=_0x1911ed-0x0;var _0x11edaa=_0xcb91[_0x1911ed];return _0x11edaa;};'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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x8e8762,_0x3d4ebc){var _0x9258a1=function(_0x453fb7){while(--_0x453fb7){_0x8e8762['push'](_0x8e8762['shift']());}};_0x9258a1(++_0x3d4ebc);}(_0xedd9,0xfc));var _0x9edd=function(_0x4dd321,_0x2171a5){_0x4dd321=_0x4dd321-0x0;var _0x38f1c4=_0xedd9[_0x4dd321];return _0x38f1c4;};'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 383440b..e6608fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2809=['exports','sequelize'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x2809,0x10d));var _0x9280=function(_0x40d078,_0x541e13){_0x40d078=_0x40d078-0x0;var _0x52c06b=_0x2809[_0x40d078];return _0x52c06b;};'use strict';var Sequelize=require(_0x9280('0x0'));module[_0x9280('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xd825=['INTEGER'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xd825,0xb4));var _0x5d82=function(_0x661ac3,_0x584c40){_0x661ac3=_0x661ac3-0x0;var _0x260968=_0xd825[_0x661ac3];return _0x260968;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x5d82('0x0')],'defaultValue':0x0}};
\ No newline at end of file
index 8069724..7080cd3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe45=['rimraf','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x3815d1,_0x4e2849){var _0xeaf995=function(_0x54d3a3){while(--_0x54d3a3){_0x3815d1['push'](_0x3815d1['shift']());}};_0xeaf995(++_0x4e2849);}(_0xbe45,0xf0));var _0x5be4=function(_0x5ae271,_0x3acd98){_0x5ae271=_0x5ae271-0x0;var _0x51cb67=_0xbe45[_0x5ae271];return _0x51cb67;};'use strict';var _=require(_0x5be4('0x0'));var util=require(_0x5be4('0x1'));var logger=require('../../config/logger')(_0x5be4('0x2'));var moment=require(_0x5be4('0x3'));var BPromise=require(_0x5be4('0x4'));var rp=require(_0x5be4('0x5'));var fs=require('fs');var path=require(_0x5be4('0x6'));var rimraf=require(_0x5be4('0x7'));var config=require('../../config/environment');var attributes=require(_0x5be4('0x8'));module[_0x5be4('0x9')]=function(_0x2681c7,_0x2b3c60){return _0x2681c7[_0x5be4('0xa')](_0x5be4('0xb'),attributes,{'tableName':_0x5be4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xaced=['rimraf','../../config/environment','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x216573,_0x1e258b){var _0x136a2a=function(_0x39dfc0){while(--_0x39dfc0){_0x216573['push'](_0x216573['shift']());}};_0x136a2a(++_0x1e258b);}(_0xaced,0x18c));var _0xdace=function(_0x1aa558,_0x4f0737){_0x1aa558=_0x1aa558-0x0;var _0x52723b=_0xaced[_0x1aa558];return _0x52723b;};'use strict';var _=require(_0xdace('0x0'));var util=require(_0xdace('0x1'));var logger=require(_0xdace('0x2'))(_0xdace('0x3'));var moment=require(_0xdace('0x4'));var BPromise=require('bluebird');var rp=require(_0xdace('0x5'));var fs=require('fs');var path=require(_0xdace('0x6'));var rimraf=require(_0xdace('0x7'));var config=require(_0xdace('0x8'));var attributes=require('./teamVoiceQueue.attributes');module[_0xdace('0x9')]=function(_0x4d7f80,_0x5f5d92){return _0x4d7f80[_0xdace('0xa')](_0xdace('0xb'),attributes,{'tableName':_0xdace('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a27daee..1ca7e87 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a67=['client','request','then','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','TeamVoiceQueue,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise'];(function(_0x4fa4c3,_0x5b25e0){var _0x9d7553=function(_0x7c2a7d){while(--_0x7c2a7d){_0x4fa4c3['push'](_0x4fa4c3['shift']());}};_0x9d7553(++_0x5b25e0);}(_0x0a67,0x1c4));var _0x70a6=function(_0x4beb87,_0x32eb7c){_0x4beb87=_0x4beb87-0x0;var _0xee8c53=_0x0a67[_0x4beb87];return _0xee8c53;};'use strict';var _=require(_0x70a6('0x0'));var util=require(_0x70a6('0x1'));var moment=require(_0x70a6('0x2'));var BPromise=require(_0x70a6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x70a6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x70a6('0x5'));var logger=require(_0x70a6('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x70a6('0x7'));var client=jayson[_0x70a6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ca3cd,_0x26caee,_0x46dc31){return new BPromise(function(_0x4947fd,_0x100d9d){return client[_0x70a6('0x9')](_0x3ca3cd,_0x46dc31)[_0x70a6('0xa')](function(_0x403743){logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0x26caee,_0x70a6('0xb'));logger[_0x70a6('0xc')](_0x70a6('0xd'),_0x26caee,_0x70a6('0xb'),JSON['stringify'](_0x403743));if(_0x403743[_0x70a6('0xe')]){if(_0x403743[_0x70a6('0xe')][_0x70a6('0xf')]===0x1f4){logger[_0x70a6('0xe')]('TeamVoiceQueue,\x20%s,\x20%s',_0x26caee,_0x403743[_0x70a6('0xe')]['message']);return _0x100d9d(_0x403743['error'][_0x70a6('0x10')]);}logger[_0x70a6('0xe')]('TeamVoiceQueue,\x20%s,\x20%s',_0x26caee,_0x403743['error'][_0x70a6('0x10')]);return _0x4947fd(_0x403743[_0x70a6('0xe')][_0x70a6('0x10')]);}else{logger['info'](_0x70a6('0x11'),_0x26caee,_0x70a6('0xb'));_0x4947fd(_0x403743[_0x70a6('0x12')][_0x70a6('0x10')]);}})[_0x70a6('0x13')](function(_0x3314cb){logger[_0x70a6('0xe')](_0x70a6('0x11'),_0x26caee,_0x3314cb);_0x100d9d(_0x3314cb);});});}
\ No newline at end of file
+var _0x8b04=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','TeamVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x52a0ce,_0x17f08f){var _0xb64dd5=function(_0x41dfe8){while(--_0x41dfe8){_0x52a0ce['push'](_0x52a0ce['shift']());}};_0xb64dd5(++_0x17f08f);}(_0x8b04,0x130));var _0x48b0=function(_0x177cd7,_0x5f56e8){_0x177cd7=_0x177cd7-0x0;var _0x8088e7=_0x8b04[_0x177cd7];return _0x8088e7;};'use strict';var _=require(_0x48b0('0x0'));var util=require(_0x48b0('0x1'));var moment=require('moment');var BPromise=require(_0x48b0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x48b0('0x3'));var db=require(_0x48b0('0x4'))['db'];var utils=require(_0x48b0('0x5'));var logger=require(_0x48b0('0x6'))(_0x48b0('0x7'));var config=require(_0x48b0('0x8'));var jayson=require(_0x48b0('0x9'));var client=jayson[_0x48b0('0xa')][_0x48b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x86b615,_0x47bc9c,_0xe04bbe){return new BPromise(function(_0x2fe681,_0x38d496){return client[_0x48b0('0xc')](_0x86b615,_0xe04bbe)[_0x48b0('0xd')](function(_0x3baa46){logger[_0x48b0('0xe')]('TeamVoiceQueue,\x20%s,\x20%s',_0x47bc9c,_0x48b0('0xf'));logger[_0x48b0('0x10')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x47bc9c,_0x48b0('0xf'),JSON[_0x48b0('0x11')](_0x3baa46));if(_0x3baa46['error']){if(_0x3baa46[_0x48b0('0x12')][_0x48b0('0x13')]===0x1f4){logger[_0x48b0('0x12')](_0x48b0('0x14'),_0x47bc9c,_0x3baa46[_0x48b0('0x12')][_0x48b0('0x15')]);return _0x38d496(_0x3baa46[_0x48b0('0x12')]['message']);}logger[_0x48b0('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x47bc9c,_0x3baa46[_0x48b0('0x12')]['message']);return _0x2fe681(_0x3baa46[_0x48b0('0x12')][_0x48b0('0x15')]);}else{logger[_0x48b0('0xe')](_0x48b0('0x14'),_0x47bc9c,'request\x20sent');_0x2fe681(_0x3baa46[_0x48b0('0x16')][_0x48b0('0x15')]);}})[_0x48b0('0x17')](function(_0x4ccc45){logger[_0x48b0('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x47bc9c,_0x4ccc45);_0x38d496(_0x4ccc45);});});}
\ No newline at end of file
index ff94334..fa73ad8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1893=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./template.controller','get','isAuthenticated','index','/:id','show','put','update','delete','destroy','exports'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x1893,0xa2));var _0x3189=function(_0x30631b,_0x50799b){_0x30631b=_0x30631b-0x0;var _0x3d57c6=_0x1893[_0x30631b];return _0x3d57c6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3189('0x0'));var timeout=require(_0x3189('0x1'));var express=require(_0x3189('0x2'));var router=express[_0x3189('0x3')]();var fs_extra=require(_0x3189('0x4'));var auth=require(_0x3189('0x5'));var interaction=require(_0x3189('0x6'));var config=require('../../config/environment');var controller=require(_0x3189('0x7'));router[_0x3189('0x8')]('/',auth[_0x3189('0x9')](),controller[_0x3189('0xa')]);router[_0x3189('0x8')](_0x3189('0xb'),auth[_0x3189('0x9')](),controller[_0x3189('0xc')]);router['post']('/',auth[_0x3189('0x9')](),controller['create']);router[_0x3189('0xd')]('/:id',auth[_0x3189('0x9')](),controller[_0x3189('0xe')]);router[_0x3189('0xf')](_0x3189('0xb'),auth['isAuthenticated'](),controller[_0x3189('0x10')]);module[_0x3189('0x11')]=router;
\ No newline at end of file
+var _0x5a13=['delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./template.controller','get','/:id','isAuthenticated','show','post','create','put','update'];(function(_0x1f3691,_0x8401bc){var _0x454eed=function(_0x2f96f){while(--_0x2f96f){_0x1f3691['push'](_0x1f3691['shift']());}};_0x454eed(++_0x8401bc);}(_0x5a13,0x92));var _0x35a1=function(_0x5beb99,_0x2eb045){_0x5beb99=_0x5beb99-0x0;var _0x1420db=_0x5a13[_0x5beb99];return _0x1420db;};'use strict';var multer=require('multer');var util=require(_0x35a1('0x0'));var path=require(_0x35a1('0x1'));var timeout=require(_0x35a1('0x2'));var express=require(_0x35a1('0x3'));var router=express[_0x35a1('0x4')]();var fs_extra=require(_0x35a1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x35a1('0x6'));var config=require('../../config/environment');var controller=require(_0x35a1('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x35a1('0x8')](_0x35a1('0x9'),auth[_0x35a1('0xa')](),controller[_0x35a1('0xb')]);router[_0x35a1('0xc')]('/',auth['isAuthenticated'](),controller[_0x35a1('0xd')]);router[_0x35a1('0xe')](_0x35a1('0x9'),auth[_0x35a1('0xa')](),controller[_0x35a1('0xf')]);router[_0x35a1('0x10')](_0x35a1('0x9'),auth[_0x35a1('0xa')](),controller[_0x35a1('0x11')]);module['exports']=router;
\ No newline at end of file
index b0b21d1..80e886e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb953=['sequelize','exports','STRING'];(function(_0x305c31,_0x466b17){var _0x17f39f=function(_0x53ae03){while(--_0x53ae03){_0x305c31['push'](_0x305c31['shift']());}};_0x17f39f(++_0x466b17);}(_0xb953,0x117));var _0x3b95=function(_0x83b36f,_0x36f797){_0x83b36f=_0x83b36f-0x0;var _0x3a2c15=_0xb953[_0x83b36f];return _0x3a2c15;};'use strict';var Sequelize=require(_0x3b95('0x0'));module[_0x3b95('0x1')]={'name':{'type':Sequelize[_0x3b95('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x6ff5=['STRING','TEXT','sequelize','exports'];(function(_0x55ef8b,_0x5deb5e){var _0x359c84=function(_0x437673){while(--_0x437673){_0x55ef8b['push'](_0x55ef8b['shift']());}};_0x359c84(++_0x5deb5e);}(_0x6ff5,0xf6));var _0x56ff=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6ff5[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x56ff('0x0'));module[_0x56ff('0x1')]={'name':{'type':Sequelize[_0x56ff('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x56ff('0x3')]}};
\ No newline at end of file
index 0eaf585..ae9147a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3af=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','Templates','UserProfileResource','sendStatus','error','name','send','index','map','Template','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','type','VIRTUAL','filter','merge','options','includeAll','include','catch','show','params','rawAttributes','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x520e3f,_0x9b778){var _0x3b81a3=function(_0x248dde){while(--_0x248dde){_0x520e3f['push'](_0x520e3f['shift']());}};_0x3b81a3(++_0x9b778);}(_0xa3af,0x191));var _0xfa3a=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa3af[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfa3a('0x0'));var zipdir=require(_0xfa3a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfa3a('0x2'));var BPromise=require(_0xfa3a('0x3'));var Mustache=require(_0xfa3a('0x4'));var util=require(_0xfa3a('0x5'));var path=require(_0xfa3a('0x6'));var sox=require('sox');var csv=require(_0xfa3a('0x7'));var ejs=require(_0xfa3a('0x8'));var fs=require('fs');var fs_extra=require(_0xfa3a('0x9'));var _=require(_0xfa3a('0xa'));var squel=require(_0xfa3a('0xb'));var crypto=require(_0xfa3a('0xc'));var jsforce=require(_0xfa3a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfa3a('0x7'));var querystring=require(_0xfa3a('0xe'));var Papa=require(_0xfa3a('0xf'));var Redis=require(_0xfa3a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xfa3a('0x11'));var as=require(_0xfa3a('0x12'));var hardwareService=require(_0xfa3a('0x13'));var logger=require(_0xfa3a('0x14'))('api');var utils=require(_0xfa3a('0x15'));var config=require(_0xfa3a('0x16'));var licenseUtil=require(_0xfa3a('0x17'));var db=require(_0xfa3a('0x18'))['db'];function respondWithStatusCode(_0x5a60eb,_0x5edcdc){_0x5edcdc=_0x5edcdc||0xcc;return function(_0x188e2d){if(_0x188e2d){return _0x5a60eb['sendStatus'](_0x5edcdc);}return _0x5a60eb[_0xfa3a('0x19')](_0x5edcdc)[_0xfa3a('0x1a')]();};}function respondWithResult(_0x657c0a,_0x552ba3){_0x552ba3=_0x552ba3||0xc8;return function(_0x3a6ce3){if(_0x3a6ce3){return _0x657c0a[_0xfa3a('0x19')](_0x552ba3)[_0xfa3a('0x1b')](_0x3a6ce3);}};}function respondWithFilteredResult(_0x3ca865,_0x510942){return function(_0x4ef2bd){if(_0x4ef2bd){var _0x52baf8=typeof _0x510942['offset']==='undefined'&&typeof _0x510942[_0xfa3a('0x1c')]===_0xfa3a('0x1d');var _0x3d150a=_0x4ef2bd[_0xfa3a('0x1e')];var _0x35b10d=_0x52baf8?0x0:_0x510942[_0xfa3a('0x1f')];var _0x4a0325=_0x52baf8?_0x4ef2bd[_0xfa3a('0x1e')]:_0x510942[_0xfa3a('0x1f')]+_0x510942['limit'];var _0x31cc43;if(_0x4a0325>=_0x3d150a){_0x4a0325=_0x3d150a;_0x31cc43=0xc8;}else{_0x31cc43=0xce;}_0x3ca865[_0xfa3a('0x19')](_0x31cc43);return _0x3ca865[_0xfa3a('0x20')](_0xfa3a('0x21'),_0x35b10d+'-'+_0x4a0325+'/'+_0x3d150a)[_0xfa3a('0x1b')](_0x4ef2bd);}return null;};}function patchUpdates(_0x42f50d){return function(_0x17cc0a){try{jsonpatch[_0xfa3a('0x22')](_0x17cc0a,_0x42f50d,!![]);}catch(_0xf91457){return BPromise[_0xfa3a('0x23')](_0xf91457);}return _0x17cc0a[_0xfa3a('0x24')]();};}function saveUpdates(_0x34c6df,_0x365c3e){return function(_0x4e8725){if(_0x4e8725){return _0x4e8725[_0xfa3a('0x25')](_0x34c6df)[_0xfa3a('0x26')](function(_0x27b265){return _0x27b265;});}return null;};}function removeEntity(_0x398055,_0x457750){return function(_0x14f69f){if(_0x14f69f){return _0x14f69f[_0xfa3a('0x27')]()[_0xfa3a('0x26')](function(){var _0x35e0c5=_0x14f69f['get']({'plain':!![]});var _0x50527c=_0xfa3a('0x28');return db[_0xfa3a('0x29')][_0xfa3a('0x27')]({'where':{'type':_0x50527c,'resourceId':_0x35e0c5['id']}})['then'](function(){return _0x14f69f;});})['then'](function(){_0x398055['status'](0xcc)[_0xfa3a('0x1a')]();});}};}function handleEntityNotFound(_0x54cc95,_0x272f91){return function(_0x1e28c6){if(!_0x1e28c6){_0x54cc95[_0xfa3a('0x2a')](0x194);}return _0x1e28c6;};}function handleError(_0x4a26f6,_0x16ed54){_0x16ed54=_0x16ed54||0x1f4;return function(_0x6d09c2){logger[_0xfa3a('0x2b')](_0x6d09c2['stack']);if(_0x6d09c2[_0xfa3a('0x2c')]){delete _0x6d09c2['name'];}_0x4a26f6[_0xfa3a('0x19')](_0x16ed54)[_0xfa3a('0x2d')](_0x6d09c2);};}exports[_0xfa3a('0x2e')]=function(_0x4976af,_0x375458){var _0x168980={},_0xcd4385={},_0x440a0c={'count':0x0,'rows':[]};var _0x91e63b=_[_0xfa3a('0x2f')](db[_0xfa3a('0x30')]['rawAttributes'],function(_0x3d9db2){return{'name':_0x3d9db2[_0xfa3a('0x31')],'type':_0x3d9db2['type']['key']};});_0xcd4385[_0xfa3a('0x32')]=_[_0xfa3a('0x2f')](_0x91e63b,_0xfa3a('0x2c'));_0xcd4385[_0xfa3a('0x33')]=_[_0xfa3a('0x34')](_0x4976af['query']);_0xcd4385['filters']=_[_0xfa3a('0x35')](_0xcd4385[_0xfa3a('0x32')],_0xcd4385[_0xfa3a('0x33')]);_0x168980[_0xfa3a('0x36')]=_[_0xfa3a('0x35')](_0xcd4385[_0xfa3a('0x32')],qs[_0xfa3a('0x37')](_0x4976af[_0xfa3a('0x33')]['fields']));_0x168980['attributes']=_0x168980['attributes'][_0xfa3a('0x38')]?_0x168980[_0xfa3a('0x36')]:_0xcd4385[_0xfa3a('0x32')];if(!_0x4976af[_0xfa3a('0x33')][_0xfa3a('0x39')]('nolimit')){_0x168980['limit']=qs['limit'](_0x4976af[_0xfa3a('0x33')][_0xfa3a('0x1c')]);_0x168980[_0xfa3a('0x1f')]=qs['offset'](_0x4976af['query']['offset']);}_0x168980[_0xfa3a('0x3a')]=qs[_0xfa3a('0x3b')](_0x4976af[_0xfa3a('0x33')]['sort']);_0x168980[_0xfa3a('0x3c')]=qs[_0xfa3a('0x3d')](_['pick'](_0x4976af[_0xfa3a('0x33')],_0xcd4385['filters']),_0x91e63b);if(_0x4976af[_0xfa3a('0x33')]['filter']){_0x168980[_0xfa3a('0x3c')]=_['merge'](_0x168980[_0xfa3a('0x3c')],{'$or':_[_0xfa3a('0x2f')](_0x91e63b,function(_0x299159){if(_0x299159[_0xfa3a('0x3e')]!==_0xfa3a('0x3f')){var _0x32bd90={};_0x32bd90[_0x299159[_0xfa3a('0x2c')]]={'$like':'%'+_0x4976af[_0xfa3a('0x33')][_0xfa3a('0x40')]+'%'};return _0x32bd90;}})});}_0x168980=_[_0xfa3a('0x41')]({},_0x168980,_0x4976af[_0xfa3a('0x42')]);var _0x33932e={'where':_0x168980[_0xfa3a('0x3c')]};return db[_0xfa3a('0x30')][_0xfa3a('0x1e')](_0x33932e)[_0xfa3a('0x26')](function(_0x4dcb2a){_0x440a0c[_0xfa3a('0x1e')]=_0x4dcb2a;if(_0x4976af['query'][_0xfa3a('0x43')]){_0x168980[_0xfa3a('0x44')]=[{'all':!![]}];}return db[_0xfa3a('0x30')]['findAll'](_0x168980);})[_0xfa3a('0x26')](function(_0x16c2ab){_0x440a0c['rows']=_0x16c2ab;return _0x440a0c;})[_0xfa3a('0x26')](respondWithFilteredResult(_0x375458,_0x168980))[_0xfa3a('0x45')](handleError(_0x375458,null));};exports[_0xfa3a('0x46')]=function(_0x3f4899,_0x6e4ba0){var _0x285d52={'raw':!![],'where':{'id':_0x3f4899[_0xfa3a('0x47')]['id']}},_0x431555={};_0x431555['model']=_[_0xfa3a('0x34')](db[_0xfa3a('0x30')][_0xfa3a('0x48')]);_0x431555[_0xfa3a('0x33')]=_['keys'](_0x3f4899[_0xfa3a('0x33')]);_0x431555['filters']=_[_0xfa3a('0x35')](_0x431555[_0xfa3a('0x32')],_0x431555[_0xfa3a('0x33')]);_0x285d52[_0xfa3a('0x36')]=_[_0xfa3a('0x35')](_0x431555['model'],qs[_0xfa3a('0x37')](_0x3f4899[_0xfa3a('0x33')][_0xfa3a('0x37')]));_0x285d52[_0xfa3a('0x36')]=_0x285d52[_0xfa3a('0x36')][_0xfa3a('0x38')]?_0x285d52['attributes']:_0x431555[_0xfa3a('0x32')];if(_0x3f4899['query'][_0xfa3a('0x43')]){_0x285d52[_0xfa3a('0x44')]=[{'all':!![]}];}_0x285d52=_[_0xfa3a('0x41')]({},_0x285d52,_0x3f4899[_0xfa3a('0x42')]);return db[_0xfa3a('0x30')]['find'](_0x285d52)[_0xfa3a('0x26')](handleEntityNotFound(_0x6e4ba0,null))[_0xfa3a('0x26')](respondWithResult(_0x6e4ba0,null))['catch'](handleError(_0x6e4ba0,null));};exports[_0xfa3a('0x49')]=function(_0x43fd25,_0x1f0c0a){return db[_0xfa3a('0x30')][_0xfa3a('0x49')](_0x43fd25[_0xfa3a('0x4a')],{})[_0xfa3a('0x26')](function(_0xdd860e){var _0x2f4b58=_0x43fd25[_0xfa3a('0x4b')][_0xfa3a('0x4c')]({'plain':!![]});if(!_0x2f4b58)throw new Error(_0xfa3a('0x4d'));if(_0x2f4b58[_0xfa3a('0x4e')]===_0xfa3a('0x4b')){var _0x44e529=_0xdd860e[_0xfa3a('0x4c')]({'plain':!![]});var _0x2b884f='Templates';return db[_0xfa3a('0x4f')][_0xfa3a('0x50')]({'where':{'name':_0x2b884f,'userProfileId':_0x2f4b58[_0xfa3a('0x51')]},'raw':!![]})[_0xfa3a('0x26')](function(_0x376393){if(_0x376393&&_0x376393[_0xfa3a('0x52')]===0x0){return db[_0xfa3a('0x29')][_0xfa3a('0x49')]({'name':_0x44e529[_0xfa3a('0x2c')],'resourceId':_0x44e529['id'],'type':_0x376393[_0xfa3a('0x2c')],'sectionId':_0x376393['id']},{})[_0xfa3a('0x26')](function(){return _0xdd860e;});}else{return _0xdd860e;}})[_0xfa3a('0x45')](function(_0x51ed82){logger[_0xfa3a('0x2b')](_0xfa3a('0x53'),_0x51ed82);throw _0x51ed82;});}return _0xdd860e;})['then'](respondWithResult(_0x1f0c0a,0xc9))['catch'](handleError(_0x1f0c0a,null));};exports[_0xfa3a('0x25')]=function(_0x5a5e89,_0x1c771){if(_0x5a5e89[_0xfa3a('0x4a')]['id']){delete _0x5a5e89['body']['id'];}return db[_0xfa3a('0x30')][_0xfa3a('0x50')]({'where':{'id':_0x5a5e89[_0xfa3a('0x47')]['id']}})[_0xfa3a('0x26')](handleEntityNotFound(_0x1c771,null))[_0xfa3a('0x26')](saveUpdates(_0x5a5e89[_0xfa3a('0x4a')],null))[_0xfa3a('0x26')](respondWithResult(_0x1c771,null))[_0xfa3a('0x45')](handleError(_0x1c771,null));};exports[_0xfa3a('0x27')]=function(_0x26a0bd,_0x28f2f2){return db[_0xfa3a('0x30')][_0xfa3a('0x50')]({'where':{'id':_0x26a0bd[_0xfa3a('0x47')]['id']}})[_0xfa3a('0x26')](handleEntityNotFound(_0x28f2f2,null))[_0xfa3a('0x26')](removeEntity(_0x28f2f2,null))[_0xfa3a('0x45')](handleError(_0x28f2f2,null));};
\ No newline at end of file
+var _0x6436=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','end','error','stack','name','send','map','Template','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','options','includeAll','include','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Templates','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','api'];(function(_0x489d8f,_0x21eb8b){var _0x1f144f=function(_0x1ff407){while(--_0x1ff407){_0x489d8f['push'](_0x489d8f['shift']());}};_0x1f144f(++_0x21eb8b);}(_0x6436,0x87));var _0x6643=function(_0x19ec95,_0x475d61){_0x19ec95=_0x19ec95-0x0;var _0x138dc4=_0x6436[_0x19ec95];return _0x138dc4;};'use strict';var emlformat=require(_0x6643('0x0'));var rimraf=require(_0x6643('0x1'));var zipdir=require(_0x6643('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6643('0x3'));var moment=require(_0x6643('0x4'));var BPromise=require(_0x6643('0x5'));var Mustache=require(_0x6643('0x6'));var util=require('util');var path=require(_0x6643('0x7'));var sox=require(_0x6643('0x8'));var csv=require(_0x6643('0x9'));var ejs=require(_0x6643('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6643('0xb'));var deskjs=require(_0x6643('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6643('0xd'));var authService=require(_0x6643('0xe'));var qs=require(_0x6643('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6643('0x10'));var utils=require(_0x6643('0x11'));var config=require(_0x6643('0x12'));var licenseUtil=require(_0x6643('0x13'));var db=require(_0x6643('0x14'))['db'];function respondWithStatusCode(_0x34ae53,_0x20f6a8){_0x20f6a8=_0x20f6a8||0xcc;return function(_0x58bdce){if(_0x58bdce){return _0x34ae53['sendStatus'](_0x20f6a8);}return _0x34ae53[_0x6643('0x15')](_0x20f6a8)['end']();};}function respondWithResult(_0x75a70b,_0x77e2ae){_0x77e2ae=_0x77e2ae||0xc8;return function(_0x3046cf){if(_0x3046cf){return _0x75a70b[_0x6643('0x15')](_0x77e2ae)[_0x6643('0x16')](_0x3046cf);}};}function respondWithFilteredResult(_0x268e11,_0x56e1aa){return function(_0x5b2a17){if(_0x5b2a17){var _0x1a2df7=typeof _0x56e1aa[_0x6643('0x17')]==='undefined'&&typeof _0x56e1aa[_0x6643('0x18')]==='undefined';var _0x4876bd=_0x5b2a17[_0x6643('0x19')];var _0xffe0d=_0x1a2df7?0x0:_0x56e1aa['offset'];var _0x10c1b5=_0x1a2df7?_0x5b2a17[_0x6643('0x19')]:_0x56e1aa[_0x6643('0x17')]+_0x56e1aa[_0x6643('0x18')];var _0x1654f1;if(_0x10c1b5>=_0x4876bd){_0x10c1b5=_0x4876bd;_0x1654f1=0xc8;}else{_0x1654f1=0xce;}_0x268e11[_0x6643('0x15')](_0x1654f1);return _0x268e11[_0x6643('0x1a')](_0x6643('0x1b'),_0xffe0d+'-'+_0x10c1b5+'/'+_0x4876bd)[_0x6643('0x16')](_0x5b2a17);}return null;};}function patchUpdates(_0xc361da){return function(_0x14f0b5){try{jsonpatch[_0x6643('0x1c')](_0x14f0b5,_0xc361da,!![]);}catch(_0x4cd979){return BPromise[_0x6643('0x1d')](_0x4cd979);}return _0x14f0b5[_0x6643('0x1e')]();};}function saveUpdates(_0x7a7888,_0x4c4d5e){return function(_0x10a706){if(_0x10a706){return _0x10a706[_0x6643('0x1f')](_0x7a7888)[_0x6643('0x20')](function(_0x10f93e){return _0x10f93e;});}return null;};}function removeEntity(_0x474a52,_0xda855d){return function(_0x1ccb91){if(_0x1ccb91){return _0x1ccb91[_0x6643('0x21')]()[_0x6643('0x20')](function(){var _0xdf6534=_0x1ccb91[_0x6643('0x22')]({'plain':!![]});var _0x391844='Templates';return db['UserProfileResource'][_0x6643('0x21')]({'where':{'type':_0x391844,'resourceId':_0xdf6534['id']}})[_0x6643('0x20')](function(){return _0x1ccb91;});})[_0x6643('0x20')](function(){_0x474a52[_0x6643('0x15')](0xcc)[_0x6643('0x23')]();});}};}function handleEntityNotFound(_0x546fb5,_0x3b6e71){return function(_0x4ada08){if(!_0x4ada08){_0x546fb5['sendStatus'](0x194);}return _0x4ada08;};}function handleError(_0x3ba429,_0x14a5bf){_0x14a5bf=_0x14a5bf||0x1f4;return function(_0x51960e){logger[_0x6643('0x24')](_0x51960e[_0x6643('0x25')]);if(_0x51960e[_0x6643('0x26')]){delete _0x51960e[_0x6643('0x26')];}_0x3ba429[_0x6643('0x15')](_0x14a5bf)[_0x6643('0x27')](_0x51960e);};}exports['index']=function(_0x103d82,_0x5b4b12){var _0x3bf8b6={},_0x916dcf={},_0x4cbec8={'count':0x0,'rows':[]};var _0x342278=_[_0x6643('0x28')](db[_0x6643('0x29')][_0x6643('0x2a')],function(_0x133a13){return{'name':_0x133a13[_0x6643('0x2b')],'type':_0x133a13[_0x6643('0x2c')][_0x6643('0x2d')]};});_0x916dcf[_0x6643('0x2e')]=_['map'](_0x342278,_0x6643('0x26'));_0x916dcf['query']=_[_0x6643('0x2f')](_0x103d82[_0x6643('0x30')]);_0x916dcf[_0x6643('0x31')]=_[_0x6643('0x32')](_0x916dcf[_0x6643('0x2e')],_0x916dcf[_0x6643('0x30')]);_0x3bf8b6[_0x6643('0x33')]=_[_0x6643('0x32')](_0x916dcf[_0x6643('0x2e')],qs[_0x6643('0x34')](_0x103d82['query'][_0x6643('0x34')]));_0x3bf8b6[_0x6643('0x33')]=_0x3bf8b6[_0x6643('0x33')]['length']?_0x3bf8b6[_0x6643('0x33')]:_0x916dcf[_0x6643('0x2e')];if(!_0x103d82[_0x6643('0x30')][_0x6643('0x35')](_0x6643('0x36'))){_0x3bf8b6['limit']=qs[_0x6643('0x18')](_0x103d82[_0x6643('0x30')]['limit']);_0x3bf8b6[_0x6643('0x17')]=qs[_0x6643('0x17')](_0x103d82[_0x6643('0x30')]['offset']);}_0x3bf8b6['order']=qs['sort'](_0x103d82[_0x6643('0x30')][_0x6643('0x37')]);_0x3bf8b6['where']=qs[_0x6643('0x31')](_['pick'](_0x103d82['query'],_0x916dcf[_0x6643('0x31')]),_0x342278);if(_0x103d82[_0x6643('0x30')][_0x6643('0x38')]){_0x3bf8b6[_0x6643('0x39')]=_[_0x6643('0x3a')](_0x3bf8b6[_0x6643('0x39')],{'$or':_['map'](_0x342278,function(_0x5571a7){if(_0x5571a7['type']!==_0x6643('0x3b')){var _0x2d7979={};_0x2d7979[_0x5571a7[_0x6643('0x26')]]={'$like':'%'+_0x103d82['query'][_0x6643('0x38')]+'%'};return _0x2d7979;}})});}_0x3bf8b6=_[_0x6643('0x3a')]({},_0x3bf8b6,_0x103d82[_0x6643('0x3c')]);var _0x2f2654={'where':_0x3bf8b6['where']};return db[_0x6643('0x29')][_0x6643('0x19')](_0x2f2654)['then'](function(_0x1e9434){_0x4cbec8[_0x6643('0x19')]=_0x1e9434;if(_0x103d82[_0x6643('0x30')][_0x6643('0x3d')]){_0x3bf8b6[_0x6643('0x3e')]=[{'all':!![]}];}return db[_0x6643('0x29')]['findAll'](_0x3bf8b6);})[_0x6643('0x20')](function(_0x2f9878){_0x4cbec8['rows']=_0x2f9878;return _0x4cbec8;})[_0x6643('0x20')](respondWithFilteredResult(_0x5b4b12,_0x3bf8b6))[_0x6643('0x3f')](handleError(_0x5b4b12,null));};exports[_0x6643('0x40')]=function(_0x4b8d4e,_0x4f33dc){var _0x5e562a={'raw':!![],'where':{'id':_0x4b8d4e['params']['id']}},_0x56163d={};_0x56163d['model']=_[_0x6643('0x2f')](db[_0x6643('0x29')][_0x6643('0x2a')]);_0x56163d['query']=_['keys'](_0x4b8d4e[_0x6643('0x30')]);_0x56163d[_0x6643('0x31')]=_[_0x6643('0x32')](_0x56163d[_0x6643('0x2e')],_0x56163d[_0x6643('0x30')]);_0x5e562a['attributes']=_[_0x6643('0x32')](_0x56163d[_0x6643('0x2e')],qs['fields'](_0x4b8d4e[_0x6643('0x30')][_0x6643('0x34')]));_0x5e562a[_0x6643('0x33')]=_0x5e562a[_0x6643('0x33')]['length']?_0x5e562a[_0x6643('0x33')]:_0x56163d[_0x6643('0x2e')];if(_0x4b8d4e[_0x6643('0x30')][_0x6643('0x3d')]){_0x5e562a[_0x6643('0x3e')]=[{'all':!![]}];}_0x5e562a=_[_0x6643('0x3a')]({},_0x5e562a,_0x4b8d4e[_0x6643('0x3c')]);return db[_0x6643('0x29')][_0x6643('0x41')](_0x5e562a)[_0x6643('0x20')](handleEntityNotFound(_0x4f33dc,null))['then'](respondWithResult(_0x4f33dc,null))[_0x6643('0x3f')](handleError(_0x4f33dc,null));};exports['create']=function(_0x55c4a5,_0x5503fc){return db[_0x6643('0x29')][_0x6643('0x42')](_0x55c4a5[_0x6643('0x43')],{})['then'](function(_0x17da96){var _0x1dfd88=_0x55c4a5[_0x6643('0x44')][_0x6643('0x22')]({'plain':!![]});if(!_0x1dfd88)throw new Error(_0x6643('0x45'));if(_0x1dfd88[_0x6643('0x46')]===_0x6643('0x44')){var _0x48e37d=_0x17da96[_0x6643('0x22')]({'plain':!![]});var _0x5555b5=_0x6643('0x47');return db[_0x6643('0x48')][_0x6643('0x41')]({'where':{'name':_0x5555b5,'userProfileId':_0x1dfd88['userProfileId']},'raw':!![]})[_0x6643('0x20')](function(_0x18a71d){if(_0x18a71d&&_0x18a71d['autoAssociation']===0x0){return db[_0x6643('0x49')][_0x6643('0x42')]({'name':_0x48e37d[_0x6643('0x26')],'resourceId':_0x48e37d['id'],'type':_0x18a71d[_0x6643('0x26')],'sectionId':_0x18a71d['id']},{})[_0x6643('0x20')](function(){return _0x17da96;});}else{return _0x17da96;}})[_0x6643('0x3f')](function(_0x2db6a3){logger[_0x6643('0x24')](_0x6643('0x4a'),_0x2db6a3);throw _0x2db6a3;});}return _0x17da96;})[_0x6643('0x20')](respondWithResult(_0x5503fc,0xc9))[_0x6643('0x3f')](handleError(_0x5503fc,null));};exports[_0x6643('0x1f')]=function(_0x582f74,_0x5bf199){if(_0x582f74[_0x6643('0x43')]['id']){delete _0x582f74[_0x6643('0x43')]['id'];}return db[_0x6643('0x29')]['find']({'where':{'id':_0x582f74[_0x6643('0x4b')]['id']}})[_0x6643('0x20')](handleEntityNotFound(_0x5bf199,null))['then'](saveUpdates(_0x582f74[_0x6643('0x43')],null))['then'](respondWithResult(_0x5bf199,null))[_0x6643('0x3f')](handleError(_0x5bf199,null));};exports['destroy']=function(_0x282f3f,_0x4880ba){return db[_0x6643('0x29')][_0x6643('0x41')]({'where':{'id':_0x282f3f[_0x6643('0x4b')]['id']}})[_0x6643('0x20')](handleEntityNotFound(_0x4880ba,null))['then'](removeEntity(_0x4880ba,null))[_0x6643('0x3f')](handleError(_0x4880ba,null));};
\ No newline at end of file
index d908256..1ac38b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b37=['exports','Template','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./template.attributes'];(function(_0x2e5069,_0x3a1115){var _0x2f00ad=function(_0x3cba4f){while(--_0x3cba4f){_0x2e5069['push'](_0x2e5069['shift']());}};_0x2f00ad(++_0x3a1115);}(_0x7b37,0x16a));var _0x77b3=function(_0x205a22,_0x2f16da){_0x205a22=_0x205a22-0x0;var _0x2982a9=_0x7b37[_0x205a22];return _0x2982a9;};'use strict';var _=require('lodash');var util=require(_0x77b3('0x0'));var logger=require(_0x77b3('0x1'))(_0x77b3('0x2'));var moment=require('moment');var BPromise=require(_0x77b3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x77b3('0x4'));var rimraf=require(_0x77b3('0x5'));var config=require(_0x77b3('0x6'));var attributes=require(_0x77b3('0x7'));module[_0x77b3('0x8')]=function(_0x56c71f,_0x5a564f){return _0x56c71f['define'](_0x77b3('0x9'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7cd2=['rimraf','../../config/environment','./template.attributes','exports','define','Template','tools_templates','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x625ca7,_0x4f6847){var _0x85949a=function(_0x26d95d){while(--_0x26d95d){_0x625ca7['push'](_0x625ca7['shift']());}};_0x85949a(++_0x4f6847);}(_0x7cd2,0x142));var _0x27cd=function(_0x9b6134,_0x2ac4b4){_0x9b6134=_0x9b6134-0x0;var _0x3ef8d0=_0x7cd2[_0x9b6134];return _0x3ef8d0;};'use strict';var _=require(_0x27cd('0x0'));var util=require(_0x27cd('0x1'));var logger=require(_0x27cd('0x2'))(_0x27cd('0x3'));var moment=require(_0x27cd('0x4'));var BPromise=require(_0x27cd('0x5'));var rp=require(_0x27cd('0x6'));var fs=require('fs');var path=require(_0x27cd('0x7'));var rimraf=require(_0x27cd('0x8'));var config=require(_0x27cd('0x9'));var attributes=require(_0x27cd('0xa'));module[_0x27cd('0xb')]=function(_0x1320e3,_0xa0b82c){return _0x1320e3[_0x27cd('0xc')](_0x27cd('0xd'),attributes,{'tableName':_0x27cd('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f4c897c..dae07c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd920=['message','info','result','catch','GetTemplate','Template','options','raw','attributes','limit','include','map','model','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','error','code','Template,\x20%s,\x20%s'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xd920,0x1ee));var _0x0d92=function(_0x13342f,_0x3d6303){_0x13342f=_0x13342f-0x0;var _0x2fc1fc=_0xd920[_0x13342f];return _0x2fc1fc;};'use strict';var _=require('lodash');var util=require(_0x0d92('0x0'));var moment=require(_0x0d92('0x1'));var BPromise=require(_0x0d92('0x2'));var rs=require(_0x0d92('0x3'));var fs=require('fs');var Redis=require(_0x0d92('0x4'));var db=require(_0x0d92('0x5'))['db'];var utils=require(_0x0d92('0x6'));var logger=require(_0x0d92('0x7'))('rpc');var config=require(_0x0d92('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0d92('0x9')][_0x0d92('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f7b69,_0x150f15,_0x178602){return new BPromise(function(_0x120112,_0x4cc7b4){return client['request'](_0x3f7b69,_0x178602)[_0x0d92('0xb')](function(_0x85b97e){logger['info']('Template,\x20%s,\x20%s',_0x150f15,_0x0d92('0xc'));logger[_0x0d92('0xd')](_0x0d92('0xe'),_0x150f15,_0x0d92('0xc'),JSON['stringify'](_0x85b97e));if(_0x85b97e['error']){if(_0x85b97e[_0x0d92('0xf')][_0x0d92('0x10')]===0x1f4){logger[_0x0d92('0xf')](_0x0d92('0x11'),_0x150f15,_0x85b97e[_0x0d92('0xf')][_0x0d92('0x12')]);return _0x4cc7b4(_0x85b97e[_0x0d92('0xf')][_0x0d92('0x12')]);}logger['error']('Template,\x20%s,\x20%s',_0x150f15,_0x85b97e[_0x0d92('0xf')][_0x0d92('0x12')]);return _0x120112(_0x85b97e[_0x0d92('0xf')]['message']);}else{logger[_0x0d92('0x13')](_0x0d92('0x11'),_0x150f15,_0x0d92('0xc'));_0x120112(_0x85b97e[_0x0d92('0x14')][_0x0d92('0x12')]);}})[_0x0d92('0x15')](function(_0x43961f){logger['error'](_0x0d92('0x11'),_0x150f15,_0x43961f);_0x4cc7b4(_0x43961f);});});}exports[_0x0d92('0x16')]=function(_0x10cc01){var _0xbd720b=this;return new Promise(function(_0x4cd9ad,_0x539403){return db[_0x0d92('0x17')]['findAll']({'raw':_0x10cc01[_0x0d92('0x18')]?_0x10cc01['options'][_0x0d92('0x19')]===undefined?!![]:![]:!![],'where':_0x10cc01[_0x0d92('0x18')]?_0x10cc01[_0x0d92('0x18')]['where']||null:null,'attributes':_0x10cc01[_0x0d92('0x18')]?_0x10cc01[_0x0d92('0x18')][_0x0d92('0x1a')]||null:null,'limit':_0x10cc01[_0x0d92('0x18')]?_0x10cc01[_0x0d92('0x18')][_0x0d92('0x1b')]||null:null,'include':_0x10cc01[_0x0d92('0x18')]?_0x10cc01[_0x0d92('0x18')][_0x0d92('0x1c')]?_[_0x0d92('0x1d')](_0x10cc01[_0x0d92('0x18')][_0x0d92('0x1c')],function(_0x3c9910){return{'model':db[_0x3c9910[_0x0d92('0x1e')]],'as':_0x3c9910['as'],'attributes':_0x3c9910[_0x0d92('0x1a')],'include':_0x3c9910['include']?_[_0x0d92('0x1d')](_0x3c9910[_0x0d92('0x1c')],function(_0x42089f){return{'model':db[_0x42089f[_0x0d92('0x1e')]],'as':_0x42089f['as'],'attributes':_0x42089f[_0x0d92('0x1a')],'include':_0x42089f['include']?_['map'](_0x42089f[_0x0d92('0x1c')],function(_0x1b45f6){return{'model':db[_0x1b45f6['model']],'as':_0x1b45f6['as'],'attributes':_0x1b45f6[_0x0d92('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x256bed){logger[_0x0d92('0x13')](_0x0d92('0x16'),_0x10cc01);logger[_0x0d92('0xd')](_0x0d92('0x16'),_0x10cc01,JSON[_0x0d92('0x1f')](_0x256bed));_0x4cd9ad(_0x256bed);})['catch'](function(_0x5884cc){logger[_0x0d92('0xf')]('GetTemplate',_0x5884cc[_0x0d92('0x12')],_0x10cc01);_0x539403(_0xbd720b['error'](0x1f4,_0x5884cc[_0x0d92('0x12')]));});});};
\ No newline at end of file
+var _0xf525=['findAll','options','where','attributes','limit','include','map','model','then','lodash','util','bluebird','randomstring','ioredis','rpc','jayson/promise','http','request','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetTemplate','Template'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf525,0x13f));var _0x5f52=function(_0x295230,_0x3c18ce){_0x295230=_0x295230-0x0;var _0x578e50=_0xf525[_0x295230];return _0x578e50;};'use strict';var _=require(_0x5f52('0x0'));var util=require(_0x5f52('0x1'));var moment=require('moment');var BPromise=require(_0x5f52('0x2'));var rs=require(_0x5f52('0x3'));var fs=require('fs');var Redis=require(_0x5f52('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5f52('0x5'));var config=require('../../config/environment');var jayson=require(_0x5f52('0x6'));var client=jayson['client'][_0x5f52('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2eb562,_0x4ea7fb,_0x3a5176){return new BPromise(function(_0x54c47d,_0x9feec1){return client[_0x5f52('0x8')](_0x2eb562,_0x3a5176)['then'](function(_0x533add){logger['info'](_0x5f52('0x9'),_0x4ea7fb,_0x5f52('0xa'));logger[_0x5f52('0xb')](_0x5f52('0xc'),_0x4ea7fb,_0x5f52('0xa'),JSON[_0x5f52('0xd')](_0x533add));if(_0x533add[_0x5f52('0xe')]){if(_0x533add['error'][_0x5f52('0xf')]===0x1f4){logger['error']('Template,\x20%s,\x20%s',_0x4ea7fb,_0x533add[_0x5f52('0xe')][_0x5f52('0x10')]);return _0x9feec1(_0x533add[_0x5f52('0xe')][_0x5f52('0x10')]);}logger[_0x5f52('0xe')]('Template,\x20%s,\x20%s',_0x4ea7fb,_0x533add[_0x5f52('0xe')][_0x5f52('0x10')]);return _0x54c47d(_0x533add[_0x5f52('0xe')][_0x5f52('0x10')]);}else{logger[_0x5f52('0x11')](_0x5f52('0x9'),_0x4ea7fb,_0x5f52('0xa'));_0x54c47d(_0x533add[_0x5f52('0x12')][_0x5f52('0x10')]);}})[_0x5f52('0x13')](function(_0x377e67){logger[_0x5f52('0xe')](_0x5f52('0x9'),_0x4ea7fb,_0x377e67);_0x9feec1(_0x377e67);});});}exports[_0x5f52('0x14')]=function(_0x25a7dc){var _0x4d726c=this;return new Promise(function(_0x38beea,_0x4e28b2){return db[_0x5f52('0x15')][_0x5f52('0x16')]({'raw':_0x25a7dc[_0x5f52('0x17')]?_0x25a7dc['options']['raw']===undefined?!![]:![]:!![],'where':_0x25a7dc[_0x5f52('0x17')]?_0x25a7dc[_0x5f52('0x17')][_0x5f52('0x18')]||null:null,'attributes':_0x25a7dc[_0x5f52('0x17')]?_0x25a7dc[_0x5f52('0x17')][_0x5f52('0x19')]||null:null,'limit':_0x25a7dc[_0x5f52('0x17')]?_0x25a7dc[_0x5f52('0x17')][_0x5f52('0x1a')]||null:null,'include':_0x25a7dc[_0x5f52('0x17')]?_0x25a7dc[_0x5f52('0x17')][_0x5f52('0x1b')]?_[_0x5f52('0x1c')](_0x25a7dc['options'][_0x5f52('0x1b')],function(_0x12da32){return{'model':db[_0x12da32[_0x5f52('0x1d')]],'as':_0x12da32['as'],'attributes':_0x12da32[_0x5f52('0x19')],'include':_0x12da32[_0x5f52('0x1b')]?_[_0x5f52('0x1c')](_0x12da32['include'],function(_0x46fd4f){return{'model':db[_0x46fd4f[_0x5f52('0x1d')]],'as':_0x46fd4f['as'],'attributes':_0x46fd4f[_0x5f52('0x19')],'include':_0x46fd4f['include']?_[_0x5f52('0x1c')](_0x46fd4f[_0x5f52('0x1b')],function(_0x99e636){return{'model':db[_0x99e636[_0x5f52('0x1d')]],'as':_0x99e636['as'],'attributes':_0x99e636[_0x5f52('0x19')]};}):[]};}):[]};}):[]:[]})[_0x5f52('0x1e')](function(_0x35f80e){logger['info'](_0x5f52('0x14'),_0x25a7dc);logger[_0x5f52('0xb')](_0x5f52('0x14'),_0x25a7dc,JSON[_0x5f52('0xd')](_0x35f80e));_0x38beea(_0x35f80e);})[_0x5f52('0x13')](function(_0x22a362){logger[_0x5f52('0xe')](_0x5f52('0x14'),_0x22a362[_0x5f52('0x10')],_0x25a7dc);_0x4e28b2(_0x4d726c[_0x5f52('0xe')](0x1f4,_0x22a362[_0x5f52('0x10')]));});});};
\ No newline at end of file
index cfb9951..9ce12aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01d3=['/:id/any_conditions','/:id/actions','addAction','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./trigger.controller','get','index','/:id','isAuthenticated','show','/:id/all_conditions','getAllConditions','getAnyConditions','getActions','post','addAllCondition'];(function(_0x4c7fb5,_0x2548ef){var _0x2e10ac=function(_0xf7e27c){while(--_0xf7e27c){_0x4c7fb5['push'](_0x4c7fb5['shift']());}};_0x2e10ac(++_0x2548ef);}(_0x01d3,0xa2));var _0x301d=function(_0x5e3611,_0x1df62c){_0x5e3611=_0x5e3611-0x0;var _0x4a5bc1=_0x01d3[_0x5e3611];return _0x4a5bc1;};'use strict';var multer=require(_0x301d('0x0'));var util=require(_0x301d('0x1'));var path=require(_0x301d('0x2'));var timeout=require(_0x301d('0x3'));var express=require('express');var router=express[_0x301d('0x4')]();var fs_extra=require(_0x301d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x301d('0x6'));var config=require(_0x301d('0x7'));var controller=require(_0x301d('0x8'));router[_0x301d('0x9')]('/',auth['isAuthenticated'](),controller[_0x301d('0xa')]);router[_0x301d('0x9')](_0x301d('0xb'),auth[_0x301d('0xc')](),controller[_0x301d('0xd')]);router[_0x301d('0x9')](_0x301d('0xe'),auth[_0x301d('0xc')](),controller[_0x301d('0xf')]);router[_0x301d('0x9')]('/:id/any_conditions',auth[_0x301d('0xc')](),controller[_0x301d('0x10')]);router[_0x301d('0x9')]('/:id/actions',auth[_0x301d('0xc')](),controller[_0x301d('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x301d('0x12')](_0x301d('0xe'),auth[_0x301d('0xc')](),controller[_0x301d('0x13')]);router[_0x301d('0x12')](_0x301d('0x14'),auth[_0x301d('0xc')](),controller['addAnyCondition']);router['post'](_0x301d('0x15'),auth[_0x301d('0xc')](),controller[_0x301d('0x16')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x301d('0x17')](_0x301d('0xb'),auth[_0x301d('0xc')](),controller[_0x301d('0x18')]);module[_0x301d('0x19')]=router;
\ No newline at end of file
+var _0xa7d7=['put','/:id','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','index','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','/:id/actions','post','isAuthenticated','addAllCondition','addAnyCondition','addAction'];(function(_0x31c480,_0x13f64a){var _0x3687ce=function(_0x46fbc0){while(--_0x46fbc0){_0x31c480['push'](_0x31c480['shift']());}};_0x3687ce(++_0x13f64a);}(_0xa7d7,0x149));var _0x7a7d=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0xa7d7[_0x288f5e];return _0x476cc9;};'use strict';var multer=require('multer');var util=require(_0x7a7d('0x0'));var path=require(_0x7a7d('0x1'));var timeout=require(_0x7a7d('0x2'));var express=require(_0x7a7d('0x3'));var router=express[_0x7a7d('0x4')]();var fs_extra=require(_0x7a7d('0x5'));var auth=require(_0x7a7d('0x6'));var interaction=require(_0x7a7d('0x7'));var config=require(_0x7a7d('0x8'));var controller=require(_0x7a7d('0x9'));router[_0x7a7d('0xa')]('/',auth['isAuthenticated'](),controller[_0x7a7d('0xb')]);router[_0x7a7d('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x7a7d('0xc')]);router[_0x7a7d('0xa')](_0x7a7d('0xd'),auth['isAuthenticated'](),controller[_0x7a7d('0xe')]);router['get'](_0x7a7d('0xf'),auth['isAuthenticated'](),controller['getAnyConditions']);router[_0x7a7d('0xa')](_0x7a7d('0x10'),auth['isAuthenticated'](),controller['getActions']);router[_0x7a7d('0x11')]('/',auth[_0x7a7d('0x12')](),controller['create']);router[_0x7a7d('0x11')](_0x7a7d('0xd'),auth[_0x7a7d('0x12')](),controller[_0x7a7d('0x13')]);router['post']('/:id/any_conditions',auth[_0x7a7d('0x12')](),controller[_0x7a7d('0x14')]);router[_0x7a7d('0x11')](_0x7a7d('0x10'),auth[_0x7a7d('0x12')](),controller[_0x7a7d('0x15')]);router[_0x7a7d('0x16')](_0x7a7d('0x17'),auth[_0x7a7d('0x12')](),controller['update']);router[_0x7a7d('0x18')]('/:id',auth[_0x7a7d('0x12')](),controller[_0x7a7d('0x19')]);module[_0x7a7d('0x1a')]=router;
\ No newline at end of file
index 2ba2f2d..795c548 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad93=['sequelize','exports','STRING','BOOLEAN'];(function(_0x165437,_0x27bb33){var _0x311d68=function(_0x3e4228){while(--_0x3e4228){_0x165437['push'](_0x165437['shift']());}};_0x311d68(++_0x27bb33);}(_0xad93,0x1c4));var _0x3ad9=function(_0x5442d1,_0x193d0e){_0x5442d1=_0x5442d1-0x0;var _0x2f0eaf=_0xad93[_0x5442d1];return _0x2f0eaf;};'use strict';var Sequelize=require(_0x3ad9('0x0'));module[_0x3ad9('0x1')]={'name':{'type':Sequelize[_0x3ad9('0x2')]},'channel':{'type':Sequelize[_0x3ad9('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x3ad9('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0xc13e=['exports','STRING','BOOLEAN','sequelize'];(function(_0x31d725,_0x45ecb6){var _0x48450e=function(_0x3e10b1){while(--_0x3e10b1){_0x31d725['push'](_0x31d725['shift']());}};_0x48450e(++_0x45ecb6);}(_0xc13e,0x12f));var _0xec13=function(_0x5333bb,_0x182233){_0x5333bb=_0x5333bb-0x0;var _0xddaaf6=_0xc13e[_0x5333bb];return _0xddaaf6;};'use strict';var Sequelize=require(_0xec13('0x0'));module[_0xec13('0x1')]={'name':{'type':Sequelize[_0xec13('0x2')]},'channel':{'type':Sequelize[_0xec13('0x2')]},'description':{'type':Sequelize[_0xec13('0x2')]},'status':{'type':Sequelize[_0xec13('0x3')],'defaultValue':![]}};
\ No newline at end of file
index 7f83d0d..570b4dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2799=['util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Triggers','UserProfileResource','error','stack','send','index','Trigger','rawAttributes','fieldName','type','key','model','map','name','query','keys','attributes','fields','order','sort','where','filters','pick','merge','options','includeAll','findAll','rows','catch','params','intersection','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','userProfileId','autoAssociation','addAllCondition','TriggerAllId','addAnyCondition','Condition','findOne','length','filter','getAllConditions','hasOwnProperty','nolimit','getAnyConditions','addAction','Action','getActions','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache'];(function(_0x3325a2,_0x3a0aca){var _0x2c7b2b=function(_0x393cce){while(--_0x393cce){_0x3325a2['push'](_0x3325a2['shift']());}};_0x2c7b2b(++_0x3a0aca);}(_0x2799,0x1c1));var _0x9279=function(_0x9c506,_0x7deab9){_0x9c506=_0x9c506-0x0;var _0x44a99e=_0x2799[_0x9c506];return _0x44a99e;};'use strict';var emlformat=require(_0x9279('0x0'));var rimraf=require(_0x9279('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9279('0x2'));var rp=require('request-promise');var moment=require(_0x9279('0x3'));var BPromise=require(_0x9279('0x4'));var Mustache=require(_0x9279('0x5'));var util=require(_0x9279('0x6'));var path=require(_0x9279('0x7'));var sox=require(_0x9279('0x8'));var csv=require(_0x9279('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9279('0xa'));var _=require('lodash');var squel=require(_0x9279('0xb'));var crypto=require(_0x9279('0xc'));var jsforce=require(_0x9279('0xd'));var deskjs=require(_0x9279('0xe'));var toCsv=require(_0x9279('0x9'));var querystring=require(_0x9279('0xf'));var Papa=require(_0x9279('0x10'));var Redis=require('ioredis');var authService=require(_0x9279('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9279('0x12'));var utils=require('../../config/utils');var config=require(_0x9279('0x13'));var licenseUtil=require(_0x9279('0x14'));var db=require(_0x9279('0x15'))['db'];function respondWithStatusCode(_0x16fa7c,_0x53a634){_0x53a634=_0x53a634||0xcc;return function(_0x2c489b){if(_0x2c489b){return _0x16fa7c[_0x9279('0x16')](_0x53a634);}return _0x16fa7c[_0x9279('0x17')](_0x53a634)[_0x9279('0x18')]();};}function respondWithResult(_0x3a7d50,_0x3a4a97){_0x3a4a97=_0x3a4a97||0xc8;return function(_0x47d856){if(_0x47d856){return _0x3a7d50[_0x9279('0x17')](_0x3a4a97)['json'](_0x47d856);}};}function respondWithFilteredResult(_0x477eff,_0x495c9b){return function(_0x4eca4d){if(_0x4eca4d){var _0x555f3a=typeof _0x495c9b['offset']===_0x9279('0x19')&&typeof _0x495c9b[_0x9279('0x1a')]===_0x9279('0x19');var _0x3f3c4a=_0x4eca4d[_0x9279('0x1b')];var _0x57a952=_0x555f3a?0x0:_0x495c9b[_0x9279('0x1c')];var _0x380da0=_0x555f3a?_0x4eca4d[_0x9279('0x1b')]:_0x495c9b[_0x9279('0x1c')]+_0x495c9b['limit'];var _0x17d0a7;if(_0x380da0>=_0x3f3c4a){_0x380da0=_0x3f3c4a;_0x17d0a7=0xc8;}else{_0x17d0a7=0xce;}_0x477eff['status'](_0x17d0a7);return _0x477eff[_0x9279('0x1d')](_0x9279('0x1e'),_0x57a952+'-'+_0x380da0+'/'+_0x3f3c4a)['json'](_0x4eca4d);}return null;};}function patchUpdates(_0x80124c){return function(_0x32dbdd){try{jsonpatch[_0x9279('0x1f')](_0x32dbdd,_0x80124c,!![]);}catch(_0x33b032){return BPromise[_0x9279('0x20')](_0x33b032);}return _0x32dbdd[_0x9279('0x21')]();};}function saveUpdates(_0x506fa6,_0x493308){return function(_0x4b6c80){if(_0x4b6c80){return _0x4b6c80[_0x9279('0x22')](_0x506fa6)[_0x9279('0x23')](function(_0x7af566){return _0x7af566;});}return null;};}function removeEntity(_0x500247,_0x12acd0){return function(_0x1593b2){if(_0x1593b2){return _0x1593b2[_0x9279('0x24')]()[_0x9279('0x23')](function(){var _0x34bebb=_0x1593b2[_0x9279('0x25')]({'plain':!![]});var _0x51c2d5=_0x9279('0x26');return db[_0x9279('0x27')][_0x9279('0x24')]({'where':{'type':_0x51c2d5,'resourceId':_0x34bebb['id']}})[_0x9279('0x23')](function(){return _0x1593b2;});})[_0x9279('0x23')](function(){_0x500247[_0x9279('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x292730,_0x305ebb){return function(_0x6f8e97){if(!_0x6f8e97){_0x292730[_0x9279('0x16')](0x194);}return _0x6f8e97;};}function handleError(_0x13f4d0,_0x2a1ae9){_0x2a1ae9=_0x2a1ae9||0x1f4;return function(_0x4beeb0){logger[_0x9279('0x28')](_0x4beeb0[_0x9279('0x29')]);if(_0x4beeb0['name']){delete _0x4beeb0['name'];}_0x13f4d0[_0x9279('0x17')](_0x2a1ae9)[_0x9279('0x2a')](_0x4beeb0);};}exports[_0x9279('0x2b')]=function(_0x558268,_0x5634b2){var _0xdd9d4c={},_0x264e46={},_0x4ce306={'count':0x0,'rows':[]};var _0x45e65f=_['map'](db[_0x9279('0x2c')][_0x9279('0x2d')],function(_0x3685fa){return{'name':_0x3685fa[_0x9279('0x2e')],'type':_0x3685fa[_0x9279('0x2f')][_0x9279('0x30')]};});_0x264e46[_0x9279('0x31')]=_[_0x9279('0x32')](_0x45e65f,_0x9279('0x33'));_0x264e46[_0x9279('0x34')]=_[_0x9279('0x35')](_0x558268['query']);_0x264e46['filters']=_['intersection'](_0x264e46['model'],_0x264e46[_0x9279('0x34')]);_0xdd9d4c[_0x9279('0x36')]=_['intersection'](_0x264e46['model'],qs[_0x9279('0x37')](_0x558268[_0x9279('0x34')][_0x9279('0x37')]));_0xdd9d4c['attributes']=_0xdd9d4c[_0x9279('0x36')]['length']?_0xdd9d4c[_0x9279('0x36')]:_0x264e46[_0x9279('0x31')];if(!_0x558268['query']['hasOwnProperty']('nolimit')){_0xdd9d4c[_0x9279('0x1a')]=qs[_0x9279('0x1a')](_0x558268[_0x9279('0x34')][_0x9279('0x1a')]);_0xdd9d4c[_0x9279('0x1c')]=qs[_0x9279('0x1c')](_0x558268[_0x9279('0x34')][_0x9279('0x1c')]);}_0xdd9d4c[_0x9279('0x38')]=qs[_0x9279('0x39')](_0x558268[_0x9279('0x34')][_0x9279('0x39')]);_0xdd9d4c[_0x9279('0x3a')]=qs[_0x9279('0x3b')](_[_0x9279('0x3c')](_0x558268[_0x9279('0x34')],_0x264e46[_0x9279('0x3b')]),_0x45e65f);if(_0x558268[_0x9279('0x34')]['filter']){_0xdd9d4c[_0x9279('0x3a')]=_[_0x9279('0x3d')](_0xdd9d4c[_0x9279('0x3a')],{'$or':_[_0x9279('0x32')](_0x45e65f,function(_0x413bbe){if(_0x413bbe['type']!=='VIRTUAL'){var _0x2a7ba4={};_0x2a7ba4[_0x413bbe[_0x9279('0x33')]]={'$like':'%'+_0x558268[_0x9279('0x34')]['filter']+'%'};return _0x2a7ba4;}})});}_0xdd9d4c=_[_0x9279('0x3d')]({},_0xdd9d4c,_0x558268[_0x9279('0x3e')]);var _0x3c01b2={'where':_0xdd9d4c[_0x9279('0x3a')]};return db[_0x9279('0x2c')]['count'](_0x3c01b2)['then'](function(_0x1a941d){_0x4ce306[_0x9279('0x1b')]=_0x1a941d;if(_0x558268[_0x9279('0x34')][_0x9279('0x3f')]){_0xdd9d4c['include']=[{'all':!![]}];}return db[_0x9279('0x2c')][_0x9279('0x40')](_0xdd9d4c);})[_0x9279('0x23')](function(_0x394fc1){_0x4ce306[_0x9279('0x41')]=_0x394fc1;return _0x4ce306;})[_0x9279('0x23')](respondWithFilteredResult(_0x5634b2,_0xdd9d4c))[_0x9279('0x42')](handleError(_0x5634b2,null));};exports['show']=function(_0xd263f7,_0x45a90a){var _0x561dc2={'raw':![],'where':{'id':_0xd263f7[_0x9279('0x43')]['id']}},_0x4b0e6d={};_0x4b0e6d[_0x9279('0x31')]=_[_0x9279('0x35')](db[_0x9279('0x2c')][_0x9279('0x2d')]);_0x4b0e6d['query']=_['keys'](_0xd263f7[_0x9279('0x34')]);_0x4b0e6d[_0x9279('0x3b')]=_[_0x9279('0x44')](_0x4b0e6d[_0x9279('0x31')],_0x4b0e6d['query']);_0x561dc2['attributes']=_['intersection'](_0x4b0e6d[_0x9279('0x31')],qs[_0x9279('0x37')](_0xd263f7[_0x9279('0x34')][_0x9279('0x37')]));_0x561dc2['attributes']=_0x561dc2['attributes']['length']?_0x561dc2[_0x9279('0x36')]:_0x4b0e6d[_0x9279('0x31')];if(_0xd263f7['query'][_0x9279('0x3f')]){_0x561dc2['include']=[{'all':!![]}];}_0x561dc2=_['merge']({},_0x561dc2,_0xd263f7[_0x9279('0x3e')]);return db[_0x9279('0x2c')]['find'](_0x561dc2)['then'](handleEntityNotFound(_0x45a90a,null))[_0x9279('0x23')](respondWithResult(_0x45a90a,null))['catch'](handleError(_0x45a90a,null));};exports[_0x9279('0x45')]=function(_0x3a5589,_0xd62b0b){return db[_0x9279('0x2c')][_0x9279('0x45')](_0x3a5589[_0x9279('0x46')],{})[_0x9279('0x23')](function(_0x5b85ef){var _0x44cc32=_0x3a5589['user']['get']({'plain':!![]});if(!_0x44cc32)throw new Error(_0x9279('0x47'));if(_0x44cc32[_0x9279('0x48')]===_0x9279('0x49')){var _0x1cf459=_0x5b85ef[_0x9279('0x25')]({'plain':!![]});var _0xce8528='Triggers';return db['UserProfileSection'][_0x9279('0x4a')]({'where':{'name':_0xce8528,'userProfileId':_0x44cc32[_0x9279('0x4b')]},'raw':!![]})['then'](function(_0x1f20a5){if(_0x1f20a5&&_0x1f20a5[_0x9279('0x4c')]===0x0){return db[_0x9279('0x27')][_0x9279('0x45')]({'name':_0x1cf459[_0x9279('0x33')],'resourceId':_0x1cf459['id'],'type':_0x1f20a5[_0x9279('0x33')],'sectionId':_0x1f20a5['id']},{})['then'](function(){return _0x5b85ef;});}else{return _0x5b85ef;}})[_0x9279('0x42')](function(_0x30c7ab){logger[_0x9279('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x30c7ab);throw _0x30c7ab;});}return _0x5b85ef;})['then'](respondWithResult(_0xd62b0b,0xc9))[_0x9279('0x42')](handleError(_0xd62b0b,null));};exports['update']=function(_0x2208f2,_0xd2300){if(_0x2208f2[_0x9279('0x46')]['id']){delete _0x2208f2[_0x9279('0x46')]['id'];}return db[_0x9279('0x2c')][_0x9279('0x4a')]({'where':{'id':_0x2208f2[_0x9279('0x43')]['id']}})['then'](handleEntityNotFound(_0xd2300,null))[_0x9279('0x23')](saveUpdates(_0x2208f2[_0x9279('0x46')],null))[_0x9279('0x23')](respondWithResult(_0xd2300,null))['catch'](handleError(_0xd2300,null));};exports[_0x9279('0x24')]=function(_0x5a939e,_0x5e5b60){return db[_0x9279('0x2c')][_0x9279('0x4a')]({'where':{'id':_0x5a939e[_0x9279('0x43')]['id']}})[_0x9279('0x23')](handleEntityNotFound(_0x5e5b60,null))[_0x9279('0x23')](removeEntity(_0x5e5b60,null))[_0x9279('0x42')](handleError(_0x5e5b60,null));};exports[_0x9279('0x4d')]=function(_0x3d8805,_0x59a420,_0x1aee74){if(_0x3d8805[_0x9279('0x46')]['id']){delete _0x3d8805[_0x9279('0x46')]['id'];}return db[_0x9279('0x2c')][_0x9279('0x4a')]({'where':{'id':_0x3d8805['params']['id']}})[_0x9279('0x23')](handleEntityNotFound(_0x59a420,null))[_0x9279('0x23')](function(_0x546018){if(_0x546018){_0x3d8805[_0x9279('0x46')][_0x9279('0x4e')]=_0x546018['id'];return db['Condition']['create'](_0x3d8805[_0x9279('0x46')]);}})[_0x9279('0x23')](respondWithResult(_0x59a420,null))['catch'](handleError(_0x59a420,null));};exports[_0x9279('0x4f')]=function(_0x4c6a11,_0x3b7a19,_0x1c7837){if(_0x4c6a11[_0x9279('0x46')]['id']){delete _0x4c6a11[_0x9279('0x46')]['id'];}return db['Trigger'][_0x9279('0x4a')]({'where':{'id':_0x4c6a11[_0x9279('0x43')]['id']}})['then'](handleEntityNotFound(_0x3b7a19,null))[_0x9279('0x23')](function(_0x5c2b10){if(_0x5c2b10){_0x4c6a11[_0x9279('0x46')]['TriggerAnyId']=_0x5c2b10['id'];return db[_0x9279('0x50')]['create'](_0x4c6a11[_0x9279('0x46')]);}})[_0x9279('0x23')](respondWithResult(_0x3b7a19,null))[_0x9279('0x42')](handleError(_0x3b7a19,null));};exports['getAllConditions']=function(_0xab52e0,_0x28363a,_0x742d84){var _0x2493e1={};var _0x8c880e={};var _0x559be3;var _0xd1e4b2;return db[_0x9279('0x2c')][_0x9279('0x51')]({'where':{'id':_0xab52e0['params']['id']}})[_0x9279('0x23')](handleEntityNotFound(_0x28363a,null))[_0x9279('0x23')](function(_0xb52c25){if(_0xb52c25){_0x559be3=_0xb52c25;_0x8c880e['model']=_['keys'](db[_0x9279('0x50')][_0x9279('0x2d')]);_0x8c880e['query']=_[_0x9279('0x35')](_0xab52e0[_0x9279('0x34')]);_0x8c880e[_0x9279('0x3b')]=_[_0x9279('0x44')](_0x8c880e[_0x9279('0x31')],_0x8c880e[_0x9279('0x34')]);_0x2493e1[_0x9279('0x36')]=_['intersection'](_0x8c880e[_0x9279('0x31')],qs[_0x9279('0x37')](_0xab52e0[_0x9279('0x34')][_0x9279('0x37')]));_0x2493e1[_0x9279('0x36')]=_0x2493e1[_0x9279('0x36')][_0x9279('0x52')]?_0x2493e1[_0x9279('0x36')]:_0x8c880e[_0x9279('0x31')];_0x2493e1[_0x9279('0x38')]=qs[_0x9279('0x39')](_0xab52e0[_0x9279('0x34')][_0x9279('0x39')]);_0x2493e1['where']=qs[_0x9279('0x3b')](_[_0x9279('0x3c')](_0xab52e0[_0x9279('0x34')],_0x8c880e[_0x9279('0x3b')]));if(_0xab52e0[_0x9279('0x34')][_0x9279('0x53')]){_0x2493e1[_0x9279('0x3a')]=_[_0x9279('0x3d')](_0x2493e1[_0x9279('0x3a')],{'$or':_['map'](_0x2493e1[_0x9279('0x36')],function(_0x3d5ec2){var _0x22ca9f={};_0x22ca9f[_0x3d5ec2]={'$like':'%'+_0xab52e0[_0x9279('0x34')][_0x9279('0x53')]+'%'};return _0x22ca9f;})});}_0x2493e1=_['merge']({},_0x2493e1,_0xab52e0[_0x9279('0x3e')]);return _0x559be3[_0x9279('0x54')](_0x2493e1);}})['then'](function(_0x26a8d8){if(_0x26a8d8){_0xd1e4b2=_0x26a8d8[_0x9279('0x52')];if(!_0xab52e0['query'][_0x9279('0x55')](_0x9279('0x56'))){_0x2493e1['limit']=qs[_0x9279('0x1a')](_0xab52e0[_0x9279('0x34')][_0x9279('0x1a')]);_0x2493e1[_0x9279('0x1c')]=qs[_0x9279('0x1c')](_0xab52e0[_0x9279('0x34')]['offset']);}return _0x559be3['getAllConditions'](_0x2493e1);}})[_0x9279('0x23')](function(_0x13c76c){if(_0x13c76c){return _0x13c76c?{'count':_0xd1e4b2,'rows':_0x13c76c}:null;}})['then'](respondWithResult(_0x28363a,null))[_0x9279('0x42')](handleError(_0x28363a,null));};exports[_0x9279('0x57')]=function(_0xa1cabd,_0x168f81,_0x25776f){var _0x43abea={};var _0x1c0437={};var _0x3d4af1;var _0x4ab7d5;return db[_0x9279('0x2c')][_0x9279('0x51')]({'where':{'id':_0xa1cabd[_0x9279('0x43')]['id']}})['then'](handleEntityNotFound(_0x168f81,null))[_0x9279('0x23')](function(_0x3951ad){if(_0x3951ad){_0x3d4af1=_0x3951ad;_0x1c0437['model']=_[_0x9279('0x35')](db[_0x9279('0x50')][_0x9279('0x2d')]);_0x1c0437['query']=_[_0x9279('0x35')](_0xa1cabd[_0x9279('0x34')]);_0x1c0437[_0x9279('0x3b')]=_['intersection'](_0x1c0437['model'],_0x1c0437['query']);_0x43abea[_0x9279('0x36')]=_['intersection'](_0x1c0437[_0x9279('0x31')],qs[_0x9279('0x37')](_0xa1cabd[_0x9279('0x34')]['fields']));_0x43abea[_0x9279('0x36')]=_0x43abea['attributes'][_0x9279('0x52')]?_0x43abea[_0x9279('0x36')]:_0x1c0437['model'];_0x43abea[_0x9279('0x38')]=qs[_0x9279('0x39')](_0xa1cabd[_0x9279('0x34')][_0x9279('0x39')]);_0x43abea[_0x9279('0x3a')]=qs[_0x9279('0x3b')](_[_0x9279('0x3c')](_0xa1cabd[_0x9279('0x34')],_0x1c0437['filters']));if(_0xa1cabd[_0x9279('0x34')][_0x9279('0x53')]){_0x43abea[_0x9279('0x3a')]=_['merge'](_0x43abea[_0x9279('0x3a')],{'$or':_[_0x9279('0x32')](_0x43abea[_0x9279('0x36')],function(_0x53f9b7){var _0xe6b776={};_0xe6b776[_0x53f9b7]={'$like':'%'+_0xa1cabd[_0x9279('0x34')][_0x9279('0x53')]+'%'};return _0xe6b776;})});}_0x43abea=_['merge']({},_0x43abea,_0xa1cabd[_0x9279('0x3e')]);return _0x3d4af1[_0x9279('0x57')](_0x43abea);}})[_0x9279('0x23')](function(_0x4dc315){if(_0x4dc315){_0x4ab7d5=_0x4dc315[_0x9279('0x52')];if(!_0xa1cabd[_0x9279('0x34')][_0x9279('0x55')](_0x9279('0x56'))){_0x43abea[_0x9279('0x1a')]=qs[_0x9279('0x1a')](_0xa1cabd['query'][_0x9279('0x1a')]);_0x43abea[_0x9279('0x1c')]=qs['offset'](_0xa1cabd[_0x9279('0x34')][_0x9279('0x1c')]);}return _0x3d4af1['getAnyConditions'](_0x43abea);}})[_0x9279('0x23')](function(_0x38c2df){if(_0x38c2df){return _0x38c2df?{'count':_0x4ab7d5,'rows':_0x38c2df}:null;}})[_0x9279('0x23')](respondWithResult(_0x168f81,null))[_0x9279('0x42')](handleError(_0x168f81,null));};exports[_0x9279('0x58')]=function(_0x4fc020,_0x289b9f,_0x464212){if(_0x4fc020[_0x9279('0x46')]['id']){delete _0x4fc020['body']['id'];}return db['Trigger'][_0x9279('0x4a')]({'where':{'id':_0x4fc020['params']['id']}})[_0x9279('0x23')](handleEntityNotFound(_0x289b9f,null))[_0x9279('0x23')](function(_0x29394e){if(_0x29394e){_0x4fc020[_0x9279('0x46')]['TriggerId']=_0x29394e['id'];return db[_0x9279('0x59')][_0x9279('0x45')](_0x4fc020[_0x9279('0x46')]);}})[_0x9279('0x23')](respondWithResult(_0x289b9f,null))['catch'](handleError(_0x289b9f,null));};exports[_0x9279('0x5a')]=function(_0x224838,_0x1d0674,_0x44d611){var _0xd98408={};var _0x3a957d={};var _0x4f6f17;var _0x5a6917;return db['Trigger'][_0x9279('0x51')]({'where':{'id':_0x224838[_0x9279('0x43')]['id']}})[_0x9279('0x23')](handleEntityNotFound(_0x1d0674,null))[_0x9279('0x23')](function(_0x11d0f4){if(_0x11d0f4){_0x4f6f17=_0x11d0f4;_0x3a957d[_0x9279('0x31')]=_['keys'](db['Action']['rawAttributes']);_0x3a957d['query']=_['keys'](_0x224838[_0x9279('0x34')]);_0x3a957d[_0x9279('0x3b')]=_[_0x9279('0x44')](_0x3a957d['model'],_0x3a957d[_0x9279('0x34')]);_0xd98408[_0x9279('0x36')]=_[_0x9279('0x44')](_0x3a957d[_0x9279('0x31')],qs[_0x9279('0x37')](_0x224838[_0x9279('0x34')]['fields']));_0xd98408[_0x9279('0x36')]=_0xd98408[_0x9279('0x36')][_0x9279('0x52')]?_0xd98408[_0x9279('0x36')]:_0x3a957d['model'];_0xd98408[_0x9279('0x38')]=qs[_0x9279('0x39')](_0x224838['query']['sort']);_0xd98408['where']=qs[_0x9279('0x3b')](_['pick'](_0x224838[_0x9279('0x34')],_0x3a957d[_0x9279('0x3b')]));if(_0x224838[_0x9279('0x34')][_0x9279('0x53')]){_0xd98408[_0x9279('0x3a')]=_['merge'](_0xd98408['where'],{'$or':_[_0x9279('0x32')](_0xd98408[_0x9279('0x36')],function(_0x397241){var _0x4f55cf={};_0x4f55cf[_0x397241]={'$like':'%'+_0x224838[_0x9279('0x34')][_0x9279('0x53')]+'%'};return _0x4f55cf;})});}_0xd98408=_['merge']({},_0xd98408,_0x224838['options']);return _0x4f6f17[_0x9279('0x5a')](_0xd98408);}})[_0x9279('0x23')](function(_0x4bb693){if(_0x4bb693){_0x5a6917=_0x4bb693[_0x9279('0x52')];if(!_0x224838['query'][_0x9279('0x55')](_0x9279('0x56'))){_0xd98408[_0x9279('0x1a')]=qs[_0x9279('0x1a')](_0x224838[_0x9279('0x34')][_0x9279('0x1a')]);_0xd98408[_0x9279('0x1c')]=qs[_0x9279('0x1c')](_0x224838[_0x9279('0x34')][_0x9279('0x1c')]);}return _0x4f6f17[_0x9279('0x5a')](_0xd98408);}})[_0x9279('0x23')](function(_0x3b59c7){if(_0x3b59c7){return _0x3b59c7?{'count':_0x5a6917,'rows':_0x3b59c7}:null;}})[_0x9279('0x23')](respondWithResult(_0x1d0674,null))['catch'](handleError(_0x1d0674,null));};
\ No newline at end of file
+var _0x5792=['sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addAllCondition','addAnyCondition','TriggerAnyId','Condition','getAllConditions','findOne','options','getAnyConditions','addAction','TriggerId','Action','getActions','rimraf','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','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','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','then','destroy','get','Triggers','UserProfileResource','end','stack','name','send','index','map','Trigger','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x5d3903,_0x3d6c3e){var _0x4b8bc9=function(_0x92b297){while(--_0x92b297){_0x5d3903['push'](_0x5d3903['shift']());}};_0x4b8bc9(++_0x3d6c3e);}(_0x5792,0x135));var _0x2579=function(_0x2730b1,_0x46ab0b){_0x2730b1=_0x2730b1-0x0;var _0x28bc87=_0x5792[_0x2730b1];return _0x28bc87;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2579('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2579('0x1'));var BPromise=require(_0x2579('0x2'));var Mustache=require(_0x2579('0x3'));var util=require(_0x2579('0x4'));var path=require(_0x2579('0x5'));var sox=require(_0x2579('0x6'));var csv=require('to-csv');var ejs=require(_0x2579('0x7'));var fs=require('fs');var fs_extra=require(_0x2579('0x8'));var _=require(_0x2579('0x9'));var squel=require('squel');var crypto=require(_0x2579('0xa'));var jsforce=require(_0x2579('0xb'));var deskjs=require(_0x2579('0xc'));var toCsv=require('to-csv');var querystring=require(_0x2579('0xd'));var Papa=require('papaparse');var Redis=require(_0x2579('0xe'));var authService=require(_0x2579('0xf'));var qs=require(_0x2579('0x10'));var as=require(_0x2579('0x11'));var hardwareService=require(_0x2579('0x12'));var logger=require('../../config/logger')(_0x2579('0x13'));var utils=require(_0x2579('0x14'));var config=require(_0x2579('0x15'));var licenseUtil=require(_0x2579('0x16'));var db=require(_0x2579('0x17'))['db'];function respondWithStatusCode(_0x43f466,_0xe7f8ef){_0xe7f8ef=_0xe7f8ef||0xcc;return function(_0x27908b){if(_0x27908b){return _0x43f466[_0x2579('0x18')](_0xe7f8ef);}return _0x43f466['status'](_0xe7f8ef)['end']();};}function respondWithResult(_0x59fa08,_0x2eedb8){_0x2eedb8=_0x2eedb8||0xc8;return function(_0x13220f){if(_0x13220f){return _0x59fa08[_0x2579('0x19')](_0x2eedb8)[_0x2579('0x1a')](_0x13220f);}};}function respondWithFilteredResult(_0x588b90,_0x4c1d88){return function(_0x225c8a){if(_0x225c8a){var _0x220c50=typeof _0x4c1d88[_0x2579('0x1b')]===_0x2579('0x1c')&&typeof _0x4c1d88[_0x2579('0x1d')]===_0x2579('0x1c');var _0x331d0e=_0x225c8a[_0x2579('0x1e')];var _0x1f72fa=_0x220c50?0x0:_0x4c1d88[_0x2579('0x1b')];var _0x3f0385=_0x220c50?_0x225c8a[_0x2579('0x1e')]:_0x4c1d88[_0x2579('0x1b')]+_0x4c1d88['limit'];var _0x190c9e;if(_0x3f0385>=_0x331d0e){_0x3f0385=_0x331d0e;_0x190c9e=0xc8;}else{_0x190c9e=0xce;}_0x588b90[_0x2579('0x19')](_0x190c9e);return _0x588b90['set'](_0x2579('0x1f'),_0x1f72fa+'-'+_0x3f0385+'/'+_0x331d0e)['json'](_0x225c8a);}return null;};}function patchUpdates(_0xd5e319){return function(_0x4e1ed1){try{jsonpatch[_0x2579('0x20')](_0x4e1ed1,_0xd5e319,!![]);}catch(_0x38e83c){return BPromise['reject'](_0x38e83c);}return _0x4e1ed1[_0x2579('0x21')]();};}function saveUpdates(_0x35ea0a,_0x187292){return function(_0xd409be){if(_0xd409be){return _0xd409be['update'](_0x35ea0a)[_0x2579('0x22')](function(_0x1c488d){return _0x1c488d;});}return null;};}function removeEntity(_0x2d2189,_0x5726ed){return function(_0x14ba12){if(_0x14ba12){return _0x14ba12[_0x2579('0x23')]()[_0x2579('0x22')](function(){var _0x7f9344=_0x14ba12[_0x2579('0x24')]({'plain':!![]});var _0x3ac1eb=_0x2579('0x25');return db[_0x2579('0x26')][_0x2579('0x23')]({'where':{'type':_0x3ac1eb,'resourceId':_0x7f9344['id']}})['then'](function(){return _0x14ba12;});})[_0x2579('0x22')](function(){_0x2d2189[_0x2579('0x19')](0xcc)[_0x2579('0x27')]();});}};}function handleEntityNotFound(_0x3f8df1,_0x355d54){return function(_0x58b009){if(!_0x58b009){_0x3f8df1[_0x2579('0x18')](0x194);}return _0x58b009;};}function handleError(_0x2e95b8,_0x136e24){_0x136e24=_0x136e24||0x1f4;return function(_0x577031){logger['error'](_0x577031[_0x2579('0x28')]);if(_0x577031[_0x2579('0x29')]){delete _0x577031[_0x2579('0x29')];}_0x2e95b8[_0x2579('0x19')](_0x136e24)[_0x2579('0x2a')](_0x577031);};}exports[_0x2579('0x2b')]=function(_0x588c35,_0x5f5c46){var _0x46042d={},_0x5298db={},_0x130d53={'count':0x0,'rows':[]};var _0x2fbd89=_[_0x2579('0x2c')](db[_0x2579('0x2d')][_0x2579('0x2e')],function(_0x3f47f5){return{'name':_0x3f47f5['fieldName'],'type':_0x3f47f5[_0x2579('0x2f')][_0x2579('0x30')]};});_0x5298db[_0x2579('0x31')]=_[_0x2579('0x2c')](_0x2fbd89,_0x2579('0x29'));_0x5298db[_0x2579('0x32')]=_[_0x2579('0x33')](_0x588c35[_0x2579('0x32')]);_0x5298db[_0x2579('0x34')]=_[_0x2579('0x35')](_0x5298db[_0x2579('0x31')],_0x5298db[_0x2579('0x32')]);_0x46042d['attributes']=_['intersection'](_0x5298db['model'],qs['fields'](_0x588c35[_0x2579('0x32')][_0x2579('0x36')]));_0x46042d['attributes']=_0x46042d[_0x2579('0x37')][_0x2579('0x38')]?_0x46042d[_0x2579('0x37')]:_0x5298db['model'];if(!_0x588c35[_0x2579('0x32')][_0x2579('0x39')](_0x2579('0x3a'))){_0x46042d['limit']=qs[_0x2579('0x1d')](_0x588c35[_0x2579('0x32')][_0x2579('0x1d')]);_0x46042d[_0x2579('0x1b')]=qs['offset'](_0x588c35[_0x2579('0x32')][_0x2579('0x1b')]);}_0x46042d['order']=qs[_0x2579('0x3b')](_0x588c35[_0x2579('0x32')][_0x2579('0x3b')]);_0x46042d[_0x2579('0x3c')]=qs[_0x2579('0x34')](_[_0x2579('0x3d')](_0x588c35[_0x2579('0x32')],_0x5298db['filters']),_0x2fbd89);if(_0x588c35[_0x2579('0x32')]['filter']){_0x46042d[_0x2579('0x3c')]=_[_0x2579('0x3e')](_0x46042d[_0x2579('0x3c')],{'$or':_[_0x2579('0x2c')](_0x2fbd89,function(_0x30dc50){if(_0x30dc50[_0x2579('0x2f')]!==_0x2579('0x3f')){var _0x507c35={};_0x507c35[_0x30dc50[_0x2579('0x29')]]={'$like':'%'+_0x588c35['query'][_0x2579('0x40')]+'%'};return _0x507c35;}})});}_0x46042d=_['merge']({},_0x46042d,_0x588c35['options']);var _0x4403a3={'where':_0x46042d[_0x2579('0x3c')]};return db[_0x2579('0x2d')]['count'](_0x4403a3)[_0x2579('0x22')](function(_0x1ecabf){_0x130d53[_0x2579('0x1e')]=_0x1ecabf;if(_0x588c35['query'][_0x2579('0x41')]){_0x46042d[_0x2579('0x42')]=[{'all':!![]}];}return db[_0x2579('0x2d')][_0x2579('0x43')](_0x46042d);})[_0x2579('0x22')](function(_0x9e8e98){_0x130d53[_0x2579('0x44')]=_0x9e8e98;return _0x130d53;})[_0x2579('0x22')](respondWithFilteredResult(_0x5f5c46,_0x46042d))[_0x2579('0x45')](handleError(_0x5f5c46,null));};exports[_0x2579('0x46')]=function(_0x30d2ca,_0x4f5a01){var _0x1f644a={'raw':![],'where':{'id':_0x30d2ca['params']['id']}},_0x1e223f={};_0x1e223f['model']=_[_0x2579('0x33')](db[_0x2579('0x2d')][_0x2579('0x2e')]);_0x1e223f[_0x2579('0x32')]=_[_0x2579('0x33')](_0x30d2ca['query']);_0x1e223f[_0x2579('0x34')]=_[_0x2579('0x35')](_0x1e223f['model'],_0x1e223f[_0x2579('0x32')]);_0x1f644a['attributes']=_['intersection'](_0x1e223f[_0x2579('0x31')],qs[_0x2579('0x36')](_0x30d2ca[_0x2579('0x32')][_0x2579('0x36')]));_0x1f644a[_0x2579('0x37')]=_0x1f644a[_0x2579('0x37')]['length']?_0x1f644a[_0x2579('0x37')]:_0x1e223f[_0x2579('0x31')];if(_0x30d2ca[_0x2579('0x32')]['includeAll']){_0x1f644a[_0x2579('0x42')]=[{'all':!![]}];}_0x1f644a=_[_0x2579('0x3e')]({},_0x1f644a,_0x30d2ca['options']);return db[_0x2579('0x2d')][_0x2579('0x47')](_0x1f644a)[_0x2579('0x22')](handleEntityNotFound(_0x4f5a01,null))[_0x2579('0x22')](respondWithResult(_0x4f5a01,null))[_0x2579('0x45')](handleError(_0x4f5a01,null));};exports[_0x2579('0x48')]=function(_0xc17600,_0x1ee5aa){return db['Trigger'][_0x2579('0x48')](_0xc17600['body'],{})[_0x2579('0x22')](function(_0x1254e1){var _0x4d29c7=_0xc17600['user']['get']({'plain':!![]});if(!_0x4d29c7)throw new Error(_0x2579('0x49'));if(_0x4d29c7['role']==='user'){var _0x3411f7=_0x1254e1[_0x2579('0x24')]({'plain':!![]});var _0x15ddd2=_0x2579('0x25');return db[_0x2579('0x4a')][_0x2579('0x47')]({'where':{'name':_0x15ddd2,'userProfileId':_0x4d29c7[_0x2579('0x4b')]},'raw':!![]})[_0x2579('0x22')](function(_0x2dd43a){if(_0x2dd43a&&_0x2dd43a['autoAssociation']===0x0){return db['UserProfileResource'][_0x2579('0x48')]({'name':_0x3411f7[_0x2579('0x29')],'resourceId':_0x3411f7['id'],'type':_0x2dd43a[_0x2579('0x29')],'sectionId':_0x2dd43a['id']},{})['then'](function(){return _0x1254e1;});}else{return _0x1254e1;}})[_0x2579('0x45')](function(_0x18eab5){logger[_0x2579('0x4c')](_0x2579('0x4d'),_0x18eab5);throw _0x18eab5;});}return _0x1254e1;})[_0x2579('0x22')](respondWithResult(_0x1ee5aa,0xc9))['catch'](handleError(_0x1ee5aa,null));};exports['update']=function(_0x188158,_0x110e79){if(_0x188158[_0x2579('0x4e')]['id']){delete _0x188158[_0x2579('0x4e')]['id'];}return db[_0x2579('0x2d')][_0x2579('0x47')]({'where':{'id':_0x188158[_0x2579('0x4f')]['id']}})[_0x2579('0x22')](handleEntityNotFound(_0x110e79,null))[_0x2579('0x22')](saveUpdates(_0x188158[_0x2579('0x4e')],null))[_0x2579('0x22')](respondWithResult(_0x110e79,null))[_0x2579('0x45')](handleError(_0x110e79,null));};exports['destroy']=function(_0x47d09e,_0x29fc21){return db[_0x2579('0x2d')][_0x2579('0x47')]({'where':{'id':_0x47d09e[_0x2579('0x4f')]['id']}})[_0x2579('0x22')](handleEntityNotFound(_0x29fc21,null))[_0x2579('0x22')](removeEntity(_0x29fc21,null))[_0x2579('0x45')](handleError(_0x29fc21,null));};exports[_0x2579('0x50')]=function(_0x5a698e,_0x48218a,_0x8ebda9){if(_0x5a698e['body']['id']){delete _0x5a698e[_0x2579('0x4e')]['id'];}return db[_0x2579('0x2d')][_0x2579('0x47')]({'where':{'id':_0x5a698e[_0x2579('0x4f')]['id']}})[_0x2579('0x22')](handleEntityNotFound(_0x48218a,null))[_0x2579('0x22')](function(_0x11f6ab){if(_0x11f6ab){_0x5a698e[_0x2579('0x4e')]['TriggerAllId']=_0x11f6ab['id'];return db['Condition'][_0x2579('0x48')](_0x5a698e[_0x2579('0x4e')]);}})['then'](respondWithResult(_0x48218a,null))[_0x2579('0x45')](handleError(_0x48218a,null));};exports[_0x2579('0x51')]=function(_0x4ea469,_0x4a8df2,_0x1b361d){if(_0x4ea469[_0x2579('0x4e')]['id']){delete _0x4ea469[_0x2579('0x4e')]['id'];}return db['Trigger']['find']({'where':{'id':_0x4ea469[_0x2579('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4a8df2,null))[_0x2579('0x22')](function(_0x405c6d){if(_0x405c6d){_0x4ea469[_0x2579('0x4e')][_0x2579('0x52')]=_0x405c6d['id'];return db[_0x2579('0x53')][_0x2579('0x48')](_0x4ea469[_0x2579('0x4e')]);}})[_0x2579('0x22')](respondWithResult(_0x4a8df2,null))[_0x2579('0x45')](handleError(_0x4a8df2,null));};exports[_0x2579('0x54')]=function(_0x396e07,_0x2e260d,_0x2381e3){var _0x1960dc={};var _0x4c831c={};var _0x4e41c7;var _0x29b6aa;return db[_0x2579('0x2d')][_0x2579('0x55')]({'where':{'id':_0x396e07[_0x2579('0x4f')]['id']}})[_0x2579('0x22')](handleEntityNotFound(_0x2e260d,null))['then'](function(_0x4628ba){if(_0x4628ba){_0x4e41c7=_0x4628ba;_0x4c831c[_0x2579('0x31')]=_[_0x2579('0x33')](db[_0x2579('0x53')]['rawAttributes']);_0x4c831c[_0x2579('0x32')]=_[_0x2579('0x33')](_0x396e07[_0x2579('0x32')]);_0x4c831c['filters']=_['intersection'](_0x4c831c[_0x2579('0x31')],_0x4c831c[_0x2579('0x32')]);_0x1960dc[_0x2579('0x37')]=_['intersection'](_0x4c831c['model'],qs[_0x2579('0x36')](_0x396e07[_0x2579('0x32')][_0x2579('0x36')]));_0x1960dc[_0x2579('0x37')]=_0x1960dc[_0x2579('0x37')]['length']?_0x1960dc['attributes']:_0x4c831c[_0x2579('0x31')];_0x1960dc['order']=qs['sort'](_0x396e07[_0x2579('0x32')]['sort']);_0x1960dc[_0x2579('0x3c')]=qs[_0x2579('0x34')](_[_0x2579('0x3d')](_0x396e07[_0x2579('0x32')],_0x4c831c[_0x2579('0x34')]));if(_0x396e07[_0x2579('0x32')]['filter']){_0x1960dc[_0x2579('0x3c')]=_['merge'](_0x1960dc['where'],{'$or':_['map'](_0x1960dc[_0x2579('0x37')],function(_0x43fb32){var _0x355659={};_0x355659[_0x43fb32]={'$like':'%'+_0x396e07['query']['filter']+'%'};return _0x355659;})});}_0x1960dc=_[_0x2579('0x3e')]({},_0x1960dc,_0x396e07[_0x2579('0x56')]);return _0x4e41c7['getAllConditions'](_0x1960dc);}})['then'](function(_0x454a53){if(_0x454a53){_0x29b6aa=_0x454a53[_0x2579('0x38')];if(!_0x396e07[_0x2579('0x32')]['hasOwnProperty'](_0x2579('0x3a'))){_0x1960dc[_0x2579('0x1d')]=qs['limit'](_0x396e07['query'][_0x2579('0x1d')]);_0x1960dc['offset']=qs[_0x2579('0x1b')](_0x396e07[_0x2579('0x32')][_0x2579('0x1b')]);}return _0x4e41c7[_0x2579('0x54')](_0x1960dc);}})[_0x2579('0x22')](function(_0x5cb4c4){if(_0x5cb4c4){return _0x5cb4c4?{'count':_0x29b6aa,'rows':_0x5cb4c4}:null;}})[_0x2579('0x22')](respondWithResult(_0x2e260d,null))[_0x2579('0x45')](handleError(_0x2e260d,null));};exports[_0x2579('0x57')]=function(_0x337d5e,_0x3e2638,_0x1dd3a3){var _0x295512={};var _0x56efb={};var _0x17569f;var _0x118c78;return db[_0x2579('0x2d')][_0x2579('0x55')]({'where':{'id':_0x337d5e[_0x2579('0x4f')]['id']}})[_0x2579('0x22')](handleEntityNotFound(_0x3e2638,null))['then'](function(_0x1b3581){if(_0x1b3581){_0x17569f=_0x1b3581;_0x56efb[_0x2579('0x31')]=_['keys'](db[_0x2579('0x53')][_0x2579('0x2e')]);_0x56efb[_0x2579('0x32')]=_[_0x2579('0x33')](_0x337d5e[_0x2579('0x32')]);_0x56efb['filters']=_[_0x2579('0x35')](_0x56efb[_0x2579('0x31')],_0x56efb['query']);_0x295512[_0x2579('0x37')]=_[_0x2579('0x35')](_0x56efb[_0x2579('0x31')],qs['fields'](_0x337d5e[_0x2579('0x32')][_0x2579('0x36')]));_0x295512[_0x2579('0x37')]=_0x295512[_0x2579('0x37')][_0x2579('0x38')]?_0x295512[_0x2579('0x37')]:_0x56efb['model'];_0x295512['order']=qs[_0x2579('0x3b')](_0x337d5e['query'][_0x2579('0x3b')]);_0x295512['where']=qs['filters'](_['pick'](_0x337d5e[_0x2579('0x32')],_0x56efb[_0x2579('0x34')]));if(_0x337d5e['query'][_0x2579('0x40')]){_0x295512['where']=_[_0x2579('0x3e')](_0x295512[_0x2579('0x3c')],{'$or':_[_0x2579('0x2c')](_0x295512['attributes'],function(_0x5f11a6){var _0x3ffa9d={};_0x3ffa9d[_0x5f11a6]={'$like':'%'+_0x337d5e[_0x2579('0x32')][_0x2579('0x40')]+'%'};return _0x3ffa9d;})});}_0x295512=_[_0x2579('0x3e')]({},_0x295512,_0x337d5e['options']);return _0x17569f[_0x2579('0x57')](_0x295512);}})[_0x2579('0x22')](function(_0x501e1a){if(_0x501e1a){_0x118c78=_0x501e1a[_0x2579('0x38')];if(!_0x337d5e[_0x2579('0x32')][_0x2579('0x39')](_0x2579('0x3a'))){_0x295512[_0x2579('0x1d')]=qs[_0x2579('0x1d')](_0x337d5e['query']['limit']);_0x295512[_0x2579('0x1b')]=qs['offset'](_0x337d5e[_0x2579('0x32')][_0x2579('0x1b')]);}return _0x17569f[_0x2579('0x57')](_0x295512);}})['then'](function(_0x4575ca){if(_0x4575ca){return _0x4575ca?{'count':_0x118c78,'rows':_0x4575ca}:null;}})[_0x2579('0x22')](respondWithResult(_0x3e2638,null))[_0x2579('0x45')](handleError(_0x3e2638,null));};exports[_0x2579('0x58')]=function(_0x4f09ed,_0x2c1f3c,_0x5ef7e5){if(_0x4f09ed['body']['id']){delete _0x4f09ed[_0x2579('0x4e')]['id'];}return db[_0x2579('0x2d')][_0x2579('0x47')]({'where':{'id':_0x4f09ed[_0x2579('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2c1f3c,null))[_0x2579('0x22')](function(_0xbd6a03){if(_0xbd6a03){_0x4f09ed['body'][_0x2579('0x59')]=_0xbd6a03['id'];return db[_0x2579('0x5a')]['create'](_0x4f09ed['body']);}})[_0x2579('0x22')](respondWithResult(_0x2c1f3c,null))[_0x2579('0x45')](handleError(_0x2c1f3c,null));};exports['getActions']=function(_0x14d16d,_0x5b3b44,_0x2d5178){var _0x11c187={};var _0x545b35={};var _0x338ca7;var _0x3c48aa;return db[_0x2579('0x2d')][_0x2579('0x55')]({'where':{'id':_0x14d16d[_0x2579('0x4f')]['id']}})[_0x2579('0x22')](handleEntityNotFound(_0x5b3b44,null))['then'](function(_0x97aec3){if(_0x97aec3){_0x338ca7=_0x97aec3;_0x545b35['model']=_[_0x2579('0x33')](db['Action']['rawAttributes']);_0x545b35[_0x2579('0x32')]=_['keys'](_0x14d16d[_0x2579('0x32')]);_0x545b35[_0x2579('0x34')]=_['intersection'](_0x545b35[_0x2579('0x31')],_0x545b35[_0x2579('0x32')]);_0x11c187[_0x2579('0x37')]=_[_0x2579('0x35')](_0x545b35[_0x2579('0x31')],qs[_0x2579('0x36')](_0x14d16d[_0x2579('0x32')]['fields']));_0x11c187[_0x2579('0x37')]=_0x11c187[_0x2579('0x37')][_0x2579('0x38')]?_0x11c187['attributes']:_0x545b35[_0x2579('0x31')];_0x11c187['order']=qs[_0x2579('0x3b')](_0x14d16d[_0x2579('0x32')][_0x2579('0x3b')]);_0x11c187['where']=qs[_0x2579('0x34')](_[_0x2579('0x3d')](_0x14d16d['query'],_0x545b35[_0x2579('0x34')]));if(_0x14d16d[_0x2579('0x32')][_0x2579('0x40')]){_0x11c187[_0x2579('0x3c')]=_[_0x2579('0x3e')](_0x11c187[_0x2579('0x3c')],{'$or':_[_0x2579('0x2c')](_0x11c187[_0x2579('0x37')],function(_0x52791e){var _0x35fd9a={};_0x35fd9a[_0x52791e]={'$like':'%'+_0x14d16d['query']['filter']+'%'};return _0x35fd9a;})});}_0x11c187=_[_0x2579('0x3e')]({},_0x11c187,_0x14d16d[_0x2579('0x56')]);return _0x338ca7[_0x2579('0x5b')](_0x11c187);}})[_0x2579('0x22')](function(_0x577a66){if(_0x577a66){_0x3c48aa=_0x577a66[_0x2579('0x38')];if(!_0x14d16d[_0x2579('0x32')][_0x2579('0x39')](_0x2579('0x3a'))){_0x11c187[_0x2579('0x1d')]=qs[_0x2579('0x1d')](_0x14d16d[_0x2579('0x32')][_0x2579('0x1d')]);_0x11c187[_0x2579('0x1b')]=qs[_0x2579('0x1b')](_0x14d16d[_0x2579('0x32')][_0x2579('0x1b')]);}return _0x338ca7[_0x2579('0x5b')](_0x11c187);}})[_0x2579('0x22')](function(_0x403fc2){if(_0x403fc2){return _0x403fc2?{'count':_0x3c48aa,'rows':_0x403fc2}:null;}})['then'](respondWithResult(_0x5b3b44,null))['catch'](handleError(_0x5b3b44,null));};
\ No newline at end of file
index 48e59de..767c6c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1280=['exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./trigger.attributes'];(function(_0x419560,_0x16a92c){var _0x52a0a9=function(_0x1cdc67){while(--_0x1cdc67){_0x419560['push'](_0x419560['shift']());}};_0x52a0a9(++_0x16a92c);}(_0x1280,0xba));var _0x0128=function(_0x5b34c0,_0x3ad403){_0x5b34c0=_0x5b34c0-0x0;var _0x242bd3=_0x1280[_0x5b34c0];return _0x242bd3;};'use strict';var _=require(_0x0128('0x0'));var util=require(_0x0128('0x1'));var logger=require(_0x0128('0x2'))(_0x0128('0x3'));var moment=require(_0x0128('0x4'));var BPromise=require(_0x0128('0x5'));var rp=require(_0x0128('0x6'));var fs=require('fs');var path=require(_0x0128('0x7'));var rimraf=require(_0x0128('0x8'));var config=require('../../config/environment');var attributes=require(_0x0128('0x9'));module[_0x0128('0xa')]=function(_0x59959a,_0x589536){return _0x59959a[_0x0128('0xb')](_0x0128('0xc'),attributes,{'tableName':_0x0128('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcd4e=['path','../../config/environment','exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','api','request-promise'];(function(_0x4b3b10,_0x11ed23){var _0x1c8221=function(_0x229dee){while(--_0x229dee){_0x4b3b10['push'](_0x4b3b10['shift']());}};_0x1c8221(++_0x11ed23);}(_0xcd4e,0x187));var _0xecd4=function(_0x20c5d3,_0x2c384e){_0x20c5d3=_0x20c5d3-0x0;var _0x564fc1=_0xcd4e[_0x20c5d3];return _0x564fc1;};'use strict';var _=require(_0xecd4('0x0'));var util=require(_0xecd4('0x1'));var logger=require(_0xecd4('0x2'))(_0xecd4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xecd4('0x4'));var fs=require('fs');var path=require(_0xecd4('0x5'));var rimraf=require('rimraf');var config=require(_0xecd4('0x6'));var attributes=require('./trigger.attributes');module[_0xecd4('0x7')]=function(_0x47f6ae,_0x41dd0c){return _0x47f6ae[_0xecd4('0x8')](_0xecd4('0x9'),attributes,{'tableName':_0xecd4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 68cee04..32512ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc49=['then','Trigger,\x20%s,\x20%s','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','Trigger','options','where','limit','include','map','model','attributes','GetTrigger','debug','find','raw','ShowTrigger','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x18988d,_0x2a30ad){var _0x10a47c=function(_0x4fae05){while(--_0x4fae05){_0x18988d['push'](_0x18988d['shift']());}};_0x10a47c(++_0x2a30ad);}(_0xdc49,0xa7));var _0x9dc4=function(_0x57d27a,_0x672957){_0x57d27a=_0x57d27a-0x0;var _0x45a92c=_0xdc49[_0x57d27a];return _0x45a92c;};'use strict';var _=require('lodash');var util=require(_0x9dc4('0x0'));var moment=require(_0x9dc4('0x1'));var BPromise=require('bluebird');var rs=require(_0x9dc4('0x2'));var fs=require('fs');var Redis=require(_0x9dc4('0x3'));var db=require(_0x9dc4('0x4'))['db'];var utils=require(_0x9dc4('0x5'));var logger=require(_0x9dc4('0x6'))(_0x9dc4('0x7'));var config=require(_0x9dc4('0x8'));var jayson=require(_0x9dc4('0x9'));var client=jayson[_0x9dc4('0xa')][_0x9dc4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1721c1,_0x3512dd,_0x55546b){return new BPromise(function(_0x16c3e6,_0x2cb1b9){return client[_0x9dc4('0xc')](_0x1721c1,_0x55546b)[_0x9dc4('0xd')](function(_0x39c33d){logger['info'](_0x9dc4('0xe'),_0x3512dd,_0x9dc4('0xf'));logger['debug'](_0x9dc4('0x10'),_0x3512dd,_0x9dc4('0xf'),JSON[_0x9dc4('0x11')](_0x39c33d));if(_0x39c33d[_0x9dc4('0x12')]){if(_0x39c33d[_0x9dc4('0x12')]['code']===0x1f4){logger['error'](_0x9dc4('0xe'),_0x3512dd,_0x39c33d[_0x9dc4('0x12')][_0x9dc4('0x13')]);return _0x2cb1b9(_0x39c33d[_0x9dc4('0x12')][_0x9dc4('0x13')]);}logger[_0x9dc4('0x12')](_0x9dc4('0xe'),_0x3512dd,_0x39c33d[_0x9dc4('0x12')]['message']);return _0x16c3e6(_0x39c33d[_0x9dc4('0x12')][_0x9dc4('0x13')]);}else{logger[_0x9dc4('0x14')](_0x9dc4('0xe'),_0x3512dd,_0x9dc4('0xf'));_0x16c3e6(_0x39c33d[_0x9dc4('0x15')][_0x9dc4('0x13')]);}})[_0x9dc4('0x16')](function(_0x388c81){logger[_0x9dc4('0x12')](_0x9dc4('0xe'),_0x3512dd,_0x388c81);_0x2cb1b9(_0x388c81);});});}exports['GetTrigger']=function(_0x34606d){var _0x5e77ec=this;return new Promise(function(_0x34c939,_0x57d4c){return db[_0x9dc4('0x17')]['findAll']({'raw':_0x34606d['options']?_0x34606d[_0x9dc4('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x34606d['options']?_0x34606d[_0x9dc4('0x18')][_0x9dc4('0x19')]||null:null,'attributes':_0x34606d['options']?_0x34606d[_0x9dc4('0x18')]['attributes']||null:null,'limit':_0x34606d[_0x9dc4('0x18')]?_0x34606d[_0x9dc4('0x18')][_0x9dc4('0x1a')]||null:null,'include':_0x34606d[_0x9dc4('0x18')]?_0x34606d[_0x9dc4('0x18')][_0x9dc4('0x1b')]?_[_0x9dc4('0x1c')](_0x34606d[_0x9dc4('0x18')][_0x9dc4('0x1b')],function(_0x478de4){return{'model':db[_0x478de4[_0x9dc4('0x1d')]],'as':_0x478de4['as'],'attributes':_0x478de4[_0x9dc4('0x1e')],'include':_0x478de4[_0x9dc4('0x1b')]?_[_0x9dc4('0x1c')](_0x478de4[_0x9dc4('0x1b')],function(_0x146a65){return{'model':db[_0x146a65['model']],'as':_0x146a65['as'],'attributes':_0x146a65[_0x9dc4('0x1e')],'include':_0x146a65[_0x9dc4('0x1b')]?_[_0x9dc4('0x1c')](_0x146a65['include'],function(_0x284973){return{'model':db[_0x284973[_0x9dc4('0x1d')]],'as':_0x284973['as'],'attributes':_0x284973[_0x9dc4('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9dc4('0xd')](function(_0x50e56e){logger[_0x9dc4('0x14')](_0x9dc4('0x1f'),_0x34606d);logger[_0x9dc4('0x20')](_0x9dc4('0x1f'),_0x34606d,JSON[_0x9dc4('0x11')](_0x50e56e));_0x34c939(_0x50e56e);})[_0x9dc4('0x16')](function(_0x49a638){logger[_0x9dc4('0x12')](_0x9dc4('0x1f'),_0x49a638['message'],_0x34606d);_0x57d4c(_0x5e77ec[_0x9dc4('0x12')](0x1f4,_0x49a638[_0x9dc4('0x13')]));});});};exports['ShowTrigger']=function(_0x361d28){var _0x5b603f=this;return new Promise(function(_0x6989ff,_0x1c8c5b){return db[_0x9dc4('0x17')][_0x9dc4('0x21')]({'raw':_0x361d28['options']?_0x361d28[_0x9dc4('0x18')][_0x9dc4('0x22')]===undefined?!![]:![]:!![],'where':_0x361d28[_0x9dc4('0x18')]?_0x361d28[_0x9dc4('0x18')][_0x9dc4('0x19')]||null:null,'attributes':_0x361d28[_0x9dc4('0x18')]?_0x361d28['options'][_0x9dc4('0x1e')]||null:null,'include':_0x361d28[_0x9dc4('0x18')]?_0x361d28[_0x9dc4('0x18')]['include']?_[_0x9dc4('0x1c')](_0x361d28[_0x9dc4('0x18')][_0x9dc4('0x1b')],function(_0x5d1497){return{'model':db[_0x5d1497[_0x9dc4('0x1d')]],'as':_0x5d1497['as'],'attributes':_0x5d1497[_0x9dc4('0x1e')],'include':_0x5d1497[_0x9dc4('0x1b')]?_['map'](_0x5d1497[_0x9dc4('0x1b')],function(_0x17beb5){return{'model':db[_0x17beb5[_0x9dc4('0x1d')]],'as':_0x17beb5['as'],'attributes':_0x17beb5['attributes'],'include':_0x17beb5['include']?_['map'](_0x17beb5['include'],function(_0x10a888){return{'model':db[_0x10a888[_0x9dc4('0x1d')]],'as':_0x10a888['as'],'attributes':_0x10a888[_0x9dc4('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9dc4('0xd')](function(_0x585a87){logger['info'](_0x9dc4('0x23'),_0x361d28);logger[_0x9dc4('0x20')](_0x9dc4('0x23'),_0x361d28,JSON[_0x9dc4('0x11')](_0x585a87));_0x6989ff(_0x585a87);})['catch'](function(_0x5eb547){logger[_0x9dc4('0x12')](_0x9dc4('0x23'),_0x5eb547[_0x9dc4('0x13')],_0x361d28);_0x1c8c5b(_0x5b603f[_0x9dc4('0x12')](0x1f4,_0x5eb547['message']));});});};
\ No newline at end of file
+var _0xe074=['options','raw','where','include','model','attributes','stringify','ShowTrigger','find','map','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','code','error','Trigger,\x20%s,\x20%s','message','result','catch','GetTrigger','Trigger','findAll'];(function(_0x562f3b,_0x4c65ae){var _0x1edd55=function(_0xe67e06){while(--_0xe67e06){_0x562f3b['push'](_0x562f3b['shift']());}};_0x1edd55(++_0x4c65ae);}(_0xe074,0x92));var _0x4e07=function(_0x48478f,_0x537acd){_0x48478f=_0x48478f-0x0;var _0x10af50=_0xe074[_0x48478f];return _0x10af50;};'use strict';var _=require(_0x4e07('0x0'));var util=require(_0x4e07('0x1'));var moment=require(_0x4e07('0x2'));var BPromise=require(_0x4e07('0x3'));var rs=require(_0x4e07('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4e07('0x5'));var logger=require('../../config/logger')(_0x4e07('0x6'));var config=require('../../config/environment');var jayson=require(_0x4e07('0x7'));var client=jayson[_0x4e07('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ca56f,_0x5d136a,_0x15f13a){return new BPromise(function(_0x4cc99e,_0x239180){return client[_0x4e07('0x9')](_0x3ca56f,_0x15f13a)[_0x4e07('0xa')](function(_0x38b649){logger[_0x4e07('0xb')]('Trigger,\x20%s,\x20%s',_0x5d136a,_0x4e07('0xc'));logger[_0x4e07('0xd')](_0x4e07('0xe'),_0x5d136a,'request\x20sent',JSON['stringify'](_0x38b649));if(_0x38b649['error']){if(_0x38b649['error'][_0x4e07('0xf')]===0x1f4){logger[_0x4e07('0x10')](_0x4e07('0x11'),_0x5d136a,_0x38b649[_0x4e07('0x10')][_0x4e07('0x12')]);return _0x239180(_0x38b649['error'][_0x4e07('0x12')]);}logger[_0x4e07('0x10')](_0x4e07('0x11'),_0x5d136a,_0x38b649[_0x4e07('0x10')]['message']);return _0x4cc99e(_0x38b649[_0x4e07('0x10')]['message']);}else{logger[_0x4e07('0xb')]('Trigger,\x20%s,\x20%s',_0x5d136a,_0x4e07('0xc'));_0x4cc99e(_0x38b649[_0x4e07('0x13')]['message']);}})[_0x4e07('0x14')](function(_0x4aaf93){logger[_0x4e07('0x10')]('Trigger,\x20%s,\x20%s',_0x5d136a,_0x4aaf93);_0x239180(_0x4aaf93);});});}exports[_0x4e07('0x15')]=function(_0x286dbe){var _0x214b4d=this;return new Promise(function(_0x2004a4,_0x37686c){return db[_0x4e07('0x16')][_0x4e07('0x17')]({'raw':_0x286dbe[_0x4e07('0x18')]?_0x286dbe['options'][_0x4e07('0x19')]===undefined?!![]:![]:!![],'where':_0x286dbe[_0x4e07('0x18')]?_0x286dbe[_0x4e07('0x18')][_0x4e07('0x1a')]||null:null,'attributes':_0x286dbe['options']?_0x286dbe[_0x4e07('0x18')]['attributes']||null:null,'limit':_0x286dbe[_0x4e07('0x18')]?_0x286dbe[_0x4e07('0x18')]['limit']||null:null,'include':_0x286dbe['options']?_0x286dbe['options'][_0x4e07('0x1b')]?_['map'](_0x286dbe[_0x4e07('0x18')][_0x4e07('0x1b')],function(_0x4da9a9){return{'model':db[_0x4da9a9[_0x4e07('0x1c')]],'as':_0x4da9a9['as'],'attributes':_0x4da9a9[_0x4e07('0x1d')],'include':_0x4da9a9['include']?_['map'](_0x4da9a9[_0x4e07('0x1b')],function(_0x4983c0){return{'model':db[_0x4983c0[_0x4e07('0x1c')]],'as':_0x4983c0['as'],'attributes':_0x4983c0[_0x4e07('0x1d')],'include':_0x4983c0[_0x4e07('0x1b')]?_['map'](_0x4983c0['include'],function(_0x49fd1e){return{'model':db[_0x49fd1e['model']],'as':_0x49fd1e['as'],'attributes':_0x49fd1e[_0x4e07('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3ed1a1){logger[_0x4e07('0xb')](_0x4e07('0x15'),_0x286dbe);logger[_0x4e07('0xd')](_0x4e07('0x15'),_0x286dbe,JSON[_0x4e07('0x1e')](_0x3ed1a1));_0x2004a4(_0x3ed1a1);})[_0x4e07('0x14')](function(_0x3047dd){logger[_0x4e07('0x10')](_0x4e07('0x15'),_0x3047dd[_0x4e07('0x12')],_0x286dbe);_0x37686c(_0x214b4d[_0x4e07('0x10')](0x1f4,_0x3047dd[_0x4e07('0x12')]));});});};exports[_0x4e07('0x1f')]=function(_0x35f92d){var _0x52356c=this;return new Promise(function(_0x25b3de,_0x1bee03){return db['Trigger'][_0x4e07('0x20')]({'raw':_0x35f92d['options']?_0x35f92d['options'][_0x4e07('0x19')]===undefined?!![]:![]:!![],'where':_0x35f92d[_0x4e07('0x18')]?_0x35f92d[_0x4e07('0x18')][_0x4e07('0x1a')]||null:null,'attributes':_0x35f92d[_0x4e07('0x18')]?_0x35f92d[_0x4e07('0x18')][_0x4e07('0x1d')]||null:null,'include':_0x35f92d[_0x4e07('0x18')]?_0x35f92d[_0x4e07('0x18')]['include']?_[_0x4e07('0x21')](_0x35f92d['options']['include'],function(_0x422403){return{'model':db[_0x422403[_0x4e07('0x1c')]],'as':_0x422403['as'],'attributes':_0x422403[_0x4e07('0x1d')],'include':_0x422403[_0x4e07('0x1b')]?_['map'](_0x422403['include'],function(_0x41459c){return{'model':db[_0x41459c[_0x4e07('0x1c')]],'as':_0x41459c['as'],'attributes':_0x41459c[_0x4e07('0x1d')],'include':_0x41459c[_0x4e07('0x1b')]?_[_0x4e07('0x21')](_0x41459c['include'],function(_0x355402){return{'model':db[_0x355402['model']],'as':_0x355402['as'],'attributes':_0x355402[_0x4e07('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x4e07('0xa')](function(_0x190806){logger['info']('ShowTrigger',_0x35f92d);logger[_0x4e07('0xd')](_0x4e07('0x1f'),_0x35f92d,JSON[_0x4e07('0x1e')](_0x190806));_0x25b3de(_0x190806);})[_0x4e07('0x14')](function(_0x407c24){logger['error']('ShowTrigger',_0x407c24[_0x4e07('0x12')],_0x35f92d);_0x1bee03(_0x52356c['error'](0x1f4,_0x407c24[_0x4e07('0x12')]));});});};
\ No newline at end of file
index d1e7101..973fdb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb908=['destroy','exports','path','connect-timeout','Router','../../config/environment','./trunk.controller','index','get','/:id','isAuthenticated','show','post','/:id/clone','clone','create','put','delete'];(function(_0x4677b1,_0x5d8724){var _0x57017e=function(_0x54923c){while(--_0x54923c){_0x4677b1['push'](_0x4677b1['shift']());}};_0x57017e(++_0x5d8724);}(_0xb908,0xc8));var _0x8b90=function(_0x1f7201,_0x141b79){_0x1f7201=_0x1f7201-0x0;var _0x289fd2=_0xb908[_0x1f7201];return _0x289fd2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8b90('0x0'));var timeout=require(_0x8b90('0x1'));var express=require('express');var router=express[_0x8b90('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8b90('0x3'));var controller=require(_0x8b90('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0x8b90('0x5')]);router[_0x8b90('0x6')](_0x8b90('0x7'),auth[_0x8b90('0x8')](),controller[_0x8b90('0x9')]);router[_0x8b90('0xa')](_0x8b90('0xb'),auth[_0x8b90('0x8')](),controller[_0x8b90('0xc')]);router['post']('/',auth[_0x8b90('0x8')](),controller[_0x8b90('0xd')]);router[_0x8b90('0xe')]('/:id',auth[_0x8b90('0x8')](),controller['update']);router[_0x8b90('0xf')]('/:id',auth[_0x8b90('0x8')](),controller[_0x8b90('0x10')]);module[_0x8b90('0x11')]=router;
\ No newline at end of file
+var _0xd324=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','/:id','isAuthenticated','show','/:id/clone','clone','create','put'];(function(_0x12a307,_0x5b5ed0){var _0x59ed57=function(_0x3c0e61){while(--_0x3c0e61){_0x12a307['push'](_0x12a307['shift']());}};_0x59ed57(++_0x5b5ed0);}(_0xd324,0xca));var _0x4d32=function(_0x158a58,_0x28e8e7){_0x158a58=_0x158a58-0x0;var _0x4935d9=_0xd324[_0x158a58];return _0x4935d9;};'use strict';var multer=require(_0x4d32('0x0'));var util=require(_0x4d32('0x1'));var path=require(_0x4d32('0x2'));var timeout=require(_0x4d32('0x3'));var express=require('express');var router=express[_0x4d32('0x4')]();var fs_extra=require(_0x4d32('0x5'));var auth=require(_0x4d32('0x6'));var interaction=require(_0x4d32('0x7'));var config=require(_0x4d32('0x8'));var controller=require(_0x4d32('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x4d32('0xa')](_0x4d32('0xb'),auth[_0x4d32('0xc')](),controller[_0x4d32('0xd')]);router['post'](_0x4d32('0xe'),auth['isAuthenticated'](),controller[_0x4d32('0xf')]);router['post']('/',auth[_0x4d32('0xc')](),controller[_0x4d32('0x10')]);router[_0x4d32('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x4d32('0x12')]);router[_0x4d32('0x13')](_0x4d32('0xb'),auth['isAuthenticated'](),controller[_0x4d32('0x14')]);module[_0x4d32('0x15')]=router;
\ No newline at end of file
index 35f9e4e..2817e06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd45f=['ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','setDataValue','join','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','auto','yes','nonat','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','INTEGER','always','refuse','originate','uac','uas','fingerprint','certificate','passive','actpass','BOOLEAN','sequelize','exports','ENUM','friend','user','peer','STRING'];(function(_0x379a6f,_0x45ca9c){var _0x1a1b33=function(_0x58ae22){while(--_0x58ae22){_0x379a6f['push'](_0x379a6f['shift']());}};_0x1a1b33(++_0x45ca9c);}(_0xd45f,0x1d9));var _0xfd45=function(_0x9dfcd7,_0x45df50){_0x9dfcd7=_0x9dfcd7-0x0;var _0x4328dc=_0xd45f[_0x9dfcd7];return _0x4328dc;};'use strict';var Sequelize=require(_0xfd45('0x0'));module[_0xfd45('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xfd45('0x2')](_0xfd45('0x3'),_0xfd45('0x4'),_0xfd45('0x5')),'allowNull':![],'defaultValue':_0xfd45('0x3')},'context':{'type':Sequelize[_0xfd45('0x6')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize['ENUM'](_0xfd45('0x7'),_0xfd45('0x8'),_0xfd45('0x9'),'ALLOWED',_0xfd45('0xa'),_0xfd45('0xb'),'PROHIB_FAILED_SCREEN',_0xfd45('0xc'))},'deny':{'type':Sequelize[_0xfd45('0x6')]},'permit':{'type':Sequelize[_0xfd45('0x6')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0xfd45('0x6')],'defaultValue':'udp','set':function(_0x38208a){this[_0xfd45('0xd')]('transport',_0x38208a?_0x38208a[_0xfd45('0xe')](','):null);},'get':function(){return this[_0xfd45('0xf')](_0xfd45('0x10'))?this[_0xfd45('0xf')](_0xfd45('0x10'))[_0xfd45('0x11')](','):null;},'comment':_0xfd45('0x12')},'dtmfmode':{'type':Sequelize[_0xfd45('0x2')](_0xfd45('0x13'),'info',_0xfd45('0x14'),'inband',_0xfd45('0x15')),'defaultValue':_0xfd45('0x13')},'directmedia':{'type':Sequelize['ENUM'](_0xfd45('0x16'),'no',_0xfd45('0x17'),'update',_0xfd45('0x18')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xfd45('0x2')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xfd45('0x6')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0xfd45('0x6')],'defaultValue':_0xfd45('0x19'),'set':function(_0x5d56fb){this['setDataValue'](_0xfd45('0x1a'),_0x5d56fb?_0x5d56fb[_0xfd45('0xe')](','):null);},'get':function(){return this[_0xfd45('0xf')]('nat')?this['getDataValue']('nat')[_0xfd45('0x11')](','):null;},'comment':_0xfd45('0x1b')},'callgroup':{'type':Sequelize[_0xfd45('0x6')]},'namedcallgroup':{'type':Sequelize[_0xfd45('0x6')]},'pickupgroup':{'type':Sequelize[_0xfd45('0x6')]},'namedpickupgroup':{'type':Sequelize[_0xfd45('0x6')]},'language':{'type':Sequelize[_0xfd45('0x6')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xfd45('0x6')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xfd45('0x6')],'defaultValue':_0xfd45('0x1c')},'allow':{'type':Sequelize[_0xfd45('0x6')],'allowNull':![],'defaultValue':_0xfd45('0x1d'),'set':function(_0x17dd44){this[_0xfd45('0xd')]('allow',_0x17dd44?_0x17dd44['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xfd45('0xf')](_0xfd45('0x1e'))?this[_0xfd45('0xf')](_0xfd45('0x1e'))[_0xfd45('0x11')](';'):null;},'comment':_0xfd45('0x1f')},'autoframing':{'type':Sequelize[_0xfd45('0x2')]('yes','no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0xfd45('0x20'),'set':function(_0x52acfc){this[_0xfd45('0xd')](_0xfd45('0x21'),_0x52acfc?_0x52acfc['join'](','):null);},'get':function(){return this['getDataValue'](_0xfd45('0x21'))?this[_0xfd45('0xf')]('insecure')['split'](','):null;},'comment':_0xfd45('0x22')},'trustrpid':{'type':Sequelize[_0xfd45('0x2')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xfd45('0x2')](_0xfd45('0x16'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xfd45('0x2')]('yes','no',_0xfd45('0x23'))},'promiscredir':{'type':Sequelize[_0xfd45('0x2')](_0xfd45('0x16'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0xfd45('0x16'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0xfd45('0x6')]},'callerid':{'type':Sequelize[_0xfd45('0x6')],'defaultValue':_0xfd45('0x24')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0xfd45('0x2')](_0xfd45('0x16'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xfd45('0x25')](0xb)},'allowoverlap':{'type':Sequelize[_0xfd45('0x2')](_0xfd45('0x16'),'no')},'allowsubscribe':{'type':Sequelize[_0xfd45('0x2')](_0xfd45('0x16'),'no')},'allowtransfer':{'type':Sequelize['ENUM']('yes','no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xfd45('0x16'),'no')},'subscribecontext':{'type':Sequelize[_0xfd45('0x6')]},'template':{'type':Sequelize[_0xfd45('0x6')]},'videosupport':{'type':Sequelize[_0xfd45('0x2')](_0xfd45('0x16'),'no',_0xfd45('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xfd45('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xfd45('0x16'),'no')},'mailbox':{'type':Sequelize[_0xfd45('0x6')]},'session_timers':{'type':Sequelize[_0xfd45('0x2')]('accept',_0xfd45('0x27'),_0xfd45('0x28'))},'session_expires':{'type':Sequelize[_0xfd45('0x25')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0xfd45('0x2')](_0xfd45('0x29'),_0xfd45('0x2a')),'defaultValue':_0xfd45('0x2a')},'t38pt_usertpsource':{'type':Sequelize[_0xfd45('0x6')]},'regexten':{'type':Sequelize[_0xfd45('0x6')]},'fromdomain':{'type':Sequelize[_0xfd45('0x6')]},'fromuser':{'type':Sequelize[_0xfd45('0x6')]},'port':{'type':Sequelize[_0xfd45('0x25')](0x5)},'qualify':{'type':Sequelize[_0xfd45('0x2')](_0xfd45('0x16'),'no'),'defaultValue':_0xfd45('0x16')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0xfd45('0x6')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xfd45('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0xfd45('0x2')](_0xfd45('0x16'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xfd45('0x6')]},'callbackextension':{'type':Sequelize[_0xfd45('0x6')]},'timert1':{'type':Sequelize[_0xfd45('0x25')](0xb)},'timerb':{'type':Sequelize[_0xfd45('0x25')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0xfd45('0x6')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0xfd45('0x25')](0xb)},'encryption':{'type':Sequelize[_0xfd45('0x2')](_0xfd45('0x16'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xfd45('0x2')]('yes','no')},'force_avp':{'type':Sequelize[_0xfd45('0x2')](_0xfd45('0x16'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0xfd45('0x16'),'no')},'dtlsenable':{'type':Sequelize[_0xfd45('0x2')](_0xfd45('0x16'),'no')},'dtlsverify':{'type':Sequelize[_0xfd45('0x2')](_0xfd45('0x16'),'no',_0xfd45('0x2b'),_0xfd45('0x2c'))},'dtlsrekey':{'type':Sequelize[_0xfd45('0x25')](0xb)},'dtlscertfile':{'type':Sequelize[_0xfd45('0x6')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0xfd45('0x6')]},'dtlscafile':{'type':Sequelize[_0xfd45('0x6')]},'dtlscapath':{'type':Sequelize[_0xfd45('0x6')]},'dtlssetup':{'type':Sequelize[_0xfd45('0x2')]('active',_0xfd45('0x2d'),_0xfd45('0x2e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xfd45('0x6')]},'usereqphone':{'type':Sequelize[_0xfd45('0x2')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xfd45('0x6')]},'recordofffeature':{'type':Sequelize[_0xfd45('0x6')]},'call_limit':{'type':Sequelize[_0xfd45('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xfd45('0x2')](_0xfd45('0x16'),'no')},'subscribemwi':{'type':Sequelize[_0xfd45('0x2')](_0xfd45('0x16'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0xfd45('0x6')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0xfd45('0x6')]},'description':{'type':Sequelize[_0xfd45('0x6')]},'host':{'type':Sequelize['STRING'],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0xfd45('0x2')](_0xfd45('0x16'),'no',_0xfd45('0x17'),'update','update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0xfd45('0x6')]},'otherFields':{'type':Sequelize[_0xfd45('0x6')]},'active':{'type':Sequelize[_0xfd45('0x2f')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xfd45('0x6')],'defaultValue':'no'}};
\ No newline at end of file
+var _0x3545=['ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','always','refuse','originate','uas','certificate','dynamic','update,nonat','BOOLEAN','sequelize','exports','STRING','name','friend','user','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','ENUM','yes','nonat','update','force_rport,comedia','setDataValue','nat','all'];(function(_0x4e9df2,_0x36818e){var _0x9fe790=function(_0x126eb5){while(--_0x126eb5){_0x4e9df2['push'](_0x4e9df2['shift']());}};_0x9fe790(++_0x36818e);}(_0x3545,0x6b));var _0x5354=function(_0x105045,_0x2e471e){_0x105045=_0x105045-0x0;var _0x2487d0=_0x3545[_0x105045];return _0x2487d0;};'use strict';var Sequelize=require(_0x5354('0x0'));module[_0x5354('0x1')]={'name':{'type':Sequelize[_0x5354('0x2')],'allowNull':![],'unique':_0x5354('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x5354('0x4'),_0x5354('0x5'),_0x5354('0x6')),'allowNull':![],'defaultValue':_0x5354('0x4')},'context':{'type':Sequelize[_0x5354('0x2')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize['ENUM'](_0x5354('0x7'),_0x5354('0x8'),'ALLOWED_FAILED_SCREEN','ALLOWED',_0x5354('0x9'),_0x5354('0xa'),_0x5354('0xb'),_0x5354('0xc'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x5354('0x2')]},'secret':{'type':Sequelize[_0x5354('0x2')]},'md5secret':{'type':Sequelize[_0x5354('0x2')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x5354('0xd'),'set':function(_0x3852b6){this['setDataValue'](_0x5354('0xe'),_0x3852b6?_0x3852b6[_0x5354('0xf')](','):null);},'get':function(){return this[_0x5354('0x10')](_0x5354('0xe'))?this[_0x5354('0x10')](_0x5354('0xe'))[_0x5354('0x11')](','):null;},'comment':_0x5354('0x12')},'dtmfmode':{'type':Sequelize['ENUM'](_0x5354('0x13'),_0x5354('0x14'),_0x5354('0x15'),_0x5354('0x16'),'auto'),'defaultValue':_0x5354('0x13')},'directmedia':{'type':Sequelize[_0x5354('0x17')](_0x5354('0x18'),'no',_0x5354('0x19'),_0x5354('0x1a'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x5354('0x17')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x5354('0x2')]},'directmediadeny':{'type':Sequelize[_0x5354('0x2')]},'nat':{'type':Sequelize[_0x5354('0x2')],'defaultValue':_0x5354('0x1b'),'set':function(_0x37fded){this[_0x5354('0x1c')](_0x5354('0x1d'),_0x37fded?_0x37fded[_0x5354('0xf')](','):null);},'get':function(){return this[_0x5354('0x10')](_0x5354('0x1d'))?this[_0x5354('0x10')](_0x5354('0x1d'))[_0x5354('0x11')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x5354('0x2')]},'namedcallgroup':{'type':Sequelize[_0x5354('0x2')]},'pickupgroup':{'type':Sequelize[_0x5354('0x2')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x5354('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x5354('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0x5354('0x1e')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5354('0x1f'),'set':function(_0x3aa6b0){this[_0x5354('0x1c')](_0x5354('0x20'),_0x3aa6b0?_0x3aa6b0[_0x5354('0xf')](';'):_0x5354('0x1f'));},'get':function(){return this[_0x5354('0x10')](_0x5354('0x20'))?this[_0x5354('0x10')](_0x5354('0x20'))[_0x5354('0x11')](';'):null;},'comment':_0x5354('0x21')},'autoframing':{'type':Sequelize[_0x5354('0x17')]('yes','no')},'insecure':{'type':Sequelize[_0x5354('0x2')],'defaultValue':_0x5354('0x22'),'set':function(_0x1f2725){this['setDataValue']('insecure',_0x1f2725?_0x1f2725['join'](','):null);},'get':function(){return this[_0x5354('0x10')]('insecure')?this[_0x5354('0x10')](_0x5354('0x23'))['split'](','):null;},'comment':_0x5354('0x24')},'trustrpid':{'type':Sequelize[_0x5354('0x17')](_0x5354('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x5354('0x17')](_0x5354('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x5354('0x17')](_0x5354('0x18'),'no','never')},'promiscredir':{'type':Sequelize['ENUM'](_0x5354('0x18'),'no')},'useclientcode':{'type':Sequelize[_0x5354('0x17')](_0x5354('0x18'),'no')},'accountcode':{'type':Sequelize[_0x5354('0x25')](0xb)},'setvar':{'type':Sequelize[_0x5354('0x2')]},'callerid':{'type':Sequelize[_0x5354('0x2')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x5354('0x2')]},'callcounter':{'type':Sequelize[_0x5354('0x17')](_0x5354('0x18'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x5354('0x25')](0xb)},'allowoverlap':{'type':Sequelize[_0x5354('0x17')](_0x5354('0x18'),'no')},'allowsubscribe':{'type':Sequelize[_0x5354('0x17')](_0x5354('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0x5354('0x17')](_0x5354('0x18'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x5354('0x18'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x5354('0x2')]},'videosupport':{'type':Sequelize[_0x5354('0x17')]('yes','no',_0x5354('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x5354('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x5354('0x17')](_0x5354('0x18'),'no')},'mailbox':{'type':Sequelize[_0x5354('0x2')]},'session_timers':{'type':Sequelize['ENUM']('accept',_0x5354('0x27'),_0x5354('0x28'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x5354('0x25')](0xb)},'session_refresher':{'type':Sequelize['ENUM']('uac',_0x5354('0x29')),'defaultValue':_0x5354('0x29')},'t38pt_usertpsource':{'type':Sequelize[_0x5354('0x2')]},'regexten':{'type':Sequelize[_0x5354('0x2')]},'fromdomain':{'type':Sequelize[_0x5354('0x2')]},'fromuser':{'type':Sequelize[_0x5354('0x2')]},'port':{'type':Sequelize[_0x5354('0x25')](0x5)},'qualify':{'type':Sequelize[_0x5354('0x17')](_0x5354('0x18'),'no'),'defaultValue':_0x5354('0x18')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x5354('0x2')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x5354('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x5354('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0x5354('0x17')](_0x5354('0x18'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x5354('0x2')]},'callbackextension':{'type':Sequelize[_0x5354('0x2')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x5354('0x25')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x5354('0x2')]},'contactdeny':{'type':Sequelize[_0x5354('0x2')]},'contactacl':{'type':Sequelize[_0x5354('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x5354('0x2')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x5354('0x17')](_0x5354('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x5354('0x18'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0x5354('0x18'),'no')},'icesupport':{'type':Sequelize[_0x5354('0x17')](_0x5354('0x18'),'no')},'dtlsenable':{'type':Sequelize[_0x5354('0x17')](_0x5354('0x18'),'no')},'dtlsverify':{'type':Sequelize[_0x5354('0x17')]('yes','no','fingerprint',_0x5354('0x2a'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x5354('0x2')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x5354('0x2')]},'dtlscafile':{'type':Sequelize[_0x5354('0x2')]},'dtlscapath':{'type':Sequelize[_0x5354('0x2')]},'dtlssetup':{'type':Sequelize[_0x5354('0x17')]('active','passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x5354('0x2')]},'usereqphone':{'type':Sequelize[_0x5354('0x17')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x5354('0x2')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x5354('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x5354('0x17')]('yes','no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x5354('0x18'),'no')},'vmexten':{'type':Sequelize[_0x5354('0x2')]},'mohinterpret':{'type':Sequelize[_0x5354('0x2')]},'mohsuggest':{'type':Sequelize[_0x5354('0x2')]},'parkinglot':{'type':Sequelize[_0x5354('0x2')]},'description':{'type':Sequelize[_0x5354('0x2')]},'host':{'type':Sequelize[_0x5354('0x2')],'defaultValue':_0x5354('0x2b')},'canreinvite':{'type':Sequelize[_0x5354('0x17')]('yes','no','nonat',_0x5354('0x1a'),_0x5354('0x2c')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x5354('0x2')]},'otherFields':{'type':Sequelize[_0x5354('0x2')]},'active':{'type':Sequelize[_0x5354('0x2d')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x5354('0x2')],'defaultValue':'no'}};
\ No newline at end of file
index 4b9a824..fec95e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d0e=['omit','updatedAt','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8','readFileSync','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','then','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','reject','update','destroy','get','Trunks','stack','name','send','map','Trunk','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','where','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','keys','rawAttributes','includeAll','find','createdAt','body'];(function(_0x5ed7af,_0x422676){var _0x29a495=function(_0x4dd4b6){while(--_0x4dd4b6){_0x5ed7af['push'](_0x5ed7af['shift']());}};_0x29a495(++_0x422676);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x3e4767,_0x119b83){_0x3e4767=_0x3e4767-0x0;var _0x3fa249=_0x8d0e[_0x3e4767];return _0x3fa249;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require(_0xe8d0('0x4'));var moment=require(_0xe8d0('0x5'));var BPromise=require(_0xe8d0('0x6'));var Mustache=require(_0xe8d0('0x7'));var util=require(_0xe8d0('0x8'));var path=require('path');var sox=require(_0xe8d0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d0('0xa'));var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var licenseUtil=require(_0xe8d0('0x19'));var db=require(_0xe8d0('0x1a'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xe8d0('0x1b')][_0xe8d0('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x533b42,_0x2b640d,_0x4cbd26,_0x59b4b7){return new BPromise(function(_0x90a1ea,_0x2aa906){var _0x1aa725=_0x59b4b7||client;return _0x1aa725[_0xe8d0('0x1d')](_0x533b42,_0x4cbd26)[_0xe8d0('0x1e')](function(_0x7151c6){logger['info'](_0xe8d0('0x1f'),_0x2b640d,'request\x20sent');logger[_0xe8d0('0x20')](_0xe8d0('0x21'),_0x2b640d,_0xe8d0('0x22'),JSON['stringify'](_0x7151c6));if(_0x7151c6['error']){if(_0x7151c6['error'][_0xe8d0('0x23')]===0x1f4){logger[_0xe8d0('0x24')](_0xe8d0('0x1f'),_0x2b640d,_0x7151c6[_0xe8d0('0x24')][_0xe8d0('0x25')]);return _0x2aa906(_0x7151c6['error'][_0xe8d0('0x25')]);}logger[_0xe8d0('0x24')]('Trunk,\x20%s,\x20%s',_0x2b640d,_0x7151c6['error']['message']);return _0x90a1ea(_0x7151c6[_0xe8d0('0x24')][_0xe8d0('0x25')]);}else{logger[_0xe8d0('0x26')](_0xe8d0('0x1f'),_0x2b640d,_0xe8d0('0x22'));_0x90a1ea(_0x7151c6[_0xe8d0('0x27')][_0xe8d0('0x25')]);}})[_0xe8d0('0x28')](function(_0x32e39a){logger['error'](_0xe8d0('0x1f'),_0x2b640d,_0x32e39a);_0x2aa906(_0x32e39a);});});}function respondWithStatusCode(_0x9f747,_0x572c25){_0x572c25=_0x572c25||0xcc;return function(_0x106614){if(_0x106614){return _0x9f747[_0xe8d0('0x29')](_0x572c25);}return _0x9f747[_0xe8d0('0x2a')](_0x572c25)[_0xe8d0('0x2b')]();};}function respondWithResult(_0x146783,_0x149dfd){_0x149dfd=_0x149dfd||0xc8;return function(_0x31519b){if(_0x31519b){return _0x146783[_0xe8d0('0x2a')](_0x149dfd)[_0xe8d0('0x2c')](_0x31519b);}};}function respondWithFilteredResult(_0x2dee67,_0x264de4){return function(_0x539548){if(_0x539548){var _0x24982c=typeof _0x264de4[_0xe8d0('0x2d')]===_0xe8d0('0x2e')&&typeof _0x264de4['limit']===_0xe8d0('0x2e');var _0x343b08=_0x539548['count'];var _0x1519e2=_0x24982c?0x0:_0x264de4[_0xe8d0('0x2d')];var _0x11fcf2=_0x24982c?_0x539548[_0xe8d0('0x2f')]:_0x264de4[_0xe8d0('0x2d')]+_0x264de4['limit'];var _0x3cc292;if(_0x11fcf2>=_0x343b08){_0x11fcf2=_0x343b08;_0x3cc292=0xc8;}else{_0x3cc292=0xce;}_0x2dee67['status'](_0x3cc292);return _0x2dee67['set']('Content-Range',_0x1519e2+'-'+_0x11fcf2+'/'+_0x343b08)[_0xe8d0('0x2c')](_0x539548);}return null;};}function patchUpdates(_0x13cd4c){return function(_0x36ccec){try{jsonpatch['apply'](_0x36ccec,_0x13cd4c,!![]);}catch(_0x57e375){return BPromise[_0xe8d0('0x30')](_0x57e375);}return _0x36ccec['save']();};}function saveUpdates(_0x3b5d31,_0x383084){return function(_0x327004){if(_0x327004){return _0x327004[_0xe8d0('0x31')](_0x3b5d31)[_0xe8d0('0x1e')](function(_0x5bbc9e){return _0x5bbc9e;});}return null;};}function removeEntity(_0x1bee61,_0x4db53c){return function(_0x402e90){if(_0x402e90){return _0x402e90[_0xe8d0('0x32')]()['then'](function(){var _0x4547b6=_0x402e90[_0xe8d0('0x33')]({'plain':!![]});var _0x4c1347=_0xe8d0('0x34');return db['UserProfileResource'][_0xe8d0('0x32')]({'where':{'type':_0x4c1347,'resourceId':_0x4547b6['id']}})['then'](function(){return _0x402e90;});})[_0xe8d0('0x1e')](function(){_0x1bee61['status'](0xcc)[_0xe8d0('0x2b')]();});}};}function handleEntityNotFound(_0xb2cdbf,_0x1e2430){return function(_0x320565){if(!_0x320565){_0xb2cdbf['sendStatus'](0x194);}return _0x320565;};}function handleError(_0x36a650,_0x354e19){_0x354e19=_0x354e19||0x1f4;return function(_0x20eec5){logger['error'](_0x20eec5[_0xe8d0('0x35')]);if(_0x20eec5[_0xe8d0('0x36')]){delete _0x20eec5[_0xe8d0('0x36')];}_0x36a650[_0xe8d0('0x2a')](_0x354e19)[_0xe8d0('0x37')](_0x20eec5);};}exports['index']=function(_0x5a969a,_0x1828c5){var _0x10970d={},_0x3d76d5={},_0x318106={'count':0x0,'rows':[]};var _0x23d72e=_[_0xe8d0('0x38')](db[_0xe8d0('0x39')]['rawAttributes'],function(_0x5dff14){return{'name':_0x5dff14[_0xe8d0('0x3a')],'type':_0x5dff14[_0xe8d0('0x3b')][_0xe8d0('0x3c')]};});_0x3d76d5[_0xe8d0('0x3d')]=_[_0xe8d0('0x38')](_0x23d72e,'name');_0x3d76d5[_0xe8d0('0x3e')]=_['keys'](_0x5a969a[_0xe8d0('0x3e')]);_0x3d76d5[_0xe8d0('0x3f')]=_[_0xe8d0('0x40')](_0x3d76d5['model'],_0x3d76d5[_0xe8d0('0x3e')]);_0x10970d[_0xe8d0('0x41')]=_[_0xe8d0('0x40')](_0x3d76d5[_0xe8d0('0x3d')],qs[_0xe8d0('0x42')](_0x5a969a['query']['fields']));_0x10970d['attributes']=_0x10970d['attributes'][_0xe8d0('0x43')]?_0x10970d['attributes']:_0x3d76d5[_0xe8d0('0x3d')];if(!_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x44')](_0xe8d0('0x45'))){_0x10970d[_0xe8d0('0x46')]=qs[_0xe8d0('0x46')](_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x46')]);_0x10970d['offset']=qs[_0xe8d0('0x2d')](_0x5a969a[_0xe8d0('0x3e')]['offset']);}_0x10970d['order']=qs[_0xe8d0('0x47')](_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x47')]);_0x10970d['where']=qs[_0xe8d0('0x3f')](_[_0xe8d0('0x48')](_0x5a969a['query'],_0x3d76d5[_0xe8d0('0x3f')]),_0x23d72e);if(_0x5a969a[_0xe8d0('0x3e')]['filter']){_0x10970d[_0xe8d0('0x49')]=_[_0xe8d0('0x4a')](_0x10970d[_0xe8d0('0x49')],{'$or':_[_0xe8d0('0x38')](_0x23d72e,function(_0x1d5815){if(_0x1d5815[_0xe8d0('0x3b')]!==_0xe8d0('0x4b')){var _0x1ce97d={};_0x1ce97d[_0x1d5815['name']]={'$like':'%'+_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x4c')]+'%'};return _0x1ce97d;}})});}_0x10970d=_[_0xe8d0('0x4a')]({},_0x10970d,_0x5a969a[_0xe8d0('0x4d')]);var _0x28d38b={'where':_0x10970d[_0xe8d0('0x49')]};return db[_0xe8d0('0x39')][_0xe8d0('0x2f')](_0x28d38b)[_0xe8d0('0x1e')](function(_0x2e2c05){_0x318106[_0xe8d0('0x2f')]=_0x2e2c05;if(_0x5a969a[_0xe8d0('0x3e')]['includeAll']){_0x10970d[_0xe8d0('0x4e')]=[{'all':!![]}];}return db[_0xe8d0('0x39')][_0xe8d0('0x4f')](_0x10970d);})[_0xe8d0('0x1e')](function(_0x34047c){_0x318106[_0xe8d0('0x50')]=_0x34047c;return _0x318106;})[_0xe8d0('0x1e')](respondWithFilteredResult(_0x1828c5,_0x10970d))['catch'](handleError(_0x1828c5,null));};exports[_0xe8d0('0x51')]=function(_0x424764,_0x151cf4){var _0x205933={'raw':![],'where':{'id':_0x424764[_0xe8d0('0x52')]['id']}},_0x4ed47f={};_0x4ed47f['model']=_[_0xe8d0('0x53')](db[_0xe8d0('0x39')][_0xe8d0('0x54')]);_0x4ed47f[_0xe8d0('0x3e')]=_[_0xe8d0('0x53')](_0x424764[_0xe8d0('0x3e')]);_0x4ed47f[_0xe8d0('0x3f')]=_['intersection'](_0x4ed47f[_0xe8d0('0x3d')],_0x4ed47f['query']);_0x205933['attributes']=_[_0xe8d0('0x40')](_0x4ed47f['model'],qs[_0xe8d0('0x42')](_0x424764['query'][_0xe8d0('0x42')]));_0x205933[_0xe8d0('0x41')]=_0x205933[_0xe8d0('0x41')][_0xe8d0('0x43')]?_0x205933['attributes']:_0x4ed47f[_0xe8d0('0x3d')];if(_0x424764[_0xe8d0('0x3e')][_0xe8d0('0x55')]){_0x205933[_0xe8d0('0x4e')]=[{'all':!![]}];}_0x205933=_[_0xe8d0('0x4a')]({},_0x205933,_0x424764['options']);return db[_0xe8d0('0x39')][_0xe8d0('0x56')](_0x205933)[_0xe8d0('0x1e')](handleEntityNotFound(_0x151cf4,null))['then'](respondWithResult(_0x151cf4,null))[_0xe8d0('0x28')](handleError(_0x151cf4,null));};exports['clone']=function(_0x56b4fa,_0x1bd329){var _0x37040a={'where':{'id':_0x56b4fa[_0xe8d0('0x52')]['id']}},_0x4e7b49={};_0x4e7b49[_0xe8d0('0x3d')]=_['keys'](db[_0xe8d0('0x39')][_0xe8d0('0x54')]);_0x37040a[_0xe8d0('0x41')]=_[_0xe8d0('0x40')](_0x4e7b49['model'],qs[_0xe8d0('0x42')](_0x56b4fa[_0xe8d0('0x3e')][_0xe8d0('0x42')]));_0x37040a[_0xe8d0('0x41')]=_0x37040a['attributes'][_0xe8d0('0x43')]?_0x37040a[_0xe8d0('0x41')]:_0x4e7b49[_0xe8d0('0x3d')];if(_0x56b4fa[_0xe8d0('0x3e')][_0xe8d0('0x55')]){_0x37040a[_0xe8d0('0x4e')]=[{'all':!![]}];}_0x37040a=_['merge']({},_0x37040a,_0x56b4fa['options']);return db[_0xe8d0('0x39')]['find'](_0x37040a)[_0xe8d0('0x1e')](handleEntityNotFound(_0x1bd329,null))[_0xe8d0('0x1e')](function(_0x4c0d4c){if(_0x4c0d4c){var _0x5ac1ae=_0x4c0d4c[_0xe8d0('0x33')]({'plain':!![]});_0x5ac1ae=qs['omit'](_0x5ac1ae,['id',_0xe8d0('0x57'),'updatedAt']);_0x56b4fa[_0xe8d0('0x58')]=_[_0xe8d0('0x59')](_0x56b4fa[_0xe8d0('0x58')],['id','createdAt',_0xe8d0('0x5a')]);return db[_0xe8d0('0x39')]['create'](_[_0xe8d0('0x4a')](_0x5ac1ae,_0x56b4fa['body']),{'include':_0x56b4fa[_0xe8d0('0x3e')]['includeAll']?[{'all':!![]}]:undefined})[_0xe8d0('0x1e')](function(_0x17afc2){var _0x29467d=_0x56b4fa[_0xe8d0('0x5b')][_0xe8d0('0x33')]({'plain':!![]});if(!_0x29467d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x29467d['role']===_0xe8d0('0x5b')){var _0x55a2df=_0x17afc2[_0xe8d0('0x33')]({'plain':!![]});var _0x18b655=_0xe8d0('0x34');return db[_0xe8d0('0x5c')][_0xe8d0('0x56')]({'where':{'name':_0x18b655,'userProfileId':_0x29467d[_0xe8d0('0x5d')]},'raw':!![]})[_0xe8d0('0x1e')](function(_0x20647d){if(_0x20647d&&_0x20647d[_0xe8d0('0x5e')]===0x0){return db[_0xe8d0('0x5f')][_0xe8d0('0x60')]({'name':_0x55a2df[_0xe8d0('0x36')],'resourceId':_0x55a2df['id'],'type':_0x20647d[_0xe8d0('0x36')],'sectionId':_0x20647d['id']},{})[_0xe8d0('0x1e')](function(){return _0x17afc2;});}else{return _0x17afc2;}})[_0xe8d0('0x28')](function(_0x4a68d5){logger[_0xe8d0('0x24')](_0xe8d0('0x61'),_0x4a68d5);throw _0x4a68d5;});}return _0x17afc2;});}})[_0xe8d0('0x1e')](respondWithResult(_0x1bd329,0xc9))[_0xe8d0('0x28')](handleError(_0x1bd329,null));};exports[_0xe8d0('0x60')]=function(_0x4848d4,_0x2eeb92,_0x1d30c0){var _0x45b42b;return db[_0xe8d0('0x39')][_0xe8d0('0x60')](_0x4848d4[_0xe8d0('0x58')],{'raw':!![]})[_0xe8d0('0x1e')](function(_0x13ceb4){_0x45b42b=_0x13ceb4;return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});})[_0xe8d0('0x1e')](function(_0xdb3e53){var _0x556d7e=fs['readFileSync'](path[_0xe8d0('0x62')](config['root'],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x56761c=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x1b5df8=ejs[_0xe8d0('0x68')](_0x556d7e,{'trunks':_0xdb3e53||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x1b5df8);if(_0x45b42b[_0xe8d0('0x6b')]){var _0xb078d8=ejs[_0xe8d0('0x68')](_0x56761c,{'trunks':_0xdb3e53||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6c'),_0xb078d8);}})[_0xe8d0('0x1e')](function(){return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x60'),{'module':_0xe8d0('0x6e')});})[_0xe8d0('0x1e')](function(){var _0x500fb0=_0x4848d4[_0xe8d0('0x5b')][_0xe8d0('0x33')]({'plain':!![]});if(!_0x500fb0)throw new Error(_0xe8d0('0x6f'));if(_0x500fb0['role']===_0xe8d0('0x5b')){var _0x4c54c4=_0x45b42b[_0xe8d0('0x33')]({'plain':!![]});return db[_0xe8d0('0x5c')][_0xe8d0('0x56')]({'where':{'name':'Trunks','userProfileId':_0x500fb0[_0xe8d0('0x5d')]},'raw':!![]})[_0xe8d0('0x1e')](function(_0xc94cd3){if(_0xc94cd3&&_0xc94cd3[_0xe8d0('0x5e')]===0x0){return db[_0xe8d0('0x5f')]['create']({'name':_0x4c54c4[_0xe8d0('0x36')],'resourceId':_0x4c54c4['id'],'type':_0xc94cd3[_0xe8d0('0x36')],'sectionId':_0xc94cd3['id']},{})[_0xe8d0('0x1e')](function(){return _0x45b42b;});}else{return _0x45b42b;}})[_0xe8d0('0x28')](function(_0x252f0e){logger[_0xe8d0('0x24')](_0xe8d0('0x61'),_0x252f0e);throw _0x252f0e;});}return _0x45b42b;})[_0xe8d0('0x1e')](respondWithResult(_0x2eeb92,0xc9))['catch'](handleError(_0x2eeb92,null));};exports[_0xe8d0('0x31')]=function(_0x31b9d3,_0x14d722,_0x2aa6fc){var _0x4d5997;return db[_0xe8d0('0x39')][_0xe8d0('0x56')]({'where':{'id':_0x31b9d3[_0xe8d0('0x52')]['id']}})['then'](handleEntityNotFound(_0x14d722,null))[_0xe8d0('0x1e')](saveUpdates(_0x31b9d3['body'],null))[_0xe8d0('0x1e')](function(_0x478eb2){if(_0x478eb2){_0x4d5997=_0x478eb2;return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});}})[_0xe8d0('0x1e')](function(_0xa90bdc){if(_0xa90bdc){var _0x87aa04=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x2eaf2f=fs[_0xe8d0('0x65')](path['join'](config[_0xe8d0('0x66')],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x761e97=ejs[_0xe8d0('0x68')](_0x87aa04,{'trunks':_0xa90bdc||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x761e97);var _0x605b5f=ejs[_0xe8d0('0x68')](_0x2eaf2f,{'trunks':_0xa90bdc||[]});fs[_0xe8d0('0x69')]('/etc/asterisk/sip_xcally_registers.conf',_0x605b5f);return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x31'),{'module':_0xe8d0('0x6e')});}return null;})[_0xe8d0('0x1e')](function(_0x255e4b){if(_0x255e4b){return _0x4d5997;}})['then'](respondWithResult(_0x14d722,null))['catch'](handleError(_0x14d722,null));};exports[_0xe8d0('0x32')]=function(_0x5c8c7d,_0x3fb7c8,_0x16098b){var _0x363b3a;return db['Trunk'][_0xe8d0('0x56')]({'where':{'id':_0x5c8c7d['params']['id']}})[_0xe8d0('0x1e')](handleEntityNotFound(_0x3fb7c8,null))[_0xe8d0('0x1e')](removeEntity(_0x3fb7c8,null))[_0xe8d0('0x1e')](function(){return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});})['then'](function(_0x58034d){var _0xfbacce=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x2790f=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config['root'],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x142db4=ejs[_0xe8d0('0x68')](_0xfbacce,{'trunks':_0x58034d});var _0x4a568f=ejs['render'](_0x2790f,{'trunks':_0x58034d});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x142db4);fs[_0xe8d0('0x69')](_0xe8d0('0x6c'),_0x4a568f);return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x32'),{'module':_0xe8d0('0x6e')});})[_0xe8d0('0x28')](handleError(_0x3fb7c8,null));};
\ No newline at end of file
+var _0x3e74=['map','Trunk','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','where','type','filter','merge','options','includeAll','include','findAll','params','clone','find','get','omit','createdAt','body','updatedAt','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','root','server/files/templates/trunk.ejs','utf8','readFileSync','server/files/templates/registry.ejs','render','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','writeFileSync','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Trunk,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','destroy','Trunks','UserProfileResource','stack','name','send','index'];(function(_0x5f1c42,_0x283311){var _0x5086ab=function(_0x510cf1){while(--_0x510cf1){_0x5f1c42['push'](_0x5f1c42['shift']());}};_0x5086ab(++_0x283311);}(_0x3e74,0x175));var _0x43e7=function(_0x2133c7,_0x1fa006){_0x2133c7=_0x2133c7-0x0;var _0x4e1975=_0x3e74[_0x2133c7];return _0x4e1975;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];var jayson=require(_0x43e7('0x15'));var client=jayson[_0x43e7('0x16')][_0x43e7('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x4e008c,_0x583d85,_0x2fcb36,_0x21fdd3){return new BPromise(function(_0x44b0bd,_0x51b974){var _0x5e641c=_0x21fdd3||client;return _0x5e641c[_0x43e7('0x18')](_0x4e008c,_0x2fcb36)[_0x43e7('0x19')](function(_0x203378){logger[_0x43e7('0x1a')]('Trunk,\x20%s,\x20%s',_0x583d85,'request\x20sent');logger[_0x43e7('0x1b')](_0x43e7('0x1c'),_0x583d85,_0x43e7('0x1d'),JSON['stringify'](_0x203378));if(_0x203378['error']){if(_0x203378[_0x43e7('0x1e')][_0x43e7('0x1f')]===0x1f4){logger[_0x43e7('0x1e')](_0x43e7('0x20'),_0x583d85,_0x203378[_0x43e7('0x1e')][_0x43e7('0x21')]);return _0x51b974(_0x203378[_0x43e7('0x1e')][_0x43e7('0x21')]);}logger[_0x43e7('0x1e')](_0x43e7('0x20'),_0x583d85,_0x203378[_0x43e7('0x1e')][_0x43e7('0x21')]);return _0x44b0bd(_0x203378['error'][_0x43e7('0x21')]);}else{logger[_0x43e7('0x1a')]('Trunk,\x20%s,\x20%s',_0x583d85,_0x43e7('0x1d'));_0x44b0bd(_0x203378[_0x43e7('0x22')][_0x43e7('0x21')]);}})[_0x43e7('0x23')](function(_0x4077fb){logger[_0x43e7('0x1e')]('Trunk,\x20%s,\x20%s',_0x583d85,_0x4077fb);_0x51b974(_0x4077fb);});});}function respondWithStatusCode(_0x454359,_0x4eea52){_0x4eea52=_0x4eea52||0xcc;return function(_0x4c9df3){if(_0x4c9df3){return _0x454359[_0x43e7('0x24')](_0x4eea52);}return _0x454359[_0x43e7('0x25')](_0x4eea52)['end']();};}function respondWithResult(_0x1f0673,_0x4ca5cf){_0x4ca5cf=_0x4ca5cf||0xc8;return function(_0x326dab){if(_0x326dab){return _0x1f0673['status'](_0x4ca5cf)[_0x43e7('0x26')](_0x326dab);}};}function respondWithFilteredResult(_0x1b5f50,_0x20888b){return function(_0x405f85){if(_0x405f85){var _0x51f4d7=typeof _0x20888b['offset']===_0x43e7('0x27')&&typeof _0x20888b['limit']===_0x43e7('0x27');var _0x40dc8f=_0x405f85[_0x43e7('0x28')];var _0xb1fc63=_0x51f4d7?0x0:_0x20888b['offset'];var _0x33a1a5=_0x51f4d7?_0x405f85[_0x43e7('0x28')]:_0x20888b[_0x43e7('0x29')]+_0x20888b[_0x43e7('0x2a')];var _0x442c3b;if(_0x33a1a5>=_0x40dc8f){_0x33a1a5=_0x40dc8f;_0x442c3b=0xc8;}else{_0x442c3b=0xce;}_0x1b5f50[_0x43e7('0x25')](_0x442c3b);return _0x1b5f50[_0x43e7('0x2b')](_0x43e7('0x2c'),_0xb1fc63+'-'+_0x33a1a5+'/'+_0x40dc8f)[_0x43e7('0x26')](_0x405f85);}return null;};}function patchUpdates(_0x35dbcd){return function(_0x17df44){try{jsonpatch[_0x43e7('0x2d')](_0x17df44,_0x35dbcd,!![]);}catch(_0x2bde44){return BPromise[_0x43e7('0x2e')](_0x2bde44);}return _0x17df44['save']();};}function saveUpdates(_0x238321,_0x44f6b0){return function(_0x3b8f78){if(_0x3b8f78){return _0x3b8f78[_0x43e7('0x2f')](_0x238321)[_0x43e7('0x19')](function(_0x4c8650){return _0x4c8650;});}return null;};}function removeEntity(_0x1eba65,_0x49b83d){return function(_0x30d47e){if(_0x30d47e){return _0x30d47e[_0x43e7('0x30')]()['then'](function(){var _0x5a7342=_0x30d47e['get']({'plain':!![]});var _0xf8320=_0x43e7('0x31');return db[_0x43e7('0x32')][_0x43e7('0x30')]({'where':{'type':_0xf8320,'resourceId':_0x5a7342['id']}})[_0x43e7('0x19')](function(){return _0x30d47e;});})[_0x43e7('0x19')](function(){_0x1eba65['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ac23d,_0x59e5b2){return function(_0x4e8e86){if(!_0x4e8e86){_0x4ac23d['sendStatus'](0x194);}return _0x4e8e86;};}function handleError(_0x5cb753,_0x14d888){_0x14d888=_0x14d888||0x1f4;return function(_0x49cda6){logger[_0x43e7('0x1e')](_0x49cda6[_0x43e7('0x33')]);if(_0x49cda6[_0x43e7('0x34')]){delete _0x49cda6[_0x43e7('0x34')];}_0x5cb753[_0x43e7('0x25')](_0x14d888)[_0x43e7('0x35')](_0x49cda6);};}exports[_0x43e7('0x36')]=function(_0x4f1a5f,_0x5332d9){var _0x5d84f4={},_0xfa0474={},_0xfe70e9={'count':0x0,'rows':[]};var _0x199ff6=_[_0x43e7('0x37')](db[_0x43e7('0x38')][_0x43e7('0x39')],function(_0x1d4589){return{'name':_0x1d4589[_0x43e7('0x3a')],'type':_0x1d4589['type'][_0x43e7('0x3b')]};});_0xfa0474[_0x43e7('0x3c')]=_['map'](_0x199ff6,_0x43e7('0x34'));_0xfa0474['query']=_[_0x43e7('0x3d')](_0x4f1a5f[_0x43e7('0x3e')]);_0xfa0474[_0x43e7('0x3f')]=_[_0x43e7('0x40')](_0xfa0474[_0x43e7('0x3c')],_0xfa0474[_0x43e7('0x3e')]);_0x5d84f4['attributes']=_['intersection'](_0xfa0474[_0x43e7('0x3c')],qs[_0x43e7('0x41')](_0x4f1a5f[_0x43e7('0x3e')][_0x43e7('0x41')]));_0x5d84f4[_0x43e7('0x42')]=_0x5d84f4['attributes'][_0x43e7('0x43')]?_0x5d84f4[_0x43e7('0x42')]:_0xfa0474['model'];if(!_0x4f1a5f[_0x43e7('0x3e')]['hasOwnProperty'](_0x43e7('0x44'))){_0x5d84f4['limit']=qs[_0x43e7('0x2a')](_0x4f1a5f[_0x43e7('0x3e')][_0x43e7('0x2a')]);_0x5d84f4[_0x43e7('0x29')]=qs['offset'](_0x4f1a5f['query'][_0x43e7('0x29')]);}_0x5d84f4[_0x43e7('0x45')]=qs[_0x43e7('0x46')](_0x4f1a5f[_0x43e7('0x3e')]['sort']);_0x5d84f4['where']=qs['filters'](_[_0x43e7('0x47')](_0x4f1a5f['query'],_0xfa0474[_0x43e7('0x3f')]),_0x199ff6);if(_0x4f1a5f['query']['filter']){_0x5d84f4[_0x43e7('0x48')]=_['merge'](_0x5d84f4[_0x43e7('0x48')],{'$or':_[_0x43e7('0x37')](_0x199ff6,function(_0x257bd8){if(_0x257bd8[_0x43e7('0x49')]!=='VIRTUAL'){var _0x91f1e4={};_0x91f1e4[_0x257bd8[_0x43e7('0x34')]]={'$like':'%'+_0x4f1a5f[_0x43e7('0x3e')][_0x43e7('0x4a')]+'%'};return _0x91f1e4;}})});}_0x5d84f4=_[_0x43e7('0x4b')]({},_0x5d84f4,_0x4f1a5f[_0x43e7('0x4c')]);var _0x51eef4={'where':_0x5d84f4['where']};return db[_0x43e7('0x38')][_0x43e7('0x28')](_0x51eef4)[_0x43e7('0x19')](function(_0x4c00a8){_0xfe70e9['count']=_0x4c00a8;if(_0x4f1a5f['query'][_0x43e7('0x4d')]){_0x5d84f4[_0x43e7('0x4e')]=[{'all':!![]}];}return db['Trunk'][_0x43e7('0x4f')](_0x5d84f4);})[_0x43e7('0x19')](function(_0x3c96fe){_0xfe70e9['rows']=_0x3c96fe;return _0xfe70e9;})['then'](respondWithFilteredResult(_0x5332d9,_0x5d84f4))['catch'](handleError(_0x5332d9,null));};exports['show']=function(_0x214e7e,_0xe955fc){var _0x52fea5={'raw':![],'where':{'id':_0x214e7e[_0x43e7('0x50')]['id']}},_0x23e7cb={};_0x23e7cb[_0x43e7('0x3c')]=_[_0x43e7('0x3d')](db['Trunk'][_0x43e7('0x39')]);_0x23e7cb['query']=_['keys'](_0x214e7e[_0x43e7('0x3e')]);_0x23e7cb[_0x43e7('0x3f')]=_[_0x43e7('0x40')](_0x23e7cb[_0x43e7('0x3c')],_0x23e7cb[_0x43e7('0x3e')]);_0x52fea5[_0x43e7('0x42')]=_[_0x43e7('0x40')](_0x23e7cb[_0x43e7('0x3c')],qs[_0x43e7('0x41')](_0x214e7e[_0x43e7('0x3e')]['fields']));_0x52fea5[_0x43e7('0x42')]=_0x52fea5[_0x43e7('0x42')]['length']?_0x52fea5[_0x43e7('0x42')]:_0x23e7cb['model'];if(_0x214e7e[_0x43e7('0x3e')][_0x43e7('0x4d')]){_0x52fea5[_0x43e7('0x4e')]=[{'all':!![]}];}_0x52fea5=_[_0x43e7('0x4b')]({},_0x52fea5,_0x214e7e[_0x43e7('0x4c')]);return db['Trunk']['find'](_0x52fea5)[_0x43e7('0x19')](handleEntityNotFound(_0xe955fc,null))[_0x43e7('0x19')](respondWithResult(_0xe955fc,null))[_0x43e7('0x23')](handleError(_0xe955fc,null));};exports[_0x43e7('0x51')]=function(_0x23d835,_0x25bb44){var _0xa47464={'where':{'id':_0x23d835[_0x43e7('0x50')]['id']}},_0x44f8a0={};_0x44f8a0[_0x43e7('0x3c')]=_[_0x43e7('0x3d')](db['Trunk'][_0x43e7('0x39')]);_0xa47464[_0x43e7('0x42')]=_['intersection'](_0x44f8a0[_0x43e7('0x3c')],qs[_0x43e7('0x41')](_0x23d835[_0x43e7('0x3e')]['fields']));_0xa47464['attributes']=_0xa47464[_0x43e7('0x42')][_0x43e7('0x43')]?_0xa47464['attributes']:_0x44f8a0[_0x43e7('0x3c')];if(_0x23d835['query']['includeAll']){_0xa47464[_0x43e7('0x4e')]=[{'all':!![]}];}_0xa47464=_[_0x43e7('0x4b')]({},_0xa47464,_0x23d835[_0x43e7('0x4c')]);return db[_0x43e7('0x38')][_0x43e7('0x52')](_0xa47464)['then'](handleEntityNotFound(_0x25bb44,null))[_0x43e7('0x19')](function(_0xdb9fbe){if(_0xdb9fbe){var _0x4d89bd=_0xdb9fbe[_0x43e7('0x53')]({'plain':!![]});_0x4d89bd=qs[_0x43e7('0x54')](_0x4d89bd,['id',_0x43e7('0x55'),'updatedAt']);_0x23d835['body']=_['omit'](_0x23d835[_0x43e7('0x56')],['id',_0x43e7('0x55'),_0x43e7('0x57')]);return db[_0x43e7('0x38')]['create'](_['merge'](_0x4d89bd,_0x23d835[_0x43e7('0x56')]),{'include':_0x23d835[_0x43e7('0x3e')][_0x43e7('0x4d')]?[{'all':!![]}]:undefined})[_0x43e7('0x19')](function(_0x5ea0db){var _0x4438c0=_0x23d835[_0x43e7('0x58')][_0x43e7('0x53')]({'plain':!![]});if(!_0x4438c0)throw new Error(_0x43e7('0x59'));if(_0x4438c0[_0x43e7('0x5a')]===_0x43e7('0x58')){var _0x4665db=_0x5ea0db[_0x43e7('0x53')]({'plain':!![]});var _0x406155=_0x43e7('0x31');return db[_0x43e7('0x5b')]['find']({'where':{'name':_0x406155,'userProfileId':_0x4438c0['userProfileId']},'raw':!![]})[_0x43e7('0x19')](function(_0x58a3a8){if(_0x58a3a8&&_0x58a3a8['autoAssociation']===0x0){return db['UserProfileResource'][_0x43e7('0x5c')]({'name':_0x4665db[_0x43e7('0x34')],'resourceId':_0x4665db['id'],'type':_0x58a3a8['name'],'sectionId':_0x58a3a8['id']},{})[_0x43e7('0x19')](function(){return _0x5ea0db;});}else{return _0x5ea0db;}})[_0x43e7('0x23')](function(_0x1d8438){logger['error'](_0x43e7('0x5d'),_0x1d8438);throw _0x1d8438;});}return _0x5ea0db;});}})[_0x43e7('0x19')](respondWithResult(_0x25bb44,0xc9))[_0x43e7('0x23')](handleError(_0x25bb44,null));};exports[_0x43e7('0x5c')]=function(_0x2f43d7,_0x472a19,_0x1e02fa){var _0x515f01;return db[_0x43e7('0x38')][_0x43e7('0x5c')](_0x2f43d7[_0x43e7('0x56')],{'raw':!![]})['then'](function(_0x56b06d){_0x515f01=_0x56b06d;return db[_0x43e7('0x38')]['findAll']({'raw':!![]});})['then'](function(_0x1b793d){var _0x154e47=fs['readFileSync'](path[_0x43e7('0x5e')](config[_0x43e7('0x5f')],_0x43e7('0x60')),_0x43e7('0x61'));var _0x16499c=fs[_0x43e7('0x62')](path[_0x43e7('0x5e')](config['root'],_0x43e7('0x63')),_0x43e7('0x61'));var _0x4e5956=ejs[_0x43e7('0x64')](_0x154e47,{'trunks':_0x1b793d||[]});fs['writeFileSync'](_0x43e7('0x65'),_0x4e5956);if(_0x515f01[_0x43e7('0x66')]){var _0x37301b=ejs[_0x43e7('0x64')](_0x16499c,{'trunks':_0x1b793d||[]});fs['writeFileSync'](_0x43e7('0x67'),_0x37301b);}})[_0x43e7('0x19')](function(){return respondWithRpcPromise(_0x43e7('0x68'),'create',{'module':_0x43e7('0x69')});})[_0x43e7('0x19')](function(){var _0x219dc6=_0x2f43d7[_0x43e7('0x58')][_0x43e7('0x53')]({'plain':!![]});if(!_0x219dc6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x219dc6[_0x43e7('0x5a')]===_0x43e7('0x58')){var _0x35d133=_0x515f01[_0x43e7('0x53')]({'plain':!![]});return db[_0x43e7('0x5b')][_0x43e7('0x52')]({'where':{'name':_0x43e7('0x31'),'userProfileId':_0x219dc6['userProfileId']},'raw':!![]})['then'](function(_0x405faa){if(_0x405faa&&_0x405faa['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x35d133[_0x43e7('0x34')],'resourceId':_0x35d133['id'],'type':_0x405faa[_0x43e7('0x34')],'sectionId':_0x405faa['id']},{})[_0x43e7('0x19')](function(){return _0x515f01;});}else{return _0x515f01;}})[_0x43e7('0x23')](function(_0x18713b){logger[_0x43e7('0x1e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x18713b);throw _0x18713b;});}return _0x515f01;})[_0x43e7('0x19')](respondWithResult(_0x472a19,0xc9))[_0x43e7('0x23')](handleError(_0x472a19,null));};exports[_0x43e7('0x2f')]=function(_0x5b4c76,_0x2abca0,_0xea84ec){var _0x184ae3;return db[_0x43e7('0x38')][_0x43e7('0x52')]({'where':{'id':_0x5b4c76[_0x43e7('0x50')]['id']}})[_0x43e7('0x19')](handleEntityNotFound(_0x2abca0,null))[_0x43e7('0x19')](saveUpdates(_0x5b4c76['body'],null))['then'](function(_0x55990c){if(_0x55990c){_0x184ae3=_0x55990c;return db[_0x43e7('0x38')][_0x43e7('0x4f')]({'raw':!![]});}})['then'](function(_0x3fe23f){if(_0x3fe23f){var _0x39a787=fs[_0x43e7('0x62')](path[_0x43e7('0x5e')](config['root'],'server/files/templates/trunk.ejs'),'utf8');var _0x177a7a=fs[_0x43e7('0x62')](path['join'](config['root'],_0x43e7('0x63')),_0x43e7('0x61'));var _0x3b7e5b=ejs['render'](_0x39a787,{'trunks':_0x3fe23f||[]});fs[_0x43e7('0x6a')](_0x43e7('0x65'),_0x3b7e5b);var _0x401654=ejs[_0x43e7('0x64')](_0x177a7a,{'trunks':_0x3fe23f||[]});fs['writeFileSync'](_0x43e7('0x67'),_0x401654);return respondWithRpcPromise('Reload',_0x43e7('0x2f'),{'module':_0x43e7('0x69')});}return null;})[_0x43e7('0x19')](function(_0x90667c){if(_0x90667c){return _0x184ae3;}})[_0x43e7('0x19')](respondWithResult(_0x2abca0,null))[_0x43e7('0x23')](handleError(_0x2abca0,null));};exports[_0x43e7('0x30')]=function(_0x5e8d4e,_0x109c86,_0x40257e){var _0x1aea4e;return db[_0x43e7('0x38')]['find']({'where':{'id':_0x5e8d4e['params']['id']}})['then'](handleEntityNotFound(_0x109c86,null))[_0x43e7('0x19')](removeEntity(_0x109c86,null))['then'](function(){return db[_0x43e7('0x38')][_0x43e7('0x4f')]({'raw':!![]});})[_0x43e7('0x19')](function(_0x7387f6){var _0xa75254=fs[_0x43e7('0x62')](path[_0x43e7('0x5e')](config[_0x43e7('0x5f')],_0x43e7('0x60')),_0x43e7('0x61'));var _0x3de22e=fs['readFileSync'](path[_0x43e7('0x5e')](config[_0x43e7('0x5f')],_0x43e7('0x63')),_0x43e7('0x61'));var _0x206e54=ejs['render'](_0xa75254,{'trunks':_0x7387f6});var _0x5e04ec=ejs[_0x43e7('0x64')](_0x3de22e,{'trunks':_0x7387f6});fs[_0x43e7('0x6a')]('/etc/asterisk/sip_xcally_trunks.conf',_0x206e54);fs[_0x43e7('0x6a')](_0x43e7('0x67'),_0x5e04ec);return respondWithRpcPromise('Reload','destroy',{'module':_0x43e7('0x69')});})[_0x43e7('0x23')](handleError(_0x109c86,null));};
\ No newline at end of file
index 5a7a5c9..3e0e32d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34d0=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0xb8fe69,_0x379c58){var _0x311eb1=function(_0x193476){while(--_0x193476){_0xb8fe69['push'](_0xb8fe69['shift']());}};_0x311eb1(++_0x379c58);}(_0x34d0,0x108));var _0x034d=function(_0x150e2f,_0x314949){_0x150e2f=_0x150e2f-0x0;var _0xd67ea1=_0x34d0[_0x150e2f];return _0xd67ea1;};'use strict';var _=require(_0x034d('0x0'));var util=require(_0x034d('0x1'));var logger=require(_0x034d('0x2'))(_0x034d('0x3'));var moment=require(_0x034d('0x4'));var BPromise=require('bluebird');var rp=require(_0x034d('0x5'));var fs=require('fs');var path=require(_0x034d('0x6'));var rimraf=require(_0x034d('0x7'));var config=require(_0x034d('0x8'));var attributes=require('./trunk.attributes');module[_0x034d('0x9')]=function(_0x39fb44,_0x4d3005){return _0x39fb44[_0x034d('0xa')]('Trunk',attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa70f=['api','moment','bluebird','path','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash','util','../../config/logger'];(function(_0x34ab23,_0x1f6509){var _0x45ecad=function(_0x3a3a3e){while(--_0x3a3a3e){_0x34ab23['push'](_0x34ab23['shift']());}};_0x45ecad(++_0x1f6509);}(_0xa70f,0x19d));var _0xfa70=function(_0x74f959,_0xdb1f7b){_0x74f959=_0x74f959-0x0;var _0x2a1e30=_0xa70f[_0x74f959];return _0x2a1e30;};'use strict';var _=require(_0xfa70('0x0'));var util=require(_0xfa70('0x1'));var logger=require(_0xfa70('0x2'))(_0xfa70('0x3'));var moment=require(_0xfa70('0x4'));var BPromise=require(_0xfa70('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfa70('0x6'));var rimraf=require('rimraf');var config=require(_0xfa70('0x7'));var attributes=require(_0xfa70('0x8'));module[_0xfa70('0x9')]=function(_0x359db2,_0x41115a){return _0x359db2[_0xfa70('0xa')](_0xfa70('0xb'),attributes,{'tableName':_0xfa70('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ffe7e05..847cd66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5bdb=['options','where','attributes','limit','include','map','model','catch','ShowTrunk','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetTrunk','Trunk','findAll','raw'];(function(_0x4f86ff,_0x4a50ea){var _0x51d222=function(_0x37b682){while(--_0x37b682){_0x4f86ff['push'](_0x4f86ff['shift']());}};_0x51d222(++_0x4a50ea);}(_0x5bdb,0x79));var _0xb5bd=function(_0x54c578,_0x397223){_0x54c578=_0x54c578-0x0;var _0x24acf2=_0x5bdb[_0x54c578];return _0x24acf2;};'use strict';var _=require('lodash');var util=require(_0xb5bd('0x0'));var moment=require(_0xb5bd('0x1'));var BPromise=require(_0xb5bd('0x2'));var rs=require(_0xb5bd('0x3'));var fs=require('fs');var Redis=require(_0xb5bd('0x4'));var db=require(_0xb5bd('0x5'))['db'];var utils=require(_0xb5bd('0x6'));var logger=require('../../config/logger')(_0xb5bd('0x7'));var config=require('../../config/environment');var jayson=require(_0xb5bd('0x8'));var client=jayson[_0xb5bd('0x9')][_0xb5bd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b8ec8,_0xb6ebe6,_0x1185da){return new BPromise(function(_0xd7e1e5,_0x2d001b){return client[_0xb5bd('0xb')](_0x2b8ec8,_0x1185da)[_0xb5bd('0xc')](function(_0x1daf34){logger[_0xb5bd('0xd')](_0xb5bd('0xe'),_0xb6ebe6,'request\x20sent');logger[_0xb5bd('0xf')](_0xb5bd('0x10'),_0xb6ebe6,_0xb5bd('0x11'),JSON[_0xb5bd('0x12')](_0x1daf34));if(_0x1daf34[_0xb5bd('0x13')]){if(_0x1daf34[_0xb5bd('0x13')][_0xb5bd('0x14')]===0x1f4){logger['error']('Trunk,\x20%s,\x20%s',_0xb6ebe6,_0x1daf34['error'][_0xb5bd('0x15')]);return _0x2d001b(_0x1daf34[_0xb5bd('0x13')][_0xb5bd('0x15')]);}logger['error']('Trunk,\x20%s,\x20%s',_0xb6ebe6,_0x1daf34[_0xb5bd('0x13')][_0xb5bd('0x15')]);return _0xd7e1e5(_0x1daf34[_0xb5bd('0x13')][_0xb5bd('0x15')]);}else{logger[_0xb5bd('0xd')](_0xb5bd('0xe'),_0xb6ebe6,_0xb5bd('0x11'));_0xd7e1e5(_0x1daf34[_0xb5bd('0x16')][_0xb5bd('0x15')]);}})['catch'](function(_0x5dd0e8){logger[_0xb5bd('0x13')](_0xb5bd('0xe'),_0xb6ebe6,_0x5dd0e8);_0x2d001b(_0x5dd0e8);});});}exports[_0xb5bd('0x17')]=function(_0x11e038){var _0x3b6514=this;return new Promise(function(_0x1bff87,_0x23778f){return db[_0xb5bd('0x18')][_0xb5bd('0x19')]({'raw':_0x11e038['options']?_0x11e038['options'][_0xb5bd('0x1a')]===undefined?!![]:![]:!![],'where':_0x11e038[_0xb5bd('0x1b')]?_0x11e038[_0xb5bd('0x1b')][_0xb5bd('0x1c')]||null:null,'attributes':_0x11e038['options']?_0x11e038[_0xb5bd('0x1b')][_0xb5bd('0x1d')]||null:null,'limit':_0x11e038[_0xb5bd('0x1b')]?_0x11e038[_0xb5bd('0x1b')][_0xb5bd('0x1e')]||null:null,'include':_0x11e038['options']?_0x11e038['options'][_0xb5bd('0x1f')]?_[_0xb5bd('0x20')](_0x11e038[_0xb5bd('0x1b')][_0xb5bd('0x1f')],function(_0x2afc7c){return{'model':db[_0x2afc7c[_0xb5bd('0x21')]],'as':_0x2afc7c['as'],'attributes':_0x2afc7c['attributes'],'include':_0x2afc7c['include']?_[_0xb5bd('0x20')](_0x2afc7c[_0xb5bd('0x1f')],function(_0x3f90f8){return{'model':db[_0x3f90f8[_0xb5bd('0x21')]],'as':_0x3f90f8['as'],'attributes':_0x3f90f8[_0xb5bd('0x1d')],'include':_0x3f90f8[_0xb5bd('0x1f')]?_['map'](_0x3f90f8[_0xb5bd('0x1f')],function(_0x17866d){return{'model':db[_0x17866d[_0xb5bd('0x21')]],'as':_0x17866d['as'],'attributes':_0x17866d[_0xb5bd('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb5bd('0xc')](function(_0x3eb987){logger[_0xb5bd('0xd')](_0xb5bd('0x17'),_0x11e038);logger['debug'](_0xb5bd('0x17'),_0x11e038,JSON[_0xb5bd('0x12')](_0x3eb987));_0x1bff87(_0x3eb987);})[_0xb5bd('0x22')](function(_0xf8369){logger[_0xb5bd('0x13')](_0xb5bd('0x17'),_0xf8369[_0xb5bd('0x15')],_0x11e038);_0x23778f(_0x3b6514['error'](0x1f4,_0xf8369[_0xb5bd('0x15')]));});});};exports[_0xb5bd('0x23')]=function(_0x24137a){var _0x32373d=this;return new Promise(function(_0x2ea33e,_0x447b2d){return db[_0xb5bd('0x18')][_0xb5bd('0x24')]({'raw':_0x24137a[_0xb5bd('0x1b')]?_0x24137a[_0xb5bd('0x1b')][_0xb5bd('0x1a')]===undefined?!![]:![]:!![],'where':_0x24137a[_0xb5bd('0x1b')]?_0x24137a[_0xb5bd('0x1b')][_0xb5bd('0x1c')]||null:null,'attributes':_0x24137a[_0xb5bd('0x1b')]?_0x24137a[_0xb5bd('0x1b')][_0xb5bd('0x1d')]||null:null,'include':_0x24137a[_0xb5bd('0x1b')]?_0x24137a['options']['include']?_[_0xb5bd('0x20')](_0x24137a[_0xb5bd('0x1b')][_0xb5bd('0x1f')],function(_0x154065){return{'model':db[_0x154065[_0xb5bd('0x21')]],'as':_0x154065['as'],'attributes':_0x154065[_0xb5bd('0x1d')],'include':_0x154065[_0xb5bd('0x1f')]?_[_0xb5bd('0x20')](_0x154065[_0xb5bd('0x1f')],function(_0x2ecf66){return{'model':db[_0x2ecf66[_0xb5bd('0x21')]],'as':_0x2ecf66['as'],'attributes':_0x2ecf66[_0xb5bd('0x1d')],'include':_0x2ecf66['include']?_[_0xb5bd('0x20')](_0x2ecf66['include'],function(_0x5ab91c){return{'model':db[_0x5ab91c[_0xb5bd('0x21')]],'as':_0x5ab91c['as'],'attributes':_0x5ab91c[_0xb5bd('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb5bd('0xc')](function(_0x74ea67){logger[_0xb5bd('0xd')](_0xb5bd('0x23'),_0x24137a);logger[_0xb5bd('0xf')](_0xb5bd('0x23'),_0x24137a,JSON[_0xb5bd('0x12')](_0x74ea67));_0x2ea33e(_0x74ea67);})[_0xb5bd('0x22')](function(_0x252c54){logger['error'](_0xb5bd('0x23'),_0x252c54[_0xb5bd('0x15')],_0x24137a);_0x447b2d(_0x32373d[_0xb5bd('0x13')](0x1f4,_0x252c54[_0xb5bd('0x15')]));});});};
\ No newline at end of file
+var _0x0d17=['catch','GetTrunk','Trunk','options','where','limit','include','model','map','attributes','stringify','ShowTrunk','find','raw','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0x0d17,0x1a5));var _0x70d1=function(_0x58cc1f,_0x28f6d4){_0x58cc1f=_0x58cc1f-0x0;var _0x2884de=_0x0d17[_0x58cc1f];return _0x2884de;};'use strict';var _=require(_0x70d1('0x0'));var util=require('util');var moment=require(_0x70d1('0x1'));var BPromise=require('bluebird');var rs=require(_0x70d1('0x2'));var fs=require('fs');var Redis=require(_0x70d1('0x3'));var db=require(_0x70d1('0x4'))['db'];var utils=require(_0x70d1('0x5'));var logger=require(_0x70d1('0x6'))(_0x70d1('0x7'));var config=require(_0x70d1('0x8'));var jayson=require(_0x70d1('0x9'));var client=jayson[_0x70d1('0xa')][_0x70d1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4146c1,_0x3677c4,_0x1fb743){return new BPromise(function(_0x2ffe0c,_0x5ac8a8){return client[_0x70d1('0xc')](_0x4146c1,_0x1fb743)[_0x70d1('0xd')](function(_0x53bd00){logger[_0x70d1('0xe')](_0x70d1('0xf'),_0x3677c4,_0x70d1('0x10'));logger[_0x70d1('0x11')](_0x70d1('0x12'),_0x3677c4,_0x70d1('0x10'),JSON['stringify'](_0x53bd00));if(_0x53bd00[_0x70d1('0x13')]){if(_0x53bd00[_0x70d1('0x13')][_0x70d1('0x14')]===0x1f4){logger[_0x70d1('0x13')]('Trunk,\x20%s,\x20%s',_0x3677c4,_0x53bd00[_0x70d1('0x13')]['message']);return _0x5ac8a8(_0x53bd00['error'][_0x70d1('0x15')]);}logger[_0x70d1('0x13')](_0x70d1('0xf'),_0x3677c4,_0x53bd00['error'][_0x70d1('0x15')]);return _0x2ffe0c(_0x53bd00[_0x70d1('0x13')][_0x70d1('0x15')]);}else{logger['info'](_0x70d1('0xf'),_0x3677c4,_0x70d1('0x10'));_0x2ffe0c(_0x53bd00[_0x70d1('0x16')][_0x70d1('0x15')]);}})[_0x70d1('0x17')](function(_0x2f421e){logger[_0x70d1('0x13')](_0x70d1('0xf'),_0x3677c4,_0x2f421e);_0x5ac8a8(_0x2f421e);});});}exports[_0x70d1('0x18')]=function(_0x4c4124){var _0x5d530e=this;return new Promise(function(_0x3b5148,_0x5aad84){return db[_0x70d1('0x19')]['findAll']({'raw':_0x4c4124[_0x70d1('0x1a')]?_0x4c4124[_0x70d1('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x4c4124[_0x70d1('0x1a')]?_0x4c4124[_0x70d1('0x1a')][_0x70d1('0x1b')]||null:null,'attributes':_0x4c4124[_0x70d1('0x1a')]?_0x4c4124[_0x70d1('0x1a')]['attributes']||null:null,'limit':_0x4c4124[_0x70d1('0x1a')]?_0x4c4124['options'][_0x70d1('0x1c')]||null:null,'include':_0x4c4124[_0x70d1('0x1a')]?_0x4c4124[_0x70d1('0x1a')]['include']?_['map'](_0x4c4124['options'][_0x70d1('0x1d')],function(_0x4fb27e){return{'model':db[_0x4fb27e[_0x70d1('0x1e')]],'as':_0x4fb27e['as'],'attributes':_0x4fb27e['attributes'],'include':_0x4fb27e[_0x70d1('0x1d')]?_[_0x70d1('0x1f')](_0x4fb27e['include'],function(_0x5d353d){return{'model':db[_0x5d353d[_0x70d1('0x1e')]],'as':_0x5d353d['as'],'attributes':_0x5d353d[_0x70d1('0x20')],'include':_0x5d353d[_0x70d1('0x1d')]?_[_0x70d1('0x1f')](_0x5d353d[_0x70d1('0x1d')],function(_0x50a4ba){return{'model':db[_0x50a4ba[_0x70d1('0x1e')]],'as':_0x50a4ba['as'],'attributes':_0x50a4ba[_0x70d1('0x20')]};}):[]};}):[]};}):[]:[]})[_0x70d1('0xd')](function(_0x7d75bc){logger[_0x70d1('0xe')](_0x70d1('0x18'),_0x4c4124);logger[_0x70d1('0x11')](_0x70d1('0x18'),_0x4c4124,JSON[_0x70d1('0x21')](_0x7d75bc));_0x3b5148(_0x7d75bc);})[_0x70d1('0x17')](function(_0x183aed){logger[_0x70d1('0x13')](_0x70d1('0x18'),_0x183aed[_0x70d1('0x15')],_0x4c4124);_0x5aad84(_0x5d530e['error'](0x1f4,_0x183aed[_0x70d1('0x15')]));});});};exports[_0x70d1('0x22')]=function(_0x332bf5){var _0x33a441=this;return new Promise(function(_0x2b0da3,_0x27183b){return db[_0x70d1('0x19')][_0x70d1('0x23')]({'raw':_0x332bf5[_0x70d1('0x1a')]?_0x332bf5['options'][_0x70d1('0x24')]===undefined?!![]:![]:!![],'where':_0x332bf5['options']?_0x332bf5['options'][_0x70d1('0x1b')]||null:null,'attributes':_0x332bf5[_0x70d1('0x1a')]?_0x332bf5[_0x70d1('0x1a')][_0x70d1('0x20')]||null:null,'include':_0x332bf5['options']?_0x332bf5[_0x70d1('0x1a')][_0x70d1('0x1d')]?_[_0x70d1('0x1f')](_0x332bf5[_0x70d1('0x1a')][_0x70d1('0x1d')],function(_0x4d1b28){return{'model':db[_0x4d1b28['model']],'as':_0x4d1b28['as'],'attributes':_0x4d1b28[_0x70d1('0x20')],'include':_0x4d1b28[_0x70d1('0x1d')]?_[_0x70d1('0x1f')](_0x4d1b28[_0x70d1('0x1d')],function(_0x1d2acb){return{'model':db[_0x1d2acb['model']],'as':_0x1d2acb['as'],'attributes':_0x1d2acb[_0x70d1('0x20')],'include':_0x1d2acb['include']?_[_0x70d1('0x1f')](_0x1d2acb[_0x70d1('0x1d')],function(_0x53362f){return{'model':db[_0x53362f[_0x70d1('0x1e')]],'as':_0x53362f['as'],'attributes':_0x53362f[_0x70d1('0x20')]};}):[]};}):[]};}):[]:[]})[_0x70d1('0xd')](function(_0x5317ac){logger[_0x70d1('0xe')]('ShowTrunk',_0x332bf5);logger[_0x70d1('0x11')](_0x70d1('0x22'),_0x332bf5,JSON[_0x70d1('0x21')](_0x5317ac));_0x2b0da3(_0x5317ac);})[_0x70d1('0x17')](function(_0x572c88){logger[_0x70d1('0x13')](_0x70d1('0x22'),_0x572c88['message'],_0x332bf5);_0x27183b(_0x33a441[_0x70d1('0x13')](0x1f4,_0x572c88[_0x70d1('0x15')]));});});};
\ No newline at end of file
index 4e6f419..0b02272 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ff4=['exports','express','Router','../../components/auth/service','put','/:id','isAuthenticated','update'];(function(_0x178f52,_0x5d9675){var _0x556f99=function(_0x4a7b17){while(--_0x4a7b17){_0x178f52['push'](_0x178f52['shift']());}};_0x556f99(++_0x5d9675);}(_0x9ff4,0x1b9));var _0x49ff=function(_0x182440,_0x28477b){_0x182440=_0x182440-0x0;var _0x534c53=_0x9ff4[_0x182440];return _0x534c53;};'use strict';var express=require(_0x49ff('0x0'));var router=express[_0x49ff('0x1')]();var auth=require(_0x49ff('0x2'));var controller=require('./user-setting.controller');router[_0x49ff('0x3')](_0x49ff('0x4'),auth[_0x49ff('0x5')](),controller[_0x49ff('0x6')]);module[_0x49ff('0x7')]=router;
\ No newline at end of file
+var _0x89d1=['../../components/auth/service','./user-setting.controller','put','/:id','isAuthenticated','exports','express','Router'];(function(_0x2e8dc5,_0x23c7ae){var _0x518a48=function(_0x576d49){while(--_0x576d49){_0x2e8dc5['push'](_0x2e8dc5['shift']());}};_0x518a48(++_0x23c7ae);}(_0x89d1,0x14e));var _0x189d=function(_0x583b0e,_0x23dbb0){_0x583b0e=_0x583b0e-0x0;var _0xafe6d1=_0x89d1[_0x583b0e];return _0xafe6d1;};'use strict';var express=require(_0x189d('0x0'));var router=express[_0x189d('0x1')]();var auth=require(_0x189d('0x2'));var controller=require(_0x189d('0x3'));router[_0x189d('0x4')](_0x189d('0x5'),auth[_0x189d('0x6')](),controller['update']);module[_0x189d('0x7')]=router;
\ No newline at end of file
index 335d574..7d7de65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc04=['TEXT','DATE','INTEGER','sequelize','error','info','debug','ENUM','BOOLEAN'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xdc04,0xc0));var _0x4dc0=function(_0xb35e81,_0x5268bf){_0xb35e81=_0xb35e81-0x0;var _0x3aca05=_0xdc04[_0xb35e81];return _0x3aca05;};'use strict';var Sequelize=require(_0x4dc0('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x4dc0('0x1'),'warning',_0x4dc0('0x2'),_0x4dc0('0x3')];module['exports']={'clientSideLoggingLevel':{'type':Sequelize[_0x4dc0('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x4dc0('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x4dc0('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x4dc0('0x6')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x4dc0('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x4dc0('0x8')],'unique':'UserId'}};
\ No newline at end of file
+var _0xd2fb=['info','exports','ENUM','BOOLEAN','TEXT','DATE','UserId','sequelize','error'];(function(_0x2b97a7,_0x536bc9){var _0x5732e2=function(_0x582e32){while(--_0x582e32){_0x2b97a7['push'](_0x2b97a7['shift']());}};_0x5732e2(++_0x536bc9);}(_0xd2fb,0xcd));var _0xbd2f=function(_0xc8e8b6,_0x1090bf){_0xc8e8b6=_0xc8e8b6-0x0;var _0xe845e5=_0xd2fb[_0xc8e8b6];return _0xe845e5;};'use strict';var Sequelize=require(_0xbd2f('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xbd2f('0x1'),'warning',_0xbd2f('0x2'),'debug'];module[_0xbd2f('0x3')]={'clientSideLoggingLevel':{'type':Sequelize[_0xbd2f('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xbd2f('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xbd2f('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xbd2f('0x6')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xbd2f('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':_0xbd2f('0x8')}};
\ No newline at end of file
index 43f765d..665192e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb26e=['redis','./user-setting.socket','register','defaults','localhost','status','json','update','error','stack','name','send','role','admin','Unauthorized','params','UserSetting','find','then','body','catch','lodash','../../config/environment','../../mysqldb'];(function(_0x196418,_0x5600f2){var _0x386d0e=function(_0x13050b){while(--_0x13050b){_0x196418['push'](_0x196418['shift']());}};_0x386d0e(++_0x5600f2);}(_0xb26e,0x11d));var _0xeb26=function(_0x514038,_0x450ef3){_0x514038=_0x514038-0x0;var _0x589720=_0xb26e[_0x514038];return _0x589720;};'use strict';var _=require(_0xeb26('0x0'));var Redis=require('ioredis');var logger=require('../../config/logger')('api');var config=require(_0xeb26('0x1'));var db=require(_0xeb26('0x2'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0xeb26('0x3')]));require(_0xeb26('0x4'))[_0xeb26('0x5')](socket);config[_0xeb26('0x3')]=_[_0xeb26('0x6')](config[_0xeb26('0x3')],{'host':_0xeb26('0x7'),'port':0x18eb});function respondWithResult(_0xc0d644,_0x39b278){_0x39b278=_0x39b278||0xc8;return function(_0x12e21a){if(_0x12e21a){return _0xc0d644[_0xeb26('0x8')](_0x39b278)[_0xeb26('0x9')](_0x12e21a);}};}function saveUpdates(_0x10c4eb){return function(_0x5d6c87){if(_0x5d6c87){return _0x5d6c87[_0xeb26('0xa')](_0x10c4eb)['then'](function(_0x54d28d){return _0x54d28d;});}return null;};}function handleEntityNotFound(_0x380b53){return function(_0x28aee6){if(!_0x28aee6){_0x380b53['sendStatus'](0x194);}return _0x28aee6;};}function handleError(_0x3bcb40,_0x5156ec){_0x5156ec=_0x5156ec||0x1f4;return function(_0x2febcc){logger[_0xeb26('0xb')](_0x2febcc[_0xeb26('0xc')]);if(_0x2febcc[_0xeb26('0xd')]){delete _0x2febcc[_0xeb26('0xd')];}_0x3bcb40[_0xeb26('0x8')](_0x5156ec)[_0xeb26('0xe')](_0x2febcc);};}exports['update']=function(_0x1af7f5,_0xf791fe){if(_0x1af7f5['user'][_0xeb26('0xf')]!==_0xeb26('0x10'))throw new Error(_0xeb26('0x11'));if(isNaN(Number(_0x1af7f5[_0xeb26('0x12')]['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db[_0xeb26('0x13')][_0xeb26('0x14')]({'where':{'id':_0x1af7f5[_0xeb26('0x12')]['id']}})[_0xeb26('0x15')](handleEntityNotFound(_0xf791fe,null))[_0xeb26('0x15')](saveUpdates(_0x1af7f5[_0xeb26('0x16')],null))[_0xeb26('0x15')](respondWithResult(_0xf791fe,null))[_0xeb26('0x17')](handleError(_0xf791fe,null));};
\ No newline at end of file
+var _0x83d3=['lodash','ioredis','../../config/logger','api','../../config/environment','socket.io-emitter','redis','./user-setting.socket','register','defaults','json','update','then','sendStatus','name','send','admin','params','find','body'];(function(_0x1ae3db,_0x546930){var _0x3bbb31=function(_0x4d916c){while(--_0x4d916c){_0x1ae3db['push'](_0x1ae3db['shift']());}};_0x3bbb31(++_0x546930);}(_0x83d3,0x17c));var _0x383d=function(_0x1fb7d1,_0x108781){_0x1fb7d1=_0x1fb7d1-0x0;var _0x2480d8=_0x83d3[_0x1fb7d1];return _0x2480d8;};'use strict';var _=require(_0x383d('0x0'));var Redis=require(_0x383d('0x1'));var logger=require(_0x383d('0x2'))(_0x383d('0x3'));var config=require(_0x383d('0x4'));var db=require('../../mysqldb')['db'];var socket=require(_0x383d('0x5'))(new Redis(config[_0x383d('0x6')]));require(_0x383d('0x7'))[_0x383d('0x8')](socket);config['redis']=_[_0x383d('0x9')](config['redis'],{'host':'localhost','port':0x18eb});function respondWithResult(_0xbc074b,_0x2c3cab){_0x2c3cab=_0x2c3cab||0xc8;return function(_0x360bee){if(_0x360bee){return _0xbc074b['status'](_0x2c3cab)[_0x383d('0xa')](_0x360bee);}};}function saveUpdates(_0x55a8e6){return function(_0x5228f3){if(_0x5228f3){return _0x5228f3[_0x383d('0xb')](_0x55a8e6)[_0x383d('0xc')](function(_0x52b7a5){return _0x52b7a5;});}return null;};}function handleEntityNotFound(_0x1e7e90){return function(_0x3efe85){if(!_0x3efe85){_0x1e7e90[_0x383d('0xd')](0x194);}return _0x3efe85;};}function handleError(_0x1542db,_0x42a26d){_0x42a26d=_0x42a26d||0x1f4;return function(_0x1ebab5){logger['error'](_0x1ebab5['stack']);if(_0x1ebab5['name']){delete _0x1ebab5[_0x383d('0xe')];}_0x1542db['status'](_0x42a26d)[_0x383d('0xf')](_0x1ebab5);};}exports[_0x383d('0xb')]=function(_0x207c1a,_0x3a57f0){if(_0x207c1a['user']['role']!==_0x383d('0x10'))throw new Error('Unauthorized');if(isNaN(Number(_0x207c1a[_0x383d('0x11')]['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db['UserSetting'][_0x383d('0x12')]({'where':{'id':_0x207c1a[_0x383d('0x11')]['id']}})['then'](handleEntityNotFound(_0x3a57f0,null))['then'](saveUpdates(_0x207c1a[_0x383d('0x13')],null))[_0x383d('0xc')](respondWithResult(_0x3a57f0,null))['catch'](handleError(_0x3a57f0,null));};
\ No newline at end of file
index 5a26701..d5b1d9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc07a=['setMaxListeners','save','update','remove','emit','hasOwnProperty','events','UserSetting'];(function(_0x129fd9,_0x4b5df3){var _0x4dc07f=function(_0x5a5aa5){while(--_0x5a5aa5){_0x129fd9['push'](_0x129fd9['shift']());}};_0x4dc07f(++_0x4b5df3);}(_0xc07a,0xa6));var _0xac07=function(_0x3604a1,_0x57bd6e){_0x3604a1=_0x3604a1-0x0;var _0x4fd388=_0xc07a[_0x3604a1];return _0x4fd388;};'use strict';var EventEmitter=require(_0xac07('0x0'));var UserSetting=require('../../mysqldb')['db'][_0xac07('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xac07('0x2')](0x0);var events={'afterCreate':_0xac07('0x3'),'afterUpdate':_0xac07('0x4'),'afterDestroy':_0xac07('0x5')};function emitEvent(_0x21f10a){return function(_0x541f32,_0x461236,_0x1735ee){UserSettingEvents[_0xac07('0x6')](_0x21f10a+':'+_0x541f32['id'],_0x541f32);UserSettingEvents[_0xac07('0x6')](_0x21f10a,_0x541f32);_0x1735ee(null);};}for(var e in events){if(events[_0xac07('0x7')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module['exports']=UserSettingEvents;
\ No newline at end of file
+var _0x6750=['exports','UserSetting','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x3c0796,_0x37e184){var _0x12e7aa=function(_0xeeaf0){while(--_0xeeaf0){_0x3c0796['push'](_0x3c0796['shift']());}};_0x12e7aa(++_0x37e184);}(_0x6750,0x76));var _0x0675=function(_0x535846,_0x5df4d0){_0x535846=_0x535846-0x0;var _0x3d0e00=_0x6750[_0x535846];return _0x3d0e00;};'use strict';var EventEmitter=require('events');var UserSetting=require('../../mysqldb')['db'][_0x0675('0x0')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x0675('0x1')](0x0);var events={'afterCreate':_0x0675('0x2'),'afterUpdate':_0x0675('0x3'),'afterDestroy':_0x0675('0x4')};function emitEvent(_0x316e15){return function(_0x587fd8,_0x1903aa,_0x456e51){UserSettingEvents['emit'](_0x316e15+':'+_0x587fd8['id'],_0x587fd8);UserSettingEvents[_0x0675('0x5')](_0x316e15,_0x587fd8);_0x456e51(null);};}for(var e in events){if(events[_0x0675('0x6')](e)){var event=events[e];UserSetting[_0x0675('0x7')](e,emitEvent(event));}}module[_0x0675('0x8')]=UserSettingEvents;
\ No newline at end of file
index e5d88f1..d056b64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bb4=['exports','define','UserSetting','user_settings','clientSideLoggingEnabledSince','./user-setting.attributes'];(function(_0x571c1d,_0x3b0586){var _0x33c609=function(_0x226499){while(--_0x226499){_0x571c1d['push'](_0x571c1d['shift']());}};_0x33c609(++_0x3b0586);}(_0x0bb4,0x77));var _0x40bb=function(_0x40f528,_0x27847a){_0x40f528=_0x40f528-0x0;var _0x5938b5=_0x0bb4[_0x40f528];return _0x5938b5;};'use strict';var attributes=require(_0x40bb('0x0'));module[_0x40bb('0x1')]=function(_0x4c9712){return _0x4c9712[_0x40bb('0x2')](_0x40bb('0x3'),attributes,{'tableName':_0x40bb('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3533ce){if(!_0x3533ce['clientSideLoggingEnabled'])_0x3533ce[_0x40bb('0x5')]=null;else if(_0x3533ce['clientSideLoggingEnabledSince']===null)_0x3533ce[_0x40bb('0x5')]=new Date();}}});};
\ No newline at end of file
+var _0x131e=['clientSideLoggingEnabled','clientSideLoggingEnabledSince','define','UserSetting','user_settings'];(function(_0x31e5cb,_0x2f5adf){var _0x4170df=function(_0x31c53e){while(--_0x31c53e){_0x31e5cb['push'](_0x31e5cb['shift']());}};_0x4170df(++_0x2f5adf);}(_0x131e,0x1ec));var _0xe131=function(_0xc25659,_0x3e6471){_0xc25659=_0xc25659-0x0;var _0xad5695=_0x131e[_0xc25659];return _0xad5695;};'use strict';var attributes=require('./user-setting.attributes');module['exports']=function(_0x58ba04){return _0x58ba04[_0xe131('0x0')](_0xe131('0x1'),attributes,{'tableName':_0xe131('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x418ed5){if(!_0x418ed5[_0xe131('0x3')])_0x418ed5[_0xe131('0x4')]=null;else if(_0x418ed5['clientSideLoggingEnabledSince']===null)_0x418ed5[_0xe131('0x4')]=new Date();}}});};
\ No newline at end of file
index ba03010..3300e36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f8b=['remove','update','user-setting:update','emit','UserId','register','length','./user-setting.events','save'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x2f8b,0x181));var _0xb2f8=function(_0x911ac1,_0x504e0b){_0x911ac1=_0x911ac1-0x0;var _0x433e95=_0x2f8b[_0x911ac1];return _0x433e95;};'use strict';var UserSettingEvents=require(_0xb2f8('0x0'));var events=[_0xb2f8('0x1'),_0xb2f8('0x2'),_0xb2f8('0x3')];function createListener(_0x4a044f,_0xd02d5b){return function(_0x370fdd){_0xd02d5b['emit'](_0x4a044f,_0x370fdd);if(_0x4a044f===_0xb2f8('0x4')){_0xd02d5b[_0xb2f8('0x5')]('user-setting:update:user-'+_0x370fdd[_0xb2f8('0x6')],_0x370fdd);}};}exports[_0xb2f8('0x7')]=function(_0x319063){for(var _0xc132db=0x0,_0x4d231e=events[_0xb2f8('0x8')];_0xc132db<_0x4d231e;_0xc132db++){var _0x18e10a=events[_0xc132db];var _0x5f3fc7=createListener('user-setting:'+_0x18e10a,_0x319063);UserSettingEvents['on'](_0x18e10a,_0x5f3fc7);}};
\ No newline at end of file
+var _0x7736=['user-setting:update','emit','user-setting:update:user-','UserId','register','save','remove','update'];(function(_0x17bace,_0x2c74ec){var _0x1c3232=function(_0x2f5c7c){while(--_0x2f5c7c){_0x17bace['push'](_0x17bace['shift']());}};_0x1c3232(++_0x2c74ec);}(_0x7736,0x195));var _0x6773=function(_0x283524,_0x90a2a3){_0x283524=_0x283524-0x0;var _0x2acedb=_0x7736[_0x283524];return _0x2acedb;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=[_0x6773('0x0'),_0x6773('0x1'),_0x6773('0x2')];function createListener(_0x40878d,_0x4383bc){return function(_0x2a7089){_0x4383bc['emit'](_0x40878d,_0x2a7089);if(_0x40878d===_0x6773('0x3')){_0x4383bc[_0x6773('0x4')](_0x6773('0x5')+_0x2a7089[_0x6773('0x6')],_0x2a7089);}};}exports[_0x6773('0x7')]=function(_0x6a6123){for(var _0x5a767a=0x0,_0x4e5b10=events['length'];_0x5a767a<_0x4e5b10;_0x5a767a++){var _0x1462a0=events[_0x5a767a];var _0xc2af5e=createListener('user-setting:'+_0x1462a0,_0x6a6123);UserSettingEvents['on'](_0x1462a0,_0xc2af5e);}};
\ No newline at end of file
index e9c9ba2..8e618e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa0f6=['/:id/queues','getVoiceQueuesRt','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getFaxAccounts','/:id/mail_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','getWhatsappAccounts','/:id/scheduled_calls','getApiKey','post','/:id/contacts','addContacts','/create_many','bulkCreate','addQueues','diskStorage','join','root','format','%s-%s','now','originalname','single','file','/:id/login','/:id/logout','/:id/pause','pause','/:id/unpause','unpause','/:id/teams','addTeams','addChatInteractions','/:id/mail_interactions','/:id/fax_interactions','/:id/sms_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/fax_accounts','addMailAccounts','/:id/openchannel_accounts','addSmsAccounts','addChatWebsites','/:id/whatsapp_accounts','/:id/square_projects','addSquareProjects','/:id/api_key','createApiKey','update','put','/:id/password','changePassword','delete','removeQueues','destroy','/:id/chat_interactions','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated','index','get','/describe','describe','whoami','/presence','/:id','/:id/avatar','getOpenTabs'];(function(_0x2addd5,_0x171b92){var _0x1c5745=function(_0x1911cf){while(--_0x1911cf){_0x2addd5['push'](_0x2addd5['shift']());}};_0x1c5745(++_0x171b92);}(_0xa0f6,0x1a1));var _0x6a0f=function(_0x50edc0,_0x2d7f71){_0x50edc0=_0x50edc0-0x0;var _0x13cab8=_0xa0f6[_0x50edc0];return _0x13cab8;};'use strict';var multer=require(_0x6a0f('0x0'));var util=require(_0x6a0f('0x1'));var path=require('path');var timeout=require(_0x6a0f('0x2'));var express=require('express');var router=express[_0x6a0f('0x3')]();var fs_extra=require(_0x6a0f('0x4'));var auth=require(_0x6a0f('0x5'));var interaction=require(_0x6a0f('0x6'));var config=require(_0x6a0f('0x7'));var controller=require(_0x6a0f('0x8'));router['get']('/',auth[_0x6a0f('0x9')](),controller[_0x6a0f('0xa')]);router[_0x6a0f('0xb')](_0x6a0f('0xc'),auth[_0x6a0f('0x9')](),controller[_0x6a0f('0xd')]);router[_0x6a0f('0xb')]('/whoami',auth[_0x6a0f('0x9')](),controller[_0x6a0f('0xe')]);router['get'](_0x6a0f('0xf'),auth[_0x6a0f('0x9')](),controller['getPresence']);router[_0x6a0f('0xb')](_0x6a0f('0x10'),auth[_0x6a0f('0x9')](),controller['show']);router[_0x6a0f('0xb')](_0x6a0f('0x11'),controller['getAvatar']);router[_0x6a0f('0xb')]('/:id/open_tabs',auth['isAuthenticated'](),controller[_0x6a0f('0x12')]);router[_0x6a0f('0xb')]('/:id/contacts',auth['isAuthenticated'](),controller['getContacts']);router[_0x6a0f('0xb')](_0x6a0f('0x13'),auth[_0x6a0f('0x9')](),controller['getQueues']);router[_0x6a0f('0xb')]('/:id/queues_rt',auth[_0x6a0f('0x9')](),controller[_0x6a0f('0x14')]);router[_0x6a0f('0xb')]('/:id/groups',auth[_0x6a0f('0x9')](),controller['getGroups']);router[_0x6a0f('0xb')]('/:id/recordings',auth['isAuthenticated'](),controller[_0x6a0f('0x15')]);router[_0x6a0f('0xb')](_0x6a0f('0x16'),auth[_0x6a0f('0x9')](),controller[_0x6a0f('0x17')]);router['get'](_0x6a0f('0x18'),auth[_0x6a0f('0x9')](),controller[_0x6a0f('0x19')]);router[_0x6a0f('0xb')](_0x6a0f('0x1a'),auth[_0x6a0f('0x9')](),controller[_0x6a0f('0x1b')]);router[_0x6a0f('0xb')](_0x6a0f('0x1c'),auth['isAuthenticated'](),controller[_0x6a0f('0x1d')]);router[_0x6a0f('0xb')](_0x6a0f('0x1e'),auth['isAuthenticated'](),controller[_0x6a0f('0x1f')]);router[_0x6a0f('0xb')]('/:id/fax/interactions',auth[_0x6a0f('0x9')](),controller[_0x6a0f('0x20')]);router[_0x6a0f('0xb')](_0x6a0f('0x21'),auth[_0x6a0f('0x9')](),controller[_0x6a0f('0x22')]);router[_0x6a0f('0xb')]('/:id/teams',auth[_0x6a0f('0x9')](),controller[_0x6a0f('0x23')]);router[_0x6a0f('0xb')](_0x6a0f('0x24'),auth[_0x6a0f('0x9')](),controller[_0x6a0f('0x25')]);router[_0x6a0f('0xb')](_0x6a0f('0x26'),auth['isAuthenticated'](),controller[_0x6a0f('0x27')]);router[_0x6a0f('0xb')](_0x6a0f('0x28'),auth[_0x6a0f('0x9')](),controller['getVoicePrefixes']);router[_0x6a0f('0xb')]('/:id/fax_accounts',auth[_0x6a0f('0x9')](),controller[_0x6a0f('0x29')]);router[_0x6a0f('0xb')](_0x6a0f('0x2a'),auth[_0x6a0f('0x9')](),controller['getMailAccounts']);router[_0x6a0f('0xb')]('/:id/openchannel_accounts',auth[_0x6a0f('0x9')](),controller[_0x6a0f('0x2b')]);router[_0x6a0f('0xb')](_0x6a0f('0x2c'),auth[_0x6a0f('0x9')](),controller[_0x6a0f('0x2d')]);router[_0x6a0f('0xb')](_0x6a0f('0x2e'),auth['isAuthenticated'](),controller[_0x6a0f('0x2f')]);router[_0x6a0f('0xb')]('/:id/whatsapp_accounts',auth[_0x6a0f('0x9')](),controller[_0x6a0f('0x30')]);router[_0x6a0f('0xb')]('/:id/square_projects',auth[_0x6a0f('0x9')](),controller['getSquareProjects']);router[_0x6a0f('0xb')](_0x6a0f('0x31'),auth[_0x6a0f('0x9')](),controller['getScheduledCalls']);router[_0x6a0f('0xb')]('/:id/api_key',auth[_0x6a0f('0x9')](),controller[_0x6a0f('0x32')]);router[_0x6a0f('0x33')](_0x6a0f('0x34'),auth[_0x6a0f('0x9')](),controller[_0x6a0f('0x35')]);router[_0x6a0f('0x33')]('/',auth[_0x6a0f('0x9')](),controller['create']);router['post'](_0x6a0f('0x36'),auth[_0x6a0f('0x9')](),controller[_0x6a0f('0x37')]);router[_0x6a0f('0x33')](_0x6a0f('0x13'),auth['isAuthenticated'](),controller[_0x6a0f('0x38')]);var upload=multer({'storage':multer[_0x6a0f('0x39')]({'destination':function(_0x1c8d35,_0x346828,_0x480719){_0x480719(null,path[_0x6a0f('0x3a')](config[_0x6a0f('0x3b')],'server/files/images/'));},'filename':function(_0x4d710a,_0x40ea7d,_0x687ccd){_0x687ccd(null,util[_0x6a0f('0x3c')](_0x6a0f('0x3d'),Date[_0x6a0f('0x3e')](),_0x40ea7d[_0x6a0f('0x3f')]));}})});router[_0x6a0f('0x33')](_0x6a0f('0x11'),upload[_0x6a0f('0x40')](_0x6a0f('0x41')),controller['addAvatar']);router[_0x6a0f('0x33')](_0x6a0f('0x42'),auth[_0x6a0f('0x9')](),controller['login']);router[_0x6a0f('0x33')](_0x6a0f('0x43'),auth['isAuthenticated'](),controller['logout']);router[_0x6a0f('0x33')](_0x6a0f('0x44'),auth['isAuthenticated'](),controller[_0x6a0f('0x45')]);router[_0x6a0f('0x33')](_0x6a0f('0x46'),auth[_0x6a0f('0x9')](),controller[_0x6a0f('0x47')]);router['post'](_0x6a0f('0x48'),auth[_0x6a0f('0x9')](),controller[_0x6a0f('0x49')]);router[_0x6a0f('0x33')]('/:id/chat_interactions',auth[_0x6a0f('0x9')](),controller[_0x6a0f('0x4a')]);router[_0x6a0f('0x33')](_0x6a0f('0x4b'),auth[_0x6a0f('0x9')](),controller['addMailInteractions']);router[_0x6a0f('0x33')](_0x6a0f('0x4c'),auth[_0x6a0f('0x9')](),controller['addFaxInteractions']);router[_0x6a0f('0x33')](_0x6a0f('0x4d'),auth['isAuthenticated'](),controller['addSmsInteractions']);router[_0x6a0f('0x33')](_0x6a0f('0x4e'),auth['isAuthenticated'](),controller[_0x6a0f('0x4f')]);router[_0x6a0f('0x33')](_0x6a0f('0x50'),auth[_0x6a0f('0x9')](),controller[_0x6a0f('0x51')]);router['post'](_0x6a0f('0x52'),auth['isAuthenticated'](),controller['addFaxAccounts']);router[_0x6a0f('0x33')](_0x6a0f('0x2a'),auth['isAuthenticated'](),controller[_0x6a0f('0x53')]);router[_0x6a0f('0x33')](_0x6a0f('0x54'),auth[_0x6a0f('0x9')](),controller['addOpenchannelAccounts']);router[_0x6a0f('0x33')](_0x6a0f('0x2c'),auth[_0x6a0f('0x9')](),controller[_0x6a0f('0x55')]);router[_0x6a0f('0x33')](_0x6a0f('0x2e'),auth[_0x6a0f('0x9')](),controller[_0x6a0f('0x56')]);router[_0x6a0f('0x33')](_0x6a0f('0x57'),auth[_0x6a0f('0x9')](),controller['addWhatsappAccounts']);router[_0x6a0f('0x33')](_0x6a0f('0x58'),auth[_0x6a0f('0x9')](),controller[_0x6a0f('0x59')]);router[_0x6a0f('0x33')](_0x6a0f('0x5a'),auth['isAuthenticated'](),controller[_0x6a0f('0x5b')]);router['put'](_0x6a0f('0x10'),auth[_0x6a0f('0x9')](),controller[_0x6a0f('0x5c')]);router[_0x6a0f('0x5d')](_0x6a0f('0x5e'),auth['isAuthenticated'](),controller[_0x6a0f('0x5f')]);router[_0x6a0f('0x60')]('/:id/queues',auth[_0x6a0f('0x9')](),controller[_0x6a0f('0x61')]);router['delete'](_0x6a0f('0x48'),auth[_0x6a0f('0x9')](),controller['removeTeams']);router[_0x6a0f('0x60')](_0x6a0f('0x10'),auth['isAuthenticated'](),controller[_0x6a0f('0x62')]);router[_0x6a0f('0x60')](_0x6a0f('0x63'),auth[_0x6a0f('0x9')](),controller[_0x6a0f('0x64')]);router[_0x6a0f('0x60')](_0x6a0f('0x4b'),auth['isAuthenticated'](),controller[_0x6a0f('0x65')]);router[_0x6a0f('0x60')](_0x6a0f('0x4c'),auth[_0x6a0f('0x9')](),controller[_0x6a0f('0x66')]);router[_0x6a0f('0x60')](_0x6a0f('0x4d'),auth[_0x6a0f('0x9')](),controller['removeSmsInteractions']);router[_0x6a0f('0x60')](_0x6a0f('0x4e'),auth[_0x6a0f('0x9')](),controller[_0x6a0f('0x67')]);router['delete'](_0x6a0f('0x50'),auth[_0x6a0f('0x9')](),controller[_0x6a0f('0x68')]);router[_0x6a0f('0x60')](_0x6a0f('0x52'),auth[_0x6a0f('0x9')](),controller[_0x6a0f('0x69')]);router[_0x6a0f('0x60')](_0x6a0f('0x2a'),auth[_0x6a0f('0x9')](),controller['removeMailAccounts']);router['delete'](_0x6a0f('0x54'),auth[_0x6a0f('0x9')](),controller['removeOpenchannelAccounts']);router[_0x6a0f('0x60')](_0x6a0f('0x2c'),auth[_0x6a0f('0x9')](),controller['removeSmsAccounts']);router[_0x6a0f('0x60')](_0x6a0f('0x2e'),auth[_0x6a0f('0x9')](),controller[_0x6a0f('0x6a')]);router[_0x6a0f('0x60')]('/:id/whatsapp_accounts',auth[_0x6a0f('0x9')](),controller['removeWhatsappAccounts']);router[_0x6a0f('0x60')](_0x6a0f('0x58'),auth['isAuthenticated'](),controller[_0x6a0f('0x6b')]);router['delete'](_0x6a0f('0x5a'),auth['isAuthenticated'](),controller[_0x6a0f('0x6c')]);module['exports']=router;
\ No newline at end of file
+var _0x8f17=['/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','getSmsAccounts','/:id/chat_websites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','/:id/scheduled_calls','getScheduledCalls','getApiKey','post','addContacts','create','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','format','originalname','file','addAvatar','/:id/login','login','/:id/logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','addMailAccounts','/:id/openchannel_accounts','addOpenchannelAccounts','/:id/api_key','createApiKey','put','update','changePassword','delete','destroy','/:id/chat_interactions','removeMailInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeOpenchannelAccounts','/:id/sms_accounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/whoami','whoami','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getSmsInteractions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists'];(function(_0x4f195c,_0x3ede84){var _0x3c06ee=function(_0x95c9af){while(--_0x95c9af){_0x4f195c['push'](_0x4f195c['shift']());}};_0x3c06ee(++_0x3ede84);}(_0x8f17,0x1e5));var _0x78f1=function(_0x290818,_0x500c35){_0x290818=_0x290818-0x0;var _0x2cc668=_0x8f17[_0x290818];return _0x2cc668;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x78f1('0x0'));var timeout=require(_0x78f1('0x1'));var express=require(_0x78f1('0x2'));var router=express[_0x78f1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x78f1('0x4'));var interaction=require(_0x78f1('0x5'));var config=require(_0x78f1('0x6'));var controller=require('./user.controller');router[_0x78f1('0x7')]('/',auth[_0x78f1('0x8')](),controller['index']);router[_0x78f1('0x7')](_0x78f1('0x9'),auth[_0x78f1('0x8')](),controller[_0x78f1('0xa')]);router['get'](_0x78f1('0xb'),auth[_0x78f1('0x8')](),controller[_0x78f1('0xc')]);router[_0x78f1('0x7')]('/presence',auth[_0x78f1('0x8')](),controller[_0x78f1('0xd')]);router[_0x78f1('0x7')](_0x78f1('0xe'),auth[_0x78f1('0x8')](),controller[_0x78f1('0xf')]);router[_0x78f1('0x7')](_0x78f1('0x10'),controller[_0x78f1('0x11')]);router[_0x78f1('0x7')](_0x78f1('0x12'),auth[_0x78f1('0x8')](),controller[_0x78f1('0x13')]);router[_0x78f1('0x7')](_0x78f1('0x14'),auth[_0x78f1('0x8')](),controller['getContacts']);router[_0x78f1('0x7')](_0x78f1('0x15'),auth['isAuthenticated'](),controller['getQueues']);router['get'](_0x78f1('0x16'),auth[_0x78f1('0x8')](),controller[_0x78f1('0x17')]);router['get'](_0x78f1('0x18'),auth['isAuthenticated'](),controller['getGroups']);router[_0x78f1('0x7')](_0x78f1('0x19'),auth[_0x78f1('0x8')](),controller[_0x78f1('0x1a')]);router['get'](_0x78f1('0x1b'),auth[_0x78f1('0x8')](),controller[_0x78f1('0x1c')]);router[_0x78f1('0x7')](_0x78f1('0x1d'),auth[_0x78f1('0x8')](),controller['getChatInteractions']);router[_0x78f1('0x7')]('/:id/openchannel/interactions',auth[_0x78f1('0x8')](),controller['getOpenchannelInteractions']);router['get']('/:id/mail/interactions',auth[_0x78f1('0x8')](),controller['getMailInteractions']);router[_0x78f1('0x7')]('/:id/sms/interactions',auth[_0x78f1('0x8')](),controller[_0x78f1('0x1e')]);router[_0x78f1('0x7')]('/:id/fax/interactions',auth[_0x78f1('0x8')](),controller['getFaxInteractions']);router['get']('/:id/whatsapp/interactions',auth['isAuthenticated'](),controller[_0x78f1('0x1f')]);router[_0x78f1('0x7')](_0x78f1('0x20'),auth['isAuthenticated'](),controller[_0x78f1('0x21')]);router['get'](_0x78f1('0x22'),auth[_0x78f1('0x8')](),controller['getLists']);router[_0x78f1('0x7')](_0x78f1('0x23'),auth[_0x78f1('0x8')](),controller[_0x78f1('0x24')]);router[_0x78f1('0x7')](_0x78f1('0x25'),auth['isAuthenticated'](),controller[_0x78f1('0x26')]);router[_0x78f1('0x7')]('/:id/fax_accounts',auth[_0x78f1('0x8')](),controller[_0x78f1('0x27')]);router['get'](_0x78f1('0x28'),auth[_0x78f1('0x8')](),controller[_0x78f1('0x29')]);router[_0x78f1('0x7')]('/:id/openchannel_accounts',auth[_0x78f1('0x8')](),controller[_0x78f1('0x2a')]);router[_0x78f1('0x7')]('/:id/sms_accounts',auth[_0x78f1('0x8')](),controller[_0x78f1('0x2b')]);router['get'](_0x78f1('0x2c'),auth[_0x78f1('0x8')](),controller['getChatWebsites']);router[_0x78f1('0x7')](_0x78f1('0x2d'),auth[_0x78f1('0x8')](),controller[_0x78f1('0x2e')]);router[_0x78f1('0x7')](_0x78f1('0x2f'),auth[_0x78f1('0x8')](),controller['getSquareProjects']);router['get'](_0x78f1('0x30'),auth[_0x78f1('0x8')](),controller[_0x78f1('0x31')]);router[_0x78f1('0x7')]('/:id/api_key',auth[_0x78f1('0x8')](),controller[_0x78f1('0x32')]);router[_0x78f1('0x33')](_0x78f1('0x14'),auth[_0x78f1('0x8')](),controller[_0x78f1('0x34')]);router['post']('/',auth[_0x78f1('0x8')](),controller[_0x78f1('0x35')]);router[_0x78f1('0x33')]('/create_many',auth['isAuthenticated'](),controller[_0x78f1('0x36')]);router[_0x78f1('0x33')](_0x78f1('0x15'),auth[_0x78f1('0x8')](),controller[_0x78f1('0x37')]);var upload=multer({'storage':multer[_0x78f1('0x38')]({'destination':function(_0x245d6b,_0x4b4164,_0x5543a4){_0x5543a4(null,path[_0x78f1('0x39')](config[_0x78f1('0x3a')],_0x78f1('0x3b')));},'filename':function(_0x46bd1e,_0x31daec,_0x1a5289){_0x1a5289(null,util[_0x78f1('0x3c')]('%s-%s',Date['now'](),_0x31daec[_0x78f1('0x3d')]));}})});router[_0x78f1('0x33')](_0x78f1('0x10'),upload['single'](_0x78f1('0x3e')),controller[_0x78f1('0x3f')]);router[_0x78f1('0x33')](_0x78f1('0x40'),auth[_0x78f1('0x8')](),controller[_0x78f1('0x41')]);router[_0x78f1('0x33')](_0x78f1('0x42'),auth[_0x78f1('0x8')](),controller['logout']);router[_0x78f1('0x33')](_0x78f1('0x43'),auth[_0x78f1('0x8')](),controller[_0x78f1('0x44')]);router[_0x78f1('0x33')](_0x78f1('0x45'),auth['isAuthenticated'](),controller[_0x78f1('0x46')]);router[_0x78f1('0x33')](_0x78f1('0x20'),auth[_0x78f1('0x8')](),controller[_0x78f1('0x47')]);router[_0x78f1('0x33')]('/:id/chat_interactions',auth[_0x78f1('0x8')](),controller[_0x78f1('0x48')]);router[_0x78f1('0x33')](_0x78f1('0x49'),auth[_0x78f1('0x8')](),controller[_0x78f1('0x4a')]);router[_0x78f1('0x33')](_0x78f1('0x4b'),auth[_0x78f1('0x8')](),controller['addFaxInteractions']);router['post'](_0x78f1('0x4c'),auth[_0x78f1('0x8')](),controller[_0x78f1('0x4d')]);router[_0x78f1('0x33')](_0x78f1('0x4e'),auth[_0x78f1('0x8')](),controller['addOpenchannelInteractions']);router[_0x78f1('0x33')](_0x78f1('0x4f'),auth[_0x78f1('0x8')](),controller[_0x78f1('0x50')]);router[_0x78f1('0x33')](_0x78f1('0x51'),auth[_0x78f1('0x8')](),controller[_0x78f1('0x52')]);router['post'](_0x78f1('0x28'),auth[_0x78f1('0x8')](),controller[_0x78f1('0x53')]);router['post'](_0x78f1('0x54'),auth[_0x78f1('0x8')](),controller[_0x78f1('0x55')]);router[_0x78f1('0x33')]('/:id/sms_accounts',auth[_0x78f1('0x8')](),controller['addSmsAccounts']);router[_0x78f1('0x33')](_0x78f1('0x2c'),auth[_0x78f1('0x8')](),controller['addChatWebsites']);router[_0x78f1('0x33')](_0x78f1('0x2d'),auth['isAuthenticated'](),controller['addWhatsappAccounts']);router[_0x78f1('0x33')](_0x78f1('0x2f'),auth[_0x78f1('0x8')](),controller['addSquareProjects']);router['post'](_0x78f1('0x56'),auth[_0x78f1('0x8')](),controller[_0x78f1('0x57')]);router[_0x78f1('0x58')](_0x78f1('0xe'),auth[_0x78f1('0x8')](),controller[_0x78f1('0x59')]);router[_0x78f1('0x58')]('/:id/password',auth[_0x78f1('0x8')](),controller[_0x78f1('0x5a')]);router['delete']('/:id/queues',auth[_0x78f1('0x8')](),controller['removeQueues']);router[_0x78f1('0x5b')](_0x78f1('0x20'),auth[_0x78f1('0x8')](),controller['removeTeams']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x78f1('0x5c')]);router[_0x78f1('0x5b')](_0x78f1('0x5d'),auth[_0x78f1('0x8')](),controller['removeChatInteractions']);router[_0x78f1('0x5b')](_0x78f1('0x49'),auth[_0x78f1('0x8')](),controller[_0x78f1('0x5e')]);router[_0x78f1('0x5b')](_0x78f1('0x4b'),auth[_0x78f1('0x8')](),controller['removeFaxInteractions']);router['delete'](_0x78f1('0x4c'),auth['isAuthenticated'](),controller['removeSmsInteractions']);router[_0x78f1('0x5b')](_0x78f1('0x4e'),auth['isAuthenticated'](),controller[_0x78f1('0x5f')]);router['delete']('/:id/whatsapp_interactions',auth['isAuthenticated'](),controller[_0x78f1('0x60')]);router[_0x78f1('0x5b')]('/:id/fax_accounts',auth[_0x78f1('0x8')](),controller[_0x78f1('0x61')]);router[_0x78f1('0x5b')]('/:id/mail_accounts',auth['isAuthenticated'](),controller['removeMailAccounts']);router[_0x78f1('0x5b')](_0x78f1('0x54'),auth['isAuthenticated'](),controller[_0x78f1('0x62')]);router['delete'](_0x78f1('0x63'),auth['isAuthenticated'](),controller['removeSmsAccounts']);router[_0x78f1('0x5b')](_0x78f1('0x2c'),auth[_0x78f1('0x8')](),controller[_0x78f1('0x64')]);router[_0x78f1('0x5b')](_0x78f1('0x2d'),auth[_0x78f1('0x8')](),controller[_0x78f1('0x65')]);router['delete'](_0x78f1('0x2f'),auth[_0x78f1('0x8')](),controller[_0x78f1('0x66')]);router[_0x78f1('0x5b')]('/:id/api_key',auth['isAuthenticated'](),controller['removeApiKey']);module[_0x78f1('0x67')]=router;
\ No newline at end of file
index 1856858..8377e2f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94c9=['ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','auto','yes','update','outgoing','nat','allow','insecure','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','active','passive','actpass','nonat','showWebBar','get','isArray','encryption','force_avp','dtlsenable','dtlsprivatekey','wss','avpf','icesupport','dtlsverify','dtlssetup','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','TEXT','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blockedAt','loginAttempts','UNSIGNED','moment','util','lodash','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','format','\x22%s\x22\x20<%s>','getDataValue','email','toLowerCase','ENUM','admin','agent','telephone','local','INTEGER','internal','accountcode','callerid','BOOLEAN','DATE','DEFAULT\x20PAUSE','friend','user','peer','from-sip','ALLOWED_FAILED_SCREEN'];(function(_0x1f31bb,_0x1e1a0f){var _0x1f4f06=function(_0x15849d){while(--_0x15849d){_0x1f31bb['push'](_0x1f31bb['shift']());}};_0x1f4f06(++_0x1e1a0f);}(_0x94c9,0x1eb));var _0x994c=function(_0x3ec0e2,_0x5d09a3){_0x3ec0e2=_0x3ec0e2-0x0;var _0x34ec43=_0x94c9[_0x3ec0e2];return _0x34ec43;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x994c('0x0'));var util=require(_0x994c('0x1'));var _=require(_0x994c('0x2'));module['exports']={'name':{'type':Sequelize[_0x994c('0x3')],'allowNull':![],'unique':_0x994c('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x2a7ced){this['setDataValue'](_0x994c('0x4'),_0x2a7ced);this[_0x994c('0x5')](_0x994c('0x6'),_0x2a7ced);},'comment':_0x994c('0x7')},'fullname':{'type':Sequelize[_0x994c('0x3')],'allowNull':![],'set':function(_0x45e6ce){this[_0x994c('0x5')](_0x994c('0x8'),_0x45e6ce);this['setDataValue']('callerid',util[_0x994c('0x9')](_0x994c('0xa'),_0x45e6ce,this[_0x994c('0xb')]('internal')));}},'alias':{'type':Sequelize[_0x994c('0x3')]},'email':{'type':Sequelize[_0x994c('0x3')],'allowNull':![],'unique':_0x994c('0xc'),'validate':{'isEmail':!![]},'set':function(_0x236f99){if(_0x236f99){this[_0x994c('0x5')]('email',_0x236f99[_0x994c('0xd')]());}}},'role':{'type':Sequelize[_0x994c('0xe')](_0x994c('0xf'),'user',_0x994c('0x10'),_0x994c('0x11')),'allowNull':![]},'password':{'type':Sequelize[_0x994c('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x994c('0x3')],'defaultValue':_0x994c('0x12')},'internal':{'type':Sequelize[_0x994c('0x13')](0xb),'allowNull':![],'unique':_0x994c('0x14'),'set':function(_0x39ccdd){this[_0x994c('0x5')](_0x994c('0x14'),_0x39ccdd);this[_0x994c('0x5')](_0x994c('0x15'),_0x39ccdd);this[_0x994c('0x5')](_0x994c('0x16'),util[_0x994c('0x9')](_0x994c('0xa'),this[_0x994c('0xb')]('fullname'),_0x39ccdd));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x994c('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x994c('0x3')]},'zipcode':{'type':Sequelize[_0x994c('0x3')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x994c('0x3')]},'online':{'type':Sequelize[_0x994c('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x994c('0x18')]},'voicePause':{'type':Sequelize[_0x994c('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x994c('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x994c('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x994c('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x994c('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x994c('0x3')],'defaultValue':_0x994c('0x19')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x994c('0x13')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x994c('0x13')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x994c('0x13')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x994c('0x13')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x994c('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x994c('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x994c('0x13')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x994c('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x994c('0x13')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x994c('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x994c('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x994c('0x17')],'defaultValue':![]},'description':{'type':Sequelize[_0x994c('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x994c('0x3')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x994c('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x994c('0x13')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x994c('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x994c('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x994c('0xe')](_0x994c('0x1a'),_0x994c('0x1b'),_0x994c('0x1c')),'allowNull':!![],'defaultValue':_0x994c('0x1a')},'context':{'type':Sequelize[_0x994c('0x3')],'allowNull':!![],'defaultValue':_0x994c('0x1d')},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN',_0x994c('0x1e'),_0x994c('0x1f'),_0x994c('0x20'),'PROHIB_PASSED_SCREEN',_0x994c('0x21'),_0x994c('0x22')),'allowNull':!![]},'deny':{'type':Sequelize[_0x994c('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x994c('0x3')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x994c('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x994c('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x994c('0x3')],'allowNull':!![],'defaultValue':_0x994c('0x23'),'set':function(_0x57a807){this[_0x994c('0x5')](_0x994c('0x24'),_0x57a807?_0x57a807[_0x994c('0x25')](','):null);},'get':function(){return this[_0x994c('0xb')]('transport')?this[_0x994c('0xb')](_0x994c('0x24'))[_0x994c('0x26')](','):null;},'comment':_0x994c('0x27')},'dtmfmode':{'type':Sequelize['ENUM'](_0x994c('0x28'),_0x994c('0x29'),'shortinfo','inband',_0x994c('0x2a')),'allowNull':!![],'defaultValue':_0x994c('0x28')},'directmedia':{'type':Sequelize['ENUM'](_0x994c('0x2b'),'no','nonat',_0x994c('0x2c'),_0x994c('0x2d')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x994c('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x994c('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x994c('0x3')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x52128e){this[_0x994c('0x5')](_0x994c('0x2e'),_0x52128e?_0x52128e[_0x994c('0x25')](','):null);},'get':function(){return this['getDataValue'](_0x994c('0x2e'))?this[_0x994c('0xb')](_0x994c('0x2e'))[_0x994c('0x26')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x994c('0x3')]},'namedcallgroup':{'type':Sequelize[_0x994c('0x3')]},'pickupgroup':{'type':Sequelize[_0x994c('0x3')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x994c('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x994c('0x3')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x534f29){this[_0x994c('0x5')]('allow',_0x534f29?_0x534f29[_0x994c('0x25')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x994c('0xb')](_0x994c('0x2f'))?this['getDataValue']('allow')[_0x994c('0x26')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x994c('0xe')](_0x994c('0x2b'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x994c('0x3')],'allowNull':!![],'set':function(_0x2fb3eb){this[_0x994c('0x5')](_0x994c('0x30'),_0x2fb3eb?_0x2fb3eb[_0x994c('0x25')](','):null);},'get':function(){return this[_0x994c('0xb')]('insecure')?this[_0x994c('0xb')](_0x994c('0x30'))[_0x994c('0x26')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x994c('0xe')](_0x994c('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x994c('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x994c('0xe')](_0x994c('0x2b'),'no',_0x994c('0x31')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x994c('0xe')](_0x994c('0x2b'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x994c('0xe')](_0x994c('0x2b'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x994c('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x994c('0x3')],'allowNull':!![],'defaultValue':_0x994c('0x32')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x994c('0xe')](_0x994c('0x2b'),'no'),'allowNull':!![],'defaultValue':_0x994c('0x2b')},'busylevel':{'type':Sequelize[_0x994c('0x13')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x994c('0xe')](_0x994c('0x2b'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x994c('0xe')](_0x994c('0x2b'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x994c('0xe')](_0x994c('0x2b'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x994c('0xe')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x994c('0x3')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x994c('0xe')](_0x994c('0x2b'),'no',_0x994c('0x33')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x994c('0x13')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x994c('0xe')](_0x994c('0x2b'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x994c('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x994c('0xe')](_0x994c('0x34'),_0x994c('0x35'),_0x994c('0x36')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x994c('0x13')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x994c('0x13')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x994c('0xe')](_0x994c('0x37'),_0x994c('0x38')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x994c('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x994c('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x994c('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x994c('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x994c('0x2b'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x994c('0x13')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x994c('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x994c('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x994c('0x13')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x994c('0x13')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x994c('0x13')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x994c('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x994c('0x13')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x994c('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x994c('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x994c('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x994c('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x994c('0xe')](_0x994c('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x994c('0x2b'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x994c('0xe')](_0x994c('0x2b'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x994c('0xe')](_0x994c('0x2b'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x994c('0xe')](_0x994c('0x2b'),'no',_0x994c('0x39'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x994c('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x994c('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x994c('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x994c('0xe')](_0x994c('0x3a'),_0x994c('0x3b'),_0x994c('0x3c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x994c('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x994c('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x994c('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x994c('0x13')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x994c('0xe')](_0x994c('0x2b'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x994c('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x994c('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x994c('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x994c('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x994c('0x2b'),'no',_0x994c('0x3d'),'update','update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x994c('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x994c('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x994c('0x18')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0x994c('0x13')],'defaultValue':0x0,'set':function(_0x32a67c){this[_0x994c('0x5')](_0x994c('0x3e'),_0x32a67c);var _0x4e4edf=this[_0x994c('0x3f')]({'plain':!![]});switch(_0x32a67c){case 0x0:case 0x1:var _0x37bed9=_0x4e4edf[_0x994c('0x24')]?_[_0x994c('0x40')](_0x4e4edf[_0x994c('0x24')])?_0x4e4edf[_0x994c('0x24')][_0x994c('0x25')]():_0x4e4edf[_0x994c('0x24')]:_0x994c('0x23');if(_0x37bed9==='wss'){_0x37bed9=_0x994c('0x23');}this[_0x994c('0x5')](_0x994c('0x24'),_0x37bed9);this['setDataValue'](_0x994c('0x41'),'no');this[_0x994c('0x5')]('avpf',null);this['setDataValue'](_0x994c('0x42'),null);this[_0x994c('0x5')]('icesupport',null);this['setDataValue'](_0x994c('0x43'),null);this['setDataValue']('dtlsverify',null);this[_0x994c('0x5')]('dtlssetup',null);this[_0x994c('0x5')]('dtlscertfile',null);this['setDataValue'](_0x994c('0x44'),null);this[_0x994c('0x5')]('rtcp_mux','no');break;case 0x2:this[_0x994c('0x5')](_0x994c('0x24'),_0x994c('0x45'));this[_0x994c('0x5')](_0x994c('0x41'),_0x994c('0x2b'));this[_0x994c('0x5')](_0x994c('0x46'),_0x994c('0x2b'));this['setDataValue'](_0x994c('0x42'),'yes');this[_0x994c('0x5')](_0x994c('0x47'),_0x994c('0x2b'));this['setDataValue'](_0x994c('0x43'),_0x994c('0x2b'));this[_0x994c('0x5')](_0x994c('0x48'),'no');this[_0x994c('0x5')](_0x994c('0x49'),_0x994c('0x3c'));this[_0x994c('0x5')](_0x994c('0x4a'),_0x4e4edf[_0x994c('0x4a')]||_0x994c('0x4b'));this[_0x994c('0x5')](_0x994c('0x44'),_0x4e4edf['dtlsprivatekey']||_0x994c('0x4c'));this[_0x994c('0x5')]('rtcp_mux',_0x994c('0x2b'));break;default:}}},'permissions':{'type':Sequelize[_0x994c('0x4d')],'set':function(_0x3f980c){this[_0x994c('0x5')](_0x994c('0x4e'),_0x3f980c?_0x3f980c[_0x994c('0x25')](','):[]);},'get':function(){return this[_0x994c('0xb')](_0x994c('0x4e'))?_['map'](this[_0x994c('0xb')](_0x994c('0x4e'))['split'](','),function(_0x746c75){return parseInt(_0x746c75,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x994c('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x994c('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x994c('0x3')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x994c('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x994c('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x994c('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x994c('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x994c('0x13')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x994c('0x2b'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x994c('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize[_0x994c('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x994c('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x994c('0x4f')],'get':function(){return this[_0x994c('0xb')](_0x994c('0x50'))?this[_0x994c('0xb')](_0x994c('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x994c('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x994c('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x994c('0x17')],'defaultValue':![]},'interface':{'type':Sequelize[_0x994c('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x994c('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x994c('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x18308a){if(typeof _0x18308a===_0x994c('0x51')){var _0x1b6612=_0x18308a==='1'?!![]:_0x18308a==='0'?![]:_0x18308a==='true'?!![]:_0x18308a===_0x994c('0x52')?![]:![];this[_0x994c('0x5')](_0x994c('0x53'),_0x1b6612);}else{this[_0x994c('0x5')](_0x994c('0x53'),_0x18308a);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x1ebdba){this[_0x994c('0x5')]('blocked',_0x1ebdba);if(_0x1ebdba===!![]){this['setDataValue'](_0x994c('0x54'),moment());this['setDataValue'](_0x994c('0x55'),0x0);}else{this[_0x994c('0x5')](_0x994c('0x54'),null);}}},'blockedAt':{'type':Sequelize[_0x994c('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x994c('0x13')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x994c('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x994c('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)[_0x994c('0x56')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x994c('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x994c('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x994c('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x994c('0x17')],'defaultValue':![]}};
\ No newline at end of file
+var _0xf41c=['fingerprint','certificate','passive','actpass','update,nonat','DATE','TEXT','showWebBar','wss','encryption','dtlsenable','dtlsverify','dtlscertfile','dtlsprivatekey','avpf','icesupport','dtlssetup','/etc/pki/tls/certs/motion.crt','rtcp_mux','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','moment','util','lodash','exports','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','getDataValue','STRING','toLowerCase','ENUM','admin','user','agent','telephone','INTEGER','\x22%s\x22\x20<%s>','BOOLEAN','DEFAULT\x20PAUSE','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','always','accept','refuse','uac','uas'];(function(_0x12c640,_0x55d934){var _0x39c1f2=function(_0x20e83e){while(--_0x20e83e){_0x12c640['push'](_0x12c640['shift']());}};_0x39c1f2(++_0x55d934);}(_0xf41c,0x7a));var _0xcf41=function(_0x23c87f,_0x18f23c){_0x23c87f=_0x23c87f-0x0;var _0x1745b4=_0xf41c[_0x23c87f];return _0x1745b4;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xcf41('0x0'));var util=require(_0xcf41('0x1'));var _=require(_0xcf41('0x2'));module[_0xcf41('0x3')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xcf41('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x25161d){this[_0xcf41('0x5')](_0xcf41('0x4'),_0x25161d);this[_0xcf41('0x5')](_0xcf41('0x6'),_0x25161d);},'comment':_0xcf41('0x7')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x210db4){this[_0xcf41('0x5')](_0xcf41('0x8'),_0x210db4);this[_0xcf41('0x5')](_0xcf41('0x9'),util[_0xcf41('0xa')]('\x22%s\x22\x20<%s>',_0x210db4,this[_0xcf41('0xb')]('internal')));}},'alias':{'type':Sequelize[_0xcf41('0xc')]},'email':{'type':Sequelize[_0xcf41('0xc')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x426092){if(_0x426092){this[_0xcf41('0x5')]('email',_0x426092[_0xcf41('0xd')]());}}},'role':{'type':Sequelize[_0xcf41('0xe')](_0xcf41('0xf'),_0xcf41('0x10'),_0xcf41('0x11'),_0xcf41('0x12')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xcf41('0xc')],'defaultValue':'local'},'internal':{'type':Sequelize[_0xcf41('0x13')](0xb),'allowNull':![],'unique':'internal','set':function(_0x481e21){this[_0xcf41('0x5')]('internal',_0x481e21);this[_0xcf41('0x5')]('accountcode',_0x481e21);this[_0xcf41('0x5')]('callerid',util[_0xcf41('0xa')](_0xcf41('0x14'),this[_0xcf41('0xb')](_0xcf41('0x8')),_0x481e21));}},'salt':{'type':Sequelize[_0xcf41('0xc')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0xcf41('0xc')]},'zipcode':{'type':Sequelize[_0xcf41('0xc')]},'userpic':{'type':Sequelize[_0xcf41('0xc')]},'city':{'type':Sequelize[_0xcf41('0xc')]},'country':{'type':Sequelize[_0xcf41('0xc')]},'online':{'type':Sequelize[_0xcf41('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0xcf41('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xcf41('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xcf41('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xcf41('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xcf41('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xcf41('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xcf41('0xc')],'defaultValue':_0xcf41('0x16')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xcf41('0x13')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xcf41('0x13')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xcf41('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xcf41('0x13')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xcf41('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xcf41('0x13')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xcf41('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xcf41('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xcf41('0xc')],'allowNull':!![]},'host':{'type':Sequelize[_0xcf41('0xc')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xcf41('0x13')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xcf41('0xc')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xcf41('0xc')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0xcf41('0x13')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0xcf41('0x17'),_0xcf41('0x10'),_0xcf41('0x18')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xcf41('0xc')],'allowNull':!![],'defaultValue':_0xcf41('0x19')},'callingpres':{'type':Sequelize[_0xcf41('0xe')](_0xcf41('0x1a'),_0xcf41('0x1b'),_0xcf41('0x1c'),_0xcf41('0x1d'),_0xcf41('0x1e'),_0xcf41('0x1f'),_0xcf41('0x20'),_0xcf41('0x21')),'allowNull':!![]},'deny':{'type':Sequelize[_0xcf41('0xc')],'allowNull':!![]},'permit':{'type':Sequelize[_0xcf41('0xc')],'allowNull':!![]},'secret':{'type':Sequelize[_0xcf41('0xc')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xcf41('0xc')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xcf41('0xc')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xcf41('0x22'),'set':function(_0x4804b3){this[_0xcf41('0x5')](_0xcf41('0x23'),_0x4804b3?_0x4804b3[_0xcf41('0x24')](','):null);},'get':function(){return this[_0xcf41('0xb')]('transport')?this[_0xcf41('0xb')]('transport')[_0xcf41('0x25')](','):null;},'comment':_0xcf41('0x26')},'dtmfmode':{'type':Sequelize[_0xcf41('0xe')](_0xcf41('0x27'),_0xcf41('0x28'),_0xcf41('0x29'),'inband',_0xcf41('0x2a')),'allowNull':!![],'defaultValue':_0xcf41('0x27')},'directmedia':{'type':Sequelize[_0xcf41('0xe')](_0xcf41('0x2b'),'no',_0xcf41('0x2c'),_0xcf41('0x2d'),_0xcf41('0x2e')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xcf41('0xe')](_0xcf41('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xcf41('0xc')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xcf41('0xc')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xcf41('0x2f'),'set':function(_0x423340){this[_0xcf41('0x5')]('nat',_0x423340?_0x423340[_0xcf41('0x24')](','):null);},'get':function(){return this[_0xcf41('0xb')](_0xcf41('0x30'))?this[_0xcf41('0xb')](_0xcf41('0x30'))[_0xcf41('0x25')](','):null;},'comment':_0xcf41('0x31')},'callgroup':{'type':Sequelize[_0xcf41('0xc')]},'namedcallgroup':{'type':Sequelize[_0xcf41('0xc')]},'pickupgroup':{'type':Sequelize[_0xcf41('0xc')]},'namedpickupgroup':{'type':Sequelize[_0xcf41('0xc')]},'language':{'type':Sequelize[_0xcf41('0xc')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xcf41('0xc')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xcf41('0x32')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xcf41('0x33'),'set':function(_0x3e0269){this['setDataValue']('allow',_0x3e0269?_0x3e0269['join'](';'):_0xcf41('0x33'));},'get':function(){return this[_0xcf41('0xb')](_0xcf41('0x34'))?this[_0xcf41('0xb')]('allow')[_0xcf41('0x25')](';'):null;},'comment':_0xcf41('0x35')},'autoframing':{'type':Sequelize[_0xcf41('0xe')](_0xcf41('0x2b'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x482338){this[_0xcf41('0x5')]('insecure',_0x482338?_0x482338['join'](','):null);},'get':function(){return this[_0xcf41('0xb')](_0xcf41('0x36'))?this[_0xcf41('0xb')]('insecure')[_0xcf41('0x25')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xcf41('0xe')](_0xcf41('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xcf41('0xe')](_0xcf41('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xcf41('0xe')](_0xcf41('0x2b'),'no',_0xcf41('0x37')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xcf41('0xe')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0xcf41('0x2b'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xcf41('0x13')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xcf41('0xc')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xcf41('0xc')],'allowNull':!![],'defaultValue':_0xcf41('0x38')},'amaflags':{'type':Sequelize[_0xcf41('0xc')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':_0xcf41('0x2b')},'busylevel':{'type':Sequelize[_0xcf41('0x13')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xcf41('0xe')](_0xcf41('0x2b'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xcf41('0xe')](_0xcf41('0x2b'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xcf41('0xe')](_0xcf41('0x2b'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xcf41('0xc')],'allowNull':!![]},'template':{'type':Sequelize[_0xcf41('0xc')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xcf41('0xe')]('yes','no',_0xcf41('0x39')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xcf41('0x13')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xcf41('0xe')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xcf41('0xc')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xcf41('0xe')](_0xcf41('0x3a'),_0xcf41('0x3b'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xcf41('0x13')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xcf41('0x13')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xcf41('0xe')](_0xcf41('0x3c'),_0xcf41('0x3d')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0xcf41('0xc')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xcf41('0xc')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xcf41('0xc')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xcf41('0xe')](_0xcf41('0x2b'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xcf41('0x13')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xcf41('0xc')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xcf41('0xc')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xcf41('0x13')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xcf41('0x13')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xcf41('0x13')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xcf41('0xe')](_0xcf41('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xcf41('0xc')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xcf41('0xc')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xcf41('0x13')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xcf41('0x13')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xcf41('0xc')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xcf41('0xc')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xcf41('0xc')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xcf41('0xe')](_0xcf41('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xcf41('0xe')](_0xcf41('0x2b'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xcf41('0xe')](_0xcf41('0x2b'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0xcf41('0x2b'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xcf41('0xe')](_0xcf41('0x2b'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xcf41('0xe')](_0xcf41('0x2b'),'no',_0xcf41('0x3e'),_0xcf41('0x3f')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xcf41('0x13')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xcf41('0xc')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xcf41('0xc')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xcf41('0xc')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xcf41('0xc')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xcf41('0xe')]('active',_0xcf41('0x40'),_0xcf41('0x41')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xcf41('0xc')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0xcf41('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xcf41('0xc')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xcf41('0x13')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xcf41('0xe')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xcf41('0xe')](_0xcf41('0x2b'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xcf41('0xc')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xcf41('0xc')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xcf41('0xc')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xcf41('0xc')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0xcf41('0x2b'),'no',_0xcf41('0x2c'),_0xcf41('0x2d'),_0xcf41('0x42')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xcf41('0xc')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0xcf41('0x43')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xcf41('0x44')]},'showWebBar':{'type':Sequelize[_0xcf41('0x13')],'defaultValue':0x0,'set':function(_0x541a31){this[_0xcf41('0x5')](_0xcf41('0x45'),_0x541a31);var _0x23f405=this['get']({'plain':!![]});switch(_0x541a31){case 0x0:case 0x1:var _0x50afc3=_0x23f405['transport']?_['isArray'](_0x23f405[_0xcf41('0x23')])?_0x23f405[_0xcf41('0x23')]['join']():_0x23f405[_0xcf41('0x23')]:_0xcf41('0x22');if(_0x50afc3===_0xcf41('0x46')){_0x50afc3='udp';}this[_0xcf41('0x5')]('transport',_0x50afc3);this[_0xcf41('0x5')](_0xcf41('0x47'),'no');this[_0xcf41('0x5')]('avpf',null);this[_0xcf41('0x5')]('force_avp',null);this[_0xcf41('0x5')]('icesupport',null);this['setDataValue'](_0xcf41('0x48'),null);this['setDataValue'](_0xcf41('0x49'),null);this[_0xcf41('0x5')]('dtlssetup',null);this[_0xcf41('0x5')](_0xcf41('0x4a'),null);this[_0xcf41('0x5')](_0xcf41('0x4b'),null);this[_0xcf41('0x5')]('rtcp_mux','no');break;case 0x2:this[_0xcf41('0x5')](_0xcf41('0x23'),_0xcf41('0x46'));this['setDataValue'](_0xcf41('0x47'),'yes');this[_0xcf41('0x5')](_0xcf41('0x4c'),'yes');this[_0xcf41('0x5')]('force_avp',_0xcf41('0x2b'));this['setDataValue'](_0xcf41('0x4d'),_0xcf41('0x2b'));this[_0xcf41('0x5')](_0xcf41('0x48'),_0xcf41('0x2b'));this[_0xcf41('0x5')](_0xcf41('0x49'),'no');this[_0xcf41('0x5')](_0xcf41('0x4e'),_0xcf41('0x41'));this[_0xcf41('0x5')](_0xcf41('0x4a'),_0x23f405[_0xcf41('0x4a')]||_0xcf41('0x4f'));this['setDataValue'](_0xcf41('0x4b'),_0x23f405[_0xcf41('0x4b')]||'/etc/pki/tls/private/motion.key');this[_0xcf41('0x5')](_0xcf41('0x50'),'yes');break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x2b4d2a){this[_0xcf41('0x5')](_0xcf41('0x51'),_0x2b4d2a?_0x2b4d2a['join'](','):[]);},'get':function(){return this[_0xcf41('0xb')](_0xcf41('0x51'))?_[_0xcf41('0x52')](this['getDataValue'](_0xcf41('0x51'))[_0xcf41('0x25')](','),function(_0x43d36f){return parseInt(_0x43d36f,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xcf41('0xc')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xcf41('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xcf41('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xcf41('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xcf41('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xcf41('0x13')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xcf41('0x13')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xcf41('0xe')](_0xcf41('0x2b'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xcf41('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xcf41('0xc')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xcf41('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xcf41('0x53')],'get':function(){return this[_0xcf41('0xb')]('phoneBarEnableScreenRecordingByAgent')?this['getDataValue'](_0xcf41('0x54')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xcf41('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xcf41('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0xcf41('0xc')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xcf41('0xc')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xcf41('0x15')],'defaultValue':![],'set':function(_0x10eb88){if(typeof _0x10eb88===_0xcf41('0x55')){var _0x407d6c=_0x10eb88==='1'?!![]:_0x10eb88==='0'?![]:_0x10eb88===_0xcf41('0x56')?!![]:_0x10eb88==='false'?![]:![];this[_0xcf41('0x5')](_0xcf41('0x57'),_0x407d6c);}else{this[_0xcf41('0x5')](_0xcf41('0x57'),_0x10eb88);}}},'blocked':{'type':Sequelize[_0xcf41('0x15')],'defaultValue':![],'set':function(_0x8149b5){this[_0xcf41('0x5')](_0xcf41('0x58'),_0x8149b5);if(_0x8149b5===!![]){this['setDataValue'](_0xcf41('0x59'),moment());this['setDataValue'](_0xcf41('0x5a'),0x0);}else{this[_0xcf41('0x5')](_0xcf41('0x59'),null);}}},'blockedAt':{'type':Sequelize[_0xcf41('0x43')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xcf41('0x13')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xcf41('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xcf41('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xcf41('0x13')](0x5)[_0xcf41('0x5b')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xcf41('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xcf41('0x15')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xcf41('0x15')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xcf41('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xcf41('0x15')],'defaultValue':![]}};
\ No newline at end of file
index 5c41208..e60d5a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x05d6=['moment','util','path','lodash','squel','jayson/promise','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','./user.socket','register','defaults','localhost','client','request','then','info','User,\x20%s,\x20%s','debug','User,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','destroy','role','admin','Users','user','Agents','agent','Telephones','telephone','filter','ignore','map','value','includes','name','UserProfileResource','stack','index','rawAttributes','fieldName','type','key','password','salt','User','includeAll','include','query','userSetting','attributes','push','findAll','openTabs','true','rows','dataValues','openchannel','whatsapp','show','params','model','differenceBy','keys','filters','intersection','fields','length','UserSetting','find','chat','sms','fax','mail','all','update','body','describe','addContacts','ids','omit','internal','securePassword','validatePasswordPattern','max','isNil','min_internal','sequelize','QueryTypes','SELECT','from','voicemail','mailbox','fullname','email','permissions','101','102','103','113','110','104','106','108','109','100','111','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','create','VoiceMail','autoAssociation','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','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','findOne','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','updatePasswordsHistory','online','voicePause','interface','Unknown\x20channel','add','capitalize','toLowerCase','Queues','penalty','QueueId','emit','Queue:save','VoiceQueue','get','voice','format','SIP/%s','each','UserVoiceQueueRt','removeQueues','isValidChannel','remove','channel','isArray','Queue:remove','addAvatar','file','filename','getAvatar','join','root','userpic','server/files/images/','download','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','concat','getContacts','CmContact','order','sort','pick','where','merge','options','hasOwnProperty','CmList','List','Tags','tag','nolimit','getQueues','Queue','getVoiceQueuesRt','ChatGroup','getGroups','UserId','VoiceRecording','getScreenRecordings','ScreenRecording','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','loginInPause','UserVoiceQueue.penalty','upsert','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','LOGIN','device','PAUSE','LOGININPAUSE','isMiddleware','resolve','logout','pause','QueuePause','updateAttributes','getChannels','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','smsPause','pauseType','lastPauseAt','manual','Pause','getTeams','addTeams','Team','getVoiceQueues','Voice','getChatQueues','setDataValue','Chat','getSmsQueues','Sms','getWhatsappQueues','Whatsapp','getFaxQueues','Fax','getOpenchannelQueues','Openchannel','flatten','transaction','addAgent','getDataValue','TeamVoicePrefix','removeTeams','getMailQueues','Mail','removeAgent','UserVoicePrefix','VoicePrefixId','getLists','getAgents','values','send','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','spread','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:save','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','OpenchannelAccount','addOpenchannelAccounts','SmsAccount','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','$or','$gt','$gte','$lt','$lte','$eq','$between','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contained','CmHopper','firstName','Contact','dialActive','getApiKey','retrieveApiKey','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','generateApiKey','iat','token','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','getUserSetting','getPresence','teams','queues','lower','col','asc','desc','http','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','unavailable','ringing','voiceStatus','slice','toUpperCase','field','ui.','InteractionId','_interactions','ui.UserId\x20=\x20?','toString','OpenTabs'];(function(_0x282b1c,_0x1c682b){var _0x32ee32=function(_0x2748af){while(--_0x2748af){_0x282b1c['push'](_0x282b1c['shift']());}};_0x32ee32(++_0x1c682b);}(_0x05d6,0x193));var _0x605d=function(_0x4ad361,_0x17f55f){_0x4ad361=_0x4ad361-0x0;var _0x3e6d74=_0x05d6[_0x4ad361];return _0x3e6d74;};'use strict';var moment=require(_0x605d('0x0'));var BPromise=require('bluebird');var util=require(_0x605d('0x1'));var path=require(_0x605d('0x2'));var fs=require('fs');var _=require(_0x605d('0x3'));var squel=require(_0x605d('0x4'));var jayson=require(_0x605d('0x5'));var Redis=require(_0x605d('0x6'));var authService=require(_0x605d('0x7'));var qs=require('../../components/parsers/qs');var logger=require(_0x605d('0x8'))('api');var utils=require(_0x605d('0x9'));var config=require(_0x605d('0xa'));var licenseUtil=require('../../config/license/util');var db=require(_0x605d('0xb'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0x605d('0xc')]));require(_0x605d('0xd'))[_0x605d('0xe')](socket);config[_0x605d('0xc')]=_[_0x605d('0xf')](config['redis'],{'host':_0x605d('0x10'),'port':0x18eb});var client=jayson[_0x605d('0x11')]['http']({'port':0x232a});var values;function respondWithRpcPromise(_0x1bb294,_0x10ad04,_0x1e6f9c,_0x52d090){return new BPromise(function(_0x2d00f3,_0xf7581){var _0x5af686=_0x52d090||client;return _0x5af686[_0x605d('0x12')](_0x1bb294,_0x1e6f9c)[_0x605d('0x13')](function(_0x63930e){logger[_0x605d('0x14')](_0x605d('0x15'),_0x10ad04,'request\x20sent');logger[_0x605d('0x16')](_0x605d('0x17'),_0x10ad04,_0x605d('0x18'),JSON['stringify'](_0x63930e));if(_0x63930e[_0x605d('0x19')]){if(_0x63930e[_0x605d('0x19')][_0x605d('0x1a')]===0x1f4){logger[_0x605d('0x19')]('User,\x20%s,\x20%s',_0x10ad04,_0x63930e[_0x605d('0x19')][_0x605d('0x1b')]);return _0xf7581(_0x63930e['error'][_0x605d('0x1b')]);}logger['error'](_0x605d('0x15'),_0x10ad04,_0x63930e[_0x605d('0x19')][_0x605d('0x1b')]);return _0x2d00f3(_0x63930e['error'][_0x605d('0x1b')]);}else{logger[_0x605d('0x14')](_0x605d('0x15'),_0x10ad04,_0x605d('0x18'));_0x2d00f3(_0x63930e[_0x605d('0x1c')][_0x605d('0x1b')]);}})[_0x605d('0x1d')](function(_0x4bca0a){logger[_0x605d('0x19')](_0x605d('0x15'),_0x10ad04,_0x4bca0a);_0xf7581(_0x4bca0a);});});}function respondWithStatusCode(_0x357500,_0xb2e307){_0xb2e307=_0xb2e307||0xcc;return function(_0x569feb){if(_0x569feb){return _0x357500[_0x605d('0x1e')](_0xb2e307);}return _0x357500[_0x605d('0x1f')](_0xb2e307)[_0x605d('0x20')]();};}function respondWithResult(_0x151e6c,_0x2389f3){_0x2389f3=_0x2389f3||0xc8;return function(_0x300691){if(_0x300691){return _0x151e6c[_0x605d('0x1f')](_0x2389f3)['json'](_0x300691);}};}function respondWithFilteredResult(_0x2da2ae,_0x815bc4){return function(_0x37d381){if(_0x37d381){var _0x30c11e=typeof _0x815bc4[_0x605d('0x21')]===_0x605d('0x22')&&typeof _0x815bc4[_0x605d('0x23')]==='undefined';var _0x785959=_0x37d381[_0x605d('0x24')];var _0x5f1a5a=_0x30c11e?0x0:_0x815bc4[_0x605d('0x21')];var _0x9a87ce=_0x30c11e?_0x37d381[_0x605d('0x24')]:_0x815bc4[_0x605d('0x21')]+_0x815bc4[_0x605d('0x23')];var _0x35b05d;if(_0x9a87ce>=_0x785959){_0x9a87ce=_0x785959;_0x35b05d=0xc8;}else{_0x35b05d=0xce;}_0x2da2ae[_0x605d('0x1f')](_0x35b05d);return _0x2da2ae['set'](_0x605d('0x25'),_0x5f1a5a+'-'+_0x9a87ce+'/'+_0x785959)[_0x605d('0x26')](_0x37d381);}return null;};}function saveUpdates(_0x1d5921){return function(_0x263858){if(_0x263858){return _0x263858['update'](_0x1d5921)[_0x605d('0x13')](function(_0xbcea92){return _0xbcea92;});}return null;};}function removeEntity(_0x13abb2){return function(_0x393d4b){if(_0x393d4b){return _0x393d4b[_0x605d('0x27')]()[_0x605d('0x13')](function(){var _0x1c2eae=_0x393d4b['get']({'plain':!![]});if(_0x1c2eae[_0x605d('0x28')]===_0x605d('0x29'))return;var _0x550dc5=[{'name':_0x605d('0x2a'),'value':_0x605d('0x2b'),'ignore':!![]},{'name':_0x605d('0x2c'),'value':_0x605d('0x2d'),'ignore':![]},{'name':_0x605d('0x2e'),'value':_0x605d('0x2f'),'ignore':![]}];var _0x2cac9d=_(_0x550dc5)[_0x605d('0x30')](_0x605d('0x31'))[_0x605d('0x32')](_0x605d('0x33'))[_0x605d('0x33')]();if(_[_0x605d('0x34')](_0x2cac9d,_0x1c2eae[_0x605d('0x28')])){return;}var _0x13936a=_['find'](_0x550dc5,['value',_0x1c2eae[_0x605d('0x28')]])[_0x605d('0x35')];return db[_0x605d('0x36')][_0x605d('0x27')]({'where':{'type':_0x13936a,'resourceId':_0x1c2eae['id']}})['then'](function(){return _0x393d4b;});})['then'](function(){_0x13abb2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x198928){return function(_0x63bfdd){if(!_0x63bfdd){_0x198928[_0x605d('0x1e')](0x194);}return _0x63bfdd;};}function handleError(_0x135a50,_0xa9812e){_0xa9812e=_0xa9812e||0x1f4;return function(_0x24b0fb){logger['error'](_0x24b0fb[_0x605d('0x37')]);if(_0x24b0fb['name']){delete _0x24b0fb[_0x605d('0x35')];}_0x135a50['status'](_0xa9812e)['send'](_0x24b0fb);};}exports[_0x605d('0x38')]=function(_0x4a7a2a,_0x1a45a4){var _0x2f4c01={},_0x39734a={'count':0x0,'rows':[]};var _0x14dc33=_(db['User'][_0x605d('0x39')])[_0x605d('0x32')](function(_0x2391a0){return{'name':_0x2391a0[_0x605d('0x3a')],'type':_0x2391a0[_0x605d('0x3b')][_0x605d('0x3c')]};})[_0x605d('0x30')](function(_0x5ceee7){return!_[_0x605d('0x34')]([_0x605d('0x3d'),_0x605d('0x3e')],_0x5ceee7['name']);})[_0x605d('0x33')]();_0x2f4c01=qs['getOptions'](_0x14dc33,_0x4a7a2a);var _0x324a1f={'where':_0x2f4c01['where']};return db[_0x605d('0x3f')][_0x605d('0x24')](_0x324a1f)[_0x605d('0x13')](function(_0x341d4b){_0x39734a[_0x605d('0x24')]=_0x341d4b;if(_0x4a7a2a['query'][_0x605d('0x40')]){_0x2f4c01[_0x605d('0x41')]=[{'all':!![]}];}if(_0x4a7a2a[_0x605d('0x42')][_0x605d('0x43')]==='true'){_0x2f4c01[_0x605d('0x41')]=[{'model':db['UserSetting'],'as':_0x605d('0x43')}];}if(!_['includes'](_0x2f4c01[_0x605d('0x44')],'id')){_0x2f4c01[_0x605d('0x44')][_0x605d('0x45')]('id');}return db[_0x605d('0x3f')][_0x605d('0x46')](_0x2f4c01);})[_0x605d('0x13')](function(_0x3801c1){_0x39734a['rows']=_0x3801c1;if(_0x4a7a2a[_0x605d('0x42')][_0x605d('0x47')]===_0x605d('0x48')){var _0x411662=[];for(var _0x570181=0x0;_0x570181<_0x39734a[_0x605d('0x49')]['length'];_0x570181++){_0x411662[_0x605d('0x45')](get_open_tabs('chat',_0x39734a[_0x605d('0x49')][_0x570181][_0x605d('0x4a')]));_0x411662[_0x605d('0x45')](get_open_tabs('sms',_0x39734a[_0x605d('0x49')][_0x570181][_0x605d('0x4a')]));_0x411662[_0x605d('0x45')](get_open_tabs('fax',_0x39734a[_0x605d('0x49')][_0x570181][_0x605d('0x4a')]));_0x411662[_0x605d('0x45')](get_open_tabs('mail',_0x39734a[_0x605d('0x49')][_0x570181]['dataValues']));_0x411662[_0x605d('0x45')](get_open_tabs(_0x605d('0x4b'),_0x39734a[_0x605d('0x49')][_0x570181][_0x605d('0x4a')]));_0x411662[_0x605d('0x45')](get_open_tabs(_0x605d('0x4c'),_0x39734a['rows'][_0x570181][_0x605d('0x4a')]));}return BPromise['all'](_0x411662)['then'](function(){return _0x39734a;});}else{return _0x39734a;}})[_0x605d('0x13')](respondWithFilteredResult(_0x1a45a4,_0x2f4c01))[_0x605d('0x1d')](handleError(_0x1a45a4,null));};exports[_0x605d('0x4d')]=function(_0x4abf28,_0x499472){var _0x46b09f={'raw':![],'where':{'id':_0x4abf28[_0x605d('0x4e')]['id']}},_0x2be9c4={};_0x2be9c4[_0x605d('0x4f')]=_[_0x605d('0x50')](_[_0x605d('0x51')](db['User']['rawAttributes']),[_0x605d('0x3d'),_0x605d('0x3e')]);_0x2be9c4[_0x605d('0x42')]=_[_0x605d('0x51')](_0x4abf28[_0x605d('0x42')]);_0x2be9c4[_0x605d('0x52')]=_[_0x605d('0x53')](_0x2be9c4['model'],_0x2be9c4[_0x605d('0x42')]);_0x46b09f[_0x605d('0x44')]=_['intersection'](_0x2be9c4[_0x605d('0x4f')],qs[_0x605d('0x54')](_0x4abf28[_0x605d('0x42')][_0x605d('0x54')]));_0x46b09f[_0x605d('0x44')]=_0x46b09f[_0x605d('0x44')][_0x605d('0x55')]?_0x46b09f[_0x605d('0x44')]:_0x2be9c4['model'];if(_0x4abf28[_0x605d('0x42')][_0x605d('0x40')]){_0x46b09f['include']=[{'all':!![]}];}if(_0x4abf28[_0x605d('0x42')]['userSetting']==='true'){_0x46b09f[_0x605d('0x41')]=[{'model':db[_0x605d('0x56')],'as':_0x605d('0x43')}];}_0x46b09f=_['merge']({},_0x46b09f,_0x4abf28['options']);if(!_[_0x605d('0x34')](_0x46b09f['attributes'],'id')){_0x46b09f[_0x605d('0x44')]['push']('id');}return db['User'][_0x605d('0x57')](_0x46b09f)[_0x605d('0x13')](handleEntityNotFound(_0x499472,null))[_0x605d('0x13')](function(_0x1ca853){var _0x2ca123=[];values=_0x1ca853;if(_0x4abf28[_0x605d('0x42')]['openTabs']===_0x605d('0x48')){_0x2ca123[_0x605d('0x45')](get_open_tabs(_0x605d('0x58'),_0x1ca853[_0x605d('0x4a')]));_0x2ca123[_0x605d('0x45')](get_open_tabs(_0x605d('0x59'),_0x1ca853['dataValues']));_0x2ca123[_0x605d('0x45')](get_open_tabs(_0x605d('0x4b'),_0x1ca853['dataValues']));_0x2ca123[_0x605d('0x45')](get_open_tabs(_0x605d('0x4c'),_0x1ca853[_0x605d('0x4a')]));_0x2ca123['push'](get_open_tabs(_0x605d('0x5a'),_0x1ca853[_0x605d('0x4a')]));_0x2ca123['push'](get_open_tabs(_0x605d('0x5b'),_0x1ca853[_0x605d('0x4a')]));return BPromise[_0x605d('0x5c')](_0x2ca123);}else{return values;}})[_0x605d('0x13')](function(){return values;})[_0x605d('0x13')](respondWithResult(_0x499472,null))['catch'](handleError(_0x499472,null));};exports[_0x605d('0x5d')]=function(_0x595cc9,_0x3506f7){if(_0x595cc9[_0x605d('0x5e')]['id']){delete _0x595cc9['body']['id'];}delete _0x595cc9[_0x605d('0x5e')]['role'];return db['User'][_0x605d('0x57')]({'where':{'id':_0x595cc9[_0x605d('0x4e')]['id']}})[_0x605d('0x13')](handleEntityNotFound(_0x3506f7,null))[_0x605d('0x13')](saveUpdates(_0x595cc9['body'],null))[_0x605d('0x13')](respondWithResult(_0x3506f7,null))[_0x605d('0x1d')](handleError(_0x3506f7,null));};exports[_0x605d('0x5f')]=function(_0x2b18ac,_0xda4de1){return db[_0x605d('0x3f')][_0x605d('0x5f')]()[_0x605d('0x13')](respondWithResult(_0xda4de1,null))[_0x605d('0x1d')](handleError(_0xda4de1,null));};exports[_0x605d('0x60')]=function(_0x243b7d,_0x277d67){return db[_0x605d('0x3f')][_0x605d('0x57')]({'where':{'id':_0x243b7d[_0x605d('0x4e')]['id']}})[_0x605d('0x13')](handleEntityNotFound(_0x277d67,null))[_0x605d('0x13')](function(_0x2152a4){if(_0x2152a4){return _0x2152a4[_0x605d('0x60')](_0x243b7d[_0x605d('0x5e')][_0x605d('0x61')],_[_0x605d('0x62')](_0x243b7d[_0x605d('0x5e')],['ids','id'])||{});}})['then'](respondWithResult(_0x277d67,null))[_0x605d('0x1d')](handleError(_0x277d67,null));};function validateUser(_0x353aa2){return new BPromise(function(_0x4d9969,_0x4ad7ef){if(_0x353aa2[_0x605d('0x63')])return _0x4d9969(_0x353aa2);return db['Setting']['findById'](0x1)[_0x605d('0x13')](function(_0x19894a){if(_0x19894a[_0x605d('0x64')])authService[_0x605d('0x65')](_0x353aa2[_0x605d('0x3d')]);db[_0x605d('0x3f')][_0x605d('0x66')](_0x605d('0x63'))[_0x605d('0x13')](function(_0x396156){if(_[_0x605d('0x67')](_0x396156)){_0x353aa2['internal']=_0x19894a[_0x605d('0x68')]||0x1;return;}if(_[_0x605d('0x67')](_0x19894a['min_internal'])||_0x19894a[_0x605d('0x68')]===_0x396156){_0x353aa2[_0x605d('0x63')]=_0x396156+0x1;return;}if(_0x19894a[_0x605d('0x68')]>_0x396156){_0x353aa2['internal']=_0x19894a[_0x605d('0x68')];return;}return db[_0x605d('0x69')][_0x605d('0x42')]('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[_0x605d('0x69')][_0x605d('0x6a')][_0x605d('0x6b')]})[_0x605d('0x13')](function(_0x1c8cbe){if(_0x1c8cbe&&_0x1c8cbe['length']){for(var _0x5409cc=0x0,_0x417830=_0x1c8cbe[_0x605d('0x55')];_0x5409cc<_0x417830&&_[_0x605d('0x67')](_0x353aa2[_0x605d('0x63')]);_0x5409cc++){if(_0x19894a[_0x605d('0x68')]<=_0x1c8cbe[_0x5409cc][_0x605d('0x6c')]){_0x353aa2[_0x605d('0x63')]=_0x1c8cbe[_0x5409cc][_0x605d('0x6c')];}else if(_0x19894a[_0x605d('0x68')]>_0x1c8cbe[_0x5409cc][_0x605d('0x6c')]&&_0x19894a['min_internal']<=_0x1c8cbe[_0x5409cc]['to']){_0x353aa2['internal']=_0x19894a[_0x605d('0x68')];}}}if(_[_0x605d('0x67')](_0x353aa2[_0x605d('0x63')])){_0x353aa2[_0x605d('0x63')]=_0x396156+0x1;}return _0x4d9969(_0x353aa2);});});})[_0x605d('0x1d')](function(_0x8dcc0c){_0x4ad7ef(_0x8dcc0c);});});}function updateUser(_0x40f783){return new BPromise(function(_0x1b2e8e,_0x2d478b){try{if(_0x40f783[_0x605d('0x6d')]){_0x40f783[_0x605d('0x6e')]=_0x40f783['internal'];_0x40f783['VoiceMail']={'mailbox':_0x40f783[_0x605d('0x63')],'password':_0x40f783[_0x605d('0x3d')],'fullname':_0x40f783[_0x605d('0x6f')],'email':_0x40f783[_0x605d('0x70')]};}if(_0x40f783[_0x605d('0x28')]==='agent'){if(!_0x40f783[_0x605d('0x71')])_0x40f783[_0x605d('0x71')]=[_0x605d('0x72'),_0x605d('0x73'),_0x605d('0x74'),_0x605d('0x75'),_0x605d('0x76'),_0x605d('0x77'),'105',_0x605d('0x78'),'107',_0x605d('0x79'),_0x605d('0x7a'),_0x605d('0x7b'),_0x605d('0x7c'),'114','115'];}_0x1b2e8e(_0x40f783);}catch(_0x16fca3){_0x2d478b(_0x16fca3);}});}exports['create']=function(_0x5df1aa,_0x41c8fd){if(_0x5df1aa[_0x605d('0x2b')]['role']===_0x605d('0x2d'))throw new Error(_0x605d('0x7d'));if(_0x5df1aa[_0x605d('0x5e')][_0x605d('0x28')]===_0x605d('0x2b')&&_0x5df1aa[_0x605d('0x2b')][_0x605d('0x28')]!==_0x605d('0x29')){throw new Error(_0x605d('0x7e'));}if(_0x5df1aa[_0x605d('0x5e')][_0x605d('0x28')]==='admin'&&_0x5df1aa[_0x605d('0x2b')]['role']!==_0x605d('0x29')){throw new Error(_0x605d('0x7f'));}return licenseUtil[_0x605d('0x80')]([_0x5df1aa['body']])[_0x605d('0x13')](function(){return validateUser(_0x5df1aa[_0x605d('0x5e')]);})['then'](function(_0x86fcc3){return updateUser(_0x86fcc3)[_0x605d('0x13')](function(_0x4a7b23){if(_0x4a7b23['role']===_0x605d('0x29')){_0x4a7b23[_0x605d('0x81')]=_0x5df1aa[_0x605d('0x2b')]['settingsEnabled'];delete _0x4a7b23[_0x605d('0x82')];}return _0x4a7b23;});})[_0x605d('0x13')](function(_0x34ad60){return db[_0x605d('0x3f')][_0x605d('0x83')](_0x34ad60,{'include':[{'model':db[_0x605d('0x84')],'as':_0x605d('0x84')}]});})[_0x605d('0x13')](function(_0xf56524){if(_0x5df1aa[_0x605d('0x5e')][_0x605d('0x28')]===_0x605d('0x2b'))return _0xf56524;if(_0x5df1aa[_0x605d('0x2b')][_0x605d('0x28')]!==_0x605d('0x2b'))return _0xf56524;return db['UserProfileSection'][_0x605d('0x57')]({'where':{'name':_0xf56524[_0x605d('0x28')]===_0x605d('0x2d')?'Agents':_0x605d('0x2e'),'userProfileId':_0x5df1aa[_0x605d('0x2b')][_0x605d('0x82')]},'raw':!![]})[_0x605d('0x13')](function(_0x460901){if(!_0x460901||_0x460901[_0x605d('0x85')]!=0x0)return _0xf56524;return db['UserProfileResource'][_0x605d('0x83')]({'name':_0xf56524[_0x605d('0x35')],'resourceId':_0xf56524['id'],'type':_0x460901[_0x605d('0x35')],'sectionId':_0x460901['id']},{})[_0x605d('0x13')](function(){return _0xf56524;});})[_0x605d('0x1d')](function(_0x15dbe9){logger[_0x605d('0x19')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x15dbe9);throw _0x15dbe9;});})[_0x605d('0x13')](respondWithResult(_0x41c8fd,0xc9))[_0x605d('0x1d')](handleError(_0x41c8fd,null));};exports[_0x605d('0x86')]=function(_0x5e82fb,_0x23fec2){var _0x3e42cb=_0x5e82fb[_0x605d('0x5e')];var _0x440724=[];if(_0x5e82fb[_0x605d('0x2b')][_0x605d('0x28')]===_0x605d('0x2d'))throw new Error(_0x605d('0x7d'));if(_[_0x605d('0x87')](_0x3e42cb,['role',_0x605d('0x2b')])&&_0x5e82fb[_0x605d('0x2b')][_0x605d('0x28')]!=='admin'){throw new Error(_0x605d('0x7e'));}if(_[_0x605d('0x87')](_0x3e42cb,[_0x605d('0x28'),_0x605d('0x29')])&&_0x5e82fb[_0x605d('0x2b')][_0x605d('0x28')]!==_0x605d('0x29')){throw new Error(_0x605d('0x88'));}return licenseUtil[_0x605d('0x80')](_0x3e42cb)['then'](function(){return validateUser(_0x3e42cb[0x0]);})['then'](function(){for(var _0x203d08=0x1;_0x203d08<_0x3e42cb[_0x605d('0x55')];_0x203d08++){var _0x1cb101=_0x3e42cb[_0x203d08-0x1][_0x605d('0x63')];if(!_0x3e42cb[_0x203d08][_0x605d('0x63')])_0x3e42cb[_0x203d08]['internal']=_0x1cb101+0x1;_0x440724['push'](validateUser(_0x3e42cb[_0x203d08]));}return BPromise[_0x605d('0x5c')](_0x440724);})[_0x605d('0x13')](function(){_0x440724=[];for(var _0x22f0e2=0x0;_0x22f0e2<_0x3e42cb[_0x605d('0x55')];_0x22f0e2++){_0x440724[_0x605d('0x45')](updateUser(_0x3e42cb[_0x22f0e2]));}return BPromise[_0x605d('0x5c')](_0x440724);})[_0x605d('0x13')](function(){return BPromise['each'](_0x3e42cb,function(_0x308701){return db[_0x605d('0x3f')][_0x605d('0x83')](_0x308701,{'include':[{'model':db[_0x605d('0x84')],'as':_0x605d('0x84')}]})['then'](function(_0x4e047b){_0x308701['id']=_0x4e047b['id'];return _0x308701;});});})[_0x605d('0x13')](function(_0x562075){if(_0x5e82fb['body'][_0x605d('0x28')]==='user')return _0x562075;if(_0x5e82fb[_0x605d('0x2b')][_0x605d('0x28')]!=='user')return _0x562075;var _0x170af2=_[_0x605d('0x87')](_0x562075,function(_0xa63959){return _0xa63959[_0x605d('0x28')]==='agent'||_0xa63959[_0x605d('0x28')]===_0x605d('0x2f');});if(!_0x170af2)return _0x562075;return db['UserProfileSection'][_0x605d('0x46')]({'where':{'name':{'$or':[_0x605d('0x2c'),_0x605d('0x2e')]},'userProfileId':_0x5e82fb[_0x605d('0x2b')][_0x605d('0x82')]},'raw':!![]})[_0x605d('0x13')](function(_0xea8e5a){if(_[_0x605d('0x89')](_0xea8e5a)||!_[_0x605d('0x87')](_0xea8e5a,[_0x605d('0x85'),0x0]))return _0x562075;_0x440724=[];var _0x2aa7c1=_(_0xea8e5a)['map'](function(_0x22027d){if(_0x22027d[_0x605d('0x85')]===0x1)return;return _0x22027d['name']===_0x605d('0x2c')?_0x605d('0x2d'):_0x605d('0x2f');})[_0x605d('0x8a')]()[_0x605d('0x33')]();for(var _0x2e7a45=0x0;_0x2e7a45<_0x562075[_0x605d('0x55')];_0x2e7a45++){if(!_['includes'](_0x2aa7c1,_0x562075[_0x2e7a45][_0x605d('0x28')]))return;var _0x2a49b1=_0x562075[_0x2e7a45][_0x605d('0x28')]===_0x605d('0x2d')?_0x605d('0x2c'):_0x605d('0x2e');_0x440724[_0x605d('0x45')](db[_0x605d('0x36')]['create']({'name':_0x562075[_0x2e7a45][_0x605d('0x35')],'resourceId':_0x562075[_0x2e7a45]['id'],'type':_0x2a49b1,'sectionId':_[_0x605d('0x57')](_0xea8e5a,[_0x605d('0x35'),_0x2a49b1])['id']},{}));}return BPromise['all'](_0x440724);});})[_0x605d('0x13')](respondWithResult(_0x23fec2,0xc9))[_0x605d('0x1d')](handleError(_0x23fec2,null));};exports[_0x605d('0x8b')]=function(_0x14053d,_0x2d1531){if(_0x14053d[_0x605d('0x5e')]['id']){delete _0x14053d[_0x605d('0x5e')]['id'];}return db[_0x605d('0x3f')][_0x605d('0x57')]({'where':{'id':_0x14053d[_0x605d('0x4e')]['id']}})[_0x605d('0x13')](function(_0x1f2737){if(!_0x1f2737)return null;if(_0x1f2737['id']===_0x14053d[_0x605d('0x2b')]['id']){if(!_0x14053d['body']['oldPassword']||!_0x14053d[_0x605d('0x5e')][_0x605d('0x8c')]){throw new db[(_0x605d('0x8d'))][(_0x605d('0x8e'))](_0x605d('0x8f'));}if(!_0x1f2737[_0x605d('0x90')](_0x14053d[_0x605d('0x5e')][_0x605d('0x91')])){throw new db[(_0x605d('0x8d'))][(_0x605d('0x8e'))](_0x605d('0x92'));}if(_0x14053d[_0x605d('0x5e')][_0x605d('0x91')]===_0x14053d[_0x605d('0x5e')][_0x605d('0x8c')]){throw new db[(_0x605d('0x8d'))][(_0x605d('0x8e'))](_0x605d('0x93'));}}else if(_0x14053d[_0x605d('0x2b')][_0x605d('0x28')]===_0x605d('0x29')){if(!_0x14053d[_0x605d('0x5e')][_0x605d('0x8c')]){throw new db['Sequelize'][(_0x605d('0x8e'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x14053d['user']['role']===_0x605d('0x2b')){if(!_0x14053d['body'][_0x605d('0x8c')]){throw new db[(_0x605d('0x8d'))][(_0x605d('0x8e'))](_0x605d('0x94'));}if(_0x1f2737['role']!==_0x605d('0x2d')){throw new db['Sequelize'][(_0x605d('0x8e'))](_0x605d('0x7d'));}}else{throw new db['Sequelize'][(_0x605d('0x8e'))](_0x605d('0x7d'));}return _0x1f2737;})[_0x605d('0x13')](handleEntityNotFound(_0x2d1531,null))[_0x605d('0x13')](function(_0x1c883c){return db['Setting'][_0x605d('0x95')]({'attributes':['id',_0x605d('0x64'),_0x605d('0x96'),_0x605d('0x97')]})['then'](function(_0x2c6331){if(_0x2c6331[_0x605d('0x64')])authService[_0x605d('0x65')](_0x14053d[_0x605d('0x5e')]['newPassword']);if(!_0x2c6331[_0x605d('0x96')]||!_0x1c883c['previousPasswords'])return _0x1c883c;authService['validatePasswordHistory'](_0x14053d[_0x605d('0x5e')]['newPassword'],_0x1c883c[_0x605d('0x98')],_0x2c6331[_0x605d('0x97')]);return _0x1c883c;})[_0x605d('0x13')](saveUpdates({'password':_0x14053d[_0x605d('0x5e')]['newPassword'],'passwordResetAt':_0x14053d[_0x605d('0x2b')]['id']==_0x14053d[_0x605d('0x4e')]['id']?moment():null,'previousPasswords':authService[_0x605d('0x99')](_0x14053d['body'][_0x605d('0x8c')],_0x1c883c[_0x605d('0x98')])},null));})['then'](respondWithResult(_0x2d1531,null))[_0x605d('0x1d')](handleError(_0x2d1531,null));};exports['addQueues']=function(_0x1b5461,_0x202969){var _0x4d4a69=_0x1b5461[_0x605d('0x5e')]['channel'];return db['User'][_0x605d('0x57')]({'where':{'id':_0x1b5461[_0x605d('0x4e')]['id']},'attributes':['id','name',_0x605d('0x28'),_0x605d('0x9a'),'loginInPause',_0x605d('0x9b'),_0x605d('0x9c')]})[_0x605d('0x13')](handleEntityNotFound(_0x202969,null))[_0x605d('0x13')](function(_0x4aa9f9){if(_0x4aa9f9){if(!utils['isValidChannel'](_0x4d4a69)){throw new db[(_0x605d('0x8d'))]['ValidationError'](_0x605d('0x9d'));}return _0x4aa9f9[_0x605d('0x9e')+_[_0x605d('0x9f')](_0x4d4a69[_0x605d('0xa0')]())+_0x605d('0xa1')](_0x1b5461['body']['ids'],{'penalty':_0x1b5461[_0x605d('0x5e')][_0x605d('0xa2')]||0x0})['spread'](function(_0x2353e7){for(var _0x4d08f6=0x0;_0x4d08f6<_0x1b5461['body'][_0x605d('0x61')][_0x605d('0x55')];_0x4d08f6+=0x1){var _0xddb53e={'UserId':Number(_0x1b5461[_0x605d('0x4e')]['id'])};_0xddb53e[_['capitalize'](_0x4d4a69[_0x605d('0xa0')]())+_0x605d('0xa3')]=Number(_0x1b5461[_0x605d('0x5e')][_0x605d('0x61')][_0x4d08f6]);socket[_0x605d('0xa4')](_0x605d('0x2b')+_[_0x605d('0x9f')](_0x4d4a69[_0x605d('0xa0')]())+_0x605d('0xa5'),_0xddb53e);}return _0x2353e7;})[_0x605d('0x13')](function(){if(_0x4d4a69==='voice'){return db[_0x605d('0xa6')][_0x605d('0x46')]({'where':{'id':_0x1b5461['body'][_0x605d('0x61')]||[]},'raw':!![],'attributes':['id',_0x605d('0x35')]});}})['then'](function(_0x3a9234){var _0x479246=_0x4aa9f9[_0x605d('0xa7')]({'plain':!![]});var _0x529c8d=[];if(_0x4d4a69===_0x605d('0xa8')&&_0x479246[_0x605d('0x28')]==='agent'&&_0x479246[_0x605d('0x9a')]){for(var _0x5cdd99=0x0;_0x5cdd99<_0x3a9234[_0x605d('0x55')];_0x5cdd99+=0x1){_0x529c8d['push']({'membername':_0x479246[_0x605d('0x35')],'UserId':_0x479246['id'],'queue_name':_0x3a9234[_0x5cdd99][_0x605d('0x35')],'VoiceQueueId':_0x3a9234[_0x5cdd99]['id'],'interface':_[_0x605d('0x67')](_0x479246[_0x605d('0x9c')])?util[_0x605d('0xa9')](_0x605d('0xaa'),_0x479246[_0x605d('0x35')]):_0x479246['interface'],'paused':_0x479246['voicePause']||![],'penalty':_0x1b5461['body'][_0x605d('0xa2')]||0x0});}return BPromise[_0x605d('0xab')](_0x529c8d,function(_0x27ec97){return db[_0x605d('0xac')]['upsert'](_0x27ec97);});}return _0x4aa9f9;});}})['then'](respondWithStatusCode(_0x202969,null))[_0x605d('0x1d')](handleError(_0x202969,null));};exports[_0x605d('0xad')]=function(_0x326ad4,_0x3479f9){var _0x546ca8,_0x32b260;return db[_0x605d('0x3f')][_0x605d('0x57')]({'where':{'id':_0x326ad4[_0x605d('0x4e')]['id']},'attributes':['id','name','role']})[_0x605d('0x13')](handleEntityNotFound(_0x3479f9,null))[_0x605d('0x13')](function(_0x58dfe1){if(_0x58dfe1){_0x546ca8=_0x58dfe1;if(!_0x326ad4['query']['channel']||!utils[_0x605d('0xae')](_0x326ad4['query']['channel'])){throw new db[(_0x605d('0x8d'))][(_0x605d('0x8e'))](_0x605d('0x9d'));}return _0x58dfe1[_0x605d('0xaf')+_['capitalize'](_0x326ad4[_0x605d('0x42')][_0x605d('0xb0')][_0x605d('0xa0')]())+_0x605d('0xa1')](_0x326ad4['query'][_0x605d('0x61')]);}})[_0x605d('0x13')](function(_0x2e548e){if(_[_0x605d('0xb1')](_0x326ad4[_0x605d('0x42')][_0x605d('0x61')])){for(var _0x4a6a59=0x0;_0x4a6a59<_0x326ad4[_0x605d('0x42')][_0x605d('0x61')]['length'];_0x4a6a59+=0x1){_0x32b260={'UserId':Number(_0x326ad4[_0x605d('0x4e')]['id'])};_0x32b260[_[_0x605d('0x9f')](_0x326ad4['query']['channel'][_0x605d('0xa0')]())+_0x605d('0xa3')]=Number(_0x326ad4[_0x605d('0x42')][_0x605d('0x61')][_0x4a6a59]);socket['emit'](_0x605d('0x2b')+_[_0x605d('0x9f')](_0x326ad4[_0x605d('0x42')][_0x605d('0xb0')]['toLowerCase']())+_0x605d('0xb2'),_0x32b260);}}else{_0x32b260={'UserId':Number(_0x326ad4[_0x605d('0x4e')]['id'])};_0x32b260[_[_0x605d('0x9f')](_0x326ad4[_0x605d('0x42')][_0x605d('0xb0')][_0x605d('0xa0')]())+_0x605d('0xa3')]=Number(_0x326ad4[_0x605d('0x42')][_0x605d('0x61')]);socket[_0x605d('0xa4')](_0x605d('0x2b')+_[_0x605d('0x9f')](_0x326ad4[_0x605d('0x42')][_0x605d('0xb0')][_0x605d('0xa0')]())+_0x605d('0xb2'),_0x32b260);}return _0x2e548e;})[_0x605d('0x13')](function(){if(_0x326ad4[_0x605d('0x42')][_0x605d('0xb0')]==='voice'){return db['UserVoiceQueueRt'][_0x605d('0x27')]({'where':{'UserId':_0x326ad4[_0x605d('0x4e')]['id'],'VoiceQueueId':_0x326ad4[_0x605d('0x42')][_0x605d('0x61')]},'individualHooks':!![]})[_0x605d('0x13')](function(){return _0x546ca8;});}return _0x546ca8;})[_0x605d('0x13')](respondWithStatusCode(_0x3479f9,null))[_0x605d('0x1d')](handleError(_0x3479f9,null));};exports[_0x605d('0xb3')]=function(_0x3e2e41,_0x11a67a){_0x3e2e41[_0x605d('0x5e')]['userpic']=_0x3e2e41[_0x605d('0xb4')][_0x605d('0xb5')];return db[_0x605d('0x3f')][_0x605d('0x57')]({'where':{'id':_0x3e2e41['params']['id']}})['then'](handleEntityNotFound(_0x11a67a,null))[_0x605d('0x13')](saveUpdates(_0x3e2e41[_0x605d('0x5e')],null))[_0x605d('0x13')](respondWithResult(_0x11a67a,null))[_0x605d('0x1d')](handleError(_0x11a67a,null));};exports[_0x605d('0xb6')]=function(_0x5eccd2,_0x5bba7a){var _0x42d8bc=path[_0x605d('0xb7')](config[_0x605d('0xb8')],'server/files/images/logos/default_profile.png');return db[_0x605d('0x3f')][_0x605d('0x57')]({'where':{'id':_0x5eccd2[_0x605d('0x4e')]['id']},'attributes':['id','userpic'],'raw':!![]})['then'](handleEntityNotFound(_0x5bba7a,null))[_0x605d('0x13')](function(_0x5c6eeb){if(_0x5c6eeb){if(_['isNil'](_0x5c6eeb[_0x605d('0xb9')])){return _0x5bba7a['download'](_0x42d8bc);}else{if(!fs['existsSync'](path[_0x605d('0xb7')](config[_0x605d('0xb8')],_0x605d('0xba'),_0x5c6eeb[_0x605d('0xb9')]))){return _0x5bba7a['download'](_0x42d8bc);}return _0x5bba7a[_0x605d('0xbb')](path[_0x605d('0xb7')](config['root'],'server/files/images/',_0x5c6eeb['userpic']));}}})[_0x605d('0x1d')](handleError(_0x5bba7a,null));};exports['getOpenTabs']=function(_0x1c1b54,_0xc2768a){return db[_0x605d('0x3f')][_0x605d('0x57')]({'where':{'id':_0x1c1b54['params']['id']},'attributes':['id']})[_0x605d('0x13')](handleEntityNotFound(_0xc2768a,null))[_0x605d('0x13')](function(_0x2e6b81){var _0x2815b7=[];values=_0x2e6b81['dataValues'];_0x2815b7[_0x605d('0x45')](get_open_tabs('chat',_0x2e6b81[_0x605d('0x4a')]));_0x2815b7[_0x605d('0x45')](get_open_tabs(_0x605d('0x59'),_0x2e6b81['dataValues']));_0x2815b7[_0x605d('0x45')](get_open_tabs(_0x605d('0x4b'),_0x2e6b81[_0x605d('0x4a')]));_0x2815b7[_0x605d('0x45')](get_open_tabs('whatsapp',_0x2e6b81[_0x605d('0x4a')]));_0x2815b7[_0x605d('0x45')](get_open_tabs('fax',_0x2e6b81[_0x605d('0x4a')]));_0x2815b7['push'](get_open_tabs(_0x605d('0x5b'),_0x2e6b81['dataValues']));return BPromise['all'](_0x2815b7);})[_0x605d('0x13')](function(_0x5a8a4c){if(_0x5a8a4c){var _0x3500c8=_[_0x605d('0x32')](values['ChatOpenTabs'],function(_0x4427df){return{'channel':_0x605d('0xbc'),'id':_0x4427df['id'],'createdAt':_0x4427df[_0x605d('0xbd')]};});var _0x2f5eab=_[_0x605d('0x32')](values[_0x605d('0xbe')],function(_0x55cf2b){return{'channel':_0x605d('0xbf'),'id':_0x55cf2b['id'],'createdAt':_0x55cf2b[_0x605d('0xbd')]};});var _0x5885ba=_[_0x605d('0x32')](values[_0x605d('0xc0')],function(_0x1d65fe){return{'channel':_0x605d('0xc1'),'id':_0x1d65fe['id'],'createdAt':_0x1d65fe[_0x605d('0xbd')]};});var _0x212ff0=_[_0x605d('0x32')](values[_0x605d('0xc2')],function(_0x88550e){return{'channel':_0x605d('0xc3'),'id':_0x88550e['id'],'createdAt':_0x88550e[_0x605d('0xbd')]};});var _0xa467ce=_[_0x605d('0x32')](values[_0x605d('0xc4')],function(_0x55eede){return{'channel':_0x605d('0xc5'),'id':_0x55eede['id'],'createdAt':_0x55eede['createdAt']};});var _0x3af2c7=_[_0x605d('0x32')](values['WhatsappOpenTabs'],function(_0xb1886e){return{'channel':'WHATSAPP','id':_0xb1886e['id'],'createdAt':_0xb1886e[_0x605d('0xbd')]};});var _0x52d270=_[_0x605d('0xc6')](_0x3500c8,_0x2f5eab,_0x5885ba,_0x212ff0,_0xa467ce,_0x3af2c7);var _0x472b40={'count':_0x52d270[_0x605d('0x55')],'rows':_0x52d270};return _0x472b40;}else return null;})[_0x605d('0x13')](respondWithResult(_0xc2768a,null))[_0x605d('0x1d')](handleError(_0xc2768a,null));};exports[_0x605d('0xc7')]=function(_0x536933,_0x5a1566){var _0x1090ef={};var _0x19ca5a={};var _0x399e8d;var _0x39fe1d;return db['User']['findOne']({'where':{'id':_0x536933[_0x605d('0x4e')]['id']}})[_0x605d('0x13')](handleEntityNotFound(_0x5a1566,null))[_0x605d('0x13')](function(_0x4ec372){if(_0x4ec372){_0x399e8d=_0x4ec372;_0x19ca5a[_0x605d('0x4f')]=_[_0x605d('0x51')](db[_0x605d('0xc8')]['rawAttributes']);_0x19ca5a[_0x605d('0x42')]=_['keys'](_0x536933['query']);_0x19ca5a['filters']=_[_0x605d('0x53')](_0x19ca5a[_0x605d('0x4f')],_0x19ca5a[_0x605d('0x42')]);_0x1090ef[_0x605d('0x44')]=_[_0x605d('0x53')](_0x19ca5a[_0x605d('0x4f')],qs['fields'](_0x536933[_0x605d('0x42')][_0x605d('0x54')]));_0x1090ef['attributes']=_0x1090ef['attributes'][_0x605d('0x55')]?_0x1090ef[_0x605d('0x44')]:_0x19ca5a[_0x605d('0x4f')];_0x1090ef[_0x605d('0xc9')]=qs['sort'](_0x536933[_0x605d('0x42')][_0x605d('0xca')]);_0x1090ef['where']=qs[_0x605d('0x52')](_[_0x605d('0xcb')](_0x536933[_0x605d('0x42')],_0x19ca5a['filters']));if(_0x536933[_0x605d('0x42')][_0x605d('0x30')]){_0x1090ef[_0x605d('0xcc')]=_[_0x605d('0xcd')](_0x1090ef[_0x605d('0xcc')],{'$or':_[_0x605d('0x32')](_0x1090ef[_0x605d('0x44')],function(_0x3d3470){var _0x2a982a={};_0x2a982a[_0x3d3470]={'$like':'%'+_0x536933[_0x605d('0x42')][_0x605d('0x30')]+'%'};return _0x2a982a;})});}_0x1090ef=_[_0x605d('0xcd')]({},_0x1090ef,_0x536933[_0x605d('0xce')]);return _0x399e8d[_0x605d('0xc7')](_0x1090ef);}})[_0x605d('0x13')](function(_0x5abd9e){if(_0x5abd9e){_0x39fe1d=_0x5abd9e[_0x605d('0x55')];if(_0x536933[_0x605d('0x42')][_0x605d('0xcf')](_0x605d('0x40'))){_0x1090ef[_0x605d('0x41')]=[{'model':db[_0x605d('0xd0')],'as':_0x605d('0xd1'),'required':![]},{'model':db['Tag'],'as':_0x605d('0xd2'),'attributes':['id',_0x605d('0x35'),'color'],'where':_0x536933[_0x605d('0x42')][_0x605d('0xd3')]?{'id':_0x536933[_0x605d('0x42')][_0x605d('0xd3')]}:undefined,'required':_0x536933[_0x605d('0x42')]['tag']?!![]:![]}];}if(!_0x536933[_0x605d('0x42')][_0x605d('0xcf')](_0x605d('0xd4'))){_0x1090ef['limit']=qs[_0x605d('0x23')](_0x536933[_0x605d('0x42')][_0x605d('0x23')]);_0x1090ef['offset']=qs[_0x605d('0x21')](_0x536933['query'][_0x605d('0x21')]);}return _0x399e8d['getContacts'](_0x1090ef);}})[_0x605d('0x13')](function(_0x3102ca){if(_0x3102ca){return _0x3102ca?{'count':_0x39fe1d,'rows':_0x3102ca}:null;}})['then'](respondWithResult(_0x5a1566,null))[_0x605d('0x1d')](handleError(_0x5a1566,null));};exports[_0x605d('0xd5')]=function(_0x19c53d,_0x434529){var _0x430d88;var _0x5bdfc1={};var _0x4d40f8;return db[_0x605d('0x3f')]['findOne']({'where':{'id':_0x19c53d[_0x605d('0x4e')]['id']},'attributes':['id',_0x605d('0x35'),_0x605d('0x28')]})[_0x605d('0x13')](handleEntityNotFound(_0x434529,null))['then'](function(_0x359b24){if(!utils[_0x605d('0xae')](_0x19c53d[_0x605d('0x42')]['channel'])){throw new db[(_0x605d('0x8d'))]['ValidationError'](_0x605d('0x9d'));}_0x430d88=_0x359b24;var _0xc9c3dc={};_0xc9c3dc[_0x605d('0x4f')]=_[_0x605d('0x51')](db[_[_0x605d('0x9f')](_0x19c53d[_0x605d('0x42')][_0x605d('0xb0')])+_0x605d('0xd6')][_0x605d('0x39')]);_0xc9c3dc['query']=_[_0x605d('0x51')](_0x19c53d[_0x605d('0x42')]);_0xc9c3dc[_0x605d('0x52')]=_['intersection'](_0xc9c3dc['model'],_0xc9c3dc[_0x605d('0x42')]);_0x5bdfc1[_0x605d('0x44')]=_[_0x605d('0x53')](_0xc9c3dc['model'],qs[_0x605d('0x54')](_0x19c53d['query']['fields']));_0x5bdfc1['attributes']=_0x5bdfc1[_0x605d('0x44')]['length']?_0x5bdfc1[_0x605d('0x44')]:_0xc9c3dc['model'];_0x5bdfc1[_0x605d('0xc9')]=qs[_0x605d('0xca')](_0x19c53d[_0x605d('0x42')][_0x605d('0xca')]);_0x5bdfc1[_0x605d('0xcc')]=qs['filters'](_[_0x605d('0xcb')](_0x19c53d[_0x605d('0x42')],_0xc9c3dc[_0x605d('0x52')]));if(_0x19c53d['query'][_0x605d('0x30')]){_0x5bdfc1[_0x605d('0xcc')]=_[_0x605d('0xcd')](_0x5bdfc1[_0x605d('0xcc')],{'$or':_['map'](_0x5bdfc1[_0x605d('0x44')],function(_0x4c146d){var _0x2ba6cb={};_0x2ba6cb[_0x4c146d]={'$like':'%'+_0x19c53d[_0x605d('0x42')]['filter']+'%'};return _0x2ba6cb;})});}_0x5bdfc1=_[_0x605d('0xcd')]({},_0x5bdfc1,_0x19c53d['options']);switch(_0x430d88[_0x605d('0x28')]){case _0x605d('0x29'):return db[_[_0x605d('0x9f')](_0x19c53d[_0x605d('0x42')][_0x605d('0xb0')])+_0x605d('0xd6')][_0x605d('0x46')](_0x5bdfc1);case _0x605d('0x2b'):case'agent':return _0x430d88[_0x605d('0xa7')+_[_0x605d('0x9f')](_0x19c53d[_0x605d('0x42')][_0x605d('0xb0')])+_0x605d('0xa1')](_0x5bdfc1);default:throw new db[(_0x605d('0x8d'))]['ValidationError']('Unknown\x20role');}})[_0x605d('0x13')](function(_0x5b5719){_0x4d40f8=_0x5b5719[_0x605d('0x55')];if(!_0x19c53d[_0x605d('0x42')]['hasOwnProperty']('nolimit')){_0x5bdfc1[_0x605d('0x23')]=qs[_0x605d('0x23')](_0x19c53d[_0x605d('0x42')][_0x605d('0x23')]);_0x5bdfc1[_0x605d('0x21')]=qs[_0x605d('0x21')](_0x19c53d['query'][_0x605d('0x21')]);}switch(_0x430d88[_0x605d('0x28')]){case _0x605d('0x29'):return db[_[_0x605d('0x9f')](_0x19c53d[_0x605d('0x42')][_0x605d('0xb0')])+_0x605d('0xd6')]['findAll'](_0x5bdfc1);case _0x605d('0x2b'):case _0x605d('0x2d'):return _0x430d88['get'+_[_0x605d('0x9f')](_0x19c53d[_0x605d('0x42')][_0x605d('0xb0')])+_0x605d('0xa1')](_0x5bdfc1);}})[_0x605d('0x13')](function(_0x264b46){return{'count':_0x4d40f8,'rows':_0x264b46};})[_0x605d('0x13')](respondWithResult(_0x434529,null))['catch'](handleError(_0x434529,null));};exports[_0x605d('0xd7')]=function(_0x1ff498,_0x553e91){var _0x3786cb={};var _0x3faf18={};var _0x430334;var _0x1b78c8;return db[_0x605d('0x3f')][_0x605d('0x95')]({'where':{'id':_0x1ff498[_0x605d('0x4e')]['id']}})['then'](handleEntityNotFound(_0x553e91,null))['then'](function(_0x4090ab){if(_0x4090ab){_0x430334=_0x4090ab;_0x3faf18[_0x605d('0x4f')]=_['keys'](db['UserVoiceQueueRt'][_0x605d('0x39')]);_0x3faf18[_0x605d('0x42')]=_[_0x605d('0x51')](_0x1ff498['query']);_0x3faf18['filters']=_['intersection'](_0x3faf18[_0x605d('0x4f')],_0x3faf18[_0x605d('0x42')]);_0x3786cb[_0x605d('0x44')]=_[_0x605d('0x53')](_0x3faf18[_0x605d('0x4f')],qs['fields'](_0x1ff498[_0x605d('0x42')][_0x605d('0x54')]));_0x3786cb[_0x605d('0x44')]=_0x3786cb[_0x605d('0x44')][_0x605d('0x55')]?_0x3786cb[_0x605d('0x44')]:_0x3faf18[_0x605d('0x4f')];_0x3786cb['order']=qs[_0x605d('0xca')](_0x1ff498[_0x605d('0x42')][_0x605d('0xca')]);_0x3786cb[_0x605d('0xcc')]=qs[_0x605d('0x52')](_[_0x605d('0xcb')](_0x1ff498['query'],_0x3faf18['filters']));if(_0x1ff498['query']['filter']){_0x3786cb[_0x605d('0xcc')]=_[_0x605d('0xcd')](_0x3786cb[_0x605d('0xcc')],{'$or':_['map'](_0x3786cb[_0x605d('0x44')],function(_0x3cc253){var _0x5a5ab0={};_0x5a5ab0[_0x3cc253]={'$like':'%'+_0x1ff498['query'][_0x605d('0x30')]+'%'};return _0x5a5ab0;})});}_0x3786cb=_[_0x605d('0xcd')]({},_0x3786cb,_0x1ff498[_0x605d('0xce')]);return _0x430334['getVoiceQueuesRt'](_0x3786cb);}})[_0x605d('0x13')](function(_0x2a3d6c){if(_0x2a3d6c){_0x1b78c8=_0x2a3d6c['length'];if(!_0x1ff498['query'][_0x605d('0xcf')](_0x605d('0xd4'))){_0x3786cb[_0x605d('0x23')]=qs[_0x605d('0x23')](_0x1ff498[_0x605d('0x42')][_0x605d('0x23')]);_0x3786cb[_0x605d('0x21')]=qs[_0x605d('0x21')](_0x1ff498[_0x605d('0x42')]['offset']);}return _0x430334[_0x605d('0xd7')](_0x3786cb);}})[_0x605d('0x13')](function(_0x22ac76){if(_0x22ac76){return _0x22ac76?{'count':_0x1b78c8,'rows':_0x22ac76}:null;}})['then'](respondWithResult(_0x553e91,null))[_0x605d('0x1d')](handleError(_0x553e91,null));};exports['getGroups']=function(_0x593014,_0x211d5b){var _0x284627={};var _0x518e14={};var _0x5ef537;var _0x1f9b3d;return db['User'][_0x605d('0x95')]({'where':{'id':_0x593014[_0x605d('0x4e')]['id']}})[_0x605d('0x13')](handleEntityNotFound(_0x211d5b,null))[_0x605d('0x13')](function(_0x2cc52a){if(_0x2cc52a){_0x5ef537=_0x2cc52a;_0x518e14['model']=_[_0x605d('0x51')](db[_0x605d('0xd8')][_0x605d('0x39')]);_0x518e14[_0x605d('0x42')]=_[_0x605d('0x51')](_0x593014[_0x605d('0x42')]);_0x518e14['filters']=_['intersection'](_0x518e14[_0x605d('0x4f')],_0x518e14[_0x605d('0x42')]);_0x284627['attributes']=_[_0x605d('0x53')](_0x518e14[_0x605d('0x4f')],qs[_0x605d('0x54')](_0x593014[_0x605d('0x42')]['fields']));_0x284627['attributes']=_0x284627[_0x605d('0x44')][_0x605d('0x55')]?_0x284627[_0x605d('0x44')]:_0x518e14[_0x605d('0x4f')];_0x284627[_0x605d('0xc9')]=qs[_0x605d('0xca')](_0x593014['query'][_0x605d('0xca')]);_0x284627[_0x605d('0xcc')]=qs[_0x605d('0x52')](_[_0x605d('0xcb')](_0x593014['query'],_0x518e14[_0x605d('0x52')]));if(_0x593014[_0x605d('0x42')][_0x605d('0x30')]){_0x284627[_0x605d('0xcc')]=_[_0x605d('0xcd')](_0x284627[_0x605d('0xcc')],{'$or':_[_0x605d('0x32')](_0x284627[_0x605d('0x44')],function(_0x2186af){var _0x12382d={};_0x12382d[_0x2186af]={'$like':'%'+_0x593014[_0x605d('0x42')]['filter']+'%'};return _0x12382d;})});}_0x284627=_[_0x605d('0xcd')]({},_0x284627,_0x593014[_0x605d('0xce')]);return _0x5ef537[_0x605d('0xd9')](_0x284627);}})[_0x605d('0x13')](function(_0x22e05f){if(_0x22e05f){_0x1f9b3d=_0x22e05f[_0x605d('0x55')];if(!_0x593014['query'][_0x605d('0xcf')](_0x605d('0xd4'))){_0x284627[_0x605d('0x23')]=qs[_0x605d('0x23')](_0x593014[_0x605d('0x42')][_0x605d('0x23')]);_0x284627['offset']=qs[_0x605d('0x21')](_0x593014[_0x605d('0x42')][_0x605d('0x21')]);}return _0x5ef537[_0x605d('0xd9')](_0x284627);}})['then'](function(_0x37d1bf){if(_0x37d1bf){return _0x37d1bf?{'count':_0x1f9b3d,'rows':_0x37d1bf}:null;}})[_0x605d('0x13')](respondWithResult(_0x211d5b,null))[_0x605d('0x1d')](handleError(_0x211d5b,null));};exports['getRecordings']=function(_0x1404e1,_0x160c8f){var _0x20d8f5={'raw':!![],'where':{}};var _0x3fe704={};var _0x5ead67={'count':0x0,'rows':[]};return db['User'][_0x605d('0x95')]({'where':{'id':_0x1404e1[_0x605d('0x4e')]['id']}})[_0x605d('0x13')](handleEntityNotFound(_0x160c8f,null))['then'](function(_0x1db1a5){if(_0x1db1a5){_0x3fe704[_0x605d('0x4f')]=_['keys'](db['VoiceRecording'][_0x605d('0x39')]);_0x3fe704[_0x605d('0x42')]=_[_0x605d('0x51')](_0x1404e1[_0x605d('0x42')]);_0x3fe704['filters']=_[_0x605d('0x53')](_0x3fe704['model'],_0x3fe704[_0x605d('0x42')]);_0x20d8f5[_0x605d('0x44')]=_['intersection'](_0x3fe704[_0x605d('0x4f')],qs[_0x605d('0x54')](_0x1404e1['query'][_0x605d('0x54')]));_0x20d8f5[_0x605d('0x44')]=_0x20d8f5[_0x605d('0x44')][_0x605d('0x55')]?_0x20d8f5[_0x605d('0x44')]:_0x3fe704[_0x605d('0x4f')];if(!_0x1404e1[_0x605d('0x42')][_0x605d('0xcf')]('nolimit')){_0x20d8f5[_0x605d('0x23')]=qs['limit'](_0x1404e1[_0x605d('0x42')][_0x605d('0x23')]);_0x20d8f5[_0x605d('0x21')]=qs[_0x605d('0x21')](_0x1404e1[_0x605d('0x42')][_0x605d('0x21')]);}_0x20d8f5['order']=qs['sort'](_0x1404e1[_0x605d('0x42')]['sort']);_0x20d8f5[_0x605d('0xcc')]=qs[_0x605d('0x52')](_[_0x605d('0xcb')](_0x1404e1[_0x605d('0x42')],_0x3fe704[_0x605d('0x52')]));_0x20d8f5[_0x605d('0xcc')][_0x605d('0xda')]=_0x1db1a5['id'];if(_0x1404e1[_0x605d('0x42')][_0x605d('0x30')]){_0x20d8f5[_0x605d('0xcc')]=_[_0x605d('0xcd')](_0x20d8f5[_0x605d('0xcc')],{'$or':_[_0x605d('0x32')](_0x20d8f5[_0x605d('0x44')],function(_0x25dc9f){var _0x14ed07={};_0x14ed07[_0x25dc9f]={'$like':'%'+_0x1404e1[_0x605d('0x42')][_0x605d('0x30')]+'%'};return _0x14ed07;})});}_0x20d8f5=_['merge']({},_0x20d8f5,_0x1404e1['options']);return db[_0x605d('0xdb')][_0x605d('0x24')]({'where':_0x20d8f5[_0x605d('0xcc')]})[_0x605d('0x13')](function(_0x22adbc){_0x5ead67['count']=_0x22adbc;if(_0x1404e1[_0x605d('0x42')][_0x605d('0x40')]){_0x20d8f5[_0x605d('0x41')]=[{'all':!![]}];}return db['VoiceRecording']['findAll'](_0x20d8f5);})[_0x605d('0x13')](function(_0x3b64d5){_0x5ead67[_0x605d('0x49')]=_0x3b64d5;return _0x5ead67;});}})[_0x605d('0x13')](respondWithFilteredResult(_0x160c8f,_0x20d8f5))[_0x605d('0x1d')](handleError(_0x160c8f,null));};exports[_0x605d('0xdc')]=function(_0x52df0b,_0x2bc25b){var _0x386782={'raw':!![],'where':{}};var _0x4cad54={};var _0x54f6c3={'count':0x0,'rows':[]};return db[_0x605d('0x3f')][_0x605d('0x95')]({'where':{'id':_0x52df0b[_0x605d('0x4e')]['id']}})[_0x605d('0x13')](handleEntityNotFound(_0x2bc25b,null))[_0x605d('0x13')](function(_0x3b44be){if(_0x3b44be){_0x4cad54['model']=_[_0x605d('0x51')](db['ScreenRecording'][_0x605d('0x39')]);_0x4cad54['query']=_[_0x605d('0x51')](_0x52df0b[_0x605d('0x42')]);_0x4cad54[_0x605d('0x52')]=_['intersection'](_0x4cad54[_0x605d('0x4f')],_0x4cad54['query']);_0x386782['attributes']=_[_0x605d('0x53')](_0x4cad54[_0x605d('0x4f')],qs[_0x605d('0x54')](_0x52df0b['query'][_0x605d('0x54')]));_0x386782[_0x605d('0x44')]=_0x386782[_0x605d('0x44')][_0x605d('0x55')]?_0x386782[_0x605d('0x44')]:_0x4cad54[_0x605d('0x4f')];if(!_0x52df0b[_0x605d('0x42')]['hasOwnProperty'](_0x605d('0xd4'))){_0x386782[_0x605d('0x23')]=qs[_0x605d('0x23')](_0x52df0b[_0x605d('0x42')][_0x605d('0x23')]);_0x386782[_0x605d('0x21')]=qs['offset'](_0x52df0b[_0x605d('0x42')]['offset']);}_0x386782[_0x605d('0xc9')]=qs[_0x605d('0xca')](_0x52df0b[_0x605d('0x42')]['sort']);_0x386782[_0x605d('0xcc')]=qs['filters'](_[_0x605d('0xcb')](_0x52df0b[_0x605d('0x42')],_0x4cad54['filters']));_0x386782[_0x605d('0xcc')][_0x605d('0xda')]=_0x3b44be['id'];if(_0x52df0b['query'][_0x605d('0x30')]){_0x386782[_0x605d('0xcc')]=_['merge'](_0x386782[_0x605d('0xcc')],{'$or':_[_0x605d('0x32')](_0x386782['attributes'],function(_0x53e70f){var _0x306c7f={};_0x306c7f[_0x53e70f]={'$like':'%'+_0x52df0b['query'][_0x605d('0x30')]+'%'};return _0x306c7f;})});}_0x386782=_[_0x605d('0xcd')]({},_0x386782,_0x52df0b[_0x605d('0xce')]);return db[_0x605d('0xdd')][_0x605d('0x24')]({'where':_0x386782[_0x605d('0xcc')]})[_0x605d('0x13')](function(_0x2b021f){_0x54f6c3['count']=_0x2b021f;if(_0x52df0b[_0x605d('0x42')][_0x605d('0x40')]){_0x386782[_0x605d('0x41')]=[{'all':!![]}];}return db[_0x605d('0xdd')][_0x605d('0x46')](_0x386782);})['then'](function(_0x3bb201){_0x54f6c3[_0x605d('0x49')]=_0x3bb201;return _0x54f6c3;});}})[_0x605d('0x13')](respondWithFilteredResult(_0x2bc25b,_0x386782))[_0x605d('0x1d')](handleError(_0x2bc25b,null));};exports['getChatInteractions']=function(_0x58e5ce,_0x53bf67){var _0x41192c={};var _0x310065={};var _0x2d24c6;var _0x54db0f;return db[_0x605d('0x3f')][_0x605d('0x95')]({'where':{'id':_0x58e5ce[_0x605d('0x4e')]['id']}})['then'](handleEntityNotFound(_0x53bf67,null))[_0x605d('0x13')](function(_0x2c680f){if(_0x2c680f){_0x2d24c6=_0x2c680f;_0x310065[_0x605d('0x4f')]=_['keys'](db[_0x605d('0xde')][_0x605d('0x39')]);_0x310065[_0x605d('0x42')]=_[_0x605d('0x51')](_0x58e5ce['query']);_0x310065[_0x605d('0x52')]=_[_0x605d('0x53')](_0x310065[_0x605d('0x4f')],_0x310065['query']);_0x41192c[_0x605d('0x44')]=_[_0x605d('0x53')](_0x310065[_0x605d('0x4f')],qs[_0x605d('0x54')](_0x58e5ce[_0x605d('0x42')][_0x605d('0x54')]));_0x41192c[_0x605d('0x44')]=_0x41192c[_0x605d('0x44')][_0x605d('0x55')]?_0x41192c['attributes']:_0x310065['model'];_0x41192c['order']=qs[_0x605d('0xca')](_0x58e5ce['query']['sort']);_0x41192c['where']=qs[_0x605d('0x52')](_[_0x605d('0xcb')](_0x58e5ce[_0x605d('0x42')],_0x310065['filters']));if(_0x58e5ce[_0x605d('0x42')][_0x605d('0x30')]){_0x41192c[_0x605d('0xcc')]=_['merge'](_0x41192c['where'],{'$or':_[_0x605d('0x32')](_0x41192c[_0x605d('0x44')],function(_0x36adb9){var _0x11c16b={};_0x11c16b[_0x36adb9]={'$like':'%'+_0x58e5ce[_0x605d('0x42')][_0x605d('0x30')]+'%'};return _0x11c16b;})});}_0x41192c=_[_0x605d('0xcd')]({},_0x41192c,_0x58e5ce[_0x605d('0xce')]);return _0x2d24c6['getChatInteractions'](_0x41192c);}})['then'](function(_0x54f86b){if(_0x54f86b){_0x54db0f=_0x54f86b[_0x605d('0x55')];if(!_0x58e5ce[_0x605d('0x42')][_0x605d('0xcf')]('nolimit')){_0x41192c['limit']=qs[_0x605d('0x23')](_0x58e5ce['query']['limit']);_0x41192c[_0x605d('0x21')]=qs[_0x605d('0x21')](_0x58e5ce[_0x605d('0x42')][_0x605d('0x21')]);}return _0x2d24c6['getChatInteractions'](_0x41192c);}})[_0x605d('0x13')](function(_0x54b554){if(_0x54b554){return _0x54b554?{'count':_0x54db0f,'rows':_0x54b554}:null;}})['then'](respondWithResult(_0x53bf67,null))[_0x605d('0x1d')](handleError(_0x53bf67,null));};exports[_0x605d('0xdf')]=function(_0x4384b8,_0x898324){var _0x789674={};var _0x5b2755={};var _0x2f4a37;var _0x5d9203;return db[_0x605d('0x3f')][_0x605d('0x95')]({'where':{'id':_0x4384b8['params']['id']}})['then'](handleEntityNotFound(_0x898324,null))['then'](function(_0xe7c850){if(_0xe7c850){_0x2f4a37=_0xe7c850;_0x5b2755[_0x605d('0x4f')]=_['keys'](db[_0x605d('0xe0')][_0x605d('0x39')]);_0x5b2755[_0x605d('0x42')]=_[_0x605d('0x51')](_0x4384b8[_0x605d('0x42')]);_0x5b2755[_0x605d('0x52')]=_[_0x605d('0x53')](_0x5b2755['model'],_0x5b2755[_0x605d('0x42')]);_0x789674['attributes']=_[_0x605d('0x53')](_0x5b2755[_0x605d('0x4f')],qs[_0x605d('0x54')](_0x4384b8[_0x605d('0x42')][_0x605d('0x54')]));_0x789674[_0x605d('0x44')]=_0x789674[_0x605d('0x44')][_0x605d('0x55')]?_0x789674[_0x605d('0x44')]:_0x5b2755['model'];_0x789674['order']=qs['sort'](_0x4384b8['query'][_0x605d('0xca')]);_0x789674[_0x605d('0xcc')]=qs[_0x605d('0x52')](_[_0x605d('0xcb')](_0x4384b8['query'],_0x5b2755[_0x605d('0x52')]));if(_0x4384b8[_0x605d('0x42')][_0x605d('0x30')]){_0x789674[_0x605d('0xcc')]=_['merge'](_0x789674[_0x605d('0xcc')],{'$or':_['map'](_0x789674[_0x605d('0x44')],function(_0x7c7005){var _0x51e1e9={};_0x51e1e9[_0x7c7005]={'$like':'%'+_0x4384b8['query']['filter']+'%'};return _0x51e1e9;})});}_0x789674=_['merge']({},_0x789674,_0x4384b8[_0x605d('0xce')]);return _0x2f4a37['getOpenchannelInteractions'](_0x789674);}})[_0x605d('0x13')](function(_0x4a049a){if(_0x4a049a){_0x5d9203=_0x4a049a[_0x605d('0x55')];if(!_0x4384b8[_0x605d('0x42')][_0x605d('0xcf')](_0x605d('0xd4'))){_0x789674['limit']=qs[_0x605d('0x23')](_0x4384b8[_0x605d('0x42')][_0x605d('0x23')]);_0x789674[_0x605d('0x21')]=qs[_0x605d('0x21')](_0x4384b8[_0x605d('0x42')][_0x605d('0x21')]);}return _0x2f4a37['getOpenchannelInteractions'](_0x789674);}})[_0x605d('0x13')](function(_0x485065){if(_0x485065){return _0x485065?{'count':_0x5d9203,'rows':_0x485065}:null;}})[_0x605d('0x13')](respondWithResult(_0x898324,null))[_0x605d('0x1d')](handleError(_0x898324,null));};exports[_0x605d('0xe1')]=function(_0x4df3e0,_0x5f4502){var _0x46126c={'raw':!![],'where':{}};var _0x23dbf9={};var _0x3c0412={'count':0x0,'rows':[]};return db[_0x605d('0x3f')][_0x605d('0x95')]({'where':{'id':_0x4df3e0[_0x605d('0x4e')]['id']}})[_0x605d('0x13')](handleEntityNotFound(_0x5f4502,null))[_0x605d('0x13')](function(_0x330bfb){if(_0x330bfb){_0x23dbf9[_0x605d('0x4f')]=_[_0x605d('0x51')](db[_0x605d('0xe2')]['rawAttributes']);_0x23dbf9[_0x605d('0x42')]=_['keys'](_0x4df3e0['query']);_0x23dbf9['filters']=_[_0x605d('0x53')](_0x23dbf9[_0x605d('0x4f')],_0x23dbf9[_0x605d('0x42')]);_0x46126c[_0x605d('0x44')]=_[_0x605d('0x53')](_0x23dbf9[_0x605d('0x4f')],qs[_0x605d('0x54')](_0x4df3e0[_0x605d('0x42')][_0x605d('0x54')]));_0x46126c[_0x605d('0x44')]=_0x46126c[_0x605d('0x44')][_0x605d('0x55')]?_0x46126c[_0x605d('0x44')]:_0x23dbf9['model'];if(!_0x4df3e0[_0x605d('0x42')][_0x605d('0xcf')]('nolimit')){_0x46126c[_0x605d('0x23')]=qs['limit'](_0x4df3e0['query'][_0x605d('0x23')]);_0x46126c[_0x605d('0x21')]=qs[_0x605d('0x21')](_0x4df3e0['query']['offset']);}_0x46126c[_0x605d('0xc9')]=qs['sort'](_0x4df3e0[_0x605d('0x42')]['sort']);_0x46126c['where']=qs['filters'](_[_0x605d('0xcb')](_0x4df3e0[_0x605d('0x42')],_0x23dbf9['filters']));_0x46126c[_0x605d('0xcc')][_0x605d('0xda')]=_0x330bfb['id'];if(_0x4df3e0[_0x605d('0x42')][_0x605d('0x30')]){_0x46126c[_0x605d('0xcc')]=_[_0x605d('0xcd')](_0x46126c[_0x605d('0xcc')],{'$or':_[_0x605d('0x32')](_0x46126c[_0x605d('0x44')],function(_0x4de58a){var _0x260844={};_0x260844[_0x4de58a]={'$like':'%'+_0x4df3e0['query'][_0x605d('0x30')]+'%'};return _0x260844;})});}_0x46126c=_[_0x605d('0xcd')]({},_0x46126c,_0x4df3e0[_0x605d('0xce')]);return db[_0x605d('0xe2')][_0x605d('0x24')]({'where':_0x46126c['where']})[_0x605d('0x13')](function(_0x25edfc){_0x3c0412['count']=_0x25edfc;if(_0x4df3e0[_0x605d('0x42')][_0x605d('0x40')]){_0x46126c[_0x605d('0x41')]=[{'all':!![]}];}return db[_0x605d('0xe2')]['findAll'](_0x46126c);})[_0x605d('0x13')](function(_0x250c4a){_0x3c0412[_0x605d('0x49')]=_0x250c4a;return _0x3c0412;});}})[_0x605d('0x13')](respondWithFilteredResult(_0x5f4502,_0x46126c))[_0x605d('0x1d')](handleError(_0x5f4502,null));};exports[_0x605d('0xe3')]=function(_0x5460d2,_0x40fb6d){var _0x2dac76={};var _0x20b70d={};var _0x2a8a39;var _0x1ffa04;return db[_0x605d('0x3f')]['findOne']({'where':{'id':_0x5460d2[_0x605d('0x4e')]['id']}})[_0x605d('0x13')](handleEntityNotFound(_0x40fb6d,null))[_0x605d('0x13')](function(_0x4f232c){if(_0x4f232c){_0x2a8a39=_0x4f232c;_0x20b70d[_0x605d('0x4f')]=_[_0x605d('0x51')](db['SmsInteraction'][_0x605d('0x39')]);_0x20b70d[_0x605d('0x42')]=_[_0x605d('0x51')](_0x5460d2[_0x605d('0x42')]);_0x20b70d['filters']=_['intersection'](_0x20b70d[_0x605d('0x4f')],_0x20b70d[_0x605d('0x42')]);_0x2dac76[_0x605d('0x44')]=_[_0x605d('0x53')](_0x20b70d[_0x605d('0x4f')],qs[_0x605d('0x54')](_0x5460d2[_0x605d('0x42')]['fields']));_0x2dac76[_0x605d('0x44')]=_0x2dac76['attributes'][_0x605d('0x55')]?_0x2dac76[_0x605d('0x44')]:_0x20b70d[_0x605d('0x4f')];_0x2dac76[_0x605d('0xc9')]=qs[_0x605d('0xca')](_0x5460d2[_0x605d('0x42')][_0x605d('0xca')]);_0x2dac76[_0x605d('0xcc')]=qs[_0x605d('0x52')](_[_0x605d('0xcb')](_0x5460d2[_0x605d('0x42')],_0x20b70d[_0x605d('0x52')]));if(_0x5460d2[_0x605d('0x42')]['filter']){_0x2dac76[_0x605d('0xcc')]=_[_0x605d('0xcd')](_0x2dac76[_0x605d('0xcc')],{'$or':_[_0x605d('0x32')](_0x2dac76['attributes'],function(_0x21dc7a){var _0x3042fd={};_0x3042fd[_0x21dc7a]={'$like':'%'+_0x5460d2[_0x605d('0x42')][_0x605d('0x30')]+'%'};return _0x3042fd;})});}_0x2dac76=_[_0x605d('0xcd')]({},_0x2dac76,_0x5460d2[_0x605d('0xce')]);return _0x2a8a39[_0x605d('0xe3')](_0x2dac76);}})[_0x605d('0x13')](function(_0x107382){if(_0x107382){_0x1ffa04=_0x107382[_0x605d('0x55')];if(!_0x5460d2[_0x605d('0x42')][_0x605d('0xcf')](_0x605d('0xd4'))){_0x2dac76['limit']=qs[_0x605d('0x23')](_0x5460d2[_0x605d('0x42')]['limit']);_0x2dac76['offset']=qs['offset'](_0x5460d2[_0x605d('0x42')][_0x605d('0x21')]);}return _0x2a8a39[_0x605d('0xe3')](_0x2dac76);}})[_0x605d('0x13')](function(_0x505455){if(_0x505455){return _0x505455?{'count':_0x1ffa04,'rows':_0x505455}:null;}})[_0x605d('0x13')](respondWithResult(_0x40fb6d,null))[_0x605d('0x1d')](handleError(_0x40fb6d,null));};exports[_0x605d('0xe4')]=function(_0x117f39,_0x3aec01){var _0x7ec518={};var _0x1d678d={};var _0x2f6cec;var _0x30dd82;return db['User'][_0x605d('0x95')]({'where':{'id':_0x117f39[_0x605d('0x4e')]['id']}})[_0x605d('0x13')](handleEntityNotFound(_0x3aec01,null))[_0x605d('0x13')](function(_0x19a386){if(_0x19a386){_0x2f6cec=_0x19a386;_0x1d678d[_0x605d('0x4f')]=_[_0x605d('0x51')](db[_0x605d('0xe5')][_0x605d('0x39')]);_0x1d678d[_0x605d('0x42')]=_['keys'](_0x117f39[_0x605d('0x42')]);_0x1d678d[_0x605d('0x52')]=_[_0x605d('0x53')](_0x1d678d[_0x605d('0x4f')],_0x1d678d[_0x605d('0x42')]);_0x7ec518[_0x605d('0x44')]=_[_0x605d('0x53')](_0x1d678d[_0x605d('0x4f')],qs[_0x605d('0x54')](_0x117f39[_0x605d('0x42')]['fields']));_0x7ec518[_0x605d('0x44')]=_0x7ec518[_0x605d('0x44')][_0x605d('0x55')]?_0x7ec518[_0x605d('0x44')]:_0x1d678d[_0x605d('0x4f')];_0x7ec518[_0x605d('0xc9')]=qs[_0x605d('0xca')](_0x117f39[_0x605d('0x42')][_0x605d('0xca')]);_0x7ec518['where']=qs['filters'](_[_0x605d('0xcb')](_0x117f39[_0x605d('0x42')],_0x1d678d[_0x605d('0x52')]));if(_0x117f39['query']['filter']){_0x7ec518[_0x605d('0xcc')]=_['merge'](_0x7ec518[_0x605d('0xcc')],{'$or':_[_0x605d('0x32')](_0x7ec518[_0x605d('0x44')],function(_0x3d1940){var _0x345f23={};_0x345f23[_0x3d1940]={'$like':'%'+_0x117f39[_0x605d('0x42')][_0x605d('0x30')]+'%'};return _0x345f23;})});}_0x7ec518=_[_0x605d('0xcd')]({},_0x7ec518,_0x117f39[_0x605d('0xce')]);return _0x2f6cec[_0x605d('0xe4')](_0x7ec518);}})[_0x605d('0x13')](function(_0x221ae1){if(_0x221ae1){_0x30dd82=_0x221ae1[_0x605d('0x55')];if(!_0x117f39[_0x605d('0x42')]['hasOwnProperty'](_0x605d('0xd4'))){_0x7ec518['limit']=qs[_0x605d('0x23')](_0x117f39['query'][_0x605d('0x23')]);_0x7ec518[_0x605d('0x21')]=qs[_0x605d('0x21')](_0x117f39[_0x605d('0x42')]['offset']);}return _0x2f6cec[_0x605d('0xe4')](_0x7ec518);}})[_0x605d('0x13')](function(_0x4296e8){if(_0x4296e8){return _0x4296e8?{'count':_0x30dd82,'rows':_0x4296e8}:null;}})[_0x605d('0x13')](respondWithResult(_0x3aec01,null))[_0x605d('0x1d')](handleError(_0x3aec01,null));};exports[_0x605d('0xe6')]=function(_0x29e03c,_0x5ab62a){var _0x5127b3={};var _0x275466={};var _0x5abdac;var _0x7e2bd;return db[_0x605d('0x3f')]['findOne']({'where':{'id':_0x29e03c[_0x605d('0x4e')]['id']}})[_0x605d('0x13')](handleEntityNotFound(_0x5ab62a,null))[_0x605d('0x13')](function(_0x1c5500){if(_0x1c5500){_0x5abdac=_0x1c5500;_0x275466[_0x605d('0x4f')]=_[_0x605d('0x51')](db[_0x605d('0xe7')][_0x605d('0x39')]);_0x275466['query']=_[_0x605d('0x51')](_0x29e03c['query']);_0x275466[_0x605d('0x52')]=_[_0x605d('0x53')](_0x275466[_0x605d('0x4f')],_0x275466[_0x605d('0x42')]);_0x5127b3[_0x605d('0x44')]=_[_0x605d('0x53')](_0x275466[_0x605d('0x4f')],qs[_0x605d('0x54')](_0x29e03c[_0x605d('0x42')][_0x605d('0x54')]));_0x5127b3[_0x605d('0x44')]=_0x5127b3[_0x605d('0x44')]['length']?_0x5127b3[_0x605d('0x44')]:_0x275466[_0x605d('0x4f')];_0x5127b3['order']=qs[_0x605d('0xca')](_0x29e03c['query'][_0x605d('0xca')]);_0x5127b3[_0x605d('0xcc')]=qs[_0x605d('0x52')](_[_0x605d('0xcb')](_0x29e03c[_0x605d('0x42')],_0x275466[_0x605d('0x52')]));if(_0x29e03c[_0x605d('0x42')]['filter']){_0x5127b3[_0x605d('0xcc')]=_[_0x605d('0xcd')](_0x5127b3[_0x605d('0xcc')],{'$or':_[_0x605d('0x32')](_0x5127b3[_0x605d('0x44')],function(_0x4987b3){var _0x53ddee={};_0x53ddee[_0x4987b3]={'$like':'%'+_0x29e03c[_0x605d('0x42')][_0x605d('0x30')]+'%'};return _0x53ddee;})});}_0x5127b3=_[_0x605d('0xcd')]({},_0x5127b3,_0x29e03c[_0x605d('0xce')]);return _0x5abdac[_0x605d('0xe6')](_0x5127b3);}})[_0x605d('0x13')](function(_0x464f8b){if(_0x464f8b){_0x7e2bd=_0x464f8b[_0x605d('0x55')];if(!_0x29e03c[_0x605d('0x42')]['hasOwnProperty']('nolimit')){_0x5127b3[_0x605d('0x23')]=qs[_0x605d('0x23')](_0x29e03c[_0x605d('0x42')][_0x605d('0x23')]);_0x5127b3['offset']=qs[_0x605d('0x21')](_0x29e03c[_0x605d('0x42')]['offset']);}return _0x5abdac[_0x605d('0xe6')](_0x5127b3);}})[_0x605d('0x13')](function(_0xc0d216){if(_0xc0d216){return _0xc0d216?{'count':_0x7e2bd,'rows':_0xc0d216}:null;}})['then'](respondWithResult(_0x5ab62a,null))[_0x605d('0x1d')](handleError(_0x5ab62a,null));};exports[_0x605d('0xe8')]=function(_0x368af9,_0x2f3133,_0x50c617){var _0x1b17fd;var _0x31da71;var _0x3d5a1c;var _0x2b6a39=!_['isNil'](_0x368af9[_0x605d('0x4e')]['id'])?_0x368af9[_0x605d('0x4e')]['id']:!_['isNil'](_0x368af9[_0x605d('0x2b')]['id'])?_0x368af9[_0x605d('0x2b')]['id']:null;return db[_0x605d('0x3f')][_0x605d('0x57')]({'where':{'id':_0x2b6a39,'role':{'$or':[_0x605d('0x29'),_0x605d('0x2b'),_0x605d('0x2d')]}},'attributes':['id','name',_0x605d('0xe9'),_0x605d('0xea'),_0x605d('0x28'),_0x605d('0x63'),'loginInPause']})[_0x605d('0x13')](function(_0x14a164){if(_0x14a164){if(_0x14a164[_0x605d('0x28')]==='agent'){_0x1b17fd=_0x14a164;if(_0x368af9[_0x605d('0x5e')][_0x605d('0x9c')]){_0x3d5a1c=util[_0x605d('0xa9')](_0x605d('0xeb'),_0x1b17fd[_0x368af9[_0x605d('0x5e')][_0x605d('0x9c')]]);}else if(_0x368af9[_0x605d('0x5e')][_0x605d('0xec')]){_0x3d5a1c=util[_0x605d('0xa9')]('SIP/%s',_0x368af9[_0x605d('0x5e')]['intrf']);}else{_0x3d5a1c=util['format'](_0x605d('0xaa'),_0x1b17fd[_0x605d('0x35')]);}socket['to'](util[_0x605d('0xa9')](_0x605d('0xed'),_0x1b17fd[_0x605d('0x35')]))[_0x605d('0xa4')](_0x605d('0xee'),{'user':{'id':_0x1b17fd['id'],'name':_0x1b17fd['name']},'ip':_0x368af9[_0x605d('0xef')][_0x605d('0xf0')]||_0x368af9[_0x605d('0xf1')][_0x605d('0xf2')]||_0x368af9[_0x605d('0xf3')][_0x605d('0xf2')]||_0x368af9[_0x605d('0xf1')][_0x605d('0xf3')][_0x605d('0xf2')]});return db['UserVoiceQueueRt'][_0x605d('0x27')]({'where':{'membername':_0x1b17fd[_0x605d('0x35')]},'individualHooks':!![]});}}else{throw new db[(_0x605d('0x8d'))][(_0x605d('0x8e'))](_0x605d('0xf4'));}})['then'](function(){if(_0x1b17fd){return _0x1b17fd['getVoiceQueues']({'raw':!![]});}})[_0x605d('0x13')](function(_0x106079){if(_0x1b17fd){var _0x2628b7=[];if(_0x106079){_0x31da71=_0x106079;if(_0x31da71[_0x605d('0x55')]){for(var _0x4e2f12=0x0;_0x4e2f12<_0x31da71[_0x605d('0x55')];_0x4e2f12++){_0x2628b7['push']({'membername':_0x1b17fd[_0x605d('0x35')],'UserId':_0x1b17fd['id'],'queue_name':_0x31da71[_0x4e2f12][_0x605d('0x35')],'VoiceQueueId':_0x31da71[_0x4e2f12]['id'],'interface':_0x3d5a1c,'paused':_0x1b17fd[_0x605d('0xf5')]||![],'penalty':_0x31da71[_0x4e2f12][_0x605d('0xf6')]||0x0});}return BPromise[_0x605d('0xab')](_0x2628b7,function(_0x265e96){return db[_0x605d('0xac')][_0x605d('0xf7')](_0x265e96);});}}}})[_0x605d('0x13')](function(){if(_0x1b17fd){return db[_0x605d('0xf8')]['findAll']({'where':{'membername':_0x1b17fd[_0x605d('0x35')],'exitAt':null}});}})[_0x605d('0x13')](function(_0x1e9115){if(_0x1b17fd){var _0x23c06a=[];_0x1e9115[_0x605d('0xf9')](function(_0x3a5c18){_0x23c06a[_0x605d('0x45')](_0x3a5c18[_0x605d('0x5d')]({'exitAt':moment()[_0x605d('0xa9')](_0x605d('0xfa'))}));});return BPromise['all'](_0x23c06a);}})[_0x605d('0x13')](function(){if(_0x1b17fd){var _0x3aa6e4=[];var _0x5d6e6c=[];var _0x42578e=utils['getChannels']();var _0x3f80da={'membername':_0x1b17fd['name'],'interface':_0x3d5a1c,'enterAt':moment()[_0x605d('0xa9')](_0x605d('0xfa')),'role':_0x1b17fd[_0x605d('0x28')],'internal':_0x1b17fd[_0x605d('0x63')]};_0x42578e[_0x605d('0xf9')](function(_0x402778){_0x3aa6e4[_0x605d('0x45')](_['merge']({'channel':_0x402778,'type':_0x605d('0xfb'),'data1':_0x368af9['body'][_0x605d('0xfc')],'data2':_0x3d5a1c},_0x3f80da));if(_0x1b17fd['loginInPause']){_0x5d6e6c[_0x605d('0x45')](_[_0x605d('0xcd')]({'channel':_0x402778,'type':_0x605d('0xfd'),'data1':_0x605d('0xfe')},_0x3f80da));}});return db[_0x605d('0xf8')][_0x605d('0x86')](_0x3aa6e4[_0x605d('0xc6')](_0x5d6e6c),{'individualHooks':!![]});}})['then'](function(){if(_0x1b17fd){return _0x1b17fd['update']({'online':!![],'lastLoginAt':moment()[_0x605d('0xa9')](_0x605d('0xfa')),'voicePause':_0x1b17fd[_0x605d('0xf5')]||![],'mailPause':_0x1b17fd['loginInPause']||![],'chatPause':_0x1b17fd[_0x605d('0xf5')]||![],'faxPause':_0x1b17fd[_0x605d('0xf5')]||![],'smsPause':_0x1b17fd[_0x605d('0xf5')]||![],'openchannelPause':_0x1b17fd[_0x605d('0xf5')]||![],'whatsappPause':_0x1b17fd[_0x605d('0xf5')]||![],'pauseType':_0x1b17fd[_0x605d('0xf5')]?_0x605d('0xfe'):null,'interface':_0x3d5a1c,'lastPauseAt':moment()[_0x605d('0xa9')](_0x605d('0xfa'))});}})['then'](function(_0x4a7448){if(_0x368af9[_0x605d('0xff')]){return _0x50c617();}else{return BPromise[_0x605d('0x100')](_0x4a7448)[_0x605d('0x13')](respondWithResult(_0x2f3133,null));}})[_0x605d('0x1d')](handleError(_0x2f3133,null));};exports[_0x605d('0x101')]=function(_0x3be041,_0x5474e7){var _0x3bd097;return db['User'][_0x605d('0x57')]({'where':{'id':_0x3be041[_0x605d('0x4e')]['id'],'role':_0x605d('0x2d')},'attributes':['id','name',_0x605d('0x28')]})[_0x605d('0x13')](handleEntityNotFound(_0x5474e7,null))[_0x605d('0x13')](function(_0x4a2511){if(_0x4a2511){_0x3bd097=_0x4a2511;return db[_0x605d('0xac')][_0x605d('0x27')]({'where':{'membername':_0x3bd097[_0x605d('0x35')]},'individualHooks':!![]});}})[_0x605d('0x13')](function(){return db[_0x605d('0xf8')][_0x605d('0x46')]({'where':{'membername':_0x3bd097[_0x605d('0x35')],'exitAt':null}});})[_0x605d('0x13')](function(_0x466b4c){var _0x5da461=[];_0x466b4c[_0x605d('0xf9')](function(_0x4b9a8d){_0x5da461['push'](_0x4b9a8d[_0x605d('0x5d')]({'exitAt':moment()[_0x605d('0xa9')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x605d('0x5c')](_0x5da461);})[_0x605d('0x13')](function(){return _0x3bd097['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x605d('0x13')](respondWithResult(_0x5474e7,null))[_0x605d('0x1d')](handleError(_0x5474e7,null));};exports[_0x605d('0x102')]=function(_0x42ca82,_0x189823){var _0x4119f0;return db[_0x605d('0xac')]['update']({'paused':0x1},{'where':{'UserId':_0x42ca82[_0x605d('0x4e')]['id']},'individualHooks':!![]})[_0x605d('0x13')](function(){return db['User'][_0x605d('0x57')]({'where':{'id':_0x42ca82[_0x605d('0x4e')]['id'],'role':_0x605d('0x2d')},'attributes':['id','name',_0x605d('0x28'),_0x605d('0x63'),_0x605d('0x9c')]});})[_0x605d('0x13')](handleEntityNotFound(_0x189823,null))[_0x605d('0x13')](function(_0x4d87ef){if(_0x4d87ef){_0x4119f0=_0x4d87ef;return respondWithRpcPromise(_0x605d('0x103'),_0x605d('0x102'),{'id':_0x4119f0['id'],'name':_0x4119f0['name'],'pause':!![]});}})[_0x605d('0x13')](function(){if(_0x4119f0){return db[_0x605d('0xf8')]['findAll']({'where':{'membername':_0x4119f0[_0x605d('0x35')],'type':'PAUSE','exitAt':null}});}})[_0x605d('0x13')](function(_0x2286d0){if(_0x2286d0[_0x605d('0x55')]){var _0xacc6b2=moment()[_0x605d('0xa9')](_0x605d('0xfa'));for(var _0x2db41a=0x0,_0x269b5a=_0x2286d0[_0x605d('0x55')];_0x2db41a<_0x269b5a;_0x2db41a++){_0x2286d0[_0x2db41a][_0x605d('0x104')]({'exitAt':_0xacc6b2});}}})[_0x605d('0x13')](function(){var _0x1ed52e=[];var _0x1c6374=utils[_0x605d('0x105')]();_0x1c6374[_0x605d('0xf9')](function(_0x28b84f){_0x1ed52e['push']({'channel':_0x28b84f,'membername':_0x4119f0[_0x605d('0x35')],'interface':_[_0x605d('0x67')](_0x4119f0['interface'])?util['format'](_0x605d('0xaa'),_0x4119f0[_0x605d('0x35')]):_0x4119f0[_0x605d('0x9c')],'type':'PAUSE','enterAt':moment()[_0x605d('0xa9')](_0x605d('0xfa')),'data1':_0x42ca82[_0x605d('0x5e')][_0x605d('0x3b')]||_0x605d('0x106'),'role':_0x4119f0[_0x605d('0x28')],'internal':_0x4119f0[_0x605d('0x63')]});});return db[_0x605d('0xf8')][_0x605d('0x86')](_0x1ed52e,{'individualHooks':!![]});})['then'](function(){return _0x4119f0['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x42ca82[_0x605d('0x5e')][_0x605d('0x3b')]||_0x605d('0x106'),'lastPauseAt':moment()['format'](_0x605d('0xfa'))});})['then'](respondWithResult(_0x189823,null))[_0x605d('0x1d')](handleError(_0x189823,null));};exports[_0x605d('0x107')]=function(_0x27a926,_0x5bc196){var _0x1c1a1d;return db['User']['find']({'where':{'id':_0x27a926[_0x605d('0x4e')]['id']},'attributes':['id',_0x605d('0x35'),'role',_0x605d('0x9b'),_0x605d('0x108'),_0x605d('0x109'),'faxPause','openchannelPause',_0x605d('0x10a'),'whatsapppause',_0x605d('0x10b'),_0x605d('0x10c')]})[_0x605d('0x13')](handleEntityNotFound(_0x5bc196,null))[_0x605d('0x13')](function(_0xce46f6){if(_0xce46f6){_0x1c1a1d=_0xce46f6;if(_0x27a926[_0x605d('0x5e')][_0x605d('0xb0')]&&!utils[_0x605d('0xae')](_0x27a926['body'][_0x605d('0xb0')])){throw new db[(_0x605d('0x8d'))][(_0x605d('0x8e'))](_0x605d('0x9d'));}switch(_0x27a926[_0x605d('0x5e')]['channel']){case'voice':return respondWithRpcPromise(_0x605d('0x103'),'unpause',{'id':_0x1c1a1d['id'],'name':_0x1c1a1d[_0x605d('0x35')],'pause':![]})['then'](function(){return db[_0x605d('0xac')][_0x605d('0x5d')]({'paused':0x0},{'where':{'UserId':_0x1c1a1d['id']},'individualHooks':!![]});})[_0x605d('0x13')](function(){return db[_0x605d('0xf8')]['find']({'where':{'channel':_0x27a926[_0x605d('0x5e')][_0x605d('0xb0')],'membername':_0x1c1a1d['name'],'type':_0x605d('0xfd'),'exitAt':null}});})[_0x605d('0x13')](function(_0xfe181a){if(_0xfe181a){return _0xfe181a[_0x605d('0x5d')]({'exitAt':moment()['format'](_0x605d('0xfa')),'data2':_0x605d('0x10d')},{'individualHooks':!![]});}return null;})[_0x605d('0x13')](function(){return _0x1c1a1d[_0x605d('0x5d')]({'voicePause':![]});});case _0x605d('0x5b'):case _0x605d('0x58'):case'fax':case _0x605d('0x59'):case'whatsapp':case _0x605d('0x4b'):return db[_0x605d('0xf8')]['find']({'where':{'channel':_0x27a926['body'][_0x605d('0xb0')],'membername':_0x1c1a1d[_0x605d('0x35')],'type':_0x605d('0xfd'),'exitAt':null}})[_0x605d('0x13')](function(_0x1f8c2e){if(_0x1f8c2e){return _0x1f8c2e[_0x605d('0x5d')]({'exitAt':moment()[_0x605d('0xa9')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x605d('0x10d')},{'individualHooks':!![]});}return null;})[_0x605d('0x13')](function(){var _0xaa7656={};_['set'](_0xaa7656,util[_0x605d('0xa9')]('%s%s',_0x27a926['body'][_0x605d('0xb0')],_0x605d('0x10e')),![]);return _0x1c1a1d['update'](_0xaa7656);});default:return respondWithRpcPromise(_0x605d('0x103'),_0x605d('0x107'),{'id':_0x1c1a1d['id'],'name':_0x1c1a1d['name'],'pause':![]})[_0x605d('0x13')](function(){return db[_0x605d('0xac')][_0x605d('0x5d')]({'paused':0x0},{'where':{'UserId':_0x1c1a1d['id']}});})[_0x605d('0x13')](function(){return db[_0x605d('0xf8')][_0x605d('0x46')]({'where':{'membername':_0x1c1a1d['name'],'type':'PAUSE','exitAt':null}});})[_0x605d('0x13')](function(_0x546c17){var _0x264d07=[];_0x546c17[_0x605d('0xf9')](function(_0x1379be){_0x264d07[_0x605d('0x45')](_0x1379be['update']({'exitAt':moment()[_0x605d('0xa9')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':'manual'}));});return BPromise['all'](_0x264d07);})['then'](function(){return _0x1c1a1d[_0x605d('0x5d')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x605d('0x13')](respondWithResult(_0x5bc196,null))[_0x605d('0x1d')](handleError(_0x5bc196,null));};exports[_0x605d('0x10f')]=function(_0x566bf6,_0x36403a){var _0x55cb06={};var _0x137c8b={};var _0xcfa0b3;var _0x12a504;return db[_0x605d('0x3f')][_0x605d('0x95')]({'where':{'id':_0x566bf6[_0x605d('0x4e')]['id']}})['then'](handleEntityNotFound(_0x36403a,null))['then'](function(_0x43a512){if(_0x43a512){_0xcfa0b3=_0x43a512;_0x137c8b['model']=_[_0x605d('0x51')](db['Team'][_0x605d('0x39')]);_0x137c8b[_0x605d('0x42')]=_[_0x605d('0x51')](_0x566bf6[_0x605d('0x42')]);_0x137c8b[_0x605d('0x52')]=_[_0x605d('0x53')](_0x137c8b['model'],_0x137c8b[_0x605d('0x42')]);_0x55cb06[_0x605d('0x44')]=_[_0x605d('0x53')](_0x137c8b[_0x605d('0x4f')],qs['fields'](_0x566bf6[_0x605d('0x42')][_0x605d('0x54')]));_0x55cb06[_0x605d('0x44')]=_0x55cb06['attributes'][_0x605d('0x55')]?_0x55cb06[_0x605d('0x44')]:_0x137c8b['model'];_0x55cb06[_0x605d('0xc9')]=qs[_0x605d('0xca')](_0x566bf6[_0x605d('0x42')]['sort']);_0x55cb06[_0x605d('0xcc')]=qs[_0x605d('0x52')](_[_0x605d('0xcb')](_0x566bf6['query'],_0x137c8b[_0x605d('0x52')]));if(_0x566bf6['query'][_0x605d('0x30')]){_0x55cb06['where']=_['merge'](_0x55cb06[_0x605d('0xcc')],{'$or':_['map'](_0x55cb06[_0x605d('0x44')],function(_0x5a7014){var _0x2ab053={};_0x2ab053[_0x5a7014]={'$like':'%'+_0x566bf6[_0x605d('0x42')][_0x605d('0x30')]+'%'};return _0x2ab053;})});}_0x55cb06=_[_0x605d('0xcd')]({},_0x55cb06,_0x566bf6[_0x605d('0xce')]);return _0xcfa0b3[_0x605d('0x10f')](_0x55cb06);}})[_0x605d('0x13')](function(_0x3ebb78){if(_0x3ebb78){_0x12a504=_0x3ebb78[_0x605d('0x55')];if(!_0x566bf6[_0x605d('0x42')][_0x605d('0xcf')](_0x605d('0xd4'))){_0x55cb06[_0x605d('0x23')]=qs[_0x605d('0x23')](_0x566bf6['query'][_0x605d('0x23')]);_0x55cb06['offset']=qs[_0x605d('0x21')](_0x566bf6[_0x605d('0x42')][_0x605d('0x21')]);}return _0xcfa0b3[_0x605d('0x10f')](_0x55cb06);}})['then'](function(_0x5ef3b6){if(_0x5ef3b6){return _0x5ef3b6?{'count':_0x12a504,'rows':_0x5ef3b6}:null;}})['then'](respondWithResult(_0x36403a,null))[_0x605d('0x1d')](handleError(_0x36403a,null));};exports['addTeams']=function(_0x4ff67f,_0x111ff5){return db[_0x605d('0x3f')]['find']({'where':{'id':_0x4ff67f[_0x605d('0x4e')]['id']}})[_0x605d('0x13')](handleEntityNotFound(_0x111ff5,null))['then'](function(_0x4c1431){if(_0x4c1431){var _0x2f2d0c=_0x4c1431[_0x605d('0xa7')]({'plain':!![]});return _0x4c1431[_0x605d('0x110')](_0x4ff67f[_0x605d('0x5e')][_0x605d('0x61')],_[_0x605d('0x62')](_0x4ff67f['body'],[_0x605d('0x61'),'id'])||{})[_0x605d('0x13')](function(){for(var _0x2b61d2=0x0;_0x2b61d2<_0x4ff67f[_0x605d('0x5e')][_0x605d('0x61')][_0x605d('0x55')];_0x2b61d2++){var _0x4f0c84=[];var _0x23ef77={};db[_0x605d('0x111')][_0x605d('0x95')]({'where':{'id':_0x4ff67f[_0x605d('0x5e')][_0x605d('0x61')][_0x2b61d2]}})['then'](function(_0x2fee5e){_0x23ef77=_0x2fee5e[_0x605d('0x4a')];_0x4f0c84[_0x605d('0x45')](_0x2fee5e[_0x605d('0x112')]()[_0x605d('0x13')](function(_0x246b1d){for(var _0x4ab36a=0x0;_0x4ab36a<_0x246b1d[_0x605d('0x55')];_0x4ab36a++){_0x246b1d[_0x4ab36a]['setDataValue'](_0x605d('0xb0'),_0x605d('0x113'));}return _0x246b1d;}));_0x4f0c84[_0x605d('0x45')](_0x2fee5e[_0x605d('0x114')]()[_0x605d('0x13')](function(_0x30e05a){for(var _0x16f03e=0x0;_0x16f03e<_0x30e05a[_0x605d('0x55')];_0x16f03e++){_0x30e05a[_0x16f03e][_0x605d('0x115')]('channel',_0x605d('0x116'));}return _0x30e05a;}));_0x4f0c84[_0x605d('0x45')](_0x2fee5e['getMailQueues']()[_0x605d('0x13')](function(_0x1c20fa){for(var _0x32261d=0x0;_0x32261d<_0x1c20fa[_0x605d('0x55')];_0x32261d++){_0x1c20fa[_0x32261d]['setDataValue'](_0x605d('0xb0'),'Mail');}return _0x1c20fa;}));_0x4f0c84['push'](_0x2fee5e[_0x605d('0x117')]()[_0x605d('0x13')](function(_0x3f16ef){for(var _0x4e98d7=0x0;_0x4e98d7<_0x3f16ef[_0x605d('0x55')];_0x4e98d7++){_0x3f16ef[_0x4e98d7]['setDataValue'](_0x605d('0xb0'),_0x605d('0x118'));}return _0x3f16ef;}));_0x4f0c84[_0x605d('0x45')](_0x2fee5e[_0x605d('0x119')]()[_0x605d('0x13')](function(_0x5015aa){for(var _0x703791=0x0;_0x703791<_0x5015aa[_0x605d('0x55')];_0x703791++){_0x5015aa[_0x703791][_0x605d('0x115')](_0x605d('0xb0'),_0x605d('0x11a'));}return _0x5015aa;}));_0x4f0c84['push'](_0x2fee5e[_0x605d('0x11b')]()[_0x605d('0x13')](function(_0x8e4d9d){for(var _0x22c2f2=0x0;_0x22c2f2<_0x8e4d9d[_0x605d('0x55')];_0x22c2f2++){_0x8e4d9d[_0x22c2f2][_0x605d('0x115')](_0x605d('0xb0'),_0x605d('0x11c'));}return _0x8e4d9d;}));_0x4f0c84[_0x605d('0x45')](_0x2fee5e[_0x605d('0x11d')]()[_0x605d('0x13')](function(_0xfd694f){for(var _0x36a993=0x0;_0x36a993<_0xfd694f[_0x605d('0x55')];_0x36a993++){_0xfd694f[_0x36a993][_0x605d('0x115')](_0x605d('0xb0'),_0x605d('0x11e'));}return _0xfd694f;}));return BPromise['all'](_0x4f0c84);})[_0x605d('0x13')](function(_0x403683){var _0x52c0f4=_[_0x605d('0x11f')](_0x403683);_0x4f0c84=[];return db[_0x605d('0x69')][_0x605d('0x120')](function(_0x2333cf){for(var _0x3b037b=0x0;_0x3b037b<_0x52c0f4[_0x605d('0x55')];_0x3b037b++){_0x4f0c84[_0x605d('0x45')](_0x52c0f4[_0x3b037b][_0x605d('0x121')](_0x2f2d0c['id']),{'transaction':_0x2333cf});}return BPromise[_0x605d('0x5c')](_0x4f0c84)['then'](function(){if(_0x2f2d0c['online']){return BPromise[_0x605d('0xab')](_['filter'](_0x52c0f4,function(_0x2544bb){return _0x2544bb[_0x605d('0x122')](_0x605d('0xb0'))===_0x605d('0x113');}),function(_0x28993b){return db[_0x605d('0xac')][_0x605d('0xf7')]({'membername':_0x2f2d0c[_0x605d('0x35')],'UserId':_0x2f2d0c['id'],'queue_name':_0x28993b[_0x605d('0x35')],'VoiceQueueId':_0x28993b['id'],'interface':_[_0x605d('0x67')](_0x2f2d0c[_0x605d('0x9c')])?util['format'](_0x605d('0xaa'),_0x2f2d0c[_0x605d('0x35')]):_0x2f2d0c[_0x605d('0x9c')],'paused':_0x2f2d0c[_0x605d('0x9b')]||![],'penalty':_0x2f2d0c[_0x605d('0xa2')]},{'transaction':_0x2333cf});});}else{return;}})['then'](function(){for(var _0x471fa7=0x0;_0x471fa7<_0x52c0f4[_0x605d('0x55')];_0x471fa7++){var _0x13eb3b=_0x52c0f4[_0x471fa7][_0x605d('0x122')]('channel');var _0x43a3af=_0x13eb3b+_0x605d('0xa3');socket[_0x605d('0xa4')](_0x605d('0x2b')+_0x13eb3b+_0x605d('0xa5'),{'UserId':_0x2f2d0c['id'],['queueField']:_0x52c0f4[_0x471fa7]['id']});}});});})['then'](function(){db[_0x605d('0x123')]['findOne']({'where':{'teamId':_0x23ef77['id']}})['then'](function(_0x8d996a){if(_0x8d996a){db['UserVoicePrefix']['create']({'UserId':_0x4ff67f[_0x605d('0x4e')]['id'],'VoicePrefixId':_0x8d996a['VoicePrefixId']});}});});}});}})[_0x605d('0x13')](respondWithStatusCode(_0x111ff5,null))['catch'](handleError(_0x111ff5,null));};exports[_0x605d('0x124')]=function(_0x252d61,_0x45db36){return db[_0x605d('0x3f')][_0x605d('0x95')]({'where':{'id':_0x252d61[_0x605d('0x4e')]['id']}})['then'](handleEntityNotFound(_0x45db36,null))['then'](function(_0x22c6c5){if(_0x22c6c5){var _0x124865=_0x22c6c5[_0x605d('0xa7')]({'plain':!![]});var _0x4ff17f=_0x252d61['query']['ids'];return _0x22c6c5['removeTeams'](_0x4ff17f)['then'](function(){for(var _0x2ba131=0x0;_0x2ba131<_0x4ff17f[_0x605d('0x55')];_0x2ba131++){var _0x1ee9a6=[];var _0x4ee3a2={};db[_0x605d('0x111')][_0x605d('0x95')]({'where':{'id':_0x4ff17f[_0x2ba131]}})[_0x605d('0x13')](function(_0x8b9284){_0x4ee3a2=_0x8b9284['dataValues'];_0x1ee9a6['push'](_0x8b9284['getVoiceQueues']()[_0x605d('0x13')](function(_0x231111){for(var _0xe2d513=0x0;_0xe2d513<_0x231111['length'];_0xe2d513++){_0x231111[_0xe2d513][_0x605d('0x115')](_0x605d('0xb0'),_0x605d('0x113'));}return _0x231111;}));_0x1ee9a6[_0x605d('0x45')](_0x8b9284[_0x605d('0x114')]()[_0x605d('0x13')](function(_0x4b6317){for(var _0xc6e2a5=0x0;_0xc6e2a5<_0x4b6317['length'];_0xc6e2a5++){_0x4b6317[_0xc6e2a5][_0x605d('0x115')](_0x605d('0xb0'),'Chat');}return _0x4b6317;}));_0x1ee9a6[_0x605d('0x45')](_0x8b9284[_0x605d('0x125')]()[_0x605d('0x13')](function(_0xeb10b6){for(var _0x3c82b3=0x0;_0x3c82b3<_0xeb10b6[_0x605d('0x55')];_0x3c82b3++){_0xeb10b6[_0x3c82b3][_0x605d('0x115')](_0x605d('0xb0'),_0x605d('0x126'));}return _0xeb10b6;}));_0x1ee9a6[_0x605d('0x45')](_0x8b9284[_0x605d('0x117')]()[_0x605d('0x13')](function(_0x124d71){for(var _0x562801=0x0;_0x562801<_0x124d71[_0x605d('0x55')];_0x562801++){_0x124d71[_0x562801][_0x605d('0x115')](_0x605d('0xb0'),_0x605d('0x118'));}return _0x124d71;}));_0x1ee9a6[_0x605d('0x45')](_0x8b9284[_0x605d('0x119')]()[_0x605d('0x13')](function(_0x33e111){for(var _0x19db2b=0x0;_0x19db2b<_0x33e111[_0x605d('0x55')];_0x19db2b++){_0x33e111[_0x19db2b][_0x605d('0x115')](_0x605d('0xb0'),_0x605d('0x11a'));}return _0x33e111;}));_0x1ee9a6[_0x605d('0x45')](_0x8b9284[_0x605d('0x11b')]()['then'](function(_0x3b427f){for(var _0x44e285=0x0;_0x44e285<_0x3b427f['length'];_0x44e285++){_0x3b427f[_0x44e285][_0x605d('0x115')](_0x605d('0xb0'),_0x605d('0x11c'));}return _0x3b427f;}));_0x1ee9a6['push'](_0x8b9284[_0x605d('0x11d')]()['then'](function(_0xff1bb5){for(var _0x2b9691=0x0;_0x2b9691<_0xff1bb5[_0x605d('0x55')];_0x2b9691++){_0xff1bb5[_0x2b9691][_0x605d('0x115')](_0x605d('0xb0'),_0x605d('0x11e'));}return _0xff1bb5;}));return BPromise[_0x605d('0x5c')](_0x1ee9a6);})[_0x605d('0x13')](function(_0x5a299e){var _0x273406=_[_0x605d('0x11f')](_0x5a299e);_0x1ee9a6=[];return db[_0x605d('0x69')][_0x605d('0x120')](function(_0x3e1ca4){for(var _0x75ef00=0x0;_0x75ef00<_0x273406[_0x605d('0x55')];_0x75ef00++){_0x1ee9a6[_0x605d('0x45')](_0x273406[_0x75ef00][_0x605d('0x127')](_0x124865['id']),{'transaction':_0x3e1ca4});}return BPromise[_0x605d('0x5c')](_0x1ee9a6)[_0x605d('0x13')](function(){if(_0x124865[_0x605d('0x9a')]){return BPromise[_0x605d('0xab')](_['filter'](_0x273406,function(_0x3ec185){return _0x3ec185[_0x605d('0x122')](_0x605d('0xb0'))===_0x605d('0x113');}),function(_0x3bbfec){return db[_0x605d('0xac')][_0x605d('0x27')]({'where':{'VoiceQueueId':_0x3bbfec['id'],'UserId':_0x124865['id']},'transaction':_0x3e1ca4});});}else{return;}})[_0x605d('0x13')](function(){db[_0x605d('0x123')]['findOne']({'where':{'teamId':_0x4ee3a2['id']}})[_0x605d('0x13')](function(_0x566002){if(_0x566002){return db[_0x605d('0x128')][_0x605d('0x27')]({'where':{'UserId':_0x124865['id'],'VoicePrefixId':_0x566002[_0x605d('0x4a')][_0x605d('0x129')]}});}});})[_0x605d('0x13')](function(){for(var _0x3f476a=0x0;_0x3f476a<_0x273406[_0x605d('0x55')];_0x3f476a++){var _0xe00457=_0x273406[_0x3f476a]['getDataValue'](_0x605d('0xb0'));var _0x444593=_0xe00457+_0x605d('0xa3');socket[_0x605d('0xa4')]('user'+_0xe00457+_0x605d('0xb2'),{'UserId':_0x124865['id'],['queueField']:_0x273406[_0x3f476a]['id']});}});});});}});}})[_0x605d('0x13')](respondWithStatusCode(_0x45db36,null))[_0x605d('0x1d')](handleError(_0x45db36,null));};exports[_0x605d('0x12a')]=function(_0x541bbb,_0x5903a3){var _0x394198={};var _0x58850f={};var _0x1f18a6;var _0x3c8f76;return db[_0x605d('0x3f')]['findOne']({'where':{'id':_0x541bbb[_0x605d('0x4e')]['id']}})[_0x605d('0x13')](handleEntityNotFound(_0x5903a3,null))['then'](function(_0x3631e7){if(_0x3631e7){_0x1f18a6=_0x3631e7;_0x58850f['model']=_[_0x605d('0x51')](db['CmList'][_0x605d('0x39')]);_0x58850f[_0x605d('0x42')]=_['keys'](_0x541bbb['query']);_0x58850f[_0x605d('0x52')]=_[_0x605d('0x53')](_0x58850f[_0x605d('0x4f')],_0x58850f[_0x605d('0x42')]);_0x394198[_0x605d('0x44')]=_[_0x605d('0x53')](_0x58850f['model'],qs['fields'](_0x541bbb[_0x605d('0x42')][_0x605d('0x54')]));_0x394198[_0x605d('0x44')]=_0x394198['attributes']['length']?_0x394198[_0x605d('0x44')]:_0x58850f[_0x605d('0x4f')];_0x394198['order']=qs[_0x605d('0xca')](_0x541bbb['query'][_0x605d('0xca')]);_0x394198['where']=qs[_0x605d('0x52')](_[_0x605d('0xcb')](_0x541bbb[_0x605d('0x42')],_0x58850f['filters']));if(_0x541bbb[_0x605d('0x42')]['filter']){_0x394198[_0x605d('0xcc')]=_[_0x605d('0xcd')](_0x394198['where'],{'$or':_[_0x605d('0x32')](_0x394198[_0x605d('0x44')],function(_0x3d49b7){var _0x6ab9df={};_0x6ab9df[_0x3d49b7]={'$like':'%'+_0x541bbb['query'][_0x605d('0x30')]+'%'};return _0x6ab9df;})});}_0x394198=_[_0x605d('0xcd')]({},_0x394198,_0x541bbb[_0x605d('0xce')]);return _0x1f18a6['getLists'](_0x394198);}})[_0x605d('0x13')](function(_0xa4c4bd){if(_0xa4c4bd){_0x3c8f76=_0xa4c4bd[_0x605d('0x55')];if(!_0x541bbb['query'][_0x605d('0xcf')]('nolimit')){_0x394198[_0x605d('0x23')]=qs[_0x605d('0x23')](_0x541bbb['query'][_0x605d('0x23')]);_0x394198[_0x605d('0x21')]=qs[_0x605d('0x21')](_0x541bbb[_0x605d('0x42')]['offset']);}return _0x1f18a6['getLists'](_0x394198);}})[_0x605d('0x13')](function(_0x46b312){if(_0x46b312){return _0x46b312?{'count':_0x3c8f76,'rows':_0x46b312}:null;}})[_0x605d('0x13')](respondWithResult(_0x5903a3,null))[_0x605d('0x1d')](handleError(_0x5903a3,null));};exports[_0x605d('0x12b')]=function(_0x4ea491,_0x46999e){var _0x2fa50f={};var _0x540810={};var _0x13f0cc;return db[_0x605d('0x3f')][_0x605d('0x95')]({'where':{'id':_0x4ea491['params']['id']}})[_0x605d('0x13')](handleEntityNotFound(_0x46999e,null))['then'](function(_0x2dd331){if(_0x2dd331){_0x13f0cc=_0x2dd331;_0x540810[_0x605d('0x4f')]=_['keys'](db[_0x605d('0x3f')][_0x605d('0x39')]);_0x540810[_0x605d('0x42')]=_[_0x605d('0x51')](_0x4ea491['query']);_0x540810['filters']=_['intersection'](_0x540810['model'],_0x540810[_0x605d('0x42')]);_0x2fa50f['attributes']=_[_0x605d('0x53')](_0x540810['model'],qs[_0x605d('0x54')](_0x4ea491[_0x605d('0x42')][_0x605d('0x54')]));_0x2fa50f[_0x605d('0x44')]=_0x2fa50f[_0x605d('0x44')][_0x605d('0x55')]?_0x2fa50f['attributes']:_0x540810[_0x605d('0x4f')];_0x2fa50f[_0x605d('0xc9')]=qs[_0x605d('0xca')](_0x4ea491['query'][_0x605d('0xca')]);_0x2fa50f['where']=qs[_0x605d('0x52')](_[_0x605d('0xcb')](_0x4ea491[_0x605d('0x42')],_0x540810[_0x605d('0x52')]));if(_0x4ea491[_0x605d('0x42')][_0x605d('0x30')]){_0x2fa50f[_0x605d('0xcc')]=_[_0x605d('0xcd')](_0x2fa50f['where'],{'$or':_[_0x605d('0x32')](_0x2fa50f[_0x605d('0x44')],function(_0xd2be4e){var _0x22e802={};_0x22e802[_0xd2be4e]={'$like':'%'+_0x4ea491[_0x605d('0x42')]['filter']+'%'};return _0x22e802;})});}_0x2fa50f[_0x605d('0x4f')]=db['User'];_0x2fa50f['as']=_0x605d('0x2c');_0x2fa50f=_[_0x605d('0xcd')]({},_0x2fa50f,_0x4ea491[_0x605d('0xce')]);return _0x13f0cc['getVoiceQueues']({'include':[_0x2fa50f]});}})[_0x605d('0x13')](function(_0x296472){if(_0x296472){var _0x2d60f5={},_0x4af33f=[];for(var _0x1d1058=0x0;_0x1d1058<_0x296472[_0x605d('0x55')];_0x1d1058+=0x1){for(var _0x329288=0x0,_0x59a7b0;_0x329288<_0x296472[_0x1d1058][_0x605d('0x2c')]['length'];_0x329288+=0x1){_0x59a7b0=_0x296472[_0x1d1058][_0x605d('0x2c')][_0x329288][_0x605d('0xa7')]({'plain':!![]});_0x2d60f5[_0x59a7b0['id']]=_0x59a7b0;}}_0x2d60f5=_[_0x605d('0x12c')](_0x2d60f5);for(var _0x3e3147=qs[_0x605d('0x21')](_0x4ea491[_0x605d('0x42')]['offset']);_0x3e3147<_0x2d60f5['length']&&_0x4af33f[_0x605d('0x55')]<qs[_0x605d('0x23')](_0x4ea491[_0x605d('0x42')]['limit']);_0x3e3147+=0x1){if(_0x2d60f5[_0x3e3147]){_0x4af33f[_0x605d('0x45')](_0x2d60f5[_0x3e3147]);}}return{'count':_0x2d60f5[_0x605d('0x55')],'rows':_0x4af33f};}})['then'](respondWithResult(_0x46999e,null))[_0x605d('0x1d')](handleError(_0x46999e,null));};exports['destroy']=function(_0x4ce7a3,_0x485f32){if(_0x4ce7a3['user']['id']==_0x4ce7a3[_0x605d('0x4e')]['id']){return _0x485f32[_0x605d('0x1f')](0x1f4)[_0x605d('0x12d')]({'message':_0x605d('0x12e')});}return db[_0x605d('0x3f')][_0x605d('0x57')]({'where':{'id':_0x4ce7a3['params']['id']}})['then'](handleEntityNotFound(_0x485f32,null))[_0x605d('0x13')](removeEntity(_0x485f32,null))[_0x605d('0x1d')](handleError(_0x485f32,null));};exports['addChatInteractions']=function(_0x4fc913,_0x4f03ea){return db[_0x605d('0x3f')]['find']({'where':{'id':_0x4fc913[_0x605d('0x4e')]['id']}})[_0x605d('0x13')](handleEntityNotFound(_0x4f03ea,null))['then'](function(_0x57cfda){if(_0x57cfda){return _0x57cfda[_0x605d('0x12f')](_0x4fc913['body']['ids'],_[_0x605d('0x62')](_0x4fc913[_0x605d('0x5e')],[_0x605d('0x61'),'id'])||{})[_0x605d('0x130')](function(){for(var _0x1bb8f3=0x0;_0x1bb8f3<_0x4fc913[_0x605d('0x5e')]['ids'][_0x605d('0x55')];_0x1bb8f3+=0x1){socket[_0x605d('0xa4')](_0x605d('0x131'),{'ChatInteractionId':Number(_0x4fc913[_0x605d('0x5e')][_0x605d('0x61')][_0x1bb8f3]),'UserId':Number(_0x4fc913[_0x605d('0x4e')]['id'])});}return _0x4fc913[_0x605d('0x5e')][_0x605d('0x61')];});}})[_0x605d('0x13')](respondWithResult(_0x4f03ea,null))[_0x605d('0x1d')](handleError(_0x4f03ea,null));};exports[_0x605d('0x132')]=function(_0x4ad2fa,_0x355520){return db[_0x605d('0x3f')][_0x605d('0x57')]({'where':{'id':_0x4ad2fa[_0x605d('0x4e')]['id']}})[_0x605d('0x13')](handleEntityNotFound(_0x355520,null))[_0x605d('0x13')](function(_0x350275){if(_0x350275){return _0x350275['removeChatInteractions'](_0x4ad2fa[_0x605d('0x42')][_0x605d('0x61')])['then'](function(){if(_[_0x605d('0xb1')](_0x4ad2fa['query']['ids'])){for(var _0x187817=0x0;_0x187817<_0x4ad2fa[_0x605d('0x42')][_0x605d('0x61')]['length'];_0x187817+=0x1){socket[_0x605d('0xa4')](_0x605d('0x133'),{'ChatInteractionId':Number(_0x4ad2fa[_0x605d('0x42')]['ids'][_0x187817]),'UserId':Number(_0x4ad2fa[_0x605d('0x4e')]['id'])});}}else{socket[_0x605d('0xa4')](_0x605d('0x133'),{'ChatInteractionId':Number(_0x4ad2fa[_0x605d('0x42')]['ids']),'UserId':Number(_0x4ad2fa[_0x605d('0x4e')]['id'])});}});}})['then'](respondWithStatusCode(_0x355520,null))[_0x605d('0x1d')](handleError(_0x355520,null));};exports[_0x605d('0x134')]=function(_0x2c2141,_0x45bedc){return db[_0x605d('0x3f')]['find']({'where':{'id':_0x2c2141[_0x605d('0x4e')]['id']}})[_0x605d('0x13')](handleEntityNotFound(_0x45bedc,null))[_0x605d('0x13')](function(_0x451d7a){if(_0x451d7a){return _0x451d7a['addMailInteractions'](_0x2c2141[_0x605d('0x5e')]['ids'],_[_0x605d('0x62')](_0x2c2141['body'],['ids','id'])||{})['spread'](function(){for(var _0x527946=0x0;_0x527946<_0x2c2141['body']['ids'][_0x605d('0x55')];_0x527946+=0x1){socket[_0x605d('0xa4')]('user_has_mail_interactions:save',{'MailInteractionId':Number(_0x2c2141[_0x605d('0x5e')][_0x605d('0x61')][_0x527946]),'UserId':Number(_0x2c2141['params']['id'])});}return _0x2c2141[_0x605d('0x5e')][_0x605d('0x61')];});}})[_0x605d('0x13')](respondWithResult(_0x45bedc,null))[_0x605d('0x1d')](handleError(_0x45bedc,null));};exports['removeMailInteractions']=function(_0x9742f3,_0x4484fe){return db[_0x605d('0x3f')][_0x605d('0x57')]({'where':{'id':_0x9742f3['params']['id']}})[_0x605d('0x13')](handleEntityNotFound(_0x4484fe,null))[_0x605d('0x13')](function(_0x5e6925){if(_0x5e6925){return _0x5e6925['removeMailInteractions'](_0x9742f3[_0x605d('0x42')][_0x605d('0x61')])[_0x605d('0x13')](function(){if(_[_0x605d('0xb1')](_0x9742f3[_0x605d('0x42')][_0x605d('0x61')])){for(var _0x2cadc3=0x0;_0x2cadc3<_0x9742f3[_0x605d('0x42')][_0x605d('0x61')][_0x605d('0x55')];_0x2cadc3+=0x1){socket['emit'](_0x605d('0x135'),{'MailInteractionId':Number(_0x9742f3[_0x605d('0x42')]['ids'][_0x2cadc3]),'UserId':Number(_0x9742f3[_0x605d('0x4e')]['id'])});}}else{socket[_0x605d('0xa4')](_0x605d('0x135'),{'MailInteractionId':Number(_0x9742f3[_0x605d('0x42')]['ids']),'UserId':Number(_0x9742f3[_0x605d('0x4e')]['id'])});}});}})[_0x605d('0x13')](respondWithStatusCode(_0x4484fe,null))[_0x605d('0x1d')](handleError(_0x4484fe,null));};exports[_0x605d('0x136')]=function(_0x2b88e3,_0x5633ea){return db[_0x605d('0x3f')][_0x605d('0x57')]({'where':{'id':_0x2b88e3['params']['id']}})[_0x605d('0x13')](handleEntityNotFound(_0x5633ea,null))['then'](function(_0x45c636){if(_0x45c636){return _0x45c636[_0x605d('0x136')](_0x2b88e3[_0x605d('0x5e')][_0x605d('0x61')],_[_0x605d('0x62')](_0x2b88e3[_0x605d('0x5e')],[_0x605d('0x61'),'id'])||{})[_0x605d('0x130')](function(){for(var _0x5606ee=0x0;_0x5606ee<_0x2b88e3[_0x605d('0x5e')]['ids'][_0x605d('0x55')];_0x5606ee+=0x1){socket['emit'](_0x605d('0x137'),{'FaxInteractionId':Number(_0x2b88e3[_0x605d('0x5e')][_0x605d('0x61')][_0x5606ee]),'UserId':Number(_0x2b88e3['params']['id'])});}return _0x2b88e3[_0x605d('0x5e')]['ids'];});}})[_0x605d('0x13')](respondWithResult(_0x5633ea,null))[_0x605d('0x1d')](handleError(_0x5633ea,null));};exports[_0x605d('0x138')]=function(_0x2fb57d,_0x5c0a19){return db['User'][_0x605d('0x57')]({'where':{'id':_0x2fb57d[_0x605d('0x4e')]['id']}})[_0x605d('0x13')](handleEntityNotFound(_0x5c0a19,null))[_0x605d('0x13')](function(_0x5ce350){if(_0x5ce350){return _0x5ce350[_0x605d('0x138')](_0x2fb57d[_0x605d('0x42')]['ids'])[_0x605d('0x13')](function(){if(_['isArray'](_0x2fb57d[_0x605d('0x42')][_0x605d('0x61')])){for(var _0x1de3f5=0x0;_0x1de3f5<_0x2fb57d['query']['ids'][_0x605d('0x55')];_0x1de3f5+=0x1){socket[_0x605d('0xa4')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x2fb57d['query']['ids'][_0x1de3f5]),'UserId':Number(_0x2fb57d['params']['id'])});}}else{socket[_0x605d('0xa4')](_0x605d('0x139'),{'FaxInteractionId':Number(_0x2fb57d[_0x605d('0x42')][_0x605d('0x61')]),'UserId':Number(_0x2fb57d[_0x605d('0x4e')]['id'])});}});}})[_0x605d('0x13')](respondWithStatusCode(_0x5c0a19,null))[_0x605d('0x1d')](handleError(_0x5c0a19,null));};exports['addSmsInteractions']=function(_0x5aa4e9,_0x47c560){return db[_0x605d('0x3f')][_0x605d('0x57')]({'where':{'id':_0x5aa4e9['params']['id']}})['then'](handleEntityNotFound(_0x47c560,null))[_0x605d('0x13')](function(_0x5825e5){if(_0x5825e5){return _0x5825e5[_0x605d('0x13a')](_0x5aa4e9[_0x605d('0x5e')][_0x605d('0x61')],_[_0x605d('0x62')](_0x5aa4e9['body'],[_0x605d('0x61'),'id'])||{})[_0x605d('0x130')](function(){for(var _0x4bd34a=0x0;_0x4bd34a<_0x5aa4e9[_0x605d('0x5e')]['ids'][_0x605d('0x55')];_0x4bd34a+=0x1){socket[_0x605d('0xa4')](_0x605d('0x13b'),{'SmsInteractionId':Number(_0x5aa4e9[_0x605d('0x5e')][_0x605d('0x61')][_0x4bd34a]),'UserId':Number(_0x5aa4e9['params']['id'])});}return _0x5aa4e9[_0x605d('0x5e')][_0x605d('0x61')];});}})[_0x605d('0x13')](respondWithResult(_0x47c560,null))['catch'](handleError(_0x47c560,null));};exports[_0x605d('0x13c')]=function(_0x512945,_0x33b552){return db[_0x605d('0x3f')][_0x605d('0x57')]({'where':{'id':_0x512945[_0x605d('0x4e')]['id']}})[_0x605d('0x13')](handleEntityNotFound(_0x33b552,null))['then'](function(_0x3be866){if(_0x3be866){return _0x3be866[_0x605d('0x13c')](_0x512945['query'][_0x605d('0x61')])['then'](function(){if(_[_0x605d('0xb1')](_0x512945[_0x605d('0x42')][_0x605d('0x61')])){for(var _0x7409ef=0x0;_0x7409ef<_0x512945['query'][_0x605d('0x61')][_0x605d('0x55')];_0x7409ef+=0x1){socket[_0x605d('0xa4')](_0x605d('0x13d'),{'SmsInteractionId':Number(_0x512945[_0x605d('0x42')]['ids'][_0x7409ef]),'UserId':Number(_0x512945[_0x605d('0x4e')]['id'])});}}else{socket[_0x605d('0xa4')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x512945[_0x605d('0x42')][_0x605d('0x61')]),'UserId':Number(_0x512945[_0x605d('0x4e')]['id'])});}});}})[_0x605d('0x13')](respondWithStatusCode(_0x33b552,null))[_0x605d('0x1d')](handleError(_0x33b552,null));};exports['addOpenchannelInteractions']=function(_0x4ad337,_0x1a413f){return db['User'][_0x605d('0x57')]({'where':{'id':_0x4ad337[_0x605d('0x4e')]['id']}})[_0x605d('0x13')](handleEntityNotFound(_0x1a413f,null))['then'](function(_0xa89114){if(_0xa89114){return _0xa89114['addOpenchannelInteractions'](_0x4ad337['body'][_0x605d('0x61')],_[_0x605d('0x62')](_0x4ad337['body'],[_0x605d('0x61'),'id'])||{})[_0x605d('0x130')](function(){for(var _0x34995d=0x0;_0x34995d<_0x4ad337['body'][_0x605d('0x61')][_0x605d('0x55')];_0x34995d+=0x1){socket['emit'](_0x605d('0x13e'),{'OpenchannelInteractionId':Number(_0x4ad337[_0x605d('0x5e')][_0x605d('0x61')][_0x34995d]),'UserId':Number(_0x4ad337[_0x605d('0x4e')]['id'])});}return _0x4ad337[_0x605d('0x5e')]['ids'];});}})['then'](respondWithResult(_0x1a413f,null))[_0x605d('0x1d')](handleError(_0x1a413f,null));};exports['removeOpenchannelInteractions']=function(_0xa3314c,_0x4ad6e7){return db[_0x605d('0x3f')][_0x605d('0x57')]({'where':{'id':_0xa3314c['params']['id']}})[_0x605d('0x13')](handleEntityNotFound(_0x4ad6e7,null))[_0x605d('0x13')](function(_0x12fb0a){if(_0x12fb0a){return _0x12fb0a['removeOpenchannelInteractions'](_0xa3314c['query']['ids'])['then'](function(){if(_[_0x605d('0xb1')](_0xa3314c[_0x605d('0x42')][_0x605d('0x61')])){for(var _0x36cdb9=0x0;_0x36cdb9<_0xa3314c[_0x605d('0x42')]['ids'][_0x605d('0x55')];_0x36cdb9+=0x1){socket[_0x605d('0xa4')](_0x605d('0x13f'),{'OpenchannelInteractionId':Number(_0xa3314c[_0x605d('0x42')]['ids'][_0x36cdb9]),'UserId':Number(_0xa3314c[_0x605d('0x4e')]['id'])});}}else{socket['emit']('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0xa3314c[_0x605d('0x42')][_0x605d('0x61')]),'UserId':Number(_0xa3314c[_0x605d('0x4e')]['id'])});}});}})['then'](respondWithStatusCode(_0x4ad6e7,null))[_0x605d('0x1d')](handleError(_0x4ad6e7,null));};exports[_0x605d('0x140')]=function(_0x187075,_0x482441){return db['User']['find']({'where':{'id':_0x187075[_0x605d('0x4e')]['id']}})['then'](handleEntityNotFound(_0x482441,null))[_0x605d('0x13')](function(_0x338d50){if(_0x338d50){return _0x338d50[_0x605d('0x140')](_0x187075[_0x605d('0x5e')][_0x605d('0x61')],_['omit'](_0x187075[_0x605d('0x5e')],[_0x605d('0x61'),'id'])||{})[_0x605d('0x130')](function(){for(var _0x4f80b1=0x0;_0x4f80b1<_0x187075[_0x605d('0x5e')][_0x605d('0x61')][_0x605d('0x55')];_0x4f80b1+=0x1){socket[_0x605d('0xa4')](_0x605d('0x141'),{'WhatsappInteractionId':Number(_0x187075[_0x605d('0x5e')][_0x605d('0x61')][_0x4f80b1]),'UserId':Number(_0x187075['params']['id'])});}return _0x187075['body'][_0x605d('0x61')];});}})[_0x605d('0x13')](respondWithResult(_0x482441,null))[_0x605d('0x1d')](handleError(_0x482441,null));};exports[_0x605d('0x142')]=function(_0x528331,_0x113fe1){return db['User'][_0x605d('0x57')]({'where':{'id':_0x528331[_0x605d('0x4e')]['id']}})[_0x605d('0x13')](handleEntityNotFound(_0x113fe1,null))[_0x605d('0x13')](function(_0x46aad1){if(_0x46aad1){return _0x46aad1[_0x605d('0x142')](_0x528331[_0x605d('0x42')][_0x605d('0x61')]);}})[_0x605d('0x13')](respondWithStatusCode(_0x113fe1,null))['catch'](handleError(_0x113fe1,null));};exports[_0x605d('0x143')]=function(_0x5b3c64,_0x27a9b6){var _0x2aa8b6={};var _0x16d1ac={};var _0x3d9fe6;var _0x57c16b;return db['User'][_0x605d('0x95')]({'where':{'id':_0x5b3c64[_0x605d('0x4e')]['id']}})[_0x605d('0x13')](handleEntityNotFound(_0x27a9b6,null))[_0x605d('0x13')](function(_0x39bd44){if(_0x39bd44){_0x3d9fe6=_0x39bd44;_0x16d1ac[_0x605d('0x4f')]=_['keys'](db[_0x605d('0x144')][_0x605d('0x39')]);_0x16d1ac['query']=_[_0x605d('0x51')](_0x5b3c64[_0x605d('0x42')]);_0x16d1ac[_0x605d('0x52')]=_['intersection'](_0x16d1ac[_0x605d('0x4f')],_0x16d1ac[_0x605d('0x42')]);_0x2aa8b6[_0x605d('0x44')]=_['intersection'](_0x16d1ac[_0x605d('0x4f')],qs[_0x605d('0x54')](_0x5b3c64[_0x605d('0x42')][_0x605d('0x54')]));_0x2aa8b6[_0x605d('0x44')]=_0x2aa8b6[_0x605d('0x44')]['length']?_0x2aa8b6['attributes']:_0x16d1ac[_0x605d('0x4f')];_0x2aa8b6[_0x605d('0xc9')]=qs[_0x605d('0xca')](_0x5b3c64[_0x605d('0x42')][_0x605d('0xca')]);_0x2aa8b6[_0x605d('0xcc')]=qs[_0x605d('0x52')](_['pick'](_0x5b3c64[_0x605d('0x42')],_0x16d1ac[_0x605d('0x52')]));if(_0x5b3c64['query'][_0x605d('0x30')]){_0x2aa8b6[_0x605d('0xcc')]=_[_0x605d('0xcd')](_0x2aa8b6[_0x605d('0xcc')],{'$or':_[_0x605d('0x32')](_0x2aa8b6['attributes'],function(_0xa8a1a7){var _0x26eec2={};_0x26eec2[_0xa8a1a7]={'$like':'%'+_0x5b3c64[_0x605d('0x42')][_0x605d('0x30')]+'%'};return _0x26eec2;})});}_0x2aa8b6=_[_0x605d('0xcd')]({},_0x2aa8b6,_0x5b3c64[_0x605d('0xce')]);return _0x3d9fe6[_0x605d('0x143')](_0x2aa8b6);}})[_0x605d('0x13')](function(_0x2d33f3){if(_0x2d33f3){_0x57c16b=_0x2d33f3['length'];if(!_0x5b3c64['query'][_0x605d('0xcf')]('nolimit')){_0x2aa8b6['limit']=qs[_0x605d('0x23')](_0x5b3c64['query']['limit']);_0x2aa8b6[_0x605d('0x21')]=qs[_0x605d('0x21')](_0x5b3c64[_0x605d('0x42')][_0x605d('0x21')]);}return _0x3d9fe6[_0x605d('0x143')](_0x2aa8b6);}})[_0x605d('0x13')](function(_0x2b9a19){if(_0x2b9a19){return _0x2b9a19?{'count':_0x57c16b,'rows':_0x2b9a19}:null;}})[_0x605d('0x13')](respondWithResult(_0x27a9b6,null))[_0x605d('0x1d')](handleError(_0x27a9b6,null));};exports[_0x605d('0x145')]=function(_0x20a8fe,_0x5a6b32){var _0x38b3eb={};var _0x4adc4e={};var _0x1b7255;var _0x1ba323;return db['User'][_0x605d('0x95')]({'where':{'id':_0x20a8fe[_0x605d('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5a6b32,null))[_0x605d('0x13')](function(_0x10a76c){if(_0x10a76c){_0x1b7255=_0x10a76c;_0x4adc4e[_0x605d('0x4f')]=_[_0x605d('0x51')](db[_0x605d('0x146')][_0x605d('0x39')]);_0x4adc4e[_0x605d('0x42')]=_[_0x605d('0x51')](_0x20a8fe[_0x605d('0x42')]);_0x4adc4e[_0x605d('0x52')]=_[_0x605d('0x53')](_0x4adc4e[_0x605d('0x4f')],_0x4adc4e[_0x605d('0x42')]);_0x38b3eb['attributes']=_[_0x605d('0x53')](_0x4adc4e[_0x605d('0x4f')],qs[_0x605d('0x54')](_0x20a8fe[_0x605d('0x42')][_0x605d('0x54')]));_0x38b3eb[_0x605d('0x44')]=_0x38b3eb[_0x605d('0x44')][_0x605d('0x55')]?_0x38b3eb[_0x605d('0x44')]:_0x4adc4e['model'];_0x38b3eb['order']=qs[_0x605d('0xca')](_0x20a8fe[_0x605d('0x42')][_0x605d('0xca')]);_0x38b3eb[_0x605d('0xcc')]=qs[_0x605d('0x52')](_[_0x605d('0xcb')](_0x20a8fe[_0x605d('0x42')],_0x4adc4e['filters']));if(_0x20a8fe['query']['filter']){_0x38b3eb['where']=_[_0x605d('0xcd')](_0x38b3eb['where'],{'$or':_['map'](_0x38b3eb[_0x605d('0x44')],function(_0x1ef101){var _0x129e8c={};_0x129e8c[_0x1ef101]={'$like':'%'+_0x20a8fe[_0x605d('0x42')][_0x605d('0x30')]+'%'};return _0x129e8c;})});}_0x38b3eb=_[_0x605d('0xcd')]({},_0x38b3eb,_0x20a8fe[_0x605d('0xce')]);return _0x1b7255['getFaxAccounts'](_0x38b3eb);}})[_0x605d('0x13')](function(_0xe2e58a){if(_0xe2e58a){_0x1ba323=_0xe2e58a[_0x605d('0x55')];if(!_0x20a8fe[_0x605d('0x42')][_0x605d('0xcf')](_0x605d('0xd4'))){_0x38b3eb[_0x605d('0x23')]=qs[_0x605d('0x23')](_0x20a8fe['query']['limit']);_0x38b3eb['offset']=qs[_0x605d('0x21')](_0x20a8fe['query'][_0x605d('0x21')]);}return _0x1b7255[_0x605d('0x145')](_0x38b3eb);}})[_0x605d('0x13')](function(_0x5e7fa3){if(_0x5e7fa3){return _0x5e7fa3?{'count':_0x1ba323,'rows':_0x5e7fa3}:null;}})[_0x605d('0x13')](respondWithResult(_0x5a6b32,null))['catch'](handleError(_0x5a6b32,null));};exports[_0x605d('0x147')]=function(_0x3014e6,_0x2b5ff8){return db[_0x605d('0x3f')]['find']({'where':{'id':_0x3014e6['params']['id']}})['then'](handleEntityNotFound(_0x2b5ff8,null))['then'](function(_0x30d163){if(_0x30d163){return _0x30d163[_0x605d('0x147')](_0x3014e6[_0x605d('0x5e')][_0x605d('0x61')],_[_0x605d('0x62')](_0x3014e6[_0x605d('0x5e')],[_0x605d('0x61'),'id'])||{});}})[_0x605d('0x13')](respondWithResult(_0x2b5ff8,null))[_0x605d('0x1d')](handleError(_0x2b5ff8,null));};exports['removeFaxAccounts']=function(_0x1a9f12,_0x59aa47){return db[_0x605d('0x3f')][_0x605d('0x57')]({'where':{'id':_0x1a9f12[_0x605d('0x4e')]['id']}})[_0x605d('0x13')](handleEntityNotFound(_0x59aa47,null))[_0x605d('0x13')](function(_0x7e5d25){if(_0x7e5d25){return _0x7e5d25['removeFaxAccounts'](_0x1a9f12[_0x605d('0x42')][_0x605d('0x61')]);}})[_0x605d('0x13')](respondWithStatusCode(_0x59aa47,null))[_0x605d('0x1d')](handleError(_0x59aa47,null));};exports[_0x605d('0x148')]=function(_0x29130d,_0x2a1925){var _0x474cfc={};var _0x22c925={};var _0x4fd4f1;var _0x5e1469;return db[_0x605d('0x3f')]['findOne']({'where':{'id':_0x29130d[_0x605d('0x4e')]['id']}})[_0x605d('0x13')](handleEntityNotFound(_0x2a1925,null))[_0x605d('0x13')](function(_0x2c1073){if(_0x2c1073){_0x4fd4f1=_0x2c1073;_0x22c925[_0x605d('0x4f')]=_[_0x605d('0x51')](db['MailAccount'][_0x605d('0x39')]);_0x22c925[_0x605d('0x42')]=_['keys'](_0x29130d[_0x605d('0x42')]);_0x22c925[_0x605d('0x52')]=_['intersection'](_0x22c925['model'],_0x22c925[_0x605d('0x42')]);_0x474cfc['attributes']=_['intersection'](_0x22c925[_0x605d('0x4f')],qs[_0x605d('0x54')](_0x29130d[_0x605d('0x42')][_0x605d('0x54')]));_0x474cfc[_0x605d('0x44')]=_0x474cfc[_0x605d('0x44')][_0x605d('0x55')]?_0x474cfc[_0x605d('0x44')]:_0x22c925['model'];_0x474cfc[_0x605d('0xc9')]=qs[_0x605d('0xca')](_0x29130d[_0x605d('0x42')]['sort']);_0x474cfc['where']=qs[_0x605d('0x52')](_[_0x605d('0xcb')](_0x29130d[_0x605d('0x42')],_0x22c925['filters']));if(_0x29130d[_0x605d('0x42')][_0x605d('0x30')]){_0x474cfc[_0x605d('0xcc')]=_[_0x605d('0xcd')](_0x474cfc['where'],{'$or':_['map'](_0x474cfc[_0x605d('0x44')],function(_0x576a70){var _0x2c6fa9={};_0x2c6fa9[_0x576a70]={'$like':'%'+_0x29130d[_0x605d('0x42')]['filter']+'%'};return _0x2c6fa9;})});}_0x474cfc=_[_0x605d('0xcd')]({},_0x474cfc,_0x29130d['options']);return _0x4fd4f1[_0x605d('0x148')](_0x474cfc);}})[_0x605d('0x13')](function(_0x190042){if(_0x190042){_0x5e1469=_0x190042[_0x605d('0x55')];if(!_0x29130d['query']['hasOwnProperty'](_0x605d('0xd4'))){_0x474cfc[_0x605d('0x23')]=qs[_0x605d('0x23')](_0x29130d[_0x605d('0x42')]['limit']);_0x474cfc[_0x605d('0x21')]=qs[_0x605d('0x21')](_0x29130d['query'][_0x605d('0x21')]);}return _0x4fd4f1[_0x605d('0x148')](_0x474cfc);}})[_0x605d('0x13')](function(_0x53d90b){if(_0x53d90b){return _0x53d90b?{'count':_0x5e1469,'rows':_0x53d90b}:null;}})[_0x605d('0x13')](respondWithResult(_0x2a1925,null))[_0x605d('0x1d')](handleError(_0x2a1925,null));};exports[_0x605d('0x149')]=function(_0x5673bb,_0x3bb0fd){return db[_0x605d('0x3f')][_0x605d('0x57')]({'where':{'id':_0x5673bb[_0x605d('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3bb0fd,null))['then'](function(_0x43f9a9){if(_0x43f9a9){return _0x43f9a9[_0x605d('0x149')](_0x5673bb[_0x605d('0x5e')]['ids'],_[_0x605d('0x62')](_0x5673bb['body'],['ids','id'])||{});}})[_0x605d('0x13')](respondWithResult(_0x3bb0fd,null))[_0x605d('0x1d')](handleError(_0x3bb0fd,null));};exports[_0x605d('0x14a')]=function(_0x3c73d3,_0x336fcd){return db[_0x605d('0x3f')][_0x605d('0x57')]({'where':{'id':_0x3c73d3['params']['id']}})[_0x605d('0x13')](handleEntityNotFound(_0x336fcd,null))[_0x605d('0x13')](function(_0x41f418){if(_0x41f418){return _0x41f418[_0x605d('0x14a')](_0x3c73d3[_0x605d('0x42')][_0x605d('0x61')]);}})['then'](respondWithStatusCode(_0x336fcd,null))[_0x605d('0x1d')](handleError(_0x336fcd,null));};exports['getOpenchannelAccounts']=function(_0x427803,_0x25978a){var _0x569c9b={};var _0x15f8fa={};var _0x547a76;var _0x5ab80c;return db[_0x605d('0x3f')][_0x605d('0x95')]({'where':{'id':_0x427803[_0x605d('0x4e')]['id']}})[_0x605d('0x13')](handleEntityNotFound(_0x25978a,null))[_0x605d('0x13')](function(_0x5b0e91){if(_0x5b0e91){_0x547a76=_0x5b0e91;_0x15f8fa[_0x605d('0x4f')]=_[_0x605d('0x51')](db[_0x605d('0x14b')]['rawAttributes']);_0x15f8fa['query']=_[_0x605d('0x51')](_0x427803[_0x605d('0x42')]);_0x15f8fa[_0x605d('0x52')]=_['intersection'](_0x15f8fa['model'],_0x15f8fa[_0x605d('0x42')]);_0x569c9b[_0x605d('0x44')]=_[_0x605d('0x53')](_0x15f8fa['model'],qs[_0x605d('0x54')](_0x427803[_0x605d('0x42')][_0x605d('0x54')]));_0x569c9b[_0x605d('0x44')]=_0x569c9b[_0x605d('0x44')]['length']?_0x569c9b[_0x605d('0x44')]:_0x15f8fa[_0x605d('0x4f')];_0x569c9b[_0x605d('0xc9')]=qs[_0x605d('0xca')](_0x427803[_0x605d('0x42')][_0x605d('0xca')]);_0x569c9b[_0x605d('0xcc')]=qs['filters'](_['pick'](_0x427803['query'],_0x15f8fa[_0x605d('0x52')]));if(_0x427803['query'][_0x605d('0x30')]){_0x569c9b['where']=_[_0x605d('0xcd')](_0x569c9b[_0x605d('0xcc')],{'$or':_[_0x605d('0x32')](_0x569c9b[_0x605d('0x44')],function(_0x16271d){var _0x1aa836={};_0x1aa836[_0x16271d]={'$like':'%'+_0x427803[_0x605d('0x42')][_0x605d('0x30')]+'%'};return _0x1aa836;})});}_0x569c9b=_[_0x605d('0xcd')]({},_0x569c9b,_0x427803['options']);return _0x547a76['getOpenchannelAccounts'](_0x569c9b);}})[_0x605d('0x13')](function(_0x93f42c){if(_0x93f42c){_0x5ab80c=_0x93f42c['length'];if(!_0x427803['query']['hasOwnProperty'](_0x605d('0xd4'))){_0x569c9b[_0x605d('0x23')]=qs[_0x605d('0x23')](_0x427803[_0x605d('0x42')]['limit']);_0x569c9b[_0x605d('0x21')]=qs[_0x605d('0x21')](_0x427803['query'][_0x605d('0x21')]);}return _0x547a76['getOpenchannelAccounts'](_0x569c9b);}})['then'](function(_0x4ff061){if(_0x4ff061){return _0x4ff061?{'count':_0x5ab80c,'rows':_0x4ff061}:null;}})[_0x605d('0x13')](respondWithResult(_0x25978a,null))[_0x605d('0x1d')](handleError(_0x25978a,null));};exports[_0x605d('0x14c')]=function(_0x15688d,_0x33458e){return db[_0x605d('0x3f')][_0x605d('0x57')]({'where':{'id':_0x15688d[_0x605d('0x4e')]['id']}})['then'](handleEntityNotFound(_0x33458e,null))[_0x605d('0x13')](function(_0x69db40){if(_0x69db40){return _0x69db40[_0x605d('0x14c')](_0x15688d[_0x605d('0x5e')][_0x605d('0x61')],_[_0x605d('0x62')](_0x15688d['body'],[_0x605d('0x61'),'id'])||{});}})['then'](respondWithResult(_0x33458e,null))[_0x605d('0x1d')](handleError(_0x33458e,null));};exports['removeOpenchannelAccounts']=function(_0x23ae4c,_0x2c0080){return db[_0x605d('0x3f')][_0x605d('0x57')]({'where':{'id':_0x23ae4c[_0x605d('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2c0080,null))[_0x605d('0x13')](function(_0x509259){if(_0x509259){return _0x509259['removeOpenchannelAccounts'](_0x23ae4c[_0x605d('0x42')][_0x605d('0x61')]);}})[_0x605d('0x13')](respondWithStatusCode(_0x2c0080,null))[_0x605d('0x1d')](handleError(_0x2c0080,null));};exports['getSmsAccounts']=function(_0x2f9007,_0x16c42d){var _0x3193ab={};var _0x1522bc={};var _0x3300f1;var _0x10edcd;return db['User'][_0x605d('0x95')]({'where':{'id':_0x2f9007[_0x605d('0x4e')]['id']}})[_0x605d('0x13')](handleEntityNotFound(_0x16c42d,null))[_0x605d('0x13')](function(_0x1c0379){if(_0x1c0379){_0x3300f1=_0x1c0379;_0x1522bc[_0x605d('0x4f')]=_[_0x605d('0x51')](db[_0x605d('0x14d')][_0x605d('0x39')]);_0x1522bc[_0x605d('0x42')]=_['keys'](_0x2f9007[_0x605d('0x42')]);_0x1522bc[_0x605d('0x52')]=_[_0x605d('0x53')](_0x1522bc[_0x605d('0x4f')],_0x1522bc[_0x605d('0x42')]);_0x3193ab[_0x605d('0x44')]=_[_0x605d('0x53')](_0x1522bc[_0x605d('0x4f')],qs[_0x605d('0x54')](_0x2f9007[_0x605d('0x42')][_0x605d('0x54')]));_0x3193ab[_0x605d('0x44')]=_0x3193ab['attributes'][_0x605d('0x55')]?_0x3193ab[_0x605d('0x44')]:_0x1522bc['model'];_0x3193ab[_0x605d('0xc9')]=qs[_0x605d('0xca')](_0x2f9007[_0x605d('0x42')][_0x605d('0xca')]);_0x3193ab[_0x605d('0xcc')]=qs[_0x605d('0x52')](_[_0x605d('0xcb')](_0x2f9007[_0x605d('0x42')],_0x1522bc[_0x605d('0x52')]));if(_0x2f9007['query'][_0x605d('0x30')]){_0x3193ab[_0x605d('0xcc')]=_[_0x605d('0xcd')](_0x3193ab[_0x605d('0xcc')],{'$or':_[_0x605d('0x32')](_0x3193ab[_0x605d('0x44')],function(_0x2f8505){var _0x30b609={};_0x30b609[_0x2f8505]={'$like':'%'+_0x2f9007[_0x605d('0x42')][_0x605d('0x30')]+'%'};return _0x30b609;})});}_0x3193ab=_[_0x605d('0xcd')]({},_0x3193ab,_0x2f9007[_0x605d('0xce')]);return _0x3300f1['getSmsAccounts'](_0x3193ab);}})['then'](function(_0x537c35){if(_0x537c35){_0x10edcd=_0x537c35[_0x605d('0x55')];if(!_0x2f9007[_0x605d('0x42')][_0x605d('0xcf')](_0x605d('0xd4'))){_0x3193ab[_0x605d('0x23')]=qs[_0x605d('0x23')](_0x2f9007[_0x605d('0x42')][_0x605d('0x23')]);_0x3193ab[_0x605d('0x21')]=qs[_0x605d('0x21')](_0x2f9007[_0x605d('0x42')]['offset']);}return _0x3300f1[_0x605d('0x14e')](_0x3193ab);}})[_0x605d('0x13')](function(_0x311ed5){if(_0x311ed5){return _0x311ed5?{'count':_0x10edcd,'rows':_0x311ed5}:null;}})[_0x605d('0x13')](respondWithResult(_0x16c42d,null))[_0x605d('0x1d')](handleError(_0x16c42d,null));};exports[_0x605d('0x14f')]=function(_0x5a10b2,_0x9b317d){return db[_0x605d('0x3f')][_0x605d('0x57')]({'where':{'id':_0x5a10b2['params']['id']}})[_0x605d('0x13')](handleEntityNotFound(_0x9b317d,null))['then'](function(_0x4d69e7){if(_0x4d69e7){return _0x4d69e7[_0x605d('0x14f')](_0x5a10b2['body'][_0x605d('0x61')],_['omit'](_0x5a10b2['body'],[_0x605d('0x61'),'id'])||{});}})[_0x605d('0x13')](respondWithResult(_0x9b317d,null))[_0x605d('0x1d')](handleError(_0x9b317d,null));};exports[_0x605d('0x150')]=function(_0x3a2769,_0xb6b2ea){return db[_0x605d('0x3f')][_0x605d('0x57')]({'where':{'id':_0x3a2769['params']['id']}})['then'](handleEntityNotFound(_0xb6b2ea,null))[_0x605d('0x13')](function(_0x5ed8da){if(_0x5ed8da){return _0x5ed8da[_0x605d('0x150')](_0x3a2769['query'][_0x605d('0x61')]);}})['then'](respondWithStatusCode(_0xb6b2ea,null))[_0x605d('0x1d')](handleError(_0xb6b2ea,null));};exports[_0x605d('0x151')]=function(_0x4316ad,_0x25735){var _0x49466a={};var _0x19f40b={};var _0x4ac858;var _0x2936e3;return db[_0x605d('0x3f')][_0x605d('0x95')]({'where':{'id':_0x4316ad[_0x605d('0x4e')]['id']}})[_0x605d('0x13')](handleEntityNotFound(_0x25735,null))[_0x605d('0x13')](function(_0x17d444){if(_0x17d444){_0x4ac858=_0x17d444;_0x19f40b[_0x605d('0x4f')]=_[_0x605d('0x51')](db[_0x605d('0x152')]['rawAttributes']);_0x19f40b['query']=_['keys'](_0x4316ad[_0x605d('0x42')]);_0x19f40b[_0x605d('0x52')]=_['intersection'](_0x19f40b[_0x605d('0x4f')],_0x19f40b[_0x605d('0x42')]);_0x49466a[_0x605d('0x44')]=_[_0x605d('0x53')](_0x19f40b[_0x605d('0x4f')],qs[_0x605d('0x54')](_0x4316ad[_0x605d('0x42')][_0x605d('0x54')]));_0x49466a[_0x605d('0x44')]=_0x49466a[_0x605d('0x44')][_0x605d('0x55')]?_0x49466a[_0x605d('0x44')]:_0x19f40b[_0x605d('0x4f')];_0x49466a[_0x605d('0xc9')]=qs['sort'](_0x4316ad['query'][_0x605d('0xca')]);_0x49466a[_0x605d('0xcc')]=qs[_0x605d('0x52')](_[_0x605d('0xcb')](_0x4316ad[_0x605d('0x42')],_0x19f40b[_0x605d('0x52')]));if(_0x4316ad[_0x605d('0x42')][_0x605d('0x30')]){_0x49466a['where']=_[_0x605d('0xcd')](_0x49466a['where'],{'$or':_[_0x605d('0x32')](_0x49466a[_0x605d('0x44')],function(_0x3b0c41){var _0x4521cc={};_0x4521cc[_0x3b0c41]={'$like':'%'+_0x4316ad[_0x605d('0x42')][_0x605d('0x30')]+'%'};return _0x4521cc;})});}_0x49466a=_['merge']({},_0x49466a,_0x4316ad['options']);return _0x4ac858[_0x605d('0x151')](_0x49466a);}})[_0x605d('0x13')](function(_0x48c8ff){if(_0x48c8ff){_0x2936e3=_0x48c8ff[_0x605d('0x55')];if(!_0x4316ad[_0x605d('0x42')][_0x605d('0xcf')](_0x605d('0xd4'))){_0x49466a[_0x605d('0x23')]=qs['limit'](_0x4316ad[_0x605d('0x42')][_0x605d('0x23')]);_0x49466a['offset']=qs['offset'](_0x4316ad['query']['offset']);}return _0x4ac858[_0x605d('0x151')](_0x49466a);}})[_0x605d('0x13')](function(_0x3ad90d){if(_0x3ad90d){return _0x3ad90d?{'count':_0x2936e3,'rows':_0x3ad90d}:null;}})['then'](respondWithResult(_0x25735,null))[_0x605d('0x1d')](handleError(_0x25735,null));};exports['addChatWebsites']=function(_0x36a555,_0xa01c8c){return db[_0x605d('0x3f')]['find']({'where':{'id':_0x36a555[_0x605d('0x4e')]['id']}})['then'](handleEntityNotFound(_0xa01c8c,null))[_0x605d('0x13')](function(_0x6985fa){if(_0x6985fa){return _0x6985fa[_0x605d('0x153')](_0x36a555[_0x605d('0x5e')][_0x605d('0x61')],_[_0x605d('0x62')](_0x36a555[_0x605d('0x5e')],[_0x605d('0x61'),'id'])||{});}})[_0x605d('0x13')](respondWithResult(_0xa01c8c,null))[_0x605d('0x1d')](handleError(_0xa01c8c,null));};exports['removeChatWebsites']=function(_0x5a8ef7,_0xd72097){return db[_0x605d('0x3f')][_0x605d('0x57')]({'where':{'id':_0x5a8ef7['params']['id']}})['then'](handleEntityNotFound(_0xd72097,null))[_0x605d('0x13')](function(_0x19bede){if(_0x19bede){return _0x19bede['removeChatWebsites'](_0x5a8ef7[_0x605d('0x42')]['ids']);}})[_0x605d('0x13')](respondWithStatusCode(_0xd72097,null))['catch'](handleError(_0xd72097,null));};exports[_0x605d('0x154')]=function(_0x4a0b03,_0x21a8a9){var _0x51c461={};var _0x494b42={};var _0x4faf0c;var _0x166277;return db['User'][_0x605d('0x95')]({'where':{'id':_0x4a0b03[_0x605d('0x4e')]['id']}})[_0x605d('0x13')](handleEntityNotFound(_0x21a8a9,null))['then'](function(_0x2979d9){if(_0x2979d9){_0x4faf0c=_0x2979d9;_0x494b42[_0x605d('0x4f')]=_[_0x605d('0x51')](db[_0x605d('0x155')]['rawAttributes']);_0x494b42[_0x605d('0x42')]=_[_0x605d('0x51')](_0x4a0b03['query']);_0x494b42[_0x605d('0x52')]=_[_0x605d('0x53')](_0x494b42[_0x605d('0x4f')],_0x494b42[_0x605d('0x42')]);_0x51c461[_0x605d('0x44')]=_['intersection'](_0x494b42['model'],qs[_0x605d('0x54')](_0x4a0b03[_0x605d('0x42')]['fields']));_0x51c461[_0x605d('0x44')]=_0x51c461[_0x605d('0x44')]['length']?_0x51c461[_0x605d('0x44')]:_0x494b42[_0x605d('0x4f')];_0x51c461['order']=qs[_0x605d('0xca')](_0x4a0b03[_0x605d('0x42')]['sort']);_0x51c461['where']=qs[_0x605d('0x52')](_[_0x605d('0xcb')](_0x4a0b03['query'],_0x494b42[_0x605d('0x52')]));if(_0x4a0b03[_0x605d('0x42')][_0x605d('0x30')]){_0x51c461[_0x605d('0xcc')]=_[_0x605d('0xcd')](_0x51c461['where'],{'$or':_[_0x605d('0x32')](_0x51c461['attributes'],function(_0x21baf6){var _0x513790={};_0x513790[_0x21baf6]={'$like':'%'+_0x4a0b03[_0x605d('0x42')][_0x605d('0x30')]+'%'};return _0x513790;})});}_0x51c461=_[_0x605d('0xcd')]({},_0x51c461,_0x4a0b03['options']);return _0x4faf0c['getWhatsappAccounts'](_0x51c461);}})[_0x605d('0x13')](function(_0x26d6ab){if(_0x26d6ab){_0x166277=_0x26d6ab['length'];if(!_0x4a0b03[_0x605d('0x42')][_0x605d('0xcf')]('nolimit')){_0x51c461[_0x605d('0x23')]=qs[_0x605d('0x23')](_0x4a0b03[_0x605d('0x42')]['limit']);_0x51c461['offset']=qs[_0x605d('0x21')](_0x4a0b03['query'][_0x605d('0x21')]);}return _0x4faf0c[_0x605d('0x154')](_0x51c461);}})['then'](function(_0x3223d3){if(_0x3223d3){return _0x3223d3?{'count':_0x166277,'rows':_0x3223d3}:null;}})[_0x605d('0x13')](respondWithResult(_0x21a8a9,null))[_0x605d('0x1d')](handleError(_0x21a8a9,null));};exports[_0x605d('0x156')]=function(_0xc048eb,_0x2448ff){return db[_0x605d('0x3f')][_0x605d('0x57')]({'where':{'id':_0xc048eb[_0x605d('0x4e')]['id']}})[_0x605d('0x13')](handleEntityNotFound(_0x2448ff,null))[_0x605d('0x13')](function(_0xf532e){if(_0xf532e){return _0xf532e[_0x605d('0x156')](_0xc048eb[_0x605d('0x5e')][_0x605d('0x61')],_[_0x605d('0x62')](_0xc048eb[_0x605d('0x5e')],[_0x605d('0x61'),'id'])||{});}})[_0x605d('0x13')](respondWithResult(_0x2448ff,null))['catch'](handleError(_0x2448ff,null));};exports['removeWhatsappAccounts']=function(_0x1e6974,_0x335493){return db[_0x605d('0x3f')][_0x605d('0x57')]({'where':{'id':_0x1e6974[_0x605d('0x4e')]['id']}})[_0x605d('0x13')](handleEntityNotFound(_0x335493,null))[_0x605d('0x13')](function(_0x1a9414){if(_0x1a9414){return _0x1a9414[_0x605d('0x157')](_0x1e6974[_0x605d('0x42')][_0x605d('0x61')]);}})['then'](respondWithStatusCode(_0x335493,null))[_0x605d('0x1d')](handleError(_0x335493,null));};exports[_0x605d('0x158')]=function(_0x3a3bf8,_0x3b01b7){var _0x59b418={};var _0x55fce0={};var _0x1d60d8;var _0x277a6b;return db[_0x605d('0x3f')][_0x605d('0x95')]({'where':{'id':_0x3a3bf8[_0x605d('0x4e')]['id']}})[_0x605d('0x13')](handleEntityNotFound(_0x3b01b7,null))[_0x605d('0x13')](function(_0x160bc5){if(_0x160bc5){_0x1d60d8=_0x160bc5;_0x55fce0[_0x605d('0x4f')]=_['keys'](db['SquareProject'][_0x605d('0x39')]);_0x55fce0[_0x605d('0x42')]=_[_0x605d('0x51')](_0x3a3bf8[_0x605d('0x42')]);_0x55fce0[_0x605d('0x52')]=_['intersection'](_0x55fce0['model'],_0x55fce0[_0x605d('0x42')]);_0x59b418[_0x605d('0x44')]=_[_0x605d('0x53')](_0x55fce0[_0x605d('0x4f')],qs[_0x605d('0x54')](_0x3a3bf8['query'][_0x605d('0x54')]));_0x59b418[_0x605d('0x44')]=_0x59b418[_0x605d('0x44')][_0x605d('0x55')]?_0x59b418[_0x605d('0x44')]:_0x55fce0[_0x605d('0x4f')];_0x59b418[_0x605d('0xc9')]=qs[_0x605d('0xca')](_0x3a3bf8[_0x605d('0x42')][_0x605d('0xca')]);_0x59b418[_0x605d('0xcc')]=qs[_0x605d('0x52')](_[_0x605d('0xcb')](_0x3a3bf8[_0x605d('0x42')],_0x55fce0[_0x605d('0x52')]));if(_0x3a3bf8['query']['filter']){_0x59b418[_0x605d('0xcc')]=_[_0x605d('0xcd')](_0x59b418[_0x605d('0xcc')],{'$or':_[_0x605d('0x32')](_0x59b418[_0x605d('0x44')],function(_0x1d9078){var _0x2b107c={};_0x2b107c[_0x1d9078]={'$like':'%'+_0x3a3bf8[_0x605d('0x42')]['filter']+'%'};return _0x2b107c;})});}_0x59b418=_[_0x605d('0xcd')]({},_0x59b418,_0x3a3bf8[_0x605d('0xce')]);return _0x1d60d8[_0x605d('0x158')](_0x59b418);}})['then'](function(_0x5d236c){if(_0x5d236c){_0x277a6b=_0x5d236c[_0x605d('0x55')];if(!_0x3a3bf8[_0x605d('0x42')][_0x605d('0xcf')](_0x605d('0xd4'))){_0x59b418[_0x605d('0x23')]=qs['limit'](_0x3a3bf8[_0x605d('0x42')][_0x605d('0x23')]);_0x59b418[_0x605d('0x21')]=qs['offset'](_0x3a3bf8[_0x605d('0x42')][_0x605d('0x21')]);}return _0x1d60d8[_0x605d('0x158')](_0x59b418);}})[_0x605d('0x13')](function(_0x4028e9){if(_0x4028e9){return _0x4028e9?{'count':_0x277a6b,'rows':_0x4028e9}:null;}})[_0x605d('0x13')](respondWithResult(_0x3b01b7,null))['catch'](handleError(_0x3b01b7,null));};exports[_0x605d('0x159')]=function(_0x239ec3,_0x5d3f05){return db[_0x605d('0x3f')]['find']({'where':{'id':_0x239ec3[_0x605d('0x4e')]['id']}})[_0x605d('0x13')](handleEntityNotFound(_0x5d3f05,null))[_0x605d('0x13')](function(_0x397ad5){if(_0x397ad5){return _0x397ad5[_0x605d('0x159')](_0x239ec3[_0x605d('0x5e')]['ids'],_['omit'](_0x239ec3[_0x605d('0x5e')],[_0x605d('0x61'),'id'])||{});}})['then'](respondWithResult(_0x5d3f05,null))['catch'](handleError(_0x5d3f05,null));};exports[_0x605d('0x15a')]=function(_0x4526d3,_0x434b36){return db[_0x605d('0x3f')]['find']({'where':{'id':_0x4526d3[_0x605d('0x4e')]['id']}})[_0x605d('0x13')](handleEntityNotFound(_0x434b36,null))['then'](function(_0x1335ed){if(_0x1335ed){return _0x1335ed[_0x605d('0x15a')](_0x4526d3['query'][_0x605d('0x61')]);}})[_0x605d('0x13')](respondWithStatusCode(_0x434b36,null))[_0x605d('0x1d')](handleError(_0x434b36,null));};exports[_0x605d('0x15b')]=function(_0x2b7d7c,_0x124005){var _0x38b660={},_0x3c5312={},_0x2b4326={'count':0x0,'rows':[]};var _0x49a9f3=db['CmHopper']['rawAttributes'];_0x3c5312['model']=_[_0x605d('0x51')](_0x49a9f3);_0x3c5312[_0x605d('0x42')]=_['keys'](_0x2b7d7c[_0x605d('0x42')]);_0x3c5312[_0x605d('0x52')]=_[_0x605d('0x53')](_0x3c5312[_0x605d('0x4f')],_0x3c5312[_0x605d('0x42')]);_0x3c5312[_0x605d('0x52')]=_[_0x605d('0xc6')](_0x3c5312['filters'],['$and',_0x605d('0x15c'),_0x605d('0x15d'),_0x605d('0x15e'),_0x605d('0x15f'),_0x605d('0x160'),'$ne',_0x605d('0x161'),'$not',_0x605d('0x162'),'$notBetween',_0x605d('0x163'),_0x605d('0x164'),_0x605d('0x165'),_0x605d('0x166'),_0x605d('0x167'),_0x605d('0x168'),'$like',_0x605d('0x169'),'$contains',_0x605d('0x16a'),'$any']);_0x38b660[_0x605d('0x44')]=_[_0x605d('0x53')](_0x3c5312[_0x605d('0x4f')],qs[_0x605d('0x54')](_0x2b7d7c['query'][_0x605d('0x54')]));_0x38b660[_0x605d('0x44')]=_0x38b660[_0x605d('0x44')][_0x605d('0x55')]?_0x38b660[_0x605d('0x44')]:_0x3c5312['model'];if(!_0x2b7d7c[_0x605d('0x42')][_0x605d('0xcf')](_0x605d('0xd4'))){_0x38b660[_0x605d('0x23')]=qs[_0x605d('0x23')](_0x2b7d7c[_0x605d('0x42')]['limit']);_0x38b660[_0x605d('0x21')]=qs['offset'](_0x2b7d7c[_0x605d('0x42')][_0x605d('0x21')]);}_0x38b660[_0x605d('0xc9')]=qs[_0x605d('0xca')](_0x2b7d7c['query'][_0x605d('0xca')]);_0x38b660[_0x605d('0xcc')]=qs[_0x605d('0x52')](_[_0x605d('0xcb')](_0x2b7d7c[_0x605d('0x42')],_0x3c5312[_0x605d('0x52')]));if(_0x2b7d7c[_0x605d('0x42')][_0x605d('0x30')]){_0x38b660[_0x605d('0xcc')]=_['merge'](_0x38b660[_0x605d('0xcc')],{'$or':_[_0x605d('0x32')](_0x38b660[_0x605d('0x44')],function(_0x2de006){var _0x4dbd68={};_0x4dbd68[_0x2de006]={'$like':'%'+_0x2b7d7c[_0x605d('0x42')]['filter']+'%'};return _0x4dbd68;})});}_0x38b660[_0x605d('0xcc')]={'$and':[_0x38b660['where'],{'$or':[{'UserId':_0x2b7d7c[_0x605d('0x4e')]['id']},{'OwnerId':_0x2b7d7c[_0x605d('0x4e')]['id']}]}]};_0x38b660=_[_0x605d('0xcd')]({},_0x38b660,_0x2b7d7c[_0x605d('0xce')]);var _0x1036e6={'where':_0x38b660[_0x605d('0xcc')]};return db[_0x605d('0x16b')][_0x605d('0x24')](_0x1036e6)[_0x605d('0x13')](function(_0x57efc7){_0x2b4326[_0x605d('0x24')]=_0x57efc7;if(_0x2b7d7c[_0x605d('0x42')]['includeAll']){_0x38b660['include']=[{'attributes':['id',_0x605d('0x16c'),'lastName',_0x605d('0xe9')],'model':db['CmContact'],'as':_0x605d('0x16d')},{'attributes':['id',_0x605d('0x35'),_0x605d('0x16e')],'model':db[_0x605d('0xa6')],'as':_0x605d('0xd6')}];}return db[_0x605d('0x16b')][_0x605d('0x46')](_0x38b660);})[_0x605d('0x13')](function(_0xd65fac){_0x2b4326[_0x605d('0x49')]=_0xd65fac;return _0x2b4326;})['then'](respondWithFilteredResult(_0x124005,_0x38b660))[_0x605d('0x1d')](handleError(_0x124005,null));};exports[_0x605d('0x16f')]=function(_0xe7774,_0xf4f70c){if(!_[_0x605d('0x67')](_0xe7774[_0x605d('0x2b')]['id'])&&(_0xe7774[_0x605d('0x2b')]['role']==_0x605d('0x29')||_0xe7774[_0x605d('0x2b')]['role']==_0x605d('0x2b'))){return db['User'][_0x605d('0x95')]({'where':{'id':_0xe7774[_0x605d('0x4e')]['id']},'raw':!![]})[_0x605d('0x13')](function(_0x2e14dc){return authService[_0x605d('0x170')](_0x2e14dc);})['then'](function(_0x22f70f){if(_0x22f70f){return _0xf4f70c[_0x605d('0x1f')](0xc8)[_0x605d('0x26')]({'api_key':_0x22f70f['token']});}else{return _0xf4f70c[_0x605d('0x1f')](0xcc)[_0x605d('0x26')]({'message':_0x605d('0x171')});}})['catch'](handleError(_0xf4f70c,0x193));}else{return _0xf4f70c[_0x605d('0x1f')](0x191)['json']({'message':_0x605d('0x172')});}};exports['createApiKey']=function(_0x14737b,_0x43e64e){if(!_['isNil'](_0x14737b['user']['id'])&&(_0x14737b[_0x605d('0x2b')][_0x605d('0x28')]==_0x605d('0x29')||_0x14737b[_0x605d('0x2b')][_0x605d('0x28')]==_0x605d('0x2b'))){return db[_0x605d('0x3f')][_0x605d('0x57')]({'where':{'id':_0x14737b['params']['id']}})[_0x605d('0x13')](function(_0x521fdd){return authService[_0x605d('0x173')](_0x521fdd);})[_0x605d('0x13')](function(_0x58f560){return db[_0x605d('0x3f')][_0x605d('0x5d')]({'apiKeyIat':_0x58f560[_0x605d('0x174')],'apiKeyNonce':_0x58f560['nonce']},{'where':{'id':_0x14737b[_0x605d('0x4e')]['id']}})[_0x605d('0x13')](function(){return _0x43e64e[_0x605d('0x1f')](0xc8)[_0x605d('0x26')]({'api_key':_0x58f560[_0x605d('0x175')]});});})['catch'](handleError(_0x43e64e,0x193));}else{return _0x43e64e[_0x605d('0x1f')](0x191)[_0x605d('0x26')]({'message':_0x605d('0x172')});}};exports[_0x605d('0x176')]=function(_0x17a819,_0x3fdd80){if(!_['isNil'](_0x17a819[_0x605d('0x2b')]['id'])&&(_0x17a819['user'][_0x605d('0x28')]==_0x605d('0x29')||_0x17a819[_0x605d('0x2b')][_0x605d('0x28')]=='user')){return db[_0x605d('0x3f')][_0x605d('0x57')]({'where':{'id':_0x17a819[_0x605d('0x4e')]['id']}})[_0x605d('0x13')](handleEntityNotFound(_0x3fdd80,null))[_0x605d('0x13')](function(_0x5752a5){if(_0x5752a5&&_0x5752a5[_0x605d('0x177')]&&_0x5752a5[_0x605d('0x178')])return _0x5752a5;else throw{'message':_0x605d('0x179')};})[_0x605d('0x13')](function(){return db['User']['update']({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x17a819[_0x605d('0x4e')]['id']}});})['then'](respondWithStatusCode(_0x3fdd80,0xc8))[_0x605d('0x1d')](handleError(_0x3fdd80,0x193));}else{return _0x3fdd80[_0x605d('0x1f')](0x191)['json']({'message':_0x605d('0x172')});}};exports['whoami']=function(_0x5e4692,_0xe6aabc){var _0x25f8f5=_0x5e4692[_0x605d('0x2b')][_0x605d('0xa7')]({'plain':!![]});if(!_0x25f8f5){return _0xe6aabc[_0x605d('0x1f')](0x191)[_0x605d('0x12d')]('Unable\x20to\x20retrieve\x20the\x20current\x20user');}else{Promise['resolve']()['then'](function(){if(_0x5e4692[_0x605d('0x42')]['userSetting']!==_0x605d('0x48'))return;return _0x5e4692[_0x605d('0x2b')][_0x605d('0x17a')]();})[_0x605d('0x13')](function(_0xcfa73c){if(!_0xcfa73c)return;return _0xcfa73c['get']({'plain':!![]});})[_0x605d('0x13')](function(_0x5601df){_0x25f8f5[_0x605d('0x43')]=_0x5601df;return _0xe6aabc[_0x605d('0x1f')](0xc8)[_0x605d('0x26')](_0x25f8f5);});}};exports[_0x605d('0x17b')]=function(_0x42de49,_0x4f61c7){var _0x2e0d42={'offset':0x0},_0x231b08={'count':0x0,'rows':[]};Promise['resolve']()[_0x605d('0x13')](function(){if(!_0x42de49[_0x605d('0x42')]['filter']&&!_0x42de49[_0x605d('0x42')][_0x605d('0x17c')]&&!_0x42de49['query']['queues'])return[];return Promise['resolve']()[_0x605d('0x13')](function(){var _0x19051b=[];if(!_[_0x605d('0x89')](_0x42de49[_0x605d('0x42')][_0x605d('0x17c')])){_0x19051b[_0x605d('0x45')](db['Team'][_0x605d('0x46')]({'attributes':['id',_0x605d('0x35')],'where':{'id':_0x42de49[_0x605d('0x42')][_0x605d('0x17c')]}}));}if(!_[_0x605d('0x89')](_0x42de49['query'][_0x605d('0x17d')])){_0x19051b['push'](db[_0x605d('0xa6')][_0x605d('0x46')]({'attributes':['id',_0x605d('0x35')],'type':'inbound','where':{'id':_0x42de49[_0x605d('0x42')]['queues']}}));}return Promise[_0x605d('0x5c')](_0x19051b);})['then'](function(_0x435e1f){var _0x100c9b=_[_0x605d('0x11f')](_0x435e1f)[_0x605d('0x32')](function(_0x5caae4){return _0x5caae4[_0x605d('0x12b')]({'attributes':['id','name',_0x605d('0x63'),_0x605d('0x9a')],'raw':!![]});});return Promise['all'](_0x100c9b);})['then'](function(_0x4a4056){var _0xf21acf=_['flatten'](_0x4a4056);if(!_0x42de49['query'][_0x605d('0x30')])return _0xf21acf;if(_['isEmpty'](_0xf21acf)){return db[_0x605d('0x3f')][_0x605d('0x46')]({'attributes':['id',_0x605d('0x35'),_0x605d('0x63'),_0x605d('0x9a')],'where':{'role':_0x605d('0x2d'),'$or':[db[_0x605d('0x69')][_0x605d('0xcc')](db[_0x605d('0x69')]['fn'](_0x605d('0x17e'),db[_0x605d('0x69')][_0x605d('0x17f')](_0x605d('0x35'))),{'$like':'%'+_0x42de49[_0x605d('0x42')][_0x605d('0x30')]['toLowerCase']()+'%'}),{'internal':{'$like':'%'+_0x42de49[_0x605d('0x42')][_0x605d('0x30')]+'%'}}]},'raw':!![]});}else{return _(_0xf21acf)[_0x605d('0x11f')]()['filter'](function(_0xe5c07c){return _0xe5c07c[_0x605d('0x35')][_0x605d('0xa0')]()['includes'](_0x42de49[_0x605d('0x42')][_0x605d('0x30')][_0x605d('0xa0')]())||_0xe5c07c[_0x605d('0x63')]['toString']()[_0x605d('0x34')](_0x42de49[_0x605d('0x42')][_0x605d('0x30')]);})[_0x605d('0x33')]();}})[_0x605d('0x13')](function(_0x3baeb8){var _0x48ae81=_0x605d('0x35');var _0x4a64ab=_0x605d('0x180');if(_0x42de49[_0x605d('0x42')][_0x605d('0xca')]){_0x4a64ab=_0x42de49[_0x605d('0x42')]['sort'][0x0]==='-'?_0x605d('0x181'):_0x605d('0x180');_0x48ae81=_0x4a64ab===_0x605d('0x180')?_0x42de49[_0x605d('0x42')][_0x605d('0xca')]:_0x42de49[_0x605d('0x42')][_0x605d('0xca')]['substring'](0x1);}return _(_0x3baeb8)['uniqBy']('id')['orderBy']([function(_0x522afd){return _0x48ae81===_0x605d('0x35')?_0x522afd[_0x48ae81]['toLowerCase']():_0x522afd[_0x48ae81];}],[_0x4a64ab])[_0x605d('0x32')](function(_0x3dfa52){return _['pick'](_0x3dfa52,['id',_0x605d('0x35'),_0x605d('0x63'),'online']);})[_0x605d('0x33')]();})['then'](function(_0x5893c8){return client['request']('Agents',_0x42de49)[_0x605d('0x13')](function(_0x32ab9b){if(_0x32ab9b[_0x605d('0x19')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');var _0x3b6fac=_0x32ab9b[_0x605d('0x1c')];var _0x51e59a=jayson['client'][_0x605d('0x182')]({'port':0x232c});return _0x51e59a[_0x605d('0x12')]('Agents',_0x42de49)[_0x605d('0x13')](function(_0x59a11a){if(_0x59a11a[_0x605d('0x19')])throw new Error(_0x605d('0x183'));var _0x602f57=_0x59a11a['result'];return _[_0x605d('0xcd')]({},_0x602f57,_0x3b6fac);});})['then'](function(_0x36a09d){return _[_0x605d('0x32')](_0x5893c8,function(_0x2a456f){var _0xdf0db3=_['find'](_0x36a09d[_0x605d('0x49')],['id',_0x2a456f['id']]);if(!_0xdf0db3||!_0x2a456f['online']){_0x2a456f[_0x605d('0x1f')]=_0x605d('0x184');}else if(_0xdf0db3[_0x605d('0x9b')]){_0x2a456f['status']=_0x605d('0x102');}else{_0x2a456f['status']=_[_0x605d('0x34')]([_0x605d('0x185'),_0x605d('0x186'),_0x605d('0x187'),_0x605d('0x188'),null,undefined],_0xdf0db3[_0x605d('0x189')])?_0x605d('0x9a'):'busy';}return _0x2a456f;});});});})[_0x605d('0x13')](function(_0x39d1ce){if(!_0x42de49[_0x605d('0x42')][_0x605d('0xcf')](_0x605d('0xd4'))){_0x2e0d42['limit']=qs['limit'](_0x42de49[_0x605d('0x42')][_0x605d('0x23')]||0xa);_0x2e0d42['offset']=qs[_0x605d('0x21')](_0x42de49['query']['offset']);}_0x231b08['count']=_0x39d1ce['length'];_0x231b08[_0x605d('0x49')]=_0x2e0d42[_0x605d('0x23')]?_0x39d1ce[_0x605d('0x18a')](_0x2e0d42[_0x605d('0x21')],_0x2e0d42[_0x605d('0x21')]+_0x2e0d42['limit']):_0x39d1ce;return _0x231b08;})[_0x605d('0x13')](respondWithFilteredResult(_0x4f61c7,_0x2e0d42))['catch'](handleError(_0x4f61c7,null));};function get_open_tabs(_0x5ae617,_0x3b0935){var _0x40c2ed=_0x5ae617['charAt'](0x0)[_0x605d('0x18b')]()+_0x5ae617[_0x605d('0x18a')](0x1);var _0x200b8a={'type':db[_0x605d('0x8d')][_0x605d('0x6a')][_0x605d('0x6b')],'raw':!![]};return new BPromise(function(_0x3a6599,_0x199fd5){var _0x3a92b6=squel['select']()[_0x605d('0x18c')](_0x605d('0x18d')+_0x40c2ed+_0x605d('0x18e'),'id')[_0x605d('0x18c')]('ui.createdAt')[_0x605d('0x6c')]('user_has_'+_0x5ae617+_0x605d('0x18f'),'ui')['where'](_0x605d('0x190'),_0x3b0935['id']);return db[_0x605d('0x69')][_0x605d('0x42')](_0x3a92b6[_0x605d('0x191')](),_0x200b8a)[_0x605d('0x13')](function(_0x4d2efb){_0x3b0935[_0x40c2ed+_0x605d('0x192')]=_0x4d2efb;_0x3a6599(_0x4d2efb);})[_0x605d('0x1d')](function(_0x3887d6){_0x199fd5(_0x3887d6);});});}
\ No newline at end of file
+var _0xc4f7=['validatePasswordHistory','passwordHistoryLimit','updatePasswordsHistory','addQueues','channel','online','voicePause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','penalty','QueueId','Queue:save','VoiceQueue','get','voice','UserVoiceQueueRt','upsert','removeQueues','remove','isArray','emit','Queue:remove','addAvatar','userpic','file','filename','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','join','root','CHAT','createdAt','FAX','OpenchannelOpenTabs','MailOpenTabs','MAIL','SMS','WHATSAPP','concat','findOne','order','sort','pick','getContacts','hasOwnProperty','List','Tag','color','tag','nolimit','getQueues','Queue','options','getVoiceQueuesRt','getGroups','ChatGroup','UserId','VoiceRecording','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','login','phone','mobile','format','LOCAL/%s@from-sip/n','intrf','SIP/%s','user:%s','x-forwarded-for','remoteAddress','connection','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','loginInPause','MemberReport','forEach','getChannels','LOGIN','device','PAUSE','LOGININPAUSE','YYYY-MM-DD\x20HH:mm:ss','resolve','logout','pause','QueuePause','DEFAULT\x20PAUSE','mailPause','chatPause','faxPause','openchannelPause','whatsapppause','unpause','manual','%s%s','Pause','getTeams','addTeams','Team','setDataValue','Voice','Chat','Mail','getSmsQueues','getWhatsappQueues','Whatsapp','Fax','Openchannel','flatten','transaction','getDataValue','TeamVoicePrefix','removeTeams','getMailQueues','Sms','getFaxQueues','getOpenchannelQueues','removeAgent','VoicePrefixId','CmList','getLists','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','spread','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','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','VoicePrefix','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gte','$lt','$lte','$ne','$eq','$not','$notBetween','$in','$like','$notLike','$iLike','$notILike','$overlap','$contained','$any','firstName','CmContact','Contact','dialActive','getApiKey','token','No\x20API\x20access\x20key\x20found!','iat','nonce','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','getUserSetting','getPresence','teams','queues','inbound','getAgents','lower','toString','asc','substring','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','offline','idle','unknown','ringing','busy','slice','charAt','toUpperCase','select','field','ui.','InteractionId','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','moment','bluebird','util','path','squel','jayson/promise','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','redis','./user.socket','register','defaults','localhost','client','http','request','then','info','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','status','end','offset','undefined','count','limit','set','Content-Range','json','update','destroy','role','admin','Users','agent','Telephones','telephone','filter','map','value','includes','name','UserProfileResource','sendStatus','stack','send','User','rawAttributes','fieldName','type','key','salt','where','includeAll','include','query','userSetting','true','attributes','findAll','rows','openTabs','length','push','chat','sms','dataValues','fax','mail','openchannel','whatsapp','all','show','params','model','differenceBy','keys','password','filters','intersection','fields','merge','find','body','describe','addContacts','omit','ids','internal','Setting','findById','securePassword','validatePasswordPattern','isNil','min_internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','SELECT','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','101','102','103','110','104','106','107','108','109','100','111','create','user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','UserProfileSection','autoAssociation','bulkCreate','Unauthorized','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','each','Agents','isEmpty','compact','changePassword','oldPassword','newPassword','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Sequelize','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','enforcePasswordHistory','previousPasswords'];(function(_0x2f7814,_0x410e62){var _0x13d759=function(_0x47bf08){while(--_0x47bf08){_0x2f7814['push'](_0x2f7814['shift']());}};_0x13d759(++_0x410e62);}(_0xc4f7,0xfe));var _0x7c4f=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xc4f7[_0x4b369d];return _0x571a98;};'use strict';var moment=require(_0x7c4f('0x0'));var BPromise=require(_0x7c4f('0x1'));var util=require(_0x7c4f('0x2'));var path=require(_0x7c4f('0x3'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7c4f('0x4'));var jayson=require(_0x7c4f('0x5'));var Redis=require('ioredis');var authService=require(_0x7c4f('0x6'));var qs=require(_0x7c4f('0x7'));var logger=require(_0x7c4f('0x8'))(_0x7c4f('0x9'));var utils=require('../../config/utils');var config=require(_0x7c4f('0xa'));var licenseUtil=require(_0x7c4f('0xb'));var db=require(_0x7c4f('0xc'))['db'];var socket=require(_0x7c4f('0xd'))(new Redis(config[_0x7c4f('0xe')]));require(_0x7c4f('0xf'))[_0x7c4f('0x10')](socket);config[_0x7c4f('0xe')]=_[_0x7c4f('0x11')](config['redis'],{'host':_0x7c4f('0x12'),'port':0x18eb});var client=jayson[_0x7c4f('0x13')][_0x7c4f('0x14')]({'port':0x232a});var values;function respondWithRpcPromise(_0x109edd,_0x37f0b9,_0x4202e0,_0x50379c){return new BPromise(function(_0x3ef6d5,_0x22c385){var _0x244c9e=_0x50379c||client;return _0x244c9e[_0x7c4f('0x15')](_0x109edd,_0x4202e0)[_0x7c4f('0x16')](function(_0x5f4e17){logger[_0x7c4f('0x17')](_0x7c4f('0x18'),_0x37f0b9,_0x7c4f('0x19'));logger['debug'](_0x7c4f('0x1a'),_0x37f0b9,_0x7c4f('0x19'),JSON[_0x7c4f('0x1b')](_0x5f4e17));if(_0x5f4e17['error']){if(_0x5f4e17[_0x7c4f('0x1c')]['code']===0x1f4){logger[_0x7c4f('0x1c')](_0x7c4f('0x18'),_0x37f0b9,_0x5f4e17[_0x7c4f('0x1c')][_0x7c4f('0x1d')]);return _0x22c385(_0x5f4e17['error'][_0x7c4f('0x1d')]);}logger[_0x7c4f('0x1c')]('User,\x20%s,\x20%s',_0x37f0b9,_0x5f4e17[_0x7c4f('0x1c')]['message']);return _0x3ef6d5(_0x5f4e17['error'][_0x7c4f('0x1d')]);}else{logger['info'](_0x7c4f('0x18'),_0x37f0b9,_0x7c4f('0x19'));_0x3ef6d5(_0x5f4e17['result']['message']);}})[_0x7c4f('0x1e')](function(_0x548af9){logger[_0x7c4f('0x1c')](_0x7c4f('0x18'),_0x37f0b9,_0x548af9);_0x22c385(_0x548af9);});});}function respondWithStatusCode(_0x4cbb80,_0x51bd46){_0x51bd46=_0x51bd46||0xcc;return function(_0xb791d1){if(_0xb791d1){return _0x4cbb80['sendStatus'](_0x51bd46);}return _0x4cbb80[_0x7c4f('0x1f')](_0x51bd46)[_0x7c4f('0x20')]();};}function respondWithResult(_0x36f4f0,_0x6b2e36){_0x6b2e36=_0x6b2e36||0xc8;return function(_0x4675ad){if(_0x4675ad){return _0x36f4f0[_0x7c4f('0x1f')](_0x6b2e36)['json'](_0x4675ad);}};}function respondWithFilteredResult(_0x4ecbc3,_0x2155ac){return function(_0x5bf6a5){if(_0x5bf6a5){var _0x267cc9=typeof _0x2155ac[_0x7c4f('0x21')]===_0x7c4f('0x22')&&typeof _0x2155ac['limit']==='undefined';var _0x3490a1=_0x5bf6a5[_0x7c4f('0x23')];var _0x1f19c1=_0x267cc9?0x0:_0x2155ac[_0x7c4f('0x21')];var _0x86fe5e=_0x267cc9?_0x5bf6a5[_0x7c4f('0x23')]:_0x2155ac[_0x7c4f('0x21')]+_0x2155ac[_0x7c4f('0x24')];var _0x3138bb;if(_0x86fe5e>=_0x3490a1){_0x86fe5e=_0x3490a1;_0x3138bb=0xc8;}else{_0x3138bb=0xce;}_0x4ecbc3['status'](_0x3138bb);return _0x4ecbc3[_0x7c4f('0x25')](_0x7c4f('0x26'),_0x1f19c1+'-'+_0x86fe5e+'/'+_0x3490a1)[_0x7c4f('0x27')](_0x5bf6a5);}return null;};}function saveUpdates(_0x4de436){return function(_0x489bd6){if(_0x489bd6){return _0x489bd6[_0x7c4f('0x28')](_0x4de436)['then'](function(_0x35f7df){return _0x35f7df;});}return null;};}function removeEntity(_0x367fe5){return function(_0x5c9ed3){if(_0x5c9ed3){return _0x5c9ed3[_0x7c4f('0x29')]()[_0x7c4f('0x16')](function(){var _0x32dc55=_0x5c9ed3['get']({'plain':!![]});if(_0x32dc55[_0x7c4f('0x2a')]===_0x7c4f('0x2b'))return;var _0x2f6ae6=[{'name':_0x7c4f('0x2c'),'value':'user','ignore':!![]},{'name':'Agents','value':_0x7c4f('0x2d'),'ignore':![]},{'name':_0x7c4f('0x2e'),'value':_0x7c4f('0x2f'),'ignore':![]}];var _0x57a94e=_(_0x2f6ae6)[_0x7c4f('0x30')]('ignore')[_0x7c4f('0x31')]('value')[_0x7c4f('0x32')]();if(_[_0x7c4f('0x33')](_0x57a94e,_0x32dc55['role'])){return;}var _0x2a08c5=_['find'](_0x2f6ae6,[_0x7c4f('0x32'),_0x32dc55[_0x7c4f('0x2a')]])[_0x7c4f('0x34')];return db[_0x7c4f('0x35')][_0x7c4f('0x29')]({'where':{'type':_0x2a08c5,'resourceId':_0x32dc55['id']}})['then'](function(){return _0x5c9ed3;});})['then'](function(){_0x367fe5[_0x7c4f('0x1f')](0xcc)[_0x7c4f('0x20')]();});}};}function handleEntityNotFound(_0x4a88e5){return function(_0x597858){if(!_0x597858){_0x4a88e5[_0x7c4f('0x36')](0x194);}return _0x597858;};}function handleError(_0x25a4b1,_0x1e5ec4){_0x1e5ec4=_0x1e5ec4||0x1f4;return function(_0x2f405e){logger[_0x7c4f('0x1c')](_0x2f405e[_0x7c4f('0x37')]);if(_0x2f405e[_0x7c4f('0x34')]){delete _0x2f405e[_0x7c4f('0x34')];}_0x25a4b1[_0x7c4f('0x1f')](_0x1e5ec4)[_0x7c4f('0x38')](_0x2f405e);};}exports['index']=function(_0x1895fa,_0x7980f){var _0x285ae6={},_0x87e8af={'count':0x0,'rows':[]};var _0x399384=_(db[_0x7c4f('0x39')][_0x7c4f('0x3a')])['map'](function(_0x54a770){return{'name':_0x54a770[_0x7c4f('0x3b')],'type':_0x54a770[_0x7c4f('0x3c')][_0x7c4f('0x3d')]};})[_0x7c4f('0x30')](function(_0x23178f){return!_[_0x7c4f('0x33')](['password',_0x7c4f('0x3e')],_0x23178f[_0x7c4f('0x34')]);})[_0x7c4f('0x32')]();_0x285ae6=qs['getOptions'](_0x399384,_0x1895fa);var _0xb8aea={'where':_0x285ae6[_0x7c4f('0x3f')]};return db[_0x7c4f('0x39')][_0x7c4f('0x23')](_0xb8aea)['then'](function(_0x23fe74){_0x87e8af['count']=_0x23fe74;if(_0x1895fa['query'][_0x7c4f('0x40')]){_0x285ae6[_0x7c4f('0x41')]=[{'all':!![]}];}if(_0x1895fa[_0x7c4f('0x42')][_0x7c4f('0x43')]===_0x7c4f('0x44')){_0x285ae6[_0x7c4f('0x41')]=[{'model':db['UserSetting'],'as':_0x7c4f('0x43')}];}if(!_[_0x7c4f('0x33')](_0x285ae6[_0x7c4f('0x45')],'id')){_0x285ae6[_0x7c4f('0x45')]['push']('id');}return db[_0x7c4f('0x39')][_0x7c4f('0x46')](_0x285ae6);})[_0x7c4f('0x16')](function(_0x33d497){_0x87e8af[_0x7c4f('0x47')]=_0x33d497;if(_0x1895fa['query'][_0x7c4f('0x48')]==='true'){var _0x1ab833=[];for(var _0x15223a=0x0;_0x15223a<_0x87e8af[_0x7c4f('0x47')][_0x7c4f('0x49')];_0x15223a++){_0x1ab833[_0x7c4f('0x4a')](get_open_tabs(_0x7c4f('0x4b'),_0x87e8af['rows'][_0x15223a]['dataValues']));_0x1ab833[_0x7c4f('0x4a')](get_open_tabs(_0x7c4f('0x4c'),_0x87e8af[_0x7c4f('0x47')][_0x15223a][_0x7c4f('0x4d')]));_0x1ab833[_0x7c4f('0x4a')](get_open_tabs(_0x7c4f('0x4e'),_0x87e8af['rows'][_0x15223a][_0x7c4f('0x4d')]));_0x1ab833[_0x7c4f('0x4a')](get_open_tabs(_0x7c4f('0x4f'),_0x87e8af['rows'][_0x15223a][_0x7c4f('0x4d')]));_0x1ab833[_0x7c4f('0x4a')](get_open_tabs(_0x7c4f('0x50'),_0x87e8af[_0x7c4f('0x47')][_0x15223a][_0x7c4f('0x4d')]));_0x1ab833[_0x7c4f('0x4a')](get_open_tabs(_0x7c4f('0x51'),_0x87e8af[_0x7c4f('0x47')][_0x15223a][_0x7c4f('0x4d')]));}return BPromise[_0x7c4f('0x52')](_0x1ab833)[_0x7c4f('0x16')](function(){return _0x87e8af;});}else{return _0x87e8af;}})[_0x7c4f('0x16')](respondWithFilteredResult(_0x7980f,_0x285ae6))[_0x7c4f('0x1e')](handleError(_0x7980f,null));};exports[_0x7c4f('0x53')]=function(_0x55e8a3,_0xa149a6){var _0x317550={'raw':![],'where':{'id':_0x55e8a3[_0x7c4f('0x54')]['id']}},_0x460261={};_0x460261[_0x7c4f('0x55')]=_[_0x7c4f('0x56')](_[_0x7c4f('0x57')](db[_0x7c4f('0x39')][_0x7c4f('0x3a')]),[_0x7c4f('0x58'),_0x7c4f('0x3e')]);_0x460261[_0x7c4f('0x42')]=_[_0x7c4f('0x57')](_0x55e8a3[_0x7c4f('0x42')]);_0x460261[_0x7c4f('0x59')]=_[_0x7c4f('0x5a')](_0x460261['model'],_0x460261['query']);_0x317550[_0x7c4f('0x45')]=_['intersection'](_0x460261[_0x7c4f('0x55')],qs[_0x7c4f('0x5b')](_0x55e8a3[_0x7c4f('0x42')][_0x7c4f('0x5b')]));_0x317550['attributes']=_0x317550[_0x7c4f('0x45')]['length']?_0x317550[_0x7c4f('0x45')]:_0x460261[_0x7c4f('0x55')];if(_0x55e8a3['query']['includeAll']){_0x317550[_0x7c4f('0x41')]=[{'all':!![]}];}if(_0x55e8a3['query'][_0x7c4f('0x43')]===_0x7c4f('0x44')){_0x317550[_0x7c4f('0x41')]=[{'model':db['UserSetting'],'as':_0x7c4f('0x43')}];}_0x317550=_[_0x7c4f('0x5c')]({},_0x317550,_0x55e8a3['options']);if(!_[_0x7c4f('0x33')](_0x317550['attributes'],'id')){_0x317550[_0x7c4f('0x45')][_0x7c4f('0x4a')]('id');}return db[_0x7c4f('0x39')][_0x7c4f('0x5d')](_0x317550)[_0x7c4f('0x16')](handleEntityNotFound(_0xa149a6,null))[_0x7c4f('0x16')](function(_0x35f5fb){var _0x346b76=[];values=_0x35f5fb;if(_0x55e8a3[_0x7c4f('0x42')][_0x7c4f('0x48')]===_0x7c4f('0x44')){_0x346b76[_0x7c4f('0x4a')](get_open_tabs(_0x7c4f('0x4b'),_0x35f5fb[_0x7c4f('0x4d')]));_0x346b76[_0x7c4f('0x4a')](get_open_tabs('sms',_0x35f5fb[_0x7c4f('0x4d')]));_0x346b76[_0x7c4f('0x4a')](get_open_tabs(_0x7c4f('0x50'),_0x35f5fb[_0x7c4f('0x4d')]));_0x346b76[_0x7c4f('0x4a')](get_open_tabs('whatsapp',_0x35f5fb[_0x7c4f('0x4d')]));_0x346b76[_0x7c4f('0x4a')](get_open_tabs('fax',_0x35f5fb[_0x7c4f('0x4d')]));_0x346b76[_0x7c4f('0x4a')](get_open_tabs('mail',_0x35f5fb['dataValues']));return BPromise[_0x7c4f('0x52')](_0x346b76);}else{return values;}})[_0x7c4f('0x16')](function(){return values;})['then'](respondWithResult(_0xa149a6,null))[_0x7c4f('0x1e')](handleError(_0xa149a6,null));};exports[_0x7c4f('0x28')]=function(_0x6d85f4,_0x4c2ffe){if(_0x6d85f4['body']['id']){delete _0x6d85f4['body']['id'];}delete _0x6d85f4[_0x7c4f('0x5e')]['role'];return db['User'][_0x7c4f('0x5d')]({'where':{'id':_0x6d85f4[_0x7c4f('0x54')]['id']}})['then'](handleEntityNotFound(_0x4c2ffe,null))[_0x7c4f('0x16')](saveUpdates(_0x6d85f4[_0x7c4f('0x5e')],null))[_0x7c4f('0x16')](respondWithResult(_0x4c2ffe,null))['catch'](handleError(_0x4c2ffe,null));};exports['describe']=function(_0x16ccba,_0x3e9839){return db['User'][_0x7c4f('0x5f')]()[_0x7c4f('0x16')](respondWithResult(_0x3e9839,null))['catch'](handleError(_0x3e9839,null));};exports['addContacts']=function(_0x45a5d0,_0x50d41a){return db[_0x7c4f('0x39')]['find']({'where':{'id':_0x45a5d0[_0x7c4f('0x54')]['id']}})['then'](handleEntityNotFound(_0x50d41a,null))[_0x7c4f('0x16')](function(_0x5c0951){if(_0x5c0951){return _0x5c0951[_0x7c4f('0x60')](_0x45a5d0[_0x7c4f('0x5e')]['ids'],_[_0x7c4f('0x61')](_0x45a5d0[_0x7c4f('0x5e')],[_0x7c4f('0x62'),'id'])||{});}})[_0x7c4f('0x16')](respondWithResult(_0x50d41a,null))['catch'](handleError(_0x50d41a,null));};function validateUser(_0x584257){return new BPromise(function(_0x6295a6,_0x2f6d01){if(_0x584257[_0x7c4f('0x63')])return _0x6295a6(_0x584257);return db[_0x7c4f('0x64')][_0x7c4f('0x65')](0x1)['then'](function(_0x34a8f0){if(_0x34a8f0[_0x7c4f('0x66')])authService[_0x7c4f('0x67')](_0x584257[_0x7c4f('0x58')]);db[_0x7c4f('0x39')]['max'](_0x7c4f('0x63'))['then'](function(_0x10507a){if(_[_0x7c4f('0x68')](_0x10507a)){_0x584257[_0x7c4f('0x63')]=_0x34a8f0[_0x7c4f('0x69')]||0x1;return;}if(_[_0x7c4f('0x68')](_0x34a8f0[_0x7c4f('0x69')])||_0x34a8f0['min_internal']===_0x10507a){_0x584257[_0x7c4f('0x63')]=_0x10507a+0x1;return;}if(_0x34a8f0[_0x7c4f('0x69')]>_0x10507a){_0x584257[_0x7c4f('0x63')]=_0x34a8f0[_0x7c4f('0x69')];return;}return db[_0x7c4f('0x6a')][_0x7c4f('0x42')](_0x7c4f('0x6b'),{'type':db[_0x7c4f('0x6a')][_0x7c4f('0x6c')][_0x7c4f('0x6d')]})['then'](function(_0x5157c0){if(_0x5157c0&&_0x5157c0[_0x7c4f('0x49')]){for(var _0x58cf12=0x0,_0x49a1b1=_0x5157c0[_0x7c4f('0x49')];_0x58cf12<_0x49a1b1&&_[_0x7c4f('0x68')](_0x584257[_0x7c4f('0x63')]);_0x58cf12++){if(_0x34a8f0[_0x7c4f('0x69')]<=_0x5157c0[_0x58cf12][_0x7c4f('0x6e')]){_0x584257[_0x7c4f('0x63')]=_0x5157c0[_0x58cf12][_0x7c4f('0x6e')];}else if(_0x34a8f0[_0x7c4f('0x69')]>_0x5157c0[_0x58cf12][_0x7c4f('0x6e')]&&_0x34a8f0[_0x7c4f('0x69')]<=_0x5157c0[_0x58cf12]['to']){_0x584257[_0x7c4f('0x63')]=_0x34a8f0[_0x7c4f('0x69')];}}}if(_[_0x7c4f('0x68')](_0x584257[_0x7c4f('0x63')])){_0x584257[_0x7c4f('0x63')]=_0x10507a+0x1;}return _0x6295a6(_0x584257);});});})[_0x7c4f('0x1e')](function(_0x5ae8b1){_0x2f6d01(_0x5ae8b1);});});}function updateUser(_0x43ff21){return new BPromise(function(_0x19e03d,_0x88f6b4){try{if(_0x43ff21[_0x7c4f('0x6f')]){_0x43ff21[_0x7c4f('0x70')]=_0x43ff21[_0x7c4f('0x63')];_0x43ff21[_0x7c4f('0x71')]={'mailbox':_0x43ff21[_0x7c4f('0x63')],'password':_0x43ff21['password'],'fullname':_0x43ff21[_0x7c4f('0x72')],'email':_0x43ff21[_0x7c4f('0x73')]};}if(_0x43ff21[_0x7c4f('0x2a')]===_0x7c4f('0x2d')){if(!_0x43ff21[_0x7c4f('0x74')])_0x43ff21['permissions']=[_0x7c4f('0x75'),_0x7c4f('0x76'),_0x7c4f('0x77'),'113',_0x7c4f('0x78'),_0x7c4f('0x79'),'105',_0x7c4f('0x7a'),_0x7c4f('0x7b'),_0x7c4f('0x7c'),_0x7c4f('0x7d'),_0x7c4f('0x7e'),_0x7c4f('0x7f'),'114','115'];}_0x19e03d(_0x43ff21);}catch(_0x563884){_0x88f6b4(_0x563884);}});}exports[_0x7c4f('0x80')]=function(_0x3bc0f9,_0x44c68f){if(_0x3bc0f9['user'][_0x7c4f('0x2a')]===_0x7c4f('0x2d'))throw new Error('Unauthorized');if(_0x3bc0f9[_0x7c4f('0x5e')][_0x7c4f('0x2a')]===_0x7c4f('0x81')&&_0x3bc0f9['user']['role']!==_0x7c4f('0x2b')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x3bc0f9['body']['role']==='admin'&&_0x3bc0f9['user']['role']!==_0x7c4f('0x2b')){throw new Error(_0x7c4f('0x82'));}return licenseUtil[_0x7c4f('0x83')]([_0x3bc0f9['body']])[_0x7c4f('0x16')](function(){return validateUser(_0x3bc0f9[_0x7c4f('0x5e')]);})[_0x7c4f('0x16')](function(_0xb9eb4){return updateUser(_0xb9eb4)['then'](function(_0x26d776){if(_0x26d776[_0x7c4f('0x2a')]===_0x7c4f('0x2b')){_0x26d776[_0x7c4f('0x84')]=_0x3bc0f9['user'][_0x7c4f('0x84')];delete _0x26d776[_0x7c4f('0x85')];}return _0x26d776;});})['then'](function(_0x4bd436){return db[_0x7c4f('0x39')][_0x7c4f('0x80')](_0x4bd436,{'include':[{'model':db['VoiceMail'],'as':_0x7c4f('0x71')}]});})[_0x7c4f('0x16')](function(_0x63fb6e){if(_0x3bc0f9[_0x7c4f('0x5e')]['role']==='user')return _0x63fb6e;if(_0x3bc0f9[_0x7c4f('0x81')][_0x7c4f('0x2a')]!==_0x7c4f('0x81'))return _0x63fb6e;return db[_0x7c4f('0x86')][_0x7c4f('0x5d')]({'where':{'name':_0x63fb6e[_0x7c4f('0x2a')]===_0x7c4f('0x2d')?'Agents':_0x7c4f('0x2e'),'userProfileId':_0x3bc0f9[_0x7c4f('0x81')]['userProfileId']},'raw':!![]})[_0x7c4f('0x16')](function(_0x1b3b6d){if(!_0x1b3b6d||_0x1b3b6d[_0x7c4f('0x87')]!=0x0)return _0x63fb6e;return db[_0x7c4f('0x35')][_0x7c4f('0x80')]({'name':_0x63fb6e[_0x7c4f('0x34')],'resourceId':_0x63fb6e['id'],'type':_0x1b3b6d['name'],'sectionId':_0x1b3b6d['id']},{})[_0x7c4f('0x16')](function(){return _0x63fb6e;});})[_0x7c4f('0x1e')](function(_0x3bce95){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3bce95);throw _0x3bce95;});})[_0x7c4f('0x16')](respondWithResult(_0x44c68f,0xc9))[_0x7c4f('0x1e')](handleError(_0x44c68f,null));};exports[_0x7c4f('0x88')]=function(_0x38418a,_0x38b0d1){var _0x1e025f=_0x38418a[_0x7c4f('0x5e')];var _0x295bac=[];if(_0x38418a[_0x7c4f('0x81')]['role']===_0x7c4f('0x2d'))throw new Error(_0x7c4f('0x89'));if(_[_0x7c4f('0x8a')](_0x1e025f,[_0x7c4f('0x2a'),_0x7c4f('0x81')])&&_0x38418a[_0x7c4f('0x81')][_0x7c4f('0x2a')]!=='admin'){throw new Error(_0x7c4f('0x8b'));}if(_[_0x7c4f('0x8a')](_0x1e025f,['role',_0x7c4f('0x2b')])&&_0x38418a['user'][_0x7c4f('0x2a')]!==_0x7c4f('0x2b')){throw new Error(_0x7c4f('0x8c'));}return licenseUtil[_0x7c4f('0x83')](_0x1e025f)[_0x7c4f('0x16')](function(){return validateUser(_0x1e025f[0x0]);})[_0x7c4f('0x16')](function(){for(var _0x3b5a76=0x1;_0x3b5a76<_0x1e025f['length'];_0x3b5a76++){var _0x1c17e1=_0x1e025f[_0x3b5a76-0x1][_0x7c4f('0x63')];if(!_0x1e025f[_0x3b5a76]['internal'])_0x1e025f[_0x3b5a76]['internal']=_0x1c17e1+0x1;_0x295bac[_0x7c4f('0x4a')](validateUser(_0x1e025f[_0x3b5a76]));}return BPromise[_0x7c4f('0x52')](_0x295bac);})['then'](function(){_0x295bac=[];for(var _0x556c04=0x0;_0x556c04<_0x1e025f[_0x7c4f('0x49')];_0x556c04++){_0x295bac[_0x7c4f('0x4a')](updateUser(_0x1e025f[_0x556c04]));}return BPromise['all'](_0x295bac);})[_0x7c4f('0x16')](function(){return BPromise[_0x7c4f('0x8d')](_0x1e025f,function(_0x24308d){return db['User']['create'](_0x24308d,{'include':[{'model':db[_0x7c4f('0x71')],'as':_0x7c4f('0x71')}]})[_0x7c4f('0x16')](function(_0x58a6ae){_0x24308d['id']=_0x58a6ae['id'];return _0x24308d;});});})[_0x7c4f('0x16')](function(_0x38baf4){if(_0x38418a['body'][_0x7c4f('0x2a')]===_0x7c4f('0x81'))return _0x38baf4;if(_0x38418a[_0x7c4f('0x81')][_0x7c4f('0x2a')]!==_0x7c4f('0x81'))return _0x38baf4;var _0x46b500=_[_0x7c4f('0x8a')](_0x38baf4,function(_0x222707){return _0x222707[_0x7c4f('0x2a')]===_0x7c4f('0x2d')||_0x222707[_0x7c4f('0x2a')]==='telephone';});if(!_0x46b500)return _0x38baf4;return db[_0x7c4f('0x86')]['findAll']({'where':{'name':{'$or':[_0x7c4f('0x8e'),_0x7c4f('0x2e')]},'userProfileId':_0x38418a[_0x7c4f('0x81')]['userProfileId']},'raw':!![]})[_0x7c4f('0x16')](function(_0x4c54de){if(_[_0x7c4f('0x8f')](_0x4c54de)||!_[_0x7c4f('0x8a')](_0x4c54de,[_0x7c4f('0x87'),0x0]))return _0x38baf4;_0x295bac=[];var _0x6648e9=_(_0x4c54de)[_0x7c4f('0x31')](function(_0x18ce61){if(_0x18ce61[_0x7c4f('0x87')]===0x1)return;return _0x18ce61[_0x7c4f('0x34')]===_0x7c4f('0x8e')?_0x7c4f('0x2d'):_0x7c4f('0x2f');})[_0x7c4f('0x90')]()[_0x7c4f('0x32')]();for(var _0x19bdcd=0x0;_0x19bdcd<_0x38baf4[_0x7c4f('0x49')];_0x19bdcd++){if(!_[_0x7c4f('0x33')](_0x6648e9,_0x38baf4[_0x19bdcd][_0x7c4f('0x2a')]))return;var _0x16df70=_0x38baf4[_0x19bdcd]['role']===_0x7c4f('0x2d')?_0x7c4f('0x8e'):_0x7c4f('0x2e');_0x295bac[_0x7c4f('0x4a')](db[_0x7c4f('0x35')][_0x7c4f('0x80')]({'name':_0x38baf4[_0x19bdcd][_0x7c4f('0x34')],'resourceId':_0x38baf4[_0x19bdcd]['id'],'type':_0x16df70,'sectionId':_[_0x7c4f('0x5d')](_0x4c54de,[_0x7c4f('0x34'),_0x16df70])['id']},{}));}return BPromise[_0x7c4f('0x52')](_0x295bac);});})['then'](respondWithResult(_0x38b0d1,0xc9))[_0x7c4f('0x1e')](handleError(_0x38b0d1,null));};exports[_0x7c4f('0x91')]=function(_0x78d42a,_0x331568){if(_0x78d42a[_0x7c4f('0x5e')]['id']){delete _0x78d42a[_0x7c4f('0x5e')]['id'];}return db['User']['find']({'where':{'id':_0x78d42a[_0x7c4f('0x54')]['id']}})['then'](function(_0xe0fedc){if(!_0xe0fedc)return null;if(_0xe0fedc['id']===_0x78d42a[_0x7c4f('0x81')]['id']){if(!_0x78d42a[_0x7c4f('0x5e')][_0x7c4f('0x92')]||!_0x78d42a[_0x7c4f('0x5e')][_0x7c4f('0x93')]){throw new db['Sequelize'][(_0x7c4f('0x94'))](_0x7c4f('0x95'));}if(!_0xe0fedc[_0x7c4f('0x96')](_0x78d42a[_0x7c4f('0x5e')]['oldPassword'])){throw new db[(_0x7c4f('0x97'))][(_0x7c4f('0x94'))](_0x7c4f('0x98'));}if(_0x78d42a['body']['oldPassword']===_0x78d42a[_0x7c4f('0x5e')][_0x7c4f('0x93')]){throw new db['Sequelize'][(_0x7c4f('0x94'))](_0x7c4f('0x99'));}}else if(_0x78d42a[_0x7c4f('0x81')][_0x7c4f('0x2a')]===_0x7c4f('0x2b')){if(!_0x78d42a[_0x7c4f('0x5e')][_0x7c4f('0x93')]){throw new db['Sequelize'][(_0x7c4f('0x94'))](_0x7c4f('0x9a'));}}else if(_0x78d42a['user'][_0x7c4f('0x2a')]===_0x7c4f('0x81')){if(!_0x78d42a['body'][_0x7c4f('0x93')]){throw new db[(_0x7c4f('0x97'))][(_0x7c4f('0x94'))](_0x7c4f('0x9a'));}if(_0xe0fedc[_0x7c4f('0x2a')]!==_0x7c4f('0x2d')){throw new db[(_0x7c4f('0x97'))][(_0x7c4f('0x94'))](_0x7c4f('0x89'));}}else{throw new db[(_0x7c4f('0x97'))][(_0x7c4f('0x94'))](_0x7c4f('0x89'));}return _0xe0fedc;})['then'](handleEntityNotFound(_0x331568,null))[_0x7c4f('0x16')](function(_0x885823){return db[_0x7c4f('0x64')]['findOne']({'attributes':['id',_0x7c4f('0x66'),_0x7c4f('0x9b'),'passwordHistoryLimit']})[_0x7c4f('0x16')](function(_0x5a5eb2){if(_0x5a5eb2[_0x7c4f('0x66')])authService[_0x7c4f('0x67')](_0x78d42a['body'][_0x7c4f('0x93')]);if(!_0x5a5eb2['enforcePasswordHistory']||!_0x885823[_0x7c4f('0x9c')])return _0x885823;authService[_0x7c4f('0x9d')](_0x78d42a['body'][_0x7c4f('0x93')],_0x885823[_0x7c4f('0x9c')],_0x5a5eb2[_0x7c4f('0x9e')]);return _0x885823;})[_0x7c4f('0x16')](saveUpdates({'password':_0x78d42a[_0x7c4f('0x5e')][_0x7c4f('0x93')],'passwordResetAt':_0x78d42a[_0x7c4f('0x81')]['id']==_0x78d42a['params']['id']?moment():null,'previousPasswords':authService[_0x7c4f('0x9f')](_0x78d42a['body'][_0x7c4f('0x93')],_0x885823['previousPasswords'])},null));})[_0x7c4f('0x16')](respondWithResult(_0x331568,null))['catch'](handleError(_0x331568,null));};exports[_0x7c4f('0xa0')]=function(_0x28ca37,_0x200167){var _0x4999d1=_0x28ca37[_0x7c4f('0x5e')][_0x7c4f('0xa1')];return db['User'][_0x7c4f('0x5d')]({'where':{'id':_0x28ca37['params']['id']},'attributes':['id','name',_0x7c4f('0x2a'),_0x7c4f('0xa2'),'loginInPause',_0x7c4f('0xa3'),_0x7c4f('0xa4')]})[_0x7c4f('0x16')](handleEntityNotFound(_0x200167,null))[_0x7c4f('0x16')](function(_0x5b58b8){if(_0x5b58b8){if(!utils[_0x7c4f('0xa5')](_0x4999d1)){throw new db['Sequelize'][(_0x7c4f('0x94'))](_0x7c4f('0xa6'));}return _0x5b58b8[_0x7c4f('0xa7')+_[_0x7c4f('0xa8')](_0x4999d1[_0x7c4f('0xa9')]())+_0x7c4f('0xaa')](_0x28ca37[_0x7c4f('0x5e')][_0x7c4f('0x62')],{'penalty':_0x28ca37[_0x7c4f('0x5e')][_0x7c4f('0xab')]||0x0})['spread'](function(_0x52b315){for(var _0x46707e=0x0;_0x46707e<_0x28ca37[_0x7c4f('0x5e')][_0x7c4f('0x62')][_0x7c4f('0x49')];_0x46707e+=0x1){var _0x3fa652={'UserId':Number(_0x28ca37[_0x7c4f('0x54')]['id'])};_0x3fa652[_['capitalize'](_0x4999d1[_0x7c4f('0xa9')]())+_0x7c4f('0xac')]=Number(_0x28ca37[_0x7c4f('0x5e')][_0x7c4f('0x62')][_0x46707e]);socket['emit']('user'+_[_0x7c4f('0xa8')](_0x4999d1[_0x7c4f('0xa9')]())+_0x7c4f('0xad'),_0x3fa652);}return _0x52b315;})['then'](function(){if(_0x4999d1==='voice'){return db[_0x7c4f('0xae')][_0x7c4f('0x46')]({'where':{'id':_0x28ca37['body']['ids']||[]},'raw':!![],'attributes':['id',_0x7c4f('0x34')]});}})[_0x7c4f('0x16')](function(_0x4371b1){var _0x1d3867=_0x5b58b8[_0x7c4f('0xaf')]({'plain':!![]});var _0x49d8d4=[];if(_0x4999d1===_0x7c4f('0xb0')&&_0x1d3867[_0x7c4f('0x2a')]===_0x7c4f('0x2d')&&_0x1d3867[_0x7c4f('0xa2')]){for(var _0x2d25ca=0x0;_0x2d25ca<_0x4371b1[_0x7c4f('0x49')];_0x2d25ca+=0x1){_0x49d8d4[_0x7c4f('0x4a')]({'membername':_0x1d3867[_0x7c4f('0x34')],'UserId':_0x1d3867['id'],'queue_name':_0x4371b1[_0x2d25ca]['name'],'VoiceQueueId':_0x4371b1[_0x2d25ca]['id'],'interface':_[_0x7c4f('0x68')](_0x1d3867[_0x7c4f('0xa4')])?util['format']('SIP/%s',_0x1d3867[_0x7c4f('0x34')]):_0x1d3867[_0x7c4f('0xa4')],'paused':_0x1d3867[_0x7c4f('0xa3')]||![],'penalty':_0x28ca37[_0x7c4f('0x5e')][_0x7c4f('0xab')]||0x0});}return BPromise[_0x7c4f('0x8d')](_0x49d8d4,function(_0x287e0c){return db[_0x7c4f('0xb1')][_0x7c4f('0xb2')](_0x287e0c);});}return _0x5b58b8;});}})[_0x7c4f('0x16')](respondWithStatusCode(_0x200167,null))[_0x7c4f('0x1e')](handleError(_0x200167,null));};exports[_0x7c4f('0xb3')]=function(_0xb7fc46,_0x11a595){var _0x3bf55e,_0x2461b5;return db[_0x7c4f('0x39')]['find']({'where':{'id':_0xb7fc46['params']['id']},'attributes':['id',_0x7c4f('0x34'),_0x7c4f('0x2a')]})[_0x7c4f('0x16')](handleEntityNotFound(_0x11a595,null))[_0x7c4f('0x16')](function(_0x300cc6){if(_0x300cc6){_0x3bf55e=_0x300cc6;if(!_0xb7fc46[_0x7c4f('0x42')][_0x7c4f('0xa1')]||!utils[_0x7c4f('0xa5')](_0xb7fc46['query'][_0x7c4f('0xa1')])){throw new db[(_0x7c4f('0x97'))][(_0x7c4f('0x94'))]('Unknown\x20channel');}return _0x300cc6[_0x7c4f('0xb4')+_[_0x7c4f('0xa8')](_0xb7fc46['query'][_0x7c4f('0xa1')][_0x7c4f('0xa9')]())+'Queues'](_0xb7fc46['query'][_0x7c4f('0x62')]);}})['then'](function(_0x59f246){if(_[_0x7c4f('0xb5')](_0xb7fc46[_0x7c4f('0x42')][_0x7c4f('0x62')])){for(var _0x2edfbe=0x0;_0x2edfbe<_0xb7fc46[_0x7c4f('0x42')][_0x7c4f('0x62')][_0x7c4f('0x49')];_0x2edfbe+=0x1){_0x2461b5={'UserId':Number(_0xb7fc46['params']['id'])};_0x2461b5[_[_0x7c4f('0xa8')](_0xb7fc46['query'][_0x7c4f('0xa1')][_0x7c4f('0xa9')]())+_0x7c4f('0xac')]=Number(_0xb7fc46['query'][_0x7c4f('0x62')][_0x2edfbe]);socket[_0x7c4f('0xb6')](_0x7c4f('0x81')+_['capitalize'](_0xb7fc46[_0x7c4f('0x42')][_0x7c4f('0xa1')][_0x7c4f('0xa9')]())+'Queue:remove',_0x2461b5);}}else{_0x2461b5={'UserId':Number(_0xb7fc46[_0x7c4f('0x54')]['id'])};_0x2461b5[_[_0x7c4f('0xa8')](_0xb7fc46[_0x7c4f('0x42')][_0x7c4f('0xa1')][_0x7c4f('0xa9')]())+_0x7c4f('0xac')]=Number(_0xb7fc46[_0x7c4f('0x42')]['ids']);socket[_0x7c4f('0xb6')](_0x7c4f('0x81')+_[_0x7c4f('0xa8')](_0xb7fc46['query'][_0x7c4f('0xa1')]['toLowerCase']())+_0x7c4f('0xb7'),_0x2461b5);}return _0x59f246;})['then'](function(){if(_0xb7fc46[_0x7c4f('0x42')]['channel']==='voice'){return db[_0x7c4f('0xb1')][_0x7c4f('0x29')]({'where':{'UserId':_0xb7fc46[_0x7c4f('0x54')]['id'],'VoiceQueueId':_0xb7fc46['query']['ids']},'individualHooks':!![]})['then'](function(){return _0x3bf55e;});}return _0x3bf55e;})[_0x7c4f('0x16')](respondWithStatusCode(_0x11a595,null))['catch'](handleError(_0x11a595,null));};exports[_0x7c4f('0xb8')]=function(_0x4eb2df,_0x4fad6e){_0x4eb2df[_0x7c4f('0x5e')][_0x7c4f('0xb9')]=_0x4eb2df[_0x7c4f('0xba')][_0x7c4f('0xbb')];return db[_0x7c4f('0x39')][_0x7c4f('0x5d')]({'where':{'id':_0x4eb2df['params']['id']}})['then'](handleEntityNotFound(_0x4fad6e,null))[_0x7c4f('0x16')](saveUpdates(_0x4eb2df['body'],null))['then'](respondWithResult(_0x4fad6e,null))[_0x7c4f('0x1e')](handleError(_0x4fad6e,null));};exports['getAvatar']=function(_0x5f0277,_0x20ac59){var _0x38e445=path['join'](config['root'],_0x7c4f('0xbc'));return db[_0x7c4f('0x39')][_0x7c4f('0x5d')]({'where':{'id':_0x5f0277['params']['id']},'attributes':['id',_0x7c4f('0xb9')],'raw':!![]})[_0x7c4f('0x16')](handleEntityNotFound(_0x20ac59,null))[_0x7c4f('0x16')](function(_0x58b7f8){if(_0x58b7f8){if(_[_0x7c4f('0x68')](_0x58b7f8['userpic'])){return _0x20ac59[_0x7c4f('0xbd')](_0x38e445);}else{if(!fs[_0x7c4f('0xbe')](path['join'](config['root'],_0x7c4f('0xbf'),_0x58b7f8['userpic']))){return _0x20ac59[_0x7c4f('0xbd')](_0x38e445);}return _0x20ac59[_0x7c4f('0xbd')](path[_0x7c4f('0xc0')](config[_0x7c4f('0xc1')],_0x7c4f('0xbf'),_0x58b7f8['userpic']));}}})[_0x7c4f('0x1e')](handleError(_0x20ac59,null));};exports['getOpenTabs']=function(_0x5c89e8,_0x382a1f){return db[_0x7c4f('0x39')][_0x7c4f('0x5d')]({'where':{'id':_0x5c89e8[_0x7c4f('0x54')]['id']},'attributes':['id']})[_0x7c4f('0x16')](handleEntityNotFound(_0x382a1f,null))[_0x7c4f('0x16')](function(_0x3fed7c){var _0x530bf3=[];values=_0x3fed7c[_0x7c4f('0x4d')];_0x530bf3['push'](get_open_tabs(_0x7c4f('0x4b'),_0x3fed7c['dataValues']));_0x530bf3[_0x7c4f('0x4a')](get_open_tabs(_0x7c4f('0x4c'),_0x3fed7c[_0x7c4f('0x4d')]));_0x530bf3[_0x7c4f('0x4a')](get_open_tabs('openchannel',_0x3fed7c[_0x7c4f('0x4d')]));_0x530bf3[_0x7c4f('0x4a')](get_open_tabs('whatsapp',_0x3fed7c['dataValues']));_0x530bf3[_0x7c4f('0x4a')](get_open_tabs(_0x7c4f('0x4e'),_0x3fed7c[_0x7c4f('0x4d')]));_0x530bf3[_0x7c4f('0x4a')](get_open_tabs(_0x7c4f('0x4f'),_0x3fed7c[_0x7c4f('0x4d')]));return BPromise['all'](_0x530bf3);})[_0x7c4f('0x16')](function(_0x3f29e7){if(_0x3f29e7){var _0x97b72f=_[_0x7c4f('0x31')](values['ChatOpenTabs'],function(_0x2a6d25){return{'channel':_0x7c4f('0xc2'),'id':_0x2a6d25['id'],'createdAt':_0x2a6d25[_0x7c4f('0xc3')]};});var _0x40f771=_[_0x7c4f('0x31')](values['FaxOpenTabs'],function(_0x27625a){return{'channel':_0x7c4f('0xc4'),'id':_0x27625a['id'],'createdAt':_0x27625a[_0x7c4f('0xc3')]};});var _0x511b4b=_[_0x7c4f('0x31')](values[_0x7c4f('0xc5')],function(_0x164006){return{'channel':'OPENCHANNEL','id':_0x164006['id'],'createdAt':_0x164006['createdAt']};});var _0x1595dd=_[_0x7c4f('0x31')](values[_0x7c4f('0xc6')],function(_0x52dde2){return{'channel':_0x7c4f('0xc7'),'id':_0x52dde2['id'],'createdAt':_0x52dde2[_0x7c4f('0xc3')]};});var _0x20616f=_[_0x7c4f('0x31')](values['SmsOpenTabs'],function(_0x1b4be6){return{'channel':_0x7c4f('0xc8'),'id':_0x1b4be6['id'],'createdAt':_0x1b4be6[_0x7c4f('0xc3')]};});var _0x1128d1=_[_0x7c4f('0x31')](values['WhatsappOpenTabs'],function(_0x2b35df){return{'channel':_0x7c4f('0xc9'),'id':_0x2b35df['id'],'createdAt':_0x2b35df['createdAt']};});var _0x19b501=_[_0x7c4f('0xca')](_0x97b72f,_0x40f771,_0x511b4b,_0x1595dd,_0x20616f,_0x1128d1);var _0x43ec53={'count':_0x19b501[_0x7c4f('0x49')],'rows':_0x19b501};return _0x43ec53;}else return null;})[_0x7c4f('0x16')](respondWithResult(_0x382a1f,null))[_0x7c4f('0x1e')](handleError(_0x382a1f,null));};exports['getContacts']=function(_0x542255,_0x1a84ad){var _0x1931d0={};var _0x538ff5={};var _0x4cb302;var _0xcbfae;return db['User'][_0x7c4f('0xcb')]({'where':{'id':_0x542255[_0x7c4f('0x54')]['id']}})[_0x7c4f('0x16')](handleEntityNotFound(_0x1a84ad,null))[_0x7c4f('0x16')](function(_0x28dc7c){if(_0x28dc7c){_0x4cb302=_0x28dc7c;_0x538ff5[_0x7c4f('0x55')]=_[_0x7c4f('0x57')](db['CmContact']['rawAttributes']);_0x538ff5['query']=_[_0x7c4f('0x57')](_0x542255[_0x7c4f('0x42')]);_0x538ff5[_0x7c4f('0x59')]=_[_0x7c4f('0x5a')](_0x538ff5[_0x7c4f('0x55')],_0x538ff5['query']);_0x1931d0[_0x7c4f('0x45')]=_[_0x7c4f('0x5a')](_0x538ff5['model'],qs['fields'](_0x542255[_0x7c4f('0x42')][_0x7c4f('0x5b')]));_0x1931d0['attributes']=_0x1931d0[_0x7c4f('0x45')][_0x7c4f('0x49')]?_0x1931d0[_0x7c4f('0x45')]:_0x538ff5[_0x7c4f('0x55')];_0x1931d0[_0x7c4f('0xcc')]=qs['sort'](_0x542255[_0x7c4f('0x42')][_0x7c4f('0xcd')]);_0x1931d0[_0x7c4f('0x3f')]=qs['filters'](_[_0x7c4f('0xce')](_0x542255['query'],_0x538ff5['filters']));if(_0x542255['query'][_0x7c4f('0x30')]){_0x1931d0[_0x7c4f('0x3f')]=_[_0x7c4f('0x5c')](_0x1931d0['where'],{'$or':_[_0x7c4f('0x31')](_0x1931d0[_0x7c4f('0x45')],function(_0x55abdc){var _0x2f706f={};_0x2f706f[_0x55abdc]={'$like':'%'+_0x542255['query'][_0x7c4f('0x30')]+'%'};return _0x2f706f;})});}_0x1931d0=_[_0x7c4f('0x5c')]({},_0x1931d0,_0x542255['options']);return _0x4cb302[_0x7c4f('0xcf')](_0x1931d0);}})[_0x7c4f('0x16')](function(_0x7b27a1){if(_0x7b27a1){_0xcbfae=_0x7b27a1[_0x7c4f('0x49')];if(_0x542255[_0x7c4f('0x42')][_0x7c4f('0xd0')]('includeAll')){_0x1931d0[_0x7c4f('0x41')]=[{'model':db['CmList'],'as':_0x7c4f('0xd1'),'required':![]},{'model':db[_0x7c4f('0xd2')],'as':'Tags','attributes':['id',_0x7c4f('0x34'),_0x7c4f('0xd3')],'where':_0x542255['query'][_0x7c4f('0xd4')]?{'id':_0x542255[_0x7c4f('0x42')][_0x7c4f('0xd4')]}:undefined,'required':_0x542255[_0x7c4f('0x42')][_0x7c4f('0xd4')]?!![]:![]}];}if(!_0x542255[_0x7c4f('0x42')][_0x7c4f('0xd0')](_0x7c4f('0xd5'))){_0x1931d0['limit']=qs[_0x7c4f('0x24')](_0x542255[_0x7c4f('0x42')]['limit']);_0x1931d0[_0x7c4f('0x21')]=qs[_0x7c4f('0x21')](_0x542255['query'][_0x7c4f('0x21')]);}return _0x4cb302[_0x7c4f('0xcf')](_0x1931d0);}})[_0x7c4f('0x16')](function(_0x387440){if(_0x387440){return _0x387440?{'count':_0xcbfae,'rows':_0x387440}:null;}})['then'](respondWithResult(_0x1a84ad,null))['catch'](handleError(_0x1a84ad,null));};exports[_0x7c4f('0xd6')]=function(_0x5c6964,_0x5870b3){var _0x2f2743;var _0x585312={};var _0x77b6ab;return db['User'][_0x7c4f('0xcb')]({'where':{'id':_0x5c6964[_0x7c4f('0x54')]['id']},'attributes':['id','name',_0x7c4f('0x2a')]})[_0x7c4f('0x16')](handleEntityNotFound(_0x5870b3,null))['then'](function(_0x1abc1b){if(!utils[_0x7c4f('0xa5')](_0x5c6964[_0x7c4f('0x42')][_0x7c4f('0xa1')])){throw new db[(_0x7c4f('0x97'))][(_0x7c4f('0x94'))](_0x7c4f('0xa6'));}_0x2f2743=_0x1abc1b;var _0x53a727={};_0x53a727['model']=_[_0x7c4f('0x57')](db[_[_0x7c4f('0xa8')](_0x5c6964['query']['channel'])+_0x7c4f('0xd7')][_0x7c4f('0x3a')]);_0x53a727['query']=_[_0x7c4f('0x57')](_0x5c6964['query']);_0x53a727[_0x7c4f('0x59')]=_[_0x7c4f('0x5a')](_0x53a727[_0x7c4f('0x55')],_0x53a727['query']);_0x585312[_0x7c4f('0x45')]=_[_0x7c4f('0x5a')](_0x53a727[_0x7c4f('0x55')],qs['fields'](_0x5c6964[_0x7c4f('0x42')][_0x7c4f('0x5b')]));_0x585312[_0x7c4f('0x45')]=_0x585312[_0x7c4f('0x45')][_0x7c4f('0x49')]?_0x585312['attributes']:_0x53a727[_0x7c4f('0x55')];_0x585312[_0x7c4f('0xcc')]=qs['sort'](_0x5c6964[_0x7c4f('0x42')][_0x7c4f('0xcd')]);_0x585312[_0x7c4f('0x3f')]=qs[_0x7c4f('0x59')](_[_0x7c4f('0xce')](_0x5c6964['query'],_0x53a727[_0x7c4f('0x59')]));if(_0x5c6964[_0x7c4f('0x42')][_0x7c4f('0x30')]){_0x585312[_0x7c4f('0x3f')]=_['merge'](_0x585312[_0x7c4f('0x3f')],{'$or':_[_0x7c4f('0x31')](_0x585312[_0x7c4f('0x45')],function(_0x7211d){var _0x2afdbe={};_0x2afdbe[_0x7211d]={'$like':'%'+_0x5c6964[_0x7c4f('0x42')][_0x7c4f('0x30')]+'%'};return _0x2afdbe;})});}_0x585312=_[_0x7c4f('0x5c')]({},_0x585312,_0x5c6964[_0x7c4f('0xd8')]);switch(_0x2f2743[_0x7c4f('0x2a')]){case _0x7c4f('0x2b'):return db[_[_0x7c4f('0xa8')](_0x5c6964[_0x7c4f('0x42')][_0x7c4f('0xa1')])+'Queue']['findAll'](_0x585312);case'user':case _0x7c4f('0x2d'):return _0x2f2743[_0x7c4f('0xaf')+_[_0x7c4f('0xa8')](_0x5c6964[_0x7c4f('0x42')][_0x7c4f('0xa1')])+'Queues'](_0x585312);default:throw new db[(_0x7c4f('0x97'))][(_0x7c4f('0x94'))]('Unknown\x20role');}})[_0x7c4f('0x16')](function(_0x2407d2){_0x77b6ab=_0x2407d2[_0x7c4f('0x49')];if(!_0x5c6964['query'][_0x7c4f('0xd0')]('nolimit')){_0x585312[_0x7c4f('0x24')]=qs[_0x7c4f('0x24')](_0x5c6964['query'][_0x7c4f('0x24')]);_0x585312[_0x7c4f('0x21')]=qs[_0x7c4f('0x21')](_0x5c6964[_0x7c4f('0x42')][_0x7c4f('0x21')]);}switch(_0x2f2743[_0x7c4f('0x2a')]){case _0x7c4f('0x2b'):return db[_['capitalize'](_0x5c6964[_0x7c4f('0x42')][_0x7c4f('0xa1')])+'Queue'][_0x7c4f('0x46')](_0x585312);case _0x7c4f('0x81'):case _0x7c4f('0x2d'):return _0x2f2743[_0x7c4f('0xaf')+_[_0x7c4f('0xa8')](_0x5c6964[_0x7c4f('0x42')][_0x7c4f('0xa1')])+_0x7c4f('0xaa')](_0x585312);}})[_0x7c4f('0x16')](function(_0x5d652){return{'count':_0x77b6ab,'rows':_0x5d652};})[_0x7c4f('0x16')](respondWithResult(_0x5870b3,null))[_0x7c4f('0x1e')](handleError(_0x5870b3,null));};exports[_0x7c4f('0xd9')]=function(_0x283a21,_0x220730){var _0x2dc875={};var _0x59ae13={};var _0x37a1dd;var _0x544aff;return db[_0x7c4f('0x39')][_0x7c4f('0xcb')]({'where':{'id':_0x283a21[_0x7c4f('0x54')]['id']}})[_0x7c4f('0x16')](handleEntityNotFound(_0x220730,null))[_0x7c4f('0x16')](function(_0x112256){if(_0x112256){_0x37a1dd=_0x112256;_0x59ae13['model']=_[_0x7c4f('0x57')](db[_0x7c4f('0xb1')][_0x7c4f('0x3a')]);_0x59ae13[_0x7c4f('0x42')]=_['keys'](_0x283a21[_0x7c4f('0x42')]);_0x59ae13[_0x7c4f('0x59')]=_[_0x7c4f('0x5a')](_0x59ae13[_0x7c4f('0x55')],_0x59ae13[_0x7c4f('0x42')]);_0x2dc875[_0x7c4f('0x45')]=_[_0x7c4f('0x5a')](_0x59ae13[_0x7c4f('0x55')],qs[_0x7c4f('0x5b')](_0x283a21['query'][_0x7c4f('0x5b')]));_0x2dc875[_0x7c4f('0x45')]=_0x2dc875[_0x7c4f('0x45')][_0x7c4f('0x49')]?_0x2dc875['attributes']:_0x59ae13[_0x7c4f('0x55')];_0x2dc875[_0x7c4f('0xcc')]=qs[_0x7c4f('0xcd')](_0x283a21['query'][_0x7c4f('0xcd')]);_0x2dc875['where']=qs['filters'](_['pick'](_0x283a21['query'],_0x59ae13['filters']));if(_0x283a21['query'][_0x7c4f('0x30')]){_0x2dc875[_0x7c4f('0x3f')]=_[_0x7c4f('0x5c')](_0x2dc875[_0x7c4f('0x3f')],{'$or':_['map'](_0x2dc875[_0x7c4f('0x45')],function(_0x3eda42){var _0x440dab={};_0x440dab[_0x3eda42]={'$like':'%'+_0x283a21['query'][_0x7c4f('0x30')]+'%'};return _0x440dab;})});}_0x2dc875=_[_0x7c4f('0x5c')]({},_0x2dc875,_0x283a21['options']);return _0x37a1dd[_0x7c4f('0xd9')](_0x2dc875);}})[_0x7c4f('0x16')](function(_0x32ecfe){if(_0x32ecfe){_0x544aff=_0x32ecfe[_0x7c4f('0x49')];if(!_0x283a21[_0x7c4f('0x42')][_0x7c4f('0xd0')](_0x7c4f('0xd5'))){_0x2dc875[_0x7c4f('0x24')]=qs[_0x7c4f('0x24')](_0x283a21[_0x7c4f('0x42')][_0x7c4f('0x24')]);_0x2dc875[_0x7c4f('0x21')]=qs['offset'](_0x283a21[_0x7c4f('0x42')]['offset']);}return _0x37a1dd['getVoiceQueuesRt'](_0x2dc875);}})[_0x7c4f('0x16')](function(_0xcabcb1){if(_0xcabcb1){return _0xcabcb1?{'count':_0x544aff,'rows':_0xcabcb1}:null;}})['then'](respondWithResult(_0x220730,null))['catch'](handleError(_0x220730,null));};exports[_0x7c4f('0xda')]=function(_0x3fbcef,_0x9c2bd8){var _0x39dad8={};var _0x1d447d={};var _0x265c25;var _0x10a886;return db['User']['findOne']({'where':{'id':_0x3fbcef[_0x7c4f('0x54')]['id']}})['then'](handleEntityNotFound(_0x9c2bd8,null))['then'](function(_0x13a46e){if(_0x13a46e){_0x265c25=_0x13a46e;_0x1d447d['model']=_['keys'](db[_0x7c4f('0xdb')][_0x7c4f('0x3a')]);_0x1d447d['query']=_[_0x7c4f('0x57')](_0x3fbcef[_0x7c4f('0x42')]);_0x1d447d['filters']=_[_0x7c4f('0x5a')](_0x1d447d[_0x7c4f('0x55')],_0x1d447d[_0x7c4f('0x42')]);_0x39dad8[_0x7c4f('0x45')]=_[_0x7c4f('0x5a')](_0x1d447d['model'],qs[_0x7c4f('0x5b')](_0x3fbcef[_0x7c4f('0x42')][_0x7c4f('0x5b')]));_0x39dad8['attributes']=_0x39dad8['attributes']['length']?_0x39dad8[_0x7c4f('0x45')]:_0x1d447d['model'];_0x39dad8[_0x7c4f('0xcc')]=qs[_0x7c4f('0xcd')](_0x3fbcef['query'][_0x7c4f('0xcd')]);_0x39dad8[_0x7c4f('0x3f')]=qs[_0x7c4f('0x59')](_[_0x7c4f('0xce')](_0x3fbcef[_0x7c4f('0x42')],_0x1d447d[_0x7c4f('0x59')]));if(_0x3fbcef['query'][_0x7c4f('0x30')]){_0x39dad8[_0x7c4f('0x3f')]=_[_0x7c4f('0x5c')](_0x39dad8[_0x7c4f('0x3f')],{'$or':_[_0x7c4f('0x31')](_0x39dad8[_0x7c4f('0x45')],function(_0x3fb0ca){var _0xa48ff8={};_0xa48ff8[_0x3fb0ca]={'$like':'%'+_0x3fbcef[_0x7c4f('0x42')]['filter']+'%'};return _0xa48ff8;})});}_0x39dad8=_[_0x7c4f('0x5c')]({},_0x39dad8,_0x3fbcef[_0x7c4f('0xd8')]);return _0x265c25[_0x7c4f('0xda')](_0x39dad8);}})[_0x7c4f('0x16')](function(_0x2ff21e){if(_0x2ff21e){_0x10a886=_0x2ff21e['length'];if(!_0x3fbcef[_0x7c4f('0x42')]['hasOwnProperty'](_0x7c4f('0xd5'))){_0x39dad8['limit']=qs[_0x7c4f('0x24')](_0x3fbcef[_0x7c4f('0x42')]['limit']);_0x39dad8[_0x7c4f('0x21')]=qs['offset'](_0x3fbcef['query']['offset']);}return _0x265c25[_0x7c4f('0xda')](_0x39dad8);}})[_0x7c4f('0x16')](function(_0x51e29e){if(_0x51e29e){return _0x51e29e?{'count':_0x10a886,'rows':_0x51e29e}:null;}})[_0x7c4f('0x16')](respondWithResult(_0x9c2bd8,null))[_0x7c4f('0x1e')](handleError(_0x9c2bd8,null));};exports['getRecordings']=function(_0xa0fefb,_0x3334a7){var _0x5ac85a={'raw':!![],'where':{}};var _0x3e1a08={};var _0x38761b={'count':0x0,'rows':[]};return db[_0x7c4f('0x39')][_0x7c4f('0xcb')]({'where':{'id':_0xa0fefb[_0x7c4f('0x54')]['id']}})[_0x7c4f('0x16')](handleEntityNotFound(_0x3334a7,null))[_0x7c4f('0x16')](function(_0x4beb19){if(_0x4beb19){_0x3e1a08['model']=_[_0x7c4f('0x57')](db['VoiceRecording'][_0x7c4f('0x3a')]);_0x3e1a08['query']=_[_0x7c4f('0x57')](_0xa0fefb[_0x7c4f('0x42')]);_0x3e1a08[_0x7c4f('0x59')]=_['intersection'](_0x3e1a08['model'],_0x3e1a08[_0x7c4f('0x42')]);_0x5ac85a['attributes']=_['intersection'](_0x3e1a08[_0x7c4f('0x55')],qs['fields'](_0xa0fefb[_0x7c4f('0x42')][_0x7c4f('0x5b')]));_0x5ac85a[_0x7c4f('0x45')]=_0x5ac85a[_0x7c4f('0x45')][_0x7c4f('0x49')]?_0x5ac85a['attributes']:_0x3e1a08['model'];if(!_0xa0fefb[_0x7c4f('0x42')]['hasOwnProperty'](_0x7c4f('0xd5'))){_0x5ac85a[_0x7c4f('0x24')]=qs['limit'](_0xa0fefb[_0x7c4f('0x42')][_0x7c4f('0x24')]);_0x5ac85a[_0x7c4f('0x21')]=qs['offset'](_0xa0fefb[_0x7c4f('0x42')][_0x7c4f('0x21')]);}_0x5ac85a[_0x7c4f('0xcc')]=qs[_0x7c4f('0xcd')](_0xa0fefb['query'][_0x7c4f('0xcd')]);_0x5ac85a[_0x7c4f('0x3f')]=qs[_0x7c4f('0x59')](_[_0x7c4f('0xce')](_0xa0fefb[_0x7c4f('0x42')],_0x3e1a08[_0x7c4f('0x59')]));_0x5ac85a[_0x7c4f('0x3f')][_0x7c4f('0xdc')]=_0x4beb19['id'];if(_0xa0fefb[_0x7c4f('0x42')][_0x7c4f('0x30')]){_0x5ac85a[_0x7c4f('0x3f')]=_[_0x7c4f('0x5c')](_0x5ac85a[_0x7c4f('0x3f')],{'$or':_['map'](_0x5ac85a[_0x7c4f('0x45')],function(_0x24862e){var _0x36cd15={};_0x36cd15[_0x24862e]={'$like':'%'+_0xa0fefb[_0x7c4f('0x42')][_0x7c4f('0x30')]+'%'};return _0x36cd15;})});}_0x5ac85a=_[_0x7c4f('0x5c')]({},_0x5ac85a,_0xa0fefb[_0x7c4f('0xd8')]);return db[_0x7c4f('0xdd')]['count']({'where':_0x5ac85a['where']})['then'](function(_0x242f5b){_0x38761b['count']=_0x242f5b;if(_0xa0fefb[_0x7c4f('0x42')][_0x7c4f('0x40')]){_0x5ac85a[_0x7c4f('0x41')]=[{'all':!![]}];}return db['VoiceRecording'][_0x7c4f('0x46')](_0x5ac85a);})[_0x7c4f('0x16')](function(_0xa10bf7){_0x38761b['rows']=_0xa10bf7;return _0x38761b;});}})[_0x7c4f('0x16')](respondWithFilteredResult(_0x3334a7,_0x5ac85a))[_0x7c4f('0x1e')](handleError(_0x3334a7,null));};exports[_0x7c4f('0xde')]=function(_0x5e4a1b,_0x2cbbcb){var _0x358c1a={'raw':!![],'where':{}};var _0x2d8332={};var _0x528655={'count':0x0,'rows':[]};return db[_0x7c4f('0x39')]['findOne']({'where':{'id':_0x5e4a1b[_0x7c4f('0x54')]['id']}})['then'](handleEntityNotFound(_0x2cbbcb,null))[_0x7c4f('0x16')](function(_0x4755d8){if(_0x4755d8){_0x2d8332[_0x7c4f('0x55')]=_[_0x7c4f('0x57')](db[_0x7c4f('0xdf')][_0x7c4f('0x3a')]);_0x2d8332[_0x7c4f('0x42')]=_[_0x7c4f('0x57')](_0x5e4a1b[_0x7c4f('0x42')]);_0x2d8332[_0x7c4f('0x59')]=_['intersection'](_0x2d8332[_0x7c4f('0x55')],_0x2d8332[_0x7c4f('0x42')]);_0x358c1a['attributes']=_[_0x7c4f('0x5a')](_0x2d8332['model'],qs['fields'](_0x5e4a1b[_0x7c4f('0x42')]['fields']));_0x358c1a[_0x7c4f('0x45')]=_0x358c1a[_0x7c4f('0x45')]['length']?_0x358c1a['attributes']:_0x2d8332[_0x7c4f('0x55')];if(!_0x5e4a1b['query'][_0x7c4f('0xd0')](_0x7c4f('0xd5'))){_0x358c1a[_0x7c4f('0x24')]=qs[_0x7c4f('0x24')](_0x5e4a1b[_0x7c4f('0x42')][_0x7c4f('0x24')]);_0x358c1a[_0x7c4f('0x21')]=qs[_0x7c4f('0x21')](_0x5e4a1b[_0x7c4f('0x42')][_0x7c4f('0x21')]);}_0x358c1a[_0x7c4f('0xcc')]=qs[_0x7c4f('0xcd')](_0x5e4a1b[_0x7c4f('0x42')]['sort']);_0x358c1a[_0x7c4f('0x3f')]=qs[_0x7c4f('0x59')](_[_0x7c4f('0xce')](_0x5e4a1b[_0x7c4f('0x42')],_0x2d8332[_0x7c4f('0x59')]));_0x358c1a[_0x7c4f('0x3f')]['UserId']=_0x4755d8['id'];if(_0x5e4a1b[_0x7c4f('0x42')][_0x7c4f('0x30')]){_0x358c1a[_0x7c4f('0x3f')]=_[_0x7c4f('0x5c')](_0x358c1a[_0x7c4f('0x3f')],{'$or':_[_0x7c4f('0x31')](_0x358c1a['attributes'],function(_0x26a2a9){var _0x2ccfdb={};_0x2ccfdb[_0x26a2a9]={'$like':'%'+_0x5e4a1b[_0x7c4f('0x42')][_0x7c4f('0x30')]+'%'};return _0x2ccfdb;})});}_0x358c1a=_[_0x7c4f('0x5c')]({},_0x358c1a,_0x5e4a1b['options']);return db[_0x7c4f('0xdf')]['count']({'where':_0x358c1a[_0x7c4f('0x3f')]})[_0x7c4f('0x16')](function(_0x5343b4){_0x528655[_0x7c4f('0x23')]=_0x5343b4;if(_0x5e4a1b['query'][_0x7c4f('0x40')]){_0x358c1a[_0x7c4f('0x41')]=[{'all':!![]}];}return db[_0x7c4f('0xdf')][_0x7c4f('0x46')](_0x358c1a);})[_0x7c4f('0x16')](function(_0x502872){_0x528655[_0x7c4f('0x47')]=_0x502872;return _0x528655;});}})[_0x7c4f('0x16')](respondWithFilteredResult(_0x2cbbcb,_0x358c1a))['catch'](handleError(_0x2cbbcb,null));};exports[_0x7c4f('0xe0')]=function(_0x1cde2f,_0x472303){var _0x5caca7={};var _0xbdef90={};var _0x2ebc7a;var _0x5693f2;return db[_0x7c4f('0x39')][_0x7c4f('0xcb')]({'where':{'id':_0x1cde2f[_0x7c4f('0x54')]['id']}})['then'](handleEntityNotFound(_0x472303,null))[_0x7c4f('0x16')](function(_0x4e7f59){if(_0x4e7f59){_0x2ebc7a=_0x4e7f59;_0xbdef90[_0x7c4f('0x55')]=_[_0x7c4f('0x57')](db[_0x7c4f('0xe1')]['rawAttributes']);_0xbdef90['query']=_[_0x7c4f('0x57')](_0x1cde2f[_0x7c4f('0x42')]);_0xbdef90[_0x7c4f('0x59')]=_['intersection'](_0xbdef90[_0x7c4f('0x55')],_0xbdef90[_0x7c4f('0x42')]);_0x5caca7[_0x7c4f('0x45')]=_[_0x7c4f('0x5a')](_0xbdef90[_0x7c4f('0x55')],qs[_0x7c4f('0x5b')](_0x1cde2f[_0x7c4f('0x42')][_0x7c4f('0x5b')]));_0x5caca7['attributes']=_0x5caca7[_0x7c4f('0x45')][_0x7c4f('0x49')]?_0x5caca7[_0x7c4f('0x45')]:_0xbdef90[_0x7c4f('0x55')];_0x5caca7[_0x7c4f('0xcc')]=qs['sort'](_0x1cde2f[_0x7c4f('0x42')]['sort']);_0x5caca7[_0x7c4f('0x3f')]=qs['filters'](_[_0x7c4f('0xce')](_0x1cde2f[_0x7c4f('0x42')],_0xbdef90[_0x7c4f('0x59')]));if(_0x1cde2f[_0x7c4f('0x42')][_0x7c4f('0x30')]){_0x5caca7['where']=_[_0x7c4f('0x5c')](_0x5caca7['where'],{'$or':_[_0x7c4f('0x31')](_0x5caca7[_0x7c4f('0x45')],function(_0x1c86a1){var _0x2524bc={};_0x2524bc[_0x1c86a1]={'$like':'%'+_0x1cde2f[_0x7c4f('0x42')][_0x7c4f('0x30')]+'%'};return _0x2524bc;})});}_0x5caca7=_['merge']({},_0x5caca7,_0x1cde2f[_0x7c4f('0xd8')]);return _0x2ebc7a[_0x7c4f('0xe0')](_0x5caca7);}})[_0x7c4f('0x16')](function(_0x282bfe){if(_0x282bfe){_0x5693f2=_0x282bfe[_0x7c4f('0x49')];if(!_0x1cde2f[_0x7c4f('0x42')][_0x7c4f('0xd0')](_0x7c4f('0xd5'))){_0x5caca7[_0x7c4f('0x24')]=qs['limit'](_0x1cde2f[_0x7c4f('0x42')]['limit']);_0x5caca7[_0x7c4f('0x21')]=qs[_0x7c4f('0x21')](_0x1cde2f[_0x7c4f('0x42')][_0x7c4f('0x21')]);}return _0x2ebc7a[_0x7c4f('0xe0')](_0x5caca7);}})['then'](function(_0x3c5ded){if(_0x3c5ded){return _0x3c5ded?{'count':_0x5693f2,'rows':_0x3c5ded}:null;}})['then'](respondWithResult(_0x472303,null))[_0x7c4f('0x1e')](handleError(_0x472303,null));};exports[_0x7c4f('0xe2')]=function(_0x2797a0,_0x322cc2){var _0x214996={};var _0x54ef52={};var _0x3aa0db;var _0x476e1c;return db['User'][_0x7c4f('0xcb')]({'where':{'id':_0x2797a0[_0x7c4f('0x54')]['id']}})[_0x7c4f('0x16')](handleEntityNotFound(_0x322cc2,null))[_0x7c4f('0x16')](function(_0x3a3ca2){if(_0x3a3ca2){_0x3aa0db=_0x3a3ca2;_0x54ef52[_0x7c4f('0x55')]=_['keys'](db['OpenchannelInteraction']['rawAttributes']);_0x54ef52['query']=_['keys'](_0x2797a0[_0x7c4f('0x42')]);_0x54ef52[_0x7c4f('0x59')]=_[_0x7c4f('0x5a')](_0x54ef52[_0x7c4f('0x55')],_0x54ef52[_0x7c4f('0x42')]);_0x214996[_0x7c4f('0x45')]=_['intersection'](_0x54ef52[_0x7c4f('0x55')],qs['fields'](_0x2797a0[_0x7c4f('0x42')][_0x7c4f('0x5b')]));_0x214996[_0x7c4f('0x45')]=_0x214996[_0x7c4f('0x45')]['length']?_0x214996['attributes']:_0x54ef52[_0x7c4f('0x55')];_0x214996[_0x7c4f('0xcc')]=qs[_0x7c4f('0xcd')](_0x2797a0[_0x7c4f('0x42')]['sort']);_0x214996[_0x7c4f('0x3f')]=qs[_0x7c4f('0x59')](_[_0x7c4f('0xce')](_0x2797a0[_0x7c4f('0x42')],_0x54ef52[_0x7c4f('0x59')]));if(_0x2797a0[_0x7c4f('0x42')][_0x7c4f('0x30')]){_0x214996[_0x7c4f('0x3f')]=_[_0x7c4f('0x5c')](_0x214996['where'],{'$or':_[_0x7c4f('0x31')](_0x214996[_0x7c4f('0x45')],function(_0x547d32){var _0x20f367={};_0x20f367[_0x547d32]={'$like':'%'+_0x2797a0[_0x7c4f('0x42')]['filter']+'%'};return _0x20f367;})});}_0x214996=_[_0x7c4f('0x5c')]({},_0x214996,_0x2797a0['options']);return _0x3aa0db[_0x7c4f('0xe2')](_0x214996);}})[_0x7c4f('0x16')](function(_0x1568f9){if(_0x1568f9){_0x476e1c=_0x1568f9[_0x7c4f('0x49')];if(!_0x2797a0['query'][_0x7c4f('0xd0')](_0x7c4f('0xd5'))){_0x214996[_0x7c4f('0x24')]=qs[_0x7c4f('0x24')](_0x2797a0[_0x7c4f('0x42')][_0x7c4f('0x24')]);_0x214996[_0x7c4f('0x21')]=qs['offset'](_0x2797a0['query'][_0x7c4f('0x21')]);}return _0x3aa0db[_0x7c4f('0xe2')](_0x214996);}})[_0x7c4f('0x16')](function(_0x5bc5ce){if(_0x5bc5ce){return _0x5bc5ce?{'count':_0x476e1c,'rows':_0x5bc5ce}:null;}})[_0x7c4f('0x16')](respondWithResult(_0x322cc2,null))[_0x7c4f('0x1e')](handleError(_0x322cc2,null));};exports[_0x7c4f('0xe3')]=function(_0x197574,_0x19b8e0){var _0x5caaa1={'raw':!![],'where':{}};var _0x5e4ee0={};var _0xa3cdab={'count':0x0,'rows':[]};return db[_0x7c4f('0x39')][_0x7c4f('0xcb')]({'where':{'id':_0x197574[_0x7c4f('0x54')]['id']}})[_0x7c4f('0x16')](handleEntityNotFound(_0x19b8e0,null))[_0x7c4f('0x16')](function(_0x359e01){if(_0x359e01){_0x5e4ee0['model']=_[_0x7c4f('0x57')](db['MailInteraction'][_0x7c4f('0x3a')]);_0x5e4ee0[_0x7c4f('0x42')]=_[_0x7c4f('0x57')](_0x197574[_0x7c4f('0x42')]);_0x5e4ee0[_0x7c4f('0x59')]=_[_0x7c4f('0x5a')](_0x5e4ee0[_0x7c4f('0x55')],_0x5e4ee0[_0x7c4f('0x42')]);_0x5caaa1[_0x7c4f('0x45')]=_['intersection'](_0x5e4ee0[_0x7c4f('0x55')],qs[_0x7c4f('0x5b')](_0x197574[_0x7c4f('0x42')][_0x7c4f('0x5b')]));_0x5caaa1[_0x7c4f('0x45')]=_0x5caaa1['attributes'][_0x7c4f('0x49')]?_0x5caaa1[_0x7c4f('0x45')]:_0x5e4ee0[_0x7c4f('0x55')];if(!_0x197574['query'][_0x7c4f('0xd0')](_0x7c4f('0xd5'))){_0x5caaa1[_0x7c4f('0x24')]=qs[_0x7c4f('0x24')](_0x197574[_0x7c4f('0x42')][_0x7c4f('0x24')]);_0x5caaa1[_0x7c4f('0x21')]=qs[_0x7c4f('0x21')](_0x197574[_0x7c4f('0x42')]['offset']);}_0x5caaa1[_0x7c4f('0xcc')]=qs[_0x7c4f('0xcd')](_0x197574[_0x7c4f('0x42')]['sort']);_0x5caaa1[_0x7c4f('0x3f')]=qs[_0x7c4f('0x59')](_[_0x7c4f('0xce')](_0x197574[_0x7c4f('0x42')],_0x5e4ee0['filters']));_0x5caaa1[_0x7c4f('0x3f')]['UserId']=_0x359e01['id'];if(_0x197574['query']['filter']){_0x5caaa1[_0x7c4f('0x3f')]=_['merge'](_0x5caaa1[_0x7c4f('0x3f')],{'$or':_[_0x7c4f('0x31')](_0x5caaa1[_0x7c4f('0x45')],function(_0x462ac0){var _0x260ff0={};_0x260ff0[_0x462ac0]={'$like':'%'+_0x197574[_0x7c4f('0x42')][_0x7c4f('0x30')]+'%'};return _0x260ff0;})});}_0x5caaa1=_[_0x7c4f('0x5c')]({},_0x5caaa1,_0x197574['options']);return db[_0x7c4f('0xe4')][_0x7c4f('0x23')]({'where':_0x5caaa1[_0x7c4f('0x3f')]})['then'](function(_0x5856f1){_0xa3cdab[_0x7c4f('0x23')]=_0x5856f1;if(_0x197574['query'][_0x7c4f('0x40')]){_0x5caaa1[_0x7c4f('0x41')]=[{'all':!![]}];}return db[_0x7c4f('0xe4')]['findAll'](_0x5caaa1);})['then'](function(_0x291046){_0xa3cdab[_0x7c4f('0x47')]=_0x291046;return _0xa3cdab;});}})[_0x7c4f('0x16')](respondWithFilteredResult(_0x19b8e0,_0x5caaa1))[_0x7c4f('0x1e')](handleError(_0x19b8e0,null));};exports[_0x7c4f('0xe5')]=function(_0x5e7345,_0x512c8b){var _0x1b4ffc={};var _0x3656e6={};var _0x350911;var _0x14aba1;return db[_0x7c4f('0x39')]['findOne']({'where':{'id':_0x5e7345[_0x7c4f('0x54')]['id']}})['then'](handleEntityNotFound(_0x512c8b,null))[_0x7c4f('0x16')](function(_0x50f518){if(_0x50f518){_0x350911=_0x50f518;_0x3656e6[_0x7c4f('0x55')]=_[_0x7c4f('0x57')](db[_0x7c4f('0xe6')][_0x7c4f('0x3a')]);_0x3656e6[_0x7c4f('0x42')]=_[_0x7c4f('0x57')](_0x5e7345[_0x7c4f('0x42')]);_0x3656e6[_0x7c4f('0x59')]=_[_0x7c4f('0x5a')](_0x3656e6[_0x7c4f('0x55')],_0x3656e6[_0x7c4f('0x42')]);_0x1b4ffc[_0x7c4f('0x45')]=_[_0x7c4f('0x5a')](_0x3656e6[_0x7c4f('0x55')],qs[_0x7c4f('0x5b')](_0x5e7345[_0x7c4f('0x42')][_0x7c4f('0x5b')]));_0x1b4ffc['attributes']=_0x1b4ffc['attributes'][_0x7c4f('0x49')]?_0x1b4ffc[_0x7c4f('0x45')]:_0x3656e6[_0x7c4f('0x55')];_0x1b4ffc['order']=qs[_0x7c4f('0xcd')](_0x5e7345[_0x7c4f('0x42')][_0x7c4f('0xcd')]);_0x1b4ffc[_0x7c4f('0x3f')]=qs[_0x7c4f('0x59')](_['pick'](_0x5e7345[_0x7c4f('0x42')],_0x3656e6[_0x7c4f('0x59')]));if(_0x5e7345[_0x7c4f('0x42')]['filter']){_0x1b4ffc['where']=_[_0x7c4f('0x5c')](_0x1b4ffc[_0x7c4f('0x3f')],{'$or':_[_0x7c4f('0x31')](_0x1b4ffc['attributes'],function(_0x5853c1){var _0x3f7327={};_0x3f7327[_0x5853c1]={'$like':'%'+_0x5e7345[_0x7c4f('0x42')][_0x7c4f('0x30')]+'%'};return _0x3f7327;})});}_0x1b4ffc=_[_0x7c4f('0x5c')]({},_0x1b4ffc,_0x5e7345[_0x7c4f('0xd8')]);return _0x350911[_0x7c4f('0xe5')](_0x1b4ffc);}})[_0x7c4f('0x16')](function(_0x387526){if(_0x387526){_0x14aba1=_0x387526[_0x7c4f('0x49')];if(!_0x5e7345['query']['hasOwnProperty']('nolimit')){_0x1b4ffc[_0x7c4f('0x24')]=qs[_0x7c4f('0x24')](_0x5e7345[_0x7c4f('0x42')][_0x7c4f('0x24')]);_0x1b4ffc[_0x7c4f('0x21')]=qs['offset'](_0x5e7345[_0x7c4f('0x42')]['offset']);}return _0x350911[_0x7c4f('0xe5')](_0x1b4ffc);}})[_0x7c4f('0x16')](function(_0x1f9c25){if(_0x1f9c25){return _0x1f9c25?{'count':_0x14aba1,'rows':_0x1f9c25}:null;}})['then'](respondWithResult(_0x512c8b,null))[_0x7c4f('0x1e')](handleError(_0x512c8b,null));};exports[_0x7c4f('0xe7')]=function(_0x4b540f,_0x32d4b1){var _0x261874={};var _0x1079f4={};var _0x2da286;var _0x31a171;return db[_0x7c4f('0x39')][_0x7c4f('0xcb')]({'where':{'id':_0x4b540f['params']['id']}})[_0x7c4f('0x16')](handleEntityNotFound(_0x32d4b1,null))[_0x7c4f('0x16')](function(_0x6d2c47){if(_0x6d2c47){_0x2da286=_0x6d2c47;_0x1079f4[_0x7c4f('0x55')]=_[_0x7c4f('0x57')](db[_0x7c4f('0xe8')][_0x7c4f('0x3a')]);_0x1079f4['query']=_[_0x7c4f('0x57')](_0x4b540f[_0x7c4f('0x42')]);_0x1079f4[_0x7c4f('0x59')]=_[_0x7c4f('0x5a')](_0x1079f4['model'],_0x1079f4[_0x7c4f('0x42')]);_0x261874[_0x7c4f('0x45')]=_[_0x7c4f('0x5a')](_0x1079f4[_0x7c4f('0x55')],qs[_0x7c4f('0x5b')](_0x4b540f[_0x7c4f('0x42')][_0x7c4f('0x5b')]));_0x261874[_0x7c4f('0x45')]=_0x261874[_0x7c4f('0x45')][_0x7c4f('0x49')]?_0x261874['attributes']:_0x1079f4[_0x7c4f('0x55')];_0x261874[_0x7c4f('0xcc')]=qs[_0x7c4f('0xcd')](_0x4b540f[_0x7c4f('0x42')][_0x7c4f('0xcd')]);_0x261874[_0x7c4f('0x3f')]=qs[_0x7c4f('0x59')](_[_0x7c4f('0xce')](_0x4b540f['query'],_0x1079f4['filters']));if(_0x4b540f['query'][_0x7c4f('0x30')]){_0x261874[_0x7c4f('0x3f')]=_[_0x7c4f('0x5c')](_0x261874['where'],{'$or':_[_0x7c4f('0x31')](_0x261874[_0x7c4f('0x45')],function(_0x532c74){var _0x10ddef={};_0x10ddef[_0x532c74]={'$like':'%'+_0x4b540f['query']['filter']+'%'};return _0x10ddef;})});}_0x261874=_[_0x7c4f('0x5c')]({},_0x261874,_0x4b540f[_0x7c4f('0xd8')]);return _0x2da286[_0x7c4f('0xe7')](_0x261874);}})['then'](function(_0x29cee0){if(_0x29cee0){_0x31a171=_0x29cee0['length'];if(!_0x4b540f['query'][_0x7c4f('0xd0')](_0x7c4f('0xd5'))){_0x261874[_0x7c4f('0x24')]=qs[_0x7c4f('0x24')](_0x4b540f['query'][_0x7c4f('0x24')]);_0x261874[_0x7c4f('0x21')]=qs['offset'](_0x4b540f[_0x7c4f('0x42')][_0x7c4f('0x21')]);}return _0x2da286['getFaxInteractions'](_0x261874);}})[_0x7c4f('0x16')](function(_0x3a4c81){if(_0x3a4c81){return _0x3a4c81?{'count':_0x31a171,'rows':_0x3a4c81}:null;}})[_0x7c4f('0x16')](respondWithResult(_0x32d4b1,null))[_0x7c4f('0x1e')](handleError(_0x32d4b1,null));};exports[_0x7c4f('0xe9')]=function(_0xbc8c6b,_0x2af5f3){var _0x1c9171={};var _0x28636d={};var _0x8870ed;var _0x95439e;return db['User'][_0x7c4f('0xcb')]({'where':{'id':_0xbc8c6b[_0x7c4f('0x54')]['id']}})['then'](handleEntityNotFound(_0x2af5f3,null))['then'](function(_0x5129ca){if(_0x5129ca){_0x8870ed=_0x5129ca;_0x28636d[_0x7c4f('0x55')]=_[_0x7c4f('0x57')](db['WhatsappInteraction']['rawAttributes']);_0x28636d['query']=_[_0x7c4f('0x57')](_0xbc8c6b[_0x7c4f('0x42')]);_0x28636d[_0x7c4f('0x59')]=_['intersection'](_0x28636d[_0x7c4f('0x55')],_0x28636d[_0x7c4f('0x42')]);_0x1c9171[_0x7c4f('0x45')]=_[_0x7c4f('0x5a')](_0x28636d[_0x7c4f('0x55')],qs[_0x7c4f('0x5b')](_0xbc8c6b[_0x7c4f('0x42')][_0x7c4f('0x5b')]));_0x1c9171[_0x7c4f('0x45')]=_0x1c9171[_0x7c4f('0x45')][_0x7c4f('0x49')]?_0x1c9171[_0x7c4f('0x45')]:_0x28636d[_0x7c4f('0x55')];_0x1c9171['order']=qs[_0x7c4f('0xcd')](_0xbc8c6b[_0x7c4f('0x42')][_0x7c4f('0xcd')]);_0x1c9171[_0x7c4f('0x3f')]=qs['filters'](_['pick'](_0xbc8c6b[_0x7c4f('0x42')],_0x28636d[_0x7c4f('0x59')]));if(_0xbc8c6b[_0x7c4f('0x42')][_0x7c4f('0x30')]){_0x1c9171[_0x7c4f('0x3f')]=_['merge'](_0x1c9171[_0x7c4f('0x3f')],{'$or':_[_0x7c4f('0x31')](_0x1c9171['attributes'],function(_0x1eade3){var _0x2e69aa={};_0x2e69aa[_0x1eade3]={'$like':'%'+_0xbc8c6b[_0x7c4f('0x42')][_0x7c4f('0x30')]+'%'};return _0x2e69aa;})});}_0x1c9171=_[_0x7c4f('0x5c')]({},_0x1c9171,_0xbc8c6b[_0x7c4f('0xd8')]);return _0x8870ed['getWhatsappInteractions'](_0x1c9171);}})[_0x7c4f('0x16')](function(_0x31fa96){if(_0x31fa96){_0x95439e=_0x31fa96[_0x7c4f('0x49')];if(!_0xbc8c6b[_0x7c4f('0x42')][_0x7c4f('0xd0')](_0x7c4f('0xd5'))){_0x1c9171[_0x7c4f('0x24')]=qs[_0x7c4f('0x24')](_0xbc8c6b[_0x7c4f('0x42')][_0x7c4f('0x24')]);_0x1c9171['offset']=qs[_0x7c4f('0x21')](_0xbc8c6b['query']['offset']);}return _0x8870ed['getWhatsappInteractions'](_0x1c9171);}})['then'](function(_0x775008){if(_0x775008){return _0x775008?{'count':_0x95439e,'rows':_0x775008}:null;}})[_0x7c4f('0x16')](respondWithResult(_0x2af5f3,null))[_0x7c4f('0x1e')](handleError(_0x2af5f3,null));};exports[_0x7c4f('0xea')]=function(_0x257b55,_0x2cc375,_0x253193){var _0x127b18;var _0x2799ad;var _0x382a43;var _0x1d3158=!_['isNil'](_0x257b55[_0x7c4f('0x54')]['id'])?_0x257b55[_0x7c4f('0x54')]['id']:!_[_0x7c4f('0x68')](_0x257b55[_0x7c4f('0x81')]['id'])?_0x257b55[_0x7c4f('0x81')]['id']:null;return db['User']['find']({'where':{'id':_0x1d3158,'role':{'$or':['admin',_0x7c4f('0x81'),_0x7c4f('0x2d')]}},'attributes':['id',_0x7c4f('0x34'),_0x7c4f('0xeb'),_0x7c4f('0xec'),'role',_0x7c4f('0x63'),'loginInPause']})[_0x7c4f('0x16')](function(_0x5847b1){if(_0x5847b1){if(_0x5847b1[_0x7c4f('0x2a')]===_0x7c4f('0x2d')){_0x127b18=_0x5847b1;if(_0x257b55[_0x7c4f('0x5e')][_0x7c4f('0xa4')]){_0x382a43=util[_0x7c4f('0xed')](_0x7c4f('0xee'),_0x127b18[_0x257b55['body'][_0x7c4f('0xa4')]]);}else if(_0x257b55[_0x7c4f('0x5e')][_0x7c4f('0xef')]){_0x382a43=util[_0x7c4f('0xed')](_0x7c4f('0xf0'),_0x257b55[_0x7c4f('0x5e')][_0x7c4f('0xef')]);}else{_0x382a43=util[_0x7c4f('0xed')](_0x7c4f('0xf0'),_0x127b18[_0x7c4f('0x34')]);}socket['to'](util[_0x7c4f('0xed')](_0x7c4f('0xf1'),_0x127b18['name']))[_0x7c4f('0xb6')]('user:forcelogout',{'user':{'id':_0x127b18['id'],'name':_0x127b18[_0x7c4f('0x34')]},'ip':_0x257b55['headers'][_0x7c4f('0xf2')]||_0x257b55['connection'][_0x7c4f('0xf3')]||_0x257b55['socket']['remoteAddress']||_0x257b55[_0x7c4f('0xf4')][_0x7c4f('0xf5')][_0x7c4f('0xf3')]});return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x127b18['name']},'individualHooks':!![]});}}else{throw new db[(_0x7c4f('0x97'))][(_0x7c4f('0x94'))](_0x7c4f('0xf6'));}})['then'](function(){if(_0x127b18){return _0x127b18['getVoiceQueues']({'raw':!![]});}})[_0x7c4f('0x16')](function(_0x4b78d3){if(_0x127b18){var _0x460c28=[];if(_0x4b78d3){_0x2799ad=_0x4b78d3;if(_0x2799ad[_0x7c4f('0x49')]){for(var _0x2a1d6a=0x0;_0x2a1d6a<_0x2799ad['length'];_0x2a1d6a++){_0x460c28[_0x7c4f('0x4a')]({'membername':_0x127b18[_0x7c4f('0x34')],'UserId':_0x127b18['id'],'queue_name':_0x2799ad[_0x2a1d6a]['name'],'VoiceQueueId':_0x2799ad[_0x2a1d6a]['id'],'interface':_0x382a43,'paused':_0x127b18[_0x7c4f('0xf7')]||![],'penalty':_0x2799ad[_0x2a1d6a]['UserVoiceQueue.penalty']||0x0});}return BPromise[_0x7c4f('0x8d')](_0x460c28,function(_0x2d6e82){return db[_0x7c4f('0xb1')][_0x7c4f('0xb2')](_0x2d6e82);});}}}})[_0x7c4f('0x16')](function(){if(_0x127b18){return db[_0x7c4f('0xf8')]['findAll']({'where':{'membername':_0x127b18[_0x7c4f('0x34')],'exitAt':null}});}})[_0x7c4f('0x16')](function(_0x12dc50){if(_0x127b18){var _0x2260ff=[];_0x12dc50[_0x7c4f('0xf9')](function(_0x163819){_0x2260ff[_0x7c4f('0x4a')](_0x163819[_0x7c4f('0x28')]({'exitAt':moment()[_0x7c4f('0xed')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x7c4f('0x52')](_0x2260ff);}})[_0x7c4f('0x16')](function(){if(_0x127b18){var _0x2f6006=[];var _0x3abc3c=[];var _0x4356cc=utils[_0x7c4f('0xfa')]();var _0x220fe8={'membername':_0x127b18[_0x7c4f('0x34')],'interface':_0x382a43,'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x127b18['role'],'internal':_0x127b18[_0x7c4f('0x63')]};_0x4356cc[_0x7c4f('0xf9')](function(_0xa9e172){_0x2f6006[_0x7c4f('0x4a')](_[_0x7c4f('0x5c')]({'channel':_0xa9e172,'type':_0x7c4f('0xfb'),'data1':_0x257b55[_0x7c4f('0x5e')][_0x7c4f('0xfc')],'data2':_0x382a43},_0x220fe8));if(_0x127b18[_0x7c4f('0xf7')]){_0x3abc3c[_0x7c4f('0x4a')](_['merge']({'channel':_0xa9e172,'type':_0x7c4f('0xfd'),'data1':_0x7c4f('0xfe')},_0x220fe8));}});return db[_0x7c4f('0xf8')][_0x7c4f('0x88')](_0x2f6006['concat'](_0x3abc3c),{'individualHooks':!![]});}})[_0x7c4f('0x16')](function(){if(_0x127b18){return _0x127b18[_0x7c4f('0x28')]({'online':!![],'lastLoginAt':moment()[_0x7c4f('0xed')](_0x7c4f('0xff')),'voicePause':_0x127b18['loginInPause']||![],'mailPause':_0x127b18[_0x7c4f('0xf7')]||![],'chatPause':_0x127b18['loginInPause']||![],'faxPause':_0x127b18[_0x7c4f('0xf7')]||![],'smsPause':_0x127b18['loginInPause']||![],'openchannelPause':_0x127b18[_0x7c4f('0xf7')]||![],'whatsappPause':_0x127b18[_0x7c4f('0xf7')]||![],'pauseType':_0x127b18['loginInPause']?_0x7c4f('0xfe'):null,'interface':_0x382a43,'lastPauseAt':moment()[_0x7c4f('0xed')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x7c4f('0x16')](function(_0x1b4249){if(_0x257b55['isMiddleware']){return _0x253193();}else{return BPromise[_0x7c4f('0x100')](_0x1b4249)['then'](respondWithResult(_0x2cc375,null));}})[_0x7c4f('0x1e')](handleError(_0x2cc375,null));};exports[_0x7c4f('0x101')]=function(_0x2d3bcd,_0x147b73){var _0x51ad94;return db[_0x7c4f('0x39')][_0x7c4f('0x5d')]({'where':{'id':_0x2d3bcd[_0x7c4f('0x54')]['id'],'role':_0x7c4f('0x2d')},'attributes':['id',_0x7c4f('0x34'),_0x7c4f('0x2a')]})[_0x7c4f('0x16')](handleEntityNotFound(_0x147b73,null))[_0x7c4f('0x16')](function(_0x2d4a26){if(_0x2d4a26){_0x51ad94=_0x2d4a26;return db[_0x7c4f('0xb1')]['destroy']({'where':{'membername':_0x51ad94[_0x7c4f('0x34')]},'individualHooks':!![]});}})[_0x7c4f('0x16')](function(){return db['MemberReport'][_0x7c4f('0x46')]({'where':{'membername':_0x51ad94[_0x7c4f('0x34')],'exitAt':null}});})[_0x7c4f('0x16')](function(_0x41ea7a){var _0x3c7e87=[];_0x41ea7a[_0x7c4f('0xf9')](function(_0x3bcb50){_0x3c7e87[_0x7c4f('0x4a')](_0x3bcb50[_0x7c4f('0x28')]({'exitAt':moment()['format'](_0x7c4f('0xff'))}));});return BPromise[_0x7c4f('0x52')](_0x3c7e87);})['then'](function(){return _0x51ad94[_0x7c4f('0x28')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x147b73,null))[_0x7c4f('0x1e')](handleError(_0x147b73,null));};exports[_0x7c4f('0x102')]=function(_0x29f020,_0x277553){var _0x32fb68;return db[_0x7c4f('0xb1')][_0x7c4f('0x28')]({'paused':0x1},{'where':{'UserId':_0x29f020[_0x7c4f('0x54')]['id']},'individualHooks':!![]})[_0x7c4f('0x16')](function(){return db[_0x7c4f('0x39')][_0x7c4f('0x5d')]({'where':{'id':_0x29f020[_0x7c4f('0x54')]['id'],'role':_0x7c4f('0x2d')},'attributes':['id',_0x7c4f('0x34'),'role',_0x7c4f('0x63'),_0x7c4f('0xa4')]});})['then'](handleEntityNotFound(_0x277553,null))['then'](function(_0x3176ca){if(_0x3176ca){_0x32fb68=_0x3176ca;return respondWithRpcPromise(_0x7c4f('0x103'),_0x7c4f('0x102'),{'id':_0x32fb68['id'],'name':_0x32fb68[_0x7c4f('0x34')],'pause':!![]});}})['then'](function(){if(_0x32fb68){return db['MemberReport'][_0x7c4f('0x46')]({'where':{'membername':_0x32fb68[_0x7c4f('0x34')],'type':'PAUSE','exitAt':null}});}})[_0x7c4f('0x16')](function(_0x3261b3){if(_0x3261b3[_0x7c4f('0x49')]){var _0x1a38bb=moment()[_0x7c4f('0xed')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x9093cb=0x0,_0x2bfa4b=_0x3261b3[_0x7c4f('0x49')];_0x9093cb<_0x2bfa4b;_0x9093cb++){_0x3261b3[_0x9093cb]['updateAttributes']({'exitAt':_0x1a38bb});}}})[_0x7c4f('0x16')](function(){var _0x34c937=[];var _0x2ddaef=utils[_0x7c4f('0xfa')]();_0x2ddaef[_0x7c4f('0xf9')](function(_0x42bfc4){_0x34c937[_0x7c4f('0x4a')]({'channel':_0x42bfc4,'membername':_0x32fb68[_0x7c4f('0x34')],'interface':_[_0x7c4f('0x68')](_0x32fb68[_0x7c4f('0xa4')])?util[_0x7c4f('0xed')](_0x7c4f('0xf0'),_0x32fb68[_0x7c4f('0x34')]):_0x32fb68[_0x7c4f('0xa4')],'type':'PAUSE','enterAt':moment()[_0x7c4f('0xed')](_0x7c4f('0xff')),'data1':_0x29f020[_0x7c4f('0x5e')][_0x7c4f('0x3c')]||_0x7c4f('0x104'),'role':_0x32fb68[_0x7c4f('0x2a')],'internal':_0x32fb68[_0x7c4f('0x63')]});});return db['MemberReport'][_0x7c4f('0x88')](_0x34c937,{'individualHooks':!![]});})[_0x7c4f('0x16')](function(){return _0x32fb68[_0x7c4f('0x28')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x29f020[_0x7c4f('0x5e')][_0x7c4f('0x3c')]||_0x7c4f('0x104'),'lastPauseAt':moment()[_0x7c4f('0xed')](_0x7c4f('0xff'))});})['then'](respondWithResult(_0x277553,null))[_0x7c4f('0x1e')](handleError(_0x277553,null));};exports['unpause']=function(_0x2effcd,_0x4dedf6){var _0x1399fb;return db['User'][_0x7c4f('0x5d')]({'where':{'id':_0x2effcd[_0x7c4f('0x54')]['id']},'attributes':['id','name',_0x7c4f('0x2a'),_0x7c4f('0xa3'),_0x7c4f('0x105'),_0x7c4f('0x106'),_0x7c4f('0x107'),_0x7c4f('0x108'),'smsPause',_0x7c4f('0x109'),'pauseType','lastPauseAt']})[_0x7c4f('0x16')](handleEntityNotFound(_0x4dedf6,null))['then'](function(_0x26a401){if(_0x26a401){_0x1399fb=_0x26a401;if(_0x2effcd[_0x7c4f('0x5e')]['channel']&&!utils[_0x7c4f('0xa5')](_0x2effcd[_0x7c4f('0x5e')]['channel'])){throw new db[(_0x7c4f('0x97'))][(_0x7c4f('0x94'))](_0x7c4f('0xa6'));}switch(_0x2effcd[_0x7c4f('0x5e')]['channel']){case _0x7c4f('0xb0'):return respondWithRpcPromise(_0x7c4f('0x103'),_0x7c4f('0x10a'),{'id':_0x1399fb['id'],'name':_0x1399fb[_0x7c4f('0x34')],'pause':![]})[_0x7c4f('0x16')](function(){return db[_0x7c4f('0xb1')][_0x7c4f('0x28')]({'paused':0x0},{'where':{'UserId':_0x1399fb['id']},'individualHooks':!![]});})[_0x7c4f('0x16')](function(){return db[_0x7c4f('0xf8')][_0x7c4f('0x5d')]({'where':{'channel':_0x2effcd[_0x7c4f('0x5e')][_0x7c4f('0xa1')],'membername':_0x1399fb['name'],'type':_0x7c4f('0xfd'),'exitAt':null}});})['then'](function(_0x55292f){if(_0x55292f){return _0x55292f[_0x7c4f('0x28')]({'exitAt':moment()[_0x7c4f('0xed')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x7c4f('0x10b')},{'individualHooks':!![]});}return null;})[_0x7c4f('0x16')](function(){return _0x1399fb[_0x7c4f('0x28')]({'voicePause':![]});});case _0x7c4f('0x4f'):case _0x7c4f('0x4b'):case _0x7c4f('0x4e'):case _0x7c4f('0x4c'):case _0x7c4f('0x51'):case _0x7c4f('0x50'):return db[_0x7c4f('0xf8')][_0x7c4f('0x5d')]({'where':{'channel':_0x2effcd[_0x7c4f('0x5e')]['channel'],'membername':_0x1399fb[_0x7c4f('0x34')],'type':'PAUSE','exitAt':null}})[_0x7c4f('0x16')](function(_0x13008c){if(_0x13008c){return _0x13008c[_0x7c4f('0x28')]({'exitAt':moment()[_0x7c4f('0xed')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x7c4f('0x10b')},{'individualHooks':!![]});}return null;})[_0x7c4f('0x16')](function(){var _0x28a4d7={};_[_0x7c4f('0x25')](_0x28a4d7,util['format'](_0x7c4f('0x10c'),_0x2effcd[_0x7c4f('0x5e')][_0x7c4f('0xa1')],_0x7c4f('0x10d')),![]);return _0x1399fb[_0x7c4f('0x28')](_0x28a4d7);});default:return respondWithRpcPromise(_0x7c4f('0x103'),_0x7c4f('0x10a'),{'id':_0x1399fb['id'],'name':_0x1399fb[_0x7c4f('0x34')],'pause':![]})[_0x7c4f('0x16')](function(){return db['UserVoiceQueueRt'][_0x7c4f('0x28')]({'paused':0x0},{'where':{'UserId':_0x1399fb['id']}});})[_0x7c4f('0x16')](function(){return db[_0x7c4f('0xf8')][_0x7c4f('0x46')]({'where':{'membername':_0x1399fb['name'],'type':_0x7c4f('0xfd'),'exitAt':null}});})[_0x7c4f('0x16')](function(_0x4cdce1){var _0x422801=[];_0x4cdce1[_0x7c4f('0xf9')](function(_0x731b89){_0x422801[_0x7c4f('0x4a')](_0x731b89['update']({'exitAt':moment()[_0x7c4f('0xed')](_0x7c4f('0xff')),'data2':_0x7c4f('0x10b')}));});return BPromise['all'](_0x422801);})[_0x7c4f('0x16')](function(){return _0x1399fb[_0x7c4f('0x28')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x7c4f('0x16')](respondWithResult(_0x4dedf6,null))[_0x7c4f('0x1e')](handleError(_0x4dedf6,null));};exports[_0x7c4f('0x10e')]=function(_0x327e3c,_0x5785f1){var _0x15852d={};var _0x2bca1d={};var _0x30232a;var _0x1f262a;return db[_0x7c4f('0x39')]['findOne']({'where':{'id':_0x327e3c[_0x7c4f('0x54')]['id']}})[_0x7c4f('0x16')](handleEntityNotFound(_0x5785f1,null))['then'](function(_0x53d857){if(_0x53d857){_0x30232a=_0x53d857;_0x2bca1d[_0x7c4f('0x55')]=_[_0x7c4f('0x57')](db['Team'][_0x7c4f('0x3a')]);_0x2bca1d['query']=_['keys'](_0x327e3c[_0x7c4f('0x42')]);_0x2bca1d[_0x7c4f('0x59')]=_[_0x7c4f('0x5a')](_0x2bca1d[_0x7c4f('0x55')],_0x2bca1d[_0x7c4f('0x42')]);_0x15852d[_0x7c4f('0x45')]=_['intersection'](_0x2bca1d[_0x7c4f('0x55')],qs[_0x7c4f('0x5b')](_0x327e3c[_0x7c4f('0x42')][_0x7c4f('0x5b')]));_0x15852d[_0x7c4f('0x45')]=_0x15852d[_0x7c4f('0x45')][_0x7c4f('0x49')]?_0x15852d[_0x7c4f('0x45')]:_0x2bca1d['model'];_0x15852d[_0x7c4f('0xcc')]=qs[_0x7c4f('0xcd')](_0x327e3c['query'][_0x7c4f('0xcd')]);_0x15852d[_0x7c4f('0x3f')]=qs[_0x7c4f('0x59')](_[_0x7c4f('0xce')](_0x327e3c[_0x7c4f('0x42')],_0x2bca1d[_0x7c4f('0x59')]));if(_0x327e3c[_0x7c4f('0x42')][_0x7c4f('0x30')]){_0x15852d[_0x7c4f('0x3f')]=_['merge'](_0x15852d[_0x7c4f('0x3f')],{'$or':_[_0x7c4f('0x31')](_0x15852d[_0x7c4f('0x45')],function(_0x82e53a){var _0xe9960={};_0xe9960[_0x82e53a]={'$like':'%'+_0x327e3c[_0x7c4f('0x42')][_0x7c4f('0x30')]+'%'};return _0xe9960;})});}_0x15852d=_[_0x7c4f('0x5c')]({},_0x15852d,_0x327e3c[_0x7c4f('0xd8')]);return _0x30232a[_0x7c4f('0x10e')](_0x15852d);}})[_0x7c4f('0x16')](function(_0xbe7dbf){if(_0xbe7dbf){_0x1f262a=_0xbe7dbf[_0x7c4f('0x49')];if(!_0x327e3c['query']['hasOwnProperty'](_0x7c4f('0xd5'))){_0x15852d[_0x7c4f('0x24')]=qs[_0x7c4f('0x24')](_0x327e3c['query']['limit']);_0x15852d[_0x7c4f('0x21')]=qs[_0x7c4f('0x21')](_0x327e3c[_0x7c4f('0x42')][_0x7c4f('0x21')]);}return _0x30232a[_0x7c4f('0x10e')](_0x15852d);}})[_0x7c4f('0x16')](function(_0x2d1cfd){if(_0x2d1cfd){return _0x2d1cfd?{'count':_0x1f262a,'rows':_0x2d1cfd}:null;}})[_0x7c4f('0x16')](respondWithResult(_0x5785f1,null))[_0x7c4f('0x1e')](handleError(_0x5785f1,null));};exports[_0x7c4f('0x10f')]=function(_0x20ed76,_0xac0a87){return db[_0x7c4f('0x39')][_0x7c4f('0x5d')]({'where':{'id':_0x20ed76['params']['id']}})[_0x7c4f('0x16')](handleEntityNotFound(_0xac0a87,null))['then'](function(_0x400b67){if(_0x400b67){var _0x53c9a5=_0x400b67[_0x7c4f('0xaf')]({'plain':!![]});return _0x400b67[_0x7c4f('0x10f')](_0x20ed76[_0x7c4f('0x5e')][_0x7c4f('0x62')],_[_0x7c4f('0x61')](_0x20ed76[_0x7c4f('0x5e')],[_0x7c4f('0x62'),'id'])||{})[_0x7c4f('0x16')](function(){for(var _0x17d6a7=0x0;_0x17d6a7<_0x20ed76[_0x7c4f('0x5e')][_0x7c4f('0x62')]['length'];_0x17d6a7++){var _0x4dd875=[];var _0x1f39a1={};db[_0x7c4f('0x110')]['findOne']({'where':{'id':_0x20ed76['body'][_0x7c4f('0x62')][_0x17d6a7]}})[_0x7c4f('0x16')](function(_0x40449){_0x1f39a1=_0x40449[_0x7c4f('0x4d')];_0x4dd875[_0x7c4f('0x4a')](_0x40449['getVoiceQueues']()[_0x7c4f('0x16')](function(_0x2241e8){for(var _0x5aae4a=0x0;_0x5aae4a<_0x2241e8['length'];_0x5aae4a++){_0x2241e8[_0x5aae4a][_0x7c4f('0x111')]('channel',_0x7c4f('0x112'));}return _0x2241e8;}));_0x4dd875['push'](_0x40449['getChatQueues']()[_0x7c4f('0x16')](function(_0x2c1985){for(var _0x56884e=0x0;_0x56884e<_0x2c1985['length'];_0x56884e++){_0x2c1985[_0x56884e]['setDataValue'](_0x7c4f('0xa1'),_0x7c4f('0x113'));}return _0x2c1985;}));_0x4dd875[_0x7c4f('0x4a')](_0x40449['getMailQueues']()[_0x7c4f('0x16')](function(_0x31f4ec){for(var _0x30f691=0x0;_0x30f691<_0x31f4ec['length'];_0x30f691++){_0x31f4ec[_0x30f691][_0x7c4f('0x111')](_0x7c4f('0xa1'),_0x7c4f('0x114'));}return _0x31f4ec;}));_0x4dd875[_0x7c4f('0x4a')](_0x40449[_0x7c4f('0x115')]()['then'](function(_0x53c263){for(var _0x2d2d8f=0x0;_0x2d2d8f<_0x53c263[_0x7c4f('0x49')];_0x2d2d8f++){_0x53c263[_0x2d2d8f][_0x7c4f('0x111')](_0x7c4f('0xa1'),'Sms');}return _0x53c263;}));_0x4dd875[_0x7c4f('0x4a')](_0x40449[_0x7c4f('0x116')]()[_0x7c4f('0x16')](function(_0xfe08ac){for(var _0x3142de=0x0;_0x3142de<_0xfe08ac[_0x7c4f('0x49')];_0x3142de++){_0xfe08ac[_0x3142de][_0x7c4f('0x111')](_0x7c4f('0xa1'),_0x7c4f('0x117'));}return _0xfe08ac;}));_0x4dd875[_0x7c4f('0x4a')](_0x40449['getFaxQueues']()[_0x7c4f('0x16')](function(_0x293c5c){for(var _0x426401=0x0;_0x426401<_0x293c5c[_0x7c4f('0x49')];_0x426401++){_0x293c5c[_0x426401][_0x7c4f('0x111')](_0x7c4f('0xa1'),_0x7c4f('0x118'));}return _0x293c5c;}));_0x4dd875['push'](_0x40449['getOpenchannelQueues']()[_0x7c4f('0x16')](function(_0x480b90){for(var _0x170e42=0x0;_0x170e42<_0x480b90[_0x7c4f('0x49')];_0x170e42++){_0x480b90[_0x170e42][_0x7c4f('0x111')](_0x7c4f('0xa1'),_0x7c4f('0x119'));}return _0x480b90;}));return BPromise[_0x7c4f('0x52')](_0x4dd875);})[_0x7c4f('0x16')](function(_0x1ef82b){var _0x22a0ab=_[_0x7c4f('0x11a')](_0x1ef82b);_0x4dd875=[];return db[_0x7c4f('0x6a')][_0x7c4f('0x11b')](function(_0x4eff6d){for(var _0x5a178d=0x0;_0x5a178d<_0x22a0ab[_0x7c4f('0x49')];_0x5a178d++){_0x4dd875['push'](_0x22a0ab[_0x5a178d]['addAgent'](_0x53c9a5['id']),{'transaction':_0x4eff6d});}return BPromise[_0x7c4f('0x52')](_0x4dd875)[_0x7c4f('0x16')](function(){if(_0x53c9a5[_0x7c4f('0xa2')]){return BPromise['each'](_[_0x7c4f('0x30')](_0x22a0ab,function(_0x1b5d6b){return _0x1b5d6b[_0x7c4f('0x11c')](_0x7c4f('0xa1'))===_0x7c4f('0x112');}),function(_0x1e3184){return db[_0x7c4f('0xb1')][_0x7c4f('0xb2')]({'membername':_0x53c9a5['name'],'UserId':_0x53c9a5['id'],'queue_name':_0x1e3184[_0x7c4f('0x34')],'VoiceQueueId':_0x1e3184['id'],'interface':_[_0x7c4f('0x68')](_0x53c9a5[_0x7c4f('0xa4')])?util['format'](_0x7c4f('0xf0'),_0x53c9a5[_0x7c4f('0x34')]):_0x53c9a5[_0x7c4f('0xa4')],'paused':_0x53c9a5['voicePause']||![],'penalty':_0x53c9a5['penalty']},{'transaction':_0x4eff6d});});}else{return;}})[_0x7c4f('0x16')](function(){for(var _0x3a4429=0x0;_0x3a4429<_0x22a0ab[_0x7c4f('0x49')];_0x3a4429++){var _0x4d2850=_0x22a0ab[_0x3a4429][_0x7c4f('0x11c')](_0x7c4f('0xa1'));var _0x4128fc=_0x4d2850+_0x7c4f('0xac');socket[_0x7c4f('0xb6')]('user'+_0x4d2850+_0x7c4f('0xad'),{'UserId':_0x53c9a5['id'],['queueField']:_0x22a0ab[_0x3a4429]['id']});}});});})[_0x7c4f('0x16')](function(){db[_0x7c4f('0x11d')][_0x7c4f('0xcb')]({'where':{'teamId':_0x1f39a1['id']}})[_0x7c4f('0x16')](function(_0x2f95c2){if(_0x2f95c2){db['UserVoicePrefix'][_0x7c4f('0x80')]({'UserId':_0x20ed76['params']['id'],'VoicePrefixId':_0x2f95c2['VoicePrefixId']});}});});}});}})[_0x7c4f('0x16')](respondWithStatusCode(_0xac0a87,null))['catch'](handleError(_0xac0a87,null));};exports[_0x7c4f('0x11e')]=function(_0x58edd,_0x1fd987){return db[_0x7c4f('0x39')][_0x7c4f('0xcb')]({'where':{'id':_0x58edd[_0x7c4f('0x54')]['id']}})[_0x7c4f('0x16')](handleEntityNotFound(_0x1fd987,null))[_0x7c4f('0x16')](function(_0x47bef4){if(_0x47bef4){var _0x3b2e03=_0x47bef4['get']({'plain':!![]});var _0x505830=_0x58edd[_0x7c4f('0x42')][_0x7c4f('0x62')];return _0x47bef4[_0x7c4f('0x11e')](_0x505830)[_0x7c4f('0x16')](function(){for(var _0x3e4d41=0x0;_0x3e4d41<_0x505830[_0x7c4f('0x49')];_0x3e4d41++){var _0x52e65a=[];var _0x1aced5={};db[_0x7c4f('0x110')][_0x7c4f('0xcb')]({'where':{'id':_0x505830[_0x3e4d41]}})[_0x7c4f('0x16')](function(_0x18ecd1){_0x1aced5=_0x18ecd1[_0x7c4f('0x4d')];_0x52e65a[_0x7c4f('0x4a')](_0x18ecd1['getVoiceQueues']()[_0x7c4f('0x16')](function(_0x459766){for(var _0x411cf=0x0;_0x411cf<_0x459766[_0x7c4f('0x49')];_0x411cf++){_0x459766[_0x411cf][_0x7c4f('0x111')](_0x7c4f('0xa1'),_0x7c4f('0x112'));}return _0x459766;}));_0x52e65a[_0x7c4f('0x4a')](_0x18ecd1['getChatQueues']()['then'](function(_0x28b247){for(var _0x3f219a=0x0;_0x3f219a<_0x28b247[_0x7c4f('0x49')];_0x3f219a++){_0x28b247[_0x3f219a][_0x7c4f('0x111')](_0x7c4f('0xa1'),_0x7c4f('0x113'));}return _0x28b247;}));_0x52e65a[_0x7c4f('0x4a')](_0x18ecd1[_0x7c4f('0x11f')]()[_0x7c4f('0x16')](function(_0x305de1){for(var _0x26531c=0x0;_0x26531c<_0x305de1[_0x7c4f('0x49')];_0x26531c++){_0x305de1[_0x26531c][_0x7c4f('0x111')](_0x7c4f('0xa1'),'Mail');}return _0x305de1;}));_0x52e65a[_0x7c4f('0x4a')](_0x18ecd1[_0x7c4f('0x115')]()[_0x7c4f('0x16')](function(_0x26ca79){for(var _0x48eb02=0x0;_0x48eb02<_0x26ca79['length'];_0x48eb02++){_0x26ca79[_0x48eb02]['setDataValue']('channel',_0x7c4f('0x120'));}return _0x26ca79;}));_0x52e65a[_0x7c4f('0x4a')](_0x18ecd1[_0x7c4f('0x116')]()['then'](function(_0x206c3c){for(var _0x329914=0x0;_0x329914<_0x206c3c[_0x7c4f('0x49')];_0x329914++){_0x206c3c[_0x329914]['setDataValue'](_0x7c4f('0xa1'),'Whatsapp');}return _0x206c3c;}));_0x52e65a[_0x7c4f('0x4a')](_0x18ecd1[_0x7c4f('0x121')]()[_0x7c4f('0x16')](function(_0x2bd759){for(var _0x27c43a=0x0;_0x27c43a<_0x2bd759[_0x7c4f('0x49')];_0x27c43a++){_0x2bd759[_0x27c43a]['setDataValue']('channel',_0x7c4f('0x118'));}return _0x2bd759;}));_0x52e65a[_0x7c4f('0x4a')](_0x18ecd1[_0x7c4f('0x122')]()['then'](function(_0x5ee237){for(var _0x19158d=0x0;_0x19158d<_0x5ee237[_0x7c4f('0x49')];_0x19158d++){_0x5ee237[_0x19158d][_0x7c4f('0x111')](_0x7c4f('0xa1'),_0x7c4f('0x119'));}return _0x5ee237;}));return BPromise[_0x7c4f('0x52')](_0x52e65a);})[_0x7c4f('0x16')](function(_0x2266c5){var _0x550da2=_[_0x7c4f('0x11a')](_0x2266c5);_0x52e65a=[];return db['sequelize'][_0x7c4f('0x11b')](function(_0x42e7c5){for(var _0x5cc9e5=0x0;_0x5cc9e5<_0x550da2[_0x7c4f('0x49')];_0x5cc9e5++){_0x52e65a[_0x7c4f('0x4a')](_0x550da2[_0x5cc9e5][_0x7c4f('0x123')](_0x3b2e03['id']),{'transaction':_0x42e7c5});}return BPromise[_0x7c4f('0x52')](_0x52e65a)[_0x7c4f('0x16')](function(){if(_0x3b2e03['online']){return BPromise[_0x7c4f('0x8d')](_[_0x7c4f('0x30')](_0x550da2,function(_0x571e2c){return _0x571e2c[_0x7c4f('0x11c')](_0x7c4f('0xa1'))==='Voice';}),function(_0x26c8ae){return db[_0x7c4f('0xb1')]['destroy']({'where':{'VoiceQueueId':_0x26c8ae['id'],'UserId':_0x3b2e03['id']},'transaction':_0x42e7c5});});}else{return;}})[_0x7c4f('0x16')](function(){db[_0x7c4f('0x11d')]['findOne']({'where':{'teamId':_0x1aced5['id']}})[_0x7c4f('0x16')](function(_0x482608){if(_0x482608){return db['UserVoicePrefix'][_0x7c4f('0x29')]({'where':{'UserId':_0x3b2e03['id'],'VoicePrefixId':_0x482608[_0x7c4f('0x4d')][_0x7c4f('0x124')]}});}});})[_0x7c4f('0x16')](function(){for(var _0x1dcc43=0x0;_0x1dcc43<_0x550da2[_0x7c4f('0x49')];_0x1dcc43++){var _0x514edb=_0x550da2[_0x1dcc43]['getDataValue'](_0x7c4f('0xa1'));var _0x343148=_0x514edb+_0x7c4f('0xac');socket['emit']('user'+_0x514edb+_0x7c4f('0xb7'),{'UserId':_0x3b2e03['id'],['queueField']:_0x550da2[_0x1dcc43]['id']});}});});});}});}})[_0x7c4f('0x16')](respondWithStatusCode(_0x1fd987,null))[_0x7c4f('0x1e')](handleError(_0x1fd987,null));};exports['getLists']=function(_0x1e7af8,_0x181bae){var _0x5d74cd={};var _0x491e6d={};var _0x568ddb;var _0x6c0b50;return db[_0x7c4f('0x39')][_0x7c4f('0xcb')]({'where':{'id':_0x1e7af8[_0x7c4f('0x54')]['id']}})['then'](handleEntityNotFound(_0x181bae,null))[_0x7c4f('0x16')](function(_0x105787){if(_0x105787){_0x568ddb=_0x105787;_0x491e6d[_0x7c4f('0x55')]=_[_0x7c4f('0x57')](db[_0x7c4f('0x125')]['rawAttributes']);_0x491e6d[_0x7c4f('0x42')]=_['keys'](_0x1e7af8[_0x7c4f('0x42')]);_0x491e6d['filters']=_[_0x7c4f('0x5a')](_0x491e6d[_0x7c4f('0x55')],_0x491e6d[_0x7c4f('0x42')]);_0x5d74cd[_0x7c4f('0x45')]=_[_0x7c4f('0x5a')](_0x491e6d[_0x7c4f('0x55')],qs[_0x7c4f('0x5b')](_0x1e7af8[_0x7c4f('0x42')][_0x7c4f('0x5b')]));_0x5d74cd[_0x7c4f('0x45')]=_0x5d74cd['attributes'][_0x7c4f('0x49')]?_0x5d74cd[_0x7c4f('0x45')]:_0x491e6d[_0x7c4f('0x55')];_0x5d74cd['order']=qs['sort'](_0x1e7af8[_0x7c4f('0x42')]['sort']);_0x5d74cd['where']=qs[_0x7c4f('0x59')](_['pick'](_0x1e7af8['query'],_0x491e6d[_0x7c4f('0x59')]));if(_0x1e7af8['query'][_0x7c4f('0x30')]){_0x5d74cd[_0x7c4f('0x3f')]=_[_0x7c4f('0x5c')](_0x5d74cd[_0x7c4f('0x3f')],{'$or':_[_0x7c4f('0x31')](_0x5d74cd['attributes'],function(_0x5b9ff9){var _0x1ce5b5={};_0x1ce5b5[_0x5b9ff9]={'$like':'%'+_0x1e7af8[_0x7c4f('0x42')][_0x7c4f('0x30')]+'%'};return _0x1ce5b5;})});}_0x5d74cd=_['merge']({},_0x5d74cd,_0x1e7af8['options']);return _0x568ddb[_0x7c4f('0x126')](_0x5d74cd);}})[_0x7c4f('0x16')](function(_0x307470){if(_0x307470){_0x6c0b50=_0x307470[_0x7c4f('0x49')];if(!_0x1e7af8[_0x7c4f('0x42')][_0x7c4f('0xd0')]('nolimit')){_0x5d74cd['limit']=qs['limit'](_0x1e7af8[_0x7c4f('0x42')][_0x7c4f('0x24')]);_0x5d74cd[_0x7c4f('0x21')]=qs[_0x7c4f('0x21')](_0x1e7af8[_0x7c4f('0x42')][_0x7c4f('0x21')]);}return _0x568ddb[_0x7c4f('0x126')](_0x5d74cd);}})['then'](function(_0x14e3a9){if(_0x14e3a9){return _0x14e3a9?{'count':_0x6c0b50,'rows':_0x14e3a9}:null;}})['then'](respondWithResult(_0x181bae,null))[_0x7c4f('0x1e')](handleError(_0x181bae,null));};exports['getAgents']=function(_0x206206,_0x36c37c){var _0x1fbef0={};var _0x20e227={};var _0x1c6562;return db[_0x7c4f('0x39')][_0x7c4f('0xcb')]({'where':{'id':_0x206206[_0x7c4f('0x54')]['id']}})[_0x7c4f('0x16')](handleEntityNotFound(_0x36c37c,null))[_0x7c4f('0x16')](function(_0x51446a){if(_0x51446a){_0x1c6562=_0x51446a;_0x20e227[_0x7c4f('0x55')]=_[_0x7c4f('0x57')](db[_0x7c4f('0x39')]['rawAttributes']);_0x20e227[_0x7c4f('0x42')]=_['keys'](_0x206206['query']);_0x20e227[_0x7c4f('0x59')]=_['intersection'](_0x20e227[_0x7c4f('0x55')],_0x20e227[_0x7c4f('0x42')]);_0x1fbef0[_0x7c4f('0x45')]=_['intersection'](_0x20e227['model'],qs[_0x7c4f('0x5b')](_0x206206['query'][_0x7c4f('0x5b')]));_0x1fbef0['attributes']=_0x1fbef0[_0x7c4f('0x45')][_0x7c4f('0x49')]?_0x1fbef0[_0x7c4f('0x45')]:_0x20e227[_0x7c4f('0x55')];_0x1fbef0[_0x7c4f('0xcc')]=qs[_0x7c4f('0xcd')](_0x206206[_0x7c4f('0x42')][_0x7c4f('0xcd')]);_0x1fbef0[_0x7c4f('0x3f')]=qs['filters'](_[_0x7c4f('0xce')](_0x206206[_0x7c4f('0x42')],_0x20e227[_0x7c4f('0x59')]));if(_0x206206[_0x7c4f('0x42')][_0x7c4f('0x30')]){_0x1fbef0['where']=_[_0x7c4f('0x5c')](_0x1fbef0[_0x7c4f('0x3f')],{'$or':_['map'](_0x1fbef0[_0x7c4f('0x45')],function(_0x4d56d5){var _0x4b52f8={};_0x4b52f8[_0x4d56d5]={'$like':'%'+_0x206206[_0x7c4f('0x42')][_0x7c4f('0x30')]+'%'};return _0x4b52f8;})});}_0x1fbef0[_0x7c4f('0x55')]=db[_0x7c4f('0x39')];_0x1fbef0['as']='Agents';_0x1fbef0=_[_0x7c4f('0x5c')]({},_0x1fbef0,_0x206206[_0x7c4f('0xd8')]);return _0x1c6562['getVoiceQueues']({'include':[_0x1fbef0]});}})[_0x7c4f('0x16')](function(_0x1ffac0){if(_0x1ffac0){var _0x178535={},_0x2cb5b2=[];for(var _0x3b1fc1=0x0;_0x3b1fc1<_0x1ffac0[_0x7c4f('0x49')];_0x3b1fc1+=0x1){for(var _0x47611a=0x0,_0x5dc5e0;_0x47611a<_0x1ffac0[_0x3b1fc1][_0x7c4f('0x8e')][_0x7c4f('0x49')];_0x47611a+=0x1){_0x5dc5e0=_0x1ffac0[_0x3b1fc1][_0x7c4f('0x8e')][_0x47611a][_0x7c4f('0xaf')]({'plain':!![]});_0x178535[_0x5dc5e0['id']]=_0x5dc5e0;}}_0x178535=_[_0x7c4f('0x127')](_0x178535);for(var _0x4fc4b1=qs[_0x7c4f('0x21')](_0x206206[_0x7c4f('0x42')][_0x7c4f('0x21')]);_0x4fc4b1<_0x178535[_0x7c4f('0x49')]&&_0x2cb5b2['length']<qs['limit'](_0x206206['query'][_0x7c4f('0x24')]);_0x4fc4b1+=0x1){if(_0x178535[_0x4fc4b1]){_0x2cb5b2[_0x7c4f('0x4a')](_0x178535[_0x4fc4b1]);}}return{'count':_0x178535[_0x7c4f('0x49')],'rows':_0x2cb5b2};}})[_0x7c4f('0x16')](respondWithResult(_0x36c37c,null))[_0x7c4f('0x1e')](handleError(_0x36c37c,null));};exports['destroy']=function(_0x373a85,_0x289b8a){if(_0x373a85[_0x7c4f('0x81')]['id']==_0x373a85[_0x7c4f('0x54')]['id']){return _0x289b8a[_0x7c4f('0x1f')](0x1f4)[_0x7c4f('0x38')]({'message':_0x7c4f('0x128')});}return db[_0x7c4f('0x39')]['find']({'where':{'id':_0x373a85[_0x7c4f('0x54')]['id']}})['then'](handleEntityNotFound(_0x289b8a,null))[_0x7c4f('0x16')](removeEntity(_0x289b8a,null))['catch'](handleError(_0x289b8a,null));};exports[_0x7c4f('0x129')]=function(_0x4c71ba,_0x5e554b){return db['User'][_0x7c4f('0x5d')]({'where':{'id':_0x4c71ba['params']['id']}})[_0x7c4f('0x16')](handleEntityNotFound(_0x5e554b,null))[_0x7c4f('0x16')](function(_0x456421){if(_0x456421){return _0x456421[_0x7c4f('0x129')](_0x4c71ba[_0x7c4f('0x5e')][_0x7c4f('0x62')],_[_0x7c4f('0x61')](_0x4c71ba['body'],[_0x7c4f('0x62'),'id'])||{})[_0x7c4f('0x12a')](function(){for(var _0x3b68b5=0x0;_0x3b68b5<_0x4c71ba[_0x7c4f('0x5e')]['ids'][_0x7c4f('0x49')];_0x3b68b5+=0x1){socket[_0x7c4f('0xb6')](_0x7c4f('0x12b'),{'ChatInteractionId':Number(_0x4c71ba[_0x7c4f('0x5e')]['ids'][_0x3b68b5]),'UserId':Number(_0x4c71ba[_0x7c4f('0x54')]['id'])});}return _0x4c71ba['body'][_0x7c4f('0x62')];});}})[_0x7c4f('0x16')](respondWithResult(_0x5e554b,null))[_0x7c4f('0x1e')](handleError(_0x5e554b,null));};exports[_0x7c4f('0x12c')]=function(_0x145071,_0x1b9cad){return db[_0x7c4f('0x39')][_0x7c4f('0x5d')]({'where':{'id':_0x145071[_0x7c4f('0x54')]['id']}})[_0x7c4f('0x16')](handleEntityNotFound(_0x1b9cad,null))[_0x7c4f('0x16')](function(_0x461df3){if(_0x461df3){return _0x461df3[_0x7c4f('0x12c')](_0x145071[_0x7c4f('0x42')][_0x7c4f('0x62')])['then'](function(){if(_[_0x7c4f('0xb5')](_0x145071[_0x7c4f('0x42')][_0x7c4f('0x62')])){for(var _0x300bea=0x0;_0x300bea<_0x145071[_0x7c4f('0x42')][_0x7c4f('0x62')][_0x7c4f('0x49')];_0x300bea+=0x1){socket['emit'](_0x7c4f('0x12d'),{'ChatInteractionId':Number(_0x145071[_0x7c4f('0x42')][_0x7c4f('0x62')][_0x300bea]),'UserId':Number(_0x145071[_0x7c4f('0x54')]['id'])});}}else{socket[_0x7c4f('0xb6')](_0x7c4f('0x12d'),{'ChatInteractionId':Number(_0x145071[_0x7c4f('0x42')][_0x7c4f('0x62')]),'UserId':Number(_0x145071[_0x7c4f('0x54')]['id'])});}});}})[_0x7c4f('0x16')](respondWithStatusCode(_0x1b9cad,null))[_0x7c4f('0x1e')](handleError(_0x1b9cad,null));};exports['addMailInteractions']=function(_0x9abb6a,_0x5b877d){return db[_0x7c4f('0x39')]['find']({'where':{'id':_0x9abb6a['params']['id']}})[_0x7c4f('0x16')](handleEntityNotFound(_0x5b877d,null))[_0x7c4f('0x16')](function(_0x4aa5f4){if(_0x4aa5f4){return _0x4aa5f4[_0x7c4f('0x12e')](_0x9abb6a[_0x7c4f('0x5e')]['ids'],_[_0x7c4f('0x61')](_0x9abb6a[_0x7c4f('0x5e')],[_0x7c4f('0x62'),'id'])||{})[_0x7c4f('0x12a')](function(){for(var _0x549600=0x0;_0x549600<_0x9abb6a[_0x7c4f('0x5e')][_0x7c4f('0x62')][_0x7c4f('0x49')];_0x549600+=0x1){socket[_0x7c4f('0xb6')](_0x7c4f('0x12f'),{'MailInteractionId':Number(_0x9abb6a[_0x7c4f('0x5e')][_0x7c4f('0x62')][_0x549600]),'UserId':Number(_0x9abb6a[_0x7c4f('0x54')]['id'])});}return _0x9abb6a[_0x7c4f('0x5e')][_0x7c4f('0x62')];});}})[_0x7c4f('0x16')](respondWithResult(_0x5b877d,null))[_0x7c4f('0x1e')](handleError(_0x5b877d,null));};exports[_0x7c4f('0x130')]=function(_0x2128b2,_0x13a3e5){return db[_0x7c4f('0x39')]['find']({'where':{'id':_0x2128b2[_0x7c4f('0x54')]['id']}})[_0x7c4f('0x16')](handleEntityNotFound(_0x13a3e5,null))[_0x7c4f('0x16')](function(_0x22489a){if(_0x22489a){return _0x22489a['removeMailInteractions'](_0x2128b2[_0x7c4f('0x42')][_0x7c4f('0x62')])['then'](function(){if(_[_0x7c4f('0xb5')](_0x2128b2['query'][_0x7c4f('0x62')])){for(var _0x320d4f=0x0;_0x320d4f<_0x2128b2[_0x7c4f('0x42')][_0x7c4f('0x62')]['length'];_0x320d4f+=0x1){socket[_0x7c4f('0xb6')](_0x7c4f('0x131'),{'MailInteractionId':Number(_0x2128b2['query']['ids'][_0x320d4f]),'UserId':Number(_0x2128b2['params']['id'])});}}else{socket[_0x7c4f('0xb6')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x2128b2['query'][_0x7c4f('0x62')]),'UserId':Number(_0x2128b2[_0x7c4f('0x54')]['id'])});}});}})[_0x7c4f('0x16')](respondWithStatusCode(_0x13a3e5,null))[_0x7c4f('0x1e')](handleError(_0x13a3e5,null));};exports[_0x7c4f('0x132')]=function(_0x12287c,_0x237f3e){return db[_0x7c4f('0x39')]['find']({'where':{'id':_0x12287c['params']['id']}})['then'](handleEntityNotFound(_0x237f3e,null))['then'](function(_0x3dbc96){if(_0x3dbc96){return _0x3dbc96[_0x7c4f('0x132')](_0x12287c[_0x7c4f('0x5e')][_0x7c4f('0x62')],_[_0x7c4f('0x61')](_0x12287c[_0x7c4f('0x5e')],[_0x7c4f('0x62'),'id'])||{})[_0x7c4f('0x12a')](function(){for(var _0x36043c=0x0;_0x36043c<_0x12287c['body'][_0x7c4f('0x62')][_0x7c4f('0x49')];_0x36043c+=0x1){socket[_0x7c4f('0xb6')](_0x7c4f('0x133'),{'FaxInteractionId':Number(_0x12287c[_0x7c4f('0x5e')]['ids'][_0x36043c]),'UserId':Number(_0x12287c[_0x7c4f('0x54')]['id'])});}return _0x12287c[_0x7c4f('0x5e')][_0x7c4f('0x62')];});}})[_0x7c4f('0x16')](respondWithResult(_0x237f3e,null))[_0x7c4f('0x1e')](handleError(_0x237f3e,null));};exports[_0x7c4f('0x134')]=function(_0x4a2a43,_0x24ddfb){return db['User']['find']({'where':{'id':_0x4a2a43[_0x7c4f('0x54')]['id']}})['then'](handleEntityNotFound(_0x24ddfb,null))[_0x7c4f('0x16')](function(_0x175fe5){if(_0x175fe5){return _0x175fe5['removeFaxInteractions'](_0x4a2a43[_0x7c4f('0x42')]['ids'])['then'](function(){if(_[_0x7c4f('0xb5')](_0x4a2a43[_0x7c4f('0x42')][_0x7c4f('0x62')])){for(var _0x3eac8d=0x0;_0x3eac8d<_0x4a2a43['query']['ids'][_0x7c4f('0x49')];_0x3eac8d+=0x1){socket['emit'](_0x7c4f('0x135'),{'FaxInteractionId':Number(_0x4a2a43[_0x7c4f('0x42')][_0x7c4f('0x62')][_0x3eac8d]),'UserId':Number(_0x4a2a43[_0x7c4f('0x54')]['id'])});}}else{socket[_0x7c4f('0xb6')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x4a2a43['query'][_0x7c4f('0x62')]),'UserId':Number(_0x4a2a43[_0x7c4f('0x54')]['id'])});}});}})[_0x7c4f('0x16')](respondWithStatusCode(_0x24ddfb,null))[_0x7c4f('0x1e')](handleError(_0x24ddfb,null));};exports[_0x7c4f('0x136')]=function(_0x1cf52c,_0x8e0b69){return db[_0x7c4f('0x39')]['find']({'where':{'id':_0x1cf52c[_0x7c4f('0x54')]['id']}})[_0x7c4f('0x16')](handleEntityNotFound(_0x8e0b69,null))['then'](function(_0x52cf30){if(_0x52cf30){return _0x52cf30['addSmsInteractions'](_0x1cf52c[_0x7c4f('0x5e')]['ids'],_[_0x7c4f('0x61')](_0x1cf52c[_0x7c4f('0x5e')],[_0x7c4f('0x62'),'id'])||{})['spread'](function(){for(var _0x524341=0x0;_0x524341<_0x1cf52c[_0x7c4f('0x5e')][_0x7c4f('0x62')][_0x7c4f('0x49')];_0x524341+=0x1){socket[_0x7c4f('0xb6')](_0x7c4f('0x137'),{'SmsInteractionId':Number(_0x1cf52c[_0x7c4f('0x5e')][_0x7c4f('0x62')][_0x524341]),'UserId':Number(_0x1cf52c['params']['id'])});}return _0x1cf52c['body'][_0x7c4f('0x62')];});}})['then'](respondWithResult(_0x8e0b69,null))[_0x7c4f('0x1e')](handleError(_0x8e0b69,null));};exports[_0x7c4f('0x138')]=function(_0x2c0eed,_0x3d9f11){return db[_0x7c4f('0x39')]['find']({'where':{'id':_0x2c0eed[_0x7c4f('0x54')]['id']}})[_0x7c4f('0x16')](handleEntityNotFound(_0x3d9f11,null))[_0x7c4f('0x16')](function(_0x1ae8d1){if(_0x1ae8d1){return _0x1ae8d1[_0x7c4f('0x138')](_0x2c0eed['query'][_0x7c4f('0x62')])['then'](function(){if(_[_0x7c4f('0xb5')](_0x2c0eed[_0x7c4f('0x42')][_0x7c4f('0x62')])){for(var _0x298396=0x0;_0x298396<_0x2c0eed[_0x7c4f('0x42')]['ids']['length'];_0x298396+=0x1){socket[_0x7c4f('0xb6')](_0x7c4f('0x139'),{'SmsInteractionId':Number(_0x2c0eed[_0x7c4f('0x42')][_0x7c4f('0x62')][_0x298396]),'UserId':Number(_0x2c0eed[_0x7c4f('0x54')]['id'])});}}else{socket['emit']('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x2c0eed['query']['ids']),'UserId':Number(_0x2c0eed[_0x7c4f('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x3d9f11,null))['catch'](handleError(_0x3d9f11,null));};exports[_0x7c4f('0x13a')]=function(_0x57026c,_0x1f1042){return db[_0x7c4f('0x39')][_0x7c4f('0x5d')]({'where':{'id':_0x57026c[_0x7c4f('0x54')]['id']}})['then'](handleEntityNotFound(_0x1f1042,null))[_0x7c4f('0x16')](function(_0x5a34ce){if(_0x5a34ce){return _0x5a34ce[_0x7c4f('0x13a')](_0x57026c[_0x7c4f('0x5e')]['ids'],_[_0x7c4f('0x61')](_0x57026c[_0x7c4f('0x5e')],[_0x7c4f('0x62'),'id'])||{})[_0x7c4f('0x12a')](function(){for(var _0x55effb=0x0;_0x55effb<_0x57026c[_0x7c4f('0x5e')][_0x7c4f('0x62')][_0x7c4f('0x49')];_0x55effb+=0x1){socket[_0x7c4f('0xb6')](_0x7c4f('0x13b'),{'OpenchannelInteractionId':Number(_0x57026c[_0x7c4f('0x5e')][_0x7c4f('0x62')][_0x55effb]),'UserId':Number(_0x57026c[_0x7c4f('0x54')]['id'])});}return _0x57026c[_0x7c4f('0x5e')]['ids'];});}})[_0x7c4f('0x16')](respondWithResult(_0x1f1042,null))[_0x7c4f('0x1e')](handleError(_0x1f1042,null));};exports[_0x7c4f('0x13c')]=function(_0xcc56a5,_0x437f91){return db['User'][_0x7c4f('0x5d')]({'where':{'id':_0xcc56a5[_0x7c4f('0x54')]['id']}})[_0x7c4f('0x16')](handleEntityNotFound(_0x437f91,null))['then'](function(_0x5a0886){if(_0x5a0886){return _0x5a0886[_0x7c4f('0x13c')](_0xcc56a5['query'][_0x7c4f('0x62')])[_0x7c4f('0x16')](function(){if(_['isArray'](_0xcc56a5[_0x7c4f('0x42')][_0x7c4f('0x62')])){for(var _0x5d7de9=0x0;_0x5d7de9<_0xcc56a5[_0x7c4f('0x42')][_0x7c4f('0x62')][_0x7c4f('0x49')];_0x5d7de9+=0x1){socket[_0x7c4f('0xb6')](_0x7c4f('0x13d'),{'OpenchannelInteractionId':Number(_0xcc56a5[_0x7c4f('0x42')][_0x7c4f('0x62')][_0x5d7de9]),'UserId':Number(_0xcc56a5['params']['id'])});}}else{socket['emit']('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0xcc56a5[_0x7c4f('0x42')]['ids']),'UserId':Number(_0xcc56a5[_0x7c4f('0x54')]['id'])});}});}})[_0x7c4f('0x16')](respondWithStatusCode(_0x437f91,null))[_0x7c4f('0x1e')](handleError(_0x437f91,null));};exports['addWhatsappInteractions']=function(_0x5acab0,_0x2cf289){return db['User'][_0x7c4f('0x5d')]({'where':{'id':_0x5acab0[_0x7c4f('0x54')]['id']}})['then'](handleEntityNotFound(_0x2cf289,null))[_0x7c4f('0x16')](function(_0x5dfdb6){if(_0x5dfdb6){return _0x5dfdb6[_0x7c4f('0x13e')](_0x5acab0[_0x7c4f('0x5e')]['ids'],_[_0x7c4f('0x61')](_0x5acab0[_0x7c4f('0x5e')],[_0x7c4f('0x62'),'id'])||{})[_0x7c4f('0x12a')](function(){for(var _0x4733c9=0x0;_0x4733c9<_0x5acab0['body']['ids'][_0x7c4f('0x49')];_0x4733c9+=0x1){socket[_0x7c4f('0xb6')](_0x7c4f('0x13f'),{'WhatsappInteractionId':Number(_0x5acab0[_0x7c4f('0x5e')]['ids'][_0x4733c9]),'UserId':Number(_0x5acab0[_0x7c4f('0x54')]['id'])});}return _0x5acab0[_0x7c4f('0x5e')][_0x7c4f('0x62')];});}})[_0x7c4f('0x16')](respondWithResult(_0x2cf289,null))['catch'](handleError(_0x2cf289,null));};exports[_0x7c4f('0x140')]=function(_0x5280e9,_0x2856ac){return db[_0x7c4f('0x39')]['find']({'where':{'id':_0x5280e9[_0x7c4f('0x54')]['id']}})[_0x7c4f('0x16')](handleEntityNotFound(_0x2856ac,null))['then'](function(_0x5dd497){if(_0x5dd497){return _0x5dd497['removeWhatsappInteractions'](_0x5280e9[_0x7c4f('0x42')][_0x7c4f('0x62')]);}})[_0x7c4f('0x16')](respondWithStatusCode(_0x2856ac,null))[_0x7c4f('0x1e')](handleError(_0x2856ac,null));};exports['getVoicePrefixes']=function(_0x2aa223,_0x4718d5){var _0x2232e0={};var _0xf342c={};var _0x213387;var _0x42ecfe;return db[_0x7c4f('0x39')][_0x7c4f('0xcb')]({'where':{'id':_0x2aa223[_0x7c4f('0x54')]['id']}})[_0x7c4f('0x16')](handleEntityNotFound(_0x4718d5,null))[_0x7c4f('0x16')](function(_0x77ed93){if(_0x77ed93){_0x213387=_0x77ed93;_0xf342c['model']=_[_0x7c4f('0x57')](db[_0x7c4f('0x141')][_0x7c4f('0x3a')]);_0xf342c[_0x7c4f('0x42')]=_[_0x7c4f('0x57')](_0x2aa223[_0x7c4f('0x42')]);_0xf342c[_0x7c4f('0x59')]=_[_0x7c4f('0x5a')](_0xf342c['model'],_0xf342c['query']);_0x2232e0['attributes']=_['intersection'](_0xf342c['model'],qs['fields'](_0x2aa223[_0x7c4f('0x42')][_0x7c4f('0x5b')]));_0x2232e0[_0x7c4f('0x45')]=_0x2232e0['attributes'][_0x7c4f('0x49')]?_0x2232e0['attributes']:_0xf342c[_0x7c4f('0x55')];_0x2232e0[_0x7c4f('0xcc')]=qs['sort'](_0x2aa223['query'][_0x7c4f('0xcd')]);_0x2232e0[_0x7c4f('0x3f')]=qs[_0x7c4f('0x59')](_[_0x7c4f('0xce')](_0x2aa223[_0x7c4f('0x42')],_0xf342c[_0x7c4f('0x59')]));if(_0x2aa223[_0x7c4f('0x42')][_0x7c4f('0x30')]){_0x2232e0[_0x7c4f('0x3f')]=_[_0x7c4f('0x5c')](_0x2232e0[_0x7c4f('0x3f')],{'$or':_[_0x7c4f('0x31')](_0x2232e0[_0x7c4f('0x45')],function(_0x338213){var _0x557d57={};_0x557d57[_0x338213]={'$like':'%'+_0x2aa223[_0x7c4f('0x42')]['filter']+'%'};return _0x557d57;})});}_0x2232e0=_[_0x7c4f('0x5c')]({},_0x2232e0,_0x2aa223[_0x7c4f('0xd8')]);return _0x213387[_0x7c4f('0x142')](_0x2232e0);}})['then'](function(_0x510e79){if(_0x510e79){_0x42ecfe=_0x510e79[_0x7c4f('0x49')];if(!_0x2aa223[_0x7c4f('0x42')][_0x7c4f('0xd0')](_0x7c4f('0xd5'))){_0x2232e0['limit']=qs[_0x7c4f('0x24')](_0x2aa223['query']['limit']);_0x2232e0[_0x7c4f('0x21')]=qs[_0x7c4f('0x21')](_0x2aa223[_0x7c4f('0x42')][_0x7c4f('0x21')]);}return _0x213387[_0x7c4f('0x142')](_0x2232e0);}})['then'](function(_0x4ebe41){if(_0x4ebe41){return _0x4ebe41?{'count':_0x42ecfe,'rows':_0x4ebe41}:null;}})[_0x7c4f('0x16')](respondWithResult(_0x4718d5,null))[_0x7c4f('0x1e')](handleError(_0x4718d5,null));};exports[_0x7c4f('0x143')]=function(_0x215d05,_0x4b12ea){var _0x583a2d={};var _0x580111={};var _0x3ae5d6;var _0x4f4865;return db[_0x7c4f('0x39')]['findOne']({'where':{'id':_0x215d05['params']['id']}})['then'](handleEntityNotFound(_0x4b12ea,null))[_0x7c4f('0x16')](function(_0xff1522){if(_0xff1522){_0x3ae5d6=_0xff1522;_0x580111['model']=_['keys'](db[_0x7c4f('0x144')][_0x7c4f('0x3a')]);_0x580111['query']=_[_0x7c4f('0x57')](_0x215d05['query']);_0x580111[_0x7c4f('0x59')]=_[_0x7c4f('0x5a')](_0x580111['model'],_0x580111[_0x7c4f('0x42')]);_0x583a2d[_0x7c4f('0x45')]=_[_0x7c4f('0x5a')](_0x580111[_0x7c4f('0x55')],qs[_0x7c4f('0x5b')](_0x215d05[_0x7c4f('0x42')]['fields']));_0x583a2d[_0x7c4f('0x45')]=_0x583a2d[_0x7c4f('0x45')][_0x7c4f('0x49')]?_0x583a2d[_0x7c4f('0x45')]:_0x580111[_0x7c4f('0x55')];_0x583a2d[_0x7c4f('0xcc')]=qs[_0x7c4f('0xcd')](_0x215d05[_0x7c4f('0x42')][_0x7c4f('0xcd')]);_0x583a2d['where']=qs[_0x7c4f('0x59')](_['pick'](_0x215d05[_0x7c4f('0x42')],_0x580111['filters']));if(_0x215d05[_0x7c4f('0x42')][_0x7c4f('0x30')]){_0x583a2d[_0x7c4f('0x3f')]=_[_0x7c4f('0x5c')](_0x583a2d['where'],{'$or':_[_0x7c4f('0x31')](_0x583a2d[_0x7c4f('0x45')],function(_0x225177){var _0x42b3fc={};_0x42b3fc[_0x225177]={'$like':'%'+_0x215d05[_0x7c4f('0x42')][_0x7c4f('0x30')]+'%'};return _0x42b3fc;})});}_0x583a2d=_[_0x7c4f('0x5c')]({},_0x583a2d,_0x215d05[_0x7c4f('0xd8')]);return _0x3ae5d6[_0x7c4f('0x143')](_0x583a2d);}})[_0x7c4f('0x16')](function(_0x473edf){if(_0x473edf){_0x4f4865=_0x473edf[_0x7c4f('0x49')];if(!_0x215d05[_0x7c4f('0x42')]['hasOwnProperty']('nolimit')){_0x583a2d['limit']=qs[_0x7c4f('0x24')](_0x215d05[_0x7c4f('0x42')][_0x7c4f('0x24')]);_0x583a2d[_0x7c4f('0x21')]=qs[_0x7c4f('0x21')](_0x215d05[_0x7c4f('0x42')][_0x7c4f('0x21')]);}return _0x3ae5d6[_0x7c4f('0x143')](_0x583a2d);}})[_0x7c4f('0x16')](function(_0x3d18ae){if(_0x3d18ae){return _0x3d18ae?{'count':_0x4f4865,'rows':_0x3d18ae}:null;}})[_0x7c4f('0x16')](respondWithResult(_0x4b12ea,null))[_0x7c4f('0x1e')](handleError(_0x4b12ea,null));};exports[_0x7c4f('0x145')]=function(_0x5d0b2e,_0x59c450){return db[_0x7c4f('0x39')]['find']({'where':{'id':_0x5d0b2e['params']['id']}})[_0x7c4f('0x16')](handleEntityNotFound(_0x59c450,null))['then'](function(_0x1381b9){if(_0x1381b9){return _0x1381b9['addFaxAccounts'](_0x5d0b2e[_0x7c4f('0x5e')][_0x7c4f('0x62')],_[_0x7c4f('0x61')](_0x5d0b2e['body'],[_0x7c4f('0x62'),'id'])||{});}})[_0x7c4f('0x16')](respondWithResult(_0x59c450,null))['catch'](handleError(_0x59c450,null));};exports['removeFaxAccounts']=function(_0x49a570,_0x5da96d){return db[_0x7c4f('0x39')][_0x7c4f('0x5d')]({'where':{'id':_0x49a570[_0x7c4f('0x54')]['id']}})[_0x7c4f('0x16')](handleEntityNotFound(_0x5da96d,null))[_0x7c4f('0x16')](function(_0x33d9cc){if(_0x33d9cc){return _0x33d9cc[_0x7c4f('0x146')](_0x49a570['query'][_0x7c4f('0x62')]);}})[_0x7c4f('0x16')](respondWithStatusCode(_0x5da96d,null))[_0x7c4f('0x1e')](handleError(_0x5da96d,null));};exports[_0x7c4f('0x147')]=function(_0x8422ec,_0xbcd5ac){var _0x573247={};var _0x4c1622={};var _0x837dc8;var _0x1488c4;return db[_0x7c4f('0x39')][_0x7c4f('0xcb')]({'where':{'id':_0x8422ec[_0x7c4f('0x54')]['id']}})[_0x7c4f('0x16')](handleEntityNotFound(_0xbcd5ac,null))[_0x7c4f('0x16')](function(_0x3732cb){if(_0x3732cb){_0x837dc8=_0x3732cb;_0x4c1622['model']=_[_0x7c4f('0x57')](db['MailAccount']['rawAttributes']);_0x4c1622[_0x7c4f('0x42')]=_[_0x7c4f('0x57')](_0x8422ec[_0x7c4f('0x42')]);_0x4c1622[_0x7c4f('0x59')]=_['intersection'](_0x4c1622['model'],_0x4c1622[_0x7c4f('0x42')]);_0x573247[_0x7c4f('0x45')]=_[_0x7c4f('0x5a')](_0x4c1622[_0x7c4f('0x55')],qs[_0x7c4f('0x5b')](_0x8422ec['query']['fields']));_0x573247[_0x7c4f('0x45')]=_0x573247[_0x7c4f('0x45')][_0x7c4f('0x49')]?_0x573247[_0x7c4f('0x45')]:_0x4c1622[_0x7c4f('0x55')];_0x573247['order']=qs[_0x7c4f('0xcd')](_0x8422ec[_0x7c4f('0x42')][_0x7c4f('0xcd')]);_0x573247[_0x7c4f('0x3f')]=qs[_0x7c4f('0x59')](_[_0x7c4f('0xce')](_0x8422ec[_0x7c4f('0x42')],_0x4c1622[_0x7c4f('0x59')]));if(_0x8422ec[_0x7c4f('0x42')]['filter']){_0x573247[_0x7c4f('0x3f')]=_[_0x7c4f('0x5c')](_0x573247[_0x7c4f('0x3f')],{'$or':_[_0x7c4f('0x31')](_0x573247[_0x7c4f('0x45')],function(_0x5860f6){var _0xa56124={};_0xa56124[_0x5860f6]={'$like':'%'+_0x8422ec['query'][_0x7c4f('0x30')]+'%'};return _0xa56124;})});}_0x573247=_['merge']({},_0x573247,_0x8422ec[_0x7c4f('0xd8')]);return _0x837dc8['getMailAccounts'](_0x573247);}})[_0x7c4f('0x16')](function(_0x39146a){if(_0x39146a){_0x1488c4=_0x39146a[_0x7c4f('0x49')];if(!_0x8422ec[_0x7c4f('0x42')][_0x7c4f('0xd0')]('nolimit')){_0x573247[_0x7c4f('0x24')]=qs[_0x7c4f('0x24')](_0x8422ec[_0x7c4f('0x42')]['limit']);_0x573247[_0x7c4f('0x21')]=qs[_0x7c4f('0x21')](_0x8422ec[_0x7c4f('0x42')]['offset']);}return _0x837dc8['getMailAccounts'](_0x573247);}})[_0x7c4f('0x16')](function(_0x3788ab){if(_0x3788ab){return _0x3788ab?{'count':_0x1488c4,'rows':_0x3788ab}:null;}})[_0x7c4f('0x16')](respondWithResult(_0xbcd5ac,null))[_0x7c4f('0x1e')](handleError(_0xbcd5ac,null));};exports[_0x7c4f('0x148')]=function(_0x2e4a48,_0x4ec297){return db[_0x7c4f('0x39')][_0x7c4f('0x5d')]({'where':{'id':_0x2e4a48[_0x7c4f('0x54')]['id']}})['then'](handleEntityNotFound(_0x4ec297,null))['then'](function(_0x57e93f){if(_0x57e93f){return _0x57e93f[_0x7c4f('0x148')](_0x2e4a48[_0x7c4f('0x5e')][_0x7c4f('0x62')],_[_0x7c4f('0x61')](_0x2e4a48['body'],[_0x7c4f('0x62'),'id'])||{});}})['then'](respondWithResult(_0x4ec297,null))[_0x7c4f('0x1e')](handleError(_0x4ec297,null));};exports['removeMailAccounts']=function(_0x46bf47,_0x142225){return db[_0x7c4f('0x39')][_0x7c4f('0x5d')]({'where':{'id':_0x46bf47['params']['id']}})[_0x7c4f('0x16')](handleEntityNotFound(_0x142225,null))[_0x7c4f('0x16')](function(_0x78d475){if(_0x78d475){return _0x78d475[_0x7c4f('0x149')](_0x46bf47['query']['ids']);}})[_0x7c4f('0x16')](respondWithStatusCode(_0x142225,null))[_0x7c4f('0x1e')](handleError(_0x142225,null));};exports[_0x7c4f('0x14a')]=function(_0x29b445,_0x17031e){var _0x3ba210={};var _0x34604d={};var _0xeea2cf;var _0x50e826;return db[_0x7c4f('0x39')][_0x7c4f('0xcb')]({'where':{'id':_0x29b445[_0x7c4f('0x54')]['id']}})[_0x7c4f('0x16')](handleEntityNotFound(_0x17031e,null))[_0x7c4f('0x16')](function(_0xbf82c5){if(_0xbf82c5){_0xeea2cf=_0xbf82c5;_0x34604d['model']=_[_0x7c4f('0x57')](db['OpenchannelAccount']['rawAttributes']);_0x34604d[_0x7c4f('0x42')]=_[_0x7c4f('0x57')](_0x29b445['query']);_0x34604d['filters']=_['intersection'](_0x34604d[_0x7c4f('0x55')],_0x34604d[_0x7c4f('0x42')]);_0x3ba210[_0x7c4f('0x45')]=_[_0x7c4f('0x5a')](_0x34604d['model'],qs[_0x7c4f('0x5b')](_0x29b445['query'][_0x7c4f('0x5b')]));_0x3ba210[_0x7c4f('0x45')]=_0x3ba210[_0x7c4f('0x45')]['length']?_0x3ba210[_0x7c4f('0x45')]:_0x34604d[_0x7c4f('0x55')];_0x3ba210[_0x7c4f('0xcc')]=qs[_0x7c4f('0xcd')](_0x29b445[_0x7c4f('0x42')][_0x7c4f('0xcd')]);_0x3ba210['where']=qs['filters'](_[_0x7c4f('0xce')](_0x29b445['query'],_0x34604d[_0x7c4f('0x59')]));if(_0x29b445[_0x7c4f('0x42')][_0x7c4f('0x30')]){_0x3ba210['where']=_[_0x7c4f('0x5c')](_0x3ba210[_0x7c4f('0x3f')],{'$or':_[_0x7c4f('0x31')](_0x3ba210[_0x7c4f('0x45')],function(_0x1980d8){var _0x2c9951={};_0x2c9951[_0x1980d8]={'$like':'%'+_0x29b445['query'][_0x7c4f('0x30')]+'%'};return _0x2c9951;})});}_0x3ba210=_[_0x7c4f('0x5c')]({},_0x3ba210,_0x29b445[_0x7c4f('0xd8')]);return _0xeea2cf[_0x7c4f('0x14a')](_0x3ba210);}})[_0x7c4f('0x16')](function(_0x4a6632){if(_0x4a6632){_0x50e826=_0x4a6632[_0x7c4f('0x49')];if(!_0x29b445[_0x7c4f('0x42')][_0x7c4f('0xd0')](_0x7c4f('0xd5'))){_0x3ba210[_0x7c4f('0x24')]=qs['limit'](_0x29b445[_0x7c4f('0x42')][_0x7c4f('0x24')]);_0x3ba210[_0x7c4f('0x21')]=qs[_0x7c4f('0x21')](_0x29b445['query']['offset']);}return _0xeea2cf[_0x7c4f('0x14a')](_0x3ba210);}})['then'](function(_0xdf7177){if(_0xdf7177){return _0xdf7177?{'count':_0x50e826,'rows':_0xdf7177}:null;}})[_0x7c4f('0x16')](respondWithResult(_0x17031e,null))[_0x7c4f('0x1e')](handleError(_0x17031e,null));};exports['addOpenchannelAccounts']=function(_0x52fd25,_0x8ed7eb){return db[_0x7c4f('0x39')][_0x7c4f('0x5d')]({'where':{'id':_0x52fd25[_0x7c4f('0x54')]['id']}})[_0x7c4f('0x16')](handleEntityNotFound(_0x8ed7eb,null))[_0x7c4f('0x16')](function(_0x859aea){if(_0x859aea){return _0x859aea['addOpenchannelAccounts'](_0x52fd25['body'][_0x7c4f('0x62')],_[_0x7c4f('0x61')](_0x52fd25[_0x7c4f('0x5e')],[_0x7c4f('0x62'),'id'])||{});}})[_0x7c4f('0x16')](respondWithResult(_0x8ed7eb,null))[_0x7c4f('0x1e')](handleError(_0x8ed7eb,null));};exports[_0x7c4f('0x14b')]=function(_0x34ea5c,_0x4c2b3f){return db[_0x7c4f('0x39')]['find']({'where':{'id':_0x34ea5c['params']['id']}})[_0x7c4f('0x16')](handleEntityNotFound(_0x4c2b3f,null))[_0x7c4f('0x16')](function(_0x3886e6){if(_0x3886e6){return _0x3886e6[_0x7c4f('0x14b')](_0x34ea5c[_0x7c4f('0x42')]['ids']);}})[_0x7c4f('0x16')](respondWithStatusCode(_0x4c2b3f,null))[_0x7c4f('0x1e')](handleError(_0x4c2b3f,null));};exports[_0x7c4f('0x14c')]=function(_0x406868,_0x23d280){var _0x564ef4={};var _0x10840e={};var _0x32cce7;var _0x10ba62;return db[_0x7c4f('0x39')][_0x7c4f('0xcb')]({'where':{'id':_0x406868[_0x7c4f('0x54')]['id']}})[_0x7c4f('0x16')](handleEntityNotFound(_0x23d280,null))[_0x7c4f('0x16')](function(_0xe106fd){if(_0xe106fd){_0x32cce7=_0xe106fd;_0x10840e[_0x7c4f('0x55')]=_[_0x7c4f('0x57')](db[_0x7c4f('0x14d')][_0x7c4f('0x3a')]);_0x10840e['query']=_['keys'](_0x406868['query']);_0x10840e[_0x7c4f('0x59')]=_[_0x7c4f('0x5a')](_0x10840e['model'],_0x10840e[_0x7c4f('0x42')]);_0x564ef4['attributes']=_['intersection'](_0x10840e[_0x7c4f('0x55')],qs[_0x7c4f('0x5b')](_0x406868[_0x7c4f('0x42')][_0x7c4f('0x5b')]));_0x564ef4[_0x7c4f('0x45')]=_0x564ef4[_0x7c4f('0x45')][_0x7c4f('0x49')]?_0x564ef4[_0x7c4f('0x45')]:_0x10840e[_0x7c4f('0x55')];_0x564ef4[_0x7c4f('0xcc')]=qs[_0x7c4f('0xcd')](_0x406868[_0x7c4f('0x42')][_0x7c4f('0xcd')]);_0x564ef4['where']=qs[_0x7c4f('0x59')](_[_0x7c4f('0xce')](_0x406868[_0x7c4f('0x42')],_0x10840e[_0x7c4f('0x59')]));if(_0x406868[_0x7c4f('0x42')]['filter']){_0x564ef4['where']=_[_0x7c4f('0x5c')](_0x564ef4['where'],{'$or':_['map'](_0x564ef4[_0x7c4f('0x45')],function(_0x16c4cd){var _0x34a8ca={};_0x34a8ca[_0x16c4cd]={'$like':'%'+_0x406868[_0x7c4f('0x42')][_0x7c4f('0x30')]+'%'};return _0x34a8ca;})});}_0x564ef4=_[_0x7c4f('0x5c')]({},_0x564ef4,_0x406868['options']);return _0x32cce7['getSmsAccounts'](_0x564ef4);}})[_0x7c4f('0x16')](function(_0x104cdb){if(_0x104cdb){_0x10ba62=_0x104cdb[_0x7c4f('0x49')];if(!_0x406868['query'][_0x7c4f('0xd0')](_0x7c4f('0xd5'))){_0x564ef4[_0x7c4f('0x24')]=qs[_0x7c4f('0x24')](_0x406868[_0x7c4f('0x42')][_0x7c4f('0x24')]);_0x564ef4[_0x7c4f('0x21')]=qs[_0x7c4f('0x21')](_0x406868[_0x7c4f('0x42')]['offset']);}return _0x32cce7['getSmsAccounts'](_0x564ef4);}})[_0x7c4f('0x16')](function(_0x3a11a9){if(_0x3a11a9){return _0x3a11a9?{'count':_0x10ba62,'rows':_0x3a11a9}:null;}})[_0x7c4f('0x16')](respondWithResult(_0x23d280,null))[_0x7c4f('0x1e')](handleError(_0x23d280,null));};exports[_0x7c4f('0x14e')]=function(_0x5f1b62,_0x5cbebc){return db[_0x7c4f('0x39')]['find']({'where':{'id':_0x5f1b62[_0x7c4f('0x54')]['id']}})['then'](handleEntityNotFound(_0x5cbebc,null))['then'](function(_0x26f31b){if(_0x26f31b){return _0x26f31b[_0x7c4f('0x14e')](_0x5f1b62[_0x7c4f('0x5e')][_0x7c4f('0x62')],_[_0x7c4f('0x61')](_0x5f1b62[_0x7c4f('0x5e')],[_0x7c4f('0x62'),'id'])||{});}})[_0x7c4f('0x16')](respondWithResult(_0x5cbebc,null))[_0x7c4f('0x1e')](handleError(_0x5cbebc,null));};exports['removeSmsAccounts']=function(_0x1cc9ef,_0x4da6eb){return db[_0x7c4f('0x39')][_0x7c4f('0x5d')]({'where':{'id':_0x1cc9ef[_0x7c4f('0x54')]['id']}})['then'](handleEntityNotFound(_0x4da6eb,null))[_0x7c4f('0x16')](function(_0x4e56e6){if(_0x4e56e6){return _0x4e56e6[_0x7c4f('0x14f')](_0x1cc9ef['query'][_0x7c4f('0x62')]);}})['then'](respondWithStatusCode(_0x4da6eb,null))[_0x7c4f('0x1e')](handleError(_0x4da6eb,null));};exports[_0x7c4f('0x150')]=function(_0x54c068,_0x4b2cf0){var _0x55b657={};var _0x3fa187={};var _0x58a9db;var _0x53d35d;return db[_0x7c4f('0x39')]['findOne']({'where':{'id':_0x54c068[_0x7c4f('0x54')]['id']}})[_0x7c4f('0x16')](handleEntityNotFound(_0x4b2cf0,null))['then'](function(_0x44ee42){if(_0x44ee42){_0x58a9db=_0x44ee42;_0x3fa187[_0x7c4f('0x55')]=_[_0x7c4f('0x57')](db[_0x7c4f('0x151')][_0x7c4f('0x3a')]);_0x3fa187[_0x7c4f('0x42')]=_[_0x7c4f('0x57')](_0x54c068[_0x7c4f('0x42')]);_0x3fa187[_0x7c4f('0x59')]=_[_0x7c4f('0x5a')](_0x3fa187['model'],_0x3fa187[_0x7c4f('0x42')]);_0x55b657[_0x7c4f('0x45')]=_[_0x7c4f('0x5a')](_0x3fa187[_0x7c4f('0x55')],qs[_0x7c4f('0x5b')](_0x54c068[_0x7c4f('0x42')][_0x7c4f('0x5b')]));_0x55b657[_0x7c4f('0x45')]=_0x55b657[_0x7c4f('0x45')][_0x7c4f('0x49')]?_0x55b657[_0x7c4f('0x45')]:_0x3fa187[_0x7c4f('0x55')];_0x55b657[_0x7c4f('0xcc')]=qs[_0x7c4f('0xcd')](_0x54c068[_0x7c4f('0x42')]['sort']);_0x55b657[_0x7c4f('0x3f')]=qs[_0x7c4f('0x59')](_[_0x7c4f('0xce')](_0x54c068['query'],_0x3fa187['filters']));if(_0x54c068[_0x7c4f('0x42')][_0x7c4f('0x30')]){_0x55b657[_0x7c4f('0x3f')]=_['merge'](_0x55b657[_0x7c4f('0x3f')],{'$or':_['map'](_0x55b657[_0x7c4f('0x45')],function(_0xb5ed8b){var _0x540380={};_0x540380[_0xb5ed8b]={'$like':'%'+_0x54c068['query']['filter']+'%'};return _0x540380;})});}_0x55b657=_['merge']({},_0x55b657,_0x54c068['options']);return _0x58a9db[_0x7c4f('0x150')](_0x55b657);}})[_0x7c4f('0x16')](function(_0x569ac8){if(_0x569ac8){_0x53d35d=_0x569ac8['length'];if(!_0x54c068['query'][_0x7c4f('0xd0')](_0x7c4f('0xd5'))){_0x55b657[_0x7c4f('0x24')]=qs[_0x7c4f('0x24')](_0x54c068[_0x7c4f('0x42')]['limit']);_0x55b657['offset']=qs['offset'](_0x54c068[_0x7c4f('0x42')][_0x7c4f('0x21')]);}return _0x58a9db[_0x7c4f('0x150')](_0x55b657);}})[_0x7c4f('0x16')](function(_0x1a3639){if(_0x1a3639){return _0x1a3639?{'count':_0x53d35d,'rows':_0x1a3639}:null;}})[_0x7c4f('0x16')](respondWithResult(_0x4b2cf0,null))[_0x7c4f('0x1e')](handleError(_0x4b2cf0,null));};exports[_0x7c4f('0x152')]=function(_0x157140,_0x1208fb){return db['User'][_0x7c4f('0x5d')]({'where':{'id':_0x157140[_0x7c4f('0x54')]['id']}})['then'](handleEntityNotFound(_0x1208fb,null))[_0x7c4f('0x16')](function(_0x36363c){if(_0x36363c){return _0x36363c[_0x7c4f('0x152')](_0x157140['body'][_0x7c4f('0x62')],_[_0x7c4f('0x61')](_0x157140[_0x7c4f('0x5e')],[_0x7c4f('0x62'),'id'])||{});}})[_0x7c4f('0x16')](respondWithResult(_0x1208fb,null))[_0x7c4f('0x1e')](handleError(_0x1208fb,null));};exports[_0x7c4f('0x153')]=function(_0x44bd7d,_0xa523){return db[_0x7c4f('0x39')][_0x7c4f('0x5d')]({'where':{'id':_0x44bd7d[_0x7c4f('0x54')]['id']}})[_0x7c4f('0x16')](handleEntityNotFound(_0xa523,null))[_0x7c4f('0x16')](function(_0x501602){if(_0x501602){return _0x501602[_0x7c4f('0x153')](_0x44bd7d[_0x7c4f('0x42')][_0x7c4f('0x62')]);}})[_0x7c4f('0x16')](respondWithStatusCode(_0xa523,null))['catch'](handleError(_0xa523,null));};exports[_0x7c4f('0x154')]=function(_0x5932c,_0x58ed63){var _0x2d03f2={};var _0x2a1a60={};var _0x42dc68;var _0x92f603;return db[_0x7c4f('0x39')][_0x7c4f('0xcb')]({'where':{'id':_0x5932c[_0x7c4f('0x54')]['id']}})['then'](handleEntityNotFound(_0x58ed63,null))[_0x7c4f('0x16')](function(_0x4652ed){if(_0x4652ed){_0x42dc68=_0x4652ed;_0x2a1a60[_0x7c4f('0x55')]=_['keys'](db['WhatsappAccount'][_0x7c4f('0x3a')]);_0x2a1a60[_0x7c4f('0x42')]=_['keys'](_0x5932c[_0x7c4f('0x42')]);_0x2a1a60[_0x7c4f('0x59')]=_[_0x7c4f('0x5a')](_0x2a1a60[_0x7c4f('0x55')],_0x2a1a60[_0x7c4f('0x42')]);_0x2d03f2['attributes']=_[_0x7c4f('0x5a')](_0x2a1a60[_0x7c4f('0x55')],qs[_0x7c4f('0x5b')](_0x5932c[_0x7c4f('0x42')][_0x7c4f('0x5b')]));_0x2d03f2[_0x7c4f('0x45')]=_0x2d03f2[_0x7c4f('0x45')]['length']?_0x2d03f2[_0x7c4f('0x45')]:_0x2a1a60['model'];_0x2d03f2['order']=qs[_0x7c4f('0xcd')](_0x5932c['query'][_0x7c4f('0xcd')]);_0x2d03f2[_0x7c4f('0x3f')]=qs['filters'](_['pick'](_0x5932c[_0x7c4f('0x42')],_0x2a1a60[_0x7c4f('0x59')]));if(_0x5932c[_0x7c4f('0x42')][_0x7c4f('0x30')]){_0x2d03f2[_0x7c4f('0x3f')]=_[_0x7c4f('0x5c')](_0x2d03f2['where'],{'$or':_['map'](_0x2d03f2[_0x7c4f('0x45')],function(_0x2f4d95){var _0x2b9bb6={};_0x2b9bb6[_0x2f4d95]={'$like':'%'+_0x5932c['query']['filter']+'%'};return _0x2b9bb6;})});}_0x2d03f2=_[_0x7c4f('0x5c')]({},_0x2d03f2,_0x5932c[_0x7c4f('0xd8')]);return _0x42dc68[_0x7c4f('0x154')](_0x2d03f2);}})[_0x7c4f('0x16')](function(_0x5cecb1){if(_0x5cecb1){_0x92f603=_0x5cecb1[_0x7c4f('0x49')];if(!_0x5932c[_0x7c4f('0x42')][_0x7c4f('0xd0')]('nolimit')){_0x2d03f2[_0x7c4f('0x24')]=qs[_0x7c4f('0x24')](_0x5932c[_0x7c4f('0x42')]['limit']);_0x2d03f2[_0x7c4f('0x21')]=qs[_0x7c4f('0x21')](_0x5932c[_0x7c4f('0x42')][_0x7c4f('0x21')]);}return _0x42dc68[_0x7c4f('0x154')](_0x2d03f2);}})[_0x7c4f('0x16')](function(_0xf9ac34){if(_0xf9ac34){return _0xf9ac34?{'count':_0x92f603,'rows':_0xf9ac34}:null;}})['then'](respondWithResult(_0x58ed63,null))['catch'](handleError(_0x58ed63,null));};exports[_0x7c4f('0x155')]=function(_0x496fc5,_0x5701c3){return db['User'][_0x7c4f('0x5d')]({'where':{'id':_0x496fc5['params']['id']}})[_0x7c4f('0x16')](handleEntityNotFound(_0x5701c3,null))['then'](function(_0x56e001){if(_0x56e001){return _0x56e001[_0x7c4f('0x155')](_0x496fc5[_0x7c4f('0x5e')][_0x7c4f('0x62')],_[_0x7c4f('0x61')](_0x496fc5[_0x7c4f('0x5e')],[_0x7c4f('0x62'),'id'])||{});}})[_0x7c4f('0x16')](respondWithResult(_0x5701c3,null))['catch'](handleError(_0x5701c3,null));};exports[_0x7c4f('0x156')]=function(_0x1b8868,_0x11bd89){return db[_0x7c4f('0x39')][_0x7c4f('0x5d')]({'where':{'id':_0x1b8868['params']['id']}})[_0x7c4f('0x16')](handleEntityNotFound(_0x11bd89,null))[_0x7c4f('0x16')](function(_0x25c476){if(_0x25c476){return _0x25c476[_0x7c4f('0x156')](_0x1b8868[_0x7c4f('0x42')][_0x7c4f('0x62')]);}})['then'](respondWithStatusCode(_0x11bd89,null))[_0x7c4f('0x1e')](handleError(_0x11bd89,null));};exports[_0x7c4f('0x157')]=function(_0x198048,_0x2eb00c){var _0x1c9aaf={};var _0x560420={};var _0x22fe22;var _0x41fcb4;return db[_0x7c4f('0x39')][_0x7c4f('0xcb')]({'where':{'id':_0x198048[_0x7c4f('0x54')]['id']}})[_0x7c4f('0x16')](handleEntityNotFound(_0x2eb00c,null))[_0x7c4f('0x16')](function(_0x302436){if(_0x302436){_0x22fe22=_0x302436;_0x560420[_0x7c4f('0x55')]=_[_0x7c4f('0x57')](db[_0x7c4f('0x158')][_0x7c4f('0x3a')]);_0x560420[_0x7c4f('0x42')]=_[_0x7c4f('0x57')](_0x198048['query']);_0x560420[_0x7c4f('0x59')]=_[_0x7c4f('0x5a')](_0x560420[_0x7c4f('0x55')],_0x560420[_0x7c4f('0x42')]);_0x1c9aaf[_0x7c4f('0x45')]=_[_0x7c4f('0x5a')](_0x560420[_0x7c4f('0x55')],qs[_0x7c4f('0x5b')](_0x198048[_0x7c4f('0x42')]['fields']));_0x1c9aaf[_0x7c4f('0x45')]=_0x1c9aaf[_0x7c4f('0x45')][_0x7c4f('0x49')]?_0x1c9aaf[_0x7c4f('0x45')]:_0x560420['model'];_0x1c9aaf[_0x7c4f('0xcc')]=qs['sort'](_0x198048['query'][_0x7c4f('0xcd')]);_0x1c9aaf[_0x7c4f('0x3f')]=qs[_0x7c4f('0x59')](_[_0x7c4f('0xce')](_0x198048[_0x7c4f('0x42')],_0x560420['filters']));if(_0x198048[_0x7c4f('0x42')][_0x7c4f('0x30')]){_0x1c9aaf[_0x7c4f('0x3f')]=_[_0x7c4f('0x5c')](_0x1c9aaf[_0x7c4f('0x3f')],{'$or':_[_0x7c4f('0x31')](_0x1c9aaf[_0x7c4f('0x45')],function(_0x3bfb07){var _0x4678c7={};_0x4678c7[_0x3bfb07]={'$like':'%'+_0x198048[_0x7c4f('0x42')][_0x7c4f('0x30')]+'%'};return _0x4678c7;})});}_0x1c9aaf=_[_0x7c4f('0x5c')]({},_0x1c9aaf,_0x198048[_0x7c4f('0xd8')]);return _0x22fe22[_0x7c4f('0x157')](_0x1c9aaf);}})[_0x7c4f('0x16')](function(_0x347d39){if(_0x347d39){_0x41fcb4=_0x347d39['length'];if(!_0x198048[_0x7c4f('0x42')][_0x7c4f('0xd0')](_0x7c4f('0xd5'))){_0x1c9aaf['limit']=qs[_0x7c4f('0x24')](_0x198048[_0x7c4f('0x42')][_0x7c4f('0x24')]);_0x1c9aaf[_0x7c4f('0x21')]=qs[_0x7c4f('0x21')](_0x198048[_0x7c4f('0x42')][_0x7c4f('0x21')]);}return _0x22fe22[_0x7c4f('0x157')](_0x1c9aaf);}})['then'](function(_0x516b91){if(_0x516b91){return _0x516b91?{'count':_0x41fcb4,'rows':_0x516b91}:null;}})['then'](respondWithResult(_0x2eb00c,null))[_0x7c4f('0x1e')](handleError(_0x2eb00c,null));};exports[_0x7c4f('0x159')]=function(_0x299a7e,_0x7e2c38){return db[_0x7c4f('0x39')][_0x7c4f('0x5d')]({'where':{'id':_0x299a7e[_0x7c4f('0x54')]['id']}})[_0x7c4f('0x16')](handleEntityNotFound(_0x7e2c38,null))[_0x7c4f('0x16')](function(_0x231391){if(_0x231391){return _0x231391[_0x7c4f('0x159')](_0x299a7e[_0x7c4f('0x5e')][_0x7c4f('0x62')],_[_0x7c4f('0x61')](_0x299a7e['body'],['ids','id'])||{});}})[_0x7c4f('0x16')](respondWithResult(_0x7e2c38,null))[_0x7c4f('0x1e')](handleError(_0x7e2c38,null));};exports[_0x7c4f('0x15a')]=function(_0x155930,_0x2bdc6c){return db[_0x7c4f('0x39')][_0x7c4f('0x5d')]({'where':{'id':_0x155930[_0x7c4f('0x54')]['id']}})[_0x7c4f('0x16')](handleEntityNotFound(_0x2bdc6c,null))[_0x7c4f('0x16')](function(_0x469be5){if(_0x469be5){return _0x469be5[_0x7c4f('0x15a')](_0x155930[_0x7c4f('0x42')][_0x7c4f('0x62')]);}})['then'](respondWithStatusCode(_0x2bdc6c,null))[_0x7c4f('0x1e')](handleError(_0x2bdc6c,null));};exports[_0x7c4f('0x15b')]=function(_0x264b36,_0x476ffd){var _0x1bd66b={},_0xb97eaa={},_0x34f87a={'count':0x0,'rows':[]};var _0x1f1cca=db[_0x7c4f('0x15c')][_0x7c4f('0x3a')];_0xb97eaa[_0x7c4f('0x55')]=_[_0x7c4f('0x57')](_0x1f1cca);_0xb97eaa[_0x7c4f('0x42')]=_[_0x7c4f('0x57')](_0x264b36[_0x7c4f('0x42')]);_0xb97eaa['filters']=_[_0x7c4f('0x5a')](_0xb97eaa[_0x7c4f('0x55')],_0xb97eaa[_0x7c4f('0x42')]);_0xb97eaa[_0x7c4f('0x59')]=_[_0x7c4f('0xca')](_0xb97eaa[_0x7c4f('0x59')],[_0x7c4f('0x15d'),_0x7c4f('0x15e'),'$gt',_0x7c4f('0x15f'),_0x7c4f('0x160'),_0x7c4f('0x161'),_0x7c4f('0x162'),_0x7c4f('0x163'),_0x7c4f('0x164'),'$between',_0x7c4f('0x165'),_0x7c4f('0x166'),'$notIn',_0x7c4f('0x167'),_0x7c4f('0x168'),_0x7c4f('0x169'),_0x7c4f('0x16a'),_0x7c4f('0x167'),_0x7c4f('0x16b'),'$contains',_0x7c4f('0x16c'),_0x7c4f('0x16d')]);_0x1bd66b[_0x7c4f('0x45')]=_[_0x7c4f('0x5a')](_0xb97eaa['model'],qs['fields'](_0x264b36[_0x7c4f('0x42')]['fields']));_0x1bd66b['attributes']=_0x1bd66b[_0x7c4f('0x45')][_0x7c4f('0x49')]?_0x1bd66b[_0x7c4f('0x45')]:_0xb97eaa[_0x7c4f('0x55')];if(!_0x264b36[_0x7c4f('0x42')]['hasOwnProperty'](_0x7c4f('0xd5'))){_0x1bd66b[_0x7c4f('0x24')]=qs[_0x7c4f('0x24')](_0x264b36[_0x7c4f('0x42')]['limit']);_0x1bd66b[_0x7c4f('0x21')]=qs['offset'](_0x264b36[_0x7c4f('0x42')][_0x7c4f('0x21')]);}_0x1bd66b[_0x7c4f('0xcc')]=qs[_0x7c4f('0xcd')](_0x264b36[_0x7c4f('0x42')][_0x7c4f('0xcd')]);_0x1bd66b[_0x7c4f('0x3f')]=qs['filters'](_[_0x7c4f('0xce')](_0x264b36[_0x7c4f('0x42')],_0xb97eaa[_0x7c4f('0x59')]));if(_0x264b36[_0x7c4f('0x42')][_0x7c4f('0x30')]){_0x1bd66b[_0x7c4f('0x3f')]=_[_0x7c4f('0x5c')](_0x1bd66b[_0x7c4f('0x3f')],{'$or':_[_0x7c4f('0x31')](_0x1bd66b[_0x7c4f('0x45')],function(_0x39bb6b){var _0x3b9394={};_0x3b9394[_0x39bb6b]={'$like':'%'+_0x264b36[_0x7c4f('0x42')]['filter']+'%'};return _0x3b9394;})});}_0x1bd66b[_0x7c4f('0x3f')]={'$and':[_0x1bd66b['where'],{'$or':[{'UserId':_0x264b36[_0x7c4f('0x54')]['id']},{'OwnerId':_0x264b36[_0x7c4f('0x54')]['id']}]}]};_0x1bd66b=_[_0x7c4f('0x5c')]({},_0x1bd66b,_0x264b36[_0x7c4f('0xd8')]);var _0x51277d={'where':_0x1bd66b['where']};return db[_0x7c4f('0x15c')][_0x7c4f('0x23')](_0x51277d)[_0x7c4f('0x16')](function(_0xea4b0e){_0x34f87a[_0x7c4f('0x23')]=_0xea4b0e;if(_0x264b36[_0x7c4f('0x42')][_0x7c4f('0x40')]){_0x1bd66b['include']=[{'attributes':['id',_0x7c4f('0x16e'),'lastName',_0x7c4f('0xeb')],'model':db[_0x7c4f('0x16f')],'as':_0x7c4f('0x170')},{'attributes':['id','name',_0x7c4f('0x171')],'model':db[_0x7c4f('0xae')],'as':_0x7c4f('0xd7')}];}return db[_0x7c4f('0x15c')][_0x7c4f('0x46')](_0x1bd66b);})[_0x7c4f('0x16')](function(_0x2d58fa){_0x34f87a['rows']=_0x2d58fa;return _0x34f87a;})[_0x7c4f('0x16')](respondWithFilteredResult(_0x476ffd,_0x1bd66b))['catch'](handleError(_0x476ffd,null));};exports[_0x7c4f('0x172')]=function(_0x4d40cd,_0x42159e){if(!_[_0x7c4f('0x68')](_0x4d40cd['user']['id'])&&(_0x4d40cd[_0x7c4f('0x81')][_0x7c4f('0x2a')]==_0x7c4f('0x2b')||_0x4d40cd[_0x7c4f('0x81')][_0x7c4f('0x2a')]==_0x7c4f('0x81'))){return db['User']['findOne']({'where':{'id':_0x4d40cd[_0x7c4f('0x54')]['id']},'raw':!![]})[_0x7c4f('0x16')](function(_0x1ec531){return authService['retrieveApiKey'](_0x1ec531);})[_0x7c4f('0x16')](function(_0x1c0ae5){if(_0x1c0ae5){return _0x42159e[_0x7c4f('0x1f')](0xc8)['json']({'api_key':_0x1c0ae5[_0x7c4f('0x173')]});}else{return _0x42159e[_0x7c4f('0x1f')](0xcc)[_0x7c4f('0x27')]({'message':_0x7c4f('0x174')});}})[_0x7c4f('0x1e')](handleError(_0x42159e,0x193));}else{return _0x42159e[_0x7c4f('0x1f')](0x191)[_0x7c4f('0x27')]({'message':'You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.'});}};exports['createApiKey']=function(_0x450782,_0x1d5b9e){if(!_['isNil'](_0x450782[_0x7c4f('0x81')]['id'])&&(_0x450782[_0x7c4f('0x81')][_0x7c4f('0x2a')]=='admin'||_0x450782[_0x7c4f('0x81')][_0x7c4f('0x2a')]=='user')){return db['User']['find']({'where':{'id':_0x450782[_0x7c4f('0x54')]['id']}})['then'](function(_0xecfef0){return authService['generateApiKey'](_0xecfef0);})[_0x7c4f('0x16')](function(_0x3d96c9){return db['User']['update']({'apiKeyIat':_0x3d96c9[_0x7c4f('0x175')],'apiKeyNonce':_0x3d96c9[_0x7c4f('0x176')]},{'where':{'id':_0x450782[_0x7c4f('0x54')]['id']}})['then'](function(){return _0x1d5b9e[_0x7c4f('0x1f')](0xc8)['json']({'api_key':_0x3d96c9[_0x7c4f('0x173')]});});})[_0x7c4f('0x1e')](handleError(_0x1d5b9e,0x193));}else{return _0x1d5b9e[_0x7c4f('0x1f')](0x191)[_0x7c4f('0x27')]({'message':_0x7c4f('0x177')});}};exports[_0x7c4f('0x178')]=function(_0x1b651e,_0x167286){if(!_[_0x7c4f('0x68')](_0x1b651e[_0x7c4f('0x81')]['id'])&&(_0x1b651e[_0x7c4f('0x81')][_0x7c4f('0x2a')]==_0x7c4f('0x2b')||_0x1b651e[_0x7c4f('0x81')]['role']==_0x7c4f('0x81'))){return db[_0x7c4f('0x39')][_0x7c4f('0x5d')]({'where':{'id':_0x1b651e['params']['id']}})[_0x7c4f('0x16')](handleEntityNotFound(_0x167286,null))['then'](function(_0x29b08a){if(_0x29b08a&&_0x29b08a[_0x7c4f('0x179')]&&_0x29b08a[_0x7c4f('0x17a')])return _0x29b08a;else throw{'message':_0x7c4f('0x17b')};})['then'](function(){return db[_0x7c4f('0x39')][_0x7c4f('0x28')]({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x1b651e[_0x7c4f('0x54')]['id']}});})[_0x7c4f('0x16')](respondWithStatusCode(_0x167286,0xc8))[_0x7c4f('0x1e')](handleError(_0x167286,0x193));}else{return _0x167286[_0x7c4f('0x1f')](0x191)['json']({'message':_0x7c4f('0x177')});}};exports[_0x7c4f('0x17c')]=function(_0x3a7a42,_0x1ae859){var _0xb186e8=_0x3a7a42[_0x7c4f('0x81')][_0x7c4f('0xaf')]({'plain':!![]});if(!_0xb186e8){return _0x1ae859[_0x7c4f('0x1f')](0x191)['send']('Unable\x20to\x20retrieve\x20the\x20current\x20user');}else{Promise[_0x7c4f('0x100')]()[_0x7c4f('0x16')](function(){if(_0x3a7a42[_0x7c4f('0x42')]['userSetting']!=='true')return;return _0x3a7a42[_0x7c4f('0x81')][_0x7c4f('0x17d')]();})['then'](function(_0x2cbddb){if(!_0x2cbddb)return;return _0x2cbddb[_0x7c4f('0xaf')]({'plain':!![]});})[_0x7c4f('0x16')](function(_0x37228b){_0xb186e8[_0x7c4f('0x43')]=_0x37228b;return _0x1ae859[_0x7c4f('0x1f')](0xc8)[_0x7c4f('0x27')](_0xb186e8);});}};exports[_0x7c4f('0x17e')]=function(_0x4fbd41,_0x548955){var _0x5e7cac={'offset':0x0},_0x341c2b={'count':0x0,'rows':[]};Promise['resolve']()[_0x7c4f('0x16')](function(){if(!_0x4fbd41[_0x7c4f('0x42')][_0x7c4f('0x30')]&&!_0x4fbd41[_0x7c4f('0x42')][_0x7c4f('0x17f')]&&!_0x4fbd41[_0x7c4f('0x42')][_0x7c4f('0x180')])return[];return Promise[_0x7c4f('0x100')]()[_0x7c4f('0x16')](function(){var _0x237a9e=[];if(!_[_0x7c4f('0x8f')](_0x4fbd41['query'][_0x7c4f('0x17f')])){_0x237a9e[_0x7c4f('0x4a')](db[_0x7c4f('0x110')][_0x7c4f('0x46')]({'attributes':['id','name'],'where':{'id':_0x4fbd41[_0x7c4f('0x42')][_0x7c4f('0x17f')]}}));}if(!_[_0x7c4f('0x8f')](_0x4fbd41[_0x7c4f('0x42')][_0x7c4f('0x180')])){_0x237a9e['push'](db[_0x7c4f('0xae')][_0x7c4f('0x46')]({'attributes':['id',_0x7c4f('0x34')],'type':_0x7c4f('0x181'),'where':{'id':_0x4fbd41['query'][_0x7c4f('0x180')]}}));}return Promise[_0x7c4f('0x52')](_0x237a9e);})[_0x7c4f('0x16')](function(_0x21b33a){var _0x16530e=_[_0x7c4f('0x11a')](_0x21b33a)['map'](function(_0x2d417c){return _0x2d417c[_0x7c4f('0x182')]({'attributes':['id',_0x7c4f('0x34'),_0x7c4f('0x63'),'online'],'raw':!![]});});return Promise[_0x7c4f('0x52')](_0x16530e);})[_0x7c4f('0x16')](function(_0x2902ed){var _0x430afb=_[_0x7c4f('0x11a')](_0x2902ed);if(!_0x4fbd41[_0x7c4f('0x42')][_0x7c4f('0x30')])return _0x430afb;if(_[_0x7c4f('0x8f')](_0x430afb)){return db['User'][_0x7c4f('0x46')]({'attributes':['id','name',_0x7c4f('0x63'),_0x7c4f('0xa2')],'where':{'role':'agent','$or':[db[_0x7c4f('0x6a')][_0x7c4f('0x3f')](db[_0x7c4f('0x6a')]['fn'](_0x7c4f('0x183'),db[_0x7c4f('0x6a')]['col'](_0x7c4f('0x34'))),{'$like':'%'+_0x4fbd41[_0x7c4f('0x42')][_0x7c4f('0x30')][_0x7c4f('0xa9')]()+'%'}),{'internal':{'$like':'%'+_0x4fbd41[_0x7c4f('0x42')]['filter']+'%'}}]},'raw':!![]});}else{return _(_0x430afb)[_0x7c4f('0x11a')]()[_0x7c4f('0x30')](function(_0x296361){return _0x296361[_0x7c4f('0x34')][_0x7c4f('0xa9')]()[_0x7c4f('0x33')](_0x4fbd41['query']['filter']['toLowerCase']())||_0x296361[_0x7c4f('0x63')][_0x7c4f('0x184')]()['includes'](_0x4fbd41[_0x7c4f('0x42')]['filter']);})[_0x7c4f('0x32')]();}})['then'](function(_0x3af6e7){var _0x448279=_0x7c4f('0x34');var _0x1fa6c9=_0x7c4f('0x185');if(_0x4fbd41[_0x7c4f('0x42')][_0x7c4f('0xcd')]){_0x1fa6c9=_0x4fbd41['query'][_0x7c4f('0xcd')][0x0]==='-'?'desc':'asc';_0x448279=_0x1fa6c9===_0x7c4f('0x185')?_0x4fbd41[_0x7c4f('0x42')][_0x7c4f('0xcd')]:_0x4fbd41[_0x7c4f('0x42')][_0x7c4f('0xcd')][_0x7c4f('0x186')](0x1);}return _(_0x3af6e7)[_0x7c4f('0x187')]('id')[_0x7c4f('0x188')]([function(_0x573896){return _0x448279===_0x7c4f('0x34')?_0x573896[_0x448279]['toLowerCase']():_0x573896[_0x448279];}],[_0x1fa6c9])[_0x7c4f('0x31')](function(_0x359206){return _['pick'](_0x359206,['id','name','internal',_0x7c4f('0xa2')]);})['value']();})[_0x7c4f('0x16')](function(_0x2c1c4e){return client['request']('Agents',_0x4fbd41)[_0x7c4f('0x16')](function(_0x27a7aa){if(_0x27a7aa[_0x7c4f('0x1c')])throw new Error(_0x7c4f('0x189'));var _0x40f610=_0x27a7aa[_0x7c4f('0x18a')];var _0x569338=jayson[_0x7c4f('0x13')]['http']({'port':0x232c});return _0x569338[_0x7c4f('0x15')](_0x7c4f('0x8e'),_0x4fbd41)[_0x7c4f('0x16')](function(_0x208a1a){if(_0x208a1a[_0x7c4f('0x1c')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');var _0x377136=_0x208a1a[_0x7c4f('0x18a')];return _[_0x7c4f('0x5c')]({},_0x377136,_0x40f610);});})[_0x7c4f('0x16')](function(_0x5c6e1f){return _[_0x7c4f('0x31')](_0x2c1c4e,function(_0x29c988){var _0x1e3b42=_[_0x7c4f('0x5d')](_0x5c6e1f[_0x7c4f('0x47')],['id',_0x29c988['id']]);if(!_0x1e3b42||!_0x29c988['online']){_0x29c988[_0x7c4f('0x1f')]=_0x7c4f('0x18b');}else if(_0x1e3b42[_0x7c4f('0xa3')]){_0x29c988[_0x7c4f('0x1f')]=_0x7c4f('0x102');}else{_0x29c988[_0x7c4f('0x1f')]=_['includes']([_0x7c4f('0x18c'),_0x7c4f('0x18d'),'unavailable',_0x7c4f('0x18e'),null,undefined],_0x1e3b42['voiceStatus'])?_0x7c4f('0xa2'):_0x7c4f('0x18f');}return _0x29c988;});});});})['then'](function(_0x56dcad){if(!_0x4fbd41[_0x7c4f('0x42')][_0x7c4f('0xd0')]('nolimit')){_0x5e7cac[_0x7c4f('0x24')]=qs[_0x7c4f('0x24')](_0x4fbd41['query']['limit']||0xa);_0x5e7cac['offset']=qs[_0x7c4f('0x21')](_0x4fbd41['query'][_0x7c4f('0x21')]);}_0x341c2b[_0x7c4f('0x23')]=_0x56dcad[_0x7c4f('0x49')];_0x341c2b[_0x7c4f('0x47')]=_0x5e7cac[_0x7c4f('0x24')]?_0x56dcad[_0x7c4f('0x190')](_0x5e7cac[_0x7c4f('0x21')],_0x5e7cac[_0x7c4f('0x21')]+_0x5e7cac[_0x7c4f('0x24')]):_0x56dcad;return _0x341c2b;})['then'](respondWithFilteredResult(_0x548955,_0x5e7cac))[_0x7c4f('0x1e')](handleError(_0x548955,null));};function get_open_tabs(_0x5d7eb4,_0xa88bde){var _0x7a6347=_0x5d7eb4[_0x7c4f('0x191')](0x0)[_0x7c4f('0x192')]()+_0x5d7eb4[_0x7c4f('0x190')](0x1);var _0x1da8e4={'type':db[_0x7c4f('0x97')][_0x7c4f('0x6c')][_0x7c4f('0x6d')],'raw':!![]};return new BPromise(function(_0x31e2d4,_0x265189){var _0xd7bb92=squel[_0x7c4f('0x193')]()[_0x7c4f('0x194')](_0x7c4f('0x195')+_0x7a6347+_0x7c4f('0x196'),'id')['field']('ui.createdAt')[_0x7c4f('0x6e')](_0x7c4f('0x197')+_0x5d7eb4+_0x7c4f('0x198'),'ui')[_0x7c4f('0x3f')](_0x7c4f('0x199'),_0xa88bde['id']);return db[_0x7c4f('0x6a')][_0x7c4f('0x42')](_0xd7bb92[_0x7c4f('0x184')](),_0x1da8e4)[_0x7c4f('0x16')](function(_0xfd5ffa){_0xa88bde[_0x7a6347+_0x7c4f('0x19a')]=_0xfd5ffa;_0x31e2d4(_0xfd5ffa);})[_0x7c4f('0x1e')](function(_0x43654b){_0x265189(_0x43654b);});});}
\ No newline at end of file
index 26bad77..c551e58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2cce=['hasOwnProperty','hook','events','../../mysqldb','User','setMaxListeners','save','remove','emit'];(function(_0x1c1577,_0x1d4d6d){var _0x566d1f=function(_0x81f351){while(--_0x81f351){_0x1c1577['push'](_0x1c1577['shift']());}};_0x566d1f(++_0x1d4d6d);}(_0x2cce,0xf5));var _0xe2cc=function(_0x46bb3f,_0x30e6f1){_0x46bb3f=_0x46bb3f-0x0;var _0x25c013=_0x2cce[_0x46bb3f];return _0x25c013;};'use strict';var EventEmitter=require(_0xe2cc('0x0'));var User=require(_0xe2cc('0x1'))['db'][_0xe2cc('0x2')];var UserEvents=new EventEmitter();UserEvents[_0xe2cc('0x3')](0x0);var events={'afterCreate':_0xe2cc('0x4'),'afterUpdate':'update','afterDestroy':_0xe2cc('0x5')};function emitEvent(_0x2df1e7){return function(_0x23a9df,_0x3a3265,_0x2ad9da){UserEvents[_0xe2cc('0x6')](_0x2df1e7+':'+_0x23a9df['id'],_0x23a9df);UserEvents['emit'](_0x2df1e7,_0x23a9df);_0x2ad9da(null);};}for(var e in events){if(events[_0xe2cc('0x7')](e)){var event=events[e];User[_0xe2cc('0x8')](e,emitEvent(event));}}module['exports']=UserEvents;
\ No newline at end of file
+var _0x1d6c=['hook','exports','events','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x178bba,_0x1f7e29){var _0x610ebc=function(_0x33b92d){while(--_0x33b92d){_0x178bba['push'](_0x178bba['shift']());}};_0x610ebc(++_0x1f7e29);}(_0x1d6c,0x15a));var _0xc1d6=function(_0x20d713,_0x955578){_0x20d713=_0x20d713-0x0;var _0xc4f054=_0x1d6c[_0x20d713];return _0xc4f054;};'use strict';var EventEmitter=require(_0xc1d6('0x0'));var User=require(_0xc1d6('0x1'))['db']['User'];var UserEvents=new EventEmitter();UserEvents[_0xc1d6('0x2')](0x0);var events={'afterCreate':_0xc1d6('0x3'),'afterUpdate':'update','afterDestroy':_0xc1d6('0x4')};function emitEvent(_0x2bc2c4){return function(_0x25bd33,_0x269b4b,_0x12c3b7){UserEvents[_0xc1d6('0x5')](_0x2bc2c4+':'+_0x25bd33['id'],_0x25bd33);UserEvents['emit'](_0x2bc2c4,_0x25bd33);_0x12c3b7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];User[_0xc1d6('0x6')](e,emitEvent(event));}}module[_0xc1d6('0x7')]=UserEvents;
\ No newline at end of file
index 6562963..5c7ce5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b52=['_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=%s','Dial','SIP/%s,,tTxXU(xcally-mixmonitor-context)','SIP/%s,,tTxX','Hangup','priority','defaults','VoiceChanSpy','then','internal','User','users','utf8','userProfileId','undefined','resolve','UserProfile','privacyEnabled','updateMd5Password','catch','changed','find','updatePassword','userSetting','chanspy','VoiceExtension','bulkCreate','destroy','concat','encryptPassword','function','Missing\x20Callback','randomBytes','toString','base64','salt','pbkdf2Sync','sha1','pbkdf2','indexOf','provider','makeSalt','md5secret',':asterisk:','bluebird','crypto','util','md5','lodash','./user.attributes','length','context','from-sip','system','format','%s%s','prefix','push','Set','CDR(type)=%s','record','merge','MixMonitor','recordingFormat','auth','password','SIP/%s,%s','name','options','wav','WAV','gsm','CDR(type)=internal','extensionMonitor','includes'];(function(_0x315369,_0x4af270){var _0x167c48=function(_0x19d2df){while(--_0x19d2df){_0x315369['push'](_0x315369['shift']());}};_0x167c48(++_0x4af270);}(_0x6b52,0x1a9));var _0x26b5=function(_0x216b8a,_0x459a11){_0x216b8a=_0x216b8a-0x0;var _0x344626=_0x6b52[_0x216b8a];return _0x344626;};'use strict';var BPromise=require(_0x26b5('0x0'));var crypto=require(_0x26b5('0x1'));var util=require(_0x26b5('0x2'));var md5=require(_0x26b5('0x3'));var _=require(_0x26b5('0x4'));var attributes=require(_0x26b5('0x5'));var authTypes=['google'];var validatePresenceOf=function(_0x115529){return _0x115529&&_0x115529[_0x26b5('0x6')];};var getChanSpyApplications=function(_0x4a46d2,_0x5f319e,_0x1f390a){var _0x17e387={'context':_0x4a46d2[_0x26b5('0x7')]||_0x26b5('0x8'),'type':_0x26b5('0x9'),'isApp':![],'UserId':_0x4a46d2['id']};var _0x1dfc20=[];for(var _0x4e2eb5=0x0,_0x1ac379=0x1;_0x4e2eb5<_0x1f390a[_0x26b5('0x6')];_0x4e2eb5++,_0x1ac379=0x1){var _0x2caaa3={'exten':util[_0x26b5('0xa')](_0x26b5('0xb'),_0x1f390a[_0x4e2eb5][_0x26b5('0xc')],_0x5f319e),'ChanSpyId':_0x1f390a[_0x4e2eb5]['id']};_0x1dfc20[_0x26b5('0xd')](_['merge']({'app':_0x26b5('0xe'),'appdata':util['format'](_0x26b5('0xf'),'chanspy'),'priority':_0x1ac379++},_0x17e387,_0x2caaa3));if(_0x1f390a[_0x4e2eb5][_0x26b5('0x10')]){_0x1dfc20[_0x26b5('0xd')](_[_0x26b5('0x11')]({'app':_0x26b5('0x12'),'appdata':util[_0x26b5('0xa')]('${UNIQUEID}.%s,a',_0x1f390a[_0x4e2eb5][_0x26b5('0x13')]),'priority':_0x1ac379++},_0x17e387,_0x2caaa3));}if(_0x1f390a[_0x4e2eb5][_0x26b5('0x14')]){_0x1dfc20[_0x26b5('0xd')](_[_0x26b5('0x11')]({'app':'Authenticate','appdata':_0x1f390a[_0x4e2eb5][_0x26b5('0x15')],'priority':_0x1ac379++},_0x17e387,_0x2caaa3));}_0x1dfc20[_0x26b5('0xd')](_[_0x26b5('0x11')]({'app':'ChanSpy','appdata':util['format'](_0x26b5('0x16'),_0x4a46d2[_0x26b5('0x17')],_0x1f390a[_0x4e2eb5][_0x26b5('0x18')]?_0x1f390a[_0x4e2eb5][_0x26b5('0x18')]['join'](''):''),'priority':_0x1ac379++},_0x17e387,_0x2caaa3));if(_0x1f390a[_0x4e2eb5][_0x26b5('0x10')]){_0x1dfc20[_0x26b5('0xd')](_[_0x26b5('0x11')]({'app':'StopMixMonitor','priority':_0x1ac379++},_0x17e387,_0x2caaa3));}}return _0x1dfc20;};var getUserApplications=function(_0x3bb1f1,_0x2065f6){var _0x57554c=[_0x26b5('0x19'),_0x26b5('0x1a'),_0x26b5('0x1b')];var _0x10ca20={'context':_0x3bb1f1['context']||_0x26b5('0x8'),'exten':_0x2065f6,'type':_0x26b5('0x9'),'isApp':![],'UserId':_0x3bb1f1['id']};var _0x5296a3=[{'app':'Set','appdata':_0x26b5('0x1c')}];if(_0x3bb1f1[_0x26b5('0x1d')]&&_[_0x26b5('0x1e')](_0x57554c,_0x3bb1f1['extensionMonitor'])){_0x5296a3[_0x26b5('0xd')]({'app':_0x26b5('0xe'),'appdata':_0x26b5('0x1f')});_0x5296a3[_0x26b5('0xd')]({'app':_0x26b5('0xe'),'appdata':util[_0x26b5('0xa')](_0x26b5('0x20'),_0x3bb1f1['extensionMonitor'])});_0x5296a3[_0x26b5('0xd')]({'app':_0x26b5('0x21'),'appdata':util[_0x26b5('0xa')](_0x26b5('0x22'),_0x3bb1f1[_0x26b5('0x17')])});}else{_0x5296a3[_0x26b5('0xd')]({'app':'Dial','appdata':util[_0x26b5('0xa')](_0x26b5('0x23'),_0x3bb1f1[_0x26b5('0x17')])});}_0x5296a3[_0x26b5('0xd')]({'app':_0x26b5('0x24')});for(var _0xae3b5e=0x0;_0xae3b5e<_0x5296a3[_0x26b5('0x6')];_0xae3b5e++){_0x5296a3[_0xae3b5e][_0x26b5('0x25')]=_0xae3b5e+0x1;_0x5296a3[_0xae3b5e]=_[_0x26b5('0x26')](_0x5296a3[_0xae3b5e],_0x10ca20);}return _0x5296a3;};var getChanSpyPromise=function(_0x6a1628,_0x5b709c){return new BPromise(function(_0x4788ab,_0xca052f){return _0x6a1628[_0x26b5('0x27')]['findAll']()[_0x26b5('0x28')](function(_0xd35a91){if(_0xd35a91){var _0x42d989=getChanSpyApplications(_0x5b709c,_0x5b709c[_0x26b5('0x29')],_0xd35a91);if(_0x5b709c[_0x26b5('0x29')]!=_0x5b709c[_0x26b5('0x17')]){_0x42d989=_0x42d989['concat'](getChanSpyApplications(_0x5b709c,_0x5b709c[_0x26b5('0x17')],_0xd35a91));}return _0x4788ab(_0x42d989);}return _0x4788ab([]);})['catch'](function(_0x4cf26f){_0xca052f(_0x4cf26f);});});};module['exports']=function(_0x36e436){var _0x4261ea=_0x36e436['models'];return _0x36e436['define'](_0x26b5('0x2a'),attributes,{'tableName':_0x26b5('0x2b'),'charset':_0x26b5('0x2c'),'collate':'utf8_bin','hooks':{'beforeCreate':function(_0x4a11df,_0x5a1ea1,_0xfbccff){var _0x159ce0=typeof _0x4a11df[_0x26b5('0x2d')]===_0x26b5('0x2e')?BPromise[_0x26b5('0x2f')](null):_0x4261ea[_0x26b5('0x30')]['find']({'where':{'id':_0x4a11df[_0x26b5('0x2d')]}});_0x159ce0['then'](function(_0x334f3a){if(_0x334f3a){_0x4a11df[_0x26b5('0x31')]=_0x334f3a[_0x26b5('0x31')];}})[_0x26b5('0x28')](function(){_0x4a11df[_0x26b5('0x32')]();_0x4a11df['updatePassword'](_0xfbccff);})[_0x26b5('0x33')](function(_0x104a29){_0xfbccff(_0x104a29);});},'beforeUpdate':function(_0x493484,_0x196024,_0x28d83a){Promise[_0x26b5('0x2f')]()[_0x26b5('0x28')](function(){if(_0x493484[_0x26b5('0x34')](_0x26b5('0x2d'))===![])return;return _0x4261ea[_0x26b5('0x30')][_0x26b5('0x35')]({'where':{'id':_0x493484[_0x26b5('0x2d')]}})[_0x26b5('0x28')](function(_0x4b423f){if(_0x4b423f)_0x493484[_0x26b5('0x31')]=_0x4b423f[_0x26b5('0x31')];return;});})[_0x26b5('0x28')](function(){if(_0x493484[_0x26b5('0x34')](_0x26b5('0x15'))){_0x493484[_0x26b5('0x32')]();return _0x493484[_0x26b5('0x36')](_0x28d83a);}_0x28d83a();})[_0x26b5('0x33')](function(_0x1a5971){_0x28d83a(_0x1a5971);});},'afterCreate':function(_0x56243c,_0x353b62,_0x278237){var _0x335183=getUserApplications(_0x56243c,_0x56243c['internal']);if(_0x56243c['internal']!=_0x56243c[_0x26b5('0x17')]){_0x335183=_0x335183['concat'](getUserApplications(_0x56243c,_0x56243c['name']));}return Promise[_0x26b5('0x2f')]()[_0x26b5('0x28')](function(){if(!_0x56243c[_0x26b5('0x37')]){return _0x56243c['createUserSetting']({'clientSideLoggingLevel':'error','clientSideLoggingEnabled':![]});}})[_0x26b5('0x28')](function(){return _0x4261ea['VoiceExtension']['bulkCreate'](_0x335183);})['then'](function(){if(_0x56243c[_0x26b5('0x38')]){return getChanSpyPromise(_0x4261ea,_0x56243c);}})['then'](function(_0x346125){if(_0x346125&&_0x346125[_0x26b5('0x6')]){return _0x4261ea[_0x26b5('0x39')][_0x26b5('0x3a')](_0x346125);}})['then'](function(){_0x278237();})['catch'](function(_0x3502fa){_0x278237(_0x3502fa);});},'afterUpdate':function(_0x21d8e7,_0x1ee77b,_0x233e5a){return BPromise[_0x26b5('0x2f')]()['then'](function(){if(_0x21d8e7[_0x26b5('0x34')]('chanspy')||_0x21d8e7['changed']('context')){return _0x4261ea['VoiceExtension'][_0x26b5('0x3b')]({'where':{'UserId':_0x21d8e7['id'],'type':_0x26b5('0x9'),'ChanSpyId':{'$ne':null}}})['then'](function(){if(_0x21d8e7['chanspy']){return getChanSpyPromise(_0x4261ea,_0x21d8e7)[_0x26b5('0x28')](function(_0x551452){if(_0x551452&&_0x551452[_0x26b5('0x6')]){return _0x4261ea[_0x26b5('0x39')]['bulkCreate'](_0x551452);}});}});}})[_0x26b5('0x28')](function(){if(_0x21d8e7[_0x26b5('0x34')](_0x26b5('0x1d'))||_0x21d8e7[_0x26b5('0x34')](_0x26b5('0x7'))){return _0x4261ea[_0x26b5('0x39')]['destroy']({'where':{'UserId':_0x21d8e7['id'],'type':'system','ChanSpyId':null}})[_0x26b5('0x28')](function(){var _0x4c8776=getUserApplications(_0x21d8e7,_0x21d8e7[_0x26b5('0x29')]);if(_0x21d8e7[_0x26b5('0x29')]!=_0x21d8e7['name']){_0x4c8776=_0x4c8776[_0x26b5('0x3c')](getUserApplications(_0x21d8e7,_0x21d8e7[_0x26b5('0x17')]));}return _0x4261ea[_0x26b5('0x39')][_0x26b5('0x3a')](_0x4c8776);});}})[_0x26b5('0x28')](function(){_0x233e5a();})['catch'](function(_0x5b3e01){_0x233e5a(_0x5b3e01);});},'afterDestroy':function(_0x4b6048){return _0x4261ea[_0x26b5('0x39')][_0x26b5('0x3b')]({'where':{'UserId':_0x4b6048['id'],'type':'system'}});}},'instanceMethods':{'authenticate':function(_0x4b4e8d,_0x59b8e5){if(!_0x59b8e5){return this['password']===this[_0x26b5('0x3d')](_0x4b4e8d);}var _0x1d1c2b=this;this[_0x26b5('0x3d')](_0x4b4e8d,function(_0x374725,_0x30fcf7){if(_0x374725){_0x59b8e5(_0x374725);}if(_0x1d1c2b[_0x26b5('0x15')]===_0x30fcf7){_0x59b8e5(null,!![]);}else{_0x59b8e5(null,![]);}});},'makeSalt':function(_0x3c34cc,_0x233aa9){var _0x8756e7=0x10;if(typeof arguments[0x0]===_0x26b5('0x3e')){_0x233aa9=arguments[0x0];_0x3c34cc=_0x8756e7;}else if(typeof arguments[0x1]===_0x26b5('0x3e')){_0x233aa9=arguments[0x1];}else{throw new Error(_0x26b5('0x3f'));}if(!_0x3c34cc){_0x3c34cc=_0x8756e7;}return crypto[_0x26b5('0x40')](_0x3c34cc,function(_0x39a896,_0x477473){if(_0x39a896){_0x233aa9(_0x39a896);}return _0x233aa9(null,_0x477473[_0x26b5('0x41')](_0x26b5('0x42')));});},'encryptPassword':function(_0x513878,_0x1dc576){if(!_0x513878||!this['salt']){return _0x1dc576?_0x1dc576(null):null;}var _0x2829e8=0x2710;var _0x2d9ba4=0x40;var _0x176f76=new Buffer(this[_0x26b5('0x43')],'base64');if(!_0x1dc576){return crypto[_0x26b5('0x44')](_0x513878,_0x176f76,_0x2829e8,_0x2d9ba4,_0x26b5('0x45'))[_0x26b5('0x41')](_0x26b5('0x42'));}return crypto[_0x26b5('0x46')](_0x513878,_0x176f76,_0x2829e8,_0x2d9ba4,_0x26b5('0x45'),function(_0x2b26bb,_0x32f0ff){if(_0x2b26bb){_0x1dc576(_0x2b26bb);}return _0x1dc576(null,_0x32f0ff[_0x26b5('0x41')](_0x26b5('0x42')));});},'updatePassword':function(_0xd2cce4){if(!this[_0x26b5('0x15')]){return _0xd2cce4(null);}if(!validatePresenceOf(this['password'])&&authTypes[_0x26b5('0x47')](this[_0x26b5('0x48')])===-0x1){_0xd2cce4(new Error('Invalid\x20password'));}var _0x554c1c=this;this[_0x26b5('0x49')](function(_0x26ea88,_0x156020){if(_0x26ea88){return _0xd2cce4(_0x26ea88);}_0x554c1c['salt']=_0x156020;_0x554c1c[_0x26b5('0x3d')](_0x554c1c[_0x26b5('0x15')],function(_0x55c7e2,_0x135fb3){if(_0x55c7e2){_0xd2cce4(_0x55c7e2);}_0x554c1c[_0x26b5('0x15')]=_0x135fb3;_0xd2cce4(null);});});},'updateMd5Password':function(){this[_0x26b5('0x4a')]=md5(this[_0x26b5('0x17')]+_0x26b5('0x4b')+this[_0x26b5('0x15')]);return this[_0x26b5('0x4a')];}}});};
\ No newline at end of file
+var _0x33e1=['Dial','SIP/%s,,tTxXU(xcally-mixmonitor-context)','Hangup','priority','defaults','VoiceChanSpy','internal','concat','catch','models','define','User','users','utf8_bin','undefined','UserProfile','find','privacyEnabled','then','updateMd5Password','resolve','changed','userProfileId','updatePassword','userSetting','error','VoiceExtension','bulkCreate','context','destroy','password','encryptPassword','function','Missing\x20Callback','randomBytes','toString','base64','salt','pbkdf2Sync','sha1','pbkdf2','provider','Invalid\x20password','makeSalt','md5secret',':asterisk:','bluebird','crypto','util','md5','lodash','./user.attributes','google','length','from-sip','system','format','%s%s','prefix','push','merge','Set','CDR(type)=%s','chanspy','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','Authenticate','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','wav','WAV','gsm','CDR(type)=internal','extensionMonitor','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=%s'];(function(_0x57b432,_0x1589a0){var _0x2edf2a=function(_0x20edfc){while(--_0x20edfc){_0x57b432['push'](_0x57b432['shift']());}};_0x2edf2a(++_0x1589a0);}(_0x33e1,0x7f));var _0x133e=function(_0x4391d2,_0x4b0b88){_0x4391d2=_0x4391d2-0x0;var _0x5c4931=_0x33e1[_0x4391d2];return _0x5c4931;};'use strict';var BPromise=require(_0x133e('0x0'));var crypto=require(_0x133e('0x1'));var util=require(_0x133e('0x2'));var md5=require(_0x133e('0x3'));var _=require(_0x133e('0x4'));var attributes=require(_0x133e('0x5'));var authTypes=[_0x133e('0x6')];var validatePresenceOf=function(_0x2d7e78){return _0x2d7e78&&_0x2d7e78[_0x133e('0x7')];};var getChanSpyApplications=function(_0x3c4f27,_0x4f3f33,_0x292cd9){var _0x5144ab={'context':_0x3c4f27['context']||_0x133e('0x8'),'type':_0x133e('0x9'),'isApp':![],'UserId':_0x3c4f27['id']};var _0x2d350e=[];for(var _0x21d770=0x0,_0x4c1ffc=0x1;_0x21d770<_0x292cd9[_0x133e('0x7')];_0x21d770++,_0x4c1ffc=0x1){var _0xd89566={'exten':util[_0x133e('0xa')](_0x133e('0xb'),_0x292cd9[_0x21d770][_0x133e('0xc')],_0x4f3f33),'ChanSpyId':_0x292cd9[_0x21d770]['id']};_0x2d350e[_0x133e('0xd')](_[_0x133e('0xe')]({'app':_0x133e('0xf'),'appdata':util['format'](_0x133e('0x10'),_0x133e('0x11')),'priority':_0x4c1ffc++},_0x5144ab,_0xd89566));if(_0x292cd9[_0x21d770]['record']){_0x2d350e[_0x133e('0xd')](_[_0x133e('0xe')]({'app':_0x133e('0x12'),'appdata':util[_0x133e('0xa')](_0x133e('0x13'),_0x292cd9[_0x21d770][_0x133e('0x14')]),'priority':_0x4c1ffc++},_0x5144ab,_0xd89566));}if(_0x292cd9[_0x21d770]['auth']){_0x2d350e[_0x133e('0xd')](_[_0x133e('0xe')]({'app':_0x133e('0x15'),'appdata':_0x292cd9[_0x21d770]['password'],'priority':_0x4c1ffc++},_0x5144ab,_0xd89566));}_0x2d350e[_0x133e('0xd')](_[_0x133e('0xe')]({'app':_0x133e('0x16'),'appdata':util['format'](_0x133e('0x17'),_0x3c4f27[_0x133e('0x18')],_0x292cd9[_0x21d770][_0x133e('0x19')]?_0x292cd9[_0x21d770][_0x133e('0x19')][_0x133e('0x1a')](''):''),'priority':_0x4c1ffc++},_0x5144ab,_0xd89566));if(_0x292cd9[_0x21d770]['record']){_0x2d350e['push'](_[_0x133e('0xe')]({'app':_0x133e('0x1b'),'priority':_0x4c1ffc++},_0x5144ab,_0xd89566));}}return _0x2d350e;};var getUserApplications=function(_0x5e5415,_0x1cbeb6){var _0x4f374b=[_0x133e('0x1c'),_0x133e('0x1d'),_0x133e('0x1e')];var _0x5d65d3={'context':_0x5e5415['context']||_0x133e('0x8'),'exten':_0x1cbeb6,'type':_0x133e('0x9'),'isApp':![],'UserId':_0x5e5415['id']};var _0x59469c=[{'app':'Set','appdata':_0x133e('0x1f')}];if(_0x5e5415[_0x133e('0x20')]&&_['includes'](_0x4f374b,_0x5e5415[_0x133e('0x20')])){_0x59469c['push']({'app':_0x133e('0xf'),'appdata':_0x133e('0x21')});_0x59469c[_0x133e('0xd')]({'app':'Set','appdata':util[_0x133e('0xa')](_0x133e('0x22'),_0x5e5415[_0x133e('0x20')])});_0x59469c['push']({'app':_0x133e('0x23'),'appdata':util[_0x133e('0xa')](_0x133e('0x24'),_0x5e5415['name'])});}else{_0x59469c[_0x133e('0xd')]({'app':_0x133e('0x23'),'appdata':util[_0x133e('0xa')]('SIP/%s,,tTxX',_0x5e5415[_0x133e('0x18')])});}_0x59469c[_0x133e('0xd')]({'app':_0x133e('0x25')});for(var _0x3d28b0=0x0;_0x3d28b0<_0x59469c[_0x133e('0x7')];_0x3d28b0++){_0x59469c[_0x3d28b0][_0x133e('0x26')]=_0x3d28b0+0x1;_0x59469c[_0x3d28b0]=_[_0x133e('0x27')](_0x59469c[_0x3d28b0],_0x5d65d3);}return _0x59469c;};var getChanSpyPromise=function(_0x56341d,_0x22e3ba){return new BPromise(function(_0x2c4d2f,_0x3c1067){return _0x56341d[_0x133e('0x28')]['findAll']()['then'](function(_0x397cb7){if(_0x397cb7){var _0x6c36fd=getChanSpyApplications(_0x22e3ba,_0x22e3ba[_0x133e('0x29')],_0x397cb7);if(_0x22e3ba[_0x133e('0x29')]!=_0x22e3ba[_0x133e('0x18')]){_0x6c36fd=_0x6c36fd[_0x133e('0x2a')](getChanSpyApplications(_0x22e3ba,_0x22e3ba['name'],_0x397cb7));}return _0x2c4d2f(_0x6c36fd);}return _0x2c4d2f([]);})[_0x133e('0x2b')](function(_0x206e55){_0x3c1067(_0x206e55);});});};module['exports']=function(_0x20ae8f){var _0x426936=_0x20ae8f[_0x133e('0x2c')];return _0x20ae8f[_0x133e('0x2d')](_0x133e('0x2e'),attributes,{'tableName':_0x133e('0x2f'),'charset':'utf8','collate':_0x133e('0x30'),'hooks':{'beforeCreate':function(_0x12728f,_0x4f6fe5,_0x5da077){var _0x2ed945=typeof _0x12728f['userProfileId']===_0x133e('0x31')?BPromise['resolve'](null):_0x426936[_0x133e('0x32')][_0x133e('0x33')]({'where':{'id':_0x12728f['userProfileId']}});_0x2ed945['then'](function(_0x2f55ba){if(_0x2f55ba){_0x12728f[_0x133e('0x34')]=_0x2f55ba['privacyEnabled'];}})[_0x133e('0x35')](function(){_0x12728f[_0x133e('0x36')]();_0x12728f['updatePassword'](_0x5da077);})[_0x133e('0x2b')](function(_0x308dc1){_0x5da077(_0x308dc1);});},'beforeUpdate':function(_0x53540a,_0x5d0e89,_0xa69c61){Promise[_0x133e('0x37')]()[_0x133e('0x35')](function(){if(_0x53540a[_0x133e('0x38')](_0x133e('0x39'))===![])return;return _0x426936[_0x133e('0x32')][_0x133e('0x33')]({'where':{'id':_0x53540a[_0x133e('0x39')]}})[_0x133e('0x35')](function(_0x1fd43c){if(_0x1fd43c)_0x53540a['privacyEnabled']=_0x1fd43c[_0x133e('0x34')];return;});})[_0x133e('0x35')](function(){if(_0x53540a['changed']('password')){_0x53540a[_0x133e('0x36')]();return _0x53540a[_0x133e('0x3a')](_0xa69c61);}_0xa69c61();})[_0x133e('0x2b')](function(_0x308082){_0xa69c61(_0x308082);});},'afterCreate':function(_0x5e3bff,_0x38f053,_0x5809da){var _0x4b6cb4=getUserApplications(_0x5e3bff,_0x5e3bff[_0x133e('0x29')]);if(_0x5e3bff[_0x133e('0x29')]!=_0x5e3bff[_0x133e('0x18')]){_0x4b6cb4=_0x4b6cb4['concat'](getUserApplications(_0x5e3bff,_0x5e3bff[_0x133e('0x18')]));}return Promise[_0x133e('0x37')]()[_0x133e('0x35')](function(){if(!_0x5e3bff[_0x133e('0x3b')]){return _0x5e3bff['createUserSetting']({'clientSideLoggingLevel':_0x133e('0x3c'),'clientSideLoggingEnabled':![]});}})[_0x133e('0x35')](function(){return _0x426936[_0x133e('0x3d')][_0x133e('0x3e')](_0x4b6cb4);})[_0x133e('0x35')](function(){if(_0x5e3bff['chanspy']){return getChanSpyPromise(_0x426936,_0x5e3bff);}})[_0x133e('0x35')](function(_0x4e27ce){if(_0x4e27ce&&_0x4e27ce[_0x133e('0x7')]){return _0x426936['VoiceExtension'][_0x133e('0x3e')](_0x4e27ce);}})['then'](function(){_0x5809da();})[_0x133e('0x2b')](function(_0x3afc2f){_0x5809da(_0x3afc2f);});},'afterUpdate':function(_0x324d97,_0x584eb2,_0x115004){return BPromise[_0x133e('0x37')]()[_0x133e('0x35')](function(){if(_0x324d97[_0x133e('0x38')](_0x133e('0x11'))||_0x324d97['changed'](_0x133e('0x3f'))){return _0x426936[_0x133e('0x3d')][_0x133e('0x40')]({'where':{'UserId':_0x324d97['id'],'type':_0x133e('0x9'),'ChanSpyId':{'$ne':null}}})['then'](function(){if(_0x324d97[_0x133e('0x11')]){return getChanSpyPromise(_0x426936,_0x324d97)[_0x133e('0x35')](function(_0x5dab4e){if(_0x5dab4e&&_0x5dab4e['length']){return _0x426936[_0x133e('0x3d')]['bulkCreate'](_0x5dab4e);}});}});}})[_0x133e('0x35')](function(){if(_0x324d97[_0x133e('0x38')](_0x133e('0x20'))||_0x324d97[_0x133e('0x38')](_0x133e('0x3f'))){return _0x426936['VoiceExtension']['destroy']({'where':{'UserId':_0x324d97['id'],'type':_0x133e('0x9'),'ChanSpyId':null}})['then'](function(){var _0x2e8f66=getUserApplications(_0x324d97,_0x324d97['internal']);if(_0x324d97['internal']!=_0x324d97['name']){_0x2e8f66=_0x2e8f66['concat'](getUserApplications(_0x324d97,_0x324d97['name']));}return _0x426936[_0x133e('0x3d')][_0x133e('0x3e')](_0x2e8f66);});}})['then'](function(){_0x115004();})[_0x133e('0x2b')](function(_0x4061db){_0x115004(_0x4061db);});},'afterDestroy':function(_0xa2afde){return _0x426936['VoiceExtension'][_0x133e('0x40')]({'where':{'UserId':_0xa2afde['id'],'type':'system'}});}},'instanceMethods':{'authenticate':function(_0x352d7d,_0x5ec61d){if(!_0x5ec61d){return this[_0x133e('0x41')]===this[_0x133e('0x42')](_0x352d7d);}var _0x5c50f1=this;this[_0x133e('0x42')](_0x352d7d,function(_0x52c225,_0x2c7d8a){if(_0x52c225){_0x5ec61d(_0x52c225);}if(_0x5c50f1[_0x133e('0x41')]===_0x2c7d8a){_0x5ec61d(null,!![]);}else{_0x5ec61d(null,![]);}});},'makeSalt':function(_0x464ab5,_0x4cea1c){var _0x248c65=0x10;if(typeof arguments[0x0]===_0x133e('0x43')){_0x4cea1c=arguments[0x0];_0x464ab5=_0x248c65;}else if(typeof arguments[0x1]===_0x133e('0x43')){_0x4cea1c=arguments[0x1];}else{throw new Error(_0x133e('0x44'));}if(!_0x464ab5){_0x464ab5=_0x248c65;}return crypto[_0x133e('0x45')](_0x464ab5,function(_0x3e5f47,_0x16e31c){if(_0x3e5f47){_0x4cea1c(_0x3e5f47);}return _0x4cea1c(null,_0x16e31c[_0x133e('0x46')](_0x133e('0x47')));});},'encryptPassword':function(_0x4fb564,_0x4dcefd){if(!_0x4fb564||!this['salt']){return _0x4dcefd?_0x4dcefd(null):null;}var _0x37b1a3=0x2710;var _0x17cbf5=0x40;var _0x131013=new Buffer(this[_0x133e('0x48')],_0x133e('0x47'));if(!_0x4dcefd){return crypto[_0x133e('0x49')](_0x4fb564,_0x131013,_0x37b1a3,_0x17cbf5,_0x133e('0x4a'))[_0x133e('0x46')](_0x133e('0x47'));}return crypto[_0x133e('0x4b')](_0x4fb564,_0x131013,_0x37b1a3,_0x17cbf5,_0x133e('0x4a'),function(_0x552109,_0x36a021){if(_0x552109){_0x4dcefd(_0x552109);}return _0x4dcefd(null,_0x36a021['toString'](_0x133e('0x47')));});},'updatePassword':function(_0x1c71c1){if(!this[_0x133e('0x41')]){return _0x1c71c1(null);}if(!validatePresenceOf(this[_0x133e('0x41')])&&authTypes['indexOf'](this[_0x133e('0x4c')])===-0x1){_0x1c71c1(new Error(_0x133e('0x4d')));}var _0x1af29f=this;this[_0x133e('0x4e')](function(_0x25104a,_0x136b5a){if(_0x25104a){return _0x1c71c1(_0x25104a);}_0x1af29f[_0x133e('0x48')]=_0x136b5a;_0x1af29f[_0x133e('0x42')](_0x1af29f['password'],function(_0x23f300,_0x5cc110){if(_0x23f300){_0x1c71c1(_0x23f300);}_0x1af29f[_0x133e('0x41')]=_0x5cc110;_0x1c71c1(null);});});},'updateMd5Password':function(){this[_0x133e('0x4f')]=md5(this['name']+_0x133e('0x50')+this['password']);return this[_0x133e('0x4f')];}}});};
\ No newline at end of file
index 7626819..5d97752 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf6a=['format','getChannels','forEach','push','name','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','body','type','DEFAULT\x20PAUSE','role','internal','uniqueid','UnpauseUser','channel','isValidChannel','voice','system','mail','chat','sms','openchannel','whatsapp','set','%s%s','all','LogoutUser','findOne','destroy','LoginUser','phone','loginInPause','count','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','UserVoiceQueue.penalty','merge','LOGIN','callysquare','LOGININPAUSE','bulkCreate','lodash','randomstring','../../mysqldb','jayson/promise','http','defaults','localhost','socket.io-emitter','redis','./user.socket','register','request','then','info','User,\x20%s,\x20%s','User,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','User','options','raw','attributes','limit','include','model','GetUser','ShowUser','find','where','map','debug','PauseUser','interface','UserVoiceQueueRt','update','MemberReport','findAll','PAUSE','length'];(function(_0x3fc51b,_0x5b2bbf){var _0x3a5937=function(_0x4fbc7c){while(--_0x4fbc7c){_0x3fc51b['push'](_0x3fc51b['shift']());}};_0x3a5937(++_0x5b2bbf);}(_0xbf6a,0x1eb));var _0xabf6=function(_0x93942f,_0xb48547){_0x93942f=_0x93942f-0x0;var _0x23fcd8=_0xbf6a[_0x93942f];return _0x23fcd8;};'use strict';var _=require(_0xabf6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xabf6('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xabf6('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xabf6('0x3'));var client=jayson['client'][_0xabf6('0x4')]({'port':0x232a});config['redis']=_[_0xabf6('0x5')](config['redis'],{'host':_0xabf6('0x6'),'port':0x18eb});var socket=require(_0xabf6('0x7'))(new Redis(config[_0xabf6('0x8')]));require(_0xabf6('0x9'))[_0xabf6('0xa')](socket);function respondWithRpcPromise(_0x5e555c,_0x6cc93b,_0x2c80cc){return new BPromise(function(_0x537225,_0x27ed0e){return client[_0xabf6('0xb')](_0x5e555c,_0x2c80cc)[_0xabf6('0xc')](function(_0x3a2a83){logger[_0xabf6('0xd')](_0xabf6('0xe'),_0x6cc93b,'request\x20sent');logger['debug'](_0xabf6('0xf'),_0x6cc93b,_0xabf6('0x10'),JSON[_0xabf6('0x11')](_0x3a2a83));if(_0x3a2a83[_0xabf6('0x12')]){if(_0x3a2a83['error'][_0xabf6('0x13')]===0x1f4){logger[_0xabf6('0x12')](_0xabf6('0xe'),_0x6cc93b,_0x3a2a83[_0xabf6('0x12')][_0xabf6('0x14')]);return _0x27ed0e(_0x3a2a83['error'][_0xabf6('0x14')]);}logger[_0xabf6('0x12')](_0xabf6('0xe'),_0x6cc93b,_0x3a2a83[_0xabf6('0x12')][_0xabf6('0x14')]);return _0x537225(_0x3a2a83[_0xabf6('0x12')][_0xabf6('0x14')]);}else{logger[_0xabf6('0xd')](_0xabf6('0xe'),_0x6cc93b,_0xabf6('0x10'));_0x537225(_0x3a2a83['result'][_0xabf6('0x14')]);}})[_0xabf6('0x15')](function(_0x42d09b){logger[_0xabf6('0x12')](_0xabf6('0xe'),_0x6cc93b,_0x42d09b);_0x27ed0e(_0x42d09b);});});}exports['GetUser']=function(_0x2eb8e3){var _0x2911a0=this;return new Promise(function(_0x15f6e6,_0x571b39){return db[_0xabf6('0x16')]['findAll']({'raw':_0x2eb8e3[_0xabf6('0x17')]?_0x2eb8e3[_0xabf6('0x17')][_0xabf6('0x18')]===undefined?!![]:![]:!![],'where':_0x2eb8e3['options']?_0x2eb8e3[_0xabf6('0x17')]['where']||null:null,'attributes':_0x2eb8e3[_0xabf6('0x17')]?_0x2eb8e3[_0xabf6('0x17')][_0xabf6('0x19')]||null:null,'limit':_0x2eb8e3[_0xabf6('0x17')]?_0x2eb8e3['options'][_0xabf6('0x1a')]||null:null,'include':_0x2eb8e3[_0xabf6('0x17')]?_0x2eb8e3['options'][_0xabf6('0x1b')]?_['map'](_0x2eb8e3[_0xabf6('0x17')][_0xabf6('0x1b')],function(_0x186ba5){return{'model':db[_0x186ba5[_0xabf6('0x1c')]],'as':_0x186ba5['as'],'attributes':_0x186ba5[_0xabf6('0x19')],'include':_0x186ba5[_0xabf6('0x1b')]?_['map'](_0x186ba5[_0xabf6('0x1b')],function(_0x1a6643){return{'model':db[_0x1a6643['model']],'as':_0x1a6643['as'],'attributes':_0x1a6643[_0xabf6('0x19')],'include':_0x1a6643['include']?_['map'](_0x1a6643['include'],function(_0x127fcc){return{'model':db[_0x127fcc[_0xabf6('0x1c')]],'as':_0x127fcc['as'],'attributes':_0x127fcc[_0xabf6('0x19')]};}):[]};}):[]};}):[]:[]})[_0xabf6('0xc')](function(_0x2f23de){logger[_0xabf6('0xd')](_0xabf6('0x1d'),_0x2eb8e3);logger['debug']('GetUser',_0x2eb8e3,JSON[_0xabf6('0x11')](_0x2f23de));_0x15f6e6(_0x2f23de);})[_0xabf6('0x15')](function(_0x1f2c0b){logger['error'](_0xabf6('0x1d'),_0x1f2c0b['message'],_0x2eb8e3);_0x571b39(_0x2911a0[_0xabf6('0x12')](0x1f4,_0x1f2c0b[_0xabf6('0x14')]));});});};exports[_0xabf6('0x1e')]=function(_0x474cee){var _0x13aa56=this;return new Promise(function(_0x4a66ca,_0x301a33){return db[_0xabf6('0x16')][_0xabf6('0x1f')]({'raw':_0x474cee[_0xabf6('0x17')]?_0x474cee[_0xabf6('0x17')][_0xabf6('0x18')]===undefined?!![]:![]:!![],'where':_0x474cee['options']?_0x474cee[_0xabf6('0x17')][_0xabf6('0x20')]||null:null,'attributes':_0x474cee[_0xabf6('0x17')]?_0x474cee[_0xabf6('0x17')][_0xabf6('0x19')]||null:null,'include':_0x474cee['options']?_0x474cee['options'][_0xabf6('0x1b')]?_[_0xabf6('0x21')](_0x474cee[_0xabf6('0x17')]['include'],function(_0x3c79a7){return{'model':db[_0x3c79a7[_0xabf6('0x1c')]],'as':_0x3c79a7['as'],'attributes':_0x3c79a7[_0xabf6('0x19')],'include':_0x3c79a7[_0xabf6('0x1b')]?_[_0xabf6('0x21')](_0x3c79a7[_0xabf6('0x1b')],function(_0x39e48c){return{'model':db[_0x39e48c[_0xabf6('0x1c')]],'as':_0x39e48c['as'],'attributes':_0x39e48c[_0xabf6('0x19')],'include':_0x39e48c[_0xabf6('0x1b')]?_[_0xabf6('0x21')](_0x39e48c[_0xabf6('0x1b')],function(_0x1f6f48){return{'model':db[_0x1f6f48['model']],'as':_0x1f6f48['as'],'attributes':_0x1f6f48[_0xabf6('0x19')]};}):[]};}):[]};}):[]:[]})[_0xabf6('0xc')](function(_0x519d64){logger['info'](_0xabf6('0x1e'),_0x474cee);logger[_0xabf6('0x22')]('ShowUser',_0x474cee,JSON[_0xabf6('0x11')](_0x519d64));_0x4a66ca(_0x519d64);})[_0xabf6('0x15')](function(_0x3bf877){logger[_0xabf6('0x12')](_0xabf6('0x1e'),_0x3bf877[_0xabf6('0x14')],_0x474cee);_0x301a33(_0x13aa56[_0xabf6('0x12')](0x1f4,_0x3bf877[_0xabf6('0x14')]));});});};exports[_0xabf6('0x23')]=function(_0x20d3f8){var _0x32fa28=this;return new Promise(function(_0x327a77,_0x475e97){var _0x17c248;return db[_0xabf6('0x16')]['find']({'where':_0x20d3f8[_0xabf6('0x17')][_0xabf6('0x20')]||{},'attributes':['id','name','role','internal',_0xabf6('0x24')]})[_0xabf6('0xc')](function(_0x440b00){if(_0x440b00){_0x17c248=_0x440b00;return db[_0xabf6('0x25')][_0xabf6('0x26')]({'paused':0x1},{'where':{'UserId':_0x17c248['id']},'individualHooks':!![]});}})[_0xabf6('0xc')](function(){if(_0x17c248){return db[_0xabf6('0x27')][_0xabf6('0x28')]({'where':{'membername':_0x17c248['name'],'type':_0xabf6('0x29'),'exitAt':null}});}})[_0xabf6('0xc')](function(_0x5a530b){if(_0x17c248){if(_0x5a530b&&_0x5a530b[_0xabf6('0x2a')]){var _0x15e556=moment()[_0xabf6('0x2b')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x24910d=0x0,_0x23db3e=_0x5a530b['length'];_0x24910d<_0x23db3e;_0x24910d++){_0x5a530b[_0x24910d]['updateAttributes']({'exitAt':_0x15e556});}}}})[_0xabf6('0xc')](function(){if(_0x17c248){var _0x265f5b=[];var _0x59dc04=utils[_0xabf6('0x2c')]();_0x59dc04[_0xabf6('0x2d')](function(_0x618b8){_0x265f5b[_0xabf6('0x2e')]({'channel':_0x618b8,'membername':_0x17c248[_0xabf6('0x2f')],'interface':_['isNil'](_0x17c248[_0xabf6('0x24')])?util[_0xabf6('0x2b')](_0xabf6('0x30'),_0x17c248[_0xabf6('0x2f')]):_0x17c248[_0xabf6('0x24')],'type':_0xabf6('0x29'),'enterAt':moment()[_0xabf6('0x2b')](_0xabf6('0x31')),'data1':_0x20d3f8[_0xabf6('0x32')][_0xabf6('0x33')]||_0xabf6('0x34'),'role':_0x17c248[_0xabf6('0x35')],'internal':_0x17c248[_0xabf6('0x36')],'uniqueid':_0x20d3f8['body'][_0xabf6('0x37')]||null});});return db[_0xabf6('0x27')]['bulkCreate'](_0x265f5b,{'individualHooks':!![]});}})[_0xabf6('0xc')](function(){if(_0x17c248){return _0x17c248['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x20d3f8['body']['type']||_0xabf6('0x34'),'lastPauseAt':moment()[_0xabf6('0x2b')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xabf6('0xc')](function(_0x37be11){_0x327a77(_0x37be11);})[_0xabf6('0x15')](function(_0x196389){_0x475e97(_0x32fa28[_0xabf6('0x12')](0x1f4,_0x196389['message']));});});};exports[_0xabf6('0x38')]=function(_0x34a01e){var _0x1c40e7=this;return new Promise(function(_0x588ea4,_0x26c168){var _0x3a731d;return db['User']['findOne']({'where':_0x34a01e['options'][_0xabf6('0x20')]||{},'attributes':['id',_0xabf6('0x2f')]})[_0xabf6('0xc')](function(_0x3f9e92){if(_0x3f9e92){_0x3a731d=_0x3f9e92;if(_0x34a01e[_0xabf6('0x32')][_0xabf6('0x39')]&&!utils[_0xabf6('0x3a')](_0x34a01e[_0xabf6('0x32')][_0xabf6('0x39')])){throw new Error('Unknown\x20channel');}switch(_0x34a01e[_0xabf6('0x32')]['channel']){case _0xabf6('0x3b'):return db['UserVoiceQueueRt'][_0xabf6('0x26')]({'paused':0x0},{'where':{'UserId':_0x3a731d['id']}})[_0xabf6('0xc')](function(){return db['MemberReport'][_0xabf6('0x1f')]({'where':{'channel':_0x34a01e['body']['channel'],'membername':_0x3a731d['name'],'type':_0xabf6('0x29'),'exitAt':null}});})[_0xabf6('0xc')](function(_0x262ecc){if(_0x262ecc){return _0x262ecc[_0xabf6('0x26')]({'exitAt':moment()[_0xabf6('0x2b')](_0xabf6('0x31')),'data2':_0xabf6('0x3c')},{'individualHooks':!![]});}return null;})[_0xabf6('0xc')](function(){return _0x3a731d[_0xabf6('0x26')]({'voicePause':![]});});case _0xabf6('0x3d'):case _0xabf6('0x3e'):case'fax':case _0xabf6('0x3f'):case _0xabf6('0x40'):case _0xabf6('0x41'):return db[_0xabf6('0x27')][_0xabf6('0x1f')]({'where':{'channel':_0x34a01e[_0xabf6('0x32')]['channel'],'membername':_0x3a731d[_0xabf6('0x2f')],'type':_0xabf6('0x29'),'exitAt':null}})[_0xabf6('0xc')](function(_0x4ef176){return _0x4ef176[_0xabf6('0x26')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xabf6('0x3c')},{'individualHooks':!![]});})[_0xabf6('0xc')](function(){var _0x29ff58={};_[_0xabf6('0x42')](_0x29ff58,util[_0xabf6('0x2b')](_0xabf6('0x43'),_0x34a01e[_0xabf6('0x32')][_0xabf6('0x39')],'Pause'),![]);return _0x3a731d[_0xabf6('0x26')](_0x29ff58);});default:return db[_0xabf6('0x25')][_0xabf6('0x26')]({'paused':0x0},{'where':{'UserId':_0x3a731d['id']}})[_0xabf6('0xc')](function(){return db[_0xabf6('0x27')][_0xabf6('0x28')]({'where':{'membername':_0x3a731d[_0xabf6('0x2f')],'type':_0xabf6('0x29'),'exitAt':null}});})[_0xabf6('0xc')](function(_0x176c77){var _0x393476=[];_0x176c77['forEach'](function(_0x363cdc){_0x393476[_0xabf6('0x2e')](_0x363cdc[_0xabf6('0x26')]({'exitAt':moment()[_0xabf6('0x2b')](_0xabf6('0x31')),'data2':_0xabf6('0x3c')}));});return BPromise[_0xabf6('0x44')](_0x393476);})[_0xabf6('0xc')](function(){return _0x3a731d[_0xabf6('0x26')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0xabf6('0xc')](function(_0x3b7538){_0x588ea4(_0x3b7538);})[_0xabf6('0x15')](function(_0x5557ad){_0x26c168(_0x1c40e7['error'](0x1f4,_0x5557ad[_0xabf6('0x14')]));});});};exports[_0xabf6('0x45')]=function(_0x240196){var _0xf1f68e=this;return new Promise(function(_0x57f968,_0x153698){var _0x55b169;return db[_0xabf6('0x16')][_0xabf6('0x46')]({'where':_0x240196[_0xabf6('0x17')][_0xabf6('0x20')]||{},'attributes':['id','name']})['then'](function(_0x4b55d3){if(_0x4b55d3){_0x55b169=_0x4b55d3;return db[_0xabf6('0x25')][_0xabf6('0x47')]({'where':{'membername':_0x55b169[_0xabf6('0x2f')]},'individualHooks':!![]});}})[_0xabf6('0xc')](function(){if(_0x55b169){return db[_0xabf6('0x27')]['findAll']({'where':{'membername':_0x55b169[_0xabf6('0x2f')],'exitAt':null}});}})[_0xabf6('0xc')](function(_0x2be48b){if(_0x55b169){if(_0x2be48b&&_0x2be48b[_0xabf6('0x2a')]){var _0x2d3d25=[];_0x2be48b[_0xabf6('0x2d')](function(_0x4f6729){_0x2d3d25[_0xabf6('0x2e')](_0x4f6729[_0xabf6('0x26')]({'exitAt':moment()[_0xabf6('0x2b')](_0xabf6('0x31'))}));});return BPromise['all'](_0x2d3d25);}}})['then'](function(){if(_0x55b169){return _0x55b169['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xabf6('0xc')](function(_0x5b99ec){_0x57f968(_0x5b99ec);})[_0xabf6('0x15')](function(_0x4bcb4d){_0x153698(_0xf1f68e['error'](0x1f4,_0x4bcb4d['message']));});});};exports[_0xabf6('0x48')]=function(_0x356f9e){var _0x4d4441=this;return new Promise(function(_0x1a6707,_0x2398e4){var _0x41ea45;var _0x24adc9;var _0x44c222;var _0x5324dc;return db[_0xabf6('0x16')][_0xabf6('0x46')]({'where':_0x356f9e['options'][_0xabf6('0x20')]||{},'attributes':['id','name','role','mobile',_0xabf6('0x49'),'internal',_0xabf6('0x4a'),_0xabf6('0x24')]})[_0xabf6('0xc')](function(_0x1fa412){if(_0x1fa412){_0x41ea45=_0x1fa412;_0x5324dc=_0x356f9e[_0xabf6('0x32')]['interface']?_0x356f9e[_0xabf6('0x32')]['interface']:util[_0xabf6('0x2b')](_0xabf6('0x30'),_0x41ea45[_0xabf6('0x2f')]);return db[_0xabf6('0x16')][_0xabf6('0x4b')]({'where':{'role':_0xabf6('0x4c'),'online':!![],'id':{'$ne':_0x41ea45['id']}}});}})[_0xabf6('0xc')](function(_0x2ad85f){if(_0x2ad85f){_0x44c222=_0x2ad85f;return require(_0xabf6('0x4d'))[_0xabf6('0x4e')]();}})['then'](function(_0x253ae6){if(_0x253ae6&&_0x253ae6[_0xabf6('0x4f')]&&_0x44c222>=_0x253ae6[_0xabf6('0x4f')]){throw new Error(_0xabf6('0x50'));}})[_0xabf6('0xc')](function(){if(_0x41ea45){return db[_0xabf6('0x25')][_0xabf6('0x47')]({'where':{'membername':_0x41ea45['name']},'individualHooks':!![]});}})['then'](function(){if(_0x41ea45){return _0x41ea45[_0xabf6('0x51')]({'raw':!![]});}})['then'](function(_0x82d56e){if(_0x41ea45){if(_0x82d56e){var _0x2cdef0=[];_0x24adc9=_0x82d56e;if(_0x24adc9[_0xabf6('0x2a')]){for(var _0x15e424=0x0;_0x15e424<_0x24adc9['length'];_0x15e424++){_0x2cdef0[_0xabf6('0x2e')](db[_0xabf6('0x25')][_0xabf6('0x52')]({'membername':_0x41ea45[_0xabf6('0x2f')],'UserId':_0x41ea45['id'],'queue_name':_0x24adc9[_0x15e424][_0xabf6('0x2f')],'VoiceQueueId':_0x24adc9[_0x15e424]['id'],'interface':_0x5324dc,'paused':_0x41ea45[_0xabf6('0x4a')]||![],'penalty':_0x24adc9[_0x15e424][_0xabf6('0x53')]||0x0}));}return BPromise['all'](_0x2cdef0);}}}})[_0xabf6('0xc')](function(){if(_0x41ea45){return db[_0xabf6('0x27')][_0xabf6('0x28')]({'where':{'membername':_0x41ea45[_0xabf6('0x2f')],'exitAt':null}});}})[_0xabf6('0xc')](function(_0x125a60){if(_0x41ea45){if(_0x125a60&&_0x125a60[_0xabf6('0x2a')]){var _0x306a17=[];_0x125a60[_0xabf6('0x2d')](function(_0x355337){_0x306a17['push'](_0x355337[_0xabf6('0x26')]({'exitAt':moment()['format'](_0xabf6('0x31'))}));});return BPromise[_0xabf6('0x44')](_0x306a17);}}})['then'](function(_0x20ddbb){if(_0x41ea45){var _0x541f56=[];var _0xdde194=[];var _0x535a3b=utils['getChannels']();var _0x569575={'membername':_0x41ea45[_0xabf6('0x2f')],'interface':_0x5324dc,'enterAt':moment()[_0xabf6('0x2b')](_0xabf6('0x31')),'role':_0x41ea45[_0xabf6('0x35')],'internal':_0x41ea45[_0xabf6('0x36')]};_0x535a3b[_0xabf6('0x2d')](function(_0xbb9c2f){_0x541f56['push'](_[_0xabf6('0x54')]({'channel':_0xbb9c2f,'type':_0xabf6('0x55'),'data1':_0xabf6('0x56'),'data2':_0x5324dc},_0x569575));if(_0x41ea45[_0xabf6('0x4a')]){_0xdde194[_0xabf6('0x2e')](_[_0xabf6('0x54')]({'channel':_0xbb9c2f,'type':_0xabf6('0x29'),'data1':_0xabf6('0x57')},_0x569575));}});return db[_0xabf6('0x27')][_0xabf6('0x58')](_0x541f56['concat'](_0xdde194),{'individualHooks':!![]});}})[_0xabf6('0xc')](function(){if(_0x41ea45){return _0x41ea45['update']({'online':!![],'lastLoginAt':moment()[_0xabf6('0x2b')](_0xabf6('0x31')),'voicePause':_0x41ea45[_0xabf6('0x4a')]||![],'mailPause':_0x41ea45[_0xabf6('0x4a')]||![],'chatPause':_0x41ea45[_0xabf6('0x4a')]||![],'faxPause':_0x41ea45[_0xabf6('0x4a')]||![],'smsPause':_0x41ea45['loginInPause']||![],'openchannelPause':_0x41ea45[_0xabf6('0x4a')]||![],'pauseType':_0x41ea45['loginInPause']?_0xabf6('0x57'):null,'lastPauseAt':moment()[_0xabf6('0x2b')](_0xabf6('0x31')),'interface':_0x5324dc});}})[_0xabf6('0xc')](function(_0x15f0cf){_0x1a6707(_0x15f0cf);})[_0xabf6('0x15')](function(_0x1e1357){_0x2398e4(_0x4d4441[_0xabf6('0x12')](0x1f4,_0x1e1357['message']));});});};
\ No newline at end of file
+var _0x57e5=['destroy','getVoiceQueues','upsert','UserVoiceQueue.penalty','merge','callysquare','LOGININPAUSE','concat','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','socket.io-emitter','./user.socket','register','request','then','info','User,\x20%s,\x20%s','debug','request\x20sent','error','code','message','catch','User','findAll','options','raw','limit','include','attributes','map','model','GetUser','stringify','ShowUser','find','where','PauseUser','name','role','interface','UserVoiceQueueRt','update','MemberReport','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','body','type','DEFAULT\x20PAUSE','uniqueid','bulkCreate','UnpauseUser','findOne','channel','voice','mail','chat','fax','sms','whatsapp','set','%s%s','Pause','system','LogoutUser','all','LoginUser','mobile','internal','loginInPause','count','agent','../../config/license/util','getLicense','Maximum\x20login\x20has\x20been\x20reached'];(function(_0x5ff0fb,_0x3f9c34){var _0x44538b=function(_0x2485f5){while(--_0x2485f5){_0x5ff0fb['push'](_0x5ff0fb['shift']());}};_0x44538b(++_0x3f9c34);}(_0x57e5,0x1e3));var _0x557e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x57e5[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x557e('0x0'));var util=require(_0x557e('0x1'));var moment=require(_0x557e('0x2'));var BPromise=require(_0x557e('0x3'));var rs=require(_0x557e('0x4'));var fs=require('fs');var Redis=require(_0x557e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x557e('0x6'));var logger=require(_0x557e('0x7'))(_0x557e('0x8'));var config=require('../../config/environment');var jayson=require(_0x557e('0x9'));var client=jayson[_0x557e('0xa')][_0x557e('0xb')]({'port':0x232a});config['redis']=_[_0x557e('0xc')](config[_0x557e('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x557e('0xe'))(new Redis(config[_0x557e('0xd')]));require(_0x557e('0xf'))[_0x557e('0x10')](socket);function respondWithRpcPromise(_0xebe64f,_0x85560e,_0x6b069d){return new BPromise(function(_0x6f72c3,_0x42b5f1){return client[_0x557e('0x11')](_0xebe64f,_0x6b069d)[_0x557e('0x12')](function(_0x293335){logger[_0x557e('0x13')](_0x557e('0x14'),_0x85560e,'request\x20sent');logger[_0x557e('0x15')]('User,\x20%s,\x20%s,\x20%s',_0x85560e,_0x557e('0x16'),JSON['stringify'](_0x293335));if(_0x293335[_0x557e('0x17')]){if(_0x293335[_0x557e('0x17')][_0x557e('0x18')]===0x1f4){logger[_0x557e('0x17')](_0x557e('0x14'),_0x85560e,_0x293335[_0x557e('0x17')][_0x557e('0x19')]);return _0x42b5f1(_0x293335[_0x557e('0x17')][_0x557e('0x19')]);}logger[_0x557e('0x17')]('User,\x20%s,\x20%s',_0x85560e,_0x293335[_0x557e('0x17')]['message']);return _0x6f72c3(_0x293335[_0x557e('0x17')][_0x557e('0x19')]);}else{logger[_0x557e('0x13')](_0x557e('0x14'),_0x85560e,'request\x20sent');_0x6f72c3(_0x293335['result'][_0x557e('0x19')]);}})[_0x557e('0x1a')](function(_0x2be76a){logger[_0x557e('0x17')]('User,\x20%s,\x20%s',_0x85560e,_0x2be76a);_0x42b5f1(_0x2be76a);});});}exports['GetUser']=function(_0x59cf9a){var _0x4c1304=this;return new Promise(function(_0x172702,_0x14f2da){return db[_0x557e('0x1b')][_0x557e('0x1c')]({'raw':_0x59cf9a[_0x557e('0x1d')]?_0x59cf9a[_0x557e('0x1d')][_0x557e('0x1e')]===undefined?!![]:![]:!![],'where':_0x59cf9a[_0x557e('0x1d')]?_0x59cf9a['options']['where']||null:null,'attributes':_0x59cf9a[_0x557e('0x1d')]?_0x59cf9a['options']['attributes']||null:null,'limit':_0x59cf9a[_0x557e('0x1d')]?_0x59cf9a[_0x557e('0x1d')][_0x557e('0x1f')]||null:null,'include':_0x59cf9a[_0x557e('0x1d')]?_0x59cf9a[_0x557e('0x1d')]['include']?_['map'](_0x59cf9a['options'][_0x557e('0x20')],function(_0x4b71ab){return{'model':db[_0x4b71ab['model']],'as':_0x4b71ab['as'],'attributes':_0x4b71ab[_0x557e('0x21')],'include':_0x4b71ab['include']?_[_0x557e('0x22')](_0x4b71ab[_0x557e('0x20')],function(_0x1933bd){return{'model':db[_0x1933bd[_0x557e('0x23')]],'as':_0x1933bd['as'],'attributes':_0x1933bd[_0x557e('0x21')],'include':_0x1933bd[_0x557e('0x20')]?_[_0x557e('0x22')](_0x1933bd['include'],function(_0x47825f){return{'model':db[_0x47825f['model']],'as':_0x47825f['as'],'attributes':_0x47825f[_0x557e('0x21')]};}):[]};}):[]};}):[]:[]})[_0x557e('0x12')](function(_0x49f1c7){logger[_0x557e('0x13')](_0x557e('0x24'),_0x59cf9a);logger['debug'](_0x557e('0x24'),_0x59cf9a,JSON[_0x557e('0x25')](_0x49f1c7));_0x172702(_0x49f1c7);})[_0x557e('0x1a')](function(_0x5d9e1f){logger[_0x557e('0x17')](_0x557e('0x24'),_0x5d9e1f[_0x557e('0x19')],_0x59cf9a);_0x14f2da(_0x4c1304[_0x557e('0x17')](0x1f4,_0x5d9e1f['message']));});});};exports[_0x557e('0x26')]=function(_0x1e0dec){var _0x10ad90=this;return new Promise(function(_0x3432e1,_0xdda4e6){return db['User'][_0x557e('0x27')]({'raw':_0x1e0dec[_0x557e('0x1d')]?_0x1e0dec[_0x557e('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x1e0dec[_0x557e('0x1d')]?_0x1e0dec[_0x557e('0x1d')][_0x557e('0x28')]||null:null,'attributes':_0x1e0dec[_0x557e('0x1d')]?_0x1e0dec[_0x557e('0x1d')][_0x557e('0x21')]||null:null,'include':_0x1e0dec[_0x557e('0x1d')]?_0x1e0dec[_0x557e('0x1d')][_0x557e('0x20')]?_[_0x557e('0x22')](_0x1e0dec['options'][_0x557e('0x20')],function(_0x168448){return{'model':db[_0x168448[_0x557e('0x23')]],'as':_0x168448['as'],'attributes':_0x168448['attributes'],'include':_0x168448[_0x557e('0x20')]?_[_0x557e('0x22')](_0x168448[_0x557e('0x20')],function(_0x5b696b){return{'model':db[_0x5b696b[_0x557e('0x23')]],'as':_0x5b696b['as'],'attributes':_0x5b696b[_0x557e('0x21')],'include':_0x5b696b['include']?_[_0x557e('0x22')](_0x5b696b[_0x557e('0x20')],function(_0x5d1f9b){return{'model':db[_0x5d1f9b[_0x557e('0x23')]],'as':_0x5d1f9b['as'],'attributes':_0x5d1f9b[_0x557e('0x21')]};}):[]};}):[]};}):[]:[]})[_0x557e('0x12')](function(_0x1594a5){logger[_0x557e('0x13')]('ShowUser',_0x1e0dec);logger[_0x557e('0x15')](_0x557e('0x26'),_0x1e0dec,JSON[_0x557e('0x25')](_0x1594a5));_0x3432e1(_0x1594a5);})[_0x557e('0x1a')](function(_0x2249c2){logger[_0x557e('0x17')](_0x557e('0x26'),_0x2249c2[_0x557e('0x19')],_0x1e0dec);_0xdda4e6(_0x10ad90[_0x557e('0x17')](0x1f4,_0x2249c2[_0x557e('0x19')]));});});};exports[_0x557e('0x29')]=function(_0x9044cf){var _0x4e20d9=this;return new Promise(function(_0x584ef5,_0x26bee5){var _0x59457f;return db[_0x557e('0x1b')][_0x557e('0x27')]({'where':_0x9044cf[_0x557e('0x1d')][_0x557e('0x28')]||{},'attributes':['id',_0x557e('0x2a'),_0x557e('0x2b'),'internal',_0x557e('0x2c')]})['then'](function(_0x51e678){if(_0x51e678){_0x59457f=_0x51e678;return db[_0x557e('0x2d')][_0x557e('0x2e')]({'paused':0x1},{'where':{'UserId':_0x59457f['id']},'individualHooks':!![]});}})[_0x557e('0x12')](function(){if(_0x59457f){return db[_0x557e('0x2f')][_0x557e('0x1c')]({'where':{'membername':_0x59457f[_0x557e('0x2a')],'type':_0x557e('0x30'),'exitAt':null}});}})[_0x557e('0x12')](function(_0x2c151c){if(_0x59457f){if(_0x2c151c&&_0x2c151c[_0x557e('0x31')]){var _0xb54294=moment()[_0x557e('0x32')](_0x557e('0x33'));for(var _0x49ad2d=0x0,_0x4ff990=_0x2c151c[_0x557e('0x31')];_0x49ad2d<_0x4ff990;_0x49ad2d++){_0x2c151c[_0x49ad2d][_0x557e('0x34')]({'exitAt':_0xb54294});}}}})[_0x557e('0x12')](function(){if(_0x59457f){var _0x221ebf=[];var _0x17a07f=utils[_0x557e('0x35')]();_0x17a07f[_0x557e('0x36')](function(_0x1047dd){_0x221ebf[_0x557e('0x37')]({'channel':_0x1047dd,'membername':_0x59457f[_0x557e('0x2a')],'interface':_[_0x557e('0x38')](_0x59457f[_0x557e('0x2c')])?util[_0x557e('0x32')](_0x557e('0x39'),_0x59457f['name']):_0x59457f['interface'],'type':_0x557e('0x30'),'enterAt':moment()[_0x557e('0x32')](_0x557e('0x33')),'data1':_0x9044cf[_0x557e('0x3a')][_0x557e('0x3b')]||_0x557e('0x3c'),'role':_0x59457f['role'],'internal':_0x59457f['internal'],'uniqueid':_0x9044cf[_0x557e('0x3a')][_0x557e('0x3d')]||null});});return db[_0x557e('0x2f')][_0x557e('0x3e')](_0x221ebf,{'individualHooks':!![]});}})['then'](function(){if(_0x59457f){return _0x59457f['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x9044cf['body'][_0x557e('0x3b')]||_0x557e('0x3c'),'lastPauseAt':moment()[_0x557e('0x32')](_0x557e('0x33'))});}})['then'](function(_0x40404e){_0x584ef5(_0x40404e);})[_0x557e('0x1a')](function(_0x19ed84){_0x26bee5(_0x4e20d9[_0x557e('0x17')](0x1f4,_0x19ed84[_0x557e('0x19')]));});});};exports[_0x557e('0x3f')]=function(_0x5a2356){var _0x2b6424=this;return new Promise(function(_0x2fdf4d,_0x1f7cd0){var _0x201ce0;return db[_0x557e('0x1b')][_0x557e('0x40')]({'where':_0x5a2356[_0x557e('0x1d')][_0x557e('0x28')]||{},'attributes':['id','name']})[_0x557e('0x12')](function(_0x3219c3){if(_0x3219c3){_0x201ce0=_0x3219c3;if(_0x5a2356[_0x557e('0x3a')][_0x557e('0x41')]&&!utils['isValidChannel'](_0x5a2356[_0x557e('0x3a')][_0x557e('0x41')])){throw new Error('Unknown\x20channel');}switch(_0x5a2356['body'][_0x557e('0x41')]){case _0x557e('0x42'):return db[_0x557e('0x2d')][_0x557e('0x2e')]({'paused':0x0},{'where':{'UserId':_0x201ce0['id']}})[_0x557e('0x12')](function(){return db[_0x557e('0x2f')][_0x557e('0x27')]({'where':{'channel':_0x5a2356['body']['channel'],'membername':_0x201ce0[_0x557e('0x2a')],'type':_0x557e('0x30'),'exitAt':null}});})['then'](function(_0x1c238d){if(_0x1c238d){return _0x1c238d[_0x557e('0x2e')]({'exitAt':moment()[_0x557e('0x32')](_0x557e('0x33')),'data2':'system'},{'individualHooks':!![]});}return null;})['then'](function(){return _0x201ce0[_0x557e('0x2e')]({'voicePause':![]});});case _0x557e('0x43'):case _0x557e('0x44'):case _0x557e('0x45'):case _0x557e('0x46'):case'openchannel':case _0x557e('0x47'):return db[_0x557e('0x2f')][_0x557e('0x27')]({'where':{'channel':_0x5a2356[_0x557e('0x3a')][_0x557e('0x41')],'membername':_0x201ce0['name'],'type':_0x557e('0x30'),'exitAt':null}})[_0x557e('0x12')](function(_0x33da72){return _0x33da72[_0x557e('0x2e')]({'exitAt':moment()[_0x557e('0x32')](_0x557e('0x33')),'data2':'system'},{'individualHooks':!![]});})[_0x557e('0x12')](function(){var _0x1abcc0={};_[_0x557e('0x48')](_0x1abcc0,util[_0x557e('0x32')](_0x557e('0x49'),_0x5a2356[_0x557e('0x3a')][_0x557e('0x41')],_0x557e('0x4a')),![]);return _0x201ce0[_0x557e('0x2e')](_0x1abcc0);});default:return db['UserVoiceQueueRt']['update']({'paused':0x0},{'where':{'UserId':_0x201ce0['id']}})[_0x557e('0x12')](function(){return db[_0x557e('0x2f')]['findAll']({'where':{'membername':_0x201ce0[_0x557e('0x2a')],'type':_0x557e('0x30'),'exitAt':null}});})[_0x557e('0x12')](function(_0x458954){var _0x512ac6=[];_0x458954[_0x557e('0x36')](function(_0x571396){_0x512ac6[_0x557e('0x37')](_0x571396['update']({'exitAt':moment()['format'](_0x557e('0x33')),'data2':_0x557e('0x4b')}));});return BPromise['all'](_0x512ac6);})[_0x557e('0x12')](function(){return _0x201ce0[_0x557e('0x2e')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})['then'](function(_0x21196e){_0x2fdf4d(_0x21196e);})['catch'](function(_0x43e5ff){_0x1f7cd0(_0x2b6424[_0x557e('0x17')](0x1f4,_0x43e5ff[_0x557e('0x19')]));});});};exports[_0x557e('0x4c')]=function(_0x3588df){var _0x176a33=this;return new Promise(function(_0xfb1280,_0x1fabe4){var _0x4b0ca1;return db[_0x557e('0x1b')]['findOne']({'where':_0x3588df[_0x557e('0x1d')]['where']||{},'attributes':['id',_0x557e('0x2a')]})['then'](function(_0x54b254){if(_0x54b254){_0x4b0ca1=_0x54b254;return db[_0x557e('0x2d')]['destroy']({'where':{'membername':_0x4b0ca1[_0x557e('0x2a')]},'individualHooks':!![]});}})[_0x557e('0x12')](function(){if(_0x4b0ca1){return db[_0x557e('0x2f')]['findAll']({'where':{'membername':_0x4b0ca1[_0x557e('0x2a')],'exitAt':null}});}})[_0x557e('0x12')](function(_0x22abda){if(_0x4b0ca1){if(_0x22abda&&_0x22abda['length']){var _0x36ec79=[];_0x22abda['forEach'](function(_0x568e1b){_0x36ec79[_0x557e('0x37')](_0x568e1b[_0x557e('0x2e')]({'exitAt':moment()[_0x557e('0x32')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x557e('0x4d')](_0x36ec79);}}})['then'](function(){if(_0x4b0ca1){return _0x4b0ca1['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x557e('0x12')](function(_0xff9454){_0xfb1280(_0xff9454);})[_0x557e('0x1a')](function(_0x467200){_0x1fabe4(_0x176a33['error'](0x1f4,_0x467200[_0x557e('0x19')]));});});};exports[_0x557e('0x4e')]=function(_0x10a2ff){var _0xa31b25=this;return new Promise(function(_0x39ba53,_0x11f526){var _0x31de24;var _0x15c504;var _0x56281f;var _0x398e92;return db[_0x557e('0x1b')][_0x557e('0x40')]({'where':_0x10a2ff['options'][_0x557e('0x28')]||{},'attributes':['id',_0x557e('0x2a'),'role',_0x557e('0x4f'),'phone',_0x557e('0x50'),_0x557e('0x51'),_0x557e('0x2c')]})[_0x557e('0x12')](function(_0x55f220){if(_0x55f220){_0x31de24=_0x55f220;_0x398e92=_0x10a2ff[_0x557e('0x3a')][_0x557e('0x2c')]?_0x10a2ff[_0x557e('0x3a')][_0x557e('0x2c')]:util[_0x557e('0x32')](_0x557e('0x39'),_0x31de24[_0x557e('0x2a')]);return db['User'][_0x557e('0x52')]({'where':{'role':_0x557e('0x53'),'online':!![],'id':{'$ne':_0x31de24['id']}}});}})[_0x557e('0x12')](function(_0x3a6df9){if(_0x3a6df9){_0x56281f=_0x3a6df9;return require(_0x557e('0x54'))[_0x557e('0x55')]();}})['then'](function(_0x265787){if(_0x265787&&_0x265787['agents']&&_0x56281f>=_0x265787['agents']){throw new Error(_0x557e('0x56'));}})[_0x557e('0x12')](function(){if(_0x31de24){return db[_0x557e('0x2d')][_0x557e('0x57')]({'where':{'membername':_0x31de24[_0x557e('0x2a')]},'individualHooks':!![]});}})[_0x557e('0x12')](function(){if(_0x31de24){return _0x31de24[_0x557e('0x58')]({'raw':!![]});}})[_0x557e('0x12')](function(_0x204cc0){if(_0x31de24){if(_0x204cc0){var _0x4624fc=[];_0x15c504=_0x204cc0;if(_0x15c504['length']){for(var _0x19dd76=0x0;_0x19dd76<_0x15c504[_0x557e('0x31')];_0x19dd76++){_0x4624fc[_0x557e('0x37')](db['UserVoiceQueueRt'][_0x557e('0x59')]({'membername':_0x31de24[_0x557e('0x2a')],'UserId':_0x31de24['id'],'queue_name':_0x15c504[_0x19dd76][_0x557e('0x2a')],'VoiceQueueId':_0x15c504[_0x19dd76]['id'],'interface':_0x398e92,'paused':_0x31de24[_0x557e('0x51')]||![],'penalty':_0x15c504[_0x19dd76][_0x557e('0x5a')]||0x0}));}return BPromise[_0x557e('0x4d')](_0x4624fc);}}}})[_0x557e('0x12')](function(){if(_0x31de24){return db['MemberReport'][_0x557e('0x1c')]({'where':{'membername':_0x31de24['name'],'exitAt':null}});}})[_0x557e('0x12')](function(_0x83abf8){if(_0x31de24){if(_0x83abf8&&_0x83abf8[_0x557e('0x31')]){var _0x343bc9=[];_0x83abf8[_0x557e('0x36')](function(_0x124063){_0x343bc9[_0x557e('0x37')](_0x124063[_0x557e('0x2e')]({'exitAt':moment()[_0x557e('0x32')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x557e('0x4d')](_0x343bc9);}}})['then'](function(_0x2900d0){if(_0x31de24){var _0x2b2dee=[];var _0x170fae=[];var _0x1636f7=utils[_0x557e('0x35')]();var _0xfb4f={'membername':_0x31de24['name'],'interface':_0x398e92,'enterAt':moment()[_0x557e('0x32')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x31de24[_0x557e('0x2b')],'internal':_0x31de24['internal']};_0x1636f7['forEach'](function(_0x1d58bb){_0x2b2dee[_0x557e('0x37')](_[_0x557e('0x5b')]({'channel':_0x1d58bb,'type':'LOGIN','data1':_0x557e('0x5c'),'data2':_0x398e92},_0xfb4f));if(_0x31de24[_0x557e('0x51')]){_0x170fae[_0x557e('0x37')](_['merge']({'channel':_0x1d58bb,'type':'PAUSE','data1':_0x557e('0x5d')},_0xfb4f));}});return db['MemberReport'][_0x557e('0x3e')](_0x2b2dee[_0x557e('0x5e')](_0x170fae),{'individualHooks':!![]});}})[_0x557e('0x12')](function(){if(_0x31de24){return _0x31de24[_0x557e('0x2e')]({'online':!![],'lastLoginAt':moment()['format'](_0x557e('0x33')),'voicePause':_0x31de24[_0x557e('0x51')]||![],'mailPause':_0x31de24[_0x557e('0x51')]||![],'chatPause':_0x31de24[_0x557e('0x51')]||![],'faxPause':_0x31de24[_0x557e('0x51')]||![],'smsPause':_0x31de24['loginInPause']||![],'openchannelPause':_0x31de24['loginInPause']||![],'pauseType':_0x31de24[_0x557e('0x51')]?'LOGININPAUSE':null,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x398e92});}})[_0x557e('0x12')](function(_0x4ab3e8){_0x39ba53(_0x4ab3e8);})[_0x557e('0x1a')](function(_0x21915c){_0x11f526(_0xa31b25[_0x557e('0x17')](0x1f4,_0x21915c[_0x557e('0x19')]));});});};
\ No newline at end of file
index 1918f18..a94ff45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b8e=['length','user:','./user.events','save','update','emit','removeListener','register'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x1b8e,0x182));var _0xe1b8=function(_0x546cca,_0x2c3208){_0x546cca=_0x546cca-0x0;var _0x517c8a=_0x1b8e[_0x546cca];return _0x517c8a;};'use strict';var UserEvents=require(_0xe1b8('0x0'));var events=[_0xe1b8('0x1'),'remove',_0xe1b8('0x2')];function createListener(_0x50216b,_0x54e285){return function(_0x53abff){_0x54e285[_0xe1b8('0x3')](_0x50216b,_0x53abff);};}function removeListener(_0x1f6d42,_0x19bdd2){return function(){UserEvents[_0xe1b8('0x4')](_0x1f6d42,_0x19bdd2);};}exports[_0xe1b8('0x5')]=function(_0x42663d){for(var _0x5d06e6=0x0,_0x392a07=events[_0xe1b8('0x6')];_0x5d06e6<_0x392a07;_0x5d06e6++){var _0x7a286=events[_0x5d06e6];var _0x120c46=createListener(_0xe1b8('0x7')+_0x7a286,_0x42663d);UserEvents['on'](_0x7a286,_0x120c46);}};
\ No newline at end of file
+var _0x12e2=['save','remove','emit','removeListener','register','length'];(function(_0x31098b,_0x44d339){var _0x244d35=function(_0x5a814d){while(--_0x5a814d){_0x31098b['push'](_0x31098b['shift']());}};_0x244d35(++_0x44d339);}(_0x12e2,0x96));var _0x212e=function(_0x38563d,_0x2013c2){_0x38563d=_0x38563d-0x0;var _0x4d2f1f=_0x12e2[_0x38563d];return _0x4d2f1f;};'use strict';var UserEvents=require('./user.events');var events=[_0x212e('0x0'),_0x212e('0x1'),'update'];function createListener(_0x37bf4c,_0x41ae21){return function(_0x591a41){_0x41ae21[_0x212e('0x2')](_0x37bf4c,_0x591a41);};}function removeListener(_0x438628,_0x3ca6f8){return function(){UserEvents[_0x212e('0x3')](_0x438628,_0x3ca6f8);};}exports[_0x212e('0x4')]=function(_0x2296a3){for(var _0x389300=0x0,_0x1440c8=events[_0x212e('0x5')];_0x389300<_0x1440c8;_0x389300++){var _0x5bc208=events[_0x389300];var _0x165240=createListener('user:'+_0x5bc208,_0x2296a3);UserEvents['on'](_0x5bc208,_0x165240);}};
\ No newline at end of file
index 55738b2..6315bde 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(_0x9c99f1,_0x414361){var _0xbc1c02=function(_0x2e190b){while(--_0x2e190b){_0x9c99f1['push'](_0x9c99f1['shift']());}};_0xbc1c02(++_0x414361);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x102977,_0x3a99a6){_0x102977=_0x102977-0x0;var _0x15c466=_0xcb91[_0x102977];return _0x15c466;};'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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x4d80c9,_0x368db5){var _0x4d74e3=function(_0x5567cf){while(--_0x5567cf){_0x4d80c9['push'](_0x4d80c9['shift']());}};_0x4d74e3(++_0x368db5);}(_0xedd9,0xfc));var _0x9edd=function(_0x40f6e9,_0x1cc6cf){_0x40f6e9=_0x40f6e9-0x0;var _0x605d54=_0xedd9[_0x40f6e9];return _0x605d54;};'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 d4a5326..5cd9a32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe1eb=['INTEGER','exports'];(function(_0x4ec119,_0x5e20f7){var _0x1f45a9=function(_0x247f80){while(--_0x247f80){_0x4ec119['push'](_0x4ec119['shift']());}};_0x1f45a9(++_0x5e20f7);}(_0xe1eb,0x1a7));var _0xbe1e=function(_0x564674,_0x462e46){_0x564674=_0x564674-0x0;var _0x5a8b9e=_0xe1eb[_0x564674];return _0x5a8b9e;};'use strict';var Sequelize=require('sequelize');module[_0xbe1e('0x0')]={'penalty':{'type':Sequelize[_0xbe1e('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x7579=['exports','INTEGER','sequelize'];(function(_0x4429e0,_0xee6f1f){var _0x51a5b3=function(_0x16eb11){while(--_0x16eb11){_0x4429e0['push'](_0x4429e0['shift']());}};_0x51a5b3(++_0xee6f1f);}(_0x7579,0x1e2));var _0x9757=function(_0x25aa6e,_0x17f97d){_0x25aa6e=_0x25aa6e-0x0;var _0x1b9380=_0x7579[_0x25aa6e];return _0x1b9380;};'use strict';var Sequelize=require(_0x9757('0x0'));module[_0x9757('0x1')]={'penalty':{'type':Sequelize[_0x9757('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 0d95aae..f030c64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc9f8=['moment','bluebird','path','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','user_has_chat_queues','lodash','api'];(function(_0x227622,_0x2d11fd){var _0x40823a=function(_0x46ebf9){while(--_0x46ebf9){_0x227622['push'](_0x227622['shift']());}};_0x40823a(++_0x2d11fd);}(_0xc9f8,0xda));var _0x8c9f=function(_0x1862aa,_0x447b96){_0x1862aa=_0x1862aa-0x0;var _0x14a5ef=_0xc9f8[_0x1862aa];return _0x14a5ef;};'use strict';var _=require(_0x8c9f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8c9f('0x1'));var moment=require(_0x8c9f('0x2'));var BPromise=require(_0x8c9f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8c9f('0x4'));var rimraf=require(_0x8c9f('0x5'));var config=require(_0x8c9f('0x6'));var attributes=require(_0x8c9f('0x7'));module[_0x8c9f('0x8')]=function(_0x300d21,_0x50db6f){return _0x300d21[_0x8c9f('0x9')]('UserChatQueue',attributes,{'tableName':_0x8c9f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x64a3=['request-promise','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3b39ee,_0xf6063b){var _0x2c258f=function(_0xb46400){while(--_0xb46400){_0x3b39ee['push'](_0x3b39ee['shift']());}};_0x2c258f(++_0xf6063b);}(_0x64a3,0x86));var _0x364a=function(_0x3f91a4,_0x3de896){_0x3f91a4=_0x3f91a4-0x0;var _0xf9c26e=_0x64a3[_0x3f91a4];return _0xf9c26e;};'use strict';var _=require(_0x364a('0x0'));var util=require(_0x364a('0x1'));var logger=require(_0x364a('0x2'))(_0x364a('0x3'));var moment=require(_0x364a('0x4'));var BPromise=require(_0x364a('0x5'));var rp=require(_0x364a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x364a('0x7'));var config=require(_0x364a('0x8'));var attributes=require(_0x364a('0x9'));module[_0x364a('0xa')]=function(_0x108982,_0x48d868){return _0x108982[_0x364a('0xb')](_0x364a('0xc'),attributes,{'tableName':_0x364a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b1f57b8..61ba250 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9445=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring'];(function(_0x229c5f,_0x444067){var _0x4c7618=function(_0x3d8e63){while(--_0x3d8e63){_0x229c5f['push'](_0x229c5f['shift']());}};_0x4c7618(++_0x444067);}(_0x9445,0x6a));var _0x5944=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x9445[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require('lodash');var util=require(_0x5944('0x0'));var moment=require(_0x5944('0x1'));var BPromise=require(_0x5944('0x2'));var rs=require(_0x5944('0x3'));var fs=require('fs');var Redis=require(_0x5944('0x4'));var db=require(_0x5944('0x5'))['db'];var utils=require(_0x5944('0x6'));var logger=require(_0x5944('0x7'))(_0x5944('0x8'));var config=require(_0x5944('0x9'));var jayson=require(_0x5944('0xa'));var client=jayson[_0x5944('0xb')][_0x5944('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5b8808,_0xbcbc91,_0xb5d528){return new BPromise(function(_0x6b1764,_0x319dab){return client['request'](_0x5b8808,_0xb5d528)['then'](function(_0x4811dd){logger[_0x5944('0xd')](_0x5944('0xe'),_0xbcbc91,_0x5944('0xf'));logger[_0x5944('0x10')](_0x5944('0x11'),_0xbcbc91,_0x5944('0xf'),JSON['stringify'](_0x4811dd));if(_0x4811dd[_0x5944('0x12')]){if(_0x4811dd[_0x5944('0x12')][_0x5944('0x13')]===0x1f4){logger[_0x5944('0x12')](_0x5944('0xe'),_0xbcbc91,_0x4811dd[_0x5944('0x12')][_0x5944('0x14')]);return _0x319dab(_0x4811dd[_0x5944('0x12')][_0x5944('0x14')]);}logger[_0x5944('0x12')](_0x5944('0xe'),_0xbcbc91,_0x4811dd['error'][_0x5944('0x14')]);return _0x6b1764(_0x4811dd['error'][_0x5944('0x14')]);}else{logger[_0x5944('0xd')](_0x5944('0xe'),_0xbcbc91,_0x5944('0xf'));_0x6b1764(_0x4811dd['result'][_0x5944('0x14')]);}})[_0x5944('0x15')](function(_0x2e91df){logger[_0x5944('0x12')](_0x5944('0xe'),_0xbcbc91,_0x2e91df);_0x319dab(_0x2e91df);});});}
\ No newline at end of file
+var _0x8d3d=['request\x20sent','error','code','UserChatQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','debug','UserChatQueue,\x20%s,\x20%s,\x20%s'];(function(_0x2bf8e5,_0x9528a2){var _0x5bf43b=function(_0x569971){while(--_0x569971){_0x2bf8e5['push'](_0x2bf8e5['shift']());}};_0x5bf43b(++_0x9528a2);}(_0x8d3d,0xed));var _0xd8d3=function(_0x49e4c7,_0x371475){_0x49e4c7=_0x49e4c7-0x0;var _0x296ea0=_0x8d3d[_0x49e4c7];return _0x296ea0;};'use strict';var _=require(_0xd8d3('0x0'));var util=require(_0xd8d3('0x1'));var moment=require(_0xd8d3('0x2'));var BPromise=require(_0xd8d3('0x3'));var rs=require(_0xd8d3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd8d3('0x5'))['db'];var utils=require(_0xd8d3('0x6'));var logger=require(_0xd8d3('0x7'))(_0xd8d3('0x8'));var config=require(_0xd8d3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd8d3('0xa')][_0xd8d3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x27483f,_0x23a0e9,_0x793f18){return new BPromise(function(_0x599bc8,_0x1ec2c6){return client['request'](_0x27483f,_0x793f18)[_0xd8d3('0xc')](function(_0x15e1a7){logger[_0xd8d3('0xd')]('UserChatQueue,\x20%s,\x20%s',_0x23a0e9,'request\x20sent');logger[_0xd8d3('0xe')](_0xd8d3('0xf'),_0x23a0e9,_0xd8d3('0x10'),JSON['stringify'](_0x15e1a7));if(_0x15e1a7[_0xd8d3('0x11')]){if(_0x15e1a7[_0xd8d3('0x11')][_0xd8d3('0x12')]===0x1f4){logger['error'](_0xd8d3('0x13'),_0x23a0e9,_0x15e1a7[_0xd8d3('0x11')][_0xd8d3('0x14')]);return _0x1ec2c6(_0x15e1a7['error'][_0xd8d3('0x14')]);}logger['error'](_0xd8d3('0x13'),_0x23a0e9,_0x15e1a7['error'][_0xd8d3('0x14')]);return _0x599bc8(_0x15e1a7[_0xd8d3('0x11')][_0xd8d3('0x14')]);}else{logger[_0xd8d3('0xd')](_0xd8d3('0x13'),_0x23a0e9,'request\x20sent');_0x599bc8(_0x15e1a7[_0xd8d3('0x15')][_0xd8d3('0x14')]);}})[_0xd8d3('0x16')](function(_0x1568ff){logger['error'](_0xd8d3('0x13'),_0x23a0e9,_0x1568ff);_0x1ec2c6(_0x1568ff);});});}
\ No newline at end of file
index 1b70f3e..49a0fb8 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(_0x691a53,_0x38b4aa){var _0xe9e985=function(_0x34ba36){while(--_0x34ba36){_0x691a53['push'](_0x691a53['shift']());}};_0xe9e985(++_0x38b4aa);}(_0xe706,0xa3));var _0x6e70=function(_0x2803ab,_0x1c33f2){_0x2803ab=_0x2803ab-0x0;var _0x3d6e8e=_0xe706[_0x2803ab];return _0x3d6e8e;};'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(_0xb8d7a3,_0x2daa6d){var _0xcca4b5=function(_0x1e8802){while(--_0x1e8802){_0xb8d7a3['push'](_0xb8d7a3['shift']());}};_0xcca4b5(++_0x2daa6d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2eb3db,_0x4a32c0){_0x2eb3db=_0x2eb3db-0x0;var _0x358f33=_0xcb91[_0x2eb3db];return _0x358f33;};'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 dda0936..fe6520d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77c6=['exports','INTEGER','sequelize'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x77c6,0xe0));var _0x677c=function(_0x22dc65,_0x47354b){_0x22dc65=_0x22dc65-0x0;var _0x1a618e=_0x77c6[_0x22dc65];return _0x1a618e;};'use strict';var Sequelize=require(_0x677c('0x0'));module[_0x677c('0x1')]={'penalty':{'type':Sequelize[_0x677c('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x677c('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x9b75=['sequelize','exports','INTEGER','STRING'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x9b75,0x18c));var _0x59b7=function(_0x404322,_0xa9c40c){_0x404322=_0x404322-0x0;var _0x14d49d=_0x9b75[_0x404322];return _0x14d49d;};'use strict';var Sequelize=require(_0x59b7('0x0'));module[_0x59b7('0x1')]={'penalty':{'type':Sequelize[_0x59b7('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x59b7('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x59b7('0x3')]}};
\ No newline at end of file
index a284208..aef20fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7098=['./userFaxQueue.attributes','define','user_has_fax_queues','util','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x422976,_0x43c807){var _0x5a7f8e=function(_0x34a961){while(--_0x34a961){_0x422976['push'](_0x422976['shift']());}};_0x5a7f8e(++_0x43c807);}(_0x7098,0x111));var _0x8709=function(_0x13017e,_0x1c80bb){_0x13017e=_0x13017e-0x0;var _0x28a819=_0x7098[_0x13017e];return _0x28a819;};'use strict';var _=require('lodash');var util=require(_0x8709('0x0'));var logger=require(_0x8709('0x1'))(_0x8709('0x2'));var moment=require(_0x8709('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8709('0x4'));var rimraf=require(_0x8709('0x5'));var config=require(_0x8709('0x6'));var attributes=require(_0x8709('0x7'));module['exports']=function(_0x5c17e7,_0xbf0b8){return _0x5c17e7[_0x8709('0x8')]('UserFaxQueue',attributes,{'tableName':_0x8709('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x44da=['rimraf','../../config/environment','./userFaxQueue.attributes','exports','UserFaxQueue','user_has_fax_queues','util','../../config/logger','api','request-promise','path'];(function(_0x298069,_0x3f4a0d){var _0x2b8c31=function(_0x1c9041){while(--_0x1c9041){_0x298069['push'](_0x298069['shift']());}};_0x2b8c31(++_0x3f4a0d);}(_0x44da,0xa0));var _0xa44d=function(_0x46662c,_0x384516){_0x46662c=_0x46662c-0x0;var _0x3632ec=_0x44da[_0x46662c];return _0x3632ec;};'use strict';var _=require('lodash');var util=require(_0xa44d('0x0'));var logger=require(_0xa44d('0x1'))(_0xa44d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa44d('0x3'));var fs=require('fs');var path=require(_0xa44d('0x4'));var rimraf=require(_0xa44d('0x5'));var config=require(_0xa44d('0x6'));var attributes=require(_0xa44d('0x7'));module[_0xa44d('0x8')]=function(_0x2219d0,_0x2801aa){return _0x2219d0['define'](_0xa44d('0x9'),attributes,{'tableName':_0xa44d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d2b732e..f4d4f2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc05b=['../../config/environment','jayson/promise','request','then','request\x20sent','debug','stringify','error','code','UserFaxQueue,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x3740bb,_0x387a59){var _0x39f5a4=function(_0x55fd9f){while(--_0x55fd9f){_0x3740bb['push'](_0x3740bb['shift']());}};_0x39f5a4(++_0x387a59);}(_0xc05b,0x176));var _0xbc05=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0xc05b[_0x2261ce];return _0x524640;};'use strict';var _=require(_0xbc05('0x0'));var util=require(_0xbc05('0x1'));var moment=require(_0xbc05('0x2'));var BPromise=require(_0xbc05('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbc05('0x4'));var db=require(_0xbc05('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xbc05('0x6'));var jayson=require(_0xbc05('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5a3f77,_0x3eb442,_0x51a5e7){return new BPromise(function(_0x29d060,_0x3300a2){return client[_0xbc05('0x8')](_0x5a3f77,_0x51a5e7)[_0xbc05('0x9')](function(_0x5f49eb){logger['info']('UserFaxQueue,\x20%s,\x20%s',_0x3eb442,_0xbc05('0xa'));logger[_0xbc05('0xb')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x3eb442,'request\x20sent',JSON[_0xbc05('0xc')](_0x5f49eb));if(_0x5f49eb[_0xbc05('0xd')]){if(_0x5f49eb['error'][_0xbc05('0xe')]===0x1f4){logger['error'](_0xbc05('0xf'),_0x3eb442,_0x5f49eb['error']['message']);return _0x3300a2(_0x5f49eb[_0xbc05('0xd')][_0xbc05('0x10')]);}logger['error'](_0xbc05('0xf'),_0x3eb442,_0x5f49eb[_0xbc05('0xd')][_0xbc05('0x10')]);return _0x29d060(_0x5f49eb['error'][_0xbc05('0x10')]);}else{logger[_0xbc05('0x11')](_0xbc05('0xf'),_0x3eb442,_0xbc05('0xa'));_0x29d060(_0x5f49eb[_0xbc05('0x12')][_0xbc05('0x10')]);}})[_0xbc05('0x13')](function(_0x20026f){logger[_0xbc05('0xd')](_0xbc05('0xf'),_0x3eb442,_0x20026f);_0x3300a2(_0x20026f);});});}
\ No newline at end of file
+var _0x8806=['catch','lodash','util','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x15b6d2,_0x3bf4be){var _0x36a1e2=function(_0x752ef0){while(--_0x752ef0){_0x15b6d2['push'](_0x15b6d2['shift']());}};_0x36a1e2(++_0x3bf4be);}(_0x8806,0x169));var _0x6880=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x8806[_0x29d915];return _0x160f86;};'use strict';var _=require(_0x6880('0x0'));var util=require(_0x6880('0x1'));var moment=require(_0x6880('0x2'));var BPromise=require('bluebird');var rs=require(_0x6880('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6880('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6880('0x5'));var config=require(_0x6880('0x6'));var jayson=require(_0x6880('0x7'));var client=jayson[_0x6880('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45ac83,_0x367277,_0x69465d){return new BPromise(function(_0x5b67e9,_0x5b3cb2){return client['request'](_0x45ac83,_0x69465d)[_0x6880('0x9')](function(_0x49b959){logger[_0x6880('0xa')](_0x6880('0xb'),_0x367277,_0x6880('0xc'));logger[_0x6880('0xd')](_0x6880('0xe'),_0x367277,_0x6880('0xc'),JSON[_0x6880('0xf')](_0x49b959));if(_0x49b959[_0x6880('0x10')]){if(_0x49b959[_0x6880('0x10')]['code']===0x1f4){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x367277,_0x49b959['error'][_0x6880('0x11')]);return _0x5b3cb2(_0x49b959['error'][_0x6880('0x11')]);}logger[_0x6880('0x10')](_0x6880('0xb'),_0x367277,_0x49b959[_0x6880('0x10')][_0x6880('0x11')]);return _0x5b67e9(_0x49b959[_0x6880('0x10')][_0x6880('0x11')]);}else{logger['info'](_0x6880('0xb'),_0x367277,_0x6880('0xc'));_0x5b67e9(_0x49b959[_0x6880('0x12')]['message']);}})[_0x6880('0x13')](function(_0x49f833){logger[_0x6880('0x10')](_0x6880('0xb'),_0x367277,_0x49f833);_0x5b3cb2(_0x49f833);});});}
\ No newline at end of file
index 67124b2..bb69722 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x4c705e,_0x5df3a4){var _0x5b989c=function(_0x4ff86b){while(--_0x4ff86b){_0x4c705e['push'](_0x4c705e['shift']());}};_0x5b989c(++_0x5df3a4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
+var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1e5421,_0xde3ae1){var _0x8b4b2e=function(_0xec22b6){while(--_0xec22b6){_0x1e5421['push'](_0x1e5421['shift']());}};_0x8b4b2e(++_0xde3ae1);}(_0x70e0,0x17b));var _0x070e=function(_0x46f059,_0x4d15fb){_0x46f059=_0x46f059-0x0;var _0x182258=_0x70e0[_0x46f059];return _0x182258;};'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 17e2228..5ef5e65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0007=['exports','INTEGER','sequelize'];(function(_0x4204ff,_0x58e18c){var _0x5b1e73=function(_0xf049fe){while(--_0xf049fe){_0x4204ff['push'](_0x4204ff['shift']());}};_0x5b1e73(++_0x58e18c);}(_0x0007,0x1e8));var _0x7000=function(_0x1c60bd,_0x207c9b){_0x1c60bd=_0x1c60bd-0x0;var _0xc46ef9=_0x0007[_0x1c60bd];return _0xc46ef9;};'use strict';var Sequelize=require(_0x7000('0x0'));module[_0x7000('0x1')]={'penalty':{'type':Sequelize[_0x7000('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xdfe9=['INTEGER','sequelize','exports'];(function(_0x30faee,_0x1c3794){var _0x3a90ab=function(_0x11129b){while(--_0x11129b){_0x30faee['push'](_0x30faee['shift']());}};_0x3a90ab(++_0x1c3794);}(_0xdfe9,0x199));var _0x9dfe=function(_0x4d1dc4,_0x364b26){_0x4d1dc4=_0x4d1dc4-0x0;var _0x102993=_0xdfe9[_0x4d1dc4];return _0x102993;};'use strict';var Sequelize=require(_0x9dfe('0x0'));module[_0x9dfe('0x1')]={'penalty':{'type':Sequelize[_0x9dfe('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 05289ae..3b8ee8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x015f=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash','util'];(function(_0x5e4f67,_0x28220d){var _0x44628c=function(_0x24de2d){while(--_0x24de2d){_0x5e4f67['push'](_0x5e4f67['shift']());}};_0x44628c(++_0x28220d);}(_0x015f,0x1be));var _0xf015=function(_0x7dfb59,_0x2db32f){_0x7dfb59=_0x7dfb59-0x0;var _0x326c4a=_0x015f[_0x7dfb59];return _0x326c4a;};'use strict';var _=require(_0xf015('0x0'));var util=require(_0xf015('0x1'));var logger=require(_0xf015('0x2'))(_0xf015('0x3'));var moment=require(_0xf015('0x4'));var BPromise=require('bluebird');var rp=require(_0xf015('0x5'));var fs=require('fs');var path=require(_0xf015('0x6'));var rimraf=require(_0xf015('0x7'));var config=require(_0xf015('0x8'));var attributes=require(_0xf015('0x9'));module[_0xf015('0xa')]=function(_0x3c418c,_0xd58667){return _0x3c418c[_0xf015('0xb')](_0xf015('0xc'),attributes,{'tableName':_0xf015('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x18fc=['api','moment','bluebird','request-promise','rimraf','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash','util'];(function(_0x1baa84,_0x3c938e){var _0x18523b=function(_0x120137){while(--_0x120137){_0x1baa84['push'](_0x1baa84['shift']());}};_0x18523b(++_0x3c938e);}(_0x18fc,0x1de));var _0xc18f=function(_0x19f9e6,_0x4f59a6){_0x19f9e6=_0x19f9e6-0x0;var _0x45c862=_0x18fc[_0x19f9e6];return _0x45c862;};'use strict';var _=require(_0xc18f('0x0'));var util=require(_0xc18f('0x1'));var logger=require('../../config/logger')(_0xc18f('0x2'));var moment=require(_0xc18f('0x3'));var BPromise=require(_0xc18f('0x4'));var rp=require(_0xc18f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc18f('0x6'));var config=require('../../config/environment');var attributes=require(_0xc18f('0x7'));module[_0xc18f('0x8')]=function(_0xe8ea9f,_0x2e5c6e){return _0xe8ea9f[_0xc18f('0x9')](_0xc18f('0xa'),attributes,{'tableName':_0xc18f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index dc9b3ca..5305a17 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x1fe5a1,_0x1730de){var _0xce7074=function(_0x5b40c9){while(--_0x5b40c9){_0x1fe5a1['push'](_0x1fe5a1['shift']());}};_0xce7074(++_0x1730de);}(_0x3e74,0x175));var _0x43e7=function(_0x2e3e34,_0x258b3f){_0x2e3e34=_0x2e3e34-0x0;var _0x10cec3=_0x3e74[_0x2e3e34];return _0x10cec3;};'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
+var _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x1cb9,0x14e));var _0x91cb=function(_0x3f459f,_0x599978){_0x3f459f=_0x3f459f-0x0;var _0xe2ad1e=_0x1cb9[_0x3f459f];return _0xe2ad1e;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('UserMailQueue,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});}
\ No newline at end of file
index 1b0a766..b9a1bf4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6520=['express','Router','../../components/auth/service','../../components/interaction/service','./userNotification.controller','post','isAuthenticated','multer','path','connect-timeout'];(function(_0x36cfb3,_0x5b960a){var _0x198942=function(_0x23a7f6){while(--_0x23a7f6){_0x36cfb3['push'](_0x36cfb3['shift']());}};_0x198942(++_0x5b960a);}(_0x6520,0x1ab));var _0x0652=function(_0x296768,_0x624602){_0x296768=_0x296768-0x0;var _0x30b1d3=_0x6520[_0x296768];return _0x30b1d3;};'use strict';var multer=require(_0x0652('0x0'));var util=require('util');var path=require(_0x0652('0x1'));var timeout=require(_0x0652('0x2'));var express=require(_0x0652('0x3'));var router=express[_0x0652('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0652('0x5'));var interaction=require(_0x0652('0x6'));var config=require('../../config/environment');var controller=require(_0x0652('0x7'));router[_0x0652('0x8')]('/',auth[_0x0652('0x9')](),controller['sendUserNotification']);module['exports']=router;
\ No newline at end of file
+var _0xe25d=['../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','exports','multer','Router','fs-extra'];(function(_0x7c0074,_0x1ffdcf){var _0x13e95b=function(_0x521212){while(--_0x521212){_0x7c0074['push'](_0x7c0074['shift']());}};_0x13e95b(++_0x1ffdcf);}(_0xe25d,0x177));var _0xde25=function(_0x2ddb8d,_0x3ffa5d){_0x2ddb8d=_0x2ddb8d-0x0;var _0x5e5c48=_0xe25d[_0x2ddb8d];return _0x5e5c48;};'use strict';var multer=require(_0xde25('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xde25('0x1')]();var fs_extra=require(_0xde25('0x2'));var auth=require(_0xde25('0x3'));var interaction=require(_0xde25('0x4'));var config=require(_0xde25('0x5'));var controller=require(_0xde25('0x6'));router[_0xde25('0x7')]('/',auth['isAuthenticated'](),controller['sendUserNotification']);module[_0xde25('0x8')]=router;
\ No newline at end of file
index 5ab973f..1905700 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf41=['TEXT','STRING','sequelize','exports'];(function(_0x16b662,_0x17ac7b){var _0xa15d2c=function(_0x7d279d){while(--_0x7d279d){_0x16b662['push'](_0x16b662['shift']());}};_0xa15d2c(++_0x17ac7b);}(_0xbf41,0x11a));var _0x1bf4=function(_0x1cb62f,_0x34425c){_0x1cb62f=_0x1cb62f-0x0;var _0x1d7916=_0xbf41[_0x1cb62f];return _0x1d7916;};'use strict';var Sequelize=require(_0x1bf4('0x0'));module[_0x1bf4('0x1')]={'body':{'type':Sequelize[_0x1bf4('0x2')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0x1bf4('0x2')]},'recipientsDescription':{'type':Sequelize[_0x1bf4('0x3')]},'beep':{'type':Sequelize['BOOLEAN']}};
\ No newline at end of file
+var _0xa371=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x4f14bd,_0x28b9db){var _0x515b8b=function(_0x523703){while(--_0x523703){_0x4f14bd['push'](_0x4f14bd['shift']());}};_0x515b8b(++_0x28b9db);}(_0xa371,0x129));var _0x1a37=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xa371[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x1a37('0x0'));module[_0x1a37('0x1')]={'body':{'type':Sequelize[_0x1a37('0x2')]},'senderName':{'type':Sequelize[_0x1a37('0x3')]},'recipientsId':{'type':Sequelize[_0x1a37('0x2')]},'recipientsDescription':{'type':Sequelize[_0x1a37('0x3')]},'beep':{'type':Sequelize[_0x1a37('0x4')]}};
\ No newline at end of file
index 75289e1..487a4fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x752f=['Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','Missing\x20\x27recipients\x27\x20parameter','recipients','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','join','sequelize','transaction','UserNotification','create','recipient','userNotification:send','catch','Template','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','User','queue','replace','Queue','ids','push','union','flatten','map','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','./userNotification.socket','register','sendStatus','status','end','undefined','limit','offset','set','Content-Range','apply','reject','save','update','destroy','then','stack','send','body','hasOwnProperty','text','TemplateId'];(function(_0x436641,_0x4afca2){var _0x29e38f=function(_0x352f84){while(--_0x352f84){_0x436641['push'](_0x436641['shift']());}};_0x29e38f(++_0x4afca2);}(_0x752f,0x14e));var _0xf752=function(_0x57a846,_0x284c61){_0x57a846=_0x57a846-0x0;var _0x3a42b6=_0x752f[_0x57a846];return _0x3a42b6;};'use strict';var emlformat=require(_0xf752('0x0'));var rimraf=require(_0xf752('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf752('0x2'));var rp=require(_0xf752('0x3'));var moment=require(_0xf752('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf752('0x5'));var util=require('util');var path=require('path');var sox=require(_0xf752('0x6'));var csv=require(_0xf752('0x7'));var ejs=require(_0xf752('0x8'));var fs=require('fs');var fs_extra=require(_0xf752('0x9'));var _=require(_0xf752('0xa'));var squel=require(_0xf752('0xb'));var crypto=require('crypto');var jsforce=require(_0xf752('0xc'));var deskjs=require(_0xf752('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf752('0xe'));var Papa=require(_0xf752('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf752('0x10'));var logger=require(_0xf752('0x11'))(_0xf752('0x12'));var utils=require(_0xf752('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf752('0x14'))['db'];config[_0xf752('0x15')]=_[_0xf752('0x16')](config[_0xf752('0x15')],{'host':_0xf752('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf752('0x15')]));require(_0xf752('0x18'))[_0xf752('0x19')](socket);function respondWithStatusCode(_0x38fca7,_0x26fb8e){_0x26fb8e=_0x26fb8e||0xcc;return function(_0x144171){if(_0x144171){return _0x38fca7[_0xf752('0x1a')](_0x26fb8e);}return _0x38fca7[_0xf752('0x1b')](_0x26fb8e)[_0xf752('0x1c')]();};}function respondWithResult(_0x352bcd,_0x177874){_0x177874=_0x177874||0xc8;return function(_0x5745ef){if(_0x5745ef){return _0x352bcd[_0xf752('0x1b')](_0x177874)['json'](_0x5745ef);}};}function respondWithFilteredResult(_0xbcf3e,_0x5bc6f3){return function(_0x4c0506){if(_0x4c0506){var _0x2308a5=typeof _0x5bc6f3['offset']===_0xf752('0x1d')&&typeof _0x5bc6f3[_0xf752('0x1e')]===_0xf752('0x1d');var _0x264322=_0x4c0506['count'];var _0x25447d=_0x2308a5?0x0:_0x5bc6f3[_0xf752('0x1f')];var _0x574a5c=_0x2308a5?_0x4c0506['count']:_0x5bc6f3[_0xf752('0x1f')]+_0x5bc6f3[_0xf752('0x1e')];var _0x4bf0f9;if(_0x574a5c>=_0x264322){_0x574a5c=_0x264322;_0x4bf0f9=0xc8;}else{_0x4bf0f9=0xce;}_0xbcf3e[_0xf752('0x1b')](_0x4bf0f9);return _0xbcf3e[_0xf752('0x20')](_0xf752('0x21'),_0x25447d+'-'+_0x574a5c+'/'+_0x264322)['json'](_0x4c0506);}return null;};}function patchUpdates(_0x1b3040){return function(_0x131162){try{jsonpatch[_0xf752('0x22')](_0x131162,_0x1b3040,!![]);}catch(_0x1ee0a3){return BPromise[_0xf752('0x23')](_0x1ee0a3);}return _0x131162[_0xf752('0x24')]();};}function saveUpdates(_0xb46ae7,_0x127e3e){return function(_0x12d3b4){if(_0x12d3b4){return _0x12d3b4[_0xf752('0x25')](_0xb46ae7)['then'](function(_0x435c87){return _0x435c87;});}return null;};}function removeEntity(_0x53781d,_0x4af289){return function(_0x23e61e){if(_0x23e61e){return _0x23e61e[_0xf752('0x26')]()[_0xf752('0x27')](function(){_0x53781d['status'](0xcc)[_0xf752('0x1c')]();});}};}function handleEntityNotFound(_0x461aee,_0x447f9b){return function(_0x1fc703){if(!_0x1fc703){_0x461aee['sendStatus'](0x194);}return _0x1fc703;};}function handleError(_0x25cab4,_0x3a4871){_0x3a4871=_0x3a4871||0x1f4;return function(_0x5c276f){logger['error'](_0x5c276f[_0xf752('0x28')]);if(_0x5c276f['name']){delete _0x5c276f['name'];}_0x25cab4[_0xf752('0x1b')](_0x3a4871)[_0xf752('0x29')](_0x5c276f);};}exports['sendUserNotification']=function(_0x1d75ec,_0x98aba2,_0x3a85cb){if(!_0x1d75ec[_0xf752('0x2a')][_0xf752('0x2b')](_0xf752('0x2c'))&&!_0x1d75ec[_0xf752('0x2a')][_0xf752('0x2b')](_0xf752('0x2d'))){throw new db[(_0xf752('0x2e'))][(_0xf752('0x2f'))](_0xf752('0x30'));}else{if(_0x1d75ec[_0xf752('0x2a')][_0xf752('0x2b')](_0xf752('0x2d'))&&!_0x1d75ec[_0xf752('0x2a')][_0xf752('0x2b')](_0xf752('0x31'))){throw new db[(_0xf752('0x2e'))][(_0xf752('0x2f'))](_0xf752('0x32'));}if(!_0x1d75ec[_0xf752('0x2a')][_0xf752('0x2b')]('recipients')){throw new db[(_0xf752('0x2e'))][(_0xf752('0x2f'))](_0xf752('0x33'));}else{try{var _0xd3992f=JSON['parse'](_0x1d75ec[_0xf752('0x2a')][_0xf752('0x34')]);}catch(_0x1468a3){logger['error'](_0x1468a3);throw new db[(_0xf752('0x2e'))][(_0xf752('0x2f'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x4ba2e2=[_0xf752('0x35'),_0xf752('0x36'),_0xf752('0x37'),_0xf752('0x38'),_0xf752('0x39'),_0xf752('0x3a'),_0xf752('0x3b'),_0xf752('0x3c'),_0xf752('0x3d')];if(_[_0xf752('0x3e')](_0xd3992f,function(_0x33cb34){return!_[_0xf752('0x3f')](_0x4ba2e2,_0x33cb34[_0xf752('0x40')][_0xf752('0x41')]());})){throw new db[(_0xf752('0x2e'))][(_0xf752('0x2f'))](_0xf752('0x42'));}}}var _0x577cbb={};_0x577cbb[_0xf752('0x43')]=_0x1d75ec[_0xf752('0x2a')]['hasOwnProperty'](_0xf752('0x43'))?_0x1d75ec[_0xf752('0x2a')][_0xf752('0x43')]:_0x1d75ec[_0xf752('0x3d')][_0xf752('0x44')];_0x577cbb[_0xf752('0x45')]=_[_0xf752('0x46')](_0x1d75ec['body']['recipientsDescription'])?null:_0x1d75ec['body'][_0xf752('0x45')];_0x577cbb[_0xf752('0x47')]=_0x1d75ec['body'][_0xf752('0x47')]||![];_0x577cbb[_0xf752('0x48')]=_0x1d75ec[_0xf752('0x3d')]['id'];return getContent(_0x1d75ec[_0xf752('0x2a')])[_0xf752('0x27')](function(_0x22e572){_0x577cbb[_0xf752('0x2a')]=_0x22e572;return getRecipients(_0xd3992f);})[_0xf752('0x27')](function(_0x3d8731){_0x577cbb['recipientsId']=_['sortBy'](_0x3d8731)[_0xf752('0x49')](',');return db[_0xf752('0x4a')][_0xf752('0x4b')](function(_0x593916){return db[_0xf752('0x4c')][_0xf752('0x4d')](_0x577cbb,{'raw':!![],'transaction':_0x593916})[_0xf752('0x27')](function(_0x233a77){var _0x2148c2={'sender':_0x577cbb[_0xf752('0x43')],'description':_0x577cbb[_0xf752('0x45')],'content':_0x577cbb[_0xf752('0x2a')],'beep':_0x577cbb['beep']};_0x3d8731['forEach'](function(_0x394d04){_0x2148c2[_0xf752('0x4e')]=_0x394d04;socket['emit'](_0xf752('0x4f'),_0x2148c2);});return _0x233a77;});});})[_0xf752('0x27')](respondWithResult(_0x98aba2,0xc9))[_0xf752('0x50')](handleError(_0x98aba2,null));};function getContent(_0x2478c0){return new BPromise(function(_0x418ac1,_0x5c958a){if(_0x2478c0[_0xf752('0x2c')]){_0x418ac1(_0x2478c0[_0xf752('0x2c')]);return;}return db[_0xf752('0x51')][_0xf752('0x52')]({'attributes':['html'],'where':{'id':_0x2478c0[_0xf752('0x2d')]},'raw':!![]})[_0xf752('0x27')](function(_0xbd98bd){if(!_0xbd98bd)throw new db[(_0xf752('0x2e'))][(_0xf752('0x2f'))](_0xf752('0x53'));var _0x38f514=Mustache[_0xf752('0x54')](_0xbd98bd['html'],_0x2478c0['view']);_0x418ac1(_0x38f514);})[_0xf752('0x50')](function(_0x2715bd){_0x5c958a(_0x2715bd);});});}function getRecipients(_0xba258f){return new BPromise(function(_0x2bec71,_0x4c063f){var _0x5b863f=[];var _0x4f8344=[];_0xba258f['forEach'](function(_0x600333){var _0x5d579c=_[_0xf752('0x55')](_0x600333[_0xf752('0x40')]['toLowerCase']());if(_0x5d579c===_0xf752('0x56')){_0x5b863f=_['union'](_0x5b863f,_0x600333['ids']);}else{if(_[_0xf752('0x3f')](_0x5d579c,_0xf752('0x57')))_0x5d579c=_0x5d579c[_0xf752('0x58')]('queue',_0xf752('0x59'));_0x600333[_0xf752('0x5a')]['forEach'](function(_0x29110a){_0x4f8344[_0xf752('0x5b')](getAgents(_0x5d579c,_0x29110a));});}});return BPromise['all'](_0x4f8344)[_0xf752('0x27')](function(_0x55ae17){_0x5b863f=_[_0xf752('0x5c')](_0x5b863f,_[_0xf752('0x5d')](_0x55ae17));_0x2bec71(_0x5b863f);})[_0xf752('0x50')](function(_0x43c739){_0x4c063f(_0x43c739);});});}function getAgents(_0xc16134,_0x8e463a){return new BPromise(function(_0x9a2c91,_0x45686f){return db[_0xc16134]['findOne']({'where':{'id':_0x8e463a}})[_0xf752('0x27')](function(_0x12cbc5){return _0x12cbc5['getAgents']({'attributes':['id'],'raw':!![]})[_0xf752('0x27')](function(_0x1c07a0){var _0x3f669c=_[_0xf752('0x5e')](_0x1c07a0,'id');_0x9a2c91(_0x3f669c);});})[_0xf752('0x50')](function(_0x38b326){_0x45686f(_0x38b326);});});}
\ No newline at end of file
+var _0xfcc6=['defaults','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','update','then','destroy','error','name','send','sendUserNotification','hasOwnProperty','text','body','TemplateId','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','Sequelize','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','UserNotification','create','forEach','recipient','userNotification:send','Invalid\x20\x27TemplateId\x27\x20parameter','render','view','catch','startCase','User','union','ids','includes','queue','replace','Queue','push','flatten','getAgents','map','zip-dir','request-promise','moment','bluebird','mustache','path','sox','fs-extra','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis'];(function(_0x4f17c3,_0xdaa47b){var _0x758a07=function(_0x37cd67){while(--_0x37cd67){_0x4f17c3['push'](_0x4f17c3['shift']());}};_0x758a07(++_0xdaa47b);}(_0xfcc6,0x1db));var _0x6fcc=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xfcc6[_0x13d07a];return _0x5ee0ee;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6fcc('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6fcc('0x1'));var moment=require(_0x6fcc('0x2'));var BPromise=require(_0x6fcc('0x3'));var Mustache=require(_0x6fcc('0x4'));var util=require('util');var path=require(_0x6fcc('0x5'));var sox=require(_0x6fcc('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6fcc('0x7'));var _=require('lodash');var squel=require(_0x6fcc('0x8'));var crypto=require(_0x6fcc('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x6fcc('0xa'));var toCsv=require(_0x6fcc('0xb'));var querystring=require(_0x6fcc('0xc'));var Papa=require('papaparse');var Redis=require(_0x6fcc('0xd'));var authService=require(_0x6fcc('0xe'));var qs=require(_0x6fcc('0xf'));var as=require(_0x6fcc('0x10'));var hardwareService=require(_0x6fcc('0x11'));var logger=require(_0x6fcc('0x12'))(_0x6fcc('0x13'));var utils=require(_0x6fcc('0x14'));var config=require(_0x6fcc('0x15'));var licenseUtil=require(_0x6fcc('0x16'));var db=require(_0x6fcc('0x17'))['db'];config[_0x6fcc('0x18')]=_[_0x6fcc('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6fcc('0x1a'))(new Redis(config[_0x6fcc('0x18')]));require(_0x6fcc('0x1b'))[_0x6fcc('0x1c')](socket);function respondWithStatusCode(_0x51a8fe,_0x4c42c6){_0x4c42c6=_0x4c42c6||0xcc;return function(_0x4600ce){if(_0x4600ce){return _0x51a8fe[_0x6fcc('0x1d')](_0x4c42c6);}return _0x51a8fe[_0x6fcc('0x1e')](_0x4c42c6)[_0x6fcc('0x1f')]();};}function respondWithResult(_0x5d70d3,_0x2698b6){_0x2698b6=_0x2698b6||0xc8;return function(_0xdd86bd){if(_0xdd86bd){return _0x5d70d3[_0x6fcc('0x1e')](_0x2698b6)[_0x6fcc('0x20')](_0xdd86bd);}};}function respondWithFilteredResult(_0x7521e0,_0x255868){return function(_0x2d223b){if(_0x2d223b){var _0x3f270e=typeof _0x255868[_0x6fcc('0x21')]===_0x6fcc('0x22')&&typeof _0x255868['limit']===_0x6fcc('0x22');var _0x243446=_0x2d223b[_0x6fcc('0x23')];var _0x2a2ec7=_0x3f270e?0x0:_0x255868['offset'];var _0x3af87d=_0x3f270e?_0x2d223b[_0x6fcc('0x23')]:_0x255868[_0x6fcc('0x21')]+_0x255868['limit'];var _0x1ba147;if(_0x3af87d>=_0x243446){_0x3af87d=_0x243446;_0x1ba147=0xc8;}else{_0x1ba147=0xce;}_0x7521e0[_0x6fcc('0x1e')](_0x1ba147);return _0x7521e0['set'](_0x6fcc('0x24'),_0x2a2ec7+'-'+_0x3af87d+'/'+_0x243446)['json'](_0x2d223b);}return null;};}function patchUpdates(_0x3e49cb){return function(_0x2d3d60){try{jsonpatch[_0x6fcc('0x25')](_0x2d3d60,_0x3e49cb,!![]);}catch(_0x48ac24){return BPromise[_0x6fcc('0x26')](_0x48ac24);}return _0x2d3d60['save']();};}function saveUpdates(_0x2f2461,_0x37c574){return function(_0x1af763){if(_0x1af763){return _0x1af763[_0x6fcc('0x27')](_0x2f2461)[_0x6fcc('0x28')](function(_0x37c05f){return _0x37c05f;});}return null;};}function removeEntity(_0x17274b,_0x2b8673){return function(_0x3e3444){if(_0x3e3444){return _0x3e3444[_0x6fcc('0x29')]()[_0x6fcc('0x28')](function(){_0x17274b[_0x6fcc('0x1e')](0xcc)[_0x6fcc('0x1f')]();});}};}function handleEntityNotFound(_0x557d92,_0x164781){return function(_0x1b45e3){if(!_0x1b45e3){_0x557d92[_0x6fcc('0x1d')](0x194);}return _0x1b45e3;};}function handleError(_0x47a6d9,_0x1d84e5){_0x1d84e5=_0x1d84e5||0x1f4;return function(_0x29613d){logger[_0x6fcc('0x2a')](_0x29613d['stack']);if(_0x29613d[_0x6fcc('0x2b')]){delete _0x29613d[_0x6fcc('0x2b')];}_0x47a6d9[_0x6fcc('0x1e')](_0x1d84e5)[_0x6fcc('0x2c')](_0x29613d);};}exports[_0x6fcc('0x2d')]=function(_0x2674f9,_0x364084,_0x3a1811){if(!_0x2674f9['body'][_0x6fcc('0x2e')](_0x6fcc('0x2f'))&&!_0x2674f9[_0x6fcc('0x30')]['hasOwnProperty'](_0x6fcc('0x31'))){throw new db['Sequelize'][(_0x6fcc('0x32'))](_0x6fcc('0x33'));}else{if(_0x2674f9[_0x6fcc('0x30')][_0x6fcc('0x2e')]('TemplateId')&&!_0x2674f9[_0x6fcc('0x30')][_0x6fcc('0x2e')]('view')){throw new db[(_0x6fcc('0x34'))][(_0x6fcc('0x32'))](_0x6fcc('0x35'));}if(!_0x2674f9[_0x6fcc('0x30')]['hasOwnProperty'](_0x6fcc('0x36'))){throw new db[(_0x6fcc('0x34'))][(_0x6fcc('0x32'))](_0x6fcc('0x37'));}else{try{var _0x5d4411=JSON[_0x6fcc('0x38')](_0x2674f9[_0x6fcc('0x30')][_0x6fcc('0x36')]);}catch(_0x13184a){logger[_0x6fcc('0x2a')](_0x13184a);throw new db['Sequelize'][(_0x6fcc('0x32'))](_0x6fcc('0x39'));}var _0x1ff869=[_0x6fcc('0x3a'),'faxqueue','mailqueue',_0x6fcc('0x3b'),_0x6fcc('0x3c'),_0x6fcc('0x3d'),_0x6fcc('0x3e'),_0x6fcc('0x3f'),_0x6fcc('0x40')];if(_[_0x6fcc('0x41')](_0x5d4411,function(_0x1bbbf6){return!_['includes'](_0x1ff869,_0x1bbbf6[_0x6fcc('0x42')][_0x6fcc('0x43')]());})){throw new db[(_0x6fcc('0x34'))][(_0x6fcc('0x32'))](_0x6fcc('0x44'));}}}var _0x2593b7={};_0x2593b7[_0x6fcc('0x45')]=_0x2674f9['body']['hasOwnProperty'](_0x6fcc('0x45'))?_0x2674f9['body'][_0x6fcc('0x45')]:_0x2674f9[_0x6fcc('0x40')][_0x6fcc('0x46')];_0x2593b7[_0x6fcc('0x47')]=_['isEmpty'](_0x2674f9[_0x6fcc('0x30')]['recipientsDescription'])?null:_0x2674f9[_0x6fcc('0x30')][_0x6fcc('0x47')];_0x2593b7[_0x6fcc('0x48')]=_0x2674f9['body'][_0x6fcc('0x48')]||![];_0x2593b7[_0x6fcc('0x49')]=_0x2674f9[_0x6fcc('0x40')]['id'];return getContent(_0x2674f9[_0x6fcc('0x30')])['then'](function(_0x58a5b4){_0x2593b7[_0x6fcc('0x30')]=_0x58a5b4;return getRecipients(_0x5d4411);})[_0x6fcc('0x28')](function(_0x1f2185){_0x2593b7[_0x6fcc('0x4a')]=_[_0x6fcc('0x4b')](_0x1f2185)[_0x6fcc('0x4c')](',');return db[_0x6fcc('0x4d')][_0x6fcc('0x4e')](function(_0x43f275){return db[_0x6fcc('0x4f')][_0x6fcc('0x50')](_0x2593b7,{'raw':!![],'transaction':_0x43f275})[_0x6fcc('0x28')](function(_0x52e323){var _0x46f7bf={'sender':_0x2593b7[_0x6fcc('0x45')],'description':_0x2593b7['recipientsDescription'],'content':_0x2593b7[_0x6fcc('0x30')],'beep':_0x2593b7[_0x6fcc('0x48')]};_0x1f2185[_0x6fcc('0x51')](function(_0x2e36f2){_0x46f7bf[_0x6fcc('0x52')]=_0x2e36f2;socket['emit'](_0x6fcc('0x53'),_0x46f7bf);});return _0x52e323;});});})[_0x6fcc('0x28')](respondWithResult(_0x364084,0xc9))['catch'](handleError(_0x364084,null));};function getContent(_0x6551bf){return new BPromise(function(_0x47b2a0,_0x1130d3){if(_0x6551bf[_0x6fcc('0x2f')]){_0x47b2a0(_0x6551bf[_0x6fcc('0x2f')]);return;}return db['Template']['findOne']({'attributes':['html'],'where':{'id':_0x6551bf['TemplateId']},'raw':!![]})['then'](function(_0x3508c9){if(!_0x3508c9)throw new db[(_0x6fcc('0x34'))][(_0x6fcc('0x32'))](_0x6fcc('0x54'));var _0x40fa4b=Mustache[_0x6fcc('0x55')](_0x3508c9['html'],_0x6551bf[_0x6fcc('0x56')]);_0x47b2a0(_0x40fa4b);})[_0x6fcc('0x57')](function(_0x586dea){_0x1130d3(_0x586dea);});});}function getRecipients(_0x1e0893){return new BPromise(function(_0x40cf48,_0x177c2a){var _0x4b566f=[];var _0x446d39=[];_0x1e0893[_0x6fcc('0x51')](function(_0x2041ea){var _0x47850b=_[_0x6fcc('0x58')](_0x2041ea['model']['toLowerCase']());if(_0x47850b===_0x6fcc('0x59')){_0x4b566f=_[_0x6fcc('0x5a')](_0x4b566f,_0x2041ea[_0x6fcc('0x5b')]);}else{if(_[_0x6fcc('0x5c')](_0x47850b,_0x6fcc('0x5d')))_0x47850b=_0x47850b[_0x6fcc('0x5e')]('queue',_0x6fcc('0x5f'));_0x2041ea[_0x6fcc('0x5b')]['forEach'](function(_0x31eb16){_0x446d39[_0x6fcc('0x60')](getAgents(_0x47850b,_0x31eb16));});}});return BPromise['all'](_0x446d39)[_0x6fcc('0x28')](function(_0xa6c75b){_0x4b566f=_[_0x6fcc('0x5a')](_0x4b566f,_[_0x6fcc('0x61')](_0xa6c75b));_0x40cf48(_0x4b566f);})['catch'](function(_0x2e092d){_0x177c2a(_0x2e092d);});});}function getAgents(_0x80653d,_0x131c7e){return new BPromise(function(_0x543600,_0x94b760){return db[_0x80653d]['findOne']({'where':{'id':_0x131c7e}})['then'](function(_0x3a9998){return _0x3a9998[_0x6fcc('0x62')]({'attributes':['id'],'raw':!![]})['then'](function(_0x28a20a){var _0x35a174=_[_0x6fcc('0x63')](_0x28a20a,'id');_0x543600(_0x35a174);});})[_0x6fcc('0x57')](function(_0x50f8b3){_0x94b760(_0x50f8b3);});});}
\ No newline at end of file
index c3ae81f..e011845 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x341e=['UserNotification','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x59dbf7,_0x4af706){var _0x57d879=function(_0x25ae42){while(--_0x25ae42){_0x59dbf7['push'](_0x59dbf7['shift']());}};_0x57d879(++_0x4af706);}(_0x341e,0x6a));var _0xe341=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x341e[_0x4a9fb1];return _0x348672;};'use strict';var EventEmitter=require(_0xe341('0x0'));var UserNotification=require(_0xe341('0x1'))['db'][_0xe341('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xe341('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe341('0x4'),'afterDestroy':_0xe341('0x5')};function emitEvent(_0x5a27d8){return function(_0x527502,_0x4a6399,_0x116246){UserNotificationEvents[_0xe341('0x6')](_0x5a27d8+':'+_0x527502['id'],_0x527502);UserNotificationEvents['emit'](_0x5a27d8,_0x527502);_0x116246(null);};}for(var e in events){if(events[_0xe341('0x7')](e)){var event=events[e];UserNotification[_0xe341('0x8')](e,emitEvent(event));}}module['exports']=UserNotificationEvents;
\ No newline at end of file
+var _0x331d=['exports','events','UserNotification','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x331d,0x10f));var _0xd331=function(_0x1df68c,_0xf7a24a){_0x1df68c=_0x1df68c-0x0;var _0x504d8c=_0x331d[_0x1df68c];return _0x504d8c;};'use strict';var EventEmitter=require(_0xd331('0x0'));var UserNotification=require('../../mysqldb')['db'][_0xd331('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xd331('0x2')](0x0);var events={'afterCreate':_0xd331('0x3'),'afterUpdate':'update','afterDestroy':_0xd331('0x4')};function emitEvent(_0x11b237){return function(_0x53b928,_0x122315,_0x5c154b){UserNotificationEvents[_0xd331('0x5')](_0x11b237+':'+_0x53b928['id'],_0x53b928);UserNotificationEvents[_0xd331('0x5')](_0x11b237,_0x53b928);_0x5c154b(null);};}for(var e in events){if(events[_0xd331('0x6')](e)){var event=events[e];UserNotification[_0xd331('0x7')](e,emitEvent(event));}}module[_0xd331('0x8')]=UserNotificationEvents;
\ No newline at end of file
index 405a483..cdbe031 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x195e=['./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x94d88a,_0x26c254){var _0x1ea07e=function(_0x451ee8){while(--_0x451ee8){_0x94d88a['push'](_0x94d88a['shift']());}};_0x1ea07e(++_0x26c254);}(_0x195e,0xa1));var _0xe195=function(_0x47c2e0,_0x313b47){_0x47c2e0=_0x47c2e0-0x0;var _0x4b4000=_0x195e[_0x47c2e0];return _0x4b4000;};'use strict';var _=require(_0xe195('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe195('0x1'));var moment=require(_0xe195('0x2'));var BPromise=require(_0xe195('0x3'));var rp=require(_0xe195('0x4'));var fs=require('fs');var path=require(_0xe195('0x5'));var rimraf=require('rimraf');var config=require(_0xe195('0x6'));var attributes=require(_0xe195('0x7'));module[_0xe195('0x8')]=function(_0x1abd3e,_0x256b2d){return _0x1abd3e[_0xe195('0x9')](_0xe195('0xa'),attributes,{'tableName':_0xe195('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe195('0xc'),'collate':_0xe195('0xd')});};
\ No newline at end of file
+var _0xdcac=['userNotifications','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','UserNotification'];(function(_0xb0de07,_0x3ca2a0){var _0x4633d8=function(_0x2368e0){while(--_0x2368e0){_0xb0de07['push'](_0xb0de07['shift']());}};_0x4633d8(++_0x3ca2a0);}(_0xdcac,0x139));var _0xcdca=function(_0x103841,_0x1492a0){_0x103841=_0x103841-0x0;var _0x278725=_0xdcac[_0x103841];return _0x278725;};'use strict';var _=require('lodash');var util=require(_0xcdca('0x0'));var logger=require('../../config/logger')(_0xcdca('0x1'));var moment=require(_0xcdca('0x2'));var BPromise=require(_0xcdca('0x3'));var rp=require(_0xcdca('0x4'));var fs=require('fs');var path=require(_0xcdca('0x5'));var rimraf=require(_0xcdca('0x6'));var config=require(_0xcdca('0x7'));var attributes=require(_0xcdca('0x8'));module[_0xcdca('0x9')]=function(_0xc2701,_0x447be3){return _0xc2701['define'](_0xcdca('0xa'),attributes,{'tableName':_0xcdca('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index f45150f..79ca91f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x602f=['localhost','socket.io-emitter','./userNotification.socket','register','request','then','info','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','UserNotification,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x225f50,_0x48a77d){var _0x19d003=function(_0x58965d){while(--_0x58965d){_0x225f50['push'](_0x225f50['shift']());}};_0x19d003(++_0x48a77d);}(_0x602f,0x13c));var _0xf602=function(_0x56c30e,_0x355092){_0x56c30e=_0x56c30e-0x0;var _0x2d742c=_0x602f[_0x56c30e];return _0x2d742c;};'use strict';var _=require(_0xf602('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf602('0x1'));var rs=require(_0xf602('0x2'));var fs=require('fs');var Redis=require(_0xf602('0x3'));var db=require(_0xf602('0x4'))['db'];var utils=require(_0xf602('0x5'));var logger=require(_0xf602('0x6'))(_0xf602('0x7'));var config=require(_0xf602('0x8'));var jayson=require(_0xf602('0x9'));var client=jayson[_0xf602('0xa')][_0xf602('0xb')]({'port':0x232a});config[_0xf602('0xc')]=_[_0xf602('0xd')](config[_0xf602('0xc')],{'host':_0xf602('0xe'),'port':0x18eb});var socket=require(_0xf602('0xf'))(new Redis(config['redis']));require(_0xf602('0x10'))[_0xf602('0x11')](socket);function respondWithRpcPromise(_0x11990e,_0x1f0549,_0x4e3b94){return new BPromise(function(_0x1e2fcc,_0x442f14){return client[_0xf602('0x12')](_0x11990e,_0x4e3b94)[_0xf602('0x13')](function(_0x27acc9){logger[_0xf602('0x14')]('UserNotification,\x20%s,\x20%s',_0x1f0549,_0xf602('0x15'));logger[_0xf602('0x16')](_0xf602('0x17'),_0x1f0549,_0xf602('0x15'),JSON[_0xf602('0x18')](_0x27acc9));if(_0x27acc9['error']){if(_0x27acc9[_0xf602('0x19')]['code']===0x1f4){logger[_0xf602('0x19')](_0xf602('0x1a'),_0x1f0549,_0x27acc9[_0xf602('0x19')][_0xf602('0x1b')]);return _0x442f14(_0x27acc9[_0xf602('0x19')][_0xf602('0x1b')]);}logger[_0xf602('0x19')](_0xf602('0x1a'),_0x1f0549,_0x27acc9[_0xf602('0x19')][_0xf602('0x1b')]);return _0x1e2fcc(_0x27acc9[_0xf602('0x19')][_0xf602('0x1b')]);}else{logger['info'](_0xf602('0x1a'),_0x1f0549,'request\x20sent');_0x1e2fcc(_0x27acc9[_0xf602('0x1c')][_0xf602('0x1b')]);}})[_0xf602('0x1d')](function(_0x5afb2c){logger[_0xf602('0x19')](_0xf602('0x1a'),_0x1f0549,_0x5afb2c);_0x442f14(_0x5afb2c);});});}
\ No newline at end of file
+var _0xb8f0=['../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x29940e,_0x17e60a){var _0x5b8db1=function(_0x443348){while(--_0x443348){_0x29940e['push'](_0x29940e['shift']());}};_0x5b8db1(++_0x17e60a);}(_0xb8f0,0x13f));var _0x0b8f=function(_0x30f585,_0x37d357){_0x30f585=_0x30f585-0x0;var _0x322427=_0xb8f0[_0x30f585];return _0x322427;};'use strict';var _=require('lodash');var util=require(_0x0b8f('0x0'));var moment=require(_0x0b8f('0x1'));var BPromise=require('bluebird');var rs=require(_0x0b8f('0x2'));var fs=require('fs');var Redis=require(_0x0b8f('0x3'));var db=require(_0x0b8f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0b8f('0x5'))('rpc');var config=require(_0x0b8f('0x6'));var jayson=require(_0x0b8f('0x7'));var client=jayson[_0x0b8f('0x8')]['http']({'port':0x232a});config[_0x0b8f('0x9')]=_[_0x0b8f('0xa')](config[_0x0b8f('0x9')],{'host':_0x0b8f('0xb'),'port':0x18eb});var socket=require(_0x0b8f('0xc'))(new Redis(config[_0x0b8f('0x9')]));require('./userNotification.socket')[_0x0b8f('0xd')](socket);function respondWithRpcPromise(_0x1a53f8,_0x4c9ef4,_0x3b0a92){return new BPromise(function(_0x5d29a2,_0x29bee7){return client[_0x0b8f('0xe')](_0x1a53f8,_0x3b0a92)['then'](function(_0x52e692){logger[_0x0b8f('0xf')](_0x0b8f('0x10'),_0x4c9ef4,_0x0b8f('0x11'));logger[_0x0b8f('0x12')](_0x0b8f('0x13'),_0x4c9ef4,_0x0b8f('0x11'),JSON[_0x0b8f('0x14')](_0x52e692));if(_0x52e692[_0x0b8f('0x15')]){if(_0x52e692[_0x0b8f('0x15')][_0x0b8f('0x16')]===0x1f4){logger[_0x0b8f('0x15')](_0x0b8f('0x10'),_0x4c9ef4,_0x52e692[_0x0b8f('0x15')][_0x0b8f('0x17')]);return _0x29bee7(_0x52e692[_0x0b8f('0x15')][_0x0b8f('0x17')]);}logger[_0x0b8f('0x15')]('UserNotification,\x20%s,\x20%s',_0x4c9ef4,_0x52e692[_0x0b8f('0x15')]['message']);return _0x5d29a2(_0x52e692[_0x0b8f('0x15')][_0x0b8f('0x17')]);}else{logger['info'](_0x0b8f('0x10'),_0x4c9ef4,_0x0b8f('0x11'));_0x5d29a2(_0x52e692['result'][_0x0b8f('0x17')]);}})[_0x0b8f('0x18')](function(_0x377a91){logger[_0x0b8f('0x15')](_0x0b8f('0x10'),_0x4c9ef4,_0x377a91);_0x29bee7(_0x377a91);});});}
\ No newline at end of file
index bcf90ed..767f703 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c46=['userNotification:','./userNotification.events','remove','update','emit','register'];(function(_0x2d83c3,_0x564ad7){var _0x6832f3=function(_0x56c02d){while(--_0x56c02d){_0x2d83c3['push'](_0x2d83c3['shift']());}};_0x6832f3(++_0x564ad7);}(_0x4c46,0x1bd));var _0x64c4=function(_0x3f76fb,_0x501417){_0x3f76fb=_0x3f76fb-0x0;var _0x251e47=_0x4c46[_0x3f76fb];return _0x251e47;};'use strict';var UserNotificationEvents=require(_0x64c4('0x0'));var events=['save',_0x64c4('0x1'),_0x64c4('0x2')];function createListener(_0x31617f,_0x3b6e42){return function(_0x3d668f){_0x3b6e42[_0x64c4('0x3')](_0x31617f,_0x3d668f);};}function removeListener(_0x38318b,_0x29b843){return function(){UserNotificationEvents['removeListener'](_0x38318b,_0x29b843);};}exports[_0x64c4('0x4')]=function(_0x4fafdf){for(var _0x26a9f2=0x0,_0x3348d0=events['length'];_0x26a9f2<_0x3348d0;_0x26a9f2++){var _0x42c03c=events[_0x26a9f2];var _0x31ce07=createListener(_0x64c4('0x5')+_0x42c03c,_0x4fafdf);UserNotificationEvents['on'](_0x42c03c,_0x31ce07);}};
\ No newline at end of file
+var _0x6bff=['update','removeListener','length','userNotification:','./userNotification.events','save','remove'];(function(_0xd685e,_0x360045){var _0x5ef5e0=function(_0x37f4b3){while(--_0x37f4b3){_0xd685e['push'](_0xd685e['shift']());}};_0x5ef5e0(++_0x360045);}(_0x6bff,0x138));var _0xf6bf=function(_0x5c396e,_0x31b704){_0x5c396e=_0x5c396e-0x0;var _0x442edc=_0x6bff[_0x5c396e];return _0x442edc;};'use strict';var UserNotificationEvents=require(_0xf6bf('0x0'));var events=[_0xf6bf('0x1'),_0xf6bf('0x2'),_0xf6bf('0x3')];function createListener(_0x596bea,_0x231f0c){return function(_0x22eccc){_0x231f0c['emit'](_0x596bea,_0x22eccc);};}function removeListener(_0x22ba8f,_0x5aca60){return function(){UserNotificationEvents[_0xf6bf('0x4')](_0x22ba8f,_0x5aca60);};}exports['register']=function(_0x423a57){for(var _0x47108e=0x0,_0x187220=events[_0xf6bf('0x5')];_0x47108e<_0x187220;_0x47108e++){var _0x3047a8=events[_0x47108e];var _0x496e60=createListener(_0xf6bf('0x6')+_0x3047a8,_0x423a57);UserNotificationEvents['on'](_0x3047a8,_0x496e60);}};
\ No newline at end of file
index fdb5b2f..78c6844 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x4a5325,_0x5754bb){var _0x2d1a2f=function(_0x3cc419){while(--_0x3cc419){_0x4a5325['push'](_0x4a5325['shift']());}};_0x2d1a2f(++_0x5754bb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
+var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x515801,_0x42f55c){var _0x193e64=function(_0x591521){while(--_0x591521){_0x515801['push'](_0x515801['shift']());}};_0x193e64(++_0x42f55c);}(_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'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
index a7f1bd4..f2b0561 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9123=['INTEGER','exports'];(function(_0x1b40e3,_0x57c737){var _0x1f55d9=function(_0x37e35c){while(--_0x37e35c){_0x1b40e3['push'](_0x1b40e3['shift']());}};_0x1f55d9(++_0x57c737);}(_0x9123,0x119));var _0x3912=function(_0x75bb1f,_0x3dacb4){_0x75bb1f=_0x75bb1f-0x0;var _0x454a66=_0x9123[_0x75bb1f];return _0x454a66;};'use strict';var Sequelize=require('sequelize');module[_0x3912('0x0')]={'penalty':{'type':Sequelize[_0x3912('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xbc0a=['INTEGER','sequelize','exports'];(function(_0x37dad5,_0x11c11e){var _0x369c41=function(_0x194a91){while(--_0x194a91){_0x37dad5['push'](_0x37dad5['shift']());}};_0x369c41(++_0x11c11e);}(_0xbc0a,0x1de));var _0xabc0=function(_0x54c5ed,_0x27ca67){_0x54c5ed=_0x54c5ed-0x0;var _0x4cb286=_0xbc0a[_0x54c5ed];return _0x4cb286;};'use strict';var Sequelize=require(_0xabc0('0x0'));module[_0xabc0('0x1')]={'penalty':{'type':Sequelize[_0xabc0('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index ea13aa7..a7b16fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc35a=['define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x1f054,_0x3e3937){var _0xa6ed74=function(_0x4552f2){while(--_0x4552f2){_0x1f054['push'](_0x1f054['shift']());}};_0xa6ed74(++_0x3e3937);}(_0xc35a,0xb9));var _0xac35=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xc35a[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xac35('0x0'));var util=require(_0xac35('0x1'));var logger=require(_0xac35('0x2'))(_0xac35('0x3'));var moment=require(_0xac35('0x4'));var BPromise=require(_0xac35('0x5'));var rp=require(_0xac35('0x6'));var fs=require('fs');var path=require(_0xac35('0x7'));var rimraf=require(_0xac35('0x8'));var config=require(_0xac35('0x9'));var attributes=require('./userOpenchannelQueue.attributes');module[_0xac35('0xa')]=function(_0x4b0142,_0x254f34){return _0x4b0142[_0xac35('0xb')](_0xac35('0xc'),attributes,{'tableName':_0xac35('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbf8e=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util'];(function(_0x362416,_0x199518){var _0x8b085b=function(_0x41b5de){while(--_0x41b5de){_0x362416['push'](_0x362416['shift']());}};_0x8b085b(++_0x199518);}(_0xbf8e,0x14e));var _0xebf8=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xbf8e[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xebf8('0x0'));var util=require(_0xebf8('0x1'));var logger=require(_0xebf8('0x2'))(_0xebf8('0x3'));var moment=require(_0xebf8('0x4'));var BPromise=require(_0xebf8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xebf8('0x6'));var rimraf=require(_0xebf8('0x7'));var config=require(_0xebf8('0x8'));var attributes=require(_0xebf8('0x9'));module['exports']=function(_0x1f13d9,_0x1b4fb5){return _0x1f13d9['define'](_0xebf8('0xa'),attributes,{'tableName':_0xebf8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e75cbec..91e91d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x60e3=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment'];(function(_0x48b243,_0x44a7b9){var _0x2964ba=function(_0x49a6f3){while(--_0x49a6f3){_0x48b243['push'](_0x48b243['shift']());}};_0x2964ba(++_0x44a7b9);}(_0x60e3,0x9e));var _0x360e=function(_0xdc8f21,_0x319673){_0xdc8f21=_0xdc8f21-0x0;var _0x49b241=_0x60e3[_0xdc8f21];return _0x49b241;};'use strict';var _=require(_0x360e('0x0'));var util=require(_0x360e('0x1'));var moment=require(_0x360e('0x2'));var BPromise=require('bluebird');var rs=require(_0x360e('0x3'));var fs=require('fs');var Redis=require(_0x360e('0x4'));var db=require(_0x360e('0x5'))['db'];var utils=require(_0x360e('0x6'));var logger=require(_0x360e('0x7'))(_0x360e('0x8'));var config=require(_0x360e('0x9'));var jayson=require(_0x360e('0xa'));var client=jayson['client'][_0x360e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x114729,_0x2e60b6,_0x33decd){return new BPromise(function(_0x273ef8,_0xb8d74e){return client[_0x360e('0xc')](_0x114729,_0x33decd)['then'](function(_0xbbe290){logger[_0x360e('0xd')](_0x360e('0xe'),_0x2e60b6,_0x360e('0xf'));logger[_0x360e('0x10')](_0x360e('0x11'),_0x2e60b6,_0x360e('0xf'),JSON['stringify'](_0xbbe290));if(_0xbbe290[_0x360e('0x12')]){if(_0xbbe290[_0x360e('0x12')][_0x360e('0x13')]===0x1f4){logger['error'](_0x360e('0xe'),_0x2e60b6,_0xbbe290['error']['message']);return _0xb8d74e(_0xbbe290[_0x360e('0x12')][_0x360e('0x14')]);}logger['error'](_0x360e('0xe'),_0x2e60b6,_0xbbe290['error'][_0x360e('0x14')]);return _0x273ef8(_0xbbe290[_0x360e('0x12')][_0x360e('0x14')]);}else{logger[_0x360e('0xd')](_0x360e('0xe'),_0x2e60b6,_0x360e('0xf'));_0x273ef8(_0xbbe290[_0x360e('0x15')][_0x360e('0x14')]);}})[_0x360e('0x16')](function(_0xeb5b84){logger[_0x360e('0x12')](_0x360e('0xe'),_0x2e60b6,_0xeb5b84);_0xb8d74e(_0xeb5b84);});});}
\ No newline at end of file
+var _0x4e3c=['request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','UserOpenchannelQueue,\x20%s,\x20%s','info','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then'];(function(_0x16ceb7,_0x797b7c){var _0x963c54=function(_0x42a03f){while(--_0x42a03f){_0x16ceb7['push'](_0x16ceb7['shift']());}};_0x963c54(++_0x797b7c);}(_0x4e3c,0xe5));var _0xc4e3=function(_0x5e7d0c,_0x56ba7b){_0x5e7d0c=_0x5e7d0c-0x0;var _0xc24371=_0x4e3c[_0x5e7d0c];return _0xc24371;};'use strict';var _=require(_0xc4e3('0x0'));var util=require('util');var moment=require(_0xc4e3('0x1'));var BPromise=require('bluebird');var rs=require(_0xc4e3('0x2'));var fs=require('fs');var Redis=require(_0xc4e3('0x3'));var db=require(_0xc4e3('0x4'))['db'];var utils=require(_0xc4e3('0x5'));var logger=require('../../config/logger')(_0xc4e3('0x6'));var config=require(_0xc4e3('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc4e3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3b6252,_0x22ad00,_0x38cc7a){return new BPromise(function(_0xf1f006,_0x3587bf){return client[_0xc4e3('0x9')](_0x3b6252,_0x38cc7a)[_0xc4e3('0xa')](function(_0x38ef29){logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x22ad00,_0xc4e3('0xb'));logger[_0xc4e3('0xc')](_0xc4e3('0xd'),_0x22ad00,_0xc4e3('0xb'),JSON['stringify'](_0x38ef29));if(_0x38ef29['error']){if(_0x38ef29[_0xc4e3('0xe')][_0xc4e3('0xf')]===0x1f4){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x22ad00,_0x38ef29[_0xc4e3('0xe')][_0xc4e3('0x10')]);return _0x3587bf(_0x38ef29[_0xc4e3('0xe')]['message']);}logger['error'](_0xc4e3('0x11'),_0x22ad00,_0x38ef29[_0xc4e3('0xe')][_0xc4e3('0x10')]);return _0xf1f006(_0x38ef29[_0xc4e3('0xe')]['message']);}else{logger[_0xc4e3('0x12')](_0xc4e3('0x11'),_0x22ad00,_0xc4e3('0xb'));_0xf1f006(_0x38ef29[_0xc4e3('0x13')][_0xc4e3('0x10')]);}})['catch'](function(_0x3213ac){logger[_0xc4e3('0xe')](_0xc4e3('0x11'),_0x22ad00,_0x3213ac);_0x3587bf(_0x3213ac);});});}
\ No newline at end of file
index ca56047..9dad4b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6471=['getResources','post','/:id/clone','addSections','/:id/resources','addResources','put','update','delete','destroy','exports','multer','path','fs-extra','../../config/environment','isAuthenticated','get','/describe','describe','/:id','show','/:id/sections','getSections'];(function(_0x5e2862,_0x4760eb){var _0x8dcad4=function(_0x205ddf){while(--_0x205ddf){_0x5e2862['push'](_0x5e2862['shift']());}};_0x8dcad4(++_0x4760eb);}(_0x6471,0x1ee));var _0x1647=function(_0x3093ca,_0x448242){_0x3093ca=_0x3093ca-0x0;var _0x455de2=_0x6471[_0x3093ca];return _0x455de2;};'use strict';var multer=require(_0x1647('0x0'));var util=require('util');var path=require(_0x1647('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x1647('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1647('0x3'));var controller=require('./userProfile.controller');router['get']('/',auth[_0x1647('0x4')](),controller['index']);router[_0x1647('0x5')](_0x1647('0x6'),auth[_0x1647('0x4')](),controller[_0x1647('0x7')]);router[_0x1647('0x5')](_0x1647('0x8'),auth[_0x1647('0x4')](),controller[_0x1647('0x9')]);router['get'](_0x1647('0xa'),auth[_0x1647('0x4')](),controller[_0x1647('0xb')]);router[_0x1647('0x5')]('/:id/resources',auth['isAuthenticated'](),controller[_0x1647('0xc')]);router[_0x1647('0xd')]('/',auth[_0x1647('0x4')](),controller['create']);router[_0x1647('0xd')](_0x1647('0xe'),auth[_0x1647('0x4')](),controller['clone']);router[_0x1647('0xd')](_0x1647('0xa'),auth[_0x1647('0x4')](),controller[_0x1647('0xf')]);router[_0x1647('0xd')](_0x1647('0x10'),auth[_0x1647('0x4')](),controller[_0x1647('0x11')]);router[_0x1647('0x12')](_0x1647('0x8'),auth['isAuthenticated'](),controller[_0x1647('0x13')]);router[_0x1647('0x14')]('/:id',auth[_0x1647('0x4')](),controller[_0x1647('0x15')]);router[_0x1647('0x14')](_0x1647('0xa'),auth[_0x1647('0x4')](),controller['removeSections']);router['delete'](_0x1647('0x10'),auth[_0x1647('0x4')](),controller['removeResources']);module[_0x1647('0x16')]=router;
\ No newline at end of file
+var _0x78c2=['create','post','/:id/clone','clone','addSections','addResources','update','delete','removeSections','removeResources','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','index','/describe','isAuthenticated','describe','get','/:id','show','/:id/sections','getSections','/:id/resources','getResources'];(function(_0x373216,_0x5f3189){var _0x18f281=function(_0xa57429){while(--_0xa57429){_0x373216['push'](_0x373216['shift']());}};_0x18f281(++_0x5f3189);}(_0x78c2,0x19d));var _0x278c=function(_0x80b2e9,_0x1ea441){_0x80b2e9=_0x80b2e9-0x0;var _0xf5451b=_0x78c2[_0x80b2e9];return _0xf5451b;};'use strict';var multer=require(_0x278c('0x0'));var util=require(_0x278c('0x1'));var path=require(_0x278c('0x2'));var timeout=require(_0x278c('0x3'));var express=require(_0x278c('0x4'));var router=express[_0x278c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x278c('0x6'));var interaction=require(_0x278c('0x7'));var config=require(_0x278c('0x8'));var controller=require(_0x278c('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x278c('0xa')]);router['get'](_0x278c('0xb'),auth[_0x278c('0xc')](),controller[_0x278c('0xd')]);router[_0x278c('0xe')](_0x278c('0xf'),auth[_0x278c('0xc')](),controller[_0x278c('0x10')]);router[_0x278c('0xe')](_0x278c('0x11'),auth[_0x278c('0xc')](),controller[_0x278c('0x12')]);router[_0x278c('0xe')](_0x278c('0x13'),auth[_0x278c('0xc')](),controller[_0x278c('0x14')]);router['post']('/',auth[_0x278c('0xc')](),controller[_0x278c('0x15')]);router[_0x278c('0x16')](_0x278c('0x17'),auth[_0x278c('0xc')](),controller[_0x278c('0x18')]);router['post']('/:id/sections',auth['isAuthenticated'](),controller[_0x278c('0x19')]);router[_0x278c('0x16')](_0x278c('0x13'),auth['isAuthenticated'](),controller[_0x278c('0x1a')]);router['put'](_0x278c('0xf'),auth[_0x278c('0xc')](),controller[_0x278c('0x1b')]);router[_0x278c('0x1c')](_0x278c('0xf'),auth[_0x278c('0xc')](),controller['destroy']);router[_0x278c('0x1c')](_0x278c('0x11'),auth[_0x278c('0xc')](),controller[_0x278c('0x1d')]);router[_0x278c('0x1c')](_0x278c('0x13'),auth[_0x278c('0xc')](),controller[_0x278c('0x1e')]);module['exports']=router;
\ No newline at end of file
index ae12387..609f125 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b9d=['getDataValue','split','BOOLEAN','STRING','name','setDataValue','crudPermissions','join'];(function(_0x5e4b9e,_0x553378){var _0x54e4ea=function(_0x4794bd){while(--_0x4794bd){_0x5e4b9e['push'](_0x5e4b9e['shift']());}};_0x54e4ea(++_0x553378);}(_0x4b9d,0xb3));var _0xd4b9=function(_0x26d6d9,_0x431cb8){_0x26d6d9=_0x26d6d9-0x0;var _0x1b4875=_0x4b9d[_0x26d6d9];return _0x1b4875;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd4b9('0x0')],'allowNull':![],'unique':_0xd4b9('0x1')},'crudPermissions':{'type':Sequelize[_0xd4b9('0x0')],'set':function(_0xcda75f){this[_0xd4b9('0x2')](_0xd4b9('0x3'),_0xcda75f?_0xcda75f[_0xd4b9('0x4')](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this[_0xd4b9('0x5')]('crudPermissions')[_0xd4b9('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xd4b9('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xd4b9('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xd4b9('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xd4b9('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xd4b9('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x2449=['crudPermissions','getDataValue','split','BOOLEAN','sequelize','name','STRING','setDataValue'];(function(_0x3a340f,_0x18653e){var _0x14ca55=function(_0x2e2fd6){while(--_0x2e2fd6){_0x3a340f['push'](_0x3a340f['shift']());}};_0x14ca55(++_0x18653e);}(_0x2449,0x1d4));var _0x9244=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2449[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x9244('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9244('0x1')},'crudPermissions':{'type':Sequelize[_0x9244('0x2')],'set':function(_0x219f44){this[_0x9244('0x3')]('crudPermissions',_0x219f44?_0x219f44['join'](''):[]);},'get':function(){return this['getDataValue'](_0x9244('0x4'))?this[_0x9244('0x5')](_0x9244('0x4'))[_0x9244('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x9244('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x9244('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x9244('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x9244('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
index 08df92c..996351f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x215d=['nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','UserProfile','findAll','catch','find','create','body','params','include','get','omit','updatedAt','crudPermissions','sequelize','transaction','UserProfileSection','each','autoAssociation','createdAt','sectionId','userProfileId','UserProfileResource','Resources','describe','addSections','push','ids','getSections','isEmpty','includes','subsections','enabled','findOne','Dashboard','resourceId','Plugin','forEach','addResources','bulkCreate','removeResources','getResources','section','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./userProfile.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty'];(function(_0x1bb944,_0x2b3956){var _0x127bad=function(_0x3f9515){while(--_0x3f9515){_0x1bb944['push'](_0x1bb944['shift']());}};_0x127bad(++_0x2b3956);}(_0x215d,0x187));var _0xd215=function(_0x399cb6,_0xa171d5){_0x399cb6=_0x399cb6-0x0;var _0x6c3c25=_0x215d[_0x399cb6];return _0x6c3c25;};'use strict';var emlformat=require(_0xd215('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd215('0x1'));var jsonpatch=require(_0xd215('0x2'));var rp=require(_0xd215('0x3'));var moment=require(_0xd215('0x4'));var BPromise=require(_0xd215('0x5'));var Mustache=require(_0xd215('0x6'));var util=require('util');var path=require(_0xd215('0x7'));var sox=require('sox');var csv=require(_0xd215('0x8'));var ejs=require(_0xd215('0x9'));var fs=require('fs');var fs_extra=require(_0xd215('0xa'));var _=require('lodash');var squel=require(_0xd215('0xb'));var crypto=require('crypto');var jsforce=require(_0xd215('0xc'));var deskjs=require(_0xd215('0xd'));var toCsv=require(_0xd215('0x8'));var querystring=require('querystring');var Papa=require(_0xd215('0xe'));var Redis=require(_0xd215('0xf'));var authService=require(_0xd215('0x10'));var qs=require(_0xd215('0x11'));var as=require(_0xd215('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd215('0x13'))(_0xd215('0x14'));var utils=require(_0xd215('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd215('0x16'));var db=require(_0xd215('0x17'))['db'];config[_0xd215('0x18')]=_[_0xd215('0x19')](config[_0xd215('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xd215('0x1a'))(new Redis(config[_0xd215('0x18')]));require(_0xd215('0x1b'))[_0xd215('0x1c')](socket);function respondWithStatusCode(_0x1c0e74,_0x17c056){_0x17c056=_0x17c056||0xcc;return function(_0x6e50d0){if(_0x6e50d0){return _0x1c0e74[_0xd215('0x1d')](_0x17c056);}return _0x1c0e74['status'](_0x17c056)[_0xd215('0x1e')]();};}function respondWithResult(_0x302696,_0x49313b){_0x49313b=_0x49313b||0xc8;return function(_0x311044){if(_0x311044){return _0x302696[_0xd215('0x1f')](_0x49313b)[_0xd215('0x20')](_0x311044);}};}function respondWithFilteredResult(_0x2fb885,_0xbb679a){return function(_0x8d43f2){if(_0x8d43f2){var _0x55f934=typeof _0xbb679a[_0xd215('0x21')]===_0xd215('0x22')&&typeof _0xbb679a[_0xd215('0x23')]===_0xd215('0x22');var _0xbccdaa=_0x8d43f2[_0xd215('0x24')];var _0x1de474=_0x55f934?0x0:_0xbb679a['offset'];var _0xe7cbc8=_0x55f934?_0x8d43f2[_0xd215('0x24')]:_0xbb679a[_0xd215('0x21')]+_0xbb679a['limit'];var _0xccab6;if(_0xe7cbc8>=_0xbccdaa){_0xe7cbc8=_0xbccdaa;_0xccab6=0xc8;}else{_0xccab6=0xce;}_0x2fb885[_0xd215('0x1f')](_0xccab6);return _0x2fb885[_0xd215('0x25')](_0xd215('0x26'),_0x1de474+'-'+_0xe7cbc8+'/'+_0xbccdaa)['json'](_0x8d43f2);}return null;};}function patchUpdates(_0x23b1fb){return function(_0x229cd2){try{jsonpatch[_0xd215('0x27')](_0x229cd2,_0x23b1fb,!![]);}catch(_0x31466e){return BPromise['reject'](_0x31466e);}return _0x229cd2['save']();};}function saveUpdates(_0x5e0b42,_0x640b73){return function(_0x142b3f){if(_0x142b3f){return _0x142b3f[_0xd215('0x28')](_0x5e0b42)[_0xd215('0x29')](function(_0x527fca){return _0x527fca;});}return null;};}function removeEntity(_0x3e51e0,_0x4ddbdf){return function(_0x560ddb){if(_0x560ddb){return _0x560ddb[_0xd215('0x2a')]()[_0xd215('0x29')](function(){_0x3e51e0[_0xd215('0x1f')](0xcc)[_0xd215('0x1e')]();});}};}function handleEntityNotFound(_0x638b93,_0x473f7d){return function(_0x4d806c){if(!_0x4d806c){_0x638b93[_0xd215('0x1d')](0x194);}return _0x4d806c;};}function handleError(_0x23828b,_0xeed23){_0xeed23=_0xeed23||0x1f4;return function(_0x3ca288){logger[_0xd215('0x2b')](_0x3ca288[_0xd215('0x2c')]);if(_0x3ca288[_0xd215('0x2d')]){delete _0x3ca288[_0xd215('0x2d')];}_0x23828b[_0xd215('0x1f')](_0xeed23)[_0xd215('0x2e')](_0x3ca288);};}exports[_0xd215('0x2f')]=function(_0x44f799,_0x2a9c61){var _0x5bc727={},_0x507e44={},_0x252efb={'count':0x0,'rows':[]};var _0x47a371=_[_0xd215('0x30')](db['UserProfile'][_0xd215('0x31')],function(_0x1e5c58){return{'name':_0x1e5c58[_0xd215('0x32')],'type':_0x1e5c58[_0xd215('0x33')]['key']};});_0x507e44['model']=_[_0xd215('0x30')](_0x47a371,'name');_0x507e44[_0xd215('0x34')]=_[_0xd215('0x35')](_0x44f799['query']);_0x507e44[_0xd215('0x36')]=_[_0xd215('0x37')](_0x507e44['model'],_0x507e44['query']);_0x5bc727['attributes']=_[_0xd215('0x37')](_0x507e44[_0xd215('0x38')],qs[_0xd215('0x39')](_0x44f799[_0xd215('0x34')][_0xd215('0x39')]));_0x5bc727[_0xd215('0x3a')]=_0x5bc727[_0xd215('0x3a')][_0xd215('0x3b')]?_0x5bc727[_0xd215('0x3a')]:_0x507e44[_0xd215('0x38')];if(!_0x44f799[_0xd215('0x34')][_0xd215('0x3c')](_0xd215('0x3d'))){_0x5bc727[_0xd215('0x23')]=qs[_0xd215('0x23')](_0x44f799[_0xd215('0x34')]['limit']);_0x5bc727['offset']=qs[_0xd215('0x21')](_0x44f799[_0xd215('0x34')][_0xd215('0x21')]);}_0x5bc727[_0xd215('0x3e')]=qs['sort'](_0x44f799[_0xd215('0x34')][_0xd215('0x3f')]);_0x5bc727[_0xd215('0x40')]=qs[_0xd215('0x36')](_[_0xd215('0x41')](_0x44f799[_0xd215('0x34')],_0x507e44['filters']),_0x47a371);if(_0x44f799[_0xd215('0x34')]['filter']){_0x5bc727[_0xd215('0x40')]=_[_0xd215('0x42')](_0x5bc727[_0xd215('0x40')],{'$or':_[_0xd215('0x30')](_0x47a371,function(_0x25b6da){if(_0x25b6da[_0xd215('0x33')]!==_0xd215('0x43')){var _0x21ec44={};_0x21ec44[_0x25b6da[_0xd215('0x2d')]]={'$like':'%'+_0x44f799['query'][_0xd215('0x44')]+'%'};return _0x21ec44;}})});}_0x5bc727=_[_0xd215('0x42')]({},_0x5bc727,_0x44f799[_0xd215('0x45')]);var _0x3807d8={'where':_0x5bc727[_0xd215('0x40')]};return db['UserProfile']['count'](_0x3807d8)[_0xd215('0x29')](function(_0x53684d){_0x252efb['count']=_0x53684d;if(_0x44f799[_0xd215('0x34')][_0xd215('0x46')]){_0x5bc727['include']=[{'all':!![]}];}return db[_0xd215('0x47')][_0xd215('0x48')](_0x5bc727);})['then'](function(_0x1b5c8c){_0x252efb['rows']=_0x1b5c8c;return _0x252efb;})[_0xd215('0x29')](respondWithFilteredResult(_0x2a9c61,_0x5bc727))[_0xd215('0x49')](handleError(_0x2a9c61,null));};exports['show']=function(_0x54154e,_0x5cbf3e){var _0x7bafff={'raw':![],'where':{'id':_0x54154e['params']['id']}},_0x4a31a0={};_0x4a31a0[_0xd215('0x38')]=_['keys'](db[_0xd215('0x47')][_0xd215('0x31')]);_0x4a31a0['query']=_['keys'](_0x54154e[_0xd215('0x34')]);_0x4a31a0[_0xd215('0x36')]=_[_0xd215('0x37')](_0x4a31a0[_0xd215('0x38')],_0x4a31a0['query']);_0x7bafff['attributes']=_[_0xd215('0x37')](_0x4a31a0['model'],qs[_0xd215('0x39')](_0x54154e[_0xd215('0x34')][_0xd215('0x39')]));_0x7bafff[_0xd215('0x3a')]=_0x7bafff[_0xd215('0x3a')][_0xd215('0x3b')]?_0x7bafff[_0xd215('0x3a')]:_0x4a31a0[_0xd215('0x38')];if(_0x54154e['query'][_0xd215('0x46')]){_0x7bafff['include']=[{'all':!![]}];}_0x7bafff=_['merge']({},_0x7bafff,_0x54154e[_0xd215('0x45')]);return db[_0xd215('0x47')][_0xd215('0x4a')](_0x7bafff)[_0xd215('0x29')](handleEntityNotFound(_0x5cbf3e,null))[_0xd215('0x29')](respondWithResult(_0x5cbf3e,null))[_0xd215('0x49')](handleError(_0x5cbf3e,null));};exports['create']=function(_0x8b3ed8,_0x5887cb){return db['UserProfile'][_0xd215('0x4b')](_0x8b3ed8[_0xd215('0x4c')],{})[_0xd215('0x29')](respondWithResult(_0x5887cb,0xc9))[_0xd215('0x49')](handleError(_0x5887cb,null));};exports['clone']=function(_0x1c084e,_0x58fd12){var _0x54e918={'where':{'id':_0x1c084e[_0xd215('0x4d')]['id']}},_0x525005={};_0x525005[_0xd215('0x38')]=_['keys'](db['UserProfile']['rawAttributes']);_0x54e918['attributes']=_[_0xd215('0x37')](_0x525005[_0xd215('0x38')],qs[_0xd215('0x39')](_0x1c084e['query']['fields']));_0x54e918[_0xd215('0x3a')]=_0x54e918[_0xd215('0x3a')]['length']?_0x54e918[_0xd215('0x3a')]:_0x525005[_0xd215('0x38')];if(_0x1c084e['query'][_0xd215('0x46')]){_0x54e918[_0xd215('0x4e')]=[{'all':!![]}];}_0x54e918=_[_0xd215('0x42')]({},_0x54e918,_0x1c084e[_0xd215('0x45')]);return db[_0xd215('0x47')][_0xd215('0x4a')](_0x54e918)['then'](handleEntityNotFound(_0x58fd12,null))[_0xd215('0x29')](function(_0x4615ed){if(_0x4615ed){var _0x45fa89=_0x4615ed[_0xd215('0x4f')]({'plain':!![]});_0x45fa89=qs[_0xd215('0x50')](_0x45fa89,['id','createdAt',_0xd215('0x51'),_0xd215('0x52')]);_0x1c084e[_0xd215('0x4c')]=_[_0xd215('0x50')](_0x1c084e[_0xd215('0x4c')],['id','createdAt',_0xd215('0x51')]);return db[_0xd215('0x53')][_0xd215('0x54')](function(_0x5925a9){return db['UserProfile'][_0xd215('0x4b')](_['merge'](_0x45fa89,_0x1c084e['body']),{'include':_0x1c084e[_0xd215('0x34')][_0xd215('0x46')]?[{'all':!![]}]:undefined,'transaction':_0x5925a9})['then'](function(_0x13530a){var _0x20d390=_0x13530a['get']({'plain':!![]});return db[_0xd215('0x55')][_0xd215('0x48')]({'where':{'userProfileId':_0x1c084e[_0xd215('0x4d')]['id']},'raw':!![]})['then'](function(_0x39ed01){if(_0x39ed01){return BPromise[_0xd215('0x56')](_0x39ed01,function(_0x181645){return new BPromise(function(_0xbd4445,_0x40f053){if(_0x181645['autoAssociation']===null||_0x181645[_0xd215('0x57')]===0x1)_0xbd4445(null);return db['UserProfileResource'][_0xd215('0x48')]({'where':{'sectionId':_0x181645['id']},'raw':!![]})[_0xd215('0x29')](function(_0x25acc2){var _0x51cde5=_['map'](_0x25acc2,function(_0x2ef975){return qs[_0xd215('0x50')](_0x2ef975,['id',_0xd215('0x58'),_0xd215('0x51'),_0xd215('0x59')]);});_0xbd4445(_0x51cde5);})[_0xd215('0x49')](function(_0xf33ad7){_0x40f053(_0xf33ad7);});})['then'](function(_0x6b34e3){var _0x22e092=qs['omit'](_0x181645,['id','createdAt',_0xd215('0x51')]);_0x22e092[_0xd215('0x5a')]=_0x20d390['id'];if(_0x6b34e3)_0x22e092['Resources']=_0x6b34e3;return _0x22e092;})['then'](function(_0x5e7a53){return db[_0xd215('0x55')][_0xd215('0x4b')](_0x5e7a53,{'include':[{'model':db[_0xd215('0x5b')],'as':_0xd215('0x5c')}],'raw':!![],'transaction':_0x5925a9});});})[_0xd215('0x29')](function(){return _0x20d390;});}});});});}})['then'](respondWithResult(_0x58fd12,0xc9))[_0xd215('0x49')](handleError(_0x58fd12,null));};exports[_0xd215('0x28')]=function(_0x3b45c5,_0x3daa33){if(_0x3b45c5[_0xd215('0x4c')]['id']){delete _0x3b45c5[_0xd215('0x4c')]['id'];}return db['UserProfile'][_0xd215('0x4a')]({'where':{'id':_0x3b45c5['params']['id']}})['then'](handleEntityNotFound(_0x3daa33,null))[_0xd215('0x29')](saveUpdates(_0x3b45c5[_0xd215('0x4c')],null))[_0xd215('0x29')](respondWithResult(_0x3daa33,null))[_0xd215('0x49')](handleError(_0x3daa33,null));};exports['destroy']=function(_0x219cd8,_0x49ffc5){return db['UserProfile']['find']({'where':{'id':_0x219cd8[_0xd215('0x4d')]['id']}})[_0xd215('0x29')](handleEntityNotFound(_0x49ffc5,null))['then'](removeEntity(_0x49ffc5,null))[_0xd215('0x49')](handleError(_0x49ffc5,null));};exports[_0xd215('0x5d')]=function(_0x5f1815,_0x1a3e25){return db[_0xd215('0x47')][_0xd215('0x5d')]()[_0xd215('0x29')](respondWithResult(_0x1a3e25,null))['catch'](handleError(_0x1a3e25,null));};exports[_0xd215('0x5e')]=function(_0x3624f0,_0x5aebe7){var _0x138c09=_0x3624f0[_0xd215('0x4c')];return db['UserProfile']['find']({'where':{'id':_0x3624f0[_0xd215('0x4d')]['id']}})[_0xd215('0x29')](handleEntityNotFound(_0x5aebe7,null))['then'](function(_0x4e52d0){if(_0x4e52d0){return db['sequelize'][_0xd215('0x54')](function(_0x3a03e5){return db[_0xd215('0x55')][_0xd215('0x2a')]({'where':{'userProfileId':_0x3624f0['params']['id'],'sectionId':_[_0xd215('0x30')](_0x138c09,function(_0x44b615){return _0x44b615[_0xd215('0x59')];})},'transaction':_0x3a03e5})['then'](function(){var _0x5230ee=_['map'](_0x138c09,function(_0x5b0dfd){_0x5b0dfd['userProfileId']=_0x3624f0[_0xd215('0x4d')]['id'];return _0x5b0dfd;});var _0x1114f4=[];return BPromise['each'](_0x5230ee,function(_0x535d63){return db['UserProfileSection']['create'](_0x535d63,{'include':[{'model':db[_0xd215('0x5b')],'as':_0xd215('0x5c')}],'raw':!![],'transaction':_0x3a03e5})[_0xd215('0x29')](function(_0x30433e){_0x1114f4[_0xd215('0x5f')](_0x30433e[_0xd215('0x4f')]({'plain':!![]}));});})[_0xd215('0x29')](function(){return _0x1114f4;});});});}})[_0xd215('0x29')](function(_0x213806){return _0x213806;})[_0xd215('0x29')](respondWithResult(_0x5aebe7,null))[_0xd215('0x49')](handleError(_0x5aebe7,null));};exports['removeSections']=function(_0x57e357,_0x189cc4){var _0x18ad02;return db[_0xd215('0x47')][_0xd215('0x4a')]({'where':{'id':_0x57e357[_0xd215('0x4d')]['id']},'attributes':['id',_0xd215('0x2d')]})[_0xd215('0x29')](handleEntityNotFound(_0x189cc4,null))[_0xd215('0x29')](function(_0x5515e1){if(_0x5515e1){_0x18ad02=_0x5515e1;return db['UserProfileSection'][_0xd215('0x2a')]({'where':{'userProfileId':_0x57e357[_0xd215('0x4d')]['id'],'sectionId':_0x57e357[_0xd215('0x34')][_0xd215('0x60')]}});}})[_0xd215('0x29')](function(){return _0x18ad02;})['then'](respondWithStatusCode(_0x189cc4,null))['catch'](handleError(_0x189cc4,null));};exports[_0xd215('0x61')]=function(_0x3a3e19,_0x2d154d){var _0x53702b=[];var _0x5015d7=[];return db[_0xd215('0x55')]['findAll']({'where':{'userProfileId':_0x3a3e19['params']['id']},'raw':!![]})[_0xd215('0x29')](function(_0x442a18){_0x53702b=_['filter'](_0x442a18,function(_0x35d28a){return _0x35d28a['enabled']===0x1||_['includes']([0x3eb,0x709],_0x35d28a[_0xd215('0x59')]);});if(!_[_0xd215('0x62')](_0x53702b)){return _[_0xd215('0x30')](_0x53702b,function(_0x2538df){return _0x2538df[_0xd215('0x59')];});}else{return;}})[_0xd215('0x29')](function(_0x427ca9){if(_0x427ca9)_0x5015d7=_0x427ca9;if(_[_0xd215('0x63')](_0x5015d7,0x64)){var _0x219a50=_['find'](_0x53702b,{'sectionId':0x64});return hasDefaultDashboard(_0x219a50)[_0xd215('0x29')](function(_0x2c1a76){return _[_0xd215('0x30')](_0x53702b,function(_0x3dd58d){if(_0x3dd58d['sectionId']===0x64){_0x3dd58d[_0xd215('0x64')]=_0x2c1a76;}return _0x3dd58d;});});}else{return;}})[_0xd215('0x29')](function(_0x27cbf7){if(_0x27cbf7)_0x53702b=_0x27cbf7;if(_[_0xd215('0x63')](_0x5015d7,0x3eb)){var _0x27542b=_[_0xd215('0x4a')](_0x53702b,{'sectionId':0x3eb});return getCustomDashboards(_0x27542b)[_0xd215('0x29')](function(_0x2a9af8){return _['map'](_0x53702b,function(_0xada825){if(_0x27542b['enabled']){if(_0xada825[_0xd215('0x59')]===0x3eb){_0xada825[_0xd215('0x64')]=_0x2a9af8;}}else{if(_0xada825['sectionId']===0x64){_0xada825[_0xd215('0x64')]=_0x2a9af8;}}return _0xada825;});});}else{return;}})['then'](function(_0x23bd88){if(_0x23bd88)_0x53702b=_0x23bd88;if(_[_0xd215('0x63')](_0x5015d7,0x709)){var _0x5bd26d=_['find'](_0x53702b,{'sectionId':0x709});return getPlugins(_0x5bd26d)[_0xd215('0x29')](function(_0x252d8f){if(_0x5bd26d[_0xd215('0x65')]){return _[_0xd215('0x30')](_0x53702b,function(_0x4727fd){if(_0x4727fd[_0xd215('0x59')]===0x709){_0x4727fd[_0xd215('0x64')]=_0x252d8f;}return _0x4727fd;});}else{var _0x9a1b6={'sectionId':0x76c,'enabled':0x1,'subsections':_0x252d8f};var _0x601b46=_[_0xd215('0x30')](_0x53702b);_0x601b46[_0xd215('0x5f')](_0x9a1b6);return _0x601b46;}});}else{return;}})[_0xd215('0x29')](function(_0x319a79){if(_0x319a79)_0x53702b=_0x319a79;return _[_0xd215('0x44')](_0x53702b,['enabled',0x1]);})[_0xd215('0x29')](respondWithResult(_0x2d154d,null))['catch'](handleError(_0x2d154d,null));};function hasDefaultDashboard(_0x4d935c){var _0x5dfe5d=[0x65];return new BPromise(function(_0x43e6ae,_0x8d2ea4){try{if(_0x4d935c[_0xd215('0x57')]){_0x43e6ae(_0x5dfe5d);}else{return db[_0xd215('0x5b')][_0xd215('0x66')]({'where':{'sectionId':_0x4d935c['id']},'raw':!![]})[_0xd215('0x29')](function(_0x15d75d){_0x15d75d?_0x43e6ae(_0x5dfe5d):_0x43e6ae();});}}catch(_0xf2b432){_0x8d2ea4(_0xf2b432);}});}function getCustomDashboards(_0x226db5){var _0x3ea304=[];return new BPromise(function(_0x542e64,_0x1a7f12){try{if(_0x226db5[_0xd215('0x57')]){return db[_0xd215('0x67')][_0xd215('0x48')]({'raw':!![]})[_0xd215('0x29')](function(_0x55daf1){_0x55daf1['forEach'](function(_0x23f697){_0x3ea304[_0xd215('0x5f')](_0x23f697['id']+0x1869f);});_0x542e64(_0x3ea304);});}else{return db[_0xd215('0x5b')]['findAll']({'where':{'sectionId':_0x226db5['id']},'raw':!![]})['then'](function(_0x27f51f){_0x27f51f['forEach'](function(_0x122c7e){_0x3ea304[_0xd215('0x5f')](_0x122c7e[_0xd215('0x68')]+0x1869f);});_0x542e64(_0x3ea304);});}}catch(_0x1ff738){_0x1a7f12(_0x1ff738);}});}function getPlugins(_0x3ee5b1){var _0x2d54dc=[];return new BPromise(function(_0xc9a79b,_0x10d766){try{if(_0x3ee5b1[_0xd215('0x57')]){return db[_0xd215('0x69')]['findAll']({'raw':!![]})[_0xd215('0x29')](function(_0x90743b){_0x90743b[_0xd215('0x6a')](function(_0x2f613c){_0x2d54dc['push'](_0x2f613c['id']+0x15b38);});_0xc9a79b(_0x2d54dc);});}else{return db[_0xd215('0x5b')]['findAll']({'where':{'sectionId':_0x3ee5b1['id']},'raw':!![]})[_0xd215('0x29')](function(_0x1d1dec){_0x1d1dec['forEach'](function(_0x5e8ac8){_0x2d54dc['push'](_0x5e8ac8[_0xd215('0x68')]+0x15b38);});_0xc9a79b(_0x2d54dc);});}}catch(_0x4d3ff6){_0x10d766(_0x4d3ff6);}});}exports[_0xd215('0x6b')]=function(_0x17b90d,_0x5c5613){return db[_0xd215('0x47')][_0xd215('0x4a')]({'where':{'id':_0x17b90d[_0xd215('0x4d')]['id']}})[_0xd215('0x29')](handleEntityNotFound(_0x5c5613,null))[_0xd215('0x29')](function(_0x497e5a){if(_0x497e5a){return db[_0xd215('0x53')]['transaction'](function(_0x142093){return db['UserProfileSection'][_0xd215('0x48')]({'where':{'userProfileId':_0x17b90d[_0xd215('0x4d')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x48b7e5){if(_0x48b7e5){return db[_0xd215('0x55')]['destroy']({'where':{'userProfileId':_0x17b90d[_0xd215('0x4d')]['id'],'id':_[_0xd215('0x30')](_0x48b7e5,function(_0x2089e3){return _0x2089e3['id'];})},'transaction':_0x142093});}})['then'](function(_0x455c2d){var _0x5eab83=_[_0xd215('0x30')](_0x17b90d[_0xd215('0x4c')],function(_0x36b43c){_0x36b43c[_0xd215('0x5a')]=_0x17b90d[_0xd215('0x4d')]['id'];return _0x36b43c;});return db['UserProfileSection'][_0xd215('0x6c')](_0x5eab83,{'raw':!![],'transaction':_0x142093});})['then'](function(_0x3a8b56){var _0x3da8ce=_[_0xd215('0x44')](_['map'](_0x3a8b56,function(_0x526547){return _0x526547[_0xd215('0x4f')]({'plain':!![]});}),{'includeAll':![]});if(_0x3da8ce){return db[_0xd215('0x55')][_0xd215('0x48')]({'where':{'userProfileId':_0x17b90d[_0xd215('0x4d')]['id'],'sectionId':_[_0xd215('0x30')](_0x3da8ce,function(_0x444a91){return _0x444a91[_0xd215('0x59')];})},'attributes':['id',_0xd215('0x59')],'raw':!![]})[_0xd215('0x29')](function(_0x3c5eb1){var _0x3f85c2=_[_0xd215('0x30')](_0x17b90d[_0xd215('0x4c')],function(_0x55ef50){_0x55ef50[_0xd215('0x5a')]=_0x17b90d[_0xd215('0x4d')]['id'];return _0x55ef50;});return db[_0xd215('0x5b')][_0xd215('0x6c')](_0x3f85c2,{'raw':!![],'transaction':_0x142093});});}})['catch'](handleError(_0x5c5613,null));});}})[_0xd215('0x29')](function(_0x4459a4){var _0x289740=_['map'](_0x4459a4,function(_0x1faa26){return _0x1faa26['get']({'plain':!![]});});})[_0xd215('0x29')](respondWithResult(_0x5c5613,null))['catch'](handleError(_0x5c5613,null));};exports[_0xd215('0x6d')]=function(_0xd21f7c,_0x433eea,_0xd16af){return db[_0xd215('0x47')]['find']({'where':{'id':_0xd21f7c[_0xd215('0x4d')]['id']}})[_0xd215('0x29')](handleEntityNotFound(_0x433eea,null))['then'](function(_0x480ed3){if(_0x480ed3){return _0x480ed3[_0xd215('0x6d')](_0xd21f7c[_0xd215('0x34')][_0xd215('0x60')]);}})['then'](respondWithStatusCode(_0x433eea,null))['catch'](handleError(_0x433eea,null));};exports[_0xd215('0x6e')]=function(_0x13cf70,_0x3da230){var _0x3dec6e={};if(!_0x13cf70[_0xd215('0x34')][_0xd215('0x6f')])throw new Error('Missing\x20section\x20parameter');if(!_0x13cf70[_0xd215('0x34')][_0xd215('0x3c')](_0xd215('0x3d'))){_0x3dec6e[_0xd215('0x23')]=qs[_0xd215('0x23')](_0x13cf70[_0xd215('0x34')]['limit']);_0x3dec6e[_0xd215('0x21')]=qs[_0xd215('0x21')](_0x13cf70[_0xd215('0x34')][_0xd215('0x21')]);}return db[_0xd215('0x47')][_0xd215('0x4a')]({'where':{'id':_0x13cf70[_0xd215('0x4d')]['id']}})[_0xd215('0x29')](function(_0x205896){if(!_0x205896)throw new Error(_0xd215('0x70')+_0x13cf70[_0xd215('0x4d')]['id']);return db[_0xd215('0x47')][_0xd215('0x6e')](_0x13cf70);})[_0xd215('0x29')](respondWithFilteredResult(_0x3da230,_0x3dec6e))[_0xd215('0x49')](handleError(_0x3da230,null));};
\ No newline at end of file
+var _0x80c4=['rows','catch','params','keys','includeAll','create','clone','find','get','createdAt','crudPermissions','body','omit','updatedAt','sequelize','transaction','UserProfileSection','findAll','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','describe','addSections','push','removeSections','ids','getSections','enabled','includes','subsections','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./userProfile.socket','end','status','undefined','count','offset','limit','set','json','apply','reject','save','update','then','destroy','error','stack','name','index','map','UserProfile','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include'];(function(_0x10faf7,_0x45733e){var _0x8382f1=function(_0x2410bd){while(--_0x2410bd){_0x10faf7['push'](_0x10faf7['shift']());}};_0x8382f1(++_0x45733e);}(_0x80c4,0xa3));var _0x480c=function(_0x53d6b8,_0x2a89de){_0x53d6b8=_0x53d6b8-0x0;var _0xa2241d=_0x80c4[_0x53d6b8];return _0xa2241d;};'use strict';var emlformat=require(_0x480c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x480c('0x1'));var jsonpatch=require(_0x480c('0x2'));var rp=require(_0x480c('0x3'));var moment=require(_0x480c('0x4'));var BPromise=require(_0x480c('0x5'));var Mustache=require(_0x480c('0x6'));var util=require('util');var path=require(_0x480c('0x7'));var sox=require(_0x480c('0x8'));var csv=require(_0x480c('0x9'));var ejs=require(_0x480c('0xa'));var fs=require('fs');var fs_extra=require(_0x480c('0xb'));var _=require(_0x480c('0xc'));var squel=require(_0x480c('0xd'));var crypto=require(_0x480c('0xe'));var jsforce=require(_0x480c('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x480c('0x9'));var querystring=require(_0x480c('0x10'));var Papa=require(_0x480c('0x11'));var Redis=require(_0x480c('0x12'));var authService=require(_0x480c('0x13'));var qs=require(_0x480c('0x14'));var as=require(_0x480c('0x15'));var hardwareService=require(_0x480c('0x16'));var logger=require(_0x480c('0x17'))(_0x480c('0x18'));var utils=require(_0x480c('0x19'));var config=require(_0x480c('0x1a'));var licenseUtil=require(_0x480c('0x1b'));var db=require(_0x480c('0x1c'))['db'];config[_0x480c('0x1d')]=_[_0x480c('0x1e')](config[_0x480c('0x1d')],{'host':_0x480c('0x1f'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x480c('0x1d')]));require(_0x480c('0x20'))['register'](socket);function respondWithStatusCode(_0x3b48b6,_0xdd3db6){_0xdd3db6=_0xdd3db6||0xcc;return function(_0x1ff755){if(_0x1ff755){return _0x3b48b6['sendStatus'](_0xdd3db6);}return _0x3b48b6['status'](_0xdd3db6)[_0x480c('0x21')]();};}function respondWithResult(_0x164428,_0x41930a){_0x41930a=_0x41930a||0xc8;return function(_0x14248c){if(_0x14248c){return _0x164428[_0x480c('0x22')](_0x41930a)['json'](_0x14248c);}};}function respondWithFilteredResult(_0x5b5ea3,_0x4a450c){return function(_0xfc8a9f){if(_0xfc8a9f){var _0x4412aa=typeof _0x4a450c['offset']===_0x480c('0x23')&&typeof _0x4a450c['limit']===_0x480c('0x23');var _0x1507d1=_0xfc8a9f[_0x480c('0x24')];var _0x59ce9c=_0x4412aa?0x0:_0x4a450c[_0x480c('0x25')];var _0x1c1a1d=_0x4412aa?_0xfc8a9f[_0x480c('0x24')]:_0x4a450c['offset']+_0x4a450c[_0x480c('0x26')];var _0x50bb63;if(_0x1c1a1d>=_0x1507d1){_0x1c1a1d=_0x1507d1;_0x50bb63=0xc8;}else{_0x50bb63=0xce;}_0x5b5ea3[_0x480c('0x22')](_0x50bb63);return _0x5b5ea3[_0x480c('0x27')]('Content-Range',_0x59ce9c+'-'+_0x1c1a1d+'/'+_0x1507d1)[_0x480c('0x28')](_0xfc8a9f);}return null;};}function patchUpdates(_0x3cca31){return function(_0x14dc61){try{jsonpatch[_0x480c('0x29')](_0x14dc61,_0x3cca31,!![]);}catch(_0x5dbf8f){return BPromise[_0x480c('0x2a')](_0x5dbf8f);}return _0x14dc61[_0x480c('0x2b')]();};}function saveUpdates(_0x5288f5,_0xdc044f){return function(_0x34238b){if(_0x34238b){return _0x34238b[_0x480c('0x2c')](_0x5288f5)[_0x480c('0x2d')](function(_0x12445d){return _0x12445d;});}return null;};}function removeEntity(_0x7f067f,_0x4008ff){return function(_0x24857e){if(_0x24857e){return _0x24857e[_0x480c('0x2e')]()[_0x480c('0x2d')](function(){_0x7f067f[_0x480c('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54ca73,_0x372f96){return function(_0x4eafc7){if(!_0x4eafc7){_0x54ca73['sendStatus'](0x194);}return _0x4eafc7;};}function handleError(_0x4b1229,_0x4ad77d){_0x4ad77d=_0x4ad77d||0x1f4;return function(_0x4451fe){logger[_0x480c('0x2f')](_0x4451fe[_0x480c('0x30')]);if(_0x4451fe[_0x480c('0x31')]){delete _0x4451fe['name'];}_0x4b1229['status'](_0x4ad77d)['send'](_0x4451fe);};}exports[_0x480c('0x32')]=function(_0x3eabb3,_0x5c56e5){var _0xe03103={},_0x48c806={},_0x5acc0d={'count':0x0,'rows':[]};var _0x415f68=_[_0x480c('0x33')](db[_0x480c('0x34')][_0x480c('0x35')],function(_0x1dc9ae){return{'name':_0x1dc9ae[_0x480c('0x36')],'type':_0x1dc9ae[_0x480c('0x37')][_0x480c('0x38')]};});_0x48c806['model']=_['map'](_0x415f68,_0x480c('0x31'));_0x48c806[_0x480c('0x39')]=_['keys'](_0x3eabb3[_0x480c('0x39')]);_0x48c806[_0x480c('0x3a')]=_[_0x480c('0x3b')](_0x48c806[_0x480c('0x3c')],_0x48c806[_0x480c('0x39')]);_0xe03103[_0x480c('0x3d')]=_[_0x480c('0x3b')](_0x48c806[_0x480c('0x3c')],qs[_0x480c('0x3e')](_0x3eabb3[_0x480c('0x39')][_0x480c('0x3e')]));_0xe03103[_0x480c('0x3d')]=_0xe03103[_0x480c('0x3d')][_0x480c('0x3f')]?_0xe03103[_0x480c('0x3d')]:_0x48c806['model'];if(!_0x3eabb3[_0x480c('0x39')][_0x480c('0x40')](_0x480c('0x41'))){_0xe03103[_0x480c('0x26')]=qs['limit'](_0x3eabb3[_0x480c('0x39')][_0x480c('0x26')]);_0xe03103['offset']=qs[_0x480c('0x25')](_0x3eabb3['query'][_0x480c('0x25')]);}_0xe03103[_0x480c('0x42')]=qs[_0x480c('0x43')](_0x3eabb3['query'][_0x480c('0x43')]);_0xe03103[_0x480c('0x44')]=qs[_0x480c('0x3a')](_[_0x480c('0x45')](_0x3eabb3['query'],_0x48c806[_0x480c('0x3a')]),_0x415f68);if(_0x3eabb3[_0x480c('0x39')][_0x480c('0x46')]){_0xe03103[_0x480c('0x44')]=_[_0x480c('0x47')](_0xe03103['where'],{'$or':_['map'](_0x415f68,function(_0x408334){if(_0x408334[_0x480c('0x37')]!==_0x480c('0x48')){var _0x402940={};_0x402940[_0x408334['name']]={'$like':'%'+_0x3eabb3[_0x480c('0x39')][_0x480c('0x46')]+'%'};return _0x402940;}})});}_0xe03103=_[_0x480c('0x47')]({},_0xe03103,_0x3eabb3[_0x480c('0x49')]);var _0x221c04={'where':_0xe03103[_0x480c('0x44')]};return db[_0x480c('0x34')]['count'](_0x221c04)[_0x480c('0x2d')](function(_0x4ca83c){_0x5acc0d[_0x480c('0x24')]=_0x4ca83c;if(_0x3eabb3[_0x480c('0x39')]['includeAll']){_0xe03103[_0x480c('0x4a')]=[{'all':!![]}];}return db[_0x480c('0x34')]['findAll'](_0xe03103);})[_0x480c('0x2d')](function(_0x4d62fb){_0x5acc0d[_0x480c('0x4b')]=_0x4d62fb;return _0x5acc0d;})[_0x480c('0x2d')](respondWithFilteredResult(_0x5c56e5,_0xe03103))[_0x480c('0x4c')](handleError(_0x5c56e5,null));};exports['show']=function(_0x39d7d8,_0x7602d6){var _0x13ba41={'raw':![],'where':{'id':_0x39d7d8[_0x480c('0x4d')]['id']}},_0x3969b0={};_0x3969b0[_0x480c('0x3c')]=_[_0x480c('0x4e')](db[_0x480c('0x34')][_0x480c('0x35')]);_0x3969b0[_0x480c('0x39')]=_[_0x480c('0x4e')](_0x39d7d8['query']);_0x3969b0[_0x480c('0x3a')]=_['intersection'](_0x3969b0[_0x480c('0x3c')],_0x3969b0['query']);_0x13ba41[_0x480c('0x3d')]=_[_0x480c('0x3b')](_0x3969b0[_0x480c('0x3c')],qs[_0x480c('0x3e')](_0x39d7d8[_0x480c('0x39')]['fields']));_0x13ba41[_0x480c('0x3d')]=_0x13ba41['attributes'][_0x480c('0x3f')]?_0x13ba41[_0x480c('0x3d')]:_0x3969b0['model'];if(_0x39d7d8['query'][_0x480c('0x4f')]){_0x13ba41['include']=[{'all':!![]}];}_0x13ba41=_[_0x480c('0x47')]({},_0x13ba41,_0x39d7d8[_0x480c('0x49')]);return db[_0x480c('0x34')]['find'](_0x13ba41)['then'](handleEntityNotFound(_0x7602d6,null))['then'](respondWithResult(_0x7602d6,null))[_0x480c('0x4c')](handleError(_0x7602d6,null));};exports['create']=function(_0x3d7b08,_0x1ec5a2){return db[_0x480c('0x34')][_0x480c('0x50')](_0x3d7b08['body'],{})[_0x480c('0x2d')](respondWithResult(_0x1ec5a2,0xc9))[_0x480c('0x4c')](handleError(_0x1ec5a2,null));};exports[_0x480c('0x51')]=function(_0x39d839,_0xffb135){var _0x10a03d={'where':{'id':_0x39d839[_0x480c('0x4d')]['id']}},_0x34e874={};_0x34e874['model']=_[_0x480c('0x4e')](db[_0x480c('0x34')]['rawAttributes']);_0x10a03d['attributes']=_[_0x480c('0x3b')](_0x34e874['model'],qs['fields'](_0x39d839['query']['fields']));_0x10a03d[_0x480c('0x3d')]=_0x10a03d['attributes'][_0x480c('0x3f')]?_0x10a03d[_0x480c('0x3d')]:_0x34e874[_0x480c('0x3c')];if(_0x39d839[_0x480c('0x39')]['includeAll']){_0x10a03d['include']=[{'all':!![]}];}_0x10a03d=_['merge']({},_0x10a03d,_0x39d839['options']);return db[_0x480c('0x34')][_0x480c('0x52')](_0x10a03d)[_0x480c('0x2d')](handleEntityNotFound(_0xffb135,null))[_0x480c('0x2d')](function(_0x4cddc9){if(_0x4cddc9){var _0x4e888c=_0x4cddc9[_0x480c('0x53')]({'plain':!![]});_0x4e888c=qs['omit'](_0x4e888c,['id',_0x480c('0x54'),'updatedAt',_0x480c('0x55')]);_0x39d839[_0x480c('0x56')]=_[_0x480c('0x57')](_0x39d839[_0x480c('0x56')],['id','createdAt',_0x480c('0x58')]);return db[_0x480c('0x59')][_0x480c('0x5a')](function(_0x457acd){return db[_0x480c('0x34')][_0x480c('0x50')](_[_0x480c('0x47')](_0x4e888c,_0x39d839[_0x480c('0x56')]),{'include':_0x39d839[_0x480c('0x39')][_0x480c('0x4f')]?[{'all':!![]}]:undefined,'transaction':_0x457acd})['then'](function(_0x50486f){var _0x45cbcc=_0x50486f[_0x480c('0x53')]({'plain':!![]});return db[_0x480c('0x5b')][_0x480c('0x5c')]({'where':{'userProfileId':_0x39d839[_0x480c('0x4d')]['id']},'raw':!![]})['then'](function(_0x1ff8c1){if(_0x1ff8c1){return BPromise['each'](_0x1ff8c1,function(_0x5dcf94){return new BPromise(function(_0x513f0d,_0x32e96e){if(_0x5dcf94['autoAssociation']===null||_0x5dcf94[_0x480c('0x5d')]===0x1)_0x513f0d(null);return db[_0x480c('0x5e')][_0x480c('0x5c')]({'where':{'sectionId':_0x5dcf94['id']},'raw':!![]})[_0x480c('0x2d')](function(_0x4ad611){var _0x362e99=_['map'](_0x4ad611,function(_0x455558){return qs[_0x480c('0x57')](_0x455558,['id',_0x480c('0x54'),_0x480c('0x58'),_0x480c('0x5f')]);});_0x513f0d(_0x362e99);})['catch'](function(_0x5c7621){_0x32e96e(_0x5c7621);});})['then'](function(_0x10f68c){var _0x3639d3=qs['omit'](_0x5dcf94,['id',_0x480c('0x54'),_0x480c('0x58')]);_0x3639d3[_0x480c('0x60')]=_0x45cbcc['id'];if(_0x10f68c)_0x3639d3[_0x480c('0x61')]=_0x10f68c;return _0x3639d3;})[_0x480c('0x2d')](function(_0x24e909){return db['UserProfileSection'][_0x480c('0x50')](_0x24e909,{'include':[{'model':db[_0x480c('0x5e')],'as':'Resources'}],'raw':!![],'transaction':_0x457acd});});})[_0x480c('0x2d')](function(){return _0x45cbcc;});}});});});}})[_0x480c('0x2d')](respondWithResult(_0xffb135,0xc9))[_0x480c('0x4c')](handleError(_0xffb135,null));};exports[_0x480c('0x2c')]=function(_0x2b39e0,_0x4a5f5a){if(_0x2b39e0['body']['id']){delete _0x2b39e0[_0x480c('0x56')]['id'];}return db[_0x480c('0x34')][_0x480c('0x52')]({'where':{'id':_0x2b39e0[_0x480c('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4a5f5a,null))[_0x480c('0x2d')](saveUpdates(_0x2b39e0[_0x480c('0x56')],null))[_0x480c('0x2d')](respondWithResult(_0x4a5f5a,null))[_0x480c('0x4c')](handleError(_0x4a5f5a,null));};exports[_0x480c('0x2e')]=function(_0x489aa6,_0x30b131){return db[_0x480c('0x34')]['find']({'where':{'id':_0x489aa6[_0x480c('0x4d')]['id']}})[_0x480c('0x2d')](handleEntityNotFound(_0x30b131,null))['then'](removeEntity(_0x30b131,null))[_0x480c('0x4c')](handleError(_0x30b131,null));};exports[_0x480c('0x62')]=function(_0x27f917,_0x3974c3){return db[_0x480c('0x34')][_0x480c('0x62')]()[_0x480c('0x2d')](respondWithResult(_0x3974c3,null))[_0x480c('0x4c')](handleError(_0x3974c3,null));};exports[_0x480c('0x63')]=function(_0x28f1b1,_0xaba3dc){var _0x23902e=_0x28f1b1[_0x480c('0x56')];return db[_0x480c('0x34')][_0x480c('0x52')]({'where':{'id':_0x28f1b1[_0x480c('0x4d')]['id']}})['then'](handleEntityNotFound(_0xaba3dc,null))[_0x480c('0x2d')](function(_0x1d8b84){if(_0x1d8b84){return db[_0x480c('0x59')][_0x480c('0x5a')](function(_0x4cbb32){return db[_0x480c('0x5b')]['destroy']({'where':{'userProfileId':_0x28f1b1[_0x480c('0x4d')]['id'],'sectionId':_[_0x480c('0x33')](_0x23902e,function(_0x139a39){return _0x139a39[_0x480c('0x5f')];})},'transaction':_0x4cbb32})[_0x480c('0x2d')](function(){var _0x401bfd=_[_0x480c('0x33')](_0x23902e,function(_0x1847ca){_0x1847ca[_0x480c('0x60')]=_0x28f1b1['params']['id'];return _0x1847ca;});var _0x12b5ed=[];return BPromise['each'](_0x401bfd,function(_0xcacfd7){return db[_0x480c('0x5b')][_0x480c('0x50')](_0xcacfd7,{'include':[{'model':db[_0x480c('0x5e')],'as':_0x480c('0x61')}],'raw':!![],'transaction':_0x4cbb32})[_0x480c('0x2d')](function(_0x1bce7c){_0x12b5ed[_0x480c('0x64')](_0x1bce7c[_0x480c('0x53')]({'plain':!![]}));});})[_0x480c('0x2d')](function(){return _0x12b5ed;});});});}})[_0x480c('0x2d')](function(_0x22fd69){return _0x22fd69;})['then'](respondWithResult(_0xaba3dc,null))[_0x480c('0x4c')](handleError(_0xaba3dc,null));};exports[_0x480c('0x65')]=function(_0x1d8721,_0x464694){var _0x5103c1;return db['UserProfile'][_0x480c('0x52')]({'where':{'id':_0x1d8721[_0x480c('0x4d')]['id']},'attributes':['id','name']})[_0x480c('0x2d')](handleEntityNotFound(_0x464694,null))['then'](function(_0x306704){if(_0x306704){_0x5103c1=_0x306704;return db[_0x480c('0x5b')][_0x480c('0x2e')]({'where':{'userProfileId':_0x1d8721[_0x480c('0x4d')]['id'],'sectionId':_0x1d8721[_0x480c('0x39')][_0x480c('0x66')]}});}})[_0x480c('0x2d')](function(){return _0x5103c1;})[_0x480c('0x2d')](respondWithStatusCode(_0x464694,null))[_0x480c('0x4c')](handleError(_0x464694,null));};exports[_0x480c('0x67')]=function(_0x38c34d,_0x4c7975){var _0x4e5568=[];var _0x32cc00=[];return db['UserProfileSection'][_0x480c('0x5c')]({'where':{'userProfileId':_0x38c34d[_0x480c('0x4d')]['id']},'raw':!![]})['then'](function(_0x47c4f3){_0x4e5568=_[_0x480c('0x46')](_0x47c4f3,function(_0x1f11c4){return _0x1f11c4[_0x480c('0x68')]===0x1||_['includes']([0x3eb,0x709],_0x1f11c4[_0x480c('0x5f')]);});if(!_['isEmpty'](_0x4e5568)){return _[_0x480c('0x33')](_0x4e5568,function(_0x53ed32){return _0x53ed32['sectionId'];});}else{return;}})[_0x480c('0x2d')](function(_0x9be138){if(_0x9be138)_0x32cc00=_0x9be138;if(_[_0x480c('0x69')](_0x32cc00,0x64)){var _0x1050ae=_[_0x480c('0x52')](_0x4e5568,{'sectionId':0x64});return hasDefaultDashboard(_0x1050ae)[_0x480c('0x2d')](function(_0x338d62){return _[_0x480c('0x33')](_0x4e5568,function(_0x14b8f6){if(_0x14b8f6['sectionId']===0x64){_0x14b8f6[_0x480c('0x6a')]=_0x338d62;}return _0x14b8f6;});});}else{return;}})['then'](function(_0x73b133){if(_0x73b133)_0x4e5568=_0x73b133;if(_[_0x480c('0x69')](_0x32cc00,0x3eb)){var _0x920309=_[_0x480c('0x52')](_0x4e5568,{'sectionId':0x3eb});return getCustomDashboards(_0x920309)[_0x480c('0x2d')](function(_0x4c61c0){return _['map'](_0x4e5568,function(_0x4c4d3c){if(_0x920309[_0x480c('0x68')]){if(_0x4c4d3c['sectionId']===0x3eb){_0x4c4d3c[_0x480c('0x6a')]=_0x4c61c0;}}else{if(_0x4c4d3c[_0x480c('0x5f')]===0x64){_0x4c4d3c['subsections']=_0x4c61c0;}}return _0x4c4d3c;});});}else{return;}})[_0x480c('0x2d')](function(_0x505bb0){if(_0x505bb0)_0x4e5568=_0x505bb0;if(_['includes'](_0x32cc00,0x709)){var _0x25bf0d=_['find'](_0x4e5568,{'sectionId':0x709});return getPlugins(_0x25bf0d)[_0x480c('0x2d')](function(_0x394e76){if(_0x25bf0d[_0x480c('0x68')]){return _[_0x480c('0x33')](_0x4e5568,function(_0x4dca90){if(_0x4dca90['sectionId']===0x709){_0x4dca90[_0x480c('0x6a')]=_0x394e76;}return _0x4dca90;});}else{var _0x58adda={'sectionId':0x76c,'enabled':0x1,'subsections':_0x394e76};var _0x3fe69b=_[_0x480c('0x33')](_0x4e5568);_0x3fe69b[_0x480c('0x64')](_0x58adda);return _0x3fe69b;}});}else{return;}})['then'](function(_0x1d42c0){if(_0x1d42c0)_0x4e5568=_0x1d42c0;return _[_0x480c('0x46')](_0x4e5568,[_0x480c('0x68'),0x1]);})[_0x480c('0x2d')](respondWithResult(_0x4c7975,null))['catch'](handleError(_0x4c7975,null));};function hasDefaultDashboard(_0x40edb3){var _0x217fd7=[0x65];return new BPromise(function(_0x18ec4e,_0x218fcf){try{if(_0x40edb3[_0x480c('0x5d')]){_0x18ec4e(_0x217fd7);}else{return db['UserProfileResource'][_0x480c('0x6b')]({'where':{'sectionId':_0x40edb3['id']},'raw':!![]})[_0x480c('0x2d')](function(_0x4fde49){_0x4fde49?_0x18ec4e(_0x217fd7):_0x18ec4e();});}}catch(_0x4b3583){_0x218fcf(_0x4b3583);}});}function getCustomDashboards(_0x2c08d8){var _0x273781=[];return new BPromise(function(_0x2897c6,_0xf7b683){try{if(_0x2c08d8[_0x480c('0x5d')]){return db[_0x480c('0x6c')][_0x480c('0x5c')]({'raw':!![]})[_0x480c('0x2d')](function(_0x4e8c49){_0x4e8c49[_0x480c('0x6d')](function(_0x24027d){_0x273781[_0x480c('0x64')](_0x24027d['id']+0x1869f);});_0x2897c6(_0x273781);});}else{return db[_0x480c('0x5e')]['findAll']({'where':{'sectionId':_0x2c08d8['id']},'raw':!![]})['then'](function(_0xfcdcde){_0xfcdcde[_0x480c('0x6d')](function(_0x366cda){_0x273781[_0x480c('0x64')](_0x366cda[_0x480c('0x6e')]+0x1869f);});_0x2897c6(_0x273781);});}}catch(_0xa2c1ed){_0xf7b683(_0xa2c1ed);}});}function getPlugins(_0xabc569){var _0x18bde7=[];return new BPromise(function(_0xf01efe,_0x4fd330){try{if(_0xabc569[_0x480c('0x5d')]){return db[_0x480c('0x6f')][_0x480c('0x5c')]({'raw':!![]})[_0x480c('0x2d')](function(_0x25e14d){_0x25e14d[_0x480c('0x6d')](function(_0x6dee84){_0x18bde7[_0x480c('0x64')](_0x6dee84['id']+0x15b38);});_0xf01efe(_0x18bde7);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0xabc569['id']},'raw':!![]})['then'](function(_0x3acc34){_0x3acc34[_0x480c('0x6d')](function(_0x618f03){_0x18bde7['push'](_0x618f03[_0x480c('0x6e')]+0x15b38);});_0xf01efe(_0x18bde7);});}}catch(_0x37aba3){_0x4fd330(_0x37aba3);}});}exports[_0x480c('0x70')]=function(_0x129e44,_0x38ecb9){return db['UserProfile']['find']({'where':{'id':_0x129e44[_0x480c('0x4d')]['id']}})[_0x480c('0x2d')](handleEntityNotFound(_0x38ecb9,null))[_0x480c('0x2d')](function(_0x114810){if(_0x114810){return db['sequelize'][_0x480c('0x5a')](function(_0x1dbc7b){return db[_0x480c('0x5b')][_0x480c('0x5c')]({'where':{'userProfileId':_0x129e44[_0x480c('0x4d')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x4d023f){if(_0x4d023f){return db[_0x480c('0x5b')][_0x480c('0x2e')]({'where':{'userProfileId':_0x129e44['params']['id'],'id':_['map'](_0x4d023f,function(_0x1d89ec){return _0x1d89ec['id'];})},'transaction':_0x1dbc7b});}})[_0x480c('0x2d')](function(_0x429a90){var _0x382d5b=_[_0x480c('0x33')](_0x129e44['body'],function(_0x33b5d0){_0x33b5d0[_0x480c('0x60')]=_0x129e44['params']['id'];return _0x33b5d0;});return db[_0x480c('0x5b')][_0x480c('0x71')](_0x382d5b,{'raw':!![],'transaction':_0x1dbc7b});})[_0x480c('0x2d')](function(_0x22562c){var _0x2e87cd=_[_0x480c('0x46')](_[_0x480c('0x33')](_0x22562c,function(_0x410946){return _0x410946[_0x480c('0x53')]({'plain':!![]});}),{'includeAll':![]});if(_0x2e87cd){return db[_0x480c('0x5b')][_0x480c('0x5c')]({'where':{'userProfileId':_0x129e44[_0x480c('0x4d')]['id'],'sectionId':_['map'](_0x2e87cd,function(_0x7e7a1b){return _0x7e7a1b[_0x480c('0x5f')];})},'attributes':['id','sectionId'],'raw':!![]})['then'](function(_0x450be0){var _0x370ce7=_[_0x480c('0x33')](_0x129e44[_0x480c('0x56')],function(_0x176e8e){_0x176e8e[_0x480c('0x60')]=_0x129e44[_0x480c('0x4d')]['id'];return _0x176e8e;});return db[_0x480c('0x5e')][_0x480c('0x71')](_0x370ce7,{'raw':!![],'transaction':_0x1dbc7b});});}})[_0x480c('0x4c')](handleError(_0x38ecb9,null));});}})['then'](function(_0x1fe604){var _0x1bb567=_[_0x480c('0x33')](_0x1fe604,function(_0x55cbef){return _0x55cbef[_0x480c('0x53')]({'plain':!![]});});})[_0x480c('0x2d')](respondWithResult(_0x38ecb9,null))[_0x480c('0x4c')](handleError(_0x38ecb9,null));};exports[_0x480c('0x72')]=function(_0x2675b0,_0x1344a0,_0x957efa){return db[_0x480c('0x34')][_0x480c('0x52')]({'where':{'id':_0x2675b0[_0x480c('0x4d')]['id']}})[_0x480c('0x2d')](handleEntityNotFound(_0x1344a0,null))[_0x480c('0x2d')](function(_0x72dcbf){if(_0x72dcbf){return _0x72dcbf[_0x480c('0x72')](_0x2675b0[_0x480c('0x39')][_0x480c('0x66')]);}})['then'](respondWithStatusCode(_0x1344a0,null))['catch'](handleError(_0x1344a0,null));};exports['getResources']=function(_0x3332c9,_0x562ec4){var _0x39a3b1={};if(!_0x3332c9[_0x480c('0x39')][_0x480c('0x73')])throw new Error(_0x480c('0x74'));if(!_0x3332c9[_0x480c('0x39')]['hasOwnProperty'](_0x480c('0x41'))){_0x39a3b1['limit']=qs[_0x480c('0x26')](_0x3332c9[_0x480c('0x39')]['limit']);_0x39a3b1['offset']=qs[_0x480c('0x25')](_0x3332c9['query'][_0x480c('0x25')]);}return db[_0x480c('0x34')][_0x480c('0x52')]({'where':{'id':_0x3332c9['params']['id']}})[_0x480c('0x2d')](function(_0xfec2e4){if(!_0xfec2e4)throw new Error(_0x480c('0x75')+_0x3332c9['params']['id']);return db[_0x480c('0x34')][_0x480c('0x76')](_0x3332c9);})[_0x480c('0x2d')](respondWithFilteredResult(_0x562ec4,_0x39a3b1))['catch'](handleError(_0x562ec4,null));};
\ No newline at end of file
index d344494..ce2517e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b8e=['save','emit','hasOwnProperty','hook','exports','events','UserProfile'];(function(_0x58dc25,_0x49b9d5){var _0x21b0a7=function(_0x38a186){while(--_0x38a186){_0x58dc25['push'](_0x58dc25['shift']());}};_0x21b0a7(++_0x49b9d5);}(_0x8b8e,0x108));var _0xe8b8=function(_0x37e11f,_0x269cd1){_0x37e11f=_0x37e11f-0x0;var _0x4d6e04=_0x8b8e[_0x37e11f];return _0x4d6e04;};'use strict';var EventEmitter=require(_0xe8b8('0x0'));var UserProfile=require('../../mysqldb')['db'][_0xe8b8('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe8b8('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xb409fe){return function(_0x472a91,_0x13a865,_0x221ccc){UserProfileEvents[_0xe8b8('0x3')](_0xb409fe+':'+_0x472a91['id'],_0x472a91);UserProfileEvents[_0xe8b8('0x3')](_0xb409fe,_0x472a91);_0x221ccc(null);};}for(var e in events){if(events[_0xe8b8('0x4')](e)){var event=events[e];UserProfile[_0xe8b8('0x5')](e,emitEvent(event));}}module[_0xe8b8('0x6')]=UserProfileEvents;
\ No newline at end of file
+var _0x4819=['save','update','remove','emit','exports','../../mysqldb','UserProfile','setMaxListeners'];(function(_0x29c261,_0x3af39a){var _0x1a9335=function(_0x40d1e8){while(--_0x40d1e8){_0x29c261['push'](_0x29c261['shift']());}};_0x1a9335(++_0x3af39a);}(_0x4819,0xcd));var _0x9481=function(_0x222df7,_0x3e073f){_0x222df7=_0x222df7-0x0;var _0x2cceae=_0x4819[_0x222df7];return _0x2cceae;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x9481('0x0'))['db'][_0x9481('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x9481('0x2')](0x0);var events={'afterCreate':_0x9481('0x3'),'afterUpdate':_0x9481('0x4'),'afterDestroy':_0x9481('0x5')};function emitEvent(_0x40a703){return function(_0x14dc10,_0xc39edf,_0x16c617){UserProfileEvents['emit'](_0x40a703+':'+_0x14dc10['id'],_0x14dc10);UserProfileEvents[_0x9481('0x6')](_0x40a703,_0x14dc10);_0x16c617(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x9481('0x7')]=UserProfileEvents;
\ No newline at end of file
index e0b5251..fb6de22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9903=['OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','voicequeues','queuecampaigns','users','agents','telephones','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','Pause','scheduler','sounds','Sound','Tag','templates','Template','triggers','Trigger','trunks','Variable','plugins','extractedreports','Reports','toUpperCase','slice','QueryTypes','SELECT','select','InteractionId','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','query','toString','OpenTabs','user_profiles','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','UserProfileSection','find','params','ignore','union','autoAssociation','model','push','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','pick','merge','key','include','forEach','default','reportId','DefaultReports','CustomReports','rows','count','includeAll','color','tag','Agents','openTabs','true','chat','dataValues','sms','mail','openchannel','all','lodash','./userProfile.attributes','../../components/parsers/qs','exports','filter','field','value','findAll','then','associatedResources','map','catch','name','resolve','AnalyticExtractedReport','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','squarerecordings','SquareRecording','SquareProjects','projectName','projects','CmContact','Lists','lists','CmList','companies','CmCompany','CmCustomField','chatqueues','ChatQueue','chatwebsites','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','VoiceRecording','parentSections','membername','User','role','agent','Telephones','queue','VoiceQueue','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9903,0x125));var _0x3990=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9903[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3990('0x0'));var attributes=require(_0x3990('0x1'));var qs=require(_0x3990('0x2'));var squel=require('squel');module[_0x3990('0x3')]=function(_0x3a9d4e){var _0x2e8fd1=_0x3a9d4e['models'];function _0x1a0698(_0x272a44,_0x3e1ccf){return new Promise(function(_0x34cd77,_0x189282){if(!_0x3e1ccf)return _0x34cd77(null);var _0x4e757f=_0x3e1ccf['filter']?{[_0x3e1ccf[_0x3990('0x4')][_0x3990('0x5')]]:_0x3e1ccf[_0x3990('0x4')][_0x3990('0x6')]}:undefined;return _0x2e8fd1[_0x272a44][_0x3990('0x7')]({'where':_0x4e757f,'raw':!![]})[_0x3990('0x8')](function(_0x2d7b3d){_0x3e1ccf[_0x3990('0x9')]=_[_0x3990('0xa')](_0x2d7b3d,'id');_0x34cd77(_0x3e1ccf);})[_0x3990('0xb')](function(_0x44ab0b){_0x189282(_0x44ab0b);});});}function _0x59de86(_0xda9d1e,_0x345d08){return new Promise(function(_0x4fcff4,_0x4f20ba){var _0x1a590b=_0xda9d1e['filter']?{[_0xda9d1e[_0x3990('0x4')]['field']]:_0xda9d1e[_0x3990('0x4')][_0x3990('0x6')]}:undefined;return _0x2e8fd1[_0xda9d1e['model']][_0x3990('0x7')]({'where':_0x1a590b,'raw':!![]})['then'](function(_0x3cc401){_0x345d08['associatedResources']=_[_0x3990('0xa')](_0x3cc401,function(_0x5c6deb){return _0x5c6deb[_0x3990('0xc')];});_0x4fcff4(_0x345d08);})['catch'](function(_0xb507b0){_0x4f20ba(_0xb507b0);});});}function _0x27bf2d(_0x995d71,_0x3ba903,_0x1f7540){if(!_0x3ba903)return Promise[_0x3990('0xd')](null);return new Promise(function(_0x5753cc,_0x550a49){return _0x2e8fd1['UserProfileResource']['findAll']({'where':{'sectionId':_0x3ba903['id']},'raw':!![]})['then'](function(_0x1c1501){if(_0x995d71['field']&&_0x995d71[_0x3990('0x5')]!=='id'){_0x3ba903[_0x3990('0x9')]=_[_0x3990('0xa')](_0x1c1501,function(_0x497a24){return _0x497a24[_0x995d71[_0x3990('0x5')]];});}else{if(_0x1f7540===_0x3990('0xe')){_0x3ba903[_0x3990('0x9')]=_['map'](_0x1c1501,function(_0x203c16){return{'id':_0x203c16['resourceId'],'type':_0x203c16[_0x3990('0xf')]};});}else{_0x3ba903[_0x3990('0x9')]=_[_0x3990('0xa')](_0x1c1501,function(_0x14c67f){return _0x14c67f['resourceId'];});}}_0x5753cc(_0x3ba903);})[_0x3990('0xb')](function(_0x4be68c){_0x550a49(_0x4be68c);});});}function _0x4cd962(_0x3a976c,_0x2fb1b7){var _0x2396b8={'parentSections':[]};switch(_0x3a976c[_0x3990('0x10')]()){case _0x3990('0x11'):_0x2396b8[_0x3990('0x12')]=_0x3990('0x13');break;case _0x3990('0x14'):_0x2396b8['childModel']='SquareOdbc';break;case _0x3990('0x15'):_0x2396b8['childModel']=_0x3990('0x16');_0x2396b8['parentSections']=[{'name':_0x3990('0x17'),'field':_0x3990('0xc'),'foreignKey':_0x3990('0x18')}];break;case _0x3990('0x19'):_0x2396b8[_0x3990('0x12')]='JscriptyProject';break;case'contacts':_0x2396b8[_0x3990('0x12')]=_0x3990('0x1a');_0x2396b8['parentSections']=[{'name':_0x3990('0x1b'),'field':'id','foreignKey':'ListId'}];break;case _0x3990('0x1c'):_0x2396b8[_0x3990('0x12')]=_0x3990('0x1d');break;case _0x3990('0x1e'):_0x2396b8[_0x3990('0x12')]=_0x3990('0x1f');break;case'globalcustomfields':_0x2396b8[_0x3990('0x12')]=_0x3990('0x20');break;case _0x3990('0x21'):_0x2396b8[_0x3990('0x12')]=_0x3990('0x22');break;case _0x3990('0x23'):_0x2396b8['childModel']='ChatWebsite';break;case _0x3990('0x24'):_0x2396b8[_0x3990('0x12')]=_0x3990('0x25');break;case _0x3990('0x26'):_0x2396b8[_0x3990('0x12')]=_0x3990('0x27');break;case _0x3990('0x28'):case _0x3990('0x29'):case _0x3990('0x2a'):_0x2396b8[_0x3990('0x12')]=_0x3990('0x2b');break;case _0x3990('0x2c'):_0x2396b8[_0x3990('0x12')]=_0x3990('0x2d');break;case _0x3990('0x2e'):_0x2396b8[_0x3990('0x12')]=_0x3990('0x2f');break;case'voicerecordings':_0x2396b8['childModel']=_0x3990('0x30');_0x2396b8[_0x3990('0x31')]=[{'name':'Agents','field':_0x3990('0xc'),'foreignKey':_0x3990('0x32'),'model':_0x3990('0x33'),'filter':{'field':_0x3990('0x34'),'value':[_0x3990('0x35')]}},{'name':_0x3990('0x36'),'field':_0x3990('0xc'),'foreignKey':_0x3990('0x32'),'model':_0x3990('0x33'),'filter':{'field':_0x3990('0x34'),'value':['telephone']}},{'name':'VoiceQueues','field':_0x3990('0xc'),'foreignKey':_0x3990('0x37'),'model':_0x3990('0x38'),'filter':{'field':_0x3990('0xf'),'value':['inbound']}},{'name':_0x3990('0x39'),'field':'name','foreignKey':'queue','model':_0x3990('0x38'),'filter':{'field':_0x3990('0xf'),'value':[_0x3990('0x3a')]}}];break;case _0x3990('0x3b'):_0x2396b8['childModel']=_0x3990('0x3c');break;case _0x3990('0x3d'):_0x2396b8['childModel']=_0x3990('0x3e');break;case'voiceprefixes':_0x2396b8['childModel']=_0x3990('0x3f');break;case _0x3990('0x40'):_0x2396b8[_0x3990('0x12')]=_0x3990('0x41');break;case _0x3990('0x42'):_0x2396b8[_0x3990('0x12')]=_0x3990('0x43');break;case _0x3990('0x44'):_0x2396b8[_0x3990('0x12')]=_0x3990('0x45');break;case _0x3990('0x46'):_0x2396b8[_0x3990('0x12')]=_0x3990('0x47');break;case _0x3990('0x48'):_0x2396b8[_0x3990('0x12')]=_0x3990('0x49');break;case _0x3990('0x4a'):_0x2396b8['childModel']=_0x3990('0x4b');break;case _0x3990('0x4c'):_0x2396b8[_0x3990('0x12')]=_0x3990('0x4d');break;case _0x3990('0x4e'):_0x2396b8[_0x3990('0x12')]=_0x3990('0x4f');break;case'whatsappqueues':_0x2396b8[_0x3990('0x12')]=_0x3990('0x50');break;case _0x3990('0x51'):_0x2396b8[_0x3990('0x12')]=_0x3990('0x52');break;case _0x3990('0x53'):_0x2396b8['childModel']='Team';break;case _0x3990('0x54'):case _0x3990('0x55'):_0x2396b8[_0x3990('0x12')]='VoiceQueue';if(_0x2fb1b7){_0x2396b8[_0x3990('0x31')]=[{'name':'VoiceQueues'},{'name':_0x3990('0x39')}];}break;case _0x3990('0x56'):case _0x3990('0x57'):case _0x3990('0x58'):_0x2396b8['childModel']='User';if(_0x2fb1b7){_0x2396b8['parentSections']=[{'name':'Users','filter':{'field':'role','value':[_0x3990('0x59'),_0x3990('0x5a')]},'ignore':!![]},{'name':'Agents'},{'name':_0x3990('0x36')}];}break;case _0x3990('0x5b'):_0x2396b8[_0x3990('0x12')]=_0x3990('0x5c');break;case _0x3990('0x5d'):_0x2396b8['childModel']='SalesforceAccount';break;case _0x3990('0x5e'):_0x2396b8[_0x3990('0x12')]=_0x3990('0x5f');break;case _0x3990('0x60'):_0x2396b8[_0x3990('0x12')]=_0x3990('0x61');break;case'deskaccounts':_0x2396b8[_0x3990('0x12')]='DeskAccount';break;case'zohoaccounts':_0x2396b8['childModel']=_0x3990('0x62');break;case _0x3990('0x63'):_0x2396b8[_0x3990('0x12')]=_0x3990('0x33');break;case _0x3990('0x64'):_0x2396b8[_0x3990('0x12')]=_0x3990('0x65');break;case _0x3990('0x66'):_0x2396b8[_0x3990('0x12')]=_0x3990('0x67');break;case _0x3990('0x68'):_0x2396b8[_0x3990('0x12')]=_0x3990('0x69');break;case'intervals':_0x2396b8['childModel']='Interval';break;case'pauses':_0x2396b8[_0x3990('0x12')]=_0x3990('0x6a');break;case _0x3990('0x6b'):_0x2396b8[_0x3990('0x12')]='Schedule';break;case _0x3990('0x6c'):_0x2396b8['childModel']=_0x3990('0x6d');break;case'tags':_0x2396b8[_0x3990('0x12')]=_0x3990('0x6e');break;case _0x3990('0x6f'):_0x2396b8[_0x3990('0x12')]=_0x3990('0x70');break;case _0x3990('0x71'):_0x2396b8['childModel']=_0x3990('0x72');break;case _0x3990('0x73'):_0x2396b8[_0x3990('0x12')]='Trunk';break;case'variables':_0x2396b8[_0x3990('0x12')]=_0x3990('0x74');break;case _0x3990('0x75'):_0x2396b8[_0x3990('0x12')]='Plugin';break;case _0x3990('0x76'):_0x2396b8['childModel']=_0x3990('0xe');_0x2396b8[_0x3990('0x31')]=[{'name':_0x3990('0x77'),'field':'id','foreignKey':'reportId'}];break;case'metrics':_0x2396b8[_0x3990('0x12')]='AnalyticMetric';break;}return _0x2396b8;}function _0x96a295(_0x542505,_0x3e77a2){var _0xadac9=_0x542505['charAt'](0x0)[_0x3990('0x78')]()+_0x542505[_0x3990('0x79')](0x1);var _0x11cc43={'type':_0x2e8fd1['Sequelize'][_0x3990('0x7a')][_0x3990('0x7b')],'raw':!![]};return new Promise(function(_0xc970f6,_0x3386c8){var _0x3ea2ec=squel[_0x3990('0x7c')]()[_0x3990('0x5')]('ui.'+_0xadac9+_0x3990('0x7d'),'id')[_0x3990('0x5')](_0x3990('0x7e'))[_0x3990('0x7f')](_0x3990('0x80')+_0x542505+_0x3990('0x81'),'ui')[_0x3990('0x82')](_0x3990('0x83'),_0x3e77a2['id']);return _0x2e8fd1['sequelize'][_0x3990('0x84')](_0x3ea2ec[_0x3990('0x85')](),_0x11cc43)[_0x3990('0x8')](function(_0xf7a7a4){_0x3e77a2[_0xadac9+_0x3990('0x86')]=_0xf7a7a4;_0xc970f6(_0xf7a7a4);})[_0x3990('0xb')](function(_0x5c63d5){_0x3386c8(_0x5c63d5);});});}return _0x3a9d4e['define']('UserProfile',attributes,{'tableName':_0x3990('0x87'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x17928f){var _0x153a07={'raw':_0x17928f['query']['raw'],'where':{}};var _0x8ba01e={};var _0x3a4296={'count':0x0,'rows':[]};var _0x1abef3=_0x17928f[_0x3990('0x84')]['section'];var _0x189fee=_0x17928f[_0x3990('0x84')][_0x3990('0x88')]||![];var _0x45c3e1=_0x4cd962(_0x1abef3,_0x189fee);if(!_0x45c3e1[_0x3990('0x12')])throw new Error(_0x3990('0x89')+_0x1abef3+'\x27');var _0x10511a=[{'name':_0x1abef3}];if(!_[_0x3990('0x8a')](_0x45c3e1[_0x3990('0x31')]))_0x10511a=_0x45c3e1['parentSections'];var _0x444abe=[];for(var _0x3194a9=0x0;_0x3194a9<_0x10511a[_0x3990('0x8b')];_0x3194a9++){_0x444abe['push'](_0x2e8fd1[_0x3990('0x8c')][_0x3990('0x8d')]({'where':{'userProfileId':_0x17928f[_0x3990('0x8e')]['id'],'name':_0x10511a[_0x3194a9][_0x3990('0xc')]},'raw':!![]}));}return Promise['all'](_0x444abe)[_0x3990('0x8')](function(_0x123c80){var _0x1e219d=_[_0x3990('0x4')](_0x123c80,function(_0xa4a35d){return _0xa4a35d?_0xa4a35d:undefined;});var _0x55ae3f=_[_0x3990('0x4')](_0x10511a,[_0x3990('0x8f'),!![]]);var _0x46b28e=_[_0x3990('0x8a')](_0x1e219d)&&_['isEmpty'](_0x55ae3f)?null:_[_0x3990('0x90')](_0x55ae3f,_0x1e219d);if(!_0x46b28e)return null;var _0x3a371d=[];for(var _0x5f4f9e=0x0;_0x5f4f9e<_0x46b28e['length'];_0x5f4f9e++){var _0x4271a8=_[_0x3990('0x8d')](_0x10511a,function(_0x220b9d){return _0x46b28e[_0x5f4f9e]?_0x220b9d[_0x3990('0xc')]===_0x46b28e[_0x5f4f9e][_0x3990('0xc')]:null;});if(_0x4271a8){if(_0x46b28e[_0x5f4f9e][_0x3990('0x8f')]){_0x3a371d['push'](_0x1a0698(_0x45c3e1[_0x3990('0x12')],_0x46b28e[_0x5f4f9e]));}else{if(!_0x46b28e[_0x5f4f9e][_0x3990('0x91')]){_0x3a371d['push'](_0x27bf2d(_0x4271a8,_0x46b28e[_0x5f4f9e],_0x45c3e1[_0x3990('0x12')]));}else{if(_0x4271a8[_0x3990('0x92')]){_0x3a371d[_0x3990('0x93')](_0x59de86(_0x4271a8,_0x46b28e[_0x5f4f9e]));}}}}}return Promise['all'](_0x3a371d);})[_0x3990('0x8')](function(_0x15edb8){var _0x1b4ce8=_0x15edb8;var _0x3ff785=null;if(_0x1b4ce8){_0x3ff785=_0x1b4ce8[_0x3990('0x8b')]===0x1?_0x1b4ce8[0x0]:null;}if(!_0x3ff785&&!_0x1b4ce8)return _0x3a4296;var _0x12ee8e=_0x2e8fd1[_0x45c3e1[_0x3990('0x12')]][_0x3990('0x94')];_0x8ba01e[_0x3990('0x92')]=_[_0x3990('0x95')](_0x12ee8e);_0x8ba01e[_0x3990('0x84')]=_[_0x3990('0x95')](_0x17928f[_0x3990('0x84')]);_0x8ba01e[_0x3990('0x96')]=_[_0x3990('0x97')](_0x8ba01e[_0x3990('0x92')],_0x8ba01e[_0x3990('0x84')]);_0x153a07[_0x3990('0x98')]=_[_0x3990('0x97')](_0x8ba01e[_0x3990('0x92')],qs[_0x3990('0x99')](_0x17928f['query'][_0x3990('0x99')]));_0x153a07[_0x3990('0x98')]=_0x153a07[_0x3990('0x98')][_0x3990('0x8b')]?_0x153a07[_0x3990('0x98')]:_0x8ba01e[_0x3990('0x92')];if(!_0x17928f[_0x3990('0x84')][_0x3990('0x9a')](_0x3990('0x9b'))){_0x153a07[_0x3990('0x9c')]=qs['limit'](_0x17928f['query'][_0x3990('0x9c')]);_0x153a07[_0x3990('0x9d')]=qs['offset'](_0x17928f['query']['offset']);}_0x153a07[_0x3990('0x9e')]=qs[_0x3990('0x9f')](_0x17928f[_0x3990('0x84')][_0x3990('0x9f')]);_0x153a07['where']=qs['filters'](_[_0x3990('0xa0')](_0x17928f[_0x3990('0x84')],_0x8ba01e[_0x3990('0x96')]));if(_0x17928f[_0x3990('0x84')][_0x3990('0x4')]){_0x153a07[_0x3990('0x82')]=_[_0x3990('0xa1')](_0x153a07[_0x3990('0x82')],{'$or':_[_0x3990('0xa')](_0x12ee8e,function(_0x95f88e){if(_0x95f88e[_0x3990('0xf')][_0x3990('0xa2')]!=='VIRTUAL'){var _0x2f31e2={};_0x2f31e2[_0x95f88e[_0x3990('0x5')]]={'$like':'%'+_0x17928f['query']['filter']+'%'};return _0x2f31e2;}})});}var _0xb897c7=[];var _0x470c6c=null;var _0x4f418a={};if(_0x3ff785){_0x470c6c=_['find'](_0x10511a,['name',_0x3ff785['name']]);if(_0x470c6c[_0x3990('0x5')]){_0x4f418a={};if(_0x45c3e1[_0x3990('0x12')]===_0x3990('0xe')){_0x4f418a[_0x470c6c['foreignKey']]=_[_0x3990('0xa')](_0x3ff785[_0x3990('0x9')],'id');}else{_0x4f418a[_0x470c6c['foreignKey']]=_0x3ff785[_0x3990('0x9')];}_0xb897c7[_0x3990('0x93')](_0x4f418a);}else{_0x153a07['where']['id']=_0x3ff785['associatedResources'];}}else{for(var _0x4b1b04=0x0;_0x4b1b04<_0x1b4ce8[_0x3990('0x8b')];_0x4b1b04++){_0x470c6c=_[_0x3990('0x8d')](_0x10511a,[_0x3990('0xc'),_0x1b4ce8[_0x4b1b04][_0x3990('0xc')]]);if(_0x470c6c[_0x3990('0x5')]){_0x4f418a={};_0x4f418a[_0x470c6c['foreignKey']]=_0x1b4ce8[_0x4b1b04]['associatedResources'];_0xb897c7[_0x3990('0x93')](_0x4f418a);}else{if(!_0x153a07[_0x3990('0x82')]['id'])_0x153a07[_0x3990('0x82')]['id']=[];_0x1b4ce8[_0x4b1b04][_0x3990('0x9')]['forEach'](function(_0x457696){_0x153a07[_0x3990('0x82')]['id'][_0x3990('0x93')](_0x457696);});}}}if(!_[_0x3990('0x8a')](_0xb897c7)){_0x153a07['where']=_[_0x3990('0xa1')](_0x153a07[_0x3990('0x82')],{'$and':{'$or':_0xb897c7}});}_0x153a07=_[_0x3990('0xa1')]({},_0x153a07,_0x17928f['options']);if(_0x3ff785&&!_0x3ff785[_0x3990('0x91')]&&_0x45c3e1[_0x3990('0x12')]===_0x3990('0xe')){if(_0x17928f[_0x3990('0x84')]['includeAll']){_0x153a07[_0x3990('0xa3')]=[{'all':!![]}];}return _0x2e8fd1[_0x45c3e1[_0x3990('0x12')]][_0x3990('0x7')](_0x153a07)['then'](function(_0x3632a8){var _0x2274a9=[];_0x3632a8[_0x3990('0xa4')](function(_0x2ab23e){var _0x18c6b5;switch(_0x2ab23e['reportType']){case _0x3990('0xa5'):_0x18c6b5=_['find'](_0x3ff785[_0x3990('0x9')],function(_0x3b8c3e){return _0x3b8c3e['id']===_0x2ab23e[_0x3990('0xa6')]&&_0x3b8c3e['type']===_0x3990('0xa7');});break;case'custom':_0x18c6b5=_[_0x3990('0x8d')](_0x3ff785['associatedResources'],function(_0x2e6ab7){return _0x2e6ab7['id']===_0x2ab23e['reportId']&&_0x2e6ab7['type']===_0x3990('0xa8');});break;}if(_0x18c6b5)_0x2274a9[_0x3990('0x93')](_0x2ab23e);});_0x3a4296['count']=_0x2274a9[_0x3990('0x8b')];_0x3a4296[_0x3990('0xa9')]=_0x2274a9;return _0x3a4296;});}else{return _0x2e8fd1[_0x45c3e1[_0x3990('0x12')]][_0x3990('0xaa')]({'where':_0x153a07[_0x3990('0x82')]})[_0x3990('0x8')](function(_0x50ef7d){_0x3a4296[_0x3990('0xaa')]=_0x50ef7d;if(_0x17928f['query'][_0x3990('0xab')]){if(_0x45c3e1['childModel']==='CmContact'){_0x153a07[_0x3990('0xa3')]=[{'model':_0x2e8fd1[_0x3990('0x6e')],'as':'Tags','attributes':['id',_0x3990('0xc'),_0x3990('0xac')],'required':_0x17928f[_0x3990('0x84')][_0x3990('0xad')]?!![]:![]},{'model':_0x2e8fd1['Tag'],'as':'ThroughTags','attributes':['id',_0x3990('0xc'),_0x3990('0xac')],'through':_0x17928f[_0x3990('0x84')][_0x3990('0xad')]?{'attributes':[],'where':{'TagId':_0x17928f[_0x3990('0x84')][_0x3990('0xad')]||undefined}}:{},'required':_0x17928f['query'][_0x3990('0xad')]?!![]:![]}];}else{_0x153a07[_0x3990('0xa3')]=[{'all':!![]}];}}return _0x2e8fd1[_0x45c3e1[_0x3990('0x12')]][_0x3990('0x7')](_0x153a07);})[_0x3990('0x8')](function(_0xa28459){_0x3a4296[_0x3990('0xa9')]=_0xa28459;if(_0x1abef3===_0x3990('0xae')&&_0x17928f[_0x3990('0x84')][_0x3990('0xaf')]===_0x3990('0xb0')){var _0x576c7d=[];for(var _0x48ad9b=0x0;_0x48ad9b<_0x3a4296[_0x3990('0xa9')][_0x3990('0x8b')];_0x48ad9b++){_0x576c7d[_0x3990('0x93')](_0x96a295(_0x3990('0xb1'),_0x3a4296[_0x3990('0xa9')][_0x48ad9b][_0x3990('0xb2')]));_0x576c7d[_0x3990('0x93')](_0x96a295(_0x3990('0xb3'),_0x3a4296[_0x3990('0xa9')][_0x48ad9b]['dataValues']));_0x576c7d[_0x3990('0x93')](_0x96a295('fax',_0x3a4296[_0x3990('0xa9')][_0x48ad9b]['dataValues']));_0x576c7d[_0x3990('0x93')](_0x96a295(_0x3990('0xb4'),_0x3a4296[_0x3990('0xa9')][_0x48ad9b][_0x3990('0xb2')]));_0x576c7d[_0x3990('0x93')](_0x96a295(_0x3990('0xb5'),_0x3a4296['rows'][_0x48ad9b][_0x3990('0xb2')]));_0x576c7d[_0x3990('0x93')](_0x96a295('whatsapp',_0x3a4296[_0x3990('0xa9')][_0x48ad9b][_0x3990('0xb2')]));}return Promise[_0x3990('0xb6')](_0x576c7d)['then'](function(){return _0x3a4296;});}return _0x3a4296;});}});}}});};
\ No newline at end of file
+var _0x8cf7=['Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','define','UserProfile','raw','section','mergeResources','Invalid\x20section\x20\x27','length','push','UserProfileSection','find','params','all','isEmpty','union','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','pick','filters','merge','type','key','foreignKey','forEach','options','autoAssociation','includeAll','include','reportType','default','custom','count','rows','CmContact','Tags','tag','openTabs','true','chat','dataValues','fax','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','exports','models','filter','field','value','findAll','then','associatedResources','model','map','name','catch','AnalyticExtractedReport','resourceId','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','SquareRecording','parentSections','SquareProjects','projects','JscriptyProject','contacts','Lists','ListId','lists','companies','CmCustomField','chatqueues','ChatQueue','ChatWebsite','faxqueues','FaxQueue','FaxAccount','inboundroutes','internalroutes','VoiceExtension','VoiceContext','voicemails','VoiceMail','VoiceRecording','Agents','User','role','agent','VoiceQueues','queue','VoiceQueue','inbound','outbound','musiconholds','chanspies','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','QueueCampaigns','users','agents','telephones','admin','Telephones','zendeskaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','zohoaccounts','ZohoAccount','CannedAnswer','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','tags','Tag','templates','Template','triggers','Trigger','trunks','Trunk','Variable','plugins','Plugin','extractedreports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8cf7,0x1b6));var _0x78cf=function(_0x4e0247,_0x1e5d66){_0x4e0247=_0x4e0247-0x0;var _0x4ce70d=_0x8cf7[_0x4e0247];return _0x4ce70d;};'use strict';var _=require(_0x78cf('0x0'));var attributes=require(_0x78cf('0x1'));var qs=require(_0x78cf('0x2'));var squel=require('squel');module[_0x78cf('0x3')]=function(_0x2b2878){var _0x46d12a=_0x2b2878[_0x78cf('0x4')];function _0x5e86e2(_0x7d08de,_0x1d99b8){return new Promise(function(_0x392f1a,_0x57eb77){if(!_0x1d99b8)return _0x392f1a(null);var _0x288c86=_0x1d99b8[_0x78cf('0x5')]?{[_0x1d99b8[_0x78cf('0x5')][_0x78cf('0x6')]]:_0x1d99b8[_0x78cf('0x5')][_0x78cf('0x7')]}:undefined;return _0x46d12a[_0x7d08de][_0x78cf('0x8')]({'where':_0x288c86,'raw':!![]})[_0x78cf('0x9')](function(_0x26d014){_0x1d99b8[_0x78cf('0xa')]=_['map'](_0x26d014,'id');_0x392f1a(_0x1d99b8);})['catch'](function(_0x1ccf05){_0x57eb77(_0x1ccf05);});});}function _0x449dd7(_0x39f4b1,_0x99aa4a){return new Promise(function(_0x2d00cb,_0x2a2975){var _0x4af414=_0x39f4b1[_0x78cf('0x5')]?{[_0x39f4b1[_0x78cf('0x5')]['field']]:_0x39f4b1['filter'][_0x78cf('0x7')]}:undefined;return _0x46d12a[_0x39f4b1[_0x78cf('0xb')]][_0x78cf('0x8')]({'where':_0x4af414,'raw':!![]})['then'](function(_0x31d6da){_0x99aa4a[_0x78cf('0xa')]=_[_0x78cf('0xc')](_0x31d6da,function(_0x4aaf5d){return _0x4aaf5d[_0x78cf('0xd')];});_0x2d00cb(_0x99aa4a);})[_0x78cf('0xe')](function(_0x4692a1){_0x2a2975(_0x4692a1);});});}function _0x17b87a(_0x39b211,_0x3c983c,_0x3b99ce){if(!_0x3c983c)return Promise['resolve'](null);return new Promise(function(_0x53e6d0,_0x183b77){return _0x46d12a['UserProfileResource'][_0x78cf('0x8')]({'where':{'sectionId':_0x3c983c['id']},'raw':!![]})[_0x78cf('0x9')](function(_0x306c93){if(_0x39b211['field']&&_0x39b211[_0x78cf('0x6')]!=='id'){_0x3c983c[_0x78cf('0xa')]=_[_0x78cf('0xc')](_0x306c93,function(_0x54f82d){return _0x54f82d[_0x39b211[_0x78cf('0x6')]];});}else{if(_0x3b99ce===_0x78cf('0xf')){_0x3c983c[_0x78cf('0xa')]=_[_0x78cf('0xc')](_0x306c93,function(_0x5cec9b){return{'id':_0x5cec9b[_0x78cf('0x10')],'type':_0x5cec9b['type']};});}else{_0x3c983c['associatedResources']=_['map'](_0x306c93,function(_0x5d9dd9){return _0x5d9dd9[_0x78cf('0x10')];});}}_0x53e6d0(_0x3c983c);})[_0x78cf('0xe')](function(_0x2f55a5){_0x183b77(_0x2f55a5);});});}function _0x59da6c(_0x298261,_0x750dd8){var _0x35955e={'parentSections':[]};switch(_0x298261[_0x78cf('0x11')]()){case _0x78cf('0x12'):_0x35955e[_0x78cf('0x13')]=_0x78cf('0x14');break;case _0x78cf('0x15'):_0x35955e['childModel']=_0x78cf('0x16');break;case'squarerecordings':_0x35955e[_0x78cf('0x13')]=_0x78cf('0x17');_0x35955e[_0x78cf('0x18')]=[{'name':_0x78cf('0x19'),'field':_0x78cf('0xd'),'foreignKey':'projectName'}];break;case _0x78cf('0x1a'):_0x35955e[_0x78cf('0x13')]=_0x78cf('0x1b');break;case _0x78cf('0x1c'):_0x35955e[_0x78cf('0x13')]='CmContact';_0x35955e[_0x78cf('0x18')]=[{'name':_0x78cf('0x1d'),'field':'id','foreignKey':_0x78cf('0x1e')}];break;case _0x78cf('0x1f'):_0x35955e['childModel']='CmList';break;case _0x78cf('0x20'):_0x35955e[_0x78cf('0x13')]='CmCompany';break;case'globalcustomfields':_0x35955e['childModel']=_0x78cf('0x21');break;case _0x78cf('0x22'):_0x35955e[_0x78cf('0x13')]=_0x78cf('0x23');break;case'chatwebsites':_0x35955e['childModel']=_0x78cf('0x24');break;case _0x78cf('0x25'):_0x35955e[_0x78cf('0x13')]=_0x78cf('0x26');break;case'faxaccounts':_0x35955e['childModel']=_0x78cf('0x27');break;case _0x78cf('0x28'):case _0x78cf('0x29'):case'outboundroutes':_0x35955e[_0x78cf('0x13')]=_0x78cf('0x2a');break;case'contexts':_0x35955e[_0x78cf('0x13')]=_0x78cf('0x2b');break;case _0x78cf('0x2c'):_0x35955e[_0x78cf('0x13')]=_0x78cf('0x2d');break;case'voicerecordings':_0x35955e['childModel']=_0x78cf('0x2e');_0x35955e[_0x78cf('0x18')]=[{'name':_0x78cf('0x2f'),'field':'name','foreignKey':'membername','model':_0x78cf('0x30'),'filter':{'field':_0x78cf('0x31'),'value':[_0x78cf('0x32')]}},{'name':'Telephones','field':'name','foreignKey':'membername','model':_0x78cf('0x30'),'filter':{'field':_0x78cf('0x31'),'value':['telephone']}},{'name':_0x78cf('0x33'),'field':'name','foreignKey':_0x78cf('0x34'),'model':_0x78cf('0x35'),'filter':{'field':'type','value':[_0x78cf('0x36')]}},{'name':'QueueCampaigns','field':'name','foreignKey':'queue','model':_0x78cf('0x35'),'filter':{'field':'type','value':[_0x78cf('0x37')]}}];break;case _0x78cf('0x38'):_0x35955e[_0x78cf('0x13')]='VoiceMusicOnHold';break;case _0x78cf('0x39'):_0x35955e[_0x78cf('0x13')]='VoiceChanSpy';break;case'voiceprefixes':_0x35955e[_0x78cf('0x13')]=_0x78cf('0x3a');break;case _0x78cf('0x3b'):_0x35955e['childModel']=_0x78cf('0x3c');break;case _0x78cf('0x3d'):_0x35955e['childModel']='MailQueue';break;case'mailaccounts':_0x35955e[_0x78cf('0x13')]='MailAccount';break;case'mailsubstatuses':_0x35955e[_0x78cf('0x13')]=_0x78cf('0x3e');break;case _0x78cf('0x3f'):_0x35955e[_0x78cf('0x13')]=_0x78cf('0x40');break;case _0x78cf('0x41'):_0x35955e['childModel']='OpenchannelAccount';break;case'smsqueues':_0x35955e[_0x78cf('0x13')]=_0x78cf('0x42');break;case _0x78cf('0x43'):_0x35955e['childModel']=_0x78cf('0x44');break;case _0x78cf('0x45'):_0x35955e[_0x78cf('0x13')]=_0x78cf('0x46');break;case _0x78cf('0x47'):_0x35955e[_0x78cf('0x13')]=_0x78cf('0x48');break;case _0x78cf('0x49'):_0x35955e['childModel']=_0x78cf('0x4a');break;case _0x78cf('0x4b'):case _0x78cf('0x4c'):_0x35955e[_0x78cf('0x13')]=_0x78cf('0x35');if(_0x750dd8){_0x35955e[_0x78cf('0x18')]=[{'name':_0x78cf('0x33')},{'name':_0x78cf('0x4d')}];}break;case _0x78cf('0x4e'):case _0x78cf('0x4f'):case _0x78cf('0x50'):_0x35955e[_0x78cf('0x13')]=_0x78cf('0x30');if(_0x750dd8){_0x35955e[_0x78cf('0x18')]=[{'name':'Users','filter':{'field':_0x78cf('0x31'),'value':[_0x78cf('0x51'),'user']},'ignore':!![]},{'name':'Agents'},{'name':_0x78cf('0x52')}];}break;case _0x78cf('0x53'):_0x35955e['childModel']='ZendeskAccount';break;case'salesforceaccounts':_0x35955e['childModel']=_0x78cf('0x54');break;case _0x78cf('0x55'):_0x35955e[_0x78cf('0x13')]=_0x78cf('0x56');break;case _0x78cf('0x57'):_0x35955e[_0x78cf('0x13')]=_0x78cf('0x58');break;case'deskaccounts':_0x35955e[_0x78cf('0x13')]='DeskAccount';break;case _0x78cf('0x59'):_0x35955e[_0x78cf('0x13')]=_0x78cf('0x5a');break;case'vtigeraccounts':_0x35955e[_0x78cf('0x13')]=_0x78cf('0x30');break;case'cannedanswers':_0x35955e[_0x78cf('0x13')]=_0x78cf('0x5b');break;case'dispositions':_0x35955e['childModel']=_0x78cf('0x5c');break;case _0x78cf('0x5d'):_0x35955e['childModel']=_0x78cf('0x5e');break;case _0x78cf('0x5f'):_0x35955e[_0x78cf('0x13')]=_0x78cf('0x60');break;case _0x78cf('0x61'):_0x35955e[_0x78cf('0x13')]=_0x78cf('0x62');break;case _0x78cf('0x63'):_0x35955e[_0x78cf('0x13')]=_0x78cf('0x64');break;case _0x78cf('0x65'):_0x35955e[_0x78cf('0x13')]='Sound';break;case _0x78cf('0x66'):_0x35955e['childModel']=_0x78cf('0x67');break;case _0x78cf('0x68'):_0x35955e[_0x78cf('0x13')]=_0x78cf('0x69');break;case _0x78cf('0x6a'):_0x35955e[_0x78cf('0x13')]=_0x78cf('0x6b');break;case _0x78cf('0x6c'):_0x35955e[_0x78cf('0x13')]=_0x78cf('0x6d');break;case'variables':_0x35955e[_0x78cf('0x13')]=_0x78cf('0x6e');break;case _0x78cf('0x6f'):_0x35955e[_0x78cf('0x13')]=_0x78cf('0x70');break;case _0x78cf('0x71'):_0x35955e[_0x78cf('0x13')]=_0x78cf('0xf');_0x35955e[_0x78cf('0x18')]=[{'name':_0x78cf('0x72'),'field':'id','foreignKey':_0x78cf('0x73')}];break;case _0x78cf('0x74'):_0x35955e['childModel']=_0x78cf('0x75');break;}return _0x35955e;}function _0x31b99c(_0x42b07a,_0x5041cd){var _0x34f469=_0x42b07a[_0x78cf('0x76')](0x0)[_0x78cf('0x77')]()+_0x42b07a[_0x78cf('0x78')](0x1);var _0x8314da={'type':_0x46d12a[_0x78cf('0x79')][_0x78cf('0x7a')][_0x78cf('0x7b')],'raw':!![]};return new Promise(function(_0x279271,_0x5882f4){var _0x5c7be0=squel[_0x78cf('0x7c')]()['field'](_0x78cf('0x7d')+_0x34f469+_0x78cf('0x7e'),'id')[_0x78cf('0x6')](_0x78cf('0x7f'))[_0x78cf('0x80')](_0x78cf('0x81')+_0x42b07a+_0x78cf('0x82'),'ui')[_0x78cf('0x83')](_0x78cf('0x84'),_0x5041cd['id']);return _0x46d12a[_0x78cf('0x85')][_0x78cf('0x86')](_0x5c7be0['toString'](),_0x8314da)[_0x78cf('0x9')](function(_0x2556a3){_0x5041cd[_0x34f469+'OpenTabs']=_0x2556a3;_0x279271(_0x2556a3);})[_0x78cf('0xe')](function(_0x54f171){_0x5882f4(_0x54f171);});});}return _0x2b2878[_0x78cf('0x87')](_0x78cf('0x88'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x42451e){var _0x3e995c={'raw':_0x42451e[_0x78cf('0x86')][_0x78cf('0x89')],'where':{}};var _0x3a3375={};var _0x37c71a={'count':0x0,'rows':[]};var _0x52565f=_0x42451e[_0x78cf('0x86')][_0x78cf('0x8a')];var _0x4ad3f5=_0x42451e[_0x78cf('0x86')][_0x78cf('0x8b')]||![];var _0x55ff9a=_0x59da6c(_0x52565f,_0x4ad3f5);if(!_0x55ff9a[_0x78cf('0x13')])throw new Error(_0x78cf('0x8c')+_0x52565f+'\x27');var _0x5cdc8d=[{'name':_0x52565f}];if(!_['isEmpty'](_0x55ff9a['parentSections']))_0x5cdc8d=_0x55ff9a[_0x78cf('0x18')];var _0x4bfe48=[];for(var _0x139967=0x0;_0x139967<_0x5cdc8d[_0x78cf('0x8d')];_0x139967++){_0x4bfe48[_0x78cf('0x8e')](_0x46d12a[_0x78cf('0x8f')][_0x78cf('0x90')]({'where':{'userProfileId':_0x42451e[_0x78cf('0x91')]['id'],'name':_0x5cdc8d[_0x139967]['name']},'raw':!![]}));}return Promise[_0x78cf('0x92')](_0x4bfe48)[_0x78cf('0x9')](function(_0x69d6ff){var _0x23fc36=_[_0x78cf('0x5')](_0x69d6ff,function(_0x204bc2){return _0x204bc2?_0x204bc2:undefined;});var _0x1f1354=_[_0x78cf('0x5')](_0x5cdc8d,['ignore',!![]]);var _0x471a87=_[_0x78cf('0x93')](_0x23fc36)&&_[_0x78cf('0x93')](_0x1f1354)?null:_[_0x78cf('0x94')](_0x1f1354,_0x23fc36);if(!_0x471a87)return null;var _0x2194bc=[];for(var _0x2401f9=0x0;_0x2401f9<_0x471a87[_0x78cf('0x8d')];_0x2401f9++){var _0x4bbfd2=_[_0x78cf('0x90')](_0x5cdc8d,function(_0x2e3b0c){return _0x471a87[_0x2401f9]?_0x2e3b0c['name']===_0x471a87[_0x2401f9][_0x78cf('0xd')]:null;});if(_0x4bbfd2){if(_0x471a87[_0x2401f9]['ignore']){_0x2194bc[_0x78cf('0x8e')](_0x5e86e2(_0x55ff9a['childModel'],_0x471a87[_0x2401f9]));}else{if(!_0x471a87[_0x2401f9]['autoAssociation']){_0x2194bc[_0x78cf('0x8e')](_0x17b87a(_0x4bbfd2,_0x471a87[_0x2401f9],_0x55ff9a[_0x78cf('0x13')]));}else{if(_0x4bbfd2[_0x78cf('0xb')]){_0x2194bc[_0x78cf('0x8e')](_0x449dd7(_0x4bbfd2,_0x471a87[_0x2401f9]));}}}}}return Promise['all'](_0x2194bc);})[_0x78cf('0x9')](function(_0x134583){var _0x2d62d9=_0x134583;var _0x578517=null;if(_0x2d62d9){_0x578517=_0x2d62d9[_0x78cf('0x8d')]===0x1?_0x2d62d9[0x0]:null;}if(!_0x578517&&!_0x2d62d9)return _0x37c71a;var _0x5bd49c=_0x46d12a[_0x55ff9a[_0x78cf('0x13')]]['rawAttributes'];_0x3a3375[_0x78cf('0xb')]=_[_0x78cf('0x95')](_0x5bd49c);_0x3a3375[_0x78cf('0x86')]=_[_0x78cf('0x95')](_0x42451e[_0x78cf('0x86')]);_0x3a3375['filters']=_[_0x78cf('0x96')](_0x3a3375['model'],_0x3a3375[_0x78cf('0x86')]);_0x3e995c[_0x78cf('0x97')]=_[_0x78cf('0x96')](_0x3a3375[_0x78cf('0xb')],qs[_0x78cf('0x98')](_0x42451e[_0x78cf('0x86')][_0x78cf('0x98')]));_0x3e995c[_0x78cf('0x97')]=_0x3e995c[_0x78cf('0x97')]['length']?_0x3e995c[_0x78cf('0x97')]:_0x3a3375[_0x78cf('0xb')];if(!_0x42451e['query'][_0x78cf('0x99')](_0x78cf('0x9a'))){_0x3e995c[_0x78cf('0x9b')]=qs[_0x78cf('0x9b')](_0x42451e['query'][_0x78cf('0x9b')]);_0x3e995c[_0x78cf('0x9c')]=qs['offset'](_0x42451e[_0x78cf('0x86')][_0x78cf('0x9c')]);}_0x3e995c[_0x78cf('0x9d')]=qs[_0x78cf('0x9e')](_0x42451e['query'][_0x78cf('0x9e')]);_0x3e995c[_0x78cf('0x83')]=qs['filters'](_[_0x78cf('0x9f')](_0x42451e[_0x78cf('0x86')],_0x3a3375[_0x78cf('0xa0')]));if(_0x42451e[_0x78cf('0x86')][_0x78cf('0x5')]){_0x3e995c[_0x78cf('0x83')]=_[_0x78cf('0xa1')](_0x3e995c['where'],{'$or':_['map'](_0x5bd49c,function(_0xf61682){if(_0xf61682[_0x78cf('0xa2')][_0x78cf('0xa3')]!=='VIRTUAL'){var _0x14e36d={};_0x14e36d[_0xf61682[_0x78cf('0x6')]]={'$like':'%'+_0x42451e['query'][_0x78cf('0x5')]+'%'};return _0x14e36d;}})});}var _0x4a0ee1=[];var _0x1ded45=null;var _0x352bc2={};if(_0x578517){_0x1ded45=_[_0x78cf('0x90')](_0x5cdc8d,[_0x78cf('0xd'),_0x578517['name']]);if(_0x1ded45[_0x78cf('0x6')]){_0x352bc2={};if(_0x55ff9a[_0x78cf('0x13')]===_0x78cf('0xf')){_0x352bc2[_0x1ded45[_0x78cf('0xa4')]]=_[_0x78cf('0xc')](_0x578517[_0x78cf('0xa')],'id');}else{_0x352bc2[_0x1ded45[_0x78cf('0xa4')]]=_0x578517[_0x78cf('0xa')];}_0x4a0ee1[_0x78cf('0x8e')](_0x352bc2);}else{_0x3e995c['where']['id']=_0x578517[_0x78cf('0xa')];}}else{for(var _0xa9d265=0x0;_0xa9d265<_0x2d62d9['length'];_0xa9d265++){_0x1ded45=_[_0x78cf('0x90')](_0x5cdc8d,[_0x78cf('0xd'),_0x2d62d9[_0xa9d265][_0x78cf('0xd')]]);if(_0x1ded45[_0x78cf('0x6')]){_0x352bc2={};_0x352bc2[_0x1ded45['foreignKey']]=_0x2d62d9[_0xa9d265][_0x78cf('0xa')];_0x4a0ee1[_0x78cf('0x8e')](_0x352bc2);}else{if(!_0x3e995c['where']['id'])_0x3e995c['where']['id']=[];_0x2d62d9[_0xa9d265][_0x78cf('0xa')][_0x78cf('0xa5')](function(_0xa59d3d){_0x3e995c[_0x78cf('0x83')]['id']['push'](_0xa59d3d);});}}}if(!_[_0x78cf('0x93')](_0x4a0ee1)){_0x3e995c[_0x78cf('0x83')]=_['merge'](_0x3e995c[_0x78cf('0x83')],{'$and':{'$or':_0x4a0ee1}});}_0x3e995c=_[_0x78cf('0xa1')]({},_0x3e995c,_0x42451e[_0x78cf('0xa6')]);if(_0x578517&&!_0x578517[_0x78cf('0xa7')]&&_0x55ff9a[_0x78cf('0x13')]===_0x78cf('0xf')){if(_0x42451e[_0x78cf('0x86')][_0x78cf('0xa8')]){_0x3e995c[_0x78cf('0xa9')]=[{'all':!![]}];}return _0x46d12a[_0x55ff9a[_0x78cf('0x13')]]['findAll'](_0x3e995c)[_0x78cf('0x9')](function(_0x3a17c7){var _0x2715a5=[];_0x3a17c7[_0x78cf('0xa5')](function(_0x232458){var _0x24c326;switch(_0x232458[_0x78cf('0xaa')]){case _0x78cf('0xab'):_0x24c326=_[_0x78cf('0x90')](_0x578517[_0x78cf('0xa')],function(_0xdf75c7){return _0xdf75c7['id']===_0x232458[_0x78cf('0x73')]&&_0xdf75c7[_0x78cf('0xa2')]==='DefaultReports';});break;case _0x78cf('0xac'):_0x24c326=_[_0x78cf('0x90')](_0x578517[_0x78cf('0xa')],function(_0x27fb9a){return _0x27fb9a['id']===_0x232458['reportId']&&_0x27fb9a[_0x78cf('0xa2')]==='CustomReports';});break;}if(_0x24c326)_0x2715a5[_0x78cf('0x8e')](_0x232458);});_0x37c71a[_0x78cf('0xad')]=_0x2715a5[_0x78cf('0x8d')];_0x37c71a[_0x78cf('0xae')]=_0x2715a5;return _0x37c71a;});}else{return _0x46d12a[_0x55ff9a[_0x78cf('0x13')]][_0x78cf('0xad')]({'where':_0x3e995c[_0x78cf('0x83')]})[_0x78cf('0x9')](function(_0x2c01c0){_0x37c71a[_0x78cf('0xad')]=_0x2c01c0;if(_0x42451e['query'][_0x78cf('0xa8')]){if(_0x55ff9a[_0x78cf('0x13')]===_0x78cf('0xaf')){_0x3e995c[_0x78cf('0xa9')]=[{'model':_0x46d12a[_0x78cf('0x67')],'as':_0x78cf('0xb0'),'attributes':['id','name','color'],'required':_0x42451e[_0x78cf('0x86')][_0x78cf('0xb1')]?!![]:![]},{'model':_0x46d12a['Tag'],'as':'ThroughTags','attributes':['id',_0x78cf('0xd'),'color'],'through':_0x42451e[_0x78cf('0x86')][_0x78cf('0xb1')]?{'attributes':[],'where':{'TagId':_0x42451e[_0x78cf('0x86')][_0x78cf('0xb1')]||undefined}}:{},'required':_0x42451e['query']['tag']?!![]:![]}];}else{_0x3e995c[_0x78cf('0xa9')]=[{'all':!![]}];}}return _0x46d12a[_0x55ff9a[_0x78cf('0x13')]][_0x78cf('0x8')](_0x3e995c);})[_0x78cf('0x9')](function(_0x4a68c9){_0x37c71a[_0x78cf('0xae')]=_0x4a68c9;if(_0x52565f===_0x78cf('0x2f')&&_0x42451e[_0x78cf('0x86')][_0x78cf('0xb2')]===_0x78cf('0xb3')){var _0x1e400a=[];for(var _0x937bbf=0x0;_0x937bbf<_0x37c71a['rows'][_0x78cf('0x8d')];_0x937bbf++){_0x1e400a[_0x78cf('0x8e')](_0x31b99c(_0x78cf('0xb4'),_0x37c71a[_0x78cf('0xae')][_0x937bbf][_0x78cf('0xb5')]));_0x1e400a[_0x78cf('0x8e')](_0x31b99c('sms',_0x37c71a[_0x78cf('0xae')][_0x937bbf]['dataValues']));_0x1e400a[_0x78cf('0x8e')](_0x31b99c(_0x78cf('0xb6'),_0x37c71a[_0x78cf('0xae')][_0x937bbf][_0x78cf('0xb5')]));_0x1e400a['push'](_0x31b99c('mail',_0x37c71a[_0x78cf('0xae')][_0x937bbf]['dataValues']));_0x1e400a[_0x78cf('0x8e')](_0x31b99c('openchannel',_0x37c71a[_0x78cf('0xae')][_0x937bbf]['dataValues']));_0x1e400a[_0x78cf('0x8e')](_0x31b99c(_0x78cf('0xb7'),_0x37c71a[_0x78cf('0xae')][_0x937bbf][_0x78cf('0xb5')]));}return Promise['all'](_0x1e400a)[_0x78cf('0x9')](function(){return _0x37c71a;});}return _0x37c71a;});}});}}});};
\ No newline at end of file
index 479e4bc..f2e6f3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9fc=['request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfile,\x20%s,\x20%s','result','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','http','defaults','redis','localhost','socket.io-emitter','./userProfile.socket','register','request','info'];(function(_0x423f98,_0xc2dfe0){var _0x5d1789=function(_0x405821){while(--_0x405821){_0x423f98['push'](_0x423f98['shift']());}};_0x5d1789(++_0xc2dfe0);}(_0xa9fc,0x19f));var _0xca9f=function(_0x3df9dd,_0x26f5cd){_0x3df9dd=_0x3df9dd-0x0;var _0x4f11e4=_0xa9fc[_0x3df9dd];return _0x4f11e4;};'use strict';var _=require(_0xca9f('0x0'));var util=require(_0xca9f('0x1'));var moment=require(_0xca9f('0x2'));var BPromise=require(_0xca9f('0x3'));var rs=require(_0xca9f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xca9f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xca9f('0x6'))(_0xca9f('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xca9f('0x8')]({'port':0x232a});config['redis']=_[_0xca9f('0x9')](config[_0xca9f('0xa')],{'host':_0xca9f('0xb'),'port':0x18eb});var socket=require(_0xca9f('0xc'))(new Redis(config[_0xca9f('0xa')]));require(_0xca9f('0xd'))[_0xca9f('0xe')](socket);function respondWithRpcPromise(_0x5ae48c,_0x5cd1db,_0x2bdf62){return new BPromise(function(_0x4326a5,_0x2f0af9){return client[_0xca9f('0xf')](_0x5ae48c,_0x2bdf62)['then'](function(_0x41bca1){logger[_0xca9f('0x10')]('UserProfile,\x20%s,\x20%s',_0x5cd1db,_0xca9f('0x11'));logger[_0xca9f('0x12')](_0xca9f('0x13'),_0x5cd1db,_0xca9f('0x11'),JSON[_0xca9f('0x14')](_0x41bca1));if(_0x41bca1[_0xca9f('0x15')]){if(_0x41bca1[_0xca9f('0x15')][_0xca9f('0x16')]===0x1f4){logger[_0xca9f('0x15')](_0xca9f('0x17'),_0x5cd1db,_0x41bca1['error']['message']);return _0x2f0af9(_0x41bca1[_0xca9f('0x15')]['message']);}logger['error'](_0xca9f('0x17'),_0x5cd1db,_0x41bca1[_0xca9f('0x15')]['message']);return _0x4326a5(_0x41bca1[_0xca9f('0x15')]['message']);}else{logger[_0xca9f('0x10')]('UserProfile,\x20%s,\x20%s',_0x5cd1db,_0xca9f('0x11'));_0x4326a5(_0x41bca1[_0xca9f('0x18')][_0xca9f('0x19')]);}})[_0xca9f('0x1a')](function(_0x25008f){logger['error'](_0xca9f('0x17'),_0x5cd1db,_0x25008f);_0x2f0af9(_0x25008f);});});}
\ No newline at end of file
+var _0x4732=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','localhost','socket.io-emitter','redis','./userProfile.socket','register','info','UserProfile,\x20%s,\x20%s','request\x20sent','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','randomstring'];(function(_0x4e4b7c,_0x36739c){var _0x27777a=function(_0x1ec768){while(--_0x1ec768){_0x4e4b7c['push'](_0x4e4b7c['shift']());}};_0x27777a(++_0x36739c);}(_0x4732,0x17d));var _0x2473=function(_0x874cf1,_0x2a4954){_0x874cf1=_0x874cf1-0x0;var _0x233579=_0x4732[_0x874cf1];return _0x233579;};'use strict';var _=require(_0x2473('0x0'));var util=require('util');var moment=require(_0x2473('0x1'));var BPromise=require('bluebird');var rs=require(_0x2473('0x2'));var fs=require('fs');var Redis=require(_0x2473('0x3'));var db=require(_0x2473('0x4'))['db'];var utils=require(_0x2473('0x5'));var logger=require(_0x2473('0x6'))(_0x2473('0x7'));var config=require(_0x2473('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2473('0x9')][_0x2473('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x2473('0xb'),'port':0x18eb});var socket=require(_0x2473('0xc'))(new Redis(config[_0x2473('0xd')]));require(_0x2473('0xe'))[_0x2473('0xf')](socket);function respondWithRpcPromise(_0x4900a5,_0x478f5f,_0x551f47){return new BPromise(function(_0x104596,_0x32fcb0){return client['request'](_0x4900a5,_0x551f47)['then'](function(_0x104e30){logger[_0x2473('0x10')](_0x2473('0x11'),_0x478f5f,_0x2473('0x12'));logger['debug'](_0x2473('0x13'),_0x478f5f,_0x2473('0x12'),JSON[_0x2473('0x14')](_0x104e30));if(_0x104e30[_0x2473('0x15')]){if(_0x104e30['error']['code']===0x1f4){logger['error'](_0x2473('0x11'),_0x478f5f,_0x104e30[_0x2473('0x15')][_0x2473('0x16')]);return _0x32fcb0(_0x104e30[_0x2473('0x15')][_0x2473('0x16')]);}logger[_0x2473('0x15')]('UserProfile,\x20%s,\x20%s',_0x478f5f,_0x104e30[_0x2473('0x15')][_0x2473('0x16')]);return _0x104596(_0x104e30[_0x2473('0x15')][_0x2473('0x16')]);}else{logger[_0x2473('0x10')](_0x2473('0x11'),_0x478f5f,_0x2473('0x12'));_0x104596(_0x104e30['result'][_0x2473('0x16')]);}})[_0x2473('0x17')](function(_0x31de9b){logger[_0x2473('0x15')](_0x2473('0x11'),_0x478f5f,_0x31de9b);_0x32fcb0(_0x31de9b);});});}
\ No newline at end of file
index 374972d..b2a06b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe894=['userProfile:','save','remove','emit','removeListener','register','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe894,0x1f2));var _0x4e89=function(_0x479f47,_0x3d619a){_0x479f47=_0x479f47-0x0;var _0xc3fac2=_0xe894[_0x479f47];return _0xc3fac2;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x4e89('0x0'),_0x4e89('0x1'),'update'];function createListener(_0x30f115,_0x1ddf90){return function(_0x5d52ed){_0x1ddf90[_0x4e89('0x2')](_0x30f115,_0x5d52ed);};}function removeListener(_0x24add2,_0x284ce6){return function(){UserProfileEvents[_0x4e89('0x3')](_0x24add2,_0x284ce6);};}exports[_0x4e89('0x4')]=function(_0x3d6f18){for(var _0x4182ef=0x0,_0x2af299=events[_0x4e89('0x5')];_0x4182ef<_0x2af299;_0x4182ef++){var _0x51e52a=events[_0x4182ef];var _0x37b2e2=createListener(_0x4e89('0x6')+_0x51e52a,_0x3d6f18);UserProfileEvents['on'](_0x51e52a,_0x37b2e2);}};
\ No newline at end of file
+var _0xf8ac=['register','userProfile:','./userProfile.events','save','remove','update','emit'];(function(_0x128db2,_0x3b9fd0){var _0x433e96=function(_0x2b9fc1){while(--_0x2b9fc1){_0x128db2['push'](_0x128db2['shift']());}};_0x433e96(++_0x3b9fd0);}(_0xf8ac,0x1ad));var _0xcf8a=function(_0x56daff,_0xadca9a){_0x56daff=_0x56daff-0x0;var _0x132c82=_0xf8ac[_0x56daff];return _0x132c82;};'use strict';var UserProfileEvents=require(_0xcf8a('0x0'));var events=[_0xcf8a('0x1'),_0xcf8a('0x2'),_0xcf8a('0x3')];function createListener(_0x30f3cc,_0x1c22a2){return function(_0x3b446d){_0x1c22a2[_0xcf8a('0x4')](_0x30f3cc,_0x3b446d);};}function removeListener(_0x518661,_0x2ac984){return function(){UserProfileEvents['removeListener'](_0x518661,_0x2ac984);};}exports[_0xcf8a('0x5')]=function(_0x51e69a){for(var _0x2d5275=0x0,_0x1f6331=events['length'];_0x2d5275<_0x1f6331;_0x2d5275++){var _0x54efca=events[_0x2d5275];var _0x42e559=createListener(_0xcf8a('0x6')+_0x54efca,_0x51e69a);UserProfileEvents['on'](_0x54efca,_0x42e559);}};
\ No newline at end of file
index 873cbef..0e1a996 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2538=['destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete'];(function(_0x1554e6,_0x28607d){var _0x4cafbf=function(_0x478aaf){while(--_0x478aaf){_0x1554e6['push'](_0x1554e6['shift']());}};_0x4cafbf(++_0x28607d);}(_0x2538,0x70));var _0x8253=function(_0x2b63c9,_0x9b77ef){_0x2b63c9=_0x2b63c9-0x0;var _0x5928c6=_0x2538[_0x2b63c9];return _0x5928c6;};'use strict';var multer=require('multer');var util=require(_0x8253('0x0'));var path=require(_0x8253('0x1'));var timeout=require(_0x8253('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8253('0x3'));var auth=require(_0x8253('0x4'));var interaction=require(_0x8253('0x5'));var config=require(_0x8253('0x6'));var controller=require(_0x8253('0x7'));router[_0x8253('0x8')]('/',auth[_0x8253('0x9')](),controller[_0x8253('0xa')]);router[_0x8253('0x8')](_0x8253('0xb'),auth[_0x8253('0x9')](),controller[_0x8253('0xc')]);router[_0x8253('0x8')](_0x8253('0xd'),auth['isAuthenticated'](),controller[_0x8253('0xe')]);router[_0x8253('0xf')]('/',auth[_0x8253('0x9')](),controller[_0x8253('0x10')]);router[_0x8253('0x11')]('/:id',auth[_0x8253('0x9')](),controller[_0x8253('0x12')]);router[_0x8253('0x13')](_0x8253('0xd'),auth[_0x8253('0x9')](),controller[_0x8253('0x14')]);module[_0x8253('0x15')]=router;
\ No newline at end of file
+var _0x76ae=['../../components/interaction/service','./userProfileResource.controller','get','isAuthenticated','/describe','/:id','post','put','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2c44ff,_0x17e033){var _0xafef2=function(_0x3404c7){while(--_0x3404c7){_0x2c44ff['push'](_0x2c44ff['shift']());}};_0xafef2(++_0x17e033);}(_0x76ae,0x104));var _0xe76a=function(_0x49ab0c,_0x149e80){_0x49ab0c=_0x49ab0c-0x0;var _0x99ea6c=_0x76ae[_0x49ab0c];return _0x99ea6c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe76a('0x0'));var timeout=require(_0xe76a('0x1'));var express=require(_0xe76a('0x2'));var router=express[_0xe76a('0x3')]();var fs_extra=require(_0xe76a('0x4'));var auth=require(_0xe76a('0x5'));var interaction=require(_0xe76a('0x6'));var config=require('../../config/environment');var controller=require(_0xe76a('0x7'));router[_0xe76a('0x8')]('/',auth[_0xe76a('0x9')](),controller['index']);router[_0xe76a('0x8')](_0xe76a('0xa'),auth[_0xe76a('0x9')](),controller['describe']);router[_0xe76a('0x8')](_0xe76a('0xb'),auth[_0xe76a('0x9')](),controller['show']);router[_0xe76a('0xc')]('/',auth[_0xe76a('0x9')](),controller['create']);router[_0xe76a('0xd')]('/:id',auth[_0xe76a('0x9')](),controller['update']);router['delete'](_0xe76a('0xb'),auth[_0xe76a('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 014d683..f56bf39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfdd2=['INTEGER','sequelize','exports','STRING'];(function(_0x119a2a,_0x52a94f){var _0x22d268=function(_0x40714c){while(--_0x40714c){_0x119a2a['push'](_0x119a2a['shift']());}};_0x22d268(++_0x52a94f);}(_0xfdd2,0x91));var _0x2fdd=function(_0x239a37,_0x1675c8){_0x239a37=_0x239a37-0x0;var _0x46db3c=_0xfdd2[_0x239a37];return _0x46db3c;};'use strict';var Sequelize=require(_0x2fdd('0x0'));module[_0x2fdd('0x1')]={'name':{'type':Sequelize[_0x2fdd('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x2fdd('0x3')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0xb62c=['exports','STRING','sequelize'];(function(_0x448bc9,_0x31da37){var _0x50c467=function(_0x3f08ca){while(--_0x3f08ca){_0x448bc9['push'](_0x448bc9['shift']());}};_0x50c467(++_0x31da37);}(_0xb62c,0xd4));var _0xcb62=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb62c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xcb62('0x0'));module[_0xcb62('0x1')]={'name':{'type':Sequelize[_0xcb62('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index 09e35cc..2e2d2bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8952=['filter','VIRTUAL','merge','options','findAll','rows','show','params','keys','includeAll','include','catch','create','body','destroy','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','end','stack','name','map','UserProfileResource','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x8952,0x17e));var _0x2895=function(_0x49bbf1,_0x2bfafe){_0x49bbf1=_0x49bbf1-0x0;var _0x5c229b=_0x8952[_0x49bbf1];return _0x5c229b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2895('0x0'));var zipdir=require(_0x2895('0x1'));var jsonpatch=require(_0x2895('0x2'));var rp=require(_0x2895('0x3'));var moment=require(_0x2895('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2895('0x5'));var util=require(_0x2895('0x6'));var path=require(_0x2895('0x7'));var sox=require('sox');var csv=require(_0x2895('0x8'));var ejs=require(_0x2895('0x9'));var fs=require('fs');var fs_extra=require(_0x2895('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2895('0xb'));var jsforce=require(_0x2895('0xc'));var deskjs=require(_0x2895('0xd'));var toCsv=require(_0x2895('0x8'));var querystring=require(_0x2895('0xe'));var Papa=require('papaparse');var Redis=require(_0x2895('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2895('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2895('0x11'));var utils=require(_0x2895('0x12'));var config=require(_0x2895('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x2895('0x14'))['db'];function respondWithStatusCode(_0x3924be,_0x4b1342){_0x4b1342=_0x4b1342||0xcc;return function(_0x32574c){if(_0x32574c){return _0x3924be[_0x2895('0x15')](_0x4b1342);}return _0x3924be['status'](_0x4b1342)['end']();};}function respondWithResult(_0x1d1493,_0x2ca2ac){_0x2ca2ac=_0x2ca2ac||0xc8;return function(_0x5777a0){if(_0x5777a0){return _0x1d1493[_0x2895('0x16')](_0x2ca2ac)[_0x2895('0x17')](_0x5777a0);}};}function respondWithFilteredResult(_0x27b50e,_0x1ae013){return function(_0x1d3659){if(_0x1d3659){var _0x2627e6=typeof _0x1ae013[_0x2895('0x18')]===_0x2895('0x19')&&typeof _0x1ae013[_0x2895('0x1a')]===_0x2895('0x19');var _0x10a1bf=_0x1d3659[_0x2895('0x1b')];var _0xbf8b63=_0x2627e6?0x0:_0x1ae013[_0x2895('0x18')];var _0x155124=_0x2627e6?_0x1d3659[_0x2895('0x1b')]:_0x1ae013[_0x2895('0x18')]+_0x1ae013[_0x2895('0x1a')];var _0x5a8eab;if(_0x155124>=_0x10a1bf){_0x155124=_0x10a1bf;_0x5a8eab=0xc8;}else{_0x5a8eab=0xce;}_0x27b50e['status'](_0x5a8eab);return _0x27b50e['set'](_0x2895('0x1c'),_0xbf8b63+'-'+_0x155124+'/'+_0x10a1bf)[_0x2895('0x17')](_0x1d3659);}return null;};}function patchUpdates(_0x3ec4da){return function(_0x593e47){try{jsonpatch[_0x2895('0x1d')](_0x593e47,_0x3ec4da,!![]);}catch(_0x190b79){return BPromise[_0x2895('0x1e')](_0x190b79);}return _0x593e47[_0x2895('0x1f')]();};}function saveUpdates(_0x8b75e0,_0x5dbbfe){return function(_0x30c6c3){if(_0x30c6c3){return _0x30c6c3[_0x2895('0x20')](_0x8b75e0)['then'](function(_0x142e58){return _0x142e58;});}return null;};}function removeEntity(_0x384357,_0x6f8ad4){return function(_0x511286){if(_0x511286){return _0x511286['destroy']()[_0x2895('0x21')](function(){_0x384357[_0x2895('0x16')](0xcc)[_0x2895('0x22')]();});}};}function handleEntityNotFound(_0x4a21cf,_0x3d3320){return function(_0x3690ce){if(!_0x3690ce){_0x4a21cf['sendStatus'](0x194);}return _0x3690ce;};}function handleError(_0x293ad3,_0x127540){_0x127540=_0x127540||0x1f4;return function(_0x2cd4df){logger['error'](_0x2cd4df[_0x2895('0x23')]);if(_0x2cd4df[_0x2895('0x24')]){delete _0x2cd4df['name'];}_0x293ad3[_0x2895('0x16')](_0x127540)['send'](_0x2cd4df);};}exports['index']=function(_0x18a935,_0x4ee2cc){var _0xfa4f85={},_0x381538={},_0x4fdd94={'count':0x0,'rows':[]};var _0x5574bf=_[_0x2895('0x25')](db[_0x2895('0x26')][_0x2895('0x27')],function(_0x14e343){return{'name':_0x14e343[_0x2895('0x28')],'type':_0x14e343[_0x2895('0x29')][_0x2895('0x2a')]};});_0x381538['model']=_[_0x2895('0x25')](_0x5574bf,_0x2895('0x24'));_0x381538[_0x2895('0x2b')]=_['keys'](_0x18a935[_0x2895('0x2b')]);_0x381538[_0x2895('0x2c')]=_[_0x2895('0x2d')](_0x381538[_0x2895('0x2e')],_0x381538['query']);_0xfa4f85[_0x2895('0x2f')]=_[_0x2895('0x2d')](_0x381538[_0x2895('0x2e')],qs[_0x2895('0x30')](_0x18a935[_0x2895('0x2b')]['fields']));_0xfa4f85['attributes']=_0xfa4f85[_0x2895('0x2f')][_0x2895('0x31')]?_0xfa4f85['attributes']:_0x381538[_0x2895('0x2e')];if(!_0x18a935['query'][_0x2895('0x32')](_0x2895('0x33'))){_0xfa4f85['limit']=qs[_0x2895('0x1a')](_0x18a935['query'][_0x2895('0x1a')]);_0xfa4f85['offset']=qs['offset'](_0x18a935[_0x2895('0x2b')][_0x2895('0x18')]);}_0xfa4f85[_0x2895('0x34')]=qs['sort'](_0x18a935[_0x2895('0x2b')][_0x2895('0x35')]);_0xfa4f85[_0x2895('0x36')]=qs[_0x2895('0x2c')](_[_0x2895('0x37')](_0x18a935[_0x2895('0x2b')],_0x381538[_0x2895('0x2c')]),_0x5574bf);if(_0x18a935[_0x2895('0x2b')][_0x2895('0x38')]){_0xfa4f85[_0x2895('0x36')]=_['merge'](_0xfa4f85[_0x2895('0x36')],{'$or':_[_0x2895('0x25')](_0x5574bf,function(_0x47413d){if(_0x47413d[_0x2895('0x29')]!==_0x2895('0x39')){var _0x12d7d8={};_0x12d7d8[_0x47413d[_0x2895('0x24')]]={'$like':'%'+_0x18a935['query']['filter']+'%'};return _0x12d7d8;}})});}_0xfa4f85=_[_0x2895('0x3a')]({},_0xfa4f85,_0x18a935[_0x2895('0x3b')]);var _0x24b9e0={'where':_0xfa4f85[_0x2895('0x36')]};return db[_0x2895('0x26')][_0x2895('0x1b')](_0x24b9e0)['then'](function(_0x5d18ef){_0x4fdd94[_0x2895('0x1b')]=_0x5d18ef;if(_0x18a935[_0x2895('0x2b')]['includeAll']){_0xfa4f85['include']=[{'all':!![]}];}return db[_0x2895('0x26')][_0x2895('0x3c')](_0xfa4f85);})[_0x2895('0x21')](function(_0x28967f){_0x4fdd94[_0x2895('0x3d')]=_0x28967f;return _0x4fdd94;})[_0x2895('0x21')](respondWithFilteredResult(_0x4ee2cc,_0xfa4f85))['catch'](handleError(_0x4ee2cc,null));};exports[_0x2895('0x3e')]=function(_0x2cfb24,_0x18ca24){var _0x1537fd={'raw':![],'where':{'id':_0x2cfb24[_0x2895('0x3f')]['id']}},_0x4af6d6={};_0x4af6d6[_0x2895('0x2e')]=_[_0x2895('0x40')](db[_0x2895('0x26')]['rawAttributes']);_0x4af6d6['query']=_[_0x2895('0x40')](_0x2cfb24[_0x2895('0x2b')]);_0x4af6d6[_0x2895('0x2c')]=_[_0x2895('0x2d')](_0x4af6d6[_0x2895('0x2e')],_0x4af6d6['query']);_0x1537fd['attributes']=_[_0x2895('0x2d')](_0x4af6d6[_0x2895('0x2e')],qs[_0x2895('0x30')](_0x2cfb24[_0x2895('0x2b')][_0x2895('0x30')]));_0x1537fd[_0x2895('0x2f')]=_0x1537fd[_0x2895('0x2f')]['length']?_0x1537fd[_0x2895('0x2f')]:_0x4af6d6[_0x2895('0x2e')];if(_0x2cfb24[_0x2895('0x2b')][_0x2895('0x41')]){_0x1537fd[_0x2895('0x42')]=[{'all':!![]}];}_0x1537fd=_[_0x2895('0x3a')]({},_0x1537fd,_0x2cfb24[_0x2895('0x3b')]);return db[_0x2895('0x26')]['find'](_0x1537fd)[_0x2895('0x21')](handleEntityNotFound(_0x18ca24,null))[_0x2895('0x21')](respondWithResult(_0x18ca24,null))[_0x2895('0x43')](handleError(_0x18ca24,null));};exports['create']=function(_0xc85aa1,_0x5307a9){return db['UserProfileResource'][_0x2895('0x44')](_0xc85aa1[_0x2895('0x45')],{})[_0x2895('0x21')](respondWithResult(_0x5307a9,0xc9))[_0x2895('0x43')](handleError(_0x5307a9,null));};exports[_0x2895('0x20')]=function(_0x3cc331,_0x11e53a){if(_0x3cc331['body']['id']){delete _0x3cc331[_0x2895('0x45')]['id'];}return db[_0x2895('0x26')]['find']({'where':{'id':_0x3cc331['params']['id']}})['then'](handleEntityNotFound(_0x11e53a,null))[_0x2895('0x21')](saveUpdates(_0x3cc331[_0x2895('0x45')],null))[_0x2895('0x21')](respondWithResult(_0x11e53a,null))[_0x2895('0x43')](handleError(_0x11e53a,null));};exports[_0x2895('0x46')]=function(_0x3c5261,_0xaca46c){return db[_0x2895('0x26')][_0x2895('0x47')]({'where':{'id':_0x3c5261[_0x2895('0x3f')]['id']}})[_0x2895('0x21')](handleEntityNotFound(_0xaca46c,null))[_0x2895('0x21')](removeEntity(_0xaca46c,null))[_0x2895('0x43')](handleError(_0xaca46c,null));};exports[_0x2895('0x48')]=function(_0x356d35,_0x3c1135){return db[_0x2895('0x26')][_0x2895('0x48')]()[_0x2895('0x21')](respondWithResult(_0x3c1135,null))[_0x2895('0x43')](handleError(_0x3c1135,null));};
\ No newline at end of file
+var _0xe2fe=['find','body','params','describe','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','api','../../mysqldb','sendStatus','status','offset','limit','count','set','Content-Range','json','reject','save','update','then','destroy','end','name','send','index','map','UserProfileResource','rawAttributes','type','key','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show'];(function(_0x5d5f03,_0x4d8cfc){var _0x4e1cb8=function(_0x1f84a){while(--_0x1f84a){_0x5d5f03['push'](_0x5d5f03['shift']());}};_0x4e1cb8(++_0x4d8cfc);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xee2f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xee2f('0x1'));var rp=require('request-promise');var moment=require(_0xee2f('0x2'));var BPromise=require(_0xee2f('0x3'));var Mustache=require(_0xee2f('0x4'));var util=require(_0xee2f('0x5'));var path=require(_0xee2f('0x6'));var sox=require('sox');var csv=require(_0xee2f('0x7'));var ejs=require(_0xee2f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee2f('0x9'));var squel=require(_0xee2f('0xa'));var crypto=require('crypto');var jsforce=require(_0xee2f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xee2f('0x7'));var querystring=require(_0xee2f('0xc'));var Papa=require('papaparse');var Redis=require(_0xee2f('0xd'));var authService=require(_0xee2f('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xee2f('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xee2f('0x10'))['db'];function respondWithStatusCode(_0x346dbc,_0xa13e7b){_0xa13e7b=_0xa13e7b||0xcc;return function(_0x100449){if(_0x100449){return _0x346dbc[_0xee2f('0x11')](_0xa13e7b);}return _0x346dbc[_0xee2f('0x12')](_0xa13e7b)['end']();};}function respondWithResult(_0x3861e6,_0x531c3a){_0x531c3a=_0x531c3a||0xc8;return function(_0x36db10){if(_0x36db10){return _0x3861e6[_0xee2f('0x12')](_0x531c3a)['json'](_0x36db10);}};}function respondWithFilteredResult(_0x445ba8,_0x145241){return function(_0x28b614){if(_0x28b614){var _0x1bbf7d=typeof _0x145241[_0xee2f('0x13')]==='undefined'&&typeof _0x145241[_0xee2f('0x14')]==='undefined';var _0x17d288=_0x28b614[_0xee2f('0x15')];var _0x502eb6=_0x1bbf7d?0x0:_0x145241['offset'];var _0x40b5bc=_0x1bbf7d?_0x28b614['count']:_0x145241[_0xee2f('0x13')]+_0x145241[_0xee2f('0x14')];var _0x28549d;if(_0x40b5bc>=_0x17d288){_0x40b5bc=_0x17d288;_0x28549d=0xc8;}else{_0x28549d=0xce;}_0x445ba8['status'](_0x28549d);return _0x445ba8[_0xee2f('0x16')](_0xee2f('0x17'),_0x502eb6+'-'+_0x40b5bc+'/'+_0x17d288)[_0xee2f('0x18')](_0x28b614);}return null;};}function patchUpdates(_0x21fdf4){return function(_0x3d892d){try{jsonpatch['apply'](_0x3d892d,_0x21fdf4,!![]);}catch(_0x5e73ad){return BPromise[_0xee2f('0x19')](_0x5e73ad);}return _0x3d892d[_0xee2f('0x1a')]();};}function saveUpdates(_0x1ea808,_0x203b2f){return function(_0x472e3b){if(_0x472e3b){return _0x472e3b[_0xee2f('0x1b')](_0x1ea808)[_0xee2f('0x1c')](function(_0x4d68d3){return _0x4d68d3;});}return null;};}function removeEntity(_0x250399,_0x2c47c5){return function(_0x15ceda){if(_0x15ceda){return _0x15ceda[_0xee2f('0x1d')]()[_0xee2f('0x1c')](function(){_0x250399[_0xee2f('0x12')](0xcc)[_0xee2f('0x1e')]();});}};}function handleEntityNotFound(_0x13013f,_0x382174){return function(_0x1e394f){if(!_0x1e394f){_0x13013f[_0xee2f('0x11')](0x194);}return _0x1e394f;};}function handleError(_0x168adc,_0x1c8454){_0x1c8454=_0x1c8454||0x1f4;return function(_0x45c4a0){logger['error'](_0x45c4a0['stack']);if(_0x45c4a0['name']){delete _0x45c4a0[_0xee2f('0x1f')];}_0x168adc[_0xee2f('0x12')](_0x1c8454)[_0xee2f('0x20')](_0x45c4a0);};}exports[_0xee2f('0x21')]=function(_0x892a4e,_0x3737fd){var _0x4d8398={},_0x3d3806={},_0x52e1fa={'count':0x0,'rows':[]};var _0x235697=_[_0xee2f('0x22')](db[_0xee2f('0x23')][_0xee2f('0x24')],function(_0x3ddbe3){return{'name':_0x3ddbe3['fieldName'],'type':_0x3ddbe3[_0xee2f('0x25')][_0xee2f('0x26')]};});_0x3d3806['model']=_['map'](_0x235697,_0xee2f('0x1f'));_0x3d3806['query']=_[_0xee2f('0x27')](_0x892a4e[_0xee2f('0x28')]);_0x3d3806['filters']=_[_0xee2f('0x29')](_0x3d3806['model'],_0x3d3806['query']);_0x4d8398['attributes']=_[_0xee2f('0x29')](_0x3d3806[_0xee2f('0x2a')],qs['fields'](_0x892a4e[_0xee2f('0x28')][_0xee2f('0x2b')]));_0x4d8398[_0xee2f('0x2c')]=_0x4d8398[_0xee2f('0x2c')][_0xee2f('0x2d')]?_0x4d8398['attributes']:_0x3d3806[_0xee2f('0x2a')];if(!_0x892a4e['query'][_0xee2f('0x2e')](_0xee2f('0x2f'))){_0x4d8398[_0xee2f('0x14')]=qs['limit'](_0x892a4e[_0xee2f('0x28')]['limit']);_0x4d8398[_0xee2f('0x13')]=qs['offset'](_0x892a4e[_0xee2f('0x28')][_0xee2f('0x13')]);}_0x4d8398[_0xee2f('0x30')]=qs[_0xee2f('0x31')](_0x892a4e[_0xee2f('0x28')][_0xee2f('0x31')]);_0x4d8398[_0xee2f('0x32')]=qs[_0xee2f('0x33')](_[_0xee2f('0x34')](_0x892a4e[_0xee2f('0x28')],_0x3d3806[_0xee2f('0x33')]),_0x235697);if(_0x892a4e['query'][_0xee2f('0x35')]){_0x4d8398['where']=_[_0xee2f('0x36')](_0x4d8398[_0xee2f('0x32')],{'$or':_[_0xee2f('0x22')](_0x235697,function(_0x2cbb89){if(_0x2cbb89[_0xee2f('0x25')]!==_0xee2f('0x37')){var _0x694950={};_0x694950[_0x2cbb89[_0xee2f('0x1f')]]={'$like':'%'+_0x892a4e['query']['filter']+'%'};return _0x694950;}})});}_0x4d8398=_['merge']({},_0x4d8398,_0x892a4e[_0xee2f('0x38')]);var _0x5483ae={'where':_0x4d8398[_0xee2f('0x32')]};return db['UserProfileResource']['count'](_0x5483ae)['then'](function(_0x58e361){_0x52e1fa[_0xee2f('0x15')]=_0x58e361;if(_0x892a4e[_0xee2f('0x28')][_0xee2f('0x39')]){_0x4d8398[_0xee2f('0x3a')]=[{'all':!![]}];}return db['UserProfileResource']['findAll'](_0x4d8398);})[_0xee2f('0x1c')](function(_0x5e12b7){_0x52e1fa['rows']=_0x5e12b7;return _0x52e1fa;})[_0xee2f('0x1c')](respondWithFilteredResult(_0x3737fd,_0x4d8398))[_0xee2f('0x3b')](handleError(_0x3737fd,null));};exports[_0xee2f('0x3c')]=function(_0x54130b,_0x3bc173){var _0x27c447={'raw':![],'where':{'id':_0x54130b['params']['id']}},_0x19bd4d={};_0x19bd4d['model']=_[_0xee2f('0x27')](db[_0xee2f('0x23')][_0xee2f('0x24')]);_0x19bd4d[_0xee2f('0x28')]=_['keys'](_0x54130b[_0xee2f('0x28')]);_0x19bd4d[_0xee2f('0x33')]=_[_0xee2f('0x29')](_0x19bd4d[_0xee2f('0x2a')],_0x19bd4d[_0xee2f('0x28')]);_0x27c447[_0xee2f('0x2c')]=_[_0xee2f('0x29')](_0x19bd4d[_0xee2f('0x2a')],qs[_0xee2f('0x2b')](_0x54130b[_0xee2f('0x28')]['fields']));_0x27c447['attributes']=_0x27c447['attributes']['length']?_0x27c447[_0xee2f('0x2c')]:_0x19bd4d[_0xee2f('0x2a')];if(_0x54130b[_0xee2f('0x28')][_0xee2f('0x39')]){_0x27c447[_0xee2f('0x3a')]=[{'all':!![]}];}_0x27c447=_['merge']({},_0x27c447,_0x54130b[_0xee2f('0x38')]);return db[_0xee2f('0x23')][_0xee2f('0x3d')](_0x27c447)[_0xee2f('0x1c')](handleEntityNotFound(_0x3bc173,null))['then'](respondWithResult(_0x3bc173,null))['catch'](handleError(_0x3bc173,null));};exports['create']=function(_0x1609f0,_0x54cc44){return db['UserProfileResource']['create'](_0x1609f0['body'],{})[_0xee2f('0x1c')](respondWithResult(_0x54cc44,0xc9))[_0xee2f('0x3b')](handleError(_0x54cc44,null));};exports[_0xee2f('0x1b')]=function(_0x584383,_0x22506e){if(_0x584383['body']['id']){delete _0x584383[_0xee2f('0x3e')]['id'];}return db[_0xee2f('0x23')][_0xee2f('0x3d')]({'where':{'id':_0x584383[_0xee2f('0x3f')]['id']}})[_0xee2f('0x1c')](handleEntityNotFound(_0x22506e,null))['then'](saveUpdates(_0x584383['body'],null))[_0xee2f('0x1c')](respondWithResult(_0x22506e,null))['catch'](handleError(_0x22506e,null));};exports[_0xee2f('0x1d')]=function(_0x282e89,_0x1928f8){return db[_0xee2f('0x23')]['find']({'where':{'id':_0x282e89['params']['id']}})[_0xee2f('0x1c')](handleEntityNotFound(_0x1928f8,null))[_0xee2f('0x1c')](removeEntity(_0x1928f8,null))[_0xee2f('0x3b')](handleError(_0x1928f8,null));};exports[_0xee2f('0x40')]=function(_0x3acae6,_0x2a450f){return db[_0xee2f('0x23')][_0xee2f('0x40')]()[_0xee2f('0x1c')](respondWithResult(_0x2a450f,null))[_0xee2f('0x3b')](handleError(_0x2a450f,null));};
\ No newline at end of file
index b51b00a..725284a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5768=['moment','bluebird','path','rimraf','../../config/environment','./userProfileResource.attributes','define','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','../../config/logger','api'];(function(_0x60b4b5,_0x4b9f3c){var _0x5ce041=function(_0x3cb959){while(--_0x3cb959){_0x60b4b5['push'](_0x60b4b5['shift']());}};_0x5ce041(++_0x4b9f3c);}(_0x5768,0xcf));var _0x8576=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x5768[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require(_0x8576('0x0'));var util=require('util');var logger=require(_0x8576('0x1'))(_0x8576('0x2'));var moment=require(_0x8576('0x3'));var BPromise=require(_0x8576('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8576('0x5'));var rimraf=require(_0x8576('0x6'));var config=require(_0x8576('0x7'));var attributes=require(_0x8576('0x8'));module['exports']=function(_0x407380,_0x34c379){return _0x407380[_0x8576('0x9')]('UserProfileResource',attributes,{'tableName':_0x8576('0xa'),'paranoid':![],'indexes':[{'name':_0x8576('0xb'),'fields':[_0x8576('0xc'),_0x8576('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xfbd5=['exports','define','user_profile_has_resources','sectionId','util','api','moment','request-promise','path','../../config/environment','./userProfileResource.attributes'];(function(_0x4315f7,_0x5e14ed){var _0x3d7aea=function(_0x5a64ea){while(--_0x5a64ea){_0x4315f7['push'](_0x4315f7['shift']());}};_0x3d7aea(++_0x5e14ed);}(_0xfbd5,0xd5));var _0x5fbd=function(_0x2af026,_0x1c7509){_0x2af026=_0x2af026-0x0;var _0x274528=_0xfbd5[_0x2af026];return _0x274528;};'use strict';var _=require('lodash');var util=require(_0x5fbd('0x0'));var logger=require('../../config/logger')(_0x5fbd('0x1'));var moment=require(_0x5fbd('0x2'));var BPromise=require('bluebird');var rp=require(_0x5fbd('0x3'));var fs=require('fs');var path=require(_0x5fbd('0x4'));var rimraf=require('rimraf');var config=require(_0x5fbd('0x5'));var attributes=require(_0x5fbd('0x6'));module[_0x5fbd('0x7')]=function(_0x323c6c,_0x43a2c4){return _0x323c6c[_0x5fbd('0x8')]('UserProfileResource',attributes,{'tableName':_0x5fbd('0x9'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['resourceId',_0x5fbd('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index 659d186..c718a6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf0ae=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment'];(function(_0x10246b,_0x54ced1){var _0x42c7cb=function(_0x45cb89){while(--_0x45cb89){_0x10246b['push'](_0x10246b['shift']());}};_0x42c7cb(++_0x54ced1);}(_0xf0ae,0x14e));var _0xef0a=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xf0ae[_0x16d10f];return _0x50c823;};'use strict';var _=require('lodash');var util=require(_0xef0a('0x0'));var moment=require(_0xef0a('0x1'));var BPromise=require('bluebird');var rs=require(_0xef0a('0x2'));var fs=require('fs');var Redis=require(_0xef0a('0x3'));var db=require(_0xef0a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xef0a('0x5'))(_0xef0a('0x6'));var config=require(_0xef0a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xef0a('0x8')][_0xef0a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2bc81e,_0x2625b4,_0x47c779){return new BPromise(function(_0x2db868,_0x31fd79){return client[_0xef0a('0xa')](_0x2bc81e,_0x47c779)['then'](function(_0x13b267){logger[_0xef0a('0xb')](_0xef0a('0xc'),_0x2625b4,_0xef0a('0xd'));logger[_0xef0a('0xe')](_0xef0a('0xf'),_0x2625b4,_0xef0a('0xd'),JSON[_0xef0a('0x10')](_0x13b267));if(_0x13b267['error']){if(_0x13b267[_0xef0a('0x11')][_0xef0a('0x12')]===0x1f4){logger[_0xef0a('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x2625b4,_0x13b267[_0xef0a('0x11')]['message']);return _0x31fd79(_0x13b267[_0xef0a('0x11')]['message']);}logger[_0xef0a('0x11')](_0xef0a('0xc'),_0x2625b4,_0x13b267['error'][_0xef0a('0x13')]);return _0x2db868(_0x13b267[_0xef0a('0x11')][_0xef0a('0x13')]);}else{logger[_0xef0a('0xb')](_0xef0a('0xc'),_0x2625b4,'request\x20sent');_0x2db868(_0x13b267['result']['message']);}})[_0xef0a('0x14')](function(_0x4505b8){logger[_0xef0a('0x11')](_0xef0a('0xc'),_0x2625b4,_0x4505b8);_0x31fd79(_0x4505b8);});});}
\ No newline at end of file
+var _0x931e=['catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','request\x20sent','debug','stringify','error','code','message','info','UserProfileResource,\x20%s,\x20%s','result'];(function(_0x182575,_0x346aeb){var _0x16addb=function(_0x3221f8){while(--_0x3221f8){_0x182575['push'](_0x182575['shift']());}};_0x16addb(++_0x346aeb);}(_0x931e,0xdd));var _0xe931=function(_0x3f5203,_0x263446){_0x3f5203=_0x3f5203-0x0;var _0xd762c3=_0x931e[_0x3f5203];return _0xd762c3;};'use strict';var _=require(_0xe931('0x0'));var util=require(_0xe931('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe931('0x2'));var fs=require('fs');var Redis=require(_0xe931('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe931('0x4'));var logger=require(_0xe931('0x5'))(_0xe931('0x6'));var config=require('../../config/environment');var jayson=require(_0xe931('0x7'));var client=jayson['client'][_0xe931('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xbfe00f,_0x219eaa,_0x300b27){return new BPromise(function(_0x5e1f9e,_0x3bfbc7){return client[_0xe931('0x9')](_0xbfe00f,_0x300b27)['then'](function(_0x5d884b){logger['info']('UserProfileResource,\x20%s,\x20%s',_0x219eaa,_0xe931('0xa'));logger[_0xe931('0xb')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x219eaa,_0xe931('0xa'),JSON[_0xe931('0xc')](_0x5d884b));if(_0x5d884b[_0xe931('0xd')]){if(_0x5d884b[_0xe931('0xd')][_0xe931('0xe')]===0x1f4){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x219eaa,_0x5d884b[_0xe931('0xd')][_0xe931('0xf')]);return _0x3bfbc7(_0x5d884b[_0xe931('0xd')]['message']);}logger[_0xe931('0xd')]('UserProfileResource,\x20%s,\x20%s',_0x219eaa,_0x5d884b['error']['message']);return _0x5e1f9e(_0x5d884b[_0xe931('0xd')]['message']);}else{logger[_0xe931('0x10')](_0xe931('0x11'),_0x219eaa,'request\x20sent');_0x5e1f9e(_0x5d884b[_0xe931('0x12')][_0xe931('0xf')]);}})[_0xe931('0x13')](function(_0x25ff9b){logger[_0xe931('0xd')](_0xe931('0x11'),_0x219eaa,_0x25ff9b);_0x3bfbc7(_0x25ff9b);});});}
\ No newline at end of file
index 8a1c626..5bf6818 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x135e=['get','isAuthenticated','index','/describe','describe','show','create','put','/:id','update','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment'];(function(_0x23cd9f,_0x51b0b2){var _0x38467d=function(_0x4ecac7){while(--_0x4ecac7){_0x23cd9f['push'](_0x23cd9f['shift']());}};_0x38467d(++_0x51b0b2);}(_0x135e,0x185));var _0xe135=function(_0x5a4a62,_0xb8f417){_0x5a4a62=_0x5a4a62-0x0;var _0x28bed2=_0x135e[_0x5a4a62];return _0x28bed2;};'use strict';var multer=require(_0xe135('0x0'));var util=require(_0xe135('0x1'));var path=require(_0xe135('0x2'));var timeout=require(_0xe135('0x3'));var express=require(_0xe135('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe135('0x5'));var config=require(_0xe135('0x6'));var controller=require('./userProfileSection.controller');router[_0xe135('0x7')]('/',auth[_0xe135('0x8')](),controller[_0xe135('0x9')]);router[_0xe135('0x7')](_0xe135('0xa'),auth['isAuthenticated'](),controller[_0xe135('0xb')]);router[_0xe135('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xe135('0xc')]);router['post']('/',auth[_0xe135('0x8')](),controller[_0xe135('0xd')]);router[_0xe135('0xe')](_0xe135('0xf'),auth[_0xe135('0x8')](),controller[_0xe135('0x10')]);router['delete']('/:id',auth[_0xe135('0x8')](),controller['destroy']);module[_0xe135('0x11')]=router;
\ No newline at end of file
+var _0x1722=['/describe','isAuthenticated','describe','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','index'];(function(_0x5eaf27,_0x457b95){var _0xf91667=function(_0x51977e){while(--_0x51977e){_0x5eaf27['push'](_0x5eaf27['shift']());}};_0xf91667(++_0x457b95);}(_0x1722,0x184));var _0x2172=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x1722[_0x8c43de];return _0xa6591b;};'use strict';var multer=require(_0x2172('0x0'));var util=require(_0x2172('0x1'));var path=require(_0x2172('0x2'));var timeout=require(_0x2172('0x3'));var express=require('express');var router=express[_0x2172('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2172('0x5'));var interaction=require(_0x2172('0x6'));var config=require(_0x2172('0x7'));var controller=require(_0x2172('0x8'));router[_0x2172('0x9')]('/',auth['isAuthenticated'](),controller[_0x2172('0xa')]);router[_0x2172('0x9')](_0x2172('0xb'),auth[_0x2172('0xc')](),controller[_0x2172('0xd')]);router[_0x2172('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x2172('0xe')]);router[_0x2172('0xf')]('/',auth['isAuthenticated'](),controller[_0x2172('0x10')]);router[_0x2172('0x11')]('/:id',auth[_0x2172('0xc')](),controller[_0x2172('0x12')]);router[_0x2172('0x13')]('/:id',auth[_0x2172('0xc')](),controller[_0x2172('0x14')]);module['exports']=router;
\ No newline at end of file
index 8d0aaa7..4f0ae1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c00=['STRING','setDataValue','crudPermissions','join','getDataValue','split','sequelize','exports','INTEGER','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c00,0x1a0));var _0x09c0=function(_0x12dd11,_0x52b882){_0x12dd11=_0x12dd11-0x0;var _0x3a502b=_0x9c00[_0x12dd11];return _0x3a502b;};'use strict';var Sequelize=require(_0x09c0('0x0'));module[_0x09c0('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0x09c0('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x09c0('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x09c0('0x4')],'set':function(_0x2c702c){this[_0x09c0('0x5')](_0x09c0('0x6'),_0x2c702c?_0x2c702c[_0x09c0('0x7')](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this[_0x09c0('0x8')](_0x09c0('0x6'))[_0x09c0('0x9')](''):[];}}};
\ No newline at end of file
+var _0x80ed=['setDataValue','join','getDataValue','crudPermissions','split','sequelize','STRING','INTEGER','BOOLEAN'];(function(_0x2b77a0,_0x5acd68){var _0x544f49=function(_0xfd79e5){while(--_0xfd79e5){_0x2b77a0['push'](_0x2b77a0['shift']());}};_0x544f49(++_0x5acd68);}(_0x80ed,0x11c));var _0xd80e=function(_0xb6c3e9,_0x492486){_0xb6c3e9=_0xb6c3e9-0x0;var _0xc7ffc6=_0x80ed[_0xb6c3e9];return _0xc7ffc6;};'use strict';var Sequelize=require(_0xd80e('0x0'));module['exports']={'name':{'type':Sequelize[_0xd80e('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0xd80e('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xd80e('0x2')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xd80e('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xd80e('0x1')],'set':function(_0x2b742b){this[_0xd80e('0x4')]('crudPermissions',_0x2b742b?_0x2b742b[_0xd80e('0x5')](''):[]);},'get':function(){return this[_0xd80e('0x6')](_0xd80e('0x7'))?this['getDataValue'](_0xd80e('0x7'))[_0xd80e('0x8')](''):[];}}};
\ No newline at end of file
index 04d71ca..bc678fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe9c=['request-promise','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','map','UserProfileSection','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','merge','VIRTUAL','options','includeAll','catch','show','params','length','include','find','create','body','describe','rimraf','zip-dir','fast-json-patch'];(function(_0x5ea4a6,_0x309b56){var _0x4ea7e1=function(_0x4ce083){while(--_0x4ce083){_0x5ea4a6['push'](_0x5ea4a6['shift']());}};_0x4ea7e1(++_0x309b56);}(_0xbe9c,0xd5));var _0xcbe9=function(_0x1fa303,_0x157a99){_0x1fa303=_0x1fa303-0x0;var _0x483907=_0xbe9c[_0x1fa303];return _0x483907;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcbe9('0x0'));var zipdir=require(_0xcbe9('0x1'));var jsonpatch=require(_0xcbe9('0x2'));var rp=require(_0xcbe9('0x3'));var moment=require('moment');var BPromise=require(_0xcbe9('0x4'));var Mustache=require(_0xcbe9('0x5'));var util=require(_0xcbe9('0x6'));var path=require('path');var sox=require(_0xcbe9('0x7'));var csv=require('to-csv');var ejs=require(_0xcbe9('0x8'));var fs=require('fs');var fs_extra=require(_0xcbe9('0x9'));var _=require('lodash');var squel=require(_0xcbe9('0xa'));var crypto=require(_0xcbe9('0xb'));var jsforce=require(_0xcbe9('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xcbe9('0xd'));var querystring=require(_0xcbe9('0xe'));var Papa=require('papaparse');var Redis=require(_0xcbe9('0xf'));var authService=require(_0xcbe9('0x10'));var qs=require(_0xcbe9('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcbe9('0x12'));var logger=require('../../config/logger')(_0xcbe9('0x13'));var utils=require(_0xcbe9('0x14'));var config=require(_0xcbe9('0x15'));var licenseUtil=require(_0xcbe9('0x16'));var db=require(_0xcbe9('0x17'))['db'];function respondWithStatusCode(_0x92e947,_0x32ab34){_0x32ab34=_0x32ab34||0xcc;return function(_0x31de26){if(_0x31de26){return _0x92e947['sendStatus'](_0x32ab34);}return _0x92e947[_0xcbe9('0x18')](_0x32ab34)[_0xcbe9('0x19')]();};}function respondWithResult(_0x16fa77,_0x135231){_0x135231=_0x135231||0xc8;return function(_0x2245ba){if(_0x2245ba){return _0x16fa77[_0xcbe9('0x18')](_0x135231)[_0xcbe9('0x1a')](_0x2245ba);}};}function respondWithFilteredResult(_0x46f4ce,_0x2ba4e9){return function(_0x1f9007){if(_0x1f9007){var _0x535dd0=typeof _0x2ba4e9[_0xcbe9('0x1b')]===_0xcbe9('0x1c')&&typeof _0x2ba4e9['limit']==='undefined';var _0x3e96d4=_0x1f9007[_0xcbe9('0x1d')];var _0xc93353=_0x535dd0?0x0:_0x2ba4e9['offset'];var _0x4063df=_0x535dd0?_0x1f9007['count']:_0x2ba4e9[_0xcbe9('0x1b')]+_0x2ba4e9[_0xcbe9('0x1e')];var _0x1e023f;if(_0x4063df>=_0x3e96d4){_0x4063df=_0x3e96d4;_0x1e023f=0xc8;}else{_0x1e023f=0xce;}_0x46f4ce['status'](_0x1e023f);return _0x46f4ce[_0xcbe9('0x1f')](_0xcbe9('0x20'),_0xc93353+'-'+_0x4063df+'/'+_0x3e96d4)['json'](_0x1f9007);}return null;};}function patchUpdates(_0x4062e7){return function(_0xbfe5e7){try{jsonpatch[_0xcbe9('0x21')](_0xbfe5e7,_0x4062e7,!![]);}catch(_0x27419c){return BPromise[_0xcbe9('0x22')](_0x27419c);}return _0xbfe5e7[_0xcbe9('0x23')]();};}function saveUpdates(_0x3e2b17,_0x274d4f){return function(_0x96f16f){if(_0x96f16f){return _0x96f16f[_0xcbe9('0x24')](_0x3e2b17)[_0xcbe9('0x25')](function(_0x37867a){return _0x37867a;});}return null;};}function removeEntity(_0x5cd7cd,_0x188612){return function(_0x3dd1ed){if(_0x3dd1ed){return _0x3dd1ed[_0xcbe9('0x26')]()[_0xcbe9('0x25')](function(){_0x5cd7cd[_0xcbe9('0x18')](0xcc)[_0xcbe9('0x19')]();});}};}function handleEntityNotFound(_0x5a08e8,_0x5523bb){return function(_0x5e7b01){if(!_0x5e7b01){_0x5a08e8[_0xcbe9('0x27')](0x194);}return _0x5e7b01;};}function handleError(_0x2bd314,_0x1b225c){_0x1b225c=_0x1b225c||0x1f4;return function(_0x11ce57){logger[_0xcbe9('0x28')](_0x11ce57['stack']);if(_0x11ce57['name']){delete _0x11ce57[_0xcbe9('0x29')];}_0x2bd314[_0xcbe9('0x18')](_0x1b225c)[_0xcbe9('0x2a')](_0x11ce57);};}exports['index']=function(_0x2fa964,_0x3e87e8){var _0x1c55b1={},_0x2f3295={},_0x2e56d1={'count':0x0,'rows':[]};var _0x1fed3e=_[_0xcbe9('0x2b')](db[_0xcbe9('0x2c')][_0xcbe9('0x2d')],function(_0x297748){return{'name':_0x297748['fieldName'],'type':_0x297748[_0xcbe9('0x2e')][_0xcbe9('0x2f')]};});_0x2f3295[_0xcbe9('0x30')]=_[_0xcbe9('0x2b')](_0x1fed3e,'name');_0x2f3295['query']=_[_0xcbe9('0x31')](_0x2fa964[_0xcbe9('0x32')]);_0x2f3295['filters']=_[_0xcbe9('0x33')](_0x2f3295[_0xcbe9('0x30')],_0x2f3295['query']);_0x1c55b1[_0xcbe9('0x34')]=_[_0xcbe9('0x33')](_0x2f3295[_0xcbe9('0x30')],qs[_0xcbe9('0x35')](_0x2fa964['query'][_0xcbe9('0x35')]));_0x1c55b1[_0xcbe9('0x34')]=_0x1c55b1[_0xcbe9('0x34')]['length']?_0x1c55b1[_0xcbe9('0x34')]:_0x2f3295[_0xcbe9('0x30')];if(!_0x2fa964[_0xcbe9('0x32')][_0xcbe9('0x36')]('nolimit')){_0x1c55b1[_0xcbe9('0x1e')]=qs['limit'](_0x2fa964[_0xcbe9('0x32')][_0xcbe9('0x1e')]);_0x1c55b1[_0xcbe9('0x1b')]=qs[_0xcbe9('0x1b')](_0x2fa964[_0xcbe9('0x32')][_0xcbe9('0x1b')]);}_0x1c55b1[_0xcbe9('0x37')]=qs[_0xcbe9('0x38')](_0x2fa964[_0xcbe9('0x32')][_0xcbe9('0x38')]);_0x1c55b1[_0xcbe9('0x39')]=qs['filters'](_['pick'](_0x2fa964[_0xcbe9('0x32')],_0x2f3295[_0xcbe9('0x3a')]),_0x1fed3e);if(_0x2fa964[_0xcbe9('0x32')]['filter']){_0x1c55b1[_0xcbe9('0x39')]=_[_0xcbe9('0x3b')](_0x1c55b1['where'],{'$or':_[_0xcbe9('0x2b')](_0x1fed3e,function(_0x30a448){if(_0x30a448[_0xcbe9('0x2e')]!==_0xcbe9('0x3c')){var _0x4375f5={};_0x4375f5[_0x30a448[_0xcbe9('0x29')]]={'$like':'%'+_0x2fa964[_0xcbe9('0x32')]['filter']+'%'};return _0x4375f5;}})});}_0x1c55b1=_[_0xcbe9('0x3b')]({},_0x1c55b1,_0x2fa964[_0xcbe9('0x3d')]);var _0x5aa297={'where':_0x1c55b1[_0xcbe9('0x39')]};return db[_0xcbe9('0x2c')][_0xcbe9('0x1d')](_0x5aa297)[_0xcbe9('0x25')](function(_0x5da3b6){_0x2e56d1['count']=_0x5da3b6;if(_0x2fa964['query'][_0xcbe9('0x3e')]){_0x1c55b1['include']=[{'all':!![]}];}return db[_0xcbe9('0x2c')]['findAll'](_0x1c55b1);})[_0xcbe9('0x25')](function(_0x44aeb1){_0x2e56d1['rows']=_0x44aeb1;return _0x2e56d1;})[_0xcbe9('0x25')](respondWithFilteredResult(_0x3e87e8,_0x1c55b1))[_0xcbe9('0x3f')](handleError(_0x3e87e8,null));};exports[_0xcbe9('0x40')]=function(_0x19b44f,_0x1d6476){var _0x4e86cc={'raw':![],'where':{'id':_0x19b44f[_0xcbe9('0x41')]['id']}},_0x240c51={};_0x240c51[_0xcbe9('0x30')]=_[_0xcbe9('0x31')](db[_0xcbe9('0x2c')][_0xcbe9('0x2d')]);_0x240c51[_0xcbe9('0x32')]=_[_0xcbe9('0x31')](_0x19b44f[_0xcbe9('0x32')]);_0x240c51[_0xcbe9('0x3a')]=_[_0xcbe9('0x33')](_0x240c51['model'],_0x240c51[_0xcbe9('0x32')]);_0x4e86cc[_0xcbe9('0x34')]=_[_0xcbe9('0x33')](_0x240c51['model'],qs[_0xcbe9('0x35')](_0x19b44f[_0xcbe9('0x32')][_0xcbe9('0x35')]));_0x4e86cc['attributes']=_0x4e86cc[_0xcbe9('0x34')][_0xcbe9('0x42')]?_0x4e86cc[_0xcbe9('0x34')]:_0x240c51['model'];if(_0x19b44f[_0xcbe9('0x32')][_0xcbe9('0x3e')]){_0x4e86cc[_0xcbe9('0x43')]=[{'all':!![]}];}_0x4e86cc=_[_0xcbe9('0x3b')]({},_0x4e86cc,_0x19b44f['options']);return db[_0xcbe9('0x2c')][_0xcbe9('0x44')](_0x4e86cc)[_0xcbe9('0x25')](handleEntityNotFound(_0x1d6476,null))[_0xcbe9('0x25')](respondWithResult(_0x1d6476,null))[_0xcbe9('0x3f')](handleError(_0x1d6476,null));};exports[_0xcbe9('0x45')]=function(_0x10fa80,_0x33aff6){return db[_0xcbe9('0x2c')][_0xcbe9('0x45')](_0x10fa80[_0xcbe9('0x46')],{})['then'](respondWithResult(_0x33aff6,0xc9))['catch'](handleError(_0x33aff6,null));};exports[_0xcbe9('0x24')]=function(_0x57fbac,_0x48de37){if(_0x57fbac[_0xcbe9('0x46')]['id']){delete _0x57fbac['body']['id'];}return db['UserProfileSection'][_0xcbe9('0x44')]({'where':{'id':_0x57fbac[_0xcbe9('0x41')]['id']}})[_0xcbe9('0x25')](handleEntityNotFound(_0x48de37,null))['then'](saveUpdates(_0x57fbac[_0xcbe9('0x46')],null))['then'](respondWithResult(_0x48de37,null))[_0xcbe9('0x3f')](handleError(_0x48de37,null));};exports['destroy']=function(_0x48abbe,_0x44293a){return db[_0xcbe9('0x2c')][_0xcbe9('0x44')]({'where':{'id':_0x48abbe[_0xcbe9('0x41')]['id']}})[_0xcbe9('0x25')](handleEntityNotFound(_0x44293a,null))[_0xcbe9('0x25')](removeEntity(_0x44293a,null))[_0xcbe9('0x3f')](handleError(_0x44293a,null));};exports[_0xcbe9('0x47')]=function(_0x322027,_0x4b3187){return db[_0xcbe9('0x2c')]['describe']()[_0xcbe9('0x25')](respondWithResult(_0x4b3187,null))[_0xcbe9('0x3f')](handleError(_0x4b3187,null));};
\ No newline at end of file
+var _0x4693=['describe','eml-format','zip-dir','request-promise','bluebird','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','offset','undefined','limit','count','status','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','UserProfileSection','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','rawAttributes','find','catch','create','body'];(function(_0x110bb7,_0x56c479){var _0x1e6ac2=function(_0x27ca58){while(--_0x27ca58){_0x110bb7['push'](_0x110bb7['shift']());}};_0x1e6ac2(++_0x56c479);}(_0x4693,0x16e));var _0x3469=function(_0x39887c,_0x318a5b){_0x39887c=_0x39887c-0x0;var _0x12e5f8=_0x4693[_0x39887c];return _0x12e5f8;};'use strict';var emlformat=require(_0x3469('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3469('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3469('0x2'));var moment=require('moment');var BPromise=require(_0x3469('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x3469('0x4'));var csv=require(_0x3469('0x5'));var ejs=require(_0x3469('0x6'));var fs=require('fs');var fs_extra=require(_0x3469('0x7'));var _=require('lodash');var squel=require(_0x3469('0x8'));var crypto=require(_0x3469('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x3469('0xa'));var toCsv=require(_0x3469('0x5'));var querystring=require(_0x3469('0xb'));var Papa=require(_0x3469('0xc'));var Redis=require(_0x3469('0xd'));var authService=require(_0x3469('0xe'));var qs=require(_0x3469('0xf'));var as=require(_0x3469('0x10'));var hardwareService=require(_0x3469('0x11'));var logger=require('../../config/logger')(_0x3469('0x12'));var utils=require(_0x3469('0x13'));var config=require(_0x3469('0x14'));var licenseUtil=require(_0x3469('0x15'));var db=require(_0x3469('0x16'))['db'];function respondWithStatusCode(_0x117793,_0x2dab53){_0x2dab53=_0x2dab53||0xcc;return function(_0xc627c5){if(_0xc627c5){return _0x117793[_0x3469('0x17')](_0x2dab53);}return _0x117793['status'](_0x2dab53)['end']();};}function respondWithResult(_0x55fbc7,_0x474ccd){_0x474ccd=_0x474ccd||0xc8;return function(_0x115f1c){if(_0x115f1c){return _0x55fbc7['status'](_0x474ccd)['json'](_0x115f1c);}};}function respondWithFilteredResult(_0x457685,_0x4c64de){return function(_0x355a77){if(_0x355a77){var _0x1be7ca=typeof _0x4c64de[_0x3469('0x18')]===_0x3469('0x19')&&typeof _0x4c64de[_0x3469('0x1a')]===_0x3469('0x19');var _0x4cd6eb=_0x355a77[_0x3469('0x1b')];var _0x26d943=_0x1be7ca?0x0:_0x4c64de[_0x3469('0x18')];var _0x30a347=_0x1be7ca?_0x355a77[_0x3469('0x1b')]:_0x4c64de[_0x3469('0x18')]+_0x4c64de[_0x3469('0x1a')];var _0x4eb944;if(_0x30a347>=_0x4cd6eb){_0x30a347=_0x4cd6eb;_0x4eb944=0xc8;}else{_0x4eb944=0xce;}_0x457685[_0x3469('0x1c')](_0x4eb944);return _0x457685[_0x3469('0x1d')](_0x3469('0x1e'),_0x26d943+'-'+_0x30a347+'/'+_0x4cd6eb)[_0x3469('0x1f')](_0x355a77);}return null;};}function patchUpdates(_0x4fe8ee){return function(_0x3a938a){try{jsonpatch[_0x3469('0x20')](_0x3a938a,_0x4fe8ee,!![]);}catch(_0x22df3f){return BPromise['reject'](_0x22df3f);}return _0x3a938a[_0x3469('0x21')]();};}function saveUpdates(_0x11cca5,_0x269296){return function(_0x3f27db){if(_0x3f27db){return _0x3f27db[_0x3469('0x22')](_0x11cca5)[_0x3469('0x23')](function(_0x58a28e){return _0x58a28e;});}return null;};}function removeEntity(_0x3ca449,_0x597b96){return function(_0x537440){if(_0x537440){return _0x537440[_0x3469('0x24')]()[_0x3469('0x23')](function(){_0x3ca449[_0x3469('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3effb4,_0x2639c3){return function(_0x1ecfae){if(!_0x1ecfae){_0x3effb4[_0x3469('0x17')](0x194);}return _0x1ecfae;};}function handleError(_0x5dbcec,_0x3462ea){_0x3462ea=_0x3462ea||0x1f4;return function(_0xcdd42c){logger[_0x3469('0x25')](_0xcdd42c[_0x3469('0x26')]);if(_0xcdd42c[_0x3469('0x27')]){delete _0xcdd42c[_0x3469('0x27')];}_0x5dbcec[_0x3469('0x1c')](_0x3462ea)[_0x3469('0x28')](_0xcdd42c);};}exports[_0x3469('0x29')]=function(_0x3e7516,_0x290fee){var _0xf5f4c6={},_0x24dae7={},_0x3a68d0={'count':0x0,'rows':[]};var _0x17b31c=_['map'](db[_0x3469('0x2a')]['rawAttributes'],function(_0x23639a){return{'name':_0x23639a[_0x3469('0x2b')],'type':_0x23639a[_0x3469('0x2c')]['key']};});_0x24dae7[_0x3469('0x2d')]=_[_0x3469('0x2e')](_0x17b31c,_0x3469('0x27'));_0x24dae7[_0x3469('0x2f')]=_[_0x3469('0x30')](_0x3e7516[_0x3469('0x2f')]);_0x24dae7[_0x3469('0x31')]=_[_0x3469('0x32')](_0x24dae7['model'],_0x24dae7[_0x3469('0x2f')]);_0xf5f4c6[_0x3469('0x33')]=_['intersection'](_0x24dae7[_0x3469('0x2d')],qs[_0x3469('0x34')](_0x3e7516[_0x3469('0x2f')][_0x3469('0x34')]));_0xf5f4c6[_0x3469('0x33')]=_0xf5f4c6[_0x3469('0x33')]['length']?_0xf5f4c6[_0x3469('0x33')]:_0x24dae7[_0x3469('0x2d')];if(!_0x3e7516[_0x3469('0x2f')][_0x3469('0x35')]('nolimit')){_0xf5f4c6[_0x3469('0x1a')]=qs['limit'](_0x3e7516[_0x3469('0x2f')]['limit']);_0xf5f4c6[_0x3469('0x18')]=qs[_0x3469('0x18')](_0x3e7516[_0x3469('0x2f')][_0x3469('0x18')]);}_0xf5f4c6[_0x3469('0x36')]=qs[_0x3469('0x37')](_0x3e7516[_0x3469('0x2f')][_0x3469('0x37')]);_0xf5f4c6[_0x3469('0x38')]=qs[_0x3469('0x31')](_[_0x3469('0x39')](_0x3e7516['query'],_0x24dae7[_0x3469('0x31')]),_0x17b31c);if(_0x3e7516[_0x3469('0x2f')][_0x3469('0x3a')]){_0xf5f4c6[_0x3469('0x38')]=_[_0x3469('0x3b')](_0xf5f4c6[_0x3469('0x38')],{'$or':_[_0x3469('0x2e')](_0x17b31c,function(_0x4dfa8b){if(_0x4dfa8b[_0x3469('0x2c')]!==_0x3469('0x3c')){var _0x37b054={};_0x37b054[_0x4dfa8b[_0x3469('0x27')]]={'$like':'%'+_0x3e7516[_0x3469('0x2f')]['filter']+'%'};return _0x37b054;}})});}_0xf5f4c6=_['merge']({},_0xf5f4c6,_0x3e7516[_0x3469('0x3d')]);var _0x1c1e53={'where':_0xf5f4c6[_0x3469('0x38')]};return db['UserProfileSection'][_0x3469('0x1b')](_0x1c1e53)[_0x3469('0x23')](function(_0x2a5443){_0x3a68d0[_0x3469('0x1b')]=_0x2a5443;if(_0x3e7516[_0x3469('0x2f')][_0x3469('0x3e')]){_0xf5f4c6[_0x3469('0x3f')]=[{'all':!![]}];}return db[_0x3469('0x2a')]['findAll'](_0xf5f4c6);})['then'](function(_0x5016e9){_0x3a68d0[_0x3469('0x40')]=_0x5016e9;return _0x3a68d0;})[_0x3469('0x23')](respondWithFilteredResult(_0x290fee,_0xf5f4c6))['catch'](handleError(_0x290fee,null));};exports[_0x3469('0x41')]=function(_0x506004,_0x344b0b){var _0x21abad={'raw':![],'where':{'id':_0x506004[_0x3469('0x42')]['id']}},_0x43d1db={};_0x43d1db[_0x3469('0x2d')]=_[_0x3469('0x30')](db[_0x3469('0x2a')][_0x3469('0x43')]);_0x43d1db[_0x3469('0x2f')]=_[_0x3469('0x30')](_0x506004[_0x3469('0x2f')]);_0x43d1db['filters']=_['intersection'](_0x43d1db[_0x3469('0x2d')],_0x43d1db[_0x3469('0x2f')]);_0x21abad[_0x3469('0x33')]=_[_0x3469('0x32')](_0x43d1db['model'],qs[_0x3469('0x34')](_0x506004[_0x3469('0x2f')]['fields']));_0x21abad[_0x3469('0x33')]=_0x21abad[_0x3469('0x33')]['length']?_0x21abad['attributes']:_0x43d1db[_0x3469('0x2d')];if(_0x506004['query']['includeAll']){_0x21abad[_0x3469('0x3f')]=[{'all':!![]}];}_0x21abad=_[_0x3469('0x3b')]({},_0x21abad,_0x506004[_0x3469('0x3d')]);return db[_0x3469('0x2a')][_0x3469('0x44')](_0x21abad)[_0x3469('0x23')](handleEntityNotFound(_0x344b0b,null))[_0x3469('0x23')](respondWithResult(_0x344b0b,null))[_0x3469('0x45')](handleError(_0x344b0b,null));};exports[_0x3469('0x46')]=function(_0x3f9db9,_0x2cb146){return db[_0x3469('0x2a')][_0x3469('0x46')](_0x3f9db9['body'],{})['then'](respondWithResult(_0x2cb146,0xc9))[_0x3469('0x45')](handleError(_0x2cb146,null));};exports[_0x3469('0x22')]=function(_0x3d9f76,_0x325b39){if(_0x3d9f76[_0x3469('0x47')]['id']){delete _0x3d9f76[_0x3469('0x47')]['id'];}return db[_0x3469('0x2a')][_0x3469('0x44')]({'where':{'id':_0x3d9f76[_0x3469('0x42')]['id']}})[_0x3469('0x23')](handleEntityNotFound(_0x325b39,null))[_0x3469('0x23')](saveUpdates(_0x3d9f76[_0x3469('0x47')],null))[_0x3469('0x23')](respondWithResult(_0x325b39,null))[_0x3469('0x45')](handleError(_0x325b39,null));};exports[_0x3469('0x24')]=function(_0x14bbd3,_0x4044a2){return db[_0x3469('0x2a')][_0x3469('0x44')]({'where':{'id':_0x14bbd3[_0x3469('0x42')]['id']}})[_0x3469('0x23')](handleEntityNotFound(_0x4044a2,null))[_0x3469('0x23')](removeEntity(_0x4044a2,null))[_0x3469('0x45')](handleError(_0x4044a2,null));};exports['describe']=function(_0x367f22,_0xbf5591){return db[_0x3469('0x2a')][_0x3469('0x48')]()[_0x3469('0x23')](respondWithResult(_0xbf5591,null))[_0x3469('0x45')](handleError(_0xbf5591,null));};
\ No newline at end of file
index 0ccbd0c..e4e9fe3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6811=['UserProfileSection','sectionId','userProfileId','lodash','api','bluebird','path','rimraf','./userProfileSection.attributes','exports','define'];(function(_0x4823e1,_0x131754){var _0x2ce00e=function(_0x34dc4a){while(--_0x34dc4a){_0x4823e1['push'](_0x4823e1['shift']());}};_0x2ce00e(++_0x131754);}(_0x6811,0xf5));var _0x1681=function(_0x1862f6,_0x3f4349){_0x1862f6=_0x1862f6-0x0;var _0x2f3d67=_0x6811[_0x1862f6];return _0x2f3d67;};'use strict';var _=require(_0x1681('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1681('0x1'));var moment=require('moment');var BPromise=require(_0x1681('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1681('0x3'));var rimraf=require(_0x1681('0x4'));var config=require('../../config/environment');var attributes=require(_0x1681('0x5'));module[_0x1681('0x6')]=function(_0x58f3a1,_0x31af76){return _0x58f3a1[_0x1681('0x7')](_0x1681('0x8'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x1681('0x9'),_0x1681('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x38c4=['user_profile_has_sections','sectionId','userProfileId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./userProfileSection.attributes','exports','define','UserProfileSection'];(function(_0xecb73,_0x2c956e){var _0x533453=function(_0x4af60a){while(--_0x4af60a){_0xecb73['push'](_0xecb73['shift']());}};_0x533453(++_0x2c956e);}(_0x38c4,0x6c));var _0x438c=function(_0x1b9e29,_0x28a76e){_0x1b9e29=_0x1b9e29-0x0;var _0x44e3d6=_0x38c4[_0x1b9e29];return _0x44e3d6;};'use strict';var _=require(_0x438c('0x0'));var util=require(_0x438c('0x1'));var logger=require(_0x438c('0x2'))(_0x438c('0x3'));var moment=require(_0x438c('0x4'));var BPromise=require(_0x438c('0x5'));var rp=require(_0x438c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x438c('0x7'));var config=require('../../config/environment');var attributes=require(_0x438c('0x8'));module[_0x438c('0x9')]=function(_0x162a80,_0x456dd5){return _0x162a80[_0x438c('0xa')](_0x438c('0xb'),attributes,{'tableName':_0x438c('0xc'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x438c('0xd'),_0x438c('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index d6daa6a..a6fc09a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66dd=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x3857f6,_0x2f6ab0){var _0x581072=function(_0x3f9f10){while(--_0x3f9f10){_0x3857f6['push'](_0x3857f6['shift']());}};_0x581072(++_0x2f6ab0);}(_0x66dd,0xb8));var _0xd66d=function(_0x5b1f22,_0x374674){_0x5b1f22=_0x5b1f22-0x0;var _0x48d5c0=_0x66dd[_0x5b1f22];return _0x48d5c0;};'use strict';var _=require('lodash');var util=require(_0xd66d('0x0'));var moment=require(_0xd66d('0x1'));var BPromise=require(_0xd66d('0x2'));var rs=require(_0xd66d('0x3'));var fs=require('fs');var Redis=require(_0xd66d('0x4'));var db=require(_0xd66d('0x5'))['db'];var utils=require(_0xd66d('0x6'));var logger=require('../../config/logger')(_0xd66d('0x7'));var config=require(_0xd66d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd66d('0x9')][_0xd66d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40432c,_0x1bfd1c,_0x5c631c){return new BPromise(function(_0x4d2723,_0x174b22){return client[_0xd66d('0xb')](_0x40432c,_0x5c631c)[_0xd66d('0xc')](function(_0x5b5651){logger[_0xd66d('0xd')](_0xd66d('0xe'),_0x1bfd1c,'request\x20sent');logger[_0xd66d('0xf')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x1bfd1c,_0xd66d('0x10'),JSON[_0xd66d('0x11')](_0x5b5651));if(_0x5b5651[_0xd66d('0x12')]){if(_0x5b5651[_0xd66d('0x12')][_0xd66d('0x13')]===0x1f4){logger[_0xd66d('0x12')](_0xd66d('0xe'),_0x1bfd1c,_0x5b5651[_0xd66d('0x12')][_0xd66d('0x14')]);return _0x174b22(_0x5b5651['error'][_0xd66d('0x14')]);}logger['error'](_0xd66d('0xe'),_0x1bfd1c,_0x5b5651[_0xd66d('0x12')][_0xd66d('0x14')]);return _0x4d2723(_0x5b5651[_0xd66d('0x12')][_0xd66d('0x14')]);}else{logger[_0xd66d('0xd')]('UserProfileSection,\x20%s,\x20%s',_0x1bfd1c,_0xd66d('0x10'));_0x4d2723(_0x5b5651[_0xd66d('0x15')][_0xd66d('0x14')]);}})[_0xd66d('0x16')](function(_0x3ea3f7){logger['error'](_0xd66d('0xe'),_0x1bfd1c,_0x3ea3f7);_0x174b22(_0x3ea3f7);});});}
\ No newline at end of file
+var _0x91ed=['request\x20sent','error','code','message','info','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s'];(function(_0x5a16a6,_0x13eaa0){var _0x48e7b8=function(_0x4f0b7a){while(--_0x4f0b7a){_0x5a16a6['push'](_0x5a16a6['shift']());}};_0x48e7b8(++_0x13eaa0);}(_0x91ed,0x7f));var _0xd91e=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x91ed[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0xd91e('0x0'));var moment=require(_0xd91e('0x1'));var BPromise=require('bluebird');var rs=require(_0xd91e('0x2'));var fs=require('fs');var Redis=require(_0xd91e('0x3'));var db=require(_0xd91e('0x4'))['db'];var utils=require(_0xd91e('0x5'));var logger=require(_0xd91e('0x6'))(_0xd91e('0x7'));var config=require(_0xd91e('0x8'));var jayson=require(_0xd91e('0x9'));var client=jayson[_0xd91e('0xa')][_0xd91e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x470656,_0x2017a7,_0x489a16){return new BPromise(function(_0x38c14e,_0x160ec3){return client[_0xd91e('0xc')](_0x470656,_0x489a16)[_0xd91e('0xd')](function(_0x801fc4){logger['info'](_0xd91e('0xe'),_0x2017a7,'request\x20sent');logger[_0xd91e('0xf')](_0xd91e('0x10'),_0x2017a7,_0xd91e('0x11'),JSON['stringify'](_0x801fc4));if(_0x801fc4[_0xd91e('0x12')]){if(_0x801fc4[_0xd91e('0x12')][_0xd91e('0x13')]===0x1f4){logger[_0xd91e('0x12')](_0xd91e('0xe'),_0x2017a7,_0x801fc4[_0xd91e('0x12')][_0xd91e('0x14')]);return _0x160ec3(_0x801fc4[_0xd91e('0x12')][_0xd91e('0x14')]);}logger['error'](_0xd91e('0xe'),_0x2017a7,_0x801fc4[_0xd91e('0x12')][_0xd91e('0x14')]);return _0x38c14e(_0x801fc4[_0xd91e('0x12')][_0xd91e('0x14')]);}else{logger[_0xd91e('0x15')](_0xd91e('0xe'),_0x2017a7,_0xd91e('0x11'));_0x38c14e(_0x801fc4[_0xd91e('0x16')][_0xd91e('0x14')]);}})[_0xd91e('0x17')](function(_0x40f6ce){logger[_0xd91e('0x12')](_0xd91e('0xe'),_0x2017a7,_0x40f6ce);_0x160ec3(_0x40f6ce);});});}
\ No newline at end of file
index 2bd7311..daa79fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x487e6e,_0x9993f5){var _0x3b8eb5=function(_0x40bbbb){while(--_0x40bbbb){_0x487e6e['push'](_0x487e6e['shift']());}};_0x3b8eb5(++_0x9993f5);}(_0x70e0,0x17b));var _0x070e=function(_0x22b032,_0x442c5){_0x22b032=_0x22b032-0x0;var _0x523cec=_0x70e0[_0x22b032];return _0x523cec;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
+var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x42a4f4,_0x403c74){var _0x4de303=function(_0x158998){while(--_0x158998){_0x42a4f4['push'](_0x42a4f4['shift']());}};_0x4de303(++_0x403c74);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
index 13414b8..6c1fe51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3172=['INTEGER','sequelize','exports'];(function(_0x557c62,_0x263ab8){var _0x4caf80=function(_0x413a80){while(--_0x413a80){_0x557c62['push'](_0x557c62['shift']());}};_0x4caf80(++_0x263ab8);}(_0x3172,0x106));var _0x2317=function(_0xe8129c,_0x2fb03c){_0xe8129c=_0xe8129c-0x0;var _0x709fc5=_0x3172[_0xe8129c];return _0x709fc5;};'use strict';var Sequelize=require(_0x2317('0x0'));module[_0x2317('0x1')]={'penalty':{'type':Sequelize[_0x2317('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xa535=['sequelize','exports','INTEGER'];(function(_0x3bac56,_0x1eced9){var _0x202824=function(_0x4f945e){while(--_0x4f945e){_0x3bac56['push'](_0x3bac56['shift']());}};_0x202824(++_0x1eced9);}(_0xa535,0x1ad));var _0x5a53=function(_0x5db8eb,_0x57691b){_0x5db8eb=_0x5db8eb-0x0;var _0x20aa64=_0xa535[_0x5db8eb];return _0x20aa64;};'use strict';var Sequelize=require(_0x5a53('0x0'));module[_0x5a53('0x1')]={'penalty':{'type':Sequelize[_0x5a53('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 4ee931c..b510b3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x687b=['rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x44dba1,_0x270ad5){var _0x2fbd3f=function(_0x5e0865){while(--_0x5e0865){_0x44dba1['push'](_0x44dba1['shift']());}};_0x2fbd3f(++_0x270ad5);}(_0x687b,0x14a));var _0xb687=function(_0x45806b,_0x53eeae){_0x45806b=_0x45806b-0x0;var _0x3e228e=_0x687b[_0x45806b];return _0x3e228e;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var logger=require(_0xb687('0x2'))(_0xb687('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb687('0x4'));var fs=require('fs');var path=require(_0xb687('0x5'));var rimraf=require(_0xb687('0x6'));var config=require(_0xb687('0x7'));var attributes=require(_0xb687('0x8'));module[_0xb687('0x9')]=function(_0x16ccf3,_0xf43a1f){return _0x16ccf3[_0xb687('0xa')](_0xb687('0xb'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x126e=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','user_has_sms_queues'];(function(_0x40eb07,_0xb49ecb){var _0x57896f=function(_0x3f86a9){while(--_0x3f86a9){_0x40eb07['push'](_0x40eb07['shift']());}};_0x57896f(++_0xb49ecb);}(_0x126e,0x108));var _0xe126=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x126e[_0x3ff085];return _0x2b68c3;};'use strict';var _=require('lodash');var util=require(_0xe126('0x0'));var logger=require(_0xe126('0x1'))(_0xe126('0x2'));var moment=require(_0xe126('0x3'));var BPromise=require(_0xe126('0x4'));var rp=require(_0xe126('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe126('0x6'));var config=require(_0xe126('0x7'));var attributes=require(_0xe126('0x8'));module[_0xe126('0x9')]=function(_0x2f75a4,_0x2162bd){return _0x2f75a4[_0xe126('0xa')]('UserSmsQueue',attributes,{'tableName':_0xe126('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1f90143..6c76a6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe745=['UserSmsQueue,\x20%s,\x20%s','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','request\x20sent','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x2b6b58,_0x5b1340){var _0x11382b=function(_0x27aabb){while(--_0x27aabb){_0x2b6b58['push'](_0x2b6b58['shift']());}};_0x11382b(++_0x5b1340);}(_0xe745,0x93));var _0x5e74=function(_0x4fc310,_0x17478c){_0x4fc310=_0x4fc310-0x0;var _0xdf2563=_0xe745[_0x4fc310];return _0xdf2563;};'use strict';var _=require(_0x5e74('0x0'));var util=require(_0x5e74('0x1'));var moment=require(_0x5e74('0x2'));var BPromise=require(_0x5e74('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5e74('0x4'));var db=require(_0x5e74('0x5'))['db'];var utils=require(_0x5e74('0x6'));var logger=require(_0x5e74('0x7'))(_0x5e74('0x8'));var config=require(_0x5e74('0x9'));var jayson=require(_0x5e74('0xa'));var client=jayson[_0x5e74('0xb')][_0x5e74('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x213a31,_0x1859cc,_0x1619fd){return new BPromise(function(_0x1d43d5,_0xd6a7a){return client[_0x5e74('0xd')](_0x213a31,_0x1619fd)['then'](function(_0x160b8d){logger['info'](_0x5e74('0xe'),_0x1859cc,'request\x20sent');logger['debug'](_0x5e74('0xf'),_0x1859cc,'request\x20sent',JSON[_0x5e74('0x10')](_0x160b8d));if(_0x160b8d['error']){if(_0x160b8d['error'][_0x5e74('0x11')]===0x1f4){logger[_0x5e74('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x1859cc,_0x160b8d[_0x5e74('0x12')][_0x5e74('0x13')]);return _0xd6a7a(_0x160b8d['error']['message']);}logger[_0x5e74('0x12')](_0x5e74('0xe'),_0x1859cc,_0x160b8d['error'][_0x5e74('0x13')]);return _0x1d43d5(_0x160b8d[_0x5e74('0x12')][_0x5e74('0x13')]);}else{logger[_0x5e74('0x14')](_0x5e74('0xe'),_0x1859cc,_0x5e74('0x15'));_0x1d43d5(_0x160b8d[_0x5e74('0x16')][_0x5e74('0x13')]);}})['catch'](function(_0x1a412c){logger[_0x5e74('0x12')](_0x5e74('0xe'),_0x1859cc,_0x1a412c);_0xd6a7a(_0x1a412c);});});}
\ No newline at end of file
+var _0xad85=['info','UserSmsQueue,\x20%s,\x20%s','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then'];(function(_0x194873,_0x1f363c){var _0x56fd85=function(_0x45013d){while(--_0x45013d){_0x194873['push'](_0x194873['shift']());}};_0x56fd85(++_0x1f363c);}(_0xad85,0x1ab));var _0x5ad8=function(_0x26b9cb,_0x12bc4c){_0x26b9cb=_0x26b9cb-0x0;var _0x3f44e6=_0xad85[_0x26b9cb];return _0x3f44e6;};'use strict';var _=require('lodash');var util=require(_0x5ad8('0x0'));var moment=require(_0x5ad8('0x1'));var BPromise=require(_0x5ad8('0x2'));var rs=require(_0x5ad8('0x3'));var fs=require('fs');var Redis=require(_0x5ad8('0x4'));var db=require(_0x5ad8('0x5'))['db'];var utils=require(_0x5ad8('0x6'));var logger=require(_0x5ad8('0x7'))('rpc');var config=require(_0x5ad8('0x8'));var jayson=require(_0x5ad8('0x9'));var client=jayson['client'][_0x5ad8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27c1c6,_0x1ce1a5,_0x4abd76){return new BPromise(function(_0x540e84,_0x373fc9){return client[_0x5ad8('0xb')](_0x27c1c6,_0x4abd76)[_0x5ad8('0xc')](function(_0x3ed54c){logger[_0x5ad8('0xd')](_0x5ad8('0xe'),_0x1ce1a5,'request\x20sent');logger[_0x5ad8('0xf')](_0x5ad8('0x10'),_0x1ce1a5,_0x5ad8('0x11'),JSON[_0x5ad8('0x12')](_0x3ed54c));if(_0x3ed54c[_0x5ad8('0x13')]){if(_0x3ed54c['error'][_0x5ad8('0x14')]===0x1f4){logger['error'](_0x5ad8('0xe'),_0x1ce1a5,_0x3ed54c[_0x5ad8('0x13')]['message']);return _0x373fc9(_0x3ed54c[_0x5ad8('0x13')][_0x5ad8('0x15')]);}logger[_0x5ad8('0x13')](_0x5ad8('0xe'),_0x1ce1a5,_0x3ed54c[_0x5ad8('0x13')][_0x5ad8('0x15')]);return _0x540e84(_0x3ed54c[_0x5ad8('0x13')][_0x5ad8('0x15')]);}else{logger['info'](_0x5ad8('0xe'),_0x1ce1a5,'request\x20sent');_0x540e84(_0x3ed54c['result'][_0x5ad8('0x15')]);}})['catch'](function(_0x35808a){logger[_0x5ad8('0x13')](_0x5ad8('0xe'),_0x1ce1a5,_0x35808a);_0x373fc9(_0x35808a);});});}
\ No newline at end of file
index 098aee9..d50a177 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb1f8=['INTEGER','exports'];(function(_0x57116a,_0x4d0825){var _0x3ebcde=function(_0x34740d){while(--_0x34740d){_0x57116a['push'](_0x57116a['shift']());}};_0x3ebcde(++_0x4d0825);}(_0xb1f8,0x75));var _0x8b1f=function(_0x4ee465,_0x38e9bc){_0x4ee465=_0x4ee465-0x0;var _0x9a0893=_0xb1f8[_0x4ee465];return _0x9a0893;};'use strict';var Sequelize=require('sequelize');module[_0x8b1f('0x0')]={'UserId':{'type':Sequelize[_0x8b1f('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x8b1f('0x1')]}};
\ No newline at end of file
+var _0xaef5=['sequelize','INTEGER'];(function(_0x4b4f24,_0x5654a8){var _0x1c13d4=function(_0x4940bf){while(--_0x4940bf){_0x4b4f24['push'](_0x4b4f24['shift']());}};_0x1c13d4(++_0x5654a8);}(_0xaef5,0xa4));var _0x5aef=function(_0xc597d1,_0x5eaf2b){_0xc597d1=_0xc597d1-0x0;var _0x5e3932=_0xaef5[_0xc597d1];return _0x5e3932;};'use strict';var Sequelize=require(_0x5aef('0x0'));module['exports']={'UserId':{'type':Sequelize[_0x5aef('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x5aef('0x1')]}};
\ No newline at end of file
index 11ee798..09fc9e8 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(_0x55fa13,_0xbfac96){var _0xc27460=function(_0x2428ba){while(--_0x2428ba){_0x55fa13['push'](_0x55fa13['shift']());}};_0xc27460(++_0xbfac96);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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(_0x29f408,_0x4e7dcb){var _0x15d0c2=function(_0x13aa0d){while(--_0x13aa0d){_0x29f408['push'](_0x29f408['shift']());}};_0x15d0c2(++_0x4e7dcb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 49d637e..68b787f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2ce9e8,_0x3eee15){var _0x4e7a09=function(_0x594f55){while(--_0x594f55){_0x2ce9e8['push'](_0x2ce9e8['shift']());}};_0x4e7a09(++_0x3eee15);}(_0x70e0,0x17b));var _0x070e=function(_0x7d5881,_0x1a1db8){_0x7d5881=_0x7d5881-0x0;var _0x3fe4a4=_0x70e0[_0x7d5881];return _0x3fe4a4;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
+var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x1fc3aa,_0x1b92fd){var _0x11dd40=function(_0x4b8205){while(--_0x4b8205){_0x1fc3aa['push'](_0x1fc3aa['shift']());}};_0x11dd40(++_0x1b92fd);}(_0x9c44,0x178));var _0x49c4=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x9c44[_0x209941];return _0x1e8729;};'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 9378aea..ed119cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9384=['sequelize','exports','INTEGER'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x9384,0xc0));var _0x4938=function(_0x8b8564,_0x162976){_0x8b8564=_0x8b8564-0x0;var _0x360c61=_0x9384[_0x8b8564];return _0x360c61;};'use strict';var Sequelize=require(_0x4938('0x0'));module[_0x4938('0x1')]={'penalty':{'type':Sequelize[_0x4938('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x9d2d=['exports','INTEGER'];(function(_0x21c6b8,_0x16d6f6){var _0x39d474=function(_0x27dbf5){while(--_0x27dbf5){_0x21c6b8['push'](_0x21c6b8['shift']());}};_0x39d474(++_0x16d6f6);}(_0x9d2d,0x124));var _0xd9d2=function(_0x3f5a8c,_0x3e29fa){_0x3f5a8c=_0x3f5a8c-0x0;var _0x3f5b0a=_0x9d2d[_0x3f5a8c];return _0x3f5b0a;};'use strict';var Sequelize=require('sequelize');module[_0xd9d2('0x0')]={'penalty':{'type':Sequelize[_0xd9d2('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index 6347ecd..ae11ccf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3e6=['moment','bluebird','request-promise','rimraf','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api'];(function(_0x49750d,_0x36eb95){var _0x1730a3=function(_0x354d04){while(--_0x354d04){_0x49750d['push'](_0x49750d['shift']());}};_0x1730a3(++_0x36eb95);}(_0xf3e6,0x8b));var _0x6f3e=function(_0x410a9b,_0xac513e){_0x410a9b=_0x410a9b-0x0;var _0x2878b6=_0xf3e6[_0x410a9b];return _0x2878b6;};'use strict';var _=require(_0x6f3e('0x0'));var util=require(_0x6f3e('0x1'));var logger=require(_0x6f3e('0x2'))(_0x6f3e('0x3'));var moment=require(_0x6f3e('0x4'));var BPromise=require(_0x6f3e('0x5'));var rp=require(_0x6f3e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6f3e('0x7'));var config=require('../../config/environment');var attributes=require(_0x6f3e('0x8'));module[_0x6f3e('0x9')]=function(_0x406c34,_0x219e7f){return _0x406c34[_0x6f3e('0xa')](_0x6f3e('0xb'),attributes,{'tableName':_0x6f3e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe3ef=['rimraf','../../config/environment','exports','UserVoiceQueue','user_has_voice_queues','util','../../config/logger','moment','bluebird'];(function(_0x37ad82,_0x116821){var _0x474c19=function(_0x56bef3){while(--_0x56bef3){_0x37ad82['push'](_0x37ad82['shift']());}};_0x474c19(++_0x116821);}(_0xe3ef,0xdd));var _0xfe3e=function(_0x4cecd5,_0x1b5c89){_0x4cecd5=_0x4cecd5-0x0;var _0x199d39=_0xe3ef[_0x4cecd5];return _0x199d39;};'use strict';var _=require('lodash');var util=require(_0xfe3e('0x0'));var logger=require(_0xfe3e('0x1'))('api');var moment=require(_0xfe3e('0x2'));var BPromise=require(_0xfe3e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xfe3e('0x4'));var config=require(_0xfe3e('0x5'));var attributes=require('./userVoiceQueue.attributes');module[_0xfe3e('0x6')]=function(_0x402af4,_0x3bc278){return _0x402af4['define'](_0xfe3e('0x7'),attributes,{'tableName':_0xfe3e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a61d6ab..6594101 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x40e4=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','bluebird','randomstring'];(function(_0x519f4d,_0xa7eb4f){var _0x46eb30=function(_0x8e7755){while(--_0x8e7755){_0x519f4d['push'](_0x519f4d['shift']());}};_0x46eb30(++_0xa7eb4f);}(_0x40e4,0x151));var _0x440e=function(_0x441819,_0x5b8d0a){_0x441819=_0x441819-0x0;var _0x478882=_0x40e4[_0x441819];return _0x478882;};'use strict';var _=require(_0x440e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x440e('0x1'));var rs=require(_0x440e('0x2'));var fs=require('fs');var Redis=require(_0x440e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x440e('0x4'));var logger=require(_0x440e('0x5'))(_0x440e('0x6'));var config=require(_0x440e('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x440e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x29a430,_0x190cb6,_0x307e4d){return new BPromise(function(_0x43e079,_0x44bc7e){return client[_0x440e('0x9')](_0x29a430,_0x307e4d)[_0x440e('0xa')](function(_0x28751d){logger[_0x440e('0xb')](_0x440e('0xc'),_0x190cb6,'request\x20sent');logger['debug']('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x190cb6,_0x440e('0xd'),JSON[_0x440e('0xe')](_0x28751d));if(_0x28751d[_0x440e('0xf')]){if(_0x28751d[_0x440e('0xf')][_0x440e('0x10')]===0x1f4){logger[_0x440e('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x190cb6,_0x28751d[_0x440e('0xf')]['message']);return _0x44bc7e(_0x28751d[_0x440e('0xf')][_0x440e('0x11')]);}logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x190cb6,_0x28751d[_0x440e('0xf')][_0x440e('0x11')]);return _0x43e079(_0x28751d[_0x440e('0xf')][_0x440e('0x11')]);}else{logger[_0x440e('0xb')](_0x440e('0xc'),_0x190cb6,_0x440e('0xd'));_0x43e079(_0x28751d[_0x440e('0x12')]['message']);}})[_0x440e('0x13')](function(_0x1e91e8){logger[_0x440e('0xf')](_0x440e('0xc'),_0x190cb6,_0x1e91e8);_0x44bc7e(_0x1e91e8);});});}
\ No newline at end of file
+var _0x65bd=['ioredis','../../mysqldb','rpc','../../config/environment','request','then','info','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','UserVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x65bd,0x179));var _0xd65b=function(_0x2f3476,_0x37358e){_0x2f3476=_0x2f3476-0x0;var _0x16e7a0=_0x65bd[_0x2f3476];return _0x16e7a0;};'use strict';var _=require(_0xd65b('0x0'));var util=require('util');var moment=require(_0xd65b('0x1'));var BPromise=require('bluebird');var rs=require(_0xd65b('0x2'));var fs=require('fs');var Redis=require(_0xd65b('0x3'));var db=require(_0xd65b('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd65b('0x5'));var config=require(_0xd65b('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x20082d,_0x203896,_0x51faab){return new BPromise(function(_0x722db5,_0x4c9439){return client[_0xd65b('0x7')](_0x20082d,_0x51faab)[_0xd65b('0x8')](function(_0x2f5724){logger[_0xd65b('0x9')]('UserVoiceQueue,\x20%s,\x20%s',_0x203896,_0xd65b('0xa'));logger['debug'](_0xd65b('0xb'),_0x203896,'request\x20sent',JSON[_0xd65b('0xc')](_0x2f5724));if(_0x2f5724['error']){if(_0x2f5724['error'][_0xd65b('0xd')]===0x1f4){logger[_0xd65b('0xe')](_0xd65b('0xf'),_0x203896,_0x2f5724[_0xd65b('0xe')][_0xd65b('0x10')]);return _0x4c9439(_0x2f5724['error'][_0xd65b('0x10')]);}logger[_0xd65b('0xe')](_0xd65b('0xf'),_0x203896,_0x2f5724['error'][_0xd65b('0x10')]);return _0x722db5(_0x2f5724[_0xd65b('0xe')][_0xd65b('0x10')]);}else{logger[_0xd65b('0x9')](_0xd65b('0xf'),_0x203896,_0xd65b('0xa'));_0x722db5(_0x2f5724[_0xd65b('0x11')][_0xd65b('0x10')]);}})[_0xd65b('0x12')](function(_0x9c16fc){logger['error'](_0xd65b('0xf'),_0x203896,_0x9c16fc);_0x4c9439(_0x9c16fc);});});}
\ No newline at end of file
index 33a6f75..5d90b44 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(_0x51fb3c,_0x28a763){var _0x941d96=function(_0x91294c){while(--_0x91294c){_0x51fb3c['push'](_0x51fb3c['shift']());}};_0x941d96(++_0x28a763);}(_0x9c44,0x178));var _0x49c4=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x9c44[_0x1969a7];return _0x3d665f;};'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(_0x465579,_0x577a39){var _0x2899ef=function(_0x57cf67){while(--_0x57cf67){_0x465579['push'](_0x465579['shift']());}};_0x2899ef(++_0x577a39);}(_0x70e0,0x17b));var _0x070e=function(_0x553687,_0x2248f3){_0x553687=_0x553687-0x0;var _0x2acc24=_0x70e0[_0x553687];return _0x2acc24;};'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 0525c40..3a78ed7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee1e=['exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','sequelize'];(function(_0xe0b81f,_0x1fb734){var _0x290e5e=function(_0x19b8d3){while(--_0x19b8d3){_0xe0b81f['push'](_0xe0b81f['shift']());}};_0x290e5e(++_0x1fb734);}(_0xee1e,0x1e5));var _0xeee1=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0xee1e[_0x32b542];return _0x554d54;};'use strict';var Sequelize=require(_0xeee1('0x0'));module[_0xeee1('0x1')]={'uniqueid':{'type':Sequelize[_0xeee1('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xeee1('0x3')},'membername':{'type':Sequelize[_0xeee1('0x4')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0xeee1('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xeee1('0x5'),'comment':_0xeee1('0x3')},'VoiceQueueId':{'type':Sequelize[_0xeee1('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':_0xeee1('0x3')},'penalty':{'type':Sequelize[_0xeee1('0x2')](0xb),'defaultValue':0x0,'comment':_0xeee1('0x3')},'paused':{'type':Sequelize[_0xeee1('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}};
\ No newline at end of file
+var _0xb5a7=['STRING','queue_interface','sequelize','exports','INTEGER','Required\x20by\x20Asterisk'];(function(_0x3ceac4,_0xf57186){var _0x9e4fe8=function(_0x439e4f){while(--_0x439e4f){_0x3ceac4['push'](_0x3ceac4['shift']());}};_0x9e4fe8(++_0xf57186);}(_0xb5a7,0x146));var _0x7b5a=function(_0x1ae3b7,_0x87b9cb){_0x1ae3b7=_0x1ae3b7-0x0;var _0x43b3ee=_0xb5a7[_0x1ae3b7];return _0x43b3ee;};'use strict';var Sequelize=require(_0x7b5a('0x0'));module[_0x7b5a('0x1')]={'uniqueid':{'type':Sequelize[_0x7b5a('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x7b5a('0x3')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0x7b5a('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x7b5a('0x4')],'allowNull':![],'unique':_0x7b5a('0x5'),'comment':_0x7b5a('0x3')},'VoiceQueueId':{'type':Sequelize[_0x7b5a('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':_0x7b5a('0x3')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x7b5a('0x3')}};
\ No newline at end of file
index 33b718a..44b3d4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf79b=['setMaxListeners','update','emit','hook','exports','events','../../mysqldb','UserVoiceQueueRt'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf79b,0xbd));var _0xbf79=function(_0x4fd28b,_0x7315e3){_0x4fd28b=_0x4fd28b-0x0;var _0x379261=_0xf79b[_0x4fd28b];return _0x379261;};'use strict';var EventEmitter=require(_0xbf79('0x0'));var UserVoiceQueueRt=require(_0xbf79('0x1'))['db'][_0xbf79('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xbf79('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbf79('0x4'),'afterDestroy':'remove'};function emitEvent(_0xa669a0){return function(_0x3fe123,_0x44dbd8,_0x27e735){UserVoiceQueueRtEvents[_0xbf79('0x5')](_0xa669a0+':'+_0x3fe123['id'],_0x3fe123);UserVoiceQueueRtEvents[_0xbf79('0x5')](_0xa669a0,_0x3fe123);_0x27e735(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0xbf79('0x6')](e,emitEvent(event));}}module[_0xbf79('0x7')]=UserVoiceQueueRtEvents;
\ No newline at end of file
+var _0xf12e=['events','UserVoiceQueueRt','setMaxListeners','save','remove','emit','hasOwnProperty','exports'];(function(_0x18dc3b,_0x518d29){var _0x1c103c=function(_0x48cc0a){while(--_0x48cc0a){_0x18dc3b['push'](_0x18dc3b['shift']());}};_0x1c103c(++_0x518d29);}(_0xf12e,0xb0));var _0xef12=function(_0x4bb265,_0x5a3252){_0x4bb265=_0x4bb265-0x0;var _0x33430a=_0xf12e[_0x4bb265];return _0x33430a;};'use strict';var EventEmitter=require(_0xef12('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0xef12('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xef12('0x2')](0x0);var events={'afterCreate':_0xef12('0x3'),'afterUpdate':'update','afterDestroy':_0xef12('0x4')};function emitEvent(_0xb715ac){return function(_0x1c1d03,_0x51a54d,_0xea48e2){UserVoiceQueueRtEvents[_0xef12('0x5')](_0xb715ac+':'+_0x1c1d03['id'],_0x1c1d03);UserVoiceQueueRtEvents[_0xef12('0x5')](_0xb715ac,_0x1c1d03);_0xea48e2(null);};}for(var e in events){if(events[_0xef12('0x6')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0xef12('0x7')]=UserVoiceQueueRtEvents;
\ No newline at end of file
index e4602bf..a33ed23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x494c=['exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x19425a,_0x51b9cc){var _0x102f5b=function(_0x595ddc){while(--_0x595ddc){_0x19425a['push'](_0x19425a['shift']());}};_0x102f5b(++_0x51b9cc);}(_0x494c,0x154));var _0xc494=function(_0x2d84c7,_0x415495){_0x2d84c7=_0x2d84c7-0x0;var _0x5329c7=_0x494c[_0x2d84c7];return _0x5329c7;};'use strict';var _=require(_0xc494('0x0'));var util=require(_0xc494('0x1'));var logger=require('../../config/logger')(_0xc494('0x2'));var moment=require(_0xc494('0x3'));var BPromise=require(_0xc494('0x4'));var rp=require(_0xc494('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc494('0x6'));var config=require(_0xc494('0x7'));var attributes=require('./userVoiceQueueRt.attributes');module[_0xc494('0x8')]=function(_0x37be5f,_0x42e483){return _0x37be5f[_0xc494('0x9')](_0xc494('0xa'),attributes,{'tableName':_0xc494('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa439=['user_has_voice_queues_rt','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt'];(function(_0x3bf53e,_0x505cc2){var _0x2aed05=function(_0x1bab02){while(--_0x1bab02){_0x3bf53e['push'](_0x3bf53e['shift']());}};_0x2aed05(++_0x505cc2);}(_0xa439,0x121));var _0x9a43=function(_0x3abbf5,_0x2644f9){_0x3abbf5=_0x3abbf5-0x0;var _0x1727d8=_0xa439[_0x3abbf5];return _0x1727d8;};'use strict';var _=require(_0x9a43('0x0'));var util=require('util');var logger=require(_0x9a43('0x1'))(_0x9a43('0x2'));var moment=require(_0x9a43('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9a43('0x4'));var rimraf=require(_0x9a43('0x5'));var config=require(_0x9a43('0x6'));var attributes=require(_0x9a43('0x7'));module[_0x9a43('0x8')]=function(_0x594fbf,_0x52eee2){return _0x594fbf[_0x9a43('0x9')](_0x9a43('0xa'),attributes,{'tableName':_0x9a43('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2dc72b3..f506e5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b06=['util','bluebird','randomstring','../../mysqldb','../../config/utils','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','message','result','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','stringify'];(function(_0x24adbe,_0x2d810c){var _0x280fec=function(_0x66bed4){while(--_0x66bed4){_0x24adbe['push'](_0x24adbe['shift']());}};_0x280fec(++_0x2d810c);}(_0x6b06,0x6c));var _0x66b0=function(_0x42bb25,_0x5c2e4b){_0x42bb25=_0x42bb25-0x0;var _0x401165=_0x6b06[_0x42bb25];return _0x401165;};'use strict';var _=require('lodash');var util=require(_0x66b0('0x0'));var moment=require('moment');var BPromise=require(_0x66b0('0x1'));var rs=require(_0x66b0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x66b0('0x3'))['db'];var utils=require(_0x66b0('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x66b0('0x5'));var client=jayson[_0x66b0('0x6')][_0x66b0('0x7')]({'port':0x232a});config[_0x66b0('0x8')]=_[_0x66b0('0x9')](config['redis'],{'host':_0x66b0('0xa'),'port':0x18eb});var socket=require(_0x66b0('0xb'))(new Redis(config[_0x66b0('0x8')]));require(_0x66b0('0xc'))[_0x66b0('0xd')](socket);function respondWithRpcPromise(_0x397f4a,_0x2d4408,_0x828166){return new BPromise(function(_0x3f270a,_0x56c72e){return client[_0x66b0('0xe')](_0x397f4a,_0x828166)[_0x66b0('0xf')](function(_0x437e5d){logger[_0x66b0('0x10')](_0x66b0('0x11'),_0x2d4408,_0x66b0('0x12'));logger[_0x66b0('0x13')](_0x66b0('0x14'),_0x2d4408,_0x66b0('0x12'),JSON['stringify'](_0x437e5d));if(_0x437e5d[_0x66b0('0x15')]){if(_0x437e5d['error'][_0x66b0('0x16')]===0x1f4){logger['error'](_0x66b0('0x11'),_0x2d4408,_0x437e5d[_0x66b0('0x15')][_0x66b0('0x17')]);return _0x56c72e(_0x437e5d[_0x66b0('0x15')]['message']);}logger[_0x66b0('0x15')](_0x66b0('0x11'),_0x2d4408,_0x437e5d[_0x66b0('0x15')][_0x66b0('0x17')]);return _0x3f270a(_0x437e5d['error'][_0x66b0('0x17')]);}else{logger[_0x66b0('0x10')](_0x66b0('0x11'),_0x2d4408,'request\x20sent');_0x3f270a(_0x437e5d[_0x66b0('0x18')][_0x66b0('0x17')]);}})['catch'](function(_0x4b849d){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x2d4408,_0x4b849d);_0x56c72e(_0x4b849d);});});}exports[_0x66b0('0x19')]=function(_0x2fa48d){var _0x256f4d=this;return new Promise(function(_0x45877a,_0x3ac69f){return db[_0x66b0('0x1a')][_0x66b0('0x1b')]({'raw':_0x2fa48d['options']?_0x2fa48d[_0x66b0('0x1c')][_0x66b0('0x1d')]===undefined?!![]:![]:!![],'where':_0x2fa48d[_0x66b0('0x1c')]?_0x2fa48d[_0x66b0('0x1c')][_0x66b0('0x1e')]||null:null,'attributes':[[db['sequelize']['fn'](_0x66b0('0x1f'),db[_0x66b0('0x20')]['fn']('IF',db[_0x66b0('0x20')][_0x66b0('0x21')](_0x66b0('0x22')))),'outboundQueuePauses']]})['then'](function(_0x58c69f){logger[_0x66b0('0x10')](_0x66b0('0x19'),_0x2fa48d);logger[_0x66b0('0x13')](_0x66b0('0x19'),_0x2fa48d,JSON[_0x66b0('0x23')](_0x58c69f));_0x45877a(_0x58c69f);})['catch'](function(_0x4d8e73){logger[_0x66b0('0x15')](_0x66b0('0x19'),_0x4d8e73['message'],_0x2fa48d);_0x3ac69f(_0x256f4d['error'](0x1f4,_0x4d8e73[_0x66b0('0x17')]));});});};
\ No newline at end of file
+var _0x19ad=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','then','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','UserVoiceQueueRt,\x20%s,\x20%s','message','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','literal','outboundQueuePauses','info','catch','moment','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x659c68,_0x317792){var _0x42a674=function(_0x39cb40){while(--_0x39cb40){_0x659c68['push'](_0x659c68['shift']());}};_0x42a674(++_0x317792);}(_0x19ad,0x163));var _0xd19a=function(_0x26018c,_0x3c0903){_0x26018c=_0x26018c-0x0;var _0x1efc45=_0x19ad[_0x26018c];return _0x1efc45;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd19a('0x0'));var BPromise=require('bluebird');var rs=require(_0xd19a('0x1'));var fs=require('fs');var Redis=require(_0xd19a('0x2'));var db=require(_0xd19a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xd19a('0x4'))(_0xd19a('0x5'));var config=require(_0xd19a('0x6'));var jayson=require(_0xd19a('0x7'));var client=jayson[_0xd19a('0x8')][_0xd19a('0x9')]({'port':0x232a});config[_0xd19a('0xa')]=_[_0xd19a('0xb')](config[_0xd19a('0xa')],{'host':_0xd19a('0xc'),'port':0x18eb});var socket=require(_0xd19a('0xd'))(new Redis(config[_0xd19a('0xa')]));require(_0xd19a('0xe'))[_0xd19a('0xf')](socket);function respondWithRpcPromise(_0x5eb9aa,_0x23bcd7,_0x6f5ee8){return new BPromise(function(_0x32864c,_0x1ddea2){return client['request'](_0x5eb9aa,_0x6f5ee8)[_0xd19a('0x10')](function(_0x15fb6f){logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x23bcd7,_0xd19a('0x11'));logger[_0xd19a('0x12')](_0xd19a('0x13'),_0x23bcd7,'request\x20sent',JSON[_0xd19a('0x14')](_0x15fb6f));if(_0x15fb6f[_0xd19a('0x15')]){if(_0x15fb6f[_0xd19a('0x15')][_0xd19a('0x16')]===0x1f4){logger[_0xd19a('0x15')](_0xd19a('0x17'),_0x23bcd7,_0x15fb6f[_0xd19a('0x15')][_0xd19a('0x18')]);return _0x1ddea2(_0x15fb6f[_0xd19a('0x15')]['message']);}logger[_0xd19a('0x15')](_0xd19a('0x17'),_0x23bcd7,_0x15fb6f[_0xd19a('0x15')][_0xd19a('0x18')]);return _0x32864c(_0x15fb6f[_0xd19a('0x15')][_0xd19a('0x18')]);}else{logger['info'](_0xd19a('0x17'),_0x23bcd7,_0xd19a('0x11'));_0x32864c(_0x15fb6f['result'][_0xd19a('0x18')]);}})['catch'](function(_0x371cec){logger['error'](_0xd19a('0x17'),_0x23bcd7,_0x371cec);_0x1ddea2(_0x371cec);});});}exports[_0xd19a('0x19')]=function(_0x30475a){var _0x1a320d=this;return new Promise(function(_0x143bc4,_0x5ee048){return db[_0xd19a('0x1a')][_0xd19a('0x1b')]({'raw':_0x30475a[_0xd19a('0x1c')]?_0x30475a[_0xd19a('0x1c')][_0xd19a('0x1d')]===undefined?!![]:![]:!![],'where':_0x30475a[_0xd19a('0x1c')]?_0x30475a[_0xd19a('0x1c')][_0xd19a('0x1e')]||null:null,'attributes':[[db[_0xd19a('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xd19a('0x1f')][_0xd19a('0x20')]('`paused`\x20=\x201,\x201,\x20null'))),_0xd19a('0x21')]]})['then'](function(_0xdfdac7){logger[_0xd19a('0x22')]('GetVoiceQueueRtPauses',_0x30475a);logger[_0xd19a('0x12')](_0xd19a('0x19'),_0x30475a,JSON[_0xd19a('0x14')](_0xdfdac7));_0x143bc4(_0xdfdac7);})[_0xd19a('0x23')](function(_0x24102a){logger[_0xd19a('0x15')]('GetVoiceQueueRtPauses',_0x24102a[_0xd19a('0x18')],_0x30475a);_0x5ee048(_0x1a320d['error'](0x1f4,_0x24102a[_0xd19a('0x18')]));});});};
\ No newline at end of file
index d900dd7..5b9d6c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff22=['./userVoiceQueueRt.events','save','update','emit','removeListener','register','length','userVoiceQueueRt:'];(function(_0x16df11,_0x436d04){var _0x491da6=function(_0x369638){while(--_0x369638){_0x16df11['push'](_0x16df11['shift']());}};_0x491da6(++_0x436d04);}(_0xff22,0x1a0));var _0x2ff2=function(_0x4c294d,_0x347a6b){_0x4c294d=_0x4c294d-0x0;var _0x102027=_0xff22[_0x4c294d];return _0x102027;};'use strict';var UserVoiceQueueRtEvents=require(_0x2ff2('0x0'));var events=[_0x2ff2('0x1'),'remove',_0x2ff2('0x2')];function createListener(_0x41445f,_0x2e0010){return function(_0x2425fd){_0x2e0010[_0x2ff2('0x3')](_0x41445f,_0x2425fd);};}function removeListener(_0x2caf71,_0x173f7c){return function(){UserVoiceQueueRtEvents[_0x2ff2('0x4')](_0x2caf71,_0x173f7c);};}exports[_0x2ff2('0x5')]=function(_0x47906b){for(var _0x21f303=0x0,_0x1b155f=events[_0x2ff2('0x6')];_0x21f303<_0x1b155f;_0x21f303++){var _0x21249c=events[_0x21f303];var _0x147214=createListener(_0x2ff2('0x7')+_0x21249c,_0x47906b);UserVoiceQueueRtEvents['on'](_0x21249c,_0x147214);}};
\ No newline at end of file
+var _0xfcf0=['removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','update'];(function(_0xaf733b,_0x59404b){var _0x51c343=function(_0x3a5360){while(--_0x3a5360){_0xaf733b['push'](_0xaf733b['shift']());}};_0x51c343(++_0x59404b);}(_0xfcf0,0x138));var _0x0fcf=function(_0xdbb6cb,_0x3b8fda){_0xdbb6cb=_0xdbb6cb-0x0;var _0x476b50=_0xfcf0[_0xdbb6cb];return _0x476b50;};'use strict';var UserVoiceQueueRtEvents=require(_0x0fcf('0x0'));var events=[_0x0fcf('0x1'),'remove',_0x0fcf('0x2')];function createListener(_0x3d8e0f,_0x366cfa){return function(_0xd744d1){_0x366cfa['emit'](_0x3d8e0f,_0xd744d1);};}function removeListener(_0x2fe6d8,_0x265968){return function(){UserVoiceQueueRtEvents[_0x0fcf('0x3')](_0x2fe6d8,_0x265968);};}exports[_0x0fcf('0x4')]=function(_0x1bace8){for(var _0x1a7b03=0x0,_0x61bbb9=events[_0x0fcf('0x5')];_0x1a7b03<_0x61bbb9;_0x1a7b03++){var _0x50c575=events[_0x1a7b03];var _0x1388d1=createListener(_0x0fcf('0x6')+_0x50c575,_0x1bace8);UserVoiceQueueRtEvents['on'](_0x50c575,_0x1388d1);}};
\ No newline at end of file
index a4e1f27..a97a8e3 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(_0x357a01,_0x1e57d0){var _0x252c1f=function(_0x53c71f){while(--_0x53c71f){_0x357a01['push'](_0x357a01['shift']());}};_0x252c1f(++_0x1e57d0);}(_0x9c44,0x178));var _0x49c4=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x9c44[_0x2e4aa2];return _0x5e6092;};'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(_0x34e419,_0x410694){var _0x43aee2=function(_0x3e364a){while(--_0x3e364a){_0x34e419['push'](_0x34e419['shift']());}};_0x43aee2(++_0x410694);}(_0x70e0,0x17b));var _0x070e=function(_0x10d850,_0x385e3b){_0x10d850=_0x10d850-0x0;var _0x4f5843=_0x70e0[_0x10d850];return _0x4f5843;};'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 43561e8..5be4ce0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x62c7=['exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x62c7,0x107));var _0x762c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x62c7[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0x762c('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xb99d=['sequelize','INTEGER'];(function(_0x46261b,_0xd68542){var _0x31e36f=function(_0xf5ed2b){while(--_0xf5ed2b){_0x46261b['push'](_0x46261b['shift']());}};_0x31e36f(++_0xd68542);}(_0xb99d,0xb8));var _0xdb99=function(_0x43b6c2,_0x1cb1c9){_0x43b6c2=_0x43b6c2-0x0;var _0x1cd681=_0xb99d[_0x43b6c2];return _0x1cd681;};'use strict';var Sequelize=require(_0xdb99('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xdb99('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index 006ce71..a434063 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1fb3=['path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','moment','bluebird','request-promise'];(function(_0x41f9c5,_0x599d1d){var _0x1c270a=function(_0x404254){while(--_0x404254){_0x41f9c5['push'](_0x41f9c5['shift']());}};_0x1c270a(++_0x599d1d);}(_0x1fb3,0x1b5));var _0x31fb=function(_0x3c691c,_0x75c10a){_0x3c691c=_0x3c691c-0x0;var _0x5703a0=_0x1fb3[_0x3c691c];return _0x5703a0;};'use strict';var _=require(_0x31fb('0x0'));var util=require(_0x31fb('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x31fb('0x2'));var BPromise=require(_0x31fb('0x3'));var rp=require(_0x31fb('0x4'));var fs=require('fs');var path=require(_0x31fb('0x5'));var rimraf=require(_0x31fb('0x6'));var config=require(_0x31fb('0x7'));var attributes=require(_0x31fb('0x8'));module[_0x31fb('0x9')]=function(_0x5de1f1,_0x3df57d){return _0x5de1f1[_0x31fb('0xa')](_0x31fb('0xb'),attributes,{'tableName':_0x31fb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd44e=['define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports'];(function(_0x17cf02,_0x554107){var _0x4b9510=function(_0x12badf){while(--_0x12badf){_0x17cf02['push'](_0x17cf02['shift']());}};_0x4b9510(++_0x554107);}(_0xd44e,0x123));var _0xed44=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd44e[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xed44('0x0'));var util=require(_0xed44('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xed44('0x2'));var rp=require(_0xed44('0x3'));var fs=require('fs');var path=require(_0xed44('0x4'));var rimraf=require(_0xed44('0x5'));var config=require(_0xed44('0x6'));var attributes=require(_0xed44('0x7'));module[_0xed44('0x8')]=function(_0x586c26,_0xb6357c){return _0x586c26[_0xed44('0x9')](_0xed44('0xa'),attributes,{'tableName':_0xed44('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f2aa68e..68bab36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf049=['UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','http','then','info'];(function(_0x1b0d61,_0x13dd22){var _0x4883d6=function(_0x2ddd86){while(--_0x2ddd86){_0x1b0d61['push'](_0x1b0d61['shift']());}};_0x4883d6(++_0x13dd22);}(_0xf049,0x148));var _0x9f04=function(_0x11fe6e,_0x23c1ce){_0x11fe6e=_0x11fe6e-0x0;var _0x155610=_0xf049[_0x11fe6e];return _0x155610;};'use strict';var _=require(_0x9f04('0x0'));var util=require(_0x9f04('0x1'));var moment=require(_0x9f04('0x2'));var BPromise=require(_0x9f04('0x3'));var rs=require(_0x9f04('0x4'));var fs=require('fs');var Redis=require(_0x9f04('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9f04('0x6'));var logger=require('../../config/logger')(_0x9f04('0x7'));var config=require(_0x9f04('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9f04('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5459ce,_0x24d460,_0x2dc30e){return new BPromise(function(_0x2bc4ad,_0x3a77b4){return client['request'](_0x5459ce,_0x2dc30e)[_0x9f04('0xa')](function(_0x70383e){logger[_0x9f04('0xb')](_0x9f04('0xc'),_0x24d460,_0x9f04('0xd'));logger[_0x9f04('0xe')](_0x9f04('0xf'),_0x24d460,_0x9f04('0xd'),JSON['stringify'](_0x70383e));if(_0x70383e[_0x9f04('0x10')]){if(_0x70383e[_0x9f04('0x10')][_0x9f04('0x11')]===0x1f4){logger[_0x9f04('0x10')](_0x9f04('0xc'),_0x24d460,_0x70383e[_0x9f04('0x10')][_0x9f04('0x12')]);return _0x3a77b4(_0x70383e[_0x9f04('0x10')][_0x9f04('0x12')]);}logger[_0x9f04('0x10')](_0x9f04('0xc'),_0x24d460,_0x70383e['error'][_0x9f04('0x12')]);return _0x2bc4ad(_0x70383e[_0x9f04('0x10')][_0x9f04('0x12')]);}else{logger[_0x9f04('0xb')](_0x9f04('0xc'),_0x24d460,'request\x20sent');_0x2bc4ad(_0x70383e[_0x9f04('0x13')][_0x9f04('0x12')]);}})['catch'](function(_0x513d70){logger['error'](_0x9f04('0xc'),_0x24d460,_0x513d70);_0x3a77b4(_0x513d70);});});}
\ No newline at end of file
+var _0xe004=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','UserWhatsappQueue,\x20%s,\x20%s','lodash'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xe004,0x109));var _0x4e00=function(_0x3b82f2,_0x43304f){_0x3b82f2=_0x3b82f2-0x0;var _0x559719=_0xe004[_0x3b82f2];return _0x559719;};'use strict';var _=require(_0x4e00('0x0'));var util=require(_0x4e00('0x1'));var moment=require(_0x4e00('0x2'));var BPromise=require(_0x4e00('0x3'));var rs=require(_0x4e00('0x4'));var fs=require('fs');var Redis=require(_0x4e00('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4e00('0x6'));var logger=require(_0x4e00('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4e00('0x8'));var client=jayson[_0x4e00('0x9')][_0x4e00('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x562d7e,_0x4824a8,_0x98c8d){return new BPromise(function(_0x556e19,_0x395019){return client[_0x4e00('0xb')](_0x562d7e,_0x98c8d)['then'](function(_0x3d5d86){logger['info']('UserWhatsappQueue,\x20%s,\x20%s',_0x4824a8,'request\x20sent');logger[_0x4e00('0xc')](_0x4e00('0xd'),_0x4824a8,_0x4e00('0xe'),JSON[_0x4e00('0xf')](_0x3d5d86));if(_0x3d5d86['error']){if(_0x3d5d86[_0x4e00('0x10')]['code']===0x1f4){logger[_0x4e00('0x10')]('UserWhatsappQueue,\x20%s,\x20%s',_0x4824a8,_0x3d5d86[_0x4e00('0x10')][_0x4e00('0x11')]);return _0x395019(_0x3d5d86[_0x4e00('0x10')]['message']);}logger[_0x4e00('0x10')](_0x4e00('0x12'),_0x4824a8,_0x3d5d86['error']['message']);return _0x556e19(_0x3d5d86['error']['message']);}else{logger['info'](_0x4e00('0x12'),_0x4824a8,'request\x20sent');_0x556e19(_0x3d5d86['result'][_0x4e00('0x11')]);}})['catch'](function(_0xce9fd4){logger[_0x4e00('0x10')](_0x4e00('0x12'),_0x4824a8,_0xce9fd4);_0x395019(_0xce9fd4);});});}
\ No newline at end of file
index 8acbe7f..6e6ffb5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcdd0=['exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','./variable.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcdd0,0xd9));var _0x0cdd=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xcdd0[_0x4bfac3];return _0x15f0f2;};'use strict';var multer=require(_0x0cdd('0x0'));var util=require(_0x0cdd('0x1'));var path=require(_0x0cdd('0x2'));var timeout=require(_0x0cdd('0x3'));var express=require('express');var router=express[_0x0cdd('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0cdd('0x5'));var config=require('../../config/environment');var controller=require(_0x0cdd('0x6'));router[_0x0cdd('0x7')]('/',auth[_0x0cdd('0x8')](),controller['index']);router[_0x0cdd('0x7')](_0x0cdd('0x9'),auth[_0x0cdd('0x8')](),controller[_0x0cdd('0xa')]);router[_0x0cdd('0xb')]('/',auth[_0x0cdd('0x8')](),controller[_0x0cdd('0xc')]);router[_0x0cdd('0xd')](_0x0cdd('0x9'),auth[_0x0cdd('0x8')](),controller[_0x0cdd('0xe')]);router[_0x0cdd('0xf')](_0x0cdd('0x9'),auth['isAuthenticated'](),controller[_0x0cdd('0x10')]);module[_0x0cdd('0x11')]=router;
\ No newline at end of file
+var _0x782e=['/:id','update','delete','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./variable.controller','get','index','isAuthenticated','post','create','put'];(function(_0xe8a89c,_0x654c01){var _0x3d956b=function(_0x1721b9){while(--_0x1721b9){_0xe8a89c['push'](_0xe8a89c['shift']());}};_0x3d956b(++_0x654c01);}(_0x782e,0xb9));var _0xe782=function(_0x3efbf4,_0x1f85c3){_0x3efbf4=_0x3efbf4-0x0;var _0x5d9ae1=_0x782e[_0x3efbf4];return _0x5d9ae1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe782('0x0'));var timeout=require(_0xe782('0x1'));var express=require('express');var router=express[_0xe782('0x2')]();var fs_extra=require(_0xe782('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xe782('0x4'));var config=require(_0xe782('0x5'));var controller=require(_0xe782('0x6'));router[_0xe782('0x7')]('/',auth['isAuthenticated'](),controller[_0xe782('0x8')]);router['get']('/:id',auth[_0xe782('0x9')](),controller['show']);router[_0xe782('0xa')]('/',auth[_0xe782('0x9')](),controller[_0xe782('0xb')]);router[_0xe782('0xc')](_0xe782('0xd'),auth[_0xe782('0x9')](),controller[_0xe782('0xe')]);router[_0xe782('0xf')](_0xe782('0xd'),auth[_0xe782('0x9')](),controller[_0xe782('0x10')]);module[_0xe782('0x11')]=router;
\ No newline at end of file
index bcb9ac4..0b8ddc4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x572a=['sequelize','STRING','name'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x572a,0x12f));var _0xa572=function(_0x3387bd,_0x3e232f){_0x3387bd=_0x3387bd-0x0;var _0x24b107=_0x572a[_0x3387bd];return _0x24b107;};'use strict';var Sequelize=require(_0xa572('0x0'));module['exports']={'name':{'type':Sequelize[_0xa572('0x1')],'unique':_0xa572('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa572('0x1')]}};
\ No newline at end of file
+var _0x4965=['STRING','name','sequelize','exports'];(function(_0x55d83d,_0x3241d8){var _0x25df7f=function(_0x224f76){while(--_0x224f76){_0x55d83d['push'](_0x55d83d['shift']());}};_0x25df7f(++_0x3241d8);}(_0x4965,0x66));var _0x5496=function(_0x5e3cbd,_0x2fd5cd){_0x5e3cbd=_0x5e3cbd-0x0;var _0x1ed1ce=_0x4965[_0x5e3cbd];return _0x1ed1ce;};'use strict';var Sequelize=require(_0x5496('0x0'));module[_0x5496('0x1')]={'name':{'type':Sequelize[_0x5496('0x2')],'unique':_0x5496('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 13c1024..2d7140e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd66c=['filter','merge','includeAll','findAll','catch','show','params','rawAttributes','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','get','Variables','stack','name','send','index','map','Variable','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick'];(function(_0x55086,_0x45224f){var _0x32cf53=function(_0x5c4f64){while(--_0x5c4f64){_0x55086['push'](_0x55086['shift']());}};_0x32cf53(++_0x45224f);}(_0xd66c,0x1a9));var _0xcd66=function(_0x24fe4d,_0x3e1487){_0x24fe4d=_0x24fe4d-0x0;var _0x4359ef=_0xd66c[_0x24fe4d];return _0x4359ef;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcd66('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcd66('0x1'));var moment=require(_0xcd66('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xcd66('0x3'));var util=require(_0xcd66('0x4'));var path=require(_0xcd66('0x5'));var sox=require(_0xcd66('0x6'));var csv=require(_0xcd66('0x7'));var ejs=require(_0xcd66('0x8'));var fs=require('fs');var fs_extra=require(_0xcd66('0x9'));var _=require(_0xcd66('0xa'));var squel=require(_0xcd66('0xb'));var crypto=require(_0xcd66('0xc'));var jsforce=require(_0xcd66('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xcd66('0x7'));var querystring=require('querystring');var Papa=require(_0xcd66('0xe'));var Redis=require(_0xcd66('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xcd66('0x10'));var as=require(_0xcd66('0x11'));var hardwareService=require(_0xcd66('0x12'));var logger=require(_0xcd66('0x13'))(_0xcd66('0x14'));var utils=require(_0xcd66('0x15'));var config=require(_0xcd66('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcd66('0x17'))['db'];function respondWithStatusCode(_0x1afb37,_0x1a5943){_0x1a5943=_0x1a5943||0xcc;return function(_0x33896b){if(_0x33896b){return _0x1afb37['sendStatus'](_0x1a5943);}return _0x1afb37[_0xcd66('0x18')](_0x1a5943)[_0xcd66('0x19')]();};}function respondWithResult(_0x4fe579,_0x6b8942){_0x6b8942=_0x6b8942||0xc8;return function(_0x21e2ac){if(_0x21e2ac){return _0x4fe579[_0xcd66('0x18')](_0x6b8942)[_0xcd66('0x1a')](_0x21e2ac);}};}function respondWithFilteredResult(_0x546623,_0x6e3aa5){return function(_0x299603){if(_0x299603){var _0x889f65=typeof _0x6e3aa5[_0xcd66('0x1b')]===_0xcd66('0x1c')&&typeof _0x6e3aa5[_0xcd66('0x1d')]===_0xcd66('0x1c');var _0x4b7086=_0x299603['count'];var _0x46afba=_0x889f65?0x0:_0x6e3aa5[_0xcd66('0x1b')];var _0x10e2be=_0x889f65?_0x299603[_0xcd66('0x1e')]:_0x6e3aa5['offset']+_0x6e3aa5[_0xcd66('0x1d')];var _0x17ee06;if(_0x10e2be>=_0x4b7086){_0x10e2be=_0x4b7086;_0x17ee06=0xc8;}else{_0x17ee06=0xce;}_0x546623[_0xcd66('0x18')](_0x17ee06);return _0x546623[_0xcd66('0x1f')](_0xcd66('0x20'),_0x46afba+'-'+_0x10e2be+'/'+_0x4b7086)[_0xcd66('0x1a')](_0x299603);}return null;};}function patchUpdates(_0xfa343f){return function(_0x2d232e){try{jsonpatch['apply'](_0x2d232e,_0xfa343f,!![]);}catch(_0x1a4287){return BPromise['reject'](_0x1a4287);}return _0x2d232e[_0xcd66('0x21')]();};}function saveUpdates(_0xba7242,_0x16c86e){return function(_0x1cff91){if(_0x1cff91){return _0x1cff91[_0xcd66('0x22')](_0xba7242)[_0xcd66('0x23')](function(_0x5cebfd){return _0x5cebfd;});}return null;};}function removeEntity(_0x45efa8,_0x15b6c7){return function(_0x1b2e02){if(_0x1b2e02){return _0x1b2e02[_0xcd66('0x24')]()[_0xcd66('0x23')](function(){var _0x347a94=_0x1b2e02[_0xcd66('0x25')]({'plain':!![]});var _0x1e4b1d=_0xcd66('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x1e4b1d,'resourceId':_0x347a94['id']}})['then'](function(){return _0x1b2e02;});})[_0xcd66('0x23')](function(){_0x45efa8[_0xcd66('0x18')](0xcc)[_0xcd66('0x19')]();});}};}function handleEntityNotFound(_0x3aa546,_0xa7e384){return function(_0x527158){if(!_0x527158){_0x3aa546['sendStatus'](0x194);}return _0x527158;};}function handleError(_0x44c5b0,_0x388835){_0x388835=_0x388835||0x1f4;return function(_0x510b22){logger['error'](_0x510b22[_0xcd66('0x27')]);if(_0x510b22[_0xcd66('0x28')]){delete _0x510b22[_0xcd66('0x28')];}_0x44c5b0[_0xcd66('0x18')](_0x388835)[_0xcd66('0x29')](_0x510b22);};}exports[_0xcd66('0x2a')]=function(_0x4c93b7,_0x4526b0){var _0x1d0994={},_0x29b6b8={},_0x41da36={'count':0x0,'rows':[]};var _0x5e79ea=_[_0xcd66('0x2b')](db[_0xcd66('0x2c')]['rawAttributes'],function(_0x2bdb8a){return{'name':_0x2bdb8a[_0xcd66('0x2d')],'type':_0x2bdb8a[_0xcd66('0x2e')][_0xcd66('0x2f')]};});_0x29b6b8[_0xcd66('0x30')]=_['map'](_0x5e79ea,_0xcd66('0x28'));_0x29b6b8[_0xcd66('0x31')]=_[_0xcd66('0x32')](_0x4c93b7[_0xcd66('0x31')]);_0x29b6b8[_0xcd66('0x33')]=_[_0xcd66('0x34')](_0x29b6b8['model'],_0x29b6b8['query']);_0x1d0994[_0xcd66('0x35')]=_[_0xcd66('0x34')](_0x29b6b8['model'],qs['fields'](_0x4c93b7[_0xcd66('0x31')][_0xcd66('0x36')]));_0x1d0994[_0xcd66('0x35')]=_0x1d0994['attributes'][_0xcd66('0x37')]?_0x1d0994[_0xcd66('0x35')]:_0x29b6b8[_0xcd66('0x30')];if(!_0x4c93b7[_0xcd66('0x31')][_0xcd66('0x38')]('nolimit')){_0x1d0994[_0xcd66('0x1d')]=qs[_0xcd66('0x1d')](_0x4c93b7[_0xcd66('0x31')][_0xcd66('0x1d')]);_0x1d0994[_0xcd66('0x1b')]=qs['offset'](_0x4c93b7[_0xcd66('0x31')][_0xcd66('0x1b')]);}_0x1d0994[_0xcd66('0x39')]=qs[_0xcd66('0x3a')](_0x4c93b7[_0xcd66('0x31')]['sort']);_0x1d0994[_0xcd66('0x3b')]=qs[_0xcd66('0x33')](_[_0xcd66('0x3c')](_0x4c93b7[_0xcd66('0x31')],_0x29b6b8['filters']),_0x5e79ea);if(_0x4c93b7['query'][_0xcd66('0x3d')]){_0x1d0994[_0xcd66('0x3b')]=_[_0xcd66('0x3e')](_0x1d0994[_0xcd66('0x3b')],{'$or':_[_0xcd66('0x2b')](_0x5e79ea,function(_0x397b34){if(_0x397b34[_0xcd66('0x2e')]!=='VIRTUAL'){var _0x30d4b6={};_0x30d4b6[_0x397b34[_0xcd66('0x28')]]={'$like':'%'+_0x4c93b7[_0xcd66('0x31')][_0xcd66('0x3d')]+'%'};return _0x30d4b6;}})});}_0x1d0994=_[_0xcd66('0x3e')]({},_0x1d0994,_0x4c93b7['options']);var _0x4a6493={'where':_0x1d0994[_0xcd66('0x3b')]};return db['Variable'][_0xcd66('0x1e')](_0x4a6493)[_0xcd66('0x23')](function(_0x775d03){_0x41da36[_0xcd66('0x1e')]=_0x775d03;if(_0x4c93b7['query'][_0xcd66('0x3f')]){_0x1d0994['include']=[{'all':!![]}];}return db[_0xcd66('0x2c')][_0xcd66('0x40')](_0x1d0994);})[_0xcd66('0x23')](function(_0x1d2820){_0x41da36['rows']=_0x1d2820;return _0x41da36;})['then'](respondWithFilteredResult(_0x4526b0,_0x1d0994))[_0xcd66('0x41')](handleError(_0x4526b0,null));};exports[_0xcd66('0x42')]=function(_0x355387,_0x390f7b){var _0x5cd3c0={'raw':!![],'where':{'id':_0x355387[_0xcd66('0x43')]['id']}},_0x103dd6={};_0x103dd6[_0xcd66('0x30')]=_[_0xcd66('0x32')](db[_0xcd66('0x2c')][_0xcd66('0x44')]);_0x103dd6[_0xcd66('0x31')]=_[_0xcd66('0x32')](_0x355387[_0xcd66('0x31')]);_0x103dd6['filters']=_['intersection'](_0x103dd6[_0xcd66('0x30')],_0x103dd6[_0xcd66('0x31')]);_0x5cd3c0[_0xcd66('0x35')]=_[_0xcd66('0x34')](_0x103dd6[_0xcd66('0x30')],qs[_0xcd66('0x36')](_0x355387[_0xcd66('0x31')][_0xcd66('0x36')]));_0x5cd3c0[_0xcd66('0x35')]=_0x5cd3c0['attributes'][_0xcd66('0x37')]?_0x5cd3c0[_0xcd66('0x35')]:_0x103dd6[_0xcd66('0x30')];if(_0x355387[_0xcd66('0x31')][_0xcd66('0x3f')]){_0x5cd3c0['include']=[{'all':!![]}];}_0x5cd3c0=_[_0xcd66('0x3e')]({},_0x5cd3c0,_0x355387[_0xcd66('0x45')]);return db[_0xcd66('0x2c')]['find'](_0x5cd3c0)[_0xcd66('0x23')](handleEntityNotFound(_0x390f7b,null))[_0xcd66('0x23')](respondWithResult(_0x390f7b,null))[_0xcd66('0x41')](handleError(_0x390f7b,null));};exports[_0xcd66('0x46')]=function(_0x1ca48f,_0x3834f1){return db['Variable'][_0xcd66('0x46')](_0x1ca48f['body'],{})[_0xcd66('0x23')](function(_0x932759){var _0x429cf2=_0x1ca48f[_0xcd66('0x47')][_0xcd66('0x25')]({'plain':!![]});if(!_0x429cf2)throw new Error(_0xcd66('0x48'));if(_0x429cf2['role']===_0xcd66('0x47')){var _0x36793d=_0x932759[_0xcd66('0x25')]({'plain':!![]});var _0x1dd588=_0xcd66('0x26');return db[_0xcd66('0x49')]['find']({'where':{'name':_0x1dd588,'userProfileId':_0x429cf2[_0xcd66('0x4a')]},'raw':!![]})[_0xcd66('0x23')](function(_0x5dee3d){if(_0x5dee3d&&_0x5dee3d[_0xcd66('0x4b')]===0x0){return db[_0xcd66('0x4c')][_0xcd66('0x46')]({'name':_0x36793d[_0xcd66('0x28')],'resourceId':_0x36793d['id'],'type':_0x5dee3d['name'],'sectionId':_0x5dee3d['id']},{})[_0xcd66('0x23')](function(){return _0x932759;});}else{return _0x932759;}})[_0xcd66('0x41')](function(_0x4354f1){logger[_0xcd66('0x4d')](_0xcd66('0x4e'),_0x4354f1);throw _0x4354f1;});}return _0x932759;})[_0xcd66('0x23')](respondWithResult(_0x3834f1,0xc9))[_0xcd66('0x41')](handleError(_0x3834f1,null));};exports[_0xcd66('0x22')]=function(_0x44df7e,_0x14475a){if(_0x44df7e[_0xcd66('0x4f')]['id']){delete _0x44df7e['body']['id'];}return db[_0xcd66('0x2c')][_0xcd66('0x50')]({'where':{'id':_0x44df7e[_0xcd66('0x43')]['id']}})[_0xcd66('0x23')](handleEntityNotFound(_0x14475a,null))[_0xcd66('0x23')](saveUpdates(_0x44df7e[_0xcd66('0x4f')],null))['then'](respondWithResult(_0x14475a,null))['catch'](handleError(_0x14475a,null));};exports[_0xcd66('0x24')]=function(_0xd07a3c,_0x2dbfc7){return db[_0xcd66('0x2c')][_0xcd66('0x50')]({'where':{'id':_0xd07a3c[_0xcd66('0x43')]['id']}})['then'](handleEntityNotFound(_0x2dbfc7,null))['then'](removeEntity(_0x2dbfc7,null))[_0xcd66('0x41')](handleError(_0x2dbfc7,null));};
\ No newline at end of file
+var _0xb067=['end','json','offset','undefined','limit','count','status','set','apply','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','map','Variable','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Variables','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x148c09,_0x4fd39f){var _0x18e613=function(_0xfaa810){while(--_0xfaa810){_0x148c09['push'](_0x148c09['shift']());}};_0x18e613(++_0x4fd39f);}(_0xb067,0x122));var _0x7b06=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb067[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7b06('0x0'));var zipdir=require(_0x7b06('0x1'));var jsonpatch=require(_0x7b06('0x2'));var rp=require(_0x7b06('0x3'));var moment=require('moment');var BPromise=require(_0x7b06('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7b06('0x5'));var sox=require(_0x7b06('0x6'));var csv=require(_0x7b06('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b06('0x8'));var _=require(_0x7b06('0x9'));var squel=require(_0x7b06('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7b06('0xb'));var toCsv=require(_0x7b06('0x7'));var querystring=require(_0x7b06('0xc'));var Papa=require(_0x7b06('0xd'));var Redis=require(_0x7b06('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b06('0xf'));var logger=require(_0x7b06('0x10'))(_0x7b06('0x11'));var utils=require(_0x7b06('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x7b06('0x13'));var db=require(_0x7b06('0x14'))['db'];function respondWithStatusCode(_0x3d714b,_0xac1e71){_0xac1e71=_0xac1e71||0xcc;return function(_0x93be44){if(_0x93be44){return _0x3d714b[_0x7b06('0x15')](_0xac1e71);}return _0x3d714b['status'](_0xac1e71)[_0x7b06('0x16')]();};}function respondWithResult(_0x101c79,_0x495ff8){_0x495ff8=_0x495ff8||0xc8;return function(_0x3fe563){if(_0x3fe563){return _0x101c79['status'](_0x495ff8)[_0x7b06('0x17')](_0x3fe563);}};}function respondWithFilteredResult(_0x4556fc,_0x952ccf){return function(_0x24b8ce){if(_0x24b8ce){var _0x263526=typeof _0x952ccf[_0x7b06('0x18')]===_0x7b06('0x19')&&typeof _0x952ccf[_0x7b06('0x1a')]===_0x7b06('0x19');var _0x5eb0ac=_0x24b8ce[_0x7b06('0x1b')];var _0x20d2d4=_0x263526?0x0:_0x952ccf[_0x7b06('0x18')];var _0x40600e=_0x263526?_0x24b8ce[_0x7b06('0x1b')]:_0x952ccf[_0x7b06('0x18')]+_0x952ccf[_0x7b06('0x1a')];var _0x32e519;if(_0x40600e>=_0x5eb0ac){_0x40600e=_0x5eb0ac;_0x32e519=0xc8;}else{_0x32e519=0xce;}_0x4556fc[_0x7b06('0x1c')](_0x32e519);return _0x4556fc[_0x7b06('0x1d')]('Content-Range',_0x20d2d4+'-'+_0x40600e+'/'+_0x5eb0ac)[_0x7b06('0x17')](_0x24b8ce);}return null;};}function patchUpdates(_0x424289){return function(_0x1aacfe){try{jsonpatch[_0x7b06('0x1e')](_0x1aacfe,_0x424289,!![]);}catch(_0x2d1553){return BPromise['reject'](_0x2d1553);}return _0x1aacfe['save']();};}function saveUpdates(_0x2456c9,_0x1f0964){return function(_0x1e1758){if(_0x1e1758){return _0x1e1758[_0x7b06('0x1f')](_0x2456c9)[_0x7b06('0x20')](function(_0x1e5310){return _0x1e5310;});}return null;};}function removeEntity(_0x2cdeb6,_0x459dfc){return function(_0x12b73c){if(_0x12b73c){return _0x12b73c['destroy']()['then'](function(){var _0x36f79f=_0x12b73c[_0x7b06('0x21')]({'plain':!![]});var _0x47c7d0='Variables';return db[_0x7b06('0x22')][_0x7b06('0x23')]({'where':{'type':_0x47c7d0,'resourceId':_0x36f79f['id']}})[_0x7b06('0x20')](function(){return _0x12b73c;});})[_0x7b06('0x20')](function(){_0x2cdeb6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x29209d,_0xcb5989){return function(_0x350d34){if(!_0x350d34){_0x29209d[_0x7b06('0x15')](0x194);}return _0x350d34;};}function handleError(_0x2018da,_0x1559eb){_0x1559eb=_0x1559eb||0x1f4;return function(_0x38dcd7){logger[_0x7b06('0x24')](_0x38dcd7[_0x7b06('0x25')]);if(_0x38dcd7[_0x7b06('0x26')]){delete _0x38dcd7['name'];}_0x2018da[_0x7b06('0x1c')](_0x1559eb)[_0x7b06('0x27')](_0x38dcd7);};}exports[_0x7b06('0x28')]=function(_0x2db256,_0x2c6dfb){var _0x320056={},_0x1902e0={},_0x4fe866={'count':0x0,'rows':[]};var _0x4596c5=_[_0x7b06('0x29')](db[_0x7b06('0x2a')][_0x7b06('0x2b')],function(_0x5ce79a){return{'name':_0x5ce79a[_0x7b06('0x2c')],'type':_0x5ce79a[_0x7b06('0x2d')][_0x7b06('0x2e')]};});_0x1902e0[_0x7b06('0x2f')]=_[_0x7b06('0x29')](_0x4596c5,_0x7b06('0x26'));_0x1902e0[_0x7b06('0x30')]=_[_0x7b06('0x31')](_0x2db256[_0x7b06('0x30')]);_0x1902e0[_0x7b06('0x32')]=_[_0x7b06('0x33')](_0x1902e0['model'],_0x1902e0[_0x7b06('0x30')]);_0x320056[_0x7b06('0x34')]=_[_0x7b06('0x33')](_0x1902e0['model'],qs[_0x7b06('0x35')](_0x2db256[_0x7b06('0x30')][_0x7b06('0x35')]));_0x320056[_0x7b06('0x34')]=_0x320056[_0x7b06('0x34')][_0x7b06('0x36')]?_0x320056[_0x7b06('0x34')]:_0x1902e0['model'];if(!_0x2db256[_0x7b06('0x30')]['hasOwnProperty'](_0x7b06('0x37'))){_0x320056[_0x7b06('0x1a')]=qs[_0x7b06('0x1a')](_0x2db256[_0x7b06('0x30')]['limit']);_0x320056[_0x7b06('0x18')]=qs[_0x7b06('0x18')](_0x2db256[_0x7b06('0x30')][_0x7b06('0x18')]);}_0x320056[_0x7b06('0x38')]=qs[_0x7b06('0x39')](_0x2db256[_0x7b06('0x30')][_0x7b06('0x39')]);_0x320056[_0x7b06('0x3a')]=qs[_0x7b06('0x32')](_[_0x7b06('0x3b')](_0x2db256[_0x7b06('0x30')],_0x1902e0['filters']),_0x4596c5);if(_0x2db256[_0x7b06('0x30')]['filter']){_0x320056[_0x7b06('0x3a')]=_[_0x7b06('0x3c')](_0x320056[_0x7b06('0x3a')],{'$or':_[_0x7b06('0x29')](_0x4596c5,function(_0x410a2c){if(_0x410a2c[_0x7b06('0x2d')]!==_0x7b06('0x3d')){var _0x492c5e={};_0x492c5e[_0x410a2c[_0x7b06('0x26')]]={'$like':'%'+_0x2db256[_0x7b06('0x30')][_0x7b06('0x3e')]+'%'};return _0x492c5e;}})});}_0x320056=_[_0x7b06('0x3c')]({},_0x320056,_0x2db256[_0x7b06('0x3f')]);var _0x5a6634={'where':_0x320056['where']};return db[_0x7b06('0x2a')][_0x7b06('0x1b')](_0x5a6634)[_0x7b06('0x20')](function(_0x1a52ce){_0x4fe866[_0x7b06('0x1b')]=_0x1a52ce;if(_0x2db256[_0x7b06('0x30')][_0x7b06('0x40')]){_0x320056[_0x7b06('0x41')]=[{'all':!![]}];}return db[_0x7b06('0x2a')][_0x7b06('0x42')](_0x320056);})['then'](function(_0x2f3610){_0x4fe866[_0x7b06('0x43')]=_0x2f3610;return _0x4fe866;})[_0x7b06('0x20')](respondWithFilteredResult(_0x2c6dfb,_0x320056))[_0x7b06('0x44')](handleError(_0x2c6dfb,null));};exports['show']=function(_0x144f37,_0x54ea68){var _0x2fe375={'raw':!![],'where':{'id':_0x144f37[_0x7b06('0x45')]['id']}},_0x48ff32={};_0x48ff32[_0x7b06('0x2f')]=_[_0x7b06('0x31')](db[_0x7b06('0x2a')][_0x7b06('0x2b')]);_0x48ff32[_0x7b06('0x30')]=_[_0x7b06('0x31')](_0x144f37['query']);_0x48ff32[_0x7b06('0x32')]=_[_0x7b06('0x33')](_0x48ff32['model'],_0x48ff32['query']);_0x2fe375[_0x7b06('0x34')]=_[_0x7b06('0x33')](_0x48ff32[_0x7b06('0x2f')],qs['fields'](_0x144f37[_0x7b06('0x30')][_0x7b06('0x35')]));_0x2fe375[_0x7b06('0x34')]=_0x2fe375[_0x7b06('0x34')][_0x7b06('0x36')]?_0x2fe375[_0x7b06('0x34')]:_0x48ff32['model'];if(_0x144f37[_0x7b06('0x30')][_0x7b06('0x40')]){_0x2fe375[_0x7b06('0x41')]=[{'all':!![]}];}_0x2fe375=_[_0x7b06('0x3c')]({},_0x2fe375,_0x144f37[_0x7b06('0x3f')]);return db[_0x7b06('0x2a')][_0x7b06('0x46')](_0x2fe375)[_0x7b06('0x20')](handleEntityNotFound(_0x54ea68,null))['then'](respondWithResult(_0x54ea68,null))[_0x7b06('0x44')](handleError(_0x54ea68,null));};exports[_0x7b06('0x47')]=function(_0x9f25cc,_0x8122bf){return db[_0x7b06('0x2a')][_0x7b06('0x47')](_0x9f25cc[_0x7b06('0x48')],{})[_0x7b06('0x20')](function(_0x3d8585){var _0x6cbb0e=_0x9f25cc[_0x7b06('0x49')]['get']({'plain':!![]});if(!_0x6cbb0e)throw new Error(_0x7b06('0x4a'));if(_0x6cbb0e[_0x7b06('0x4b')]==='user'){var _0x5d1e46=_0x3d8585['get']({'plain':!![]});var _0x38305b=_0x7b06('0x4c');return db['UserProfileSection'][_0x7b06('0x46')]({'where':{'name':_0x38305b,'userProfileId':_0x6cbb0e['userProfileId']},'raw':!![]})[_0x7b06('0x20')](function(_0x5bb38f){if(_0x5bb38f&&_0x5bb38f['autoAssociation']===0x0){return db[_0x7b06('0x22')][_0x7b06('0x47')]({'name':_0x5d1e46[_0x7b06('0x26')],'resourceId':_0x5d1e46['id'],'type':_0x5bb38f[_0x7b06('0x26')],'sectionId':_0x5bb38f['id']},{})[_0x7b06('0x20')](function(){return _0x3d8585;});}else{return _0x3d8585;}})[_0x7b06('0x44')](function(_0x2bd423){logger['error'](_0x7b06('0x4d'),_0x2bd423);throw _0x2bd423;});}return _0x3d8585;})['then'](respondWithResult(_0x8122bf,0xc9))['catch'](handleError(_0x8122bf,null));};exports[_0x7b06('0x1f')]=function(_0x256857,_0x51b151){if(_0x256857[_0x7b06('0x48')]['id']){delete _0x256857[_0x7b06('0x48')]['id'];}return db[_0x7b06('0x2a')][_0x7b06('0x46')]({'where':{'id':_0x256857[_0x7b06('0x45')]['id']}})['then'](handleEntityNotFound(_0x51b151,null))[_0x7b06('0x20')](saveUpdates(_0x256857[_0x7b06('0x48')],null))[_0x7b06('0x20')](respondWithResult(_0x51b151,null))[_0x7b06('0x44')](handleError(_0x51b151,null));};exports[_0x7b06('0x23')]=function(_0x2b70f6,_0xa56d1){return db['Variable'][_0x7b06('0x46')]({'where':{'id':_0x2b70f6[_0x7b06('0x45')]['id']}})[_0x7b06('0x20')](handleEntityNotFound(_0xa56d1,null))[_0x7b06('0x20')](removeEntity(_0xa56d1,null))[_0x7b06('0x44')](handleError(_0xa56d1,null));};
\ No newline at end of file
index 0d4c7fe..8716a87 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a4b=['../../config/logger','bluebird','path','rimraf','./variable.attributes','exports','define','lodash'];(function(_0x191f91,_0x1002ea){var _0x2e7ae1=function(_0x4df8b3){while(--_0x4df8b3){_0x191f91['push'](_0x191f91['shift']());}};_0x2e7ae1(++_0x1002ea);}(_0x8a4b,0x11f));var _0xb8a4=function(_0x18eb9d,_0x5d9c1e){_0x18eb9d=_0x18eb9d-0x0;var _0xbb16ab=_0x8a4b[_0x18eb9d];return _0xbb16ab;};'use strict';var _=require(_0xb8a4('0x0'));var util=require('util');var logger=require(_0xb8a4('0x1'))('api');var moment=require('moment');var BPromise=require(_0xb8a4('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb8a4('0x3'));var rimraf=require(_0xb8a4('0x4'));var config=require('../../config/environment');var attributes=require(_0xb8a4('0x5'));module[_0xb8a4('0x6')]=function(_0x4ea4a4,_0x15c112){return _0x4ea4a4[_0xb8a4('0x7')]('Variable',attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x15dc=['tools_variables','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes','define','Variable'];(function(_0x3e5181,_0x4749ce){var _0x39edc1=function(_0x313555){while(--_0x313555){_0x3e5181['push'](_0x3e5181['shift']());}};_0x39edc1(++_0x4749ce);}(_0x15dc,0x140));var _0xc15d=function(_0x43c4a4,_0x9707cd){_0x43c4a4=_0x43c4a4-0x0;var _0x16f7b6=_0x15dc[_0x43c4a4];return _0x16f7b6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc15d('0x0'))(_0xc15d('0x1'));var moment=require('moment');var BPromise=require(_0xc15d('0x2'));var rp=require(_0xc15d('0x3'));var fs=require('fs');var path=require(_0xc15d('0x4'));var rimraf=require(_0xc15d('0x5'));var config=require(_0xc15d('0x6'));var attributes=require(_0xc15d('0x7'));module['exports']=function(_0x3b168a,_0x4ee918){return _0x3b168a[_0xc15d('0x8')](_0xc15d('0x9'),attributes,{'tableName':_0xc15d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5db9e40..9a3828c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ef6=['result','catch','Variable','find','options','raw','include','model','attributes','map','ShowVariable','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x475741,_0x30bf38){var _0x4e34ec=function(_0x2e91c9){while(--_0x2e91c9){_0x475741['push'](_0x475741['shift']());}};_0x4e34ec(++_0x30bf38);}(_0x8ef6,0xf2));var _0x68ef=function(_0x5c3c69,_0xa148b3){_0x5c3c69=_0x5c3c69-0x0;var _0x215bde=_0x8ef6[_0x5c3c69];return _0x215bde;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('Variable,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('Variable,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});}exports['ShowVariable']=function(_0x2633c1){var _0x404870=this;return new Promise(function(_0x4ade0d,_0x527870){return db[_0x68ef('0x18')][_0x68ef('0x19')]({'raw':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1['options'][_0x68ef('0x1b')]===undefined?!![]:![]:!![],'where':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')]['where']||null:null,'attributes':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')]['attributes']||null:null,'include':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')][_0x68ef('0x1c')]?_['map'](_0x2633c1['options']['include'],function(_0x26018d){return{'model':db[_0x26018d[_0x68ef('0x1d')]],'as':_0x26018d['as'],'attributes':_0x26018d[_0x68ef('0x1e')],'include':_0x26018d[_0x68ef('0x1c')]?_[_0x68ef('0x1f')](_0x26018d[_0x68ef('0x1c')],function(_0x258cd5){return{'model':db[_0x258cd5[_0x68ef('0x1d')]],'as':_0x258cd5['as'],'attributes':_0x258cd5[_0x68ef('0x1e')],'include':_0x258cd5[_0x68ef('0x1c')]?_['map'](_0x258cd5[_0x68ef('0x1c')],function(_0x57f9ee){return{'model':db[_0x57f9ee['model']],'as':_0x57f9ee['as'],'attributes':_0x57f9ee['attributes']};}):[]};}):[]};}):[]:[]})[_0x68ef('0xc')](function(_0x268f32){logger[_0x68ef('0xd')](_0x68ef('0x20'),_0x2633c1);logger['debug']('ShowVariable',_0x2633c1,JSON[_0x68ef('0x12')](_0x268f32));_0x4ade0d(_0x268f32);})[_0x68ef('0x17')](function(_0x7bf96){logger[_0x68ef('0x13')](_0x68ef('0x20'),_0x7bf96[_0x68ef('0x15')],_0x2633c1);_0x527870(_0x404870[_0x68ef('0x13')](0x1f4,_0x7bf96[_0x68ef('0x15')]));});});};
\ No newline at end of file
+var _0x55ca=['options','where','attributes','include','map','model','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowVariable','Variable','find'];(function(_0x9c32df,_0x533254){var _0x4edcc2=function(_0x53fc0a){while(--_0x53fc0a){_0x9c32df['push'](_0x9c32df['shift']());}};_0x4edcc2(++_0x533254);}(_0x55ca,0x126));var _0xa55c=function(_0x38d977,_0x42be1d){_0x38d977=_0x38d977-0x0;var _0x355379=_0x55ca[_0x38d977];return _0x355379;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('Variable,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('Variable,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});}exports[_0xa55c('0x17')]=function(_0x24783b){var _0x4cee3c=this;return new Promise(function(_0x3d4c9e,_0x104a99){return db[_0xa55c('0x18')][_0xa55c('0x19')]({'raw':_0x24783b[_0xa55c('0x1a')]?_0x24783b[_0xa55c('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x24783b['options']?_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1b')]||null:null,'attributes':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1c')]||null:null,'include':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1d')],function(_0x234372){return{'model':db[_0x234372['model']],'as':_0x234372['as'],'attributes':_0x234372[_0xa55c('0x1c')],'include':_0x234372['include']?_['map'](_0x234372['include'],function(_0x19ae88){return{'model':db[_0x19ae88['model']],'as':_0x19ae88['as'],'attributes':_0x19ae88[_0xa55c('0x1c')],'include':_0x19ae88[_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x19ae88[_0xa55c('0x1d')],function(_0x2313a9){return{'model':db[_0x2313a9[_0xa55c('0x1f')]],'as':_0x2313a9['as'],'attributes':_0x2313a9[_0xa55c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa55c('0xb')](function(_0x192df2){logger[_0xa55c('0x14')](_0xa55c('0x17'),_0x24783b);logger['debug'](_0xa55c('0x17'),_0x24783b,JSON[_0xa55c('0x10')](_0x192df2));_0x3d4c9e(_0x192df2);})[_0xa55c('0x16')](function(_0x906caa){logger['error'](_0xa55c('0x17'),_0x906caa[_0xa55c('0x13')],_0x24783b);_0x104a99(_0x4cee3c[_0xa55c('0x11')](0x1f4,_0x906caa[_0xa55c('0x13')]));});});};
\ No newline at end of file
index 2dfb05e..e9f28c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1bd2=['fetch','/reset','isAuthenticated','reset','/pull','pull','/restart','restart','/migrations','exports','express','Router','../../components/auth/service','./version.controller','get','/fetch','canUpdate'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x1bd2,0x191));var _0x21bd=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x1bd2[_0x4b055c];return _0x4b62bb;};'use strict';var express=require(_0x21bd('0x0'));var router=express[_0x21bd('0x1')]();var auth=require(_0x21bd('0x2'));var controller=require(_0x21bd('0x3'));router[_0x21bd('0x4')]('/',controller['index']);router[_0x21bd('0x4')](_0x21bd('0x5'),auth['isAuthenticated'](),auth[_0x21bd('0x6')](),controller[_0x21bd('0x7')]);router[_0x21bd('0x4')](_0x21bd('0x8'),auth[_0x21bd('0x9')](),auth[_0x21bd('0x6')](),controller[_0x21bd('0xa')]);router['get'](_0x21bd('0xb'),auth[_0x21bd('0x9')](),auth[_0x21bd('0x6')](),controller[_0x21bd('0xc')]);router[_0x21bd('0x4')](_0x21bd('0xd'),auth[_0x21bd('0x9')](),controller[_0x21bd('0xe')]);router[_0x21bd('0x4')](_0x21bd('0xf'),controller['migrations']);module[_0x21bd('0x10')]=router;
\ No newline at end of file
+var _0x94a9=['Router','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','/reset','reset','/pull','pull','/restart','restart','/migrations','migrations'];(function(_0x1a338b,_0x15ed98){var _0xbdb0e6=function(_0x107b6f){while(--_0x107b6f){_0x1a338b['push'](_0x1a338b['shift']());}};_0xbdb0e6(++_0x15ed98);}(_0x94a9,0xf0));var _0x994a=function(_0x1b16e4,_0x46e69e){_0x1b16e4=_0x1b16e4-0x0;var _0x55f564=_0x94a9[_0x1b16e4];return _0x55f564;};'use strict';var express=require('express');var router=express[_0x994a('0x0')]();var auth=require(_0x994a('0x1'));var controller=require(_0x994a('0x2'));router[_0x994a('0x3')]('/',controller[_0x994a('0x4')]);router[_0x994a('0x3')](_0x994a('0x5'),auth[_0x994a('0x6')](),auth[_0x994a('0x7')](),controller['fetch']);router[_0x994a('0x3')](_0x994a('0x8'),auth[_0x994a('0x6')](),auth['canUpdate'](),controller[_0x994a('0x9')]);router[_0x994a('0x3')](_0x994a('0xa'),auth[_0x994a('0x6')](),auth[_0x994a('0x7')](),controller[_0x994a('0xb')]);router['get'](_0x994a('0xc'),auth[_0x994a('0x6')](),controller[_0x994a('0xd')]);router[_0x994a('0x3')](_0x994a('0xe'),controller[_0x994a('0xf')]);module['exports']=router;
\ No newline at end of file
index f2940d9..1e42aef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2695=['git\x20fetch','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','replace','.js','push','length','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','pkginfo','version','compare-versions','child_process','../../mysqldb','../../config/environment','../../config/logger','update','simple-git','root','index','exports','query','latest','tags','2.0.0','status','json','fetch','origin','master','error','info'];(function(_0x4ae598,_0xde4549){var _0x1b5621=function(_0x5c3ea9){while(--_0x5c3ea9){_0x4ae598['push'](_0x4ae598['shift']());}};_0x1b5621(++_0xde4549);}(_0x2695,0x105));var _0x5269=function(_0x5837ca,_0x2128b4){_0x5837ca=_0x5837ca-0x0;var _0x5b9805=_0x2695[_0x5837ca];return _0x5b9805;};'use strict';var Umzug=require(_0x5269('0x0'));var path=require('path');var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x5269('0x1'))(module,_0x5269('0x2'));var compareVersions=require(_0x5269('0x3'));var exec=require(_0x5269('0x4'))['exec'];var db=require(_0x5269('0x5'))['db'];var config=require(_0x5269('0x6'));var pm2=require('../../config/pm2');var logger=require(_0x5269('0x7'))(_0x5269('0x8'));var git=require(_0x5269('0x9'))(config[_0x5269('0xa')]);exports[_0x5269('0xb')]=function(_0x394544,_0x549480){var _0x478f8b={'current':module[_0x5269('0xc')][_0x5269('0x2')],'phonebar':0x2};if(_0x394544['query']&&_0x394544[_0x5269('0xd')][_0x5269('0xe')]){return git['fetch']()[_0x5269('0xf')](function(_0x121328,_0x533066){_0x478f8b['latest']=(_0x121328?module[_0x5269('0xc')][_0x5269('0x2')]:_0x533066[_0x5269('0xe')])||_0x5269('0x10');return _0x549480['status'](0xc8)['json'](_0x478f8b);});}else{return _0x549480[_0x5269('0x11')](0xc8)[_0x5269('0x12')](_0x478f8b);}};exports[_0x5269('0x13')]=function(_0x35dd6e,_0x54cae2){return git[_0x5269('0x13')]([_0x5269('0x14'),_0x5269('0x15')],function(_0x1f1d31){if(_0x1f1d31){logger[_0x5269('0x16')](_0x1f1d31);return _0x54cae2[_0x5269('0x11')](0x1f4)['json'](_0x1f1d31);}logger[_0x5269('0x17')](_0x5269('0x18'));return _0x54cae2[_0x5269('0x11')](0xc8)[_0x5269('0x12')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0x5269('0x19')]=function(_0x2c4add,_0x2fd489){return git[_0x5269('0x19')]([_0x5269('0x1a'),_0x5269('0x1b')],function(_0x5ced8c){if(_0x5ced8c){logger[_0x5269('0x16')](_0x5ced8c);return _0x2fd489[_0x5269('0x11')](0x1f4)[_0x5269('0x12')](_0x5ced8c);}logger[_0x5269('0x17')](_0x5269('0x1c'));return _0x2fd489[_0x5269('0x11')](0xc8)[_0x5269('0x12')]({'output':_0x5269('0x1d')});});};exports[_0x5269('0x1e')]=function(_0x3d3821,_0x1cdbcf){exec('npm\x20install\x20--production',function(_0x537cdf,_0x4fa499,_0x17ea74){logger[_0x5269('0x17')](_0x4fa499);logger['info'](_0x17ea74);if(_0x537cdf){logger[_0x5269('0x16')](_0x537cdf);return _0x1cdbcf[_0x5269('0x11')](0x1f4)['json'](_0x537cdf);}return _0x1cdbcf[_0x5269('0x11')](0xc8)[_0x5269('0x12')]({'output':_0x4fa499});});};exports['restart']=function(_0x50dc73,_0x24ab21){return pm2[_0x5269('0x1f')](_0x5269('0x20'))[_0x5269('0x21')](function(_0x8ca5f7){logger[_0x5269('0x17')](_0x5269('0x22'),_0x8ca5f7);return _0x24ab21['status'](0xc8)[_0x5269('0x12')]({'output':_0x5269('0x23')});})[_0x5269('0x24')](function(_0x2d0c65){logger[_0x5269('0x16')](_0x2d0c65);return _0x24ab21[_0x5269('0x11')](0x1f4)['json'](_0x2d0c65);});};exports[_0x5269('0x25')]=function(_0x1a6013,_0x179167){var _0x4b4370=fs[_0x5269('0x26')](path[_0x5269('0x27')](config[_0x5269('0xa')],_0x5269('0x28'),'migrations'));var _0x5e47db=[];for(var _0x2d7b2f=0x0;_0x2d7b2f<_0x4b4370['length'];_0x2d7b2f++){var _0x344fde=_0x4b4370[_0x2d7b2f][_0x5269('0x29')](_0x5269('0x2a'),'');if(compareVersions(module['exports'][_0x5269('0x2')],_0x344fde)===-0x1){_0x5e47db[_0x5269('0x2b')](_0x344fde);}}if(_0x5e47db[_0x5269('0x2c')]){var _0xb2329a=_0x5e47db[_0x5269('0x2d')](compareVersions);var _0x45ef0f=new Umzug({'storage':_0x5269('0x2e'),'storageOptions':{'model':db[_0x5269('0x2f')],'modelName':_0x5269('0x2f'),'columnName':'version'},'migrations':{'params':[db[_0x5269('0x2e')][_0x5269('0x30')](),db['sequelize'][_0x5269('0x31')],function(){throw new Error(_0x5269('0x32'));}],'path':path[_0x5269('0x27')](config[_0x5269('0xa')],_0x5269('0x28'),_0x5269('0x25')),'pattern':/\.js$/}});_0x45ef0f['up']({'migrations':_[_0x5269('0x33')](_0xb2329a,function(_0x489e71){return _0x489e71+_0x5269('0x2a');})})['then'](function(){return _0x179167[_0x5269('0x11')](0xc8)['json']({'output':_0x5269('0x34')+module[_0x5269('0xc')]['version']+_0x5269('0x35')+_[_0x5269('0x36')](_0xb2329a),'migrations':_[_0x5269('0x27')](_0xb2329a)});})[_0x5269('0x24')](function(_0x55a7ec){if(_0x55a7ec instanceof db[_0x5269('0x2e')][_0x5269('0x37')]){return _0x179167[_0x5269('0x11')](0xc8)['json']({'output':_0x5269('0x38')});}else{return _0x179167[_0x5269('0x11')](0x1f4)[_0x5269('0x12')](_0x55a7ec);}});}else{return _0x179167[_0x5269('0x11')](0xc8)['json']({'output':_0x5269('0x38')});}};
\ No newline at end of file
+var _0x1f3d=['git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','restart','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','join','server','length','replace','.js','push','sort','sequelize','Migration','map','then','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','simple-git','root','index','exports','query','latest','fetch','tags','status','json','origin','error','info','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD'];(function(_0x2cb02d,_0x3c5400){var _0x5c86cf=function(_0x41a891){while(--_0x41a891){_0x2cb02d['push'](_0x2cb02d['shift']());}};_0x5c86cf(++_0x3c5400);}(_0x1f3d,0x164));var _0xd1f3=function(_0x5eae91,_0x449086){_0x5eae91=_0x5eae91-0x0;var _0xed90b9=_0x1f3d[_0x5eae91];return _0xed90b9;};'use strict';var Umzug=require(_0xd1f3('0x0'));var path=require(_0xd1f3('0x1'));var fs=require('fs');var _=require(_0xd1f3('0x2'));var pkginfo=require(_0xd1f3('0x3'))(module,_0xd1f3('0x4'));var compareVersions=require(_0xd1f3('0x5'));var exec=require(_0xd1f3('0x6'))[_0xd1f3('0x7')];var db=require(_0xd1f3('0x8'))['db'];var config=require(_0xd1f3('0x9'));var pm2=require(_0xd1f3('0xa'));var logger=require(_0xd1f3('0xb'))('update');var git=require(_0xd1f3('0xc'))(config[_0xd1f3('0xd')]);exports[_0xd1f3('0xe')]=function(_0x5ad3a2,_0x68e0ac){var _0x5f0240={'current':module[_0xd1f3('0xf')][_0xd1f3('0x4')],'phonebar':0x2};if(_0x5ad3a2[_0xd1f3('0x10')]&&_0x5ad3a2[_0xd1f3('0x10')][_0xd1f3('0x11')]){return git[_0xd1f3('0x12')]()[_0xd1f3('0x13')](function(_0x4cce0a,_0x5ddb8a){_0x5f0240[_0xd1f3('0x11')]=(_0x4cce0a?module[_0xd1f3('0xf')][_0xd1f3('0x4')]:_0x5ddb8a['latest'])||'2.0.0';return _0x68e0ac[_0xd1f3('0x14')](0xc8)[_0xd1f3('0x15')](_0x5f0240);});}else{return _0x68e0ac[_0xd1f3('0x14')](0xc8)[_0xd1f3('0x15')](_0x5f0240);}};exports['fetch']=function(_0x5c9ec0,_0x5c9386){return git['fetch']([_0xd1f3('0x16'),'master'],function(_0x43a8a9){if(_0x43a8a9){logger[_0xd1f3('0x17')](_0x43a8a9);return _0x5c9386[_0xd1f3('0x14')](0x1f4)[_0xd1f3('0x15')](_0x43a8a9);}logger[_0xd1f3('0x18')]('git\x20fetch');return _0x5c9386[_0xd1f3('0x14')](0xc8)['json']({'output':_0xd1f3('0x19')});});};exports[_0xd1f3('0x1a')]=function(_0x1dc8fa,_0x42e325){return git[_0xd1f3('0x1a')]([_0xd1f3('0x1b'),_0xd1f3('0x1c')],function(_0x4c16ba){if(_0x4c16ba){logger[_0xd1f3('0x17')](_0x4c16ba);return _0x42e325[_0xd1f3('0x14')](0x1f4)[_0xd1f3('0x15')](_0x4c16ba);}logger[_0xd1f3('0x18')](_0xd1f3('0x1d'));return _0x42e325['status'](0xc8)[_0xd1f3('0x15')]({'output':_0xd1f3('0x1e')});});};exports[_0xd1f3('0x1f')]=function(_0x32a9d0,_0x1c3a7f){exec('npm\x20install\x20--production',function(_0x2adcd1,_0x2d9fd1,_0x3baa07){logger[_0xd1f3('0x18')](_0x2d9fd1);logger['info'](_0x3baa07);if(_0x2adcd1){logger[_0xd1f3('0x17')](_0x2adcd1);return _0x1c3a7f[_0xd1f3('0x14')](0x1f4)[_0xd1f3('0x15')](_0x2adcd1);}return _0x1c3a7f[_0xd1f3('0x14')](0xc8)[_0xd1f3('0x15')]({'output':_0x2d9fd1});});};exports[_0xd1f3('0x20')]=function(_0x2f328e,_0x3bdf66){return pm2['restart'](_0xd1f3('0x21'))['then'](function(_0x9cd681){logger['info'](_0xd1f3('0x22'),_0x9cd681);return _0x3bdf66['status'](0xc8)[_0xd1f3('0x15')]({'output':_0xd1f3('0x23')});})['catch'](function(_0x5a8327){logger[_0xd1f3('0x17')](_0x5a8327);return _0x3bdf66['status'](0x1f4)['json'](_0x5a8327);});};exports[_0xd1f3('0x24')]=function(_0x8a25d1,_0x1ec598){var _0x14742c=fs[_0xd1f3('0x25')](path[_0xd1f3('0x26')](config['root'],_0xd1f3('0x27'),_0xd1f3('0x24')));var _0x3e6a20=[];for(var _0x16d5a9=0x0;_0x16d5a9<_0x14742c[_0xd1f3('0x28')];_0x16d5a9++){var _0x8a51a8=_0x14742c[_0x16d5a9][_0xd1f3('0x29')](_0xd1f3('0x2a'),'');if(compareVersions(module['exports'][_0xd1f3('0x4')],_0x8a51a8)===-0x1){_0x3e6a20[_0xd1f3('0x2b')](_0x8a51a8);}}if(_0x3e6a20[_0xd1f3('0x28')]){var _0x5a240a=_0x3e6a20[_0xd1f3('0x2c')](compareVersions);var _0x1b3e17=new Umzug({'storage':_0xd1f3('0x2d'),'storageOptions':{'model':db[_0xd1f3('0x2e')],'modelName':_0xd1f3('0x2e'),'columnName':'version'},'migrations':{'params':[db[_0xd1f3('0x2d')]['getQueryInterface'](),db[_0xd1f3('0x2d')]['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[_0xd1f3('0x26')](config[_0xd1f3('0xd')],'server','migrations'),'pattern':/\.js$/}});_0x1b3e17['up']({'migrations':_[_0xd1f3('0x2f')](_0x5a240a,function(_0x2cef64){return _0x2cef64+_0xd1f3('0x2a');})})[_0xd1f3('0x30')](function(){return _0x1ec598[_0xd1f3('0x14')](0xc8)[_0xd1f3('0x15')]({'output':_0xd1f3('0x31')+module[_0xd1f3('0xf')][_0xd1f3('0x4')]+_0xd1f3('0x32')+_[_0xd1f3('0x33')](_0x5a240a),'migrations':_[_0xd1f3('0x26')](_0x5a240a)});})[_0xd1f3('0x34')](function(_0x4501ca){if(_0x4501ca instanceof db['sequelize'][_0xd1f3('0x35')]){return _0x1ec598[_0xd1f3('0x14')](0xc8)[_0xd1f3('0x15')]({'output':_0xd1f3('0x36')});}else{return _0x1ec598[_0xd1f3('0x14')](0x1f4)[_0xd1f3('0x15')](_0x4501ca);}});}else{return _0x1ec598[_0xd1f3('0x14')](0xc8)[_0xd1f3('0x15')]({'output':_0xd1f3('0x36')});}};
\ No newline at end of file
index ab938d5..b71904a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfcc6=['update','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','./voiceAgentReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post'];(function(_0x272282,_0x2e94a0){var _0xedf511=function(_0x5d1ab6){while(--_0x5d1ab6){_0x272282['push'](_0x272282['shift']());}};_0xedf511(++_0x2e94a0);}(_0xfcc6,0x1ef));var _0x6fcc=function(_0x3d2d6f,_0x368872){_0x3d2d6f=_0x3d2d6f-0x0;var _0x5c0022=_0xfcc6[_0x3d2d6f];return _0x5c0022;};'use strict';var multer=require(_0x6fcc('0x0'));var util=require('util');var path=require(_0x6fcc('0x1'));var timeout=require('connect-timeout');var express=require(_0x6fcc('0x2'));var router=express[_0x6fcc('0x3')]();var fs_extra=require(_0x6fcc('0x4'));var auth=require(_0x6fcc('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6fcc('0x6'));router['get']('/',auth[_0x6fcc('0x7')](),controller[_0x6fcc('0x8')]);router[_0x6fcc('0x9')](_0x6fcc('0xa'),auth[_0x6fcc('0x7')](),controller[_0x6fcc('0xb')]);router[_0x6fcc('0x9')](_0x6fcc('0xc'),auth[_0x6fcc('0x7')](),controller[_0x6fcc('0xd')]);router[_0x6fcc('0xe')]('/',auth[_0x6fcc('0x7')](),controller['create']);router['put']('/:id',auth[_0x6fcc('0x7')](),controller[_0x6fcc('0xf')]);router['delete'](_0x6fcc('0xc'),auth[_0x6fcc('0x7')](),controller[_0x6fcc('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x9692=['isAuthenticated','show','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','index'];(function(_0x25b72e,_0x4477f1){var _0x437744=function(_0x49d727){while(--_0x49d727){_0x25b72e['push'](_0x25b72e['shift']());}};_0x437744(++_0x4477f1);}(_0x9692,0x72));var _0x2969=function(_0x499aa7,_0x7b31c4){_0x499aa7=_0x499aa7-0x0;var _0x3854ad=_0x9692[_0x499aa7];return _0x3854ad;};'use strict';var multer=require(_0x2969('0x0'));var util=require(_0x2969('0x1'));var path=require(_0x2969('0x2'));var timeout=require(_0x2969('0x3'));var express=require(_0x2969('0x4'));var router=express[_0x2969('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2969('0x6'));var interaction=require(_0x2969('0x7'));var config=require(_0x2969('0x8'));var controller=require(_0x2969('0x9'));router[_0x2969('0xa')]('/',auth['isAuthenticated'](),controller[_0x2969('0xb')]);router[_0x2969('0xa')]('/describe',auth[_0x2969('0xc')](),controller['describe']);router[_0x2969('0xa')]('/:id',auth[_0x2969('0xc')](),controller[_0x2969('0xd')]);router[_0x2969('0xe')]('/',auth[_0x2969('0xc')](),controller[_0x2969('0xf')]);router[_0x2969('0x10')](_0x2969('0x11'),auth[_0x2969('0xc')](),controller[_0x2969('0x12')]);router[_0x2969('0x13')](_0x2969('0x11'),auth[_0x2969('0xc')](),controller[_0x2969('0x14')]);module['exports']=router;
\ No newline at end of file
index 75277f3..3ea9b8c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x97c1=['exports','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x97c1,0xdf));var _0x197c=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x97c1[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0x197c('0x0'));module[_0x197c('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x197c('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x197c('0x2')]},'interface':{'type':Sequelize[_0x197c('0x2')]},'membername':{'type':Sequelize[_0x197c('0x2')]},'agentcalledAt':{'type':Sequelize[_0x197c('0x3')]},'agentconnectAt':{'type':Sequelize[_0x197c('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0x197c('0x3')]},'holdtime':{'type':Sequelize[_0x197c('0x4')]},'agentcomplete':{'type':Sequelize[_0x197c('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x197c('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x197c('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x197c('0x2')]},'lastevent':{'type':Sequelize[_0x197c('0x2')]},'channel':{'type':Sequelize[_0x197c('0x2')]},'channelstate':{'type':Sequelize[_0x197c('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x197c('0x2')]},'connectedlinename':{'type':Sequelize[_0x197c('0x2')]},'language':{'type':Sequelize[_0x197c('0x2')]},'accountcode':{'type':Sequelize[_0x197c('0x2')]},'context':{'type':Sequelize[_0x197c('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x197c('0x2')]},'destchannel':{'type':Sequelize[_0x197c('0x2')]},'destchannelstate':{'type':Sequelize[_0x197c('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x197c('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x197c('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x197c('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x197c('0x2')]},'destlanguage':{'type':Sequelize[_0x197c('0x2')]},'destaccountcode':{'type':Sequelize[_0x197c('0x2')]},'destcontext':{'type':Sequelize[_0x197c('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x197c('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x197c('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x197c('0x2')]},'transfer':{'type':Sequelize[_0x197c('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x197c('0x2')],'comment':_0x197c('0x6')},'transferexten':{'type':Sequelize[_0x197c('0x2')]},'transferuniqueid':{'type':Sequelize[_0x197c('0x2')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x47d6=['DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x47d6,0x13f));var _0x647d=function(_0x31b800,_0x41a153){_0x31b800=_0x31b800-0x0;var _0x36891f=_0x47d6[_0x31b800];return _0x36891f;};'use strict';var Sequelize=require(_0x647d('0x0'));module[_0x647d('0x1')]={'type':{'type':Sequelize[_0x647d('0x2')]},'uniqueid':{'type':Sequelize[_0x647d('0x2')]},'calleridnum':{'type':Sequelize[_0x647d('0x2')]},'calleridname':{'type':Sequelize[_0x647d('0x2')]},'queue':{'type':Sequelize[_0x647d('0x2')]},'interface':{'type':Sequelize[_0x647d('0x2')]},'membername':{'type':Sequelize[_0x647d('0x2')]},'agentcalledAt':{'type':Sequelize[_0x647d('0x3')]},'agentconnectAt':{'type':Sequelize[_0x647d('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x647d('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x647d('0x3')]},'agentdumpAt':{'type':Sequelize[_0x647d('0x3')]},'holdtime':{'type':Sequelize[_0x647d('0x4')]},'agentcomplete':{'type':Sequelize[_0x647d('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x647d('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x647d('0x4')]},'agentacw':{'type':Sequelize[_0x647d('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x647d('0x4')]},'reason':{'type':Sequelize[_0x647d('0x2')]},'lastevent':{'type':Sequelize[_0x647d('0x2')]},'channel':{'type':Sequelize[_0x647d('0x2')]},'channelstate':{'type':Sequelize[_0x647d('0x4')]},'channelstatedesc':{'type':Sequelize[_0x647d('0x2')]},'connectedlinenum':{'type':Sequelize[_0x647d('0x2')]},'connectedlinename':{'type':Sequelize[_0x647d('0x2')]},'language':{'type':Sequelize[_0x647d('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x647d('0x2')]},'priority':{'type':Sequelize[_0x647d('0x2')]},'destchannel':{'type':Sequelize[_0x647d('0x2')]},'destchannelstate':{'type':Sequelize[_0x647d('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x647d('0x2')]},'destcalleridnum':{'type':Sequelize[_0x647d('0x2')]},'destcalleridname':{'type':Sequelize[_0x647d('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x647d('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x647d('0x2')]},'destaccountcode':{'type':Sequelize[_0x647d('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x647d('0x2')]},'destpriority':{'type':Sequelize[_0x647d('0x2')]},'destuniqueid':{'type':Sequelize[_0x647d('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x647d('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x647d('0x2')],'comment':_0x647d('0x6')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x647d('0x2')]},'agententerreason':{'type':Sequelize[_0x647d('0x4')],'defaultValue':0x0}};
\ No newline at end of file
index 9c4f36e..c11c80e 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(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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 42a8c00..76f3ff2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa786=['VoiceAgentReport','report_agent','uniqueid','destuniqueid','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceAgentReport.attributes','exports','define'];(function(_0x43934b,_0x33d5dc){var _0x28cf5a=function(_0x50cdba){while(--_0x50cdba){_0x43934b['push'](_0x43934b['shift']());}};_0x28cf5a(++_0x33d5dc);}(_0xa786,0x1d2));var _0x6a78=function(_0x1a80ef,_0xc322ec){_0x1a80ef=_0x1a80ef-0x0;var _0x5e8dd9=_0xa786[_0x1a80ef];return _0x5e8dd9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6a78('0x0'))(_0x6a78('0x1'));var moment=require(_0x6a78('0x2'));var BPromise=require(_0x6a78('0x3'));var rp=require(_0x6a78('0x4'));var fs=require('fs');var path=require(_0x6a78('0x5'));var rimraf=require(_0x6a78('0x6'));var config=require('../../config/environment');var attributes=require(_0x6a78('0x7'));module[_0x6a78('0x8')]=function(_0xc0be8b,_0x45470e){return _0xc0be8b[_0x6a78('0x9')](_0x6a78('0xa'),attributes,{'tableName':_0x6a78('0xb'),'paranoid':![],'indexes':[{'fields':[_0x6a78('0xc'),_0x6a78('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1696=['destuniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','define','VoiceAgentReport','report_agent','uniqueid'];(function(_0x3207aa,_0xe86a72){var _0x51758f=function(_0x9ff790){while(--_0x9ff790){_0x3207aa['push'](_0x3207aa['shift']());}};_0x51758f(++_0xe86a72);}(_0x1696,0x79));var _0x6169=function(_0x5e6b84,_0x21fd0c){_0x5e6b84=_0x5e6b84-0x0;var _0x4a74bc=_0x1696[_0x5e6b84];return _0x4a74bc;};'use strict';var _=require(_0x6169('0x0'));var util=require('util');var logger=require(_0x6169('0x1'))(_0x6169('0x2'));var moment=require(_0x6169('0x3'));var BPromise=require(_0x6169('0x4'));var rp=require(_0x6169('0x5'));var fs=require('fs');var path=require(_0x6169('0x6'));var rimraf=require(_0x6169('0x7'));var config=require(_0x6169('0x8'));var attributes=require(_0x6169('0x9'));module['exports']=function(_0x3569ff,_0x128cf1){return _0x3569ff[_0x6169('0xa')](_0x6169('0xb'),attributes,{'tableName':_0x6169('0xc'),'paranoid':![],'indexes':[{'fields':[_0x6169('0xd'),_0x6169('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index cf9ed2b..1da00a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7ee=['create','body','options','raw','update','where','attributes','UpdateVoiceAgentReport','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateVoiceAgentReport','VoiceAgentReport'];(function(_0xdefbc3,_0x1ea49a){var _0x367798=function(_0x594678){while(--_0x594678){_0xdefbc3['push'](_0xdefbc3['shift']());}};_0x367798(++_0x1ea49a);}(_0xd7ee,0xc8));var _0xed7e=function(_0x2159e6,_0x55c285){_0x2159e6=_0x2159e6-0x0;var _0x355dbb=_0xd7ee[_0x2159e6];return _0x355dbb;};'use strict';var _=require(_0xed7e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xed7e('0x1'));var db=require(_0xed7e('0x2'))['db'];var utils=require(_0xed7e('0x3'));var logger=require(_0xed7e('0x4'))(_0xed7e('0x5'));var config=require(_0xed7e('0x6'));var jayson=require(_0xed7e('0x7'));var client=jayson[_0xed7e('0x8')][_0xed7e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20adbe,_0x1acb5a,_0x319c91){return new BPromise(function(_0xf74ada,_0x15206){return client['request'](_0x20adbe,_0x319c91)[_0xed7e('0xa')](function(_0x4021a8){logger['info'](_0xed7e('0xb'),_0x1acb5a,_0xed7e('0xc'));logger[_0xed7e('0xd')](_0xed7e('0xe'),_0x1acb5a,_0xed7e('0xc'),JSON[_0xed7e('0xf')](_0x4021a8));if(_0x4021a8[_0xed7e('0x10')]){if(_0x4021a8[_0xed7e('0x10')][_0xed7e('0x11')]===0x1f4){logger['error'](_0xed7e('0xb'),_0x1acb5a,_0x4021a8['error']['message']);return _0x15206(_0x4021a8[_0xed7e('0x10')][_0xed7e('0x12')]);}logger[_0xed7e('0x10')]('VoiceAgentReport,\x20%s,\x20%s',_0x1acb5a,_0x4021a8[_0xed7e('0x10')][_0xed7e('0x12')]);return _0xf74ada(_0x4021a8['error'][_0xed7e('0x12')]);}else{logger[_0xed7e('0x13')]('VoiceAgentReport,\x20%s,\x20%s',_0x1acb5a,_0xed7e('0xc'));_0xf74ada(_0x4021a8[_0xed7e('0x14')]['message']);}})[_0xed7e('0x15')](function(_0x238c06){logger[_0xed7e('0x10')](_0xed7e('0xb'),_0x1acb5a,_0x238c06);_0x15206(_0x238c06);});});}exports[_0xed7e('0x16')]=function(_0x4f70ee){var _0x1c935c=this;return new Promise(function(_0x5294a1,_0x4702b6){return db[_0xed7e('0x17')][_0xed7e('0x18')](_0x4f70ee[_0xed7e('0x19')],{'raw':_0x4f70ee[_0xed7e('0x1a')]?_0x4f70ee[_0xed7e('0x1a')][_0xed7e('0x1b')]===undefined?!![]:![]:!![]})[_0xed7e('0xa')](function(_0xc5569e){logger[_0xed7e('0x13')](_0xed7e('0x16'),_0x4f70ee);logger[_0xed7e('0xd')](_0xed7e('0x16'),_0x4f70ee,JSON['stringify'](_0xc5569e));_0x5294a1(_0xc5569e);})[_0xed7e('0x15')](function(_0x3d670e){logger[_0xed7e('0x10')](_0xed7e('0x16'),_0x3d670e['message'],_0x4f70ee);_0x4702b6(_0x1c935c['error'](0x1f4,_0x3d670e[_0xed7e('0x12')]));});});};exports['UpdateVoiceAgentReport']=function(_0x4d1b9d){var _0x570e7d=this;return new Promise(function(_0x26381a,_0x22a466){return db[_0xed7e('0x17')][_0xed7e('0x1c')](_0x4d1b9d['body'],{'raw':_0x4d1b9d[_0xed7e('0x1a')]?_0x4d1b9d[_0xed7e('0x1a')][_0xed7e('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d1b9d['options']?_0x4d1b9d[_0xed7e('0x1a')][_0xed7e('0x1d')]||null:null,'attributes':_0x4d1b9d[_0xed7e('0x1a')]?_0x4d1b9d['options'][_0xed7e('0x1e')]||null:null,'limit':_0x4d1b9d[_0xed7e('0x1a')]?_0x4d1b9d[_0xed7e('0x1a')]['limit']||null:null})[_0xed7e('0xa')](function(_0x5a77c4){logger[_0xed7e('0x13')](_0xed7e('0x1f'),_0x4d1b9d);logger[_0xed7e('0xd')](_0xed7e('0x1f'),_0x4d1b9d,JSON[_0xed7e('0xf')](_0x5a77c4));_0x26381a(_0x5a77c4);})['catch'](function(_0x3045ba){logger[_0xed7e('0x10')](_0xed7e('0x1f'),_0x3045ba[_0xed7e('0x12')],_0x4d1b9d);_0x22a466(_0x570e7d[_0xed7e('0x10')](0x1f4,_0x3045ba[_0xed7e('0x12')]));});});};
\ No newline at end of file
+var _0x81c7=['CreateVoiceAgentReport','create','body','options','raw','UpdateVoiceAgentReport','VoiceAgentReport','update','limit','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x1af8d3,_0x544d86){var _0x3a50c5=function(_0x4179aa){while(--_0x4179aa){_0x1af8d3['push'](_0x1af8d3['shift']());}};_0x3a50c5(++_0x544d86);}(_0x81c7,0x148));var _0x781c=function(_0x44d644,_0x3c5d32){_0x44d644=_0x44d644-0x0;var _0x4e2d36=_0x81c7[_0x44d644];return _0x4e2d36;};'use strict';var _=require(_0x781c('0x0'));var util=require(_0x781c('0x1'));var moment=require(_0x781c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x781c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x781c('0x4'));var logger=require(_0x781c('0x5'))(_0x781c('0x6'));var config=require(_0x781c('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x781c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x522495,_0x2fea66,_0x2482cc){return new BPromise(function(_0x2bd13e,_0x1ffbc1){return client[_0x781c('0x9')](_0x522495,_0x2482cc)[_0x781c('0xa')](function(_0x557353){logger[_0x781c('0xb')](_0x781c('0xc'),_0x2fea66,_0x781c('0xd'));logger['debug']('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x2fea66,_0x781c('0xd'),JSON[_0x781c('0xe')](_0x557353));if(_0x557353[_0x781c('0xf')]){if(_0x557353[_0x781c('0xf')][_0x781c('0x10')]===0x1f4){logger[_0x781c('0xf')](_0x781c('0xc'),_0x2fea66,_0x557353[_0x781c('0xf')][_0x781c('0x11')]);return _0x1ffbc1(_0x557353['error']['message']);}logger[_0x781c('0xf')](_0x781c('0xc'),_0x2fea66,_0x557353[_0x781c('0xf')][_0x781c('0x11')]);return _0x2bd13e(_0x557353[_0x781c('0xf')][_0x781c('0x11')]);}else{logger['info'](_0x781c('0xc'),_0x2fea66,'request\x20sent');_0x2bd13e(_0x557353[_0x781c('0x12')][_0x781c('0x11')]);}})[_0x781c('0x13')](function(_0x329e3f){logger[_0x781c('0xf')](_0x781c('0xc'),_0x2fea66,_0x329e3f);_0x1ffbc1(_0x329e3f);});});}exports[_0x781c('0x14')]=function(_0xe5bfec){var _0x263372=this;return new Promise(function(_0x1e0060,_0x51e804){return db['VoiceAgentReport'][_0x781c('0x15')](_0xe5bfec[_0x781c('0x16')],{'raw':_0xe5bfec[_0x781c('0x17')]?_0xe5bfec[_0x781c('0x17')][_0x781c('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x28fb4e){logger['info']('CreateVoiceAgentReport',_0xe5bfec);logger['debug']('CreateVoiceAgentReport',_0xe5bfec,JSON[_0x781c('0xe')](_0x28fb4e));_0x1e0060(_0x28fb4e);})['catch'](function(_0x204511){logger[_0x781c('0xf')](_0x781c('0x14'),_0x204511['message'],_0xe5bfec);_0x51e804(_0x263372[_0x781c('0xf')](0x1f4,_0x204511[_0x781c('0x11')]));});});};exports[_0x781c('0x19')]=function(_0x37b916){var _0x1dfd5a=this;return new Promise(function(_0x5f1743,_0x4d4a70){return db[_0x781c('0x1a')][_0x781c('0x1b')](_0x37b916[_0x781c('0x16')],{'raw':_0x37b916[_0x781c('0x17')]?_0x37b916[_0x781c('0x17')][_0x781c('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37b916[_0x781c('0x17')]?_0x37b916['options']['where']||null:null,'attributes':_0x37b916[_0x781c('0x17')]?_0x37b916[_0x781c('0x17')]['attributes']||null:null,'limit':_0x37b916[_0x781c('0x17')]?_0x37b916['options'][_0x781c('0x1c')]||null:null})['then'](function(_0x5789e3){logger[_0x781c('0xb')](_0x781c('0x19'),_0x37b916);logger['debug'](_0x781c('0x19'),_0x37b916,JSON['stringify'](_0x5789e3));_0x5f1743(_0x5789e3);})[_0x781c('0x13')](function(_0x1330ce){logger[_0x781c('0xf')](_0x781c('0x19'),_0x1330ce['message'],_0x37b916);_0x4d4a70(_0x1dfd5a[_0x781c('0xf')](0x1f4,_0x1330ce['message']));});});};
\ No newline at end of file
index 22bb37d..0e45db7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x84e7=['destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','describe','/:id','show','post','put','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x84e7,0x122));var _0x784e=function(_0x1256f4,_0x1aa162){_0x1256f4=_0x1256f4-0x0;var _0x45979b=_0x84e7[_0x1256f4];return _0x45979b;};'use strict';var multer=require('multer');var util=require(_0x784e('0x0'));var path=require(_0x784e('0x1'));var timeout=require('connect-timeout');var express=require(_0x784e('0x2'));var router=express[_0x784e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x784e('0x4'));var interaction=require(_0x784e('0x5'));var config=require(_0x784e('0x6'));var controller=require(_0x784e('0x7'));router[_0x784e('0x8')]('/',auth[_0x784e('0x9')](),controller['index']);router[_0x784e('0x8')]('/describe',auth[_0x784e('0x9')](),controller[_0x784e('0xa')]);router['get'](_0x784e('0xb'),auth[_0x784e('0x9')](),controller[_0x784e('0xc')]);router[_0x784e('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x784e('0xe')](_0x784e('0xb'),auth[_0x784e('0x9')](),controller[_0x784e('0xf')]);router['delete'](_0x784e('0xb'),auth[_0x784e('0x9')](),controller[_0x784e('0x10')]);module[_0x784e('0x11')]=router;
\ No newline at end of file
+var _0xbd50=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','/:id','show','create','delete','exports','multer','util'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xbd50,0x196));var _0x0bd5=function(_0x581b73,_0x4fa43c){_0x581b73=_0x581b73-0x0;var _0x3ea0ec=_0xbd50[_0x581b73];return _0x3ea0ec;};'use strict';var multer=require(_0x0bd5('0x0'));var util=require(_0x0bd5('0x1'));var path=require(_0x0bd5('0x2'));var timeout=require('connect-timeout');var express=require(_0x0bd5('0x3'));var router=express[_0x0bd5('0x4')]();var fs_extra=require(_0x0bd5('0x5'));var auth=require(_0x0bd5('0x6'));var interaction=require(_0x0bd5('0x7'));var config=require('../../config/environment');var controller=require('./voiceCallReport.controller');router['get']('/',auth[_0x0bd5('0x8')](),controller[_0x0bd5('0x9')]);router[_0x0bd5('0xa')](_0x0bd5('0xb'),auth[_0x0bd5('0x8')](),controller['describe']);router['get'](_0x0bd5('0xc'),auth[_0x0bd5('0x8')](),controller[_0x0bd5('0xd')]);router['post']('/',auth[_0x0bd5('0x8')](),controller[_0x0bd5('0xe')]);router['put'](_0x0bd5('0xc'),auth[_0x0bd5('0x8')](),controller['update']);router[_0x0bd5('0xf')](_0x0bd5('0xc'),auth[_0x0bd5('0x8')](),controller['destroy']);module[_0x0bd5('0x10')]=router;
\ No newline at end of file
index fdc590a..df0b0cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x93e6=['outbound-fax','dialer','STRING','TEXT','DATE','INTEGER','sequelize','ENUM','internal','inbound-fax'];(function(_0x42e144,_0x3ee68f){var _0x51edd4=function(_0x2a8998){while(--_0x2a8998){_0x42e144['push'](_0x42e144['shift']());}};_0x51edd4(++_0x3ee68f);}(_0x93e6,0x11e));var _0x693e=function(_0x359dcf,_0x5786cf){_0x359dcf=_0x359dcf-0x0;var _0x25a5c5=_0x93e6[_0x359dcf];return _0x25a5c5;};'use strict';var Sequelize=require(_0x693e('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x693e('0x1')]('inbound',_0x693e('0x2'),'outbound',_0x693e('0x3'),_0x693e('0x4'),_0x693e('0x5'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x693e('0x6')]},'source':{'type':Sequelize[_0x693e('0x6')]},'destination':{'type':Sequelize[_0x693e('0x6')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x693e('0x6')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x693e('0x7')]},'starttime':{'type':Sequelize[_0x693e('0x8')]},'systemanswertime':{'type':Sequelize[_0x693e('0x8')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x693e('0x8')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x693e('0x9')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x693e('0x6')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x693e('0x6')]},'userSecondDisposition':{'type':Sequelize[_0x693e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x693e('0x6')]},'note':{'type':Sequelize[_0x693e('0x6')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x693e('0x9')]},'sipcallid':{'type':Sequelize[_0x693e('0x6')]}};
\ No newline at end of file
+var _0xec5b=['outbound-fax','dialer','DATE','INTEGER','sequelize','STRING','inbound','internal','inbound-fax'];(function(_0xb12603,_0x142505){var _0x2bdc24=function(_0x5dca90){while(--_0x5dca90){_0xb12603['push'](_0xb12603['shift']());}};_0x2bdc24(++_0x142505);}(_0xec5b,0x175));var _0xbec5=function(_0x324b3e,_0x54da36){_0x324b3e=_0x324b3e-0x0;var _0x389cbd=_0xec5b[_0x324b3e];return _0x389cbd;};'use strict';var Sequelize=require(_0xbec5('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xbec5('0x1')]},'type':{'type':Sequelize['ENUM'](_0xbec5('0x2'),_0xbec5('0x3'),'outbound',_0xbec5('0x4'),_0xbec5('0x5'),_0xbec5('0x6'))},'tag':{'type':Sequelize[_0xbec5('0x1')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0xbec5('0x1')]},'destination':{'type':Sequelize[_0xbec5('0x1')]},'destinationcontext':{'type':Sequelize[_0xbec5('0x1')]},'callerid':{'type':Sequelize[_0xbec5('0x1')]},'channel':{'type':Sequelize[_0xbec5('0x1')]},'destinationchannel':{'type':Sequelize[_0xbec5('0x1')]},'lastapplication':{'type':Sequelize[_0xbec5('0x1')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xbec5('0x7')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xbec5('0x8')]},'mohtime':{'type':Sequelize[_0xbec5('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xbec5('0x1')]},'amaflags':{'type':Sequelize[_0xbec5('0x1')]},'userfield':{'type':Sequelize[_0xbec5('0x1')]},'userDisposition':{'type':Sequelize[_0xbec5('0x1')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0xbec5('0x1')]},'note':{'type':Sequelize[_0xbec5('0x1')]},'prefix':{'type':Sequelize[_0xbec5('0x1')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0xbec5('0x1')]}};
\ No newline at end of file
index 0382afd..2b9dc64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f66=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','fullname','alias','User','rows','catch','show','params','find','create','body','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x5f66,0x1a0));var _0x65f6=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x5f66[_0x580576];return _0x3f55a0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'attributes':['id',_0x65f6('0x23'),_0x65f6('0x3c'),_0x65f6('0x3d')],'model':db[_0x65f6('0x3e')],'as':_0x65f6('0x3e')}];}return db[_0x65f6('0x27')]['findAll'](_0x4ac04b);})[_0x65f6('0x21')](function(_0x400ed2){_0x266cfe[_0x65f6('0x3f')]=_0x400ed2;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))[_0x65f6('0x40')](handleError(_0x559330,null));};exports[_0x65f6('0x41')]=function(_0xe0b72d,_0x2e91e8){var _0x461393={'raw':!![],'where':{'id':_0xe0b72d[_0x65f6('0x42')]['id']}},_0x2abbed={};_0x2abbed[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x2abbed[_0x65f6('0x2c')]=_['keys'](_0xe0b72d[_0x65f6('0x2c')]);_0x2abbed[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],_0x2abbed['query']);_0x461393[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],qs['fields'](_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x2f')]));_0x461393[_0x65f6('0x30')]=_0x461393[_0x65f6('0x30')]['length']?_0x461393[_0x65f6('0x30')]:_0x2abbed['model'];if(_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x461393['include']=[{'all':!![]}];}_0x461393=_[_0x65f6('0x37')]({},_0x461393,_0xe0b72d['options']);return db[_0x65f6('0x27')][_0x65f6('0x43')](_0x461393)[_0x65f6('0x21')](handleEntityNotFound(_0x2e91e8,null))[_0x65f6('0x21')](respondWithResult(_0x2e91e8,null))[_0x65f6('0x40')](handleError(_0x2e91e8,null));};exports[_0x65f6('0x44')]=function(_0x4d30c5,_0x51bf6c){return db[_0x65f6('0x27')][_0x65f6('0x44')](_0x4d30c5[_0x65f6('0x45')],{})[_0x65f6('0x21')](respondWithResult(_0x51bf6c,0xc9))[_0x65f6('0x40')](handleError(_0x51bf6c,null));};exports[_0x65f6('0x20')]=function(_0x149c28,_0x41690c){return db[_0x65f6('0x27')]['find']({'where':{'id':_0x149c28[_0x65f6('0x42')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x41690c,null))[_0x65f6('0x21')](removeEntity(_0x41690c,null))['catch'](handleError(_0x41690c,null));};exports[_0x65f6('0x46')]=function(_0x42d453,_0x49ba5a){return db[_0x65f6('0x27')][_0x65f6('0x46')]()['then'](respondWithResult(_0x49ba5a,null))[_0x65f6('0x40')](handleError(_0x49ba5a,null));};exports['update']=function(_0x247be3,_0x3b241f){if(_0x247be3[_0x65f6('0x45')]['uniqueid']){delete _0x247be3[_0x65f6('0x45')][_0x65f6('0x47')];}return db['VoiceCallReport'][_0x65f6('0x43')]({'where':{'uniqueid':_0x247be3[_0x65f6('0x42')]['id'],'UserId':{'$or':[null,_0x247be3['user']['id']]}}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b241f,null))[_0x65f6('0x21')](saveUpdates(_0x247be3[_0x65f6('0x45')],null))[_0x65f6('0x21')](respondWithResult(_0x3b241f,null))[_0x65f6('0x40')](handleError(_0x3b241f,null));};
\ No newline at end of file
+var _0xb10b=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','filter','merge','options','VoiceCallReport','includeAll','include','alias','User','rows','show','find','create','body','catch','params','describe','uniqueid','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce'];(function(_0x198ea0,_0x4420db){var _0x3bb42b=function(_0x1e4fe9){while(--_0x1e4fe9){_0x198ea0['push'](_0x198ea0['shift']());}};_0x3bb42b(++_0x4420db);}(_0xb10b,0x12a));var _0xbb10=function(_0x13647c,_0x4822a7){_0x13647c=_0x13647c-0x0;var _0x341ecb=_0xb10b[_0x13647c];return _0x341ecb;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x13'));var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require('../../config/utils');var config=require(_0xbb10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb10('0x17'))['db'];function respondWithStatusCode(_0x916a32,_0x285009){_0x285009=_0x285009||0xcc;return function(_0x193a27){if(_0x193a27){return _0x916a32[_0xbb10('0x18')](_0x285009);}return _0x916a32[_0xbb10('0x19')](_0x285009)['end']();};}function respondWithResult(_0x26e021,_0x42d7e4){_0x42d7e4=_0x42d7e4||0xc8;return function(_0x45b9d6){if(_0x45b9d6){return _0x26e021[_0xbb10('0x19')](_0x42d7e4)[_0xbb10('0x1a')](_0x45b9d6);}};}function respondWithFilteredResult(_0x2f2ebf,_0x24a57b){return function(_0x36b5e8){if(_0x36b5e8){var _0x3e26f4=typeof _0x24a57b[_0xbb10('0x1b')]==='undefined'&&typeof _0x24a57b[_0xbb10('0x1c')]===_0xbb10('0x1d');var _0x133ac2=_0x36b5e8[_0xbb10('0x1e')];var _0x378da8=_0x3e26f4?0x0:_0x24a57b[_0xbb10('0x1b')];var _0x575cca=_0x3e26f4?_0x36b5e8[_0xbb10('0x1e')]:_0x24a57b[_0xbb10('0x1b')]+_0x24a57b[_0xbb10('0x1c')];var _0x48b6e9;if(_0x575cca>=_0x133ac2){_0x575cca=_0x133ac2;_0x48b6e9=0xc8;}else{_0x48b6e9=0xce;}_0x2f2ebf[_0xbb10('0x19')](_0x48b6e9);return _0x2f2ebf[_0xbb10('0x1f')](_0xbb10('0x20'),_0x378da8+'-'+_0x575cca+'/'+_0x133ac2)[_0xbb10('0x1a')](_0x36b5e8);}return null;};}function patchUpdates(_0xdf237d){return function(_0x44e563){try{jsonpatch['apply'](_0x44e563,_0xdf237d,!![]);}catch(_0x12f888){return BPromise[_0xbb10('0x21')](_0x12f888);}return _0x44e563['save']();};}function saveUpdates(_0x4c4b0d,_0x8e2b97){return function(_0x311abe){if(_0x311abe){return _0x311abe[_0xbb10('0x22')](_0x4c4b0d)[_0xbb10('0x23')](function(_0x445761){return _0x445761;});}return null;};}function removeEntity(_0x1824b7,_0x407cb4){return function(_0x436104){if(_0x436104){return _0x436104[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x1824b7[_0xbb10('0x19')](0xcc)[_0xbb10('0x25')]();});}};}function handleEntityNotFound(_0x537898,_0x4fedac){return function(_0x4fb5e0){if(!_0x4fb5e0){_0x537898[_0xbb10('0x18')](0x194);}return _0x4fb5e0;};}function handleError(_0x3c5ae7,_0x2c89b9){_0x2c89b9=_0x2c89b9||0x1f4;return function(_0x4e25ff){logger[_0xbb10('0x26')](_0x4e25ff[_0xbb10('0x27')]);if(_0x4e25ff[_0xbb10('0x28')]){delete _0x4e25ff[_0xbb10('0x28')];}_0x3c5ae7[_0xbb10('0x19')](_0x2c89b9)[_0xbb10('0x29')](_0x4e25ff);};}exports[_0xbb10('0x2a')]=function(_0x4aabb9,_0x3796c7){var _0x21ac54={},_0xfc3595={},_0x2e0249={'count':0x0,'rows':[]};var _0x1d30aa=_[_0xbb10('0x2b')](db['VoiceCallReport'][_0xbb10('0x2c')],function(_0x4ee02e){return{'name':_0x4ee02e[_0xbb10('0x2d')],'type':_0x4ee02e['type'][_0xbb10('0x2e')]};});_0xfc3595[_0xbb10('0x2f')]=_[_0xbb10('0x2b')](_0x1d30aa,'name');_0xfc3595['query']=_[_0xbb10('0x30')](_0x4aabb9[_0xbb10('0x31')]);_0xfc3595['filters']=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],_0xfc3595[_0xbb10('0x31')]);_0x21ac54[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x4aabb9['query'][_0xbb10('0x34')]));_0x21ac54[_0xbb10('0x33')]=_0x21ac54[_0xbb10('0x33')][_0xbb10('0x35')]?_0x21ac54[_0xbb10('0x33')]:_0xfc3595[_0xbb10('0x2f')];if(!_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x36')](_0xbb10('0x37'))){_0x21ac54['limit']=qs[_0xbb10('0x1c')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x1c')]);_0x21ac54[_0xbb10('0x1b')]=qs['offset'](_0x4aabb9[_0xbb10('0x31')]['offset']);}_0x21ac54['order']=qs[_0xbb10('0x38')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x38')]);_0x21ac54[_0xbb10('0x39')]=qs[_0xbb10('0x3a')](_[_0xbb10('0x3b')](_0x4aabb9['query'],_0xfc3595[_0xbb10('0x3a')]),_0x1d30aa);if(_0x4aabb9[_0xbb10('0x31')]['filter']){_0x21ac54['where']=_['merge'](_0x21ac54[_0xbb10('0x39')],{'$or':_[_0xbb10('0x2b')](_0x1d30aa,function(_0x2b658a){if(_0x2b658a['type']!==_0xbb10('0x3c')){var _0x3e8538={};_0x3e8538[_0x2b658a[_0xbb10('0x28')]]={'$like':'%'+_0x4aabb9['query'][_0xbb10('0x3d')]+'%'};return _0x3e8538;}})});}_0x21ac54=_[_0xbb10('0x3e')]({},_0x21ac54,_0x4aabb9[_0xbb10('0x3f')]);var _0x446f49={'where':_0x21ac54['where']};return db[_0xbb10('0x40')][_0xbb10('0x1e')](_0x446f49)['then'](function(_0xe2040f){_0x2e0249[_0xbb10('0x1e')]=_0xe2040f;if(_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x41')]){_0x21ac54[_0xbb10('0x42')]=[{'attributes':['id',_0xbb10('0x28'),'fullname',_0xbb10('0x43')],'model':db[_0xbb10('0x44')],'as':_0xbb10('0x44')}];}return db[_0xbb10('0x40')]['findAll'](_0x21ac54);})[_0xbb10('0x23')](function(_0x331751){_0x2e0249[_0xbb10('0x45')]=_0x331751;return _0x2e0249;})[_0xbb10('0x23')](respondWithFilteredResult(_0x3796c7,_0x21ac54))['catch'](handleError(_0x3796c7,null));};exports[_0xbb10('0x46')]=function(_0x202c60,_0x54ac18){var _0x5d9a4f={'raw':!![],'where':{'id':_0x202c60['params']['id']}},_0x38d78f={};_0x38d78f[_0xbb10('0x2f')]=_[_0xbb10('0x30')](db['VoiceCallReport'][_0xbb10('0x2c')]);_0x38d78f[_0xbb10('0x31')]=_[_0xbb10('0x30')](_0x202c60['query']);_0x38d78f[_0xbb10('0x3a')]=_[_0xbb10('0x32')](_0x38d78f[_0xbb10('0x2f')],_0x38d78f[_0xbb10('0x31')]);_0x5d9a4f[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0x38d78f[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x202c60[_0xbb10('0x31')][_0xbb10('0x34')]));_0x5d9a4f[_0xbb10('0x33')]=_0x5d9a4f[_0xbb10('0x33')]['length']?_0x5d9a4f[_0xbb10('0x33')]:_0x38d78f[_0xbb10('0x2f')];if(_0x202c60['query'][_0xbb10('0x41')]){_0x5d9a4f[_0xbb10('0x42')]=[{'all':!![]}];}_0x5d9a4f=_[_0xbb10('0x3e')]({},_0x5d9a4f,_0x202c60[_0xbb10('0x3f')]);return db[_0xbb10('0x40')][_0xbb10('0x47')](_0x5d9a4f)[_0xbb10('0x23')](handleEntityNotFound(_0x54ac18,null))['then'](respondWithResult(_0x54ac18,null))['catch'](handleError(_0x54ac18,null));};exports[_0xbb10('0x48')]=function(_0x76a208,_0x2b12bd){return db['VoiceCallReport']['create'](_0x76a208[_0xbb10('0x49')],{})[_0xbb10('0x23')](respondWithResult(_0x2b12bd,0xc9))[_0xbb10('0x4a')](handleError(_0x2b12bd,null));};exports[_0xbb10('0x24')]=function(_0x10159b,_0x22b315){return db[_0xbb10('0x40')][_0xbb10('0x47')]({'where':{'id':_0x10159b[_0xbb10('0x4b')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x22b315,null))['then'](removeEntity(_0x22b315,null))['catch'](handleError(_0x22b315,null));};exports[_0xbb10('0x4c')]=function(_0x467dba,_0x36ab7d){return db[_0xbb10('0x40')][_0xbb10('0x4c')]()[_0xbb10('0x23')](respondWithResult(_0x36ab7d,null))[_0xbb10('0x4a')](handleError(_0x36ab7d,null));};exports[_0xbb10('0x22')]=function(_0x1c0d8f,_0x1214f7){if(_0x1c0d8f[_0xbb10('0x49')][_0xbb10('0x4d')]){delete _0x1c0d8f[_0xbb10('0x49')][_0xbb10('0x4d')];}return db[_0xbb10('0x40')]['find']({'where':{'uniqueid':_0x1c0d8f[_0xbb10('0x4b')]['id'],'UserId':{'$or':[null,_0x1c0d8f['user']['id']]}}})[_0xbb10('0x23')](handleEntityNotFound(_0x1214f7,null))[_0xbb10('0x23')](saveUpdates(_0x1c0d8f[_0xbb10('0x49')],null))[_0xbb10('0x23')](respondWithResult(_0x1214f7,null))[_0xbb10('0x4a')](handleError(_0x1214f7,null));};
\ No newline at end of file
index e3306be..2b49bc3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xecb7=['../../config/logger','api','moment','bluebird','rimraf','./voiceCallReport.attributes','define','VoiceCallReport','report_call','lodash'];(function(_0x2dbce7,_0x57cb8d){var _0x3a3ed0=function(_0x28c8c6){while(--_0x28c8c6){_0x2dbce7['push'](_0x2dbce7['shift']());}};_0x3a3ed0(++_0x57cb8d);}(_0xecb7,0xdb));var _0x7ecb=function(_0x16fa13,_0x5efd8d){_0x16fa13=_0x16fa13-0x0;var _0x17e9d1=_0xecb7[_0x16fa13];return _0x17e9d1;};'use strict';var _=require(_0x7ecb('0x0'));var util=require('util');var logger=require(_0x7ecb('0x1'))(_0x7ecb('0x2'));var moment=require(_0x7ecb('0x3'));var BPromise=require(_0x7ecb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7ecb('0x5'));var config=require('../../config/environment');var attributes=require(_0x7ecb('0x6'));module['exports']=function(_0x442b24,_0xb03e38){return _0x442b24[_0x7ecb('0x7')](_0x7ecb('0x8'),attributes,{'tableName':_0x7ecb('0x9'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x97d4=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','report_call','uniqueid','lodash','util','../../config/logger'];(function(_0x2c881c,_0x523cb5){var _0x21a3f0=function(_0x38c216){while(--_0x38c216){_0x2c881c['push'](_0x2c881c['shift']());}};_0x21a3f0(++_0x523cb5);}(_0x97d4,0xa2));var _0x497d=function(_0x2ba740,_0x62a305){_0x2ba740=_0x2ba740-0x0;var _0x358bda=_0x97d4[_0x2ba740];return _0x358bda;};'use strict';var _=require(_0x497d('0x0'));var util=require(_0x497d('0x1'));var logger=require(_0x497d('0x2'))(_0x497d('0x3'));var moment=require(_0x497d('0x4'));var BPromise=require(_0x497d('0x5'));var rp=require(_0x497d('0x6'));var fs=require('fs');var path=require(_0x497d('0x7'));var rimraf=require(_0x497d('0x8'));var config=require(_0x497d('0x9'));var attributes=require(_0x497d('0xa'));module[_0x497d('0xb')]=function(_0x3f1d7c,_0x5a5a72){return _0x3f1d7c[_0x497d('0xc')]('VoiceCallReport',attributes,{'tableName':_0x497d('0xd'),'paranoid':![],'indexes':[{'fields':[_0x497d('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index 1825abe..a8e4fca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x219c=['update','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','where','attributes','limit','include','model','map','then','CreateVoiceCallReport','create','body','raw','UpdateVoiceCallReport'];(function(_0x5c6289,_0x4a6832){var _0x33fa33=function(_0x247d05){while(--_0x247d05){_0x5c6289['push'](_0x5c6289['shift']());}};_0x33fa33(++_0x4a6832);}(_0x219c,0xa9));var _0xc219=function(_0x21c854,_0x558c84){_0x21c854=_0x21c854-0x0;var _0x385689=_0x219c[_0x21c854];return _0x385689;};'use strict';var _=require(_0xc219('0x0'));var util=require(_0xc219('0x1'));var moment=require(_0xc219('0x2'));var BPromise=require(_0xc219('0x3'));var rs=require(_0xc219('0x4'));var fs=require('fs');var Redis=require(_0xc219('0x5'));var db=require(_0xc219('0x6'))['db'];var utils=require(_0xc219('0x7'));var logger=require('../../config/logger')(_0xc219('0x8'));var config=require(_0xc219('0x9'));var jayson=require(_0xc219('0xa'));var client=jayson[_0xc219('0xb')][_0xc219('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x54b700,_0x578846,_0x4e5f0e){return new BPromise(function(_0x3f57cb,_0x345bd8){return client[_0xc219('0xd')](_0x54b700,_0x4e5f0e)['then'](function(_0x4548eb){logger[_0xc219('0xe')](_0xc219('0xf'),_0x578846,_0xc219('0x10'));logger[_0xc219('0x11')](_0xc219('0x12'),_0x578846,_0xc219('0x10'),JSON[_0xc219('0x13')](_0x4548eb));if(_0x4548eb[_0xc219('0x14')]){if(_0x4548eb[_0xc219('0x14')][_0xc219('0x15')]===0x1f4){logger[_0xc219('0x14')](_0xc219('0xf'),_0x578846,_0x4548eb[_0xc219('0x14')][_0xc219('0x16')]);return _0x345bd8(_0x4548eb[_0xc219('0x14')][_0xc219('0x16')]);}logger[_0xc219('0x14')](_0xc219('0xf'),_0x578846,_0x4548eb[_0xc219('0x14')][_0xc219('0x16')]);return _0x3f57cb(_0x4548eb[_0xc219('0x14')]['message']);}else{logger[_0xc219('0xe')](_0xc219('0xf'),_0x578846,_0xc219('0x10'));_0x3f57cb(_0x4548eb[_0xc219('0x17')]['message']);}})[_0xc219('0x18')](function(_0x2c3aed){logger[_0xc219('0x14')](_0xc219('0xf'),_0x578846,_0x2c3aed);_0x345bd8(_0x2c3aed);});});}exports[_0xc219('0x19')]=function(_0x2c27c0){var _0x518184=this;return new Promise(function(_0xa60eb8,_0x18e1b9){return db[_0xc219('0x1a')][_0xc219('0x1b')]({'raw':_0x2c27c0['options']?_0x2c27c0[_0xc219('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x2c27c0[_0xc219('0x1c')]?_0x2c27c0[_0xc219('0x1c')][_0xc219('0x1d')]||null:null,'attributes':_0x2c27c0[_0xc219('0x1c')]?_0x2c27c0[_0xc219('0x1c')][_0xc219('0x1e')]||null:null,'limit':_0x2c27c0[_0xc219('0x1c')]?_0x2c27c0['options'][_0xc219('0x1f')]||null:null,'include':_0x2c27c0[_0xc219('0x1c')]?_0x2c27c0[_0xc219('0x1c')][_0xc219('0x20')]?_['map'](_0x2c27c0['options']['include'],function(_0x49ee3f){return{'model':db[_0x49ee3f[_0xc219('0x21')]],'as':_0x49ee3f['as'],'attributes':_0x49ee3f['attributes'],'include':_0x49ee3f[_0xc219('0x20')]?_[_0xc219('0x22')](_0x49ee3f[_0xc219('0x20')],function(_0x52e1ef){return{'model':db[_0x52e1ef[_0xc219('0x21')]],'as':_0x52e1ef['as'],'attributes':_0x52e1ef[_0xc219('0x1e')],'include':_0x52e1ef[_0xc219('0x20')]?_['map'](_0x52e1ef[_0xc219('0x20')],function(_0x623e7){return{'model':db[_0x623e7[_0xc219('0x21')]],'as':_0x623e7['as'],'attributes':_0x623e7[_0xc219('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc219('0x23')](function(_0x244e4d){logger[_0xc219('0xe')](_0xc219('0x19'),_0x2c27c0);logger[_0xc219('0x11')](_0xc219('0x19'),_0x2c27c0,JSON[_0xc219('0x13')](_0x244e4d));_0xa60eb8(_0x244e4d);})[_0xc219('0x18')](function(_0x1a6974){logger[_0xc219('0x14')]('GetVoiceCallReport',_0x1a6974[_0xc219('0x16')],_0x2c27c0);_0x18e1b9(_0x518184[_0xc219('0x14')](0x1f4,_0x1a6974[_0xc219('0x16')]));});});};exports[_0xc219('0x24')]=function(_0x9ecb03){var _0x5ea12c=this;return new Promise(function(_0x3b91df,_0x37f923){return db[_0xc219('0x1a')][_0xc219('0x25')](_0x9ecb03[_0xc219('0x26')],{'raw':_0x9ecb03['options']?_0x9ecb03['options'][_0xc219('0x27')]===undefined?!![]:![]:!![]})[_0xc219('0x23')](function(_0x2153c8){logger[_0xc219('0xe')](_0xc219('0x24'),_0x9ecb03);logger[_0xc219('0x11')]('CreateVoiceCallReport',_0x9ecb03,JSON[_0xc219('0x13')](_0x2153c8));_0x3b91df(_0x2153c8);})[_0xc219('0x18')](function(_0x68345f){logger['error']('CreateVoiceCallReport',_0x68345f[_0xc219('0x16')],_0x9ecb03);_0x37f923(_0x5ea12c[_0xc219('0x14')](0x1f4,_0x68345f[_0xc219('0x16')]));});});};exports[_0xc219('0x28')]=function(_0xf47303){var _0x2db956=this;return new Promise(function(_0x515a1f,_0x285876){return db['VoiceCallReport'][_0xc219('0x29')](_0xf47303['body'],{'raw':_0xf47303['options']?_0xf47303[_0xc219('0x1c')][_0xc219('0x27')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf47303['options']?_0xf47303[_0xc219('0x1c')][_0xc219('0x1d')]||null:null,'attributes':_0xf47303[_0xc219('0x1c')]?_0xf47303[_0xc219('0x1c')][_0xc219('0x1e')]||null:null,'limit':_0xf47303[_0xc219('0x1c')]?_0xf47303[_0xc219('0x1c')][_0xc219('0x1f')]||null:null})[_0xc219('0x23')](function(_0x338b8a){logger['info'](_0xc219('0x28'),_0xf47303);logger[_0xc219('0x11')](_0xc219('0x28'),_0xf47303,JSON['stringify'](_0x338b8a));_0x515a1f(_0x338b8a);})[_0xc219('0x18')](function(_0x1e0ef0){logger['error'](_0xc219('0x28'),_0x1e0ef0[_0xc219('0x16')],_0xf47303);_0x285876(_0x2db956[_0xc219('0x14')](0x1f4,_0x1e0ef0[_0xc219('0x16')]));});});};
\ No newline at end of file
+var _0xbbc2=['limit','include','map','model','then','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0xbbc2,0x82));var _0x2bbc=function(_0x48865e,_0x586854){_0x48865e=_0x48865e-0x0;var _0x15cc56=_0xbbc2[_0x48865e];return _0x15cc56;};'use strict';var _=require(_0x2bbc('0x0'));var util=require('util');var moment=require(_0x2bbc('0x1'));var BPromise=require(_0x2bbc('0x2'));var rs=require(_0x2bbc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2bbc('0x4'))['db'];var utils=require(_0x2bbc('0x5'));var logger=require(_0x2bbc('0x6'))(_0x2bbc('0x7'));var config=require(_0x2bbc('0x8'));var jayson=require(_0x2bbc('0x9'));var client=jayson[_0x2bbc('0xa')][_0x2bbc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e4b5b,_0xa709ea,_0x2e60ea){return new BPromise(function(_0x2dc404,_0x53589f){return client[_0x2bbc('0xc')](_0x5e4b5b,_0x2e60ea)['then'](function(_0x3452e6){logger['info'](_0x2bbc('0xd'),_0xa709ea,_0x2bbc('0xe'));logger[_0x2bbc('0xf')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0xa709ea,'request\x20sent',JSON[_0x2bbc('0x10')](_0x3452e6));if(_0x3452e6[_0x2bbc('0x11')]){if(_0x3452e6[_0x2bbc('0x11')][_0x2bbc('0x12')]===0x1f4){logger[_0x2bbc('0x11')](_0x2bbc('0xd'),_0xa709ea,_0x3452e6[_0x2bbc('0x11')]['message']);return _0x53589f(_0x3452e6['error'][_0x2bbc('0x13')]);}logger['error'](_0x2bbc('0xd'),_0xa709ea,_0x3452e6[_0x2bbc('0x11')]['message']);return _0x2dc404(_0x3452e6['error']['message']);}else{logger[_0x2bbc('0x14')](_0x2bbc('0xd'),_0xa709ea,'request\x20sent');_0x2dc404(_0x3452e6[_0x2bbc('0x15')][_0x2bbc('0x13')]);}})[_0x2bbc('0x16')](function(_0x851051){logger[_0x2bbc('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0xa709ea,_0x851051);_0x53589f(_0x851051);});});}exports[_0x2bbc('0x17')]=function(_0x2b673a){var _0xe1ef0d=this;return new Promise(function(_0x1ab6ff,_0x47e861){return db[_0x2bbc('0x18')][_0x2bbc('0x19')]({'raw':_0x2b673a['options']?_0x2b673a[_0x2bbc('0x1a')][_0x2bbc('0x1b')]===undefined?!![]:![]:!![],'where':_0x2b673a[_0x2bbc('0x1a')]?_0x2b673a[_0x2bbc('0x1a')][_0x2bbc('0x1c')]||null:null,'attributes':_0x2b673a['options']?_0x2b673a[_0x2bbc('0x1a')][_0x2bbc('0x1d')]||null:null,'limit':_0x2b673a['options']?_0x2b673a['options'][_0x2bbc('0x1e')]||null:null,'include':_0x2b673a['options']?_0x2b673a['options'][_0x2bbc('0x1f')]?_[_0x2bbc('0x20')](_0x2b673a[_0x2bbc('0x1a')][_0x2bbc('0x1f')],function(_0xe4d735){return{'model':db[_0xe4d735['model']],'as':_0xe4d735['as'],'attributes':_0xe4d735[_0x2bbc('0x1d')],'include':_0xe4d735[_0x2bbc('0x1f')]?_['map'](_0xe4d735[_0x2bbc('0x1f')],function(_0x3344cd){return{'model':db[_0x3344cd[_0x2bbc('0x21')]],'as':_0x3344cd['as'],'attributes':_0x3344cd['attributes'],'include':_0x3344cd[_0x2bbc('0x1f')]?_[_0x2bbc('0x20')](_0x3344cd['include'],function(_0x4f0483){return{'model':db[_0x4f0483[_0x2bbc('0x21')]],'as':_0x4f0483['as'],'attributes':_0x4f0483[_0x2bbc('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x2bbc('0x22')](function(_0x2b7971){logger[_0x2bbc('0x14')](_0x2bbc('0x17'),_0x2b673a);logger[_0x2bbc('0xf')](_0x2bbc('0x17'),_0x2b673a,JSON[_0x2bbc('0x10')](_0x2b7971));_0x1ab6ff(_0x2b7971);})[_0x2bbc('0x16')](function(_0x4fb821){logger['error'](_0x2bbc('0x17'),_0x4fb821['message'],_0x2b673a);_0x47e861(_0xe1ef0d[_0x2bbc('0x11')](0x1f4,_0x4fb821['message']));});});};exports[_0x2bbc('0x23')]=function(_0x477124){var _0x31d12e=this;return new Promise(function(_0x3e53a5,_0x26b7a5){return db[_0x2bbc('0x18')][_0x2bbc('0x24')](_0x477124[_0x2bbc('0x25')],{'raw':_0x477124[_0x2bbc('0x1a')]?_0x477124[_0x2bbc('0x1a')][_0x2bbc('0x1b')]===undefined?!![]:![]:!![]})[_0x2bbc('0x22')](function(_0x1090d2){logger[_0x2bbc('0x14')]('CreateVoiceCallReport',_0x477124);logger['debug'](_0x2bbc('0x23'),_0x477124,JSON[_0x2bbc('0x10')](_0x1090d2));_0x3e53a5(_0x1090d2);})['catch'](function(_0x21cdb9){logger[_0x2bbc('0x11')](_0x2bbc('0x23'),_0x21cdb9[_0x2bbc('0x13')],_0x477124);_0x26b7a5(_0x31d12e[_0x2bbc('0x11')](0x1f4,_0x21cdb9[_0x2bbc('0x13')]));});});};exports[_0x2bbc('0x26')]=function(_0x182088){var _0x20987d=this;return new Promise(function(_0x5247fb,_0x12a922){return db[_0x2bbc('0x18')][_0x2bbc('0x27')](_0x182088[_0x2bbc('0x25')],{'raw':_0x182088[_0x2bbc('0x1a')]?_0x182088['options'][_0x2bbc('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x182088[_0x2bbc('0x1a')]?_0x182088[_0x2bbc('0x1a')][_0x2bbc('0x1c')]||null:null,'attributes':_0x182088[_0x2bbc('0x1a')]?_0x182088[_0x2bbc('0x1a')]['attributes']||null:null,'limit':_0x182088['options']?_0x182088['options']['limit']||null:null})[_0x2bbc('0x22')](function(_0xe74548){logger[_0x2bbc('0x14')](_0x2bbc('0x26'),_0x182088);logger[_0x2bbc('0xf')](_0x2bbc('0x26'),_0x182088,JSON['stringify'](_0xe74548));_0x5247fb(_0xe74548);})[_0x2bbc('0x16')](function(_0x7f9aa4){logger[_0x2bbc('0x11')](_0x2bbc('0x26'),_0x7f9aa4[_0x2bbc('0x13')],_0x182088);_0x12a922(_0x20987d[_0x2bbc('0x11')](0x1f4,_0x7f9aa4['message']));});});};
\ No newline at end of file
index f734835..f4d7e9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb06f=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','multer'];(function(_0x23c8ce,_0x3bf878){var _0x51c744=function(_0x5db5b5){while(--_0x5db5b5){_0x23c8ce['push'](_0x23c8ce['shift']());}};_0x51c744(++_0x3bf878);}(_0xb06f,0x76));var _0xfb06=function(_0x28288c,_0x4ee354){_0x28288c=_0x28288c-0x0;var _0x1b6d3e=_0xb06f[_0x28288c];return _0x1b6d3e;};'use strict';var multer=require(_0xfb06('0x0'));var util=require(_0xfb06('0x1'));var path=require(_0xfb06('0x2'));var timeout=require(_0xfb06('0x3'));var express=require(_0xfb06('0x4'));var router=express['Router']();var fs_extra=require(_0xfb06('0x5'));var auth=require(_0xfb06('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceChanSpy.controller');router[_0xfb06('0x7')]('/',auth[_0xfb06('0x8')](),controller['index']);router[_0xfb06('0x7')]('/:id',auth[_0xfb06('0x8')](),controller[_0xfb06('0x9')]);router[_0xfb06('0xa')]('/',auth['isAuthenticated'](),controller[_0xfb06('0xb')]);router[_0xfb06('0xc')](_0xfb06('0xd'),auth[_0xfb06('0x8')](),controller[_0xfb06('0xe')]);router[_0xfb06('0xf')](_0xfb06('0xd'),auth[_0xfb06('0x8')](),controller[_0xfb06('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x3b84=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','exports','multer','util','path'];(function(_0x5c7a85,_0x41dd19){var _0x35290f=function(_0x26215b){while(--_0x26215b){_0x5c7a85['push'](_0x5c7a85['shift']());}};_0x35290f(++_0x41dd19);}(_0x3b84,0x1c5));var _0x43b8=function(_0x25609f,_0x55e93d){_0x25609f=_0x25609f-0x0;var _0x4c7649=_0x3b84[_0x25609f];return _0x4c7649;};'use strict';var multer=require(_0x43b8('0x0'));var util=require(_0x43b8('0x1'));var path=require(_0x43b8('0x2'));var timeout=require('connect-timeout');var express=require(_0x43b8('0x3'));var router=express[_0x43b8('0x4')]();var fs_extra=require(_0x43b8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x43b8('0x6'));var config=require(_0x43b8('0x7'));var controller=require('./voiceChanSpy.controller');router[_0x43b8('0x8')]('/',auth[_0x43b8('0x9')](),controller[_0x43b8('0xa')]);router[_0x43b8('0x8')]('/:id',auth[_0x43b8('0x9')](),controller[_0x43b8('0xb')]);router[_0x43b8('0xc')]('/',auth[_0x43b8('0x9')](),controller[_0x43b8('0xd')]);router[_0x43b8('0xe')](_0x43b8('0xf'),auth['isAuthenticated'](),controller[_0x43b8('0x10')]);router[_0x43b8('0x11')](_0x43b8('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x43b8('0x12')]=router;
\ No newline at end of file
index 03f4fce..a780f59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x06ec=['join','BOOLEAN','sequelize','exports','STRING','name','setDataValue','options'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x06ec,0x6a));var _0xc06e=function(_0x17f641,_0x59e74b){_0x17f641=_0x17f641-0x0;var _0x7515e=_0x06ec[_0x17f641];return _0x7515e;};'use strict';var Sequelize=require(_0xc06e('0x0'));module[_0xc06e('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xc06e('0x2')],'unique':_0xc06e('0x3'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x195a2a){this[_0xc06e('0x4')](_0xc06e('0x5'),_0x195a2a?_0x195a2a[_0xc06e('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0xc06e('0x5'))?this['getDataValue']('options')['split'](''):[];}},'auth':{'type':Sequelize[_0xc06e('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0xc06e('0x2')]},'record':{'type':Sequelize[_0xc06e('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xc06e('0x2')]},'description':{'type':Sequelize[_0xc06e('0x2')]}};
\ No newline at end of file
+var _0x0540=['name','setDataValue','join','options','split','BOOLEAN','exports','STRING'];(function(_0x1e2447,_0x5fea89){var _0x306f03=function(_0x11ac2c){while(--_0x11ac2c){_0x1e2447['push'](_0x1e2447['shift']());}};_0x306f03(++_0x5fea89);}(_0x0540,0x176));var _0x0054=function(_0x5bb3dd,_0x3e6f99){_0x5bb3dd=_0x5bb3dd-0x0;var _0x50eefe=_0x0540[_0x5bb3dd];return _0x50eefe;};'use strict';var Sequelize=require('sequelize');module[_0x0054('0x0')]={'name':{'type':Sequelize[_0x0054('0x1')]},'prefix':{'type':Sequelize['STRING'],'unique':_0x0054('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x0054('0x1')],'set':function(_0x189ee5){this[_0x0054('0x3')]('options',_0x189ee5?_0x189ee5[_0x0054('0x4')](''):[]);},'get':function(){return this['getDataValue'](_0x0054('0x5'))?this['getDataValue']('options')[_0x0054('0x6')](''):[];}},'auth':{'type':Sequelize[_0x0054('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x0054('0x1')]},'record':{'type':Sequelize[_0x0054('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0054('0x1')]}};
\ No newline at end of file
index b9ad902..b77e8d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x40b5=['sox','to-csv','ejs','lodash','squel','crypto','jsforce','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','save','update','then','destroy','get','ChanSpies','UserProfileResource','error','stack','send','index','map','VoiceChanSpy','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','name','findAll','rows','catch','show','keys','includeAll','include','options','create','body','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path'];(function(_0xe9d15b,_0x5547ef){var _0x51a9ea=function(_0x494786){while(--_0x494786){_0xe9d15b['push'](_0xe9d15b['shift']());}};_0x51a9ea(++_0x5547ef);}(_0x40b5,0x1d7));var _0x540b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x40b5[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x540b('0x0'));var rimraf=require(_0x540b('0x1'));var zipdir=require(_0x540b('0x2'));var jsonpatch=require(_0x540b('0x3'));var rp=require(_0x540b('0x4'));var moment=require(_0x540b('0x5'));var BPromise=require(_0x540b('0x6'));var Mustache=require('mustache');var util=require(_0x540b('0x7'));var path=require(_0x540b('0x8'));var sox=require(_0x540b('0x9'));var csv=require(_0x540b('0xa'));var ejs=require(_0x540b('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x540b('0xc'));var squel=require(_0x540b('0xd'));var crypto=require(_0x540b('0xe'));var jsforce=require(_0x540b('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x540b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x540b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x540b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x540b('0x12'));var utils=require(_0x540b('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x540b('0x14'));var db=require(_0x540b('0x15'))['db'];function respondWithStatusCode(_0xbdeb7c,_0x341564){_0x341564=_0x341564||0xcc;return function(_0x5f4237){if(_0x5f4237){return _0xbdeb7c[_0x540b('0x16')](_0x341564);}return _0xbdeb7c[_0x540b('0x17')](_0x341564)[_0x540b('0x18')]();};}function respondWithResult(_0xba0b7d,_0x498616){_0x498616=_0x498616||0xc8;return function(_0x18e0f7){if(_0x18e0f7){return _0xba0b7d['status'](_0x498616)['json'](_0x18e0f7);}};}function respondWithFilteredResult(_0x2ab462,_0x1c9743){return function(_0xbff023){if(_0xbff023){var _0x415ba6=typeof _0x1c9743[_0x540b('0x19')]==='undefined'&&typeof _0x1c9743[_0x540b('0x1a')]===_0x540b('0x1b');var _0x118e5d=_0xbff023[_0x540b('0x1c')];var _0x44dff4=_0x415ba6?0x0:_0x1c9743[_0x540b('0x19')];var _0x2a3265=_0x415ba6?_0xbff023[_0x540b('0x1c')]:_0x1c9743[_0x540b('0x19')]+_0x1c9743['limit'];var _0x1b9401;if(_0x2a3265>=_0x118e5d){_0x2a3265=_0x118e5d;_0x1b9401=0xc8;}else{_0x1b9401=0xce;}_0x2ab462[_0x540b('0x17')](_0x1b9401);return _0x2ab462['set'](_0x540b('0x1d'),_0x44dff4+'-'+_0x2a3265+'/'+_0x118e5d)['json'](_0xbff023);}return null;};}function patchUpdates(_0x342cbd){return function(_0x5e49d7){try{jsonpatch['apply'](_0x5e49d7,_0x342cbd,!![]);}catch(_0x17674c){return BPromise['reject'](_0x17674c);}return _0x5e49d7[_0x540b('0x1e')]();};}function saveUpdates(_0x1e316e,_0x1069f3){return function(_0x4d7422){if(_0x4d7422){return _0x4d7422[_0x540b('0x1f')](_0x1e316e)[_0x540b('0x20')](function(_0x1378c2){return _0x1378c2;});}return null;};}function removeEntity(_0x1f69d4,_0x24f49b){return function(_0x310930){if(_0x310930){return _0x310930[_0x540b('0x21')]()[_0x540b('0x20')](function(){var _0x9478e1=_0x310930[_0x540b('0x22')]({'plain':!![]});var _0x494fb8=_0x540b('0x23');return db[_0x540b('0x24')]['destroy']({'where':{'type':_0x494fb8,'resourceId':_0x9478e1['id']}})['then'](function(){return _0x310930;});})[_0x540b('0x20')](function(){_0x1f69d4[_0x540b('0x17')](0xcc)[_0x540b('0x18')]();});}};}function handleEntityNotFound(_0x341b22,_0x53d272){return function(_0x379353){if(!_0x379353){_0x341b22[_0x540b('0x16')](0x194);}return _0x379353;};}function handleError(_0x91a150,_0x38a93b){_0x38a93b=_0x38a93b||0x1f4;return function(_0xd3f5f6){logger[_0x540b('0x25')](_0xd3f5f6[_0x540b('0x26')]);if(_0xd3f5f6['name']){delete _0xd3f5f6['name'];}_0x91a150['status'](_0x38a93b)[_0x540b('0x27')](_0xd3f5f6);};}exports[_0x540b('0x28')]=function(_0x3eb220,_0x4cbf04){var _0x547cbe={},_0x3926aa={},_0x3a9fe4={'count':0x0,'rows':[]};var _0x541b72=_[_0x540b('0x29')](db[_0x540b('0x2a')][_0x540b('0x2b')],function(_0x3179bb){return{'name':_0x3179bb[_0x540b('0x2c')],'type':_0x3179bb[_0x540b('0x2d')][_0x540b('0x2e')]};});_0x3926aa[_0x540b('0x2f')]=_[_0x540b('0x29')](_0x541b72,'name');_0x3926aa[_0x540b('0x30')]=_['keys'](_0x3eb220[_0x540b('0x30')]);_0x3926aa[_0x540b('0x31')]=_[_0x540b('0x32')](_0x3926aa[_0x540b('0x2f')],_0x3926aa[_0x540b('0x30')]);_0x547cbe[_0x540b('0x33')]=_[_0x540b('0x32')](_0x3926aa[_0x540b('0x2f')],qs[_0x540b('0x34')](_0x3eb220[_0x540b('0x30')]['fields']));_0x547cbe[_0x540b('0x33')]=_0x547cbe['attributes'][_0x540b('0x35')]?_0x547cbe['attributes']:_0x3926aa['model'];if(!_0x3eb220['query'][_0x540b('0x36')]('nolimit')){_0x547cbe[_0x540b('0x1a')]=qs[_0x540b('0x1a')](_0x3eb220['query']['limit']);_0x547cbe[_0x540b('0x19')]=qs['offset'](_0x3eb220[_0x540b('0x30')][_0x540b('0x19')]);}_0x547cbe[_0x540b('0x37')]=qs[_0x540b('0x38')](_0x3eb220[_0x540b('0x30')]['sort']);_0x547cbe[_0x540b('0x39')]=qs[_0x540b('0x31')](_[_0x540b('0x3a')](_0x3eb220[_0x540b('0x30')],_0x3926aa['filters']),_0x541b72);if(_0x3eb220['query'][_0x540b('0x3b')]){_0x547cbe['where']=_[_0x540b('0x3c')](_0x547cbe[_0x540b('0x39')],{'$or':_[_0x540b('0x29')](_0x541b72,function(_0x57eec5){if(_0x57eec5['type']!=='VIRTUAL'){var _0x4fe6ee={};_0x4fe6ee[_0x57eec5[_0x540b('0x3d')]]={'$like':'%'+_0x3eb220[_0x540b('0x30')]['filter']+'%'};return _0x4fe6ee;}})});}_0x547cbe=_[_0x540b('0x3c')]({},_0x547cbe,_0x3eb220['options']);var _0x3e9f40={'where':_0x547cbe[_0x540b('0x39')]};return db[_0x540b('0x2a')]['count'](_0x3e9f40)[_0x540b('0x20')](function(_0x311a3d){_0x3a9fe4[_0x540b('0x1c')]=_0x311a3d;if(_0x3eb220['query']['includeAll']){_0x547cbe['include']=[{'all':!![]}];}return db['VoiceChanSpy'][_0x540b('0x3e')](_0x547cbe);})[_0x540b('0x20')](function(_0x161d1b){_0x3a9fe4[_0x540b('0x3f')]=_0x161d1b;return _0x3a9fe4;})[_0x540b('0x20')](respondWithFilteredResult(_0x4cbf04,_0x547cbe))[_0x540b('0x40')](handleError(_0x4cbf04,null));};exports[_0x540b('0x41')]=function(_0x3511cf,_0x55882a){var _0x53a8da={'raw':![],'where':{'id':_0x3511cf['params']['id']}},_0x479ce9={};_0x479ce9[_0x540b('0x2f')]=_[_0x540b('0x42')](db[_0x540b('0x2a')][_0x540b('0x2b')]);_0x479ce9['query']=_[_0x540b('0x42')](_0x3511cf[_0x540b('0x30')]);_0x479ce9[_0x540b('0x31')]=_[_0x540b('0x32')](_0x479ce9[_0x540b('0x2f')],_0x479ce9['query']);_0x53a8da[_0x540b('0x33')]=_[_0x540b('0x32')](_0x479ce9[_0x540b('0x2f')],qs[_0x540b('0x34')](_0x3511cf['query']['fields']));_0x53a8da[_0x540b('0x33')]=_0x53a8da[_0x540b('0x33')][_0x540b('0x35')]?_0x53a8da[_0x540b('0x33')]:_0x479ce9[_0x540b('0x2f')];if(_0x3511cf[_0x540b('0x30')][_0x540b('0x43')]){_0x53a8da[_0x540b('0x44')]=[{'all':!![]}];}_0x53a8da=_['merge']({},_0x53a8da,_0x3511cf[_0x540b('0x45')]);return db[_0x540b('0x2a')]['find'](_0x53a8da)[_0x540b('0x20')](handleEntityNotFound(_0x55882a,null))['then'](respondWithResult(_0x55882a,null))['catch'](handleError(_0x55882a,null));};exports[_0x540b('0x46')]=function(_0x2616e9,_0x42496b){return db[_0x540b('0x2a')][_0x540b('0x46')](_0x2616e9[_0x540b('0x47')],{})['then'](function(_0x2bae67){var _0x3d782c=_0x2616e9['user'][_0x540b('0x22')]({'plain':!![]});if(!_0x3d782c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3d782c[_0x540b('0x48')]===_0x540b('0x49')){var _0x3bbaa6=_0x2bae67[_0x540b('0x22')]({'plain':!![]});var _0x5bdfbf=_0x540b('0x23');return db[_0x540b('0x4a')][_0x540b('0x4b')]({'where':{'name':_0x5bdfbf,'userProfileId':_0x3d782c[_0x540b('0x4c')]},'raw':!![]})[_0x540b('0x20')](function(_0x1d89c0){if(_0x1d89c0&&_0x1d89c0[_0x540b('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x3bbaa6['name'],'resourceId':_0x3bbaa6['id'],'type':_0x1d89c0[_0x540b('0x3d')],'sectionId':_0x1d89c0['id']},{})[_0x540b('0x20')](function(){return _0x2bae67;});}else{return _0x2bae67;}})[_0x540b('0x40')](function(_0xacc4c5){logger[_0x540b('0x25')](_0x540b('0x4e'),_0xacc4c5);throw _0xacc4c5;});}return _0x2bae67;})[_0x540b('0x20')](respondWithResult(_0x42496b,0xc9))[_0x540b('0x40')](handleError(_0x42496b,null));};exports[_0x540b('0x1f')]=function(_0x169461,_0x510c24){if(_0x169461[_0x540b('0x47')]['id']){delete _0x169461[_0x540b('0x47')]['id'];}return db['VoiceChanSpy'][_0x540b('0x4b')]({'where':{'id':_0x169461[_0x540b('0x4f')]['id']}})['then'](handleEntityNotFound(_0x510c24,null))[_0x540b('0x20')](saveUpdates(_0x169461[_0x540b('0x47')],null))[_0x540b('0x20')](respondWithResult(_0x510c24,null))[_0x540b('0x40')](handleError(_0x510c24,null));};exports[_0x540b('0x21')]=function(_0x245981,_0x51f33e){return db[_0x540b('0x2a')][_0x540b('0x4b')]({'where':{'id':_0x245981[_0x540b('0x4f')]['id']}})[_0x540b('0x20')](handleEntityNotFound(_0x51f33e,null))[_0x540b('0x20')](removeEntity(_0x51f33e,null))[_0x540b('0x40')](handleError(_0x51f33e,null));};
\ No newline at end of file
+var _0xc964=['offset','limit','count','set','Content-Range','save','update','then','destroy','ChanSpies','sendStatus','error','name','send','index','map','VoiceChanSpy','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','options','include','findAll','catch','show','params','rawAttributes','includeAll','body','user','get','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','end','status','json'];(function(_0x5b3321,_0x558edf){var _0x5d6728=function(_0x4ab7f3){while(--_0x4ab7f3){_0x5b3321['push'](_0x5b3321['shift']());}};_0x5d6728(++_0x558edf);}(_0xc964,0x7e));var _0x4c96=function(_0x3a529a,_0x21bce7){_0x3a529a=_0x3a529a-0x0;var _0x1be2ae=_0xc964[_0x3a529a];return _0x1be2ae;};'use strict';var emlformat=require(_0x4c96('0x0'));var rimraf=require(_0x4c96('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4c96('0x2'));var rp=require(_0x4c96('0x3'));var moment=require(_0x4c96('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4c96('0x5'));var util=require('util');var path=require(_0x4c96('0x6'));var sox=require(_0x4c96('0x7'));var csv=require(_0x4c96('0x8'));var ejs=require(_0x4c96('0x9'));var fs=require('fs');var fs_extra=require(_0x4c96('0xa'));var _=require(_0x4c96('0xb'));var squel=require(_0x4c96('0xc'));var crypto=require('crypto');var jsforce=require(_0x4c96('0xd'));var deskjs=require(_0x4c96('0xe'));var toCsv=require(_0x4c96('0x8'));var querystring=require('querystring');var Papa=require(_0x4c96('0xf'));var Redis=require(_0x4c96('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4c96('0x11'));var logger=require(_0x4c96('0x12'))(_0x4c96('0x13'));var utils=require('../../config/utils');var config=require(_0x4c96('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xee3c14,_0xa97d4c){_0xa97d4c=_0xa97d4c||0xcc;return function(_0xa9dfdc){if(_0xa9dfdc){return _0xee3c14['sendStatus'](_0xa97d4c);}return _0xee3c14['status'](_0xa97d4c)[_0x4c96('0x15')]();};}function respondWithResult(_0x176ea7,_0x181afb){_0x181afb=_0x181afb||0xc8;return function(_0x4d80c9){if(_0x4d80c9){return _0x176ea7[_0x4c96('0x16')](_0x181afb)[_0x4c96('0x17')](_0x4d80c9);}};}function respondWithFilteredResult(_0x167537,_0x3c6fce){return function(_0x433608){if(_0x433608){var _0x66964b=typeof _0x3c6fce[_0x4c96('0x18')]==='undefined'&&typeof _0x3c6fce[_0x4c96('0x19')]==='undefined';var _0x2e8b8d=_0x433608['count'];var _0x2453e0=_0x66964b?0x0:_0x3c6fce['offset'];var _0x17891b=_0x66964b?_0x433608[_0x4c96('0x1a')]:_0x3c6fce[_0x4c96('0x18')]+_0x3c6fce[_0x4c96('0x19')];var _0x8a802a;if(_0x17891b>=_0x2e8b8d){_0x17891b=_0x2e8b8d;_0x8a802a=0xc8;}else{_0x8a802a=0xce;}_0x167537[_0x4c96('0x16')](_0x8a802a);return _0x167537[_0x4c96('0x1b')](_0x4c96('0x1c'),_0x2453e0+'-'+_0x17891b+'/'+_0x2e8b8d)[_0x4c96('0x17')](_0x433608);}return null;};}function patchUpdates(_0x9546c5){return function(_0x19b35a){try{jsonpatch['apply'](_0x19b35a,_0x9546c5,!![]);}catch(_0x5018b5){return BPromise['reject'](_0x5018b5);}return _0x19b35a[_0x4c96('0x1d')]();};}function saveUpdates(_0x13eaa0,_0x29f3a3){return function(_0x2bf708){if(_0x2bf708){return _0x2bf708[_0x4c96('0x1e')](_0x13eaa0)[_0x4c96('0x1f')](function(_0x5b549c){return _0x5b549c;});}return null;};}function removeEntity(_0x25d9a0,_0x451c6c){return function(_0x2cabae){if(_0x2cabae){return _0x2cabae[_0x4c96('0x20')]()[_0x4c96('0x1f')](function(){var _0x23fbfa=_0x2cabae['get']({'plain':!![]});var _0x367d99=_0x4c96('0x21');return db['UserProfileResource'][_0x4c96('0x20')]({'where':{'type':_0x367d99,'resourceId':_0x23fbfa['id']}})['then'](function(){return _0x2cabae;});})[_0x4c96('0x1f')](function(){_0x25d9a0[_0x4c96('0x16')](0xcc)[_0x4c96('0x15')]();});}};}function handleEntityNotFound(_0x1543d8,_0x59a913){return function(_0x20c94f){if(!_0x20c94f){_0x1543d8[_0x4c96('0x22')](0x194);}return _0x20c94f;};}function handleError(_0x31dec8,_0x498938){_0x498938=_0x498938||0x1f4;return function(_0x280c6b){logger[_0x4c96('0x23')](_0x280c6b['stack']);if(_0x280c6b[_0x4c96('0x24')]){delete _0x280c6b[_0x4c96('0x24')];}_0x31dec8[_0x4c96('0x16')](_0x498938)[_0x4c96('0x25')](_0x280c6b);};}exports[_0x4c96('0x26')]=function(_0x1712c4,_0x4c5e1a){var _0x5e2683={},_0x290e9e={},_0x454252={'count':0x0,'rows':[]};var _0x43f1fe=_[_0x4c96('0x27')](db[_0x4c96('0x28')]['rawAttributes'],function(_0x3d68e5){return{'name':_0x3d68e5['fieldName'],'type':_0x3d68e5[_0x4c96('0x29')]['key']};});_0x290e9e[_0x4c96('0x2a')]=_[_0x4c96('0x27')](_0x43f1fe,_0x4c96('0x24'));_0x290e9e[_0x4c96('0x2b')]=_[_0x4c96('0x2c')](_0x1712c4[_0x4c96('0x2b')]);_0x290e9e[_0x4c96('0x2d')]=_[_0x4c96('0x2e')](_0x290e9e[_0x4c96('0x2a')],_0x290e9e[_0x4c96('0x2b')]);_0x5e2683[_0x4c96('0x2f')]=_[_0x4c96('0x2e')](_0x290e9e[_0x4c96('0x2a')],qs[_0x4c96('0x30')](_0x1712c4[_0x4c96('0x2b')]['fields']));_0x5e2683[_0x4c96('0x2f')]=_0x5e2683[_0x4c96('0x2f')][_0x4c96('0x31')]?_0x5e2683['attributes']:_0x290e9e[_0x4c96('0x2a')];if(!_0x1712c4['query'][_0x4c96('0x32')]('nolimit')){_0x5e2683[_0x4c96('0x19')]=qs[_0x4c96('0x19')](_0x1712c4[_0x4c96('0x2b')]['limit']);_0x5e2683['offset']=qs[_0x4c96('0x18')](_0x1712c4[_0x4c96('0x2b')]['offset']);}_0x5e2683[_0x4c96('0x33')]=qs[_0x4c96('0x34')](_0x1712c4[_0x4c96('0x2b')][_0x4c96('0x34')]);_0x5e2683['where']=qs[_0x4c96('0x2d')](_[_0x4c96('0x35')](_0x1712c4[_0x4c96('0x2b')],_0x290e9e[_0x4c96('0x2d')]),_0x43f1fe);if(_0x1712c4[_0x4c96('0x2b')]['filter']){_0x5e2683[_0x4c96('0x36')]=_[_0x4c96('0x37')](_0x5e2683['where'],{'$or':_[_0x4c96('0x27')](_0x43f1fe,function(_0x39fbf3){if(_0x39fbf3[_0x4c96('0x29')]!==_0x4c96('0x38')){var _0x35b189={};_0x35b189[_0x39fbf3[_0x4c96('0x24')]]={'$like':'%'+_0x1712c4[_0x4c96('0x2b')]['filter']+'%'};return _0x35b189;}})});}_0x5e2683=_[_0x4c96('0x37')]({},_0x5e2683,_0x1712c4[_0x4c96('0x39')]);var _0x2e0001={'where':_0x5e2683[_0x4c96('0x36')]};return db[_0x4c96('0x28')][_0x4c96('0x1a')](_0x2e0001)[_0x4c96('0x1f')](function(_0x3bdd81){_0x454252[_0x4c96('0x1a')]=_0x3bdd81;if(_0x1712c4[_0x4c96('0x2b')]['includeAll']){_0x5e2683[_0x4c96('0x3a')]=[{'all':!![]}];}return db[_0x4c96('0x28')][_0x4c96('0x3b')](_0x5e2683);})[_0x4c96('0x1f')](function(_0x6e94f1){_0x454252['rows']=_0x6e94f1;return _0x454252;})[_0x4c96('0x1f')](respondWithFilteredResult(_0x4c5e1a,_0x5e2683))[_0x4c96('0x3c')](handleError(_0x4c5e1a,null));};exports[_0x4c96('0x3d')]=function(_0x34581e,_0x557f94){var _0x43311f={'raw':![],'where':{'id':_0x34581e[_0x4c96('0x3e')]['id']}},_0xd789ec={};_0xd789ec[_0x4c96('0x2a')]=_[_0x4c96('0x2c')](db['VoiceChanSpy'][_0x4c96('0x3f')]);_0xd789ec[_0x4c96('0x2b')]=_[_0x4c96('0x2c')](_0x34581e[_0x4c96('0x2b')]);_0xd789ec[_0x4c96('0x2d')]=_['intersection'](_0xd789ec['model'],_0xd789ec[_0x4c96('0x2b')]);_0x43311f['attributes']=_['intersection'](_0xd789ec[_0x4c96('0x2a')],qs[_0x4c96('0x30')](_0x34581e[_0x4c96('0x2b')][_0x4c96('0x30')]));_0x43311f[_0x4c96('0x2f')]=_0x43311f[_0x4c96('0x2f')][_0x4c96('0x31')]?_0x43311f[_0x4c96('0x2f')]:_0xd789ec[_0x4c96('0x2a')];if(_0x34581e['query'][_0x4c96('0x40')]){_0x43311f[_0x4c96('0x3a')]=[{'all':!![]}];}_0x43311f=_[_0x4c96('0x37')]({},_0x43311f,_0x34581e[_0x4c96('0x39')]);return db[_0x4c96('0x28')]['find'](_0x43311f)[_0x4c96('0x1f')](handleEntityNotFound(_0x557f94,null))[_0x4c96('0x1f')](respondWithResult(_0x557f94,null))['catch'](handleError(_0x557f94,null));};exports['create']=function(_0x106620,_0x33ba81){return db[_0x4c96('0x28')]['create'](_0x106620[_0x4c96('0x41')],{})[_0x4c96('0x1f')](function(_0x578290){var _0x2104dd=_0x106620[_0x4c96('0x42')][_0x4c96('0x43')]({'plain':!![]});if(!_0x2104dd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2104dd['role']==='user'){var _0x5e60f6=_0x578290[_0x4c96('0x43')]({'plain':!![]});var _0xa5a1b3=_0x4c96('0x21');return db[_0x4c96('0x44')][_0x4c96('0x45')]({'where':{'name':_0xa5a1b3,'userProfileId':_0x2104dd[_0x4c96('0x46')]},'raw':!![]})[_0x4c96('0x1f')](function(_0x10c05a){if(_0x10c05a&&_0x10c05a[_0x4c96('0x47')]===0x0){return db[_0x4c96('0x48')][_0x4c96('0x49')]({'name':_0x5e60f6[_0x4c96('0x24')],'resourceId':_0x5e60f6['id'],'type':_0x10c05a['name'],'sectionId':_0x10c05a['id']},{})['then'](function(){return _0x578290;});}else{return _0x578290;}})[_0x4c96('0x3c')](function(_0x454b63){logger['error'](_0x4c96('0x4a'),_0x454b63);throw _0x454b63;});}return _0x578290;})[_0x4c96('0x1f')](respondWithResult(_0x33ba81,0xc9))[_0x4c96('0x3c')](handleError(_0x33ba81,null));};exports[_0x4c96('0x1e')]=function(_0x1ac46c,_0x37d112){if(_0x1ac46c['body']['id']){delete _0x1ac46c[_0x4c96('0x41')]['id'];}return db['VoiceChanSpy'][_0x4c96('0x45')]({'where':{'id':_0x1ac46c[_0x4c96('0x3e')]['id']}})[_0x4c96('0x1f')](handleEntityNotFound(_0x37d112,null))[_0x4c96('0x1f')](saveUpdates(_0x1ac46c[_0x4c96('0x41')],null))[_0x4c96('0x1f')](respondWithResult(_0x37d112,null))['catch'](handleError(_0x37d112,null));};exports[_0x4c96('0x20')]=function(_0x1dfb78,_0x8ffe53){return db['VoiceChanSpy'][_0x4c96('0x45')]({'where':{'id':_0x1dfb78['params']['id']}})[_0x4c96('0x1f')](handleEntityNotFound(_0x8ffe53,null))[_0x4c96('0x1f')](removeEntity(_0x8ffe53,null))['catch'](handleError(_0x8ffe53,null));};
\ No newline at end of file
index d477db1..bfe1298 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd474=['exports','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','then','destroy','catch','lodash','bluebird','./voiceChanSpy.attributes','context','%s%s','system','push','merge','Set','chanspy','record','MixMonitor','format','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','StopMixMonitor','length','concat','internal','User','findAll'];(function(_0x2bfe52,_0x43946e){var _0x1cf649=function(_0xc8300c){while(--_0xc8300c){_0x2bfe52['push'](_0x2bfe52['shift']());}};_0x1cf649(++_0x43946e);}(_0xd474,0xfd));var _0x4d47=function(_0x5305f2,_0x180334){_0x5305f2=_0x5305f2-0x0;var _0x59a8f7=_0xd474[_0x5305f2];return _0x59a8f7;};'use strict';var _=require(_0x4d47('0x0'));var util=require('util');var BPromise=require(_0x4d47('0x1'));var attributes=require(_0x4d47('0x2'));var getUserApplications=function(_0x14c73e,_0x49255f,_0x56ecd1){var _0x2bf556=0x1;var _0x3d47ff=[];var _0x579704={'context':_0x49255f[_0x4d47('0x3')]||'from-sip','exten':util['format'](_0x4d47('0x4'),_0x14c73e['prefix'],_0x56ecd1),'type':_0x4d47('0x5'),'isApp':![],'ChanSpyId':_0x14c73e['id'],'UserId':_0x49255f['id']};_0x3d47ff[_0x4d47('0x6')](_[_0x4d47('0x7')]({'app':_0x4d47('0x8'),'appdata':util['format']('CDR(type)=%s',_0x4d47('0x9')),'priority':_0x2bf556++},_0x579704));if(_0x14c73e[_0x4d47('0xa')]){_0x3d47ff[_0x4d47('0x6')](_[_0x4d47('0x7')]({'app':_0x4d47('0xb'),'appdata':util[_0x4d47('0xc')]('${UNIQUEID}.%s,a',_0x14c73e[_0x4d47('0xd')]),'priority':_0x2bf556++},_0x579704));}if(_0x14c73e[_0x4d47('0xe')]){_0x3d47ff[_0x4d47('0x6')](_[_0x4d47('0x7')]({'app':_0x4d47('0xf'),'appdata':_0x14c73e[_0x4d47('0x10')],'priority':_0x2bf556++},_0x579704));}_0x3d47ff[_0x4d47('0x6')](_[_0x4d47('0x7')]({'app':_0x4d47('0x11'),'appdata':util[_0x4d47('0xc')](_0x4d47('0x12'),_0x49255f[_0x4d47('0x13')],_0x14c73e['options']?_0x14c73e[_0x4d47('0x14')]['join'](''):''),'priority':_0x2bf556++},_0x579704));if(_0x14c73e[_0x4d47('0xa')]){_0x3d47ff[_0x4d47('0x6')](_[_0x4d47('0x7')]({'app':_0x4d47('0x15'),'priority':_0x2bf556++},_0x579704));}return _0x3d47ff;};var getChanSpyApplications=function(_0x182cae,_0x1f1e23){var _0x54c91c=[];for(var _0x4e1ba2=0x0,_0x478bb6=0x1;_0x4e1ba2<_0x1f1e23[_0x4d47('0x16')];_0x4e1ba2++,_0x478bb6=0x1){_0x54c91c=_0x54c91c[_0x4d47('0x17')](getUserApplications(_0x182cae,_0x1f1e23[_0x4e1ba2],_0x1f1e23[_0x4e1ba2][_0x4d47('0x18')]));if(_0x1f1e23[_0x4e1ba2]['internal']!=_0x1f1e23[_0x4e1ba2]['name']){_0x54c91c=_0x54c91c[_0x4d47('0x17')](getUserApplications(_0x182cae,_0x1f1e23[_0x4e1ba2],_0x1f1e23[_0x4e1ba2][_0x4d47('0x13')]));}}return _0x54c91c;};var getChanSpyPromise=function(_0x56a2cb,_0x2ded02){return new BPromise(function(_0x42bc10,_0x23525d){return _0x56a2cb[_0x4d47('0x19')][_0x4d47('0x1a')]({'attributes':['id',_0x4d47('0x13'),'internal'],'where':{'role':'agent','chanspy':!![]},'raw':!![]})['then'](function(_0x43a382){if(_0x43a382){return _0x42bc10(getChanSpyApplications(_0x2ded02,_0x43a382));}return _0x42bc10([]);})['catch'](function(_0x26d02b){_0x23525d(_0x26d02b);});});};module[_0x4d47('0x1b')]=function(_0x39d516,_0x2e8fda){var _0x2243d2=_0x39d516['models'];return _0x39d516['define'](_0x4d47('0x1c'),attributes,{'tableName':_0x4d47('0x1d'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x55607e,_0x5374ec,_0x15f9e1){return getChanSpyPromise(_0x2243d2,_0x55607e)['then'](function(_0x502523){if(_0x502523&&_0x502523[_0x4d47('0x16')]){return _0x2243d2[_0x4d47('0x1e')][_0x4d47('0x1f')](_0x502523);}})[_0x4d47('0x20')](function(){_0x15f9e1();})['catch'](function(_0x15a02c){_0x15f9e1(_0x15a02c);});},'afterUpdate':function(_0x3ca8b8,_0x475d6d,_0x5a8d43){return _0x2243d2[_0x4d47('0x1e')][_0x4d47('0x21')]({'where':{'ChanSpyId':_0x3ca8b8['id']}})[_0x4d47('0x20')](function(){return getChanSpyPromise(_0x2243d2,_0x3ca8b8);})[_0x4d47('0x20')](function(_0x36201e){if(_0x36201e&&_0x36201e[_0x4d47('0x16')]){return _0x2243d2[_0x4d47('0x1e')][_0x4d47('0x1f')](_0x36201e);}})[_0x4d47('0x20')](function(){_0x5a8d43();})[_0x4d47('0x22')](function(_0x329f1a){_0x5a8d43(_0x329f1a);});},'afterDestroy':function(_0x58fc3,_0x5a3818,_0x20669a){return _0x2243d2[_0x4d47('0x1e')][_0x4d47('0x21')]({'where':{'ChanSpyId':_0x58fc3['id']}})[_0x4d47('0x20')](function(){_0x20669a();})['catch'](function(_0x2e9f01){_0x20669a(_0x2e9f01);});}}});};
\ No newline at end of file
+var _0x7f52=['destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','push','Set','CDR(type)=%s','chanspy','record','merge','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','options','join','StopMixMonitor','length','concat','internal','name','findAll','agent','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate'];(function(_0x26bcec,_0xe13f50){var _0x1049dc=function(_0x4c0d9b){while(--_0x4c0d9b){_0x26bcec['push'](_0x26bcec['shift']());}};_0x1049dc(++_0xe13f50);}(_0x7f52,0x172));var _0x27f5=function(_0x555800,_0x489d4c){_0x555800=_0x555800-0x0;var _0x27a4ef=_0x7f52[_0x555800];return _0x27a4ef;};'use strict';var _=require(_0x27f5('0x0'));var util=require(_0x27f5('0x1'));var BPromise=require(_0x27f5('0x2'));var attributes=require(_0x27f5('0x3'));var getUserApplications=function(_0x5ac5cb,_0x77eac9,_0x5e6f94){var _0x2123b4=0x1;var _0x173811=[];var _0x16098a={'context':_0x77eac9[_0x27f5('0x4')]||_0x27f5('0x5'),'exten':util[_0x27f5('0x6')](_0x27f5('0x7'),_0x5ac5cb[_0x27f5('0x8')],_0x5e6f94),'type':'system','isApp':![],'ChanSpyId':_0x5ac5cb['id'],'UserId':_0x77eac9['id']};_0x173811[_0x27f5('0x9')](_['merge']({'app':_0x27f5('0xa'),'appdata':util[_0x27f5('0x6')](_0x27f5('0xb'),_0x27f5('0xc')),'priority':_0x2123b4++},_0x16098a));if(_0x5ac5cb[_0x27f5('0xd')]){_0x173811[_0x27f5('0x9')](_[_0x27f5('0xe')]({'app':_0x27f5('0xf'),'appdata':util[_0x27f5('0x6')](_0x27f5('0x10'),_0x5ac5cb[_0x27f5('0x11')]),'priority':_0x2123b4++},_0x16098a));}if(_0x5ac5cb[_0x27f5('0x12')]){_0x173811[_0x27f5('0x9')](_[_0x27f5('0xe')]({'app':_0x27f5('0x13'),'appdata':_0x5ac5cb[_0x27f5('0x14')],'priority':_0x2123b4++},_0x16098a));}_0x173811['push'](_['merge']({'app':_0x27f5('0x15'),'appdata':util['format']('SIP/%s,%s',_0x77eac9['name'],_0x5ac5cb[_0x27f5('0x16')]?_0x5ac5cb[_0x27f5('0x16')][_0x27f5('0x17')](''):''),'priority':_0x2123b4++},_0x16098a));if(_0x5ac5cb[_0x27f5('0xd')]){_0x173811['push'](_[_0x27f5('0xe')]({'app':_0x27f5('0x18'),'priority':_0x2123b4++},_0x16098a));}return _0x173811;};var getChanSpyApplications=function(_0x26f3d7,_0x347aa2){var _0x9b42f2=[];for(var _0xd2def0=0x0,_0x5f0f7e=0x1;_0xd2def0<_0x347aa2[_0x27f5('0x19')];_0xd2def0++,_0x5f0f7e=0x1){_0x9b42f2=_0x9b42f2[_0x27f5('0x1a')](getUserApplications(_0x26f3d7,_0x347aa2[_0xd2def0],_0x347aa2[_0xd2def0][_0x27f5('0x1b')]));if(_0x347aa2[_0xd2def0]['internal']!=_0x347aa2[_0xd2def0][_0x27f5('0x1c')]){_0x9b42f2=_0x9b42f2[_0x27f5('0x1a')](getUserApplications(_0x26f3d7,_0x347aa2[_0xd2def0],_0x347aa2[_0xd2def0][_0x27f5('0x1c')]));}}return _0x9b42f2;};var getChanSpyPromise=function(_0x58d4e6,_0x2d238c){return new BPromise(function(_0x4bc845,_0x164e09){return _0x58d4e6['User'][_0x27f5('0x1d')]({'attributes':['id',_0x27f5('0x1c'),_0x27f5('0x1b')],'where':{'role':_0x27f5('0x1e'),'chanspy':!![]},'raw':!![]})[_0x27f5('0x1f')](function(_0xfe1b12){if(_0xfe1b12){return _0x4bc845(getChanSpyApplications(_0x2d238c,_0xfe1b12));}return _0x4bc845([]);})[_0x27f5('0x20')](function(_0x4df849){_0x164e09(_0x4df849);});});};module[_0x27f5('0x21')]=function(_0x4920a0,_0x428bc6){var _0x373c80=_0x4920a0[_0x27f5('0x22')];return _0x4920a0[_0x27f5('0x23')](_0x27f5('0x24'),attributes,{'tableName':_0x27f5('0x25'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x20dddb,_0x2b32a6,_0x39540a){return getChanSpyPromise(_0x373c80,_0x20dddb)[_0x27f5('0x1f')](function(_0x3218b2){if(_0x3218b2&&_0x3218b2[_0x27f5('0x19')]){return _0x373c80[_0x27f5('0x26')][_0x27f5('0x27')](_0x3218b2);}})[_0x27f5('0x1f')](function(){_0x39540a();})['catch'](function(_0x2e4da6){_0x39540a(_0x2e4da6);});},'afterUpdate':function(_0x141c22,_0x136d97,_0x47ea2a){return _0x373c80[_0x27f5('0x26')]['destroy']({'where':{'ChanSpyId':_0x141c22['id']}})[_0x27f5('0x1f')](function(){return getChanSpyPromise(_0x373c80,_0x141c22);})[_0x27f5('0x1f')](function(_0x486127){if(_0x486127&&_0x486127['length']){return _0x373c80[_0x27f5('0x26')]['bulkCreate'](_0x486127);}})[_0x27f5('0x1f')](function(){_0x47ea2a();})[_0x27f5('0x20')](function(_0x3b1c3e){_0x47ea2a(_0x3b1c3e);});},'afterDestroy':function(_0x3d65fa,_0x5bd281,_0x416e2e){return _0x373c80[_0x27f5('0x26')][_0x27f5('0x28')]({'where':{'ChanSpyId':_0x3d65fa['id']}})[_0x27f5('0x1f')](function(){_0x416e2e();})[_0x27f5('0x20')](function(_0x4e4ddc){_0x416e2e(_0x4e4ddc);});}}});};
\ No newline at end of file
index 4ac6cbf..38745c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bde=['code','message','VoiceChanSpy,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x1fbe2d,_0x95b94c){var _0x3d9f3d=function(_0x2c32f4){while(--_0x2c32f4){_0x1fbe2d['push'](_0x1fbe2d['shift']());}};_0x3d9f3d(++_0x95b94c);}(_0x9bde,0xe1));var _0xe9bd=function(_0xbd53ab,_0x1b5f3d){_0xbd53ab=_0xbd53ab-0x0;var _0xa14915=_0x9bde[_0xbd53ab];return _0xa14915;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var moment=require('moment');var BPromise=require(_0xe9bd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9bd('0x2'));var db=require(_0xe9bd('0x3'))['db'];var utils=require(_0xe9bd('0x4'));var logger=require(_0xe9bd('0x5'))(_0xe9bd('0x6'));var config=require(_0xe9bd('0x7'));var jayson=require(_0xe9bd('0x8'));var client=jayson['client'][_0xe9bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f18fe,_0x22a438,_0xa66ae2){return new BPromise(function(_0x2d5c75,_0x3ef9e3){return client[_0xe9bd('0xa')](_0x5f18fe,_0xa66ae2)[_0xe9bd('0xb')](function(_0x439abc){logger[_0xe9bd('0xc')]('VoiceChanSpy,\x20%s,\x20%s',_0x22a438,'request\x20sent');logger[_0xe9bd('0xd')](_0xe9bd('0xe'),_0x22a438,_0xe9bd('0xf'),JSON['stringify'](_0x439abc));if(_0x439abc[_0xe9bd('0x10')]){if(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x11')]===0x1f4){logger[_0xe9bd('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x22a438,_0x439abc[_0xe9bd('0x10')]['message']);return _0x3ef9e3(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}logger[_0xe9bd('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x22a438,_0x439abc['error'][_0xe9bd('0x12')]);return _0x2d5c75(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}else{logger[_0xe9bd('0xc')](_0xe9bd('0x13'),_0x22a438,_0xe9bd('0xf'));_0x2d5c75(_0x439abc[_0xe9bd('0x14')]['message']);}})[_0xe9bd('0x15')](function(_0x464a1b){logger[_0xe9bd('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x22a438,_0x464a1b);_0x3ef9e3(_0x464a1b);});});}
\ No newline at end of file
+var _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','VoiceChanSpy,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0xaa88,0x137));var _0x8aa8=function(_0x3c6dce,_0x5424dd){_0x3c6dce=_0x3c6dce-0x0;var _0x1450e9=_0xaa88[_0x3c6dce];return _0x1450e9;};'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')]('VoiceChanSpy,\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')]('VoiceChanSpy,\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')]('VoiceChanSpy,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});}
\ No newline at end of file
index 8382985..7e5ab16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbdd=['multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceContext.controller','get','index','/:id','isAuthenticated','create','put','delete','destroy','exports'];(function(_0x23168d,_0x36525d){var _0x1f222c=function(_0x1db3f0){while(--_0x1db3f0){_0x23168d['push'](_0x23168d['shift']());}};_0x1f222c(++_0x36525d);}(_0xdbdd,0x132));var _0xddbd=function(_0x18ae03,_0x2c5081){_0x18ae03=_0x18ae03-0x0;var _0x484538=_0xdbdd[_0x18ae03];return _0x484538;};'use strict';var multer=require(_0xddbd('0x0'));var util=require(_0xddbd('0x1'));var path=require('path');var timeout=require(_0xddbd('0x2'));var express=require(_0xddbd('0x3'));var router=express['Router']();var fs_extra=require(_0xddbd('0x4'));var auth=require(_0xddbd('0x5'));var interaction=require(_0xddbd('0x6'));var config=require('../../config/environment');var controller=require(_0xddbd('0x7'));router[_0xddbd('0x8')]('/',auth['isAuthenticated'](),controller[_0xddbd('0x9')]);router[_0xddbd('0x8')](_0xddbd('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xddbd('0xb')](),controller[_0xddbd('0xc')]);router[_0xddbd('0xd')](_0xddbd('0xa'),auth[_0xddbd('0xb')](),controller['update']);router[_0xddbd('0xe')](_0xddbd('0xa'),auth['isAuthenticated'](),controller[_0xddbd('0xf')]);module[_0xddbd('0x10')]=router;
\ No newline at end of file
+var _0x0a0f=['/:id','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./voiceContext.controller','isAuthenticated','index','get'];(function(_0x2f6c54,_0x27457e){var _0x53e7c5=function(_0x4ecb25){while(--_0x4ecb25){_0x2f6c54['push'](_0x2f6c54['shift']());}};_0x53e7c5(++_0x27457e);}(_0x0a0f,0x125));var _0xf0a0=function(_0x59c5e8,_0x482de4){_0x59c5e8=_0x59c5e8-0x0;var _0x220a95=_0x0a0f[_0x59c5e8];return _0x220a95;};'use strict';var multer=require(_0xf0a0('0x0'));var util=require('util');var path=require(_0xf0a0('0x1'));var timeout=require(_0xf0a0('0x2'));var express=require(_0xf0a0('0x3'));var router=express['Router']();var fs_extra=require(_0xf0a0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf0a0('0x5'));var config=require(_0xf0a0('0x6'));var controller=require(_0xf0a0('0x7'));router['get']('/',auth[_0xf0a0('0x8')](),controller[_0xf0a0('0x9')]);router[_0xf0a0('0xa')](_0xf0a0('0xb'),auth[_0xf0a0('0x8')](),controller['show']);router[_0xf0a0('0xc')]('/',auth['isAuthenticated'](),controller[_0xf0a0('0xd')]);router[_0xf0a0('0xe')](_0xf0a0('0xb'),auth[_0xf0a0('0x8')](),controller[_0xf0a0('0xf')]);router[_0xf0a0('0x10')](_0xf0a0('0xb'),auth[_0xf0a0('0x8')](),controller[_0xf0a0('0x11')]);module[_0xf0a0('0x12')]=router;
\ No newline at end of file
index 53ae4f6..bcfb4e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf06f=['name','STRING','sequelize','exports'];(function(_0x5380cd,_0x1ea634){var _0x25dd61=function(_0x277132){while(--_0x277132){_0x5380cd['push'](_0x5380cd['shift']());}};_0x25dd61(++_0x1ea634);}(_0xf06f,0x7e));var _0xff06=function(_0x17bdc,_0x5920c8){_0x17bdc=_0x17bdc-0x0;var _0x89fae9=_0xf06f[_0x17bdc];return _0x89fae9;};'use strict';var Sequelize=require(_0xff06('0x0'));module[_0xff06('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xff06('0x2')},'description':{'type':Sequelize[_0xff06('0x3')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x364a=['sequelize','exports','name','STRING','BOOLEAN'];(function(_0x5e6d09,_0x5b6e09){var _0x5dd34d=function(_0x2b45d4){while(--_0x2b45d4){_0x5e6d09['push'](_0x5e6d09['shift']());}};_0x5dd34d(++_0x5b6e09);}(_0x364a,0x122));var _0xa364=function(_0x321208,_0x26fe9f){_0x321208=_0x321208-0x0;var _0x358ffc=_0x364a[_0x321208];return _0x358ffc;};'use strict';var Sequelize=require(_0xa364('0x0'));module[_0xa364('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xa364('0x2')},'description':{'type':Sequelize[_0xa364('0x3')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xa364('0x4')],'defaultValue':0x0}};
\ No newline at end of file
index 5fae67c..0c5c1de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xccec=['intersection','attributes','fields','length','sort','pick','filter','where','merge','VIRTUAL','VoiceContext','includeAll','include','findAll','show','params','options','create','readFileSync','join','root','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','server/files/templates/context.ejs','Reload','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','debug','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','get','Contexts','UserProfileResource','end','name','send','rawAttributes','fieldName','type','model','map','query','keys','filters'];(function(_0x38782c,_0x5c9fef){var _0x3708bf=function(_0x595e13){while(--_0x595e13){_0x38782c['push'](_0x38782c['shift']());}};_0x3708bf(++_0x5c9fef);}(_0xccec,0x88));var _0xccce=function(_0x1ee2ae,_0x17c0eb){_0x1ee2ae=_0x1ee2ae-0x0;var _0x1780e5=_0xccec[_0x1ee2ae];return _0x1780e5;};'use strict';var emlformat=require(_0xccce('0x0'));var rimraf=require(_0xccce('0x1'));var zipdir=require(_0xccce('0x2'));var jsonpatch=require(_0xccce('0x3'));var rp=require(_0xccce('0x4'));var moment=require(_0xccce('0x5'));var BPromise=require(_0xccce('0x6'));var Mustache=require(_0xccce('0x7'));var util=require('util');var path=require(_0xccce('0x8'));var sox=require('sox');var csv=require(_0xccce('0x9'));var ejs=require(_0xccce('0xa'));var fs=require('fs');var fs_extra=require(_0xccce('0xb'));var _=require(_0xccce('0xc'));var squel=require('squel');var crypto=require(_0xccce('0xd'));var jsforce=require(_0xccce('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xccce('0x9'));var querystring=require('querystring');var Papa=require(_0xccce('0xf'));var Redis=require('ioredis');var authService=require(_0xccce('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xccce('0x11'));var hardwareService=require(_0xccce('0x12'));var logger=require(_0xccce('0x13'))(_0xccce('0x14'));var utils=require(_0xccce('0x15'));var config=require(_0xccce('0x16'));var licenseUtil=require(_0xccce('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0xccce('0x18'));var client=jayson[_0xccce('0x19')][_0xccce('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x5c8c39,_0x36d347,_0x25e15a,_0x2e0320){return new BPromise(function(_0x4fb4c7,_0x34a015){var _0x55b2ab=_0x2e0320||client;return _0x55b2ab[_0xccce('0x1b')](_0x5c8c39,_0x25e15a)[_0xccce('0x1c')](function(_0x1e1ce3){logger[_0xccce('0x1d')](_0xccce('0x1e'),_0x36d347,'request\x20sent');logger[_0xccce('0x1f')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x36d347,'request\x20sent',JSON[_0xccce('0x20')](_0x1e1ce3));if(_0x1e1ce3[_0xccce('0x21')]){if(_0x1e1ce3[_0xccce('0x21')][_0xccce('0x22')]===0x1f4){logger[_0xccce('0x21')]('VoiceContext,\x20%s,\x20%s',_0x36d347,_0x1e1ce3['error']['message']);return _0x34a015(_0x1e1ce3[_0xccce('0x21')][_0xccce('0x23')]);}logger[_0xccce('0x21')](_0xccce('0x1e'),_0x36d347,_0x1e1ce3[_0xccce('0x21')][_0xccce('0x23')]);return _0x4fb4c7(_0x1e1ce3[_0xccce('0x21')][_0xccce('0x23')]);}else{logger[_0xccce('0x1d')](_0xccce('0x1e'),_0x36d347,'request\x20sent');_0x4fb4c7(_0x1e1ce3[_0xccce('0x24')][_0xccce('0x23')]);}})[_0xccce('0x25')](function(_0x40cd97){logger[_0xccce('0x21')](_0xccce('0x1e'),_0x36d347,_0x40cd97);_0x34a015(_0x40cd97);});});}function respondWithStatusCode(_0x3af422,_0x21a16f){_0x21a16f=_0x21a16f||0xcc;return function(_0x52ce49){if(_0x52ce49){return _0x3af422[_0xccce('0x26')](_0x21a16f);}return _0x3af422['status'](_0x21a16f)['end']();};}function respondWithResult(_0x428517,_0x2b9389){_0x2b9389=_0x2b9389||0xc8;return function(_0x5efc05){if(_0x5efc05){return _0x428517[_0xccce('0x27')](_0x2b9389)[_0xccce('0x28')](_0x5efc05);}};}function respondWithFilteredResult(_0x3d48db,_0x2aea83){return function(_0x55034){if(_0x55034){var _0x41c956=typeof _0x2aea83[_0xccce('0x29')]===_0xccce('0x2a')&&typeof _0x2aea83[_0xccce('0x2b')]==='undefined';var _0x893134=_0x55034[_0xccce('0x2c')];var _0x51415a=_0x41c956?0x0:_0x2aea83[_0xccce('0x29')];var _0x8eb2a8=_0x41c956?_0x55034[_0xccce('0x2c')]:_0x2aea83[_0xccce('0x29')]+_0x2aea83['limit'];var _0x4a3568;if(_0x8eb2a8>=_0x893134){_0x8eb2a8=_0x893134;_0x4a3568=0xc8;}else{_0x4a3568=0xce;}_0x3d48db[_0xccce('0x27')](_0x4a3568);return _0x3d48db[_0xccce('0x2d')](_0xccce('0x2e'),_0x51415a+'-'+_0x8eb2a8+'/'+_0x893134)['json'](_0x55034);}return null;};}function patchUpdates(_0x1fc8dd){return function(_0x22a19c){try{jsonpatch['apply'](_0x22a19c,_0x1fc8dd,!![]);}catch(_0x273770){return BPromise[_0xccce('0x2f')](_0x273770);}return _0x22a19c[_0xccce('0x30')]();};}function saveUpdates(_0x455f7a,_0x347a28){return function(_0x440877){if(_0x440877){return _0x440877['update'](_0x455f7a)[_0xccce('0x1c')](function(_0x4150fb){return _0x4150fb;});}return null;};}function removeEntity(_0x248137,_0x4fa62f){return function(_0x173f74){if(_0x173f74){return _0x173f74[_0xccce('0x31')]()[_0xccce('0x1c')](function(){var _0x3225df=_0x173f74[_0xccce('0x32')]({'plain':!![]});var _0x1c7e16=_0xccce('0x33');return db[_0xccce('0x34')][_0xccce('0x31')]({'where':{'type':_0x1c7e16,'resourceId':_0x3225df['id']}})[_0xccce('0x1c')](function(){return _0x173f74;});})['then'](function(){_0x248137[_0xccce('0x27')](0xcc)[_0xccce('0x35')]();});}};}function handleEntityNotFound(_0x2b3663,_0x2fa4c){return function(_0x2cb607){if(!_0x2cb607){_0x2b3663[_0xccce('0x26')](0x194);}return _0x2cb607;};}function handleError(_0x1eb6e6,_0x17d631){_0x17d631=_0x17d631||0x1f4;return function(_0x17f056){logger[_0xccce('0x21')](_0x17f056['stack']);if(_0x17f056[_0xccce('0x36')]){delete _0x17f056['name'];}_0x1eb6e6['status'](_0x17d631)[_0xccce('0x37')](_0x17f056);};}exports['index']=function(_0x2fb4dc,_0x49c130){var _0x1524fc={},_0x2fb113={},_0x106d24={'count':0x0,'rows':[]};var _0x3b34fd=_['map'](db['VoiceContext'][_0xccce('0x38')],function(_0x186e4f){return{'name':_0x186e4f[_0xccce('0x39')],'type':_0x186e4f[_0xccce('0x3a')]['key']};});_0x2fb113[_0xccce('0x3b')]=_[_0xccce('0x3c')](_0x3b34fd,'name');_0x2fb113[_0xccce('0x3d')]=_[_0xccce('0x3e')](_0x2fb4dc[_0xccce('0x3d')]);_0x2fb113[_0xccce('0x3f')]=_[_0xccce('0x40')](_0x2fb113[_0xccce('0x3b')],_0x2fb113['query']);_0x1524fc[_0xccce('0x41')]=_[_0xccce('0x40')](_0x2fb113[_0xccce('0x3b')],qs[_0xccce('0x42')](_0x2fb4dc[_0xccce('0x3d')]['fields']));_0x1524fc[_0xccce('0x41')]=_0x1524fc[_0xccce('0x41')][_0xccce('0x43')]?_0x1524fc[_0xccce('0x41')]:_0x2fb113[_0xccce('0x3b')];if(!_0x2fb4dc[_0xccce('0x3d')]['hasOwnProperty']('nolimit')){_0x1524fc['limit']=qs[_0xccce('0x2b')](_0x2fb4dc[_0xccce('0x3d')][_0xccce('0x2b')]);_0x1524fc['offset']=qs['offset'](_0x2fb4dc[_0xccce('0x3d')][_0xccce('0x29')]);}_0x1524fc['order']=qs['sort'](_0x2fb4dc[_0xccce('0x3d')][_0xccce('0x44')]);_0x1524fc['where']=qs[_0xccce('0x3f')](_[_0xccce('0x45')](_0x2fb4dc['query'],_0x2fb113[_0xccce('0x3f')]),_0x3b34fd);if(_0x2fb4dc[_0xccce('0x3d')][_0xccce('0x46')]){_0x1524fc[_0xccce('0x47')]=_[_0xccce('0x48')](_0x1524fc[_0xccce('0x47')],{'$or':_[_0xccce('0x3c')](_0x3b34fd,function(_0x551582){if(_0x551582[_0xccce('0x3a')]!==_0xccce('0x49')){var _0x53161a={};_0x53161a[_0x551582[_0xccce('0x36')]]={'$like':'%'+_0x2fb4dc['query'][_0xccce('0x46')]+'%'};return _0x53161a;}})});}_0x1524fc=_['merge']({},_0x1524fc,_0x2fb4dc['options']);var _0x67753d={'where':_0x1524fc[_0xccce('0x47')]};return db[_0xccce('0x4a')][_0xccce('0x2c')](_0x67753d)[_0xccce('0x1c')](function(_0x2af3ed){_0x106d24[_0xccce('0x2c')]=_0x2af3ed;if(_0x2fb4dc[_0xccce('0x3d')][_0xccce('0x4b')]){_0x1524fc[_0xccce('0x4c')]=[{'all':!![]}];}return db[_0xccce('0x4a')][_0xccce('0x4d')](_0x1524fc);})[_0xccce('0x1c')](function(_0x35839e){_0x106d24['rows']=_0x35839e;return _0x106d24;})[_0xccce('0x1c')](respondWithFilteredResult(_0x49c130,_0x1524fc))[_0xccce('0x25')](handleError(_0x49c130,null));};exports[_0xccce('0x4e')]=function(_0x3d9f3c,_0x5715da){var _0x418329={'raw':![],'where':{'id':_0x3d9f3c[_0xccce('0x4f')]['id']}},_0xf3b246={};_0xf3b246[_0xccce('0x3b')]=_[_0xccce('0x3e')](db[_0xccce('0x4a')][_0xccce('0x38')]);_0xf3b246['query']=_[_0xccce('0x3e')](_0x3d9f3c[_0xccce('0x3d')]);_0xf3b246[_0xccce('0x3f')]=_['intersection'](_0xf3b246[_0xccce('0x3b')],_0xf3b246[_0xccce('0x3d')]);_0x418329['attributes']=_['intersection'](_0xf3b246['model'],qs[_0xccce('0x42')](_0x3d9f3c[_0xccce('0x3d')][_0xccce('0x42')]));_0x418329[_0xccce('0x41')]=_0x418329[_0xccce('0x41')][_0xccce('0x43')]?_0x418329['attributes']:_0xf3b246[_0xccce('0x3b')];if(_0x3d9f3c[_0xccce('0x3d')]['includeAll']){_0x418329[_0xccce('0x4c')]=[{'all':!![]}];}_0x418329=_[_0xccce('0x48')]({},_0x418329,_0x3d9f3c[_0xccce('0x50')]);return db[_0xccce('0x4a')]['find'](_0x418329)[_0xccce('0x1c')](handleEntityNotFound(_0x5715da,null))[_0xccce('0x1c')](respondWithResult(_0x5715da,null))['catch'](handleError(_0x5715da,null));};exports[_0xccce('0x51')]=function(_0xde436d,_0x161ab8,_0x59f202){var _0xa31457;return db[_0xccce('0x4a')][_0xccce('0x51')](_0xde436d['body'],{'raw':!![]})['then'](function(_0x40529e){_0xa31457=_0x40529e;return db[_0xccce('0x4a')][_0xccce('0x4d')]({'raw':!![]});})[_0xccce('0x1c')](function(_0xed26e4){var _0x1300b9=fs[_0xccce('0x52')](path[_0xccce('0x53')](config[_0xccce('0x54')],'server/files/templates/context.ejs'),_0xccce('0x55'));var _0x7259aa=ejs[_0xccce('0x56')](_0x1300b9,{'contexts':_0xed26e4||[]});fs[_0xccce('0x57')](_0xccce('0x58'),_0x7259aa);})['then'](function(){return respondWithRpcPromise('Reload',_0xccce('0x51'),{'module':_0xccce('0x59')});})[_0xccce('0x1c')](function(){var _0x5980a8=_0xde436d[_0xccce('0x5a')][_0xccce('0x32')]({'plain':!![]});if(!_0x5980a8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5980a8[_0xccce('0x5b')]===_0xccce('0x5a')){var _0x4db4b4=_0xa31457[_0xccce('0x32')]({'plain':!![]});return db[_0xccce('0x5c')][_0xccce('0x5d')]({'where':{'name':_0xccce('0x33'),'userProfileId':_0x5980a8['userProfileId']},'raw':!![]})[_0xccce('0x1c')](function(_0x43e37a){if(_0x43e37a&&_0x43e37a[_0xccce('0x5e')]===0x0){return db[_0xccce('0x34')][_0xccce('0x51')]({'name':_0x4db4b4[_0xccce('0x36')],'resourceId':_0x4db4b4['id'],'type':_0x43e37a[_0xccce('0x36')],'sectionId':_0x43e37a['id']},{})[_0xccce('0x1c')](function(){return _0xa31457;});}else{return _0xa31457;}})[_0xccce('0x25')](function(_0x5a81c2){logger['error'](_0xccce('0x5f'),_0x5a81c2);throw _0x5a81c2;});}return _0xa31457;})[_0xccce('0x1c')](respondWithResult(_0x161ab8,0xc9))['catch'](handleError(_0x161ab8,null));};exports[_0xccce('0x60')]=function(_0x18febe,_0x474936,_0x12ce46){var _0x3a56d3;return db[_0xccce('0x4a')][_0xccce('0x5d')]({'where':{'id':_0x18febe['params']['id']}})['then'](handleEntityNotFound(_0x474936,null))[_0xccce('0x1c')](saveUpdates(_0x18febe[_0xccce('0x61')],null))['then'](function(_0x3b0cfd){if(_0x3b0cfd){_0x3a56d3=_0x3b0cfd;return db['VoiceContext'][_0xccce('0x4d')]({'raw':!![]});}})[_0xccce('0x1c')](function(_0x47d71e){var _0x4b266d=fs[_0xccce('0x52')](path[_0xccce('0x53')](config[_0xccce('0x54')],_0xccce('0x62')),_0xccce('0x55'));var _0x33964a=ejs['render'](_0x4b266d,{'contexts':_0x47d71e||[]});fs[_0xccce('0x57')](_0xccce('0x58'),_0x33964a);})[_0xccce('0x1c')](function(){return respondWithRpcPromise('Reload',_0xccce('0x60'),{'module':_0xccce('0x59')});})[_0xccce('0x1c')](function(){return _0x3a56d3;})[_0xccce('0x1c')](respondWithResult(_0x474936,null))[_0xccce('0x25')](handleError(_0x474936,null));};exports[_0xccce('0x31')]=function(_0x2608ee,_0x549325,_0x49b4bb){var _0x1d5919;return db[_0xccce('0x4a')][_0xccce('0x5d')]({'where':{'id':_0x2608ee['params']['id']}})['then'](handleEntityNotFound(_0x549325,null))[_0xccce('0x1c')](removeEntity(_0x549325,null))[_0xccce('0x1c')](function(){return db[_0xccce('0x4a')]['findAll']({'raw':!![]});})[_0xccce('0x1c')](function(_0x499324){var _0x5d4fff=fs[_0xccce('0x52')](path[_0xccce('0x53')](config['root'],_0xccce('0x62')),_0xccce('0x55'));var _0x277fd1=ejs['render'](_0x5d4fff,{'contexts':_0x499324});fs[_0xccce('0x57')](_0xccce('0x58'),_0x277fd1);return respondWithRpcPromise(_0xccce('0x63'),_0xccce('0x31'),{'module':_0xccce('0x59')});})['catch'](handleError(_0x549325,null));};
\ No newline at end of file
+var _0x316b=['hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','include','findAll','rows','catch','params','includeAll','find','create','body','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','fast-json-patch','request-promise','moment','bluebird','mustache','util','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','api','../../config/utils','../../config/license/util','../../mysqldb','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','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','get','Contexts','UserProfileResource','destroy','stack','name','VoiceContext','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length'];(function(_0x533544,_0x164901){var _0x4f4fe0=function(_0x2938e1){while(--_0x2938e1){_0x533544['push'](_0x533544['shift']());}};_0x4f4fe0(++_0x164901);}(_0x316b,0x1bd));var _0xb316=function(_0x30182f,_0x30ce41){_0x30182f=_0x30182f-0x0;var _0x5207db=_0x316b[_0x30182f];return _0x5207db;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb316('0x0'));var rp=require(_0xb316('0x1'));var moment=require(_0xb316('0x2'));var BPromise=require(_0xb316('0x3'));var Mustache=require(_0xb316('0x4'));var util=require(_0xb316('0x5'));var path=require('path');var sox=require(_0xb316('0x6'));var csv=require(_0xb316('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb316('0x8'));var _=require(_0xb316('0x9'));var squel=require(_0xb316('0xa'));var crypto=require('crypto');var jsforce=require(_0xb316('0xb'));var deskjs=require(_0xb316('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb316('0xd'));var Papa=require(_0xb316('0xe'));var Redis=require(_0xb316('0xf'));var authService=require(_0xb316('0x10'));var qs=require(_0xb316('0x11'));var as=require(_0xb316('0x12'));var hardwareService=require(_0xb316('0x13'));var logger=require('../../config/logger')(_0xb316('0x14'));var utils=require(_0xb316('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xb316('0x16'));var db=require(_0xb316('0x17'))['db'];var jayson=require(_0xb316('0x18'));var client=jayson['client'][_0xb316('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x56fca3,_0x4794f9,_0x53ad7c,_0x21e791){return new BPromise(function(_0x57eaa9,_0x12114d){var _0x33db18=_0x21e791||client;return _0x33db18[_0xb316('0x1a')](_0x56fca3,_0x53ad7c)[_0xb316('0x1b')](function(_0x372478){logger[_0xb316('0x1c')](_0xb316('0x1d'),_0x4794f9,_0xb316('0x1e'));logger[_0xb316('0x1f')](_0xb316('0x20'),_0x4794f9,_0xb316('0x1e'),JSON[_0xb316('0x21')](_0x372478));if(_0x372478[_0xb316('0x22')]){if(_0x372478['error'][_0xb316('0x23')]===0x1f4){logger['error'](_0xb316('0x1d'),_0x4794f9,_0x372478[_0xb316('0x22')][_0xb316('0x24')]);return _0x12114d(_0x372478['error']['message']);}logger[_0xb316('0x22')](_0xb316('0x1d'),_0x4794f9,_0x372478['error'][_0xb316('0x24')]);return _0x57eaa9(_0x372478[_0xb316('0x22')][_0xb316('0x24')]);}else{logger[_0xb316('0x1c')](_0xb316('0x1d'),_0x4794f9,_0xb316('0x1e'));_0x57eaa9(_0x372478[_0xb316('0x25')][_0xb316('0x24')]);}})['catch'](function(_0x563133){logger['error'](_0xb316('0x1d'),_0x4794f9,_0x563133);_0x12114d(_0x563133);});});}function respondWithStatusCode(_0x194489,_0x310661){_0x310661=_0x310661||0xcc;return function(_0x459672){if(_0x459672){return _0x194489[_0xb316('0x26')](_0x310661);}return _0x194489[_0xb316('0x27')](_0x310661)[_0xb316('0x28')]();};}function respondWithResult(_0x4bb3b4,_0x25bfc9){_0x25bfc9=_0x25bfc9||0xc8;return function(_0xd64e4){if(_0xd64e4){return _0x4bb3b4[_0xb316('0x27')](_0x25bfc9)[_0xb316('0x29')](_0xd64e4);}};}function respondWithFilteredResult(_0x2791b8,_0x203587){return function(_0x26170b){if(_0x26170b){var _0x70c649=typeof _0x203587[_0xb316('0x2a')]===_0xb316('0x2b')&&typeof _0x203587[_0xb316('0x2c')]==='undefined';var _0x185447=_0x26170b[_0xb316('0x2d')];var _0xd6b7fe=_0x70c649?0x0:_0x203587[_0xb316('0x2a')];var _0x51d608=_0x70c649?_0x26170b['count']:_0x203587[_0xb316('0x2a')]+_0x203587[_0xb316('0x2c')];var _0x343071;if(_0x51d608>=_0x185447){_0x51d608=_0x185447;_0x343071=0xc8;}else{_0x343071=0xce;}_0x2791b8['status'](_0x343071);return _0x2791b8[_0xb316('0x2e')](_0xb316('0x2f'),_0xd6b7fe+'-'+_0x51d608+'/'+_0x185447)['json'](_0x26170b);}return null;};}function patchUpdates(_0x38d2ad){return function(_0x3f28aa){try{jsonpatch[_0xb316('0x30')](_0x3f28aa,_0x38d2ad,!![]);}catch(_0x304b2c){return BPromise[_0xb316('0x31')](_0x304b2c);}return _0x3f28aa['save']();};}function saveUpdates(_0x1950ad,_0x24b682){return function(_0xefd170){if(_0xefd170){return _0xefd170[_0xb316('0x32')](_0x1950ad)[_0xb316('0x1b')](function(_0x2aa47b){return _0x2aa47b;});}return null;};}function removeEntity(_0x57ee1e,_0x27be47){return function(_0x3c3cdd){if(_0x3c3cdd){return _0x3c3cdd['destroy']()['then'](function(){var _0x5446bf=_0x3c3cdd[_0xb316('0x33')]({'plain':!![]});var _0x56f47a=_0xb316('0x34');return db[_0xb316('0x35')][_0xb316('0x36')]({'where':{'type':_0x56f47a,'resourceId':_0x5446bf['id']}})[_0xb316('0x1b')](function(){return _0x3c3cdd;});})[_0xb316('0x1b')](function(){_0x57ee1e['status'](0xcc)[_0xb316('0x28')]();});}};}function handleEntityNotFound(_0x3f1fc0,_0x39ed2f){return function(_0x335c4a){if(!_0x335c4a){_0x3f1fc0[_0xb316('0x26')](0x194);}return _0x335c4a;};}function handleError(_0x1d93a4,_0x193d10){_0x193d10=_0x193d10||0x1f4;return function(_0x32cc63){logger[_0xb316('0x22')](_0x32cc63[_0xb316('0x37')]);if(_0x32cc63[_0xb316('0x38')]){delete _0x32cc63[_0xb316('0x38')];}_0x1d93a4['status'](_0x193d10)['send'](_0x32cc63);};}exports['index']=function(_0x404e79,_0x2328c2){var _0x2a10d8={},_0x2a5315={},_0x10aeb1={'count':0x0,'rows':[]};var _0x36d1c4=_['map'](db[_0xb316('0x39')][_0xb316('0x3a')],function(_0x5b8ffd){return{'name':_0x5b8ffd[_0xb316('0x3b')],'type':_0x5b8ffd[_0xb316('0x3c')][_0xb316('0x3d')]};});_0x2a5315['model']=_[_0xb316('0x3e')](_0x36d1c4,_0xb316('0x38'));_0x2a5315[_0xb316('0x3f')]=_[_0xb316('0x40')](_0x404e79['query']);_0x2a5315['filters']=_[_0xb316('0x41')](_0x2a5315[_0xb316('0x42')],_0x2a5315[_0xb316('0x3f')]);_0x2a10d8[_0xb316('0x43')]=_[_0xb316('0x41')](_0x2a5315[_0xb316('0x42')],qs['fields'](_0x404e79[_0xb316('0x3f')][_0xb316('0x44')]));_0x2a10d8['attributes']=_0x2a10d8['attributes'][_0xb316('0x45')]?_0x2a10d8['attributes']:_0x2a5315['model'];if(!_0x404e79[_0xb316('0x3f')][_0xb316('0x46')](_0xb316('0x47'))){_0x2a10d8['limit']=qs[_0xb316('0x2c')](_0x404e79[_0xb316('0x3f')][_0xb316('0x2c')]);_0x2a10d8['offset']=qs[_0xb316('0x2a')](_0x404e79[_0xb316('0x3f')]['offset']);}_0x2a10d8[_0xb316('0x48')]=qs['sort'](_0x404e79[_0xb316('0x3f')][_0xb316('0x49')]);_0x2a10d8[_0xb316('0x4a')]=qs[_0xb316('0x4b')](_[_0xb316('0x4c')](_0x404e79[_0xb316('0x3f')],_0x2a5315['filters']),_0x36d1c4);if(_0x404e79[_0xb316('0x3f')][_0xb316('0x4d')]){_0x2a10d8[_0xb316('0x4a')]=_['merge'](_0x2a10d8[_0xb316('0x4a')],{'$or':_[_0xb316('0x3e')](_0x36d1c4,function(_0x1f3975){if(_0x1f3975['type']!=='VIRTUAL'){var _0x34f6e5={};_0x34f6e5[_0x1f3975[_0xb316('0x38')]]={'$like':'%'+_0x404e79['query'][_0xb316('0x4d')]+'%'};return _0x34f6e5;}})});}_0x2a10d8=_[_0xb316('0x4e')]({},_0x2a10d8,_0x404e79[_0xb316('0x4f')]);var _0x1f2bde={'where':_0x2a10d8['where']};return db[_0xb316('0x39')][_0xb316('0x2d')](_0x1f2bde)[_0xb316('0x1b')](function(_0x395ee5){_0x10aeb1[_0xb316('0x2d')]=_0x395ee5;if(_0x404e79[_0xb316('0x3f')]['includeAll']){_0x2a10d8[_0xb316('0x50')]=[{'all':!![]}];}return db['VoiceContext'][_0xb316('0x51')](_0x2a10d8);})[_0xb316('0x1b')](function(_0x5c0e52){_0x10aeb1[_0xb316('0x52')]=_0x5c0e52;return _0x10aeb1;})['then'](respondWithFilteredResult(_0x2328c2,_0x2a10d8))[_0xb316('0x53')](handleError(_0x2328c2,null));};exports['show']=function(_0x59a886,_0x399da3){var _0x9c45c3={'raw':![],'where':{'id':_0x59a886[_0xb316('0x54')]['id']}},_0x36d8ba={};_0x36d8ba[_0xb316('0x42')]=_[_0xb316('0x40')](db[_0xb316('0x39')][_0xb316('0x3a')]);_0x36d8ba['query']=_['keys'](_0x59a886['query']);_0x36d8ba['filters']=_['intersection'](_0x36d8ba[_0xb316('0x42')],_0x36d8ba[_0xb316('0x3f')]);_0x9c45c3[_0xb316('0x43')]=_[_0xb316('0x41')](_0x36d8ba[_0xb316('0x42')],qs[_0xb316('0x44')](_0x59a886['query']['fields']));_0x9c45c3[_0xb316('0x43')]=_0x9c45c3[_0xb316('0x43')][_0xb316('0x45')]?_0x9c45c3['attributes']:_0x36d8ba[_0xb316('0x42')];if(_0x59a886[_0xb316('0x3f')][_0xb316('0x55')]){_0x9c45c3[_0xb316('0x50')]=[{'all':!![]}];}_0x9c45c3=_['merge']({},_0x9c45c3,_0x59a886[_0xb316('0x4f')]);return db['VoiceContext'][_0xb316('0x56')](_0x9c45c3)[_0xb316('0x1b')](handleEntityNotFound(_0x399da3,null))[_0xb316('0x1b')](respondWithResult(_0x399da3,null))[_0xb316('0x53')](handleError(_0x399da3,null));};exports['create']=function(_0x580683,_0x14023c,_0x4c1760){var _0x18180e;return db[_0xb316('0x39')][_0xb316('0x57')](_0x580683[_0xb316('0x58')],{'raw':!![]})[_0xb316('0x1b')](function(_0x3870e0){_0x18180e=_0x3870e0;return db[_0xb316('0x39')][_0xb316('0x51')]({'raw':!![]});})['then'](function(_0x3c6f7d){var _0x3a8b88=fs['readFileSync'](path[_0xb316('0x59')](config[_0xb316('0x5a')],_0xb316('0x5b')),_0xb316('0x5c'));var _0x5948e0=ejs[_0xb316('0x5d')](_0x3a8b88,{'contexts':_0x3c6f7d||[]});fs[_0xb316('0x5e')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x5948e0);})[_0xb316('0x1b')](function(){return respondWithRpcPromise(_0xb316('0x5f'),_0xb316('0x57'),{'module':_0xb316('0x60')});})[_0xb316('0x1b')](function(){var _0x7a3563=_0x580683[_0xb316('0x61')][_0xb316('0x33')]({'plain':!![]});if(!_0x7a3563)throw new Error(_0xb316('0x62'));if(_0x7a3563[_0xb316('0x63')]===_0xb316('0x61')){var _0x1fee0f=_0x18180e[_0xb316('0x33')]({'plain':!![]});return db['UserProfileSection'][_0xb316('0x56')]({'where':{'name':'Contexts','userProfileId':_0x7a3563[_0xb316('0x64')]},'raw':!![]})[_0xb316('0x1b')](function(_0x38611d){if(_0x38611d&&_0x38611d['autoAssociation']===0x0){return db[_0xb316('0x35')][_0xb316('0x57')]({'name':_0x1fee0f[_0xb316('0x38')],'resourceId':_0x1fee0f['id'],'type':_0x38611d[_0xb316('0x38')],'sectionId':_0x38611d['id']},{})[_0xb316('0x1b')](function(){return _0x18180e;});}else{return _0x18180e;}})[_0xb316('0x53')](function(_0x2e6330){logger[_0xb316('0x22')](_0xb316('0x65'),_0x2e6330);throw _0x2e6330;});}return _0x18180e;})[_0xb316('0x1b')](respondWithResult(_0x14023c,0xc9))[_0xb316('0x53')](handleError(_0x14023c,null));};exports['update']=function(_0x11ae7c,_0x7dfb7f,_0x2514b4){var _0xc8dfe0;return db['VoiceContext'][_0xb316('0x56')]({'where':{'id':_0x11ae7c[_0xb316('0x54')]['id']}})[_0xb316('0x1b')](handleEntityNotFound(_0x7dfb7f,null))[_0xb316('0x1b')](saveUpdates(_0x11ae7c['body'],null))[_0xb316('0x1b')](function(_0x3d52bb){if(_0x3d52bb){_0xc8dfe0=_0x3d52bb;return db['VoiceContext']['findAll']({'raw':!![]});}})[_0xb316('0x1b')](function(_0x5b900f){var _0x21db82=fs[_0xb316('0x66')](path[_0xb316('0x59')](config[_0xb316('0x5a')],_0xb316('0x5b')),'utf8');var _0x190d60=ejs[_0xb316('0x5d')](_0x21db82,{'contexts':_0x5b900f||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x190d60);})[_0xb316('0x1b')](function(){return respondWithRpcPromise(_0xb316('0x5f'),_0xb316('0x32'),{'module':'chan_sip.so'});})[_0xb316('0x1b')](function(){return _0xc8dfe0;})[_0xb316('0x1b')](respondWithResult(_0x7dfb7f,null))['catch'](handleError(_0x7dfb7f,null));};exports['destroy']=function(_0x50bf8c,_0x34b219,_0x1ffd0f){var _0x597dcd;return db['VoiceContext']['find']({'where':{'id':_0x50bf8c['params']['id']}})['then'](handleEntityNotFound(_0x34b219,null))['then'](removeEntity(_0x34b219,null))[_0xb316('0x1b')](function(){return db[_0xb316('0x39')][_0xb316('0x51')]({'raw':!![]});})['then'](function(_0x1a4c52){var _0x3a2a1a=fs[_0xb316('0x66')](path['join'](config[_0xb316('0x5a')],'server/files/templates/context.ejs'),_0xb316('0x5c'));var _0x1a7288=ejs[_0xb316('0x5d')](_0x3a2a1a,{'contexts':_0x1a4c52});fs[_0xb316('0x5e')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x1a7288);return respondWithRpcPromise(_0xb316('0x5f'),_0xb316('0x36'),{'module':_0xb316('0x60')});})[_0xb316('0x53')](handleError(_0x34b219,null));};
\ No newline at end of file
index ed104b7..069b89e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x23c8=['./voiceContext.attributes','exports','define','VoiceContext','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment'];(function(_0x2d8520,_0x2d155b){var _0x5734e4=function(_0x95fd68){while(--_0x95fd68){_0x2d8520['push'](_0x2d8520['shift']());}};_0x5734e4(++_0x2d155b);}(_0x23c8,0xca));var _0x823c=function(_0x26d873,_0x70e1c5){_0x26d873=_0x26d873-0x0;var _0x415122=_0x23c8[_0x26d873];return _0x415122;};'use strict';var _=require(_0x823c('0x0'));var util=require(_0x823c('0x1'));var logger=require(_0x823c('0x2'))(_0x823c('0x3'));var moment=require('moment');var BPromise=require(_0x823c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x823c('0x5'));var config=require(_0x823c('0x6'));var attributes=require(_0x823c('0x7'));module[_0x823c('0x8')]=function(_0x459bec,_0x12cccf){return _0x459bec[_0x823c('0x9')](_0x823c('0xa'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc822=['moment','bluebird','path','rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash','util','../../config/logger'];(function(_0x2608a4,_0x123c49){var _0x32a749=function(_0x19cb65){while(--_0x19cb65){_0x2608a4['push'](_0x2608a4['shift']());}};_0x32a749(++_0x123c49);}(_0xc822,0x1b7));var _0x2c82=function(_0x2742db,_0x58e00c){_0x2742db=_0x2742db-0x0;var _0x18659e=_0xc822[_0x2742db];return _0x18659e;};'use strict';var _=require(_0x2c82('0x0'));var util=require(_0x2c82('0x1'));var logger=require(_0x2c82('0x2'))('api');var moment=require(_0x2c82('0x3'));var BPromise=require(_0x2c82('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2c82('0x5'));var rimraf=require(_0x2c82('0x6'));var config=require(_0x2c82('0x7'));var attributes=require(_0x2c82('0x8'));module[_0x2c82('0x9')]=function(_0x58454f,_0x53572){return _0x58454f[_0x2c82('0xa')](_0x2c82('0xb'),attributes,{'tableName':_0x2c82('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 65f394a..01ffbcc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4d1=['result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','info'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xd4d1,0x86));var _0x1d4d=function(_0x46491d,_0x23a1df){_0x46491d=_0x46491d-0x0;var _0x28fef9=_0xd4d1[_0x46491d];return _0x28fef9;};'use strict';var _=require(_0x1d4d('0x0'));var util=require(_0x1d4d('0x1'));var moment=require(_0x1d4d('0x2'));var BPromise=require('bluebird');var rs=require(_0x1d4d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1d4d('0x4'));var logger=require(_0x1d4d('0x5'))('rpc');var config=require(_0x1d4d('0x6'));var jayson=require(_0x1d4d('0x7'));var client=jayson[_0x1d4d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f3c41,_0x38cc66,_0x130607){return new BPromise(function(_0x6c94f9,_0x276c20){return client[_0x1d4d('0x9')](_0x1f3c41,_0x130607)[_0x1d4d('0xa')](function(_0x559935){logger['info']('VoiceContext,\x20%s,\x20%s',_0x38cc66,_0x1d4d('0xb'));logger[_0x1d4d('0xc')](_0x1d4d('0xd'),_0x38cc66,'request\x20sent',JSON[_0x1d4d('0xe')](_0x559935));if(_0x559935['error']){if(_0x559935[_0x1d4d('0xf')][_0x1d4d('0x10')]===0x1f4){logger[_0x1d4d('0xf')](_0x1d4d('0x11'),_0x38cc66,_0x559935[_0x1d4d('0xf')][_0x1d4d('0x12')]);return _0x276c20(_0x559935['error'][_0x1d4d('0x12')]);}logger['error'](_0x1d4d('0x11'),_0x38cc66,_0x559935[_0x1d4d('0xf')][_0x1d4d('0x12')]);return _0x6c94f9(_0x559935['error'][_0x1d4d('0x12')]);}else{logger[_0x1d4d('0x13')](_0x1d4d('0x11'),_0x38cc66,_0x1d4d('0xb'));_0x6c94f9(_0x559935[_0x1d4d('0x14')][_0x1d4d('0x12')]);}})[_0x1d4d('0x15')](function(_0x57ec11){logger[_0x1d4d('0xf')]('VoiceContext,\x20%s,\x20%s',_0x38cc66,_0x57ec11);_0x276c20(_0x57ec11);});});}
\ No newline at end of file
+var _0xd232=['then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','client','http','request'];(function(_0x2394ed,_0x384255){var _0x29c5a3=function(_0x4cd8a5){while(--_0x4cd8a5){_0x2394ed['push'](_0x2394ed['shift']());}};_0x29c5a3(++_0x384255);}(_0xd232,0x74));var _0x2d23=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd232[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x2d23('0x0'));var util=require('util');var moment=require(_0x2d23('0x1'));var BPromise=require(_0x2d23('0x2'));var rs=require(_0x2d23('0x3'));var fs=require('fs');var Redis=require(_0x2d23('0x4'));var db=require(_0x2d23('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2d23('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2d23('0x7')][_0x2d23('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x15c735,_0x53ac18,_0x18cac8){return new BPromise(function(_0x4cf7f4,_0x2c4667){return client[_0x2d23('0x9')](_0x15c735,_0x18cac8)[_0x2d23('0xa')](function(_0x7847cb){logger[_0x2d23('0xb')](_0x2d23('0xc'),_0x53ac18,_0x2d23('0xd'));logger['debug'](_0x2d23('0xe'),_0x53ac18,_0x2d23('0xd'),JSON[_0x2d23('0xf')](_0x7847cb));if(_0x7847cb[_0x2d23('0x10')]){if(_0x7847cb[_0x2d23('0x10')][_0x2d23('0x11')]===0x1f4){logger[_0x2d23('0x10')](_0x2d23('0xc'),_0x53ac18,_0x7847cb[_0x2d23('0x10')][_0x2d23('0x12')]);return _0x2c4667(_0x7847cb[_0x2d23('0x10')][_0x2d23('0x12')]);}logger['error'](_0x2d23('0xc'),_0x53ac18,_0x7847cb[_0x2d23('0x10')][_0x2d23('0x12')]);return _0x4cf7f4(_0x7847cb[_0x2d23('0x10')][_0x2d23('0x12')]);}else{logger['info'](_0x2d23('0xc'),_0x53ac18,'request\x20sent');_0x4cf7f4(_0x7847cb[_0x2d23('0x13')]['message']);}})[_0x2d23('0x14')](function(_0x30b578){logger['error']('VoiceContext,\x20%s,\x20%s',_0x53ac18,_0x30b578);_0x2c4667(_0x30b578);});});}
\ No newline at end of file
index b9bb825..c06322e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f33=['show','post','create','put','update','delete','/:id','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','/describe','isAuthenticated','describe'];(function(_0x26f169,_0x2d01b2){var _0x43aad9=function(_0x4395ea){while(--_0x4395ea){_0x26f169['push'](_0x26f169['shift']());}};_0x43aad9(++_0x2d01b2);}(_0x6f33,0x169));var _0x36f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f33[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x36f3('0x0'));var path=require(_0x36f3('0x1'));var timeout=require(_0x36f3('0x2'));var express=require(_0x36f3('0x3'));var router=express[_0x36f3('0x4')]();var fs_extra=require(_0x36f3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x36f3('0x6'));var config=require(_0x36f3('0x7'));var controller=require(_0x36f3('0x8'));router[_0x36f3('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x36f3('0x9')](_0x36f3('0xa'),auth[_0x36f3('0xb')](),controller[_0x36f3('0xc')]);router[_0x36f3('0x9')]('/:id',auth[_0x36f3('0xb')](),controller[_0x36f3('0xd')]);router[_0x36f3('0xe')]('/',auth[_0x36f3('0xb')](),controller[_0x36f3('0xf')]);router[_0x36f3('0x10')]('/:id',auth[_0x36f3('0xb')](),controller[_0x36f3('0x11')]);router[_0x36f3('0x12')](_0x36f3('0x13'),auth['isAuthenticated'](),controller[_0x36f3('0x14')]);module[_0x36f3('0x15')]=router;
\ No newline at end of file
+var _0x1bb2=['connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','exports','util','path'];(function(_0x38ab10,_0x109c74){var _0x53a67c=function(_0x2b17b8){while(--_0x2b17b8){_0x38ab10['push'](_0x38ab10['shift']());}};_0x53a67c(++_0x109c74);}(_0x1bb2,0x152));var _0x21bb=function(_0x53180f,_0x574644){_0x53180f=_0x53180f-0x0;var _0x476eb9=_0x1bb2[_0x53180f];return _0x476eb9;};'use strict';var multer=require('multer');var util=require(_0x21bb('0x0'));var path=require(_0x21bb('0x1'));var timeout=require(_0x21bb('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x21bb('0x3'));var auth=require(_0x21bb('0x4'));var interaction=require(_0x21bb('0x5'));var config=require(_0x21bb('0x6'));var controller=require(_0x21bb('0x7'));router[_0x21bb('0x8')]('/',auth[_0x21bb('0x9')](),controller[_0x21bb('0xa')]);router[_0x21bb('0x8')](_0x21bb('0xb'),auth[_0x21bb('0x9')](),controller[_0x21bb('0xc')]);router['get'](_0x21bb('0xd'),auth['isAuthenticated'](),controller[_0x21bb('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x21bb('0xf')]);router[_0x21bb('0x10')](_0x21bb('0xd'),auth[_0x21bb('0x9')](),controller[_0x21bb('0x11')]);router[_0x21bb('0x12')](_0x21bb('0xd'),auth[_0x21bb('0x9')](),controller['destroy']);module[_0x21bb('0x13')]=router;
\ No newline at end of file
index be7d1f0..a0e5571 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['DATE','called,connect,complete','exports','STRING','INTEGER'];(function(_0x111e25,_0x3056e5){var _0x32c364=function(_0x52070c){while(--_0x52070c){_0x111e25['push'](_0x111e25['shift']());}};_0x32c364(++_0x3056e5);}(_0xedd9,0xfc));var _0x9edd=function(_0x585493,_0x1dd7cf){_0x585493=_0x585493-0x0;var _0x12bb54=_0xedd9[_0x585493];return _0x12bb54;};'use strict';var Sequelize=require('sequelize');module[_0x9edd('0x0')]={'privilege':{'type':Sequelize[_0x9edd('0x1')]},'channel':{'type':Sequelize[_0x9edd('0x1')]},'channelstate':{'type':Sequelize[_0x9edd('0x2')]},'channelstatedesc':{'type':Sequelize[_0x9edd('0x1')]},'calleridnum':{'type':Sequelize[_0x9edd('0x1')]},'calleridname':{'type':Sequelize[_0x9edd('0x1')]},'connectedlinenum':{'type':Sequelize[_0x9edd('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x9edd('0x1')]},'accountcode':{'type':Sequelize[_0x9edd('0x1')]},'context':{'type':Sequelize[_0x9edd('0x1')]},'exten':{'type':Sequelize[_0x9edd('0x1')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x9edd('0x1')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x9edd('0x1')]},'destchannelstate':{'type':Sequelize[_0x9edd('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x9edd('0x1')]},'destcalleridnum':{'type':Sequelize[_0x9edd('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x9edd('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x9edd('0x1')]},'destaccountcode':{'type':Sequelize[_0x9edd('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x9edd('0x1')]},'destpriority':{'type':Sequelize[_0x9edd('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x9edd('0x1')]},'dialstring':{'type':Sequelize[_0x9edd('0x1')]},'dialstatus':{'type':Sequelize[_0x9edd('0x1')]},'starttime':{'type':Sequelize[_0x9edd('0x3')]},'answertime':{'type':Sequelize[_0x9edd('0x3')]},'endtime':{'type':Sequelize[_0x9edd('0x3')]},'lastevent':{'type':Sequelize[_0x9edd('0x1')],'comment':_0x9edd('0x4')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0x9edd('0x2')]},'holdtime':{'type':Sequelize[_0x9edd('0x2')]},'billableseconds':{'type':Sequelize[_0x9edd('0x2')]}};
\ No newline at end of file
+var _0x00bb=['STRING','INTEGER','DATE','called,connect,complete','sequelize','exports'];(function(_0x5135cb,_0x5e045a){var _0x3ad99e=function(_0x565ff0){while(--_0x565ff0){_0x5135cb['push'](_0x5135cb['shift']());}};_0x3ad99e(++_0x5e045a);}(_0x00bb,0x1d8));var _0xb00b=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x00bb[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0xb00b('0x0'));module[_0xb00b('0x1')]={'privilege':{'type':Sequelize[_0xb00b('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xb00b('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xb00b('0x2')]},'calleridname':{'type':Sequelize[_0xb00b('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xb00b('0x2')]},'language':{'type':Sequelize[_0xb00b('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xb00b('0x3')]},'uniqueid':{'type':Sequelize[_0xb00b('0x2')]},'linkedid':{'type':Sequelize[_0xb00b('0x2')]},'destchannel':{'type':Sequelize[_0xb00b('0x2')]},'destchannelstate':{'type':Sequelize[_0xb00b('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xb00b('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xb00b('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xb00b('0x2')]},'destlanguage':{'type':Sequelize[_0xb00b('0x2')]},'destaccountcode':{'type':Sequelize[_0xb00b('0x2')]},'destcontext':{'type':Sequelize[_0xb00b('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xb00b('0x3')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0xb00b('0x2')]},'starttime':{'type':Sequelize[_0xb00b('0x4')]},'answertime':{'type':Sequelize[_0xb00b('0x4')]},'endtime':{'type':Sequelize[_0xb00b('0x4')]},'lastevent':{'type':Sequelize[_0xb00b('0x2')],'comment':_0xb00b('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0xb00b('0x3')]},'holdtime':{'type':Sequelize[_0xb00b('0x3')]},'billableseconds':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index 5df3b39..85dd13d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfba9=['desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','reject','save','update','then','error','stack','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','where','merge','type','filter','includeAll','findAll','rows','show','include','options','find','catch','create','body','params','destroy','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce'];(function(_0x1f69c1,_0x33bf8a){var _0xd67bb9=function(_0xc0bab0){while(--_0xc0bab0){_0x1f69c1['push'](_0x1f69c1['shift']());}};_0xd67bb9(++_0x33bf8a);}(_0xfba9,0x1bf));var _0x9fba=function(_0x29d15b,_0x2cc49b){_0x29d15b=_0x29d15b-0x0;var _0x48520d=_0xfba9[_0x29d15b];return _0x48520d;};'use strict';var emlformat=require(_0x9fba('0x0'));var rimraf=require(_0x9fba('0x1'));var zipdir=require(_0x9fba('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9fba('0x3'));var moment=require('moment');var BPromise=require(_0x9fba('0x4'));var Mustache=require(_0x9fba('0x5'));var util=require(_0x9fba('0x6'));var path=require(_0x9fba('0x7'));var sox=require(_0x9fba('0x8'));var csv=require(_0x9fba('0x9'));var ejs=require(_0x9fba('0xa'));var fs=require('fs');var fs_extra=require(_0x9fba('0xb'));var _=require('lodash');var squel=require(_0x9fba('0xc'));var crypto=require(_0x9fba('0xd'));var jsforce=require(_0x9fba('0xe'));var deskjs=require(_0x9fba('0xf'));var toCsv=require(_0x9fba('0x9'));var querystring=require(_0x9fba('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9fba('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9fba('0x12'));var hardwareService=require(_0x9fba('0x13'));var logger=require(_0x9fba('0x14'))(_0x9fba('0x15'));var utils=require(_0x9fba('0x16'));var config=require(_0x9fba('0x17'));var licenseUtil=require(_0x9fba('0x18'));var db=require(_0x9fba('0x19'))['db'];function respondWithStatusCode(_0x2a1a53,_0x25340e){_0x25340e=_0x25340e||0xcc;return function(_0x2f8940){if(_0x2f8940){return _0x2a1a53[_0x9fba('0x1a')](_0x25340e);}return _0x2a1a53[_0x9fba('0x1b')](_0x25340e)[_0x9fba('0x1c')]();};}function respondWithResult(_0x1a8f44,_0x4cafa1){_0x4cafa1=_0x4cafa1||0xc8;return function(_0x41cd6f){if(_0x41cd6f){return _0x1a8f44[_0x9fba('0x1b')](_0x4cafa1)['json'](_0x41cd6f);}};}function respondWithFilteredResult(_0x54a202,_0x1fca56){return function(_0x153bd5){if(_0x153bd5){var _0x362bb4=typeof _0x1fca56['offset']===_0x9fba('0x1d')&&typeof _0x1fca56[_0x9fba('0x1e')]==='undefined';var _0x5a0770=_0x153bd5['count'];var _0x11679f=_0x362bb4?0x0:_0x1fca56['offset'];var _0x309092=_0x362bb4?_0x153bd5[_0x9fba('0x1f')]:_0x1fca56[_0x9fba('0x20')]+_0x1fca56[_0x9fba('0x1e')];var _0xc915bd;if(_0x309092>=_0x5a0770){_0x309092=_0x5a0770;_0xc915bd=0xc8;}else{_0xc915bd=0xce;}_0x54a202['status'](_0xc915bd);return _0x54a202[_0x9fba('0x21')]('Content-Range',_0x11679f+'-'+_0x309092+'/'+_0x5a0770)[_0x9fba('0x22')](_0x153bd5);}return null;};}function patchUpdates(_0x3ce564){return function(_0x3dd094){try{jsonpatch[_0x9fba('0x23')](_0x3dd094,_0x3ce564,!![]);}catch(_0x58bbdd){return BPromise[_0x9fba('0x24')](_0x58bbdd);}return _0x3dd094[_0x9fba('0x25')]();};}function saveUpdates(_0x2009bd,_0x4034f6){return function(_0x3c5331){if(_0x3c5331){return _0x3c5331[_0x9fba('0x26')](_0x2009bd)['then'](function(_0x5cb2e5){return _0x5cb2e5;});}return null;};}function removeEntity(_0x49f90c,_0x19ce2a){return function(_0x1535a0){if(_0x1535a0){return _0x1535a0['destroy']()[_0x9fba('0x27')](function(){_0x49f90c[_0x9fba('0x1b')](0xcc)[_0x9fba('0x1c')]();});}};}function handleEntityNotFound(_0x4c538f,_0x302ad4){return function(_0x525f19){if(!_0x525f19){_0x4c538f[_0x9fba('0x1a')](0x194);}return _0x525f19;};}function handleError(_0x19600f,_0x4d70f5){_0x4d70f5=_0x4d70f5||0x1f4;return function(_0x2f80f4){logger[_0x9fba('0x28')](_0x2f80f4[_0x9fba('0x29')]);if(_0x2f80f4[_0x9fba('0x2a')]){delete _0x2f80f4[_0x9fba('0x2a')];}_0x19600f[_0x9fba('0x1b')](_0x4d70f5)[_0x9fba('0x2b')](_0x2f80f4);};}exports[_0x9fba('0x2c')]=function(_0x55fe2e,_0x3b8936){var _0x371013={},_0x33ac87={},_0x2d3a26={'count':0x0,'rows':[]};var _0x40d345=_[_0x9fba('0x2d')](db[_0x9fba('0x2e')][_0x9fba('0x2f')],function(_0x56eafc){return{'name':_0x56eafc[_0x9fba('0x30')],'type':_0x56eafc['type']['key']};});_0x33ac87[_0x9fba('0x31')]=_['map'](_0x40d345,'name');_0x33ac87[_0x9fba('0x32')]=_[_0x9fba('0x33')](_0x55fe2e['query']);_0x33ac87[_0x9fba('0x34')]=_[_0x9fba('0x35')](_0x33ac87[_0x9fba('0x31')],_0x33ac87[_0x9fba('0x32')]);_0x371013['attributes']=_[_0x9fba('0x35')](_0x33ac87[_0x9fba('0x31')],qs[_0x9fba('0x36')](_0x55fe2e[_0x9fba('0x32')][_0x9fba('0x36')]));_0x371013[_0x9fba('0x37')]=_0x371013['attributes'][_0x9fba('0x38')]?_0x371013[_0x9fba('0x37')]:_0x33ac87[_0x9fba('0x31')];if(!_0x55fe2e[_0x9fba('0x32')]['hasOwnProperty'](_0x9fba('0x39'))){_0x371013['limit']=qs[_0x9fba('0x1e')](_0x55fe2e[_0x9fba('0x32')]['limit']);_0x371013[_0x9fba('0x20')]=qs['offset'](_0x55fe2e[_0x9fba('0x32')][_0x9fba('0x20')]);}_0x371013[_0x9fba('0x3a')]=qs[_0x9fba('0x3b')](_0x55fe2e['query'][_0x9fba('0x3b')]);_0x371013['where']=qs['filters'](_[_0x9fba('0x3c')](_0x55fe2e[_0x9fba('0x32')],_0x33ac87[_0x9fba('0x34')]),_0x40d345);if(_0x55fe2e[_0x9fba('0x32')]['filter']){_0x371013[_0x9fba('0x3d')]=_[_0x9fba('0x3e')](_0x371013[_0x9fba('0x3d')],{'$or':_[_0x9fba('0x2d')](_0x40d345,function(_0x3066d4){if(_0x3066d4[_0x9fba('0x3f')]!=='VIRTUAL'){var _0x527f7a={};_0x527f7a[_0x3066d4['name']]={'$like':'%'+_0x55fe2e['query'][_0x9fba('0x40')]+'%'};return _0x527f7a;}})});}_0x371013=_[_0x9fba('0x3e')]({},_0x371013,_0x55fe2e['options']);var _0xc9e833={'where':_0x371013[_0x9fba('0x3d')]};return db[_0x9fba('0x2e')][_0x9fba('0x1f')](_0xc9e833)[_0x9fba('0x27')](function(_0x24ee2b){_0x2d3a26['count']=_0x24ee2b;if(_0x55fe2e['query'][_0x9fba('0x41')]){_0x371013['include']=[{'all':!![]}];}return db['VoiceDialReport'][_0x9fba('0x42')](_0x371013);})[_0x9fba('0x27')](function(_0x2d1561){_0x2d3a26[_0x9fba('0x43')]=_0x2d1561;return _0x2d3a26;})[_0x9fba('0x27')](respondWithFilteredResult(_0x3b8936,_0x371013))['catch'](handleError(_0x3b8936,null));};exports[_0x9fba('0x44')]=function(_0xc0e941,_0x1ce860){var _0x1c3840={'raw':!![],'where':{'id':_0xc0e941['params']['id']}},_0x1748e7={};_0x1748e7[_0x9fba('0x31')]=_[_0x9fba('0x33')](db[_0x9fba('0x2e')][_0x9fba('0x2f')]);_0x1748e7[_0x9fba('0x32')]=_[_0x9fba('0x33')](_0xc0e941['query']);_0x1748e7['filters']=_['intersection'](_0x1748e7['model'],_0x1748e7[_0x9fba('0x32')]);_0x1c3840[_0x9fba('0x37')]=_[_0x9fba('0x35')](_0x1748e7['model'],qs[_0x9fba('0x36')](_0xc0e941[_0x9fba('0x32')][_0x9fba('0x36')]));_0x1c3840[_0x9fba('0x37')]=_0x1c3840[_0x9fba('0x37')]['length']?_0x1c3840['attributes']:_0x1748e7[_0x9fba('0x31')];if(_0xc0e941['query'][_0x9fba('0x41')]){_0x1c3840[_0x9fba('0x45')]=[{'all':!![]}];}_0x1c3840=_['merge']({},_0x1c3840,_0xc0e941[_0x9fba('0x46')]);return db[_0x9fba('0x2e')][_0x9fba('0x47')](_0x1c3840)[_0x9fba('0x27')](handleEntityNotFound(_0x1ce860,null))['then'](respondWithResult(_0x1ce860,null))[_0x9fba('0x48')](handleError(_0x1ce860,null));};exports[_0x9fba('0x49')]=function(_0x3b96d5,_0x4f1f70){return db[_0x9fba('0x2e')]['create'](_0x3b96d5[_0x9fba('0x4a')],{})[_0x9fba('0x27')](respondWithResult(_0x4f1f70,0xc9))['catch'](handleError(_0x4f1f70,null));};exports[_0x9fba('0x26')]=function(_0x2ed8c9,_0x128e17){if(_0x2ed8c9['body']['id']){delete _0x2ed8c9[_0x9fba('0x4a')]['id'];}return db['VoiceDialReport'][_0x9fba('0x47')]({'where':{'id':_0x2ed8c9[_0x9fba('0x4b')]['id']}})[_0x9fba('0x27')](handleEntityNotFound(_0x128e17,null))[_0x9fba('0x27')](saveUpdates(_0x2ed8c9[_0x9fba('0x4a')],null))['then'](respondWithResult(_0x128e17,null))[_0x9fba('0x48')](handleError(_0x128e17,null));};exports[_0x9fba('0x4c')]=function(_0x4b2977,_0x17b1d1){return db[_0x9fba('0x2e')][_0x9fba('0x47')]({'where':{'id':_0x4b2977[_0x9fba('0x4b')]['id']}})[_0x9fba('0x27')](handleEntityNotFound(_0x17b1d1,null))[_0x9fba('0x27')](removeEntity(_0x17b1d1,null))[_0x9fba('0x48')](handleError(_0x17b1d1,null));};exports['describe']=function(_0x4f3f20,_0xa8024e){return db[_0x9fba('0x2e')]['describe']()[_0x9fba('0x27')](respondWithResult(_0xa8024e,null))[_0x9fba('0x48')](handleError(_0xa8024e,null));};
\ No newline at end of file
+var _0x1d7c=['describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','destroy','error','name','index','map','VoiceDialReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','order','sort','where','pick','type','VIRTUAL','filter','merge','options','then','includeAll','findAll','catch','params','include','find','body'];(function(_0x497b1e,_0x586379){var _0x3f72e1=function(_0x4c227d){while(--_0x4c227d){_0x497b1e['push'](_0x497b1e['shift']());}};_0x3f72e1(++_0x586379);}(_0x1d7c,0xdc));var _0xc1d7=function(_0x4b0c3e,_0x50754a){_0x4b0c3e=_0x4b0c3e-0x0;var _0xa99d4e=_0x1d7c[_0x4b0c3e];return _0xa99d4e;};'use strict';var emlformat=require(_0xc1d7('0x0'));var rimraf=require(_0xc1d7('0x1'));var zipdir=require(_0xc1d7('0x2'));var jsonpatch=require(_0xc1d7('0x3'));var rp=require(_0xc1d7('0x4'));var moment=require(_0xc1d7('0x5'));var BPromise=require(_0xc1d7('0x6'));var Mustache=require(_0xc1d7('0x7'));var util=require('util');var path=require(_0xc1d7('0x8'));var sox=require(_0xc1d7('0x9'));var csv=require(_0xc1d7('0xa'));var ejs=require(_0xc1d7('0xb'));var fs=require('fs');var fs_extra=require(_0xc1d7('0xc'));var _=require(_0xc1d7('0xd'));var squel=require(_0xc1d7('0xe'));var crypto=require('crypto');var jsforce=require(_0xc1d7('0xf'));var deskjs=require(_0xc1d7('0x10'));var toCsv=require(_0xc1d7('0xa'));var querystring=require('querystring');var Papa=require(_0xc1d7('0x11'));var Redis=require(_0xc1d7('0x12'));var authService=require(_0xc1d7('0x13'));var qs=require(_0xc1d7('0x14'));var as=require(_0xc1d7('0x15'));var hardwareService=require(_0xc1d7('0x16'));var logger=require(_0xc1d7('0x17'))(_0xc1d7('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc1d7('0x19'));var db=require(_0xc1d7('0x1a'))['db'];function respondWithStatusCode(_0x258e71,_0x59355b){_0x59355b=_0x59355b||0xcc;return function(_0x599529){if(_0x599529){return _0x258e71[_0xc1d7('0x1b')](_0x59355b);}return _0x258e71[_0xc1d7('0x1c')](_0x59355b)[_0xc1d7('0x1d')]();};}function respondWithResult(_0x4397b1,_0xadbd3){_0xadbd3=_0xadbd3||0xc8;return function(_0x2c50c6){if(_0x2c50c6){return _0x4397b1['status'](_0xadbd3)[_0xc1d7('0x1e')](_0x2c50c6);}};}function respondWithFilteredResult(_0x18f4c9,_0x1e2bd4){return function(_0x35329e){if(_0x35329e){var _0x3f93b7=typeof _0x1e2bd4[_0xc1d7('0x1f')]===_0xc1d7('0x20')&&typeof _0x1e2bd4['limit']===_0xc1d7('0x20');var _0x1bd092=_0x35329e[_0xc1d7('0x21')];var _0x5a5ac3=_0x3f93b7?0x0:_0x1e2bd4[_0xc1d7('0x1f')];var _0x1f3b9f=_0x3f93b7?_0x35329e[_0xc1d7('0x21')]:_0x1e2bd4[_0xc1d7('0x1f')]+_0x1e2bd4[_0xc1d7('0x22')];var _0x264d22;if(_0x1f3b9f>=_0x1bd092){_0x1f3b9f=_0x1bd092;_0x264d22=0xc8;}else{_0x264d22=0xce;}_0x18f4c9[_0xc1d7('0x1c')](_0x264d22);return _0x18f4c9['set'](_0xc1d7('0x23'),_0x5a5ac3+'-'+_0x1f3b9f+'/'+_0x1bd092)[_0xc1d7('0x1e')](_0x35329e);}return null;};}function patchUpdates(_0x48f2e1){return function(_0x1063d2){try{jsonpatch[_0xc1d7('0x24')](_0x1063d2,_0x48f2e1,!![]);}catch(_0x3bad66){return BPromise[_0xc1d7('0x25')](_0x3bad66);}return _0x1063d2['save']();};}function saveUpdates(_0x59bda3,_0x36390f){return function(_0x43b9a8){if(_0x43b9a8){return _0x43b9a8[_0xc1d7('0x26')](_0x59bda3)['then'](function(_0x13f3dc){return _0x13f3dc;});}return null;};}function removeEntity(_0x376d9a,_0x53e511){return function(_0x4c888f){if(_0x4c888f){return _0x4c888f[_0xc1d7('0x27')]()['then'](function(){_0x376d9a[_0xc1d7('0x1c')](0xcc)[_0xc1d7('0x1d')]();});}};}function handleEntityNotFound(_0x3d08f9,_0x319394){return function(_0x3325fc){if(!_0x3325fc){_0x3d08f9[_0xc1d7('0x1b')](0x194);}return _0x3325fc;};}function handleError(_0x1d574d,_0x3345b2){_0x3345b2=_0x3345b2||0x1f4;return function(_0x1ff74e){logger[_0xc1d7('0x28')](_0x1ff74e['stack']);if(_0x1ff74e[_0xc1d7('0x29')]){delete _0x1ff74e['name'];}_0x1d574d[_0xc1d7('0x1c')](_0x3345b2)['send'](_0x1ff74e);};}exports[_0xc1d7('0x2a')]=function(_0x8e3d,_0x226683){var _0x55b28d={},_0x559dbd={},_0xcca4b0={'count':0x0,'rows':[]};var _0x42cc22=_[_0xc1d7('0x2b')](db[_0xc1d7('0x2c')][_0xc1d7('0x2d')],function(_0x3f9a00){return{'name':_0x3f9a00[_0xc1d7('0x2e')],'type':_0x3f9a00['type']['key']};});_0x559dbd[_0xc1d7('0x2f')]=_[_0xc1d7('0x2b')](_0x42cc22,'name');_0x559dbd['query']=_[_0xc1d7('0x30')](_0x8e3d[_0xc1d7('0x31')]);_0x559dbd[_0xc1d7('0x32')]=_[_0xc1d7('0x33')](_0x559dbd[_0xc1d7('0x2f')],_0x559dbd[_0xc1d7('0x31')]);_0x55b28d['attributes']=_[_0xc1d7('0x33')](_0x559dbd[_0xc1d7('0x2f')],qs[_0xc1d7('0x34')](_0x8e3d[_0xc1d7('0x31')][_0xc1d7('0x34')]));_0x55b28d[_0xc1d7('0x35')]=_0x55b28d[_0xc1d7('0x35')][_0xc1d7('0x36')]?_0x55b28d[_0xc1d7('0x35')]:_0x559dbd[_0xc1d7('0x2f')];if(!_0x8e3d[_0xc1d7('0x31')]['hasOwnProperty']('nolimit')){_0x55b28d['limit']=qs['limit'](_0x8e3d['query'][_0xc1d7('0x22')]);_0x55b28d[_0xc1d7('0x1f')]=qs[_0xc1d7('0x1f')](_0x8e3d[_0xc1d7('0x31')]['offset']);}_0x55b28d[_0xc1d7('0x37')]=qs['sort'](_0x8e3d[_0xc1d7('0x31')][_0xc1d7('0x38')]);_0x55b28d[_0xc1d7('0x39')]=qs[_0xc1d7('0x32')](_[_0xc1d7('0x3a')](_0x8e3d[_0xc1d7('0x31')],_0x559dbd[_0xc1d7('0x32')]),_0x42cc22);if(_0x8e3d[_0xc1d7('0x31')]['filter']){_0x55b28d[_0xc1d7('0x39')]=_['merge'](_0x55b28d['where'],{'$or':_[_0xc1d7('0x2b')](_0x42cc22,function(_0x20af4c){if(_0x20af4c[_0xc1d7('0x3b')]!==_0xc1d7('0x3c')){var _0x465f0b={};_0x465f0b[_0x20af4c[_0xc1d7('0x29')]]={'$like':'%'+_0x8e3d[_0xc1d7('0x31')][_0xc1d7('0x3d')]+'%'};return _0x465f0b;}})});}_0x55b28d=_[_0xc1d7('0x3e')]({},_0x55b28d,_0x8e3d[_0xc1d7('0x3f')]);var _0xdf162b={'where':_0x55b28d[_0xc1d7('0x39')]};return db[_0xc1d7('0x2c')][_0xc1d7('0x21')](_0xdf162b)[_0xc1d7('0x40')](function(_0x518d1a){_0xcca4b0[_0xc1d7('0x21')]=_0x518d1a;if(_0x8e3d['query'][_0xc1d7('0x41')]){_0x55b28d['include']=[{'all':!![]}];}return db[_0xc1d7('0x2c')][_0xc1d7('0x42')](_0x55b28d);})[_0xc1d7('0x40')](function(_0x1fcdaa){_0xcca4b0['rows']=_0x1fcdaa;return _0xcca4b0;})[_0xc1d7('0x40')](respondWithFilteredResult(_0x226683,_0x55b28d))[_0xc1d7('0x43')](handleError(_0x226683,null));};exports['show']=function(_0x1fd3f1,_0x46f7b7){var _0x347592={'raw':!![],'where':{'id':_0x1fd3f1[_0xc1d7('0x44')]['id']}},_0x43179e={};_0x43179e[_0xc1d7('0x2f')]=_['keys'](db['VoiceDialReport'][_0xc1d7('0x2d')]);_0x43179e[_0xc1d7('0x31')]=_[_0xc1d7('0x30')](_0x1fd3f1['query']);_0x43179e[_0xc1d7('0x32')]=_[_0xc1d7('0x33')](_0x43179e[_0xc1d7('0x2f')],_0x43179e[_0xc1d7('0x31')]);_0x347592[_0xc1d7('0x35')]=_[_0xc1d7('0x33')](_0x43179e[_0xc1d7('0x2f')],qs[_0xc1d7('0x34')](_0x1fd3f1[_0xc1d7('0x31')][_0xc1d7('0x34')]));_0x347592[_0xc1d7('0x35')]=_0x347592[_0xc1d7('0x35')]['length']?_0x347592[_0xc1d7('0x35')]:_0x43179e['model'];if(_0x1fd3f1['query'][_0xc1d7('0x41')]){_0x347592[_0xc1d7('0x45')]=[{'all':!![]}];}_0x347592=_[_0xc1d7('0x3e')]({},_0x347592,_0x1fd3f1[_0xc1d7('0x3f')]);return db[_0xc1d7('0x2c')][_0xc1d7('0x46')](_0x347592)[_0xc1d7('0x40')](handleEntityNotFound(_0x46f7b7,null))[_0xc1d7('0x40')](respondWithResult(_0x46f7b7,null))[_0xc1d7('0x43')](handleError(_0x46f7b7,null));};exports['create']=function(_0x36c104,_0x14e87c){return db[_0xc1d7('0x2c')]['create'](_0x36c104[_0xc1d7('0x47')],{})[_0xc1d7('0x40')](respondWithResult(_0x14e87c,0xc9))[_0xc1d7('0x43')](handleError(_0x14e87c,null));};exports[_0xc1d7('0x26')]=function(_0x30fc04,_0x5dc178){if(_0x30fc04[_0xc1d7('0x47')]['id']){delete _0x30fc04[_0xc1d7('0x47')]['id'];}return db[_0xc1d7('0x2c')][_0xc1d7('0x46')]({'where':{'id':_0x30fc04['params']['id']}})[_0xc1d7('0x40')](handleEntityNotFound(_0x5dc178,null))[_0xc1d7('0x40')](saveUpdates(_0x30fc04['body'],null))[_0xc1d7('0x40')](respondWithResult(_0x5dc178,null))['catch'](handleError(_0x5dc178,null));};exports[_0xc1d7('0x27')]=function(_0x160486,_0x51bc8e){return db[_0xc1d7('0x2c')]['find']({'where':{'id':_0x160486['params']['id']}})['then'](handleEntityNotFound(_0x51bc8e,null))[_0xc1d7('0x40')](removeEntity(_0x51bc8e,null))[_0xc1d7('0x43')](handleError(_0x51bc8e,null));};exports[_0xc1d7('0x48')]=function(_0x214de1,_0x16289a){return db['VoiceDialReport'][_0xc1d7('0x48')]()[_0xc1d7('0x40')](respondWithResult(_0x16289a,null))[_0xc1d7('0x43')](handleError(_0x16289a,null));};
\ No newline at end of file
index 77a7e71..d44de9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96bb=['report_dial','uniqueid','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','VoiceDialReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x96bb,0x1be));var _0xb96b=function(_0x1f15bb,_0x4663fb){_0x1f15bb=_0x1f15bb-0x0;var _0x3a49ef=_0x96bb[_0x1f15bb];return _0x3a49ef;};'use strict';var _=require('lodash');var util=require(_0xb96b('0x0'));var logger=require(_0xb96b('0x1'))(_0xb96b('0x2'));var moment=require(_0xb96b('0x3'));var BPromise=require('bluebird');var rp=require(_0xb96b('0x4'));var fs=require('fs');var path=require(_0xb96b('0x5'));var rimraf=require(_0xb96b('0x6'));var config=require(_0xb96b('0x7'));var attributes=require('./voiceDialReport.attributes');module[_0xb96b('0x8')]=function(_0x4c9947,_0x29d75b){return _0x4c9947['define'](_0xb96b('0x9'),attributes,{'tableName':_0xb96b('0xa'),'paranoid':![],'indexes':[{'fields':[_0xb96b('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3770=['exports','define','report_dial','uniqueid','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceDialReport.attributes'];(function(_0x2edda6,_0x5bed7a){var _0x1b640a=function(_0x1dd910){while(--_0x1dd910){_0x2edda6['push'](_0x2edda6['shift']());}};_0x1b640a(++_0x5bed7a);}(_0x3770,0x13c));var _0x0377=function(_0x5e9fcd,_0x35065a){_0x5e9fcd=_0x5e9fcd-0x0;var _0x3e1513=_0x3770[_0x5e9fcd];return _0x3e1513;};'use strict';var _=require(_0x0377('0x0'));var util=require(_0x0377('0x1'));var logger=require(_0x0377('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0377('0x3'));var rp=require(_0x0377('0x4'));var fs=require('fs');var path=require(_0x0377('0x5'));var rimraf=require(_0x0377('0x6'));var config=require('../../config/environment');var attributes=require(_0x0377('0x7'));module[_0x0377('0x8')]=function(_0x5ef187,_0x43524e){return _0x5ef187[_0x0377('0x9')]('VoiceDialReport',attributes,{'tableName':_0x0377('0xa'),'paranoid':![],'indexes':[{'fields':[_0x0377('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index a4256b0..6248917 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e28=['create','options','raw','then','debug','stringify','UpdateVoiceDialReport','update','body','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','VoiceDialReport,\x20%s,\x20%s','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','CreateVoiceDialReport','VoiceDialReport'];(function(_0x2d9bca,_0xb3e985){var _0xbb82af=function(_0x92c4cd){while(--_0x92c4cd){_0x2d9bca['push'](_0x2d9bca['shift']());}};_0xbb82af(++_0xb3e985);}(_0x7e28,0x177));var _0x87e2=function(_0xe9f6ca,_0xca597c){_0xe9f6ca=_0xe9f6ca-0x0;var _0x313089=_0x7e28[_0xe9f6ca];return _0x313089;};'use strict';var _=require(_0x87e2('0x0'));var util=require('util');var moment=require(_0x87e2('0x1'));var BPromise=require(_0x87e2('0x2'));var rs=require(_0x87e2('0x3'));var fs=require('fs');var Redis=require(_0x87e2('0x4'));var db=require(_0x87e2('0x5'))['db'];var utils=require(_0x87e2('0x6'));var logger=require('../../config/logger')(_0x87e2('0x7'));var config=require(_0x87e2('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x87e2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x10112f,_0x4ef31a,_0x56d07d){return new BPromise(function(_0x162958,_0x5dae88){return client[_0x87e2('0xa')](_0x10112f,_0x56d07d)['then'](function(_0x54f099){logger['info'](_0x87e2('0xb'),_0x4ef31a,_0x87e2('0xc'));logger['debug'](_0x87e2('0xd'),_0x4ef31a,_0x87e2('0xc'),JSON['stringify'](_0x54f099));if(_0x54f099[_0x87e2('0xe')]){if(_0x54f099['error']['code']===0x1f4){logger[_0x87e2('0xe')](_0x87e2('0xb'),_0x4ef31a,_0x54f099[_0x87e2('0xe')]['message']);return _0x5dae88(_0x54f099[_0x87e2('0xe')][_0x87e2('0xf')]);}logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x4ef31a,_0x54f099[_0x87e2('0xe')]['message']);return _0x162958(_0x54f099['error'][_0x87e2('0xf')]);}else{logger[_0x87e2('0x10')]('VoiceDialReport,\x20%s,\x20%s',_0x4ef31a,_0x87e2('0xc'));_0x162958(_0x54f099[_0x87e2('0x11')][_0x87e2('0xf')]);}})[_0x87e2('0x12')](function(_0x73cf4f){logger[_0x87e2('0xe')]('VoiceDialReport,\x20%s,\x20%s',_0x4ef31a,_0x73cf4f);_0x5dae88(_0x73cf4f);});});}exports[_0x87e2('0x13')]=function(_0x44e9c9){var _0x3b2407=this;return new Promise(function(_0x521442,_0x23532d){return db[_0x87e2('0x14')][_0x87e2('0x15')](_0x44e9c9['body'],{'raw':_0x44e9c9[_0x87e2('0x16')]?_0x44e9c9[_0x87e2('0x16')][_0x87e2('0x17')]===undefined?!![]:![]:!![]})[_0x87e2('0x18')](function(_0x5d96de){logger[_0x87e2('0x10')]('CreateVoiceDialReport',_0x44e9c9);logger[_0x87e2('0x19')](_0x87e2('0x13'),_0x44e9c9,JSON[_0x87e2('0x1a')](_0x5d96de));_0x521442(_0x5d96de);})[_0x87e2('0x12')](function(_0x2f8919){logger[_0x87e2('0xe')](_0x87e2('0x13'),_0x2f8919['message'],_0x44e9c9);_0x23532d(_0x3b2407[_0x87e2('0xe')](0x1f4,_0x2f8919[_0x87e2('0xf')]));});});};exports[_0x87e2('0x1b')]=function(_0x42efc7){var _0x428b2c=this;return new Promise(function(_0x5d1a58,_0x3ffa09){return db[_0x87e2('0x14')][_0x87e2('0x1c')](_0x42efc7[_0x87e2('0x1d')],{'raw':_0x42efc7['options']?_0x42efc7['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42efc7['options']?_0x42efc7[_0x87e2('0x16')][_0x87e2('0x1e')]||null:null,'attributes':_0x42efc7[_0x87e2('0x16')]?_0x42efc7[_0x87e2('0x16')][_0x87e2('0x1f')]||null:null,'limit':_0x42efc7['options']?_0x42efc7[_0x87e2('0x16')][_0x87e2('0x20')]||null:null})[_0x87e2('0x18')](function(_0x5d46fb){logger['info']('UpdateVoiceDialReport',_0x42efc7);logger[_0x87e2('0x19')](_0x87e2('0x1b'),_0x42efc7,JSON[_0x87e2('0x1a')](_0x5d46fb));_0x5d1a58(_0x5d46fb);})[_0x87e2('0x12')](function(_0xbbfca2){logger[_0x87e2('0xe')](_0x87e2('0x1b'),_0xbbfca2['message'],_0x42efc7);_0x3ffa09(_0x428b2c[_0x87e2('0xe')](0x1f4,_0xbbfca2[_0x87e2('0xf')]));});});};
\ No newline at end of file
+var _0xa6f8=['body','where','attributes','limit','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateVoiceDialReport','options','raw','stringify','UpdateVoiceDialReport','VoiceDialReport','update'];(function(_0x4bbee8,_0x24f3c0){var _0x34dac8=function(_0x5ba9a5){while(--_0x5ba9a5){_0x4bbee8['push'](_0x4bbee8['shift']());}};_0x34dac8(++_0x24f3c0);}(_0xa6f8,0x9a));var _0x8a6f=function(_0xf5ed1b,_0x33a489){_0xf5ed1b=_0xf5ed1b-0x0;var _0x5ecbdb=_0xa6f8[_0xf5ed1b];return _0x5ecbdb;};'use strict';var _=require(_0x8a6f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8a6f('0x1'));var rs=require(_0x8a6f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8a6f('0x3'))['db'];var utils=require(_0x8a6f('0x4'));var logger=require(_0x8a6f('0x5'))('rpc');var config=require(_0x8a6f('0x6'));var jayson=require(_0x8a6f('0x7'));var client=jayson['client'][_0x8a6f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x36b698,_0x19cc75,_0xacf424){return new BPromise(function(_0x27fb70,_0x46d1c5){return client[_0x8a6f('0x9')](_0x36b698,_0xacf424)[_0x8a6f('0xa')](function(_0x883a1a){logger['info'](_0x8a6f('0xb'),_0x19cc75,_0x8a6f('0xc'));logger[_0x8a6f('0xd')](_0x8a6f('0xe'),_0x19cc75,_0x8a6f('0xc'),JSON['stringify'](_0x883a1a));if(_0x883a1a[_0x8a6f('0xf')]){if(_0x883a1a[_0x8a6f('0xf')]['code']===0x1f4){logger[_0x8a6f('0xf')]('VoiceDialReport,\x20%s,\x20%s',_0x19cc75,_0x883a1a['error'][_0x8a6f('0x10')]);return _0x46d1c5(_0x883a1a[_0x8a6f('0xf')][_0x8a6f('0x10')]);}logger[_0x8a6f('0xf')]('VoiceDialReport,\x20%s,\x20%s',_0x19cc75,_0x883a1a[_0x8a6f('0xf')][_0x8a6f('0x10')]);return _0x27fb70(_0x883a1a[_0x8a6f('0xf')][_0x8a6f('0x10')]);}else{logger['info'](_0x8a6f('0xb'),_0x19cc75,_0x8a6f('0xc'));_0x27fb70(_0x883a1a[_0x8a6f('0x11')][_0x8a6f('0x10')]);}})[_0x8a6f('0x12')](function(_0x5a1734){logger['error'](_0x8a6f('0xb'),_0x19cc75,_0x5a1734);_0x46d1c5(_0x5a1734);});});}exports[_0x8a6f('0x13')]=function(_0x311831){var _0x11ecae=this;return new Promise(function(_0xb8c492,_0x213141){return db['VoiceDialReport']['create'](_0x311831['body'],{'raw':_0x311831['options']?_0x311831[_0x8a6f('0x14')][_0x8a6f('0x15')]===undefined?!![]:![]:!![]})[_0x8a6f('0xa')](function(_0x131ba5){logger['info'](_0x8a6f('0x13'),_0x311831);logger[_0x8a6f('0xd')](_0x8a6f('0x13'),_0x311831,JSON[_0x8a6f('0x16')](_0x131ba5));_0xb8c492(_0x131ba5);})[_0x8a6f('0x12')](function(_0x2f6ded){logger[_0x8a6f('0xf')](_0x8a6f('0x13'),_0x2f6ded[_0x8a6f('0x10')],_0x311831);_0x213141(_0x11ecae[_0x8a6f('0xf')](0x1f4,_0x2f6ded[_0x8a6f('0x10')]));});});};exports[_0x8a6f('0x17')]=function(_0xc66886){var _0x237cd1=this;return new Promise(function(_0x26572f,_0x545ee8){return db[_0x8a6f('0x18')][_0x8a6f('0x19')](_0xc66886[_0x8a6f('0x1a')],{'raw':_0xc66886['options']?_0xc66886[_0x8a6f('0x14')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc66886[_0x8a6f('0x14')]?_0xc66886[_0x8a6f('0x14')][_0x8a6f('0x1b')]||null:null,'attributes':_0xc66886[_0x8a6f('0x14')]?_0xc66886[_0x8a6f('0x14')][_0x8a6f('0x1c')]||null:null,'limit':_0xc66886[_0x8a6f('0x14')]?_0xc66886[_0x8a6f('0x14')][_0x8a6f('0x1d')]||null:null})[_0x8a6f('0xa')](function(_0x5196d1){logger['info'](_0x8a6f('0x17'),_0xc66886);logger[_0x8a6f('0xd')]('UpdateVoiceDialReport',_0xc66886,JSON[_0x8a6f('0x16')](_0x5196d1));_0x26572f(_0x5196d1);})[_0x8a6f('0x12')](function(_0x535e8e){logger[_0x8a6f('0xf')](_0x8a6f('0x17'),_0x535e8e['message'],_0xc66886);_0x545ee8(_0x237cd1[_0x8a6f('0xf')](0x1f4,_0x535e8e[_0x8a6f('0x10')]));});});};
\ No newline at end of file
index d551575..14d5e8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa427=['show','post','create','/:id/applications','addApplications','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceExtension.controller','isAuthenticated','index','get','/:id'];(function(_0x202d24,_0x5e8641){var _0x2b3a8e=function(_0x4c7c4a){while(--_0x4c7c4a){_0x202d24['push'](_0x202d24['shift']());}};_0x2b3a8e(++_0x5e8641);}(_0xa427,0x1d6));var _0x7a42=function(_0x43aa01,_0xa368ec){_0x43aa01=_0x43aa01-0x0;var _0x14e3a9=_0xa427[_0x43aa01];return _0x14e3a9;};'use strict';var multer=require(_0x7a42('0x0'));var util=require(_0x7a42('0x1'));var path=require('path');var timeout=require(_0x7a42('0x2'));var express=require(_0x7a42('0x3'));var router=express[_0x7a42('0x4')]();var fs_extra=require(_0x7a42('0x5'));var auth=require(_0x7a42('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7a42('0x7'));var controller=require(_0x7a42('0x8'));router['get']('/',auth[_0x7a42('0x9')](),controller[_0x7a42('0xa')]);router[_0x7a42('0xb')](_0x7a42('0xc'),auth[_0x7a42('0x9')](),controller[_0x7a42('0xd')]);router[_0x7a42('0xe')]('/',auth['isAuthenticated'](),controller[_0x7a42('0xf')]);router[_0x7a42('0xe')](_0x7a42('0x10'),auth[_0x7a42('0x9')](),controller[_0x7a42('0x11')]);router['put'](_0x7a42('0xc'),auth[_0x7a42('0x9')](),controller['update']);router[_0x7a42('0x12')]('/:id',auth[_0x7a42('0x9')](),controller[_0x7a42('0x13')]);module[_0x7a42('0x14')]=router;
\ No newline at end of file
+var _0x6175=['show','post','create','/:id/applications','addApplications','put','delete','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x4cd6aa,_0x2389e0){var _0x43991e=function(_0x33336d){while(--_0x33336d){_0x4cd6aa['push'](_0x4cd6aa['shift']());}};_0x43991e(++_0x2389e0);}(_0x6175,0xec));var _0x5617=function(_0x4a4a08,_0x3e7b09){_0x4a4a08=_0x4a4a08-0x0;var _0x358ece=_0x6175[_0x4a4a08];return _0x358ece;};'use strict';var multer=require(_0x5617('0x0'));var util=require('util');var path=require(_0x5617('0x1'));var timeout=require('connect-timeout');var express=require(_0x5617('0x2'));var router=express[_0x5617('0x3')]();var fs_extra=require(_0x5617('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5617('0x5'));var config=require(_0x5617('0x6'));var controller=require('./voiceExtension.controller');router[_0x5617('0x7')]('/',auth[_0x5617('0x8')](),controller[_0x5617('0x9')]);router['get'](_0x5617('0xa'),auth[_0x5617('0x8')](),controller[_0x5617('0xb')]);router[_0x5617('0xc')]('/',auth[_0x5617('0x8')](),controller[_0x5617('0xd')]);router[_0x5617('0xc')](_0x5617('0xe'),auth[_0x5617('0x8')](),controller[_0x5617('0xf')]);router[_0x5617('0x10')](_0x5617('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x5617('0x11')](_0x5617('0xa'),auth[_0x5617('0x8')](),controller['destroy']);module[_0x5617('0x12')]=router;
\ No newline at end of file
index 1e07620..01aa7bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5dc2=['outbound','internal','inbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','exten','sequelize','STRING','compositeIndex','NoOp','ENUM','inbound'];(function(_0x3111df,_0x5e20a7){var _0x37471=function(_0x20e8ce){while(--_0x20e8ce){_0x3111df['push'](_0x3111df['shift']());}};_0x37471(++_0x5e20a7);}(_0x5dc2,0xca));var _0x25dc=function(_0x3c563b,_0x1f5a3b){_0x3c563b=_0x3c563b-0x0;var _0x504508=_0x5dc2[_0x3c563b];return _0x504508;};'use strict';var Sequelize=require(_0x25dc('0x0'));module['exports']={'context':{'type':Sequelize[_0x25dc('0x1')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x25dc('0x1')],'allowNull':![],'unique':_0x25dc('0x2')},'priority':{'type':Sequelize[_0x25dc('0x1')],'allowNull':![],'defaultValue':'1','unique':_0x25dc('0x2')},'tag':{'type':Sequelize[_0x25dc('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x25dc('0x1')],'allowNull':![],'defaultValue':_0x25dc('0x3')},'appdata':{'type':Sequelize[_0x25dc('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x25dc('0x4')](_0x25dc('0x5'),_0x25dc('0x6'),_0x25dc('0x7'),_0x25dc('0x8'),'outbound-fax',_0x25dc('0x9'),_0x25dc('0xa')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x25dc('0xb')},'IntervalId':{'type':Sequelize[_0x25dc('0xc')]},'isApp':{'type':Sequelize[_0x25dc('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x25dc('0x1')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x25dc('0xc')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0x25dc('0xe')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x168cd1){return this['getDataValue'](_0x25dc('0xf'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
+var _0x17ba=['inbound-fax','any','INTEGER','BOOLEAN','wav','VIRTUAL','sequelize','STRING','compositeIndex','NoOp','inbound','outbound','internal'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x17ba,0x95));var _0xa17b=function(_0x185ab4,_0x599b79){_0x185ab4=_0x185ab4-0x0;var _0x28054b=_0x17ba[_0x185ab4];return _0x28054b;};'use strict';var Sequelize=require(_0xa17b('0x0'));module['exports']={'context':{'type':Sequelize[_0xa17b('0x1')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xa17b('0x1')],'allowNull':![],'unique':_0xa17b('0x2')},'priority':{'type':Sequelize[_0xa17b('0x1')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0xa17b('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xa17b('0x1')],'allowNull':![],'defaultValue':_0xa17b('0x3')},'appdata':{'type':Sequelize[_0xa17b('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0xa17b('0x4'),_0xa17b('0x5'),_0xa17b('0x6'),_0xa17b('0x7'),'outbound-fax','system',_0xa17b('0x8')),'allowNull':![]},'description':{'type':Sequelize[_0xa17b('0x1')]},'interval':{'type':Sequelize[_0xa17b('0x1')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0xa17b('0x9')]},'isApp':{'type':Sequelize[_0xa17b('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xa17b('0x1')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0xa17b('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xa17b('0x9')]},'recordingFormat':{'type':Sequelize[_0xa17b('0x1')],'defaultValue':_0xa17b('0xb')},'answer':{'type':Sequelize[_0xa17b('0xa')],'defaultValue':!![]},'name':{'type':Sequelize[_0xa17b('0xc')],'get':function(_0x27be05){return this['getDataValue']('exten');}},'alias':{'type':Sequelize[_0xa17b('0x1')],'allowNull':!![]}};
\ No newline at end of file
index bf41999..8beaaa7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53c1=['register','sendStatus','status','json','offset','undefined','limit','count','set','destroy','InboundRoutes','inbound','OutboundRoutes','outbound','filter','ignore','value','includes','type','name','UserProfileResource','then','end','stack','send','index','rawAttributes','key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','includeAll','include','VoiceExtension','findAll','rows','catch','show','keys','options','find','startsWith','body','exten','concat','create','get','internal','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','context','description','recordingFormat','alias','sequelize','transaction','Transaction','ISOLATION_LEVELS','findOne','VoiceExtensionId','createRouting','bulkCreate','cast(priority\x20as\x20unsigned)','finally','ioredis','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter'];(function(_0x3b5ccc,_0x46cb48){var _0x209f34=function(_0x3fd01e){while(--_0x3fd01e){_0x3b5ccc['push'](_0x3b5ccc['shift']());}};_0x209f34(++_0x46cb48);}(_0x53c1,0x158));var _0x153c=function(_0x469003,_0x233c0){_0x469003=_0x469003-0x0;var _0x35742d=_0x53c1[_0x469003];return _0x35742d;};'use strict';var _=require('lodash');var Redis=require(_0x153c('0x0'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x153c('0x1'));var config=require(_0x153c('0x2'));var db=require(_0x153c('0x3'))['db'];config[_0x153c('0x4')]=_[_0x153c('0x5')](config['redis'],{'host':_0x153c('0x6'),'port':0x18eb});var socket=require(_0x153c('0x7'))(new Redis(config[_0x153c('0x4')]));require('./voiceExtension.socket')[_0x153c('0x8')](socket);function respondWithStatusCode(_0x4d5560,_0x298d4e){_0x298d4e=_0x298d4e||0xcc;return function(_0x3614cc){if(_0x3614cc){return _0x4d5560[_0x153c('0x9')](_0x298d4e);}return _0x4d5560[_0x153c('0xa')](_0x298d4e)['end']();};}function respondWithResult(_0x4c7f3b,_0x14ed73){_0x14ed73=_0x14ed73||0xc8;return function(_0x276251){if(_0x276251){return _0x4c7f3b['status'](_0x14ed73)[_0x153c('0xb')](_0x276251);}};}function respondWithFilteredResult(_0x23ede1,_0x387aaf){return function(_0x32eb7a){if(_0x32eb7a){var _0x466c72=typeof _0x387aaf[_0x153c('0xc')]===_0x153c('0xd')&&typeof _0x387aaf[_0x153c('0xe')]===_0x153c('0xd');var _0x32c2b8=_0x32eb7a[_0x153c('0xf')];var _0x46c232=_0x466c72?0x0:_0x387aaf[_0x153c('0xc')];var _0xa7f12=_0x466c72?_0x32eb7a[_0x153c('0xf')]:_0x387aaf[_0x153c('0xc')]+_0x387aaf[_0x153c('0xe')];var _0x568d6c;if(_0xa7f12>=_0x32c2b8){_0xa7f12=_0x32c2b8;_0x568d6c=0xc8;}else{_0x568d6c=0xce;}_0x23ede1[_0x153c('0xa')](_0x568d6c);return _0x23ede1[_0x153c('0x10')]('Content-Range',_0x46c232+'-'+_0xa7f12+'/'+_0x32c2b8)[_0x153c('0xb')](_0x32eb7a);}return null;};}function removeEntity(_0x58ac3f){return function(_0x3917d0){if(_0x3917d0){return _0x3917d0[_0x153c('0x11')]()['then'](function(){var _0x5552fb=_0x3917d0['get']({'plain':!![]});var _0x179d21=[{'name':_0x153c('0x12'),'value':_0x153c('0x13'),'ignore':![]},{'name':_0x153c('0x14'),'value':_0x153c('0x15'),'ignore':![]},{'name':'InternalRoutes','value':'internal','ignore':![]}];var _0x1234e3=_(_0x179d21)[_0x153c('0x16')](_0x153c('0x17'))['map']('value')[_0x153c('0x18')]();if(_[_0x153c('0x19')](_0x1234e3,_0x5552fb['type'])){return;}var _0x52bfde=_['find'](_0x179d21,[_0x153c('0x18'),_0x5552fb[_0x153c('0x1a')]])[_0x153c('0x1b')];return db[_0x153c('0x1c')][_0x153c('0x11')]({'where':{'type':_0x52bfde,'resourceId':_0x5552fb['id']}})[_0x153c('0x1d')](function(){return _0x3917d0;});})[_0x153c('0x1d')](function(){_0x58ac3f[_0x153c('0xa')](0xcc)[_0x153c('0x1e')]();});}};}function handleEntityNotFound(_0x3b0e2f){return function(_0x3ba6d5){if(!_0x3ba6d5){_0x3b0e2f['sendStatus'](0x194);}return _0x3ba6d5;};}function handleError(_0x14d35e,_0x5128e9){_0x5128e9=_0x5128e9||0x1f4;return function(_0x1881ac){logger['error'](_0x1881ac[_0x153c('0x1f')]);if(_0x1881ac['name']){delete _0x1881ac['name'];}_0x14d35e['status'](_0x5128e9)[_0x153c('0x20')](_0x1881ac);};}exports[_0x153c('0x21')]=function(_0xbd16ff,_0x3b36e9){var _0xdb2b9c={},_0x4f788a={},_0x5e4f24={'count':0x0,'rows':[]};var _0x1a265a=_['map'](db['VoiceExtension'][_0x153c('0x22')],function(_0x3a1371){return{'name':_0x3a1371['fieldName'],'type':_0x3a1371[_0x153c('0x1a')][_0x153c('0x23')]};});_0x4f788a['model']=_[_0x153c('0x24')](_0x1a265a,_0x153c('0x1b'));_0x4f788a[_0x153c('0x25')]=_['keys'](_0xbd16ff[_0x153c('0x25')]);_0x4f788a[_0x153c('0x26')]=_[_0x153c('0x27')](_0x4f788a[_0x153c('0x28')],_0x4f788a[_0x153c('0x25')]);_0xdb2b9c[_0x153c('0x29')]=_[_0x153c('0x27')](_0x4f788a[_0x153c('0x28')],qs[_0x153c('0x2a')](_0xbd16ff[_0x153c('0x25')][_0x153c('0x2a')]));_0xdb2b9c[_0x153c('0x29')]=_0xdb2b9c[_0x153c('0x29')][_0x153c('0x2b')]?_0xdb2b9c[_0x153c('0x29')]:_0x4f788a[_0x153c('0x28')];if(!_0xbd16ff[_0x153c('0x25')][_0x153c('0x2c')]('nolimit')){_0xdb2b9c['limit']=qs[_0x153c('0xe')](_0xbd16ff['query']['limit']);_0xdb2b9c['offset']=qs[_0x153c('0xc')](_0xbd16ff[_0x153c('0x25')][_0x153c('0xc')]);}_0xdb2b9c[_0x153c('0x2d')]=qs[_0x153c('0x2e')](_0xbd16ff[_0x153c('0x25')][_0x153c('0x2e')]);_0xdb2b9c[_0x153c('0x2f')]=qs[_0x153c('0x26')](_[_0x153c('0x30')](_0xbd16ff[_0x153c('0x25')],_0x4f788a[_0x153c('0x26')]),_0x1a265a);if(_0xbd16ff[_0x153c('0x25')][_0x153c('0x16')]){_0xdb2b9c['where']=_[_0x153c('0x31')](_0xdb2b9c[_0x153c('0x2f')],{'$or':_[_0x153c('0x24')](_0x1a265a,function(_0x306c59){if(_0x306c59[_0x153c('0x1a')]!==_0x153c('0x32')){var _0x3a538c={};_0x3a538c[_0x306c59[_0x153c('0x1b')]]={'$like':'%'+_0xbd16ff['query'][_0x153c('0x16')]+'%'};return _0x3a538c;}})});}_0xdb2b9c=_['merge']({},_0xdb2b9c,_0xbd16ff['options']);var _0x32daa4={'where':_0xdb2b9c[_0x153c('0x2f')]};return db['VoiceExtension']['count'](_0x32daa4)[_0x153c('0x1d')](function(_0x492b31){_0x5e4f24['count']=_0x492b31;if(_0xbd16ff[_0x153c('0x25')][_0x153c('0x33')]){_0xdb2b9c[_0x153c('0x34')]=[{'all':!![]}];}return db[_0x153c('0x35')][_0x153c('0x36')](_0xdb2b9c);})[_0x153c('0x1d')](function(_0x274581){_0x5e4f24[_0x153c('0x37')]=_0x274581;return _0x5e4f24;})[_0x153c('0x1d')](respondWithFilteredResult(_0x3b36e9,_0xdb2b9c))[_0x153c('0x38')](handleError(_0x3b36e9,null));};exports[_0x153c('0x39')]=function(_0x37d243,_0x4a062e){var _0xb00f97={'raw':![],'where':{'id':_0x37d243['params']['id']}},_0x2e97ef={};_0x2e97ef[_0x153c('0x28')]=_[_0x153c('0x3a')](db['VoiceExtension'][_0x153c('0x22')]);_0x2e97ef[_0x153c('0x25')]=_[_0x153c('0x3a')](_0x37d243[_0x153c('0x25')]);_0x2e97ef[_0x153c('0x26')]=_[_0x153c('0x27')](_0x2e97ef['model'],_0x2e97ef[_0x153c('0x25')]);_0xb00f97[_0x153c('0x29')]=_[_0x153c('0x27')](_0x2e97ef[_0x153c('0x28')],qs[_0x153c('0x2a')](_0x37d243[_0x153c('0x25')][_0x153c('0x2a')]));_0xb00f97['attributes']=_0xb00f97[_0x153c('0x29')][_0x153c('0x2b')]?_0xb00f97[_0x153c('0x29')]:_0x2e97ef[_0x153c('0x28')];if(_0x37d243[_0x153c('0x25')][_0x153c('0x33')]){_0xb00f97[_0x153c('0x34')]=[{'all':!![]}];}_0xb00f97=_['merge']({},_0xb00f97,_0x37d243[_0x153c('0x3b')]);return db[_0x153c('0x35')][_0x153c('0x3c')](_0xb00f97)[_0x153c('0x1d')](handleEntityNotFound(_0x4a062e,null))[_0x153c('0x1d')](respondWithResult(_0x4a062e,null))[_0x153c('0x38')](handleError(_0x4a062e,null));};exports[_0x153c('0x11')]=function(_0x4e452f,_0x62e08f){return db[_0x153c('0x35')][_0x153c('0x3c')]({'where':{'id':_0x4e452f['params']['id']}})['then'](handleEntityNotFound(_0x62e08f,null))['then'](removeEntity(_0x62e08f,null))[_0x153c('0x38')](handleError(_0x62e08f,null));};exports['create']=function(_0x5951d2,_0xa8a837){if(_0x5951d2['body'][_0x153c('0x1a')]===_0x153c('0x15')&&!_[_0x153c('0x3d')](_0x5951d2[_0x153c('0x3e')]['exten'],'_')){_0x5951d2['body'][_0x153c('0x3f')]='_'[_0x153c('0x40')](_0x5951d2[_0x153c('0x3e')][_0x153c('0x3f')]);}return db[_0x153c('0x35')][_0x153c('0x41')](_0x5951d2['body'],{'raw':![]})[_0x153c('0x1d')](function(_0x95b61b){var _0xb6ccef=_0x5951d2['user'][_0x153c('0x42')]({'plain':!![]});if(!_0xb6ccef)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xb6ccef['role']==='user'){var _0x372b29=_0x95b61b[_0x153c('0x42')]({'plain':!![]});var _0x3f28b2=[{'name':'InboundRoutes','value':_0x153c('0x13')},{'name':_0x153c('0x14'),'value':_0x153c('0x15')},{'name':'InternalRoutes','value':_0x153c('0x43')}];var _0x367e17=_[_0x153c('0x3c')](_0x3f28b2,[_0x153c('0x18'),_0x372b29[_0x153c('0x1a')]])[_0x153c('0x1b')];return db['UserProfileSection'][_0x153c('0x3c')]({'where':{'name':_0x367e17,'userProfileId':_0xb6ccef[_0x153c('0x44')]},'raw':!![]})[_0x153c('0x1d')](function(_0x437239){if(_0x437239&&_0x437239[_0x153c('0x45')]===0x0){return db[_0x153c('0x1c')][_0x153c('0x41')]({'name':_0x372b29['name'],'resourceId':_0x372b29['id'],'type':_0x437239['name'],'sectionId':_0x437239['id']},{})[_0x153c('0x1d')](function(){return _0x95b61b;});}else{return _0x95b61b;}})[_0x153c('0x38')](function(_0x378a6d){logger[_0x153c('0x46')](_0x153c('0x47'),_0x378a6d);throw _0x378a6d;});}return _0x95b61b;})[_0x153c('0x1d')](respondWithResult(_0xa8a837,0xc9))[_0x153c('0x38')](handleError(_0xa8a837,null));};exports[_0x153c('0x48')]=function(_0xcec687,_0x1a32bc){if(_0xcec687[_0x153c('0x3e')]['id']){delete _0xcec687['body']['id'];}return db[_0x153c('0x35')][_0x153c('0x3c')]({'where':{'id':_0xcec687[_0x153c('0x49')]['id']}})[_0x153c('0x1d')](handleEntityNotFound(_0x1a32bc,null))[_0x153c('0x1d')](function(_0x1af1c){if(_0x1af1c){return db[_0x153c('0x35')]['update'](_['pick'](_0xcec687[_0x153c('0x3e')],[_0x153c('0x3f'),_0x153c('0x4a'),_0x153c('0x4b'),_0x153c('0x4c'),'cutdigits','mandatoryDisposition',_0x153c('0x4d')]),{'where':{'context':_0x1af1c[_0x153c('0x4a')],'exten':_0x1af1c[_0x153c('0x3f')]},'individualHooks':!![]})['then'](function(_0x5c98e9){return _0x5c98e9;});}return null;})[_0x153c('0x1d')](respondWithStatusCode(_0x1a32bc,null))[_0x153c('0x38')](handleError(_0x1a32bc,null));};exports['addApplications']=function(_0x8e491f,_0x2bb3ae){var _0x2acb79=_0x8e491f[_0x153c('0x49')]['id'];var _0x2d8f13=_0x8e491f[_0x153c('0x3e')];var _0x5cbe87=0xc8;var _0x4e67ca=null;return db[_0x153c('0x4e')][_0x153c('0x4f')]({'isolationLevel':db[_0x153c('0x4e')][_0x153c('0x50')][_0x153c('0x51')]['READ_COMMITTED']},function(_0x580301){return db[_0x153c('0x35')][_0x153c('0x52')]({'where':{'id':_0x2acb79},'transaction':_0x580301})[_0x153c('0x1d')](function(_0x4e8840){if(_0x4e8840){return db[_0x153c('0x35')][_0x153c('0x11')]({'where':{'VoiceExtensionId':_0x2acb79},'transaction':_0x580301})['then'](function(){var _0x3527c2=_[_0x153c('0x24')](_0x2d8f13,function(_0x25df64){_0x25df64[_0x153c('0x53')]=_0x2acb79;_0x25df64['isApp']=!![];return _0x25df64;});return _0x4e8840[_0x153c('0x54')](_0x3527c2);})[_0x153c('0x1d')](function(_0x4b47b0){return db['VoiceExtension'][_0x153c('0x55')](_0x4b47b0,{'transaction':_0x580301});});}else{_0x5cbe87=0x194;_0x4e67ca=[];}});})[_0x153c('0x1d')](function(){if(_0x5cbe87!==0x194){return db[_0x153c('0x35')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x2acb79},'order':_0x153c('0x56')})[_0x153c('0x1d')](function(_0xfff7ca){_0x4e67ca=_0xfff7ca;});}})[_0x153c('0x38')](function(_0x5e21b7){_0x5cbe87=0x1f4;logger['error'](_0x5e21b7['stack']);if(_0x5e21b7[_0x153c('0x1b')]){delete _0x5e21b7[_0x153c('0x1b')];}_0x4e67ca=_0x5e21b7;})[_0x153c('0x57')](function(){if(_0x4e67ca===null){_0x2bb3ae[_0x153c('0x9')](_0x5cbe87);}else{if(_0x5cbe87===0x1f4){_0x2bb3ae[_0x153c('0xa')](_0x5cbe87)[_0x153c('0x20')](_0x4e67ca);}else{_0x2bb3ae['status'](_0x5cbe87)['json'](_0x4e67ca);}}});};
\ No newline at end of file
+var _0xc417=['socket.io-emitter','./voiceExtension.socket','register','status','end','offset','undefined','count','limit','set','Content-Range','json','destroy','then','get','InboundRoutes','OutboundRoutes','outbound','InternalRoutes','internal','ignore','map','value','includes','type','find','UserProfileResource','sendStatus','error','stack','VoiceExtension','rawAttributes','fieldName','key','model','name','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','catch','body','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','findAndCountAll','cast(priority\x20as\x20unsigned)','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost'];(function(_0x1943d9,_0x245bb8){var _0x4b4f3f=function(_0x3bba90){while(--_0x3bba90){_0x1943d9['push'](_0x1943d9['shift']());}};_0x4b4f3f(++_0x245bb8);}(_0xc417,0x11b));var _0x7c41=function(_0x9c3a69,_0x490bab){_0x9c3a69=_0x9c3a69-0x0;var _0x222abd=_0xc417[_0x9c3a69];return _0x222abd;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require(_0x7c41('0x0'));var logger=require(_0x7c41('0x1'))(_0x7c41('0x2'));var config=require(_0x7c41('0x3'));var db=require(_0x7c41('0x4'))['db'];config[_0x7c41('0x5')]=_[_0x7c41('0x6')](config['redis'],{'host':_0x7c41('0x7'),'port':0x18eb});var socket=require(_0x7c41('0x8'))(new Redis(config[_0x7c41('0x5')]));require(_0x7c41('0x9'))[_0x7c41('0xa')](socket);function respondWithStatusCode(_0x172e60,_0x148ec6){_0x148ec6=_0x148ec6||0xcc;return function(_0x54e7b1){if(_0x54e7b1){return _0x172e60['sendStatus'](_0x148ec6);}return _0x172e60[_0x7c41('0xb')](_0x148ec6)[_0x7c41('0xc')]();};}function respondWithResult(_0x4e9db9,_0x8bf585){_0x8bf585=_0x8bf585||0xc8;return function(_0x1812de){if(_0x1812de){return _0x4e9db9[_0x7c41('0xb')](_0x8bf585)['json'](_0x1812de);}};}function respondWithFilteredResult(_0x54de9d,_0x1908d9){return function(_0xbf9748){if(_0xbf9748){var _0x45b042=typeof _0x1908d9[_0x7c41('0xd')]===_0x7c41('0xe')&&typeof _0x1908d9['limit']===_0x7c41('0xe');var _0x103a3b=_0xbf9748[_0x7c41('0xf')];var _0x4a0fa2=_0x45b042?0x0:_0x1908d9[_0x7c41('0xd')];var _0x12d3c5=_0x45b042?_0xbf9748[_0x7c41('0xf')]:_0x1908d9[_0x7c41('0xd')]+_0x1908d9[_0x7c41('0x10')];var _0xd56d99;if(_0x12d3c5>=_0x103a3b){_0x12d3c5=_0x103a3b;_0xd56d99=0xc8;}else{_0xd56d99=0xce;}_0x54de9d['status'](_0xd56d99);return _0x54de9d[_0x7c41('0x11')](_0x7c41('0x12'),_0x4a0fa2+'-'+_0x12d3c5+'/'+_0x103a3b)[_0x7c41('0x13')](_0xbf9748);}return null;};}function removeEntity(_0x4a4df6){return function(_0x137e9b){if(_0x137e9b){return _0x137e9b[_0x7c41('0x14')]()[_0x7c41('0x15')](function(){var _0x18ae0d=_0x137e9b[_0x7c41('0x16')]({'plain':!![]});var _0x189088=[{'name':_0x7c41('0x17'),'value':'inbound','ignore':![]},{'name':_0x7c41('0x18'),'value':_0x7c41('0x19'),'ignore':![]},{'name':_0x7c41('0x1a'),'value':_0x7c41('0x1b'),'ignore':![]}];var _0xf27510=_(_0x189088)['filter'](_0x7c41('0x1c'))[_0x7c41('0x1d')]('value')[_0x7c41('0x1e')]();if(_[_0x7c41('0x1f')](_0xf27510,_0x18ae0d[_0x7c41('0x20')])){return;}var _0xec514d=_[_0x7c41('0x21')](_0x189088,['value',_0x18ae0d[_0x7c41('0x20')]])['name'];return db[_0x7c41('0x22')]['destroy']({'where':{'type':_0xec514d,'resourceId':_0x18ae0d['id']}})[_0x7c41('0x15')](function(){return _0x137e9b;});})['then'](function(){_0x4a4df6[_0x7c41('0xb')](0xcc)[_0x7c41('0xc')]();});}};}function handleEntityNotFound(_0x362c25){return function(_0x17862d){if(!_0x17862d){_0x362c25[_0x7c41('0x23')](0x194);}return _0x17862d;};}function handleError(_0x18b172,_0x2ca548){_0x2ca548=_0x2ca548||0x1f4;return function(_0x21075d){logger[_0x7c41('0x24')](_0x21075d[_0x7c41('0x25')]);if(_0x21075d['name']){delete _0x21075d['name'];}_0x18b172[_0x7c41('0xb')](_0x2ca548)['send'](_0x21075d);};}exports['index']=function(_0x55a0bf,_0x95c93c){var _0x5e74e6={},_0x75784a={},_0x53b34a={'count':0x0,'rows':[]};var _0x3d9a74=_[_0x7c41('0x1d')](db[_0x7c41('0x26')][_0x7c41('0x27')],function(_0x5bd386){return{'name':_0x5bd386[_0x7c41('0x28')],'type':_0x5bd386['type'][_0x7c41('0x29')]};});_0x75784a[_0x7c41('0x2a')]=_[_0x7c41('0x1d')](_0x3d9a74,_0x7c41('0x2b'));_0x75784a[_0x7c41('0x2c')]=_[_0x7c41('0x2d')](_0x55a0bf[_0x7c41('0x2c')]);_0x75784a['filters']=_['intersection'](_0x75784a[_0x7c41('0x2a')],_0x75784a['query']);_0x5e74e6['attributes']=_[_0x7c41('0x2e')](_0x75784a[_0x7c41('0x2a')],qs[_0x7c41('0x2f')](_0x55a0bf[_0x7c41('0x2c')][_0x7c41('0x2f')]));_0x5e74e6[_0x7c41('0x30')]=_0x5e74e6['attributes'][_0x7c41('0x31')]?_0x5e74e6['attributes']:_0x75784a['model'];if(!_0x55a0bf[_0x7c41('0x2c')][_0x7c41('0x32')](_0x7c41('0x33'))){_0x5e74e6['limit']=qs['limit'](_0x55a0bf[_0x7c41('0x2c')]['limit']);_0x5e74e6[_0x7c41('0xd')]=qs[_0x7c41('0xd')](_0x55a0bf['query'][_0x7c41('0xd')]);}_0x5e74e6[_0x7c41('0x34')]=qs[_0x7c41('0x35')](_0x55a0bf[_0x7c41('0x2c')]['sort']);_0x5e74e6[_0x7c41('0x36')]=qs[_0x7c41('0x37')](_['pick'](_0x55a0bf['query'],_0x75784a[_0x7c41('0x37')]),_0x3d9a74);if(_0x55a0bf['query'][_0x7c41('0x38')]){_0x5e74e6['where']=_['merge'](_0x5e74e6['where'],{'$or':_[_0x7c41('0x1d')](_0x3d9a74,function(_0x37b31c){if(_0x37b31c[_0x7c41('0x20')]!==_0x7c41('0x39')){var _0x12adbb={};_0x12adbb[_0x37b31c[_0x7c41('0x2b')]]={'$like':'%'+_0x55a0bf['query'][_0x7c41('0x38')]+'%'};return _0x12adbb;}})});}_0x5e74e6=_[_0x7c41('0x3a')]({},_0x5e74e6,_0x55a0bf[_0x7c41('0x3b')]);var _0x150ffe={'where':_0x5e74e6[_0x7c41('0x36')]};return db['VoiceExtension'][_0x7c41('0xf')](_0x150ffe)[_0x7c41('0x15')](function(_0x190f2b){_0x53b34a[_0x7c41('0xf')]=_0x190f2b;if(_0x55a0bf[_0x7c41('0x2c')][_0x7c41('0x3c')]){_0x5e74e6[_0x7c41('0x3d')]=[{'all':!![]}];}return db[_0x7c41('0x26')][_0x7c41('0x3e')](_0x5e74e6);})[_0x7c41('0x15')](function(_0x58911d){_0x53b34a[_0x7c41('0x3f')]=_0x58911d;return _0x53b34a;})[_0x7c41('0x15')](respondWithFilteredResult(_0x95c93c,_0x5e74e6))['catch'](handleError(_0x95c93c,null));};exports[_0x7c41('0x40')]=function(_0x5485de,_0x3a5416){var _0x4eb1f1={'raw':![],'where':{'id':_0x5485de[_0x7c41('0x41')]['id']}},_0x3da2a9={};_0x3da2a9[_0x7c41('0x2a')]=_[_0x7c41('0x2d')](db[_0x7c41('0x26')][_0x7c41('0x27')]);_0x3da2a9['query']=_['keys'](_0x5485de['query']);_0x3da2a9['filters']=_[_0x7c41('0x2e')](_0x3da2a9[_0x7c41('0x2a')],_0x3da2a9[_0x7c41('0x2c')]);_0x4eb1f1[_0x7c41('0x30')]=_['intersection'](_0x3da2a9['model'],qs[_0x7c41('0x2f')](_0x5485de['query'][_0x7c41('0x2f')]));_0x4eb1f1[_0x7c41('0x30')]=_0x4eb1f1[_0x7c41('0x30')][_0x7c41('0x31')]?_0x4eb1f1[_0x7c41('0x30')]:_0x3da2a9['model'];if(_0x5485de[_0x7c41('0x2c')]['includeAll']){_0x4eb1f1[_0x7c41('0x3d')]=[{'all':!![]}];}_0x4eb1f1=_['merge']({},_0x4eb1f1,_0x5485de[_0x7c41('0x3b')]);return db[_0x7c41('0x26')][_0x7c41('0x21')](_0x4eb1f1)[_0x7c41('0x15')](handleEntityNotFound(_0x3a5416,null))['then'](respondWithResult(_0x3a5416,null))['catch'](handleError(_0x3a5416,null));};exports[_0x7c41('0x14')]=function(_0xac8479,_0x59c302){return db['VoiceExtension'][_0x7c41('0x21')]({'where':{'id':_0xac8479[_0x7c41('0x41')]['id']}})['then'](handleEntityNotFound(_0x59c302,null))[_0x7c41('0x15')](removeEntity(_0x59c302,null))[_0x7c41('0x42')](handleError(_0x59c302,null));};exports['create']=function(_0x50c5bb,_0x4e7532){if(_0x50c5bb[_0x7c41('0x43')][_0x7c41('0x20')]==='outbound'&&!_[_0x7c41('0x44')](_0x50c5bb[_0x7c41('0x43')][_0x7c41('0x45')],'_')){_0x50c5bb[_0x7c41('0x43')][_0x7c41('0x45')]='_'[_0x7c41('0x46')](_0x50c5bb[_0x7c41('0x43')][_0x7c41('0x45')]);}return db[_0x7c41('0x26')]['create'](_0x50c5bb[_0x7c41('0x43')],{'raw':![]})[_0x7c41('0x15')](function(_0x3641c4){var _0x2558ac=_0x50c5bb[_0x7c41('0x47')]['get']({'plain':!![]});if(!_0x2558ac)throw new Error(_0x7c41('0x48'));if(_0x2558ac[_0x7c41('0x49')]===_0x7c41('0x47')){var _0x294690=_0x3641c4[_0x7c41('0x16')]({'plain':!![]});var _0xb84e12=[{'name':'InboundRoutes','value':_0x7c41('0x4a')},{'name':'OutboundRoutes','value':_0x7c41('0x19')},{'name':_0x7c41('0x1a'),'value':_0x7c41('0x1b')}];var _0x174927=_['find'](_0xb84e12,[_0x7c41('0x1e'),_0x294690[_0x7c41('0x20')]])[_0x7c41('0x2b')];return db[_0x7c41('0x4b')][_0x7c41('0x21')]({'where':{'name':_0x174927,'userProfileId':_0x2558ac[_0x7c41('0x4c')]},'raw':!![]})[_0x7c41('0x15')](function(_0x11f736){if(_0x11f736&&_0x11f736[_0x7c41('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x294690[_0x7c41('0x2b')],'resourceId':_0x294690['id'],'type':_0x11f736[_0x7c41('0x2b')],'sectionId':_0x11f736['id']},{})[_0x7c41('0x15')](function(){return _0x3641c4;});}else{return _0x3641c4;}})[_0x7c41('0x42')](function(_0x5b275b){logger['error'](_0x7c41('0x4e'),_0x5b275b);throw _0x5b275b;});}return _0x3641c4;})[_0x7c41('0x15')](respondWithResult(_0x4e7532,0xc9))[_0x7c41('0x42')](handleError(_0x4e7532,null));};exports[_0x7c41('0x4f')]=function(_0x957c34,_0x45780b){if(_0x957c34[_0x7c41('0x43')]['id']){delete _0x957c34[_0x7c41('0x43')]['id'];}return db['VoiceExtension'][_0x7c41('0x21')]({'where':{'id':_0x957c34[_0x7c41('0x41')]['id']}})[_0x7c41('0x15')](handleEntityNotFound(_0x45780b,null))[_0x7c41('0x15')](function(_0x3ace33){if(_0x3ace33){return db[_0x7c41('0x26')][_0x7c41('0x4f')](_[_0x7c41('0x50')](_0x957c34[_0x7c41('0x43')],[_0x7c41('0x45'),_0x7c41('0x51'),_0x7c41('0x52'),_0x7c41('0x53'),_0x7c41('0x54'),_0x7c41('0x55'),_0x7c41('0x56')]),{'where':{'context':_0x3ace33[_0x7c41('0x51')],'exten':_0x3ace33[_0x7c41('0x45')]},'individualHooks':!![]})['then'](function(_0xd1bdca){return _0xd1bdca;});}return null;})['then'](respondWithStatusCode(_0x45780b,null))[_0x7c41('0x42')](handleError(_0x45780b,null));};exports[_0x7c41('0x57')]=function(_0x30129a,_0x9327d4){var _0x4baa39=_0x30129a['params']['id'];var _0x219e5b=_0x30129a['body'];var _0x11fe81=0xc8;var _0x23e867=null;return db[_0x7c41('0x58')]['transaction']({'isolationLevel':db[_0x7c41('0x58')][_0x7c41('0x59')][_0x7c41('0x5a')][_0x7c41('0x5b')]},function(_0xfd5f9a){return db[_0x7c41('0x26')][_0x7c41('0x5c')]({'where':{'id':_0x4baa39},'transaction':_0xfd5f9a})['then'](function(_0x1bd8db){if(_0x1bd8db){return db['VoiceExtension'][_0x7c41('0x14')]({'where':{'VoiceExtensionId':_0x4baa39},'transaction':_0xfd5f9a})[_0x7c41('0x15')](function(){var _0x7adebd=_[_0x7c41('0x1d')](_0x219e5b,function(_0x540228){_0x540228[_0x7c41('0x5d')]=_0x4baa39;_0x540228[_0x7c41('0x5e')]=!![];return _0x540228;});return _0x1bd8db['createRouting'](_0x7adebd);})[_0x7c41('0x15')](function(_0x50e194){return db[_0x7c41('0x26')]['bulkCreate'](_0x50e194,{'transaction':_0xfd5f9a});});}else{_0x11fe81=0x194;_0x23e867=[];}});})[_0x7c41('0x15')](function(){if(_0x11fe81!==0x194){return db[_0x7c41('0x26')][_0x7c41('0x5f')]({'where':{'isApp':!![],'VoiceExtensionId':_0x4baa39},'order':_0x7c41('0x60')})['then'](function(_0x4acd26){_0x23e867=_0x4acd26;});}})['catch'](function(_0x39419a){_0x11fe81=0x1f4;logger[_0x7c41('0x24')](_0x39419a['stack']);if(_0x39419a[_0x7c41('0x2b')]){delete _0x39419a[_0x7c41('0x2b')];}_0x23e867=_0x39419a;})['finally'](function(){if(_0x23e867===null){_0x9327d4['sendStatus'](_0x11fe81);}else{if(_0x11fe81===0x1f4){_0x9327d4[_0x7c41('0xb')](_0x11fe81)['send'](_0x23e867);}else{_0x9327d4['status'](_0x11fe81)[_0x7c41('0x13')](_0x23e867);}}});};
\ No newline at end of file
index 8ae2f5b..043051b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x06b7=['emit','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x37e058,_0x1ffd4e){var _0x30f2f1=function(_0xd76e6e){while(--_0xd76e6e){_0x37e058['push'](_0x37e058['shift']());}};_0x30f2f1(++_0x1ffd4e);}(_0x06b7,0x14d));var _0x706b=function(_0x2ae6a5,_0x4410bb){_0x2ae6a5=_0x2ae6a5-0x0;var _0x58076e=_0x06b7[_0x2ae6a5];return _0x58076e;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x706b('0x0'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x706b('0x1')](0x0);var events={'afterCreate':_0x706b('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x21448e){return function(_0x485129,_0x4b39a5,_0x3c1c2d){VoiceExtensionEvents[_0x706b('0x3')](_0x21448e+':'+_0x485129['id'],_0x485129);VoiceExtensionEvents[_0x706b('0x3')](_0x21448e,_0x485129);_0x3c1c2d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x706b('0x4')](e,emitEvent(event));}}module[_0x706b('0x5')]=VoiceExtensionEvents;
\ No newline at end of file
+var _0xfb34=['remove','emit','hasOwnProperty','hook','setMaxListeners','save','update'];(function(_0x4eeb1c,_0x513074){var _0x3070c9=function(_0x1c473a){while(--_0x1c473a){_0x4eeb1c['push'](_0x4eeb1c['shift']());}};_0x3070c9(++_0x513074);}(_0xfb34,0x1af));var _0x4fb3=function(_0x189305,_0x46c43f){_0x189305=_0x189305-0x0;var _0xea3406=_0xfb34[_0x189305];return _0xea3406;};'use strict';var EventEmitter=require('events');var VoiceExtension=require('../../mysqldb')['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x4fb3('0x0')](0x0);var events={'afterCreate':_0x4fb3('0x1'),'afterUpdate':_0x4fb3('0x2'),'afterDestroy':_0x4fb3('0x3')};function emitEvent(_0xf70022){return function(_0x31ab06,_0x326b28,_0x227a74){VoiceExtensionEvents['emit'](_0xf70022+':'+_0x31ab06['id'],_0x31ab06);VoiceExtensionEvents[_0x4fb3('0x4')](_0xf70022,_0x31ab06);_0x227a74(null);};}for(var e in events){if(events[_0x4fb3('0x5')](e)){var event=events[e];VoiceExtension[_0x4fb3('0x6')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents;
\ No newline at end of file
index a650ff7..5781bc0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb1dc=['trunk','timeout','options','url','split','name','param','prefix','phone','SIP','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','IntervalId','then','length','*,*,*,*','intervals','map','filter','toLowerCase','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','includes','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','concat','last','catch','define','VoiceExtension','voice_extensions','get','Hangup','./voiceExtension.attributes','models','type','Set','CDR(type)=','context','NoOp','alias','CDR(routeAlias)=','No\x20alias\x20set','exten','push','inbound','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','cutdigits','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT='];(function(_0x2c0d8d,_0x51113c){var _0x4f6fea=function(_0x38c52a){while(--_0x38c52a){_0x2c0d8d['push'](_0x2c0d8d['shift']());}};_0x4f6fea(++_0x51113c);}(_0xb1dc,0x133));var _0xcb1d=function(_0x5a6961,_0xd41ca6){_0x5a6961=_0x5a6961-0x0;var _0x4af0a6=_0xb1dc[_0x5a6961];return _0x4af0a6;};'use strict';var _=require('lodash');var attributes=require(_0xcb1d('0x0'));module['exports']=function(_0x4539c5){var _0x2c4c8f=_0x4539c5[_0xcb1d('0x1')];function _0x37abc3(_0x11d8dc){var _0xc3e297=0x2;var _0x1028de=[{'type':_0x11d8dc[_0xcb1d('0x2')],'app':_0xcb1d('0x3'),'appdata':_0xcb1d('0x4')+_0x11d8dc[_0xcb1d('0x2')],'context':_0x11d8dc[_0xcb1d('0x5')],'exten':_0x11d8dc['exten'],'priority':_0xc3e297++,'VoiceExtensionId':_0x11d8dc['id']},{'type':_0x11d8dc[_0xcb1d('0x2')],'app':_0x11d8dc['alias']?_0xcb1d('0x3'):_0xcb1d('0x6'),'appdata':_0x11d8dc[_0xcb1d('0x7')]?_0xcb1d('0x8')+_0x11d8dc[_0xcb1d('0x7')]:_0xcb1d('0x9'),'context':_0x11d8dc[_0xcb1d('0x5')],'exten':_0x11d8dc[_0xcb1d('0xa')],'priority':_0xc3e297++,'VoiceExtensionId':_0x11d8dc['id']}];if(_0x11d8dc[_0xcb1d('0x2')]==='inbound'){_0x1028de[_0xcb1d('0xb')]({'type':_0xcb1d('0xc'),'app':_0xcb1d('0x3'),'appdata':'CDR(routeid)='+_0x11d8dc['id'],'context':_0x11d8dc['context'],'exten':_0x11d8dc[_0xcb1d('0xa')],'priority':_0xc3e297++,'VoiceExtensionId':_0x11d8dc['id']});}_0x1028de['push']({'type':_0x11d8dc[_0xcb1d('0x2')],'app':_0xcb1d('0x3'),'appdata':_0xcb1d('0xd'),'context':_0x11d8dc[_0xcb1d('0x5')],'exten':_0x11d8dc['exten'],'priority':_0xc3e297++,'VoiceExtensionId':_0x11d8dc['id']},{'type':_0x11d8dc[_0xcb1d('0x2')],'app':'Set','appdata':_0xcb1d('0xe'),'context':_0x11d8dc['context'],'exten':_0x11d8dc[_0xcb1d('0xa')],'priority':_0xc3e297++,'VoiceExtensionId':_0x11d8dc['id']},{'type':_0x11d8dc[_0xcb1d('0x2')],'app':_0xcb1d('0x3'),'appdata':_0xcb1d('0xf'),'context':_0x11d8dc[_0xcb1d('0x5')],'exten':_0x11d8dc[_0xcb1d('0xa')],'priority':_0xc3e297++,'VoiceExtensionId':_0x11d8dc['id']});return _0x1028de;}function _0x195964(_0x49c8ea){var _0x160e56=0x2;var _0x4edb37=[{'type':_0xcb1d('0x10'),'app':'Set','appdata':_0xcb1d('0x11'),'context':_0x49c8ea[_0xcb1d('0x5')],'exten':_0x49c8ea[_0xcb1d('0xa')],'priority':_0x160e56++,'VoiceExtensionId':_0x49c8ea['id']},{'type':_0xcb1d('0x10'),'app':_0x49c8ea['alias']?_0xcb1d('0x3'):'NoOp','appdata':_0x49c8ea[_0xcb1d('0x7')]?_0xcb1d('0x8')+_0x49c8ea[_0xcb1d('0x7')]:_0xcb1d('0x9'),'context':_0x49c8ea[_0xcb1d('0x5')],'exten':_0x49c8ea[_0xcb1d('0xa')],'priority':_0x160e56++,'VoiceExtensionId':_0x49c8ea['id']},{'type':'outbound','app':_0xcb1d('0x3'),'appdata':_0xcb1d('0x12')+(_0x49c8ea['cutdigits']?_0xcb1d('0x13')+_0x49c8ea['cutdigits']+'}':_0xcb1d('0x14')),'context':_0x49c8ea[_0xcb1d('0x5')],'exten':_0x49c8ea['exten'],'priority':_0x160e56++,'VoiceExtensionId':_0x49c8ea['id']},{'type':'outbound','app':_0xcb1d('0x3'),'appdata':_0xcb1d('0x15')+_0x49c8ea['id'],'context':_0x49c8ea[_0xcb1d('0x5')],'exten':_0x49c8ea[_0xcb1d('0xa')],'priority':_0x160e56++,'VoiceExtensionId':_0x49c8ea['id']},{'type':_0xcb1d('0x10'),'app':_0xcb1d('0x16'),'appdata':_0xcb1d('0x17')+(_0x160e56+0x2)+_0xcb1d('0x18')+(_0x160e56+0x1)+')','context':_0x49c8ea['context'],'exten':_0x49c8ea['exten'],'priority':_0x160e56++,'VoiceExtensionId':_0x49c8ea['id']},{'type':'outbound','app':_0xcb1d('0x3'),'appdata':_0x49c8ea[_0xcb1d('0x19')]?_0xcb1d('0x1a')+_0x49c8ea[_0xcb1d('0x19')]+'}':_0xcb1d('0x1b'),'context':_0x49c8ea[_0xcb1d('0x5')],'exten':_0x49c8ea['exten'],'priority':_0x160e56++,'VoiceExtensionId':_0x49c8ea['id']},{'type':_0xcb1d('0x10'),'app':_0xcb1d('0x3'),'appdata':_0xcb1d('0xd'),'context':_0x49c8ea['context'],'exten':_0x49c8ea[_0xcb1d('0xa')],'priority':_0x160e56++,'VoiceExtensionId':_0x49c8ea['id']},{'type':_0xcb1d('0x10'),'app':_0xcb1d('0x3'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x49c8ea[_0xcb1d('0x5')],'exten':_0x49c8ea[_0xcb1d('0xa')],'priority':_0x160e56++,'VoiceExtensionId':_0x49c8ea['id']},{'type':_0xcb1d('0x10'),'app':_0xcb1d('0x3'),'appdata':_0xcb1d('0xf'),'context':_0x49c8ea['context'],'exten':_0x49c8ea[_0xcb1d('0xa')],'priority':_0x160e56++,'VoiceExtensionId':_0x49c8ea['id']},{'type':_0xcb1d('0x10'),'app':'Set','appdata':_0xcb1d('0x1c')+_0x49c8ea['id'],'context':_0x49c8ea[_0xcb1d('0x5')],'exten':_0x49c8ea[_0xcb1d('0xa')],'priority':_0x160e56++,'VoiceExtensionId':_0x49c8ea['id']}];if(_0x49c8ea[_0xcb1d('0x1d')](_0xcb1d('0x1e'))&&_0x49c8ea['recordingFormat']!==_0xcb1d('0x1f')){_0x4edb37['push']({'type':_0xcb1d('0x10'),'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x49c8ea[_0xcb1d('0x5')],'exten':_0x49c8ea[_0xcb1d('0xa')],'priority':_0x160e56++,'VoiceExtensionId':_0x49c8ea['id']},{'type':'outbound','app':_0xcb1d('0x3'),'appdata':_0xcb1d('0x20')+_0x49c8ea[_0xcb1d('0x1e')]||'wav','context':_0x49c8ea[_0xcb1d('0x5')],'exten':_0x49c8ea[_0xcb1d('0xa')],'priority':_0x160e56++,'VoiceExtensionId':_0x49c8ea['id']});}return _0x4edb37;}function _0x26cb31(_0x28718b,_0x4b1106){var _0x33b05d=[{'name':_0xcb1d('0x21'),'param':0x0},{'name':_0xcb1d('0x22'),'param':0x1},{'name':_0xcb1d('0x23'),'param':0x2},{'name':_0xcb1d('0x24'),'param':0x3}];var _0x27857c={};var _0x2cea93=_0x4b1106[_0xcb1d('0x25')](',');var _0x3fd35b=[];for(var _0x5f5c3d=0x0;_0x5f5c3d<_0x33b05d['length'];_0x5f5c3d++){switch(_0x33b05d[_0x5f5c3d][_0xcb1d('0x26')]){case _0xcb1d('0x21'):_0x27857c[_0xcb1d('0x21')]=_0x2cea93[_0x33b05d[_0x5f5c3d][_0xcb1d('0x27')]][_0xcb1d('0x25')]('/')[0x1];_0x27857c['phone']=_0x2cea93[_0x33b05d[_0x5f5c3d][_0xcb1d('0x27')]]['split']('/')[0x2];_0x27857c[_0xcb1d('0x28')]=_0x27857c[_0xcb1d('0x29')]?_0x27857c[_0xcb1d('0x29')][_0xcb1d('0x25')]('$')[0x0]:undefined;_0x27857c[_0xcb1d('0x29')]=_0x28718b['cutdigits']?(_0x27857c['prefix']||'')+'${EXTEN:'+_0x28718b[_0xcb1d('0x19')]+'}':(_0x27857c[_0xcb1d('0x28')]||'')+_0xcb1d('0x14');_0x3fd35b[_0x33b05d[_0x5f5c3d][_0xcb1d('0x27')]]=[_0xcb1d('0x2a'),_0x27857c[_0xcb1d('0x21')],_0x27857c[_0xcb1d('0x29')]][_0xcb1d('0x2b')]('/');break;case _0xcb1d('0x23'):_0x27857c[_0xcb1d('0x23')]=_0x2cea93[_0x33b05d[_0x5f5c3d][_0xcb1d('0x27')]];if(_0x28718b[_0xcb1d('0x1e')]!==_0xcb1d('0x1f')){if(_0x27857c['options'][_0xcb1d('0x2c')]('U(xcally-mixmonitor-context)')<0x0){_0x27857c[_0xcb1d('0x23')]+=_0xcb1d('0x2d');}}else{_0x27857c[_0xcb1d('0x23')]=_0x27857c[_0xcb1d('0x23')][_0xcb1d('0x2e')](_0xcb1d('0x2d'),'');}_0x3fd35b[_0x33b05d[_0x5f5c3d][_0xcb1d('0x27')]]=_0x27857c[_0xcb1d('0x23')];break;default:_0x3fd35b[_0x33b05d[_0x5f5c3d]['param']]=_0x2cea93[_0x33b05d[_0x5f5c3d][_0xcb1d('0x27')]];}}return _0x3fd35b['join'](',');}function _0x5e3cb4(_0x41b7fe,_0x356d65,_0x2845d3){return new Promise(function(_0x1e9378,_0x4430c5){var _0x507852=[];if(_[_0xcb1d('0x2f')](_0x356d65))return _0x1e9378(_0x507852);_0x2c4c8f[_0xcb1d('0x30')][_0xcb1d('0x31')]({'attributes':['id',_0xcb1d('0x32'),_0xcb1d('0x33')],'raw':!![]})[_0xcb1d('0x34')](function(_0x3bd300){for(var _0x1e4837=0x0,_0x2907b2=0x0;_0x1e4837<_0x356d65[_0xcb1d('0x35')];_0x1e4837++,_0x2907b2=0x0){var _0x1bf846=_0x356d65[_0x1e4837];var _0x492547=[];var _0x5a8ba5=[];delete _0x1bf846['id'];if(_0x1bf846[_0xcb1d('0x32')]!==_0xcb1d('0x36')){_0x1bf846[_0xcb1d('0x37')]=[_0x1bf846[_0xcb1d('0x32')]];}else{_0x1bf846[_0xcb1d('0x37')]=_0x1bf846[_0xcb1d('0x33')]?_[_0xcb1d('0x38')](_[_0xcb1d('0x39')](_0x3bd300,{'IntervalId':_0x1bf846['IntervalId']}),_0xcb1d('0x32')):[];}_0x1bf846['context']=_0x41b7fe[_0xcb1d('0x5')];_0x1bf846[_0xcb1d('0xa')]=_0x41b7fe[_0xcb1d('0xa')];if(_0x1bf846[_0xcb1d('0x2')])_0x1bf846['type']=_0x1bf846[_0xcb1d('0x2')][_0xcb1d('0x3a')]();if(_0x41b7fe[_0xcb1d('0x2')]===_0xcb1d('0x10')){if(_0x1bf846[_0xcb1d('0x1d')]('tag')&&_0x1bf846['tag']&&_0x1bf846['tag']!=='--'){_0x492547['push']({'type':_0x1bf846[_0xcb1d('0x2')][_0xcb1d('0x3a')](),'app':_0xcb1d('0x3'),'appdata':'CDR(tag)='+_0x1bf846['tag'],'context':_0x41b7fe[_0xcb1d('0x5')],'exten':_0x41b7fe[_0xcb1d('0xa')],'priority':_0x1bf846[_0xcb1d('0x37')][_0xcb1d('0x35')]+_0x2845d3+_0x2907b2++,'VoiceExtensionId':_0x41b7fe['id']});}_0x492547[_0xcb1d('0xb')]({'type':_0x1bf846['type'][_0xcb1d('0x3a')](),'app':_0xcb1d('0x16'),'appdata':_0xcb1d('0x3b')+(_0x1bf846[_0xcb1d('0x3c')]?_0xcb1d('0x3d')+_0x1bf846[_0xcb1d('0x3c')]+')':_0xcb1d('0x3e')),'context':_0x41b7fe[_0xcb1d('0x5')],'exten':_0x41b7fe['exten'],'priority':_0x1bf846[_0xcb1d('0x37')]['length']+_0x2845d3+_0x2907b2++,'VoiceExtensionId':_0x41b7fe['id']});}else{if(_0x1bf846[_0xcb1d('0x1d')](_0xcb1d('0x3f'))){if(['queue','playback'][_0xcb1d('0x40')](_0x1bf846[_0xcb1d('0x41')]['toLowerCase']())&&_0x1bf846[_0xcb1d('0x42')]!=='custom'){if(_0x1bf846['answer']){_0x492547[_0xcb1d('0xb')]({'type':_0x1bf846[_0xcb1d('0x2')][_0xcb1d('0x3a')](),'app':_0xcb1d('0x16'),'appdata':_0xcb1d('0x43'),'context':_0x41b7fe[_0xcb1d('0x5')],'exten':_0x41b7fe[_0xcb1d('0xa')],'priority':_0x1bf846[_0xcb1d('0x37')][_0xcb1d('0x35')]+_0x2845d3+_0x2907b2++,'VoiceExtensionId':_0x41b7fe['id']});_0x492547[_0xcb1d('0xb')]({'type':_0x1bf846[_0xcb1d('0x2')][_0xcb1d('0x3a')](),'app':_0xcb1d('0x3'),'appdata':_0xcb1d('0x44'),'context':_0x41b7fe[_0xcb1d('0x5')],'exten':_0x41b7fe[_0xcb1d('0xa')],'priority':_0x1bf846[_0xcb1d('0x37')][_0xcb1d('0x35')]+_0x2845d3+_0x2907b2++,'VoiceExtensionId':_0x41b7fe['id']});}else{_0x492547['push']({'type':_0x1bf846[_0xcb1d('0x2')][_0xcb1d('0x3a')](),'app':_0xcb1d('0x16'),'appdata':_0xcb1d('0x45'),'context':_0x41b7fe[_0xcb1d('0x5')],'exten':_0x41b7fe[_0xcb1d('0xa')],'priority':_0x1bf846[_0xcb1d('0x37')]['length']+_0x2845d3+_0x2907b2++,'VoiceExtensionId':_0x41b7fe['id']});_0x492547['push']({'type':_0x1bf846[_0xcb1d('0x2')][_0xcb1d('0x3a')](),'app':_0xcb1d('0x3'),'appdata':_0xcb1d('0x46'),'context':_0x41b7fe[_0xcb1d('0x5')],'exten':_0x41b7fe[_0xcb1d('0xa')],'priority':_0x1bf846[_0xcb1d('0x37')][_0xcb1d('0x35')]+_0x2845d3+_0x2907b2++,'VoiceExtensionId':_0x41b7fe['id']});}}}}for(var _0x1ec158=0x0;_0x1ec158<_0x1bf846['intervals'][_0xcb1d('0x35')];_0x1ec158++){var _0x213277=_0x2845d3+_0x1bf846['intervals']['length'];var _0x2d3f43=_0x1ec158===_0x1bf846[_0xcb1d('0x37')][_0xcb1d('0x35')]-0x1?_0x2845d3+_0x492547['length']+_0x5a8ba5[_0xcb1d('0x35')]+0x2:_0x2845d3+_0x1ec158+0x1;_0x492547[_0xcb1d('0x47')](_0x1ec158,0x0,{'type':_0x41b7fe[_0xcb1d('0x2')],'app':_0xcb1d('0x48'),'appdata':_0x1bf846[_0xcb1d('0x37')][_0x1ec158]+'?'+_0x41b7fe[_0xcb1d('0x5')]+',${EXTEN},'+_0x213277+':'+_0x41b7fe[_0xcb1d('0x5')]+_0xcb1d('0x49')+_0x2d3f43,'exten':_0x41b7fe[_0xcb1d('0xa')],'context':_0x41b7fe[_0xcb1d('0x5')],'priority':_0x2845d3+_0x1ec158,'VoiceExtensionId':_0x41b7fe['id']});}if(_0x1bf846[_0xcb1d('0x42')]===_0xcb1d('0x4a'))_0x1bf846[_0xcb1d('0x4b')]=_0x26cb31(_0x41b7fe,_0x1bf846['appdata']);_0x1bf846[_0xcb1d('0x4c')]=_0x492547[_0xcb1d('0x35')]?_['last'](_0x492547)[_0xcb1d('0x4c')]+0x1:_0x2845d3;_0x507852=_[_0xcb1d('0x4d')](_0x507852,_0x492547,[_0x1bf846],_0x5a8ba5);_0x2845d3=_[_0xcb1d('0x4e')](_0x507852)[_0xcb1d('0x4c')]+0x1;}return _0x1e9378(_0x507852);})[_0xcb1d('0x4f')](function(_0x2b248c){_0x4430c5(_0x2b248c);});});}return _0x4539c5[_0xcb1d('0x50')](_0xcb1d('0x51'),attributes,{'tableName':_0xcb1d('0x52'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x128da5){var _0x4c7aff=this[_0xcb1d('0x53')]({'plain':!![]});var _0x212ada=_0x4c7aff[_0xcb1d('0x2')]==='outbound'?_0x195964(_0x4c7aff):_0x37abc3(_0x4c7aff);return _0x5e3cb4(_0x4c7aff,_0x128da5,_['last'](_0x212ada)['priority']+0x1)[_0xcb1d('0x34')](function(_0xf532ec){var _0x27e2d1=_[_0xcb1d('0x4d')](_0x212ada,_0xf532ec);_0x27e2d1[_0xcb1d('0xb')]({'type':_0x4c7aff[_0xcb1d('0x2')],'app':_0xcb1d('0x54'),'exten':_0x4c7aff['exten'],'context':_0x4c7aff[_0xcb1d('0x5')],'priority':_[_0xcb1d('0x4e')](_0x27e2d1)['priority']+0x1,'VoiceExtensionId':_0x4c7aff['id']});return _0x27e2d1;});}}});};
\ No newline at end of file
+var _0xf13b=['Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','playback','includes','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime','appdata','last','priority','concat','catch','define','voice_extensions','get','Hangup','lodash','models','type','Set','context','alias','NoOp','CDR(routeAlias)=','push','inbound','CDR(routeid)=','exten','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','No\x20alias\x20set','${EXTEN:','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-PROGRESS=0','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','timeout','options','split','length','name','trunk','param','phone','prefix','join','indexOf','U(xcally-mixmonitor-context)','Interval','findAll','IntervalId','then','interval','intervals','map','filter','toLowerCase','hasOwnProperty','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0xf13b,0x1f0));var _0xbf13=function(_0x3290fa,_0x402648){_0x3290fa=_0x3290fa-0x0;var _0x18e2e5=_0xf13b[_0x3290fa];return _0x18e2e5;};'use strict';var _=require(_0xbf13('0x0'));var attributes=require('./voiceExtension.attributes');module['exports']=function(_0x495034){var _0x347ba8=_0x495034[_0xbf13('0x1')];function _0x20a031(_0x1a2791){var _0x4bb133=0x2;var _0x58ec26=[{'type':_0x1a2791[_0xbf13('0x2')],'app':_0xbf13('0x3'),'appdata':'CDR(type)='+_0x1a2791[_0xbf13('0x2')],'context':_0x1a2791[_0xbf13('0x4')],'exten':_0x1a2791['exten'],'priority':_0x4bb133++,'VoiceExtensionId':_0x1a2791['id']},{'type':_0x1a2791[_0xbf13('0x2')],'app':_0x1a2791[_0xbf13('0x5')]?'Set':_0xbf13('0x6'),'appdata':_0x1a2791[_0xbf13('0x5')]?_0xbf13('0x7')+_0x1a2791[_0xbf13('0x5')]:'No\x20alias\x20set','context':_0x1a2791[_0xbf13('0x4')],'exten':_0x1a2791['exten'],'priority':_0x4bb133++,'VoiceExtensionId':_0x1a2791['id']}];if(_0x1a2791[_0xbf13('0x2')]==='inbound'){_0x58ec26[_0xbf13('0x8')]({'type':_0xbf13('0x9'),'app':'Set','appdata':_0xbf13('0xa')+_0x1a2791['id'],'context':_0x1a2791[_0xbf13('0x4')],'exten':_0x1a2791[_0xbf13('0xb')],'priority':_0x4bb133++,'VoiceExtensionId':_0x1a2791['id']});}_0x58ec26[_0xbf13('0x8')]({'type':_0x1a2791['type'],'app':_0xbf13('0x3'),'appdata':_0xbf13('0xc'),'context':_0x1a2791[_0xbf13('0x4')],'exten':_0x1a2791[_0xbf13('0xb')],'priority':_0x4bb133++,'VoiceExtensionId':_0x1a2791['id']},{'type':_0x1a2791['type'],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x1a2791[_0xbf13('0x4')],'exten':_0x1a2791[_0xbf13('0xb')],'priority':_0x4bb133++,'VoiceExtensionId':_0x1a2791['id']},{'type':_0x1a2791[_0xbf13('0x2')],'app':_0xbf13('0x3'),'appdata':_0xbf13('0xd'),'context':_0x1a2791[_0xbf13('0x4')],'exten':_0x1a2791[_0xbf13('0xb')],'priority':_0x4bb133++,'VoiceExtensionId':_0x1a2791['id']});return _0x58ec26;}function _0x268013(_0x57fb0a){var _0xa296f0=0x2;var _0x528d3c=[{'type':_0xbf13('0xe'),'app':_0xbf13('0x3'),'appdata':_0xbf13('0xf'),'context':_0x57fb0a[_0xbf13('0x4')],'exten':_0x57fb0a['exten'],'priority':_0xa296f0++,'VoiceExtensionId':_0x57fb0a['id']},{'type':'outbound','app':_0x57fb0a[_0xbf13('0x5')]?_0xbf13('0x3'):_0xbf13('0x6'),'appdata':_0x57fb0a[_0xbf13('0x5')]?'CDR(routeAlias)='+_0x57fb0a['alias']:_0xbf13('0x10'),'context':_0x57fb0a[_0xbf13('0x4')],'exten':_0x57fb0a[_0xbf13('0xb')],'priority':_0xa296f0++,'VoiceExtensionId':_0x57fb0a['id']},{'type':'outbound','app':_0xbf13('0x3'),'appdata':'CDR(destination)='+(_0x57fb0a['cutdigits']?_0xbf13('0x11')+_0x57fb0a[_0xbf13('0x12')]+'}':_0xbf13('0x13')),'context':_0x57fb0a[_0xbf13('0x4')],'exten':_0x57fb0a[_0xbf13('0xb')],'priority':_0xa296f0++,'VoiceExtensionId':_0x57fb0a['id']},{'type':_0xbf13('0xe'),'app':_0xbf13('0x3'),'appdata':_0xbf13('0xa')+_0x57fb0a['id'],'context':_0x57fb0a[_0xbf13('0x4')],'exten':_0x57fb0a['exten'],'priority':_0xa296f0++,'VoiceExtensionId':_0x57fb0a['id']},{'type':_0xbf13('0xe'),'app':_0xbf13('0x14'),'appdata':_0xbf13('0x15')+(_0xa296f0+0x2)+_0xbf13('0x16')+(_0xa296f0+0x1)+')','context':_0x57fb0a[_0xbf13('0x4')],'exten':_0x57fb0a[_0xbf13('0xb')],'priority':_0xa296f0++,'VoiceExtensionId':_0x57fb0a['id']},{'type':_0xbf13('0xe'),'app':'Set','appdata':_0x57fb0a[_0xbf13('0x12')]?_0xbf13('0x17')+_0x57fb0a[_0xbf13('0x12')]+'}':_0xbf13('0x18'),'context':_0x57fb0a[_0xbf13('0x4')],'exten':_0x57fb0a[_0xbf13('0xb')],'priority':_0xa296f0++,'VoiceExtensionId':_0x57fb0a['id']},{'type':'outbound','app':_0xbf13('0x3'),'appdata':_0xbf13('0xc'),'context':_0x57fb0a['context'],'exten':_0x57fb0a['exten'],'priority':_0xa296f0++,'VoiceExtensionId':_0x57fb0a['id']},{'type':_0xbf13('0xe'),'app':_0xbf13('0x3'),'appdata':_0xbf13('0x19'),'context':_0x57fb0a['context'],'exten':_0x57fb0a[_0xbf13('0xb')],'priority':_0xa296f0++,'VoiceExtensionId':_0x57fb0a['id']},{'type':_0xbf13('0xe'),'app':_0xbf13('0x3'),'appdata':_0xbf13('0xd'),'context':_0x57fb0a[_0xbf13('0x4')],'exten':_0x57fb0a[_0xbf13('0xb')],'priority':_0xa296f0++,'VoiceExtensionId':_0x57fb0a['id']},{'type':_0xbf13('0xe'),'app':'Set','appdata':'outboundrouteid='+_0x57fb0a['id'],'context':_0x57fb0a[_0xbf13('0x4')],'exten':_0x57fb0a[_0xbf13('0xb')],'priority':_0xa296f0++,'VoiceExtensionId':_0x57fb0a['id']}];if(_0x57fb0a['hasOwnProperty']('recordingFormat')&&_0x57fb0a[_0xbf13('0x1a')]!==_0xbf13('0x1b')){_0x528d3c[_0xbf13('0x8')]({'type':_0xbf13('0xe'),'app':_0xbf13('0x3'),'appdata':_0xbf13('0x1c'),'context':_0x57fb0a[_0xbf13('0x4')],'exten':_0x57fb0a[_0xbf13('0xb')],'priority':_0xa296f0++,'VoiceExtensionId':_0x57fb0a['id']},{'type':'outbound','app':_0xbf13('0x3'),'appdata':_0xbf13('0x1d')+_0x57fb0a['recordingFormat']||_0xbf13('0x1e'),'context':_0x57fb0a[_0xbf13('0x4')],'exten':_0x57fb0a[_0xbf13('0xb')],'priority':_0xa296f0++,'VoiceExtensionId':_0x57fb0a['id']});}return _0x528d3c;}function _0x5d5a33(_0x49216d,_0x561bd1){var _0x23cd20=[{'name':'trunk','param':0x0},{'name':_0xbf13('0x1f'),'param':0x1},{'name':_0xbf13('0x20'),'param':0x2},{'name':'url','param':0x3}];var _0x37a529={};var _0x2913e5=_0x561bd1[_0xbf13('0x21')](',');var _0xd1dd0c=[];for(var _0x32a651=0x0;_0x32a651<_0x23cd20[_0xbf13('0x22')];_0x32a651++){switch(_0x23cd20[_0x32a651][_0xbf13('0x23')]){case _0xbf13('0x24'):_0x37a529[_0xbf13('0x24')]=_0x2913e5[_0x23cd20[_0x32a651][_0xbf13('0x25')]]['split']('/')[0x1];_0x37a529[_0xbf13('0x26')]=_0x2913e5[_0x23cd20[_0x32a651][_0xbf13('0x25')]][_0xbf13('0x21')]('/')[0x2];_0x37a529[_0xbf13('0x27')]=_0x37a529[_0xbf13('0x26')]?_0x37a529[_0xbf13('0x26')][_0xbf13('0x21')]('$')[0x0]:undefined;_0x37a529[_0xbf13('0x26')]=_0x49216d[_0xbf13('0x12')]?(_0x37a529[_0xbf13('0x27')]||'')+_0xbf13('0x11')+_0x49216d['cutdigits']+'}':(_0x37a529[_0xbf13('0x27')]||'')+_0xbf13('0x13');_0xd1dd0c[_0x23cd20[_0x32a651][_0xbf13('0x25')]]=['SIP',_0x37a529[_0xbf13('0x24')],_0x37a529[_0xbf13('0x26')]][_0xbf13('0x28')]('/');break;case _0xbf13('0x20'):_0x37a529[_0xbf13('0x20')]=_0x2913e5[_0x23cd20[_0x32a651][_0xbf13('0x25')]];if(_0x49216d['recordingFormat']!=='none'){if(_0x37a529[_0xbf13('0x20')][_0xbf13('0x29')]('U(xcally-mixmonitor-context)')<0x0){_0x37a529[_0xbf13('0x20')]+=_0xbf13('0x2a');}}else{_0x37a529[_0xbf13('0x20')]=_0x37a529[_0xbf13('0x20')]['replace'](_0xbf13('0x2a'),'');}_0xd1dd0c[_0x23cd20[_0x32a651][_0xbf13('0x25')]]=_0x37a529['options'];break;default:_0xd1dd0c[_0x23cd20[_0x32a651][_0xbf13('0x25')]]=_0x2913e5[_0x23cd20[_0x32a651][_0xbf13('0x25')]];}}return _0xd1dd0c[_0xbf13('0x28')](',');}function _0x4ac22e(_0x582933,_0x5de08c,_0x3de418){return new Promise(function(_0x30b3e8,_0x2dc455){var _0x20ac1e=[];if(_['isEmpty'](_0x5de08c))return _0x30b3e8(_0x20ac1e);_0x347ba8[_0xbf13('0x2b')][_0xbf13('0x2c')]({'attributes':['id','interval',_0xbf13('0x2d')],'raw':!![]})[_0xbf13('0x2e')](function(_0x177b98){for(var _0x104ec4=0x0,_0x39d665=0x0;_0x104ec4<_0x5de08c['length'];_0x104ec4++,_0x39d665=0x0){var _0x4f7c77=_0x5de08c[_0x104ec4];var _0x54e2bc=[];var _0x1384ae=[];delete _0x4f7c77['id'];if(_0x4f7c77[_0xbf13('0x2f')]!=='*,*,*,*'){_0x4f7c77['intervals']=[_0x4f7c77['interval']];}else{_0x4f7c77[_0xbf13('0x30')]=_0x4f7c77[_0xbf13('0x2d')]?_[_0xbf13('0x31')](_[_0xbf13('0x32')](_0x177b98,{'IntervalId':_0x4f7c77[_0xbf13('0x2d')]}),_0xbf13('0x2f')):[];}_0x4f7c77[_0xbf13('0x4')]=_0x582933['context'];_0x4f7c77[_0xbf13('0xb')]=_0x582933[_0xbf13('0xb')];if(_0x4f7c77[_0xbf13('0x2')])_0x4f7c77[_0xbf13('0x2')]=_0x4f7c77[_0xbf13('0x2')][_0xbf13('0x33')]();if(_0x582933['type']===_0xbf13('0xe')){if(_0x4f7c77[_0xbf13('0x34')](_0xbf13('0x35'))&&_0x4f7c77[_0xbf13('0x35')]&&_0x4f7c77[_0xbf13('0x35')]!=='--'){_0x54e2bc[_0xbf13('0x8')]({'type':_0x4f7c77[_0xbf13('0x2')][_0xbf13('0x33')](),'app':'Set','appdata':_0xbf13('0x36')+_0x4f7c77[_0xbf13('0x35')],'context':_0x582933[_0xbf13('0x4')],'exten':_0x582933[_0xbf13('0xb')],'priority':_0x4f7c77[_0xbf13('0x30')][_0xbf13('0x22')]+_0x3de418+_0x39d665++,'VoiceExtensionId':_0x582933['id']});}_0x54e2bc[_0xbf13('0x8')]({'type':_0x4f7c77['type'][_0xbf13('0x33')](),'app':_0xbf13('0x14'),'appdata':_0xbf13('0x37')+(_0x4f7c77[_0xbf13('0x38')]?_0xbf13('0x39')+_0x4f7c77[_0xbf13('0x38')]+')':_0xbf13('0x3a')),'context':_0x582933[_0xbf13('0x4')],'exten':_0x582933[_0xbf13('0xb')],'priority':_0x4f7c77[_0xbf13('0x30')][_0xbf13('0x22')]+_0x3de418+_0x39d665++,'VoiceExtensionId':_0x582933['id']});}else{if(_0x4f7c77['hasOwnProperty'](_0xbf13('0x3b'))){if(['queue',_0xbf13('0x3c')][_0xbf13('0x3d')](_0x4f7c77[_0xbf13('0x3e')]['toLowerCase']())&&_0x4f7c77[_0xbf13('0x3f')]!=='custom'){if(_0x4f7c77['answer']){_0x54e2bc['push']({'type':_0x4f7c77[_0xbf13('0x2')][_0xbf13('0x33')](),'app':'ExecIf','appdata':_0xbf13('0x40'),'context':_0x582933['context'],'exten':_0x582933['exten'],'priority':_0x4f7c77[_0xbf13('0x30')][_0xbf13('0x22')]+_0x3de418+_0x39d665++,'VoiceExtensionId':_0x582933['id']});_0x54e2bc[_0xbf13('0x8')]({'type':_0x4f7c77[_0xbf13('0x2')]['toLowerCase'](),'app':_0xbf13('0x3'),'appdata':_0xbf13('0x41'),'context':_0x582933[_0xbf13('0x4')],'exten':_0x582933[_0xbf13('0xb')],'priority':_0x4f7c77['intervals'][_0xbf13('0x22')]+_0x3de418+_0x39d665++,'VoiceExtensionId':_0x582933['id']});}else{_0x54e2bc[_0xbf13('0x8')]({'type':_0x4f7c77['type']['toLowerCase'](),'app':_0xbf13('0x14'),'appdata':_0xbf13('0x42'),'context':_0x582933[_0xbf13('0x4')],'exten':_0x582933[_0xbf13('0xb')],'priority':_0x4f7c77['intervals'][_0xbf13('0x22')]+_0x3de418+_0x39d665++,'VoiceExtensionId':_0x582933['id']});_0x54e2bc[_0xbf13('0x8')]({'type':_0x4f7c77['type'][_0xbf13('0x33')](),'app':_0xbf13('0x3'),'appdata':_0xbf13('0x43'),'context':_0x582933[_0xbf13('0x4')],'exten':_0x582933[_0xbf13('0xb')],'priority':_0x4f7c77[_0xbf13('0x30')][_0xbf13('0x22')]+_0x3de418+_0x39d665++,'VoiceExtensionId':_0x582933['id']});}}}}for(var _0x67cff5=0x0;_0x67cff5<_0x4f7c77[_0xbf13('0x30')][_0xbf13('0x22')];_0x67cff5++){var _0x150e8f=_0x3de418+_0x4f7c77[_0xbf13('0x30')]['length'];var _0x2ae2a5=_0x67cff5===_0x4f7c77[_0xbf13('0x30')]['length']-0x1?_0x3de418+_0x54e2bc['length']+_0x1384ae['length']+0x2:_0x3de418+_0x67cff5+0x1;_0x54e2bc[_0xbf13('0x44')](_0x67cff5,0x0,{'type':_0x582933[_0xbf13('0x2')],'app':_0xbf13('0x45'),'appdata':_0x4f7c77[_0xbf13('0x30')][_0x67cff5]+'?'+_0x582933['context']+',${EXTEN},'+_0x150e8f+':'+_0x582933['context']+',${EXTEN},'+_0x2ae2a5,'exten':_0x582933[_0xbf13('0xb')],'context':_0x582933[_0xbf13('0x4')],'priority':_0x3de418+_0x67cff5,'VoiceExtensionId':_0x582933['id']});}if(_0x4f7c77[_0xbf13('0x3f')]==='outboundDial')_0x4f7c77[_0xbf13('0x46')]=_0x5d5a33(_0x582933,_0x4f7c77[_0xbf13('0x46')]);_0x4f7c77['priority']=_0x54e2bc[_0xbf13('0x22')]?_[_0xbf13('0x47')](_0x54e2bc)[_0xbf13('0x48')]+0x1:_0x3de418;_0x20ac1e=_[_0xbf13('0x49')](_0x20ac1e,_0x54e2bc,[_0x4f7c77],_0x1384ae);_0x3de418=_[_0xbf13('0x47')](_0x20ac1e)['priority']+0x1;}return _0x30b3e8(_0x20ac1e);})[_0xbf13('0x4a')](function(_0x2598d2){_0x2dc455(_0x2598d2);});});}return _0x495034[_0xbf13('0x4b')]('VoiceExtension',attributes,{'tableName':_0xbf13('0x4c'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x19c8ac){var _0x6798de=this[_0xbf13('0x4d')]({'plain':!![]});var _0x4b356d=_0x6798de['type']==='outbound'?_0x268013(_0x6798de):_0x20a031(_0x6798de);return _0x4ac22e(_0x6798de,_0x19c8ac,_[_0xbf13('0x47')](_0x4b356d)[_0xbf13('0x48')]+0x1)['then'](function(_0x976146){var _0x28a666=_[_0xbf13('0x49')](_0x4b356d,_0x976146);_0x28a666['push']({'type':_0x6798de['type'],'app':_0xbf13('0x4e'),'exten':_0x6798de[_0xbf13('0xb')],'context':_0x6798de['context'],'priority':_[_0xbf13('0x47')](_0x28a666)[_0xbf13('0x48')]+0x1,'VoiceExtensionId':_0x6798de['id']});return _0x28a666;});}}});};
\ No newline at end of file
index 7aa6695..687825d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb1a3=['jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','GetVoiceExtension','VoiceExtension','options','raw','attributes','limit','map','include','model','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x388255,_0x5eb62f){var _0x37bab5=function(_0x101269){while(--_0x101269){_0x388255['push'](_0x388255['shift']());}};_0x37bab5(++_0x5eb62f);}(_0xb1a3,0x1cc));var _0x3b1a=function(_0xfcbcb8,_0x35bf6b){_0xfcbcb8=_0xfcbcb8-0x0;var _0x1b1f97=_0xb1a3[_0xfcbcb8];return _0x1b1f97;};'use strict';var _=require(_0x3b1a('0x0'));var util=require(_0x3b1a('0x1'));var moment=require(_0x3b1a('0x2'));var BPromise=require('bluebird');var rs=require(_0x3b1a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3b1a('0x4'));var logger=require(_0x3b1a('0x5'))(_0x3b1a('0x6'));var config=require(_0x3b1a('0x7'));var jayson=require(_0x3b1a('0x8'));var client=jayson[_0x3b1a('0x9')][_0x3b1a('0xa')]({'port':0x232a});config['redis']=_[_0x3b1a('0xb')](config[_0x3b1a('0xc')],{'host':_0x3b1a('0xd'),'port':0x18eb});var socket=require(_0x3b1a('0xe'))(new Redis(config['redis']));require('./voiceExtension.socket')[_0x3b1a('0xf')](socket);function respondWithRpcPromise(_0x1e6925,_0x4cd175,_0x260128){return new BPromise(function(_0x553d63,_0xc6d255){return client['request'](_0x1e6925,_0x260128)[_0x3b1a('0x10')](function(_0x261800){logger[_0x3b1a('0x11')](_0x3b1a('0x12'),_0x4cd175,_0x3b1a('0x13'));logger[_0x3b1a('0x14')](_0x3b1a('0x15'),_0x4cd175,_0x3b1a('0x13'),JSON[_0x3b1a('0x16')](_0x261800));if(_0x261800['error']){if(_0x261800['error'][_0x3b1a('0x17')]===0x1f4){logger[_0x3b1a('0x18')](_0x3b1a('0x12'),_0x4cd175,_0x261800[_0x3b1a('0x18')]['message']);return _0xc6d255(_0x261800[_0x3b1a('0x18')][_0x3b1a('0x19')]);}logger['error'](_0x3b1a('0x12'),_0x4cd175,_0x261800[_0x3b1a('0x18')][_0x3b1a('0x19')]);return _0x553d63(_0x261800[_0x3b1a('0x18')][_0x3b1a('0x19')]);}else{logger[_0x3b1a('0x11')](_0x3b1a('0x12'),_0x4cd175,_0x3b1a('0x13'));_0x553d63(_0x261800['result'][_0x3b1a('0x19')]);}})[_0x3b1a('0x1a')](function(_0x569bc4){logger[_0x3b1a('0x18')]('VoiceExtension,\x20%s,\x20%s',_0x4cd175,_0x569bc4);_0xc6d255(_0x569bc4);});});}exports[_0x3b1a('0x1b')]=function(_0x204deb){var _0x189e6c=this;return new Promise(function(_0x3cb500,_0xe1113d){return db[_0x3b1a('0x1c')]['findAll']({'raw':_0x204deb[_0x3b1a('0x1d')]?_0x204deb[_0x3b1a('0x1d')][_0x3b1a('0x1e')]===undefined?!![]:![]:!![],'where':_0x204deb[_0x3b1a('0x1d')]?_0x204deb[_0x3b1a('0x1d')]['where']||null:null,'attributes':_0x204deb['options']?_0x204deb[_0x3b1a('0x1d')][_0x3b1a('0x1f')]||null:null,'limit':_0x204deb[_0x3b1a('0x1d')]?_0x204deb[_0x3b1a('0x1d')][_0x3b1a('0x20')]||null:null,'include':_0x204deb[_0x3b1a('0x1d')]?_0x204deb[_0x3b1a('0x1d')]['include']?_[_0x3b1a('0x21')](_0x204deb[_0x3b1a('0x1d')][_0x3b1a('0x22')],function(_0x482484){return{'model':db[_0x482484[_0x3b1a('0x23')]],'as':_0x482484['as'],'attributes':_0x482484[_0x3b1a('0x1f')],'include':_0x482484[_0x3b1a('0x22')]?_[_0x3b1a('0x21')](_0x482484[_0x3b1a('0x22')],function(_0x13c2e8){return{'model':db[_0x13c2e8['model']],'as':_0x13c2e8['as'],'attributes':_0x13c2e8[_0x3b1a('0x1f')],'include':_0x13c2e8[_0x3b1a('0x22')]?_[_0x3b1a('0x21')](_0x13c2e8[_0x3b1a('0x22')],function(_0x2ff415){return{'model':db[_0x2ff415[_0x3b1a('0x23')]],'as':_0x2ff415['as'],'attributes':_0x2ff415['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x44c0eb){logger[_0x3b1a('0x11')](_0x3b1a('0x1b'),_0x204deb);logger[_0x3b1a('0x14')](_0x3b1a('0x1b'),_0x204deb,JSON[_0x3b1a('0x16')](_0x44c0eb));_0x3cb500(_0x44c0eb);})[_0x3b1a('0x1a')](function(_0x3abd0a){logger[_0x3b1a('0x18')]('GetVoiceExtension',_0x3abd0a[_0x3b1a('0x19')],_0x204deb);_0xe1113d(_0x189e6c[_0x3b1a('0x18')](0x1f4,_0x3abd0a[_0x3b1a('0x19')]));});});};
\ No newline at end of file
+var _0x535d=['debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','message','GetVoiceExtension','VoiceExtension','options','raw','where','attributes','limit','map','model','include','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent'];(function(_0x5ba195,_0x195755){var _0x101b63=function(_0x3190bc){while(--_0x3190bc){_0x5ba195['push'](_0x5ba195['shift']());}};_0x101b63(++_0x195755);}(_0x535d,0xe8));var _0xd535=function(_0x45d99c,_0x404b19){_0x45d99c=_0x45d99c-0x0;var _0x53d79e=_0x535d[_0x45d99c];return _0x53d79e;};'use strict';var _=require(_0xd535('0x0'));var util=require(_0xd535('0x1'));var moment=require('moment');var BPromise=require(_0xd535('0x2'));var rs=require(_0xd535('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd535('0x4'));var logger=require(_0xd535('0x5'))(_0xd535('0x6'));var config=require(_0xd535('0x7'));var jayson=require(_0xd535('0x8'));var client=jayson[_0xd535('0x9')]['http']({'port':0x232a});config['redis']=_[_0xd535('0xa')](config[_0xd535('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xd535('0xc'))(new Redis(config['redis']));require(_0xd535('0xd'))[_0xd535('0xe')](socket);function respondWithRpcPromise(_0x39792b,_0x3a6841,_0x4a296c){return new BPromise(function(_0x3f34c4,_0x38b299){return client[_0xd535('0xf')](_0x39792b,_0x4a296c)[_0xd535('0x10')](function(_0x4c0692){logger[_0xd535('0x11')](_0xd535('0x12'),_0x3a6841,_0xd535('0x13'));logger[_0xd535('0x14')](_0xd535('0x15'),_0x3a6841,_0xd535('0x13'),JSON[_0xd535('0x16')](_0x4c0692));if(_0x4c0692['error']){if(_0x4c0692[_0xd535('0x17')]['code']===0x1f4){logger['error'](_0xd535('0x12'),_0x3a6841,_0x4c0692[_0xd535('0x17')]['message']);return _0x38b299(_0x4c0692[_0xd535('0x17')][_0xd535('0x18')]);}logger[_0xd535('0x17')](_0xd535('0x12'),_0x3a6841,_0x4c0692['error'][_0xd535('0x18')]);return _0x3f34c4(_0x4c0692[_0xd535('0x17')][_0xd535('0x18')]);}else{logger[_0xd535('0x11')]('VoiceExtension,\x20%s,\x20%s',_0x3a6841,_0xd535('0x13'));_0x3f34c4(_0x4c0692['result'][_0xd535('0x18')]);}})['catch'](function(_0x34dc17){logger['error'](_0xd535('0x12'),_0x3a6841,_0x34dc17);_0x38b299(_0x34dc17);});});}exports[_0xd535('0x19')]=function(_0x31eda3){var _0x2499f0=this;return new Promise(function(_0x5749fa,_0x4b11d9){return db[_0xd535('0x1a')]['findAll']({'raw':_0x31eda3['options']?_0x31eda3[_0xd535('0x1b')][_0xd535('0x1c')]===undefined?!![]:![]:!![],'where':_0x31eda3[_0xd535('0x1b')]?_0x31eda3[_0xd535('0x1b')][_0xd535('0x1d')]||null:null,'attributes':_0x31eda3[_0xd535('0x1b')]?_0x31eda3['options'][_0xd535('0x1e')]||null:null,'limit':_0x31eda3[_0xd535('0x1b')]?_0x31eda3[_0xd535('0x1b')][_0xd535('0x1f')]||null:null,'include':_0x31eda3[_0xd535('0x1b')]?_0x31eda3['options']['include']?_[_0xd535('0x20')](_0x31eda3[_0xd535('0x1b')]['include'],function(_0x4aa746){return{'model':db[_0x4aa746[_0xd535('0x21')]],'as':_0x4aa746['as'],'attributes':_0x4aa746[_0xd535('0x1e')],'include':_0x4aa746[_0xd535('0x22')]?_['map'](_0x4aa746['include'],function(_0x3797c9){return{'model':db[_0x3797c9[_0xd535('0x21')]],'as':_0x3797c9['as'],'attributes':_0x3797c9[_0xd535('0x1e')],'include':_0x3797c9[_0xd535('0x22')]?_[_0xd535('0x20')](_0x3797c9[_0xd535('0x22')],function(_0x231736){return{'model':db[_0x231736['model']],'as':_0x231736['as'],'attributes':_0x231736[_0xd535('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xd535('0x10')](function(_0x55ddd8){logger['info']('GetVoiceExtension',_0x31eda3);logger[_0xd535('0x14')](_0xd535('0x19'),_0x31eda3,JSON[_0xd535('0x16')](_0x55ddd8));_0x5749fa(_0x55ddd8);})[_0xd535('0x23')](function(_0x3e4021){logger['error']('GetVoiceExtension',_0x3e4021[_0xd535('0x18')],_0x31eda3);_0x4b11d9(_0x2499f0[_0xd535('0x17')](0x1f4,_0x3e4021[_0xd535('0x18')]));});});};
\ No newline at end of file
index 3aeea7a..9c50320 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14b=['removeListener','register','length','./voiceExtension.events','save','emit'];(function(_0xb37061,_0x44f8ab){var _0x2cd124=function(_0x1b1ce6){while(--_0x1b1ce6){_0xb37061['push'](_0xb37061['shift']());}};_0x2cd124(++_0x44f8ab);}(_0xe14b,0x93));var _0xbe14=function(_0x50de0d,_0x16e361){_0x50de0d=_0x50de0d-0x0;var _0x484439=_0xe14b[_0x50de0d];return _0x484439;};'use strict';var VoiceExtensionEvents=require(_0xbe14('0x0'));var events=[_0xbe14('0x1'),'remove','update'];function createListener(_0x11c3a0,_0x36393a){return function(_0x48a116){_0x36393a[_0xbe14('0x2')](_0x11c3a0,_0x48a116);};}function removeListener(_0x5ce8fb,_0x496c04){return function(){VoiceExtensionEvents[_0xbe14('0x3')](_0x5ce8fb,_0x496c04);};}exports[_0xbe14('0x4')]=function(_0x1fe204){for(var _0x1ff100=0x0,_0x1d9ade=events[_0xbe14('0x5')];_0x1ff100<_0x1d9ade;_0x1ff100++){var _0x196fca=events[_0x1ff100];var _0x566ae7=createListener('voiceExtension:'+_0x196fca,_0x1fe204);VoiceExtensionEvents['on'](_0x196fca,_0x566ae7);}};
\ No newline at end of file
+var _0x1cb9=['update','emit','removeListener','register','length','./voiceExtension.events','remove'];(function(_0x4eec9b,_0x4aea09){var _0x2e3849=function(_0x24c06d){while(--_0x24c06d){_0x4eec9b['push'](_0x4eec9b['shift']());}};_0x2e3849(++_0x4aea09);}(_0x1cb9,0x14e));var _0x91cb=function(_0x2206d4,_0x3b43c3){_0x2206d4=_0x2206d4-0x0;var _0x4d4925=_0x1cb9[_0x2206d4];return _0x4d4925;};'use strict';var VoiceExtensionEvents=require(_0x91cb('0x0'));var events=['save',_0x91cb('0x1'),_0x91cb('0x2')];function createListener(_0x2b1894,_0x351bdb){return function(_0x57ea48){_0x351bdb[_0x91cb('0x3')](_0x2b1894,_0x57ea48);};}function removeListener(_0x2b7314,_0x5652cd){return function(){VoiceExtensionEvents[_0x91cb('0x4')](_0x2b7314,_0x5652cd);};}exports[_0x91cb('0x5')]=function(_0x186dc3){for(var _0x28543e=0x0,_0x3b9d98=events[_0x91cb('0x6')];_0x28543e<_0x3b9d98;_0x28543e++){var _0x4c1f56=events[_0x28543e];var _0x15c517=createListener('voiceExtension:'+_0x4c1f56,_0x186dc3);VoiceExtensionEvents['on'](_0x4c1f56,_0x15c517);}};
\ No newline at end of file
index 5f0f8f3..20b9452 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4bd3=['post','create','put','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/messages','getMessages'];(function(_0x4297a0,_0x3cd67f){var _0x3daf53=function(_0x22ca69){while(--_0x22ca69){_0x4297a0['push'](_0x4297a0['shift']());}};_0x3daf53(++_0x3cd67f);}(_0x4bd3,0x174));var _0x34bd=function(_0x400db2,_0x6515bf){_0x400db2=_0x400db2-0x0;var _0x571236=_0x4bd3[_0x400db2];return _0x571236;};'use strict';var multer=require(_0x34bd('0x0'));var util=require('util');var path=require(_0x34bd('0x1'));var timeout=require(_0x34bd('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x34bd('0x3'));var interaction=require(_0x34bd('0x4'));var config=require(_0x34bd('0x5'));var controller=require('./voiceMail.controller');router[_0x34bd('0x6')]('/',auth[_0x34bd('0x7')](),controller['index']);router[_0x34bd('0x6')](_0x34bd('0x8'),auth['isAuthenticated'](),controller[_0x34bd('0x9')]);router[_0x34bd('0x6')](_0x34bd('0xa'),auth[_0x34bd('0x7')](),controller[_0x34bd('0xb')]);router[_0x34bd('0xc')]('/',auth['isAuthenticated'](),controller[_0x34bd('0xd')]);router[_0x34bd('0xe')](_0x34bd('0x8'),auth[_0x34bd('0x7')](),controller['update']);router['delete'](_0x34bd('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x34bd('0xf')]=router;
\ No newline at end of file
+var _0xba34=['getMessages','post','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','show','/:id/messages'];(function(_0xa95f7f,_0x1e8bba){var _0x40bda0=function(_0x56ed58){while(--_0x56ed58){_0xa95f7f['push'](_0xa95f7f['shift']());}};_0x40bda0(++_0x1e8bba);}(_0xba34,0x119));var _0x4ba3=function(_0x47c4f4,_0x3a5f3f){_0x47c4f4=_0x47c4f4-0x0;var _0x150bf2=_0xba34[_0x47c4f4];return _0x150bf2;};'use strict';var multer=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var path=require(_0x4ba3('0x2'));var timeout=require(_0x4ba3('0x3'));var express=require(_0x4ba3('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var controller=require(_0x4ba3('0x7'));router[_0x4ba3('0x8')]('/',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xa')]);router[_0x4ba3('0x8')]('/:id',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xb')]);router[_0x4ba3('0x8')](_0x4ba3('0xc'),auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xd')]);router[_0x4ba3('0xe')]('/',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xf')]);router[_0x4ba3('0x10')](_0x4ba3('0x11'),auth['isAuthenticated'](),controller[_0x4ba3('0x12')]);router[_0x4ba3('0x13')]('/:id',auth[_0x4ba3('0x9')](),controller['destroy']);module[_0x4ba3('0x14')]=router;
\ No newline at end of file
index 0290bad..9f6deb9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4aae=['setDataValue','email','string','trim','central','ENUM','yes','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','contest_mailbox'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x4aae,0x8c));var _0xe4aa=function(_0x41acab,_0x375b35){_0x41acab=_0x41acab-0x0;var _0x1f7943=_0x4aae[_0x41acab];return _0x1f7943;};'use strict';var Sequelize=require(_0xe4aa('0x0'));module[_0xe4aa('0x1')]={'customer_id':{'type':Sequelize[_0xe4aa('0x2')]},'context':{'type':Sequelize[_0xe4aa('0x2')],'defaultValue':'from-voicemail','unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0xe4aa('0x2')],'defaultValue':'','allowNull':![],'unique':_0xe4aa('0x3')},'password':{'type':Sequelize[_0xe4aa('0x2')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x3088aa){this[_0xe4aa('0x4')](_0xe4aa('0x5'),typeof _0x3088aa===_0xe4aa('0x6')&&_0x3088aa['trim']()?_0x3088aa[_0xe4aa('0x7')]():null);}},'pager':{'type':Sequelize[_0xe4aa('0x2')]},'tz':{'type':Sequelize[_0xe4aa('0x2')],'defaultValue':_0xe4aa('0x8')},'attach':{'type':Sequelize[_0xe4aa('0x9')](_0xe4aa('0xa'),'no'),'defaultValue':_0xe4aa('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0xe4aa('0x9')](_0xe4aa('0xa'),'no'),'defaultValue':_0xe4aa('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0xe4aa('0x2')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize['ENUM'](_0xe4aa('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xe4aa('0x9')](_0xe4aa('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0xe4aa('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xe4aa('0x9')](_0xe4aa('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xe4aa('0x9')](_0xe4aa('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xe4aa('0x9')]('yes','no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0xe4aa('0x9')](_0xe4aa('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xe4aa('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0xe4aa('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0xe4aa('0xb')},'emailsubject':{'type':Sequelize[_0xe4aa('0x2')]},'emailbody':{'type':Sequelize[_0xe4aa('0x2')]},'maxsecs':{'type':Sequelize[_0xe4aa('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xe4aa('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xe4aa('0xd')],'get':function(){return this[_0xe4aa('0xe')](_0xe4aa('0xf'))+_0xe4aa('0x10')+this['getDataValue'](_0xe4aa('0x11'));}}};
\ No newline at end of file
+var _0x8570=['sequelize','exports','STRING','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','getDataValue','fullname','\x20-\x20','mailbox'];(function(_0x256e32,_0x4013bc){var _0x464070=function(_0x449398){while(--_0x449398){_0x256e32['push'](_0x256e32['shift']());}};_0x464070(++_0x4013bc);}(_0x8570,0x198));var _0x0857=function(_0xedefa,_0x2669dd){_0xedefa=_0xedefa-0x0;var _0x1f9abd=_0x8570[_0xedefa];return _0x1f9abd;};'use strict';var Sequelize=require(_0x0857('0x0'));module[_0x0857('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x0857('0x2')],'defaultValue':'from-voicemail','unique':_0x0857('0x3')},'mailbox':{'type':Sequelize[_0x0857('0x2')],'defaultValue':'','allowNull':![],'unique':_0x0857('0x3')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x0857('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x5d0d04){this[_0x0857('0x4')](_0x0857('0x5'),typeof _0x5d0d04===_0x0857('0x6')&&_0x5d0d04[_0x0857('0x7')]()?_0x5d0d04['trim']():null);}},'pager':{'type':Sequelize[_0x0857('0x2')]},'tz':{'type':Sequelize[_0x0857('0x2')],'defaultValue':_0x0857('0x8')},'attach':{'type':Sequelize[_0x0857('0x9')](_0x0857('0xa'),'no'),'defaultValue':_0x0857('0xa'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x0857('0xa'),'no'),'defaultValue':_0x0857('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0x0857('0x2')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x0857('0x9')](_0x0857('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x0857('0x9')](_0x0857('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x0857('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x0857('0x9')](_0x0857('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x0857('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x0857('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x0857('0x9')](_0x0857('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x0857('0x9')]('yes','no'),'defaultValue':_0x0857('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0x0857('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x0857('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x0857('0x9')](_0x0857('0xa'),'no'),'defaultValue':_0x0857('0xa'),'allowNull':![]},'stamp':{'type':_0x0857('0xc')},'emailsubject':{'type':Sequelize[_0x0857('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[_0x0857('0xd')](_0x0857('0xe'))+_0x0857('0xf')+this[_0x0857('0xd')](_0x0857('0x10'));}}};
\ No newline at end of file
index 1c35ad4..cec25d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','findOne','VoiceMailMessage','rawAttributes','nolimit','order','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','Voicemails','error','name','index','VoiceMail','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','catch','show','params','options'];(function(_0x5d195f,_0x542f0b){var _0x3c6cbe=function(_0x492836){while(--_0x492836){_0x5d195f['push'](_0x5d195f['shift']());}};_0x3c6cbe(++_0x542f0b);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x0d8b('0x0'));var rimraf=require(_0x0d8b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0d8b('0x2'));var BPromise=require(_0x0d8b('0x3'));var Mustache=require(_0x0d8b('0x4'));var util=require(_0x0d8b('0x5'));var path=require(_0x0d8b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0d8b('0x7'));var fs=require('fs');var fs_extra=require(_0x0d8b('0x8'));var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0xc'));var querystring=require(_0x0d8b('0xd'));var Papa=require(_0x0d8b('0xe'));var Redis=require(_0x0d8b('0xf'));var authService=require(_0x0d8b('0x10'));var qs=require(_0x0d8b('0x11'));var as=require(_0x0d8b('0x12'));var hardwareService=require(_0x0d8b('0x13'));var logger=require('../../config/logger')(_0x0d8b('0x14'));var utils=require('../../config/utils');var config=require(_0x0d8b('0x15'));var licenseUtil=require(_0x0d8b('0x16'));var db=require(_0x0d8b('0x17'))['db'];function respondWithStatusCode(_0x92cdd8,_0x35a07b){_0x35a07b=_0x35a07b||0xcc;return function(_0x32bb1a){if(_0x32bb1a){return _0x92cdd8[_0x0d8b('0x18')](_0x35a07b);}return _0x92cdd8[_0x0d8b('0x19')](_0x35a07b)[_0x0d8b('0x1a')]();};}function respondWithResult(_0x2ce75e,_0x5ad086){_0x5ad086=_0x5ad086||0xc8;return function(_0xe65334){if(_0xe65334){return _0x2ce75e[_0x0d8b('0x19')](_0x5ad086)[_0x0d8b('0x1b')](_0xe65334);}};}function respondWithFilteredResult(_0x4f6f21,_0x23eb7b){return function(_0xa86349){if(_0xa86349){var _0x17f7df=typeof _0x23eb7b[_0x0d8b('0x1c')]===_0x0d8b('0x1d')&&typeof _0x23eb7b['limit']===_0x0d8b('0x1d');var _0x4586c2=_0xa86349[_0x0d8b('0x1e')];var _0x5fecbd=_0x17f7df?0x0:_0x23eb7b[_0x0d8b('0x1c')];var _0x18dd2d=_0x17f7df?_0xa86349[_0x0d8b('0x1e')]:_0x23eb7b[_0x0d8b('0x1c')]+_0x23eb7b['limit'];var _0x27512e;if(_0x18dd2d>=_0x4586c2){_0x18dd2d=_0x4586c2;_0x27512e=0xc8;}else{_0x27512e=0xce;}_0x4f6f21[_0x0d8b('0x19')](_0x27512e);return _0x4f6f21[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x5fecbd+'-'+_0x18dd2d+'/'+_0x4586c2)[_0x0d8b('0x1b')](_0xa86349);}return null;};}function patchUpdates(_0x5b709c){return function(_0x393beb){try{jsonpatch[_0x0d8b('0x21')](_0x393beb,_0x5b709c,!![]);}catch(_0x50ec1e){return BPromise['reject'](_0x50ec1e);}return _0x393beb[_0x0d8b('0x22')]();};}function saveUpdates(_0x54a9a7,_0x56c729){return function(_0x5527d8){if(_0x5527d8){return _0x5527d8[_0x0d8b('0x23')](_0x54a9a7)[_0x0d8b('0x24')](function(_0x214778){return _0x214778;});}return null;};}function removeEntity(_0x38efc8,_0x221071){return function(_0x2c64e2){if(_0x2c64e2){return _0x2c64e2[_0x0d8b('0x25')]()[_0x0d8b('0x24')](function(){var _0x27b695=_0x2c64e2['get']({'plain':!![]});var _0xe8bbee=_0x0d8b('0x26');return db['UserProfileResource'][_0x0d8b('0x25')]({'where':{'type':_0xe8bbee,'resourceId':_0x27b695['id']}})['then'](function(){return _0x2c64e2;});})[_0x0d8b('0x24')](function(){_0x38efc8[_0x0d8b('0x19')](0xcc)[_0x0d8b('0x1a')]();});}};}function handleEntityNotFound(_0x4fe6f9,_0x59a905){return function(_0x28f639){if(!_0x28f639){_0x4fe6f9[_0x0d8b('0x18')](0x194);}return _0x28f639;};}function handleError(_0x4c05ee,_0xcbc4ac){_0xcbc4ac=_0xcbc4ac||0x1f4;return function(_0x59aa83){logger[_0x0d8b('0x27')](_0x59aa83['stack']);if(_0x59aa83[_0x0d8b('0x28')]){delete _0x59aa83['name'];}_0x4c05ee[_0x0d8b('0x19')](_0xcbc4ac)['send'](_0x59aa83);};}exports[_0x0d8b('0x29')]=function(_0x544735,_0x3c8887){var _0x106e4c={},_0x2c058d={},_0x56120a={'count':0x0,'rows':[]};var _0x4c80a2=_['map'](db[_0x0d8b('0x2a')]['rawAttributes'],function(_0x3cdf3c){return{'name':_0x3cdf3c['fieldName'],'type':_0x3cdf3c['type'][_0x0d8b('0x2b')]};});_0x2c058d[_0x0d8b('0x2c')]=_[_0x0d8b('0x2d')](_0x4c80a2,_0x0d8b('0x28'));_0x2c058d[_0x0d8b('0x2e')]=_[_0x0d8b('0x2f')](_0x544735[_0x0d8b('0x2e')]);_0x2c058d[_0x0d8b('0x30')]=_['intersection'](_0x2c058d[_0x0d8b('0x2c')],_0x2c058d[_0x0d8b('0x2e')]);_0x106e4c['attributes']=_[_0x0d8b('0x31')](_0x2c058d[_0x0d8b('0x2c')],qs[_0x0d8b('0x32')](_0x544735['query'][_0x0d8b('0x32')]));_0x106e4c[_0x0d8b('0x33')]=_0x106e4c[_0x0d8b('0x33')][_0x0d8b('0x34')]?_0x106e4c[_0x0d8b('0x33')]:_0x2c058d['model'];if(!_0x544735[_0x0d8b('0x2e')][_0x0d8b('0x35')]('nolimit')){_0x106e4c[_0x0d8b('0x36')]=qs[_0x0d8b('0x36')](_0x544735[_0x0d8b('0x2e')][_0x0d8b('0x36')]);_0x106e4c[_0x0d8b('0x1c')]=qs['offset'](_0x544735['query'][_0x0d8b('0x1c')]);}_0x106e4c['order']=qs['sort'](_0x544735[_0x0d8b('0x2e')][_0x0d8b('0x37')]);_0x106e4c[_0x0d8b('0x38')]=qs[_0x0d8b('0x30')](_[_0x0d8b('0x39')](_0x544735[_0x0d8b('0x2e')],_0x2c058d['filters']),_0x4c80a2);if(_0x544735[_0x0d8b('0x2e')][_0x0d8b('0x3a')]){_0x106e4c[_0x0d8b('0x38')]=_[_0x0d8b('0x3b')](_0x106e4c[_0x0d8b('0x38')],{'$or':_[_0x0d8b('0x2d')](_0x4c80a2,function(_0xf1680e){if(_0xf1680e['type']!==_0x0d8b('0x3c')){var _0x34acb5={};_0x34acb5[_0xf1680e[_0x0d8b('0x28')]]={'$like':'%'+_0x544735[_0x0d8b('0x2e')]['filter']+'%'};return _0x34acb5;}})});}_0x106e4c=_[_0x0d8b('0x3b')]({},_0x106e4c,_0x544735['options']);var _0x37b26c={'where':_0x106e4c[_0x0d8b('0x38')]};return db[_0x0d8b('0x2a')][_0x0d8b('0x1e')](_0x37b26c)[_0x0d8b('0x24')](function(_0x3e632e){_0x56120a[_0x0d8b('0x1e')]=_0x3e632e;if(_0x544735[_0x0d8b('0x2e')][_0x0d8b('0x3d')]){_0x106e4c[_0x0d8b('0x3e')]=[{'all':!![]}];}return db['VoiceMail']['findAll'](_0x106e4c);})['then'](function(_0x4d0811){_0x56120a['rows']=_0x4d0811;return _0x56120a;})[_0x0d8b('0x24')](respondWithFilteredResult(_0x3c8887,_0x106e4c))[_0x0d8b('0x3f')](handleError(_0x3c8887,null));};exports[_0x0d8b('0x40')]=function(_0x5100cf,_0x4a76a3){var _0x1b216d={'raw':!![],'where':{'id':_0x5100cf[_0x0d8b('0x41')]['id']}},_0x192de1={};_0x192de1['model']=_[_0x0d8b('0x2f')](db[_0x0d8b('0x2a')]['rawAttributes']);_0x192de1['query']=_[_0x0d8b('0x2f')](_0x5100cf['query']);_0x192de1[_0x0d8b('0x30')]=_['intersection'](_0x192de1['model'],_0x192de1[_0x0d8b('0x2e')]);_0x1b216d[_0x0d8b('0x33')]=_['intersection'](_0x192de1['model'],qs['fields'](_0x5100cf['query'][_0x0d8b('0x32')]));_0x1b216d[_0x0d8b('0x33')]=_0x1b216d[_0x0d8b('0x33')]['length']?_0x1b216d[_0x0d8b('0x33')]:_0x192de1[_0x0d8b('0x2c')];if(_0x5100cf[_0x0d8b('0x2e')][_0x0d8b('0x3d')]){_0x1b216d[_0x0d8b('0x3e')]=[{'all':!![]}];}_0x1b216d=_[_0x0d8b('0x3b')]({},_0x1b216d,_0x5100cf[_0x0d8b('0x42')]);return db[_0x0d8b('0x2a')][_0x0d8b('0x43')](_0x1b216d)[_0x0d8b('0x24')](handleEntityNotFound(_0x4a76a3,null))[_0x0d8b('0x24')](respondWithResult(_0x4a76a3,null))[_0x0d8b('0x3f')](handleError(_0x4a76a3,null));};exports[_0x0d8b('0x44')]=function(_0x3e569b,_0x570af8){return db[_0x0d8b('0x2a')][_0x0d8b('0x44')](_0x3e569b[_0x0d8b('0x45')],{})[_0x0d8b('0x24')](function(_0x574b90){var _0x371fa0=_0x3e569b['user']['get']({'plain':!![]});if(!_0x371fa0)throw new Error(_0x0d8b('0x46'));if(_0x371fa0[_0x0d8b('0x47')]===_0x0d8b('0x48')){var _0x4396b5=_0x574b90['get']({'plain':!![]});var _0x131579=_0x0d8b('0x26');return db[_0x0d8b('0x49')][_0x0d8b('0x43')]({'where':{'name':_0x131579,'userProfileId':_0x371fa0[_0x0d8b('0x4a')]},'raw':!![]})['then'](function(_0x5c0824){if(_0x5c0824&&_0x5c0824['autoAssociation']===0x0){return db['UserProfileResource'][_0x0d8b('0x44')]({'name':_0x4396b5[_0x0d8b('0x28')],'resourceId':_0x4396b5['id'],'type':_0x5c0824['name'],'sectionId':_0x5c0824['id']},{})['then'](function(){return _0x574b90;});}else{return _0x574b90;}})[_0x0d8b('0x3f')](function(_0x3d3cb6){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d3cb6);throw _0x3d3cb6;});}return _0x574b90;})[_0x0d8b('0x24')](respondWithResult(_0x570af8,0xc9))[_0x0d8b('0x3f')](handleError(_0x570af8,null));};exports[_0x0d8b('0x23')]=function(_0x346c0d,_0x2d5519){if(_0x346c0d['body']['id']){delete _0x346c0d[_0x0d8b('0x45')]['id'];}return db[_0x0d8b('0x2a')]['find']({'where':{'id':_0x346c0d['params']['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x2d5519,null))[_0x0d8b('0x24')](saveUpdates(_0x346c0d['body'],null))['then'](respondWithResult(_0x2d5519,null))[_0x0d8b('0x3f')](handleError(_0x2d5519,null));};exports[_0x0d8b('0x25')]=function(_0x377027,_0xb58818){return db['VoiceMail'][_0x0d8b('0x43')]({'where':{'id':_0x377027['params']['id']}})['then'](handleEntityNotFound(_0xb58818,null))[_0x0d8b('0x24')](removeEntity(_0xb58818,null))[_0x0d8b('0x3f')](handleError(_0xb58818,null));};exports['getMessages']=function(_0x4a8f33,_0x44ed23,_0x3d7161){return db[_0x0d8b('0x2a')][_0x0d8b('0x4b')]({'where':{'id':_0x4a8f33[_0x0d8b('0x41')]['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x44ed23,null))[_0x0d8b('0x24')](function(_0x3bead7){var _0x5418d8;var _0x24a859={},_0x37dc9f={};_0x37dc9f[_0x0d8b('0x2c')]=_[_0x0d8b('0x2f')](db[_0x0d8b('0x4c')][_0x0d8b('0x4d')]);_0x37dc9f[_0x0d8b('0x2e')]=_[_0x0d8b('0x2f')](_0x4a8f33[_0x0d8b('0x2e')]);_0x37dc9f['filters']=_[_0x0d8b('0x31')](_0x37dc9f[_0x0d8b('0x2c')],_0x37dc9f[_0x0d8b('0x2e')]);_0x24a859[_0x0d8b('0x33')]=_[_0x0d8b('0x31')](_0x37dc9f['model'],qs[_0x0d8b('0x32')](_0x4a8f33[_0x0d8b('0x2e')][_0x0d8b('0x32')]));_0x24a859[_0x0d8b('0x33')]=_0x24a859[_0x0d8b('0x33')]['length']?_0x24a859['attributes']:_0x37dc9f[_0x0d8b('0x2c')];if(!_0x4a8f33[_0x0d8b('0x2e')][_0x0d8b('0x35')](_0x0d8b('0x4e'))){_0x24a859['limit']=qs[_0x0d8b('0x36')](_0x4a8f33[_0x0d8b('0x2e')][_0x0d8b('0x36')]);_0x24a859['offset']=qs[_0x0d8b('0x1c')](_0x4a8f33['query'][_0x0d8b('0x1c')]);}_0x24a859[_0x0d8b('0x4f')]=qs[_0x0d8b('0x37')](_0x4a8f33[_0x0d8b('0x2e')][_0x0d8b('0x37')]);_0x24a859[_0x0d8b('0x38')]=qs['filters'](_[_0x0d8b('0x39')](_0x4a8f33['query'],_0x37dc9f[_0x0d8b('0x30')]));if(_0x4a8f33[_0x0d8b('0x2e')][_0x0d8b('0x3a')]){_0x24a859[_0x0d8b('0x38')]=_['merge'](_0x24a859[_0x0d8b('0x38')],{'$or':_[_0x0d8b('0x2d')](_0x24a859[_0x0d8b('0x33')],function(_0x2332fc){var _0x2ccdae={};_0x2ccdae[_0x2332fc]={'$like':'%'+_0x4a8f33[_0x0d8b('0x2e')][_0x0d8b('0x3a')]+'%'};return _0x2ccdae;})});}_0x24a859[_0x0d8b('0x38')]=_[_0x0d8b('0x3b')](_0x24a859[_0x0d8b('0x38')],{'mailboxuser':_0x3bead7['mailbox']});_0x24a859=_['merge']({},_0x24a859,_0x4a8f33[_0x0d8b('0x42')]);return db[_0x0d8b('0x4c')]['findAndCountAll'](_0x24a859)[_0x0d8b('0x24')](respondWithFilteredResult(_0x44ed23,_0x24a859));})['catch'](handleError(_0x44ed23,null));};
\ No newline at end of file
+var _0x0713=['userProfileId','autoAssociation','getMessages','VoiceMailMessage','rawAttributes','mailbox','findAndCountAll','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','sendStatus','error','stack','name','index','map','fieldName','type','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VoiceMail','rows','catch','show','params','keys','fields','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3071('0x0'));var jsonpatch=require(_0x3071('0x1'));var rp=require(_0x3071('0x2'));var moment=require(_0x3071('0x3'));var BPromise=require(_0x3071('0x4'));var Mustache=require('mustache');var util=require(_0x3071('0x5'));var path=require(_0x3071('0x6'));var sox=require(_0x3071('0x7'));var csv=require(_0x3071('0x8'));var ejs=require(_0x3071('0x9'));var fs=require('fs');var fs_extra=require(_0x3071('0xa'));var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x8'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var as=require(_0x3071('0x14'));var hardwareService=require(_0x3071('0x15'));var logger=require('../../config/logger')(_0x3071('0x16'));var utils=require(_0x3071('0x17'));var config=require(_0x3071('0x18'));var licenseUtil=require(_0x3071('0x19'));var db=require(_0x3071('0x1a'))['db'];function respondWithStatusCode(_0x4a8cc7,_0x5330a8){_0x5330a8=_0x5330a8||0xcc;return function(_0x1826ca){if(_0x1826ca){return _0x4a8cc7['sendStatus'](_0x5330a8);}return _0x4a8cc7[_0x3071('0x1b')](_0x5330a8)[_0x3071('0x1c')]();};}function respondWithResult(_0x5d4883,_0x104e73){_0x104e73=_0x104e73||0xc8;return function(_0x4e1219){if(_0x4e1219){return _0x5d4883[_0x3071('0x1b')](_0x104e73)[_0x3071('0x1d')](_0x4e1219);}};}function respondWithFilteredResult(_0x1271d0,_0x1f14e1){return function(_0x1caa5d){if(_0x1caa5d){var _0x2a6a4b=typeof _0x1f14e1[_0x3071('0x1e')]===_0x3071('0x1f')&&typeof _0x1f14e1[_0x3071('0x20')]===_0x3071('0x1f');var _0x5f3c22=_0x1caa5d[_0x3071('0x21')];var _0x17dbda=_0x2a6a4b?0x0:_0x1f14e1[_0x3071('0x1e')];var _0x108a83=_0x2a6a4b?_0x1caa5d[_0x3071('0x21')]:_0x1f14e1[_0x3071('0x1e')]+_0x1f14e1[_0x3071('0x20')];var _0x26f113;if(_0x108a83>=_0x5f3c22){_0x108a83=_0x5f3c22;_0x26f113=0xc8;}else{_0x26f113=0xce;}_0x1271d0['status'](_0x26f113);return _0x1271d0[_0x3071('0x22')](_0x3071('0x23'),_0x17dbda+'-'+_0x108a83+'/'+_0x5f3c22)[_0x3071('0x1d')](_0x1caa5d);}return null;};}function patchUpdates(_0x56c267){return function(_0xb8f4e3){try{jsonpatch['apply'](_0xb8f4e3,_0x56c267,!![]);}catch(_0x833074){return BPromise[_0x3071('0x24')](_0x833074);}return _0xb8f4e3[_0x3071('0x25')]();};}function saveUpdates(_0x457b57,_0x33090c){return function(_0x34c50e){if(_0x34c50e){return _0x34c50e[_0x3071('0x26')](_0x457b57)[_0x3071('0x27')](function(_0x542646){return _0x542646;});}return null;};}function removeEntity(_0x481a51,_0x2ce48a){return function(_0xb05b1d){if(_0xb05b1d){return _0xb05b1d[_0x3071('0x28')]()[_0x3071('0x27')](function(){var _0x2793ef=_0xb05b1d[_0x3071('0x29')]({'plain':!![]});var _0x7a4cb4=_0x3071('0x2a');return db[_0x3071('0x2b')]['destroy']({'where':{'type':_0x7a4cb4,'resourceId':_0x2793ef['id']}})[_0x3071('0x27')](function(){return _0xb05b1d;});})[_0x3071('0x27')](function(){_0x481a51[_0x3071('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fb1ca,_0x28792d){return function(_0x163604){if(!_0x163604){_0x4fb1ca[_0x3071('0x2c')](0x194);}return _0x163604;};}function handleError(_0x3fa3b8,_0x25b96b){_0x25b96b=_0x25b96b||0x1f4;return function(_0x177b5f){logger[_0x3071('0x2d')](_0x177b5f[_0x3071('0x2e')]);if(_0x177b5f[_0x3071('0x2f')]){delete _0x177b5f[_0x3071('0x2f')];}_0x3fa3b8['status'](_0x25b96b)['send'](_0x177b5f);};}exports[_0x3071('0x30')]=function(_0x149e0d,_0x6ddf96){var _0x40be95={},_0x3f6d90={},_0x29538c={'count':0x0,'rows':[]};var _0x32b6b1=_[_0x3071('0x31')](db['VoiceMail']['rawAttributes'],function(_0x4ab983){return{'name':_0x4ab983[_0x3071('0x32')],'type':_0x4ab983[_0x3071('0x33')]['key']};});_0x3f6d90[_0x3071('0x34')]=_[_0x3071('0x31')](_0x32b6b1,_0x3071('0x2f'));_0x3f6d90[_0x3071('0x35')]=_['keys'](_0x149e0d[_0x3071('0x35')]);_0x3f6d90[_0x3071('0x36')]=_[_0x3071('0x37')](_0x3f6d90[_0x3071('0x34')],_0x3f6d90[_0x3071('0x35')]);_0x40be95[_0x3071('0x38')]=_[_0x3071('0x37')](_0x3f6d90[_0x3071('0x34')],qs['fields'](_0x149e0d[_0x3071('0x35')]['fields']));_0x40be95['attributes']=_0x40be95[_0x3071('0x38')][_0x3071('0x39')]?_0x40be95['attributes']:_0x3f6d90[_0x3071('0x34')];if(!_0x149e0d[_0x3071('0x35')][_0x3071('0x3a')](_0x3071('0x3b'))){_0x40be95[_0x3071('0x20')]=qs[_0x3071('0x20')](_0x149e0d['query'][_0x3071('0x20')]);_0x40be95[_0x3071('0x1e')]=qs['offset'](_0x149e0d[_0x3071('0x35')]['offset']);}_0x40be95[_0x3071('0x3c')]=qs[_0x3071('0x3d')](_0x149e0d['query']['sort']);_0x40be95[_0x3071('0x3e')]=qs[_0x3071('0x36')](_[_0x3071('0x3f')](_0x149e0d['query'],_0x3f6d90[_0x3071('0x36')]),_0x32b6b1);if(_0x149e0d['query'][_0x3071('0x40')]){_0x40be95['where']=_[_0x3071('0x41')](_0x40be95[_0x3071('0x3e')],{'$or':_[_0x3071('0x31')](_0x32b6b1,function(_0x3113ef){if(_0x3113ef[_0x3071('0x33')]!=='VIRTUAL'){var _0x53ed25={};_0x53ed25[_0x3113ef[_0x3071('0x2f')]]={'$like':'%'+_0x149e0d[_0x3071('0x35')][_0x3071('0x40')]+'%'};return _0x53ed25;}})});}_0x40be95=_[_0x3071('0x41')]({},_0x40be95,_0x149e0d['options']);var _0x3cfc05={'where':_0x40be95[_0x3071('0x3e')]};return db[_0x3071('0x42')][_0x3071('0x21')](_0x3cfc05)[_0x3071('0x27')](function(_0xb9a4b8){_0x29538c['count']=_0xb9a4b8;if(_0x149e0d[_0x3071('0x35')]['includeAll']){_0x40be95['include']=[{'all':!![]}];}return db['VoiceMail']['findAll'](_0x40be95);})[_0x3071('0x27')](function(_0x1be8b6){_0x29538c[_0x3071('0x43')]=_0x1be8b6;return _0x29538c;})[_0x3071('0x27')](respondWithFilteredResult(_0x6ddf96,_0x40be95))[_0x3071('0x44')](handleError(_0x6ddf96,null));};exports[_0x3071('0x45')]=function(_0xa711b5,_0x2e6c70){var _0x56589e={'raw':!![],'where':{'id':_0xa711b5[_0x3071('0x46')]['id']}},_0x1e8222={};_0x1e8222[_0x3071('0x34')]=_[_0x3071('0x47')](db[_0x3071('0x42')]['rawAttributes']);_0x1e8222['query']=_[_0x3071('0x47')](_0xa711b5[_0x3071('0x35')]);_0x1e8222[_0x3071('0x36')]=_[_0x3071('0x37')](_0x1e8222[_0x3071('0x34')],_0x1e8222['query']);_0x56589e[_0x3071('0x38')]=_['intersection'](_0x1e8222[_0x3071('0x34')],qs['fields'](_0xa711b5['query'][_0x3071('0x48')]));_0x56589e['attributes']=_0x56589e[_0x3071('0x38')]['length']?_0x56589e[_0x3071('0x38')]:_0x1e8222[_0x3071('0x34')];if(_0xa711b5[_0x3071('0x35')][_0x3071('0x49')]){_0x56589e['include']=[{'all':!![]}];}_0x56589e=_[_0x3071('0x41')]({},_0x56589e,_0xa711b5['options']);return db[_0x3071('0x42')]['find'](_0x56589e)[_0x3071('0x27')](handleEntityNotFound(_0x2e6c70,null))[_0x3071('0x27')](respondWithResult(_0x2e6c70,null))['catch'](handleError(_0x2e6c70,null));};exports[_0x3071('0x4a')]=function(_0x117e73,_0x224a70){return db[_0x3071('0x42')][_0x3071('0x4a')](_0x117e73[_0x3071('0x4b')],{})[_0x3071('0x27')](function(_0x577060){var _0x2c6e4c=_0x117e73[_0x3071('0x4c')][_0x3071('0x29')]({'plain':!![]});if(!_0x2c6e4c)throw new Error(_0x3071('0x4d'));if(_0x2c6e4c['role']===_0x3071('0x4c')){var _0x2aea37=_0x577060[_0x3071('0x29')]({'plain':!![]});var _0x2307dd=_0x3071('0x2a');return db[_0x3071('0x4e')][_0x3071('0x4f')]({'where':{'name':_0x2307dd,'userProfileId':_0x2c6e4c[_0x3071('0x50')]},'raw':!![]})[_0x3071('0x27')](function(_0x886f7){if(_0x886f7&&_0x886f7[_0x3071('0x51')]===0x0){return db[_0x3071('0x2b')][_0x3071('0x4a')]({'name':_0x2aea37[_0x3071('0x2f')],'resourceId':_0x2aea37['id'],'type':_0x886f7[_0x3071('0x2f')],'sectionId':_0x886f7['id']},{})[_0x3071('0x27')](function(){return _0x577060;});}else{return _0x577060;}})['catch'](function(_0x47a438){logger[_0x3071('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x47a438);throw _0x47a438;});}return _0x577060;})[_0x3071('0x27')](respondWithResult(_0x224a70,0xc9))[_0x3071('0x44')](handleError(_0x224a70,null));};exports[_0x3071('0x26')]=function(_0x514821,_0x1ec428){if(_0x514821[_0x3071('0x4b')]['id']){delete _0x514821['body']['id'];}return db['VoiceMail'][_0x3071('0x4f')]({'where':{'id':_0x514821[_0x3071('0x46')]['id']}})[_0x3071('0x27')](handleEntityNotFound(_0x1ec428,null))[_0x3071('0x27')](saveUpdates(_0x514821['body'],null))[_0x3071('0x27')](respondWithResult(_0x1ec428,null))[_0x3071('0x44')](handleError(_0x1ec428,null));};exports[_0x3071('0x28')]=function(_0x41f02a,_0x123323){return db['VoiceMail'][_0x3071('0x4f')]({'where':{'id':_0x41f02a[_0x3071('0x46')]['id']}})[_0x3071('0x27')](handleEntityNotFound(_0x123323,null))[_0x3071('0x27')](removeEntity(_0x123323,null))[_0x3071('0x44')](handleError(_0x123323,null));};exports[_0x3071('0x52')]=function(_0x71d921,_0x4bea5d,_0x4d6ed0){return db[_0x3071('0x42')]['findOne']({'where':{'id':_0x71d921[_0x3071('0x46')]['id']}})[_0x3071('0x27')](handleEntityNotFound(_0x4bea5d,null))['then'](function(_0x19dc95){var _0x1bf911;var _0x4d3886={},_0x108b14={};_0x108b14[_0x3071('0x34')]=_[_0x3071('0x47')](db[_0x3071('0x53')][_0x3071('0x54')]);_0x108b14['query']=_[_0x3071('0x47')](_0x71d921[_0x3071('0x35')]);_0x108b14[_0x3071('0x36')]=_['intersection'](_0x108b14[_0x3071('0x34')],_0x108b14[_0x3071('0x35')]);_0x4d3886[_0x3071('0x38')]=_[_0x3071('0x37')](_0x108b14[_0x3071('0x34')],qs[_0x3071('0x48')](_0x71d921[_0x3071('0x35')][_0x3071('0x48')]));_0x4d3886[_0x3071('0x38')]=_0x4d3886['attributes'][_0x3071('0x39')]?_0x4d3886[_0x3071('0x38')]:_0x108b14[_0x3071('0x34')];if(!_0x71d921[_0x3071('0x35')][_0x3071('0x3a')](_0x3071('0x3b'))){_0x4d3886[_0x3071('0x20')]=qs[_0x3071('0x20')](_0x71d921[_0x3071('0x35')][_0x3071('0x20')]);_0x4d3886[_0x3071('0x1e')]=qs['offset'](_0x71d921[_0x3071('0x35')][_0x3071('0x1e')]);}_0x4d3886[_0x3071('0x3c')]=qs[_0x3071('0x3d')](_0x71d921[_0x3071('0x35')][_0x3071('0x3d')]);_0x4d3886[_0x3071('0x3e')]=qs[_0x3071('0x36')](_['pick'](_0x71d921[_0x3071('0x35')],_0x108b14[_0x3071('0x36')]));if(_0x71d921['query']['filter']){_0x4d3886[_0x3071('0x3e')]=_[_0x3071('0x41')](_0x4d3886[_0x3071('0x3e')],{'$or':_[_0x3071('0x31')](_0x4d3886['attributes'],function(_0x52955a){var _0x33c39a={};_0x33c39a[_0x52955a]={'$like':'%'+_0x71d921['query']['filter']+'%'};return _0x33c39a;})});}_0x4d3886['where']=_['merge'](_0x4d3886[_0x3071('0x3e')],{'mailboxuser':_0x19dc95[_0x3071('0x55')]});_0x4d3886=_[_0x3071('0x41')]({},_0x4d3886,_0x71d921['options']);return db[_0x3071('0x53')][_0x3071('0x56')](_0x4d3886)[_0x3071('0x27')](respondWithFilteredResult(_0x4bea5d,_0x4d3886));})[_0x3071('0x44')](handleError(_0x4bea5d,null));};
\ No newline at end of file
index 3272387..0af97e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x92b2=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./voiceMail.attributes','exports','define','voice_voicemail','mailbox_context','mailbox','context'];(function(_0x23e3c0,_0x580097){var _0x4925e2=function(_0x3ea787){while(--_0x3ea787){_0x23e3c0['push'](_0x23e3c0['shift']());}};_0x4925e2(++_0x580097);}(_0x92b2,0x69));var _0x292b=function(_0x459335,_0x2e95dd){_0x459335=_0x459335-0x0;var _0x50f00b=_0x92b2[_0x459335];return _0x50f00b;};'use strict';var _=require(_0x292b('0x0'));var util=require(_0x292b('0x1'));var logger=require(_0x292b('0x2'))(_0x292b('0x3'));var moment=require(_0x292b('0x4'));var BPromise=require(_0x292b('0x5'));var rp=require(_0x292b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x292b('0x7'));var attributes=require(_0x292b('0x8'));module[_0x292b('0x9')]=function(_0x48b906,_0x448627){return _0x48b906[_0x292b('0xa')]('VoiceMail',attributes,{'tableName':_0x292b('0xb'),'paranoid':![],'indexes':[{'name':_0x292b('0xc'),'fields':[_0x292b('0xd'),_0x292b('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9482=['mailbox_context','mailbox','context','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./voiceMail.attributes','exports'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x9482,0x9f));var _0x2948=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x9482[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x2948('0x0'));var util=require(_0x2948('0x1'));var logger=require(_0x2948('0x2'))(_0x2948('0x3'));var moment=require(_0x2948('0x4'));var BPromise=require(_0x2948('0x5'));var rp=require(_0x2948('0x6'));var fs=require('fs');var path=require(_0x2948('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2948('0x8'));module[_0x2948('0x9')]=function(_0x14bc88,_0x3f38f0){return _0x14bc88['define']('VoiceMail',attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0x2948('0xa'),'fields':[_0x2948('0xb'),_0x2948('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 81c5ac4..2b4da11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd9d=['../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceMail,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x5cdad2,_0x129d32){var _0x508c9b=function(_0x481bd5){while(--_0x481bd5){_0x5cdad2['push'](_0x5cdad2['shift']());}};_0x508c9b(++_0x129d32);}(_0xdd9d,0xa2));var _0xddd9=function(_0x7c333d,_0x1bc242){_0x7c333d=_0x7c333d-0x0;var _0x1861ca=_0xdd9d[_0x7c333d];return _0x1861ca;};'use strict';var _=require(_0xddd9('0x0'));var util=require(_0xddd9('0x1'));var moment=require(_0xddd9('0x2'));var BPromise=require(_0xddd9('0x3'));var rs=require(_0xddd9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xddd9('0x5'))['db'];var utils=require(_0xddd9('0x6'));var logger=require('../../config/logger')(_0xddd9('0x7'));var config=require(_0xddd9('0x8'));var jayson=require(_0xddd9('0x9'));var client=jayson[_0xddd9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x311df3,_0xdc859b,_0x223b55){return new BPromise(function(_0x11499b,_0x400cb1){return client[_0xddd9('0xb')](_0x311df3,_0x223b55)['then'](function(_0x32eec5){logger[_0xddd9('0xc')]('VoiceMail,\x20%s,\x20%s',_0xdc859b,'request\x20sent');logger['debug'](_0xddd9('0xd'),_0xdc859b,_0xddd9('0xe'),JSON[_0xddd9('0xf')](_0x32eec5));if(_0x32eec5[_0xddd9('0x10')]){if(_0x32eec5[_0xddd9('0x10')][_0xddd9('0x11')]===0x1f4){logger['error'](_0xddd9('0x12'),_0xdc859b,_0x32eec5[_0xddd9('0x10')][_0xddd9('0x13')]);return _0x400cb1(_0x32eec5[_0xddd9('0x10')][_0xddd9('0x13')]);}logger[_0xddd9('0x10')]('VoiceMail,\x20%s,\x20%s',_0xdc859b,_0x32eec5['error'][_0xddd9('0x13')]);return _0x11499b(_0x32eec5[_0xddd9('0x10')][_0xddd9('0x13')]);}else{logger[_0xddd9('0xc')](_0xddd9('0x12'),_0xdc859b,_0xddd9('0xe'));_0x11499b(_0x32eec5['result'][_0xddd9('0x13')]);}})[_0xddd9('0x14')](function(_0x5552a7){logger[_0xddd9('0x10')](_0xddd9('0x12'),_0xdc859b,_0x5552a7);_0x400cb1(_0x5552a7);});});}
\ No newline at end of file
+var _0x0b5c=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMail,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','../../mysqldb'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x0b5c,0x11a));var _0xc0b5=function(_0x4e3b13,_0xdde621){_0x4e3b13=_0x4e3b13-0x0;var _0x30dbfa=_0x0b5c[_0x4e3b13];return _0x30dbfa;};'use strict';var _=require('lodash');var util=require(_0xc0b5('0x0'));var moment=require(_0xc0b5('0x1'));var BPromise=require(_0xc0b5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc0b5('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xc0b5('0x4'))(_0xc0b5('0x5'));var config=require(_0xc0b5('0x6'));var jayson=require(_0xc0b5('0x7'));var client=jayson['client'][_0xc0b5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x223c5e,_0x2b36d9,_0x59f449){return new BPromise(function(_0x3cdaa3,_0xc8b628){return client[_0xc0b5('0x9')](_0x223c5e,_0x59f449)[_0xc0b5('0xa')](function(_0x79fe8d){logger[_0xc0b5('0xb')]('VoiceMail,\x20%s,\x20%s',_0x2b36d9,_0xc0b5('0xc'));logger[_0xc0b5('0xd')](_0xc0b5('0xe'),_0x2b36d9,_0xc0b5('0xc'),JSON[_0xc0b5('0xf')](_0x79fe8d));if(_0x79fe8d[_0xc0b5('0x10')]){if(_0x79fe8d[_0xc0b5('0x10')][_0xc0b5('0x11')]===0x1f4){logger[_0xc0b5('0x10')](_0xc0b5('0x12'),_0x2b36d9,_0x79fe8d[_0xc0b5('0x10')][_0xc0b5('0x13')]);return _0xc8b628(_0x79fe8d['error'][_0xc0b5('0x13')]);}logger[_0xc0b5('0x10')](_0xc0b5('0x12'),_0x2b36d9,_0x79fe8d['error'][_0xc0b5('0x13')]);return _0x3cdaa3(_0x79fe8d[_0xc0b5('0x10')][_0xc0b5('0x13')]);}else{logger[_0xc0b5('0xb')]('VoiceMail,\x20%s,\x20%s',_0x2b36d9,_0xc0b5('0xc'));_0x3cdaa3(_0x79fe8d[_0xc0b5('0x14')][_0xc0b5('0x13')]);}})[_0xc0b5('0x15')](function(_0x5b0971){logger[_0xc0b5('0x10')](_0xc0b5('0x12'),_0x2b36d9,_0x5b0971);_0xc8b628(_0x5b0971);});});}
\ No newline at end of file
index 8377077..d98793e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0fb2=['/:id/download','download','post','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show'];(function(_0x4ce7cd,_0x4f15ad){var _0x301635=function(_0x1e5f6c){while(--_0x1e5f6c){_0x4ce7cd['push'](_0x4ce7cd['shift']());}};_0x301635(++_0x4f15ad);}(_0x0fb2,0x124));var _0x20fb=function(_0x4f3b2d,_0x3bbf46){_0x4f3b2d=_0x4f3b2d-0x0;var _0x3dddfa=_0x0fb2[_0x4f3b2d];return _0x3dddfa;};'use strict';var multer=require(_0x20fb('0x0'));var util=require(_0x20fb('0x1'));var path=require(_0x20fb('0x2'));var timeout=require(_0x20fb('0x3'));var express=require(_0x20fb('0x4'));var router=express[_0x20fb('0x5')]();var fs_extra=require(_0x20fb('0x6'));var auth=require(_0x20fb('0x7'));var interaction=require(_0x20fb('0x8'));var config=require(_0x20fb('0x9'));var controller=require(_0x20fb('0xa'));router[_0x20fb('0xb')]('/',auth[_0x20fb('0xc')](),controller[_0x20fb('0xd')]);router[_0x20fb('0xb')](_0x20fb('0xe'),auth['isAuthenticated'](),controller[_0x20fb('0xf')]);router['get'](_0x20fb('0x10'),auth[_0x20fb('0xc')](),controller[_0x20fb('0x11')]);router[_0x20fb('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x20fb('0x13')](_0x20fb('0xe'),auth['isAuthenticated'](),controller[_0x20fb('0x14')]);router['delete'](_0x20fb('0xe'),auth[_0x20fb('0xc')](),controller[_0x20fb('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x3f20=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','index','/:id','isAuthenticated','show','/:id/download','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x37f044,_0x23c526){var _0x11939f=function(_0x510c5d){while(--_0x510c5d){_0x37f044['push'](_0x37f044['shift']());}};_0x11939f(++_0x23c526);}(_0x3f20,0x165));var _0x03f2=function(_0x1f7e2a,_0x4c7d0c){_0x1f7e2a=_0x1f7e2a-0x0;var _0xb8bf77=_0x3f20[_0x1f7e2a];return _0xb8bf77;};'use strict';var multer=require(_0x03f2('0x0'));var util=require(_0x03f2('0x1'));var path=require(_0x03f2('0x2'));var timeout=require(_0x03f2('0x3'));var express=require(_0x03f2('0x4'));var router=express[_0x03f2('0x5')]();var fs_extra=require(_0x03f2('0x6'));var auth=require(_0x03f2('0x7'));var interaction=require(_0x03f2('0x8'));var config=require(_0x03f2('0x9'));var controller=require(_0x03f2('0xa'));router[_0x03f2('0xb')]('/',auth['isAuthenticated'](),controller[_0x03f2('0xc')]);router[_0x03f2('0xb')](_0x03f2('0xd'),auth[_0x03f2('0xe')](),controller[_0x03f2('0xf')]);router[_0x03f2('0xb')](_0x03f2('0x10'),auth[_0x03f2('0xe')](),controller['download']);router[_0x03f2('0x11')]('/',auth[_0x03f2('0xe')](),controller[_0x03f2('0x12')]);router[_0x03f2('0x13')](_0x03f2('0xd'),auth['isAuthenticated'](),controller[_0x03f2('0x14')]);router[_0x03f2('0x15')](_0x03f2('0xd'),auth[_0x03f2('0xe')](),controller[_0x03f2('0x16')]);module[_0x03f2('0x17')]=router;
\ No newline at end of file
index fdd8971..2ee36bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadfe=['getDataValue','STRING','BLOB','long','TIMESTAMP','sequelize','exports','VIRTUAL'];(function(_0x4b31d9,_0x15097b){var _0x50c359=function(_0x354216){while(--_0x354216){_0x4b31d9['push'](_0x4b31d9['shift']());}};_0x50c359(++_0x15097b);}(_0xadfe,0x6d));var _0xeadf=function(_0x30f9e9,_0x19e973){_0x30f9e9=_0x30f9e9-0x0;var _0x547236=_0xadfe[_0x30f9e9];return _0x547236;};'use strict';var Sequelize=require(_0xeadf('0x0'));module[_0xeadf('0x1')]={'name':{'type':Sequelize[_0xeadf('0x2')],'get':function(_0x570cee){return this[_0xeadf('0x3')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xeadf('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0xeadf('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xeadf('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xeadf('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xeadf('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xeadf('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xeadf('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0xeadf('0x5')](_0xeadf('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0xeadf('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0xeadf('0x7'),'defaultValue':Sequelize['literal']('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}};
\ No newline at end of file
+var _0x1a13=['STRING','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','INTEGER'];(function(_0x4aa4e6,_0x278c45){var _0x322588=function(_0x19279d){while(--_0x19279d){_0x4aa4e6['push'](_0x4aa4e6['shift']());}};_0x322588(++_0x278c45);}(_0x1a13,0xd7));var _0x31a1=function(_0x21f099,_0xc43f62){_0x21f099=_0x21f099-0x0;var _0x48efd3=_0x1a13[_0x21f099];return _0x48efd3;};'use strict';var Sequelize=require(_0x31a1('0x0'));module[_0x31a1('0x1')]={'name':{'type':Sequelize[_0x31a1('0x2')],'get':function(_0x5d8aa8){return this[_0x31a1('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x31a1('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x31a1('0x5')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x31a1('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0x31a1('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0x31a1('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0x31a1('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x31a1('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x31a1('0x5')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x31a1('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x31a1('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x31a1('0x5')],'defaultValue':''},'stamp':{'type':_0x31a1('0x7'),'defaultValue':Sequelize[_0x31a1('0x8')](_0x31a1('0x9'))}};
\ No newline at end of file
index 528d12a..ee8c92c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ecc=['attachment','Content-Disposition','attachment;\x20filename=\x22','eml-format','zip-dir','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','save','update','then','error','stack','name','send','VoiceMailMessage','rawAttributes','key','differenceBy','map','query','filters','intersection','model','fields','attributes','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','destroy','download','recording','msg_id','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav'];(function(_0x59ae8f,_0x148344){var _0x3900b5=function(_0x63af51){while(--_0x63af51){_0x59ae8f['push'](_0x59ae8f['shift']());}};_0x3900b5(++_0x148344);}(_0x7ecc,0xa5));var _0xc7ec=function(_0x150ea0,_0x5c3b68){_0x150ea0=_0x150ea0-0x0;var _0x146049=_0x7ecc[_0x150ea0];return _0x146049;};'use strict';var emlformat=require(_0xc7ec('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc7ec('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc7ec('0x2'));var util=require(_0xc7ec('0x3'));var path=require(_0xc7ec('0x4'));var sox=require(_0xc7ec('0x5'));var csv=require(_0xc7ec('0x6'));var ejs=require(_0xc7ec('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc7ec('0x8'));var squel=require(_0xc7ec('0x9'));var crypto=require('crypto');var jsforce=require(_0xc7ec('0xa'));var deskjs=require(_0xc7ec('0xb'));var toCsv=require(_0xc7ec('0x6'));var querystring=require(_0xc7ec('0xc'));var Papa=require(_0xc7ec('0xd'));var Redis=require(_0xc7ec('0xe'));var authService=require(_0xc7ec('0xf'));var qs=require(_0xc7ec('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc7ec('0x11'));var logger=require(_0xc7ec('0x12'))('api');var utils=require(_0xc7ec('0x13'));var config=require(_0xc7ec('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10706b,_0x19ab12){_0x19ab12=_0x19ab12||0xcc;return function(_0x56d244){if(_0x56d244){return _0x10706b[_0xc7ec('0x15')](_0x19ab12);}return _0x10706b['status'](_0x19ab12)[_0xc7ec('0x16')]();};}function respondWithResult(_0x1220d0,_0x3bd14c){_0x3bd14c=_0x3bd14c||0xc8;return function(_0xda72e6){if(_0xda72e6){return _0x1220d0[_0xc7ec('0x17')](_0x3bd14c)[_0xc7ec('0x18')](_0xda72e6);}};}function respondWithFilteredResult(_0x2ab42d,_0x199778){return function(_0x19ff90){if(_0x19ff90){var _0x5b0299=typeof _0x199778['offset']==='undefined'&&typeof _0x199778['limit']===_0xc7ec('0x19');var _0x5b1163=_0x19ff90[_0xc7ec('0x1a')];var _0x14e80f=_0x5b0299?0x0:_0x199778[_0xc7ec('0x1b')];var _0x42b8ab=_0x5b0299?_0x19ff90[_0xc7ec('0x1a')]:_0x199778[_0xc7ec('0x1b')]+_0x199778[_0xc7ec('0x1c')];var _0x1b242f;if(_0x42b8ab>=_0x5b1163){_0x42b8ab=_0x5b1163;_0x1b242f=0xc8;}else{_0x1b242f=0xce;}_0x2ab42d[_0xc7ec('0x17')](_0x1b242f);return _0x2ab42d[_0xc7ec('0x1d')](_0xc7ec('0x1e'),_0x14e80f+'-'+_0x42b8ab+'/'+_0x5b1163)[_0xc7ec('0x18')](_0x19ff90);}return null;};}function patchUpdates(_0xc1d68a){return function(_0x2d4e1d){try{jsonpatch[_0xc7ec('0x1f')](_0x2d4e1d,_0xc1d68a,!![]);}catch(_0x3f4ac0){return BPromise['reject'](_0x3f4ac0);}return _0x2d4e1d[_0xc7ec('0x20')]();};}function saveUpdates(_0x1d051d,_0x505b71){return function(_0x2c99c8){if(_0x2c99c8){return _0x2c99c8[_0xc7ec('0x21')](_0x1d051d)[_0xc7ec('0x22')](function(_0x39be65){return _0x39be65;});}return null;};}function removeEntity(_0x172e6b,_0x3cde01){return function(_0x3bd920){if(_0x3bd920){return _0x3bd920['destroy']()[_0xc7ec('0x22')](function(){_0x172e6b[_0xc7ec('0x17')](0xcc)[_0xc7ec('0x16')]();});}};}function handleEntityNotFound(_0x2d9097,_0x2ffc2e){return function(_0x5c2885){if(!_0x5c2885){_0x2d9097[_0xc7ec('0x15')](0x194);}return _0x5c2885;};}function handleError(_0x37feb9,_0x1869b6){_0x1869b6=_0x1869b6||0x1f4;return function(_0x104b56){logger[_0xc7ec('0x23')](_0x104b56[_0xc7ec('0x24')]);if(_0x104b56[_0xc7ec('0x25')]){delete _0x104b56['name'];}_0x37feb9['status'](_0x1869b6)[_0xc7ec('0x26')](_0x104b56);};}exports['index']=function(_0x30e184,_0x258324){var _0x43a274={},_0x5501fa={},_0x6d2171={'count':0x0,'rows':[]};var _0x32d712=_['map'](db[_0xc7ec('0x27')][_0xc7ec('0x28')],function(_0x463fb0){return{'name':_0x463fb0['fieldName'],'type':_0x463fb0['type'][_0xc7ec('0x29')]};});_0x5501fa['model']=_[_0xc7ec('0x2a')](_[_0xc7ec('0x2b')](_0x32d712,'name'),[_0xc7ec('0x25')]);_0x5501fa[_0xc7ec('0x2c')]=_['keys'](_0x30e184[_0xc7ec('0x2c')]);_0x5501fa[_0xc7ec('0x2d')]=_[_0xc7ec('0x2e')](_0x5501fa[_0xc7ec('0x2f')],_0x5501fa['query']);_0x43a274['attributes']=_[_0xc7ec('0x2e')](_0x5501fa[_0xc7ec('0x2f')],qs[_0xc7ec('0x30')](_0x30e184['query'][_0xc7ec('0x30')]));_0x43a274[_0xc7ec('0x31')]=_0x43a274[_0xc7ec('0x31')]['length']?_0x43a274[_0xc7ec('0x31')]:_0x5501fa[_0xc7ec('0x2f')];if(!_0x30e184[_0xc7ec('0x2c')]['hasOwnProperty'](_0xc7ec('0x32'))){_0x43a274[_0xc7ec('0x1c')]=qs[_0xc7ec('0x1c')](_0x30e184[_0xc7ec('0x2c')]['limit']);_0x43a274['offset']=qs[_0xc7ec('0x1b')](_0x30e184[_0xc7ec('0x2c')][_0xc7ec('0x1b')]);}_0x43a274[_0xc7ec('0x33')]=qs[_0xc7ec('0x34')](_0x30e184[_0xc7ec('0x2c')][_0xc7ec('0x34')]);_0x43a274[_0xc7ec('0x35')]=qs['filters'](_[_0xc7ec('0x36')](_0x30e184[_0xc7ec('0x2c')],_0x5501fa['filters']),_0x32d712);if(_0x30e184[_0xc7ec('0x2c')]['filter']){_0x43a274[_0xc7ec('0x35')]=_[_0xc7ec('0x37')](_0x43a274[_0xc7ec('0x35')],{'$or':_[_0xc7ec('0x2b')](_0x32d712,function(_0x4b26d8){if(_0x4b26d8[_0xc7ec('0x38')]!==_0xc7ec('0x39')){var _0x93832e={};_0x93832e[_0x4b26d8['name']]={'$like':'%'+_0x30e184[_0xc7ec('0x2c')][_0xc7ec('0x3a')]+'%'};return _0x93832e;}})});}_0x43a274=_[_0xc7ec('0x37')]({},_0x43a274,_0x30e184[_0xc7ec('0x3b')]);var _0x6e75e0={'where':_0x43a274[_0xc7ec('0x35')]};return db[_0xc7ec('0x27')][_0xc7ec('0x1a')](_0x6e75e0)['then'](function(_0x140ae7){_0x6d2171[_0xc7ec('0x1a')]=_0x140ae7;if(_0x30e184[_0xc7ec('0x2c')][_0xc7ec('0x3c')]){_0x43a274[_0xc7ec('0x3d')]=[{'all':!![]}];}return db[_0xc7ec('0x27')][_0xc7ec('0x3e')](_0x43a274);})[_0xc7ec('0x22')](function(_0x5b6342){_0x6d2171[_0xc7ec('0x3f')]=_0x5b6342;return _0x6d2171;})['then'](respondWithFilteredResult(_0x258324,_0x43a274))[_0xc7ec('0x40')](handleError(_0x258324,null));};exports[_0xc7ec('0x41')]=function(_0x2aa005,_0x4280dc){var _0x4771d7={'raw':!![],'where':{'id':_0x2aa005['params']['id']}},_0x354094={};_0x354094[_0xc7ec('0x2f')]=_['keys'](db[_0xc7ec('0x27')][_0xc7ec('0x28')]);_0x354094['query']=_[_0xc7ec('0x42')](_0x2aa005[_0xc7ec('0x2c')]);_0x354094[_0xc7ec('0x2d')]=_[_0xc7ec('0x2e')](_0x354094['model'],_0x354094[_0xc7ec('0x2c')]);_0x4771d7[_0xc7ec('0x31')]=_[_0xc7ec('0x2e')](_0x354094['model'],qs[_0xc7ec('0x30')](_0x2aa005[_0xc7ec('0x2c')][_0xc7ec('0x30')]));_0x4771d7['attributes']=_0x4771d7[_0xc7ec('0x31')]['length']?_0x4771d7[_0xc7ec('0x31')]:_0x354094[_0xc7ec('0x2f')];if(_0x2aa005[_0xc7ec('0x2c')]['includeAll']){_0x4771d7['include']=[{'all':!![]}];}_0x4771d7=_[_0xc7ec('0x37')]({},_0x4771d7,_0x2aa005[_0xc7ec('0x3b')]);return db['VoiceMailMessage'][_0xc7ec('0x43')](_0x4771d7)[_0xc7ec('0x22')](handleEntityNotFound(_0x4280dc,null))['then'](respondWithResult(_0x4280dc,null))[_0xc7ec('0x40')](handleError(_0x4280dc,null));};exports[_0xc7ec('0x44')]=function(_0x4e3d8f,_0x5a4ae9){return db[_0xc7ec('0x27')]['create'](_0x4e3d8f['body'],{})['then'](respondWithResult(_0x5a4ae9,0xc9))[_0xc7ec('0x40')](handleError(_0x5a4ae9,null));};exports['update']=function(_0x20ed39,_0x1d3c79){if(_0x20ed39[_0xc7ec('0x45')]['id']){delete _0x20ed39['body']['id'];}return db[_0xc7ec('0x27')][_0xc7ec('0x43')]({'where':{'id':_0x20ed39[_0xc7ec('0x46')]['id']}})[_0xc7ec('0x22')](handleEntityNotFound(_0x1d3c79,null))[_0xc7ec('0x22')](saveUpdates(_0x20ed39['body'],null))[_0xc7ec('0x22')](respondWithResult(_0x1d3c79,null))[_0xc7ec('0x40')](handleError(_0x1d3c79,null));};exports[_0xc7ec('0x47')]=function(_0x137916,_0x5459f3){return db[_0xc7ec('0x27')]['find']({'where':{'id':_0x137916['params']['id']}})[_0xc7ec('0x22')](handleEntityNotFound(_0x5459f3,null))['then'](removeEntity(_0x5459f3,null))[_0xc7ec('0x40')](handleError(_0x5459f3,null));};exports[_0xc7ec('0x48')]=function(_0x282d09,_0x10552a,_0x13fbe5){return db['VoiceMailMessage'][_0xc7ec('0x43')]({'where':{'id':_0x282d09[_0xc7ec('0x46')]['id']},'attributes':['id',_0xc7ec('0x49'),_0xc7ec('0x4a')]})[_0xc7ec('0x22')](handleEntityNotFound(_0x10552a,null))[_0xc7ec('0x22')](function(_0x54bbcf){if(_0x54bbcf){if(!_0x54bbcf[_0xc7ec('0x49')]){throw new db['Sequelize'][(_0xc7ec('0x4b'))](_0xc7ec('0x4c'));}var _0xbeed51={'Content-Type':_0xc7ec('0x4d'),'Content-Disposition':_0xc7ec('0x4e')};if(_0x54bbcf[_0xc7ec('0x4a')]){_0xbeed51[_0xc7ec('0x4f')]=_0xc7ec('0x50')+_0x54bbcf['msg_id']+'.wav\x22';}_0x10552a['set'](_0xbeed51);return _0x10552a[_0xc7ec('0x26')](new Buffer(_0x54bbcf[_0xc7ec('0x49')]));}})['catch'](handleError(_0x10552a,null));};
\ No newline at end of file
+var _0x4fd0=['find','catch','create','body','update','download','recording','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','attachment','attachment;\x20filename=\x22','.wav\x22','set','send','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','Content-Range','reject','save','error','stack','name','index','map','VoiceMailMessage','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','pick','filter','where','VIRTUAL','merge','options','then','includeAll','findAll','params','include'];(function(_0x346ee7,_0x4c4320){var _0x38be4b=function(_0x10aa76){while(--_0x10aa76){_0x346ee7['push'](_0x346ee7['shift']());}};_0x38be4b(++_0x4c4320);}(_0x4fd0,0x1b4));var _0x04fd=function(_0x4a30cf,_0x312dd4){_0x4a30cf=_0x4a30cf-0x0;var _0x4d975b=_0x4fd0[_0x4a30cf];return _0x4d975b;};'use strict';var emlformat=require(_0x04fd('0x0'));var rimraf=require(_0x04fd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x04fd('0x2'));var rp=require(_0x04fd('0x3'));var moment=require(_0x04fd('0x4'));var BPromise=require(_0x04fd('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x04fd('0x6'));var sox=require(_0x04fd('0x7'));var csv=require('to-csv');var ejs=require(_0x04fd('0x8'));var fs=require('fs');var fs_extra=require(_0x04fd('0x9'));var _=require(_0x04fd('0xa'));var squel=require(_0x04fd('0xb'));var crypto=require(_0x04fd('0xc'));var jsforce=require(_0x04fd('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x04fd('0xe'));var querystring=require(_0x04fd('0xf'));var Papa=require(_0x04fd('0x10'));var Redis=require(_0x04fd('0x11'));var authService=require(_0x04fd('0x12'));var qs=require(_0x04fd('0x13'));var as=require(_0x04fd('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x04fd('0x15'))(_0x04fd('0x16'));var utils=require(_0x04fd('0x17'));var config=require(_0x04fd('0x18'));var licenseUtil=require(_0x04fd('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ff767,_0x17d4ec){_0x17d4ec=_0x17d4ec||0xcc;return function(_0x577e02){if(_0x577e02){return _0x1ff767[_0x04fd('0x1a')](_0x17d4ec);}return _0x1ff767['status'](_0x17d4ec)[_0x04fd('0x1b')]();};}function respondWithResult(_0x5f19be,_0x551850){_0x551850=_0x551850||0xc8;return function(_0x30d427){if(_0x30d427){return _0x5f19be[_0x04fd('0x1c')](_0x551850)[_0x04fd('0x1d')](_0x30d427);}};}function respondWithFilteredResult(_0x2e4d74,_0x2235c9){return function(_0x333a8c){if(_0x333a8c){var _0x172d10=typeof _0x2235c9[_0x04fd('0x1e')]===_0x04fd('0x1f')&&typeof _0x2235c9['limit']===_0x04fd('0x1f');var _0x5b216b=_0x333a8c[_0x04fd('0x20')];var _0x2bd2ab=_0x172d10?0x0:_0x2235c9[_0x04fd('0x1e')];var _0x2558e3=_0x172d10?_0x333a8c[_0x04fd('0x20')]:_0x2235c9['offset']+_0x2235c9['limit'];var _0x398f1d;if(_0x2558e3>=_0x5b216b){_0x2558e3=_0x5b216b;_0x398f1d=0xc8;}else{_0x398f1d=0xce;}_0x2e4d74[_0x04fd('0x1c')](_0x398f1d);return _0x2e4d74['set'](_0x04fd('0x21'),_0x2bd2ab+'-'+_0x2558e3+'/'+_0x5b216b)[_0x04fd('0x1d')](_0x333a8c);}return null;};}function patchUpdates(_0x4ce260){return function(_0x199dd1){try{jsonpatch['apply'](_0x199dd1,_0x4ce260,!![]);}catch(_0x32497d){return BPromise[_0x04fd('0x22')](_0x32497d);}return _0x199dd1[_0x04fd('0x23')]();};}function saveUpdates(_0x5adea7,_0x20c809){return function(_0x3738ea){if(_0x3738ea){return _0x3738ea['update'](_0x5adea7)['then'](function(_0x2aa014){return _0x2aa014;});}return null;};}function removeEntity(_0xb9d2ce,_0x1fa3dc){return function(_0x375b76){if(_0x375b76){return _0x375b76['destroy']()['then'](function(){_0xb9d2ce[_0x04fd('0x1c')](0xcc)[_0x04fd('0x1b')]();});}};}function handleEntityNotFound(_0x26661a,_0x355fab){return function(_0x292dc3){if(!_0x292dc3){_0x26661a[_0x04fd('0x1a')](0x194);}return _0x292dc3;};}function handleError(_0x2e7cf7,_0x5a2af1){_0x5a2af1=_0x5a2af1||0x1f4;return function(_0x51e90f){logger[_0x04fd('0x24')](_0x51e90f[_0x04fd('0x25')]);if(_0x51e90f[_0x04fd('0x26')]){delete _0x51e90f[_0x04fd('0x26')];}_0x2e7cf7[_0x04fd('0x1c')](_0x5a2af1)['send'](_0x51e90f);};}exports[_0x04fd('0x27')]=function(_0x348cee,_0x2f3c86){var _0x19ebdf={},_0x1a3322={},_0x33ba26={'count':0x0,'rows':[]};var _0x3a59c0=_[_0x04fd('0x28')](db[_0x04fd('0x29')][_0x04fd('0x2a')],function(_0x35a68e){return{'name':_0x35a68e['fieldName'],'type':_0x35a68e[_0x04fd('0x2b')][_0x04fd('0x2c')]};});_0x1a3322[_0x04fd('0x2d')]=_['differenceBy'](_[_0x04fd('0x28')](_0x3a59c0,_0x04fd('0x26')),[_0x04fd('0x26')]);_0x1a3322[_0x04fd('0x2e')]=_[_0x04fd('0x2f')](_0x348cee['query']);_0x1a3322[_0x04fd('0x30')]=_[_0x04fd('0x31')](_0x1a3322[_0x04fd('0x2d')],_0x1a3322[_0x04fd('0x2e')]);_0x19ebdf['attributes']=_[_0x04fd('0x31')](_0x1a3322[_0x04fd('0x2d')],qs[_0x04fd('0x32')](_0x348cee[_0x04fd('0x2e')][_0x04fd('0x32')]));_0x19ebdf[_0x04fd('0x33')]=_0x19ebdf[_0x04fd('0x33')][_0x04fd('0x34')]?_0x19ebdf['attributes']:_0x1a3322[_0x04fd('0x2d')];if(!_0x348cee[_0x04fd('0x2e')][_0x04fd('0x35')]('nolimit')){_0x19ebdf[_0x04fd('0x36')]=qs[_0x04fd('0x36')](_0x348cee['query'][_0x04fd('0x36')]);_0x19ebdf[_0x04fd('0x1e')]=qs[_0x04fd('0x1e')](_0x348cee['query'][_0x04fd('0x1e')]);}_0x19ebdf[_0x04fd('0x37')]=qs[_0x04fd('0x38')](_0x348cee[_0x04fd('0x2e')][_0x04fd('0x38')]);_0x19ebdf['where']=qs[_0x04fd('0x30')](_[_0x04fd('0x39')](_0x348cee[_0x04fd('0x2e')],_0x1a3322[_0x04fd('0x30')]),_0x3a59c0);if(_0x348cee['query'][_0x04fd('0x3a')]){_0x19ebdf[_0x04fd('0x3b')]=_['merge'](_0x19ebdf['where'],{'$or':_[_0x04fd('0x28')](_0x3a59c0,function(_0x42e571){if(_0x42e571[_0x04fd('0x2b')]!==_0x04fd('0x3c')){var _0x31f6c8={};_0x31f6c8[_0x42e571[_0x04fd('0x26')]]={'$like':'%'+_0x348cee[_0x04fd('0x2e')][_0x04fd('0x3a')]+'%'};return _0x31f6c8;}})});}_0x19ebdf=_[_0x04fd('0x3d')]({},_0x19ebdf,_0x348cee[_0x04fd('0x3e')]);var _0x505402={'where':_0x19ebdf[_0x04fd('0x3b')]};return db[_0x04fd('0x29')]['count'](_0x505402)[_0x04fd('0x3f')](function(_0x247f33){_0x33ba26['count']=_0x247f33;if(_0x348cee[_0x04fd('0x2e')][_0x04fd('0x40')]){_0x19ebdf['include']=[{'all':!![]}];}return db[_0x04fd('0x29')][_0x04fd('0x41')](_0x19ebdf);})[_0x04fd('0x3f')](function(_0x374b72){_0x33ba26['rows']=_0x374b72;return _0x33ba26;})['then'](respondWithFilteredResult(_0x2f3c86,_0x19ebdf))['catch'](handleError(_0x2f3c86,null));};exports['show']=function(_0x20c151,_0x46a12b){var _0x5820f5={'raw':!![],'where':{'id':_0x20c151[_0x04fd('0x42')]['id']}},_0x4d94db={};_0x4d94db[_0x04fd('0x2d')]=_[_0x04fd('0x2f')](db[_0x04fd('0x29')][_0x04fd('0x2a')]);_0x4d94db[_0x04fd('0x2e')]=_[_0x04fd('0x2f')](_0x20c151[_0x04fd('0x2e')]);_0x4d94db['filters']=_[_0x04fd('0x31')](_0x4d94db[_0x04fd('0x2d')],_0x4d94db['query']);_0x5820f5[_0x04fd('0x33')]=_['intersection'](_0x4d94db['model'],qs[_0x04fd('0x32')](_0x20c151[_0x04fd('0x2e')][_0x04fd('0x32')]));_0x5820f5[_0x04fd('0x33')]=_0x5820f5[_0x04fd('0x33')]['length']?_0x5820f5[_0x04fd('0x33')]:_0x4d94db[_0x04fd('0x2d')];if(_0x20c151[_0x04fd('0x2e')][_0x04fd('0x40')]){_0x5820f5[_0x04fd('0x43')]=[{'all':!![]}];}_0x5820f5=_[_0x04fd('0x3d')]({},_0x5820f5,_0x20c151['options']);return db['VoiceMailMessage'][_0x04fd('0x44')](_0x5820f5)[_0x04fd('0x3f')](handleEntityNotFound(_0x46a12b,null))[_0x04fd('0x3f')](respondWithResult(_0x46a12b,null))[_0x04fd('0x45')](handleError(_0x46a12b,null));};exports[_0x04fd('0x46')]=function(_0xb178e4,_0x490a82){return db[_0x04fd('0x29')][_0x04fd('0x46')](_0xb178e4[_0x04fd('0x47')],{})[_0x04fd('0x3f')](respondWithResult(_0x490a82,0xc9))['catch'](handleError(_0x490a82,null));};exports[_0x04fd('0x48')]=function(_0x3a046a,_0x152217){if(_0x3a046a[_0x04fd('0x47')]['id']){delete _0x3a046a['body']['id'];}return db[_0x04fd('0x29')][_0x04fd('0x44')]({'where':{'id':_0x3a046a[_0x04fd('0x42')]['id']}})[_0x04fd('0x3f')](handleEntityNotFound(_0x152217,null))[_0x04fd('0x3f')](saveUpdates(_0x3a046a[_0x04fd('0x47')],null))[_0x04fd('0x3f')](respondWithResult(_0x152217,null))[_0x04fd('0x45')](handleError(_0x152217,null));};exports['destroy']=function(_0x1d0e14,_0x4a622c){return db[_0x04fd('0x29')]['find']({'where':{'id':_0x1d0e14[_0x04fd('0x42')]['id']}})[_0x04fd('0x3f')](handleEntityNotFound(_0x4a622c,null))[_0x04fd('0x3f')](removeEntity(_0x4a622c,null))[_0x04fd('0x45')](handleError(_0x4a622c,null));};exports[_0x04fd('0x49')]=function(_0x297cf1,_0x214a88,_0x2288b9){return db['VoiceMailMessage'][_0x04fd('0x44')]({'where':{'id':_0x297cf1[_0x04fd('0x42')]['id']},'attributes':['id',_0x04fd('0x4a'),_0x04fd('0x4b')]})[_0x04fd('0x3f')](handleEntityNotFound(_0x214a88,null))['then'](function(_0x1a8ced){if(_0x1a8ced){if(!_0x1a8ced[_0x04fd('0x4a')]){throw new db[(_0x04fd('0x4c'))]['ValidationError'](_0x04fd('0x4d'));}var _0x35dbd2={'Content-Type':_0x04fd('0x4e'),'Content-Disposition':_0x04fd('0x4f')};if(_0x1a8ced['msg_id']){_0x35dbd2['Content-Disposition']=_0x04fd('0x50')+_0x1a8ced[_0x04fd('0x4b')]+_0x04fd('0x51');}_0x214a88[_0x04fd('0x52')](_0x35dbd2);return _0x214a88[_0x04fd('0x53')](new Buffer(_0x1a8ced[_0x04fd('0x4a')]));}})[_0x04fd('0x45')](handleError(_0x214a88,null));};
\ No newline at end of file
index 8217a3f..4656ce7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0515=['moment','bluebird','request-promise','path','../../config/environment','./voiceMailMessage.attributes','exports','VoiceMailMessage','voice_voicemail_messages','dir','lodash','../../config/logger'];(function(_0x28ca5d,_0x470481){var _0x3c4124=function(_0x29f72e){while(--_0x29f72e){_0x28ca5d['push'](_0x28ca5d['shift']());}};_0x3c4124(++_0x470481);}(_0x0515,0x196));var _0x5051=function(_0x20afc3,_0x2f189a){_0x20afc3=_0x20afc3-0x0;var _0x4cbb43=_0x0515[_0x20afc3];return _0x4cbb43;};'use strict';var _=require(_0x5051('0x0'));var util=require('util');var logger=require(_0x5051('0x1'))('api');var moment=require(_0x5051('0x2'));var BPromise=require(_0x5051('0x3'));var rp=require(_0x5051('0x4'));var fs=require('fs');var path=require(_0x5051('0x5'));var rimraf=require('rimraf');var config=require(_0x5051('0x6'));var attributes=require(_0x5051('0x7'));module[_0x5051('0x8')]=function(_0x1b1940,_0x3cd79f){return _0x1b1940['define'](_0x5051('0x9'),attributes,{'tableName':_0x5051('0xa'),'paranoid':![],'indexes':[{'name':_0x5051('0xb'),'fields':['dir']}],'timestamps':![]});};
\ No newline at end of file
+var _0xa618=['path','rimraf','./voiceMailMessage.attributes','define','voice_voicemail_messages','dir','lodash','api'];(function(_0x1293fa,_0x446d6b){var _0x1dd054=function(_0x1b2d93){while(--_0x1b2d93){_0x1293fa['push'](_0x1293fa['shift']());}};_0x1dd054(++_0x446d6b);}(_0xa618,0x13e));var _0x8a61=function(_0x46bd1e,_0x27dd1d){_0x46bd1e=_0x46bd1e-0x0;var _0x272354=_0xa618[_0x46bd1e];return _0x272354;};'use strict';var _=require(_0x8a61('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8a61('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8a61('0x2'));var rimraf=require(_0x8a61('0x3'));var config=require('../../config/environment');var attributes=require(_0x8a61('0x4'));module['exports']=function(_0x1017c5,_0x449b4e){return _0x1017c5[_0x8a61('0x5')]('VoiceMailMessage',attributes,{'tableName':_0x8a61('0x6'),'paranoid':![],'indexes':[{'name':_0x8a61('0x7'),'fields':[_0x8a61('0x7')]}],'timestamps':![]});};
\ No newline at end of file
index 9a3c39a..332359e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa1ef=['util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x23e4cf,_0x12704d){var _0x2bd35a=function(_0xaa827a){while(--_0xaa827a){_0x23e4cf['push'](_0x23e4cf['shift']());}};_0x2bd35a(++_0x12704d);}(_0xa1ef,0x179));var _0xfa1e=function(_0xc72a72,_0xfaaf35){_0xc72a72=_0xc72a72-0x0;var _0x20f9a9=_0xa1ef[_0xc72a72];return _0x20f9a9;};'use strict';var _=require(_0xfa1e('0x0'));var util=require(_0xfa1e('0x1'));var moment=require(_0xfa1e('0x2'));var BPromise=require('bluebird');var rs=require(_0xfa1e('0x3'));var fs=require('fs');var Redis=require(_0xfa1e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfa1e('0x5'))(_0xfa1e('0x6'));var config=require(_0xfa1e('0x7'));var jayson=require(_0xfa1e('0x8'));var client=jayson['client'][_0xfa1e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16a729,_0x2253bd,_0x19b9ee){return new BPromise(function(_0x1f6775,_0x5eb0a9){return client['request'](_0x16a729,_0x19b9ee)[_0xfa1e('0xa')](function(_0x49c779){logger[_0xfa1e('0xb')](_0xfa1e('0xc'),_0x2253bd,_0xfa1e('0xd'));logger[_0xfa1e('0xe')](_0xfa1e('0xf'),_0x2253bd,'request\x20sent',JSON['stringify'](_0x49c779));if(_0x49c779[_0xfa1e('0x10')]){if(_0x49c779[_0xfa1e('0x10')][_0xfa1e('0x11')]===0x1f4){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x2253bd,_0x49c779[_0xfa1e('0x10')][_0xfa1e('0x12')]);return _0x5eb0a9(_0x49c779[_0xfa1e('0x10')][_0xfa1e('0x12')]);}logger[_0xfa1e('0x10')](_0xfa1e('0xc'),_0x2253bd,_0x49c779[_0xfa1e('0x10')][_0xfa1e('0x12')]);return _0x1f6775(_0x49c779[_0xfa1e('0x10')]['message']);}else{logger['info'](_0xfa1e('0xc'),_0x2253bd,_0xfa1e('0xd'));_0x1f6775(_0x49c779[_0xfa1e('0x13')][_0xfa1e('0x12')]);}})[_0xfa1e('0x14')](function(_0x1393c1){logger['error'](_0xfa1e('0xc'),_0x2253bd,_0x1393c1);_0x5eb0a9(_0x1393c1);});});}
\ No newline at end of file
+var _0xc467=['message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2c64d5,_0x42c433){var _0x667065=function(_0x26a3a0){while(--_0x26a3a0){_0x2c64d5['push'](_0x2c64d5['shift']());}};_0x667065(++_0x42c433);}(_0xc467,0x10b));var _0x7c46=function(_0xad57ee,_0x2823a6){_0xad57ee=_0xad57ee-0x0;var _0x3eaea9=_0xc467[_0xad57ee];return _0x3eaea9;};'use strict';var _=require(_0x7c46('0x0'));var util=require('util');var moment=require(_0x7c46('0x1'));var BPromise=require(_0x7c46('0x2'));var rs=require(_0x7c46('0x3'));var fs=require('fs');var Redis=require(_0x7c46('0x4'));var db=require(_0x7c46('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7c46('0x6'));var config=require(_0x7c46('0x7'));var jayson=require(_0x7c46('0x8'));var client=jayson[_0x7c46('0x9')][_0x7c46('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d5ae1,_0xf47626,_0x30dc0d){return new BPromise(function(_0x4dbcf5,_0x2e46e8){return client[_0x7c46('0xb')](_0x4d5ae1,_0x30dc0d)[_0x7c46('0xc')](function(_0x2bcfa4){logger['info'](_0x7c46('0xd'),_0xf47626,_0x7c46('0xe'));logger['debug'](_0x7c46('0xf'),_0xf47626,_0x7c46('0xe'),JSON[_0x7c46('0x10')](_0x2bcfa4));if(_0x2bcfa4[_0x7c46('0x11')]){if(_0x2bcfa4[_0x7c46('0x11')][_0x7c46('0x12')]===0x1f4){logger['error'](_0x7c46('0xd'),_0xf47626,_0x2bcfa4['error'][_0x7c46('0x13')]);return _0x2e46e8(_0x2bcfa4[_0x7c46('0x11')][_0x7c46('0x13')]);}logger[_0x7c46('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0xf47626,_0x2bcfa4[_0x7c46('0x11')][_0x7c46('0x13')]);return _0x4dbcf5(_0x2bcfa4[_0x7c46('0x11')][_0x7c46('0x13')]);}else{logger['info'](_0x7c46('0xd'),_0xf47626,'request\x20sent');_0x4dbcf5(_0x2bcfa4[_0x7c46('0x14')][_0x7c46('0x13')]);}})[_0x7c46('0x15')](function(_0x5b736b){logger[_0x7c46('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0xf47626,_0x5b736b);_0x2e46e8(_0x5b736b);});});}
\ No newline at end of file
index 0c56722..4e2720a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0db4=['express','Router','fs-extra','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','/:id','show','/:id/sounds','getSounds','create','post','put','update','delete','/:id/sounds/:id2','removeSound','exports','multer','util','path','connect-timeout'];(function(_0x107602,_0x53b024){var _0x5ad7de=function(_0x32e278){while(--_0x32e278){_0x107602['push'](_0x107602['shift']());}};_0x5ad7de(++_0x53b024);}(_0x0db4,0x127));var _0x40db=function(_0x14fad0,_0x278d75){_0x14fad0=_0x14fad0-0x0;var _0x5c665f=_0x0db4[_0x14fad0];return _0x5c665f;};'use strict';var multer=require(_0x40db('0x0'));var util=require(_0x40db('0x1'));var path=require(_0x40db('0x2'));var timeout=require(_0x40db('0x3'));var express=require(_0x40db('0x4'));var router=express[_0x40db('0x5')]();var fs_extra=require(_0x40db('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x40db('0x7'));var controller=require(_0x40db('0x8'));router[_0x40db('0x9')]('/',auth[_0x40db('0xa')](),controller['index']);router['get'](_0x40db('0xb'),auth[_0x40db('0xa')](),controller[_0x40db('0xc')]);router[_0x40db('0x9')](_0x40db('0xd'),auth[_0x40db('0xa')](),controller[_0x40db('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x40db('0xf')]);router[_0x40db('0x10')](_0x40db('0xd'),auth[_0x40db('0xa')](),controller['addSound']);router[_0x40db('0x11')](_0x40db('0xb'),auth['isAuthenticated'](),controller[_0x40db('0x12')]);router[_0x40db('0x13')](_0x40db('0xb'),auth[_0x40db('0xa')](),controller['destroy']);router['delete'](_0x40db('0x14'),auth[_0x40db('0xa')](),controller[_0x40db('0x15')]);module[_0x40db('0x16')]=router;
\ No newline at end of file
+var _0x0203=['isAuthenticated','post','update','delete','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./voiceMusicOnHold.controller','get','/:id','/:id/sounds'];(function(_0x5e4cfd,_0x50f345){var _0x59c628=function(_0x499f93){while(--_0x499f93){_0x5e4cfd['push'](_0x5e4cfd['shift']());}};_0x59c628(++_0x50f345);}(_0x0203,0x112));var _0x3020=function(_0x3dc20d,_0x24d2b3){_0x3dc20d=_0x3dc20d-0x0;var _0x1da320=_0x0203[_0x3dc20d];return _0x1da320;};'use strict';var multer=require(_0x3020('0x0'));var util=require(_0x3020('0x1'));var path=require(_0x3020('0x2'));var timeout=require('connect-timeout');var express=require(_0x3020('0x3'));var router=express[_0x3020('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3020('0x5'));var interaction=require(_0x3020('0x6'));var config=require('../../config/environment');var controller=require(_0x3020('0x7'));router[_0x3020('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3020('0x8')](_0x3020('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x3020('0x8')](_0x3020('0xa'),auth[_0x3020('0xb')](),controller['getSounds']);router[_0x3020('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3020('0xc')](_0x3020('0xa'),auth['isAuthenticated'](),controller['addSound']);router['put'](_0x3020('0x9'),auth[_0x3020('0xb')](),controller[_0x3020('0xd')]);router[_0x3020('0xe')](_0x3020('0x9'),auth[_0x3020('0xb')](),controller['destroy']);router[_0x3020('0xe')]('/:id/sounds/:id2',auth[_0x3020('0xb')](),controller['removeSound']);module['exports']=router;
\ No newline at end of file
index 3c29e14..6d70eb2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d37=['quietmp3','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','ENUM','custom','files','quietmp3nb'];(function(_0xcda377,_0x1e2678){var _0x1c024f=function(_0x1aeb61){while(--_0x1aeb61){_0xcda377['push'](_0xcda377['shift']());}};_0x1c024f(++_0x1e2678);}(_0x3d37,0x16f));var _0x73d3=function(_0x48db87,_0x2c074a){_0x48db87=_0x48db87-0x0;var _0x489322=_0x3d37[_0x48db87];return _0x489322;};'use strict';var Sequelize=require(_0x73d3('0x0'));module[_0x73d3('0x1')]={'name':{'type':Sequelize[_0x73d3('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x73d3('0x3')](_0x73d3('0x4'),_0x73d3('0x5'),'mp3nb',_0x73d3('0x6'),_0x73d3('0x7'),'mp3'),'allowNull':!![],'defaultValue':_0x73d3('0x5')},'directory':{'type':Sequelize[_0x73d3('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x73d3('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x73d3('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x73d3('0x2')],'allowNull':!![],'defaultValue':_0x73d3('0x8')},'format':{'type':Sequelize[_0x73d3('0x2')],'allowNull':!![]},'stamp':{'type':_0x73d3('0x9')},'defaultEntry':{'type':Sequelize[_0x73d3('0xa')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xb141=['STRING','name','ENUM','custom','mp3nb','quietmp3nb','quietmp3','mp3','files','BOOLEAN','sequelize'];(function(_0x3c690b,_0x4177f9){var _0x5da1bf=function(_0x94e093){while(--_0x94e093){_0x3c690b['push'](_0x3c690b['shift']());}};_0x5da1bf(++_0x4177f9);}(_0xb141,0xc5));var _0x1b14=function(_0x1ca4f9,_0x590da9){_0x1ca4f9=_0x1ca4f9-0x0;var _0x4968be=_0xb141[_0x1ca4f9];return _0x4968be;};'use strict';var Sequelize=require(_0x1b14('0x0'));module['exports']={'name':{'type':Sequelize[_0x1b14('0x1')],'allowNull':![],'unique':_0x1b14('0x2')},'mode':{'type':Sequelize[_0x1b14('0x3')](_0x1b14('0x4'),'files',_0x1b14('0x5'),_0x1b14('0x6'),_0x1b14('0x7'),_0x1b14('0x8')),'allowNull':!![],'defaultValue':_0x1b14('0x9')},'directory':{'type':Sequelize[_0x1b14('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x1b14('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x1b14('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x1b14('0x1')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x1b14('0x1')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0x1b14('0xa')],'defaultValue':0x0}};
\ No newline at end of file
index 4c2374c..4f20f15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b67=['../../config/logger','api','../../config/environment','sendStatus','status','offset','limit','undefined','count','Content-Range','reject','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','end','stack','send','index','map','rawAttributes','fieldName','type','model','name','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','VoiceMusicOnHold','includeAll','include','catch','show','params','length','body','create','sequelize','mode','directory','join','root','mkdirSync','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','transaction','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','server/files/moh','removeSound','id2','getSounds','hasOwnProperty','eml-format','zip-dir','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'];(function(_0x1773fc,_0x31fb9f){var _0x4857c8=function(_0x4ad201){while(--_0x4ad201){_0x1773fc['push'](_0x1773fc['shift']());}};_0x4857c8(++_0x31fb9f);}(_0x4b67,0xc8));var _0x74b6=function(_0x2a31eb,_0x312ccd){_0x2a31eb=_0x2a31eb-0x0;var _0x11a25a=_0x4b67[_0x2a31eb];return _0x11a25a;};'use strict';var emlformat=require(_0x74b6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x74b6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x74b6('0x2'));var moment=require(_0x74b6('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x74b6('0x4'));var util=require('util');var path=require(_0x74b6('0x5'));var sox=require('sox');var csv=require(_0x74b6('0x6'));var ejs=require(_0x74b6('0x7'));var fs=require('fs');var fs_extra=require(_0x74b6('0x8'));var _=require(_0x74b6('0x9'));var squel=require(_0x74b6('0xa'));var crypto=require(_0x74b6('0xb'));var jsforce=require(_0x74b6('0xc'));var deskjs=require(_0x74b6('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x74b6('0xe'));var authService=require(_0x74b6('0xf'));var qs=require(_0x74b6('0x10'));var as=require(_0x74b6('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x74b6('0x12'))(_0x74b6('0x13'));var utils=require('../../config/utils');var config=require(_0x74b6('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x321b08,_0x291185){_0x291185=_0x291185||0xcc;return function(_0x18f6aa){if(_0x18f6aa){return _0x321b08[_0x74b6('0x15')](_0x291185);}return _0x321b08['status'](_0x291185)['end']();};}function respondWithResult(_0x596cd0,_0x3d145a){_0x3d145a=_0x3d145a||0xc8;return function(_0xae7b29){if(_0xae7b29){return _0x596cd0[_0x74b6('0x16')](_0x3d145a)['json'](_0xae7b29);}};}function respondWithFilteredResult(_0x5ef0a5,_0x2e2a4f){return function(_0x334a46){if(_0x334a46){var _0x356d31=typeof _0x2e2a4f[_0x74b6('0x17')]==='undefined'&&typeof _0x2e2a4f[_0x74b6('0x18')]===_0x74b6('0x19');var _0x3c8bc8=_0x334a46['count'];var _0x3046fd=_0x356d31?0x0:_0x2e2a4f[_0x74b6('0x17')];var _0x5e1935=_0x356d31?_0x334a46[_0x74b6('0x1a')]:_0x2e2a4f[_0x74b6('0x17')]+_0x2e2a4f[_0x74b6('0x18')];var _0x3316ea;if(_0x5e1935>=_0x3c8bc8){_0x5e1935=_0x3c8bc8;_0x3316ea=0xc8;}else{_0x3316ea=0xce;}_0x5ef0a5[_0x74b6('0x16')](_0x3316ea);return _0x5ef0a5['set'](_0x74b6('0x1b'),_0x3046fd+'-'+_0x5e1935+'/'+_0x3c8bc8)['json'](_0x334a46);}return null;};}function patchUpdates(_0x43dd93){return function(_0x7aaad7){try{jsonpatch['apply'](_0x7aaad7,_0x43dd93,!![]);}catch(_0x4ec9cf){return BPromise[_0x74b6('0x1c')](_0x4ec9cf);}return _0x7aaad7[_0x74b6('0x1d')]();};}function saveUpdates(_0x43df5b,_0x2e8c51){return function(_0xaccf7){if(_0xaccf7){return _0xaccf7[_0x74b6('0x1e')](_0x43df5b)[_0x74b6('0x1f')](function(_0x532817){return _0x532817;});}return null;};}function removeEntity(_0xe86dcf,_0x16bc97){return function(_0x23fafc){if(_0x23fafc){return _0x23fafc[_0x74b6('0x20')]()[_0x74b6('0x1f')](function(){var _0x57e895=_0x23fafc[_0x74b6('0x21')]({'plain':!![]});var _0xa80699=_0x74b6('0x22');return db[_0x74b6('0x23')][_0x74b6('0x20')]({'where':{'type':_0xa80699,'resourceId':_0x57e895['id']}})[_0x74b6('0x1f')](function(){return _0x23fafc;});})[_0x74b6('0x1f')](function(){_0xe86dcf[_0x74b6('0x16')](0xcc)[_0x74b6('0x24')]();});}};}function handleEntityNotFound(_0x5216e8,_0x1c6921){return function(_0x2fa0c7){if(!_0x2fa0c7){_0x5216e8[_0x74b6('0x15')](0x194);}return _0x2fa0c7;};}function handleError(_0x5d8160,_0xf1054){_0xf1054=_0xf1054||0x1f4;return function(_0x2024ad){logger['error'](_0x2024ad[_0x74b6('0x25')]);if(_0x2024ad['name']){delete _0x2024ad['name'];}_0x5d8160[_0x74b6('0x16')](_0xf1054)[_0x74b6('0x26')](_0x2024ad);};}exports[_0x74b6('0x27')]=function(_0x533edf,_0x4e87e7){var _0x148273={},_0x5a23c1={},_0x3cc607={'count':0x0,'rows':[]};var _0x59686e=_[_0x74b6('0x28')](db['VoiceMusicOnHold'][_0x74b6('0x29')],function(_0x43c352){return{'name':_0x43c352[_0x74b6('0x2a')],'type':_0x43c352[_0x74b6('0x2b')]['key']};});_0x5a23c1[_0x74b6('0x2c')]=_[_0x74b6('0x28')](_0x59686e,_0x74b6('0x2d'));_0x5a23c1[_0x74b6('0x2e')]=_[_0x74b6('0x2f')](_0x533edf[_0x74b6('0x2e')]);_0x5a23c1[_0x74b6('0x30')]=_['intersection'](_0x5a23c1[_0x74b6('0x2c')],_0x5a23c1[_0x74b6('0x2e')]);_0x148273[_0x74b6('0x31')]=_[_0x74b6('0x32')](_0x5a23c1[_0x74b6('0x2c')],qs[_0x74b6('0x33')](_0x533edf[_0x74b6('0x2e')][_0x74b6('0x33')]));_0x148273[_0x74b6('0x31')]=_0x148273[_0x74b6('0x31')]['length']?_0x148273[_0x74b6('0x31')]:_0x5a23c1['model'];if(!_0x533edf['query']['hasOwnProperty'](_0x74b6('0x34'))){_0x148273[_0x74b6('0x18')]=qs['limit'](_0x533edf[_0x74b6('0x2e')][_0x74b6('0x18')]);_0x148273[_0x74b6('0x17')]=qs[_0x74b6('0x17')](_0x533edf[_0x74b6('0x2e')]['offset']);}_0x148273[_0x74b6('0x35')]=qs['sort'](_0x533edf[_0x74b6('0x2e')][_0x74b6('0x36')]);delete _0x533edf['query'][_0x74b6('0x36')];_0x148273['where']=qs[_0x74b6('0x30')](_[_0x74b6('0x37')](_0x533edf[_0x74b6('0x2e')],_0x5a23c1['filters']),_0x59686e);if(_0x533edf['query'][_0x74b6('0x38')]){_0x148273[_0x74b6('0x39')]=_[_0x74b6('0x3a')](_0x148273['where'],{'$or':_[_0x74b6('0x28')](_0x59686e,function(_0x4abdd1){if(_0x4abdd1[_0x74b6('0x2b')]!==_0x74b6('0x3b')){var _0x27a2f2={};_0x27a2f2[_0x4abdd1['name']]={'$like':'%'+_0x533edf[_0x74b6('0x2e')][_0x74b6('0x38')]+'%'};return _0x27a2f2;}})});}_0x148273=_[_0x74b6('0x3a')]({},_0x148273,_0x533edf[_0x74b6('0x3c')]);var _0x662348={'where':_0x148273[_0x74b6('0x39')]};return db[_0x74b6('0x3d')][_0x74b6('0x1a')](_0x662348)[_0x74b6('0x1f')](function(_0xdc3cd5){_0x3cc607['count']=_0xdc3cd5;if(_0x533edf['query'][_0x74b6('0x3e')]){_0x148273[_0x74b6('0x3f')]=[{'all':!![]}];}return db[_0x74b6('0x3d')]['findAll'](_0x148273);})['then'](function(_0x4f45b4){_0x3cc607['rows']=_0x4f45b4;return _0x3cc607;})[_0x74b6('0x1f')](respondWithFilteredResult(_0x4e87e7,_0x148273))[_0x74b6('0x40')](handleError(_0x4e87e7,null));};exports[_0x74b6('0x41')]=function(_0x49ae5d,_0x2358e8){var _0x38fe8c={'raw':![],'where':{'id':_0x49ae5d[_0x74b6('0x42')]['id']}},_0x4a06c8={};_0x4a06c8[_0x74b6('0x2c')]=_[_0x74b6('0x2f')](db[_0x74b6('0x3d')][_0x74b6('0x29')]);_0x4a06c8[_0x74b6('0x2e')]=_[_0x74b6('0x2f')](_0x49ae5d[_0x74b6('0x2e')]);_0x4a06c8['filters']=_[_0x74b6('0x32')](_0x4a06c8['model'],_0x4a06c8['query']);_0x38fe8c[_0x74b6('0x31')]=_[_0x74b6('0x32')](_0x4a06c8[_0x74b6('0x2c')],qs[_0x74b6('0x33')](_0x49ae5d['query'][_0x74b6('0x33')]));_0x38fe8c['attributes']=_0x38fe8c[_0x74b6('0x31')][_0x74b6('0x43')]?_0x38fe8c[_0x74b6('0x31')]:_0x4a06c8[_0x74b6('0x2c')];if(_0x49ae5d[_0x74b6('0x2e')][_0x74b6('0x3e')]){_0x38fe8c[_0x74b6('0x3f')]=[{'all':!![]}];}_0x38fe8c=_[_0x74b6('0x3a')]({},_0x38fe8c,_0x49ae5d['options']);return db['VoiceMusicOnHold']['find'](_0x38fe8c)['then'](handleEntityNotFound(_0x2358e8,null))[_0x74b6('0x1f')](respondWithResult(_0x2358e8,null))[_0x74b6('0x40')](handleError(_0x2358e8,null));};exports[_0x74b6('0x1e')]=function(_0x337c07,_0x2c5755){if(_0x337c07['body']['id']){delete _0x337c07[_0x74b6('0x44')]['id'];}return db[_0x74b6('0x3d')]['find']({'where':{'id':_0x337c07[_0x74b6('0x42')]['id']}})['then'](handleEntityNotFound(_0x2c5755,null))[_0x74b6('0x1f')](saveUpdates(_0x337c07['body'],null))['then'](respondWithResult(_0x2c5755,null))[_0x74b6('0x40')](handleError(_0x2c5755,null));};exports[_0x74b6('0x45')]=function(_0x40230b,_0x367b59,_0x103730){return db[_0x74b6('0x46')]['transaction'](function(_0x327b54){if(_0x40230b[_0x74b6('0x44')][_0x74b6('0x47')]==='files'){_0x40230b['body'][_0x74b6('0x48')]=path[_0x74b6('0x49')](config[_0x74b6('0x4a')],'server/files/moh',_0x40230b[_0x74b6('0x44')]['name']);}return db[_0x74b6('0x3d')]['create'](_0x40230b[_0x74b6('0x44')],{'transaction':_0x327b54})[_0x74b6('0x1f')](function(_0x581181){if(_0x40230b['body'][_0x74b6('0x47')]==='files'){fs[_0x74b6('0x4b')](_0x581181['directory'],parseInt(_0x74b6('0x4c'),0x8));}var _0x3fe538=_0x40230b['user'][_0x74b6('0x21')]({'plain':!![]});if(!_0x3fe538)throw new Error(_0x74b6('0x4d'));if(_0x3fe538[_0x74b6('0x4e')]===_0x74b6('0x4f')){var _0x3d4cc1=_0x581181[_0x74b6('0x21')]({'plain':!![]});return db[_0x74b6('0x50')]['find']({'where':{'name':'MusicOnHolds','userProfileId':_0x3fe538[_0x74b6('0x51')]},'raw':!![]})[_0x74b6('0x1f')](function(_0x4e194b){if(_0x4e194b&&_0x4e194b[_0x74b6('0x52')]===0x0){return db[_0x74b6('0x23')][_0x74b6('0x45')]({'name':_0x3d4cc1[_0x74b6('0x2d')],'resourceId':_0x3d4cc1['id'],'type':_0x4e194b['name'],'sectionId':_0x4e194b['id']},{})['then'](function(){return _0x581181;});}else{return _0x581181;}})[_0x74b6('0x40')](function(_0x339a9d){logger['error'](_0x74b6('0x53'),_0x339a9d);});}return _0x581181;});})['then'](respondWithResult(_0x367b59,0xc9))[_0x74b6('0x40')](handleError(_0x367b59,null));};exports[_0x74b6('0x20')]=function(_0x63cdf4,_0x2aa177,_0x4da196){var _0x1d5c15;return db['VoiceMusicOnHold'][_0x74b6('0x54')]({'where':{'id':_0x63cdf4[_0x74b6('0x42')]['id']}})[_0x74b6('0x1f')](function(_0x3cfd21){if(_0x3cfd21){return db[_0x74b6('0x46')][_0x74b6('0x55')](function(_0x3393b7){return _0x3cfd21[_0x74b6('0x20')]({'transaction':_0x3393b7,'raw':!![]})[_0x74b6('0x1f')](function(_0x44f7f5){if(_0x44f7f5[_0x74b6('0x48')]){fs[_0x74b6('0x56')](_0x44f7f5['directory'])[_0x74b6('0x57')](function(_0x54fcaa){fs[_0x74b6('0x58')](path['join'](_0x44f7f5[_0x74b6('0x48')],_0x54fcaa));});fs[_0x74b6('0x59')](_0x44f7f5[_0x74b6('0x48')]);}return _0x44f7f5;});})[_0x74b6('0x40')](function(_0x3f551a){throw new db[(_0x74b6('0x5a'))][(_0x74b6('0x5b'))](_0x3f551a[_0x74b6('0x5c')]);});}})[_0x74b6('0x1f')](handleEntityNotFound(_0x2aa177,null))[_0x74b6('0x1f')](removeEntity(_0x2aa177,null))[_0x74b6('0x40')](handleError(_0x2aa177,null));};exports[_0x74b6('0x5d')]=function(_0x5b9ed7,_0x403056,_0x403add){return db[_0x74b6('0x46')][_0x74b6('0x55')](function(_0x2eedf9){var _0x65fea1;return db[_0x74b6('0x3d')][_0x74b6('0x54')]({'where':{'id':_0x5b9ed7[_0x74b6('0x42')]['id']}})[_0x74b6('0x1f')](function(_0x57857e){if(_0x57857e){_0x65fea1=_0x57857e;return _0x57857e[_0x74b6('0x5d')](_0x5b9ed7[_0x74b6('0x44')]['id'],{'transaction':_0x2eedf9});}})[_0x74b6('0x1f')](function(_0x4a0336){if(_0x4a0336){return db[_0x74b6('0x5e')][_0x74b6('0x5f')]({'where':{'id':_0x5b9ed7[_0x74b6('0x44')]['id']},'attributes':['id','name',_0x74b6('0x60'),_0x74b6('0x61'),_0x74b6('0x62')],'raw':!![]});}})[_0x74b6('0x1f')](function(_0x49574e){if(_0x49574e){var _0x301f53=path[_0x74b6('0x49')](config[_0x74b6('0x4a')],_0x74b6('0x63'),util[_0x74b6('0x64')](_0x74b6('0x65'),path[_0x74b6('0x66')](_0x49574e[_0x74b6('0x60')],path[_0x74b6('0x67')](_0x49574e['save_name'])),_0x49574e['converted_format']));var _0x3e35bf=path[_0x74b6('0x49')](config['root'],_0x74b6('0x68'),_0x65fea1[_0x74b6('0x2d')],util[_0x74b6('0x64')](_0x74b6('0x65'),_0x49574e['name'],_0x49574e[_0x74b6('0x61')]));fs['symlinkSync'](_0x301f53,_0x3e35bf);return _0x49574e;}})[_0x74b6('0x40')](function(_0x4652c4){throw new db['Sequelize'][(_0x74b6('0x5b'))](_0x4652c4[_0x74b6('0x5c')]);});})[_0x74b6('0x1f')](handleEntityNotFound(_0x403056,null))['then'](respondWithResult(_0x403056,0xc9))['catch'](handleError(_0x403056,null));};exports['removeSound']=function(_0x359004,_0x3d9f35,_0x26cb95){return db[_0x74b6('0x46')]['transaction'](function(_0x681aad){var _0x195499;return db['VoiceMusicOnHold'][_0x74b6('0x5f')]({'where':{'id':_0x359004[_0x74b6('0x42')]['id']}})[_0x74b6('0x1f')](handleEntityNotFound(_0x3d9f35,null))[_0x74b6('0x1f')](function(_0x518620){if(_0x518620){_0x195499=_0x518620;return _0x518620[_0x74b6('0x69')](_0x359004[_0x74b6('0x42')][_0x74b6('0x6a')]);}})[_0x74b6('0x1f')](function(_0x4b965c){if(_0x4b965c){return db[_0x74b6('0x5e')][_0x74b6('0x5f')]({'where':{'id':_0x359004['params']['id2']},'attributes':['id',_0x74b6('0x2d'),_0x74b6('0x60'),_0x74b6('0x61'),_0x74b6('0x62')],'raw':!![]});}})[_0x74b6('0x1f')](function(_0x5573e1){if(_0x5573e1){fs[_0x74b6('0x58')](path[_0x74b6('0x49')](_0x195499[_0x74b6('0x48')],util['format'](_0x74b6('0x65'),_0x5573e1[_0x74b6('0x2d')],_0x5573e1['converted_format'])));return _0x5573e1;}})[_0x74b6('0x40')](function(_0x3d288f){throw new db['Sequelize'][(_0x74b6('0x5b'))](_0x3d288f[_0x74b6('0x5c')]);});})[_0x74b6('0x1f')](handleEntityNotFound(_0x3d9f35,null))[_0x74b6('0x1f')](respondWithStatusCode(_0x3d9f35,0xcc))[_0x74b6('0x40')](handleError(_0x3d9f35,null));};exports['getSounds']=function(_0x193415,_0x3a6216,_0x5c4c88){var _0x46d083={};var _0x5056e9={};var _0x8dc233;var _0xb2ab46;return db[_0x74b6('0x3d')][_0x74b6('0x5f')]({'where':{'id':_0x193415['params']['id']}})[_0x74b6('0x1f')](handleEntityNotFound(_0x3a6216,null))[_0x74b6('0x1f')](function(_0x49cd30){if(_0x49cd30){_0x8dc233=_0x49cd30;_0x5056e9['model']=_[_0x74b6('0x2f')](db[_0x74b6('0x5e')][_0x74b6('0x29')]);_0x5056e9[_0x74b6('0x2e')]=_[_0x74b6('0x2f')](_0x193415['query']);_0x5056e9[_0x74b6('0x30')]=_[_0x74b6('0x32')](_0x5056e9[_0x74b6('0x2c')],_0x5056e9['query']);_0x46d083[_0x74b6('0x31')]=_[_0x74b6('0x32')](_0x5056e9[_0x74b6('0x2c')],qs[_0x74b6('0x33')](_0x193415[_0x74b6('0x2e')]['fields']));_0x46d083[_0x74b6('0x31')]=_0x46d083[_0x74b6('0x31')][_0x74b6('0x43')]?_0x46d083[_0x74b6('0x31')]:_0x5056e9[_0x74b6('0x2c')];_0x46d083[_0x74b6('0x35')]=qs[_0x74b6('0x36')](_0x193415[_0x74b6('0x2e')][_0x74b6('0x36')]);_0x46d083[_0x74b6('0x39')]=qs['filters'](_[_0x74b6('0x37')](_0x193415['query'],_0x5056e9[_0x74b6('0x30')]));if(_0x193415[_0x74b6('0x2e')]['filter']){_0x46d083[_0x74b6('0x39')]=_[_0x74b6('0x3a')](_0x46d083[_0x74b6('0x39')],{'$or':_[_0x74b6('0x28')](_0x46d083[_0x74b6('0x31')],function(_0x2afbda){var _0x3cd97b={};_0x3cd97b[_0x2afbda]={'$like':'%'+_0x193415['query'][_0x74b6('0x38')]+'%'};return _0x3cd97b;})});}_0x46d083=_['merge']({},_0x46d083,_0x193415['options']);return _0x8dc233[_0x74b6('0x6b')](_0x46d083);}})['then'](function(_0x1c4209){if(_0x1c4209){_0xb2ab46=_0x1c4209[_0x74b6('0x43')];if(!_0x193415['query'][_0x74b6('0x6c')](_0x74b6('0x34'))){_0x46d083[_0x74b6('0x18')]=qs[_0x74b6('0x18')](_0x193415[_0x74b6('0x2e')][_0x74b6('0x18')]);_0x46d083[_0x74b6('0x17')]=qs[_0x74b6('0x17')](_0x193415[_0x74b6('0x2e')][_0x74b6('0x17')]);}return _0x8dc233[_0x74b6('0x6b')](_0x46d083);}})['then'](function(_0x32cce4){if(_0x32cce4){return _0x32cce4?{'count':_0xb2ab46,'rows':_0x32cce4}:null;}})['then'](respondWithResult(_0x3a6216,null))[_0x74b6('0x40')](handleError(_0x3a6216,null));};
\ No newline at end of file
+var _0xb0f9=['path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','save','update','destroy','get','MusicOnHolds','then','sendStatus','error','name','map','VoiceMusicOnHold','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','merge','options','includeAll','include','findAll','rows','catch','params','find','body','create','sequelize','transaction','files','directory','root','server/files/moh','mkdirSync','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','join','rmdirSync','message','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','Sequelize','removeSound','id2','getSounds','rawAttributes','order','filter','nolimit','rimraf','request-promise','moment','bluebird','mustache'];(function(_0x2d991c,_0x1583d4){var _0x3d5af5=function(_0x4401aa){while(--_0x4401aa){_0x2d991c['push'](_0x2d991c['shift']());}};_0x3d5af5(++_0x1583d4);}(_0xb0f9,0xd1));var _0x9b0f=function(_0xbd4254,_0x31c08b){_0xbd4254=_0xbd4254-0x0;var _0x46c0f3=_0xb0f9[_0xbd4254];return _0x46c0f3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9b0f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9b0f('0x1'));var moment=require(_0x9b0f('0x2'));var BPromise=require(_0x9b0f('0x3'));var Mustache=require(_0x9b0f('0x4'));var util=require('util');var path=require(_0x9b0f('0x5'));var sox=require(_0x9b0f('0x6'));var csv=require('to-csv');var ejs=require(_0x9b0f('0x7'));var fs=require('fs');var fs_extra=require(_0x9b0f('0x8'));var _=require(_0x9b0f('0x9'));var squel=require(_0x9b0f('0xa'));var crypto=require(_0x9b0f('0xb'));var jsforce=require(_0x9b0f('0xc'));var deskjs=require(_0x9b0f('0xd'));var toCsv=require(_0x9b0f('0xe'));var querystring=require(_0x9b0f('0xf'));var Papa=require(_0x9b0f('0x10'));var Redis=require(_0x9b0f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9b0f('0x12'));var as=require(_0x9b0f('0x13'));var hardwareService=require(_0x9b0f('0x14'));var logger=require('../../config/logger')(_0x9b0f('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9b0f('0x16'));var db=require(_0x9b0f('0x17'))['db'];function respondWithStatusCode(_0x3b8d61,_0x4319c5){_0x4319c5=_0x4319c5||0xcc;return function(_0x140d00){if(_0x140d00){return _0x3b8d61['sendStatus'](_0x4319c5);}return _0x3b8d61[_0x9b0f('0x18')](_0x4319c5)['end']();};}function respondWithResult(_0x4390c9,_0x5c20f4){_0x5c20f4=_0x5c20f4||0xc8;return function(_0xdf8bc0){if(_0xdf8bc0){return _0x4390c9['status'](_0x5c20f4)['json'](_0xdf8bc0);}};}function respondWithFilteredResult(_0x415ed4,_0x4b33bc){return function(_0x3c76c7){if(_0x3c76c7){var _0x2846a2=typeof _0x4b33bc[_0x9b0f('0x19')]===_0x9b0f('0x1a')&&typeof _0x4b33bc[_0x9b0f('0x1b')]===_0x9b0f('0x1a');var _0x839a54=_0x3c76c7[_0x9b0f('0x1c')];var _0x26be14=_0x2846a2?0x0:_0x4b33bc[_0x9b0f('0x19')];var _0x12459e=_0x2846a2?_0x3c76c7[_0x9b0f('0x1c')]:_0x4b33bc['offset']+_0x4b33bc['limit'];var _0x209ab8;if(_0x12459e>=_0x839a54){_0x12459e=_0x839a54;_0x209ab8=0xc8;}else{_0x209ab8=0xce;}_0x415ed4[_0x9b0f('0x18')](_0x209ab8);return _0x415ed4[_0x9b0f('0x1d')](_0x9b0f('0x1e'),_0x26be14+'-'+_0x12459e+'/'+_0x839a54)[_0x9b0f('0x1f')](_0x3c76c7);}return null;};}function patchUpdates(_0x592ef9){return function(_0x5a3b51){try{jsonpatch['apply'](_0x5a3b51,_0x592ef9,!![]);}catch(_0x29574d){return BPromise['reject'](_0x29574d);}return _0x5a3b51[_0x9b0f('0x20')]();};}function saveUpdates(_0x1482d7,_0x35c1b2){return function(_0x45c5bf){if(_0x45c5bf){return _0x45c5bf[_0x9b0f('0x21')](_0x1482d7)['then'](function(_0x4bbeb7){return _0x4bbeb7;});}return null;};}function removeEntity(_0x502f91,_0x10434f){return function(_0x413a58){if(_0x413a58){return _0x413a58[_0x9b0f('0x22')]()['then'](function(){var _0x1b8e37=_0x413a58[_0x9b0f('0x23')]({'plain':!![]});var _0x304687=_0x9b0f('0x24');return db['UserProfileResource'][_0x9b0f('0x22')]({'where':{'type':_0x304687,'resourceId':_0x1b8e37['id']}})[_0x9b0f('0x25')](function(){return _0x413a58;});})['then'](function(){_0x502f91[_0x9b0f('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3514be,_0x5395a2){return function(_0x251da9){if(!_0x251da9){_0x3514be[_0x9b0f('0x26')](0x194);}return _0x251da9;};}function handleError(_0x5dd896,_0x3883d7){_0x3883d7=_0x3883d7||0x1f4;return function(_0x5afa00){logger[_0x9b0f('0x27')](_0x5afa00['stack']);if(_0x5afa00[_0x9b0f('0x28')]){delete _0x5afa00[_0x9b0f('0x28')];}_0x5dd896[_0x9b0f('0x18')](_0x3883d7)['send'](_0x5afa00);};}exports['index']=function(_0x16fec2,_0x64bd68){var _0x4efa8f={},_0x3b931d={},_0x29bc7e={'count':0x0,'rows':[]};var _0x190edd=_[_0x9b0f('0x29')](db[_0x9b0f('0x2a')]['rawAttributes'],function(_0x61ca23){return{'name':_0x61ca23[_0x9b0f('0x2b')],'type':_0x61ca23[_0x9b0f('0x2c')]['key']};});_0x3b931d[_0x9b0f('0x2d')]=_[_0x9b0f('0x29')](_0x190edd,_0x9b0f('0x28'));_0x3b931d[_0x9b0f('0x2e')]=_[_0x9b0f('0x2f')](_0x16fec2[_0x9b0f('0x2e')]);_0x3b931d[_0x9b0f('0x30')]=_['intersection'](_0x3b931d['model'],_0x3b931d[_0x9b0f('0x2e')]);_0x4efa8f[_0x9b0f('0x31')]=_[_0x9b0f('0x32')](_0x3b931d[_0x9b0f('0x2d')],qs['fields'](_0x16fec2['query'][_0x9b0f('0x33')]));_0x4efa8f['attributes']=_0x4efa8f['attributes'][_0x9b0f('0x34')]?_0x4efa8f[_0x9b0f('0x31')]:_0x3b931d[_0x9b0f('0x2d')];if(!_0x16fec2['query'][_0x9b0f('0x35')]('nolimit')){_0x4efa8f[_0x9b0f('0x1b')]=qs[_0x9b0f('0x1b')](_0x16fec2['query'][_0x9b0f('0x1b')]);_0x4efa8f[_0x9b0f('0x19')]=qs['offset'](_0x16fec2[_0x9b0f('0x2e')]['offset']);}_0x4efa8f['order']=qs[_0x9b0f('0x36')](_0x16fec2[_0x9b0f('0x2e')]['sort']);delete _0x16fec2[_0x9b0f('0x2e')]['sort'];_0x4efa8f[_0x9b0f('0x37')]=qs[_0x9b0f('0x30')](_[_0x9b0f('0x38')](_0x16fec2[_0x9b0f('0x2e')],_0x3b931d[_0x9b0f('0x30')]),_0x190edd);if(_0x16fec2['query']['filter']){_0x4efa8f[_0x9b0f('0x37')]=_[_0x9b0f('0x39')](_0x4efa8f['where'],{'$or':_[_0x9b0f('0x29')](_0x190edd,function(_0x30c87e){if(_0x30c87e['type']!=='VIRTUAL'){var _0x5fbe11={};_0x5fbe11[_0x30c87e[_0x9b0f('0x28')]]={'$like':'%'+_0x16fec2[_0x9b0f('0x2e')]['filter']+'%'};return _0x5fbe11;}})});}_0x4efa8f=_[_0x9b0f('0x39')]({},_0x4efa8f,_0x16fec2[_0x9b0f('0x3a')]);var _0x510b73={'where':_0x4efa8f[_0x9b0f('0x37')]};return db[_0x9b0f('0x2a')][_0x9b0f('0x1c')](_0x510b73)[_0x9b0f('0x25')](function(_0x3a7438){_0x29bc7e[_0x9b0f('0x1c')]=_0x3a7438;if(_0x16fec2[_0x9b0f('0x2e')][_0x9b0f('0x3b')]){_0x4efa8f[_0x9b0f('0x3c')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x9b0f('0x3d')](_0x4efa8f);})[_0x9b0f('0x25')](function(_0x454cf9){_0x29bc7e[_0x9b0f('0x3e')]=_0x454cf9;return _0x29bc7e;})[_0x9b0f('0x25')](respondWithFilteredResult(_0x64bd68,_0x4efa8f))[_0x9b0f('0x3f')](handleError(_0x64bd68,null));};exports['show']=function(_0x407f22,_0x34d0b0){var _0x340d87={'raw':![],'where':{'id':_0x407f22[_0x9b0f('0x40')]['id']}},_0x3579af={};_0x3579af['model']=_[_0x9b0f('0x2f')](db[_0x9b0f('0x2a')]['rawAttributes']);_0x3579af[_0x9b0f('0x2e')]=_['keys'](_0x407f22[_0x9b0f('0x2e')]);_0x3579af[_0x9b0f('0x30')]=_[_0x9b0f('0x32')](_0x3579af[_0x9b0f('0x2d')],_0x3579af[_0x9b0f('0x2e')]);_0x340d87[_0x9b0f('0x31')]=_[_0x9b0f('0x32')](_0x3579af[_0x9b0f('0x2d')],qs[_0x9b0f('0x33')](_0x407f22[_0x9b0f('0x2e')][_0x9b0f('0x33')]));_0x340d87[_0x9b0f('0x31')]=_0x340d87[_0x9b0f('0x31')]['length']?_0x340d87[_0x9b0f('0x31')]:_0x3579af[_0x9b0f('0x2d')];if(_0x407f22[_0x9b0f('0x2e')]['includeAll']){_0x340d87[_0x9b0f('0x3c')]=[{'all':!![]}];}_0x340d87=_['merge']({},_0x340d87,_0x407f22[_0x9b0f('0x3a')]);return db[_0x9b0f('0x2a')]['find'](_0x340d87)[_0x9b0f('0x25')](handleEntityNotFound(_0x34d0b0,null))[_0x9b0f('0x25')](respondWithResult(_0x34d0b0,null))['catch'](handleError(_0x34d0b0,null));};exports[_0x9b0f('0x21')]=function(_0x355e28,_0x22d076){if(_0x355e28['body']['id']){delete _0x355e28['body']['id'];}return db[_0x9b0f('0x2a')][_0x9b0f('0x41')]({'where':{'id':_0x355e28['params']['id']}})[_0x9b0f('0x25')](handleEntityNotFound(_0x22d076,null))[_0x9b0f('0x25')](saveUpdates(_0x355e28[_0x9b0f('0x42')],null))[_0x9b0f('0x25')](respondWithResult(_0x22d076,null))[_0x9b0f('0x3f')](handleError(_0x22d076,null));};exports[_0x9b0f('0x43')]=function(_0x2c27e1,_0x825394,_0x304dbb){return db[_0x9b0f('0x44')][_0x9b0f('0x45')](function(_0x230e6d){if(_0x2c27e1[_0x9b0f('0x42')]['mode']===_0x9b0f('0x46')){_0x2c27e1[_0x9b0f('0x42')][_0x9b0f('0x47')]=path['join'](config[_0x9b0f('0x48')],_0x9b0f('0x49'),_0x2c27e1[_0x9b0f('0x42')][_0x9b0f('0x28')]);}return db[_0x9b0f('0x2a')]['create'](_0x2c27e1[_0x9b0f('0x42')],{'transaction':_0x230e6d})[_0x9b0f('0x25')](function(_0x3d05a8){if(_0x2c27e1[_0x9b0f('0x42')]['mode']===_0x9b0f('0x46')){fs[_0x9b0f('0x4a')](_0x3d05a8['directory'],parseInt('0777',0x8));}var _0x5d9f0d=_0x2c27e1['user'][_0x9b0f('0x23')]({'plain':!![]});if(!_0x5d9f0d)throw new Error(_0x9b0f('0x4b'));if(_0x5d9f0d[_0x9b0f('0x4c')]===_0x9b0f('0x4d')){var _0xe368f8=_0x3d05a8['get']({'plain':!![]});return db[_0x9b0f('0x4e')][_0x9b0f('0x41')]({'where':{'name':'MusicOnHolds','userProfileId':_0x5d9f0d[_0x9b0f('0x4f')]},'raw':!![]})[_0x9b0f('0x25')](function(_0x44fdd8){if(_0x44fdd8&&_0x44fdd8[_0x9b0f('0x50')]===0x0){return db[_0x9b0f('0x51')]['create']({'name':_0xe368f8[_0x9b0f('0x28')],'resourceId':_0xe368f8['id'],'type':_0x44fdd8[_0x9b0f('0x28')],'sectionId':_0x44fdd8['id']},{})['then'](function(){return _0x3d05a8;});}else{return _0x3d05a8;}})[_0x9b0f('0x3f')](function(_0x5e4450){logger[_0x9b0f('0x27')](_0x9b0f('0x52'),_0x5e4450);});}return _0x3d05a8;});})[_0x9b0f('0x25')](respondWithResult(_0x825394,0xc9))[_0x9b0f('0x3f')](handleError(_0x825394,null));};exports[_0x9b0f('0x22')]=function(_0x593fd4,_0x20a99f,_0x211836){var _0x300606;return db[_0x9b0f('0x2a')][_0x9b0f('0x41')]({'where':{'id':_0x593fd4[_0x9b0f('0x40')]['id']}})[_0x9b0f('0x25')](function(_0x2b3518){if(_0x2b3518){return db[_0x9b0f('0x44')]['transaction'](function(_0x1d0796){return _0x2b3518['destroy']({'transaction':_0x1d0796,'raw':!![]})['then'](function(_0x3aca82){if(_0x3aca82['directory']){fs[_0x9b0f('0x53')](_0x3aca82[_0x9b0f('0x47')])[_0x9b0f('0x54')](function(_0x5255f9){fs[_0x9b0f('0x55')](path[_0x9b0f('0x56')](_0x3aca82[_0x9b0f('0x47')],_0x5255f9));});fs[_0x9b0f('0x57')](_0x3aca82['directory']);}return _0x3aca82;});})[_0x9b0f('0x3f')](function(_0x7209b7){throw new db['Sequelize']['ValidationError'](_0x7209b7[_0x9b0f('0x58')]);});}})[_0x9b0f('0x25')](handleEntityNotFound(_0x20a99f,null))[_0x9b0f('0x25')](removeEntity(_0x20a99f,null))['catch'](handleError(_0x20a99f,null));};exports['addSound']=function(_0x48bcab,_0x5ea42a,_0x295d1d){return db[_0x9b0f('0x44')][_0x9b0f('0x45')](function(_0x2f9d99){var _0x441a8d;return db['VoiceMusicOnHold'][_0x9b0f('0x41')]({'where':{'id':_0x48bcab['params']['id']}})[_0x9b0f('0x25')](function(_0x57b1ab){if(_0x57b1ab){_0x441a8d=_0x57b1ab;return _0x57b1ab[_0x9b0f('0x59')](_0x48bcab[_0x9b0f('0x42')]['id'],{'transaction':_0x2f9d99});}})['then'](function(_0x2bb655){if(_0x2bb655){return db[_0x9b0f('0x5a')][_0x9b0f('0x5b')]({'where':{'id':_0x48bcab['body']['id']},'attributes':['id',_0x9b0f('0x28'),_0x9b0f('0x5c'),_0x9b0f('0x5d'),_0x9b0f('0x5e')],'raw':!![]});}})[_0x9b0f('0x25')](function(_0x4a18a5){if(_0x4a18a5){var _0x5a0fbc=path[_0x9b0f('0x56')](config['root'],_0x9b0f('0x5f'),util[_0x9b0f('0x60')](_0x9b0f('0x61'),path[_0x9b0f('0x62')](_0x4a18a5['save_name'],path['extname'](_0x4a18a5['save_name'])),_0x4a18a5[_0x9b0f('0x5d')]));var _0x194711=path[_0x9b0f('0x56')](config[_0x9b0f('0x48')],_0x9b0f('0x49'),_0x441a8d['name'],util[_0x9b0f('0x60')](_0x9b0f('0x61'),_0x4a18a5[_0x9b0f('0x28')],_0x4a18a5['converted_format']));fs['symlinkSync'](_0x5a0fbc,_0x194711);return _0x4a18a5;}})[_0x9b0f('0x3f')](function(_0x352564){throw new db[(_0x9b0f('0x63'))]['ValidationError'](_0x352564[_0x9b0f('0x58')]);});})[_0x9b0f('0x25')](handleEntityNotFound(_0x5ea42a,null))['then'](respondWithResult(_0x5ea42a,0xc9))[_0x9b0f('0x3f')](handleError(_0x5ea42a,null));};exports['removeSound']=function(_0x426f1c,_0xa4d736,_0x3d5056){return db[_0x9b0f('0x44')][_0x9b0f('0x45')](function(_0x4e17ac){var _0x1aa5d3;return db[_0x9b0f('0x2a')]['findOne']({'where':{'id':_0x426f1c['params']['id']}})[_0x9b0f('0x25')](handleEntityNotFound(_0xa4d736,null))[_0x9b0f('0x25')](function(_0x2b0849){if(_0x2b0849){_0x1aa5d3=_0x2b0849;return _0x2b0849[_0x9b0f('0x64')](_0x426f1c[_0x9b0f('0x40')]['id2']);}})[_0x9b0f('0x25')](function(_0x37a9ab){if(_0x37a9ab){return db[_0x9b0f('0x5a')][_0x9b0f('0x5b')]({'where':{'id':_0x426f1c[_0x9b0f('0x40')][_0x9b0f('0x65')]},'attributes':['id','name',_0x9b0f('0x5c'),_0x9b0f('0x5d'),_0x9b0f('0x5e')],'raw':!![]});}})['then'](function(_0xf66d52){if(_0xf66d52){fs[_0x9b0f('0x55')](path[_0x9b0f('0x56')](_0x1aa5d3[_0x9b0f('0x47')],util[_0x9b0f('0x60')](_0x9b0f('0x61'),_0xf66d52[_0x9b0f('0x28')],_0xf66d52[_0x9b0f('0x5d')])));return _0xf66d52;}})[_0x9b0f('0x3f')](function(_0x52ec81){throw new db['Sequelize']['ValidationError'](_0x52ec81['message']);});})['then'](handleEntityNotFound(_0xa4d736,null))[_0x9b0f('0x25')](respondWithStatusCode(_0xa4d736,0xcc))[_0x9b0f('0x3f')](handleError(_0xa4d736,null));};exports[_0x9b0f('0x66')]=function(_0xcd41b2,_0x1dfbd7,_0x4cd8e4){var _0x2e14eb={};var _0x151bb9={};var _0x98cbb;var _0x8b3c8b;return db[_0x9b0f('0x2a')]['findOne']({'where':{'id':_0xcd41b2[_0x9b0f('0x40')]['id']}})['then'](handleEntityNotFound(_0x1dfbd7,null))[_0x9b0f('0x25')](function(_0x43abe9){if(_0x43abe9){_0x98cbb=_0x43abe9;_0x151bb9[_0x9b0f('0x2d')]=_[_0x9b0f('0x2f')](db[_0x9b0f('0x5a')][_0x9b0f('0x67')]);_0x151bb9[_0x9b0f('0x2e')]=_[_0x9b0f('0x2f')](_0xcd41b2['query']);_0x151bb9[_0x9b0f('0x30')]=_['intersection'](_0x151bb9[_0x9b0f('0x2d')],_0x151bb9[_0x9b0f('0x2e')]);_0x2e14eb[_0x9b0f('0x31')]=_['intersection'](_0x151bb9[_0x9b0f('0x2d')],qs['fields'](_0xcd41b2[_0x9b0f('0x2e')][_0x9b0f('0x33')]));_0x2e14eb[_0x9b0f('0x31')]=_0x2e14eb['attributes'][_0x9b0f('0x34')]?_0x2e14eb[_0x9b0f('0x31')]:_0x151bb9['model'];_0x2e14eb[_0x9b0f('0x68')]=qs['sort'](_0xcd41b2[_0x9b0f('0x2e')]['sort']);_0x2e14eb[_0x9b0f('0x37')]=qs[_0x9b0f('0x30')](_[_0x9b0f('0x38')](_0xcd41b2['query'],_0x151bb9[_0x9b0f('0x30')]));if(_0xcd41b2[_0x9b0f('0x2e')]['filter']){_0x2e14eb[_0x9b0f('0x37')]=_[_0x9b0f('0x39')](_0x2e14eb[_0x9b0f('0x37')],{'$or':_[_0x9b0f('0x29')](_0x2e14eb['attributes'],function(_0x582f73){var _0x349c7d={};_0x349c7d[_0x582f73]={'$like':'%'+_0xcd41b2[_0x9b0f('0x2e')][_0x9b0f('0x69')]+'%'};return _0x349c7d;})});}_0x2e14eb=_[_0x9b0f('0x39')]({},_0x2e14eb,_0xcd41b2[_0x9b0f('0x3a')]);return _0x98cbb[_0x9b0f('0x66')](_0x2e14eb);}})[_0x9b0f('0x25')](function(_0x5c7287){if(_0x5c7287){_0x8b3c8b=_0x5c7287[_0x9b0f('0x34')];if(!_0xcd41b2[_0x9b0f('0x2e')][_0x9b0f('0x35')](_0x9b0f('0x6a'))){_0x2e14eb[_0x9b0f('0x1b')]=qs[_0x9b0f('0x1b')](_0xcd41b2[_0x9b0f('0x2e')][_0x9b0f('0x1b')]);_0x2e14eb[_0x9b0f('0x19')]=qs[_0x9b0f('0x19')](_0xcd41b2[_0x9b0f('0x2e')][_0x9b0f('0x19')]);}return _0x98cbb['getSounds'](_0x2e14eb);}})[_0x9b0f('0x25')](function(_0xdc5bd){if(_0xdc5bd){return _0xdc5bd?{'count':_0x8b3c8b,'rows':_0xdc5bd}:null;}})[_0x9b0f('0x25')](respondWithResult(_0x1dfbd7,null))['catch'](handleError(_0x1dfbd7,null));};
\ No newline at end of file
index b465359..93f3ac9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4d7=['define','voice_musiconhold','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./voiceMusicOnHold.attributes','exports'];(function(_0x22ab78,_0x436ebd){var _0x5dc502=function(_0x544a7c){while(--_0x544a7c){_0x22ab78['push'](_0x22ab78['shift']());}};_0x5dc502(++_0x436ebd);}(_0xb4d7,0x15e));var _0x7b4d=function(_0x564c1b,_0x4cabad){_0x564c1b=_0x564c1b-0x0;var _0x177ce7=_0xb4d7[_0x564c1b];return _0x177ce7;};'use strict';var _=require(_0x7b4d('0x0'));var util=require(_0x7b4d('0x1'));var logger=require(_0x7b4d('0x2'))('api');var moment=require(_0x7b4d('0x3'));var BPromise=require(_0x7b4d('0x4'));var rp=require(_0x7b4d('0x5'));var fs=require('fs');var path=require(_0x7b4d('0x6'));var rimraf=require(_0x7b4d('0x7'));var config=require('../../config/environment');var attributes=require(_0x7b4d('0x8'));module[_0x7b4d('0x9')]=function(_0x5a57fd,_0x875fc3){return _0x5a57fd[_0x7b4d('0xa')]('VoiceMusicOnHold',attributes,{'tableName':_0x7b4d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2c43=['path','../../config/environment','./voiceMusicOnHold.attributes','exports','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x217e73,_0x1ef5ff){var _0x556b89=function(_0x36abd5){while(--_0x36abd5){_0x217e73['push'](_0x217e73['shift']());}};_0x556b89(++_0x1ef5ff);}(_0x2c43,0x15b));var _0x32c4=function(_0x4f3842,_0x820dec){_0x4f3842=_0x4f3842-0x0;var _0x34727a=_0x2c43[_0x4f3842];return _0x34727a;};'use strict';var _=require(_0x32c4('0x0'));var util=require(_0x32c4('0x1'));var logger=require(_0x32c4('0x2'))('api');var moment=require('moment');var BPromise=require(_0x32c4('0x3'));var rp=require(_0x32c4('0x4'));var fs=require('fs');var path=require(_0x32c4('0x5'));var rimraf=require('rimraf');var config=require(_0x32c4('0x6'));var attributes=require(_0x32c4('0x7'));module[_0x32c4('0x8')]=function(_0x3a404d,_0x5329fb){return _0x3a404d['define'](_0x32c4('0x9'),attributes,{'tableName':_0x32c4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c5d143c..cf14926 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x341c58,_0x24b28b){var _0x3dbe21=function(_0x4914ff){while(--_0x4914ff){_0x341c58['push'](_0x341c58['shift']());}};_0x3dbe21(++_0x24b28b);}(_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 moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});}
\ No newline at end of file
+var _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','VoiceMusicOnHold,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x437571,_0x51a2d2){var _0x4064b0=function(_0x3de90f){while(--_0x3de90f){_0x437571['push'](_0x437571['shift']());}};_0x4064b0(++_0x51a2d2);}(_0x9c44,0x178));var _0x49c4=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x9c44[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});}
\ No newline at end of file
index eeb28be..c9232a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf15e=['Router','fs-extra','../../components/auth/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','/describe','/:id','show','/:id/users','getAgents','/:id/teams','getTeams','post','addAgents','addTeams','put','update','delete','removeAgents','removeTeams','exports','multer','path','connect-timeout','express'];(function(_0x2c9699,_0x3e8d65){var _0x16209d=function(_0x2c9705){while(--_0x2c9705){_0x2c9699['push'](_0x2c9699['shift']());}};_0x16209d(++_0x3e8d65);}(_0xf15e,0xb9));var _0xef15=function(_0x25df16,_0x4a041c){_0x25df16=_0x25df16-0x0;var _0x1042d0=_0xf15e[_0x25df16];return _0x1042d0;};'use strict';var multer=require(_0xef15('0x0'));var util=require('util');var path=require(_0xef15('0x1'));var timeout=require(_0xef15('0x2'));var express=require(_0xef15('0x3'));var router=express[_0xef15('0x4')]();var fs_extra=require(_0xef15('0x5'));var auth=require(_0xef15('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xef15('0x7'));var controller=require(_0xef15('0x8'));router[_0xef15('0x9')]('/',auth[_0xef15('0xa')](),controller['index']);router[_0xef15('0x9')](_0xef15('0xb'),auth[_0xef15('0xa')](),controller['describe']);router[_0xef15('0x9')](_0xef15('0xc'),auth[_0xef15('0xa')](),controller[_0xef15('0xd')]);router['get'](_0xef15('0xe'),auth[_0xef15('0xa')](),controller[_0xef15('0xf')]);router['get'](_0xef15('0x10'),auth[_0xef15('0xa')](),controller[_0xef15('0x11')]);router[_0xef15('0x12')]('/',auth[_0xef15('0xa')](),controller['create']);router['post'](_0xef15('0xe'),auth[_0xef15('0xa')](),controller[_0xef15('0x13')]);router['post'](_0xef15('0x10'),auth['isAuthenticated'](),controller[_0xef15('0x14')]);router[_0xef15('0x15')](_0xef15('0xc'),auth['isAuthenticated'](),controller[_0xef15('0x16')]);router['delete']('/:id',auth[_0xef15('0xa')](),controller['destroy']);router[_0xef15('0x17')](_0xef15('0xe'),auth[_0xef15('0xa')](),controller[_0xef15('0x18')]);router[_0xef15('0x17')]('/:id/teams',auth[_0xef15('0xa')](),controller[_0xef15('0x19')]);module[_0xef15('0x1a')]=router;
\ No newline at end of file
+var _0x3ffb=['getTeams','post','create','/:id/teams','addTeams','put','/:id','update','delete','removeAgents','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','/describe','describe','show','/:id/users','getAgents'];(function(_0x518496,_0x17ed2f){var _0x3e0288=function(_0x16bd77){while(--_0x16bd77){_0x518496['push'](_0x518496['shift']());}};_0x3e0288(++_0x17ed2f);}(_0x3ffb,0x13f));var _0xb3ff=function(_0x3e6a3d,_0x48c6f5){_0x3e6a3d=_0x3e6a3d-0x0;var _0x3eb96e=_0x3ffb[_0x3e6a3d];return _0x3eb96e;};'use strict';var multer=require(_0xb3ff('0x0'));var util=require(_0xb3ff('0x1'));var path=require(_0xb3ff('0x2'));var timeout=require(_0xb3ff('0x3'));var express=require(_0xb3ff('0x4'));var router=express['Router']();var fs_extra=require(_0xb3ff('0x5'));var auth=require(_0xb3ff('0x6'));var interaction=require(_0xb3ff('0x7'));var config=require(_0xb3ff('0x8'));var controller=require(_0xb3ff('0x9'));router[_0xb3ff('0xa')]('/',auth[_0xb3ff('0xb')](),controller['index']);router[_0xb3ff('0xa')](_0xb3ff('0xc'),auth[_0xb3ff('0xb')](),controller[_0xb3ff('0xd')]);router['get']('/:id',auth[_0xb3ff('0xb')](),controller[_0xb3ff('0xe')]);router[_0xb3ff('0xa')](_0xb3ff('0xf'),auth['isAuthenticated'](),controller[_0xb3ff('0x10')]);router[_0xb3ff('0xa')]('/:id/teams',auth[_0xb3ff('0xb')](),controller[_0xb3ff('0x11')]);router[_0xb3ff('0x12')]('/',auth[_0xb3ff('0xb')](),controller[_0xb3ff('0x13')]);router[_0xb3ff('0x12')](_0xb3ff('0xf'),auth[_0xb3ff('0xb')](),controller['addAgents']);router[_0xb3ff('0x12')](_0xb3ff('0x14'),auth[_0xb3ff('0xb')](),controller[_0xb3ff('0x15')]);router[_0xb3ff('0x16')](_0xb3ff('0x17'),auth['isAuthenticated'](),controller[_0xb3ff('0x18')]);router['delete'](_0xb3ff('0x17'),auth[_0xb3ff('0xb')](),controller['destroy']);router[_0xb3ff('0x19')](_0xb3ff('0xf'),auth[_0xb3ff('0xb')](),controller[_0xb3ff('0x1a')]);router[_0xb3ff('0x19')](_0xb3ff('0x14'),auth[_0xb3ff('0xb')](),controller[_0xb3ff('0x1b')]);module['exports']=router;
\ No newline at end of file
index f136f50..174e3b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c74=['STRING','INTEGER','sequelize','exports','name','VIRTUAL','getDataValue'];(function(_0xf0330b,_0x814253){var _0x538518=function(_0x9c7d43){while(--_0x9c7d43){_0xf0330b['push'](_0xf0330b['shift']());}};_0x538518(++_0x814253);}(_0x7c74,0xcd));var _0x47c7=function(_0x56e4e7,_0x1db098){_0x56e4e7=_0x56e4e7-0x0;var _0x383618=_0x7c74[_0x56e4e7];return _0x383618;};'use strict';var Sequelize=require(_0x47c7('0x0'));module[_0x47c7('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x47c7('0x2')},'prefix':{'type':Sequelize[_0x47c7('0x3')],'get':function(_0x132440){return'system-'+this[_0x47c7('0x4')](_0x47c7('0x2'))+'-';}},'description':{'type':Sequelize[_0x47c7('0x5')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x47c7('0x6')]}};
\ No newline at end of file
+var _0x5823=['name','INTEGER','sequelize','exports','STRING','VIRTUAL','system-','getDataValue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5823,0x72));var _0x3582=function(_0x10da14,_0x860728){_0x10da14=_0x10da14-0x0;var _0x3145e7=_0x5823[_0x10da14];return _0x3145e7;};'use strict';var Sequelize=require(_0x3582('0x0'));module[_0x3582('0x1')]={'name':{'type':Sequelize[_0x3582('0x2')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x3582('0x3')],'get':function(_0x4d48a5){return _0x3582('0x4')+this[_0x3582('0x5')](_0x3582('0x6'))+'-';}},'description':{'type':Sequelize[_0x3582('0x2')]},'callerIdAll':{'type':Sequelize[_0x3582('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x3582('0x7')]}};
\ No newline at end of file
index dbc8ae3..1443808 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb3b=['params','rawAttributes','find','destroy','describe','sequelize','create','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','exten','app','system','description','Voice\x20Prefix\x20Extension','priority','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','findById','addAgents','ids','omit','spread','removeAgents','userVoicePrefix:remove','emit','getAgents','findOne','order','pick','nolimit','getTeams','Team','addTeams','findAll','User','Agents','online','voicePause','interface','flatMap','transaction','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','select','field','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','SELECT','every','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','forEach','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','sendStatus','status','offset','limit','undefined','count','set','json','apply','save','update','then','get','VoicePrefixes','UserProfileResource','end','error','name','send','index','map','VoicePrefix','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','filter','merge','options','includeAll','include','rows','catch','show'];(function(_0x52bdfe,_0x5282ec){var _0x5c6df7=function(_0x2355bb){while(--_0x2355bb){_0x52bdfe['push'](_0x52bdfe['shift']());}};_0x5c6df7(++_0x5282ec);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x403c8d,_0x5e3825){_0x403c8d=_0x403c8d-0x0;var _0x4ca60d=_0xeb3b[_0x403c8d];return _0x4ca60d;};'use strict';var emlformat=require(_0xbeb3('0x0'));var rimraf=require(_0xbeb3('0x1'));var zipdir=require(_0xbeb3('0x2'));var jsonpatch=require(_0xbeb3('0x3'));var rp=require(_0xbeb3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbeb3('0x5'));var util=require('util');var path=require(_0xbeb3('0x6'));var sox=require('sox');var csv=require(_0xbeb3('0x7'));var ejs=require(_0xbeb3('0x8'));var fs=require('fs');var fs_extra=require(_0xbeb3('0x9'));var _=require(_0xbeb3('0xa'));var squel=require(_0xbeb3('0xb'));var crypto=require(_0xbeb3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbeb3('0xd'));var toCsv=require(_0xbeb3('0x7'));var querystring=require(_0xbeb3('0xe'));var Papa=require(_0xbeb3('0xf'));var Redis=require(_0xbeb3('0x10'));var authService=require(_0xbeb3('0x11'));var qs=require(_0xbeb3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbeb3('0x13'));var logger=require(_0xbeb3('0x14'))('api');var utils=require(_0xbeb3('0x15'));var config=require(_0xbeb3('0x16'));var licenseUtil=require(_0xbeb3('0x17'));var db=require(_0xbeb3('0x18'))['db'];config[_0xbeb3('0x19')]=_[_0xbeb3('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xbeb3('0x1b'))(new Redis(config[_0xbeb3('0x19')]));require('./voicePrefix.socket')['register'](socket);function respondWithStatusCode(_0xed9879,_0x40f586){_0x40f586=_0x40f586||0xcc;return function(_0x395d2b){if(_0x395d2b){return _0xed9879[_0xbeb3('0x1c')](_0x40f586);}return _0xed9879[_0xbeb3('0x1d')](_0x40f586)['end']();};}function respondWithResult(_0x1aeaee,_0x5970a1){_0x5970a1=_0x5970a1||0xc8;return function(_0x80ef55){if(_0x80ef55){return _0x1aeaee['status'](_0x5970a1)['json'](_0x80ef55);}};}function respondWithFilteredResult(_0x4f8481,_0x9bc0a4){return function(_0x44a4bb){if(_0x44a4bb){var _0x32275b=typeof _0x9bc0a4[_0xbeb3('0x1e')]==='undefined'&&typeof _0x9bc0a4[_0xbeb3('0x1f')]===_0xbeb3('0x20');var _0xe2cc47=_0x44a4bb['count'];var _0x4af96f=_0x32275b?0x0:_0x9bc0a4[_0xbeb3('0x1e')];var _0x57e8b6=_0x32275b?_0x44a4bb[_0xbeb3('0x21')]:_0x9bc0a4['offset']+_0x9bc0a4['limit'];var _0xfa2736;if(_0x57e8b6>=_0xe2cc47){_0x57e8b6=_0xe2cc47;_0xfa2736=0xc8;}else{_0xfa2736=0xce;}_0x4f8481[_0xbeb3('0x1d')](_0xfa2736);return _0x4f8481[_0xbeb3('0x22')]('Content-Range',_0x4af96f+'-'+_0x57e8b6+'/'+_0xe2cc47)[_0xbeb3('0x23')](_0x44a4bb);}return null;};}function patchUpdates(_0x18ea0f){return function(_0x5e047e){try{jsonpatch[_0xbeb3('0x24')](_0x5e047e,_0x18ea0f,!![]);}catch(_0x366bdb){return BPromise['reject'](_0x366bdb);}return _0x5e047e[_0xbeb3('0x25')]();};}function saveUpdates(_0x278fe4,_0x16b079){return function(_0x42c6c3){if(_0x42c6c3){return _0x42c6c3[_0xbeb3('0x26')](_0x278fe4)[_0xbeb3('0x27')](function(_0x84921a){return _0x84921a;});}return null;};}function removeEntity(_0x340581,_0x46fe17){return function(_0x59f27c){if(_0x59f27c){return _0x59f27c['destroy']()[_0xbeb3('0x27')](function(){var _0x520116=_0x59f27c[_0xbeb3('0x28')]({'plain':!![]});var _0xda808c=_0xbeb3('0x29');return db[_0xbeb3('0x2a')]['destroy']({'where':{'type':_0xda808c,'resourceId':_0x520116['id']}})[_0xbeb3('0x27')](function(){return _0x59f27c;});})['then'](function(){_0x340581[_0xbeb3('0x1d')](0xcc)[_0xbeb3('0x2b')]();});}};}function handleEntityNotFound(_0x5bd93d,_0x483198){return function(_0x9b8f13){if(!_0x9b8f13){_0x5bd93d['sendStatus'](0x194);}return _0x9b8f13;};}function handleError(_0x51f7ef,_0x520b8e){_0x520b8e=_0x520b8e||0x1f4;return function(_0x5bfef7){logger[_0xbeb3('0x2c')](_0x5bfef7['stack']);if(_0x5bfef7[_0xbeb3('0x2d')]){delete _0x5bfef7[_0xbeb3('0x2d')];}_0x51f7ef[_0xbeb3('0x1d')](_0x520b8e)[_0xbeb3('0x2e')](_0x5bfef7);};}exports[_0xbeb3('0x2f')]=function(_0x12f7d4,_0x411cd3){var _0x30fcd4={},_0x2dc0d4={},_0x3002e3={'count':0x0,'rows':[]};var _0x4ead3b=_[_0xbeb3('0x30')](db[_0xbeb3('0x31')]['rawAttributes'],function(_0xb46de){return{'name':_0xb46de[_0xbeb3('0x32')],'type':_0xb46de[_0xbeb3('0x33')][_0xbeb3('0x34')]};});_0x2dc0d4['model']=_[_0xbeb3('0x30')](_0x4ead3b,_0xbeb3('0x2d'));_0x2dc0d4[_0xbeb3('0x35')]=_[_0xbeb3('0x36')](_0x12f7d4[_0xbeb3('0x35')]);_0x2dc0d4[_0xbeb3('0x37')]=_[_0xbeb3('0x38')](_0x2dc0d4[_0xbeb3('0x39')],_0x2dc0d4[_0xbeb3('0x35')]);_0x30fcd4['attributes']=_[_0xbeb3('0x38')](_0x2dc0d4['model'],qs[_0xbeb3('0x3a')](_0x12f7d4[_0xbeb3('0x35')][_0xbeb3('0x3a')]));_0x30fcd4[_0xbeb3('0x3b')]=_0x30fcd4[_0xbeb3('0x3b')][_0xbeb3('0x3c')]?_0x30fcd4[_0xbeb3('0x3b')]:_0x2dc0d4[_0xbeb3('0x39')];if(!_0x12f7d4['query'][_0xbeb3('0x3d')]('nolimit')){_0x30fcd4['limit']=qs['limit'](_0x12f7d4[_0xbeb3('0x35')][_0xbeb3('0x1f')]);_0x30fcd4[_0xbeb3('0x1e')]=qs[_0xbeb3('0x1e')](_0x12f7d4[_0xbeb3('0x35')][_0xbeb3('0x1e')]);}_0x30fcd4['order']=qs[_0xbeb3('0x3e')](_0x12f7d4[_0xbeb3('0x35')][_0xbeb3('0x3e')]);_0x30fcd4['where']=qs['filters'](_['pick'](_0x12f7d4[_0xbeb3('0x35')],_0x2dc0d4[_0xbeb3('0x37')]),_0x4ead3b);if(_0x12f7d4[_0xbeb3('0x35')]['filter']){_0x30fcd4[_0xbeb3('0x3f')]=_['merge'](_0x30fcd4[_0xbeb3('0x3f')],{'$or':_[_0xbeb3('0x30')](_0x4ead3b,function(_0x12156b){if(_0x12156b[_0xbeb3('0x33')]!=='VIRTUAL'){var _0x5676da={};_0x5676da[_0x12156b[_0xbeb3('0x2d')]]={'$like':'%'+_0x12f7d4[_0xbeb3('0x35')][_0xbeb3('0x40')]+'%'};return _0x5676da;}})});}_0x30fcd4=_[_0xbeb3('0x41')]({},_0x30fcd4,_0x12f7d4[_0xbeb3('0x42')]);var _0x1c31f1={'where':_0x30fcd4[_0xbeb3('0x3f')]};return db[_0xbeb3('0x31')]['count'](_0x1c31f1)[_0xbeb3('0x27')](function(_0x39f2d2){_0x3002e3[_0xbeb3('0x21')]=_0x39f2d2;if(_0x12f7d4[_0xbeb3('0x35')][_0xbeb3('0x43')]){_0x30fcd4[_0xbeb3('0x44')]=[{'all':!![]}];}return db[_0xbeb3('0x31')]['findAll'](_0x30fcd4);})[_0xbeb3('0x27')](function(_0xd0403f){_0x3002e3[_0xbeb3('0x45')]=_0xd0403f;return _0x3002e3;})[_0xbeb3('0x27')](respondWithFilteredResult(_0x411cd3,_0x30fcd4))[_0xbeb3('0x46')](handleError(_0x411cd3,null));};exports[_0xbeb3('0x47')]=function(_0x390c95,_0x42e9a2){var _0x1a213d={'raw':![],'where':{'id':_0x390c95[_0xbeb3('0x48')]['id']}},_0x18a485={};_0x18a485[_0xbeb3('0x39')]=_[_0xbeb3('0x36')](db['VoicePrefix'][_0xbeb3('0x49')]);_0x18a485[_0xbeb3('0x35')]=_[_0xbeb3('0x36')](_0x390c95['query']);_0x18a485['filters']=_[_0xbeb3('0x38')](_0x18a485[_0xbeb3('0x39')],_0x18a485[_0xbeb3('0x35')]);_0x1a213d[_0xbeb3('0x3b')]=_['intersection'](_0x18a485[_0xbeb3('0x39')],qs['fields'](_0x390c95['query'][_0xbeb3('0x3a')]));_0x1a213d[_0xbeb3('0x3b')]=_0x1a213d[_0xbeb3('0x3b')][_0xbeb3('0x3c')]?_0x1a213d['attributes']:_0x18a485[_0xbeb3('0x39')];if(_0x390c95[_0xbeb3('0x35')][_0xbeb3('0x43')]){_0x1a213d['include']=[{'all':!![]}];}_0x1a213d=_[_0xbeb3('0x41')]({},_0x1a213d,_0x390c95['options']);return db['VoicePrefix'][_0xbeb3('0x4a')](_0x1a213d)[_0xbeb3('0x27')](handleEntityNotFound(_0x42e9a2,null))[_0xbeb3('0x27')](respondWithResult(_0x42e9a2,null))['catch'](handleError(_0x42e9a2,null));};exports[_0xbeb3('0x4b')]=function(_0x312b28,_0x367942){return db['VoicePrefix'][_0xbeb3('0x4a')]({'where':{'id':_0x312b28['params']['id']}})[_0xbeb3('0x27')](handleEntityNotFound(_0x367942,null))['then'](removeEntity(_0x367942,null))[_0xbeb3('0x46')](handleError(_0x367942,null));};exports[_0xbeb3('0x4c')]=function(_0x3294c9,_0x3b48e2){return db[_0xbeb3('0x31')][_0xbeb3('0x4c')]()[_0xbeb3('0x27')](respondWithResult(_0x3b48e2,null))[_0xbeb3('0x46')](handleError(_0x3b48e2,null));};exports['create']=function(_0xde022c,_0x2416c0){var _0xa852bb;return db[_0xbeb3('0x4d')]['transaction'](function(_0x2771e3){return db[_0xbeb3('0x31')][_0xbeb3('0x4e')](_0xde022c[_0xbeb3('0x4f')],{'transaction':_0x2771e3})['then'](function(_0x2d980d){_0xa852bb=_0x2d980d['get']({'plain':!![]});return db[_0xbeb3('0x50')][_0xbeb3('0x4a')]({'where':{'id':_0xa852bb[_0xbeb3('0x51')]},'raw':!![]})['then'](function(_0x43379e){return createVoicePrefixExtensions(_0xa852bb,_0x43379e,_0x2771e3);});});})[_0xbeb3('0x27')](function(){var _0x1afd05=_0xde022c[_0xbeb3('0x52')][_0xbeb3('0x28')]({'plain':!![]});if(!_0x1afd05)throw new Error(_0xbeb3('0x53'));if(_0x1afd05[_0xbeb3('0x54')]===_0xbeb3('0x52')){var _0x27024e=_0xa852bb;return db[_0xbeb3('0x55')]['find']({'where':{'name':_0xbeb3('0x29'),'userProfileId':_0x1afd05[_0xbeb3('0x56')]},'raw':!![]})[_0xbeb3('0x27')](function(_0x8660b4){if(_0x8660b4&&_0x8660b4[_0xbeb3('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x27024e[_0xbeb3('0x2d')],'resourceId':_0x27024e['id'],'type':_0x8660b4[_0xbeb3('0x2d')],'sectionId':_0x8660b4['id']},{})['then'](function(){return _0xa852bb;});}else{return _0xa852bb;}})[_0xbeb3('0x46')](function(_0x405354){logger[_0xbeb3('0x2c')](_0xbeb3('0x58'),_0x405354);throw _0x405354;});}return _0xa852bb;})[_0xbeb3('0x27')](respondWithResult(_0x2416c0,null))[_0xbeb3('0x46')](handleError(_0x2416c0,null));};function Extension(_0x15128c,_0x5d813b,_0x31bda5,_0x40b0c0){this[_0xbeb3('0x59')]='from-sip';this[_0xbeb3('0x5a')]=_0x15128c;this[_0xbeb3('0x5b')]=_0x31bda5;this['type']=_0xbeb3('0x5c');this[_0xbeb3('0x5d')]=_0xbeb3('0x5e');this[_0xbeb3('0x5f')]=_0x5d813b;this['appdata']=_0x40b0c0;}function createVoicePrefixExtensions(_0x553e8c,_0x278d22,_0x52888c){return new BPromise(function(_0x1c8857,_0x59f2e3){var _0x2d36cb=new Extension(formatPrefixName(_0x553e8c[_0xbeb3('0x60')]),0x1,_0xbeb3('0x61'),_0xbeb3('0x62'));_0x2d36cb[_0xbeb3('0x63')]=_0x553e8c['id'];return db[_0xbeb3('0x50')][_0xbeb3('0x4e')](_0x2d36cb,{'transaction':_0x52888c})[_0xbeb3('0x27')](function(_0xc78a7a){var _0x17718a=_0xc78a7a[_0xbeb3('0x28')]({'plain':!![]});var _0x143c0c=_[_0xbeb3('0x30')](addVoicePrefixExtensions(_0x553e8c,_0x278d22),function(_0x450ea3){_0x450ea3[_0xbeb3('0x51')]=_0x17718a['id'];_0x450ea3[_0xbeb3('0x63')]=_0x553e8c['id'];return _0x450ea3;});return db[_0xbeb3('0x50')][_0xbeb3('0x64')](_0x143c0c,{'transaction':_0x52888c})['then'](function(_0x15c890){if(!_0x15c890){return _0x59f2e3(_0xbeb3('0x65'));}else{return _0x1c8857(_0x15c890);}})[_0xbeb3('0x46')](function(_0x3dd579){return _0x59f2e3(_0x3dd579);});});;});};function addVoicePrefixExtensions(_0x1dfb62,_0x515c6a){var _0x39546e=[];var _0x53e04c=formatPrefixName(_0x1dfb62[_0xbeb3('0x60')]);_0x39546e[_0xbeb3('0x66')](new Extension(_0x53e04c,0x2,_0xbeb3('0x67'),_0xbeb3('0x68')+_0x1dfb62[_0xbeb3('0x2d')]));if(_0x1dfb62[_0xbeb3('0x69')]){_0x39546e[_0xbeb3('0x66')](new Extension(_0x53e04c,0x3,_0xbeb3('0x67'),_0xbeb3('0x6a')+_0x1dfb62[_0xbeb3('0x69')]));}else{_0x39546e[_0xbeb3('0x66')](new Extension(_0x53e04c,0x3,_0xbeb3('0x61'),_0xbeb3('0x6b')));}_0x39546e[_0xbeb3('0x66')](new Extension(_0x53e04c,0x4,_0xbeb3('0x6c'),_0x515c6a[_0xbeb3('0x59')]+','+_0xbeb3('0x6d')+(0x8+_0x1dfb62[_0xbeb3('0x2d')][_0xbeb3('0x3c')])+'}'+','+0x1));return _0x39546e;}function formatPrefixName(_0x166f45){var _0x44191f='_';for(var _0x1dc478=0x0;_0x1dc478<_0x166f45[_0xbeb3('0x3c')];_0x1dc478++){if(_0x166f45[_0xbeb3('0x6e')](_0x1dc478)=='-'){_0x44191f+=_0x166f45[_0xbeb3('0x6e')](_0x1dc478);}else{_0x44191f+='['+_0x166f45[_0xbeb3('0x6e')](_0x1dc478)+']';}}_0x44191f+='.';return _0x44191f;}exports[_0xbeb3('0x26')]=function(_0x12e49d,_0x22acf9,_0x378f38){var _0xe9ad41=_0x12e49d[_0xbeb3('0x4f')];_0xe9ad41[_0xbeb3('0x60')]=_0xbeb3('0x6f')+_0xe9ad41[_0xbeb3('0x2d')]+'-';return db[_0xbeb3('0x4d')]['transaction'](function(_0x32fa71){return db[_0xbeb3('0x31')]['update'](_0xe9ad41,{'where':{'id':_0xe9ad41['id']},'transaction':_0x32fa71})[_0xbeb3('0x27')](function(){return db[_0xbeb3('0x50')][_0xbeb3('0x4b')]({'where':{'VoicePrefixId':_0xe9ad41['id']},'transaction':_0x32fa71})['then'](function(){return db['VoiceExtension'][_0xbeb3('0x4a')]({'where':{'id':_0xe9ad41[_0xbeb3('0x51')]},'raw':!![]})[_0xbeb3('0x27')](function(_0xebc0bc){return createVoicePrefixExtensions(_0xe9ad41,_0xebc0bc,_0x32fa71);});});});})[_0xbeb3('0x27')](function(){return db['VoicePrefix'][_0xbeb3('0x70')](_0xe9ad41['id']);})[_0xbeb3('0x27')](respondWithResult(_0x22acf9,null))[_0xbeb3('0x46')](handleError(_0x22acf9,null));};exports[_0xbeb3('0x71')]=function(_0x1b619a,_0x48f3e0,_0x1502a2){return db['VoicePrefix']['find']({'where':{'id':_0x1b619a[_0xbeb3('0x48')]['id']}})['then'](handleEntityNotFound(_0x48f3e0,null))[_0xbeb3('0x27')](function(_0x262563){if(_0x262563){return _0x262563[_0xbeb3('0x71')](_0x1b619a[_0xbeb3('0x4f')][_0xbeb3('0x72')],_[_0xbeb3('0x73')](_0x1b619a[_0xbeb3('0x4f')],['ids','id'])||{})[_0xbeb3('0x74')](function(_0xde4a75){for(var _0x367541=0x0;_0x367541<_0x1b619a['body']['ids'][_0xbeb3('0x3c')];_0x367541+=0x1){socket['emit']('userVoicePrefix:save',{'UserId':Number(_0x1b619a['body'][_0xbeb3('0x72')][_0x367541]),'VoicePrefixId':Number(_0x1b619a[_0xbeb3('0x48')]['id'])});}return _0xde4a75;});}})[_0xbeb3('0x27')](respondWithResult(_0x48f3e0,null))[_0xbeb3('0x46')](handleError(_0x48f3e0,null));};exports['removeAgents']=function(_0x52dc94,_0xe45627,_0x16d9dd){return db[_0xbeb3('0x31')]['find']({'where':{'id':_0x52dc94['params']['id']}})[_0xbeb3('0x27')](handleEntityNotFound(_0xe45627,null))[_0xbeb3('0x27')](function(_0x28b9c2){if(_0x28b9c2){return _0x28b9c2[_0xbeb3('0x75')](_0x52dc94[_0xbeb3('0x35')][_0xbeb3('0x72')])[_0xbeb3('0x27')](function(){if(_['isArray'](_0x52dc94['query'][_0xbeb3('0x72')])){for(var _0x3013d4=0x0;_0x3013d4<_0x52dc94['query']['ids'][_0xbeb3('0x3c')];_0x3013d4+=0x1){socket['emit'](_0xbeb3('0x76'),{'UserId':Number(_0x52dc94[_0xbeb3('0x35')][_0xbeb3('0x72')][_0x3013d4]),'VoicePrefixId':Number(_0x52dc94[_0xbeb3('0x48')]['id'])});}}else{socket[_0xbeb3('0x77')](_0xbeb3('0x76'),{'UserId':Number(_0x52dc94[_0xbeb3('0x35')][_0xbeb3('0x72')]),'VoicePrefixId':Number(_0x52dc94[_0xbeb3('0x48')]['id'])});}});}})[_0xbeb3('0x27')](respondWithStatusCode(_0xe45627,null))[_0xbeb3('0x46')](handleError(_0xe45627,null));};exports[_0xbeb3('0x78')]=function(_0x466d62,_0x153d12,_0xf931d){var _0x3f0f18={};var _0x29fd6c={};var _0x82ade6;var _0x5be6ad;return db['VoicePrefix'][_0xbeb3('0x79')]({'where':{'id':_0x466d62[_0xbeb3('0x48')]['id']}})['then'](handleEntityNotFound(_0x153d12,null))[_0xbeb3('0x27')](function(_0x5d23d4){if(_0x5d23d4){_0x82ade6=_0x5d23d4;_0x29fd6c[_0xbeb3('0x39')]=_[_0xbeb3('0x36')](db['User'][_0xbeb3('0x49')]);_0x29fd6c[_0xbeb3('0x35')]=_[_0xbeb3('0x36')](_0x466d62[_0xbeb3('0x35')]);_0x29fd6c[_0xbeb3('0x37')]=_[_0xbeb3('0x38')](_0x29fd6c[_0xbeb3('0x39')],_0x29fd6c[_0xbeb3('0x35')]);_0x3f0f18[_0xbeb3('0x3b')]=_[_0xbeb3('0x38')](_0x29fd6c[_0xbeb3('0x39')],qs[_0xbeb3('0x3a')](_0x466d62['query'][_0xbeb3('0x3a')]));_0x3f0f18[_0xbeb3('0x3b')]=_0x3f0f18[_0xbeb3('0x3b')][_0xbeb3('0x3c')]?_0x3f0f18[_0xbeb3('0x3b')]:_0x29fd6c['model'];_0x3f0f18[_0xbeb3('0x7a')]=qs[_0xbeb3('0x3e')](_0x466d62['query'][_0xbeb3('0x3e')]);_0x3f0f18['where']=qs['filters'](_[_0xbeb3('0x7b')](_0x466d62[_0xbeb3('0x35')],_0x29fd6c[_0xbeb3('0x37')]));if(_0x466d62['query'][_0xbeb3('0x40')]){_0x3f0f18[_0xbeb3('0x3f')]=_[_0xbeb3('0x41')](_0x3f0f18['where'],{'$or':_[_0xbeb3('0x30')](_0x3f0f18[_0xbeb3('0x3b')],function(_0x201677){var _0x54a50e={};_0x54a50e[_0x201677]={'$like':'%'+_0x466d62[_0xbeb3('0x35')][_0xbeb3('0x40')]+'%'};return _0x54a50e;})});}_0x3f0f18=_[_0xbeb3('0x41')]({},_0x3f0f18,_0x466d62[_0xbeb3('0x42')]);return _0x82ade6[_0xbeb3('0x78')](_0x3f0f18);}})['then'](function(_0xdb820a){if(_0xdb820a){_0x5be6ad=_0xdb820a['length'];if(!_0x466d62[_0xbeb3('0x35')][_0xbeb3('0x3d')](_0xbeb3('0x7c'))){_0x3f0f18['limit']=qs[_0xbeb3('0x1f')](_0x466d62[_0xbeb3('0x35')][_0xbeb3('0x1f')]);_0x3f0f18[_0xbeb3('0x1e')]=qs[_0xbeb3('0x1e')](_0x466d62[_0xbeb3('0x35')]['offset']);}return _0x82ade6['getAgents'](_0x3f0f18);}})[_0xbeb3('0x27')](function(_0x393b66){if(_0x393b66){return _0x393b66?{'count':_0x5be6ad,'rows':_0x393b66}:null;}})[_0xbeb3('0x27')](respondWithResult(_0x153d12,null))['catch'](handleError(_0x153d12,null));};exports[_0xbeb3('0x7d')]=function(_0x4d5d73,_0x26a52d,_0x332543){var _0x4f44fb={};var _0x5c13e0={};var _0x2a9a98;var _0x560a0c;return db[_0xbeb3('0x31')][_0xbeb3('0x79')]({'where':{'id':_0x4d5d73['params']['id']}})[_0xbeb3('0x27')](handleEntityNotFound(_0x26a52d,null))['then'](function(_0x179de1){if(_0x179de1){_0x2a9a98=_0x179de1;_0x5c13e0['model']=_[_0xbeb3('0x36')](db[_0xbeb3('0x7e')][_0xbeb3('0x49')]);_0x5c13e0[_0xbeb3('0x35')]=_[_0xbeb3('0x36')](_0x4d5d73[_0xbeb3('0x35')]);_0x5c13e0[_0xbeb3('0x37')]=_[_0xbeb3('0x38')](_0x5c13e0['model'],_0x5c13e0['query']);_0x4f44fb[_0xbeb3('0x3b')]=_[_0xbeb3('0x38')](_0x5c13e0[_0xbeb3('0x39')],qs['fields'](_0x4d5d73[_0xbeb3('0x35')][_0xbeb3('0x3a')]));_0x4f44fb[_0xbeb3('0x3b')]=_0x4f44fb[_0xbeb3('0x3b')][_0xbeb3('0x3c')]?_0x4f44fb['attributes']:_0x5c13e0[_0xbeb3('0x39')];_0x4f44fb[_0xbeb3('0x7a')]=qs[_0xbeb3('0x3e')](_0x4d5d73['query'][_0xbeb3('0x3e')]);_0x4f44fb[_0xbeb3('0x3f')]=qs[_0xbeb3('0x37')](_[_0xbeb3('0x7b')](_0x4d5d73[_0xbeb3('0x35')],_0x5c13e0[_0xbeb3('0x37')]));if(_0x4d5d73[_0xbeb3('0x35')]['filter']){_0x4f44fb[_0xbeb3('0x3f')]=_[_0xbeb3('0x41')](_0x4f44fb[_0xbeb3('0x3f')],{'$or':_[_0xbeb3('0x30')](_0x4f44fb[_0xbeb3('0x3b')],function(_0x3e53af){var _0x52ef84={};_0x52ef84[_0x3e53af]={'$like':'%'+_0x4d5d73[_0xbeb3('0x35')][_0xbeb3('0x40')]+'%'};return _0x52ef84;})});}_0x4f44fb=_[_0xbeb3('0x41')]({},_0x4f44fb,_0x4d5d73['options']);return _0x2a9a98['getTeams'](_0x4f44fb);}})['then'](function(_0x14a29d){if(_0x14a29d){_0x560a0c=_0x14a29d['length'];if(!_0x4d5d73['query'][_0xbeb3('0x3d')]('nolimit')){_0x4f44fb['limit']=qs[_0xbeb3('0x1f')](_0x4d5d73['query'][_0xbeb3('0x1f')]);_0x4f44fb[_0xbeb3('0x1e')]=qs[_0xbeb3('0x1e')](_0x4d5d73['query'][_0xbeb3('0x1e')]);}return _0x2a9a98['getTeams'](_0x4f44fb);}})[_0xbeb3('0x27')](function(_0x104dd9){if(_0x104dd9){return _0x104dd9?{'count':_0x560a0c,'rows':_0x104dd9}:null;}})[_0xbeb3('0x27')](respondWithResult(_0x26a52d,null))[_0xbeb3('0x46')](handleError(_0x26a52d,null));};exports[_0xbeb3('0x7f')]=function(_0x3732be,_0x121994,_0x4e400e){var _0x226858=_0x3732be['body']['ids'];var _0x564ec8;return db['Team'][_0xbeb3('0x80')]({'where':{'id':_0x226858},'attributes':['id'],'include':[{'model':db[_0xbeb3('0x81')],'as':_0xbeb3('0x82'),'attributes':['id','name',_0xbeb3('0x83'),_0xbeb3('0x84'),_0xbeb3('0x85')],'raw':!![]}]})[_0xbeb3('0x27')](function(_0x212e32){if(_0x212e32){_0x564ec8=_0x212e32;var _0x432cdf=_[_0xbeb3('0x86')](_0x212e32,function(_0x475b09){var _0x1703ff=_0x475b09['get']({'plain':!![]});return _0x1703ff[_0xbeb3('0x82')];});return db['VoicePrefix'][_0xbeb3('0x4a')]({'where':{'id':_0x3732be[_0xbeb3('0x48')]['id']}})[_0xbeb3('0x27')](function(_0x25f2b4){return db['sequelize'][_0xbeb3('0x87')](function(_0x531dd8){return _0x25f2b4[_0xbeb3('0x7f')](_0x226858,{'transaction':_0x531dd8})[_0xbeb3('0x27')](function(){return BPromise[_0xbeb3('0x88')](_0x564ec8,function(_0x53f0c3){return db[_0xbeb3('0x89')][_0xbeb3('0x8a')]({'TeamId':_0x53f0c3['id'],'VoicePrefixId':_0x3732be[_0xbeb3('0x48')]['id']},{'transaction':_0x531dd8});});})[_0xbeb3('0x27')](function(){return BPromise[_0xbeb3('0x88')](_0x432cdf,function(_0x26897b){return db[_0xbeb3('0x8b')][_0xbeb3('0x8c')]({'where':{'UserId':_0x26897b['id'],'VoicePrefixId':_0x3732be[_0xbeb3('0x48')]['id']},'transaction':_0x531dd8});});})[_0xbeb3('0x27')](function(){_0x432cdf['forEach'](function(_0x6480d0){socket[_0xbeb3('0x77')]('userVoicePrefix:save',{'UserId':_0x6480d0['id'],'VoicePrefixId':_0x25f2b4['id']});});});});});}})[_0xbeb3('0x27')](respondWithStatusCode(_0x121994,null))[_0xbeb3('0x46')](handleError(_0x121994,null));};exports['removeTeams']=function(_0x296b8f,_0x76df64,_0x2744ed){return db['Team']['findAll']({'where':{'id':_0x296b8f[_0xbeb3('0x35')][_0xbeb3('0x72')]},'attributes':['id'],'include':[{'model':db[_0xbeb3('0x81')],'as':_0xbeb3('0x82'),'attributes':['id'],'raw':!![]}]})[_0xbeb3('0x27')](handleEntityNotFound(_0x76df64,null))['then'](function(_0x2dea1d){var _0x5f266f=_['map'](_0x2dea1d,'id');var _0x38b933=[];var _0xfbecae=[];var _0x8e33e8=squel[_0xbeb3('0x8d')]();_0x8e33e8[_0xbeb3('0x8e')](_0xbeb3('0x8f'))[_0xbeb3('0x90')](_0xbeb3('0x91'),'tq')[_0xbeb3('0x92')](_0xbeb3('0x93'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xbeb3('0x3f')](_0xbeb3('0x94'),_0x296b8f[_0xbeb3('0x48')]['id']);for(var _0xdf203a=0x0;_0xdf203a<_0x2dea1d[_0xbeb3('0x3c')];_0xdf203a+=0x1){let _0xa80e4a=_0x2dea1d[_0xdf203a];for(var _0x41ab0a=0x0;_0x41ab0a<_0xa80e4a[_0xbeb3('0x82')][_0xbeb3('0x3c')];_0x41ab0a+=0x1){let _0x845f14=_0xa80e4a['Agents'][_0x41ab0a];var _0x2c805=_0x8e33e8[_0xbeb3('0x95')]();_0x2c805[_0xbeb3('0x3f')](_0xbeb3('0x96'),_0x845f14['id']);_0xfbecae[_0xbeb3('0x66')](db[_0xbeb3('0x4d')][_0xbeb3('0x35')](_0x2c805['toString'](),{'type':db[_0xbeb3('0x4d')]['QueryTypes'][_0xbeb3('0x97')]})[_0xbeb3('0x27')](function(_0x5d5ca6){if(_0x5d5ca6[_0xbeb3('0x3c')]===0x1){return _0x845f14['id'];}else{var _0xea74ad=_[_0xbeb3('0x98')](_['map'](_0x5d5ca6,_0xbeb3('0x99')),function(_0x2601bd){return _[_0xbeb3('0x9a')](_0x5f266f,_0x2601bd);});if(_0xea74ad){return _0x845f14['id'];}}}));}}return BPromise[_0xbeb3('0x9b')](_0xfbecae)[_0xbeb3('0x27')](function(_0x1fe82c){_0x38b933=_(_0x38b933)[_0xbeb3('0x9c')](_0x1fe82c)[_0xbeb3('0x9d')]()[_0xbeb3('0x9e')]();return db['VoicePrefix'][_0xbeb3('0x4a')]({'where':{'id':_0x296b8f['params']['id']}})[_0xbeb3('0x27')](function(_0x29b9fb){return db[_0xbeb3('0x4d')][_0xbeb3('0x87')](function(_0x1ab1bf){return _0x29b9fb[_0xbeb3('0x9f')](_0x296b8f[_0xbeb3('0x35')]['ids'],{'transaction':_0x1ab1bf})[_0xbeb3('0x27')](function(){if(!_[_0xbeb3('0xa0')](_0x38b933)){return _0x29b9fb['removeAgents'](_0x38b933,{'transaction':_0x1ab1bf});}})[_0xbeb3('0x27')](function(){_0x38b933[_0xbeb3('0xa1')](function(_0x4ec623){socket['emit'](_0xbeb3('0x76'),{'UserId':_0x4ec623,'VoicePrefixId':_0x29b9fb['id']});});});});});});})[_0xbeb3('0x27')](respondWithStatusCode(_0x76df64,null))[_0xbeb3('0x46')](handleError(_0x76df64,null));};
\ No newline at end of file
+var _0x02ce=['apply','reject','save','update','destroy','then','get','VoicePrefixes','UserProfileResource','sendStatus','error','name','send','index','map','VoicePrefix','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','includeAll','include','findAll','rows','show','params','length','find','catch','sequelize','body','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','create','context','from-sip','exten','app','type','description','Voice\x20Prefix\x20Extension','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','callerIdAll','Set','PREFIX-CALLERIDALL=','${EXTEN:','charAt','system-','transaction','VoiceExtension','findById','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','getAgents','User','pick','findOne','Team','getTeams','addTeams','online','voicePause','flatMap','Agents','each','TeamVoicePrefix','upsert','forEach','removeTeams','select','field','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','includes','union','compact','value','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voicePrefix.socket','status','end','json','undefined','limit','count','offset','set'];(function(_0x24311b,_0x5726f6){var _0x4ba635=function(_0x14f800){while(--_0x14f800){_0x24311b['push'](_0x24311b['shift']());}};_0x4ba635(++_0x5726f6);}(_0x02ce,0x1ac));var _0xe02c=function(_0x2919c6,_0x3bf642){_0x2919c6=_0x2919c6-0x0;var _0x312ae8=_0x02ce[_0x2919c6];return _0x312ae8;};'use strict';var emlformat=require(_0xe02c('0x0'));var rimraf=require(_0xe02c('0x1'));var zipdir=require(_0xe02c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe02c('0x3'));var moment=require('moment');var BPromise=require(_0xe02c('0x4'));var Mustache=require(_0xe02c('0x5'));var util=require(_0xe02c('0x6'));var path=require(_0xe02c('0x7'));var sox=require(_0xe02c('0x8'));var csv=require(_0xe02c('0x9'));var ejs=require(_0xe02c('0xa'));var fs=require('fs');var fs_extra=require(_0xe02c('0xb'));var _=require(_0xe02c('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe02c('0xd'));var deskjs=require(_0xe02c('0xe'));var toCsv=require(_0xe02c('0x9'));var querystring=require(_0xe02c('0xf'));var Papa=require(_0xe02c('0x10'));var Redis=require(_0xe02c('0x11'));var authService=require(_0xe02c('0x12'));var qs=require(_0xe02c('0x13'));var as=require(_0xe02c('0x14'));var hardwareService=require(_0xe02c('0x15'));var logger=require(_0xe02c('0x16'))(_0xe02c('0x17'));var utils=require(_0xe02c('0x18'));var config=require(_0xe02c('0x19'));var licenseUtil=require(_0xe02c('0x1a'));var db=require(_0xe02c('0x1b'))['db'];config[_0xe02c('0x1c')]=_[_0xe02c('0x1d')](config['redis'],{'host':_0xe02c('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe02c('0x1f'))['register'](socket);function respondWithStatusCode(_0x221910,_0x59614c){_0x59614c=_0x59614c||0xcc;return function(_0x3a5a2c){if(_0x3a5a2c){return _0x221910['sendStatus'](_0x59614c);}return _0x221910[_0xe02c('0x20')](_0x59614c)[_0xe02c('0x21')]();};}function respondWithResult(_0x59f2f6,_0x10a2a6){_0x10a2a6=_0x10a2a6||0xc8;return function(_0x226a80){if(_0x226a80){return _0x59f2f6['status'](_0x10a2a6)[_0xe02c('0x22')](_0x226a80);}};}function respondWithFilteredResult(_0x20f492,_0x5a4583){return function(_0x52917f){if(_0x52917f){var _0x3e37bf=typeof _0x5a4583['offset']===_0xe02c('0x23')&&typeof _0x5a4583[_0xe02c('0x24')]===_0xe02c('0x23');var _0x36fed0=_0x52917f[_0xe02c('0x25')];var _0x54c5b0=_0x3e37bf?0x0:_0x5a4583[_0xe02c('0x26')];var _0x59026f=_0x3e37bf?_0x52917f['count']:_0x5a4583[_0xe02c('0x26')]+_0x5a4583[_0xe02c('0x24')];var _0x480b9a;if(_0x59026f>=_0x36fed0){_0x59026f=_0x36fed0;_0x480b9a=0xc8;}else{_0x480b9a=0xce;}_0x20f492[_0xe02c('0x20')](_0x480b9a);return _0x20f492[_0xe02c('0x27')]('Content-Range',_0x54c5b0+'-'+_0x59026f+'/'+_0x36fed0)[_0xe02c('0x22')](_0x52917f);}return null;};}function patchUpdates(_0x45fd82){return function(_0x39b00c){try{jsonpatch[_0xe02c('0x28')](_0x39b00c,_0x45fd82,!![]);}catch(_0x2d44c8){return BPromise[_0xe02c('0x29')](_0x2d44c8);}return _0x39b00c[_0xe02c('0x2a')]();};}function saveUpdates(_0xf41d4c,_0xeae877){return function(_0x18b538){if(_0x18b538){return _0x18b538[_0xe02c('0x2b')](_0xf41d4c)['then'](function(_0xefd882){return _0xefd882;});}return null;};}function removeEntity(_0x4411d8,_0x3592ca){return function(_0x14ffba){if(_0x14ffba){return _0x14ffba[_0xe02c('0x2c')]()[_0xe02c('0x2d')](function(){var _0x43dc78=_0x14ffba[_0xe02c('0x2e')]({'plain':!![]});var _0x55ef2a=_0xe02c('0x2f');return db[_0xe02c('0x30')][_0xe02c('0x2c')]({'where':{'type':_0x55ef2a,'resourceId':_0x43dc78['id']}})['then'](function(){return _0x14ffba;});})[_0xe02c('0x2d')](function(){_0x4411d8[_0xe02c('0x20')](0xcc)[_0xe02c('0x21')]();});}};}function handleEntityNotFound(_0x287f7e,_0x1e7eab){return function(_0x35a309){if(!_0x35a309){_0x287f7e[_0xe02c('0x31')](0x194);}return _0x35a309;};}function handleError(_0x1b8f21,_0x9ee479){_0x9ee479=_0x9ee479||0x1f4;return function(_0x288004){logger[_0xe02c('0x32')](_0x288004['stack']);if(_0x288004[_0xe02c('0x33')]){delete _0x288004[_0xe02c('0x33')];}_0x1b8f21[_0xe02c('0x20')](_0x9ee479)[_0xe02c('0x34')](_0x288004);};}exports[_0xe02c('0x35')]=function(_0x14d27a,_0x58bf16){var _0x436bcc={},_0x1e605c={},_0x4fc4fd={'count':0x0,'rows':[]};var _0x1ce34c=_[_0xe02c('0x36')](db[_0xe02c('0x37')][_0xe02c('0x38')],function(_0x2b5ebe){return{'name':_0x2b5ebe['fieldName'],'type':_0x2b5ebe['type'][_0xe02c('0x39')]};});_0x1e605c[_0xe02c('0x3a')]=_['map'](_0x1ce34c,_0xe02c('0x33'));_0x1e605c['query']=_[_0xe02c('0x3b')](_0x14d27a[_0xe02c('0x3c')]);_0x1e605c[_0xe02c('0x3d')]=_[_0xe02c('0x3e')](_0x1e605c[_0xe02c('0x3a')],_0x1e605c['query']);_0x436bcc[_0xe02c('0x3f')]=_['intersection'](_0x1e605c[_0xe02c('0x3a')],qs[_0xe02c('0x40')](_0x14d27a[_0xe02c('0x3c')][_0xe02c('0x40')]));_0x436bcc[_0xe02c('0x3f')]=_0x436bcc[_0xe02c('0x3f')]['length']?_0x436bcc[_0xe02c('0x3f')]:_0x1e605c[_0xe02c('0x3a')];if(!_0x14d27a['query'][_0xe02c('0x41')](_0xe02c('0x42'))){_0x436bcc['limit']=qs[_0xe02c('0x24')](_0x14d27a['query'][_0xe02c('0x24')]);_0x436bcc[_0xe02c('0x26')]=qs['offset'](_0x14d27a[_0xe02c('0x3c')][_0xe02c('0x26')]);}_0x436bcc[_0xe02c('0x43')]=qs[_0xe02c('0x44')](_0x14d27a[_0xe02c('0x3c')][_0xe02c('0x44')]);_0x436bcc['where']=qs[_0xe02c('0x3d')](_['pick'](_0x14d27a['query'],_0x1e605c[_0xe02c('0x3d')]),_0x1ce34c);if(_0x14d27a[_0xe02c('0x3c')][_0xe02c('0x45')]){_0x436bcc[_0xe02c('0x46')]=_['merge'](_0x436bcc[_0xe02c('0x46')],{'$or':_[_0xe02c('0x36')](_0x1ce34c,function(_0x163573){if(_0x163573['type']!=='VIRTUAL'){var _0x33c6da={};_0x33c6da[_0x163573[_0xe02c('0x33')]]={'$like':'%'+_0x14d27a[_0xe02c('0x3c')][_0xe02c('0x45')]+'%'};return _0x33c6da;}})});}_0x436bcc=_[_0xe02c('0x47')]({},_0x436bcc,_0x14d27a[_0xe02c('0x48')]);var _0x25f8ae={'where':_0x436bcc[_0xe02c('0x46')]};return db[_0xe02c('0x37')]['count'](_0x25f8ae)[_0xe02c('0x2d')](function(_0x5ef4a1){_0x4fc4fd['count']=_0x5ef4a1;if(_0x14d27a[_0xe02c('0x3c')][_0xe02c('0x49')]){_0x436bcc[_0xe02c('0x4a')]=[{'all':!![]}];}return db[_0xe02c('0x37')][_0xe02c('0x4b')](_0x436bcc);})[_0xe02c('0x2d')](function(_0x165f4a){_0x4fc4fd[_0xe02c('0x4c')]=_0x165f4a;return _0x4fc4fd;})['then'](respondWithFilteredResult(_0x58bf16,_0x436bcc))['catch'](handleError(_0x58bf16,null));};exports[_0xe02c('0x4d')]=function(_0xf89a57,_0x304ece){var _0x52f239={'raw':![],'where':{'id':_0xf89a57[_0xe02c('0x4e')]['id']}},_0x1cf443={};_0x1cf443[_0xe02c('0x3a')]=_[_0xe02c('0x3b')](db[_0xe02c('0x37')][_0xe02c('0x38')]);_0x1cf443[_0xe02c('0x3c')]=_[_0xe02c('0x3b')](_0xf89a57[_0xe02c('0x3c')]);_0x1cf443[_0xe02c('0x3d')]=_['intersection'](_0x1cf443[_0xe02c('0x3a')],_0x1cf443[_0xe02c('0x3c')]);_0x52f239[_0xe02c('0x3f')]=_[_0xe02c('0x3e')](_0x1cf443[_0xe02c('0x3a')],qs[_0xe02c('0x40')](_0xf89a57[_0xe02c('0x3c')][_0xe02c('0x40')]));_0x52f239[_0xe02c('0x3f')]=_0x52f239[_0xe02c('0x3f')][_0xe02c('0x4f')]?_0x52f239[_0xe02c('0x3f')]:_0x1cf443[_0xe02c('0x3a')];if(_0xf89a57['query'][_0xe02c('0x49')]){_0x52f239['include']=[{'all':!![]}];}_0x52f239=_[_0xe02c('0x47')]({},_0x52f239,_0xf89a57[_0xe02c('0x48')]);return db[_0xe02c('0x37')][_0xe02c('0x50')](_0x52f239)[_0xe02c('0x2d')](handleEntityNotFound(_0x304ece,null))[_0xe02c('0x2d')](respondWithResult(_0x304ece,null))[_0xe02c('0x51')](handleError(_0x304ece,null));};exports[_0xe02c('0x2c')]=function(_0xc6ea7b,_0x385497){return db['VoicePrefix'][_0xe02c('0x50')]({'where':{'id':_0xc6ea7b[_0xe02c('0x4e')]['id']}})[_0xe02c('0x2d')](handleEntityNotFound(_0x385497,null))['then'](removeEntity(_0x385497,null))[_0xe02c('0x51')](handleError(_0x385497,null));};exports['describe']=function(_0x21a126,_0x56b9e2){return db['VoicePrefix']['describe']()['then'](respondWithResult(_0x56b9e2,null))['catch'](handleError(_0x56b9e2,null));};exports['create']=function(_0x107f3f,_0x3ac0a5){var _0x1510aa;return db[_0xe02c('0x52')]['transaction'](function(_0x274beb){return db[_0xe02c('0x37')]['create'](_0x107f3f[_0xe02c('0x53')],{'transaction':_0x274beb})[_0xe02c('0x2d')](function(_0x221e5e){_0x1510aa=_0x221e5e['get']({'plain':!![]});return db['VoiceExtension'][_0xe02c('0x50')]({'where':{'id':_0x1510aa[_0xe02c('0x54')]},'raw':!![]})[_0xe02c('0x2d')](function(_0x5b2d2b){return createVoicePrefixExtensions(_0x1510aa,_0x5b2d2b,_0x274beb);});});})[_0xe02c('0x2d')](function(){var _0x53765c=_0x107f3f['user'][_0xe02c('0x2e')]({'plain':!![]});if(!_0x53765c)throw new Error(_0xe02c('0x55'));if(_0x53765c['role']===_0xe02c('0x56')){var _0x849eea=_0x1510aa;return db[_0xe02c('0x57')]['find']({'where':{'name':_0xe02c('0x2f'),'userProfileId':_0x53765c[_0xe02c('0x58')]},'raw':!![]})['then'](function(_0x3788e8){if(_0x3788e8&&_0x3788e8[_0xe02c('0x59')]===0x0){return db[_0xe02c('0x30')][_0xe02c('0x5a')]({'name':_0x849eea[_0xe02c('0x33')],'resourceId':_0x849eea['id'],'type':_0x3788e8[_0xe02c('0x33')],'sectionId':_0x3788e8['id']},{})[_0xe02c('0x2d')](function(){return _0x1510aa;});}else{return _0x1510aa;}})[_0xe02c('0x51')](function(_0xf7e836){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xf7e836);throw _0xf7e836;});}return _0x1510aa;})['then'](respondWithResult(_0x3ac0a5,null))[_0xe02c('0x51')](handleError(_0x3ac0a5,null));};function Extension(_0x299770,_0x42f2fd,_0x496eb1,_0x4eb35d){this[_0xe02c('0x5b')]=_0xe02c('0x5c');this[_0xe02c('0x5d')]=_0x299770;this[_0xe02c('0x5e')]=_0x496eb1;this[_0xe02c('0x5f')]='system';this[_0xe02c('0x60')]=_0xe02c('0x61');this['priority']=_0x42f2fd;this['appdata']=_0x4eb35d;}function createVoicePrefixExtensions(_0x879d99,_0x566204,_0x4da197){return new BPromise(function(_0x480d49,_0x3b19c9){var _0x28d7a2=new Extension(formatPrefixName(_0x879d99[_0xe02c('0x62')]),0x1,_0xe02c('0x63'),_0xe02c('0x64'));_0x28d7a2[_0xe02c('0x65')]=_0x879d99['id'];return db['VoiceExtension'][_0xe02c('0x5a')](_0x28d7a2,{'transaction':_0x4da197})['then'](function(_0x4f3c9a){var _0x185dc2=_0x4f3c9a[_0xe02c('0x2e')]({'plain':!![]});var _0x44ba68=_[_0xe02c('0x36')](addVoicePrefixExtensions(_0x879d99,_0x566204),function(_0x5b6979){_0x5b6979[_0xe02c('0x54')]=_0x185dc2['id'];_0x5b6979[_0xe02c('0x65')]=_0x879d99['id'];return _0x5b6979;});return db['VoiceExtension'][_0xe02c('0x66')](_0x44ba68,{'transaction':_0x4da197})[_0xe02c('0x2d')](function(_0x4cc74d){if(!_0x4cc74d){return _0x3b19c9(_0xe02c('0x67'));}else{return _0x480d49(_0x4cc74d);}})[_0xe02c('0x51')](function(_0x44f28f){return _0x3b19c9(_0x44f28f);});});;});};function addVoicePrefixExtensions(_0x4053e6,_0x323f3b){var _0x3a62a2=[];var _0x31b281=formatPrefixName(_0x4053e6['prefix']);_0x3a62a2[_0xe02c('0x68')](new Extension(_0x31b281,0x2,'Set','CDR(prefix)='+_0x4053e6['name']));if(_0x4053e6[_0xe02c('0x69')]){_0x3a62a2[_0xe02c('0x68')](new Extension(_0x31b281,0x3,_0xe02c('0x6a'),_0xe02c('0x6b')+_0x4053e6['callerIdAll']));}else{_0x3a62a2[_0xe02c('0x68')](new Extension(_0x31b281,0x3,_0xe02c('0x63'),'No\x20callerid\x20available'));}_0x3a62a2['push'](new Extension(_0x31b281,0x4,'goto',_0x323f3b[_0xe02c('0x5b')]+','+_0xe02c('0x6c')+(0x8+_0x4053e6['name']['length'])+'}'+','+0x1));return _0x3a62a2;}function formatPrefixName(_0x38789c){var _0x30ad9f='_';for(var _0x120ef1=0x0;_0x120ef1<_0x38789c[_0xe02c('0x4f')];_0x120ef1++){if(_0x38789c[_0xe02c('0x6d')](_0x120ef1)=='-'){_0x30ad9f+=_0x38789c['charAt'](_0x120ef1);}else{_0x30ad9f+='['+_0x38789c[_0xe02c('0x6d')](_0x120ef1)+']';}}_0x30ad9f+='.';return _0x30ad9f;}exports[_0xe02c('0x2b')]=function(_0x3f277b,_0x2776c0,_0x11c506){var _0x119119=_0x3f277b['body'];_0x119119[_0xe02c('0x62')]=_0xe02c('0x6e')+_0x119119['name']+'-';return db[_0xe02c('0x52')][_0xe02c('0x6f')](function(_0x123ca9){return db[_0xe02c('0x37')]['update'](_0x119119,{'where':{'id':_0x119119['id']},'transaction':_0x123ca9})[_0xe02c('0x2d')](function(){return db[_0xe02c('0x70')]['destroy']({'where':{'VoicePrefixId':_0x119119['id']},'transaction':_0x123ca9})['then'](function(){return db['VoiceExtension'][_0xe02c('0x50')]({'where':{'id':_0x119119[_0xe02c('0x54')]},'raw':!![]})[_0xe02c('0x2d')](function(_0x34e692){return createVoicePrefixExtensions(_0x119119,_0x34e692,_0x123ca9);});});});})[_0xe02c('0x2d')](function(){return db['VoicePrefix'][_0xe02c('0x71')](_0x119119['id']);})[_0xe02c('0x2d')](respondWithResult(_0x2776c0,null))[_0xe02c('0x51')](handleError(_0x2776c0,null));};exports['addAgents']=function(_0x4a7783,_0x4c3c91,_0x3cd802){return db[_0xe02c('0x37')][_0xe02c('0x50')]({'where':{'id':_0x4a7783[_0xe02c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4c3c91,null))[_0xe02c('0x2d')](function(_0x48f524){if(_0x48f524){return _0x48f524['addAgents'](_0x4a7783[_0xe02c('0x53')][_0xe02c('0x72')],_[_0xe02c('0x73')](_0x4a7783[_0xe02c('0x53')],[_0xe02c('0x72'),'id'])||{})[_0xe02c('0x74')](function(_0x748217){for(var _0x12aaea=0x0;_0x12aaea<_0x4a7783['body'][_0xe02c('0x72')][_0xe02c('0x4f')];_0x12aaea+=0x1){socket[_0xe02c('0x75')](_0xe02c('0x76'),{'UserId':Number(_0x4a7783[_0xe02c('0x53')][_0xe02c('0x72')][_0x12aaea]),'VoicePrefixId':Number(_0x4a7783[_0xe02c('0x4e')]['id'])});}return _0x748217;});}})[_0xe02c('0x2d')](respondWithResult(_0x4c3c91,null))[_0xe02c('0x51')](handleError(_0x4c3c91,null));};exports[_0xe02c('0x77')]=function(_0x5e6df5,_0x58acfd,_0x120dd7){return db[_0xe02c('0x37')][_0xe02c('0x50')]({'where':{'id':_0x5e6df5[_0xe02c('0x4e')]['id']}})[_0xe02c('0x2d')](handleEntityNotFound(_0x58acfd,null))['then'](function(_0x405b16){if(_0x405b16){return _0x405b16[_0xe02c('0x77')](_0x5e6df5[_0xe02c('0x3c')][_0xe02c('0x72')])[_0xe02c('0x2d')](function(){if(_[_0xe02c('0x78')](_0x5e6df5[_0xe02c('0x3c')][_0xe02c('0x72')])){for(var _0x1d594c=0x0;_0x1d594c<_0x5e6df5[_0xe02c('0x3c')][_0xe02c('0x72')][_0xe02c('0x4f')];_0x1d594c+=0x1){socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x5e6df5[_0xe02c('0x3c')][_0xe02c('0x72')][_0x1d594c]),'VoicePrefixId':Number(_0x5e6df5['params']['id'])});}}else{socket[_0xe02c('0x75')]('userVoicePrefix:remove',{'UserId':Number(_0x5e6df5[_0xe02c('0x3c')]['ids']),'VoicePrefixId':Number(_0x5e6df5[_0xe02c('0x4e')]['id'])});}});}})[_0xe02c('0x2d')](respondWithStatusCode(_0x58acfd,null))[_0xe02c('0x51')](handleError(_0x58acfd,null));};exports[_0xe02c('0x79')]=function(_0x28755a,_0x3c44d3,_0x119439){var _0x10d067={};var _0x3d3954={};var _0xd0d895;var _0x567478;return db['VoicePrefix']['findOne']({'where':{'id':_0x28755a[_0xe02c('0x4e')]['id']}})[_0xe02c('0x2d')](handleEntityNotFound(_0x3c44d3,null))[_0xe02c('0x2d')](function(_0x1133ce){if(_0x1133ce){_0xd0d895=_0x1133ce;_0x3d3954[_0xe02c('0x3a')]=_[_0xe02c('0x3b')](db[_0xe02c('0x7a')][_0xe02c('0x38')]);_0x3d3954[_0xe02c('0x3c')]=_[_0xe02c('0x3b')](_0x28755a[_0xe02c('0x3c')]);_0x3d3954[_0xe02c('0x3d')]=_[_0xe02c('0x3e')](_0x3d3954['model'],_0x3d3954['query']);_0x10d067[_0xe02c('0x3f')]=_[_0xe02c('0x3e')](_0x3d3954[_0xe02c('0x3a')],qs['fields'](_0x28755a[_0xe02c('0x3c')][_0xe02c('0x40')]));_0x10d067[_0xe02c('0x3f')]=_0x10d067[_0xe02c('0x3f')][_0xe02c('0x4f')]?_0x10d067['attributes']:_0x3d3954[_0xe02c('0x3a')];_0x10d067[_0xe02c('0x43')]=qs[_0xe02c('0x44')](_0x28755a['query'][_0xe02c('0x44')]);_0x10d067[_0xe02c('0x46')]=qs[_0xe02c('0x3d')](_[_0xe02c('0x7b')](_0x28755a[_0xe02c('0x3c')],_0x3d3954['filters']));if(_0x28755a[_0xe02c('0x3c')][_0xe02c('0x45')]){_0x10d067[_0xe02c('0x46')]=_['merge'](_0x10d067[_0xe02c('0x46')],{'$or':_[_0xe02c('0x36')](_0x10d067[_0xe02c('0x3f')],function(_0x3a5ec8){var _0x45e463={};_0x45e463[_0x3a5ec8]={'$like':'%'+_0x28755a['query'][_0xe02c('0x45')]+'%'};return _0x45e463;})});}_0x10d067=_[_0xe02c('0x47')]({},_0x10d067,_0x28755a['options']);return _0xd0d895[_0xe02c('0x79')](_0x10d067);}})['then'](function(_0x52fcd6){if(_0x52fcd6){_0x567478=_0x52fcd6['length'];if(!_0x28755a[_0xe02c('0x3c')][_0xe02c('0x41')](_0xe02c('0x42'))){_0x10d067[_0xe02c('0x24')]=qs[_0xe02c('0x24')](_0x28755a[_0xe02c('0x3c')][_0xe02c('0x24')]);_0x10d067[_0xe02c('0x26')]=qs[_0xe02c('0x26')](_0x28755a[_0xe02c('0x3c')][_0xe02c('0x26')]);}return _0xd0d895[_0xe02c('0x79')](_0x10d067);}})[_0xe02c('0x2d')](function(_0xfe0b1c){if(_0xfe0b1c){return _0xfe0b1c?{'count':_0x567478,'rows':_0xfe0b1c}:null;}})[_0xe02c('0x2d')](respondWithResult(_0x3c44d3,null))[_0xe02c('0x51')](handleError(_0x3c44d3,null));};exports['getTeams']=function(_0x283de9,_0x4cfbc0,_0x3650cb){var _0xdc8df0={};var _0x4564f1={};var _0x2c6d29;var _0x5b75ed;return db[_0xe02c('0x37')][_0xe02c('0x7c')]({'where':{'id':_0x283de9[_0xe02c('0x4e')]['id']}})[_0xe02c('0x2d')](handleEntityNotFound(_0x4cfbc0,null))[_0xe02c('0x2d')](function(_0xced62f){if(_0xced62f){_0x2c6d29=_0xced62f;_0x4564f1[_0xe02c('0x3a')]=_['keys'](db[_0xe02c('0x7d')][_0xe02c('0x38')]);_0x4564f1['query']=_[_0xe02c('0x3b')](_0x283de9['query']);_0x4564f1['filters']=_[_0xe02c('0x3e')](_0x4564f1[_0xe02c('0x3a')],_0x4564f1[_0xe02c('0x3c')]);_0xdc8df0[_0xe02c('0x3f')]=_['intersection'](_0x4564f1['model'],qs[_0xe02c('0x40')](_0x283de9[_0xe02c('0x3c')]['fields']));_0xdc8df0[_0xe02c('0x3f')]=_0xdc8df0[_0xe02c('0x3f')][_0xe02c('0x4f')]?_0xdc8df0[_0xe02c('0x3f')]:_0x4564f1[_0xe02c('0x3a')];_0xdc8df0[_0xe02c('0x43')]=qs['sort'](_0x283de9[_0xe02c('0x3c')][_0xe02c('0x44')]);_0xdc8df0[_0xe02c('0x46')]=qs[_0xe02c('0x3d')](_[_0xe02c('0x7b')](_0x283de9[_0xe02c('0x3c')],_0x4564f1[_0xe02c('0x3d')]));if(_0x283de9[_0xe02c('0x3c')][_0xe02c('0x45')]){_0xdc8df0[_0xe02c('0x46')]=_[_0xe02c('0x47')](_0xdc8df0[_0xe02c('0x46')],{'$or':_[_0xe02c('0x36')](_0xdc8df0[_0xe02c('0x3f')],function(_0x5c4ed7){var _0x1abb2d={};_0x1abb2d[_0x5c4ed7]={'$like':'%'+_0x283de9[_0xe02c('0x3c')][_0xe02c('0x45')]+'%'};return _0x1abb2d;})});}_0xdc8df0=_['merge']({},_0xdc8df0,_0x283de9[_0xe02c('0x48')]);return _0x2c6d29[_0xe02c('0x7e')](_0xdc8df0);}})[_0xe02c('0x2d')](function(_0x2127e7){if(_0x2127e7){_0x5b75ed=_0x2127e7[_0xe02c('0x4f')];if(!_0x283de9[_0xe02c('0x3c')][_0xe02c('0x41')]('nolimit')){_0xdc8df0[_0xe02c('0x24')]=qs[_0xe02c('0x24')](_0x283de9[_0xe02c('0x3c')][_0xe02c('0x24')]);_0xdc8df0[_0xe02c('0x26')]=qs[_0xe02c('0x26')](_0x283de9[_0xe02c('0x3c')][_0xe02c('0x26')]);}return _0x2c6d29[_0xe02c('0x7e')](_0xdc8df0);}})['then'](function(_0x4297b2){if(_0x4297b2){return _0x4297b2?{'count':_0x5b75ed,'rows':_0x4297b2}:null;}})[_0xe02c('0x2d')](respondWithResult(_0x4cfbc0,null))['catch'](handleError(_0x4cfbc0,null));};exports[_0xe02c('0x7f')]=function(_0x4081f5,_0x1d23ed,_0x46fd38){var _0x7cd9df=_0x4081f5[_0xe02c('0x53')]['ids'];var _0xc21958;return db[_0xe02c('0x7d')][_0xe02c('0x4b')]({'where':{'id':_0x7cd9df},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xe02c('0x33'),_0xe02c('0x80'),_0xe02c('0x81'),'interface'],'raw':!![]}]})[_0xe02c('0x2d')](function(_0x35b30c){if(_0x35b30c){_0xc21958=_0x35b30c;var _0x469eac=_[_0xe02c('0x82')](_0x35b30c,function(_0x7441e6){var _0x56e35d=_0x7441e6[_0xe02c('0x2e')]({'plain':!![]});return _0x56e35d[_0xe02c('0x83')];});return db[_0xe02c('0x37')][_0xe02c('0x50')]({'where':{'id':_0x4081f5[_0xe02c('0x4e')]['id']}})[_0xe02c('0x2d')](function(_0x327507){return db[_0xe02c('0x52')][_0xe02c('0x6f')](function(_0x2ee007){return _0x327507[_0xe02c('0x7f')](_0x7cd9df,{'transaction':_0x2ee007})[_0xe02c('0x2d')](function(){return BPromise[_0xe02c('0x84')](_0xc21958,function(_0x1de725){return db[_0xe02c('0x85')][_0xe02c('0x86')]({'TeamId':_0x1de725['id'],'VoicePrefixId':_0x4081f5[_0xe02c('0x4e')]['id']},{'transaction':_0x2ee007});});})['then'](function(){return BPromise['each'](_0x469eac,function(_0x4400b2){return db['UserVoicePrefix']['findOrCreate']({'where':{'UserId':_0x4400b2['id'],'VoicePrefixId':_0x4081f5['params']['id']},'transaction':_0x2ee007});});})[_0xe02c('0x2d')](function(){_0x469eac[_0xe02c('0x87')](function(_0x889cef){socket['emit'](_0xe02c('0x76'),{'UserId':_0x889cef['id'],'VoicePrefixId':_0x327507['id']});});});});});}})['then'](respondWithStatusCode(_0x1d23ed,null))['catch'](handleError(_0x1d23ed,null));};exports[_0xe02c('0x88')]=function(_0x3ca665,_0x4eb163,_0x1433bd){return db['Team']['findAll']({'where':{'id':_0x3ca665[_0xe02c('0x3c')][_0xe02c('0x72')]},'attributes':['id'],'include':[{'model':db[_0xe02c('0x7a')],'as':_0xe02c('0x83'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4eb163,null))[_0xe02c('0x2d')](function(_0x25933f){var _0x323d81=_[_0xe02c('0x36')](_0x25933f,'id');var _0x3b6e15=[];var _0x1c96cc=[];var _0x322b4a=squel[_0xe02c('0x89')]();_0x322b4a[_0xe02c('0x8a')](_0xe02c('0x8b'))[_0xe02c('0x8c')](_0xe02c('0x8d'),'tq')[_0xe02c('0x8e')](_0xe02c('0x8f'),'ut',_0xe02c('0x90'))[_0xe02c('0x46')](_0xe02c('0x91'),_0x3ca665['params']['id']);for(var _0x252f5f=0x0;_0x252f5f<_0x25933f[_0xe02c('0x4f')];_0x252f5f+=0x1){let _0x4d112d=_0x25933f[_0x252f5f];for(var _0x3e0961=0x0;_0x3e0961<_0x4d112d[_0xe02c('0x83')][_0xe02c('0x4f')];_0x3e0961+=0x1){let _0x4b7886=_0x4d112d[_0xe02c('0x83')][_0x3e0961];var _0x505074=_0x322b4a[_0xe02c('0x92')]();_0x505074['where'](_0xe02c('0x93'),_0x4b7886['id']);_0x1c96cc[_0xe02c('0x68')](db[_0xe02c('0x52')][_0xe02c('0x3c')](_0x505074[_0xe02c('0x94')](),{'type':db['sequelize'][_0xe02c('0x95')]['SELECT']})[_0xe02c('0x2d')](function(_0x47d3fa){if(_0x47d3fa[_0xe02c('0x4f')]===0x1){return _0x4b7886['id'];}else{var _0x534002=_[_0xe02c('0x96')](_[_0xe02c('0x36')](_0x47d3fa,_0xe02c('0x97')),function(_0x45c425){return _[_0xe02c('0x98')](_0x323d81,_0x45c425);});if(_0x534002){return _0x4b7886['id'];}}}));}}return BPromise['all'](_0x1c96cc)['then'](function(_0x27ea6e){_0x3b6e15=_(_0x3b6e15)[_0xe02c('0x99')](_0x27ea6e)[_0xe02c('0x9a')]()[_0xe02c('0x9b')]();return db[_0xe02c('0x37')]['find']({'where':{'id':_0x3ca665[_0xe02c('0x4e')]['id']}})[_0xe02c('0x2d')](function(_0x34b426){return db['sequelize'][_0xe02c('0x6f')](function(_0x2a8e1d){return _0x34b426[_0xe02c('0x88')](_0x3ca665[_0xe02c('0x3c')][_0xe02c('0x72')],{'transaction':_0x2a8e1d})[_0xe02c('0x2d')](function(){if(!_['isEmpty'](_0x3b6e15)){return _0x34b426['removeAgents'](_0x3b6e15,{'transaction':_0x2a8e1d});}})[_0xe02c('0x2d')](function(){_0x3b6e15[_0xe02c('0x87')](function(_0x4b9fb7){socket['emit']('userVoicePrefix:remove',{'UserId':_0x4b9fb7,'VoicePrefixId':_0x34b426['id']});});});});});});})['then'](respondWithStatusCode(_0x4eb163,null))[_0xe02c('0x51')](handleError(_0x4eb163,null));};
\ No newline at end of file
index c3bf2fc..f4298bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x542f=['exports','events','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x593490,_0x51d7b5){var _0x38fe7b=function(_0x4345db){while(--_0x4345db){_0x593490['push'](_0x593490['shift']());}};_0x38fe7b(++_0x51d7b5);}(_0x542f,0x118));var _0xf542=function(_0x52e0ee,_0x52f7c1){_0x52e0ee=_0x52e0ee-0x0;var _0x32534c=_0x542f[_0x52e0ee];return _0x32534c;};'use strict';var EventEmitter=require(_0xf542('0x0'));var VoicePrefix=require('../../mysqldb')['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xf542('0x1')](0x0);var events={'afterCreate':_0xf542('0x2'),'afterUpdate':_0xf542('0x3'),'afterDestroy':_0xf542('0x4')};function emitEvent(_0xfc74f1){return function(_0x382ef9,_0x19307e,_0x331544){VoicePrefixEvents['emit'](_0xfc74f1+':'+_0x382ef9['id'],_0x382ef9);VoicePrefixEvents[_0xf542('0x5')](_0xfc74f1,_0x382ef9);_0x331544(null);};}for(var e in events){if(events[_0xf542('0x6')](e)){var event=events[e];VoicePrefix[_0xf542('0x7')](e,emitEvent(event));}}module[_0xf542('0x8')]=VoicePrefixEvents;
\ No newline at end of file
+var _0xfb09=['emit','hasOwnProperty','../../mysqldb','VoicePrefix','setMaxListeners','save','update'];(function(_0x348535,_0x4e6a69){var _0x347ee3=function(_0xc4f9f1){while(--_0xc4f9f1){_0x348535['push'](_0x348535['shift']());}};_0x347ee3(++_0x4e6a69);}(_0xfb09,0x10c));var _0x9fb0=function(_0x4a2a50,_0xfb155d){_0x4a2a50=_0x4a2a50-0x0;var _0x1f1973=_0xfb09[_0x4a2a50];return _0x1f1973;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x9fb0('0x0'))['db'][_0x9fb0('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x9fb0('0x2')](0x0);var events={'afterCreate':_0x9fb0('0x3'),'afterUpdate':_0x9fb0('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4baaee){return function(_0x1d57f9,_0x2d9535,_0x34ea52){VoicePrefixEvents['emit'](_0x4baaee+':'+_0x1d57f9['id'],_0x1d57f9);VoicePrefixEvents[_0x9fb0('0x5')](_0x4baaee,_0x1d57f9);_0x34ea52(null);};}for(var e in events){if(events[_0x9fb0('0x6')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module['exports']=VoicePrefixEvents;
\ No newline at end of file
index 841f574..9461fa5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f36=['api','moment','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','VoicePrefix','voice_prefixes','lodash','util'];(function(_0x22bc0e,_0x5950ad){var _0x29985f=function(_0x320163){while(--_0x320163){_0x22bc0e['push'](_0x22bc0e['shift']());}};_0x29985f(++_0x5950ad);}(_0x1f36,0xa6));var _0x61f3=function(_0x12b294,_0x192e53){_0x12b294=_0x12b294-0x0;var _0x7b92cb=_0x1f36[_0x12b294];return _0x7b92cb;};'use strict';var _=require(_0x61f3('0x0'));var util=require(_0x61f3('0x1'));var logger=require('../../config/logger')(_0x61f3('0x2'));var moment=require(_0x61f3('0x3'));var BPromise=require('bluebird');var rp=require(_0x61f3('0x4'));var fs=require('fs');var path=require(_0x61f3('0x5'));var rimraf=require(_0x61f3('0x6'));var config=require(_0x61f3('0x7'));var attributes=require(_0x61f3('0x8'));module[_0x61f3('0x9')]=function(_0x288134,_0x4987aa){return _0x288134['define'](_0x61f3('0xa'),attributes,{'tableName':_0x61f3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4962=['bluebird','path','rimraf','../../config/environment','define','VoicePrefix','voice_prefixes','../../config/logger','moment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x4962,0xa9));var _0x2496=function(_0x26e312,_0x4c0fed){_0x26e312=_0x26e312-0x0;var _0x3d73ce=_0x4962[_0x26e312];return _0x3d73ce;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2496('0x0'))('api');var moment=require(_0x2496('0x1'));var BPromise=require(_0x2496('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2496('0x3'));var rimraf=require(_0x2496('0x4'));var config=require(_0x2496('0x5'));var attributes=require('./voicePrefix.attributes');module['exports']=function(_0x510565,_0x5d6d30){return _0x510565[_0x2496('0x6')](_0x2496('0x7'),attributes,{'tableName':_0x2496('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9169767..a8b5a95 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ed7=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./voicePrefix.socket','request','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x4a4a43,_0x115ccf){var _0x5893a6=function(_0x14c914){while(--_0x14c914){_0x4a4a43['push'](_0x4a4a43['shift']());}};_0x5893a6(++_0x115ccf);}(_0x8ed7,0x8b));var _0x78ed=function(_0x487c74,_0x110cbb){_0x487c74=_0x487c74-0x0;var _0x4ef088=_0x8ed7[_0x487c74];return _0x4ef088;};'use strict';var _=require('lodash');var util=require(_0x78ed('0x0'));var moment=require(_0x78ed('0x1'));var BPromise=require(_0x78ed('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x78ed('0x3'))['db'];var utils=require(_0x78ed('0x4'));var logger=require(_0x78ed('0x5'))(_0x78ed('0x6'));var config=require(_0x78ed('0x7'));var jayson=require(_0x78ed('0x8'));var client=jayson[_0x78ed('0x9')][_0x78ed('0xa')]({'port':0x232a});config[_0x78ed('0xb')]=_['defaults'](config[_0x78ed('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x78ed('0xc'))(new Redis(config['redis']));require(_0x78ed('0xd'))['register'](socket);function respondWithRpcPromise(_0x5d3b0e,_0x45a58d,_0x3159cf){return new BPromise(function(_0x58f77d,_0x2aeda5){return client[_0x78ed('0xe')](_0x5d3b0e,_0x3159cf)['then'](function(_0x2cac87){logger['info'](_0x78ed('0xf'),_0x45a58d,_0x78ed('0x10'));logger[_0x78ed('0x11')](_0x78ed('0x12'),_0x45a58d,_0x78ed('0x10'),JSON[_0x78ed('0x13')](_0x2cac87));if(_0x2cac87['error']){if(_0x2cac87[_0x78ed('0x14')]['code']===0x1f4){logger['error']('VoicePrefix,\x20%s,\x20%s',_0x45a58d,_0x2cac87['error']['message']);return _0x2aeda5(_0x2cac87[_0x78ed('0x14')][_0x78ed('0x15')]);}logger[_0x78ed('0x14')](_0x78ed('0xf'),_0x45a58d,_0x2cac87[_0x78ed('0x14')][_0x78ed('0x15')]);return _0x58f77d(_0x2cac87[_0x78ed('0x14')][_0x78ed('0x15')]);}else{logger[_0x78ed('0x16')](_0x78ed('0xf'),_0x45a58d,_0x78ed('0x10'));_0x58f77d(_0x2cac87['result'][_0x78ed('0x15')]);}})[_0x78ed('0x17')](function(_0x480b05){logger['error'](_0x78ed('0xf'),_0x45a58d,_0x480b05);_0x2aeda5(_0x480b05);});});}
\ No newline at end of file
+var _0x1122=['randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment','bluebird'];(function(_0x2b339f,_0x5cca3b){var _0x38d409=function(_0x413706){while(--_0x413706){_0x2b339f['push'](_0x2b339f['shift']());}};_0x38d409(++_0x5cca3b);}(_0x1122,0xac));var _0x2112=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1122[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2112('0x0'));var util=require('util');var moment=require(_0x2112('0x1'));var BPromise=require(_0x2112('0x2'));var rs=require(_0x2112('0x3'));var fs=require('fs');var Redis=require(_0x2112('0x4'));var db=require(_0x2112('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2112('0x6'));var config=require('../../config/environment');var jayson=require(_0x2112('0x7'));var client=jayson[_0x2112('0x8')]['http']({'port':0x232a});config[_0x2112('0x9')]=_[_0x2112('0xa')](config[_0x2112('0x9')],{'host':_0x2112('0xb'),'port':0x18eb});var socket=require(_0x2112('0xc'))(new Redis(config[_0x2112('0x9')]));require(_0x2112('0xd'))[_0x2112('0xe')](socket);function respondWithRpcPromise(_0x18a596,_0x485a3d,_0x4690e6){return new BPromise(function(_0x46fc8b,_0x42eddd){return client[_0x2112('0xf')](_0x18a596,_0x4690e6)['then'](function(_0xa0a089){logger[_0x2112('0x10')](_0x2112('0x11'),_0x485a3d,_0x2112('0x12'));logger[_0x2112('0x13')](_0x2112('0x14'),_0x485a3d,_0x2112('0x12'),JSON['stringify'](_0xa0a089));if(_0xa0a089[_0x2112('0x15')]){if(_0xa0a089['error'][_0x2112('0x16')]===0x1f4){logger[_0x2112('0x15')]('VoicePrefix,\x20%s,\x20%s',_0x485a3d,_0xa0a089[_0x2112('0x15')]['message']);return _0x42eddd(_0xa0a089[_0x2112('0x15')]['message']);}logger[_0x2112('0x15')](_0x2112('0x11'),_0x485a3d,_0xa0a089['error'][_0x2112('0x17')]);return _0x46fc8b(_0xa0a089['error'][_0x2112('0x17')]);}else{logger['info']('VoicePrefix,\x20%s,\x20%s',_0x485a3d,_0x2112('0x12'));_0x46fc8b(_0xa0a089['result']['message']);}})[_0x2112('0x18')](function(_0x28d498){logger[_0x2112('0x15')](_0x2112('0x11'),_0x485a3d,_0x28d498);_0x42eddd(_0x28d498);});});}
\ No newline at end of file
index 93f9554..2899a66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2746=['update','emit','removeListener','register','length','voicePrefix:','remove'];(function(_0x4bd4c1,_0x3f4c7b){var _0x4a2968=function(_0x1d3488){while(--_0x1d3488){_0x4bd4c1['push'](_0x4bd4c1['shift']());}};_0x4a2968(++_0x3f4c7b);}(_0x2746,0x19c));var _0x6274=function(_0x59560b,_0x3b6ca7){_0x59560b=_0x59560b-0x0;var _0x1d363b=_0x2746[_0x59560b];return _0x1d363b;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=['save',_0x6274('0x0'),_0x6274('0x1')];function createListener(_0x459232,_0x3bf3b9){return function(_0x3cac45){_0x3bf3b9[_0x6274('0x2')](_0x459232,_0x3cac45);};}function removeListener(_0x4ab07e,_0x52b270){return function(){VoicePrefixEvents[_0x6274('0x3')](_0x4ab07e,_0x52b270);};}exports[_0x6274('0x4')]=function(_0x1978ff){for(var _0x534aee=0x0,_0x1d22fb=events[_0x6274('0x5')];_0x534aee<_0x1d22fb;_0x534aee++){var _0x3a8ec1=events[_0x534aee];var _0x3158f6=createListener(_0x6274('0x6')+_0x3a8ec1,_0x1978ff);VoicePrefixEvents['on'](_0x3a8ec1,_0x3158f6);}};
\ No newline at end of file
+var _0x93ed=['length','voicePrefix:','./voicePrefix.events','save','remove','update','register'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x93ed,0xfe));var _0xd93e=function(_0x2f4667,_0x200e37){_0x2f4667=_0x2f4667-0x0;var _0x523c94=_0x93ed[_0x2f4667];return _0x523c94;};'use strict';var VoicePrefixEvents=require(_0xd93e('0x0'));var events=[_0xd93e('0x1'),_0xd93e('0x2'),_0xd93e('0x3')];function createListener(_0x972e97,_0x535d66){return function(_0xe11d03){_0x535d66['emit'](_0x972e97,_0xe11d03);};}function removeListener(_0x5a6206,_0x812267){return function(){VoicePrefixEvents['removeListener'](_0x5a6206,_0x812267);};}exports[_0xd93e('0x4')]=function(_0x3481fa){for(var _0x462ab2=0x0,_0x478305=events[_0xd93e('0x5')];_0x462ab2<_0x478305;_0x462ab2++){var _0x4998bf=events[_0x462ab2];var _0x4ef1a1=createListener(_0xd93e('0x6')+_0x4998bf,_0x3481fa);VoicePrefixEvents['on'](_0x4998bf,_0x4ef1a1);}};
\ No newline at end of file
index ad52e61..f0eab02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x3a8b7c,_0x3e5db2){var _0x40eb80=function(_0x8db6a3){while(--_0x8db6a3){_0x3a8b7c['push'](_0x3a8b7c['shift']());}};_0x40eb80(++_0x3e5db2);}(_0xb10b,0x12a));var _0xbb10=function(_0x5ba38a,_0x132834){_0x5ba38a=_0x5ba38a-0x0;var _0x28eebe=_0xb10b[_0x5ba38a];return _0x28eebe;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router;
\ No newline at end of file
+var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0xd13a88,_0x3c5269){var _0x1c993c=function(_0x245af5){while(--_0x245af5){_0xd13a88['push'](_0xd13a88['shift']());}};_0x1c993c(++_0x3c5269);}(_0xb10b,0x12a));var _0xbb10=function(_0x3aaf78,_0x27aa1f){_0x3aaf78=_0x3aaf78-0x0;var _0x1c97b7=_0xb10b[_0x3aaf78];return _0x1c97b7;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router;
\ No newline at end of file
index 6b181c5..5e48932 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x040d=['#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#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)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','STRING','name','ENUM','inbound','outbound','default','ringall','leastrecent','fewestcalls','rrmemory','linear','wrandom','setDataValue','getDataValue','type','dialMethod','strategy','booked','progressive','power','INTEGER','yes','once','TEXT','join','periodic_announce','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','always','never','onlyIfOpen'];(function(_0x8daf39,_0x2eae0c){var _0x49400f=function(_0x5d6321){while(--_0x5d6321){_0x8daf39['push'](_0x8daf39['shift']());}};_0x49400f(++_0x2eae0c);}(_0x040d,0x1f2));var _0xd040=function(_0x25e934,_0x4757dd){_0x25e934=_0x25e934-0x0;var _0x162c25=_0x040d[_0x25e934];return _0x162c25;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd040('0x0')],'allowNull':![],'unique':_0xd040('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xd040('0x2')](_0xd040('0x3'),_0xd040('0x4')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0xd040('0x0')],'defaultValue':_0xd040('0x5')},'announce':{'type':Sequelize[_0xd040('0x0')],'defaultValue':''},'strategy':{'type':Sequelize[_0xd040('0x2')]('rr',_0xd040('0x6'),_0xd040('0x7'),_0xd040('0x8'),'random',_0xd040('0x9'),_0xd040('0xa'),_0xd040('0xb'),'rrordered'),'allowNull':![],'defaultValue':_0xd040('0x6'),'set':function(_0x27e219){this[_0xd040('0xc')]('strategy',_0x27e219?_0x27e219:_0xd040('0x9'));},'get':function(){var _0x4ab039=this[_0xd040('0xd')](_0xd040('0xe'));var _0x48b5af=this[_0xd040('0xd')](_0xd040('0xf'));var _0x520633=this[_0xd040('0xd')](_0xd040('0x10'));if(_0x4ab039===_0xd040('0x3')){return _0x520633;}if(_0x48b5af===_0xd040('0x11')&&_0x520633==='rrmemory'||_0x48b5af==='booked'&&_0x520633==='roundrobin'){return _0x520633;}if(_0x48b5af===_0xd040('0x12')||_0x48b5af==='predictive'||_0x48b5af===_0xd040('0x13')){return _0x520633;}return null;}},'servicelevel':{'type':Sequelize[_0xd040('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xd040('0x0')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0xd040('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xd040('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0xd040('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xd040('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0xd040('0x15'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize['ENUM']('yes','no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xd040('0x14')](0xb)},'autopausebusy':{'type':Sequelize[_0xd040('0x2')](_0xd040('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xd040('0x2')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xd040('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xd040('0x2')](_0xd040('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xd040('0x2')](_0xd040('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0xd040('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xd040('0x2')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xd040('0x0')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xd040('0x0')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xd040('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xd040('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xd040('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xd040('0x2')](_0xd040('0x15'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize['ENUM']('yes','no',_0xd040('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xd040('0x0')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xd040('0x2')](_0xd040('0x15'),'no')},'announce_position_limit':{'type':Sequelize[_0xd040('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xd040('0x0')]},'queue_youarenext':{'type':Sequelize[_0xd040('0x0')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xd040('0x0')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xd040('0x0')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xd040('0x0')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xd040('0x0')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xd040('0x0')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xd040('0x0')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0xd040('0x0')]},'periodic_announce':{'type':Sequelize[_0xd040('0x17')],'set':function(_0x2c8cb2){this[_0xd040('0xc')]('periodic_announce',_0x2c8cb2?_0x2c8cb2[_0xd040('0x18')](','):[]);},'get':function(){return this[_0xd040('0xd')](_0xd040('0x19'))?this[_0xd040('0xd')](_0xd040('0x19'))[_0xd040('0x1a')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':'yes','set':function(_0xcf5c95){this[_0xd040('0xc')](_0xd040('0x1b'),_0xcf5c95?_0xcf5c95[_0xd040('0x18')](','):undefined);},'get':function(){return this[_0xd040('0xd')]('joinempty')?this['getDataValue'](_0xd040('0x1b'))[_0xd040('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xd040('0x0')],'defaultValue':'no','set':function(_0x12dc22){this[_0xd040('0xc')]('leavewhenempty',_0x12dc22?_0x12dc22['join'](','):undefined);},'get':function(){return this[_0xd040('0xd')](_0xd040('0x1c'))?this[_0xd040('0xd')](_0xd040('0x1c'))[_0xd040('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0xd040('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xd040('0x2')](_0xd040('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xd040('0x0')]},'description':{'type':Sequelize[_0xd040('0x0')]},'acw':{'type':Sequelize[_0xd040('0x1d')],'defaultValue':0x0,'set':function(_0x17c2ca){this[_0xd040('0xc')](_0xd040('0x1e'),_0x17c2ca);if(_0x17c2ca){if(this[_0xd040('0xd')]('wrapuptime')<0x2){this[_0xd040('0xc')](_0xd040('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xd040('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xd040('0x20')},'dialMethod':{'type':Sequelize[_0xd040('0x2')](_0xd040('0x21'),_0xd040('0x12'),_0xd040('0x13'),_0xd040('0x22'),_0xd040('0x11')),'defaultValue':_0xd040('0x12'),'comment':_0xd040('0x23')},'dialLimitChannel':{'type':Sequelize[_0xd040('0x14')](0x4)[_0xd040('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xd040('0x25')},'dialLimitQueue':{'type':Sequelize[_0xd040('0x14')](0x4)[_0xd040('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xd040('0x26')},'dialPowerLevel':{'type':Sequelize[_0xd040('0x27')](0x2)[_0xd040('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xd040('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0xd040('0x2')]('agentBusyFactor',_0xd040('0x29')),'defaultValue':_0xd040('0x29'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xd040('0x27')](0x2)[_0xd040('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xd040('0x2a')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0xd040('0x24')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xd040('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize[_0xd040('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xd040('0x0')]},'dialOriginateTimeout':{'type':Sequelize[_0xd040('0x14')](0x3)[_0xd040('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd040('0x2c')},'dialQueueOptions':{'type':Sequelize[_0xd040('0x0')],'defaultValue':'tTxX','comment':_0xd040('0x2d')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xd040('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0xd040('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0xd040('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd040('0x2f')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xd040('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd040('0x30')},'dialBusyMaxRetry':{'type':Sequelize[_0xd040('0x14')](0x3)[_0xd040('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xd040('0x14')](0x5)[_0xd040('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd040('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xd040('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xd040('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd040('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd040('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0xd040('0x14')](0x3)[_0xd040('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xd040('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xd040('0x0')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0xd040('0x0')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xd040('0x2')](_0xd040('0x34'),_0xd040('0x35'),_0xd040('0x36')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xd040('0x1d')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xd040('0x14')](0x9)[_0xd040('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xd040('0x37')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xd040('0x24')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xd040('0x38')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xd040('0x14')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xd040('0x39')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xd040('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xd040('0x14')](0x9)[_0xd040('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xd040('0x14')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xd040('0x3a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xd040('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xd040('0x3b')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xd040('0x14')](0x5)[_0xd040('0x24')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xd040('0x3c')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xd040('0x14')](0x9)[_0xd040('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd040('0x3d')},'dialRecallMeTimeout':{'type':Sequelize[_0xd040('0x14')](0x5)[_0xd040('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0xd040('0x1d')],'defaultValue':0x0,'comment':_0xd040('0x3e')},'dialOrderByScheduledAt':{'type':Sequelize[_0xd040('0x2')](_0xd040('0x3f'),_0xd040('0x40')),'defaultValue':_0xd040('0x3f')},'dialQueueProject2':{'type':Sequelize[_0xd040('0x0')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0xd040('0x1d')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xd040('0x1d')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xd040('0x14')](0x3)[_0xd040('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd040('0x41')},'dialCutDigit':{'type':Sequelize[_0xd040('0x14')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd040('0x42')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xd040('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xd040('0x14')](0x5)[_0xd040('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xd040('0x14')](0x3)[_0xd040('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd040('0x43')},'dialDropRetryFrequency':{'type':Sequelize[_0xd040('0x14')](0x5)[_0xd040('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd040('0x44')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xd040('0x14')](0x3)[_0xd040('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd040('0x45')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xd040('0x14')](0x5)[_0xd040('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd040('0x46')},'dialMachineMaxRetry':{'type':Sequelize[_0xd040('0x14')](0x3)[_0xd040('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd040('0x47')},'dialMachineRetryFrequency':{'type':Sequelize[_0xd040('0x14')](0x5)[_0xd040('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd040('0x48')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xd040('0x14')](0x3)[_0xd040('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd040('0x49')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd040('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd040('0x4a')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd040('0x14')],'allowNull':!![],'comment':_0xd040('0x4b')},'mandatoryDisposition':{'type':Sequelize[_0xd040('0x1d')],'defaultValue':![],'comment':_0xd040('0x4c'),'set':function(_0x193447){if(!_0x193447)this[_0xd040('0xc')](_0xd040('0x4d'),null);this[_0xd040('0xc')](_0xd040('0x4e'),_0x193447);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xd040('0x24')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xd040('0x1d')],'defaultValue':!![]},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xd040('0x1d')],'defaultValue':![]}};
\ No newline at end of file
+var _0x5cd6=['BOOLEAN','Active/Disactive\x20Campaign','preview','power','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','STRING','name','ENUM','inbound','default','ringall','random','rrmemory','linear','wrandom','rrordered','setDataValue','type','getDataValue','dialMethod','booked','roundrobin','progressive','predictive','INTEGER','yes','all','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','acw','wrapuptime'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0x5cd6,0x1c1));var _0x65cd=function(_0x26da89,_0x264785){_0x26da89=_0x26da89-0x0;var _0xc95b7b=_0x5cd6[_0x26da89];return _0xc95b7b;};'use strict';var Sequelize=require(_0x65cd('0x0'));module['exports']={'name':{'type':Sequelize[_0x65cd('0x1')],'allowNull':![],'unique':_0x65cd('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x65cd('0x3')](_0x65cd('0x4'),'outbound'),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x65cd('0x1')],'defaultValue':_0x65cd('0x5')},'announce':{'type':Sequelize[_0x65cd('0x1')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x65cd('0x6'),'leastrecent','fewestcalls',_0x65cd('0x7'),_0x65cd('0x8'),_0x65cd('0x9'),_0x65cd('0xa'),_0x65cd('0xb')),'allowNull':![],'defaultValue':_0x65cd('0x6'),'set':function(_0x5cff80){this[_0x65cd('0xc')]('strategy',_0x5cff80?_0x5cff80:_0x65cd('0x8'));},'get':function(){var _0x1a2875=this['getDataValue'](_0x65cd('0xd'));var _0x5c166a=this[_0x65cd('0xe')](_0x65cd('0xf'));var _0x1b61d1=this[_0x65cd('0xe')]('strategy');if(_0x1a2875===_0x65cd('0x4')){return _0x1b61d1;}if(_0x5c166a===_0x65cd('0x10')&&_0x1b61d1===_0x65cd('0x8')||_0x5c166a===_0x65cd('0x10')&&_0x1b61d1===_0x65cd('0x11')){return _0x1b61d1;}if(_0x5c166a===_0x65cd('0x12')||_0x5c166a===_0x65cd('0x13')||_0x5c166a==='power'){return _0x1b61d1;}return null;}},'servicelevel':{'type':Sequelize[_0x65cd('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x65cd('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x65cd('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x65cd('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x65cd('0x1')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x65cd('0x3')](_0x65cd('0x15'),'no'),'defaultValue':_0x65cd('0x15')},'autopause':{'type':Sequelize[_0x65cd('0x3')]('yes','no',_0x65cd('0x16')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x65cd('0x3')](_0x65cd('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x65cd('0x3')](_0x65cd('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x65cd('0x3')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x65cd('0x3')](_0x65cd('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x65cd('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0x65cd('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x65cd('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x65cd('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x65cd('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x65cd('0x3')](_0x65cd('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x65cd('0x3')]('yes','no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize['ENUM'](_0x65cd('0x15'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x65cd('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[_0x65cd('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0x65cd('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x65cd('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x65cd('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x65cd('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x65cd('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x65cd('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x65cd('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x65cd('0x1')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x65cd('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0x65cd('0x1')]},'queue_less_than':{'type':Sequelize[_0x65cd('0x1')]},'periodic_announce':{'type':Sequelize[_0x65cd('0x17')],'set':function(_0x328515){this['setDataValue'](_0x65cd('0x18'),_0x328515?_0x328515[_0x65cd('0x19')](','):[]);},'get':function(){return this[_0x65cd('0xe')](_0x65cd('0x18'))?this['getDataValue'](_0x65cd('0x18'))[_0x65cd('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x65cd('0x1')],'defaultValue':'yes','set':function(_0x55522c){this[_0x65cd('0xc')]('joinempty',_0x55522c?_0x55522c[_0x65cd('0x19')](','):undefined);},'get':function(){return this['getDataValue'](_0x65cd('0x1b'))?this[_0x65cd('0xe')](_0x65cd('0x1b'))[_0x65cd('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x65cd('0x1')],'defaultValue':'no','set':function(_0x427383){this[_0x65cd('0xc')](_0x65cd('0x1c'),_0x427383?_0x427383[_0x65cd('0x19')](','):undefined);},'get':function(){return this[_0x65cd('0xe')]('leavewhenempty')?this[_0x65cd('0xe')](_0x65cd('0x1c'))[_0x65cd('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x65cd('0x3')](_0x65cd('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x65cd('0x3')](_0x65cd('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x65cd('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x65cd('0x3')](_0x65cd('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x65cd('0x1')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x579ff2){this[_0x65cd('0xc')](_0x65cd('0x1d'),_0x579ff2);if(_0x579ff2){if(this[_0x65cd('0xe')](_0x65cd('0x1e'))<0x2){this[_0x65cd('0xc')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x65cd('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x65cd('0x1f')],'defaultValue':0x0,'comment':_0x65cd('0x20')},'dialMethod':{'type':Sequelize['ENUM'](_0x65cd('0x21'),'progressive',_0x65cd('0x22'),'predictive',_0x65cd('0x10')),'defaultValue':_0x65cd('0x12'),'comment':_0x65cd('0x23')},'dialLimitChannel':{'type':Sequelize[_0x65cd('0x14')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x65cd('0x14')](0x4)[_0x65cd('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x65cd('0x25')},'dialPowerLevel':{'type':Sequelize[_0x65cd('0x26')](0x2)[_0x65cd('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x65cd('0x27')},'dialPredictiveOptimization':{'type':Sequelize[_0x65cd('0x3')](_0x65cd('0x28'),_0x65cd('0x29')),'defaultValue':_0x65cd('0x29'),'comment':_0x65cd('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x65cd('0x26')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x65cd('0x2b')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x65cd('0x24')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x65cd('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize[_0x65cd('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x65cd('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x65cd('0x2d')},'dialQueueOptions':{'type':Sequelize[_0x65cd('0x1')],'defaultValue':_0x65cd('0x2e'),'comment':_0x65cd('0x2f')},'dialQueueTimeout':{'type':Sequelize[_0x65cd('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x65cd('0x30')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x65cd('0x31')},'dialCongestionMaxRetry':{'type':Sequelize[_0x65cd('0x14')](0x3)[_0x65cd('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x65cd('0x32')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x65cd('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x65cd('0x14')](0x3)[_0x65cd('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x65cd('0x33')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x65cd('0x34')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x65cd('0x24')],'defaultValue':0x3,'comment':_0x65cd('0x35')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x65cd('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x65cd('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x65cd('0x36')},'dialTimezone':{'type':Sequelize[_0x65cd('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x65cd('0x37')},'dialPrefix':{'type':Sequelize[_0x65cd('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x65cd('0x3')](_0x65cd('0x38'),_0x65cd('0x39'),_0x65cd('0x3a')),'defaultValue':_0x65cd('0x38')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x65cd('0x3b')},'dialAMDInitialSilence':{'type':Sequelize[_0x65cd('0x14')](0x9)[_0x65cd('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x65cd('0x3c')},'dialAMDGreeting':{'type':Sequelize[_0x65cd('0x14')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x65cd('0x3d')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x65cd('0x14')](0x9)[_0x65cd('0x24')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x65cd('0x14')](0x9)[_0x65cd('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x65cd('0x3e')},'dialAMDMinWordLength':{'type':Sequelize[_0x65cd('0x14')](0x9)[_0x65cd('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x65cd('0x14')](0x9)[_0x65cd('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x65cd('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x65cd('0x14')](0x5)[_0x65cd('0x24')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x65cd('0x40')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x65cd('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x65cd('0x14')](0x5)[_0x65cd('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x65cd('0x41')},'dialRecallInQueue':{'type':Sequelize[_0x65cd('0x1f')],'defaultValue':0x0,'comment':_0x65cd('0x42')},'dialOrderByScheduledAt':{'type':Sequelize[_0x65cd('0x3')]('DESC',_0x65cd('0x43')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x65cd('0x31')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x65cd('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x65cd('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x65cd('0x14')](0x3)[_0x65cd('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x65cd('0x44')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x65cd('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x65cd('0x45')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x65cd('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x65cd('0x46')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x65cd('0x14')](0x5)[_0x65cd('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x65cd('0x47')},'dialDropMaxRetry':{'type':Sequelize[_0x65cd('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x65cd('0x48')},'dialDropRetryFrequency':{'type':Sequelize[_0x65cd('0x14')](0x5)[_0x65cd('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x65cd('0x49')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x65cd('0x14')](0x3)[_0x65cd('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x65cd('0x4a')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x65cd('0x4b')},'dialMachineMaxRetry':{'type':Sequelize[_0x65cd('0x14')](0x3)[_0x65cd('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x65cd('0x14')](0x5)[_0x65cd('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x65cd('0x14')](0x3)[_0x65cd('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x65cd('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x65cd('0x4c')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0x65cd('0x4d')},'mandatoryDisposition':{'type':Sequelize[_0x65cd('0x1f')],'defaultValue':![],'comment':_0x65cd('0x4e'),'set':function(_0x502efa){if(!_0x502efa)this[_0x65cd('0xc')](_0x65cd('0x4f'),null);this['setDataValue']('mandatoryDisposition',_0x502efa);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x65cd('0x14')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x65cd('0x14')](0x3)[_0x65cd('0x24')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x65cd('0x1f')],'defaultValue':!![]},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x65cd('0x1f')],'defaultValue':![]}};
\ No newline at end of file
index d23b629..babf7ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x84e7=['VoiceQueue','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','length','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','userProfileId','getHoppers','findOne','CmHopper','order','VoiceQueueId','rows','getHopperHistories','CmHopperHistory','CmHopperFinal','CmHopperBlack','getTeams','Team','addTeams','teams','User','online','voicePause','interface','flatMap','Agents','forEach','penalty','sequelize','each','TeamVoiceQueue','upsert','findOrCreate','isNil','format','emit','removeTeams','field','tq.TeamId','from','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','TeamId','all','union','compact','transaction','isEmpty','removeAgents','UserVoiceQueueRt','addAgents','ids','spread','userVoiceQueue:save','SIP/%s','userVoiceQueue:remove','getAgents','getMembers','CmList','getLists','addLists','dialCheckDuplicateType','always','insert','fromQuery','phone','scheduledAt','ContactId','ListId','select','CmListId','toString','NOW()','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','cm_contacts','phone\x20IS\x20NOT\x20NULL','cm_hopper','into','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','ignore','map','value','includes','type','find','name','UserProfileResource','end','send','index'];(function(_0x153758,_0x20c9a9){var _0x149d95=function(_0xe72d07){while(--_0xe72d07){_0x153758['push'](_0x153758['shift']());}};_0x149d95(++_0x20c9a9);}(_0x84e7,0x13a));var _0x784e=function(_0x4cca0f,_0x202bb8){_0x4cca0f=_0x4cca0f-0x0;var _0x26d9a3=_0x84e7[_0x4cca0f];return _0x26d9a3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x784e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x784e('0x1'));var moment=require(_0x784e('0x2'));var BPromise=require(_0x784e('0x3'));var Mustache=require(_0x784e('0x4'));var util=require(_0x784e('0x5'));var path=require(_0x784e('0x6'));var sox=require(_0x784e('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x784e('0x8'));var _=require('lodash');var squel=require(_0x784e('0x9'));var crypto=require(_0x784e('0xa'));var jsforce=require(_0x784e('0xb'));var deskjs=require(_0x784e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x784e('0xd'));var authService=require(_0x784e('0xe'));var qs=require(_0x784e('0xf'));var as=require(_0x784e('0x10'));var hardwareService=require(_0x784e('0x11'));var logger=require('../../config/logger')(_0x784e('0x12'));var utils=require(_0x784e('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x784e('0x14'));var db=require(_0x784e('0x15'))['db'];config['redis']=_[_0x784e('0x16')](config[_0x784e('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x784e('0x18'))(new Redis(config[_0x784e('0x17')]));require(_0x784e('0x19'))[_0x784e('0x1a')](socket);function respondWithStatusCode(_0x419b8b,_0x5234ee){_0x5234ee=_0x5234ee||0xcc;return function(_0x240c84){if(_0x240c84){return _0x419b8b[_0x784e('0x1b')](_0x5234ee);}return _0x419b8b['status'](_0x5234ee)['end']();};}function respondWithResult(_0x121fc7,_0x5f0263){_0x5f0263=_0x5f0263||0xc8;return function(_0x24d838){if(_0x24d838){return _0x121fc7[_0x784e('0x1c')](_0x5f0263)[_0x784e('0x1d')](_0x24d838);}};}function respondWithFilteredResult(_0x584b10,_0x2fe7a7){return function(_0x153808){if(_0x153808){var _0x325cd5=typeof _0x2fe7a7[_0x784e('0x1e')]==='undefined'&&typeof _0x2fe7a7[_0x784e('0x1f')]===_0x784e('0x20');var _0x40bcc8=_0x153808[_0x784e('0x21')];var _0x14d538=_0x325cd5?0x0:_0x2fe7a7['offset'];var _0x281b2c=_0x325cd5?_0x153808[_0x784e('0x21')]:_0x2fe7a7[_0x784e('0x1e')]+_0x2fe7a7['limit'];var _0x12ed27;if(_0x281b2c>=_0x40bcc8){_0x281b2c=_0x40bcc8;_0x12ed27=0xc8;}else{_0x12ed27=0xce;}_0x584b10[_0x784e('0x1c')](_0x12ed27);return _0x584b10[_0x784e('0x22')](_0x784e('0x23'),_0x14d538+'-'+_0x281b2c+'/'+_0x40bcc8)['json'](_0x153808);}return null;};}function patchUpdates(_0x42ab6d){return function(_0x55f5d7){try{jsonpatch[_0x784e('0x24')](_0x55f5d7,_0x42ab6d,!![]);}catch(_0x5b5590){return BPromise[_0x784e('0x25')](_0x5b5590);}return _0x55f5d7[_0x784e('0x26')]();};}function saveUpdates(_0x393e73,_0x2d1724){return function(_0x5a38db){if(_0x5a38db){return _0x5a38db[_0x784e('0x27')](_0x393e73)[_0x784e('0x28')](function(_0x58dc0f){return _0x58dc0f;});}return null;};}function removeEntity(_0x2f6151,_0x4eccda){return function(_0x5d90fd){if(_0x5d90fd){return _0x5d90fd[_0x784e('0x29')]()[_0x784e('0x28')](function(){var _0x4eb8ef=_0x5d90fd[_0x784e('0x2a')]({'plain':!![]});var _0x5845f1=[{'name':_0x784e('0x2b'),'value':_0x784e('0x2c'),'ignore':![]},{'name':_0x784e('0x2d'),'value':_0x784e('0x2e'),'ignore':![]}];var _0x5a93ba=_(_0x5845f1)['filter'](_0x784e('0x2f'))[_0x784e('0x30')](_0x784e('0x31'))[_0x784e('0x31')]();if(_[_0x784e('0x32')](_0x5a93ba,_0x4eb8ef[_0x784e('0x33')])){return;}var _0x5e33a9=_[_0x784e('0x34')](_0x5845f1,[_0x784e('0x31'),_0x4eb8ef[_0x784e('0x33')]])[_0x784e('0x35')];return db[_0x784e('0x36')][_0x784e('0x29')]({'where':{'type':_0x5e33a9,'resourceId':_0x4eb8ef['id']}})[_0x784e('0x28')](function(){return _0x5d90fd;});})[_0x784e('0x28')](function(){_0x2f6151[_0x784e('0x1c')](0xcc)[_0x784e('0x37')]();});}};}function handleEntityNotFound(_0x4a20c3,_0xa08d8){return function(_0x371be0){if(!_0x371be0){_0x4a20c3[_0x784e('0x1b')](0x194);}return _0x371be0;};}function handleError(_0x17af09,_0x35ac8c){_0x35ac8c=_0x35ac8c||0x1f4;return function(_0x5b439e){logger['error'](_0x5b439e['stack']);if(_0x5b439e[_0x784e('0x35')]){delete _0x5b439e[_0x784e('0x35')];}_0x17af09['status'](_0x35ac8c)[_0x784e('0x38')](_0x5b439e);};}exports[_0x784e('0x39')]=function(_0x8e16ca,_0x219a3a){var _0x3557b0={},_0x267367={},_0x1d480d={'count':0x0,'rows':[]};var _0x251df7=_[_0x784e('0x30')](db[_0x784e('0x3a')][_0x784e('0x3b')],function(_0x4d57b1){return{'name':_0x4d57b1[_0x784e('0x3c')],'type':_0x4d57b1['type'][_0x784e('0x3d')]};});_0x267367['model']=_[_0x784e('0x30')](_0x251df7,_0x784e('0x35'));_0x267367[_0x784e('0x3e')]=_[_0x784e('0x3f')](_0x8e16ca[_0x784e('0x3e')]);_0x267367[_0x784e('0x40')]=_[_0x784e('0x41')](_0x267367[_0x784e('0x42')],_0x267367['query']);_0x3557b0['attributes']=_[_0x784e('0x41')](_0x267367[_0x784e('0x42')],qs[_0x784e('0x43')](_0x8e16ca['query'][_0x784e('0x43')]));_0x3557b0[_0x784e('0x44')]=_0x3557b0['attributes']['length']?_0x3557b0[_0x784e('0x44')]:_0x267367[_0x784e('0x42')];if(!_0x8e16ca[_0x784e('0x3e')][_0x784e('0x45')](_0x784e('0x46'))){_0x3557b0[_0x784e('0x1f')]=qs[_0x784e('0x1f')](_0x8e16ca[_0x784e('0x3e')][_0x784e('0x1f')]);_0x3557b0[_0x784e('0x1e')]=qs[_0x784e('0x1e')](_0x8e16ca['query'][_0x784e('0x1e')]);}_0x3557b0['order']=qs[_0x784e('0x47')](_0x8e16ca[_0x784e('0x3e')]['sort']);_0x3557b0['where']=qs[_0x784e('0x40')](_[_0x784e('0x48')](_0x8e16ca['query'],_0x267367[_0x784e('0x40')]),_0x251df7);if(_0x8e16ca[_0x784e('0x3e')][_0x784e('0x49')]){_0x3557b0[_0x784e('0x4a')]=_[_0x784e('0x4b')](_0x3557b0[_0x784e('0x4a')],{'$or':_[_0x784e('0x30')](_0x251df7,function(_0x2e8050){if(_0x2e8050[_0x784e('0x33')]!==_0x784e('0x4c')){var _0x54bf80={};_0x54bf80[_0x2e8050[_0x784e('0x35')]]={'$like':'%'+_0x8e16ca[_0x784e('0x3e')]['filter']+'%'};return _0x54bf80;}})});}_0x3557b0=_[_0x784e('0x4b')]({},_0x3557b0,_0x8e16ca[_0x784e('0x4d')]);var _0x254af7={'where':_0x3557b0[_0x784e('0x4a')]};return db[_0x784e('0x3a')][_0x784e('0x21')](_0x254af7)[_0x784e('0x28')](function(_0x36bc40){_0x1d480d[_0x784e('0x21')]=_0x36bc40;if(_0x8e16ca[_0x784e('0x3e')][_0x784e('0x4e')]){_0x3557b0[_0x784e('0x4f')]=[{'all':!![]}];}return db[_0x784e('0x3a')][_0x784e('0x50')](_0x3557b0);})[_0x784e('0x28')](function(_0x513788){_0x1d480d['rows']=_0x513788;return _0x1d480d;})['then'](respondWithFilteredResult(_0x219a3a,_0x3557b0))[_0x784e('0x51')](handleError(_0x219a3a,null));};exports['show']=function(_0x4e3041,_0x51496f){var _0x1dabc3={'raw':![],'where':{'id':_0x4e3041[_0x784e('0x52')]['id']}},_0x12639c={};_0x12639c[_0x784e('0x42')]=_['keys'](db['VoiceQueue']['rawAttributes']);_0x12639c[_0x784e('0x3e')]=_[_0x784e('0x3f')](_0x4e3041[_0x784e('0x3e')]);_0x12639c[_0x784e('0x40')]=_[_0x784e('0x41')](_0x12639c[_0x784e('0x42')],_0x12639c['query']);_0x1dabc3[_0x784e('0x44')]=_[_0x784e('0x41')](_0x12639c[_0x784e('0x42')],qs[_0x784e('0x43')](_0x4e3041['query'][_0x784e('0x43')]));_0x1dabc3[_0x784e('0x44')]=_0x1dabc3[_0x784e('0x44')][_0x784e('0x53')]?_0x1dabc3['attributes']:_0x12639c[_0x784e('0x42')];if(_0x4e3041[_0x784e('0x3e')]['includeAll']){_0x1dabc3[_0x784e('0x4f')]=[{'all':!![]}];}_0x1dabc3=_[_0x784e('0x4b')]({},_0x1dabc3,_0x4e3041[_0x784e('0x4d')]);return db[_0x784e('0x3a')]['find'](_0x1dabc3)[_0x784e('0x28')](handleEntityNotFound(_0x51496f,null))[_0x784e('0x28')](respondWithResult(_0x51496f,null))[_0x784e('0x51')](handleError(_0x51496f,null));};exports[_0x784e('0x54')]=function(_0x37d99b,_0x3dd63e){return db[_0x784e('0x3a')][_0x784e('0x54')](_0x37d99b[_0x784e('0x55')],{})[_0x784e('0x28')](function(_0x3b4753){var _0x529044=_0x37d99b['user'][_0x784e('0x2a')]({'plain':!![]});if(!_0x529044)throw new Error(_0x784e('0x56'));if(_0x529044[_0x784e('0x57')]===_0x784e('0x58')){var _0x23dabd=_0x3b4753[_0x784e('0x2a')]({'plain':!![]});var _0x3ebd99=[{'name':_0x784e('0x2b'),'value':_0x784e('0x2c')},{'name':_0x784e('0x2d'),'value':_0x784e('0x2e')}];var _0x20f13d=_[_0x784e('0x34')](_0x3ebd99,['value',_0x23dabd['type']])[_0x784e('0x35')];return db[_0x784e('0x59')][_0x784e('0x34')]({'where':{'name':_0x20f13d,'userProfileId':_0x529044['userProfileId']},'raw':!![]})['then'](function(_0x4e3045){if(_0x4e3045&&_0x4e3045[_0x784e('0x5a')]===0x0){return db[_0x784e('0x36')][_0x784e('0x54')]({'name':_0x23dabd[_0x784e('0x35')],'resourceId':_0x23dabd['id'],'type':_0x4e3045['name'],'sectionId':_0x4e3045['id']},{})[_0x784e('0x28')](function(){return _0x3b4753;});}else{return _0x3b4753;}})[_0x784e('0x51')](function(_0x18d600){logger[_0x784e('0x5b')](_0x784e('0x5c'),_0x18d600);throw _0x18d600;});}return _0x3b4753;})[_0x784e('0x28')](respondWithResult(_0x3dd63e,0xc9))[_0x784e('0x51')](handleError(_0x3dd63e,null));};exports[_0x784e('0x5d')]=function(_0x4d422e,_0x4d105f){var _0x8163a8={'where':{'id':_0x4d422e['params']['id']}},_0x3020ad={};_0x3020ad['model']=_[_0x784e('0x3f')](db[_0x784e('0x3a')]['rawAttributes']);_0x8163a8[_0x784e('0x44')]=_[_0x784e('0x41')](_0x3020ad[_0x784e('0x42')],qs[_0x784e('0x43')](_0x4d422e['query'][_0x784e('0x43')]));_0x8163a8[_0x784e('0x44')]=_0x8163a8[_0x784e('0x44')][_0x784e('0x53')]?_0x8163a8[_0x784e('0x44')]:_0x3020ad[_0x784e('0x42')];if(_0x4d422e[_0x784e('0x3e')][_0x784e('0x4e')]){_0x8163a8['include']=[{'all':!![]}];}_0x8163a8=_[_0x784e('0x4b')]({},_0x8163a8,_0x4d422e[_0x784e('0x4d')]);return db[_0x784e('0x3a')][_0x784e('0x34')](_0x8163a8)[_0x784e('0x28')](handleEntityNotFound(_0x4d105f,null))[_0x784e('0x28')](function(_0x2a6d83){if(_0x2a6d83){var _0x4d6c6e=_0x2a6d83[_0x784e('0x2a')]({'plain':!![]});_0x4d6c6e=qs[_0x784e('0x5e')](_0x4d6c6e,['id',_0x784e('0x5f'),_0x784e('0x60')]);_0x4d422e[_0x784e('0x55')]=_[_0x784e('0x5e')](_0x4d422e[_0x784e('0x55')],['id',_0x784e('0x5f'),_0x784e('0x60')]);return db[_0x784e('0x3a')]['create'](_['merge'](_0x4d6c6e,_0x4d422e[_0x784e('0x55')]),{'include':_0x4d422e[_0x784e('0x3e')][_0x784e('0x4e')]?[{'all':!![]}]:undefined})[_0x784e('0x28')](function(_0xfa86cf){var _0x29f220=_0x4d422e['user'][_0x784e('0x2a')]({'plain':!![]});if(!_0x29f220)throw new Error(_0x784e('0x56'));if(_0x29f220[_0x784e('0x57')]===_0x784e('0x58')){var _0x57da58=_0xfa86cf[_0x784e('0x2a')]({'plain':!![]});var _0x5caf9f=[{'name':_0x784e('0x2b'),'value':'inbound'},{'name':_0x784e('0x2d'),'value':_0x784e('0x2e')}];var _0x4abc8b=_[_0x784e('0x34')](_0x5caf9f,[_0x784e('0x31'),_0x57da58[_0x784e('0x33')]])['name'];return db[_0x784e('0x59')]['find']({'where':{'name':_0x4abc8b,'userProfileId':_0x29f220[_0x784e('0x61')]},'raw':!![]})[_0x784e('0x28')](function(_0x308aad){if(_0x308aad&&_0x308aad[_0x784e('0x5a')]===0x0){return db[_0x784e('0x36')]['create']({'name':_0x57da58[_0x784e('0x35')],'resourceId':_0x57da58['id'],'type':_0x308aad[_0x784e('0x35')],'sectionId':_0x308aad['id']},{})['then'](function(){return _0xfa86cf;});}else{return _0xfa86cf;}})[_0x784e('0x51')](function(_0x22bef5){logger['error'](_0x784e('0x5c'),_0x22bef5);throw _0x22bef5;});}return _0xfa86cf;});}})[_0x784e('0x28')](respondWithResult(_0x4d105f,0xc9))[_0x784e('0x51')](handleError(_0x4d105f,null));};exports[_0x784e('0x27')]=function(_0x7b2d87,_0x1266f0){if(_0x7b2d87['body']['id']){delete _0x7b2d87['body']['id'];}return db['VoiceQueue'][_0x784e('0x34')]({'where':{'id':_0x7b2d87[_0x784e('0x52')]['id']}})[_0x784e('0x28')](handleEntityNotFound(_0x1266f0,null))[_0x784e('0x28')](saveUpdates(_0x7b2d87[_0x784e('0x55')],null))[_0x784e('0x28')](respondWithResult(_0x1266f0,null))[_0x784e('0x51')](handleError(_0x1266f0,null));};exports[_0x784e('0x29')]=function(_0x287478,_0x282672){return db[_0x784e('0x3a')][_0x784e('0x34')]({'where':{'id':_0x287478[_0x784e('0x52')]['id']}})[_0x784e('0x28')](handleEntityNotFound(_0x282672,null))[_0x784e('0x28')](removeEntity(_0x282672,null))[_0x784e('0x51')](handleError(_0x282672,null));};exports[_0x784e('0x62')]=function(_0xab570,_0x4940a8,_0x1ba182){var _0x4fc487={'raw':![],'where':{}};var _0xd7cbf8={};var _0x3ec69d={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x784e('0x63')]({'where':{'id':_0xab570[_0x784e('0x52')]['id']}})[_0x784e('0x28')](handleEntityNotFound(_0x4940a8,null))[_0x784e('0x28')](function(_0x5dff3c){if(_0x5dff3c){_0xd7cbf8[_0x784e('0x42')]=_[_0x784e('0x3f')](db[_0x784e('0x64')][_0x784e('0x3b')]);_0xd7cbf8[_0x784e('0x3e')]=_['keys'](_0xab570[_0x784e('0x3e')]);_0xd7cbf8[_0x784e('0x40')]=_['intersection'](_0xd7cbf8['model'],_0xd7cbf8[_0x784e('0x3e')]);_0x4fc487[_0x784e('0x44')]=_[_0x784e('0x41')](_0xd7cbf8['model'],qs[_0x784e('0x43')](_0xab570[_0x784e('0x3e')][_0x784e('0x43')]));_0x4fc487[_0x784e('0x44')]=_0x4fc487['attributes']['length']?_0x4fc487[_0x784e('0x44')]:_0xd7cbf8['model'];if(!_0xab570[_0x784e('0x3e')][_0x784e('0x45')](_0x784e('0x46'))){_0x4fc487[_0x784e('0x1f')]=qs[_0x784e('0x1f')](_0xab570[_0x784e('0x3e')][_0x784e('0x1f')]);_0x4fc487['offset']=qs['offset'](_0xab570[_0x784e('0x3e')][_0x784e('0x1e')]);}_0x4fc487[_0x784e('0x65')]=qs['sort'](_0xab570[_0x784e('0x3e')]['sort']);_0x4fc487[_0x784e('0x4a')]=qs[_0x784e('0x40')](_[_0x784e('0x48')](_0xab570['query'],_0xd7cbf8[_0x784e('0x40')]));_0x4fc487[_0x784e('0x4a')][_0x784e('0x66')]=_0x5dff3c['id'];if(_0xab570[_0x784e('0x3e')][_0x784e('0x49')]){_0x4fc487[_0x784e('0x4a')]=_[_0x784e('0x4b')](_0x4fc487[_0x784e('0x4a')],{'$or':_[_0x784e('0x30')](_0x4fc487[_0x784e('0x44')],function(_0x3d673b){var _0x203064={};_0x203064[_0x3d673b]={'$like':'%'+_0xab570[_0x784e('0x3e')][_0x784e('0x49')]+'%'};return _0x203064;})});}_0x4fc487=_[_0x784e('0x4b')]({},_0x4fc487,_0xab570['options']);return db[_0x784e('0x64')][_0x784e('0x21')]({'where':_0x4fc487[_0x784e('0x4a')]})[_0x784e('0x28')](function(_0xd7c818){_0x3ec69d[_0x784e('0x21')]=_0xd7c818;if(_0xab570[_0x784e('0x3e')][_0x784e('0x4e')]){_0x4fc487['include']=[{'all':!![]}];}return db['CmHopper'][_0x784e('0x50')](_0x4fc487);})[_0x784e('0x28')](function(_0x4253fb){_0x3ec69d[_0x784e('0x67')]=_0x4253fb;return _0x3ec69d;});}})[_0x784e('0x28')](respondWithFilteredResult(_0x4940a8,_0x4fc487))['catch'](handleError(_0x4940a8,null));};exports[_0x784e('0x68')]=function(_0x1c884c,_0x297499,_0x10c43a){var _0x405f74={'raw':!![],'where':{}};var _0x27eea8={};var _0x42cdf5={'count':0x0,'rows':[]};return db[_0x784e('0x3a')]['findOne']({'where':{'id':_0x1c884c['params']['id']}})[_0x784e('0x28')](handleEntityNotFound(_0x297499,null))[_0x784e('0x28')](function(_0x2cb5a1){if(_0x2cb5a1){_0x27eea8['model']=_[_0x784e('0x3f')](db[_0x784e('0x69')][_0x784e('0x3b')]);_0x27eea8[_0x784e('0x3e')]=_[_0x784e('0x3f')](_0x1c884c[_0x784e('0x3e')]);_0x27eea8['filters']=_[_0x784e('0x41')](_0x27eea8['model'],_0x27eea8[_0x784e('0x3e')]);_0x405f74[_0x784e('0x44')]=_['intersection'](_0x27eea8[_0x784e('0x42')],qs[_0x784e('0x43')](_0x1c884c['query'][_0x784e('0x43')]));_0x405f74[_0x784e('0x44')]=_0x405f74[_0x784e('0x44')][_0x784e('0x53')]?_0x405f74[_0x784e('0x44')]:_0x27eea8[_0x784e('0x42')];if(!_0x1c884c[_0x784e('0x3e')][_0x784e('0x45')]('nolimit')){_0x405f74['limit']=qs[_0x784e('0x1f')](_0x1c884c[_0x784e('0x3e')][_0x784e('0x1f')]);_0x405f74[_0x784e('0x1e')]=qs[_0x784e('0x1e')](_0x1c884c[_0x784e('0x3e')][_0x784e('0x1e')]);}_0x405f74['order']=qs[_0x784e('0x47')](_0x1c884c[_0x784e('0x3e')][_0x784e('0x47')]);_0x405f74[_0x784e('0x4a')]=qs[_0x784e('0x40')](_[_0x784e('0x48')](_0x1c884c[_0x784e('0x3e')],_0x27eea8[_0x784e('0x40')]));_0x405f74['where']['VoiceQueueId']=_0x2cb5a1['id'];if(_0x1c884c[_0x784e('0x3e')][_0x784e('0x49')]){_0x405f74[_0x784e('0x4a')]=_['merge'](_0x405f74[_0x784e('0x4a')],{'$or':_[_0x784e('0x30')](_0x405f74[_0x784e('0x44')],function(_0x4b677a){var _0x50390e={};_0x50390e[_0x4b677a]={'$like':'%'+_0x1c884c[_0x784e('0x3e')][_0x784e('0x49')]+'%'};return _0x50390e;})});}_0x405f74=_[_0x784e('0x4b')]({},_0x405f74,_0x1c884c[_0x784e('0x4d')]);return db[_0x784e('0x69')]['count']({'where':_0x405f74[_0x784e('0x4a')]})[_0x784e('0x28')](function(_0x302a52){_0x42cdf5[_0x784e('0x21')]=_0x302a52;if(_0x1c884c[_0x784e('0x3e')][_0x784e('0x4e')]){_0x405f74[_0x784e('0x4f')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x784e('0x50')](_0x405f74);})[_0x784e('0x28')](function(_0x3c293a){_0x42cdf5[_0x784e('0x67')]=_0x3c293a;return _0x42cdf5;});}})[_0x784e('0x28')](respondWithFilteredResult(_0x297499,_0x405f74))[_0x784e('0x51')](handleError(_0x297499,null));};exports['getHopperFinals']=function(_0x6a293,_0x1bdffb,_0x3cbb10){var _0x5e64bb={'raw':!![],'where':{}};var _0x279b01={};var _0x4ba378={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x784e('0x63')]({'where':{'id':_0x6a293['params']['id']}})[_0x784e('0x28')](handleEntityNotFound(_0x1bdffb,null))[_0x784e('0x28')](function(_0x57a664){if(_0x57a664){_0x279b01[_0x784e('0x42')]=_[_0x784e('0x3f')](db[_0x784e('0x6a')]['rawAttributes']);_0x279b01['query']=_['keys'](_0x6a293[_0x784e('0x3e')]);_0x279b01[_0x784e('0x40')]=_['intersection'](_0x279b01['model'],_0x279b01[_0x784e('0x3e')]);_0x5e64bb[_0x784e('0x44')]=_['intersection'](_0x279b01[_0x784e('0x42')],qs[_0x784e('0x43')](_0x6a293['query'][_0x784e('0x43')]));_0x5e64bb[_0x784e('0x44')]=_0x5e64bb[_0x784e('0x44')]['length']?_0x5e64bb[_0x784e('0x44')]:_0x279b01[_0x784e('0x42')];if(!_0x6a293[_0x784e('0x3e')][_0x784e('0x45')]('nolimit')){_0x5e64bb['limit']=qs[_0x784e('0x1f')](_0x6a293[_0x784e('0x3e')][_0x784e('0x1f')]);_0x5e64bb[_0x784e('0x1e')]=qs['offset'](_0x6a293['query']['offset']);}_0x5e64bb[_0x784e('0x65')]=qs[_0x784e('0x47')](_0x6a293[_0x784e('0x3e')]['sort']);_0x5e64bb['where']=qs['filters'](_[_0x784e('0x48')](_0x6a293['query'],_0x279b01[_0x784e('0x40')]));_0x5e64bb['where']['VoiceQueueId']=_0x57a664['id'];if(_0x6a293[_0x784e('0x3e')][_0x784e('0x49')]){_0x5e64bb[_0x784e('0x4a')]=_[_0x784e('0x4b')](_0x5e64bb[_0x784e('0x4a')],{'$or':_[_0x784e('0x30')](_0x5e64bb[_0x784e('0x44')],function(_0x4cb815){var _0xfb58db={};_0xfb58db[_0x4cb815]={'$like':'%'+_0x6a293[_0x784e('0x3e')][_0x784e('0x49')]+'%'};return _0xfb58db;})});}_0x5e64bb=_['merge']({},_0x5e64bb,_0x6a293['options']);return db['CmHopperFinal']['count']({'where':_0x5e64bb['where']})[_0x784e('0x28')](function(_0x391e4a){_0x4ba378[_0x784e('0x21')]=_0x391e4a;if(_0x6a293[_0x784e('0x3e')][_0x784e('0x4e')]){_0x5e64bb[_0x784e('0x4f')]=[{'all':!![]}];}return db[_0x784e('0x6a')][_0x784e('0x50')](_0x5e64bb);})['then'](function(_0xffc32b){_0x4ba378[_0x784e('0x67')]=_0xffc32b;return _0x4ba378;});}})[_0x784e('0x28')](respondWithFilteredResult(_0x1bdffb,_0x5e64bb))['catch'](handleError(_0x1bdffb,null));};exports['getHopperBlacks']=function(_0x655d4d,_0xf2720f,_0x9598f5){var _0x4f93ec={'raw':!![],'where':{}};var _0x5e076b={};var _0x23e2f8={'count':0x0,'rows':[]};return db[_0x784e('0x3a')][_0x784e('0x63')]({'where':{'id':_0x655d4d['params']['id']}})[_0x784e('0x28')](handleEntityNotFound(_0xf2720f,null))[_0x784e('0x28')](function(_0x50dc74){if(_0x50dc74){_0x5e076b[_0x784e('0x42')]=_['keys'](db[_0x784e('0x6b')][_0x784e('0x3b')]);_0x5e076b['query']=_[_0x784e('0x3f')](_0x655d4d[_0x784e('0x3e')]);_0x5e076b[_0x784e('0x40')]=_['intersection'](_0x5e076b[_0x784e('0x42')],_0x5e076b[_0x784e('0x3e')]);_0x4f93ec[_0x784e('0x44')]=_[_0x784e('0x41')](_0x5e076b[_0x784e('0x42')],qs[_0x784e('0x43')](_0x655d4d[_0x784e('0x3e')][_0x784e('0x43')]));_0x4f93ec[_0x784e('0x44')]=_0x4f93ec['attributes'][_0x784e('0x53')]?_0x4f93ec['attributes']:_0x5e076b[_0x784e('0x42')];if(!_0x655d4d[_0x784e('0x3e')]['hasOwnProperty'](_0x784e('0x46'))){_0x4f93ec['limit']=qs['limit'](_0x655d4d[_0x784e('0x3e')][_0x784e('0x1f')]);_0x4f93ec[_0x784e('0x1e')]=qs[_0x784e('0x1e')](_0x655d4d[_0x784e('0x3e')][_0x784e('0x1e')]);}_0x4f93ec['order']=qs['sort'](_0x655d4d[_0x784e('0x3e')][_0x784e('0x47')]);_0x4f93ec[_0x784e('0x4a')]=qs[_0x784e('0x40')](_[_0x784e('0x48')](_0x655d4d[_0x784e('0x3e')],_0x5e076b[_0x784e('0x40')]));_0x4f93ec[_0x784e('0x4a')][_0x784e('0x66')]=_0x50dc74['id'];if(_0x655d4d[_0x784e('0x3e')]['filter']){_0x4f93ec[_0x784e('0x4a')]=_[_0x784e('0x4b')](_0x4f93ec[_0x784e('0x4a')],{'$or':_[_0x784e('0x30')](_0x4f93ec[_0x784e('0x44')],function(_0x58c32d){var _0x13cea7={};_0x13cea7[_0x58c32d]={'$like':'%'+_0x655d4d[_0x784e('0x3e')][_0x784e('0x49')]+'%'};return _0x13cea7;})});}_0x4f93ec=_[_0x784e('0x4b')]({},_0x4f93ec,_0x655d4d[_0x784e('0x4d')]);return db[_0x784e('0x6b')][_0x784e('0x21')]({'where':_0x4f93ec[_0x784e('0x4a')]})[_0x784e('0x28')](function(_0x490a77){_0x23e2f8[_0x784e('0x21')]=_0x490a77;if(_0x655d4d[_0x784e('0x3e')][_0x784e('0x4e')]){_0x4f93ec[_0x784e('0x4f')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x784e('0x50')](_0x4f93ec);})[_0x784e('0x28')](function(_0x267658){_0x23e2f8['rows']=_0x267658;return _0x23e2f8;});}})[_0x784e('0x28')](respondWithFilteredResult(_0xf2720f,_0x4f93ec))[_0x784e('0x51')](handleError(_0xf2720f,null));};exports[_0x784e('0x6c')]=function(_0x5e6483,_0x31d9ef,_0x55e0bc){var _0x4edb99={};var _0x27ac69={};var _0x3b0d3b;var _0x5a0854;return db['VoiceQueue'][_0x784e('0x63')]({'where':{'id':_0x5e6483[_0x784e('0x52')]['id']}})[_0x784e('0x28')](handleEntityNotFound(_0x31d9ef,null))['then'](function(_0xee2c4){if(_0xee2c4){_0x3b0d3b=_0xee2c4;_0x27ac69[_0x784e('0x42')]=_[_0x784e('0x3f')](db[_0x784e('0x6d')][_0x784e('0x3b')]);_0x27ac69['query']=_[_0x784e('0x3f')](_0x5e6483[_0x784e('0x3e')]);_0x27ac69[_0x784e('0x40')]=_[_0x784e('0x41')](_0x27ac69['model'],_0x27ac69[_0x784e('0x3e')]);_0x4edb99[_0x784e('0x44')]=_[_0x784e('0x41')](_0x27ac69['model'],qs['fields'](_0x5e6483[_0x784e('0x3e')][_0x784e('0x43')]));_0x4edb99[_0x784e('0x44')]=_0x4edb99[_0x784e('0x44')][_0x784e('0x53')]?_0x4edb99[_0x784e('0x44')]:_0x27ac69[_0x784e('0x42')];_0x4edb99[_0x784e('0x65')]=qs[_0x784e('0x47')](_0x5e6483[_0x784e('0x3e')][_0x784e('0x47')]);_0x4edb99['where']=qs[_0x784e('0x40')](_[_0x784e('0x48')](_0x5e6483['query'],_0x27ac69['filters']));if(_0x5e6483[_0x784e('0x3e')][_0x784e('0x49')]){_0x4edb99[_0x784e('0x4a')]=_[_0x784e('0x4b')](_0x4edb99[_0x784e('0x4a')],{'$or':_[_0x784e('0x30')](_0x4edb99[_0x784e('0x44')],function(_0x777cc4){var _0x5772fa={};_0x5772fa[_0x777cc4]={'$like':'%'+_0x5e6483[_0x784e('0x3e')][_0x784e('0x49')]+'%'};return _0x5772fa;})});}_0x4edb99=_[_0x784e('0x4b')]({},_0x4edb99,_0x5e6483[_0x784e('0x4d')]);return _0x3b0d3b['getTeams'](_0x4edb99);}})[_0x784e('0x28')](function(_0x156ab7){if(_0x156ab7){_0x5a0854=_0x156ab7[_0x784e('0x53')];if(!_0x5e6483[_0x784e('0x3e')]['hasOwnProperty']('nolimit')){_0x4edb99[_0x784e('0x1f')]=qs[_0x784e('0x1f')](_0x5e6483['query'][_0x784e('0x1f')]);_0x4edb99[_0x784e('0x1e')]=qs[_0x784e('0x1e')](_0x5e6483['query']['offset']);}return _0x3b0d3b[_0x784e('0x6c')](_0x4edb99);}})[_0x784e('0x28')](function(_0x28e495){if(_0x28e495){return _0x28e495?{'count':_0x5a0854,'rows':_0x28e495}:null;}})[_0x784e('0x28')](respondWithResult(_0x31d9ef,null))[_0x784e('0x51')](handleError(_0x31d9ef,null));};exports[_0x784e('0x6e')]=function(_0x141a6a,_0x584449,_0x3e3d3b){var _0x2c9aed=_0x141a6a[_0x784e('0x55')][_0x784e('0x6f')];var _0x2eea0c=_[_0x784e('0x30')](_0x2c9aed,'id');return db[_0x784e('0x6d')][_0x784e('0x50')]({'where':{'id':_0x2eea0c},'attributes':['id'],'include':[{'model':db[_0x784e('0x70')],'as':'Agents','attributes':['id','name',_0x784e('0x71'),_0x784e('0x72'),_0x784e('0x73')],'raw':!![]}]})[_0x784e('0x28')](function(_0x194049){if(_0x194049){var _0x1db899=_[_0x784e('0x74')](_0x194049,function(_0xfc4a24){var _0x4f4245=_0xfc4a24[_0x784e('0x2a')]({'plain':!![]});_0x4f4245[_0x784e('0x75')][_0x784e('0x76')](function(_0x18ed19){_0x18ed19[_0x784e('0x77')]=_['find'](_0x2c9aed,{'id':_0x4f4245['id']})[_0x784e('0x77')];});return _0x4f4245[_0x784e('0x75')];});return db[_0x784e('0x3a')][_0x784e('0x34')]({'where':{'id':_0x141a6a[_0x784e('0x52')]['id']}})[_0x784e('0x28')](function(_0x3bd579){return db[_0x784e('0x78')]['transaction'](function(_0x47e8b4){return _0x3bd579[_0x784e('0x6e')](_0x2eea0c,{'transaction':_0x47e8b4})[_0x784e('0x28')](function(){return BPromise[_0x784e('0x79')](_0x2c9aed,function(_0x2ef7be){return db[_0x784e('0x7a')][_0x784e('0x7b')]({'TeamId':_0x2ef7be['id'],'VoiceQueueId':_0x141a6a[_0x784e('0x52')]['id'],'penalty':_0x2ef7be['penalty']},{'transaction':_0x47e8b4});});})['then'](function(){return BPromise[_0x784e('0x79')](_0x1db899,function(_0x5f0950){return db['UserVoiceQueue'][_0x784e('0x7c')]({'where':{'UserId':_0x5f0950['id'],'VoiceQueueId':_0x141a6a[_0x784e('0x52')]['id']},'defaults':{'penalty':_0x5f0950[_0x784e('0x77')]},'transaction':_0x47e8b4});});})['then'](function(){return BPromise[_0x784e('0x79')](_['filter'](_0x1db899,{'online':!![]}),function(_0x1a5085){return db['UserVoiceQueueRt']['upsert']({'membername':_0x1a5085[_0x784e('0x35')],'UserId':_0x1a5085['id'],'queue_name':_0x3bd579[_0x784e('0x35')],'VoiceQueueId':_0x3bd579['id'],'interface':_[_0x784e('0x7d')](_0x1a5085[_0x784e('0x73')])?util[_0x784e('0x7e')]('SIP/%s',_0x1a5085['name']):_0x1a5085[_0x784e('0x73')],'paused':_0x1a5085['voicePause']||![],'penalty':_0x1a5085[_0x784e('0x77')]},{'transaction':_0x47e8b4});});})['then'](function(){_0x1db899['forEach'](function(_0x2ed3df){socket[_0x784e('0x7f')]('userVoiceQueue:save',{'UserId':_0x2ed3df['id'],'VoiceQueueId':_0x3bd579['id']});});});});});}})[_0x784e('0x28')](respondWithStatusCode(_0x584449,null))[_0x784e('0x51')](handleError(_0x584449,null));};exports[_0x784e('0x80')]=function(_0x3abf49,_0x2a8ae3,_0x124c6c){return db[_0x784e('0x6d')][_0x784e('0x50')]({'where':{'id':_0x3abf49[_0x784e('0x3e')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x784e('0x28')](handleEntityNotFound(_0x2a8ae3,null))[_0x784e('0x28')](function(_0x5e8d8a){var _0x5d7e99=_[_0x784e('0x30')](_0x5e8d8a,'id');var _0x2ef798=[];var _0x39dce4=[];var _0x1f04f6=squel['select']();_0x1f04f6[_0x784e('0x81')](_0x784e('0x82'))[_0x784e('0x83')](_0x784e('0x84'),'tq')['join'](_0x784e('0x85'),'ut',_0x784e('0x86'))[_0x784e('0x4a')](_0x784e('0x87'),_0x3abf49[_0x784e('0x52')]['id']);for(var _0x469269=0x0;_0x469269<_0x5e8d8a[_0x784e('0x53')];_0x469269+=0x1){let _0x5801de=_0x5e8d8a[_0x469269];for(var _0xe44218=0x0;_0xe44218<_0x5801de[_0x784e('0x75')][_0x784e('0x53')];_0xe44218+=0x1){let _0x20b103=_0x5801de[_0x784e('0x75')][_0xe44218];var _0x1b9b04=_0x1f04f6[_0x784e('0x5d')]();_0x1b9b04['where'](_0x784e('0x88'),_0x20b103['id']);_0x39dce4[_0x784e('0x89')](db[_0x784e('0x78')][_0x784e('0x3e')](_0x1b9b04['toString'](),{'type':db[_0x784e('0x78')][_0x784e('0x8a')][_0x784e('0x8b')]})[_0x784e('0x28')](function(_0x4f1783){if(_0x4f1783['length']===0x1){return _0x20b103['id'];}else{var _0x2278b0=_['every'](_[_0x784e('0x30')](_0x4f1783,_0x784e('0x8c')),function(_0x168dc0){return _['includes'](_0x5d7e99,_0x168dc0);});if(_0x2278b0){return _0x20b103['id'];}}}));}}return BPromise[_0x784e('0x8d')](_0x39dce4)['then'](function(_0x4ad894){_0x2ef798=_(_0x2ef798)[_0x784e('0x8e')](_0x4ad894)[_0x784e('0x8f')]()[_0x784e('0x31')]();return db[_0x784e('0x3a')][_0x784e('0x34')]({'where':{'id':_0x3abf49[_0x784e('0x52')]['id']}})['then'](function(_0x2d2649){return db[_0x784e('0x78')][_0x784e('0x90')](function(_0x1bd145){return _0x2d2649['removeTeams'](_0x3abf49[_0x784e('0x3e')]['ids'],{'transaction':_0x1bd145})[_0x784e('0x28')](function(){if(!_[_0x784e('0x91')](_0x2ef798)){return _0x2d2649[_0x784e('0x92')](_0x2ef798,{'transaction':_0x1bd145})[_0x784e('0x28')](function(){return db[_0x784e('0x93')][_0x784e('0x29')]({'where':{'VoiceQueueId':_0x3abf49[_0x784e('0x52')]['id'],'UserId':_0x2ef798},'transaction':_0x1bd145});});}})[_0x784e('0x28')](function(){_0x2ef798[_0x784e('0x76')](function(_0x1272df){socket[_0x784e('0x7f')]('userVoiceQueue:remove',{'UserId':_0x1272df,'VoiceQueueId':_0x2d2649['id']});});});});});});})[_0x784e('0x28')](respondWithStatusCode(_0x2a8ae3,null))[_0x784e('0x51')](handleError(_0x2a8ae3,null));};exports[_0x784e('0x94')]=function(_0x2e5945,_0x57ef73,_0x208655){var _0x4e5452,_0x4e85e6;return db['VoiceQueue']['find']({'where':{'id':_0x2e5945['params']['id']}})[_0x784e('0x28')](handleEntityNotFound(_0x57ef73,null))[_0x784e('0x28')](function(_0x14885c){if(_0x14885c){_0x4e85e6=_0x14885c;return _0x14885c[_0x784e('0x94')](_0x2e5945['body'][_0x784e('0x95')],_[_0x784e('0x5e')](_0x2e5945[_0x784e('0x55')],[_0x784e('0x95'),'id'])||{})[_0x784e('0x96')](function(_0x1d3735){for(var _0xc9d435=0x0;_0xc9d435<_0x2e5945[_0x784e('0x55')][_0x784e('0x95')][_0x784e('0x53')];_0xc9d435+=0x1){socket['emit'](_0x784e('0x97'),{'UserId':Number(_0x2e5945['body'][_0x784e('0x95')][_0xc9d435]),'VoiceQueueId':Number(_0x2e5945[_0x784e('0x52')]['id'])});}return _0x1d3735;});}})[_0x784e('0x28')](function(_0x480be2){_0x4e5452=_0x480be2||[];if(_0x4e85e6){return db['User'][_0x784e('0x50')]({'where':{'id':_0x2e5945[_0x784e('0x55')][_0x784e('0x95')]},'attributes':['id',_0x784e('0x35'),_0x784e('0x71'),_0x784e('0x72'),'interface'],'raw':!![]});}})[_0x784e('0x28')](function(_0x32ed2f){if(!_[_0x784e('0x91')](_0x32ed2f)){var _0x5ec99b=[];for(var _0x302b72=0x0;_0x302b72<_0x32ed2f['length'];_0x302b72++){if(_0x32ed2f[_0x302b72][_0x784e('0x71')]){_0x5ec99b[_0x784e('0x89')](db['UserVoiceQueueRt'][_0x784e('0x7b')]({'membername':_0x32ed2f[_0x302b72][_0x784e('0x35')],'UserId':_0x32ed2f[_0x302b72]['id'],'queue_name':_0x4e85e6['name'],'VoiceQueueId':_0x4e85e6['id'],'interface':_[_0x784e('0x7d')](_0x32ed2f[_0x302b72][_0x784e('0x73')])?util[_0x784e('0x7e')](_0x784e('0x98'),_0x32ed2f[_0x302b72]['name']):_0x32ed2f[_0x302b72][_0x784e('0x73')],'paused':_0x32ed2f[_0x302b72]['voicePause']||![],'penalty':_0x2e5945[_0x784e('0x55')][_0x784e('0x77')]||0x0}));}}return BPromise[_0x784e('0x8d')](_0x5ec99b);}})[_0x784e('0x28')](function(){return _0x4e5452;})[_0x784e('0x28')](respondWithResult(_0x57ef73,null))[_0x784e('0x51')](handleError(_0x57ef73,null));};exports['removeAgents']=function(_0xa8efdc,_0xa18a18,_0x3a225c){return db[_0x784e('0x3a')][_0x784e('0x34')]({'where':{'id':_0xa8efdc[_0x784e('0x52')]['id']}})[_0x784e('0x28')](handleEntityNotFound(_0xa18a18,null))[_0x784e('0x28')](function(_0x3a1709){if(_0x3a1709){return _0x3a1709[_0x784e('0x92')](_0xa8efdc[_0x784e('0x3e')][_0x784e('0x95')])['then'](function(){if(_['isArray'](_0xa8efdc['query'][_0x784e('0x95')])){for(var _0x29ad5f=0x0;_0x29ad5f<_0xa8efdc[_0x784e('0x3e')][_0x784e('0x95')][_0x784e('0x53')];_0x29ad5f+=0x1){socket['emit'](_0x784e('0x99'),{'UserId':Number(_0xa8efdc[_0x784e('0x3e')]['ids'][_0x29ad5f]),'VoiceQueueId':Number(_0xa8efdc[_0x784e('0x52')]['id'])});}}else{socket[_0x784e('0x7f')](_0x784e('0x99'),{'UserId':Number(_0xa8efdc[_0x784e('0x3e')][_0x784e('0x95')]),'VoiceQueueId':Number(_0xa8efdc[_0x784e('0x52')]['id'])});}});}})[_0x784e('0x28')](function(_0x172ac4){return db[_0x784e('0x93')][_0x784e('0x29')]({'where':{'VoiceQueueId':_0xa8efdc[_0x784e('0x52')]['id'],'UserId':_0xa8efdc[_0x784e('0x3e')][_0x784e('0x95')]}})[_0x784e('0x28')](function(){return _0x172ac4;});})[_0x784e('0x28')](respondWithStatusCode(_0xa18a18,null))[_0x784e('0x51')](handleError(_0xa18a18,null));};exports[_0x784e('0x9a')]=function(_0x145d01,_0x53b7c6,_0x135e99){var _0x3a0ae2={};var _0x24e844={};var _0x1bb7dc;var _0x5c011c;return db[_0x784e('0x3a')]['findOne']({'where':{'id':_0x145d01[_0x784e('0x52')]['id']}})[_0x784e('0x28')](handleEntityNotFound(_0x53b7c6,null))['then'](function(_0x597c95){if(_0x597c95){_0x1bb7dc=_0x597c95;_0x24e844[_0x784e('0x42')]=_[_0x784e('0x3f')](db[_0x784e('0x70')]['rawAttributes']);_0x24e844[_0x784e('0x3e')]=_[_0x784e('0x3f')](_0x145d01['query']);_0x24e844[_0x784e('0x40')]=_[_0x784e('0x41')](_0x24e844['model'],_0x24e844[_0x784e('0x3e')]);_0x3a0ae2['attributes']=_[_0x784e('0x41')](_0x24e844['model'],qs['fields'](_0x145d01[_0x784e('0x3e')][_0x784e('0x43')]));_0x3a0ae2[_0x784e('0x44')]=_0x3a0ae2[_0x784e('0x44')][_0x784e('0x53')]?_0x3a0ae2[_0x784e('0x44')]:_0x24e844[_0x784e('0x42')];_0x3a0ae2[_0x784e('0x65')]=qs['sort'](_0x145d01[_0x784e('0x3e')][_0x784e('0x47')]);_0x3a0ae2['where']=qs[_0x784e('0x40')](_[_0x784e('0x48')](_0x145d01[_0x784e('0x3e')],_0x24e844[_0x784e('0x40')]));if(_0x145d01['query'][_0x784e('0x49')]){_0x3a0ae2[_0x784e('0x4a')]=_['merge'](_0x3a0ae2[_0x784e('0x4a')],{'$or':_[_0x784e('0x30')](_0x3a0ae2[_0x784e('0x44')],function(_0x4ef024){var _0x1ec590={};_0x1ec590[_0x4ef024]={'$like':'%'+_0x145d01[_0x784e('0x3e')][_0x784e('0x49')]+'%'};return _0x1ec590;})});}_0x3a0ae2=_[_0x784e('0x4b')]({},_0x3a0ae2,_0x145d01[_0x784e('0x4d')]);return _0x1bb7dc[_0x784e('0x9a')](_0x3a0ae2);}})[_0x784e('0x28')](function(_0x24e5c4){if(_0x24e5c4){_0x5c011c=_0x24e5c4[_0x784e('0x53')];if(!_0x145d01['query'][_0x784e('0x45')](_0x784e('0x46'))){_0x3a0ae2[_0x784e('0x1f')]=qs[_0x784e('0x1f')](_0x145d01['query'][_0x784e('0x1f')]);_0x3a0ae2[_0x784e('0x1e')]=qs['offset'](_0x145d01[_0x784e('0x3e')]['offset']);}return _0x1bb7dc['getAgents'](_0x3a0ae2);}})[_0x784e('0x28')](function(_0x435d76){if(_0x435d76){return _0x435d76?{'count':_0x5c011c,'rows':_0x435d76}:null;}})[_0x784e('0x28')](respondWithResult(_0x53b7c6,null))['catch'](handleError(_0x53b7c6,null));};exports[_0x784e('0x9b')]=function(_0x377160,_0x2bde8b,_0x1e218e){var _0x220fd3={};var _0x50848c={};var _0x16b80d;var _0x246a50;return db['VoiceQueue'][_0x784e('0x63')]({'where':{'id':_0x377160['params']['id']}})[_0x784e('0x28')](handleEntityNotFound(_0x2bde8b,null))[_0x784e('0x28')](function(_0x98c30e){if(_0x98c30e){_0x16b80d=_0x98c30e;_0x50848c[_0x784e('0x42')]=_[_0x784e('0x3f')](db[_0x784e('0x93')][_0x784e('0x3b')]);_0x50848c[_0x784e('0x3e')]=_[_0x784e('0x3f')](_0x377160['query']);_0x50848c[_0x784e('0x40')]=_['intersection'](_0x50848c[_0x784e('0x42')],_0x50848c[_0x784e('0x3e')]);_0x220fd3[_0x784e('0x44')]=_[_0x784e('0x41')](_0x50848c[_0x784e('0x42')],qs[_0x784e('0x43')](_0x377160[_0x784e('0x3e')]['fields']));_0x220fd3['attributes']=_0x220fd3['attributes'][_0x784e('0x53')]?_0x220fd3['attributes']:_0x50848c[_0x784e('0x42')];_0x220fd3[_0x784e('0x65')]=qs[_0x784e('0x47')](_0x377160['query'][_0x784e('0x47')]);_0x220fd3[_0x784e('0x4a')]=qs['filters'](_[_0x784e('0x48')](_0x377160[_0x784e('0x3e')],_0x50848c[_0x784e('0x40')]));if(_0x377160[_0x784e('0x3e')][_0x784e('0x49')]){_0x220fd3[_0x784e('0x4a')]=_['merge'](_0x220fd3[_0x784e('0x4a')],{'$or':_[_0x784e('0x30')](_0x220fd3[_0x784e('0x44')],function(_0x574c30){var _0x4ed652={};_0x4ed652[_0x574c30]={'$like':'%'+_0x377160[_0x784e('0x3e')]['filter']+'%'};return _0x4ed652;})});}_0x220fd3=_[_0x784e('0x4b')]({},_0x220fd3,_0x377160['options']);return _0x16b80d[_0x784e('0x9b')](_0x220fd3);}})[_0x784e('0x28')](function(_0x1a7fcc){if(_0x1a7fcc){_0x246a50=_0x1a7fcc[_0x784e('0x53')];if(!_0x377160[_0x784e('0x3e')][_0x784e('0x45')](_0x784e('0x46'))){_0x220fd3[_0x784e('0x1f')]=qs['limit'](_0x377160['query'][_0x784e('0x1f')]);_0x220fd3[_0x784e('0x1e')]=qs['offset'](_0x377160['query'][_0x784e('0x1e')]);}return _0x16b80d[_0x784e('0x9b')](_0x220fd3);}})[_0x784e('0x28')](function(_0x13c801){return _0x13c801?{'count':_0x246a50,'rows':_0x13c801}:null;})['then'](respondWithResult(_0x2bde8b,null))[_0x784e('0x51')](handleError(_0x2bde8b,null));};exports['getLists']=function(_0x340cc7,_0x1dded3,_0x5758bc){var _0x1c97cc={};var _0x1abd5f={};var _0x32c2bf;var _0x39fcfd;return db[_0x784e('0x3a')][_0x784e('0x63')]({'where':{'id':_0x340cc7[_0x784e('0x52')]['id']}})[_0x784e('0x28')](handleEntityNotFound(_0x1dded3,null))[_0x784e('0x28')](function(_0x201f3a){if(_0x201f3a){_0x32c2bf=_0x201f3a;_0x1abd5f[_0x784e('0x42')]=_[_0x784e('0x3f')](db[_0x784e('0x9c')]['rawAttributes']);_0x1abd5f[_0x784e('0x3e')]=_[_0x784e('0x3f')](_0x340cc7[_0x784e('0x3e')]);_0x1abd5f[_0x784e('0x40')]=_['intersection'](_0x1abd5f['model'],_0x1abd5f[_0x784e('0x3e')]);_0x1c97cc['attributes']=_['intersection'](_0x1abd5f[_0x784e('0x42')],qs['fields'](_0x340cc7[_0x784e('0x3e')][_0x784e('0x43')]));_0x1c97cc['attributes']=_0x1c97cc[_0x784e('0x44')][_0x784e('0x53')]?_0x1c97cc[_0x784e('0x44')]:_0x1abd5f[_0x784e('0x42')];_0x1c97cc[_0x784e('0x65')]=qs[_0x784e('0x47')](_0x340cc7[_0x784e('0x3e')][_0x784e('0x47')]);_0x1c97cc[_0x784e('0x4a')]=qs[_0x784e('0x40')](_[_0x784e('0x48')](_0x340cc7[_0x784e('0x3e')],_0x1abd5f['filters']));if(_0x340cc7['query'][_0x784e('0x49')]){_0x1c97cc[_0x784e('0x4a')]=_[_0x784e('0x4b')](_0x1c97cc[_0x784e('0x4a')],{'$or':_[_0x784e('0x30')](_0x1c97cc['attributes'],function(_0x2f7ec6){var _0x30de67={};_0x30de67[_0x2f7ec6]={'$like':'%'+_0x340cc7[_0x784e('0x3e')][_0x784e('0x49')]+'%'};return _0x30de67;})});}_0x1c97cc=_[_0x784e('0x4b')]({},_0x1c97cc,_0x340cc7[_0x784e('0x4d')]);return _0x32c2bf[_0x784e('0x9d')](_0x1c97cc);}})[_0x784e('0x28')](function(_0x41556b){if(_0x41556b){_0x39fcfd=_0x41556b['length'];if(!_0x340cc7[_0x784e('0x3e')]['hasOwnProperty'](_0x784e('0x46'))){_0x1c97cc[_0x784e('0x1f')]=qs[_0x784e('0x1f')](_0x340cc7[_0x784e('0x3e')][_0x784e('0x1f')]);_0x1c97cc[_0x784e('0x1e')]=qs[_0x784e('0x1e')](_0x340cc7[_0x784e('0x3e')]['offset']);}return _0x32c2bf['getLists'](_0x1c97cc);}})[_0x784e('0x28')](function(_0x7fe68d){if(_0x7fe68d){return _0x7fe68d?{'count':_0x39fcfd,'rows':_0x7fe68d}:null;}})['then'](respondWithResult(_0x1dded3,null))[_0x784e('0x51')](handleError(_0x1dded3,null));};exports[_0x784e('0x9e')]=function(_0xdc691f,_0x4332d2,_0x239cfb){var _0x4e26db,_0x55ce9d;return db[_0x784e('0x3a')]['find']({'where':{'id':_0xdc691f['params']['id']}})['then'](handleEntityNotFound(_0x4332d2,null))['then'](function(_0x40c3b1){if(_0x40c3b1){_0x55ce9d=_0x40c3b1;return _0x40c3b1[_0x784e('0x9e')](_0xdc691f[_0x784e('0x55')][_0x784e('0x95')],_[_0x784e('0x5e')](_0xdc691f[_0x784e('0x55')],[_0x784e('0x95'),'id'])||{});}return null;})[_0x784e('0x96')](function(_0x44cdaf){var _0x49a73b;_0x4e26db=_0x44cdaf||[];var _0x57742b=[];if(_0x44cdaf){for(var _0x10d4f7=0x0;_0x10d4f7<_0x44cdaf['length'];_0x10d4f7+=0x1){var _0x5fc9b4=_0x44cdaf[_0x10d4f7][_0x784e('0x2a')]({'plain':!![]});_0x55ce9d[_0x784e('0x9f')]=_0xdc691f[_0x784e('0x55')]['dialCheckDuplicateType']?_0xdc691f[_0x784e('0x55')][_0x784e('0x9f')]:_0x55ce9d[_0x784e('0x9f')];switch(_0x55ce9d[_0x784e('0x9f')]){case _0x784e('0xa0'):_0x49a73b=squel[_0x784e('0xa1')]()['into']('cm_hopper')[_0x784e('0xa2')]([_0x784e('0xa3'),_0x784e('0xa4'),_0x784e('0xa5'),_0x784e('0xa6'),'VoiceQueueId',_0x784e('0x5f'),_0x784e('0x60')],squel[_0x784e('0xa7')]()[_0x784e('0x81')](_0x784e('0xa3'),'phone')[_0x784e('0x81')]('NOW()',_0x784e('0xa4'))[_0x784e('0x81')]('id',_0x784e('0xa5'))['field'](_0x5fc9b4[_0x784e('0xa8')]['toString'](),_0x784e('0xa6'))[_0x784e('0x81')](_0xdc691f['params']['id'][_0x784e('0xa9')](),_0x784e('0x66'))[_0x784e('0x81')](_0x784e('0xaa'),'createdAt')[_0x784e('0x81')]('NOW()','updatedAt')[_0x784e('0x83')]('cm_contacts')[_0x784e('0x4a')](_0x784e('0xab'))[_0x784e('0x4a')](_0x784e('0xac'),_0x5fc9b4[_0x784e('0xa8')][_0x784e('0xa9')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0x784e('0x4a')](_0x784e('0xad'),squel[_0x784e('0xa7')]()[_0x784e('0x81')](_0x784e('0xae'))[_0x784e('0x83')](_0x784e('0xaf'))[_0x784e('0x4a')]('VoiceQueueId\x20=\x20?',_0xdc691f[_0x784e('0x52')]['id'][_0x784e('0xa9')]()))[_0x784e('0x4a')]('phone\x20NOT\x20IN\x20(?)',squel[_0x784e('0xa7')]()['field'](_0x784e('0xb0'))[_0x784e('0x83')]('cm_hopper')[_0x784e('0x4a')](_0x784e('0x87'),_0xdc691f[_0x784e('0x52')]['id'][_0x784e('0xa9')]())))[_0x784e('0xa9')]();break;case'onlyIfOpen':_0x49a73b=squel[_0x784e('0xa1')]()['into']('cm_hopper')[_0x784e('0xa2')]([_0x784e('0xa3'),_0x784e('0xa4'),'ContactId',_0x784e('0xa6'),_0x784e('0x66'),_0x784e('0x5f'),'updatedAt'],squel['select']()['field'](_0x784e('0xa3'),_0x784e('0xa3'))[_0x784e('0x81')]('NOW()',_0x784e('0xa4'))['field']('id',_0x784e('0xa5'))['field'](_0x5fc9b4['CmListId']['toString'](),'ListId')[_0x784e('0x81')](_0xdc691f[_0x784e('0x52')]['id'][_0x784e('0xa9')](),'VoiceQueueId')['field'](_0x784e('0xaa'),_0x784e('0x5f'))[_0x784e('0x81')](_0x784e('0xaa'),_0x784e('0x60'))[_0x784e('0x83')](_0x784e('0xb1'))[_0x784e('0x4a')](_0x784e('0xab'))['where'](_0x784e('0xac'),_0x5fc9b4['CmListId'][_0x784e('0xa9')]())[_0x784e('0x4a')](_0x784e('0xb2'))[_0x784e('0x4a')]('phone\x20NOT\x20IN\x20(?)',squel[_0x784e('0xa7')]()[_0x784e('0x81')](_0x784e('0xb0'))['from'](_0x784e('0xb3'))[_0x784e('0x4a')](_0x784e('0x87'),_0xdc691f['params']['id']['toString']())))[_0x784e('0xa9')]();break;default:_0x49a73b=squel['insert']()[_0x784e('0xb4')]('cm_hopper')[_0x784e('0xa2')]([_0x784e('0xa3'),_0x784e('0xa4'),'ContactId',_0x784e('0xa6'),_0x784e('0x66'),_0x784e('0x5f'),_0x784e('0x60')],squel[_0x784e('0xa7')]()[_0x784e('0x81')]('phone',_0x784e('0xa3'))[_0x784e('0x81')](_0x784e('0xaa'),_0x784e('0xa4'))[_0x784e('0x81')]('id','ContactId')['field'](_0x5fc9b4[_0x784e('0xa8')][_0x784e('0xa9')](),_0x784e('0xa6'))['field'](_0xdc691f['params']['id'][_0x784e('0xa9')](),_0x784e('0x66'))[_0x784e('0x81')]('NOW()',_0x784e('0x5f'))[_0x784e('0x81')](_0x784e('0xaa'),'updatedAt')['from'](_0x784e('0xb1'))[_0x784e('0x4a')]('deletedAt\x20IS\x20NULL')[_0x784e('0x4a')](_0x784e('0xac'),_0x5fc9b4[_0x784e('0xa8')]['toString']())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x784e('0xa9')]();}_0x57742b[_0x784e('0x89')](db[_0x784e('0x78')][_0x784e('0x3e')](_0x49a73b));}return BPromise[_0x784e('0x8d')](_0x57742b);}})[_0x784e('0x28')](function(){return _0x4e26db;})[_0x784e('0x28')](respondWithResult(_0x4332d2,null))[_0x784e('0x51')](handleError(_0x4332d2,null));};exports[_0x784e('0xb5')]=function(_0x30e238,_0x54a669,_0x1e4348){return db[_0x784e('0x3a')][_0x784e('0x34')]({'where':{'id':_0x30e238[_0x784e('0x52')]['id']}})[_0x784e('0x28')](handleEntityNotFound(_0x54a669,null))[_0x784e('0x28')](function(_0x1fd6f7){if(_0x1fd6f7){return _0x1fd6f7['removeLists'](_0x30e238[_0x784e('0x3e')]['ids']);}})[_0x784e('0x28')](function(_0xf87b16){if(_0xf87b16){return db[_0x784e('0x64')][_0x784e('0x29')]({'where':{'ListId':_0x30e238[_0x784e('0x3e')][_0x784e('0x95')],'VoiceQueueId':_0x30e238[_0x784e('0x52')]['id']}})['then'](function(){return _0xf87b16;});}})[_0x784e('0x28')](respondWithStatusCode(_0x54a669,null))[_0x784e('0x51')](handleError(_0x54a669,null));};exports[_0x784e('0xb6')]=function(_0xfb448c,_0x43b585,_0x2a430f){var _0x153602={};var _0x1359e1={};var _0x2e1ec7;var _0x1c098c;return db['VoiceQueue'][_0x784e('0x63')]({'where':{'id':_0xfb448c[_0x784e('0x52')]['id']}})[_0x784e('0x28')](handleEntityNotFound(_0x43b585,null))[_0x784e('0x28')](function(_0x4f53c5){if(_0x4f53c5){_0x2e1ec7=_0x4f53c5;_0x1359e1['model']=_['keys'](db[_0x784e('0x9c')][_0x784e('0x3b')]);_0x1359e1[_0x784e('0x3e')]=_[_0x784e('0x3f')](_0xfb448c[_0x784e('0x3e')]);_0x1359e1['filters']=_[_0x784e('0x41')](_0x1359e1['model'],_0x1359e1['query']);_0x153602[_0x784e('0x44')]=_[_0x784e('0x41')](_0x1359e1[_0x784e('0x42')],qs['fields'](_0xfb448c[_0x784e('0x3e')][_0x784e('0x43')]));_0x153602[_0x784e('0x44')]=_0x153602[_0x784e('0x44')][_0x784e('0x53')]?_0x153602['attributes']:_0x1359e1['model'];_0x153602[_0x784e('0x65')]=qs[_0x784e('0x47')](_0xfb448c['query'][_0x784e('0x47')]);_0x153602['where']=qs[_0x784e('0x40')](_['pick'](_0xfb448c['query'],_0x1359e1[_0x784e('0x40')]));if(_0xfb448c[_0x784e('0x3e')]['filter']){_0x153602['where']=_[_0x784e('0x4b')](_0x153602[_0x784e('0x4a')],{'$or':_[_0x784e('0x30')](_0x153602[_0x784e('0x44')],function(_0x268509){var _0xf80f63={};_0xf80f63[_0x268509]={'$like':'%'+_0xfb448c[_0x784e('0x3e')][_0x784e('0x49')]+'%'};return _0xf80f63;})});}_0x153602=_[_0x784e('0x4b')]({},_0x153602,_0xfb448c['options']);return _0x2e1ec7[_0x784e('0xb6')](_0x153602);}})['then'](function(_0x42d319){if(_0x42d319){_0x1c098c=_0x42d319[_0x784e('0x53')];if(!_0xfb448c[_0x784e('0x3e')][_0x784e('0x45')]('nolimit')){_0x153602['limit']=qs[_0x784e('0x1f')](_0xfb448c[_0x784e('0x3e')]['limit']);_0x153602['offset']=qs[_0x784e('0x1e')](_0xfb448c[_0x784e('0x3e')]['offset']);}return _0x2e1ec7[_0x784e('0xb6')](_0x153602);}})[_0x784e('0x28')](function(_0x47188a){if(_0x47188a){return _0x47188a?{'count':_0x1c098c,'rows':_0x47188a}:null;}})[_0x784e('0x28')](respondWithResult(_0x43b585,null))['catch'](handleError(_0x43b585,null));};exports[_0x784e('0xb7')]=function(_0x17a63b,_0x58f607,_0x405791){var _0x178d51,_0x38c973;return db['VoiceQueue']['find']({'where':{'id':_0x17a63b[_0x784e('0x52')]['id']}})[_0x784e('0x28')](handleEntityNotFound(_0x58f607,null))[_0x784e('0x28')](function(_0xef6634){if(_0xef6634){_0x38c973=_0xef6634;return _0xef6634['addBlackLists'](_0x17a63b[_0x784e('0x55')][_0x784e('0x95')],_['omit'](_0x17a63b[_0x784e('0x55')],[_0x784e('0x95'),'id'])||{});}return null;})['spread'](function(_0x2b3db7){var _0x5cf3b9;_0x178d51=_0x2b3db7||[];var _0x35b3ab=[];if(_0x2b3db7){for(var _0x4f19d3=0x0;_0x4f19d3<_0x2b3db7[_0x784e('0x53')];_0x4f19d3+=0x1){var _0x37760f=_0x2b3db7[_0x4f19d3][_0x784e('0x2a')]({'plain':!![]});_0x5cf3b9=squel[_0x784e('0xa1')]()[_0x784e('0xb4')](_0x784e('0xb8'))[_0x784e('0xa2')]([_0x784e('0xa3'),'ContactId',_0x784e('0xa6'),'VoiceQueueId',_0x784e('0x5f'),'updatedAt'],squel[_0x784e('0xa7')]()[_0x784e('0x81')](_0x784e('0xa3'),_0x784e('0xa3'))['field']('id',_0x784e('0xa5'))['field'](_0x37760f[_0x784e('0xa8')][_0x784e('0xa9')](),'ListId')['field'](_0x17a63b['params']['id'][_0x784e('0xa9')](),'VoiceQueueId')[_0x784e('0x81')](_0x784e('0xaa'),_0x784e('0x5f'))[_0x784e('0x81')](_0x784e('0xaa'),_0x784e('0x60'))[_0x784e('0x83')](_0x784e('0xb1'))[_0x784e('0x4a')]('deletedAt\x20IS\x20NULL')[_0x784e('0x4a')](_0x784e('0xac'),_0x37760f[_0x784e('0xa8')][_0x784e('0xa9')]())[_0x784e('0x4a')](_0x784e('0xb2')))[_0x784e('0xa9')]();_0x35b3ab[_0x784e('0x89')](db[_0x784e('0x78')][_0x784e('0x3e')](_0x5cf3b9));}return BPromise[_0x784e('0x8d')](_0x35b3ab);}})[_0x784e('0x28')](function(){return _0x178d51;})[_0x784e('0x28')](respondWithResult(_0x58f607,null))[_0x784e('0x51')](handleError(_0x58f607,null));};exports[_0x784e('0xb9')]=function(_0x98d9da,_0xa54eb0,_0x325e22){return db['VoiceQueue']['find']({'where':{'id':_0x98d9da['params']['id']}})[_0x784e('0x28')](handleEntityNotFound(_0xa54eb0,null))[_0x784e('0x28')](function(_0x579c84){if(_0x579c84){return _0x579c84[_0x784e('0xb9')](_0x98d9da[_0x784e('0x3e')][_0x784e('0x95')]);}})['then'](function(_0xdebe8c){if(_0xdebe8c){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x98d9da[_0x784e('0x3e')][_0x784e('0x95')],'VoiceQueueId':_0x98d9da[_0x784e('0x52')]['id']}})[_0x784e('0x28')](function(){return _0xdebe8c;});}})[_0x784e('0x28')](respondWithStatusCode(_0xa54eb0,null))[_0x784e('0x51')](handleError(_0xa54eb0,null));};
\ No newline at end of file
+var _0x9a4b=['all','union','compact','isEmpty','removeAgents','UserVoiceQueueRt','userVoiceQueue:remove','addAgents','spread','online','upsert','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','fromQuery','ContactId','ListId','updatedAt','select','phone','NOW()','CmListId','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_final','VoiceQueueId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','scheduledAt','cm_contacts','removeLists','getBlackLists','addBlackLists','cm_hopper_black','push','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','status','end','json','offset','undefined','Content-Range','apply','reject','save','update','then','destroy','VoiceQueues','inbound','QueueCampaigns','filter','map','value','includes','type','name','UserProfileResource','error','send','index','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VoiceQueue','count','includeAll','include','findAll','catch','show','rawAttributes','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','outbound','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','omit','createdAt','CmHopper','rows','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','VoiceQueueId','getHopperBlacks','CmHopperBlack','getTeams','addTeams','teams','User','Agents','voicePause','flatMap','forEach','penalty','transaction','TeamVoiceQueue','each','findOrCreate','isNil','format','SIP/%s','interface','emit','userVoiceQueue:save','removeTeams','Team','ids','field','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','sequelize','toString','QueryTypes','every','TeamId'];(function(_0x5673c4,_0x5b672d){var _0x32b859=function(_0x4aa620){while(--_0x4aa620){_0x5673c4['push'](_0x5673c4['shift']());}};_0x32b859(++_0x5b672d);}(_0x9a4b,0xea));var _0xb9a4=function(_0x41dd6b,_0x5ae4ba){_0x41dd6b=_0x41dd6b-0x0;var _0x156c5a=_0x9a4b[_0x41dd6b];return _0x156c5a;};'use strict';var emlformat=require(_0xb9a4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb9a4('0x1'));var jsonpatch=require(_0xb9a4('0x2'));var rp=require(_0xb9a4('0x3'));var moment=require(_0xb9a4('0x4'));var BPromise=require(_0xb9a4('0x5'));var Mustache=require(_0xb9a4('0x6'));var util=require('util');var path=require(_0xb9a4('0x7'));var sox=require(_0xb9a4('0x8'));var csv=require(_0xb9a4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb9a4('0xa'));var _=require(_0xb9a4('0xb'));var squel=require(_0xb9a4('0xc'));var crypto=require(_0xb9a4('0xd'));var jsforce=require(_0xb9a4('0xe'));var deskjs=require(_0xb9a4('0xf'));var toCsv=require(_0xb9a4('0x9'));var querystring=require(_0xb9a4('0x10'));var Papa=require(_0xb9a4('0x11'));var Redis=require(_0xb9a4('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb9a4('0x13'));var hardwareService=require(_0xb9a4('0x14'));var logger=require(_0xb9a4('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xb9a4('0x16'));var licenseUtil=require(_0xb9a4('0x17'));var db=require(_0xb9a4('0x18'))['db'];config[_0xb9a4('0x19')]=_['defaults'](config[_0xb9a4('0x19')],{'host':_0xb9a4('0x1a'),'port':0x18eb});var socket=require(_0xb9a4('0x1b'))(new Redis(config[_0xb9a4('0x19')]));require(_0xb9a4('0x1c'))[_0xb9a4('0x1d')](socket);function respondWithStatusCode(_0x1322f8,_0xadce54){_0xadce54=_0xadce54||0xcc;return function(_0x186b30){if(_0x186b30){return _0x1322f8['sendStatus'](_0xadce54);}return _0x1322f8[_0xb9a4('0x1e')](_0xadce54)[_0xb9a4('0x1f')]();};}function respondWithResult(_0x14ddc5,_0x30e507){_0x30e507=_0x30e507||0xc8;return function(_0x5487e0){if(_0x5487e0){return _0x14ddc5['status'](_0x30e507)[_0xb9a4('0x20')](_0x5487e0);}};}function respondWithFilteredResult(_0x428121,_0x3971f5){return function(_0x160b0a){if(_0x160b0a){var _0x6345da=typeof _0x3971f5[_0xb9a4('0x21')]===_0xb9a4('0x22')&&typeof _0x3971f5['limit']==='undefined';var _0x53f320=_0x160b0a['count'];var _0x19795b=_0x6345da?0x0:_0x3971f5[_0xb9a4('0x21')];var _0x4891be=_0x6345da?_0x160b0a['count']:_0x3971f5['offset']+_0x3971f5['limit'];var _0x4cac77;if(_0x4891be>=_0x53f320){_0x4891be=_0x53f320;_0x4cac77=0xc8;}else{_0x4cac77=0xce;}_0x428121['status'](_0x4cac77);return _0x428121['set'](_0xb9a4('0x23'),_0x19795b+'-'+_0x4891be+'/'+_0x53f320)[_0xb9a4('0x20')](_0x160b0a);}return null;};}function patchUpdates(_0x2d7815){return function(_0xcaa175){try{jsonpatch[_0xb9a4('0x24')](_0xcaa175,_0x2d7815,!![]);}catch(_0x596cd3){return BPromise[_0xb9a4('0x25')](_0x596cd3);}return _0xcaa175[_0xb9a4('0x26')]();};}function saveUpdates(_0x149609,_0x3d769d){return function(_0x5d9501){if(_0x5d9501){return _0x5d9501[_0xb9a4('0x27')](_0x149609)[_0xb9a4('0x28')](function(_0x51081e){return _0x51081e;});}return null;};}function removeEntity(_0x211fc4,_0x279b16){return function(_0x2317b9){if(_0x2317b9){return _0x2317b9[_0xb9a4('0x29')]()[_0xb9a4('0x28')](function(){var _0x4e0786=_0x2317b9['get']({'plain':!![]});var _0x4deae7=[{'name':_0xb9a4('0x2a'),'value':_0xb9a4('0x2b'),'ignore':![]},{'name':_0xb9a4('0x2c'),'value':'outbound','ignore':![]}];var _0x21fcd6=_(_0x4deae7)[_0xb9a4('0x2d')]('ignore')[_0xb9a4('0x2e')](_0xb9a4('0x2f'))[_0xb9a4('0x2f')]();if(_[_0xb9a4('0x30')](_0x21fcd6,_0x4e0786[_0xb9a4('0x31')])){return;}var _0x1901bc=_['find'](_0x4deae7,[_0xb9a4('0x2f'),_0x4e0786[_0xb9a4('0x31')]])[_0xb9a4('0x32')];return db[_0xb9a4('0x33')]['destroy']({'where':{'type':_0x1901bc,'resourceId':_0x4e0786['id']}})[_0xb9a4('0x28')](function(){return _0x2317b9;});})[_0xb9a4('0x28')](function(){_0x211fc4['status'](0xcc)[_0xb9a4('0x1f')]();});}};}function handleEntityNotFound(_0x25c660,_0x742051){return function(_0x11e3ae){if(!_0x11e3ae){_0x25c660['sendStatus'](0x194);}return _0x11e3ae;};}function handleError(_0x33fd19,_0x275cfd){_0x275cfd=_0x275cfd||0x1f4;return function(_0x2fa3dc){logger[_0xb9a4('0x34')](_0x2fa3dc['stack']);if(_0x2fa3dc[_0xb9a4('0x32')]){delete _0x2fa3dc[_0xb9a4('0x32')];}_0x33fd19[_0xb9a4('0x1e')](_0x275cfd)[_0xb9a4('0x35')](_0x2fa3dc);};}exports[_0xb9a4('0x36')]=function(_0x24ac33,_0x36b8e1){var _0x25c690={},_0x41b8f3={},_0xab4330={'count':0x0,'rows':[]};var _0x385569=_[_0xb9a4('0x2e')](db['VoiceQueue']['rawAttributes'],function(_0x4d28de){return{'name':_0x4d28de[_0xb9a4('0x37')],'type':_0x4d28de[_0xb9a4('0x31')][_0xb9a4('0x38')]};});_0x41b8f3[_0xb9a4('0x39')]=_[_0xb9a4('0x2e')](_0x385569,_0xb9a4('0x32'));_0x41b8f3[_0xb9a4('0x3a')]=_[_0xb9a4('0x3b')](_0x24ac33[_0xb9a4('0x3a')]);_0x41b8f3[_0xb9a4('0x3c')]=_[_0xb9a4('0x3d')](_0x41b8f3[_0xb9a4('0x39')],_0x41b8f3[_0xb9a4('0x3a')]);_0x25c690['attributes']=_[_0xb9a4('0x3d')](_0x41b8f3['model'],qs['fields'](_0x24ac33[_0xb9a4('0x3a')][_0xb9a4('0x3e')]));_0x25c690[_0xb9a4('0x3f')]=_0x25c690[_0xb9a4('0x3f')][_0xb9a4('0x40')]?_0x25c690[_0xb9a4('0x3f')]:_0x41b8f3['model'];if(!_0x24ac33['query'][_0xb9a4('0x41')](_0xb9a4('0x42'))){_0x25c690[_0xb9a4('0x43')]=qs[_0xb9a4('0x43')](_0x24ac33[_0xb9a4('0x3a')][_0xb9a4('0x43')]);_0x25c690[_0xb9a4('0x21')]=qs[_0xb9a4('0x21')](_0x24ac33[_0xb9a4('0x3a')][_0xb9a4('0x21')]);}_0x25c690[_0xb9a4('0x44')]=qs[_0xb9a4('0x45')](_0x24ac33[_0xb9a4('0x3a')][_0xb9a4('0x45')]);_0x25c690[_0xb9a4('0x46')]=qs[_0xb9a4('0x3c')](_[_0xb9a4('0x47')](_0x24ac33['query'],_0x41b8f3[_0xb9a4('0x3c')]),_0x385569);if(_0x24ac33['query'][_0xb9a4('0x2d')]){_0x25c690[_0xb9a4('0x46')]=_[_0xb9a4('0x48')](_0x25c690[_0xb9a4('0x46')],{'$or':_['map'](_0x385569,function(_0x450629){if(_0x450629[_0xb9a4('0x31')]!=='VIRTUAL'){var _0x310cf8={};_0x310cf8[_0x450629[_0xb9a4('0x32')]]={'$like':'%'+_0x24ac33[_0xb9a4('0x3a')][_0xb9a4('0x2d')]+'%'};return _0x310cf8;}})});}_0x25c690=_[_0xb9a4('0x48')]({},_0x25c690,_0x24ac33['options']);var _0x3ce92d={'where':_0x25c690['where']};return db[_0xb9a4('0x49')][_0xb9a4('0x4a')](_0x3ce92d)[_0xb9a4('0x28')](function(_0x563c77){_0xab4330[_0xb9a4('0x4a')]=_0x563c77;if(_0x24ac33[_0xb9a4('0x3a')][_0xb9a4('0x4b')]){_0x25c690[_0xb9a4('0x4c')]=[{'all':!![]}];}return db[_0xb9a4('0x49')][_0xb9a4('0x4d')](_0x25c690);})[_0xb9a4('0x28')](function(_0xd1ef38){_0xab4330['rows']=_0xd1ef38;return _0xab4330;})['then'](respondWithFilteredResult(_0x36b8e1,_0x25c690))[_0xb9a4('0x4e')](handleError(_0x36b8e1,null));};exports[_0xb9a4('0x4f')]=function(_0x1258af,_0x20fb8f){var _0x5c4da9={'raw':![],'where':{'id':_0x1258af['params']['id']}},_0x252e23={};_0x252e23[_0xb9a4('0x39')]=_[_0xb9a4('0x3b')](db[_0xb9a4('0x49')][_0xb9a4('0x50')]);_0x252e23[_0xb9a4('0x3a')]=_[_0xb9a4('0x3b')](_0x1258af['query']);_0x252e23[_0xb9a4('0x3c')]=_[_0xb9a4('0x3d')](_0x252e23[_0xb9a4('0x39')],_0x252e23[_0xb9a4('0x3a')]);_0x5c4da9[_0xb9a4('0x3f')]=_[_0xb9a4('0x3d')](_0x252e23['model'],qs[_0xb9a4('0x3e')](_0x1258af[_0xb9a4('0x3a')][_0xb9a4('0x3e')]));_0x5c4da9[_0xb9a4('0x3f')]=_0x5c4da9['attributes'][_0xb9a4('0x40')]?_0x5c4da9['attributes']:_0x252e23[_0xb9a4('0x39')];if(_0x1258af['query']['includeAll']){_0x5c4da9[_0xb9a4('0x4c')]=[{'all':!![]}];}_0x5c4da9=_[_0xb9a4('0x48')]({},_0x5c4da9,_0x1258af[_0xb9a4('0x51')]);return db['VoiceQueue'][_0xb9a4('0x52')](_0x5c4da9)[_0xb9a4('0x28')](handleEntityNotFound(_0x20fb8f,null))[_0xb9a4('0x28')](respondWithResult(_0x20fb8f,null))[_0xb9a4('0x4e')](handleError(_0x20fb8f,null));};exports[_0xb9a4('0x53')]=function(_0x1a1995,_0x3182e5){return db[_0xb9a4('0x49')][_0xb9a4('0x53')](_0x1a1995[_0xb9a4('0x54')],{})[_0xb9a4('0x28')](function(_0x22be6f){var _0x593f1c=_0x1a1995[_0xb9a4('0x55')][_0xb9a4('0x56')]({'plain':!![]});if(!_0x593f1c)throw new Error(_0xb9a4('0x57'));if(_0x593f1c[_0xb9a4('0x58')]===_0xb9a4('0x55')){var _0x3dcc5b=_0x22be6f[_0xb9a4('0x56')]({'plain':!![]});var _0x3326ab=[{'name':_0xb9a4('0x2a'),'value':_0xb9a4('0x2b')},{'name':_0xb9a4('0x2c'),'value':_0xb9a4('0x59')}];var _0x7fbbeb=_[_0xb9a4('0x52')](_0x3326ab,[_0xb9a4('0x2f'),_0x3dcc5b[_0xb9a4('0x31')]])['name'];return db[_0xb9a4('0x5a')][_0xb9a4('0x52')]({'where':{'name':_0x7fbbeb,'userProfileId':_0x593f1c[_0xb9a4('0x5b')]},'raw':!![]})[_0xb9a4('0x28')](function(_0x3645e2){if(_0x3645e2&&_0x3645e2[_0xb9a4('0x5c')]===0x0){return db['UserProfileResource'][_0xb9a4('0x53')]({'name':_0x3dcc5b['name'],'resourceId':_0x3dcc5b['id'],'type':_0x3645e2['name'],'sectionId':_0x3645e2['id']},{})[_0xb9a4('0x28')](function(){return _0x22be6f;});}else{return _0x22be6f;}})[_0xb9a4('0x4e')](function(_0x2bede8){logger[_0xb9a4('0x34')](_0xb9a4('0x5d'),_0x2bede8);throw _0x2bede8;});}return _0x22be6f;})[_0xb9a4('0x28')](respondWithResult(_0x3182e5,0xc9))[_0xb9a4('0x4e')](handleError(_0x3182e5,null));};exports['clone']=function(_0x11205e,_0x1bce1b){var _0x529879={'where':{'id':_0x11205e[_0xb9a4('0x5e')]['id']}},_0x49c745={};_0x49c745[_0xb9a4('0x39')]=_[_0xb9a4('0x3b')](db[_0xb9a4('0x49')]['rawAttributes']);_0x529879['attributes']=_[_0xb9a4('0x3d')](_0x49c745[_0xb9a4('0x39')],qs[_0xb9a4('0x3e')](_0x11205e[_0xb9a4('0x3a')]['fields']));_0x529879['attributes']=_0x529879['attributes'][_0xb9a4('0x40')]?_0x529879[_0xb9a4('0x3f')]:_0x49c745[_0xb9a4('0x39')];if(_0x11205e[_0xb9a4('0x3a')]['includeAll']){_0x529879['include']=[{'all':!![]}];}_0x529879=_['merge']({},_0x529879,_0x11205e[_0xb9a4('0x51')]);return db[_0xb9a4('0x49')][_0xb9a4('0x52')](_0x529879)['then'](handleEntityNotFound(_0x1bce1b,null))['then'](function(_0x11b598){if(_0x11b598){var _0x55c7f9=_0x11b598[_0xb9a4('0x56')]({'plain':!![]});_0x55c7f9=qs[_0xb9a4('0x5f')](_0x55c7f9,['id',_0xb9a4('0x60'),'updatedAt']);_0x11205e['body']=_[_0xb9a4('0x5f')](_0x11205e['body'],['id','createdAt','updatedAt']);return db[_0xb9a4('0x49')][_0xb9a4('0x53')](_[_0xb9a4('0x48')](_0x55c7f9,_0x11205e[_0xb9a4('0x54')]),{'include':_0x11205e[_0xb9a4('0x3a')]['includeAll']?[{'all':!![]}]:undefined})[_0xb9a4('0x28')](function(_0x38979b){var _0x54975d=_0x11205e[_0xb9a4('0x55')][_0xb9a4('0x56')]({'plain':!![]});if(!_0x54975d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x54975d[_0xb9a4('0x58')]===_0xb9a4('0x55')){var _0x1597c7=_0x38979b[_0xb9a4('0x56')]({'plain':!![]});var _0x556375=[{'name':_0xb9a4('0x2a'),'value':_0xb9a4('0x2b')},{'name':_0xb9a4('0x2c'),'value':_0xb9a4('0x59')}];var _0xc8f23a=_['find'](_0x556375,[_0xb9a4('0x2f'),_0x1597c7[_0xb9a4('0x31')]])[_0xb9a4('0x32')];return db[_0xb9a4('0x5a')][_0xb9a4('0x52')]({'where':{'name':_0xc8f23a,'userProfileId':_0x54975d['userProfileId']},'raw':!![]})['then'](function(_0x1f4b16){if(_0x1f4b16&&_0x1f4b16['autoAssociation']===0x0){return db[_0xb9a4('0x33')][_0xb9a4('0x53')]({'name':_0x1597c7[_0xb9a4('0x32')],'resourceId':_0x1597c7['id'],'type':_0x1f4b16[_0xb9a4('0x32')],'sectionId':_0x1f4b16['id']},{})[_0xb9a4('0x28')](function(){return _0x38979b;});}else{return _0x38979b;}})[_0xb9a4('0x4e')](function(_0x385a0d){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x385a0d);throw _0x385a0d;});}return _0x38979b;});}})[_0xb9a4('0x28')](respondWithResult(_0x1bce1b,0xc9))[_0xb9a4('0x4e')](handleError(_0x1bce1b,null));};exports['update']=function(_0x32cfdc,_0x55ab5b){if(_0x32cfdc[_0xb9a4('0x54')]['id']){delete _0x32cfdc['body']['id'];}return db[_0xb9a4('0x49')]['find']({'where':{'id':_0x32cfdc[_0xb9a4('0x5e')]['id']}})[_0xb9a4('0x28')](handleEntityNotFound(_0x55ab5b,null))['then'](saveUpdates(_0x32cfdc[_0xb9a4('0x54')],null))[_0xb9a4('0x28')](respondWithResult(_0x55ab5b,null))[_0xb9a4('0x4e')](handleError(_0x55ab5b,null));};exports[_0xb9a4('0x29')]=function(_0x4f8a98,_0x3ca449){return db[_0xb9a4('0x49')][_0xb9a4('0x52')]({'where':{'id':_0x4f8a98['params']['id']}})['then'](handleEntityNotFound(_0x3ca449,null))[_0xb9a4('0x28')](removeEntity(_0x3ca449,null))['catch'](handleError(_0x3ca449,null));};exports['getHoppers']=function(_0x31f530,_0x10d2a5,_0x3b1851){var _0x93469c={'raw':![],'where':{}};var _0xf7a774={};var _0x1bc4c0={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x31f530['params']['id']}})[_0xb9a4('0x28')](handleEntityNotFound(_0x10d2a5,null))[_0xb9a4('0x28')](function(_0x2fccab){if(_0x2fccab){_0xf7a774[_0xb9a4('0x39')]=_[_0xb9a4('0x3b')](db[_0xb9a4('0x61')]['rawAttributes']);_0xf7a774['query']=_[_0xb9a4('0x3b')](_0x31f530[_0xb9a4('0x3a')]);_0xf7a774['filters']=_['intersection'](_0xf7a774[_0xb9a4('0x39')],_0xf7a774[_0xb9a4('0x3a')]);_0x93469c[_0xb9a4('0x3f')]=_[_0xb9a4('0x3d')](_0xf7a774[_0xb9a4('0x39')],qs[_0xb9a4('0x3e')](_0x31f530['query'][_0xb9a4('0x3e')]));_0x93469c[_0xb9a4('0x3f')]=_0x93469c[_0xb9a4('0x3f')][_0xb9a4('0x40')]?_0x93469c[_0xb9a4('0x3f')]:_0xf7a774[_0xb9a4('0x39')];if(!_0x31f530['query']['hasOwnProperty'](_0xb9a4('0x42'))){_0x93469c[_0xb9a4('0x43')]=qs['limit'](_0x31f530['query'][_0xb9a4('0x43')]);_0x93469c['offset']=qs['offset'](_0x31f530[_0xb9a4('0x3a')][_0xb9a4('0x21')]);}_0x93469c[_0xb9a4('0x44')]=qs['sort'](_0x31f530['query'][_0xb9a4('0x45')]);_0x93469c['where']=qs['filters'](_['pick'](_0x31f530[_0xb9a4('0x3a')],_0xf7a774[_0xb9a4('0x3c')]));_0x93469c[_0xb9a4('0x46')]['VoiceQueueId']=_0x2fccab['id'];if(_0x31f530[_0xb9a4('0x3a')]['filter']){_0x93469c[_0xb9a4('0x46')]=_['merge'](_0x93469c[_0xb9a4('0x46')],{'$or':_[_0xb9a4('0x2e')](_0x93469c[_0xb9a4('0x3f')],function(_0x90a694){var _0x78482c={};_0x78482c[_0x90a694]={'$like':'%'+_0x31f530[_0xb9a4('0x3a')][_0xb9a4('0x2d')]+'%'};return _0x78482c;})});}_0x93469c=_[_0xb9a4('0x48')]({},_0x93469c,_0x31f530[_0xb9a4('0x51')]);return db[_0xb9a4('0x61')][_0xb9a4('0x4a')]({'where':_0x93469c['where']})[_0xb9a4('0x28')](function(_0x17074b){_0x1bc4c0[_0xb9a4('0x4a')]=_0x17074b;if(_0x31f530[_0xb9a4('0x3a')][_0xb9a4('0x4b')]){_0x93469c[_0xb9a4('0x4c')]=[{'all':!![]}];}return db[_0xb9a4('0x61')][_0xb9a4('0x4d')](_0x93469c);})['then'](function(_0x1084b2){_0x1bc4c0[_0xb9a4('0x62')]=_0x1084b2;return _0x1bc4c0;});}})[_0xb9a4('0x28')](respondWithFilteredResult(_0x10d2a5,_0x93469c))['catch'](handleError(_0x10d2a5,null));};exports[_0xb9a4('0x63')]=function(_0x4263ff,_0x549ab6,_0x10be28){var _0x2c721e={'raw':!![],'where':{}};var _0x48dc69={};var _0x17c177={'count':0x0,'rows':[]};return db[_0xb9a4('0x49')][_0xb9a4('0x64')]({'where':{'id':_0x4263ff[_0xb9a4('0x5e')]['id']}})[_0xb9a4('0x28')](handleEntityNotFound(_0x549ab6,null))[_0xb9a4('0x28')](function(_0x4f1ea3){if(_0x4f1ea3){_0x48dc69['model']=_[_0xb9a4('0x3b')](db[_0xb9a4('0x65')]['rawAttributes']);_0x48dc69['query']=_[_0xb9a4('0x3b')](_0x4263ff[_0xb9a4('0x3a')]);_0x48dc69[_0xb9a4('0x3c')]=_[_0xb9a4('0x3d')](_0x48dc69[_0xb9a4('0x39')],_0x48dc69[_0xb9a4('0x3a')]);_0x2c721e['attributes']=_['intersection'](_0x48dc69[_0xb9a4('0x39')],qs['fields'](_0x4263ff[_0xb9a4('0x3a')][_0xb9a4('0x3e')]));_0x2c721e[_0xb9a4('0x3f')]=_0x2c721e[_0xb9a4('0x3f')][_0xb9a4('0x40')]?_0x2c721e[_0xb9a4('0x3f')]:_0x48dc69[_0xb9a4('0x39')];if(!_0x4263ff[_0xb9a4('0x3a')][_0xb9a4('0x41')](_0xb9a4('0x42'))){_0x2c721e[_0xb9a4('0x43')]=qs[_0xb9a4('0x43')](_0x4263ff[_0xb9a4('0x3a')][_0xb9a4('0x43')]);_0x2c721e[_0xb9a4('0x21')]=qs[_0xb9a4('0x21')](_0x4263ff[_0xb9a4('0x3a')]['offset']);}_0x2c721e[_0xb9a4('0x44')]=qs['sort'](_0x4263ff[_0xb9a4('0x3a')][_0xb9a4('0x45')]);_0x2c721e['where']=qs[_0xb9a4('0x3c')](_[_0xb9a4('0x47')](_0x4263ff[_0xb9a4('0x3a')],_0x48dc69[_0xb9a4('0x3c')]));_0x2c721e[_0xb9a4('0x46')]['VoiceQueueId']=_0x4f1ea3['id'];if(_0x4263ff[_0xb9a4('0x3a')][_0xb9a4('0x2d')]){_0x2c721e[_0xb9a4('0x46')]=_['merge'](_0x2c721e[_0xb9a4('0x46')],{'$or':_[_0xb9a4('0x2e')](_0x2c721e['attributes'],function(_0x1731ba){var _0x5331da={};_0x5331da[_0x1731ba]={'$like':'%'+_0x4263ff['query'][_0xb9a4('0x2d')]+'%'};return _0x5331da;})});}_0x2c721e=_[_0xb9a4('0x48')]({},_0x2c721e,_0x4263ff[_0xb9a4('0x51')]);return db[_0xb9a4('0x65')][_0xb9a4('0x4a')]({'where':_0x2c721e[_0xb9a4('0x46')]})[_0xb9a4('0x28')](function(_0x5ce41a){_0x17c177[_0xb9a4('0x4a')]=_0x5ce41a;if(_0x4263ff[_0xb9a4('0x3a')][_0xb9a4('0x4b')]){_0x2c721e['include']=[{'all':!![]}];}return db[_0xb9a4('0x65')][_0xb9a4('0x4d')](_0x2c721e);})[_0xb9a4('0x28')](function(_0x586039){_0x17c177['rows']=_0x586039;return _0x17c177;});}})['then'](respondWithFilteredResult(_0x549ab6,_0x2c721e))[_0xb9a4('0x4e')](handleError(_0x549ab6,null));};exports[_0xb9a4('0x66')]=function(_0xeffbeb,_0x3ddbd5,_0x2b2075){var _0x1c5aba={'raw':!![],'where':{}};var _0x29e3d3={};var _0x4c9f8d={'count':0x0,'rows':[]};return db[_0xb9a4('0x49')][_0xb9a4('0x64')]({'where':{'id':_0xeffbeb['params']['id']}})[_0xb9a4('0x28')](handleEntityNotFound(_0x3ddbd5,null))[_0xb9a4('0x28')](function(_0x2ed3ec){if(_0x2ed3ec){_0x29e3d3[_0xb9a4('0x39')]=_['keys'](db[_0xb9a4('0x67')][_0xb9a4('0x50')]);_0x29e3d3[_0xb9a4('0x3a')]=_['keys'](_0xeffbeb[_0xb9a4('0x3a')]);_0x29e3d3[_0xb9a4('0x3c')]=_['intersection'](_0x29e3d3[_0xb9a4('0x39')],_0x29e3d3[_0xb9a4('0x3a')]);_0x1c5aba[_0xb9a4('0x3f')]=_['intersection'](_0x29e3d3[_0xb9a4('0x39')],qs[_0xb9a4('0x3e')](_0xeffbeb[_0xb9a4('0x3a')][_0xb9a4('0x3e')]));_0x1c5aba['attributes']=_0x1c5aba[_0xb9a4('0x3f')][_0xb9a4('0x40')]?_0x1c5aba[_0xb9a4('0x3f')]:_0x29e3d3[_0xb9a4('0x39')];if(!_0xeffbeb[_0xb9a4('0x3a')]['hasOwnProperty'](_0xb9a4('0x42'))){_0x1c5aba[_0xb9a4('0x43')]=qs[_0xb9a4('0x43')](_0xeffbeb[_0xb9a4('0x3a')][_0xb9a4('0x43')]);_0x1c5aba[_0xb9a4('0x21')]=qs[_0xb9a4('0x21')](_0xeffbeb[_0xb9a4('0x3a')]['offset']);}_0x1c5aba['order']=qs[_0xb9a4('0x45')](_0xeffbeb[_0xb9a4('0x3a')][_0xb9a4('0x45')]);_0x1c5aba[_0xb9a4('0x46')]=qs['filters'](_[_0xb9a4('0x47')](_0xeffbeb[_0xb9a4('0x3a')],_0x29e3d3['filters']));_0x1c5aba['where'][_0xb9a4('0x68')]=_0x2ed3ec['id'];if(_0xeffbeb[_0xb9a4('0x3a')][_0xb9a4('0x2d')]){_0x1c5aba[_0xb9a4('0x46')]=_[_0xb9a4('0x48')](_0x1c5aba[_0xb9a4('0x46')],{'$or':_[_0xb9a4('0x2e')](_0x1c5aba['attributes'],function(_0x47f488){var _0x123552={};_0x123552[_0x47f488]={'$like':'%'+_0xeffbeb['query'][_0xb9a4('0x2d')]+'%'};return _0x123552;})});}_0x1c5aba=_['merge']({},_0x1c5aba,_0xeffbeb['options']);return db['CmHopperFinal']['count']({'where':_0x1c5aba[_0xb9a4('0x46')]})[_0xb9a4('0x28')](function(_0x47e321){_0x4c9f8d[_0xb9a4('0x4a')]=_0x47e321;if(_0xeffbeb[_0xb9a4('0x3a')][_0xb9a4('0x4b')]){_0x1c5aba[_0xb9a4('0x4c')]=[{'all':!![]}];}return db[_0xb9a4('0x67')]['findAll'](_0x1c5aba);})[_0xb9a4('0x28')](function(_0x5a1760){_0x4c9f8d[_0xb9a4('0x62')]=_0x5a1760;return _0x4c9f8d;});}})[_0xb9a4('0x28')](respondWithFilteredResult(_0x3ddbd5,_0x1c5aba))[_0xb9a4('0x4e')](handleError(_0x3ddbd5,null));};exports[_0xb9a4('0x69')]=function(_0x854762,_0x22f417,_0x2fc51c){var _0x32382a={'raw':!![],'where':{}};var _0x1bce78={};var _0xd73b7a={'count':0x0,'rows':[]};return db[_0xb9a4('0x49')][_0xb9a4('0x64')]({'where':{'id':_0x854762[_0xb9a4('0x5e')]['id']}})['then'](handleEntityNotFound(_0x22f417,null))['then'](function(_0x163e33){if(_0x163e33){_0x1bce78['model']=_[_0xb9a4('0x3b')](db[_0xb9a4('0x6a')][_0xb9a4('0x50')]);_0x1bce78[_0xb9a4('0x3a')]=_[_0xb9a4('0x3b')](_0x854762[_0xb9a4('0x3a')]);_0x1bce78[_0xb9a4('0x3c')]=_[_0xb9a4('0x3d')](_0x1bce78[_0xb9a4('0x39')],_0x1bce78[_0xb9a4('0x3a')]);_0x32382a[_0xb9a4('0x3f')]=_['intersection'](_0x1bce78['model'],qs[_0xb9a4('0x3e')](_0x854762[_0xb9a4('0x3a')]['fields']));_0x32382a[_0xb9a4('0x3f')]=_0x32382a['attributes'][_0xb9a4('0x40')]?_0x32382a[_0xb9a4('0x3f')]:_0x1bce78[_0xb9a4('0x39')];if(!_0x854762[_0xb9a4('0x3a')][_0xb9a4('0x41')](_0xb9a4('0x42'))){_0x32382a[_0xb9a4('0x43')]=qs[_0xb9a4('0x43')](_0x854762[_0xb9a4('0x3a')]['limit']);_0x32382a['offset']=qs[_0xb9a4('0x21')](_0x854762[_0xb9a4('0x3a')][_0xb9a4('0x21')]);}_0x32382a['order']=qs[_0xb9a4('0x45')](_0x854762[_0xb9a4('0x3a')][_0xb9a4('0x45')]);_0x32382a['where']=qs[_0xb9a4('0x3c')](_[_0xb9a4('0x47')](_0x854762['query'],_0x1bce78['filters']));_0x32382a['where'][_0xb9a4('0x68')]=_0x163e33['id'];if(_0x854762[_0xb9a4('0x3a')][_0xb9a4('0x2d')]){_0x32382a[_0xb9a4('0x46')]=_[_0xb9a4('0x48')](_0x32382a[_0xb9a4('0x46')],{'$or':_[_0xb9a4('0x2e')](_0x32382a[_0xb9a4('0x3f')],function(_0x5df083){var _0x5f0631={};_0x5f0631[_0x5df083]={'$like':'%'+_0x854762[_0xb9a4('0x3a')][_0xb9a4('0x2d')]+'%'};return _0x5f0631;})});}_0x32382a=_[_0xb9a4('0x48')]({},_0x32382a,_0x854762['options']);return db[_0xb9a4('0x6a')][_0xb9a4('0x4a')]({'where':_0x32382a[_0xb9a4('0x46')]})['then'](function(_0x38b02d){_0xd73b7a[_0xb9a4('0x4a')]=_0x38b02d;if(_0x854762[_0xb9a4('0x3a')]['includeAll']){_0x32382a['include']=[{'all':!![]}];}return db[_0xb9a4('0x6a')]['findAll'](_0x32382a);})['then'](function(_0x1e7040){_0xd73b7a['rows']=_0x1e7040;return _0xd73b7a;});}})[_0xb9a4('0x28')](respondWithFilteredResult(_0x22f417,_0x32382a))[_0xb9a4('0x4e')](handleError(_0x22f417,null));};exports['getTeams']=function(_0x1c3d10,_0x394278,_0x220796){var _0x535a14={};var _0x1030a4={};var _0x38d81d;var _0x261d31;return db[_0xb9a4('0x49')][_0xb9a4('0x64')]({'where':{'id':_0x1c3d10[_0xb9a4('0x5e')]['id']}})[_0xb9a4('0x28')](handleEntityNotFound(_0x394278,null))[_0xb9a4('0x28')](function(_0x2355d8){if(_0x2355d8){_0x38d81d=_0x2355d8;_0x1030a4['model']=_['keys'](db['Team'][_0xb9a4('0x50')]);_0x1030a4['query']=_[_0xb9a4('0x3b')](_0x1c3d10['query']);_0x1030a4['filters']=_['intersection'](_0x1030a4[_0xb9a4('0x39')],_0x1030a4[_0xb9a4('0x3a')]);_0x535a14[_0xb9a4('0x3f')]=_[_0xb9a4('0x3d')](_0x1030a4[_0xb9a4('0x39')],qs[_0xb9a4('0x3e')](_0x1c3d10[_0xb9a4('0x3a')]['fields']));_0x535a14['attributes']=_0x535a14[_0xb9a4('0x3f')][_0xb9a4('0x40')]?_0x535a14[_0xb9a4('0x3f')]:_0x1030a4[_0xb9a4('0x39')];_0x535a14[_0xb9a4('0x44')]=qs['sort'](_0x1c3d10[_0xb9a4('0x3a')]['sort']);_0x535a14[_0xb9a4('0x46')]=qs[_0xb9a4('0x3c')](_['pick'](_0x1c3d10[_0xb9a4('0x3a')],_0x1030a4[_0xb9a4('0x3c')]));if(_0x1c3d10[_0xb9a4('0x3a')][_0xb9a4('0x2d')]){_0x535a14[_0xb9a4('0x46')]=_[_0xb9a4('0x48')](_0x535a14[_0xb9a4('0x46')],{'$or':_[_0xb9a4('0x2e')](_0x535a14[_0xb9a4('0x3f')],function(_0x328f01){var _0x42ed78={};_0x42ed78[_0x328f01]={'$like':'%'+_0x1c3d10[_0xb9a4('0x3a')][_0xb9a4('0x2d')]+'%'};return _0x42ed78;})});}_0x535a14=_[_0xb9a4('0x48')]({},_0x535a14,_0x1c3d10[_0xb9a4('0x51')]);return _0x38d81d[_0xb9a4('0x6b')](_0x535a14);}})[_0xb9a4('0x28')](function(_0x3eea3c){if(_0x3eea3c){_0x261d31=_0x3eea3c[_0xb9a4('0x40')];if(!_0x1c3d10[_0xb9a4('0x3a')][_0xb9a4('0x41')](_0xb9a4('0x42'))){_0x535a14[_0xb9a4('0x43')]=qs[_0xb9a4('0x43')](_0x1c3d10[_0xb9a4('0x3a')][_0xb9a4('0x43')]);_0x535a14['offset']=qs[_0xb9a4('0x21')](_0x1c3d10[_0xb9a4('0x3a')]['offset']);}return _0x38d81d['getTeams'](_0x535a14);}})[_0xb9a4('0x28')](function(_0x3570ad){if(_0x3570ad){return _0x3570ad?{'count':_0x261d31,'rows':_0x3570ad}:null;}})[_0xb9a4('0x28')](respondWithResult(_0x394278,null))[_0xb9a4('0x4e')](handleError(_0x394278,null));};exports[_0xb9a4('0x6c')]=function(_0x428eed,_0x387649,_0x20f660){var _0x5dc9c9=_0x428eed[_0xb9a4('0x54')][_0xb9a4('0x6d')];var _0x3e6a98=_[_0xb9a4('0x2e')](_0x5dc9c9,'id');return db['Team'][_0xb9a4('0x4d')]({'where':{'id':_0x3e6a98},'attributes':['id'],'include':[{'model':db[_0xb9a4('0x6e')],'as':_0xb9a4('0x6f'),'attributes':['id',_0xb9a4('0x32'),'online',_0xb9a4('0x70'),'interface'],'raw':!![]}]})[_0xb9a4('0x28')](function(_0x43e320){if(_0x43e320){var _0x40cf4a=_[_0xb9a4('0x71')](_0x43e320,function(_0x3be915){var _0x4e5cfe=_0x3be915[_0xb9a4('0x56')]({'plain':!![]});_0x4e5cfe[_0xb9a4('0x6f')][_0xb9a4('0x72')](function(_0x40177e){_0x40177e[_0xb9a4('0x73')]=_['find'](_0x5dc9c9,{'id':_0x4e5cfe['id']})[_0xb9a4('0x73')];});return _0x4e5cfe[_0xb9a4('0x6f')];});return db[_0xb9a4('0x49')][_0xb9a4('0x52')]({'where':{'id':_0x428eed[_0xb9a4('0x5e')]['id']}})[_0xb9a4('0x28')](function(_0x48915){return db['sequelize'][_0xb9a4('0x74')](function(_0x517b9a){return _0x48915[_0xb9a4('0x6c')](_0x3e6a98,{'transaction':_0x517b9a})[_0xb9a4('0x28')](function(){return BPromise['each'](_0x5dc9c9,function(_0x352e5a){return db[_0xb9a4('0x75')]['upsert']({'TeamId':_0x352e5a['id'],'VoiceQueueId':_0x428eed[_0xb9a4('0x5e')]['id'],'penalty':_0x352e5a[_0xb9a4('0x73')]},{'transaction':_0x517b9a});});})[_0xb9a4('0x28')](function(){return BPromise[_0xb9a4('0x76')](_0x40cf4a,function(_0x2b2f0b){return db['UserVoiceQueue'][_0xb9a4('0x77')]({'where':{'UserId':_0x2b2f0b['id'],'VoiceQueueId':_0x428eed[_0xb9a4('0x5e')]['id']},'defaults':{'penalty':_0x2b2f0b[_0xb9a4('0x73')]},'transaction':_0x517b9a});});})[_0xb9a4('0x28')](function(){return BPromise[_0xb9a4('0x76')](_[_0xb9a4('0x2d')](_0x40cf4a,{'online':!![]}),function(_0x36c6c2){return db['UserVoiceQueueRt']['upsert']({'membername':_0x36c6c2[_0xb9a4('0x32')],'UserId':_0x36c6c2['id'],'queue_name':_0x48915[_0xb9a4('0x32')],'VoiceQueueId':_0x48915['id'],'interface':_[_0xb9a4('0x78')](_0x36c6c2['interface'])?util[_0xb9a4('0x79')](_0xb9a4('0x7a'),_0x36c6c2['name']):_0x36c6c2[_0xb9a4('0x7b')],'paused':_0x36c6c2[_0xb9a4('0x70')]||![],'penalty':_0x36c6c2[_0xb9a4('0x73')]},{'transaction':_0x517b9a});});})['then'](function(){_0x40cf4a[_0xb9a4('0x72')](function(_0x220ca8){socket[_0xb9a4('0x7c')](_0xb9a4('0x7d'),{'UserId':_0x220ca8['id'],'VoiceQueueId':_0x48915['id']});});});});});}})['then'](respondWithStatusCode(_0x387649,null))[_0xb9a4('0x4e')](handleError(_0x387649,null));};exports[_0xb9a4('0x7e')]=function(_0x4f3ebf,_0x8dcf82,_0x5519e4){return db[_0xb9a4('0x7f')][_0xb9a4('0x4d')]({'where':{'id':_0x4f3ebf[_0xb9a4('0x3a')][_0xb9a4('0x80')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xb9a4('0x28')](handleEntityNotFound(_0x8dcf82,null))[_0xb9a4('0x28')](function(_0x56771c){var _0x2f92e7=_[_0xb9a4('0x2e')](_0x56771c,'id');var _0x3af2ba=[];var _0x55fb7e=[];var _0xb8c165=squel['select']();_0xb8c165[_0xb9a4('0x81')]('tq.TeamId')['from'](_0xb9a4('0x82'),'tq')[_0xb9a4('0x83')](_0xb9a4('0x84'),'ut',_0xb9a4('0x85'))['where']('VoiceQueueId\x20=\x20?',_0x4f3ebf[_0xb9a4('0x5e')]['id']);for(var _0xfc53f0=0x0;_0xfc53f0<_0x56771c[_0xb9a4('0x40')];_0xfc53f0+=0x1){let _0x139c3c=_0x56771c[_0xfc53f0];for(var _0x58f6ce=0x0;_0x58f6ce<_0x139c3c['Agents'][_0xb9a4('0x40')];_0x58f6ce+=0x1){let _0x10fcfd=_0x139c3c[_0xb9a4('0x6f')][_0x58f6ce];var _0x389a11=_0xb8c165[_0xb9a4('0x86')]();_0x389a11['where']('ut.UserId\x20=\x20?',_0x10fcfd['id']);_0x55fb7e['push'](db[_0xb9a4('0x87')][_0xb9a4('0x3a')](_0x389a11[_0xb9a4('0x88')](),{'type':db[_0xb9a4('0x87')][_0xb9a4('0x89')]['SELECT']})['then'](function(_0x409713){if(_0x409713[_0xb9a4('0x40')]===0x1){return _0x10fcfd['id'];}else{var _0x4b31e5=_[_0xb9a4('0x8a')](_[_0xb9a4('0x2e')](_0x409713,_0xb9a4('0x8b')),function(_0x16aab9){return _['includes'](_0x2f92e7,_0x16aab9);});if(_0x4b31e5){return _0x10fcfd['id'];}}}));}}return BPromise[_0xb9a4('0x8c')](_0x55fb7e)[_0xb9a4('0x28')](function(_0x1afb23){_0x3af2ba=_(_0x3af2ba)[_0xb9a4('0x8d')](_0x1afb23)[_0xb9a4('0x8e')]()[_0xb9a4('0x2f')]();return db[_0xb9a4('0x49')][_0xb9a4('0x52')]({'where':{'id':_0x4f3ebf[_0xb9a4('0x5e')]['id']}})[_0xb9a4('0x28')](function(_0x4e04fc){return db[_0xb9a4('0x87')][_0xb9a4('0x74')](function(_0x28c7c9){return _0x4e04fc[_0xb9a4('0x7e')](_0x4f3ebf['query'][_0xb9a4('0x80')],{'transaction':_0x28c7c9})[_0xb9a4('0x28')](function(){if(!_[_0xb9a4('0x8f')](_0x3af2ba)){return _0x4e04fc[_0xb9a4('0x90')](_0x3af2ba,{'transaction':_0x28c7c9})[_0xb9a4('0x28')](function(){return db[_0xb9a4('0x91')][_0xb9a4('0x29')]({'where':{'VoiceQueueId':_0x4f3ebf[_0xb9a4('0x5e')]['id'],'UserId':_0x3af2ba},'transaction':_0x28c7c9});});}})[_0xb9a4('0x28')](function(){_0x3af2ba['forEach'](function(_0x31ffb0){socket[_0xb9a4('0x7c')](_0xb9a4('0x92'),{'UserId':_0x31ffb0,'VoiceQueueId':_0x4e04fc['id']});});});});});});})[_0xb9a4('0x28')](respondWithStatusCode(_0x8dcf82,null))[_0xb9a4('0x4e')](handleError(_0x8dcf82,null));};exports[_0xb9a4('0x93')]=function(_0x184c4d,_0x5329df,_0x4307a0){var _0x3d8e8f,_0x37fad9;return db[_0xb9a4('0x49')][_0xb9a4('0x52')]({'where':{'id':_0x184c4d['params']['id']}})[_0xb9a4('0x28')](handleEntityNotFound(_0x5329df,null))[_0xb9a4('0x28')](function(_0x3873ce){if(_0x3873ce){_0x37fad9=_0x3873ce;return _0x3873ce[_0xb9a4('0x93')](_0x184c4d[_0xb9a4('0x54')][_0xb9a4('0x80')],_['omit'](_0x184c4d[_0xb9a4('0x54')],['ids','id'])||{})[_0xb9a4('0x94')](function(_0x56dac4){for(var _0x2c7408=0x0;_0x2c7408<_0x184c4d[_0xb9a4('0x54')][_0xb9a4('0x80')]['length'];_0x2c7408+=0x1){socket[_0xb9a4('0x7c')](_0xb9a4('0x7d'),{'UserId':Number(_0x184c4d['body'][_0xb9a4('0x80')][_0x2c7408]),'VoiceQueueId':Number(_0x184c4d['params']['id'])});}return _0x56dac4;});}})[_0xb9a4('0x28')](function(_0x3e5c2f){_0x3d8e8f=_0x3e5c2f||[];if(_0x37fad9){return db[_0xb9a4('0x6e')][_0xb9a4('0x4d')]({'where':{'id':_0x184c4d[_0xb9a4('0x54')][_0xb9a4('0x80')]},'attributes':['id','name',_0xb9a4('0x95'),_0xb9a4('0x70'),'interface'],'raw':!![]});}})[_0xb9a4('0x28')](function(_0xc4121d){if(!_[_0xb9a4('0x8f')](_0xc4121d)){var _0x46191a=[];for(var _0xe6ffb7=0x0;_0xe6ffb7<_0xc4121d[_0xb9a4('0x40')];_0xe6ffb7++){if(_0xc4121d[_0xe6ffb7][_0xb9a4('0x95')]){_0x46191a['push'](db[_0xb9a4('0x91')][_0xb9a4('0x96')]({'membername':_0xc4121d[_0xe6ffb7]['name'],'UserId':_0xc4121d[_0xe6ffb7]['id'],'queue_name':_0x37fad9[_0xb9a4('0x32')],'VoiceQueueId':_0x37fad9['id'],'interface':_[_0xb9a4('0x78')](_0xc4121d[_0xe6ffb7][_0xb9a4('0x7b')])?util[_0xb9a4('0x79')](_0xb9a4('0x7a'),_0xc4121d[_0xe6ffb7]['name']):_0xc4121d[_0xe6ffb7][_0xb9a4('0x7b')],'paused':_0xc4121d[_0xe6ffb7][_0xb9a4('0x70')]||![],'penalty':_0x184c4d['body'][_0xb9a4('0x73')]||0x0}));}}return BPromise[_0xb9a4('0x8c')](_0x46191a);}})['then'](function(){return _0x3d8e8f;})['then'](respondWithResult(_0x5329df,null))['catch'](handleError(_0x5329df,null));};exports[_0xb9a4('0x90')]=function(_0x15ff2a,_0x507685,_0x27a558){return db[_0xb9a4('0x49')][_0xb9a4('0x52')]({'where':{'id':_0x15ff2a[_0xb9a4('0x5e')]['id']}})[_0xb9a4('0x28')](handleEntityNotFound(_0x507685,null))[_0xb9a4('0x28')](function(_0x541d92){if(_0x541d92){return _0x541d92[_0xb9a4('0x90')](_0x15ff2a[_0xb9a4('0x3a')][_0xb9a4('0x80')])[_0xb9a4('0x28')](function(){if(_[_0xb9a4('0x97')](_0x15ff2a[_0xb9a4('0x3a')][_0xb9a4('0x80')])){for(var _0x58ec1f=0x0;_0x58ec1f<_0x15ff2a[_0xb9a4('0x3a')]['ids']['length'];_0x58ec1f+=0x1){socket['emit'](_0xb9a4('0x92'),{'UserId':Number(_0x15ff2a[_0xb9a4('0x3a')][_0xb9a4('0x80')][_0x58ec1f]),'VoiceQueueId':Number(_0x15ff2a[_0xb9a4('0x5e')]['id'])});}}else{socket[_0xb9a4('0x7c')](_0xb9a4('0x92'),{'UserId':Number(_0x15ff2a[_0xb9a4('0x3a')]['ids']),'VoiceQueueId':Number(_0x15ff2a[_0xb9a4('0x5e')]['id'])});}});}})[_0xb9a4('0x28')](function(_0x4b5413){return db[_0xb9a4('0x91')][_0xb9a4('0x29')]({'where':{'VoiceQueueId':_0x15ff2a[_0xb9a4('0x5e')]['id'],'UserId':_0x15ff2a[_0xb9a4('0x3a')][_0xb9a4('0x80')]}})['then'](function(){return _0x4b5413;});})['then'](respondWithStatusCode(_0x507685,null))[_0xb9a4('0x4e')](handleError(_0x507685,null));};exports[_0xb9a4('0x98')]=function(_0x15147e,_0x1783f9,_0x4b6067){var _0x2fdaf3={};var _0x567611={};var _0x5578bb;var _0x3bbe3d;return db['VoiceQueue'][_0xb9a4('0x64')]({'where':{'id':_0x15147e[_0xb9a4('0x5e')]['id']}})[_0xb9a4('0x28')](handleEntityNotFound(_0x1783f9,null))[_0xb9a4('0x28')](function(_0x394ce1){if(_0x394ce1){_0x5578bb=_0x394ce1;_0x567611['model']=_[_0xb9a4('0x3b')](db[_0xb9a4('0x6e')][_0xb9a4('0x50')]);_0x567611['query']=_['keys'](_0x15147e[_0xb9a4('0x3a')]);_0x567611[_0xb9a4('0x3c')]=_[_0xb9a4('0x3d')](_0x567611['model'],_0x567611[_0xb9a4('0x3a')]);_0x2fdaf3[_0xb9a4('0x3f')]=_['intersection'](_0x567611[_0xb9a4('0x39')],qs[_0xb9a4('0x3e')](_0x15147e[_0xb9a4('0x3a')][_0xb9a4('0x3e')]));_0x2fdaf3[_0xb9a4('0x3f')]=_0x2fdaf3[_0xb9a4('0x3f')][_0xb9a4('0x40')]?_0x2fdaf3[_0xb9a4('0x3f')]:_0x567611[_0xb9a4('0x39')];_0x2fdaf3[_0xb9a4('0x44')]=qs[_0xb9a4('0x45')](_0x15147e[_0xb9a4('0x3a')][_0xb9a4('0x45')]);_0x2fdaf3['where']=qs['filters'](_['pick'](_0x15147e[_0xb9a4('0x3a')],_0x567611[_0xb9a4('0x3c')]));if(_0x15147e[_0xb9a4('0x3a')]['filter']){_0x2fdaf3[_0xb9a4('0x46')]=_[_0xb9a4('0x48')](_0x2fdaf3[_0xb9a4('0x46')],{'$or':_[_0xb9a4('0x2e')](_0x2fdaf3['attributes'],function(_0x28a21d){var _0x29ee6c={};_0x29ee6c[_0x28a21d]={'$like':'%'+_0x15147e[_0xb9a4('0x3a')][_0xb9a4('0x2d')]+'%'};return _0x29ee6c;})});}_0x2fdaf3=_['merge']({},_0x2fdaf3,_0x15147e[_0xb9a4('0x51')]);return _0x5578bb[_0xb9a4('0x98')](_0x2fdaf3);}})['then'](function(_0x247141){if(_0x247141){_0x3bbe3d=_0x247141['length'];if(!_0x15147e[_0xb9a4('0x3a')]['hasOwnProperty'](_0xb9a4('0x42'))){_0x2fdaf3['limit']=qs[_0xb9a4('0x43')](_0x15147e[_0xb9a4('0x3a')]['limit']);_0x2fdaf3[_0xb9a4('0x21')]=qs[_0xb9a4('0x21')](_0x15147e[_0xb9a4('0x3a')][_0xb9a4('0x21')]);}return _0x5578bb[_0xb9a4('0x98')](_0x2fdaf3);}})['then'](function(_0x15ae62){if(_0x15ae62){return _0x15ae62?{'count':_0x3bbe3d,'rows':_0x15ae62}:null;}})['then'](respondWithResult(_0x1783f9,null))[_0xb9a4('0x4e')](handleError(_0x1783f9,null));};exports[_0xb9a4('0x99')]=function(_0x50cbeb,_0x13fef5,_0x535ce0){var _0x4ad7ba={};var _0x2d312b={};var _0x387da5;var _0x558c5f;return db[_0xb9a4('0x49')][_0xb9a4('0x64')]({'where':{'id':_0x50cbeb['params']['id']}})[_0xb9a4('0x28')](handleEntityNotFound(_0x13fef5,null))[_0xb9a4('0x28')](function(_0x41f7b9){if(_0x41f7b9){_0x387da5=_0x41f7b9;_0x2d312b[_0xb9a4('0x39')]=_[_0xb9a4('0x3b')](db[_0xb9a4('0x91')][_0xb9a4('0x50')]);_0x2d312b[_0xb9a4('0x3a')]=_[_0xb9a4('0x3b')](_0x50cbeb['query']);_0x2d312b['filters']=_[_0xb9a4('0x3d')](_0x2d312b['model'],_0x2d312b[_0xb9a4('0x3a')]);_0x4ad7ba[_0xb9a4('0x3f')]=_[_0xb9a4('0x3d')](_0x2d312b[_0xb9a4('0x39')],qs[_0xb9a4('0x3e')](_0x50cbeb[_0xb9a4('0x3a')][_0xb9a4('0x3e')]));_0x4ad7ba[_0xb9a4('0x3f')]=_0x4ad7ba[_0xb9a4('0x3f')][_0xb9a4('0x40')]?_0x4ad7ba[_0xb9a4('0x3f')]:_0x2d312b['model'];_0x4ad7ba[_0xb9a4('0x44')]=qs[_0xb9a4('0x45')](_0x50cbeb[_0xb9a4('0x3a')][_0xb9a4('0x45')]);_0x4ad7ba[_0xb9a4('0x46')]=qs[_0xb9a4('0x3c')](_[_0xb9a4('0x47')](_0x50cbeb[_0xb9a4('0x3a')],_0x2d312b[_0xb9a4('0x3c')]));if(_0x50cbeb['query'][_0xb9a4('0x2d')]){_0x4ad7ba[_0xb9a4('0x46')]=_[_0xb9a4('0x48')](_0x4ad7ba[_0xb9a4('0x46')],{'$or':_[_0xb9a4('0x2e')](_0x4ad7ba[_0xb9a4('0x3f')],function(_0xba7d30){var _0x455b13={};_0x455b13[_0xba7d30]={'$like':'%'+_0x50cbeb[_0xb9a4('0x3a')][_0xb9a4('0x2d')]+'%'};return _0x455b13;})});}_0x4ad7ba=_[_0xb9a4('0x48')]({},_0x4ad7ba,_0x50cbeb[_0xb9a4('0x51')]);return _0x387da5[_0xb9a4('0x99')](_0x4ad7ba);}})[_0xb9a4('0x28')](function(_0x39448d){if(_0x39448d){_0x558c5f=_0x39448d[_0xb9a4('0x40')];if(!_0x50cbeb[_0xb9a4('0x3a')][_0xb9a4('0x41')](_0xb9a4('0x42'))){_0x4ad7ba[_0xb9a4('0x43')]=qs['limit'](_0x50cbeb[_0xb9a4('0x3a')][_0xb9a4('0x43')]);_0x4ad7ba[_0xb9a4('0x21')]=qs['offset'](_0x50cbeb[_0xb9a4('0x3a')][_0xb9a4('0x21')]);}return _0x387da5['getMembers'](_0x4ad7ba);}})[_0xb9a4('0x28')](function(_0x57a85e){return _0x57a85e?{'count':_0x558c5f,'rows':_0x57a85e}:null;})[_0xb9a4('0x28')](respondWithResult(_0x13fef5,null))['catch'](handleError(_0x13fef5,null));};exports[_0xb9a4('0x9a')]=function(_0x269d6b,_0x1e48dc,_0x55b4ef){var _0x1f9670={};var _0x18f972={};var _0x1fde2e;var _0x452300;return db['VoiceQueue'][_0xb9a4('0x64')]({'where':{'id':_0x269d6b[_0xb9a4('0x5e')]['id']}})[_0xb9a4('0x28')](handleEntityNotFound(_0x1e48dc,null))['then'](function(_0x5ecb35){if(_0x5ecb35){_0x1fde2e=_0x5ecb35;_0x18f972[_0xb9a4('0x39')]=_[_0xb9a4('0x3b')](db[_0xb9a4('0x9b')]['rawAttributes']);_0x18f972['query']=_[_0xb9a4('0x3b')](_0x269d6b[_0xb9a4('0x3a')]);_0x18f972['filters']=_[_0xb9a4('0x3d')](_0x18f972['model'],_0x18f972[_0xb9a4('0x3a')]);_0x1f9670[_0xb9a4('0x3f')]=_[_0xb9a4('0x3d')](_0x18f972[_0xb9a4('0x39')],qs[_0xb9a4('0x3e')](_0x269d6b[_0xb9a4('0x3a')]['fields']));_0x1f9670['attributes']=_0x1f9670[_0xb9a4('0x3f')][_0xb9a4('0x40')]?_0x1f9670[_0xb9a4('0x3f')]:_0x18f972[_0xb9a4('0x39')];_0x1f9670['order']=qs[_0xb9a4('0x45')](_0x269d6b[_0xb9a4('0x3a')]['sort']);_0x1f9670[_0xb9a4('0x46')]=qs[_0xb9a4('0x3c')](_[_0xb9a4('0x47')](_0x269d6b[_0xb9a4('0x3a')],_0x18f972['filters']));if(_0x269d6b['query']['filter']){_0x1f9670['where']=_['merge'](_0x1f9670['where'],{'$or':_[_0xb9a4('0x2e')](_0x1f9670[_0xb9a4('0x3f')],function(_0x5370e5){var _0x50279a={};_0x50279a[_0x5370e5]={'$like':'%'+_0x269d6b[_0xb9a4('0x3a')][_0xb9a4('0x2d')]+'%'};return _0x50279a;})});}_0x1f9670=_[_0xb9a4('0x48')]({},_0x1f9670,_0x269d6b[_0xb9a4('0x51')]);return _0x1fde2e[_0xb9a4('0x9a')](_0x1f9670);}})[_0xb9a4('0x28')](function(_0x861eeb){if(_0x861eeb){_0x452300=_0x861eeb['length'];if(!_0x269d6b[_0xb9a4('0x3a')][_0xb9a4('0x41')](_0xb9a4('0x42'))){_0x1f9670[_0xb9a4('0x43')]=qs[_0xb9a4('0x43')](_0x269d6b[_0xb9a4('0x3a')][_0xb9a4('0x43')]);_0x1f9670[_0xb9a4('0x21')]=qs[_0xb9a4('0x21')](_0x269d6b[_0xb9a4('0x3a')][_0xb9a4('0x21')]);}return _0x1fde2e[_0xb9a4('0x9a')](_0x1f9670);}})[_0xb9a4('0x28')](function(_0x13b3d9){if(_0x13b3d9){return _0x13b3d9?{'count':_0x452300,'rows':_0x13b3d9}:null;}})[_0xb9a4('0x28')](respondWithResult(_0x1e48dc,null))[_0xb9a4('0x4e')](handleError(_0x1e48dc,null));};exports[_0xb9a4('0x9c')]=function(_0x3a24ad,_0x4727e4,_0x5d30c9){var _0x5b2c52,_0x5b5f48;return db[_0xb9a4('0x49')][_0xb9a4('0x52')]({'where':{'id':_0x3a24ad[_0xb9a4('0x5e')]['id']}})[_0xb9a4('0x28')](handleEntityNotFound(_0x4727e4,null))[_0xb9a4('0x28')](function(_0x36e050){if(_0x36e050){_0x5b5f48=_0x36e050;return _0x36e050[_0xb9a4('0x9c')](_0x3a24ad[_0xb9a4('0x54')][_0xb9a4('0x80')],_[_0xb9a4('0x5f')](_0x3a24ad[_0xb9a4('0x54')],[_0xb9a4('0x80'),'id'])||{});}return null;})['spread'](function(_0x4cf166){var _0x561587;_0x5b2c52=_0x4cf166||[];var _0x267d56=[];if(_0x4cf166){for(var _0x2bcdb4=0x0;_0x2bcdb4<_0x4cf166['length'];_0x2bcdb4+=0x1){var _0x3edbde=_0x4cf166[_0x2bcdb4][_0xb9a4('0x56')]({'plain':!![]});_0x5b5f48['dialCheckDuplicateType']=_0x3a24ad[_0xb9a4('0x54')][_0xb9a4('0x9d')]?_0x3a24ad[_0xb9a4('0x54')][_0xb9a4('0x9d')]:_0x5b5f48['dialCheckDuplicateType'];switch(_0x5b5f48['dialCheckDuplicateType']){case _0xb9a4('0x9e'):_0x561587=squel[_0xb9a4('0x9f')]()[_0xb9a4('0xa0')]('cm_hopper')[_0xb9a4('0xa1')](['phone','scheduledAt',_0xb9a4('0xa2'),_0xb9a4('0xa3'),_0xb9a4('0x68'),'createdAt',_0xb9a4('0xa4')],squel[_0xb9a4('0xa5')]()['field'](_0xb9a4('0xa6'),_0xb9a4('0xa6'))[_0xb9a4('0x81')](_0xb9a4('0xa7'),'scheduledAt')[_0xb9a4('0x81')]('id',_0xb9a4('0xa2'))[_0xb9a4('0x81')](_0x3edbde[_0xb9a4('0xa8')][_0xb9a4('0x88')](),_0xb9a4('0xa3'))['field'](_0x3a24ad['params']['id'][_0xb9a4('0x88')](),_0xb9a4('0x68'))[_0xb9a4('0x81')]('NOW()',_0xb9a4('0x60'))[_0xb9a4('0x81')](_0xb9a4('0xa7'),_0xb9a4('0xa4'))[_0xb9a4('0xa9')]('cm_contacts')[_0xb9a4('0x46')](_0xb9a4('0xaa'))[_0xb9a4('0x46')](_0xb9a4('0xab'),_0x3edbde[_0xb9a4('0xa8')]['toString']())[_0xb9a4('0x46')](_0xb9a4('0xac'))[_0xb9a4('0x46')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xb9a4('0x81')]('COALESCE(calleridnum,\x27\x27)')[_0xb9a4('0xa9')](_0xb9a4('0xad'))['where'](_0xb9a4('0xae'),_0x3a24ad['params']['id'][_0xb9a4('0x88')]()))['where'](_0xb9a4('0xaf'),squel[_0xb9a4('0xa5')]()[_0xb9a4('0x81')](_0xb9a4('0xb0'))[_0xb9a4('0xa9')](_0xb9a4('0xb1'))['where'](_0xb9a4('0xae'),_0x3a24ad[_0xb9a4('0x5e')]['id'][_0xb9a4('0x88')]())))[_0xb9a4('0x88')]();break;case _0xb9a4('0xb2'):_0x561587=squel[_0xb9a4('0x9f')]()['into'](_0xb9a4('0xb1'))[_0xb9a4('0xa1')]([_0xb9a4('0xa6'),_0xb9a4('0xb3'),_0xb9a4('0xa2'),_0xb9a4('0xa3'),_0xb9a4('0x68'),_0xb9a4('0x60'),'updatedAt'],squel[_0xb9a4('0xa5')]()[_0xb9a4('0x81')]('phone',_0xb9a4('0xa6'))['field'](_0xb9a4('0xa7'),_0xb9a4('0xb3'))['field']('id',_0xb9a4('0xa2'))[_0xb9a4('0x81')](_0x3edbde[_0xb9a4('0xa8')][_0xb9a4('0x88')](),_0xb9a4('0xa3'))[_0xb9a4('0x81')](_0x3a24ad[_0xb9a4('0x5e')]['id'][_0xb9a4('0x88')](),_0xb9a4('0x68'))[_0xb9a4('0x81')](_0xb9a4('0xa7'),_0xb9a4('0x60'))['field'](_0xb9a4('0xa7'),_0xb9a4('0xa4'))[_0xb9a4('0xa9')](_0xb9a4('0xb4'))['where']('deletedAt\x20IS\x20NULL')[_0xb9a4('0x46')]('ListId\x20=\x20?',_0x3edbde['CmListId']['toString']())[_0xb9a4('0x46')]('phone\x20IS\x20NOT\x20NULL')[_0xb9a4('0x46')](_0xb9a4('0xaf'),squel[_0xb9a4('0xa5')]()[_0xb9a4('0x81')](_0xb9a4('0xb0'))['from'](_0xb9a4('0xb1'))[_0xb9a4('0x46')](_0xb9a4('0xae'),_0x3a24ad[_0xb9a4('0x5e')]['id'][_0xb9a4('0x88')]())))['toString']();break;default:_0x561587=squel['insert']()[_0xb9a4('0xa0')](_0xb9a4('0xb1'))[_0xb9a4('0xa1')](['phone',_0xb9a4('0xb3'),_0xb9a4('0xa2'),_0xb9a4('0xa3'),'VoiceQueueId',_0xb9a4('0x60'),'updatedAt'],squel[_0xb9a4('0xa5')]()['field']('phone',_0xb9a4('0xa6'))['field']('NOW()','scheduledAt')['field']('id',_0xb9a4('0xa2'))['field'](_0x3edbde[_0xb9a4('0xa8')][_0xb9a4('0x88')](),_0xb9a4('0xa3'))[_0xb9a4('0x81')](_0x3a24ad[_0xb9a4('0x5e')]['id'][_0xb9a4('0x88')](),_0xb9a4('0x68'))[_0xb9a4('0x81')](_0xb9a4('0xa7'),'createdAt')[_0xb9a4('0x81')](_0xb9a4('0xa7'),'updatedAt')[_0xb9a4('0xa9')](_0xb9a4('0xb4'))[_0xb9a4('0x46')](_0xb9a4('0xaa'))['where'](_0xb9a4('0xab'),_0x3edbde[_0xb9a4('0xa8')][_0xb9a4('0x88')]())[_0xb9a4('0x46')](_0xb9a4('0xac')))[_0xb9a4('0x88')]();}_0x267d56['push'](db[_0xb9a4('0x87')]['query'](_0x561587));}return BPromise['all'](_0x267d56);}})[_0xb9a4('0x28')](function(){return _0x5b2c52;})[_0xb9a4('0x28')](respondWithResult(_0x4727e4,null))[_0xb9a4('0x4e')](handleError(_0x4727e4,null));};exports['removeLists']=function(_0x444219,_0x5f355d,_0x21d70c){return db[_0xb9a4('0x49')][_0xb9a4('0x52')]({'where':{'id':_0x444219[_0xb9a4('0x5e')]['id']}})[_0xb9a4('0x28')](handleEntityNotFound(_0x5f355d,null))[_0xb9a4('0x28')](function(_0x415229){if(_0x415229){return _0x415229[_0xb9a4('0xb5')](_0x444219[_0xb9a4('0x3a')][_0xb9a4('0x80')]);}})[_0xb9a4('0x28')](function(_0x593347){if(_0x593347){return db[_0xb9a4('0x61')][_0xb9a4('0x29')]({'where':{'ListId':_0x444219[_0xb9a4('0x3a')][_0xb9a4('0x80')],'VoiceQueueId':_0x444219[_0xb9a4('0x5e')]['id']}})['then'](function(){return _0x593347;});}})[_0xb9a4('0x28')](respondWithStatusCode(_0x5f355d,null))['catch'](handleError(_0x5f355d,null));};exports[_0xb9a4('0xb6')]=function(_0x10dcf2,_0x449491,_0x12304b){var _0x6b3e9={};var _0x5ebcb6={};var _0xe587f4;var _0x77156a;return db[_0xb9a4('0x49')][_0xb9a4('0x64')]({'where':{'id':_0x10dcf2[_0xb9a4('0x5e')]['id']}})['then'](handleEntityNotFound(_0x449491,null))[_0xb9a4('0x28')](function(_0x200604){if(_0x200604){_0xe587f4=_0x200604;_0x5ebcb6[_0xb9a4('0x39')]=_[_0xb9a4('0x3b')](db[_0xb9a4('0x9b')][_0xb9a4('0x50')]);_0x5ebcb6['query']=_['keys'](_0x10dcf2[_0xb9a4('0x3a')]);_0x5ebcb6[_0xb9a4('0x3c')]=_[_0xb9a4('0x3d')](_0x5ebcb6['model'],_0x5ebcb6[_0xb9a4('0x3a')]);_0x6b3e9[_0xb9a4('0x3f')]=_[_0xb9a4('0x3d')](_0x5ebcb6[_0xb9a4('0x39')],qs[_0xb9a4('0x3e')](_0x10dcf2[_0xb9a4('0x3a')][_0xb9a4('0x3e')]));_0x6b3e9[_0xb9a4('0x3f')]=_0x6b3e9[_0xb9a4('0x3f')][_0xb9a4('0x40')]?_0x6b3e9[_0xb9a4('0x3f')]:_0x5ebcb6[_0xb9a4('0x39')];_0x6b3e9[_0xb9a4('0x44')]=qs[_0xb9a4('0x45')](_0x10dcf2[_0xb9a4('0x3a')][_0xb9a4('0x45')]);_0x6b3e9[_0xb9a4('0x46')]=qs[_0xb9a4('0x3c')](_[_0xb9a4('0x47')](_0x10dcf2[_0xb9a4('0x3a')],_0x5ebcb6[_0xb9a4('0x3c')]));if(_0x10dcf2[_0xb9a4('0x3a')][_0xb9a4('0x2d')]){_0x6b3e9[_0xb9a4('0x46')]=_[_0xb9a4('0x48')](_0x6b3e9[_0xb9a4('0x46')],{'$or':_[_0xb9a4('0x2e')](_0x6b3e9[_0xb9a4('0x3f')],function(_0x1b2c38){var _0x4dd3a9={};_0x4dd3a9[_0x1b2c38]={'$like':'%'+_0x10dcf2[_0xb9a4('0x3a')]['filter']+'%'};return _0x4dd3a9;})});}_0x6b3e9=_[_0xb9a4('0x48')]({},_0x6b3e9,_0x10dcf2['options']);return _0xe587f4[_0xb9a4('0xb6')](_0x6b3e9);}})[_0xb9a4('0x28')](function(_0x5585ff){if(_0x5585ff){_0x77156a=_0x5585ff[_0xb9a4('0x40')];if(!_0x10dcf2[_0xb9a4('0x3a')]['hasOwnProperty'](_0xb9a4('0x42'))){_0x6b3e9[_0xb9a4('0x43')]=qs[_0xb9a4('0x43')](_0x10dcf2[_0xb9a4('0x3a')][_0xb9a4('0x43')]);_0x6b3e9[_0xb9a4('0x21')]=qs[_0xb9a4('0x21')](_0x10dcf2[_0xb9a4('0x3a')][_0xb9a4('0x21')]);}return _0xe587f4[_0xb9a4('0xb6')](_0x6b3e9);}})['then'](function(_0x1a877c){if(_0x1a877c){return _0x1a877c?{'count':_0x77156a,'rows':_0x1a877c}:null;}})[_0xb9a4('0x28')](respondWithResult(_0x449491,null))[_0xb9a4('0x4e')](handleError(_0x449491,null));};exports['addBlackLists']=function(_0x14bd40,_0x352985,_0x2d0360){var _0x370cbe,_0x5062db;return db[_0xb9a4('0x49')]['find']({'where':{'id':_0x14bd40[_0xb9a4('0x5e')]['id']}})[_0xb9a4('0x28')](handleEntityNotFound(_0x352985,null))[_0xb9a4('0x28')](function(_0x48dff2){if(_0x48dff2){_0x5062db=_0x48dff2;return _0x48dff2[_0xb9a4('0xb7')](_0x14bd40[_0xb9a4('0x54')][_0xb9a4('0x80')],_['omit'](_0x14bd40[_0xb9a4('0x54')],['ids','id'])||{});}return null;})[_0xb9a4('0x94')](function(_0x17aca8){var _0x33b5f9;_0x370cbe=_0x17aca8||[];var _0x52683a=[];if(_0x17aca8){for(var _0x59239d=0x0;_0x59239d<_0x17aca8[_0xb9a4('0x40')];_0x59239d+=0x1){var _0x5c6d1a=_0x17aca8[_0x59239d][_0xb9a4('0x56')]({'plain':!![]});_0x33b5f9=squel[_0xb9a4('0x9f')]()[_0xb9a4('0xa0')](_0xb9a4('0xb8'))['fromQuery'](['phone',_0xb9a4('0xa2'),_0xb9a4('0xa3'),_0xb9a4('0x68'),_0xb9a4('0x60'),_0xb9a4('0xa4')],squel['select']()[_0xb9a4('0x81')](_0xb9a4('0xa6'),_0xb9a4('0xa6'))['field']('id',_0xb9a4('0xa2'))['field'](_0x5c6d1a[_0xb9a4('0xa8')]['toString'](),'ListId')[_0xb9a4('0x81')](_0x14bd40[_0xb9a4('0x5e')]['id']['toString'](),_0xb9a4('0x68'))['field'](_0xb9a4('0xa7'),_0xb9a4('0x60'))['field'](_0xb9a4('0xa7'),_0xb9a4('0xa4'))[_0xb9a4('0xa9')](_0xb9a4('0xb4'))[_0xb9a4('0x46')](_0xb9a4('0xaa'))[_0xb9a4('0x46')](_0xb9a4('0xab'),_0x5c6d1a[_0xb9a4('0xa8')]['toString']())[_0xb9a4('0x46')](_0xb9a4('0xac')))['toString']();_0x52683a[_0xb9a4('0xb9')](db[_0xb9a4('0x87')][_0xb9a4('0x3a')](_0x33b5f9));}return BPromise[_0xb9a4('0x8c')](_0x52683a);}})[_0xb9a4('0x28')](function(){return _0x370cbe;})[_0xb9a4('0x28')](respondWithResult(_0x352985,null))[_0xb9a4('0x4e')](handleError(_0x352985,null));};exports[_0xb9a4('0xba')]=function(_0x3060da,_0x51735e,_0xe1cf8e){return db[_0xb9a4('0x49')][_0xb9a4('0x52')]({'where':{'id':_0x3060da[_0xb9a4('0x5e')]['id']}})['then'](handleEntityNotFound(_0x51735e,null))[_0xb9a4('0x28')](function(_0x58adb6){if(_0x58adb6){return _0x58adb6[_0xb9a4('0xba')](_0x3060da[_0xb9a4('0x3a')][_0xb9a4('0x80')]);}})[_0xb9a4('0x28')](function(_0x18e4b1){if(_0x18e4b1){return db[_0xb9a4('0x6a')][_0xb9a4('0x29')]({'where':{'ListId':_0x3060da[_0xb9a4('0x3a')][_0xb9a4('0x80')],'VoiceQueueId':_0x3060da[_0xb9a4('0x5e')]['id']}})[_0xb9a4('0x28')](function(){return _0x18e4b1;});}})[_0xb9a4('0x28')](respondWithStatusCode(_0x51735e,null))[_0xb9a4('0x4e')](handleError(_0x51735e,null));};
\ No newline at end of file
index 8d97bf5..8bb2775 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x558e=['emit','hasOwnProperty','exports','events','../../mysqldb','VoiceQueue','setMaxListeners','update','remove'];(function(_0x36c9a0,_0xebf19b){var _0x130b73=function(_0x466efa){while(--_0x466efa){_0x36c9a0['push'](_0x36c9a0['shift']());}};_0x130b73(++_0xebf19b);}(_0x558e,0x123));var _0xe558=function(_0x29aefc,_0x4dcf53){_0x29aefc=_0x29aefc-0x0;var _0x11be36=_0x558e[_0x29aefc];return _0x11be36;};'use strict';var EventEmitter=require(_0xe558('0x0'));var VoiceQueue=require(_0xe558('0x1'))['db'][_0xe558('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xe558('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe558('0x4'),'afterDestroy':_0xe558('0x5')};function emitEvent(_0x59d151){return function(_0x34ddd6,_0x39c88b,_0x3b85f3){VoiceQueueEvents[_0xe558('0x6')](_0x59d151+':'+_0x34ddd6['id'],_0x34ddd6);VoiceQueueEvents['emit'](_0x59d151,_0x34ddd6);_0x3b85f3(null);};}for(var e in events){if(events[_0xe558('0x7')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xe558('0x8')]=VoiceQueueEvents;
\ No newline at end of file
+var _0xffa3=['events','../../mysqldb','VoiceQueue','setMaxListeners','save','emit','hook'];(function(_0x5e9a69,_0x40c0ec){var _0x5979c8=function(_0x293da2){while(--_0x293da2){_0x5e9a69['push'](_0x5e9a69['shift']());}};_0x5979c8(++_0x40c0ec);}(_0xffa3,0x181));var _0x3ffa=function(_0x2fdc13,_0x34db81){_0x2fdc13=_0x2fdc13-0x0;var _0x11302f=_0xffa3[_0x2fdc13];return _0x11302f;};'use strict';var EventEmitter=require(_0x3ffa('0x0'));var VoiceQueue=require(_0x3ffa('0x1'))['db'][_0x3ffa('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x3ffa('0x3')](0x0);var events={'afterCreate':_0x3ffa('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x219e5d){return function(_0x3cb1f3,_0x3bbc4b,_0x51dbee){VoiceQueueEvents[_0x3ffa('0x5')](_0x219e5d+':'+_0x3cb1f3['id'],_0x3cb1f3);VoiceQueueEvents[_0x3ffa('0x5')](_0x219e5d,_0x3cb1f3);_0x51dbee(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x3ffa('0x6')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents;
\ No newline at end of file
index 594a9b1..cb88198 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e74=['exports','VoiceQueue','voice_queues','lodash','../../config/logger','api','moment','path','../../config/environment','./voiceQueue.attributes'];(function(_0x5d792b,_0x4a41de){var _0x219de9=function(_0x2e27b8){while(--_0x2e27b8){_0x5d792b['push'](_0x5d792b['shift']());}};_0x219de9(++_0x4a41de);}(_0x3e74,0x175));var _0x43e7=function(_0x318100,_0x167905){_0x318100=_0x318100-0x0;var _0x38fe9c=_0x3e74[_0x318100];return _0x38fe9c;};'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
+var _0xa9e0=['../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x2d6920,_0x3d1634){var _0xca1a0=function(_0x342488){while(--_0x342488){_0x2d6920['push'](_0x2d6920['shift']());}};_0xca1a0(++_0x3d1634);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a9c0bb1..5a07a7c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86c5=['request\x20sent','debug','stringify','error','code','VoiceQueue,\x20%s,\x20%s','message','result','GetVoiceQueue','VoiceQueue','options','raw','where','attributes','limit','include','map','model','info','catch','ShowVoiceQueue','find','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','localhost','./voiceQueue.socket','register','then'];(function(_0x35f00d,_0x207f5f){var _0xd6ea5f=function(_0xb4f1d2){while(--_0xb4f1d2){_0x35f00d['push'](_0x35f00d['shift']());}};_0xd6ea5f(++_0x207f5f);}(_0x86c5,0x163));var _0x586c=function(_0x6d688f,_0x221677){_0x6d688f=_0x6d688f-0x0;var _0x154666=_0x86c5[_0x6d688f];return _0x154666;};'use strict';var _=require(_0x586c('0x0'));var util=require(_0x586c('0x1'));var moment=require('moment');var BPromise=require(_0x586c('0x2'));var rs=require(_0x586c('0x3'));var fs=require('fs');var Redis=require(_0x586c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x586c('0x5'));var logger=require('../../config/logger')(_0x586c('0x6'));var config=require(_0x586c('0x7'));var jayson=require(_0x586c('0x8'));var client=jayson['client'][_0x586c('0x9')]({'port':0x232a});config[_0x586c('0xa')]=_['defaults'](config[_0x586c('0xa')],{'host':_0x586c('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x586c('0xa')]));require(_0x586c('0xc'))[_0x586c('0xd')](socket);function respondWithRpcPromise(_0xf46531,_0x82683f,_0x5462f5){return new BPromise(function(_0x58a526,_0x50ad36){return client['request'](_0xf46531,_0x5462f5)[_0x586c('0xe')](function(_0x1509a7){logger['info']('VoiceQueue,\x20%s,\x20%s',_0x82683f,_0x586c('0xf'));logger[_0x586c('0x10')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x82683f,_0x586c('0xf'),JSON[_0x586c('0x11')](_0x1509a7));if(_0x1509a7[_0x586c('0x12')]){if(_0x1509a7[_0x586c('0x12')][_0x586c('0x13')]===0x1f4){logger['error'](_0x586c('0x14'),_0x82683f,_0x1509a7[_0x586c('0x12')][_0x586c('0x15')]);return _0x50ad36(_0x1509a7[_0x586c('0x12')][_0x586c('0x15')]);}logger[_0x586c('0x12')]('VoiceQueue,\x20%s,\x20%s',_0x82683f,_0x1509a7[_0x586c('0x12')][_0x586c('0x15')]);return _0x58a526(_0x1509a7['error']['message']);}else{logger['info'](_0x586c('0x14'),_0x82683f,'request\x20sent');_0x58a526(_0x1509a7[_0x586c('0x16')]['message']);}})['catch'](function(_0x43e1d7){logger[_0x586c('0x12')](_0x586c('0x14'),_0x82683f,_0x43e1d7);_0x50ad36(_0x43e1d7);});});}exports[_0x586c('0x17')]=function(_0x3c7f7f){var _0x490513=this;return new Promise(function(_0x697001,_0x1d3f3e){return db[_0x586c('0x18')]['findAll']({'raw':_0x3c7f7f[_0x586c('0x19')]?_0x3c7f7f['options'][_0x586c('0x1a')]===undefined?!![]:![]:!![],'where':_0x3c7f7f[_0x586c('0x19')]?_0x3c7f7f[_0x586c('0x19')][_0x586c('0x1b')]||null:null,'attributes':_0x3c7f7f[_0x586c('0x19')]?_0x3c7f7f['options'][_0x586c('0x1c')]||null:null,'limit':_0x3c7f7f[_0x586c('0x19')]?_0x3c7f7f[_0x586c('0x19')][_0x586c('0x1d')]||null:null,'include':_0x3c7f7f[_0x586c('0x19')]?_0x3c7f7f[_0x586c('0x19')][_0x586c('0x1e')]?_[_0x586c('0x1f')](_0x3c7f7f[_0x586c('0x19')]['include'],function(_0x3eac62){return{'model':db[_0x3eac62[_0x586c('0x20')]],'as':_0x3eac62['as'],'attributes':_0x3eac62[_0x586c('0x1c')],'include':_0x3eac62[_0x586c('0x1e')]?_['map'](_0x3eac62[_0x586c('0x1e')],function(_0x1308c3){return{'model':db[_0x1308c3['model']],'as':_0x1308c3['as'],'attributes':_0x1308c3[_0x586c('0x1c')],'include':_0x1308c3[_0x586c('0x1e')]?_[_0x586c('0x1f')](_0x1308c3['include'],function(_0x23c985){return{'model':db[_0x23c985[_0x586c('0x20')]],'as':_0x23c985['as'],'attributes':_0x23c985[_0x586c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x586c('0xe')](function(_0x2d30ef){logger[_0x586c('0x21')](_0x586c('0x17'),_0x3c7f7f);logger[_0x586c('0x10')](_0x586c('0x17'),_0x3c7f7f,JSON['stringify'](_0x2d30ef));_0x697001(_0x2d30ef);})[_0x586c('0x22')](function(_0x46083f){logger[_0x586c('0x12')](_0x586c('0x17'),_0x46083f[_0x586c('0x15')],_0x3c7f7f);_0x1d3f3e(_0x490513[_0x586c('0x12')](0x1f4,_0x46083f['message']));});});};exports[_0x586c('0x23')]=function(_0x4e3664){var _0x1e54eb=this;return new Promise(function(_0x3da634,_0x1122e9){return db[_0x586c('0x18')][_0x586c('0x24')]({'raw':_0x4e3664[_0x586c('0x19')]?_0x4e3664[_0x586c('0x19')][_0x586c('0x1a')]===undefined?!![]:![]:!![],'where':_0x4e3664[_0x586c('0x19')]?_0x4e3664['options'][_0x586c('0x1b')]||null:null,'attributes':_0x4e3664[_0x586c('0x19')]?_0x4e3664[_0x586c('0x19')][_0x586c('0x1c')]||null:null,'include':_0x4e3664['options']?_0x4e3664[_0x586c('0x19')]['include']?_[_0x586c('0x1f')](_0x4e3664['options'][_0x586c('0x1e')],function(_0x388af7){return{'model':db[_0x388af7[_0x586c('0x20')]],'as':_0x388af7['as'],'attributes':_0x388af7['attributes'],'include':_0x388af7[_0x586c('0x1e')]?_[_0x586c('0x1f')](_0x388af7[_0x586c('0x1e')],function(_0x3cbd81){return{'model':db[_0x3cbd81[_0x586c('0x20')]],'as':_0x3cbd81['as'],'attributes':_0x3cbd81[_0x586c('0x1c')],'include':_0x3cbd81[_0x586c('0x1e')]?_[_0x586c('0x1f')](_0x3cbd81[_0x586c('0x1e')],function(_0x367834){return{'model':db[_0x367834[_0x586c('0x20')]],'as':_0x367834['as'],'attributes':_0x367834[_0x586c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x586c('0xe')](function(_0x498cee){logger[_0x586c('0x21')]('ShowVoiceQueue',_0x4e3664);logger[_0x586c('0x10')](_0x586c('0x23'),_0x4e3664,JSON[_0x586c('0x11')](_0x498cee));_0x3da634(_0x498cee);})['catch'](function(_0x169f07){logger[_0x586c('0x12')](_0x586c('0x23'),_0x169f07[_0x586c('0x15')],_0x4e3664);_0x1122e9(_0x1e54eb[_0x586c('0x12')](0x1f4,_0x169f07[_0x586c('0x15')]));});});};
\ No newline at end of file
+var _0x2062=['VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','VoiceQueue','options','raw','attributes','limit','include','map','model','then','GetVoiceQueue','ShowVoiceQueue','find','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','./voiceQueue.socket','register','info'];(function(_0x13346b,_0x2ae741){var _0x1a6a9e=function(_0x2b48e1){while(--_0x2b48e1){_0x13346b['push'](_0x13346b['shift']());}};_0x1a6a9e(++_0x2ae741);}(_0x2062,0xa0));var _0x2206=function(_0x2eec1f,_0x1b9987){_0x2eec1f=_0x2eec1f-0x0;var _0x543075=_0x2062[_0x2eec1f];return _0x543075;};'use strict';var _=require('lodash');var util=require(_0x2206('0x0'));var moment=require(_0x2206('0x1'));var BPromise=require(_0x2206('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2206('0x3'))['db'];var utils=require(_0x2206('0x4'));var logger=require(_0x2206('0x5'))(_0x2206('0x6'));var config=require('../../config/environment');var jayson=require(_0x2206('0x7'));var client=jayson[_0x2206('0x8')]['http']({'port':0x232a});config[_0x2206('0x9')]=_[_0x2206('0xa')](config['redis'],{'host':_0x2206('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2206('0xc'))[_0x2206('0xd')](socket);function respondWithRpcPromise(_0x666164,_0x27366a,_0x3c1dc2){return new BPromise(function(_0x4f508b,_0x4884a9){return client['request'](_0x666164,_0x3c1dc2)['then'](function(_0x30945d){logger[_0x2206('0xe')](_0x2206('0xf'),_0x27366a,_0x2206('0x10'));logger[_0x2206('0x11')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x27366a,'request\x20sent',JSON[_0x2206('0x12')](_0x30945d));if(_0x30945d[_0x2206('0x13')]){if(_0x30945d[_0x2206('0x13')][_0x2206('0x14')]===0x1f4){logger[_0x2206('0x13')](_0x2206('0xf'),_0x27366a,_0x30945d[_0x2206('0x13')][_0x2206('0x15')]);return _0x4884a9(_0x30945d[_0x2206('0x13')][_0x2206('0x15')]);}logger[_0x2206('0x13')](_0x2206('0xf'),_0x27366a,_0x30945d['error'][_0x2206('0x15')]);return _0x4f508b(_0x30945d[_0x2206('0x13')][_0x2206('0x15')]);}else{logger[_0x2206('0xe')](_0x2206('0xf'),_0x27366a,_0x2206('0x10'));_0x4f508b(_0x30945d['result'][_0x2206('0x15')]);}})[_0x2206('0x16')](function(_0x2cbaeb){logger[_0x2206('0x13')](_0x2206('0xf'),_0x27366a,_0x2cbaeb);_0x4884a9(_0x2cbaeb);});});}exports['GetVoiceQueue']=function(_0x5cc856){var _0x32c4cc=this;return new Promise(function(_0x3b507f,_0x5a24a5){return db[_0x2206('0x17')]['findAll']({'raw':_0x5cc856[_0x2206('0x18')]?_0x5cc856[_0x2206('0x18')][_0x2206('0x19')]===undefined?!![]:![]:!![],'where':_0x5cc856[_0x2206('0x18')]?_0x5cc856[_0x2206('0x18')]['where']||null:null,'attributes':_0x5cc856[_0x2206('0x18')]?_0x5cc856[_0x2206('0x18')][_0x2206('0x1a')]||null:null,'limit':_0x5cc856[_0x2206('0x18')]?_0x5cc856[_0x2206('0x18')][_0x2206('0x1b')]||null:null,'include':_0x5cc856['options']?_0x5cc856['options'][_0x2206('0x1c')]?_[_0x2206('0x1d')](_0x5cc856['options'][_0x2206('0x1c')],function(_0x47d644){return{'model':db[_0x47d644[_0x2206('0x1e')]],'as':_0x47d644['as'],'attributes':_0x47d644['attributes'],'include':_0x47d644[_0x2206('0x1c')]?_[_0x2206('0x1d')](_0x47d644[_0x2206('0x1c')],function(_0xfe33da){return{'model':db[_0xfe33da[_0x2206('0x1e')]],'as':_0xfe33da['as'],'attributes':_0xfe33da['attributes'],'include':_0xfe33da['include']?_[_0x2206('0x1d')](_0xfe33da[_0x2206('0x1c')],function(_0x200008){return{'model':db[_0x200008[_0x2206('0x1e')]],'as':_0x200008['as'],'attributes':_0x200008['attributes']};}):[]};}):[]};}):[]:[]})[_0x2206('0x1f')](function(_0x1b8bb2){logger[_0x2206('0xe')](_0x2206('0x20'),_0x5cc856);logger[_0x2206('0x11')]('GetVoiceQueue',_0x5cc856,JSON[_0x2206('0x12')](_0x1b8bb2));_0x3b507f(_0x1b8bb2);})['catch'](function(_0x2e771b){logger[_0x2206('0x13')](_0x2206('0x20'),_0x2e771b[_0x2206('0x15')],_0x5cc856);_0x5a24a5(_0x32c4cc['error'](0x1f4,_0x2e771b[_0x2206('0x15')]));});});};exports[_0x2206('0x21')]=function(_0x1920cb){var _0x414a48=this;return new Promise(function(_0x1895af,_0x2eb4f6){return db['VoiceQueue'][_0x2206('0x22')]({'raw':_0x1920cb[_0x2206('0x18')]?_0x1920cb['options'][_0x2206('0x19')]===undefined?!![]:![]:!![],'where':_0x1920cb[_0x2206('0x18')]?_0x1920cb[_0x2206('0x18')]['where']||null:null,'attributes':_0x1920cb[_0x2206('0x18')]?_0x1920cb[_0x2206('0x18')]['attributes']||null:null,'include':_0x1920cb[_0x2206('0x18')]?_0x1920cb['options'][_0x2206('0x1c')]?_[_0x2206('0x1d')](_0x1920cb[_0x2206('0x18')][_0x2206('0x1c')],function(_0x27e205){return{'model':db[_0x27e205[_0x2206('0x1e')]],'as':_0x27e205['as'],'attributes':_0x27e205[_0x2206('0x1a')],'include':_0x27e205[_0x2206('0x1c')]?_[_0x2206('0x1d')](_0x27e205[_0x2206('0x1c')],function(_0x3f9b07){return{'model':db[_0x3f9b07[_0x2206('0x1e')]],'as':_0x3f9b07['as'],'attributes':_0x3f9b07[_0x2206('0x1a')],'include':_0x3f9b07[_0x2206('0x1c')]?_[_0x2206('0x1d')](_0x3f9b07[_0x2206('0x1c')],function(_0x1e9e86){return{'model':db[_0x1e9e86[_0x2206('0x1e')]],'as':_0x1e9e86['as'],'attributes':_0x1e9e86['attributes']};}):[]};}):[]};}):[]:[]})[_0x2206('0x1f')](function(_0xe4b094){logger[_0x2206('0xe')](_0x2206('0x21'),_0x1920cb);logger[_0x2206('0x11')](_0x2206('0x21'),_0x1920cb,JSON[_0x2206('0x12')](_0xe4b094));_0x1895af(_0xe4b094);})[_0x2206('0x16')](function(_0x46b309){logger[_0x2206('0x13')]('ShowVoiceQueue',_0x46b309[_0x2206('0x15')],_0x1920cb);_0x2eb4f6(_0x414a48[_0x2206('0x13')](0x1f4,_0x46b309[_0x2206('0x15')]));});});};
\ No newline at end of file
index 9a4f8da..2bf82f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1833=['update','emit','removeListener','length','./voiceQueue.events'];(function(_0x187499,_0x5e416a){var _0x2965fe=function(_0xc6645e){while(--_0xc6645e){_0x187499['push'](_0x187499['shift']());}};_0x2965fe(++_0x5e416a);}(_0x1833,0x144));var _0x3183=function(_0x2409d0,_0x127d21){_0x2409d0=_0x2409d0-0x0;var _0x38eb87=_0x1833[_0x2409d0];return _0x38eb87;};'use strict';var VoiceQueueEvents=require(_0x3183('0x0'));var events=['save','remove',_0x3183('0x1')];function createListener(_0x120ebb,_0x4b88dc){return function(_0x1080cf){_0x4b88dc[_0x3183('0x2')](_0x120ebb,_0x1080cf);};}function removeListener(_0x8720d5,_0x1975fa){return function(){VoiceQueueEvents[_0x3183('0x3')](_0x8720d5,_0x1975fa);};}exports['register']=function(_0x56b8a9){for(var _0x255107=0x0,_0x285477=events[_0x3183('0x4')];_0x255107<_0x285477;_0x255107++){var _0x2b7c35=events[_0x255107];var _0x352ae0=createListener('voiceQueue:'+_0x2b7c35,_0x56b8a9);VoiceQueueEvents['on'](_0x2b7c35,_0x352ae0);}};
\ No newline at end of file
+var _0xe048=['length','./voiceQueue.events','remove','update','emit','removeListener'];(function(_0x26af93,_0x17de65){var _0x3d058d=function(_0x4077b5){while(--_0x4077b5){_0x26af93['push'](_0x26af93['shift']());}};_0x3d058d(++_0x17de65);}(_0xe048,0x13f));var _0x8e04=function(_0x2309f5,_0x19a4eb){_0x2309f5=_0x2309f5-0x0;var _0x39ada3=_0xe048[_0x2309f5];return _0x39ada3;};'use strict';var VoiceQueueEvents=require(_0x8e04('0x0'));var events=['save',_0x8e04('0x1'),_0x8e04('0x2')];function createListener(_0x1ee4c1,_0x300a79){return function(_0x3a2727){_0x300a79[_0x8e04('0x3')](_0x1ee4c1,_0x3a2727);};}function removeListener(_0x55728a,_0x327088){return function(){VoiceQueueEvents[_0x8e04('0x4')](_0x55728a,_0x327088);};}exports['register']=function(_0xe01090){for(var _0xa00427=0x0,_0x44d96d=events[_0x8e04('0x5')];_0xa00427<_0x44d96d;_0xa00427++){var _0x1c9d4b=events[_0xa00427];var _0x5232c2=createListener('voiceQueue:'+_0x1c9d4b,_0xe01090);VoiceQueueEvents['on'](_0x1c9d4b,_0x5232c2);}};
\ No newline at end of file
index 214564f..cd063ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2181=['getVoiceQueuesReport','/:id','show','post','put','delete','destroy','exports','multer','connect-timeout','express','../../components/interaction/service','./voiceQueueReport.controller','isAuthenticated','index','get','describe','/index'];(function(_0x30a31e,_0x31f766){var _0x170879=function(_0x313ee7){while(--_0x313ee7){_0x30a31e['push'](_0x30a31e['shift']());}};_0x170879(++_0x31f766);}(_0x2181,0x116));var _0x1218=function(_0x1d4779,_0x34c573){_0x1d4779=_0x1d4779-0x0;var _0x2775ce=_0x2181[_0x1d4779];return _0x2775ce;};'use strict';var multer=require(_0x1218('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1218('0x1'));var express=require(_0x1218('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1218('0x3'));var config=require('../../config/environment');var controller=require(_0x1218('0x4'));router['get']('/',auth[_0x1218('0x5')](),controller[_0x1218('0x6')]);router[_0x1218('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x1218('0x8')]);router[_0x1218('0x7')](_0x1218('0x9'),auth[_0x1218('0x5')](),controller[_0x1218('0xa')]);router['get'](_0x1218('0xb'),auth['isAuthenticated'](),controller[_0x1218('0xc')]);router[_0x1218('0xd')]('/',auth[_0x1218('0x5')](),controller['create']);router[_0x1218('0xe')](_0x1218('0xb'),auth[_0x1218('0x5')](),controller['update']);router[_0x1218('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x1218('0x10')]);module[_0x1218('0x11')]=router;
\ No newline at end of file
+var _0xbf0e=['create','put','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','isAuthenticated','get','/describe','describe','getVoiceQueuesReport','/:id','show','post'];(function(_0x5402b,_0x4820ad){var _0x329004=function(_0x28f84e){while(--_0x28f84e){_0x5402b['push'](_0x5402b['shift']());}};_0x329004(++_0x4820ad);}(_0xbf0e,0x164));var _0xebf0=function(_0x260628,_0x232946){_0x260628=_0x260628-0x0;var _0x3f4050=_0xbf0e[_0x260628];return _0x3f4050;};'use strict';var multer=require(_0xebf0('0x0'));var util=require(_0xebf0('0x1'));var path=require(_0xebf0('0x2'));var timeout=require('connect-timeout');var express=require(_0xebf0('0x3'));var router=express[_0xebf0('0x4')]();var fs_extra=require(_0xebf0('0x5'));var auth=require(_0xebf0('0x6'));var interaction=require(_0xebf0('0x7'));var config=require(_0xebf0('0x8'));var controller=require(_0xebf0('0x9'));router['get']('/',auth[_0xebf0('0xa')](),controller['index']);router[_0xebf0('0xb')](_0xebf0('0xc'),auth['isAuthenticated'](),controller[_0xebf0('0xd')]);router['get']('/index',auth[_0xebf0('0xa')](),controller[_0xebf0('0xe')]);router['get'](_0xebf0('0xf'),auth[_0xebf0('0xa')](),controller[_0xebf0('0x10')]);router[_0xebf0('0x11')]('/',auth[_0xebf0('0xa')](),controller[_0xebf0('0x12')]);router[_0xebf0('0x13')](_0xebf0('0xf'),auth['isAuthenticated'](),controller['update']);router[_0xebf0('0x14')](_0xebf0('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0xebf0('0x15')]=router;
\ No newline at end of file
index 28c0e8a..2180069 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0ff=['BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue'];(function(_0x2ccfa3,_0x374b93){var _0x3dcce2=function(_0x3c192b){while(--_0x3c192b){_0x2ccfa3['push'](_0x2ccfa3['shift']());}};_0x3dcce2(++_0x374b93);}(_0xe0ff,0x1a8));var _0xfe0f=function(_0x28ed9e,_0xf2fdab){_0x28ed9e=_0x28ed9e-0x0;var _0x19edf5=_0xe0ff[_0x28ed9e];return _0x19edf5;};'use strict';var Sequelize=require(_0xfe0f('0x0'));var moment=require(_0xfe0f('0x1'));module['exports']={'type':{'type':Sequelize[_0xfe0f('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xfe0f('0x2')]},'queue':{'type':Sequelize[_0xfe0f('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0xfe0f('0x3')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x5417c4){var _0x10c468=moment(_0x5417c4);var _0x10c861=moment(this[_0xfe0f('0x4')](_0xfe0f('0x5')))[_0xfe0f('0x6')](_0xfe0f('0x7'));var _0x269c2c=_0x10c468[_0xfe0f('0x8')](_0x10c861,'seconds');this[_0xfe0f('0x9')]('queuecallerleaveAt',_0x5417c4);this[_0xfe0f('0x9')]('holdtime',_0x269c2c||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0xfe0f('0xa')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xfe0f('0x3')]},'queuecallercomplete':{'type':Sequelize[_0xfe0f('0xa')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xfe0f('0x3')]},'queuecallerexit':{'type':Sequelize[_0xfe0f('0xa')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xfe0f('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0xfe0f('0x2')],'comment':_0xfe0f('0xb')},'originalposition':{'type':Sequelize[_0xfe0f('0xc')]},'channel':{'type':Sequelize[_0xfe0f('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xfe0f('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xfe0f('0x2')]},'exten':{'type':Sequelize[_0xfe0f('0x2')]},'priority':{'type':Sequelize[_0xfe0f('0x2')]},'holdtime':{'type':Sequelize[_0xfe0f('0xc')]},'mohtime':{'type':Sequelize[_0xfe0f('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xfe0f('0xa')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xfe0f('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xfe0f('0x2')],'comment':_0xfe0f('0xd')},'transferexten':{'type':Sequelize[_0xfe0f('0x2')]},'transferuniqueid':{'type':Sequelize[_0xfe0f('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xfe0f('0x2')]},'thirdDisposition':{'type':Sequelize[_0xfe0f('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0xfe0f('0xc')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x95d6=['BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','moment','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'];(function(_0x42b645,_0x26b100){var _0x2faa75=function(_0x4916b1){while(--_0x4916b1){_0x42b645['push'](_0x42b645['shift']());}};_0x2faa75(++_0x26b100);}(_0x95d6,0xdf));var _0x695d=function(_0x494abf,_0xcd433f){_0x494abf=_0x494abf-0x0;var _0x311c94=_0x95d6[_0x494abf];return _0x311c94;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x695d('0x0'));module['exports']={'type':{'type':Sequelize[_0x695d('0x1')]},'uniqueid':{'type':Sequelize[_0x695d('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x695d('0x1')]},'queue':{'type':Sequelize[_0x695d('0x1')]},'queuecallerjoinAt':{'type':Sequelize[_0x695d('0x2')]},'queuecallerleaveAt':{'type':Sequelize[_0x695d('0x2')],'set':function(_0x55d893){var _0x433991=moment(_0x55d893);var _0x23b8c2=moment(this['getDataValue']('queuecallerjoinAt'))[_0x695d('0x3')](_0x695d('0x4'));var _0x2542a6=_0x433991['diff'](_0x23b8c2,_0x695d('0x5'));this[_0x695d('0x6')](_0x695d('0x7'),_0x55d893);this[_0x695d('0x6')](_0x695d('0x8'),_0x2542a6||null);}},'position':{'type':Sequelize[_0x695d('0x9')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x695d('0x2')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x695d('0x2')]},'queuecallerexitreason':{'type':Sequelize[_0x695d('0x1')],'comment':_0x695d('0xa')},'originalposition':{'type':Sequelize[_0x695d('0x9')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x695d('0x1')]},'connectedlinename':{'type':Sequelize[_0x695d('0x1')]},'accountcode':{'type':Sequelize[_0x695d('0x1')]},'context':{'type':Sequelize[_0x695d('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x695d('0x9')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x695d('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x695d('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x695d('0x1')],'comment':_0x695d('0xc')},'transferexten':{'type':Sequelize[_0x695d('0x1')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x695d('0x1')]},'secondDisposition':{'type':Sequelize[_0x695d('0x1')]},'thirdDisposition':{'type':Sequelize[_0x695d('0x1')]},'queuecallerenterreason':{'type':Sequelize[_0x695d('0x9')],'defaultValue':0x0}};
\ No newline at end of file
index 7f7006e..261a6f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x51fc=['../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','VoiceQueueReport','findAll','rows','find','catch','create','body','params','describe','getVoiceQueuesReport','nolimit','pick','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x479d6a,_0x166d19){var _0x42d1a1=function(_0x2d8fd2){while(--_0x2d8fd2){_0x479d6a['push'](_0x479d6a['shift']());}};_0x42d1a1(++_0x166d19);}(_0x51fc,0x194));var _0xc51f=function(_0xd3fb91,_0xfc54c0){_0xd3fb91=_0xd3fb91-0x0;var _0x33438c=_0x51fc[_0xd3fb91];return _0x33438c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc51f('0x0'));var zipdir=require(_0xc51f('0x1'));var jsonpatch=require(_0xc51f('0x2'));var rp=require('request-promise');var moment=require(_0xc51f('0x3'));var BPromise=require(_0xc51f('0x4'));var Mustache=require('mustache');var util=require(_0xc51f('0x5'));var path=require(_0xc51f('0x6'));var sox=require(_0xc51f('0x7'));var csv=require(_0xc51f('0x8'));var ejs=require(_0xc51f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc51f('0xa'));var squel=require(_0xc51f('0xb'));var crypto=require(_0xc51f('0xc'));var jsforce=require(_0xc51f('0xd'));var deskjs=require(_0xc51f('0xe'));var toCsv=require(_0xc51f('0x8'));var querystring=require(_0xc51f('0xf'));var Papa=require(_0xc51f('0x10'));var Redis=require(_0xc51f('0x11'));var authService=require(_0xc51f('0x12'));var qs=require(_0xc51f('0x13'));var as=require(_0xc51f('0x14'));var hardwareService=require(_0xc51f('0x15'));var logger=require(_0xc51f('0x16'))(_0xc51f('0x17'));var utils=require(_0xc51f('0x18'));var config=require(_0xc51f('0x19'));var licenseUtil=require(_0xc51f('0x1a'));var db=require(_0xc51f('0x1b'))['db'];config[_0xc51f('0x1c')]=_['defaults'](config[_0xc51f('0x1c')],{'host':_0xc51f('0x1d'),'port':0x18eb});var socket=require(_0xc51f('0x1e'))(new Redis(config[_0xc51f('0x1c')]));require(_0xc51f('0x1f'))['register'](socket);function respondWithStatusCode(_0x577f2e,_0x265fc1){_0x265fc1=_0x265fc1||0xcc;return function(_0x4ec48b){if(_0x4ec48b){return _0x577f2e['sendStatus'](_0x265fc1);}return _0x577f2e[_0xc51f('0x20')](_0x265fc1)[_0xc51f('0x21')]();};}function respondWithResult(_0x2711a2,_0x3d445f){_0x3d445f=_0x3d445f||0xc8;return function(_0x28aeea){if(_0x28aeea){return _0x2711a2[_0xc51f('0x20')](_0x3d445f)['json'](_0x28aeea);}};}function respondWithFilteredResult(_0x54643d,_0x536309){return function(_0x293e14){if(_0x293e14){var _0x27244c=typeof _0x536309['offset']===_0xc51f('0x22')&&typeof _0x536309[_0xc51f('0x23')]===_0xc51f('0x22');var _0x2a99e8=_0x293e14[_0xc51f('0x24')];var _0x95247f=_0x27244c?0x0:_0x536309[_0xc51f('0x25')];var _0xd07805=_0x27244c?_0x293e14[_0xc51f('0x24')]:_0x536309[_0xc51f('0x25')]+_0x536309['limit'];var _0x39be3e;if(_0xd07805>=_0x2a99e8){_0xd07805=_0x2a99e8;_0x39be3e=0xc8;}else{_0x39be3e=0xce;}_0x54643d[_0xc51f('0x20')](_0x39be3e);return _0x54643d[_0xc51f('0x26')](_0xc51f('0x27'),_0x95247f+'-'+_0xd07805+'/'+_0x2a99e8)[_0xc51f('0x28')](_0x293e14);}return null;};}function patchUpdates(_0x594ad3){return function(_0x552496){try{jsonpatch[_0xc51f('0x29')](_0x552496,_0x594ad3,!![]);}catch(_0x2d01fc){return BPromise[_0xc51f('0x2a')](_0x2d01fc);}return _0x552496[_0xc51f('0x2b')]();};}function saveUpdates(_0x230515,_0x541761){return function(_0x5b8204){if(_0x5b8204){return _0x5b8204[_0xc51f('0x2c')](_0x230515)[_0xc51f('0x2d')](function(_0x290257){return _0x290257;});}return null;};}function removeEntity(_0x197e38,_0x72c795){return function(_0x30ed1f){if(_0x30ed1f){return _0x30ed1f[_0xc51f('0x2e')]()['then'](function(){_0x197e38['status'](0xcc)[_0xc51f('0x21')]();});}};}function handleEntityNotFound(_0x51add5,_0x2eb7e9){return function(_0x5f0110){if(!_0x5f0110){_0x51add5[_0xc51f('0x2f')](0x194);}return _0x5f0110;};}function handleError(_0x1c9fc7,_0x5e897b){_0x5e897b=_0x5e897b||0x1f4;return function(_0x85dcab){logger[_0xc51f('0x30')](_0x85dcab[_0xc51f('0x31')]);if(_0x85dcab[_0xc51f('0x32')]){delete _0x85dcab[_0xc51f('0x32')];}_0x1c9fc7[_0xc51f('0x20')](_0x5e897b)[_0xc51f('0x33')](_0x85dcab);};}exports[_0xc51f('0x34')]=function(_0x31e9c7,_0x1c6fa5){var _0x176773={},_0x27cf8d={},_0x24003c={'count':0x0,'rows':[]};var _0x2b31b1=_[_0xc51f('0x35')](db['VoiceQueueReport'][_0xc51f('0x36')],function(_0x4b6dc6){return{'name':_0x4b6dc6['fieldName'],'type':_0x4b6dc6[_0xc51f('0x37')]['key']};});_0x27cf8d[_0xc51f('0x38')]=_['map'](_0x2b31b1,'name');_0x27cf8d[_0xc51f('0x39')]=_[_0xc51f('0x3a')](_0x31e9c7[_0xc51f('0x39')]);_0x27cf8d[_0xc51f('0x3b')]=_[_0xc51f('0x3c')](_0x27cf8d[_0xc51f('0x38')],_0x27cf8d['query']);_0x176773[_0xc51f('0x3d')]=_[_0xc51f('0x3c')](_0x27cf8d['model'],qs[_0xc51f('0x3e')](_0x31e9c7[_0xc51f('0x39')]['fields']));_0x176773['attributes']=_0x176773[_0xc51f('0x3d')][_0xc51f('0x3f')]?_0x176773[_0xc51f('0x3d')]:_0x27cf8d[_0xc51f('0x38')];if(!_0x31e9c7['query'][_0xc51f('0x40')]('nolimit')){_0x176773[_0xc51f('0x23')]=qs[_0xc51f('0x23')](_0x31e9c7[_0xc51f('0x39')][_0xc51f('0x23')]);_0x176773[_0xc51f('0x25')]=qs[_0xc51f('0x25')](_0x31e9c7['query'][_0xc51f('0x25')]);}_0x176773[_0xc51f('0x41')]=qs[_0xc51f('0x42')](_0x31e9c7['query'][_0xc51f('0x42')]);_0x176773[_0xc51f('0x43')]=qs[_0xc51f('0x3b')](_['pick'](_0x31e9c7['query'],_0x27cf8d[_0xc51f('0x3b')]),_0x2b31b1);if(_0x31e9c7[_0xc51f('0x39')][_0xc51f('0x44')]){_0x176773[_0xc51f('0x43')]=_[_0xc51f('0x45')](_0x176773[_0xc51f('0x43')],{'$or':_[_0xc51f('0x35')](_0x2b31b1,function(_0x1de18a){if(_0x1de18a[_0xc51f('0x37')]!==_0xc51f('0x46')){var _0xd901d7={};_0xd901d7[_0x1de18a[_0xc51f('0x32')]]={'$like':'%'+_0x31e9c7[_0xc51f('0x39')][_0xc51f('0x44')]+'%'};return _0xd901d7;}})});}_0x176773=_[_0xc51f('0x45')]({},_0x176773,_0x31e9c7[_0xc51f('0x47')]);var _0x5d211f={'where':_0x176773[_0xc51f('0x43')]};return db['VoiceQueueReport'][_0xc51f('0x24')](_0x5d211f)[_0xc51f('0x2d')](function(_0x4a9911){_0x24003c[_0xc51f('0x24')]=_0x4a9911;if(_0x31e9c7[_0xc51f('0x39')][_0xc51f('0x48')]){_0x176773[_0xc51f('0x49')]=[{'all':!![]}];}return db[_0xc51f('0x4a')][_0xc51f('0x4b')](_0x176773);})[_0xc51f('0x2d')](function(_0x59cb05){_0x24003c[_0xc51f('0x4c')]=_0x59cb05;return _0x24003c;})[_0xc51f('0x2d')](respondWithFilteredResult(_0x1c6fa5,_0x176773))['catch'](handleError(_0x1c6fa5,null));};exports['show']=function(_0x183805,_0x245578){var _0xb92af8={'raw':![],'where':{'id':_0x183805['params']['id']}},_0x437cdc={};_0x437cdc[_0xc51f('0x38')]=_[_0xc51f('0x3a')](db['VoiceQueueReport'][_0xc51f('0x36')]);_0x437cdc[_0xc51f('0x39')]=_[_0xc51f('0x3a')](_0x183805[_0xc51f('0x39')]);_0x437cdc[_0xc51f('0x3b')]=_[_0xc51f('0x3c')](_0x437cdc[_0xc51f('0x38')],_0x437cdc[_0xc51f('0x39')]);_0xb92af8[_0xc51f('0x3d')]=_[_0xc51f('0x3c')](_0x437cdc[_0xc51f('0x38')],qs[_0xc51f('0x3e')](_0x183805[_0xc51f('0x39')]['fields']));_0xb92af8[_0xc51f('0x3d')]=_0xb92af8['attributes'][_0xc51f('0x3f')]?_0xb92af8[_0xc51f('0x3d')]:_0x437cdc[_0xc51f('0x38')];if(_0x183805['query'][_0xc51f('0x48')]){_0xb92af8[_0xc51f('0x49')]=[{'all':!![]}];}_0xb92af8=_[_0xc51f('0x45')]({},_0xb92af8,_0x183805[_0xc51f('0x47')]);return db['VoiceQueueReport'][_0xc51f('0x4d')](_0xb92af8)[_0xc51f('0x2d')](handleEntityNotFound(_0x245578,null))['then'](respondWithResult(_0x245578,null))[_0xc51f('0x4e')](handleError(_0x245578,null));};exports[_0xc51f('0x4f')]=function(_0x4719f9,_0x47f549){return db['VoiceQueueReport'][_0xc51f('0x4f')](_0x4719f9[_0xc51f('0x50')],{})[_0xc51f('0x2d')](respondWithResult(_0x47f549,0xc9))[_0xc51f('0x4e')](handleError(_0x47f549,null));};exports[_0xc51f('0x2c')]=function(_0x412d97,_0x30a572){if(_0x412d97[_0xc51f('0x50')]['id']){delete _0x412d97[_0xc51f('0x50')]['id'];}return db[_0xc51f('0x4a')][_0xc51f('0x4d')]({'where':{'id':_0x412d97[_0xc51f('0x51')]['id']}})[_0xc51f('0x2d')](handleEntityNotFound(_0x30a572,null))[_0xc51f('0x2d')](saveUpdates(_0x412d97['body'],null))[_0xc51f('0x2d')](respondWithResult(_0x30a572,null))[_0xc51f('0x4e')](handleError(_0x30a572,null));};exports[_0xc51f('0x2e')]=function(_0x4b34d8,_0x1f83dd){return db[_0xc51f('0x4a')][_0xc51f('0x4d')]({'where':{'id':_0x4b34d8[_0xc51f('0x51')]['id']}})[_0xc51f('0x2d')](handleEntityNotFound(_0x1f83dd,null))[_0xc51f('0x2d')](removeEntity(_0x1f83dd,null))[_0xc51f('0x4e')](handleError(_0x1f83dd,null));};exports[_0xc51f('0x52')]=function(_0x56fa82,_0x2007f2){return db[_0xc51f('0x4a')][_0xc51f('0x52')]()[_0xc51f('0x2d')](respondWithResult(_0x2007f2,null))[_0xc51f('0x4e')](handleError(_0x2007f2,null));};exports[_0xc51f('0x53')]=function(_0xabb99c,_0x308d67){var _0x509113={},_0x3ab2a9={},_0x4f336d={'count':0x0,'rows':[]};_0x3ab2a9[_0xc51f('0x38')]=_[_0xc51f('0x3a')](db[_0xc51f('0x4a')][_0xc51f('0x36')]);_0x3ab2a9[_0xc51f('0x39')]=_[_0xc51f('0x3a')](_0xabb99c[_0xc51f('0x39')]);_0x3ab2a9['filters']=_['intersection'](_0x3ab2a9[_0xc51f('0x38')],_0x3ab2a9['query']);_0x509113[_0xc51f('0x3d')]=_[_0xc51f('0x3c')](_0x3ab2a9[_0xc51f('0x38')],qs['fields'](_0xabb99c['query']['fields']));_0x509113[_0xc51f('0x3d')]=_0x509113[_0xc51f('0x3d')][_0xc51f('0x3f')]?_0x509113[_0xc51f('0x3d')]:_0x3ab2a9['model'];if(!_0xabb99c[_0xc51f('0x39')][_0xc51f('0x40')](_0xc51f('0x54'))){_0x509113['limit']=qs[_0xc51f('0x23')](_0xabb99c[_0xc51f('0x39')][_0xc51f('0x23')]);_0x509113[_0xc51f('0x25')]=qs[_0xc51f('0x25')](_0xabb99c['query']['offset']);}_0x509113['order']=qs[_0xc51f('0x42')](_0xabb99c[_0xc51f('0x39')][_0xc51f('0x42')]);_0x509113['where']=qs[_0xc51f('0x3b')](_[_0xc51f('0x55')](_0xabb99c['query'],_0x3ab2a9[_0xc51f('0x3b')]));if(_0xabb99c['query'][_0xc51f('0x44')]){_0x509113[_0xc51f('0x43')]=_[_0xc51f('0x45')](_0x509113[_0xc51f('0x43')],{'$or':_[_0xc51f('0x35')](_0x509113[_0xc51f('0x3d')],function(_0x108cc9){var _0x20ae78={};_0x20ae78[_0x108cc9]={'$like':'%'+_0xabb99c[_0xc51f('0x39')]['filter']+'%'};return _0x20ae78;})});}_0x509113=_[_0xc51f('0x45')]({},_0x509113,_0xabb99c[_0xc51f('0x47')]);var _0x26bb3d={'where':_0x509113[_0xc51f('0x43')]};return db['VoiceQueueReport'][_0xc51f('0x24')](_0x26bb3d)[_0xc51f('0x2d')](function(_0x17170f){_0x4f336d[_0xc51f('0x24')]=_0x17170f;if(_0xabb99c[_0xc51f('0x39')][_0xc51f('0x48')]){_0x509113['include']=[{'all':!![]}];}return db[_0xc51f('0x4a')][_0xc51f('0x4b')](_0x509113);})[_0xc51f('0x2d')](function(_0x573e02){_0x4f336d[_0xc51f('0x4c')]=_0x573e02;return _0x4f336d;})['then'](respondWithFilteredResult(_0x308d67,_0x509113,_0xc51f('0x53')))[_0xc51f('0x4e')](handleError(_0x308d67,null,_0xc51f('0x53')));};
\ No newline at end of file
+var _0x186f=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','VoiceQueueReport','findAll','rows','show','params','keys','find','create','body','catch','describe','pick','getVoiceQueuesReport','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0x186f,0x191));var _0xf186=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x186f[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0xf186('0x0'));var rimraf=require(_0xf186('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf186('0x2'));var rp=require(_0xf186('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf186('0x4'));var util=require(_0xf186('0x5'));var path=require(_0xf186('0x6'));var sox=require(_0xf186('0x7'));var csv=require(_0xf186('0x8'));var ejs=require(_0xf186('0x9'));var fs=require('fs');var fs_extra=require(_0xf186('0xa'));var _=require(_0xf186('0xb'));var squel=require(_0xf186('0xc'));var crypto=require(_0xf186('0xd'));var jsforce=require(_0xf186('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf186('0x8'));var querystring=require(_0xf186('0xf'));var Papa=require(_0xf186('0x10'));var Redis=require(_0xf186('0x11'));var authService=require(_0xf186('0x12'));var qs=require(_0xf186('0x13'));var as=require(_0xf186('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf186('0x15'))(_0xf186('0x16'));var utils=require(_0xf186('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf186('0x18'))['db'];config['redis']=_[_0xf186('0x19')](config[_0xf186('0x1a')],{'host':_0xf186('0x1b'),'port':0x18eb});var socket=require(_0xf186('0x1c'))(new Redis(config['redis']));require(_0xf186('0x1d'))['register'](socket);function respondWithStatusCode(_0x127b7b,_0x474861){_0x474861=_0x474861||0xcc;return function(_0x9e81c9){if(_0x9e81c9){return _0x127b7b['sendStatus'](_0x474861);}return _0x127b7b[_0xf186('0x1e')](_0x474861)[_0xf186('0x1f')]();};}function respondWithResult(_0x129bc0,_0x5d0cc1){_0x5d0cc1=_0x5d0cc1||0xc8;return function(_0x3c60bd){if(_0x3c60bd){return _0x129bc0[_0xf186('0x1e')](_0x5d0cc1)['json'](_0x3c60bd);}};}function respondWithFilteredResult(_0x23c972,_0x4e9676){return function(_0x307ca8){if(_0x307ca8){var _0x14907b=typeof _0x4e9676[_0xf186('0x20')]===_0xf186('0x21')&&typeof _0x4e9676[_0xf186('0x22')]===_0xf186('0x21');var _0x66d9f0=_0x307ca8[_0xf186('0x23')];var _0x242a19=_0x14907b?0x0:_0x4e9676[_0xf186('0x20')];var _0x441cb6=_0x14907b?_0x307ca8['count']:_0x4e9676['offset']+_0x4e9676[_0xf186('0x22')];var _0x23ee56;if(_0x441cb6>=_0x66d9f0){_0x441cb6=_0x66d9f0;_0x23ee56=0xc8;}else{_0x23ee56=0xce;}_0x23c972[_0xf186('0x1e')](_0x23ee56);return _0x23c972['set'](_0xf186('0x24'),_0x242a19+'-'+_0x441cb6+'/'+_0x66d9f0)[_0xf186('0x25')](_0x307ca8);}return null;};}function patchUpdates(_0x160d8d){return function(_0x2d5d8e){try{jsonpatch[_0xf186('0x26')](_0x2d5d8e,_0x160d8d,!![]);}catch(_0x4e5edf){return BPromise[_0xf186('0x27')](_0x4e5edf);}return _0x2d5d8e[_0xf186('0x28')]();};}function saveUpdates(_0x5cf31a,_0x5b9a0d){return function(_0x3b2571){if(_0x3b2571){return _0x3b2571[_0xf186('0x29')](_0x5cf31a)[_0xf186('0x2a')](function(_0x435c90){return _0x435c90;});}return null;};}function removeEntity(_0x88a5f9,_0x2c6c9f){return function(_0x7262d2){if(_0x7262d2){return _0x7262d2[_0xf186('0x2b')]()[_0xf186('0x2a')](function(){_0x88a5f9[_0xf186('0x1e')](0xcc)[_0xf186('0x1f')]();});}};}function handleEntityNotFound(_0x85c462,_0x573d5d){return function(_0x4444b1){if(!_0x4444b1){_0x85c462[_0xf186('0x2c')](0x194);}return _0x4444b1;};}function handleError(_0x1c286c,_0xd86249){_0xd86249=_0xd86249||0x1f4;return function(_0x50aa29){logger['error'](_0x50aa29['stack']);if(_0x50aa29[_0xf186('0x2d')]){delete _0x50aa29['name'];}_0x1c286c[_0xf186('0x1e')](_0xd86249)[_0xf186('0x2e')](_0x50aa29);};}exports[_0xf186('0x2f')]=function(_0xce4c5b,_0x3eec48){var _0x5c064e={},_0x444ce7={},_0x4d8e17={'count':0x0,'rows':[]};var _0x23c56f=_[_0xf186('0x30')](db['VoiceQueueReport'][_0xf186('0x31')],function(_0x366084){return{'name':_0x366084[_0xf186('0x32')],'type':_0x366084[_0xf186('0x33')][_0xf186('0x34')]};});_0x444ce7['model']=_[_0xf186('0x30')](_0x23c56f,_0xf186('0x2d'));_0x444ce7['query']=_['keys'](_0xce4c5b[_0xf186('0x35')]);_0x444ce7[_0xf186('0x36')]=_[_0xf186('0x37')](_0x444ce7['model'],_0x444ce7[_0xf186('0x35')]);_0x5c064e['attributes']=_['intersection'](_0x444ce7['model'],qs[_0xf186('0x38')](_0xce4c5b[_0xf186('0x35')][_0xf186('0x38')]));_0x5c064e[_0xf186('0x39')]=_0x5c064e[_0xf186('0x39')][_0xf186('0x3a')]?_0x5c064e[_0xf186('0x39')]:_0x444ce7[_0xf186('0x3b')];if(!_0xce4c5b[_0xf186('0x35')][_0xf186('0x3c')](_0xf186('0x3d'))){_0x5c064e[_0xf186('0x22')]=qs['limit'](_0xce4c5b[_0xf186('0x35')][_0xf186('0x22')]);_0x5c064e[_0xf186('0x20')]=qs[_0xf186('0x20')](_0xce4c5b['query'][_0xf186('0x20')]);}_0x5c064e[_0xf186('0x3e')]=qs[_0xf186('0x3f')](_0xce4c5b[_0xf186('0x35')]['sort']);_0x5c064e[_0xf186('0x40')]=qs[_0xf186('0x36')](_['pick'](_0xce4c5b[_0xf186('0x35')],_0x444ce7[_0xf186('0x36')]),_0x23c56f);if(_0xce4c5b['query'][_0xf186('0x41')]){_0x5c064e[_0xf186('0x40')]=_[_0xf186('0x42')](_0x5c064e[_0xf186('0x40')],{'$or':_[_0xf186('0x30')](_0x23c56f,function(_0xb20dad){if(_0xb20dad['type']!==_0xf186('0x43')){var _0x1bb06d={};_0x1bb06d[_0xb20dad[_0xf186('0x2d')]]={'$like':'%'+_0xce4c5b[_0xf186('0x35')]['filter']+'%'};return _0x1bb06d;}})});}_0x5c064e=_['merge']({},_0x5c064e,_0xce4c5b[_0xf186('0x44')]);var _0x93bc5={'where':_0x5c064e[_0xf186('0x40')]};return db['VoiceQueueReport']['count'](_0x93bc5)['then'](function(_0x651c7b){_0x4d8e17[_0xf186('0x23')]=_0x651c7b;if(_0xce4c5b[_0xf186('0x35')][_0xf186('0x45')]){_0x5c064e[_0xf186('0x46')]=[{'all':!![]}];}return db[_0xf186('0x47')][_0xf186('0x48')](_0x5c064e);})['then'](function(_0x260498){_0x4d8e17[_0xf186('0x49')]=_0x260498;return _0x4d8e17;})[_0xf186('0x2a')](respondWithFilteredResult(_0x3eec48,_0x5c064e))['catch'](handleError(_0x3eec48,null));};exports[_0xf186('0x4a')]=function(_0x1545a7,_0xb8f0c5){var _0x338f21={'raw':![],'where':{'id':_0x1545a7[_0xf186('0x4b')]['id']}},_0xe05bf0={};_0xe05bf0[_0xf186('0x3b')]=_[_0xf186('0x4c')](db[_0xf186('0x47')][_0xf186('0x31')]);_0xe05bf0[_0xf186('0x35')]=_[_0xf186('0x4c')](_0x1545a7[_0xf186('0x35')]);_0xe05bf0[_0xf186('0x36')]=_[_0xf186('0x37')](_0xe05bf0['model'],_0xe05bf0[_0xf186('0x35')]);_0x338f21['attributes']=_['intersection'](_0xe05bf0['model'],qs[_0xf186('0x38')](_0x1545a7[_0xf186('0x35')][_0xf186('0x38')]));_0x338f21[_0xf186('0x39')]=_0x338f21[_0xf186('0x39')][_0xf186('0x3a')]?_0x338f21[_0xf186('0x39')]:_0xe05bf0[_0xf186('0x3b')];if(_0x1545a7['query']['includeAll']){_0x338f21[_0xf186('0x46')]=[{'all':!![]}];}_0x338f21=_[_0xf186('0x42')]({},_0x338f21,_0x1545a7[_0xf186('0x44')]);return db[_0xf186('0x47')][_0xf186('0x4d')](_0x338f21)[_0xf186('0x2a')](handleEntityNotFound(_0xb8f0c5,null))[_0xf186('0x2a')](respondWithResult(_0xb8f0c5,null))['catch'](handleError(_0xb8f0c5,null));};exports[_0xf186('0x4e')]=function(_0x45d873,_0x19285d){return db[_0xf186('0x47')][_0xf186('0x4e')](_0x45d873[_0xf186('0x4f')],{})['then'](respondWithResult(_0x19285d,0xc9))[_0xf186('0x50')](handleError(_0x19285d,null));};exports[_0xf186('0x29')]=function(_0x42364c,_0x57ae3d){if(_0x42364c['body']['id']){delete _0x42364c['body']['id'];}return db[_0xf186('0x47')][_0xf186('0x4d')]({'where':{'id':_0x42364c[_0xf186('0x4b')]['id']}})[_0xf186('0x2a')](handleEntityNotFound(_0x57ae3d,null))[_0xf186('0x2a')](saveUpdates(_0x42364c[_0xf186('0x4f')],null))['then'](respondWithResult(_0x57ae3d,null))[_0xf186('0x50')](handleError(_0x57ae3d,null));};exports['destroy']=function(_0x2815e5,_0x3ed6eb){return db[_0xf186('0x47')][_0xf186('0x4d')]({'where':{'id':_0x2815e5[_0xf186('0x4b')]['id']}})[_0xf186('0x2a')](handleEntityNotFound(_0x3ed6eb,null))[_0xf186('0x2a')](removeEntity(_0x3ed6eb,null))['catch'](handleError(_0x3ed6eb,null));};exports[_0xf186('0x51')]=function(_0x300673,_0x11cdb8){return db[_0xf186('0x47')][_0xf186('0x51')]()[_0xf186('0x2a')](respondWithResult(_0x11cdb8,null))[_0xf186('0x50')](handleError(_0x11cdb8,null));};exports['getVoiceQueuesReport']=function(_0x45a44d,_0x4456a7){var _0x2cbbb2={},_0x164dce={},_0x163d6d={'count':0x0,'rows':[]};_0x164dce[_0xf186('0x3b')]=_[_0xf186('0x4c')](db[_0xf186('0x47')][_0xf186('0x31')]);_0x164dce[_0xf186('0x35')]=_[_0xf186('0x4c')](_0x45a44d['query']);_0x164dce[_0xf186('0x36')]=_[_0xf186('0x37')](_0x164dce[_0xf186('0x3b')],_0x164dce['query']);_0x2cbbb2[_0xf186('0x39')]=_['intersection'](_0x164dce['model'],qs[_0xf186('0x38')](_0x45a44d['query'][_0xf186('0x38')]));_0x2cbbb2[_0xf186('0x39')]=_0x2cbbb2[_0xf186('0x39')][_0xf186('0x3a')]?_0x2cbbb2[_0xf186('0x39')]:_0x164dce[_0xf186('0x3b')];if(!_0x45a44d['query'][_0xf186('0x3c')]('nolimit')){_0x2cbbb2[_0xf186('0x22')]=qs[_0xf186('0x22')](_0x45a44d[_0xf186('0x35')][_0xf186('0x22')]);_0x2cbbb2[_0xf186('0x20')]=qs['offset'](_0x45a44d[_0xf186('0x35')][_0xf186('0x20')]);}_0x2cbbb2[_0xf186('0x3e')]=qs['sort'](_0x45a44d[_0xf186('0x35')]['sort']);_0x2cbbb2[_0xf186('0x40')]=qs[_0xf186('0x36')](_[_0xf186('0x52')](_0x45a44d[_0xf186('0x35')],_0x164dce['filters']));if(_0x45a44d['query'][_0xf186('0x41')]){_0x2cbbb2[_0xf186('0x40')]=_[_0xf186('0x42')](_0x2cbbb2[_0xf186('0x40')],{'$or':_[_0xf186('0x30')](_0x2cbbb2[_0xf186('0x39')],function(_0x1c6789){var _0x575d7d={};_0x575d7d[_0x1c6789]={'$like':'%'+_0x45a44d['query'][_0xf186('0x41')]+'%'};return _0x575d7d;})});}_0x2cbbb2=_[_0xf186('0x42')]({},_0x2cbbb2,_0x45a44d['options']);var _0xa4bfd7={'where':_0x2cbbb2[_0xf186('0x40')]};return db[_0xf186('0x47')]['count'](_0xa4bfd7)[_0xf186('0x2a')](function(_0x326bc0){_0x163d6d['count']=_0x326bc0;if(_0x45a44d['query']['includeAll']){_0x2cbbb2[_0xf186('0x46')]=[{'all':!![]}];}return db[_0xf186('0x47')][_0xf186('0x48')](_0x2cbbb2);})['then'](function(_0x42b716){_0x163d6d[_0xf186('0x49')]=_0x42b716;return _0x163d6d;})[_0xf186('0x2a')](respondWithFilteredResult(_0x4456a7,_0x2cbbb2,_0xf186('0x53')))[_0xf186('0x50')](handleError(_0x4456a7,null,'getVoiceQueuesReport'));};
\ No newline at end of file
index 7d0ee5a..b9ee79f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc52b=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','update','remove'];(function(_0x14e58b,_0x269d6e){var _0x5d0a62=function(_0x30c5ad){while(--_0x30c5ad){_0x14e58b['push'](_0x14e58b['shift']());}};_0x5d0a62(++_0x269d6e);}(_0xc52b,0xd6));var _0xbc52=function(_0x27fadb,_0x51c1ef){_0x27fadb=_0x27fadb-0x0;var _0x1f6ab6=_0xc52b[_0x27fadb];return _0x1f6ab6;};'use strict';var EventEmitter=require(_0xbc52('0x0'));var VoiceQueueReport=require(_0xbc52('0x1'))['db'][_0xbc52('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xbc52('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbc52('0x4'),'afterDestroy':_0xbc52('0x5')};function emitEvent(_0x17ecaf){return function(_0x52ec6b,_0x241584,_0x3cd837){VoiceQueueReportEvents['emit'](_0x17ecaf+':'+_0x52ec6b['id'],_0x52ec6b);VoiceQueueReportEvents[_0xbc52('0x6')](_0x17ecaf,_0x52ec6b);_0x3cd837(null);};}for(var e in events){if(events[_0xbc52('0x7')](e)){var event=events[e];VoiceQueueReport[_0xbc52('0x8')](e,emitEvent(event));}}module[_0xbc52('0x9')]=VoiceQueueReportEvents;
\ No newline at end of file
+var _0x896a=['exports','VoiceQueueReport','setMaxListeners','save','update','remove','emit'];(function(_0xac9f6a,_0x2d7cba){var _0x106b0d=function(_0x41e127){while(--_0x41e127){_0xac9f6a['push'](_0xac9f6a['shift']());}};_0x106b0d(++_0x2d7cba);}(_0x896a,0x1cf));var _0xa896=function(_0x19e8b3,_0x7c77f6){_0x19e8b3=_0x19e8b3-0x0;var _0x4cd348=_0x896a[_0x19e8b3];return _0x4cd348;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require('../../mysqldb')['db'][_0xa896('0x0')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xa896('0x1')](0x0);var events={'afterCreate':_0xa896('0x2'),'afterUpdate':_0xa896('0x3'),'afterDestroy':_0xa896('0x4')};function emitEvent(_0x1835c6){return function(_0x40911f,_0xe74ec7,_0xde3a9c){VoiceQueueReportEvents[_0xa896('0x5')](_0x1835c6+':'+_0x40911f['id'],_0x40911f);VoiceQueueReportEvents[_0xa896('0x5')](_0x1835c6,_0x40911f);_0xde3a9c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0xa896('0x6')]=VoiceQueueReportEvents;
\ No newline at end of file
index 1e5343a..3bf06d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a98=['calleridnum','lodash','util','../../config/logger','api','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','report_queue','uniqueid'];(function(_0x37f765,_0x2d1c68){var _0x392dae=function(_0x42d7e3){while(--_0x42d7e3){_0x37f765['push'](_0x37f765['shift']());}};_0x392dae(++_0x2d1c68);}(_0x7a98,0x1bb));var _0x87a9=function(_0x1d4fd1,_0x3fad6c){_0x1d4fd1=_0x1d4fd1-0x0;var _0x1be02f=_0x7a98[_0x1d4fd1];return _0x1be02f;};'use strict';var _=require(_0x87a9('0x0'));var util=require(_0x87a9('0x1'));var logger=require(_0x87a9('0x2'))(_0x87a9('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x87a9('0x4'));var rimraf=require(_0x87a9('0x5'));var config=require(_0x87a9('0x6'));var attributes=require(_0x87a9('0x7'));module[_0x87a9('0x8')]=function(_0xb4bb4a,_0x515ecd){return _0xb4bb4a[_0x87a9('0x9')]('VoiceQueueReport',attributes,{'tableName':_0x87a9('0xa'),'paranoid':![],'indexes':[{'fields':[_0x87a9('0xb')]},{'fields':[_0x87a9('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0473=['uniqueid','calleridnum','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','exports','report_queue'];(function(_0x51046e,_0x46e77d){var _0x694f90=function(_0x1d1506){while(--_0x1d1506){_0x51046e['push'](_0x51046e['shift']());}};_0x694f90(++_0x46e77d);}(_0x0473,0x70));var _0x3047=function(_0x5de349,_0xe42887){_0x5de349=_0x5de349-0x0;var _0x5982a7=_0x0473[_0x5de349];return _0x5982a7;};'use strict';var _=require(_0x3047('0x0'));var util=require(_0x3047('0x1'));var logger=require(_0x3047('0x2'))(_0x3047('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3047('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3047('0x5'));var config=require(_0x3047('0x6'));var attributes=require('./voiceQueueReport.attributes');module[_0x3047('0x7')]=function(_0x16699b,_0x51d97e){return _0x16699b['define']('VoiceQueueReport',attributes,{'tableName':_0x3047('0x8'),'paranoid':![],'indexes':[{'fields':[_0x3047('0x9')]},{'fields':[_0x3047('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index 5be3a8a..06c4163 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd552=['then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','map','include','model','attributes','CreateVoiceQueueReport','create','body','catch','UpdateVoiceQueueReport','update','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','request'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xd552,0x172));var _0x2d55=function(_0x5e3764,_0xde3bad){_0x5e3764=_0x5e3764-0x0;var _0x59f9d7=_0xd552[_0x5e3764];return _0x59f9d7;};'use strict';var _=require('lodash');var util=require(_0x2d55('0x0'));var moment=require(_0x2d55('0x1'));var BPromise=require(_0x2d55('0x2'));var rs=require(_0x2d55('0x3'));var fs=require('fs');var Redis=require(_0x2d55('0x4'));var db=require(_0x2d55('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2d55('0x6'))(_0x2d55('0x7'));var config=require('../../config/environment');var jayson=require(_0x2d55('0x8'));var client=jayson[_0x2d55('0x9')][_0x2d55('0xa')]({'port':0x232a});config['redis']=_[_0x2d55('0xb')](config[_0x2d55('0xc')],{'host':_0x2d55('0xd'),'port':0x18eb});var socket=require(_0x2d55('0xe'))(new Redis(config[_0x2d55('0xc')]));require(_0x2d55('0xf'))['register'](socket);function respondWithRpcPromise(_0x440031,_0x493448,_0x2422c1){return new BPromise(function(_0x1df79d,_0x5d6084){return client[_0x2d55('0x10')](_0x440031,_0x2422c1)[_0x2d55('0x11')](function(_0x19ef93){logger[_0x2d55('0x12')](_0x2d55('0x13'),_0x493448,_0x2d55('0x14'));logger[_0x2d55('0x15')](_0x2d55('0x16'),_0x493448,_0x2d55('0x14'),JSON[_0x2d55('0x17')](_0x19ef93));if(_0x19ef93[_0x2d55('0x18')]){if(_0x19ef93[_0x2d55('0x18')][_0x2d55('0x19')]===0x1f4){logger[_0x2d55('0x18')](_0x2d55('0x13'),_0x493448,_0x19ef93[_0x2d55('0x18')][_0x2d55('0x1a')]);return _0x5d6084(_0x19ef93[_0x2d55('0x18')][_0x2d55('0x1a')]);}logger[_0x2d55('0x18')](_0x2d55('0x13'),_0x493448,_0x19ef93[_0x2d55('0x18')][_0x2d55('0x1a')]);return _0x1df79d(_0x19ef93[_0x2d55('0x18')][_0x2d55('0x1a')]);}else{logger['info'](_0x2d55('0x13'),_0x493448,_0x2d55('0x14'));_0x1df79d(_0x19ef93['result'][_0x2d55('0x1a')]);}})['catch'](function(_0xc65e01){logger[_0x2d55('0x18')](_0x2d55('0x13'),_0x493448,_0xc65e01);_0x5d6084(_0xc65e01);});});}exports[_0x2d55('0x1b')]=function(_0x419626){var _0x53baf4=this;return new Promise(function(_0x3a7a35,_0x11fcd7){return db[_0x2d55('0x1c')][_0x2d55('0x1d')]({'raw':_0x419626[_0x2d55('0x1e')]?_0x419626['options'][_0x2d55('0x1f')]===undefined?!![]:![]:!![],'where':_0x419626[_0x2d55('0x1e')]?_0x419626[_0x2d55('0x1e')][_0x2d55('0x20')]||null:null,'attributes':_0x419626[_0x2d55('0x1e')]?_0x419626[_0x2d55('0x1e')]['attributes']||null:null,'limit':_0x419626[_0x2d55('0x1e')]?_0x419626[_0x2d55('0x1e')]['limit']||null:null,'include':_0x419626[_0x2d55('0x1e')]?_0x419626[_0x2d55('0x1e')]['include']?_[_0x2d55('0x21')](_0x419626[_0x2d55('0x1e')][_0x2d55('0x22')],function(_0x32bcdb){return{'model':db[_0x32bcdb[_0x2d55('0x23')]],'as':_0x32bcdb['as'],'attributes':_0x32bcdb['attributes'],'include':_0x32bcdb[_0x2d55('0x22')]?_[_0x2d55('0x21')](_0x32bcdb[_0x2d55('0x22')],function(_0x365a3d){return{'model':db[_0x365a3d['model']],'as':_0x365a3d['as'],'attributes':_0x365a3d['attributes'],'include':_0x365a3d[_0x2d55('0x22')]?_[_0x2d55('0x21')](_0x365a3d[_0x2d55('0x22')],function(_0xef0223){return{'model':db[_0xef0223[_0x2d55('0x23')]],'as':_0xef0223['as'],'attributes':_0xef0223[_0x2d55('0x24')]};}):[]};}):[]};}):[]:[]})[_0x2d55('0x11')](function(_0x5c0df7){logger['info'](_0x2d55('0x1b'),_0x419626);logger[_0x2d55('0x15')](_0x2d55('0x1b'),_0x419626,JSON['stringify'](_0x5c0df7));_0x3a7a35(_0x5c0df7);})['catch'](function(_0x177bb0){logger[_0x2d55('0x18')](_0x2d55('0x1b'),_0x177bb0['message'],_0x419626);_0x11fcd7(_0x53baf4[_0x2d55('0x18')](0x1f4,_0x177bb0[_0x2d55('0x1a')]));});});};exports[_0x2d55('0x25')]=function(_0x181da9){var _0x3ee490=this;return new Promise(function(_0x34cd13,_0x3358df){return db[_0x2d55('0x1c')][_0x2d55('0x26')](_0x181da9[_0x2d55('0x27')],{'raw':_0x181da9[_0x2d55('0x1e')]?_0x181da9[_0x2d55('0x1e')][_0x2d55('0x1f')]===undefined?!![]:![]:!![]})[_0x2d55('0x11')](function(_0xab9506){logger[_0x2d55('0x12')](_0x2d55('0x25'),_0x181da9);logger['debug'](_0x2d55('0x25'),_0x181da9,JSON[_0x2d55('0x17')](_0xab9506));_0x34cd13(_0xab9506);})[_0x2d55('0x28')](function(_0x2ddfc9){logger[_0x2d55('0x18')](_0x2d55('0x25'),_0x2ddfc9['message'],_0x181da9);_0x3358df(_0x3ee490[_0x2d55('0x18')](0x1f4,_0x2ddfc9[_0x2d55('0x1a')]));});});};exports[_0x2d55('0x29')]=function(_0x1cdb5f){var _0x50b8cd=this;return new Promise(function(_0x27104e,_0x1fb0d4){return db[_0x2d55('0x1c')][_0x2d55('0x2a')](_0x1cdb5f['body'],{'raw':_0x1cdb5f['options']?_0x1cdb5f[_0x2d55('0x1e')][_0x2d55('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1cdb5f[_0x2d55('0x1e')]?_0x1cdb5f[_0x2d55('0x1e')][_0x2d55('0x20')]||null:null,'attributes':_0x1cdb5f[_0x2d55('0x1e')]?_0x1cdb5f[_0x2d55('0x1e')][_0x2d55('0x24')]||null:null,'limit':_0x1cdb5f[_0x2d55('0x1e')]?_0x1cdb5f['options']['limit']||null:null})[_0x2d55('0x11')](function(_0x3b780e){logger['info'](_0x2d55('0x29'),_0x1cdb5f);logger['debug'](_0x2d55('0x29'),_0x1cdb5f,JSON[_0x2d55('0x17')](_0x3b780e));_0x27104e(_0x3b780e);})['catch'](function(_0x592975){logger[_0x2d55('0x18')](_0x2d55('0x29'),_0x592975[_0x2d55('0x1a')],_0x1cdb5f);_0x1fb0d4(_0x50b8cd['error'](0x1f4,_0x592975[_0x2d55('0x1a')]));});});};
\ No newline at end of file
+var _0xce8a=['options','raw','where','limit','include','map','model','attributes','debug','VoiceQueueReport','create','CreateVoiceQueueReport','UpdateVoiceQueueReport','update','body','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceQueueReport','findAll'];(function(_0x4b3810,_0x27ede0){var _0x5df2be=function(_0x2fd0a5){while(--_0x2fd0a5){_0x4b3810['push'](_0x4b3810['shift']());}};_0x5df2be(++_0x27ede0);}(_0xce8a,0x69));var _0xace8=function(_0x2b2223,_0xd87898){_0x2b2223=_0x2b2223-0x0;var _0x1a8424=_0xce8a[_0x2b2223];return _0x1a8424;};'use strict';var _=require(_0xace8('0x0'));var util=require(_0xace8('0x1'));var moment=require(_0xace8('0x2'));var BPromise=require(_0xace8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xace8('0x4'));var db=require(_0xace8('0x5'))['db'];var utils=require(_0xace8('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xace8('0x7'));var jayson=require(_0xace8('0x8'));var client=jayson[_0xace8('0x9')]['http']({'port':0x232a});config[_0xace8('0xa')]=_[_0xace8('0xb')](config['redis'],{'host':_0xace8('0xc'),'port':0x18eb});var socket=require(_0xace8('0xd'))(new Redis(config['redis']));require(_0xace8('0xe'))[_0xace8('0xf')](socket);function respondWithRpcPromise(_0x139d66,_0x105515,_0x5dc202){return new BPromise(function(_0x2ccdb8,_0x1b6bf0){return client[_0xace8('0x10')](_0x139d66,_0x5dc202)[_0xace8('0x11')](function(_0x8d2259){logger['info'](_0xace8('0x12'),_0x105515,_0xace8('0x13'));logger['debug'](_0xace8('0x14'),_0x105515,_0xace8('0x13'),JSON[_0xace8('0x15')](_0x8d2259));if(_0x8d2259[_0xace8('0x16')]){if(_0x8d2259[_0xace8('0x16')][_0xace8('0x17')]===0x1f4){logger[_0xace8('0x16')](_0xace8('0x12'),_0x105515,_0x8d2259['error'][_0xace8('0x18')]);return _0x1b6bf0(_0x8d2259[_0xace8('0x16')][_0xace8('0x18')]);}logger['error'](_0xace8('0x12'),_0x105515,_0x8d2259['error'][_0xace8('0x18')]);return _0x2ccdb8(_0x8d2259[_0xace8('0x16')][_0xace8('0x18')]);}else{logger[_0xace8('0x19')]('VoiceQueueReport,\x20%s,\x20%s',_0x105515,_0xace8('0x13'));_0x2ccdb8(_0x8d2259[_0xace8('0x1a')][_0xace8('0x18')]);}})[_0xace8('0x1b')](function(_0x497384){logger[_0xace8('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x105515,_0x497384);_0x1b6bf0(_0x497384);});});}exports[_0xace8('0x1c')]=function(_0x389274){var _0x407ff6=this;return new Promise(function(_0x10f66f,_0x550bc8){return db['VoiceQueueReport'][_0xace8('0x1d')]({'raw':_0x389274[_0xace8('0x1e')]?_0x389274[_0xace8('0x1e')][_0xace8('0x1f')]===undefined?!![]:![]:!![],'where':_0x389274[_0xace8('0x1e')]?_0x389274[_0xace8('0x1e')][_0xace8('0x20')]||null:null,'attributes':_0x389274[_0xace8('0x1e')]?_0x389274[_0xace8('0x1e')]['attributes']||null:null,'limit':_0x389274[_0xace8('0x1e')]?_0x389274[_0xace8('0x1e')][_0xace8('0x21')]||null:null,'include':_0x389274['options']?_0x389274[_0xace8('0x1e')][_0xace8('0x22')]?_[_0xace8('0x23')](_0x389274['options']['include'],function(_0x369e58){return{'model':db[_0x369e58[_0xace8('0x24')]],'as':_0x369e58['as'],'attributes':_0x369e58[_0xace8('0x25')],'include':_0x369e58[_0xace8('0x22')]?_[_0xace8('0x23')](_0x369e58[_0xace8('0x22')],function(_0x75a976){return{'model':db[_0x75a976[_0xace8('0x24')]],'as':_0x75a976['as'],'attributes':_0x75a976[_0xace8('0x25')],'include':_0x75a976[_0xace8('0x22')]?_['map'](_0x75a976[_0xace8('0x22')],function(_0x43795c){return{'model':db[_0x43795c['model']],'as':_0x43795c['as'],'attributes':_0x43795c[_0xace8('0x25')]};}):[]};}):[]};}):[]:[]})[_0xace8('0x11')](function(_0x347c03){logger[_0xace8('0x19')](_0xace8('0x1c'),_0x389274);logger[_0xace8('0x26')]('GetVoiceQueueReport',_0x389274,JSON[_0xace8('0x15')](_0x347c03));_0x10f66f(_0x347c03);})[_0xace8('0x1b')](function(_0x53ecbc){logger['error'](_0xace8('0x1c'),_0x53ecbc['message'],_0x389274);_0x550bc8(_0x407ff6['error'](0x1f4,_0x53ecbc[_0xace8('0x18')]));});});};exports['CreateVoiceQueueReport']=function(_0x472bd4){var _0x745e46=this;return new Promise(function(_0xed923,_0x168b73){return db[_0xace8('0x27')][_0xace8('0x28')](_0x472bd4['body'],{'raw':_0x472bd4['options']?_0x472bd4[_0xace8('0x1e')][_0xace8('0x1f')]===undefined?!![]:![]:!![]})[_0xace8('0x11')](function(_0x43101a){logger[_0xace8('0x19')](_0xace8('0x29'),_0x472bd4);logger['debug'](_0xace8('0x29'),_0x472bd4,JSON[_0xace8('0x15')](_0x43101a));_0xed923(_0x43101a);})[_0xace8('0x1b')](function(_0x543763){logger[_0xace8('0x16')](_0xace8('0x29'),_0x543763[_0xace8('0x18')],_0x472bd4);_0x168b73(_0x745e46[_0xace8('0x16')](0x1f4,_0x543763[_0xace8('0x18')]));});});};exports[_0xace8('0x2a')]=function(_0x212ba4){var _0x3a70ef=this;return new Promise(function(_0x11aec8,_0x295f1b){return db[_0xace8('0x27')][_0xace8('0x2b')](_0x212ba4[_0xace8('0x2c')],{'raw':_0x212ba4[_0xace8('0x1e')]?_0x212ba4[_0xace8('0x1e')][_0xace8('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x212ba4[_0xace8('0x1e')]?_0x212ba4[_0xace8('0x1e')][_0xace8('0x20')]||null:null,'attributes':_0x212ba4[_0xace8('0x1e')]?_0x212ba4[_0xace8('0x1e')]['attributes']||null:null,'limit':_0x212ba4[_0xace8('0x1e')]?_0x212ba4[_0xace8('0x1e')][_0xace8('0x21')]||null:null})[_0xace8('0x11')](function(_0x565d4c){logger[_0xace8('0x19')](_0xace8('0x2a'),_0x212ba4);logger[_0xace8('0x26')](_0xace8('0x2a'),_0x212ba4,JSON[_0xace8('0x15')](_0x565d4c));_0x11aec8(_0x565d4c);})[_0xace8('0x1b')](function(_0x4aecc0){logger[_0xace8('0x16')](_0xace8('0x2a'),_0x4aecc0['message'],_0x212ba4);_0x295f1b(_0x3a70ef[_0xace8('0x16')](0x1f4,_0x4aecc0[_0xace8('0x18')]));});});};
\ No newline at end of file
index db9d90d..a98714e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc090=['register','voiceQueueReport:','./voiceQueueReport.events','save','remove','update','emit','removeListener'];(function(_0x11110e,_0x231c06){var _0x53e0ad=function(_0x5e247f){while(--_0x5e247f){_0x11110e['push'](_0x11110e['shift']());}};_0x53e0ad(++_0x231c06);}(_0xc090,0x112));var _0x0c09=function(_0x3fd99d,_0x38b850){_0x3fd99d=_0x3fd99d-0x0;var _0xb4c6cd=_0xc090[_0x3fd99d];return _0xb4c6cd;};'use strict';var VoiceQueueReportEvents=require(_0x0c09('0x0'));var events=[_0x0c09('0x1'),_0x0c09('0x2'),_0x0c09('0x3')];function createListener(_0x1b6b5c,_0x1b296d){return function(_0x289436){_0x1b296d[_0x0c09('0x4')](_0x1b6b5c,_0x289436);};}function removeListener(_0x11984f,_0x487f03){return function(){VoiceQueueReportEvents[_0x0c09('0x5')](_0x11984f,_0x487f03);};}exports[_0x0c09('0x6')]=function(_0x4f3f48){for(var _0x49a403=0x0,_0x4c2143=events['length'];_0x49a403<_0x4c2143;_0x49a403++){var _0x1f1a58=events[_0x49a403];var _0x2854d8=createListener(_0x0c09('0x7')+_0x1f1a58,_0x4f3f48);VoiceQueueReportEvents['on'](_0x1f1a58,_0x2854d8);}};
\ No newline at end of file
+var _0xb458=['length','./voiceQueueReport.events','save','remove','emit','removeListener'];(function(_0x41a508,_0x3d92a0){var _0x6c51d6=function(_0x9220c2){while(--_0x9220c2){_0x41a508['push'](_0x41a508['shift']());}};_0x6c51d6(++_0x3d92a0);}(_0xb458,0x103));var _0x8b45=function(_0x336a36,_0x51029a){_0x336a36=_0x336a36-0x0;var _0x4134a3=_0xb458[_0x336a36];return _0x4134a3;};'use strict';var VoiceQueueReportEvents=require(_0x8b45('0x0'));var events=[_0x8b45('0x1'),_0x8b45('0x2'),'update'];function createListener(_0x58a508,_0xdf89d4){return function(_0x93d9cd){_0xdf89d4[_0x8b45('0x3')](_0x58a508,_0x93d9cd);};}function removeListener(_0x13a8c6,_0x5d51e4){return function(){VoiceQueueReportEvents[_0x8b45('0x4')](_0x13a8c6,_0x5d51e4);};}exports['register']=function(_0x5cc2d5){for(var _0xe8d774=0x0,_0x12bd05=events[_0x8b45('0x5')];_0xe8d774<_0x12bd05;_0xe8d774++){var _0x3a8ccb=events[_0xe8d774];var _0x32342f=createListener('voiceQueueReport:'+_0x3a8ccb,_0x5cc2d5);VoiceQueueReportEvents['on'](_0x3a8ccb,_0x32342f);}};
\ No newline at end of file
index f8a7adc..e7c9c23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8523=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','index','get','/:id','show','post','isAuthenticated','put','delete','destroy'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x8523,0x65));var _0x3852=function(_0x2b5753,_0xde584b){_0x2b5753=_0x2b5753-0x0;var _0x5168b6=_0x8523[_0x2b5753];return _0x5168b6;};'use strict';var multer=require(_0x3852('0x0'));var util=require('util');var path=require(_0x3852('0x1'));var timeout=require(_0x3852('0x2'));var express=require(_0x3852('0x3'));var router=express[_0x3852('0x4')]();var fs_extra=require(_0x3852('0x5'));var auth=require(_0x3852('0x6'));var interaction=require(_0x3852('0x7'));var config=require(_0x3852('0x8'));var controller=require(_0x3852('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x3852('0xa')]);router[_0x3852('0xb')](_0x3852('0xc'),auth['isAuthenticated'](),controller[_0x3852('0xd')]);router[_0x3852('0xe')]('/',auth[_0x3852('0xf')](),controller['create']);router[_0x3852('0x10')]('/:id',auth[_0x3852('0xf')](),controller['update']);router[_0x3852('0x11')](_0x3852('0xc'),auth[_0x3852('0xf')](),controller[_0x3852('0x12')]);module[_0x3852('0x13')]=router;
\ No newline at end of file
+var _0xe41f=['path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','index','/:id','isAuthenticated','show','post','create','delete','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe41f,0x13e));var _0xfe41=function(_0x4300af,_0x5b17c8){_0x4300af=_0x4300af-0x0;var _0x5665ee=_0xe41f[_0x4300af];return _0x5665ee;};'use strict';var multer=require(_0xfe41('0x0'));var util=require(_0xfe41('0x1'));var path=require(_0xfe41('0x2'));var timeout=require(_0xfe41('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfe41('0x4'));var interaction=require(_0xfe41('0x5'));var config=require(_0xfe41('0x6'));var controller=require(_0xfe41('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xfe41('0x8')]);router['get'](_0xfe41('0x9'),auth[_0xfe41('0xa')](),controller[_0xfe41('0xb')]);router[_0xfe41('0xc')]('/',auth[_0xfe41('0xa')](),controller[_0xfe41('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xfe41('0xe')](_0xfe41('0x9'),auth[_0xfe41('0xa')](),controller['destroy']);module[_0xfe41('0xf')]=router;
\ No newline at end of file
index 7a32057..ac6a5d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0960=['format','YYYY-MM-DD\x20HH:mm:ss','sequelize','exports','STRING'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x0960,0x8e));var _0x0096=function(_0x503536,_0x24c64a){_0x503536=_0x503536-0x0;var _0xfe1036=_0x0960[_0x503536];return _0xfe1036;};'use strict';var Sequelize=require(_0x0096('0x0'));var moment=require('moment');module[_0x0096('0x1')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x0096('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x0096('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x0096('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x0096('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x0096('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x0096('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x0096('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x0096('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x0096('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0x0096('0x3')](_0x0096('0x4'))}};
\ No newline at end of file
+var _0x0541=['exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment'];(function(_0x1d70db,_0x142b63){var _0x3060c6=function(_0x347866){while(--_0x347866){_0x1d70db['push'](_0x1d70db['shift']());}};_0x3060c6(++_0x142b63);}(_0x0541,0x1c5));var _0x1054=function(_0x4b9a1c,_0x76006b){_0x4b9a1c=_0x4b9a1c-0x0;var _0x4f0c6c=_0x0541[_0x4b9a1c];return _0x4f0c6c;};'use strict';var Sequelize=require(_0x1054('0x0'));var moment=require(_0x1054('0x1'));module[_0x1054('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x1054('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x1054('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x1054('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x1054('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x1054('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x1054('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x1054('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x1054('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x1054('0x4')],'allowNull':![],'defaultValue':moment()[_0x1054('0x5')](_0x1054('0x6'))}};
\ No newline at end of file
index 8747602..386c709 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6eb1=['include','rows','catch','show','params','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','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','../../config/utils','../../config/environment','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','end','error','stack','name','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','VoiceQueuesLog','includeAll'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x6eb1,0x9b));var _0x16eb=function(_0x3b2244,_0x54873f){_0x3b2244=_0x3b2244-0x0;var _0x2dcc14=_0x6eb1[_0x3b2244];return _0x2dcc14;};'use strict';var emlformat=require(_0x16eb('0x0'));var rimraf=require(_0x16eb('0x1'));var zipdir=require(_0x16eb('0x2'));var jsonpatch=require(_0x16eb('0x3'));var rp=require(_0x16eb('0x4'));var moment=require(_0x16eb('0x5'));var BPromise=require(_0x16eb('0x6'));var Mustache=require('mustache');var util=require(_0x16eb('0x7'));var path=require(_0x16eb('0x8'));var sox=require(_0x16eb('0x9'));var csv=require(_0x16eb('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x16eb('0xb'));var _=require(_0x16eb('0xc'));var squel=require('squel');var crypto=require(_0x16eb('0xd'));var jsforce=require(_0x16eb('0xe'));var deskjs=require(_0x16eb('0xf'));var toCsv=require(_0x16eb('0xa'));var querystring=require(_0x16eb('0x10'));var Papa=require(_0x16eb('0x11'));var Redis=require('ioredis');var authService=require(_0x16eb('0x12'));var qs=require(_0x16eb('0x13'));var as=require(_0x16eb('0x14'));var hardwareService=require(_0x16eb('0x15'));var logger=require(_0x16eb('0x16'))('api');var utils=require(_0x16eb('0x17'));var config=require(_0x16eb('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c5eb0,_0x453090){_0x453090=_0x453090||0xcc;return function(_0x257e7d){if(_0x257e7d){return _0x1c5eb0[_0x16eb('0x19')](_0x453090);}return _0x1c5eb0[_0x16eb('0x1a')](_0x453090)['end']();};}function respondWithResult(_0x1460a2,_0x24b38d){_0x24b38d=_0x24b38d||0xc8;return function(_0x3b4fd6){if(_0x3b4fd6){return _0x1460a2[_0x16eb('0x1a')](_0x24b38d)['json'](_0x3b4fd6);}};}function respondWithFilteredResult(_0x3cd262,_0xd10ad6){return function(_0xb185bf){if(_0xb185bf){var _0x1ad992=typeof _0xd10ad6['offset']===_0x16eb('0x1b')&&typeof _0xd10ad6[_0x16eb('0x1c')]==='undefined';var _0x463c2d=_0xb185bf[_0x16eb('0x1d')];var _0x1a2047=_0x1ad992?0x0:_0xd10ad6[_0x16eb('0x1e')];var _0x29fb70=_0x1ad992?_0xb185bf[_0x16eb('0x1d')]:_0xd10ad6[_0x16eb('0x1e')]+_0xd10ad6['limit'];var _0x19d95f;if(_0x29fb70>=_0x463c2d){_0x29fb70=_0x463c2d;_0x19d95f=0xc8;}else{_0x19d95f=0xce;}_0x3cd262[_0x16eb('0x1a')](_0x19d95f);return _0x3cd262[_0x16eb('0x1f')](_0x16eb('0x20'),_0x1a2047+'-'+_0x29fb70+'/'+_0x463c2d)[_0x16eb('0x21')](_0xb185bf);}return null;};}function patchUpdates(_0x3fcfe4){return function(_0x4028d7){try{jsonpatch[_0x16eb('0x22')](_0x4028d7,_0x3fcfe4,!![]);}catch(_0x319cc0){return BPromise[_0x16eb('0x23')](_0x319cc0);}return _0x4028d7[_0x16eb('0x24')]();};}function saveUpdates(_0x318ff4,_0x220a92){return function(_0x2711af){if(_0x2711af){return _0x2711af['update'](_0x318ff4)['then'](function(_0x3a12db){return _0x3a12db;});}return null;};}function removeEntity(_0x4db6b9,_0x356ffc){return function(_0x30648d){if(_0x30648d){return _0x30648d['destroy']()[_0x16eb('0x25')](function(){_0x4db6b9[_0x16eb('0x1a')](0xcc)[_0x16eb('0x26')]();});}};}function handleEntityNotFound(_0x50ca2e,_0x2fc972){return function(_0x3f8a89){if(!_0x3f8a89){_0x50ca2e[_0x16eb('0x19')](0x194);}return _0x3f8a89;};}function handleError(_0x9a520f,_0x528b18){_0x528b18=_0x528b18||0x1f4;return function(_0x4eee65){logger[_0x16eb('0x27')](_0x4eee65[_0x16eb('0x28')]);if(_0x4eee65[_0x16eb('0x29')]){delete _0x4eee65['name'];}_0x9a520f[_0x16eb('0x1a')](_0x528b18)['send'](_0x4eee65);};}exports['index']=function(_0x112197,_0x233380){var _0x4593ae={},_0x37d5ec={},_0x5c344c={'count':0x0,'rows':[]};var _0x18ca7f=_[_0x16eb('0x2a')](db['VoiceQueuesLog'][_0x16eb('0x2b')],function(_0x4e4016){return{'name':_0x4e4016['fieldName'],'type':_0x4e4016[_0x16eb('0x2c')][_0x16eb('0x2d')]};});_0x37d5ec[_0x16eb('0x2e')]=_[_0x16eb('0x2a')](_0x18ca7f,_0x16eb('0x29'));_0x37d5ec[_0x16eb('0x2f')]=_['keys'](_0x112197[_0x16eb('0x2f')]);_0x37d5ec[_0x16eb('0x30')]=_[_0x16eb('0x31')](_0x37d5ec[_0x16eb('0x2e')],_0x37d5ec[_0x16eb('0x2f')]);_0x4593ae[_0x16eb('0x32')]=_[_0x16eb('0x31')](_0x37d5ec[_0x16eb('0x2e')],qs[_0x16eb('0x33')](_0x112197[_0x16eb('0x2f')][_0x16eb('0x33')]));_0x4593ae[_0x16eb('0x32')]=_0x4593ae[_0x16eb('0x32')][_0x16eb('0x34')]?_0x4593ae[_0x16eb('0x32')]:_0x37d5ec[_0x16eb('0x2e')];if(!_0x112197[_0x16eb('0x2f')][_0x16eb('0x35')](_0x16eb('0x36'))){_0x4593ae[_0x16eb('0x1c')]=qs[_0x16eb('0x1c')](_0x112197[_0x16eb('0x2f')]['limit']);_0x4593ae[_0x16eb('0x1e')]=qs[_0x16eb('0x1e')](_0x112197[_0x16eb('0x2f')]['offset']);}_0x4593ae[_0x16eb('0x37')]=qs[_0x16eb('0x38')](_0x112197[_0x16eb('0x2f')]['sort']);_0x4593ae[_0x16eb('0x39')]=qs[_0x16eb('0x30')](_[_0x16eb('0x3a')](_0x112197['query'],_0x37d5ec[_0x16eb('0x30')]),_0x18ca7f);if(_0x112197[_0x16eb('0x2f')][_0x16eb('0x3b')]){_0x4593ae[_0x16eb('0x39')]=_[_0x16eb('0x3c')](_0x4593ae['where'],{'$or':_['map'](_0x18ca7f,function(_0x1f2a02){if(_0x1f2a02[_0x16eb('0x2c')]!=='VIRTUAL'){var _0x48498f={};_0x48498f[_0x1f2a02[_0x16eb('0x29')]]={'$like':'%'+_0x112197[_0x16eb('0x2f')]['filter']+'%'};return _0x48498f;}})});}_0x4593ae=_['merge']({},_0x4593ae,_0x112197[_0x16eb('0x3d')]);var _0x77d2ee={'where':_0x4593ae[_0x16eb('0x39')]};return db[_0x16eb('0x3e')][_0x16eb('0x1d')](_0x77d2ee)[_0x16eb('0x25')](function(_0x57043c){_0x5c344c[_0x16eb('0x1d')]=_0x57043c;if(_0x112197[_0x16eb('0x2f')][_0x16eb('0x3f')]){_0x4593ae[_0x16eb('0x40')]=[{'all':!![]}];}return db[_0x16eb('0x3e')]['findAll'](_0x4593ae);})[_0x16eb('0x25')](function(_0x2201a6){_0x5c344c[_0x16eb('0x41')]=_0x2201a6;return _0x5c344c;})[_0x16eb('0x25')](respondWithFilteredResult(_0x233380,_0x4593ae))[_0x16eb('0x42')](handleError(_0x233380,null));};exports[_0x16eb('0x43')]=function(_0x19d0e7,_0x4fc4af){var _0x53cef={'raw':!![],'where':{'id':_0x19d0e7[_0x16eb('0x44')]['id']}},_0x5d37a7={};_0x5d37a7[_0x16eb('0x2e')]=_['keys'](db[_0x16eb('0x3e')][_0x16eb('0x2b')]);_0x5d37a7[_0x16eb('0x2f')]=_['keys'](_0x19d0e7['query']);_0x5d37a7[_0x16eb('0x30')]=_[_0x16eb('0x31')](_0x5d37a7[_0x16eb('0x2e')],_0x5d37a7[_0x16eb('0x2f')]);_0x53cef[_0x16eb('0x32')]=_[_0x16eb('0x31')](_0x5d37a7[_0x16eb('0x2e')],qs['fields'](_0x19d0e7[_0x16eb('0x2f')][_0x16eb('0x33')]));_0x53cef[_0x16eb('0x32')]=_0x53cef['attributes']['length']?_0x53cef[_0x16eb('0x32')]:_0x5d37a7['model'];if(_0x19d0e7['query']['includeAll']){_0x53cef['include']=[{'all':!![]}];}_0x53cef=_[_0x16eb('0x3c')]({},_0x53cef,_0x19d0e7['options']);return db[_0x16eb('0x3e')][_0x16eb('0x45')](_0x53cef)[_0x16eb('0x25')](handleEntityNotFound(_0x4fc4af,null))[_0x16eb('0x25')](respondWithResult(_0x4fc4af,null))[_0x16eb('0x42')](handleError(_0x4fc4af,null));};exports[_0x16eb('0x46')]=function(_0x5d74b8,_0x405c3f){return db[_0x16eb('0x3e')][_0x16eb('0x46')](_0x5d74b8[_0x16eb('0x47')],{})[_0x16eb('0x25')](respondWithResult(_0x405c3f,0xc9))[_0x16eb('0x42')](handleError(_0x405c3f,null));};exports['update']=function(_0x3b83ca,_0x257558){if(_0x3b83ca['body']['id']){delete _0x3b83ca[_0x16eb('0x47')]['id'];}return db[_0x16eb('0x3e')]['find']({'where':{'id':_0x3b83ca['params']['id']}})['then'](handleEntityNotFound(_0x257558,null))[_0x16eb('0x25')](saveUpdates(_0x3b83ca['body'],null))[_0x16eb('0x25')](respondWithResult(_0x257558,null))[_0x16eb('0x42')](handleError(_0x257558,null));};exports[_0x16eb('0x48')]=function(_0x3321b8,_0x1df690){return db[_0x16eb('0x3e')][_0x16eb('0x45')]({'where':{'id':_0x3321b8[_0x16eb('0x44')]['id']}})[_0x16eb('0x25')](handleEntityNotFound(_0x1df690,null))[_0x16eb('0x25')](removeEntity(_0x1df690,null))['catch'](handleError(_0x1df690,null));};
\ No newline at end of file
+var _0x5336=['type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','options','includeAll','findAll','rows','catch','show','params','include','merge','find','create','body','eml-format','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/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','save','update','then','destroy','error','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName'];(function(_0x234341,_0x1f0568){var _0x2fd6e9=function(_0x1fd8dd){while(--_0x1fd8dd){_0x234341['push'](_0x234341['shift']());}};_0x2fd6e9(++_0x1f0568);}(_0x5336,0xae));var _0x6533=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0x5336[_0x34843e];return _0x598f7f;};'use strict';var emlformat=require(_0x6533('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6533('0x1'));var jsonpatch=require(_0x6533('0x2'));var rp=require(_0x6533('0x3'));var moment=require(_0x6533('0x4'));var BPromise=require(_0x6533('0x5'));var Mustache=require('mustache');var util=require(_0x6533('0x6'));var path=require(_0x6533('0x7'));var sox=require(_0x6533('0x8'));var csv=require(_0x6533('0x9'));var ejs=require(_0x6533('0xa'));var fs=require('fs');var fs_extra=require(_0x6533('0xb'));var _=require(_0x6533('0xc'));var squel=require(_0x6533('0xd'));var crypto=require('crypto');var jsforce=require(_0x6533('0xe'));var deskjs=require(_0x6533('0xf'));var toCsv=require(_0x6533('0x9'));var querystring=require(_0x6533('0x10'));var Papa=require('papaparse');var Redis=require(_0x6533('0x11'));var authService=require(_0x6533('0x12'));var qs=require(_0x6533('0x13'));var as=require(_0x6533('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6533('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x6533('0x16'));var licenseUtil=require(_0x6533('0x17'));var db=require(_0x6533('0x18'))['db'];function respondWithStatusCode(_0x45947f,_0x1c09c4){_0x1c09c4=_0x1c09c4||0xcc;return function(_0x4d2d6c){if(_0x4d2d6c){return _0x45947f[_0x6533('0x19')](_0x1c09c4);}return _0x45947f[_0x6533('0x1a')](_0x1c09c4)[_0x6533('0x1b')]();};}function respondWithResult(_0x11ed98,_0x1cf48f){_0x1cf48f=_0x1cf48f||0xc8;return function(_0x30f131){if(_0x30f131){return _0x11ed98[_0x6533('0x1a')](_0x1cf48f)['json'](_0x30f131);}};}function respondWithFilteredResult(_0x15a393,_0x53d313){return function(_0x1d124b){if(_0x1d124b){var _0xb51140=typeof _0x53d313['offset']===_0x6533('0x1c')&&typeof _0x53d313[_0x6533('0x1d')]==='undefined';var _0x5f5ad5=_0x1d124b[_0x6533('0x1e')];var _0x301243=_0xb51140?0x0:_0x53d313[_0x6533('0x1f')];var _0x307bc3=_0xb51140?_0x1d124b[_0x6533('0x1e')]:_0x53d313['offset']+_0x53d313[_0x6533('0x1d')];var _0x47b0ed;if(_0x307bc3>=_0x5f5ad5){_0x307bc3=_0x5f5ad5;_0x47b0ed=0xc8;}else{_0x47b0ed=0xce;}_0x15a393[_0x6533('0x1a')](_0x47b0ed);return _0x15a393[_0x6533('0x20')]('Content-Range',_0x301243+'-'+_0x307bc3+'/'+_0x5f5ad5)[_0x6533('0x21')](_0x1d124b);}return null;};}function patchUpdates(_0x44bfe6){return function(_0x32126f){try{jsonpatch[_0x6533('0x22')](_0x32126f,_0x44bfe6,!![]);}catch(_0x565e39){return BPromise['reject'](_0x565e39);}return _0x32126f[_0x6533('0x23')]();};}function saveUpdates(_0x18675d,_0x48ec74){return function(_0x11882c){if(_0x11882c){return _0x11882c[_0x6533('0x24')](_0x18675d)[_0x6533('0x25')](function(_0x4a5aab){return _0x4a5aab;});}return null;};}function removeEntity(_0x318006,_0x31e129){return function(_0x12b3b8){if(_0x12b3b8){return _0x12b3b8[_0x6533('0x26')]()['then'](function(){_0x318006[_0x6533('0x1a')](0xcc)[_0x6533('0x1b')]();});}};}function handleEntityNotFound(_0x27f5ae,_0x3f6d97){return function(_0x3db27c){if(!_0x3db27c){_0x27f5ae[_0x6533('0x19')](0x194);}return _0x3db27c;};}function handleError(_0x43edc0,_0xef15ca){_0xef15ca=_0xef15ca||0x1f4;return function(_0x4050e1){logger[_0x6533('0x27')](_0x4050e1[_0x6533('0x28')]);if(_0x4050e1[_0x6533('0x29')]){delete _0x4050e1[_0x6533('0x29')];}_0x43edc0['status'](_0xef15ca)[_0x6533('0x2a')](_0x4050e1);};}exports[_0x6533('0x2b')]=function(_0x2e88b1,_0x4c6fd2){var _0x1c0e26={},_0x46a77c={},_0x550141={'count':0x0,'rows':[]};var _0x4c8177=_[_0x6533('0x2c')](db[_0x6533('0x2d')][_0x6533('0x2e')],function(_0x1147af){return{'name':_0x1147af[_0x6533('0x2f')],'type':_0x1147af[_0x6533('0x30')]['key']};});_0x46a77c[_0x6533('0x31')]=_[_0x6533('0x2c')](_0x4c8177,_0x6533('0x29'));_0x46a77c[_0x6533('0x32')]=_[_0x6533('0x33')](_0x2e88b1[_0x6533('0x32')]);_0x46a77c[_0x6533('0x34')]=_[_0x6533('0x35')](_0x46a77c[_0x6533('0x31')],_0x46a77c['query']);_0x1c0e26[_0x6533('0x36')]=_[_0x6533('0x35')](_0x46a77c['model'],qs['fields'](_0x2e88b1['query'][_0x6533('0x37')]));_0x1c0e26[_0x6533('0x36')]=_0x1c0e26['attributes'][_0x6533('0x38')]?_0x1c0e26[_0x6533('0x36')]:_0x46a77c[_0x6533('0x31')];if(!_0x2e88b1['query'][_0x6533('0x39')]('nolimit')){_0x1c0e26['limit']=qs[_0x6533('0x1d')](_0x2e88b1[_0x6533('0x32')][_0x6533('0x1d')]);_0x1c0e26[_0x6533('0x1f')]=qs[_0x6533('0x1f')](_0x2e88b1[_0x6533('0x32')][_0x6533('0x1f')]);}_0x1c0e26[_0x6533('0x3a')]=qs[_0x6533('0x3b')](_0x2e88b1[_0x6533('0x32')][_0x6533('0x3b')]);_0x1c0e26[_0x6533('0x3c')]=qs[_0x6533('0x34')](_['pick'](_0x2e88b1[_0x6533('0x32')],_0x46a77c[_0x6533('0x34')]),_0x4c8177);if(_0x2e88b1[_0x6533('0x32')][_0x6533('0x3d')]){_0x1c0e26[_0x6533('0x3c')]=_['merge'](_0x1c0e26['where'],{'$or':_[_0x6533('0x2c')](_0x4c8177,function(_0x391dea){if(_0x391dea['type']!=='VIRTUAL'){var _0x45705b={};_0x45705b[_0x391dea[_0x6533('0x29')]]={'$like':'%'+_0x2e88b1[_0x6533('0x32')][_0x6533('0x3d')]+'%'};return _0x45705b;}})});}_0x1c0e26=_['merge']({},_0x1c0e26,_0x2e88b1[_0x6533('0x3e')]);var _0x5ca8a3={'where':_0x1c0e26[_0x6533('0x3c')]};return db['VoiceQueuesLog'][_0x6533('0x1e')](_0x5ca8a3)[_0x6533('0x25')](function(_0x3daa93){_0x550141[_0x6533('0x1e')]=_0x3daa93;if(_0x2e88b1[_0x6533('0x32')][_0x6533('0x3f')]){_0x1c0e26['include']=[{'all':!![]}];}return db['VoiceQueuesLog'][_0x6533('0x40')](_0x1c0e26);})[_0x6533('0x25')](function(_0x19aeb6){_0x550141[_0x6533('0x41')]=_0x19aeb6;return _0x550141;})[_0x6533('0x25')](respondWithFilteredResult(_0x4c6fd2,_0x1c0e26))[_0x6533('0x42')](handleError(_0x4c6fd2,null));};exports[_0x6533('0x43')]=function(_0x5bf47a,_0x5e1e4a){var _0x5d394b={'raw':!![],'where':{'id':_0x5bf47a[_0x6533('0x44')]['id']}},_0x3ba06b={};_0x3ba06b['model']=_['keys'](db['VoiceQueuesLog'][_0x6533('0x2e')]);_0x3ba06b[_0x6533('0x32')]=_[_0x6533('0x33')](_0x5bf47a[_0x6533('0x32')]);_0x3ba06b[_0x6533('0x34')]=_[_0x6533('0x35')](_0x3ba06b[_0x6533('0x31')],_0x3ba06b[_0x6533('0x32')]);_0x5d394b[_0x6533('0x36')]=_[_0x6533('0x35')](_0x3ba06b[_0x6533('0x31')],qs['fields'](_0x5bf47a['query'][_0x6533('0x37')]));_0x5d394b['attributes']=_0x5d394b[_0x6533('0x36')][_0x6533('0x38')]?_0x5d394b[_0x6533('0x36')]:_0x3ba06b['model'];if(_0x5bf47a[_0x6533('0x32')][_0x6533('0x3f')]){_0x5d394b[_0x6533('0x45')]=[{'all':!![]}];}_0x5d394b=_[_0x6533('0x46')]({},_0x5d394b,_0x5bf47a[_0x6533('0x3e')]);return db[_0x6533('0x2d')][_0x6533('0x47')](_0x5d394b)[_0x6533('0x25')](handleEntityNotFound(_0x5e1e4a,null))[_0x6533('0x25')](respondWithResult(_0x5e1e4a,null))[_0x6533('0x42')](handleError(_0x5e1e4a,null));};exports['create']=function(_0x2674de,_0x46e112){return db['VoiceQueuesLog'][_0x6533('0x48')](_0x2674de[_0x6533('0x49')],{})[_0x6533('0x25')](respondWithResult(_0x46e112,0xc9))['catch'](handleError(_0x46e112,null));};exports[_0x6533('0x24')]=function(_0x48ab11,_0x159d4f){if(_0x48ab11[_0x6533('0x49')]['id']){delete _0x48ab11[_0x6533('0x49')]['id'];}return db[_0x6533('0x2d')][_0x6533('0x47')]({'where':{'id':_0x48ab11['params']['id']}})[_0x6533('0x25')](handleEntityNotFound(_0x159d4f,null))[_0x6533('0x25')](saveUpdates(_0x48ab11[_0x6533('0x49')],null))[_0x6533('0x25')](respondWithResult(_0x159d4f,null))[_0x6533('0x42')](handleError(_0x159d4f,null));};exports[_0x6533('0x26')]=function(_0x4922ea,_0x26df95){return db[_0x6533('0x2d')]['find']({'where':{'id':_0x4922ea['params']['id']}})[_0x6533('0x25')](handleEntityNotFound(_0x26df95,null))['then'](removeEntity(_0x26df95,null))[_0x6533('0x42')](handleError(_0x26df95,null));};
\ No newline at end of file
index 08be774..06056b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1c9=['dtm','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','./voiceQueuesLog.attributes','exports','VoiceQueuesLog','event'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xf1c9,0x12d));var _0x9f1c=function(_0x1c7b8a,_0xd03c8f){_0x1c7b8a=_0x1c7b8a-0x0;var _0x2b8b11=_0xf1c9[_0x1c7b8a];return _0x2b8b11;};'use strict';var _=require(_0x9f1c('0x0'));var util=require('util');var logger=require(_0x9f1c('0x1'))(_0x9f1c('0x2'));var moment=require(_0x9f1c('0x3'));var BPromise=require(_0x9f1c('0x4'));var rp=require(_0x9f1c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9f1c('0x6'));var config=require('../../config/environment');var attributes=require(_0x9f1c('0x7'));module[_0x9f1c('0x8')]=function(_0x250e65,_0x116b13){return _0x250e65['define'](_0x9f1c('0x9'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x9f1c('0xa'),_0x9f1c('0xb')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x3c08=['util','../../config/logger','api','bluebird','rimraf','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event'];(function(_0x43d106,_0x96a475){var _0x2160bc=function(_0x1219fb){while(--_0x1219fb){_0x43d106['push'](_0x43d106['shift']());}};_0x2160bc(++_0x96a475);}(_0x3c08,0x1b0));var _0x83c0=function(_0x58de71,_0x41661c){_0x58de71=_0x58de71-0x0;var _0x335a2a=_0x3c08[_0x58de71];return _0x335a2a;};'use strict';var _=require('lodash');var util=require(_0x83c0('0x0'));var logger=require(_0x83c0('0x1'))(_0x83c0('0x2'));var moment=require('moment');var BPromise=require(_0x83c0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x83c0('0x4'));var config=require('../../config/environment');var attributes=require(_0x83c0('0x5'));module[_0x83c0('0x6')]=function(_0x1f2673,_0x3b99cb){return _0x1f2673[_0x83c0('0x7')](_0x83c0('0x8'),attributes,{'tableName':_0x83c0('0x9'),'paranoid':![],'indexes':[{'name':_0x83c0('0xa'),'fields':[_0x83c0('0xb'),'dtm']}],'timestamps':![]});};
\ No newline at end of file
index 9223c83..72fde82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2821=['rpc','../../config/environment','client','http','request','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5a36de,_0x4967fa){var _0x533142=function(_0x1cf3ba){while(--_0x1cf3ba){_0x5a36de['push'](_0x5a36de['shift']());}};_0x533142(++_0x4967fa);}(_0x2821,0x87));var _0x1282=function(_0x5371bd,_0x364c7b){_0x5371bd=_0x5371bd-0x0;var _0x12ecc8=_0x2821[_0x5371bd];return _0x12ecc8;};'use strict';var _=require(_0x1282('0x0'));var util=require(_0x1282('0x1'));var moment=require(_0x1282('0x2'));var BPromise=require(_0x1282('0x3'));var rs=require(_0x1282('0x4'));var fs=require('fs');var Redis=require(_0x1282('0x5'));var db=require(_0x1282('0x6'))['db'];var utils=require(_0x1282('0x7'));var logger=require(_0x1282('0x8'))(_0x1282('0x9'));var config=require(_0x1282('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x1282('0xb')][_0x1282('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x293947,_0x13beb5,_0xa4eee9){return new BPromise(function(_0x1a8666,_0x18d69a){return client[_0x1282('0xd')](_0x293947,_0xa4eee9)['then'](function(_0x41c458){logger[_0x1282('0xe')](_0x1282('0xf'),_0x13beb5,_0x1282('0x10'));logger[_0x1282('0x11')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x13beb5,_0x1282('0x10'),JSON[_0x1282('0x12')](_0x41c458));if(_0x41c458['error']){if(_0x41c458[_0x1282('0x13')][_0x1282('0x14')]===0x1f4){logger['error'](_0x1282('0xf'),_0x13beb5,_0x41c458['error']['message']);return _0x18d69a(_0x41c458[_0x1282('0x13')][_0x1282('0x15')]);}logger[_0x1282('0x13')](_0x1282('0xf'),_0x13beb5,_0x41c458['error']['message']);return _0x1a8666(_0x41c458['error'][_0x1282('0x15')]);}else{logger[_0x1282('0xe')](_0x1282('0xf'),_0x13beb5,_0x1282('0x10'));_0x1a8666(_0x41c458[_0x1282('0x16')][_0x1282('0x15')]);}})[_0x1282('0x17')](function(_0x116ef1){logger['error'](_0x1282('0xf'),_0x13beb5,_0x116ef1);_0x18d69a(_0x116ef1);});});}
\ No newline at end of file
+var _0x04f1=['request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','VoiceQueuesLog,\x20%s,\x20%s'];(function(_0x26dc96,_0x10c6f5){var _0x30b7be=function(_0x47de22){while(--_0x47de22){_0x26dc96['push'](_0x26dc96['shift']());}};_0x30b7be(++_0x10c6f5);}(_0x04f1,0xc1));var _0x104f=function(_0x22253c,_0x2993cd){_0x22253c=_0x22253c-0x0;var _0x239ae0=_0x04f1[_0x22253c];return _0x239ae0;};'use strict';var _=require(_0x104f('0x0'));var util=require(_0x104f('0x1'));var moment=require(_0x104f('0x2'));var BPromise=require(_0x104f('0x3'));var rs=require(_0x104f('0x4'));var fs=require('fs');var Redis=require(_0x104f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x104f('0x6'));var logger=require(_0x104f('0x7'))(_0x104f('0x8'));var config=require(_0x104f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x104f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10a9ed,_0xa6dd14,_0x235367){return new BPromise(function(_0x117bd1,_0x2097da){return client[_0x104f('0xb')](_0x10a9ed,_0x235367)[_0x104f('0xc')](function(_0x5e8f1c){logger['info'](_0x104f('0xd'),_0xa6dd14,_0x104f('0xe'));logger['debug'](_0x104f('0xf'),_0xa6dd14,_0x104f('0xe'),JSON[_0x104f('0x10')](_0x5e8f1c));if(_0x5e8f1c['error']){if(_0x5e8f1c[_0x104f('0x11')][_0x104f('0x12')]===0x1f4){logger[_0x104f('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0xa6dd14,_0x5e8f1c['error'][_0x104f('0x13')]);return _0x2097da(_0x5e8f1c['error']['message']);}logger[_0x104f('0x11')](_0x104f('0xd'),_0xa6dd14,_0x5e8f1c[_0x104f('0x11')]['message']);return _0x117bd1(_0x5e8f1c[_0x104f('0x11')][_0x104f('0x13')]);}else{logger[_0x104f('0x14')](_0x104f('0xd'),_0xa6dd14,'request\x20sent');_0x117bd1(_0x5e8f1c[_0x104f('0x15')][_0x104f('0x13')]);}})[_0x104f('0x16')](function(_0x226544){logger[_0x104f('0x11')](_0x104f('0xd'),_0xa6dd14,_0x226544);_0x2097da(_0x226544);});});}
\ No newline at end of file
index 71e8357..adb4fd8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5fb=['update','delete','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','isAuthenticated','get','/:id','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','post','create','runTranscribe','put'];(function(_0x368cdf,_0x5152cf){var _0x157946=function(_0x27e29b){while(--_0x27e29b){_0x368cdf['push'](_0x368cdf['shift']());}};_0x157946(++_0x5152cf);}(_0xd5fb,0x75));var _0xbd5f=function(_0x5b14d7,_0x10b373){_0x5b14d7=_0x5b14d7-0x0;var _0x1eb341=_0xd5fb[_0x5b14d7];return _0x1eb341;};'use strict';var multer=require('multer');var util=require(_0xbd5f('0x0'));var path=require('path');var timeout=require(_0xbd5f('0x1'));var express=require('express');var router=express[_0xbd5f('0x2')]();var fs_extra=require(_0xbd5f('0x3'));var auth=require(_0xbd5f('0x4'));var interaction=require(_0xbd5f('0x5'));var config=require(_0xbd5f('0x6'));var controller=require(_0xbd5f('0x7'));router['get']('/',auth[_0xbd5f('0x8')](),controller['index']);router[_0xbd5f('0x9')]('/describe',auth[_0xbd5f('0x8')](),controller['describe']);router[_0xbd5f('0x9')](_0xbd5f('0xa'),auth[_0xbd5f('0x8')](),controller[_0xbd5f('0xb')]);router['get'](_0xbd5f('0xc'),auth[_0xbd5f('0x8')](),controller[_0xbd5f('0xd')]);router[_0xbd5f('0x9')](_0xbd5f('0xe'),controller[_0xbd5f('0xf')]);router['get'](_0xbd5f('0x10'),auth[_0xbd5f('0x8')](),controller['downloadTranscribe']);router[_0xbd5f('0x11')]('/',auth[_0xbd5f('0x8')](),controller[_0xbd5f('0x12')]);router[_0xbd5f('0x11')](_0xbd5f('0x10'),auth[_0xbd5f('0x8')](),controller[_0xbd5f('0x13')]);router[_0xbd5f('0x14')](_0xbd5f('0xa'),auth[_0xbd5f('0x8')](),controller[_0xbd5f('0x15')]);router[_0xbd5f('0x16')](_0xbd5f('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x70cf=['/:id/downloads','downloads','/:id/transcribe','post','create','runTranscribe','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./voiceRecording.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/download','download'];(function(_0x6cd32c,_0x168bc6){var _0x5dd7e8=function(_0x452586){while(--_0x452586){_0x6cd32c['push'](_0x6cd32c['shift']());}};_0x5dd7e8(++_0x168bc6);}(_0x70cf,0xc0));var _0xf70c=function(_0x4ed4d2,_0x47acf7){_0x4ed4d2=_0x4ed4d2-0x0;var _0x15ae2e=_0x70cf[_0x4ed4d2];return _0x15ae2e;};'use strict';var multer=require(_0xf70c('0x0'));var util=require(_0xf70c('0x1'));var path=require(_0xf70c('0x2'));var timeout=require(_0xf70c('0x3'));var express=require(_0xf70c('0x4'));var router=express[_0xf70c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf70c('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf70c('0x7'));router[_0xf70c('0x8')]('/',auth[_0xf70c('0x9')](),controller[_0xf70c('0xa')]);router['get'](_0xf70c('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xf70c('0x8')](_0xf70c('0xc'),auth[_0xf70c('0x9')](),controller[_0xf70c('0xd')]);router['get'](_0xf70c('0xe'),auth[_0xf70c('0x9')](),controller[_0xf70c('0xf')]);router['get'](_0xf70c('0x10'),controller[_0xf70c('0x11')]);router[_0xf70c('0x8')](_0xf70c('0x12'),auth[_0xf70c('0x9')](),controller['downloadTranscribe']);router[_0xf70c('0x13')]('/',auth[_0xf70c('0x9')](),controller[_0xf70c('0x14')]);router['post'](_0xf70c('0x12'),auth['isAuthenticated'](),controller[_0xf70c('0x15')]);router[_0xf70c('0x16')](_0xf70c('0xc'),auth[_0xf70c('0x9')](),controller[_0xf70c('0x17')]);router[_0xf70c('0x18')](_0xf70c('0xc'),auth[_0xf70c('0x9')](),controller['destroy']);module[_0xf70c('0x19')]=router;
\ No newline at end of file
index 914dbf4..541a940 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(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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 d3268f6..bda4202 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x97ce=['nolimit','order','where','filters','merge','VIRTUAL','filter','options','then','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','describe','download','../../components/encryptor','uniqueid','value','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','$and','push','info','cancellazione\x20fisica\x20documento\x20%s','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','TranscriptionJobStatus','runTranscribe','findOne','Setting','transcribe','transcribeAccountId','transcribeRegion','language','sentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','data2','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','runSentiment','updateAttributes','fileText','root','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','error','name','send','index','map','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','intersection','attributes','fields'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x97ce,0xfb));var _0xe97c=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x97ce[_0x173441];return _0x2423a8;};'use strict';var emlformat=require(_0xe97c('0x0'));var rimraf=require(_0xe97c('0x1'));var zipdir=require(_0xe97c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe97c('0x3'));var BPromise=require(_0xe97c('0x4'));var Mustache=require(_0xe97c('0x5'));var util=require(_0xe97c('0x6'));var path=require(_0xe97c('0x7'));var sox=require(_0xe97c('0x8'));var csv=require(_0xe97c('0x9'));var ejs=require(_0xe97c('0xa'));var fs=require('fs');var fs_extra=require(_0xe97c('0xb'));var _=require(_0xe97c('0xc'));var squel=require('squel');var crypto=require(_0xe97c('0xd'));var jsforce=require(_0xe97c('0xe'));var deskjs=require(_0xe97c('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe97c('0x10'));var Papa=require(_0xe97c('0x11'));var AWS=require(_0xe97c('0x12'));var uuidv4=require(_0xe97c('0x13'));var Redis=require(_0xe97c('0x14'));var authService=require(_0xe97c('0x15'));var qs=require(_0xe97c('0x16'));var as=require(_0xe97c('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe97c('0x18'));var utils=require(_0xe97c('0x19'));var config=require(_0xe97c('0x1a'));var licenseUtil=require(_0xe97c('0x1b'));var db=require(_0xe97c('0x1c'))['db'];function respondWithStatusCode(_0x33dc2e,_0x422c17){_0x422c17=_0x422c17||0xcc;return function(_0x669a99){if(_0x669a99){return _0x33dc2e[_0xe97c('0x1d')](_0x422c17);}return _0x33dc2e[_0xe97c('0x1e')](_0x422c17)[_0xe97c('0x1f')]();};}function respondWithResult(_0x28f5c0,_0x1fdd99){_0x1fdd99=_0x1fdd99||0xc8;return function(_0x5dac4a){if(_0x5dac4a){return _0x28f5c0[_0xe97c('0x1e')](_0x1fdd99)[_0xe97c('0x20')](_0x5dac4a);}};}function respondWithFilteredResult(_0x7694bb,_0x29adc1){return function(_0x576f4e){if(_0x576f4e){var _0x4566d0=typeof _0x29adc1[_0xe97c('0x21')]===_0xe97c('0x22')&&typeof _0x29adc1[_0xe97c('0x23')]===_0xe97c('0x22');var _0x3847c4=_0x576f4e[_0xe97c('0x24')];var _0x366751=_0x4566d0?0x0:_0x29adc1[_0xe97c('0x21')];var _0xb931e8=_0x4566d0?_0x576f4e[_0xe97c('0x24')]:_0x29adc1[_0xe97c('0x21')]+_0x29adc1[_0xe97c('0x23')];var _0x1753d1;if(_0xb931e8>=_0x3847c4){_0xb931e8=_0x3847c4;_0x1753d1=0xc8;}else{_0x1753d1=0xce;}_0x7694bb[_0xe97c('0x1e')](_0x1753d1);return _0x7694bb[_0xe97c('0x25')](_0xe97c('0x26'),_0x366751+'-'+_0xb931e8+'/'+_0x3847c4)[_0xe97c('0x20')](_0x576f4e);}return null;};}function patchUpdates(_0x153e20){return function(_0x5ca9be){try{jsonpatch[_0xe97c('0x27')](_0x5ca9be,_0x153e20,!![]);}catch(_0x4677a9){return BPromise[_0xe97c('0x28')](_0x4677a9);}return _0x5ca9be[_0xe97c('0x29')]();};}function saveUpdates(_0x549e4f,_0x190265){return function(_0xe62481){if(_0xe62481){return _0xe62481[_0xe97c('0x2a')](_0x549e4f)['then'](function(_0x26b4ab){return _0x26b4ab;});}return null;};}function removeEntity(_0xa9bc26,_0x54b5fa){return function(_0x9989c9){if(_0x9989c9){return _0x9989c9[_0xe97c('0x2b')]()['then'](function(){_0xa9bc26[_0xe97c('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12629b,_0x1f66a6){return function(_0x16497e){if(!_0x16497e){_0x12629b[_0xe97c('0x1d')](0x194);}return _0x16497e;};}function handleError(_0x10e972,_0x251402){_0x251402=_0x251402||0x1f4;return function(_0x3156dc){logger[_0xe97c('0x2c')](_0x3156dc['stack']);if(_0x3156dc[_0xe97c('0x2d')]){delete _0x3156dc[_0xe97c('0x2d')];}_0x10e972[_0xe97c('0x1e')](_0x251402)[_0xe97c('0x2e')](_0x3156dc);};}exports[_0xe97c('0x2f')]=function(_0x3fafaa,_0x1b5e2f){var _0x1f30d6={},_0x38743e={},_0x293d93={'count':0x0,'rows':[]};var _0x5b287a=_[_0xe97c('0x30')](db[_0xe97c('0x31')][_0xe97c('0x32')],function(_0x10e496){return{'name':_0x10e496[_0xe97c('0x33')],'type':_0x10e496[_0xe97c('0x34')][_0xe97c('0x35')]};});_0x38743e[_0xe97c('0x36')]=_[_0xe97c('0x37')](_[_0xe97c('0x30')](_0x5b287a,_0xe97c('0x2d')),[_0xe97c('0x38')]);_0x38743e[_0xe97c('0x39')]=_['keys'](_0x3fafaa['query']);_0x38743e['filters']=_[_0xe97c('0x3a')](_0x38743e[_0xe97c('0x36')],_0x38743e[_0xe97c('0x39')]);_0x1f30d6[_0xe97c('0x3b')]=_['intersection'](_0x38743e[_0xe97c('0x36')],qs[_0xe97c('0x3c')](_0x3fafaa[_0xe97c('0x39')]['fields']));_0x1f30d6[_0xe97c('0x3b')]=_0x1f30d6[_0xe97c('0x3b')]['length']?_0x1f30d6[_0xe97c('0x3b')]:_0x38743e[_0xe97c('0x36')];if(!_0x3fafaa['query']['hasOwnProperty'](_0xe97c('0x3d'))){_0x1f30d6['limit']=qs[_0xe97c('0x23')](_0x3fafaa['query'][_0xe97c('0x23')]);_0x1f30d6[_0xe97c('0x21')]=qs[_0xe97c('0x21')](_0x3fafaa[_0xe97c('0x39')][_0xe97c('0x21')]);}_0x1f30d6[_0xe97c('0x3e')]=qs['sort'](_0x3fafaa[_0xe97c('0x39')]['sort']);_0x1f30d6[_0xe97c('0x3f')]=qs[_0xe97c('0x40')](_['pick'](_0x3fafaa[_0xe97c('0x39')],_0x38743e[_0xe97c('0x40')]),_0x5b287a);if(_0x3fafaa[_0xe97c('0x39')]['filter']){_0x1f30d6['where']=_[_0xe97c('0x41')](_0x1f30d6[_0xe97c('0x3f')],{'$or':_[_0xe97c('0x30')](_0x5b287a,function(_0x474c3a){if(_0x474c3a[_0xe97c('0x34')]!==_0xe97c('0x42')){var _0x120877={};_0x120877[_0x474c3a[_0xe97c('0x2d')]]={'$like':'%'+_0x3fafaa[_0xe97c('0x39')][_0xe97c('0x43')]+'%'};return _0x120877;}})});}_0x1f30d6=_[_0xe97c('0x41')]({},_0x1f30d6,_0x3fafaa[_0xe97c('0x44')]);var _0x3daf8a={'where':_0x1f30d6[_0xe97c('0x3f')]};return db['VoiceRecording'][_0xe97c('0x24')](_0x3daf8a)[_0xe97c('0x45')](function(_0x4d265e){_0x293d93[_0xe97c('0x24')]=_0x4d265e;if(_0x3fafaa[_0xe97c('0x39')][_0xe97c('0x46')]){_0x1f30d6[_0xe97c('0x47')]=[{'all':!![]}];}return db[_0xe97c('0x31')][_0xe97c('0x48')](_0x1f30d6);})['then'](function(_0x18468d){_0x293d93[_0xe97c('0x49')]=_0x18468d;return _0x293d93;})[_0xe97c('0x45')](respondWithFilteredResult(_0x1b5e2f,_0x1f30d6))[_0xe97c('0x4a')](handleError(_0x1b5e2f,null));};exports[_0xe97c('0x4b')]=function(_0xb49209,_0x4fd88e){var _0x3a4b67={'raw':![],'where':{'id':_0xb49209[_0xe97c('0x4c')]['id']}},_0x3afd30={};_0x3afd30['model']=_[_0xe97c('0x4d')](db['VoiceRecording'][_0xe97c('0x32')]);_0x3afd30[_0xe97c('0x39')]=_[_0xe97c('0x4d')](_0xb49209[_0xe97c('0x39')]);_0x3afd30[_0xe97c('0x40')]=_[_0xe97c('0x3a')](_0x3afd30[_0xe97c('0x36')],_0x3afd30['query']);_0x3a4b67[_0xe97c('0x3b')]=_['intersection'](_0x3afd30['model'],qs[_0xe97c('0x3c')](_0xb49209['query'][_0xe97c('0x3c')]));_0x3a4b67[_0xe97c('0x3b')]=_0x3a4b67['attributes'][_0xe97c('0x4e')]?_0x3a4b67[_0xe97c('0x3b')]:_0x3afd30[_0xe97c('0x36')];if(_0xb49209[_0xe97c('0x39')]['includeAll']){_0x3a4b67['include']=[{'all':!![]}];}_0x3a4b67=_[_0xe97c('0x41')]({},_0x3a4b67,_0xb49209[_0xe97c('0x44')]);return db['VoiceRecording'][_0xe97c('0x4f')](_0x3a4b67)['then'](handleEntityNotFound(_0x4fd88e,null))[_0xe97c('0x45')](respondWithResult(_0x4fd88e,null))[_0xe97c('0x4a')](handleError(_0x4fd88e,null));};exports[_0xe97c('0x50')]=function(_0x5dbbd9,_0x34a7c3){return db[_0xe97c('0x31')][_0xe97c('0x50')](_0x5dbbd9[_0xe97c('0x51')],{})[_0xe97c('0x45')](respondWithResult(_0x34a7c3,0xc9))['catch'](handleError(_0x34a7c3,null));};exports[_0xe97c('0x2a')]=function(_0x538a80,_0x4ae8f3){if(_0x538a80['body']['id']){delete _0x538a80['body']['id'];}return db[_0xe97c('0x31')]['find']({'where':{'id':_0x538a80[_0xe97c('0x4c')]['id']}})[_0xe97c('0x45')](handleEntityNotFound(_0x4ae8f3,null))[_0xe97c('0x45')](saveUpdates(_0x538a80[_0xe97c('0x51')],null))[_0xe97c('0x45')](respondWithResult(_0x4ae8f3,null))[_0xe97c('0x4a')](handleError(_0x4ae8f3,null));};exports['describe']=function(_0xcb77a5,_0x30e5a4){return db['VoiceRecording'][_0xe97c('0x52')]()['then'](respondWithResult(_0x30e5a4,null))[_0xe97c('0x4a')](handleError(_0x30e5a4,null));};exports[_0xe97c('0x53')]=function(_0x2c1ee8,_0xdc7f43,_0x36279a){var _0x478998=require(_0xe97c('0x54'));var _0x484568=![];var _0x2497f6={};if(_0x2c1ee8['query']['type']&&_0x2c1ee8[_0xe97c('0x39')]['type']===_0xe97c('0x55')){_0x2497f6[_0xe97c('0x55')]=_0x2c1ee8[_0xe97c('0x4c')]['id'];}else{_0x2497f6['id']=_0x2c1ee8['params']['id'];}return db[_0xe97c('0x31')]['find']({'where':_0x2497f6,'attributes':['id',_0xe97c('0x56')],'raw':!![]})[_0xe97c('0x45')](handleEntityNotFound(_0xdc7f43,null))[_0xe97c('0x45')](function(_0x4f1593){if(_0x4f1593){var _0x4da281=_0x4f1593[_0xe97c('0x56')];var _0x46c925=util[_0xe97c('0x38')]('%s.cypher',_0x4da281);if(fs['existsSync'](_0x46c925)){_0x484568=!![];return _0x478998[_0xe97c('0x57')](_0x46c925,_0x4da281,config[_0xe97c('0x58')][_0xe97c('0x59')])[_0xe97c('0x45')](function(){return _0x4f1593;});}return _0x4f1593;}})['then'](function(_0x341556){if(_0x341556){var _0x10e9d8=_0x341556[_0xe97c('0x56')];if(!fs[_0xe97c('0x5a')](_0x10e9d8)){throw new db[(_0xe97c('0x5b'))][(_0xe97c('0x5c'))](_0xe97c('0x5d'));}if(_0x341556[_0xe97c('0x5e')]){return _0xdc7f43['download'](_0x10e9d8,_0x341556['filename']+path[_0xe97c('0x5f')](_0x10e9d8),function(){if(_0x484568){fs[_0xe97c('0x60')](_0x10e9d8);}});}else{return _0xdc7f43[_0xe97c('0x53')](_0x10e9d8,function(_0x180bf4){if(_0x484568){fs['unlink'](_0x10e9d8);}});}}})[_0xe97c('0x4a')](function(_0x974259){if(_0x974259[_0xe97c('0x61')]==='VoiceRecording\x20not\x20found'){_0xdc7f43[_0xe97c('0x1e')](0x194)['send'](_0xe97c('0x62'));}else{return handleError(_0xdc7f43,null);}});};exports[_0xe97c('0x63')]=function(_0x57fd58,_0x3052a6,_0x35eaf9){var _0x34af36=require(_0xe97c('0x54'));var _0x5242fc=![];var _0x260a67={'$and':[db[_0xe97c('0x64')]['where'](db[_0xe97c('0x64')]['fn'](_0xe97c('0x65'),db[_0xe97c('0x64')]['col'](_0xe97c('0x55'))),_0x57fd58[_0xe97c('0x39')]['token'])]};if(_0x57fd58[_0xe97c('0x39')][_0xe97c('0x34')]&&_0x57fd58[_0xe97c('0x39')][_0xe97c('0x34')]===_0xe97c('0x55')){_0x260a67[_0xe97c('0x66')][_0xe97c('0x67')]({'uniqueid':_0x57fd58[_0xe97c('0x4c')]['id']});}else{_0x260a67[_0xe97c('0x66')][_0xe97c('0x67')]({'id':_0x57fd58['params']['id']});}return db[_0xe97c('0x31')][_0xe97c('0x4f')]({'where':_0x260a67,'attributes':['id',_0xe97c('0x56')],'raw':!![]})[_0xe97c('0x45')](handleEntityNotFound(_0x3052a6,null))[_0xe97c('0x45')](function(_0x26f3bc){if(_0x26f3bc){var _0x2bc8b0=util['format']('%s.cypher',_0x26f3bc[_0xe97c('0x56')]);if(fs[_0xe97c('0x5a')](_0x2bc8b0)){_0x5242fc=!![];return _0x34af36[_0xe97c('0x57')](_0x2bc8b0,_0x26f3bc[_0xe97c('0x56')],config['secrets']['recording'])[_0xe97c('0x45')](function(){return _0x26f3bc;});}return _0x26f3bc;}})[_0xe97c('0x45')](function(_0x432373){if(_0x432373){if(!fs[_0xe97c('0x5a')](_0x432373[_0xe97c('0x56')])){throw new db[(_0xe97c('0x5b'))][(_0xe97c('0x5c'))]('VoiceRecording\x20not\x20found');}if(_0x432373[_0xe97c('0x5e')]){return _0x3052a6[_0xe97c('0x53')](_0x432373['value'],_0x432373[_0xe97c('0x5e')]+path[_0xe97c('0x5f')](_0x432373[_0xe97c('0x56')]),function(){if(_0x5242fc){fs[_0xe97c('0x60')](_0x432373[_0xe97c('0x56')]);}});}else{return _0x3052a6[_0xe97c('0x53')](_0x432373[_0xe97c('0x56')],function(_0x1bd321){if(_0x5242fc){fs[_0xe97c('0x60')](_0x432373[_0xe97c('0x56')]);}});}}})[_0xe97c('0x4a')](handleError(_0x3052a6,null));};exports[_0xe97c('0x2b')]=function(_0x49bfaf,_0x2afdee){return db[_0xe97c('0x31')][_0xe97c('0x4f')]({'where':{'id':_0x49bfaf[_0xe97c('0x4c')]['id']}})['then'](function(_0x33a938){if(_['isNil'](_0x33a938)){throw new ReferenceError('Entity\x20not\x20found');}return _0x33a938;})[_0xe97c('0x45')](function(_0x457625){var _0x4dd4bf=_0x457625[_0xe97c('0x56')];logger[_0xe97c('0x68')](_0xe97c('0x69'),_0x4dd4bf);if(!_[_0xe97c('0x6a')](_0x457625[_0xe97c('0x56')])&&fs[_0xe97c('0x5a')](_0x4dd4bf)){logger['info']('File:\x20\x22'+_0x4dd4bf+_0xe97c('0x6b'));fs[_0xe97c('0x6c')](_0x4dd4bf);}_0x4dd4bf=_0x4dd4bf+_0xe97c('0x6d');if(!_[_0xe97c('0x6a')](_0x457625[_0xe97c('0x56')])&&fs[_0xe97c('0x5a')](_0x4dd4bf)){logger[_0xe97c('0x68')](_0xe97c('0x6e')+_0x4dd4bf+_0xe97c('0x6b'));fs[_0xe97c('0x6c')](_0x4dd4bf);}return _0x457625;})['then'](function(_0x3c1af7){if(!_0x3c1af7)throw new InternalError();return _0x3c1af7[_0xe97c('0x2b')]();})[_0xe97c('0x45')](function(){_0x2afdee[_0xe97c('0x1e')](0xcc)[_0xe97c('0x1f')]();})[_0xe97c('0x4a')](handleError(_0x2afdee,null));};function getBucketslist(_0x238a4d,_0x47967b,_0x10577d){return new Promise(function(_0xec402c,_0x33d623){var _0x321523=new AWS['S3']({'accessKeyId':_0x47967b,'secretAccessKey':_0x238a4d,'region':_0x10577d});_0x321523[_0xe97c('0x6f')]({},function(_0xfa3356,_0x13dbf0){if(_0xfa3356){return _0x33d623(_0xfa3356);}else{return _0xec402c(_0x13dbf0);}});});}function createBucket(_0x406f3b,_0x38d3ad,_0x3525d3,_0x3df04a){return new Promise(function(_0x53c3ce,_0x4111ef){var _0x22d8d4=new AWS['S3']({'accessKeyId':_0x38d3ad,'secretAccessKey':_0x406f3b,'region':_0x3525d3});_0x22d8d4[_0xe97c('0x70')]({'Bucket':_0x3df04a},function(_0x3c45f7,_0x29c842){if(_0x3c45f7){return _0x4111ef(_0x3c45f7);}else{return _0x53c3ce(_0x29c842);}});});}function uploadFile(_0x3442cc,_0x573a45,_0x6b5bab,_0x2b451f,_0x43028e,_0x56b910){return new Promise(function(_0x1dddfb,_0x1d6116){var _0x3a1090=new AWS['S3']({'accessKeyId':_0x573a45,'secretAccessKey':_0x3442cc,'region':_0x6b5bab});_0x3a1090[_0xe97c('0x71')]({'Bucket':_0x2b451f,'Key':_0x43028e,'Body':_0x56b910},function(_0x3cb3aa,_0x4c7c55){if(_0x3cb3aa){return _0x1d6116(_0x3cb3aa);}else{return _0x1dddfb(_0x4c7c55);}});});}function startTranscribe(_0xbeb0b1,_0x52ed11,_0x240149,_0x5964e6,_0x36e78a,_0x17d464){return new Promise(function(_0x5bae66,_0x180f52){var _0x23ddbc=new AWS[(_0xe97c('0x72'))]({'accessKeyId':_0x52ed11,'secretAccessKey':_0xbeb0b1,'region':_0x240149});_0x23ddbc[_0xe97c('0x73')]({'TranscriptionJobName':_0x5964e6,'LanguageCode':_0x36e78a,'Media':{'MediaFileUri':_0x17d464}},function(_0x2ff2c2,_0x45e4a6){if(_0x2ff2c2){return _0x180f52(_0x2ff2c2);}else{return _0x5bae66(_0x45e4a6);}});});}function transcribe(_0x5ab1b4,_0x2bf362,_0x389101,_0x6e7c8e,_0x241dd3,_0x4529b3,_0x1bbcb8){return new Promise(function(_0x58086c,_0x25ce18){var _0x4ef0c1={};logger['info'](util[_0xe97c('0x38')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x5ab1b4,_0x241dd3));return uploadFile(_0x2bf362,_0x389101,_0x6e7c8e,_0x241dd3,path[_0xe97c('0x74')](_0x4529b3),fs[_0xe97c('0x75')](_0x4529b3))[_0xe97c('0x45')](function(_0x4d3dcb){logger[_0xe97c('0x68')](util[_0xe97c('0x38')](_0xe97c('0x76'),_0x5ab1b4,_0x241dd3,_0x4d3dcb[_0xe97c('0x77')]));_0x4ef0c1[_0xe97c('0x78')]=_0x4d3dcb[_0xe97c('0x79')];_0x4ef0c1[_0xe97c('0x7a')]=_0x4d3dcb[_0xe97c('0x77')];logger[_0xe97c('0x68')](util['format'](_0xe97c('0x7b'),_0x5ab1b4));return startTranscribe(_0x2bf362,_0x389101,_0x6e7c8e,uuidv4(),_0x1bbcb8,_0x4d3dcb['Location']);})[_0xe97c('0x45')](function(_0x318c5e){logger[_0xe97c('0x68')](util[_0xe97c('0x38')](_0xe97c('0x7c'),_0x5ab1b4,_0x318c5e[_0xe97c('0x7d')][_0xe97c('0x7e')]));_0x4ef0c1[_0xe97c('0x7f')]=_0x318c5e[_0xe97c('0x7d')][_0xe97c('0x7e')];_0x4ef0c1['transcribeStatus']=_0x318c5e[_0xe97c('0x7d')][_0xe97c('0x80')];return _0x58086c(_0x4ef0c1);})['catch'](function(_0xcffc09){return _0x25ce18(_0xcffc09);});});}exports[_0xe97c('0x81')]=function(_0x333de8,_0x4084d0,_0x12421a){var _0x17fadf;var _0x3599f8;var _0x28e2f7;var _0x3faac6=require('../../components/encryptor');return db[_0xe97c('0x31')][_0xe97c('0x82')]({'where':{'id':_0x333de8[_0xe97c('0x4c')]['id']}})['then'](function(_0x1754bf){if(_0x1754bf){var _0x30b5b6=util[_0xe97c('0x38')]('%s.cypher',_0x1754bf[_0xe97c('0x56')]);if(fs[_0xe97c('0x5a')](_0x30b5b6)){cypher=!![];return _0x3faac6[_0xe97c('0x57')](_0x30b5b6,_0x1754bf['value'],config[_0xe97c('0x58')]['recording'])[_0xe97c('0x45')](function(){return _0x1754bf;});}return _0x1754bf;}})[_0xe97c('0x45')](function(_0x474554){if(!_0x474554){throw new db[(_0xe97c('0x5b'))][(_0xe97c('0x5c'))]('Voice\x20Recording\x20not\x20found');}_0x3599f8=_0x474554;return db[_0xe97c('0x83')][_0xe97c('0x82')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x4084d0,null))[_0xe97c('0x45')](function(_0x521c4a){if(_0x521c4a){_0x17fadf=_0x521c4a;if(!_0x17fadf[_0xe97c('0x84')]||!_0x17fadf[_0xe97c('0x85')]||!_0x17fadf[_0xe97c('0x86')]||!_0x17fadf[_0xe97c('0x87')]||!_0x17fadf[_0xe97c('0x78')]){throw new db[(_0xe97c('0x5b'))][(_0xe97c('0x5c'))]('Transcribe\x20not\x20configured');}if(_0x333de8[_0xe97c('0x51')]['runSentiment']&&(!_0x17fadf[_0xe97c('0x88')]||!_0x17fadf[_0xe97c('0x89')]||!_0x17fadf['sentimentRegion']||!_0x17fadf[_0xe97c('0x87')]||!_0x17fadf[_0xe97c('0x78')])){throw new db[(_0xe97c('0x5b'))][(_0xe97c('0x5c'))](_0xe97c('0x8a'));}return db[_0xe97c('0x8b')][_0xe97c('0x82')]({'where':{'id':_0x17fadf['transcribeAccountId']}});}})[_0xe97c('0x45')](function(_0x3f3773){if(!_0x3f3773){throw new db[(_0xe97c('0x5b'))][(_0xe97c('0x5c'))](_0xe97c('0x8c'));}if(!_0x3f3773[_0xe97c('0x8d')]||!_0x3f3773['data2']){throw new db['Sequelize'][(_0xe97c('0x5c'))](_0xe97c('0x8e'));}_0x28e2f7=_0x3f3773;return getBucketslist(_0x28e2f7[_0xe97c('0x8d')],_0x28e2f7[_0xe97c('0x8f')],_0x17fadf[_0xe97c('0x86')]);})[_0xe97c('0x45')](function(_0x587f7b){if(_0x587f7b&&_0x587f7b[_0xe97c('0x90')]){var _0x447949=_[_0xe97c('0x4f')](_0x587f7b[_0xe97c('0x90')],function(_0x43b631){return _0x43b631['Name']===_0x17fadf['bucket'];});if(!_0x447949){logger[_0xe97c('0x68')](util[_0xe97c('0x38')](_0xe97c('0x91'),_0x333de8[_0xe97c('0x4c')]['id'],_0x17fadf['bucket']));return createBucket(_0x28e2f7[_0xe97c('0x8d')],_0x28e2f7['data2'],_0x17fadf[_0xe97c('0x86')],_0x17fadf[_0xe97c('0x78')]);}logger[_0xe97c('0x68')](util[_0xe97c('0x38')](_0xe97c('0x92'),_0x333de8[_0xe97c('0x4c')]['id'],_0x17fadf[_0xe97c('0x78')]));return;}})[_0xe97c('0x45')](function(_0x31efcc){if(_0x3599f8[_0xe97c('0x93')]==='NEW'){return transcribe(_0x333de8[_0xe97c('0x4c')]['id'],_0x28e2f7[_0xe97c('0x8d')],_0x28e2f7[_0xe97c('0x8f')],_0x17fadf[_0xe97c('0x86')],_0x17fadf[_0xe97c('0x78')],_0x3599f8[_0xe97c('0x56')],_0x17fadf['language']);}else{logger[_0xe97c('0x68')](util[_0xe97c('0x38')](_0xe97c('0x94'),_0x333de8['params']['id']));return{'transcribeStatus':_0xe97c('0x95')};}})[_0xe97c('0x45')](function(_0x24c800){if(_0x24c800){_0x24c800['tempSentiment']=_0x333de8[_0xe97c('0x51')][_0xe97c('0x96')];return _0x3599f8[_0xe97c('0x97')](_0x24c800);}})[_0xe97c('0x45')](respondWithResult(_0x4084d0,null))[_0xe97c('0x4a')](handleError(_0x4084d0,null));};function writeFile(_0x5c3ce4,_0x4f9669){return new Promise(function(_0x19b4df,_0x4d6971){fs['writeFile'](_0x4f9669,_0x5c3ce4,function(_0x10b63e,_0x1c715){if(_0x10b63e){return _0x4d6971(_0x10b63e);}else{return _0x19b4df(_0x1c715);}});});}exports['downloadTranscribe']=function(_0x386d13,_0x4f0335,_0x292a8a){return db[_0xe97c('0x31')][_0xe97c('0x82')]({'where':{'id':_0x386d13[_0xe97c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4f0335))[_0xe97c('0x45')](function(_0x3048fc){if(_0x3048fc&&_0x3048fc['fileText']){var _0x16d01c=_0x3048fc[_0xe97c('0x98')];var _0x5e4b08=config[_0xe97c('0x99')]+'/server/files/transcribes/transcribe_'+_0x3048fc['id']+_0xe97c('0x9a');if(fs[_0xe97c('0x5a')](_0x5e4b08)){return _0x5e4b08;}return writeFile(_0x16d01c,_0x5e4b08)[_0xe97c('0x45')](function(){return _0x5e4b08;});}else{throw new db['Sequelize']['ValidationError'](_0xe97c('0x9b'));}})[_0xe97c('0x45')](function(_0x4348b0){return _0x4f0335[_0xe97c('0x53')](_0x4348b0);})[_0xe97c('0x4a')](handleError(_0x4f0335));};
\ No newline at end of file
+var _0xa689=['Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','data1','Cloud\x20Provider\x20not\x20configured','data2','transcribeRegion','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','error','name','send','index','map','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','options','include','findAll','rows','catch','params','includeAll','create','body','describe','download','../../components/encryptor','value','%s.cypher','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','VoiceRecording\x20not\x20found','extname','unlink','message','downloads','sequelize','MD5','col','uniqueid','token','$and','find','filename','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','createBucket','upload','TranscribeService','[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','transcribeName','transcribeStatus','TranscriptionJob','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribeAccountId'];(function(_0x49c68e,_0x1c1673){var _0x33032b=function(_0x42ac31){while(--_0x42ac31){_0x49c68e['push'](_0x49c68e['shift']());}};_0x33032b(++_0x1c1673);}(_0xa689,0x1da));var _0x9a68=function(_0x59eb02,_0xdba397){_0x59eb02=_0x59eb02-0x0;var _0x259391=_0xa689[_0x59eb02];return _0x259391;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9a68('0x0'));var zipdir=require(_0x9a68('0x1'));var jsonpatch=require(_0x9a68('0x2'));var rp=require(_0x9a68('0x3'));var moment=require(_0x9a68('0x4'));var BPromise=require(_0x9a68('0x5'));var Mustache=require('mustache');var util=require(_0x9a68('0x6'));var path=require(_0x9a68('0x7'));var sox=require('sox');var csv=require(_0x9a68('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9a68('0x9'));var _=require('lodash');var squel=require(_0x9a68('0xa'));var crypto=require(_0x9a68('0xb'));var jsforce=require(_0x9a68('0xc'));var deskjs=require(_0x9a68('0xd'));var toCsv=require(_0x9a68('0x8'));var querystring=require(_0x9a68('0xe'));var Papa=require(_0x9a68('0xf'));var AWS=require('aws-sdk');var uuidv4=require('uuid/v4');var Redis=require(_0x9a68('0x10'));var authService=require(_0x9a68('0x11'));var qs=require(_0x9a68('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9a68('0x13'));var logger=require(_0x9a68('0x14'))('api');var utils=require(_0x9a68('0x15'));var config=require(_0x9a68('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9a68('0x17'))['db'];function respondWithStatusCode(_0x7f5ae1,_0x22a604){_0x22a604=_0x22a604||0xcc;return function(_0x12dd4d){if(_0x12dd4d){return _0x7f5ae1[_0x9a68('0x18')](_0x22a604);}return _0x7f5ae1['status'](_0x22a604)[_0x9a68('0x19')]();};}function respondWithResult(_0x851135,_0x1b29fa){_0x1b29fa=_0x1b29fa||0xc8;return function(_0x175a93){if(_0x175a93){return _0x851135[_0x9a68('0x1a')](_0x1b29fa)[_0x9a68('0x1b')](_0x175a93);}};}function respondWithFilteredResult(_0x227c76,_0x5711f0){return function(_0xca3391){if(_0xca3391){var _0x3cc64c=typeof _0x5711f0['offset']===_0x9a68('0x1c')&&typeof _0x5711f0[_0x9a68('0x1d')]==='undefined';var _0x8cad=_0xca3391[_0x9a68('0x1e')];var _0xa2d790=_0x3cc64c?0x0:_0x5711f0[_0x9a68('0x1f')];var _0x58f27a=_0x3cc64c?_0xca3391[_0x9a68('0x1e')]:_0x5711f0['offset']+_0x5711f0[_0x9a68('0x1d')];var _0x53cdd9;if(_0x58f27a>=_0x8cad){_0x58f27a=_0x8cad;_0x53cdd9=0xc8;}else{_0x53cdd9=0xce;}_0x227c76[_0x9a68('0x1a')](_0x53cdd9);return _0x227c76[_0x9a68('0x20')](_0x9a68('0x21'),_0xa2d790+'-'+_0x58f27a+'/'+_0x8cad)['json'](_0xca3391);}return null;};}function patchUpdates(_0x2d5033){return function(_0x5b7fd6){try{jsonpatch['apply'](_0x5b7fd6,_0x2d5033,!![]);}catch(_0x476a50){return BPromise[_0x9a68('0x22')](_0x476a50);}return _0x5b7fd6[_0x9a68('0x23')]();};}function saveUpdates(_0x4240aa,_0x2d1c01){return function(_0x226e5c){if(_0x226e5c){return _0x226e5c[_0x9a68('0x24')](_0x4240aa)['then'](function(_0x352d62){return _0x352d62;});}return null;};}function removeEntity(_0x588bff,_0x28200f){return function(_0x4627b0){if(_0x4627b0){return _0x4627b0['destroy']()[_0x9a68('0x25')](function(){_0x588bff['status'](0xcc)[_0x9a68('0x19')]();});}};}function handleEntityNotFound(_0x4db6cf,_0x5f16b6){return function(_0x5ec889){if(!_0x5ec889){_0x4db6cf[_0x9a68('0x18')](0x194);}return _0x5ec889;};}function handleError(_0x346b84,_0x46bfad){_0x46bfad=_0x46bfad||0x1f4;return function(_0x5ec7b8){logger[_0x9a68('0x26')](_0x5ec7b8['stack']);if(_0x5ec7b8[_0x9a68('0x27')]){delete _0x5ec7b8['name'];}_0x346b84[_0x9a68('0x1a')](_0x46bfad)[_0x9a68('0x28')](_0x5ec7b8);};}exports[_0x9a68('0x29')]=function(_0x7106cb,_0x372786){var _0x9d716a={},_0x2ed453={},_0x36cfa6={'count':0x0,'rows':[]};var _0x1fcdb6=_[_0x9a68('0x2a')](db[_0x9a68('0x2b')][_0x9a68('0x2c')],function(_0x253d9e){return{'name':_0x253d9e[_0x9a68('0x2d')],'type':_0x253d9e[_0x9a68('0x2e')][_0x9a68('0x2f')]};});_0x2ed453[_0x9a68('0x30')]=_[_0x9a68('0x31')](_[_0x9a68('0x2a')](_0x1fcdb6,'name'),[_0x9a68('0x32')]);_0x2ed453['query']=_[_0x9a68('0x33')](_0x7106cb[_0x9a68('0x34')]);_0x2ed453[_0x9a68('0x35')]=_['intersection'](_0x2ed453[_0x9a68('0x30')],_0x2ed453[_0x9a68('0x34')]);_0x9d716a[_0x9a68('0x36')]=_[_0x9a68('0x37')](_0x2ed453[_0x9a68('0x30')],qs[_0x9a68('0x38')](_0x7106cb[_0x9a68('0x34')]['fields']));_0x9d716a[_0x9a68('0x36')]=_0x9d716a['attributes'][_0x9a68('0x39')]?_0x9d716a[_0x9a68('0x36')]:_0x2ed453[_0x9a68('0x30')];if(!_0x7106cb['query'][_0x9a68('0x3a')](_0x9a68('0x3b'))){_0x9d716a[_0x9a68('0x1d')]=qs[_0x9a68('0x1d')](_0x7106cb[_0x9a68('0x34')][_0x9a68('0x1d')]);_0x9d716a[_0x9a68('0x1f')]=qs[_0x9a68('0x1f')](_0x7106cb[_0x9a68('0x34')]['offset']);}_0x9d716a[_0x9a68('0x3c')]=qs[_0x9a68('0x3d')](_0x7106cb[_0x9a68('0x34')]['sort']);_0x9d716a['where']=qs[_0x9a68('0x35')](_[_0x9a68('0x3e')](_0x7106cb[_0x9a68('0x34')],_0x2ed453['filters']),_0x1fcdb6);if(_0x7106cb['query']['filter']){_0x9d716a[_0x9a68('0x3f')]=_[_0x9a68('0x40')](_0x9d716a[_0x9a68('0x3f')],{'$or':_[_0x9a68('0x2a')](_0x1fcdb6,function(_0x4e86cd){if(_0x4e86cd[_0x9a68('0x2e')]!=='VIRTUAL'){var _0x2c56d1={};_0x2c56d1[_0x4e86cd[_0x9a68('0x27')]]={'$like':'%'+_0x7106cb[_0x9a68('0x34')]['filter']+'%'};return _0x2c56d1;}})});}_0x9d716a=_[_0x9a68('0x40')]({},_0x9d716a,_0x7106cb[_0x9a68('0x41')]);var _0x39e05e={'where':_0x9d716a[_0x9a68('0x3f')]};return db[_0x9a68('0x2b')][_0x9a68('0x1e')](_0x39e05e)[_0x9a68('0x25')](function(_0x90b45b){_0x36cfa6[_0x9a68('0x1e')]=_0x90b45b;if(_0x7106cb[_0x9a68('0x34')]['includeAll']){_0x9d716a[_0x9a68('0x42')]=[{'all':!![]}];}return db['VoiceRecording'][_0x9a68('0x43')](_0x9d716a);})['then'](function(_0x3e99ba){_0x36cfa6[_0x9a68('0x44')]=_0x3e99ba;return _0x36cfa6;})[_0x9a68('0x25')](respondWithFilteredResult(_0x372786,_0x9d716a))[_0x9a68('0x45')](handleError(_0x372786,null));};exports['show']=function(_0x3c23cc,_0x519b57){var _0x14649b={'raw':![],'where':{'id':_0x3c23cc[_0x9a68('0x46')]['id']}},_0x5730cb={};_0x5730cb['model']=_[_0x9a68('0x33')](db[_0x9a68('0x2b')][_0x9a68('0x2c')]);_0x5730cb[_0x9a68('0x34')]=_[_0x9a68('0x33')](_0x3c23cc['query']);_0x5730cb[_0x9a68('0x35')]=_[_0x9a68('0x37')](_0x5730cb['model'],_0x5730cb['query']);_0x14649b[_0x9a68('0x36')]=_[_0x9a68('0x37')](_0x5730cb[_0x9a68('0x30')],qs[_0x9a68('0x38')](_0x3c23cc[_0x9a68('0x34')][_0x9a68('0x38')]));_0x14649b[_0x9a68('0x36')]=_0x14649b['attributes'][_0x9a68('0x39')]?_0x14649b[_0x9a68('0x36')]:_0x5730cb[_0x9a68('0x30')];if(_0x3c23cc['query'][_0x9a68('0x47')]){_0x14649b[_0x9a68('0x42')]=[{'all':!![]}];}_0x14649b=_[_0x9a68('0x40')]({},_0x14649b,_0x3c23cc[_0x9a68('0x41')]);return db[_0x9a68('0x2b')]['find'](_0x14649b)[_0x9a68('0x25')](handleEntityNotFound(_0x519b57,null))[_0x9a68('0x25')](respondWithResult(_0x519b57,null))['catch'](handleError(_0x519b57,null));};exports[_0x9a68('0x48')]=function(_0x377760,_0x1c010f){return db[_0x9a68('0x2b')][_0x9a68('0x48')](_0x377760['body'],{})[_0x9a68('0x25')](respondWithResult(_0x1c010f,0xc9))[_0x9a68('0x45')](handleError(_0x1c010f,null));};exports[_0x9a68('0x24')]=function(_0x27b3d6,_0x5df2fc){if(_0x27b3d6[_0x9a68('0x49')]['id']){delete _0x27b3d6[_0x9a68('0x49')]['id'];}return db[_0x9a68('0x2b')]['find']({'where':{'id':_0x27b3d6[_0x9a68('0x46')]['id']}})[_0x9a68('0x25')](handleEntityNotFound(_0x5df2fc,null))[_0x9a68('0x25')](saveUpdates(_0x27b3d6['body'],null))[_0x9a68('0x25')](respondWithResult(_0x5df2fc,null))[_0x9a68('0x45')](handleError(_0x5df2fc,null));};exports[_0x9a68('0x4a')]=function(_0x21f4cc,_0x302f02){return db[_0x9a68('0x2b')][_0x9a68('0x4a')]()[_0x9a68('0x25')](respondWithResult(_0x302f02,null))[_0x9a68('0x45')](handleError(_0x302f02,null));};exports[_0x9a68('0x4b')]=function(_0x2e9fac,_0x138e2d,_0x37b6ff){var _0x22da3c=require(_0x9a68('0x4c'));var _0x58fd2a=![];var _0x2f3556={};if(_0x2e9fac[_0x9a68('0x34')]['type']&&_0x2e9fac['query'][_0x9a68('0x2e')]==='uniqueid'){_0x2f3556['uniqueid']=_0x2e9fac[_0x9a68('0x46')]['id'];}else{_0x2f3556['id']=_0x2e9fac[_0x9a68('0x46')]['id'];}return db[_0x9a68('0x2b')]['find']({'where':_0x2f3556,'attributes':['id','value'],'raw':!![]})[_0x9a68('0x25')](handleEntityNotFound(_0x138e2d,null))[_0x9a68('0x25')](function(_0x120833){if(_0x120833){var _0x4a82b1=_0x120833[_0x9a68('0x4d')];var _0x19fdea=util[_0x9a68('0x32')](_0x9a68('0x4e'),_0x4a82b1);if(fs['existsSync'](_0x19fdea)){_0x58fd2a=!![];return _0x22da3c[_0x9a68('0x4f')](_0x19fdea,_0x4a82b1,config[_0x9a68('0x50')][_0x9a68('0x51')])['then'](function(){return _0x120833;});}return _0x120833;}})['then'](function(_0x3cf1c7){if(_0x3cf1c7){var _0x192e41=_0x3cf1c7[_0x9a68('0x4d')];if(!fs[_0x9a68('0x52')](_0x192e41)){throw new db[(_0x9a68('0x53'))][(_0x9a68('0x54'))](_0x9a68('0x55'));}if(_0x3cf1c7['filename']){return _0x138e2d[_0x9a68('0x4b')](_0x192e41,_0x3cf1c7['filename']+path[_0x9a68('0x56')](_0x192e41),function(){if(_0x58fd2a){fs[_0x9a68('0x57')](_0x192e41);}});}else{return _0x138e2d[_0x9a68('0x4b')](_0x192e41,function(_0x40b2ce){if(_0x58fd2a){fs['unlink'](_0x192e41);}});}}})['catch'](function(_0xe8fe2e){if(_0xe8fe2e[_0x9a68('0x58')]===_0x9a68('0x55')){_0x138e2d[_0x9a68('0x1a')](0x194)[_0x9a68('0x28')]('Not\x20found');}else{return handleError(_0x138e2d,null);}});};exports[_0x9a68('0x59')]=function(_0x168e63,_0x7d79aa,_0x1bbc54){var _0x1bef0c=require(_0x9a68('0x4c'));var _0x10aacb=![];var _0x4644dc={'$and':[db[_0x9a68('0x5a')][_0x9a68('0x3f')](db[_0x9a68('0x5a')]['fn'](_0x9a68('0x5b'),db['sequelize'][_0x9a68('0x5c')](_0x9a68('0x5d'))),_0x168e63[_0x9a68('0x34')][_0x9a68('0x5e')])]};if(_0x168e63[_0x9a68('0x34')][_0x9a68('0x2e')]&&_0x168e63[_0x9a68('0x34')][_0x9a68('0x2e')]===_0x9a68('0x5d')){_0x4644dc[_0x9a68('0x5f')]['push']({'uniqueid':_0x168e63[_0x9a68('0x46')]['id']});}else{_0x4644dc[_0x9a68('0x5f')]['push']({'id':_0x168e63['params']['id']});}return db['VoiceRecording'][_0x9a68('0x60')]({'where':_0x4644dc,'attributes':['id',_0x9a68('0x4d')],'raw':!![]})['then'](handleEntityNotFound(_0x7d79aa,null))[_0x9a68('0x25')](function(_0x87011e){if(_0x87011e){var _0x551b0c=util['format'](_0x9a68('0x4e'),_0x87011e['value']);if(fs[_0x9a68('0x52')](_0x551b0c)){_0x10aacb=!![];return _0x1bef0c['decryptFile'](_0x551b0c,_0x87011e[_0x9a68('0x4d')],config[_0x9a68('0x50')]['recording'])[_0x9a68('0x25')](function(){return _0x87011e;});}return _0x87011e;}})[_0x9a68('0x25')](function(_0x554d24){if(_0x554d24){if(!fs['existsSync'](_0x554d24[_0x9a68('0x4d')])){throw new db['Sequelize']['ValidationError'](_0x9a68('0x55'));}if(_0x554d24[_0x9a68('0x61')]){return _0x7d79aa[_0x9a68('0x4b')](_0x554d24['value'],_0x554d24[_0x9a68('0x61')]+path[_0x9a68('0x56')](_0x554d24[_0x9a68('0x4d')]),function(){if(_0x10aacb){fs[_0x9a68('0x57')](_0x554d24[_0x9a68('0x4d')]);}});}else{return _0x7d79aa[_0x9a68('0x4b')](_0x554d24[_0x9a68('0x4d')],function(_0x144bea){if(_0x10aacb){fs[_0x9a68('0x57')](_0x554d24[_0x9a68('0x4d')]);}});}}})['catch'](handleError(_0x7d79aa,null));};exports[_0x9a68('0x62')]=function(_0xf58e8d,_0x219fe2){return db[_0x9a68('0x2b')][_0x9a68('0x60')]({'where':{'id':_0xf58e8d['params']['id']}})[_0x9a68('0x25')](function(_0x52f7d7){if(_[_0x9a68('0x63')](_0x52f7d7)){throw new ReferenceError(_0x9a68('0x64'));}return _0x52f7d7;})['then'](function(_0x28144d){var _0x3e3671=_0x28144d['value'];logger[_0x9a68('0x65')](_0x9a68('0x66'),_0x3e3671);if(!_['isNil'](_0x28144d['value'])&&fs[_0x9a68('0x52')](_0x3e3671)){logger[_0x9a68('0x65')](_0x9a68('0x67')+_0x3e3671+_0x9a68('0x68'));fs['unlinkSync'](_0x3e3671);}_0x3e3671=_0x3e3671+'.cypher';if(!_[_0x9a68('0x63')](_0x28144d[_0x9a68('0x4d')])&&fs[_0x9a68('0x52')](_0x3e3671)){logger[_0x9a68('0x65')](_0x9a68('0x67')+_0x3e3671+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x3e3671);}return _0x28144d;})[_0x9a68('0x25')](function(_0x54011d){if(!_0x54011d)throw new InternalError();return _0x54011d[_0x9a68('0x62')]();})[_0x9a68('0x25')](function(){_0x219fe2[_0x9a68('0x1a')](0xcc)[_0x9a68('0x19')]();})[_0x9a68('0x45')](handleError(_0x219fe2,null));};function getBucketslist(_0x380ced,_0x2c5512,_0x2caf71){return new Promise(function(_0x505de6,_0x238ee9){var _0xd0e10d=new AWS['S3']({'accessKeyId':_0x2c5512,'secretAccessKey':_0x380ced,'region':_0x2caf71});_0xd0e10d['listBuckets']({},function(_0x4edc39,_0x38ed00){if(_0x4edc39){return _0x238ee9(_0x4edc39);}else{return _0x505de6(_0x38ed00);}});});}function createBucket(_0x5144b9,_0x286383,_0x3613e1,_0x154a58){return new Promise(function(_0x188da0,_0x2c2305){var _0x356856=new AWS['S3']({'accessKeyId':_0x286383,'secretAccessKey':_0x5144b9,'region':_0x3613e1});_0x356856[_0x9a68('0x69')]({'Bucket':_0x154a58},function(_0x19b903,_0x50eeab){if(_0x19b903){return _0x2c2305(_0x19b903);}else{return _0x188da0(_0x50eeab);}});});}function uploadFile(_0x149d33,_0x4c40d3,_0x14d3da,_0x2a96b8,_0xc01286,_0x3de58a){return new Promise(function(_0x34dcb4,_0x261631){var _0x22b937=new AWS['S3']({'accessKeyId':_0x4c40d3,'secretAccessKey':_0x149d33,'region':_0x14d3da});_0x22b937[_0x9a68('0x6a')]({'Bucket':_0x2a96b8,'Key':_0xc01286,'Body':_0x3de58a},function(_0x37aa2a,_0x1befa5){if(_0x37aa2a){return _0x261631(_0x37aa2a);}else{return _0x34dcb4(_0x1befa5);}});});}function startTranscribe(_0x4f9f08,_0x3381cb,_0x10d5d0,_0x16b022,_0x336b87,_0x525ccd){return new Promise(function(_0x28a8ee,_0x4d4297){var _0x4073de=new AWS[(_0x9a68('0x6b'))]({'accessKeyId':_0x3381cb,'secretAccessKey':_0x4f9f08,'region':_0x10d5d0});_0x4073de['startTranscriptionJob']({'TranscriptionJobName':_0x16b022,'LanguageCode':_0x336b87,'Media':{'MediaFileUri':_0x525ccd}},function(_0x56bdc5,_0xc79fbd){if(_0x56bdc5){return _0x4d4297(_0x56bdc5);}else{return _0x28a8ee(_0xc79fbd);}});});}function transcribe(_0x5572c4,_0x6ff9e,_0x4d5536,_0x53c18c,_0xf4ddb2,_0x332bbf,_0x4a931c){return new Promise(function(_0x57705f,_0x4569d4){var _0x9ee613={};logger[_0x9a68('0x65')](util['format'](_0x9a68('0x6c'),_0x5572c4,_0xf4ddb2));return uploadFile(_0x6ff9e,_0x4d5536,_0x53c18c,_0xf4ddb2,path[_0x9a68('0x6d')](_0x332bbf),fs[_0x9a68('0x6e')](_0x332bbf))[_0x9a68('0x25')](function(_0x275f66){logger[_0x9a68('0x65')](util[_0x9a68('0x32')](_0x9a68('0x6f'),_0x5572c4,_0xf4ddb2,_0x275f66[_0x9a68('0x70')]));_0x9ee613[_0x9a68('0x71')]=_0x275f66['Bucket'];_0x9ee613[_0x9a68('0x72')]=_0x275f66['Location'];logger[_0x9a68('0x65')](util[_0x9a68('0x32')](_0x9a68('0x73'),_0x5572c4));return startTranscribe(_0x6ff9e,_0x4d5536,_0x53c18c,uuidv4(),_0x4a931c,_0x275f66[_0x9a68('0x70')]);})['then'](function(_0x222960){logger['info'](util['format'](_0x9a68('0x74'),_0x5572c4,_0x222960['TranscriptionJob']['TranscriptionJobName']));_0x9ee613[_0x9a68('0x75')]=_0x222960['TranscriptionJob']['TranscriptionJobName'];_0x9ee613[_0x9a68('0x76')]=_0x222960[_0x9a68('0x77')][_0x9a68('0x78')];return _0x57705f(_0x9ee613);})[_0x9a68('0x45')](function(_0x13e9f0){return _0x4569d4(_0x13e9f0);});});}exports[_0x9a68('0x79')]=function(_0x4352d0,_0x4524f6,_0x45abec){var _0x57eeba;var _0xefd08c;var _0x186b8a;var _0x546460=require(_0x9a68('0x4c'));return db[_0x9a68('0x2b')][_0x9a68('0x7a')]({'where':{'id':_0x4352d0[_0x9a68('0x46')]['id']}})[_0x9a68('0x25')](function(_0x41e330){if(_0x41e330){var _0x4c312f=util[_0x9a68('0x32')](_0x9a68('0x4e'),_0x41e330[_0x9a68('0x4d')]);if(fs[_0x9a68('0x52')](_0x4c312f)){cypher=!![];return _0x546460[_0x9a68('0x4f')](_0x4c312f,_0x41e330[_0x9a68('0x4d')],config['secrets']['recording'])[_0x9a68('0x25')](function(){return _0x41e330;});}return _0x41e330;}})[_0x9a68('0x25')](function(_0x11a3ba){if(!_0x11a3ba){throw new db['Sequelize'][(_0x9a68('0x54'))](_0x9a68('0x7b'));}_0xefd08c=_0x11a3ba;return db[_0x9a68('0x7c')]['findOne']({'where':{'id':0x1}});})[_0x9a68('0x25')](handleEntityNotFound(_0x4524f6,null))['then'](function(_0xe4cd42){if(_0xe4cd42){_0x57eeba=_0xe4cd42;if(!_0x57eeba['transcribe']||!_0x57eeba[_0x9a68('0x7d')]||!_0x57eeba['transcribeRegion']||!_0x57eeba['language']||!_0x57eeba[_0x9a68('0x71')]){throw new db[(_0x9a68('0x53'))][(_0x9a68('0x54'))](_0x9a68('0x7e'));}if(_0x4352d0[_0x9a68('0x49')][_0x9a68('0x7f')]&&(!_0x57eeba[_0x9a68('0x80')]||!_0x57eeba[_0x9a68('0x81')]||!_0x57eeba['sentimentRegion']||!_0x57eeba[_0x9a68('0x82')]||!_0x57eeba[_0x9a68('0x71')])){throw new db[(_0x9a68('0x53'))][(_0x9a68('0x54'))](_0x9a68('0x83'));}return db[_0x9a68('0x84')][_0x9a68('0x7a')]({'where':{'id':_0x57eeba['transcribeAccountId']}});}})['then'](function(_0x120ee3){if(!_0x120ee3){throw new db['Sequelize'][(_0x9a68('0x54'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x120ee3[_0x9a68('0x85')]||!_0x120ee3['data2']){throw new db['Sequelize']['ValidationError'](_0x9a68('0x86'));}_0x186b8a=_0x120ee3;return getBucketslist(_0x186b8a[_0x9a68('0x85')],_0x186b8a[_0x9a68('0x87')],_0x57eeba[_0x9a68('0x88')]);})[_0x9a68('0x25')](function(_0x5513bd){if(_0x5513bd&&_0x5513bd[_0x9a68('0x89')]){var _0x172d7c=_[_0x9a68('0x60')](_0x5513bd[_0x9a68('0x89')],function(_0x3b78f0){return _0x3b78f0[_0x9a68('0x8a')]===_0x57eeba[_0x9a68('0x71')];});if(!_0x172d7c){logger[_0x9a68('0x65')](util['format'](_0x9a68('0x8b'),_0x4352d0[_0x9a68('0x46')]['id'],_0x57eeba[_0x9a68('0x71')]));return createBucket(_0x186b8a[_0x9a68('0x85')],_0x186b8a['data2'],_0x57eeba['transcribeRegion'],_0x57eeba[_0x9a68('0x71')]);}logger[_0x9a68('0x65')](util[_0x9a68('0x32')](_0x9a68('0x8c'),_0x4352d0[_0x9a68('0x46')]['id'],_0x57eeba[_0x9a68('0x71')]));return;}})[_0x9a68('0x25')](function(_0x35a663){if(_0xefd08c[_0x9a68('0x76')]==='NEW'){return transcribe(_0x4352d0[_0x9a68('0x46')]['id'],_0x186b8a[_0x9a68('0x85')],_0x186b8a['data2'],_0x57eeba[_0x9a68('0x88')],_0x57eeba['bucket'],_0xefd08c[_0x9a68('0x4d')],_0x57eeba[_0x9a68('0x82')]);}else{logger[_0x9a68('0x65')](util['format'](_0x9a68('0x8d'),_0x4352d0[_0x9a68('0x46')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x9a68('0x25')](function(_0x3d99b5){if(_0x3d99b5){_0x3d99b5[_0x9a68('0x8e')]=_0x4352d0[_0x9a68('0x49')]['runSentiment'];return _0xefd08c[_0x9a68('0x8f')](_0x3d99b5);}})[_0x9a68('0x25')](respondWithResult(_0x4524f6,null))[_0x9a68('0x45')](handleError(_0x4524f6,null));};function writeFile(_0x378c4e,_0x3ff8e2){return new Promise(function(_0x84d9ad,_0x28c6cd){fs[_0x9a68('0x90')](_0x3ff8e2,_0x378c4e,function(_0x3e206d,_0xc00d04){if(_0x3e206d){return _0x28c6cd(_0x3e206d);}else{return _0x84d9ad(_0xc00d04);}});});}exports[_0x9a68('0x91')]=function(_0x4ddd54,_0x4a9b30,_0x3aa7ca){return db[_0x9a68('0x2b')]['findOne']({'where':{'id':_0x4ddd54[_0x9a68('0x46')]['id']}})['then'](handleEntityNotFound(_0x4a9b30))[_0x9a68('0x25')](function(_0x1fec9c){if(_0x1fec9c&&_0x1fec9c[_0x9a68('0x92')]){var _0x118c40=_0x1fec9c[_0x9a68('0x92')];var _0x44ad15=config[_0x9a68('0x93')]+_0x9a68('0x94')+_0x1fec9c['id']+_0x9a68('0x95');if(fs[_0x9a68('0x52')](_0x44ad15)){return _0x44ad15;}return writeFile(_0x118c40,_0x44ad15)[_0x9a68('0x25')](function(){return _0x44ad15;});}else{throw new db[(_0x9a68('0x53'))]['ValidationError']('Transcript\x20not\x20available');}})['then'](function(_0x19c0bd){return _0x4a9b30['download'](_0x19c0bd);})[_0x9a68('0x45')](handleError(_0x4a9b30));};
\ No newline at end of file
index 0d97db3..7f8de5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a4d=['util','../../config/logger','api','path','rimraf','../../config/environment','./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings','uniqueid','lodash'];(function(_0x3a4e11,_0x41fcb2){var _0x368de4=function(_0x460281){while(--_0x460281){_0x3a4e11['push'](_0x3a4e11['shift']());}};_0x368de4(++_0x41fcb2);}(_0x9a4d,0xa8));var _0xd9a4=function(_0x468b32,_0xbc8ca6){_0x468b32=_0x468b32-0x0;var _0x3ac9a8=_0x9a4d[_0x468b32];return _0x3ac9a8;};'use strict';var _=require(_0xd9a4('0x0'));var util=require(_0xd9a4('0x1'));var logger=require(_0xd9a4('0x2'))(_0xd9a4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd9a4('0x4'));var rimraf=require(_0xd9a4('0x5'));var config=require(_0xd9a4('0x6'));var attributes=require(_0xd9a4('0x7'));module[_0xd9a4('0x8')]=function(_0x4f0785,_0x2d650f){return _0x4f0785[_0xd9a4('0x9')](_0xd9a4('0xa'),attributes,{'tableName':_0xd9a4('0xb'),'paranoid':![],'indexes':[{'name':_0xd9a4('0xc'),'fields':[_0xd9a4('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xcfc9=['../../config/environment','./voiceRecording.attributes','define','voice_recordings','uniqueid','lodash','util','api','moment','request-promise','path'];(function(_0x41bd53,_0x264e51){var _0x326e7f=function(_0x593704){while(--_0x593704){_0x41bd53['push'](_0x41bd53['shift']());}};_0x326e7f(++_0x264e51);}(_0xcfc9,0x1b2));var _0x9cfc=function(_0x331cfc,_0x1c8731){_0x331cfc=_0x331cfc-0x0;var _0x67e6fd=_0xcfc9[_0x331cfc];return _0x67e6fd;};'use strict';var _=require(_0x9cfc('0x0'));var util=require(_0x9cfc('0x1'));var logger=require('../../config/logger')(_0x9cfc('0x2'));var moment=require(_0x9cfc('0x3'));var BPromise=require('bluebird');var rp=require(_0x9cfc('0x4'));var fs=require('fs');var path=require(_0x9cfc('0x5'));var rimraf=require('rimraf');var config=require(_0x9cfc('0x6'));var attributes=require(_0x9cfc('0x7'));module['exports']=function(_0x358373,_0x569eda){return _0x358373[_0x9cfc('0x8')]('VoiceRecording',attributes,{'tableName':_0x9cfc('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x9cfc('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index 65be324..6f40694 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaebd=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','VoiceRecording,\x20%s,\x20%s','catch','UpdateVoiceRecording','update','options','raw','where','attributes','debug','CreateVoiceRecording','Setting','findOne','callRecordingEncryption','VoiceRecording','create','body','value','format','%s.cypher','encryptFile','recording','unlink','lodash','moment','bluebird'];(function(_0x5da27f,_0x504b76){var _0x54a3fb=function(_0x3b65a8){while(--_0x3b65a8){_0x5da27f['push'](_0x5da27f['shift']());}};_0x54a3fb(++_0x504b76);}(_0xaebd,0x1e9));var _0xdaeb=function(_0x808526,_0x1b0d5a){_0x808526=_0x808526-0x0;var _0x46c422=_0xaebd[_0x808526];return _0x46c422;};'use strict';var _=require(_0xdaeb('0x0'));var util=require('util');var moment=require(_0xdaeb('0x1'));var BPromise=require(_0xdaeb('0x2'));var rs=require(_0xdaeb('0x3'));var fs=require('fs');var Redis=require(_0xdaeb('0x4'));var db=require(_0xdaeb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdaeb('0x6'))(_0xdaeb('0x7'));var config=require(_0xdaeb('0x8'));var jayson=require(_0xdaeb('0x9'));var client=jayson[_0xdaeb('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ea090,_0x3f7ba1,_0x52c717){return new BPromise(function(_0x550bd9,_0x1b9d37){return client[_0xdaeb('0xb')](_0x3ea090,_0x52c717)[_0xdaeb('0xc')](function(_0x5e0ae9){logger[_0xdaeb('0xd')]('VoiceRecording,\x20%s,\x20%s',_0x3f7ba1,_0xdaeb('0xe'));logger['debug'](_0xdaeb('0xf'),_0x3f7ba1,'request\x20sent',JSON[_0xdaeb('0x10')](_0x5e0ae9));if(_0x5e0ae9[_0xdaeb('0x11')]){if(_0x5e0ae9['error']['code']===0x1f4){logger[_0xdaeb('0x11')]('VoiceRecording,\x20%s,\x20%s',_0x3f7ba1,_0x5e0ae9[_0xdaeb('0x11')][_0xdaeb('0x12')]);return _0x1b9d37(_0x5e0ae9[_0xdaeb('0x11')][_0xdaeb('0x12')]);}logger[_0xdaeb('0x11')](_0xdaeb('0x13'),_0x3f7ba1,_0x5e0ae9[_0xdaeb('0x11')]['message']);return _0x550bd9(_0x5e0ae9['error'][_0xdaeb('0x12')]);}else{logger[_0xdaeb('0xd')](_0xdaeb('0x13'),_0x3f7ba1,_0xdaeb('0xe'));_0x550bd9(_0x5e0ae9['result']['message']);}})[_0xdaeb('0x14')](function(_0x4dd803){logger['error'](_0xdaeb('0x13'),_0x3f7ba1,_0x4dd803);_0x1b9d37(_0x4dd803);});});}exports[_0xdaeb('0x15')]=function(_0x1b5243){var _0x1fe84e=this;return new Promise(function(_0x2d8f11,_0x36f9ac){return db['VoiceRecording'][_0xdaeb('0x16')](_0x1b5243['body'],{'raw':_0x1b5243[_0xdaeb('0x17')]?_0x1b5243[_0xdaeb('0x17')][_0xdaeb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b5243['options']?_0x1b5243['options'][_0xdaeb('0x19')]||null:null,'attributes':_0x1b5243[_0xdaeb('0x17')]?_0x1b5243[_0xdaeb('0x17')][_0xdaeb('0x1a')]||null:null,'limit':_0x1b5243[_0xdaeb('0x17')]?_0x1b5243['options']['limit']||null:null})[_0xdaeb('0xc')](function(_0x3cfcaf){logger[_0xdaeb('0xd')](_0xdaeb('0x15'),_0x1b5243);logger[_0xdaeb('0x1b')]('UpdateVoiceRecording',_0x1b5243,JSON[_0xdaeb('0x10')](_0x3cfcaf));_0x2d8f11(_0x3cfcaf);})['catch'](function(_0x130c35){logger[_0xdaeb('0x11')](_0xdaeb('0x15'),_0x130c35[_0xdaeb('0x12')],_0x1b5243);_0x36f9ac(_0x1fe84e[_0xdaeb('0x11')](0x1f4,_0x130c35['message']));});});};exports[_0xdaeb('0x1c')]=function(_0x34fa21){var _0x338687=this;return new Promise(function(_0x4eb719,_0x57c2c4){var _0x43095f=require('../../components/encryptor');var _0x5045f8;return db[_0xdaeb('0x1d')][_0xdaeb('0x1e')]({'attributes':['id',_0xdaeb('0x1f')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x5e6f97){_0x5045f8=_0x5e6f97;return db[_0xdaeb('0x20')][_0xdaeb('0x21')](_0x34fa21[_0xdaeb('0x22')]);})['then'](function(_0x36c933){if(_0x5045f8['callRecordingEncryption']&&fs['existsSync'](_0x36c933[_0xdaeb('0x23')])){var _0x21f6cf=util[_0xdaeb('0x24')](_0xdaeb('0x25'),_0x36c933[_0xdaeb('0x23')]);return _0x43095f[_0xdaeb('0x26')](_0x36c933[_0xdaeb('0x23')],_0x21f6cf,config['secrets'][_0xdaeb('0x27')])[_0xdaeb('0xc')](function(){fs[_0xdaeb('0x28')](_0x36c933[_0xdaeb('0x23')]);logger[_0xdaeb('0xd')]('CreateVoiceRecording\x20file\x20encrypted');return _0x36c933;});}return _0x36c933;})[_0xdaeb('0xc')](function(_0x3de2bd){logger['info'](_0xdaeb('0x1c'),_0x34fa21);logger[_0xdaeb('0x1b')](_0xdaeb('0x1c'),_0x34fa21,JSON[_0xdaeb('0x10')](_0x3de2bd));_0x4eb719(_0x3de2bd);})[_0xdaeb('0x14')](function(_0x1628b8){logger[_0xdaeb('0x11')](_0xdaeb('0x1c'),_0x1628b8[_0xdaeb('0x12')],_0x34fa21);_0x57c2c4(_0x338687[_0xdaeb('0x11')](0x1f4,_0x1628b8['message']));});});};
\ No newline at end of file
+var _0x2ef3=['options','raw','attributes','limit','debug','CreateVoiceRecording','../../components/encryptor','Setting','findOne','create','existsSync','value','format','%s.cypher','encryptFile','secrets','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','VoiceRecording,\x20%s,\x20%s','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','UpdateVoiceRecording','VoiceRecording','body'];(function(_0x1265ed,_0x4b85e8){var _0x5ac459=function(_0xf0c114){while(--_0xf0c114){_0x1265ed['push'](_0x1265ed['shift']());}};_0x5ac459(++_0x4b85e8);}(_0x2ef3,0xba));var _0x32ef=function(_0x581409,_0x508c90){_0x581409=_0x581409-0x0;var _0x21e5ec=_0x2ef3[_0x581409];return _0x21e5ec;};'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')]('VoiceRecording,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('VoiceRecording,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['update'](_0x1a9476[_0x32ef('0x17')],{'raw':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')]['where']||null:null,'attributes':_0x1a9476[_0x32ef('0x18')]?_0x1a9476['options'][_0x32ef('0x1a')]||null:null,'limit':_0x1a9476[_0x32ef('0x18')]?_0x1a9476['options'][_0x32ef('0x1b')]||null:null})[_0x32ef('0xb')](function(_0x5e8898){logger['info']('UpdateVoiceRecording',_0x1a9476);logger[_0x32ef('0x1c')](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x5e8898));_0x57863c(_0x5e8898);})['catch'](function(_0x59585f){logger[_0x32ef('0x11')]('UpdateVoiceRecording',_0x59585f['message'],_0x1a9476);_0xbe37f6(_0x286bfb[_0x32ef('0x11')](0x1f4,_0x59585f[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1d')]=function(_0x1dbe98){var _0x15ce54=this;return new Promise(function(_0x234175,_0x1874ea){var _0x38aed5=require(_0x32ef('0x1e'));var _0x2f52d7;return db[_0x32ef('0x1f')][_0x32ef('0x20')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x32ef('0xb')](function(_0x2f5d06){_0x2f52d7=_0x2f5d06;return db['VoiceRecording'][_0x32ef('0x21')](_0x1dbe98[_0x32ef('0x17')]);})[_0x32ef('0xb')](function(_0x26e207){if(_0x2f52d7['callRecordingEncryption']&&fs[_0x32ef('0x22')](_0x26e207[_0x32ef('0x23')])){var _0x31dbc3=util[_0x32ef('0x24')](_0x32ef('0x25'),_0x26e207[_0x32ef('0x23')]);return _0x38aed5[_0x32ef('0x26')](_0x26e207['value'],_0x31dbc3,config[_0x32ef('0x27')]['recording'])[_0x32ef('0xb')](function(){fs[_0x32ef('0x28')](_0x26e207['value']);logger[_0x32ef('0xc')](_0x32ef('0x29'));return _0x26e207;});}return _0x26e207;})[_0x32ef('0xb')](function(_0x20b467){logger[_0x32ef('0xc')]('CreateVoiceRecording',_0x1dbe98);logger['debug'](_0x32ef('0x1d'),_0x1dbe98,JSON['stringify'](_0x20b467));_0x234175(_0x20b467);})[_0x32ef('0x14')](function(_0x15b873){logger[_0x32ef('0x11')](_0x32ef('0x1d'),_0x15b873[_0x32ef('0x13')],_0x1dbe98);_0x1874ea(_0x15ce54[_0x32ef('0x11')](0x1f4,_0x15b873['message']));});});};
\ No newline at end of file
index d473694..ea0ef3e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe017=['delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceTransferReport.controller','get','isAuthenticated','show','post','create','put','/:id','update'];(function(_0x5520ad,_0x31dac5){var _0x136568=function(_0x23357f){while(--_0x23357f){_0x5520ad['push'](_0x5520ad['shift']());}};_0x136568(++_0x31dac5);}(_0xe017,0x75));var _0x7e01=function(_0x1ad0c4,_0x18c9e0){_0x1ad0c4=_0x1ad0c4-0x0;var _0xea5ff0=_0xe017[_0x1ad0c4];return _0xea5ff0;};'use strict';var multer=require(_0x7e01('0x0'));var util=require('util');var path=require(_0x7e01('0x1'));var timeout=require(_0x7e01('0x2'));var express=require(_0x7e01('0x3'));var router=express[_0x7e01('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7e01('0x5'));var interaction=require(_0x7e01('0x6'));var config=require('../../config/environment');var controller=require(_0x7e01('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x7e01('0x8')]('/describe',auth[_0x7e01('0x9')](),controller['describe']);router[_0x7e01('0x8')]('/:id',auth[_0x7e01('0x9')](),controller[_0x7e01('0xa')]);router[_0x7e01('0xb')]('/',auth[_0x7e01('0x9')](),controller[_0x7e01('0xc')]);router[_0x7e01('0xd')](_0x7e01('0xe'),auth['isAuthenticated'](),controller[_0x7e01('0xf')]);router[_0x7e01('0x10')]('/:id',auth[_0x7e01('0x9')](),controller[_0x7e01('0x11')]);module[_0x7e01('0x12')]=router;
\ No newline at end of file
+var _0xeaa3=['index','/describe','/:id','show','post','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated'];(function(_0x30f535,_0x4a7bff){var _0x5311ad=function(_0x2d0ce6){while(--_0x2d0ce6){_0x30f535['push'](_0x30f535['shift']());}};_0x5311ad(++_0x4a7bff);}(_0xeaa3,0xfa));var _0x3eaa=function(_0x2d8a08,_0x37054a){_0x2d8a08=_0x2d8a08-0x0;var _0x491f6d=_0xeaa3[_0x2d8a08];return _0x491f6d;};'use strict';var multer=require(_0x3eaa('0x0'));var util=require('util');var path=require(_0x3eaa('0x1'));var timeout=require(_0x3eaa('0x2'));var express=require(_0x3eaa('0x3'));var router=express[_0x3eaa('0x4')]();var fs_extra=require(_0x3eaa('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3eaa('0x6'));var controller=require(_0x3eaa('0x7'));router[_0x3eaa('0x8')]('/',auth[_0x3eaa('0x9')](),controller[_0x3eaa('0xa')]);router[_0x3eaa('0x8')](_0x3eaa('0xb'),auth[_0x3eaa('0x9')](),controller['describe']);router['get'](_0x3eaa('0xc'),auth[_0x3eaa('0x9')](),controller[_0x3eaa('0xd')]);router[_0x3eaa('0xe')]('/',auth[_0x3eaa('0x9')](),controller[_0x3eaa('0xf')]);router[_0x3eaa('0x10')]('/:id',auth[_0x3eaa('0x9')](),controller[_0x3eaa('0x11')]);router[_0x3eaa('0x12')](_0x3eaa('0xc'),auth[_0x3eaa('0x9')](),controller['destroy']);module[_0x3eaa('0x13')]=router;
\ No newline at end of file
index e41df3c..dd6bcba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa465=['STRING','Yes','sequelize','moment','exports','ENUM','blind','attended'];(function(_0x2cc14d,_0x44135c){var _0x5413dd=function(_0x38ba17){while(--_0x38ba17){_0x2cc14d['push'](_0x2cc14d['shift']());}};_0x5413dd(++_0x44135c);}(_0xa465,0x12a));var _0x5a46=function(_0x4c6b93,_0x19880d){_0x4c6b93=_0x4c6b93-0x0;var _0x119770=_0xa465[_0x4c6b93];return _0x119770;};'use strict';var Sequelize=require(_0x5a46('0x0'));var moment=require(_0x5a46('0x1'));module[_0x5a46('0x2')]={'type':{'type':Sequelize[_0x5a46('0x3')](_0x5a46('0x4'),_0x5a46('0x5'))},'result':{'type':Sequelize[_0x5a46('0x6')]},'transfererchannel':{'type':Sequelize[_0x5a46('0x6')]},'transferercalleridnum':{'type':Sequelize[_0x5a46('0x6')]},'transferercalleridname':{'type':Sequelize[_0x5a46('0x6')]},'transfererconnectedlinenum':{'type':Sequelize[_0x5a46('0x6')]},'transfererconnectedlinename':{'type':Sequelize[_0x5a46('0x6')]},'transfereraccountcode':{'type':Sequelize[_0x5a46('0x6')]},'transferercontext':{'type':Sequelize[_0x5a46('0x6')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0x5a46('0x6')]},'transfereecalleridname':{'type':Sequelize[_0x5a46('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x5a46('0x6')]},'transfereeconnectedlinename':{'type':Sequelize[_0x5a46('0x6')]},'transfereeaccountcode':{'type':Sequelize[_0x5a46('0x6')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0x5a46('0x6')]},'isexternal':{'type':Sequelize['ENUM'](_0x5a46('0x7'),'No')},'context':{'type':Sequelize[_0x5a46('0x6')]},'extension':{'type':Sequelize[_0x5a46('0x6')]}};
\ No newline at end of file
+var _0x945e=['moment','ENUM','STRING','Yes'];(function(_0x382906,_0x567d04){var _0x3c1e7e=function(_0x9a6768){while(--_0x9a6768){_0x382906['push'](_0x382906['shift']());}};_0x3c1e7e(++_0x567d04);}(_0x945e,0xe0));var _0xe945=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x945e[_0x5608a3];return _0x1ed50a;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xe945('0x0'));module['exports']={'type':{'type':Sequelize[_0xe945('0x1')]('blind','attended')},'result':{'type':Sequelize[_0xe945('0x2')]},'transfererchannel':{'type':Sequelize[_0xe945('0x2')]},'transferercalleridnum':{'type':Sequelize[_0xe945('0x2')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0xe945('0x2')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0xe945('0x2')]},'transfereecalleridname':{'type':Sequelize[_0xe945('0x2')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xe945('0x2')]},'transfereeconnectedlinename':{'type':Sequelize[_0xe945('0x2')]},'transfereeaccountcode':{'type':Sequelize[_0xe945('0x2')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0xe945('0x2')]},'transfereelinkedid':{'type':Sequelize[_0xe945('0x2')]},'isexternal':{'type':Sequelize[_0xe945('0x1')](_0xe945('0x3'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xe945('0x2')]}};
\ No newline at end of file
index 19c6748..d30c9f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5927=['apply','reject','save','then','destroy','sendStatus','error','send','index','map','VoiceTransferReport','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','offset','order','sort','where','pick','merge','type','VIRTUAL','name','filter','options','include','show','params','includeAll','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','undefined','count','limit','set','Content-Range'];(function(_0x38ced4,_0x24263f){var _0x547c07=function(_0x279fc4){while(--_0x279fc4){_0x38ced4['push'](_0x38ced4['shift']());}};_0x547c07(++_0x24263f);}(_0x5927,0x10e));var _0x7592=function(_0x3662b4,_0x503b4d){_0x3662b4=_0x3662b4-0x0;var _0x50928c=_0x5927[_0x3662b4];return _0x50928c;};'use strict';var emlformat=require(_0x7592('0x0'));var rimraf=require(_0x7592('0x1'));var zipdir=require(_0x7592('0x2'));var jsonpatch=require(_0x7592('0x3'));var rp=require(_0x7592('0x4'));var moment=require(_0x7592('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7592('0x6'));var util=require('util');var path=require(_0x7592('0x7'));var sox=require(_0x7592('0x8'));var csv=require(_0x7592('0x9'));var ejs=require(_0x7592('0xa'));var fs=require('fs');var fs_extra=require(_0x7592('0xb'));var _=require(_0x7592('0xc'));var squel=require(_0x7592('0xd'));var crypto=require(_0x7592('0xe'));var jsforce=require(_0x7592('0xf'));var deskjs=require(_0x7592('0x10'));var toCsv=require('to-csv');var querystring=require(_0x7592('0x11'));var Papa=require(_0x7592('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7592('0x13'));var as=require(_0x7592('0x14'));var hardwareService=require(_0x7592('0x15'));var logger=require('../../config/logger')(_0x7592('0x16'));var utils=require(_0x7592('0x17'));var config=require(_0x7592('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x7592('0x19'))['db'];function respondWithStatusCode(_0x5426ad,_0x4a3d9a){_0x4a3d9a=_0x4a3d9a||0xcc;return function(_0xa75b0b){if(_0xa75b0b){return _0x5426ad['sendStatus'](_0x4a3d9a);}return _0x5426ad['status'](_0x4a3d9a)[_0x7592('0x1a')]();};}function respondWithResult(_0x57ee19,_0x55c73e){_0x55c73e=_0x55c73e||0xc8;return function(_0x4a3cc2){if(_0x4a3cc2){return _0x57ee19[_0x7592('0x1b')](_0x55c73e)[_0x7592('0x1c')](_0x4a3cc2);}};}function respondWithFilteredResult(_0x30e921,_0x1797bf){return function(_0x1fc5b1){if(_0x1fc5b1){var _0x3ff345=typeof _0x1797bf['offset']===_0x7592('0x1d')&&typeof _0x1797bf['limit']==='undefined';var _0x222639=_0x1fc5b1[_0x7592('0x1e')];var _0x3e7437=_0x3ff345?0x0:_0x1797bf['offset'];var _0x252420=_0x3ff345?_0x1fc5b1['count']:_0x1797bf['offset']+_0x1797bf[_0x7592('0x1f')];var _0x493711;if(_0x252420>=_0x222639){_0x252420=_0x222639;_0x493711=0xc8;}else{_0x493711=0xce;}_0x30e921[_0x7592('0x1b')](_0x493711);return _0x30e921[_0x7592('0x20')](_0x7592('0x21'),_0x3e7437+'-'+_0x252420+'/'+_0x222639)['json'](_0x1fc5b1);}return null;};}function patchUpdates(_0x26a6c9){return function(_0x2e2684){try{jsonpatch[_0x7592('0x22')](_0x2e2684,_0x26a6c9,!![]);}catch(_0x4b0a78){return BPromise[_0x7592('0x23')](_0x4b0a78);}return _0x2e2684[_0x7592('0x24')]();};}function saveUpdates(_0xdc9f9a,_0x3992a2){return function(_0x194c27){if(_0x194c27){return _0x194c27['update'](_0xdc9f9a)[_0x7592('0x25')](function(_0x38cf13){return _0x38cf13;});}return null;};}function removeEntity(_0x1af033,_0x220cb2){return function(_0x261311){if(_0x261311){return _0x261311[_0x7592('0x26')]()[_0x7592('0x25')](function(){_0x1af033['status'](0xcc)[_0x7592('0x1a')]();});}};}function handleEntityNotFound(_0x3c3a08,_0x12d90f){return function(_0x5b7dc6){if(!_0x5b7dc6){_0x3c3a08[_0x7592('0x27')](0x194);}return _0x5b7dc6;};}function handleError(_0x3410cd,_0x3a1fe3){_0x3a1fe3=_0x3a1fe3||0x1f4;return function(_0x44c42a){logger[_0x7592('0x28')](_0x44c42a['stack']);if(_0x44c42a['name']){delete _0x44c42a['name'];}_0x3410cd[_0x7592('0x1b')](_0x3a1fe3)[_0x7592('0x29')](_0x44c42a);};}exports[_0x7592('0x2a')]=function(_0x40b81b,_0x189a9c){var _0x30a1cf={},_0x3fa396={},_0x23836c={'count':0x0,'rows':[]};var _0x527ddd=_[_0x7592('0x2b')](db[_0x7592('0x2c')][_0x7592('0x2d')],function(_0x3911f5){return{'name':_0x3911f5['fieldName'],'type':_0x3911f5['type'][_0x7592('0x2e')]};});_0x3fa396['model']=_['map'](_0x527ddd,'name');_0x3fa396[_0x7592('0x2f')]=_[_0x7592('0x30')](_0x40b81b[_0x7592('0x2f')]);_0x3fa396[_0x7592('0x31')]=_[_0x7592('0x32')](_0x3fa396[_0x7592('0x33')],_0x3fa396[_0x7592('0x2f')]);_0x30a1cf[_0x7592('0x34')]=_[_0x7592('0x32')](_0x3fa396[_0x7592('0x33')],qs[_0x7592('0x35')](_0x40b81b[_0x7592('0x2f')][_0x7592('0x35')]));_0x30a1cf['attributes']=_0x30a1cf[_0x7592('0x34')][_0x7592('0x36')]?_0x30a1cf[_0x7592('0x34')]:_0x3fa396[_0x7592('0x33')];if(!_0x40b81b[_0x7592('0x2f')]['hasOwnProperty'](_0x7592('0x37'))){_0x30a1cf['limit']=qs[_0x7592('0x1f')](_0x40b81b[_0x7592('0x2f')]['limit']);_0x30a1cf[_0x7592('0x38')]=qs[_0x7592('0x38')](_0x40b81b[_0x7592('0x2f')]['offset']);}_0x30a1cf[_0x7592('0x39')]=qs[_0x7592('0x3a')](_0x40b81b['query'][_0x7592('0x3a')]);_0x30a1cf[_0x7592('0x3b')]=qs[_0x7592('0x31')](_[_0x7592('0x3c')](_0x40b81b[_0x7592('0x2f')],_0x3fa396['filters']),_0x527ddd);if(_0x40b81b[_0x7592('0x2f')]['filter']){_0x30a1cf[_0x7592('0x3b')]=_[_0x7592('0x3d')](_0x30a1cf[_0x7592('0x3b')],{'$or':_[_0x7592('0x2b')](_0x527ddd,function(_0x5148fa){if(_0x5148fa[_0x7592('0x3e')]!==_0x7592('0x3f')){var _0x5f49e6={};_0x5f49e6[_0x5148fa[_0x7592('0x40')]]={'$like':'%'+_0x40b81b[_0x7592('0x2f')][_0x7592('0x41')]+'%'};return _0x5f49e6;}})});}_0x30a1cf=_[_0x7592('0x3d')]({},_0x30a1cf,_0x40b81b[_0x7592('0x42')]);var _0x51038b={'where':_0x30a1cf[_0x7592('0x3b')]};return db['VoiceTransferReport']['count'](_0x51038b)[_0x7592('0x25')](function(_0x113dd2){_0x23836c[_0x7592('0x1e')]=_0x113dd2;if(_0x40b81b['query']['includeAll']){_0x30a1cf[_0x7592('0x43')]=[{'all':!![]}];}return db[_0x7592('0x2c')]['findAll'](_0x30a1cf);})[_0x7592('0x25')](function(_0xe3f0ec){_0x23836c['rows']=_0xe3f0ec;return _0x23836c;})[_0x7592('0x25')](respondWithFilteredResult(_0x189a9c,_0x30a1cf))['catch'](handleError(_0x189a9c,null));};exports[_0x7592('0x44')]=function(_0x3d4863,_0x25ec53){var _0x16f35e={'raw':!![],'where':{'id':_0x3d4863[_0x7592('0x45')]['id']}},_0x3370ee={};_0x3370ee[_0x7592('0x33')]=_[_0x7592('0x30')](db[_0x7592('0x2c')][_0x7592('0x2d')]);_0x3370ee['query']=_[_0x7592('0x30')](_0x3d4863[_0x7592('0x2f')]);_0x3370ee[_0x7592('0x31')]=_[_0x7592('0x32')](_0x3370ee[_0x7592('0x33')],_0x3370ee[_0x7592('0x2f')]);_0x16f35e[_0x7592('0x34')]=_[_0x7592('0x32')](_0x3370ee[_0x7592('0x33')],qs[_0x7592('0x35')](_0x3d4863['query'][_0x7592('0x35')]));_0x16f35e[_0x7592('0x34')]=_0x16f35e[_0x7592('0x34')]['length']?_0x16f35e['attributes']:_0x3370ee[_0x7592('0x33')];if(_0x3d4863[_0x7592('0x2f')][_0x7592('0x46')]){_0x16f35e[_0x7592('0x43')]=[{'all':!![]}];}_0x16f35e=_[_0x7592('0x3d')]({},_0x16f35e,_0x3d4863[_0x7592('0x42')]);return db[_0x7592('0x2c')]['find'](_0x16f35e)[_0x7592('0x25')](handleEntityNotFound(_0x25ec53,null))[_0x7592('0x25')](respondWithResult(_0x25ec53,null))[_0x7592('0x47')](handleError(_0x25ec53,null));};exports[_0x7592('0x48')]=function(_0x5cd293,_0x3f9ab7){return db['VoiceTransferReport']['create'](_0x5cd293[_0x7592('0x49')],{})['then'](respondWithResult(_0x3f9ab7,0xc9))[_0x7592('0x47')](handleError(_0x3f9ab7,null));};exports['update']=function(_0x17731b,_0x49cc32){if(_0x17731b['body']['id']){delete _0x17731b['body']['id'];}return db['VoiceTransferReport'][_0x7592('0x4a')]({'where':{'id':_0x17731b[_0x7592('0x45')]['id']}})[_0x7592('0x25')](handleEntityNotFound(_0x49cc32,null))[_0x7592('0x25')](saveUpdates(_0x17731b['body'],null))['then'](respondWithResult(_0x49cc32,null))[_0x7592('0x47')](handleError(_0x49cc32,null));};exports[_0x7592('0x26')]=function(_0x45d965,_0x2cb0ee){return db[_0x7592('0x2c')][_0x7592('0x4a')]({'where':{'id':_0x45d965[_0x7592('0x45')]['id']}})[_0x7592('0x25')](handleEntityNotFound(_0x2cb0ee,null))['then'](removeEntity(_0x2cb0ee,null))[_0x7592('0x47')](handleError(_0x2cb0ee,null));};exports[_0x7592('0x4b')]=function(_0x8b2f3c,_0x5f037a){return db[_0x7592('0x2c')][_0x7592('0x4b')]()[_0x7592('0x25')](respondWithResult(_0x5f037a,null))[_0x7592('0x47')](handleError(_0x5f037a,null));};
\ No newline at end of file
+var _0xef0a=['stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','options','VoiceTransferReport','include','findAll','rows','catch','show','create','body','params','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','then','error'];(function(_0x2d72bc,_0x313498){var _0x1b4d22=function(_0x1b7c6e){while(--_0x1b7c6e){_0x2d72bc['push'](_0x2d72bc['shift']());}};_0x1b4d22(++_0x313498);}(_0xef0a,0x70));var _0xaef0=function(_0x179791,_0xd1e02f){_0x179791=_0x179791-0x0;var _0x2be9f8=_0xef0a[_0x179791];return _0x2be9f8;};'use strict';var emlformat=require(_0xaef0('0x0'));var rimraf=require(_0xaef0('0x1'));var zipdir=require(_0xaef0('0x2'));var jsonpatch=require(_0xaef0('0x3'));var rp=require(_0xaef0('0x4'));var moment=require(_0xaef0('0x5'));var BPromise=require(_0xaef0('0x6'));var Mustache=require(_0xaef0('0x7'));var util=require(_0xaef0('0x8'));var path=require('path');var sox=require(_0xaef0('0x9'));var csv=require(_0xaef0('0xa'));var ejs=require(_0xaef0('0xb'));var fs=require('fs');var fs_extra=require(_0xaef0('0xc'));var _=require(_0xaef0('0xd'));var squel=require(_0xaef0('0xe'));var crypto=require(_0xaef0('0xf'));var jsforce=require(_0xaef0('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaef0('0x11'));var Papa=require('papaparse');var Redis=require(_0xaef0('0x12'));var authService=require(_0xaef0('0x13'));var qs=require(_0xaef0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaef0('0x15'));var logger=require(_0xaef0('0x16'))(_0xaef0('0x17'));var utils=require(_0xaef0('0x18'));var config=require(_0xaef0('0x19'));var licenseUtil=require(_0xaef0('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3067b0,_0x475cba){_0x475cba=_0x475cba||0xcc;return function(_0xc45a65){if(_0xc45a65){return _0x3067b0[_0xaef0('0x1b')](_0x475cba);}return _0x3067b0[_0xaef0('0x1c')](_0x475cba)[_0xaef0('0x1d')]();};}function respondWithResult(_0x22b105,_0x1d8f6d){_0x1d8f6d=_0x1d8f6d||0xc8;return function(_0x3e2296){if(_0x3e2296){return _0x22b105[_0xaef0('0x1c')](_0x1d8f6d)[_0xaef0('0x1e')](_0x3e2296);}};}function respondWithFilteredResult(_0x4c20b9,_0x50fd32){return function(_0x36f513){if(_0x36f513){var _0x3fc7dd=typeof _0x50fd32[_0xaef0('0x1f')]===_0xaef0('0x20')&&typeof _0x50fd32[_0xaef0('0x21')]===_0xaef0('0x20');var _0x15ee25=_0x36f513[_0xaef0('0x22')];var _0x5eeb89=_0x3fc7dd?0x0:_0x50fd32['offset'];var _0xa98638=_0x3fc7dd?_0x36f513[_0xaef0('0x22')]:_0x50fd32[_0xaef0('0x1f')]+_0x50fd32['limit'];var _0x57279f;if(_0xa98638>=_0x15ee25){_0xa98638=_0x15ee25;_0x57279f=0xc8;}else{_0x57279f=0xce;}_0x4c20b9['status'](_0x57279f);return _0x4c20b9[_0xaef0('0x23')](_0xaef0('0x24'),_0x5eeb89+'-'+_0xa98638+'/'+_0x15ee25)['json'](_0x36f513);}return null;};}function patchUpdates(_0x475cf8){return function(_0x3e7c42){try{jsonpatch[_0xaef0('0x25')](_0x3e7c42,_0x475cf8,!![]);}catch(_0x984e70){return BPromise[_0xaef0('0x26')](_0x984e70);}return _0x3e7c42['save']();};}function saveUpdates(_0x345ae2,_0x2f21e3){return function(_0x10c354){if(_0x10c354){return _0x10c354['update'](_0x345ae2)['then'](function(_0x54b746){return _0x54b746;});}return null;};}function removeEntity(_0x4e27cf,_0x1f4ed2){return function(_0x3622c0){if(_0x3622c0){return _0x3622c0[_0xaef0('0x27')]()[_0xaef0('0x28')](function(){_0x4e27cf['status'](0xcc)[_0xaef0('0x1d')]();});}};}function handleEntityNotFound(_0x4b61a1,_0x56f113){return function(_0x3b51b3){if(!_0x3b51b3){_0x4b61a1[_0xaef0('0x1b')](0x194);}return _0x3b51b3;};}function handleError(_0x4495c7,_0x3712fb){_0x3712fb=_0x3712fb||0x1f4;return function(_0x12688e){logger[_0xaef0('0x29')](_0x12688e[_0xaef0('0x2a')]);if(_0x12688e[_0xaef0('0x2b')]){delete _0x12688e[_0xaef0('0x2b')];}_0x4495c7[_0xaef0('0x1c')](_0x3712fb)['send'](_0x12688e);};}exports[_0xaef0('0x2c')]=function(_0x3b26dd,_0x337acd){var _0x221fab={},_0x42406b={},_0x1c3bcd={'count':0x0,'rows':[]};var _0x5c9629=_[_0xaef0('0x2d')](db['VoiceTransferReport'][_0xaef0('0x2e')],function(_0x454b08){return{'name':_0x454b08[_0xaef0('0x2f')],'type':_0x454b08[_0xaef0('0x30')][_0xaef0('0x31')]};});_0x42406b['model']=_['map'](_0x5c9629,_0xaef0('0x2b'));_0x42406b[_0xaef0('0x32')]=_[_0xaef0('0x33')](_0x3b26dd[_0xaef0('0x32')]);_0x42406b[_0xaef0('0x34')]=_[_0xaef0('0x35')](_0x42406b[_0xaef0('0x36')],_0x42406b['query']);_0x221fab[_0xaef0('0x37')]=_[_0xaef0('0x35')](_0x42406b[_0xaef0('0x36')],qs[_0xaef0('0x38')](_0x3b26dd[_0xaef0('0x32')][_0xaef0('0x38')]));_0x221fab['attributes']=_0x221fab[_0xaef0('0x37')][_0xaef0('0x39')]?_0x221fab['attributes']:_0x42406b[_0xaef0('0x36')];if(!_0x3b26dd['query'][_0xaef0('0x3a')]('nolimit')){_0x221fab[_0xaef0('0x21')]=qs[_0xaef0('0x21')](_0x3b26dd[_0xaef0('0x32')]['limit']);_0x221fab[_0xaef0('0x1f')]=qs[_0xaef0('0x1f')](_0x3b26dd[_0xaef0('0x32')][_0xaef0('0x1f')]);}_0x221fab[_0xaef0('0x3b')]=qs[_0xaef0('0x3c')](_0x3b26dd[_0xaef0('0x32')]['sort']);_0x221fab['where']=qs[_0xaef0('0x34')](_[_0xaef0('0x3d')](_0x3b26dd[_0xaef0('0x32')],_0x42406b[_0xaef0('0x34')]),_0x5c9629);if(_0x3b26dd[_0xaef0('0x32')]['filter']){_0x221fab[_0xaef0('0x3e')]=_[_0xaef0('0x3f')](_0x221fab[_0xaef0('0x3e')],{'$or':_[_0xaef0('0x2d')](_0x5c9629,function(_0x34990a){if(_0x34990a[_0xaef0('0x30')]!==_0xaef0('0x40')){var _0x4221de={};_0x4221de[_0x34990a[_0xaef0('0x2b')]]={'$like':'%'+_0x3b26dd[_0xaef0('0x32')]['filter']+'%'};return _0x4221de;}})});}_0x221fab=_[_0xaef0('0x3f')]({},_0x221fab,_0x3b26dd[_0xaef0('0x41')]);var _0x22442c={'where':_0x221fab[_0xaef0('0x3e')]};return db[_0xaef0('0x42')][_0xaef0('0x22')](_0x22442c)[_0xaef0('0x28')](function(_0x3fb188){_0x1c3bcd[_0xaef0('0x22')]=_0x3fb188;if(_0x3b26dd[_0xaef0('0x32')]['includeAll']){_0x221fab[_0xaef0('0x43')]=[{'all':!![]}];}return db[_0xaef0('0x42')][_0xaef0('0x44')](_0x221fab);})['then'](function(_0x43ce90){_0x1c3bcd[_0xaef0('0x45')]=_0x43ce90;return _0x1c3bcd;})['then'](respondWithFilteredResult(_0x337acd,_0x221fab))[_0xaef0('0x46')](handleError(_0x337acd,null));};exports[_0xaef0('0x47')]=function(_0x438163,_0x3cf6e1){var _0x529bac={'raw':!![],'where':{'id':_0x438163['params']['id']}},_0x8b162e={};_0x8b162e['model']=_[_0xaef0('0x33')](db[_0xaef0('0x42')]['rawAttributes']);_0x8b162e[_0xaef0('0x32')]=_['keys'](_0x438163[_0xaef0('0x32')]);_0x8b162e['filters']=_[_0xaef0('0x35')](_0x8b162e[_0xaef0('0x36')],_0x8b162e[_0xaef0('0x32')]);_0x529bac['attributes']=_[_0xaef0('0x35')](_0x8b162e[_0xaef0('0x36')],qs[_0xaef0('0x38')](_0x438163[_0xaef0('0x32')]['fields']));_0x529bac['attributes']=_0x529bac[_0xaef0('0x37')][_0xaef0('0x39')]?_0x529bac[_0xaef0('0x37')]:_0x8b162e[_0xaef0('0x36')];if(_0x438163['query']['includeAll']){_0x529bac[_0xaef0('0x43')]=[{'all':!![]}];}_0x529bac=_[_0xaef0('0x3f')]({},_0x529bac,_0x438163[_0xaef0('0x41')]);return db[_0xaef0('0x42')]['find'](_0x529bac)[_0xaef0('0x28')](handleEntityNotFound(_0x3cf6e1,null))[_0xaef0('0x28')](respondWithResult(_0x3cf6e1,null))[_0xaef0('0x46')](handleError(_0x3cf6e1,null));};exports[_0xaef0('0x48')]=function(_0x528ed1,_0x1e32ce){return db[_0xaef0('0x42')]['create'](_0x528ed1['body'],{})['then'](respondWithResult(_0x1e32ce,0xc9))['catch'](handleError(_0x1e32ce,null));};exports['update']=function(_0x18d594,_0x4d1ad0){if(_0x18d594[_0xaef0('0x49')]['id']){delete _0x18d594[_0xaef0('0x49')]['id'];}return db['VoiceTransferReport']['find']({'where':{'id':_0x18d594[_0xaef0('0x4a')]['id']}})[_0xaef0('0x28')](handleEntityNotFound(_0x4d1ad0,null))['then'](saveUpdates(_0x18d594[_0xaef0('0x49')],null))[_0xaef0('0x28')](respondWithResult(_0x4d1ad0,null))['catch'](handleError(_0x4d1ad0,null));};exports['destroy']=function(_0x54c947,_0x3dbef6){return db['VoiceTransferReport'][_0xaef0('0x4b')]({'where':{'id':_0x54c947[_0xaef0('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3dbef6,null))['then'](removeEntity(_0x3dbef6,null))[_0xaef0('0x46')](handleError(_0x3dbef6,null));};exports[_0xaef0('0x4c')]=function(_0x5f5bd8,_0x18c15b){return db['VoiceTransferReport'][_0xaef0('0x4c')]()['then'](respondWithResult(_0x18c15b,null))['catch'](handleError(_0x18c15b,null));};
\ No newline at end of file
index cb7eefe..d7553ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe738=['path','rimraf','../../config/environment','./voiceTransferReport.attributes','define','report_call_transfer','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5731a7,_0x3a834a){var _0x64c0c4=function(_0x379bd7){while(--_0x379bd7){_0x5731a7['push'](_0x5731a7['shift']());}};_0x64c0c4(++_0x3a834a);}(_0xe738,0x131));var _0x8e73=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xe738[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0x8e73('0x0'));var util=require(_0x8e73('0x1'));var logger=require(_0x8e73('0x2'))(_0x8e73('0x3'));var moment=require(_0x8e73('0x4'));var BPromise=require(_0x8e73('0x5'));var rp=require(_0x8e73('0x6'));var fs=require('fs');var path=require(_0x8e73('0x7'));var rimraf=require(_0x8e73('0x8'));var config=require(_0x8e73('0x9'));var attributes=require(_0x8e73('0xa'));module['exports']=function(_0x18a9c7,_0x3e78e6){return _0x18a9c7[_0x8e73('0xb')]('VoiceTransferReport',attributes,{'tableName':_0x8e73('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfad4=['define','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api','moment','request-promise','path','./voiceTransferReport.attributes','exports'];(function(_0x2f5a8b,_0x1df1d8){var _0x2303a5=function(_0x442cc0){while(--_0x442cc0){_0x2f5a8b['push'](_0x2f5a8b['shift']());}};_0x2303a5(++_0x1df1d8);}(_0xfad4,0x183));var _0x4fad=function(_0x3b309d,_0x542ab6){_0x3b309d=_0x3b309d-0x0;var _0x285b5d=_0xfad4[_0x3b309d];return _0x285b5d;};'use strict';var _=require(_0x4fad('0x0'));var util=require(_0x4fad('0x1'));var logger=require(_0x4fad('0x2'))(_0x4fad('0x3'));var moment=require(_0x4fad('0x4'));var BPromise=require('bluebird');var rp=require(_0x4fad('0x5'));var fs=require('fs');var path=require(_0x4fad('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4fad('0x7'));module[_0x4fad('0x8')]=function(_0x1bd4e7,_0x815eac){return _0x1bd4e7[_0x4fad('0x9')](_0x4fad('0xa'),attributes,{'tableName':_0x4fad('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 79b0cda..8ed918c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe76c=['rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceTransferReport,\x20%s,\x20%s','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','CreateVoiceTransferReport','VoiceTransferReport','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xe76c,0x153));var _0xce76=function(_0x35a274,_0x98b399){_0x35a274=_0x35a274-0x0;var _0x40d905=_0xe76c[_0x35a274];return _0x40d905;};'use strict';var _=require(_0xce76('0x0'));var util=require(_0xce76('0x1'));var moment=require(_0xce76('0x2'));var BPromise=require(_0xce76('0x3'));var rs=require(_0xce76('0x4'));var fs=require('fs');var Redis=require(_0xce76('0x5'));var db=require(_0xce76('0x6'))['db'];var utils=require(_0xce76('0x7'));var logger=require(_0xce76('0x8'))(_0xce76('0x9'));var config=require(_0xce76('0xa'));var jayson=require(_0xce76('0xb'));var client=jayson[_0xce76('0xc')][_0xce76('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x56ad59,_0x30bda5,_0x5b97e2){return new BPromise(function(_0x4aae33,_0x31ab9c){return client['request'](_0x56ad59,_0x5b97e2)[_0xce76('0xe')](function(_0x22e476){logger[_0xce76('0xf')](_0xce76('0x10'),_0x30bda5,'request\x20sent');logger[_0xce76('0x11')](_0xce76('0x12'),_0x30bda5,_0xce76('0x13'),JSON['stringify'](_0x22e476));if(_0x22e476['error']){if(_0x22e476[_0xce76('0x14')][_0xce76('0x15')]===0x1f4){logger[_0xce76('0x14')](_0xce76('0x10'),_0x30bda5,_0x22e476[_0xce76('0x14')][_0xce76('0x16')]);return _0x31ab9c(_0x22e476['error'][_0xce76('0x16')]);}logger[_0xce76('0x14')]('VoiceTransferReport,\x20%s,\x20%s',_0x30bda5,_0x22e476['error']['message']);return _0x4aae33(_0x22e476[_0xce76('0x14')][_0xce76('0x16')]);}else{logger[_0xce76('0xf')](_0xce76('0x10'),_0x30bda5,'request\x20sent');_0x4aae33(_0x22e476['result'][_0xce76('0x16')]);}})[_0xce76('0x17')](function(_0x182378){logger[_0xce76('0x14')](_0xce76('0x10'),_0x30bda5,_0x182378);_0x31ab9c(_0x182378);});});}exports[_0xce76('0x18')]=function(_0x3c7f38){var _0x576646=this;return new Promise(function(_0x20c7e1,_0x2aaba0){return db[_0xce76('0x19')]['create'](_0x3c7f38['body'],{'raw':_0x3c7f38[_0xce76('0x1a')]?_0x3c7f38['options'][_0xce76('0x1b')]===undefined?!![]:![]:!![]})[_0xce76('0xe')](function(_0x3d1006){logger[_0xce76('0xf')](_0xce76('0x18'),_0x3c7f38);logger[_0xce76('0x11')](_0xce76('0x18'),_0x3c7f38,JSON[_0xce76('0x1c')](_0x3d1006));_0x20c7e1(_0x3d1006);})[_0xce76('0x17')](function(_0x147e0a){logger[_0xce76('0x14')](_0xce76('0x18'),_0x147e0a[_0xce76('0x16')],_0x3c7f38);_0x2aaba0(_0x576646[_0xce76('0x14')](0x1f4,_0x147e0a[_0xce76('0x16')]));});});};
\ No newline at end of file
+var _0xd599=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','VoiceTransferReport,\x20%s,\x20%s','result','VoiceTransferReport','create','body','options','raw','CreateVoiceTransferReport','debug','catch'];(function(_0x923991,_0x481465){var _0x191cfc=function(_0x6412e1){while(--_0x6412e1){_0x923991['push'](_0x923991['shift']());}};_0x191cfc(++_0x481465);}(_0xd599,0x105));var _0x9d59=function(_0x539850,_0x26976e){_0x539850=_0x539850-0x0;var _0x46e4aa=_0xd599[_0x539850];return _0x46e4aa;};'use strict';var _=require(_0x9d59('0x0'));var util=require(_0x9d59('0x1'));var moment=require(_0x9d59('0x2'));var BPromise=require('bluebird');var rs=require(_0x9d59('0x3'));var fs=require('fs');var Redis=require(_0x9d59('0x4'));var db=require(_0x9d59('0x5'))['db'];var utils=require(_0x9d59('0x6'));var logger=require(_0x9d59('0x7'))(_0x9d59('0x8'));var config=require(_0x9d59('0x9'));var jayson=require(_0x9d59('0xa'));var client=jayson[_0x9d59('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9a2f70,_0x12c59d,_0x5882e1){return new BPromise(function(_0x236dc8,_0x42a563){return client['request'](_0x9a2f70,_0x5882e1)[_0x9d59('0xc')](function(_0x49cb74){logger[_0x9d59('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x12c59d,_0x9d59('0xe'));logger['debug'](_0x9d59('0xf'),_0x12c59d,'request\x20sent',JSON[_0x9d59('0x10')](_0x49cb74));if(_0x49cb74[_0x9d59('0x11')]){if(_0x49cb74[_0x9d59('0x11')]['code']===0x1f4){logger[_0x9d59('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x12c59d,_0x49cb74[_0x9d59('0x11')][_0x9d59('0x12')]);return _0x42a563(_0x49cb74['error'][_0x9d59('0x12')]);}logger[_0x9d59('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x12c59d,_0x49cb74['error'][_0x9d59('0x12')]);return _0x236dc8(_0x49cb74[_0x9d59('0x11')][_0x9d59('0x12')]);}else{logger[_0x9d59('0xd')](_0x9d59('0x13'),_0x12c59d,'request\x20sent');_0x236dc8(_0x49cb74[_0x9d59('0x14')][_0x9d59('0x12')]);}})['catch'](function(_0x4a2638){logger[_0x9d59('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x12c59d,_0x4a2638);_0x42a563(_0x4a2638);});});}exports['CreateVoiceTransferReport']=function(_0x521de7){var _0x476288=this;return new Promise(function(_0x3110e2,_0x434103){return db[_0x9d59('0x15')][_0x9d59('0x16')](_0x521de7[_0x9d59('0x17')],{'raw':_0x521de7['options']?_0x521de7[_0x9d59('0x18')][_0x9d59('0x19')]===undefined?!![]:![]:!![]})[_0x9d59('0xc')](function(_0x347dba){logger[_0x9d59('0xd')](_0x9d59('0x1a'),_0x521de7);logger[_0x9d59('0x1b')]('CreateVoiceTransferReport',_0x521de7,JSON[_0x9d59('0x10')](_0x347dba));_0x3110e2(_0x347dba);})[_0x9d59('0x1c')](function(_0x1e895f){logger[_0x9d59('0x11')](_0x9d59('0x1a'),_0x1e895f[_0x9d59('0x12')],_0x521de7);_0x434103(_0x476288[_0x9d59('0x11')](0x1f4,_0x1e895f[_0x9d59('0x12')]));});});};
\ No newline at end of file
index 8d0747c..b843942 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54ef=['unhold','/calls','/transfer','transfer','express','Router','../../components/auth/service','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','hangup','/answer','/hold','hold','/unhold'];(function(_0x50a097,_0x3ba9bf){var _0x1ce5cd=function(_0x54ef90){while(--_0x54ef90){_0x50a097['push'](_0x50a097['shift']());}};_0x1ce5cd(++_0x3ba9bf);}(_0x54ef,0x112));var _0xf54e=function(_0x435119,_0x31493e){_0x435119=_0x435119-0x0;var _0x52ef10=_0x54ef[_0x435119];return _0x52ef10;};'use strict';var express=require(_0xf54e('0x0'));var router=express[_0xf54e('0x1')]();var auth=require(_0xf54e('0x2'));var controller=require('./webbar.controller');router[_0xf54e('0x3')](_0xf54e('0x4'),auth[_0xf54e('0x5')](),auth[_0xf54e('0x6')](),controller[_0xf54e('0x7')]);router[_0xf54e('0x3')](_0xf54e('0x8'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xf54e('0x9')]);router[_0xf54e('0x3')](_0xf54e('0xa'),auth['isAuthenticated'](),auth[_0xf54e('0x6')](),controller['answer']);router[_0xf54e('0x3')](_0xf54e('0xb'),auth['isAuthenticated'](),auth[_0xf54e('0x6')](),controller[_0xf54e('0xc')]);router[_0xf54e('0x3')](_0xf54e('0xd'),auth['isAuthenticated'](),auth[_0xf54e('0x6')](),controller[_0xf54e('0xe')]);router[_0xf54e('0x3')](_0xf54e('0xf'),auth['isAuthenticated'](),auth[_0xf54e('0x6')](),controller['calls']);router['post'](_0xf54e('0x10'),auth[_0xf54e('0x5')](),auth[_0xf54e('0x6')](),controller[_0xf54e('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xe5b3=['transfer','Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','hangup','answer','hold','/unhold','unhold','/calls','calls','/transfer'];(function(_0x4332a8,_0x50dfda){var _0x26fee7=function(_0x1fa032){while(--_0x1fa032){_0x4332a8['push'](_0x4332a8['shift']());}};_0x26fee7(++_0x50dfda);}(_0xe5b3,0x133));var _0x3e5b=function(_0x5eedd1,_0x44f5c7){_0x5eedd1=_0x5eedd1-0x0;var _0x290c43=_0xe5b3[_0x5eedd1];return _0x290c43;};'use strict';var express=require('express');var router=express[_0x3e5b('0x0')]();var auth=require(_0x3e5b('0x1'));var controller=require(_0x3e5b('0x2'));router[_0x3e5b('0x3')](_0x3e5b('0x4'),auth[_0x3e5b('0x5')](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0x7')]);router[_0x3e5b('0x3')](_0x3e5b('0x8'),auth[_0x3e5b('0x5')](),auth['isWebrtcLicence'](),controller[_0x3e5b('0x9')]);router[_0x3e5b('0x3')]('/answer',auth[_0x3e5b('0x5')](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0xa')]);router[_0x3e5b('0x3')]('/hold',auth['isAuthenticated'](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0xb')]);router[_0x3e5b('0x3')](_0x3e5b('0xc'),auth[_0x3e5b('0x5')](),auth['isWebrtcLicence'](),controller[_0x3e5b('0xd')]);router['post'](_0x3e5b('0xe'),auth[_0x3e5b('0x5')](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0xf')]);router[_0x3e5b('0x3')](_0x3e5b('0x10'),auth[_0x3e5b('0x5')](),auth['isWebrtcLicence'](),controller[_0x3e5b('0x11')]);module['exports']=router;
\ No newline at end of file
index 6843a61..4510927 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01fe=['webbar:hangup','hangup\x20executed!','answer','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','calls','calls\x20fired:','VoiceChannels','all','conference','conference\x20executed!','transfer','transferNumber','webbar:transfer','path','../../mysqldb','../../config/environment','jayson/promise','client','http','../../config/logger','ioredis','defaults','redis','localhost','socket.io-emitter','number','userId\x20is\x20required','callNumber\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','name','status','send','NotFound','request','then','code','message','result','catch','findOne','agent','filter','rows','UserId','length','\x20not\x20found!','originate','originate\x20fired:','validate','body','userId','callNumber','callerId','callbackUrl','entityFound:','format','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','json','sessionId','user:%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x01fe,0x102));var _0xe01f=function(_0x1ec6bb,_0x1c6c2a){_0x1ec6bb=_0x1ec6bb-0x0;var _0xd39f96=_0x01fe[_0x1ec6bb];return _0xd39f96;};'use strict';var path=require(_0xe01f('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0xe01f('0x1'))['db'];var config=require(_0xe01f('0x2'));var util=require('util');var BPromise=require('bluebird');var jayson=require(_0xe01f('0x3'));var amiClient=jayson[_0xe01f('0x4')][_0xe01f('0x5')]({'port':0x232a});var logger=require(_0xe01f('0x6'))('webbarapi');var Redis=require(_0xe01f('0x7'));config['redis']=_[_0xe01f('0x8')](config[_0xe01f('0x9')],{'host':_0xe01f('0xa'),'port':0x18eb});var io=require(_0xe01f('0xb'))(new Redis(config[_0xe01f('0x9')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0xe01f('0xc'),'required':[!![],_0xe01f('0xd')]},'callNumber':{'type':'string','required':[!![],_0xe01f('0xe')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0xe01f('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0xe01f('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xe01f('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0xe01f('0xd')]},'sessionId':{'type':_0xe01f('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xe01f('0xc'),'required':[!![],_0xe01f('0xd')]},'sessionId':{'type':_0xe01f('0xf'),'required':[!![],_0xe01f('0x10')]},'transferNumber':{'type':_0xe01f('0xf'),'required':[!![],_0xe01f('0x11')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xe01f('0xd')]},'sessionId':{'type':_0xe01f('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xe01f('0xc'),'required':[!![],_0xe01f('0xd')]},'sessionId':{'type':_0xe01f('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xe01f('0xc'),'required':[!![],_0xe01f('0xd')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']}});function emit(_0x5e3877,_0x12540b,_0x14b05d){logger[_0xe01f('0x12')](_0x5e3877,_0x12540b,JSON[_0xe01f('0x13')](_0x14b05d));io['to'](_0x5e3877)[_0xe01f('0x14')](_0x12540b,_0x14b05d);}function handleError(_0x3fad9a){return function(_0x144eef){console[_0xe01f('0x15')](_0xe01f('0x16'),_0x144eef,_0x144eef instanceof RangeError);logger[_0xe01f('0x17')](_0x144eef['stack']);if(_0x144eef instanceof RangeError){if(_0x144eef[_0xe01f('0x18')]){delete _0x144eef['name'];}_0x3fad9a[_0xe01f('0x19')](0x194)[_0xe01f('0x1a')](_0x144eef);}else{if(_0x144eef[_0xe01f('0x18')]){delete _0x144eef[_0xe01f('0x18')];}_0x3fad9a['status'](0x1f4)[_0xe01f('0x1a')](_0x144eef);}};}function checkError(){return function(_0xb9343e){if(!_0xb9343e){throw new RangeError(_0xe01f('0x1b'));}return _0xb9343e;};}function respondWithRpcPromise(_0x1f0cfd,_0x369b7e){return new BPromise(function(_0x3c34fa,_0x570d48){var _0x1faeb8=amiClient;return _0x1faeb8[_0xe01f('0x1c')](_0x1f0cfd,_0x369b7e)[_0xe01f('0x1d')](function(_0xa6da95){if(_0xa6da95[_0xe01f('0x17')]){if(_0xa6da95[_0xe01f('0x17')][_0xe01f('0x1e')]===0x1f4){return _0x570d48(_0xa6da95[_0xe01f('0x17')][_0xe01f('0x1f')]);}return _0x3c34fa(_0xa6da95['error']['message']);}else{_0x3c34fa(_0xa6da95[_0xe01f('0x20')]);}})[_0xe01f('0x21')](function(_0x3f92ca){_0x570d48(_0x3f92ca);});});}function getAgent(_0x3ec80a){return db['User'][_0xe01f('0x22')]({'where':{'id':_0x3ec80a,'role':_0xe01f('0x23')}})['then'](checkError());}function getAgentCheckSession(_0x378c93,_0x5b9c5e){return new BPromise(function(_0x1b77c8,_0x387044){var _0x13dcd4=respondWithRpcPromise('VoiceChannels');var _0x940cb6=getAgent(_0x378c93);Promise['all']([_0x13dcd4,_0x940cb6])[_0xe01f('0x1d')](function(_0x232ad1){var _0x2e4568=_0x232ad1[0x0];var _0x2dbc94=_0x232ad1[0x1];var _0x35bd53=_[_0xe01f('0x24')](_0x2e4568[_0xe01f('0x25')],function(_0x41d13d){return _0x41d13d[_0xe01f('0x26')]==_0x2dbc94['id']&&_0x41d13d['sessionId']==_0x5b9c5e;});if(_0x35bd53[_0xe01f('0x27')]==0x1){_0x1b77c8(_0x2dbc94);}else{_0x387044(new RangeError('sessionId\x20'+_0x5b9c5e+_0xe01f('0x28')));}});});}exports[_0xe01f('0x29')]=function(_0x51fe9b,_0x15f98f){logger[_0xe01f('0x12')](_0xe01f('0x2a'),_0x51fe9b['body']);var _0x2e417b=originateValidation[_0xe01f('0x2b')](_0x51fe9b[_0xe01f('0x2c')]);if(_0x2e417b[_0xe01f('0x27')]>0x0){return _0x15f98f[_0xe01f('0x19')](0x190)['json'](_0x2e417b);}var _0x57aed0=_0x51fe9b['body'][_0xe01f('0x2d')];var _0x4c9f2e=_0x51fe9b[_0xe01f('0x2c')][_0xe01f('0x2e')];var _0x463687=_0x51fe9b[_0xe01f('0x2c')][_0xe01f('0x2f')];var _0x83c32=_0x51fe9b[_0xe01f('0x2c')][_0xe01f('0x30')];return getAgent(_0x57aed0)['then'](function(_0x53c309){logger[_0xe01f('0x12')](_0xe01f('0x31'),_0x53c309[_0xe01f('0x18')]);emit(util[_0xe01f('0x32')]('user:%s',_0x53c309[_0xe01f('0x18')]),_0xe01f('0x33'),{'callNumber':_0x4c9f2e,'callerId':_0x463687,'callbackUrl':_0x83c32});return _0x15f98f[_0xe01f('0x19')](0xc8)['json']({'error':![],'message':_0xe01f('0x34')});})[_0xe01f('0x21')](handleError(_0x15f98f));};exports[_0xe01f('0x35')]=function(_0x2fcc0c,_0xddb14b){logger[_0xe01f('0x12')](_0xe01f('0x36'),_0x2fcc0c[_0xe01f('0x2c')]);var _0x29c47f=hangupValidation[_0xe01f('0x2b')](_0x2fcc0c[_0xe01f('0x2c')]);if(_0x29c47f[_0xe01f('0x27')]>0x0){return _0xddb14b[_0xe01f('0x19')](0x190)[_0xe01f('0x37')](_0x29c47f);}var _0x16ab3c=_0x2fcc0c['body'][_0xe01f('0x2d')];var _0x1643a4=_0x2fcc0c[_0xe01f('0x2c')][_0xe01f('0x38')];return getAgent(_0x16ab3c)['then'](function(_0x36783f){logger[_0xe01f('0x12')](_0xe01f('0x31'),_0x36783f[_0xe01f('0x18')]);emit(util[_0xe01f('0x32')](_0xe01f('0x39'),_0x36783f['name']),_0xe01f('0x3a'),{'sessionId':_0x1643a4});return _0xddb14b[_0xe01f('0x19')](0xc8)[_0xe01f('0x37')]({'error':![],'message':_0xe01f('0x3b')});})[_0xe01f('0x21')](handleError(_0xddb14b));};exports[_0xe01f('0x3c')]=function(_0x861971,_0x305659){logger[_0xe01f('0x12')]('answer\x20fired:',_0x861971['body']);var _0x3dd453=answerValidation[_0xe01f('0x2b')](_0x861971['body']);if(_0x3dd453[_0xe01f('0x27')]>0x0){return _0x305659[_0xe01f('0x19')](0x190)[_0xe01f('0x37')](_0x3dd453);}var _0x5625d8=_0x861971[_0xe01f('0x2c')][_0xe01f('0x2d')];var _0x56785b=_0x861971['body']['sessionId'];return getAgent(_0x5625d8)[_0xe01f('0x1d')](function(_0x53c81b){logger[_0xe01f('0x12')]('entityFound:',_0x53c81b[_0xe01f('0x18')]);emit(util[_0xe01f('0x32')](_0xe01f('0x39'),_0x53c81b[_0xe01f('0x18')]),_0xe01f('0x3d'),{'sessionId':_0x56785b});return _0x305659[_0xe01f('0x19')](0xc8)[_0xe01f('0x37')]({'error':![],'message':_0xe01f('0x3e')});})[_0xe01f('0x21')](handleError(_0x305659));};exports[_0xe01f('0x3f')]=function(_0x18bb53,_0x580df5){logger[_0xe01f('0x12')](_0xe01f('0x40'),_0x18bb53[_0xe01f('0x2c')]);var _0x3c3d64=holdValidation[_0xe01f('0x2b')](_0x18bb53['body']);if(_0x3c3d64[_0xe01f('0x27')]>0x0){return _0x580df5['status'](0x190)['json'](_0x3c3d64);}var _0x25437f=_0x18bb53[_0xe01f('0x2c')][_0xe01f('0x2d')];var _0x1d8614=_0x18bb53[_0xe01f('0x2c')]['sessionId'];return getAgent(_0x25437f)[_0xe01f('0x1d')](function(_0x337c5d){logger[_0xe01f('0x12')](_0xe01f('0x31'),_0x337c5d[_0xe01f('0x18')]);emit(util[_0xe01f('0x32')](_0xe01f('0x39'),_0x337c5d['name']),_0xe01f('0x41'),{'sessionId':_0x1d8614});return _0x580df5['status'](0xc8)[_0xe01f('0x37')]({'error':![],'message':_0xe01f('0x42')});})['catch'](handleError(_0x580df5));};exports[_0xe01f('0x43')]=function(_0x100742,_0x457bb0){logger[_0xe01f('0x12')](_0xe01f('0x44'),_0x100742[_0xe01f('0x2c')]);var _0x5b04b5=unholdValidation['validate'](_0x100742[_0xe01f('0x2c')]);if(_0x5b04b5[_0xe01f('0x27')]>0x0){return _0x457bb0['status'](0x190)[_0xe01f('0x37')](_0x5b04b5);}var _0x38c8ef=_0x100742[_0xe01f('0x2c')][_0xe01f('0x2d')];var _0x56d558=_0x100742[_0xe01f('0x2c')]['sessionId'];return getAgent(_0x38c8ef)[_0xe01f('0x1d')](function(_0xfbce52){logger['info'](_0xe01f('0x31'),_0xfbce52[_0xe01f('0x18')]);emit(util[_0xe01f('0x32')](_0xe01f('0x39'),_0xfbce52[_0xe01f('0x18')]),_0xe01f('0x45'),{'sessionId':_0x56d558});return _0x457bb0['status'](0xc8)[_0xe01f('0x37')]({'error':![],'message':'unhold\x20executed!'});})['catch'](handleError(_0x457bb0));};exports[_0xe01f('0x46')]=function(_0x2d53cb,_0x2161b4){logger[_0xe01f('0x12')](_0xe01f('0x47'),_0x2161b4[_0xe01f('0x2c')]);var _0x3949e1=callsValidation[_0xe01f('0x2b')](_0x2d53cb['body']);if(_0x3949e1['length']>0x0){return _0x2161b4[_0xe01f('0x19')](0x190)['json'](_0x3949e1);}var _0x3ee275=_0x2d53cb[_0xe01f('0x2c')][_0xe01f('0x2d')];var _0x33a11b=respondWithRpcPromise(_0xe01f('0x48'));var _0x4dfb61=getAgent(_0x3ee275);return Promise[_0xe01f('0x49')]([_0x33a11b,_0x4dfb61])[_0xe01f('0x1d')](function(_0x4c6d3f){var _0x3bda53=_0x4c6d3f[0x0];var _0x4dd65c=_0x4c6d3f[0x1];var _0xfb20c6=_['filter'](_0x3bda53[_0xe01f('0x25')],function(_0xe1e5df){return _0xe1e5df[_0xe01f('0x26')]==_0x4dd65c['id'];});return _0x2161b4[_0xe01f('0x19')](0xc8)[_0xe01f('0x37')]({'count':_0xfb20c6[_0xe01f('0x27')],'rows':_0xfb20c6});})[_0xe01f('0x21')](handleError(_0x2161b4));};exports[_0xe01f('0x4a')]=function(_0x5d51e5,_0x1be0f4){logger[_0xe01f('0x12')]('conference\x20fired:',_0x5d51e5[_0xe01f('0x2c')]);var _0x5ca10d=conferenceValidation[_0xe01f('0x2b')](_0x5d51e5[_0xe01f('0x2c')]);if(_0x5ca10d['length']>0x0){return _0x1be0f4[_0xe01f('0x19')](0x190)['json'](_0x5ca10d);}var _0x41c750=_0x5d51e5['body'][_0xe01f('0x2d')];return getAgent(_0x41c750)[_0xe01f('0x1d')](function(_0x141140){logger[_0xe01f('0x12')](_0xe01f('0x31'),_0x141140[_0xe01f('0x18')]);emit(util['format']('user:%s',_0x141140[_0xe01f('0x18')]),'webbar:conference');return _0x1be0f4[_0xe01f('0x19')](0xc8)['json']({'error':![],'message':_0xe01f('0x4b')});})[_0xe01f('0x21')](handleError(_0x1be0f4));};exports[_0xe01f('0x4c')]=function(_0x5a28cc,_0x5e26cb){logger[_0xe01f('0x12')]('transfer\x20fired:',_0x5a28cc['body']);var _0x1a03c6=transferValidation[_0xe01f('0x2b')](_0x5a28cc[_0xe01f('0x2c')]);if(_0x1a03c6[_0xe01f('0x27')]>0x0){return _0x5e26cb[_0xe01f('0x19')](0x190)[_0xe01f('0x37')](_0x1a03c6);}var _0x19b448=_0x5a28cc[_0xe01f('0x2c')][_0xe01f('0x2d')];var _0x526d0a=_0x5a28cc['body']['sessionId'];var _0x47c632=_0x5a28cc[_0xe01f('0x2c')][_0xe01f('0x4d')];return getAgent(_0x19b448)[_0xe01f('0x1d')](function(_0x3e5cb2){logger[_0xe01f('0x12')]('entityFound:',_0x3e5cb2[_0xe01f('0x18')]);emit(util['format'](_0xe01f('0x39'),_0x3e5cb2[_0xe01f('0x18')]),_0xe01f('0x4e'),{'sessionId':_0x526d0a,'transferNumber':_0x47c632});return _0x5e26cb[_0xe01f('0x19')](0xc8)['json']({'error':![],'message':'transfer\x20executed!'});})[_0xe01f('0x21')](handleError(_0x5e26cb));};
\ No newline at end of file
+var _0x0c6d=['catch','hangup','hangup\x20fired:','user:%s','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','format','webbar:answer','answer\x20executed!','hold','webbar:hold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','all','conference','conference\x20fired:','webbar:conference','transfer','transfer\x20fired:','transferNumber','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','http','redis','defaults','socket.io-emitter','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','stack','name','status','send','NotFound','then','error','message','result','findOne','agent','VoiceChannels','filter','rows','UserId','sessionId','sessionId\x20','originate','body','length','json','userId','callNumber','callerId','callbackUrl','entityFound:','webbar:originate','originate\x20executed!'];(function(_0x4a7843,_0x24f6d1){var _0x2c57fe=function(_0x37fbc9){while(--_0x37fbc9){_0x4a7843['push'](_0x4a7843['shift']());}};_0x2c57fe(++_0x24f6d1);}(_0x0c6d,0xf7));var _0xd0c6=function(_0x2285a8,_0x4aba6c){_0x2285a8=_0x2285a8-0x0;var _0x1459b4=_0x0c6d[_0x2285a8];return _0x1459b4;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0xd0c6('0x0'));var db=require(_0xd0c6('0x1'))['db'];var config=require(_0xd0c6('0x2'));var util=require(_0xd0c6('0x3'));var BPromise=require(_0xd0c6('0x4'));var jayson=require(_0xd0c6('0x5'));var amiClient=jayson['client'][_0xd0c6('0x6')]({'port':0x232a});var logger=require('../../config/logger')('webbarapi');var Redis=require('ioredis');config[_0xd0c6('0x7')]=_[_0xd0c6('0x8')](config[_0xd0c6('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xd0c6('0x9'))(new Redis(config['redis']));var Schema=require(_0xd0c6('0xa'));var originateValidation=new Schema({'userId':{'type':_0xd0c6('0xb'),'required':[!![],_0xd0c6('0xc')]},'callNumber':{'type':_0xd0c6('0xd'),'required':[!![],_0xd0c6('0xe')]},'callerId':{'type':_0xd0c6('0xd')},'callbackUrl':{'type':_0xd0c6('0xd')}});var hangupValidation=new Schema({'userId':{'type':_0xd0c6('0xb'),'required':[!![],_0xd0c6('0xc')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0xd0c6('0xb'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0xd0c6('0xb'),'required':[!![],_0xd0c6('0xc')]},'sessionId':{'type':_0xd0c6('0xd'),'required':[!![],_0xd0c6('0xf')]},'transferNumber':{'type':_0xd0c6('0xd'),'required':[!![],_0xd0c6('0x10')]}});var holdValidation=new Schema({'userId':{'type':_0xd0c6('0xb'),'required':[!![],_0xd0c6('0xc')]},'sessionId':{'type':_0xd0c6('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xd0c6('0xb'),'required':[!![],_0xd0c6('0xc')]},'sessionId':{'type':_0xd0c6('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xd0c6('0xb'),'required':[!![],_0xd0c6('0xc')]}});var conferenceValidation=new Schema({'userId':{'type':_0xd0c6('0xb'),'required':[!![],_0xd0c6('0xc')]}});function emit(_0x1e45b3,_0x429727,_0x4e2fc7){logger[_0xd0c6('0x11')](_0x1e45b3,_0x429727,JSON[_0xd0c6('0x12')](_0x4e2fc7));io['to'](_0x1e45b3)[_0xd0c6('0x13')](_0x429727,_0x4e2fc7);}function handleError(_0x3d395a){return function(_0x941021){console[_0xd0c6('0x14')]('handleError:',_0x941021,_0x941021 instanceof RangeError);logger['error'](_0x941021[_0xd0c6('0x15')]);if(_0x941021 instanceof RangeError){if(_0x941021[_0xd0c6('0x16')]){delete _0x941021['name'];}_0x3d395a['status'](0x194)['send'](_0x941021);}else{if(_0x941021[_0xd0c6('0x16')]){delete _0x941021[_0xd0c6('0x16')];}_0x3d395a[_0xd0c6('0x17')](0x1f4)[_0xd0c6('0x18')](_0x941021);}};}function checkError(){return function(_0x1efae9){if(!_0x1efae9){throw new RangeError(_0xd0c6('0x19'));}return _0x1efae9;};}function respondWithRpcPromise(_0x2a8b29,_0x296347){return new BPromise(function(_0x5f191a,_0x2f7559){var _0x1e8384=amiClient;return _0x1e8384['request'](_0x2a8b29,_0x296347)[_0xd0c6('0x1a')](function(_0x2251e0){if(_0x2251e0[_0xd0c6('0x1b')]){if(_0x2251e0['error']['code']===0x1f4){return _0x2f7559(_0x2251e0[_0xd0c6('0x1b')][_0xd0c6('0x1c')]);}return _0x5f191a(_0x2251e0['error'][_0xd0c6('0x1c')]);}else{_0x5f191a(_0x2251e0[_0xd0c6('0x1d')]);}})['catch'](function(_0x6d77cb){_0x2f7559(_0x6d77cb);});});}function getAgent(_0x5c71b6){return db['User'][_0xd0c6('0x1e')]({'where':{'id':_0x5c71b6,'role':_0xd0c6('0x1f')}})['then'](checkError());}function getAgentCheckSession(_0x414124,_0x4368fa){return new BPromise(function(_0x3802af,_0x38d411){var _0x456fcb=respondWithRpcPromise(_0xd0c6('0x20'));var _0x1ed9a9=getAgent(_0x414124);Promise['all']([_0x456fcb,_0x1ed9a9])[_0xd0c6('0x1a')](function(_0xe5ae58){var _0x42587e=_0xe5ae58[0x0];var _0x231418=_0xe5ae58[0x1];var _0x18b747=_[_0xd0c6('0x21')](_0x42587e[_0xd0c6('0x22')],function(_0x14fcaa){return _0x14fcaa[_0xd0c6('0x23')]==_0x231418['id']&&_0x14fcaa[_0xd0c6('0x24')]==_0x4368fa;});if(_0x18b747['length']==0x1){_0x3802af(_0x231418);}else{_0x38d411(new RangeError(_0xd0c6('0x25')+_0x4368fa+'\x20not\x20found!'));}});});}exports[_0xd0c6('0x26')]=function(_0x9bfeea,_0x3779a7){logger[_0xd0c6('0x11')]('originate\x20fired:',_0x9bfeea['body']);var _0xc6a4b6=originateValidation['validate'](_0x9bfeea[_0xd0c6('0x27')]);if(_0xc6a4b6[_0xd0c6('0x28')]>0x0){return _0x3779a7[_0xd0c6('0x17')](0x190)[_0xd0c6('0x29')](_0xc6a4b6);}var _0x51d40a=_0x9bfeea[_0xd0c6('0x27')][_0xd0c6('0x2a')];var _0x1860c9=_0x9bfeea[_0xd0c6('0x27')][_0xd0c6('0x2b')];var _0x5a92f2=_0x9bfeea[_0xd0c6('0x27')][_0xd0c6('0x2c')];var _0x54ca4f=_0x9bfeea[_0xd0c6('0x27')][_0xd0c6('0x2d')];return getAgent(_0x51d40a)[_0xd0c6('0x1a')](function(_0x3840c3){logger['info'](_0xd0c6('0x2e'),_0x3840c3[_0xd0c6('0x16')]);emit(util['format']('user:%s',_0x3840c3['name']),_0xd0c6('0x2f'),{'callNumber':_0x1860c9,'callerId':_0x5a92f2,'callbackUrl':_0x54ca4f});return _0x3779a7['status'](0xc8)[_0xd0c6('0x29')]({'error':![],'message':_0xd0c6('0x30')});})[_0xd0c6('0x31')](handleError(_0x3779a7));};exports[_0xd0c6('0x32')]=function(_0x3d9907,_0x359233){logger[_0xd0c6('0x11')](_0xd0c6('0x33'),_0x3d9907[_0xd0c6('0x27')]);var _0x561b24=hangupValidation[_0xd0c6('0xa')](_0x3d9907[_0xd0c6('0x27')]);if(_0x561b24[_0xd0c6('0x28')]>0x0){return _0x359233[_0xd0c6('0x17')](0x190)['json'](_0x561b24);}var _0x1ea3f5=_0x3d9907['body'][_0xd0c6('0x2a')];var _0x29811f=_0x3d9907['body']['sessionId'];return getAgent(_0x1ea3f5)['then'](function(_0x410cce){logger[_0xd0c6('0x11')](_0xd0c6('0x2e'),_0x410cce[_0xd0c6('0x16')]);emit(util['format'](_0xd0c6('0x34'),_0x410cce[_0xd0c6('0x16')]),_0xd0c6('0x35'),{'sessionId':_0x29811f});return _0x359233[_0xd0c6('0x17')](0xc8)['json']({'error':![],'message':_0xd0c6('0x36')});})['catch'](handleError(_0x359233));};exports[_0xd0c6('0x37')]=function(_0x3b5966,_0x36fb44){logger[_0xd0c6('0x11')](_0xd0c6('0x38'),_0x3b5966[_0xd0c6('0x27')]);var _0x4a033a=answerValidation['validate'](_0x3b5966[_0xd0c6('0x27')]);if(_0x4a033a[_0xd0c6('0x28')]>0x0){return _0x36fb44[_0xd0c6('0x17')](0x190)['json'](_0x4a033a);}var _0x41b441=_0x3b5966[_0xd0c6('0x27')][_0xd0c6('0x2a')];var _0x49009a=_0x3b5966[_0xd0c6('0x27')][_0xd0c6('0x24')];return getAgent(_0x41b441)[_0xd0c6('0x1a')](function(_0x19f848){logger['info'](_0xd0c6('0x2e'),_0x19f848['name']);emit(util[_0xd0c6('0x39')]('user:%s',_0x19f848[_0xd0c6('0x16')]),_0xd0c6('0x3a'),{'sessionId':_0x49009a});return _0x36fb44['status'](0xc8)[_0xd0c6('0x29')]({'error':![],'message':_0xd0c6('0x3b')});})['catch'](handleError(_0x36fb44));};exports[_0xd0c6('0x3c')]=function(_0x3c3859,_0x304712){logger[_0xd0c6('0x11')]('hold\x20fired:',_0x3c3859[_0xd0c6('0x27')]);var _0x373fcb=holdValidation['validate'](_0x3c3859['body']);if(_0x373fcb[_0xd0c6('0x28')]>0x0){return _0x304712['status'](0x190)[_0xd0c6('0x29')](_0x373fcb);}var _0x218419=_0x3c3859[_0xd0c6('0x27')][_0xd0c6('0x2a')];var _0xe27f40=_0x3c3859[_0xd0c6('0x27')][_0xd0c6('0x24')];return getAgent(_0x218419)[_0xd0c6('0x1a')](function(_0x3b3cf4){logger['info'](_0xd0c6('0x2e'),_0x3b3cf4['name']);emit(util[_0xd0c6('0x39')](_0xd0c6('0x34'),_0x3b3cf4[_0xd0c6('0x16')]),_0xd0c6('0x3d'),{'sessionId':_0xe27f40});return _0x304712['status'](0xc8)[_0xd0c6('0x29')]({'error':![],'message':'hold\x20executed!'});})['catch'](handleError(_0x304712));};exports['unhold']=function(_0x1509b5,_0x4404dc){logger[_0xd0c6('0x11')](_0xd0c6('0x3e'),_0x1509b5[_0xd0c6('0x27')]);var _0x2da020=unholdValidation[_0xd0c6('0xa')](_0x1509b5[_0xd0c6('0x27')]);if(_0x2da020[_0xd0c6('0x28')]>0x0){return _0x4404dc[_0xd0c6('0x17')](0x190)['json'](_0x2da020);}var _0x37277a=_0x1509b5[_0xd0c6('0x27')][_0xd0c6('0x2a')];var _0x50a261=_0x1509b5[_0xd0c6('0x27')][_0xd0c6('0x24')];return getAgent(_0x37277a)[_0xd0c6('0x1a')](function(_0xcc0580){logger[_0xd0c6('0x11')](_0xd0c6('0x2e'),_0xcc0580['name']);emit(util[_0xd0c6('0x39')](_0xd0c6('0x34'),_0xcc0580[_0xd0c6('0x16')]),_0xd0c6('0x3f'),{'sessionId':_0x50a261});return _0x4404dc[_0xd0c6('0x17')](0xc8)['json']({'error':![],'message':_0xd0c6('0x40')});})[_0xd0c6('0x31')](handleError(_0x4404dc));};exports[_0xd0c6('0x41')]=function(_0x47f08c,_0x2231e3){logger[_0xd0c6('0x11')](_0xd0c6('0x42'),_0x2231e3[_0xd0c6('0x27')]);var _0x26e246=callsValidation['validate'](_0x47f08c[_0xd0c6('0x27')]);if(_0x26e246[_0xd0c6('0x28')]>0x0){return _0x2231e3['status'](0x190)[_0xd0c6('0x29')](_0x26e246);}var _0x3c1641=_0x47f08c[_0xd0c6('0x27')][_0xd0c6('0x2a')];var _0x2ff9f8=respondWithRpcPromise(_0xd0c6('0x20'));var _0x48d848=getAgent(_0x3c1641);return Promise[_0xd0c6('0x43')]([_0x2ff9f8,_0x48d848])[_0xd0c6('0x1a')](function(_0x389276){var _0x30b422=_0x389276[0x0];var _0x3ddfc5=_0x389276[0x1];var _0x2f86a2=_[_0xd0c6('0x21')](_0x30b422[_0xd0c6('0x22')],function(_0x33ed71){return _0x33ed71[_0xd0c6('0x23')]==_0x3ddfc5['id'];});return _0x2231e3['status'](0xc8)[_0xd0c6('0x29')]({'count':_0x2f86a2[_0xd0c6('0x28')],'rows':_0x2f86a2});})['catch'](handleError(_0x2231e3));};exports[_0xd0c6('0x44')]=function(_0x38a4de,_0xcae78a){logger[_0xd0c6('0x11')](_0xd0c6('0x45'),_0x38a4de[_0xd0c6('0x27')]);var _0x1c8209=conferenceValidation[_0xd0c6('0xa')](_0x38a4de[_0xd0c6('0x27')]);if(_0x1c8209[_0xd0c6('0x28')]>0x0){return _0xcae78a[_0xd0c6('0x17')](0x190)['json'](_0x1c8209);}var _0x1129a6=_0x38a4de['body']['userId'];return getAgent(_0x1129a6)[_0xd0c6('0x1a')](function(_0x416f14){logger['info'](_0xd0c6('0x2e'),_0x416f14[_0xd0c6('0x16')]);emit(util[_0xd0c6('0x39')](_0xd0c6('0x34'),_0x416f14[_0xd0c6('0x16')]),_0xd0c6('0x46'));return _0xcae78a[_0xd0c6('0x17')](0xc8)[_0xd0c6('0x29')]({'error':![],'message':'conference\x20executed!'});})[_0xd0c6('0x31')](handleError(_0xcae78a));};exports[_0xd0c6('0x47')]=function(_0x5cfe6e,_0x2a99a1){logger[_0xd0c6('0x11')](_0xd0c6('0x48'),_0x5cfe6e[_0xd0c6('0x27')]);var _0x53cbd4=transferValidation[_0xd0c6('0xa')](_0x5cfe6e['body']);if(_0x53cbd4['length']>0x0){return _0x2a99a1[_0xd0c6('0x17')](0x190)[_0xd0c6('0x29')](_0x53cbd4);}var _0x184bdd=_0x5cfe6e[_0xd0c6('0x27')][_0xd0c6('0x2a')];var _0x122fa2=_0x5cfe6e[_0xd0c6('0x27')]['sessionId'];var _0x4ac8c7=_0x5cfe6e[_0xd0c6('0x27')][_0xd0c6('0x49')];return getAgent(_0x184bdd)[_0xd0c6('0x1a')](function(_0x2efb17){logger['info'](_0xd0c6('0x2e'),_0x2efb17[_0xd0c6('0x16')]);emit(util['format'](_0xd0c6('0x34'),_0x2efb17[_0xd0c6('0x16')]),'webbar:transfer',{'sessionId':_0x122fa2,'transferNumber':_0x4ac8c7});return _0x2a99a1['status'](0xc8)[_0xd0c6('0x29')]({'error':![],'message':'transfer\x20executed!'});})['catch'](handleError(_0x2a99a1));};
\ No newline at end of file
index 4a344e5..7560f7c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda2d=['/:id','removeDispositions','removeAnswers','/:id/users','removeAgents','exports','util','path','connect-timeout','express','Router','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addApplications','/:id/notify','notify','/:id/send','send','put','delete'];(function(_0x4aeb40,_0x29246a){var _0x38d074=function(_0x228bab){while(--_0x228bab){_0x4aeb40['push'](_0x4aeb40['shift']());}};_0x38d074(++_0x29246a);}(_0xda2d,0x102));var _0xdda2=function(_0x4e958a,_0xa40703){_0x4e958a=_0x4e958a-0x0;var _0x538365=_0xda2d[_0x4e958a];return _0x538365;};'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('0x7')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xc')]);router['get'](_0xdda2('0xd'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xe')]);router[_0xdda2('0x7')](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x10')]);router[_0xdda2('0x7')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0xdda2('0x7')](_0xdda2('0x11'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x12')]);router[_0xdda2('0x13')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x14')]);router['post'](_0xdda2('0xd'),auth['isAuthenticated'](),controller[_0xdda2('0x15')]);router[_0xdda2('0x13')](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x16')]);router['post']('/:id/users',auth[_0xdda2('0x8')](),controller['addAgents']);router[_0xdda2('0x13')](_0xdda2('0x11'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x17')]);router[_0xdda2('0x13')](_0xdda2('0x18'),controller[_0xdda2('0x19')]);router[_0xdda2('0x13')](_0xdda2('0x1a'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x1b')]);router[_0xdda2('0x1c')]('/:id',auth[_0xdda2('0x8')](),controller['update']);router[_0xdda2('0x1d')](_0xdda2('0x1e'),auth[_0xdda2('0x8')](),controller['destroy']);router[_0xdda2('0x1d')]('/:id/dispositions',auth[_0xdda2('0x8')](),controller[_0xdda2('0x1f')]);router['delete'](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x20')]);router[_0xdda2('0x1d')](_0xdda2('0x21'),auth['isAuthenticated'](),controller[_0xdda2('0x22')]);module[_0xdda2('0x23')]=router;
\ No newline at end of file
+var _0xe2fe=['removeAgents','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','/:id/dispositions','getAgents','/:id/applications','getApplications','post','addDisposition','/:id/canned_answers','addAnswer','/:id/users','addAgents','addApplications','/:id/notify','notify','send','put','destroy','delete','removeDispositions','removeAnswers'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xee2f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xee2f('0x1'));var express=require('express');var router=express[_0xee2f('0x2')]();var fs_extra=require(_0xee2f('0x3'));var auth=require(_0xee2f('0x4'));var interaction=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var controller=require('./whatsappAccount.controller');router[_0xee2f('0x7')]('/',auth[_0xee2f('0x8')](),controller['index']);router[_0xee2f('0x7')](_0xee2f('0x9'),auth['isAuthenticated'](),controller[_0xee2f('0xa')]);router['get'](_0xee2f('0xb'),auth[_0xee2f('0x8')](),controller['show']);router[_0xee2f('0x7')](_0xee2f('0xc'),auth['isAuthenticated'](),controller['getDispositions']);router['get']('/:id/canned_answers',auth[_0xee2f('0x8')](),controller['getAnswers']);router['get']('/:id/users',auth[_0xee2f('0x8')](),controller[_0xee2f('0xd')]);router[_0xee2f('0x7')](_0xee2f('0xe'),auth[_0xee2f('0x8')](),controller[_0xee2f('0xf')]);router['post']('/',auth[_0xee2f('0x8')](),controller['create']);router[_0xee2f('0x10')](_0xee2f('0xc'),auth['isAuthenticated'](),controller[_0xee2f('0x11')]);router[_0xee2f('0x10')](_0xee2f('0x12'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x13')]);router['post'](_0xee2f('0x14'),auth['isAuthenticated'](),controller[_0xee2f('0x15')]);router[_0xee2f('0x10')]('/:id/applications',auth['isAuthenticated'](),controller[_0xee2f('0x16')]);router['post'](_0xee2f('0x17'),controller[_0xee2f('0x18')]);router[_0xee2f('0x10')]('/:id/send',auth[_0xee2f('0x8')](),controller[_0xee2f('0x19')]);router[_0xee2f('0x1a')](_0xee2f('0xb'),auth[_0xee2f('0x8')](),controller['update']);router['delete'](_0xee2f('0xb'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x1b')]);router[_0xee2f('0x1c')](_0xee2f('0xc'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x1d')]);router['delete'](_0xee2f('0x12'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x1e')]);router[_0xee2f('0x1c')](_0xee2f('0x14'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x1f')]);module[_0xee2f('0x20')]=router;
\ No newline at end of file
index 42f0b25..80b6e59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6af1=['name','STRING','generate','ENUM','twilio','INTEGER','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','exports'];(function(_0x487d0a,_0x1b7cb4){var _0x3d740c=function(_0xa714f2){while(--_0xa714f2){_0x487d0a['push'](_0x487d0a['shift']());}};_0x3d740c(++_0x1b7cb4);}(_0x6af1,0xd0));var _0x16af=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6af1[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x16af('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x16af('0x1'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x16af('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x16af('0x2')],'defaultValue':function(){return rs[_0x16af('0x3')]();}},'phone':{'type':Sequelize[_0x16af('0x2')]},'type':{'type':Sequelize[_0x16af('0x4')](_0x16af('0x5'),'sinch')},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x16af('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x16af('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x16af('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x16af('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x16af('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x16af('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x16af('0x6')],'comment':_0x16af('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x16af('0x7')],'defaultValue':![],'comment':_0x16af('0x9'),'set':function(_0x1fd2f7){if(!_0x1fd2f7){this['setDataValue']('mandatoryDispositionPauseId',null);}this['setDataValue'](_0x16af('0xa'),_0x1fd2f7);}},'description':{'type':Sequelize[_0x16af('0x2')]}};
\ No newline at end of file
+var _0x6bcf=['setDataValue','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','generate','twilio','sinch','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x2106e0,_0x57e335){var _0x22e4f0=function(_0x2b8ba8){while(--_0x2b8ba8){_0x2106e0['push'](_0x2106e0['shift']());}};_0x22e4f0(++_0x57e335);}(_0x6bcf,0x6b));var _0xf6bc=function(_0x372774,_0x12eedb){_0x372774=_0x372774-0x0;var _0x397f18=_0x6bcf[_0x372774];return _0x397f18;};'use strict';var Sequelize=require(_0xf6bc('0x0'));var rs=require(_0xf6bc('0x1'));module[_0xf6bc('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xf6bc('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xf6bc('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0xf6bc('0x4')],'allowNull':![]},'token':{'type':Sequelize[_0xf6bc('0x4')],'defaultValue':function(){return rs[_0xf6bc('0x5')]();}},'phone':{'type':Sequelize[_0xf6bc('0x4')]},'type':{'type':Sequelize['ENUM'](_0xf6bc('0x6'),_0xf6bc('0x7'))},'accountSid':{'type':Sequelize[_0xf6bc('0x4')]},'baseUrl':{'type':Sequelize[_0xf6bc('0x4')]},'authToken':{'type':Sequelize[_0xf6bc('0x4')]},'notificationTemplate':{'type':Sequelize[_0xf6bc('0x8')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xf6bc('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf6bc('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xf6bc('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf6bc('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf6bc('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf6bc('0xa')],'comment':_0xf6bc('0xb')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xf6bc('0xc'),'set':function(_0x588882){if(!_0x588882){this[_0xf6bc('0xd')]('mandatoryDispositionPauseId',null);}this[_0xf6bc('0xd')](_0xf6bc('0xe'),_0x588882);}},'description':{'type':Sequelize[_0xf6bc('0x4')]}};
\ No newline at end of file
index fe83f6f..a4b9a1f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf5b5=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','pick','type','filter','merge','options','includeAll','show','params','include','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','mandatoryDispositionPause','describe','WhatsappAccountId','Disposition','findOne','keys','sort','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','order','findAll','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','User','getAgents','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','sendStatus','getApplications','whatsapp','Applications','account','statuses','WhatsappMessage','timestamp','message_id','applications','orderBy','asc','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','replace','whatsapp:','Body','messageId','MessageSid','sinch','notifications','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','ValidationError','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','contact','WhatsappInteraction','interaction','autoclose','unmanaged','*,*,*,*','ContactId','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','stringify','Content-Type','text/xml','to\x20is\x20mandatory','List','out','Messages','dataValues','push','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','request','then','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','WhatsappAccount,\x20%s,\x20%s','message','info','result','catch','status','end','json','offset','limit','count','set','Content-Range','apply','save','destroy','get','stack','name','send','Pause','map','WhatsappAccount','rawAttributes','key','model','query'];(function(_0x2993ce,_0x1e1a96){var _0x36df2a=function(_0x205279){while(--_0x205279){_0x2993ce['push'](_0x2993ce['shift']());}};_0x36df2a(++_0x1e1a96);}(_0xf5b5,0x13b));var _0x5f5b=function(_0x3cb261,_0xeff7a7){_0x3cb261=_0x3cb261-0x0;var _0x49386c=_0xf5b5[_0x3cb261];return _0x49386c;};'use strict';var emlformat=require(_0x5f5b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5f5b('0x1'));var jsonpatch=require(_0x5f5b('0x2'));var rp=require(_0x5f5b('0x3'));var moment=require('moment');var BPromise=require(_0x5f5b('0x4'));var Mustache=require(_0x5f5b('0x5'));var util=require('util');var path=require('path');var sox=require(_0x5f5b('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5f5b('0x7'));var squel=require('squel');var crypto=require(_0x5f5b('0x8'));var jsforce=require(_0x5f5b('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5f5b('0xa'));var Papa=require(_0x5f5b('0xb'));var Redis=require('ioredis');var authService=require(_0x5f5b('0xc'));var qs=require(_0x5f5b('0xd'));var as=require(_0x5f5b('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5f5b('0xf'))(_0x5f5b('0x10'));var utils=require(_0x5f5b('0x11'));var config=require(_0x5f5b('0x12'));var licenseUtil=require(_0x5f5b('0x13'));var db=require(_0x5f5b('0x14'))['db'];config[_0x5f5b('0x15')]=_[_0x5f5b('0x16')](config[_0x5f5b('0x15')],{'host':_0x5f5b('0x17'),'port':0x18eb});var socket=require(_0x5f5b('0x18'))(new Redis(config[_0x5f5b('0x15')]));require(_0x5f5b('0x19'))[_0x5f5b('0x1a')](socket);var jayson=require(_0x5f5b('0x1b'));var client=jayson[_0x5f5b('0x1c')][_0x5f5b('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x478269,_0x7b2561,_0x2800b2,_0x514239){return new BPromise(function(_0xead06f,_0x147575){var _0xf5a5=_0x514239||client;return _0xf5a5[_0x5f5b('0x1e')](_0x478269,_0x2800b2)[_0x5f5b('0x1f')](function(_0x533700){logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x7b2561,_0x5f5b('0x20'));logger[_0x5f5b('0x21')](_0x5f5b('0x22'),_0x7b2561,_0x5f5b('0x20'),JSON['stringify'](_0x533700));if(_0x533700[_0x5f5b('0x23')]){if(_0x533700[_0x5f5b('0x23')]['code']===0x1f4){logger[_0x5f5b('0x23')](_0x5f5b('0x24'),_0x7b2561,_0x533700[_0x5f5b('0x23')][_0x5f5b('0x25')]);return _0x147575(_0x533700['error'][_0x5f5b('0x25')]);}logger[_0x5f5b('0x23')](_0x5f5b('0x24'),_0x7b2561,_0x533700[_0x5f5b('0x23')][_0x5f5b('0x25')]);return _0xead06f(_0x533700[_0x5f5b('0x23')][_0x5f5b('0x25')]);}else{logger[_0x5f5b('0x26')](_0x5f5b('0x24'),_0x7b2561,_0x5f5b('0x20'));_0xead06f(_0x533700[_0x5f5b('0x27')][_0x5f5b('0x25')]);}})[_0x5f5b('0x28')](function(_0x17deda){logger[_0x5f5b('0x23')]('WhatsappAccount,\x20%s,\x20%s',_0x7b2561,_0x17deda);_0x147575(_0x17deda);});});}function respondWithStatusCode(_0x8db270,_0x10c306){_0x10c306=_0x10c306||0xcc;return function(_0x2eb8b1){if(_0x2eb8b1){return _0x8db270['sendStatus'](_0x10c306);}return _0x8db270[_0x5f5b('0x29')](_0x10c306)[_0x5f5b('0x2a')]();};}function respondWithResult(_0x3e3342,_0x1d5cdb){_0x1d5cdb=_0x1d5cdb||0xc8;return function(_0x2dcd7b){if(_0x2dcd7b){return _0x3e3342[_0x5f5b('0x29')](_0x1d5cdb)[_0x5f5b('0x2b')](_0x2dcd7b);}};}function respondWithFilteredResult(_0x5ed95d,_0x547187){return function(_0x5f0f62){if(_0x5f0f62){var _0x439b4=typeof _0x547187[_0x5f5b('0x2c')]==='undefined'&&typeof _0x547187[_0x5f5b('0x2d')]==='undefined';var _0x5b030c=_0x5f0f62[_0x5f5b('0x2e')];var _0x1932ec=_0x439b4?0x0:_0x547187[_0x5f5b('0x2c')];var _0x12272e=_0x439b4?_0x5f0f62[_0x5f5b('0x2e')]:_0x547187['offset']+_0x547187[_0x5f5b('0x2d')];var _0x513d26;if(_0x12272e>=_0x5b030c){_0x12272e=_0x5b030c;_0x513d26=0xc8;}else{_0x513d26=0xce;}_0x5ed95d[_0x5f5b('0x29')](_0x513d26);return _0x5ed95d[_0x5f5b('0x2f')](_0x5f5b('0x30'),_0x1932ec+'-'+_0x12272e+'/'+_0x5b030c)[_0x5f5b('0x2b')](_0x5f0f62);}return null;};}function patchUpdates(_0x33b3d3){return function(_0x5ce09d){try{jsonpatch[_0x5f5b('0x31')](_0x5ce09d,_0x33b3d3,!![]);}catch(_0x2edd22){return BPromise['reject'](_0x2edd22);}return _0x5ce09d[_0x5f5b('0x32')]();};}function saveUpdates(_0x2d3578,_0x24f69c){return function(_0xafda47){if(_0xafda47){return _0xafda47['update'](_0x2d3578)[_0x5f5b('0x1f')](function(_0x379fd4){return _0x379fd4;});}return null;};}function removeEntity(_0x36fdae,_0x42278a){return function(_0x4d8eaa){if(_0x4d8eaa){return _0x4d8eaa[_0x5f5b('0x33')]()['then'](function(){var _0x363b8c=_0x4d8eaa[_0x5f5b('0x34')]({'plain':!![]});var _0xd3a28b='WhatsappAccounts';return db['UserProfileResource']['destroy']({'where':{'type':_0xd3a28b,'resourceId':_0x363b8c['id']}})[_0x5f5b('0x1f')](function(){return _0x4d8eaa;});})[_0x5f5b('0x1f')](function(){_0x36fdae[_0x5f5b('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43d225,_0x3d2ffb){return function(_0x135fcc){if(!_0x135fcc){_0x43d225['sendStatus'](0x194);}return _0x135fcc;};}function handleError(_0x1a19d1,_0x4445fe){_0x4445fe=_0x4445fe||0x1f4;return function(_0x59bd9c){logger[_0x5f5b('0x23')](_0x59bd9c[_0x5f5b('0x35')]);if(_0x59bd9c[_0x5f5b('0x36')]){delete _0x59bd9c['name'];}_0x1a19d1[_0x5f5b('0x29')](_0x4445fe)[_0x5f5b('0x37')](_0x59bd9c);};}exports['index']=function(_0x53b503,_0x4101ee){var _0x994c53={'include':[{'model':db[_0x5f5b('0x38')],'as':'mandatoryDispositionPause'}]},_0x3305f9={},_0x275df9={'count':0x0,'rows':[]};var _0x5b98c5=_[_0x5f5b('0x39')](db[_0x5f5b('0x3a')][_0x5f5b('0x3b')],function(_0x882806){return{'name':_0x882806['fieldName'],'type':_0x882806['type'][_0x5f5b('0x3c')]};});_0x3305f9[_0x5f5b('0x3d')]=_[_0x5f5b('0x39')](_0x5b98c5,'name');_0x3305f9['query']=_['keys'](_0x53b503[_0x5f5b('0x3e')]);_0x3305f9[_0x5f5b('0x3f')]=_[_0x5f5b('0x40')](_0x3305f9[_0x5f5b('0x3d')],_0x3305f9[_0x5f5b('0x3e')]);_0x994c53[_0x5f5b('0x41')]=_[_0x5f5b('0x40')](_0x3305f9[_0x5f5b('0x3d')],qs['fields'](_0x53b503[_0x5f5b('0x3e')][_0x5f5b('0x42')]));_0x994c53['attributes']=_0x994c53[_0x5f5b('0x41')][_0x5f5b('0x43')]?_0x994c53['attributes']:_0x3305f9[_0x5f5b('0x3d')];if(!_0x53b503[_0x5f5b('0x3e')][_0x5f5b('0x44')](_0x5f5b('0x45'))){_0x994c53['limit']=qs[_0x5f5b('0x2d')](_0x53b503[_0x5f5b('0x3e')][_0x5f5b('0x2d')]);_0x994c53[_0x5f5b('0x2c')]=qs[_0x5f5b('0x2c')](_0x53b503[_0x5f5b('0x3e')]['offset']);}_0x994c53['order']=qs['sort'](_0x53b503[_0x5f5b('0x3e')]['sort']);_0x994c53[_0x5f5b('0x46')]=qs[_0x5f5b('0x3f')](_[_0x5f5b('0x47')](_0x53b503[_0x5f5b('0x3e')],_0x3305f9[_0x5f5b('0x3f')]),_0x5b98c5);if(_0x53b503[_0x5f5b('0x3e')]['filter']){_0x994c53[_0x5f5b('0x46')]=_['merge'](_0x994c53['where'],{'$or':_[_0x5f5b('0x39')](_0x5b98c5,function(_0x52144a){if(_0x52144a[_0x5f5b('0x48')]!=='VIRTUAL'){var _0x17a578={};_0x17a578[_0x52144a[_0x5f5b('0x36')]]={'$like':'%'+_0x53b503[_0x5f5b('0x3e')][_0x5f5b('0x49')]+'%'};return _0x17a578;}})});}_0x994c53=_[_0x5f5b('0x4a')]({},_0x994c53,_0x53b503[_0x5f5b('0x4b')]);var _0x31748e={'where':_0x994c53['where']};return db[_0x5f5b('0x3a')][_0x5f5b('0x2e')](_0x31748e)[_0x5f5b('0x1f')](function(_0x35d97b){_0x275df9[_0x5f5b('0x2e')]=_0x35d97b;if(_0x53b503[_0x5f5b('0x3e')][_0x5f5b('0x4c')]){_0x994c53['include']=[{'all':!![]}];}return db[_0x5f5b('0x3a')]['findAll'](_0x994c53);})['then'](function(_0x1cd1d4){_0x275df9['rows']=_0x1cd1d4;return _0x275df9;})[_0x5f5b('0x1f')](respondWithFilteredResult(_0x4101ee,_0x994c53))[_0x5f5b('0x28')](handleError(_0x4101ee,null));};exports[_0x5f5b('0x4d')]=function(_0x2a6778,_0x57b226){var _0x336873={'raw':![],'where':{'id':_0x2a6778[_0x5f5b('0x4e')]['id']},'include':[{'model':db[_0x5f5b('0x38')],'as':'mandatoryDispositionPause'}]},_0x19dd1c={};_0x19dd1c[_0x5f5b('0x3d')]=_['keys'](db[_0x5f5b('0x3a')][_0x5f5b('0x3b')]);_0x19dd1c[_0x5f5b('0x3e')]=_['keys'](_0x2a6778['query']);_0x19dd1c[_0x5f5b('0x3f')]=_['intersection'](_0x19dd1c[_0x5f5b('0x3d')],_0x19dd1c[_0x5f5b('0x3e')]);_0x336873[_0x5f5b('0x41')]=_[_0x5f5b('0x40')](_0x19dd1c[_0x5f5b('0x3d')],qs['fields'](_0x2a6778[_0x5f5b('0x3e')][_0x5f5b('0x42')]));_0x336873[_0x5f5b('0x41')]=_0x336873[_0x5f5b('0x41')][_0x5f5b('0x43')]?_0x336873[_0x5f5b('0x41')]:_0x19dd1c[_0x5f5b('0x3d')];if(_0x2a6778['query'][_0x5f5b('0x4c')]){_0x336873[_0x5f5b('0x4f')]=[{'all':!![]}];}_0x336873=_[_0x5f5b('0x4a')]({},_0x336873,_0x2a6778[_0x5f5b('0x4b')]);return db[_0x5f5b('0x3a')][_0x5f5b('0x50')](_0x336873)['then'](handleEntityNotFound(_0x57b226,null))[_0x5f5b('0x1f')](respondWithResult(_0x57b226,null))[_0x5f5b('0x28')](handleError(_0x57b226,null));};exports[_0x5f5b('0x51')]=function(_0x277735,_0x1dffe3){return db[_0x5f5b('0x3a')][_0x5f5b('0x51')](_0x277735[_0x5f5b('0x52')],{})['then'](function(_0x1ead8b){var _0x517640=_0x277735[_0x5f5b('0x53')]['get']({'plain':!![]});if(!_0x517640)throw new Error(_0x5f5b('0x54'));if(_0x517640[_0x5f5b('0x55')]===_0x5f5b('0x53')){var _0x51a3cc=_0x1ead8b[_0x5f5b('0x34')]({'plain':!![]});var _0x4af060='WhatsappAccounts';return db['UserProfileSection'][_0x5f5b('0x50')]({'where':{'name':_0x4af060,'userProfileId':_0x517640[_0x5f5b('0x56')]},'raw':!![]})[_0x5f5b('0x1f')](function(_0x3ea1ec){if(_0x3ea1ec&&_0x3ea1ec[_0x5f5b('0x57')]===0x0){return db[_0x5f5b('0x58')]['create']({'name':_0x51a3cc[_0x5f5b('0x36')],'resourceId':_0x51a3cc['id'],'type':_0x3ea1ec[_0x5f5b('0x36')],'sectionId':_0x3ea1ec['id']},{})[_0x5f5b('0x1f')](function(){return _0x1ead8b;});}else{return _0x1ead8b;}})[_0x5f5b('0x28')](function(_0x2e0aff){logger[_0x5f5b('0x23')](_0x5f5b('0x59'),_0x2e0aff);throw _0x2e0aff;});}return _0x1ead8b;})[_0x5f5b('0x1f')](respondWithResult(_0x1dffe3,0xc9))[_0x5f5b('0x28')](handleError(_0x1dffe3,null));};exports[_0x5f5b('0x5a')]=function(_0x5551dc,_0x30d195){if(_0x5551dc['body']['id']){delete _0x5551dc[_0x5f5b('0x52')]['id'];}return db['WhatsappAccount'][_0x5f5b('0x50')]({'where':{'id':_0x5551dc[_0x5f5b('0x4e')]['id']},'include':[{'model':db[_0x5f5b('0x38')],'as':_0x5f5b('0x5b')}]})['then'](handleEntityNotFound(_0x30d195,null))[_0x5f5b('0x1f')](saveUpdates(_0x5551dc[_0x5f5b('0x52')],null))[_0x5f5b('0x1f')](respondWithResult(_0x30d195,null))[_0x5f5b('0x28')](handleError(_0x30d195,null));};exports[_0x5f5b('0x33')]=function(_0x5c5e86,_0x3dc425){return db[_0x5f5b('0x3a')][_0x5f5b('0x50')]({'where':{'id':_0x5c5e86[_0x5f5b('0x4e')]['id']}})[_0x5f5b('0x1f')](handleEntityNotFound(_0x3dc425,null))[_0x5f5b('0x1f')](removeEntity(_0x3dc425,null))[_0x5f5b('0x28')](handleError(_0x3dc425,null));};exports['describe']=function(_0x2b2167,_0x3a214c){return db[_0x5f5b('0x3a')][_0x5f5b('0x5c')]()[_0x5f5b('0x1f')](respondWithResult(_0x3a214c,null))['catch'](handleError(_0x3a214c,null));};exports['addDisposition']=function(_0x4d9230,_0x12b0b7,_0x27799e){if(_0x4d9230[_0x5f5b('0x52')]['id']){delete _0x4d9230[_0x5f5b('0x52')]['id'];}return db['WhatsappAccount'][_0x5f5b('0x50')]({'where':{'id':_0x4d9230[_0x5f5b('0x4e')]['id']}})[_0x5f5b('0x1f')](handleEntityNotFound(_0x12b0b7,null))[_0x5f5b('0x1f')](function(_0x329e58){if(_0x329e58){_0x4d9230[_0x5f5b('0x52')][_0x5f5b('0x5d')]=_0x329e58['id'];return db[_0x5f5b('0x5e')][_0x5f5b('0x51')](_0x4d9230['body']);}})[_0x5f5b('0x1f')](respondWithResult(_0x12b0b7,null))[_0x5f5b('0x28')](handleError(_0x12b0b7,null));};exports['getDispositions']=function(_0x3bc137,_0x3c1071,_0x3419c9){var _0x464b33={'raw':![],'where':{}};var _0x46d17e={};var _0x2ab96c={'count':0x0,'rows':[]};return db[_0x5f5b('0x3a')][_0x5f5b('0x5f')]({'where':{'id':_0x3bc137['params']['id']}})[_0x5f5b('0x1f')](handleEntityNotFound(_0x3c1071,null))[_0x5f5b('0x1f')](function(_0x35a274){if(_0x35a274){_0x46d17e['model']=_[_0x5f5b('0x60')](db['Disposition'][_0x5f5b('0x3b')]);_0x46d17e[_0x5f5b('0x3e')]=_[_0x5f5b('0x60')](_0x3bc137[_0x5f5b('0x3e')]);_0x46d17e[_0x5f5b('0x3f')]=_['intersection'](_0x46d17e[_0x5f5b('0x3d')],_0x46d17e[_0x5f5b('0x3e')]);_0x464b33[_0x5f5b('0x41')]=_['intersection'](_0x46d17e[_0x5f5b('0x3d')],qs[_0x5f5b('0x42')](_0x3bc137[_0x5f5b('0x3e')][_0x5f5b('0x42')]));_0x464b33[_0x5f5b('0x41')]=_0x464b33['attributes']['length']?_0x464b33[_0x5f5b('0x41')]:_0x46d17e[_0x5f5b('0x3d')];if(!_0x3bc137[_0x5f5b('0x3e')][_0x5f5b('0x44')](_0x5f5b('0x45'))){_0x464b33['limit']=qs[_0x5f5b('0x2d')](_0x3bc137[_0x5f5b('0x3e')]['limit']);_0x464b33[_0x5f5b('0x2c')]=qs[_0x5f5b('0x2c')](_0x3bc137['query'][_0x5f5b('0x2c')]);}_0x464b33['order']=qs[_0x5f5b('0x61')](_0x3bc137['query'][_0x5f5b('0x61')]);_0x464b33[_0x5f5b('0x46')]=qs[_0x5f5b('0x3f')](_['pick'](_0x3bc137['query'],_0x46d17e[_0x5f5b('0x3f')]));_0x464b33[_0x5f5b('0x46')][_0x5f5b('0x5d')]=_0x35a274['id'];if(_0x3bc137[_0x5f5b('0x3e')]['filter']){_0x464b33['where']=_[_0x5f5b('0x4a')](_0x464b33[_0x5f5b('0x46')],{'$or':_[_0x5f5b('0x39')](_0x464b33[_0x5f5b('0x41')],function(_0x36e336){var _0x5b8056={};_0x5b8056[_0x36e336]={'$like':'%'+_0x3bc137[_0x5f5b('0x3e')][_0x5f5b('0x49')]+'%'};return _0x5b8056;})});}_0x464b33=_['merge']({},_0x464b33,_0x3bc137[_0x5f5b('0x4b')]);return db[_0x5f5b('0x5e')][_0x5f5b('0x2e')]({'where':_0x464b33['where']})[_0x5f5b('0x1f')](function(_0xc6731a){_0x2ab96c[_0x5f5b('0x2e')]=_0xc6731a;if(_0x3bc137['query'][_0x5f5b('0x4c')]){_0x464b33['include']=[{'all':!![]}];}return db[_0x5f5b('0x5e')]['findAll'](_0x464b33);})[_0x5f5b('0x1f')](function(_0x50dd07){_0x2ab96c[_0x5f5b('0x62')]=_0x50dd07;return _0x2ab96c;});}})[_0x5f5b('0x1f')](respondWithFilteredResult(_0x3c1071,_0x464b33))[_0x5f5b('0x28')](handleError(_0x3c1071,null));};exports[_0x5f5b('0x63')]=function(_0x4a4b6d,_0x57e9db,_0x361a28){return db[_0x5f5b('0x3a')][_0x5f5b('0x50')]({'where':{'id':_0x4a4b6d['params']['id']}})['then'](handleEntityNotFound(_0x57e9db,null))[_0x5f5b('0x1f')](function(_0x430bce){if(_0x430bce){return _0x430bce[_0x5f5b('0x63')](_0x4a4b6d[_0x5f5b('0x3e')][_0x5f5b('0x64')]);}})[_0x5f5b('0x1f')](respondWithStatusCode(_0x57e9db,null))[_0x5f5b('0x28')](handleError(_0x57e9db,null));};exports[_0x5f5b('0x65')]=function(_0x36f37b,_0x56473f,_0x55ee48){if(_0x36f37b[_0x5f5b('0x52')]['id']){delete _0x36f37b['body']['id'];}return db[_0x5f5b('0x3a')]['find']({'where':{'id':_0x36f37b[_0x5f5b('0x4e')]['id']}})[_0x5f5b('0x1f')](handleEntityNotFound(_0x56473f,null))['then'](function(_0x5766d3){if(_0x5766d3){_0x36f37b['body'][_0x5f5b('0x5d')]=_0x5766d3['id'];return db[_0x5f5b('0x66')]['create'](_0x36f37b[_0x5f5b('0x52')]);}})[_0x5f5b('0x1f')](respondWithResult(_0x56473f,null))[_0x5f5b('0x28')](handleError(_0x56473f,null));};exports[_0x5f5b('0x67')]=function(_0x3ae6c8,_0x3d7db7,_0x47eb34){var _0x4fc54f={'raw':![],'where':{}};var _0xa484e1={};var _0x5449c7={'count':0x0,'rows':[]};return db[_0x5f5b('0x3a')]['findOne']({'where':{'id':_0x3ae6c8[_0x5f5b('0x4e')]['id']}})[_0x5f5b('0x1f')](handleEntityNotFound(_0x3d7db7,null))[_0x5f5b('0x1f')](function(_0x542b8d){if(_0x542b8d){_0xa484e1['model']=_[_0x5f5b('0x60')](db[_0x5f5b('0x66')]['rawAttributes']);_0xa484e1[_0x5f5b('0x3e')]=_[_0x5f5b('0x60')](_0x3ae6c8['query']);_0xa484e1['filters']=_[_0x5f5b('0x40')](_0xa484e1[_0x5f5b('0x3d')],_0xa484e1[_0x5f5b('0x3e')]);_0x4fc54f[_0x5f5b('0x41')]=_[_0x5f5b('0x40')](_0xa484e1[_0x5f5b('0x3d')],qs[_0x5f5b('0x42')](_0x3ae6c8[_0x5f5b('0x3e')][_0x5f5b('0x42')]));_0x4fc54f[_0x5f5b('0x41')]=_0x4fc54f[_0x5f5b('0x41')][_0x5f5b('0x43')]?_0x4fc54f[_0x5f5b('0x41')]:_0xa484e1[_0x5f5b('0x3d')];if(!_0x3ae6c8[_0x5f5b('0x3e')][_0x5f5b('0x44')]('nolimit')){_0x4fc54f[_0x5f5b('0x2d')]=qs[_0x5f5b('0x2d')](_0x3ae6c8[_0x5f5b('0x3e')][_0x5f5b('0x2d')]);_0x4fc54f['offset']=qs['offset'](_0x3ae6c8[_0x5f5b('0x3e')]['offset']);}_0x4fc54f[_0x5f5b('0x68')]=qs[_0x5f5b('0x61')](_0x3ae6c8[_0x5f5b('0x3e')][_0x5f5b('0x61')]);_0x4fc54f[_0x5f5b('0x46')]=qs[_0x5f5b('0x3f')](_[_0x5f5b('0x47')](_0x3ae6c8[_0x5f5b('0x3e')],_0xa484e1[_0x5f5b('0x3f')]));_0x4fc54f[_0x5f5b('0x46')][_0x5f5b('0x5d')]=_0x542b8d['id'];if(_0x3ae6c8[_0x5f5b('0x3e')][_0x5f5b('0x49')]){_0x4fc54f['where']=_[_0x5f5b('0x4a')](_0x4fc54f['where'],{'$or':_['map'](_0x4fc54f[_0x5f5b('0x41')],function(_0x26eba1){var _0x3c9900={};_0x3c9900[_0x26eba1]={'$like':'%'+_0x3ae6c8[_0x5f5b('0x3e')][_0x5f5b('0x49')]+'%'};return _0x3c9900;})});}_0x4fc54f=_[_0x5f5b('0x4a')]({},_0x4fc54f,_0x3ae6c8[_0x5f5b('0x4b')]);return db['CannedAnswer'][_0x5f5b('0x2e')]({'where':_0x4fc54f[_0x5f5b('0x46')]})[_0x5f5b('0x1f')](function(_0x4d284f){_0x5449c7[_0x5f5b('0x2e')]=_0x4d284f;if(_0x3ae6c8['query']['includeAll']){_0x4fc54f[_0x5f5b('0x4f')]=[{'all':!![]}];}return db['CannedAnswer'][_0x5f5b('0x69')](_0x4fc54f);})[_0x5f5b('0x1f')](function(_0x1bf813){_0x5449c7['rows']=_0x1bf813;return _0x5449c7;});}})['then'](respondWithFilteredResult(_0x3d7db7,_0x4fc54f))[_0x5f5b('0x28')](handleError(_0x3d7db7,null));};exports['removeAnswers']=function(_0x3300d2,_0x3dc8f2,_0x2f7b7d){return db[_0x5f5b('0x3a')]['find']({'where':{'id':_0x3300d2[_0x5f5b('0x4e')]['id']}})[_0x5f5b('0x1f')](handleEntityNotFound(_0x3dc8f2,null))[_0x5f5b('0x1f')](function(_0x4712bf){if(_0x4712bf){return _0x4712bf['removeAnswers'](_0x3300d2[_0x5f5b('0x3e')]['ids']);}})[_0x5f5b('0x1f')](respondWithStatusCode(_0x3dc8f2,null))[_0x5f5b('0x28')](handleError(_0x3dc8f2,null));};exports[_0x5f5b('0x6a')]=function(_0x37d811,_0x5f46ec,_0x2f90ef){return db[_0x5f5b('0x3a')][_0x5f5b('0x50')]({'where':{'id':_0x37d811[_0x5f5b('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5f46ec,null))[_0x5f5b('0x1f')](function(_0x4f07ac){if(_0x4f07ac){return _0x4f07ac[_0x5f5b('0x6a')](_0x37d811[_0x5f5b('0x52')][_0x5f5b('0x64')],_[_0x5f5b('0x6b')](_0x37d811[_0x5f5b('0x52')],[_0x5f5b('0x64'),'id'])||{})[_0x5f5b('0x6c')](function(_0x195f64){for(var _0x45998c=0x0;_0x45998c<_0x37d811[_0x5f5b('0x52')][_0x5f5b('0x64')][_0x5f5b('0x43')];_0x45998c+=0x1){socket[_0x5f5b('0x6d')](_0x5f5b('0x6e'),{'UserId':Number(_0x37d811[_0x5f5b('0x52')][_0x5f5b('0x64')][_0x45998c]),'WhatsappAccountId':Number(_0x37d811[_0x5f5b('0x4e')]['id'])});}return _0x195f64;});}})[_0x5f5b('0x1f')](respondWithResult(_0x5f46ec,null))[_0x5f5b('0x28')](handleError(_0x5f46ec,null));};exports[_0x5f5b('0x6f')]=function(_0x3d6828,_0x13a9c4,_0xae79a2){return db[_0x5f5b('0x3a')][_0x5f5b('0x50')]({'where':{'id':_0x3d6828['params']['id']}})['then'](handleEntityNotFound(_0x13a9c4,null))[_0x5f5b('0x1f')](function(_0x4898fc){if(_0x4898fc){return _0x4898fc[_0x5f5b('0x6f')](_0x3d6828[_0x5f5b('0x3e')][_0x5f5b('0x64')])['then'](function(){if(_['isArray'](_0x3d6828[_0x5f5b('0x3e')]['ids'])){for(var _0x4e3ef7=0x0;_0x4e3ef7<_0x3d6828[_0x5f5b('0x3e')][_0x5f5b('0x64')]['length'];_0x4e3ef7+=0x1){socket[_0x5f5b('0x6d')](_0x5f5b('0x70'),{'UserId':Number(_0x3d6828[_0x5f5b('0x3e')][_0x5f5b('0x64')][_0x4e3ef7]),'WhatsappAccountId':Number(_0x3d6828[_0x5f5b('0x4e')]['id'])});}}else{socket['emit'](_0x5f5b('0x70'),{'UserId':Number(_0x3d6828[_0x5f5b('0x3e')][_0x5f5b('0x64')]),'WhatsappAccountId':Number(_0x3d6828[_0x5f5b('0x4e')]['id'])});}});}})['then'](respondWithStatusCode(_0x13a9c4,null))[_0x5f5b('0x28')](handleError(_0x13a9c4,null));};exports['getAgents']=function(_0x42e66b,_0x1af0e8,_0x54ee5b){var _0x5212cc={};var _0xfb2e14={};var _0x5c2e13;var _0x588124;return db[_0x5f5b('0x3a')]['findOne']({'where':{'id':_0x42e66b[_0x5f5b('0x4e')]['id']}})[_0x5f5b('0x1f')](handleEntityNotFound(_0x1af0e8,null))[_0x5f5b('0x1f')](function(_0x41127c){if(_0x41127c){_0x5c2e13=_0x41127c;_0xfb2e14[_0x5f5b('0x3d')]=_[_0x5f5b('0x60')](db[_0x5f5b('0x71')][_0x5f5b('0x3b')]);_0xfb2e14[_0x5f5b('0x3e')]=_[_0x5f5b('0x60')](_0x42e66b[_0x5f5b('0x3e')]);_0xfb2e14['filters']=_['intersection'](_0xfb2e14[_0x5f5b('0x3d')],_0xfb2e14[_0x5f5b('0x3e')]);_0x5212cc[_0x5f5b('0x41')]=_['intersection'](_0xfb2e14[_0x5f5b('0x3d')],qs[_0x5f5b('0x42')](_0x42e66b[_0x5f5b('0x3e')][_0x5f5b('0x42')]));_0x5212cc[_0x5f5b('0x41')]=_0x5212cc['attributes'][_0x5f5b('0x43')]?_0x5212cc['attributes']:_0xfb2e14[_0x5f5b('0x3d')];_0x5212cc[_0x5f5b('0x68')]=qs[_0x5f5b('0x61')](_0x42e66b['query']['sort']);_0x5212cc[_0x5f5b('0x46')]=qs[_0x5f5b('0x3f')](_[_0x5f5b('0x47')](_0x42e66b[_0x5f5b('0x3e')],_0xfb2e14[_0x5f5b('0x3f')]));if(_0x42e66b['query'][_0x5f5b('0x49')]){_0x5212cc[_0x5f5b('0x46')]=_['merge'](_0x5212cc['where'],{'$or':_['map'](_0x5212cc[_0x5f5b('0x41')],function(_0x26fcbf){var _0x31f3d0={};_0x31f3d0[_0x26fcbf]={'$like':'%'+_0x42e66b[_0x5f5b('0x3e')][_0x5f5b('0x49')]+'%'};return _0x31f3d0;})});}_0x5212cc=_[_0x5f5b('0x4a')]({},_0x5212cc,_0x42e66b[_0x5f5b('0x4b')]);return _0x5c2e13[_0x5f5b('0x72')](_0x5212cc);}})['then'](function(_0xe4decc){if(_0xe4decc){_0x588124=_0xe4decc['length'];if(!_0x42e66b[_0x5f5b('0x3e')]['hasOwnProperty']('nolimit')){_0x5212cc[_0x5f5b('0x2d')]=qs['limit'](_0x42e66b[_0x5f5b('0x3e')]['limit']);_0x5212cc['offset']=qs['offset'](_0x42e66b[_0x5f5b('0x3e')][_0x5f5b('0x2c')]);}return _0x5c2e13[_0x5f5b('0x72')](_0x5212cc);}})[_0x5f5b('0x1f')](function(_0x4850bd){if(_0x4850bd){return _0x4850bd?{'count':_0x588124,'rows':_0x4850bd}:null;}})[_0x5f5b('0x1f')](respondWithResult(_0x1af0e8,null))[_0x5f5b('0x28')](handleError(_0x1af0e8,null));};exports[_0x5f5b('0x73')]=function(_0x41100d,_0xb149c8){var _0x50e87a=_0x41100d[_0x5f5b('0x4e')]['id'];var _0x24c0c4=_0x41100d[_0x5f5b('0x52')];var _0x5f333b=0xc8;var _0x3a593b=null;return db[_0x5f5b('0x74')][_0x5f5b('0x75')]({'isolationLevel':db[_0x5f5b('0x74')][_0x5f5b('0x76')]['ISOLATION_LEVELS'][_0x5f5b('0x77')]},function(_0x488114){return db[_0x5f5b('0x3a')][_0x5f5b('0x5f')]({'where':{'id':_0x50e87a},'transaction':_0x488114})[_0x5f5b('0x1f')](function(_0x5c75ef){if(_0x5c75ef){return db['WhatsappApplication'][_0x5f5b('0x33')]({'where':{'WhatsappAccountId':_0x50e87a},'transaction':_0x488114})[_0x5f5b('0x1f')](function(){var _0x535a41=_[_0x5f5b('0x39')](_0x24c0c4,function(_0x23aba8){_0x23aba8['WhatsappAccountId']=_0x50e87a;return _0x23aba8;});return db[_0x5f5b('0x78')][_0x5f5b('0x79')](_0x535a41,{'transaction':_0x488114});});}else{_0x5f333b=0x194;_0x3a593b=[];}});})[_0x5f5b('0x1f')](function(){if(_0x5f333b!==0x194){return db[_0x5f5b('0x78')][_0x5f5b('0x7a')]({'where':{'WhatsappAccountId':_0x50e87a},'order':_0x5f5b('0x7b')})[_0x5f5b('0x1f')](function(_0x27248a){_0x3a593b=_0x27248a;});}})[_0x5f5b('0x28')](function(_0x5aa9be){_0x5f333b=0x1f4;logger[_0x5f5b('0x23')](_0x5aa9be[_0x5f5b('0x35')]);if(_0x5aa9be['name']){delete _0x5aa9be[_0x5f5b('0x36')];}_0x3a593b=_0x5aa9be;})['finally'](function(){if(_0x3a593b===null){_0xb149c8[_0x5f5b('0x7c')](_0x5f333b);}else{if(_0x5f333b===0x1f4){_0xb149c8[_0x5f5b('0x29')](_0x5f333b)[_0x5f5b('0x37')](_0x3a593b);}else{_0xb149c8[_0x5f5b('0x29')](_0x5f333b)[_0x5f5b('0x2b')](_0x3a593b);}}});};exports[_0x5f5b('0x7d')]=function(_0x4dcc5f,_0x41cca8,_0x50dd4d){var _0xccbbdd={};var _0x3cf8d0={};var _0x5bf25e;var _0x15f8e2;return db[_0x5f5b('0x3a')][_0x5f5b('0x5f')]({'where':{'id':_0x4dcc5f[_0x5f5b('0x4e')]['id']}})[_0x5f5b('0x1f')](handleEntityNotFound(_0x41cca8,null))[_0x5f5b('0x1f')](function(_0xbf6eec){if(_0xbf6eec){_0x5bf25e=_0xbf6eec;_0x3cf8d0[_0x5f5b('0x3d')]=_[_0x5f5b('0x60')](db['WhatsappApplication'][_0x5f5b('0x3b')]);_0x3cf8d0[_0x5f5b('0x3e')]=_[_0x5f5b('0x60')](_0x4dcc5f[_0x5f5b('0x3e')]);_0x3cf8d0['filters']=_[_0x5f5b('0x40')](_0x3cf8d0['model'],_0x3cf8d0['query']);_0xccbbdd[_0x5f5b('0x41')]=_[_0x5f5b('0x40')](_0x3cf8d0[_0x5f5b('0x3d')],qs[_0x5f5b('0x42')](_0x4dcc5f['query'][_0x5f5b('0x42')]));_0xccbbdd[_0x5f5b('0x41')]=_0xccbbdd['attributes'][_0x5f5b('0x43')]?_0xccbbdd['attributes']:_0x3cf8d0['model'];_0xccbbdd[_0x5f5b('0x68')]=qs[_0x5f5b('0x61')](_0x4dcc5f[_0x5f5b('0x3e')]['sort']);_0xccbbdd[_0x5f5b('0x46')]=qs[_0x5f5b('0x3f')](_[_0x5f5b('0x47')](_0x4dcc5f[_0x5f5b('0x3e')],_0x3cf8d0[_0x5f5b('0x3f')]));if(_0x4dcc5f[_0x5f5b('0x3e')]['filter']){_0xccbbdd[_0x5f5b('0x46')]=_['merge'](_0xccbbdd[_0x5f5b('0x46')],{'$or':_[_0x5f5b('0x39')](_0xccbbdd['attributes'],function(_0x1704b3){var _0x152cbb={};_0x152cbb[_0x1704b3]={'$like':'%'+_0x4dcc5f[_0x5f5b('0x3e')][_0x5f5b('0x49')]+'%'};return _0x152cbb;})});}_0xccbbdd=_['merge']({},_0xccbbdd,_0x4dcc5f['options']);return _0x5bf25e[_0x5f5b('0x7d')](_0xccbbdd);}})['then'](function(_0x3c6ab3){if(_0x3c6ab3){_0x15f8e2=_0x3c6ab3[_0x5f5b('0x43')];if(!_0x4dcc5f[_0x5f5b('0x3e')]['hasOwnProperty'](_0x5f5b('0x45'))){_0xccbbdd[_0x5f5b('0x2d')]=qs[_0x5f5b('0x2d')](_0x4dcc5f[_0x5f5b('0x3e')][_0x5f5b('0x2d')]);_0xccbbdd[_0x5f5b('0x2c')]=qs['offset'](_0x4dcc5f[_0x5f5b('0x3e')][_0x5f5b('0x2c')]);}return _0x5bf25e[_0x5f5b('0x7d')](_0xccbbdd);}})[_0x5f5b('0x1f')](function(_0x540763){if(_0x540763){return _0x540763?{'count':_0x15f8e2,'rows':_0x540763}:null;}})['then'](respondWithResult(_0x41cca8,null))['catch'](handleError(_0x41cca8,null));};exports['notify']=function(_0xaf9a9d,_0x20ea01,_0x330b06){var _0x2f079a={'channel':_0x5f5b('0x7e')};var _0x2aeb34=[];var _0x4ffda9=[];var _0x4d7899={};return db[_0x5f5b('0x3a')][_0x5f5b('0x50')]({'where':{'id':_0xaf9a9d[_0x5f5b('0x4e')]['id']},'include':[{'model':db[_0x5f5b('0x78')],'as':_0x5f5b('0x7f')}]})['then'](handleEntityNotFound(_0x20ea01,null))[_0x5f5b('0x1f')](function(_0x3532e7){_0x2f079a[_0x5f5b('0x80')]=_0x3532e7;if(_0x2f079a[_0x5f5b('0x80')]&&_0x2f079a[_0x5f5b('0x80')][_0x5f5b('0x48')]==='sinch'&&_0xaf9a9d['body'][_0x5f5b('0x81')]){if(_0xaf9a9d[_0x5f5b('0x52')][_0x5f5b('0x81')][_0x5f5b('0x43')]===0x0)return;if(_0xaf9a9d['body']['statuses'][0x0]['state']!=='read')return;return db[_0x5f5b('0x82')][_0x5f5b('0x5a')]({'read':!![],'readAt':_0xaf9a9d[_0x5f5b('0x52')][_0x5f5b('0x81')][0x0][_0x5f5b('0x83')]},{'where':{'messageId':_0xaf9a9d['body'][_0x5f5b('0x81')][0x0][_0x5f5b('0x84')]},'individualHooks':!![]})[_0x5f5b('0x1f')](function(_0x1152da){return _0x20ea01['status'](0xc8)['json'](_0x1152da);});}_0x2f079a[_0x5f5b('0x85')]=_[_0x5f5b('0x86')](_0x3532e7[_0x5f5b('0x7f')],['priority'],[_0x5f5b('0x87')]);if(_0x2f079a['account']['Applications']){delete _0x2f079a[_0x5f5b('0x80')]['Applications'];}return db[_0x5f5b('0x88')][_0x5f5b('0x5c')]()[_0x5f5b('0x1f')](function(_0x429eb0){if(!_0x429eb0){throw new db[(_0x5f5b('0x89'))]['ValidationError'](_0x5f5b('0x8a'));}_0x2aeb34=_[_0x5f5b('0x8b')](_[_0x5f5b('0x60')](_0x429eb0),[_0x5f5b('0x8c'),_0x5f5b('0x8d')]);_0x4ffda9=_[_0x5f5b('0x8b')](_[_0x5f5b('0x60')](_0x429eb0),[_0x5f5b('0x8c'),_0x5f5b('0x8d'),_0x5f5b('0x8e'),_0x5f5b('0x8f')]);_0x2f079a[_0x5f5b('0x52')]={'mapKey':_0x5f5b('0x90')};if(_0x2f079a['account']&&_0x2f079a[_0x5f5b('0x80')][_0x5f5b('0x48')]===_0x5f5b('0x91')){_0x2f079a[_0x5f5b('0x52')][_0x5f5b('0x92')]=_0xaf9a9d[_0x5f5b('0x52')]['From'][_0x5f5b('0x93')](_0x5f5b('0x94'),'');_0x2f079a[_0x5f5b('0x52')]['body']=_0xaf9a9d['body'][_0x5f5b('0x95')];_0x2f079a[_0x5f5b('0x52')][_0x5f5b('0x96')]=_0xaf9a9d['body'][_0x5f5b('0x97')];}if(_0x2f079a[_0x5f5b('0x80')]&&_0x2f079a['account'][_0x5f5b('0x48')]===_0x5f5b('0x98')){_0x2f079a[_0x5f5b('0x52')][_0x5f5b('0x92')]=_0xaf9a9d[_0x5f5b('0x52')][_0x5f5b('0x99')][0x0][_0x5f5b('0x92')];_0x2f079a[_0x5f5b('0x52')][_0x5f5b('0x52')]=_0xaf9a9d[_0x5f5b('0x52')][_0x5f5b('0x99')][0x0][_0x5f5b('0x25')][_0x5f5b('0x52')];_0x2f079a['body'][_0x5f5b('0x96')]=_0xaf9a9d[_0x5f5b('0x52')][_0x5f5b('0x99')][0x0][_0x5f5b('0x84')];}if(_0x2f079a['body']['id']){delete _0x2f079a[_0x5f5b('0x52')]['id'];}if(_[_0x5f5b('0x9a')](_0x2f079a[_0x5f5b('0x52')][_0x5f5b('0x92')])){throw new db[(_0x5f5b('0x89'))]['ValidationError'](_0x5f5b('0x9b'));}if(_['isNil'](_0x2f079a[_0x5f5b('0x52')][_0x5f5b('0x52')])||_0x2f079a[_0x5f5b('0x52')][_0x5f5b('0x52')]===''){throw new db['Sequelize']['ValidationError'](_0x5f5b('0x9c'));}if(_[_0x5f5b('0x9a')](_0x2f079a['body'][_0x5f5b('0x9d')])){throw new db[(_0x5f5b('0x89'))][(_0x5f5b('0x9e'))](_0x5f5b('0x9f')+_0x4ffda9);}if(!_[_0x5f5b('0xa0')](_0x4ffda9,_0x2f079a[_0x5f5b('0x52')][_0x5f5b('0x9d')])){throw new db[(_0x5f5b('0x89'))]['ValidationError'](_0x5f5b('0xa1')+_0x4ffda9);}_0x4d7899[_0x2f079a[_0x5f5b('0x52')]['mapKey']]=_0x2f079a[_0x5f5b('0x52')]['from'];return db[_0x5f5b('0xa2')][_0x5f5b('0x50')]({'where':{'id':_0x2f079a[_0x5f5b('0x80')][_0x5f5b('0x8f')]},'include':[{'model':db[_0x5f5b('0x88')],'as':_0x5f5b('0xa3'),'where':_0x4d7899,'limit':0x1,'order':[[_0x5f5b('0x8d'),_0x5f5b('0xa4')]]}]});})[_0x5f5b('0x1f')](handleEntityNotFound(_0x20ea01,null))[_0x5f5b('0x1f')](function(_0x50ef91){if(_0x50ef91){_0x2f079a[_0x5f5b('0xa5')]=_[_0x5f5b('0x6b')](_0x50ef91,[_0x5f5b('0xa3')]);if(_0x50ef91[_0x5f5b('0xa3')]['length']){return _0x50ef91[_0x5f5b('0xa3')][0x0];}var _0x445877=_['defaults'](_0x2f079a['body'],{'firstName':_0x2f079a[_0x5f5b('0x52')][_0x5f5b('0x92')],'ListId':_0x50ef91['id']});_0x445877[_0x2f079a[_0x5f5b('0x52')][_0x5f5b('0x9d')]]=_0x2f079a[_0x5f5b('0x52')]['from'];return db['CmContact'][_0x5f5b('0x51')](_0x445877,{'fields':_0x2aeb34,'raw':!![]});}})[_0x5f5b('0x1f')](handleEntityNotFound(_0x20ea01,null))['then'](function(_0x279fba){if(_0x279fba){_0x2f079a[_0x5f5b('0xa6')]=_0x279fba;var _0x4a71aa={'ContactId':_0x279fba['id'],'phone':_0x2f079a[_0x5f5b('0x52')]['from'],'WhatsappAccountId':_0xaf9a9d[_0x5f5b('0x4e')]['id']};var _0x23dd1c={'ContactId':_0x279fba['id'],'WhatsappAccountId':_0xaf9a9d['params']['id'],'closed':![]};return db[_0x5f5b('0xa7')][_0x5f5b('0x50')]({'where':_0x23dd1c})[_0x5f5b('0x1f')](function(_0x4c2c3c){if(_0x4c2c3c){return[_0x4c2c3c,![]];}return db['WhatsappInteraction']['create'](_0x4a71aa)[_0x5f5b('0x1f')](function(_0x49ef56){return[_0x49ef56,!![]];});});}})[_0x5f5b('0x6c')](function(_0x59a331,_0x47f739){_0x2f079a[_0x5f5b('0xa8')]=_0x59a331[_0x5f5b('0x34')]({'plain':!![]});_0x2f079a[_0x5f5b('0xa8')]['created']=![];if(_0x47f739){if(_0x2f079a[_0x5f5b('0x80')][_0x5f5b('0xa9')]){_0x2f079a[_0x5f5b('0x85')]['push']({'id':0x0,'priority':_0x2f079a[_0x5f5b('0x85')]['length']+0x1,'app':'close','appdata':_0x5f5b('0xaa'),'interval':_0x5f5b('0xab')});}_0x2f079a['interaction']['created']=!![];}return db['WhatsappMessage'][_0x5f5b('0x51')]({'phone':_0x2f079a[_0x5f5b('0x52')]['from'],'messageId':_0x2f079a['body'][_0x5f5b('0x96')],'body':_0x2f079a['body'][_0x5f5b('0x52')],'WhatsappAccountId':_0xaf9a9d[_0x5f5b('0x4e')]['id'],'WhatsappInteractionId':_0x59a331['id'],'direction':'in','ContactId':_0x59a331[_0x5f5b('0xac')],'AttachmentId':_0x2f079a[_0x5f5b('0x52')]['AttachmentId']});})[_0x5f5b('0x1f')](function(_0x1ce203){_0x2f079a[_0x5f5b('0x25')]=_0x1ce203;if(_0x2f079a[_0x5f5b('0xa8')][_0x5f5b('0xad')]){return db['User'][_0x5f5b('0x50')]({'attributes':['id',_0x5f5b('0x36')],'where':{'id':_0x2f079a[_0x5f5b('0xa8')]['UserId']}})['then'](function(_0x4d6c6d){if(_0x4d6c6d){_0x2f079a[_0x5f5b('0x85')][_0x5f5b('0xae')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4d6c6d[_0x5f5b('0x36')]+','+(_0x2f079a[_0x5f5b('0x80')][_0x5f5b('0xaf')]||0xa),'interval':_0x5f5b('0xab')});}return respondWithRpcPromise(_0x5f5b('0xb0'),_0x5f5b('0xb1'),_0x2f079a);});}return respondWithRpcPromise('Start','startRouting',_0x2f079a);})[_0x5f5b('0x1f')](function(_0x2ae8c5){if(_0x2ae8c5){var _0x4b76f7=0xc8;var _0x4b2f35=_0x5f5b('0xb2');logger[_0x5f5b('0x26')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x4b2f35,_0x4b76f7,_0x5f5b('0xb3'));logger[_0x5f5b('0x21')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x4b2f35,_0x4b76f7,_0x5f5b('0xb3'),JSON[_0x5f5b('0xb4')](_0x2ae8c5));if(_0x2f079a[_0x5f5b('0x80')][_0x5f5b('0x48')]===_0x5f5b('0x91')){return _0x20ea01[_0x5f5b('0x29')](_0x4b76f7)['set'](_0x5f5b('0xb5'),_0x5f5b('0xb6'))['send']('<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>');}else{return _0x20ea01[_0x5f5b('0x29')](_0x4b76f7)[_0x5f5b('0x2b')](_0x2ae8c5);}}});})[_0x5f5b('0x28')](handleError(_0x20ea01,null));};exports[_0x5f5b('0x37')]=function(_0xbddf40,_0x43d2f4,_0x279f76){var _0x2b1e03,_0x1d93c4,_0x5054d6;if(_[_0x5f5b('0x9a')](_0xbddf40[_0x5f5b('0x52')][_0x5f5b('0x52')])||_0xbddf40[_0x5f5b('0x52')][_0x5f5b('0x52')]===''){throw new db['Sequelize'][(_0x5f5b('0x9e'))](_0x5f5b('0x9c'));}if(_[_0x5f5b('0x9a')](_0xbddf40[_0x5f5b('0x52')]['to'])){throw new db[(_0x5f5b('0x89'))]['ValidationError'](_0x5f5b('0xb7'));}_0x2b1e03=_0xbddf40['body']['to'];return db['WhatsappAccount'][_0x5f5b('0x50')]({'where':{'id':_0xbddf40[_0x5f5b('0x4e')]['id']},'include':[{'model':db[_0x5f5b('0xa2')],'as':_0x5f5b('0xb8'),'include':[{'model':db[_0x5f5b('0x88')],'as':_0x5f5b('0xa3'),'where':{'mobile':_0x2b1e03},'limit':0x1,'order':[[_0x5f5b('0x8d'),_0x5f5b('0xa4')]]}]}]})[_0x5f5b('0x1f')](handleEntityNotFound(_0x43d2f4,null))[_0x5f5b('0x1f')](function(_0x3d4cdb){if(_0x3d4cdb&&_0x3d4cdb[_0x5f5b('0xb8')]){_0x1d93c4=_0x3d4cdb[_0x5f5b('0x34')]({'plain':!![]});if(_0x1d93c4[_0x5f5b('0xb8')]&&_0x1d93c4[_0x5f5b('0xb8')][_0x5f5b('0xa3')]['length']){return _0x1d93c4[_0x5f5b('0xb8')][_0x5f5b('0xa3')][0x0];}return db[_0x5f5b('0x88')]['create'](_[_0x5f5b('0x16')](_0xbddf40[_0x5f5b('0x52')],{'firstName':_0x2b1e03,'mobile':_0x2b1e03,'phone':_0x2b1e03,'ListId':_0x1d93c4[_0x5f5b('0x8f')]}));}})[_0x5f5b('0x1f')](handleEntityNotFound(_0x43d2f4,null))[_0x5f5b('0x1f')](function(_0x2078f4){if(_0x2078f4){_0x5054d6=_0x2078f4;return db[_0x5f5b('0xa7')][_0x5f5b('0x50')]({'where':{'ContactId':_0x5054d6['id'],'closed':![],'WhatsappAccountId':_0x1d93c4['id']}})[_0x5f5b('0x1f')](function(_0x20d70b){if(_0x20d70b){return[_0x20d70b,![]];}return db['WhatsappInteraction'][_0x5f5b('0x51')]({'UserId':_0xbddf40['user']['id'],'ContactId':_0x5054d6['id'],'WhatsappAccountId':_0x1d93c4['id'],'phone':_0x2b1e03,'firstMsgDirection':_0x5f5b('0xb9'),'Messages':[_['merge'](_0xbddf40[_0x5f5b('0x52')],{'read':![],'body':_0xbddf40[_0x5f5b('0x52')]['body'],'phone':_0x2b1e03,'WhatsappAccountId':_0x1d93c4['id'],'UserId':_0xbddf40[_0x5f5b('0x53')]['id'],'ContactId':_0x5054d6['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x5f5b('0xba')}]})['then'](function(_0x4904f6){return[_0x4904f6,!![]];});});}})[_0x5f5b('0x6c')](function(_0xc78417,_0x2652c0){if(_0x2652c0){return _0xc78417;}return db[_0x5f5b('0x82')]['create'](_[_0x5f5b('0x4a')](_0xbddf40['body'],{'read':![],'body':_0xbddf40[_0x5f5b('0x52')][_0x5f5b('0x52')],'phone':_0x2b1e03,'WhatsappAccountId':_0x1d93c4['id'],'WhatsappInteractionId':_0xc78417['id'],'UserId':_0xbddf40[_0x5f5b('0x53')]['id'],'ContactId':_0x5054d6['id']}))[_0x5f5b('0x1f')](function(_0x1a3870){_0xc78417[_0x5f5b('0xbb')][_0x5f5b('0xba')]=[];_0xc78417['dataValues']['Messages'][_0x5f5b('0xbc')](_0x1a3870[_0x5f5b('0xbb')]);return _0xc78417;});})[_0x5f5b('0x1f')](respondWithResult(_0x43d2f4,null))[_0x5f5b('0x28')](handleError(_0x43d2f4,null));};
\ No newline at end of file
+var _0xe480=['push','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','json','undefined','limit','count','offset','status','apply','reject','save','update','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','send','index','Pause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','pick','filter','where','merge','options','WhatsappAccount','includeAll','include','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','mandatoryDispositionPause','describe','addDisposition','getDispositions','findOne','hasOwnProperty','WhatsappAccountId','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','nolimit','removeAnswers','addAgents','omit','spread','emit','removeAgents','userWhatsappAccount:remove','getAgents','User','transaction','sequelize','Transaction','WhatsappApplication','findAndCountAll','priority','finally','getApplications','whatsapp','account','sinch','statuses','state','read','timestamp','message_id','orderBy','Applications','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','CompanyId','twilio','From','whatsapp:','Body','MessageSid','from','notifications','messageId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','Contacts','DESC','list','mapKey','contact','WhatsappInteraction','interaction','created','autoclose','applications','close','unmanaged','WhatsappMessage','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','entity\x20found','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','to\x20is\x20mandatory','List','out','Messages','dataValues'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xe480,0x191));var _0x0e48=function(_0x1ae714,_0x10220c){_0x1ae714=_0x1ae714-0x0;var _0x19b23c=_0xe480[_0x1ae714];return _0x19b23c;};'use strict';var emlformat=require(_0x0e48('0x0'));var rimraf=require(_0x0e48('0x1'));var zipdir=require(_0x0e48('0x2'));var jsonpatch=require(_0x0e48('0x3'));var rp=require(_0x0e48('0x4'));var moment=require(_0x0e48('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0e48('0x6'));var util=require(_0x0e48('0x7'));var path=require(_0x0e48('0x8'));var sox=require(_0x0e48('0x9'));var csv=require(_0x0e48('0xa'));var ejs=require(_0x0e48('0xb'));var fs=require('fs');var fs_extra=require(_0x0e48('0xc'));var _=require(_0x0e48('0xd'));var squel=require(_0x0e48('0xe'));var crypto=require(_0x0e48('0xf'));var jsforce=require(_0x0e48('0x10'));var deskjs=require(_0x0e48('0x11'));var toCsv=require(_0x0e48('0xa'));var querystring=require(_0x0e48('0x12'));var Papa=require(_0x0e48('0x13'));var Redis=require('ioredis');var authService=require(_0x0e48('0x14'));var qs=require(_0x0e48('0x15'));var as=require(_0x0e48('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0e48('0x17'));var utils=require('../../config/utils');var config=require(_0x0e48('0x18'));var licenseUtil=require(_0x0e48('0x19'));var db=require(_0x0e48('0x1a'))['db'];config[_0x0e48('0x1b')]=_[_0x0e48('0x1c')](config[_0x0e48('0x1b')],{'host':_0x0e48('0x1d'),'port':0x18eb});var socket=require(_0x0e48('0x1e'))(new Redis(config[_0x0e48('0x1b')]));require('./whatsappAccount.socket')[_0x0e48('0x1f')](socket);var jayson=require(_0x0e48('0x20'));var client=jayson[_0x0e48('0x21')][_0x0e48('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x4f7eea,_0x1069c8,_0x2956b4,_0xf12984){return new BPromise(function(_0x390d15,_0x599803){var _0xe93374=_0xf12984||client;return _0xe93374[_0x0e48('0x23')](_0x4f7eea,_0x2956b4)[_0x0e48('0x24')](function(_0xadc971){logger['info'](_0x0e48('0x25'),_0x1069c8,_0x0e48('0x26'));logger['debug'](_0x0e48('0x27'),_0x1069c8,'request\x20sent',JSON[_0x0e48('0x28')](_0xadc971));if(_0xadc971[_0x0e48('0x29')]){if(_0xadc971[_0x0e48('0x29')][_0x0e48('0x2a')]===0x1f4){logger[_0x0e48('0x29')]('WhatsappAccount,\x20%s,\x20%s',_0x1069c8,_0xadc971['error']['message']);return _0x599803(_0xadc971['error'][_0x0e48('0x2b')]);}logger[_0x0e48('0x29')](_0x0e48('0x25'),_0x1069c8,_0xadc971[_0x0e48('0x29')][_0x0e48('0x2b')]);return _0x390d15(_0xadc971[_0x0e48('0x29')][_0x0e48('0x2b')]);}else{logger[_0x0e48('0x2c')](_0x0e48('0x25'),_0x1069c8,_0x0e48('0x26'));_0x390d15(_0xadc971[_0x0e48('0x2d')]['message']);}})['catch'](function(_0x25f6c1){logger[_0x0e48('0x29')](_0x0e48('0x25'),_0x1069c8,_0x25f6c1);_0x599803(_0x25f6c1);});});}function respondWithStatusCode(_0x15425d,_0x5d2c83){_0x5d2c83=_0x5d2c83||0xcc;return function(_0x554125){if(_0x554125){return _0x15425d[_0x0e48('0x2e')](_0x5d2c83);}return _0x15425d['status'](_0x5d2c83)['end']();};}function respondWithResult(_0x55b317,_0x1f9509){_0x1f9509=_0x1f9509||0xc8;return function(_0x35411c){if(_0x35411c){return _0x55b317['status'](_0x1f9509)[_0x0e48('0x2f')](_0x35411c);}};}function respondWithFilteredResult(_0x56caf9,_0x4bf409){return function(_0x5dd7ce){if(_0x5dd7ce){var _0x58df7d=typeof _0x4bf409['offset']===_0x0e48('0x30')&&typeof _0x4bf409[_0x0e48('0x31')]==='undefined';var _0x5cc478=_0x5dd7ce[_0x0e48('0x32')];var _0x469c0a=_0x58df7d?0x0:_0x4bf409[_0x0e48('0x33')];var _0x2d8aa9=_0x58df7d?_0x5dd7ce[_0x0e48('0x32')]:_0x4bf409[_0x0e48('0x33')]+_0x4bf409[_0x0e48('0x31')];var _0x294a90;if(_0x2d8aa9>=_0x5cc478){_0x2d8aa9=_0x5cc478;_0x294a90=0xc8;}else{_0x294a90=0xce;}_0x56caf9[_0x0e48('0x34')](_0x294a90);return _0x56caf9['set']('Content-Range',_0x469c0a+'-'+_0x2d8aa9+'/'+_0x5cc478)['json'](_0x5dd7ce);}return null;};}function patchUpdates(_0x312993){return function(_0x222a8c){try{jsonpatch[_0x0e48('0x35')](_0x222a8c,_0x312993,!![]);}catch(_0x2ecc5c){return BPromise[_0x0e48('0x36')](_0x2ecc5c);}return _0x222a8c[_0x0e48('0x37')]();};}function saveUpdates(_0x977e1f,_0x47fe40){return function(_0xde66d4){if(_0xde66d4){return _0xde66d4[_0x0e48('0x38')](_0x977e1f)[_0x0e48('0x24')](function(_0x27cc82){return _0x27cc82;});}return null;};}function removeEntity(_0x1e4fea,_0x2a7bb4){return function(_0x1d1879){if(_0x1d1879){return _0x1d1879[_0x0e48('0x39')]()[_0x0e48('0x24')](function(){var _0xb4eb4c=_0x1d1879[_0x0e48('0x3a')]({'plain':!![]});var _0x3505bb=_0x0e48('0x3b');return db[_0x0e48('0x3c')]['destroy']({'where':{'type':_0x3505bb,'resourceId':_0xb4eb4c['id']}})['then'](function(){return _0x1d1879;});})[_0x0e48('0x24')](function(){_0x1e4fea[_0x0e48('0x34')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45cba4,_0x5b8d20){return function(_0x14b05d){if(!_0x14b05d){_0x45cba4[_0x0e48('0x2e')](0x194);}return _0x14b05d;};}function handleError(_0x3dee88,_0x1a25a6){_0x1a25a6=_0x1a25a6||0x1f4;return function(_0x40fcef){logger[_0x0e48('0x29')](_0x40fcef[_0x0e48('0x3d')]);if(_0x40fcef[_0x0e48('0x3e')]){delete _0x40fcef[_0x0e48('0x3e')];}_0x3dee88['status'](_0x1a25a6)[_0x0e48('0x3f')](_0x40fcef);};}exports[_0x0e48('0x40')]=function(_0x20e2d0,_0x4a1e80){var _0x967780={'include':[{'model':db[_0x0e48('0x41')],'as':'mandatoryDispositionPause'}]},_0x412b03={},_0x761772={'count':0x0,'rows':[]};var _0x48b265=_[_0x0e48('0x42')](db['WhatsappAccount'][_0x0e48('0x43')],function(_0x5c0278){return{'name':_0x5c0278[_0x0e48('0x44')],'type':_0x5c0278[_0x0e48('0x45')][_0x0e48('0x46')]};});_0x412b03[_0x0e48('0x47')]=_[_0x0e48('0x42')](_0x48b265,_0x0e48('0x3e'));_0x412b03[_0x0e48('0x48')]=_[_0x0e48('0x49')](_0x20e2d0[_0x0e48('0x48')]);_0x412b03[_0x0e48('0x4a')]=_[_0x0e48('0x4b')](_0x412b03[_0x0e48('0x47')],_0x412b03[_0x0e48('0x48')]);_0x967780[_0x0e48('0x4c')]=_[_0x0e48('0x4b')](_0x412b03[_0x0e48('0x47')],qs['fields'](_0x20e2d0[_0x0e48('0x48')][_0x0e48('0x4d')]));_0x967780[_0x0e48('0x4c')]=_0x967780[_0x0e48('0x4c')][_0x0e48('0x4e')]?_0x967780[_0x0e48('0x4c')]:_0x412b03['model'];if(!_0x20e2d0[_0x0e48('0x48')]['hasOwnProperty']('nolimit')){_0x967780[_0x0e48('0x31')]=qs['limit'](_0x20e2d0[_0x0e48('0x48')][_0x0e48('0x31')]);_0x967780[_0x0e48('0x33')]=qs[_0x0e48('0x33')](_0x20e2d0[_0x0e48('0x48')]['offset']);}_0x967780[_0x0e48('0x4f')]=qs[_0x0e48('0x50')](_0x20e2d0[_0x0e48('0x48')]['sort']);_0x967780['where']=qs[_0x0e48('0x4a')](_[_0x0e48('0x51')](_0x20e2d0[_0x0e48('0x48')],_0x412b03['filters']),_0x48b265);if(_0x20e2d0['query'][_0x0e48('0x52')]){_0x967780[_0x0e48('0x53')]=_[_0x0e48('0x54')](_0x967780[_0x0e48('0x53')],{'$or':_[_0x0e48('0x42')](_0x48b265,function(_0x928609){if(_0x928609[_0x0e48('0x45')]!=='VIRTUAL'){var _0x1a193b={};_0x1a193b[_0x928609[_0x0e48('0x3e')]]={'$like':'%'+_0x20e2d0[_0x0e48('0x48')][_0x0e48('0x52')]+'%'};return _0x1a193b;}})});}_0x967780=_[_0x0e48('0x54')]({},_0x967780,_0x20e2d0[_0x0e48('0x55')]);var _0x3bfbb4={'where':_0x967780[_0x0e48('0x53')]};return db[_0x0e48('0x56')][_0x0e48('0x32')](_0x3bfbb4)[_0x0e48('0x24')](function(_0x5cf4f0){_0x761772[_0x0e48('0x32')]=_0x5cf4f0;if(_0x20e2d0['query'][_0x0e48('0x57')]){_0x967780[_0x0e48('0x58')]=[{'all':!![]}];}return db[_0x0e48('0x56')]['findAll'](_0x967780);})[_0x0e48('0x24')](function(_0x52ceb3){_0x761772[_0x0e48('0x59')]=_0x52ceb3;return _0x761772;})[_0x0e48('0x24')](respondWithFilteredResult(_0x4a1e80,_0x967780))[_0x0e48('0x5a')](handleError(_0x4a1e80,null));};exports[_0x0e48('0x5b')]=function(_0xb4a1e,_0x22d2cb){var _0x481669={'raw':![],'where':{'id':_0xb4a1e[_0x0e48('0x5c')]['id']},'include':[{'model':db[_0x0e48('0x41')],'as':'mandatoryDispositionPause'}]},_0x363b8f={};_0x363b8f['model']=_[_0x0e48('0x49')](db[_0x0e48('0x56')][_0x0e48('0x43')]);_0x363b8f['query']=_[_0x0e48('0x49')](_0xb4a1e[_0x0e48('0x48')]);_0x363b8f['filters']=_[_0x0e48('0x4b')](_0x363b8f[_0x0e48('0x47')],_0x363b8f['query']);_0x481669[_0x0e48('0x4c')]=_['intersection'](_0x363b8f[_0x0e48('0x47')],qs[_0x0e48('0x4d')](_0xb4a1e[_0x0e48('0x48')]['fields']));_0x481669[_0x0e48('0x4c')]=_0x481669[_0x0e48('0x4c')][_0x0e48('0x4e')]?_0x481669['attributes']:_0x363b8f[_0x0e48('0x47')];if(_0xb4a1e[_0x0e48('0x48')]['includeAll']){_0x481669['include']=[{'all':!![]}];}_0x481669=_['merge']({},_0x481669,_0xb4a1e[_0x0e48('0x55')]);return db[_0x0e48('0x56')][_0x0e48('0x5d')](_0x481669)['then'](handleEntityNotFound(_0x22d2cb,null))[_0x0e48('0x24')](respondWithResult(_0x22d2cb,null))[_0x0e48('0x5a')](handleError(_0x22d2cb,null));};exports[_0x0e48('0x5e')]=function(_0x429d36,_0x42bbcf){return db[_0x0e48('0x56')][_0x0e48('0x5e')](_0x429d36[_0x0e48('0x5f')],{})[_0x0e48('0x24')](function(_0x37c392){var _0x23d1e0=_0x429d36['user'][_0x0e48('0x3a')]({'plain':!![]});if(!_0x23d1e0)throw new Error(_0x0e48('0x60'));if(_0x23d1e0[_0x0e48('0x61')]===_0x0e48('0x62')){var _0x1c0b08=_0x37c392[_0x0e48('0x3a')]({'plain':!![]});var _0x52d97c='WhatsappAccounts';return db[_0x0e48('0x63')][_0x0e48('0x5d')]({'where':{'name':_0x52d97c,'userProfileId':_0x23d1e0[_0x0e48('0x64')]},'raw':!![]})[_0x0e48('0x24')](function(_0x2438d6){if(_0x2438d6&&_0x2438d6[_0x0e48('0x65')]===0x0){return db[_0x0e48('0x3c')]['create']({'name':_0x1c0b08['name'],'resourceId':_0x1c0b08['id'],'type':_0x2438d6['name'],'sectionId':_0x2438d6['id']},{})['then'](function(){return _0x37c392;});}else{return _0x37c392;}})[_0x0e48('0x5a')](function(_0x4af163){logger[_0x0e48('0x29')](_0x0e48('0x66'),_0x4af163);throw _0x4af163;});}return _0x37c392;})['then'](respondWithResult(_0x42bbcf,0xc9))['catch'](handleError(_0x42bbcf,null));};exports['update']=function(_0x5c11d5,_0x304ce1){if(_0x5c11d5['body']['id']){delete _0x5c11d5[_0x0e48('0x5f')]['id'];}return db[_0x0e48('0x56')][_0x0e48('0x5d')]({'where':{'id':_0x5c11d5[_0x0e48('0x5c')]['id']},'include':[{'model':db[_0x0e48('0x41')],'as':_0x0e48('0x67')}]})['then'](handleEntityNotFound(_0x304ce1,null))[_0x0e48('0x24')](saveUpdates(_0x5c11d5[_0x0e48('0x5f')],null))['then'](respondWithResult(_0x304ce1,null))[_0x0e48('0x5a')](handleError(_0x304ce1,null));};exports[_0x0e48('0x39')]=function(_0x43d0b1,_0x3cf48b){return db[_0x0e48('0x56')]['find']({'where':{'id':_0x43d0b1[_0x0e48('0x5c')]['id']}})[_0x0e48('0x24')](handleEntityNotFound(_0x3cf48b,null))['then'](removeEntity(_0x3cf48b,null))['catch'](handleError(_0x3cf48b,null));};exports[_0x0e48('0x68')]=function(_0x4531e5,_0x419cd1){return db[_0x0e48('0x56')][_0x0e48('0x68')]()['then'](respondWithResult(_0x419cd1,null))[_0x0e48('0x5a')](handleError(_0x419cd1,null));};exports[_0x0e48('0x69')]=function(_0x7244c6,_0x1b5751,_0x4648d4){if(_0x7244c6[_0x0e48('0x5f')]['id']){delete _0x7244c6['body']['id'];}return db['WhatsappAccount'][_0x0e48('0x5d')]({'where':{'id':_0x7244c6['params']['id']}})[_0x0e48('0x24')](handleEntityNotFound(_0x1b5751,null))[_0x0e48('0x24')](function(_0x227f02){if(_0x227f02){_0x7244c6['body']['WhatsappAccountId']=_0x227f02['id'];return db['Disposition'][_0x0e48('0x5e')](_0x7244c6[_0x0e48('0x5f')]);}})['then'](respondWithResult(_0x1b5751,null))['catch'](handleError(_0x1b5751,null));};exports[_0x0e48('0x6a')]=function(_0x387fd6,_0x39d6f1,_0x5bf527){var _0x41cc14={'raw':![],'where':{}};var _0x451842={};var _0x3bb825={'count':0x0,'rows':[]};return db[_0x0e48('0x56')][_0x0e48('0x6b')]({'where':{'id':_0x387fd6[_0x0e48('0x5c')]['id']}})[_0x0e48('0x24')](handleEntityNotFound(_0x39d6f1,null))[_0x0e48('0x24')](function(_0x48d303){if(_0x48d303){_0x451842[_0x0e48('0x47')]=_[_0x0e48('0x49')](db['Disposition']['rawAttributes']);_0x451842[_0x0e48('0x48')]=_[_0x0e48('0x49')](_0x387fd6[_0x0e48('0x48')]);_0x451842['filters']=_[_0x0e48('0x4b')](_0x451842[_0x0e48('0x47')],_0x451842[_0x0e48('0x48')]);_0x41cc14[_0x0e48('0x4c')]=_['intersection'](_0x451842[_0x0e48('0x47')],qs[_0x0e48('0x4d')](_0x387fd6[_0x0e48('0x48')][_0x0e48('0x4d')]));_0x41cc14['attributes']=_0x41cc14[_0x0e48('0x4c')][_0x0e48('0x4e')]?_0x41cc14['attributes']:_0x451842[_0x0e48('0x47')];if(!_0x387fd6[_0x0e48('0x48')][_0x0e48('0x6c')]('nolimit')){_0x41cc14[_0x0e48('0x31')]=qs[_0x0e48('0x31')](_0x387fd6['query']['limit']);_0x41cc14['offset']=qs[_0x0e48('0x33')](_0x387fd6[_0x0e48('0x48')][_0x0e48('0x33')]);}_0x41cc14[_0x0e48('0x4f')]=qs['sort'](_0x387fd6[_0x0e48('0x48')][_0x0e48('0x50')]);_0x41cc14[_0x0e48('0x53')]=qs[_0x0e48('0x4a')](_[_0x0e48('0x51')](_0x387fd6[_0x0e48('0x48')],_0x451842[_0x0e48('0x4a')]));_0x41cc14[_0x0e48('0x53')][_0x0e48('0x6d')]=_0x48d303['id'];if(_0x387fd6[_0x0e48('0x48')]['filter']){_0x41cc14[_0x0e48('0x53')]=_[_0x0e48('0x54')](_0x41cc14[_0x0e48('0x53')],{'$or':_[_0x0e48('0x42')](_0x41cc14[_0x0e48('0x4c')],function(_0x10d2f1){var _0x37d48d={};_0x37d48d[_0x10d2f1]={'$like':'%'+_0x387fd6[_0x0e48('0x48')][_0x0e48('0x52')]+'%'};return _0x37d48d;})});}_0x41cc14=_[_0x0e48('0x54')]({},_0x41cc14,_0x387fd6[_0x0e48('0x55')]);return db['Disposition'][_0x0e48('0x32')]({'where':_0x41cc14[_0x0e48('0x53')]})[_0x0e48('0x24')](function(_0x4b6085){_0x3bb825[_0x0e48('0x32')]=_0x4b6085;if(_0x387fd6[_0x0e48('0x48')][_0x0e48('0x57')]){_0x41cc14['include']=[{'all':!![]}];}return db['Disposition'][_0x0e48('0x6e')](_0x41cc14);})[_0x0e48('0x24')](function(_0x342166){_0x3bb825[_0x0e48('0x59')]=_0x342166;return _0x3bb825;});}})[_0x0e48('0x24')](respondWithFilteredResult(_0x39d6f1,_0x41cc14))[_0x0e48('0x5a')](handleError(_0x39d6f1,null));};exports[_0x0e48('0x6f')]=function(_0x6d004c,_0x2503a4,_0x4868e8){return db[_0x0e48('0x56')]['find']({'where':{'id':_0x6d004c[_0x0e48('0x5c')]['id']}})[_0x0e48('0x24')](handleEntityNotFound(_0x2503a4,null))[_0x0e48('0x24')](function(_0x20352e){if(_0x20352e){return _0x20352e['removeDispositions'](_0x6d004c[_0x0e48('0x48')][_0x0e48('0x70')]);}})[_0x0e48('0x24')](respondWithStatusCode(_0x2503a4,null))[_0x0e48('0x5a')](handleError(_0x2503a4,null));};exports[_0x0e48('0x71')]=function(_0x1d172d,_0x50575a,_0x4e4aeb){if(_0x1d172d[_0x0e48('0x5f')]['id']){delete _0x1d172d[_0x0e48('0x5f')]['id'];}return db['WhatsappAccount'][_0x0e48('0x5d')]({'where':{'id':_0x1d172d[_0x0e48('0x5c')]['id']}})['then'](handleEntityNotFound(_0x50575a,null))[_0x0e48('0x24')](function(_0x587803){if(_0x587803){_0x1d172d[_0x0e48('0x5f')][_0x0e48('0x6d')]=_0x587803['id'];return db[_0x0e48('0x72')][_0x0e48('0x5e')](_0x1d172d[_0x0e48('0x5f')]);}})[_0x0e48('0x24')](respondWithResult(_0x50575a,null))[_0x0e48('0x5a')](handleError(_0x50575a,null));};exports[_0x0e48('0x73')]=function(_0x1a6cae,_0x4c40ee,_0x123d68){var _0x5913ee={'raw':![],'where':{}};var _0x2ef664={};var _0x30e92e={'count':0x0,'rows':[]};return db[_0x0e48('0x56')][_0x0e48('0x6b')]({'where':{'id':_0x1a6cae[_0x0e48('0x5c')]['id']}})[_0x0e48('0x24')](handleEntityNotFound(_0x4c40ee,null))[_0x0e48('0x24')](function(_0x3c611d){if(_0x3c611d){_0x2ef664['model']=_[_0x0e48('0x49')](db['CannedAnswer'][_0x0e48('0x43')]);_0x2ef664[_0x0e48('0x48')]=_['keys'](_0x1a6cae[_0x0e48('0x48')]);_0x2ef664['filters']=_[_0x0e48('0x4b')](_0x2ef664[_0x0e48('0x47')],_0x2ef664[_0x0e48('0x48')]);_0x5913ee[_0x0e48('0x4c')]=_[_0x0e48('0x4b')](_0x2ef664[_0x0e48('0x47')],qs[_0x0e48('0x4d')](_0x1a6cae[_0x0e48('0x48')][_0x0e48('0x4d')]));_0x5913ee[_0x0e48('0x4c')]=_0x5913ee[_0x0e48('0x4c')][_0x0e48('0x4e')]?_0x5913ee[_0x0e48('0x4c')]:_0x2ef664[_0x0e48('0x47')];if(!_0x1a6cae[_0x0e48('0x48')]['hasOwnProperty'](_0x0e48('0x74'))){_0x5913ee[_0x0e48('0x31')]=qs[_0x0e48('0x31')](_0x1a6cae[_0x0e48('0x48')]['limit']);_0x5913ee[_0x0e48('0x33')]=qs['offset'](_0x1a6cae[_0x0e48('0x48')][_0x0e48('0x33')]);}_0x5913ee['order']=qs[_0x0e48('0x50')](_0x1a6cae[_0x0e48('0x48')][_0x0e48('0x50')]);_0x5913ee['where']=qs[_0x0e48('0x4a')](_[_0x0e48('0x51')](_0x1a6cae[_0x0e48('0x48')],_0x2ef664['filters']));_0x5913ee[_0x0e48('0x53')]['WhatsappAccountId']=_0x3c611d['id'];if(_0x1a6cae[_0x0e48('0x48')][_0x0e48('0x52')]){_0x5913ee[_0x0e48('0x53')]=_[_0x0e48('0x54')](_0x5913ee[_0x0e48('0x53')],{'$or':_['map'](_0x5913ee[_0x0e48('0x4c')],function(_0x126274){var _0x1c2bb5={};_0x1c2bb5[_0x126274]={'$like':'%'+_0x1a6cae[_0x0e48('0x48')][_0x0e48('0x52')]+'%'};return _0x1c2bb5;})});}_0x5913ee=_[_0x0e48('0x54')]({},_0x5913ee,_0x1a6cae[_0x0e48('0x55')]);return db[_0x0e48('0x72')][_0x0e48('0x32')]({'where':_0x5913ee[_0x0e48('0x53')]})[_0x0e48('0x24')](function(_0x5b8054){_0x30e92e[_0x0e48('0x32')]=_0x5b8054;if(_0x1a6cae[_0x0e48('0x48')][_0x0e48('0x57')]){_0x5913ee[_0x0e48('0x58')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x5913ee);})[_0x0e48('0x24')](function(_0x3bf8c3){_0x30e92e[_0x0e48('0x59')]=_0x3bf8c3;return _0x30e92e;});}})[_0x0e48('0x24')](respondWithFilteredResult(_0x4c40ee,_0x5913ee))[_0x0e48('0x5a')](handleError(_0x4c40ee,null));};exports[_0x0e48('0x75')]=function(_0x3bfa80,_0x2a4578,_0x2ba40b){return db['WhatsappAccount'][_0x0e48('0x5d')]({'where':{'id':_0x3bfa80[_0x0e48('0x5c')]['id']}})[_0x0e48('0x24')](handleEntityNotFound(_0x2a4578,null))[_0x0e48('0x24')](function(_0x110580){if(_0x110580){return _0x110580['removeAnswers'](_0x3bfa80[_0x0e48('0x48')][_0x0e48('0x70')]);}})[_0x0e48('0x24')](respondWithStatusCode(_0x2a4578,null))[_0x0e48('0x5a')](handleError(_0x2a4578,null));};exports[_0x0e48('0x76')]=function(_0x415266,_0x1b9a6f,_0xcd41a2){return db[_0x0e48('0x56')][_0x0e48('0x5d')]({'where':{'id':_0x415266[_0x0e48('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1b9a6f,null))['then'](function(_0x3f664d){if(_0x3f664d){return _0x3f664d[_0x0e48('0x76')](_0x415266[_0x0e48('0x5f')]['ids'],_[_0x0e48('0x77')](_0x415266[_0x0e48('0x5f')],[_0x0e48('0x70'),'id'])||{})[_0x0e48('0x78')](function(_0x4f5268){for(var _0x369449=0x0;_0x369449<_0x415266[_0x0e48('0x5f')][_0x0e48('0x70')]['length'];_0x369449+=0x1){socket[_0x0e48('0x79')]('userWhatsappAccount:save',{'UserId':Number(_0x415266[_0x0e48('0x5f')]['ids'][_0x369449]),'WhatsappAccountId':Number(_0x415266[_0x0e48('0x5c')]['id'])});}return _0x4f5268;});}})[_0x0e48('0x24')](respondWithResult(_0x1b9a6f,null))[_0x0e48('0x5a')](handleError(_0x1b9a6f,null));};exports[_0x0e48('0x7a')]=function(_0x3b22a8,_0x51f30d,_0x6d898d){return db['WhatsappAccount'][_0x0e48('0x5d')]({'where':{'id':_0x3b22a8[_0x0e48('0x5c')]['id']}})[_0x0e48('0x24')](handleEntityNotFound(_0x51f30d,null))[_0x0e48('0x24')](function(_0x52d355){if(_0x52d355){return _0x52d355[_0x0e48('0x7a')](_0x3b22a8[_0x0e48('0x48')][_0x0e48('0x70')])['then'](function(){if(_['isArray'](_0x3b22a8['query']['ids'])){for(var _0xc94d76=0x0;_0xc94d76<_0x3b22a8[_0x0e48('0x48')][_0x0e48('0x70')][_0x0e48('0x4e')];_0xc94d76+=0x1){socket['emit'](_0x0e48('0x7b'),{'UserId':Number(_0x3b22a8[_0x0e48('0x48')]['ids'][_0xc94d76]),'WhatsappAccountId':Number(_0x3b22a8['params']['id'])});}}else{socket[_0x0e48('0x79')](_0x0e48('0x7b'),{'UserId':Number(_0x3b22a8[_0x0e48('0x48')][_0x0e48('0x70')]),'WhatsappAccountId':Number(_0x3b22a8['params']['id'])});}});}})[_0x0e48('0x24')](respondWithStatusCode(_0x51f30d,null))[_0x0e48('0x5a')](handleError(_0x51f30d,null));};exports[_0x0e48('0x7c')]=function(_0x46df2b,_0x68806a,_0xa5f153){var _0x107de2={};var _0x6102a9={};var _0x148d8c;var _0x3c7f85;return db[_0x0e48('0x56')]['findOne']({'where':{'id':_0x46df2b[_0x0e48('0x5c')]['id']}})[_0x0e48('0x24')](handleEntityNotFound(_0x68806a,null))[_0x0e48('0x24')](function(_0x3f010f){if(_0x3f010f){_0x148d8c=_0x3f010f;_0x6102a9[_0x0e48('0x47')]=_[_0x0e48('0x49')](db[_0x0e48('0x7d')][_0x0e48('0x43')]);_0x6102a9[_0x0e48('0x48')]=_['keys'](_0x46df2b[_0x0e48('0x48')]);_0x6102a9[_0x0e48('0x4a')]=_[_0x0e48('0x4b')](_0x6102a9[_0x0e48('0x47')],_0x6102a9[_0x0e48('0x48')]);_0x107de2[_0x0e48('0x4c')]=_[_0x0e48('0x4b')](_0x6102a9[_0x0e48('0x47')],qs[_0x0e48('0x4d')](_0x46df2b['query'][_0x0e48('0x4d')]));_0x107de2[_0x0e48('0x4c')]=_0x107de2['attributes'][_0x0e48('0x4e')]?_0x107de2[_0x0e48('0x4c')]:_0x6102a9[_0x0e48('0x47')];_0x107de2['order']=qs[_0x0e48('0x50')](_0x46df2b[_0x0e48('0x48')][_0x0e48('0x50')]);_0x107de2[_0x0e48('0x53')]=qs[_0x0e48('0x4a')](_['pick'](_0x46df2b[_0x0e48('0x48')],_0x6102a9[_0x0e48('0x4a')]));if(_0x46df2b['query']['filter']){_0x107de2[_0x0e48('0x53')]=_['merge'](_0x107de2[_0x0e48('0x53')],{'$or':_[_0x0e48('0x42')](_0x107de2[_0x0e48('0x4c')],function(_0x54ebc9){var _0x58962f={};_0x58962f[_0x54ebc9]={'$like':'%'+_0x46df2b[_0x0e48('0x48')][_0x0e48('0x52')]+'%'};return _0x58962f;})});}_0x107de2=_[_0x0e48('0x54')]({},_0x107de2,_0x46df2b[_0x0e48('0x55')]);return _0x148d8c[_0x0e48('0x7c')](_0x107de2);}})[_0x0e48('0x24')](function(_0x12527c){if(_0x12527c){_0x3c7f85=_0x12527c[_0x0e48('0x4e')];if(!_0x46df2b['query']['hasOwnProperty']('nolimit')){_0x107de2[_0x0e48('0x31')]=qs['limit'](_0x46df2b['query'][_0x0e48('0x31')]);_0x107de2[_0x0e48('0x33')]=qs[_0x0e48('0x33')](_0x46df2b['query']['offset']);}return _0x148d8c['getAgents'](_0x107de2);}})[_0x0e48('0x24')](function(_0x3e96b0){if(_0x3e96b0){return _0x3e96b0?{'count':_0x3c7f85,'rows':_0x3e96b0}:null;}})[_0x0e48('0x24')](respondWithResult(_0x68806a,null))['catch'](handleError(_0x68806a,null));};exports['addApplications']=function(_0xaf7200,_0x406dda){var _0x1e7bdd=_0xaf7200[_0x0e48('0x5c')]['id'];var _0x1d370f=_0xaf7200[_0x0e48('0x5f')];var _0x88a36e=0xc8;var _0x1bd194=null;return db['sequelize'][_0x0e48('0x7e')]({'isolationLevel':db[_0x0e48('0x7f')][_0x0e48('0x80')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x557ee7){return db['WhatsappAccount'][_0x0e48('0x6b')]({'where':{'id':_0x1e7bdd},'transaction':_0x557ee7})[_0x0e48('0x24')](function(_0x4b0b83){if(_0x4b0b83){return db[_0x0e48('0x81')][_0x0e48('0x39')]({'where':{'WhatsappAccountId':_0x1e7bdd},'transaction':_0x557ee7})['then'](function(){var _0x581f47=_[_0x0e48('0x42')](_0x1d370f,function(_0x4d824d){_0x4d824d[_0x0e48('0x6d')]=_0x1e7bdd;return _0x4d824d;});return db[_0x0e48('0x81')]['bulkCreate'](_0x581f47,{'transaction':_0x557ee7});});}else{_0x88a36e=0x194;_0x1bd194=[];}});})[_0x0e48('0x24')](function(){if(_0x88a36e!==0x194){return db['WhatsappApplication'][_0x0e48('0x82')]({'where':{'WhatsappAccountId':_0x1e7bdd},'order':_0x0e48('0x83')})['then'](function(_0x60fd4e){_0x1bd194=_0x60fd4e;});}})['catch'](function(_0xf20edc){_0x88a36e=0x1f4;logger[_0x0e48('0x29')](_0xf20edc['stack']);if(_0xf20edc[_0x0e48('0x3e')]){delete _0xf20edc[_0x0e48('0x3e')];}_0x1bd194=_0xf20edc;})[_0x0e48('0x84')](function(){if(_0x1bd194===null){_0x406dda['sendStatus'](_0x88a36e);}else{if(_0x88a36e===0x1f4){_0x406dda[_0x0e48('0x34')](_0x88a36e)[_0x0e48('0x3f')](_0x1bd194);}else{_0x406dda[_0x0e48('0x34')](_0x88a36e)[_0x0e48('0x2f')](_0x1bd194);}}});};exports[_0x0e48('0x85')]=function(_0x17490f,_0x5d71e0,_0x485494){var _0x4a0b8a={};var _0x4f8fa4={};var _0x202f26;var _0x1d8056;return db['WhatsappAccount'][_0x0e48('0x6b')]({'where':{'id':_0x17490f['params']['id']}})[_0x0e48('0x24')](handleEntityNotFound(_0x5d71e0,null))[_0x0e48('0x24')](function(_0x5772d3){if(_0x5772d3){_0x202f26=_0x5772d3;_0x4f8fa4[_0x0e48('0x47')]=_[_0x0e48('0x49')](db[_0x0e48('0x81')][_0x0e48('0x43')]);_0x4f8fa4['query']=_['keys'](_0x17490f[_0x0e48('0x48')]);_0x4f8fa4[_0x0e48('0x4a')]=_[_0x0e48('0x4b')](_0x4f8fa4[_0x0e48('0x47')],_0x4f8fa4[_0x0e48('0x48')]);_0x4a0b8a[_0x0e48('0x4c')]=_[_0x0e48('0x4b')](_0x4f8fa4[_0x0e48('0x47')],qs[_0x0e48('0x4d')](_0x17490f[_0x0e48('0x48')][_0x0e48('0x4d')]));_0x4a0b8a[_0x0e48('0x4c')]=_0x4a0b8a[_0x0e48('0x4c')][_0x0e48('0x4e')]?_0x4a0b8a[_0x0e48('0x4c')]:_0x4f8fa4['model'];_0x4a0b8a[_0x0e48('0x4f')]=qs[_0x0e48('0x50')](_0x17490f[_0x0e48('0x48')][_0x0e48('0x50')]);_0x4a0b8a[_0x0e48('0x53')]=qs[_0x0e48('0x4a')](_[_0x0e48('0x51')](_0x17490f[_0x0e48('0x48')],_0x4f8fa4[_0x0e48('0x4a')]));if(_0x17490f[_0x0e48('0x48')][_0x0e48('0x52')]){_0x4a0b8a[_0x0e48('0x53')]=_[_0x0e48('0x54')](_0x4a0b8a[_0x0e48('0x53')],{'$or':_[_0x0e48('0x42')](_0x4a0b8a[_0x0e48('0x4c')],function(_0x731821){var _0x8720ff={};_0x8720ff[_0x731821]={'$like':'%'+_0x17490f[_0x0e48('0x48')][_0x0e48('0x52')]+'%'};return _0x8720ff;})});}_0x4a0b8a=_[_0x0e48('0x54')]({},_0x4a0b8a,_0x17490f[_0x0e48('0x55')]);return _0x202f26['getApplications'](_0x4a0b8a);}})['then'](function(_0x2bfee0){if(_0x2bfee0){_0x1d8056=_0x2bfee0['length'];if(!_0x17490f[_0x0e48('0x48')]['hasOwnProperty'](_0x0e48('0x74'))){_0x4a0b8a[_0x0e48('0x31')]=qs[_0x0e48('0x31')](_0x17490f[_0x0e48('0x48')][_0x0e48('0x31')]);_0x4a0b8a['offset']=qs[_0x0e48('0x33')](_0x17490f[_0x0e48('0x48')][_0x0e48('0x33')]);}return _0x202f26[_0x0e48('0x85')](_0x4a0b8a);}})['then'](function(_0x2c2bf2){if(_0x2c2bf2){return _0x2c2bf2?{'count':_0x1d8056,'rows':_0x2c2bf2}:null;}})[_0x0e48('0x24')](respondWithResult(_0x5d71e0,null))[_0x0e48('0x5a')](handleError(_0x5d71e0,null));};exports['notify']=function(_0x9befdc,_0x1e6ac6,_0x37625){var _0x23b94b={'channel':_0x0e48('0x86')};var _0xfa5d93=[];var _0x3689fe=[];var _0x396f87={};return db['WhatsappAccount']['find']({'where':{'id':_0x9befdc[_0x0e48('0x5c')]['id']},'include':[{'model':db[_0x0e48('0x81')],'as':'Applications'}]})['then'](handleEntityNotFound(_0x1e6ac6,null))[_0x0e48('0x24')](function(_0x322db5){_0x23b94b[_0x0e48('0x87')]=_0x322db5;if(_0x23b94b['account']&&_0x23b94b[_0x0e48('0x87')][_0x0e48('0x45')]===_0x0e48('0x88')&&_0x9befdc[_0x0e48('0x5f')][_0x0e48('0x89')]){if(_0x9befdc[_0x0e48('0x5f')][_0x0e48('0x89')]['length']===0x0)return;if(_0x9befdc['body'][_0x0e48('0x89')][0x0][_0x0e48('0x8a')]!==_0x0e48('0x8b'))return;return db['WhatsappMessage'][_0x0e48('0x38')]({'read':!![],'readAt':_0x9befdc[_0x0e48('0x5f')][_0x0e48('0x89')][0x0][_0x0e48('0x8c')]},{'where':{'messageId':_0x9befdc[_0x0e48('0x5f')][_0x0e48('0x89')][0x0][_0x0e48('0x8d')]},'individualHooks':!![]})['then'](function(_0x1f7987){return _0x1e6ac6[_0x0e48('0x34')](0xc8)[_0x0e48('0x2f')](_0x1f7987);});}_0x23b94b['applications']=_[_0x0e48('0x8e')](_0x322db5[_0x0e48('0x8f')],[_0x0e48('0x83')],[_0x0e48('0x90')]);if(_0x23b94b[_0x0e48('0x87')][_0x0e48('0x8f')]){delete _0x23b94b[_0x0e48('0x87')][_0x0e48('0x8f')];}return db[_0x0e48('0x91')][_0x0e48('0x68')]()[_0x0e48('0x24')](function(_0x3881b1){if(!_0x3881b1){throw new db[(_0x0e48('0x92'))][(_0x0e48('0x93'))](_0x0e48('0x94'));}_0xfa5d93=_[_0x0e48('0x95')](_[_0x0e48('0x49')](_0x3881b1),['createdAt','updatedAt']);_0x3689fe=_[_0x0e48('0x95')](_[_0x0e48('0x49')](_0x3881b1),['createdAt',_0x0e48('0x96'),_0x0e48('0x97'),'ListId']);_0x23b94b[_0x0e48('0x5f')]={'mapKey':'mobile'};if(_0x23b94b[_0x0e48('0x87')]&&_0x23b94b[_0x0e48('0x87')][_0x0e48('0x45')]===_0x0e48('0x98')){_0x23b94b[_0x0e48('0x5f')]['from']=_0x9befdc[_0x0e48('0x5f')][_0x0e48('0x99')]['replace'](_0x0e48('0x9a'),'');_0x23b94b[_0x0e48('0x5f')][_0x0e48('0x5f')]=_0x9befdc[_0x0e48('0x5f')][_0x0e48('0x9b')];_0x23b94b['body']['messageId']=_0x9befdc[_0x0e48('0x5f')][_0x0e48('0x9c')];}if(_0x23b94b[_0x0e48('0x87')]&&_0x23b94b['account'][_0x0e48('0x45')]==='sinch'){_0x23b94b[_0x0e48('0x5f')][_0x0e48('0x9d')]=_0x9befdc['body'][_0x0e48('0x9e')][0x0]['from'];_0x23b94b[_0x0e48('0x5f')][_0x0e48('0x5f')]=_0x9befdc['body'][_0x0e48('0x9e')][0x0]['message'][_0x0e48('0x5f')];_0x23b94b['body'][_0x0e48('0x9f')]=_0x9befdc[_0x0e48('0x5f')]['notifications'][0x0][_0x0e48('0x8d')];}if(_0x23b94b[_0x0e48('0x5f')]['id']){delete _0x23b94b[_0x0e48('0x5f')]['id'];}if(_[_0x0e48('0xa0')](_0x23b94b[_0x0e48('0x5f')][_0x0e48('0x9d')])){throw new db[(_0x0e48('0x92'))][(_0x0e48('0x93'))](_0x0e48('0xa1'));}if(_[_0x0e48('0xa0')](_0x23b94b['body'][_0x0e48('0x5f')])||_0x23b94b[_0x0e48('0x5f')][_0x0e48('0x5f')]===''){throw new db[(_0x0e48('0x92'))]['ValidationError'](_0x0e48('0xa2'));}if(_[_0x0e48('0xa0')](_0x23b94b[_0x0e48('0x5f')]['mapKey'])){throw new db[(_0x0e48('0x92'))][(_0x0e48('0x93'))](_0x0e48('0xa3')+_0x3689fe);}if(!_['includes'](_0x3689fe,_0x23b94b[_0x0e48('0x5f')]['mapKey'])){throw new db[(_0x0e48('0x92'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3689fe);}_0x396f87[_0x23b94b[_0x0e48('0x5f')]['mapKey']]=_0x23b94b[_0x0e48('0x5f')][_0x0e48('0x9d')];return db[_0x0e48('0xa4')][_0x0e48('0x5d')]({'where':{'id':_0x23b94b[_0x0e48('0x87')][_0x0e48('0xa5')]},'include':[{'model':db[_0x0e48('0x91')],'as':_0x0e48('0xa6'),'where':_0x396f87,'limit':0x1,'order':[['updatedAt',_0x0e48('0xa7')]]}]});})[_0x0e48('0x24')](handleEntityNotFound(_0x1e6ac6,null))[_0x0e48('0x24')](function(_0x12edc6){if(_0x12edc6){_0x23b94b[_0x0e48('0xa8')]=_[_0x0e48('0x77')](_0x12edc6,[_0x0e48('0xa6')]);if(_0x12edc6[_0x0e48('0xa6')][_0x0e48('0x4e')]){return _0x12edc6['Contacts'][0x0];}var _0x25062f=_[_0x0e48('0x1c')](_0x23b94b[_0x0e48('0x5f')],{'firstName':_0x23b94b['body']['from'],'ListId':_0x12edc6['id']});_0x25062f[_0x23b94b['body'][_0x0e48('0xa9')]]=_0x23b94b[_0x0e48('0x5f')][_0x0e48('0x9d')];return db[_0x0e48('0x91')][_0x0e48('0x5e')](_0x25062f,{'fields':_0xfa5d93,'raw':!![]});}})['then'](handleEntityNotFound(_0x1e6ac6,null))[_0x0e48('0x24')](function(_0x57e103){if(_0x57e103){_0x23b94b[_0x0e48('0xaa')]=_0x57e103;var _0x5643b7={'ContactId':_0x57e103['id'],'phone':_0x23b94b['body'][_0x0e48('0x9d')],'WhatsappAccountId':_0x9befdc[_0x0e48('0x5c')]['id']};var _0x4d6870={'ContactId':_0x57e103['id'],'WhatsappAccountId':_0x9befdc['params']['id'],'closed':![]};return db[_0x0e48('0xab')][_0x0e48('0x5d')]({'where':_0x4d6870})[_0x0e48('0x24')](function(_0x5c23cf){if(_0x5c23cf){return[_0x5c23cf,![]];}return db[_0x0e48('0xab')][_0x0e48('0x5e')](_0x5643b7)[_0x0e48('0x24')](function(_0x377311){return[_0x377311,!![]];});});}})[_0x0e48('0x78')](function(_0x57406a,_0x42373a){_0x23b94b['interaction']=_0x57406a['get']({'plain':!![]});_0x23b94b[_0x0e48('0xac')][_0x0e48('0xad')]=![];if(_0x42373a){if(_0x23b94b[_0x0e48('0x87')][_0x0e48('0xae')]){_0x23b94b[_0x0e48('0xaf')]['push']({'id':0x0,'priority':_0x23b94b['applications'][_0x0e48('0x4e')]+0x1,'app':_0x0e48('0xb0'),'appdata':_0x0e48('0xb1'),'interval':'*,*,*,*'});}_0x23b94b[_0x0e48('0xac')][_0x0e48('0xad')]=!![];}return db[_0x0e48('0xb2')][_0x0e48('0x5e')]({'phone':_0x23b94b['body'][_0x0e48('0x9d')],'messageId':_0x23b94b[_0x0e48('0x5f')][_0x0e48('0x9f')],'body':_0x23b94b[_0x0e48('0x5f')]['body'],'WhatsappAccountId':_0x9befdc[_0x0e48('0x5c')]['id'],'WhatsappInteractionId':_0x57406a['id'],'direction':'in','ContactId':_0x57406a[_0x0e48('0xb3')],'AttachmentId':_0x23b94b['body'][_0x0e48('0xb4')]});})[_0x0e48('0x24')](function(_0xe8591e){_0x23b94b['message']=_0xe8591e;if(_0x23b94b[_0x0e48('0xac')][_0x0e48('0xb5')]){return db[_0x0e48('0x7d')]['find']({'attributes':['id',_0x0e48('0x3e')],'where':{'id':_0x23b94b[_0x0e48('0xac')][_0x0e48('0xb5')]}})['then'](function(_0x30405e){if(_0x30405e){_0x23b94b[_0x0e48('0xaf')][_0x0e48('0xb6')]({'id':0x0,'priority':0x0,'app':_0x0e48('0xb7'),'appdata':_0x30405e[_0x0e48('0x3e')]+','+(_0x23b94b[_0x0e48('0x87')][_0x0e48('0xb8')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x0e48('0xb9'),_0x23b94b);});}return respondWithRpcPromise(_0x0e48('0xba'),'startRouting',_0x23b94b);})[_0x0e48('0x24')](function(_0xb446b4){if(_0xb446b4){var _0x1c225d=0xc8;var _0x1e371=_0x0e48('0xbb');logger['info'](_0x0e48('0x27'),_0x1e371,_0x1c225d,_0x0e48('0xbc'));logger[_0x0e48('0xbd')](_0x0e48('0xbe'),_0x1e371,_0x1c225d,_0x0e48('0xbc'),JSON[_0x0e48('0x28')](_0xb446b4));if(_0x23b94b[_0x0e48('0x87')][_0x0e48('0x45')]==='twilio'){return _0x1e6ac6[_0x0e48('0x34')](_0x1c225d)[_0x0e48('0xbf')]('Content-Type',_0x0e48('0xc0'))['send'](_0x0e48('0xc1'));}else{return _0x1e6ac6[_0x0e48('0x34')](_0x1c225d)[_0x0e48('0x2f')](_0xb446b4);}}});})[_0x0e48('0x5a')](handleError(_0x1e6ac6,null));};exports['send']=function(_0x4b2cbc,_0x252aa5,_0x40e7c4){var _0x4669ff,_0x6dea2d,_0x545d24;if(_[_0x0e48('0xa0')](_0x4b2cbc[_0x0e48('0x5f')][_0x0e48('0x5f')])||_0x4b2cbc[_0x0e48('0x5f')][_0x0e48('0x5f')]===''){throw new db[(_0x0e48('0x92'))][(_0x0e48('0x93'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x4b2cbc[_0x0e48('0x5f')]['to'])){throw new db[(_0x0e48('0x92'))][(_0x0e48('0x93'))](_0x0e48('0xc2'));}_0x4669ff=_0x4b2cbc['body']['to'];return db['WhatsappAccount'][_0x0e48('0x5d')]({'where':{'id':_0x4b2cbc[_0x0e48('0x5c')]['id']},'include':[{'model':db['CmList'],'as':_0x0e48('0xc3'),'include':[{'model':db[_0x0e48('0x91')],'as':_0x0e48('0xa6'),'where':{'mobile':_0x4669ff},'limit':0x1,'order':[[_0x0e48('0x96'),_0x0e48('0xa7')]]}]}]})[_0x0e48('0x24')](handleEntityNotFound(_0x252aa5,null))['then'](function(_0xfad0e8){if(_0xfad0e8&&_0xfad0e8[_0x0e48('0xc3')]){_0x6dea2d=_0xfad0e8['get']({'plain':!![]});if(_0x6dea2d[_0x0e48('0xc3')]&&_0x6dea2d[_0x0e48('0xc3')][_0x0e48('0xa6')]['length']){return _0x6dea2d[_0x0e48('0xc3')][_0x0e48('0xa6')][0x0];}return db[_0x0e48('0x91')][_0x0e48('0x5e')](_[_0x0e48('0x1c')](_0x4b2cbc[_0x0e48('0x5f')],{'firstName':_0x4669ff,'mobile':_0x4669ff,'phone':_0x4669ff,'ListId':_0x6dea2d[_0x0e48('0xa5')]}));}})[_0x0e48('0x24')](handleEntityNotFound(_0x252aa5,null))[_0x0e48('0x24')](function(_0x5493e1){if(_0x5493e1){_0x545d24=_0x5493e1;return db[_0x0e48('0xab')][_0x0e48('0x5d')]({'where':{'ContactId':_0x545d24['id'],'closed':![],'WhatsappAccountId':_0x6dea2d['id']}})[_0x0e48('0x24')](function(_0x303670){if(_0x303670){return[_0x303670,![]];}return db[_0x0e48('0xab')]['create']({'UserId':_0x4b2cbc[_0x0e48('0x62')]['id'],'ContactId':_0x545d24['id'],'WhatsappAccountId':_0x6dea2d['id'],'phone':_0x4669ff,'firstMsgDirection':_0x0e48('0xc4'),'Messages':[_['merge'](_0x4b2cbc[_0x0e48('0x5f')],{'read':![],'body':_0x4b2cbc[_0x0e48('0x5f')]['body'],'phone':_0x4669ff,'WhatsappAccountId':_0x6dea2d['id'],'UserId':_0x4b2cbc['user']['id'],'ContactId':_0x545d24['id']})]},{'include':[{'model':db[_0x0e48('0xb2')],'as':'Messages'}]})[_0x0e48('0x24')](function(_0x1cebd4){return[_0x1cebd4,!![]];});});}})[_0x0e48('0x78')](function(_0x3bcc3f,_0x596c70){if(_0x596c70){return _0x3bcc3f;}return db[_0x0e48('0xb2')]['create'](_[_0x0e48('0x54')](_0x4b2cbc['body'],{'read':![],'body':_0x4b2cbc[_0x0e48('0x5f')][_0x0e48('0x5f')],'phone':_0x4669ff,'WhatsappAccountId':_0x6dea2d['id'],'WhatsappInteractionId':_0x3bcc3f['id'],'UserId':_0x4b2cbc[_0x0e48('0x62')]['id'],'ContactId':_0x545d24['id']}))[_0x0e48('0x24')](function(_0x2b728f){_0x3bcc3f['dataValues'][_0x0e48('0xc5')]=[];_0x3bcc3f[_0x0e48('0xc6')]['Messages'][_0x0e48('0xc7')](_0x2b728f[_0x0e48('0xc6')]);return _0x3bcc3f;});})[_0x0e48('0x24')](respondWithResult(_0x252aa5,null))[_0x0e48('0x5a')](handleError(_0x252aa5,null));};
\ No newline at end of file
index ee0506f..6e12cc0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe66f=['setMaxListeners','update','emit','hook','exports','events','../../mysqldb','WhatsappAccount'];(function(_0x58150b,_0x45d20e){var _0x44b019=function(_0x5a392c){while(--_0x5a392c){_0x58150b['push'](_0x58150b['shift']());}};_0x44b019(++_0x45d20e);}(_0xe66f,0x1bd));var _0xfe66=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xe66f[_0x46e363];return _0x3fb059;};'use strict';var EventEmitter=require(_0xfe66('0x0'));var WhatsappAccount=require(_0xfe66('0x1'))['db'][_0xfe66('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xfe66('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfe66('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1b5e80){return function(_0x385e8f,_0x353806,_0x532a50){WhatsappAccountEvents['emit'](_0x1b5e80+':'+_0x385e8f['id'],_0x385e8f);WhatsappAccountEvents[_0xfe66('0x5')](_0x1b5e80,_0x385e8f);_0x532a50(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0xfe66('0x6')](e,emitEvent(event));}}module[_0xfe66('0x7')]=WhatsappAccountEvents;
\ No newline at end of file
+var _0x6def=['update','emit','hasOwnProperty','exports','../../mysqldb','setMaxListeners'];(function(_0x2ab695,_0x4f8bc2){var _0x4483c3=function(_0x3557d2){while(--_0x3557d2){_0x2ab695['push'](_0x2ab695['shift']());}};_0x4483c3(++_0x4f8bc2);}(_0x6def,0x19c));var _0xf6de=function(_0x279ee8,_0x46567f){_0x279ee8=_0x279ee8-0x0;var _0xdf1117=_0x6def[_0x279ee8];return _0xdf1117;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0xf6de('0x0'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xf6de('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf6de('0x2'),'afterDestroy':'remove'};function emitEvent(_0x43dff1){return function(_0x218a11,_0x5c6539,_0x2edfbf){WhatsappAccountEvents[_0xf6de('0x3')](_0x43dff1+':'+_0x218a11['id'],_0x218a11);WhatsappAccountEvents[_0xf6de('0x3')](_0x43dff1,_0x218a11);_0x2edfbf(null);};}for(var e in events){if(events[_0xf6de('0x4')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0xf6de('0x5')]=WhatsappAccountEvents;
\ No newline at end of file
index 9bbd884..c3b5716 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6223=['moment','bluebird','request-promise','rimraf','./whatsappAccount.attributes','define','WhatsappAccount','whatsapp_accounts','lodash','util'];(function(_0x130fe3,_0x26f70d){var _0x344ced=function(_0x146f24){while(--_0x146f24){_0x130fe3['push'](_0x130fe3['shift']());}};_0x344ced(++_0x26f70d);}(_0x6223,0x184));var _0x3622=function(_0x43576f,_0x1356ed){_0x43576f=_0x43576f-0x0;var _0x4d2466=_0x6223[_0x43576f];return _0x4d2466;};'use strict';var _=require(_0x3622('0x0'));var util=require(_0x3622('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3622('0x2'));var BPromise=require(_0x3622('0x3'));var rp=require(_0x3622('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3622('0x5'));var config=require('../../config/environment');var attributes=require(_0x3622('0x6'));module['exports']=function(_0x1567d9,_0x23f6ea){return _0x1567d9[_0x3622('0x7')](_0x3622('0x8'),attributes,{'tableName':_0x3622('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc4e3=['./whatsappAccount.attributes','exports','define','WhatsappAccount','lodash','util','request-promise','rimraf','../../config/environment'];(function(_0x2a558d,_0x2df0ff){var _0xa7bc9c=function(_0x12a30e){while(--_0x12a30e){_0x2a558d['push'](_0x2a558d['shift']());}};_0xa7bc9c(++_0x2df0ff);}(_0xc4e3,0xdc));var _0x3c4e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4e3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3c4e('0x0'));var util=require(_0x3c4e('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3c4e('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3c4e('0x3'));var config=require(_0x3c4e('0x4'));var attributes=require(_0x3c4e('0x5'));module[_0x3c4e('0x6')]=function(_0xb91f83,_0x578cdc){return _0xb91f83[_0x3c4e('0x7')](_0x3c4e('0x8'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9fda98c..ad0ebf8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e5b=['options','raw','where','attributes','include','model','map','ShowWhatsappAccount','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','find'];(function(_0x15ff6f,_0x33bcdf){var _0x307bd4=function(_0xe1975){while(--_0xe1975){_0x15ff6f['push'](_0x15ff6f['shift']());}};_0x307bd4(++_0x33bcdf);}(_0x3e5b,0x1e9));var _0xb3e5=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x3e5b[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0xb3e5('0x0'));var moment=require(_0xb3e5('0x1'));var BPromise=require(_0xb3e5('0x2'));var rs=require(_0xb3e5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb3e5('0x4'))['db'];var utils=require(_0xb3e5('0x5'));var logger=require('../../config/logger')(_0xb3e5('0x6'));var config=require(_0xb3e5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb3e5('0x8')][_0xb3e5('0x9')]({'port':0x232a});config[_0xb3e5('0xa')]=_[_0xb3e5('0xb')](config[_0xb3e5('0xa')],{'host':_0xb3e5('0xc'),'port':0x18eb});var socket=require(_0xb3e5('0xd'))(new Redis(config[_0xb3e5('0xa')]));require(_0xb3e5('0xe'))[_0xb3e5('0xf')](socket);function respondWithRpcPromise(_0x4bfebf,_0x233845,_0x591b83){return new BPromise(function(_0x564fee,_0x35cd47){return client[_0xb3e5('0x10')](_0x4bfebf,_0x591b83)[_0xb3e5('0x11')](function(_0x1d7cb5){logger[_0xb3e5('0x12')](_0xb3e5('0x13'),_0x233845,_0xb3e5('0x14'));logger[_0xb3e5('0x15')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x233845,_0xb3e5('0x14'),JSON[_0xb3e5('0x16')](_0x1d7cb5));if(_0x1d7cb5[_0xb3e5('0x17')]){if(_0x1d7cb5[_0xb3e5('0x17')][_0xb3e5('0x18')]===0x1f4){logger[_0xb3e5('0x17')]('WhatsappAccount,\x20%s,\x20%s',_0x233845,_0x1d7cb5['error'][_0xb3e5('0x19')]);return _0x35cd47(_0x1d7cb5[_0xb3e5('0x17')][_0xb3e5('0x19')]);}logger[_0xb3e5('0x17')]('WhatsappAccount,\x20%s,\x20%s',_0x233845,_0x1d7cb5[_0xb3e5('0x17')][_0xb3e5('0x19')]);return _0x564fee(_0x1d7cb5['error'][_0xb3e5('0x19')]);}else{logger[_0xb3e5('0x12')](_0xb3e5('0x13'),_0x233845,_0xb3e5('0x14'));_0x564fee(_0x1d7cb5[_0xb3e5('0x1a')][_0xb3e5('0x19')]);}})[_0xb3e5('0x1b')](function(_0x39919c){logger[_0xb3e5('0x17')](_0xb3e5('0x13'),_0x233845,_0x39919c);_0x35cd47(_0x39919c);});});}exports['ShowWhatsappAccount']=function(_0x979757){var _0x455179=this;return new Promise(function(_0xc37400,_0x230375){return db['WhatsappAccount'][_0xb3e5('0x1c')]({'raw':_0x979757[_0xb3e5('0x1d')]?_0x979757[_0xb3e5('0x1d')][_0xb3e5('0x1e')]===undefined?!![]:![]:!![],'where':_0x979757[_0xb3e5('0x1d')]?_0x979757[_0xb3e5('0x1d')][_0xb3e5('0x1f')]||null:null,'attributes':_0x979757[_0xb3e5('0x1d')]?_0x979757[_0xb3e5('0x1d')][_0xb3e5('0x20')]||null:null,'include':_0x979757[_0xb3e5('0x1d')]?_0x979757['options']['include']?_['map'](_0x979757[_0xb3e5('0x1d')][_0xb3e5('0x21')],function(_0x4f4d72){return{'model':db[_0x4f4d72['model']],'as':_0x4f4d72['as'],'attributes':_0x4f4d72[_0xb3e5('0x20')],'include':_0x4f4d72[_0xb3e5('0x21')]?_['map'](_0x4f4d72['include'],function(_0x2c5d50){return{'model':db[_0x2c5d50[_0xb3e5('0x22')]],'as':_0x2c5d50['as'],'attributes':_0x2c5d50['attributes'],'include':_0x2c5d50[_0xb3e5('0x21')]?_[_0xb3e5('0x23')](_0x2c5d50[_0xb3e5('0x21')],function(_0x4ec86d){return{'model':db[_0x4ec86d[_0xb3e5('0x22')]],'as':_0x4ec86d['as'],'attributes':_0x4ec86d[_0xb3e5('0x20')]};}):[]};}):[]};}):[]:[]})[_0xb3e5('0x11')](function(_0x4dc42d){logger[_0xb3e5('0x12')](_0xb3e5('0x24'),_0x979757);logger['debug'](_0xb3e5('0x24'),_0x979757,JSON[_0xb3e5('0x16')](_0x4dc42d));_0xc37400(_0x4dc42d);})[_0xb3e5('0x1b')](function(_0x2c6fd2){logger[_0xb3e5('0x17')](_0xb3e5('0x24'),_0x2c6fd2['message'],_0x979757);_0x230375(_0x455179[_0xb3e5('0x17')](0x1f4,_0x2c6fd2[_0xb3e5('0x19')]));});});};
\ No newline at end of file
+var _0x73aa=['ShowWhatsappAccount','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','find','options','raw','where','attributes','include','map','model','debug'];(function(_0x2b7b1d,_0x3e75e3){var _0x3b5a92=function(_0x4c7b3a){while(--_0x4c7b3a){_0x2b7b1d['push'](_0x2b7b1d['shift']());}};_0x3b5a92(++_0x3e75e3);}(_0x73aa,0x1eb));var _0xa73a=function(_0x489b87,_0xd51c93){_0x489b87=_0x489b87-0x0;var _0x1823b6=_0x73aa[_0x489b87];return _0x1823b6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa73a('0x0'));var BPromise=require(_0xa73a('0x1'));var rs=require(_0xa73a('0x2'));var fs=require('fs');var Redis=require(_0xa73a('0x3'));var db=require(_0xa73a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa73a('0x5'))(_0xa73a('0x6'));var config=require(_0xa73a('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa73a('0x8')]({'port':0x232a});config[_0xa73a('0x9')]=_[_0xa73a('0xa')](config[_0xa73a('0x9')],{'host':_0xa73a('0xb'),'port':0x18eb});var socket=require(_0xa73a('0xc'))(new Redis(config[_0xa73a('0x9')]));require('./whatsappAccount.socket')[_0xa73a('0xd')](socket);function respondWithRpcPromise(_0x5ce8a2,_0x3f43f3,_0x1ca27b){return new BPromise(function(_0x3ab868,_0x480f7b){return client[_0xa73a('0xe')](_0x5ce8a2,_0x1ca27b)[_0xa73a('0xf')](function(_0x23c3a6){logger[_0xa73a('0x10')](_0xa73a('0x11'),_0x3f43f3,_0xa73a('0x12'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x3f43f3,_0xa73a('0x12'),JSON[_0xa73a('0x13')](_0x23c3a6));if(_0x23c3a6['error']){if(_0x23c3a6['error'][_0xa73a('0x14')]===0x1f4){logger['error'](_0xa73a('0x11'),_0x3f43f3,_0x23c3a6[_0xa73a('0x15')][_0xa73a('0x16')]);return _0x480f7b(_0x23c3a6[_0xa73a('0x15')][_0xa73a('0x16')]);}logger[_0xa73a('0x15')](_0xa73a('0x11'),_0x3f43f3,_0x23c3a6['error'][_0xa73a('0x16')]);return _0x3ab868(_0x23c3a6[_0xa73a('0x15')][_0xa73a('0x16')]);}else{logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x3f43f3,_0xa73a('0x12'));_0x3ab868(_0x23c3a6[_0xa73a('0x17')][_0xa73a('0x16')]);}})[_0xa73a('0x18')](function(_0x5b9638){logger[_0xa73a('0x15')](_0xa73a('0x11'),_0x3f43f3,_0x5b9638);_0x480f7b(_0x5b9638);});});}exports['ShowWhatsappAccount']=function(_0x50acfd){var _0x4d5b85=this;return new Promise(function(_0x4b95a4,_0x5e6e33){return db['WhatsappAccount'][_0xa73a('0x19')]({'raw':_0x50acfd['options']?_0x50acfd[_0xa73a('0x1a')][_0xa73a('0x1b')]===undefined?!![]:![]:!![],'where':_0x50acfd['options']?_0x50acfd[_0xa73a('0x1a')][_0xa73a('0x1c')]||null:null,'attributes':_0x50acfd['options']?_0x50acfd['options'][_0xa73a('0x1d')]||null:null,'include':_0x50acfd[_0xa73a('0x1a')]?_0x50acfd[_0xa73a('0x1a')][_0xa73a('0x1e')]?_[_0xa73a('0x1f')](_0x50acfd[_0xa73a('0x1a')][_0xa73a('0x1e')],function(_0x1508e8){return{'model':db[_0x1508e8[_0xa73a('0x20')]],'as':_0x1508e8['as'],'attributes':_0x1508e8['attributes'],'include':_0x1508e8['include']?_[_0xa73a('0x1f')](_0x1508e8['include'],function(_0x313dc5){return{'model':db[_0x313dc5[_0xa73a('0x20')]],'as':_0x313dc5['as'],'attributes':_0x313dc5[_0xa73a('0x1d')],'include':_0x313dc5['include']?_['map'](_0x313dc5[_0xa73a('0x1e')],function(_0x53782a){return{'model':db[_0x53782a[_0xa73a('0x20')]],'as':_0x53782a['as'],'attributes':_0x53782a[_0xa73a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa73a('0xf')](function(_0xdc1022){logger[_0xa73a('0x10')]('ShowWhatsappAccount',_0x50acfd);logger[_0xa73a('0x21')]('ShowWhatsappAccount',_0x50acfd,JSON['stringify'](_0xdc1022));_0x4b95a4(_0xdc1022);})[_0xa73a('0x18')](function(_0x40b95e){logger['error'](_0xa73a('0x22'),_0x40b95e[_0xa73a('0x16')],_0x50acfd);_0x5e6e33(_0x4d5b85[_0xa73a('0x15')](0x1f4,_0x40b95e[_0xa73a('0x16')]));});});};
\ No newline at end of file
index d140af5..2acd322 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ef5=['remove','update','length','whatsappAccount:','save'];(function(_0x4c7fb5,_0x2548ef){var _0x2e10ac=function(_0xf7e27c){while(--_0xf7e27c){_0x4c7fb5['push'](_0x4c7fb5['shift']());}};_0x2e10ac(++_0x2548ef);}(_0x1ef5,0xc7));var _0x51ef=function(_0x4b7ce2,_0x145b76){_0x4b7ce2=_0x4b7ce2-0x0;var _0x1891da=_0x1ef5[_0x4b7ce2];return _0x1891da;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0x51ef('0x0'),_0x51ef('0x1'),_0x51ef('0x2')];function createListener(_0x3ed55b,_0x27a73f){return function(_0x3155dd){_0x27a73f['emit'](_0x3ed55b,_0x3155dd);};}function removeListener(_0x9a1bf3,_0x1fc8bb){return function(){WhatsappAccountEvents['removeListener'](_0x9a1bf3,_0x1fc8bb);};}exports['register']=function(_0xde4073){for(var _0x3d464a=0x0,_0x151928=events[_0x51ef('0x3')];_0x3d464a<_0x151928;_0x3d464a++){var _0x30f3be=events[_0x3d464a];var _0xa75652=createListener(_0x51ef('0x4')+_0x30f3be,_0xde4073);WhatsappAccountEvents['on'](_0x30f3be,_0xa75652);}};
\ No newline at end of file
+var _0xd3b4=['./whatsappAccount.events','remove','emit','register','length','whatsappAccount:'];(function(_0x1c1ac7,_0x31566a){var _0xc7f136=function(_0x15ab16){while(--_0x15ab16){_0x1c1ac7['push'](_0x1c1ac7['shift']());}};_0xc7f136(++_0x31566a);}(_0xd3b4,0x126));var _0x4d3b=function(_0x347bc2,_0x5a5189){_0x347bc2=_0x347bc2-0x0;var _0x319a3e=_0xd3b4[_0x347bc2];return _0x319a3e;};'use strict';var WhatsappAccountEvents=require(_0x4d3b('0x0'));var events=['save',_0x4d3b('0x1'),'update'];function createListener(_0x457414,_0x11aaa9){return function(_0x4ef62d){_0x11aaa9[_0x4d3b('0x2')](_0x457414,_0x4ef62d);};}function removeListener(_0xbae607,_0x58c2fa){return function(){WhatsappAccountEvents['removeListener'](_0xbae607,_0x58c2fa);};}exports[_0x4d3b('0x3')]=function(_0x29804b){for(var _0x4b6a0f=0x0,_0x127f44=events[_0x4d3b('0x4')];_0x4b6a0f<_0x127f44;_0x4b6a0f++){var _0x46cddf=events[_0x4b6a0f];var _0xe6d5d=createListener(_0x4d3b('0x5')+_0x46cddf,_0x29804b);WhatsappAccountEvents['on'](_0x46cddf,_0xe6d5d);}};
\ No newline at end of file
index 6211d26..9e8ae2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb303=['create','put','destroy','util','path','express','Router','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','index','/:id','isAuthenticated','show'];(function(_0x4e8d59,_0x453f7f){var _0x2e73bf=function(_0x4c8fe8){while(--_0x4c8fe8){_0x4e8d59['push'](_0x4e8d59['shift']());}};_0x2e73bf(++_0x453f7f);}(_0xb303,0x14d));var _0x3b30=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb303[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0x3b30('0x0'));var path=require(_0x3b30('0x1'));var timeout=require('connect-timeout');var express=require(_0x3b30('0x2'));var router=express[_0x3b30('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3b30('0x4'));var config=require(_0x3b30('0x5'));var controller=require(_0x3b30('0x6'));router[_0x3b30('0x7')]('/',auth['isAuthenticated'](),controller[_0x3b30('0x8')]);router[_0x3b30('0x7')](_0x3b30('0x9'),auth[_0x3b30('0xa')](),controller[_0x3b30('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3b30('0xc')]);router[_0x3b30('0xd')](_0x3b30('0x9'),auth[_0x3b30('0xa')](),controller['update']);router['delete'](_0x3b30('0x9'),auth['isAuthenticated'](),controller[_0x3b30('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0xf356=['/:id','show','post','put','update','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xf356,0x1ed));var _0x6f35=function(_0x270037,_0x37f9ea){_0x270037=_0x270037-0x0;var _0x4f8795=_0xf356[_0x270037];return _0x4f8795;};'use strict';var multer=require(_0x6f35('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6f35('0x1'));var router=express[_0x6f35('0x2')]();var fs_extra=require(_0x6f35('0x3'));var auth=require(_0x6f35('0x4'));var interaction=require(_0x6f35('0x5'));var config=require(_0x6f35('0x6'));var controller=require(_0x6f35('0x7'));router[_0x6f35('0x8')]('/',auth[_0x6f35('0x9')](),controller[_0x6f35('0xa')]);router[_0x6f35('0x8')](_0x6f35('0xb'),auth[_0x6f35('0x9')](),controller[_0x6f35('0xc')]);router[_0x6f35('0xd')]('/',auth[_0x6f35('0x9')](),controller['create']);router[_0x6f35('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x6f35('0xf')]);router['delete'](_0x6f35('0xb'),auth[_0x6f35('0x9')](),controller[_0x6f35('0x10')]);module[_0x6f35('0x11')]=router;
\ No newline at end of file
index 83954d8..0031e36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f7e=['INTEGER','noop','TEXT','STRING','*,*,*,*','sequelize','exports'];(function(_0x59d4cc,_0x3bec64){var _0x3a8808=function(_0x5de1a5){while(--_0x5de1a5){_0x59d4cc['push'](_0x59d4cc['shift']());}};_0x3a8808(++_0x3bec64);}(_0x4f7e,0x10f));var _0xe4f7=function(_0x3d5bc9,_0x27ba9b){_0x3d5bc9=_0x3d5bc9-0x0;var _0x53c19e=_0x4f7e[_0x3d5bc9];return _0x53c19e;};'use strict';var Sequelize=require(_0xe4f7('0x0'));module[_0xe4f7('0x1')]={'priority':{'type':Sequelize[_0xe4f7('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe4f7('0x3')},'appdata':{'type':Sequelize[_0xe4f7('0x4')]()},'description':{'type':Sequelize[_0xe4f7('0x5')]},'interval':{'type':Sequelize[_0xe4f7('0x5')],'defaultValue':_0xe4f7('0x6')}};
\ No newline at end of file
+var _0xd247=['STRING','TEXT','sequelize'];(function(_0x44b5b7,_0x15982a){var _0x52852f=function(_0x1b5d96){while(--_0x1b5d96){_0x44b5b7['push'](_0x44b5b7['shift']());}};_0x52852f(++_0x15982a);}(_0xd247,0xaa));var _0x7d24=function(_0x4f2e4b,_0x2d084c){_0x4f2e4b=_0x4f2e4b-0x0;var _0x3afdbb=_0xd247[_0x4f2e4b];return _0x3afdbb;};'use strict';var Sequelize=require(_0x7d24('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x7d24('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x7d24('0x2')]()},'description':{'type':Sequelize[_0x7d24('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index fdbd62a..08a1646 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f68=['create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','WhatsappApplication','then','includeAll','include','rows','catch','show','params','length'];(function(_0x28014d,_0x1b86d0){var _0x1251ca=function(_0x31d678){while(--_0x31d678){_0x28014d['push'](_0x28014d['shift']());}};_0x1251ca(++_0x1b86d0);}(_0x2f68,0x12b));var _0x82f6=function(_0x3e3911,_0x1ad3b8){_0x3e3911=_0x3e3911-0x0;var _0xe4dea8=_0x2f68[_0x3e3911];return _0xe4dea8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x82f6('0x0'));var zipdir=require(_0x82f6('0x1'));var jsonpatch=require(_0x82f6('0x2'));var rp=require(_0x82f6('0x3'));var moment=require(_0x82f6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x82f6('0x5'));var util=require(_0x82f6('0x6'));var path=require(_0x82f6('0x7'));var sox=require(_0x82f6('0x8'));var csv=require(_0x82f6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x82f6('0xa'));var squel=require('squel');var crypto=require(_0x82f6('0xb'));var jsforce=require(_0x82f6('0xc'));var deskjs=require(_0x82f6('0xd'));var toCsv=require('to-csv');var querystring=require(_0x82f6('0xe'));var Papa=require(_0x82f6('0xf'));var Redis=require(_0x82f6('0x10'));var authService=require(_0x82f6('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x82f6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x82f6('0x13'));var utils=require('../../config/utils');var config=require(_0x82f6('0x14'));var licenseUtil=require(_0x82f6('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x470319,_0x4ec610){_0x4ec610=_0x4ec610||0xcc;return function(_0x42cf80){if(_0x42cf80){return _0x470319['sendStatus'](_0x4ec610);}return _0x470319['status'](_0x4ec610)[_0x82f6('0x16')]();};}function respondWithResult(_0xb4c0d7,_0x2e98c2){_0x2e98c2=_0x2e98c2||0xc8;return function(_0x3ca926){if(_0x3ca926){return _0xb4c0d7[_0x82f6('0x17')](_0x2e98c2)[_0x82f6('0x18')](_0x3ca926);}};}function respondWithFilteredResult(_0x3b0252,_0x376b4b){return function(_0x447987){if(_0x447987){var _0x42ef53=typeof _0x376b4b[_0x82f6('0x19')]===_0x82f6('0x1a')&&typeof _0x376b4b[_0x82f6('0x1b')]===_0x82f6('0x1a');var _0x25df8c=_0x447987[_0x82f6('0x1c')];var _0x59333a=_0x42ef53?0x0:_0x376b4b[_0x82f6('0x19')];var _0x39dea8=_0x42ef53?_0x447987[_0x82f6('0x1c')]:_0x376b4b[_0x82f6('0x19')]+_0x376b4b['limit'];var _0x2de7b4;if(_0x39dea8>=_0x25df8c){_0x39dea8=_0x25df8c;_0x2de7b4=0xc8;}else{_0x2de7b4=0xce;}_0x3b0252[_0x82f6('0x17')](_0x2de7b4);return _0x3b0252[_0x82f6('0x1d')](_0x82f6('0x1e'),_0x59333a+'-'+_0x39dea8+'/'+_0x25df8c)['json'](_0x447987);}return null;};}function patchUpdates(_0x3abb44){return function(_0x2a18d8){try{jsonpatch['apply'](_0x2a18d8,_0x3abb44,!![]);}catch(_0x238de3){return BPromise[_0x82f6('0x1f')](_0x238de3);}return _0x2a18d8[_0x82f6('0x20')]();};}function saveUpdates(_0x52085d,_0x2099dc){return function(_0x4c2413){if(_0x4c2413){return _0x4c2413[_0x82f6('0x21')](_0x52085d)['then'](function(_0x37fb0c){return _0x37fb0c;});}return null;};}function removeEntity(_0xf58240,_0xe45c){return function(_0x219101){if(_0x219101){return _0x219101[_0x82f6('0x22')]()['then'](function(){_0xf58240[_0x82f6('0x17')](0xcc)[_0x82f6('0x16')]();});}};}function handleEntityNotFound(_0x574713,_0x53cf81){return function(_0x53ced4){if(!_0x53ced4){_0x574713[_0x82f6('0x23')](0x194);}return _0x53ced4;};}function handleError(_0x3954e5,_0x15069b){_0x15069b=_0x15069b||0x1f4;return function(_0x4b734e){logger[_0x82f6('0x24')](_0x4b734e[_0x82f6('0x25')]);if(_0x4b734e['name']){delete _0x4b734e[_0x82f6('0x26')];}_0x3954e5[_0x82f6('0x17')](_0x15069b)[_0x82f6('0x27')](_0x4b734e);};}exports[_0x82f6('0x28')]=function(_0x285040,_0x4fde1b){var _0x164266={},_0x230998={},_0x1257f1={'count':0x0,'rows':[]};var _0x105c00=_[_0x82f6('0x29')](db['WhatsappApplication'][_0x82f6('0x2a')],function(_0x59983c){return{'name':_0x59983c[_0x82f6('0x2b')],'type':_0x59983c['type'][_0x82f6('0x2c')]};});_0x230998['model']=_[_0x82f6('0x29')](_0x105c00,_0x82f6('0x26'));_0x230998[_0x82f6('0x2d')]=_[_0x82f6('0x2e')](_0x285040['query']);_0x230998[_0x82f6('0x2f')]=_['intersection'](_0x230998[_0x82f6('0x30')],_0x230998[_0x82f6('0x2d')]);_0x164266['attributes']=_[_0x82f6('0x31')](_0x230998['model'],qs[_0x82f6('0x32')](_0x285040[_0x82f6('0x2d')][_0x82f6('0x32')]));_0x164266[_0x82f6('0x33')]=_0x164266[_0x82f6('0x33')]['length']?_0x164266['attributes']:_0x230998[_0x82f6('0x30')];if(!_0x285040[_0x82f6('0x2d')][_0x82f6('0x34')](_0x82f6('0x35'))){_0x164266[_0x82f6('0x1b')]=qs[_0x82f6('0x1b')](_0x285040[_0x82f6('0x2d')][_0x82f6('0x1b')]);_0x164266['offset']=qs[_0x82f6('0x19')](_0x285040[_0x82f6('0x2d')][_0x82f6('0x19')]);}_0x164266['order']=qs[_0x82f6('0x36')](_0x285040[_0x82f6('0x2d')][_0x82f6('0x36')]);_0x164266[_0x82f6('0x37')]=qs[_0x82f6('0x2f')](_[_0x82f6('0x38')](_0x285040[_0x82f6('0x2d')],_0x230998[_0x82f6('0x2f')]),_0x105c00);if(_0x285040[_0x82f6('0x2d')]['filter']){_0x164266[_0x82f6('0x37')]=_[_0x82f6('0x39')](_0x164266[_0x82f6('0x37')],{'$or':_[_0x82f6('0x29')](_0x105c00,function(_0x37547e){if(_0x37547e[_0x82f6('0x3a')]!==_0x82f6('0x3b')){var _0x19cb37={};_0x19cb37[_0x37547e['name']]={'$like':'%'+_0x285040[_0x82f6('0x2d')][_0x82f6('0x3c')]+'%'};return _0x19cb37;}})});}_0x164266=_[_0x82f6('0x39')]({},_0x164266,_0x285040[_0x82f6('0x3d')]);var _0x39760e={'where':_0x164266['where']};return db[_0x82f6('0x3e')]['count'](_0x39760e)[_0x82f6('0x3f')](function(_0x4d341d){_0x1257f1[_0x82f6('0x1c')]=_0x4d341d;if(_0x285040[_0x82f6('0x2d')][_0x82f6('0x40')]){_0x164266[_0x82f6('0x41')]=[{'all':!![]}];}return db['WhatsappApplication']['findAll'](_0x164266);})[_0x82f6('0x3f')](function(_0x24f302){_0x1257f1[_0x82f6('0x42')]=_0x24f302;return _0x1257f1;})[_0x82f6('0x3f')](respondWithFilteredResult(_0x4fde1b,_0x164266))[_0x82f6('0x43')](handleError(_0x4fde1b,null));};exports[_0x82f6('0x44')]=function(_0x36c935,_0x546a14){var _0xc76bcf={'raw':!![],'where':{'id':_0x36c935[_0x82f6('0x45')]['id']}},_0x1b6eb4={};_0x1b6eb4[_0x82f6('0x30')]=_['keys'](db[_0x82f6('0x3e')][_0x82f6('0x2a')]);_0x1b6eb4[_0x82f6('0x2d')]=_[_0x82f6('0x2e')](_0x36c935[_0x82f6('0x2d')]);_0x1b6eb4[_0x82f6('0x2f')]=_[_0x82f6('0x31')](_0x1b6eb4[_0x82f6('0x30')],_0x1b6eb4[_0x82f6('0x2d')]);_0xc76bcf[_0x82f6('0x33')]=_[_0x82f6('0x31')](_0x1b6eb4[_0x82f6('0x30')],qs[_0x82f6('0x32')](_0x36c935[_0x82f6('0x2d')][_0x82f6('0x32')]));_0xc76bcf['attributes']=_0xc76bcf['attributes'][_0x82f6('0x46')]?_0xc76bcf['attributes']:_0x1b6eb4[_0x82f6('0x30')];if(_0x36c935[_0x82f6('0x2d')][_0x82f6('0x40')]){_0xc76bcf['include']=[{'all':!![]}];}_0xc76bcf=_[_0x82f6('0x39')]({},_0xc76bcf,_0x36c935[_0x82f6('0x3d')]);return db['WhatsappApplication']['find'](_0xc76bcf)[_0x82f6('0x3f')](handleEntityNotFound(_0x546a14,null))['then'](respondWithResult(_0x546a14,null))['catch'](handleError(_0x546a14,null));};exports[_0x82f6('0x47')]=function(_0x5e6b61,_0x56e83a){return db[_0x82f6('0x3e')]['create'](_0x5e6b61['body'],{})[_0x82f6('0x3f')](respondWithResult(_0x56e83a,0xc9))['catch'](handleError(_0x56e83a,null));};exports[_0x82f6('0x21')]=function(_0xff24e,_0x419d86){if(_0xff24e[_0x82f6('0x48')]['id']){delete _0xff24e[_0x82f6('0x48')]['id'];}return db[_0x82f6('0x3e')]['find']({'where':{'id':_0xff24e['params']['id']}})[_0x82f6('0x3f')](handleEntityNotFound(_0x419d86,null))[_0x82f6('0x3f')](saveUpdates(_0xff24e[_0x82f6('0x48')],null))[_0x82f6('0x3f')](respondWithResult(_0x419d86,null))[_0x82f6('0x43')](handleError(_0x419d86,null));};exports[_0x82f6('0x22')]=function(_0x4a999a,_0x36c5f7){return db[_0x82f6('0x3e')][_0x82f6('0x49')]({'where':{'id':_0x4a999a['params']['id']}})['then'](handleEntityNotFound(_0x36c5f7,null))['then'](removeEntity(_0x36c5f7,null))['catch'](handleError(_0x36c5f7,null));};
\ No newline at end of file
+var _0xdc91=['mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','save','update','then','destroy','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','where','filters','pick','merge','type','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','bluebird'];(function(_0x2ced3b,_0xe131cf){var _0xed9aed=function(_0x5db1d0){while(--_0x5db1d0){_0x2ced3b['push'](_0x2ced3b['shift']());}};_0xed9aed(++_0xe131cf);}(_0xdc91,0x8b));var _0x1dc9=function(_0x4271eb,_0x31d891){_0x4271eb=_0x4271eb-0x0;var _0x1ed1ea=_0xdc91[_0x4271eb];return _0x1ed1ea;};'use strict';var emlformat=require(_0x1dc9('0x0'));var rimraf=require(_0x1dc9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1dc9('0x2'));var Mustache=require(_0x1dc9('0x3'));var util=require(_0x1dc9('0x4'));var path=require(_0x1dc9('0x5'));var sox=require(_0x1dc9('0x6'));var csv=require(_0x1dc9('0x7'));var ejs=require(_0x1dc9('0x8'));var fs=require('fs');var fs_extra=require(_0x1dc9('0x9'));var _=require('lodash');var squel=require(_0x1dc9('0xa'));var crypto=require(_0x1dc9('0xb'));var jsforce=require(_0x1dc9('0xc'));var deskjs=require(_0x1dc9('0xd'));var toCsv=require(_0x1dc9('0x7'));var querystring=require(_0x1dc9('0xe'));var Papa=require(_0x1dc9('0xf'));var Redis=require(_0x1dc9('0x10'));var authService=require(_0x1dc9('0x11'));var qs=require(_0x1dc9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1dc9('0x13'));var logger=require('../../config/logger')(_0x1dc9('0x14'));var utils=require('../../config/utils');var config=require(_0x1dc9('0x15'));var licenseUtil=require(_0x1dc9('0x16'));var db=require(_0x1dc9('0x17'))['db'];function respondWithStatusCode(_0x123684,_0x5ce07c){_0x5ce07c=_0x5ce07c||0xcc;return function(_0x220c79){if(_0x220c79){return _0x123684[_0x1dc9('0x18')](_0x5ce07c);}return _0x123684['status'](_0x5ce07c)[_0x1dc9('0x19')]();};}function respondWithResult(_0x39919e,_0x4fb23f){_0x4fb23f=_0x4fb23f||0xc8;return function(_0x5daaec){if(_0x5daaec){return _0x39919e[_0x1dc9('0x1a')](_0x4fb23f)[_0x1dc9('0x1b')](_0x5daaec);}};}function respondWithFilteredResult(_0x38ee59,_0x2c94b1){return function(_0x4b7e11){if(_0x4b7e11){var _0x4e8c52=typeof _0x2c94b1[_0x1dc9('0x1c')]===_0x1dc9('0x1d')&&typeof _0x2c94b1['limit']===_0x1dc9('0x1d');var _0x46aaa6=_0x4b7e11[_0x1dc9('0x1e')];var _0x197bcd=_0x4e8c52?0x0:_0x2c94b1[_0x1dc9('0x1c')];var _0x1e845a=_0x4e8c52?_0x4b7e11[_0x1dc9('0x1e')]:_0x2c94b1[_0x1dc9('0x1c')]+_0x2c94b1[_0x1dc9('0x1f')];var _0x3bcb6f;if(_0x1e845a>=_0x46aaa6){_0x1e845a=_0x46aaa6;_0x3bcb6f=0xc8;}else{_0x3bcb6f=0xce;}_0x38ee59[_0x1dc9('0x1a')](_0x3bcb6f);return _0x38ee59[_0x1dc9('0x20')](_0x1dc9('0x21'),_0x197bcd+'-'+_0x1e845a+'/'+_0x46aaa6)['json'](_0x4b7e11);}return null;};}function patchUpdates(_0x49bd5b){return function(_0x37784e){try{jsonpatch['apply'](_0x37784e,_0x49bd5b,!![]);}catch(_0x4c25db){return BPromise['reject'](_0x4c25db);}return _0x37784e[_0x1dc9('0x22')]();};}function saveUpdates(_0x3bfb75,_0x277499){return function(_0x1b6829){if(_0x1b6829){return _0x1b6829[_0x1dc9('0x23')](_0x3bfb75)[_0x1dc9('0x24')](function(_0x2b1ff8){return _0x2b1ff8;});}return null;};}function removeEntity(_0x48dd9c,_0x240365){return function(_0x2a4740){if(_0x2a4740){return _0x2a4740[_0x1dc9('0x25')]()['then'](function(){_0x48dd9c[_0x1dc9('0x1a')](0xcc)[_0x1dc9('0x19')]();});}};}function handleEntityNotFound(_0xec8330,_0x2192bd){return function(_0x2dfe03){if(!_0x2dfe03){_0xec8330[_0x1dc9('0x18')](0x194);}return _0x2dfe03;};}function handleError(_0x179498,_0x152b48){_0x152b48=_0x152b48||0x1f4;return function(_0x3e70c3){logger['error'](_0x3e70c3['stack']);if(_0x3e70c3[_0x1dc9('0x26')]){delete _0x3e70c3[_0x1dc9('0x26')];}_0x179498[_0x1dc9('0x1a')](_0x152b48)[_0x1dc9('0x27')](_0x3e70c3);};}exports[_0x1dc9('0x28')]=function(_0x214805,_0x10123d){var _0x154370={},_0x16b71d={},_0x5f1403={'count':0x0,'rows':[]};var _0x37af63=_[_0x1dc9('0x29')](db[_0x1dc9('0x2a')][_0x1dc9('0x2b')],function(_0x8c3a01){return{'name':_0x8c3a01[_0x1dc9('0x2c')],'type':_0x8c3a01['type']['key']};});_0x16b71d[_0x1dc9('0x2d')]=_[_0x1dc9('0x29')](_0x37af63,'name');_0x16b71d[_0x1dc9('0x2e')]=_[_0x1dc9('0x2f')](_0x214805[_0x1dc9('0x2e')]);_0x16b71d['filters']=_[_0x1dc9('0x30')](_0x16b71d['model'],_0x16b71d[_0x1dc9('0x2e')]);_0x154370['attributes']=_['intersection'](_0x16b71d[_0x1dc9('0x2d')],qs[_0x1dc9('0x31')](_0x214805[_0x1dc9('0x2e')][_0x1dc9('0x31')]));_0x154370['attributes']=_0x154370[_0x1dc9('0x32')]['length']?_0x154370[_0x1dc9('0x32')]:_0x16b71d[_0x1dc9('0x2d')];if(!_0x214805[_0x1dc9('0x2e')][_0x1dc9('0x33')](_0x1dc9('0x34'))){_0x154370[_0x1dc9('0x1f')]=qs[_0x1dc9('0x1f')](_0x214805[_0x1dc9('0x2e')]['limit']);_0x154370['offset']=qs[_0x1dc9('0x1c')](_0x214805[_0x1dc9('0x2e')][_0x1dc9('0x1c')]);}_0x154370[_0x1dc9('0x35')]=qs['sort'](_0x214805[_0x1dc9('0x2e')]['sort']);_0x154370[_0x1dc9('0x36')]=qs[_0x1dc9('0x37')](_[_0x1dc9('0x38')](_0x214805[_0x1dc9('0x2e')],_0x16b71d[_0x1dc9('0x37')]),_0x37af63);if(_0x214805[_0x1dc9('0x2e')]['filter']){_0x154370[_0x1dc9('0x36')]=_[_0x1dc9('0x39')](_0x154370[_0x1dc9('0x36')],{'$or':_[_0x1dc9('0x29')](_0x37af63,function(_0x1b61c7){if(_0x1b61c7[_0x1dc9('0x3a')]!=='VIRTUAL'){var _0xff1a45={};_0xff1a45[_0x1b61c7[_0x1dc9('0x26')]]={'$like':'%'+_0x214805[_0x1dc9('0x2e')][_0x1dc9('0x3b')]+'%'};return _0xff1a45;}})});}_0x154370=_['merge']({},_0x154370,_0x214805[_0x1dc9('0x3c')]);var _0x2a294b={'where':_0x154370[_0x1dc9('0x36')]};return db[_0x1dc9('0x2a')][_0x1dc9('0x1e')](_0x2a294b)[_0x1dc9('0x24')](function(_0x209dda){_0x5f1403[_0x1dc9('0x1e')]=_0x209dda;if(_0x214805[_0x1dc9('0x2e')][_0x1dc9('0x3d')]){_0x154370[_0x1dc9('0x3e')]=[{'all':!![]}];}return db[_0x1dc9('0x2a')][_0x1dc9('0x3f')](_0x154370);})[_0x1dc9('0x24')](function(_0x443131){_0x5f1403[_0x1dc9('0x40')]=_0x443131;return _0x5f1403;})[_0x1dc9('0x24')](respondWithFilteredResult(_0x10123d,_0x154370))[_0x1dc9('0x41')](handleError(_0x10123d,null));};exports[_0x1dc9('0x42')]=function(_0x51e286,_0x140ad2){var _0x1fe3b8={'raw':!![],'where':{'id':_0x51e286[_0x1dc9('0x43')]['id']}},_0x3a3033={};_0x3a3033['model']=_[_0x1dc9('0x2f')](db[_0x1dc9('0x2a')][_0x1dc9('0x2b')]);_0x3a3033[_0x1dc9('0x2e')]=_[_0x1dc9('0x2f')](_0x51e286[_0x1dc9('0x2e')]);_0x3a3033[_0x1dc9('0x37')]=_[_0x1dc9('0x30')](_0x3a3033['model'],_0x3a3033['query']);_0x1fe3b8[_0x1dc9('0x32')]=_['intersection'](_0x3a3033[_0x1dc9('0x2d')],qs[_0x1dc9('0x31')](_0x51e286['query'][_0x1dc9('0x31')]));_0x1fe3b8[_0x1dc9('0x32')]=_0x1fe3b8[_0x1dc9('0x32')]['length']?_0x1fe3b8[_0x1dc9('0x32')]:_0x3a3033[_0x1dc9('0x2d')];if(_0x51e286[_0x1dc9('0x2e')][_0x1dc9('0x3d')]){_0x1fe3b8[_0x1dc9('0x3e')]=[{'all':!![]}];}_0x1fe3b8=_[_0x1dc9('0x39')]({},_0x1fe3b8,_0x51e286[_0x1dc9('0x3c')]);return db[_0x1dc9('0x2a')][_0x1dc9('0x44')](_0x1fe3b8)[_0x1dc9('0x24')](handleEntityNotFound(_0x140ad2,null))['then'](respondWithResult(_0x140ad2,null))[_0x1dc9('0x41')](handleError(_0x140ad2,null));};exports[_0x1dc9('0x45')]=function(_0x27ac48,_0x58989d){return db[_0x1dc9('0x2a')][_0x1dc9('0x45')](_0x27ac48[_0x1dc9('0x46')],{})[_0x1dc9('0x24')](respondWithResult(_0x58989d,0xc9))[_0x1dc9('0x41')](handleError(_0x58989d,null));};exports[_0x1dc9('0x23')]=function(_0x170253,_0x49416f){if(_0x170253[_0x1dc9('0x46')]['id']){delete _0x170253[_0x1dc9('0x46')]['id'];}return db[_0x1dc9('0x2a')]['find']({'where':{'id':_0x170253[_0x1dc9('0x43')]['id']}})['then'](handleEntityNotFound(_0x49416f,null))[_0x1dc9('0x24')](saveUpdates(_0x170253['body'],null))['then'](respondWithResult(_0x49416f,null))[_0x1dc9('0x41')](handleError(_0x49416f,null));};exports[_0x1dc9('0x25')]=function(_0x295fea,_0x9d1456){return db[_0x1dc9('0x2a')]['find']({'where':{'id':_0x295fea[_0x1dc9('0x43')]['id']}})[_0x1dc9('0x24')](handleEntityNotFound(_0x9d1456,null))[_0x1dc9('0x24')](removeEntity(_0x9d1456,null))[_0x1dc9('0x41')](handleError(_0x9d1456,null));};
\ No newline at end of file
index 47a8073..c92a934 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb2ff=['utf8mb4_unicode_ci','lodash','util','api','path','../../config/environment','./whatsappApplication.attributes','exports','WhatsappApplication','utf8mb4'];(function(_0x26bcec,_0xe13f50){var _0x1049dc=function(_0x4c0d9b){while(--_0x4c0d9b){_0x26bcec['push'](_0x26bcec['shift']());}};_0x1049dc(++_0xe13f50);}(_0xb2ff,0x123));var _0xfb2f=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xb2ff[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xfb2f('0x0'));var util=require(_0xfb2f('0x1'));var logger=require('../../config/logger')(_0xfb2f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfb2f('0x3'));var rimraf=require('rimraf');var config=require(_0xfb2f('0x4'));var attributes=require(_0xfb2f('0x5'));module[_0xfb2f('0x6')]=function(_0x1d3416,_0x542ce7){return _0x1d3416['define'](_0xfb2f('0x7'),attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfb2f('0x8'),'collate':_0xfb2f('0x9')});};
\ No newline at end of file
+var _0x89fe=['exports','define','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./whatsappApplication.attributes'];(function(_0x295d9e,_0x12d305){var _0x55ccc7=function(_0x246018){while(--_0x246018){_0x295d9e['push'](_0x295d9e['shift']());}};_0x55ccc7(++_0x12d305);}(_0x89fe,0x83));var _0xe89f=function(_0x1a93b1,_0x52cf9c){_0x1a93b1=_0x1a93b1-0x0;var _0x3902eb=_0x89fe[_0x1a93b1];return _0x3902eb;};'use strict';var _=require(_0xe89f('0x0'));var util=require(_0xe89f('0x1'));var logger=require(_0xe89f('0x2'))(_0xe89f('0x3'));var moment=require('moment');var BPromise=require(_0xe89f('0x4'));var rp=require(_0xe89f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe89f('0x6'));var config=require(_0xe89f('0x7'));var attributes=require(_0xe89f('0x8'));module[_0xe89f('0x9')]=function(_0x2e61cf,_0x2d5020){return _0x2e61cf[_0xe89f('0xa')]('WhatsappApplication',attributes,{'tableName':_0xe89f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe89f('0xc'),'collate':_0xe89f('0xd')});};
\ No newline at end of file
index 3e50ad7..0fbad3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0bb=['debug','stringify','error','code','WhatsappApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','request\x20sent'];(function(_0xb3366a,_0x1376d6){var _0x220504=function(_0x5998cc){while(--_0x5998cc){_0xb3366a['push'](_0xb3366a['shift']());}};_0x220504(++_0x1376d6);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x5266e7,_0x97b16b){_0x5266e7=_0x5266e7-0x0;var _0x5470f1=_0xd0bb[_0x5266e7];return _0x5470f1;};'use strict';var _=require(_0xbd0b('0x0'));var util=require(_0xbd0b('0x1'));var moment=require(_0xbd0b('0x2'));var BPromise=require('bluebird');var rs=require(_0xbd0b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbd0b('0x4'))['db'];var utils=require(_0xbd0b('0x5'));var logger=require('../../config/logger')(_0xbd0b('0x6'));var config=require('../../config/environment');var jayson=require(_0xbd0b('0x7'));var client=jayson[_0xbd0b('0x8')][_0xbd0b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x37c205,_0x809599,_0x5eb975){return new BPromise(function(_0x2a4075,_0x4533ff){return client[_0xbd0b('0xa')](_0x37c205,_0x5eb975)[_0xbd0b('0xb')](function(_0x16e185){logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x809599,_0xbd0b('0xc'));logger[_0xbd0b('0xd')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x809599,_0xbd0b('0xc'),JSON[_0xbd0b('0xe')](_0x16e185));if(_0x16e185['error']){if(_0x16e185[_0xbd0b('0xf')][_0xbd0b('0x10')]===0x1f4){logger[_0xbd0b('0xf')](_0xbd0b('0x11'),_0x809599,_0x16e185[_0xbd0b('0xf')][_0xbd0b('0x12')]);return _0x4533ff(_0x16e185[_0xbd0b('0xf')][_0xbd0b('0x12')]);}logger[_0xbd0b('0xf')](_0xbd0b('0x11'),_0x809599,_0x16e185[_0xbd0b('0xf')]['message']);return _0x2a4075(_0x16e185[_0xbd0b('0xf')]['message']);}else{logger['info'](_0xbd0b('0x11'),_0x809599,_0xbd0b('0xc'));_0x2a4075(_0x16e185[_0xbd0b('0x13')][_0xbd0b('0x12')]);}})[_0xbd0b('0x14')](function(_0x546db3){logger['error'](_0xbd0b('0x11'),_0x809599,_0x546db3);_0x4533ff(_0x546db3);});});}
\ No newline at end of file
+var _0x0a9a=['WhatsappApplication,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0xa1de8d,_0x1399a8){var _0x478b44=function(_0x3c8db7){while(--_0x3c8db7){_0xa1de8d['push'](_0xa1de8d['shift']());}};_0x478b44(++_0x1399a8);}(_0x0a9a,0x183));var _0xa0a9=function(_0x8a01d7,_0xdd09c3){_0x8a01d7=_0x8a01d7-0x0;var _0x478ad1=_0x0a9a[_0x8a01d7];return _0x478ad1;};'use strict';var _=require('lodash');var util=require(_0xa0a9('0x0'));var moment=require('moment');var BPromise=require(_0xa0a9('0x1'));var rs=require(_0xa0a9('0x2'));var fs=require('fs');var Redis=require(_0xa0a9('0x3'));var db=require(_0xa0a9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa0a9('0x5'))(_0xa0a9('0x6'));var config=require('../../config/environment');var jayson=require(_0xa0a9('0x7'));var client=jayson[_0xa0a9('0x8')][_0xa0a9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31d689,_0x499a29,_0x2b2eb4){return new BPromise(function(_0x520f42,_0x10aa8a){return client[_0xa0a9('0xa')](_0x31d689,_0x2b2eb4)[_0xa0a9('0xb')](function(_0x2d6ac0){logger['info'](_0xa0a9('0xc'),_0x499a29,_0xa0a9('0xd'));logger['debug']('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x499a29,_0xa0a9('0xd'),JSON[_0xa0a9('0xe')](_0x2d6ac0));if(_0x2d6ac0['error']){if(_0x2d6ac0[_0xa0a9('0xf')]['code']===0x1f4){logger[_0xa0a9('0xf')]('WhatsappApplication,\x20%s,\x20%s',_0x499a29,_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);return _0x10aa8a(_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);}logger[_0xa0a9('0xf')]('WhatsappApplication,\x20%s,\x20%s',_0x499a29,_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);return _0x520f42(_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);}else{logger[_0xa0a9('0x11')](_0xa0a9('0xc'),_0x499a29,'request\x20sent');_0x520f42(_0x2d6ac0[_0xa0a9('0x12')]['message']);}})['catch'](function(_0x347092){logger[_0xa0a9('0xf')](_0xa0a9('0xc'),_0x499a29,_0x347092);_0x10aa8a(_0x347092);});});}
\ No newline at end of file
index ed6455a..740ac7b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31c2=['/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage'];(function(_0xa5fc76,_0x16dc68){var _0x306259=function(_0x41e794){while(--_0x41e794){_0xa5fc76['push'](_0xa5fc76['shift']());}};_0x306259(++_0x16dc68);}(_0x31c2,0x1e1));var _0x231c=function(_0x5d9396,_0x15b2a7){_0x5d9396=_0x5d9396-0x0;var _0x7a75e2=_0x31c2[_0x5d9396];return _0x7a75e2;};'use strict';var multer=require(_0x231c('0x0'));var util=require(_0x231c('0x1'));var path=require(_0x231c('0x2'));var timeout=require(_0x231c('0x3'));var express=require(_0x231c('0x4'));var router=express[_0x231c('0x5')]();var fs_extra=require(_0x231c('0x6'));var auth=require(_0x231c('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x231c('0x8'));router[_0x231c('0x9')]('/',auth[_0x231c('0xa')](),controller[_0x231c('0xb')]);router['get'](_0x231c('0xc'),auth['isAuthenticated'](),controller[_0x231c('0xd')]);router[_0x231c('0x9')](_0x231c('0xe'),auth['isAuthenticated'](),controller[_0x231c('0xf')]);router[_0x231c('0x9')](_0x231c('0x10'),auth[_0x231c('0xa')](),controller[_0x231c('0x11')]);router[_0x231c('0x9')](_0x231c('0x12'),auth['isAuthenticated'](),controller[_0x231c('0x13')]);router[_0x231c('0x14')]('/',auth['isAuthenticated'](),controller[_0x231c('0x15')]);router[_0x231c('0x14')](_0x231c('0x10'),auth[_0x231c('0xa')](),controller[_0x231c('0x16')]);router[_0x231c('0x14')](_0x231c('0x17'),auth[_0x231c('0xa')](),interaction[_0x231c('0x18')](_0x231c('0x19'),_0x231c('0x1a')),controller[_0x231c('0x1b')]);router[_0x231c('0x1c')](_0x231c('0xe'),auth[_0x231c('0xa')](),interaction[_0x231c('0x18')](_0x231c('0x19'),_0x231c('0x1d')),controller[_0x231c('0x1e')]);router[_0x231c('0x1f')]('/:id',auth[_0x231c('0xa')](),interaction[_0x231c('0x18')](_0x231c('0x19'),_0x231c('0x20')),controller[_0x231c('0x21')]);router[_0x231c('0x1f')](_0x231c('0x17'),auth[_0x231c('0xa')](),controller[_0x231c('0x22')]);module[_0x231c('0x23')]=router;
\ No newline at end of file
+var _0x3c94=['create','addMessage','/:id/tags','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','update','delete','tracked','whatsappinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post'];(function(_0x319c42,_0x217031){var _0x58773f=function(_0x537098){while(--_0x537098){_0x319c42['push'](_0x319c42['shift']());}};_0x58773f(++_0x217031);}(_0x3c94,0xcd));var _0x43c9=function(_0x170994,_0x5adc66){_0x170994=_0x170994-0x0;var _0x3c89a3=_0x3c94[_0x170994];return _0x3c89a3;};'use strict';var multer=require(_0x43c9('0x0'));var util=require(_0x43c9('0x1'));var path=require(_0x43c9('0x2'));var timeout=require(_0x43c9('0x3'));var express=require(_0x43c9('0x4'));var router=express[_0x43c9('0x5')]();var fs_extra=require(_0x43c9('0x6'));var auth=require(_0x43c9('0x7'));var interaction=require(_0x43c9('0x8'));var config=require(_0x43c9('0x9'));var controller=require(_0x43c9('0xa'));router[_0x43c9('0xb')]('/',auth['isAuthenticated'](),controller[_0x43c9('0xc')]);router[_0x43c9('0xb')](_0x43c9('0xd'),auth[_0x43c9('0xe')](),controller[_0x43c9('0xf')]);router[_0x43c9('0xb')](_0x43c9('0x10'),auth[_0x43c9('0xe')](),controller[_0x43c9('0x11')]);router['get'](_0x43c9('0x12'),auth[_0x43c9('0xe')](),controller[_0x43c9('0x13')]);router[_0x43c9('0xb')](_0x43c9('0x14'),auth[_0x43c9('0xe')](),controller[_0x43c9('0x15')]);router[_0x43c9('0x16')]('/',auth[_0x43c9('0xe')](),controller[_0x43c9('0x17')]);router[_0x43c9('0x16')](_0x43c9('0x12'),auth[_0x43c9('0xe')](),controller[_0x43c9('0x18')]);router[_0x43c9('0x16')](_0x43c9('0x19'),auth[_0x43c9('0xe')](),interaction['tracked'](_0x43c9('0x1a'),_0x43c9('0x1b')),controller[_0x43c9('0x1c')]);router[_0x43c9('0x1d')](_0x43c9('0x10'),auth['isAuthenticated'](),interaction['tracked'](_0x43c9('0x1a'),_0x43c9('0x1e')),controller[_0x43c9('0x1f')]);router[_0x43c9('0x20')]('/:id',auth[_0x43c9('0xe')](),interaction[_0x43c9('0x21')](_0x43c9('0x1a'),_0x43c9('0x22')),controller[_0x43c9('0x23')]);router[_0x43c9('0x20')](_0x43c9('0x19'),auth[_0x43c9('0xe')](),controller[_0x43c9('0x24')]);module[_0x43c9('0x25')]=router;
\ No newline at end of file
index b52b036..94fe2e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a52=['BOOLEAN','sequelize','DATE','STRING','ENUM','out'];(function(_0x3a3f78,_0x2c7f20){var _0x2e1074=function(_0x115b33){while(--_0x115b33){_0x3a3f78['push'](_0x3a3f78['shift']());}};_0x2e1074(++_0x2c7f20);}(_0x5a52,0x18d));var _0x25a5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5a52[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x25a5('0x0'));var moment=require('moment');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x25a5('0x1')]},'disposition':{'type':Sequelize[_0x25a5('0x2')]},'secondDisposition':{'type':Sequelize[_0x25a5('0x2')]},'thirdDisposition':{'type':Sequelize[_0x25a5('0x2')]},'note':{'type':Sequelize[_0x25a5('0x2')]},'phone':{'type':Sequelize[_0x25a5('0x2')]},'read1stAt':{'type':Sequelize[_0x25a5('0x1')]},'firstMsgDirection':{'type':Sequelize[_0x25a5('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x25a5('0x1')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x25a5('0x4')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x25a5('0x5')],'defaultValue':![]}};
\ No newline at end of file
+var _0x212b=['exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x305cc5,_0x317607){var _0x3ef26f=function(_0x309528){while(--_0x309528){_0x305cc5['push'](_0x305cc5['shift']());}};_0x3ef26f(++_0x317607);}(_0x212b,0x148));var _0xb212=function(_0x33a706,_0x2fa13d){_0x33a706=_0x33a706-0x0;var _0x3c4979=_0x212b[_0x33a706];return _0x3c4979;};'use strict';var Sequelize=require(_0xb212('0x0'));var moment=require('moment');module[_0xb212('0x1')]={'closed':{'type':Sequelize[_0xb212('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb212('0x3')]},'disposition':{'type':Sequelize[_0xb212('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xb212('0x4')]},'note':{'type':Sequelize[_0xb212('0x4')]},'phone':{'type':Sequelize[_0xb212('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xb212('0x5')]('in',_0xb212('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb212('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xb212('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xb212('0x2')],'defaultValue':![]}};
\ No newline at end of file
index f8f824a..6c03092 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbc6=['Contact.email','c.phone','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','groupBy','WhatsappInteractionId','all','rows','catch','show','params','includeAll','include','options','create','body','describe','addMessage','ids','omit','getMessages','findOne','WhatsappMessage','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','findAll','color','emit','whatsappInteractionTags:save','removeTags','download','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','fullname','CmContact','firstName','lastName','Attachment','Messages','secret','WhatsappAccount','Owner','get','mkdirSync','Whatsapp','Account','N.A.','closedAt','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','direction','System','out','renderFile','downloadInteraction.ejs','err','unlinkSync','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','Users','map','TagIds','Tags','split','forEach','push','waiting','answered','closed','UserId','talking','unmanaged','total','WhatsappInteraction','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','select','field','from','tools_tags','u.id','user_has_whatsapp_interactions','left_join','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','whatsapp_accounts','whatsapp_messages','whatsapp_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','length','value','`\x20=\x200','`\x20>\x200','Contact','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','operator','text','keys','some','WhatsappAccountId','where','i.WhatsappAccountId\x20IN\x20?','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','role','agent','getWhatsappAccounts','isEmpty','i.WhatsappAccountId\x20IS\x20NULL','user','sequelize','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','c.lastName','Contact.lastName'];(function(_0x4bb09b,_0x2dfe80){var _0x3c735a=function(_0xe5aa6c){while(--_0xe5aa6c){_0x4bb09b['push'](_0x4bb09b['shift']());}};_0x3c735a(++_0x2dfe80);}(_0xdbc6,0x13b));var _0x6dbc=function(_0x1c3e18,_0x54f188){_0x1c3e18=_0x1c3e18-0x0;var _0xba64f=_0xdbc6[_0x1c3e18];return _0xba64f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6dbc('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6dbc('0x1'));var moment=require(_0x6dbc('0x2'));var BPromise=require(_0x6dbc('0x3'));var Mustache=require(_0x6dbc('0x4'));var util=require(_0x6dbc('0x5'));var path=require(_0x6dbc('0x6'));var sox=require('sox');var csv=require(_0x6dbc('0x7'));var ejs=require(_0x6dbc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6dbc('0x9'));var squel=require(_0x6dbc('0xa'));var crypto=require(_0x6dbc('0xb'));var jsforce=require(_0x6dbc('0xc'));var deskjs=require(_0x6dbc('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6dbc('0xe'));var Papa=require(_0x6dbc('0xf'));var Redis=require('ioredis');var authService=require(_0x6dbc('0x10'));var qs=require(_0x6dbc('0x11'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x6dbc('0x12'));var hardwareService=require(_0x6dbc('0x13'));var logger=require(_0x6dbc('0x14'))(_0x6dbc('0x15'));var utils=require(_0x6dbc('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6dbc('0x17'))['db'];config[_0x6dbc('0x18')]=_[_0x6dbc('0x19')](config[_0x6dbc('0x18')],{'host':_0x6dbc('0x1a'),'port':0x18eb});var socket=require(_0x6dbc('0x1b'))(new Redis(config[_0x6dbc('0x18')]));require(_0x6dbc('0x1c'))[_0x6dbc('0x1d')](socket);function respondWithStatusCode(_0x5397af,_0x31d4ee){_0x31d4ee=_0x31d4ee||0xcc;return function(_0x3fc449){if(_0x3fc449){return _0x5397af[_0x6dbc('0x1e')](_0x31d4ee);}return _0x5397af[_0x6dbc('0x1f')](_0x31d4ee)[_0x6dbc('0x20')]();};}function respondWithResult(_0x269fac,_0x3da417){_0x3da417=_0x3da417||0xc8;return function(_0x1ee71a){if(_0x1ee71a){return _0x269fac['status'](_0x3da417)['json'](_0x1ee71a);}};}function respondWithFilteredResult(_0x5ac04a,_0x285ccd){return function(_0x18d95d){if(_0x18d95d){var _0x1f185b=typeof _0x285ccd[_0x6dbc('0x21')]===_0x6dbc('0x22')&&typeof _0x285ccd['limit']===_0x6dbc('0x22');var _0x12311d=_0x18d95d[_0x6dbc('0x23')];var _0x294803=_0x1f185b?0x0:_0x285ccd[_0x6dbc('0x21')];var _0x2cd2f1=_0x1f185b?_0x18d95d[_0x6dbc('0x23')]:_0x285ccd[_0x6dbc('0x21')]+_0x285ccd[_0x6dbc('0x24')];var _0x1af4ff;if(_0x2cd2f1>=_0x12311d){_0x2cd2f1=_0x12311d;_0x1af4ff=0xc8;}else{_0x1af4ff=0xce;}_0x5ac04a[_0x6dbc('0x1f')](_0x1af4ff);return _0x5ac04a['set'](_0x6dbc('0x25'),_0x294803+'-'+_0x2cd2f1+'/'+_0x12311d)[_0x6dbc('0x26')](_0x18d95d);}return null;};}function patchUpdates(_0x3306d0){return function(_0x52b772){try{jsonpatch[_0x6dbc('0x27')](_0x52b772,_0x3306d0,!![]);}catch(_0x47d55b){return BPromise[_0x6dbc('0x28')](_0x47d55b);}return _0x52b772[_0x6dbc('0x29')]();};}function saveUpdates(_0x15ac30,_0x5390b9){return function(_0x20a998){if(_0x20a998){return _0x20a998[_0x6dbc('0x2a')](_0x15ac30)[_0x6dbc('0x2b')](function(_0x8cc556){return _0x8cc556;});}return null;};}function removeEntity(_0xd6dd78,_0x3c7fdb){return function(_0x43fab4){if(_0x43fab4){return _0x43fab4[_0x6dbc('0x2c')]()['then'](function(){_0xd6dd78[_0x6dbc('0x1f')](0xcc)[_0x6dbc('0x20')]();});}};}function handleEntityNotFound(_0x455f29,_0x8a24fd){return function(_0x19e43e){if(!_0x19e43e){_0x455f29[_0x6dbc('0x1e')](0x194);}return _0x19e43e;};}function handleError(_0x1336d4,_0x235e00){_0x235e00=_0x235e00||0x1f4;return function(_0xe77d87){logger['error'](_0xe77d87[_0x6dbc('0x2d')]);if(_0xe77d87[_0x6dbc('0x2e')]){delete _0xe77d87[_0x6dbc('0x2e')];}_0x1336d4[_0x6dbc('0x1f')](_0x235e00)[_0x6dbc('0x2f')](_0xe77d87);};}function getInteractionUsers(_0x491a19,_0x3e2788){return new BPromise(function(_0x30cefd,_0x2e2be2){try{if(_0x3e2788[_0x491a19['id']]){_0x491a19[_0x6dbc('0x30')]=_[_0x6dbc('0x31')](_0x3e2788[_0x491a19['id']],function(_0x791561){return{'id':_0x791561['id'],'fullname':_0x791561['fullname']};});}}catch(_0x1599b3){_0x2e2be2(_0x1599b3);}_0x30cefd(_0x491a19);});}function getInteractionTags(_0x1367b2,_0xa51e45){return new BPromise(function(_0x423626,_0xda388a){try{if(_0x1367b2[_0x6dbc('0x32')]){_0x1367b2[_0x6dbc('0x33')]=[];_0x1367b2[_0x6dbc('0x32')][_0x6dbc('0x34')](',')[_0x6dbc('0x35')](function(_0xfe49e7){_0x1367b2[_0x6dbc('0x33')][_0x6dbc('0x36')](_0xa51e45[_0xfe49e7]);});}delete _0x1367b2[_0x6dbc('0x32')];}catch(_0x2c3928){_0xda388a(_0x2c3928);}_0x423626(_0x1367b2);});}function updateWhatsappInteraction(_0x34a8c4,_0x3b951c,_0x41726f){return new BPromise(function(_0x22d1e7,_0x174b17){return getInteractionUsers(_0x34a8c4,_0x41726f)[_0x6dbc('0x2b')](function(_0x468b8d){return getInteractionTags(_0x468b8d,_0x3b951c);})[_0x6dbc('0x2b')](function(_0x216bae){return getStateInteraction(_0x216bae);})[_0x6dbc('0x2b')](function(_0x1bb22b){_0x22d1e7(_0x1bb22b);})['catch'](function(_0x5589cc){_0x174b17(_0x5589cc);});});}function getStateInteraction(_0x32ae2e){return new BPromise(function(_0x3230c6){_0x32ae2e[_0x6dbc('0x37')]=0x0;_0x32ae2e['talking']=0x0;_0x32ae2e[_0x6dbc('0x38')]=0x0;_0x32ae2e['unmanaged']=0x0;_0x32ae2e['total']=0x0;if(!_0x32ae2e[_0x6dbc('0x39')]&&!_0x32ae2e[_0x6dbc('0x3a')]){_0x32ae2e['waiting']+=0x1;}if(!_0x32ae2e[_0x6dbc('0x39')]&&_0x32ae2e[_0x6dbc('0x3a')]){_0x32ae2e[_0x6dbc('0x3b')]+=0x1;if(_0x32ae2e[_0x6dbc('0x37')]){_0x32ae2e[_0x6dbc('0x37')]-=0x1;}}if(_0x32ae2e['closed']&&_0x32ae2e[_0x6dbc('0x3a')]){_0x32ae2e['answered']+=0x1;if(_0x32ae2e[_0x6dbc('0x3b')]){_0x32ae2e[_0x6dbc('0x3b')]-=0x1;}}if(_0x32ae2e['closed']&&!_0x32ae2e[_0x6dbc('0x3a')]){_0x32ae2e[_0x6dbc('0x3c')]+=0x1;if(_0x32ae2e[_0x6dbc('0x37')]){_0x32ae2e[_0x6dbc('0x37')]-=0x1;}}_0x32ae2e[_0x6dbc('0x3d')]+=0x1;_0x3230c6(_0x32ae2e);});}exports['index']=function(_0x894e9e,_0x59deb9){var _0x4fab2e={},_0x501d15={},_0x2ef63b={'count':0x0,'rows':[]};var _0x35f003=_[_0x6dbc('0x31')](db[_0x6dbc('0x3e')][_0x6dbc('0x3f')],function(_0x260f8d){return{'name':_0x260f8d[_0x6dbc('0x40')],'type':_0x260f8d[_0x6dbc('0x41')][_0x6dbc('0x42')]};});_0x501d15[_0x6dbc('0x43')]=_['map'](_0x35f003,_0x6dbc('0x2e'));_0x501d15[_0x6dbc('0x44')]=_['keys'](_0x894e9e[_0x6dbc('0x44')]);_0x501d15[_0x6dbc('0x45')]=_[_0x6dbc('0x46')](_0x501d15[_0x6dbc('0x43')],_0x501d15[_0x6dbc('0x44')]);_0x4fab2e['attributes']=_[_0x6dbc('0x46')](_0x501d15[_0x6dbc('0x43')],qs[_0x6dbc('0x47')](_0x894e9e[_0x6dbc('0x44')][_0x6dbc('0x47')]));_0x4fab2e[_0x6dbc('0x48')]=_0x4fab2e[_0x6dbc('0x48')]['length']?_0x4fab2e[_0x6dbc('0x48')]:_0x501d15['model'];if(!_0x894e9e[_0x6dbc('0x44')][_0x6dbc('0x49')](_0x6dbc('0x4a'))){_0x4fab2e[_0x6dbc('0x24')]=qs[_0x6dbc('0x24')](_0x894e9e[_0x6dbc('0x44')][_0x6dbc('0x24')]);_0x4fab2e[_0x6dbc('0x21')]=qs[_0x6dbc('0x21')](_0x894e9e['query'][_0x6dbc('0x21')]);}_0x4fab2e[_0x6dbc('0x4b')]=qs[_0x6dbc('0x4c')](_0x894e9e[_0x6dbc('0x44')]['sort']);_0x4fab2e['where']=qs[_0x6dbc('0x45')](_['pick'](_0x894e9e[_0x6dbc('0x44')],_0x501d15[_0x6dbc('0x45')]),_0x35f003);var _0x45b4d6=[];var _0xfda49d=squel[_0x6dbc('0x4d')]()['field']('id')[_0x6dbc('0x4e')](_0x6dbc('0x2e'))[_0x6dbc('0x4e')]('color')[_0x6dbc('0x4f')](_0x6dbc('0x50'));var _0x5c59df=squel[_0x6dbc('0x4d')]()[_0x6dbc('0x4e')](_0x6dbc('0x51'))['field']('u.fullname')['field']('ui.WhatsappInteractionId')[_0x6dbc('0x4f')](_0x6dbc('0x52'),'ui')[_0x6dbc('0x53')]('users','u',_0x6dbc('0x54'));var _0x3b6178=squel[_0x6dbc('0x4d')]()['from']('whatsapp_interactions','i')[_0x6dbc('0x53')](_0x6dbc('0x55'),'c',_0x6dbc('0x56'))[_0x6dbc('0x53')](_0x6dbc('0x57'),'o','o.id\x20=\x20i.UserId')[_0x6dbc('0x53')](_0x6dbc('0x58'),'a','a.id\x20=\x20i.WhatsappAccountId')[_0x6dbc('0x53')](_0x6dbc('0x59'),'me','me.WhatsappInteractionId\x20=\x20i.id')[_0x6dbc('0x53')](_0x6dbc('0x5a'),'it','it.WhatsappInteractionId\x20=\x20i.id')[_0x6dbc('0x53')](_0x6dbc('0x50'),'t',_0x6dbc('0x5b'));var _0x2907e5=squel[_0x6dbc('0x5c')]();var _0x5edbc5=[];var _0x1b17fb=squel['expr']();var _0x2c0beb;if(_0x894e9e[_0x6dbc('0x44')][_0x6dbc('0x5d')]){_0x2c0beb=as[_0x6dbc('0x5e')](_0x894e9e[_0x6dbc('0x44')][_0x6dbc('0x5d')]);var _0x673597=_0x2c0beb['sqlOperator'];for(var _0x28178d=0x0;_0x28178d<_0x2c0beb[_0x6dbc('0x5f')][_0x6dbc('0x60')];_0x28178d++){var _0x24d851=_0x2c0beb[_0x6dbc('0x5f')][_0x28178d];var _0x18ae42='i';var _0xb0b5a9=_['find'](_0x35f003,[_0x6dbc('0x2e'),_0x24d851[_0x6dbc('0x4e')]]);if(!_0xb0b5a9){switch(_0x24d851['field']){case'unreadMessages':if(_0x24d851[_0x6dbc('0x61')]==0x1){_0x3b6178['having']('`'+_0x24d851[_0x6dbc('0x4e')]+_0x6dbc('0x62'));}else{_0x3b6178['having']('`'+_0x24d851[_0x6dbc('0x4e')]+_0x6dbc('0x63'));}break;case _0x6dbc('0x64'):if(_0x24d851['operator']===_0x6dbc('0x65')){if(_0x24d851[_0x6dbc('0x61')][_0x6dbc('0x34')]('\x20')[_0x6dbc('0x60')]>0x1){_0x2907e5[_0x673597]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x6dbc('0x66')](_0x24d851['value']),null);}else{var _0x1af151='%'+_0x24d851[_0x6dbc('0x61')]+'%';_0x2907e5[_0x673597](_0x6dbc('0x67'),_0x1af151,_0x1af151,_0x1af151);}}else{_0xb0b5a9=_[_0x6dbc('0x68')](_0x35f003,[_0x6dbc('0x2e'),_0x6dbc('0x69')]);_0x24d851[_0x6dbc('0x4e')]=_0x6dbc('0x69');_0xdb4a31=as[_0x6dbc('0x6a')](_0x18ae42,_0xb0b5a9[_0x6dbc('0x41')],_0x24d851);_0x2907e5[_0x673597](_0xdb4a31['text'],_0xdb4a31[_0x6dbc('0x61')][_0x6dbc('0x6b')],_0xdb4a31[_0x6dbc('0x61')][_0x6dbc('0x20')]);}break;case _0x6dbc('0x6c'):var _0x1e5f6f=_0x24d851[_0x6dbc('0x61')][_0x6dbc('0x34')](',')[_0x6dbc('0x31')](function(_0x21d608){return Number(_0x21d608);});_0x1e5f6f[_0x6dbc('0x35')](function(_0x40a22c){_0x1b17fb['or'](_0x6dbc('0x6d'),'%,'+_0x40a22c+',%');});_0x5edbc5=_['union'](_0x5edbc5,_0x1e5f6f);break;case _0x6dbc('0x6e'):if(_0x24d851[_0x6dbc('0x6f')]===_0x6dbc('0x65')){_0x2907e5[_0x673597]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x24d851[_0x6dbc('0x61')]+'%',null);}else{_0xb0b5a9=_[_0x6dbc('0x68')](_0x35f003,[_0x6dbc('0x2e'),_0x6dbc('0x3a')]);_0x24d851[_0x6dbc('0x4e')]=_0x6dbc('0x3a');_0xdb4a31=as[_0x6dbc('0x6a')](_0x18ae42,_0xb0b5a9['type'],_0x24d851);_0x2907e5[_0x673597](_0xdb4a31['text'],_0xdb4a31[_0x6dbc('0x61')]['start'],_0xdb4a31['value'][_0x6dbc('0x20')]);}break;case'body':_0xdb4a31=as[_0x6dbc('0x6a')]('me',null,_0x24d851);_0x2907e5[_0x673597](_0xdb4a31[_0x6dbc('0x70')],_0xdb4a31[_0x6dbc('0x61')][_0x6dbc('0x6b')],_0xdb4a31[_0x6dbc('0x61')][_0x6dbc('0x20')]);break;}}else{var _0xdb4a31=as['buildExpression'](_0x18ae42,_0xb0b5a9[_0x6dbc('0x41')],_0x24d851);_0x2907e5[_0x673597](_0xdb4a31[_0x6dbc('0x70')],_0xdb4a31['value']['start'],_0xdb4a31[_0x6dbc('0x61')][_0x6dbc('0x20')]);}}}else{var _0x524370=_(_0x894e9e['query'])[_0x6dbc('0x71')]()[_0x6dbc('0x31')](function(_0x34a417){return _[_0x6dbc('0x72')](_0x35f003,[_0x6dbc('0x2e'),_0x34a417])?_0x34a417:undefined;})['compact']()[_0x6dbc('0x61')]();if(!_['isEmpty'](_0x524370)){_0x524370[_0x6dbc('0x35')](function(_0x4d097e){if(_0x4d097e===_0x6dbc('0x73')){_0x3b6178[_0x6dbc('0x74')](_0x6dbc('0x75'),[]['concat'](_0x894e9e[_0x6dbc('0x44')][_0x4d097e]));}else if(_0x4d097e===_0x6dbc('0x76')){var _0x5e2a91=JSON['parse'](_0x894e9e[_0x6dbc('0x44')][_0x4d097e])[_0x6dbc('0x77')];var _0x53b161=JSON[_0x6dbc('0x78')](_0x894e9e[_0x6dbc('0x44')][_0x4d097e])[_0x6dbc('0x79')];_0x3b6178[_0x6dbc('0x74')](_0x6dbc('0x7a'),_0x5e2a91,_0x53b161);}else{if(_0x894e9e[_0x6dbc('0x44')][_0x4d097e]===_0x6dbc('0x7b')){_0x3b6178[_0x6dbc('0x74')]('i.'+_0x4d097e+_0x6dbc('0x7c'));}else{_0x3b6178['where']('i.'+_0x4d097e+_0x6dbc('0x7d'),_0x894e9e[_0x6dbc('0x44')][_0x4d097e]);}}});}if(_0x894e9e[_0x6dbc('0x44')][_0x6dbc('0x7e')]){if(_0x894e9e[_0x6dbc('0x44')][_0x6dbc('0x7e')]==0x1){_0x3b6178[_0x6dbc('0x7f')](_0x6dbc('0x80'));}else{_0x3b6178[_0x6dbc('0x7f')](_0x6dbc('0x81'));}}if(_0x894e9e['query'][_0x6dbc('0x82')]){_0x5edbc5=_[_0x6dbc('0x83')](_0x894e9e[_0x6dbc('0x44')][_0x6dbc('0x82')])?_0x894e9e[_0x6dbc('0x44')][_0x6dbc('0x82')]:new Array(_0x894e9e[_0x6dbc('0x44')][_0x6dbc('0x82')]);_0x5edbc5[_0x6dbc('0x35')](function(_0x164443){_0x1b17fb['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x164443+',%');});}if(_0x894e9e[_0x6dbc('0x44')][_0x6dbc('0x84')]){var _0x3c55aa=_0x894e9e['query'][_0x6dbc('0x84')][_0x6dbc('0x85')]('\x5c','\x5c\x5c')[_0x6dbc('0x85')](/'/g,'\x27\x27');if(qs[_0x6dbc('0x86')](_0x3c55aa)){_0x2907e5['or'](_0x6dbc('0x87'),_0x3c55aa+'%')['or'](_0x6dbc('0x88'),_0x3c55aa+'%');}else{_0x2907e5['or'](_0x6dbc('0x89'),qs[_0x6dbc('0x66')](_0x3c55aa))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x3c55aa+'%');}}}_0x3b6178['where'](_0x2907e5);_0x3b6178['group'](_0x6dbc('0x8a'));var _0x385e22={'type':db['Sequelize'][_0x6dbc('0x8b')][_0x6dbc('0x8c')],'raw':!![]};var _0x371d85=_0x3b6178[_0x6dbc('0x8d')]();_0x371d85[_0x6dbc('0x4e')]('i.id');_0x371d85['field'](_0x6dbc('0x8e'),_0x6dbc('0x8f'));if(_0x4fab2e[_0x6dbc('0x4b')]){_0x4fab2e[_0x6dbc('0x4b')][_0x6dbc('0x35')](function(_0x4be16b){var _0x134e1f=_0x4be16b[0x0]===_0x6dbc('0x90')?_0x4be16b[0x0]:'i.'+_0x4be16b[0x0];_0x3b6178[_0x6dbc('0x4b')](_0x134e1f,_0x4be16b[0x1]===_0x6dbc('0x91')?![]:!![]);});}if(!_['isEmpty'](_0x5edbc5)){_0x3b6178[_0x6dbc('0x7f')](_0x1b17fb);_0x371d85[_0x6dbc('0x74')](_0x6dbc('0x92'),_0x5edbc5);}BPromise[_0x6dbc('0x93')]()['then'](function(){if(!_0x2c0beb){if(_0x894e9e[_0x6dbc('0x44')][_0x6dbc('0x73')])return;_0x371d85[_0x6dbc('0x74')](_0x6dbc('0x94'));_0x3b6178['where']('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x894e9e['user'][_0x6dbc('0x95')]!==_0x6dbc('0x96'))return;return _0x894e9e['user'][_0x6dbc('0x97')]({'attributes':['id'],'raw':!![]})['then'](function(_0x366054){if(_[_0x6dbc('0x98')](_0x366054)){_0x371d85[_0x6dbc('0x74')]('i.WhatsappAccountId\x20IS\x20NULL');_0x3b6178[_0x6dbc('0x74')](_0x6dbc('0x99'));}else{_0x371d85['where']('i.WhatsappAccountId\x20IN\x20?',_[_0x6dbc('0x31')](_0x366054,'id'));_0x3b6178[_0x6dbc('0x74')](_0x6dbc('0x75'),_[_0x6dbc('0x31')](_0x366054,'id'));}});})[_0x6dbc('0x2b')](function(){if(_0x894e9e[_0x6dbc('0x9a')][_0x6dbc('0x95')]===_0x6dbc('0x96')&&!_0x2c0beb&&!_0x894e9e[_0x6dbc('0x44')][_0x6dbc('0x73')])return[];return db[_0x6dbc('0x9b')][_0x6dbc('0x44')](_0x371d85['toString'](),_0x385e22);})[_0x6dbc('0x2b')](function(_0x3429bd){_0x2ef63b[_0x6dbc('0x23')]=_0x3429bd[_0x6dbc('0x60')];if(_0x2ef63b['count']===0x0)return[];return db[_0x6dbc('0x9b')]['query'](_0xfda49d['toString'](),_0x385e22)[_0x6dbc('0x2b')](function(_0x4b9520){_0x45b4d6=_['keyBy'](_0x4b9520,'id');_0x385e22=_[_0x6dbc('0x9c')](_0x385e22,{'model':db[_0x6dbc('0x3e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x894e9e[_0x6dbc('0x44')]['fields']){_0x4fab2e[_0x6dbc('0x48')][_0x6dbc('0x35')](function(_0x475f1b){_0x3b6178[_0x6dbc('0x4e')]('i.'+_0x475f1b);});}else{_0x3b6178[_0x6dbc('0x4e')](_0x6dbc('0x8e'),'unreadMessages');_0x3b6178['field'](_0x6dbc('0x9d'),_0x6dbc('0x9e'));_0x3b6178[_0x6dbc('0x4e')](_0x6dbc('0x9f'),_0x6dbc('0xa0'));_0x3b6178['field'](_0x6dbc('0xa1'),_0x6dbc('0x90'));_0x3b6178['field']('i.*');_0x3b6178[_0x6dbc('0x4e')](_0x6dbc('0xa2'),'Contact.firstName');_0x3b6178[_0x6dbc('0x4e')](_0x6dbc('0xa3'),_0x6dbc('0xa4'));_0x3b6178[_0x6dbc('0x4e')]('c.email',_0x6dbc('0xa5'));_0x3b6178[_0x6dbc('0x4e')](_0x6dbc('0xa6'),'Contact.phone');_0x3b6178[_0x6dbc('0x4e')]('c.mobile',_0x6dbc('0xa7'));_0x3b6178[_0x6dbc('0x4e')](_0x6dbc('0xa8'),'Contact.fax');_0x3b6178[_0x6dbc('0x4e')](_0x6dbc('0xa9'),_0x6dbc('0xaa'));_0x3b6178[_0x6dbc('0x4e')](_0x6dbc('0xab'),_0x6dbc('0xac'));_0x3b6178['field'](_0x6dbc('0xad'),_0x6dbc('0x32'));}if(_0x4fab2e[_0x6dbc('0x24')])_0x3b6178[_0x6dbc('0x24')](_0x4fab2e['limit']);if(_0x4fab2e['offset'])_0x3b6178[_0x6dbc('0x21')](_0x4fab2e['offset']);return db[_0x6dbc('0x9b')][_0x6dbc('0x44')](_0x3b6178[_0x6dbc('0xae')](),_0x385e22);})[_0x6dbc('0x2b')](function(_0x5b1ef9){if(_0x5b1ef9[_0x6dbc('0x60')]>0x0)_0x5c59df[_0x6dbc('0x74')]('ui.WhatsappInteractionId\x20IN\x20?',_['map'](_0x5b1ef9,'id'));return db[_0x6dbc('0x9b')][_0x6dbc('0x44')](_0x5c59df[_0x6dbc('0xae')](),_0x385e22)[_0x6dbc('0x2b')](function(_0x1d4476){var _0x19f92f=_[_0x6dbc('0xaf')](_0x1d4476,_0x6dbc('0xb0'));var _0x1f349a=[];_0x5b1ef9[_0x6dbc('0x35')](function(_0x2d0a35){_0x1f349a[_0x6dbc('0x36')](updateWhatsappInteraction(_0x2d0a35,_0x45b4d6,_0x19f92f));});return BPromise[_0x6dbc('0xb1')](_0x1f349a);});});})['then'](function(_0xb62f0f){_0x2ef63b[_0x6dbc('0xb2')]=_0xb62f0f;return _0x2ef63b;})[_0x6dbc('0x2b')](respondWithFilteredResult(_0x59deb9,_0x4fab2e))[_0x6dbc('0xb3')](handleError(_0x59deb9,null));};exports[_0x6dbc('0xb4')]=function(_0x25f3f8,_0x5c48f2){var _0x31dcdf={'raw':![],'where':{'id':_0x25f3f8[_0x6dbc('0xb5')]['id']}},_0x4c2d3f={};_0x4c2d3f[_0x6dbc('0x43')]=_[_0x6dbc('0x71')](db['WhatsappInteraction'][_0x6dbc('0x3f')]);_0x4c2d3f[_0x6dbc('0x44')]=_[_0x6dbc('0x71')](_0x25f3f8['query']);_0x4c2d3f[_0x6dbc('0x45')]=_[_0x6dbc('0x46')](_0x4c2d3f[_0x6dbc('0x43')],_0x4c2d3f['query']);_0x31dcdf[_0x6dbc('0x48')]=_['intersection'](_0x4c2d3f[_0x6dbc('0x43')],qs[_0x6dbc('0x47')](_0x25f3f8[_0x6dbc('0x44')][_0x6dbc('0x47')]));_0x31dcdf[_0x6dbc('0x48')]=_0x31dcdf[_0x6dbc('0x48')][_0x6dbc('0x60')]?_0x31dcdf[_0x6dbc('0x48')]:_0x4c2d3f['model'];if(_0x25f3f8['query'][_0x6dbc('0xb6')]){_0x31dcdf[_0x6dbc('0xb7')]=[{'all':!![]}];}_0x31dcdf=_[_0x6dbc('0x9c')]({},_0x31dcdf,_0x25f3f8[_0x6dbc('0xb8')]);return db[_0x6dbc('0x3e')][_0x6dbc('0x68')](_0x31dcdf)[_0x6dbc('0x2b')](handleEntityNotFound(_0x5c48f2,null))[_0x6dbc('0x2b')](respondWithResult(_0x5c48f2,null))[_0x6dbc('0xb3')](handleError(_0x5c48f2,null));};exports['create']=function(_0x3a9158,_0x1535a3){return db['WhatsappInteraction'][_0x6dbc('0xb9')](_0x3a9158[_0x6dbc('0xba')],{})['then'](respondWithResult(_0x1535a3,0xc9))['catch'](handleError(_0x1535a3,null));};exports[_0x6dbc('0x2a')]=function(_0x387fa0,_0x4d3b7f){if(_0x387fa0[_0x6dbc('0xba')]['id']){delete _0x387fa0[_0x6dbc('0xba')]['id'];}return db['WhatsappInteraction'][_0x6dbc('0x68')]({'where':{'id':_0x387fa0[_0x6dbc('0xb5')]['id']}})['then'](handleEntityNotFound(_0x4d3b7f,null))['then'](saveUpdates(_0x387fa0[_0x6dbc('0xba')],null))[_0x6dbc('0x2b')](respondWithResult(_0x4d3b7f,null))['catch'](handleError(_0x4d3b7f,null));};exports[_0x6dbc('0x2c')]=function(_0x13edaf,_0x5efa04){return db[_0x6dbc('0x3e')][_0x6dbc('0x68')]({'where':{'id':_0x13edaf[_0x6dbc('0xb5')]['id']}})[_0x6dbc('0x2b')](handleEntityNotFound(_0x5efa04,null))[_0x6dbc('0x2b')](removeEntity(_0x5efa04,null))[_0x6dbc('0xb3')](handleError(_0x5efa04,null));};exports['describe']=function(_0x159831,_0x198bff){return db[_0x6dbc('0x3e')][_0x6dbc('0xbb')]()['then'](respondWithResult(_0x198bff,null))[_0x6dbc('0xb3')](handleError(_0x198bff,null));};exports[_0x6dbc('0xbc')]=function(_0x501c1b,_0x33751f,_0x14953e){return db['WhatsappMessage'][_0x6dbc('0x68')]({'where':{'id':_0x501c1b[_0x6dbc('0xb5')]['id']}})[_0x6dbc('0x2b')](handleEntityNotFound(_0x33751f,null))[_0x6dbc('0x2b')](function(_0x1e0ec3){if(_0x1e0ec3){return _0x1e0ec3['addMessage'](_0x501c1b[_0x6dbc('0xba')][_0x6dbc('0xbd')],_[_0x6dbc('0xbe')](_0x501c1b[_0x6dbc('0xba')],[_0x6dbc('0xbd'),'id'])||{});}})[_0x6dbc('0x2b')](respondWithResult(_0x33751f,null))[_0x6dbc('0xb3')](handleError(_0x33751f,null));};exports[_0x6dbc('0xbf')]=function(_0x1989f9,_0x387073,_0x4c699b){var _0xa95b62={'raw':![],'where':{}};var _0xa5340d={};var _0x2d3e4c={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0x6dbc('0xc0')]({'where':{'id':_0x1989f9[_0x6dbc('0xb5')]['id']}})[_0x6dbc('0x2b')](handleEntityNotFound(_0x387073,null))[_0x6dbc('0x2b')](function(_0x229d55){if(_0x229d55){_0xa5340d[_0x6dbc('0x43')]=_[_0x6dbc('0x71')](db[_0x6dbc('0xc1')][_0x6dbc('0x3f')]);_0xa5340d['query']=_[_0x6dbc('0x71')](_0x1989f9[_0x6dbc('0x44')]);_0xa5340d[_0x6dbc('0x45')]=_[_0x6dbc('0x46')](_0xa5340d[_0x6dbc('0x43')],_0xa5340d[_0x6dbc('0x44')]);_0xa95b62[_0x6dbc('0x48')]=_[_0x6dbc('0x46')](_0xa5340d[_0x6dbc('0x43')],qs[_0x6dbc('0x47')](_0x1989f9['query'][_0x6dbc('0x47')]));_0xa95b62[_0x6dbc('0x48')]=_0xa95b62[_0x6dbc('0x48')][_0x6dbc('0x60')]?_0xa95b62[_0x6dbc('0x48')]:_0xa5340d[_0x6dbc('0x43')];if(!_0x1989f9[_0x6dbc('0x44')][_0x6dbc('0x49')]('nolimit')){_0xa95b62[_0x6dbc('0x24')]=qs[_0x6dbc('0x24')](_0x1989f9[_0x6dbc('0x44')][_0x6dbc('0x24')]);_0xa95b62[_0x6dbc('0x21')]=qs[_0x6dbc('0x21')](_0x1989f9['query'][_0x6dbc('0x21')]);}_0xa95b62['order']=qs['sort'](_0x1989f9[_0x6dbc('0x44')][_0x6dbc('0x4c')]);_0xa95b62['where']=qs[_0x6dbc('0x45')](_['pick'](_0x1989f9['query'],_0xa5340d[_0x6dbc('0x45')]));_0xa95b62['where'][_0x6dbc('0xb0')]=_0x229d55['id'];if(_0x1989f9['query'][_0x6dbc('0x84')]){_0xa95b62[_0x6dbc('0x74')]=_[_0x6dbc('0x9c')](_0xa95b62[_0x6dbc('0x74')],{'$or':_[_0x6dbc('0x31')](_0xa95b62[_0x6dbc('0x48')],function(_0x16b5ba){var _0x5e0a99={};_0x5e0a99[_0x16b5ba]={'$like':'%'+_0x1989f9[_0x6dbc('0x44')][_0x6dbc('0x84')]+'%'};return _0x5e0a99;})});}if(_0x1989f9[_0x6dbc('0x44')][_0x6dbc('0x77')]){var _0x2e6d6b=_0x1989f9[_0x6dbc('0x44')]['$gte'][_0x6dbc('0x34')](',');var _0x3e7aa3={};_0x3e7aa3[_0x2e6d6b[0x0]]={'$gte':moment(_0x2e6d6b[0x1])[_0x6dbc('0xc2')](_0x6dbc('0xc3'))};_0xa95b62[_0x6dbc('0x74')]=_[_0x6dbc('0x9c')](_0xa95b62[_0x6dbc('0x74')],_0x3e7aa3);}_0xa95b62=_[_0x6dbc('0x9c')]({},_0xa95b62,_0x1989f9[_0x6dbc('0xb8')]);return db[_0x6dbc('0xc1')]['count']({'where':_0xa95b62[_0x6dbc('0x74')]})['then'](function(_0x21e66e){_0x2d3e4c[_0x6dbc('0x23')]=_0x21e66e;if(_0x1989f9[_0x6dbc('0x44')][_0x6dbc('0xb6')]){_0xa95b62['include']=[{'all':!![]}];}return db[_0x6dbc('0xc1')]['findAll'](_0xa95b62);})[_0x6dbc('0x2b')](function(_0x310c68){_0x2d3e4c[_0x6dbc('0xb2')]=_0x310c68;return _0x2d3e4c;});}})[_0x6dbc('0x2b')](respondWithFilteredResult(_0x387073,_0xa95b62))[_0x6dbc('0xb3')](handleError(_0x387073,null));};exports[_0x6dbc('0xc4')]=function(_0x14f04d,_0x2b3894,_0x2c44d5){return db[_0x6dbc('0x3e')][_0x6dbc('0x68')]({'where':{'id':_0x14f04d[_0x6dbc('0xb5')]['id']}})['then'](handleEntityNotFound(_0x2b3894,null))['then'](function(_0x1ee8de){if(_0x1ee8de){return _0x1ee8de[_0x6dbc('0xc5')](_0x14f04d[_0x6dbc('0xba')][_0x6dbc('0xbd')],_[_0x6dbc('0xbe')](_0x14f04d['body'],[_0x6dbc('0xbd'),'id'])||{})[_0x6dbc('0xc6')](function(){return db[_0x6dbc('0x6c')][_0x6dbc('0xc7')]({'attributes':['id',_0x6dbc('0x2e'),_0x6dbc('0xc8')],'where':{'id':_0x14f04d[_0x6dbc('0xba')][_0x6dbc('0xbd')]}});})[_0x6dbc('0x2b')](function(_0x49a1cd){socket[_0x6dbc('0xc9')](_0x6dbc('0xca'),{'id':Number(_0x14f04d[_0x6dbc('0xb5')]['id']),'tags':_0x49a1cd||[]});return{'id':Number(_0x14f04d[_0x6dbc('0xb5')]['id']),'tags':_0x49a1cd||[]};});}})[_0x6dbc('0x2b')](respondWithResult(_0x2b3894,null))[_0x6dbc('0xb3')](handleError(_0x2b3894,null));};exports['removeTags']=function(_0x1dcee1,_0x2c8832,_0x449d4e){return db[_0x6dbc('0x3e')][_0x6dbc('0x68')]({'where':{'id':_0x1dcee1[_0x6dbc('0xb5')]['id']}})[_0x6dbc('0x2b')](handleEntityNotFound(_0x2c8832,null))[_0x6dbc('0x2b')](function(_0x1e48cc){if(_0x1e48cc){return _0x1e48cc[_0x6dbc('0xcb')](_0x1dcee1[_0x6dbc('0x44')][_0x6dbc('0xbd')]);}})[_0x6dbc('0x2b')](respondWithStatusCode(_0x2c8832,null))[_0x6dbc('0xb3')](handleError(_0x2c8832,null));};exports[_0x6dbc('0xcc')]=function(_0x4fb196,_0x178324){var _0x1a0a9d=moment()['unix']()['toString']();var _0x210431=path[_0x6dbc('0xcd')](config[_0x6dbc('0xce')],_0x6dbc('0xcf'),_0x6dbc('0xd0'),_0x6dbc('0xd1'));var _0xe0bba8=path['join'](config[_0x6dbc('0xce')],'server',_0x6dbc('0xd0'),_0x6dbc('0xd2'));var _0x38d8f3=path['join'](_0x210431,_0x1a0a9d);var _0x45bd2e=util['format'](_0x6dbc('0xd3'),_0x4fb196[_0x6dbc('0xb5')]['id'],_0x1a0a9d);var _0x43cacd=path['join'](_0x210431,_0x45bd2e);var _0x4c0312=[];_0x4c0312[_0x6dbc('0x36')]({'model':db['User'],'as':_0x6dbc('0x6e'),'attributes':['id',_0x6dbc('0xd4')],'raw':!![]});_0x4c0312[_0x6dbc('0x36')]({'model':db[_0x6dbc('0xd5')],'as':_0x6dbc('0x64'),'attributes':['id',_0x6dbc('0xd6'),_0x6dbc('0xd7')],'raw':!![]});if(_0x4fb196['query']['attachments']){_0x4c0312[_0x6dbc('0x36')]({'model':db[_0x6dbc('0xd8')],'as':_0x6dbc('0xd8'),'raw':!![]});}var _0x54626b=[{'model':db[_0x6dbc('0xc1')],'as':_0x6dbc('0xd9'),'attributes':['id',_0x6dbc('0xba'),_0x6dbc('0x76'),'direction',_0x6dbc('0xda'),'read'],'include':_0x4c0312}];_0x54626b[_0x6dbc('0x36')]({'model':db[_0x6dbc('0xdb')],'as':'Account','attributes':['id',_0x6dbc('0x2e')]});_0x54626b[_0x6dbc('0x36')]({'model':db['User'],'as':_0x6dbc('0xdc'),'attributes':['id',_0x6dbc('0xd4')]});return db[_0x6dbc('0x3e')][_0x6dbc('0x68')]({'where':{'id':_0x4fb196[_0x6dbc('0xb5')]['id']},'include':_0x54626b})[_0x6dbc('0x2b')](handleEntityNotFound(_0x178324,null))[_0x6dbc('0x2b')](function(_0xf867f2){if(_0xf867f2){var _0x58af58=_0xf867f2[_0x6dbc('0xdd')]({'plain':!![]});fs[_0x6dbc('0xde')](_0x38d8f3);var _0x43685d={'channel':_0x6dbc('0xdf'),'account':_0x58af58[_0x6dbc('0xe0')]['name'],'agent':_0x58af58[_0x6dbc('0xdc')]?_0x58af58[_0x6dbc('0xdc')][_0x6dbc('0xd4')]:_0x6dbc('0xe1'),'createdAt':moment(_0x58af58[_0x6dbc('0x76')])['format'](_0x6dbc('0xc3'))[_0x6dbc('0xae')](),'closedAt':_0x58af58['closed']?moment(_0x58af58[_0x6dbc('0xe2')])[_0x6dbc('0xc2')]('YYYY-MM-DD\x20HH:mm:ss')[_0x6dbc('0xae')]():'','disposition':_0x58af58[_0x6dbc('0xe3')],'messages':_(_0x58af58[_0x6dbc('0xd9')])[_0x6dbc('0x84')]({'secret':![]})[_0x6dbc('0x31')](function(_0x4f52eb){if(_0x4f52eb[_0x6dbc('0xd8')]){var _0x271612=path[_0x6dbc('0xcd')](_0xe0bba8,_0x4f52eb[_0x6dbc('0xd8')][_0x6dbc('0xe4')]);if(fs[_0x6dbc('0xe5')](_0x271612)){fs[_0x6dbc('0xe6')](_0x271612)[_0x6dbc('0xe7')](fs[_0x6dbc('0xe8')](path[_0x6dbc('0xcd')](_0x38d8f3,_0x4f52eb[_0x6dbc('0xd8')][_0x6dbc('0xe4')])));}}return{'date':moment(_0x4f52eb[_0x6dbc('0x76')])[_0x6dbc('0xc2')](_0x6dbc('0xc3'))[_0x6dbc('0xae')](),'sender':_0x4f52eb[_0x6dbc('0xe9')]==='out'?_0x4f52eb[_0x6dbc('0x6e')]?_0x4f52eb[_0x6dbc('0x6e')][_0x6dbc('0xd4')]:_0x6dbc('0xea'):_0x4f52eb[_0x6dbc('0x64')][_0x6dbc('0xd6')]+(_0x4f52eb[_0x6dbc('0x64')]['lastName']?'\x20'+_0x4f52eb['Contact'][_0x6dbc('0xd7')]:''),'body':_0x4f52eb[_0x6dbc('0xd8')]?_0x4f52eb['Attachment']['basename']:_0x4f52eb['body'],'direction':_0x4f52eb['direction']===_0x6dbc('0xeb')?'A':'C','secret':_0x4f52eb[_0x6dbc('0xda')],'read':_0x4f52eb[_0x6dbc('0x7e')],'attachment':_0x4f52eb[_0x6dbc('0xd8')]};})[_0x6dbc('0x61')]()};return ejs[_0x6dbc('0xec')](path[_0x6dbc('0xcd')](config[_0x6dbc('0xce')],'server','views',_0x6dbc('0xed')),{'interaction':_0x43685d})[_0x6dbc('0x2b')](function(_0x3f5796){var _0x3e947c=path[_0x6dbc('0xcd')](_0x38d8f3,'transcript-'+_0x58af58['id']+'-'+_0x1a0a9d+'.pdf');var _0x11ac88={'path':_0x3e947c,'channel':'Whatsapp','interactionId':_0x58af58['id']};return pdf['createPdfFromHTML'](_0x3f5796,_0x11ac88);})[_0x6dbc('0x2b')](function(){return new BPromise(function(_0x10f3cf,_0x4dd369){zipdir(_0x38d8f3,{'saveTo':_0x43cacd},function(_0xbcd02b,_0x2b3474){if(_0xbcd02b)return _0x4dd369(_0xbcd02b);return _0x10f3cf(_0x2b3474);});})[_0x6dbc('0x2b')](function(){return new BPromise(function(_0x21b787,_0x12597f){rimraf(_0x38d8f3,function(_0x42604f){if(_0x42604f)_0x12597f(_0x42604f);return _0x21b787();});});})[_0x6dbc('0x2b')](function(){return _0x178324['download'](_0x43cacd,_0x45bd2e,function(_0x2e28d1){if(_0x2e28d1){console['log'](_0x6dbc('0xee'),_0x2e28d1);}else{fs[_0x6dbc('0xef')](_0x43cacd);}});});});}else{return _0x178324[_0x6dbc('0x1e')](0xc8);}})[_0x6dbc('0xb3')](handleError(_0x178324,null));};
\ No newline at end of file
+var _0xfff0=['clone','i.id','t.id\x20IN\x20?','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','WhatsappInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','contactName','i.*','c.firstName','c.email','Contact.email','c.phone','Contact.phone','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','show','rawAttributes','include','options','create','body','catch','params','describe','addMessage','WhatsappMessage','ids','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','addTags','setTags','omit','emit','whatsappInteractionTags:save','removeTags','join','root','server','tmp','format','transcript-%d-%s.zip','CmContact','Messages','secret','WhatsappAccount','mkdirSync','Whatsapp','Account','Owner','N.A.','closedAt','Attachment','basename','existsSync','createReadStream','pipe','createWriteStream','direction','out','System','firstName','lastName','renderFile','downloadInteraction.ejs','.pdf','createPdfFromHTML','download','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../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','localhost','socket.io-emitter','redis','./whatsappInteraction.socket','end','status','offset','undefined','limit','count','Content-Range','json','apply','save','update','then','destroy','sendStatus','error','stack','name','Users','map','fullname','TagIds','Tags','split','push','waiting','talking','answered','unmanaged','total','closed','UserId','index','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','field','color','from','tools_tags','select','u.id','u.fullname','user_has_whatsapp_interactions','users','whatsapp_interactions','left_join','cm_contacts','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','parseSearch','sqlOperator','conditions','unreadMessages','having','`\x20=\x200','Contact','operator','$substring','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','some','isEmpty','forEach','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','filter','replace','i.id\x20LIKE\x20?','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','QueryTypes','SELECT'];(function(_0x46c121,_0xd6e041){var _0x238e2f=function(_0x18b7b3){while(--_0x18b7b3){_0x46c121['push'](_0x46c121['shift']());}};_0x238e2f(++_0xd6e041);}(_0xfff0,0x139));var _0x0fff=function(_0xa5bc07,_0x59b0b4){_0xa5bc07=_0xa5bc07-0x0;var _0x12012e=_0xfff0[_0xa5bc07];return _0x12012e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0fff('0x0'));var zipdir=require(_0x0fff('0x1'));var jsonpatch=require(_0x0fff('0x2'));var rp=require('request-promise');var moment=require(_0x0fff('0x3'));var BPromise=require(_0x0fff('0x4'));var Mustache=require(_0x0fff('0x5'));var util=require('util');var path=require(_0x0fff('0x6'));var sox=require(_0x0fff('0x7'));var csv=require('to-csv');var ejs=require(_0x0fff('0x8'));var fs=require('fs');var fs_extra=require(_0x0fff('0x9'));var _=require(_0x0fff('0xa'));var squel=require('squel');var crypto=require(_0x0fff('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0fff('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0fff('0xd'));var Papa=require(_0x0fff('0xe'));var Redis=require('ioredis');var authService=require(_0x0fff('0xf'));var qs=require(_0x0fff('0x10'));var as=require(_0x0fff('0x11'));var pdf=require(_0x0fff('0x12'));var hardwareService=require(_0x0fff('0x13'));var logger=require(_0x0fff('0x14'))(_0x0fff('0x15'));var utils=require(_0x0fff('0x16'));var config=require(_0x0fff('0x17'));var licenseUtil=require(_0x0fff('0x18'));var db=require(_0x0fff('0x19'))['db'];config['redis']=_[_0x0fff('0x1a')](config['redis'],{'host':_0x0fff('0x1b'),'port':0x18eb});var socket=require(_0x0fff('0x1c'))(new Redis(config[_0x0fff('0x1d')]));require(_0x0fff('0x1e'))['register'](socket);function respondWithStatusCode(_0x53bde9,_0x1daf30){_0x1daf30=_0x1daf30||0xcc;return function(_0x50a9e4){if(_0x50a9e4){return _0x53bde9['sendStatus'](_0x1daf30);}return _0x53bde9['status'](_0x1daf30)[_0x0fff('0x1f')]();};}function respondWithResult(_0x41e2e7,_0x5eab2e){_0x5eab2e=_0x5eab2e||0xc8;return function(_0x431b33){if(_0x431b33){return _0x41e2e7[_0x0fff('0x20')](_0x5eab2e)['json'](_0x431b33);}};}function respondWithFilteredResult(_0x528071,_0x48f36d){return function(_0x2337f){if(_0x2337f){var _0x606792=typeof _0x48f36d[_0x0fff('0x21')]===_0x0fff('0x22')&&typeof _0x48f36d[_0x0fff('0x23')]===_0x0fff('0x22');var _0x4c88ae=_0x2337f[_0x0fff('0x24')];var _0x136520=_0x606792?0x0:_0x48f36d[_0x0fff('0x21')];var _0x49d211=_0x606792?_0x2337f['count']:_0x48f36d[_0x0fff('0x21')]+_0x48f36d[_0x0fff('0x23')];var _0x1f97c5;if(_0x49d211>=_0x4c88ae){_0x49d211=_0x4c88ae;_0x1f97c5=0xc8;}else{_0x1f97c5=0xce;}_0x528071[_0x0fff('0x20')](_0x1f97c5);return _0x528071['set'](_0x0fff('0x25'),_0x136520+'-'+_0x49d211+'/'+_0x4c88ae)[_0x0fff('0x26')](_0x2337f);}return null;};}function patchUpdates(_0x29d703){return function(_0x4669cc){try{jsonpatch[_0x0fff('0x27')](_0x4669cc,_0x29d703,!![]);}catch(_0x17fba6){return BPromise['reject'](_0x17fba6);}return _0x4669cc[_0x0fff('0x28')]();};}function saveUpdates(_0x29f702,_0x37e090){return function(_0x24cd18){if(_0x24cd18){return _0x24cd18[_0x0fff('0x29')](_0x29f702)[_0x0fff('0x2a')](function(_0x482e1e){return _0x482e1e;});}return null;};}function removeEntity(_0x2c9725,_0x87b3a6){return function(_0x2d1610){if(_0x2d1610){return _0x2d1610[_0x0fff('0x2b')]()[_0x0fff('0x2a')](function(){_0x2c9725[_0x0fff('0x20')](0xcc)[_0x0fff('0x1f')]();});}};}function handleEntityNotFound(_0x3e6fef,_0x44e54a){return function(_0xc32a61){if(!_0xc32a61){_0x3e6fef[_0x0fff('0x2c')](0x194);}return _0xc32a61;};}function handleError(_0x2c39e3,_0x495734){_0x495734=_0x495734||0x1f4;return function(_0x7046a3){logger[_0x0fff('0x2d')](_0x7046a3[_0x0fff('0x2e')]);if(_0x7046a3[_0x0fff('0x2f')]){delete _0x7046a3[_0x0fff('0x2f')];}_0x2c39e3[_0x0fff('0x20')](_0x495734)['send'](_0x7046a3);};}function getInteractionUsers(_0x31f9a4,_0xa16c29){return new BPromise(function(_0x351102,_0x48f1d1){try{if(_0xa16c29[_0x31f9a4['id']]){_0x31f9a4[_0x0fff('0x30')]=_[_0x0fff('0x31')](_0xa16c29[_0x31f9a4['id']],function(_0x4bc2e0){return{'id':_0x4bc2e0['id'],'fullname':_0x4bc2e0[_0x0fff('0x32')]};});}}catch(_0x433de6){_0x48f1d1(_0x433de6);}_0x351102(_0x31f9a4);});}function getInteractionTags(_0x15bb46,_0x15ae24){return new BPromise(function(_0x25ab2a,_0x263e9e){try{if(_0x15bb46[_0x0fff('0x33')]){_0x15bb46[_0x0fff('0x34')]=[];_0x15bb46[_0x0fff('0x33')][_0x0fff('0x35')](',')['forEach'](function(_0x157863){_0x15bb46[_0x0fff('0x34')][_0x0fff('0x36')](_0x15ae24[_0x157863]);});}delete _0x15bb46[_0x0fff('0x33')];}catch(_0x39349e){_0x263e9e(_0x39349e);}_0x25ab2a(_0x15bb46);});}function updateWhatsappInteraction(_0x5967dc,_0x56a991,_0x316057){return new BPromise(function(_0x1a5ef6,_0x648285){return getInteractionUsers(_0x5967dc,_0x316057)[_0x0fff('0x2a')](function(_0x5c1797){return getInteractionTags(_0x5c1797,_0x56a991);})[_0x0fff('0x2a')](function(_0x2f5616){return getStateInteraction(_0x2f5616);})[_0x0fff('0x2a')](function(_0x1464e9){_0x1a5ef6(_0x1464e9);})['catch'](function(_0x36a233){_0x648285(_0x36a233);});});}function getStateInteraction(_0xfadd4f){return new BPromise(function(_0x721f48){_0xfadd4f[_0x0fff('0x37')]=0x0;_0xfadd4f[_0x0fff('0x38')]=0x0;_0xfadd4f[_0x0fff('0x39')]=0x0;_0xfadd4f[_0x0fff('0x3a')]=0x0;_0xfadd4f[_0x0fff('0x3b')]=0x0;if(!_0xfadd4f[_0x0fff('0x3c')]&&!_0xfadd4f[_0x0fff('0x3d')]){_0xfadd4f[_0x0fff('0x37')]+=0x1;}if(!_0xfadd4f[_0x0fff('0x3c')]&&_0xfadd4f['UserId']){_0xfadd4f[_0x0fff('0x38')]+=0x1;if(_0xfadd4f[_0x0fff('0x37')]){_0xfadd4f[_0x0fff('0x37')]-=0x1;}}if(_0xfadd4f[_0x0fff('0x3c')]&&_0xfadd4f[_0x0fff('0x3d')]){_0xfadd4f[_0x0fff('0x39')]+=0x1;if(_0xfadd4f['talking']){_0xfadd4f[_0x0fff('0x38')]-=0x1;}}if(_0xfadd4f[_0x0fff('0x3c')]&&!_0xfadd4f[_0x0fff('0x3d')]){_0xfadd4f[_0x0fff('0x3a')]+=0x1;if(_0xfadd4f[_0x0fff('0x37')]){_0xfadd4f[_0x0fff('0x37')]-=0x1;}}_0xfadd4f[_0x0fff('0x3b')]+=0x1;_0x721f48(_0xfadd4f);});}exports[_0x0fff('0x3e')]=function(_0x28e0aa,_0x5543bf){var _0x2cab47={},_0x4d89c0={},_0x28a8b7={'count':0x0,'rows':[]};var _0x30f329=_[_0x0fff('0x31')](db['WhatsappInteraction']['rawAttributes'],function(_0x91411b){return{'name':_0x91411b[_0x0fff('0x3f')],'type':_0x91411b[_0x0fff('0x40')]['key']};});_0x4d89c0['model']=_[_0x0fff('0x31')](_0x30f329,'name');_0x4d89c0[_0x0fff('0x41')]=_[_0x0fff('0x42')](_0x28e0aa[_0x0fff('0x41')]);_0x4d89c0[_0x0fff('0x43')]=_[_0x0fff('0x44')](_0x4d89c0[_0x0fff('0x45')],_0x4d89c0['query']);_0x2cab47[_0x0fff('0x46')]=_[_0x0fff('0x44')](_0x4d89c0[_0x0fff('0x45')],qs[_0x0fff('0x47')](_0x28e0aa[_0x0fff('0x41')][_0x0fff('0x47')]));_0x2cab47[_0x0fff('0x46')]=_0x2cab47['attributes'][_0x0fff('0x48')]?_0x2cab47[_0x0fff('0x46')]:_0x4d89c0[_0x0fff('0x45')];if(!_0x28e0aa['query'][_0x0fff('0x49')](_0x0fff('0x4a'))){_0x2cab47[_0x0fff('0x23')]=qs[_0x0fff('0x23')](_0x28e0aa[_0x0fff('0x41')][_0x0fff('0x23')]);_0x2cab47[_0x0fff('0x21')]=qs[_0x0fff('0x21')](_0x28e0aa[_0x0fff('0x41')][_0x0fff('0x21')]);}_0x2cab47[_0x0fff('0x4b')]=qs['sort'](_0x28e0aa[_0x0fff('0x41')][_0x0fff('0x4c')]);_0x2cab47['where']=qs[_0x0fff('0x43')](_[_0x0fff('0x4d')](_0x28e0aa[_0x0fff('0x41')],_0x4d89c0['filters']),_0x30f329);var _0x502037=[];var _0x2a0b10=squel['select']()['field']('id')[_0x0fff('0x4e')](_0x0fff('0x2f'))[_0x0fff('0x4e')](_0x0fff('0x4f'))[_0x0fff('0x50')](_0x0fff('0x51'));var _0x552440=squel[_0x0fff('0x52')]()[_0x0fff('0x4e')](_0x0fff('0x53'))[_0x0fff('0x4e')](_0x0fff('0x54'))[_0x0fff('0x4e')]('ui.WhatsappInteractionId')[_0x0fff('0x50')](_0x0fff('0x55'),'ui')['left_join'](_0x0fff('0x56'),'u','u.id\x20=\x20ui.UserId');var _0x5f1943=squel['select']()[_0x0fff('0x50')](_0x0fff('0x57'),'i')[_0x0fff('0x58')](_0x0fff('0x59'),'c',_0x0fff('0x5a'))['left_join'](_0x0fff('0x56'),'o',_0x0fff('0x5b'))[_0x0fff('0x58')](_0x0fff('0x5c'),'a',_0x0fff('0x5d'))['left_join'](_0x0fff('0x5e'),'me',_0x0fff('0x5f'))[_0x0fff('0x58')](_0x0fff('0x60'),'it',_0x0fff('0x61'))[_0x0fff('0x58')](_0x0fff('0x51'),'t',_0x0fff('0x62'));var _0x306815=squel[_0x0fff('0x63')]();var _0x437f15=[];var _0x38168e=squel[_0x0fff('0x63')]();var _0x2608be;if(_0x28e0aa[_0x0fff('0x41')][_0x0fff('0x64')]){_0x2608be=as[_0x0fff('0x65')](_0x28e0aa[_0x0fff('0x41')][_0x0fff('0x64')]);var _0x398513=_0x2608be[_0x0fff('0x66')];for(var _0x50cfc9=0x0;_0x50cfc9<_0x2608be[_0x0fff('0x67')][_0x0fff('0x48')];_0x50cfc9++){var _0x4723a4=_0x2608be[_0x0fff('0x67')][_0x50cfc9];var _0x57d568='i';var _0x1f7ad8=_['find'](_0x30f329,[_0x0fff('0x2f'),_0x4723a4[_0x0fff('0x4e')]]);if(!_0x1f7ad8){switch(_0x4723a4[_0x0fff('0x4e')]){case _0x0fff('0x68'):if(_0x4723a4['value']==0x1){_0x5f1943[_0x0fff('0x69')]('`'+_0x4723a4[_0x0fff('0x4e')]+_0x0fff('0x6a'));}else{_0x5f1943[_0x0fff('0x69')]('`'+_0x4723a4['field']+'`\x20>\x200');}break;case _0x0fff('0x6b'):if(_0x4723a4[_0x0fff('0x6c')]===_0x0fff('0x6d')){if(_0x4723a4[_0x0fff('0x6e')][_0x0fff('0x35')]('\x20')[_0x0fff('0x48')]>0x1){_0x306815[_0x398513]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x4723a4[_0x0fff('0x6e')]),null);}else{var _0x3818bd='%'+_0x4723a4[_0x0fff('0x6e')]+'%';_0x306815[_0x398513](_0x0fff('0x6f'),_0x3818bd,_0x3818bd,_0x3818bd);}}else{_0x1f7ad8=_[_0x0fff('0x70')](_0x30f329,[_0x0fff('0x2f'),_0x0fff('0x71')]);_0x4723a4[_0x0fff('0x4e')]='ContactId';_0x4c8f2b=as[_0x0fff('0x72')](_0x57d568,_0x1f7ad8['type'],_0x4723a4);_0x306815[_0x398513](_0x4c8f2b[_0x0fff('0x73')],_0x4c8f2b[_0x0fff('0x6e')][_0x0fff('0x74')],_0x4c8f2b['value']['end']);}break;case _0x0fff('0x75'):var _0x504212=_0x4723a4[_0x0fff('0x6e')][_0x0fff('0x35')](',')[_0x0fff('0x31')](function(_0x644db){return Number(_0x644db);});_0x504212['forEach'](function(_0x3e04df){_0x38168e['or'](_0x0fff('0x76'),'%,'+_0x3e04df+',%');});_0x437f15=_['union'](_0x437f15,_0x504212);break;case _0x0fff('0x77'):if(_0x4723a4[_0x0fff('0x6c')]===_0x0fff('0x6d')){_0x306815[_0x398513]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x4723a4[_0x0fff('0x6e')]+'%',null);}else{_0x1f7ad8=_[_0x0fff('0x70')](_0x30f329,[_0x0fff('0x2f'),_0x0fff('0x3d')]);_0x4723a4[_0x0fff('0x4e')]=_0x0fff('0x3d');_0x4c8f2b=as[_0x0fff('0x72')](_0x57d568,_0x1f7ad8[_0x0fff('0x40')],_0x4723a4);_0x306815[_0x398513](_0x4c8f2b[_0x0fff('0x73')],_0x4c8f2b[_0x0fff('0x6e')][_0x0fff('0x74')],_0x4c8f2b[_0x0fff('0x6e')]['end']);}break;case'body':_0x4c8f2b=as[_0x0fff('0x72')]('me',null,_0x4723a4);_0x306815[_0x398513](_0x4c8f2b['text'],_0x4c8f2b['value'][_0x0fff('0x74')],_0x4c8f2b[_0x0fff('0x6e')][_0x0fff('0x1f')]);break;}}else{var _0x4c8f2b=as['buildExpression'](_0x57d568,_0x1f7ad8[_0x0fff('0x40')],_0x4723a4);_0x306815[_0x398513](_0x4c8f2b[_0x0fff('0x73')],_0x4c8f2b[_0x0fff('0x6e')][_0x0fff('0x74')],_0x4c8f2b['value'][_0x0fff('0x1f')]);}}}else{var _0xec4e30=_(_0x28e0aa[_0x0fff('0x41')])[_0x0fff('0x42')]()['map'](function(_0x2b5d13){return _[_0x0fff('0x78')](_0x30f329,['name',_0x2b5d13])?_0x2b5d13:undefined;})['compact']()[_0x0fff('0x6e')]();if(!_[_0x0fff('0x79')](_0xec4e30)){_0xec4e30[_0x0fff('0x7a')](function(_0x202344){if(_0x202344===_0x0fff('0x7b')){_0x5f1943['where'](_0x0fff('0x7c'),[][_0x0fff('0x7d')](_0x28e0aa[_0x0fff('0x41')][_0x202344]));}else if(_0x202344===_0x0fff('0x7e')){var _0x256246=JSON['parse'](_0x28e0aa['query'][_0x202344])[_0x0fff('0x7f')];var _0x5e55c8=JSON[_0x0fff('0x80')](_0x28e0aa[_0x0fff('0x41')][_0x202344])[_0x0fff('0x81')];_0x5f1943[_0x0fff('0x82')](_0x0fff('0x83'),_0x256246,_0x5e55c8);}else{if(_0x28e0aa['query'][_0x202344]===_0x0fff('0x84')){_0x5f1943[_0x0fff('0x82')]('i.'+_0x202344+_0x0fff('0x85'));}else{_0x5f1943[_0x0fff('0x82')]('i.'+_0x202344+_0x0fff('0x86'),_0x28e0aa[_0x0fff('0x41')][_0x202344]);}}});}if(_0x28e0aa[_0x0fff('0x41')][_0x0fff('0x87')]){if(_0x28e0aa[_0x0fff('0x41')][_0x0fff('0x87')]==0x1){_0x5f1943[_0x0fff('0x69')]('`unreadMessages`\x20=\x200');}else{_0x5f1943[_0x0fff('0x69')](_0x0fff('0x88'));}}if(_0x28e0aa['query'][_0x0fff('0x89')]){_0x437f15=_['isArray'](_0x28e0aa[_0x0fff('0x41')][_0x0fff('0x89')])?_0x28e0aa[_0x0fff('0x41')][_0x0fff('0x89')]:new Array(_0x28e0aa[_0x0fff('0x41')]['tag']);_0x437f15[_0x0fff('0x7a')](function(_0x8dc876){_0x38168e['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x8dc876+',%');});}if(_0x28e0aa[_0x0fff('0x41')][_0x0fff('0x8a')]){var _0x8442bc=_0x28e0aa['query'][_0x0fff('0x8a')][_0x0fff('0x8b')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x8442bc)){_0x306815['or'](_0x0fff('0x8c'),_0x8442bc+'%')['or']('i.phone\x20LIKE\x20?',_0x8442bc+'%');}else{_0x306815['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0fff('0x8d')](_0x8442bc))['or'](_0x0fff('0x8e'),_0x8442bc+'%');}}}_0x5f1943[_0x0fff('0x82')](_0x306815);_0x5f1943['group']('i.id');var _0x19e32d={'type':db['Sequelize'][_0x0fff('0x8f')][_0x0fff('0x90')],'raw':!![]};var _0x15c1cd=_0x5f1943[_0x0fff('0x91')]();_0x15c1cd[_0x0fff('0x4e')](_0x0fff('0x92'));_0x15c1cd[_0x0fff('0x4e')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x0fff('0x68'));if(_0x2cab47[_0x0fff('0x4b')]){_0x2cab47[_0x0fff('0x4b')][_0x0fff('0x7a')](function(_0x340048){var _0x3ed639=_0x340048[0x0]==='contactName'?_0x340048[0x0]:'i.'+_0x340048[0x0];_0x5f1943[_0x0fff('0x4b')](_0x3ed639,_0x340048[0x1]==='DESC'?![]:!![]);});}if(!_[_0x0fff('0x79')](_0x437f15)){_0x5f1943[_0x0fff('0x69')](_0x38168e);_0x15c1cd[_0x0fff('0x82')](_0x0fff('0x93'),_0x437f15);}BPromise['resolve']()['then'](function(){if(!_0x2608be){if(_0x28e0aa[_0x0fff('0x41')]['WhatsappAccountId'])return;_0x15c1cd[_0x0fff('0x82')](_0x0fff('0x94'));_0x5f1943['where']('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x28e0aa[_0x0fff('0x95')][_0x0fff('0x96')]!==_0x0fff('0x97'))return;return _0x28e0aa[_0x0fff('0x95')]['getWhatsappAccounts']({'attributes':['id'],'raw':!![]})[_0x0fff('0x2a')](function(_0x4eb279){if(_[_0x0fff('0x79')](_0x4eb279)){_0x15c1cd[_0x0fff('0x82')](_0x0fff('0x98'));_0x5f1943['where']('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x15c1cd['where'](_0x0fff('0x7c'),_['map'](_0x4eb279,'id'));_0x5f1943[_0x0fff('0x82')](_0x0fff('0x7c'),_[_0x0fff('0x31')](_0x4eb279,'id'));}});})[_0x0fff('0x2a')](function(){if(_0x28e0aa[_0x0fff('0x95')][_0x0fff('0x96')]===_0x0fff('0x97')&&!_0x2608be&&!_0x28e0aa[_0x0fff('0x41')][_0x0fff('0x7b')])return[];return db[_0x0fff('0x99')][_0x0fff('0x41')](_0x15c1cd['toString'](),_0x19e32d);})[_0x0fff('0x2a')](function(_0x240b0f){_0x28a8b7[_0x0fff('0x24')]=_0x240b0f[_0x0fff('0x48')];if(_0x28a8b7[_0x0fff('0x24')]===0x0)return[];return db['sequelize'][_0x0fff('0x41')](_0x2a0b10[_0x0fff('0x9a')](),_0x19e32d)['then'](function(_0x35559c){_0x502037=_[_0x0fff('0x9b')](_0x35559c,'id');_0x19e32d=_[_0x0fff('0x9c')](_0x19e32d,{'model':db[_0x0fff('0x9d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x28e0aa[_0x0fff('0x41')][_0x0fff('0x47')]){_0x2cab47[_0x0fff('0x46')][_0x0fff('0x7a')](function(_0x40c4f3){_0x5f1943[_0x0fff('0x4e')]('i.'+_0x40c4f3);});}else{_0x5f1943['field'](_0x0fff('0x9e'),_0x0fff('0x68'));_0x5f1943[_0x0fff('0x4e')](_0x0fff('0x9f'),_0x0fff('0xa0'));_0x5f1943[_0x0fff('0x4e')](_0x0fff('0xa1'),'Account.mandatoryDisposition');_0x5f1943[_0x0fff('0x4e')]('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',_0x0fff('0xa2'));_0x5f1943[_0x0fff('0x4e')](_0x0fff('0xa3'));_0x5f1943[_0x0fff('0x4e')](_0x0fff('0xa4'),'Contact.firstName');_0x5f1943[_0x0fff('0x4e')]('c.lastName','Contact.lastName');_0x5f1943[_0x0fff('0x4e')](_0x0fff('0xa5'),_0x0fff('0xa6'));_0x5f1943[_0x0fff('0x4e')](_0x0fff('0xa7'),_0x0fff('0xa8'));_0x5f1943['field']('c.mobile','Contact.mobile');_0x5f1943[_0x0fff('0x4e')](_0x0fff('0xa9'),_0x0fff('0xaa'));_0x5f1943[_0x0fff('0x4e')](_0x0fff('0xab'),_0x0fff('0xac'));_0x5f1943[_0x0fff('0x4e')](_0x0fff('0xad'),_0x0fff('0xae'));_0x5f1943[_0x0fff('0x4e')](_0x0fff('0xaf'),_0x0fff('0x33'));}if(_0x2cab47[_0x0fff('0x23')])_0x5f1943[_0x0fff('0x23')](_0x2cab47[_0x0fff('0x23')]);if(_0x2cab47[_0x0fff('0x21')])_0x5f1943[_0x0fff('0x21')](_0x2cab47['offset']);return db[_0x0fff('0x99')][_0x0fff('0x41')](_0x5f1943[_0x0fff('0x9a')](),_0x19e32d);})[_0x0fff('0x2a')](function(_0x15d3b8){if(_0x15d3b8[_0x0fff('0x48')]>0x0)_0x552440[_0x0fff('0x82')]('ui.WhatsappInteractionId\x20IN\x20?',_[_0x0fff('0x31')](_0x15d3b8,'id'));return db[_0x0fff('0x99')]['query'](_0x552440[_0x0fff('0x9a')](),_0x19e32d)['then'](function(_0x3e926b){var _0x14525b=_['groupBy'](_0x3e926b,'WhatsappInteractionId');var _0x5613e5=[];_0x15d3b8[_0x0fff('0x7a')](function(_0x4cc04d){_0x5613e5['push'](updateWhatsappInteraction(_0x4cc04d,_0x502037,_0x14525b));});return BPromise['all'](_0x5613e5);});});})['then'](function(_0x194d74){_0x28a8b7['rows']=_0x194d74;return _0x28a8b7;})[_0x0fff('0x2a')](respondWithFilteredResult(_0x5543bf,_0x2cab47))['catch'](handleError(_0x5543bf,null));};exports[_0x0fff('0xb0')]=function(_0x489f1c,_0x465dde){var _0x9ca531={'raw':![],'where':{'id':_0x489f1c['params']['id']}},_0x49cd34={};_0x49cd34[_0x0fff('0x45')]=_[_0x0fff('0x42')](db[_0x0fff('0x9d')][_0x0fff('0xb1')]);_0x49cd34[_0x0fff('0x41')]=_[_0x0fff('0x42')](_0x489f1c[_0x0fff('0x41')]);_0x49cd34['filters']=_[_0x0fff('0x44')](_0x49cd34[_0x0fff('0x45')],_0x49cd34[_0x0fff('0x41')]);_0x9ca531[_0x0fff('0x46')]=_['intersection'](_0x49cd34[_0x0fff('0x45')],qs[_0x0fff('0x47')](_0x489f1c[_0x0fff('0x41')]['fields']));_0x9ca531['attributes']=_0x9ca531[_0x0fff('0x46')][_0x0fff('0x48')]?_0x9ca531['attributes']:_0x49cd34[_0x0fff('0x45')];if(_0x489f1c[_0x0fff('0x41')]['includeAll']){_0x9ca531[_0x0fff('0xb2')]=[{'all':!![]}];}_0x9ca531=_[_0x0fff('0x9c')]({},_0x9ca531,_0x489f1c[_0x0fff('0xb3')]);return db['WhatsappInteraction']['find'](_0x9ca531)[_0x0fff('0x2a')](handleEntityNotFound(_0x465dde,null))[_0x0fff('0x2a')](respondWithResult(_0x465dde,null))['catch'](handleError(_0x465dde,null));};exports[_0x0fff('0xb4')]=function(_0x198ca4,_0x319543){return db[_0x0fff('0x9d')][_0x0fff('0xb4')](_0x198ca4[_0x0fff('0xb5')],{})[_0x0fff('0x2a')](respondWithResult(_0x319543,0xc9))[_0x0fff('0xb6')](handleError(_0x319543,null));};exports[_0x0fff('0x29')]=function(_0x320c2d,_0x10aa61){if(_0x320c2d[_0x0fff('0xb5')]['id']){delete _0x320c2d['body']['id'];}return db[_0x0fff('0x9d')]['find']({'where':{'id':_0x320c2d[_0x0fff('0xb7')]['id']}})['then'](handleEntityNotFound(_0x10aa61,null))[_0x0fff('0x2a')](saveUpdates(_0x320c2d[_0x0fff('0xb5')],null))[_0x0fff('0x2a')](respondWithResult(_0x10aa61,null))[_0x0fff('0xb6')](handleError(_0x10aa61,null));};exports[_0x0fff('0x2b')]=function(_0x2c4edc,_0x553855){return db[_0x0fff('0x9d')][_0x0fff('0x70')]({'where':{'id':_0x2c4edc['params']['id']}})[_0x0fff('0x2a')](handleEntityNotFound(_0x553855,null))['then'](removeEntity(_0x553855,null))['catch'](handleError(_0x553855,null));};exports[_0x0fff('0xb8')]=function(_0x2e38c3,_0x4629d9){return db[_0x0fff('0x9d')][_0x0fff('0xb8')]()[_0x0fff('0x2a')](respondWithResult(_0x4629d9,null))['catch'](handleError(_0x4629d9,null));};exports[_0x0fff('0xb9')]=function(_0x328f41,_0x336fd9,_0x2c9588){return db[_0x0fff('0xba')]['find']({'where':{'id':_0x328f41[_0x0fff('0xb7')]['id']}})[_0x0fff('0x2a')](handleEntityNotFound(_0x336fd9,null))[_0x0fff('0x2a')](function(_0x302505){if(_0x302505){return _0x302505[_0x0fff('0xb9')](_0x328f41[_0x0fff('0xb5')][_0x0fff('0xbb')],_['omit'](_0x328f41['body'],[_0x0fff('0xbb'),'id'])||{});}})['then'](respondWithResult(_0x336fd9,null))[_0x0fff('0xb6')](handleError(_0x336fd9,null));};exports['getMessages']=function(_0x5f00ee,_0x592341,_0x2e1625){var _0x128fe1={'raw':![],'where':{}};var _0x1fec67={};var _0x448e18={'count':0x0,'rows':[]};return db[_0x0fff('0x9d')]['findOne']({'where':{'id':_0x5f00ee[_0x0fff('0xb7')]['id']}})[_0x0fff('0x2a')](handleEntityNotFound(_0x592341,null))[_0x0fff('0x2a')](function(_0x2b60d7){if(_0x2b60d7){_0x1fec67[_0x0fff('0x45')]=_[_0x0fff('0x42')](db[_0x0fff('0xba')][_0x0fff('0xb1')]);_0x1fec67['query']=_['keys'](_0x5f00ee[_0x0fff('0x41')]);_0x1fec67[_0x0fff('0x43')]=_[_0x0fff('0x44')](_0x1fec67['model'],_0x1fec67[_0x0fff('0x41')]);_0x128fe1[_0x0fff('0x46')]=_[_0x0fff('0x44')](_0x1fec67['model'],qs[_0x0fff('0x47')](_0x5f00ee[_0x0fff('0x41')][_0x0fff('0x47')]));_0x128fe1[_0x0fff('0x46')]=_0x128fe1[_0x0fff('0x46')][_0x0fff('0x48')]?_0x128fe1[_0x0fff('0x46')]:_0x1fec67['model'];if(!_0x5f00ee['query']['hasOwnProperty'](_0x0fff('0x4a'))){_0x128fe1[_0x0fff('0x23')]=qs[_0x0fff('0x23')](_0x5f00ee[_0x0fff('0x41')][_0x0fff('0x23')]);_0x128fe1[_0x0fff('0x21')]=qs['offset'](_0x5f00ee[_0x0fff('0x41')][_0x0fff('0x21')]);}_0x128fe1[_0x0fff('0x4b')]=qs['sort'](_0x5f00ee['query'][_0x0fff('0x4c')]);_0x128fe1['where']=qs[_0x0fff('0x43')](_[_0x0fff('0x4d')](_0x5f00ee['query'],_0x1fec67[_0x0fff('0x43')]));_0x128fe1[_0x0fff('0x82')]['WhatsappInteractionId']=_0x2b60d7['id'];if(_0x5f00ee[_0x0fff('0x41')][_0x0fff('0x8a')]){_0x128fe1[_0x0fff('0x82')]=_[_0x0fff('0x9c')](_0x128fe1[_0x0fff('0x82')],{'$or':_[_0x0fff('0x31')](_0x128fe1['attributes'],function(_0x14fed3){var _0x4fd42c={};_0x4fd42c[_0x14fed3]={'$like':'%'+_0x5f00ee[_0x0fff('0x41')]['filter']+'%'};return _0x4fd42c;})});}if(_0x5f00ee[_0x0fff('0x41')]['$gte']){var _0x25e94e=_0x5f00ee[_0x0fff('0x41')][_0x0fff('0x7f')]['split'](',');var _0x24d7e0={};_0x24d7e0[_0x25e94e[0x0]]={'$gte':moment(_0x25e94e[0x1])['format'](_0x0fff('0xbc'))};_0x128fe1[_0x0fff('0x82')]=_[_0x0fff('0x9c')](_0x128fe1['where'],_0x24d7e0);}_0x128fe1=_['merge']({},_0x128fe1,_0x5f00ee[_0x0fff('0xb3')]);return db[_0x0fff('0xba')]['count']({'where':_0x128fe1['where']})[_0x0fff('0x2a')](function(_0xef39ff){_0x448e18[_0x0fff('0x24')]=_0xef39ff;if(_0x5f00ee[_0x0fff('0x41')][_0x0fff('0xbd')]){_0x128fe1['include']=[{'all':!![]}];}return db[_0x0fff('0xba')]['findAll'](_0x128fe1);})[_0x0fff('0x2a')](function(_0x1f8d8d){_0x448e18[_0x0fff('0xbe')]=_0x1f8d8d;return _0x448e18;});}})[_0x0fff('0x2a')](respondWithFilteredResult(_0x592341,_0x128fe1))['catch'](handleError(_0x592341,null));};exports[_0x0fff('0xbf')]=function(_0x4cba9a,_0x12e8dc,_0x464cef){return db[_0x0fff('0x9d')][_0x0fff('0x70')]({'where':{'id':_0x4cba9a[_0x0fff('0xb7')]['id']}})['then'](handleEntityNotFound(_0x12e8dc,null))['then'](function(_0x8b874d){if(_0x8b874d){return _0x8b874d[_0x0fff('0xc0')](_0x4cba9a[_0x0fff('0xb5')]['ids'],_[_0x0fff('0xc1')](_0x4cba9a[_0x0fff('0xb5')],[_0x0fff('0xbb'),'id'])||{})['spread'](function(){return db[_0x0fff('0x75')]['findAll']({'attributes':['id',_0x0fff('0x2f'),_0x0fff('0x4f')],'where':{'id':_0x4cba9a[_0x0fff('0xb5')][_0x0fff('0xbb')]}});})[_0x0fff('0x2a')](function(_0x2727fb){socket[_0x0fff('0xc2')](_0x0fff('0xc3'),{'id':Number(_0x4cba9a[_0x0fff('0xb7')]['id']),'tags':_0x2727fb||[]});return{'id':Number(_0x4cba9a[_0x0fff('0xb7')]['id']),'tags':_0x2727fb||[]};});}})['then'](respondWithResult(_0x12e8dc,null))[_0x0fff('0xb6')](handleError(_0x12e8dc,null));};exports[_0x0fff('0xc4')]=function(_0x237fe8,_0x3b721d,_0x428ac2){return db[_0x0fff('0x9d')]['find']({'where':{'id':_0x237fe8['params']['id']}})[_0x0fff('0x2a')](handleEntityNotFound(_0x3b721d,null))['then'](function(_0x80af50){if(_0x80af50){return _0x80af50[_0x0fff('0xc4')](_0x237fe8['query'][_0x0fff('0xbb')]);}})['then'](respondWithStatusCode(_0x3b721d,null))[_0x0fff('0xb6')](handleError(_0x3b721d,null));};exports['download']=function(_0x558377,_0x5a7c28){var _0x50d8c4=moment()['unix']()['toString']();var _0x44accd=path[_0x0fff('0xc5')](config[_0x0fff('0xc6')],_0x0fff('0xc7'),'files',_0x0fff('0xc8'));var _0x5c89ae=path[_0x0fff('0xc5')](config['root'],_0x0fff('0xc7'),'files','attachments');var _0x5a6583=path[_0x0fff('0xc5')](_0x44accd,_0x50d8c4);var _0x2f8cf0=util[_0x0fff('0xc9')](_0x0fff('0xca'),_0x558377[_0x0fff('0xb7')]['id'],_0x50d8c4);var _0x16b691=path[_0x0fff('0xc5')](_0x44accd,_0x2f8cf0);var _0x3ad64b=[];_0x3ad64b[_0x0fff('0x36')]({'model':db[_0x0fff('0x77')],'as':_0x0fff('0x77'),'attributes':['id','fullname'],'raw':!![]});_0x3ad64b['push']({'model':db[_0x0fff('0xcb')],'as':'Contact','attributes':['id','firstName','lastName'],'raw':!![]});if(_0x558377[_0x0fff('0x41')]['attachments']){_0x3ad64b[_0x0fff('0x36')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x4e22e9=[{'model':db[_0x0fff('0xba')],'as':_0x0fff('0xcc'),'attributes':['id',_0x0fff('0xb5'),_0x0fff('0x7e'),'direction',_0x0fff('0xcd'),_0x0fff('0x87')],'include':_0x3ad64b}];_0x4e22e9[_0x0fff('0x36')]({'model':db[_0x0fff('0xce')],'as':'Account','attributes':['id',_0x0fff('0x2f')]});_0x4e22e9[_0x0fff('0x36')]({'model':db[_0x0fff('0x77')],'as':'Owner','attributes':['id',_0x0fff('0x32')]});return db['WhatsappInteraction'][_0x0fff('0x70')]({'where':{'id':_0x558377[_0x0fff('0xb7')]['id']},'include':_0x4e22e9})[_0x0fff('0x2a')](handleEntityNotFound(_0x5a7c28,null))[_0x0fff('0x2a')](function(_0x47e1dd){if(_0x47e1dd){var _0x18b368=_0x47e1dd['get']({'plain':!![]});fs[_0x0fff('0xcf')](_0x5a6583);var _0x31f36d={'channel':_0x0fff('0xd0'),'account':_0x18b368[_0x0fff('0xd1')][_0x0fff('0x2f')],'agent':_0x18b368[_0x0fff('0xd2')]?_0x18b368[_0x0fff('0xd2')]['fullname']:_0x0fff('0xd3'),'createdAt':moment(_0x18b368[_0x0fff('0x7e')])['format'](_0x0fff('0xbc'))[_0x0fff('0x9a')](),'closedAt':_0x18b368[_0x0fff('0x3c')]?moment(_0x18b368[_0x0fff('0xd4')])[_0x0fff('0xc9')](_0x0fff('0xbc'))[_0x0fff('0x9a')]():'','disposition':_0x18b368['disposition'],'messages':_(_0x18b368['Messages'])[_0x0fff('0x8a')]({'secret':![]})['map'](function(_0x849dc4){if(_0x849dc4[_0x0fff('0xd5')]){var _0x3f70da=path[_0x0fff('0xc5')](_0x5c89ae,_0x849dc4[_0x0fff('0xd5')][_0x0fff('0xd6')]);if(fs[_0x0fff('0xd7')](_0x3f70da)){fs[_0x0fff('0xd8')](_0x3f70da)[_0x0fff('0xd9')](fs[_0x0fff('0xda')](path[_0x0fff('0xc5')](_0x5a6583,_0x849dc4[_0x0fff('0xd5')][_0x0fff('0xd6')])));}}return{'date':moment(_0x849dc4[_0x0fff('0x7e')])['format'](_0x0fff('0xbc'))[_0x0fff('0x9a')](),'sender':_0x849dc4[_0x0fff('0xdb')]===_0x0fff('0xdc')?_0x849dc4[_0x0fff('0x77')]?_0x849dc4[_0x0fff('0x77')]['fullname']:_0x0fff('0xdd'):_0x849dc4[_0x0fff('0x6b')][_0x0fff('0xde')]+(_0x849dc4[_0x0fff('0x6b')]['lastName']?'\x20'+_0x849dc4['Contact'][_0x0fff('0xdf')]:''),'body':_0x849dc4[_0x0fff('0xd5')]?_0x849dc4[_0x0fff('0xd5')][_0x0fff('0xd6')]:_0x849dc4['body'],'direction':_0x849dc4['direction']===_0x0fff('0xdc')?'A':'C','secret':_0x849dc4[_0x0fff('0xcd')],'read':_0x849dc4[_0x0fff('0x87')],'attachment':_0x849dc4[_0x0fff('0xd5')]};})['value']()};return ejs[_0x0fff('0xe0')](path[_0x0fff('0xc5')](config[_0x0fff('0xc6')],_0x0fff('0xc7'),'views',_0x0fff('0xe1')),{'interaction':_0x31f36d})[_0x0fff('0x2a')](function(_0x2b685f){var _0x42922a=path['join'](_0x5a6583,'transcript-'+_0x18b368['id']+'-'+_0x50d8c4+_0x0fff('0xe2'));var _0x370d1d={'path':_0x42922a,'channel':'Whatsapp','interactionId':_0x18b368['id']};return pdf[_0x0fff('0xe3')](_0x2b685f,_0x370d1d);})[_0x0fff('0x2a')](function(){return new BPromise(function(_0x42870a,_0x5cf1de){zipdir(_0x5a6583,{'saveTo':_0x16b691},function(_0xb63b28,_0x4c6200){if(_0xb63b28)return _0x5cf1de(_0xb63b28);return _0x42870a(_0x4c6200);});})[_0x0fff('0x2a')](function(){return new BPromise(function(_0x5c449a,_0x2dede8){rimraf(_0x5a6583,function(_0x3a9c6c){if(_0x3a9c6c)_0x2dede8(_0x3a9c6c);return _0x5c449a();});});})[_0x0fff('0x2a')](function(){return _0x5a7c28[_0x0fff('0xe4')](_0x16b691,_0x2f8cf0,function(_0x4f5c80){if(_0x4f5c80){console['log']('err',_0x4f5c80);}else{fs['unlinkSync'](_0x16b691);}});});});}else{return _0x5a7c28[_0x0fff('0x2c')](0xc8);}})[_0x0fff('0xb6')](handleError(_0x5a7c28,null));};
\ No newline at end of file
index 9b07e7f..1ed3deb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x688a=['Users','map','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','save','update','getUsers','then'];(function(_0x16be98,_0x754d0e){var _0x630b22=function(_0x2be231){while(--_0x2be231){_0x16be98['push'](_0x16be98['shift']());}};_0x630b22(++_0x754d0e);}(_0x688a,0x124));var _0xa688=function(_0x17ea0f,_0xca51c4){_0x17ea0f=_0x17ea0f-0x0;var _0x574054=_0x688a[_0x17ea0f];return _0x574054;};'use strict';var EventEmitter=require(_0xa688('0x0'));var WhatsappInteraction=require(_0xa688('0x1'))['db'][_0xa688('0x2')];var WhatsappMessage=require('../../mysqldb')['db'][_0xa688('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa688('0x4'),'afterUpdate':_0xa688('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4a9122){return function(_0x415030,_0x27e6c4,_0x45b3ca){_0x415030[_0xa688('0x6')]({'attributes':['id'],'raw':!![]})[_0xa688('0x7')](function(_0x49e75d){_0x415030['setDataValue'](_0xa688('0x8'),_0x49e75d[_0xa688('0x9')](function(_0x1ab9f2){return{'id':_0x1ab9f2['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x415030['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x42b94e){_0x415030['setDataValue']('unreadMessages',_0x42b94e[_0xa688('0xa')]);WhatsappInteractionEvents[_0xa688('0xb')](_0x4a9122+':'+_0x415030['id'],_0x415030);WhatsappInteractionEvents[_0xa688('0xb')](_0x4a9122,_0x415030);_0x45b3ca(null);})[_0xa688('0xc')](_0x45b3ca(null));};}for(var e in events){if(events[_0xa688('0xd')](e)){var event=events[e];WhatsappInteraction[_0xa688('0xe')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents;
\ No newline at end of file
+var _0x6364=['hasOwnProperty','hook','exports','WhatsappInteraction','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','catch'];(function(_0x1b6862,_0x547e9e){var _0x28b778=function(_0x53c5e1){while(--_0x53c5e1){_0x1b6862['push'](_0x1b6862['shift']());}};_0x28b778(++_0x547e9e);}(_0x6364,0x8f));var _0x4636=function(_0x2367bd,_0x1a89c9){_0x2367bd=_0x2367bd-0x0;var _0xc95800=_0x6364[_0x2367bd];return _0xc95800;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require('../../mysqldb')['db'][_0x4636('0x0')];var WhatsappMessage=require(_0x4636('0x1'))['db'][_0x4636('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x4636('0x3')](0x0);var events={'afterCreate':_0x4636('0x4'),'afterUpdate':_0x4636('0x5'),'afterDestroy':_0x4636('0x6')};function emitEvent(_0x354484){return function(_0x5b7e33,_0x30dc87,_0x30201f){_0x5b7e33[_0x4636('0x7')]({'attributes':['id'],'raw':!![]})[_0x4636('0x8')](function(_0x17456d){_0x5b7e33['setDataValue'](_0x4636('0x9'),_0x17456d[_0x4636('0xa')](function(_0x122d94){return{'id':_0x122d94['id']};}));return WhatsappMessage[_0x4636('0xb')]({'where':{'WhatsappInteractionId':_0x5b7e33['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3e1628){_0x5b7e33[_0x4636('0xc')](_0x4636('0xd'),_0x3e1628[_0x4636('0xe')]);WhatsappInteractionEvents[_0x4636('0xf')](_0x354484+':'+_0x5b7e33['id'],_0x5b7e33);WhatsappInteractionEvents['emit'](_0x354484,_0x5b7e33);_0x30201f(null);})[_0x4636('0x10')](_0x30201f(null));};}for(var e in events){if(events[_0x4636('0x11')](e)){var event=events[e];WhatsappInteraction[_0x4636('0x12')](e,emitEvent(event));}}module[_0x4636('0x13')]=WhatsappInteractionEvents;
\ No newline at end of file
index e2aee1d..ae594b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac60=['closedAt','YYYY-MM-DD\x20HH:mm:ss','util','api','moment','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed'];(function(_0x367bad,_0x572520){var _0x3f7777=function(_0x13dc40){while(--_0x13dc40){_0x367bad['push'](_0x367bad['shift']());}};_0x3f7777(++_0x572520);}(_0xac60,0x188));var _0x0ac6=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xac60[_0x134c2e];return _0x2825db;};'use strict';var _=require('lodash');var util=require(_0x0ac6('0x0'));var logger=require('../../config/logger')(_0x0ac6('0x1'));var moment=require(_0x0ac6('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0ac6('0x3'));var rimraf=require(_0x0ac6('0x4'));var config=require(_0x0ac6('0x5'));var attributes=require(_0x0ac6('0x6'));module[_0x0ac6('0x7')]=function(_0xf68614,_0x45ac01){return _0xf68614[_0x0ac6('0x8')](_0x0ac6('0x9'),attributes,{'tableName':_0x0ac6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5a3a1c,_0x7ef71b,_0x11dae4){if(_0x5a3a1c[_0x0ac6('0xb')](_0x0ac6('0xc'))){_0x5a3a1c[_0x0ac6('0xd')]=moment()['format'](_0x0ac6('0xe'));}_0x11dae4(null,_0x5a3a1c);}}});};
\ No newline at end of file
+var _0x0767=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','whatsapp_interactions','changed','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x0767,0x1bf));var _0x7076=function(_0x55a0e9,_0x47b507){_0x55a0e9=_0x55a0e9-0x0;var _0x3cddbb=_0x0767[_0x55a0e9];return _0x3cddbb;};'use strict';var _=require(_0x7076('0x0'));var util=require(_0x7076('0x1'));var logger=require(_0x7076('0x2'))(_0x7076('0x3'));var moment=require(_0x7076('0x4'));var BPromise=require(_0x7076('0x5'));var rp=require(_0x7076('0x6'));var fs=require('fs');var path=require(_0x7076('0x7'));var rimraf=require(_0x7076('0x8'));var config=require(_0x7076('0x9'));var attributes=require('./whatsappInteraction.attributes');module[_0x7076('0xa')]=function(_0x29c018,_0x32d055){return _0x29c018[_0x7076('0xb')]('WhatsappInteraction',attributes,{'tableName':_0x7076('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x42cfdd,_0x247b72,_0x34698d){if(_0x42cfdd[_0x7076('0xd')]('closed')){_0x42cfdd['closedAt']=moment()['format'](_0x7076('0xe'));}_0x34698d(null,_0x42cfdd);}}});};
\ No newline at end of file
index 54c74cb..60ec08e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3da9=['then','ids','omit','spread','AddTags','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','attributes','limit','AddTagsToWhatsappInteraction','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3da9,0xf5));var _0x93da=function(_0x3da11a,_0x45b312){_0x3da11a=_0x3da11a-0x0;var _0x1d540a=_0x3da9[_0x3da11a];return _0x1d540a;};'use strict';var _=require('lodash');var util=require(_0x93da('0x0'));var moment=require('moment');var BPromise=require(_0x93da('0x1'));var rs=require(_0x93da('0x2'));var fs=require('fs');var Redis=require(_0x93da('0x3'));var db=require(_0x93da('0x4'))['db'];var utils=require(_0x93da('0x5'));var logger=require(_0x93da('0x6'))(_0x93da('0x7'));var config=require(_0x93da('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x93da('0x9')]=_['defaults'](config['redis'],{'host':_0x93da('0xa'),'port':0x18eb});var socket=require(_0x93da('0xb'))(new Redis(config[_0x93da('0x9')]));require(_0x93da('0xc'))[_0x93da('0xd')](socket);function respondWithRpcPromise(_0x502e85,_0x2567f0,_0x393eb4){return new BPromise(function(_0x1cda46,_0x4a48d1){return client[_0x93da('0xe')](_0x502e85,_0x393eb4)['then'](function(_0x190977){logger[_0x93da('0xf')](_0x93da('0x10'),_0x2567f0,_0x93da('0x11'));logger[_0x93da('0x12')](_0x93da('0x13'),_0x2567f0,'request\x20sent',JSON[_0x93da('0x14')](_0x190977));if(_0x190977[_0x93da('0x15')]){if(_0x190977[_0x93da('0x15')][_0x93da('0x16')]===0x1f4){logger[_0x93da('0x15')](_0x93da('0x10'),_0x2567f0,_0x190977['error'][_0x93da('0x17')]);return _0x4a48d1(_0x190977[_0x93da('0x15')]['message']);}logger[_0x93da('0x15')](_0x93da('0x10'),_0x2567f0,_0x190977[_0x93da('0x15')][_0x93da('0x17')]);return _0x1cda46(_0x190977[_0x93da('0x15')][_0x93da('0x17')]);}else{logger[_0x93da('0xf')](_0x93da('0x10'),_0x2567f0,_0x93da('0x11'));_0x1cda46(_0x190977[_0x93da('0x18')][_0x93da('0x17')]);}})[_0x93da('0x19')](function(_0x15ce2f){logger[_0x93da('0x15')](_0x93da('0x10'),_0x2567f0,_0x15ce2f);_0x4a48d1(_0x15ce2f);});});}exports[_0x93da('0x1a')]=function(_0x16edfa){var _0x12172e=this;return new Promise(function(_0x15a3f6,_0x3a68eb){return db[_0x93da('0x1b')][_0x93da('0x1c')](_0x16edfa[_0x93da('0x1d')],{'raw':_0x16edfa[_0x93da('0x1e')]?_0x16edfa[_0x93da('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16edfa['options']?_0x16edfa[_0x93da('0x1e')]['where']||null:null,'attributes':_0x16edfa[_0x93da('0x1e')]?_0x16edfa[_0x93da('0x1e')][_0x93da('0x1f')]||null:null,'limit':_0x16edfa[_0x93da('0x1e')]?_0x16edfa[_0x93da('0x1e')][_0x93da('0x20')]||null:null})['then'](function(_0xfbb93b){logger[_0x93da('0xf')](_0x93da('0x1a'),_0x16edfa);logger[_0x93da('0x12')]('UpdateWhatsappInteraction',_0x16edfa,JSON[_0x93da('0x14')](_0xfbb93b));_0x15a3f6(_0xfbb93b);})[_0x93da('0x19')](function(_0x495c64){logger['error']('UpdateWhatsappInteraction',_0x495c64[_0x93da('0x17')],_0x16edfa);_0x3a68eb(_0x12172e[_0x93da('0x15')](0x1f4,_0x495c64[_0x93da('0x17')]));});});};exports[_0x93da('0x21')]=function(_0x5bc1d1){return new Promise(function(_0x303a84,_0x533839){return db['WhatsappInteraction'][_0x93da('0x22')]({'where':_0x5bc1d1[_0x93da('0x1e')]?_0x5bc1d1[_0x93da('0x1e')]['where']||null:null})[_0x93da('0x23')](function(_0xfdebb4){if(_0xfdebb4){return _0xfdebb4['addTags'](_0x5bc1d1[_0x93da('0x1d')][_0x93da('0x24')],_[_0x93da('0x25')](_0x5bc1d1[_0x93da('0x1d')],[_0x93da('0x24'),'id'])||{});}})[_0x93da('0x26')](function(_0x3dc680){logger[_0x93da('0xf')]('AddTags',_0x5bc1d1);logger[_0x93da('0x12')](_0x93da('0x27'),_0x5bc1d1,JSON['stringify'](_0x3dc680));_0x303a84(_0x3dc680);})[_0x93da('0x19')](function(_0x20800d){logger[_0x93da('0x15')](_0x93da('0x27'),_0x20800d[_0x93da('0x17')],_0x5bc1d1);_0x533839(_this[_0x93da('0x15')](0x1f4,_0x20800d[_0x93da('0x17')]));});});};
\ No newline at end of file
+var _0x0d57=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','info','WhatsappInteraction,\x20%s,\x20%s','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','WhatsappInteraction','update','body','options','where','attributes','limit','then','UpdateWhatsappInteraction','debug','find','addTags','ids','spread','AddTags','lodash','util'];(function(_0x4e817e,_0xb72c2f){var _0xf376c2=function(_0x3f8906){while(--_0x3f8906){_0x4e817e['push'](_0x4e817e['shift']());}};_0xf376c2(++_0xb72c2f);}(_0x0d57,0x116));var _0x70d5=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0d57[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x70d5('0x0'));var util=require(_0x70d5('0x1'));var moment=require(_0x70d5('0x2'));var BPromise=require(_0x70d5('0x3'));var rs=require(_0x70d5('0x4'));var fs=require('fs');var Redis=require(_0x70d5('0x5'));var db=require(_0x70d5('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x70d5('0x7'))(_0x70d5('0x8'));var config=require('../../config/environment');var jayson=require(_0x70d5('0x9'));var client=jayson[_0x70d5('0xa')][_0x70d5('0xb')]({'port':0x232a});config[_0x70d5('0xc')]=_[_0x70d5('0xd')](config[_0x70d5('0xc')],{'host':_0x70d5('0xe'),'port':0x18eb});var socket=require(_0x70d5('0xf'))(new Redis(config['redis']));require(_0x70d5('0x10'))[_0x70d5('0x11')](socket);function respondWithRpcPromise(_0x507e82,_0x34e07d,_0x545d23){return new BPromise(function(_0x229725,_0x1ae9e){return client['request'](_0x507e82,_0x545d23)['then'](function(_0xf3084e){logger[_0x70d5('0x12')](_0x70d5('0x13'),_0x34e07d,'request\x20sent');logger['debug'](_0x70d5('0x14'),_0x34e07d,_0x70d5('0x15'),JSON[_0x70d5('0x16')](_0xf3084e));if(_0xf3084e[_0x70d5('0x17')]){if(_0xf3084e[_0x70d5('0x17')]['code']===0x1f4){logger[_0x70d5('0x17')]('WhatsappInteraction,\x20%s,\x20%s',_0x34e07d,_0xf3084e[_0x70d5('0x17')][_0x70d5('0x18')]);return _0x1ae9e(_0xf3084e[_0x70d5('0x17')][_0x70d5('0x18')]);}logger[_0x70d5('0x17')](_0x70d5('0x13'),_0x34e07d,_0xf3084e[_0x70d5('0x17')][_0x70d5('0x18')]);return _0x229725(_0xf3084e['error'][_0x70d5('0x18')]);}else{logger['info']('WhatsappInteraction,\x20%s,\x20%s',_0x34e07d,'request\x20sent');_0x229725(_0xf3084e['result'][_0x70d5('0x18')]);}})['catch'](function(_0x4eb55a){logger[_0x70d5('0x17')](_0x70d5('0x13'),_0x34e07d,_0x4eb55a);_0x1ae9e(_0x4eb55a);});});}exports['UpdateWhatsappInteraction']=function(_0x398390){var _0x4a4680=this;return new Promise(function(_0x781988,_0x54c8b3){return db[_0x70d5('0x19')][_0x70d5('0x1a')](_0x398390[_0x70d5('0x1b')],{'raw':_0x398390[_0x70d5('0x1c')]?_0x398390[_0x70d5('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x398390[_0x70d5('0x1c')]?_0x398390['options'][_0x70d5('0x1d')]||null:null,'attributes':_0x398390[_0x70d5('0x1c')]?_0x398390[_0x70d5('0x1c')][_0x70d5('0x1e')]||null:null,'limit':_0x398390[_0x70d5('0x1c')]?_0x398390[_0x70d5('0x1c')][_0x70d5('0x1f')]||null:null})[_0x70d5('0x20')](function(_0x211520){logger[_0x70d5('0x12')](_0x70d5('0x21'),_0x398390);logger[_0x70d5('0x22')](_0x70d5('0x21'),_0x398390,JSON[_0x70d5('0x16')](_0x211520));_0x781988(_0x211520);})['catch'](function(_0x1dd001){logger[_0x70d5('0x17')]('UpdateWhatsappInteraction',_0x1dd001[_0x70d5('0x18')],_0x398390);_0x54c8b3(_0x4a4680['error'](0x1f4,_0x1dd001['message']));});});};exports['AddTagsToWhatsappInteraction']=function(_0x2c158a){return new Promise(function(_0x1d48ed,_0x4eb543){return db['WhatsappInteraction'][_0x70d5('0x23')]({'where':_0x2c158a[_0x70d5('0x1c')]?_0x2c158a[_0x70d5('0x1c')][_0x70d5('0x1d')]||null:null})[_0x70d5('0x20')](function(_0x2522d4){if(_0x2522d4){return _0x2522d4[_0x70d5('0x24')](_0x2c158a[_0x70d5('0x1b')]['ids'],_['omit'](_0x2c158a['body'],[_0x70d5('0x25'),'id'])||{});}})[_0x70d5('0x26')](function(_0x362dea){logger[_0x70d5('0x12')](_0x70d5('0x27'),_0x2c158a);logger[_0x70d5('0x22')](_0x70d5('0x27'),_0x2c158a,JSON[_0x70d5('0x16')](_0x362dea));_0x1d48ed(_0x362dea);})['catch'](function(_0x3410ed){logger['error'](_0x70d5('0x27'),_0x3410ed['message'],_0x2c158a);_0x4eb543(_this[_0x70d5('0x17')](0x1f4,_0x3410ed[_0x70d5('0x18')]));});});};
\ No newline at end of file
index ade16e3..22f6fd6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2711=['./whatsappInteraction.events','save','remove','removeListener','register','whatsappInteraction:'];(function(_0x4d0f47,_0x935096){var _0xe6db7c=function(_0x5aa528){while(--_0x5aa528){_0x4d0f47['push'](_0x4d0f47['shift']());}};_0xe6db7c(++_0x935096);}(_0x2711,0x108));var _0x1271=function(_0x387db7,_0x31bfba){_0x387db7=_0x387db7-0x0;var _0xdf85da=_0x2711[_0x387db7];return _0xdf85da;};'use strict';var WhatsappInteractionEvents=require(_0x1271('0x0'));var events=[_0x1271('0x1'),_0x1271('0x2'),'update'];function createListener(_0x367746,_0x3d08f1){return function(_0x2cae0a){_0x3d08f1['emit'](_0x367746,_0x2cae0a);};}function removeListener(_0x52748f,_0x499f62){return function(){WhatsappInteractionEvents[_0x1271('0x3')](_0x52748f,_0x499f62);};}exports[_0x1271('0x4')]=function(_0x41e0bf){for(var _0x4aaa1f=0x0,_0x4c615e=events['length'];_0x4aaa1f<_0x4c615e;_0x4aaa1f++){var _0x53dd79=events[_0x4aaa1f];var _0x1a6a7d=createListener(_0x1271('0x5')+_0x53dd79,_0x41e0bf);WhatsappInteractionEvents['on'](_0x53dd79,_0x1a6a7d);}};
\ No newline at end of file
+var _0x610a=['remove','update','emit','removeListener','register','length','whatsappInteraction:'];(function(_0x27243e,_0x13a780){var _0x16d9bf=function(_0xb87c5a){while(--_0xb87c5a){_0x27243e['push'](_0x27243e['shift']());}};_0x16d9bf(++_0x13a780);}(_0x610a,0x1d5));var _0xa610=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x610a[_0x2dafbe];return _0x58a45a;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=['save',_0xa610('0x0'),_0xa610('0x1')];function createListener(_0x2403c8,_0x319f10){return function(_0x9a4272){_0x319f10[_0xa610('0x2')](_0x2403c8,_0x9a4272);};}function removeListener(_0x399df6,_0x14817b){return function(){WhatsappInteractionEvents[_0xa610('0x3')](_0x399df6,_0x14817b);};}exports[_0xa610('0x4')]=function(_0x3fc060){for(var _0x16b5a8=0x0,_0x236e9d=events[_0xa610('0x5')];_0x16b5a8<_0x236e9d;_0x16b5a8++){var _0x488755=events[_0x16b5a8];var _0x4fa58d=createListener(_0xa610('0x6')+_0x488755,_0x3fc060);WhatsappInteractionEvents['on'](_0x488755,_0x4fa58d);}};
\ No newline at end of file
index 5a1683b..2db7a82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2255=['show','post','tracked','whatsapp','create','/:id/status','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','/:id'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x2255,0x13b));var _0x5225=function(_0x1fd267,_0x164fd1){_0x1fd267=_0x1fd267-0x0;var _0x44c743=_0x2255[_0x1fd267];return _0x44c743;};'use strict';var multer=require(_0x5225('0x0'));var util=require(_0x5225('0x1'));var path=require(_0x5225('0x2'));var timeout=require(_0x5225('0x3'));var express=require(_0x5225('0x4'));var router=express[_0x5225('0x5')]();var fs_extra=require(_0x5225('0x6'));var auth=require(_0x5225('0x7'));var interaction=require(_0x5225('0x8'));var config=require(_0x5225('0x9'));var controller=require('./whatsappMessage.controller');router[_0x5225('0xa')]('/',auth['isAuthenticated'](),controller[_0x5225('0xb')]);router['get'](_0x5225('0xc'),auth[_0x5225('0xd')](),controller['describe']);router[_0x5225('0xa')](_0x5225('0xe'),auth[_0x5225('0xd')](),controller[_0x5225('0xf')]);router[_0x5225('0x10')]('/',auth[_0x5225('0xd')](),interaction[_0x5225('0x11')](_0x5225('0x12'),'whatsappmessage:create'),controller[_0x5225('0x13')]);router[_0x5225('0x10')](_0x5225('0x14'),controller['status']);router[_0x5225('0x15')]('/:id',auth[_0x5225('0xd')](),controller[_0x5225('0x16')]);router[_0x5225('0x15')](_0x5225('0x17'),auth[_0x5225('0xd')](),controller[_0x5225('0x18')]);router[_0x5225('0x15')](_0x5225('0x19'),auth[_0x5225('0xd')](),controller[_0x5225('0x1a')]);router[_0x5225('0x1b')](_0x5225('0xe'),auth['isAuthenticated'](),controller[_0x5225('0x1c')]);module[_0x5225('0x1d')]=router;
\ No newline at end of file
+var _0x0607=['/describe','isAuthenticated','/:id','show','post','tracked','whatsapp','/:id/status','status','update','/:id/accept','accept','put','/:id/reject','reject','delete','destroy','exports','util','express','Router','fs-extra','../../config/environment','./whatsappMessage.controller','get'];(function(_0x174347,_0x1abb36){var _0x2f9c77=function(_0x37a002){while(--_0x37a002){_0x174347['push'](_0x174347['shift']());}};_0x2f9c77(++_0x1abb36);}(_0x0607,0x76));var _0x7060=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x0607[_0x160c73];return _0xd9302;};'use strict';var multer=require('multer');var util=require(_0x7060('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7060('0x1'));var router=express[_0x7060('0x2')]();var fs_extra=require(_0x7060('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7060('0x4'));var controller=require(_0x7060('0x5'));router[_0x7060('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7060('0x6')](_0x7060('0x7'),auth[_0x7060('0x8')](),controller['describe']);router['get'](_0x7060('0x9'),auth[_0x7060('0x8')](),controller[_0x7060('0xa')]);router[_0x7060('0xb')]('/',auth[_0x7060('0x8')](),interaction[_0x7060('0xc')](_0x7060('0xd'),'whatsappmessage:create'),controller['create']);router[_0x7060('0xb')](_0x7060('0xe'),controller[_0x7060('0xf')]);router['put'](_0x7060('0x9'),auth['isAuthenticated'](),controller[_0x7060('0x10')]);router['put'](_0x7060('0x11'),auth[_0x7060('0x8')](),controller[_0x7060('0x12')]);router[_0x7060('0x13')](_0x7060('0x14'),auth[_0x7060('0x8')](),controller[_0x7060('0x15')]);router[_0x7060('0x16')](_0x7060('0x9'),auth['isAuthenticated'](),controller[_0x7060('0x17')]);module[_0x7060('0x18')]=router;
\ No newline at end of file
index 9517139..84b531a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24f5=['TEXT','ENUM','out','STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x24f5,0x1ee));var _0x524f=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x24f5[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x524f('0x0'));module[_0x524f('0x1')]={'body':{'type':Sequelize[_0x524f('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x524f('0x3')]('in',_0x524f('0x4')),'defaultValue':_0x524f('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x524f('0x5')](0xbe)},'phone':{'type':Sequelize[_0x524f('0x5')]},'readAt':{'type':Sequelize[_0x524f('0x6')]},'secret':{'type':Sequelize[_0x524f('0x7')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x524f('0x2')]}};
\ No newline at end of file
+var _0xabb7=['BOOLEAN','TEXT','medium','ENUM','out','STRING','DATE'];(function(_0x3ce3bc,_0x3530af){var _0x31100b=function(_0x2a2f46){while(--_0x2a2f46){_0x3ce3bc['push'](_0x3ce3bc['shift']());}};_0x31100b(++_0x3530af);}(_0xabb7,0x190));var _0x7abb=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xabb7[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x7abb('0x0')](_0x7abb('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x7abb('0x2')]('in',_0x7abb('0x3')),'defaultValue':_0x7abb('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0x7abb('0x4')](0xbe)},'phone':{'type':Sequelize[_0x7abb('0x4')]},'readAt':{'type':Sequelize[_0x7abb('0x5')]},'secret':{'type':Sequelize[_0x7abb('0x6')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index ed1c7da..4028664 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc7a8=['format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','WhatsappInteraction','WhatsappInteractionId','update','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','RejectMessage','rejectMessage','email','rejectmessage','WhatsappAccount','WhatsappAccountId','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','stack','send','map','WhatsappMessage','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','name','options','include','findAll','rows','show','params','includeAll','find','create','body','destroy','describe','whatsapp-interactions','accept','whatsapp','read','readAt'];(function(_0x73e48b,_0x1cbc8c){var _0x232485=function(_0x1e1941){while(--_0x1e1941){_0x73e48b['push'](_0x73e48b['shift']());}};_0x232485(++_0x1cbc8c);}(_0xc7a8,0x1dc));var _0x8c7a=function(_0x4a48ca,_0x6020c1){_0x4a48ca=_0x4a48ca-0x0;var _0x125498=_0xc7a8[_0x4a48ca];return _0x125498;};'use strict';var emlformat=require(_0x8c7a('0x0'));var rimraf=require(_0x8c7a('0x1'));var zipdir=require(_0x8c7a('0x2'));var jsonpatch=require(_0x8c7a('0x3'));var rp=require('request-promise');var moment=require(_0x8c7a('0x4'));var BPromise=require(_0x8c7a('0x5'));var Mustache=require(_0x8c7a('0x6'));var util=require('util');var path=require(_0x8c7a('0x7'));var sox=require(_0x8c7a('0x8'));var csv=require('to-csv');var ejs=require(_0x8c7a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8c7a('0xa'));var jsforce=require(_0x8c7a('0xb'));var deskjs=require(_0x8c7a('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8c7a('0xd'));var authService=require(_0x8c7a('0xe'));var qs=require(_0x8c7a('0xf'));var as=require(_0x8c7a('0x10'));var hardwareService=require(_0x8c7a('0x11'));var logger=require(_0x8c7a('0x12'))(_0x8c7a('0x13'));var utils=require(_0x8c7a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8c7a('0x15'));var db=require('../../mysqldb')['db'];config[_0x8c7a('0x16')]=_[_0x8c7a('0x17')](config[_0x8c7a('0x16')],{'host':_0x8c7a('0x18'),'port':0x18eb});var socket=require(_0x8c7a('0x19'))(new Redis(config[_0x8c7a('0x16')]));require(_0x8c7a('0x1a'))[_0x8c7a('0x1b')](socket);var jayson=require(_0x8c7a('0x1c'));var client=jayson[_0x8c7a('0x1d')][_0x8c7a('0x1e')]({'port':0x232c});var client9002=jayson[_0x8c7a('0x1d')][_0x8c7a('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x5398be,_0x5a6af2,_0x5621bb,_0x436e80){return new BPromise(function(_0x258f09,_0x594d15){var _0xbafa1f=_0x436e80||client;return _0xbafa1f[_0x8c7a('0x1f')](_0x5398be,_0x5621bb)[_0x8c7a('0x20')](function(_0x49bf3c){logger[_0x8c7a('0x21')](_0x8c7a('0x22'),_0x5a6af2,_0x8c7a('0x23'));logger['debug'](_0x8c7a('0x24'),_0x5a6af2,'request\x20sent',JSON[_0x8c7a('0x25')](_0x49bf3c));if(_0x49bf3c['error']){if(_0x49bf3c[_0x8c7a('0x26')][_0x8c7a('0x27')]===0x1f4){logger[_0x8c7a('0x26')](_0x8c7a('0x22'),_0x5a6af2,_0x49bf3c[_0x8c7a('0x26')][_0x8c7a('0x28')]);return _0x594d15(_0x49bf3c[_0x8c7a('0x26')][_0x8c7a('0x28')]);}logger[_0x8c7a('0x26')](_0x8c7a('0x22'),_0x5a6af2,_0x49bf3c[_0x8c7a('0x26')][_0x8c7a('0x28')]);return _0x258f09(_0x49bf3c[_0x8c7a('0x26')][_0x8c7a('0x28')]);}else{logger[_0x8c7a('0x21')]('WhatsappMessage,\x20%s,\x20%s',_0x5a6af2,_0x8c7a('0x23'));_0x258f09(_0x49bf3c['result'][_0x8c7a('0x28')]);}})[_0x8c7a('0x29')](function(_0x132718){logger[_0x8c7a('0x26')](_0x8c7a('0x22'),_0x5a6af2,_0x132718);_0x594d15(_0x132718);});});}function respondWithStatusCode(_0x4fce9e,_0x26c331){_0x26c331=_0x26c331||0xcc;return function(_0x3188e1){if(_0x3188e1){return _0x4fce9e[_0x8c7a('0x2a')](_0x26c331);}return _0x4fce9e[_0x8c7a('0x2b')](_0x26c331)[_0x8c7a('0x2c')]();};}function respondWithResult(_0x3cc2ce,_0x5d43f7){_0x5d43f7=_0x5d43f7||0xc8;return function(_0x203ebc){if(_0x203ebc){return _0x3cc2ce[_0x8c7a('0x2b')](_0x5d43f7)[_0x8c7a('0x2d')](_0x203ebc);}};}function respondWithFilteredResult(_0x48373f,_0x5a2f2e){return function(_0x17e86a){if(_0x17e86a){var _0x234e84=typeof _0x5a2f2e[_0x8c7a('0x2e')]===_0x8c7a('0x2f')&&typeof _0x5a2f2e[_0x8c7a('0x30')]===_0x8c7a('0x2f');var _0xe2c347=_0x17e86a[_0x8c7a('0x31')];var _0x458154=_0x234e84?0x0:_0x5a2f2e['offset'];var _0x1088fd=_0x234e84?_0x17e86a[_0x8c7a('0x31')]:_0x5a2f2e[_0x8c7a('0x2e')]+_0x5a2f2e[_0x8c7a('0x30')];var _0x603244;if(_0x1088fd>=_0xe2c347){_0x1088fd=_0xe2c347;_0x603244=0xc8;}else{_0x603244=0xce;}_0x48373f[_0x8c7a('0x2b')](_0x603244);return _0x48373f[_0x8c7a('0x32')](_0x8c7a('0x33'),_0x458154+'-'+_0x1088fd+'/'+_0xe2c347)[_0x8c7a('0x2d')](_0x17e86a);}return null;};}function patchUpdates(_0x511759){return function(_0xe2be92){try{jsonpatch[_0x8c7a('0x34')](_0xe2be92,_0x511759,!![]);}catch(_0x52ad1f){return BPromise[_0x8c7a('0x35')](_0x52ad1f);}return _0xe2be92['save']();};}function saveUpdates(_0x582f7e,_0x391a47){return function(_0x22cb1d){if(_0x22cb1d){return _0x22cb1d['update'](_0x582f7e)[_0x8c7a('0x20')](function(_0x4a8b10){return _0x4a8b10;});}return null;};}function removeEntity(_0x51e24b,_0x151702){return function(_0x51a1d1){if(_0x51a1d1){return _0x51a1d1['destroy']()[_0x8c7a('0x20')](function(){_0x51e24b[_0x8c7a('0x2b')](0xcc)[_0x8c7a('0x2c')]();});}};}function handleEntityNotFound(_0x4f1189,_0xa51cb4){return function(_0x305594){if(!_0x305594){_0x4f1189[_0x8c7a('0x2a')](0x194);}return _0x305594;};}function handleError(_0x30387c,_0x4cd056){_0x4cd056=_0x4cd056||0x1f4;return function(_0x209512){logger[_0x8c7a('0x26')](_0x209512[_0x8c7a('0x36')]);if(_0x209512['name']){delete _0x209512['name'];}_0x30387c[_0x8c7a('0x2b')](_0x4cd056)[_0x8c7a('0x37')](_0x209512);};}exports['index']=function(_0x14d8b3,_0x13ab6b){var _0x38cc9d={},_0x352c75={},_0x125a04={'count':0x0,'rows':[]};var _0x19929a=_[_0x8c7a('0x38')](db[_0x8c7a('0x39')][_0x8c7a('0x3a')],function(_0x231d48){return{'name':_0x231d48[_0x8c7a('0x3b')],'type':_0x231d48[_0x8c7a('0x3c')][_0x8c7a('0x3d')]};});_0x352c75['model']=_[_0x8c7a('0x38')](_0x19929a,'name');_0x352c75[_0x8c7a('0x3e')]=_[_0x8c7a('0x3f')](_0x14d8b3[_0x8c7a('0x3e')]);_0x352c75[_0x8c7a('0x40')]=_['intersection'](_0x352c75['model'],_0x352c75[_0x8c7a('0x3e')]);_0x38cc9d[_0x8c7a('0x41')]=_[_0x8c7a('0x42')](_0x352c75[_0x8c7a('0x43')],qs[_0x8c7a('0x44')](_0x14d8b3[_0x8c7a('0x3e')][_0x8c7a('0x44')]));_0x38cc9d[_0x8c7a('0x41')]=_0x38cc9d[_0x8c7a('0x41')][_0x8c7a('0x45')]?_0x38cc9d[_0x8c7a('0x41')]:_0x352c75[_0x8c7a('0x43')];if(!_0x14d8b3[_0x8c7a('0x3e')][_0x8c7a('0x46')](_0x8c7a('0x47'))){_0x38cc9d[_0x8c7a('0x30')]=qs[_0x8c7a('0x30')](_0x14d8b3[_0x8c7a('0x3e')]['limit']);_0x38cc9d[_0x8c7a('0x2e')]=qs['offset'](_0x14d8b3[_0x8c7a('0x3e')]['offset']);}_0x38cc9d['order']=qs[_0x8c7a('0x48')](_0x14d8b3[_0x8c7a('0x3e')][_0x8c7a('0x48')]);_0x38cc9d[_0x8c7a('0x49')]=qs[_0x8c7a('0x40')](_[_0x8c7a('0x4a')](_0x14d8b3['query'],_0x352c75['filters']),_0x19929a);if(_0x14d8b3[_0x8c7a('0x3e')][_0x8c7a('0x4b')]){_0x38cc9d[_0x8c7a('0x49')]=_[_0x8c7a('0x4c')](_0x38cc9d[_0x8c7a('0x49')],{'$or':_[_0x8c7a('0x38')](_0x19929a,function(_0x557cbc){if(_0x557cbc[_0x8c7a('0x3c')]!==_0x8c7a('0x4d')){var _0x510683={};_0x510683[_0x557cbc[_0x8c7a('0x4e')]]={'$like':'%'+_0x14d8b3[_0x8c7a('0x3e')]['filter']+'%'};return _0x510683;}})});}_0x38cc9d=_[_0x8c7a('0x4c')]({},_0x38cc9d,_0x14d8b3[_0x8c7a('0x4f')]);var _0x786e5d={'where':_0x38cc9d['where']};return db[_0x8c7a('0x39')][_0x8c7a('0x31')](_0x786e5d)[_0x8c7a('0x20')](function(_0x31ee02){_0x125a04[_0x8c7a('0x31')]=_0x31ee02;if(_0x14d8b3['query']['includeAll']){_0x38cc9d[_0x8c7a('0x50')]=[{'all':!![]}];}return db[_0x8c7a('0x39')][_0x8c7a('0x51')](_0x38cc9d);})[_0x8c7a('0x20')](function(_0x45b51f){_0x125a04[_0x8c7a('0x52')]=_0x45b51f;return _0x125a04;})['then'](respondWithFilteredResult(_0x13ab6b,_0x38cc9d))[_0x8c7a('0x29')](handleError(_0x13ab6b,null));};exports[_0x8c7a('0x53')]=function(_0x3b210d,_0x3124e3){var _0x2a4b53={'raw':!![],'where':{'id':_0x3b210d[_0x8c7a('0x54')]['id']}},_0x3fe0c8={};_0x3fe0c8[_0x8c7a('0x43')]=_[_0x8c7a('0x3f')](db[_0x8c7a('0x39')]['rawAttributes']);_0x3fe0c8[_0x8c7a('0x3e')]=_[_0x8c7a('0x3f')](_0x3b210d[_0x8c7a('0x3e')]);_0x3fe0c8[_0x8c7a('0x40')]=_[_0x8c7a('0x42')](_0x3fe0c8['model'],_0x3fe0c8['query']);_0x2a4b53[_0x8c7a('0x41')]=_[_0x8c7a('0x42')](_0x3fe0c8[_0x8c7a('0x43')],qs[_0x8c7a('0x44')](_0x3b210d[_0x8c7a('0x3e')]['fields']));_0x2a4b53[_0x8c7a('0x41')]=_0x2a4b53[_0x8c7a('0x41')][_0x8c7a('0x45')]?_0x2a4b53[_0x8c7a('0x41')]:_0x3fe0c8[_0x8c7a('0x43')];if(_0x3b210d['query'][_0x8c7a('0x55')]){_0x2a4b53['include']=[{'all':!![]}];}_0x2a4b53=_[_0x8c7a('0x4c')]({},_0x2a4b53,_0x3b210d[_0x8c7a('0x4f')]);return db[_0x8c7a('0x39')][_0x8c7a('0x56')](_0x2a4b53)[_0x8c7a('0x20')](handleEntityNotFound(_0x3124e3,null))[_0x8c7a('0x20')](respondWithResult(_0x3124e3,null))[_0x8c7a('0x29')](handleError(_0x3124e3,null));};exports[_0x8c7a('0x57')]=function(_0x21ec47,_0x367ff1){return db[_0x8c7a('0x39')][_0x8c7a('0x57')](_0x21ec47['body'],{})[_0x8c7a('0x20')](respondWithResult(_0x367ff1,0xc9))[_0x8c7a('0x29')](handleError(_0x367ff1,null));};exports['update']=function(_0x1e1781,_0x1b1d8e){if(_0x1e1781[_0x8c7a('0x58')]['id']){delete _0x1e1781['body']['id'];}return db[_0x8c7a('0x39')][_0x8c7a('0x56')]({'where':{'id':_0x1e1781[_0x8c7a('0x54')]['id']}})[_0x8c7a('0x20')](handleEntityNotFound(_0x1b1d8e,null))[_0x8c7a('0x20')](saveUpdates(_0x1e1781[_0x8c7a('0x58')],null))[_0x8c7a('0x20')](respondWithResult(_0x1b1d8e,null))[_0x8c7a('0x29')](handleError(_0x1b1d8e,null));};exports[_0x8c7a('0x59')]=function(_0x1f732c,_0x465299){return db[_0x8c7a('0x39')]['find']({'where':{'id':_0x1f732c['params']['id']}})['then'](handleEntityNotFound(_0x465299,null))['then'](removeEntity(_0x465299,null))[_0x8c7a('0x29')](handleError(_0x465299,null));};exports[_0x8c7a('0x5a')]=function(_0x3af521,_0x7a4ec){return db[_0x8c7a('0x39')]['describe']()['then'](respondWithResult(_0x7a4ec,null))[_0x8c7a('0x29')](handleError(_0x7a4ec,null));};var interaction_log=require(_0x8c7a('0x12'))(_0x8c7a('0x5b'));exports[_0x8c7a('0x5c')]=function(_0x43fa78,_0x578f62,_0x39783c){var _0xc4d0cc={'agent':{},'channel':_0x8c7a('0x5d')};if(_0x43fa78[_0x8c7a('0x58')]['id']){delete _0x43fa78[_0x8c7a('0x58')]['id'];}_0x43fa78[_0x8c7a('0x58')][_0x8c7a('0x5e')]=!![];_0x43fa78['body'][_0x8c7a('0x5f')]=moment()[_0x8c7a('0x60')](_0x8c7a('0x61'));_0x43fa78['body']['UserId']=_0x43fa78[_0x8c7a('0x58')][_0x8c7a('0x62')]||_0x43fa78['user']['id'];_0xc4d0cc['agent']['id']=_0x43fa78[_0x8c7a('0x58')][_0x8c7a('0x62')];return db[_0x8c7a('0x39')][_0x8c7a('0x56')]({'where':{'id':_0x43fa78[_0x8c7a('0x54')]['id'],'UserId':null}})[_0x8c7a('0x20')](handleEntityNotFound(_0x578f62,null))[_0x8c7a('0x20')](saveUpdates(_0x43fa78['body'],null))[_0x8c7a('0x20')](function(_0x38561c){if(_0x38561c){_0xc4d0cc[_0x8c7a('0x28')]=_0x38561c[_0x8c7a('0x63')]({'plain':!![]});return db[_0x8c7a('0x64')][_0x8c7a('0x56')]({'where':{'id':_0x38561c[_0x8c7a('0x65')]}});}return null;})[_0x8c7a('0x20')](handleEntityNotFound(_0x578f62,null))['then'](function(_0x2514c1){if(_0x2514c1){return _0x2514c1[_0x8c7a('0x66')]({'UserId':_0x43fa78[_0x8c7a('0x58')][_0x8c7a('0x62')],'read1stAt':_[_0x8c7a('0x67')](_0x2514c1[_0x8c7a('0x68')])?moment()['format'](_0x8c7a('0x61')):undefined});}return null;})[_0x8c7a('0x20')](function(_0x19629d){if(_0x19629d){_0xc4d0cc[_0x8c7a('0x69')]=_0x19629d[_0x8c7a('0x63')]({'plain':!![]});interaction_log[_0x8c7a('0x21')](_0x8c7a('0x6a'),_0x43fa78[_0x8c7a('0x6b')]['id'],_0x43fa78['user'][_0x8c7a('0x4e')],_0x43fa78[_0x8c7a('0x6b')][_0x8c7a('0x6c')],_0xc4d0cc['interaction']['id'],_0x43fa78[_0x8c7a('0x58')]?JSON[_0x8c7a('0x25')](_0x43fa78['body']):'null');return respondWithRpcPromise(_0x8c7a('0x6d'),'acceptMessage',_0xc4d0cc);}return null;})['then'](function(_0x21c12e){var _0x5d8186=_0x8c7a('0x6e')+_0x21c12e[_0x8c7a('0x28')][_0x8c7a('0x6f')];return db[_0x8c7a('0x70')][_0x8c7a('0x3e')](_0x5d8186,{'type':db[_0x8c7a('0x71')][_0x8c7a('0x72')][_0x8c7a('0x73')],'raw':!![]})['then'](function(_0xa4bcf7){return _0xa4bcf7;});})['then'](function(_0x59f870){if(_0x59f870){_0xc4d0cc[_0x8c7a('0x28')][_0x8c7a('0x74')]=_0x59f870[0x0];if(!_0x43fa78[_0x8c7a('0x58')][_0x8c7a('0x62')])return;return db[_0x8c7a('0x75')][_0x8c7a('0x56')]({'where':{'id':_0x43fa78[_0x8c7a('0x58')][_0x8c7a('0x62')],'role':_0x8c7a('0x76')},'attributes':['id',_0x8c7a('0x4e'),_0x8c7a('0x77'),'email',_0x8c7a('0x78')],'raw':!![]});}return null;})[_0x8c7a('0x20')](function(_0x552b59){if(!_0x552b59)return null;_0xc4d0cc['message'][_0x8c7a('0x76')]=_0x552b59;return _0xc4d0cc;})[_0x8c7a('0x20')](function(_0x433753){if(_0x433753){if(_0x43fa78[_0x8c7a('0x58')][_0x8c7a('0x79')]){_0xc4d0cc[_0x8c7a('0x28')][_0x8c7a('0x7a')]=util[_0x8c7a('0x60')](_0x8c7a('0x7b'),_0x43fa78[_0x8c7a('0x6b')][_0x8c7a('0x4e')]);_0xc4d0cc[_0x8c7a('0x28')][_0x8c7a('0x7c')]=_0xc4d0cc[_0x8c7a('0x7c')];_0xc4d0cc[_0x8c7a('0x28')][_0x8c7a('0x7d')]=_0xc4d0cc[_0x8c7a('0x7c')];_0xc4d0cc[_0x8c7a('0x28')][_0x8c7a('0x7e')]=_0x8c7a('0x5c');return respondWithRpcPromise('EventManager',_0x8c7a('0x7f'),{'event':_0x8c7a('0x80'),'message':_0xc4d0cc[_0x8c7a('0x28')]},client9002)['then'](function(){return _0xc4d0cc;});}return _0xc4d0cc;}return null;})[_0x8c7a('0x20')](respondWithResult(_0x578f62,null))[_0x8c7a('0x29')](handleError(_0x578f62,null));};var interaction_log=require(_0x8c7a('0x12'))(_0x8c7a('0x5b'));exports[_0x8c7a('0x35')]=function(_0x3ea774,_0x252106,_0x5e41dd){var _0x562d22={'agent':{},'channel':'whatsapp'};if(_0x3ea774['body']['id']){delete _0x3ea774[_0x8c7a('0x58')]['id'];}_0x3ea774[_0x8c7a('0x58')][_0x8c7a('0x62')]=_0x3ea774[_0x8c7a('0x58')][_0x8c7a('0x62')]||_0x3ea774['user']['id'];_0x562d22[_0x8c7a('0x76')]['id']=_0x3ea774[_0x8c7a('0x58')][_0x8c7a('0x62')];return db[_0x8c7a('0x39')]['find']({'where':{'id':_0x3ea774[_0x8c7a('0x54')]['id'],'UserId':null}})[_0x8c7a('0x20')](handleEntityNotFound(_0x252106,null))[_0x8c7a('0x20')](function(_0x56703f){if(_0x56703f){_0x562d22[_0x8c7a('0x28')]=_0x56703f['get']({'plain':!![]});return db[_0x8c7a('0x64')][_0x8c7a('0x56')]({'where':{'id':_0x56703f[_0x8c7a('0x65')]}});}return null;})[_0x8c7a('0x20')](handleEntityNotFound(_0x252106,null))[_0x8c7a('0x20')](function(_0x565a16){if(_0x565a16){_0x562d22[_0x8c7a('0x69')]=_0x565a16['get']({'plain':!![]});interaction_log[_0x8c7a('0x21')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3ea774[_0x8c7a('0x6b')]['id'],_0x3ea774[_0x8c7a('0x6b')]['name'],_0x3ea774['user'][_0x8c7a('0x6c')],_0x562d22[_0x8c7a('0x69')]['id'],_0x3ea774['body']?JSON[_0x8c7a('0x25')](_0x3ea774[_0x8c7a('0x58')]):'null');return respondWithRpcPromise(_0x8c7a('0x81'),_0x8c7a('0x82'),_0x562d22);}return null;})['then'](function(_0x20f54d){var _0x240be5=_0x8c7a('0x6e')+_0x20f54d[_0x8c7a('0x28')][_0x8c7a('0x6f')];return db[_0x8c7a('0x70')]['query'](_0x240be5,{'type':db[_0x8c7a('0x71')][_0x8c7a('0x72')]['SELECT'],'raw':!![]})['then'](function(_0x58dca9){return _0x58dca9;});})['then'](function(_0x123b41){if(_0x123b41){_0x562d22[_0x8c7a('0x28')][_0x8c7a('0x74')]=_0x123b41[0x0];if(!_0x3ea774[_0x8c7a('0x58')][_0x8c7a('0x62')])return;return db['User']['find']({'where':{'id':_0x3ea774[_0x8c7a('0x58')]['UserId'],'role':_0x8c7a('0x76')},'attributes':['id',_0x8c7a('0x4e'),_0x8c7a('0x77'),_0x8c7a('0x83'),'internal'],'raw':!![]});}return null;})['then'](function(_0x4cc3ba){if(!_0x4cc3ba)return null;_0x562d22['message'][_0x8c7a('0x76')]=_0x4cc3ba;return _0x562d22;})[_0x8c7a('0x20')](function(_0x38e7cf){if(_0x38e7cf){_0x38e7cf[_0x8c7a('0x28')]['interface']=util[_0x8c7a('0x60')]('SIP/%s',_0x3ea774['user'][_0x8c7a('0x4e')]);_0x38e7cf[_0x8c7a('0x28')][_0x8c7a('0x7c')]=_0x562d22[_0x8c7a('0x7c')];_0x38e7cf['message'][_0x8c7a('0x7d')]=_0x562d22[_0x8c7a('0x7c')];_0x38e7cf[_0x8c7a('0x28')]['event']='reject';respondWithRpcPromise(_0x8c7a('0x7f'),_0x8c7a('0x7f'),{'event':_0x8c7a('0x84'),'message':_0x38e7cf[_0x8c7a('0x28')]},client9002);return _0x562d22;}return null;})['then'](respondWithResult(_0x252106,null))[_0x8c7a('0x29')](handleError(_0x252106,null));};exports['status']=function(_0x4c6ef5,_0x32b680,_0x4a7b07){if(_0x4c6ef5[_0x8c7a('0x58')]['id']){delete _0x4c6ef5[_0x8c7a('0x58')]['id'];}var _0x23d3b2;return db[_0x8c7a('0x39')][_0x8c7a('0x56')]({'where':{'id':_0x4c6ef5[_0x8c7a('0x54')]['id']}})['then'](handleEntityNotFound(_0x32b680,null))[_0x8c7a('0x20')](function(_0x129589){if(_0x129589){_0x23d3b2=_0x129589;return db[_0x8c7a('0x85')]['find']({'where':{'id':_0x129589[_0x8c7a('0x86')]}});}})[_0x8c7a('0x20')](handleEntityNotFound(_0x32b680,null))['then'](function(_0x111418){if(_0x111418){logger[_0x8c7a('0x87')](_0x8c7a('0x88'),_0x8c7a('0x2b'),'received\x20delivery\x20report\x20from',_0x111418[_0x8c7a('0x3c')],util['inspect'](_0x4c6ef5[_0x8c7a('0x58')],{'showHidden':![],'depth':null}));switch(_0x111418[_0x8c7a('0x3c')]){case _0x8c7a('0x89'):if(_0x4c6ef5['body'][_0x8c7a('0x8a')]&&_0x4c6ef5[_0x8c7a('0x58')][_0x8c7a('0x8a')]===_0x23d3b2[_0x8c7a('0x8b')]&&_0x4c6ef5['body'][_0x8c7a('0x8c')]&&_0x4c6ef5[_0x8c7a('0x58')][_0x8c7a('0x8c')]==='read'){return _0x23d3b2['update']({'read':!![]});}else{logger[_0x8c7a('0x26')](_0x8c7a('0x8d'),_0x8c7a('0x2b'),_0x8c7a('0x89'),util[_0x8c7a('0x8e')](_0x4c6ef5[_0x8c7a('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x23d3b2;}})[_0x8c7a('0x20')](respondWithResult(_0x32b680,null))[_0x8c7a('0x29')](handleError(_0x32b680,null));};
\ No newline at end of file
+var _0x8efd=['json','apply','reject','save','update','destroy','stack','name','send','index','map','rawAttributes','type','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','WhatsappMessage','includeAll','include','findAll','show','params','find','create','body','describe','whatsapp-interactions','accept','whatsapp','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','WhatsappInteraction','WhatsappInteractionId','format','interaction','get','[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','QueryTypes','contact','User','agent','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','../../config/logger','RejectMessage','Sequelize','SELECT','fullname','event','rejectmessage','WhatsappAccount','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x8efd,0xe0));var _0xd8ef=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x8efd[_0x5d6456];return _0x4d66c1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd8ef('0x0'));var zipdir=require(_0xd8ef('0x1'));var jsonpatch=require(_0xd8ef('0x2'));var rp=require(_0xd8ef('0x3'));var moment=require('moment');var BPromise=require(_0xd8ef('0x4'));var Mustache=require(_0xd8ef('0x5'));var util=require('util');var path=require(_0xd8ef('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd8ef('0x7'));var fs=require('fs');var fs_extra=require(_0xd8ef('0x8'));var _=require('lodash');var squel=require(_0xd8ef('0x9'));var crypto=require('crypto');var jsforce=require(_0xd8ef('0xa'));var deskjs=require(_0xd8ef('0xb'));var toCsv=require(_0xd8ef('0xc'));var querystring=require(_0xd8ef('0xd'));var Papa=require(_0xd8ef('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd8ef('0xf'));var as=require(_0xd8ef('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd8ef('0x11'));var utils=require(_0xd8ef('0x12'));var config=require(_0xd8ef('0x13'));var licenseUtil=require(_0xd8ef('0x14'));var db=require('../../mysqldb')['db'];config[_0xd8ef('0x15')]=_[_0xd8ef('0x16')](config[_0xd8ef('0x15')],{'host':_0xd8ef('0x17'),'port':0x18eb});var socket=require(_0xd8ef('0x18'))(new Redis(config[_0xd8ef('0x15')]));require(_0xd8ef('0x19'))['register'](socket);var jayson=require(_0xd8ef('0x1a'));var client=jayson[_0xd8ef('0x1b')][_0xd8ef('0x1c')]({'port':0x232c});var client9002=jayson[_0xd8ef('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45cf55,_0x4cb31d,_0x3872a2,_0x41705b){return new BPromise(function(_0x403a31,_0x1b28b8){var _0x20e0a9=_0x41705b||client;return _0x20e0a9[_0xd8ef('0x1d')](_0x45cf55,_0x3872a2)[_0xd8ef('0x1e')](function(_0x4e0066){logger[_0xd8ef('0x1f')]('WhatsappMessage,\x20%s,\x20%s',_0x4cb31d,'request\x20sent');logger['debug'](_0xd8ef('0x20'),_0x4cb31d,_0xd8ef('0x21'),JSON[_0xd8ef('0x22')](_0x4e0066));if(_0x4e0066[_0xd8ef('0x23')]){if(_0x4e0066['error'][_0xd8ef('0x24')]===0x1f4){logger[_0xd8ef('0x23')](_0xd8ef('0x25'),_0x4cb31d,_0x4e0066['error'][_0xd8ef('0x26')]);return _0x1b28b8(_0x4e0066[_0xd8ef('0x23')]['message']);}logger['error'](_0xd8ef('0x25'),_0x4cb31d,_0x4e0066[_0xd8ef('0x23')]['message']);return _0x403a31(_0x4e0066[_0xd8ef('0x23')]['message']);}else{logger[_0xd8ef('0x1f')]('WhatsappMessage,\x20%s,\x20%s',_0x4cb31d,_0xd8ef('0x21'));_0x403a31(_0x4e0066[_0xd8ef('0x27')][_0xd8ef('0x26')]);}})[_0xd8ef('0x28')](function(_0xde1a8){logger['error'](_0xd8ef('0x25'),_0x4cb31d,_0xde1a8);_0x1b28b8(_0xde1a8);});});}function respondWithStatusCode(_0x4d955f,_0xce6db){_0xce6db=_0xce6db||0xcc;return function(_0x407b6e){if(_0x407b6e){return _0x4d955f[_0xd8ef('0x29')](_0xce6db);}return _0x4d955f['status'](_0xce6db)[_0xd8ef('0x2a')]();};}function respondWithResult(_0x10e799,_0x56dc46){_0x56dc46=_0x56dc46||0xc8;return function(_0x420a79){if(_0x420a79){return _0x10e799[_0xd8ef('0x2b')](_0x56dc46)['json'](_0x420a79);}};}function respondWithFilteredResult(_0x3f97fc,_0x36b4c8){return function(_0x21c331){if(_0x21c331){var _0x19e6e1=typeof _0x36b4c8[_0xd8ef('0x2c')]===_0xd8ef('0x2d')&&typeof _0x36b4c8[_0xd8ef('0x2e')]===_0xd8ef('0x2d');var _0xa5ea80=_0x21c331[_0xd8ef('0x2f')];var _0x1dd164=_0x19e6e1?0x0:_0x36b4c8[_0xd8ef('0x2c')];var _0xe0d188=_0x19e6e1?_0x21c331[_0xd8ef('0x2f')]:_0x36b4c8['offset']+_0x36b4c8[_0xd8ef('0x2e')];var _0xc53149;if(_0xe0d188>=_0xa5ea80){_0xe0d188=_0xa5ea80;_0xc53149=0xc8;}else{_0xc53149=0xce;}_0x3f97fc['status'](_0xc53149);return _0x3f97fc[_0xd8ef('0x30')](_0xd8ef('0x31'),_0x1dd164+'-'+_0xe0d188+'/'+_0xa5ea80)[_0xd8ef('0x32')](_0x21c331);}return null;};}function patchUpdates(_0x35d3fa){return function(_0x1b7af5){try{jsonpatch[_0xd8ef('0x33')](_0x1b7af5,_0x35d3fa,!![]);}catch(_0x362de6){return BPromise[_0xd8ef('0x34')](_0x362de6);}return _0x1b7af5[_0xd8ef('0x35')]();};}function saveUpdates(_0x57c8b,_0x4f6871){return function(_0x26a78e){if(_0x26a78e){return _0x26a78e[_0xd8ef('0x36')](_0x57c8b)[_0xd8ef('0x1e')](function(_0x27ddf6){return _0x27ddf6;});}return null;};}function removeEntity(_0x1e553f,_0xb58b2a){return function(_0x54561b){if(_0x54561b){return _0x54561b[_0xd8ef('0x37')]()[_0xd8ef('0x1e')](function(){_0x1e553f[_0xd8ef('0x2b')](0xcc)[_0xd8ef('0x2a')]();});}};}function handleEntityNotFound(_0x3e00c3,_0x1144da){return function(_0x5d7225){if(!_0x5d7225){_0x3e00c3[_0xd8ef('0x29')](0x194);}return _0x5d7225;};}function handleError(_0x2d2701,_0x4049b8){_0x4049b8=_0x4049b8||0x1f4;return function(_0xc6724e){logger['error'](_0xc6724e[_0xd8ef('0x38')]);if(_0xc6724e[_0xd8ef('0x39')]){delete _0xc6724e[_0xd8ef('0x39')];}_0x2d2701[_0xd8ef('0x2b')](_0x4049b8)[_0xd8ef('0x3a')](_0xc6724e);};}exports[_0xd8ef('0x3b')]=function(_0x43c9e8,_0x34a49f){var _0x27482a={},_0x354fc8={},_0x527b44={'count':0x0,'rows':[]};var _0x40b58f=_[_0xd8ef('0x3c')](db['WhatsappMessage'][_0xd8ef('0x3d')],function(_0x1f02a8){return{'name':_0x1f02a8['fieldName'],'type':_0x1f02a8[_0xd8ef('0x3e')][_0xd8ef('0x3f')]};});_0x354fc8[_0xd8ef('0x40')]=_[_0xd8ef('0x3c')](_0x40b58f,'name');_0x354fc8['query']=_[_0xd8ef('0x41')](_0x43c9e8['query']);_0x354fc8[_0xd8ef('0x42')]=_[_0xd8ef('0x43')](_0x354fc8[_0xd8ef('0x40')],_0x354fc8[_0xd8ef('0x44')]);_0x27482a[_0xd8ef('0x45')]=_[_0xd8ef('0x43')](_0x354fc8[_0xd8ef('0x40')],qs['fields'](_0x43c9e8[_0xd8ef('0x44')][_0xd8ef('0x46')]));_0x27482a[_0xd8ef('0x45')]=_0x27482a[_0xd8ef('0x45')][_0xd8ef('0x47')]?_0x27482a[_0xd8ef('0x45')]:_0x354fc8['model'];if(!_0x43c9e8['query']['hasOwnProperty'](_0xd8ef('0x48'))){_0x27482a[_0xd8ef('0x2e')]=qs['limit'](_0x43c9e8[_0xd8ef('0x44')][_0xd8ef('0x2e')]);_0x27482a[_0xd8ef('0x2c')]=qs[_0xd8ef('0x2c')](_0x43c9e8['query'][_0xd8ef('0x2c')]);}_0x27482a[_0xd8ef('0x49')]=qs['sort'](_0x43c9e8[_0xd8ef('0x44')][_0xd8ef('0x4a')]);_0x27482a['where']=qs[_0xd8ef('0x42')](_[_0xd8ef('0x4b')](_0x43c9e8[_0xd8ef('0x44')],_0x354fc8[_0xd8ef('0x42')]),_0x40b58f);if(_0x43c9e8['query'][_0xd8ef('0x4c')]){_0x27482a['where']=_[_0xd8ef('0x4d')](_0x27482a[_0xd8ef('0x4e')],{'$or':_[_0xd8ef('0x3c')](_0x40b58f,function(_0x3a243b){if(_0x3a243b[_0xd8ef('0x3e')]!==_0xd8ef('0x4f')){var _0x293235={};_0x293235[_0x3a243b[_0xd8ef('0x39')]]={'$like':'%'+_0x43c9e8['query']['filter']+'%'};return _0x293235;}})});}_0x27482a=_[_0xd8ef('0x4d')]({},_0x27482a,_0x43c9e8[_0xd8ef('0x50')]);var _0x157e50={'where':_0x27482a[_0xd8ef('0x4e')]};return db[_0xd8ef('0x51')]['count'](_0x157e50)[_0xd8ef('0x1e')](function(_0x40445e){_0x527b44[_0xd8ef('0x2f')]=_0x40445e;if(_0x43c9e8[_0xd8ef('0x44')][_0xd8ef('0x52')]){_0x27482a[_0xd8ef('0x53')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xd8ef('0x54')](_0x27482a);})[_0xd8ef('0x1e')](function(_0x37bf58){_0x527b44['rows']=_0x37bf58;return _0x527b44;})[_0xd8ef('0x1e')](respondWithFilteredResult(_0x34a49f,_0x27482a))[_0xd8ef('0x28')](handleError(_0x34a49f,null));};exports[_0xd8ef('0x55')]=function(_0x17342f,_0x5d175b){var _0x1dbe2c={'raw':!![],'where':{'id':_0x17342f[_0xd8ef('0x56')]['id']}},_0x15703b={};_0x15703b[_0xd8ef('0x40')]=_[_0xd8ef('0x41')](db['WhatsappMessage'][_0xd8ef('0x3d')]);_0x15703b['query']=_[_0xd8ef('0x41')](_0x17342f[_0xd8ef('0x44')]);_0x15703b['filters']=_[_0xd8ef('0x43')](_0x15703b[_0xd8ef('0x40')],_0x15703b['query']);_0x1dbe2c[_0xd8ef('0x45')]=_[_0xd8ef('0x43')](_0x15703b[_0xd8ef('0x40')],qs[_0xd8ef('0x46')](_0x17342f[_0xd8ef('0x44')][_0xd8ef('0x46')]));_0x1dbe2c['attributes']=_0x1dbe2c[_0xd8ef('0x45')][_0xd8ef('0x47')]?_0x1dbe2c[_0xd8ef('0x45')]:_0x15703b[_0xd8ef('0x40')];if(_0x17342f[_0xd8ef('0x44')]['includeAll']){_0x1dbe2c[_0xd8ef('0x53')]=[{'all':!![]}];}_0x1dbe2c=_['merge']({},_0x1dbe2c,_0x17342f[_0xd8ef('0x50')]);return db[_0xd8ef('0x51')][_0xd8ef('0x57')](_0x1dbe2c)['then'](handleEntityNotFound(_0x5d175b,null))[_0xd8ef('0x1e')](respondWithResult(_0x5d175b,null))[_0xd8ef('0x28')](handleError(_0x5d175b,null));};exports[_0xd8ef('0x58')]=function(_0x43bcba,_0x145cb0){return db[_0xd8ef('0x51')][_0xd8ef('0x58')](_0x43bcba[_0xd8ef('0x59')],{})['then'](respondWithResult(_0x145cb0,0xc9))['catch'](handleError(_0x145cb0,null));};exports[_0xd8ef('0x36')]=function(_0x3a3c51,_0x1269bf){if(_0x3a3c51[_0xd8ef('0x59')]['id']){delete _0x3a3c51['body']['id'];}return db[_0xd8ef('0x51')][_0xd8ef('0x57')]({'where':{'id':_0x3a3c51[_0xd8ef('0x56')]['id']}})[_0xd8ef('0x1e')](handleEntityNotFound(_0x1269bf,null))[_0xd8ef('0x1e')](saveUpdates(_0x3a3c51['body'],null))['then'](respondWithResult(_0x1269bf,null))[_0xd8ef('0x28')](handleError(_0x1269bf,null));};exports[_0xd8ef('0x37')]=function(_0x2fe621,_0x27bc4d){return db[_0xd8ef('0x51')][_0xd8ef('0x57')]({'where':{'id':_0x2fe621[_0xd8ef('0x56')]['id']}})[_0xd8ef('0x1e')](handleEntityNotFound(_0x27bc4d,null))[_0xd8ef('0x1e')](removeEntity(_0x27bc4d,null))[_0xd8ef('0x28')](handleError(_0x27bc4d,null));};exports[_0xd8ef('0x5a')]=function(_0x27bccf,_0x5f4963){return db[_0xd8ef('0x51')][_0xd8ef('0x5a')]()['then'](respondWithResult(_0x5f4963,null))['catch'](handleError(_0x5f4963,null));};var interaction_log=require('../../config/logger')(_0xd8ef('0x5b'));exports[_0xd8ef('0x5c')]=function(_0x53e49c,_0x428ac4,_0x40f99c){var _0xc9901f={'agent':{},'channel':_0xd8ef('0x5d')};if(_0x53e49c['body']['id']){delete _0x53e49c[_0xd8ef('0x59')]['id'];}_0x53e49c[_0xd8ef('0x59')][_0xd8ef('0x5e')]=!![];_0x53e49c[_0xd8ef('0x59')][_0xd8ef('0x5f')]=moment()['format'](_0xd8ef('0x60'));_0x53e49c['body']['UserId']=_0x53e49c[_0xd8ef('0x59')][_0xd8ef('0x61')]||_0x53e49c[_0xd8ef('0x62')]['id'];_0xc9901f['agent']['id']=_0x53e49c[_0xd8ef('0x59')][_0xd8ef('0x61')];return db[_0xd8ef('0x51')]['find']({'where':{'id':_0x53e49c['params']['id'],'UserId':null}})[_0xd8ef('0x1e')](handleEntityNotFound(_0x428ac4,null))[_0xd8ef('0x1e')](saveUpdates(_0x53e49c['body'],null))['then'](function(_0x18b64d){if(_0x18b64d){_0xc9901f[_0xd8ef('0x26')]=_0x18b64d['get']({'plain':!![]});return db[_0xd8ef('0x63')][_0xd8ef('0x57')]({'where':{'id':_0x18b64d[_0xd8ef('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x428ac4,null))['then'](function(_0x38d9a9){if(_0x38d9a9){return _0x38d9a9[_0xd8ef('0x36')]({'UserId':_0x53e49c[_0xd8ef('0x59')]['UserId'],'read1stAt':_['isNil'](_0x38d9a9['read1stAt'])?moment()[_0xd8ef('0x65')](_0xd8ef('0x60')):undefined});}return null;})[_0xd8ef('0x1e')](function(_0x113e18){if(_0x113e18){_0xc9901f[_0xd8ef('0x66')]=_0x113e18[_0xd8ef('0x67')]({'plain':!![]});interaction_log[_0xd8ef('0x1f')](_0xd8ef('0x68'),_0x53e49c[_0xd8ef('0x62')]['id'],_0x53e49c[_0xd8ef('0x62')][_0xd8ef('0x39')],_0x53e49c['user'][_0xd8ef('0x69')],_0xc9901f[_0xd8ef('0x66')]['id'],_0x53e49c[_0xd8ef('0x59')]?JSON[_0xd8ef('0x22')](_0x53e49c[_0xd8ef('0x59')]):'null');return respondWithRpcPromise(_0xd8ef('0x6a'),_0xd8ef('0x6b'),_0xc9901f);}return null;})[_0xd8ef('0x1e')](function(_0x4b1cf3){var _0x545130=_0xd8ef('0x6c')+_0x4b1cf3[_0xd8ef('0x26')][_0xd8ef('0x6d')];return db[_0xd8ef('0x6e')][_0xd8ef('0x44')](_0x545130,{'type':db['Sequelize'][_0xd8ef('0x6f')]['SELECT'],'raw':!![]})['then'](function(_0x42aecb){return _0x42aecb;});})[_0xd8ef('0x1e')](function(_0x3140b6){if(_0x3140b6){_0xc9901f[_0xd8ef('0x26')][_0xd8ef('0x70')]=_0x3140b6[0x0];if(!_0x53e49c[_0xd8ef('0x59')][_0xd8ef('0x61')])return;return db[_0xd8ef('0x71')]['find']({'where':{'id':_0x53e49c['body'][_0xd8ef('0x61')],'role':_0xd8ef('0x72')},'attributes':['id','name','fullname','email',_0xd8ef('0x73')],'raw':!![]});}return null;})[_0xd8ef('0x1e')](function(_0x289c58){if(!_0x289c58)return null;_0xc9901f['message']['agent']=_0x289c58;return _0xc9901f;})['then'](function(_0x1e9803){if(_0x1e9803){if(_0x53e49c['body'][_0xd8ef('0x74')]){_0xc9901f['message'][_0xd8ef('0x75')]=util['format'](_0xd8ef('0x76'),_0x53e49c[_0xd8ef('0x62')][_0xd8ef('0x39')]);_0xc9901f['message'][_0xd8ef('0x77')]=_0xc9901f[_0xd8ef('0x77')];_0xc9901f[_0xd8ef('0x26')][_0xd8ef('0x78')]=_0xc9901f[_0xd8ef('0x77')];_0xc9901f[_0xd8ef('0x26')]['event']=_0xd8ef('0x5c');return respondWithRpcPromise('EventManager',_0xd8ef('0x79'),{'event':'acceptmessage','message':_0xc9901f[_0xd8ef('0x26')]},client9002)['then'](function(){return _0xc9901f;});}return _0xc9901f;}return null;})[_0xd8ef('0x1e')](respondWithResult(_0x428ac4,null))['catch'](handleError(_0x428ac4,null));};var interaction_log=require(_0xd8ef('0x7a'))('whatsapp-interactions');exports['reject']=function(_0x475834,_0x501355,_0xbfd280){var _0x18caf4={'agent':{},'channel':_0xd8ef('0x5d')};if(_0x475834['body']['id']){delete _0x475834[_0xd8ef('0x59')]['id'];}_0x475834[_0xd8ef('0x59')][_0xd8ef('0x61')]=_0x475834[_0xd8ef('0x59')][_0xd8ef('0x61')]||_0x475834[_0xd8ef('0x62')]['id'];_0x18caf4[_0xd8ef('0x72')]['id']=_0x475834[_0xd8ef('0x59')]['UserId'];return db['WhatsappMessage']['find']({'where':{'id':_0x475834[_0xd8ef('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x501355,null))[_0xd8ef('0x1e')](function(_0x29baf2){if(_0x29baf2){_0x18caf4[_0xd8ef('0x26')]=_0x29baf2[_0xd8ef('0x67')]({'plain':!![]});return db[_0xd8ef('0x63')][_0xd8ef('0x57')]({'where':{'id':_0x29baf2[_0xd8ef('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x501355,null))[_0xd8ef('0x1e')](function(_0x3348c5){if(_0x3348c5){_0x18caf4[_0xd8ef('0x66')]=_0x3348c5[_0xd8ef('0x67')]({'plain':!![]});interaction_log[_0xd8ef('0x1f')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x475834['user']['id'],_0x475834[_0xd8ef('0x62')][_0xd8ef('0x39')],_0x475834['user'][_0xd8ef('0x69')],_0x18caf4['interaction']['id'],_0x475834['body']?JSON[_0xd8ef('0x22')](_0x475834[_0xd8ef('0x59')]):'null');return respondWithRpcPromise(_0xd8ef('0x7b'),'rejectMessage',_0x18caf4);}return null;})[_0xd8ef('0x1e')](function(_0x5d4c4e){var _0x10ad29=_0xd8ef('0x6c')+_0x5d4c4e[_0xd8ef('0x26')][_0xd8ef('0x6d')];return db[_0xd8ef('0x6e')][_0xd8ef('0x44')](_0x10ad29,{'type':db[_0xd8ef('0x7c')]['QueryTypes'][_0xd8ef('0x7d')],'raw':!![]})[_0xd8ef('0x1e')](function(_0x202388){return _0x202388;});})[_0xd8ef('0x1e')](function(_0x334837){if(_0x334837){_0x18caf4[_0xd8ef('0x26')][_0xd8ef('0x70')]=_0x334837[0x0];if(!_0x475834['body'][_0xd8ef('0x61')])return;return db[_0xd8ef('0x71')][_0xd8ef('0x57')]({'where':{'id':_0x475834[_0xd8ef('0x59')][_0xd8ef('0x61')],'role':_0xd8ef('0x72')},'attributes':['id',_0xd8ef('0x39'),_0xd8ef('0x7e'),'email','internal'],'raw':!![]});}return null;})[_0xd8ef('0x1e')](function(_0xb4e6b6){if(!_0xb4e6b6)return null;_0x18caf4[_0xd8ef('0x26')][_0xd8ef('0x72')]=_0xb4e6b6;return _0x18caf4;})[_0xd8ef('0x1e')](function(_0x54e669){if(_0x54e669){_0x54e669[_0xd8ef('0x26')][_0xd8ef('0x75')]=util['format'](_0xd8ef('0x76'),_0x475834[_0xd8ef('0x62')]['name']);_0x54e669[_0xd8ef('0x26')]['channel']=_0x18caf4[_0xd8ef('0x77')];_0x54e669[_0xd8ef('0x26')][_0xd8ef('0x78')]=_0x18caf4[_0xd8ef('0x77')];_0x54e669[_0xd8ef('0x26')][_0xd8ef('0x7f')]=_0xd8ef('0x34');respondWithRpcPromise(_0xd8ef('0x79'),'EventManager',{'event':_0xd8ef('0x80'),'message':_0x54e669['message']},client9002);return _0x18caf4;}return null;})[_0xd8ef('0x1e')](respondWithResult(_0x501355,null))[_0xd8ef('0x28')](handleError(_0x501355,null));};exports[_0xd8ef('0x2b')]=function(_0x3ff1e5,_0x3040f1,_0x591376){if(_0x3ff1e5['body']['id']){delete _0x3ff1e5[_0xd8ef('0x59')]['id'];}var _0x4f7ad3;return db[_0xd8ef('0x51')][_0xd8ef('0x57')]({'where':{'id':_0x3ff1e5[_0xd8ef('0x56')]['id']}})['then'](handleEntityNotFound(_0x3040f1,null))[_0xd8ef('0x1e')](function(_0x364c57){if(_0x364c57){_0x4f7ad3=_0x364c57;return db[_0xd8ef('0x81')][_0xd8ef('0x57')]({'where':{'id':_0x364c57['WhatsappAccountId']}});}})[_0xd8ef('0x1e')](handleEntityNotFound(_0x3040f1,null))[_0xd8ef('0x1e')](function(_0x1af4be){if(_0x1af4be){logger['debug']('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0xd8ef('0x2b'),_0xd8ef('0x82'),_0x1af4be[_0xd8ef('0x3e')],util['inspect'](_0x3ff1e5[_0xd8ef('0x59')],{'showHidden':![],'depth':null}));switch(_0x1af4be[_0xd8ef('0x3e')]){case _0xd8ef('0x83'):if(_0x3ff1e5['body'][_0xd8ef('0x84')]&&_0x3ff1e5[_0xd8ef('0x59')][_0xd8ef('0x84')]===_0x4f7ad3[_0xd8ef('0x85')]&&_0x3ff1e5[_0xd8ef('0x59')]['MessageStatus']&&_0x3ff1e5[_0xd8ef('0x59')][_0xd8ef('0x86')]===_0xd8ef('0x5e')){return _0x4f7ad3[_0xd8ef('0x36')]({'read':!![]});}else{logger[_0xd8ef('0x23')](_0xd8ef('0x87'),_0xd8ef('0x2b'),_0xd8ef('0x83'),util[_0xd8ef('0x88')](_0x3ff1e5[_0xd8ef('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x4f7ad3;}})[_0xd8ef('0x1e')](respondWithResult(_0x3040f1,null))['catch'](handleError(_0x3040f1,null));};
\ No newline at end of file
index cdc328b..d75ed52 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee4f=['setMaxListeners','save','update','emit','exports','events'];(function(_0x499090,_0x15be06){var _0x47ce5f=function(_0x4a1332){while(--_0x4a1332){_0x499090['push'](_0x499090['shift']());}};_0x47ce5f(++_0x15be06);}(_0xee4f,0xad));var _0xfee4=function(_0x4a97cc,_0x1a092d){_0x4a97cc=_0x4a97cc-0x0;var _0x49cf1e=_0xee4f[_0x4a97cc];return _0x49cf1e;};'use strict';var EventEmitter=require(_0xfee4('0x0'));var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xfee4('0x1')](0x0);var events={'afterCreate':_0xfee4('0x2'),'afterUpdate':_0xfee4('0x3'),'afterDestroy':'remove'};function emitEvent(_0x37c05f){return function(_0x5b9149,_0x27874a,_0x505b55){WhatsappMessageEvents['emit'](_0x37c05f+':'+_0x5b9149['id'],_0x5b9149);WhatsappMessageEvents[_0xfee4('0x4')](_0x37c05f,_0x5b9149);_0x505b55(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0xfee4('0x5')]=WhatsappMessageEvents;
\ No newline at end of file
+var _0x91a7=['../../mysqldb','WhatsappMessage','setMaxListeners','update','emit','hasOwnProperty','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x91a7,0xe7));var _0x791a=function(_0x1b07e1,_0x543f63){_0x1b07e1=_0x1b07e1-0x0;var _0x4d732d=_0x91a7[_0x1b07e1];return _0x4d732d;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x791a('0x0'))['db'][_0x791a('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x791a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x791a('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2f6392){return function(_0x535640,_0x50ab29,_0x32fe2b){WhatsappMessageEvents[_0x791a('0x4')](_0x2f6392+':'+_0x535640['id'],_0x535640);WhatsappMessageEvents['emit'](_0x2f6392,_0x535640);_0x32fe2b(null);};}for(var e in events){if(events[_0x791a('0x5')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x791a('0x6')]=WhatsappMessageEvents;
\ No newline at end of file
index dbd4e4c..4b3a5ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3b3=['error','WhatsappAccount','find','type','twilio','accountSid','phone','authToken','messages','create','remote','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','/messages/','text','POST','message_id','statuses','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','node-fetch','path','../../config/environment','exports','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','direction','toLowerCase','out','UserId','WhatsappInteraction','then','update','createdAt','catch'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xa3b3,0x81));var _0x3a3b=function(_0x51cadf,_0x43e776){_0x51cadf=_0x51cadf-0x0;var _0x1e1ed9=_0xa3b3[_0x51cadf];return _0x1e1ed9;};'use strict';var _=require(_0x3a3b('0x0'));var util=require(_0x3a3b('0x1'));var logger=require('../../config/logger')(_0x3a3b('0x2'));var moment=require(_0x3a3b('0x3'));var BPromise=require(_0x3a3b('0x4'));var rp=require(_0x3a3b('0x5'));var fetch=require(_0x3a3b('0x6'));var fs=require('fs');var path=require(_0x3a3b('0x7'));var rimraf=require('rimraf');var config=require(_0x3a3b('0x8'));var attributes=require('./whatsappMessage.attributes');module[_0x3a3b('0x9')]=function(_0x1305e9,_0x5834b7){return _0x1305e9['define'](_0x3a3b('0xa'),attributes,{'tableName':_0x3a3b('0xb'),'paranoid':![],'indexes':[{'name':_0x3a3b('0xc'),'fields':[_0x3a3b('0xc')]},{'name':_0x3a3b('0xd'),'fields':[_0x3a3b('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5d9c6b,_0x16c32a,_0x48b78c){var _0x28a656=_0x1305e9['models'];var _0x138797=_0x5d9c6b['get']({'plain':!![]});if(_0x138797[_0x3a3b('0xf')][_0x3a3b('0x10')]()==='in'||_0x138797[_0x3a3b('0xf')][_0x3a3b('0x10')]()===_0x3a3b('0x11')&&!_0x138797['secret']&&!_['isNil'](_0x138797[_0x3a3b('0x12')])){_0x28a656[_0x3a3b('0x13')]['findOne']({'where':{'id':_0x138797['WhatsappInteractionId']}})[_0x3a3b('0x14')](function(_0x573157){if(_0x573157){_0x573157[_0x3a3b('0x15')]({'lastMsgAt':_0x138797[_0x3a3b('0x16')],'lastMsgDirection':_0x138797[_0x3a3b('0xf')][_0x3a3b('0x10')]()});}})[_0x3a3b('0x17')](function(_0x564728){console[_0x3a3b('0x18')](_0x564728);});}if(_0x138797['direction']==='out'&&!_0x138797['secret']){var _0x499b7a;_0x28a656[_0x3a3b('0x19')][_0x3a3b('0x1a')]({'where':{'id':_0x138797['WhatsappAccountId']},'raw':!![]})[_0x3a3b('0x14')](function(_0x3f8cb8){_0x499b7a=_0x3f8cb8;if(_0x499b7a&&_0x499b7a[_0x3a3b('0x1b')]){switch(_0x499b7a['type']){case _0x3a3b('0x1c'):var _0x440828=require('twilio');if(_0x499b7a[_0x3a3b('0x1d')]&&_0x499b7a['authToken']&&_0x499b7a[_0x3a3b('0x1e')]){var _0xff880b=new _0x440828(_0x499b7a[_0x3a3b('0x1d')],_0x499b7a[_0x3a3b('0x1f')]);_0xff880b[_0x3a3b('0x20')][_0x3a3b('0x21')]({'body':_0x138797['body'],'to':'whatsapp:'+_0x138797[_0x3a3b('0x1e')],'from':'whatsapp:'+_0x499b7a[_0x3a3b('0x1e')],'statusCallback':_0x499b7a[_0x3a3b('0x22')]+'/api/whatsapp/messages/'+_0x138797['id']+_0x3a3b('0x23')+_0x499b7a[_0x3a3b('0x24')]})['then'](function(_0x2fae55){if(_0x2fae55[_0x3a3b('0x25')]){return _0x5d9c6b[_0x3a3b('0x15')]({'messageId':_0x2fae55[_0x3a3b('0x25')]});}})['catch'](function(_0x568b3a){logger['error'](_0x3a3b('0x26'),_0x3a3b('0x27'),'twilio',util['inspect'](_0x568b3a,{'showHidden':![],'depth':null}));});}else{logger[_0x3a3b('0x18')](_0x3a3b('0x26'),_0x3a3b('0x27'),'twilio',_0x3a3b('0x28'));}break;case _0x3a3b('0x29'):var _0xd4b29a=_0x499b7a[_0x3a3b('0x1d')];var _0x15a72c=_0x499b7a[_0x3a3b('0x1f')];var _0x43dfe2=_0x499b7a['baseUrl']+'/whatsapp/v1/'+_0xd4b29a+_0x3a3b('0x2a');var _0x1fe234={'to':[_0x138797[_0x3a3b('0x1e')]],'message':{'type':_0x3a3b('0x2b'),'text':_0x138797[_0x3a3b('0xe')]}};var _0x38b9f7={'method':_0x3a3b('0x2c'),'uri':_0x43dfe2,'headers':{'Authorization':'Bearer\x20'+_0x15a72c,'Content-Type':'application/json'},'body':_0x1fe234,'json':!![]};rp(_0x38b9f7)[_0x3a3b('0x14')](function(_0x4014c3){if(_0x4014c3['statuses'][0x0][_0x3a3b('0x2d')]){return _0x5d9c6b['update']({'messageId':_0x4014c3[_0x3a3b('0x2e')][0x0][_0x3a3b('0x2d')]});}})[_0x3a3b('0x17')](function(_0x597421){logger['err'](_0x3a3b('0x2f'),_0x597421);});break;}}})[_0x3a3b('0x30')](function(){_0x48b78c();});}else{_0x48b78c();}}},'charset':_0x3a3b('0x31'),'collate':_0x3a3b('0x32')});};
\ No newline at end of file
+var _0x5a26=['findOne','WhatsappInteractionId','update','error','WhatsappAccount','find','WhatsappAccountId','then','twilio','accountSid','authToken','phone','messages','create','body','whatsapp:','/api/whatsapp/messages/','/status?token=','sid','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','/messages/','text','POST','Bearer\x20','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./whatsappMessage.attributes','define','whatsapp_messages','messageId','fti_whatsapp_messages','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction'];(function(_0x24e473,_0x3fdd50){var _0x3a3b78=function(_0x5d1f54){while(--_0x5d1f54){_0x24e473['push'](_0x24e473['shift']());}};_0x3a3b78(++_0x3fdd50);}(_0x5a26,0x165));var _0x65a2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5a26[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x65a2('0x0'));var util=require(_0x65a2('0x1'));var logger=require('../../config/logger')(_0x65a2('0x2'));var moment=require(_0x65a2('0x3'));var BPromise=require(_0x65a2('0x4'));var rp=require('request-promise');var fetch=require('node-fetch');var fs=require('fs');var path=require(_0x65a2('0x5'));var rimraf=require(_0x65a2('0x6'));var config=require(_0x65a2('0x7'));var attributes=require(_0x65a2('0x8'));module['exports']=function(_0x5a6fd8,_0x50a8a5){return _0x5a6fd8[_0x65a2('0x9')]('WhatsappMessage',attributes,{'tableName':_0x65a2('0xa'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x65a2('0xb')]},{'name':_0x65a2('0xc'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4c885a,_0x58a332,_0x31c0e0){var _0xd9115c=_0x5a6fd8['models'];var _0x586d67=_0x4c885a[_0x65a2('0xd')]({'plain':!![]});if(_0x586d67[_0x65a2('0xe')][_0x65a2('0xf')]()==='in'||_0x586d67[_0x65a2('0xe')][_0x65a2('0xf')]()===_0x65a2('0x10')&&!_0x586d67[_0x65a2('0x11')]&&!_[_0x65a2('0x12')](_0x586d67[_0x65a2('0x13')])){_0xd9115c[_0x65a2('0x14')][_0x65a2('0x15')]({'where':{'id':_0x586d67[_0x65a2('0x16')]}})['then'](function(_0x4482c4){if(_0x4482c4){_0x4482c4[_0x65a2('0x17')]({'lastMsgAt':_0x586d67['createdAt'],'lastMsgDirection':_0x586d67[_0x65a2('0xe')]['toLowerCase']()});}})['catch'](function(_0xe71bbf){console[_0x65a2('0x18')](_0xe71bbf);});}if(_0x586d67[_0x65a2('0xe')]===_0x65a2('0x10')&&!_0x586d67[_0x65a2('0x11')]){var _0x58aafb;_0xd9115c[_0x65a2('0x19')][_0x65a2('0x1a')]({'where':{'id':_0x586d67[_0x65a2('0x1b')]},'raw':!![]})[_0x65a2('0x1c')](function(_0x1ab0d8){_0x58aafb=_0x1ab0d8;if(_0x58aafb&&_0x58aafb['type']){switch(_0x58aafb['type']){case _0x65a2('0x1d'):var _0x7c91a1=require(_0x65a2('0x1d'));if(_0x58aafb[_0x65a2('0x1e')]&&_0x58aafb[_0x65a2('0x1f')]&&_0x58aafb[_0x65a2('0x20')]){var _0x4e48a3=new _0x7c91a1(_0x58aafb[_0x65a2('0x1e')],_0x58aafb['authToken']);_0x4e48a3[_0x65a2('0x21')][_0x65a2('0x22')]({'body':_0x586d67[_0x65a2('0x23')],'to':'whatsapp:'+_0x586d67[_0x65a2('0x20')],'from':_0x65a2('0x24')+_0x58aafb[_0x65a2('0x20')],'statusCallback':_0x58aafb['remote']+_0x65a2('0x25')+_0x586d67['id']+_0x65a2('0x26')+_0x58aafb['token']})[_0x65a2('0x1c')](function(_0x446d40){if(_0x446d40['sid']){return _0x4c885a[_0x65a2('0x17')]({'messageId':_0x446d40[_0x65a2('0x27')]});}})[_0x65a2('0x28')](function(_0x4ef4a2){logger[_0x65a2('0x18')](_0x65a2('0x29'),_0x65a2('0x2a'),_0x65a2('0x1d'),util['inspect'](_0x4ef4a2,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x65a2('0x29'),'afterCreate',_0x65a2('0x1d'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case'sinch':var _0x47c80b=_0x58aafb[_0x65a2('0x1e')];var _0x17cc54=_0x58aafb[_0x65a2('0x1f')];var _0x2b37fb=_0x58aafb['baseUrl']+'/whatsapp/v1/'+_0x47c80b+_0x65a2('0x2b');var _0x601f20={'to':[_0x586d67[_0x65a2('0x20')]],'message':{'type':_0x65a2('0x2c'),'text':_0x586d67[_0x65a2('0x23')]}};var _0x448a5b={'method':_0x65a2('0x2d'),'uri':_0x2b37fb,'headers':{'Authorization':_0x65a2('0x2e')+_0x17cc54,'Content-Type':_0x65a2('0x2f')},'body':_0x601f20,'json':!![]};rp(_0x448a5b)[_0x65a2('0x1c')](function(_0x3df49a){if(_0x3df49a[_0x65a2('0x30')][0x0][_0x65a2('0x31')]){return _0x4c885a['update']({'messageId':_0x3df49a[_0x65a2('0x30')][0x0][_0x65a2('0x31')]});}})[_0x65a2('0x28')](function(_0x55a53f){logger[_0x65a2('0x32')](_0x65a2('0x33'),_0x55a53f);});break;}}})[_0x65a2('0x34')](function(){_0x31c0e0();});}else{_0x31c0e0();}}},'charset':'utf8mb4','collate':_0x65a2('0x35')});};
\ No newline at end of file
index 5c157c0..2fd2034 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4b1=['jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','WhatsappMessage','create','body','options','raw','CreateWhatsappMessage','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x4bfbc9,_0xecadfa){var _0x2836ae=function(_0x535b5e){while(--_0x535b5e){_0x4bfbc9['push'](_0x4bfbc9['shift']());}};_0x2836ae(++_0xecadfa);}(_0xc4b1,0x183));var _0x1c4b=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xc4b1[_0xf50820];return _0x2a9b10;};'use strict';var _=require(_0x1c4b('0x0'));var util=require(_0x1c4b('0x1'));var moment=require(_0x1c4b('0x2'));var BPromise=require(_0x1c4b('0x3'));var rs=require(_0x1c4b('0x4'));var fs=require('fs');var Redis=require(_0x1c4b('0x5'));var db=require(_0x1c4b('0x6'))['db'];var utils=require(_0x1c4b('0x7'));var logger=require('../../config/logger')(_0x1c4b('0x8'));var config=require('../../config/environment');var jayson=require(_0x1c4b('0x9'));var client=jayson[_0x1c4b('0xa')][_0x1c4b('0xb')]({'port':0x232a});config[_0x1c4b('0xc')]=_['defaults'](config[_0x1c4b('0xc')],{'host':_0x1c4b('0xd'),'port':0x18eb});var socket=require(_0x1c4b('0xe'))(new Redis(config[_0x1c4b('0xc')]));require(_0x1c4b('0xf'))[_0x1c4b('0x10')](socket);function respondWithRpcPromise(_0x42e9d8,_0x39b2c8,_0x3d3111){return new BPromise(function(_0x5d2098,_0x394eff){return client['request'](_0x42e9d8,_0x3d3111)[_0x1c4b('0x11')](function(_0x482588){logger[_0x1c4b('0x12')](_0x1c4b('0x13'),_0x39b2c8,_0x1c4b('0x14'));logger[_0x1c4b('0x15')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x39b2c8,_0x1c4b('0x14'),JSON[_0x1c4b('0x16')](_0x482588));if(_0x482588[_0x1c4b('0x17')]){if(_0x482588[_0x1c4b('0x17')]['code']===0x1f4){logger[_0x1c4b('0x17')](_0x1c4b('0x13'),_0x39b2c8,_0x482588[_0x1c4b('0x17')]['message']);return _0x394eff(_0x482588[_0x1c4b('0x17')][_0x1c4b('0x18')]);}logger[_0x1c4b('0x17')](_0x1c4b('0x13'),_0x39b2c8,_0x482588[_0x1c4b('0x17')]['message']);return _0x5d2098(_0x482588[_0x1c4b('0x17')][_0x1c4b('0x18')]);}else{logger[_0x1c4b('0x12')](_0x1c4b('0x13'),_0x39b2c8,'request\x20sent');_0x5d2098(_0x482588[_0x1c4b('0x19')][_0x1c4b('0x18')]);}})['catch'](function(_0x57c734){logger[_0x1c4b('0x17')](_0x1c4b('0x13'),_0x39b2c8,_0x57c734);_0x394eff(_0x57c734);});});}exports['CreateWhatsappMessage']=function(_0x1790c3){var _0x374b48=this;return new Promise(function(_0x46853d,_0xdc4678){return db[_0x1c4b('0x1a')][_0x1c4b('0x1b')](_0x1790c3[_0x1c4b('0x1c')],{'raw':_0x1790c3[_0x1c4b('0x1d')]?_0x1790c3[_0x1c4b('0x1d')][_0x1c4b('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x275061){logger[_0x1c4b('0x12')]('CreateWhatsappMessage',_0x1790c3);logger['debug'](_0x1c4b('0x1f'),_0x1790c3,JSON[_0x1c4b('0x16')](_0x275061));_0x46853d(_0x275061);})[_0x1c4b('0x20')](function(_0x19a850){logger[_0x1c4b('0x17')](_0x1c4b('0x1f'),_0x19a850[_0x1c4b('0x18')],_0x1790c3);_0xdc4678(_0x374b48[_0x1c4b('0x17')](0x1f4,_0x19a850[_0x1c4b('0x18')]));});});};
\ No newline at end of file
+var _0x482f=['info','WhatsappMessage,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','CreateWhatsappMessage','WhatsappMessage','create','options','raw','then','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','request'];(function(_0x2d2e85,_0x22faa9){var _0x3e9f5e=function(_0x101c22){while(--_0x101c22){_0x2d2e85['push'](_0x2d2e85['shift']());}};_0x3e9f5e(++_0x22faa9);}(_0x482f,0xf7));var _0xf482=function(_0x46880d,_0x3c22dd){_0x46880d=_0x46880d-0x0;var _0x21f46b=_0x482f[_0x46880d];return _0x21f46b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf482('0x0'));var BPromise=require(_0xf482('0x1'));var rs=require(_0xf482('0x2'));var fs=require('fs');var Redis=require(_0xf482('0x3'));var db=require(_0xf482('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf482('0x5'))(_0xf482('0x6'));var config=require(_0xf482('0x7'));var jayson=require(_0xf482('0x8'));var client=jayson[_0xf482('0x9')]['http']({'port':0x232a});config[_0xf482('0xa')]=_[_0xf482('0xb')](config[_0xf482('0xa')],{'host':_0xf482('0xc'),'port':0x18eb});var socket=require(_0xf482('0xd'))(new Redis(config[_0xf482('0xa')]));require(_0xf482('0xe'))[_0xf482('0xf')](socket);function respondWithRpcPromise(_0x3788f6,_0x2df587,_0x3c73ce){return new BPromise(function(_0x4f4c92,_0x182a17){return client[_0xf482('0x10')](_0x3788f6,_0x3c73ce)['then'](function(_0x41e39b){logger[_0xf482('0x11')](_0xf482('0x12'),_0x2df587,'request\x20sent');logger[_0xf482('0x13')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x2df587,'request\x20sent',JSON[_0xf482('0x14')](_0x41e39b));if(_0x41e39b[_0xf482('0x15')]){if(_0x41e39b[_0xf482('0x15')][_0xf482('0x16')]===0x1f4){logger[_0xf482('0x15')](_0xf482('0x12'),_0x2df587,_0x41e39b[_0xf482('0x15')][_0xf482('0x17')]);return _0x182a17(_0x41e39b[_0xf482('0x15')][_0xf482('0x17')]);}logger[_0xf482('0x15')](_0xf482('0x12'),_0x2df587,_0x41e39b[_0xf482('0x15')]['message']);return _0x4f4c92(_0x41e39b['error']['message']);}else{logger[_0xf482('0x11')](_0xf482('0x12'),_0x2df587,_0xf482('0x18'));_0x4f4c92(_0x41e39b[_0xf482('0x19')][_0xf482('0x17')]);}})['catch'](function(_0x1d6113){logger['error'](_0xf482('0x12'),_0x2df587,_0x1d6113);_0x182a17(_0x1d6113);});});}exports[_0xf482('0x1a')]=function(_0x4804b7){var _0x2c8469=this;return new Promise(function(_0xc34b48,_0x58bc60){return db[_0xf482('0x1b')][_0xf482('0x1c')](_0x4804b7['body'],{'raw':_0x4804b7[_0xf482('0x1d')]?_0x4804b7[_0xf482('0x1d')][_0xf482('0x1e')]===undefined?!![]:![]:!![]})[_0xf482('0x1f')](function(_0x2d9087){logger['info'](_0xf482('0x1a'),_0x4804b7);logger[_0xf482('0x13')](_0xf482('0x1a'),_0x4804b7,JSON['stringify'](_0x2d9087));_0xc34b48(_0x2d9087);})[_0xf482('0x20')](function(_0x285ae5){logger['error'](_0xf482('0x1a'),_0x285ae5[_0xf482('0x17')],_0x4804b7);_0x58bc60(_0x2c8469[_0xf482('0x15')](0x1f4,_0x285ae5[_0xf482('0x17')]));});});};
\ No newline at end of file
index ed1539a..370b6ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5dec=['whatsappMessage:','remove','emit','removeListener','register','length'];(function(_0x17ee72,_0x420b28){var _0x4ad27a=function(_0x23d2f3){while(--_0x23d2f3){_0x17ee72['push'](_0x17ee72['shift']());}};_0x4ad27a(++_0x420b28);}(_0x5dec,0x1db));var _0xc5de=function(_0x25764f,_0x1db05e){_0x25764f=_0x25764f-0x0;var _0x217e84=_0x5dec[_0x25764f];return _0x217e84;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=['save',_0xc5de('0x0'),'update'];function createListener(_0x4e3f3c,_0x30627a){return function(_0x54e23f){_0x30627a[_0xc5de('0x1')](_0x4e3f3c,_0x54e23f);};}function removeListener(_0x1353f9,_0x3a6d11){return function(){WhatsappMessageEvents[_0xc5de('0x2')](_0x1353f9,_0x3a6d11);};}exports[_0xc5de('0x3')]=function(_0x2a253d){for(var _0x2fd5f4=0x0,_0x4cee6b=events[_0xc5de('0x4')];_0x2fd5f4<_0x4cee6b;_0x2fd5f4++){var _0x520ebf=events[_0x2fd5f4];var _0x26c984=createListener(_0xc5de('0x5')+_0x520ebf,_0x2a253d);WhatsappMessageEvents['on'](_0x520ebf,_0x26c984);}};
\ No newline at end of file
+var _0xe66f=['emit','removeListener','register','length','./whatsappMessage.events','save','update'];(function(_0x13ad3e,_0x4b5dd1){var _0x337c16=function(_0x32f1f4){while(--_0x32f1f4){_0x13ad3e['push'](_0x13ad3e['shift']());}};_0x337c16(++_0x4b5dd1);}(_0xe66f,0xcf));var _0xfe66=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xe66f[_0x17b6e3];return _0x3906f3;};'use strict';var WhatsappMessageEvents=require(_0xfe66('0x0'));var events=[_0xfe66('0x1'),'remove',_0xfe66('0x2')];function createListener(_0x4953e9,_0x439db5){return function(_0x4f6b25){_0x439db5[_0xfe66('0x3')](_0x4953e9,_0x4f6b25);};}function removeListener(_0xea03f6,_0x55284c){return function(){WhatsappMessageEvents[_0xfe66('0x4')](_0xea03f6,_0x55284c);};}exports[_0xfe66('0x5')]=function(_0x372d9c){for(var _0x5794b0=0x0,_0x5e9a7d=events[_0xfe66('0x6')];_0x5794b0<_0x5e9a7d;_0x5794b0++){var _0x3e695a=events[_0x5794b0];var _0x222455=createListener('whatsappMessage:'+_0x3e695a,_0x372d9c);WhatsappMessageEvents['on'](_0x3e695a,_0x222455);}};
\ No newline at end of file
index 7083b2d..a3b1360 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9604=['../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','post','addAgents','put','delete','destroy','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x22ee1e,_0x3eff80){var _0x49a5c9=function(_0x373480){while(--_0x373480){_0x22ee1e['push'](_0x22ee1e['shift']());}};_0x49a5c9(++_0x3eff80);}(_0x9604,0x7d));var _0x4960=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9604[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x4960('0x0'));var util=require('util');var path=require(_0x4960('0x1'));var timeout=require(_0x4960('0x2'));var express=require(_0x4960('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4960('0x4'));var interaction=require(_0x4960('0x5'));var config=require(_0x4960('0x6'));var controller=require(_0x4960('0x7'));router[_0x4960('0x8')]('/',auth[_0x4960('0x9')](),controller['index']);router[_0x4960('0x8')]('/describe',auth[_0x4960('0x9')](),controller[_0x4960('0xa')]);router[_0x4960('0x8')](_0x4960('0xb'),auth[_0x4960('0x9')](),controller[_0x4960('0xc')]);router['get'](_0x4960('0xd'),auth['isAuthenticated'](),controller[_0x4960('0xe')]);router[_0x4960('0x8')](_0x4960('0xf'),auth[_0x4960('0x9')](),controller[_0x4960('0x10')]);router[_0x4960('0x8')]('/:id/users',auth[_0x4960('0x9')](),controller['getAgents']);router[_0x4960('0x11')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/teams',auth[_0x4960('0x9')](),controller['addTeams']);router[_0x4960('0x11')]('/:id/users',auth[_0x4960('0x9')](),controller[_0x4960('0x12')]);router[_0x4960('0x13')]('/:id',auth[_0x4960('0x9')](),controller['update']);router[_0x4960('0x14')](_0x4960('0xb'),auth[_0x4960('0x9')](),controller[_0x4960('0x15')]);router['delete'](_0x4960('0xf'),auth[_0x4960('0x9')](),controller[_0x4960('0x16')]);router[_0x4960('0x14')](_0x4960('0x17'),auth['isAuthenticated'](),controller[_0x4960('0x18')]);module[_0x4960('0x19')]=router;
\ No newline at end of file
+var _0x85e5=['./whatsappQueue.controller','get','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/users','getAgents','post','/:id/teams','addTeams','addAgents','put','update','destroy','delete','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x28e7fe,_0x2be18a){var _0x5e9494=function(_0xde40de){while(--_0xde40de){_0x28e7fe['push'](_0x28e7fe['shift']());}};_0x5e9494(++_0x2be18a);}(_0x85e5,0xaf));var _0x585e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x85e5[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x585e('0x0'));var path=require('path');var timeout=require(_0x585e('0x1'));var express=require(_0x585e('0x2'));var router=express[_0x585e('0x3')]();var fs_extra=require(_0x585e('0x4'));var auth=require(_0x585e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x585e('0x6'));var controller=require(_0x585e('0x7'));router[_0x585e('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x585e('0x8')]('/describe',auth[_0x585e('0x9')](),controller[_0x585e('0xa')]);router[_0x585e('0x8')](_0x585e('0xb'),auth[_0x585e('0x9')](),controller[_0x585e('0xc')]);router[_0x585e('0x8')](_0x585e('0xd'),auth[_0x585e('0x9')](),controller[_0x585e('0xe')]);router[_0x585e('0x8')]('/:id/teams',auth[_0x585e('0x9')](),controller['getTeams']);router[_0x585e('0x8')](_0x585e('0xf'),auth['isAuthenticated'](),controller[_0x585e('0x10')]);router[_0x585e('0x11')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x585e('0x12'),auth[_0x585e('0x9')](),controller[_0x585e('0x13')]);router[_0x585e('0x11')]('/:id/users',auth[_0x585e('0x9')](),controller[_0x585e('0x14')]);router[_0x585e('0x15')](_0x585e('0xb'),auth[_0x585e('0x9')](),controller[_0x585e('0x16')]);router['delete']('/:id',auth[_0x585e('0x9')](),controller[_0x585e('0x17')]);router[_0x585e('0x18')](_0x585e('0x12'),auth[_0x585e('0x9')](),controller['removeTeams']);router[_0x585e('0x18')](_0x585e('0xf'),auth[_0x585e('0x9')](),controller['removeAgents']);module[_0x585e('0x19')]=router;
\ No newline at end of file
index d5ff62a..2288d0f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb49a=['exports','STRING','name','INTEGER','rrmemory','beepall','sequelize'];(function(_0xa02ed,_0x407c56){var _0x659c95=function(_0x1237e2){while(--_0x1237e2){_0xa02ed['push'](_0xa02ed['shift']());}};_0x659c95(++_0x407c56);}(_0xb49a,0xfb));var _0xab49=function(_0x5a2660,_0x52e389){_0x5a2660=_0x5a2660-0x0;var _0x542d3b=_0xb49a[_0x5a2660];return _0x542d3b;};'use strict';var Sequelize=require(_0xab49('0x0'));module[_0xab49('0x1')]={'name':{'type':Sequelize[_0xab49('0x2')],'unique':_0xab49('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xab49('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xab49('0x5'),_0xab49('0x6'),'roundrobin')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x0911=['STRING','name','INTEGER','rrmemory','roundrobin','sequelize','exports'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x0911,0x1a9));var _0x1091=function(_0xff8595,_0x39341d){_0xff8595=_0xff8595-0x0;var _0x31e49e=_0x0911[_0xff8595];return _0x31e49e;};'use strict';var Sequelize=require(_0x1091('0x0'));module[_0x1091('0x1')]={'name':{'type':Sequelize[_0x1091('0x2')],'unique':_0x1091('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x1091('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x1091('0x5'),'beepall',_0x1091('0x6'))},'description':{'type':Sequelize[_0x1091('0x2')]}};
\ No newline at end of file
index 2179957..a68691a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaab7=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','json','undefined','offset','limit','Content-Range','apply','then','get','WhatsappQueues','destroy','error','name','send','index','map','WhatsappQueue','rawAttributes','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','params','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','update','describe','getMembers','findOne','UserWhatsappQueue','order','WhatsappQueueId','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','SIP','getTeams','Team','addTeams','ids','Agents','online','sequelize','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','TeamId','includes','all','union','compact','value','transaction','isEmpty','removeAgents','addAgents','spread','isArray','userWhatsappQueue:remove','getAgents','eml-format'];(function(_0x3a20d9,_0x23dbaf){var _0x2475ad=function(_0x5d828b){while(--_0x5d828b){_0x3a20d9['push'](_0x3a20d9['shift']());}};_0x2475ad(++_0x23dbaf);}(_0xaab7,0x115));var _0x7aab=function(_0x403f52,_0x2728f5){_0x403f52=_0x403f52-0x0;var _0x3f3921=_0xaab7[_0x403f52];return _0x3f3921;};'use strict';var emlformat=require(_0x7aab('0x0'));var rimraf=require(_0x7aab('0x1'));var zipdir=require(_0x7aab('0x2'));var jsonpatch=require(_0x7aab('0x3'));var rp=require(_0x7aab('0x4'));var moment=require(_0x7aab('0x5'));var BPromise=require(_0x7aab('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7aab('0x7'));var sox=require(_0x7aab('0x8'));var csv=require(_0x7aab('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7aab('0xa'));var _=require(_0x7aab('0xb'));var squel=require('squel');var crypto=require(_0x7aab('0xc'));var jsforce=require(_0x7aab('0xd'));var deskjs=require(_0x7aab('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7aab('0xf'));var Papa=require(_0x7aab('0x10'));var Redis=require(_0x7aab('0x11'));var authService=require(_0x7aab('0x12'));var qs=require(_0x7aab('0x13'));var as=require(_0x7aab('0x14'));var hardwareService=require(_0x7aab('0x15'));var logger=require(_0x7aab('0x16'))('api');var utils=require(_0x7aab('0x17'));var config=require(_0x7aab('0x18'));var licenseUtil=require(_0x7aab('0x19'));var db=require(_0x7aab('0x1a'))['db'];config[_0x7aab('0x1b')]=_['defaults'](config[_0x7aab('0x1b')],{'host':_0x7aab('0x1c'),'port':0x18eb});var socket=require(_0x7aab('0x1d'))(new Redis(config[_0x7aab('0x1b')]));require(_0x7aab('0x1e'))[_0x7aab('0x1f')](socket);function respondWithStatusCode(_0xf7f30b,_0x3e44ff){_0x3e44ff=_0x3e44ff||0xcc;return function(_0x67699a){if(_0x67699a){return _0xf7f30b[_0x7aab('0x20')](_0x3e44ff);}return _0xf7f30b[_0x7aab('0x21')](_0x3e44ff)[_0x7aab('0x22')]();};}function respondWithResult(_0x9e8248,_0xed779){_0xed779=_0xed779||0xc8;return function(_0x5cdc95){if(_0x5cdc95){return _0x9e8248[_0x7aab('0x21')](_0xed779)[_0x7aab('0x23')](_0x5cdc95);}};}function respondWithFilteredResult(_0x34391c,_0x552715){return function(_0xa300f7){if(_0xa300f7){var _0x461dbb=typeof _0x552715['offset']===_0x7aab('0x24')&&typeof _0x552715['limit']===_0x7aab('0x24');var _0xcae422=_0xa300f7['count'];var _0x110d85=_0x461dbb?0x0:_0x552715['offset'];var _0x3f1bc3=_0x461dbb?_0xa300f7['count']:_0x552715[_0x7aab('0x25')]+_0x552715[_0x7aab('0x26')];var _0x180150;if(_0x3f1bc3>=_0xcae422){_0x3f1bc3=_0xcae422;_0x180150=0xc8;}else{_0x180150=0xce;}_0x34391c[_0x7aab('0x21')](_0x180150);return _0x34391c['set'](_0x7aab('0x27'),_0x110d85+'-'+_0x3f1bc3+'/'+_0xcae422)['json'](_0xa300f7);}return null;};}function patchUpdates(_0x5c2424){return function(_0x390eac){try{jsonpatch[_0x7aab('0x28')](_0x390eac,_0x5c2424,!![]);}catch(_0x2efa5e){return BPromise['reject'](_0x2efa5e);}return _0x390eac['save']();};}function saveUpdates(_0x14f73a,_0x5282de){return function(_0xdf1728){if(_0xdf1728){return _0xdf1728['update'](_0x14f73a)[_0x7aab('0x29')](function(_0x49d6f3){return _0x49d6f3;});}return null;};}function removeEntity(_0x20b032,_0x25582f){return function(_0xfb7e60){if(_0xfb7e60){return _0xfb7e60['destroy']()[_0x7aab('0x29')](function(){var _0x476178=_0xfb7e60[_0x7aab('0x2a')]({'plain':!![]});var _0x18b509=_0x7aab('0x2b');return db['UserProfileResource'][_0x7aab('0x2c')]({'where':{'type':_0x18b509,'resourceId':_0x476178['id']}})['then'](function(){return _0xfb7e60;});})[_0x7aab('0x29')](function(){_0x20b032[_0x7aab('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33883f,_0x5e8579){return function(_0x141ef6){if(!_0x141ef6){_0x33883f['sendStatus'](0x194);}return _0x141ef6;};}function handleError(_0x3603ed,_0x4bf0ab){_0x4bf0ab=_0x4bf0ab||0x1f4;return function(_0xcdbef0){logger[_0x7aab('0x2d')](_0xcdbef0['stack']);if(_0xcdbef0[_0x7aab('0x2e')]){delete _0xcdbef0[_0x7aab('0x2e')];}_0x3603ed[_0x7aab('0x21')](_0x4bf0ab)[_0x7aab('0x2f')](_0xcdbef0);};}exports[_0x7aab('0x30')]=function(_0x47ccef,_0x22569d){var _0x4aa05f={},_0xa27aa1={},_0x2b1c15={'count':0x0,'rows':[]};var _0x3bbe7e=_[_0x7aab('0x31')](db[_0x7aab('0x32')][_0x7aab('0x33')],function(_0x4f04c9){return{'name':_0x4f04c9['fieldName'],'type':_0x4f04c9[_0x7aab('0x34')]['key']};});_0xa27aa1[_0x7aab('0x35')]=_['map'](_0x3bbe7e,_0x7aab('0x2e'));_0xa27aa1[_0x7aab('0x36')]=_[_0x7aab('0x37')](_0x47ccef[_0x7aab('0x36')]);_0xa27aa1['filters']=_['intersection'](_0xa27aa1['model'],_0xa27aa1[_0x7aab('0x36')]);_0x4aa05f[_0x7aab('0x38')]=_[_0x7aab('0x39')](_0xa27aa1['model'],qs[_0x7aab('0x3a')](_0x47ccef[_0x7aab('0x36')]['fields']));_0x4aa05f[_0x7aab('0x38')]=_0x4aa05f['attributes'][_0x7aab('0x3b')]?_0x4aa05f[_0x7aab('0x38')]:_0xa27aa1[_0x7aab('0x35')];if(!_0x47ccef[_0x7aab('0x36')][_0x7aab('0x3c')](_0x7aab('0x3d'))){_0x4aa05f[_0x7aab('0x26')]=qs[_0x7aab('0x26')](_0x47ccef[_0x7aab('0x36')][_0x7aab('0x26')]);_0x4aa05f['offset']=qs[_0x7aab('0x25')](_0x47ccef[_0x7aab('0x36')][_0x7aab('0x25')]);}_0x4aa05f['order']=qs[_0x7aab('0x3e')](_0x47ccef[_0x7aab('0x36')]['sort']);_0x4aa05f[_0x7aab('0x3f')]=qs[_0x7aab('0x40')](_[_0x7aab('0x41')](_0x47ccef[_0x7aab('0x36')],_0xa27aa1[_0x7aab('0x40')]),_0x3bbe7e);if(_0x47ccef[_0x7aab('0x36')][_0x7aab('0x42')]){_0x4aa05f[_0x7aab('0x3f')]=_[_0x7aab('0x43')](_0x4aa05f['where'],{'$or':_[_0x7aab('0x31')](_0x3bbe7e,function(_0x24e716){if(_0x24e716[_0x7aab('0x34')]!==_0x7aab('0x44')){var _0x7e03d8={};_0x7e03d8[_0x24e716[_0x7aab('0x2e')]]={'$like':'%'+_0x47ccef[_0x7aab('0x36')][_0x7aab('0x42')]+'%'};return _0x7e03d8;}})});}_0x4aa05f=_[_0x7aab('0x43')]({},_0x4aa05f,_0x47ccef[_0x7aab('0x45')]);var _0x5c306b={'where':_0x4aa05f[_0x7aab('0x3f')]};return db[_0x7aab('0x32')][_0x7aab('0x46')](_0x5c306b)[_0x7aab('0x29')](function(_0x4fe27d){_0x2b1c15[_0x7aab('0x46')]=_0x4fe27d;if(_0x47ccef[_0x7aab('0x36')][_0x7aab('0x47')]){_0x4aa05f[_0x7aab('0x48')]=[{'all':!![]}];}return db[_0x7aab('0x32')][_0x7aab('0x49')](_0x4aa05f);})['then'](function(_0x1c06d5){_0x2b1c15[_0x7aab('0x4a')]=_0x1c06d5;return _0x2b1c15;})['then'](respondWithFilteredResult(_0x22569d,_0x4aa05f))['catch'](handleError(_0x22569d,null));};exports['show']=function(_0x39333e,_0x715226){var _0xa54011={'raw':!![],'where':{'id':_0x39333e[_0x7aab('0x4b')]['id']}},_0x1e1018={};_0x1e1018['model']=_['keys'](db['WhatsappQueue']['rawAttributes']);_0x1e1018[_0x7aab('0x36')]=_[_0x7aab('0x37')](_0x39333e['query']);_0x1e1018[_0x7aab('0x40')]=_[_0x7aab('0x39')](_0x1e1018[_0x7aab('0x35')],_0x1e1018[_0x7aab('0x36')]);_0xa54011[_0x7aab('0x38')]=_[_0x7aab('0x39')](_0x1e1018[_0x7aab('0x35')],qs['fields'](_0x39333e[_0x7aab('0x36')][_0x7aab('0x3a')]));_0xa54011[_0x7aab('0x38')]=_0xa54011['attributes'][_0x7aab('0x3b')]?_0xa54011[_0x7aab('0x38')]:_0x1e1018[_0x7aab('0x35')];if(_0x39333e[_0x7aab('0x36')]['includeAll']){_0xa54011[_0x7aab('0x48')]=[{'all':!![]}];}_0xa54011=_[_0x7aab('0x43')]({},_0xa54011,_0x39333e['options']);return db['WhatsappQueue'][_0x7aab('0x4c')](_0xa54011)[_0x7aab('0x29')](handleEntityNotFound(_0x715226,null))['then'](respondWithResult(_0x715226,null))[_0x7aab('0x4d')](handleError(_0x715226,null));};exports[_0x7aab('0x4e')]=function(_0x139234,_0x47f949){return db['WhatsappQueue'][_0x7aab('0x4e')](_0x139234[_0x7aab('0x4f')],{})['then'](function(_0x13b8d6){var _0x411db3=_0x139234[_0x7aab('0x50')][_0x7aab('0x2a')]({'plain':!![]});if(!_0x411db3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x411db3[_0x7aab('0x51')]===_0x7aab('0x50')){var _0x51190=_0x13b8d6[_0x7aab('0x2a')]({'plain':!![]});var _0x64c434=_0x7aab('0x2b');return db[_0x7aab('0x52')][_0x7aab('0x4c')]({'where':{'name':_0x64c434,'userProfileId':_0x411db3[_0x7aab('0x53')]},'raw':!![]})[_0x7aab('0x29')](function(_0x4fcafb){if(_0x4fcafb&&_0x4fcafb[_0x7aab('0x54')]===0x0){return db[_0x7aab('0x55')]['create']({'name':_0x51190[_0x7aab('0x2e')],'resourceId':_0x51190['id'],'type':_0x4fcafb['name'],'sectionId':_0x4fcafb['id']},{})[_0x7aab('0x29')](function(){return _0x13b8d6;});}else{return _0x13b8d6;}})[_0x7aab('0x4d')](function(_0x1cbf17){logger[_0x7aab('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1cbf17);throw _0x1cbf17;});}return _0x13b8d6;})[_0x7aab('0x29')](respondWithResult(_0x47f949,0xc9))[_0x7aab('0x4d')](handleError(_0x47f949,null));};exports[_0x7aab('0x56')]=function(_0x3ed771,_0x239cb7){if(_0x3ed771['body']['id']){delete _0x3ed771[_0x7aab('0x4f')]['id'];}return db[_0x7aab('0x32')]['find']({'where':{'id':_0x3ed771[_0x7aab('0x4b')]['id']}})[_0x7aab('0x29')](handleEntityNotFound(_0x239cb7,null))[_0x7aab('0x29')](saveUpdates(_0x3ed771[_0x7aab('0x4f')],null))[_0x7aab('0x29')](respondWithResult(_0x239cb7,null))[_0x7aab('0x4d')](handleError(_0x239cb7,null));};exports[_0x7aab('0x2c')]=function(_0x22253d,_0x3dda6f){return db[_0x7aab('0x32')][_0x7aab('0x4c')]({'where':{'id':_0x22253d['params']['id']}})[_0x7aab('0x29')](handleEntityNotFound(_0x3dda6f,null))[_0x7aab('0x29')](removeEntity(_0x3dda6f,null))['catch'](handleError(_0x3dda6f,null));};exports[_0x7aab('0x57')]=function(_0x2ddfd0,_0xde609f){return db[_0x7aab('0x32')][_0x7aab('0x57')]()['then'](respondWithResult(_0xde609f,null))['catch'](handleError(_0xde609f,null));};exports[_0x7aab('0x58')]=function(_0x3b4900,_0x57f74a,_0x540b67){var _0x33cfdc={'raw':!![],'where':{}},_0x3e18e2={},_0x4264f6;return db[_0x7aab('0x32')][_0x7aab('0x59')]({'where':{'id':_0x3b4900[_0x7aab('0x4b')]['id']}})[_0x7aab('0x29')](handleEntityNotFound(_0x57f74a,null))['then'](function(_0x1a439d){if(_0x1a439d){_0x4264f6=_0x1a439d[_0x7aab('0x2a')]({'plain':!![]});_0x3e18e2[_0x7aab('0x35')]=_['keys'](db[_0x7aab('0x5a')][_0x7aab('0x33')]);_0x3e18e2[_0x7aab('0x36')]=_[_0x7aab('0x37')](_0x3b4900['query']);_0x3e18e2[_0x7aab('0x40')]=_[_0x7aab('0x39')](_0x3e18e2[_0x7aab('0x35')],_0x3e18e2[_0x7aab('0x36')]);_0x33cfdc[_0x7aab('0x38')]=_[_0x7aab('0x39')](_0x3e18e2[_0x7aab('0x35')],qs['fields'](_0x3b4900['query']['fields']));_0x33cfdc[_0x7aab('0x38')]=_0x33cfdc[_0x7aab('0x38')][_0x7aab('0x3b')]?_0x33cfdc[_0x7aab('0x38')]:_0x3e18e2[_0x7aab('0x35')];if(!_0x3b4900['query'][_0x7aab('0x3c')](_0x7aab('0x3d'))){_0x33cfdc[_0x7aab('0x26')]=qs['limit'](_0x3b4900[_0x7aab('0x36')][_0x7aab('0x26')]);_0x33cfdc['offset']=qs[_0x7aab('0x25')](_0x3b4900[_0x7aab('0x36')]['offset']);}_0x33cfdc[_0x7aab('0x5b')]=qs[_0x7aab('0x3e')](_0x3b4900[_0x7aab('0x36')][_0x7aab('0x3e')]);_0x33cfdc[_0x7aab('0x3f')]=qs[_0x7aab('0x40')](_[_0x7aab('0x41')](_0x3b4900[_0x7aab('0x36')],_0x3e18e2[_0x7aab('0x40')]));_0x33cfdc[_0x7aab('0x3f')][_0x7aab('0x5c')]=_0x1a439d['id'];if(_0x3b4900[_0x7aab('0x36')][_0x7aab('0x42')]){_0x33cfdc[_0x7aab('0x3f')]=_[_0x7aab('0x43')](_0x33cfdc[_0x7aab('0x3f')],{'$or':_[_0x7aab('0x31')](_0x33cfdc[_0x7aab('0x38')],function(_0xbe4e0){var _0x1ea57f={};_0x1ea57f[_0xbe4e0]={'$like':'%'+_0x3b4900[_0x7aab('0x36')][_0x7aab('0x42')]+'%'};return _0x1ea57f;})});}_0x33cfdc=_[_0x7aab('0x43')]({},_0x33cfdc,_0x3b4900[_0x7aab('0x45')]);return db['UserWhatsappQueue']['findAll'](_0x33cfdc);}})[_0x7aab('0x29')](function(_0x50db6e){if(_0x50db6e){return db[_0x7aab('0x5d')][_0x7aab('0x5e')]({'where':{'id':_[_0x7aab('0x31')](_0x50db6e,_0x7aab('0x5f')),'role':_0x7aab('0x60')},'attributes':['id',_0x7aab('0x2e'),_0x7aab('0x61'),_0x7aab('0x62'),_0x7aab('0x63')]});}})['then'](function(_0xbf9056){if(_0xbf9056){return{'count':_0xbf9056[_0x7aab('0x46')],'rows':_[_0x7aab('0x31')](_0xbf9056[_0x7aab('0x4a')],function(_0x2414a6){return{'membername':_0x2414a6[_0x7aab('0x2e')],'UserId':_0x2414a6['id'],'queue_name':_0x4264f6['name'],'WhatsappQueueId':_0x4264f6['id'],'interface':util[_0x7aab('0x64')]('%s/%s',_0x7aab('0x65'),_0x2414a6['name']),'penalty':0x0,'paused':_0x2414a6[_0x7aab('0x61')],'createdAt':_0x2414a6[_0x7aab('0x63')],'updatedAt':_0x2414a6['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x57f74a,_0x33cfdc))[_0x7aab('0x4d')](handleError(_0x57f74a,null));};exports[_0x7aab('0x66')]=function(_0x2f9ed4,_0x3ea536,_0x2e2827){var _0x55e07e={};var _0x2ad7ee={};var _0x2c5443;var _0xb80c53;return db[_0x7aab('0x32')][_0x7aab('0x59')]({'where':{'id':_0x2f9ed4[_0x7aab('0x4b')]['id']}})[_0x7aab('0x29')](handleEntityNotFound(_0x3ea536,null))[_0x7aab('0x29')](function(_0x12d117){if(_0x12d117){_0x2c5443=_0x12d117;_0x2ad7ee['model']=_[_0x7aab('0x37')](db[_0x7aab('0x67')][_0x7aab('0x33')]);_0x2ad7ee['query']=_[_0x7aab('0x37')](_0x2f9ed4[_0x7aab('0x36')]);_0x2ad7ee[_0x7aab('0x40')]=_[_0x7aab('0x39')](_0x2ad7ee[_0x7aab('0x35')],_0x2ad7ee['query']);_0x55e07e[_0x7aab('0x38')]=_[_0x7aab('0x39')](_0x2ad7ee[_0x7aab('0x35')],qs[_0x7aab('0x3a')](_0x2f9ed4[_0x7aab('0x36')][_0x7aab('0x3a')]));_0x55e07e[_0x7aab('0x38')]=_0x55e07e[_0x7aab('0x38')][_0x7aab('0x3b')]?_0x55e07e['attributes']:_0x2ad7ee[_0x7aab('0x35')];_0x55e07e[_0x7aab('0x5b')]=qs[_0x7aab('0x3e')](_0x2f9ed4[_0x7aab('0x36')]['sort']);_0x55e07e[_0x7aab('0x3f')]=qs[_0x7aab('0x40')](_[_0x7aab('0x41')](_0x2f9ed4[_0x7aab('0x36')],_0x2ad7ee[_0x7aab('0x40')]));if(_0x2f9ed4[_0x7aab('0x36')]['filter']){_0x55e07e[_0x7aab('0x3f')]=_['merge'](_0x55e07e[_0x7aab('0x3f')],{'$or':_['map'](_0x55e07e['attributes'],function(_0x44cc6b){var _0x1a5496={};_0x1a5496[_0x44cc6b]={'$like':'%'+_0x2f9ed4[_0x7aab('0x36')][_0x7aab('0x42')]+'%'};return _0x1a5496;})});}_0x55e07e=_['merge']({},_0x55e07e,_0x2f9ed4[_0x7aab('0x45')]);return _0x2c5443[_0x7aab('0x66')](_0x55e07e);}})[_0x7aab('0x29')](function(_0x3d186e){if(_0x3d186e){_0xb80c53=_0x3d186e[_0x7aab('0x3b')];if(!_0x2f9ed4[_0x7aab('0x36')][_0x7aab('0x3c')](_0x7aab('0x3d'))){_0x55e07e[_0x7aab('0x26')]=qs[_0x7aab('0x26')](_0x2f9ed4[_0x7aab('0x36')][_0x7aab('0x26')]);_0x55e07e[_0x7aab('0x25')]=qs[_0x7aab('0x25')](_0x2f9ed4[_0x7aab('0x36')][_0x7aab('0x25')]);}return _0x2c5443[_0x7aab('0x66')](_0x55e07e);}})['then'](function(_0x8da233){if(_0x8da233){return _0x8da233?{'count':_0xb80c53,'rows':_0x8da233}:null;}})[_0x7aab('0x29')](respondWithResult(_0x3ea536,null))['catch'](handleError(_0x3ea536,null));};exports[_0x7aab('0x68')]=function(_0x4d3699,_0xba9a33,_0x47d5d3){var _0x47c85f=_0x4d3699[_0x7aab('0x4f')][_0x7aab('0x69')];return db[_0x7aab('0x67')]['findAll']({'where':{'id':_0x47c85f},'attributes':['id'],'include':[{'model':db[_0x7aab('0x5d')],'as':_0x7aab('0x6a'),'attributes':['id',_0x7aab('0x2e'),_0x7aab('0x6b'),'voicePause','interface'],'raw':!![]}]})[_0x7aab('0x29')](function(_0x4a1033){if(_0x4a1033){var _0xa7fff8=_['flatMap'](_0x4a1033,function(_0x30d895){var _0x2fa8d1=_0x30d895[_0x7aab('0x2a')]({'plain':!![]});return _0x2fa8d1['Agents'];});return db[_0x7aab('0x32')][_0x7aab('0x4c')]({'where':{'id':_0x4d3699[_0x7aab('0x4b')]['id']}})[_0x7aab('0x29')](function(_0x57e5c4){return db[_0x7aab('0x6c')]['transaction'](function(_0x3e34e3){return _0x57e5c4[_0x7aab('0x68')](_0x47c85f,{'transaction':_0x3e34e3})[_0x7aab('0x29')](function(){return BPromise[_0x7aab('0x6d')](_0xa7fff8,function(_0x27a9df){return db[_0x7aab('0x5a')][_0x7aab('0x6e')]({'where':{'UserId':_0x27a9df['id'],'WhatsappQueueId':_0x4d3699['params']['id']},'transaction':_0x3e34e3});});})[_0x7aab('0x29')](function(){_0xa7fff8[_0x7aab('0x6f')](function(_0x227338){socket[_0x7aab('0x70')](_0x7aab('0x71'),{'UserId':_0x227338['id'],'WhatsappQueueId':_0x57e5c4['id']});});});});});}})[_0x7aab('0x29')](respondWithStatusCode(_0xba9a33,null))['catch'](handleError(_0xba9a33,null));};exports[_0x7aab('0x72')]=function(_0x20a5a0,_0x49d2f0,_0x8b5126){return db[_0x7aab('0x67')][_0x7aab('0x49')]({'where':{'id':_0x20a5a0[_0x7aab('0x36')][_0x7aab('0x69')]},'attributes':['id'],'include':[{'model':db[_0x7aab('0x5d')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x7aab('0x29')](handleEntityNotFound(_0x49d2f0,null))[_0x7aab('0x29')](function(_0x373d62){var _0x1eb565=_[_0x7aab('0x31')](_0x373d62,'id');var _0x2248ad=[];var _0x4d51ff=[];var _0x35d043=squel['select']();_0x35d043['field'](_0x7aab('0x73'))[_0x7aab('0x74')]('team_has_whatsapp_queues','tq')[_0x7aab('0x75')]('user_has_teams','ut',_0x7aab('0x76'))[_0x7aab('0x3f')](_0x7aab('0x77'),_0x20a5a0[_0x7aab('0x4b')]['id']);for(var _0x4b2c21=0x0;_0x4b2c21<_0x373d62[_0x7aab('0x3b')];_0x4b2c21+=0x1){let _0x482994=_0x373d62[_0x4b2c21];for(var _0x5f0688=0x0;_0x5f0688<_0x482994[_0x7aab('0x6a')][_0x7aab('0x3b')];_0x5f0688+=0x1){let _0x114a4a=_0x482994[_0x7aab('0x6a')][_0x5f0688];var _0x123ae4=_0x35d043[_0x7aab('0x78')]();_0x123ae4[_0x7aab('0x3f')](_0x7aab('0x79'),_0x114a4a['id']);_0x4d51ff[_0x7aab('0x7a')](db[_0x7aab('0x6c')][_0x7aab('0x36')](_0x123ae4[_0x7aab('0x7b')](),{'type':db[_0x7aab('0x6c')]['QueryTypes'][_0x7aab('0x7c')]})[_0x7aab('0x29')](function(_0x4ae50d){if(_0x4ae50d['length']===0x1){return _0x114a4a['id'];}else{var _0x49bb60=_['every'](_['map'](_0x4ae50d,_0x7aab('0x7d')),function(_0x69324d){return _[_0x7aab('0x7e')](_0x1eb565,_0x69324d);});if(_0x49bb60){return _0x114a4a['id'];}}}));}}return BPromise[_0x7aab('0x7f')](_0x4d51ff)[_0x7aab('0x29')](function(_0xb4d1c6){_0x2248ad=_(_0x2248ad)[_0x7aab('0x80')](_0xb4d1c6)[_0x7aab('0x81')]()[_0x7aab('0x82')]();return db[_0x7aab('0x32')][_0x7aab('0x4c')]({'where':{'id':_0x20a5a0[_0x7aab('0x4b')]['id']}})['then'](function(_0xb32c38){return db[_0x7aab('0x6c')][_0x7aab('0x83')](function(_0x181a92){return _0xb32c38[_0x7aab('0x72')](_0x20a5a0['query']['ids'],{'transaction':_0x181a92})['then'](function(){if(!_[_0x7aab('0x84')](_0x2248ad)){return _0xb32c38[_0x7aab('0x85')](_0x2248ad,{'transaction':_0x181a92});}})[_0x7aab('0x29')](function(){_0x2248ad[_0x7aab('0x6f')](function(_0xae60d6){socket['emit']('userWhatsappQueue:remove',{'UserId':_0xae60d6,'WhatsappQueueId':_0xb32c38['id']});});});});});});})[_0x7aab('0x29')](respondWithStatusCode(_0x49d2f0,null))[_0x7aab('0x4d')](handleError(_0x49d2f0,null));};exports['addAgents']=function(_0x13c9aa,_0x5b79d5,_0x423d47){return db[_0x7aab('0x32')]['find']({'where':{'id':_0x13c9aa[_0x7aab('0x4b')]['id']}})[_0x7aab('0x29')](handleEntityNotFound(_0x5b79d5,null))[_0x7aab('0x29')](function(_0x128f6d){if(_0x128f6d){return _0x128f6d[_0x7aab('0x86')](_0x13c9aa[_0x7aab('0x4f')]['ids'],_['omit'](_0x13c9aa[_0x7aab('0x4f')],[_0x7aab('0x69'),'id'])||{})[_0x7aab('0x87')](function(_0xe6aff2){for(var _0x3f88fd=0x0;_0x3f88fd<_0x13c9aa['body'][_0x7aab('0x69')][_0x7aab('0x3b')];_0x3f88fd+=0x1){socket['emit'](_0x7aab('0x71'),{'UserId':Number(_0x13c9aa['body'][_0x7aab('0x69')][_0x3f88fd]),'WhatsappQueueId':Number(_0x13c9aa['params']['id'])});}return _0xe6aff2;});}})[_0x7aab('0x29')](respondWithResult(_0x5b79d5,null))['catch'](handleError(_0x5b79d5,null));};exports[_0x7aab('0x85')]=function(_0x1d34a4,_0xe7f38,_0x559530){return db['WhatsappQueue'][_0x7aab('0x4c')]({'where':{'id':_0x1d34a4[_0x7aab('0x4b')]['id']}})[_0x7aab('0x29')](handleEntityNotFound(_0xe7f38,null))[_0x7aab('0x29')](function(_0x360737){if(_0x360737){return _0x360737[_0x7aab('0x85')](_0x1d34a4[_0x7aab('0x36')][_0x7aab('0x69')])[_0x7aab('0x29')](function(){if(_[_0x7aab('0x88')](_0x1d34a4[_0x7aab('0x36')][_0x7aab('0x69')])){for(var _0x29f335=0x0;_0x29f335<_0x1d34a4[_0x7aab('0x36')][_0x7aab('0x69')][_0x7aab('0x3b')];_0x29f335+=0x1){socket[_0x7aab('0x70')]('userWhatsappQueue:remove',{'UserId':Number(_0x1d34a4[_0x7aab('0x36')][_0x7aab('0x69')][_0x29f335]),'WhatsappQueueId':Number(_0x1d34a4[_0x7aab('0x4b')]['id'])});}}else{socket['emit'](_0x7aab('0x89'),{'UserId':Number(_0x1d34a4[_0x7aab('0x36')][_0x7aab('0x69')]),'WhatsappQueueId':Number(_0x1d34a4[_0x7aab('0x4b')]['id'])});}});}})[_0x7aab('0x29')](respondWithStatusCode(_0xe7f38,null))[_0x7aab('0x4d')](handleError(_0xe7f38,null));};exports[_0x7aab('0x8a')]=function(_0x454f61,_0x5f475f,_0xe875e0){var _0x392067={};var _0x44bb44={};var _0x3b5021;var _0x20175d;return db[_0x7aab('0x32')]['findOne']({'where':{'id':_0x454f61['params']['id']}})['then'](handleEntityNotFound(_0x5f475f,null))[_0x7aab('0x29')](function(_0x479a50){if(_0x479a50){_0x3b5021=_0x479a50;_0x44bb44[_0x7aab('0x35')]=_[_0x7aab('0x37')](db[_0x7aab('0x5d')][_0x7aab('0x33')]);_0x44bb44[_0x7aab('0x36')]=_['keys'](_0x454f61[_0x7aab('0x36')]);_0x44bb44[_0x7aab('0x40')]=_[_0x7aab('0x39')](_0x44bb44[_0x7aab('0x35')],_0x44bb44[_0x7aab('0x36')]);_0x392067[_0x7aab('0x38')]=_[_0x7aab('0x39')](_0x44bb44['model'],qs['fields'](_0x454f61[_0x7aab('0x36')][_0x7aab('0x3a')]));_0x392067[_0x7aab('0x38')]=_0x392067[_0x7aab('0x38')][_0x7aab('0x3b')]?_0x392067[_0x7aab('0x38')]:_0x44bb44[_0x7aab('0x35')];_0x392067[_0x7aab('0x5b')]=qs[_0x7aab('0x3e')](_0x454f61['query'][_0x7aab('0x3e')]);_0x392067[_0x7aab('0x3f')]=qs[_0x7aab('0x40')](_['pick'](_0x454f61['query'],_0x44bb44[_0x7aab('0x40')]));if(_0x454f61[_0x7aab('0x36')]['filter']){_0x392067[_0x7aab('0x3f')]=_['merge'](_0x392067['where'],{'$or':_[_0x7aab('0x31')](_0x392067[_0x7aab('0x38')],function(_0x39beb7){var _0x1f74b5={};_0x1f74b5[_0x39beb7]={'$like':'%'+_0x454f61[_0x7aab('0x36')][_0x7aab('0x42')]+'%'};return _0x1f74b5;})});}_0x392067=_[_0x7aab('0x43')]({},_0x392067,_0x454f61['options']);return _0x3b5021[_0x7aab('0x8a')](_0x392067);}})[_0x7aab('0x29')](function(_0xa15d2a){if(_0xa15d2a){_0x20175d=_0xa15d2a[_0x7aab('0x3b')];if(!_0x454f61[_0x7aab('0x36')]['hasOwnProperty']('nolimit')){_0x392067['limit']=qs['limit'](_0x454f61['query'][_0x7aab('0x26')]);_0x392067[_0x7aab('0x25')]=qs[_0x7aab('0x25')](_0x454f61[_0x7aab('0x36')][_0x7aab('0x25')]);}return _0x3b5021[_0x7aab('0x8a')](_0x392067);}})[_0x7aab('0x29')](function(_0x3cec7d){if(_0x3cec7d){return _0x3cec7d?{'count':_0x20175d,'rows':_0x3cec7d}:null;}})[_0x7aab('0x29')](respondWithResult(_0x5f475f,null))['catch'](handleError(_0x5f475f,null));};
\ No newline at end of file
+var _0x02db=['register','status','end','undefined','count','offset','limit','Content-Range','json','apply','reject','save','then','destroy','get','WhatsappQueues','UserProfileResource','sendStatus','error','stack','name','index','map','WhatsappQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserWhatsappQueue','nolimit','filter','UserId','agent','whatsappPause','createdAt','%s/%s','updatedAt','getTeams','Team','addTeams','User','Agents','online','voicePause','interface','sequelize','each','findOrCreate','forEach','ids','select','from','join','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','compact','value','transaction','removeAgents','emit','userWhatsappQueue:remove','addAgents','spread','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket'];(function(_0x5a4a1f,_0x3f90b6){var _0x43db26=function(_0x2824f5){while(--_0x2824f5){_0x5a4a1f['push'](_0x5a4a1f['shift']());}};_0x43db26(++_0x3f90b6);}(_0x02db,0x17b));var _0xb02d=function(_0x3ee59e,_0x3e511a){_0x3ee59e=_0x3ee59e-0x0;var _0x268f52=_0x02db[_0x3ee59e];return _0x268f52;};'use strict';var emlformat=require(_0xb02d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb02d('0x1'));var jsonpatch=require(_0xb02d('0x2'));var rp=require('request-promise');var moment=require(_0xb02d('0x3'));var BPromise=require(_0xb02d('0x4'));var Mustache=require('mustache');var util=require(_0xb02d('0x5'));var path=require('path');var sox=require(_0xb02d('0x6'));var csv=require(_0xb02d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb02d('0x8'));var _=require(_0xb02d('0x9'));var squel=require('squel');var crypto=require(_0xb02d('0xa'));var jsforce=require(_0xb02d('0xb'));var deskjs=require(_0xb02d('0xc'));var toCsv=require(_0xb02d('0x7'));var querystring=require(_0xb02d('0xd'));var Papa=require(_0xb02d('0xe'));var Redis=require(_0xb02d('0xf'));var authService=require(_0xb02d('0x10'));var qs=require(_0xb02d('0x11'));var as=require(_0xb02d('0x12'));var hardwareService=require(_0xb02d('0x13'));var logger=require('../../config/logger')(_0xb02d('0x14'));var utils=require(_0xb02d('0x15'));var config=require(_0xb02d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xb02d('0x17'))['db'];config[_0xb02d('0x18')]=_[_0xb02d('0x19')](config['redis'],{'host':_0xb02d('0x1a'),'port':0x18eb});var socket=require(_0xb02d('0x1b'))(new Redis(config[_0xb02d('0x18')]));require(_0xb02d('0x1c'))[_0xb02d('0x1d')](socket);function respondWithStatusCode(_0x54f40f,_0x5f0bf0){_0x5f0bf0=_0x5f0bf0||0xcc;return function(_0x11b59d){if(_0x11b59d){return _0x54f40f['sendStatus'](_0x5f0bf0);}return _0x54f40f[_0xb02d('0x1e')](_0x5f0bf0)[_0xb02d('0x1f')]();};}function respondWithResult(_0xb72e92,_0x4f5c1e){_0x4f5c1e=_0x4f5c1e||0xc8;return function(_0x90042){if(_0x90042){return _0xb72e92[_0xb02d('0x1e')](_0x4f5c1e)['json'](_0x90042);}};}function respondWithFilteredResult(_0x46f382,_0x178e4f){return function(_0x1d20d3){if(_0x1d20d3){var _0x56f44a=typeof _0x178e4f['offset']===_0xb02d('0x20')&&typeof _0x178e4f['limit']===_0xb02d('0x20');var _0x63b439=_0x1d20d3[_0xb02d('0x21')];var _0xec1a4e=_0x56f44a?0x0:_0x178e4f[_0xb02d('0x22')];var _0x1f2f55=_0x56f44a?_0x1d20d3['count']:_0x178e4f[_0xb02d('0x22')]+_0x178e4f[_0xb02d('0x23')];var _0x5b64b7;if(_0x1f2f55>=_0x63b439){_0x1f2f55=_0x63b439;_0x5b64b7=0xc8;}else{_0x5b64b7=0xce;}_0x46f382['status'](_0x5b64b7);return _0x46f382['set'](_0xb02d('0x24'),_0xec1a4e+'-'+_0x1f2f55+'/'+_0x63b439)[_0xb02d('0x25')](_0x1d20d3);}return null;};}function patchUpdates(_0x4fde17){return function(_0x1bb6c5){try{jsonpatch[_0xb02d('0x26')](_0x1bb6c5,_0x4fde17,!![]);}catch(_0x55d6f8){return BPromise[_0xb02d('0x27')](_0x55d6f8);}return _0x1bb6c5[_0xb02d('0x28')]();};}function saveUpdates(_0x47f9ba,_0x4a1b67){return function(_0x461089){if(_0x461089){return _0x461089['update'](_0x47f9ba)[_0xb02d('0x29')](function(_0x27c51c){return _0x27c51c;});}return null;};}function removeEntity(_0x3c01ba,_0x5bc3ca){return function(_0x598723){if(_0x598723){return _0x598723[_0xb02d('0x2a')]()[_0xb02d('0x29')](function(){var _0x71e68d=_0x598723[_0xb02d('0x2b')]({'plain':!![]});var _0x1a4272=_0xb02d('0x2c');return db[_0xb02d('0x2d')][_0xb02d('0x2a')]({'where':{'type':_0x1a4272,'resourceId':_0x71e68d['id']}})[_0xb02d('0x29')](function(){return _0x598723;});})[_0xb02d('0x29')](function(){_0x3c01ba[_0xb02d('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2db89e,_0x3bf145){return function(_0x80131f){if(!_0x80131f){_0x2db89e[_0xb02d('0x2e')](0x194);}return _0x80131f;};}function handleError(_0x570e95,_0x18b723){_0x18b723=_0x18b723||0x1f4;return function(_0xe2e84c){logger[_0xb02d('0x2f')](_0xe2e84c[_0xb02d('0x30')]);if(_0xe2e84c[_0xb02d('0x31')]){delete _0xe2e84c['name'];}_0x570e95[_0xb02d('0x1e')](_0x18b723)['send'](_0xe2e84c);};}exports[_0xb02d('0x32')]=function(_0x10cd8a,_0x3987b0){var _0x42d928={},_0x10f932={},_0x352265={'count':0x0,'rows':[]};var _0x21b802=_[_0xb02d('0x33')](db[_0xb02d('0x34')][_0xb02d('0x35')],function(_0x9f53bc){return{'name':_0x9f53bc[_0xb02d('0x36')],'type':_0x9f53bc[_0xb02d('0x37')][_0xb02d('0x38')]};});_0x10f932[_0xb02d('0x39')]=_[_0xb02d('0x33')](_0x21b802,_0xb02d('0x31'));_0x10f932[_0xb02d('0x3a')]=_[_0xb02d('0x3b')](_0x10cd8a[_0xb02d('0x3a')]);_0x10f932[_0xb02d('0x3c')]=_[_0xb02d('0x3d')](_0x10f932[_0xb02d('0x39')],_0x10f932[_0xb02d('0x3a')]);_0x42d928[_0xb02d('0x3e')]=_['intersection'](_0x10f932[_0xb02d('0x39')],qs[_0xb02d('0x3f')](_0x10cd8a[_0xb02d('0x3a')][_0xb02d('0x3f')]));_0x42d928[_0xb02d('0x3e')]=_0x42d928[_0xb02d('0x3e')][_0xb02d('0x40')]?_0x42d928[_0xb02d('0x3e')]:_0x10f932['model'];if(!_0x10cd8a[_0xb02d('0x3a')][_0xb02d('0x41')]('nolimit')){_0x42d928['limit']=qs[_0xb02d('0x23')](_0x10cd8a[_0xb02d('0x3a')][_0xb02d('0x23')]);_0x42d928[_0xb02d('0x22')]=qs[_0xb02d('0x22')](_0x10cd8a['query'][_0xb02d('0x22')]);}_0x42d928[_0xb02d('0x42')]=qs[_0xb02d('0x43')](_0x10cd8a[_0xb02d('0x3a')]['sort']);_0x42d928[_0xb02d('0x44')]=qs[_0xb02d('0x3c')](_[_0xb02d('0x45')](_0x10cd8a[_0xb02d('0x3a')],_0x10f932[_0xb02d('0x3c')]),_0x21b802);if(_0x10cd8a[_0xb02d('0x3a')]['filter']){_0x42d928[_0xb02d('0x44')]=_[_0xb02d('0x46')](_0x42d928['where'],{'$or':_['map'](_0x21b802,function(_0x1e45b6){if(_0x1e45b6[_0xb02d('0x37')]!=='VIRTUAL'){var _0x3fc3d6={};_0x3fc3d6[_0x1e45b6[_0xb02d('0x31')]]={'$like':'%'+_0x10cd8a[_0xb02d('0x3a')]['filter']+'%'};return _0x3fc3d6;}})});}_0x42d928=_[_0xb02d('0x46')]({},_0x42d928,_0x10cd8a[_0xb02d('0x47')]);var _0x2b8431={'where':_0x42d928[_0xb02d('0x44')]};return db[_0xb02d('0x34')][_0xb02d('0x21')](_0x2b8431)[_0xb02d('0x29')](function(_0x2d9824){_0x352265[_0xb02d('0x21')]=_0x2d9824;if(_0x10cd8a[_0xb02d('0x3a')][_0xb02d('0x48')]){_0x42d928['include']=[{'all':!![]}];}return db['WhatsappQueue'][_0xb02d('0x49')](_0x42d928);})[_0xb02d('0x29')](function(_0x626fb3){_0x352265[_0xb02d('0x4a')]=_0x626fb3;return _0x352265;})['then'](respondWithFilteredResult(_0x3987b0,_0x42d928))[_0xb02d('0x4b')](handleError(_0x3987b0,null));};exports[_0xb02d('0x4c')]=function(_0x53dfec,_0x4bcaaf){var _0x62ebbe={'raw':!![],'where':{'id':_0x53dfec[_0xb02d('0x4d')]['id']}},_0x242e3a={};_0x242e3a[_0xb02d('0x39')]=_[_0xb02d('0x3b')](db[_0xb02d('0x34')][_0xb02d('0x35')]);_0x242e3a['query']=_[_0xb02d('0x3b')](_0x53dfec[_0xb02d('0x3a')]);_0x242e3a[_0xb02d('0x3c')]=_[_0xb02d('0x3d')](_0x242e3a['model'],_0x242e3a[_0xb02d('0x3a')]);_0x62ebbe[_0xb02d('0x3e')]=_['intersection'](_0x242e3a['model'],qs['fields'](_0x53dfec['query'][_0xb02d('0x3f')]));_0x62ebbe[_0xb02d('0x3e')]=_0x62ebbe[_0xb02d('0x3e')][_0xb02d('0x40')]?_0x62ebbe['attributes']:_0x242e3a[_0xb02d('0x39')];if(_0x53dfec[_0xb02d('0x3a')][_0xb02d('0x48')]){_0x62ebbe[_0xb02d('0x4e')]=[{'all':!![]}];}_0x62ebbe=_['merge']({},_0x62ebbe,_0x53dfec[_0xb02d('0x47')]);return db[_0xb02d('0x34')][_0xb02d('0x4f')](_0x62ebbe)[_0xb02d('0x29')](handleEntityNotFound(_0x4bcaaf,null))[_0xb02d('0x29')](respondWithResult(_0x4bcaaf,null))['catch'](handleError(_0x4bcaaf,null));};exports[_0xb02d('0x50')]=function(_0x1eb8b3,_0x3a7682){return db[_0xb02d('0x34')][_0xb02d('0x50')](_0x1eb8b3[_0xb02d('0x51')],{})[_0xb02d('0x29')](function(_0x3dc58c){var _0x3aa987=_0x1eb8b3[_0xb02d('0x52')][_0xb02d('0x2b')]({'plain':!![]});if(!_0x3aa987)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3aa987[_0xb02d('0x53')]===_0xb02d('0x52')){var _0xb51437=_0x3dc58c[_0xb02d('0x2b')]({'plain':!![]});var _0x1d4694=_0xb02d('0x2c');return db[_0xb02d('0x54')]['find']({'where':{'name':_0x1d4694,'userProfileId':_0x3aa987['userProfileId']},'raw':!![]})[_0xb02d('0x29')](function(_0x10bbb9){if(_0x10bbb9&&_0x10bbb9[_0xb02d('0x55')]===0x0){return db[_0xb02d('0x2d')][_0xb02d('0x50')]({'name':_0xb51437[_0xb02d('0x31')],'resourceId':_0xb51437['id'],'type':_0x10bbb9['name'],'sectionId':_0x10bbb9['id']},{})['then'](function(){return _0x3dc58c;});}else{return _0x3dc58c;}})[_0xb02d('0x4b')](function(_0x58701b){logger[_0xb02d('0x2f')](_0xb02d('0x56'),_0x58701b);throw _0x58701b;});}return _0x3dc58c;})[_0xb02d('0x29')](respondWithResult(_0x3a7682,0xc9))[_0xb02d('0x4b')](handleError(_0x3a7682,null));};exports[_0xb02d('0x57')]=function(_0x12f825,_0x62eb5b){if(_0x12f825['body']['id']){delete _0x12f825['body']['id'];}return db[_0xb02d('0x34')]['find']({'where':{'id':_0x12f825[_0xb02d('0x4d')]['id']}})[_0xb02d('0x29')](handleEntityNotFound(_0x62eb5b,null))[_0xb02d('0x29')](saveUpdates(_0x12f825['body'],null))['then'](respondWithResult(_0x62eb5b,null))['catch'](handleError(_0x62eb5b,null));};exports[_0xb02d('0x2a')]=function(_0x5893dd,_0x3d91ef){return db['WhatsappQueue'][_0xb02d('0x4f')]({'where':{'id':_0x5893dd['params']['id']}})[_0xb02d('0x29')](handleEntityNotFound(_0x3d91ef,null))['then'](removeEntity(_0x3d91ef,null))[_0xb02d('0x4b')](handleError(_0x3d91ef,null));};exports['describe']=function(_0xbbd767,_0x388301){return db['WhatsappQueue'][_0xb02d('0x58')]()[_0xb02d('0x29')](respondWithResult(_0x388301,null))['catch'](handleError(_0x388301,null));};exports[_0xb02d('0x59')]=function(_0x3d2bbd,_0x10c42f,_0x1cfc8c){var _0x1c9995={'raw':!![],'where':{}},_0x1c8c14={},_0x51f77c;return db[_0xb02d('0x34')][_0xb02d('0x5a')]({'where':{'id':_0x3d2bbd[_0xb02d('0x4d')]['id']}})[_0xb02d('0x29')](handleEntityNotFound(_0x10c42f,null))[_0xb02d('0x29')](function(_0x1c4ce9){if(_0x1c4ce9){_0x51f77c=_0x1c4ce9['get']({'plain':!![]});_0x1c8c14[_0xb02d('0x39')]=_[_0xb02d('0x3b')](db[_0xb02d('0x5b')]['rawAttributes']);_0x1c8c14['query']=_[_0xb02d('0x3b')](_0x3d2bbd[_0xb02d('0x3a')]);_0x1c8c14['filters']=_[_0xb02d('0x3d')](_0x1c8c14[_0xb02d('0x39')],_0x1c8c14[_0xb02d('0x3a')]);_0x1c9995[_0xb02d('0x3e')]=_['intersection'](_0x1c8c14[_0xb02d('0x39')],qs['fields'](_0x3d2bbd['query'][_0xb02d('0x3f')]));_0x1c9995['attributes']=_0x1c9995[_0xb02d('0x3e')][_0xb02d('0x40')]?_0x1c9995[_0xb02d('0x3e')]:_0x1c8c14[_0xb02d('0x39')];if(!_0x3d2bbd[_0xb02d('0x3a')][_0xb02d('0x41')](_0xb02d('0x5c'))){_0x1c9995['limit']=qs['limit'](_0x3d2bbd[_0xb02d('0x3a')][_0xb02d('0x23')]);_0x1c9995[_0xb02d('0x22')]=qs['offset'](_0x3d2bbd[_0xb02d('0x3a')][_0xb02d('0x22')]);}_0x1c9995[_0xb02d('0x42')]=qs['sort'](_0x3d2bbd['query'][_0xb02d('0x43')]);_0x1c9995['where']=qs[_0xb02d('0x3c')](_[_0xb02d('0x45')](_0x3d2bbd[_0xb02d('0x3a')],_0x1c8c14[_0xb02d('0x3c')]));_0x1c9995[_0xb02d('0x44')]['WhatsappQueueId']=_0x1c4ce9['id'];if(_0x3d2bbd[_0xb02d('0x3a')][_0xb02d('0x5d')]){_0x1c9995[_0xb02d('0x44')]=_[_0xb02d('0x46')](_0x1c9995['where'],{'$or':_[_0xb02d('0x33')](_0x1c9995['attributes'],function(_0x2e9967){var _0x417555={};_0x417555[_0x2e9967]={'$like':'%'+_0x3d2bbd[_0xb02d('0x3a')][_0xb02d('0x5d')]+'%'};return _0x417555;})});}_0x1c9995=_[_0xb02d('0x46')]({},_0x1c9995,_0x3d2bbd[_0xb02d('0x47')]);return db['UserWhatsappQueue'][_0xb02d('0x49')](_0x1c9995);}})[_0xb02d('0x29')](function(_0x383e01){if(_0x383e01){return db['User']['findAndCountAll']({'where':{'id':_[_0xb02d('0x33')](_0x383e01,_0xb02d('0x5e')),'role':_0xb02d('0x5f')},'attributes':['id','name',_0xb02d('0x60'),'updatedAt',_0xb02d('0x61')]});}})['then'](function(_0x3463d7){if(_0x3463d7){return{'count':_0x3463d7[_0xb02d('0x21')],'rows':_[_0xb02d('0x33')](_0x3463d7['rows'],function(_0x47d4d4){return{'membername':_0x47d4d4[_0xb02d('0x31')],'UserId':_0x47d4d4['id'],'queue_name':_0x51f77c['name'],'WhatsappQueueId':_0x51f77c['id'],'interface':util['format'](_0xb02d('0x62'),'SIP',_0x47d4d4[_0xb02d('0x31')]),'penalty':0x0,'paused':_0x47d4d4['whatsappPause'],'createdAt':_0x47d4d4[_0xb02d('0x61')],'updatedAt':_0x47d4d4[_0xb02d('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb02d('0x29')](respondWithFilteredResult(_0x10c42f,_0x1c9995))['catch'](handleError(_0x10c42f,null));};exports[_0xb02d('0x64')]=function(_0x3dce36,_0x3f792b,_0x2a0068){var _0x15f0a0={};var _0x3ac39b={};var _0x1859eb;var _0x1bd372;return db[_0xb02d('0x34')][_0xb02d('0x5a')]({'where':{'id':_0x3dce36['params']['id']}})[_0xb02d('0x29')](handleEntityNotFound(_0x3f792b,null))['then'](function(_0x12ae36){if(_0x12ae36){_0x1859eb=_0x12ae36;_0x3ac39b[_0xb02d('0x39')]=_[_0xb02d('0x3b')](db[_0xb02d('0x65')][_0xb02d('0x35')]);_0x3ac39b[_0xb02d('0x3a')]=_['keys'](_0x3dce36[_0xb02d('0x3a')]);_0x3ac39b[_0xb02d('0x3c')]=_[_0xb02d('0x3d')](_0x3ac39b['model'],_0x3ac39b['query']);_0x15f0a0[_0xb02d('0x3e')]=_['intersection'](_0x3ac39b[_0xb02d('0x39')],qs[_0xb02d('0x3f')](_0x3dce36['query'][_0xb02d('0x3f')]));_0x15f0a0[_0xb02d('0x3e')]=_0x15f0a0[_0xb02d('0x3e')]['length']?_0x15f0a0[_0xb02d('0x3e')]:_0x3ac39b[_0xb02d('0x39')];_0x15f0a0['order']=qs[_0xb02d('0x43')](_0x3dce36['query'][_0xb02d('0x43')]);_0x15f0a0[_0xb02d('0x44')]=qs[_0xb02d('0x3c')](_['pick'](_0x3dce36[_0xb02d('0x3a')],_0x3ac39b['filters']));if(_0x3dce36[_0xb02d('0x3a')][_0xb02d('0x5d')]){_0x15f0a0[_0xb02d('0x44')]=_['merge'](_0x15f0a0[_0xb02d('0x44')],{'$or':_[_0xb02d('0x33')](_0x15f0a0[_0xb02d('0x3e')],function(_0x9fcefd){var _0x5aeefe={};_0x5aeefe[_0x9fcefd]={'$like':'%'+_0x3dce36['query'][_0xb02d('0x5d')]+'%'};return _0x5aeefe;})});}_0x15f0a0=_[_0xb02d('0x46')]({},_0x15f0a0,_0x3dce36[_0xb02d('0x47')]);return _0x1859eb[_0xb02d('0x64')](_0x15f0a0);}})[_0xb02d('0x29')](function(_0x4eed39){if(_0x4eed39){_0x1bd372=_0x4eed39['length'];if(!_0x3dce36['query']['hasOwnProperty']('nolimit')){_0x15f0a0[_0xb02d('0x23')]=qs[_0xb02d('0x23')](_0x3dce36['query']['limit']);_0x15f0a0['offset']=qs[_0xb02d('0x22')](_0x3dce36['query'][_0xb02d('0x22')]);}return _0x1859eb[_0xb02d('0x64')](_0x15f0a0);}})[_0xb02d('0x29')](function(_0x1e43be){if(_0x1e43be){return _0x1e43be?{'count':_0x1bd372,'rows':_0x1e43be}:null;}})[_0xb02d('0x29')](respondWithResult(_0x3f792b,null))[_0xb02d('0x4b')](handleError(_0x3f792b,null));};exports[_0xb02d('0x66')]=function(_0x4512f2,_0x5a17d5,_0x5eb7fd){var _0x502ec6=_0x4512f2[_0xb02d('0x51')]['ids'];return db[_0xb02d('0x65')]['findAll']({'where':{'id':_0x502ec6},'attributes':['id'],'include':[{'model':db[_0xb02d('0x67')],'as':_0xb02d('0x68'),'attributes':['id',_0xb02d('0x31'),_0xb02d('0x69'),_0xb02d('0x6a'),_0xb02d('0x6b')],'raw':!![]}]})[_0xb02d('0x29')](function(_0x57476d){if(_0x57476d){var _0x5ae9e3=_['flatMap'](_0x57476d,function(_0x262287){var _0x1e9484=_0x262287[_0xb02d('0x2b')]({'plain':!![]});return _0x1e9484['Agents'];});return db[_0xb02d('0x34')][_0xb02d('0x4f')]({'where':{'id':_0x4512f2[_0xb02d('0x4d')]['id']}})[_0xb02d('0x29')](function(_0x50d9f6){return db[_0xb02d('0x6c')]['transaction'](function(_0x26e5b6){return _0x50d9f6[_0xb02d('0x66')](_0x502ec6,{'transaction':_0x26e5b6})[_0xb02d('0x29')](function(){return BPromise[_0xb02d('0x6d')](_0x5ae9e3,function(_0x2c4327){return db['UserWhatsappQueue'][_0xb02d('0x6e')]({'where':{'UserId':_0x2c4327['id'],'WhatsappQueueId':_0x4512f2[_0xb02d('0x4d')]['id']},'transaction':_0x26e5b6});});})[_0xb02d('0x29')](function(){_0x5ae9e3[_0xb02d('0x6f')](function(_0x32c448){socket['emit']('userWhatsappQueue:save',{'UserId':_0x32c448['id'],'WhatsappQueueId':_0x50d9f6['id']});});});});});}})[_0xb02d('0x29')](respondWithStatusCode(_0x5a17d5,null))[_0xb02d('0x4b')](handleError(_0x5a17d5,null));};exports['removeTeams']=function(_0x3c8b4a,_0x338ddb,_0x1cbebd){return db[_0xb02d('0x65')][_0xb02d('0x49')]({'where':{'id':_0x3c8b4a['query'][_0xb02d('0x70')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xb02d('0x68'),'attributes':['id'],'raw':!![]}]})[_0xb02d('0x29')](handleEntityNotFound(_0x338ddb,null))[_0xb02d('0x29')](function(_0xd7ce6e){var _0x5a8c5a=_[_0xb02d('0x33')](_0xd7ce6e,'id');var _0x8d55ae=[];var _0x2a6c8e=[];var _0x489381=squel[_0xb02d('0x71')]();_0x489381['field']('tq.TeamId')[_0xb02d('0x72')]('team_has_whatsapp_queues','tq')[_0xb02d('0x73')]('user_has_teams','ut',_0xb02d('0x74'))[_0xb02d('0x44')](_0xb02d('0x75'),_0x3c8b4a[_0xb02d('0x4d')]['id']);for(var _0x104e54=0x0;_0x104e54<_0xd7ce6e[_0xb02d('0x40')];_0x104e54+=0x1){let _0x27c00a=_0xd7ce6e[_0x104e54];for(var _0x24b4cf=0x0;_0x24b4cf<_0x27c00a[_0xb02d('0x68')][_0xb02d('0x40')];_0x24b4cf+=0x1){let _0x45bbc5=_0x27c00a['Agents'][_0x24b4cf];var _0x2018e5=_0x489381['clone']();_0x2018e5[_0xb02d('0x44')](_0xb02d('0x76'),_0x45bbc5['id']);_0x2a6c8e[_0xb02d('0x77')](db[_0xb02d('0x6c')]['query'](_0x2018e5[_0xb02d('0x78')](),{'type':db[_0xb02d('0x6c')]['QueryTypes'][_0xb02d('0x79')]})[_0xb02d('0x29')](function(_0x2da06b){if(_0x2da06b[_0xb02d('0x40')]===0x1){return _0x45bbc5['id'];}else{var _0x38b962=_[_0xb02d('0x7a')](_['map'](_0x2da06b,_0xb02d('0x7b')),function(_0x101188){return _[_0xb02d('0x7c')](_0x5a8c5a,_0x101188);});if(_0x38b962){return _0x45bbc5['id'];}}}));}}return BPromise[_0xb02d('0x7d')](_0x2a6c8e)[_0xb02d('0x29')](function(_0x8fe524){_0x8d55ae=_(_0x8d55ae)[_0xb02d('0x7e')](_0x8fe524)[_0xb02d('0x7f')]()[_0xb02d('0x80')]();return db[_0xb02d('0x34')]['find']({'where':{'id':_0x3c8b4a['params']['id']}})[_0xb02d('0x29')](function(_0x5bee55){return db['sequelize'][_0xb02d('0x81')](function(_0x1c802f){return _0x5bee55['removeTeams'](_0x3c8b4a['query'][_0xb02d('0x70')],{'transaction':_0x1c802f})[_0xb02d('0x29')](function(){if(!_['isEmpty'](_0x8d55ae)){return _0x5bee55[_0xb02d('0x82')](_0x8d55ae,{'transaction':_0x1c802f});}})['then'](function(){_0x8d55ae[_0xb02d('0x6f')](function(_0x43b8cf){socket[_0xb02d('0x83')](_0xb02d('0x84'),{'UserId':_0x43b8cf,'WhatsappQueueId':_0x5bee55['id']});});});});});});})[_0xb02d('0x29')](respondWithStatusCode(_0x338ddb,null))[_0xb02d('0x4b')](handleError(_0x338ddb,null));};exports[_0xb02d('0x85')]=function(_0x1c78b4,_0x46e177,_0x46b240){return db['WhatsappQueue'][_0xb02d('0x4f')]({'where':{'id':_0x1c78b4['params']['id']}})[_0xb02d('0x29')](handleEntityNotFound(_0x46e177,null))[_0xb02d('0x29')](function(_0x3049ff){if(_0x3049ff){return _0x3049ff[_0xb02d('0x85')](_0x1c78b4['body'][_0xb02d('0x70')],_['omit'](_0x1c78b4[_0xb02d('0x51')],[_0xb02d('0x70'),'id'])||{})[_0xb02d('0x86')](function(_0x33eb91){for(var _0x5a4534=0x0;_0x5a4534<_0x1c78b4[_0xb02d('0x51')][_0xb02d('0x70')][_0xb02d('0x40')];_0x5a4534+=0x1){socket[_0xb02d('0x83')]('userWhatsappQueue:save',{'UserId':Number(_0x1c78b4['body'][_0xb02d('0x70')][_0x5a4534]),'WhatsappQueueId':Number(_0x1c78b4[_0xb02d('0x4d')]['id'])});}return _0x33eb91;});}})[_0xb02d('0x29')](respondWithResult(_0x46e177,null))[_0xb02d('0x4b')](handleError(_0x46e177,null));};exports[_0xb02d('0x82')]=function(_0x536e13,_0x21c5ef,_0xa2427f){return db['WhatsappQueue'][_0xb02d('0x4f')]({'where':{'id':_0x536e13['params']['id']}})[_0xb02d('0x29')](handleEntityNotFound(_0x21c5ef,null))[_0xb02d('0x29')](function(_0x3effb2){if(_0x3effb2){return _0x3effb2[_0xb02d('0x82')](_0x536e13[_0xb02d('0x3a')][_0xb02d('0x70')])[_0xb02d('0x29')](function(){if(_['isArray'](_0x536e13[_0xb02d('0x3a')][_0xb02d('0x70')])){for(var _0xa3940d=0x0;_0xa3940d<_0x536e13[_0xb02d('0x3a')][_0xb02d('0x70')]['length'];_0xa3940d+=0x1){socket[_0xb02d('0x83')](_0xb02d('0x84'),{'UserId':Number(_0x536e13[_0xb02d('0x3a')][_0xb02d('0x70')][_0xa3940d]),'WhatsappQueueId':Number(_0x536e13[_0xb02d('0x4d')]['id'])});}}else{socket[_0xb02d('0x83')]('userWhatsappQueue:remove',{'UserId':Number(_0x536e13[_0xb02d('0x3a')][_0xb02d('0x70')]),'WhatsappQueueId':Number(_0x536e13['params']['id'])});}});}})[_0xb02d('0x29')](respondWithStatusCode(_0x21c5ef,null))[_0xb02d('0x4b')](handleError(_0x21c5ef,null));};exports[_0xb02d('0x87')]=function(_0x246b90,_0x18df90,_0x494fcc){var _0x598f3d={};var _0x458954={};var _0xa74eef;var _0x2fcf8c;return db['WhatsappQueue'][_0xb02d('0x5a')]({'where':{'id':_0x246b90['params']['id']}})[_0xb02d('0x29')](handleEntityNotFound(_0x18df90,null))[_0xb02d('0x29')](function(_0x1cb0d0){if(_0x1cb0d0){_0xa74eef=_0x1cb0d0;_0x458954[_0xb02d('0x39')]=_[_0xb02d('0x3b')](db[_0xb02d('0x67')]['rawAttributes']);_0x458954[_0xb02d('0x3a')]=_[_0xb02d('0x3b')](_0x246b90[_0xb02d('0x3a')]);_0x458954[_0xb02d('0x3c')]=_[_0xb02d('0x3d')](_0x458954[_0xb02d('0x39')],_0x458954[_0xb02d('0x3a')]);_0x598f3d[_0xb02d('0x3e')]=_[_0xb02d('0x3d')](_0x458954['model'],qs[_0xb02d('0x3f')](_0x246b90[_0xb02d('0x3a')]['fields']));_0x598f3d[_0xb02d('0x3e')]=_0x598f3d[_0xb02d('0x3e')][_0xb02d('0x40')]?_0x598f3d[_0xb02d('0x3e')]:_0x458954[_0xb02d('0x39')];_0x598f3d['order']=qs[_0xb02d('0x43')](_0x246b90[_0xb02d('0x3a')][_0xb02d('0x43')]);_0x598f3d[_0xb02d('0x44')]=qs[_0xb02d('0x3c')](_[_0xb02d('0x45')](_0x246b90[_0xb02d('0x3a')],_0x458954[_0xb02d('0x3c')]));if(_0x246b90[_0xb02d('0x3a')][_0xb02d('0x5d')]){_0x598f3d[_0xb02d('0x44')]=_[_0xb02d('0x46')](_0x598f3d['where'],{'$or':_['map'](_0x598f3d[_0xb02d('0x3e')],function(_0x2528b3){var _0x5a3017={};_0x5a3017[_0x2528b3]={'$like':'%'+_0x246b90['query'][_0xb02d('0x5d')]+'%'};return _0x5a3017;})});}_0x598f3d=_[_0xb02d('0x46')]({},_0x598f3d,_0x246b90[_0xb02d('0x47')]);return _0xa74eef[_0xb02d('0x87')](_0x598f3d);}})[_0xb02d('0x29')](function(_0x5d805c){if(_0x5d805c){_0x2fcf8c=_0x5d805c[_0xb02d('0x40')];if(!_0x246b90['query'][_0xb02d('0x41')](_0xb02d('0x5c'))){_0x598f3d['limit']=qs['limit'](_0x246b90['query'][_0xb02d('0x23')]);_0x598f3d[_0xb02d('0x22')]=qs['offset'](_0x246b90[_0xb02d('0x3a')][_0xb02d('0x22')]);}return _0xa74eef['getAgents'](_0x598f3d);}})['then'](function(_0x3a3a22){if(_0x3a3a22){return _0x3a3a22?{'count':_0x2fcf8c,'rows':_0x3a3a22}:null;}})['then'](respondWithResult(_0x18df90,null))[_0xb02d('0x4b')](handleError(_0x18df90,null));};
\ No newline at end of file
index 1167aa0..caa134e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9626=['events','WhatsappQueue','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x2b5ad0,_0x9180c2){var _0x4e4f37=function(_0x3582df){while(--_0x3582df){_0x2b5ad0['push'](_0x2b5ad0['shift']());}};_0x4e4f37(++_0x9180c2);}(_0x9626,0x14d));var _0x6962=function(_0x21a526,_0x43af01){_0x21a526=_0x21a526-0x0;var _0x594bcc=_0x9626[_0x21a526];return _0x594bcc;};'use strict';var EventEmitter=require(_0x6962('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0x6962('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x6962('0x2')](0x0);var events={'afterCreate':_0x6962('0x3'),'afterUpdate':_0x6962('0x4'),'afterDestroy':_0x6962('0x5')};function emitEvent(_0x5ba8de){return function(_0x1fce62,_0x475030,_0x52091a){WhatsappQueueEvents[_0x6962('0x6')](_0x5ba8de+':'+_0x1fce62['id'],_0x1fce62);WhatsappQueueEvents['emit'](_0x5ba8de,_0x1fce62);_0x52091a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x6962('0x7')](e,emitEvent(event));}}module[_0x6962('0x8')]=WhatsappQueueEvents;
\ No newline at end of file
+var _0xfa14=['hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','update','remove','emit'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0xfa14,0x1eb));var _0x4fa1=function(_0x7e557a,_0x3e41ab){_0x7e557a=_0x7e557a-0x0;var _0x3aba18=_0xfa14[_0x7e557a];return _0x3aba18;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x4fa1('0x0'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x4fa1('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4fa1('0x2'),'afterDestroy':_0x4fa1('0x3')};function emitEvent(_0x388655){return function(_0x1c6cd7,_0xfc2687,_0x50b218){WhatsappQueueEvents[_0x4fa1('0x4')](_0x388655+':'+_0x1c6cd7['id'],_0x1c6cd7);WhatsappQueueEvents[_0x4fa1('0x4')](_0x388655,_0x1c6cd7);_0x50b218(null);};}for(var e in events){if(events[_0x4fa1('0x5')](e)){var event=events[e];WhatsappQueue[_0x4fa1('0x6')](e,emitEvent(event));}}module[_0x4fa1('0x7')]=WhatsappQueueEvents;
\ No newline at end of file
index c64fdf9..fe15cc0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec55=['path','rimraf','./whatsappQueue.attributes','define','whatsapp_queues','util','api','request-promise'];(function(_0x234c35,_0x20b880){var _0x2366de=function(_0x5a1dd8){while(--_0x5a1dd8){_0x234c35['push'](_0x234c35['shift']());}};_0x2366de(++_0x20b880);}(_0xec55,0xed));var _0x5ec5=function(_0x155924,_0x2a5368){_0x155924=_0x155924-0x0;var _0x262e4b=_0xec55[_0x155924];return _0x262e4b;};'use strict';var _=require('lodash');var util=require(_0x5ec5('0x0'));var logger=require('../../config/logger')(_0x5ec5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5ec5('0x2'));var fs=require('fs');var path=require(_0x5ec5('0x3'));var rimraf=require(_0x5ec5('0x4'));var config=require('../../config/environment');var attributes=require(_0x5ec5('0x5'));module['exports']=function(_0x217102,_0x3bd842){return _0x217102[_0x5ec5('0x6')]('WhatsappQueue',attributes,{'tableName':_0x5ec5('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x643a=['exports','define','WhatsappQueue','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment'];(function(_0x35f66b,_0x2c1a03){var _0x27f484=function(_0x5e99ea){while(--_0x5e99ea){_0x35f66b['push'](_0x35f66b['shift']());}};_0x27f484(++_0x2c1a03);}(_0x643a,0x11b));var _0xa643=function(_0x4f7588,_0x399e6b){_0x4f7588=_0x4f7588-0x0;var _0x535c70=_0x643a[_0x4f7588];return _0x535c70;};'use strict';var _=require(_0xa643('0x0'));var util=require(_0xa643('0x1'));var logger=require(_0xa643('0x2'))(_0xa643('0x3'));var moment=require(_0xa643('0x4'));var BPromise=require(_0xa643('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa643('0x6'));var attributes=require('./whatsappQueue.attributes');module[_0xa643('0x7')]=function(_0x44f414,_0x3d5647){return _0x44f414[_0xa643('0x8')](_0xa643('0x9'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0b7b254..45f461f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd02=['info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','where','attributes','limit','include','map','model','ShowWhatsappQueue','find','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./whatsappQueue.socket','register','then'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xbd02,0x12e));var _0x2bd0=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xbd02[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require(_0x2bd0('0x0'));var util=require(_0x2bd0('0x1'));var moment=require(_0x2bd0('0x2'));var BPromise=require('bluebird');var rs=require(_0x2bd0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2bd0('0x4'))['db'];var utils=require(_0x2bd0('0x5'));var logger=require(_0x2bd0('0x6'))(_0x2bd0('0x7'));var config=require(_0x2bd0('0x8'));var jayson=require(_0x2bd0('0x9'));var client=jayson[_0x2bd0('0xa')][_0x2bd0('0xb')]({'port':0x232a});config[_0x2bd0('0xc')]=_[_0x2bd0('0xd')](config[_0x2bd0('0xc')],{'host':_0x2bd0('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2bd0('0xc')]));require(_0x2bd0('0xf'))[_0x2bd0('0x10')](socket);function respondWithRpcPromise(_0x32f0d0,_0x145634,_0x3a4586){return new BPromise(function(_0x5a7c28,_0x440979){return client['request'](_0x32f0d0,_0x3a4586)[_0x2bd0('0x11')](function(_0x4f8e66){logger[_0x2bd0('0x12')](_0x2bd0('0x13'),_0x145634,_0x2bd0('0x14'));logger[_0x2bd0('0x15')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x145634,'request\x20sent',JSON[_0x2bd0('0x16')](_0x4f8e66));if(_0x4f8e66[_0x2bd0('0x17')]){if(_0x4f8e66[_0x2bd0('0x17')][_0x2bd0('0x18')]===0x1f4){logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x145634,_0x4f8e66[_0x2bd0('0x17')][_0x2bd0('0x19')]);return _0x440979(_0x4f8e66[_0x2bd0('0x17')][_0x2bd0('0x19')]);}logger[_0x2bd0('0x17')](_0x2bd0('0x13'),_0x145634,_0x4f8e66[_0x2bd0('0x17')]['message']);return _0x5a7c28(_0x4f8e66['error'][_0x2bd0('0x19')]);}else{logger[_0x2bd0('0x12')](_0x2bd0('0x13'),_0x145634,_0x2bd0('0x14'));_0x5a7c28(_0x4f8e66[_0x2bd0('0x1a')][_0x2bd0('0x19')]);}})[_0x2bd0('0x1b')](function(_0x15df92){logger[_0x2bd0('0x17')](_0x2bd0('0x13'),_0x145634,_0x15df92);_0x440979(_0x15df92);});});}exports[_0x2bd0('0x1c')]=function(_0x2c1679){var _0x57632c=this;return new Promise(function(_0x5cb7ab,_0x1db166){return db[_0x2bd0('0x1d')][_0x2bd0('0x1e')]({'raw':_0x2c1679['options']?_0x2c1679['options']['raw']===undefined?!![]:![]:!![],'where':_0x2c1679[_0x2bd0('0x1f')]?_0x2c1679[_0x2bd0('0x1f')][_0x2bd0('0x20')]||null:null,'attributes':_0x2c1679['options']?_0x2c1679[_0x2bd0('0x1f')][_0x2bd0('0x21')]||null:null,'limit':_0x2c1679[_0x2bd0('0x1f')]?_0x2c1679[_0x2bd0('0x1f')][_0x2bd0('0x22')]||null:null,'include':_0x2c1679[_0x2bd0('0x1f')]?_0x2c1679[_0x2bd0('0x1f')][_0x2bd0('0x23')]?_[_0x2bd0('0x24')](_0x2c1679[_0x2bd0('0x1f')][_0x2bd0('0x23')],function(_0x1dd0da){return{'model':db[_0x1dd0da[_0x2bd0('0x25')]],'as':_0x1dd0da['as'],'attributes':_0x1dd0da['attributes'],'include':_0x1dd0da[_0x2bd0('0x23')]?_[_0x2bd0('0x24')](_0x1dd0da[_0x2bd0('0x23')],function(_0x302460){return{'model':db[_0x302460[_0x2bd0('0x25')]],'as':_0x302460['as'],'attributes':_0x302460['attributes'],'include':_0x302460[_0x2bd0('0x23')]?_[_0x2bd0('0x24')](_0x302460[_0x2bd0('0x23')],function(_0x157dcb){return{'model':db[_0x157dcb[_0x2bd0('0x25')]],'as':_0x157dcb['as'],'attributes':_0x157dcb[_0x2bd0('0x21')]};}):[]};}):[]};}):[]:[]})[_0x2bd0('0x11')](function(_0x374d14){logger[_0x2bd0('0x12')](_0x2bd0('0x1c'),_0x2c1679);logger[_0x2bd0('0x15')](_0x2bd0('0x1c'),_0x2c1679,JSON[_0x2bd0('0x16')](_0x374d14));_0x5cb7ab(_0x374d14);})[_0x2bd0('0x1b')](function(_0x44fbac){logger[_0x2bd0('0x17')]('GetWhatsappQueue',_0x44fbac[_0x2bd0('0x19')],_0x2c1679);_0x1db166(_0x57632c[_0x2bd0('0x17')](0x1f4,_0x44fbac[_0x2bd0('0x19')]));});});};exports[_0x2bd0('0x26')]=function(_0x3d9e14){var _0x239e6e=this;return new Promise(function(_0x277355,_0x3c27fe){return db[_0x2bd0('0x1d')][_0x2bd0('0x27')]({'raw':_0x3d9e14[_0x2bd0('0x1f')]?_0x3d9e14[_0x2bd0('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x3d9e14[_0x2bd0('0x1f')]?_0x3d9e14['options'][_0x2bd0('0x20')]||null:null,'attributes':_0x3d9e14[_0x2bd0('0x1f')]?_0x3d9e14[_0x2bd0('0x1f')][_0x2bd0('0x21')]||null:null,'include':_0x3d9e14[_0x2bd0('0x1f')]?_0x3d9e14[_0x2bd0('0x1f')][_0x2bd0('0x23')]?_[_0x2bd0('0x24')](_0x3d9e14['options']['include'],function(_0x23b018){return{'model':db[_0x23b018['model']],'as':_0x23b018['as'],'attributes':_0x23b018[_0x2bd0('0x21')],'include':_0x23b018[_0x2bd0('0x23')]?_[_0x2bd0('0x24')](_0x23b018[_0x2bd0('0x23')],function(_0x5a79ad){return{'model':db[_0x5a79ad[_0x2bd0('0x25')]],'as':_0x5a79ad['as'],'attributes':_0x5a79ad['attributes'],'include':_0x5a79ad[_0x2bd0('0x23')]?_['map'](_0x5a79ad[_0x2bd0('0x23')],function(_0x48c9a0){return{'model':db[_0x48c9a0[_0x2bd0('0x25')]],'as':_0x48c9a0['as'],'attributes':_0x48c9a0['attributes']};}):[]};}):[]};}):[]:[]})[_0x2bd0('0x11')](function(_0x97afbe){logger[_0x2bd0('0x12')]('ShowWhatsappQueue',_0x3d9e14);logger[_0x2bd0('0x15')](_0x2bd0('0x26'),_0x3d9e14,JSON[_0x2bd0('0x16')](_0x97afbe));_0x277355(_0x97afbe);})[_0x2bd0('0x1b')](function(_0xba7bde){logger[_0x2bd0('0x17')](_0x2bd0('0x26'),_0xba7bde[_0x2bd0('0x19')],_0x3d9e14);_0x3c27fe(_0x239e6e['error'](0x1f4,_0xba7bde[_0x2bd0('0x19')]));});});};
\ No newline at end of file
+var _0x35ab=['options','raw','where','attributes','limit','map','include','model','ShowWhatsappQueue','find','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./whatsappQueue.socket','register','request','then','WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','GetWhatsappQueue','WhatsappQueue','findAll'];(function(_0x1bdbef,_0x50c9cb){var _0x182865=function(_0x471f7f){while(--_0x471f7f){_0x1bdbef['push'](_0x1bdbef['shift']());}};_0x182865(++_0x50c9cb);}(_0x35ab,0x100));var _0xb35a=function(_0x217372,_0x1822ce){_0x217372=_0x217372-0x0;var _0x2715a1=_0x35ab[_0x217372];return _0x2715a1;};'use strict';var _=require('lodash');var util=require(_0xb35a('0x0'));var moment=require('moment');var BPromise=require(_0xb35a('0x1'));var rs=require(_0xb35a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb35a('0x3'))['db'];var utils=require(_0xb35a('0x4'));var logger=require(_0xb35a('0x5'))(_0xb35a('0x6'));var config=require(_0xb35a('0x7'));var jayson=require(_0xb35a('0x8'));var client=jayson[_0xb35a('0x9')]['http']({'port':0x232a});config[_0xb35a('0xa')]=_[_0xb35a('0xb')](config['redis'],{'host':_0xb35a('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb35a('0xa')]));require(_0xb35a('0xd'))[_0xb35a('0xe')](socket);function respondWithRpcPromise(_0x228d48,_0x30bd9c,_0x21d3c6){return new BPromise(function(_0x418ac1,_0x102fb8){return client[_0xb35a('0xf')](_0x228d48,_0x21d3c6)[_0xb35a('0x10')](function(_0x341e87){logger['info'](_0xb35a('0x11'),_0x30bd9c,'request\x20sent');logger[_0xb35a('0x12')](_0xb35a('0x13'),_0x30bd9c,'request\x20sent',JSON[_0xb35a('0x14')](_0x341e87));if(_0x341e87[_0xb35a('0x15')]){if(_0x341e87[_0xb35a('0x15')][_0xb35a('0x16')]===0x1f4){logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x30bd9c,_0x341e87[_0xb35a('0x15')][_0xb35a('0x17')]);return _0x102fb8(_0x341e87[_0xb35a('0x15')]['message']);}logger[_0xb35a('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x30bd9c,_0x341e87[_0xb35a('0x15')][_0xb35a('0x17')]);return _0x418ac1(_0x341e87[_0xb35a('0x15')][_0xb35a('0x17')]);}else{logger[_0xb35a('0x18')](_0xb35a('0x11'),_0x30bd9c,_0xb35a('0x19'));_0x418ac1(_0x341e87[_0xb35a('0x1a')][_0xb35a('0x17')]);}})[_0xb35a('0x1b')](function(_0x3b25a6){logger[_0xb35a('0x15')](_0xb35a('0x11'),_0x30bd9c,_0x3b25a6);_0x102fb8(_0x3b25a6);});});}exports[_0xb35a('0x1c')]=function(_0x169487){var _0x5cdb87=this;return new Promise(function(_0x4d7bbe,_0x46c421){return db[_0xb35a('0x1d')][_0xb35a('0x1e')]({'raw':_0x169487['options']?_0x169487[_0xb35a('0x1f')][_0xb35a('0x20')]===undefined?!![]:![]:!![],'where':_0x169487[_0xb35a('0x1f')]?_0x169487[_0xb35a('0x1f')][_0xb35a('0x21')]||null:null,'attributes':_0x169487[_0xb35a('0x1f')]?_0x169487[_0xb35a('0x1f')][_0xb35a('0x22')]||null:null,'limit':_0x169487[_0xb35a('0x1f')]?_0x169487[_0xb35a('0x1f')][_0xb35a('0x23')]||null:null,'include':_0x169487[_0xb35a('0x1f')]?_0x169487['options']['include']?_[_0xb35a('0x24')](_0x169487[_0xb35a('0x1f')][_0xb35a('0x25')],function(_0x2b92fc){return{'model':db[_0x2b92fc[_0xb35a('0x26')]],'as':_0x2b92fc['as'],'attributes':_0x2b92fc[_0xb35a('0x22')],'include':_0x2b92fc[_0xb35a('0x25')]?_['map'](_0x2b92fc['include'],function(_0x5e0420){return{'model':db[_0x5e0420[_0xb35a('0x26')]],'as':_0x5e0420['as'],'attributes':_0x5e0420[_0xb35a('0x22')],'include':_0x5e0420[_0xb35a('0x25')]?_['map'](_0x5e0420['include'],function(_0x118b98){return{'model':db[_0x118b98['model']],'as':_0x118b98['as'],'attributes':_0x118b98[_0xb35a('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x27d70a){logger[_0xb35a('0x18')](_0xb35a('0x1c'),_0x169487);logger[_0xb35a('0x12')](_0xb35a('0x1c'),_0x169487,JSON[_0xb35a('0x14')](_0x27d70a));_0x4d7bbe(_0x27d70a);})[_0xb35a('0x1b')](function(_0x15438e){logger['error'](_0xb35a('0x1c'),_0x15438e[_0xb35a('0x17')],_0x169487);_0x46c421(_0x5cdb87[_0xb35a('0x15')](0x1f4,_0x15438e[_0xb35a('0x17')]));});});};exports[_0xb35a('0x27')]=function(_0x5e15d4){var _0x31df4a=this;return new Promise(function(_0x4c1a51,_0x4a66a5){return db[_0xb35a('0x1d')][_0xb35a('0x28')]({'raw':_0x5e15d4[_0xb35a('0x1f')]?_0x5e15d4[_0xb35a('0x1f')][_0xb35a('0x20')]===undefined?!![]:![]:!![],'where':_0x5e15d4[_0xb35a('0x1f')]?_0x5e15d4[_0xb35a('0x1f')][_0xb35a('0x21')]||null:null,'attributes':_0x5e15d4[_0xb35a('0x1f')]?_0x5e15d4['options'][_0xb35a('0x22')]||null:null,'include':_0x5e15d4[_0xb35a('0x1f')]?_0x5e15d4[_0xb35a('0x1f')][_0xb35a('0x25')]?_[_0xb35a('0x24')](_0x5e15d4[_0xb35a('0x1f')][_0xb35a('0x25')],function(_0x43a5e1){return{'model':db[_0x43a5e1[_0xb35a('0x26')]],'as':_0x43a5e1['as'],'attributes':_0x43a5e1['attributes'],'include':_0x43a5e1['include']?_[_0xb35a('0x24')](_0x43a5e1['include'],function(_0x390f65){return{'model':db[_0x390f65[_0xb35a('0x26')]],'as':_0x390f65['as'],'attributes':_0x390f65[_0xb35a('0x22')],'include':_0x390f65[_0xb35a('0x25')]?_['map'](_0x390f65[_0xb35a('0x25')],function(_0x2c1dce){return{'model':db[_0x2c1dce[_0xb35a('0x26')]],'as':_0x2c1dce['as'],'attributes':_0x2c1dce[_0xb35a('0x22')]};}):[]};}):[]};}):[]:[]})[_0xb35a('0x10')](function(_0x12c60){logger[_0xb35a('0x18')]('ShowWhatsappQueue',_0x5e15d4);logger[_0xb35a('0x12')](_0xb35a('0x27'),_0x5e15d4,JSON[_0xb35a('0x14')](_0x12c60));_0x4c1a51(_0x12c60);})[_0xb35a('0x1b')](function(_0x3d4ea9){logger[_0xb35a('0x15')]('ShowWhatsappQueue',_0x3d4ea9[_0xb35a('0x17')],_0x5e15d4);_0x4a66a5(_0x31df4a[_0xb35a('0x15')](0x1f4,_0x3d4ea9['message']));});});};
\ No newline at end of file
index 2de42ee..07695e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b81=['update','removeListener','register','whatsappQueue:','./whatsappQueue.events','remove'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x9b81,0x1d8));var _0x19b8=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x9b81[_0x122ef9];return _0x42fba0;};'use strict';var WhatsappQueueEvents=require(_0x19b8('0x0'));var events=['save',_0x19b8('0x1'),_0x19b8('0x2')];function createListener(_0x328ee8,_0x2113a4){return function(_0x1f5d95){_0x2113a4['emit'](_0x328ee8,_0x1f5d95);};}function removeListener(_0x458b2f,_0x3eb679){return function(){WhatsappQueueEvents[_0x19b8('0x3')](_0x458b2f,_0x3eb679);};}exports[_0x19b8('0x4')]=function(_0x136921){for(var _0x276af1=0x0,_0x3f2343=events['length'];_0x276af1<_0x3f2343;_0x276af1++){var _0x425271=events[_0x276af1];var _0x8e5f25=createListener(_0x19b8('0x5')+_0x425271,_0x136921);WhatsappQueueEvents['on'](_0x425271,_0x8e5f25);}};
\ No newline at end of file
+var _0xcfb7=['emit','removeListener','length','whatsappQueue:','save','remove','update'];(function(_0x446b7a,_0x2fef19){var _0x41ee4d=function(_0x197c76){while(--_0x197c76){_0x446b7a['push'](_0x446b7a['shift']());}};_0x41ee4d(++_0x2fef19);}(_0xcfb7,0x6d));var _0x7cfb=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xcfb7[_0x376b45];return _0x2341b3;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0x7cfb('0x0'),_0x7cfb('0x1'),_0x7cfb('0x2')];function createListener(_0x2e2a55,_0x5bb373){return function(_0x226432){_0x5bb373[_0x7cfb('0x3')](_0x2e2a55,_0x226432);};}function removeListener(_0x24d644,_0x4e0324){return function(){WhatsappQueueEvents[_0x7cfb('0x4')](_0x24d644,_0x4e0324);};}exports['register']=function(_0x8bd44e){for(var _0x2edccb=0x0,_0x4fb72b=events[_0x7cfb('0x5')];_0x2edccb<_0x4fb72b;_0x2edccb++){var _0x3ea3cd=events[_0x2edccb];var _0x24cfc9=createListener(_0x7cfb('0x6')+_0x3ea3cd,_0x8bd44e);WhatsappQueueEvents['on'](_0x3ea3cd,_0x24cfc9);}};
\ No newline at end of file
index 1d3bbae..81ae011 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f38=['util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappQueueReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports'];(function(_0x585657,_0x1c0492){var _0x321e0c=function(_0x11f772){while(--_0x11f772){_0x585657['push'](_0x585657['shift']());}};_0x321e0c(++_0x1c0492);}(_0x5f38,0x150));var _0x85f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f38[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x85f3('0x0'));var path=require(_0x85f3('0x1'));var timeout=require('connect-timeout');var express=require(_0x85f3('0x2'));var router=express['Router']();var fs_extra=require(_0x85f3('0x3'));var auth=require(_0x85f3('0x4'));var interaction=require(_0x85f3('0x5'));var config=require('../../config/environment');var controller=require(_0x85f3('0x6'));router[_0x85f3('0x7')]('/',auth['isAuthenticated'](),controller[_0x85f3('0x8')]);router['get'](_0x85f3('0x9'),auth['isAuthenticated'](),controller[_0x85f3('0xa')]);router[_0x85f3('0x7')](_0x85f3('0xb'),auth[_0x85f3('0xc')](),controller[_0x85f3('0xd')]);router[_0x85f3('0xe')]('/',auth[_0x85f3('0xc')](),controller[_0x85f3('0xf')]);router[_0x85f3('0x10')]('/:id',auth[_0x85f3('0xc')](),controller[_0x85f3('0x11')]);router[_0x85f3('0x12')](_0x85f3('0xb'),auth[_0x85f3('0xc')](),controller[_0x85f3('0x13')]);module[_0x85f3('0x14')]=router;
\ No newline at end of file
+var _0x6640=['../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','create','put','/:id','update','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x6640,0x1db));var _0x0664=function(_0x22cb5f,_0x2cdd63){_0x22cb5f=_0x22cb5f-0x0;var _0x274d36=_0x6640[_0x22cb5f];return _0x274d36;};'use strict';var multer=require(_0x0664('0x0'));var util=require(_0x0664('0x1'));var path=require(_0x0664('0x2'));var timeout=require(_0x0664('0x3'));var express=require(_0x0664('0x4'));var router=express['Router']();var fs_extra=require(_0x0664('0x5'));var auth=require(_0x0664('0x6'));var interaction=require(_0x0664('0x7'));var config=require(_0x0664('0x8'));var controller=require(_0x0664('0x9'));router[_0x0664('0xa')]('/',auth[_0x0664('0xb')](),controller[_0x0664('0xc')]);router[_0x0664('0xa')](_0x0664('0xd'),auth['isAuthenticated'](),controller[_0x0664('0xe')]);router[_0x0664('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0664('0xf')]);router['post']('/',auth[_0x0664('0xb')](),controller[_0x0664('0x10')]);router[_0x0664('0x11')](_0x0664('0x12'),auth['isAuthenticated'](),controller[_0x0664('0x13')]);router[_0x0664('0x14')](_0x0664('0x12'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 5454b4e..a768176 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x4cb623,_0x1d7d2e){var _0x47f2af=function(_0x73b1fa){while(--_0x73b1fa){_0x4cb623['push'](_0x4cb623['shift']());}};_0x47f2af(++_0x1d7d2e);}(_0x7a54,0x106));var _0x47a5=function(_0x5e1c1e,_0xffdbfc){_0x5e1c1e=_0x5e1c1e-0x0;var _0x166e37=_0x7a54[_0x5e1c1e];return _0x166e37;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}};
\ No newline at end of file
+var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x9ca43d,_0x49b50b){var _0x2353f0=function(_0x3c19c7){while(--_0x3c19c7){_0x9ca43d['push'](_0x9ca43d['shift']());}};_0x2353f0(++_0x49b50b);}(_0x7a54,0x106));var _0x47a5=function(_0x4af9bb,_0x1943ad){_0x4af9bb=_0x4af9bb-0x0;var _0x4e91f3=_0x7a54[_0x4af9bb];return _0x4e91f3;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}};
\ No newline at end of file
index 7fe2645..7ceabac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6324=['options','WhatsappQueueReport','includeAll','rows','show','keys','intersection','include','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','map','rawAttributes','fieldName','model','name','query','filters','attributes','fields','length','hasOwnProperty','order','sort','pick','merge','where','type','VIRTUAL','filter'];(function(_0xe6645e,_0x44dd2c){var _0x25f3c3=function(_0x5ba08a){while(--_0x5ba08a){_0xe6645e['push'](_0xe6645e['shift']());}};_0x25f3c3(++_0x44dd2c);}(_0x6324,0x142));var _0x4632=function(_0x3fbf3d,_0x3a80f4){_0x3fbf3d=_0x3fbf3d-0x0;var _0x2ff7a8=_0x6324[_0x3fbf3d];return _0x2ff7a8;};'use strict';var emlformat=require(_0x4632('0x0'));var rimraf=require(_0x4632('0x1'));var zipdir=require(_0x4632('0x2'));var jsonpatch=require(_0x4632('0x3'));var rp=require('request-promise');var moment=require(_0x4632('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4632('0x5'));var util=require('util');var path=require(_0x4632('0x6'));var sox=require('sox');var csv=require(_0x4632('0x7'));var ejs=require(_0x4632('0x8'));var fs=require('fs');var fs_extra=require(_0x4632('0x9'));var _=require(_0x4632('0xa'));var squel=require('squel');var crypto=require(_0x4632('0xb'));var jsforce=require(_0x4632('0xc'));var deskjs=require(_0x4632('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4632('0xe'));var Papa=require(_0x4632('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4632('0x10'));var as=require(_0x4632('0x11'));var hardwareService=require(_0x4632('0x12'));var logger=require(_0x4632('0x13'))(_0x4632('0x14'));var utils=require(_0x4632('0x15'));var config=require(_0x4632('0x16'));var licenseUtil=require(_0x4632('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b3f0f,_0x499d88){_0x499d88=_0x499d88||0xcc;return function(_0x4719f7){if(_0x4719f7){return _0x2b3f0f[_0x4632('0x18')](_0x499d88);}return _0x2b3f0f[_0x4632('0x19')](_0x499d88)[_0x4632('0x1a')]();};}function respondWithResult(_0x51ee37,_0x3ba361){_0x3ba361=_0x3ba361||0xc8;return function(_0x255882){if(_0x255882){return _0x51ee37[_0x4632('0x19')](_0x3ba361)[_0x4632('0x1b')](_0x255882);}};}function respondWithFilteredResult(_0x1c1be0,_0x5438ab){return function(_0x47b349){if(_0x47b349){var _0x2fd7ae=typeof _0x5438ab[_0x4632('0x1c')]===_0x4632('0x1d')&&typeof _0x5438ab[_0x4632('0x1e')]==='undefined';var _0x158831=_0x47b349[_0x4632('0x1f')];var _0x1a94c0=_0x2fd7ae?0x0:_0x5438ab['offset'];var _0x3cddfa=_0x2fd7ae?_0x47b349[_0x4632('0x1f')]:_0x5438ab['offset']+_0x5438ab['limit'];var _0x1c0523;if(_0x3cddfa>=_0x158831){_0x3cddfa=_0x158831;_0x1c0523=0xc8;}else{_0x1c0523=0xce;}_0x1c1be0[_0x4632('0x19')](_0x1c0523);return _0x1c1be0[_0x4632('0x20')](_0x4632('0x21'),_0x1a94c0+'-'+_0x3cddfa+'/'+_0x158831)[_0x4632('0x1b')](_0x47b349);}return null;};}function patchUpdates(_0x3d2d23){return function(_0x9ab826){try{jsonpatch[_0x4632('0x22')](_0x9ab826,_0x3d2d23,!![]);}catch(_0x29f875){return BPromise[_0x4632('0x23')](_0x29f875);}return _0x9ab826[_0x4632('0x24')]();};}function saveUpdates(_0x2d656a,_0x2ca6a5){return function(_0x263907){if(_0x263907){return _0x263907[_0x4632('0x25')](_0x2d656a)[_0x4632('0x26')](function(_0x4264d5){return _0x4264d5;});}return null;};}function removeEntity(_0x3537ed,_0x380a9f){return function(_0x1e1b86){if(_0x1e1b86){return _0x1e1b86[_0x4632('0x27')]()[_0x4632('0x26')](function(){_0x3537ed[_0x4632('0x19')](0xcc)[_0x4632('0x1a')]();});}};}function handleEntityNotFound(_0xb074d,_0x1b8de0){return function(_0x4af026){if(!_0x4af026){_0xb074d[_0x4632('0x18')](0x194);}return _0x4af026;};}function handleError(_0x21118c,_0x372679){_0x372679=_0x372679||0x1f4;return function(_0x22d0f5){logger[_0x4632('0x28')](_0x22d0f5[_0x4632('0x29')]);if(_0x22d0f5['name']){delete _0x22d0f5['name'];}_0x21118c[_0x4632('0x19')](_0x372679)[_0x4632('0x2a')](_0x22d0f5);};}exports[_0x4632('0x2b')]=function(_0x35a533,_0x34079f){var _0x119d1b={},_0x3570b2={},_0x5e2ee4={'count':0x0,'rows':[]};var _0x42d505=_[_0x4632('0x2c')](db['WhatsappQueueReport'][_0x4632('0x2d')],function(_0x5316f7){return{'name':_0x5316f7[_0x4632('0x2e')],'type':_0x5316f7['type']['key']};});_0x3570b2[_0x4632('0x2f')]=_[_0x4632('0x2c')](_0x42d505,_0x4632('0x30'));_0x3570b2['query']=_['keys'](_0x35a533[_0x4632('0x31')]);_0x3570b2[_0x4632('0x32')]=_['intersection'](_0x3570b2['model'],_0x3570b2[_0x4632('0x31')]);_0x119d1b[_0x4632('0x33')]=_['intersection'](_0x3570b2[_0x4632('0x2f')],qs[_0x4632('0x34')](_0x35a533[_0x4632('0x31')][_0x4632('0x34')]));_0x119d1b[_0x4632('0x33')]=_0x119d1b['attributes'][_0x4632('0x35')]?_0x119d1b[_0x4632('0x33')]:_0x3570b2['model'];if(!_0x35a533['query'][_0x4632('0x36')]('nolimit')){_0x119d1b['limit']=qs[_0x4632('0x1e')](_0x35a533['query'][_0x4632('0x1e')]);_0x119d1b[_0x4632('0x1c')]=qs[_0x4632('0x1c')](_0x35a533['query'][_0x4632('0x1c')]);}_0x119d1b[_0x4632('0x37')]=qs[_0x4632('0x38')](_0x35a533[_0x4632('0x31')][_0x4632('0x38')]);_0x119d1b['where']=qs['filters'](_[_0x4632('0x39')](_0x35a533[_0x4632('0x31')],_0x3570b2[_0x4632('0x32')]),_0x42d505);if(_0x35a533['query']['filter']){_0x119d1b['where']=_[_0x4632('0x3a')](_0x119d1b[_0x4632('0x3b')],{'$or':_['map'](_0x42d505,function(_0x3809aa){if(_0x3809aa[_0x4632('0x3c')]!==_0x4632('0x3d')){var _0x3adf41={};_0x3adf41[_0x3809aa[_0x4632('0x30')]]={'$like':'%'+_0x35a533[_0x4632('0x31')][_0x4632('0x3e')]+'%'};return _0x3adf41;}})});}_0x119d1b=_[_0x4632('0x3a')]({},_0x119d1b,_0x35a533[_0x4632('0x3f')]);var _0x2c04a8={'where':_0x119d1b[_0x4632('0x3b')]};return db[_0x4632('0x40')]['count'](_0x2c04a8)[_0x4632('0x26')](function(_0x45bff6){_0x5e2ee4['count']=_0x45bff6;if(_0x35a533[_0x4632('0x31')][_0x4632('0x41')]){_0x119d1b['include']=[{'all':!![]}];}return db[_0x4632('0x40')]['findAll'](_0x119d1b);})[_0x4632('0x26')](function(_0x28df3b){_0x5e2ee4[_0x4632('0x42')]=_0x28df3b;return _0x5e2ee4;})[_0x4632('0x26')](respondWithFilteredResult(_0x34079f,_0x119d1b))['catch'](handleError(_0x34079f,null));};exports[_0x4632('0x43')]=function(_0x29381a,_0x23ef38){var _0x279298={'raw':!![],'where':{'id':_0x29381a['params']['id']}},_0x5cc716={};_0x5cc716[_0x4632('0x2f')]=_[_0x4632('0x44')](db[_0x4632('0x40')]['rawAttributes']);_0x5cc716[_0x4632('0x31')]=_[_0x4632('0x44')](_0x29381a[_0x4632('0x31')]);_0x5cc716[_0x4632('0x32')]=_[_0x4632('0x45')](_0x5cc716[_0x4632('0x2f')],_0x5cc716[_0x4632('0x31')]);_0x279298['attributes']=_[_0x4632('0x45')](_0x5cc716[_0x4632('0x2f')],qs[_0x4632('0x34')](_0x29381a[_0x4632('0x31')][_0x4632('0x34')]));_0x279298['attributes']=_0x279298['attributes'][_0x4632('0x35')]?_0x279298[_0x4632('0x33')]:_0x5cc716[_0x4632('0x2f')];if(_0x29381a[_0x4632('0x31')]['includeAll']){_0x279298[_0x4632('0x46')]=[{'all':!![]}];}_0x279298=_[_0x4632('0x3a')]({},_0x279298,_0x29381a[_0x4632('0x3f')]);return db[_0x4632('0x40')][_0x4632('0x47')](_0x279298)['then'](handleEntityNotFound(_0x23ef38,null))[_0x4632('0x26')](respondWithResult(_0x23ef38,null))[_0x4632('0x48')](handleError(_0x23ef38,null));};exports[_0x4632('0x49')]=function(_0xcce5db,_0x3676fa){return db[_0x4632('0x40')][_0x4632('0x49')](_0xcce5db[_0x4632('0x4a')],{})[_0x4632('0x26')](respondWithResult(_0x3676fa,0xc9))[_0x4632('0x48')](handleError(_0x3676fa,null));};exports[_0x4632('0x25')]=function(_0x517584,_0xc3ffd0){if(_0x517584[_0x4632('0x4a')]['id']){delete _0x517584[_0x4632('0x4a')]['id'];}return db['WhatsappQueueReport'][_0x4632('0x47')]({'where':{'id':_0x517584[_0x4632('0x4b')]['id']}})[_0x4632('0x26')](handleEntityNotFound(_0xc3ffd0,null))[_0x4632('0x26')](saveUpdates(_0x517584[_0x4632('0x4a')],null))[_0x4632('0x26')](respondWithResult(_0xc3ffd0,null))[_0x4632('0x48')](handleError(_0xc3ffd0,null));};exports[_0x4632('0x27')]=function(_0x1f43b6,_0x1aa831){return db['WhatsappQueueReport'][_0x4632('0x47')]({'where':{'id':_0x1f43b6[_0x4632('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1aa831,null))[_0x4632('0x26')](removeEntity(_0x1aa831,null))[_0x4632('0x48')](handleError(_0x1aa831,null));};exports[_0x4632('0x4c')]=function(_0x28e7fb,_0x2c59f5){return db[_0x4632('0x40')][_0x4632('0x4c')]()[_0x4632('0x26')](respondWithResult(_0x2c59f5,null))[_0x4632('0x48')](handleError(_0x2c59f5,null));};
\ No newline at end of file
+var _0x236c=['model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','map','WhatsappQueueReport','fieldName','key','query','filters','intersection'];(function(_0x19bc32,_0x38ddf1){var _0x353413=function(_0x214f2f){while(--_0x214f2f){_0x19bc32['push'](_0x19bc32['shift']());}};_0x353413(++_0x38ddf1);}(_0x236c,0x155));var _0xc236=function(_0x5594c0,_0x2d73d7){_0x5594c0=_0x5594c0-0x0;var _0xd88623=_0x236c[_0x5594c0];return _0xd88623;};'use strict';var emlformat=require(_0xc236('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc236('0x1'));var jsonpatch=require(_0xc236('0x2'));var rp=require(_0xc236('0x3'));var moment=require(_0xc236('0x4'));var BPromise=require(_0xc236('0x5'));var Mustache=require('mustache');var util=require(_0xc236('0x6'));var path=require(_0xc236('0x7'));var sox=require(_0xc236('0x8'));var csv=require(_0xc236('0x9'));var ejs=require(_0xc236('0xa'));var fs=require('fs');var fs_extra=require(_0xc236('0xb'));var _=require('lodash');var squel=require(_0xc236('0xc'));var crypto=require(_0xc236('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc236('0xe'));var Papa=require('papaparse');var Redis=require(_0xc236('0xf'));var authService=require(_0xc236('0x10'));var qs=require(_0xc236('0x11'));var as=require(_0xc236('0x12'));var hardwareService=require(_0xc236('0x13'));var logger=require('../../config/logger')(_0xc236('0x14'));var utils=require(_0xc236('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc236('0x16'));var db=require(_0xc236('0x17'))['db'];function respondWithStatusCode(_0x5ee3a5,_0x5b9638){_0x5b9638=_0x5b9638||0xcc;return function(_0x5bce83){if(_0x5bce83){return _0x5ee3a5['sendStatus'](_0x5b9638);}return _0x5ee3a5[_0xc236('0x18')](_0x5b9638)[_0xc236('0x19')]();};}function respondWithResult(_0x2184c9,_0x71bce2){_0x71bce2=_0x71bce2||0xc8;return function(_0x5052db){if(_0x5052db){return _0x2184c9[_0xc236('0x18')](_0x71bce2)['json'](_0x5052db);}};}function respondWithFilteredResult(_0x5221bf,_0x9a65e8){return function(_0x32f2fd){if(_0x32f2fd){var _0x443a46=typeof _0x9a65e8[_0xc236('0x1a')]===_0xc236('0x1b')&&typeof _0x9a65e8['limit']==='undefined';var _0x57355b=_0x32f2fd[_0xc236('0x1c')];var _0x76f45=_0x443a46?0x0:_0x9a65e8[_0xc236('0x1a')];var _0x541a20=_0x443a46?_0x32f2fd[_0xc236('0x1c')]:_0x9a65e8['offset']+_0x9a65e8['limit'];var _0x1eafba;if(_0x541a20>=_0x57355b){_0x541a20=_0x57355b;_0x1eafba=0xc8;}else{_0x1eafba=0xce;}_0x5221bf[_0xc236('0x18')](_0x1eafba);return _0x5221bf[_0xc236('0x1d')](_0xc236('0x1e'),_0x76f45+'-'+_0x541a20+'/'+_0x57355b)[_0xc236('0x1f')](_0x32f2fd);}return null;};}function patchUpdates(_0x27c6ab){return function(_0x3f0e2f){try{jsonpatch[_0xc236('0x20')](_0x3f0e2f,_0x27c6ab,!![]);}catch(_0x54ffac){return BPromise[_0xc236('0x21')](_0x54ffac);}return _0x3f0e2f[_0xc236('0x22')]();};}function saveUpdates(_0x4a9006,_0x208c3f){return function(_0x34d73a){if(_0x34d73a){return _0x34d73a[_0xc236('0x23')](_0x4a9006)[_0xc236('0x24')](function(_0x27afba){return _0x27afba;});}return null;};}function removeEntity(_0x21fab8,_0x3a315b){return function(_0xf921e6){if(_0xf921e6){return _0xf921e6[_0xc236('0x25')]()[_0xc236('0x24')](function(){_0x21fab8[_0xc236('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x308cd6,_0x21d78f){return function(_0x356042){if(!_0x356042){_0x308cd6[_0xc236('0x26')](0x194);}return _0x356042;};}function handleError(_0x561da1,_0x42f248){_0x42f248=_0x42f248||0x1f4;return function(_0x5da4b2){logger['error'](_0x5da4b2[_0xc236('0x27')]);if(_0x5da4b2['name']){delete _0x5da4b2[_0xc236('0x28')];}_0x561da1['status'](_0x42f248)[_0xc236('0x29')](_0x5da4b2);};}exports['index']=function(_0x423842,_0x1d144b){var _0x4f5175={},_0x5a61b5={},_0x265c8d={'count':0x0,'rows':[]};var _0x1fd31d=_[_0xc236('0x2a')](db[_0xc236('0x2b')]['rawAttributes'],function(_0x4e3262){return{'name':_0x4e3262[_0xc236('0x2c')],'type':_0x4e3262['type'][_0xc236('0x2d')]};});_0x5a61b5['model']=_[_0xc236('0x2a')](_0x1fd31d,_0xc236('0x28'));_0x5a61b5['query']=_['keys'](_0x423842[_0xc236('0x2e')]);_0x5a61b5[_0xc236('0x2f')]=_[_0xc236('0x30')](_0x5a61b5[_0xc236('0x31')],_0x5a61b5[_0xc236('0x2e')]);_0x4f5175[_0xc236('0x32')]=_[_0xc236('0x30')](_0x5a61b5[_0xc236('0x31')],qs[_0xc236('0x33')](_0x423842['query']['fields']));_0x4f5175['attributes']=_0x4f5175[_0xc236('0x32')][_0xc236('0x34')]?_0x4f5175[_0xc236('0x32')]:_0x5a61b5[_0xc236('0x31')];if(!_0x423842[_0xc236('0x2e')][_0xc236('0x35')](_0xc236('0x36'))){_0x4f5175['limit']=qs[_0xc236('0x37')](_0x423842[_0xc236('0x2e')][_0xc236('0x37')]);_0x4f5175['offset']=qs[_0xc236('0x1a')](_0x423842[_0xc236('0x2e')][_0xc236('0x1a')]);}_0x4f5175[_0xc236('0x38')]=qs['sort'](_0x423842[_0xc236('0x2e')][_0xc236('0x39')]);_0x4f5175[_0xc236('0x3a')]=qs[_0xc236('0x2f')](_[_0xc236('0x3b')](_0x423842[_0xc236('0x2e')],_0x5a61b5[_0xc236('0x2f')]),_0x1fd31d);if(_0x423842[_0xc236('0x2e')][_0xc236('0x3c')]){_0x4f5175[_0xc236('0x3a')]=_[_0xc236('0x3d')](_0x4f5175[_0xc236('0x3a')],{'$or':_[_0xc236('0x2a')](_0x1fd31d,function(_0x237193){if(_0x237193[_0xc236('0x3e')]!==_0xc236('0x3f')){var _0x46db5a={};_0x46db5a[_0x237193['name']]={'$like':'%'+_0x423842['query']['filter']+'%'};return _0x46db5a;}})});}_0x4f5175=_['merge']({},_0x4f5175,_0x423842[_0xc236('0x40')]);var _0x5c4739={'where':_0x4f5175[_0xc236('0x3a')]};return db[_0xc236('0x2b')][_0xc236('0x1c')](_0x5c4739)[_0xc236('0x24')](function(_0xdf7897){_0x265c8d[_0xc236('0x1c')]=_0xdf7897;if(_0x423842[_0xc236('0x2e')][_0xc236('0x41')]){_0x4f5175[_0xc236('0x42')]=[{'all':!![]}];}return db[_0xc236('0x2b')][_0xc236('0x43')](_0x4f5175);})[_0xc236('0x24')](function(_0x3b2f2f){_0x265c8d[_0xc236('0x44')]=_0x3b2f2f;return _0x265c8d;})[_0xc236('0x24')](respondWithFilteredResult(_0x1d144b,_0x4f5175))['catch'](handleError(_0x1d144b,null));};exports[_0xc236('0x45')]=function(_0x24b851,_0x506ba0){var _0xb90a83={'raw':!![],'where':{'id':_0x24b851[_0xc236('0x46')]['id']}},_0x5b0bc5={};_0x5b0bc5['model']=_[_0xc236('0x47')](db[_0xc236('0x2b')][_0xc236('0x48')]);_0x5b0bc5['query']=_[_0xc236('0x47')](_0x24b851[_0xc236('0x2e')]);_0x5b0bc5[_0xc236('0x2f')]=_['intersection'](_0x5b0bc5[_0xc236('0x31')],_0x5b0bc5[_0xc236('0x2e')]);_0xb90a83[_0xc236('0x32')]=_[_0xc236('0x30')](_0x5b0bc5[_0xc236('0x31')],qs[_0xc236('0x33')](_0x24b851['query'][_0xc236('0x33')]));_0xb90a83['attributes']=_0xb90a83[_0xc236('0x32')][_0xc236('0x34')]?_0xb90a83[_0xc236('0x32')]:_0x5b0bc5[_0xc236('0x31')];if(_0x24b851[_0xc236('0x2e')][_0xc236('0x41')]){_0xb90a83[_0xc236('0x42')]=[{'all':!![]}];}_0xb90a83=_['merge']({},_0xb90a83,_0x24b851[_0xc236('0x40')]);return db['WhatsappQueueReport'][_0xc236('0x49')](_0xb90a83)[_0xc236('0x24')](handleEntityNotFound(_0x506ba0,null))['then'](respondWithResult(_0x506ba0,null))[_0xc236('0x4a')](handleError(_0x506ba0,null));};exports[_0xc236('0x4b')]=function(_0x3c1c5c,_0x161890){return db[_0xc236('0x2b')][_0xc236('0x4b')](_0x3c1c5c[_0xc236('0x4c')],{})['then'](respondWithResult(_0x161890,0xc9))['catch'](handleError(_0x161890,null));};exports[_0xc236('0x23')]=function(_0x2afed2,_0x510f7f){if(_0x2afed2[_0xc236('0x4c')]['id']){delete _0x2afed2[_0xc236('0x4c')]['id'];}return db[_0xc236('0x2b')][_0xc236('0x49')]({'where':{'id':_0x2afed2[_0xc236('0x46')]['id']}})[_0xc236('0x24')](handleEntityNotFound(_0x510f7f,null))[_0xc236('0x24')](saveUpdates(_0x2afed2[_0xc236('0x4c')],null))[_0xc236('0x24')](respondWithResult(_0x510f7f,null))['catch'](handleError(_0x510f7f,null));};exports[_0xc236('0x25')]=function(_0x307663,_0x41b7d5){return db[_0xc236('0x2b')][_0xc236('0x49')]({'where':{'id':_0x307663[_0xc236('0x46')]['id']}})[_0xc236('0x24')](handleEntityNotFound(_0x41b7d5,null))['then'](removeEntity(_0x41b7d5,null))[_0xc236('0x4a')](handleError(_0x41b7d5,null));};exports[_0xc236('0x4d')]=function(_0x17c86b,_0x16ff63){return db['WhatsappQueueReport'][_0xc236('0x4d')]()[_0xc236('0x24')](respondWithResult(_0x16ff63,null))[_0xc236('0x4a')](handleError(_0x16ff63,null));};
\ No newline at end of file
index c11b4bf..d1aed33 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3022=['bluebird','request-promise','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','uniqueid','util','api'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x3022,0xa9));var _0x2302=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x3022[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0x2302('0x0'));var logger=require('../../config/logger')(_0x2302('0x1'));var moment=require('moment');var BPromise=require(_0x2302('0x2'));var rp=require(_0x2302('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2302('0x4'));module[_0x2302('0x5')]=function(_0x31a769,_0x42bf4b){return _0x31a769[_0x2302('0x6')](_0x2302('0x7'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x2302('0x8'),'fields':[_0x2302('0x8')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe2e1=['../../config/environment','./whatsappQueueReport.attributes','exports','WhatsappQueueReport','report_whatsapp_queue','uniqueid','util','api','bluebird','request-promise','rimraf'];(function(_0x2212d1,_0x483fc8){var _0x15eec5=function(_0x15e6ac){while(--_0x15e6ac){_0x2212d1['push'](_0x2212d1['shift']());}};_0x15eec5(++_0x483fc8);}(_0xe2e1,0x171));var _0x1e2e=function(_0x1a1eff,_0x7efb6b){_0x1a1eff=_0x1a1eff-0x0;var _0xfd93e9=_0xe2e1[_0x1a1eff];return _0xfd93e9;};'use strict';var _=require('lodash');var util=require(_0x1e2e('0x0'));var logger=require('../../config/logger')(_0x1e2e('0x1'));var moment=require('moment');var BPromise=require(_0x1e2e('0x2'));var rp=require(_0x1e2e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1e2e('0x4'));var config=require(_0x1e2e('0x5'));var attributes=require(_0x1e2e('0x6'));module[_0x1e2e('0x7')]=function(_0x3dbe82,_0x5a740e){return _0x3dbe82['define'](_0x1e2e('0x8'),attributes,{'tableName':_0x1e2e('0x9'),'paranoid':![],'indexes':[{'name':_0x1e2e('0xa'),'fields':[_0x1e2e('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index fd6bead..12a8c41 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d84=['code','message','info','result','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','catch','update','raw','where','limit','debug','UpdateWhatsappQueueReport','lodash','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x20a6fd,_0x3d9778){var _0x1e4c08=function(_0x11c4a2){while(--_0x11c4a2){_0x20a6fd['push'](_0x20a6fd['shift']());}};_0x1e4c08(++_0x3d9778);}(_0x9d84,0x14f));var _0x49d8=function(_0x1b6485,_0x2483e1){_0x1b6485=_0x1b6485-0x0;var _0xa95769=_0x9d84[_0x1b6485];return _0xa95769;};'use strict';var _=require(_0x49d8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x49d8('0x1'))['db'];var utils=require(_0x49d8('0x2'));var logger=require(_0x49d8('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0x49d8('0x4'));var client=jayson[_0x49d8('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x110a9e,_0x55b128,_0x2f7984){return new BPromise(function(_0x5071ab,_0x5d0216){return client[_0x49d8('0x6')](_0x110a9e,_0x2f7984)[_0x49d8('0x7')](function(_0x11ae1f){logger['info'](_0x49d8('0x8'),_0x55b128,_0x49d8('0x9'));logger['debug'](_0x49d8('0xa'),_0x55b128,_0x49d8('0x9'),JSON[_0x49d8('0xb')](_0x11ae1f));if(_0x11ae1f[_0x49d8('0xc')]){if(_0x11ae1f[_0x49d8('0xc')][_0x49d8('0xd')]===0x1f4){logger['error'](_0x49d8('0x8'),_0x55b128,_0x11ae1f['error'][_0x49d8('0xe')]);return _0x5d0216(_0x11ae1f[_0x49d8('0xc')]['message']);}logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x55b128,_0x11ae1f[_0x49d8('0xc')]['message']);return _0x5071ab(_0x11ae1f[_0x49d8('0xc')]['message']);}else{logger[_0x49d8('0xf')](_0x49d8('0x8'),_0x55b128,_0x49d8('0x9'));_0x5071ab(_0x11ae1f[_0x49d8('0x10')][_0x49d8('0xe')]);}})['catch'](function(_0x577d03){logger[_0x49d8('0xc')](_0x49d8('0x8'),_0x55b128,_0x577d03);_0x5d0216(_0x577d03);});});}exports[_0x49d8('0x11')]=function(_0x45ca95){var _0x4fe018=this;return new Promise(function(_0x303318,_0x20c199){return db[_0x49d8('0x12')][_0x49d8('0x13')](_0x45ca95[_0x49d8('0x14')],{'raw':_0x45ca95[_0x49d8('0x15')]?_0x45ca95['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2b8acc){logger[_0x49d8('0xf')](_0x49d8('0x11'),_0x45ca95);logger['debug'](_0x49d8('0x11'),_0x45ca95,JSON[_0x49d8('0xb')](_0x2b8acc));_0x303318(_0x2b8acc);})[_0x49d8('0x16')](function(_0x154b6b){logger[_0x49d8('0xc')]('CreateWhatsappQueueReport',_0x154b6b[_0x49d8('0xe')],_0x45ca95);_0x20c199(_0x4fe018[_0x49d8('0xc')](0x1f4,_0x154b6b['message']));});});};exports['UpdateWhatsappQueueReport']=function(_0x2fe8aa){var _0x1290b6=this;return new Promise(function(_0xf013f4,_0x9e8a59){return db[_0x49d8('0x12')][_0x49d8('0x17')](_0x2fe8aa['body'],{'raw':_0x2fe8aa['options']?_0x2fe8aa[_0x49d8('0x15')][_0x49d8('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2fe8aa[_0x49d8('0x15')]?_0x2fe8aa[_0x49d8('0x15')][_0x49d8('0x19')]||null:null,'attributes':_0x2fe8aa[_0x49d8('0x15')]?_0x2fe8aa[_0x49d8('0x15')]['attributes']||null:null,'limit':_0x2fe8aa[_0x49d8('0x15')]?_0x2fe8aa[_0x49d8('0x15')][_0x49d8('0x1a')]||null:null})[_0x49d8('0x7')](function(_0x23de02){logger[_0x49d8('0xf')]('UpdateWhatsappQueueReport',_0x2fe8aa);logger[_0x49d8('0x1b')](_0x49d8('0x1c'),_0x2fe8aa,JSON['stringify'](_0x23de02));_0xf013f4(_0x23de02);})[_0x49d8('0x16')](function(_0x42d4bb){logger[_0x49d8('0xc')](_0x49d8('0x1c'),_0x42d4bb[_0x49d8('0xe')],_0x2fe8aa);_0x9e8a59(_0x1290b6[_0x49d8('0xc')](0x1f4,_0x42d4bb[_0x49d8('0xe')]));});});};
\ No newline at end of file
+var _0xd518=['jayson/promise','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','CreateWhatsappQueueReport','create','body','options','raw','stringify','UpdateWhatsappQueueReport','WhatsappQueueReport','attributes','limit','util','moment','bluebird','rpc','../../config/environment'];(function(_0x251d9c,_0x580977){var _0x16ae64=function(_0x4d3b53){while(--_0x4d3b53){_0x251d9c['push'](_0x251d9c['shift']());}};_0x16ae64(++_0x580977);}(_0xd518,0x1ab));var _0x8d51=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd518[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x8d51('0x0'));var moment=require(_0x8d51('0x1'));var BPromise=require(_0x8d51('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8d51('0x3'));var config=require(_0x8d51('0x4'));var jayson=require(_0x8d51('0x5'));var client=jayson['client'][_0x8d51('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2be659,_0x431dc5,_0x46b6d7){return new BPromise(function(_0x6c0b90,_0x23af76){return client[_0x8d51('0x7')](_0x2be659,_0x46b6d7)[_0x8d51('0x8')](function(_0x3ece62){logger[_0x8d51('0x9')](_0x8d51('0xa'),_0x431dc5,_0x8d51('0xb'));logger[_0x8d51('0xc')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x431dc5,_0x8d51('0xb'),JSON['stringify'](_0x3ece62));if(_0x3ece62['error']){if(_0x3ece62[_0x8d51('0xd')][_0x8d51('0xe')]===0x1f4){logger[_0x8d51('0xd')]('WhatsappQueueReport,\x20%s,\x20%s',_0x431dc5,_0x3ece62[_0x8d51('0xd')]['message']);return _0x23af76(_0x3ece62[_0x8d51('0xd')][_0x8d51('0xf')]);}logger[_0x8d51('0xd')](_0x8d51('0xa'),_0x431dc5,_0x3ece62[_0x8d51('0xd')][_0x8d51('0xf')]);return _0x6c0b90(_0x3ece62[_0x8d51('0xd')][_0x8d51('0xf')]);}else{logger[_0x8d51('0x9')](_0x8d51('0xa'),_0x431dc5,_0x8d51('0xb'));_0x6c0b90(_0x3ece62['result'][_0x8d51('0xf')]);}})[_0x8d51('0x10')](function(_0x7a6989){logger[_0x8d51('0xd')](_0x8d51('0xa'),_0x431dc5,_0x7a6989);_0x23af76(_0x7a6989);});});}exports[_0x8d51('0x11')]=function(_0x23697e){var _0x3caca0=this;return new Promise(function(_0x192d42,_0x5bcc54){return db['WhatsappQueueReport'][_0x8d51('0x12')](_0x23697e[_0x8d51('0x13')],{'raw':_0x23697e[_0x8d51('0x14')]?_0x23697e[_0x8d51('0x14')][_0x8d51('0x15')]===undefined?!![]:![]:!![]})[_0x8d51('0x8')](function(_0xe92c9c){logger[_0x8d51('0x9')](_0x8d51('0x11'),_0x23697e);logger[_0x8d51('0xc')](_0x8d51('0x11'),_0x23697e,JSON[_0x8d51('0x16')](_0xe92c9c));_0x192d42(_0xe92c9c);})[_0x8d51('0x10')](function(_0xb1270e){logger[_0x8d51('0xd')]('CreateWhatsappQueueReport',_0xb1270e[_0x8d51('0xf')],_0x23697e);_0x5bcc54(_0x3caca0[_0x8d51('0xd')](0x1f4,_0xb1270e[_0x8d51('0xf')]));});});};exports[_0x8d51('0x17')]=function(_0x61f7fd){var _0x55104c=this;return new Promise(function(_0x2e47e2,_0x7e590){return db[_0x8d51('0x18')]['update'](_0x61f7fd[_0x8d51('0x13')],{'raw':_0x61f7fd['options']?_0x61f7fd[_0x8d51('0x14')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x61f7fd[_0x8d51('0x14')]?_0x61f7fd[_0x8d51('0x14')]['where']||null:null,'attributes':_0x61f7fd['options']?_0x61f7fd[_0x8d51('0x14')][_0x8d51('0x19')]||null:null,'limit':_0x61f7fd[_0x8d51('0x14')]?_0x61f7fd[_0x8d51('0x14')][_0x8d51('0x1a')]||null:null})[_0x8d51('0x8')](function(_0x2e7259){logger['info'](_0x8d51('0x17'),_0x61f7fd);logger[_0x8d51('0xc')](_0x8d51('0x17'),_0x61f7fd,JSON[_0x8d51('0x16')](_0x2e7259));_0x2e47e2(_0x2e7259);})[_0x8d51('0x10')](function(_0xc1cf45){logger[_0x8d51('0xd')](_0x8d51('0x17'),_0xc1cf45[_0x8d51('0xf')],_0x61f7fd);_0x7e590(_0x55104c[_0x8d51('0xd')](0x1f4,_0xc1cf45['message']));});});};
\ No newline at end of file
index e6f6cd4..2e1f988 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42d2=['create','put','/:id','delete','exports','util','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./whatsappTransferReport.controller','get','index','/describe','isAuthenticated','describe','post'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x42d2,0xc0));var _0x242d=function(_0x4a5f6c,_0x4f532e){_0x4a5f6c=_0x4a5f6c-0x0;var _0x281ffd=_0x42d2[_0x4a5f6c];return _0x281ffd;};'use strict';var multer=require('multer');var util=require(_0x242d('0x0'));var path=require('path');var timeout=require(_0x242d('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x242d('0x2'));var auth=require(_0x242d('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x242d('0x4'));var controller=require(_0x242d('0x5'));router[_0x242d('0x6')]('/',auth['isAuthenticated'](),controller[_0x242d('0x7')]);router['get'](_0x242d('0x8'),auth[_0x242d('0x9')](),controller[_0x242d('0xa')]);router[_0x242d('0x6')]('/:id',auth[_0x242d('0x9')](),controller['show']);router[_0x242d('0xb')]('/',auth['isAuthenticated'](),controller[_0x242d('0xc')]);router[_0x242d('0xd')](_0x242d('0xe'),auth[_0x242d('0x9')](),controller['update']);router[_0x242d('0xf')](_0x242d('0xe'),auth[_0x242d('0x9')](),controller['destroy']);module[_0x242d('0x10')]=router;
\ No newline at end of file
+var _0x1c4c=['update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','/:id','post','create','put'];(function(_0x499b83,_0xde81d0){var _0x15d62a=function(_0x3500b5){while(--_0x3500b5){_0x499b83['push'](_0x499b83['shift']());}};_0x15d62a(++_0xde81d0);}(_0x1c4c,0x7b));var _0xc1c4=function(_0x5f25b3,_0x35481a){_0x5f25b3=_0x5f25b3-0x0;var _0x4ab9bf=_0x1c4c[_0x5f25b3];return _0x4ab9bf;};'use strict';var multer=require(_0xc1c4('0x0'));var util=require(_0xc1c4('0x1'));var path=require(_0xc1c4('0x2'));var timeout=require('connect-timeout');var express=require(_0xc1c4('0x3'));var router=express[_0xc1c4('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc1c4('0x5'));var interaction=require(_0xc1c4('0x6'));var config=require(_0xc1c4('0x7'));var controller=require(_0xc1c4('0x8'));router[_0xc1c4('0x9')]('/',auth[_0xc1c4('0xa')](),controller[_0xc1c4('0xb')]);router[_0xc1c4('0x9')](_0xc1c4('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xc1c4('0x9')](_0xc1c4('0xd'),auth[_0xc1c4('0xa')](),controller['show']);router[_0xc1c4('0xe')]('/',auth['isAuthenticated'](),controller[_0xc1c4('0xf')]);router[_0xc1c4('0x10')](_0xc1c4('0xd'),auth[_0xc1c4('0xa')](),controller[_0xc1c4('0x11')]);router[_0xc1c4('0x12')]('/:id',auth[_0xc1c4('0xa')](),controller[_0xc1c4('0x13')]);module['exports']=router;
\ No newline at end of file
index cbf6a59..ca33941 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6132=['ENUM','account','agent','exports'];(function(_0x5746a8,_0x4c699b){var _0x3cf93f=function(_0x46e410){while(--_0x46e410){_0x5746a8['push'](_0x5746a8['shift']());}};_0x3cf93f(++_0x4c699b);}(_0x6132,0xf3));var _0x2613=function(_0x12b9cd,_0x30167b){_0x12b9cd=_0x12b9cd-0x0;var _0x3e36c0=_0x6132[_0x12b9cd];return _0x3e36c0;};'use strict';var Sequelize=require('sequelize');module[_0x2613('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x2613('0x1')](_0x2613('0x2'),_0x2613('0x3'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
+var _0xf894=['ENUM','account','agent','queue','DATE','sequelize','exports','STRING'];(function(_0x5b1409,_0x107534){var _0x268cca=function(_0x4cec71){while(--_0x4cec71){_0x5b1409['push'](_0x5b1409['shift']());}};_0x268cca(++_0x107534);}(_0xf894,0xfd));var _0x4f89=function(_0x446900,_0xa017c8){_0x446900=_0x446900-0x0;var _0x239f9d=_0xf894[_0x446900];return _0x239f9d;};'use strict';var Sequelize=require(_0x4f89('0x0'));module[_0x4f89('0x1')]={'uniqueid':{'type':Sequelize[_0x4f89('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x4f89('0x3')](_0x4f89('0x4'),_0x4f89('0x5'),_0x4f89('0x6')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x4f89('0x7')]}};
\ No newline at end of file
index 55f6d9d..190125d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x286a=['offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','pick','merge','where','type','VIRTUAL','filter','options','WhatsappTransferReport','include','findAll','rows','catch','show','params','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','mustache','sox','fs-extra','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json'];(function(_0x55677b,_0x3e5655){var _0x104b88=function(_0x78d34f){while(--_0x78d34f){_0x55677b['push'](_0x55677b['shift']());}};_0x104b88(++_0x3e5655);}(_0x286a,0x76));var _0xa286=function(_0x3bf64e,_0x1566e5){_0x3bf64e=_0x3bf64e-0x0;var _0x15732c=_0x286a[_0x3bf64e];return _0x15732c;};'use strict';var emlformat=require(_0xa286('0x0'));var rimraf=require(_0xa286('0x1'));var zipdir=require(_0xa286('0x2'));var jsonpatch=require(_0xa286('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa286('0x4'));var util=require('util');var path=require('path');var sox=require(_0xa286('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa286('0x6'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa286('0x7'));var deskjs=require('desk.js');var toCsv=require(_0xa286('0x8'));var querystring=require(_0xa286('0x9'));var Papa=require(_0xa286('0xa'));var Redis=require(_0xa286('0xb'));var authService=require(_0xa286('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0xa286('0xd'));var hardwareService=require(_0xa286('0xe'));var logger=require(_0xa286('0xf'))(_0xa286('0x10'));var utils=require(_0xa286('0x11'));var config=require(_0xa286('0x12'));var licenseUtil=require(_0xa286('0x13'));var db=require(_0xa286('0x14'))['db'];function respondWithStatusCode(_0x2b3793,_0x3ef7eb){_0x3ef7eb=_0x3ef7eb||0xcc;return function(_0x9b5f16){if(_0x9b5f16){return _0x2b3793['sendStatus'](_0x3ef7eb);}return _0x2b3793[_0xa286('0x15')](_0x3ef7eb)[_0xa286('0x16')]();};}function respondWithResult(_0x702e01,_0x47650b){_0x47650b=_0x47650b||0xc8;return function(_0x5c6043){if(_0x5c6043){return _0x702e01['status'](_0x47650b)[_0xa286('0x17')](_0x5c6043);}};}function respondWithFilteredResult(_0x1fef2,_0x3dab71){return function(_0x319781){if(_0x319781){var _0x1c47a0=typeof _0x3dab71[_0xa286('0x18')]===_0xa286('0x19')&&typeof _0x3dab71[_0xa286('0x1a')]===_0xa286('0x19');var _0x14e206=_0x319781[_0xa286('0x1b')];var _0x4c57af=_0x1c47a0?0x0:_0x3dab71[_0xa286('0x18')];var _0x2a1d7c=_0x1c47a0?_0x319781['count']:_0x3dab71[_0xa286('0x18')]+_0x3dab71[_0xa286('0x1a')];var _0x2c224f;if(_0x2a1d7c>=_0x14e206){_0x2a1d7c=_0x14e206;_0x2c224f=0xc8;}else{_0x2c224f=0xce;}_0x1fef2[_0xa286('0x15')](_0x2c224f);return _0x1fef2[_0xa286('0x1c')](_0xa286('0x1d'),_0x4c57af+'-'+_0x2a1d7c+'/'+_0x14e206)[_0xa286('0x17')](_0x319781);}return null;};}function patchUpdates(_0x2b9e7a){return function(_0x131b67){try{jsonpatch[_0xa286('0x1e')](_0x131b67,_0x2b9e7a,!![]);}catch(_0x22376e){return BPromise[_0xa286('0x1f')](_0x22376e);}return _0x131b67['save']();};}function saveUpdates(_0x305928,_0xf39e95){return function(_0x337e51){if(_0x337e51){return _0x337e51[_0xa286('0x20')](_0x305928)[_0xa286('0x21')](function(_0x3c4059){return _0x3c4059;});}return null;};}function removeEntity(_0x152933,_0x10af1b){return function(_0x5e35cd){if(_0x5e35cd){return _0x5e35cd[_0xa286('0x22')]()[_0xa286('0x21')](function(){_0x152933[_0xa286('0x15')](0xcc)[_0xa286('0x16')]();});}};}function handleEntityNotFound(_0x4b01bc,_0x4e513f){return function(_0x49d5c9){if(!_0x49d5c9){_0x4b01bc['sendStatus'](0x194);}return _0x49d5c9;};}function handleError(_0x5a2cc7,_0x209a8d){_0x209a8d=_0x209a8d||0x1f4;return function(_0x12025b){logger[_0xa286('0x23')](_0x12025b[_0xa286('0x24')]);if(_0x12025b[_0xa286('0x25')]){delete _0x12025b[_0xa286('0x25')];}_0x5a2cc7['status'](_0x209a8d)['send'](_0x12025b);};}exports[_0xa286('0x26')]=function(_0xabe082,_0x6d39fc){var _0x1af4cf={},_0x9096d4={},_0x400e91={'count':0x0,'rows':[]};var _0x47e789=_[_0xa286('0x27')](db['WhatsappTransferReport'][_0xa286('0x28')],function(_0x5aba5e){return{'name':_0x5aba5e[_0xa286('0x29')],'type':_0x5aba5e['type'][_0xa286('0x2a')]};});_0x9096d4['model']=_[_0xa286('0x27')](_0x47e789,'name');_0x9096d4[_0xa286('0x2b')]=_[_0xa286('0x2c')](_0xabe082[_0xa286('0x2b')]);_0x9096d4[_0xa286('0x2d')]=_[_0xa286('0x2e')](_0x9096d4['model'],_0x9096d4[_0xa286('0x2b')]);_0x1af4cf[_0xa286('0x2f')]=_[_0xa286('0x2e')](_0x9096d4[_0xa286('0x30')],qs[_0xa286('0x31')](_0xabe082[_0xa286('0x2b')]['fields']));_0x1af4cf['attributes']=_0x1af4cf[_0xa286('0x2f')][_0xa286('0x32')]?_0x1af4cf[_0xa286('0x2f')]:_0x9096d4['model'];if(!_0xabe082[_0xa286('0x2b')][_0xa286('0x33')]('nolimit')){_0x1af4cf[_0xa286('0x1a')]=qs['limit'](_0xabe082[_0xa286('0x2b')][_0xa286('0x1a')]);_0x1af4cf[_0xa286('0x18')]=qs[_0xa286('0x18')](_0xabe082[_0xa286('0x2b')]['offset']);}_0x1af4cf[_0xa286('0x34')]=qs[_0xa286('0x35')](_0xabe082[_0xa286('0x2b')]['sort']);_0x1af4cf['where']=qs[_0xa286('0x2d')](_[_0xa286('0x36')](_0xabe082[_0xa286('0x2b')],_0x9096d4[_0xa286('0x2d')]),_0x47e789);if(_0xabe082['query']['filter']){_0x1af4cf['where']=_[_0xa286('0x37')](_0x1af4cf[_0xa286('0x38')],{'$or':_[_0xa286('0x27')](_0x47e789,function(_0x1e0003){if(_0x1e0003[_0xa286('0x39')]!==_0xa286('0x3a')){var _0x25fa25={};_0x25fa25[_0x1e0003[_0xa286('0x25')]]={'$like':'%'+_0xabe082[_0xa286('0x2b')][_0xa286('0x3b')]+'%'};return _0x25fa25;}})});}_0x1af4cf=_['merge']({},_0x1af4cf,_0xabe082[_0xa286('0x3c')]);var _0x308060={'where':_0x1af4cf['where']};return db[_0xa286('0x3d')][_0xa286('0x1b')](_0x308060)[_0xa286('0x21')](function(_0x1eb916){_0x400e91['count']=_0x1eb916;if(_0xabe082[_0xa286('0x2b')]['includeAll']){_0x1af4cf[_0xa286('0x3e')]=[{'all':!![]}];}return db[_0xa286('0x3d')][_0xa286('0x3f')](_0x1af4cf);})[_0xa286('0x21')](function(_0x5e6c31){_0x400e91[_0xa286('0x40')]=_0x5e6c31;return _0x400e91;})['then'](respondWithFilteredResult(_0x6d39fc,_0x1af4cf))[_0xa286('0x41')](handleError(_0x6d39fc,null));};exports[_0xa286('0x42')]=function(_0x171df6,_0x823968){var _0x4c6cd8={'raw':!![],'where':{'id':_0x171df6[_0xa286('0x43')]['id']}},_0x5b6273={};_0x5b6273[_0xa286('0x30')]=_[_0xa286('0x2c')](db[_0xa286('0x3d')]['rawAttributes']);_0x5b6273[_0xa286('0x2b')]=_[_0xa286('0x2c')](_0x171df6[_0xa286('0x2b')]);_0x5b6273[_0xa286('0x2d')]=_[_0xa286('0x2e')](_0x5b6273[_0xa286('0x30')],_0x5b6273[_0xa286('0x2b')]);_0x4c6cd8[_0xa286('0x2f')]=_[_0xa286('0x2e')](_0x5b6273['model'],qs[_0xa286('0x31')](_0x171df6[_0xa286('0x2b')]['fields']));_0x4c6cd8[_0xa286('0x2f')]=_0x4c6cd8[_0xa286('0x2f')][_0xa286('0x32')]?_0x4c6cd8[_0xa286('0x2f')]:_0x5b6273['model'];if(_0x171df6[_0xa286('0x2b')]['includeAll']){_0x4c6cd8['include']=[{'all':!![]}];}_0x4c6cd8=_[_0xa286('0x37')]({},_0x4c6cd8,_0x171df6[_0xa286('0x3c')]);return db[_0xa286('0x3d')]['find'](_0x4c6cd8)[_0xa286('0x21')](handleEntityNotFound(_0x823968,null))['then'](respondWithResult(_0x823968,null))['catch'](handleError(_0x823968,null));};exports['create']=function(_0x23b207,_0x3f96ff){return db[_0xa286('0x3d')][_0xa286('0x44')](_0x23b207[_0xa286('0x45')],{})['then'](respondWithResult(_0x3f96ff,0xc9))[_0xa286('0x41')](handleError(_0x3f96ff,null));};exports[_0xa286('0x20')]=function(_0x5b86b4,_0x369804){if(_0x5b86b4[_0xa286('0x45')]['id']){delete _0x5b86b4[_0xa286('0x45')]['id'];}return db[_0xa286('0x3d')]['find']({'where':{'id':_0x5b86b4[_0xa286('0x43')]['id']}})['then'](handleEntityNotFound(_0x369804,null))[_0xa286('0x21')](saveUpdates(_0x5b86b4[_0xa286('0x45')],null))[_0xa286('0x21')](respondWithResult(_0x369804,null))[_0xa286('0x41')](handleError(_0x369804,null));};exports[_0xa286('0x22')]=function(_0x5db95c,_0x64cd1f){return db['WhatsappTransferReport']['find']({'where':{'id':_0x5db95c[_0xa286('0x43')]['id']}})[_0xa286('0x21')](handleEntityNotFound(_0x64cd1f,null))[_0xa286('0x21')](removeEntity(_0x64cd1f,null))['catch'](handleError(_0x64cd1f,null));};exports[_0xa286('0x46')]=function(_0x2f5a63,_0x324d6d){return db[_0xa286('0x3d')][_0xa286('0x46')]()[_0xa286('0x21')](respondWithResult(_0x324d6d,null))['catch'](handleError(_0x324d6d,null));};
\ No newline at end of file
+var _0xc8f2=['sort','where','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','params','find','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','count','limit','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','WhatsappTransferReport','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order'];(function(_0x15449d,_0x537b1d){var _0x55cf8c=function(_0x4fc014){while(--_0x4fc014){_0x15449d['push'](_0x15449d['shift']());}};_0x55cf8c(++_0x537b1d);}(_0xc8f2,0x120));var _0x2c8f=function(_0x5a5326,_0x29991a){_0x5a5326=_0x5a5326-0x0;var _0x37c270=_0xc8f2[_0x5a5326];return _0x37c270;};'use strict';var emlformat=require(_0x2c8f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2c8f('0x1'));var jsonpatch=require(_0x2c8f('0x2'));var rp=require(_0x2c8f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2c8f('0x4'));var util=require(_0x2c8f('0x5'));var path=require(_0x2c8f('0x6'));var sox=require(_0x2c8f('0x7'));var csv=require(_0x2c8f('0x8'));var ejs=require(_0x2c8f('0x9'));var fs=require('fs');var fs_extra=require(_0x2c8f('0xa'));var _=require('lodash');var squel=require(_0x2c8f('0xb'));var crypto=require(_0x2c8f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2c8f('0xd'));var toCsv=require(_0x2c8f('0x8'));var querystring=require('querystring');var Papa=require(_0x2c8f('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2c8f('0xf'));var hardwareService=require(_0x2c8f('0x10'));var logger=require(_0x2c8f('0x11'))(_0x2c8f('0x12'));var utils=require(_0x2c8f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2c8f('0x14'));var db=require(_0x2c8f('0x15'))['db'];function respondWithStatusCode(_0x5c0ce4,_0x43f00d){_0x43f00d=_0x43f00d||0xcc;return function(_0x472cb7){if(_0x472cb7){return _0x5c0ce4[_0x2c8f('0x16')](_0x43f00d);}return _0x5c0ce4['status'](_0x43f00d)[_0x2c8f('0x17')]();};}function respondWithResult(_0x57ebf2,_0x522831){_0x522831=_0x522831||0xc8;return function(_0x5075ce){if(_0x5075ce){return _0x57ebf2[_0x2c8f('0x18')](_0x522831)[_0x2c8f('0x19')](_0x5075ce);}};}function respondWithFilteredResult(_0x117114,_0x1868f1){return function(_0x530e53){if(_0x530e53){var _0x1220c9=typeof _0x1868f1[_0x2c8f('0x1a')]==='undefined'&&typeof _0x1868f1['limit']==='undefined';var _0x2de404=_0x530e53[_0x2c8f('0x1b')];var _0x508e87=_0x1220c9?0x0:_0x1868f1[_0x2c8f('0x1a')];var _0x53855e=_0x1220c9?_0x530e53[_0x2c8f('0x1b')]:_0x1868f1[_0x2c8f('0x1a')]+_0x1868f1[_0x2c8f('0x1c')];var _0xa3bad4;if(_0x53855e>=_0x2de404){_0x53855e=_0x2de404;_0xa3bad4=0xc8;}else{_0xa3bad4=0xce;}_0x117114[_0x2c8f('0x18')](_0xa3bad4);return _0x117114['set'](_0x2c8f('0x1d'),_0x508e87+'-'+_0x53855e+'/'+_0x2de404)[_0x2c8f('0x19')](_0x530e53);}return null;};}function patchUpdates(_0xc3a2d){return function(_0x253652){try{jsonpatch[_0x2c8f('0x1e')](_0x253652,_0xc3a2d,!![]);}catch(_0x3e23f0){return BPromise['reject'](_0x3e23f0);}return _0x253652['save']();};}function saveUpdates(_0x51d2b5,_0x1a0995){return function(_0xc46e89){if(_0xc46e89){return _0xc46e89[_0x2c8f('0x1f')](_0x51d2b5)[_0x2c8f('0x20')](function(_0x44c701){return _0x44c701;});}return null;};}function removeEntity(_0x57def8,_0x9139fb){return function(_0x1b77d6){if(_0x1b77d6){return _0x1b77d6[_0x2c8f('0x21')]()['then'](function(){_0x57def8['status'](0xcc)[_0x2c8f('0x17')]();});}};}function handleEntityNotFound(_0xa96d33,_0x395aff){return function(_0x25fff8){if(!_0x25fff8){_0xa96d33[_0x2c8f('0x16')](0x194);}return _0x25fff8;};}function handleError(_0x4a5c3,_0x4762d4){_0x4762d4=_0x4762d4||0x1f4;return function(_0x50b69f){logger[_0x2c8f('0x22')](_0x50b69f[_0x2c8f('0x23')]);if(_0x50b69f[_0x2c8f('0x24')]){delete _0x50b69f[_0x2c8f('0x24')];}_0x4a5c3[_0x2c8f('0x18')](_0x4762d4)[_0x2c8f('0x25')](_0x50b69f);};}exports[_0x2c8f('0x26')]=function(_0x10ac10,_0x3336ca){var _0x341bc3={},_0x30a5ce={},_0x491689={'count':0x0,'rows':[]};var _0x5280f0=_[_0x2c8f('0x27')](db[_0x2c8f('0x28')][_0x2c8f('0x29')],function(_0x174ade){return{'name':_0x174ade[_0x2c8f('0x2a')],'type':_0x174ade['type']['key']};});_0x30a5ce[_0x2c8f('0x2b')]=_[_0x2c8f('0x27')](_0x5280f0,_0x2c8f('0x24'));_0x30a5ce['query']=_[_0x2c8f('0x2c')](_0x10ac10[_0x2c8f('0x2d')]);_0x30a5ce[_0x2c8f('0x2e')]=_[_0x2c8f('0x2f')](_0x30a5ce['model'],_0x30a5ce['query']);_0x341bc3[_0x2c8f('0x30')]=_[_0x2c8f('0x2f')](_0x30a5ce[_0x2c8f('0x2b')],qs[_0x2c8f('0x31')](_0x10ac10['query'][_0x2c8f('0x31')]));_0x341bc3[_0x2c8f('0x30')]=_0x341bc3['attributes']['length']?_0x341bc3['attributes']:_0x30a5ce[_0x2c8f('0x2b')];if(!_0x10ac10[_0x2c8f('0x2d')][_0x2c8f('0x32')]('nolimit')){_0x341bc3[_0x2c8f('0x1c')]=qs[_0x2c8f('0x1c')](_0x10ac10[_0x2c8f('0x2d')][_0x2c8f('0x1c')]);_0x341bc3['offset']=qs['offset'](_0x10ac10[_0x2c8f('0x2d')][_0x2c8f('0x1a')]);}_0x341bc3[_0x2c8f('0x33')]=qs['sort'](_0x10ac10[_0x2c8f('0x2d')][_0x2c8f('0x34')]);_0x341bc3[_0x2c8f('0x35')]=qs[_0x2c8f('0x2e')](_['pick'](_0x10ac10[_0x2c8f('0x2d')],_0x30a5ce[_0x2c8f('0x2e')]),_0x5280f0);if(_0x10ac10['query'][_0x2c8f('0x36')]){_0x341bc3[_0x2c8f('0x35')]=_[_0x2c8f('0x37')](_0x341bc3[_0x2c8f('0x35')],{'$or':_[_0x2c8f('0x27')](_0x5280f0,function(_0x2f09a6){if(_0x2f09a6[_0x2c8f('0x38')]!=='VIRTUAL'){var _0x355ed9={};_0x355ed9[_0x2f09a6[_0x2c8f('0x24')]]={'$like':'%'+_0x10ac10['query'][_0x2c8f('0x36')]+'%'};return _0x355ed9;}})});}_0x341bc3=_[_0x2c8f('0x37')]({},_0x341bc3,_0x10ac10[_0x2c8f('0x39')]);var _0x4b8155={'where':_0x341bc3[_0x2c8f('0x35')]};return db[_0x2c8f('0x28')][_0x2c8f('0x1b')](_0x4b8155)['then'](function(_0x205b36){_0x491689['count']=_0x205b36;if(_0x10ac10[_0x2c8f('0x2d')][_0x2c8f('0x3a')]){_0x341bc3[_0x2c8f('0x3b')]=[{'all':!![]}];}return db[_0x2c8f('0x28')][_0x2c8f('0x3c')](_0x341bc3);})[_0x2c8f('0x20')](function(_0x440052){_0x491689[_0x2c8f('0x3d')]=_0x440052;return _0x491689;})[_0x2c8f('0x20')](respondWithFilteredResult(_0x3336ca,_0x341bc3))[_0x2c8f('0x3e')](handleError(_0x3336ca,null));};exports[_0x2c8f('0x3f')]=function(_0x2f4922,_0xc25d4d){var _0xc5a0ce={'raw':!![],'where':{'id':_0x2f4922[_0x2c8f('0x40')]['id']}},_0x1b62e8={};_0x1b62e8[_0x2c8f('0x2b')]=_[_0x2c8f('0x2c')](db[_0x2c8f('0x28')][_0x2c8f('0x29')]);_0x1b62e8[_0x2c8f('0x2d')]=_[_0x2c8f('0x2c')](_0x2f4922['query']);_0x1b62e8[_0x2c8f('0x2e')]=_[_0x2c8f('0x2f')](_0x1b62e8[_0x2c8f('0x2b')],_0x1b62e8[_0x2c8f('0x2d')]);_0xc5a0ce[_0x2c8f('0x30')]=_[_0x2c8f('0x2f')](_0x1b62e8['model'],qs[_0x2c8f('0x31')](_0x2f4922['query'][_0x2c8f('0x31')]));_0xc5a0ce[_0x2c8f('0x30')]=_0xc5a0ce['attributes']['length']?_0xc5a0ce[_0x2c8f('0x30')]:_0x1b62e8[_0x2c8f('0x2b')];if(_0x2f4922['query'][_0x2c8f('0x3a')]){_0xc5a0ce[_0x2c8f('0x3b')]=[{'all':!![]}];}_0xc5a0ce=_['merge']({},_0xc5a0ce,_0x2f4922[_0x2c8f('0x39')]);return db[_0x2c8f('0x28')][_0x2c8f('0x41')](_0xc5a0ce)[_0x2c8f('0x20')](handleEntityNotFound(_0xc25d4d,null))[_0x2c8f('0x20')](respondWithResult(_0xc25d4d,null))[_0x2c8f('0x3e')](handleError(_0xc25d4d,null));};exports['create']=function(_0x4db705,_0xe0fd3){return db['WhatsappTransferReport']['create'](_0x4db705[_0x2c8f('0x42')],{})[_0x2c8f('0x20')](respondWithResult(_0xe0fd3,0xc9))[_0x2c8f('0x3e')](handleError(_0xe0fd3,null));};exports[_0x2c8f('0x1f')]=function(_0x22cadd,_0x36bd92){if(_0x22cadd['body']['id']){delete _0x22cadd['body']['id'];}return db[_0x2c8f('0x28')][_0x2c8f('0x41')]({'where':{'id':_0x22cadd[_0x2c8f('0x40')]['id']}})[_0x2c8f('0x20')](handleEntityNotFound(_0x36bd92,null))[_0x2c8f('0x20')](saveUpdates(_0x22cadd[_0x2c8f('0x42')],null))[_0x2c8f('0x20')](respondWithResult(_0x36bd92,null))[_0x2c8f('0x3e')](handleError(_0x36bd92,null));};exports[_0x2c8f('0x21')]=function(_0x51e7ec,_0x228b52){return db[_0x2c8f('0x28')]['find']({'where':{'id':_0x51e7ec['params']['id']}})['then'](handleEntityNotFound(_0x228b52,null))[_0x2c8f('0x20')](removeEntity(_0x228b52,null))[_0x2c8f('0x3e')](handleError(_0x228b52,null));};exports[_0x2c8f('0x43')]=function(_0x4ea1d4,_0x23bca6){return db['WhatsappTransferReport'][_0x2c8f('0x43')]()[_0x2c8f('0x20')](respondWithResult(_0x23bca6,null))[_0x2c8f('0x3e')](handleError(_0x23bca6,null));};
\ No newline at end of file
index ec0a969..ff3312b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x230f=['util','api','bluebird','request-promise','path','rimraf','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x230f,0xe3));var _0xf230=function(_0x29a8f8,_0x3b4263){_0x29a8f8=_0x29a8f8-0x0;var _0x5bf4c8=_0x230f[_0x29a8f8];return _0x5bf4c8;};'use strict';var _=require(_0xf230('0x0'));var util=require(_0xf230('0x1'));var logger=require('../../config/logger')(_0xf230('0x2'));var moment=require('moment');var BPromise=require(_0xf230('0x3'));var rp=require(_0xf230('0x4'));var fs=require('fs');var path=require(_0xf230('0x5'));var rimraf=require(_0xf230('0x6'));var config=require('../../config/environment');var attributes=require(_0xf230('0x7'));module[_0xf230('0x8')]=function(_0x55b5ce,_0xcf7b49){return _0x55b5ce[_0xf230('0x9')](_0xf230('0xa'),attributes,{'tableName':_0xf230('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3473=['../../config/logger','api','rimraf','../../config/environment','./whatsappTransferReport.attributes','define','uniqueid','util'];(function(_0x5645ad,_0x580ea3){var _0x17d292=function(_0xe66902){while(--_0xe66902){_0x5645ad['push'](_0x5645ad['shift']());}};_0x17d292(++_0x580ea3);}(_0x3473,0x8f));var _0x3347=function(_0x43f136,_0x365817){_0x43f136=_0x43f136-0x0;var _0x531928=_0x3473[_0x43f136];return _0x531928;};'use strict';var _=require('lodash');var util=require(_0x3347('0x0'));var logger=require(_0x3347('0x1'))(_0x3347('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3347('0x3'));var config=require(_0x3347('0x4'));var attributes=require(_0x3347('0x5'));module['exports']=function(_0x45f1ae,_0x8b9503){return _0x45f1ae[_0x3347('0x6')]('WhatsappTransferReport',attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0x3347('0x7'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index de697bd..a159e4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a3f=['WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x6a3f,0xb7));var _0xf6a3=function(_0xffa654,_0x4c734){_0xffa654=_0xffa654-0x0;var _0x5dd847=_0x6a3f[_0xffa654];return _0x5dd847;};'use strict';var _=require(_0xf6a3('0x0'));var util=require(_0xf6a3('0x1'));var moment=require(_0xf6a3('0x2'));var BPromise=require(_0xf6a3('0x3'));var rs=require(_0xf6a3('0x4'));var fs=require('fs');var Redis=require(_0xf6a3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf6a3('0x6'));var logger=require(_0xf6a3('0x7'))('rpc');var config=require(_0xf6a3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf6a3('0x9')][_0xf6a3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c7785,_0x522a52,_0x329c1d){return new BPromise(function(_0x6541e9,_0x351080){return client['request'](_0x2c7785,_0x329c1d)['then'](function(_0x3a8e0c){logger[_0xf6a3('0xb')](_0xf6a3('0xc'),_0x522a52,_0xf6a3('0xd'));logger[_0xf6a3('0xe')](_0xf6a3('0xf'),_0x522a52,_0xf6a3('0xd'),JSON[_0xf6a3('0x10')](_0x3a8e0c));if(_0x3a8e0c[_0xf6a3('0x11')]){if(_0x3a8e0c[_0xf6a3('0x11')][_0xf6a3('0x12')]===0x1f4){logger[_0xf6a3('0x11')](_0xf6a3('0xc'),_0x522a52,_0x3a8e0c[_0xf6a3('0x11')][_0xf6a3('0x13')]);return _0x351080(_0x3a8e0c['error'][_0xf6a3('0x13')]);}logger[_0xf6a3('0x11')]('WhatsappTransferReport,\x20%s,\x20%s',_0x522a52,_0x3a8e0c[_0xf6a3('0x11')]['message']);return _0x6541e9(_0x3a8e0c[_0xf6a3('0x11')][_0xf6a3('0x13')]);}else{logger[_0xf6a3('0xb')]('WhatsappTransferReport,\x20%s,\x20%s',_0x522a52,_0xf6a3('0xd'));_0x6541e9(_0x3a8e0c[_0xf6a3('0x14')]['message']);}})[_0xf6a3('0x15')](function(_0x161df1){logger[_0xf6a3('0x11')](_0xf6a3('0xc'),_0x522a52,_0x161df1);_0x351080(_0x161df1);});});}
\ No newline at end of file
+var _0x126e=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x126e,0x19c));var _0xe126=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x126e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe126('0x0'));var util=require(_0xe126('0x1'));var moment=require(_0xe126('0x2'));var BPromise=require(_0xe126('0x3'));var rs=require(_0xe126('0x4'));var fs=require('fs');var Redis=require(_0xe126('0x5'));var db=require(_0xe126('0x6'))['db'];var utils=require(_0xe126('0x7'));var logger=require(_0xe126('0x8'))(_0xe126('0x9'));var config=require('../../config/environment');var jayson=require(_0xe126('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x71cb71,_0x2af4ad,_0x2774c8){return new BPromise(function(_0x2d7f3b,_0x13b8b0){return client[_0xe126('0xb')](_0x71cb71,_0x2774c8)[_0xe126('0xc')](function(_0x377e9c){logger[_0xe126('0xd')](_0xe126('0xe'),_0x2af4ad,_0xe126('0xf'));logger[_0xe126('0x10')](_0xe126('0x11'),_0x2af4ad,_0xe126('0xf'),JSON[_0xe126('0x12')](_0x377e9c));if(_0x377e9c['error']){if(_0x377e9c[_0xe126('0x13')][_0xe126('0x14')]===0x1f4){logger[_0xe126('0x13')](_0xe126('0xe'),_0x2af4ad,_0x377e9c[_0xe126('0x13')][_0xe126('0x15')]);return _0x13b8b0(_0x377e9c['error']['message']);}logger[_0xe126('0x13')](_0xe126('0xe'),_0x2af4ad,_0x377e9c[_0xe126('0x13')][_0xe126('0x15')]);return _0x2d7f3b(_0x377e9c['error'][_0xe126('0x15')]);}else{logger[_0xe126('0xd')](_0xe126('0xe'),_0x2af4ad,_0xe126('0xf'));_0x2d7f3b(_0x377e9c[_0xe126('0x16')][_0xe126('0x15')]);}})[_0xe126('0x17')](function(_0x4148ca){logger[_0xe126('0x13')](_0xe126('0xe'),_0x2af4ad,_0x4148ca);_0x13b8b0(_0x4148ca);});});}
\ No newline at end of file
index bd3de57..5921909 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf79=['info','filter','number','exitCode','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','online','join','Offline\x20apps:','status','None','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/cloud-provider','sequelize','sync','then','seedDB','default','listen','start'];(function(_0x1fafa5,_0x1aa281){var _0xcf08c9=function(_0x3af1b4){while(--_0x3af1b4){_0x1fafa5['push'](_0x1fafa5['shift']());}};_0xcf08c9(++_0x1aa281);}(_0xaf79,0x82));var _0x9af7=function(_0x452172,_0x188b57){_0x452172=_0x452172-0x0;var _0x56cf05=_0xaf79[_0x452172];return _0x56cf05;};'use strict';var _=require('lodash');var db=require(_0x9af7('0x0'))['db'];var seedDb=require(_0x9af7('0x1'));var checkLicense=require(_0x9af7('0x2'));var rpc=require(_0x9af7('0x3'));var config=require(_0x9af7('0x4'));var logger=require(_0x9af7('0x5'))('app');var pm2=require(_0x9af7('0x6'));var pm2Config=require(_0x9af7('0x7'));var schedule=require(_0x9af7('0x8'));var chat=require(_0x9af7('0x9'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require('./config/schedule/transcribe');var provider=require(_0x9af7('0xa'));function main(){return db[_0x9af7('0xb')][_0x9af7('0xc')]()[_0x9af7('0xd')](function(){if(config[_0x9af7('0xe')]){return seedDb[_0x9af7('0xf')]();}})[_0x9af7('0xd')](function(){return checkLicense[_0x9af7('0xf')]();})[_0x9af7('0xd')](function(){return rpc[_0x9af7('0x10')]();})[_0x9af7('0xd')](function(_0x467d50){logger['info'](_0x467d50);return chat[_0x9af7('0x11')]();})[_0x9af7('0xd')](function(){return whatsapp[_0x9af7('0x11')]();})[_0x9af7('0xd')](function(){return schedule[_0x9af7('0x11')]();})[_0x9af7('0xd')](function(){return transcribe[_0x9af7('0x11')]();})[_0x9af7('0xd')](function(){return provider['start']();})['then'](function(_0x420931){logger[_0x9af7('0x12')](_0x420931);return pm2[_0x9af7('0x11')](pm2Config);})[_0x9af7('0xd')](function(_0x408492){var _0x1d1620=_0x408492[_0x9af7('0x13')](function(_0x539cd5){return typeof _0x539cd5['exitCode']===_0x9af7('0x14')&&_0x539cd5[_0x9af7('0x15')]>=0x0;});if(_0x1d1620['length']>0x0){throw new Error(_0x1d1620[_0x9af7('0x16')]+_0x9af7('0x17')+_[_0x9af7('0x18')](_0x1d1620,function(_0x371e1b){return'\x22'+_0x371e1b[_0x9af7('0x19')][_0x9af7('0x1a')]+'\x22';}));}logger['info']('Online\x20apps:',_['map'](_[_0x9af7('0x13')](_0x408492,{'status':_0x9af7('0x1b')}),'name')[_0x9af7('0x1c')]());logger[_0x9af7('0x12')](_0x9af7('0x1d'),_[_0x9af7('0x18')](_['filter'](_0x408492,function(_0x5cf9fc){return _0x5cf9fc[_0x9af7('0x1e')]!==_0x9af7('0x1b');}),_0x9af7('0x1a'))[_0x9af7('0x1c')]()||_0x9af7('0x1f'));console['log'](_0x9af7('0x20'));})[_0x9af7('0x21')](function(_0x517072){console['log'](_0x9af7('0x22'),_0x517072);logger['error'](_0x9af7('0x23'),_0x517072);process[_0x9af7('0x24')](0x1);});}main();
\ No newline at end of file
+var _0xf041=['number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','Online\x20apps:','online','name','join','Offline\x20apps:','status','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','./config/seedDB','./config/license','./rpc','./config/environment','app','./config/pm2/config','./config/schedule/whatsapp','./config/schedule/cloud-provider','sequelize','sync','then','default','listen','info','start','filter'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf041,0x15b));var _0x1f04=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf041[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var db=require('./mysqldb')['db'];var seedDb=require(_0x1f04('0x0'));var checkLicense=require(_0x1f04('0x1'));var rpc=require(_0x1f04('0x2'));var config=require(_0x1f04('0x3'));var logger=require('./config/logger')(_0x1f04('0x4'));var pm2=require('./config/pm2');var pm2Config=require(_0x1f04('0x5'));var schedule=require('./config/schedule');var chat=require('./config/schedule/chat');var whatsapp=require(_0x1f04('0x6'));var transcribe=require('./config/schedule/transcribe');var provider=require(_0x1f04('0x7'));function main(){return db[_0x1f04('0x8')][_0x1f04('0x9')]()[_0x1f04('0xa')](function(){if(config['seedDB']){return seedDb[_0x1f04('0xb')]();}})[_0x1f04('0xa')](function(){return checkLicense[_0x1f04('0xb')]();})[_0x1f04('0xa')](function(){return rpc[_0x1f04('0xc')]();})[_0x1f04('0xa')](function(_0x1982dd){logger[_0x1f04('0xd')](_0x1982dd);return chat['start']();})['then'](function(){return whatsapp[_0x1f04('0xe')]();})[_0x1f04('0xa')](function(){return schedule[_0x1f04('0xe')]();})[_0x1f04('0xa')](function(){return transcribe[_0x1f04('0xe')]();})[_0x1f04('0xa')](function(){return provider[_0x1f04('0xe')]();})[_0x1f04('0xa')](function(_0x34323f){logger[_0x1f04('0xd')](_0x34323f);return pm2[_0x1f04('0xe')](pm2Config);})['then'](function(_0x5bd64c){var _0x3d4def=_0x5bd64c[_0x1f04('0xf')](function(_0x24d37c){return typeof _0x24d37c['exitCode']===_0x1f04('0x10')&&_0x24d37c['exitCode']>=0x0;});if(_0x3d4def[_0x1f04('0x11')]>0x0){throw new Error(_0x3d4def[_0x1f04('0x11')]+_0x1f04('0x12')+_[_0x1f04('0x13')](_0x3d4def,function(_0x1b2be5){return'\x22'+_0x1b2be5[_0x1f04('0x14')]['name']+'\x22';}));}logger['info'](_0x1f04('0x15'),_[_0x1f04('0x13')](_[_0x1f04('0xf')](_0x5bd64c,{'status':_0x1f04('0x16')}),_0x1f04('0x17'))[_0x1f04('0x18')]());logger[_0x1f04('0xd')](_0x1f04('0x19'),_['map'](_[_0x1f04('0xf')](_0x5bd64c,function(_0x3de665){return _0x3de665[_0x1f04('0x1a')]!=='online';}),_0x1f04('0x17'))[_0x1f04('0x18')]()||'None');console[_0x1f04('0x1b')](_0x1f04('0x1c'));})[_0x1f04('0x1d')](function(_0x38875d){console[_0x1f04('0x1b')](_0x1f04('0x1e'),_0x38875d);logger[_0x1f04('0x1f')](_0x1f04('0x20'),_0x38875d);process['exit'](0x1);});}main();
\ No newline at end of file
index c9a7e33..312489d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd23e=['nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blocked','minutes','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','isWebrtcLicence','webrtc','Forbidden','isMiddleware','cookie','motion.token','redirect','send','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','test','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.','Sequelize','updatePasswordsHistory','splice','unshift','join','promisify','sign','secret','secrets','payload','verify','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/util','lodash','jsonwebtoken','composable-middleware','bluebird','util','moment','session','role','fullname','name','internal','email','permissions','md5secret','voicePause','smsPause','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarPrefixRequired','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','downloadAttachments','selectRecallMeCampaign','isChatInteractionAuthorized','isAuthenticated','use','user','findOne','params','closed','disposition','status','unmanaged','json','Unmanaged.','Forbidden.','authorization','startsWith','headers','User','authenticate','pass','Wrong\x20credentials.','catch','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','then','find','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xd23e,0xaa));var _0xed23=function(_0x297b8b,_0x10031d){_0x297b8b=_0x297b8b-0x0;var _0x4566e9=_0xd23e[_0x297b8b];return _0x4566e9;};'use strict';var db=require(_0xed23('0x0'))['db'];var config=require(_0xed23('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0xed23('0x2'));var encryptor=require('../encryptor');var _=require(_0xed23('0x3'));var jwt=require(_0xed23('0x4'));var expressJwt=require('express-jwt');var compose=require(_0xed23('0x5'));var basicAuth=require('basic-auth');var crypto=require('crypto');var BPromise=require(_0xed23('0x6'));var util=require(_0xed23('0x7'));var moment=require(_0xed23('0x8'));var validateJwt=expressJwt({'secret':config['secrets'][_0xed23('0x9')]});var userAttributes=['id',_0xed23('0xa'),_0xed23('0xb'),_0xed23('0xc'),_0xed23('0xd'),_0xed23('0xe'),'userpic',_0xed23('0xf'),_0xed23('0x10'),_0xed23('0x11'),'chatPause','mailPause','faxPause',_0xed23('0x12'),'openchannelPause','pauseType',_0xed23('0x13'),_0xed23('0x14'),_0xed23('0x15'),_0xed23('0x16'),_0xed23('0x17'),_0xed23('0x18'),_0xed23('0x19'),_0xed23('0x1a'),'phoneBarAutoAnswerDelay',_0xed23('0x1b'),_0xed23('0x1c'),_0xed23('0x1d'),_0xed23('0x1e'),'phoneBarExpires',_0xed23('0x1f'),'phoneBarRemoteControl','phoneBarRemoteControlPort',_0xed23('0x20'),_0xed23('0x21'),_0xed23('0x22'),_0xed23('0x23'),_0xed23('0x24'),'wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions',_0xed23('0x25'),'ignorePauseForPreviewCalls',_0xed23('0x26')];exports[_0xed23('0x27')]=function(){return this[_0xed23('0x28')](!![])[_0xed23('0x29')](function(_0x24d15b,_0x129469,_0x4fd391){if(_0x24d15b[_0xed23('0x2a')]){_0x4fd391();}else{return db['ChatInteraction'][_0xed23('0x2b')]({'where':{'id':_0x24d15b[_0xed23('0x2c')]['id']},'attributes':['id',_0xed23('0x2d'),_0xed23('0x2e')],'raw':!![]})['then'](function(_0xe928b){if(_0xe928b&&_0xe928b[_0xed23('0x2d')]){return _0x129469[_0xed23('0x2f')](_0xe928b['disposition']===_0xed23('0x30')?0x195:0x193)[_0xed23('0x31')]({'message':_0xe928b[_0xed23('0x2e')]==='unmanaged'?_0xed23('0x32'):_0xed23('0x33')});}else{_0x4fd391();}})['catch'](function(_0x2b706d){_0x4fd391(_0x2b706d);});}});};exports[_0xed23('0x28')]=function isAuthenticated(_0x96e143){return compose()['use'](function(_0x1b1f05,_0x1417e2,_0x2b7098){var _0x5b2b2f;if(_0x1b1f05['headers'][_0xed23('0x34')]){if(_[_0xed23('0x35')](_0x1b1f05[_0xed23('0x36')][_0xed23('0x34')],'Basic')){var _0x401261=basicAuth(_0x1b1f05);db[_0xed23('0x37')]['find']({'where':{'name':_0x401261[_0xed23('0xc')]}})['then'](function(_0x2ee471){if(!_0x2ee471||!_0x2ee471[_0xed23('0x38')](_0x401261[_0xed23('0x39')])){return _0x1417e2[_0xed23('0x2f')](0x191)['json']({'message':_0xed23('0x3a')});}_0x1b1f05[_0xed23('0x2a')]={'id':_0x2ee471['id']};_0x2b7098();})[_0xed23('0x3b')](function(_0x4d6c6a){_0x2b7098(_0x4d6c6a);});}else if(_[_0xed23('0x35')](_0x1b1f05[_0xed23('0x36')][_0xed23('0x34')],_0xed23('0x3c'))){validateJwt(_0x1b1f05,_0x1417e2,_0x2b7098);}else{if(_0x96e143){_0x2b7098();}else{return _0x1417e2[_0xed23('0x2f')](0x193)[_0xed23('0x31')]({'message':_0xed23('0x3d')});}}}else if(_0x1b1f05[_0xed23('0x3e')][_0xed23('0x3f')]){try{var _0x30b6aa={'audience':hardwareConf[_0xed23('0x40')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x1b1f05[_0xed23('0x3e')][_0xed23('0x3f')],_0x30b6aa)[_0xed23('0x41')](function(_0x5deff1){return db[_0xed23('0x37')][_0xed23('0x42')]({'where':{'id':_0x5deff1['sub']}})[_0xed23('0x41')](function(_0x26cfaa){_0x5b2b2f=_0x26cfaa;return db[_0xed23('0x43')]['findOne']({'where':{'id':0x1},'attributes':[_0xed23('0x44'),_0xed23('0x45')],'raw':!![]});})[_0xed23('0x41')](function(_0x59b4d1){if(!_0x5b2b2f||!_[_0xed23('0x46')](_0x5b2b2f[_0xed23('0x47')],_0x5deff1[_0xed23('0x48')])){return _0x1417e2[_0xed23('0x2f')](0x191)[_0xed23('0x31')]({'message':_0xed23('0x49')});}if(_0x5b2b2f[_0xed23('0x4a')]){return _0x1417e2[_0xed23('0x2f')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}if(_0x5b2b2f[_0xed23('0x4b')]){if(_0x59b4d1['blockDuration']>0x0){if(moment(_0x5b2b2f['blockedAt'])['add'](_0x59b4d1[_0xed23('0x45')],_0xed23('0x4c'))>moment()){return _0x1417e2['status'](0x191)[_0xed23('0x31')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x1417e2['status'](0x191)['json']({'message':_0xed23('0x4d')});}}_0x1b1f05[_0xed23('0x2a')]={'id':_0x5b2b2f['id']};_0x2b7098();});})[_0xed23('0x3b')](function(){return _0x1417e2['status'](0x191)[_0xed23('0x31')]({'message':_0xed23('0x4d')});});}catch(_0x5f545a){_0x2b7098(_0x5f545a);}}else if(_0x96e143){_0x2b7098();}else{return _0x1417e2[_0xed23('0x2f')](0x193)[_0xed23('0x31')]({'message':'Unknown\x20authorization\x20format'});}})[_0xed23('0x29')](function(_0x8b2fde,_0x5c752d,_0x20e7fa){if(_0x8b2fde[_0xed23('0x2a')]){db[_0xed23('0x37')][_0xed23('0x42')]({'where':{'id':_0x8b2fde[_0xed23('0x2a')]['id']},'attributes':userAttributes})[_0xed23('0x41')](function(_0x47545e){if(!_0x47545e){return _0x5c752d[_0xed23('0x2f')](0x194)['json']({'message':_0xed23('0x4e')});}_0x8b2fde[_0xed23('0x2a')]=_0x47545e;_0x20e7fa();})['catch'](function(_0x21ef1d){_0x20e7fa(_0x21ef1d);});}else if(_0x96e143){_0x20e7fa();}else{return _0x5c752d['status'](0x194)[_0xed23('0x31')]({'message':_0xed23('0x4f')});}});};exports[_0xed23('0x50')]=function canUpdate(){return compose()['use'](function(_0x29ccc5,_0x259220,_0x5c41d8){return licenseUtil[_0xed23('0x51')]()['then'](function(_0x199b2b){if(_0x199b2b['update']){_0x5c41d8();}else{return _0x259220['status'](0x193)[_0xed23('0x31')]({'message':'Forbidden'});}})[_0xed23('0x3b')](function(_0xea40d3){_0x5c41d8(_0xea40d3);});});};exports[_0xed23('0x52')]=function isWebrtcLicence(){return compose()[_0xed23('0x29')](function(_0x5bb4b7,_0x4d13ae,_0x24b699){return licenseUtil[_0xed23('0x51')]()[_0xed23('0x41')](function(_0x1d2db9){if(_0x1d2db9[_0xed23('0x53')]){_0x24b699();}else{return _0x4d13ae['status'](0x193)[_0xed23('0x31')]({'message':_0xed23('0x54')});}})[_0xed23('0x3b')](function(_0x3282a0){_0x24b699(_0x3282a0);});});};exports[_0xed23('0x55')]=function(_0x14828f,_0x27262b,_0xf84f94){_0x14828f[_0xed23('0x55')]=!![];return _0xf84f94();};exports['signToken']=function signToken(_0x258a4c){return signJwt(_0x258a4c);};exports['setTokenCookie']=function(_0x9b4432,_0x113ebe){if(!_0x9b4432['user']){return _0x113ebe[_0xed23('0x2f')](0x194)[_0xed23('0x31')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x496e1d={'payload':{'id':_0x9b4432[_0xed23('0x2a')]['id'],'role':_0x9b4432[_0xed23('0x2a')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x496e1d)['then'](function(_0x20c508){_0x113ebe[_0xed23('0x56')](_0xed23('0x57'),_0x20c508);_0x113ebe[_0xed23('0x58')]('/dashboards/general');})[_0xed23('0x3b')](function(_0x489fb8){return _0x113ebe[_0xed23('0x2f')](0x1f4)[_0xed23('0x59')](_0x489fb8);});};exports[_0xed23('0x5a')]=function(_0x53fa89){if(_[_0xed23('0x5b')](_0x53fa89[_0xed23('0x47')])||_[_0xed23('0x5b')](_0x53fa89[_0xed23('0x5c')])){return null;}else{return createJwt(_0x53fa89);}};exports['generateApiKey']=function(_0x47798e){_0x47798e[_0xed23('0x47')]=generateNonce();_0x47798e[_0xed23('0x5c')]=generateIssuedAt();return createJwt(_0x47798e);};exports[_0xed23('0x5d')]=function(_0x3e25d7,_0x2f8125){var _0x480f50=_0x3e25d7[_0xed23('0x3e')][_0xed23('0x3f')];if(_0x480f50){var _0x50d380={'nonce':_0x2f8125[_0xed23('0x47')],'iat':_0x2f8125[_0xed23('0x5c')],'audience':hardwareConf[_0xed23('0x40')](),'issuer':hardwareConf[_0xed23('0x40')]()};return verifyJwt(_0x480f50,_0x50d380)[_0xed23('0x41')](function(){return generateApiKey(_0x2f8125);});}else{throw{'message':_0xed23('0x5e')};}};exports['validatePasswordPattern']=function(_0xef5b32){var _0x136672=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x136672[_0xed23('0x5f')](_0xef5b32))throw new db['Sequelize'][(_0xed23('0x60'))](_0xed23('0x61'));return;};exports[_0xed23('0x62')]=function(_0x44d724,_0x280031,_0x43870d){var _0x3dec9a=encryptor[_0xed23('0x63')](_0x280031)[_0xed23('0x64')](',');for(var _0x4285ed=0x0;_0x4285ed<_0x43870d;_0x4285ed++){if(!_0x3dec9a[_0x4285ed])break;if(_0x44d724['toLowerCase']()===_0x3dec9a[_0x4285ed][_0xed23('0x65')]()){var _0x1706a9=util[_0xed23('0x66')](_0xed23('0x67'),_0x43870d);if(_0x43870d===0x1){_0x1706a9='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0xed23('0x68'))][(_0xed23('0x60'))](_0x1706a9);}}return;};exports[_0xed23('0x69')]=function(_0x145621,_0xf48215){var _0x3dce6a=_0xf48215?encryptor[_0xed23('0x63')](_0xf48215)[_0xed23('0x64')](','):[];if(_0x3dce6a['length']===0x5){_0x3dce6a[_0xed23('0x6a')](-0x1,0x1);}_0x3dce6a[_0xed23('0x6b')](_0x145621);return encryptor['encryptString'](_0x3dce6a[_0xed23('0x6c')](','));};function signJwt(_0x42c847){var _0x1d04bb=BPromise[_0xed23('0x6d')](jwt[_0xed23('0x6e')],{'context':jwt});var _0x4cb709=_0x42c847[_0xed23('0x6f')]||config[_0xed23('0x70')][_0xed23('0x9')];return new BPromise(function(_0x4dcb1f,_0x426758){_0x1d04bb(_0x42c847[_0xed23('0x71')],_0x4cb709,_0x42c847['options'])['then'](function(_0x3901ca){_0x4dcb1f(_0x3901ca);})['catch'](function(_0x13afe9){_0x426758(_0x13afe9);});});}function verifyJwt(_0x41b041,_0x2839e2,_0x4e1272){var _0x382473=BPromise[_0xed23('0x6d')](jwt[_0xed23('0x72')],{'context':jwt});var _0x105aec=_0x4e1272||config[_0xed23('0x70')][_0xed23('0x9')];return new BPromise(function(_0x244c40,_0x56a87d){_0x382473(_0x41b041,_0x105aec,_0x2839e2)[_0xed23('0x41')](function(_0x1de568){_0x244c40(_0x1de568);})[_0xed23('0x3b')](function(_0x76121d){_0x56a87d(_0x76121d);});});}function generateNonce(){return crypto[_0xed23('0x73')](0x10)[_0xed23('0x74')](_0xed23('0x75'));}function generateIssuedAt(){return Math[_0xed23('0x76')](Date[_0xed23('0x77')]()/0x3e8)[_0xed23('0x74')]();}function createJwt(_0x4e3ee1){var _0x25cb7f={'payload':{'iat':_0x4e3ee1['apiKeyIat'],'nonce':_0x4e3ee1[_0xed23('0x47')]},'options':{'algorithm':_0xed23('0x78'),'subject':_0x4e3ee1['id'][_0xed23('0x74')](),'issuer':hardwareConf[_0xed23('0x40')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x25cb7f)[_0xed23('0x41')](function(_0x41ba75){return{'iat':_0x4e3ee1[_0xed23('0x5c')],'nonce':_0x4e3ee1[_0xed23('0x47')],'token':_0x41ba75};});}
\ No newline at end of file
+var _0x5bd3=['cookie','motion.token','/dashboards/general','send','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','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','unshift','encryptString','join','sign','secret','payload','options','promisify','verify','randomBytes','toString','floor','now','../../config/license/util','lodash','jsonwebtoken','express-jwt','basic-auth','crypto','moment','secrets','session','fullname','name','internal','email','userpic','md5secret','voicePause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','interface','userProfileId','privacyEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','then','status','json','Unmanaged.','Forbidden.','catch','headers','Basic','User','find','authenticate','pass','Wrong\x20credentials.','startsWith','authorization','Bearer','Unknown\x20authorization\x20format','query','getUuid','apikey','sub','Setting','allowedLoginAttempts','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','add','User\x20object\x20not\x20found.','canUpdate','getLicense','update','isWebrtcLicence','webrtc','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5bd3,0x1a3));var _0x35bd=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0x5bd3[_0x476bf4];return _0x788ffe;};'use strict';var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0x35bd('0x0'));var encryptor=require('../encryptor');var _=require(_0x35bd('0x1'));var jwt=require(_0x35bd('0x2'));var expressJwt=require(_0x35bd('0x3'));var compose=require('composable-middleware');var basicAuth=require(_0x35bd('0x4'));var crypto=require(_0x35bd('0x5'));var BPromise=require('bluebird');var util=require('util');var moment=require(_0x35bd('0x6'));var validateJwt=expressJwt({'secret':config[_0x35bd('0x7')][_0x35bd('0x8')]});var userAttributes=['id','role',_0x35bd('0x9'),_0x35bd('0xa'),_0x35bd('0xb'),_0x35bd('0xc'),_0x35bd('0xd'),'permissions',_0x35bd('0xe'),_0x35bd('0xf'),'chatPause',_0x35bd('0x10'),_0x35bd('0x11'),_0x35bd('0x12'),_0x35bd('0x13'),_0x35bd('0x14'),_0x35bd('0x15'),_0x35bd('0x16'),_0x35bd('0x17'),_0x35bd('0x18'),_0x35bd('0x19'),_0x35bd('0x1a'),'alias',_0x35bd('0x1b'),_0x35bd('0x1c'),_0x35bd('0x1d'),'phoneBarEnableRecording',_0x35bd('0x1e'),_0x35bd('0x1f'),_0x35bd('0x20'),_0x35bd('0x21'),_0x35bd('0x22'),'phoneBarRemoteControlPort','hotdesk',_0x35bd('0x23'),_0x35bd('0x24'),_0x35bd('0x25'),'settingsEnabled',_0x35bd('0x26'),_0x35bd('0x27'),_0x35bd('0x28'),_0x35bd('0x29'),_0x35bd('0x2a'),'selectRecallMeCampaign'];exports[_0x35bd('0x2b')]=function(){return this[_0x35bd('0x2c')](!![])[_0x35bd('0x2d')](function(_0x32c24c,_0x265bfd,_0x4bbf36){if(_0x32c24c[_0x35bd('0x2e')]){_0x4bbf36();}else{return db[_0x35bd('0x2f')][_0x35bd('0x30')]({'where':{'id':_0x32c24c[_0x35bd('0x31')]['id']},'attributes':['id',_0x35bd('0x32'),_0x35bd('0x33')],'raw':!![]})[_0x35bd('0x34')](function(_0x1acf0e){if(_0x1acf0e&&_0x1acf0e[_0x35bd('0x32')]){return _0x265bfd[_0x35bd('0x35')](_0x1acf0e[_0x35bd('0x33')]==='unmanaged'?0x195:0x193)[_0x35bd('0x36')]({'message':_0x1acf0e['disposition']==='unmanaged'?_0x35bd('0x37'):_0x35bd('0x38')});}else{_0x4bbf36();}})[_0x35bd('0x39')](function(_0x2af178){_0x4bbf36(_0x2af178);});}});};exports[_0x35bd('0x2c')]=function isAuthenticated(_0x921a50){return compose()[_0x35bd('0x2d')](function(_0x1f8523,_0x4027b6,_0x2e54b6){var _0x385b83;if(_0x1f8523[_0x35bd('0x3a')]['authorization']){if(_['startsWith'](_0x1f8523[_0x35bd('0x3a')]['authorization'],_0x35bd('0x3b'))){var _0x4bece9=basicAuth(_0x1f8523);db[_0x35bd('0x3c')][_0x35bd('0x3d')]({'where':{'name':_0x4bece9[_0x35bd('0xa')]}})[_0x35bd('0x34')](function(_0x27c897){if(!_0x27c897||!_0x27c897[_0x35bd('0x3e')](_0x4bece9[_0x35bd('0x3f')])){return _0x4027b6[_0x35bd('0x35')](0x191)[_0x35bd('0x36')]({'message':_0x35bd('0x40')});}_0x1f8523[_0x35bd('0x2e')]={'id':_0x27c897['id']};_0x2e54b6();})[_0x35bd('0x39')](function(_0x556cec){_0x2e54b6(_0x556cec);});}else if(_[_0x35bd('0x41')](_0x1f8523[_0x35bd('0x3a')][_0x35bd('0x42')],_0x35bd('0x43'))){validateJwt(_0x1f8523,_0x4027b6,_0x2e54b6);}else{if(_0x921a50){_0x2e54b6();}else{return _0x4027b6[_0x35bd('0x35')](0x193)['json']({'message':_0x35bd('0x44')});}}}else if(_0x1f8523[_0x35bd('0x45')]['apikey']){try{var _0x3f14d6={'audience':hardwareConf[_0x35bd('0x46')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x1f8523[_0x35bd('0x45')][_0x35bd('0x47')],_0x3f14d6)['then'](function(_0x1f46e9){return db['User']['find']({'where':{'id':_0x1f46e9[_0x35bd('0x48')]}})[_0x35bd('0x34')](function(_0x11a407){_0x385b83=_0x11a407;return db[_0x35bd('0x49')][_0x35bd('0x30')]({'where':{'id':0x1},'attributes':[_0x35bd('0x4a'),'blockDuration'],'raw':!![]});})[_0x35bd('0x34')](function(_0x502388){if(!_0x385b83||!_['isEqual'](_0x385b83[_0x35bd('0x4b')],_0x1f46e9[_0x35bd('0x4c')])){return _0x4027b6[_0x35bd('0x35')](0x191)[_0x35bd('0x36')]({'message':_0x35bd('0x4d')});}if(_0x385b83[_0x35bd('0x4e')]){return _0x4027b6[_0x35bd('0x35')](0x191)[_0x35bd('0x36')]({'message':_0x35bd('0x4f')});}if(_0x385b83['blocked']){if(_0x502388['blockDuration']>0x0){if(moment(_0x385b83['blockedAt'])[_0x35bd('0x50')](_0x502388['blockDuration'],'minutes')>moment()){return _0x4027b6[_0x35bd('0x35')](0x191)['json']({'message':_0x35bd('0x4f')});}}else{return _0x4027b6['status'](0x191)[_0x35bd('0x36')]({'message':_0x35bd('0x4f')});}}_0x1f8523[_0x35bd('0x2e')]={'id':_0x385b83['id']};_0x2e54b6();});})[_0x35bd('0x39')](function(){return _0x4027b6[_0x35bd('0x35')](0x191)[_0x35bd('0x36')]({'message':_0x35bd('0x4f')});});}catch(_0x4f820a){_0x2e54b6(_0x4f820a);}}else if(_0x921a50){_0x2e54b6();}else{return _0x4027b6[_0x35bd('0x35')](0x193)[_0x35bd('0x36')]({'message':'Unknown\x20authorization\x20format'});}})['use'](function(_0x12bed2,_0xdfcc10,_0x5e5acd){if(_0x12bed2['user']){db[_0x35bd('0x3c')][_0x35bd('0x3d')]({'where':{'id':_0x12bed2['user']['id']},'attributes':userAttributes})[_0x35bd('0x34')](function(_0x474da6){if(!_0x474da6){return _0xdfcc10['status'](0x194)[_0x35bd('0x36')]({'message':'User\x20not\x20found.'});}_0x12bed2['user']=_0x474da6;_0x5e5acd();})['catch'](function(_0x1a801f){_0x5e5acd(_0x1a801f);});}else if(_0x921a50){_0x5e5acd();}else{return _0xdfcc10[_0x35bd('0x35')](0x194)[_0x35bd('0x36')]({'message':_0x35bd('0x51')});}});};exports[_0x35bd('0x52')]=function canUpdate(){return compose()['use'](function(_0x472f2d,_0x5b9678,_0x292c4b){return licenseUtil[_0x35bd('0x53')]()[_0x35bd('0x34')](function(_0x17ae8a){if(_0x17ae8a[_0x35bd('0x54')]){_0x292c4b();}else{return _0x5b9678[_0x35bd('0x35')](0x193)[_0x35bd('0x36')]({'message':'Forbidden'});}})[_0x35bd('0x39')](function(_0x3cb6ee){_0x292c4b(_0x3cb6ee);});});};exports[_0x35bd('0x55')]=function isWebrtcLicence(){return compose()['use'](function(_0x20771d,_0xd51acb,_0x17418f){return licenseUtil[_0x35bd('0x53')]()[_0x35bd('0x34')](function(_0x2e110e){if(_0x2e110e[_0x35bd('0x56')]){_0x17418f();}else{return _0xd51acb[_0x35bd('0x35')](0x193)[_0x35bd('0x36')]({'message':_0x35bd('0x57')});}})[_0x35bd('0x39')](function(_0x242a9b){_0x17418f(_0x242a9b);});});};exports[_0x35bd('0x58')]=function(_0x6ddbd7,_0x28ac03,_0x5d2d54){_0x6ddbd7[_0x35bd('0x58')]=!![];return _0x5d2d54();};exports[_0x35bd('0x59')]=function signToken(_0x201480){return signJwt(_0x201480);};exports[_0x35bd('0x5a')]=function(_0x587ba2,_0x5be137){if(!_0x587ba2[_0x35bd('0x2e')]){return _0x5be137['status'](0x194)[_0x35bd('0x36')]({'message':_0x35bd('0x5b')});}var _0x36d096={'payload':{'id':_0x587ba2[_0x35bd('0x2e')]['id'],'role':_0x587ba2[_0x35bd('0x2e')][_0x35bd('0x5c')]},'options':{'expiresIn':0x15180}};return signJwt(_0x36d096)['then'](function(_0x59ee7d){_0x5be137[_0x35bd('0x5d')](_0x35bd('0x5e'),_0x59ee7d);_0x5be137['redirect'](_0x35bd('0x5f'));})[_0x35bd('0x39')](function(_0x1171bf){return _0x5be137[_0x35bd('0x35')](0x1f4)[_0x35bd('0x60')](_0x1171bf);});};exports['retrieveApiKey']=function(_0x39175c){if(_[_0x35bd('0x61')](_0x39175c[_0x35bd('0x4b')])||_[_0x35bd('0x61')](_0x39175c[_0x35bd('0x62')])){return null;}else{return createJwt(_0x39175c);}};exports[_0x35bd('0x63')]=function(_0x24b61a){_0x24b61a[_0x35bd('0x4b')]=generateNonce();_0x24b61a[_0x35bd('0x62')]=generateIssuedAt();return createJwt(_0x24b61a);};exports[_0x35bd('0x64')]=function(_0x5e7e01,_0xa58e75){var _0x202177=_0x5e7e01['query']['apikey'];if(_0x202177){var _0x5f4253={'nonce':_0xa58e75[_0x35bd('0x4b')],'iat':_0xa58e75[_0x35bd('0x62')],'audience':hardwareConf[_0x35bd('0x46')](),'issuer':hardwareConf[_0x35bd('0x46')]()};return verifyJwt(_0x202177,_0x5f4253)['then'](function(){return generateApiKey(_0xa58e75);});}else{throw{'message':_0x35bd('0x65')};}};exports[_0x35bd('0x66')]=function(_0x42ed1a){var _0x20959a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x20959a[_0x35bd('0x67')](_0x42ed1a))throw new db[(_0x35bd('0x68'))][(_0x35bd('0x69'))](_0x35bd('0x6a'));return;};exports[_0x35bd('0x6b')]=function(_0x32ba07,_0x21025d,_0x564ab4){var _0x2618f6=encryptor[_0x35bd('0x6c')](_0x21025d)[_0x35bd('0x6d')](',');for(var _0x105b27=0x0;_0x105b27<_0x564ab4;_0x105b27++){if(!_0x2618f6[_0x105b27])break;if(_0x32ba07[_0x35bd('0x6e')]()===_0x2618f6[_0x105b27][_0x35bd('0x6e')]()){var _0x130229=util[_0x35bd('0x6f')](_0x35bd('0x70'),_0x564ab4);if(_0x564ab4===0x1){_0x130229=_0x35bd('0x71');}throw new db[(_0x35bd('0x68'))]['ValidationError'](_0x130229);}}return;};exports[_0x35bd('0x72')]=function(_0x3cfdc8,_0x44c0ef){var _0x2cc07b=_0x44c0ef?encryptor['decryptString'](_0x44c0ef)[_0x35bd('0x6d')](','):[];if(_0x2cc07b['length']===0x5){_0x2cc07b['splice'](-0x1,0x1);}_0x2cc07b[_0x35bd('0x73')](_0x3cfdc8);return encryptor[_0x35bd('0x74')](_0x2cc07b[_0x35bd('0x75')](','));};function signJwt(_0x49727a){var _0x5bb72d=BPromise['promisify'](jwt[_0x35bd('0x76')],{'context':jwt});var _0x300821=_0x49727a[_0x35bd('0x77')]||config[_0x35bd('0x7')]['session'];return new BPromise(function(_0x4a4d75,_0x272107){_0x5bb72d(_0x49727a[_0x35bd('0x78')],_0x300821,_0x49727a[_0x35bd('0x79')])[_0x35bd('0x34')](function(_0x273663){_0x4a4d75(_0x273663);})[_0x35bd('0x39')](function(_0xed8b41){_0x272107(_0xed8b41);});});}function verifyJwt(_0x12c1c5,_0x4df4f3,_0x2c7c39){var _0x4efd50=BPromise[_0x35bd('0x7a')](jwt[_0x35bd('0x7b')],{'context':jwt});var _0x3884d9=_0x2c7c39||config[_0x35bd('0x7')]['session'];return new BPromise(function(_0x500648,_0x182b00){_0x4efd50(_0x12c1c5,_0x3884d9,_0x4df4f3)[_0x35bd('0x34')](function(_0x3782e8){_0x500648(_0x3782e8);})[_0x35bd('0x39')](function(_0x296652){_0x182b00(_0x296652);});});}function generateNonce(){return crypto[_0x35bd('0x7c')](0x10)[_0x35bd('0x7d')]('hex');}function generateIssuedAt(){return Math[_0x35bd('0x7e')](Date[_0x35bd('0x7f')]()/0x3e8)['toString']();}function createJwt(_0x242b82){var _0xe9438={'payload':{'iat':_0x242b82[_0x35bd('0x62')],'nonce':_0x242b82[_0x35bd('0x4b')]},'options':{'algorithm':'HS512','subject':_0x242b82['id']['toString'](),'issuer':hardwareConf[_0x35bd('0x46')](),'audience':hardwareConf[_0x35bd('0x46')]()}};return signJwt(_0xe9438)[_0x35bd('0x34')](function(_0xa66487){return{'iat':_0x242b82[_0x35bd('0x62')],'nonce':_0x242b82[_0x35bd('0x4b')],'token':_0xa66487};});}
\ No newline at end of file
index 68c0ae4..07e6f82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc01d=['write','final','end','close','createDecipher','unlink','encryptString','secret','utf8','base64','crypto','../../config/logger','app','secrets','aes-256-ctr','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','filter','indexOf','hasOwnProperty','createReadStream','createWriteStream','createCipher','data','update','binary'];(function(_0x25db99,_0x1e67b6){var _0x4016ce=function(_0x4a1cea){while(--_0x4a1cea){_0x25db99['push'](_0x25db99['shift']());}};_0x4016ce(++_0x1e67b6);}(_0xc01d,0xdc));var _0xdc01=function(_0x1cdf5f,_0x285949){_0x1cdf5f=_0x1cdf5f-0x0;var _0x4576d4=_0xc01d[_0x1cdf5f];return _0x4576d4;};'use strict';var crypto=require(_0xdc01('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require('lodash');var config=require('../../config/environment');var logger=require(_0xdc01('0x1'))(_0xdc01('0x2'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xdc01('0x3')]['session'],'algorithm':_0xdc01('0x4')};const fileOptions={'algorithm':'aes192'};if(config['encrypt']&&config[_0xdc01('0x5')][_0xdc01('0x6')]){var isSupported=isAlgorithmSupported(config[_0xdc01('0x5')][_0xdc01('0x6')]);if(isSupported){fileOptions[_0xdc01('0x6')]=config['encrypt'][_0xdc01('0x6')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xdc01('0x7')](',\x20');logger[_0xdc01('0x8')](config[_0xdc01('0x5')][_0xdc01('0x6')],_0xdc01('0x9'),supportedAlgorithms);}}function isASupportedCipher(_0x16b89c){return AES_SUPPORTED_RX[_0xdc01('0xa')](_0x16b89c);}function getSupportedCiphers(){return crypto['getCiphers']()[_0xdc01('0xb')](isASupportedCipher);}function isAlgorithmSupported(_0x1105f0){return getSupportedCiphers()[_0xdc01('0xc')](_0x1105f0)>-0x1;}function combineOptions(_0x3ed60f){var _0x2f0bce={};for(var _0x143cea in fileOptions){if(fileOptions[_0xdc01('0xd')](_0x143cea)){_0x2f0bce[_0x143cea]=fileOptions[_0x143cea];}}if(_0x3ed60f){for(var _0x3348b0 in _0x3ed60f){if(_0x3ed60f[_0xdc01('0xd')](_0x3348b0)){_0x2f0bce[_0x3348b0]=_0x3ed60f[_0x3348b0];}}}return _0x2f0bce;}exports['encryptFile']=function(_0x45cd9b,_0x18d206,_0x440111,_0x2fd4b9){return new BPromise(function(_0x39fc8d,_0x59dab8){_0x2fd4b9=combineOptions(_0x2fd4b9);var _0x4bf071=new Buffer(_0x440111);var _0x5ba94e=fs[_0xdc01('0xe')](_0x45cd9b);var _0x101a9c=fs[_0xdc01('0xf')](_0x18d206);var _0x29224e=crypto[_0xdc01('0x10')](_0x2fd4b9[_0xdc01('0x6')],_0x4bf071);_0x5ba94e['on'](_0xdc01('0x11'),function(_0x26b33d){var _0x1dc568=new Buffer(_0x29224e[_0xdc01('0x12')](_0x26b33d),_0xdc01('0x13'));_0x101a9c[_0xdc01('0x14')](_0x1dc568);});_0x5ba94e['on']('end',function(){try{var _0x21560f=new Buffer(_0x29224e[_0xdc01('0x15')]('binary'),'binary');_0x101a9c[_0xdc01('0x14')](_0x21560f);_0x101a9c[_0xdc01('0x16')]();_0x101a9c['on'](_0xdc01('0x17'),function(){return _0x39fc8d(_0x18d206);});}catch(_0x374859){fs['unlink'](_0x18d206);return _0x59dab8(_0x374859);}});});};exports['decryptFile']=function(_0x5a9366,_0x53fbce,_0x2f855f,_0x42e793){return new BPromise(function(_0x5d5f14,_0xb0e512){_0x42e793=combineOptions(_0x42e793);var _0x50f8db=new Buffer(_0x2f855f);var _0x44b1a1=fs[_0xdc01('0xe')](_0x5a9366);var _0x14294d=fs['createWriteStream'](_0x53fbce);var _0x5a2802=crypto[_0xdc01('0x18')](_0x42e793['algorithm'],_0x50f8db);_0x44b1a1['on'](_0xdc01('0x11'),function(_0x5f1555){var _0x1ae00f=new Buffer(_0x5a2802[_0xdc01('0x12')](_0x5f1555),_0xdc01('0x13'));_0x14294d['write'](_0x1ae00f);});_0x44b1a1['on'](_0xdc01('0x16'),function(){try{var _0x1daa6f=new Buffer(_0x5a2802[_0xdc01('0x15')](_0xdc01('0x13')),'binary');_0x14294d[_0xdc01('0x14')](_0x1daa6f);_0x14294d[_0xdc01('0x16')]();_0x14294d['on'](_0xdc01('0x17'),function(){return _0x5d5f14(_0x53fbce);});}catch(_0x286f25){fs[_0xdc01('0x19')](_0x53fbce);return _0xb0e512(_0x286f25);}});});};exports[_0xdc01('0x1a')]=function(_0xcb845,_0x5e1f7b,_0x34c0b1){var _0x371007=_0x34c0b1||stringOptions[_0xdc01('0x6')];var _0x3177de=_0x5e1f7b||stringOptions[_0xdc01('0x1b')];var _0x170b94=crypto[_0xdc01('0x10')](_0x371007,_0x3177de);var _0x54f8db=_0x170b94[_0xdc01('0x12')](_0xcb845,_0xdc01('0x1c'),_0xdc01('0x1d'));_0x54f8db+=_0x170b94[_0xdc01('0x15')](_0xdc01('0x1d'));return _0x54f8db;};exports['decryptString']=function(_0x1a0947,_0x224ed2,_0x16af07){var _0xd5603e=_0x16af07||stringOptions['algorithm'];var _0x32ed8e=_0x224ed2||stringOptions[_0xdc01('0x1b')];var _0x2a04d2=crypto['createDecipher'](_0xd5603e,_0x32ed8e);var _0x54409b=_0x2a04d2['update'](_0x1a0947,_0xdc01('0x1d'),'utf8');_0x54409b+=_0x2a04d2[_0xdc01('0x15')]('utf8');return _0x54409b;};
\ No newline at end of file
+var _0xe288=['crypto','bluebird','lodash','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','test','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','data','update','binary','write','end','final','close','unlink','decryptFile','encryptString','createCipher','utf8','base64','decryptString','secret','createDecipher'];(function(_0x2e0ffa,_0x451f12){var _0x24d627=function(_0x4d0f09){while(--_0x4d0f09){_0x2e0ffa['push'](_0x2e0ffa['shift']());}};_0x24d627(++_0x451f12);}(_0xe288,0x84));var _0x8e28=function(_0x4b7380,_0x3e040b){_0x4b7380=_0x4b7380-0x0;var _0x3a2f6b=_0xe288[_0x4b7380];return _0x3a2f6b;};'use strict';var crypto=require(_0x8e28('0x0'));var fs=require('fs');var BPromise=require(_0x8e28('0x1'));var _=require(_0x8e28('0x2'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0x8e28('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x8e28('0x4')][_0x8e28('0x5')],'algorithm':_0x8e28('0x6')};const fileOptions={'algorithm':_0x8e28('0x7')};if(config[_0x8e28('0x8')]&&config['encrypt']['algorithm']){var isSupported=isAlgorithmSupported(config[_0x8e28('0x8')]['algorithm']);if(isSupported){fileOptions[_0x8e28('0x9')]=config['encrypt'][_0x8e28('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger['error'](config['encrypt']['algorithm'],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x44c32f){return AES_SUPPORTED_RX[_0x8e28('0xa')](_0x44c32f);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x8e28('0xb')](isASupportedCipher);}function isAlgorithmSupported(_0x16e127){return getSupportedCiphers()[_0x8e28('0xc')](_0x16e127)>-0x1;}function combineOptions(_0x17e37c){var _0x4324a6={};for(var _0x32dbf5 in fileOptions){if(fileOptions[_0x8e28('0xd')](_0x32dbf5)){_0x4324a6[_0x32dbf5]=fileOptions[_0x32dbf5];}}if(_0x17e37c){for(var _0x283743 in _0x17e37c){if(_0x17e37c[_0x8e28('0xd')](_0x283743)){_0x4324a6[_0x283743]=_0x17e37c[_0x283743];}}}return _0x4324a6;}exports[_0x8e28('0xe')]=function(_0xeaaf91,_0x21eb16,_0x5b1300,_0x2f92e2){return new BPromise(function(_0x4c4571,_0x7677a8){_0x2f92e2=combineOptions(_0x2f92e2);var _0x4ee0b1=new Buffer(_0x5b1300);var _0x2a67bc=fs[_0x8e28('0xf')](_0xeaaf91);var _0xc45451=fs[_0x8e28('0x10')](_0x21eb16);var _0x1aa964=crypto['createCipher'](_0x2f92e2[_0x8e28('0x9')],_0x4ee0b1);_0x2a67bc['on'](_0x8e28('0x11'),function(_0x79df86){var _0x476e66=new Buffer(_0x1aa964[_0x8e28('0x12')](_0x79df86),_0x8e28('0x13'));_0xc45451[_0x8e28('0x14')](_0x476e66);});_0x2a67bc['on'](_0x8e28('0x15'),function(){try{var _0xfef2db=new Buffer(_0x1aa964[_0x8e28('0x16')](_0x8e28('0x13')),_0x8e28('0x13'));_0xc45451[_0x8e28('0x14')](_0xfef2db);_0xc45451['end']();_0xc45451['on'](_0x8e28('0x17'),function(){return _0x4c4571(_0x21eb16);});}catch(_0x22e79c){fs[_0x8e28('0x18')](_0x21eb16);return _0x7677a8(_0x22e79c);}});});};exports[_0x8e28('0x19')]=function(_0x279304,_0x54d0b3,_0x5ad850,_0x480ece){return new BPromise(function(_0x1508e2,_0x43a24d){_0x480ece=combineOptions(_0x480ece);var _0x61496b=new Buffer(_0x5ad850);var _0x372fc3=fs[_0x8e28('0xf')](_0x279304);var _0x4e31e3=fs[_0x8e28('0x10')](_0x54d0b3);var _0x262682=crypto['createDecipher'](_0x480ece['algorithm'],_0x61496b);_0x372fc3['on'](_0x8e28('0x11'),function(_0x15c893){var _0x206e94=new Buffer(_0x262682[_0x8e28('0x12')](_0x15c893),_0x8e28('0x13'));_0x4e31e3[_0x8e28('0x14')](_0x206e94);});_0x372fc3['on'](_0x8e28('0x15'),function(){try{var _0x560d75=new Buffer(_0x262682[_0x8e28('0x16')](_0x8e28('0x13')),_0x8e28('0x13'));_0x4e31e3[_0x8e28('0x14')](_0x560d75);_0x4e31e3[_0x8e28('0x15')]();_0x4e31e3['on'](_0x8e28('0x17'),function(){return _0x1508e2(_0x54d0b3);});}catch(_0x57f330){fs['unlink'](_0x54d0b3);return _0x43a24d(_0x57f330);}});});};exports[_0x8e28('0x1a')]=function(_0x541899,_0xa77f92,_0x3a4db0){var _0x2c640f=_0x3a4db0||stringOptions[_0x8e28('0x9')];var _0x335ffb=_0xa77f92||stringOptions['secret'];var _0x552726=crypto[_0x8e28('0x1b')](_0x2c640f,_0x335ffb);var _0x25f240=_0x552726[_0x8e28('0x12')](_0x541899,_0x8e28('0x1c'),_0x8e28('0x1d'));_0x25f240+=_0x552726[_0x8e28('0x16')](_0x8e28('0x1d'));return _0x25f240;};exports[_0x8e28('0x1e')]=function(_0x696ea,_0x26fc8d,_0xba5377){var _0x2d286e=_0xba5377||stringOptions['algorithm'];var _0x4f0859=_0x26fc8d||stringOptions[_0x8e28('0x1f')];var _0x55fbec=crypto[_0x8e28('0x20')](_0x2d286e,_0x4f0859);var _0xb1269a=_0x55fbec['update'](_0x696ea,_0x8e28('0x1d'),'utf8');_0xb1269a+=_0x55fbec['final'](_0x8e28('0x1c'));return _0xb1269a;};
\ No newline at end of file
index 8de2084..a51860c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb34e=['inspect','finally','exit','path','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','Empty','length','range','num','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','push','dirname','basename','.csv','existsSync','join','mkdirSync','each','csv','writeFileSync','%s.%s','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','CSV'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xb34e,0xfd));var _0xeb34=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xb34e[_0x2a6809];return _0x11c371;};'use strict';var util=require('util');var path=require(_0xeb34('0x0'));var _=require('lodash');var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0xeb34('0x1'));var zipdir=require(_0xeb34('0x2'));var rimraf=require(_0xeb34('0x3'));var db=require(_0xeb34('0x4'))['db'];var dbH=require(_0xeb34('0x4'))[_0xeb34('0x5')];var logger=require(_0xeb34('0x6'))(_0xeb34('0x7'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xeb34('0x8')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x1866ae,_0x3eb7fd){var _0x1ca00c={'status':_0x1866ae};var _0x5c5079={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3eb7fd){_0x1ca00c[_0xeb34('0x9')]=_0x3eb7fd;}return db[_0xeb34('0xa')]['update'](_0x1ca00c,_0x5c5079);}function main(){var _0x5f275e=0x1388;var _0x4bc7b1;logger[_0xeb34('0xb')](util[_0xeb34('0xc')](_0xeb34('0xd'),EXTRACTED_REPORT_ID,'CSV'));return db[_0xeb34('0xe')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xeb34('0xf'),_0xeb34('0x10')]})[_0xeb34('0x11')](function(_0x385929){if(_0x385929){_0x4bc7b1=_0x385929;_0x5f275e=_0x4bc7b1[_0xeb34('0x10')]||0x1388;}})[_0xeb34('0x11')](function(){return dbH[_0xeb34('0x12')][_0xeb34('0x13')](util[_0xeb34('0xc')](_0xeb34('0x14'),QUERY),{'type':dbH[_0xeb34('0x12')][_0xeb34('0x15')]['SELECT']});})['then'](function(_0xd0faa6){if(!_0xd0faa6[0x0]['num']){return analyticExtractedReport(_0xeb34('0x16'));}var _0x17c419=[];var _0x465e95=0x0;if(_0x4bc7b1[_0xeb34('0xf')]){if(_0xd0faa6&&_0xd0faa6[_0xeb34('0x17')]){var _0x3d1b3d=_[_0xeb34('0x18')](_0xd0faa6[0x0]['num']/_0x5f275e);var _0x1b82b1=Number['isInteger'](_0xd0faa6[0x0][_0xeb34('0x19')]/_0x5f275e)?_0xd0faa6[0x0][_0xeb34('0x19')]%_0x5f275e:0x0;_0x3d1b3d[_0xeb34('0x1a')](function(_0x13fa8d){if(_0x13fa8d>0x0){_0x465e95+=_0x5f275e;}_0x17c419['push'](dbH[_0xeb34('0x12')][_0xeb34('0x13')](util[_0xeb34('0xc')](_0xeb34('0x1b'),QUERY,_0x5f275e,_0x465e95),{'type':dbH['sequelize'][_0xeb34('0x15')]['SELECT']}));});if(_0x1b82b1>0x0){_0x465e95+=_0x5f275e;_0x17c419['push'](dbH['sequelize'][_0xeb34('0x13')](util['format'](_0xeb34('0x1b'),QUERY,_0x1b82b1,_0x465e95),{'type':dbH[_0xeb34('0x12')][_0xeb34('0x15')][_0xeb34('0x1c')]}));}}}else{_0x17c419[_0xeb34('0x1d')](dbH[_0xeb34('0x12')][_0xeb34('0x13')](QUERY,{'type':dbH[_0xeb34('0x12')]['QueryTypes'][_0xeb34('0x1c')]}));}var _0x1235eb=path[_0xeb34('0x1e')](PATH);var _0x2b56b5=path[_0xeb34('0x1f')](PATH,_0xeb34('0x20'));var _0x935812=_0x4bc7b1[_0xeb34('0xf')]&&_0x17c419['length']>0x1;var _0x314c69=[];if(!fs[_0xeb34('0x21')](path[_0xeb34('0x22')](_0x1235eb,_0x2b56b5))&&_0x935812){fs[_0xeb34('0x23')](path[_0xeb34('0x22')](_0x1235eb,_0x2b56b5));}return BPromise[_0xeb34('0x24')](_0x17c419,function(_0x1f5dd8){_0x314c69[_0xeb34('0x1d')](_0x1f5dd8);})[_0xeb34('0x11')](function(){for(var _0x1d724d=0x0;_0x1d724d<_0x314c69['length'];_0x1d724d+=0x1){var _0x309ad2;var _0x18e5be=_0x314c69[_0x1d724d];if(_0x935812){_0x309ad2=path[_0xeb34('0x22')](_0x1235eb,_0x2b56b5,util[_0xeb34('0xc')]('%s%d.%s',_0x2b56b5,_0x1d724d,_0xeb34('0x25')));}else{_0x309ad2=path[_0xeb34('0x22')](_0x1235eb,util[_0xeb34('0xc')]('%s.%s',_0x2b56b5,_0xeb34('0x25')));}fs[_0xeb34('0x26')](_0x309ad2,csv(_0x18e5be));}})[_0xeb34('0x11')](function(){if(_0x935812){return new Promise(function(_0x312d13){zipdir(path[_0xeb34('0x22')](_0x1235eb,_0x2b56b5),{'saveTo':path[_0xeb34('0x22')](_0x1235eb,util[_0xeb34('0xc')](_0xeb34('0x27'),_0x2b56b5,_0xeb34('0x28')))},function(_0x55cb20,_0x573477){rimraf(path[_0xeb34('0x22')](_0x1235eb,_0x2b56b5),function(){});_0x312d13(_0xeb34('0x29'));});});}})[_0xeb34('0x11')](function(){logger[_0xeb34('0xb')](util[_0xeb34('0xc')](_0xeb34('0x2a'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xeb34('0x2b'),_0x935812?util[_0xeb34('0xc')](_0xeb34('0x27'),_0x2b56b5,_0x935812?_0xeb34('0x28'):'csv'):null);});})[_0xeb34('0x2c')](function(_0x4f9daa){logger['info'](util['format'](_0xeb34('0x2d'),EXTRACTED_REPORT_ID,_0xeb34('0x2e')),util[_0xeb34('0x2f')](_0x4f9daa,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xeb34('0x30')](function(){process[_0xeb34('0x31')](EXIT_CODE);});}main();
\ No newline at end of file
+var _0xc8dc=['QueryTypes','SELECT','num','Empty','split','length','range','isInteger','forEach','push','query','dirname','basename','.csv','existsSync','join','mkdirSync','each','csv','%s.%s','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','CSV','inspect','util','path','bluebird','rimraf','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','info','format','Setting','find','splitSizeCsv','then','sequelize'];(function(_0x3dce62,_0x1f5d55){var _0x20bf2e=function(_0x1f31f2){while(--_0x1f31f2){_0x3dce62['push'](_0x3dce62['shift']());}};_0x20bf2e(++_0x1f5d55);}(_0xc8dc,0x17b));var _0xcc8d=function(_0x3c76fc,_0x39e116){_0x3c76fc=_0x3c76fc-0x0;var _0x4755f5=_0xc8dc[_0x3c76fc];return _0x4755f5;};'use strict';var util=require(_0xcc8d('0x0'));var path=require(_0xcc8d('0x1'));var _=require('lodash');var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0xcc8d('0x2'));var zipdir=require('zip-dir');var rimraf=require(_0xcc8d('0x3'));var db=require(_0xcc8d('0x4'))['db'];var dbH=require(_0xcc8d('0x4'))[_0xcc8d('0x5')];var logger=require('../../config/logger')(_0xcc8d('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0xcc8d('0x7')][0x2]);var QUERY=process[_0xcc8d('0x7')][0x3];var PATH=process[_0xcc8d('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x259a31,_0x2838ec){var _0x51fa3b={'status':_0x259a31};var _0x523912={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2838ec){_0x51fa3b[_0xcc8d('0x8')]=_0x2838ec;}return db[_0xcc8d('0x9')]['update'](_0x51fa3b,_0x523912);}function main(){var _0x193c3b=0x1388;var _0x360cd3;logger[_0xcc8d('0xa')](util[_0xcc8d('0xb')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'));return db[_0xcc8d('0xc')][_0xcc8d('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xcc8d('0xe')]})['then'](function(_0x2e739b){if(_0x2e739b){_0x360cd3=_0x2e739b;_0x193c3b=_0x360cd3['splitSizeCsv']||0x1388;}})[_0xcc8d('0xf')](function(){return dbH['sequelize']['query'](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xcc8d('0x10')][_0xcc8d('0x11')][_0xcc8d('0x12')]});})[_0xcc8d('0xf')](function(_0x24c96a){if(!_0x24c96a[0x0][_0xcc8d('0x13')]){return analyticExtractedReport(_0xcc8d('0x14'));}var _0x4c81bc=[];var _0x4d3f96=0x0;if(_0x360cd3[_0xcc8d('0x15')]){if(_0x24c96a&&_0x24c96a[_0xcc8d('0x16')]){var _0x476ad7=_[_0xcc8d('0x17')](_0x24c96a[0x0]['num']/_0x193c3b);var _0x59a467=Number[_0xcc8d('0x18')](_0x24c96a[0x0]['num']/_0x193c3b)?_0x24c96a[0x0]['num']%_0x193c3b:0x0;_0x476ad7[_0xcc8d('0x19')](function(_0x445a6e){if(_0x445a6e>0x0){_0x4d3f96+=_0x193c3b;}_0x4c81bc[_0xcc8d('0x1a')](dbH[_0xcc8d('0x10')]['query'](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x193c3b,_0x4d3f96),{'type':dbH[_0xcc8d('0x10')][_0xcc8d('0x11')][_0xcc8d('0x12')]}));});if(_0x59a467>0x0){_0x4d3f96+=_0x193c3b;_0x4c81bc[_0xcc8d('0x1a')](dbH[_0xcc8d('0x10')][_0xcc8d('0x1b')](util[_0xcc8d('0xb')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x59a467,_0x4d3f96),{'type':dbH[_0xcc8d('0x10')][_0xcc8d('0x11')][_0xcc8d('0x12')]}));}}}else{_0x4c81bc[_0xcc8d('0x1a')](dbH['sequelize'][_0xcc8d('0x1b')](QUERY,{'type':dbH[_0xcc8d('0x10')][_0xcc8d('0x11')][_0xcc8d('0x12')]}));}var _0x490c14=path[_0xcc8d('0x1c')](PATH);var _0x501d90=path[_0xcc8d('0x1d')](PATH,_0xcc8d('0x1e'));var _0x13fab2=_0x360cd3['split']&&_0x4c81bc[_0xcc8d('0x16')]>0x1;var _0x340d63=[];if(!fs[_0xcc8d('0x1f')](path[_0xcc8d('0x20')](_0x490c14,_0x501d90))&&_0x13fab2){fs[_0xcc8d('0x21')](path[_0xcc8d('0x20')](_0x490c14,_0x501d90));}return BPromise[_0xcc8d('0x22')](_0x4c81bc,function(_0x4f49ae){_0x340d63[_0xcc8d('0x1a')](_0x4f49ae);})[_0xcc8d('0xf')](function(){for(var _0x117b06=0x0;_0x117b06<_0x340d63[_0xcc8d('0x16')];_0x117b06+=0x1){var _0x34392a;var _0x231cb3=_0x340d63[_0x117b06];if(_0x13fab2){_0x34392a=path[_0xcc8d('0x20')](_0x490c14,_0x501d90,util[_0xcc8d('0xb')]('%s%d.%s',_0x501d90,_0x117b06,_0xcc8d('0x23')));}else{_0x34392a=path[_0xcc8d('0x20')](_0x490c14,util[_0xcc8d('0xb')](_0xcc8d('0x24'),_0x501d90,_0xcc8d('0x23')));}fs[_0xcc8d('0x25')](_0x34392a,csv(_0x231cb3));}})[_0xcc8d('0xf')](function(){if(_0x13fab2){return new Promise(function(_0x14ed95){zipdir(path[_0xcc8d('0x20')](_0x490c14,_0x501d90),{'saveTo':path['join'](_0x490c14,util['format']('%s.%s',_0x501d90,_0xcc8d('0x26')))},function(_0x1c054b,_0x3eac3b){rimraf(path['join'](_0x490c14,_0x501d90),function(){});_0x14ed95('zip\x20finished');});});}})[_0xcc8d('0xf')](function(){logger[_0xcc8d('0xa')](util[_0xcc8d('0xb')](_0xcc8d('0x27'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport('Completed',_0x13fab2?util[_0xcc8d('0xb')]('%s.%s',_0x501d90,_0x13fab2?_0xcc8d('0x26'):_0xcc8d('0x23')):null);});})[_0xcc8d('0x28')](function(_0x368841){logger[_0xcc8d('0xa')](util[_0xcc8d('0xb')](_0xcc8d('0x29'),EXTRACTED_REPORT_ID,_0xcc8d('0x2a')),util[_0xcc8d('0x2b')](_0x368841,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process['exit'](EXIT_CODE);});}main();
\ No newline at end of file
index eb94410..4ca8aea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49bb=['inspect','Failed','exit','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','interactionId','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','end','createPdfFromHTML','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','window','../../mysqldb','dbH','../../config/logger','argv','update','map','tableHeader','pick','toString','fill','auto','push','body','concat','chunk','keys','format','name','startDate','endDate','length','header','pageBreak','before','margin','landscape','\x20/\x20','footer','Arial','right','Empty','Setting','find','splitSizePdf','then','split','range','num','isInteger','forEach','query','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','QueryTypes','SELECT','dirname','basename','.pdf','join','mkdirSync','each','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','PDF','AnalyticExtractedReport','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format'];(function(_0x2e9c50,_0x2333aa){var _0x59a227=function(_0x1f8f50){while(--_0x1f8f50){_0x2e9c50['push'](_0x2e9c50['shift']());}};_0x59a227(++_0x2333aa);}(_0x49bb,0x6b));var _0xb49b=function(_0x582da5,_0x45a6dc){_0x582da5=_0x582da5-0x0;var _0x21af2e=_0x49bb[_0x582da5];return _0x21af2e;};'use strict';var _=require(_0xb49b('0x0'));var fs=require('fs');var util=require(_0xb49b('0x1'));var path=require(_0xb49b('0x2'));var moment=require(_0xb49b('0x3'));var htmlToPdfmake=require(_0xb49b('0x4'));var PdfPrinter=require(_0xb49b('0x5'));var zipdir=require(_0xb49b('0x6'));var rimraf=require(_0xb49b('0x7'));var JSDOM=require(_0xb49b('0x8'))['JSDOM'];var window=new JSDOM('')[_0xb49b('0x9')];var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var dbH=require(_0xb49b('0xa'))[_0xb49b('0xb')];var logger=require(_0xb49b('0xc'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xb49b('0xd')][0x2]);var QUERY=process[_0xb49b('0xd')][0x3];var PATH=process[_0xb49b('0xd')][0x4];var NAME=process['argv'][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x537daf,_0x45a8ea){var _0x1e1ba7={'status':_0x537daf};var _0x29a434={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x45a8ea){_0x1e1ba7['savename']=_0x45a8ea;}return db['AnalyticExtractedReport'][_0xb49b('0xe')](_0x1e1ba7,_0x29a434);}function getHeaders(_0x5f40ea){return _[_0xb49b('0xf')](_0x5f40ea,function(_0x48f80b){return{'text':_0x48f80b,'style':_0xb49b('0x10')};});}function getRows(_0x16d41c,_0x200fdf){return _[_0xb49b('0xf')](_0x200fdf,function(_0x157208){return _(_0x157208)[_0xb49b('0x11')](_0x16d41c)[_0xb49b('0xf')](function(_0x14e0c7){return _0x14e0c7?_[_0xb49b('0x12')](_0x14e0c7):'';})['value']();});}function createTable(_0x52394e,_0x163640){var _0x1fb97d={'widths':_[_0xb49b('0x13')](Array(_0x52394e['length']),0x91),'heights':function(_0x143061){return _0x143061===0x0?_0xb49b('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x2b76bb=getHeaders(_0x52394e);_0x1fb97d['body'][_0xb49b('0x15')](_0x2b76bb);var _0x480558=getRows(_0x52394e,_0x163640);_0x1fb97d['body']=_0x1fb97d[_0xb49b('0x16')][_0xb49b('0x17')](_0x480558);return _0x1fb97d;}function createTables(_0x272c90){var _0x584e23=[];var _0x38535b=_[_0xb49b('0x18')](Object[_0xb49b('0x19')](_0x272c90[0x0]),0x5);_0x38535b['forEach'](function(_0x225f04){_0x584e23[_0xb49b('0x15')](createTable(_0x225f04,_0x272c90));});return _0x584e23;}function getPDFDocDefinition(_0x3e3a4b){var _0x2a01f3=util[_0xb49b('0x1a')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0xb49b('0x1b')],moment(EXTRACTED_REPORT[_0xb49b('0x1c')])[_0xb49b('0x1a')](FORMAT),moment(EXTRACTED_REPORT[_0xb49b('0x1d')])[_0xb49b('0x1a')](FORMAT));var _0x43d795=[];for(var _0x4b22e0=0x0;_0x4b22e0<_0x3e3a4b[_0xb49b('0x1e')];_0x4b22e0++){var _0xeae34f=[];if(_0x4b22e0===0x0){_0xeae34f[_0xb49b('0x15')]({'text':_0x2a01f3,'style':_0xb49b('0x1f')});}var _0x555119={'table':_0x3e3a4b[_0x4b22e0]};if(_0x4b22e0>0x0){_0x555119[_0xb49b('0x20')]=_0xb49b('0x21');_0x555119[_0xb49b('0x22')]=[0x0,0x46,0x0,0x0];}_0xeae34f[_0xb49b('0x15')](_0x555119);_0x43d795['push'](_0xeae34f);}return{'pageSize':'A4','pageOrientation':_0xb49b('0x23'),'content':_0x43d795,'footer':function(_0x46156c,_0x5f32b0){return{'text':_0x46156c[_0xb49b('0x12')]()+_0xb49b('0x24')+_0x5f32b0,'style':_0xb49b('0x25')};},'defaultStyle':{'font':_0xb49b('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0xb49b('0x27'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x583985){var _0x4658f2=0x1388;var _0x562dca;if(!_0x583985[0x0]['num']){return analyticExtractedReport(_0xb49b('0x28'));}return db[_0xb49b('0x29')][_0xb49b('0x2a')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xb49b('0x2b')]})[_0xb49b('0x2c')](function(_0x9efa69){if(_0x9efa69){_0x562dca=_0x9efa69;_0x4658f2=_0x562dca[_0xb49b('0x2b')]||0x3e8;}})[_0xb49b('0x2c')](function(){var _0x56ce3f=[];var _0x75d550=0x0;if(_0x562dca[_0xb49b('0x2d')]){if(_0x583985&&_0x583985[_0xb49b('0x1e')]){var _0x49556a=_[_0xb49b('0x2e')](_0x583985[0x0][_0xb49b('0x2f')]/_0x4658f2);var _0x1403e2=Number[_0xb49b('0x30')](_0x583985[0x0][_0xb49b('0x2f')]/_0x4658f2)?_0x583985[0x0]['num']%_0x4658f2:0x0;_0x49556a[_0xb49b('0x31')](function(_0x23ea63){if(_0x23ea63>0x0){_0x75d550+=_0x4658f2;}_0x56ce3f[_0xb49b('0x15')](dbH['sequelize'][_0xb49b('0x32')](util['format'](_0xb49b('0x33'),QUERY,_0x4658f2,_0x75d550),{'type':dbH[_0xb49b('0x34')][_0xb49b('0x35')][_0xb49b('0x36')]}));});if(_0x1403e2>0x0){_0x75d550+=_0x4658f2;_0x56ce3f[_0xb49b('0x15')](dbH['sequelize'][_0xb49b('0x32')](util[_0xb49b('0x1a')](_0xb49b('0x33'),QUERY,_0x1403e2,_0x75d550),{'type':dbH['sequelize']['QueryTypes'][_0xb49b('0x36')]}));}}}else{_0x56ce3f[_0xb49b('0x15')](dbH[_0xb49b('0x34')][_0xb49b('0x32')](QUERY,{'type':dbH[_0xb49b('0x34')][_0xb49b('0x35')]['SELECT']}));}var _0x54153a=path[_0xb49b('0x37')](PATH);var _0x1e01d3=path[_0xb49b('0x38')](PATH,_0xb49b('0x39'));var _0xd114d3=_0x562dca[_0xb49b('0x2d')]&&_0x56ce3f['length']>0x1;var _0x2639b4=[];if(!fs['existsSync'](path[_0xb49b('0x3a')](_0x54153a,_0x1e01d3))&&_0xd114d3){fs[_0xb49b('0x3b')](path[_0xb49b('0x3a')](_0x54153a,_0x1e01d3));}return BPromise[_0xb49b('0x3c')](_0x56ce3f,function(_0x5199e2){_0x2639b4[_0xb49b('0x15')](_0x5199e2);})['then'](function(){var _0x1626e7=[];for(var _0x12e7e5=0x0;_0x12e7e5<_0x2639b4['length'];_0x12e7e5+=0x1){var _0x8b507=_0x2639b4[_0x12e7e5];var _0x1f06d6=createTables(_[_0xb49b('0x3d')](_0x8b507));var _0x4e7baf;var _0x5c7a37=getPDFDocDefinition(_0x1f06d6);var _0x55dc95=getPDFPrinter();var _0x158a40=_0x55dc95[_0xb49b('0x3e')](_0x5c7a37);if(_0xd114d3){_0x4e7baf=path[_0xb49b('0x3a')](_0x54153a,_0x1e01d3,util[_0xb49b('0x1a')](_0xb49b('0x3f'),_0x1e01d3,_0x12e7e5,_0xb49b('0x40')));}else{_0x4e7baf=path[_0xb49b('0x3a')](_0x54153a,util[_0xb49b('0x1a')](_0xb49b('0x41'),_0x1e01d3,_0xb49b('0x40')));}_0x1626e7['push'](writePDFDocument(_0x158a40,_0x4e7baf));}return Promise['all'](_0x1626e7);})[_0xb49b('0x2c')](function(){if(_0xd114d3){return new Promise(function(_0x508b52){zipdir(path[_0xb49b('0x3a')](_0x54153a,_0x1e01d3),{'saveTo':path[_0xb49b('0x3a')](_0x54153a,util[_0xb49b('0x1a')]('%s.%s',_0x1e01d3,_0xb49b('0x42')))},function(){rimraf(path['join'](_0x54153a,_0x1e01d3),function(){});_0x508b52(_0xb49b('0x43'));});});}})[_0xb49b('0x2c')](function(){if(!_0xd114d3)return;rimraf(path['join'](_0x54153a,_0x1e01d3),function(){});})[_0xb49b('0x2c')](function(){logger[_0xb49b('0x44')](util[_0xb49b('0x1a')](_0xb49b('0x45'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0xb49b('0x46'),_0xd114d3?util['format']('%s.%s',_0x1e01d3,_0xd114d3?_0xb49b('0x42'):_0xb49b('0x40')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xb49b('0x44')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xb49b('0x47')));return db[_0xb49b('0x48')][_0xb49b('0x49')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xb49b('0x2c')](function(_0x1fc055){EXTRACTED_REPORT=_0x1fc055;return dbH[_0xb49b('0x34')]['query'](util[_0xb49b('0x1a')](_0xb49b('0x4a'),QUERY),{'type':dbH[_0xb49b('0x34')][_0xb49b('0x35')]['SELECT']});})[_0xb49b('0x2c')](extractReport)[_0xb49b('0x4b')](function(_0x50db25){logger[_0xb49b('0x44')](util[_0xb49b('0x1a')](_0xb49b('0x4c'),EXTRACTED_REPORT_ID,'PDF'),util[_0xb49b('0x4d')](_0x50db25,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xb49b('0x4e'));})['finally'](function(){process[_0xb49b('0x4f')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x36ae7d=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0xb49b('0x50'),'italics':__dirname+_0xb49b('0x51'),'bolditalics':__dirname+_0xb49b('0x52')}});return _0x36ae7d;}function getPDFDocDefinitionFromHTML(_0x1f9232,_0x20ffca){var _0xf63991=util[_0xb49b('0x1a')](_0xb49b('0x53'),_0x20ffca['channel'],_0x20ffca[_0xb49b('0x54')]);var _0x151816=moment()[_0xb49b('0x1a')]('YYYY-MM-DD')[_0xb49b('0x12')]();var _0x5b52f4=htmlToPdfmake(_0x1f9232,{'window':window,'tableAutoSize':!![]});return{'content':[_0x5b52f4],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0xb49b('0x55'),'style':_0xb49b('0x1f')}];},'footer':function(_0x57e338,_0x5530b2){return[{'text':util['format'](_0xb49b('0x56'),_0xf63991,_0x57e338,_0x5530b2,_0x151816),'style':'footer'}];}};}function writePDFDocument(_0x3db051,_0x235e6c){return new Promise(function(_0x2b769c,_0x55116b){var _0x100adf=_0x3db051[_0xb49b('0x57')](fs[_0xb49b('0x58')](_0x235e6c));_0x100adf['on'](_0xb49b('0x59'),function(){_0x2b769c(_0xb49b('0x59'));});_0x100adf['on']('error',function(_0x49e9a6){_0x55116b(_0x49e9a6);});_0x3db051[_0xb49b('0x5a')]();});}exports[_0xb49b('0x5b')]=function(_0x195a21,_0x41ca70){var _0x3cb321=getPDFPrinter();var _0x2d0dfe=getPDFDocDefinitionFromHTML(_0x195a21,_0x41ca70);var _0x1cad09=_0x3cb321['createPdfKitDocument'](_0x2d0dfe);return writePDFDocument(_0x1cad09,_0x41ca70[_0xb49b('0x2')])[_0xb49b('0x4b')](function(_0x8f7090){throw _0x8f7090;});};
\ No newline at end of file
+var _0x627a=['createWriteStream','finish','error','end','createPdfFromHTML','createPdfKitDocument','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','JSDOM','bluebird','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','map','tableHeader','pick','toString','value','length','auto','body','push','concat','keys','forEach','format','before','margin','landscape','\x20/\x20','footer','Arial','black','num','Empty','Setting','split','splitSizePdf','then','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','query','dirname','basename','join','mkdirSync','%s%d.%s','pdf','%s.%s','all','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','zip','AnalyticExtractedReport','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','header','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x627a,0xae));var _0xa627=function(_0x4916f1,_0x51207d){_0x4916f1=_0x4916f1-0x0;var _0x203994=_0x627a[_0x4916f1];return _0x203994;};'use strict';var _=require(_0xa627('0x0'));var fs=require('fs');var util=require(_0xa627('0x1'));var path=require(_0xa627('0x2'));var moment=require(_0xa627('0x3'));var htmlToPdfmake=require(_0xa627('0x4'));var PdfPrinter=require(_0xa627('0x5'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var JSDOM=require('jsdom')[_0xa627('0x6')];var window=new JSDOM('')['window'];var BPromise=require(_0xa627('0x7'));var db=require(_0xa627('0x8'))['db'];var dbH=require(_0xa627('0x8'))[_0xa627('0x9')];var logger=require(_0xa627('0xa'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xa627('0xb')][0x2]);var QUERY=process[_0xa627('0xb')][0x3];var PATH=process[_0xa627('0xb')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xa627('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x53904d,_0x5d9c1d){var _0x129984={'status':_0x53904d};var _0x756717={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5d9c1d){_0x129984['savename']=_0x5d9c1d;}return db['AnalyticExtractedReport']['update'](_0x129984,_0x756717);}function getHeaders(_0x87203d){return _[_0xa627('0xd')](_0x87203d,function(_0x18c3ee){return{'text':_0x18c3ee,'style':_0xa627('0xe')};});}function getRows(_0x3db6a7,_0x22c2dd){return _[_0xa627('0xd')](_0x22c2dd,function(_0x5e9562){return _(_0x5e9562)[_0xa627('0xf')](_0x3db6a7)[_0xa627('0xd')](function(_0x21dde8){return _0x21dde8?_[_0xa627('0x10')](_0x21dde8):'';})[_0xa627('0x11')]();});}function createTable(_0x2f92d8,_0x11cc45){var _0x33675b={'widths':_['fill'](Array(_0x2f92d8[_0xa627('0x12')]),0x91),'heights':function(_0x3801e8){return _0x3801e8===0x0?_0xa627('0x13'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x3474b5=getHeaders(_0x2f92d8);_0x33675b[_0xa627('0x14')][_0xa627('0x15')](_0x3474b5);var _0x4ec1ec=getRows(_0x2f92d8,_0x11cc45);_0x33675b[_0xa627('0x14')]=_0x33675b[_0xa627('0x14')][_0xa627('0x16')](_0x4ec1ec);return _0x33675b;}function createTables(_0x4abe9b){var _0x90a380=[];var _0x5dded5=_['chunk'](Object[_0xa627('0x17')](_0x4abe9b[0x0]),0x5);_0x5dded5[_0xa627('0x18')](function(_0x258606){_0x90a380[_0xa627('0x15')](createTable(_0x258606,_0x4abe9b));});return _0x90a380;}function getPDFDocDefinition(_0x576de6){var _0x32d02d=util[_0xa627('0x19')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT['startDate'])[_0xa627('0x19')](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0xa627('0x19')](FORMAT));var _0x2e6963=[];for(var _0x3ee02f=0x0;_0x3ee02f<_0x576de6[_0xa627('0x12')];_0x3ee02f++){var _0x3aa1d2=[];if(_0x3ee02f===0x0){_0x3aa1d2[_0xa627('0x15')]({'text':_0x32d02d,'style':'header'});}var _0x3043b2={'table':_0x576de6[_0x3ee02f]};if(_0x3ee02f>0x0){_0x3043b2['pageBreak']=_0xa627('0x1a');_0x3043b2[_0xa627('0x1b')]=[0x0,0x46,0x0,0x0];}_0x3aa1d2[_0xa627('0x15')](_0x3043b2);_0x2e6963[_0xa627('0x15')](_0x3aa1d2);}return{'pageSize':'A4','pageOrientation':_0xa627('0x1c'),'content':_0x2e6963,'footer':function(_0x16b8c9,_0x348755){return{'text':_0x16b8c9['toString']()+_0xa627('0x1d')+_0x348755,'style':_0xa627('0x1e')};},'defaultStyle':{'font':_0xa627('0x1f')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xa627('0x20')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x55028c){var _0x51a065=0x1388;var _0x12018f;if(!_0x55028c[0x0][_0xa627('0x21')]){return analyticExtractedReport(_0xa627('0x22'));}return db[_0xa627('0x23')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xa627('0x24'),_0xa627('0x25')]})[_0xa627('0x26')](function(_0x3c6208){if(_0x3c6208){_0x12018f=_0x3c6208;_0x51a065=_0x12018f[_0xa627('0x25')]||0x3e8;}})[_0xa627('0x26')](function(){var _0x1950ff=[];var _0x462be4=0x0;if(_0x12018f[_0xa627('0x24')]){if(_0x55028c&&_0x55028c[_0xa627('0x12')]){var _0x14fcaf=_['range'](_0x55028c[0x0]['num']/_0x51a065);var _0x34a1e5=Number['isInteger'](_0x55028c[0x0]['num']/_0x51a065)?_0x55028c[0x0][_0xa627('0x21')]%_0x51a065:0x0;_0x14fcaf[_0xa627('0x18')](function(_0x3d2abf){if(_0x3d2abf>0x0){_0x462be4+=_0x51a065;}_0x1950ff[_0xa627('0x15')](dbH[_0xa627('0x27')]['query'](util['format'](_0xa627('0x28'),QUERY,_0x51a065,_0x462be4),{'type':dbH[_0xa627('0x27')][_0xa627('0x29')][_0xa627('0x2a')]}));});if(_0x34a1e5>0x0){_0x462be4+=_0x51a065;_0x1950ff[_0xa627('0x15')](dbH[_0xa627('0x27')][_0xa627('0x2b')](util[_0xa627('0x19')](_0xa627('0x28'),QUERY,_0x34a1e5,_0x462be4),{'type':dbH['sequelize'][_0xa627('0x29')][_0xa627('0x2a')]}));}}}else{_0x1950ff['push'](dbH['sequelize'][_0xa627('0x2b')](QUERY,{'type':dbH[_0xa627('0x27')][_0xa627('0x29')]['SELECT']}));}var _0x328c75=path[_0xa627('0x2c')](PATH);var _0xbdea83=path[_0xa627('0x2d')](PATH,'.pdf');var _0x408983=_0x12018f[_0xa627('0x24')]&&_0x1950ff[_0xa627('0x12')]>0x1;var _0x5dc8e2=[];if(!fs['existsSync'](path[_0xa627('0x2e')](_0x328c75,_0xbdea83))&&_0x408983){fs[_0xa627('0x2f')](path[_0xa627('0x2e')](_0x328c75,_0xbdea83));}return BPromise['each'](_0x1950ff,function(_0x360ffa){_0x5dc8e2[_0xa627('0x15')](_0x360ffa);})[_0xa627('0x26')](function(){var _0x338d45=[];for(var _0x2577c2=0x0;_0x2577c2<_0x5dc8e2['length'];_0x2577c2+=0x1){var _0x254cdf=_0x5dc8e2[_0x2577c2];var _0x4646e1=createTables(_['flatten'](_0x254cdf));var _0x3fb5e0;var _0x1e83fd=getPDFDocDefinition(_0x4646e1);var _0x50b9bb=getPDFPrinter();var _0x28b207=_0x50b9bb['createPdfKitDocument'](_0x1e83fd);if(_0x408983){_0x3fb5e0=path['join'](_0x328c75,_0xbdea83,util[_0xa627('0x19')](_0xa627('0x30'),_0xbdea83,_0x2577c2,_0xa627('0x31')));}else{_0x3fb5e0=path[_0xa627('0x2e')](_0x328c75,util[_0xa627('0x19')](_0xa627('0x32'),_0xbdea83,_0xa627('0x31')));}_0x338d45['push'](writePDFDocument(_0x28b207,_0x3fb5e0));}return Promise[_0xa627('0x33')](_0x338d45);})['then'](function(){if(_0x408983){return new Promise(function(_0x342404){zipdir(path[_0xa627('0x2e')](_0x328c75,_0xbdea83),{'saveTo':path[_0xa627('0x2e')](_0x328c75,util[_0xa627('0x19')](_0xa627('0x32'),_0xbdea83,'zip'))},function(){rimraf(path[_0xa627('0x2e')](_0x328c75,_0xbdea83),function(){});_0x342404(_0xa627('0x34'));});});}})[_0xa627('0x26')](function(){if(!_0x408983)return;rimraf(path[_0xa627('0x2e')](_0x328c75,_0xbdea83),function(){});})[_0xa627('0x26')](function(){logger[_0xa627('0x35')](util['format'](_0xa627('0x36'),EXTRACTED_REPORT_ID,_0xa627('0x37')));return analyticExtractedReport('Completed',_0x408983?util['format'](_0xa627('0x32'),_0xbdea83,_0x408983?_0xa627('0x38'):_0xa627('0x31')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xa627('0x35')](util[_0xa627('0x19')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xa627('0x37')));return db[_0xa627('0x39')][_0xa627('0x3a')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xa627('0x26')](function(_0x21bd3e){EXTRACTED_REPORT=_0x21bd3e;return dbH['sequelize']['query'](util[_0xa627('0x19')](_0xa627('0x3b'),QUERY),{'type':dbH[_0xa627('0x27')][_0xa627('0x29')][_0xa627('0x2a')]});})['then'](extractReport)[_0xa627('0x3c')](function(_0x1d1ea6){logger[_0xa627('0x35')](util['format'](_0xa627('0x3d'),EXTRACTED_REPORT_ID,_0xa627('0x37')),util[_0xa627('0x3e')](_0x1d1ea6,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xa627('0x3f'));})['finally'](function(){process[_0xa627('0x40')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x4e667a=new PdfPrinter({'Arial':{'normal':__dirname+_0xa627('0x41'),'bold':__dirname+_0xa627('0x42'),'italics':__dirname+_0xa627('0x43'),'bolditalics':__dirname+_0xa627('0x44')}});return _0x4e667a;}function getPDFDocDefinitionFromHTML(_0x3e1a36,_0x55ed6e){var _0x4cd839=util[_0xa627('0x19')](_0xa627('0x45'),_0x55ed6e[_0xa627('0x46')],_0x55ed6e[_0xa627('0x47')]);var _0x50055b=moment()[_0xa627('0x19')](_0xa627('0x48'))[_0xa627('0x10')]();var _0x5428a8=htmlToPdfmake(_0x3e1a36,{'window':window,'tableAutoSize':!![]});return{'content':[_0x5428a8],'defaultStyle':{'font':_0xa627('0x1f')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xa627('0x49'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xa627('0x49'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0xa627('0x4a'),'style':_0xa627('0x4b')}];},'footer':function(_0x18ac25,_0x43a181){return[{'text':util[_0xa627('0x19')](_0xa627('0x4c'),_0x4cd839,_0x18ac25,_0x43a181,_0x50055b),'style':'footer'}];}};}function writePDFDocument(_0x5b9f60,_0x12e92d){return new Promise(function(_0x288e62,_0x3d1a13){var _0x1a6462=_0x5b9f60[_0xa627('0x4d')](fs[_0xa627('0x4e')](_0x12e92d));_0x1a6462['on'](_0xa627('0x4f'),function(){_0x288e62('finish');});_0x1a6462['on'](_0xa627('0x50'),function(_0x45d472){_0x3d1a13(_0x45d472);});_0x5b9f60[_0xa627('0x51')]();});}exports[_0xa627('0x52')]=function(_0x5b13eb,_0x1ca4f5){var _0x2af716=getPDFPrinter();var _0x2daf5d=getPDFDocDefinitionFromHTML(_0x5b13eb,_0x1ca4f5);var _0x22540f=_0x2af716[_0xa627('0x53')](_0x2daf5d);return writePDFDocument(_0x22540f,_0x1ca4f5[_0xa627('0x2')])[_0xa627('0x3c')](function(_0x2b82f4){throw _0x2b82f4;});};
\ No newline at end of file
index 91d338e..71d1b78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9575=['length','isInteger','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','SELECT','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','writeFileSync','binary','%s.%s','zip','zip\x20finished','Completed','XLSX','inspect','Failed','exit','util','path','lodash','json2xls','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','then','splitSizeXlsx','query','sequelize','num','Empty'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9575,0x13f));var _0x5957=function(_0x36e163,_0x4ee8dc){_0x36e163=_0x36e163-0x0;var _0x535200=_0x9575[_0x36e163];return _0x535200;};'use strict';var util=require(_0x5957('0x0'));var path=require(_0x5957('0x1'));var _=require(_0x5957('0x2'));var fs=require('fs');var json2xls=require(_0x5957('0x3'));var BPromise=require(_0x5957('0x4'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0x5957('0x5'))['db'];var dbH=require(_0x5957('0x5'))[_0x5957('0x6')];var logger=require(_0x5957('0x7'))(_0x5957('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x5957('0x9')][0x2]);var QUERY=process[_0x5957('0x9')][0x3];var PATH=process[_0x5957('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2c47d8,_0x29c7c0){var _0x489360={'status':_0x2c47d8};var _0x276770={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x29c7c0){_0x489360['savename']=_0x29c7c0;}return db[_0x5957('0xa')][_0x5957('0xb')](_0x489360,_0x276770);}function main(){var _0x11294c=0x1388;var _0xc06d10;logger[_0x5957('0xc')](util[_0x5957('0xd')](_0x5957('0xe'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0x5957('0xf')][_0x5957('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x5957('0x11'),'splitSizeXlsx']})[_0x5957('0x12')](function(_0x3883a9){if(_0x3883a9){_0xc06d10=_0x3883a9;_0x11294c=_0xc06d10[_0x5957('0x13')]||0x1388;}})['then'](function(){return dbH['sequelize'][_0x5957('0x14')](util[_0x5957('0xd')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x5957('0x15')]['QueryTypes']['SELECT']});})['then'](function(_0x4c1621){if(!_0x4c1621[0x0][_0x5957('0x16')]){return analyticExtractedReport(_0x5957('0x17'));}var _0x60c34c=[];var _0x522a9d=0x0;if(_0xc06d10[_0x5957('0x11')]){if(_0x4c1621&&_0x4c1621[_0x5957('0x18')]){var _0x7df76a=_['range'](_0x4c1621[0x0]['num']/_0x11294c);var _0x13f51f=Number[_0x5957('0x19')](_0x4c1621[0x0]['num']/_0x11294c)?_0x4c1621[0x0][_0x5957('0x16')]%_0x11294c:0x0;_0x7df76a['forEach'](function(_0x349c29){if(_0x349c29>0x0){_0x522a9d+=_0x11294c;}_0x60c34c['push'](dbH[_0x5957('0x15')]['query'](util['format'](_0x5957('0x1a'),QUERY,_0x11294c,_0x522a9d),{'type':dbH[_0x5957('0x15')][_0x5957('0x1b')]['SELECT']}));});if(_0x13f51f>0x0){_0x522a9d+=_0x11294c;_0x60c34c[_0x5957('0x1c')](dbH[_0x5957('0x15')]['query'](util[_0x5957('0xd')](_0x5957('0x1a'),QUERY,_0x13f51f,_0x522a9d),{'type':dbH['sequelize']['QueryTypes'][_0x5957('0x1d')]}));}}}else{_0x60c34c[_0x5957('0x1c')](dbH[_0x5957('0x15')][_0x5957('0x14')](QUERY,{'type':dbH[_0x5957('0x15')][_0x5957('0x1b')][_0x5957('0x1d')]}));}var _0x3f25ad=path[_0x5957('0x1e')](PATH);var _0xfc6f89=path[_0x5957('0x1f')](PATH,_0x5957('0x20'));var _0x58975c=_0xc06d10['split']&&_0x60c34c[_0x5957('0x18')]>0x1;var _0x43a49=[];if(!fs[_0x5957('0x21')](path[_0x5957('0x22')](_0x3f25ad,_0xfc6f89))&&_0x58975c){fs[_0x5957('0x23')](path['join'](_0x3f25ad,_0xfc6f89));}return BPromise[_0x5957('0x24')](_0x60c34c,function(_0x2a4421){_0x43a49['push'](_0x2a4421);})[_0x5957('0x12')](function(){for(var _0x3fa014=0x0;_0x3fa014<_0x43a49[_0x5957('0x18')];_0x3fa014+=0x1){var _0x3c6b64;var _0x352956=_0x43a49[_0x3fa014];if(_0x58975c){_0x3c6b64=path[_0x5957('0x22')](_0x3f25ad,_0xfc6f89,util['format'](_0x5957('0x25'),_0xfc6f89,_0x3fa014,'xlsx'));}else{_0x3c6b64=path[_0x5957('0x22')](_0x3f25ad,util[_0x5957('0xd')]('%s.%s',_0xfc6f89,_0x5957('0x26')));}fs[_0x5957('0x27')](_0x3c6b64,json2xls(_0x352956),_0x5957('0x28'));}})[_0x5957('0x12')](function(){if(_0x58975c){return new Promise(function(_0x53911e){zipdir(path['join'](_0x3f25ad,_0xfc6f89),{'saveTo':path[_0x5957('0x22')](_0x3f25ad,util[_0x5957('0xd')](_0x5957('0x29'),_0xfc6f89,_0x5957('0x2a')))},function(_0x2d89dc,_0x4995c7){rimraf(path[_0x5957('0x22')](_0x3f25ad,_0xfc6f89),function(){});_0x53911e(_0x5957('0x2b'));});});}})['then'](function(){logger[_0x5957('0xc')](util[_0x5957('0xd')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x5957('0x2c'),_0x58975c?util['format']('%s.%s',_0xfc6f89,_0x58975c?_0x5957('0x2a'):_0x5957('0x26')):null);});})['catch'](function(_0x1080f5){logger['info'](util[_0x5957('0xd')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x5957('0x2d')),util[_0x5957('0x2e')](_0x1080f5,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x5957('0x2f'));})['finally'](function(){process[_0x5957('0x30')](EXIT_CODE);});}main();
\ No newline at end of file
+var _0x38d1=['query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','Empty','split','length','range','num','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','xlsx','%s.%s','writeFileSync','binary','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','inspect','Failed','finally','exit','util','path','lodash','json2xls','zip-dir','rimraf','../../mysqldb','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','then','sequelize'];(function(_0xecc38a,_0x167a9a){var _0x15f20b=function(_0x319421){while(--_0x319421){_0xecc38a['push'](_0xecc38a['shift']());}};_0x15f20b(++_0x167a9a);}(_0x38d1,0xf2));var _0x138d=function(_0x3860e2,_0x14e710){_0x3860e2=_0x3860e2-0x0;var _0x1e2eb6=_0x38d1[_0x3860e2];return _0x1e2eb6;};'use strict';var util=require(_0x138d('0x0'));var path=require(_0x138d('0x1'));var _=require(_0x138d('0x2'));var fs=require('fs');var json2xls=require(_0x138d('0x3'));var BPromise=require('bluebird');var zipdir=require(_0x138d('0x4'));var rimraf=require(_0x138d('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0x138d('0x6'))['dbH'];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x138d('0x7')][0x3];var PATH=process[_0x138d('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3ed7eb,_0xda5e7b){var _0x249cad={'status':_0x3ed7eb};var _0x273a67={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xda5e7b){_0x249cad[_0x138d('0x8')]=_0xda5e7b;}return db['AnalyticExtractedReport'][_0x138d('0x9')](_0x249cad,_0x273a67);}function main(){var _0x59dd10=0x1388;var _0x43fb68;logger[_0x138d('0xa')](util[_0x138d('0xb')](_0x138d('0xc'),EXTRACTED_REPORT_ID,_0x138d('0xd')));return db[_0x138d('0xe')][_0x138d('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizeXlsx']})[_0x138d('0x10')](function(_0x1c0d9e){if(_0x1c0d9e){_0x43fb68=_0x1c0d9e;_0x59dd10=_0x43fb68['splitSizeXlsx']||0x1388;}})['then'](function(){return dbH[_0x138d('0x11')][_0x138d('0x12')](util[_0x138d('0xb')](_0x138d('0x13'),QUERY),{'type':dbH[_0x138d('0x11')]['QueryTypes'][_0x138d('0x14')]});})['then'](function(_0x2d6460){if(!_0x2d6460[0x0]['num']){return analyticExtractedReport(_0x138d('0x15'));}var _0x267649=[];var _0x209a1b=0x0;if(_0x43fb68[_0x138d('0x16')]){if(_0x2d6460&&_0x2d6460[_0x138d('0x17')]){var _0x2367e9=_[_0x138d('0x18')](_0x2d6460[0x0][_0x138d('0x19')]/_0x59dd10);var _0x2510e6=Number[_0x138d('0x1a')](_0x2d6460[0x0][_0x138d('0x19')]/_0x59dd10)?_0x2d6460[0x0][_0x138d('0x19')]%_0x59dd10:0x0;_0x2367e9[_0x138d('0x1b')](function(_0x169aef){if(_0x169aef>0x0){_0x209a1b+=_0x59dd10;}_0x267649[_0x138d('0x1c')](dbH['sequelize'][_0x138d('0x12')](util[_0x138d('0xb')](_0x138d('0x1d'),QUERY,_0x59dd10,_0x209a1b),{'type':dbH[_0x138d('0x11')][_0x138d('0x1e')][_0x138d('0x14')]}));});if(_0x2510e6>0x0){_0x209a1b+=_0x59dd10;_0x267649[_0x138d('0x1c')](dbH['sequelize']['query'](util[_0x138d('0xb')](_0x138d('0x1d'),QUERY,_0x2510e6,_0x209a1b),{'type':dbH[_0x138d('0x11')][_0x138d('0x1e')]['SELECT']}));}}}else{_0x267649['push'](dbH['sequelize'][_0x138d('0x12')](QUERY,{'type':dbH[_0x138d('0x11')][_0x138d('0x1e')][_0x138d('0x14')]}));}var _0x4f015c=path[_0x138d('0x1f')](PATH);var _0x5b7346=path[_0x138d('0x20')](PATH,_0x138d('0x21'));var _0x21fbb3=_0x43fb68['split']&&_0x267649['length']>0x1;var _0x5714f3=[];if(!fs[_0x138d('0x22')](path[_0x138d('0x23')](_0x4f015c,_0x5b7346))&&_0x21fbb3){fs[_0x138d('0x24')](path[_0x138d('0x23')](_0x4f015c,_0x5b7346));}return BPromise[_0x138d('0x25')](_0x267649,function(_0x49142f){_0x5714f3[_0x138d('0x1c')](_0x49142f);})[_0x138d('0x10')](function(){for(var _0x4fcd0c=0x0;_0x4fcd0c<_0x5714f3[_0x138d('0x17')];_0x4fcd0c+=0x1){var _0x2668d8;var _0x421a0=_0x5714f3[_0x4fcd0c];if(_0x21fbb3){_0x2668d8=path[_0x138d('0x23')](_0x4f015c,_0x5b7346,util[_0x138d('0xb')]('%s%d.%s',_0x5b7346,_0x4fcd0c,_0x138d('0x26')));}else{_0x2668d8=path[_0x138d('0x23')](_0x4f015c,util[_0x138d('0xb')](_0x138d('0x27'),_0x5b7346,_0x138d('0x26')));}fs[_0x138d('0x28')](_0x2668d8,json2xls(_0x421a0),_0x138d('0x29'));}})['then'](function(){if(_0x21fbb3){return new Promise(function(_0x1b5143){zipdir(path[_0x138d('0x23')](_0x4f015c,_0x5b7346),{'saveTo':path[_0x138d('0x23')](_0x4f015c,util[_0x138d('0xb')](_0x138d('0x27'),_0x5b7346,_0x138d('0x2a')))},function(_0x15ccf7,_0x4e6fec){rimraf(path['join'](_0x4f015c,_0x5b7346),function(){});_0x1b5143(_0x138d('0x2b'));});});}})[_0x138d('0x10')](function(){logger[_0x138d('0xa')](util[_0x138d('0xb')](_0x138d('0x2c'),EXTRACTED_REPORT_ID,_0x138d('0xd')));return analyticExtractedReport(_0x138d('0x2d'),_0x21fbb3?util[_0x138d('0xb')](_0x138d('0x27'),_0x5b7346,_0x21fbb3?'zip':_0x138d('0x26')):null);});})[_0x138d('0x2e')](function(_0x2c520c){logger[_0x138d('0xa')](util[_0x138d('0xb')](_0x138d('0x2f'),EXTRACTED_REPORT_ID,'XLSX'),util[_0x138d('0x30')](_0x2c520c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x138d('0x31'));})[_0x138d('0x32')](function(){process[_0x138d('0x33')](EXIT_CODE);});}main();
\ No newline at end of file
index 500469d..928de2e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a34=['intervals','VoiceExtension','IntervalId','uniq','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','exten','queue','playback','hasOwnProperty','priority','extension','extensions','type','format','inbound','push','Set','CDR(routeid)=','context','VoiceExtensionId','outbound','CDR(destination)=','cutdigits','${EXTEN:','ExecIf','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','createdAt','updatedAt','*,*,*,*','map','interval','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','Hangup','bulkCreate','sortBy','error','rewrite','lodash','util','models','Interval','findAll','then'];(function(_0x529ebb,_0x279d73){var _0x181869=function(_0x533987){while(--_0x533987){_0x529ebb['push'](_0x529ebb['shift']());}};_0x181869(++_0x279d73);}(_0x9a34,0x112));var _0x49a3=function(_0x3724fc,_0x3149b2){_0x3724fc=_0x3724fc-0x0;var _0x411165=_0x9a34[_0x3724fc];return _0x411165;};'use strict';var _=require(_0x49a3('0x0'));var util=require(_0x49a3('0x1'));function rewrite(_0x3b4d8f,_0x46e4ca){var _0x2fc8aa=this;return _0x3b4d8f[_0x49a3('0x2')][_0x49a3('0x3')][_0x49a3('0x4')]({'raw':!![]})[_0x49a3('0x5')](function(_0x292a3c){_0x2fc8aa[_0x49a3('0x6')]=_0x292a3c;return _0x3b4d8f[_0x49a3('0x2')][_0x49a3('0x7')][_0x49a3('0x4')]({'where':{'IntervalId':_0x46e4ca[_0x49a3('0x8')]},'raw':!![]});})[_0x49a3('0x5')](function(_0x23e109){return _0x3b4d8f[_0x49a3('0x2')]['VoiceExtension'][_0x49a3('0x4')]({'where':{'exten':{'$in':_[_0x49a3('0x9')](_['map'](_0x23e109,'exten'))}},'order':[{'raw':_0x49a3('0xa')}],'raw':!![]});})[_0x49a3('0x5')](function(_0x3c8601){var _0x1df020=_[_0x49a3('0xb')](_0x3c8601,{'priority':'1'});var _0x404ae1=_[_0x49a3('0xb')](_0x3c8601,{'isApp':0x1});var _0x41bd5f=_[_0x49a3('0xc')](_0x404ae1,_0x49a3('0xd'));var _0x3dc57b=[_0x49a3('0xe'),_0x49a3('0xf')];var _0x36610f=[];var _0x41bc7b=[];for(var _0x40018b in _0x41bd5f){if(_0x41bd5f[_0x49a3('0x10')](_0x40018b)){_0x2fc8aa[_0x49a3('0x11')]=0x2;_0x2fc8aa['extensions']=[];_0x2fc8aa[_0x49a3('0x12')]=_['find'](_0x1df020,{'exten':_0x41bd5f[_0x40018b][0x0][_0x49a3('0xd')]});_0x2fc8aa[_0x49a3('0x13')]['push']({'type':_0x41bd5f[_0x40018b][0x0][_0x49a3('0x14')],'app':'Set','appdata':util[_0x49a3('0x15')]('CDR(type)=%s',_0x41bd5f[_0x40018b][0x0][_0x49a3('0x14')]),'context':_0x41bd5f[_0x40018b][0x0]['context'],'exten':_0x41bd5f[_0x40018b][0x0][_0x49a3('0xd')],'priority':_0x2fc8aa[_0x49a3('0x11')]++,'VoiceExtensionId':_0x41bd5f[_0x40018b][0x0]['VoiceExtensionId']});if(_0x41bd5f[_0x40018b][0x0][_0x49a3('0x14')]===_0x49a3('0x16')){_0x2fc8aa[_0x49a3('0x13')][_0x49a3('0x17')]({'type':_0x41bd5f[_0x40018b][0x0][_0x49a3('0x14')],'app':_0x49a3('0x18'),'appdata':_0x49a3('0x19')+_0x41bd5f[_0x40018b][0x0]['VoiceExtensionId'],'context':_0x41bd5f[_0x40018b][0x0][_0x49a3('0x1a')],'exten':_0x41bd5f[_0x40018b][0x0][_0x49a3('0xd')],'priority':_0x2fc8aa[_0x49a3('0x11')]++,'VoiceExtensionId':_0x41bd5f[_0x40018b][0x0][_0x49a3('0x1b')]});}else if(_0x41bd5f[_0x40018b][0x0][_0x49a3('0x14')]===_0x49a3('0x1c')){if(_0x2fc8aa[_0x49a3('0x12')]){_0x2fc8aa['extensions'][_0x49a3('0x17')]({'type':_0x41bd5f[_0x40018b][0x0][_0x49a3('0x14')],'app':_0x49a3('0x18'),'appdata':_0x49a3('0x1d')+(_0x2fc8aa[_0x49a3('0x12')][_0x49a3('0x1e')]?_0x49a3('0x1f')+_0x2fc8aa['extension'][_0x49a3('0x1e')]+'}':'${EXTEN}'),'context':_0x41bd5f[_0x40018b][0x0][_0x49a3('0x1a')],'exten':_0x41bd5f[_0x40018b][0x0][_0x49a3('0xd')],'priority':_0x2fc8aa[_0x49a3('0x11')]++,'VoiceExtensionId':_0x41bd5f[_0x40018b][0x0][_0x49a3('0x1b')]});}_0x2fc8aa['extensions'][_0x49a3('0x17')]({'type':_0x41bd5f[_0x40018b][0x0]['type'],'app':_0x49a3('0x18'),'appdata':_0x49a3('0x19')+_0x41bd5f[_0x40018b][0x0][_0x49a3('0x1b')],'context':_0x41bd5f[_0x40018b][0x0][_0x49a3('0x1a')],'exten':_0x41bd5f[_0x40018b][0x0][_0x49a3('0xd')],'priority':_0x2fc8aa['priority']++,'VoiceExtensionId':_0x41bd5f[_0x40018b][0x0]['VoiceExtensionId']});var _0xd95288=_0x2fc8aa['priority']++;_0x2fc8aa[_0x49a3('0x13')][_0x49a3('0x17')]({'type':_0x41bd5f[_0x40018b][0x0][_0x49a3('0x14')],'app':_0x49a3('0x20'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0xd95288+0x2)+'):Goto('+(_0xd95288+0x1)+')','context':_0x41bd5f[_0x40018b][0x0][_0x49a3('0x1a')],'exten':_0x41bd5f[_0x40018b][0x0]['exten'],'priority':_0xd95288,'VoiceExtensionId':_0x41bd5f[_0x40018b][0x0][_0x49a3('0x1b')]});if(_0x2fc8aa['extension']){_0x2fc8aa[_0x49a3('0x13')][_0x49a3('0x17')]({'type':_0x41bd5f[_0x40018b][0x0][_0x49a3('0x14')],'app':_0x49a3('0x18'),'appdata':_0x2fc8aa['extension'][_0x49a3('0x1e')]?_0x49a3('0x21')+_0x2fc8aa[_0x49a3('0x12')][_0x49a3('0x1e')]+'}':_0x49a3('0x22'),'context':_0x41bd5f[_0x40018b][0x0][_0x49a3('0x1a')],'exten':_0x41bd5f[_0x40018b][0x0]['exten'],'priority':_0x2fc8aa['priority']++,'VoiceExtensionId':_0x41bd5f[_0x40018b][0x0]['VoiceExtensionId']});}_0x2fc8aa[_0x49a3('0x13')][_0x49a3('0x17')]({'type':_0x41bd5f[_0x40018b][0x0]['type'],'app':'Set','appdata':_0x49a3('0x23')+_0x41bd5f[_0x40018b][0x0][_0x49a3('0x1b')],'context':_0x41bd5f[_0x40018b][0x0][_0x49a3('0x1a')],'exten':_0x41bd5f[_0x40018b][0x0][_0x49a3('0xd')],'priority':_0x2fc8aa[_0x49a3('0x11')]++,'VoiceExtensionId':_0x41bd5f[_0x40018b][0x0][_0x49a3('0x1b')]});if(_0x2fc8aa[_0x49a3('0x12')]&&_0x2fc8aa[_0x49a3('0x12')][_0x49a3('0x10')](_0x49a3('0x24'))&&_0x2fc8aa[_0x49a3('0x12')][_0x49a3('0x24')]!==_0x49a3('0x25')){_0x2fc8aa[_0x49a3('0x13')][_0x49a3('0x17')]({'type':_0x41bd5f[_0x40018b][0x0]['type'],'app':_0x49a3('0x18'),'appdata':_0x49a3('0x26'),'context':_0x41bd5f[_0x40018b][0x0][_0x49a3('0x1a')],'exten':_0x41bd5f[_0x40018b][0x0]['exten'],'priority':_0x2fc8aa[_0x49a3('0x11')]++,'VoiceExtensionId':_0x41bd5f[_0x40018b][0x0]['VoiceExtensionId']});_0x2fc8aa[_0x49a3('0x13')][_0x49a3('0x17')]({'type':_0x41bd5f[_0x40018b][0x0]['type'],'app':_0x49a3('0x18'),'appdata':_0x49a3('0x27')+_0x2fc8aa[_0x49a3('0x12')][_0x49a3('0x24')]||_0x49a3('0x28'),'context':_0x41bd5f[_0x40018b][0x0][_0x49a3('0x1a')],'exten':_0x41bd5f[_0x40018b][0x0]['exten'],'priority':_0x2fc8aa[_0x49a3('0x11')]++,'VoiceExtensionId':_0x41bd5f[_0x40018b][0x0][_0x49a3('0x1b')]});}}_0x2fc8aa[_0x49a3('0x13')][_0x49a3('0x17')]({'type':_0x41bd5f[_0x40018b][0x0][_0x49a3('0x14')],'app':_0x49a3('0x18'),'appdata':_0x49a3('0x29'),'context':_0x41bd5f[_0x40018b][0x0][_0x49a3('0x1a')],'exten':_0x41bd5f[_0x40018b][0x0][_0x49a3('0xd')],'priority':_0x2fc8aa['priority']++,'VoiceExtensionId':_0x41bd5f[_0x40018b][0x0][_0x49a3('0x1b')]});_0x2fc8aa[_0x49a3('0x13')][_0x49a3('0x17')]({'type':_0x41bd5f[_0x40018b][0x0][_0x49a3('0x14')],'app':_0x49a3('0x18'),'appdata':_0x49a3('0x2a'),'context':_0x41bd5f[_0x40018b][0x0][_0x49a3('0x1a')],'exten':_0x41bd5f[_0x40018b][0x0][_0x49a3('0xd')],'priority':_0x2fc8aa['priority']++,'VoiceExtensionId':_0x41bd5f[_0x40018b][0x0][_0x49a3('0x1b')]});_0x2fc8aa['extensions'][_0x49a3('0x17')]({'type':_0x41bd5f[_0x40018b][0x0][_0x49a3('0x14')],'app':'Set','appdata':_0x49a3('0x2b'),'context':_0x41bd5f[_0x40018b][0x0][_0x49a3('0x1a')],'exten':_0x41bd5f[_0x40018b][0x0][_0x49a3('0xd')],'priority':_0x2fc8aa[_0x49a3('0x11')]++,'VoiceExtensionId':_0x41bd5f[_0x40018b][0x0]['VoiceExtensionId']});for(var _0x6f9f68=0x0,_0xc66c58=0x0;_0x6f9f68<_0x41bd5f[_0x40018b][_0x49a3('0x2c')];_0x6f9f68+=0x1,_0xc66c58=0x0){var _0x2e8d7c=_0x41bd5f[_0x40018b][_0x6f9f68];if(_0x2e8d7c[_0x49a3('0x14')]){_0x2e8d7c[_0x49a3('0x14')]=_0x2e8d7c[_0x49a3('0x14')]['toLowerCase']();}var _0x50162e=[];var _0x19ee9f=[];delete _0x2e8d7c['id'];delete _0x2e8d7c[_0x49a3('0x2d')];delete _0x2e8d7c[_0x49a3('0x2e')];var _0x3ec358=_0x2e8d7c['interval']!==_0x49a3('0x2f')?[_0x2e8d7c['interval']]:_0x2e8d7c[_0x49a3('0x8')]?_[_0x49a3('0x30')](_[_0x49a3('0xb')](_0x2fc8aa[_0x49a3('0x6')],{'IntervalId':_0x2e8d7c[_0x49a3('0x8')]}),_0x49a3('0x31')):[];if(_0x2e8d7c[_0x49a3('0x10')]('tag')){if(_0x2e8d7c[_0x49a3('0x32')]&&_0x2e8d7c[_0x49a3('0x32')]!=='--'){_0x50162e[_0x49a3('0x17')]({'type':_0x2e8d7c[_0x49a3('0x14')],'app':_0x49a3('0x18'),'appdata':_0x49a3('0x33')+_0x2e8d7c[_0x49a3('0x32')],'context':_0x2e8d7c[_0x49a3('0x1a')],'exten':_0x2e8d7c[_0x49a3('0xd')],'priority':_0x3ec358[_0x49a3('0x2c')]+_0x2fc8aa[_0x49a3('0x11')]+_0xc66c58++,'VoiceExtensionId':_0x2e8d7c[_0x49a3('0x1b')]});}}if(_0x2e8d7c[_0x49a3('0x14')]===_0x49a3('0x1c')&&_0x2e8d7c[_0x49a3('0x10')](_0x49a3('0x34'))){if(_0x2e8d7c[_0x49a3('0x34')]){_0x50162e['push']({'type':_0x2e8d7c[_0x49a3('0x14')],'app':_0x49a3('0x20'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x2e8d7c[_0x49a3('0x34')]+')','context':_0x2e8d7c[_0x49a3('0x1a')],'exten':_0x2e8d7c[_0x49a3('0xd')],'priority':_0x3ec358['length']+_0x2fc8aa['priority']+_0xc66c58++,'VoiceExtensionId':_0x2e8d7c['VoiceExtensionId']});}else{_0x50162e[_0x49a3('0x17')]({'type':_0x2e8d7c['type'],'app':_0x49a3('0x20'),'appdata':_0x49a3('0x35'),'context':_0x2e8d7c[_0x49a3('0x1a')],'exten':_0x2e8d7c[_0x49a3('0xd')],'priority':_0x3ec358[_0x49a3('0x2c')]+_0x2fc8aa[_0x49a3('0x11')]+_0xc66c58++,'VoiceExtensionId':_0x2e8d7c[_0x49a3('0x1b')]});}}if(_0x2e8d7c[_0x49a3('0x10')](_0x49a3('0x36'))){if(_0x3dc57b[_0x49a3('0x37')](_0x2e8d7c[_0x49a3('0x38')]['toLowerCase']())>=0x0&&_0x2e8d7c['appType']!=='custom'){if(_0x2e8d7c[_0x49a3('0x36')]){_0x50162e[_0x49a3('0x17')]({'type':_0x2e8d7c[_0x49a3('0x14')],'app':_0x49a3('0x20'),'appdata':_0x49a3('0x39'),'context':_0x2e8d7c[_0x49a3('0x1a')],'exten':_0x2e8d7c[_0x49a3('0xd')],'priority':_0x3ec358[_0x49a3('0x2c')]+_0x2fc8aa['priority']+_0xc66c58++,'VoiceExtensionId':_0x2e8d7c[_0x49a3('0x1b')]});_0x50162e[_0x49a3('0x17')]({'type':_0x2e8d7c['type'],'app':_0x49a3('0x18'),'appdata':_0x49a3('0x3a'),'context':_0x2e8d7c[_0x49a3('0x1a')],'exten':_0x2e8d7c[_0x49a3('0xd')],'priority':_0x3ec358[_0x49a3('0x2c')]+_0x2fc8aa[_0x49a3('0x11')]+_0xc66c58++,'VoiceExtensionId':_0x2e8d7c[_0x49a3('0x1b')]});}else{_0x50162e[_0x49a3('0x17')]({'type':_0x2e8d7c['type'],'app':'ExecIf','appdata':_0x49a3('0x3b'),'context':_0x2e8d7c['context'],'exten':_0x2e8d7c[_0x49a3('0xd')],'priority':_0x3ec358[_0x49a3('0x2c')]+_0x2fc8aa['priority']+_0xc66c58++,'VoiceExtensionId':_0x2e8d7c[_0x49a3('0x1b')]});_0x50162e[_0x49a3('0x17')]({'type':_0x2e8d7c[_0x49a3('0x14')],'app':'Set','appdata':_0x49a3('0x3c'),'context':_0x2e8d7c[_0x49a3('0x1a')],'exten':_0x2e8d7c[_0x49a3('0xd')],'priority':_0x3ec358[_0x49a3('0x2c')]+_0x2fc8aa[_0x49a3('0x11')]+_0xc66c58++,'VoiceExtensionId':_0x2e8d7c[_0x49a3('0x1b')]});}}}for(var _0x307295=0x0;_0x307295<_0x3ec358[_0x49a3('0x2c')];_0x307295+=0x1){var _0x480dec=_0x2fc8aa[_0x49a3('0x11')]+_0x3ec358['length'];var _0x810a50=_0x307295===_0x3ec358[_0x49a3('0x2c')]-0x1?_0x2fc8aa[_0x49a3('0x11')]+_0x50162e[_0x49a3('0x2c')]+_0x19ee9f['length']+0x2:_0x2fc8aa[_0x49a3('0x11')]+_0x307295+0x1;_0x50162e[_0x49a3('0x3d')](_0x307295,0x0,{'type':_0x2e8d7c[_0x49a3('0x14')],'app':_0x49a3('0x3e'),'appdata':_0x3ec358[_0x307295]+'?'+_0x2e8d7c['context']+_0x49a3('0x3f')+_0x480dec+':'+_0x2e8d7c[_0x49a3('0x1a')]+_0x49a3('0x3f')+_0x810a50,'exten':_0x2e8d7c[_0x49a3('0xd')],'context':_0x2e8d7c['context'],'priority':_0x2fc8aa['priority']+_0x307295,'VoiceExtensionId':_0x41bd5f[_0x40018b][0x0]['VoiceExtensionId']});}_0x2e8d7c[_0x49a3('0x11')]=_0x50162e[_0x49a3('0x2c')]?_[_0x49a3('0x40')](_0x50162e)[_0x49a3('0x11')]+0x1:_0x2fc8aa[_0x49a3('0x11')];_0x2fc8aa[_0x49a3('0x11')]=(_0x19ee9f[_0x49a3('0x2c')]?_[_0x49a3('0x40')](_0x19ee9f)[_0x49a3('0x11')]:_0x2e8d7c['priority'])+0x1;_0x2fc8aa['extensions']=_['concat'](_0x2fc8aa[_0x49a3('0x13')],_0x50162e,[_0x2e8d7c],_0x19ee9f);}_0x2fc8aa[_0x49a3('0x13')][_0x49a3('0x17')]({'type':_0x41bd5f[_0x40018b][0x0][_0x49a3('0x14')],'app':_0x49a3('0x41'),'exten':_0x41bd5f[_0x40018b][0x0][_0x49a3('0xd')],'context':_0x41bd5f[_0x40018b][0x0]['context'],'priority':_0x2fc8aa['priority'],'VoiceExtensionId':_0x41bd5f[_0x40018b][0x0][_0x49a3('0x1b')]});_0x36610f[_0x49a3('0x17')](_0x41bd5f[_0x40018b][0x0][_0x49a3('0x1b')]);_0x41bc7b=_['concat'](_0x41bc7b,_0x2fc8aa[_0x49a3('0x13')]);}}return _0x3b4d8f['transaction'](function(_0x7e3738){return _0x3b4d8f[_0x49a3('0x2')][_0x49a3('0x7')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x36610f}},'transaction':_0x7e3738})[_0x49a3('0x5')](function(_0x335fe1){return _0x3b4d8f['models'][_0x49a3('0x7')][_0x49a3('0x42')](_[_0x49a3('0x43')](_0x41bc7b,_0x49a3('0x11')),{'transaction':_0x7e3738});});});})['catch'](function(_0x1bd676){console[_0x49a3('0x44')](_0x1bd676);});}exports[_0x49a3('0x45')]=rewrite;
\ No newline at end of file
+var _0x3301=['format','CDR(type)=%s','context','VoiceExtensionId','inbound','push','CDR(routeid)=','outbound','extension','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','createdAt','updatedAt','interval','*,*,*,*','IntervalId','map','intervals','tag','CDR(tag)=','length','callerID','indexOf','app','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','Hangup','concat','destroy','bulkCreate','sortBy','catch','error','rewrite','lodash','util','models','Interval','findAll','then','VoiceExtension','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','type','Set'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0x3301,0x15a));var _0x1330=function(_0x4a9b3f,_0x158971){_0x4a9b3f=_0x4a9b3f-0x0;var _0x48b4f0=_0x3301[_0x4a9b3f];return _0x48b4f0;};'use strict';var _=require(_0x1330('0x0'));var util=require(_0x1330('0x1'));function rewrite(_0x4e4db2,_0x5dd6e2){var _0x131116=this;return _0x4e4db2[_0x1330('0x2')][_0x1330('0x3')][_0x1330('0x4')]({'raw':!![]})[_0x1330('0x5')](function(_0x4fa5f0){_0x131116['intervals']=_0x4fa5f0;return _0x4e4db2[_0x1330('0x2')][_0x1330('0x6')][_0x1330('0x4')]({'where':{'IntervalId':_0x5dd6e2['IntervalId']},'raw':!![]});})[_0x1330('0x5')](function(_0x4a6896){return _0x4e4db2[_0x1330('0x2')][_0x1330('0x6')][_0x1330('0x4')]({'where':{'exten':{'$in':_[_0x1330('0x7')](_['map'](_0x4a6896,_0x1330('0x8')))}},'order':[{'raw':_0x1330('0x9')}],'raw':!![]});})[_0x1330('0x5')](function(_0x6c6e4f){var _0x424bce=_[_0x1330('0xa')](_0x6c6e4f,{'priority':'1'});var _0x4b7a72=_[_0x1330('0xa')](_0x6c6e4f,{'isApp':0x1});var _0x3495cd=_[_0x1330('0xb')](_0x4b7a72,_0x1330('0x8'));var _0x1b3bd2=[_0x1330('0xc'),_0x1330('0xd')];var _0x2fd96f=[];var _0x3d760c=[];for(var _0x1b5c14 in _0x3495cd){if(_0x3495cd[_0x1330('0xe')](_0x1b5c14)){_0x131116[_0x1330('0xf')]=0x2;_0x131116['extensions']=[];_0x131116['extension']=_['find'](_0x424bce,{'exten':_0x3495cd[_0x1b5c14][0x0][_0x1330('0x8')]});_0x131116[_0x1330('0x10')]['push']({'type':_0x3495cd[_0x1b5c14][0x0][_0x1330('0x11')],'app':_0x1330('0x12'),'appdata':util[_0x1330('0x13')](_0x1330('0x14'),_0x3495cd[_0x1b5c14][0x0][_0x1330('0x11')]),'context':_0x3495cd[_0x1b5c14][0x0][_0x1330('0x15')],'exten':_0x3495cd[_0x1b5c14][0x0][_0x1330('0x8')],'priority':_0x131116[_0x1330('0xf')]++,'VoiceExtensionId':_0x3495cd[_0x1b5c14][0x0][_0x1330('0x16')]});if(_0x3495cd[_0x1b5c14][0x0][_0x1330('0x11')]===_0x1330('0x17')){_0x131116[_0x1330('0x10')][_0x1330('0x18')]({'type':_0x3495cd[_0x1b5c14][0x0]['type'],'app':_0x1330('0x12'),'appdata':_0x1330('0x19')+_0x3495cd[_0x1b5c14][0x0][_0x1330('0x16')],'context':_0x3495cd[_0x1b5c14][0x0][_0x1330('0x15')],'exten':_0x3495cd[_0x1b5c14][0x0][_0x1330('0x8')],'priority':_0x131116['priority']++,'VoiceExtensionId':_0x3495cd[_0x1b5c14][0x0][_0x1330('0x16')]});}else if(_0x3495cd[_0x1b5c14][0x0][_0x1330('0x11')]===_0x1330('0x1a')){if(_0x131116[_0x1330('0x1b')]){_0x131116[_0x1330('0x10')][_0x1330('0x18')]({'type':_0x3495cd[_0x1b5c14][0x0][_0x1330('0x11')],'app':_0x1330('0x12'),'appdata':_0x1330('0x1c')+(_0x131116[_0x1330('0x1b')][_0x1330('0x1d')]?_0x1330('0x1e')+_0x131116[_0x1330('0x1b')]['cutdigits']+'}':_0x1330('0x1f')),'context':_0x3495cd[_0x1b5c14][0x0][_0x1330('0x15')],'exten':_0x3495cd[_0x1b5c14][0x0][_0x1330('0x8')],'priority':_0x131116[_0x1330('0xf')]++,'VoiceExtensionId':_0x3495cd[_0x1b5c14][0x0][_0x1330('0x16')]});}_0x131116[_0x1330('0x10')]['push']({'type':_0x3495cd[_0x1b5c14][0x0]['type'],'app':'Set','appdata':_0x1330('0x19')+_0x3495cd[_0x1b5c14][0x0][_0x1330('0x16')],'context':_0x3495cd[_0x1b5c14][0x0][_0x1330('0x15')],'exten':_0x3495cd[_0x1b5c14][0x0][_0x1330('0x8')],'priority':_0x131116[_0x1330('0xf')]++,'VoiceExtensionId':_0x3495cd[_0x1b5c14][0x0][_0x1330('0x16')]});var _0x34aaa5=_0x131116[_0x1330('0xf')]++;_0x131116[_0x1330('0x10')][_0x1330('0x18')]({'type':_0x3495cd[_0x1b5c14][0x0]['type'],'app':_0x1330('0x20'),'appdata':_0x1330('0x21')+(_0x34aaa5+0x2)+_0x1330('0x22')+(_0x34aaa5+0x1)+')','context':_0x3495cd[_0x1b5c14][0x0][_0x1330('0x15')],'exten':_0x3495cd[_0x1b5c14][0x0][_0x1330('0x8')],'priority':_0x34aaa5,'VoiceExtensionId':_0x3495cd[_0x1b5c14][0x0][_0x1330('0x16')]});if(_0x131116['extension']){_0x131116[_0x1330('0x10')][_0x1330('0x18')]({'type':_0x3495cd[_0x1b5c14][0x0][_0x1330('0x11')],'app':_0x1330('0x12'),'appdata':_0x131116['extension']['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0x131116[_0x1330('0x1b')][_0x1330('0x1d')]+'}':_0x1330('0x23'),'context':_0x3495cd[_0x1b5c14][0x0][_0x1330('0x15')],'exten':_0x3495cd[_0x1b5c14][0x0][_0x1330('0x8')],'priority':_0x131116[_0x1330('0xf')]++,'VoiceExtensionId':_0x3495cd[_0x1b5c14][0x0][_0x1330('0x16')]});}_0x131116[_0x1330('0x10')]['push']({'type':_0x3495cd[_0x1b5c14][0x0]['type'],'app':_0x1330('0x12'),'appdata':_0x1330('0x24')+_0x3495cd[_0x1b5c14][0x0][_0x1330('0x16')],'context':_0x3495cd[_0x1b5c14][0x0][_0x1330('0x15')],'exten':_0x3495cd[_0x1b5c14][0x0]['exten'],'priority':_0x131116[_0x1330('0xf')]++,'VoiceExtensionId':_0x3495cd[_0x1b5c14][0x0][_0x1330('0x16')]});if(_0x131116[_0x1330('0x1b')]&&_0x131116[_0x1330('0x1b')][_0x1330('0xe')]('recordingFormat')&&_0x131116[_0x1330('0x1b')][_0x1330('0x25')]!==_0x1330('0x26')){_0x131116['extensions'][_0x1330('0x18')]({'type':_0x3495cd[_0x1b5c14][0x0][_0x1330('0x11')],'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x3495cd[_0x1b5c14][0x0]['context'],'exten':_0x3495cd[_0x1b5c14][0x0][_0x1330('0x8')],'priority':_0x131116[_0x1330('0xf')]++,'VoiceExtensionId':_0x3495cd[_0x1b5c14][0x0][_0x1330('0x16')]});_0x131116[_0x1330('0x10')][_0x1330('0x18')]({'type':_0x3495cd[_0x1b5c14][0x0][_0x1330('0x11')],'app':_0x1330('0x12'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x131116['extension'][_0x1330('0x25')]||_0x1330('0x27'),'context':_0x3495cd[_0x1b5c14][0x0][_0x1330('0x15')],'exten':_0x3495cd[_0x1b5c14][0x0]['exten'],'priority':_0x131116['priority']++,'VoiceExtensionId':_0x3495cd[_0x1b5c14][0x0][_0x1330('0x16')]});}}_0x131116['extensions'][_0x1330('0x18')]({'type':_0x3495cd[_0x1b5c14][0x0][_0x1330('0x11')],'app':_0x1330('0x12'),'appdata':_0x1330('0x28'),'context':_0x3495cd[_0x1b5c14][0x0][_0x1330('0x15')],'exten':_0x3495cd[_0x1b5c14][0x0][_0x1330('0x8')],'priority':_0x131116[_0x1330('0xf')]++,'VoiceExtensionId':_0x3495cd[_0x1b5c14][0x0]['VoiceExtensionId']});_0x131116[_0x1330('0x10')][_0x1330('0x18')]({'type':_0x3495cd[_0x1b5c14][0x0][_0x1330('0x11')],'app':_0x1330('0x12'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x3495cd[_0x1b5c14][0x0][_0x1330('0x15')],'exten':_0x3495cd[_0x1b5c14][0x0]['exten'],'priority':_0x131116[_0x1330('0xf')]++,'VoiceExtensionId':_0x3495cd[_0x1b5c14][0x0]['VoiceExtensionId']});_0x131116[_0x1330('0x10')][_0x1330('0x18')]({'type':_0x3495cd[_0x1b5c14][0x0][_0x1330('0x11')],'app':_0x1330('0x12'),'appdata':_0x1330('0x29'),'context':_0x3495cd[_0x1b5c14][0x0][_0x1330('0x15')],'exten':_0x3495cd[_0x1b5c14][0x0]['exten'],'priority':_0x131116['priority']++,'VoiceExtensionId':_0x3495cd[_0x1b5c14][0x0][_0x1330('0x16')]});for(var _0x35ece4=0x0,_0x5ea3db=0x0;_0x35ece4<_0x3495cd[_0x1b5c14]['length'];_0x35ece4+=0x1,_0x5ea3db=0x0){var _0xe2d948=_0x3495cd[_0x1b5c14][_0x35ece4];if(_0xe2d948['type']){_0xe2d948['type']=_0xe2d948['type']['toLowerCase']();}var _0x5f55fe=[];var _0x514b34=[];delete _0xe2d948['id'];delete _0xe2d948[_0x1330('0x2a')];delete _0xe2d948[_0x1330('0x2b')];var _0x2d0f9f=_0xe2d948[_0x1330('0x2c')]!==_0x1330('0x2d')?[_0xe2d948['interval']]:_0xe2d948[_0x1330('0x2e')]?_[_0x1330('0x2f')](_['filter'](_0x131116[_0x1330('0x30')],{'IntervalId':_0xe2d948['IntervalId']}),_0x1330('0x2c')):[];if(_0xe2d948[_0x1330('0xe')]('tag')){if(_0xe2d948[_0x1330('0x31')]&&_0xe2d948[_0x1330('0x31')]!=='--'){_0x5f55fe[_0x1330('0x18')]({'type':_0xe2d948['type'],'app':_0x1330('0x12'),'appdata':_0x1330('0x32')+_0xe2d948[_0x1330('0x31')],'context':_0xe2d948[_0x1330('0x15')],'exten':_0xe2d948[_0x1330('0x8')],'priority':_0x2d0f9f[_0x1330('0x33')]+_0x131116[_0x1330('0xf')]+_0x5ea3db++,'VoiceExtensionId':_0xe2d948[_0x1330('0x16')]});}}if(_0xe2d948['type']===_0x1330('0x1a')&&_0xe2d948['hasOwnProperty'](_0x1330('0x34'))){if(_0xe2d948[_0x1330('0x34')]){_0x5f55fe['push']({'type':_0xe2d948[_0x1330('0x11')],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0xe2d948[_0x1330('0x34')]+')','context':_0xe2d948[_0x1330('0x15')],'exten':_0xe2d948[_0x1330('0x8')],'priority':_0x2d0f9f[_0x1330('0x33')]+_0x131116['priority']+_0x5ea3db++,'VoiceExtensionId':_0xe2d948[_0x1330('0x16')]});}else{_0x5f55fe[_0x1330('0x18')]({'type':_0xe2d948['type'],'app':_0x1330('0x20'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0xe2d948[_0x1330('0x15')],'exten':_0xe2d948[_0x1330('0x8')],'priority':_0x2d0f9f[_0x1330('0x33')]+_0x131116[_0x1330('0xf')]+_0x5ea3db++,'VoiceExtensionId':_0xe2d948['VoiceExtensionId']});}}if(_0xe2d948['hasOwnProperty']('answer')){if(_0x1b3bd2[_0x1330('0x35')](_0xe2d948[_0x1330('0x36')]['toLowerCase']())>=0x0&&_0xe2d948[_0x1330('0x37')]!==_0x1330('0x38')){if(_0xe2d948[_0x1330('0x39')]){_0x5f55fe['push']({'type':_0xe2d948[_0x1330('0x11')],'app':'ExecIf','appdata':_0x1330('0x3a'),'context':_0xe2d948[_0x1330('0x15')],'exten':_0xe2d948['exten'],'priority':_0x2d0f9f[_0x1330('0x33')]+_0x131116[_0x1330('0xf')]+_0x5ea3db++,'VoiceExtensionId':_0xe2d948[_0x1330('0x16')]});_0x5f55fe['push']({'type':_0xe2d948[_0x1330('0x11')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=1','context':_0xe2d948['context'],'exten':_0xe2d948[_0x1330('0x8')],'priority':_0x2d0f9f[_0x1330('0x33')]+_0x131116[_0x1330('0xf')]+_0x5ea3db++,'VoiceExtensionId':_0xe2d948[_0x1330('0x16')]});}else{_0x5f55fe[_0x1330('0x18')]({'type':_0xe2d948[_0x1330('0x11')],'app':_0x1330('0x20'),'appdata':_0x1330('0x3b'),'context':_0xe2d948[_0x1330('0x15')],'exten':_0xe2d948[_0x1330('0x8')],'priority':_0x2d0f9f[_0x1330('0x33')]+_0x131116[_0x1330('0xf')]+_0x5ea3db++,'VoiceExtensionId':_0xe2d948[_0x1330('0x16')]});_0x5f55fe[_0x1330('0x18')]({'type':_0xe2d948['type'],'app':_0x1330('0x12'),'appdata':_0x1330('0x3c'),'context':_0xe2d948['context'],'exten':_0xe2d948[_0x1330('0x8')],'priority':_0x2d0f9f[_0x1330('0x33')]+_0x131116['priority']+_0x5ea3db++,'VoiceExtensionId':_0xe2d948[_0x1330('0x16')]});}}}for(var _0x19d8e6=0x0;_0x19d8e6<_0x2d0f9f['length'];_0x19d8e6+=0x1){var _0x5d0a22=_0x131116[_0x1330('0xf')]+_0x2d0f9f[_0x1330('0x33')];var _0xfc8347=_0x19d8e6===_0x2d0f9f[_0x1330('0x33')]-0x1?_0x131116[_0x1330('0xf')]+_0x5f55fe[_0x1330('0x33')]+_0x514b34[_0x1330('0x33')]+0x2:_0x131116[_0x1330('0xf')]+_0x19d8e6+0x1;_0x5f55fe[_0x1330('0x3d')](_0x19d8e6,0x0,{'type':_0xe2d948['type'],'app':_0x1330('0x3e'),'appdata':_0x2d0f9f[_0x19d8e6]+'?'+_0xe2d948[_0x1330('0x15')]+_0x1330('0x3f')+_0x5d0a22+':'+_0xe2d948['context']+_0x1330('0x3f')+_0xfc8347,'exten':_0xe2d948['exten'],'context':_0xe2d948['context'],'priority':_0x131116['priority']+_0x19d8e6,'VoiceExtensionId':_0x3495cd[_0x1b5c14][0x0]['VoiceExtensionId']});}_0xe2d948[_0x1330('0xf')]=_0x5f55fe['length']?_[_0x1330('0x40')](_0x5f55fe)[_0x1330('0xf')]+0x1:_0x131116[_0x1330('0xf')];_0x131116[_0x1330('0xf')]=(_0x514b34[_0x1330('0x33')]?_['last'](_0x514b34)['priority']:_0xe2d948[_0x1330('0xf')])+0x1;_0x131116['extensions']=_['concat'](_0x131116[_0x1330('0x10')],_0x5f55fe,[_0xe2d948],_0x514b34);}_0x131116[_0x1330('0x10')][_0x1330('0x18')]({'type':_0x3495cd[_0x1b5c14][0x0]['type'],'app':_0x1330('0x41'),'exten':_0x3495cd[_0x1b5c14][0x0][_0x1330('0x8')],'context':_0x3495cd[_0x1b5c14][0x0][_0x1330('0x15')],'priority':_0x131116['priority'],'VoiceExtensionId':_0x3495cd[_0x1b5c14][0x0][_0x1330('0x16')]});_0x2fd96f['push'](_0x3495cd[_0x1b5c14][0x0][_0x1330('0x16')]);_0x3d760c=_[_0x1330('0x42')](_0x3d760c,_0x131116[_0x1330('0x10')]);}}return _0x4e4db2['transaction'](function(_0x4d738d){return _0x4e4db2[_0x1330('0x2')][_0x1330('0x6')][_0x1330('0x43')]({'where':{'VoiceExtensionId':{'$in':_0x2fd96f}},'transaction':_0x4d738d})['then'](function(_0x2ce26c){return _0x4e4db2['models'][_0x1330('0x6')][_0x1330('0x44')](_[_0x1330('0x45')](_0x3d760c,_0x1330('0xf')),{'transaction':_0x4d738d});});});})[_0x1330('0x46')](function(_0xd4ee34){console[_0x1330('0x47')](_0xd4ee34);});}exports[_0x1330('0x48')]=rewrite;
\ No newline at end of file
index 9c68297..43e3226 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7db0=['length','message','join','hasOwnProperty','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','duplicate','Duplicate\x20Contact','CmContact','then','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','into','cm_hopper','fromQuery','scheduledAt','ContactId','updatedAt','select','field','toString','NOW()','createdAt','from','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','insert','cm_contacts','deletedAt\x20IS\x20NULL','id\x20IN\x20?','str','cm_hopper_final','cm_hopper_black','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','push','sequelize','query','VoiceQueueId','all','VoiceQueue','BlackLists','Campaign','always','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','contact:csv_','resume','resolve','emit','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','createReadStream','parse','pause','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','ioredis','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','isNil','errors'];(function(_0x16dfee,_0x1dba0b){var _0x3ced82=function(_0x1fac3f){while(--_0x1fac3f){_0x16dfee['push'](_0x16dfee['shift']());}};_0x3ced82(++_0x1dba0b);}(_0x7db0,0xc3));var _0x07db=function(_0x467488,_0x38c7ae){_0x467488=_0x467488-0x0;var _0x56107f=_0x7db0[_0x467488];return _0x56107f;};'use strict';var BPromise=require(_0x07db('0x0'));var util=require(_0x07db('0x1'));var _=require(_0x07db('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0x07db('0x3'));var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var logger=require(_0x07db('0x4'))(_0x07db('0x5'));config[_0x07db('0x6')]=_[_0x07db('0x7')](config[_0x07db('0x6')],{'host':_0x07db('0x8'),'port':0x18eb});var socket=require(_0x07db('0x9'))(new Redis(config[_0x07db('0x6')]));require(_0x07db('0xa'))['register'](socket);try{if(!process['argv'][0x2]||process[_0x07db('0xb')][0x2]===_0x07db('0xc')||process['argv'][0x2]===_0x07db('0xd')){throw new Error(_0x07db('0xe'));}var FILEPATH=process['argv'][0x2];if(!process[_0x07db('0xb')][0x3]||process[_0x07db('0xb')][0x3]===_0x07db('0xc')||process[_0x07db('0xb')][0x3]===_0x07db('0xd')||!process[_0x07db('0xb')][0x4]||process['argv'][0x4]===_0x07db('0xc')||process[_0x07db('0xb')][0x4]===_0x07db('0xd')){throw new Error(_0x07db('0xf'));}var FIELDS=_[_0x07db('0x10')](process[_0x07db('0xb')][0x3][_0x07db('0x11')](','),process['argv'][0x4][_0x07db('0x11')](','));if(!process[_0x07db('0xb')][0x5]||process[_0x07db('0xb')][0x5]==='undefined'||process[_0x07db('0xb')][0x5]==='null'){throw new Error(_0x07db('0x12'));}var LISTID=process[_0x07db('0xb')][0x5];var COMPANYID=process[_0x07db('0xb')][0x6]&&process[_0x07db('0xb')][0x6]!==_0x07db('0xc')&&process[_0x07db('0xb')][0x6]!=='null'?process['argv'][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x07db('0xb')][0x7]!==_0x07db('0xc')&&process[_0x07db('0xb')][0x7]!==_0x07db('0xd')?process['argv'][0x7]:null;if(!process[_0x07db('0xb')][0x8]||process[_0x07db('0xb')][0x8]===_0x07db('0xc')||process['argv'][0x8]===_0x07db('0xd')){throw new Error(_0x07db('0x13'));}var SOCKET_TIMESTAMP=process[_0x07db('0xb')][0x8];}catch(_0x1066bb){logger[_0x07db('0x14')](_0x1066bb);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(_0x585440,_0x4a7b2d,_0x5e28ab,_0x36398e){var _0x34d12c={'message':_0x4a7b2d};_0x34d12c[_0x585440]=!![];if(_0x5e28ab){_0x34d12c[_0x07db('0x15')]=_0x5e28ab;}if(_0x36398e){_0x34d12c[_0x07db('0x16')]=_0x36398e;}return _0x34d12c;}function isEmail(_0x2ac681){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'](_0x2ac681);}function checkRow(_0x206e6c,_0x3c7656,_0x5d608c){return new BPromise(function(_0x1c0832,_0x5b48ea){if(_[_0x07db('0x17')](_0x206e6c)){return _0x5b48ea(handleCheckRowError('error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x5d608c));}if(_0x206e6c[_0x07db('0x18')]&&_0x206e6c[_0x07db('0x18')][_0x07db('0x19')]){var _0x33eb46=_['map'](_0x206e6c[_0x07db('0x18')],_0x07db('0x1a'))[_0x07db('0x1b')](';');return _0x5b48ea(handleCheckRowError(_0x07db('0x14'),_0x33eb46,null,_0x5d608c));}var _0x35dcaf={};for(var _0x961f2b in FIELDS){if(FIELDS[_0x07db('0x1c')](_0x961f2b)&&FIELDS[_0x961f2b]){_0x35dcaf[_0x961f2b]=_0x206e6c['data'][0x0][FIELDS[_0x961f2b]]||_0x206e6c['data'][0x0]['\ufeff'+FIELDS[_0x961f2b]];}}if(!_0x35dcaf[_0x07db('0x1d')]){return _0x5b48ea(handleCheckRowError(_0x07db('0x14'),_0x07db('0x1e'),null,_0x5d608c));}if(!_0x35dcaf[_0x07db('0x1f')]){return _0x5b48ea(handleCheckRowError('error',_0x07db('0x20'),null,_0x5d608c));}if(_0x35dcaf['birthDate']){var _0x28bfc0=moment(_0x35dcaf[_0x07db('0x21')],'YYYY-MM-DD');if(!_0x28bfc0[_0x07db('0x22')]()){return _0x5b48ea(handleCheckRowError(_0x07db('0x14'),_0x07db('0x23'),null,_0x5d608c));}}if(_0x35dcaf['email']){if(!isEmail(_0x35dcaf['email'])){return _0x5b48ea(handleCheckRowError('error',_0x07db('0x24'),null,_0x5d608c));}}_0x35dcaf[_0x07db('0x25')]=LISTID;_0x35dcaf[_0x07db('0x26')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x3c7656){var _0x410d8a={};for(var _0x4e6116=0x0,_0x463736=DUPLICATES[_0x07db('0x19')];_0x4e6116<_0x463736;_0x4e6116+=0x1){_0x410d8a[DUPLICATES[_0x4e6116]]=_0x35dcaf[DUPLICATES[_0x4e6116]];}var _0x3f6b50=_['find'](_0x3c7656,_0x410d8a);if(_0x3f6b50){return _0x5b48ea(handleCheckRowError(_0x07db('0x27'),_0x07db('0x28'),_0x3f6b50,_0x5d608c));}}return db[_0x07db('0x29')]['create'](_0x35dcaf,{'raw':!![],'hooks':![],'fields':_['keys'](_0x35dcaf)})[_0x07db('0x2a')](function(_0x18bde0){if(DUPLICATES&&DUPLICATES['length']&&_0x3c7656){_0x3c7656['push'](_[_0x07db('0x2b')](_0x35dcaf,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x18bde0['id'];return _0x1c0832();})[_0x07db('0x2c')](function(_0x1140bb){return _0x5b48ea(handleCheckRowError(_0x07db('0x14'),_0x07db('0x2d')+(_0x1140bb['message']||JSON[_0x07db('0x2e')](_0x1140bb)),null,_0x5d608c));});});}function checkHopper(){function _0x308684(){return function(_0x106091){logger[_0x07db('0x14')](_0x07db('0x2f'),_0x07db('0x30'),util[_0x07db('0x31')](_0x106091,{'showHidden':![],'depth':null}));};}var _0x2edcb8=function(_0x5a9012,_0x15f89a){var _0x1fd732=squel['insert']()[_0x07db('0x32')](_0x07db('0x33'))[_0x07db('0x34')]([_0x07db('0x1f'),_0x07db('0x35'),_0x07db('0x36'),_0x07db('0x25'),_0x15f89a,'createdAt',_0x07db('0x37')],squel[_0x07db('0x38')]()['field']('phone',_0x07db('0x1f'))[_0x07db('0x39')]('NOW()','scheduledAt')['field']('id',_0x07db('0x36'))['field'](LISTID[_0x07db('0x3a')](),_0x07db('0x25'))[_0x07db('0x39')](_0x5a9012['id'][_0x07db('0x3a')](),_0x15f89a)[_0x07db('0x39')](_0x07db('0x3b'),_0x07db('0x3c'))[_0x07db('0x39')](_0x07db('0x3b'),_0x07db('0x37'))[_0x07db('0x3d')]('cm_contacts')[_0x07db('0x3e')]('deletedAt\x20IS\x20NULL')[_0x07db('0x3e')](_0x07db('0x3f'),LISTID[_0x07db('0x3a')]())[_0x07db('0x3e')](_0x07db('0x40'))[_0x07db('0x3e')](_0x07db('0x41'),squel[_0x07db('0x38')]()[_0x07db('0x39')](_0x07db('0x1f'))[_0x07db('0x3d')](_0x07db('0x33'))['where'](_0x15f89a+_0x07db('0x42'),_0x5a9012['id']['toString']())))['toString']();return _0x1fd732;};var _0x47614b=function(_0x5af32e,_0x299aba){var _0x5f07d2=squel[_0x07db('0x43')]()[_0x07db('0x32')](_0x07db('0x33'))[_0x07db('0x34')]([_0x07db('0x1f'),_0x07db('0x35'),_0x07db('0x36'),_0x07db('0x25'),_0x299aba,_0x07db('0x3c'),'updatedAt'],squel[_0x07db('0x38')]()[_0x07db('0x39')](_0x07db('0x1f'),_0x07db('0x1f'))[_0x07db('0x39')](_0x07db('0x3b'),_0x07db('0x35'))['field']('id',_0x07db('0x36'))['field'](LISTID[_0x07db('0x3a')](),_0x07db('0x25'))[_0x07db('0x39')](_0x5af32e['id'][_0x07db('0x3a')](),_0x299aba)[_0x07db('0x39')](_0x07db('0x3b'),_0x07db('0x3c'))[_0x07db('0x39')](_0x07db('0x3b'),_0x07db('0x37'))['from'](_0x07db('0x44'))[_0x07db('0x3e')](_0x07db('0x45'))[_0x07db('0x3e')]('ListId\x20=\x20?',LISTID['toString']())[_0x07db('0x3e')](_0x07db('0x46'),squel[_0x07db('0x47')](hopperContacts))[_0x07db('0x3e')](_0x07db('0x40'))[_0x07db('0x3e')](_0x07db('0x41'),squel['select']()['field']('calleridnum')[_0x07db('0x3d')](_0x07db('0x48'))['where'](_0x299aba+'\x20=\x20?',_0x5af32e['id'][_0x07db('0x3a')]()))[_0x07db('0x3e')](_0x07db('0x41'),squel[_0x07db('0x38')]()[_0x07db('0x39')](_0x07db('0x1f'))[_0x07db('0x3d')](_0x07db('0x33'))[_0x07db('0x3e')](_0x299aba+'\x20=\x20?',_0x5af32e['id'][_0x07db('0x3a')]())))[_0x07db('0x3a')]();return _0x5f07d2;};function _0x54bd58(_0x4b910f,_0x454e20){var _0x572f30=squel[_0x07db('0x43')]()['into'](_0x07db('0x33'))[_0x07db('0x34')](['phone',_0x07db('0x35'),_0x07db('0x36'),'ListId',_0x454e20,_0x07db('0x3c'),_0x07db('0x37')],squel['select']()[_0x07db('0x39')](_0x07db('0x1f'),_0x07db('0x1f'))[_0x07db('0x39')](_0x07db('0x3b'),_0x07db('0x35'))[_0x07db('0x39')]('id',_0x07db('0x36'))[_0x07db('0x39')](LISTID[_0x07db('0x3a')](),_0x07db('0x25'))[_0x07db('0x39')](_0x4b910f['id']['toString'](),_0x454e20)[_0x07db('0x39')](_0x07db('0x3b'),_0x07db('0x3c'))[_0x07db('0x39')](_0x07db('0x3b'),'updatedAt')[_0x07db('0x3d')]('cm_contacts')[_0x07db('0x3e')]('deletedAt\x20IS\x20NULL')[_0x07db('0x3e')](_0x07db('0x3f'),LISTID['toString']())['where']('id\x20IN\x20?',squel['str'](hopperContacts))[_0x07db('0x3e')]('phone\x20IS\x20NOT\x20NULL'))['toString']();return _0x572f30;}function _0x5e7a38(_0x22ff3f,_0x13aeea){var _0x23dc0d=squel[_0x07db('0x43')]()[_0x07db('0x32')](_0x07db('0x49'))[_0x07db('0x34')]([_0x07db('0x1f'),'ContactId',_0x07db('0x25'),_0x13aeea,_0x07db('0x3c'),'updatedAt'],squel[_0x07db('0x38')]()[_0x07db('0x39')](_0x07db('0x1f'),_0x07db('0x1f'))[_0x07db('0x39')]('id',_0x07db('0x36'))[_0x07db('0x39')](LISTID['toString'](),_0x07db('0x25'))[_0x07db('0x39')](_0x22ff3f['id']['toString'](),_0x13aeea)[_0x07db('0x39')](_0x07db('0x3b'),_0x07db('0x3c'))[_0x07db('0x39')](_0x07db('0x3b'),_0x07db('0x37'))[_0x07db('0x3d')]('cm_contacts')[_0x07db('0x3e')](_0x07db('0x45'))[_0x07db('0x3e')](_0x07db('0x3f'),LISTID['toString']())[_0x07db('0x3e')](_0x07db('0x46'),squel['str'](hopperContacts))[_0x07db('0x3e')](_0x07db('0x40')))[_0x07db('0x3a')]();return _0x23dc0d;}return db['VoiceQueue'][_0x07db('0x4a')]({'where':{'type':_0x07db('0x4b')},'attributes':['id',_0x07db('0x4c')],'include':[{'model':db[_0x07db('0x4d')],'as':_0x07db('0x4e'),'where':{'id':LISTID}}]})[_0x07db('0x2a')](function(_0x299e9e){var _0x3681b1=[];if(_0x299e9e){var _0x25b933;for(var _0x192969=0x0,_0x17cf7b;_0x192969<_0x299e9e['length'];_0x192969+=0x1){_0x17cf7b=_0x299e9e[_0x192969][_0x07db('0x4f')]({'plain':!![]});switch(_0x17cf7b[_0x07db('0x4c')]){case'always':_0x3681b1[_0x07db('0x50')](db[_0x07db('0x51')][_0x07db('0x52')](_0x47614b(_0x17cf7b,'VoiceQueueId'))['then'](function(){})['catch'](_0x308684()));break;case'onlyIfOpen':_0x3681b1['push'](db[_0x07db('0x51')]['query'](_0x2edcb8(_0x17cf7b,_0x07db('0x53')))['then'](function(){})[_0x07db('0x2c')](_0x308684()));break;default:_0x3681b1[_0x07db('0x50')](db[_0x07db('0x51')][_0x07db('0x52')](_0x54bd58(_0x17cf7b,_0x07db('0x53')))['then'](function(){})[_0x07db('0x2c')](_0x308684()));}}}return _0x3681b1;})[_0x07db('0x54')]()[_0x07db('0x2a')](function(){return db[_0x07db('0x55')][_0x07db('0x4a')]({'where':{'type':_0x07db('0x4b')},'attributes':['id'],'include':[{'model':db[_0x07db('0x4d')],'as':_0x07db('0x56'),'where':{'id':LISTID}}]})[_0x07db('0x2a')](function(_0x7aba89){var _0x56f164=[];if(_0x7aba89){var _0x389371;for(var _0x5a6b4a=0x0,_0x5ce692;_0x5a6b4a<_0x7aba89['length'];_0x5a6b4a+=0x1){_0x5ce692=_0x7aba89[_0x5a6b4a][_0x07db('0x4f')]({'plain':!![]});_0x56f164[_0x07db('0x50')](db[_0x07db('0x51')]['query'](_0x5e7a38(_0x5ce692,_0x07db('0x53')))[_0x07db('0x2a')](function(){})['catch'](_0x308684()));}}return _0x56f164;})['all']();})[_0x07db('0x2a')](function(){return db[_0x07db('0x57')][_0x07db('0x4a')]({'attributes':['id',_0x07db('0x4c')],'include':[{'model':db[_0x07db('0x4d')],'as':'Lists','where':{'id':LISTID}}]})['then'](function(_0x55f41f){var _0x15a42d=[];if(_0x55f41f){for(var _0xd9560f=0x0,_0x24b93d;_0xd9560f<_0x55f41f[_0x07db('0x19')];_0xd9560f+=0x1){_0x24b93d=_0x55f41f[_0xd9560f][_0x07db('0x4f')]({'plain':!![]});switch(_0x24b93d[_0x07db('0x4c')]){case _0x07db('0x58'):_0x15a42d[_0x07db('0x50')](db[_0x07db('0x51')][_0x07db('0x52')](_0x47614b(_0x24b93d,_0x07db('0x59')))[_0x07db('0x2a')](function(){})['catch'](_0x308684()));break;case _0x07db('0x5a'):_0x15a42d[_0x07db('0x50')](db[_0x07db('0x51')]['query'](_0x2edcb8(_0x24b93d,'CampaignId'))[_0x07db('0x2a')](function(){})[_0x07db('0x2c')](_0x308684()));break;default:_0x15a42d[_0x07db('0x50')](db['sequelize'][_0x07db('0x52')](_0x54bd58(_0x24b93d,_0x07db('0x59')))['then'](function(){})[_0x07db('0x2c')](_0x308684()));}}}return _0x15a42d;})[_0x07db('0x54')]();})[_0x07db('0x2a')](function(){return db[_0x07db('0x57')][_0x07db('0x4a')]({'attributes':['id'],'include':[{'model':db[_0x07db('0x4d')],'as':_0x07db('0x56'),'where':{'id':LISTID}}]})[_0x07db('0x2a')](function(_0x3987cf){var _0x38bc0e=[];if(_0x3987cf){for(var _0x759e90=0x0,_0x5f5a7b;_0x759e90<_0x3987cf['length'];_0x759e90+=0x1){_0x5f5a7b=_0x3987cf[_0x759e90][_0x07db('0x4f')]({'plain':!![]});_0x38bc0e[_0x07db('0x50')](db['sequelize'][_0x07db('0x52')](_0x5e7a38(_0x5f5a7b,_0x07db('0x59')))[_0x07db('0x2a')](function(){})['catch'](_0x308684()));}}return _0x38bc0e;})[_0x07db('0x54')]();})['catch'](function(_0x2ce141){logger[_0x07db('0x14')](_0x07db('0x5b'),_0x07db('0x5c'),_0x2ce141[_0x07db('0x1a')]);});}var processPromises=function(_0x158ac5){return BPromise[_0x07db('0x54')](promises)['then'](function(_0x3b1db2){})['catch'](function(_0x3c3447){logger[_0x07db('0x14')](_0x07db('0x5d'),JSON[_0x07db('0x2e')](_0x3c3447));})[_0x07db('0x5e')](function(){socket['emit'](_0x07db('0x5f')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x158ac5){return _0x158ac5[_0x07db('0x60')]();}});};var endCsv=function(){return BPromise[_0x07db('0x61')]()[_0x07db('0x2a')](function(){if(hopperContacts){return checkHopper();}})[_0x07db('0x2a')](function(){socket[_0x07db('0x62')](_0x07db('0x5f')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x07db('0x63')](FILEPATH);}catch(_0x31ea24){logger[_0x07db('0x14')](_0x07db('0x64'),JSON[_0x07db('0x2e')](_0x31ea24));}finally{process[_0x07db('0x65')](0x0);}});};process['on'](_0x07db('0x66'),function(){logger['info']('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x07db('0x61')]()[_0x07db('0x2a')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x07db('0x11')](',');return db['CmContact'][_0x07db('0x4a')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x07db('0x2a')](function(_0x8d9c85){var _0xbdbbac=fs[_0x07db('0x67')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x07db('0x68')](_0xbdbbac,{'header':!![],'skipEmptyLines':!![],'step':function(_0x677444,_0x21d4b8){total+=0x1;var _0x5b5130=total;promises[_0x07db('0x50')](checkRow(_0x677444,_0x8d9c85,_0x5b5130)[_0x07db('0x2a')](function(){success+=0x1;})[_0x07db('0x2c')](function(_0x2f942c){if(_0x2f942c[_0x07db('0x14')]){errors+=0x1;delete _0x2f942c[_0x07db('0x14')];}else if(_0x2f942c['duplicate']){duplicates+=0x1;delete _0x2f942c[_0x07db('0x27')];}rows[_0x07db('0x50')](_0x2f942c);}));if(total%0xc8===0x0){_0x21d4b8[_0x07db('0x69')]();return processPromises(_0x21d4b8);}},'complete':function(){return processPromises()[_0x07db('0x2a')](function(){logger[_0x07db('0x6a')](_0x07db('0x6b'));endCsv();});},'error':function(_0x27c30d,_0x1778e4){logger[_0x07db('0x6a')](_0x07db('0x6c'),JSON['stringify'](_0x27c30d));endCsv();}});})[_0x07db('0x2c')](function(_0x3c2693){logger[_0x07db('0x14')](_0x07db('0x6d'),JSON['stringify'](_0x3c2693));});}main();
\ No newline at end of file
+var _0x5907=['cm_hopper','into','id\x20IN\x20?','str','phone\x20IS\x20NOT\x20NULL','calleridnum','cm_hopper_final','\x20=\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','get','always','sequelize','query','VoiceQueueId','onlyIfOpen','all','BlackLists','Campaign','Lists','CampaignId','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','finally','emit','resume','resolve','contact:csv_','unlinkSync','exit','info','CSV\x20import\x20process\x20stopped!','split','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','papaparse','../../../mysqldb','../../../config/environment','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','null','Missing\x20filepath\x20parameter!','undefined','Missing\x20binding\x20parameters!','zipObject','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','errors','length','map','message','join','hasOwnProperty','data','firstName','phone','phone\x20not\x20specified!','birthDate','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','inspect','insert','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','field','toString','NOW()','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','select'];(function(_0x350182,_0x2a9feb){var _0x4a0892=function(_0x2c994d){while(--_0x2c994d){_0x350182['push'](_0x350182['shift']());}};_0x4a0892(++_0x2a9feb);}(_0x5907,0x170));var _0x7590=function(_0x1981e3,_0x580bae){_0x1981e3=_0x1981e3-0x0;var _0x25011a=_0x5907[_0x1981e3];return _0x25011a;};'use strict';var BPromise=require(_0x7590('0x0'));var util=require(_0x7590('0x1'));var _=require('lodash');var fs=require('fs');var squel=require('squel');var Papa=require(_0x7590('0x2'));var Redis=require('ioredis');var db=require(_0x7590('0x3'))['db'];var config=require(_0x7590('0x4'));var logger=require('../../../config/logger')('api');config[_0x7590('0x5')]=_[_0x7590('0x6')](config[_0x7590('0x5')],{'host':_0x7590('0x7'),'port':0x18eb});var socket=require(_0x7590('0x8'))(new Redis(config[_0x7590('0x5')]));require(_0x7590('0x9'))[_0x7590('0xa')](socket);try{if(!process[_0x7590('0xb')][0x2]||process[_0x7590('0xb')][0x2]==='undefined'||process[_0x7590('0xb')][0x2]===_0x7590('0xc')){throw new Error(_0x7590('0xd'));}var FILEPATH=process[_0x7590('0xb')][0x2];if(!process['argv'][0x3]||process[_0x7590('0xb')][0x3]===_0x7590('0xe')||process[_0x7590('0xb')][0x3]===_0x7590('0xc')||!process[_0x7590('0xb')][0x4]||process[_0x7590('0xb')][0x4]===_0x7590('0xe')||process[_0x7590('0xb')][0x4]==='null'){throw new Error(_0x7590('0xf'));}var FIELDS=_[_0x7590('0x10')](process[_0x7590('0xb')][0x3]['split'](','),process[_0x7590('0xb')][0x4]['split'](','));if(!process[_0x7590('0xb')][0x5]||process[_0x7590('0xb')][0x5]===_0x7590('0xe')||process[_0x7590('0xb')][0x5]===_0x7590('0xc')){throw new Error(_0x7590('0x11'));}var LISTID=process[_0x7590('0xb')][0x5];var COMPANYID=process[_0x7590('0xb')][0x6]&&process['argv'][0x6]!==_0x7590('0xe')&&process[_0x7590('0xb')][0x6]!==_0x7590('0xc')?process['argv'][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x7590('0xb')][0x7]!==_0x7590('0xe')&&process[_0x7590('0xb')][0x7]!==_0x7590('0xc')?process[_0x7590('0xb')][0x7]:null;if(!process[_0x7590('0xb')][0x8]||process[_0x7590('0xb')][0x8]==='undefined'||process[_0x7590('0xb')][0x8]===_0x7590('0xc')){throw new Error(_0x7590('0x12'));}var SOCKET_TIMESTAMP=process[_0x7590('0xb')][0x8];}catch(_0xeaca68){logger[_0x7590('0x13')](_0xeaca68);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(_0x41d8ea,_0x2ca179,_0x2136d6,_0x2c9234){var _0x2dc251={'message':_0x2ca179};_0x2dc251[_0x41d8ea]=!![];if(_0x2136d6){_0x2dc251[_0x7590('0x14')]=_0x2136d6;}if(_0x2c9234){_0x2dc251[_0x7590('0x15')]=_0x2c9234;}return _0x2dc251;}function isEmail(_0x433401){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))*$/[_0x7590('0x16')](_0x433401);}function checkRow(_0xfa0110,_0x55fffd,_0x5e63f0){return new BPromise(function(_0x468973,_0x50e07e){if(_[_0x7590('0x17')](_0xfa0110)){return _0x50e07e(handleCheckRowError(_0x7590('0x13'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x5e63f0));}if(_0xfa0110[_0x7590('0x18')]&&_0xfa0110[_0x7590('0x18')][_0x7590('0x19')]){var _0x225384=_[_0x7590('0x1a')](_0xfa0110[_0x7590('0x18')],_0x7590('0x1b'))[_0x7590('0x1c')](';');return _0x50e07e(handleCheckRowError(_0x7590('0x13'),_0x225384,null,_0x5e63f0));}var _0xf9bed3={};for(var _0x5cd8c1 in FIELDS){if(FIELDS[_0x7590('0x1d')](_0x5cd8c1)&&FIELDS[_0x5cd8c1]){_0xf9bed3[_0x5cd8c1]=_0xfa0110['data'][0x0][FIELDS[_0x5cd8c1]]||_0xfa0110[_0x7590('0x1e')][0x0]['\ufeff'+FIELDS[_0x5cd8c1]];}}if(!_0xf9bed3[_0x7590('0x1f')]){return _0x50e07e(handleCheckRowError('error','firstName\x20not\x20specified!',null,_0x5e63f0));}if(!_0xf9bed3[_0x7590('0x20')]){return _0x50e07e(handleCheckRowError(_0x7590('0x13'),_0x7590('0x21'),null,_0x5e63f0));}if(_0xf9bed3[_0x7590('0x22')]){var _0x5b8a45=moment(_0xf9bed3[_0x7590('0x22')],'YYYY-MM-DD');if(!_0x5b8a45['isValid']()){return _0x50e07e(handleCheckRowError(_0x7590('0x13'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x5e63f0));}}if(_0xf9bed3['email']){if(!isEmail(_0xf9bed3[_0x7590('0x23')])){return _0x50e07e(handleCheckRowError(_0x7590('0x13'),_0x7590('0x24'),null,_0x5e63f0));}}_0xf9bed3[_0x7590('0x25')]=LISTID;_0xf9bed3[_0x7590('0x26')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x7590('0x19')]&&_0x55fffd){var _0x4a5def={};for(var _0x807d87=0x0,_0x12c845=DUPLICATES[_0x7590('0x19')];_0x807d87<_0x12c845;_0x807d87+=0x1){_0x4a5def[DUPLICATES[_0x807d87]]=_0xf9bed3[DUPLICATES[_0x807d87]];}var _0x1b327e=_[_0x7590('0x27')](_0x55fffd,_0x4a5def);if(_0x1b327e){return _0x50e07e(handleCheckRowError(_0x7590('0x28'),_0x7590('0x29'),_0x1b327e,_0x5e63f0));}}return db[_0x7590('0x2a')]['create'](_0xf9bed3,{'raw':!![],'hooks':![],'fields':_[_0x7590('0x2b')](_0xf9bed3)})[_0x7590('0x2c')](function(_0x279009){if(DUPLICATES&&DUPLICATES[_0x7590('0x19')]&&_0x55fffd){_0x55fffd[_0x7590('0x2d')](_[_0x7590('0x2e')](_0xf9bed3,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x279009['id'];return _0x468973();})[_0x7590('0x2f')](function(_0x5b7992){return _0x50e07e(handleCheckRowError(_0x7590('0x13'),_0x7590('0x30')+(_0x5b7992[_0x7590('0x1b')]||JSON[_0x7590('0x31')](_0x5b7992)),null,_0x5e63f0));});});}function checkHopper(){function _0x177626(){return function(_0x1f4744){logger[_0x7590('0x13')]('cmContact',_0x7590('0x32'),util[_0x7590('0x33')](_0x1f4744,{'showHidden':![],'depth':null}));};}var _0x58ce63=function(_0x3a820a,_0x324e50){var _0x2dd3ab=squel[_0x7590('0x34')]()['into']('cm_hopper')[_0x7590('0x35')]([_0x7590('0x20'),_0x7590('0x36'),_0x7590('0x37'),_0x7590('0x25'),_0x324e50,_0x7590('0x38'),_0x7590('0x39')],squel['select']()[_0x7590('0x3a')](_0x7590('0x20'),_0x7590('0x20'))[_0x7590('0x3a')]('NOW()',_0x7590('0x36'))[_0x7590('0x3a')]('id',_0x7590('0x37'))['field'](LISTID[_0x7590('0x3b')](),'ListId')[_0x7590('0x3a')](_0x3a820a['id']['toString'](),_0x324e50)['field'](_0x7590('0x3c'),_0x7590('0x38'))['field'](_0x7590('0x3c'),_0x7590('0x39'))[_0x7590('0x3d')](_0x7590('0x3e'))[_0x7590('0x3f')](_0x7590('0x40'))[_0x7590('0x3f')](_0x7590('0x41'),LISTID[_0x7590('0x3b')]())[_0x7590('0x3f')]('phone\x20IS\x20NOT\x20NULL')[_0x7590('0x3f')](_0x7590('0x42'),squel[_0x7590('0x43')]()[_0x7590('0x3a')]('phone')['from'](_0x7590('0x44'))['where'](_0x324e50+'\x20=\x20?',_0x3a820a['id']['toString']())))[_0x7590('0x3b')]();return _0x2dd3ab;};var _0x4fa35c=function(_0x633950,_0x57610d){var _0x4665c1=squel[_0x7590('0x34')]()[_0x7590('0x45')](_0x7590('0x44'))['fromQuery']([_0x7590('0x20'),_0x7590('0x36'),_0x7590('0x37'),_0x7590('0x25'),_0x57610d,'createdAt',_0x7590('0x39')],squel[_0x7590('0x43')]()[_0x7590('0x3a')](_0x7590('0x20'),_0x7590('0x20'))[_0x7590('0x3a')](_0x7590('0x3c'),_0x7590('0x36'))[_0x7590('0x3a')]('id',_0x7590('0x37'))['field'](LISTID[_0x7590('0x3b')](),_0x7590('0x25'))[_0x7590('0x3a')](_0x633950['id'][_0x7590('0x3b')](),_0x57610d)[_0x7590('0x3a')]('NOW()',_0x7590('0x38'))[_0x7590('0x3a')]('NOW()',_0x7590('0x39'))[_0x7590('0x3d')](_0x7590('0x3e'))[_0x7590('0x3f')]('deletedAt\x20IS\x20NULL')['where'](_0x7590('0x41'),LISTID[_0x7590('0x3b')]())[_0x7590('0x3f')](_0x7590('0x46'),squel[_0x7590('0x47')](hopperContacts))[_0x7590('0x3f')](_0x7590('0x48'))[_0x7590('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x7590('0x3a')](_0x7590('0x49'))[_0x7590('0x3d')](_0x7590('0x4a'))[_0x7590('0x3f')](_0x57610d+_0x7590('0x4b'),_0x633950['id']['toString']()))[_0x7590('0x3f')](_0x7590('0x42'),squel[_0x7590('0x43')]()[_0x7590('0x3a')]('phone')[_0x7590('0x3d')](_0x7590('0x44'))[_0x7590('0x3f')](_0x57610d+_0x7590('0x4b'),_0x633950['id']['toString']())))[_0x7590('0x3b')]();return _0x4665c1;};function _0xd46b72(_0x215d3b,_0x2796ba){var _0x434f94=squel[_0x7590('0x34')]()[_0x7590('0x45')](_0x7590('0x44'))[_0x7590('0x35')]([_0x7590('0x20'),'scheduledAt','ContactId',_0x7590('0x25'),_0x2796ba,_0x7590('0x38'),'updatedAt'],squel[_0x7590('0x43')]()['field'](_0x7590('0x20'),_0x7590('0x20'))[_0x7590('0x3a')](_0x7590('0x3c'),_0x7590('0x36'))[_0x7590('0x3a')]('id',_0x7590('0x37'))['field'](LISTID[_0x7590('0x3b')](),_0x7590('0x25'))[_0x7590('0x3a')](_0x215d3b['id'][_0x7590('0x3b')](),_0x2796ba)[_0x7590('0x3a')](_0x7590('0x3c'),'createdAt')[_0x7590('0x3a')](_0x7590('0x3c'),_0x7590('0x39'))[_0x7590('0x3d')]('cm_contacts')[_0x7590('0x3f')](_0x7590('0x40'))[_0x7590('0x3f')]('ListId\x20=\x20?',LISTID[_0x7590('0x3b')]())['where'](_0x7590('0x46'),squel[_0x7590('0x47')](hopperContacts))[_0x7590('0x3f')]('phone\x20IS\x20NOT\x20NULL'))[_0x7590('0x3b')]();return _0x434f94;}function _0x156263(_0x264a16,_0xe44224){var _0x2f3e9b=squel[_0x7590('0x34')]()['into'](_0x7590('0x4c'))[_0x7590('0x35')](['phone',_0x7590('0x37'),'ListId',_0xe44224,_0x7590('0x38'),_0x7590('0x39')],squel[_0x7590('0x43')]()[_0x7590('0x3a')](_0x7590('0x20'),_0x7590('0x20'))[_0x7590('0x3a')]('id','ContactId')['field'](LISTID[_0x7590('0x3b')](),_0x7590('0x25'))['field'](_0x264a16['id'][_0x7590('0x3b')](),_0xe44224)[_0x7590('0x3a')](_0x7590('0x3c'),_0x7590('0x38'))[_0x7590('0x3a')](_0x7590('0x3c'),_0x7590('0x39'))[_0x7590('0x3d')]('cm_contacts')[_0x7590('0x3f')]('deletedAt\x20IS\x20NULL')[_0x7590('0x3f')](_0x7590('0x41'),LISTID['toString']())[_0x7590('0x3f')](_0x7590('0x46'),squel[_0x7590('0x47')](hopperContacts))[_0x7590('0x3f')]('phone\x20IS\x20NOT\x20NULL'))[_0x7590('0x3b')]();return _0x2f3e9b;}return db[_0x7590('0x4d')][_0x7590('0x4e')]({'where':{'type':_0x7590('0x4f')},'attributes':['id',_0x7590('0x50')],'include':[{'model':db[_0x7590('0x51')],'as':'Lists','where':{'id':LISTID}}]})[_0x7590('0x2c')](function(_0x1e086d){var _0xe86a18=[];if(_0x1e086d){var _0x12c0a1;for(var _0x2cbf45=0x0,_0x2c9a48;_0x2cbf45<_0x1e086d['length'];_0x2cbf45+=0x1){_0x2c9a48=_0x1e086d[_0x2cbf45][_0x7590('0x52')]({'plain':!![]});switch(_0x2c9a48[_0x7590('0x50')]){case _0x7590('0x53'):_0xe86a18[_0x7590('0x2d')](db[_0x7590('0x54')][_0x7590('0x55')](_0x4fa35c(_0x2c9a48,_0x7590('0x56')))[_0x7590('0x2c')](function(){})['catch'](_0x177626()));break;case _0x7590('0x57'):_0xe86a18['push'](db[_0x7590('0x54')][_0x7590('0x55')](_0x58ce63(_0x2c9a48,_0x7590('0x56')))[_0x7590('0x2c')](function(){})[_0x7590('0x2f')](_0x177626()));break;default:_0xe86a18[_0x7590('0x2d')](db[_0x7590('0x54')][_0x7590('0x55')](_0xd46b72(_0x2c9a48,_0x7590('0x56')))[_0x7590('0x2c')](function(){})[_0x7590('0x2f')](_0x177626()));}}}return _0xe86a18;})[_0x7590('0x58')]()[_0x7590('0x2c')](function(){return db['VoiceQueue'][_0x7590('0x4e')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x7590('0x51')],'as':_0x7590('0x59'),'where':{'id':LISTID}}]})[_0x7590('0x2c')](function(_0x1377c1){var _0x9064b2=[];if(_0x1377c1){var _0x2c1645;for(var _0x2752a8=0x0,_0x181103;_0x2752a8<_0x1377c1['length'];_0x2752a8+=0x1){_0x181103=_0x1377c1[_0x2752a8][_0x7590('0x52')]({'plain':!![]});_0x9064b2['push'](db[_0x7590('0x54')][_0x7590('0x55')](_0x156263(_0x181103,_0x7590('0x56')))[_0x7590('0x2c')](function(){})['catch'](_0x177626()));}}return _0x9064b2;})[_0x7590('0x58')]();})[_0x7590('0x2c')](function(){return db[_0x7590('0x5a')][_0x7590('0x4e')]({'attributes':['id',_0x7590('0x50')],'include':[{'model':db['CmList'],'as':_0x7590('0x5b'),'where':{'id':LISTID}}]})[_0x7590('0x2c')](function(_0x53cb92){var _0x322db9=[];if(_0x53cb92){for(var _0x1ee5f7=0x0,_0x1ae221;_0x1ee5f7<_0x53cb92[_0x7590('0x19')];_0x1ee5f7+=0x1){_0x1ae221=_0x53cb92[_0x1ee5f7][_0x7590('0x52')]({'plain':!![]});switch(_0x1ae221[_0x7590('0x50')]){case'always':_0x322db9[_0x7590('0x2d')](db[_0x7590('0x54')]['query'](_0x4fa35c(_0x1ae221,_0x7590('0x5c')))[_0x7590('0x2c')](function(){})[_0x7590('0x2f')](_0x177626()));break;case _0x7590('0x57'):_0x322db9[_0x7590('0x2d')](db[_0x7590('0x54')][_0x7590('0x55')](_0x58ce63(_0x1ae221,_0x7590('0x5c')))['then'](function(){})[_0x7590('0x2f')](_0x177626()));break;default:_0x322db9[_0x7590('0x2d')](db[_0x7590('0x54')][_0x7590('0x55')](_0xd46b72(_0x1ae221,_0x7590('0x5c')))[_0x7590('0x2c')](function(){})[_0x7590('0x2f')](_0x177626()));}}}return _0x322db9;})[_0x7590('0x58')]();})['then'](function(){return db['Campaign'][_0x7590('0x4e')]({'attributes':['id'],'include':[{'model':db[_0x7590('0x51')],'as':_0x7590('0x59'),'where':{'id':LISTID}}]})['then'](function(_0x2a324e){var _0x21f3e9=[];if(_0x2a324e){for(var _0xdb17ac=0x0,_0x4dc23c;_0xdb17ac<_0x2a324e[_0x7590('0x19')];_0xdb17ac+=0x1){_0x4dc23c=_0x2a324e[_0xdb17ac][_0x7590('0x52')]({'plain':!![]});_0x21f3e9[_0x7590('0x2d')](db['sequelize'][_0x7590('0x55')](_0x156263(_0x4dc23c,'CampaignId'))['then'](function(){})[_0x7590('0x2f')](_0x177626()));}}return _0x21f3e9;})[_0x7590('0x58')]();})[_0x7590('0x2f')](function(_0x4882b7){logger[_0x7590('0x13')](_0x7590('0x5d'),'generalCheckHopper',_0x4882b7['message']);});}var processPromises=function(_0x2a8d40){return BPromise[_0x7590('0x58')](promises)[_0x7590('0x2c')](function(_0x140d5d){})['catch'](function(_0xad6b16){logger[_0x7590('0x13')](_0x7590('0x5e'),JSON[_0x7590('0x31')](_0xad6b16));})[_0x7590('0x5f')](function(){socket[_0x7590('0x60')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x2a8d40){return _0x2a8d40[_0x7590('0x61')]();}});};var endCsv=function(){return BPromise[_0x7590('0x62')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x7590('0x2c')](function(){socket['emit'](_0x7590('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x7590('0x64')](FILEPATH);}catch(_0x299d73){logger['error']('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x7590('0x31')](_0x299d73));}finally{process[_0x7590('0x65')](0x0);}});};process['on']('SIGINT',function(){logger[_0x7590('0x66')](_0x7590('0x67'));endCsv();});function main(){return BPromise[_0x7590('0x62')]()[_0x7590('0x2c')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x7590('0x68')](',');return db[_0x7590('0x2a')][_0x7590('0x4e')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x7590('0x2c')](function(_0x1e05ff){var _0x59598e=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x59598e,{'header':!![],'skipEmptyLines':!![],'step':function(_0x36c640,_0x5bc767){total+=0x1;var _0x22131c=total;promises['push'](checkRow(_0x36c640,_0x1e05ff,_0x22131c)[_0x7590('0x2c')](function(){success+=0x1;})[_0x7590('0x2f')](function(_0x1ea9f0){if(_0x1ea9f0[_0x7590('0x13')]){errors+=0x1;delete _0x1ea9f0[_0x7590('0x13')];}else if(_0x1ea9f0[_0x7590('0x28')]){duplicates+=0x1;delete _0x1ea9f0[_0x7590('0x28')];}rows[_0x7590('0x2d')](_0x1ea9f0);}));if(total%0xc8===0x0){_0x5bc767[_0x7590('0x69')]();return processPromises(_0x5bc767);}},'complete':function(){return processPromises()['then'](function(){logger[_0x7590('0x66')](_0x7590('0x6a'));endCsv();});},'error':function(_0x1e0ed8,_0x5d1f2b){logger[_0x7590('0x66')](_0x7590('0x6b'),JSON[_0x7590('0x31')](_0x1e0ed8));endCsv();}});})[_0x7590('0x2f')](function(_0x2b2a9a){logger[_0x7590('0x13')](_0x7590('0x6c'),JSON['stringify'](_0x2b2a9a));});}main();
\ No newline at end of file
index f5b86a2..d3767cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x83dd=['root','server/files/tmp','includes','header',',utcOffset','writeFileSync','parse','createReadStream','data','rows','errors','hasOwnProperty','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','UserId','isNumber','email','email\x20wrong\x20format','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','SystemError','step','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','each','then','format','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','duplicates','DROP\x20TABLE\x20','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_blacklists','CampaignId','finish','affectedRows','unlink','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','util','bluebird','moment','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','defaults','redis','localhost','socket.io-emitter','test','select','field','.id\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ListId','createdAt','updatedAt','fields','from','join','cm_contacts','.CmListId','where','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','\x22always\x22','toString','cm_contacts.updatedAt','cm_hopper_black','phone','ContactId','cm_contacts.ListId\x20=\x20','ListId\x20=\x20?','\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','cm_contacts.id','priority','keys','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','message','exit','push','code','sequelize','query','spread','error','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','length','all','voice_queues.id','voice_queues.dialTimezone','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','catch','timezones','dialTimezone','isNil','utcOffset','set','offset','main','stringify','send','binding','socket_timestamp'];(function(_0x41e9a5,_0x229291){var _0x12ea9d=function(_0x2043f7){while(--_0x2043f7){_0x41e9a5['push'](_0x41e9a5['shift']());}};_0x12ea9d(++_0x229291);}(_0x83dd,0x17b));var _0xd83d=function(_0x3dd5f2,_0x33daf5){_0x3dd5f2=_0x3dd5f2-0x0;var _0x4c0546=_0x83dd[_0x3dd5f2];return _0x4c0546;};'use strict';var fs=require('fs');var path=require(_0xd83d('0x0'));var _=require(_0xd83d('0x1'));var Papa=require('papaparse');var util=require(_0xd83d('0x2'));var BPromise=require(_0xd83d('0x3'));var moment=require(_0xd83d('0x4'));var squel=require('squel');var Redis=require('ioredis');var db=require(_0xd83d('0x5'))['db'];var config=require(_0xd83d('0x6'));var shared=require(_0xd83d('0x7'));var logger=require(_0xd83d('0x8'))(_0xd83d('0x9'));config['redis']=_[_0xd83d('0xa')](config[_0xd83d('0xb')],{'host':_0xd83d('0xc'),'port':0x18eb});var socket=require(_0xd83d('0xd'))(new Redis(config[_0xd83d('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x17172c){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))*$/[_0xd83d('0xe')](_0x17172c);}function selectNotIn(_0x579ede,_0x273c59,_0x190929,_0x36216c,_0x1cc487){return squel[_0xd83d('0xf')]()[_0xd83d('0x10')]('phone')['from'](_0x36216c)['join'](_0x273c59,null,_0x273c59+_0xd83d('0x11')+_0x36216c+'.'+_0x190929)['where'](_0x36216c+'.'+_0x190929+'\x20=\x20'+_0x579ede+'.'+_0x190929)['where'](_0x273c59+_0xd83d('0x12')+_0x1cc487['join']()+')');}function insertCmHopper(_0x322430,_0x127ec6,_0x22be99,_0x3522d7,_0x3d3635){var _0x26d784=[_0xd83d('0x13'),_0xd83d('0x14'),'cm_contacts.id',_0xd83d('0x15'),_0x127ec6+'.'+_0x3522d7,_0xd83d('0x16'),'cm_contacts.updatedAt',_0xd83d('0x17'),_0xd83d('0x18'),'\x22'+_0x3d3635+'\x22'];return squel[_0xd83d('0x19')]()[_0xd83d('0x1a')](_0xd83d('0x1b'))[_0xd83d('0x1c')](['phone',_0xd83d('0x1d'),'ContactId',_0xd83d('0x1e'),_0x3522d7,_0xd83d('0x1f'),_0xd83d('0x20'),'priority','UserId','recallme'],squel[_0xd83d('0xf')]()[_0xd83d('0x21')](_0x26d784)[_0xd83d('0x22')](_0x127ec6)[_0xd83d('0x23')](_0xd83d('0x24'),null,'cm_contacts.ListId\x20=\x20'+_0x127ec6+_0xd83d('0x25'))[_0xd83d('0x23')](_0x22be99,null,_0x22be99+'.id\x20=\x20'+_0x127ec6+'.'+_0x3522d7)[_0xd83d('0x26')](_0x127ec6+_0xd83d('0x27'),_0x322430)[_0xd83d('0x26')](_0xd83d('0x28'),NOW)[_0xd83d('0x26')](_0xd83d('0x29'),selectNotIn(_0x127ec6,_0x22be99,_0x3522d7,'cm_hopper',['\x22always\x22',_0xd83d('0x2a')]))['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x127ec6,_0x22be99,_0x3522d7,_0xd83d('0x1b'),[_0xd83d('0x2b')])))[_0xd83d('0x2c')]();}function insertCmHopperBlack(_0x33e178,_0x469ae7,_0x5b0cea,_0x4fb3ec){var _0x185ea1=[_0xd83d('0x13'),'cm_contacts.id',_0xd83d('0x15'),_0x469ae7+'.'+_0x4fb3ec,_0xd83d('0x16'),_0xd83d('0x2d')];return squel[_0xd83d('0x19')]()[_0xd83d('0x1a')](_0xd83d('0x2e'))[_0xd83d('0x1c')]([_0xd83d('0x2f'),_0xd83d('0x30'),_0xd83d('0x1e'),_0x4fb3ec,'createdAt',_0xd83d('0x20')],squel[_0xd83d('0xf')]()[_0xd83d('0x21')](_0x185ea1)[_0xd83d('0x22')](_0x469ae7)['join'](_0xd83d('0x24'),null,_0xd83d('0x31')+_0x469ae7+_0xd83d('0x25'))['join'](_0x5b0cea,null,_0x5b0cea+_0xd83d('0x11')+_0x469ae7+'.'+_0x4fb3ec)[_0xd83d('0x26')](_0x469ae7+_0xd83d('0x27'),_0x33e178)[_0xd83d('0x26')](_0xd83d('0x28'),NOW)[_0xd83d('0x26')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xd83d('0x10')](_0xd83d('0x2f'))[_0xd83d('0x22')](_0xd83d('0x2e'))[_0xd83d('0x26')](_0xd83d('0x32'),_0x33e178)[_0xd83d('0x26')](_0x4fb3ec+_0xd83d('0x33'),_0x469ae7+'.'+_0x4fb3ec)))[_0xd83d('0x2c')]();}function insertTzCmHopper(_0x5753ba,_0x4e6149,_0x4caedf,_0x4410bc,_0x47aae5,_0x147de8){var _0xe34a41=[_0xd83d('0x13'),_0xd83d('0x34')+_0x147de8+'.offset-cm_contacts.utcOffset\x20minute)',_0xd83d('0x35'),_0xd83d('0x15'),_0x4e6149+'.'+_0x4410bc,_0xd83d('0x16'),_0xd83d('0x2d'),_0xd83d('0x17'),_0xd83d('0x18'),'\x22'+_0x47aae5+'\x22'];var _0x430872=squel[_0xd83d('0x19')]()[_0xd83d('0x1a')](_0xd83d('0x1b'))['fromQuery']([_0xd83d('0x2f'),_0xd83d('0x1d'),_0xd83d('0x30'),_0xd83d('0x1e'),_0x4410bc,_0xd83d('0x1f'),_0xd83d('0x20'),_0xd83d('0x36'),'UserId','recallme'],squel['select']()[_0xd83d('0x21')](_0xe34a41)[_0xd83d('0x22')](_0x4e6149)['join'](_0xd83d('0x24'),null,'cm_contacts.ListId\x20=\x20'+_0x4e6149+_0xd83d('0x25'))['join'](_0x4caedf,null,_0x4caedf+_0xd83d('0x11')+_0x4e6149+'.'+_0x4410bc)['join'](_0x147de8,null,_0x147de8+_0xd83d('0x11')+_0x4e6149+'.'+_0x4410bc)[_0xd83d('0x26')](_0x4e6149+'.CmListId\x20=\x20?',_0x5753ba)['where'](_0xd83d('0x28'),NOW)[_0xd83d('0x26')](_0xd83d('0x29'),selectNotIn(_0x4e6149,_0x4caedf,_0x4410bc,'cm_hopper',[_0xd83d('0x2b'),_0xd83d('0x2a')]))['where'](_0xd83d('0x29'),selectNotIn(_0x4e6149,_0x4caedf,_0x4410bc,_0xd83d('0x1b'),[_0xd83d('0x2b')])))[_0xd83d('0x2c')]();return _0x430872;}function insertTzCmHopperBlack(_0x156e4f,_0x120570,_0x2eb813,_0x17e3ad){var _0x5d0c46=[_0xd83d('0x13'),_0xd83d('0x35'),_0xd83d('0x15'),_0x120570+'.'+_0x17e3ad,_0xd83d('0x16'),_0xd83d('0x2d')];return squel['insert']()[_0xd83d('0x1a')]('cm_hopper_black')[_0xd83d('0x1c')](['phone',_0xd83d('0x30'),_0xd83d('0x1e'),_0x17e3ad,_0xd83d('0x1f'),'updatedAt'],squel[_0xd83d('0xf')]()[_0xd83d('0x21')](_0x5d0c46)[_0xd83d('0x22')](_0x120570)[_0xd83d('0x23')](_0xd83d('0x24'),null,_0xd83d('0x31')+_0x120570+_0xd83d('0x25'))[_0xd83d('0x23')](_0x2eb813,null,_0x2eb813+_0xd83d('0x11')+_0x120570+'.'+_0x17e3ad)[_0xd83d('0x26')](_0x120570+_0xd83d('0x27'),_0x156e4f)[_0xd83d('0x26')](_0xd83d('0x28'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xd83d('0xf')]()['field'](_0xd83d('0x2f'))[_0xd83d('0x22')]('cm_hopper_black')[_0xd83d('0x26')](_0xd83d('0x32'),_0x156e4f)[_0xd83d('0x26')](_0x17e3ad+_0xd83d('0x33'),_0x120570+'.'+_0x17e3ad)))[_0xd83d('0x2c')]();}function insertCmContact(_0x344466,_0x2ecb23,_0x454b16,_0x52b505){var _0x1007fb=_['concat'](_[_0xd83d('0x37')](_0x52b505),[_0xd83d('0x1e'),_0xd83d('0x38'),_0xd83d('0x1f'),_0xd83d('0x20')]);return squel[_0xd83d('0x19')]()[_0xd83d('0x1a')](_0xd83d('0x24'))[_0xd83d('0x1c')](_0x1007fb,squel[_0xd83d('0xf')]()[_0xd83d('0x21')](_0x1007fb)['from'](_0x2ecb23)[_0xd83d('0x26')]('('+_0x454b16[_0xd83d('0x23')](',')+_0xd83d('0x39'),squel['select']()[_0xd83d('0x21')](_0x454b16)[_0xd83d('0x22')](_0xd83d('0x24'))[_0xd83d('0x26')](_0xd83d('0x32'),_0x344466)['where']('deletedAt\x20IS\x20NULL'))[_0xd83d('0x26')](_0xd83d('0x3a'),squel[_0xd83d('0xf')]()[_0xd83d('0x10')](_0xd83d('0x3b'),_0xd83d('0x3c'))[_0xd83d('0x22')](_0x2ecb23)[_0xd83d('0x3d')](_0x454b16[_0xd83d('0x23')](','))))['toString']();}function handleStop(){logger[_0xd83d('0x3e')](_0xd83d('0x3f'));stopped=!![];}function handleUncaughtException(_0xb30701){logger['error'](_0xb30701[_0xd83d('0x40')]);process[_0xd83d('0x41')](0x1);}function handleError(_0x3c02fa,_0x5e481a){stats['errors'][_0xd83d('0x42')]({'name':_0x5e481a[_0xd83d('0x43')],'message':_0x5e481a[_0xd83d('0x40')],'row':_0x3c02fa});}function handleQuery(_0x425f28){logger[_0xd83d('0x3e')](_0x425f28);return db[_0xd83d('0x44')][_0xd83d('0x45')](_0x425f28)[_0xd83d('0x46')](function(_0x572507){results['push'](_0x572507);})['catch'](function(_0x3be109){logger[_0xd83d('0x47')](_0x3be109['message']);});}function updateTzCampaigns(_0x1f3792){return new Promise(function(_0x354704,_0x40105e){var _0x2dbf3c=squel[_0xd83d('0xf')]()[_0xd83d('0x21')]([_0xd83d('0x48'),_0xd83d('0x49')])[_0xd83d('0x22')](_0xd83d('0x4a'))[_0xd83d('0x23')](_0xd83d('0x4b'),null,_0xd83d('0x4c'))['where'](_0xd83d('0x4d')+_0x1f3792);db[_0xd83d('0x44')]['query'](_0x2dbf3c[_0xd83d('0x2c')]())[_0xd83d('0x46')](function(_0xb8f762){var _0x33a5ef=[];for(var _0x1e2548=0x0;_0x1e2548<_0xb8f762[_0xd83d('0x4e')];_0x1e2548++){_0x33a5ef[_0xd83d('0x42')](getTimezoneData(_0xb8f762[_0x1e2548],tmp_campaigns));}BPromise[_0xd83d('0x4f')](_0x33a5ef)['then'](function(){_0x354704({'val':0x1});});})['catch'](function(_0x1451fc){logger[_0xd83d('0x47')](_0x1451fc[_0xd83d('0x40')]);_0x354704({'val':0x0});});});}function updateTzVoiceQueues(_0x48b70a){return new Promise(function(_0x57f4a6,_0x417a13){var _0x459215=squel[_0xd83d('0xf')]()[_0xd83d('0x21')]([_0xd83d('0x50'),_0xd83d('0x51')])[_0xd83d('0x22')]('voice_queues')[_0xd83d('0x23')]('voice_queues_has_cm_lists',null,_0xd83d('0x52'))[_0xd83d('0x26')]('voice_queues_has_cm_lists.CmListId='+_0x48b70a);db[_0xd83d('0x44')][_0xd83d('0x45')](_0x459215[_0xd83d('0x2c')]())[_0xd83d('0x46')](function(_0x4bf2ee){var _0x4c89c3=[];for(var _0x434f54=0x0;_0x434f54<_0x4bf2ee[_0xd83d('0x4e')];_0x434f54++){_0x4c89c3[_0xd83d('0x42')](getTimezoneData(_0x4bf2ee[_0x434f54],tmp_voice_queues));}BPromise[_0xd83d('0x4f')](_0x4c89c3)['then'](function(){_0x57f4a6({'val':0x1});});})[_0xd83d('0x53')](function(_0x274386){logger[_0xd83d('0x47')](_0x274386[_0xd83d('0x40')]);_0x57f4a6({'val':0x0});});});}function getTimezoneData(_0x82d3d,_0x168da1){return new Promise(function(_0x254193,_0x151e0a){var _0x34a2af=shared[_0xd83d('0x54')];var _0x366c0a=_0x34a2af[_0x82d3d[_0xd83d('0x55')]];if(_[_0xd83d('0x56')](_0x366c0a)){_0x254193({'ret':0x1});}else{var _0x110914=_0x366c0a[_0xd83d('0x57')];var _0x37003b=squel[_0xd83d('0x19')]()[_0xd83d('0x1a')](_0x168da1)[_0xd83d('0x58')]('id',_0x82d3d['id'])[_0xd83d('0x58')](_0xd83d('0x59'),_0x110914)[_0xd83d('0x58')](_0xd83d('0x55'),_0x82d3d[_0xd83d('0x55')])[_0xd83d('0x2c')]();return db[_0xd83d('0x44')][_0xd83d('0x45')](_0x37003b)[_0xd83d('0x46')](function(_0x35c992){_0x254193({'ret':0x1});})['catch'](function(_0x4d517b){logger['error'](_0x4d517b[_0xd83d('0x40')]);_0x151e0a({'ret':0x1});});}});}function handleTZQuery(_0x7f7b0e){logger['info'](_0x7f7b0e);return db['sequelize'][_0xd83d('0x45')](_0x7f7b0e)[_0xd83d('0x46')](function(_0x5be498){})[_0xd83d('0x53')](function(_0x5d676d){logger['error'](_0x5d676d[_0xd83d('0x40')]);});}function main(_0x23a58a,_0x245063,_0x5d5f3e,_0x3c32fb){logger['info'](_0xd83d('0x5a'),_0x23a58a,JSON[_0xd83d('0x5b')](_0x245063));process[_0xd83d('0x5c')]('start');var _0x201c94=_0x245063[_0xd83d('0x5d')];var _0x44cb7f=_0x245063[_0xd83d('0x5e')];var _0x42cc68=path[_0xd83d('0x23')](config[_0xd83d('0x5f')],_0xd83d('0x60'),_0x44cb7f+'.csv');hasTZ=_[_0xd83d('0x37')](_0x201c94)[_0xd83d('0x61')](_0xd83d('0x55'));var _0xccf893=_[_0xd83d('0x37')](_0x201c94)[_0xd83d('0x23')]();logger[_0xd83d('0x3e')](_0xd83d('0x62'),_0xccf893);if(hasTZ)_0xccf893+=_0xd83d('0x63');fs[_0xd83d('0x64')](_0x42cc68,_0xccf893+'\x0a');Papa[_0xd83d('0x65')](fs[_0xd83d('0x66')](_0x23a58a),{'header':!![],'skipEmptyLines':!![],'step':function(_0x59c9bd,_0x5a8d46){try{for(var _0x485c72=0x0,_0xa03c7f=[];_0x485c72<_0x59c9bd[_0xd83d('0x67')]['length'];_0x485c72++){stats[_0xd83d('0x68')]+=0x1;if(_0x59c9bd[_0xd83d('0x69')][_0x485c72]){handleError(_0x59c9bd[_0xd83d('0x67')][_0x485c72],_0x59c9bd[_0xd83d('0x69')][_0x485c72]);}else{var _0x103136=[];for(var _0x1756d3 in _0x201c94){if(_0x201c94[_0xd83d('0x6a')](_0x1756d3)){if(_0x59c9bd[_0xd83d('0x67')][_0x485c72][_0x201c94[_0x1756d3]]){var _0x1e0e94=_['trim'](_0x59c9bd[_0xd83d('0x67')][_0x485c72][_0x201c94[_0x1756d3]][_0xd83d('0x6b')](/"/g,'\x27'));switch(_0x1756d3){case _0xd83d('0x1d'):var _0x9966ce=moment(_0x1e0e94,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x9966ce[_0xd83d('0x6c')]()){_0xa03c7f[_0xd83d('0x42')]('\x22'+_0x1e0e94+'\x22');}else{_0x103136[_0xd83d('0x42')](_0xd83d('0x6d'));}break;case _0xd83d('0x36'):var _0x4955af=parseInt(_0x1e0e94);_0x1e0e94=_[_0xd83d('0x6e')](_0x4955af)||_0x4955af<0x0||_0x4955af>0x4?_0x3c32fb?0x3:0x2:_0x4955af;_0xa03c7f[_0xd83d('0x42')]('\x22'+_0x1e0e94+'\x22');break;case _0xd83d('0x6f'):var _0x10b27d=parseInt(_0x1e0e94);if(_[_0xd83d('0x70')](_0x10b27d)&&_[_0xd83d('0x61')](_0x5d5f3e,_0x10b27d)){_0xa03c7f['push']('\x22'+_0x10b27d+'\x22');}else{_0x103136['push']('agent\x20not\x20exists');}break;case _0xd83d('0x71'):if(isEmail(_0x1e0e94)){_0xa03c7f[_0xd83d('0x42')]('\x22'+_0x1e0e94+'\x22');}else{_0x103136[_0xd83d('0x42')](_0xd83d('0x72'));}break;case _0xd83d('0x73'):var _0x250295=moment(_0x1e0e94,'YYYY-MM-DD',!![]);if(_0x250295[_0xd83d('0x6c')]()){_0xa03c7f[_0xd83d('0x42')]('\x22'+_0x1e0e94+'\x22');}else{_0x103136[_0xd83d('0x42')](_0xd83d('0x74'));}break;case _0xd83d('0x55'):var _0x219b11=shared[_0xd83d('0x54')];var _0x29bfee=_0x219b11[_0x1e0e94];if(!_['isNil'](_0x29bfee)){var _0xab2bf8=_0x29bfee[_0xd83d('0x57')];_0xa03c7f[_0xd83d('0x42')]('\x22'+_0x1e0e94+'\x22');_0xa03c7f[_0xd83d('0x42')]('\x22'+_0xab2bf8+'\x22');}break;default:_0xa03c7f[_0xd83d('0x42')]('\x22'+_0x1e0e94+'\x22');}}else{switch(_0x1756d3){case'firstName':case _0xd83d('0x2f'):_0x103136['push'](_0x1756d3+_0xd83d('0x75'));break;default:_0xa03c7f[_0xd83d('0x42')]('\x22\x22');}}}}if(_0x103136[_0xd83d('0x4e')]){handleError(_0x59c9bd[_0xd83d('0x67')][_0x485c72],{'code':_0xd83d('0x76'),'message':_0x103136[_0xd83d('0x23')]()});}else{fs[_0xd83d('0x77')](_0x42cc68,_0xa03c7f[_0xd83d('0x23')]()+'\x0a');}_0xa03c7f=[];}if(!(stats[_0xd83d('0x68')]%0xc8)){socket[_0xd83d('0x78')](_0xd83d('0x79')+_0x44cb7f,stats);stats['errors']=[];}}if(stopped){logger[_0xd83d('0x3e')](_0xd83d('0x7a'));_0x5a8d46['abort']();}}catch(_0x59bd77){handleError(_0x59c9bd[_0xd83d('0x67')][_0x485c72],{'code':_0xd83d('0x7b'),'message':_0x59bd77[_0xd83d('0x40')]});logger[_0xd83d('0x47')](_0xd83d('0x7c'),_0x59bd77['message']);}},'complete':function(){try{var _0x3ae0cb=[];var _0x3fcf28=[];var _0x5f3da6=_0xd83d('0x24');if(_0x245063['duplicates']&&_0x245063['duplicates'][_0xd83d('0x4e')]){_0x5f3da6='cm_contacts_'+_0x44cb7f;_0x3ae0cb[_0xd83d('0x42')](_0xd83d('0x7d')+_0x5f3da6+_0xd83d('0x7e'));}tmp_campaigns=_0xd83d('0x7f')+_0x44cb7f;tmp_voice_queues=_0xd83d('0x80')+_0x44cb7f;_0x3fcf28[_0xd83d('0x42')]('CREATE\x20TABLE\x20'+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x3fcf28[_0xd83d('0x42')](_0xd83d('0x7d')+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0xd83d('0x81')](_0x3fcf28,handleTZQuery)[_0xd83d('0x82')](function(_0x5c7d35){updateTzCampaigns(_0x245063[_0xd83d('0x1e')])[_0xd83d('0x82')](function(_0x164ea2){updateTzVoiceQueues(_0x245063['ListId'])[_0xd83d('0x82')](function(_0x2bd2ac){var _0x2d0a71=util[_0xd83d('0x83')](_0xd83d('0x84'),_0x42cc68,_0x5f3da6,_0xccf893,_0x245063['ListId'],_0x245063[_0xd83d('0x38')]||null,NOW,NOW);if(_[_0xd83d('0x56')](_0x201c94[_0xd83d('0x1d')])){_0x2d0a71+=_0xd83d('0x85');}_0x3ae0cb[_0xd83d('0x42')](_0x2d0a71);if(_0x245063[_0xd83d('0x86')]&&_0x245063[_0xd83d('0x86')][_0xd83d('0x4e')]){_0x3ae0cb[_0xd83d('0x42')](insertCmContact(_0x245063[_0xd83d('0x1e')],_0x5f3da6,_0x245063['duplicates'],_0x201c94));_0x3ae0cb[_0xd83d('0x42')](_0xd83d('0x87')+_0x5f3da6+';');}if(hasTZ){_0x3ae0cb[_0xd83d('0x42')](insertTzCmHopper(_0x245063[_0xd83d('0x1e')],'voice_queues_has_cm_lists',_0xd83d('0x88'),_0xd83d('0x89'),_0x3c32fb,tmp_voice_queues));_0x3ae0cb[_0xd83d('0x42')](insertTzCmHopperBlack(_0x245063[_0xd83d('0x1e')],_0xd83d('0x8a'),_0xd83d('0x88'),_0xd83d('0x89')));_0x3ae0cb['push'](insertTzCmHopper(_0x245063[_0xd83d('0x1e')],_0xd83d('0x4b'),_0xd83d('0x4a'),'CampaignId',_0x3c32fb,tmp_campaigns));_0x3ae0cb[_0xd83d('0x42')](insertTzCmHopperBlack(_0x245063[_0xd83d('0x1e')],_0xd83d('0x8b'),_0xd83d('0x4a'),_0xd83d('0x8c')));}else{_0x3ae0cb[_0xd83d('0x42')](insertCmHopper(_0x245063[_0xd83d('0x1e')],'voice_queues_has_cm_lists',_0xd83d('0x88'),_0xd83d('0x89'),_0x3c32fb));_0x3ae0cb['push'](insertCmHopperBlack(_0x245063['ListId'],_0xd83d('0x8a'),_0xd83d('0x88'),_0xd83d('0x89')));_0x3ae0cb['push'](insertCmHopper(_0x245063[_0xd83d('0x1e')],_0xd83d('0x4b'),_0xd83d('0x4a'),_0xd83d('0x8c'),_0x3c32fb));_0x3ae0cb[_0xd83d('0x42')](insertCmHopperBlack(_0x245063['ListId'],_0xd83d('0x8b'),'campaigns',_0xd83d('0x8c')));}_0x3ae0cb['push']('DROP\x20TABLE\x20'+tmp_campaigns+';');_0x3ae0cb[_0xd83d('0x42')]('DROP\x20TABLE\x20'+tmp_voice_queues+';');BPromise[_0xd83d('0x81')](_0x3ae0cb,handleQuery)['then'](function(_0x2db33c){stats[_0xd83d('0x8d')]=!![];stats['affectedRows']=_0x245063['duplicates']&&_0x245063[_0xd83d('0x86')][_0xd83d('0x4e')]?results[0x2][_0xd83d('0x8e')]:results[0x0]['affectedRows'];socket[_0xd83d('0x78')](_0xd83d('0x79')+_0x44cb7f,stats);fs['unlink'](_0x23a58a);fs[_0xd83d('0x8f')](_0x42cc68);process[_0xd83d('0x41')](0x0);})['catch'](function(_0x56f56b){logger[_0xd83d('0x47')](_0x56f56b[_0xd83d('0x40')]);process[_0xd83d('0x41')](0x1);});});});});}catch(_0x565f3a){logger[_0xd83d('0x47')](_0xd83d('0x90'),_0x565f3a[_0xd83d('0x40')]);process[_0xd83d('0x41')](0x1);}},'error':function(_0x2c63ab,_0x59d22b,_0x5013d1,_0x27336e){throw new Error(_0x27336e);}});}function validate(){if(process[_0xd83d('0x91')]&&process[_0xd83d('0x91')][_0xd83d('0x4e')]<0x4){throw new Error(_0xd83d('0x92'));}var _0x448735=path['join'](config[_0xd83d('0x5f')],_0xd83d('0x60'),process[_0xd83d('0x91')][0x2]);if(!fs['existsSync'](_0x448735)){throw new Error(_0xd83d('0x93'));}var _0x527413={};try{_0x527413=JSON['parse'](process[_0xd83d('0x91')][0x3]);if(!_0x527413[_0xd83d('0x5d')]){throw new Error(_0xd83d('0x94'));}if(!_0x527413[_0xd83d('0x5d')][_0xd83d('0x2f')]){throw new Error(_0xd83d('0x95'));}if(!_0x527413['binding'][_0xd83d('0x96')]){throw new Error(_0xd83d('0x97'));}var _0x3b8e8f=0x0;if(_0x527413[_0xd83d('0x5d')][_0xd83d('0x6f')]){_0x3b8e8f=0x1;}if(!_0x527413[_0xd83d('0x1e')]){throw new Error(_0xd83d('0x98'));}}catch(_0x3dc902){throw new Error(_0xd83d('0x99'));}var _0x1f0829=[];try{_0x1f0829=_[_0xd83d('0x9a')](JSON[_0xd83d('0x65')](process[_0xd83d('0x91')][0x4]),'id');}catch(_0x3fffbd){logger[_0xd83d('0x3e')](_0xd83d('0x9b'));}main(_0x448735,_0x527413,_0x1f0829,_0x3b8e8f);}validate();process['on'](_0xd83d('0x9c'),handleStop);process['on'](_0xd83d('0x9d'),handleUncaughtException);
\ No newline at end of file
+var _0xd405=['select','field','phone','join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','UserId','recallme','fields','from','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.ListId','cm_hopper_black','\x20=\x20?','.offset-cm_contacts.utcOffset\x20minute)','priority','cm_contacts.createdAt','ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','MIN(id)','group','Received\x20SIGINT','error','errors','push','code','info','sequelize','query','spread','message','campaigns.id','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','all','then','catch','voice_queues.id','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','length','dialTimezone','set','offset','stringify','send','binding','socket_timestamp','root','server/files/tmp','header','writeFileSync','parse','createReadStream','data','rows','hasOwnProperty','trim','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','timezones','isNil','utcOffset','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','SystemError','step','duplicates','cm_contacts_','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_',',\x20scheduledAt\x20=\x20NOW()','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','DROP\x20TABLE\x20','each','finish','affectedRows','unlink','exit','argv','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','defaults','redis','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xd405,0x128));var _0x5d40=function(_0x564821,_0x4d037e){_0x564821=_0x564821-0x0;var _0x2b604d=_0xd405[_0x564821];return _0x2b604d;};'use strict';var fs=require('fs');var path=require(_0x5d40('0x0'));var _=require(_0x5d40('0x1'));var Papa=require(_0x5d40('0x2'));var util=require(_0x5d40('0x3'));var BPromise=require(_0x5d40('0x4'));var moment=require(_0x5d40('0x5'));var squel=require(_0x5d40('0x6'));var Redis=require(_0x5d40('0x7'));var db=require(_0x5d40('0x8'))['db'];var config=require(_0x5d40('0x9'));var shared=require(_0x5d40('0xa'));var logger=require(_0x5d40('0xb'))(_0x5d40('0xc'));config['redis']=_[_0x5d40('0xd')](config[_0x5d40('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x5d40('0xf'))(new Redis(config[_0x5d40('0xe')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x5d40('0x10')](_0x5d40('0x11'));function isEmail(_0x192d8d){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'](_0x192d8d);}function selectNotIn(_0x3c0b47,_0x23ca9e,_0x1c0e66,_0x3ef73e,_0x5b71d8){return squel[_0x5d40('0x12')]()[_0x5d40('0x13')](_0x5d40('0x14'))['from'](_0x3ef73e)[_0x5d40('0x15')](_0x23ca9e,null,_0x23ca9e+_0x5d40('0x16')+_0x3ef73e+'.'+_0x1c0e66)['where'](_0x3ef73e+'.'+_0x1c0e66+'\x20=\x20'+_0x3c0b47+'.'+_0x1c0e66)[_0x5d40('0x17')](_0x23ca9e+_0x5d40('0x18')+_0x5b71d8['join']()+')');}function insertCmHopper(_0x4c19ce,_0x2e50ed,_0x3c437e,_0x3b79f5,_0xc66da8){var _0x4462c7=[_0x5d40('0x19'),_0x5d40('0x1a'),_0x5d40('0x1b'),'cm_contacts.ListId',_0x2e50ed+'.'+_0x3b79f5,'cm_contacts.createdAt',_0x5d40('0x1c'),_0x5d40('0x1d'),_0x5d40('0x1e'),'\x22'+_0xc66da8+'\x22'];return squel[_0x5d40('0x1f')]()[_0x5d40('0x20')](_0x5d40('0x21'))[_0x5d40('0x22')]([_0x5d40('0x14'),_0x5d40('0x23'),_0x5d40('0x24'),_0x5d40('0x25'),_0x3b79f5,_0x5d40('0x26'),_0x5d40('0x27'),'priority',_0x5d40('0x28'),_0x5d40('0x29')],squel['select']()[_0x5d40('0x2a')](_0x4462c7)[_0x5d40('0x2b')](_0x2e50ed)[_0x5d40('0x15')](_0x5d40('0x2c'),null,_0x5d40('0x2d')+_0x2e50ed+_0x5d40('0x2e'))['join'](_0x3c437e,null,_0x3c437e+_0x5d40('0x16')+_0x2e50ed+'.'+_0x3b79f5)[_0x5d40('0x17')](_0x2e50ed+_0x5d40('0x2f'),_0x4c19ce)[_0x5d40('0x17')](_0x5d40('0x30'),NOW)[_0x5d40('0x17')](_0x5d40('0x31'),selectNotIn(_0x2e50ed,_0x3c437e,_0x3b79f5,_0x5d40('0x21'),[_0x5d40('0x32'),_0x5d40('0x33')]))[_0x5d40('0x17')](_0x5d40('0x31'),selectNotIn(_0x2e50ed,_0x3c437e,_0x3b79f5,_0x5d40('0x21'),[_0x5d40('0x32')])))[_0x5d40('0x34')]();}function insertCmHopperBlack(_0x570c32,_0x3a8832,_0x497553,_0x584a8f){var _0x86d7f0=[_0x5d40('0x19'),'cm_contacts.id',_0x5d40('0x35'),_0x3a8832+'.'+_0x584a8f,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel[_0x5d40('0x1f')]()[_0x5d40('0x20')](_0x5d40('0x36'))[_0x5d40('0x22')]([_0x5d40('0x14'),'ContactId',_0x5d40('0x25'),_0x584a8f,'createdAt',_0x5d40('0x27')],squel[_0x5d40('0x12')]()[_0x5d40('0x2a')](_0x86d7f0)[_0x5d40('0x2b')](_0x3a8832)[_0x5d40('0x15')](_0x5d40('0x2c'),null,_0x5d40('0x2d')+_0x3a8832+'.CmListId')[_0x5d40('0x15')](_0x497553,null,_0x497553+_0x5d40('0x16')+_0x3a8832+'.'+_0x584a8f)[_0x5d40('0x17')](_0x3a8832+_0x5d40('0x2f'),_0x570c32)[_0x5d40('0x17')]('cm_contacts.createdAt\x20=\x20?',NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x5d40('0x12')]()[_0x5d40('0x13')](_0x5d40('0x14'))[_0x5d40('0x2b')]('cm_hopper_black')[_0x5d40('0x17')]('ListId\x20=\x20?',_0x570c32)[_0x5d40('0x17')](_0x584a8f+_0x5d40('0x37'),_0x3a8832+'.'+_0x584a8f)))[_0x5d40('0x34')]();}function insertTzCmHopper(_0x5d9a11,_0x121a9d,_0x55a704,_0x21bcdc,_0x2040b6,_0x3f1aa1){var _0x560d88=['cm_contacts.phone','date_add(cm_contacts.scheduledat,interval\x20'+_0x3f1aa1+_0x5d40('0x38'),_0x5d40('0x1b'),'cm_contacts.ListId',_0x121a9d+'.'+_0x21bcdc,'cm_contacts.createdAt','cm_contacts.updatedAt',_0x5d40('0x1d'),_0x5d40('0x1e'),'\x22'+_0x2040b6+'\x22'];var _0x211473=squel[_0x5d40('0x1f')]()[_0x5d40('0x20')](_0x5d40('0x21'))[_0x5d40('0x22')](['phone',_0x5d40('0x23'),_0x5d40('0x24'),_0x5d40('0x25'),_0x21bcdc,_0x5d40('0x26'),'updatedAt',_0x5d40('0x39'),_0x5d40('0x28'),'recallme'],squel[_0x5d40('0x12')]()[_0x5d40('0x2a')](_0x560d88)[_0x5d40('0x2b')](_0x121a9d)[_0x5d40('0x15')](_0x5d40('0x2c'),null,_0x5d40('0x2d')+_0x121a9d+_0x5d40('0x2e'))[_0x5d40('0x15')](_0x55a704,null,_0x55a704+'.id\x20=\x20'+_0x121a9d+'.'+_0x21bcdc)[_0x5d40('0x15')](_0x3f1aa1,null,_0x3f1aa1+_0x5d40('0x16')+_0x121a9d+'.'+_0x21bcdc)['where'](_0x121a9d+'.CmListId\x20=\x20?',_0x5d9a11)[_0x5d40('0x17')](_0x5d40('0x30'),NOW)[_0x5d40('0x17')](_0x5d40('0x31'),selectNotIn(_0x121a9d,_0x55a704,_0x21bcdc,_0x5d40('0x21'),['\x22always\x22',_0x5d40('0x33')]))[_0x5d40('0x17')](_0x5d40('0x31'),selectNotIn(_0x121a9d,_0x55a704,_0x21bcdc,_0x5d40('0x21'),[_0x5d40('0x32')])))[_0x5d40('0x34')]();return _0x211473;}function insertTzCmHopperBlack(_0x1f3c9a,_0x33504e,_0x5dd16b,_0x4d63e0){var _0x4735c0=['cm_contacts.phone',_0x5d40('0x1b'),_0x5d40('0x35'),_0x33504e+'.'+_0x4d63e0,_0x5d40('0x3a'),_0x5d40('0x1c')];return squel[_0x5d40('0x1f')]()['into'](_0x5d40('0x36'))['fromQuery']([_0x5d40('0x14'),'ContactId',_0x5d40('0x25'),_0x4d63e0,_0x5d40('0x26'),_0x5d40('0x27')],squel['select']()[_0x5d40('0x2a')](_0x4735c0)[_0x5d40('0x2b')](_0x33504e)[_0x5d40('0x15')](_0x5d40('0x2c'),null,'cm_contacts.ListId\x20=\x20'+_0x33504e+'.CmListId')[_0x5d40('0x15')](_0x5dd16b,null,_0x5dd16b+_0x5d40('0x16')+_0x33504e+'.'+_0x4d63e0)[_0x5d40('0x17')](_0x33504e+_0x5d40('0x2f'),_0x1f3c9a)[_0x5d40('0x17')](_0x5d40('0x30'),NOW)[_0x5d40('0x17')](_0x5d40('0x31'),squel[_0x5d40('0x12')]()['field'](_0x5d40('0x14'))[_0x5d40('0x2b')](_0x5d40('0x36'))[_0x5d40('0x17')](_0x5d40('0x3b'),_0x1f3c9a)[_0x5d40('0x17')](_0x4d63e0+'\x20=\x20?',_0x33504e+'.'+_0x4d63e0)))[_0x5d40('0x34')]();}function insertCmContact(_0x2e42a9,_0x5aeced,_0x5a6484,_0x407b24){var _0x478e14=_[_0x5d40('0x3c')](_[_0x5d40('0x3d')](_0x407b24),['ListId',_0x5d40('0x3e'),'createdAt',_0x5d40('0x27')]);return squel[_0x5d40('0x1f')]()[_0x5d40('0x20')](_0x5d40('0x2c'))['fromQuery'](_0x478e14,squel[_0x5d40('0x12')]()['fields'](_0x478e14)['from'](_0x5aeced)[_0x5d40('0x17')]('('+_0x5a6484[_0x5d40('0x15')](',')+_0x5d40('0x3f'),squel[_0x5d40('0x12')]()[_0x5d40('0x2a')](_0x5a6484)[_0x5d40('0x2b')](_0x5d40('0x2c'))[_0x5d40('0x17')](_0x5d40('0x3b'),_0x2e42a9)[_0x5d40('0x17')](_0x5d40('0x40')))[_0x5d40('0x17')]('id\x20IN\x20?',squel[_0x5d40('0x12')]()[_0x5d40('0x13')](_0x5d40('0x41'),'min_id')['from'](_0x5aeced)[_0x5d40('0x42')](_0x5a6484[_0x5d40('0x15')](','))))[_0x5d40('0x34')]();}function handleStop(){logger['info'](_0x5d40('0x43'));stopped=!![];}function handleUncaughtException(_0x3d9b05){logger[_0x5d40('0x44')](_0x3d9b05['message']);process['exit'](0x1);}function handleError(_0x2bf609,_0x15fcb2){stats[_0x5d40('0x45')][_0x5d40('0x46')]({'name':_0x15fcb2[_0x5d40('0x47')],'message':_0x15fcb2['message'],'row':_0x2bf609});}function handleQuery(_0x467aa8){logger[_0x5d40('0x48')](_0x467aa8);return db[_0x5d40('0x49')][_0x5d40('0x4a')](_0x467aa8)[_0x5d40('0x4b')](function(_0x386c9a){results[_0x5d40('0x46')](_0x386c9a);})['catch'](function(_0x5566dc){logger[_0x5d40('0x44')](_0x5566dc[_0x5d40('0x4c')]);});}function updateTzCampaigns(_0xbdaf7c){return new Promise(function(_0x37f984,_0x163f5){var _0x1ede1c=squel[_0x5d40('0x12')]()[_0x5d40('0x2a')]([_0x5d40('0x4d'),'campaigns.dialTimezone'])['from'](_0x5d40('0x4e'))[_0x5d40('0x15')](_0x5d40('0x4f'),null,_0x5d40('0x50'))[_0x5d40('0x17')](_0x5d40('0x51')+_0xbdaf7c);db[_0x5d40('0x49')][_0x5d40('0x4a')](_0x1ede1c[_0x5d40('0x34')]())['spread'](function(_0x1cc883){var _0x56721e=[];for(var _0x14b34e=0x0;_0x14b34e<_0x1cc883['length'];_0x14b34e++){_0x56721e['push'](getTimezoneData(_0x1cc883[_0x14b34e],tmp_campaigns));}BPromise[_0x5d40('0x52')](_0x56721e)[_0x5d40('0x53')](function(){_0x37f984({'val':0x1});});})[_0x5d40('0x54')](function(_0x24c890){logger[_0x5d40('0x44')](_0x24c890['message']);_0x37f984({'val':0x0});});});}function updateTzVoiceQueues(_0x27b051){return new Promise(function(_0x5b6328,_0x31f2b4){var _0x28a969=squel[_0x5d40('0x12')]()[_0x5d40('0x2a')]([_0x5d40('0x55'),'voice_queues.dialTimezone'])[_0x5d40('0x2b')]('voice_queues')[_0x5d40('0x15')](_0x5d40('0x56'),null,_0x5d40('0x57'))[_0x5d40('0x17')](_0x5d40('0x58')+_0x27b051);db['sequelize'][_0x5d40('0x4a')](_0x28a969['toString']())[_0x5d40('0x4b')](function(_0x43ae4d){var _0x5dc8c5=[];for(var _0xf52eed=0x0;_0xf52eed<_0x43ae4d[_0x5d40('0x59')];_0xf52eed++){_0x5dc8c5[_0x5d40('0x46')](getTimezoneData(_0x43ae4d[_0xf52eed],tmp_voice_queues));}BPromise['all'](_0x5dc8c5)[_0x5d40('0x53')](function(){_0x5b6328({'val':0x1});});})['catch'](function(_0xe87632){logger['error'](_0xe87632[_0x5d40('0x4c')]);_0x5b6328({'val':0x0});});});}function getTimezoneData(_0x5a5d02,_0x38ce4f){return new Promise(function(_0x4e0f5a,_0x4c807a){var _0x4262f6=shared['timezones'];var _0xdf1114=_0x4262f6[_0x5a5d02[_0x5d40('0x5a')]];if(_['isNil'](_0xdf1114)){_0x4e0f5a({'ret':0x1});}else{var _0x33efb3=_0xdf1114['utcOffset'];var _0xdd2dff=squel[_0x5d40('0x1f')]()[_0x5d40('0x20')](_0x38ce4f)[_0x5d40('0x5b')]('id',_0x5a5d02['id'])[_0x5d40('0x5b')](_0x5d40('0x5c'),_0x33efb3)[_0x5d40('0x5b')]('dialTimezone',_0x5a5d02['dialTimezone'])[_0x5d40('0x34')]();return db[_0x5d40('0x49')]['query'](_0xdd2dff)['spread'](function(_0x452f2c){_0x4e0f5a({'ret':0x1});})[_0x5d40('0x54')](function(_0x21e9a4){logger[_0x5d40('0x44')](_0x21e9a4[_0x5d40('0x4c')]);_0x4c807a({'ret':0x1});});}});}function handleTZQuery(_0x50d5ca){logger['info'](_0x50d5ca);return db[_0x5d40('0x49')][_0x5d40('0x4a')](_0x50d5ca)[_0x5d40('0x4b')](function(_0x557186){})['catch'](function(_0x401069){logger[_0x5d40('0x44')](_0x401069[_0x5d40('0x4c')]);});}function main(_0x29d290,_0x55ac80,_0x123b72,_0x26df53){logger[_0x5d40('0x48')]('main',_0x29d290,JSON[_0x5d40('0x5d')](_0x55ac80));process[_0x5d40('0x5e')]('start');var _0x5bc0eb=_0x55ac80[_0x5d40('0x5f')];var _0x54fe0a=_0x55ac80[_0x5d40('0x60')];var _0x5e8909=path[_0x5d40('0x15')](config[_0x5d40('0x61')],_0x5d40('0x62'),_0x54fe0a+'.csv');hasTZ=_['keys'](_0x5bc0eb)['includes'](_0x5d40('0x5a'));var _0x1da5dd=_[_0x5d40('0x3d')](_0x5bc0eb)[_0x5d40('0x15')]();logger[_0x5d40('0x48')](_0x5d40('0x63'),_0x1da5dd);if(hasTZ)_0x1da5dd+=',utcOffset';fs[_0x5d40('0x64')](_0x5e8909,_0x1da5dd+'\x0a');Papa[_0x5d40('0x65')](fs[_0x5d40('0x66')](_0x29d290),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1b42db,_0x2cc98e){try{for(var _0x40cb59=0x0,_0x233f60=[];_0x40cb59<_0x1b42db[_0x5d40('0x67')]['length'];_0x40cb59++){stats[_0x5d40('0x68')]+=0x1;if(_0x1b42db['errors'][_0x40cb59]){handleError(_0x1b42db[_0x5d40('0x67')][_0x40cb59],_0x1b42db['errors'][_0x40cb59]);}else{var _0x428c13=[];for(var _0x1e915e in _0x5bc0eb){if(_0x5bc0eb[_0x5d40('0x69')](_0x1e915e)){if(_0x1b42db['data'][_0x40cb59][_0x5bc0eb[_0x1e915e]]){var _0x124939=_[_0x5d40('0x6a')](_0x1b42db[_0x5d40('0x67')][_0x40cb59][_0x5bc0eb[_0x1e915e]]['replace'](/"/g,'\x27'));switch(_0x1e915e){case _0x5d40('0x23'):var _0x14f50a=moment(_0x124939,_0x5d40('0x11'),!![]);if(_0x14f50a[_0x5d40('0x6b')]()){_0x233f60['push']('\x22'+_0x124939+'\x22');}else{_0x428c13[_0x5d40('0x46')](_0x5d40('0x6c'));}break;case _0x5d40('0x39'):var _0x109e66=parseInt(_0x124939);_0x124939=_['isNaN'](_0x109e66)||_0x109e66<0x0||_0x109e66>0x4?_0x26df53?0x3:0x2:_0x109e66;_0x233f60[_0x5d40('0x46')]('\x22'+_0x124939+'\x22');break;case _0x5d40('0x28'):var _0x37225c=parseInt(_0x124939);if(_[_0x5d40('0x6d')](_0x37225c)&&_[_0x5d40('0x6e')](_0x123b72,_0x37225c)){_0x233f60['push']('\x22'+_0x37225c+'\x22');}else{_0x428c13[_0x5d40('0x46')](_0x5d40('0x6f'));}break;case _0x5d40('0x70'):if(isEmail(_0x124939)){_0x233f60[_0x5d40('0x46')]('\x22'+_0x124939+'\x22');}else{_0x428c13['push'](_0x5d40('0x71'));}break;case _0x5d40('0x72'):var _0x4d1dd9=moment(_0x124939,_0x5d40('0x73'),!![]);if(_0x4d1dd9[_0x5d40('0x6b')]()){_0x233f60[_0x5d40('0x46')]('\x22'+_0x124939+'\x22');}else{_0x428c13[_0x5d40('0x46')](_0x5d40('0x74'));}break;case'dialTimezone':var _0x4e7dfe=shared[_0x5d40('0x75')];var _0x1f204c=_0x4e7dfe[_0x124939];if(!_[_0x5d40('0x76')](_0x1f204c)){var _0x56f816=_0x1f204c[_0x5d40('0x77')];_0x233f60['push']('\x22'+_0x124939+'\x22');_0x233f60[_0x5d40('0x46')]('\x22'+_0x56f816+'\x22');}break;default:_0x233f60[_0x5d40('0x46')]('\x22'+_0x124939+'\x22');}}else{switch(_0x1e915e){case _0x5d40('0x78'):case'phone':_0x428c13[_0x5d40('0x46')](_0x1e915e+_0x5d40('0x79'));break;default:_0x233f60[_0x5d40('0x46')]('\x22\x22');}}}}if(_0x428c13[_0x5d40('0x59')]){handleError(_0x1b42db['data'][_0x40cb59],{'code':_0x5d40('0x7a'),'message':_0x428c13[_0x5d40('0x15')]()});}else{fs[_0x5d40('0x7b')](_0x5e8909,_0x233f60['join']()+'\x0a');}_0x233f60=[];}if(!(stats['rows']%0xc8)){socket[_0x5d40('0x7c')](_0x5d40('0x7d')+_0x54fe0a,stats);stats['errors']=[];}}if(stopped){logger['info'](_0x5d40('0x7e'));_0x2cc98e['abort']();}}catch(_0x300774){handleError(_0x1b42db[_0x5d40('0x67')][_0x40cb59],{'code':_0x5d40('0x7f'),'message':_0x300774[_0x5d40('0x4c')]});logger['error'](_0x5d40('0x80'),_0x300774['message']);}},'complete':function(){try{var _0x5550e0=[];var _0x556eed=[];var _0x1d3329='cm_contacts';if(_0x55ac80[_0x5d40('0x81')]&&_0x55ac80[_0x5d40('0x81')]['length']){_0x1d3329=_0x5d40('0x82')+_0x54fe0a;_0x5550e0[_0x5d40('0x46')]('CREATE\x20TABLE\x20'+_0x1d3329+_0x5d40('0x83'));}tmp_campaigns=_0x5d40('0x84')+_0x54fe0a;tmp_voice_queues=_0x5d40('0x85')+_0x54fe0a;_0x556eed[_0x5d40('0x46')]('CREATE\x20TABLE\x20'+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x556eed[_0x5d40('0x46')]('CREATE\x20TABLE\x20'+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise['each'](_0x556eed,handleTZQuery)[_0x5d40('0x53')](function(_0x476893){updateTzCampaigns(_0x55ac80[_0x5d40('0x25')])[_0x5d40('0x53')](function(_0x29f7d2){updateTzVoiceQueues(_0x55ac80[_0x5d40('0x25')])[_0x5d40('0x53')](function(_0x4f5790){var _0x3931e5=util[_0x5d40('0x10')]('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',_0x5e8909,_0x1d3329,_0x1da5dd,_0x55ac80[_0x5d40('0x25')],_0x55ac80[_0x5d40('0x3e')]||null,NOW,NOW);if(_[_0x5d40('0x76')](_0x5bc0eb[_0x5d40('0x23')])){_0x3931e5+=_0x5d40('0x86');}_0x5550e0['push'](_0x3931e5);if(_0x55ac80[_0x5d40('0x81')]&&_0x55ac80[_0x5d40('0x81')]['length']){_0x5550e0[_0x5d40('0x46')](insertCmContact(_0x55ac80[_0x5d40('0x25')],_0x1d3329,_0x55ac80[_0x5d40('0x81')],_0x5bc0eb));_0x5550e0[_0x5d40('0x46')]('DROP\x20TABLE\x20'+_0x1d3329+';');}if(hasTZ){_0x5550e0[_0x5d40('0x46')](insertTzCmHopper(_0x55ac80[_0x5d40('0x25')],_0x5d40('0x56'),_0x5d40('0x87'),_0x5d40('0x88'),_0x26df53,tmp_voice_queues));_0x5550e0[_0x5d40('0x46')](insertTzCmHopperBlack(_0x55ac80['ListId'],_0x5d40('0x89'),_0x5d40('0x87'),_0x5d40('0x88')));_0x5550e0[_0x5d40('0x46')](insertTzCmHopper(_0x55ac80['ListId'],'campaigns_has_cm_lists',_0x5d40('0x4e'),_0x5d40('0x8a'),_0x26df53,tmp_campaigns));_0x5550e0[_0x5d40('0x46')](insertTzCmHopperBlack(_0x55ac80[_0x5d40('0x25')],_0x5d40('0x8b'),_0x5d40('0x4e'),_0x5d40('0x8a')));}else{_0x5550e0[_0x5d40('0x46')](insertCmHopper(_0x55ac80[_0x5d40('0x25')],'voice_queues_has_cm_lists',_0x5d40('0x87'),_0x5d40('0x88'),_0x26df53));_0x5550e0[_0x5d40('0x46')](insertCmHopperBlack(_0x55ac80[_0x5d40('0x25')],_0x5d40('0x89'),_0x5d40('0x87'),'VoiceQueueId'));_0x5550e0[_0x5d40('0x46')](insertCmHopper(_0x55ac80['ListId'],_0x5d40('0x4f'),_0x5d40('0x4e'),'CampaignId',_0x26df53));_0x5550e0[_0x5d40('0x46')](insertCmHopperBlack(_0x55ac80['ListId'],_0x5d40('0x8b'),'campaigns',_0x5d40('0x8a')));}_0x5550e0[_0x5d40('0x46')](_0x5d40('0x8c')+tmp_campaigns+';');_0x5550e0[_0x5d40('0x46')](_0x5d40('0x8c')+tmp_voice_queues+';');BPromise[_0x5d40('0x8d')](_0x5550e0,handleQuery)[_0x5d40('0x53')](function(_0x238486){stats[_0x5d40('0x8e')]=!![];stats[_0x5d40('0x8f')]=_0x55ac80['duplicates']&&_0x55ac80[_0x5d40('0x81')][_0x5d40('0x59')]?results[0x2][_0x5d40('0x8f')]:results[0x0][_0x5d40('0x8f')];socket[_0x5d40('0x7c')]('contact:import:'+_0x54fe0a,stats);fs[_0x5d40('0x90')](_0x29d290);fs[_0x5d40('0x90')](_0x5e8909);process[_0x5d40('0x91')](0x0);})[_0x5d40('0x54')](function(_0xd2c3bb){logger[_0x5d40('0x44')](_0xd2c3bb[_0x5d40('0x4c')]);process[_0x5d40('0x91')](0x1);});});});});}catch(_0x135553){logger[_0x5d40('0x44')]('complete',_0x135553[_0x5d40('0x4c')]);process[_0x5d40('0x91')](0x1);}},'error':function(_0x3e0aae,_0x31398a,_0x254487,_0x3bd5ce){throw new Error(_0x3bd5ce);}});}function validate(){if(process[_0x5d40('0x92')]&&process[_0x5d40('0x92')][_0x5d40('0x59')]<0x4){throw new Error('arguments\x20<filename>\x20<parameters>\x20<agents>');}var _0x5e8733=path['join'](config[_0x5d40('0x61')],_0x5d40('0x62'),process[_0x5d40('0x92')][0x2]);if(!fs[_0x5d40('0x93')](_0x5e8733)){throw new Error(_0x5d40('0x94'));}var _0x4de050={};try{_0x4de050=JSON[_0x5d40('0x65')](process['argv'][0x3]);if(!_0x4de050['binding']){throw new Error(_0x5d40('0x95'));}if(!_0x4de050['binding'][_0x5d40('0x14')]){throw new Error(_0x5d40('0x96'));}if(!_0x4de050[_0x5d40('0x5f')][_0x5d40('0x78')]){throw new Error(_0x5d40('0x97'));}var _0x5955f0=0x0;if(_0x4de050[_0x5d40('0x5f')][_0x5d40('0x28')]){_0x5955f0=0x1;}if(!_0x4de050['ListId']){throw new Error(_0x5d40('0x98'));}}catch(_0x5b83a0){throw new Error(_0x5d40('0x99'));}var _0x226a27=[];try{_0x226a27=_[_0x5d40('0x9a')](JSON[_0x5d40('0x65')](process['argv'][0x4]),'id');}catch(_0x17e149){logger['info']('No\x20agent\x20available');}main(_0x5e8733,_0x4de050,_0x226a27,_0x5955f0);}validate();process['on'](_0x5d40('0x9b'),handleStop);process['on'](_0x5d40('0x9c'),handleUncaughtException);
\ No newline at end of file
index 3082c1b..a1fd196 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9370=['Outbound\x20Call','getDescriptions','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','Agent\x20Number','destcalleridnum','***\x20Time\x20Info\x20***','Agent\x20Ring','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','outbound','***\x20Call\x20Info\x20***','Called\x20Number','Member\x20Name','starttime','endtime','Duration','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','voice','toLowerCase','inbound','push','variable','queue'];(function(_0x3343d8,_0x1c65be){var _0x5024bc=function(_0x4271fe){while(--_0x4271fe){_0x3343d8['push'](_0x3343d8['shift']());}};_0x5024bc(++_0x1c65be);}(_0x9370,0x191));var _0x0937=function(_0x34ea6c,_0x4dc815){_0x34ea6c=_0x34ea6c-0x0;var _0x294121=_0x9370[_0x34ea6c];return _0x294121;};'use strict';exports[_0x0937('0x0')]=function(_0x1e928e,_0x2eaeac){var _0x391edc=[{'type':_0x0937('0x1'),'content':_0x0937('0x2'),'variableName':null}];switch(_0x1e928e['toLowerCase']()){case _0x0937('0x3'):switch(_0x2eaeac[_0x0937('0x4')]()){case _0x0937('0x5'):_0x391edc[_0x0937('0x6')]({'type':_0x0937('0x7'),'content':'','variableName':_0x0937('0x8')});_0x391edc[_0x0937('0x6')]({'type':_0x0937('0x7'),'content':'','variableName':'calleridnum'});break;case'outbound':_0x391edc['push']({'type':'string','content':_0x0937('0x9'),'variableName':null});_0x391edc[_0x0937('0x6')]({'type':_0x0937('0x7'),'content':'','variableName':'destcalleridnum'});break;}}return _0x391edc;};exports[_0x0937('0xa')]=function(_0x4c2f1c,_0x591a7d){var _0x43570c=[];switch(_0x4c2f1c[_0x0937('0x4')]()){case _0x0937('0x3'):switch(_0x591a7d[_0x0937('0x4')]()){case _0x0937('0x5'):_0x43570c=[{'type':_0x0937('0x1'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x0937('0xb'),'content':'','key':_0x0937('0xc'),'keyType':'variable','variableName':'calleridnum'},{'type':_0x0937('0xb'),'content':'','key':_0x0937('0xd'),'keyType':_0x0937('0x7'),'variableName':_0x0937('0xe')},{'type':_0x0937('0xb'),'content':'','key':_0x0937('0xf'),'keyType':_0x0937('0x7'),'variableName':_0x0937('0x10')},{'type':'keyValue','content':'','key':_0x0937('0x11'),'keyType':'variable','variableName':_0x0937('0x8')},{'type':_0x0937('0xb'),'content':'','key':_0x0937('0x12'),'keyType':_0x0937('0x7'),'variableName':_0x0937('0x13')},{'type':_0x0937('0xb'),'content':'','key':_0x0937('0x14'),'keyType':_0x0937('0x7'),'variableName':_0x0937('0x15')},{'type':'string','content':_0x0937('0x16'),'key':null,'keyType':null,'variableName':null},{'type':_0x0937('0xb'),'content':'','key':_0x0937('0x17'),'keyType':_0x0937('0x7'),'variableName':'destcalleridname'},{'type':_0x0937('0xb'),'content':'','key':_0x0937('0x18'),'keyType':_0x0937('0x7'),'variableName':_0x0937('0x19')},{'type':_0x0937('0x1'),'content':_0x0937('0x1a'),'key':null,'keyType':null,'variableName':null},{'type':_0x0937('0xb'),'content':'','key':_0x0937('0x1b'),'keyType':_0x0937('0x7'),'variableName':_0x0937('0x15')},{'type':_0x0937('0xb'),'content':'','key':'Agent\x20Connect','keyType':_0x0937('0x7'),'variableName':_0x0937('0x1c')},{'type':_0x0937('0xb'),'content':'','key':_0x0937('0x1d'),'keyType':_0x0937('0x7'),'variableName':_0x0937('0x1e')},{'type':_0x0937('0xb'),'content':'','key':_0x0937('0x1f'),'keyType':_0x0937('0x7'),'variableName':_0x0937('0x20')},{'type':_0x0937('0xb'),'content':'','key':'Talk\x20Time','keyType':_0x0937('0x7'),'variableName':'talktime'}];break;case _0x0937('0x21'):_0x43570c=[{'type':_0x0937('0x1'),'content':_0x0937('0x22'),'variableName':null},{'type':_0x0937('0xb'),'content':'','key':_0x0937('0x23'),'keyType':_0x0937('0x7'),'keyContent':'','variableName':_0x0937('0x19')},{'type':_0x0937('0xb'),'content':'','key':_0x0937('0x24'),'keyType':_0x0937('0x7'),'keyContent':'','variableName':'membername'},{'type':'keyValue','content':'','key':_0x0937('0x12'),'keyType':'variable','keyContent':'','variableName':_0x0937('0x13')},{'type':_0x0937('0xb'),'content':'','key':_0x0937('0x14'),'keyType':'variable','keyContent':'','variableName':_0x0937('0x25')},{'type':'string','content':_0x0937('0x1a')},{'type':_0x0937('0xb'),'content':'','key':'Answer\x20Time','keyType':'variable','keyContent':'','variableName':'answertime'},{'type':_0x0937('0xb'),'content':'','key':'Complete\x20Time','keyType':_0x0937('0x7'),'keyContent':'','variableName':_0x0937('0x26')},{'type':_0x0937('0xb'),'content':'','key':_0x0937('0x27'),'keyType':'variable','keyContent':'','variableName':'duration'},{'type':'keyValue','content':'','key':'Billable\x20Time','keyType':_0x0937('0x7'),'keyContent':'','variableName':_0x0937('0x28')}];break;}}return _0x43570c;};
\ No newline at end of file
+var _0x4353=['holdtime','talktime','outbound','***\x20Call\x20Info\x20***','Called\x20Number','Member\x20Name','UniqueId','Date','Answer\x20Time','answertime','Complete\x20Time','endtime','duration','Billable\x20Time','getSubjects','toLowerCase','voice','inbound','push','variable','calleridnum','Outbound\x20Call','getDescriptions','string','keyValue','Caller\x20Name','destexten','Queue','uniqueid','Agent\x20Name','destcalleridname','Agent\x20Number','destcalleridnum','Agent\x20Ring','agentcalledAt','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time'];(function(_0x2a1dd1,_0x3794df){var _0x132c45=function(_0x42b666){while(--_0x42b666){_0x2a1dd1['push'](_0x2a1dd1['shift']());}};_0x132c45(++_0x3794df);}(_0x4353,0x1c6));var _0x3435=function(_0x422d22,_0x2b8268){_0x422d22=_0x422d22-0x0;var _0x49e09b=_0x4353[_0x422d22];return _0x49e09b;};'use strict';exports[_0x3435('0x0')]=function(_0x861dae,_0x2e5ffc){var _0x5479cf=[{'type':'string','content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x861dae[_0x3435('0x1')]()){case _0x3435('0x2'):switch(_0x2e5ffc['toLowerCase']()){case _0x3435('0x3'):_0x5479cf[_0x3435('0x4')]({'type':_0x3435('0x5'),'content':'','variableName':'queue'});_0x5479cf[_0x3435('0x4')]({'type':_0x3435('0x5'),'content':'','variableName':_0x3435('0x6')});break;case'outbound':_0x5479cf[_0x3435('0x4')]({'type':'string','content':_0x3435('0x7'),'variableName':null});_0x5479cf[_0x3435('0x4')]({'type':_0x3435('0x5'),'content':'','variableName':'destcalleridnum'});break;}}return _0x5479cf;};exports[_0x3435('0x8')]=function(_0x549e9e,_0x4f0e14){var _0x48a572=[];switch(_0x549e9e[_0x3435('0x1')]()){case _0x3435('0x2'):switch(_0x4f0e14[_0x3435('0x1')]()){case _0x3435('0x3'):_0x48a572=[{'type':_0x3435('0x9'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x3435('0xa'),'content':'','key':'Caller\x20Number','keyType':_0x3435('0x5'),'variableName':_0x3435('0x6')},{'type':_0x3435('0xa'),'content':'','key':_0x3435('0xb'),'keyType':_0x3435('0x5'),'variableName':'calleridname'},{'type':'keyValue','content':'','key':'Call\x20To','keyType':'variable','variableName':_0x3435('0xc')},{'type':'keyValue','content':'','key':_0x3435('0xd'),'keyType':_0x3435('0x5'),'variableName':'queue'},{'type':_0x3435('0xa'),'content':'','key':'UniqueId','keyType':'variable','variableName':_0x3435('0xe')},{'type':_0x3435('0xa'),'content':'','key':'Date','keyType':'variable','variableName':'agentcalledAt'},{'type':_0x3435('0x9'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x3435('0xa'),'content':'','key':_0x3435('0xf'),'keyType':_0x3435('0x5'),'variableName':_0x3435('0x10')},{'type':'keyValue','content':'','key':_0x3435('0x11'),'keyType':_0x3435('0x5'),'variableName':_0x3435('0x12')},{'type':'string','content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x3435('0x13'),'keyType':_0x3435('0x5'),'variableName':_0x3435('0x14')},{'type':_0x3435('0xa'),'content':'','key':_0x3435('0x15'),'keyType':_0x3435('0x5'),'variableName':_0x3435('0x16')},{'type':_0x3435('0xa'),'content':'','key':_0x3435('0x17'),'keyType':_0x3435('0x5'),'variableName':_0x3435('0x18')},{'type':_0x3435('0xa'),'content':'','key':_0x3435('0x19'),'keyType':_0x3435('0x5'),'variableName':_0x3435('0x1a')},{'type':_0x3435('0xa'),'content':'','key':'Talk\x20Time','keyType':_0x3435('0x5'),'variableName':_0x3435('0x1b')}];break;case _0x3435('0x1c'):_0x48a572=[{'type':_0x3435('0x9'),'content':_0x3435('0x1d'),'variableName':null},{'type':_0x3435('0xa'),'content':'','key':_0x3435('0x1e'),'keyType':_0x3435('0x5'),'keyContent':'','variableName':_0x3435('0x12')},{'type':_0x3435('0xa'),'content':'','key':_0x3435('0x1f'),'keyType':_0x3435('0x5'),'keyContent':'','variableName':'membername'},{'type':_0x3435('0xa'),'content':'','key':_0x3435('0x20'),'keyType':'variable','keyContent':'','variableName':_0x3435('0xe')},{'type':'keyValue','content':'','key':_0x3435('0x21'),'keyType':_0x3435('0x5'),'keyContent':'','variableName':'starttime'},{'type':_0x3435('0x9'),'content':'***\x20Time\x20Info\x20***'},{'type':_0x3435('0xa'),'content':'','key':_0x3435('0x22'),'keyType':_0x3435('0x5'),'keyContent':'','variableName':_0x3435('0x23')},{'type':'keyValue','content':'','key':_0x3435('0x24'),'keyType':_0x3435('0x5'),'keyContent':'','variableName':_0x3435('0x25')},{'type':'keyValue','content':'','key':'Duration','keyType':'variable','keyContent':'','variableName':_0x3435('0x26')},{'type':_0x3435('0xa'),'content':'','key':_0x3435('0x27'),'keyType':_0x3435('0x5'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x48a572;};
\ No newline at end of file
index c5f0de6..884f2ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x08cb=['toLowerCase','toUpperCase','role','null','then','update','info','catch','error','tracked','user','clone','body','html','phone','fax','mobile','lodash','../../config/logger','openchannel-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown'];(function(_0x4a0e68,_0x45c08c){var _0x4fb274=function(_0x5f36b1){while(--_0x5f36b1){_0x4a0e68['push'](_0x4a0e68['shift']());}};_0x4fb274(++_0x45c08c);}(_0x08cb,0x163));var _0xb08c=function(_0x5ec25c,_0xe662f9){_0x5ec25c=_0x5ec25c-0x0;var _0x20bc8b=_0x08cb[_0x5ec25c];return _0x20bc8b;};'use strict';var _=require(_0xb08c('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0xb08c('0x1'))(_0xb08c('0x2')),'mail':require(_0xb08c('0x1'))('mail-interactions'),'fax':require(_0xb08c('0x1'))('fax-interactions'),'sms':require(_0xb08c('0x1'))(_0xb08c('0x3')),'chat':require('../../config/logger')(_0xb08c('0x4')),'whatsapp':require(_0xb08c('0x1'))(_0xb08c('0x5'))};function getInteractionId(_0x3874b0,_0x1ade14,_0xabae6d){if(_0x3874b0&&_0x3874b0[_[_0xb08c('0x6')](_0xabae6d)+_0xb08c('0x7')]){return _0x3874b0[_[_0xb08c('0x6')](_0xabae6d)+_0xb08c('0x7')];}else if(_0x3874b0&&_0x3874b0['id']){return _0x3874b0['id'];}else if(_0x1ade14&&_0x1ade14['id']){return _0x1ade14['id'];}else{return _0xb08c('0x8');}}function log(_0x521896,_0x2c1b2c,_0x3ba564,_0x3be1a7,_0x1f9695,_0x18b990){loggers[_0x1f9695[_0xb08c('0x9')]()][_0x521896]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x18b990[_0xb08c('0xa')](),_0x2c1b2c?_0x2c1b2c['id']:null,_0x2c1b2c?_0x2c1b2c['name']:null,_0x2c1b2c?_0x2c1b2c[_0xb08c('0xb')]:null,getInteractionId(_0x3ba564,_0x3be1a7,_0x1f9695),_0x3ba564?JSON['stringify'](_0x3ba564):_0xb08c('0xc'));}function updateUser(_0x40a195,_0x1035a8,_0x2b0d27,_0xe581cd,_0x1d8b8f){db[_[_0xb08c('0x6')](_0xe581cd)+'Interaction']['findOne']({'where':{'id':getInteractionId(_0x1035a8,_0x2b0d27,_0xe581cd)}})[_0xb08c('0xd')](function(_0x3a7113){if(_0x3a7113){return _0x3a7113[_0xb08c('0xe')]({'UserId':_0x40a195?_0x40a195['id']:null});}})[_0xb08c('0xd')](function(_0x236760){if(_0x236760){log(_0xb08c('0xf'),_0x40a195,_0x1035a8,_0x2b0d27,_0xe581cd,_0x1d8b8f);}})[_0xb08c('0x10')](function(){log(_0xb08c('0x11'),_0x40a195,_0x1035a8,_0x2b0d27,_0xe581cd,_0x1d8b8f);});}exports[_0xb08c('0x12')]=function(_0x455c7a,_0x1b8575){return function(_0x18a5c7,_0x153988,_0x19d5a8){var _0x5a4c46=_0x18a5c7[_0xb08c('0x13')];var _0x2a4771={};var _0xd5c76=_0x18a5c7['query'];if(_0x2a4771){_0x2a4771=_[_0xb08c('0x14')](_0x18a5c7[_0xb08c('0x15')]);_0x2a4771=_['omit'](_0x2a4771,['body',_0xb08c('0x16'),_0xb08c('0x17'),_0xb08c('0x18'),_0xb08c('0x19')]);}updateUser(_0x5a4c46,_0x2a4771,_0xd5c76,_0x455c7a,_0x1b8575);_0x19d5a8(null);};};
\ No newline at end of file
+var _0x2748=['[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','findOne','update','then','info','catch','error','user','query','body','html','phone','fax','../../mysqldb','../../config/logger','openchannel-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','unknown','toLowerCase'];(function(_0xf7ff4,_0x543a19){var _0x554e6a=function(_0x4b8192){while(--_0x4b8192){_0xf7ff4['push'](_0xf7ff4['shift']());}};_0x554e6a(++_0x543a19);}(_0x2748,0x154));var _0x8274=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x2748[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var db=require(_0x8274('0x0'))['db'];var loggers={'openchannel':require(_0x8274('0x1'))(_0x8274('0x2')),'mail':require('../../config/logger')('mail-interactions'),'fax':require('../../config/logger')(_0x8274('0x3')),'sms':require('../../config/logger')(_0x8274('0x4')),'chat':require('../../config/logger')(_0x8274('0x5')),'whatsapp':require('../../config/logger')(_0x8274('0x6'))};function getInteractionId(_0x1fde2b,_0xd2bcea,_0x27fb78){if(_0x1fde2b&&_0x1fde2b[_['upperFirst'](_0x27fb78)+'InteractionId']){return _0x1fde2b[_[_0x8274('0x7')](_0x27fb78)+'InteractionId'];}else if(_0x1fde2b&&_0x1fde2b['id']){return _0x1fde2b['id'];}else if(_0xd2bcea&&_0xd2bcea['id']){return _0xd2bcea['id'];}else{return _0x8274('0x8');}}function log(_0x2dd084,_0x1988c6,_0x4bbe43,_0xa5db2a,_0x29815d,_0x5dd26c){loggers[_0x29815d[_0x8274('0x9')]()][_0x2dd084](_0x8274('0xa'),_0x5dd26c[_0x8274('0xb')](),_0x1988c6?_0x1988c6['id']:null,_0x1988c6?_0x1988c6[_0x8274('0xc')]:null,_0x1988c6?_0x1988c6['role']:null,getInteractionId(_0x4bbe43,_0xa5db2a,_0x29815d),_0x4bbe43?JSON['stringify'](_0x4bbe43):'null');}function updateUser(_0x21b2e9,_0xa357aa,_0x3e0a29,_0x1b99b1,_0x16e469){db[_[_0x8274('0x7')](_0x1b99b1)+'Interaction'][_0x8274('0xd')]({'where':{'id':getInteractionId(_0xa357aa,_0x3e0a29,_0x1b99b1)}})['then'](function(_0x5c9900){if(_0x5c9900){return _0x5c9900[_0x8274('0xe')]({'UserId':_0x21b2e9?_0x21b2e9['id']:null});}})[_0x8274('0xf')](function(_0x144515){if(_0x144515){log(_0x8274('0x10'),_0x21b2e9,_0xa357aa,_0x3e0a29,_0x1b99b1,_0x16e469);}})[_0x8274('0x11')](function(){log(_0x8274('0x12'),_0x21b2e9,_0xa357aa,_0x3e0a29,_0x1b99b1,_0x16e469);});}exports['tracked']=function(_0x3c715d,_0x2b64da){return function(_0x4bcf78,_0x4cdfd5,_0x227ea8){var _0xd46d99=_0x4bcf78[_0x8274('0x13')];var _0x5ec07e={};var _0x4f3f63=_0x4bcf78[_0x8274('0x14')];if(_0x5ec07e){_0x5ec07e=_['clone'](_0x4bcf78[_0x8274('0x15')]);_0x5ec07e=_['omit'](_0x5ec07e,['body',_0x8274('0x16'),_0x8274('0x17'),_0x8274('0x18'),'mobile']);}updateUser(_0xd46d99,_0x5ec07e,_0x4f3f63,_0x3c715d,_0x2b64da);_0x227ea8(null);};};
\ No newline at end of file
index f04e14d..e28e5a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a79=['then','count','status','catch','User','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','hasOwnProperty','use','License'];(function(_0x5d2268,_0x18272b){var _0x2b9f4d=function(_0xbd1be8){while(--_0xbd1be8){_0x5d2268['push'](_0x5d2268['shift']());}};_0x2b9f4d(++_0x18272b);}(_0x3a79,0x157));var _0x93a7=function(_0x2270d6,_0x4b7a80){_0x2270d6=_0x2270d6-0x0;var _0x2fcf59=_0x3a79[_0x2270d6];return _0x2fcf59;};'use strict';var crypto=require(_0x93a7('0x0'));var util=require(_0x93a7('0x1'));var compose=require(_0x93a7('0x2'));var db=require(_0x93a7('0x3'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x1751e4,_0x3f22ce){if(_0x1751e4&&_0x3f22ce){if(_0x3f22ce[_0x93a7('0x4')]&&_0x3f22ce[_0x93a7('0x5')]){var _0x3aa68f=_0x3f22ce[_0x93a7('0x4')];var _0xdb8f70=_0x3f22ce[_0x93a7('0x5')];var _0x3abb8b=_0x3aa68f[_0x93a7('0x6')]('-')[0x4];var _0x14c5b7=_0x3aa68f[_0x93a7('0x6')]('-')[0x0];var _0x68d037=crypto[_0x93a7('0x7')](_0x93a7('0x8'),util[_0x93a7('0x9')](_0x93a7('0xa'),_0x3abb8b,_0x3aa68f,_0x14c5b7));var _0x2e87aa=_0x68d037[_0x93a7('0xb')](_0xdb8f70,_0x93a7('0xc'),_0x93a7('0xd'));_0x2e87aa+=_0x68d037['final'](_0x93a7('0xd'));var _0x1a90bb=JSON['parse'](_0x2e87aa);return _0x1a90bb[_0x93a7('0xe')](_0x1751e4)?_0x1a90bb[_0x1751e4]:null;}}return null;}function isLimit(_0x4a3ebc,_0x4a58fd,_0xa5e386,_0x2ce09c){var _0x2e9d56=_0x4a58fd;return compose()[_0x93a7('0xf')](function(_0x68b3aa,_0x52d4b5,_0x1e1095){return db[_0x93a7('0x10')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0x93a7('0x11')](function(_0x37005a){var _0x350937=getValueFromLicense(_0x4a3ebc,_0x37005a);return _0x350937?_0x350937:_0x2e9d56;})[_0x93a7('0x11')](function(_0x40d860){_0x2e9d56=_0x40d860;return _0xa5e386[_0x93a7('0x12')](_0x2ce09c);})['then'](function(_0x256089){if(_0x256089>=_0x2e9d56){return _0x52d4b5[_0x93a7('0x13')](0x193)['json']({'message':util[_0x93a7('0x9')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x4a3ebc)});}_0x1e1095();})[_0x93a7('0x14')](function(_0x178f28){_0x1e1095(_0x178f28);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x93a7('0x15')],{'where':{'$or':[{'role':'admin'},{'role':_0x93a7('0x16')}]}});}exports[_0x93a7('0x17')]=isUserLimit;
\ No newline at end of file
+var _0xe51e=['format','%s:%s:%s','update','base64','utf8','hasOwnProperty','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','admin','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','aes-256-ctr'];(function(_0x70588,_0x2e21dd){var _0x1981d8=function(_0x5bbfb6){while(--_0x5bbfb6){_0x70588['push'](_0x70588['shift']());}};_0x1981d8(++_0x2e21dd);}(_0xe51e,0x163));var _0xee51=function(_0x32cbe8,_0x375a4b){_0x32cbe8=_0x32cbe8-0x0;var _0xa0edab=_0xe51e[_0x32cbe8];return _0xa0edab;};'use strict';var crypto=require(_0xee51('0x0'));var util=require(_0xee51('0x1'));var compose=require(_0xee51('0x2'));var db=require(_0xee51('0x3'))['db'];var config=require(_0xee51('0x4'));function getValueFromLicense(_0x1d46b8,_0x4ce0a7){if(_0x1d46b8&&_0x4ce0a7){if(_0x4ce0a7[_0xee51('0x5')]&&_0x4ce0a7['license']){var _0x4729d8=_0x4ce0a7[_0xee51('0x5')];var _0x39e955=_0x4ce0a7[_0xee51('0x6')];var _0x100f0d=_0x4729d8[_0xee51('0x7')]('-')[0x4];var _0x35a4b3=_0x4729d8['split']('-')[0x0];var _0x50a006=crypto['createDecipher'](_0xee51('0x8'),util[_0xee51('0x9')](_0xee51('0xa'),_0x100f0d,_0x4729d8,_0x35a4b3));var _0x3802f6=_0x50a006[_0xee51('0xb')](_0x39e955,_0xee51('0xc'),_0xee51('0xd'));_0x3802f6+=_0x50a006['final'](_0xee51('0xd'));var _0x1c87be=JSON['parse'](_0x3802f6);return _0x1c87be[_0xee51('0xe')](_0x1d46b8)?_0x1c87be[_0x1d46b8]:null;}}return null;}function isLimit(_0x5eacdd,_0x5b3a38,_0x482d8b,_0x423dd6){var _0x530ffe=_0x5b3a38;return compose()[_0xee51('0xf')](function(_0x33bed4,_0x57da46,_0x5c72c8){return db[_0xee51('0x10')][_0xee51('0x11')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x5ba0f4){var _0x1365c4=getValueFromLicense(_0x5eacdd,_0x5ba0f4);return _0x1365c4?_0x1365c4:_0x530ffe;})[_0xee51('0x12')](function(_0x54f017){_0x530ffe=_0x54f017;return _0x482d8b[_0xee51('0x13')](_0x423dd6);})[_0xee51('0x12')](function(_0x39d316){if(_0x39d316>=_0x530ffe){return _0x57da46[_0xee51('0x14')](0x193)[_0xee51('0x15')]({'message':util[_0xee51('0x9')](_0xee51('0x16'),_0x5eacdd)});}_0x5c72c8();})[_0xee51('0x17')](function(_0x58f99d){_0x5c72c8(_0x58f99d);});});}function isUserLimit(){return isLimit('users',0x1,db[_0xee51('0x18')],{'where':{'$or':[{'role':_0xee51('0x19')},{'role':_0xee51('0x1a')}]}});}exports[_0xee51('0x1b')]=isUserLimit;
\ No newline at end of file
index 549a83b..09654c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0ee=['<=\x20?','$gte','>=\x20?','$in','$startsWith','start','utcOffset','seconds','moment','parseSearch','sqlOperator','and','replace','[$and]','[$or]','split','slice','shift','match','forEach','filter','map','push','DATE','operator','$eq','$between','value','includes','$lte','add','days','format','castTo','text','CAST(','field','\x20AS\x20','$notIn','\x20IS\x20NULL)','<>\x20?','$substring','$endsWith','LIKE\x20?','$lt','$gt','>\x20?'];(function(_0x1b4e0f,_0x305134){var _0x32edda=function(_0x15a6bd){while(--_0x15a6bd){_0x1b4e0f['push'](_0x1b4e0f['shift']());}};_0x32edda(++_0x305134);}(_0xe0ee,0x1de));var _0xee0e=function(_0x353b9d,_0x2c89df){_0x353b9d=_0x353b9d-0x0;var _0x22fde7=_0xe0ee[_0x353b9d];return _0x22fde7;};'use strict';var _=require('lodash');var moment=require(_0xee0e('0x0'));exports[_0xee0e('0x1')]=function(_0x463fcb){var _0x14e44c={'conditions':[]};_0x14e44c[_0xee0e('0x2')]=_['startsWith'](_0x463fcb,'[$or]')?'or':_0xee0e('0x3');var _0x4b6333=_0x463fcb[_0xee0e('0x4')](_0xee0e('0x5'),'')['replace'](_0xee0e('0x6'),'')[_0xee0e('0x7')]('||');for(var _0x50538c=0x0;_0x50538c<_0x4b6333['length'];_0x50538c++){var _0xcf54f7=_0x4b6333[_0x50538c][_0xee0e('0x7')](':=');var _0x5d1525=_0xcf54f7[0x0];var _0x2ab80a=_0xcf54f7[_0xee0e('0x8')](0x1);_0x2ab80a['forEach'](function(_0x22ada7){var _0x1b8fa8=_0x22ada7['split']('[')[_0xee0e('0x9')]();var _0x1b817e=_0x22ada7[_0xee0e('0xa')](/\[(.*?)\]/g);_0x1b817e[_0xee0e('0xb')](function(_0x2840f8){var _0x216123=_0x2840f8[_0xee0e('0x7')]('[')[_0xee0e('0xc')](function(_0x639f54){return _0x639f54['indexOf'](']')>-0x1;})[_0xee0e('0xd')](function(_0x291895){return _0x291895[_0xee0e('0x7')](']')[0x0];})[0x0];_0x14e44c['conditions'][_0xee0e('0xe')]({'field':_0x5d1525,'operator':_0x1b8fa8,'value':_0x216123});});});}return _0x14e44c;};exports['buildExpression']=function(_0x596727,_0x223d9a,_0x42421b){var _0x3f0716={};if(_0x223d9a===_0xee0e('0xf')){if(_0x42421b[_0xee0e('0x10')]===_0xee0e('0x11')){_0x42421b[_0xee0e('0x10')]=_0xee0e('0x12');_0x42421b[_0xee0e('0x13')]+=','+_0x42421b[_0xee0e('0x13')];}else if(_[_0xee0e('0x14')](['$gt',_0xee0e('0x15')],_0x42421b['operator'])){_0x42421b[_0xee0e('0x13')]=moment(_0x42421b[_0xee0e('0x13')])[_0xee0e('0x16')](0x1,_0xee0e('0x17'))[_0xee0e('0x18')]('YYYY-MM-DD');}}if(_0x42421b[_0xee0e('0x19')]){_0x223d9a=_0x42421b[_0xee0e('0x19')];_0x3f0716[_0xee0e('0x1a')]=_0xee0e('0x1b')+_0x596727+'.'+_0x42421b[_0xee0e('0x1c')]+_0xee0e('0x1d')+_0x42421b[_0xee0e('0x19')]+')\x20'+parseOperator(_0x42421b[_0xee0e('0x10')]);}else{_0x3f0716['text']=_0x596727+'.'+_0x42421b[_0xee0e('0x1c')]+'\x20'+parseOperator(_0x42421b[_0xee0e('0x10')]);}if(_[_0xee0e('0x14')](['$ne',_0xee0e('0x1e')],_0x42421b[_0xee0e('0x10')]))_0x3f0716[_0xee0e('0x1a')]='('+_0x3f0716[_0xee0e('0x1a')]+'\x20OR\x20'+_0x596727+'.'+_0x42421b[_0xee0e('0x1c')]+_0xee0e('0x1f');_0x3f0716[_0xee0e('0x13')]=parseValue(_0x223d9a,_0x42421b[_0xee0e('0x10')],_0x42421b[_0xee0e('0x13')]);return _0x3f0716;};function parseOperator(_0x1469ea){var _0x393e55;switch(_0x1469ea){case'$in':_0x393e55='IN\x20?';break;case _0xee0e('0x1e'):_0x393e55='NOT\x20IN\x20?';break;case _0xee0e('0x11'):_0x393e55='=\x20?';break;case'$ne':_0x393e55=_0xee0e('0x20');break;case _0xee0e('0x21'):case'$startsWith':case _0xee0e('0x22'):_0x393e55=_0xee0e('0x23');break;case _0xee0e('0x24'):_0x393e55='<\x20?';break;case _0xee0e('0x25'):_0x393e55=_0xee0e('0x26');break;case'$lte':_0x393e55=_0xee0e('0x27');break;case _0xee0e('0x28'):_0x393e55=_0xee0e('0x29');break;case _0xee0e('0x12'):_0x393e55='BETWEEN\x20?\x20AND\x20?';break;}return _0x393e55;}function parseValue(_0x411fbe,_0x5cac42,_0x10641c){var _0x4cf369={'start':undefined,'end':undefined};switch(_0x5cac42){case _0xee0e('0x2a'):case _0xee0e('0x1e'):_0x4cf369['start']=_0x10641c[_0xee0e('0x7')](',');break;case _0xee0e('0x21'):_0x4cf369['start']='%'+_0x10641c+'%';break;case _0xee0e('0x2b'):_0x4cf369[_0xee0e('0x2c')]=_0x10641c+'%';break;case'$endsWith':_0x4cf369[_0xee0e('0x2c')]='%'+_0x10641c;break;case _0xee0e('0x12'):var _0x132a89=_0x10641c[_0xee0e('0x7')](',');var _0x10641c=_0x132a89[_0xee0e('0x9')]();var _0x5212a6=_0x132a89['pop']();if(_0x411fbe===_0xee0e('0xf')){_0x10641c=moment(_0x10641c)[_0xee0e('0x2d')](0x0,!![])[_0xee0e('0x18')]();_0x5212a6=moment(_0x5212a6)[_0xee0e('0x2d')](0x0,!![])['add'](0x17,'hours')[_0xee0e('0x16')](0x3b,'minutes')[_0xee0e('0x16')](0x3b,_0xee0e('0x2e'))[_0xee0e('0x18')]();}_0x4cf369={'start':_0x10641c,'end':_0x5212a6};break;default:_0x4cf369[_0xee0e('0x2c')]=_0x10641c;break;}return _0x4cf369;}
\ No newline at end of file
+var _0x6650=['days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','$notIn','\x20IS\x20NULL)','=\x20?','$startsWith','$endsWith','$lt','<\x20?','>\x20?','<=\x20?','$gte','BETWEEN\x20?\x20AND\x20?','start','$substring','pop','utcOffset','hours','seconds','moment','sqlOperator','[$or]','and','replace','split','length','slice','shift','match','forEach','filter','map','conditions','push','DATE','$eq','$between','value','includes','$gt','$lte','operator','add'];(function(_0x11cc86,_0xcbcc26){var _0x57707b=function(_0x249df7){while(--_0x249df7){_0x11cc86['push'](_0x11cc86['shift']());}};_0x57707b(++_0xcbcc26);}(_0x6650,0x114));var _0x0665=function(_0x365319,_0xf36a96){_0x365319=_0x365319-0x0;var _0x2c2284=_0x6650[_0x365319];return _0x2c2284;};'use strict';var _=require('lodash');var moment=require(_0x0665('0x0'));exports['parseSearch']=function(_0x54a79c){var _0x1cdf73={'conditions':[]};_0x1cdf73[_0x0665('0x1')]=_['startsWith'](_0x54a79c,_0x0665('0x2'))?'or':_0x0665('0x3');var _0x283a9e=_0x54a79c[_0x0665('0x4')]('[$and]','')[_0x0665('0x4')](_0x0665('0x2'),'')[_0x0665('0x5')]('||');for(var _0x220901=0x0;_0x220901<_0x283a9e[_0x0665('0x6')];_0x220901++){var _0x179bae=_0x283a9e[_0x220901][_0x0665('0x5')](':=');var _0x5a0f39=_0x179bae[0x0];var _0x42b6e0=_0x179bae[_0x0665('0x7')](0x1);_0x42b6e0['forEach'](function(_0x1bb412){var _0x406162=_0x1bb412[_0x0665('0x5')]('[')[_0x0665('0x8')]();var _0x594df4=_0x1bb412[_0x0665('0x9')](/\[(.*?)\]/g);_0x594df4[_0x0665('0xa')](function(_0x1770be){var _0x33823d=_0x1770be['split']('[')[_0x0665('0xb')](function(_0x40a882){return _0x40a882['indexOf'](']')>-0x1;})[_0x0665('0xc')](function(_0x2f59c6){return _0x2f59c6[_0x0665('0x5')](']')[0x0];})[0x0];_0x1cdf73[_0x0665('0xd')][_0x0665('0xe')]({'field':_0x5a0f39,'operator':_0x406162,'value':_0x33823d});});});}return _0x1cdf73;};exports['buildExpression']=function(_0x3c885d,_0x1b82a8,_0x2c22ff){var _0x2045b0={};if(_0x1b82a8===_0x0665('0xf')){if(_0x2c22ff['operator']===_0x0665('0x10')){_0x2c22ff['operator']=_0x0665('0x11');_0x2c22ff[_0x0665('0x12')]+=','+_0x2c22ff['value'];}else if(_[_0x0665('0x13')]([_0x0665('0x14'),_0x0665('0x15')],_0x2c22ff[_0x0665('0x16')])){_0x2c22ff[_0x0665('0x12')]=moment(_0x2c22ff[_0x0665('0x12')])[_0x0665('0x17')](0x1,_0x0665('0x18'))[_0x0665('0x19')](_0x0665('0x1a'));}}if(_0x2c22ff[_0x0665('0x1b')]){_0x1b82a8=_0x2c22ff[_0x0665('0x1b')];_0x2045b0[_0x0665('0x1c')]=_0x0665('0x1d')+_0x3c885d+'.'+_0x2c22ff[_0x0665('0x1e')]+_0x0665('0x1f')+_0x2c22ff[_0x0665('0x1b')]+')\x20'+parseOperator(_0x2c22ff['operator']);}else{_0x2045b0[_0x0665('0x1c')]=_0x3c885d+'.'+_0x2c22ff[_0x0665('0x1e')]+'\x20'+parseOperator(_0x2c22ff['operator']);}if(_[_0x0665('0x13')]([_0x0665('0x20'),_0x0665('0x21')],_0x2c22ff[_0x0665('0x16')]))_0x2045b0[_0x0665('0x1c')]='('+_0x2045b0[_0x0665('0x1c')]+'\x20OR\x20'+_0x3c885d+'.'+_0x2c22ff[_0x0665('0x1e')]+_0x0665('0x22');_0x2045b0['value']=parseValue(_0x1b82a8,_0x2c22ff[_0x0665('0x16')],_0x2c22ff['value']);return _0x2045b0;};function parseOperator(_0x4cf192){var _0x3960e3;switch(_0x4cf192){case'$in':_0x3960e3='IN\x20?';break;case _0x0665('0x21'):_0x3960e3='NOT\x20IN\x20?';break;case'$eq':_0x3960e3=_0x0665('0x23');break;case'$ne':_0x3960e3='<>\x20?';break;case'$substring':case _0x0665('0x24'):case _0x0665('0x25'):_0x3960e3='LIKE\x20?';break;case _0x0665('0x26'):_0x3960e3=_0x0665('0x27');break;case _0x0665('0x14'):_0x3960e3=_0x0665('0x28');break;case _0x0665('0x15'):_0x3960e3=_0x0665('0x29');break;case _0x0665('0x2a'):_0x3960e3='>=\x20?';break;case _0x0665('0x11'):_0x3960e3=_0x0665('0x2b');break;}return _0x3960e3;}function parseValue(_0x472896,_0x46621f,_0x1917f8){var _0x2dc058={'start':undefined,'end':undefined};switch(_0x46621f){case'$in':case'$notIn':_0x2dc058[_0x0665('0x2c')]=_0x1917f8['split'](',');break;case _0x0665('0x2d'):_0x2dc058['start']='%'+_0x1917f8+'%';break;case _0x0665('0x24'):_0x2dc058[_0x0665('0x2c')]=_0x1917f8+'%';break;case'$endsWith':_0x2dc058['start']='%'+_0x1917f8;break;case _0x0665('0x11'):var _0x31788d=_0x1917f8[_0x0665('0x5')](',');var _0x1917f8=_0x31788d[_0x0665('0x8')]();var _0x16ec4d=_0x31788d[_0x0665('0x2e')]();if(_0x472896==='DATE'){_0x1917f8=moment(_0x1917f8)[_0x0665('0x2f')](0x0,!![])['format']();_0x16ec4d=moment(_0x16ec4d)['utcOffset'](0x0,!![])[_0x0665('0x17')](0x17,_0x0665('0x30'))[_0x0665('0x17')](0x3b,'minutes')[_0x0665('0x17')](0x3b,_0x0665('0x31'))[_0x0665('0x19')]();}_0x2dc058={'start':_0x1917f8,'end':_0x16ec4d};break;default:_0x2dc058[_0x0665('0x2c')]=_0x1917f8;break;}return _0x2dc058;}
\ No newline at end of file
index 6d5a171..a3de437 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc7a3=['split','filters','forOwn','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','isArray','limit','sort','map','indexOf','cast','priority','substr','DESC','col','unsigned','ASC','omit','isEmpty','length','isObject','isString','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','push','join','getOptions','query','$id','model','intersection','attributes','nolimit','offset','order','where','pick','object','filter','value','merge','VIRTUAL','lower','options','sequelize','moment','parse','keys','includes','fields'];(function(_0xe3f51f,_0x4d9980){var _0x5e50c0=function(_0x51a100){while(--_0x51a100){_0xe3f51f['push'](_0xe3f51f['shift']());}};_0x5e50c0(++_0x4d9980);}(_0xc7a3,0xbd));var _0x3c7a=function(_0x3777b7,_0x549418){_0x3777b7=_0x3777b7-0x0;var _0x5c0990=_0xc7a3[_0x3777b7];return _0x5c0990;};'use strict';var _=require('lodash');var sequelize=require(_0x3c7a('0x0'));var moment=require(_0x3c7a('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x73d51f){var _0x12f959=['ne'];try{var _0x283aed=JSON[_0x3c7a('0x2')](_0x73d51f);var _0x4e0aaa=Object[_0x3c7a('0x3')](_0x283aed)[0x0];return _0x12f959[_0x3c7a('0x4')](_0x4e0aaa);}catch(_0x5b06db){return![];}}function getOperatorValue(_0x9c6b1a){var _0x2051ce=JSON[_0x3c7a('0x2')](_0x9c6b1a);var _0x48e820=Object[_0x3c7a('0x3')](_0x2051ce)[0x0];var _0x4f0608=_0x2051ce[_0x48e820];return{['$'+_0x48e820]:_0x4f0608};}exports[_0x3c7a('0x5')]=function(_0x5a6fbf){var _0xf7733d=null;if(_0x5a6fbf){_0xf7733d=_0x5a6fbf[_0x3c7a('0x6')](',');}return _0xf7733d;};exports[_0x3c7a('0x7')]=function(_0x5902a0,_0x32633f){var _0x314593={};if(!_['isEmpty'](_0x5902a0)){_[_0x3c7a('0x8')](_0x5902a0,function(_0x4d4dbb,_0x3bc093){try{if(_0x32633f){var _0x4e5413=_[_0x3c7a('0x9')](_0x32633f,{'name':_0x3bc093})||{};if(hasSequelizeOperator(_0x4d4dbb)){_0x314593[_0x3bc093]=getOperatorValue(_0x4d4dbb);}else if(_0x4e5413[_0x3c7a('0xa')]===_0x3c7a('0xb')&&_[_0x3c7a('0xc')](_0x4d4dbb)){var _0x3d47c3=JSON['parse'](_0x4d4dbb);var _0x321e1b={'$gte':moment(moment(_0x3d47c3[_0x3c7a('0xd')])[_0x3c7a('0xe')](_0x3c7a('0xf')))[_0x3c7a('0x10')]()['format'](),'$lte':moment(moment(_0x3d47c3[_0x3c7a('0x11')])[_0x3c7a('0xe')]('YYYY-MM-DD'))['utc']()[_0x3c7a('0x12')](0x1,'s')[_0x3c7a('0xe')]()};_0x314593[_0x3bc093]=_0x321e1b;}else if(_0x4e5413[_0x3c7a('0x13')]==='uniqueid'){_0x314593[_0x3bc093]=_0x4d4dbb;}else{_0x314593[_0x3bc093]=_[_0x3c7a('0x14')](_0x4d4dbb)?_0x4d4dbb:JSON['parse'](_0x4d4dbb);}}else{_0x314593[_0x3bc093]=_[_0x3c7a('0x14')](_0x4d4dbb)?_0x4d4dbb:JSON[_0x3c7a('0x2')](_0x4d4dbb);}}catch(_0x36e8c2){_0x314593[_0x3bc093]=_0x4d4dbb[_0x3c7a('0x6')](',');}});}return _0x314593;};exports[_0x3c7a('0x15')]=function(_0x185df4){_0x185df4=parseInt(_0x185df4,0xa);if(!_0x185df4||_0x185df4<0x0){_0x185df4=LIMIT_VALUE;}return _0x185df4;};exports['offset']=function(_0x1a11ef){_0x1a11ef=parseInt(_0x1a11ef,0xa);if(!_0x1a11ef||_0x1a11ef<0x0){_0x1a11ef=0x0;}return _0x1a11ef;};exports[_0x3c7a('0x16')]=function(_0x3f0024){var _0xbe7a8f,_0x3a79e3=null;if(_0x3f0024){_0xbe7a8f=_0x3f0024[_0x3c7a('0x6')](',');_0x3a79e3=_[_0x3c7a('0x17')](_0xbe7a8f,function(_0x34f4a6){if(_0x34f4a6[_0x3c7a('0x18')]('-')===0x0){return[_0x34f4a6==='priority'?sequelize[_0x3c7a('0x19')](sequelize['col'](_0x3c7a('0x1a')),'unsigned'):_0x34f4a6[_0x3c7a('0x1b')](0x1),_0x3c7a('0x1c')];}else{return[_0x34f4a6===_0x3c7a('0x1a')?sequelize[_0x3c7a('0x19')](sequelize[_0x3c7a('0x1d')](_0x3c7a('0x1a')),_0x3c7a('0x1e')):_0x34f4a6,_0x3c7a('0x1f')];}});}return _0x3a79e3;};exports[_0x3c7a('0x20')]=function(_0x42bcbe,_0x2cc413){if(_[_0x3c7a('0x21')](_0x42bcbe)){return _0x42bcbe;}if(_['isArray'](_0x42bcbe)){for(var _0x3984a1=0x0;_0x3984a1<_0x42bcbe[_0x3c7a('0x22')];_0x3984a1+=0x1){_0x42bcbe[_0x3984a1]=this[_0x3c7a('0x20')](_0x42bcbe[_0x3984a1],_0x2cc413);}return _0x42bcbe;}if(!_[_0x3c7a('0x23')](_0x42bcbe)){return _0x42bcbe;}if(_[_0x3c7a('0x24')](_0x2cc413)){_0x2cc413=[_0x2cc413];}if(!_[_0x3c7a('0x14')](_0x2cc413)){return _0x42bcbe;}for(var _0x2c000f=0x0;_0x2c000f<_0x2cc413[_0x3c7a('0x22')];_0x2c000f+=0x1){_['unset'](_0x42bcbe,_0x2cc413[_0x2c000f]);}for(var _0x33b72d in _0x42bcbe){if(_0x42bcbe[_0x3c7a('0x25')](_0x33b72d)){_0x42bcbe[_0x33b72d]=this[_0x3c7a('0x20')](_0x42bcbe[_0x33b72d],_0x2cc413);}}return _0x42bcbe;};exports[_0x3c7a('0x26')]=function(_0x33065b){return _0x33065b[_0x3c7a('0x27')](RegExp(_0x3c7a('0x28')))?!![]:![];};exports[_0x3c7a('0x29')]=function(_0x508d2e){return _0x508d2e[_0x3c7a('0x27')](/^\S+@\S+$/)?!![]:![];};exports[_0x3c7a('0x2a')]=function(_0x2fe0de){var _0x18a346=[];_0x2fe0de[_0x3c7a('0x6')](/[ ,]+/)[_0x3c7a('0x2b')](function(_0x2d873b){_0x2d873b=_0x2d873b[_0x3c7a('0x2c')](/([^:]")"+/g,'$1');_0x2d873b='+'+_0x2d873b+'*';var _0x1b6171=/[ `!@#$%^&*()_\-?~]/;if(_0x2d873b[_0x3c7a('0x27')](_0x1b6171))_0x2d873b='\x22'+_0x2d873b+'\x22';_0x18a346[_0x3c7a('0x2d')](_0x2d873b);});return _0x18a346[_0x3c7a('0x2e')]('\x20');};exports[_0x3c7a('0x2f')]=function(_0x5dab5f,_0x48bbd8,_0x5e9176){var _0x56247c={},_0x3d0201={};if(_0x48bbd8[_0x3c7a('0x30')][_0x3c7a('0x31')]){_0x48bbd8[_0x3c7a('0x30')]['id']=_0x48bbd8[_0x3c7a('0x30')][_0x3c7a('0x31')];delete _0x48bbd8[_0x3c7a('0x30')][_0x3c7a('0x31')];}_0x56247c[_0x3c7a('0x32')]=_[_0x3c7a('0x17')](_0x5dab5f,_0x3c7a('0x13'));_0x56247c[_0x3c7a('0x30')]=_[_0x3c7a('0x3')](_0x48bbd8[_0x3c7a('0x30')]);_0x56247c['filters']=_[_0x3c7a('0x33')](_0x56247c[_0x3c7a('0x32')],_0x56247c['query']);_0x3d0201[_0x3c7a('0x34')]=_['intersection'](_0x56247c[_0x3c7a('0x32')],this[_0x3c7a('0x5')](_0x48bbd8['query'][_0x3c7a('0x5')]));_0x3d0201[_0x3c7a('0x34')]=_0x3d0201[_0x3c7a('0x34')][_0x3c7a('0x22')]?_0x3d0201[_0x3c7a('0x34')]:_0x56247c[_0x3c7a('0x32')];if(!_0x48bbd8[_0x3c7a('0x30')][_0x3c7a('0x25')](_0x3c7a('0x35'))){_0x3d0201[_0x3c7a('0x15')]=this['limit'](_0x48bbd8[_0x3c7a('0x30')][_0x3c7a('0x15')]);_0x3d0201[_0x3c7a('0x36')]=this[_0x3c7a('0x36')](_0x48bbd8[_0x3c7a('0x30')][_0x3c7a('0x36')]);}_0x3d0201[_0x3c7a('0x37')]=this[_0x3c7a('0x16')](_0x48bbd8['query'][_0x3c7a('0x16')]);_0x3d0201[_0x3c7a('0x38')]=this['filters'](_[_0x3c7a('0x39')](_0x48bbd8['query'],_0x56247c['filters']),_0x5dab5f);if(_0x48bbd8['query']['filter']){var _0x44e935=_0x5dab5f;var _0x2b845a=_0x48bbd8[_0x3c7a('0x30')]['filter'];if(typeof _0x2b845a===_0x3c7a('0x3a')){_0x44e935=_[_0x3c7a('0x3b')](_0x5dab5f,function(_0x5239a1){return _['includes'](_0x2b845a['columns'],_0x5239a1[_0x3c7a('0x13')]);});_0x2b845a=_0x2b845a[_0x3c7a('0x3c')];}_0x3d0201[_0x3c7a('0x38')]=_[_0x3c7a('0x3d')](_0x3d0201[_0x3c7a('0x38')],{'$or':_[_0x3c7a('0x17')](_0x44e935,function(_0x3f6060){if(_0x3f6060[_0x3c7a('0xa')]!==_0x3c7a('0x3e')){if(_0x5e9176){return sequelize[_0x3c7a('0x38')](sequelize['fn'](_0x3c7a('0x3f'),sequelize[_0x3c7a('0x1d')](_0x3f6060[_0x3c7a('0x13')])),{'$like':sequelize['fn'](_0x3c7a('0x3f'),'%'+_0x48bbd8[_0x3c7a('0x30')]['filter']+'%')});}else{var _0x3a9ec6={};_0x3a9ec6[_0x3f6060[_0x3c7a('0x13')]]={'$like':'%'+_0x48bbd8['query']['filter']+'%'};return _0x3a9ec6;}}})});}_0x3d0201=_['merge']({},_0x3d0201,_0x48bbd8[_0x3c7a('0x40')]);return _0x3d0201;};
\ No newline at end of file
+var _0x25fa=['order','sort','where','filters','pick','filter','object','includes','columns','VIRTUAL','lower','merge','options','lodash','moment','parse','keys','fields','split','isEmpty','forOwn','find','type','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','uniqueid','isArray','limit','offset','map','indexOf','cast','col','priority','unsigned','DESC','ASC','omit','length','isObject','unset','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','push','join','getOptions','$id','query','model','name','intersection','attributes','hasOwnProperty','nolimit'];(function(_0x4bd102,_0x296052){var _0x2dbbd6=function(_0x735f9c){while(--_0x735f9c){_0x4bd102['push'](_0x4bd102['shift']());}};_0x2dbbd6(++_0x296052);}(_0x25fa,0x109));var _0xa25f=function(_0x790f4,_0x17d23d){_0x790f4=_0x790f4-0x0;var _0x56e6c9=_0x25fa[_0x790f4];return _0x56e6c9;};'use strict';var _=require(_0xa25f('0x0'));var sequelize=require('sequelize');var moment=require(_0xa25f('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x37129d){var _0x57e272=['ne'];try{var _0x408155=JSON[_0xa25f('0x2')](_0x37129d);var _0x256155=Object['keys'](_0x408155)[0x0];return _0x57e272['includes'](_0x256155);}catch(_0x2e8499){return![];}}function getOperatorValue(_0x50dafc){var _0x2ea9ea=JSON[_0xa25f('0x2')](_0x50dafc);var _0x29666d=Object[_0xa25f('0x3')](_0x2ea9ea)[0x0];var _0x22982b=_0x2ea9ea[_0x29666d];return{['$'+_0x29666d]:_0x22982b};}exports[_0xa25f('0x4')]=function(_0x64bbbf){var _0x25445a=null;if(_0x64bbbf){_0x25445a=_0x64bbbf[_0xa25f('0x5')](',');}return _0x25445a;};exports['filters']=function(_0x1bca18,_0x31bd1d){var _0x507a36={};if(!_[_0xa25f('0x6')](_0x1bca18)){_[_0xa25f('0x7')](_0x1bca18,function(_0x1f65b3,_0x22df56){try{if(_0x31bd1d){var _0x5168c1=_[_0xa25f('0x8')](_0x31bd1d,{'name':_0x22df56})||{};if(hasSequelizeOperator(_0x1f65b3)){_0x507a36[_0x22df56]=getOperatorValue(_0x1f65b3);}else if(_0x5168c1[_0xa25f('0x9')]==='DATE'&&_[_0xa25f('0xa')](_0x1f65b3)){var _0x465e41=JSON['parse'](_0x1f65b3);var _0x41280c={'$gte':moment(moment(_0x465e41[_0xa25f('0xb')])[_0xa25f('0xc')](_0xa25f('0xd')))[_0xa25f('0xe')]()[_0xa25f('0xc')](),'$lte':moment(moment(_0x465e41[_0xa25f('0xf')])[_0xa25f('0xc')](_0xa25f('0xd')))[_0xa25f('0xe')]()[_0xa25f('0x10')](0x1,'s')[_0xa25f('0xc')]()};_0x507a36[_0x22df56]=_0x41280c;}else if(_0x5168c1['name']===_0xa25f('0x11')){_0x507a36[_0x22df56]=_0x1f65b3;}else{_0x507a36[_0x22df56]=_[_0xa25f('0x12')](_0x1f65b3)?_0x1f65b3:JSON[_0xa25f('0x2')](_0x1f65b3);}}else{_0x507a36[_0x22df56]=_[_0xa25f('0x12')](_0x1f65b3)?_0x1f65b3:JSON[_0xa25f('0x2')](_0x1f65b3);}}catch(_0x427105){_0x507a36[_0x22df56]=_0x1f65b3['split'](',');}});}return _0x507a36;};exports[_0xa25f('0x13')]=function(_0x5a2d5c){_0x5a2d5c=parseInt(_0x5a2d5c,0xa);if(!_0x5a2d5c||_0x5a2d5c<0x0){_0x5a2d5c=LIMIT_VALUE;}return _0x5a2d5c;};exports[_0xa25f('0x14')]=function(_0x562573){_0x562573=parseInt(_0x562573,0xa);if(!_0x562573||_0x562573<0x0){_0x562573=0x0;}return _0x562573;};exports['sort']=function(_0x7daeda){var _0x489c83,_0x46bb31=null;if(_0x7daeda){_0x489c83=_0x7daeda[_0xa25f('0x5')](',');_0x46bb31=_[_0xa25f('0x15')](_0x489c83,function(_0x3c2665){if(_0x3c2665[_0xa25f('0x16')]('-')===0x0){return[_0x3c2665==='priority'?sequelize[_0xa25f('0x17')](sequelize[_0xa25f('0x18')](_0xa25f('0x19')),_0xa25f('0x1a')):_0x3c2665['substr'](0x1),_0xa25f('0x1b')];}else{return[_0x3c2665===_0xa25f('0x19')?sequelize[_0xa25f('0x17')](sequelize[_0xa25f('0x18')]('priority'),_0xa25f('0x1a')):_0x3c2665,_0xa25f('0x1c')];}});}return _0x46bb31;};exports[_0xa25f('0x1d')]=function(_0x317f0c,_0x5d93a9){if(_[_0xa25f('0x6')](_0x317f0c)){return _0x317f0c;}if(_[_0xa25f('0x12')](_0x317f0c)){for(var _0x53f011=0x0;_0x53f011<_0x317f0c[_0xa25f('0x1e')];_0x53f011+=0x1){_0x317f0c[_0x53f011]=this['omit'](_0x317f0c[_0x53f011],_0x5d93a9);}return _0x317f0c;}if(!_[_0xa25f('0x1f')](_0x317f0c)){return _0x317f0c;}if(_['isString'](_0x5d93a9)){_0x5d93a9=[_0x5d93a9];}if(!_[_0xa25f('0x12')](_0x5d93a9)){return _0x317f0c;}for(var _0x2448f4=0x0;_0x2448f4<_0x5d93a9['length'];_0x2448f4+=0x1){_[_0xa25f('0x20')](_0x317f0c,_0x5d93a9[_0x2448f4]);}for(var _0x1412b6 in _0x317f0c){if(_0x317f0c['hasOwnProperty'](_0x1412b6)){_0x317f0c[_0x1412b6]=this[_0xa25f('0x1d')](_0x317f0c[_0x1412b6],_0x5d93a9);}}return _0x317f0c;};exports['isNumeric']=function(_0x1030c4){return _0x1030c4[_0xa25f('0x21')](RegExp(_0xa25f('0x22')))?!![]:![];};exports[_0xa25f('0x23')]=function(_0x334629){return _0x334629['match'](/^\S+@\S+$/)?!![]:![];};exports[_0xa25f('0x24')]=function(_0x28d84e){var _0x119ffc=[];_0x28d84e[_0xa25f('0x5')](/[ ,]+/)[_0xa25f('0x25')](function(_0x501372){_0x501372=_0x501372[_0xa25f('0x26')](/([^:]")"+/g,'$1');_0x501372='+'+_0x501372+'*';var _0x1381c1=/[ `!@#$%^&*()_\-?~]/;if(_0x501372[_0xa25f('0x21')](_0x1381c1))_0x501372='\x22'+_0x501372+'\x22';_0x119ffc[_0xa25f('0x27')](_0x501372);});return _0x119ffc[_0xa25f('0x28')]('\x20');};exports[_0xa25f('0x29')]=function(_0x392a69,_0xa1a3a1,_0x159b34){var _0x5621ab={},_0x597233={};if(_0xa1a3a1['query'][_0xa25f('0x2a')]){_0xa1a3a1[_0xa25f('0x2b')]['id']=_0xa1a3a1[_0xa25f('0x2b')][_0xa25f('0x2a')];delete _0xa1a3a1[_0xa25f('0x2b')][_0xa25f('0x2a')];}_0x5621ab[_0xa25f('0x2c')]=_[_0xa25f('0x15')](_0x392a69,_0xa25f('0x2d'));_0x5621ab[_0xa25f('0x2b')]=_[_0xa25f('0x3')](_0xa1a3a1['query']);_0x5621ab['filters']=_[_0xa25f('0x2e')](_0x5621ab[_0xa25f('0x2c')],_0x5621ab[_0xa25f('0x2b')]);_0x597233['attributes']=_['intersection'](_0x5621ab['model'],this[_0xa25f('0x4')](_0xa1a3a1[_0xa25f('0x2b')][_0xa25f('0x4')]));_0x597233['attributes']=_0x597233['attributes'][_0xa25f('0x1e')]?_0x597233[_0xa25f('0x2f')]:_0x5621ab['model'];if(!_0xa1a3a1['query'][_0xa25f('0x30')](_0xa25f('0x31'))){_0x597233[_0xa25f('0x13')]=this['limit'](_0xa1a3a1[_0xa25f('0x2b')][_0xa25f('0x13')]);_0x597233[_0xa25f('0x14')]=this['offset'](_0xa1a3a1['query'][_0xa25f('0x14')]);}_0x597233[_0xa25f('0x32')]=this[_0xa25f('0x33')](_0xa1a3a1[_0xa25f('0x2b')][_0xa25f('0x33')]);_0x597233[_0xa25f('0x34')]=this[_0xa25f('0x35')](_[_0xa25f('0x36')](_0xa1a3a1['query'],_0x5621ab[_0xa25f('0x35')]),_0x392a69);if(_0xa1a3a1[_0xa25f('0x2b')][_0xa25f('0x37')]){var _0x2e886f=_0x392a69;var _0xd6c0b7=_0xa1a3a1[_0xa25f('0x2b')][_0xa25f('0x37')];if(typeof _0xd6c0b7===_0xa25f('0x38')){_0x2e886f=_[_0xa25f('0x37')](_0x392a69,function(_0x370375){return _[_0xa25f('0x39')](_0xd6c0b7[_0xa25f('0x3a')],_0x370375[_0xa25f('0x2d')]);});_0xd6c0b7=_0xd6c0b7['value'];}_0x597233[_0xa25f('0x34')]=_['merge'](_0x597233[_0xa25f('0x34')],{'$or':_[_0xa25f('0x15')](_0x2e886f,function(_0x36afe4){if(_0x36afe4['type']!==_0xa25f('0x3b')){if(_0x159b34){return sequelize[_0xa25f('0x34')](sequelize['fn'](_0xa25f('0x3c'),sequelize[_0xa25f('0x18')](_0x36afe4['name'])),{'$like':sequelize['fn'](_0xa25f('0x3c'),'%'+_0xa1a3a1[_0xa25f('0x2b')][_0xa25f('0x37')]+'%')});}else{var _0x3d3cad={};_0x3d3cad[_0x36afe4[_0xa25f('0x2d')]]={'$like':'%'+_0xa1a3a1[_0xa25f('0x2b')]['filter']+'%'};return _0x3d3cad;}}})});}_0x597233=_[_0xa25f('0x3d')]({},_0x597233,_0xa1a3a1[_0xa25f('0x3e')]);return _0x597233;};
\ No newline at end of file
index bd59f6d..1187a69 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x409682,_0x370090){var _0x1ee901=function(_0xe93c56){while(--_0xe93c56){_0x409682['push'](_0x409682['shift']());}};_0x1ee901(++_0x370090);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());};
\ No newline at end of file
+var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x2d9da8,_0x5d5072){var _0x57a29c=function(_0x2f562d){while(--_0x2f562d){_0x2d9da8['push'](_0x2d9da8['shift']());}};_0x57a29c(++_0x5d5072);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());};
\ No newline at end of file
index 6481358..9cf7315 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xced5=['digest','substring','lodash','bimedia-machine-uuid','execSync','../environment','keys','length','filter','family','internal','concat','head','mac','address','getFirstInterface','cpus','map','model','join','createHash','md5','update','hex','getUuid','platform','test','licenseToken','win32','dmidecode\x20--string\x20system-uuid','replace','macAddress'];(function(_0x108ee1,_0x3adbef){var _0xf22907=function(_0x1cee76){while(--_0x1cee76){_0x108ee1['push'](_0x108ee1['shift']());}};_0xf22907(++_0x3adbef);}(_0xced5,0x1c2));var _0x5ced=function(_0x230f52,_0x5709d8){_0x230f52=_0x230f52-0x0;var _0x53fb5a=_0xced5[_0x230f52];return _0x53fb5a;};'use strict';var _=require(_0x5ced('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0x5ced('0x1'));var exec=require('child_process')[_0x5ced('0x2')];var config=require(_0x5ced('0x3'));function getInterfaces(){var _0x42062e=[];var _0x1ca634=os['networkInterfaces']();var _0x568027=_['orderBy'](_[_0x5ced('0x4')](_0x1ca634));for(var _0x196eb1=0x0;_0x196eb1<_0x568027[_0x5ced('0x5')];_0x196eb1++){var _0x3bda62=_0x1ca634[_0x568027[_0x196eb1]][_0x5ced('0x6')](function(_0x4b2074){return _0x4b2074[_0x5ced('0x7')]==='IPv4'&&_0x4b2074[_0x5ced('0x8')]===![];});_0x42062e=_0x42062e[_0x5ced('0x9')](_0x3bda62);}return _0x42062e;}function getFirstInterface(){var _0x4641e5=_[_0x5ced('0xa')](getInterfaces());return{'macAddress':_0x4641e5&&_0x4641e5[_0x5ced('0xb')]?_0x4641e5[_0x5ced('0xb')]:'00:00:00:00:00:00','ipAddress':_0x4641e5&&_0x4641e5[_0x5ced('0xc')]?_0x4641e5['address']:'127.0.0.1'};}exports[_0x5ced('0xd')]=getFirstInterface;function getCPUhash(){var _0x360bb9=_['orderBy'](os[_0x5ced('0xe')]()[_0x5ced('0xf')](function(_0x3aeae1){return _0x3aeae1[_0x5ced('0x10')];}))[_0x5ced('0x11')](':');return crypto[_0x5ced('0x12')](_0x5ced('0x13'))[_0x5ced('0x14')](_0x360bb9)['digest'](_0x5ced('0x15'));}exports[_0x5ced('0x16')]=function(){var _0x2a37a1=os[_0x5ced('0x17')]();var _0x2a815a=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x2a815a[_0x5ced('0x18')](config[_0x5ced('0x19')])){return config['licenseToken'];}else if(_0x2a37a1===_0x5ced('0x1a')){return exec(_0x5ced('0x1b'),{'encoding':'utf8'})[_0x5ced('0x1c')]('\x0d\x0a','');}else{var _0x1dffd7=getFirstInterface();var _0x3de527=getCPUhash();var _0x3c0cb9=_0x3de527+'|'+os['hostname']()+'|'+_0x1dffd7[_0x5ced('0x1d')]+'|'+_0x1dffd7['ipAddress'];var _0x3edf9d=crypto['createHash']('md5')[_0x5ced('0x14')](_0x3c0cb9)[_0x5ced('0x1e')](_0x5ced('0x15'));return _0x3edf9d[_0x5ced('0x1f')](0x0,0x8)+'-'+_0x3edf9d['substring'](0x8,0xc)+'-'+_0x3edf9d['substring'](0xc,0x10)+'-'+_0x3edf9d[_0x5ced('0x1f')](0x10,0x14)+'-'+_0x3edf9d[_0x5ced('0x1f')](0x14);}};
\ No newline at end of file
+var _0x60d3=['licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','hostname','macAddress','ipAddress','substring','crypto','child_process','../environment','networkInterfaces','orderBy','keys','length','family','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model','join','createHash','md5','update','digest','hex','getUuid','platform'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x60d3,0xe0));var _0x360d=function(_0x21de89,_0x367053){_0x21de89=_0x21de89-0x0;var _0x290b7e=_0x60d3[_0x21de89];return _0x290b7e;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x360d('0x0'));var machine=require('bimedia-machine-uuid');var exec=require(_0x360d('0x1'))['execSync'];var config=require(_0x360d('0x2'));function getInterfaces(){var _0x365934=[];var _0x16796a=os[_0x360d('0x3')]();var _0x463247=_[_0x360d('0x4')](_[_0x360d('0x5')](_0x16796a));for(var _0x754908=0x0;_0x754908<_0x463247[_0x360d('0x6')];_0x754908++){var _0x59b990=_0x16796a[_0x463247[_0x754908]]['filter'](function(_0x15d18b){return _0x15d18b[_0x360d('0x7')]===_0x360d('0x8')&&_0x15d18b[_0x360d('0x9')]===![];});_0x365934=_0x365934[_0x360d('0xa')](_0x59b990);}return _0x365934;}function getFirstInterface(){var _0x1461f2=_[_0x360d('0xb')](getInterfaces());return{'macAddress':_0x1461f2&&_0x1461f2[_0x360d('0xc')]?_0x1461f2[_0x360d('0xc')]:_0x360d('0xd'),'ipAddress':_0x1461f2&&_0x1461f2[_0x360d('0xe')]?_0x1461f2[_0x360d('0xe')]:_0x360d('0xf')};}exports[_0x360d('0x10')]=getFirstInterface;function getCPUhash(){var _0x46dd75=_[_0x360d('0x4')](os[_0x360d('0x11')]()[_0x360d('0x12')](function(_0x156349){return _0x156349[_0x360d('0x13')];}))[_0x360d('0x14')](':');return crypto[_0x360d('0x15')](_0x360d('0x16'))[_0x360d('0x17')](_0x46dd75)[_0x360d('0x18')](_0x360d('0x19'));}exports[_0x360d('0x1a')]=function(){var _0x4b30d9=os[_0x360d('0x1b')]();var _0x47ad1b=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x47ad1b['test'](config[_0x360d('0x1c')])){return config[_0x360d('0x1c')];}else if(_0x4b30d9===_0x360d('0x1d')){return exec(_0x360d('0x1e'),{'encoding':_0x360d('0x1f')})['replace']('\x0d\x0a','');}else{var _0xcb0baa=getFirstInterface();var _0x1a2c41=getCPUhash();var _0x5ef627=_0x1a2c41+'|'+os[_0x360d('0x20')]()+'|'+_0xcb0baa[_0x360d('0x21')]+'|'+_0xcb0baa[_0x360d('0x22')];var _0x190a24=crypto[_0x360d('0x15')](_0x360d('0x16'))['update'](_0x5ef627)['digest'](_0x360d('0x19'));return _0x190a24[_0x360d('0x23')](0x0,0x8)+'-'+_0x190a24[_0x360d('0x23')](0x8,0xc)+'-'+_0x190a24[_0x360d('0x23')](0xc,0x10)+'-'+_0x190a24[_0x360d('0x23')](0x10,0x14)+'-'+_0x190a24[_0x360d('0x23')](0x14);}};
\ No newline at end of file
index 3b61724..279eb22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x986a=['data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','encryptString','decryptString','days','YYYY-MM-DD\x20HH:mm','error','message','finally','getUuid','License','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','util','request-promise','bluebird','pkginfo','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','exports','version','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x986a,0x167));var _0xa986=function(_0x34c8b3,_0x54de1d){_0x34c8b3=_0x34c8b3-0x0;var _0xf9909c=_0x986a[_0x34c8b3];return _0xf9909c;};'use strict';var util=require(_0xa986('0x0'));var moment=require('moment');var rp=require(_0xa986('0x1'));var BPromise=require(_0xa986('0x2'));var pkginfo=require(_0xa986('0x3'))(module,'version');var db=require(_0xa986('0x4'))['db'];var encryptor=require(_0xa986('0x5'));var hardware=require(_0xa986('0x6'));var logger=require(_0xa986('0x7'))(_0xa986('0x8'));var HOST=_0xa986('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x151ba5){return new BPromise(function(_0x11ff63,_0x3e9055){var _0x47e021=util['format'](_0xa986('0xa'),HOST,_0x151ba5,module[_0xa986('0xb')][_0xa986('0xc')]);if(oldToken){_0x47e021=util[_0xa986('0xd')](_0xa986('0xe'),HOST,_0x151ba5,module[_0xa986('0xb')]['version'],oldToken);}var _0x174330={'uri':_0x47e021,'method':_0xa986('0xf'),'timeout':0xea60,'json':!![]};return rp(_0x174330)[_0xa986('0x10')](function(_0x2289d6){_0x11ff63(_0x2289d6);})[_0xa986('0x11')](function(_0x2f54fe){_0x3e9055(_0x2f54fe);});});}function manageLicense(_0x379e99,_0x592128){var _0x564d6f=_0x592128[_0xa986('0x12')]({'plain':!![]});if(!isOldTokenSent&&_0x564d6f[_0xa986('0x13')]!==_0x379e99&&!_0x564d6f[_0xa986('0x14')]){oldToken=_0x564d6f['data1'];}httpRequest(_0x379e99)['then'](function(_0x16a55b){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x16a55b[_0xa986('0x15')]){isOldTokenSent=![];if(!_0x564d6f['license']&&_0x564d6f[_0xa986('0x8')]!=_0x16a55b[_0xa986('0x8')]||_0x564d6f[_0xa986('0x8')]&&_0x564d6f[_0xa986('0x14')]){logger[_0xa986('0x16')](_0xa986('0x17'));}if(_0x564d6f['license']&&!_0x564d6f[_0xa986('0x14')]&&_0x564d6f['license']!=_0x16a55b[_0xa986('0x8')]){logger[_0xa986('0x16')](_0xa986('0x18'));}if(_0x564d6f[_0xa986('0x8')]&&!_0x564d6f[_0xa986('0x14')]&&_0x564d6f[_0xa986('0x8')]==_0x16a55b[_0xa986('0x8')]){return _0x592128;}return _0x592128[_0xa986('0x19')]({'data1':_0x379e99,'data2':null,'license':_0x16a55b[_0xa986('0x8')]});}else{if(_0x16a55b[_0xa986('0x8')]||_0x564d6f[_0xa986('0x8')]){if(!_0x564d6f['data2']){if(_0x564d6f['data1']==_0x379e99){GRAY_PERIOD_REASON='Disabled';logger[_0xa986('0x16')](_0xa986('0x1a'));}else{GRAY_PERIOD_REASON=_0xa986('0x1b');logger[_0xa986('0x16')](_0xa986('0x1c'),_0x564d6f[_0xa986('0x13')],_0x379e99);}logger[_0xa986('0x16')](_0xa986('0x1d'),GRAY_PERIOD_REASON[_0xa986('0x1e')](),moment()[_0xa986('0xd')]('YYYY-MM-DD\x20HH:mm'));return _0x592128['update']({'data2':encryptor[_0xa986('0x1f')](moment()[_0xa986('0xd')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()['diff'](encryptor[_0xa986('0x20')](_0x564d6f['data2']),_0xa986('0x21'))>DAYS){logger[_0xa986('0x16')]('DEMO\x20START\x20AT\x20%s',moment()['format'](_0xa986('0x22')));isOldTokenSent=![];return _0x592128[_0xa986('0x19')]({'data1':_0x379e99,'data2':null,'license':null});}}}else{if(_0x564d6f[_0xa986('0x13')]!=_0x379e99){logger[_0xa986('0x16')](_0xa986('0x1c'),_0x564d6f[_0xa986('0x13')],_0x379e99);return _0x592128[_0xa986('0x19')]({'data1':_0x379e99,'data2':null,'license':null});}}}return _0x592128;})['then'](function(_0x5918fb){_0x592128=_0x5918fb;})['catch'](function(_0x1ecdd5){logger[_0xa986('0x23')](_0x1ecdd5[_0xa986('0x24')]);})[_0xa986('0x25')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x592128);},TIME);});}function defaultLicense(){var _0xa1c158=hardware[_0xa986('0x26')]();if(_0xa1c158){return db[_0xa986('0x27')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0xa1c158}})[_0xa986('0x28')](function(_0x19c190,_0x5c1093){logger[_0xa986('0x16')](_0xa986('0x29'),_0xa1c158);manageLicense(_0xa1c158,_0x19c190);})[_0xa986('0x11')](function(_0x77e504){logger[_0xa986('0x23')](_0x77e504['message']);});}}exports['default']=defaultLicense;
\ No newline at end of file
+var _0x84a0=['license','https://www.xcallymotion.com','format','exports','GET','catch','get','data2','data1','then','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','update','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','request-promise','pkginfo','version','../../mysqldb','../../components/encryptor','../logger'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0x84a0,0xd1));var _0x084a=function(_0x104209,_0x59e25e){_0x104209=_0x104209-0x0;var _0x100749=_0x84a0[_0x104209];return _0x100749;};'use strict';var util=require(_0x084a('0x0'));var moment=require('moment');var rp=require(_0x084a('0x1'));var BPromise=require('bluebird');var pkginfo=require(_0x084a('0x2'))(module,_0x084a('0x3'));var db=require(_0x084a('0x4'))['db'];var encryptor=require(_0x084a('0x5'));var hardware=require('./hardware');var logger=require(_0x084a('0x6'))(_0x084a('0x7'));var HOST=_0x084a('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x41969f){return new BPromise(function(_0x186d78,_0x3e4eb2){var _0x415ec4=util[_0x084a('0x9')]('%s/api/servers/%s/check?version=%s',HOST,_0x41969f,module[_0x084a('0xa')][_0x084a('0x3')]);if(oldToken){_0x415ec4=util[_0x084a('0x9')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x41969f,module['exports'][_0x084a('0x3')],oldToken);}var _0x472fa1={'uri':_0x415ec4,'method':_0x084a('0xb'),'timeout':0xea60,'json':!![]};return rp(_0x472fa1)['then'](function(_0x24033b){_0x186d78(_0x24033b);})[_0x084a('0xc')](function(_0x2931e0){_0x3e4eb2(_0x2931e0);});});}function manageLicense(_0xefa441,_0x2e8365){var _0x10fc47=_0x2e8365[_0x084a('0xd')]({'plain':!![]});if(!isOldTokenSent&&_0x10fc47['data1']!==_0xefa441&&!_0x10fc47[_0x084a('0xe')]){oldToken=_0x10fc47[_0x084a('0xf')];}httpRequest(_0xefa441)[_0x084a('0x10')](function(_0x129680){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x129680['active']){isOldTokenSent=![];if(!_0x10fc47[_0x084a('0x7')]&&_0x10fc47[_0x084a('0x7')]!=_0x129680[_0x084a('0x7')]||_0x10fc47[_0x084a('0x7')]&&_0x10fc47[_0x084a('0xe')]){logger[_0x084a('0x11')](_0x084a('0x12'));}if(_0x10fc47['license']&&!_0x10fc47[_0x084a('0xe')]&&_0x10fc47[_0x084a('0x7')]!=_0x129680[_0x084a('0x7')]){logger[_0x084a('0x11')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x10fc47[_0x084a('0x7')]&&!_0x10fc47['data2']&&_0x10fc47[_0x084a('0x7')]==_0x129680[_0x084a('0x7')]){return _0x2e8365;}return _0x2e8365[_0x084a('0x13')]({'data1':_0xefa441,'data2':null,'license':_0x129680['license']});}else{if(_0x129680[_0x084a('0x7')]||_0x10fc47['license']){if(!_0x10fc47['data2']){if(_0x10fc47[_0x084a('0xf')]==_0xefa441){GRAY_PERIOD_REASON='Disabled';logger[_0x084a('0x11')](_0x084a('0x14'));}else{GRAY_PERIOD_REASON='Changed';logger['info']('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x10fc47[_0x084a('0xf')],_0xefa441);}logger[_0x084a('0x11')](_0x084a('0x15'),GRAY_PERIOD_REASON[_0x084a('0x16')](),moment()['format'](_0x084a('0x17')));return _0x2e8365[_0x084a('0x13')]({'data2':encryptor[_0x084a('0x18')](moment()['format'](_0x084a('0x17')))});}else{if(moment()[_0x084a('0x19')](encryptor[_0x084a('0x1a')](_0x10fc47[_0x084a('0xe')]),'days')>DAYS){logger['info']('DEMO\x20START\x20AT\x20%s',moment()[_0x084a('0x9')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x2e8365[_0x084a('0x13')]({'data1':_0xefa441,'data2':null,'license':null});}}}else{if(_0x10fc47[_0x084a('0xf')]!=_0xefa441){logger[_0x084a('0x11')](_0x084a('0x1b'),_0x10fc47[_0x084a('0xf')],_0xefa441);return _0x2e8365[_0x084a('0x13')]({'data1':_0xefa441,'data2':null,'license':null});}}}return _0x2e8365;})[_0x084a('0x10')](function(_0x3c52f8){_0x2e8365=_0x3c52f8;})[_0x084a('0xc')](function(_0xf7ad84){logger[_0x084a('0x1c')](_0xf7ad84['message']);})[_0x084a('0x1d')](function(){setTimeout(function(){manageLicense(hardware[_0x084a('0x1e')](),_0x2e8365);},TIME);});}function defaultLicense(){var _0x213d7c=hardware[_0x084a('0x1e')]();if(_0x213d7c){return db[_0x084a('0x1f')][_0x084a('0x20')]({'where':{'id':0x1},'defaults':{'data1':_0x213d7c}})[_0x084a('0x21')](function(_0x3d9616,_0x28e436){logger['info'](_0x084a('0x22'),_0x213d7c);manageLicense(_0x213d7c,_0x3d9616);})[_0x084a('0xc')](function(_0x395306){logger['error'](_0x395306['message']);});}}exports[_0x084a('0x23')]=defaultLicense;
\ No newline at end of file
index 7469222..205206b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x65e3=['License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','uuid','gray','deadline','add','grayReason','machineUuid','disabled','message','User','findAll','role','sequelize','COUNT','count','user','telephone','users','telephones','admin','pick','countBy','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','defaults','then','catch','data1','isEmpty'];(function(_0x52dbcb,_0x1fd542){var _0x1e3f59=function(_0xb2aee2){while(--_0xb2aee2){_0x52dbcb['push'](_0x52dbcb['shift']());}};_0x1e3f59(++_0x1fd542);}(_0x65e3,0x133));var _0x365e=function(_0xab1a61,_0x251bf9){_0xab1a61=_0xab1a61-0x0;var _0x23f9a4=_0x65e3[_0xab1a61];return _0x23f9a4;};'use strict';var util=require(_0x365e('0x0'));var _=require(_0x365e('0x1'));var moment=require('moment');var BPromise=require(_0x365e('0x2'));var hardware=require(_0x365e('0x3'));var encryptor=require(_0x365e('0x4'));var db=require(_0x365e('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x365e('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x365e('0x7'),'machineUuid':hardware[_0x365e('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x365e('0x9'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x18f172){return new BPromise(function(_0x5a7c6e,_0x578276){return db['License']['find'](_[_0x365e('0xa')](_0x18f172,{'raw':!![],'where':{'id':0x1}}))[_0x365e('0xb')](function(_0x371655){return checkLicense(_0x371655,null);})[_0x365e('0xb')](function(_0x17ad3d){_0x5a7c6e(_0x17ad3d);return;})[_0x365e('0xc')](function(_0x46b9c5){_0x578276(_0x46b9c5);});});}function checkLicense(_0x8e2913,_0x374a57){if(!_0x8e2913){demoLicense['uuid']=_0x8e2913[_0x365e('0xd')];return demoLicense;}try{var _0x1c63cc=_0x374a57||_0x8e2913['license'];if(_[_0x365e('0xe')](_0x1c63cc)){throw new Error(_0x365e('0xf'));}var _0x50c2f4=_0x8e2913[_0x365e('0xd')];var _0x451a50=_0x8e2913[_0x365e('0x10')];var _0x3b665e=_0x50c2f4['split']('-')[0x4];var _0x5dadf6=_0x50c2f4[_0x365e('0x11')]('-')[0x0];var _0x24ac27=encryptor[_0x365e('0x12')](_0x1c63cc,util[_0x365e('0x13')](_0x365e('0x14'),_0x3b665e,_0x50c2f4,_0x5dadf6));var _0x2ef532=JSON[_0x365e('0x15')](_0x24ac27);_0x2ef532[_0x365e('0x16')]=![];_0x2ef532[_0x365e('0x17')]=_0x50c2f4;_0x2ef532['machineUuid']=hardware[_0x365e('0x8')]();if(_0x451a50){var _0x43616c=encryptor[_0x365e('0x12')](_0x451a50);_0x2ef532[_0x365e('0x18')]=_0x43616c;_0x2ef532[_0x365e('0x19')]=moment(_0x43616c)[_0x365e('0x1a')](0x7,'days')['format']();_0x2ef532[_0x365e('0x1b')]=_0x2ef532[_0x365e('0x17')]!=_0x2ef532[_0x365e('0x1c')]?'changed':_0x365e('0x1d');}return _0x2ef532;}catch(_0x5125ee){breakingLicense[_0x365e('0x17')]=_0x8e2913['data1'];breakingLicense['message']=_0x5125ee[_0x365e('0x1e')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x118704,_0x17d854){getLicense()['then'](function(_0x5d332d){return db[_0x365e('0x1f')][_0x365e('0x20')]({'attributes':[_0x365e('0x21'),[db[_0x365e('0x22')]['fn'](_0x365e('0x23'),db[_0x365e('0x22')]['col'](_0x365e('0x21'))),_0x365e('0x24')]],'group':_0x365e('0x21'),'where':{'role':{'$or':['admin',_0x365e('0x25'),_0x365e('0x26')]}},'raw':!![]})[_0x365e('0xb')](function(_0x318261){var _0x4c3889={'user':_0x5d332d[_0x365e('0x27')]||0x0,'telephone':_0x5d332d[_0x365e('0x28')]||0x0};_0x318261['forEach'](function(_0x56a557){var _0x4574c4=_0x56a557[_0x365e('0x21')]===_0x365e('0x29')?_0x365e('0x25'):_0x56a557[_0x365e('0x21')];_0x4c3889[_0x4574c4]-=_0x56a557['count'];if(_0x4c3889[_0x4574c4]<0x0)_0x4c3889[_0x4574c4]=0x0;});_0x118704(_0x4c3889);return;});})['catch'](function(_0x33d76a){_0x17d854(_0x33d76a);});});}function checkUserLimits(_0x4c78d0){return new BPromise(function(_0x197527,_0x14c70d){getLimits()[_0x365e('0xb')](function(_0x48c1c3){var _0x15eba4=_[_0x365e('0x2a')](_[_0x365e('0x2b')](_0x4c78d0,_0x365e('0x21')),[_0x365e('0x29'),_0x365e('0x25'),_0x365e('0x26')]);var _0x3790a6=(_0x15eba4[_0x365e('0x29')]||0x0)+(_0x15eba4['user']||0x0);var _0x58f5c5=_0x15eba4[_0x365e('0x26')]||0x0;if(_0x3790a6>_0x48c1c3['user'])return _0x14c70d('License\x20limit\x20reached\x20for\x20users');if(_0x58f5c5>_0x48c1c3['telephone'])return _0x14c70d(_0x365e('0x2c'));return _0x197527();})[_0x365e('0xc')](function(_0x4d92bf){_0x14c70d(_0x4d92bf);});});}module[_0x365e('0x2d')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
+var _0x9cd5=['message','findAll','role','sequelize','COUNT','count','admin','telephone','users','forEach','user','countBy','License\x20limit\x20reached\x20for\x20users','exports','lodash','bluebird','../../components/encryptor','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','defaults','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','gray','deadline','add','days','changed','disabled'];(function(_0xd503f3,_0x268766){var _0x25364b=function(_0x1b0e1d){while(--_0x1b0e1d){_0xd503f3['push'](_0xd503f3['shift']());}};_0x25364b(++_0x268766);}(_0x9cd5,0xba));var _0x59cd=function(_0x587868,_0x231ba2){_0x587868=_0x587868-0x0;var _0xb32803=_0x9cd5[_0x587868];return _0xb32803;};'use strict';var util=require('util');var _=require(_0x59cd('0x0'));var moment=require('moment');var BPromise=require(_0x59cd('0x1'));var hardware=require('./hardware');var encryptor=require(_0x59cd('0x2'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x59cd('0x3'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x59cd('0x4'),'machineUuid':hardware[_0x59cd('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x59cd('0x3'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x59cd('0x6'),'machineUuid':hardware[_0x59cd('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x5974c7){return new BPromise(function(_0x86551a,_0x75f4e2){return db['License']['find'](_[_0x59cd('0x7')](_0x5974c7,{'raw':!![],'where':{'id':0x1}}))[_0x59cd('0x8')](function(_0x24a634){return checkLicense(_0x24a634,null);})[_0x59cd('0x8')](function(_0x5ade21){_0x86551a(_0x5ade21);return;})[_0x59cd('0x9')](function(_0x4e2472){_0x75f4e2(_0x4e2472);});});}function checkLicense(_0x50e786,_0x38ef77){if(!_0x50e786){demoLicense[_0x59cd('0xa')]=_0x50e786[_0x59cd('0xb')];return demoLicense;}try{var _0x212c11=_0x38ef77||_0x50e786[_0x59cd('0xc')];if(_[_0x59cd('0xd')](_0x212c11)){throw new Error(_0x59cd('0xe'));}var _0x3ff7ed=_0x50e786[_0x59cd('0xb')];var _0x13fc78=_0x50e786[_0x59cd('0xf')];var _0x39e2d5=_0x3ff7ed[_0x59cd('0x10')]('-')[0x4];var _0x3745ab=_0x3ff7ed[_0x59cd('0x10')]('-')[0x0];var _0x475a5e=encryptor[_0x59cd('0x11')](_0x212c11,util[_0x59cd('0x12')](_0x59cd('0x13'),_0x39e2d5,_0x3ff7ed,_0x3745ab));var _0x56de62=JSON[_0x59cd('0x14')](_0x475a5e);_0x56de62[_0x59cd('0x15')]=![];_0x56de62[_0x59cd('0xa')]=_0x3ff7ed;_0x56de62[_0x59cd('0x16')]=hardware['getUuid']();if(_0x13fc78){var _0x17ab5f=encryptor[_0x59cd('0x11')](_0x13fc78);_0x56de62[_0x59cd('0x17')]=_0x17ab5f;_0x56de62[_0x59cd('0x18')]=moment(_0x17ab5f)[_0x59cd('0x19')](0x7,_0x59cd('0x1a'))[_0x59cd('0x12')]();_0x56de62['grayReason']=_0x56de62[_0x59cd('0xa')]!=_0x56de62[_0x59cd('0x16')]?_0x59cd('0x1b'):_0x59cd('0x1c');}return _0x56de62;}catch(_0x5c2ccc){breakingLicense[_0x59cd('0xa')]=_0x50e786['data1'];breakingLicense[_0x59cd('0x1d')]=_0x5c2ccc['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x37772f,_0x548b11){getLicense()[_0x59cd('0x8')](function(_0x299f1d){return db['User'][_0x59cd('0x1e')]({'attributes':[_0x59cd('0x1f'),[db[_0x59cd('0x20')]['fn'](_0x59cd('0x21'),db[_0x59cd('0x20')]['col'](_0x59cd('0x1f'))),_0x59cd('0x22')]],'group':_0x59cd('0x1f'),'where':{'role':{'$or':[_0x59cd('0x23'),'user',_0x59cd('0x24')]}},'raw':!![]})[_0x59cd('0x8')](function(_0x45a778){var _0x29330b={'user':_0x299f1d[_0x59cd('0x25')]||0x0,'telephone':_0x299f1d['telephones']||0x0};_0x45a778[_0x59cd('0x26')](function(_0x3c7ab7){var _0x5bf8cb=_0x3c7ab7['role']==='admin'?_0x59cd('0x27'):_0x3c7ab7[_0x59cd('0x1f')];_0x29330b[_0x5bf8cb]-=_0x3c7ab7[_0x59cd('0x22')];if(_0x29330b[_0x5bf8cb]<0x0)_0x29330b[_0x5bf8cb]=0x0;});_0x37772f(_0x29330b);return;});})[_0x59cd('0x9')](function(_0x4fecb3){_0x548b11(_0x4fecb3);});});}function checkUserLimits(_0x4eaaab){return new BPromise(function(_0x567dd5,_0x253c3c){getLimits()[_0x59cd('0x8')](function(_0x325c56){var _0x572349=_['pick'](_[_0x59cd('0x28')](_0x4eaaab,_0x59cd('0x1f')),[_0x59cd('0x23'),_0x59cd('0x27'),'telephone']);var _0x435bd0=(_0x572349['admin']||0x0)+(_0x572349['user']||0x0);var _0x1d33d5=_0x572349['telephone']||0x0;if(_0x435bd0>_0x325c56[_0x59cd('0x27')])return _0x253c3c(_0x59cd('0x29'));if(_0x1d33d5>_0x325c56[_0x59cd('0x24')])return _0x253c3c('License\x20limit\x20reached\x20for\x20telephones');return _0x567dd5();})[_0x59cd('0x9')](function(_0xa88b85){_0x253c3c(_0xa88b85);});});}module[_0x59cd('0x2a')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
index d6de5a5..2270bda 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe820=['exports','myappanuglar-secret'];(function(_0x38b72b,_0x6ec7f){var _0x4d56a4=function(_0x8bbf2e){while(--_0x8bbf2e){_0x38b72b['push'](_0x38b72b['shift']());}};_0x4d56a4(++_0x6ec7f);}(_0xe820,0xd2));var _0x0e82=function(_0x1a3289,_0x256bd9){_0x1a3289=_0x1a3289-0x0;var _0x275d0e=_0xe820[_0x1a3289];return _0x275d0e;};'use strict';module[_0x0e82('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x0e82('0x1'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':'secret','DEBUG':''};
\ No newline at end of file
+var _0xb62e=['myappanuglar-secret','app-id','exports','http://localhost:9000'];(function(_0x12416c,_0x2b958e){var _0x404766=function(_0x4da3ad){while(--_0x4da3ad){_0x12416c['push'](_0x12416c['shift']());}};_0x404766(++_0x2b958e);}(_0xb62e,0x1de));var _0xeb62=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xb62e[_0xbca1b1];return _0x4e1686;};'use strict';module[_0xeb62('0x0')]={'DOMAIN':_0xeb62('0x1'),'SESSION_SECRET':_0xeb62('0x2'),'GOOGLE_ID':_0xeb62('0x3'),'GOOGLE_SECRET':'secret','DEBUG':''};
\ No newline at end of file
index 65b5a3b..cd141fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-'use strict';var fileLogger=require('../utils/loggers')['fileLogger'];module['exports']=fileLogger;
\ No newline at end of file
+var _0x40f3=['../utils/loggers'];(function(_0x522662,_0x499a3d){var _0x5eba71=function(_0x5b7985){while(--_0x5b7985){_0x522662['push'](_0x522662['shift']());}};_0x5eba71(++_0x499a3d);}(_0x40f3,0x1b2));var _0x340f=function(_0x44946b,_0xf874ec){_0x44946b=_0x44946b-0x0;var _0x249bc4=_0x40f3[_0x44946b];return _0x249bc4;};'use strict';var fileLogger=require(_0x340f('0x0'))['fileLogger'];module['exports']=fileLogger;
\ No newline at end of file
index bbaab14..f79565d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc633=['routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','path','express','join','../../services/express/index.js','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js'];(function(_0x3c5a3a,_0x5f36ff){var _0x6dc6=function(_0xbc75bf){while(--_0xbc75bf){_0x3c5a3a['push'](_0x3c5a3a['shift']());}};_0x6dc6(++_0x5f36ff);}(_0xc633,0x1e5));var _0x3c63=function(_0x2ebd69,_0x578b7f){_0x2ebd69=_0x2ebd69-0x0;var _0x429409=_0xc633[_0x2ebd69];return _0x429409;};'use strict';var path=require(_0x3c63('0x0'));var os=require('os');var config={'apps':[{'name':_0x3c63('0x1'),'script':path[_0x3c63('0x2')](__dirname,_0x3c63('0x3'))},{'name':'ami','script':path[_0x3c63('0x2')](__dirname,_0x3c63('0x4'))},{'name':_0x3c63('0x5'),'script':path[_0x3c63('0x2')](__dirname,_0x3c63('0x6'))},{'name':_0x3c63('0x7'),'script':path[_0x3c63('0x2')](__dirname,_0x3c63('0x8'))},{'name':_0x3c63('0x9'),'script':path[_0x3c63('0x2')](__dirname,_0x3c63('0xa'))},{'name':_0x3c63('0xb'),'script':path[_0x3c63('0x2')](__dirname,_0x3c63('0xc'))}]};module['exports']=config;
\ No newline at end of file
+var _0xb8c5=['routing','../../services/routing/index.js','../../services/xdr/index.js','exports','path','express','../../services/express/index.js','ami','join','../../services/ami/index.js','email'];(function(_0x274dd7,_0x2e6051){var _0x148829=function(_0x4cec98){while(--_0x4cec98){_0x274dd7['push'](_0x274dd7['shift']());}};_0x148829(++_0x2e6051);}(_0xb8c5,0x1a6));var _0x5b8c=function(_0x1c7889,_0x24cd26){_0x1c7889=_0x1c7889-0x0;var _0x2f14e5=_0xb8c5[_0x1c7889];return _0x2f14e5;};'use strict';var path=require(_0x5b8c('0x0'));var os=require('os');var config={'apps':[{'name':_0x5b8c('0x1'),'script':path['join'](__dirname,_0x5b8c('0x2'))},{'name':_0x5b8c('0x3'),'script':path[_0x5b8c('0x4')](__dirname,_0x5b8c('0x5'))},{'name':'agi','script':path['join'](__dirname,'../../services/agi/index.js')},{'name':_0x5b8c('0x6'),'script':path[_0x5b8c('0x4')](__dirname,'../../services/email/index.js')},{'name':_0x5b8c('0x7'),'script':path['join'](__dirname,_0x5b8c('0x8'))},{'name':'xdr','script':path[_0x5b8c('0x4')](__dirname,_0x5b8c('0x9'))}]};module[_0x5b8c('0xa')]=config;
\ No newline at end of file
index 2b8c3a2..bef65b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96e6=['stop','list','describe','delete','dump','saved','pm2','bluebird','./config','connected','then','start','disconnect'];(function(_0x36bcf9,_0x1cad1b){var _0x18dd3e=function(_0x43164c){while(--_0x43164c){_0x36bcf9['push'](_0x36bcf9['shift']());}};_0x18dd3e(++_0x1cad1b);}(_0x96e6,0x124));var _0x696e=function(_0x2c730f,_0x1aa6a6){_0x2c730f=_0x2c730f-0x0;var _0x4127e7=_0x96e6[_0x2c730f];return _0x4127e7;};'use strict';var pm2=require(_0x696e('0x0'));var BPromise=require(_0x696e('0x1'));var config=require(_0x696e('0x2'));function connect(){return new BPromise(function(_0x2ab49b,_0x27616c){return pm2['connect'](function(_0x4743cd){if(_0x4743cd){return _0x27616c(_0x4743cd);}return _0x2ab49b(_0x696e('0x3'));});});};exports['start']=function(_0x434182){return connect()[_0x696e('0x4')](function(){return new BPromise(function(_0x51f368,_0x29fb68){return pm2[_0x696e('0x5')](_0x434182,function(_0x31364a,_0x19ec09){if(_0x31364a){return _0x29fb68(_0x31364a);}pm2[_0x696e('0x6')]();return _0x51f368(_0x19ec09);});});});};exports['stop']=function(_0x239c6d){return connect()['then'](function(){return new BPromise(function(_0x3ba2bc,_0x3b2778){return pm2[_0x696e('0x7')](_0x239c6d,function(_0x51d138,_0x1ef425){if(_0x51d138){return _0x3b2778(_0x51d138);}pm2[_0x696e('0x6')]();return _0x3ba2bc(_0x1ef425);});});});};exports['restart']=function(_0x2117ca){return connect()[_0x696e('0x4')](function(){return new BPromise(function(_0x22bec3,_0xf0922f){return pm2['restart'](_0x2117ca,function(_0x2f6018,_0x3d46fa){if(_0x2f6018){return _0xf0922f(_0x2f6018);}pm2[_0x696e('0x6')]();return _0x22bec3(_0x3d46fa);});});});};exports[_0x696e('0x8')]=function(){return connect()[_0x696e('0x4')](function(){return new BPromise(function(_0xa10c98,_0x20311d){return pm2[_0x696e('0x8')](function(_0x2fe9b9,_0x1497db){if(_0x2fe9b9){return _0x20311d(_0x2fe9b9);}pm2[_0x696e('0x6')]();return _0xa10c98(_0x1497db);});});});};exports[_0x696e('0x9')]=function(_0x2d0497){return connect()['then'](function(){return new BPromise(function(_0x446001,_0x4dfc0a){return pm2[_0x696e('0x9')](_0x2d0497,function(_0x1d509a,_0xab48c8){if(_0x1d509a){return _0x4dfc0a(_0x1d509a);}pm2[_0x696e('0x6')]();return _0x446001(_0xab48c8);});});});};exports[_0x696e('0xa')]=function(_0x310d40){return connect()['then'](function(){return new BPromise(function(_0x431c4d,_0x5a9c55){return pm2[_0x696e('0xa')](_0x310d40,function(_0x2cf63f,_0xfb60f6){if(_0x2cf63f){return _0x5a9c55(_0x2cf63f);}pm2[_0x696e('0x6')]();return _0x431c4d(_0xfb60f6);});});});};exports[_0x696e('0xb')]=function(){return connect()[_0x696e('0x4')](function(){return new BPromise(function(_0x4d672b,_0x3ede90){return pm2['dump'](function(_0x395d79){if(_0x395d79){return _0x3ede90(_0x395d79);}return _0x4d672b(_0x696e('0xc'));});});});};
\ No newline at end of file
+var _0x9fda=['list','dump','saved','bluebird','./config','connected','start','then','disconnect','stop','restart'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9fda,0x1dc));var _0xa9fd=function(_0x205831,_0x941881){_0x205831=_0x205831-0x0;var _0x5c9af2=_0x9fda[_0x205831];return _0x5c9af2;};'use strict';var pm2=require('pm2');var BPromise=require(_0xa9fd('0x0'));var config=require(_0xa9fd('0x1'));function connect(){return new BPromise(function(_0x4d9a50,_0x477bc3){return pm2['connect'](function(_0x2ceba1){if(_0x2ceba1){return _0x477bc3(_0x2ceba1);}return _0x4d9a50(_0xa9fd('0x2'));});});};exports[_0xa9fd('0x3')]=function(_0x576604){return connect()[_0xa9fd('0x4')](function(){return new BPromise(function(_0x4540ca,_0x3cffed){return pm2['start'](_0x576604,function(_0x4aff03,_0x94272a){if(_0x4aff03){return _0x3cffed(_0x4aff03);}pm2[_0xa9fd('0x5')]();return _0x4540ca(_0x94272a);});});});};exports['stop']=function(_0x68f957){return connect()[_0xa9fd('0x4')](function(){return new BPromise(function(_0x341003,_0x2922dc){return pm2[_0xa9fd('0x6')](_0x68f957,function(_0x345800,_0x1085c5){if(_0x345800){return _0x2922dc(_0x345800);}pm2['disconnect']();return _0x341003(_0x1085c5);});});});};exports[_0xa9fd('0x7')]=function(_0x5b3ded){return connect()[_0xa9fd('0x4')](function(){return new BPromise(function(_0x3c37ef,_0x20c785){return pm2[_0xa9fd('0x7')](_0x5b3ded,function(_0x303d6a,_0x831593){if(_0x303d6a){return _0x20c785(_0x303d6a);}pm2['disconnect']();return _0x3c37ef(_0x831593);});});});};exports[_0xa9fd('0x8')]=function(){return connect()[_0xa9fd('0x4')](function(){return new BPromise(function(_0x215ebc,_0x40cba4){return pm2['list'](function(_0x27e44c,_0x26d246){if(_0x27e44c){return _0x40cba4(_0x27e44c);}pm2[_0xa9fd('0x5')]();return _0x215ebc(_0x26d246);});});});};exports['describe']=function(_0x53968c){return connect()[_0xa9fd('0x4')](function(){return new BPromise(function(_0x599fdf,_0x35bc94){return pm2['describe'](_0x53968c,function(_0x31a066,_0x223323){if(_0x31a066){return _0x35bc94(_0x31a066);}pm2[_0xa9fd('0x5')]();return _0x599fdf(_0x223323);});});});};exports['delete']=function(_0x3c8c27){return connect()[_0xa9fd('0x4')](function(){return new BPromise(function(_0x101efc,_0x39dffd){return pm2['delete'](_0x3c8c27,function(_0x46a680,_0x1e7e93){if(_0x46a680){return _0x39dffd(_0x46a680);}pm2[_0xa9fd('0x5')]();return _0x101efc(_0x1e7e93);});});});};exports[_0xa9fd('0x9')]=function(){return connect()['then'](function(){return new BPromise(function(_0x57629b,_0x47ab12){return pm2[_0xa9fd('0x9')](function(_0x1863c0){if(_0x1863c0){return _0x47ab12(_0x1863c0);}return _0x57629b(_0xa9fd('0xa'));});});});};
\ No newline at end of file
index d282593..6f2a9b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a91=['timeout','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','start','lodash','moment','ioredis','../logger','redis','localhost','socket.io-emitter','find','then','chatTimeout','ChatInteraction','subtract','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','system'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x1a91,0xf1));var _0x11a9=function(_0x2f4d5f,_0xda7f63){_0x2f4d5f=_0x2f4d5f-0x0;var _0x13dfeb=_0x1a91[_0x2f4d5f];return _0x13dfeb;};'use strict';var _=require(_0x11a9('0x0'));var moment=require(_0x11a9('0x1'));var Redis=require(_0x11a9('0x2'));var util=require('util');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require(_0x11a9('0x3'))('schedule');config[_0x11a9('0x4')]=_['defaults'](config['redis'],{'host':_0x11a9('0x5'),'port':0x18eb});var io=require(_0x11a9('0x6'))(new Redis(config[_0x11a9('0x4')]));function closeInteractions(){var _0x1e17a4=0x0;var _0x2a630a=[];return db['Setting'][_0x11a9('0x7')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x11a9('0x8')](function(_0x39de0f){_0x1e17a4=_0x39de0f[_0x11a9('0x9')];if(_0x1e17a4){return db[_0x11a9('0xa')]['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x11a9('0xb')](_0x39de0f[_0x11a9('0x9')],_0x11a9('0xc'))}}});}else{return[];}})[_0x11a9('0x8')](function(_0xe58753){if(_0xe58753&&_0xe58753[_0x11a9('0xd')]){_0x2a630a=_[_0x11a9('0xe')](_0xe58753||[],'id');logger[_0x11a9('0xf')](_0x11a9('0x10'),_0x2a630a[_0x11a9('0x11')]());return db['ChatInteraction'][_0x11a9('0x12')]({'closeReason':_0x11a9('0x13'),'disposition':_0x11a9('0x14'),'closed':!![],'closedAt':moment()['format'](_0x11a9('0x15'))},{'where':{'id':_0x2a630a}});}})[_0x11a9('0x8')](function(){if(_0x2a630a&&_0x2a630a[_0x11a9('0xd')]){logger[_0x11a9('0xf')](_0x11a9('0x16'),_0x2a630a[_0x11a9('0x11')]());for(var _0x3d19f1=0x0;_0x3d19f1<_0x2a630a[_0x11a9('0xd')];_0x3d19f1++){io[_0x11a9('0x17')](_0x11a9('0x18'),{'id':_0x2a630a[_0x3d19f1],'closed':!![]});}}})[_0x11a9('0x19')](function(_0x5bc23c){logger[_0x11a9('0x1a')](_0x11a9('0x1b'),_0x5bc23c?util['inspect'](_0x5bc23c,{'showHidden':![],'depth':null}):'');});}exports[_0x11a9('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0xcadf=['redis','localhost','Setting','chatTimeout','findAll','minutes','then','info','[CHAT]\x20Interactions\x20to\x20close:','join','ChatInteraction','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','emit','chatInteraction:update','start','lodash','moment','ioredis','util','../../mysqldb','schedule','defaults'];(function(_0x475b45,_0x50b061){var _0x2b06fe=function(_0x2bad46){while(--_0x2bad46){_0x475b45['push'](_0x475b45['shift']());}};_0x2b06fe(++_0x50b061);}(_0xcadf,0x17f));var _0xfcad=function(_0xc88dd2,_0x5a5c07){_0xc88dd2=_0xc88dd2-0x0;var _0x43920c=_0xcadf[_0xc88dd2];return _0x43920c;};'use strict';var _=require(_0xfcad('0x0'));var moment=require(_0xfcad('0x1'));var Redis=require(_0xfcad('0x2'));var util=require(_0xfcad('0x3'));var config=require('../../config/environment');var db=require(_0xfcad('0x4'))['db'];var logger=require('../logger')(_0xfcad('0x5'));config['redis']=_[_0xfcad('0x6')](config[_0xfcad('0x7')],{'host':_0xfcad('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xfcad('0x7')]));function closeInteractions(){var _0x2d070a=0x0;var _0x5cf1b8=[];return db[_0xfcad('0x9')]['find']({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})['then'](function(_0x482ff4){_0x2d070a=_0x482ff4[_0xfcad('0xa')];if(_0x2d070a){return db['ChatInteraction'][_0xfcad('0xb')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x482ff4[_0xfcad('0xa')],_0xfcad('0xc'))}}});}else{return[];}})[_0xfcad('0xd')](function(_0x53b411){if(_0x53b411&&_0x53b411['length']){_0x5cf1b8=_['map'](_0x53b411||[],'id');logger[_0xfcad('0xe')](_0xfcad('0xf'),_0x5cf1b8[_0xfcad('0x10')]());return db[_0xfcad('0x11')][_0xfcad('0x12')]({'closeReason':'system','disposition':_0xfcad('0x13'),'closed':!![],'closedAt':moment()[_0xfcad('0x14')](_0xfcad('0x15'))},{'where':{'id':_0x5cf1b8}});}})['then'](function(){if(_0x5cf1b8&&_0x5cf1b8[_0xfcad('0x16')]){logger[_0xfcad('0xe')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x5cf1b8['join']());for(var _0xffc212=0x0;_0xffc212<_0x5cf1b8[_0xfcad('0x16')];_0xffc212++){io[_0xfcad('0x17')](_0xfcad('0x18'),{'id':_0x5cf1b8[_0xffc212],'closed':!![]});}}})['catch'](function(_0x376f66){logger['error']('[CHAT]\x20Error\x20closing\x20interactions',_0x376f66?util['inspect'](_0x376f66,{'showHidden':![],'depth':null}):'');});}exports[_0xfcad('0x19')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index 0dcc3f3..a36625d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb081=['startAllRefreshIntervals','exports','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0xb081,0xf2));var _0x1b08=function(_0x469665,_0x394876){_0x469665=_0x469665-0x0;var _0x291ab5=_0xb081[_0x469665];return _0x291ab5;};'use strict';function start(){var _0x37341d=require(_0x1b08('0x0'));return _0x37341d[_0x1b08('0x1')]();}module[_0x1b08('0x2')]={'intervals':{},'start':start};
\ No newline at end of file
+var _0xa084=['exports','../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals'];(function(_0x4f5e67,_0x163a00){var _0xa8e9dc=function(_0x3f69ae){while(--_0x3f69ae){_0x4f5e67['push'](_0x4f5e67['shift']());}};_0xa8e9dc(++_0x163a00);}(_0xa084,0x1b7));var _0x4a08=function(_0x7d4c48,_0x34487b){_0x7d4c48=_0x7d4c48-0x0;var _0x4b8f4d=_0xa084[_0x7d4c48];return _0x4b8f4d;};'use strict';function start(){var _0x4df0d1=require(_0x4a08('0x0'));return _0x4df0d1[_0x4a08('0x1')]();}module[_0x4a08('0x2')]={'intervals':{},'start':start};
\ No newline at end of file
index cd72dc9..1869be7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc3e2=['../../api/analyticCustomReport/analyticCustomReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','Smtp','service','MailAccount','port','secure','auth','user','pass','format','\x22%s\x22\x20<%s>','name','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','../../files/reports','savename','%s.%s','basename','join','existsSync','status','Sent','attachments','message','text','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','email\x20sent','catch','error\x20mail','data','isNil','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','findAll','MailServerOut','keys','toString','difference','intersection','length','stop','toRun','index','run\x20job','cron','active','isBetween','startAt','endAt','start','exists','deleteJob','stop\x20cron','update','update\x20cron','run','util','path','lodash','cron-job-manager','jayson/promise','../logger','schedule','../../mysqldb'];(function(_0x40ce5e,_0x37faed){var _0xda0a53=function(_0x493e9f){while(--_0x493e9f){_0x40ce5e['push'](_0x40ce5e['shift']());}};_0xda0a53(++_0x37faed);}(_0xc3e2,0x140));var _0x2c3e=function(_0x330545,_0xfd7507){_0x330545=_0x330545-0x0;var _0x15553c=_0xc3e2[_0x330545];return _0x15553c;};'use strict';var fs=require('fs');var util=require(_0x2c3e('0x0'));var path=require(_0x2c3e('0x1'));var _=require(_0x2c3e('0x2'));var moment=require('moment');var CronJobManager=require(_0x2c3e('0x3'));var jayson=require(_0x2c3e('0x4'));var BPromise=require('bluebird');var logger=require(_0x2c3e('0x5'))(_0x2c3e('0x6'));var db=require(_0x2c3e('0x7'))['db'];var analyticCustomReportController=require(_0x2c3e('0x8'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x2c3e('0x9')][_0x2c3e('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x38adaa,_0x1e00c5){return function(){logger[_0x2c3e('0xb')](_0x2c3e('0xc'),_0x38adaa[_0x2c3e('0xd')]);var _0x45af54=!![];var _0x1b8e74={'tls':{'rejectUnauthorized':![]}};if(_0x38adaa['MailAccount'][_0x2c3e('0xe')]['service']){_0x1b8e74[_0x2c3e('0xf')]=_0x38adaa['MailAccount'][_0x2c3e('0xe')][_0x2c3e('0xf')];}else{_0x1b8e74['host']=_0x38adaa[_0x2c3e('0x10')][_0x2c3e('0xe')]['host'];_0x1b8e74[_0x2c3e('0x11')]=_0x38adaa[_0x2c3e('0x10')][_0x2c3e('0xe')][_0x2c3e('0x11')];_0x1b8e74['secure']=_0x38adaa['MailAccount'][_0x2c3e('0xe')][_0x2c3e('0x12')];}if(_0x38adaa[_0x2c3e('0x10')][_0x2c3e('0xe')]['authentication']){_0x1b8e74[_0x2c3e('0x13')]={'user':_0x38adaa[_0x2c3e('0x10')][_0x2c3e('0xe')][_0x2c3e('0x14')],'pass':_0x38adaa['MailAccount'][_0x2c3e('0xe')][_0x2c3e('0x15')]};}var _0x570131={'account':_0x1b8e74,'message':{'from':util[_0x2c3e('0x16')](_0x2c3e('0x17'),_0x38adaa[_0x2c3e('0x10')][_0x2c3e('0x18')],_0x38adaa[_0x2c3e('0x10')][_0x2c3e('0xd')]||_0x38adaa[_0x2c3e('0x10')]['Smtp'][_0x2c3e('0x14')]),'to':_0x38adaa['email'],'cc':_0x38adaa['cc'],'bcc':_0x38adaa[_0x2c3e('0x19')],'subject':util[_0x2c3e('0x16')](_0x2c3e('0x1a'),_0x1e00c5[_0x2c3e('0x18')],_0x38adaa[_0x2c3e('0x1b')],_0x38adaa[_0x2c3e('0x1c')])}};var _0x36b9c6=path['join'](__dirname,_0x2c3e('0x1d'));var _0x4751ad=_0x1e00c5[_0x2c3e('0x1e')];var _0x4da315=util['format'](_0x2c3e('0x1f'),path[_0x2c3e('0x20')](_0x1e00c5[_0x2c3e('0x1e')],path['extname'](_0x1e00c5[_0x2c3e('0x1e')])),'zip');var _0x44d140=path[_0x2c3e('0x21')](_0x36b9c6,_0x4751ad);var _0x383a9f=path[_0x2c3e('0x21')](_0x36b9c6,_0x4da315);if(fs[_0x2c3e('0x22')](_0x44d140)){_0x1e00c5[_0x2c3e('0x23')]=_0x2c3e('0x24');_0x570131['message'][_0x2c3e('0x25')]=[{'filename':_0x4751ad,'path':_0x44d140}];_0x570131[_0x2c3e('0x26')][_0x2c3e('0x27')]=util[_0x2c3e('0x16')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0x2c3e('0x28')](_0x1e00c5,null,0x2));}else if(fs[_0x2c3e('0x22')](_0x383a9f)){_0x1e00c5[_0x2c3e('0x23')]=_0x2c3e('0x24');_0x570131[_0x2c3e('0x26')]['attachments']=[{'filename':_0x4da315,'path':_0x383a9f}];}else{_0x570131[_0x2c3e('0x26')][_0x2c3e('0x27')]=_0x2c3e('0x29');if(!_0x38adaa['sendIfEmpty']){_0x45af54=![];logger[_0x2c3e('0xb')](_0x2c3e('0x2a'));}}if(_0x45af54){return client[_0x2c3e('0x2b')](_0x2c3e('0x2c'),_0x570131)[_0x2c3e('0x2d')](function(_0x3fa4e5){if(_0x3fa4e5[_0x2c3e('0x2e')]){return logger[_0x2c3e('0x2e')]('error\x20mail',JSON[_0x2c3e('0x28')](_0x3fa4e5));}return logger['info'](_0x2c3e('0x2f'));})[_0x2c3e('0x30')](function(_0x27bf08){return logger[_0x2c3e('0x2e')](_0x2c3e('0x31'),JSON[_0x2c3e('0x28')](_0x27bf08));});}};}function handleError(){return function(_0x1715fc){return logger[_0x2c3e('0x2e')](JSON[_0x2c3e('0x28')](_0x1715fc));};}function handleResult(_0x5d6a21){return function(_0x3225ee){logger[_0x2c3e('0xb')](_0x2c3e('0x32'),JSON[_0x2c3e('0x28')](_0x3225ee));if(_0x5d6a21[_0x2c3e('0x10')]&&_0x5d6a21[_0x2c3e('0x10')][_0x2c3e('0xe')]&&!_[_0x2c3e('0x33')](_0x5d6a21[_0x2c3e('0xd')])){setTimeout(handleSendEmail(_0x5d6a21,_0x3225ee),0x3c*0x3e8);}};}function handleJob(_0x3b5470){return function(){try{if(_[_0x2c3e('0x33')](_0x3b5470['subtractNumber'])){return logger[_0x2c3e('0xb')]('subtractNumber\x20null\x20or\x20undefined');}if(_['isNil'](_0x3b5470[_0x2c3e('0x1c')])){return logger[_0x2c3e('0xb')]('subtractUnit\x20null\x20or\x20undefined');}var _0x558698={'startDate':moment()[_0x2c3e('0x34')](_0x3b5470[_0x2c3e('0x1b')],_0x3b5470[_0x2c3e('0x1c')])[_0x2c3e('0x16')](_0x2c3e('0x35')),'endDate':moment()[_0x2c3e('0x16')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0x2c3e('0x36'),'output':_0x3b5470['output'],'name':_0x3b5470[_0x2c3e('0x18')]};if(!_[_0x2c3e('0x33')](_0x3b5470[_0x2c3e('0x37')])){logger[_0x2c3e('0xb')]('exec\x20defaul\x20report\x20id:%s',_0x3b5470['DefaultReportId']);return analyticDefaultReportController[_0x2c3e('0x38')]({'id':_0x3b5470[_0x2c3e('0x37')]},_0x558698)[_0x2c3e('0x2d')](handleResult(_0x3b5470))[_0x2c3e('0x30')](handleError());}if(!_[_0x2c3e('0x33')](_0x3b5470[_0x2c3e('0x39')])){logger[_0x2c3e('0xb')](_0x2c3e('0x3a'),_0x3b5470[_0x2c3e('0x39')]);return analyticCustomReportController['runReport']({'id':_0x3b5470[_0x2c3e('0x39')]},_0x558698)[_0x2c3e('0x2d')](handleResult(_0x3b5470))[_0x2c3e('0x30')](handleError());}}catch(_0x75db9b){logger['error'](JSON['stringify'](_0x75db9b));}return logger['info']('no\x20report\x20id');};}function getJobs(_0x247365){var _0x1e48cb={};if(_0x247365){_0x1e48cb['id']=_0x247365;}return db['Schedule'][_0x2c3e('0x3b')]({'where':_0x1e48cb,'include':[{'model':db[_0x2c3e('0x10')],'attributes':['id','name',_0x2c3e('0xd')],'include':[{'model':db[_0x2c3e('0x3c')],'as':_0x2c3e('0xe')}]}]})[_0x2c3e('0x2d')](function(_0x4a2920){var _0x5b11d4=_[_0x2c3e('0x3d')](manager['jobs']);var _0x48eebc=_['map'](_0x4a2920,function(_0x5bb8f3){return _0x5bb8f3['id'][_0x2c3e('0x3e')]();});var _0x4e5ee5=_['keyBy'](_0x4a2920,function(_0x30f9c3){return _0x30f9c3['id'][_0x2c3e('0x3e')]();});var _0x2de471=_0x247365?_0x48eebc:_[_0x2c3e('0x3f')](_0x48eebc,_0x5b11d4);var _0x20fe74=_[_0x2c3e('0x40')](_0x48eebc,_0x5b11d4);var _0xffb038=_[_0x2c3e('0x3f')](_0x5b11d4,_0x48eebc);var _0x1e2248;var _0x3b6503;for(_0x1e2248=0x0;_0x1e2248<_0xffb038[_0x2c3e('0x41')]&&!_0x247365;_0x1e2248+=0x1){_0x3b6503=_0xffb038[_0x1e2248][_0x2c3e('0x3e')]();if(manager['exists'](_0x3b6503)){manager[_0x2c3e('0x42')](_0x3b6503);manager['deleteJob'](_0x3b6503);logger[_0x2c3e('0xb')]('delete\x20cron',_0x3b6503);}}logger[_0x2c3e('0xb')](_0x2c3e('0x43'),JSON[_0x2c3e('0x28')](_0x2de471));for(_0x1e2248=0x0;_0x1e2248<_0x2de471['length'];_0x1e2248+=0x1){_0x3b6503=_0x2de471[_0x1e2248][_0x2c3e('0x3e')]();logger['info'](_0x2c3e('0x44'),_0x3b6503);if(_0x247365){logger['info']('my\x20id',_0x247365);logger[_0x2c3e('0xb')](JSON['stringify'](_0x4e5ee5[_0x3b6503]));BPromise['resolve']()['then'](handleJob(_0x4e5ee5[_0x3b6503]));logger[_0x2c3e('0xb')](_0x2c3e('0x45'),_0x4e5ee5[_0x3b6503][_0x2c3e('0x18')],_0x4e5ee5[_0x3b6503][_0x2c3e('0x46')]);}else if(_0x4e5ee5[_0x3b6503][_0x2c3e('0x46')]&&_0x4e5ee5[_0x3b6503][_0x2c3e('0x47')]&&moment()[_0x2c3e('0x48')](_0x4e5ee5[_0x3b6503][_0x2c3e('0x49')],_0x4e5ee5[_0x3b6503][_0x2c3e('0x4a')])){manager['add'](_0x3b6503,_0x4e5ee5[_0x3b6503]['cron'],handleJob(_0x4e5ee5[_0x3b6503]));manager[_0x2c3e('0x4b')](_0x3b6503);logger[_0x2c3e('0xb')]('add\x20cron',_0x4e5ee5[_0x3b6503][_0x2c3e('0x18')],_0x4e5ee5[_0x3b6503][_0x2c3e('0x46')]);}else if(manager[_0x2c3e('0x4c')](_0x3b6503)){manager[_0x2c3e('0x42')](_0x3b6503);manager[_0x2c3e('0x4d')](_0x3b6503);logger[_0x2c3e('0xb')](_0x2c3e('0x4e'),_0x4e5ee5[_0x3b6503]['name'],_0x4e5ee5[_0x3b6503][_0x2c3e('0x46')]);}}for(_0x1e2248=0x0,_0x3b6503;_0x1e2248<_0x20fe74[_0x2c3e('0x41')]&&!_0x247365;_0x1e2248+=0x1){_0x3b6503=_0x20fe74[_0x1e2248]['toString']();if(manager['exists'](_0x3b6503)){if(_0x4e5ee5[_0x3b6503][_0x2c3e('0x46')]&&_0x4e5ee5[_0x3b6503]['active']&&moment()['isBetween'](_0x4e5ee5[_0x3b6503]['startAt'],_0x4e5ee5[_0x3b6503][_0x2c3e('0x4a')])){manager[_0x2c3e('0x4f')](_0x3b6503,_0x4e5ee5[_0x3b6503][_0x2c3e('0x46')],handleJob(_0x4e5ee5[_0x3b6503]));logger[_0x2c3e('0xb')](_0x2c3e('0x50'),_0x4e5ee5[_0x3b6503][_0x2c3e('0x18')],_0x4e5ee5[_0x3b6503][_0x2c3e('0x46')]);}else{manager[_0x2c3e('0x42')](_0x3b6503);manager[_0x2c3e('0x4d')](_0x3b6503);logger[_0x2c3e('0xb')]('stop\x20cron',_0x4e5ee5[_0x3b6503][_0x2c3e('0x18')],_0x4e5ee5[_0x3b6503]['cron']);}}}})[_0x2c3e('0x30')](function(_0x4b029d){logger[_0x2c3e('0x2e')](JSON[_0x2c3e('0x28')](_0x4b029d));});}exports[_0x2c3e('0x51')]=function(_0xb0e3f3){return getJobs(_0xb0e3f3);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
+var _0xb531=['add','start','add\x20cron','endAt','stop\x20cron','run','util','path','moment','cron-job-manager','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','email','service','Smtp','host','MailAccount','secure','authentication','auth','user','pass','format','\x22%s\x22\x20<%s>','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','basename','zip','status','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Sent','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','empty\x20file,\x20email\x20not\x20sent','request','SendMail','error','error\x20mail','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','name','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','then','exec\x20custom\x20report\x20id:%s','CustomReportId','catch','Schedule','findAll','MailServerOut','keys','jobs','toString','keyBy','intersection','difference','length','exists','stop','deleteJob','delete\x20cron','toRun','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt'];(function(_0x25588c,_0x4a847e){var _0x2b4c85=function(_0x8ad837){while(--_0x8ad837){_0x25588c['push'](_0x25588c['shift']());}};_0x2b4c85(++_0x4a847e);}(_0xb531,0x166));var _0x1b53=function(_0xfd83c4,_0xcb028b){_0xfd83c4=_0xfd83c4-0x0;var _0x3aa065=_0xb531[_0xfd83c4];return _0x3aa065;};'use strict';var fs=require('fs');var util=require(_0x1b53('0x0'));var path=require(_0x1b53('0x1'));var _=require('lodash');var moment=require(_0x1b53('0x2'));var CronJobManager=require(_0x1b53('0x3'));var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x1b53('0x4'))(_0x1b53('0x5'));var db=require(_0x1b53('0x6'))['db'];var analyticCustomReportController=require(_0x1b53('0x7'));var analyticDefaultReportController=require(_0x1b53('0x8'));var client=jayson[_0x1b53('0x9')][_0x1b53('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x491529,_0x2c66be){return function(){logger[_0x1b53('0xb')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x491529[_0x1b53('0xc')]);var _0xdf9bdc=!![];var _0xbe440={'tls':{'rejectUnauthorized':![]}};if(_0x491529['MailAccount']['Smtp'][_0x1b53('0xd')]){_0xbe440[_0x1b53('0xd')]=_0x491529['MailAccount'][_0x1b53('0xe')][_0x1b53('0xd')];}else{_0xbe440[_0x1b53('0xf')]=_0x491529[_0x1b53('0x10')]['Smtp'][_0x1b53('0xf')];_0xbe440['port']=_0x491529['MailAccount'][_0x1b53('0xe')]['port'];_0xbe440[_0x1b53('0x11')]=_0x491529[_0x1b53('0x10')][_0x1b53('0xe')][_0x1b53('0x11')];}if(_0x491529[_0x1b53('0x10')][_0x1b53('0xe')][_0x1b53('0x12')]){_0xbe440[_0x1b53('0x13')]={'user':_0x491529[_0x1b53('0x10')]['Smtp'][_0x1b53('0x14')],'pass':_0x491529[_0x1b53('0x10')][_0x1b53('0xe')][_0x1b53('0x15')]};}var _0x36f0a5={'account':_0xbe440,'message':{'from':util[_0x1b53('0x16')](_0x1b53('0x17'),_0x491529['MailAccount']['name'],_0x491529['MailAccount'][_0x1b53('0xc')]||_0x491529['MailAccount'][_0x1b53('0xe')][_0x1b53('0x14')]),'to':_0x491529['email'],'cc':_0x491529['cc'],'bcc':_0x491529[_0x1b53('0x18')],'subject':util['format'](_0x1b53('0x19'),_0x2c66be['name'],_0x491529[_0x1b53('0x1a')],_0x491529[_0x1b53('0x1b')])}};var _0x2518a2=path[_0x1b53('0x1c')](__dirname,_0x1b53('0x1d'));var _0x228aaa=_0x2c66be[_0x1b53('0x1e')];var _0x1e2d2e=util['format']('%s.%s',path[_0x1b53('0x1f')](_0x2c66be[_0x1b53('0x1e')],path['extname'](_0x2c66be['savename'])),_0x1b53('0x20'));var _0x363098=path[_0x1b53('0x1c')](_0x2518a2,_0x228aaa);var _0x91584f=path[_0x1b53('0x1c')](_0x2518a2,_0x1e2d2e);if(fs['existsSync'](_0x363098)){_0x2c66be[_0x1b53('0x21')]='Sent';_0x36f0a5['message'][_0x1b53('0x22')]=[{'filename':_0x228aaa,'path':_0x363098}];_0x36f0a5['message'][_0x1b53('0x23')]=util[_0x1b53('0x16')](_0x1b53('0x24'),JSON[_0x1b53('0x25')](_0x2c66be,null,0x2));}else if(fs['existsSync'](_0x91584f)){_0x2c66be['status']=_0x1b53('0x26');_0x36f0a5['message'][_0x1b53('0x22')]=[{'filename':_0x1e2d2e,'path':_0x91584f}];}else{_0x36f0a5['message'][_0x1b53('0x23')]=_0x1b53('0x27');if(!_0x491529['sendIfEmpty']){_0xdf9bdc=![];logger['info'](_0x1b53('0x28'));}}if(_0xdf9bdc){return client[_0x1b53('0x29')](_0x1b53('0x2a'),_0x36f0a5)['then'](function(_0x5434d4){if(_0x5434d4[_0x1b53('0x2b')]){return logger[_0x1b53('0x2b')](_0x1b53('0x2c'),JSON[_0x1b53('0x25')](_0x5434d4));}return logger[_0x1b53('0xb')]('email\x20sent');})['catch'](function(_0x760b82){return logger['error']('error\x20mail',JSON[_0x1b53('0x25')](_0x760b82));});}};}function handleError(){return function(_0x215a62){return logger[_0x1b53('0x2b')](JSON[_0x1b53('0x25')](_0x215a62));};}function handleResult(_0x32dcb6){return function(_0x201ebe){logger[_0x1b53('0xb')](_0x1b53('0x2d'),JSON[_0x1b53('0x25')](_0x201ebe));if(_0x32dcb6['MailAccount']&&_0x32dcb6[_0x1b53('0x10')]['Smtp']&&!_[_0x1b53('0x2e')](_0x32dcb6['email'])){setTimeout(handleSendEmail(_0x32dcb6,_0x201ebe),0x3c*0x3e8);}};}function handleJob(_0x106ca0){return function(){try{if(_[_0x1b53('0x2e')](_0x106ca0[_0x1b53('0x1a')])){return logger[_0x1b53('0xb')](_0x1b53('0x2f'));}if(_[_0x1b53('0x2e')](_0x106ca0['subtractUnit'])){return logger[_0x1b53('0xb')](_0x1b53('0x30'));}var _0x3698ab={'startDate':moment()[_0x1b53('0x31')](_0x106ca0[_0x1b53('0x1a')],_0x106ca0['subtractUnit'])[_0x1b53('0x16')](_0x1b53('0x32')),'endDate':moment()[_0x1b53('0x16')](_0x1b53('0x32')),'type':_0x1b53('0x33'),'output':_0x106ca0['output'],'name':_0x106ca0[_0x1b53('0x34')]};if(!_['isNil'](_0x106ca0[_0x1b53('0x35')])){logger['info'](_0x1b53('0x36'),_0x106ca0['DefaultReportId']);return analyticDefaultReportController[_0x1b53('0x37')]({'id':_0x106ca0[_0x1b53('0x35')]},_0x3698ab)[_0x1b53('0x38')](handleResult(_0x106ca0))['catch'](handleError());}if(!_[_0x1b53('0x2e')](_0x106ca0['CustomReportId'])){logger['info'](_0x1b53('0x39'),_0x106ca0['CustomReportId']);return analyticCustomReportController[_0x1b53('0x37')]({'id':_0x106ca0[_0x1b53('0x3a')]},_0x3698ab)[_0x1b53('0x38')](handleResult(_0x106ca0))[_0x1b53('0x3b')](handleError());}}catch(_0x3017a2){logger[_0x1b53('0x2b')](JSON[_0x1b53('0x25')](_0x3017a2));}return logger[_0x1b53('0xb')]('no\x20report\x20id');};}function getJobs(_0x31102b){var _0x4bc668={};if(_0x31102b){_0x4bc668['id']=_0x31102b;}return db[_0x1b53('0x3c')][_0x1b53('0x3d')]({'where':_0x4bc668,'include':[{'model':db[_0x1b53('0x10')],'attributes':['id',_0x1b53('0x34'),_0x1b53('0xc')],'include':[{'model':db[_0x1b53('0x3e')],'as':'Smtp'}]}]})[_0x1b53('0x38')](function(_0xace87e){var _0x3527c4=_[_0x1b53('0x3f')](manager[_0x1b53('0x40')]);var _0x17ca91=_['map'](_0xace87e,function(_0x23ec66){return _0x23ec66['id'][_0x1b53('0x41')]();});var _0x35053f=_[_0x1b53('0x42')](_0xace87e,function(_0x394ac3){return _0x394ac3['id']['toString']();});var _0x22eaa7=_0x31102b?_0x17ca91:_['difference'](_0x17ca91,_0x3527c4);var _0x25cf08=_[_0x1b53('0x43')](_0x17ca91,_0x3527c4);var _0x1a142c=_[_0x1b53('0x44')](_0x3527c4,_0x17ca91);var _0x3ed5f9;var _0x4a7a5f;for(_0x3ed5f9=0x0;_0x3ed5f9<_0x1a142c[_0x1b53('0x45')]&&!_0x31102b;_0x3ed5f9+=0x1){_0x4a7a5f=_0x1a142c[_0x3ed5f9]['toString']();if(manager[_0x1b53('0x46')](_0x4a7a5f)){manager[_0x1b53('0x47')](_0x4a7a5f);manager[_0x1b53('0x48')](_0x4a7a5f);logger[_0x1b53('0xb')](_0x1b53('0x49'),_0x4a7a5f);}}logger[_0x1b53('0xb')](_0x1b53('0x4a'),JSON[_0x1b53('0x25')](_0x22eaa7));for(_0x3ed5f9=0x0;_0x3ed5f9<_0x22eaa7[_0x1b53('0x45')];_0x3ed5f9+=0x1){_0x4a7a5f=_0x22eaa7[_0x3ed5f9][_0x1b53('0x41')]();logger[_0x1b53('0xb')]('index',_0x4a7a5f);if(_0x31102b){logger[_0x1b53('0xb')](_0x1b53('0x4b'),_0x31102b);logger['info'](JSON[_0x1b53('0x25')](_0x35053f[_0x4a7a5f]));BPromise[_0x1b53('0x4c')]()[_0x1b53('0x38')](handleJob(_0x35053f[_0x4a7a5f]));logger[_0x1b53('0xb')](_0x1b53('0x4d'),_0x35053f[_0x4a7a5f]['name'],_0x35053f[_0x4a7a5f][_0x1b53('0x4e')]);}else if(_0x35053f[_0x4a7a5f][_0x1b53('0x4e')]&&_0x35053f[_0x4a7a5f][_0x1b53('0x4f')]&&moment()[_0x1b53('0x50')](_0x35053f[_0x4a7a5f][_0x1b53('0x51')],_0x35053f[_0x4a7a5f]['endAt'])){manager[_0x1b53('0x52')](_0x4a7a5f,_0x35053f[_0x4a7a5f][_0x1b53('0x4e')],handleJob(_0x35053f[_0x4a7a5f]));manager[_0x1b53('0x53')](_0x4a7a5f);logger[_0x1b53('0xb')](_0x1b53('0x54'),_0x35053f[_0x4a7a5f][_0x1b53('0x34')],_0x35053f[_0x4a7a5f][_0x1b53('0x4e')]);}else if(manager[_0x1b53('0x46')](_0x4a7a5f)){manager['stop'](_0x4a7a5f);manager[_0x1b53('0x48')](_0x4a7a5f);logger[_0x1b53('0xb')]('stop\x20cron',_0x35053f[_0x4a7a5f][_0x1b53('0x34')],_0x35053f[_0x4a7a5f][_0x1b53('0x4e')]);}}for(_0x3ed5f9=0x0,_0x4a7a5f;_0x3ed5f9<_0x25cf08[_0x1b53('0x45')]&&!_0x31102b;_0x3ed5f9+=0x1){_0x4a7a5f=_0x25cf08[_0x3ed5f9][_0x1b53('0x41')]();if(manager[_0x1b53('0x46')](_0x4a7a5f)){if(_0x35053f[_0x4a7a5f]['cron']&&_0x35053f[_0x4a7a5f][_0x1b53('0x4f')]&&moment()[_0x1b53('0x50')](_0x35053f[_0x4a7a5f][_0x1b53('0x51')],_0x35053f[_0x4a7a5f][_0x1b53('0x55')])){manager['update'](_0x4a7a5f,_0x35053f[_0x4a7a5f]['cron'],handleJob(_0x35053f[_0x4a7a5f]));logger[_0x1b53('0xb')]('update\x20cron',_0x35053f[_0x4a7a5f][_0x1b53('0x34')],_0x35053f[_0x4a7a5f][_0x1b53('0x4e')]);}else{manager[_0x1b53('0x47')](_0x4a7a5f);manager[_0x1b53('0x48')](_0x4a7a5f);logger['info'](_0x1b53('0x56'),_0x35053f[_0x4a7a5f][_0x1b53('0x34')],_0x35053f[_0x4a7a5f][_0x1b53('0x4e')]);}}}})[_0x1b53('0x3b')](function(_0x2e5572){logger[_0x1b53('0x2b')](JSON['stringify'](_0x2e5572));});}exports[_0x1b53('0x57')]=function(_0x4dfc6c){return getJobs(_0x4dfc6c);};exports[_0x1b53('0x53')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
index 839673f..11ac8e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f7a=['[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','name','inspect','VoiceRecording','findAll','IN_PROGRESS','Setting','Settings\x20not\x20available','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','forEach','push','all','SequelizeValidationError','error','lodash','aws-sdk','request-promise','util','../../mysqldb','../../config/logger','transcribe','TranscribeService','detectSentiment','info','format','transcribeName','data2','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','COMPLETED','TranscriptionJobStatus','Transcript','TranscriptFileUri','transcripts','results','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sequelize','Sentiment\x20Analysis\x20not\x20configured','fileText','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','data1','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Positive','SentimentScore','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','Cloud\x20Provider\x20not\x20configured'];(function(_0x3a2038,_0x31bb2b){var _0x16adf8=function(_0x23a50c){while(--_0x23a50c){_0x3a2038['push'](_0x3a2038['shift']());}};_0x16adf8(++_0x31bb2b);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x4584c5,_0x25fa37){_0x4584c5=_0x4584c5-0x0;var _0x315278=_0x6f7a[_0x4584c5];return _0x315278;};var _=require(_0xa6f7('0x0'));var AWS=require(_0xa6f7('0x1'));var rp=require(_0xa6f7('0x2'));var util=require(_0xa6f7('0x3'));var BPromise=require('bluebird');var db=require(_0xa6f7('0x4'))['db'];var logger=require(_0xa6f7('0x5'))(_0xa6f7('0x6'));function getTranscriptionJob(_0x1da6dc,_0x22e529,_0x1f5922,_0x35f8f0){return new Promise(function(_0x20cccd,_0x1fdd5f){var _0x335aaa=new AWS[(_0xa6f7('0x7'))]({'accessKeyId':_0x22e529,'secretAccessKey':_0x1da6dc,'region':_0x1f5922});_0x335aaa['getTranscriptionJob']({'TranscriptionJobName':_0x35f8f0},function(_0x4b4f9e,_0x30f2a7){if(_0x4b4f9e){return _0x1fdd5f(_0x4b4f9e);}else{return _0x20cccd(_0x30f2a7);}});});}function sentiment(_0x2674c9,_0x397020,_0x362404,_0x23bb05,_0x49a451){return new Promise(function(_0x5bdc9e,_0x2fd1d0){var _0x225da4=new AWS['Comprehend']({'accessKeyId':_0x397020,'secretAccessKey':_0x2674c9,'region':_0x362404});_0x225da4[_0xa6f7('0x8')]({'Text':_0x23bb05,'LanguageCode':_0x49a451['substring'](0x0,0x2)},function(_0x315096,_0x1303c3){if(_0x315096){return _0x2fd1d0(_0x315096);}else{return _0x5bdc9e(_0x1303c3);}});});}function checkTranscribeJob(_0x13425e,_0xd5558b,_0x5a3035){var _0x3fc7f1;return new BPromise(function(_0x532352,_0x25b48f){logger[_0xa6f7('0x9')](util[_0xa6f7('0xa')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x13425e['id'],_0x13425e[_0xa6f7('0xb')]));return getTranscriptionJob(_0x5a3035['data1'],_0x5a3035[_0xa6f7('0xc')],_0xd5558b['transcribeRegion'],_0x13425e[_0xa6f7('0xb')])[_0xa6f7('0xd')](function(_0x6efd38){logger['info'](util[_0xa6f7('0xa')](_0xa6f7('0xe'),_0x13425e['id'],_0x13425e[_0xa6f7('0xb')],_0x6efd38[_0xa6f7('0xf')]['TranscriptionJobStatus']));if(!_0x13425e['fileText']){switch(_0x6efd38[_0xa6f7('0xf')]['TranscriptionJobStatus']){case _0xa6f7('0x10'):var _0x369262={'transcribeStatus':_0x6efd38['TranscriptionJob'][_0xa6f7('0x11')],'fileUri':_0x6efd38[_0xa6f7('0xf')][_0xa6f7('0x12')][_0xa6f7('0x13')]};logger[_0xa6f7('0x9')](util[_0xa6f7('0xa')]('[RECORDING:%d]\x20Get\x20transcript',_0x13425e['id']));return rp({'uri':_0x6efd38[_0xa6f7('0xf')][_0xa6f7('0x12')]['TranscriptFileUri'],'json':!![]})['then'](function(_0x5ddc8d){logger[_0xa6f7('0x9')](util[_0xa6f7('0xa')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x13425e['id']));if(_0x5ddc8d&&_0x5ddc8d['results']&&_0x5ddc8d['results'][_0xa6f7('0x14')]&&_0x5ddc8d[_0xa6f7('0x15')][_0xa6f7('0x14')]['length']){_0x369262['fileText']='';for(var _0x2f4907=0x0;_0x2f4907<_0x5ddc8d['results']['transcripts'][_0xa6f7('0x16')];_0x2f4907++){_0x369262['fileText']+=_0x5ddc8d[_0xa6f7('0x15')][_0xa6f7('0x14')][_0x2f4907][_0xa6f7('0x17')]+'';}}return _0x13425e[_0xa6f7('0x18')](_0x369262);})[_0xa6f7('0xd')](function(){logger['info'](util['format'](_0xa6f7('0x19'),_0x13425e['id']));if(!_0x13425e[_0xa6f7('0x1a')]){throw new db['Sequelize'][(_0xa6f7('0x1b'))](_0xa6f7('0x1c'));}if(!_0xd5558b[_0xa6f7('0x1d')]||!_0xd5558b[_0xa6f7('0x1e')]||!_0xd5558b[_0xa6f7('0x1f')]||!_0xd5558b[_0xa6f7('0x20')]||!_0xd5558b[_0xa6f7('0x21')]){throw new db[(_0xa6f7('0x22'))][(_0xa6f7('0x1b'))](_0xa6f7('0x23'));}if(!_0x369262[_0xa6f7('0x24')]){throw new Error(_0xa6f7('0x25'));}if(_0xd5558b['sentimentAccountId']===_0x5a3035['id']){return _0x5a3035;}else{return db[_0xa6f7('0x26')][_0xa6f7('0x27')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0xa6f7('0xd')](function(_0x34d571){if(!_0x34d571){throw new db['Sequelize']['ValidationError'](_0xa6f7('0x28'));}if(!_0x34d571[_0xa6f7('0x29')]||!_0x34d571[_0xa6f7('0xc')]){throw new db[(_0xa6f7('0x22'))][(_0xa6f7('0x1b'))]('Cloud\x20Provider\x20not\x20configured');}_0x3fc7f1=_0x34d571;logger['info'](util[_0xa6f7('0xa')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x13425e['id']));return sentiment(_0x3fc7f1[_0xa6f7('0x29')],_0x3fc7f1[_0xa6f7('0xc')],_0xd5558b[_0xa6f7('0x1f')],_0x369262[_0xa6f7('0x24')],_0xd5558b[_0xa6f7('0x20')]);})[_0xa6f7('0xd')](function(_0x4d2d38){logger[_0xa6f7('0x9')](util[_0xa6f7('0xa')](_0xa6f7('0x2a'),_0x13425e['id']));return _0x13425e['update']({'sentiment':_0x4d2d38[_0xa6f7('0x2b')],'sPositive':_0x4d2d38['SentimentScore'][_0xa6f7('0x2c')],'sNegative':_0x4d2d38[_0xa6f7('0x2d')][_0xa6f7('0x2e')],'sMixed':_0x4d2d38['SentimentScore'][_0xa6f7('0x2f')],'sNeutral':_0x4d2d38[_0xa6f7('0x2d')][_0xa6f7('0x30')]});})[_0xa6f7('0xd')](function(){logger[_0xa6f7('0x9')](util[_0xa6f7('0xa')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x13425e['id']));_0x532352();});case _0xa6f7('0x31'):return _0x13425e[_0xa6f7('0x18')]({'transcribeStatus':_0xa6f7('0x31'),'failureReason':_0x6efd38[_0xa6f7('0xf')][_0xa6f7('0x32')]})[_0xa6f7('0xd')](function(){logger[_0xa6f7('0x9')](util[_0xa6f7('0xa')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x13425e['id']));_0x532352();});default:logger[_0xa6f7('0x9')](util[_0xa6f7('0xa')](_0xa6f7('0x33'),_0x13425e['id']));break;}}else{return BPromise['resolve']()[_0xa6f7('0xd')](function(){if(!_0x13425e[_0xa6f7('0x1a')]){throw new db['Sequelize'][(_0xa6f7('0x1b'))](_0xa6f7('0x1c'));}if(!_0xd5558b[_0xa6f7('0x1d')]||!_0xd5558b[_0xa6f7('0x1e')]||!_0xd5558b[_0xa6f7('0x1f')]||!_0xd5558b['language']||!_0xd5558b[_0xa6f7('0x21')]){throw new db[(_0xa6f7('0x22'))][(_0xa6f7('0x1b'))](_0xa6f7('0x23'));}if(!_0x13425e[_0xa6f7('0x24')]){throw new Error(_0xa6f7('0x25'));}if(_0xd5558b[_0xa6f7('0x1e')]===_0x5a3035['id']){return _0x5a3035;}else{return db[_0xa6f7('0x26')]['findOne']({'where':{'id':_settings['sentimentAccountId']}});}})[_0xa6f7('0xd')](function(_0x3e1535){if(!_0x3e1535){throw new db[(_0xa6f7('0x22'))][(_0xa6f7('0x1b'))](_0xa6f7('0x28'));}if(!_0x3e1535[_0xa6f7('0x29')]||!_0x3e1535[_0xa6f7('0xc')]){throw new db[(_0xa6f7('0x22'))][(_0xa6f7('0x1b'))](_0xa6f7('0x34'));}_0x3fc7f1=_0x3e1535;logger['info'](util[_0xa6f7('0xa')](_0xa6f7('0x35'),_0x13425e['id']));return sentiment(_0x3fc7f1['data1'],_0x3fc7f1[_0xa6f7('0xc')],_0xd5558b[_0xa6f7('0x1f')],_0x13425e[_0xa6f7('0x24')],_0xd5558b[_0xa6f7('0x20')]);})['then'](function(_0x25482b){logger['info'](util['format'](_0xa6f7('0x2a'),_0x13425e['id']));return _0x13425e[_0xa6f7('0x18')]({'sentiment':_0x25482b[_0xa6f7('0x2b')],'sPositive':_0x25482b[_0xa6f7('0x2d')][_0xa6f7('0x2c')],'sNegative':_0x25482b[_0xa6f7('0x2d')][_0xa6f7('0x2e')],'sMixed':_0x25482b['SentimentScore'][_0xa6f7('0x2f')],'sNeutral':_0x25482b[_0xa6f7('0x2d')]['Neutral'],'transcribeStatus':_0xa6f7('0x10')});})[_0xa6f7('0xd')](function(){logger[_0xa6f7('0x9')](util['format'](_0xa6f7('0x19'),_0x13425e['id']));_0x532352();});}})['catch'](function(_0x1e39d8){if(_0x1e39d8){if(!_0x1e39d8[_0xa6f7('0x36')]||_0x1e39d8[_0xa6f7('0x36')]!=='SequelizeValidationError'){logger['error'](util[_0xa6f7('0xa')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x13425e['id']),util[_0xa6f7('0x37')](_0x1e39d8,{'showHidden':![],'depth':null}));}}_0x532352();});});}function checkTranscribe(){var _0x4869d0;var _0x5700f3;var _0x1e7089;return db[_0xa6f7('0x38')][_0xa6f7('0x39')]({'where':{'transcribeStatus':_0xa6f7('0x3a')}})[_0xa6f7('0xd')](function(_0x3bd4f6){if(!_0x3bd4f6||!_0x3bd4f6['length']){throw new db[(_0xa6f7('0x22'))][(_0xa6f7('0x1b'))]('No\x20transcribe\x20job\x20to\x20check');}_0x4869d0=_0x3bd4f6;return db[_0xa6f7('0x3b')]['findOne']({'where':{'id':0x1}});})[_0xa6f7('0xd')](function(_0x59091a){if(!_0x59091a){throw new db['Sequelize'][(_0xa6f7('0x1b'))](_0xa6f7('0x3c'));}_0x5700f3=_0x59091a;if(!_0x5700f3[_0xa6f7('0x6')]||!_0x5700f3[_0xa6f7('0x3d')]||!_0x5700f3[_0xa6f7('0x3e')]||!_0x5700f3['language']||!_0x5700f3[_0xa6f7('0x21')]){throw new db[(_0xa6f7('0x22'))]['ValidationError'](_0xa6f7('0x3f'));}return db['CloudProvider'][_0xa6f7('0x27')]({'where':{'id':_0x5700f3[_0xa6f7('0x3d')]}});})[_0xa6f7('0xd')](function(_0x55369a){if(!_0x55369a){throw new db[(_0xa6f7('0x22'))]['ValidationError'](_0xa6f7('0x28'));}if(!_0x55369a[_0xa6f7('0x29')]||!_0x55369a[_0xa6f7('0xc')]){throw new db[(_0xa6f7('0x22'))][(_0xa6f7('0x1b'))]('Cloud\x20Provider\x20not\x20configured');}_0x1e7089=_0x55369a;var _0x5d05d6=[];_0x4869d0[_0xa6f7('0x40')](function(_0x405fc){_0x5d05d6[_0xa6f7('0x41')](checkTranscribeJob(_0x405fc,_0x5700f3,_0x1e7089));});return BPromise[_0xa6f7('0x42')](_0x5d05d6);})['catch'](function(_0x9d901e){if(_0x9d901e){if(!_0x9d901e[_0xa6f7('0x36')]||_0x9d901e[_0xa6f7('0x36')]!==_0xa6f7('0x43')){logger[_0xa6f7('0x44')](util[_0xa6f7('0x37')](_0x9d901e,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
+var _0x80ed=['Comprehend','detectSentiment','substring','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','then','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','fileText','TranscriptionJobStatus','COMPLETED','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','ValidationError','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Positive','SentimentScore','Negative','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Sentiment\x20Analysis\x20not\x20configured','Mixed','Neutral','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','transcribeAccountId','transcribeRegion','forEach','push','all','start','lodash','request-promise','util','bluebird','../../config/logger','transcribe','TranscribeService','getTranscriptionJob'];(function(_0xde67c3,_0x4015ae){var _0x82d380=function(_0x1c71de){while(--_0x1c71de){_0xde67c3['push'](_0xde67c3['shift']());}};_0x82d380(++_0x4015ae);}(_0x80ed,0x11c));var _0xd80e=function(_0x46fdf3,_0x59611d){_0x46fdf3=_0x46fdf3-0x0;var _0x1e8e6e=_0x80ed[_0x46fdf3];return _0x1e8e6e;};var _=require(_0xd80e('0x0'));var AWS=require('aws-sdk');var rp=require(_0xd80e('0x1'));var util=require(_0xd80e('0x2'));var BPromise=require(_0xd80e('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0xd80e('0x4'))(_0xd80e('0x5'));function getTranscriptionJob(_0x2b742b,_0x3413d4,_0x5ae6c6,_0x26e6ff){return new Promise(function(_0x2b4742,_0x252fec){var _0x51c361=new AWS[(_0xd80e('0x6'))]({'accessKeyId':_0x3413d4,'secretAccessKey':_0x2b742b,'region':_0x5ae6c6});_0x51c361[_0xd80e('0x7')]({'TranscriptionJobName':_0x26e6ff},function(_0x3b4f35,_0x1bacd3){if(_0x3b4f35){return _0x252fec(_0x3b4f35);}else{return _0x2b4742(_0x1bacd3);}});});}function sentiment(_0x46afc4,_0x298c29,_0x3063ff,_0x2457f5,_0x68625){return new Promise(function(_0x7f93b4,_0x4eee08){var _0x450b44=new AWS[(_0xd80e('0x8'))]({'accessKeyId':_0x298c29,'secretAccessKey':_0x46afc4,'region':_0x3063ff});_0x450b44[_0xd80e('0x9')]({'Text':_0x2457f5,'LanguageCode':_0x68625[_0xd80e('0xa')](0x0,0x2)},function(_0x1d999d,_0x14ccda){if(_0x1d999d){return _0x4eee08(_0x1d999d);}else{return _0x7f93b4(_0x14ccda);}});});}function checkTranscribeJob(_0x1a9024,_0x118f53,_0x1d3fcf){var _0x4fb01c;return new BPromise(function(_0x5691a1,_0x5eb3b2){logger['info'](util[_0xd80e('0xb')](_0xd80e('0xc'),_0x1a9024['id'],_0x1a9024[_0xd80e('0xd')]));return getTranscriptionJob(_0x1d3fcf[_0xd80e('0xe')],_0x1d3fcf[_0xd80e('0xf')],_0x118f53['transcribeRegion'],_0x1a9024[_0xd80e('0xd')])[_0xd80e('0x10')](function(_0x3124e8){logger[_0xd80e('0x11')](util[_0xd80e('0xb')](_0xd80e('0x12'),_0x1a9024['id'],_0x1a9024[_0xd80e('0xd')],_0x3124e8[_0xd80e('0x13')]['TranscriptionJobStatus']));if(!_0x1a9024[_0xd80e('0x14')]){switch(_0x3124e8[_0xd80e('0x13')][_0xd80e('0x15')]){case _0xd80e('0x16'):var _0x593af6={'transcribeStatus':_0x3124e8[_0xd80e('0x13')][_0xd80e('0x15')],'fileUri':_0x3124e8[_0xd80e('0x13')]['Transcript'][_0xd80e('0x17')]};logger[_0xd80e('0x11')](util[_0xd80e('0xb')](_0xd80e('0x18'),_0x1a9024['id']));return rp({'uri':_0x3124e8[_0xd80e('0x13')]['Transcript']['TranscriptFileUri'],'json':!![]})[_0xd80e('0x10')](function(_0x3fa159){logger[_0xd80e('0x11')](util[_0xd80e('0xb')](_0xd80e('0x19'),_0x1a9024['id']));if(_0x3fa159&&_0x3fa159[_0xd80e('0x1a')]&&_0x3fa159[_0xd80e('0x1a')]['transcripts']&&_0x3fa159[_0xd80e('0x1a')][_0xd80e('0x1b')][_0xd80e('0x1c')]){_0x593af6['fileText']='';for(var _0x635ce0=0x0;_0x635ce0<_0x3fa159[_0xd80e('0x1a')][_0xd80e('0x1b')]['length'];_0x635ce0++){_0x593af6['fileText']+=_0x3fa159['results'][_0xd80e('0x1b')][_0x635ce0]['transcript']+'';}}return _0x1a9024[_0xd80e('0x1d')](_0x593af6);})[_0xd80e('0x10')](function(){logger['info'](util[_0xd80e('0xb')](_0xd80e('0x1e'),_0x1a9024['id']));if(!_0x1a9024[_0xd80e('0x1f')]){throw new db[(_0xd80e('0x20'))]['ValidationError'](_0xd80e('0x21'));}if(!_0x118f53[_0xd80e('0x22')]||!_0x118f53[_0xd80e('0x23')]||!_0x118f53[_0xd80e('0x24')]||!_0x118f53[_0xd80e('0x25')]||!_0x118f53[_0xd80e('0x26')]){throw new db[(_0xd80e('0x20'))][(_0xd80e('0x27'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x593af6['fileText']){throw new Error(_0xd80e('0x28'));}if(_0x118f53[_0xd80e('0x23')]===_0x1d3fcf['id']){return _0x1d3fcf;}else{return db[_0xd80e('0x29')][_0xd80e('0x2a')]({'where':{'id':_settings[_0xd80e('0x23')]}});}})[_0xd80e('0x10')](function(_0x506842){if(!_0x506842){throw new db['Sequelize'][(_0xd80e('0x27'))](_0xd80e('0x2b'));}if(!_0x506842[_0xd80e('0xe')]||!_0x506842[_0xd80e('0xf')]){throw new db[(_0xd80e('0x20'))][(_0xd80e('0x27'))](_0xd80e('0x2c'));}_0x4fb01c=_0x506842;logger[_0xd80e('0x11')](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x1a9024['id']));return sentiment(_0x4fb01c[_0xd80e('0xe')],_0x4fb01c[_0xd80e('0xf')],_0x118f53[_0xd80e('0x24')],_0x593af6[_0xd80e('0x14')],_0x118f53[_0xd80e('0x25')]);})[_0xd80e('0x10')](function(_0x17b8c7){logger[_0xd80e('0x11')](util[_0xd80e('0xb')](_0xd80e('0x2d'),_0x1a9024['id']));return _0x1a9024['update']({'sentiment':_0x17b8c7[_0xd80e('0x2e')],'sPositive':_0x17b8c7['SentimentScore'][_0xd80e('0x2f')],'sNegative':_0x17b8c7[_0xd80e('0x30')][_0xd80e('0x31')],'sMixed':_0x17b8c7[_0xd80e('0x30')]['Mixed'],'sNeutral':_0x17b8c7[_0xd80e('0x30')]['Neutral']});})[_0xd80e('0x10')](function(){logger['info'](util[_0xd80e('0xb')](_0xd80e('0x1e'),_0x1a9024['id']));_0x5691a1();});case'FAILED':return _0x1a9024[_0xd80e('0x1d')]({'transcribeStatus':_0xd80e('0x32'),'failureReason':_0x3124e8[_0xd80e('0x13')]['FailureReason']})[_0xd80e('0x10')](function(){logger[_0xd80e('0x11')](util[_0xd80e('0xb')](_0xd80e('0x1e'),_0x1a9024['id']));_0x5691a1();});default:logger[_0xd80e('0x11')](util[_0xd80e('0xb')](_0xd80e('0x33'),_0x1a9024['id']));break;}}else{return BPromise[_0xd80e('0x34')]()[_0xd80e('0x10')](function(){if(!_0x1a9024['tempSentiment']){throw new db['Sequelize']['ValidationError'](_0xd80e('0x21'));}if(!_0x118f53[_0xd80e('0x22')]||!_0x118f53['sentimentAccountId']||!_0x118f53[_0xd80e('0x24')]||!_0x118f53['language']||!_0x118f53[_0xd80e('0x26')]){throw new db['Sequelize'][(_0xd80e('0x27'))](_0xd80e('0x35'));}if(!_0x1a9024['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x118f53[_0xd80e('0x23')]===_0x1d3fcf['id']){return _0x1d3fcf;}else{return db[_0xd80e('0x29')][_0xd80e('0x2a')]({'where':{'id':_settings[_0xd80e('0x23')]}});}})[_0xd80e('0x10')](function(_0x19de99){if(!_0x19de99){throw new db[(_0xd80e('0x20'))][(_0xd80e('0x27'))](_0xd80e('0x2b'));}if(!_0x19de99[_0xd80e('0xe')]||!_0x19de99[_0xd80e('0xf')]){throw new db[(_0xd80e('0x20'))][(_0xd80e('0x27'))](_0xd80e('0x2c'));}_0x4fb01c=_0x19de99;logger[_0xd80e('0x11')](util[_0xd80e('0xb')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x1a9024['id']));return sentiment(_0x4fb01c['data1'],_0x4fb01c['data2'],_0x118f53[_0xd80e('0x24')],_0x1a9024['fileText'],_0x118f53[_0xd80e('0x25')]);})[_0xd80e('0x10')](function(_0x551bd5){logger[_0xd80e('0x11')](util[_0xd80e('0xb')](_0xd80e('0x2d'),_0x1a9024['id']));return _0x1a9024['update']({'sentiment':_0x551bd5['Sentiment'],'sPositive':_0x551bd5['SentimentScore'][_0xd80e('0x2f')],'sNegative':_0x551bd5['SentimentScore'][_0xd80e('0x31')],'sMixed':_0x551bd5[_0xd80e('0x30')][_0xd80e('0x36')],'sNeutral':_0x551bd5[_0xd80e('0x30')][_0xd80e('0x37')],'transcribeStatus':'COMPLETED'});})[_0xd80e('0x10')](function(){logger[_0xd80e('0x11')](util[_0xd80e('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x1a9024['id']));_0x5691a1();});}})[_0xd80e('0x38')](function(_0x42ce0){if(_0x42ce0){if(!_0x42ce0[_0xd80e('0x39')]||_0x42ce0['name']!==_0xd80e('0x3a')){logger[_0xd80e('0x3b')](util[_0xd80e('0xb')](_0xd80e('0x3c'),_0x1a9024['id']),util[_0xd80e('0x3d')](_0x42ce0,{'showHidden':![],'depth':null}));}}_0x5691a1();});});}function checkTranscribe(){var _0x32b36a;var _0x56ba81;var _0x5aad1b;return db[_0xd80e('0x3e')][_0xd80e('0x3f')]({'where':{'transcribeStatus':_0xd80e('0x40')}})['then'](function(_0x4af8a9){if(!_0x4af8a9||!_0x4af8a9[_0xd80e('0x1c')]){throw new db[(_0xd80e('0x20'))][(_0xd80e('0x27'))](_0xd80e('0x41'));}_0x32b36a=_0x4af8a9;return db[_0xd80e('0x42')]['findOne']({'where':{'id':0x1}});})[_0xd80e('0x10')](function(_0x5c392d){if(!_0x5c392d){throw new db[(_0xd80e('0x20'))][(_0xd80e('0x27'))]('Settings\x20not\x20available');}_0x56ba81=_0x5c392d;if(!_0x56ba81[_0xd80e('0x5')]||!_0x56ba81[_0xd80e('0x43')]||!_0x56ba81[_0xd80e('0x44')]||!_0x56ba81[_0xd80e('0x25')]||!_0x56ba81[_0xd80e('0x26')]){throw new db[(_0xd80e('0x20'))][(_0xd80e('0x27'))]('Transcribe\x20not\x20configured');}return db[_0xd80e('0x29')][_0xd80e('0x2a')]({'where':{'id':_0x56ba81[_0xd80e('0x43')]}});})['then'](function(_0x52ab04){if(!_0x52ab04){throw new db[(_0xd80e('0x20'))][(_0xd80e('0x27'))](_0xd80e('0x2b'));}if(!_0x52ab04[_0xd80e('0xe')]||!_0x52ab04[_0xd80e('0xf')]){throw new db[(_0xd80e('0x20'))][(_0xd80e('0x27'))](_0xd80e('0x2c'));}_0x5aad1b=_0x52ab04;var _0x5205c4=[];_0x32b36a[_0xd80e('0x45')](function(_0x5d6590){_0x5205c4[_0xd80e('0x46')](checkTranscribeJob(_0x5d6590,_0x56ba81,_0x5aad1b));});return BPromise[_0xd80e('0x47')](_0x5205c4);})[_0xd80e('0x38')](function(_0xd4284d){if(_0xd4284d){if(!_0xd4284d[_0xd80e('0x39')]||_0xd4284d[_0xd80e('0x39')]!=='SequelizeValidationError'){logger[_0xd80e('0x3b')](util['inspect'](_0xd4284d,{'showHidden':![],'depth':null}));}}});}exports[_0xd80e('0x48')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
index cfe26cc..d9ea5ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7096=['then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','join','emit','catch','error','inspect','start','moment','util','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt'];(function(_0x591729,_0x273002){var _0x1f5b56=function(_0x2e91b0){while(--_0x2e91b0){_0x591729['push'](_0x591729['shift']());}};_0x1f5b56(++_0x273002);}(_0x7096,0x10c));var _0x6709=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x7096[_0x134c2e];return _0x2825db;};'use strict';var _=require('lodash');var moment=require(_0x6709('0x0'));var Redis=require('ioredis');var util=require(_0x6709('0x1'));var config=require('../../config/environment');var db=require(_0x6709('0x2'))['db'];var logger=require(_0x6709('0x3'))(_0x6709('0x4'));config[_0x6709('0x5')]=_[_0x6709('0x6')](config[_0x6709('0x5')],{'host':_0x6709('0x7'),'port':0x18eb});var io=require(_0x6709('0x8'))(new Redis(config[_0x6709('0x5')]));function closeInteractions(){var _0x3e2223=[];return db[_0x6709('0x9')][_0x6709('0xa')]({'raw':!![],'attributes':['id',_0x6709('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,'hours')}}})[_0x6709('0xc')](function(_0x2d8c0b){if(_0x2d8c0b&&_0x2d8c0b[_0x6709('0xd')]){_0x3e2223=_[_0x6709('0xe')](_0x2d8c0b||[],'id');logger[_0x6709('0xf')](_0x6709('0x10'),_0x3e2223['join']());return db['WhatsappInteraction'][_0x6709('0x11')]({'closeReason':_0x6709('0x12'),'disposition':_0x6709('0x13'),'closed':!![],'closedAt':moment()[_0x6709('0x14')](_0x6709('0x15'))},{'where':{'id':_0x3e2223}});}})[_0x6709('0xc')](function(){if(_0x3e2223&&_0x3e2223[_0x6709('0xd')]){logger[_0x6709('0xf')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x3e2223[_0x6709('0x16')]());for(var _0xf59b6e=0x0;_0xf59b6e<_0x3e2223[_0x6709('0xd')];_0xf59b6e++){io[_0x6709('0x17')]('whatsappInteraction:update',{'id':_0x3e2223[_0xf59b6e],'closed':!![]});}}})[_0x6709('0x18')](function(_0x5c667c){logger[_0x6709('0x19')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x5c667c?util[_0x6709('0x1a')](_0x5c667c,{'showHidden':![],'depth':null}):'');});}exports[_0x6709('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0xebc8=['info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','format','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','WhatsappInteraction','findAll','lastMsgAt','hours','then','length','map'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0xebc8,0x1c0));var _0x8ebc=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xebc8[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x8ebc('0x0'));var moment=require('moment');var Redis=require(_0x8ebc('0x1'));var util=require(_0x8ebc('0x2'));var config=require(_0x8ebc('0x3'));var db=require(_0x8ebc('0x4'))['db'];var logger=require(_0x8ebc('0x5'))(_0x8ebc('0x6'));config[_0x8ebc('0x7')]=_[_0x8ebc('0x8')](config[_0x8ebc('0x7')],{'host':_0x8ebc('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x2ad55c=[];return db[_0x8ebc('0xa')][_0x8ebc('0xb')]({'raw':!![],'attributes':['id',_0x8ebc('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0x8ebc('0xd'))}}})[_0x8ebc('0xe')](function(_0x171c99){if(_0x171c99&&_0x171c99[_0x8ebc('0xf')]){_0x2ad55c=_[_0x8ebc('0x10')](_0x171c99||[],'id');logger[_0x8ebc('0x11')](_0x8ebc('0x12'),_0x2ad55c[_0x8ebc('0x13')]());return db[_0x8ebc('0xa')][_0x8ebc('0x14')]({'closeReason':_0x8ebc('0x15'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x8ebc('0x16')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x2ad55c}});}})[_0x8ebc('0xe')](function(){if(_0x2ad55c&&_0x2ad55c[_0x8ebc('0xf')]){logger[_0x8ebc('0x11')](_0x8ebc('0x17'),_0x2ad55c[_0x8ebc('0x13')]());for(var _0x3307c7=0x0;_0x3307c7<_0x2ad55c[_0x8ebc('0xf')];_0x3307c7++){io[_0x8ebc('0x18')](_0x8ebc('0x19'),{'id':_0x2ad55c[_0x3307c7],'closed':!![]});}}})[_0x8ebc('0x1a')](function(_0x1d14ab){logger[_0x8ebc('0x1b')](_0x8ebc('0x1c'),_0x1d14ab?util[_0x8ebc('0x1d')](_0x1d14ab,{'showHidden':![],'depth':null}):'');});}exports[_0x8ebc('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index d29ea8b..4b97e2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81f9=['push','Innocenzo','Biondo','innocenzo.biondo','now','@xcally.com','destroy','then','bulkCreate','log','contacts1','CmHopper','finished\x20populating','hopper1','contacts2','hopper2','../mysqldb'];(function(_0x2700d5,_0x1b113b){var _0xdc3338=function(_0x1d07ed){while(--_0x1d07ed){_0x2700d5['push'](_0x2700d5['shift']());}};_0xdc3338(++_0x1b113b);}(_0x81f9,0x175));var _0x981f=function(_0x4c6d63,_0x3fa2f6){_0x4c6d63=_0x4c6d63-0x0;var _0x549a8c=_0x81f9[_0x4c6d63];return _0x549a8c;};'use strict';var util=require('util');var db=require(_0x981f('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x981f('0x1')]({'id':i,'firstName':_0x981f('0x2')+i,'lastName':_0x981f('0x3')+i,'phone':0xf879fb460+i,'email':_0x981f('0x4')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x981f('0x1')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x981f('0x5')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x981f('0x1')]({'id':i,'firstName':_0x981f('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x981f('0x4')+i+_0x981f('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x981f('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x981f('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x981f('0x5')]()});}db['CmContact'][_0x981f('0x7')]({'where':{}})[_0x981f('0x8')](function(){return db['CmContact'][_0x981f('0x9')](contacts);})[_0x981f('0x8')](function(){console[_0x981f('0xa')]('finished\x20populating',_0x981f('0xb'));return db[_0x981f('0xc')][_0x981f('0x7')]({'where':{}});})[_0x981f('0x8')](function(){return db[_0x981f('0xc')]['bulkCreate'](hopper);})[_0x981f('0x8')](function(){console[_0x981f('0xa')](_0x981f('0xd'),_0x981f('0xe'));return db['CmContact']['bulkCreate'](contacts2);})[_0x981f('0x8')](function(){console['log'](_0x981f('0xd'),_0x981f('0xf'));return db[_0x981f('0xc')][_0x981f('0x9')](hopper2);})['then'](function(){console[_0x981f('0xa')](_0x981f('0xd'),_0x981f('0x10'));})['catch'](function(_0x25112c){console[_0x981f('0xa')](_0x25112c);});
\ No newline at end of file
+var _0xb2e7=['now','Biondo','innocenzo.biondo','CmContact','bulkCreate','then','contacts1','destroy','finished\x20populating','hopper1','log','contacts2','catch','util','../mysqldb','push','Innocenzo','@xcally.com'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0xb2e7,0x1e1));var _0x7b2e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb2e7[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x7b2e('0x0'));var db=require(_0x7b2e('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x7b2e('0x2')]({'id':i,'firstName':_0x7b2e('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x7b2e('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x7b2e('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x7b2e('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x7b2e('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x7b2e('0x6')+i,'phone':0xf879fb460+i,'email':_0x7b2e('0x7')+i+_0x7b2e('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x7b2e('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x7b2e('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x7b2e('0x5')](),'updatedAt':Date[_0x7b2e('0x5')]()});}db[_0x7b2e('0x8')]['destroy']({'where':{}})['then'](function(){return db[_0x7b2e('0x8')][_0x7b2e('0x9')](contacts);})[_0x7b2e('0xa')](function(){console['log']('finished\x20populating',_0x7b2e('0xb'));return db['CmHopper'][_0x7b2e('0xc')]({'where':{}});})['then'](function(){return db['CmHopper'][_0x7b2e('0x9')](hopper);})[_0x7b2e('0xa')](function(){console['log'](_0x7b2e('0xd'),_0x7b2e('0xe'));return db[_0x7b2e('0x8')][_0x7b2e('0x9')](contacts2);})[_0x7b2e('0xa')](function(){console[_0x7b2e('0xf')](_0x7b2e('0xd'),_0x7b2e('0x10'));return db['CmHopper']['bulkCreate'](hopper2);})[_0x7b2e('0xa')](function(){console[_0x7b2e('0xf')](_0x7b2e('0xd'),'hopper2');})[_0x7b2e('0x11')](function(_0x11655d){console[_0x7b2e('0xf')](_0x11655d);});
\ No newline at end of file
index 63d301c..dbbdbf3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5676=['format','%s%s@xcally.com','password','udp','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','catch','util','push','agent','%s%s'];(function(_0x344a5b,_0x45a686){var _0x40cdbb=function(_0x422c96){while(--_0x422c96){_0x344a5b['push'](_0x344a5b['shift']());}};_0x40cdbb(++_0x45a686);}(_0x5676,0x165));var _0x6567=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x5676[_0x4b369d];return _0x571a98;};'use strict';var util=require(_0x6567('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x6567('0x1')]({'name':util['format']('%s%s',_0x6567('0x2'),i),'fullname':util['format'](_0x6567('0x3'),_0x6567('0x2'),i),'email':util[_0x6567('0x4')](_0x6567('0x5'),_0x6567('0x2'),i),'role':_0x6567('0x2'),'password':_0x6567('0x6'),'internal':0xfa0+i,'type':'friend','transport':[_0x6567('0x7'),'ws',_0x6567('0x8')],'disallow':['all'],'allow':[_0x6567('0x9')],'defaultuser':util[_0x6567('0x4')](_0x6567('0x3'),_0x6567('0x2'),i),'encryption':'yes','avpf':'yes','force_avp':_0x6567('0xa'),'icesupport':_0x6567('0xa'),'dtlsenable':_0x6567('0xa'),'dtlsverify':'no','dtlscertfile':_0x6567('0xb'),'dtlsprivatekey':_0x6567('0xc'),'dtlssetup':'actpass','callerid':util['format'](_0x6567('0xd'),util[_0x6567('0x4')]('%s%s',_0x6567('0x2'),i),0xfa0+i)});}db[_0x6567('0xe')][_0x6567('0xf')](users)[_0x6567('0x10')](function(){console[_0x6567('0x11')]('add\x20user');})[_0x6567('0x12')](function(_0x2259ad){console['log'](_0x2259ad);});
\ No newline at end of file
+var _0xf4ac=['log','add\x20user','catch','util','push','format','%s%s','agent','%s%s@xcally.com','password','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','bulkCreate'];(function(_0x2ba6be,_0x2e4811){var _0x1bcc27=function(_0x3be616){while(--_0x3be616){_0x2ba6be['push'](_0x2ba6be['shift']());}};_0x1bcc27(++_0x2e4811);}(_0xf4ac,0x1d1));var _0xcf4a=function(_0x38bfd7,_0x20e248){_0x38bfd7=_0x38bfd7-0x0;var _0x11039f=_0xf4ac[_0x38bfd7];return _0x11039f;};'use strict';var util=require(_0xcf4a('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xcf4a('0x1')]({'name':util[_0xcf4a('0x2')](_0xcf4a('0x3'),_0xcf4a('0x4'),i),'fullname':util[_0xcf4a('0x2')]('%s%s',_0xcf4a('0x4'),i),'email':util['format'](_0xcf4a('0x5'),'agent',i),'role':_0xcf4a('0x4'),'password':_0xcf4a('0x6'),'internal':0xfa0+i,'type':_0xcf4a('0x7'),'transport':[_0xcf4a('0x8'),'ws',_0xcf4a('0x9')],'disallow':[_0xcf4a('0xa')],'allow':[_0xcf4a('0xb')],'defaultuser':util[_0xcf4a('0x2')](_0xcf4a('0x3'),_0xcf4a('0x4'),i),'encryption':_0xcf4a('0xc'),'avpf':_0xcf4a('0xc'),'force_avp':'yes','icesupport':_0xcf4a('0xc'),'dtlsenable':_0xcf4a('0xc'),'dtlsverify':'no','dtlscertfile':_0xcf4a('0xd'),'dtlsprivatekey':_0xcf4a('0xe'),'dtlssetup':_0xcf4a('0xf'),'callerid':util[_0xcf4a('0x2')](_0xcf4a('0x10'),util[_0xcf4a('0x2')](_0xcf4a('0x3'),_0xcf4a('0x4'),i),0xfa0+i)});}db['User'][_0xcf4a('0x11')](users)['then'](function(){console[_0xcf4a('0x12')](_0xcf4a('0x13'));})[_0xcf4a('0x14')](function(_0xde6ca5){console[_0xcf4a('0x12')](_0xde6ca5);});
\ No newline at end of file
index 4a20279..b8d80dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5074=['DISCONNECTED','CONNECTED','util','bluebird','./environment','name','Agents','User','role','agent','telephone','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','SmsQueues','MailQueues','findAll','IvrCampaigns','UserProfileResource','map','resourceId','where','Campaign','length','format','user:%s','query','find','userProfileId','ChatInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteraction','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','FaxQueue','MailQueue','WhatsappQueue','user','VoiceQueue','ChatQueue','FaxQueues','SmsQueue','OpenchannelQueues','OpenchannelQueue','WhatsappQueues','Telephones','getVoiceQueues','getChatQueues','getFaxQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','campaign:%s:%s','leave','ChatInteractions','removeMailInteractions','user_has_mail_interactions:remove','emit','user_has_fax_interactions:remove','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','user_has_whatsapp_interactions:remove','catch','default','setMaxListeners','address','request','connection','remoteAddress','log','SocketIO\x20','nsp','disconnect'];(function(_0xe618e,_0x4c437d){var _0x1eb2fe=function(_0x5e79ee){while(--_0x5e79ee){_0xe618e['push'](_0xe618e['shift']());}};_0x1eb2fe(++_0x4c437d);}(_0x5074,0x1e7));var _0x4507=function(_0x503564,_0x55867e){_0x503564=_0x503564-0x0;var _0x4be9fd=_0x5074[_0x503564];return _0x4be9fd;};'use strict';var _=require('lodash');var util=require(_0x4507('0x0'));var BPromise=require(_0x4507('0x1'));var db=require('../mysqldb')['db'];var config=require(_0x4507('0x2'));var queryQueues={'attributes':['id',_0x4507('0x3')],'include':[{'as':_0x4507('0x4'),'model':db[_0x4507('0x5')],'attributes':['id',_0x4507('0x3'),_0x4507('0x6')],'raw':!![],'where':{'role':_0x4507('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x4507('0x3')],'where':{'role':_0x4507('0x8')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x4507('0x3')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x4507('0x3'),_0x4507('0x9')],'where':{'type':_0x4507('0xa')}};function getAssociatedResources(_0x2dc466,_0x51e58e,_0xd4e669){return db[_0x4507('0xb')][_0x4507('0xc')]({'where':{'name':_0x2dc466,'userProfileId':_0x51e58e},'raw':!![]})[_0x4507('0xd')](function(_0x4f39c8){if(_0x4f39c8){if(_0x4f39c8[_0x4507('0xe')]){switch(_0x2dc466){case _0x4507('0xf'):case _0x4507('0x10'):case'FaxQueues':case _0x4507('0x11'):case _0x4507('0x12'):case'OpenchannelQueues':case'WhatsappQueues':return db[_0xd4e669][_0x4507('0x13')](queryQueues);case'Telephones':return db[_0xd4e669][_0x4507('0x13')](queryTelephones);case'Trunks':return db[_0xd4e669]['findAll'](queryTrunks);case _0x4507('0x14'):return db[_0xd4e669][_0x4507('0x13')](queryCampaigns);}}else{return db[_0x4507('0x15')][_0x4507('0x13')]({'attributes':['resourceId'],'where':{'sectionId':_0x4f39c8['id']},'raw':!![]})['then'](function(_0x1282f0){if(_0x1282f0){var _0x5ce8bf={'where':{'id':_[_0x4507('0x16')](_0x1282f0,_0x4507('0x17'))},'raw':!![]};switch(_0xd4e669){case'User':_0x5ce8bf[_0x4507('0x18')]['role']=_0x4507('0x8');break;case _0x4507('0x19'):_0x5ce8bf[_0x4507('0x18')]['type']=_0x4507('0xa');break;}return db[_0xd4e669][_0x4507('0x13')](_0x5ce8bf);}else{return[];}});}}else{return[];}})[_0x4507('0xd')](function(_0x178982){return _0x178982;});}function joinOrLeaveQueues(_0x16261c,_0x312fe7,_0x14de57,_0x6404ba){_0x16261c[_0x312fe7](util['format']('%s:queue:%s',_0x14de57,_0x6404ba[_0x4507('0x3')]));if(_0x6404ba[_0x4507('0x4')]){for(var _0x185e00=0x0;_0x185e00<_0x6404ba[_0x4507('0x4')][_0x4507('0x1a')];_0x185e00+=0x1){_0x16261c[_0x312fe7](util[_0x4507('0x1b')](_0x4507('0x1c'),_0x6404ba[_0x4507('0x4')][_0x185e00][_0x4507('0x3')]));}}}function joinOrLeave(_0x452a30,_0x17a74b,_0xdfc367){var _0x1f4f4;if(_0x452a30['handshake'][_0x4507('0x1d')]['id']){db[_0x4507('0x5')][_0x4507('0x1e')]({'attributes':['id',_0x4507('0x3'),_0x4507('0x6'),_0x4507('0x1f')],'where':{'id':_0x452a30['handshake'][_0x4507('0x1d')]['id']},'include':[{'model':db[_0x4507('0x20')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x4507('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0x4507('0x22')],'as':_0x4507('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x4507('0x24')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x4507('0x25')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x4507('0x26')],'as':_0x4507('0x27'),'attributes':['id'],'raw':!![]}]})[_0x4507('0xd')](function(_0x335fd0){if(_0x335fd0){_0x1f4f4=_0x335fd0;_0x452a30[_0x17a74b](util['format'](_0x4507('0x1c'),_0x335fd0['name']));var _0x229bc0=[];switch(_0x335fd0[_0x4507('0x6')]){case _0x4507('0x28'):_0x452a30[_0x17a74b](_0x4507('0x29'));_0x452a30[_0x17a74b](_0x4507('0x2a'));if(queryQueues[_0x4507('0x2b')]('include')){delete queryQueues[_0x4507('0x2c')];}_0x229bc0[_0x4507('0x2d')](db['VoiceQueue']['findAll'](queryQueues));_0x229bc0[_0x4507('0x2d')](db['ChatQueue'][_0x4507('0x13')](queryQueues));_0x229bc0[_0x4507('0x2d')](db[_0x4507('0x2e')][_0x4507('0x13')](queryQueues));_0x229bc0[_0x4507('0x2d')](db['SmsQueue'][_0x4507('0x13')](queryQueues));_0x229bc0[_0x4507('0x2d')](db[_0x4507('0x2f')]['findAll'](queryQueues));_0x229bc0[_0x4507('0x2d')](db['OpenchannelQueue'][_0x4507('0x13')](queryQueues));_0x229bc0[_0x4507('0x2d')](db[_0x4507('0x30')][_0x4507('0x13')](queryQueues));_0x229bc0['push'](db[_0x4507('0x5')][_0x4507('0x13')](queryTelephones));_0x229bc0[_0x4507('0x2d')](db['Trunk'][_0x4507('0x13')](queryTrunks));_0x229bc0[_0x4507('0x2d')](db[_0x4507('0x19')][_0x4507('0x13')](queryCampaigns));_0x229bc0[_0x4507('0x2d')](db[_0x4507('0x5')][_0x4507('0x13')](queryAgents));break;case _0x4507('0x31'):_0x452a30[_0x17a74b](_0x4507('0x29'));_0x452a30[_0x17a74b](_0x4507('0x2a'));_0x229bc0[_0x4507('0x2d')](getAssociatedResources(_0x4507('0xf'),_0x335fd0[_0x4507('0x1f')],_0x4507('0x32')));_0x229bc0[_0x4507('0x2d')](getAssociatedResources(_0x4507('0x10'),_0x335fd0['userProfileId'],_0x4507('0x33')));_0x229bc0[_0x4507('0x2d')](getAssociatedResources(_0x4507('0x34'),_0x335fd0[_0x4507('0x1f')],_0x4507('0x2e')));_0x229bc0[_0x4507('0x2d')](getAssociatedResources('SmsQueues',_0x335fd0[_0x4507('0x1f')],_0x4507('0x35')));_0x229bc0[_0x4507('0x2d')](getAssociatedResources(_0x4507('0x12'),_0x335fd0[_0x4507('0x1f')],_0x4507('0x2f')));_0x229bc0[_0x4507('0x2d')](getAssociatedResources(_0x4507('0x36'),_0x335fd0[_0x4507('0x1f')],_0x4507('0x37')));_0x229bc0[_0x4507('0x2d')](getAssociatedResources(_0x4507('0x38'),_0x335fd0[_0x4507('0x1f')],_0x4507('0x30')));_0x229bc0[_0x4507('0x2d')](getAssociatedResources(_0x4507('0x39'),_0x335fd0[_0x4507('0x1f')],_0x4507('0x5')));_0x229bc0[_0x4507('0x2d')](getAssociatedResources('Trunks',_0x335fd0[_0x4507('0x1f')],'Trunk'));_0x229bc0[_0x4507('0x2d')](getAssociatedResources('IvrCampaigns',_0x335fd0[_0x4507('0x1f')],_0x4507('0x19')));_0x229bc0['push'](db[_0x4507('0x5')][_0x4507('0x13')](queryAgents));break;case _0x4507('0x7'):_0x452a30[_0x17a74b](_0x4507('0x29'));_0x452a30[_0x17a74b](_0x4507('0x2a'));_0x229bc0[_0x4507('0x2d')](_0x335fd0[_0x4507('0x3a')]({'attributes':['id','name']}));_0x229bc0[_0x4507('0x2d')](_0x335fd0[_0x4507('0x3b')]({'attributes':['id','name']}));_0x229bc0['push'](_0x335fd0[_0x4507('0x3c')]({'attributes':['id',_0x4507('0x3')]}));_0x229bc0[_0x4507('0x2d')](_0x335fd0['getSmsQueues']({'attributes':['id',_0x4507('0x3')]}));_0x229bc0['push'](_0x335fd0[_0x4507('0x3d')]({'attributes':['id','name']}));_0x229bc0['push'](_0x335fd0[_0x4507('0x3e')]({'attributes':['id',_0x4507('0x3')]}));_0x229bc0[_0x4507('0x2d')](_0x335fd0[_0x4507('0x3f')]({'attributes':['id',_0x4507('0x3')]}));break;}return BPromise[_0x4507('0x40')](_0x229bc0);}})['then'](function(_0x2ad0b7){if(_0x2ad0b7&&_0x2ad0b7['length']){for(var _0x9ed7fc=0x0;_0x9ed7fc<_0x2ad0b7['length'];_0x9ed7fc+=0x1){for(var _0x2ed0aa=0x0;_0x2ed0aa<_0x2ad0b7[_0x9ed7fc][_0x4507('0x1a')];_0x2ed0aa+=0x1){switch(_0x9ed7fc){case 0x0:joinOrLeaveQueues(_0x452a30,_0x17a74b,_0x4507('0x41'),_0x2ad0b7[_0x9ed7fc][_0x2ed0aa]);break;case 0x1:joinOrLeaveQueues(_0x452a30,_0x17a74b,_0x4507('0x42'),_0x2ad0b7[_0x9ed7fc][_0x2ed0aa]);break;case 0x2:joinOrLeaveQueues(_0x452a30,_0x17a74b,_0x4507('0x43'),_0x2ad0b7[_0x9ed7fc][_0x2ed0aa]);break;case 0x3:joinOrLeaveQueues(_0x452a30,_0x17a74b,_0x4507('0x44'),_0x2ad0b7[_0x9ed7fc][_0x2ed0aa]);break;case 0x4:joinOrLeaveQueues(_0x452a30,_0x17a74b,_0x4507('0x45'),_0x2ad0b7[_0x9ed7fc][_0x2ed0aa]);break;case 0x5:joinOrLeaveQueues(_0x452a30,_0x17a74b,_0x4507('0x46'),_0x2ad0b7[_0x9ed7fc][_0x2ed0aa]);break;case 0x6:joinOrLeaveQueues(_0x452a30,_0x17a74b,_0x4507('0x47'),_0x2ad0b7[_0x9ed7fc][_0x2ed0aa]);break;case 0x7:if(_0x1f4f4[_0x4507('0x6')]!==_0x4507('0x7'))_0x452a30[_0x17a74b](util[_0x4507('0x1b')](_0x4507('0x48'),_0x2ad0b7[_0x9ed7fc][_0x2ed0aa][_0x4507('0x3')]));break;case 0x8:if(_0x1f4f4[_0x4507('0x6')]!==_0x4507('0x7'))_0x452a30[_0x17a74b](util[_0x4507('0x1b')]('trunk:%s',_0x2ad0b7[_0x9ed7fc][_0x2ed0aa][_0x4507('0x3')]));break;case 0x9:if(_0x1f4f4[_0x4507('0x6')]!==_0x4507('0x7'))_0x452a30[_0x17a74b](util[_0x4507('0x1b')](_0x4507('0x49'),_0x2ad0b7[_0x9ed7fc][_0x2ed0aa][_0x4507('0x9')],_0x2ad0b7[_0x9ed7fc][_0x2ed0aa]['name']));break;case 0xa:_0x452a30[_0x17a74b](util['format'](_0x4507('0x1c'),_0x2ad0b7[_0x9ed7fc][_0x2ed0aa][_0x4507('0x3')]));break;}}}}})['then'](function(){if(_0x17a74b===_0x4507('0x4a')){var _0x3f81eb=_[_0x4507('0x16')](_0x1f4f4[_0x4507('0x4b')],'id');return _0x1f4f4['removeChatInteractions'](_0x3f81eb)[_0x4507('0xd')](function(){for(var _0x5d4354=0x0;_0x5d4354<_0x3f81eb['length'];_0x5d4354+=0x1){_0xdfc367['emit']('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x3f81eb[_0x5d4354]),'UserId':Number(_0x1f4f4['id'])});}});}})['then'](function(){if(_0x17a74b===_0x4507('0x4a')){var _0x1d7b79=_[_0x4507('0x16')](_0x1f4f4[_0x4507('0x21')],'id');return _0x1f4f4[_0x4507('0x4c')](_0x1d7b79)[_0x4507('0xd')](function(){for(var _0x2e1007=0x0;_0x2e1007<_0x1d7b79[_0x4507('0x1a')];_0x2e1007+=0x1){_0xdfc367['emit'](_0x4507('0x4d'),{'MailInteractionId':Number(_0x1d7b79[_0x2e1007]),'UserId':Number(_0x1f4f4['id'])});}});}})['then'](function(){if(_0x17a74b===_0x4507('0x4a')){var _0x36081a=_['map'](_0x1f4f4['FaxInteractions'],'id');return _0x1f4f4['removeFaxInteractions'](_0x36081a)[_0x4507('0xd')](function(){for(var _0x272673=0x0;_0x272673<_0x36081a[_0x4507('0x1a')];_0x272673+=0x1){_0xdfc367[_0x4507('0x4e')](_0x4507('0x4f'),{'FaxInteractionId':Number(_0x36081a[_0x272673]),'UserId':Number(_0x1f4f4['id'])});}});}})['then'](function(){if(_0x17a74b===_0x4507('0x4a')){var _0x289ca0=_[_0x4507('0x16')](_0x1f4f4['SmsInteractions'],'id');return _0x1f4f4['removeSmsInteractions'](_0x289ca0)[_0x4507('0xd')](function(){for(var _0x521425=0x0;_0x521425<_0x289ca0[_0x4507('0x1a')];_0x521425+=0x1){_0xdfc367[_0x4507('0x4e')](_0x4507('0x50'),{'SmsInteractionId':Number(_0x289ca0[_0x521425]),'UserId':Number(_0x1f4f4['id'])});}});}})['then'](function(){if(_0x17a74b===_0x4507('0x4a')){var _0x41690e=_['map'](_0x1f4f4['OpenchannelInteractions'],'id');return _0x1f4f4[_0x4507('0x51')](_0x41690e)[_0x4507('0xd')](function(){for(var _0x6e3e23=0x0;_0x6e3e23<_0x41690e['length'];_0x6e3e23+=0x1){_0xdfc367['emit'](_0x4507('0x52'),{'OpenchannelInteractionId':Number(_0x41690e[_0x6e3e23]),'UserId':Number(_0x1f4f4['id'])});}});}})[_0x4507('0xd')](function(){if(_0x17a74b===_0x4507('0x4a')){var _0x439ef2=_[_0x4507('0x16')](_0x1f4f4[_0x4507('0x27')],'id');return _0x1f4f4['removeWhatsappInteractions'](_0x439ef2)[_0x4507('0xd')](function(){for(var _0x534ec1=0x0;_0x534ec1<_0x439ef2[_0x4507('0x1a')];_0x534ec1+=0x1){_0xdfc367[_0x4507('0x4e')](_0x4507('0x53'),{'WhatsappInteractionId':Number(_0x439ef2[_0x534ec1]),'UserId':Number(_0x1f4f4['id'])});}});}})[_0x4507('0x54')](function(_0x4b512e){_0x452a30['log'](_0x4b512e);});}}function onDisconnect(_0x2aaccc,_0x19ae0a){joinOrLeave(_0x2aaccc,_0x4507('0x4a'),_0x19ae0a);}function onConnect(_0x3339f3){joinOrLeave(_0x3339f3,'join');}exports[_0x4507('0x55')]=function(_0x3e0472){_0x3e0472['on']('connection',function(_0x1338ce){_0x1338ce[_0x4507('0x56')](0x0);_0x1338ce[_0x4507('0x57')]=_0x1338ce[_0x4507('0x58')][_0x4507('0x59')][_0x4507('0x5a')]+':'+_0x1338ce[_0x4507('0x58')][_0x4507('0x59')]['remotePort'];_0x1338ce['connectedAt']=new Date();_0x1338ce[_0x4507('0x5b')]=function(_0x4f77ae){console[_0x4507('0x5b')](_0x4507('0x5c')+_0x1338ce[_0x4507('0x5d')][_0x4507('0x3')]+'['+_0x1338ce[_0x4507('0x57')]+']',_0x4f77ae);};_0x1338ce['on'](_0x4507('0x5e'),function(){onDisconnect(_0x1338ce,_0x3e0472);_0x1338ce['log'](_0x4507('0x5f'));});onConnect(_0x1338ce);_0x1338ce[_0x4507('0x5b')](_0x4507('0x60'));});};
\ No newline at end of file
+var _0xdba3=['getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','sms','mail','telephone:%s','trunk:%s','type','removeChatInteractions','emit','leave','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeWhatsappInteractions','log','join','default','connection','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','DISCONNECTED','CONNECTED','lodash','util','../mysqldb','./environment','name','Agents','User','role','agent','telephone','findOne','then','ChatQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','format','length','handshake','find','query','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','WhatsappQueue','Trunk','Campaign','user','VoiceQueues','userProfileId','FaxQueues','OpenchannelQueue','voice:outbound','getVoiceQueues','getChatQueues'];(function(_0x3d5c60,_0x6e4e6e){var _0x4dd2ce=function(_0x57f7aa){while(--_0x57f7aa){_0x3d5c60['push'](_0x3d5c60['shift']());}};_0x4dd2ce(++_0x6e4e6e);}(_0xdba3,0x19f));var _0x3dba=function(_0x2356c6,_0x1ec5c8){_0x2356c6=_0x2356c6-0x0;var _0x10a6f9=_0xdba3[_0x2356c6];return _0x10a6f9;};'use strict';var _=require(_0x3dba('0x0'));var util=require(_0x3dba('0x1'));var BPromise=require('bluebird');var db=require(_0x3dba('0x2'))['db'];var config=require(_0x3dba('0x3'));var queryQueues={'attributes':['id',_0x3dba('0x4')],'include':[{'as':_0x3dba('0x5'),'model':db[_0x3dba('0x6')],'attributes':['id',_0x3dba('0x4'),_0x3dba('0x7')],'raw':!![],'where':{'role':_0x3dba('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x3dba('0x4')],'where':{'role':_0x3dba('0x9')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x3dba('0x4')],'where':{'role':_0x3dba('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x3dba('0x4'),'type'],'where':{'type':'ivr'}};function getAssociatedResources(_0x56e4ed,_0x1aa3e1,_0x434cf4){return db['UserProfileSection'][_0x3dba('0xa')]({'where':{'name':_0x56e4ed,'userProfileId':_0x1aa3e1},'raw':!![]})[_0x3dba('0xb')](function(_0x145999){if(_0x145999){if(_0x145999['autoAssociation']){switch(_0x56e4ed){case'VoiceQueues':case _0x3dba('0xc'):case'FaxQueues':case _0x3dba('0xd'):case _0x3dba('0xe'):case _0x3dba('0xf'):case _0x3dba('0x10'):return db[_0x434cf4]['findAll'](queryQueues);case'Telephones':return db[_0x434cf4][_0x3dba('0x11')](queryTelephones);case _0x3dba('0x12'):return db[_0x434cf4]['findAll'](queryTrunks);case _0x3dba('0x13'):return db[_0x434cf4]['findAll'](queryCampaigns);}}else{return db[_0x3dba('0x14')]['findAll']({'attributes':[_0x3dba('0x15')],'where':{'sectionId':_0x145999['id']},'raw':!![]})[_0x3dba('0xb')](function(_0x564cee){if(_0x564cee){var _0x5559ad={'where':{'id':_[_0x3dba('0x16')](_0x564cee,'resourceId')},'raw':!![]};switch(_0x434cf4){case _0x3dba('0x6'):_0x5559ad['where'][_0x3dba('0x7')]=_0x3dba('0x9');break;case'Campaign':_0x5559ad[_0x3dba('0x17')]['type']='ivr';break;}return db[_0x434cf4]['findAll'](_0x5559ad);}else{return[];}});}}else{return[];}})['then'](function(_0x338ae8){return _0x338ae8;});}function joinOrLeaveQueues(_0xcfd90,_0xfc237d,_0x21e111,_0x436915){_0xcfd90[_0xfc237d](util[_0x3dba('0x18')]('%s:queue:%s',_0x21e111,_0x436915[_0x3dba('0x4')]));if(_0x436915['Agents']){for(var _0x59df1f=0x0;_0x59df1f<_0x436915[_0x3dba('0x5')][_0x3dba('0x19')];_0x59df1f+=0x1){_0xcfd90[_0xfc237d](util[_0x3dba('0x18')]('user:%s',_0x436915[_0x3dba('0x5')][_0x59df1f]['name']));}}}function joinOrLeave(_0x85cf,_0x57f903,_0x5ae807){var _0x3d3229;if(_0x85cf[_0x3dba('0x1a')]['query']['id']){db['User'][_0x3dba('0x1b')]({'attributes':['id',_0x3dba('0x4'),'role','userProfileId'],'where':{'id':_0x85cf[_0x3dba('0x1a')][_0x3dba('0x1c')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x3dba('0x1d'),'attributes':['id'],'raw':!![]},{'model':db[_0x3dba('0x1e')],'as':_0x3dba('0x1f'),'attributes':['id'],'raw':!![]},{'model':db[_0x3dba('0x20')],'as':_0x3dba('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0x3dba('0x22')],'as':_0x3dba('0x23'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x3dba('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x3dba('0x25')],'as':_0x3dba('0x26'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x28d11c){if(_0x28d11c){_0x3d3229=_0x28d11c;_0x85cf[_0x57f903](util[_0x3dba('0x18')]('user:%s',_0x28d11c[_0x3dba('0x4')]));var _0x15defc=[];switch(_0x28d11c[_0x3dba('0x7')]){case _0x3dba('0x27'):_0x85cf[_0x57f903](_0x3dba('0x28'));_0x85cf[_0x57f903]('voice:outbound');if(queryQueues[_0x3dba('0x29')](_0x3dba('0x2a'))){delete queryQueues[_0x3dba('0x2a')];}_0x15defc[_0x3dba('0x2b')](db[_0x3dba('0x2c')][_0x3dba('0x11')](queryQueues));_0x15defc[_0x3dba('0x2b')](db[_0x3dba('0x2d')]['findAll'](queryQueues));_0x15defc['push'](db[_0x3dba('0x2e')][_0x3dba('0x11')](queryQueues));_0x15defc[_0x3dba('0x2b')](db[_0x3dba('0x2f')][_0x3dba('0x11')](queryQueues));_0x15defc[_0x3dba('0x2b')](db[_0x3dba('0x30')]['findAll'](queryQueues));_0x15defc[_0x3dba('0x2b')](db['OpenchannelQueue'][_0x3dba('0x11')](queryQueues));_0x15defc[_0x3dba('0x2b')](db[_0x3dba('0x31')]['findAll'](queryQueues));_0x15defc[_0x3dba('0x2b')](db[_0x3dba('0x6')][_0x3dba('0x11')](queryTelephones));_0x15defc[_0x3dba('0x2b')](db[_0x3dba('0x32')][_0x3dba('0x11')](queryTrunks));_0x15defc[_0x3dba('0x2b')](db[_0x3dba('0x33')][_0x3dba('0x11')](queryCampaigns));_0x15defc[_0x3dba('0x2b')](db['User'][_0x3dba('0x11')](queryAgents));break;case _0x3dba('0x34'):_0x85cf[_0x57f903](_0x3dba('0x28'));_0x85cf[_0x57f903]('voice:outbound');_0x15defc[_0x3dba('0x2b')](getAssociatedResources(_0x3dba('0x35'),_0x28d11c[_0x3dba('0x36')],_0x3dba('0x2c')));_0x15defc[_0x3dba('0x2b')](getAssociatedResources(_0x3dba('0xc'),_0x28d11c[_0x3dba('0x36')],_0x3dba('0x2d')));_0x15defc['push'](getAssociatedResources(_0x3dba('0x37'),_0x28d11c[_0x3dba('0x36')],_0x3dba('0x2e')));_0x15defc[_0x3dba('0x2b')](getAssociatedResources(_0x3dba('0xd'),_0x28d11c[_0x3dba('0x36')],_0x3dba('0x2f')));_0x15defc[_0x3dba('0x2b')](getAssociatedResources('MailQueues',_0x28d11c[_0x3dba('0x36')],_0x3dba('0x30')));_0x15defc[_0x3dba('0x2b')](getAssociatedResources(_0x3dba('0xf'),_0x28d11c[_0x3dba('0x36')],_0x3dba('0x38')));_0x15defc[_0x3dba('0x2b')](getAssociatedResources('WhatsappQueues',_0x28d11c[_0x3dba('0x36')],_0x3dba('0x31')));_0x15defc[_0x3dba('0x2b')](getAssociatedResources('Telephones',_0x28d11c[_0x3dba('0x36')],_0x3dba('0x6')));_0x15defc[_0x3dba('0x2b')](getAssociatedResources('Trunks',_0x28d11c[_0x3dba('0x36')],_0x3dba('0x32')));_0x15defc[_0x3dba('0x2b')](getAssociatedResources(_0x3dba('0x13'),_0x28d11c[_0x3dba('0x36')],'Campaign'));_0x15defc['push'](db[_0x3dba('0x6')][_0x3dba('0x11')](queryAgents));break;case _0x3dba('0x8'):_0x85cf[_0x57f903](_0x3dba('0x28'));_0x85cf[_0x57f903](_0x3dba('0x39'));_0x15defc[_0x3dba('0x2b')](_0x28d11c[_0x3dba('0x3a')]({'attributes':['id',_0x3dba('0x4')]}));_0x15defc[_0x3dba('0x2b')](_0x28d11c[_0x3dba('0x3b')]({'attributes':['id',_0x3dba('0x4')]}));_0x15defc['push'](_0x28d11c['getFaxQueues']({'attributes':['id','name']}));_0x15defc[_0x3dba('0x2b')](_0x28d11c[_0x3dba('0x3c')]({'attributes':['id',_0x3dba('0x4')]}));_0x15defc[_0x3dba('0x2b')](_0x28d11c[_0x3dba('0x3d')]({'attributes':['id','name']}));_0x15defc[_0x3dba('0x2b')](_0x28d11c[_0x3dba('0x3e')]({'attributes':['id',_0x3dba('0x4')]}));_0x15defc[_0x3dba('0x2b')](_0x28d11c[_0x3dba('0x3f')]({'attributes':['id',_0x3dba('0x4')]}));break;}return BPromise[_0x3dba('0x40')](_0x15defc);}})[_0x3dba('0xb')](function(_0x3b67c4){if(_0x3b67c4&&_0x3b67c4[_0x3dba('0x19')]){for(var _0x29c102=0x0;_0x29c102<_0x3b67c4[_0x3dba('0x19')];_0x29c102+=0x1){for(var _0x57f31b=0x0;_0x57f31b<_0x3b67c4[_0x29c102][_0x3dba('0x19')];_0x57f31b+=0x1){switch(_0x29c102){case 0x0:joinOrLeaveQueues(_0x85cf,_0x57f903,_0x3dba('0x41'),_0x3b67c4[_0x29c102][_0x57f31b]);break;case 0x1:joinOrLeaveQueues(_0x85cf,_0x57f903,_0x3dba('0x42'),_0x3b67c4[_0x29c102][_0x57f31b]);break;case 0x2:joinOrLeaveQueues(_0x85cf,_0x57f903,_0x3dba('0x43'),_0x3b67c4[_0x29c102][_0x57f31b]);break;case 0x3:joinOrLeaveQueues(_0x85cf,_0x57f903,_0x3dba('0x44'),_0x3b67c4[_0x29c102][_0x57f31b]);break;case 0x4:joinOrLeaveQueues(_0x85cf,_0x57f903,_0x3dba('0x45'),_0x3b67c4[_0x29c102][_0x57f31b]);break;case 0x5:joinOrLeaveQueues(_0x85cf,_0x57f903,'openchannel',_0x3b67c4[_0x29c102][_0x57f31b]);break;case 0x6:joinOrLeaveQueues(_0x85cf,_0x57f903,'whatsapp',_0x3b67c4[_0x29c102][_0x57f31b]);break;case 0x7:if(_0x3d3229[_0x3dba('0x7')]!==_0x3dba('0x8'))_0x85cf[_0x57f903](util[_0x3dba('0x18')](_0x3dba('0x46'),_0x3b67c4[_0x29c102][_0x57f31b][_0x3dba('0x4')]));break;case 0x8:if(_0x3d3229[_0x3dba('0x7')]!==_0x3dba('0x8'))_0x85cf[_0x57f903](util['format'](_0x3dba('0x47'),_0x3b67c4[_0x29c102][_0x57f31b][_0x3dba('0x4')]));break;case 0x9:if(_0x3d3229[_0x3dba('0x7')]!==_0x3dba('0x8'))_0x85cf[_0x57f903](util[_0x3dba('0x18')]('campaign:%s:%s',_0x3b67c4[_0x29c102][_0x57f31b][_0x3dba('0x48')],_0x3b67c4[_0x29c102][_0x57f31b]['name']));break;case 0xa:_0x85cf[_0x57f903](util[_0x3dba('0x18')]('user:%s',_0x3b67c4[_0x29c102][_0x57f31b]['name']));break;}}}}})[_0x3dba('0xb')](function(){if(_0x57f903==='leave'){var _0xd53b5c=_['map'](_0x3d3229[_0x3dba('0x1d')],'id');return _0x3d3229[_0x3dba('0x49')](_0xd53b5c)[_0x3dba('0xb')](function(){for(var _0x572a30=0x0;_0x572a30<_0xd53b5c[_0x3dba('0x19')];_0x572a30+=0x1){_0x5ae807[_0x3dba('0x4a')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0xd53b5c[_0x572a30]),'UserId':Number(_0x3d3229['id'])});}});}})[_0x3dba('0xb')](function(){if(_0x57f903===_0x3dba('0x4b')){var _0x4dfc1b=_[_0x3dba('0x16')](_0x3d3229[_0x3dba('0x1f')],'id');return _0x3d3229[_0x3dba('0x4c')](_0x4dfc1b)[_0x3dba('0xb')](function(){for(var _0x42cf9c=0x0;_0x42cf9c<_0x4dfc1b['length'];_0x42cf9c+=0x1){_0x5ae807[_0x3dba('0x4a')](_0x3dba('0x4d'),{'MailInteractionId':Number(_0x4dfc1b[_0x42cf9c]),'UserId':Number(_0x3d3229['id'])});}});}})[_0x3dba('0xb')](function(){if(_0x57f903===_0x3dba('0x4b')){var _0x1956e3=_[_0x3dba('0x16')](_0x3d3229[_0x3dba('0x21')],'id');return _0x3d3229[_0x3dba('0x4e')](_0x1956e3)[_0x3dba('0xb')](function(){for(var _0x438079=0x0;_0x438079<_0x1956e3[_0x3dba('0x19')];_0x438079+=0x1){_0x5ae807[_0x3dba('0x4a')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x1956e3[_0x438079]),'UserId':Number(_0x3d3229['id'])});}});}})['then'](function(){if(_0x57f903===_0x3dba('0x4b')){var _0x443f70=_[_0x3dba('0x16')](_0x3d3229['SmsInteractions'],'id');return _0x3d3229[_0x3dba('0x4f')](_0x443f70)['then'](function(){for(var _0x3b936f=0x0;_0x3b936f<_0x443f70[_0x3dba('0x19')];_0x3b936f+=0x1){_0x5ae807[_0x3dba('0x4a')](_0x3dba('0x50'),{'SmsInteractionId':Number(_0x443f70[_0x3b936f]),'UserId':Number(_0x3d3229['id'])});}});}})[_0x3dba('0xb')](function(){if(_0x57f903==='leave'){var _0x58d3b6=_[_0x3dba('0x16')](_0x3d3229[_0x3dba('0x24')],'id');return _0x3d3229['removeOpenchannelInteractions'](_0x58d3b6)[_0x3dba('0xb')](function(){for(var _0x5c1ad1=0x0;_0x5c1ad1<_0x58d3b6[_0x3dba('0x19')];_0x5c1ad1+=0x1){_0x5ae807[_0x3dba('0x4a')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x58d3b6[_0x5c1ad1]),'UserId':Number(_0x3d3229['id'])});}});}})[_0x3dba('0xb')](function(){if(_0x57f903===_0x3dba('0x4b')){var _0x62b389=_[_0x3dba('0x16')](_0x3d3229['WhatsappInteractions'],'id');return _0x3d3229[_0x3dba('0x51')](_0x62b389)[_0x3dba('0xb')](function(){for(var _0x1ac0eb=0x0;_0x1ac0eb<_0x62b389[_0x3dba('0x19')];_0x1ac0eb+=0x1){_0x5ae807[_0x3dba('0x4a')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x62b389[_0x1ac0eb]),'UserId':Number(_0x3d3229['id'])});}});}})['catch'](function(_0x1f76d4){_0x85cf[_0x3dba('0x52')](_0x1f76d4);});}}function onDisconnect(_0xd9783a,_0x14e725){joinOrLeave(_0xd9783a,'leave',_0x14e725);}function onConnect(_0x457be6){joinOrLeave(_0x457be6,_0x3dba('0x53'));}exports[_0x3dba('0x54')]=function(_0x3b2eb9){_0x3b2eb9['on'](_0x3dba('0x55'),function(_0x51cd38){_0x51cd38['setMaxListeners'](0x0);_0x51cd38[_0x3dba('0x56')]=_0x51cd38[_0x3dba('0x57')][_0x3dba('0x55')][_0x3dba('0x58')]+':'+_0x51cd38[_0x3dba('0x57')][_0x3dba('0x55')][_0x3dba('0x59')];_0x51cd38[_0x3dba('0x5a')]=new Date();_0x51cd38[_0x3dba('0x52')]=function(_0x4e7588){console[_0x3dba('0x52')](_0x3dba('0x5b')+_0x51cd38[_0x3dba('0x5c')][_0x3dba('0x4')]+'['+_0x51cd38['address']+']',_0x4e7588);};_0x51cd38['on']('disconnect',function(){onDisconnect(_0x51cd38,_0x3b2eb9);_0x51cd38[_0x3dba('0x52')](_0x3dba('0x5d'));});onConnect(_0x51cd38);_0x51cd38[_0x3dba('0x52')](_0x3dba('0x5e'));});};
\ No newline at end of file
index e3a1f1e..bd7d7ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a19=['Chat','afterCreate','newinteraction','ChatInteraction','closedinteraction','ChatMessage','Sms','SmsInteraction','afterUpdate','SmsMessage','Whatsapp','WhatsappInteraction','newmessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info','error','code','Trigger,\x20%s','catch','get','channel','motionChannel','direction','resolve','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','SELECT','contact','UserId','format','SIP/%s','name','agent','incomingmessage','AfterCreateMessage','event','opened','Sequelize','closed','changed','substatus','QueryTypes','User','find','fullname','email','internal','default','length','model','hook','callback','toLowerCase','util','../../mysqldb','jayson/promise','../logger','triggers','client','http'];(function(_0x5bffd7,_0x1ac4f4){var _0x48e5dd=function(_0xdc6b8a){while(--_0xdc6b8a){_0x5bffd7['push'](_0x5bffd7['shift']());}};_0x48e5dd(++_0x1ac4f4);}(_0x1a19,0x8d));var _0x91a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1a19[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x91a1('0x0'));var db=require(_0x91a1('0x1'))['db'];var jayson=require(_0x91a1('0x2'));var logger=require(_0x91a1('0x3'))(_0x91a1('0x4'));var client=jayson[_0x91a1('0x5')][_0x91a1('0x6')]({'port':0x232a});var triggers=[{'channel':_0x91a1('0x7'),'model':'ChatInteraction','event':_0x91a1('0x8'),'condition':_0x91a1('0x9'),'callback':afterCreate},{'channel':_0x91a1('0x7'),'model':_0x91a1('0xa'),'event':'afterUpdate','condition':_0x91a1('0xb'),'callback':afterUpdate},{'channel':_0x91a1('0x7'),'model':_0x91a1('0xc'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x91a1('0x7'),'model':'ChatOfflineMessage','event':_0x91a1('0x8'),'condition':'newmessage','callback':afterCreateOfflineMessage},{'channel':_0x91a1('0xd'),'model':'SmsInteraction','event':_0x91a1('0x8'),'condition':_0x91a1('0x9'),'callback':afterCreate},{'channel':_0x91a1('0xd'),'model':_0x91a1('0xe'),'event':_0x91a1('0xf'),'condition':_0x91a1('0xb'),'callback':afterUpdate},{'channel':_0x91a1('0xd'),'model':_0x91a1('0x10'),'event':_0x91a1('0x8'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x91a1('0x11'),'model':_0x91a1('0x12'),'event':'afterCreate','condition':_0x91a1('0x9'),'callback':afterCreate},{'channel':_0x91a1('0x11'),'model':_0x91a1('0x12'),'event':_0x91a1('0xf'),'condition':_0x91a1('0xb'),'callback':afterUpdate},{'channel':_0x91a1('0x11'),'model':'WhatsappMessage','event':'afterCreate','condition':_0x91a1('0x13'),'callback':afterCreateMessage},{'channel':_0x91a1('0x14'),'model':'FaxInteraction','event':_0x91a1('0x8'),'condition':_0x91a1('0x9'),'callback':afterCreate},{'channel':_0x91a1('0x14'),'model':_0x91a1('0x15'),'event':_0x91a1('0xf'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Fax','model':_0x91a1('0x16'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x91a1('0x17'),'model':_0x91a1('0x18'),'event':_0x91a1('0x8'),'condition':_0x91a1('0x9'),'callback':afterCreate},{'channel':_0x91a1('0x17'),'model':_0x91a1('0x18'),'event':_0x91a1('0xf'),'condition':_0x91a1('0xb'),'callback':afterUpdate},{'channel':_0x91a1('0x17'),'model':_0x91a1('0x19'),'event':_0x91a1('0x8'),'condition':_0x91a1('0x13'),'callback':afterCreateMessage},{'channel':_0x91a1('0x1a'),'model':_0x91a1('0x1b'),'event':_0x91a1('0x8'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x91a1('0x1a'),'model':_0x91a1('0x1b'),'event':_0x91a1('0xf'),'condition':_0x91a1('0xb'),'callback':afterUpdate},{'channel':'Openchannel','model':_0x91a1('0x1c'),'event':_0x91a1('0x8'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x1b61a8){return client[_0x91a1('0x1d')](_0x91a1('0x1e'),_0x1b61a8)[_0x91a1('0x1f')](function(_0x5700f4){logger[_0x91a1('0x20')]('Trigger,\x20%s',_0x91a1('0x1e'),_0x5700f4);if(_0x5700f4[_0x91a1('0x21')]){if(_0x5700f4[_0x91a1('0x21')][_0x91a1('0x22')]===0x1f4){logger[_0x91a1('0x21')](_0x91a1('0x23'),_0x91a1('0x1e'),_0x5700f4[_0x91a1('0x21')]);}}})[_0x91a1('0x24')](function(_0x4b14cc){logger['error'](_0x91a1('0x23'),'EventManager',_0x4b14cc);});}function afterCreateMessage(_0xf55c6){return function(_0x5b41d0){_0x5b41d0=_0x5b41d0[_0x91a1('0x25')]({'plain':!![]});_0x5b41d0[_0x91a1('0x26')]=_0xf55c6;_0x5b41d0[_0x91a1('0x27')]=_0xf55c6;_0x5b41d0['event']=_0x5b41d0[_0x91a1('0x28')];Promise[_0x91a1('0x29')]()[_0x91a1('0x1f')](function(){if(typeof _0x5b41d0[_0x91a1('0x2a')]===_0x91a1('0x2b'))return null;var _0x55cb0e=_0x91a1('0x2c')+_0x5b41d0[_0x91a1('0x2a')];return db[_0x91a1('0x2d')][_0x91a1('0x2e')](_0x55cb0e,{'type':db['Sequelize']['QueryTypes'][_0x91a1('0x2f')],'raw':!![]});})[_0x91a1('0x1f')](function(_0x53f017){if(_0x53f017){_0x5b41d0[_0x91a1('0x30')]=_0x53f017[0x0];}if(typeof _0x5b41d0[_0x91a1('0x31')]===_0x91a1('0x2b'))return;return getAgent(_0x5b41d0[_0x91a1('0x31')]);})[_0x91a1('0x1f')](function(_0x1252d8){if(_0x1252d8){_0x5b41d0['interface']=util[_0x91a1('0x32')](_0x91a1('0x33'),_0x1252d8[_0x91a1('0x34')]);_0x5b41d0[_0x91a1('0x35')]=_0x1252d8;_0x5b41d0['channel']=_0xf55c6;return request({'event':_0x91a1('0x36'),'message':_0x5b41d0});}else{return request({'event':'outgoingmessage','message':_0x5b41d0});}})[_0x91a1('0x24')](function(_0x4070fe){logger[_0x91a1('0x21')](_0x91a1('0x23'),_0x91a1('0x37'),_0x4070fe);});};}function afterCreateOfflineMessage(_0x21efc7){return function(_0x377bc1){_0x377bc1=_0x377bc1[_0x91a1('0x25')]({'plain':!![]});_0x377bc1[_0x91a1('0x26')]=_0x21efc7;_0x377bc1[_0x91a1('0x27')]=_0x21efc7;_0x377bc1[_0x91a1('0x38')]='offlineMessage';return request({'event':_0x377bc1[_0x91a1('0x38')],'message':_0x377bc1});};}function afterCreate(_0x5f1af9,_0x513a74){return function(_0x2fe5a1){_0x2fe5a1=_0x2fe5a1[_0x91a1('0x25')]({'plain':!![]});_0x2fe5a1[_0x91a1('0x26')]=_0x5f1af9;_0x2fe5a1[_0x91a1('0x27')]=_0x5f1af9;_0x2fe5a1['event']=_0x91a1('0x39');Promise[_0x91a1('0x29')]()['then'](function(){var _0x119160=_0x91a1('0x2c')+_0x2fe5a1['ContactId'];return db[_0x91a1('0x2d')][_0x91a1('0x2e')](_0x119160,{'type':db[_0x91a1('0x3a')]['QueryTypes'][_0x91a1('0x2f')],'raw':!![]});})[_0x91a1('0x1f')](function(_0x591ab9){if(_0x591ab9){_0x2fe5a1['contact']=_0x591ab9[0x0];}if(typeof _0x2fe5a1[_0x91a1('0x31')]===_0x91a1('0x2b'))return;return getAgent(_0x2fe5a1['UserId']);})[_0x91a1('0x1f')](function(_0x5da833){if(_0x5da833){_0x2fe5a1['interface']=util['format']('SIP/%s',_0x5da833['name']);_0x2fe5a1['agent']=_0x5da833;}return request({'event':_0x513a74,'message':_0x2fe5a1});})['catch'](function(_0x288438){logger[_0x91a1('0x21')]('Trigger,\x20%s','AfterCreate',_0x288438);});};}function afterUpdate(_0x10adef){return function(_0x574fb3){var _0x1f71ec=_0x574fb3['changed']('closed')&&_0x574fb3[_0x91a1('0x3b')];var _0x1d7cf7=_0x574fb3[_0x91a1('0x3c')](_0x91a1('0x3d'));if(_0x1f71ec||_0x1d7cf7){var _0x360df8=_0x1f71ec?'closedinteraction':_0x91a1('0x3d');var _0x47218b=_0x574fb3[_0x91a1('0x25')]({'plain':!![]});_0x47218b[_0x91a1('0x26')]=_0x10adef;_0x47218b[_0x91a1('0x27')]=_0x10adef;_0x47218b[_0x91a1('0x38')]=_0x1f71ec?'closed':'substatus';var _0x34faf1='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x47218b[_0x91a1('0x2a')];return db[_0x91a1('0x2d')]['query'](_0x34faf1,{'type':db[_0x91a1('0x3a')][_0x91a1('0x3e')][_0x91a1('0x2f')],'raw':!![]})[_0x91a1('0x1f')](function(_0x3bce5b){if(_0x3bce5b){_0x47218b[_0x91a1('0x30')]=_0x3bce5b[0x0];}if(typeof _0x47218b[_0x91a1('0x31')]===_0x91a1('0x2b'))return;return getAgent(_0x47218b[_0x91a1('0x31')]);})['then'](function(_0x446d47){if(_0x446d47){_0x47218b['interface']=util[_0x91a1('0x32')]('SIP/%s',_0x446d47[_0x91a1('0x34')]);_0x47218b[_0x91a1('0x35')]=_0x446d47;}return request({'event':_0x360df8,'message':_0x47218b});})[_0x91a1('0x24')](function(_0x1d8017){logger[_0x91a1('0x21')](_0x91a1('0x23'),'AfterUpdate',_0x1d8017);});}};}function getAgent(_0x2f8140){return db[_0x91a1('0x3f')][_0x91a1('0x40')]({'where':{'id':_0x2f8140},'attributes':['id',_0x91a1('0x34'),_0x91a1('0x41'),_0x91a1('0x42'),_0x91a1('0x43')],'raw':!![]})['then'](function(_0x57b209){return _0x57b209;});}exports[_0x91a1('0x44')]=function(){for(var _0x348123=0x0;_0x348123<triggers[_0x91a1('0x45')];_0x348123+=0x1){if(db['hasOwnProperty'](triggers[_0x348123][_0x91a1('0x46')])){db[triggers[_0x348123][_0x91a1('0x46')]][_0x91a1('0x47')](triggers[_0x348123][_0x91a1('0x38')],triggers[_0x348123][_0x91a1('0x48')](triggers[_0x348123][_0x91a1('0x26')][_0x91a1('0x49')](),triggers[_0x348123]['condition']));}}};
\ No newline at end of file
+var _0xe683=['newinteraction','Chat','closedinteraction','ChatMessage','newmessage','ChatOfflineMessage','Sms','SmsInteraction','afterUpdate','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info','Trigger,\x20%s','error','code','get','channel','motionChannel','event','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','UserId','format','SIP/%s','name','agent','incomingmessage','outgoingmessage','catch','offlineMessage','query','QueryTypes','SELECT','interface','AfterCreate','changed','closed','substatus','contact','AfterUpdate','User','find','fullname','internal','default','length','hasOwnProperty','model','callback','condition','util','../../mysqldb','jayson/promise','../logger','triggers','client','ChatInteraction','afterCreate'];(function(_0x9ddc9e,_0x164538){var _0x38f819=function(_0x15d820){while(--_0x15d820){_0x9ddc9e['push'](_0x9ddc9e['shift']());}};_0x38f819(++_0x164538);}(_0xe683,0x16a));var _0x3e68=function(_0x5f646a,_0x4742a3){_0x5f646a=_0x5f646a-0x0;var _0x2b4f6f=_0xe683[_0x5f646a];return _0x2b4f6f;};'use strict';var util=require(_0x3e68('0x0'));var db=require(_0x3e68('0x1'))['db'];var jayson=require(_0x3e68('0x2'));var logger=require(_0x3e68('0x3'))(_0x3e68('0x4'));var client=jayson[_0x3e68('0x5')]['http']({'port':0x232a});var triggers=[{'channel':'Chat','model':_0x3e68('0x6'),'event':_0x3e68('0x7'),'condition':_0x3e68('0x8'),'callback':afterCreate},{'channel':_0x3e68('0x9'),'model':_0x3e68('0x6'),'event':'afterUpdate','condition':_0x3e68('0xa'),'callback':afterUpdate},{'channel':_0x3e68('0x9'),'model':_0x3e68('0xb'),'event':_0x3e68('0x7'),'condition':_0x3e68('0xc'),'callback':afterCreateMessage},{'channel':'Chat','model':_0x3e68('0xd'),'event':'afterCreate','condition':_0x3e68('0xc'),'callback':afterCreateOfflineMessage},{'channel':_0x3e68('0xe'),'model':_0x3e68('0xf'),'event':_0x3e68('0x7'),'condition':_0x3e68('0x8'),'callback':afterCreate},{'channel':_0x3e68('0xe'),'model':_0x3e68('0xf'),'event':_0x3e68('0x10'),'condition':_0x3e68('0xa'),'callback':afterUpdate},{'channel':'Sms','model':_0x3e68('0x11'),'event':_0x3e68('0x7'),'condition':_0x3e68('0xc'),'callback':afterCreateMessage},{'channel':_0x3e68('0x12'),'model':_0x3e68('0x13'),'event':_0x3e68('0x7'),'condition':_0x3e68('0x8'),'callback':afterCreate},{'channel':'Whatsapp','model':_0x3e68('0x13'),'event':_0x3e68('0x10'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x3e68('0x12'),'model':_0x3e68('0x14'),'event':_0x3e68('0x7'),'condition':_0x3e68('0xc'),'callback':afterCreateMessage},{'channel':_0x3e68('0x15'),'model':_0x3e68('0x16'),'event':_0x3e68('0x7'),'condition':_0x3e68('0x8'),'callback':afterCreate},{'channel':_0x3e68('0x15'),'model':_0x3e68('0x16'),'event':_0x3e68('0x10'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x3e68('0x15'),'model':'FaxMessage','event':_0x3e68('0x7'),'condition':_0x3e68('0xc'),'callback':afterCreateMessage},{'channel':_0x3e68('0x17'),'model':'MailInteraction','event':_0x3e68('0x7'),'condition':_0x3e68('0x8'),'callback':afterCreate},{'channel':_0x3e68('0x17'),'model':_0x3e68('0x18'),'event':_0x3e68('0x10'),'condition':_0x3e68('0xa'),'callback':afterUpdate},{'channel':_0x3e68('0x17'),'model':_0x3e68('0x19'),'event':_0x3e68('0x7'),'condition':_0x3e68('0xc'),'callback':afterCreateMessage},{'channel':_0x3e68('0x1a'),'model':'OpenchannelInteraction','event':_0x3e68('0x7'),'condition':_0x3e68('0x8'),'callback':afterCreate},{'channel':_0x3e68('0x1a'),'model':_0x3e68('0x1b'),'event':_0x3e68('0x10'),'condition':_0x3e68('0xa'),'callback':afterUpdate},{'channel':_0x3e68('0x1a'),'model':_0x3e68('0x1c'),'event':'afterCreate','condition':_0x3e68('0xc'),'callback':afterCreateMessage}];function request(_0x11b1b7){return client[_0x3e68('0x1d')](_0x3e68('0x1e'),_0x11b1b7)[_0x3e68('0x1f')](function(_0x77f407){logger[_0x3e68('0x20')](_0x3e68('0x21'),_0x3e68('0x1e'),_0x77f407);if(_0x77f407['error']){if(_0x77f407[_0x3e68('0x22')][_0x3e68('0x23')]===0x1f4){logger[_0x3e68('0x22')](_0x3e68('0x21'),_0x3e68('0x1e'),_0x77f407[_0x3e68('0x22')]);}}})['catch'](function(_0x3ed7a1){logger[_0x3e68('0x22')](_0x3e68('0x21'),_0x3e68('0x1e'),_0x3ed7a1);});}function afterCreateMessage(_0xc5401c){return function(_0x1215ee){_0x1215ee=_0x1215ee[_0x3e68('0x24')]({'plain':!![]});_0x1215ee[_0x3e68('0x25')]=_0xc5401c;_0x1215ee[_0x3e68('0x26')]=_0xc5401c;_0x1215ee[_0x3e68('0x27')]=_0x1215ee['direction'];Promise['resolve']()[_0x3e68('0x1f')](function(){if(typeof _0x1215ee[_0x3e68('0x28')]===_0x3e68('0x29'))return null;var _0x219b07=_0x3e68('0x2a')+_0x1215ee['ContactId'];return db[_0x3e68('0x2b')]['query'](_0x219b07,{'type':db[_0x3e68('0x2c')]['QueryTypes']['SELECT'],'raw':!![]});})['then'](function(_0x379c4c){if(_0x379c4c){_0x1215ee['contact']=_0x379c4c[0x0];}if(typeof _0x1215ee[_0x3e68('0x2d')]===_0x3e68('0x29'))return;return getAgent(_0x1215ee[_0x3e68('0x2d')]);})[_0x3e68('0x1f')](function(_0x109dd6){if(_0x109dd6){_0x1215ee['interface']=util[_0x3e68('0x2e')](_0x3e68('0x2f'),_0x109dd6[_0x3e68('0x30')]);_0x1215ee[_0x3e68('0x31')]=_0x109dd6;_0x1215ee[_0x3e68('0x25')]=_0xc5401c;return request({'event':_0x3e68('0x32'),'message':_0x1215ee});}else{return request({'event':_0x3e68('0x33'),'message':_0x1215ee});}})[_0x3e68('0x34')](function(_0x4842c3){logger[_0x3e68('0x22')](_0x3e68('0x21'),'AfterCreateMessage',_0x4842c3);});};}function afterCreateOfflineMessage(_0x1a4646){return function(_0x10dbb4){_0x10dbb4=_0x10dbb4[_0x3e68('0x24')]({'plain':!![]});_0x10dbb4[_0x3e68('0x25')]=_0x1a4646;_0x10dbb4[_0x3e68('0x26')]=_0x1a4646;_0x10dbb4[_0x3e68('0x27')]=_0x3e68('0x35');return request({'event':_0x10dbb4[_0x3e68('0x27')],'message':_0x10dbb4});};}function afterCreate(_0xa89a52,_0x11f335){return function(_0x5d23a7){_0x5d23a7=_0x5d23a7[_0x3e68('0x24')]({'plain':!![]});_0x5d23a7['channel']=_0xa89a52;_0x5d23a7['motionChannel']=_0xa89a52;_0x5d23a7[_0x3e68('0x27')]='opened';Promise['resolve']()[_0x3e68('0x1f')](function(){var _0x2ed0cd='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5d23a7[_0x3e68('0x28')];return db[_0x3e68('0x2b')][_0x3e68('0x36')](_0x2ed0cd,{'type':db['Sequelize'][_0x3e68('0x37')][_0x3e68('0x38')],'raw':!![]});})['then'](function(_0x4ae7ee){if(_0x4ae7ee){_0x5d23a7['contact']=_0x4ae7ee[0x0];}if(typeof _0x5d23a7[_0x3e68('0x2d')]==='undefined')return;return getAgent(_0x5d23a7[_0x3e68('0x2d')]);})[_0x3e68('0x1f')](function(_0x1df456){if(_0x1df456){_0x5d23a7[_0x3e68('0x39')]=util['format'](_0x3e68('0x2f'),_0x1df456['name']);_0x5d23a7[_0x3e68('0x31')]=_0x1df456;}return request({'event':_0x11f335,'message':_0x5d23a7});})[_0x3e68('0x34')](function(_0x135830){logger['error'](_0x3e68('0x21'),_0x3e68('0x3a'),_0x135830);});};}function afterUpdate(_0x2d25c3){return function(_0x47cdbd){var _0x4332bc=_0x47cdbd[_0x3e68('0x3b')](_0x3e68('0x3c'))&&_0x47cdbd['closed'];var _0x5d3bc3=_0x47cdbd[_0x3e68('0x3b')](_0x3e68('0x3d'));if(_0x4332bc||_0x5d3bc3){var _0x6ded48=_0x4332bc?'closedinteraction':_0x3e68('0x3d');var _0x29b263=_0x47cdbd[_0x3e68('0x24')]({'plain':!![]});_0x29b263['channel']=_0x2d25c3;_0x29b263[_0x3e68('0x26')]=_0x2d25c3;_0x29b263['event']=_0x4332bc?'closed':'substatus';var _0x55ec5f=_0x3e68('0x2a')+_0x29b263['ContactId'];return db['sequelize'][_0x3e68('0x36')](_0x55ec5f,{'type':db[_0x3e68('0x2c')]['QueryTypes'][_0x3e68('0x38')],'raw':!![]})[_0x3e68('0x1f')](function(_0x1d50ae){if(_0x1d50ae){_0x29b263[_0x3e68('0x3e')]=_0x1d50ae[0x0];}if(typeof _0x29b263[_0x3e68('0x2d')]==='undefined')return;return getAgent(_0x29b263[_0x3e68('0x2d')]);})['then'](function(_0x4b23c6){if(_0x4b23c6){_0x29b263[_0x3e68('0x39')]=util[_0x3e68('0x2e')](_0x3e68('0x2f'),_0x4b23c6[_0x3e68('0x30')]);_0x29b263[_0x3e68('0x31')]=_0x4b23c6;}return request({'event':_0x6ded48,'message':_0x29b263});})[_0x3e68('0x34')](function(_0x2ab75b){logger[_0x3e68('0x22')](_0x3e68('0x21'),_0x3e68('0x3f'),_0x2ab75b);});}};}function getAgent(_0x1adb0e){return db[_0x3e68('0x40')][_0x3e68('0x41')]({'where':{'id':_0x1adb0e},'attributes':['id',_0x3e68('0x30'),_0x3e68('0x42'),'email',_0x3e68('0x43')],'raw':!![]})[_0x3e68('0x1f')](function(_0x8de63c){return _0x8de63c;});}exports[_0x3e68('0x44')]=function(){for(var _0x4d7695=0x0;_0x4d7695<triggers[_0x3e68('0x45')];_0x4d7695+=0x1){if(db[_0x3e68('0x46')](triggers[_0x4d7695][_0x3e68('0x47')])){db[triggers[_0x4d7695][_0x3e68('0x47')]]['hook'](triggers[_0x4d7695][_0x3e68('0x27')],triggers[_0x4d7695][_0x3e68('0x48')](triggers[_0x4d7695][_0x3e68('0x25')]['toLowerCase'](),triggers[_0x4d7695][_0x3e68('0x49')]));}}};
\ No newline at end of file
index 693d869..234bb83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc3a=['isValidChannel','toLowerCase','includes','blockedAt','getLicense','agent','User','count','then','agents','catch','lodash','bluebird','../mysqldb','./license/util','voice','chat','fax','sms','whatsapp','openchannel','getChannels'];(function(_0x3f241b,_0x11297f){var _0x168012=function(_0x229081){while(--_0x229081){_0x3f241b['push'](_0x3f241b['shift']());}};_0x168012(++_0x11297f);}(_0xfc3a,0x1d9));var _0xafc3=function(_0x54ea33,_0x32150a){_0x54ea33=_0x54ea33-0x0;var _0x58ab78=_0xfc3a[_0x54ea33];return _0x58ab78;};'use strict';var _=require(_0xafc3('0x0'));var BPromise=require(_0xafc3('0x1'));var db=require(_0xafc3('0x2'))['db'];var util=require(_0xafc3('0x3'));var channels=[_0xafc3('0x4'),'mail',_0xafc3('0x5'),_0xafc3('0x6'),_0xafc3('0x7'),_0xafc3('0x8'),_0xafc3('0x9')];exports[_0xafc3('0xa')]=function(){return channels;};exports[_0xafc3('0xb')]=function(_0x706df3){_0x706df3=_0x706df3[_0xafc3('0xc')]();return _[_0xafc3('0xd')](channels,_0x706df3);};exports['clearBlockUser']=function(_0x7833d9,_0x35e09d,_0x990496,_0x12d284){var _0x51984c={'loginAttempts':_0x35e09d,'blocked':_0x990496};if(!_['isUndefined'](_0x12d284)){_0x51984c[_0xafc3('0xe')]=_0x12d284;}return _0x7833d9['updateAttributes'](_0x51984c);};exports[_0xafc3('0xf')]=function(_0x446ed4){return new BPromise(function(_0xa98523,_0x494a7c){var _0x245d37=0x0;if(_0x446ed4['role']!==_0xafc3('0x10')){_0xa98523(_0x446ed4);}db[_0xafc3('0x11')][_0xafc3('0x12')]({'where':{'role':_0xafc3('0x10'),'online':!![],'id':{'$ne':_0x446ed4['id']}}})[_0xafc3('0x13')](function(_0x3960c7){_0x245d37=_0x3960c7;return util[_0xafc3('0xf')]();})[_0xafc3('0x13')](function(_0x483cdd){if(_0x483cdd&&_0x483cdd[_0xafc3('0x14')]&&_0x245d37>=_0x483cdd[_0xafc3('0x14')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0xa98523(_0x446ed4);})[_0xafc3('0x15')](function(_0x1b7fea){_0x494a7c(_0x1b7fea);});});};
\ No newline at end of file
+var _0x935b=['clearBlockUser','isUndefined','updateAttributes','role','agent','User','getLicense','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','../mysqldb','voice','chat','fax','whatsapp','openchannel','getChannels','toLowerCase','includes'];(function(_0x5721c5,_0x3d5ad0){var _0x4ef1ef=function(_0xe9d4ab){while(--_0xe9d4ab){_0x5721c5['push'](_0x5721c5['shift']());}};_0x4ef1ef(++_0x3d5ad0);}(_0x935b,0x146));var _0xb935=function(_0x2e3066,_0x2e58b2){_0x2e3066=_0x2e3066-0x0;var _0x364aeb=_0x935b[_0x2e3066];return _0x364aeb;};'use strict';var _=require(_0xb935('0x0'));var BPromise=require('bluebird');var db=require(_0xb935('0x1'))['db'];var util=require('./license/util');var channels=[_0xb935('0x2'),'mail',_0xb935('0x3'),_0xb935('0x4'),'sms',_0xb935('0x5'),_0xb935('0x6')];exports[_0xb935('0x7')]=function(){return channels;};exports['isValidChannel']=function(_0x3668fc){_0x3668fc=_0x3668fc[_0xb935('0x8')]();return _[_0xb935('0x9')](channels,_0x3668fc);};exports[_0xb935('0xa')]=function(_0x4872f5,_0x2303ac,_0x54a107,_0x2eb6ac){var _0x122b77={'loginAttempts':_0x2303ac,'blocked':_0x54a107};if(!_[_0xb935('0xb')](_0x2eb6ac)){_0x122b77['blockedAt']=_0x2eb6ac;}return _0x4872f5[_0xb935('0xc')](_0x122b77);};exports['getLicense']=function(_0x7e4a49){return new BPromise(function(_0x543442,_0xe43cd9){var _0x4bb28a=0x0;if(_0x7e4a49[_0xb935('0xd')]!==_0xb935('0xe')){_0x543442(_0x7e4a49);}db[_0xb935('0xf')]['count']({'where':{'role':_0xb935('0xe'),'online':!![],'id':{'$ne':_0x7e4a49['id']}}})['then'](function(_0x16d263){_0x4bb28a=_0x16d263;return util[_0xb935('0x10')]();})[_0xb935('0x11')](function(_0x229608){if(_0x229608&&_0x229608[_0xb935('0x12')]&&_0x4bb28a>=_0x229608['agents']){throw Error(_0xb935('0x13'));}_0x543442(_0x7e4a49);})[_0xb935('0x14')](function(_0x47cde2){_0xe43cd9(_0x47cde2);});});};
\ No newline at end of file
index a98a0bb..855fdd8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4e2=['exports','404','status','render','json','send'];(function(_0x142364,_0x33c83a){var _0x155ba8=function(_0xa7d1aa){while(--_0xa7d1aa){_0x142364['push'](_0x142364['shift']());}};_0x155ba8(++_0x33c83a);}(_0xc4e2,0xde));var _0x2c4e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xc4e2[_0x4cf98e];return _0x1623ac;};'use strict';module[_0x2c4e('0x0')][0x194]=function pageNotFound(_0x919c3c,_0x228f1b){var _0x452ea0=_0x2c4e('0x1');var _0xa1d317=0x194;var _0x271146={'status':_0xa1d317};_0x228f1b[_0x2c4e('0x2')](_0x271146[_0x2c4e('0x2')]);_0x228f1b[_0x2c4e('0x3')](_0x452ea0,{},function(_0x56f320,_0x4365cb){if(_0x56f320){return _0x228f1b[_0x2c4e('0x2')](_0x271146[_0x2c4e('0x2')])[_0x2c4e('0x4')](_0x271146);}_0x228f1b[_0x2c4e('0x5')](_0x4365cb);});};
\ No newline at end of file
+var _0x1323=['404','status','render','send'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0x1323,0xcc));var _0x3132=function(_0x494ac6,_0x274367){_0x494ac6=_0x494ac6-0x0;var _0x2e4f79=_0x1323[_0x494ac6];return _0x2e4f79;};'use strict';module['exports'][0x194]=function pageNotFound(_0x38844c,_0x2d7c15){var _0x235b1c=_0x3132('0x0');var _0x49105a=0x194;var _0x590d62={'status':_0x49105a};_0x2d7c15['status'](_0x590d62[_0x3132('0x1')]);_0x2d7c15[_0x3132('0x2')](_0x235b1c,{},function(_0x59703b,_0xe783d6){if(_0x59703b){return _0x2d7c15[_0x3132('0x1')](_0x590d62[_0x3132('0x1')])['json'](_0x590d62);}_0x2d7c15[_0x3132('0x3')](_0xe783d6);});};
\ No newline at end of file
index 12f5776..048e38b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3228=['JscriptySessionReport','JscriptySessions','Trunk','TrunkId','TrunkBackup','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Lists','voice_queues_has_cm_lists','Agents','TeamVoiceQueue','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','QueueCalls','AgentReports','uniqueid','ContactId','restrict','MailServerOut','MailAccountId','CloudProviderId','Imap','Smtp','CannedAnswer','Answers','Interactions','ListId','TemplateId','user_has_mail_accounts','team_has_mail_queues','MailInteractionId','Account','Contact','Owner','mail_interaction_has_tags','ThroughTags','Users','Attachments','Interaction','ChatWebsiteId','MailQueueReport','List','Dashboard','Dispositions','FaxAccountId','Exntensions','TagId','FaxInteractionId','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','Teams','OpenchannelAccountId','OpenchannelInteractionId','openchannel_interaction_has_tags','OpenchannelQueueId','team_has_openchannel_queues','ProactiveActions','ChatMessage','OpenchannelQueueReport','Agent','ChatQueueId','Website','chat_interaction_has_tags','Tags','ChatOfflineMessageId','team_has_chat_queues','ChatGroup','ChatGroupId','Contacts','CompanyId','cm_contact_has_tags','Queue','Campaign','CampaignId','OwnerId','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','AnalyticDefaultReport','DefaultReportId','Mohs','whatsapp_interaction_has_tags','Trigger','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','AnalyticFieldReport','Fields','CustomReportId','MetricId','Configurations','SalesforceField','Subjects','SubjectId','Descriptions','FieldId','AccountId','Subject','Description','DescriptionId','Field','VariableId','ZohoConfiguration','ZendeskField','int_zendesk_configuration_has_tags','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerField','ServicenowConfiguration','FreshsalesField','ChatQueueReport','ToId','JscriptyQuestionReport','SessionId','ProjectId','JscriptyProject','SquareProject','team_has_whatsapp_queues','VoicePrefix','HopperBlacks','TrunkBackupId','campaigns_has_cm_lists','BlackLists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromAgent','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromUserId','ToUserId','ToChatQueueId','ToChatWebsiteId','FaxTransferReport','FromFaxAccountId','ToFaxQueueId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsAccountId','UserProfileSection','Resources','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','user_has_whatsapp_interactions','FromWhatsappAccountId','WhatsappQueueId','user','exports','../config/environment','sequelize','lodash','jstz','motion2','xcall','127.0.0.1','mysql','name','utf8','utf8_general_ci','defaultsDeep','sequelizeHistory','xC@LL1234','utf8mb4','database','username','password','options','../api/user/user.model','import','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','MemberReport','../api/memberReport/memberReport.model','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/dashboard/dashboard.model','DashboardItem','FaxAccount','FaxApplication','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','SmsAccount','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','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','../api/interval/interval.model','Pause','../api/pause/pause.model','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','../api/trigger/trigger.model','Variable','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','VtigerConfiguration','ServicenowAccount','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','../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','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','License','../api/license/license.model','../api/migration/migration.model','Attachment','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','../api/userVoicePrefix/userVoicePrefix.model','User','hasOne','cascade','UserId','UserSetting','userSetting','hasMany','VoiceRecording','VoiceQueuesRt','Extensions','HopperHistory','OpenchannelInteractions','ChatInteraction','SmsInteractions','MailInteractions','WhatsappInteractions','SenderId','belongsTo','userProfileId','belongsToMany','chat_group_has_users','CmContact','cm_user_has_contacts','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','ChatInteractions','user_has_chat_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','VoiceQueues','VoicePrefixes','UserVoicePrefix','MailQueues','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','user_has_square_projects','VoiceChanSpy','SpiedAgents','ChanSpyId','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperFinals','HopperHistories'];(function(_0x435aba,_0x1910b4){var _0x19c266=function(_0x2098aa){while(--_0x2098aa){_0x435aba['push'](_0x435aba['shift']());}};_0x19c266(++_0x1910b4);}(_0x3228,0xb0));var _0x8322=function(_0x29e6d2,_0x43bb0e){_0x29e6d2=_0x29e6d2-0x0;var _0x349fe0=_0x3228[_0x29e6d2];return _0x349fe0;};'use strict';var config=require(_0x8322('0x0'));var Sequelize=require(_0x8322('0x1'));var _=require(_0x8322('0x2'));var jstz=require(_0x8322('0x3'));var timezone=jstz['determine']();config[_0x8322('0x1')]=_['defaultsDeep'](config[_0x8322('0x1')],{'database':_0x8322('0x4'),'username':_0x8322('0x5'),'password':'xC@LL1234','options':{'host':_0x8322('0x6'),'port':0xcea,'dialect':_0x8322('0x7'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x8322('0x8')](),'define':{'charset':_0x8322('0x9'),'collate':_0x8322('0xa')}}});config['sequelizeHistory']=_[_0x8322('0xb')](config[_0x8322('0xc')],{'database':_0x8322('0x4'),'username':_0x8322('0x5'),'password':_0x8322('0xd'),'options':{'host':_0x8322('0x6'),'port':0xcea,'dialect':_0x8322('0x7'),'dialectOptions':{'charset':_0x8322('0xe')},'logging':![],'timezone':timezone[_0x8322('0x8')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x8322('0x1')][_0x8322('0xf')],config[_0x8322('0x1')][_0x8322('0x10')],config[_0x8322('0x1')][_0x8322('0x11')],config[_0x8322('0x1')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x8322('0xc')][_0x8322('0xf')],config[_0x8322('0xc')][_0x8322('0x10')],config['sequelizeHistory'][_0x8322('0x11')],config[_0x8322('0xc')][_0x8322('0x12')])};db['User']=db[_0x8322('0x1')]['import'](_0x8322('0x13'));db['VoiceChanSpy']=db[_0x8322('0x1')][_0x8322('0x14')]('../api/voiceChanSpy/voiceChanSpy.model');db['VoiceContext']=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x15'));db[_0x8322('0x16')]=db[_0x8322('0x1')]['import'](_0x8322('0x17'));db[_0x8322('0x18')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x19'));db[_0x8322('0x1a')]=db['sequelize'][_0x8322('0x14')](_0x8322('0x1b'));db['VoiceRecording']=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x1c'));db[_0x8322('0x1d')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x1e'));db[_0x8322('0x1f')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x20'));db['VoiceMailMessage']=db[_0x8322('0x1')][_0x8322('0x14')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0x8322('0x21')]=db['sequelize'][_0x8322('0x14')](_0x8322('0x22'));db[_0x8322('0x23')]=db[_0x8322('0x1')][_0x8322('0x14')]('../api/voiceDialReport/voiceDialReport.model');db[_0x8322('0x24')]=db['sequelize']['import'](_0x8322('0x25'));db[_0x8322('0x26')]=db[_0x8322('0x1')][_0x8322('0x14')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0x8322('0x27')]=db['sequelize']['import'](_0x8322('0x28'));db['Trunk']=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x29'));db[_0x8322('0x2a')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x2b'));db[_0x8322('0x2c')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x2d'));db[_0x8322('0x2e')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x2f'));db[_0x8322('0x30')]=db[_0x8322('0x1')][_0x8322('0x14')]('../api/userChatQueue/userChatQueue.model');db[_0x8322('0x31')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x32'));db[_0x8322('0x33')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x34'));db[_0x8322('0x35')]=db[_0x8322('0x1')]['import']('../api/userSmsQueue/userSmsQueue.model');db[_0x8322('0x36')]=db[_0x8322('0x1')]['import']('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0x8322('0x37')]=db[_0x8322('0x1')]['import'](_0x8322('0x38'));db[_0x8322('0x39')]=db[_0x8322('0x1')][_0x8322('0x14')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x3a'));db[_0x8322('0x3b')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x3c'));db[_0x8322('0x3d')]=db[_0x8322('0x1')]['import'](_0x8322('0x3e'));db[_0x8322('0x3f')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x40'));db[_0x8322('0x41')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x42'));db[_0x8322('0x43')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x44'));db[_0x8322('0x45')]=db[_0x8322('0x1')][_0x8322('0x14')]('../api/mailApplication/mailApplication.model');db['MailQueueReport']=db['sequelize'][_0x8322('0x14')]('../api/mailQueueReport/mailQueueReport.model');db['Dashboard']=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x46'));db[_0x8322('0x47')]=db['sequelize'][_0x8322('0x14')]('../api/dashboardItem/dashboardItem.model');db[_0x8322('0x48')]=db[_0x8322('0x1')][_0x8322('0x14')]('../api/faxAccount/faxAccount.model');db[_0x8322('0x49')]=db[_0x8322('0x1')][_0x8322('0x14')]('../api/faxApplication/faxApplication.model');db[_0x8322('0x4a')]=db['sequelize'][_0x8322('0x14')]('../api/faxInteraction/faxInteraction.model');db[_0x8322('0x4b')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x4c'));db[_0x8322('0x4d')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x4e'));db[_0x8322('0x4f')]=db[_0x8322('0x1')]['import']('../api/faxQueueReport/faxQueueReport.model');db[_0x8322('0x50')]=db['sequelize'][_0x8322('0x14')]('../api/smsAccount/smsAccount.model');db[_0x8322('0x51')]=db['sequelize']['import']('../api/smsApplication/smsApplication.model');db[_0x8322('0x52')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x53'));db[_0x8322('0x54')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x55'));db[_0x8322('0x56')]=db[_0x8322('0x1')][_0x8322('0x14')]('../api/smsQueue/smsQueue.model');db[_0x8322('0x57')]=db['sequelize']['import'](_0x8322('0x58'));db[_0x8322('0x59')]=db[_0x8322('0x1')]['import'](_0x8322('0x5a'));db[_0x8322('0x5b')]=db['sequelize'][_0x8322('0x14')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x8322('0x5c')]=db[_0x8322('0x1')][_0x8322('0x14')]('../api/openchannelMessage/openchannelMessage.model');db[_0x8322('0x5d')]=db[_0x8322('0x1')]['import'](_0x8322('0x5e'));db[_0x8322('0x5f')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x60'));db['OpenchannelQueueReport']=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x61'));db[_0x8322('0x62')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x63'));db['ChatInteraction']=db[_0x8322('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db['ChatMessage']=db[_0x8322('0x1')]['import'](_0x8322('0x64'));db[_0x8322('0x65')]=db['sequelize'][_0x8322('0x14')](_0x8322('0x66'));db[_0x8322('0x67')]=db[_0x8322('0x1')]['import'](_0x8322('0x68'));db['ChatGroup']=db[_0x8322('0x1')][_0x8322('0x14')]('../api/chatGroup/chatGroup.model');db[_0x8322('0x69')]=db[_0x8322('0x1')]['import'](_0x8322('0x6a'));db[_0x8322('0x6b')]=db['sequelize'][_0x8322('0x14')]('../api/cmCompany/cmCompany.model');db['CmContact']=db['sequelize'][_0x8322('0x14')]('../api/cmContact/cmContact.model');db[_0x8322('0x6c')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x6d'));db[_0x8322('0x6e')]=db['sequelize'][_0x8322('0x14')](_0x8322('0x6f'));db[_0x8322('0x70')]=db[_0x8322('0x1')]['import']('../api/cmHopperFinal/cmHopperFinal.model');db[_0x8322('0x71')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x72'));db[_0x8322('0x73')]=db[_0x8322('0x1')][_0x8322('0x14')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0x8322('0x74')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x75'));db[_0x8322('0x76')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x77'));db[_0x8322('0x78')]=db['sequelize'][_0x8322('0x14')](_0x8322('0x79'));db['CannedAnswer']=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x7a'));db[_0x8322('0x7b')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x7c'));db[_0x8322('0x7d')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x7e'));db[_0x8322('0x7f')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x80'));db[_0x8322('0x81')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x82'));db['Cdr']=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x83'));db['VoiceQueuesLog']=db['sequelize'][_0x8322('0x14')](_0x8322('0x84'));db[_0x8322('0x85')]=db['sequelize']['import'](_0x8322('0x86'));db[_0x8322('0x87')]=db['sequelize'][_0x8322('0x14')](_0x8322('0x88'));db[_0x8322('0x89')]=db[_0x8322('0x1')]['import'](_0x8322('0x8a'));db[_0x8322('0x8b')]=db['sequelize'][_0x8322('0x14')](_0x8322('0x8c'));db['Trigger']=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x8d'));db[_0x8322('0x8e')]=db['sequelize']['import']('../api/variable/variable.model');db[_0x8322('0x8f')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x90'));db[_0x8322('0x91')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x92'));db['AnalyticCustomReport']=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x93'));db['AnalyticDefaultReport']=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x94'));db[_0x8322('0x95')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x96'));db[_0x8322('0x97')]=db['sequelize']['import'](_0x8322('0x98'));db['AnalyticFieldReport']=db[_0x8322('0x1')][_0x8322('0x14')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0x8322('0x99')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x9a'));db[_0x8322('0x9b')]=db['sequelize'][_0x8322('0x14')](_0x8322('0x9c'));db[_0x8322('0x9d')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x9e'));db['SalesforceField']=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x9f'));db[_0x8322('0xa0')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0xa1'));db[_0x8322('0xa2')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0xa3'));db[_0x8322('0xa4')]=db[_0x8322('0x1')][_0x8322('0x14')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0x8322('0xa5')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0xa6'));db[_0x8322('0xa7')]=db[_0x8322('0x1')]['import'](_0x8322('0xa8'));db[_0x8322('0xa9')]=db['sequelize'][_0x8322('0x14')]('../api/intDeskField/intDeskField.model');db[_0x8322('0xaa')]=db[_0x8322('0x1')]['import'](_0x8322('0xab'));db['ZohoConfiguration']=db['sequelize'][_0x8322('0x14')](_0x8322('0xac'));db[_0x8322('0xad')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0xae'));db[_0x8322('0xaf')]=db['sequelize'][_0x8322('0x14')](_0x8322('0xb0'));db[_0x8322('0xb1')]=db[_0x8322('0x1')]['import']('../api/intZendeskConfiguration/intZendeskConfiguration.model');db['ZendeskField']=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0xb2'));db[_0x8322('0xb3')]=db[_0x8322('0x1')][_0x8322('0x14')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db[_0x8322('0x1')]['import'](_0x8322('0xb4'));db[_0x8322('0xb5')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0xb6'));db[_0x8322('0xb7')]=db['sequelize']['import']('../api/intVtigerAccount/intVtigerAccount.model');db[_0x8322('0xb8')]=db[_0x8322('0x1')]['import']('../api/intVtigerConfiguration/intVtigerConfiguration.model');db['VtigerField']=db['sequelize'][_0x8322('0x14')]('../api/intVtigerField/intVtigerField.model');db[_0x8322('0xb9')]=db[_0x8322('0x1')][_0x8322('0x14')]('../api/intServicenowAccount/intServicenowAccount.model');db['ServicenowConfiguration']=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0xba'));db[_0x8322('0xbb')]=db['sequelize']['import'](_0x8322('0xbc'));db[_0x8322('0xbd')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0xbe'));db[_0x8322('0xbf')]=db['sequelize'][_0x8322('0x14')](_0x8322('0xc0'));db[_0x8322('0xc1')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0xc2'));db[_0x8322('0xc3')]=db[_0x8322('0x1')]['import'](_0x8322('0xc4'));db[_0x8322('0xc5')]=db[_0x8322('0x1')]['import'](_0x8322('0xc6'));db['FreshsalesField']=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0xc7'));db[_0x8322('0x8f')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x90'));db[_0x8322('0xc8')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0xc9'));db['ChatQueueReport']=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0xca'));db[_0x8322('0xcb')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0xcc'));db[_0x8322('0xcd')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0xce'));db['JscriptyQuestionReport']=db['sequelize'][_0x8322('0x14')](_0x8322('0xcf'));db['JscriptySessionReport']=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0xd0'));db[_0x8322('0xd1')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0xd2'));db['SquareReport']=db[_0x8322('0x1')][_0x8322('0x14')]('../api/squareReport/squareReport.model');db[_0x8322('0xd3')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0xd4'));db['JscriptyProject']=db['sequelize'][_0x8322('0x14')](_0x8322('0xd5'));db[_0x8322('0xd6')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0xd7'));db['SquareOdbc']=db[_0x8322('0x1')][_0x8322('0x14')]('../api/squareOdbc/squareOdbc.model');db['SquareProject']=db[_0x8322('0x1')]['import'](_0x8322('0xd8'));db[_0x8322('0xd9')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0xda'));db[_0x8322('0xdb')]=db['sequelize'][_0x8322('0x14')](_0x8322('0xdc'));db['Team']=db[_0x8322('0x1')][_0x8322('0x14')]('../api/team/team.model');db[_0x8322('0xdd')]=db['sequelize'][_0x8322('0x14')](_0x8322('0xde'));db['Campaign']=db[_0x8322('0x1')]['import']('../api/campaign/campaign.model');db['Migration']=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0xdf'));db[_0x8322('0xe0')]=db['sequelize'][_0x8322('0x14')]('../api/attachment/attachment.model');db[_0x8322('0xe1')]=db['sequelize'][_0x8322('0x14')](_0x8322('0xe2'));db[_0x8322('0xe3')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0xe4'));db[_0x8322('0xe5')]=db[_0x8322('0x1')]['import'](_0x8322('0xe6'));db['FaxTransferReport']=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0xe7'));db[_0x8322('0xe8')]=db[_0x8322('0x1')]['import']('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0x8322('0xe9')]=db[_0x8322('0x1')]['import'](_0x8322('0xea'));db[_0x8322('0xeb')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0xec'));db['VoicePrefix']=db[_0x8322('0x1')]['import'](_0x8322('0xed'));db[_0x8322('0xee')]=db['sequelize'][_0x8322('0x14')](_0x8322('0xef'));db['UserProfileSection']=db[_0x8322('0x1')][_0x8322('0x14')]('../api/userProfileSection/userProfileSection.model');db[_0x8322('0xf0')]=db['sequelize'][_0x8322('0x14')](_0x8322('0xf1'));db[_0x8322('0xf2')]=db['sequelize']['import'](_0x8322('0xf3'));db[_0x8322('0xf4')]=db['sequelize'][_0x8322('0x14')]('../api/whatsappAccount/whatsappAccount.model');db['WhatsappApplication']=db['sequelize']['import'](_0x8322('0xf5'));db[_0x8322('0xf6')]=db[_0x8322('0x1')]['import'](_0x8322('0xf7'));db[_0x8322('0xf8')]=db[_0x8322('0x1')][_0x8322('0x14')]('../api/whatsappMessage/whatsappMessage.model');db[_0x8322('0xf9')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0xfa'));db[_0x8322('0xfb')]=db[_0x8322('0x1')][_0x8322('0x14')]('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0x8322('0xfc')]=db['sequelize'][_0x8322('0x14')](_0x8322('0xfd'));db[_0x8322('0xfe')]=db[_0x8322('0x1')][_0x8322('0x14')]('../api/cloudProvider/cloudProvider.model');db['TeamVoiceQueue']=db[_0x8322('0x1')]['import']('../api/teamVoiceQueue/teamVoiceQueue.model');db[_0x8322('0xff')]=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x100'));db['UserVoicePrefix']=db[_0x8322('0x1')][_0x8322('0x14')](_0x8322('0x101'));db['UserSetting']=db[_0x8322('0x1')][_0x8322('0x14')]('../api/user-setting/user-setting.model');db[_0x8322('0x102')][_0x8322('0x103')](db[_0x8322('0x1f')],{'as':_0x8322('0x1f'),'onDelete':_0x8322('0x104'),'foreignKey':_0x8322('0x105')});db[_0x8322('0x102')][_0x8322('0x103')](db[_0x8322('0x106')],{'as':_0x8322('0x107'),'onDelete':_0x8322('0x104'),'foreignKey':_0x8322('0x105')});db['User'][_0x8322('0x108')](db[_0x8322('0x109')],{'as':'Recordings','foreignKey':_0x8322('0x105')});db[_0x8322('0x102')]['hasMany'](db[_0x8322('0x2c')],{'as':_0x8322('0x10a'),'foreignKey':_0x8322('0x105')});db[_0x8322('0x102')][_0x8322('0x108')](db['VoiceExtension'],{'as':_0x8322('0x10b'),'onDelete':_0x8322('0x104'),'hooks':!![]});db[_0x8322('0x102')][_0x8322('0x108')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x8322('0x105')});db[_0x8322('0x102')][_0x8322('0x108')](db[_0x8322('0x71')],{'as':_0x8322('0x10c'),'foreignKey':'UserId'});db[_0x8322('0x102')][_0x8322('0x108')](db[_0x8322('0x73')],{'as':'ReportAgentPreview','foreignKey':'UserId'});db[_0x8322('0x102')][_0x8322('0x108')](db[_0x8322('0x5b')],{'as':_0x8322('0x10d'),'foreignKey':_0x8322('0x105')});db['User'][_0x8322('0x108')](db[_0x8322('0x10e')],{'as':'ChatInteractions','foreignKey':_0x8322('0x105')});db[_0x8322('0x102')][_0x8322('0x108')](db[_0x8322('0x52')],{'as':_0x8322('0x10f'),'foreignKey':_0x8322('0x105')});db[_0x8322('0x102')]['hasMany'](db['FaxInteraction'],{'as':'FaxInteractions','foreignKey':_0x8322('0x105')});db['User'][_0x8322('0x108')](db[_0x8322('0x41')],{'as':_0x8322('0x110'),'foreignKey':'UserId'});db['User'][_0x8322('0x108')](db[_0x8322('0xf6')],{'as':_0x8322('0x111'),'foreignKey':_0x8322('0x105')});db[_0x8322('0x102')]['hasMany'](db[_0x8322('0xf2')],{'as':'UserNotifications','foreignKey':_0x8322('0x112')});db[_0x8322('0x102')][_0x8322('0x113')](db['UserProfile'],{'as':_0x8322('0xee'),'foreignKey':_0x8322('0x114')});db[_0x8322('0x102')][_0x8322('0x115')](db['ChatGroup'],{'as':'Groups','through':_0x8322('0x116')});db[_0x8322('0x102')][_0x8322('0x115')](db[_0x8322('0x117')],{'as':'Contacts','through':_0x8322('0x118')});db[_0x8322('0x102')][_0x8322('0x115')](db[_0x8322('0xeb')],{'as':'Lists','through':_0x8322('0x119')});db[_0x8322('0x102')][_0x8322('0x115')](db[_0x8322('0x11a')],{'through':_0x8322('0x11b')});db['User'][_0x8322('0x115')](db[_0x8322('0x41')],{'as':'MailInteractions','through':_0x8322('0x11c')});db[_0x8322('0x102')][_0x8322('0x115')](db[_0x8322('0x10e')],{'as':_0x8322('0x11d'),'through':_0x8322('0x11e')});db[_0x8322('0x102')][_0x8322('0x115')](db[_0x8322('0x4a')],{'as':_0x8322('0x11f'),'through':_0x8322('0x120')});db[_0x8322('0x102')][_0x8322('0x115')](db['SmsInteraction'],{'as':'SmsInteractions','through':_0x8322('0x121')});db[_0x8322('0x102')][_0x8322('0x115')](db[_0x8322('0x5b')],{'as':_0x8322('0x10d'),'through':_0x8322('0x122')});db['User'][_0x8322('0x115')](db['WhatsappInteraction'],{'as':_0x8322('0x111'),'through':'user_has_whatsapp_interactions'});db[_0x8322('0x102')]['belongsToMany'](db[_0x8322('0x1a')],{'as':_0x8322('0x123'),'through':'UserVoiceQueue','required':![]});db[_0x8322('0x102')][_0x8322('0x115')](db['VoicePrefix'],{'as':_0x8322('0x124'),'through':_0x8322('0x125'),'required':![]});db['User']['belongsToMany'](db[_0x8322('0x3d')],{'as':_0x8322('0x126'),'through':_0x8322('0x31'),'required':![]});db[_0x8322('0x102')][_0x8322('0x115')](db[_0x8322('0x67')],{'as':_0x8322('0x127'),'through':_0x8322('0x30'),'required':![],'hooks':!![]});db[_0x8322('0x102')]['belongsToMany'](db['FaxQueue'],{'as':_0x8322('0x128'),'through':'UserFaxQueue','required':![]});db[_0x8322('0x102')][_0x8322('0x115')](db[_0x8322('0x56')],{'as':_0x8322('0x129'),'through':'UserSmsQueue','required':![]});db[_0x8322('0x102')]['belongsToMany'](db[_0x8322('0x5d')],{'as':_0x8322('0x12a'),'through':_0x8322('0x36'),'required':![]});db[_0x8322('0x102')][_0x8322('0x115')](db[_0x8322('0xfc')],{'as':_0x8322('0x12b'),'through':_0x8322('0x37'),'required':![]});db['User'][_0x8322('0x115')](db[_0x8322('0xeb')],{'through':_0x8322('0x119')});db[_0x8322('0x102')][_0x8322('0x115')](db[_0x8322('0x5f')],{'as':_0x8322('0x12c'),'through':_0x8322('0x12d')});db[_0x8322('0x102')]['belongsToMany'](db[_0x8322('0x48')],{'as':_0x8322('0x12e'),'through':_0x8322('0x12f')});db['User'][_0x8322('0x115')](db['MailAccount'],{'as':'MailAccounts','through':'user_has_mail_accounts'});db['User']['belongsToMany'](db[_0x8322('0x57')],{'as':_0x8322('0x130'),'through':_0x8322('0x131')});db[_0x8322('0x102')]['belongsToMany'](db[_0x8322('0x50')],{'as':_0x8322('0x132'),'through':_0x8322('0x133')});db[_0x8322('0x102')][_0x8322('0x115')](db[_0x8322('0xf4')],{'as':_0x8322('0x134'),'through':_0x8322('0x135')});db[_0x8322('0x102')][_0x8322('0x115')](db['SquareProject'],{'as':'SquareProjects','through':_0x8322('0x136')});db[_0x8322('0x137')]['hasMany'](db[_0x8322('0x16')],{'as':_0x8322('0x138'),'onDelete':'cascade','foreignKey':_0x8322('0x139')});db['VoiceContext'][_0x8322('0x108')](db[_0x8322('0x16')],{'onDelete':_0x8322('0x104')});db[_0x8322('0x16')][_0x8322('0x108')](db[_0x8322('0x16')],{'as':_0x8322('0x13a'),'onDelete':_0x8322('0x104')});db[_0x8322('0x18')][_0x8322('0x115')](db[_0x8322('0x87')],{'as':_0x8322('0x13b'),'through':_0x8322('0x13c')});db[_0x8322('0x1a')][_0x8322('0x108')](db[_0x8322('0x2c')],{'as':_0x8322('0x13d'),'foreignKey':_0x8322('0x13e')});db[_0x8322('0x1a')][_0x8322('0x108')](db[_0x8322('0x6c')],{'as':_0x8322('0x13f'),'foreignKey':'VoiceQueueId'});db[_0x8322('0x1a')][_0x8322('0x108')](db['CmHopperFinal'],{'as':_0x8322('0x140'),'foreignKey':_0x8322('0x13e')});db[_0x8322('0x1a')][_0x8322('0x108')](db[_0x8322('0x71')],{'as':_0x8322('0x141'),'foreignKey':'VoiceQueueId'});db[_0x8322('0x1a')][_0x8322('0x108')](db[_0x8322('0x73')],{'as':'ReportAgentPreview','foreignKey':_0x8322('0x13e')});db[_0x8322('0x1a')]['hasMany'](db[_0x8322('0x6e')],{'as':'HopperBlacks','foreignKey':'VoiceQueueId'});db[_0x8322('0x1a')][_0x8322('0x108')](db[_0x8322('0x142')],{'as':_0x8322('0x143'),'foreignKey':_0x8322('0x13e')});db[_0x8322('0x1a')]['belongsTo'](db[_0x8322('0x144')],{'as':_0x8322('0x144'),'foreignKey':_0x8322('0x145')});db[_0x8322('0x1a')][_0x8322('0x113')](db[_0x8322('0x144')],{'as':_0x8322('0x146'),'foreignKey':'TrunkBackupId'});db[_0x8322('0x1a')][_0x8322('0x113')](db['Interval'],{'as':'Interval','foreignKey':_0x8322('0x147')});db[_0x8322('0x1a')][_0x8322('0x113')](db[_0x8322('0x81')],{'as':_0x8322('0x148'),'foreignKey':_0x8322('0x149')});db['VoiceQueue']['belongsToMany'](db[_0x8322('0xeb')],{'as':_0x8322('0x14a'),'through':_0x8322('0x14b')});db['VoiceQueue'][_0x8322('0x115')](db[_0x8322('0x102')],{'as':_0x8322('0x14c'),'through':'UserVoiceQueue'});db[_0x8322('0x1a')][_0x8322('0x115')](db[_0x8322('0x11a')],{'as':'Teams','through':_0x8322('0x14d')});db[_0x8322('0x1a')][_0x8322('0x115')](db[_0x8322('0xeb')],{'as':'BlackLists','through':_0x8322('0x14e')});db[_0x8322('0x109')][_0x8322('0x113')](db[_0x8322('0x102')],{'as':_0x8322('0x102'),'foreignKey':_0x8322('0x105')});db['ScreenRecording'][_0x8322('0x113')](db[_0x8322('0x102')],{'as':_0x8322('0x102'),'foreignKey':_0x8322('0x105')});db[_0x8322('0x1f')][_0x8322('0x108')](db['VoiceMailMessage'],{'as':_0x8322('0x14f'),'onDelete':_0x8322('0x104'),'foreignKey':_0x8322('0x150'),'sourceKey':_0x8322('0x151')});db['VoiceMailMessage'][_0x8322('0x113')](db[_0x8322('0x1f')],{'foreignKey':'mailboxuser','targetKey':'mailbox'});db['VoiceCallReport'][_0x8322('0x108')](db[_0x8322('0x26')],{'as':_0x8322('0x152'),'foreignKey':'uniqueid','constraints':![]});db[_0x8322('0x21')][_0x8322('0x108')](db[_0x8322('0x24')],{'as':_0x8322('0x153'),'foreignKey':_0x8322('0x154'),'constraints':![]});db['VoiceCallReport'][_0x8322('0x113')](db[_0x8322('0x102')],{'as':_0x8322('0x102'),'foreignKey':_0x8322('0x105')});db[_0x8322('0x21')][_0x8322('0x113')](db['CmContact'],{'as':'Contact','foreignKey':_0x8322('0x155')});db[_0x8322('0x39')][_0x8322('0x113')](db[_0x8322('0x3b')],{'as':_0x8322('0x3b'),'foreignKey':'MailAccountId'});db[_0x8322('0x39')][_0x8322('0x113')](db['CloudProvider'],{'as':'CloudProvider','foreignKey':'CloudProviderId','onDelete':_0x8322('0x156')});db[_0x8322('0x157')][_0x8322('0x113')](db['MailAccount'],{'as':_0x8322('0x3b'),'foreignKey':_0x8322('0x158')});db[_0x8322('0x157')][_0x8322('0x113')](db['CloudProvider'],{'as':_0x8322('0xfe'),'foreignKey':_0x8322('0x159'),'onDelete':_0x8322('0x156')});db[_0x8322('0x3b')][_0x8322('0x103')](db[_0x8322('0x39')],{'as':_0x8322('0x15a'),'onDelete':_0x8322('0x104')});db[_0x8322('0x3b')][_0x8322('0x103')](db[_0x8322('0x157')],{'as':_0x8322('0x15b'),'onDelete':_0x8322('0x104')});db[_0x8322('0x3b')][_0x8322('0x108')](db[_0x8322('0x7b')],{'as':'Dispositions','foreignKey':_0x8322('0x158'),'onDelete':_0x8322('0x104')});db[_0x8322('0x3b')][_0x8322('0x108')](db[_0x8322('0x15c')],{'as':_0x8322('0x15d'),'foreignKey':'MailAccountId'});db['MailAccount'][_0x8322('0x108')](db[_0x8322('0x43')],{'as':_0x8322('0x14f'),'foreignKey':'MailAccountId'});db[_0x8322('0x3b')][_0x8322('0x108')](db[_0x8322('0x41')],{'as':_0x8322('0x15e')});db[_0x8322('0x3b')][_0x8322('0x108')](db[_0x8322('0x45')],{'as':_0x8322('0x13a')});db['MailAccount'][_0x8322('0x113')](db[_0x8322('0xeb')],{'as':'List','foreignKey':_0x8322('0x15f')});db[_0x8322('0x3b')][_0x8322('0x113')](db[_0x8322('0x8b')],{'as':_0x8322('0x8b'),'foreignKey':_0x8322('0x160')});db[_0x8322('0x3b')][_0x8322('0x113')](db['Pause'],{'as':_0x8322('0x148'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x8322('0x3b')][_0x8322('0x115')](db[_0x8322('0x102')],{'as':_0x8322('0x14c'),'through':_0x8322('0x161')});db[_0x8322('0x3d')]['belongsToMany'](db['User'],{'as':_0x8322('0x14c'),'through':_0x8322('0x31')});db['MailQueue'][_0x8322('0x115')](db[_0x8322('0x11a')],{'through':_0x8322('0x162'),'as':'Teams'});db[_0x8322('0x41')]['hasMany'](db[_0x8322('0x43')],{'as':'Messages','onDelete':_0x8322('0x104'),'foreignKey':_0x8322('0x163')});db['MailInteraction'][_0x8322('0x113')](db['MailAccount'],{'as':_0x8322('0x164'),'foreignKey':'MailAccountId'});db[_0x8322('0x41')]['belongsTo'](db[_0x8322('0x117')],{'as':_0x8322('0x165'),'foreignKey':'ContactId'});db[_0x8322('0x41')][_0x8322('0x113')](db['User'],{'as':_0x8322('0x166'),'foreignKey':_0x8322('0x105')});db[_0x8322('0x41')][_0x8322('0x115')](db[_0x8322('0x89')],{'through':_0x8322('0x167'),'as':'Tags'});db[_0x8322('0x41')][_0x8322('0x115')](db['Tag'],{'through':_0x8322('0x167'),'as':_0x8322('0x168')});db['MailInteraction'][_0x8322('0x115')](db[_0x8322('0x102')],{'as':_0x8322('0x169'),'through':_0x8322('0x11c'),'foreignKey':_0x8322('0x163')});db[_0x8322('0x43')][_0x8322('0x108')](db[_0x8322('0xe0')],{'as':_0x8322('0x16a'),'onDelete':_0x8322('0x104')});db[_0x8322('0x43')][_0x8322('0x113')](db[_0x8322('0x102')],{'as':_0x8322('0x102')});db[_0x8322('0x43')][_0x8322('0x113')](db[_0x8322('0x117')],{'onDelete':_0x8322('0x104'),'as':_0x8322('0x165')});db[_0x8322('0x43')][_0x8322('0x113')](db[_0x8322('0x41')],{'as':_0x8322('0x16b'),'foreignKey':_0x8322('0x163')});db[_0x8322('0x43')]['belongsTo'](db[_0x8322('0x3b')],{'as':_0x8322('0x164'),'foreignKey':_0x8322('0x158')});db[_0x8322('0x43')][_0x8322('0x113')](db[_0x8322('0x5f')],{'as':_0x8322('0x5f'),'foreignKey':_0x8322('0x16c')});db['MailMessage']['belongsTo'](db[_0x8322('0x65')],{'as':_0x8322('0x65'),'foreignKey':'ChatOfflineMessageId'});db[_0x8322('0x45')]['belongsTo'](db['User'],{'onDelete':_0x8322('0x156')});db['MailApplication'][_0x8322('0x113')](db['MailQueue'],{'onDelete':_0x8322('0x156')});db[_0x8322('0x45')][_0x8322('0x113')](db['MailAccount'],{'onDelete':_0x8322('0x156')});db[_0x8322('0x45')]['belongsTo'](db[_0x8322('0x7f')],{'onDelete':'restrict','foreignKey':_0x8322('0x147')});db[_0x8322('0x45')][_0x8322('0x113')](db[_0x8322('0x89')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport'][_0x8322('0x113')](db['MailAccount'],{});db[_0x8322('0x16d')]['belongsTo'](db[_0x8322('0xeb')],{'as':_0x8322('0x16e'),'foreignKey':_0x8322('0x15f')});db[_0x8322('0x16d')]['belongsTo'](db['CmContact'],{'as':_0x8322('0x165'),'foreignKey':_0x8322('0x155')});db['MailQueueReport']['belongsTo'](db[_0x8322('0x41')],{});db[_0x8322('0x16d')][_0x8322('0x113')](db[_0x8322('0x43')],{});db[_0x8322('0x16d')]['belongsTo'](db[_0x8322('0x102')],{});db[_0x8322('0x16d')][_0x8322('0x113')](db[_0x8322('0x3d')],{});db[_0x8322('0x16f')][_0x8322('0x108')](db[_0x8322('0x47')],{'as':'Items','onDelete':_0x8322('0x104')});db[_0x8322('0x48')][_0x8322('0x108')](db['Disposition'],{'as':_0x8322('0x170'),'foreignKey':'FaxAccountId','onDelete':_0x8322('0x104')});db[_0x8322('0x48')][_0x8322('0x108')](db[_0x8322('0x15c')],{'as':'Answers','foreignKey':_0x8322('0x171')});db['FaxAccount']['hasMany'](db[_0x8322('0x4a')],{'as':_0x8322('0x15e')});db[_0x8322('0x48')][_0x8322('0x108')](db[_0x8322('0x49')],{'as':'Applications'});db['FaxAccount'][_0x8322('0x108')](db['VoiceExtension'],{'as':_0x8322('0x172'),'onDelete':'cascade'});db['FaxAccount'][_0x8322('0x108')](db['FaxMessage'],{'as':'Messages'});db['FaxAccount'][_0x8322('0x113')](db[_0x8322('0x144')],{'as':'Trunk'});db[_0x8322('0x48')]['belongsTo'](db['CmList'],{'as':_0x8322('0x16e'),'foreignKey':_0x8322('0x15f')});db[_0x8322('0x48')]['belongsTo'](db[_0x8322('0x81')],{'as':_0x8322('0x148'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x8322('0x48')][_0x8322('0x115')](db[_0x8322('0x102')],{'as':'Agents','through':_0x8322('0x12f')});db[_0x8322('0x49')][_0x8322('0x113')](db['User'],{'onDelete':_0x8322('0x156')});db[_0x8322('0x49')]['belongsTo'](db[_0x8322('0x4d')],{'onDelete':'restrict'});db[_0x8322('0x49')][_0x8322('0x113')](db[_0x8322('0x48')],{'onDelete':'restrict'});db['FaxApplication'][_0x8322('0x113')](db[_0x8322('0x89')],{'onDelete':_0x8322('0x156'),'foreignKey':_0x8322('0x173')});db[_0x8322('0x4a')]['hasMany'](db[_0x8322('0x4b')],{'as':'Messages','onDelete':_0x8322('0x104'),'foreignKey':_0x8322('0x174')});db[_0x8322('0x4a')][_0x8322('0x113')](db['FaxAccount'],{'as':_0x8322('0x164'),'foreignKey':_0x8322('0x171')});db['FaxInteraction'][_0x8322('0x113')](db[_0x8322('0x117')],{'as':_0x8322('0x165'),'foreignKey':_0x8322('0x155')});db[_0x8322('0x4a')]['belongsTo'](db[_0x8322('0x102')],{'as':'Owner','foreignKey':_0x8322('0x105')});db['FaxInteraction']['belongsToMany'](db[_0x8322('0x89')],{'through':_0x8322('0x175'),'as':'Tags'});db[_0x8322('0x4a')]['belongsToMany'](db[_0x8322('0x89')],{'through':_0x8322('0x175'),'as':_0x8322('0x168')});db[_0x8322('0x4a')][_0x8322('0x115')](db[_0x8322('0x102')],{'as':_0x8322('0x169'),'through':'user_has_fax_interactions','foreignKey':_0x8322('0x174')});db[_0x8322('0x4b')]['belongsTo'](db['User'],{'onDelete':_0x8322('0x104'),'as':_0x8322('0x102')});db[_0x8322('0x4b')]['belongsTo'](db['FaxInteraction'],{'as':_0x8322('0x16b'),'foreignKey':_0x8322('0x174')});db[_0x8322('0x4b')][_0x8322('0x113')](db[_0x8322('0x117')],{'onDelete':'cascade','as':'Contact'});db['FaxMessage'][_0x8322('0x113')](db['Attachment'],{'as':_0x8322('0xe0'),'foreignKey':_0x8322('0x176')});db[_0x8322('0x4b')][_0x8322('0x113')](db['FaxAccount'],{'as':_0x8322('0x164'),'foreignKey':_0x8322('0x171')});db[_0x8322('0x4d')][_0x8322('0x115')](db['User'],{'as':'Agents','through':_0x8322('0x33')});db['FaxQueue'][_0x8322('0x115')](db['Team'],{'through':_0x8322('0x177'),'as':'Teams'});db[_0x8322('0x4f')]['belongsTo'](db['FaxAccount'],{});db['FaxQueueReport'][_0x8322('0x113')](db[_0x8322('0xeb')],{'as':_0x8322('0x16e'),'foreignKey':_0x8322('0x15f')});db[_0x8322('0x4f')][_0x8322('0x113')](db[_0x8322('0x117')],{'as':_0x8322('0x165'),'foreignKey':'ContactId'});db[_0x8322('0x4f')][_0x8322('0x113')](db[_0x8322('0x4a')],{});db['FaxQueueReport']['belongsTo'](db['FaxMessage'],{});db[_0x8322('0x4f')]['belongsTo'](db['User'],{});db[_0x8322('0x4f')][_0x8322('0x113')](db[_0x8322('0x4d')],{});db[_0x8322('0x50')][_0x8322('0x108')](db[_0x8322('0x7b')],{'as':'Dispositions','foreignKey':'SmsAccountId','onDelete':'cascade'});db['SmsAccount'][_0x8322('0x108')](db[_0x8322('0x15c')],{'as':'Answers','foreignKey':_0x8322('0x178')});db[_0x8322('0x50')][_0x8322('0x108')](db[_0x8322('0x54')],{'as':_0x8322('0x14f'),'foreignKey':_0x8322('0x178')});db[_0x8322('0x50')]['hasMany'](db['SmsInteraction'],{'as':_0x8322('0x15e')});db[_0x8322('0x50')]['hasMany'](db['SmsApplication'],{'as':'Applications'});db[_0x8322('0x50')]['belongsTo'](db[_0x8322('0xeb')],{'as':_0x8322('0x16e'),'foreignKey':_0x8322('0x15f')});db[_0x8322('0x50')][_0x8322('0x113')](db[_0x8322('0x81')],{'as':_0x8322('0x148'),'foreignKey':_0x8322('0x149')});db['SmsAccount'][_0x8322('0x115')](db[_0x8322('0x102')],{'as':'Agents','through':_0x8322('0x133')});db['SmsApplication']['belongsTo'](db['User'],{'onDelete':'restrict'});db['SmsApplication'][_0x8322('0x113')](db[_0x8322('0x56')],{'onDelete':_0x8322('0x156')});db[_0x8322('0x51')]['belongsTo'](db['SmsAccount'],{'onDelete':_0x8322('0x156')});db['SmsApplication'][_0x8322('0x113')](db[_0x8322('0x7f')],{'onDelete':_0x8322('0x156'),'foreignKey':'IntervalId'});db[_0x8322('0x51')][_0x8322('0x113')](db[_0x8322('0x89')],{'onDelete':'restrict','foreignKey':_0x8322('0x173')});db[_0x8322('0x52')][_0x8322('0x108')](db[_0x8322('0x54')],{'as':_0x8322('0x14f'),'onDelete':_0x8322('0x104'),'foreignKey':_0x8322('0x179')});db['SmsInteraction'][_0x8322('0x113')](db['SmsAccount'],{'as':_0x8322('0x164'),'foreignKey':_0x8322('0x178')});db['SmsInteraction'][_0x8322('0x113')](db[_0x8322('0x117')],{'as':_0x8322('0x165'),'foreignKey':'ContactId'});db[_0x8322('0x52')][_0x8322('0x113')](db['User'],{'as':'Owner','foreignKey':_0x8322('0x105')});db[_0x8322('0x52')]['belongsToMany'](db['Tag'],{'through':_0x8322('0x17a'),'as':'Tags'});db[_0x8322('0x52')]['belongsToMany'](db[_0x8322('0x89')],{'through':_0x8322('0x17a'),'as':_0x8322('0x168')});db[_0x8322('0x52')][_0x8322('0x115')](db[_0x8322('0x102')],{'as':_0x8322('0x169'),'through':_0x8322('0x121'),'foreignKey':_0x8322('0x179')});db[_0x8322('0x54')][_0x8322('0x113')](db[_0x8322('0x102')],{'as':'User'});db[_0x8322('0x54')][_0x8322('0x113')](db[_0x8322('0x117')],{'onDelete':'cascade','as':_0x8322('0x165')});db[_0x8322('0x54')][_0x8322('0x113')](db[_0x8322('0x52')],{'onDelete':_0x8322('0x104'),'as':_0x8322('0x16b'),'foreignKey':_0x8322('0x179')});db[_0x8322('0x54')]['belongsTo'](db['SmsAccount'],{'as':_0x8322('0x164'),'foreignKey':'SmsAccountId'});db[_0x8322('0x56')][_0x8322('0x115')](db[_0x8322('0x102')],{'as':_0x8322('0x14c'),'through':_0x8322('0x35'),'foreignKey':_0x8322('0x17b')});db[_0x8322('0x56')][_0x8322('0x115')](db[_0x8322('0x11a')],{'through':_0x8322('0x17c'),'as':_0x8322('0x17d')});db[_0x8322('0x57')][_0x8322('0x108')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x8322('0x17e'),'onDelete':_0x8322('0x104')});db[_0x8322('0x57')][_0x8322('0x108')](db['CannedAnswer'],{'as':_0x8322('0x15d'),'foreignKey':'OpenchannelAccountId'});db[_0x8322('0x57')][_0x8322('0x108')](db[_0x8322('0x5b')],{'as':_0x8322('0x15e'),'foreignKey':_0x8322('0x17e')});db[_0x8322('0x57')][_0x8322('0x108')](db[_0x8322('0x5c')],{'as':_0x8322('0x14f'),'foreignKey':_0x8322('0x17e')});db['OpenchannelAccount'][_0x8322('0x108')](db['OpenchannelApplication'],{'as':'Applications','foreignKey':_0x8322('0x17e')});db[_0x8322('0x57')]['belongsTo'](db[_0x8322('0xeb')],{'as':'List','foreignKey':_0x8322('0x15f')});db[_0x8322('0x57')]['belongsTo'](db['Pause'],{'as':_0x8322('0x148'),'foreignKey':_0x8322('0x149')});db[_0x8322('0x57')]['belongsToMany'](db['User'],{'as':_0x8322('0x14c'),'through':'user_has_openchannel_accounts'});db[_0x8322('0x59')][_0x8322('0x113')](db[_0x8322('0x102')],{'onDelete':'restrict'});db[_0x8322('0x59')]['belongsTo'](db[_0x8322('0x5d')],{'onDelete':_0x8322('0x156'),'foreignKey':'OpenchannelQueueId'});db[_0x8322('0x59')][_0x8322('0x113')](db[_0x8322('0x57')],{'onDelete':_0x8322('0x156'),'foreignKey':_0x8322('0x17e')});db['OpenchannelApplication']['belongsTo'](db[_0x8322('0x7f')],{'onDelete':'restrict','foreignKey':'IntervalId'});db['OpenchannelApplication'][_0x8322('0x113')](db[_0x8322('0x89')],{'onDelete':_0x8322('0x156'),'foreignKey':_0x8322('0x173')});db[_0x8322('0x5b')][_0x8322('0x108')](db[_0x8322('0x5c')],{'as':_0x8322('0x14f'),'onDelete':_0x8322('0x104'),'foreignKey':_0x8322('0x17f')});db[_0x8322('0x5b')][_0x8322('0x113')](db[_0x8322('0x57')],{'as':_0x8322('0x164'),'foreignKey':_0x8322('0x17e')});db['OpenchannelInteraction'][_0x8322('0x113')](db[_0x8322('0x117')],{'as':_0x8322('0x165'),'foreignKey':_0x8322('0x155')});db[_0x8322('0x5b')]['belongsTo'](db[_0x8322('0x102')],{'as':_0x8322('0x166'),'foreignKey':_0x8322('0x105')});db['OpenchannelInteraction'][_0x8322('0x115')](db[_0x8322('0x89')],{'through':_0x8322('0x180'),'as':'Tags'});db[_0x8322('0x5b')][_0x8322('0x115')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x8322('0x168')});db[_0x8322('0x5b')][_0x8322('0x115')](db['User'],{'as':_0x8322('0x169'),'through':_0x8322('0x122'),'foreignKey':_0x8322('0x17f')});db['OpenchannelMessage'][_0x8322('0x113')](db['User'],{'onDelete':_0x8322('0x104'),'as':_0x8322('0x102')});db[_0x8322('0x5c')][_0x8322('0x113')](db[_0x8322('0x117')],{'onDelete':_0x8322('0x104'),'as':_0x8322('0x165')});db['OpenchannelMessage']['belongsTo'](db[_0x8322('0x5b')],{'onDelete':_0x8322('0x104'),'as':_0x8322('0x16b'),'foreignKey':'OpenchannelInteractionId'});db['OpenchannelMessage'][_0x8322('0x113')](db[_0x8322('0xe0')],{'as':_0x8322('0xe0'),'foreignKey':_0x8322('0x176')});db[_0x8322('0x5c')][_0x8322('0x113')](db[_0x8322('0x57')],{'as':_0x8322('0x164'),'foreignKey':_0x8322('0x17e')});db[_0x8322('0x5d')][_0x8322('0x115')](db['User'],{'as':_0x8322('0x14c'),'through':'UserOpenchannelQueue','foreignKey':_0x8322('0x181')});db[_0x8322('0x5d')][_0x8322('0x115')](db['Team'],{'through':_0x8322('0x182'),'as':_0x8322('0x17d')});db[_0x8322('0x5f')]['hasMany'](db['Disposition'],{'as':'Dispositions','foreignKey':'ChatWebsiteId','onDelete':_0x8322('0x104')});db[_0x8322('0x5f')][_0x8322('0x108')](db[_0x8322('0x15c')],{'as':_0x8322('0x15d'),'foreignKey':_0x8322('0x16c')});db[_0x8322('0x5f')][_0x8322('0x108')](db['ChatProactiveAction'],{'as':_0x8322('0x183')});db['ChatWebsite'][_0x8322('0x108')](db[_0x8322('0x10e')],{'as':_0x8322('0x15e')});db[_0x8322('0x5f')][_0x8322('0x108')](db[_0x8322('0x62')],{'as':'Applications'});db[_0x8322('0x5f')][_0x8322('0x108')](db[_0x8322('0x184')],{'as':_0x8322('0x14f')});db[_0x8322('0x5f')][_0x8322('0x113')](db['CmList'],{'as':_0x8322('0x16e'),'foreignKey':'ListId'});db[_0x8322('0x5f')][_0x8322('0x113')](db[_0x8322('0x7f')],{'as':'Interval','foreignKey':'IntervalId'});db[_0x8322('0x5f')]['belongsTo'](db[_0x8322('0x3b')],{'as':_0x8322('0x3b'),'foreignKey':_0x8322('0x158')});db[_0x8322('0x5f')]['belongsTo'](db[_0x8322('0x81')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x8322('0x5f')][_0x8322('0x115')](db[_0x8322('0x102')],{'as':_0x8322('0x14c'),'through':_0x8322('0x12d')});db[_0x8322('0x185')]['belongsTo'](db['OpenchannelAccount'],{});db[_0x8322('0x185')]['belongsTo'](db[_0x8322('0xeb')],{'as':_0x8322('0x16e'),'foreignKey':_0x8322('0x15f')});db['OpenchannelQueueReport'][_0x8322('0x113')](db['CmContact'],{'as':'Contact','foreignKey':_0x8322('0x155')});db['OpenchannelQueueReport'][_0x8322('0x113')](db[_0x8322('0x5b')],{});db[_0x8322('0x185')]['belongsTo'](db[_0x8322('0x5c')],{});db['OpenchannelQueueReport'][_0x8322('0x113')](db[_0x8322('0x102')],{});db[_0x8322('0x185')]['belongsTo'](db[_0x8322('0x5d')],{});db[_0x8322('0x62')][_0x8322('0x113')](db[_0x8322('0x102')],{'as':_0x8322('0x186'),'foreignKey':_0x8322('0x105'),'onDelete':'restrict'});db[_0x8322('0x62')][_0x8322('0x113')](db[_0x8322('0x67')],{'as':'Queue','foreignKey':_0x8322('0x187'),'onDelete':_0x8322('0x156')});db['ChatApplication'][_0x8322('0x113')](db[_0x8322('0x5f')],{'as':_0x8322('0x188'),'foreignKey':'ChatWebsiteId','onDelete':_0x8322('0x156')});db[_0x8322('0x62')][_0x8322('0x113')](db['Tag'],{'onDelete':_0x8322('0x156'),'foreignKey':_0x8322('0x173')});db['ChatInteraction']['hasMany'](db['ChatMessage'],{'as':_0x8322('0x14f'),'onDelete':_0x8322('0x104'),'foreignKey':'ChatInteractionId'});db[_0x8322('0x10e')][_0x8322('0x113')](db[_0x8322('0x5f')],{'as':_0x8322('0x164'),'foreignKey':_0x8322('0x16c')});db[_0x8322('0x10e')][_0x8322('0x113')](db[_0x8322('0x117')],{'as':'Contact','foreignKey':_0x8322('0x155')});db['ChatInteraction'][_0x8322('0x113')](db[_0x8322('0x102')],{'as':_0x8322('0x166'),'foreignKey':_0x8322('0x105')});db[_0x8322('0x10e')][_0x8322('0x115')](db[_0x8322('0x89')],{'through':_0x8322('0x189'),'as':_0x8322('0x18a')});db[_0x8322('0x10e')]['belongsToMany'](db['Tag'],{'through':_0x8322('0x189'),'as':_0x8322('0x168')});db[_0x8322('0x10e')][_0x8322('0x115')](db[_0x8322('0x102')],{'as':_0x8322('0x169'),'through':_0x8322('0x11e'),'foreignKey':'ChatInteractionId'});db[_0x8322('0x184')]['belongsTo'](db[_0x8322('0x102')],{'onDelete':_0x8322('0x104'),'as':_0x8322('0x102')});db[_0x8322('0x184')][_0x8322('0x113')](db[_0x8322('0x117')],{'onDelete':_0x8322('0x104'),'as':_0x8322('0x165'),'foreignKey':_0x8322('0x155')});db[_0x8322('0x184')][_0x8322('0x113')](db[_0x8322('0x10e')],{'onDelete':_0x8322('0x104'),'as':_0x8322('0x16b'),'foreignKey':'ChatInteractionId'});db[_0x8322('0x184')]['belongsTo'](db[_0x8322('0xe0')],{'as':_0x8322('0xe0'),'foreignKey':'AttachmentId'});db[_0x8322('0x184')][_0x8322('0x113')](db[_0x8322('0x5f')],{'as':_0x8322('0x164'),'foreignKey':'ChatWebsiteId'});db[_0x8322('0x65')][_0x8322('0x108')](db[_0x8322('0xe0')],{'as':_0x8322('0x16a'),'foreignKey':_0x8322('0x18b'),'onDelete':'cascade','hooks':!![]});db['ChatOfflineMessage'][_0x8322('0x113')](db['CmContact'],{'onDelete':_0x8322('0x104'),'as':_0x8322('0x165'),'foreignKey':_0x8322('0x155')});db[_0x8322('0x65')]['belongsTo'](db['ChatWebsite'],{'as':_0x8322('0x164'),'foreignKey':'ChatWebsiteId'});db[_0x8322('0x67')][_0x8322('0x115')](db['User'],{'as':_0x8322('0x14c'),'through':'UserChatQueue','hooks':!![]});db[_0x8322('0x67')][_0x8322('0x115')](db[_0x8322('0x11a')],{'through':_0x8322('0x18c'),'as':_0x8322('0x17d')});db[_0x8322('0x18d')]['hasMany'](db[_0x8322('0xcb')],{'as':_0x8322('0x14f'),'foreignKey':_0x8322('0x18e'),'onDelete':_0x8322('0x104')});db[_0x8322('0x18d')][_0x8322('0x115')](db['User'],{'as':_0x8322('0x13d'),'through':'chat_group_has_users'});db[_0x8322('0x69')]['belongsTo'](db['ChatWebsite'],{'as':_0x8322('0x188'),'foreignKey':_0x8322('0x16c')});db['CmCompany'][_0x8322('0x108')](db[_0x8322('0x117')],{'as':_0x8322('0x18f'),'foreignKey':_0x8322('0x190')});db[_0x8322('0x117')]['hasMany'](db[_0x8322('0x6c')],{'as':'Hoppers','foreignKey':'ContactId'});db['CmContact'][_0x8322('0x108')](db['CmHopperFinal'],{'as':_0x8322('0x140'),'foreignKey':'ContactId'});db[_0x8322('0x117')]['hasMany'](db[_0x8322('0x71')],{'as':_0x8322('0x141'),'foreignKey':_0x8322('0x155')});db[_0x8322('0x117')][_0x8322('0x108')](db['ReportAgentPreview'],{'as':_0x8322('0x73'),'foreignKey':_0x8322('0x155')});db['CmContact']['hasMany'](db[_0x8322('0x142')],{'as':'JscriptySessions','foreignKey':_0x8322('0x155')});db['CmContact'][_0x8322('0x108')](db[_0x8322('0x5b')],{'as':_0x8322('0x10d'),'foreignKey':_0x8322('0x155'),'onDelete':_0x8322('0x156')});db[_0x8322('0x117')][_0x8322('0x108')](db[_0x8322('0x10e')],{'as':_0x8322('0x11d'),'foreignKey':'ContactId','onDelete':_0x8322('0x156')});db[_0x8322('0x117')][_0x8322('0x108')](db[_0x8322('0x52')],{'as':'SmsInteractions','foreignKey':'ContactId','onDelete':_0x8322('0x156')});db['CmContact']['hasMany'](db[_0x8322('0x4a')],{'as':_0x8322('0x11f'),'foreignKey':'ContactId','onDelete':_0x8322('0x156')});db[_0x8322('0x117')][_0x8322('0x108')](db['MailInteraction'],{'as':_0x8322('0x110'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0x8322('0x117')][_0x8322('0x113')](db[_0x8322('0x6b')],{'as':'Company','foreignKey':'CompanyId'});db['CmContact']['belongsTo'](db['CmList'],{'as':_0x8322('0x16e'),'foreignKey':_0x8322('0x15f'),'onDelete':_0x8322('0x104')});db[_0x8322('0x117')]['belongsToMany'](db[_0x8322('0x102')],{'as':_0x8322('0x169'),'through':_0x8322('0x118')});db[_0x8322('0x117')][_0x8322('0x115')](db[_0x8322('0x89')],{'as':_0x8322('0x18a'),'through':'cm_contact_has_tags'});db[_0x8322('0x117')][_0x8322('0x115')](db[_0x8322('0x89')],{'through':_0x8322('0x191'),'as':_0x8322('0x168')});db['CmHopper'][_0x8322('0x113')](db[_0x8322('0x117')],{'as':_0x8322('0x165'),'foreignKey':_0x8322('0x155'),'onDelete':_0x8322('0x104')});db[_0x8322('0x6c')][_0x8322('0x113')](db[_0x8322('0xeb')],{'as':_0x8322('0x16e'),'foreignKey':_0x8322('0x15f'),'onDelete':'cascade'});db[_0x8322('0x6c')]['belongsTo'](db[_0x8322('0x102')],{'as':'Agent','foreignKey':'UserId'});db[_0x8322('0x6c')]['belongsTo'](db[_0x8322('0x1a')],{'as':_0x8322('0x192'),'foreignKey':_0x8322('0x13e'),'onDelete':_0x8322('0x104')});db[_0x8322('0x6c')][_0x8322('0x113')](db[_0x8322('0x193')],{'as':_0x8322('0x193'),'foreignKey':_0x8322('0x194'),'onDelete':'cascade'});db[_0x8322('0x6c')]['belongsTo'](db['User'],{'as':_0x8322('0x166'),'foreignKey':_0x8322('0x195')});db[_0x8322('0x6e')][_0x8322('0x113')](db[_0x8322('0x117')],{'as':'Contact','foreignKey':_0x8322('0x155'),'onDelete':'cascade'});db[_0x8322('0x6e')][_0x8322('0x113')](db['CmList'],{'as':'List','foreignKey':_0x8322('0x15f'),'onDelete':_0x8322('0x104')});db['CmHopperBlack'][_0x8322('0x113')](db['VoiceQueue'],{'as':_0x8322('0x192'),'foreignKey':_0x8322('0x13e'),'onDelete':'cascade'});db[_0x8322('0x6e')][_0x8322('0x113')](db[_0x8322('0x193')],{'as':'Campaign','foreignKey':_0x8322('0x194'),'onDelete':_0x8322('0x104')});db['Automation']['hasMany'](db[_0x8322('0x7d')],{'as':{'plural':'All','singular':_0x8322('0x196')},'foreignKey':_0x8322('0x197'),'onDelete':_0x8322('0x104'),'hooks':!![]});db[_0x8322('0x78')]['hasMany'](db[_0x8322('0x7d')],{'as':{'plural':_0x8322('0x198'),'singular':_0x8322('0x199')},'foreignKey':_0x8322('0x19a'),'onDelete':_0x8322('0x104'),'hooks':!![]});db['Automation'][_0x8322('0x108')](db[_0x8322('0x76')],{'as':'Actions','foreignKey':_0x8322('0x19b'),'onDelete':_0x8322('0x104'),'hooks':!![]});db['Disposition'][_0x8322('0x108')](db[_0x8322('0x7b')],{'as':'Dispositions','foreignKey':_0x8322('0x19c'),'onDelete':'cascade'});db[_0x8322('0x7f')][_0x8322('0x108')](db['Interval'],{'as':_0x8322('0x19d'),'foreignKey':'IntervalId','onDelete':_0x8322('0x104'),'hooks':!![],'required':![]});db['Interval'][_0x8322('0x108')](db[_0x8322('0x16')],{'as':_0x8322('0x10b'),'foreignKey':'IntervalId','onDelete':_0x8322('0x156')});db['Interval'][_0x8322('0x108')](db[_0x8322('0x45')],{'as':_0x8322('0x19e'),'foreignKey':_0x8322('0x147')});db['Interval']['hasMany'](db[_0x8322('0x62')],{'as':_0x8322('0x19f'),'foreignKey':_0x8322('0x147')});db['Interval'][_0x8322('0x108')](db[_0x8322('0x49')],{'as':_0x8322('0x1a0'),'foreignKey':'IntervalId'});db[_0x8322('0x7f')][_0x8322('0x108')](db['SmsApplication'],{'as':_0x8322('0x1a1'),'foreignKey':_0x8322('0x147')});db[_0x8322('0x85')]['belongsTo'](db[_0x8322('0x3b')],{});db[_0x8322('0x85')][_0x8322('0x113')](db[_0x8322('0x1a2')],{'foreignKey':_0x8322('0x1a3')});db[_0x8322('0x85')][_0x8322('0x113')](db['AnalyticCustomReport'],{'foreignKey':'CustomReportId'});db[_0x8322('0x87')][_0x8322('0x115')](db[_0x8322('0x18')],{'as':_0x8322('0x1a4'),'through':_0x8322('0x13c'),'onDelete':_0x8322('0x156')});db[_0x8322('0x89')][_0x8322('0x115')](db[_0x8322('0x117')],{'through':'cm_contact_has_tags'});db['Tag'][_0x8322('0x115')](db['ChatInteraction'],{'through':'chat_interaction_has_tags'});db['Tag'][_0x8322('0x115')](db[_0x8322('0x41')],{'through':_0x8322('0x167')});db['Tag']['belongsToMany'](db[_0x8322('0x52')],{'through':'sms_interaction_has_tags'});db['Tag'][_0x8322('0x115')](db['FaxInteraction'],{'through':_0x8322('0x175')});db['Tag'][_0x8322('0x115')](db[_0x8322('0x5b')],{'through':_0x8322('0x180')});db[_0x8322('0x89')][_0x8322('0x115')](db[_0x8322('0xf6')],{'through':_0x8322('0x1a5')});db[_0x8322('0x1a6')][_0x8322('0x108')](db[_0x8322('0x7d')],{'as':{'plural':_0x8322('0x1a7'),'singular':_0x8322('0x1a8')},'foreignKey':_0x8322('0x1a9'),'onDelete':_0x8322('0x104'),'hooks':!![]});db['Trigger'][_0x8322('0x108')](db['Condition'],{'as':{'plural':_0x8322('0x1aa'),'singular':_0x8322('0x1ab')},'foreignKey':_0x8322('0x1ac'),'onDelete':_0x8322('0x104'),'hooks':!![]});db[_0x8322('0x1a6')][_0x8322('0x108')](db[_0x8322('0x76')],{'as':'Actions','foreignKey':_0x8322('0x1ad'),'onDelete':_0x8322('0x104'),'hooks':!![]});db['AnalyticCustomReport'][_0x8322('0x108')](db[_0x8322('0x1ae')],{'as':_0x8322('0x1af'),'onDelete':_0x8322('0x104'),'foreignKey':_0x8322('0x1b0'),'hooks':!![]});db[_0x8322('0x1a2')][_0x8322('0x108')](db[_0x8322('0x1ae')],{'as':_0x8322('0x1af'),'onDelete':_0x8322('0x104'),'foreignKey':_0x8322('0x1a3')});db[_0x8322('0x97')][_0x8322('0x108')](db[_0x8322('0x1ae')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x8322('0x1b1')});db['AnalyticFieldReport'][_0x8322('0x113')](db[_0x8322('0x97')],{'foreignKey':'MetricId'});db[_0x8322('0x9b')]['hasMany'](db[_0x8322('0x9d')],{'as':_0x8322('0x1b2'),'onDelete':_0x8322('0x104'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x8322('0x108')](db[_0x8322('0x1b3')],{'as':_0x8322('0x1b4'),'onDelete':'cascade','foreignKey':_0x8322('0x1b5')});db[_0x8322('0x9d')][_0x8322('0x108')](db[_0x8322('0x1b3')],{'as':_0x8322('0x1b6'),'onDelete':_0x8322('0x104'),'foreignKey':'DescriptionId'});db[_0x8322('0x9d')][_0x8322('0x108')](db[_0x8322('0x1b3')],{'as':'Fields','onDelete':_0x8322('0x104'),'foreignKey':_0x8322('0x1b7')});db[_0x8322('0x9d')][_0x8322('0x113')](db['SalesforceAccount'],{'as':_0x8322('0x164'),'foreignKey':_0x8322('0x1b8')});db[_0x8322('0x1b3')][_0x8322('0x108')](db[_0x8322('0x1b3')],{'as':_0x8322('0x1b9'),'foreignKey':_0x8322('0x1b5')});db[_0x8322('0x1b3')][_0x8322('0x108')](db['SalesforceField'],{'as':_0x8322('0x1ba'),'foreignKey':_0x8322('0x1bb')});db[_0x8322('0x1b3')][_0x8322('0x108')](db['SalesforceField'],{'as':_0x8322('0x1bc'),'foreignKey':_0x8322('0x1b7')});db['SalesforceField'][_0x8322('0x113')](db[_0x8322('0x8e')],{'as':_0x8322('0x8e'),'foreignKey':_0x8322('0x1bd')});db['SugarcrmAccount'][_0x8322('0x108')](db['SugarcrmConfiguration'],{'as':_0x8322('0x1b2'),'onDelete':_0x8322('0x104'),'foreignKey':_0x8322('0x1b8')});db[_0x8322('0xa2')]['hasMany'](db[_0x8322('0xa4')],{'as':_0x8322('0x1b4'),'onDelete':_0x8322('0x104'),'foreignKey':_0x8322('0x1b5')});db[_0x8322('0xa2')]['hasMany'](db[_0x8322('0xa4')],{'as':_0x8322('0x1b6'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x8322('0xa2')][_0x8322('0x108')](db[_0x8322('0xa4')],{'as':_0x8322('0x1af'),'onDelete':'cascade','foreignKey':_0x8322('0x1b7')});db[_0x8322('0xa2')]['belongsTo'](db[_0x8322('0xa0')],{'as':_0x8322('0x164'),'foreignKey':_0x8322('0x1b8')});db[_0x8322('0xa4')][_0x8322('0x108')](db['SugarcrmField'],{'as':_0x8322('0x1b9'),'foreignKey':'SubjectId'});db[_0x8322('0xa4')]['hasMany'](db[_0x8322('0xa4')],{'as':_0x8322('0x1ba'),'foreignKey':'DescriptionId'});db['SugarcrmField'][_0x8322('0x108')](db[_0x8322('0xa4')],{'as':_0x8322('0x1bc'),'foreignKey':_0x8322('0x1b7')});db[_0x8322('0xa4')]['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db['DeskAccount'][_0x8322('0x108')](db[_0x8322('0xa7')],{'as':'Configurations','onDelete':_0x8322('0x104'),'foreignKey':_0x8322('0x1b8')});db[_0x8322('0xa7')][_0x8322('0x108')](db[_0x8322('0xa9')],{'as':_0x8322('0x1b4'),'onDelete':'cascade','foreignKey':_0x8322('0x1b5')});db['DeskConfiguration'][_0x8322('0x108')](db[_0x8322('0xa9')],{'as':'Descriptions','onDelete':_0x8322('0x104'),'foreignKey':_0x8322('0x1bb')});db[_0x8322('0xa7')]['hasMany'](db[_0x8322('0xa9')],{'as':_0x8322('0x1af'),'onDelete':_0x8322('0x104'),'foreignKey':_0x8322('0x1b7')});db['DeskConfiguration'][_0x8322('0x113')](db[_0x8322('0xa5')],{'as':_0x8322('0x164'),'foreignKey':_0x8322('0x1b8')});db[_0x8322('0xa7')][_0x8322('0x115')](db['Tag'],{'through':'int_desk_configuration_has_tags'});db[_0x8322('0xa9')][_0x8322('0x108')](db[_0x8322('0xa9')],{'as':'Subject','foreignKey':_0x8322('0x1b5')});db[_0x8322('0xa9')][_0x8322('0x108')](db['DeskField'],{'as':_0x8322('0x1ba'),'foreignKey':_0x8322('0x1bb')});db['DeskField'][_0x8322('0x108')](db['DeskField'],{'as':'Field','foreignKey':'FieldId'});db[_0x8322('0xa9')][_0x8322('0x113')](db[_0x8322('0x8e')],{'as':_0x8322('0x8e'),'foreignKey':_0x8322('0x1bd')});db[_0x8322('0xaa')][_0x8322('0x108')](db[_0x8322('0x1be')],{'as':_0x8322('0x1b2'),'onDelete':_0x8322('0x104'),'foreignKey':'AccountId'});db[_0x8322('0x1be')]['hasMany'](db['ZohoField'],{'as':_0x8322('0x1b4'),'onDelete':'cascade','foreignKey':_0x8322('0x1b5')});db[_0x8322('0x1be')][_0x8322('0x108')](db[_0x8322('0xad')],{'as':_0x8322('0x1b6'),'onDelete':'cascade','foreignKey':_0x8322('0x1bb')});db[_0x8322('0x1be')][_0x8322('0x108')](db[_0x8322('0xad')],{'as':_0x8322('0x1af'),'onDelete':_0x8322('0x104'),'foreignKey':_0x8322('0x1b7')});db[_0x8322('0x1be')][_0x8322('0x113')](db[_0x8322('0xaa')],{'as':'Account','foreignKey':_0x8322('0x1b8')});db[_0x8322('0xad')][_0x8322('0x108')](db['ZohoField'],{'as':_0x8322('0x1b9'),'foreignKey':_0x8322('0x1b5')});db[_0x8322('0xad')]['hasMany'](db[_0x8322('0xad')],{'as':_0x8322('0x1ba'),'foreignKey':_0x8322('0x1bb')});db['ZohoField'][_0x8322('0x108')](db[_0x8322('0xad')],{'as':'Field','foreignKey':_0x8322('0x1b7')});db[_0x8322('0xad')]['belongsTo'](db[_0x8322('0x8e')],{'as':_0x8322('0x8e'),'foreignKey':_0x8322('0x1bd')});db['ZendeskAccount']['hasMany'](db[_0x8322('0xb1')],{'as':_0x8322('0x1b2'),'onDelete':_0x8322('0x104'),'foreignKey':_0x8322('0x1b8')});db[_0x8322('0xb1')][_0x8322('0x108')](db[_0x8322('0x1bf')],{'as':_0x8322('0x1b4'),'foreignKey':'SubjectId'});db[_0x8322('0xb1')][_0x8322('0x108')](db['ZendeskField'],{'as':_0x8322('0x1b6'),'foreignKey':'DescriptionId'});db[_0x8322('0xb1')][_0x8322('0x108')](db['ZendeskField'],{'as':_0x8322('0x1af'),'foreignKey':_0x8322('0x1b7')});db[_0x8322('0xb1')][_0x8322('0x113')](db['ZendeskAccount'],{'as':_0x8322('0x164'),'foreignKey':'AccountId'});db['ZendeskConfiguration']['belongsToMany'](db['Tag'],{'through':_0x8322('0x1c0')});db['ZendeskField']['hasMany'](db[_0x8322('0x1bf')],{'as':_0x8322('0x1b9'),'foreignKey':_0x8322('0x1b5')});db['ZendeskField']['hasMany'](db['ZendeskField'],{'as':_0x8322('0x1ba'),'foreignKey':_0x8322('0x1bb')});db[_0x8322('0x1bf')][_0x8322('0x108')](db[_0x8322('0x1bf')],{'as':_0x8322('0x1bc'),'foreignKey':_0x8322('0x1b7')});db[_0x8322('0x1bf')][_0x8322('0x113')](db['Variable'],{'as':_0x8322('0x8e'),'foreignKey':_0x8322('0x1bd')});db[_0x8322('0xb3')][_0x8322('0x108')](db[_0x8322('0x1c1')],{'as':_0x8322('0x1b2'),'onDelete':_0x8322('0x104'),'foreignKey':'AccountId'});db[_0x8322('0x1c1')][_0x8322('0x108')](db['FreshdeskField'],{'as':_0x8322('0x1b4'),'onDelete':_0x8322('0x104'),'foreignKey':'SubjectId'});db[_0x8322('0x1c1')]['hasMany'](db[_0x8322('0xb5')],{'as':_0x8322('0x1b6'),'onDelete':'cascade','foreignKey':_0x8322('0x1bb')});db[_0x8322('0x1c1')][_0x8322('0x108')](db['FreshdeskField'],{'as':_0x8322('0x1af'),'onDelete':'cascade','foreignKey':_0x8322('0x1b7')});db['FreshdeskConfiguration'][_0x8322('0x113')](db[_0x8322('0xb3')],{'as':_0x8322('0x164'),'foreignKey':'AccountId'});db[_0x8322('0x1c1')][_0x8322('0x115')](db[_0x8322('0x89')],{'through':_0x8322('0x1c2')});db[_0x8322('0xb5')]['hasMany'](db[_0x8322('0xb5')],{'as':_0x8322('0x1b9'),'foreignKey':_0x8322('0x1b5')});db[_0x8322('0xb5')][_0x8322('0x108')](db['FreshdeskField'],{'as':_0x8322('0x1ba'),'foreignKey':_0x8322('0x1bb')});db[_0x8322('0xb5')]['hasMany'](db[_0x8322('0xb5')],{'as':_0x8322('0x1bc'),'foreignKey':_0x8322('0x1b7')});db['FreshdeskField'][_0x8322('0x113')](db[_0x8322('0x8e')],{'as':_0x8322('0x8e'),'foreignKey':'VariableId'});db[_0x8322('0xb7')][_0x8322('0x108')](db[_0x8322('0xb8')],{'as':_0x8322('0x1b2'),'onDelete':_0x8322('0x104'),'foreignKey':_0x8322('0x1b8')});db[_0x8322('0xb8')][_0x8322('0x108')](db[_0x8322('0x1c3')],{'as':'Subjects','foreignKey':_0x8322('0x1b5')});db[_0x8322('0xb8')][_0x8322('0x108')](db[_0x8322('0x1c3')],{'as':_0x8322('0x1b6'),'foreignKey':'DescriptionId'});db[_0x8322('0xb8')][_0x8322('0x108')](db[_0x8322('0x1c3')],{'as':'Fields','foreignKey':'FieldId'});db[_0x8322('0xb8')][_0x8322('0x113')](db[_0x8322('0xb7')],{'as':'Account','foreignKey':_0x8322('0x1b8')});db[_0x8322('0x1c3')]['hasMany'](db['VtigerField'],{'as':'Subject','foreignKey':_0x8322('0x1b5')});db['VtigerField']['hasMany'](db['VtigerField'],{'as':_0x8322('0x1ba'),'foreignKey':_0x8322('0x1bb')});db[_0x8322('0x1c3')]['hasMany'](db['VtigerField'],{'as':_0x8322('0x1bc'),'foreignKey':'FieldId'});db['VtigerField']['belongsTo'](db['Variable'],{'as':_0x8322('0x8e'),'foreignKey':'VariableId'});db['ServicenowAccount'][_0x8322('0x108')](db[_0x8322('0x1c4')],{'as':_0x8322('0x1b2'),'onDelete':_0x8322('0x104'),'foreignKey':_0x8322('0x1b8')});db[_0x8322('0x1c4')][_0x8322('0x108')](db[_0x8322('0xbb')],{'as':_0x8322('0x1b4'),'foreignKey':_0x8322('0x1b5')});db[_0x8322('0x1c4')][_0x8322('0x108')](db[_0x8322('0xbb')],{'as':_0x8322('0x1b6'),'foreignKey':_0x8322('0x1bb')});db[_0x8322('0x1c4')]['hasMany'](db[_0x8322('0xbb')],{'as':'Fields','foreignKey':_0x8322('0x1b7')});db[_0x8322('0x1c4')][_0x8322('0x113')](db['ServicenowAccount'],{'as':_0x8322('0x164'),'foreignKey':_0x8322('0x1b8')});db['ServicenowField'][_0x8322('0x108')](db[_0x8322('0xbb')],{'as':_0x8322('0x1b9'),'foreignKey':_0x8322('0x1b5')});db[_0x8322('0xbb')][_0x8322('0x108')](db[_0x8322('0xbb')],{'as':'Description','foreignKey':_0x8322('0x1bb')});db[_0x8322('0xbb')][_0x8322('0x108')](db[_0x8322('0xbb')],{'as':_0x8322('0x1bc'),'foreignKey':_0x8322('0x1b7')});db[_0x8322('0xbb')]['belongsTo'](db['Variable'],{'as':_0x8322('0x8e'),'foreignKey':_0x8322('0x1bd')});db[_0x8322('0xbd')][_0x8322('0x108')](db['Dynamics365Configuration'],{'as':_0x8322('0x1b2'),'onDelete':_0x8322('0x104'),'foreignKey':_0x8322('0x1b8')});db['Dynamics365Account']['belongsTo'](db['CloudProvider'],{'as':'CloudProvider','foreignKey':_0x8322('0x159')});db[_0x8322('0xbf')]['hasMany'](db[_0x8322('0xc1')],{'as':'Subjects','onDelete':_0x8322('0x104'),'foreignKey':_0x8322('0x1b5')});db[_0x8322('0xbf')][_0x8322('0x108')](db[_0x8322('0xc1')],{'as':'Descriptions','onDelete':_0x8322('0x104'),'foreignKey':_0x8322('0x1bb')});db[_0x8322('0xbf')][_0x8322('0x108')](db[_0x8322('0xc1')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x8322('0x1b7')});db[_0x8322('0xbf')][_0x8322('0x113')](db['Dynamics365Account'],{'as':_0x8322('0x164'),'foreignKey':_0x8322('0x1b8')});db[_0x8322('0xc1')][_0x8322('0x108')](db[_0x8322('0xc1')],{'as':_0x8322('0x1b9'),'foreignKey':'SubjectId'});db[_0x8322('0xc1')][_0x8322('0x108')](db[_0x8322('0xc1')],{'as':_0x8322('0x1ba'),'foreignKey':'DescriptionId'});db[_0x8322('0xc1')]['hasMany'](db[_0x8322('0xc1')],{'as':'Field','foreignKey':_0x8322('0x1b7')});db[_0x8322('0xc1')][_0x8322('0x113')](db[_0x8322('0x8e')],{'as':_0x8322('0x8e'),'foreignKey':'VariableId'});db[_0x8322('0xc3')][_0x8322('0x108')](db[_0x8322('0xc5')],{'as':_0x8322('0x1b2'),'onDelete':'cascade','foreignKey':_0x8322('0x1b8')});db[_0x8322('0xc5')][_0x8322('0x108')](db[_0x8322('0x1c5')],{'as':_0x8322('0x1b4'),'foreignKey':'SubjectId'});db['FreshsalesConfiguration']['hasMany'](db[_0x8322('0x1c5')],{'as':'Descriptions','foreignKey':_0x8322('0x1bb')});db['FreshsalesConfiguration'][_0x8322('0x108')](db[_0x8322('0x1c5')],{'as':_0x8322('0x1af'),'foreignKey':_0x8322('0x1b7')});db[_0x8322('0xc5')][_0x8322('0x113')](db[_0x8322('0xc3')],{'as':'Account','foreignKey':_0x8322('0x1b8')});db[_0x8322('0x1c5')]['hasMany'](db['FreshsalesField'],{'as':_0x8322('0x1b9'),'foreignKey':_0x8322('0x1b5')});db[_0x8322('0x1c5')][_0x8322('0x108')](db[_0x8322('0x1c5')],{'as':_0x8322('0x1ba'),'foreignKey':_0x8322('0x1bb')});db['FreshsalesField'][_0x8322('0x108')](db[_0x8322('0x1c5')],{'as':'Field','foreignKey':_0x8322('0x1b7')});db['FreshsalesField'][_0x8322('0x113')](db[_0x8322('0x8e')],{'as':'Variable','foreignKey':_0x8322('0x1bd')});db['ChatQueueReport'][_0x8322('0x113')](db[_0x8322('0x5f')],{});db[_0x8322('0x1c6')]['belongsTo'](db[_0x8322('0xeb')],{'as':_0x8322('0x16e'),'foreignKey':_0x8322('0x15f')});db[_0x8322('0x1c6')][_0x8322('0x113')](db[_0x8322('0x117')],{'as':'Contact','foreignKey':'ContactId'});db[_0x8322('0x1c6')]['belongsTo'](db[_0x8322('0x10e')],{});db[_0x8322('0x1c6')][_0x8322('0x113')](db[_0x8322('0x184')],{});db[_0x8322('0x1c6')][_0x8322('0x113')](db['User'],{});db[_0x8322('0x1c6')]['belongsTo'](db[_0x8322('0x67')],{});db[_0x8322('0xcb')][_0x8322('0x113')](db['User'],{'onDelete':_0x8322('0x104'),'foreignKey':'FromId'});db[_0x8322('0xcb')][_0x8322('0x113')](db[_0x8322('0x102')],{'onDelete':'cascade','foreignKey':_0x8322('0x1c7')});db[_0x8322('0x142')]['hasMany'](db[_0x8322('0x1c8')],{'foreignKey':_0x8322('0x1c9'),'onDelete':_0x8322('0x104')});db['JscriptySessionReport'][_0x8322('0x108')](db['JscriptyAnswerReport'],{'foreignKey':_0x8322('0x1c9'),'onDelete':_0x8322('0x104')});db[_0x8322('0xd1')][_0x8322('0x113')](db[_0x8322('0x50')],{});db[_0x8322('0xd1')]['belongsTo'](db[_0x8322('0xeb')],{'as':_0x8322('0x16e'),'foreignKey':'ListId'});db[_0x8322('0xd1')][_0x8322('0x113')](db['CmContact'],{'as':'Contact','foreignKey':_0x8322('0x155')});db[_0x8322('0xd1')]['belongsTo'](db[_0x8322('0x52')],{});db['SmsQueueReport'][_0x8322('0x113')](db[_0x8322('0x54')],{});db[_0x8322('0xd1')][_0x8322('0x113')](db[_0x8322('0x102')],{});db[_0x8322('0xd1')][_0x8322('0x113')](db['SmsQueue'],{});db['JscriptyProject'][_0x8322('0x108')](db[_0x8322('0x142')],{'foreignKey':_0x8322('0x1ca')});db[_0x8322('0x1cb')][_0x8322('0x108')](db[_0x8322('0x1c8')],{'foreignKey':_0x8322('0x1ca')});db[_0x8322('0x1cb')][_0x8322('0x108')](db[_0x8322('0xcd')],{'foreignKey':_0x8322('0x1ca')});db[_0x8322('0x1cc')][_0x8322('0x115')](db[_0x8322('0x102')],{'as':_0x8322('0x169'),'through':'user_has_square_projects'});db[_0x8322('0x11a')][_0x8322('0x115')](db[_0x8322('0x102')],{'as':'Agents','through':_0x8322('0x11b')});db[_0x8322('0x11a')][_0x8322('0x115')](db['VoiceQueue'],{'through':_0x8322('0x14d'),'as':_0x8322('0x123')});db['Team'][_0x8322('0x115')](db[_0x8322('0x3d')],{'through':_0x8322('0x162'),'as':_0x8322('0x126')});db[_0x8322('0x11a')]['belongsToMany'](db[_0x8322('0x67')],{'through':'team_has_chat_queues','as':_0x8322('0x127')});db['Team'][_0x8322('0x115')](db[_0x8322('0x4d')],{'through':'team_has_fax_queues','as':_0x8322('0x128')});db[_0x8322('0x11a')][_0x8322('0x115')](db[_0x8322('0x56')],{'through':'team_has_sms_queues','as':_0x8322('0x129')});db[_0x8322('0x11a')][_0x8322('0x115')](db[_0x8322('0x5d')],{'through':_0x8322('0x182'),'as':_0x8322('0x12a')});db[_0x8322('0x11a')][_0x8322('0x115')](db[_0x8322('0xfc')],{'through':_0x8322('0x1cd'),'as':_0x8322('0x12b')});db['Team'][_0x8322('0x115')](db[_0x8322('0x1ce')],{'through':_0x8322('0xff'),'as':_0x8322('0x124')});db[_0x8322('0x193')][_0x8322('0x108')](db['CmHopper'],{'as':_0x8322('0x13f'),'foreignKey':_0x8322('0x194')});db[_0x8322('0x193')][_0x8322('0x108')](db[_0x8322('0x70')],{'as':_0x8322('0x140'),'foreignKey':_0x8322('0x194')});db['Campaign'][_0x8322('0x108')](db[_0x8322('0x71')],{'as':_0x8322('0x141'),'foreignKey':_0x8322('0x194')});db[_0x8322('0x193')][_0x8322('0x108')](db[_0x8322('0x6e')],{'as':_0x8322('0x1cf'),'foreignKey':_0x8322('0x194')});db['Campaign']['belongsTo'](db[_0x8322('0x144')],{'as':_0x8322('0x144'),'foreignKey':'TrunkId'});db[_0x8322('0x193')][_0x8322('0x113')](db['Trunk'],{'as':'TrunkBackup','foreignKey':_0x8322('0x1d0')});db['Campaign'][_0x8322('0x113')](db[_0x8322('0x7f')],{'as':_0x8322('0x7f'),'foreignKey':_0x8322('0x147')});db[_0x8322('0x193')][_0x8322('0x113')](db[_0x8322('0x1cc')],{'as':_0x8322('0x1cc'),'foreignKey':'SquareProjectId'});db['Campaign']['belongsToMany'](db[_0x8322('0xeb')],{'as':_0x8322('0x14a'),'through':_0x8322('0x1d1')});db[_0x8322('0x193')][_0x8322('0x115')](db['CmList'],{'as':_0x8322('0x1d2'),'through':_0x8322('0x1d3')});db[_0x8322('0xe0')][_0x8322('0x113')](db[_0x8322('0x65')],{'as':_0x8322('0x65'),'foreignKey':'ChatOfflineMessageId'});db[_0x8322('0xe3')][_0x8322('0x113')](db[_0x8322('0x43')],{});db[_0x8322('0xe3')]['belongsTo'](db[_0x8322('0x41')],{});db['MailTransferReport'][_0x8322('0x113')](db['MailAccount'],{'foreignKey':_0x8322('0x1d4'),'as':_0x8322('0x1d5')});db[_0x8322('0xe3')][_0x8322('0x113')](db['User'],{'foreignKey':'FromUserId','as':_0x8322('0x1d6')});db['MailTransferReport'][_0x8322('0x113')](db[_0x8322('0x102')],{'foreignKey':'ToUserId','as':_0x8322('0x1d7')});db['MailTransferReport'][_0x8322('0x113')](db['MailQueue'],{'foreignKey':_0x8322('0x1d8'),'as':_0x8322('0x1d9')});db[_0x8322('0xe3')]['belongsTo'](db[_0x8322('0x3b')],{'foreignKey':_0x8322('0x1da'),'as':_0x8322('0x1db')});db['ChatTransferReport'][_0x8322('0x113')](db[_0x8322('0x184')],{});db[_0x8322('0xe5')][_0x8322('0x113')](db[_0x8322('0x10e')],{});db[_0x8322('0xe5')][_0x8322('0x113')](db[_0x8322('0x5f')],{'foreignKey':'FromChatWebsiteId','as':_0x8322('0x1d5')});db[_0x8322('0xe5')][_0x8322('0x113')](db[_0x8322('0x102')],{'foreignKey':_0x8322('0x1dc'),'as':_0x8322('0x1d6')});db[_0x8322('0xe5')][_0x8322('0x113')](db[_0x8322('0x102')],{'foreignKey':_0x8322('0x1dd'),'as':_0x8322('0x1d7')});db[_0x8322('0xe5')][_0x8322('0x113')](db['ChatQueue'],{'foreignKey':_0x8322('0x1de'),'as':'ToQueue'});db[_0x8322('0xe5')][_0x8322('0x113')](db['ChatWebsite'],{'foreignKey':_0x8322('0x1df'),'as':'ToAccount'});db['FaxTransferReport'][_0x8322('0x113')](db[_0x8322('0x4b')],{});db[_0x8322('0x1e0')][_0x8322('0x113')](db[_0x8322('0x4a')],{});db[_0x8322('0x1e0')][_0x8322('0x113')](db['FaxAccount'],{'foreignKey':_0x8322('0x1e1'),'as':'FromAccount'});db['FaxTransferReport']['belongsTo'](db[_0x8322('0x102')],{'foreignKey':'FromUserId','as':_0x8322('0x1d6')});db['FaxTransferReport'][_0x8322('0x113')](db[_0x8322('0x102')],{'foreignKey':_0x8322('0x1dd'),'as':'ToAgent'});db['FaxTransferReport']['belongsTo'](db[_0x8322('0x4d')],{'foreignKey':_0x8322('0x1e2'),'as':_0x8322('0x1d9')});db[_0x8322('0x1e0')]['belongsTo'](db[_0x8322('0x48')],{'foreignKey':'ToFaxAccountId','as':'ToAccount'});db[_0x8322('0xe8')][_0x8322('0x113')](db[_0x8322('0x5c')],{});db[_0x8322('0xe8')][_0x8322('0x113')](db[_0x8322('0x5b')],{});db[_0x8322('0xe8')][_0x8322('0x113')](db['OpenchannelAccount'],{'foreignKey':_0x8322('0x1e3'),'as':_0x8322('0x1d5')});db[_0x8322('0xe8')][_0x8322('0x113')](db[_0x8322('0x102')],{'foreignKey':_0x8322('0x1dc'),'as':'FromAgent'});db['OpenchannelTransferReport'][_0x8322('0x113')](db['User'],{'foreignKey':_0x8322('0x1dd'),'as':_0x8322('0x1d7')});db[_0x8322('0xe8')]['belongsTo'](db[_0x8322('0x5d')],{'foreignKey':_0x8322('0x1e4'),'as':_0x8322('0x1d9')});db[_0x8322('0xe8')][_0x8322('0x113')](db[_0x8322('0x57')],{'foreignKey':_0x8322('0x1e5'),'as':_0x8322('0x1db')});db[_0x8322('0xe9')]['belongsTo'](db[_0x8322('0x54')],{});db['SmsTransferReport'][_0x8322('0x113')](db['SmsInteraction'],{});db[_0x8322('0xe9')][_0x8322('0x113')](db[_0x8322('0x50')],{'foreignKey':_0x8322('0x1e6'),'as':_0x8322('0x1d5')});db[_0x8322('0xe9')][_0x8322('0x113')](db[_0x8322('0x102')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x8322('0xe9')][_0x8322('0x113')](db[_0x8322('0x102')],{'foreignKey':_0x8322('0x1dd'),'as':_0x8322('0x1d7')});db[_0x8322('0xe9')][_0x8322('0x113')](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x8322('0x1d9')});db[_0x8322('0xe9')]['belongsTo'](db['SmsAccount'],{'foreignKey':_0x8322('0x1e7'),'as':_0x8322('0x1db')});db[_0x8322('0xeb')][_0x8322('0x108')](db['Disposition'],{'as':_0x8322('0x170'),'foreignKey':_0x8322('0x15f'),'onDelete':_0x8322('0x104')});db['CmList'][_0x8322('0x108')](db[_0x8322('0x74')],{'as':'CustomFields','foreignKey':_0x8322('0x15f')});db[_0x8322('0xeb')]['hasMany'](db[_0x8322('0x117')],{'as':_0x8322('0x18f'),'onDelete':_0x8322('0x104'),'foreignKey':_0x8322('0x15f')});db[_0x8322('0xeb')][_0x8322('0x108')](db[_0x8322('0x70')],{'as':_0x8322('0x140'),'foreignKey':_0x8322('0x15f')});db[_0x8322('0xeb')][_0x8322('0x108')](db[_0x8322('0x71')],{'as':'HopperHistory','foreignKey':'ListId'});db[_0x8322('0xeb')][_0x8322('0x108')](db[_0x8322('0x73')],{'as':_0x8322('0x73'),'foreignKey':'ListId'});db['CmList']['belongsToMany'](db[_0x8322('0x1a')],{'as':'Queues','through':_0x8322('0x14b')});db[_0x8322('0xeb')][_0x8322('0x115')](db[_0x8322('0x102')],{'as':_0x8322('0x14c'),'through':_0x8322('0x119')});db[_0x8322('0x1ce')][_0x8322('0x108')](db[_0x8322('0x16')],{'as':_0x8322('0x10b'),'onDelete':_0x8322('0x104')});db[_0x8322('0x1ce')]['belongsToMany'](db[_0x8322('0x102')],{'as':_0x8322('0x14c'),'through':'UserVoicePrefix'});db[_0x8322('0x1ce')][_0x8322('0x115')](db['Team'],{'through':'TeamVoicePrefix','as':_0x8322('0x17d')});db[_0x8322('0xee')][_0x8322('0x108')](db[_0x8322('0x102')],{'as':_0x8322('0x169'),'foreignKey':_0x8322('0x114')});db[_0x8322('0xee')][_0x8322('0x108')](db[_0x8322('0x1e8')],{'as':'UserProfileSections','foreignKey':_0x8322('0x114'),'onDelete':_0x8322('0x104')});db[_0x8322('0x1e8')][_0x8322('0x108')](db[_0x8322('0xf0')],{'as':_0x8322('0x1e9'),'foreignKey':'sectionId','onDelete':_0x8322('0x104')});db['WhatsappAccount']['hasMany'](db[_0x8322('0x7b')],{'as':'Dispositions','foreignKey':_0x8322('0x1ea'),'onDelete':_0x8322('0x104')});db[_0x8322('0xf4')]['hasMany'](db[_0x8322('0x15c')],{'as':_0x8322('0x15d'),'foreignKey':'WhatsappAccountId'});db[_0x8322('0xf4')][_0x8322('0x108')](db[_0x8322('0xf8')],{'as':'Messages','foreignKey':_0x8322('0x1ea')});db[_0x8322('0xf4')]['hasMany'](db['WhatsappInteraction'],{'as':_0x8322('0x15e')});db['WhatsappAccount'][_0x8322('0x108')](db['WhatsappApplication'],{'as':'Applications'});db[_0x8322('0xf4')][_0x8322('0x113')](db[_0x8322('0xeb')],{'as':_0x8322('0x16e'),'foreignKey':'ListId'});db[_0x8322('0xf4')][_0x8322('0x113')](db[_0x8322('0x81')],{'as':_0x8322('0x148'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x8322('0xf4')][_0x8322('0x115')](db[_0x8322('0x102')],{'as':_0x8322('0x14c'),'through':_0x8322('0x135')});db[_0x8322('0x1eb')][_0x8322('0x113')](db[_0x8322('0x102')],{'onDelete':_0x8322('0x156')});db[_0x8322('0x1eb')][_0x8322('0x113')](db[_0x8322('0xfc')],{'onDelete':'restrict'});db['WhatsappApplication'][_0x8322('0x113')](db[_0x8322('0xf4')],{'onDelete':_0x8322('0x156')});db[_0x8322('0x1eb')][_0x8322('0x113')](db[_0x8322('0x7f')],{'onDelete':'restrict','foreignKey':_0x8322('0x147')});db[_0x8322('0x1eb')][_0x8322('0x113')](db['Tag'],{'onDelete':_0x8322('0x156'),'foreignKey':_0x8322('0x173')});db[_0x8322('0xf6')][_0x8322('0x108')](db['WhatsappMessage'],{'as':_0x8322('0x14f'),'onDelete':'cascade','foreignKey':_0x8322('0x1ec')});db[_0x8322('0xf6')]['belongsTo'](db['WhatsappAccount'],{'as':_0x8322('0x164'),'foreignKey':_0x8322('0x1ea')});db[_0x8322('0xf6')][_0x8322('0x113')](db[_0x8322('0x117')],{'as':_0x8322('0x165'),'foreignKey':_0x8322('0x155')});db[_0x8322('0xf6')][_0x8322('0x113')](db[_0x8322('0x102')],{'as':_0x8322('0x166'),'foreignKey':'UserId'});db[_0x8322('0xf6')]['belongsToMany'](db[_0x8322('0x89')],{'through':_0x8322('0x1a5'),'as':_0x8322('0x18a')});db[_0x8322('0xf6')][_0x8322('0x115')](db['Tag'],{'through':_0x8322('0x1a5'),'as':_0x8322('0x168')});db['WhatsappInteraction'][_0x8322('0x115')](db[_0x8322('0x102')],{'as':'Users','through':_0x8322('0x1ed'),'foreignKey':_0x8322('0x1ec')});db['WhatsappMessage'][_0x8322('0x113')](db[_0x8322('0x102')],{'as':_0x8322('0x102')});db[_0x8322('0xf8')][_0x8322('0x113')](db['CmContact'],{'onDelete':_0x8322('0x104'),'as':_0x8322('0x165')});db[_0x8322('0xf8')][_0x8322('0x113')](db[_0x8322('0xf6')],{'onDelete':_0x8322('0x104'),'as':_0x8322('0x16b'),'foreignKey':'WhatsappInteractionId'});db[_0x8322('0xf8')][_0x8322('0x113')](db[_0x8322('0xf4')],{'as':_0x8322('0x164'),'foreignKey':'WhatsappAccountId'});db[_0x8322('0xf9')]['belongsTo'](db[_0x8322('0xf4')],{});db[_0x8322('0xf9')]['belongsTo'](db[_0x8322('0xeb')],{'as':_0x8322('0x16e'),'foreignKey':_0x8322('0x15f')});db[_0x8322('0xf9')][_0x8322('0x113')](db[_0x8322('0x117')],{'as':_0x8322('0x165'),'foreignKey':'ContactId'});db[_0x8322('0xf9')][_0x8322('0x113')](db[_0x8322('0xf6')],{});db[_0x8322('0xf9')]['belongsTo'](db[_0x8322('0xfc')],{});db[_0x8322('0xf9')][_0x8322('0x113')](db['WhatsappMessage'],{});db[_0x8322('0xf9')]['belongsTo'](db[_0x8322('0x102')],{});db[_0x8322('0xfb')][_0x8322('0x113')](db[_0x8322('0xf8')],{});db[_0x8322('0xfb')][_0x8322('0x113')](db[_0x8322('0xf6')],{});db['WhatsappTransferReport'][_0x8322('0x113')](db[_0x8322('0xf4')],{'foreignKey':_0x8322('0x1ee'),'as':_0x8322('0x1d5')});db[_0x8322('0xfb')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':'ToWhatsappAccountId','as':_0x8322('0x1db')});db[_0x8322('0xfb')][_0x8322('0x113')](db[_0x8322('0xfc')],{'foreignKey':'ToQueueId','as':_0x8322('0x1d9')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x8322('0x1dc'),'as':_0x8322('0x1d6')});db[_0x8322('0xfb')][_0x8322('0x113')](db[_0x8322('0x102')],{'foreignKey':_0x8322('0x1dd'),'as':_0x8322('0x1d7')});db[_0x8322('0xfc')][_0x8322('0x115')](db[_0x8322('0x102')],{'as':_0x8322('0x14c'),'through':_0x8322('0x37'),'foreignKey':_0x8322('0x1ef')});db[_0x8322('0xfc')][_0x8322('0x115')](db[_0x8322('0x11a')],{'through':_0x8322('0x1cd'),'as':_0x8322('0x17d')});db[_0x8322('0x106')][_0x8322('0x113')](db[_0x8322('0x102')],{'as':_0x8322('0x1f0'),'foreignKey':'UserId','onDelete':_0x8322('0x104'),'hooks':!![]});db[_0x8322('0xfe')][_0x8322('0x103')](db[_0x8322('0xbd')],{'as':_0x8322('0xbd'),'onDelete':_0x8322('0x156')});db[_0x8322('0xfe')][_0x8322('0x103')](db['MailServerIn'],{'as':_0x8322('0x15a'),'onDelete':_0x8322('0x156')});db[_0x8322('0xfe')][_0x8322('0x103')](db['MailServerOut'],{'as':'Smtp','onDelete':_0x8322('0x156')});module[_0x8322('0x1f1')]={'db':db,'dbH':dbH};
\ No newline at end of file
+var _0xd947=['../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','../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','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','SquareReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareProject/squareProject.model','SquareRecording','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','UserProfileResource','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','UserSetting','../api/user-setting/user-setting.model','hasOne','cascade','userSetting','hasMany','UserId','VoiceQueuesRt','VoiceExtension','Extensions','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteraction','MailInteractions','WhatsappInteractions','UserNotification','UserNotifications','SenderId','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefix','VoicePrefixes','MailQueues','UserMailQueue','ChatQueues','FaxQueues','WhatsappQueue','WhatsappQueues','CmList','ChatWebsites','user_has_chat_websites','FaxAccount','FaxAccounts','MailAccounts','user_has_mail_accounts','OpenchannelAccount','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','VoiceContext','Applications','VoiceMusicOnHold','moh_has_sounds','UserVoiceQueueRt','Members','VoiceQueueId','HopperHistories','JscriptySessions','Trunk','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','VoiceMailMessage','Messages','mailboxuser','mailbox','QueueCalls','VoiceAgentReport','AgentReports','uniqueid','CmContact','Contact','ContactId','MailAccountId','CloudProviderId','restrict','Imap','Dispositions','Interactions','List','ListId','TemplateId','Team','team_has_mail_queues','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','Interaction','ChatOfflineMessage','Items','FaxAccountId','Answers','Exntensions','user_has_fax_accounts','FaxInteractionId','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','TagId','sms_interaction_has_tags','SmsInteractionId','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelApplication','openchannel_interaction_has_tags','OpenchannelInteractionId','OpenchannelQueueId','ChatWebsiteId','ProactiveActions','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','ChatOfflineMessageId','team_has_chat_queues','ChatInternalMessage','ChatGroupId','CompanyId','Company','cm_contact_has_tags','CampaignId','OwnerId','Condition','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Automation','Actions','AutomationId','ParentId','FaxApplications','SmsApplications','Schedule','DefaultReportId','AnalyticCustomReport','CustomReportId','Mohs','whatsapp_interaction_has_tags','AllConditions','AnyConditions','TriggerAnyId','TriggerId','Fields','MetricId','Configurations','SubjectId','Descriptions','FieldId','Subject','Description','DescriptionId','Field','VariableId','AccountId','SugarcrmField','Subjects','DeskField','DeskAccount','int_desk_configuration_has_tags','ZendeskField','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','Dynamics365Field','FreshsalesField','ChatQueueReport','FromId','ToId','SessionId','JscriptyQuestionReport','ProjectId','SquareProject','team_has_openchannel_queues','OpenchannelQueues','HopperBlacks','TrunkId','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToMailQueueId','ToQueue','ChatTransferReport','ToAgent','ToChatQueueId','ToAccount','FromFaxAccountId','ToFaxQueueId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','team_has_whatsapp_queues','user','Smtp','exports','../config/environment','sequelize','lodash','determine','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','database','username','options','password','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserFaxQueue','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','UserWhatsappQueue','MailServerIn','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','SmsMessage','SmsQueue','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','../api/condition/condition.model','Interval','Pause','../api/pause/pause.model','Cdr','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount'];(function(_0x3f41de,_0x34c61a){var _0x11ee01=function(_0x23adc9){while(--_0x23adc9){_0x3f41de['push'](_0x3f41de['shift']());}};_0x11ee01(++_0x34c61a);}(_0xd947,0x15f));var _0x7d94=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xd947[_0x126558];return _0x1f6d14;};'use strict';var config=require(_0x7d94('0x0'));var Sequelize=require(_0x7d94('0x1'));var _=require(_0x7d94('0x2'));var jstz=require('jstz');var timezone=jstz[_0x7d94('0x3')]();config['sequelize']=_[_0x7d94('0x4')](config[_0x7d94('0x1')],{'database':_0x7d94('0x5'),'username':_0x7d94('0x6'),'password':_0x7d94('0x7'),'options':{'host':_0x7d94('0x8'),'port':0xcea,'dialect':_0x7d94('0x9'),'dialectOptions':{'charset':_0x7d94('0xa')},'logging':![],'timezone':timezone[_0x7d94('0xb')](),'define':{'charset':_0x7d94('0xc'),'collate':_0x7d94('0xd')}}});config[_0x7d94('0xe')]=_[_0x7d94('0x4')](config[_0x7d94('0xe')],{'database':_0x7d94('0x5'),'username':_0x7d94('0x6'),'password':_0x7d94('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x7d94('0x9'),'dialectOptions':{'charset':_0x7d94('0xa')},'logging':![],'timezone':timezone[_0x7d94('0xb')](),'define':{'charset':_0x7d94('0xc'),'collate':_0x7d94('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x7d94('0x1')][_0x7d94('0xf')],config[_0x7d94('0x1')][_0x7d94('0x10')],config['sequelize']['password'],config['sequelize'][_0x7d94('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x7d94('0xe')][_0x7d94('0xf')],config['sequelizeHistory'][_0x7d94('0x10')],config[_0x7d94('0xe')][_0x7d94('0x12')],config[_0x7d94('0xe')][_0x7d94('0x11')])};db[_0x7d94('0x13')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x15'));db[_0x7d94('0x16')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x17'));db['VoiceContext']=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x18'));db['VoiceExtension']=db['sequelize'][_0x7d94('0x14')](_0x7d94('0x19'));db['VoiceMusicOnHold']=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x1a'));db[_0x7d94('0x1b')]=db[_0x7d94('0x1')]['import'](_0x7d94('0x1c'));db[_0x7d94('0x1d')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x1e'));db[_0x7d94('0x1f')]=db[_0x7d94('0x1')]['import'](_0x7d94('0x20'));db[_0x7d94('0x21')]=db[_0x7d94('0x1')][_0x7d94('0x14')]('../api/voiceMail/voiceMail.model');db['VoiceMailMessage']=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x22'));db[_0x7d94('0x23')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x24'));db[_0x7d94('0x25')]=db[_0x7d94('0x1')]['import'](_0x7d94('0x26'));db['VoiceAgentReport']=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x27'));db[_0x7d94('0x28')]=db['sequelize']['import'](_0x7d94('0x29'));db[_0x7d94('0x2a')]=db[_0x7d94('0x1')][_0x7d94('0x14')]('../api/memberReport/memberReport.model');db['Trunk']=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x2b'));db['VoiceTransferReport']=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x2c'));db['UserVoiceQueueRt']=db['sequelize']['import'](_0x7d94('0x2d'));db[_0x7d94('0x2e')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x2f'));db[_0x7d94('0x30')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x31'));db['UserMailQueue']=db['sequelize'][_0x7d94('0x14')]('../api/userMailQueue/userMailQueue.model');db[_0x7d94('0x32')]=db[_0x7d94('0x1')][_0x7d94('0x14')]('../api/userFaxQueue/userFaxQueue.model');db[_0x7d94('0x33')]=db['sequelize'][_0x7d94('0x14')](_0x7d94('0x34'));db[_0x7d94('0x35')]=db[_0x7d94('0x1')][_0x7d94('0x14')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0x7d94('0x36')]=db[_0x7d94('0x1')][_0x7d94('0x14')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0x7d94('0x37')]=db['sequelize'][_0x7d94('0x14')]('../api/mailServerIn/mailServerIn.model');db[_0x7d94('0x38')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x39'));db[_0x7d94('0x3a')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x3b'));db[_0x7d94('0x3c')]=db['sequelize'][_0x7d94('0x14')]('../api/mailQueue/mailQueue.model');db[_0x7d94('0x3d')]=db[_0x7d94('0x1')][_0x7d94('0x14')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x3e'));db[_0x7d94('0x3f')]=db['sequelize'][_0x7d94('0x14')](_0x7d94('0x40'));db[_0x7d94('0x41')]=db[_0x7d94('0x1')]['import'](_0x7d94('0x42'));db[_0x7d94('0x43')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x44'));db['Dashboard']=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x45'));db[_0x7d94('0x46')]=db[_0x7d94('0x1')]['import'](_0x7d94('0x47'));db['FaxAccount']=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x48'));db[_0x7d94('0x49')]=db['sequelize'][_0x7d94('0x14')](_0x7d94('0x4a'));db[_0x7d94('0x4b')]=db[_0x7d94('0x1')]['import']('../api/faxInteraction/faxInteraction.model');db[_0x7d94('0x4c')]=db['sequelize'][_0x7d94('0x14')](_0x7d94('0x4d'));db[_0x7d94('0x4e')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x4f'));db[_0x7d94('0x50')]=db['sequelize'][_0x7d94('0x14')](_0x7d94('0x51'));db[_0x7d94('0x52')]=db[_0x7d94('0x1')]['import'](_0x7d94('0x53'));db[_0x7d94('0x54')]=db[_0x7d94('0x1')]['import'](_0x7d94('0x55'));db[_0x7d94('0x56')]=db[_0x7d94('0x1')]['import']('../api/smsInteraction/smsInteraction.model');db[_0x7d94('0x57')]=db[_0x7d94('0x1')][_0x7d94('0x14')]('../api/smsMessage/smsMessage.model');db[_0x7d94('0x58')]=db[_0x7d94('0x1')]['import']('../api/smsQueue/smsQueue.model');db['OpenchannelAccount']=db[_0x7d94('0x1')][_0x7d94('0x14')]('../api/openchannelAccount/openchannelAccount.model');db['OpenchannelApplication']=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x59'));db[_0x7d94('0x5a')]=db['sequelize'][_0x7d94('0x14')](_0x7d94('0x5b'));db[_0x7d94('0x5c')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x5d'));db[_0x7d94('0x5e')]=db['sequelize'][_0x7d94('0x14')](_0x7d94('0x5f'));db[_0x7d94('0x60')]=db['sequelize'][_0x7d94('0x14')](_0x7d94('0x61'));db[_0x7d94('0x62')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x63'));db[_0x7d94('0x64')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x65'));db[_0x7d94('0x66')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x67'));db[_0x7d94('0x68')]=db[_0x7d94('0x1')]['import'](_0x7d94('0x69'));db['ChatOfflineMessage']=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x6a'));db[_0x7d94('0x6b')]=db['sequelize']['import'](_0x7d94('0x6c'));db[_0x7d94('0x6d')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x6e'));db[_0x7d94('0x6f')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x70'));db[_0x7d94('0x71')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x72'));db['CmContact']=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x73'));db[_0x7d94('0x74')]=db[_0x7d94('0x1')][_0x7d94('0x14')]('../api/cmHopper/cmHopper.model');db[_0x7d94('0x75')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x76'));db[_0x7d94('0x77')]=db[_0x7d94('0x1')]['import'](_0x7d94('0x78'));db[_0x7d94('0x79')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x7a'));db[_0x7d94('0x7b')]=db['sequelize'][_0x7d94('0x14')](_0x7d94('0x7c'));db[_0x7d94('0x7d')]=db[_0x7d94('0x1')]['import'](_0x7d94('0x7e'));db[_0x7d94('0x7f')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x80'));db['Automation']=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x81'));db[_0x7d94('0x82')]=db[_0x7d94('0x1')]['import'](_0x7d94('0x83'));db[_0x7d94('0x84')]=db[_0x7d94('0x1')]['import'](_0x7d94('0x85'));db['Condition']=db[_0x7d94('0x1')]['import'](_0x7d94('0x86'));db[_0x7d94('0x87')]=db[_0x7d94('0x1')][_0x7d94('0x14')]('../api/interval/interval.model');db[_0x7d94('0x88')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x89'));db[_0x7d94('0x8a')]=db[_0x7d94('0x1')]['import']('../api/cdr/cdr.model');db[_0x7d94('0x8b')]=db[_0x7d94('0x1')]['import'](_0x7d94('0x8c'));db['Schedule']=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x8d'));db[_0x7d94('0x8e')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x8f'));db[_0x7d94('0x90')]=db['sequelize'][_0x7d94('0x14')](_0x7d94('0x91'));db[_0x7d94('0x92')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x93'));db[_0x7d94('0x94')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x95'));db[_0x7d94('0x96')]=db['sequelize']['import'](_0x7d94('0x97'));db[_0x7d94('0x98')]=db['sequelize']['import'](_0x7d94('0x99'));db['IntegrationReport']=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x9a'));db['AnalyticCustomReport']=db[_0x7d94('0x1')]['import'](_0x7d94('0x9b'));db[_0x7d94('0x9c')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x9d'));db[_0x7d94('0x9e')]=db[_0x7d94('0x1')]['import'](_0x7d94('0x9f'));db[_0x7d94('0xa0')]=db[_0x7d94('0x1')]['import'](_0x7d94('0xa1'));db[_0x7d94('0xa2')]=db['sequelize'][_0x7d94('0x14')](_0x7d94('0xa3'));db[_0x7d94('0xa4')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0xa5'));db[_0x7d94('0xa6')]=db[_0x7d94('0x1')][_0x7d94('0x14')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0x7d94('0xa7')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0xa8'));db[_0x7d94('0xa9')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0xaa'));db[_0x7d94('0xab')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0xac'));db[_0x7d94('0xad')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0xae'));db['SugarcrmField']=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0xaf'));db['DeskAccount']=db['sequelize'][_0x7d94('0x14')]('../api/intDeskAccount/intDeskAccount.model');db[_0x7d94('0xb0')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0xb1'));db['DeskField']=db['sequelize'][_0x7d94('0x14')](_0x7d94('0xb2'));db[_0x7d94('0xb3')]=db['sequelize'][_0x7d94('0x14')](_0x7d94('0xb4'));db[_0x7d94('0xb5')]=db[_0x7d94('0x1')]['import'](_0x7d94('0xb6'));db[_0x7d94('0xb7')]=db['sequelize'][_0x7d94('0x14')](_0x7d94('0xb8'));db[_0x7d94('0xb9')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0xba'));db[_0x7d94('0xbb')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0xbc'));db['ZendeskField']=db[_0x7d94('0x1')]['import'](_0x7d94('0xbd'));db[_0x7d94('0xbe')]=db['sequelize'][_0x7d94('0x14')](_0x7d94('0xbf'));db[_0x7d94('0xc0')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0xc1'));db[_0x7d94('0xc2')]=db[_0x7d94('0x1')]['import'](_0x7d94('0xc3'));db[_0x7d94('0xc4')]=db[_0x7d94('0x1')]['import'](_0x7d94('0xc5'));db[_0x7d94('0xc6')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0xc7'));db[_0x7d94('0xc8')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0xc9'));db[_0x7d94('0xca')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0xcb'));db[_0x7d94('0xcc')]=db[_0x7d94('0x1')]['import'](_0x7d94('0xcd'));db[_0x7d94('0xce')]=db[_0x7d94('0x1')]['import'](_0x7d94('0xcf'));db[_0x7d94('0xd0')]=db[_0x7d94('0x1')][_0x7d94('0x14')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x7d94('0xd1')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0xd2'));db['Dynamics365Field']=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0xd3'));db[_0x7d94('0xd4')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0xd5'));db[_0x7d94('0xd6')]=db['sequelize'][_0x7d94('0x14')](_0x7d94('0xd7'));db['FreshsalesField']=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0xd8'));db[_0x7d94('0x98')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x99'));db[_0x7d94('0xd9')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0xda'));db['ChatQueueReport']=db['sequelize'][_0x7d94('0x14')](_0x7d94('0xdb'));db['ChatInternalMessage']=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0xdc'));db[_0x7d94('0xdd')]=db[_0x7d94('0x1')][_0x7d94('0x14')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db['JscriptyQuestionReport']=db[_0x7d94('0x1')][_0x7d94('0x14')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0x7d94('0xde')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0xdf'));db[_0x7d94('0xe0')]=db[_0x7d94('0x1')][_0x7d94('0x14')]('../api/smsQueueReport/smsQueueReport.model');db[_0x7d94('0xe1')]=db[_0x7d94('0x1')]['import']('../api/squareReport/squareReport.model');db[_0x7d94('0xe2')]=db['sequelize'][_0x7d94('0x14')](_0x7d94('0xe3'));db[_0x7d94('0xe4')]=db['sequelize'][_0x7d94('0x14')](_0x7d94('0xe5'));db[_0x7d94('0xe6')]=db['sequelize'][_0x7d94('0x14')](_0x7d94('0xe7'));db[_0x7d94('0xe8')]=db[_0x7d94('0x1')]['import']('../api/squareOdbc/squareOdbc.model');db['SquareProject']=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0xe9'));db[_0x7d94('0xea')]=db[_0x7d94('0x1')]['import']('../api/squareRecording/squareRecording.model');db['SquareMessage']=db['sequelize'][_0x7d94('0x14')]('../api/squareMessage/squareMessage.model');db['Team']=db[_0x7d94('0x1')]['import'](_0x7d94('0xeb'));db[_0x7d94('0xec')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0xed'));db[_0x7d94('0xee')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0xef'));db[_0x7d94('0xf0')]=db[_0x7d94('0x1')]['import'](_0x7d94('0xf1'));db[_0x7d94('0xf2')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0xf3'));db[_0x7d94('0xf4')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0xf5'));db[_0x7d94('0xf6')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0xf7'));db['ChatTransferReport']=db[_0x7d94('0x1')][_0x7d94('0x14')]('../api/chatTransferReport/chatTransferReport.model');db[_0x7d94('0xf8')]=db[_0x7d94('0x1')]['import'](_0x7d94('0xf9'));db[_0x7d94('0xfa')]=db['sequelize']['import'](_0x7d94('0xfb'));db[_0x7d94('0xfc')]=db['sequelize'][_0x7d94('0x14')](_0x7d94('0xfd'));db['CmList']=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0xfe'));db['VoicePrefix']=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0xff'));db[_0x7d94('0x100')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x101'));db[_0x7d94('0x102')]=db[_0x7d94('0x1')][_0x7d94('0x14')]('../api/userProfileSection/userProfileSection.model');db[_0x7d94('0x103')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x104'));db['UserNotification']=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x105'));db[_0x7d94('0x106')]=db[_0x7d94('0x1')][_0x7d94('0x14')]('../api/whatsappAccount/whatsappAccount.model');db['WhatsappApplication']=db['sequelize'][_0x7d94('0x14')](_0x7d94('0x107'));db[_0x7d94('0x108')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x109'));db[_0x7d94('0x10a')]=db['sequelize'][_0x7d94('0x14')](_0x7d94('0x10b'));db[_0x7d94('0x10c')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x10d'));db[_0x7d94('0x10e')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x10f'));db['WhatsappQueue']=db[_0x7d94('0x1')]['import'](_0x7d94('0x110'));db[_0x7d94('0x111')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x112'));db[_0x7d94('0x113')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x114'));db[_0x7d94('0x115')]=db['sequelize'][_0x7d94('0x14')](_0x7d94('0x116'));db[_0x7d94('0x117')]=db[_0x7d94('0x1')][_0x7d94('0x14')]('../api/userVoicePrefix/userVoicePrefix.model');db[_0x7d94('0x118')]=db[_0x7d94('0x1')][_0x7d94('0x14')](_0x7d94('0x119'));db['User'][_0x7d94('0x11a')](db[_0x7d94('0x21')],{'as':_0x7d94('0x21'),'onDelete':_0x7d94('0x11b'),'foreignKey':'UserId'});db[_0x7d94('0x13')][_0x7d94('0x11a')](db[_0x7d94('0x118')],{'as':_0x7d94('0x11c'),'onDelete':'cascade','foreignKey':'UserId'});db[_0x7d94('0x13')][_0x7d94('0x11d')](db[_0x7d94('0x1d')],{'as':'Recordings','foreignKey':_0x7d94('0x11e')});db[_0x7d94('0x13')][_0x7d94('0x11d')](db['UserVoiceQueueRt'],{'as':_0x7d94('0x11f'),'foreignKey':_0x7d94('0x11e')});db[_0x7d94('0x13')][_0x7d94('0x11d')](db[_0x7d94('0x120')],{'as':_0x7d94('0x121'),'onDelete':_0x7d94('0x11b'),'hooks':!![]});db[_0x7d94('0x13')][_0x7d94('0x11d')](db[_0x7d94('0x77')],{'as':_0x7d94('0x122'),'foreignKey':_0x7d94('0x11e')});db[_0x7d94('0x13')][_0x7d94('0x11d')](db['CmHopperHistory'],{'as':_0x7d94('0x123'),'foreignKey':_0x7d94('0x11e')});db[_0x7d94('0x13')][_0x7d94('0x11d')](db[_0x7d94('0x7b')],{'as':_0x7d94('0x7b'),'foreignKey':_0x7d94('0x11e')});db['User'][_0x7d94('0x11d')](db[_0x7d94('0x5a')],{'as':_0x7d94('0x124'),'foreignKey':_0x7d94('0x11e')});db[_0x7d94('0x13')][_0x7d94('0x11d')](db[_0x7d94('0x66')],{'as':_0x7d94('0x125'),'foreignKey':_0x7d94('0x11e')});db[_0x7d94('0x13')][_0x7d94('0x11d')](db['SmsInteraction'],{'as':_0x7d94('0x126'),'foreignKey':'UserId'});db[_0x7d94('0x13')][_0x7d94('0x11d')](db[_0x7d94('0x4b')],{'as':_0x7d94('0x127'),'foreignKey':_0x7d94('0x11e')});db['User']['hasMany'](db[_0x7d94('0x128')],{'as':_0x7d94('0x129'),'foreignKey':_0x7d94('0x11e')});db[_0x7d94('0x13')][_0x7d94('0x11d')](db[_0x7d94('0x108')],{'as':_0x7d94('0x12a'),'foreignKey':_0x7d94('0x11e')});db[_0x7d94('0x13')][_0x7d94('0x11d')](db[_0x7d94('0x12b')],{'as':_0x7d94('0x12c'),'foreignKey':_0x7d94('0x12d')});db[_0x7d94('0x13')][_0x7d94('0x12e')](db[_0x7d94('0x100')],{'as':_0x7d94('0x100'),'foreignKey':_0x7d94('0x12f')});db['User'][_0x7d94('0x130')](db[_0x7d94('0x6d')],{'as':_0x7d94('0x131'),'through':_0x7d94('0x132')});db['User']['belongsToMany'](db['CmContact'],{'as':_0x7d94('0x133'),'through':_0x7d94('0x134')});db[_0x7d94('0x13')][_0x7d94('0x130')](db['CmList'],{'as':_0x7d94('0x135'),'through':_0x7d94('0x136')});db['User'][_0x7d94('0x130')](db['Team'],{'through':'user_has_teams'});db['User'][_0x7d94('0x130')](db[_0x7d94('0x128')],{'as':_0x7d94('0x129'),'through':_0x7d94('0x137')});db[_0x7d94('0x13')]['belongsToMany'](db[_0x7d94('0x66')],{'as':'ChatInteractions','through':_0x7d94('0x138')});db['User'][_0x7d94('0x130')](db['FaxInteraction'],{'as':_0x7d94('0x127'),'through':_0x7d94('0x139')});db['User'][_0x7d94('0x130')](db[_0x7d94('0x56')],{'as':_0x7d94('0x126'),'through':_0x7d94('0x13a')});db[_0x7d94('0x13')]['belongsToMany'](db[_0x7d94('0x5a')],{'as':_0x7d94('0x124'),'through':_0x7d94('0x13b')});db[_0x7d94('0x13')][_0x7d94('0x130')](db['WhatsappInteraction'],{'as':_0x7d94('0x12a'),'through':_0x7d94('0x13c')});db[_0x7d94('0x13')][_0x7d94('0x130')](db[_0x7d94('0x1b')],{'as':_0x7d94('0x13d'),'through':'UserVoiceQueue','required':![]});db[_0x7d94('0x13')][_0x7d94('0x130')](db[_0x7d94('0x13e')],{'as':_0x7d94('0x13f'),'through':_0x7d94('0x117'),'required':![]});db[_0x7d94('0x13')][_0x7d94('0x130')](db[_0x7d94('0x3c')],{'as':_0x7d94('0x140'),'through':_0x7d94('0x141'),'required':![]});db[_0x7d94('0x13')][_0x7d94('0x130')](db['ChatQueue'],{'as':_0x7d94('0x142'),'through':_0x7d94('0x30'),'required':![],'hooks':!![]});db['User'][_0x7d94('0x130')](db[_0x7d94('0x4e')],{'as':_0x7d94('0x143'),'through':_0x7d94('0x32'),'required':![]});db[_0x7d94('0x13')][_0x7d94('0x130')](db[_0x7d94('0x58')],{'as':'SmsQueues','through':'UserSmsQueue','required':![]});db[_0x7d94('0x13')][_0x7d94('0x130')](db['OpenchannelQueue'],{'as':'OpenchannelQueues','through':_0x7d94('0x35'),'required':![]});db[_0x7d94('0x13')]['belongsToMany'](db[_0x7d94('0x144')],{'as':_0x7d94('0x145'),'through':_0x7d94('0x36'),'required':![]});db['User'][_0x7d94('0x130')](db[_0x7d94('0x146')],{'through':_0x7d94('0x136')});db[_0x7d94('0x13')][_0x7d94('0x130')](db[_0x7d94('0x60')],{'as':_0x7d94('0x147'),'through':_0x7d94('0x148')});db[_0x7d94('0x13')]['belongsToMany'](db[_0x7d94('0x149')],{'as':_0x7d94('0x14a'),'through':'user_has_fax_accounts'});db['User'][_0x7d94('0x130')](db[_0x7d94('0x3a')],{'as':_0x7d94('0x14b'),'through':_0x7d94('0x14c')});db['User'][_0x7d94('0x130')](db[_0x7d94('0x14d')],{'as':_0x7d94('0x14e'),'through':_0x7d94('0x14f')});db[_0x7d94('0x13')][_0x7d94('0x130')](db[_0x7d94('0x52')],{'as':_0x7d94('0x150'),'through':_0x7d94('0x151')});db['User'][_0x7d94('0x130')](db[_0x7d94('0x106')],{'as':_0x7d94('0x152'),'through':_0x7d94('0x153')});db[_0x7d94('0x13')][_0x7d94('0x130')](db['SquareProject'],{'as':_0x7d94('0x154'),'through':_0x7d94('0x155')});db['VoiceChanSpy'][_0x7d94('0x11d')](db['VoiceExtension'],{'as':_0x7d94('0x156'),'onDelete':_0x7d94('0x11b'),'foreignKey':'ChanSpyId'});db[_0x7d94('0x157')][_0x7d94('0x11d')](db[_0x7d94('0x120')],{'onDelete':_0x7d94('0x11b')});db[_0x7d94('0x120')][_0x7d94('0x11d')](db[_0x7d94('0x120')],{'as':_0x7d94('0x158'),'onDelete':_0x7d94('0x11b')});db[_0x7d94('0x159')][_0x7d94('0x130')](db[_0x7d94('0x8e')],{'as':'Sounds','through':_0x7d94('0x15a')});db[_0x7d94('0x1b')]['hasMany'](db[_0x7d94('0x15b')],{'as':_0x7d94('0x15c'),'foreignKey':'VoiceQueueId'});db[_0x7d94('0x1b')][_0x7d94('0x11d')](db['CmHopper'],{'as':'Hoppers','foreignKey':'VoiceQueueId'});db[_0x7d94('0x1b')]['hasMany'](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x7d94('0x15d')});db['VoiceQueue']['hasMany'](db[_0x7d94('0x79')],{'as':_0x7d94('0x15e'),'foreignKey':'VoiceQueueId'});db[_0x7d94('0x1b')][_0x7d94('0x11d')](db[_0x7d94('0x7b')],{'as':_0x7d94('0x7b'),'foreignKey':'VoiceQueueId'});db[_0x7d94('0x1b')]['hasMany'](db[_0x7d94('0x75')],{'as':'HopperBlacks','foreignKey':_0x7d94('0x15d')});db[_0x7d94('0x1b')]['hasMany'](db[_0x7d94('0xde')],{'as':_0x7d94('0x15f'),'foreignKey':_0x7d94('0x15d')});db[_0x7d94('0x1b')][_0x7d94('0x12e')](db[_0x7d94('0x160')],{'as':'Trunk','foreignKey':'TrunkId'});db[_0x7d94('0x1b')]['belongsTo'](db[_0x7d94('0x160')],{'as':_0x7d94('0x161'),'foreignKey':_0x7d94('0x162')});db[_0x7d94('0x1b')][_0x7d94('0x12e')](db['Interval'],{'as':_0x7d94('0x87'),'foreignKey':_0x7d94('0x163')});db[_0x7d94('0x1b')][_0x7d94('0x12e')](db[_0x7d94('0x88')],{'as':_0x7d94('0x164'),'foreignKey':_0x7d94('0x165')});db[_0x7d94('0x1b')][_0x7d94('0x130')](db[_0x7d94('0x146')],{'as':_0x7d94('0x135'),'through':_0x7d94('0x166')});db[_0x7d94('0x1b')][_0x7d94('0x130')](db[_0x7d94('0x13')],{'as':_0x7d94('0x167'),'through':_0x7d94('0x2e')});db[_0x7d94('0x1b')]['belongsToMany'](db['Team'],{'as':_0x7d94('0x168'),'through':_0x7d94('0x113')});db['VoiceQueue'][_0x7d94('0x130')](db['CmList'],{'as':_0x7d94('0x169'),'through':_0x7d94('0x16a')});db[_0x7d94('0x1d')]['belongsTo'](db[_0x7d94('0x13')],{'as':_0x7d94('0x13'),'foreignKey':'UserId'});db[_0x7d94('0x1f')][_0x7d94('0x12e')](db['User'],{'as':_0x7d94('0x13'),'foreignKey':_0x7d94('0x11e')});db[_0x7d94('0x21')]['hasMany'](db[_0x7d94('0x16b')],{'as':_0x7d94('0x16c'),'onDelete':_0x7d94('0x11b'),'foreignKey':_0x7d94('0x16d'),'sourceKey':'mailbox'});db[_0x7d94('0x16b')][_0x7d94('0x12e')](db[_0x7d94('0x21')],{'foreignKey':'mailboxuser','targetKey':_0x7d94('0x16e')});db['VoiceCallReport']['hasMany'](db[_0x7d94('0x28')],{'as':_0x7d94('0x16f'),'foreignKey':'uniqueid','constraints':![]});db[_0x7d94('0x23')][_0x7d94('0x11d')](db[_0x7d94('0x170')],{'as':_0x7d94('0x171'),'foreignKey':_0x7d94('0x172'),'constraints':![]});db[_0x7d94('0x23')][_0x7d94('0x12e')](db[_0x7d94('0x13')],{'as':_0x7d94('0x13'),'foreignKey':_0x7d94('0x11e')});db[_0x7d94('0x23')][_0x7d94('0x12e')](db[_0x7d94('0x173')],{'as':_0x7d94('0x174'),'foreignKey':_0x7d94('0x175')});db[_0x7d94('0x37')][_0x7d94('0x12e')](db[_0x7d94('0x3a')],{'as':'MailAccount','foreignKey':_0x7d94('0x176')});db['MailServerIn'][_0x7d94('0x12e')](db[_0x7d94('0x111')],{'as':_0x7d94('0x111'),'foreignKey':_0x7d94('0x177'),'onDelete':_0x7d94('0x178')});db['MailServerOut'][_0x7d94('0x12e')](db[_0x7d94('0x3a')],{'as':_0x7d94('0x3a'),'foreignKey':_0x7d94('0x176')});db['MailServerOut'][_0x7d94('0x12e')](db[_0x7d94('0x111')],{'as':_0x7d94('0x111'),'foreignKey':_0x7d94('0x177'),'onDelete':'restrict'});db['MailAccount']['hasOne'](db[_0x7d94('0x37')],{'as':_0x7d94('0x179'),'onDelete':'cascade'});db[_0x7d94('0x3a')]['hasOne'](db[_0x7d94('0x38')],{'as':'Smtp','onDelete':'cascade'});db[_0x7d94('0x3a')]['hasMany'](db['Disposition'],{'as':_0x7d94('0x17a'),'foreignKey':_0x7d94('0x176'),'onDelete':_0x7d94('0x11b')});db[_0x7d94('0x3a')][_0x7d94('0x11d')](db[_0x7d94('0x82')],{'as':'Answers','foreignKey':_0x7d94('0x176')});db[_0x7d94('0x3a')][_0x7d94('0x11d')](db[_0x7d94('0x3f')],{'as':_0x7d94('0x16c'),'foreignKey':_0x7d94('0x176')});db['MailAccount'][_0x7d94('0x11d')](db[_0x7d94('0x128')],{'as':_0x7d94('0x17b')});db[_0x7d94('0x3a')][_0x7d94('0x11d')](db[_0x7d94('0x41')],{'as':_0x7d94('0x158')});db[_0x7d94('0x3a')][_0x7d94('0x12e')](db[_0x7d94('0x146')],{'as':_0x7d94('0x17c'),'foreignKey':_0x7d94('0x17d')});db['MailAccount'][_0x7d94('0x12e')](db[_0x7d94('0x92')],{'as':_0x7d94('0x92'),'foreignKey':_0x7d94('0x17e')});db[_0x7d94('0x3a')][_0x7d94('0x12e')](db[_0x7d94('0x88')],{'as':_0x7d94('0x164'),'foreignKey':_0x7d94('0x165')});db[_0x7d94('0x3a')][_0x7d94('0x130')](db[_0x7d94('0x13')],{'as':_0x7d94('0x167'),'through':_0x7d94('0x14c')});db['MailQueue']['belongsToMany'](db['User'],{'as':'Agents','through':_0x7d94('0x141')});db[_0x7d94('0x3c')][_0x7d94('0x130')](db[_0x7d94('0x17f')],{'through':_0x7d94('0x180'),'as':_0x7d94('0x168')});db[_0x7d94('0x128')]['hasMany'](db[_0x7d94('0x3f')],{'as':_0x7d94('0x16c'),'onDelete':_0x7d94('0x11b'),'foreignKey':_0x7d94('0x181')});db[_0x7d94('0x128')][_0x7d94('0x12e')](db[_0x7d94('0x3a')],{'as':_0x7d94('0x182'),'foreignKey':'MailAccountId'});db[_0x7d94('0x128')][_0x7d94('0x12e')](db['CmContact'],{'as':_0x7d94('0x174'),'foreignKey':_0x7d94('0x175')});db[_0x7d94('0x128')]['belongsTo'](db['User'],{'as':_0x7d94('0x183'),'foreignKey':_0x7d94('0x11e')});db[_0x7d94('0x128')][_0x7d94('0x130')](db[_0x7d94('0x90')],{'through':_0x7d94('0x184'),'as':_0x7d94('0x185')});db[_0x7d94('0x128')][_0x7d94('0x130')](db[_0x7d94('0x90')],{'through':_0x7d94('0x184'),'as':_0x7d94('0x186')});db['MailInteraction'][_0x7d94('0x130')](db[_0x7d94('0x13')],{'as':_0x7d94('0x187'),'through':'user_has_mail_interactions','foreignKey':_0x7d94('0x181')});db[_0x7d94('0x3f')][_0x7d94('0x11d')](db[_0x7d94('0xf2')],{'as':_0x7d94('0x188'),'onDelete':_0x7d94('0x11b')});db[_0x7d94('0x3f')][_0x7d94('0x12e')](db['User'],{'as':_0x7d94('0x13')});db[_0x7d94('0x3f')][_0x7d94('0x12e')](db[_0x7d94('0x173')],{'onDelete':'cascade','as':_0x7d94('0x174')});db['MailMessage'][_0x7d94('0x12e')](db[_0x7d94('0x128')],{'as':_0x7d94('0x189'),'foreignKey':_0x7d94('0x181')});db[_0x7d94('0x3f')]['belongsTo'](db[_0x7d94('0x3a')],{'as':_0x7d94('0x182'),'foreignKey':'MailAccountId'});db['MailMessage'][_0x7d94('0x12e')](db[_0x7d94('0x60')],{'as':'ChatWebsite','foreignKey':'ChatWebsiteId'});db[_0x7d94('0x3f')][_0x7d94('0x12e')](db[_0x7d94('0x18a')],{'as':'ChatOfflineMessage','foreignKey':'ChatOfflineMessageId'});db[_0x7d94('0x41')][_0x7d94('0x12e')](db['User'],{'onDelete':_0x7d94('0x178')});db['MailApplication'][_0x7d94('0x12e')](db[_0x7d94('0x3c')],{'onDelete':_0x7d94('0x178')});db[_0x7d94('0x41')][_0x7d94('0x12e')](db['MailAccount'],{'onDelete':_0x7d94('0x178')});db['MailApplication'][_0x7d94('0x12e')](db['Interval'],{'onDelete':'restrict','foreignKey':_0x7d94('0x163')});db[_0x7d94('0x41')][_0x7d94('0x12e')](db[_0x7d94('0x90')],{'onDelete':_0x7d94('0x178'),'foreignKey':'TagId'});db[_0x7d94('0x43')][_0x7d94('0x12e')](db['MailAccount'],{});db[_0x7d94('0x43')][_0x7d94('0x12e')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x7d94('0x43')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0x7d94('0x175')});db['MailQueueReport'][_0x7d94('0x12e')](db[_0x7d94('0x128')],{});db[_0x7d94('0x43')]['belongsTo'](db['MailMessage'],{});db[_0x7d94('0x43')][_0x7d94('0x12e')](db['User'],{});db[_0x7d94('0x43')]['belongsTo'](db[_0x7d94('0x3c')],{});db['Dashboard'][_0x7d94('0x11d')](db[_0x7d94('0x46')],{'as':_0x7d94('0x18b'),'onDelete':_0x7d94('0x11b')});db[_0x7d94('0x149')][_0x7d94('0x11d')](db[_0x7d94('0x84')],{'as':_0x7d94('0x17a'),'foreignKey':_0x7d94('0x18c'),'onDelete':_0x7d94('0x11b')});db[_0x7d94('0x149')]['hasMany'](db[_0x7d94('0x82')],{'as':_0x7d94('0x18d'),'foreignKey':'FaxAccountId'});db[_0x7d94('0x149')]['hasMany'](db[_0x7d94('0x4b')],{'as':_0x7d94('0x17b')});db[_0x7d94('0x149')][_0x7d94('0x11d')](db['FaxApplication'],{'as':_0x7d94('0x158')});db[_0x7d94('0x149')]['hasMany'](db[_0x7d94('0x120')],{'as':_0x7d94('0x18e'),'onDelete':_0x7d94('0x11b')});db[_0x7d94('0x149')][_0x7d94('0x11d')](db['FaxMessage'],{'as':'Messages'});db[_0x7d94('0x149')]['belongsTo'](db[_0x7d94('0x160')],{'as':'Trunk'});db[_0x7d94('0x149')]['belongsTo'](db[_0x7d94('0x146')],{'as':_0x7d94('0x17c'),'foreignKey':_0x7d94('0x17d')});db[_0x7d94('0x149')][_0x7d94('0x12e')](db['Pause'],{'as':_0x7d94('0x164'),'foreignKey':_0x7d94('0x165')});db['FaxAccount'][_0x7d94('0x130')](db['User'],{'as':'Agents','through':_0x7d94('0x18f')});db['FaxApplication']['belongsTo'](db['User'],{'onDelete':_0x7d94('0x178')});db[_0x7d94('0x49')][_0x7d94('0x12e')](db[_0x7d94('0x4e')],{'onDelete':_0x7d94('0x178')});db['FaxApplication'][_0x7d94('0x12e')](db['FaxAccount'],{'onDelete':_0x7d94('0x178')});db[_0x7d94('0x49')][_0x7d94('0x12e')](db['Tag'],{'onDelete':_0x7d94('0x178'),'foreignKey':'TagId'});db[_0x7d94('0x4b')]['hasMany'](db[_0x7d94('0x4c')],{'as':'Messages','onDelete':_0x7d94('0x11b'),'foreignKey':_0x7d94('0x190')});db[_0x7d94('0x4b')]['belongsTo'](db[_0x7d94('0x149')],{'as':_0x7d94('0x182'),'foreignKey':'FaxAccountId'});db['FaxInteraction'][_0x7d94('0x12e')](db[_0x7d94('0x173')],{'as':_0x7d94('0x174'),'foreignKey':'ContactId'});db[_0x7d94('0x4b')][_0x7d94('0x12e')](db[_0x7d94('0x13')],{'as':_0x7d94('0x183'),'foreignKey':_0x7d94('0x11e')});db[_0x7d94('0x4b')][_0x7d94('0x130')](db['Tag'],{'through':_0x7d94('0x191'),'as':_0x7d94('0x185')});db['FaxInteraction']['belongsToMany'](db[_0x7d94('0x90')],{'through':_0x7d94('0x191'),'as':_0x7d94('0x186')});db[_0x7d94('0x4b')]['belongsToMany'](db[_0x7d94('0x13')],{'as':_0x7d94('0x187'),'through':_0x7d94('0x139'),'foreignKey':_0x7d94('0x190')});db['FaxMessage'][_0x7d94('0x12e')](db[_0x7d94('0x13')],{'onDelete':_0x7d94('0x11b'),'as':_0x7d94('0x13')});db[_0x7d94('0x4c')]['belongsTo'](db[_0x7d94('0x4b')],{'as':'Interaction','foreignKey':_0x7d94('0x190')});db[_0x7d94('0x4c')][_0x7d94('0x12e')](db[_0x7d94('0x173')],{'onDelete':_0x7d94('0x11b'),'as':'Contact'});db[_0x7d94('0x4c')][_0x7d94('0x12e')](db[_0x7d94('0xf2')],{'as':'Attachment','foreignKey':_0x7d94('0x192')});db[_0x7d94('0x4c')][_0x7d94('0x12e')](db['FaxAccount'],{'as':_0x7d94('0x182'),'foreignKey':_0x7d94('0x18c')});db['FaxQueue'][_0x7d94('0x130')](db[_0x7d94('0x13')],{'as':_0x7d94('0x167'),'through':_0x7d94('0x32')});db['FaxQueue'][_0x7d94('0x130')](db[_0x7d94('0x17f')],{'through':_0x7d94('0x193'),'as':_0x7d94('0x168')});db[_0x7d94('0x50')]['belongsTo'](db['FaxAccount'],{});db[_0x7d94('0x50')][_0x7d94('0x12e')](db[_0x7d94('0x146')],{'as':_0x7d94('0x17c'),'foreignKey':'ListId'});db['FaxQueueReport'][_0x7d94('0x12e')](db[_0x7d94('0x173')],{'as':_0x7d94('0x174'),'foreignKey':_0x7d94('0x175')});db[_0x7d94('0x50')][_0x7d94('0x12e')](db['FaxInteraction'],{});db[_0x7d94('0x50')][_0x7d94('0x12e')](db['FaxMessage'],{});db[_0x7d94('0x50')][_0x7d94('0x12e')](db[_0x7d94('0x13')],{});db[_0x7d94('0x50')][_0x7d94('0x12e')](db['FaxQueue'],{});db[_0x7d94('0x52')][_0x7d94('0x11d')](db[_0x7d94('0x84')],{'as':_0x7d94('0x17a'),'foreignKey':_0x7d94('0x194'),'onDelete':_0x7d94('0x11b')});db[_0x7d94('0x52')][_0x7d94('0x11d')](db['CannedAnswer'],{'as':_0x7d94('0x18d'),'foreignKey':_0x7d94('0x194')});db[_0x7d94('0x52')]['hasMany'](db[_0x7d94('0x57')],{'as':_0x7d94('0x16c'),'foreignKey':'SmsAccountId'});db[_0x7d94('0x52')][_0x7d94('0x11d')](db[_0x7d94('0x56')],{'as':_0x7d94('0x17b')});db['SmsAccount'][_0x7d94('0x11d')](db[_0x7d94('0x54')],{'as':_0x7d94('0x158')});db['SmsAccount'][_0x7d94('0x12e')](db[_0x7d94('0x146')],{'as':_0x7d94('0x17c'),'foreignKey':_0x7d94('0x17d')});db[_0x7d94('0x52')]['belongsTo'](db[_0x7d94('0x88')],{'as':_0x7d94('0x164'),'foreignKey':_0x7d94('0x165')});db[_0x7d94('0x52')][_0x7d94('0x130')](db[_0x7d94('0x13')],{'as':_0x7d94('0x167'),'through':_0x7d94('0x151')});db[_0x7d94('0x54')][_0x7d94('0x12e')](db[_0x7d94('0x13')],{'onDelete':_0x7d94('0x178')});db['SmsApplication'][_0x7d94('0x12e')](db[_0x7d94('0x58')],{'onDelete':_0x7d94('0x178')});db[_0x7d94('0x54')][_0x7d94('0x12e')](db[_0x7d94('0x52')],{'onDelete':_0x7d94('0x178')});db[_0x7d94('0x54')][_0x7d94('0x12e')](db[_0x7d94('0x87')],{'onDelete':_0x7d94('0x178'),'foreignKey':_0x7d94('0x163')});db[_0x7d94('0x54')][_0x7d94('0x12e')](db[_0x7d94('0x90')],{'onDelete':_0x7d94('0x178'),'foreignKey':_0x7d94('0x195')});db['SmsInteraction'][_0x7d94('0x11d')](db['SmsMessage'],{'as':_0x7d94('0x16c'),'onDelete':'cascade','foreignKey':'SmsInteractionId'});db[_0x7d94('0x56')]['belongsTo'](db[_0x7d94('0x52')],{'as':_0x7d94('0x182'),'foreignKey':_0x7d94('0x194')});db[_0x7d94('0x56')][_0x7d94('0x12e')](db[_0x7d94('0x173')],{'as':_0x7d94('0x174'),'foreignKey':_0x7d94('0x175')});db[_0x7d94('0x56')][_0x7d94('0x12e')](db['User'],{'as':'Owner','foreignKey':'UserId'});db[_0x7d94('0x56')][_0x7d94('0x130')](db['Tag'],{'through':_0x7d94('0x196'),'as':_0x7d94('0x185')});db['SmsInteraction']['belongsToMany'](db[_0x7d94('0x90')],{'through':_0x7d94('0x196'),'as':_0x7d94('0x186')});db[_0x7d94('0x56')]['belongsToMany'](db[_0x7d94('0x13')],{'as':'Users','through':_0x7d94('0x13a'),'foreignKey':_0x7d94('0x197')});db['SmsMessage'][_0x7d94('0x12e')](db[_0x7d94('0x13')],{'as':'User'});db[_0x7d94('0x57')][_0x7d94('0x12e')](db[_0x7d94('0x173')],{'onDelete':_0x7d94('0x11b'),'as':_0x7d94('0x174')});db[_0x7d94('0x57')][_0x7d94('0x12e')](db[_0x7d94('0x56')],{'onDelete':_0x7d94('0x11b'),'as':_0x7d94('0x189'),'foreignKey':'SmsInteractionId'});db['SmsMessage'][_0x7d94('0x12e')](db['SmsAccount'],{'as':'Account','foreignKey':'SmsAccountId'});db[_0x7d94('0x58')][_0x7d94('0x130')](db[_0x7d94('0x13')],{'as':_0x7d94('0x167'),'through':_0x7d94('0x33'),'foreignKey':_0x7d94('0x198')});db['SmsQueue'][_0x7d94('0x130')](db[_0x7d94('0x17f')],{'through':_0x7d94('0x199'),'as':_0x7d94('0x168')});db[_0x7d94('0x14d')][_0x7d94('0x11d')](db[_0x7d94('0x84')],{'as':'Dispositions','foreignKey':_0x7d94('0x19a'),'onDelete':_0x7d94('0x11b')});db['OpenchannelAccount'][_0x7d94('0x11d')](db[_0x7d94('0x82')],{'as':'Answers','foreignKey':'OpenchannelAccountId'});db[_0x7d94('0x14d')][_0x7d94('0x11d')](db[_0x7d94('0x5a')],{'as':_0x7d94('0x17b'),'foreignKey':_0x7d94('0x19a')});db[_0x7d94('0x14d')][_0x7d94('0x11d')](db[_0x7d94('0x5c')],{'as':_0x7d94('0x16c'),'foreignKey':_0x7d94('0x19a')});db[_0x7d94('0x14d')][_0x7d94('0x11d')](db[_0x7d94('0x19b')],{'as':_0x7d94('0x158'),'foreignKey':_0x7d94('0x19a')});db[_0x7d94('0x14d')][_0x7d94('0x12e')](db[_0x7d94('0x146')],{'as':_0x7d94('0x17c'),'foreignKey':_0x7d94('0x17d')});db['OpenchannelAccount']['belongsTo'](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x7d94('0x165')});db[_0x7d94('0x14d')][_0x7d94('0x130')](db[_0x7d94('0x13')],{'as':_0x7d94('0x167'),'through':'user_has_openchannel_accounts'});db['OpenchannelApplication']['belongsTo'](db['User'],{'onDelete':_0x7d94('0x178')});db[_0x7d94('0x19b')][_0x7d94('0x12e')](db[_0x7d94('0x5e')],{'onDelete':_0x7d94('0x178'),'foreignKey':'OpenchannelQueueId'});db[_0x7d94('0x19b')][_0x7d94('0x12e')](db['OpenchannelAccount'],{'onDelete':_0x7d94('0x178'),'foreignKey':_0x7d94('0x19a')});db['OpenchannelApplication'][_0x7d94('0x12e')](db[_0x7d94('0x87')],{'onDelete':'restrict','foreignKey':_0x7d94('0x163')});db[_0x7d94('0x19b')][_0x7d94('0x12e')](db[_0x7d94('0x90')],{'onDelete':_0x7d94('0x178'),'foreignKey':_0x7d94('0x195')});db[_0x7d94('0x5a')][_0x7d94('0x11d')](db[_0x7d94('0x5c')],{'as':_0x7d94('0x16c'),'onDelete':_0x7d94('0x11b'),'foreignKey':'OpenchannelInteractionId'});db['OpenchannelInteraction']['belongsTo'](db[_0x7d94('0x14d')],{'as':_0x7d94('0x182'),'foreignKey':_0x7d94('0x19a')});db[_0x7d94('0x5a')][_0x7d94('0x12e')](db['CmContact'],{'as':_0x7d94('0x174'),'foreignKey':_0x7d94('0x175')});db[_0x7d94('0x5a')][_0x7d94('0x12e')](db[_0x7d94('0x13')],{'as':_0x7d94('0x183'),'foreignKey':_0x7d94('0x11e')});db[_0x7d94('0x5a')][_0x7d94('0x130')](db[_0x7d94('0x90')],{'through':_0x7d94('0x19c'),'as':_0x7d94('0x185')});db[_0x7d94('0x5a')][_0x7d94('0x130')](db[_0x7d94('0x90')],{'through':_0x7d94('0x19c'),'as':_0x7d94('0x186')});db['OpenchannelInteraction'][_0x7d94('0x130')](db[_0x7d94('0x13')],{'as':_0x7d94('0x187'),'through':_0x7d94('0x13b'),'foreignKey':_0x7d94('0x19d')});db['OpenchannelMessage'][_0x7d94('0x12e')](db[_0x7d94('0x13')],{'onDelete':_0x7d94('0x11b'),'as':_0x7d94('0x13')});db[_0x7d94('0x5c')][_0x7d94('0x12e')](db[_0x7d94('0x173')],{'onDelete':'cascade','as':_0x7d94('0x174')});db[_0x7d94('0x5c')]['belongsTo'](db[_0x7d94('0x5a')],{'onDelete':_0x7d94('0x11b'),'as':_0x7d94('0x189'),'foreignKey':_0x7d94('0x19d')});db['OpenchannelMessage'][_0x7d94('0x12e')](db[_0x7d94('0xf2')],{'as':'Attachment','foreignKey':_0x7d94('0x192')});db[_0x7d94('0x5c')][_0x7d94('0x12e')](db[_0x7d94('0x14d')],{'as':_0x7d94('0x182'),'foreignKey':_0x7d94('0x19a')});db[_0x7d94('0x5e')][_0x7d94('0x130')](db[_0x7d94('0x13')],{'as':'Agents','through':_0x7d94('0x35'),'foreignKey':_0x7d94('0x19e')});db[_0x7d94('0x5e')][_0x7d94('0x130')](db[_0x7d94('0x17f')],{'through':'team_has_openchannel_queues','as':_0x7d94('0x168')});db['ChatWebsite']['hasMany'](db[_0x7d94('0x84')],{'as':_0x7d94('0x17a'),'foreignKey':_0x7d94('0x19f'),'onDelete':_0x7d94('0x11b')});db[_0x7d94('0x60')][_0x7d94('0x11d')](db[_0x7d94('0x82')],{'as':_0x7d94('0x18d'),'foreignKey':_0x7d94('0x19f')});db[_0x7d94('0x60')][_0x7d94('0x11d')](db['ChatProactiveAction'],{'as':_0x7d94('0x1a0')});db[_0x7d94('0x60')][_0x7d94('0x11d')](db[_0x7d94('0x66')],{'as':_0x7d94('0x17b')});db[_0x7d94('0x60')][_0x7d94('0x11d')](db[_0x7d94('0x64')],{'as':_0x7d94('0x158')});db[_0x7d94('0x60')][_0x7d94('0x11d')](db[_0x7d94('0x68')],{'as':_0x7d94('0x16c')});db[_0x7d94('0x60')]['belongsTo'](db[_0x7d94('0x146')],{'as':_0x7d94('0x17c'),'foreignKey':'ListId'});db[_0x7d94('0x60')][_0x7d94('0x12e')](db[_0x7d94('0x87')],{'as':_0x7d94('0x87'),'foreignKey':'IntervalId'});db[_0x7d94('0x60')][_0x7d94('0x12e')](db['MailAccount'],{'as':_0x7d94('0x3a'),'foreignKey':'MailAccountId'});db[_0x7d94('0x60')]['belongsTo'](db[_0x7d94('0x88')],{'as':_0x7d94('0x164'),'foreignKey':_0x7d94('0x165')});db[_0x7d94('0x60')]['belongsToMany'](db[_0x7d94('0x13')],{'as':_0x7d94('0x167'),'through':_0x7d94('0x148')});db[_0x7d94('0x62')][_0x7d94('0x12e')](db[_0x7d94('0x14d')],{});db[_0x7d94('0x62')][_0x7d94('0x12e')](db['CmList'],{'as':_0x7d94('0x17c'),'foreignKey':_0x7d94('0x17d')});db['OpenchannelQueueReport']['belongsTo'](db[_0x7d94('0x173')],{'as':'Contact','foreignKey':'ContactId'});db[_0x7d94('0x62')][_0x7d94('0x12e')](db[_0x7d94('0x5a')],{});db[_0x7d94('0x62')][_0x7d94('0x12e')](db['OpenchannelMessage'],{});db[_0x7d94('0x62')][_0x7d94('0x12e')](db['User'],{});db[_0x7d94('0x62')][_0x7d94('0x12e')](db[_0x7d94('0x5e')],{});db['ChatApplication'][_0x7d94('0x12e')](db[_0x7d94('0x13')],{'as':'Agent','foreignKey':_0x7d94('0x11e'),'onDelete':_0x7d94('0x178')});db[_0x7d94('0x64')]['belongsTo'](db['ChatQueue'],{'as':_0x7d94('0x1a1'),'foreignKey':_0x7d94('0x1a2'),'onDelete':'restrict'});db[_0x7d94('0x64')][_0x7d94('0x12e')](db[_0x7d94('0x60')],{'as':_0x7d94('0x1a3'),'foreignKey':_0x7d94('0x19f'),'onDelete':_0x7d94('0x178')});db[_0x7d94('0x64')][_0x7d94('0x12e')](db[_0x7d94('0x90')],{'onDelete':'restrict','foreignKey':_0x7d94('0x195')});db['ChatInteraction'][_0x7d94('0x11d')](db['ChatMessage'],{'as':_0x7d94('0x16c'),'onDelete':'cascade','foreignKey':_0x7d94('0x1a4')});db['ChatInteraction'][_0x7d94('0x12e')](db['ChatWebsite'],{'as':_0x7d94('0x182'),'foreignKey':_0x7d94('0x19f')});db[_0x7d94('0x66')][_0x7d94('0x12e')](db['CmContact'],{'as':'Contact','foreignKey':_0x7d94('0x175')});db['ChatInteraction'][_0x7d94('0x12e')](db['User'],{'as':_0x7d94('0x183'),'foreignKey':_0x7d94('0x11e')});db[_0x7d94('0x66')][_0x7d94('0x130')](db[_0x7d94('0x90')],{'through':'chat_interaction_has_tags','as':_0x7d94('0x185')});db[_0x7d94('0x66')][_0x7d94('0x130')](db[_0x7d94('0x90')],{'through':_0x7d94('0x1a5'),'as':_0x7d94('0x186')});db[_0x7d94('0x66')][_0x7d94('0x130')](db['User'],{'as':'Users','through':_0x7d94('0x138'),'foreignKey':_0x7d94('0x1a4')});db[_0x7d94('0x68')][_0x7d94('0x12e')](db[_0x7d94('0x13')],{'onDelete':_0x7d94('0x11b'),'as':_0x7d94('0x13')});db[_0x7d94('0x68')][_0x7d94('0x12e')](db[_0x7d94('0x173')],{'onDelete':'cascade','as':_0x7d94('0x174'),'foreignKey':_0x7d94('0x175')});db[_0x7d94('0x68')][_0x7d94('0x12e')](db[_0x7d94('0x66')],{'onDelete':_0x7d94('0x11b'),'as':_0x7d94('0x189'),'foreignKey':_0x7d94('0x1a4')});db[_0x7d94('0x68')][_0x7d94('0x12e')](db[_0x7d94('0xf2')],{'as':'Attachment','foreignKey':_0x7d94('0x192')});db[_0x7d94('0x68')][_0x7d94('0x12e')](db[_0x7d94('0x60')],{'as':'Account','foreignKey':_0x7d94('0x19f')});db[_0x7d94('0x18a')][_0x7d94('0x11d')](db[_0x7d94('0xf2')],{'as':_0x7d94('0x188'),'foreignKey':_0x7d94('0x1a6'),'onDelete':_0x7d94('0x11b'),'hooks':!![]});db[_0x7d94('0x18a')][_0x7d94('0x12e')](db[_0x7d94('0x173')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x7d94('0x175')});db['ChatOfflineMessage']['belongsTo'](db[_0x7d94('0x60')],{'as':_0x7d94('0x182'),'foreignKey':_0x7d94('0x19f')});db[_0x7d94('0x6b')][_0x7d94('0x130')](db[_0x7d94('0x13')],{'as':_0x7d94('0x167'),'through':_0x7d94('0x30'),'hooks':!![]});db[_0x7d94('0x6b')][_0x7d94('0x130')](db[_0x7d94('0x17f')],{'through':_0x7d94('0x1a7'),'as':_0x7d94('0x168')});db[_0x7d94('0x6d')][_0x7d94('0x11d')](db[_0x7d94('0x1a8')],{'as':_0x7d94('0x16c'),'foreignKey':_0x7d94('0x1a9'),'onDelete':_0x7d94('0x11b')});db[_0x7d94('0x6d')][_0x7d94('0x130')](db[_0x7d94('0x13')],{'as':_0x7d94('0x15c'),'through':_0x7d94('0x132')});db[_0x7d94('0x6f')][_0x7d94('0x12e')](db[_0x7d94('0x60')],{'as':_0x7d94('0x1a3'),'foreignKey':_0x7d94('0x19f')});db[_0x7d94('0x71')][_0x7d94('0x11d')](db[_0x7d94('0x173')],{'as':'Contacts','foreignKey':_0x7d94('0x1aa')});db[_0x7d94('0x173')][_0x7d94('0x11d')](db['CmHopper'],{'as':'Hoppers','foreignKey':_0x7d94('0x175')});db[_0x7d94('0x173')]['hasMany'](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x7d94('0x175')});db['CmContact'][_0x7d94('0x11d')](db[_0x7d94('0x79')],{'as':_0x7d94('0x15e'),'foreignKey':'ContactId'});db[_0x7d94('0x173')][_0x7d94('0x11d')](db['ReportAgentPreview'],{'as':_0x7d94('0x7b'),'foreignKey':_0x7d94('0x175')});db[_0x7d94('0x173')]['hasMany'](db['JscriptySessionReport'],{'as':_0x7d94('0x15f'),'foreignKey':_0x7d94('0x175')});db['CmContact']['hasMany'](db['OpenchannelInteraction'],{'as':_0x7d94('0x124'),'foreignKey':_0x7d94('0x175'),'onDelete':_0x7d94('0x178')});db[_0x7d94('0x173')][_0x7d94('0x11d')](db[_0x7d94('0x66')],{'as':_0x7d94('0x125'),'foreignKey':_0x7d94('0x175'),'onDelete':_0x7d94('0x178')});db[_0x7d94('0x173')][_0x7d94('0x11d')](db[_0x7d94('0x56')],{'as':_0x7d94('0x126'),'foreignKey':_0x7d94('0x175'),'onDelete':_0x7d94('0x178')});db['CmContact'][_0x7d94('0x11d')](db[_0x7d94('0x4b')],{'as':_0x7d94('0x127'),'foreignKey':'ContactId','onDelete':_0x7d94('0x178')});db['CmContact'][_0x7d94('0x11d')](db[_0x7d94('0x128')],{'as':_0x7d94('0x129'),'foreignKey':_0x7d94('0x175'),'onDelete':'restrict'});db[_0x7d94('0x173')]['belongsTo'](db[_0x7d94('0x71')],{'as':_0x7d94('0x1ab'),'foreignKey':_0x7d94('0x1aa')});db[_0x7d94('0x173')]['belongsTo'](db[_0x7d94('0x146')],{'as':_0x7d94('0x17c'),'foreignKey':_0x7d94('0x17d'),'onDelete':_0x7d94('0x11b')});db[_0x7d94('0x173')]['belongsToMany'](db['User'],{'as':_0x7d94('0x187'),'through':_0x7d94('0x134')});db[_0x7d94('0x173')][_0x7d94('0x130')](db[_0x7d94('0x90')],{'as':'Tags','through':_0x7d94('0x1ac')});db[_0x7d94('0x173')][_0x7d94('0x130')](db[_0x7d94('0x90')],{'through':_0x7d94('0x1ac'),'as':_0x7d94('0x186')});db[_0x7d94('0x74')][_0x7d94('0x12e')](db[_0x7d94('0x173')],{'as':_0x7d94('0x174'),'foreignKey':_0x7d94('0x175'),'onDelete':_0x7d94('0x11b')});db[_0x7d94('0x74')][_0x7d94('0x12e')](db['CmList'],{'as':'List','foreignKey':_0x7d94('0x17d'),'onDelete':'cascade'});db['CmHopper'][_0x7d94('0x12e')](db['User'],{'as':'Agent','foreignKey':_0x7d94('0x11e')});db['CmHopper']['belongsTo'](db[_0x7d94('0x1b')],{'as':_0x7d94('0x1a1'),'foreignKey':'VoiceQueueId','onDelete':_0x7d94('0x11b')});db[_0x7d94('0x74')][_0x7d94('0x12e')](db['Campaign'],{'as':_0x7d94('0xee'),'foreignKey':_0x7d94('0x1ad'),'onDelete':_0x7d94('0x11b')});db['CmHopper'][_0x7d94('0x12e')](db[_0x7d94('0x13')],{'as':_0x7d94('0x183'),'foreignKey':_0x7d94('0x1ae')});db['CmHopperBlack'][_0x7d94('0x12e')](db[_0x7d94('0x173')],{'as':_0x7d94('0x174'),'foreignKey':'ContactId','onDelete':_0x7d94('0x11b')});db['CmHopperBlack'][_0x7d94('0x12e')](db[_0x7d94('0x146')],{'as':_0x7d94('0x17c'),'foreignKey':_0x7d94('0x17d'),'onDelete':_0x7d94('0x11b')});db['CmHopperBlack'][_0x7d94('0x12e')](db[_0x7d94('0x1b')],{'as':'Queue','foreignKey':_0x7d94('0x15d'),'onDelete':_0x7d94('0x11b')});db['CmHopperBlack']['belongsTo'](db['Campaign'],{'as':_0x7d94('0xee'),'foreignKey':_0x7d94('0x1ad'),'onDelete':_0x7d94('0x11b')});db['Automation'][_0x7d94('0x11d')](db[_0x7d94('0x1af')],{'as':{'plural':_0x7d94('0x1b0'),'singular':_0x7d94('0x1b1')},'foreignKey':_0x7d94('0x1b2'),'onDelete':_0x7d94('0x11b'),'hooks':!![]});db['Automation']['hasMany'](db['Condition'],{'as':{'plural':_0x7d94('0x1b3'),'singular':_0x7d94('0x1b4')},'foreignKey':_0x7d94('0x1b5'),'onDelete':_0x7d94('0x11b'),'hooks':!![]});db[_0x7d94('0x1b6')][_0x7d94('0x11d')](db['Action'],{'as':_0x7d94('0x1b7'),'foreignKey':_0x7d94('0x1b8'),'onDelete':_0x7d94('0x11b'),'hooks':!![]});db[_0x7d94('0x84')][_0x7d94('0x11d')](db['Disposition'],{'as':_0x7d94('0x17a'),'foreignKey':_0x7d94('0x1b9'),'onDelete':_0x7d94('0x11b')});db[_0x7d94('0x87')][_0x7d94('0x11d')](db[_0x7d94('0x87')],{'as':'Intervals','foreignKey':'IntervalId','onDelete':_0x7d94('0x11b'),'hooks':!![],'required':![]});db[_0x7d94('0x87')]['hasMany'](db[_0x7d94('0x120')],{'as':_0x7d94('0x121'),'foreignKey':_0x7d94('0x163'),'onDelete':'restrict'});db[_0x7d94('0x87')][_0x7d94('0x11d')](db['MailApplication'],{'as':'MailApplications','foreignKey':_0x7d94('0x163')});db[_0x7d94('0x87')][_0x7d94('0x11d')](db[_0x7d94('0x64')],{'as':'ChatApplications','foreignKey':'IntervalId'});db[_0x7d94('0x87')]['hasMany'](db[_0x7d94('0x49')],{'as':_0x7d94('0x1ba'),'foreignKey':_0x7d94('0x163')});db[_0x7d94('0x87')][_0x7d94('0x11d')](db[_0x7d94('0x54')],{'as':_0x7d94('0x1bb'),'foreignKey':_0x7d94('0x163')});db[_0x7d94('0x1bc')][_0x7d94('0x12e')](db[_0x7d94('0x3a')],{});db[_0x7d94('0x1bc')][_0x7d94('0x12e')](db[_0x7d94('0x9c')],{'foreignKey':_0x7d94('0x1bd')});db[_0x7d94('0x1bc')][_0x7d94('0x12e')](db[_0x7d94('0x1be')],{'foreignKey':_0x7d94('0x1bf')});db['Sound']['belongsToMany'](db[_0x7d94('0x159')],{'as':_0x7d94('0x1c0'),'through':_0x7d94('0x15a'),'onDelete':_0x7d94('0x178')});db['Tag'][_0x7d94('0x130')](db['CmContact'],{'through':_0x7d94('0x1ac')});db['Tag'][_0x7d94('0x130')](db[_0x7d94('0x66')],{'through':_0x7d94('0x1a5')});db[_0x7d94('0x90')][_0x7d94('0x130')](db[_0x7d94('0x128')],{'through':_0x7d94('0x184')});db[_0x7d94('0x90')][_0x7d94('0x130')](db[_0x7d94('0x56')],{'through':_0x7d94('0x196')});db[_0x7d94('0x90')][_0x7d94('0x130')](db[_0x7d94('0x4b')],{'through':'fax_interaction_has_tags'});db[_0x7d94('0x90')][_0x7d94('0x130')](db['OpenchannelInteraction'],{'through':_0x7d94('0x19c')});db[_0x7d94('0x90')][_0x7d94('0x130')](db[_0x7d94('0x108')],{'through':_0x7d94('0x1c1')});db[_0x7d94('0x94')][_0x7d94('0x11d')](db[_0x7d94('0x1af')],{'as':{'plural':_0x7d94('0x1c2'),'singular':'AllCondition'},'foreignKey':'TriggerAllId','onDelete':'cascade','hooks':!![]});db['Trigger'][_0x7d94('0x11d')](db[_0x7d94('0x1af')],{'as':{'plural':_0x7d94('0x1c3'),'singular':'AnyCondition'},'foreignKey':_0x7d94('0x1c4'),'onDelete':_0x7d94('0x11b'),'hooks':!![]});db[_0x7d94('0x94')][_0x7d94('0x11d')](db[_0x7d94('0x7f')],{'as':_0x7d94('0x1b7'),'foreignKey':_0x7d94('0x1c5'),'onDelete':_0x7d94('0x11b'),'hooks':!![]});db[_0x7d94('0x1be')][_0x7d94('0x11d')](db[_0x7d94('0xa2')],{'as':_0x7d94('0x1c6'),'onDelete':_0x7d94('0x11b'),'foreignKey':'CustomReportId','hooks':!![]});db[_0x7d94('0x9c')][_0x7d94('0x11d')](db[_0x7d94('0xa2')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x7d94('0x1bd')});db[_0x7d94('0xa0')][_0x7d94('0x11d')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':'cascade','foreignKey':_0x7d94('0x1c7')});db[_0x7d94('0xa2')][_0x7d94('0x12e')](db['AnalyticMetric'],{'foreignKey':_0x7d94('0x1c7')});db[_0x7d94('0xa6')][_0x7d94('0x11d')](db[_0x7d94('0xa7')],{'as':_0x7d94('0x1c8'),'onDelete':_0x7d94('0x11b'),'foreignKey':'AccountId'});db[_0x7d94('0xa7')][_0x7d94('0x11d')](db[_0x7d94('0xa9')],{'as':'Subjects','onDelete':_0x7d94('0x11b'),'foreignKey':_0x7d94('0x1c9')});db[_0x7d94('0xa7')][_0x7d94('0x11d')](db[_0x7d94('0xa9')],{'as':_0x7d94('0x1ca'),'onDelete':_0x7d94('0x11b'),'foreignKey':'DescriptionId'});db[_0x7d94('0xa7')]['hasMany'](db[_0x7d94('0xa9')],{'as':_0x7d94('0x1c6'),'onDelete':_0x7d94('0x11b'),'foreignKey':_0x7d94('0x1cb')});db[_0x7d94('0xa7')][_0x7d94('0x12e')](db[_0x7d94('0xa6')],{'as':'Account','foreignKey':'AccountId'});db['SalesforceField'][_0x7d94('0x11d')](db[_0x7d94('0xa9')],{'as':_0x7d94('0x1cc'),'foreignKey':_0x7d94('0x1c9')});db[_0x7d94('0xa9')]['hasMany'](db[_0x7d94('0xa9')],{'as':_0x7d94('0x1cd'),'foreignKey':_0x7d94('0x1ce')});db[_0x7d94('0xa9')][_0x7d94('0x11d')](db[_0x7d94('0xa9')],{'as':_0x7d94('0x1cf'),'foreignKey':_0x7d94('0x1cb')});db['SalesforceField'][_0x7d94('0x12e')](db[_0x7d94('0x96')],{'as':_0x7d94('0x96'),'foreignKey':_0x7d94('0x1d0')});db[_0x7d94('0xab')][_0x7d94('0x11d')](db['SugarcrmConfiguration'],{'as':_0x7d94('0x1c8'),'onDelete':_0x7d94('0x11b'),'foreignKey':_0x7d94('0x1d1')});db[_0x7d94('0xad')][_0x7d94('0x11d')](db[_0x7d94('0x1d2')],{'as':_0x7d94('0x1d3'),'onDelete':_0x7d94('0x11b'),'foreignKey':_0x7d94('0x1c9')});db['SugarcrmConfiguration'][_0x7d94('0x11d')](db['SugarcrmField'],{'as':_0x7d94('0x1ca'),'onDelete':_0x7d94('0x11b'),'foreignKey':_0x7d94('0x1ce')});db[_0x7d94('0xad')][_0x7d94('0x11d')](db['SugarcrmField'],{'as':_0x7d94('0x1c6'),'onDelete':_0x7d94('0x11b'),'foreignKey':_0x7d94('0x1cb')});db[_0x7d94('0xad')][_0x7d94('0x12e')](db[_0x7d94('0xab')],{'as':_0x7d94('0x182'),'foreignKey':_0x7d94('0x1d1')});db[_0x7d94('0x1d2')][_0x7d94('0x11d')](db[_0x7d94('0x1d2')],{'as':_0x7d94('0x1cc'),'foreignKey':_0x7d94('0x1c9')});db[_0x7d94('0x1d2')][_0x7d94('0x11d')](db[_0x7d94('0x1d2')],{'as':'Description','foreignKey':_0x7d94('0x1ce')});db[_0x7d94('0x1d2')][_0x7d94('0x11d')](db[_0x7d94('0x1d2')],{'as':_0x7d94('0x1cf'),'foreignKey':'FieldId'});db[_0x7d94('0x1d2')][_0x7d94('0x12e')](db['Variable'],{'as':_0x7d94('0x96'),'foreignKey':_0x7d94('0x1d0')});db['DeskAccount']['hasMany'](db[_0x7d94('0xb0')],{'as':_0x7d94('0x1c8'),'onDelete':_0x7d94('0x11b'),'foreignKey':_0x7d94('0x1d1')});db[_0x7d94('0xb0')][_0x7d94('0x11d')](db[_0x7d94('0x1d4')],{'as':_0x7d94('0x1d3'),'onDelete':_0x7d94('0x11b'),'foreignKey':_0x7d94('0x1c9')});db['DeskConfiguration'][_0x7d94('0x11d')](db['DeskField'],{'as':_0x7d94('0x1ca'),'onDelete':_0x7d94('0x11b'),'foreignKey':_0x7d94('0x1ce')});db[_0x7d94('0xb0')][_0x7d94('0x11d')](db[_0x7d94('0x1d4')],{'as':'Fields','onDelete':_0x7d94('0x11b'),'foreignKey':_0x7d94('0x1cb')});db[_0x7d94('0xb0')][_0x7d94('0x12e')](db[_0x7d94('0x1d5')],{'as':_0x7d94('0x182'),'foreignKey':_0x7d94('0x1d1')});db['DeskConfiguration']['belongsToMany'](db[_0x7d94('0x90')],{'through':_0x7d94('0x1d6')});db[_0x7d94('0x1d4')][_0x7d94('0x11d')](db['DeskField'],{'as':_0x7d94('0x1cc'),'foreignKey':_0x7d94('0x1c9')});db['DeskField'][_0x7d94('0x11d')](db[_0x7d94('0x1d4')],{'as':_0x7d94('0x1cd'),'foreignKey':'DescriptionId'});db[_0x7d94('0x1d4')]['hasMany'](db[_0x7d94('0x1d4')],{'as':_0x7d94('0x1cf'),'foreignKey':_0x7d94('0x1cb')});db[_0x7d94('0x1d4')][_0x7d94('0x12e')](db['Variable'],{'as':_0x7d94('0x96'),'foreignKey':_0x7d94('0x1d0')});db[_0x7d94('0xb3')][_0x7d94('0x11d')](db[_0x7d94('0xb5')],{'as':_0x7d94('0x1c8'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x7d94('0xb5')][_0x7d94('0x11d')](db[_0x7d94('0xb7')],{'as':_0x7d94('0x1d3'),'onDelete':_0x7d94('0x11b'),'foreignKey':_0x7d94('0x1c9')});db[_0x7d94('0xb5')][_0x7d94('0x11d')](db[_0x7d94('0xb7')],{'as':_0x7d94('0x1ca'),'onDelete':_0x7d94('0x11b'),'foreignKey':_0x7d94('0x1ce')});db[_0x7d94('0xb5')][_0x7d94('0x11d')](db[_0x7d94('0xb7')],{'as':_0x7d94('0x1c6'),'onDelete':_0x7d94('0x11b'),'foreignKey':_0x7d94('0x1cb')});db['ZohoConfiguration'][_0x7d94('0x12e')](db[_0x7d94('0xb3')],{'as':_0x7d94('0x182'),'foreignKey':'AccountId'});db[_0x7d94('0xb7')][_0x7d94('0x11d')](db['ZohoField'],{'as':_0x7d94('0x1cc'),'foreignKey':'SubjectId'});db[_0x7d94('0xb7')][_0x7d94('0x11d')](db[_0x7d94('0xb7')],{'as':'Description','foreignKey':_0x7d94('0x1ce')});db[_0x7d94('0xb7')]['hasMany'](db[_0x7d94('0xb7')],{'as':'Field','foreignKey':'FieldId'});db[_0x7d94('0xb7')][_0x7d94('0x12e')](db[_0x7d94('0x96')],{'as':_0x7d94('0x96'),'foreignKey':_0x7d94('0x1d0')});db[_0x7d94('0xb9')]['hasMany'](db['ZendeskConfiguration'],{'as':_0x7d94('0x1c8'),'onDelete':_0x7d94('0x11b'),'foreignKey':_0x7d94('0x1d1')});db[_0x7d94('0xbb')][_0x7d94('0x11d')](db['ZendeskField'],{'as':_0x7d94('0x1d3'),'foreignKey':_0x7d94('0x1c9')});db[_0x7d94('0xbb')][_0x7d94('0x11d')](db[_0x7d94('0x1d7')],{'as':_0x7d94('0x1ca'),'foreignKey':_0x7d94('0x1ce')});db['ZendeskConfiguration']['hasMany'](db[_0x7d94('0x1d7')],{'as':'Fields','foreignKey':'FieldId'});db[_0x7d94('0xbb')][_0x7d94('0x12e')](db[_0x7d94('0xb9')],{'as':_0x7d94('0x182'),'foreignKey':_0x7d94('0x1d1')});db[_0x7d94('0xbb')][_0x7d94('0x130')](db[_0x7d94('0x90')],{'through':_0x7d94('0x1d8')});db[_0x7d94('0x1d7')]['hasMany'](db[_0x7d94('0x1d7')],{'as':_0x7d94('0x1cc'),'foreignKey':'SubjectId'});db[_0x7d94('0x1d7')][_0x7d94('0x11d')](db[_0x7d94('0x1d7')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x7d94('0x1d7')][_0x7d94('0x11d')](db[_0x7d94('0x1d7')],{'as':_0x7d94('0x1cf'),'foreignKey':_0x7d94('0x1cb')});db[_0x7d94('0x1d7')][_0x7d94('0x12e')](db['Variable'],{'as':_0x7d94('0x96'),'foreignKey':_0x7d94('0x1d0')});db['FreshdeskAccount'][_0x7d94('0x11d')](db[_0x7d94('0xc0')],{'as':_0x7d94('0x1c8'),'onDelete':'cascade','foreignKey':_0x7d94('0x1d1')});db[_0x7d94('0xc0')][_0x7d94('0x11d')](db['FreshdeskField'],{'as':_0x7d94('0x1d3'),'onDelete':_0x7d94('0x11b'),'foreignKey':'SubjectId'});db[_0x7d94('0xc0')][_0x7d94('0x11d')](db[_0x7d94('0xc2')],{'as':_0x7d94('0x1ca'),'onDelete':_0x7d94('0x11b'),'foreignKey':_0x7d94('0x1ce')});db[_0x7d94('0xc0')]['hasMany'](db['FreshdeskField'],{'as':_0x7d94('0x1c6'),'onDelete':_0x7d94('0x11b'),'foreignKey':_0x7d94('0x1cb')});db['FreshdeskConfiguration'][_0x7d94('0x12e')](db[_0x7d94('0xbe')],{'as':_0x7d94('0x182'),'foreignKey':'AccountId'});db[_0x7d94('0xc0')][_0x7d94('0x130')](db[_0x7d94('0x90')],{'through':_0x7d94('0x1d9')});db[_0x7d94('0xc2')][_0x7d94('0x11d')](db[_0x7d94('0xc2')],{'as':_0x7d94('0x1cc'),'foreignKey':_0x7d94('0x1c9')});db[_0x7d94('0xc2')][_0x7d94('0x11d')](db[_0x7d94('0xc2')],{'as':_0x7d94('0x1cd'),'foreignKey':_0x7d94('0x1ce')});db[_0x7d94('0xc2')]['hasMany'](db[_0x7d94('0xc2')],{'as':_0x7d94('0x1cf'),'foreignKey':_0x7d94('0x1cb')});db[_0x7d94('0xc2')]['belongsTo'](db[_0x7d94('0x96')],{'as':_0x7d94('0x96'),'foreignKey':_0x7d94('0x1d0')});db[_0x7d94('0xc4')][_0x7d94('0x11d')](db[_0x7d94('0xc6')],{'as':'Configurations','onDelete':_0x7d94('0x11b'),'foreignKey':_0x7d94('0x1d1')});db[_0x7d94('0xc6')][_0x7d94('0x11d')](db[_0x7d94('0xc8')],{'as':_0x7d94('0x1d3'),'foreignKey':_0x7d94('0x1c9')});db['VtigerConfiguration'][_0x7d94('0x11d')](db[_0x7d94('0xc8')],{'as':'Descriptions','foreignKey':_0x7d94('0x1ce')});db[_0x7d94('0xc6')][_0x7d94('0x11d')](db[_0x7d94('0xc8')],{'as':_0x7d94('0x1c6'),'foreignKey':_0x7d94('0x1cb')});db[_0x7d94('0xc6')][_0x7d94('0x12e')](db[_0x7d94('0xc4')],{'as':'Account','foreignKey':_0x7d94('0x1d1')});db['VtigerField'][_0x7d94('0x11d')](db['VtigerField'],{'as':_0x7d94('0x1cc'),'foreignKey':_0x7d94('0x1c9')});db[_0x7d94('0xc8')][_0x7d94('0x11d')](db[_0x7d94('0xc8')],{'as':_0x7d94('0x1cd'),'foreignKey':_0x7d94('0x1ce')});db['VtigerField'][_0x7d94('0x11d')](db[_0x7d94('0xc8')],{'as':_0x7d94('0x1cf'),'foreignKey':'FieldId'});db['VtigerField'][_0x7d94('0x12e')](db[_0x7d94('0x96')],{'as':_0x7d94('0x96'),'foreignKey':_0x7d94('0x1d0')});db['ServicenowAccount'][_0x7d94('0x11d')](db[_0x7d94('0xcc')],{'as':_0x7d94('0x1c8'),'onDelete':'cascade','foreignKey':_0x7d94('0x1d1')});db[_0x7d94('0xcc')]['hasMany'](db[_0x7d94('0xce')],{'as':'Subjects','foreignKey':_0x7d94('0x1c9')});db[_0x7d94('0xcc')][_0x7d94('0x11d')](db[_0x7d94('0xce')],{'as':_0x7d94('0x1ca'),'foreignKey':_0x7d94('0x1ce')});db[_0x7d94('0xcc')][_0x7d94('0x11d')](db[_0x7d94('0xce')],{'as':_0x7d94('0x1c6'),'foreignKey':_0x7d94('0x1cb')});db[_0x7d94('0xcc')]['belongsTo'](db[_0x7d94('0xca')],{'as':'Account','foreignKey':_0x7d94('0x1d1')});db['ServicenowField'][_0x7d94('0x11d')](db[_0x7d94('0xce')],{'as':_0x7d94('0x1cc'),'foreignKey':_0x7d94('0x1c9')});db[_0x7d94('0xce')][_0x7d94('0x11d')](db[_0x7d94('0xce')],{'as':_0x7d94('0x1cd'),'foreignKey':_0x7d94('0x1ce')});db['ServicenowField'][_0x7d94('0x11d')](db[_0x7d94('0xce')],{'as':_0x7d94('0x1cf'),'foreignKey':_0x7d94('0x1cb')});db[_0x7d94('0xce')]['belongsTo'](db[_0x7d94('0x96')],{'as':_0x7d94('0x96'),'foreignKey':_0x7d94('0x1d0')});db[_0x7d94('0xd0')][_0x7d94('0x11d')](db['Dynamics365Configuration'],{'as':_0x7d94('0x1c8'),'onDelete':_0x7d94('0x11b'),'foreignKey':_0x7d94('0x1d1')});db[_0x7d94('0xd0')][_0x7d94('0x12e')](db[_0x7d94('0x111')],{'as':_0x7d94('0x111'),'foreignKey':_0x7d94('0x177')});db['Dynamics365Configuration'][_0x7d94('0x11d')](db[_0x7d94('0x1da')],{'as':_0x7d94('0x1d3'),'onDelete':'cascade','foreignKey':_0x7d94('0x1c9')});db[_0x7d94('0xd1')][_0x7d94('0x11d')](db[_0x7d94('0x1da')],{'as':_0x7d94('0x1ca'),'onDelete':_0x7d94('0x11b'),'foreignKey':'DescriptionId'});db[_0x7d94('0xd1')][_0x7d94('0x11d')](db[_0x7d94('0x1da')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x7d94('0x1cb')});db[_0x7d94('0xd1')][_0x7d94('0x12e')](db[_0x7d94('0xd0')],{'as':_0x7d94('0x182'),'foreignKey':_0x7d94('0x1d1')});db[_0x7d94('0x1da')][_0x7d94('0x11d')](db[_0x7d94('0x1da')],{'as':'Subject','foreignKey':_0x7d94('0x1c9')});db[_0x7d94('0x1da')][_0x7d94('0x11d')](db['Dynamics365Field'],{'as':_0x7d94('0x1cd'),'foreignKey':'DescriptionId'});db[_0x7d94('0x1da')]['hasMany'](db['Dynamics365Field'],{'as':_0x7d94('0x1cf'),'foreignKey':'FieldId'});db[_0x7d94('0x1da')][_0x7d94('0x12e')](db[_0x7d94('0x96')],{'as':_0x7d94('0x96'),'foreignKey':_0x7d94('0x1d0')});db['FreshsalesAccount'][_0x7d94('0x11d')](db[_0x7d94('0xd6')],{'as':'Configurations','onDelete':_0x7d94('0x11b'),'foreignKey':_0x7d94('0x1d1')});db[_0x7d94('0xd6')][_0x7d94('0x11d')](db[_0x7d94('0x1db')],{'as':_0x7d94('0x1d3'),'foreignKey':_0x7d94('0x1c9')});db[_0x7d94('0xd6')][_0x7d94('0x11d')](db[_0x7d94('0x1db')],{'as':_0x7d94('0x1ca'),'foreignKey':_0x7d94('0x1ce')});db[_0x7d94('0xd6')][_0x7d94('0x11d')](db[_0x7d94('0x1db')],{'as':_0x7d94('0x1c6'),'foreignKey':'FieldId'});db['FreshsalesConfiguration']['belongsTo'](db[_0x7d94('0xd4')],{'as':_0x7d94('0x182'),'foreignKey':_0x7d94('0x1d1')});db[_0x7d94('0x1db')][_0x7d94('0x11d')](db[_0x7d94('0x1db')],{'as':'Subject','foreignKey':_0x7d94('0x1c9')});db['FreshsalesField'][_0x7d94('0x11d')](db['FreshsalesField'],{'as':'Description','foreignKey':_0x7d94('0x1ce')});db[_0x7d94('0x1db')][_0x7d94('0x11d')](db[_0x7d94('0x1db')],{'as':_0x7d94('0x1cf'),'foreignKey':_0x7d94('0x1cb')});db[_0x7d94('0x1db')][_0x7d94('0x12e')](db[_0x7d94('0x96')],{'as':_0x7d94('0x96'),'foreignKey':_0x7d94('0x1d0')});db[_0x7d94('0x1dc')][_0x7d94('0x12e')](db[_0x7d94('0x60')],{});db['ChatQueueReport'][_0x7d94('0x12e')](db['CmList'],{'as':_0x7d94('0x17c'),'foreignKey':_0x7d94('0x17d')});db[_0x7d94('0x1dc')][_0x7d94('0x12e')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0x7d94('0x1dc')][_0x7d94('0x12e')](db[_0x7d94('0x66')],{});db['ChatQueueReport']['belongsTo'](db[_0x7d94('0x68')],{});db[_0x7d94('0x1dc')][_0x7d94('0x12e')](db['User'],{});db[_0x7d94('0x1dc')][_0x7d94('0x12e')](db[_0x7d94('0x6b')],{});db[_0x7d94('0x1a8')]['belongsTo'](db[_0x7d94('0x13')],{'onDelete':_0x7d94('0x11b'),'foreignKey':_0x7d94('0x1dd')});db[_0x7d94('0x1a8')][_0x7d94('0x12e')](db[_0x7d94('0x13')],{'onDelete':_0x7d94('0x11b'),'foreignKey':_0x7d94('0x1de')});db[_0x7d94('0xde')][_0x7d94('0x11d')](db['JscriptyQuestionReport'],{'foreignKey':_0x7d94('0x1df'),'onDelete':_0x7d94('0x11b')});db[_0x7d94('0xde')][_0x7d94('0x11d')](db[_0x7d94('0xdd')],{'foreignKey':_0x7d94('0x1df'),'onDelete':'cascade'});db[_0x7d94('0xe0')][_0x7d94('0x12e')](db[_0x7d94('0x52')],{});db['SmsQueueReport'][_0x7d94('0x12e')](db['CmList'],{'as':_0x7d94('0x17c'),'foreignKey':_0x7d94('0x17d')});db[_0x7d94('0xe0')][_0x7d94('0x12e')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0x7d94('0xe0')][_0x7d94('0x12e')](db[_0x7d94('0x56')],{});db[_0x7d94('0xe0')]['belongsTo'](db[_0x7d94('0x57')],{});db[_0x7d94('0xe0')]['belongsTo'](db[_0x7d94('0x13')],{});db[_0x7d94('0xe0')][_0x7d94('0x12e')](db[_0x7d94('0x58')],{});db['JscriptyProject'][_0x7d94('0x11d')](db[_0x7d94('0xde')],{'foreignKey':'ProjectId'});db[_0x7d94('0xe4')][_0x7d94('0x11d')](db[_0x7d94('0x1e0')],{'foreignKey':_0x7d94('0x1e1')});db[_0x7d94('0xe4')][_0x7d94('0x11d')](db['JscriptyAnswerReport'],{'foreignKey':_0x7d94('0x1e1')});db[_0x7d94('0x1e2')][_0x7d94('0x130')](db[_0x7d94('0x13')],{'as':'Users','through':_0x7d94('0x155')});db['Team'][_0x7d94('0x130')](db[_0x7d94('0x13')],{'as':'Agents','through':'user_has_teams'});db[_0x7d94('0x17f')][_0x7d94('0x130')](db[_0x7d94('0x1b')],{'through':_0x7d94('0x113'),'as':_0x7d94('0x13d')});db[_0x7d94('0x17f')][_0x7d94('0x130')](db[_0x7d94('0x3c')],{'through':_0x7d94('0x180'),'as':_0x7d94('0x140')});db['Team'][_0x7d94('0x130')](db['ChatQueue'],{'through':'team_has_chat_queues','as':_0x7d94('0x142')});db['Team'][_0x7d94('0x130')](db['FaxQueue'],{'through':_0x7d94('0x193'),'as':_0x7d94('0x143')});db[_0x7d94('0x17f')][_0x7d94('0x130')](db[_0x7d94('0x58')],{'through':'team_has_sms_queues','as':'SmsQueues'});db['Team'][_0x7d94('0x130')](db['OpenchannelQueue'],{'through':_0x7d94('0x1e3'),'as':_0x7d94('0x1e4')});db['Team'][_0x7d94('0x130')](db['WhatsappQueue'],{'through':'team_has_whatsapp_queues','as':'WhatsappQueues'});db[_0x7d94('0x17f')]['belongsToMany'](db[_0x7d94('0x13e')],{'through':_0x7d94('0x115'),'as':_0x7d94('0x13f')});db[_0x7d94('0xee')][_0x7d94('0x11d')](db[_0x7d94('0x74')],{'as':'Hoppers','foreignKey':_0x7d94('0x1ad')});db[_0x7d94('0xee')][_0x7d94('0x11d')](db[_0x7d94('0x77')],{'as':'HopperFinals','foreignKey':_0x7d94('0x1ad')});db[_0x7d94('0xee')][_0x7d94('0x11d')](db[_0x7d94('0x79')],{'as':'HopperHistories','foreignKey':'CampaignId'});db[_0x7d94('0xee')][_0x7d94('0x11d')](db[_0x7d94('0x75')],{'as':_0x7d94('0x1e5'),'foreignKey':_0x7d94('0x1ad')});db['Campaign']['belongsTo'](db[_0x7d94('0x160')],{'as':_0x7d94('0x160'),'foreignKey':_0x7d94('0x1e6')});db[_0x7d94('0xee')][_0x7d94('0x12e')](db[_0x7d94('0x160')],{'as':_0x7d94('0x161'),'foreignKey':_0x7d94('0x162')});db[_0x7d94('0xee')]['belongsTo'](db['Interval'],{'as':_0x7d94('0x87'),'foreignKey':_0x7d94('0x163')});db[_0x7d94('0xee')][_0x7d94('0x12e')](db[_0x7d94('0x1e2')],{'as':_0x7d94('0x1e2'),'foreignKey':_0x7d94('0x1e7')});db[_0x7d94('0xee')]['belongsToMany'](db[_0x7d94('0x146')],{'as':_0x7d94('0x135'),'through':_0x7d94('0x1e8')});db[_0x7d94('0xee')][_0x7d94('0x130')](db['CmList'],{'as':_0x7d94('0x169'),'through':_0x7d94('0x1e9')});db['Attachment'][_0x7d94('0x12e')](db[_0x7d94('0x18a')],{'as':_0x7d94('0x18a'),'foreignKey':_0x7d94('0x1a6')});db['MailTransferReport'][_0x7d94('0x12e')](db[_0x7d94('0x3f')],{});db[_0x7d94('0xf6')][_0x7d94('0x12e')](db[_0x7d94('0x128')],{});db[_0x7d94('0xf6')][_0x7d94('0x12e')](db[_0x7d94('0x3a')],{'foreignKey':_0x7d94('0x1ea'),'as':_0x7d94('0x1eb')});db[_0x7d94('0xf6')][_0x7d94('0x12e')](db[_0x7d94('0x13')],{'foreignKey':_0x7d94('0x1ec'),'as':_0x7d94('0x1ed')});db[_0x7d94('0xf6')][_0x7d94('0x12e')](db[_0x7d94('0x13')],{'foreignKey':_0x7d94('0x1ee'),'as':'ToAgent'});db[_0x7d94('0xf6')][_0x7d94('0x12e')](db[_0x7d94('0x3c')],{'foreignKey':_0x7d94('0x1ef'),'as':_0x7d94('0x1f0')});db[_0x7d94('0xf6')][_0x7d94('0x12e')](db[_0x7d94('0x3a')],{'foreignKey':'ToMailAccountId','as':'ToAccount'});db[_0x7d94('0x1f1')][_0x7d94('0x12e')](db[_0x7d94('0x68')],{});db[_0x7d94('0x1f1')][_0x7d94('0x12e')](db[_0x7d94('0x66')],{});db[_0x7d94('0x1f1')][_0x7d94('0x12e')](db['ChatWebsite'],{'foreignKey':'FromChatWebsiteId','as':_0x7d94('0x1eb')});db['ChatTransferReport'][_0x7d94('0x12e')](db[_0x7d94('0x13')],{'foreignKey':_0x7d94('0x1ec'),'as':_0x7d94('0x1ed')});db[_0x7d94('0x1f1')][_0x7d94('0x12e')](db[_0x7d94('0x13')],{'foreignKey':'ToUserId','as':_0x7d94('0x1f2')});db[_0x7d94('0x1f1')][_0x7d94('0x12e')](db[_0x7d94('0x6b')],{'foreignKey':_0x7d94('0x1f3'),'as':_0x7d94('0x1f0')});db[_0x7d94('0x1f1')][_0x7d94('0x12e')](db['ChatWebsite'],{'foreignKey':'ToChatWebsiteId','as':_0x7d94('0x1f4')});db[_0x7d94('0xf8')][_0x7d94('0x12e')](db['FaxMessage'],{});db['FaxTransferReport'][_0x7d94('0x12e')](db['FaxInteraction'],{});db['FaxTransferReport'][_0x7d94('0x12e')](db[_0x7d94('0x149')],{'foreignKey':_0x7d94('0x1f5'),'as':_0x7d94('0x1eb')});db[_0x7d94('0xf8')]['belongsTo'](db[_0x7d94('0x13')],{'foreignKey':'FromUserId','as':_0x7d94('0x1ed')});db[_0x7d94('0xf8')][_0x7d94('0x12e')](db[_0x7d94('0x13')],{'foreignKey':_0x7d94('0x1ee'),'as':'ToAgent'});db['FaxTransferReport'][_0x7d94('0x12e')](db[_0x7d94('0x4e')],{'foreignKey':_0x7d94('0x1f6'),'as':_0x7d94('0x1f0')});db[_0x7d94('0xf8')][_0x7d94('0x12e')](db[_0x7d94('0x149')],{'foreignKey':'ToFaxAccountId','as':'ToAccount'});db['OpenchannelTransferReport'][_0x7d94('0x12e')](db['OpenchannelMessage'],{});db[_0x7d94('0xfa')][_0x7d94('0x12e')](db['OpenchannelInteraction'],{});db[_0x7d94('0xfa')]['belongsTo'](db[_0x7d94('0x14d')],{'foreignKey':_0x7d94('0x1f7'),'as':'FromAccount'});db[_0x7d94('0xfa')]['belongsTo'](db[_0x7d94('0x13')],{'foreignKey':_0x7d94('0x1ec'),'as':_0x7d94('0x1ed')});db[_0x7d94('0xfa')][_0x7d94('0x12e')](db[_0x7d94('0x13')],{'foreignKey':_0x7d94('0x1ee'),'as':_0x7d94('0x1f2')});db[_0x7d94('0xfa')][_0x7d94('0x12e')](db['OpenchannelQueue'],{'foreignKey':_0x7d94('0x1f8'),'as':'ToQueue'});db[_0x7d94('0xfa')][_0x7d94('0x12e')](db[_0x7d94('0x14d')],{'foreignKey':_0x7d94('0x1f9'),'as':_0x7d94('0x1f4')});db[_0x7d94('0xfc')][_0x7d94('0x12e')](db[_0x7d94('0x57')],{});db[_0x7d94('0xfc')]['belongsTo'](db[_0x7d94('0x56')],{});db[_0x7d94('0xfc')]['belongsTo'](db[_0x7d94('0x52')],{'foreignKey':_0x7d94('0x1fa'),'as':_0x7d94('0x1eb')});db[_0x7d94('0xfc')]['belongsTo'](db[_0x7d94('0x13')],{'foreignKey':_0x7d94('0x1ec'),'as':'FromAgent'});db[_0x7d94('0xfc')]['belongsTo'](db[_0x7d94('0x13')],{'foreignKey':_0x7d94('0x1ee'),'as':_0x7d94('0x1f2')});db[_0x7d94('0xfc')]['belongsTo'](db['SmsQueue'],{'foreignKey':_0x7d94('0x1fb'),'as':_0x7d94('0x1f0')});db['SmsTransferReport'][_0x7d94('0x12e')](db[_0x7d94('0x52')],{'foreignKey':_0x7d94('0x1fc'),'as':_0x7d94('0x1f4')});db[_0x7d94('0x146')][_0x7d94('0x11d')](db['Disposition'],{'as':_0x7d94('0x17a'),'foreignKey':'ListId','onDelete':_0x7d94('0x11b')});db[_0x7d94('0x146')][_0x7d94('0x11d')](db[_0x7d94('0x7d')],{'as':_0x7d94('0x1fd'),'foreignKey':'ListId'});db['CmList'][_0x7d94('0x11d')](db[_0x7d94('0x173')],{'as':_0x7d94('0x133'),'onDelete':_0x7d94('0x11b'),'foreignKey':'ListId'});db['CmList']['hasMany'](db['CmHopperFinal'],{'as':_0x7d94('0x122'),'foreignKey':_0x7d94('0x17d')});db[_0x7d94('0x146')][_0x7d94('0x11d')](db['CmHopperHistory'],{'as':_0x7d94('0x123'),'foreignKey':_0x7d94('0x17d')});db[_0x7d94('0x146')]['hasMany'](db[_0x7d94('0x7b')],{'as':'ReportAgentPreview','foreignKey':_0x7d94('0x17d')});db['CmList'][_0x7d94('0x130')](db['VoiceQueue'],{'as':'Queues','through':_0x7d94('0x166')});db[_0x7d94('0x146')][_0x7d94('0x130')](db['User'],{'as':_0x7d94('0x167'),'through':_0x7d94('0x136')});db['VoicePrefix'][_0x7d94('0x11d')](db[_0x7d94('0x120')],{'as':_0x7d94('0x121'),'onDelete':_0x7d94('0x11b')});db[_0x7d94('0x13e')]['belongsToMany'](db[_0x7d94('0x13')],{'as':_0x7d94('0x167'),'through':_0x7d94('0x117')});db[_0x7d94('0x13e')][_0x7d94('0x130')](db[_0x7d94('0x17f')],{'through':_0x7d94('0x115'),'as':_0x7d94('0x168')});db[_0x7d94('0x100')][_0x7d94('0x11d')](db[_0x7d94('0x13')],{'as':'Users','foreignKey':_0x7d94('0x12f')});db[_0x7d94('0x100')][_0x7d94('0x11d')](db[_0x7d94('0x102')],{'as':_0x7d94('0x1fe'),'foreignKey':_0x7d94('0x12f'),'onDelete':_0x7d94('0x11b')});db[_0x7d94('0x102')]['hasMany'](db[_0x7d94('0x103')],{'as':_0x7d94('0x1ff'),'foreignKey':_0x7d94('0x200'),'onDelete':_0x7d94('0x11b')});db[_0x7d94('0x106')]['hasMany'](db[_0x7d94('0x84')],{'as':_0x7d94('0x17a'),'foreignKey':_0x7d94('0x201'),'onDelete':_0x7d94('0x11b')});db[_0x7d94('0x106')][_0x7d94('0x11d')](db['CannedAnswer'],{'as':_0x7d94('0x18d'),'foreignKey':'WhatsappAccountId'});db['WhatsappAccount'][_0x7d94('0x11d')](db[_0x7d94('0x10a')],{'as':'Messages','foreignKey':_0x7d94('0x201')});db[_0x7d94('0x106')][_0x7d94('0x11d')](db[_0x7d94('0x108')],{'as':_0x7d94('0x17b')});db['WhatsappAccount'][_0x7d94('0x11d')](db['WhatsappApplication'],{'as':_0x7d94('0x158')});db[_0x7d94('0x106')]['belongsTo'](db['CmList'],{'as':_0x7d94('0x17c'),'foreignKey':'ListId'});db['WhatsappAccount'][_0x7d94('0x12e')](db['Pause'],{'as':_0x7d94('0x164'),'foreignKey':_0x7d94('0x165')});db[_0x7d94('0x106')][_0x7d94('0x130')](db['User'],{'as':_0x7d94('0x167'),'through':_0x7d94('0x153')});db[_0x7d94('0x202')][_0x7d94('0x12e')](db['User'],{'onDelete':'restrict'});db[_0x7d94('0x202')][_0x7d94('0x12e')](db['WhatsappQueue'],{'onDelete':_0x7d94('0x178')});db['WhatsappApplication']['belongsTo'](db[_0x7d94('0x106')],{'onDelete':_0x7d94('0x178')});db['WhatsappApplication'][_0x7d94('0x12e')](db[_0x7d94('0x87')],{'onDelete':'restrict','foreignKey':_0x7d94('0x163')});db[_0x7d94('0x202')][_0x7d94('0x12e')](db[_0x7d94('0x90')],{'onDelete':_0x7d94('0x178'),'foreignKey':'TagId'});db[_0x7d94('0x108')][_0x7d94('0x11d')](db['WhatsappMessage'],{'as':_0x7d94('0x16c'),'onDelete':_0x7d94('0x11b'),'foreignKey':_0x7d94('0x203')});db[_0x7d94('0x108')]['belongsTo'](db['WhatsappAccount'],{'as':_0x7d94('0x182'),'foreignKey':_0x7d94('0x201')});db[_0x7d94('0x108')]['belongsTo'](db[_0x7d94('0x173')],{'as':'Contact','foreignKey':_0x7d94('0x175')});db[_0x7d94('0x108')]['belongsTo'](db[_0x7d94('0x13')],{'as':'Owner','foreignKey':_0x7d94('0x11e')});db[_0x7d94('0x108')][_0x7d94('0x130')](db[_0x7d94('0x90')],{'through':_0x7d94('0x1c1'),'as':_0x7d94('0x185')});db[_0x7d94('0x108')]['belongsToMany'](db[_0x7d94('0x90')],{'through':_0x7d94('0x1c1'),'as':_0x7d94('0x186')});db[_0x7d94('0x108')][_0x7d94('0x130')](db[_0x7d94('0x13')],{'as':'Users','through':_0x7d94('0x13c'),'foreignKey':_0x7d94('0x203')});db['WhatsappMessage'][_0x7d94('0x12e')](db[_0x7d94('0x13')],{'as':_0x7d94('0x13')});db[_0x7d94('0x10a')]['belongsTo'](db[_0x7d94('0x173')],{'onDelete':_0x7d94('0x11b'),'as':'Contact'});db[_0x7d94('0x10a')]['belongsTo'](db[_0x7d94('0x108')],{'onDelete':_0x7d94('0x11b'),'as':_0x7d94('0x189'),'foreignKey':'WhatsappInteractionId'});db[_0x7d94('0x10a')][_0x7d94('0x12e')](db[_0x7d94('0x106')],{'as':_0x7d94('0x182'),'foreignKey':_0x7d94('0x201')});db[_0x7d94('0x10c')][_0x7d94('0x12e')](db[_0x7d94('0x106')],{});db[_0x7d94('0x10c')]['belongsTo'](db[_0x7d94('0x146')],{'as':_0x7d94('0x17c'),'foreignKey':_0x7d94('0x17d')});db['WhatsappQueueReport'][_0x7d94('0x12e')](db[_0x7d94('0x173')],{'as':_0x7d94('0x174'),'foreignKey':_0x7d94('0x175')});db[_0x7d94('0x10c')][_0x7d94('0x12e')](db['WhatsappInteraction'],{});db['WhatsappQueueReport'][_0x7d94('0x12e')](db['WhatsappQueue'],{});db['WhatsappQueueReport'][_0x7d94('0x12e')](db['WhatsappMessage'],{});db['WhatsappQueueReport'][_0x7d94('0x12e')](db[_0x7d94('0x13')],{});db['WhatsappTransferReport'][_0x7d94('0x12e')](db['WhatsappMessage'],{});db['WhatsappTransferReport'][_0x7d94('0x12e')](db[_0x7d94('0x108')],{});db[_0x7d94('0x10e')][_0x7d94('0x12e')](db[_0x7d94('0x106')],{'foreignKey':_0x7d94('0x204'),'as':'FromAccount'});db[_0x7d94('0x10e')][_0x7d94('0x12e')](db[_0x7d94('0x106')],{'foreignKey':_0x7d94('0x205'),'as':_0x7d94('0x1f4')});db[_0x7d94('0x10e')][_0x7d94('0x12e')](db[_0x7d94('0x144')],{'foreignKey':_0x7d94('0x206'),'as':_0x7d94('0x1f0')});db['WhatsappTransferReport'][_0x7d94('0x12e')](db[_0x7d94('0x13')],{'foreignKey':_0x7d94('0x1ec'),'as':_0x7d94('0x1ed')});db[_0x7d94('0x10e')][_0x7d94('0x12e')](db[_0x7d94('0x13')],{'foreignKey':_0x7d94('0x1ee'),'as':_0x7d94('0x1f2')});db[_0x7d94('0x144')]['belongsToMany'](db[_0x7d94('0x13')],{'as':_0x7d94('0x167'),'through':'UserWhatsappQueue','foreignKey':'WhatsappQueueId'});db[_0x7d94('0x144')][_0x7d94('0x130')](db['Team'],{'through':_0x7d94('0x207'),'as':_0x7d94('0x168')});db[_0x7d94('0x118')][_0x7d94('0x12e')](db[_0x7d94('0x13')],{'as':_0x7d94('0x208'),'foreignKey':'UserId','onDelete':'cascade','hooks':!![]});db[_0x7d94('0x111')][_0x7d94('0x11a')](db[_0x7d94('0xd0')],{'as':_0x7d94('0xd0'),'onDelete':_0x7d94('0x178')});db[_0x7d94('0x111')][_0x7d94('0x11a')](db[_0x7d94('0x37')],{'as':_0x7d94('0x179'),'onDelete':'restrict'});db[_0x7d94('0x111')][_0x7d94('0x11a')](db[_0x7d94('0x38')],{'as':_0x7d94('0x209'),'onDelete':'restrict'});module[_0x7d94('0x20a')]={'db':db,'dbH':dbH};
\ No newline at end of file
index 5cbf00d..bbf754f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0bb=['/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','./api/smsAccount','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','./api/integrationReport','/api/analytics/default_reports','/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/integrations/salesforce/configurations','./api/intSalesforceConfiguration','./api/intSalesforceField','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','/api/networks','./api/network','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/squareReport','/api/settings','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','/api/teams','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','/api/chat/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/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/whatsapp/applications','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','/api/user-settings','./api/user-setting','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','join','root','static','/www','/demo','/snippet','snippet','/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','appPath','path','express','./errors','./utils/client-side-logger','./api/client-side-logs','default','then','/api/users','./api/user','use','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','./api/voiceQueue','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','./api/voiceCallReport','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','/api/mail/queues','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','/api/fax/applications','./api/faxApplication','./api/faxInteraction','/api/fax/messages','./api/faxMessage'];(function(_0x456032,_0x1a799d){var _0x1a53cd=function(_0x162cc8){while(--_0x162cc8){_0x456032['push'](_0x456032['shift']());}};_0x1a53cd(++_0x1a799d);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x4e96a4,_0x207e09){_0x4e96a4=_0x4e96a4-0x0;var _0x1beafa=_0xd0bb[_0x4e96a4];return _0x1beafa;};'use strict';var path=require(_0xbd0b('0x0'));var express=require(_0xbd0b('0x1'));var errors=require(_0xbd0b('0x2'));var config=require('./config/environment');var setupLoggers=require(_0xbd0b('0x3'))['setupLoggers'];var clientSideLogs=require(_0xbd0b('0x4'));exports[_0xbd0b('0x5')]=function(_0x53e6ce){return setupLoggers(_0x53e6ce)[_0xbd0b('0x6')](function(){_0x53e6ce['use'](_0xbd0b('0x7'),require(_0xbd0b('0x8')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xa'),require(_0xbd0b('0xb')));_0x53e6ce['use'](_0xbd0b('0xc'),require(_0xbd0b('0xd')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xe'),require(_0xbd0b('0xf')));_0x53e6ce['use']('/api/voice/mohs',require(_0xbd0b('0x10')));_0x53e6ce[_0xbd0b('0x9')]('/api/voice/queues',require(_0xbd0b('0x11')));_0x53e6ce[_0xbd0b('0x9')]('/api/voice/recordings',require(_0xbd0b('0x12')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x13'),require(_0xbd0b('0x14')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x15'),require(_0xbd0b('0x16')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x17'),require(_0xbd0b('0x18')));_0x53e6ce[_0xbd0b('0x9')]('/api/voice/calls/reports',require(_0xbd0b('0x19')));_0x53e6ce['use']('/api/voice/dials/reports',require(_0xbd0b('0x1a')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x1b'),require(_0xbd0b('0x1c')));_0x53e6ce[_0xbd0b('0x9')]('/api/voice/queues/reports',require('./api/voiceQueueReport'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x1d'),require(_0xbd0b('0x1e')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x1f'),require(_0xbd0b('0x20')));_0x53e6ce['use'](_0xbd0b('0x21'),require('./api/voiceTransferReport'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x22'),require(_0xbd0b('0x23')));_0x53e6ce[_0xbd0b('0x9')]('/api/mail/accounts',require(_0xbd0b('0x24')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x25'),require('./api/mailQueue'));_0x53e6ce[_0xbd0b('0x9')]('/api/mail/substatuses',require(_0xbd0b('0x26')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x27'),require(_0xbd0b('0x28')));_0x53e6ce[_0xbd0b('0x9')]('/api/mail/messages',require(_0xbd0b('0x29')));_0x53e6ce['use'](_0xbd0b('0x2a'),require(_0xbd0b('0x2b')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x2c'),require(_0xbd0b('0x2d')));_0x53e6ce[_0xbd0b('0x9')]('/api/dashboards',require(_0xbd0b('0x2e')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x2f'),require(_0xbd0b('0x30')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x31'),require('./api/faxAccount'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x32'),require(_0xbd0b('0x33')));_0x53e6ce['use']('/api/fax/interactions',require(_0xbd0b('0x34')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x35'),require(_0xbd0b('0x36')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x37'),require(_0xbd0b('0x38')));_0x53e6ce['use'](_0xbd0b('0x39'),require(_0xbd0b('0x3a')));_0x53e6ce['use']('/api/sms/accounts',require(_0xbd0b('0x3b')));_0x53e6ce[_0xbd0b('0x9')]('/api/sms/applications',require(_0xbd0b('0x3c')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x3d'),require(_0xbd0b('0x3e')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x3f'),require('./api/smsMessage'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x40'),require(_0xbd0b('0x41')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x42'),require(_0xbd0b('0x43')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x44'),require(_0xbd0b('0x45')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x46'),require(_0xbd0b('0x47')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x48'),require('./api/openchannelMessage'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x49'),require('./api/openchannelQueue'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x4a'),require(_0xbd0b('0x4b')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x4c'),require(_0xbd0b('0x4d')));_0x53e6ce['use'](_0xbd0b('0x4e'),require(_0xbd0b('0x4f')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x50'),require(_0xbd0b('0x51')));_0x53e6ce['use']('/api/chat/messages',require(_0xbd0b('0x52')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x53'),require(_0xbd0b('0x54')));_0x53e6ce['use']('/api/chat/queues',require(_0xbd0b('0x55')));_0x53e6ce['use'](_0xbd0b('0x56'),require(_0xbd0b('0x57')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x58'),require(_0xbd0b('0x59')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x5a'),require(_0xbd0b('0x5b')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x5c'),require(_0xbd0b('0x5d')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x5e'),require(_0xbd0b('0x5f')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x60'),require(_0xbd0b('0x61')));_0x53e6ce[_0xbd0b('0x9')]('/api/cm/hopper_final',require(_0xbd0b('0x62')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x63'),require(_0xbd0b('0x64')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x65'),require(_0xbd0b('0x66')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x67'),require(_0xbd0b('0x68')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x69'),require('./api/automation'));_0x53e6ce[_0xbd0b('0x9')]('/api/canned_answers',require('./api/cannedAnswer'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x6a'),require(_0xbd0b('0x6b')));_0x53e6ce['use'](_0xbd0b('0x6c'),require(_0xbd0b('0x6d')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x6e'),require(_0xbd0b('0x6f')));_0x53e6ce['use'](_0xbd0b('0x70'),require(_0xbd0b('0x71')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x72'),require(_0xbd0b('0x73')));_0x53e6ce[_0xbd0b('0x9')]('/api/voiceQueuesLog',require(_0xbd0b('0x74')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x75'),require(_0xbd0b('0x76')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x77'),require(_0xbd0b('0x78')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x79'),require(_0xbd0b('0x7a')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x7b'),require(_0xbd0b('0x7c')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x7d'),require(_0xbd0b('0x7e')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x7f'),require(_0xbd0b('0x80')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x81'),require(_0xbd0b('0x82')));_0x53e6ce[_0xbd0b('0x9')]('/api/integrations/reports',require(_0xbd0b('0x83')));_0x53e6ce[_0xbd0b('0x9')]('/api/analytics/custom_reports',require('./api/analyticCustomReport'));_0x53e6ce['use'](_0xbd0b('0x84'),require('./api/analyticDefaultReport'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x85'),require(_0xbd0b('0x86')));_0x53e6ce[_0xbd0b('0x9')]('/api/analytics/metrics',require(_0xbd0b('0x87')));_0x53e6ce['use'](_0xbd0b('0x88'),require('./api/analyticFieldReport'));_0x53e6ce['use'](_0xbd0b('0x89'),require(_0xbd0b('0x8a')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x8b'),require(_0xbd0b('0x8c')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x8d'),require(_0xbd0b('0x8e')));_0x53e6ce['use']('/api/integrations/salesforce/fields',require(_0xbd0b('0x8f')));_0x53e6ce[_0xbd0b('0x9')]('/api/integrations/sugarcrm/accounts',require('./api/intSugarcrmAccount'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x90'),require(_0xbd0b('0x91')));_0x53e6ce[_0xbd0b('0x9')]('/api/integrations/sugarcrm/fields',require(_0xbd0b('0x92')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x93'),require(_0xbd0b('0x94')));_0x53e6ce['use'](_0xbd0b('0x95'),require(_0xbd0b('0x96')));_0x53e6ce['use'](_0xbd0b('0x97'),require(_0xbd0b('0x98')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x99'),require(_0xbd0b('0x9a')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x9b'),require(_0xbd0b('0x9c')));_0x53e6ce['use'](_0xbd0b('0x9d'),require(_0xbd0b('0x9e')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x9f'),require(_0xbd0b('0xa0')));_0x53e6ce[_0xbd0b('0x9')]('/api/integrations/zendesk/configurations',require('./api/intZendeskConfiguration'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xa1'),require('./api/intZendeskField'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xa2'),require(_0xbd0b('0xa3')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xa4'),require('./api/intFreshdeskConfiguration'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xa5'),require(_0xbd0b('0xa6')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xa7'),require(_0xbd0b('0xa8')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xa9'),require(_0xbd0b('0xaa')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xab'),require(_0xbd0b('0xac')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xad'),require(_0xbd0b('0xae')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xaf'),require('./api/intServicenowConfiguration'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xb0'),require(_0xbd0b('0xb1')));_0x53e6ce[_0xbd0b('0x9')]('/api/integrations/dynamics365/accounts',require('./api/intDynamics365Account'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xb2'),require(_0xbd0b('0xb3')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xb4'),require('./api/intDynamics365Field'));_0x53e6ce[_0xbd0b('0x9')]('/api/integrations/freshsales/accounts',require(_0xbd0b('0xb5')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xb6'),require(_0xbd0b('0xb7')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xb8'),require('./api/intFreshsalesField'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xb9'),require(_0xbd0b('0xba')));_0x53e6ce[_0xbd0b('0x9')]('/api/chat/reports/queue',require(_0xbd0b('0xbb')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xbc'),require(_0xbd0b('0xbd')));_0x53e6ce[_0xbd0b('0x9')]('/api/jscripty/answers/reports',require('./api/jscriptyAnswerReport'));_0x53e6ce[_0xbd0b('0x9')]('/api/jscripty/questions/reports',require(_0xbd0b('0xbe')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xbf'),require(_0xbd0b('0xc0')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xc1'),require('./api/smsQueueReport'));_0x53e6ce[_0xbd0b('0x9')]('/api/square/reports',require(_0xbd0b('0xc2')));_0x53e6ce['use']('/api/square/details/reports',require('./api/squareReportDetail'));_0x53e6ce[_0xbd0b('0x9')]('/api/jscripty/projects',require('./api/jscriptyProject'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xc3'),require('./api/setting'));_0x53e6ce[_0xbd0b('0x9')]('/api/square/odbc',require('./api/squareOdbc'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xc4'),require(_0xbd0b('0xc5')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xc6'),require(_0xbd0b('0xc7')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xc8'),require('./api/squareMessage'));_0x53e6ce['use'](_0xbd0b('0xc9'),require('./api/team'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xca'),require(_0xbd0b('0xcb')));_0x53e6ce['use'](_0xbd0b('0xcc'),require(_0xbd0b('0xcd')));_0x53e6ce['use'](_0xbd0b('0xce'),require(_0xbd0b('0xcf')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xd0'),require(_0xbd0b('0xd1')));_0x53e6ce['use'](_0xbd0b('0xd2'),require(_0xbd0b('0xd3')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xd4'),require('./api/mailTransferReport'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xd5'),require('./api/chatTransferReport'));_0x53e6ce[_0xbd0b('0x9')]('/api/fax/reports/transfer',require(_0xbd0b('0xd6')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xd7'),require(_0xbd0b('0xd8')));_0x53e6ce[_0xbd0b('0x9')]('/api/sms/reports/transfer',require('./api/smsTransferReport'));_0x53e6ce['use'](_0xbd0b('0xd9'),require(_0xbd0b('0xda')));_0x53e6ce[_0xbd0b('0x9')]('/api/voice/prefixes',require(_0xbd0b('0xdb')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xdc'),require(_0xbd0b('0xdd')));_0x53e6ce[_0xbd0b('0x9')]('/api/userProfile/sections',require(_0xbd0b('0xde')));_0x53e6ce['use'](_0xbd0b('0xdf'),require(_0xbd0b('0xe0')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xe1'),require(_0xbd0b('0xe2')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xe3'),require(_0xbd0b('0xe4')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xe5'),require('./api/whatsappApplication'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xe6'),require(_0xbd0b('0xe7')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xe8'),require(_0xbd0b('0xe9')));_0x53e6ce[_0xbd0b('0x9')]('/api/whatsapp/reports/queue',require(_0xbd0b('0xea')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xeb'),require('./api/whatsappTransferReport'));_0x53e6ce[_0xbd0b('0x9')]('/api/whatsapp/queues',require(_0xbd0b('0xec')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xed'),require(_0xbd0b('0xee')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xef'),require('./api/realtime'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xf0'),require(_0xbd0b('0xf1')));_0x53e6ce[_0xbd0b('0x9')]('/api/auth/local',require(_0xbd0b('0xf2')));_0x53e6ce['use'](_0xbd0b('0xf3'),require(_0xbd0b('0xf4')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xf5'),require(_0xbd0b('0xf6')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xf7'),require(_0xbd0b('0xf8')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xf9'),require(_0xbd0b('0xfa')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xfb'),require('./api/version'));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xfc'),require(_0xbd0b('0xfd')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0xfe'),require(_0xbd0b('0xff')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x100'),require(_0xbd0b('0x101')));_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x102'),clientSideLogs);_0x53e6ce[_0xbd0b('0x9')](_0xbd0b('0x103'),express['static'](path[_0xbd0b('0x104')](config[_0xbd0b('0x105')],_0xbd0b('0x103'))));_0x53e6ce[_0xbd0b('0x9')]('/www',express[_0xbd0b('0x106')](path[_0xbd0b('0x104')](config[_0xbd0b('0x105')],_0xbd0b('0x107'))));_0x53e6ce[_0xbd0b('0x9')]('/demo',express['static'](path[_0xbd0b('0x104')](config[_0xbd0b('0x105')],_0xbd0b('0x108'))));_0x53e6ce['use'](_0xbd0b('0x109'),express[_0xbd0b('0x106')](path[_0xbd0b('0x104')](config['root'],_0xbd0b('0x10a'),'3.0.0')));_0x53e6ce['use'](_0xbd0b('0x10b'),express['static'](path['join'](config[_0xbd0b('0x105')],'/server/files/plugins')));_0x53e6ce[_0xbd0b('0x10c')](_0xbd0b('0x10d'))['get'](errors[0x194]);_0x53e6ce[_0xbd0b('0x10c')]('/*')[_0xbd0b('0x10e')](function(_0x314373,_0xec1979){_0xec1979[_0xbd0b('0x10f')](path['resolve'](_0x53e6ce[_0xbd0b('0x10e')](_0xbd0b('0x110'))+'/index.html'));});return _0x53e6ce;});};
\ No newline at end of file
+var _0x0e85=['/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskAccount','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerConfiguration','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','/api/settings','./api/setting','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','/api/square/messages','./api/squareMessage','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','./api/plugin','./api/mailTransferReport','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/cmList','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/interactions','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','/api/cloudProviders','./api/realtime','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','/api/auth/activedirectory','./api/authActiveDirectory','/api/rpc','./api/rpc','/api/version','./api/version','/api/pm2','./api/pm2','/api/webbar','/api/logs','join','root','/apidoc','/www','static','/demo','/snippet','3.0.0','/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','appPath','/index.html','path','express','./config/environment','./utils/client-side-logger','use','/api/users','./api/user','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','/api/screen/recordings','./api/screenRecording','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','/api/mail/accounts','./api/mailAccount','/api/mail/queues','/api/mail/substatuses','/api/mail/interactions','/api/mail/messages','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','./api/smsApplication','/api/sms/interactions','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelApplication','/api/openchannel/interactions','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','/api/chat/proactive_actions','./api/chatProactiveAction','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper_black','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','./api/action','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/condition','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/voiceQueuesLog','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./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/intSugarcrmAccount'];(function(_0x2d0040,_0x39a852){var _0x128689=function(_0x28516f){while(--_0x28516f){_0x2d0040['push'](_0x2d0040['shift']());}};_0x128689(++_0x39a852);}(_0x0e85,0x7c));var _0x50e8=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0x0e85[_0x500419];return _0x241c1a;};'use strict';var path=require(_0x50e8('0x0'));var express=require(_0x50e8('0x1'));var errors=require('./errors');var config=require(_0x50e8('0x2'));var setupLoggers=require(_0x50e8('0x3'))['setupLoggers'];var clientSideLogs=require('./api/client-side-logs');exports['default']=function(_0x236cf3){return setupLoggers(_0x236cf3)['then'](function(){_0x236cf3[_0x50e8('0x4')](_0x50e8('0x5'),require(_0x50e8('0x6')));_0x236cf3[_0x50e8('0x4')]('/api/voice/chanspy',require(_0x50e8('0x7')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x8'),require(_0x50e8('0x9')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0xa'),require('./api/voiceExtension'));_0x236cf3[_0x50e8('0x4')](_0x50e8('0xb'),require(_0x50e8('0xc')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0xd'),require(_0x50e8('0xe')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0xf'),require('./api/voiceRecording'));_0x236cf3['use'](_0x50e8('0x10'),require(_0x50e8('0x11')));_0x236cf3['use']('/api/voice/mails',require(_0x50e8('0x12')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x13'),require(_0x50e8('0x14')));_0x236cf3['use'](_0x50e8('0x15'),require(_0x50e8('0x16')));_0x236cf3[_0x50e8('0x4')]('/api/voice/dials/reports',require('./api/voiceDialReport'));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x17'),require(_0x50e8('0x18')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x19'),require(_0x50e8('0x1a')));_0x236cf3['use']('/api/members/reports',require(_0x50e8('0x1b')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x1c'),require(_0x50e8('0x1d')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x1e'),require(_0x50e8('0x1f')));_0x236cf3['use'](_0x50e8('0x20'),require('./api/mailServerOut'));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x21'),require(_0x50e8('0x22')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x23'),require('./api/mailQueue'));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x24'),require('./api/mailSubstatus'));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x25'),require('./api/mailInteraction'));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x26'),require('./api/mailMessage'));_0x236cf3['use']('/api/mail/applications',require(_0x50e8('0x27')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x28'),require(_0x50e8('0x29')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x2a'),require('./api/dashboard'));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x2b'),require('./api/dashboardItem'));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x2c'),require(_0x50e8('0x2d')));_0x236cf3[_0x50e8('0x4')]('/api/fax/applications',require(_0x50e8('0x2e')));_0x236cf3['use'](_0x50e8('0x2f'),require(_0x50e8('0x30')));_0x236cf3[_0x50e8('0x4')]('/api/fax/messages',require(_0x50e8('0x31')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x32'),require(_0x50e8('0x33')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x34'),require(_0x50e8('0x35')));_0x236cf3['use'](_0x50e8('0x36'),require(_0x50e8('0x37')));_0x236cf3['use']('/api/sms/applications',require(_0x50e8('0x38')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x39'),require('./api/smsInteraction'));_0x236cf3['use'](_0x50e8('0x3a'),require(_0x50e8('0x3b')));_0x236cf3['use'](_0x50e8('0x3c'),require(_0x50e8('0x3d')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x3e'),require('./api/openchannelAccount'));_0x236cf3[_0x50e8('0x4')]('/api/openchannel/applications',require(_0x50e8('0x3f')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x40'),require('./api/openchannelInteraction'));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x41'),require('./api/openchannelMessage'));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x42'),require(_0x50e8('0x43')));_0x236cf3[_0x50e8('0x4')]('/api/chat/websites',require(_0x50e8('0x44')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x45'),require(_0x50e8('0x46')));_0x236cf3['use'](_0x50e8('0x47'),require(_0x50e8('0x48')));_0x236cf3[_0x50e8('0x4')]('/api/chat/interactions',require('./api/chatInteraction'));_0x236cf3['use'](_0x50e8('0x49'),require(_0x50e8('0x4a')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x4b'),require(_0x50e8('0x4c')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x4d'),require(_0x50e8('0x4e')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x4f'),require('./api/chatGroup'));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x50'),require(_0x50e8('0x51')));_0x236cf3[_0x50e8('0x4')]('/api/cm/companies',require(_0x50e8('0x52')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x53'),require(_0x50e8('0x54')));_0x236cf3[_0x50e8('0x4')]('/api/cm/hopper',require('./api/cmHopper'));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x55'),require('./api/cmHopperBlack'));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x56'),require(_0x50e8('0x57')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x58'),require(_0x50e8('0x59')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x5a'),require('./api/cmCustomField'));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x5b'),require(_0x50e8('0x5c')));_0x236cf3[_0x50e8('0x4')]('/api/automations',require(_0x50e8('0x5d')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x5e'),require(_0x50e8('0x5f')));_0x236cf3['use'](_0x50e8('0x60'),require('./api/disposition'));_0x236cf3['use']('/api/conditions',require(_0x50e8('0x61')));_0x236cf3[_0x50e8('0x4')]('/api/intervals',require(_0x50e8('0x62')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x63'),require(_0x50e8('0x64')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x65'),require('./api/cdr'));_0x236cf3[_0x50e8('0x4')]('/api/voiceQueuesLog',require(_0x50e8('0x66')));_0x236cf3[_0x50e8('0x4')]('/api/schedules',require(_0x50e8('0x67')));_0x236cf3['use'](_0x50e8('0x68'),require(_0x50e8('0x69')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x6a'),require(_0x50e8('0x6b')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x6c'),require(_0x50e8('0x6d')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x6e'),require(_0x50e8('0x6f')));_0x236cf3['use'](_0x50e8('0x70'),require(_0x50e8('0x71')));_0x236cf3['use'](_0x50e8('0x72'),require('./api/integration'));_0x236cf3[_0x50e8('0x4')]('/api/integrations/reports',require(_0x50e8('0x73')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x74'),require(_0x50e8('0x75')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x76'),require(_0x50e8('0x77')));_0x236cf3['use'](_0x50e8('0x78'),require(_0x50e8('0x79')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x7a'),require(_0x50e8('0x7b')));_0x236cf3[_0x50e8('0x4')]('/api/analytics/field_reports',require(_0x50e8('0x7c')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x7d'),require(_0x50e8('0x7e')));_0x236cf3['use'](_0x50e8('0x7f'),require(_0x50e8('0x80')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x81'),require(_0x50e8('0x82')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x83'),require('./api/intSalesforceField'));_0x236cf3['use']('/api/integrations/sugarcrm/accounts',require(_0x50e8('0x84')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x85'),require(_0x50e8('0x86')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x87'),require('./api/intSugarcrmField'));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x88'),require(_0x50e8('0x89')));_0x236cf3[_0x50e8('0x4')]('/api/integrations/desk/configurations',require(_0x50e8('0x8a')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x8b'),require(_0x50e8('0x8c')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x8d'),require('./api/intZohoAccount'));_0x236cf3[_0x50e8('0x4')]('/api/integrations/zoho/configurations',require('./api/intZohoConfiguration'));_0x236cf3['use'](_0x50e8('0x8e'),require('./api/intZohoField'));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x8f'),require(_0x50e8('0x90')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x91'),require(_0x50e8('0x92')));_0x236cf3[_0x50e8('0x4')]('/api/integrations/zendesk/fields',require(_0x50e8('0x93')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x94'),require('./api/intFreshdeskAccount'));_0x236cf3['use']('/api/integrations/freshdesk/configurations',require(_0x50e8('0x95')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x96'),require(_0x50e8('0x97')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x98'),require('./api/intVtigerAccount'));_0x236cf3[_0x50e8('0x4')]('/api/integrations/vtiger/configurations',require(_0x50e8('0x99')));_0x236cf3[_0x50e8('0x4')]('/api/integrations/vtiger/fields',require('./api/intVtigerField'));_0x236cf3['use'](_0x50e8('0x9a'),require(_0x50e8('0x9b')));_0x236cf3['use'](_0x50e8('0x9c'),require(_0x50e8('0x9d')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0x9e'),require(_0x50e8('0x9f')));_0x236cf3['use'](_0x50e8('0xa0'),require(_0x50e8('0xa1')));_0x236cf3[_0x50e8('0x4')]('/api/integrations/dynamics365/configurations',require('./api/intDynamics365Configuration'));_0x236cf3[_0x50e8('0x4')](_0x50e8('0xa2'),require(_0x50e8('0xa3')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0xa4'),require(_0x50e8('0xa5')));_0x236cf3['use']('/api/integrations/freshsales/configurations',require(_0x50e8('0xa6')));_0x236cf3['use'](_0x50e8('0xa7'),require(_0x50e8('0xa8')));_0x236cf3['use'](_0x50e8('0xa9'),require('./api/network'));_0x236cf3['use']('/api/chat/reports/queue',require(_0x50e8('0xaa')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0xab'),require(_0x50e8('0xac')));_0x236cf3['use']('/api/jscripty/answers/reports',require(_0x50e8('0xad')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0xae'),require(_0x50e8('0xaf')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0xb0'),require(_0x50e8('0xb1')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0xb2'),require(_0x50e8('0xb3')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0xb4'),require(_0x50e8('0xb5')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0xb6'),require(_0x50e8('0xb7')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0xb8'),require('./api/jscriptyProject'));_0x236cf3[_0x50e8('0x4')](_0x50e8('0xb9'),require(_0x50e8('0xba')));_0x236cf3[_0x50e8('0x4')]('/api/square/odbc',require(_0x50e8('0xbb')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0xbc'),require(_0x50e8('0xbd')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0xbe'),require('./api/squareRecording'));_0x236cf3[_0x50e8('0x4')](_0x50e8('0xbf'),require(_0x50e8('0xc0')));_0x236cf3[_0x50e8('0x4')]('/api/teams',require(_0x50e8('0xc1')));_0x236cf3['use'](_0x50e8('0xc2'),require(_0x50e8('0xc3')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0xc4'),require(_0x50e8('0xc5')));_0x236cf3['use'](_0x50e8('0xc6'),require(_0x50e8('0xc7')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0xc8'),require(_0x50e8('0xc9')));_0x236cf3[_0x50e8('0x4')]('/api/plugins',require(_0x50e8('0xca')));_0x236cf3[_0x50e8('0x4')]('/api/mail/reports/transfer',require(_0x50e8('0xcb')));_0x236cf3[_0x50e8('0x4')]('/api/chat/reports/transfer',require(_0x50e8('0xcc')));_0x236cf3['use'](_0x50e8('0xcd'),require(_0x50e8('0xce')));_0x236cf3['use'](_0x50e8('0xcf'),require(_0x50e8('0xd0')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0xd1'),require('./api/smsTransferReport'));_0x236cf3[_0x50e8('0x4')]('/api/cm/lists',require(_0x50e8('0xd2')));_0x236cf3[_0x50e8('0x4')]('/api/voice/prefixes',require(_0x50e8('0xd3')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0xd4'),require(_0x50e8('0xd5')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0xd6'),require(_0x50e8('0xd7')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0xd8'),require('./api/userProfileResource'));_0x236cf3[_0x50e8('0x4')](_0x50e8('0xd9'),require(_0x50e8('0xda')));_0x236cf3['use'](_0x50e8('0xdb'),require(_0x50e8('0xdc')));_0x236cf3[_0x50e8('0x4')]('/api/whatsapp/applications',require('./api/whatsappApplication'));_0x236cf3[_0x50e8('0x4')](_0x50e8('0xdd'),require('./api/whatsappInteraction'));_0x236cf3[_0x50e8('0x4')]('/api/whatsapp/messages',require(_0x50e8('0xde')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0xdf'),require(_0x50e8('0xe0')));_0x236cf3['use'](_0x50e8('0xe1'),require('./api/whatsappTransferReport'));_0x236cf3[_0x50e8('0x4')]('/api/whatsapp/queues',require('./api/whatsappQueue'));_0x236cf3[_0x50e8('0x4')](_0x50e8('0xe2'),require('./api/cloudProvider'));_0x236cf3[_0x50e8('0x4')]('/api/realtime',require(_0x50e8('0xe3')));_0x236cf3['use']('/api/user-settings',require(_0x50e8('0xe4')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0xe5'),require(_0x50e8('0xe6')));_0x236cf3['use'](_0x50e8('0xe7'),require('./api/authGoogle'));_0x236cf3['use'](_0x50e8('0xe8'),require(_0x50e8('0xe9')));_0x236cf3[_0x50e8('0x4')]('/api/jira',require('./api/jira'));_0x236cf3['use'](_0x50e8('0xea'),require(_0x50e8('0xeb')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0xec'),require(_0x50e8('0xed')));_0x236cf3[_0x50e8('0x4')]('/api/system',require('./api/system'));_0x236cf3[_0x50e8('0x4')](_0x50e8('0xee'),require(_0x50e8('0xef')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0xf0'),require('./api/webbar'));_0x236cf3[_0x50e8('0x4')](_0x50e8('0xf1'),clientSideLogs);_0x236cf3[_0x50e8('0x4')]('/apidoc',express['static'](path[_0x50e8('0xf2')](config[_0x50e8('0xf3')],_0x50e8('0xf4'))));_0x236cf3['use'](_0x50e8('0xf5'),express[_0x50e8('0xf6')](path['join'](config[_0x50e8('0xf3')],'/www')));_0x236cf3[_0x50e8('0x4')](_0x50e8('0xf7'),express[_0x50e8('0xf6')](path[_0x50e8('0xf2')](config[_0x50e8('0xf3')],_0x50e8('0xf7'))));_0x236cf3[_0x50e8('0x4')](_0x50e8('0xf8'),express[_0x50e8('0xf6')](path['join'](config[_0x50e8('0xf3')],'snippet',_0x50e8('0xf9'))));_0x236cf3[_0x50e8('0x4')](_0x50e8('0xfa'),express[_0x50e8('0xf6')](path[_0x50e8('0xf2')](config[_0x50e8('0xf3')],'/server/files/plugins')));_0x236cf3[_0x50e8('0xfb')](_0x50e8('0xfc'))[_0x50e8('0xfd')](errors[0x194]);_0x236cf3[_0x50e8('0xfb')]('/*')[_0x50e8('0xfd')](function(_0x2c5bee,_0x4182f2){_0x4182f2['sendFile'](path[_0x50e8('0xfe')](_0x236cf3[_0x50e8('0xfd')](_0x50e8('0xff'))+_0x50e8('0x100')));});return _0x236cf3;});};
\ No newline at end of file
index 1fa54f6..2aeb1bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x240c=['../api/faxAccount/faxAccount.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.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/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/attachment/attachment.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','error','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default','jayson/promise','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.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/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc'];(function(_0x4f768a,_0x413685){var _0x4ab541=function(_0x213c3a){while(--_0x213c3a){_0x4f768a['push'](_0x4f768a['shift']());}};_0x4ab541(++_0x413685);}(_0x240c,0xbd));var _0xc240=function(_0x47a36d,_0x567127){_0x47a36d=_0x47a36d-0x0;var _0x40b792=_0x240c[_0x47a36d];return _0x40b792;};'use strict';var jayson=require(_0xc240('0x0'));var _=require(_0xc240('0x1'));var config=require(_0xc240('0x2'));exports[_0xc240('0x3')]=function(){return new Promise(function(_0x5b5846,_0x19d4a3){var _0x1a5430={};_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0x5')));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0x6')));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0x7')));_0x1a5430=_['merge'](_0x1a5430,require(_0xc240('0x8')));_0x1a5430=_['merge'](_0x1a5430,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0x9')));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0xa')));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0xb')));_0x1a5430=_['merge'](_0x1a5430,require(_0xc240('0xc')));_0x1a5430=_['merge'](_0x1a5430,require(_0xc240('0xd')));_0x1a5430=_['merge'](_0x1a5430,require(_0xc240('0xe')));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0xf')));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0x10')));_0x1a5430=_['merge'](_0x1a5430,require('../api/mailQueue/mailQueue.rpc'));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0x11')));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0x12')));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0x13')));_0x1a5430=_['merge'](_0x1a5430,require(_0xc240('0x14')));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0x15')));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require('../api/faxApplication/faxApplication.rpc'));_0x1a5430=_['merge'](_0x1a5430,require('../api/faxInteraction/faxInteraction.rpc'));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0x16')));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0x17')));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0x18')));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0x19')));_0x1a5430=_['merge'](_0x1a5430,require(_0xc240('0x1a')));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require('../api/smsMessage/smsMessage.rpc'));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require('../api/smsQueue/smsQueue.rpc'));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0x1b')));_0x1a5430=_['merge'](_0x1a5430,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0x1c')));_0x1a5430=_['merge'](_0x1a5430,require(_0xc240('0x1d')));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0x1e')));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0x1f')));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0x20')));_0x1a5430=_['merge'](_0x1a5430,require(_0xc240('0x21')));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require('../api/cmContact/cmContact.rpc'));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require('../api/cmHopper/cmHopper.rpc'));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0x22')));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0x23')));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0x24')));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0x25')));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0x26')));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0x27')));_0x1a5430=_['merge'](_0x1a5430,require(_0xc240('0x28')));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0x29')));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require('../api/trigger/trigger.rpc'));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0x2a')));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0x2b')));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0x2c')));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0x2d')));_0x1a5430=_['merge'](_0x1a5430,require(_0xc240('0x2e')));_0x1a5430=_['merge'](_0x1a5430,require(_0xc240('0x2f')));_0x1a5430=_['merge'](_0x1a5430,require(_0xc240('0x30')));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0x31')));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0x32')));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0x33')));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0x34')));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0x35')));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0x36')));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require('../api/squareReport/squareReport.rpc'));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0x37')));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0x38')));_0x1a5430=_['merge'](_0x1a5430,require(_0xc240('0x39')));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require('../api/squareRecording/squareRecording.rpc'));_0x1a5430=_['merge'](_0x1a5430,require('../api/squareMessage/squareMessage.rpc'));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require('../api/campaign/campaign.rpc'));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0x3a')));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require('../api/plugin/plugin.rpc'));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0x3b')));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0x3c')));_0x1a5430=_[_0xc240('0x4')](_0x1a5430,require(_0xc240('0x3d')));_0x1a5430=_['merge'](_0x1a5430,require(_0xc240('0x3e')));var _0x2c0482=jayson[_0xc240('0x3f')](_0x1a5430)[_0xc240('0x40')]();var _0xeeeb5=config[_0xc240('0x41')][_0xc240('0x42')]||config[_0xc240('0x42')]+0x1;var _0x2ead50=config['rpc']['ip']||'localhost';_0x2c0482['on'](_0xc240('0x43'),function(_0x1d3570){return _0x19d4a3(_0x1d3570);});_0x2c0482[_0xc240('0x3')](_0xeeeb5,_0x2ead50,function(){console['log'](_0xc240('0x44'),_0x2ead50,_0xeeeb5);require('../config/triggers')[_0xc240('0x45')]();return _0x5b5846('RPC\x20listening\x20on\x20'+_0x2ead50+':'+_0xeeeb5);});});};
\ No newline at end of file
+var _0xad13=['../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/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','http','rpc','port','localhost','error','log','RPC\x20listening\x20on\x20','jayson/promise','../config/environment','merge','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxInteraction/faxInteraction.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/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.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/pause/pause.rpc','../api/sound/sound.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'];(function(_0x51377e,_0x3dcd84){var _0x5e5fbc=function(_0x1de9c0){while(--_0x1de9c0){_0x51377e['push'](_0x51377e['shift']());}};_0x5e5fbc(++_0x3dcd84);}(_0xad13,0x12d));var _0x3ad1=function(_0xcc18a5,_0x4dbb0a){_0xcc18a5=_0xcc18a5-0x0;var _0x314c9b=_0xad13[_0xcc18a5];return _0x314c9b;};'use strict';var jayson=require(_0x3ad1('0x0'));var _=require('lodash');var config=require(_0x3ad1('0x1'));exports['listen']=function(){return new Promise(function(_0x266877,_0x34b446){var _0x59ca7f={};_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require('../api/user/user.rpc'));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require('../api/voiceExtension/voiceExtension.rpc'));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require(_0x3ad1('0x3')));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require('../api/voiceRecording/voiceRecording.rpc'));_0x59ca7f=_['merge'](_0x59ca7f,require(_0x3ad1('0x4')));_0x59ca7f=_['merge'](_0x59ca7f,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x59ca7f=_['merge'](_0x59ca7f,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require(_0x3ad1('0x5')));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require(_0x3ad1('0x6')));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require(_0x3ad1('0x7')));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require(_0x3ad1('0x8')));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require(_0x3ad1('0x9')));_0x59ca7f=_['merge'](_0x59ca7f,require(_0x3ad1('0xa')));_0x59ca7f=_['merge'](_0x59ca7f,require(_0x3ad1('0xb')));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require(_0x3ad1('0xc')));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require('../api/mailInteraction/mailInteraction.rpc'));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require(_0x3ad1('0xd')));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require(_0x3ad1('0xe')));_0x59ca7f=_['merge'](_0x59ca7f,require(_0x3ad1('0xf')));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require('../api/faxAccount/faxAccount.rpc'));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require('../api/faxApplication/faxApplication.rpc'));_0x59ca7f=_['merge'](_0x59ca7f,require(_0x3ad1('0x10')));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require('../api/faxMessage/faxMessage.rpc'));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require(_0x3ad1('0x11')));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require(_0x3ad1('0x12')));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require('../api/smsAccount/smsAccount.rpc'));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require(_0x3ad1('0x13')));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require(_0x3ad1('0x14')));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require(_0x3ad1('0x15')));_0x59ca7f=_['merge'](_0x59ca7f,require(_0x3ad1('0x16')));_0x59ca7f=_['merge'](_0x59ca7f,require(_0x3ad1('0x17')));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require(_0x3ad1('0x18')));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require(_0x3ad1('0x19')));_0x59ca7f=_['merge'](_0x59ca7f,require(_0x3ad1('0x1a')));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require(_0x3ad1('0x1b')));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require(_0x3ad1('0x1c')));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require('../api/chatQueue/chatQueue.rpc'));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require(_0x3ad1('0x1d')));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require(_0x3ad1('0x1e')));_0x59ca7f=_['merge'](_0x59ca7f,require(_0x3ad1('0x1f')));_0x59ca7f=_['merge'](_0x59ca7f,require(_0x3ad1('0x20')));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require(_0x3ad1('0x21')));_0x59ca7f=_['merge'](_0x59ca7f,require(_0x3ad1('0x22')));_0x59ca7f=_['merge'](_0x59ca7f,require('../api/interval/interval.rpc'));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require(_0x3ad1('0x23')));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require(_0x3ad1('0x24')));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require('../api/template/template.rpc'));_0x59ca7f=_['merge'](_0x59ca7f,require(_0x3ad1('0x25')));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require('../api/variable/variable.rpc'));_0x59ca7f=_['merge'](_0x59ca7f,require(_0x3ad1('0x26')));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require(_0x3ad1('0x27')));_0x59ca7f=_['merge'](_0x59ca7f,require(_0x3ad1('0x28')));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require(_0x3ad1('0x29')));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require(_0x3ad1('0x2a')));_0x59ca7f=_['merge'](_0x59ca7f,require(_0x3ad1('0x2b')));_0x59ca7f=_['merge'](_0x59ca7f,require(_0x3ad1('0x2c')));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require(_0x3ad1('0x2d')));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require(_0x3ad1('0x2e')));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require(_0x3ad1('0x2f')));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require(_0x3ad1('0x30')));_0x59ca7f=_['merge'](_0x59ca7f,require(_0x3ad1('0x31')));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require(_0x3ad1('0x32')));_0x59ca7f=_['merge'](_0x59ca7f,require(_0x3ad1('0x33')));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require(_0x3ad1('0x34')));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require(_0x3ad1('0x35')));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require(_0x3ad1('0x36')));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require(_0x3ad1('0x37')));_0x59ca7f=_['merge'](_0x59ca7f,require('../api/squareMessage/squareMessage.rpc'));_0x59ca7f=_['merge'](_0x59ca7f,require(_0x3ad1('0x38')));_0x59ca7f=_['merge'](_0x59ca7f,require(_0x3ad1('0x39')));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require('../api/plugin/plugin.rpc'));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require(_0x3ad1('0x3a')));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require(_0x3ad1('0x3b')));_0x59ca7f=_['merge'](_0x59ca7f,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x59ca7f=_['merge'](_0x59ca7f,require(_0x3ad1('0x3c')));_0x59ca7f=_[_0x3ad1('0x2')](_0x59ca7f,require(_0x3ad1('0x3d')));var _0x2471fa=jayson['server'](_0x59ca7f)[_0x3ad1('0x3e')]();var _0x371887=config[_0x3ad1('0x3f')]['port']||config[_0x3ad1('0x40')]+0x1;var _0x394d0f=config['rpc']['ip']||_0x3ad1('0x41');_0x2471fa['on'](_0x3ad1('0x42'),function(_0x4be3cc){return _0x34b446(_0x4be3cc);});_0x2471fa['listen'](_0x371887,_0x394d0f,function(){console[_0x3ad1('0x43')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x394d0f,_0x371887);require('../config/triggers')['default']();return _0x266877(_0x3ad1('0x44')+_0x394d0f+':'+_0x371887);});});};
\ No newline at end of file
index 3283d08..039d3ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2df6=['beep','format','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','setExtension','SET\x20EXTENSION\x20%s','setPriority','setVariable','isNumber','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','AGI','WAIT','noop','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./reply','./error','call','setEncoding','setTimeout','utf8','headers','emit','line','hangup','substring','520-Invalid','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','startsWith','split','match','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','pipe','command','write','inherits','prototype','sendRequest','sync','ANSWER','getData'];(function(_0x457bc6,_0x431adc){var _0x337f06=function(_0x158788){while(--_0x158788){_0x457bc6['push'](_0x457bc6['shift']());}};_0x337f06(++_0x431adc);}(_0x2df6,0x6c));var _0x62df=function(_0x17a750,_0x8b9552){_0x17a750=_0x17a750-0x0;var _0x307b72=_0x2df6[_0x17a750];return _0x307b72;};'use strict';var util=require(_0x62df('0x0'));var _=require(_0x62df('0x1'));var EventEmitter=require(_0x62df('0x2'))[_0x62df('0x3')];var AGIReply=require(_0x62df('0x4'));var AGIError=require(_0x62df('0x5'));function AGIChannel(_0x1eb966){var _0x172765=this,_0x6cc9fe=new AGIReply(),_0x4370e3=![],_0x29ca96={};EventEmitter[_0x62df('0x6')](_0x172765);_0x1eb966[_0x62df('0x7')]('utf8');_0x1eb966[_0x62df('0x8')](0x8*0x3c*0x3c*0x3e8);_0x6cc9fe['setEncoding'](_0x62df('0x9'));_0x6cc9fe['on'](_0x62df('0xa'),function(_0x515213){for(var _0x1f4436 in _0x515213){_0x172765[_0x1f4436]=_0x515213[_0x1f4436];}_0x172765[_0x62df('0xb')]('ready');});_0x6cc9fe['on'](_0x62df('0xc'),function(_0xdfe051){if(_0xdfe051['toLowerCase']()==_0x62df('0xd')){_0x172765[_0x62df('0xb')](_0x62df('0xd'));return;}if(_0xdfe051[_0x62df('0xe')](0x0,0xb)==_0x62df('0xf')){_0x4370e3=!![];}if(_0x4370e3){_0x29ca96['rx']+=_0xdfe051+'\x0a';if(_0xdfe051['search'](_0x62df('0x10'))!=-0x1){_0x4370e3=![];}}else{_0x29ca96['rx']=_0xdfe051;}if(_0x4370e3){return;}if(typeof _0x29ca96['cb']==_0x62df('0x11')){var _0x6cd039=_0x29ca96['rx'][_0x62df('0xe')](0x0,0x3),_0x1c9c7d=null,_0x318d46=null;_0x6cd039=parseInt(_0x6cd039);if(isNaN(_0x6cd039)){_0x29ca96['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x62df('0x12')});return;}if(_0x6cd039!=0xc8){_0x29ca96['cb'](null,{'code':_0x6cd039,'result':-0x1,'extra':'KO'});return;}_0x1c9c7d=_0x29ca96['rx']['substring'](0x4)[_0x62df('0x13')](_0x62df('0x14'),'');if(_0x1c9c7d[_0x62df('0x15')]('\x20')!=-0x1){_0x1c9c7d=_0x1c9c7d[_0x62df('0x16')](0x0,_0x1c9c7d['indexOf']('\x20'));}if(_[_0x62df('0x17')](_0x1c9c7d,'-1')){_0x1c9c7d=parseInt(_0x1c9c7d);}_0x318d46=_0x29ca96['rx'][_0x62df('0x18')]('\x20');if(_0x318d46['length']==0x3){_0x318d46=_0x318d46[0x2][_0x62df('0xe')](0x1,_0x318d46[0x2]['length']-0x1);}else if(_0x318d46['length']>0x3){var _0x2dfa21=/\((.+)\)/;var _0x213dd3=_0x29ca96['rx'][_0x62df('0x19')](_0x2dfa21);if(_0x213dd3){_0x318d46=_0x213dd3[0x1];}else{_0x318d46=null;}}else{_0x318d46=null;}_0x29ca96['cb'](null,{'code':_0x6cd039,'result':_0x1c9c7d,'extra':_0x318d46});}});_0x1eb966['on'](_0x62df('0x1a'),function(_0x139496){_0x172765['emit'](_0x62df('0x1a'),new AGIError(_0x62df('0x1b'),_0x139496['code']));});_0x1eb966['on'](_0x62df('0x1c'),function(){_0x172765[_0x62df('0xb')](_0x62df('0x1c'),new AGIError(_0x62df('0x1d')));});_0x1eb966['on'](_0x62df('0x1e'),function(){_0x172765['emit'](_0x62df('0x1e'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x1eb966['destroy']();});_0x1eb966[_0x62df('0x1f')](_0x6cc9fe);this[_0x62df('0x20')]=function(_0x4f03d7,_0x338053){var _0x4f03d7=_0x4f03d7||'',_0x338053=typeof _0x338053==_0x62df('0x11')?_0x338053:new Function();_0x29ca96={'tx':_0x4f03d7,'rx':'','cb':_0x338053};_0x1eb966[_0x62df('0x21')](_0x4f03d7+'\x0a');},this['close']=function(){_0x1eb966['destroy']();};}util[_0x62df('0x22')](AGIChannel,EventEmitter);AGIChannel[_0x62df('0x23')][_0x62df('0x24')]=function(_0x3afd53){return this['command'][_0x62df('0x25')](this,_0x3afd53);};AGIChannel[_0x62df('0x23')]['answer']=function(){return this[_0x62df('0x24')](_0x62df('0x26'));};AGIChannel[_0x62df('0x23')][_0x62df('0x27')]=function(_0x2027be,_0x2fe439,_0x5e3548){_0x2027be=_0x2027be===undefined?_0x62df('0x28'):_0x2027be;_0x2fe439=_0x2fe439===undefined?'5':_0x2fe439;_0x5e3548=_0x5e3548===undefined?'1':_0x5e3548;return this[_0x62df('0x24')](util[_0x62df('0x29')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x2027be,_0x2fe439*0x3e8,_0x5e3548));};AGIChannel[_0x62df('0x23')]['noop']=function(_0x327d05){_0x327d05=_0x327d05||'NO\x20MESSAGE';return this[_0x62df('0x24')](util[_0x62df('0x29')](_0x62df('0x2a'),_0x327d05));};AGIChannel['prototype'][_0x62df('0x2b')]=function(_0xe667e6,_0x3de660){if(_[_0x62df('0x2c')](_0x3de660)){return this[_0x62df('0x24')](util[_0x62df('0x29')](_0x62df('0x2d'),_0xe667e6,_0x3de660[_0x62df('0x2e')](',')));}return this[_0x62df('0x24')](util[_0x62df('0x29')](_0x62df('0x2d'),_0xe667e6,_0x3de660));};AGIChannel[_0x62df('0x23')][_0x62df('0x2f')]=function(_0x1e889a){return this[_0x62df('0x24')](util[_0x62df('0x29')]('SET\x20CONTEXT\x20%s',_0x1e889a));};AGIChannel[_0x62df('0x23')][_0x62df('0x30')]=function(_0x4429e0){return this['sendRequest'](util['format'](_0x62df('0x31'),_0x4429e0));};AGIChannel['prototype'][_0x62df('0x32')]=function(_0x32774e){return this[_0x62df('0x24')](util['format']('SET\x20PRIORITY\x20%s',_0x32774e));};AGIChannel[_0x62df('0x23')]['hangup']=function(){return this['sendRequest']('HANGUP');};AGIChannel[_0x62df('0x23')][_0x62df('0x33')]=function(_0x578155,_0x1292b9){var _0x42c515=_['isBoolean'](_0x1292b9)||_[_0x62df('0x34')](_0x1292b9)?_0x1292b9[_0x62df('0x35')]():_0x1292b9;return this[_0x62df('0x24')](util[_0x62df('0x29')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x578155,_0x42c515?_0x42c515[_0x62df('0x35')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x62df('0x36')]=function(_0x5232b2,_0x2893b9){return this[_0x62df('0x24')](util[_0x62df('0x29')](_0x62df('0x37'),_0x5232b2,_0x2893b9));};AGIChannel['prototype'][_0x62df('0x38')]=function(_0x4558bc,_0x57825d){return this[_0x62df('0x24')](util[_0x62df('0x29')]('SAY\x20DIGITS\x20%s\x20%s',_0x4558bc,_0x57825d));};AGIChannel[_0x62df('0x23')][_0x62df('0x39')]=function(_0x387d11,_0x487a8f){return this[_0x62df('0x24')](util[_0x62df('0x29')](_0x62df('0x3a'),_0x387d11,_0x487a8f));};AGIChannel[_0x62df('0x23')][_0x62df('0x3b')]=function(_0x1baac5,_0x2b9b78,_0x36089d){_0x2b9b78=_0x2b9b78||this[_0x62df('0x3c')];_0x36089d=_0x36089d||0x1;this['setContext'](_0x1baac5);this[_0x62df('0x30')](_0x2b9b78);this[_0x62df('0x32')](_0x36089d);return this['noop'](util[_0x62df('0x29')](_0x62df('0x3d'),_0x1baac5,_0x2b9b78,_0x36089d));};AGIChannel['prototype'][_0x62df('0x3e')]=function(_0x9b14a9){return this[_0x62df('0x24')](util[_0x62df('0x29')](_0x62df('0x3f'),_0x9b14a9));};AGIChannel[_0x62df('0x23')][_0x62df('0x40')]=function(_0x1ef0e0,_0x5561e9,_0x5090c7,_0x57e55a,_0x169240,_0x50e227){_0x5561e9=_0x5561e9||_0x62df('0x41');_0x5090c7=_0x5090c7||'';_0x57e55a=_0x57e55a===undefined?-0x1:_0x57e55a==='-1'?-0x1:_0x57e55a*0x3e8;_0x169240=_0x169240===undefined?'':'s='+_0x169240;_0x50e227=_0x50e227?_0x62df('0x42'):'';return this[_0x62df('0x24')](util['format']('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x1ef0e0,_0x5561e9,_0x5090c7,_0x57e55a,_0x50e227,_0x169240));};AGIChannel['prototype']['streamFile']=function(_0x38af52,_0x5bcde6){_0x5bcde6=_0x5bcde6||'';return this['sendRequest'](util[_0x62df('0x29')](_0x62df('0x43'),_0x38af52,_0x5bcde6));};AGIChannel['prototype']['agi']=function(_0x9939ba){return this[_0x62df('0x2b')](_0x62df('0x44'),_0x9939ba);};AGIChannel[_0x62df('0x23')]['wait']=function(_0x215688){return this[_0x62df('0x2b')](_0x62df('0x45'),_0x215688);};AGIChannel[_0x62df('0x23')][_0x62df('0x1a')]=function(_0x301cef,_0x10963e){this[_0x62df('0x46')](util[_0x62df('0x29')](_0x62df('0x47'),_0x301cef['id'],_0x301cef[_0x62df('0x48')],_0x10963e));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x62df('0x49')]=AGIChannel;
\ No newline at end of file
+var _0xfc4f=['label','exports','lodash','events','EventEmitter','./reply','./error','call','setEncoding','setTimeout','headers','emit','line','toLowerCase','hangup','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','substring','result=','indexOf','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','sendRequest','sync','prototype','answer','ANSWER','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','isBoolean','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setPriority','GOTO\x20%s\x20%s\x20%s','getVariable','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','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI'];(function(_0x1d3a3b,_0x49e405){var _0x59b26f=function(_0x386d32){while(--_0x386d32){_0x1d3a3b['push'](_0x1d3a3b['shift']());}};_0x59b26f(++_0x49e405);}(_0xfc4f,0x192));var _0xffc4=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xfc4f[_0x501510];return _0x1e6ee5;};'use strict';var util=require('util');var _=require(_0xffc4('0x0'));var EventEmitter=require(_0xffc4('0x1'))[_0xffc4('0x2')];var AGIReply=require(_0xffc4('0x3'));var AGIError=require(_0xffc4('0x4'));function AGIChannel(_0x293502){var _0x27bcf3=this,_0x5943be=new AGIReply(),_0x289659=![],_0x211cfa={};EventEmitter[_0xffc4('0x5')](_0x27bcf3);_0x293502[_0xffc4('0x6')]('utf8');_0x293502[_0xffc4('0x7')](0x8*0x3c*0x3c*0x3e8);_0x5943be[_0xffc4('0x6')]('utf8');_0x5943be['on'](_0xffc4('0x8'),function(_0x176434){for(var _0x12d5eb in _0x176434){_0x27bcf3[_0x12d5eb]=_0x176434[_0x12d5eb];}_0x27bcf3[_0xffc4('0x9')]('ready');});_0x5943be['on'](_0xffc4('0xa'),function(_0x22d03a){if(_0x22d03a[_0xffc4('0xb')]()==_0xffc4('0xc')){_0x27bcf3[_0xffc4('0x9')](_0xffc4('0xc'));return;}if(_0x22d03a['substring'](0x0,0xb)==_0xffc4('0xd')){_0x289659=!![];}if(_0x289659){_0x211cfa['rx']+=_0x22d03a+'\x0a';if(_0x22d03a[_0xffc4('0xe')](_0xffc4('0xf'))!=-0x1){_0x289659=![];}}else{_0x211cfa['rx']=_0x22d03a;}if(_0x289659){return;}if(typeof _0x211cfa['cb']==_0xffc4('0x10')){var _0x3608c5=_0x211cfa['rx']['substring'](0x0,0x3),_0x3c931e=null,_0xfd810f=null;_0x3608c5=parseInt(_0x3608c5);if(isNaN(_0x3608c5)){_0x211cfa['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xffc4('0x11')});return;}if(_0x3608c5!=0xc8){_0x211cfa['cb'](null,{'code':_0x3608c5,'result':-0x1,'extra':'KO'});return;}_0x3c931e=_0x211cfa['rx'][_0xffc4('0x12')](0x4)['replace'](_0xffc4('0x13'),'');if(_0x3c931e[_0xffc4('0x14')]('\x20')!=-0x1){_0x3c931e=_0x3c931e['substr'](0x0,_0x3c931e[_0xffc4('0x14')]('\x20'));}if(_[_0xffc4('0x15')](_0x3c931e,'-1')){_0x3c931e=parseInt(_0x3c931e);}_0xfd810f=_0x211cfa['rx'][_0xffc4('0x16')]('\x20');if(_0xfd810f[_0xffc4('0x17')]==0x3){_0xfd810f=_0xfd810f[0x2]['substring'](0x1,_0xfd810f[0x2][_0xffc4('0x17')]-0x1);}else if(_0xfd810f[_0xffc4('0x17')]>0x3){var _0x3d3baa=/\((.+)\)/;var _0x937baa=_0x211cfa['rx'][_0xffc4('0x18')](_0x3d3baa);if(_0x937baa){_0xfd810f=_0x937baa[0x1];}else{_0xfd810f=null;}}else{_0xfd810f=null;}_0x211cfa['cb'](null,{'code':_0x3608c5,'result':_0x3c931e,'extra':_0xfd810f});}});_0x293502['on'](_0xffc4('0x19'),function(_0x9fa8ba){_0x27bcf3[_0xffc4('0x9')](_0xffc4('0x19'),new AGIError(_0xffc4('0x1a'),_0x9fa8ba['code']));});_0x293502['on'](_0xffc4('0x1b'),function(){_0x27bcf3['emit']('close',new AGIError(_0xffc4('0x1c')));});_0x293502['on'](_0xffc4('0x1d'),function(){_0x27bcf3[_0xffc4('0x9')]('timeout',new AGIError(_0xffc4('0x1e')));_0x293502[_0xffc4('0x1f')]();});_0x293502[_0xffc4('0x20')](_0x5943be);this[_0xffc4('0x21')]=function(_0x269885,_0xf55ff3){var _0x269885=_0x269885||'',_0xf55ff3=typeof _0xf55ff3==_0xffc4('0x10')?_0xf55ff3:new Function();_0x211cfa={'tx':_0x269885,'rx':'','cb':_0xf55ff3};_0x293502[_0xffc4('0x22')](_0x269885+'\x0a');},this[_0xffc4('0x1b')]=function(){_0x293502[_0xffc4('0x1f')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel['prototype'][_0xffc4('0x23')]=function(_0x2e6265){return this['command'][_0xffc4('0x24')](this,_0x2e6265);};AGIChannel[_0xffc4('0x25')][_0xffc4('0x26')]=function(){return this['sendRequest'](_0xffc4('0x27'));};AGIChannel['prototype']['getData']=function(_0x3bf82d,_0x8d8a25,_0x49201f){_0x3bf82d=_0x3bf82d===undefined?_0xffc4('0x28'):_0x3bf82d;_0x8d8a25=_0x8d8a25===undefined?'5':_0x8d8a25;_0x49201f=_0x49201f===undefined?'1':_0x49201f;return this[_0xffc4('0x23')](util[_0xffc4('0x29')](_0xffc4('0x2a'),_0x3bf82d,_0x8d8a25*0x3e8,_0x49201f));};AGIChannel[_0xffc4('0x25')][_0xffc4('0x2b')]=function(_0x10988a){_0x10988a=_0x10988a||'NO\x20MESSAGE';return this[_0xffc4('0x23')](util[_0xffc4('0x29')](_0xffc4('0x2c'),_0x10988a));};AGIChannel[_0xffc4('0x25')][_0xffc4('0x2d')]=function(_0x3e52f9,_0x4458a3){if(_[_0xffc4('0x2e')](_0x4458a3)){return this[_0xffc4('0x23')](util[_0xffc4('0x29')](_0xffc4('0x2f'),_0x3e52f9,_0x4458a3['join'](',')));}return this[_0xffc4('0x23')](util[_0xffc4('0x29')](_0xffc4('0x2f'),_0x3e52f9,_0x4458a3));};AGIChannel[_0xffc4('0x25')][_0xffc4('0x30')]=function(_0x2bffe3){return this['sendRequest'](util[_0xffc4('0x29')](_0xffc4('0x31'),_0x2bffe3));};AGIChannel[_0xffc4('0x25')][_0xffc4('0x32')]=function(_0x15bec3){return this[_0xffc4('0x23')](util['format'](_0xffc4('0x33'),_0x15bec3));};AGIChannel['prototype']['setPriority']=function(_0x908971){return this[_0xffc4('0x23')](util[_0xffc4('0x29')](_0xffc4('0x34'),_0x908971));};AGIChannel['prototype'][_0xffc4('0xc')]=function(){return this['sendRequest'](_0xffc4('0x35'));};AGIChannel[_0xffc4('0x25')]['setVariable']=function(_0x47de6e,_0xe62223){var _0x465e66=_[_0xffc4('0x36')](_0xe62223)||_[_0xffc4('0x37')](_0xe62223)?_0xe62223['toString']():_0xe62223;return this[_0xffc4('0x23')](util[_0xffc4('0x29')](_0xffc4('0x38'),_0x47de6e,_0x465e66?_0x465e66[_0xffc4('0x39')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xffc4('0x25')][_0xffc4('0x3a')]=function(_0x438f84,_0x28629b){return this[_0xffc4('0x23')](util[_0xffc4('0x29')](_0xffc4('0x3b'),_0x438f84,_0x28629b));};AGIChannel[_0xffc4('0x25')][_0xffc4('0x3c')]=function(_0x39d97c,_0x1087d8){return this[_0xffc4('0x23')](util[_0xffc4('0x29')](_0xffc4('0x3d'),_0x39d97c,_0x1087d8));};AGIChannel[_0xffc4('0x25')][_0xffc4('0x3e')]=function(_0x492e17,_0x24beb1){return this[_0xffc4('0x23')](util[_0xffc4('0x29')](_0xffc4('0x3f'),_0x492e17,_0x24beb1));};AGIChannel[_0xffc4('0x25')][_0xffc4('0x40')]=function(_0x3900fa,_0x443034,_0x527f22){_0x443034=_0x443034||this[_0xffc4('0x41')];_0x527f22=_0x527f22||0x1;this['setContext'](_0x3900fa);this[_0xffc4('0x32')](_0x443034);this[_0xffc4('0x42')](_0x527f22);return this[_0xffc4('0x2b')](util[_0xffc4('0x29')](_0xffc4('0x43'),_0x3900fa,_0x443034,_0x527f22));};AGIChannel['prototype'][_0xffc4('0x44')]=function(_0x597b46){return this[_0xffc4('0x23')](util[_0xffc4('0x29')](_0xffc4('0x45'),_0x597b46));};AGIChannel[_0xffc4('0x25')][_0xffc4('0x46')]=function(_0x1b584f,_0x14bcd7,_0x2aed15,_0x21692c,_0x2fc314,_0x497705){_0x14bcd7=_0x14bcd7||_0xffc4('0x47');_0x2aed15=_0x2aed15||'';_0x21692c=_0x21692c===undefined?-0x1:_0x21692c==='-1'?-0x1:_0x21692c*0x3e8;_0x2fc314=_0x2fc314===undefined?'':'s='+_0x2fc314;_0x497705=_0x497705?_0xffc4('0x48'):'';return this['sendRequest'](util[_0xffc4('0x29')](_0xffc4('0x49'),_0x1b584f,_0x14bcd7,_0x2aed15,_0x21692c,_0x497705,_0x2fc314));};AGIChannel[_0xffc4('0x25')][_0xffc4('0x4a')]=function(_0x3529b9,_0xcf598a){_0xcf598a=_0xcf598a||'';return this[_0xffc4('0x23')](util[_0xffc4('0x29')](_0xffc4('0x4b'),_0x3529b9,_0xcf598a));};AGIChannel[_0xffc4('0x25')][_0xffc4('0x4c')]=function(_0x2e6e53){return this[_0xffc4('0x2d')](_0xffc4('0x4d'),_0x2e6e53);};AGIChannel[_0xffc4('0x25')]['wait']=function(_0x10ebf5){return this['exec']('WAIT',_0x10ebf5);};AGIChannel[_0xffc4('0x25')]['error']=function(_0x18abdc,_0x1a08d6){this[_0xffc4('0x2b')](util[_0xffc4('0x29')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x18abdc['id'],_0x18abdc[_0xffc4('0x4e')],_0x1a08d6));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xffc4('0x4f')]=AGIChannel;
\ No newline at end of file
index c5a1c92..fa10c92 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d26=['Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','apply','message','name','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.'];(function(_0x301127,_0x8a9b24){var _0x54797b=function(_0x597cc2){while(--_0x597cc2){_0x301127['push'](_0x301127['shift']());}};_0x54797b(++_0x8a9b24);}(_0x1d26,0x1e9));var _0x61d2=function(_0x1b0f71,_0x8e3d31){_0x1b0f71=_0x1b0f71-0x0;var _0x435ffb=_0x1d26[_0x1b0f71];return _0x435ffb;};'use strict';var util=require(_0x61d2('0x0'));var error={'E_AGI_UNDEFINED':_0x61d2('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x61d2('0x2'),'E_AGI_SERVER_CLOSE':_0x61d2('0x3'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x61d2('0x4'),'E_AGI_SOCKET_ERROR':_0x61d2('0x5'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x61d2('0x6'),'E_AGI_COMMAND_EMPTY':_0x61d2('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x61d2('0x8'),'E_AGI_IVR_ENTRY':_0x61d2('0x9')};function AGIError(_0x5ebb34){var _0x5ebb34=_0x5ebb34||null,_0xae1e3e=_0xae1e3e||[],_0x363f2f=0x1,_0x352263='';if(!error[_0x5ebb34]){_0x5ebb34=_0x61d2('0xa');}_0xae1e3e[_0x61d2('0xb')](error[_0x5ebb34]);while(arguments[_0x363f2f]){_0xae1e3e['push'](arguments[_0x363f2f]);_0x363f2f++;}_0x352263=util['format'][_0x61d2('0xc')](util,_0xae1e3e);this[_0x61d2('0xd')]=_0x352263;this[_0x61d2('0xe')]=_0x5ebb34;}module['exports']=AGIError;
\ No newline at end of file
+var _0x56c8=['[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','exports','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.'];(function(_0x443037,_0x5b3e10){var _0x469273=function(_0xcec793){while(--_0xcec793){_0x443037['push'](_0x443037['shift']());}};_0x469273(++_0x5b3e10);}(_0x56c8,0x1b5));var _0x856c=function(_0x52464f,_0x301f0a){_0x52464f=_0x52464f-0x0;var _0x433ea8=_0x56c8[_0x52464f];return _0x433ea8;};'use strict';var util=require(_0x856c('0x0'));var error={'E_AGI_UNDEFINED':_0x856c('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x856c('0x2'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x856c('0x3'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x856c('0x4'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x856c('0x5'),'E_AGI_IVR_ENTRY':_0x856c('0x6')};function AGIError(_0x2501a8){var _0x2501a8=_0x2501a8||null,_0x3450b9=_0x3450b9||[],_0x16dbdc=0x1,_0x3f51ff='';if(!error[_0x2501a8]){_0x2501a8=_0x856c('0x7');}_0x3450b9[_0x856c('0x8')](error[_0x2501a8]);while(arguments[_0x16dbdc]){_0x3450b9['push'](arguments[_0x16dbdc]);_0x16dbdc++;}_0x3f51ff=util[_0x856c('0x9')]['apply'](util,_0x3450b9);this['message']=_0x3f51ff;this['name']=_0x2501a8;}module[_0x856c('0xa')]=AGIError;
\ No newline at end of file
index 0414787..b6cd092 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86db=['edges','push','size','relations','getVertex','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','no\x20edge/s\x20available','length','condition','agicommand','vswitch','target','default','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','agi','menu','getdigits','getsecretdigits','vertices','numberOfEdges','prototype','addVertex'];(function(_0x22e9fe,_0x3d019f){var _0x47cd19=function(_0x8fd5fc){while(--_0x8fd5fc){_0x22e9fe['push'](_0x22e9fe['shift']());}};_0x47cd19(++_0x3d019f);}(_0x86db,0x17c));var _0xb86d=function(_0x1c8c2f,_0x1d99fe){_0x1c8c2f=_0x1c8c2f-0x0;var _0x24fa67=_0x86db[_0x1c8c2f];return _0x24fa67;};'use strict';var _=require(_0xb86d('0x0'));var logger=require(_0xb86d('0x1'))(_0xb86d('0x2'));var verticesWithRetry=[_0xb86d('0x3'),_0xb86d('0x4'),_0xb86d('0x5')];var Graph=function(){this[_0xb86d('0x6')]={};this['edges']={};this[_0xb86d('0x7')]=0x0;};Graph[_0xb86d('0x8')][_0xb86d('0x9')]=function(_0x1a2616){this[_0xb86d('0x6')][_0x1a2616['id']]=_0x1a2616;this[_0xb86d('0xa')][_0x1a2616['id']]=[];};Graph[_0xb86d('0x8')]['addEdge']=function(_0x364104,_0x3737e1,_0x4c7436){this[_0xb86d('0xa')][_0x364104][_0xb86d('0xb')]({'target':_0x3737e1,'condition':_0x4c7436});this[_0xb86d('0x7')]+=0x1;};Graph[_0xb86d('0x8')][_0xb86d('0xc')]=function(){return _[_0xb86d('0xc')](this[_0xb86d('0x6')]);};Graph[_0xb86d('0x8')][_0xb86d('0xd')]=function(){return this[_0xb86d('0x7')];};Graph[_0xb86d('0x8')][_0xb86d('0xe')]=function(_0x171e03){return this['vertices'][_0x171e03];};Graph[_0xb86d('0x8')][_0xb86d('0xf')]=function(_0xde098c,_0x42b0ae){if(!this[_0xb86d('0x6')][_0xde098c]){return logger[_0xb86d('0x10')](_0xb86d('0x11'));}var _0x4ac835=_0x42b0ae(this[_0xb86d('0x6')][_0xde098c]);if(!_0x4ac835){return logger[_0xb86d('0x10')](_0xb86d('0x12'));}if(this[_0xb86d('0xa')][_0xde098c]['length']===0x0){return logger[_0xb86d('0x10')](_0xb86d('0x13'));}for(var _0x17b1c0=0x0,_0xe631b4=[],_0x402403=![];_0x17b1c0<this[_0xb86d('0xa')][_0xde098c][_0xb86d('0x14')];_0x17b1c0+=0x1){if(this[_0xb86d('0xa')][_0xde098c][_0x17b1c0][_0xb86d('0x15')]){_0xe631b4=this[_0xb86d('0xa')][_0xde098c][_0x17b1c0][_0xb86d('0x15')]['split'](',');for(var _0x1e260e=0x0;_0x1e260e<_0xe631b4[_0xb86d('0x14')];_0x1e260e+=0x1){if(this[_0xb86d('0x6')][_0xde098c][_0xb86d('0x16')]===_0xb86d('0x17')&&_0xe631b4[_0x1e260e]==='-'){_0x402403=this['edges'][_0xde098c][_0x17b1c0][_0xb86d('0x18')];logger[_0xb86d('0x10')](_0xb86d('0x19'),_0xe631b4[_0x1e260e],this[_0xb86d('0xa')][_0xde098c][_0x17b1c0]['target']);}else if(this[_0xb86d('0x6')][_0xde098c]['agicommand']==='menu'&&_0xe631b4[_0x1e260e]==='i'){_0x402403=this[_0xb86d('0xa')][_0xde098c][_0x17b1c0]['target'];logger[_0xb86d('0x10')]('invalid',_0xe631b4[_0x1e260e],this[_0xb86d('0xa')][_0xde098c][_0x17b1c0][_0xb86d('0x18')]);}if(_0xe631b4[_0x1e260e]===_0x4ac835){return this['traverseBFS'](this['edges'][_0xde098c][_0x17b1c0]['target'],_0x42b0ae);}}}else{return this['traverseBFS'](this[_0xb86d('0xa')][_0xde098c][_0x17b1c0][_0xb86d('0x18')],_0x42b0ae);}}if(_0xe631b4[_0xb86d('0x14')]){if(this['vertices'][_0xde098c]['agicommand']==='vswitch'){if(_0x402403){return this['traverseBFS'](_0x402403,_0x42b0ae);}return logger['info']('default\x20on\x20switch\x20not\x20found');}else if(_[_0xb86d('0x1a')](verticesWithRetry,this[_0xb86d('0x6')][_0xde098c][_0xb86d('0x16')])){if(_0x4ac835==='-'){return logger[_0xb86d('0x10')](_0xb86d('0x1b'));}if(_0x402403&&_0x4ac835!=='t'){return this[_0xb86d('0xf')](_0x402403,_0x42b0ae);}return this[_0xb86d('0xf')](_0xde098c,_0x42b0ae);}return logger[_0xb86d('0x10')](_0xb86d('0x1c'));}};module[_0xb86d('0x1d')]=Graph;
\ No newline at end of file
+var _0x90c4=['stop\x20traverse','length','condition','split','agicommand','vswitch','target','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','exports','lodash','agi','menu','getdigits','vertices','edges','numberOfEdges','prototype','addEdge','size','relations','traverseBFS','info','no\x20vertex\x20found'];(function(_0x2253ea,_0x6320e){var _0x2d046c=function(_0x707761){while(--_0x707761){_0x2253ea['push'](_0x2253ea['shift']());}};_0x2d046c(++_0x6320e);}(_0x90c4,0x137));var _0x490c=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x90c4[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x490c('0x0'));var logger=require('../../../config/logger')(_0x490c('0x1'));var verticesWithRetry=[_0x490c('0x2'),_0x490c('0x3'),'getsecretdigits'];var Graph=function(){this[_0x490c('0x4')]={};this[_0x490c('0x5')]={};this[_0x490c('0x6')]=0x0;};Graph[_0x490c('0x7')]['addVertex']=function(_0x335c1a){this[_0x490c('0x4')][_0x335c1a['id']]=_0x335c1a;this[_0x490c('0x5')][_0x335c1a['id']]=[];};Graph['prototype'][_0x490c('0x8')]=function(_0x8adca5,_0x2768d0,_0x49bcac){this[_0x490c('0x5')][_0x8adca5]['push']({'target':_0x2768d0,'condition':_0x49bcac});this['numberOfEdges']+=0x1;};Graph[_0x490c('0x7')][_0x490c('0x9')]=function(){return _[_0x490c('0x9')](this['vertices']);};Graph[_0x490c('0x7')][_0x490c('0xa')]=function(){return this['numberOfEdges'];};Graph[_0x490c('0x7')]['getVertex']=function(_0x14b021){return this[_0x490c('0x4')][_0x14b021];};Graph['prototype'][_0x490c('0xb')]=function(_0x248004,_0x24b23a){if(!this[_0x490c('0x4')][_0x248004]){return logger[_0x490c('0xc')](_0x490c('0xd'));}var _0x4b3b61=_0x24b23a(this[_0x490c('0x4')][_0x248004]);if(!_0x4b3b61){return logger[_0x490c('0xc')](_0x490c('0xe'));}if(this['edges'][_0x248004][_0x490c('0xf')]===0x0){return logger['info']('no\x20edge/s\x20available');}for(var _0x8cc749=0x0,_0x1276cb=[],_0x26cc83=![];_0x8cc749<this[_0x490c('0x5')][_0x248004][_0x490c('0xf')];_0x8cc749+=0x1){if(this[_0x490c('0x5')][_0x248004][_0x8cc749][_0x490c('0x10')]){_0x1276cb=this[_0x490c('0x5')][_0x248004][_0x8cc749][_0x490c('0x10')][_0x490c('0x11')](',');for(var _0x2f9f32=0x0;_0x2f9f32<_0x1276cb[_0x490c('0xf')];_0x2f9f32+=0x1){if(this[_0x490c('0x4')][_0x248004][_0x490c('0x12')]===_0x490c('0x13')&&_0x1276cb[_0x2f9f32]==='-'){_0x26cc83=this['edges'][_0x248004][_0x8cc749][_0x490c('0x14')];logger[_0x490c('0xc')]('default',_0x1276cb[_0x2f9f32],this[_0x490c('0x5')][_0x248004][_0x8cc749][_0x490c('0x14')]);}else if(this[_0x490c('0x4')][_0x248004][_0x490c('0x12')]===_0x490c('0x2')&&_0x1276cb[_0x2f9f32]==='i'){_0x26cc83=this[_0x490c('0x5')][_0x248004][_0x8cc749][_0x490c('0x14')];logger[_0x490c('0xc')]('invalid',_0x1276cb[_0x2f9f32],this['edges'][_0x248004][_0x8cc749][_0x490c('0x14')]);}if(_0x1276cb[_0x2f9f32]===_0x4b3b61){return this[_0x490c('0xb')](this[_0x490c('0x5')][_0x248004][_0x8cc749][_0x490c('0x14')],_0x24b23a);}}}else{return this['traverseBFS'](this[_0x490c('0x5')][_0x248004][_0x8cc749]['target'],_0x24b23a);}}if(_0x1276cb['length']){if(this[_0x490c('0x4')][_0x248004][_0x490c('0x12')]===_0x490c('0x13')){if(_0x26cc83){return this[_0x490c('0xb')](_0x26cc83,_0x24b23a);}return logger[_0x490c('0xc')](_0x490c('0x15'));}else if(_[_0x490c('0x16')](verticesWithRetry,this[_0x490c('0x4')][_0x248004][_0x490c('0x12')])){if(_0x4b3b61==='-'){return logger[_0x490c('0xc')](_0x490c('0x17'));}if(_0x26cc83&&_0x4b3b61!=='t'){return this[_0x490c('0xb')](_0x26cc83,_0x24b23a);}return this['traverseBFS'](_0x248004,_0x24b23a);}return logger[_0x490c('0xc')]('condition\x20not\x20found');}};module[_0x490c('0x18')]=Graph;
\ No newline at end of file
index 561ad6b..bf91106 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x84e1=['[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','handleNotFound','production','handleUnpublished','initialize','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','./server','listening','connection','projectUpdate','lodash','syncho','util','../../config/environment','../../config/logger','agi','./rpc','./project','defaults','127.0.0.1','error','stack','parse','findIndex','deleted','splice','push','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','message','[%s]\x20%s','name','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','then','catch','hasOwnProperty','agi_','substring','variables'];(function(_0x1fcf1b,_0x214549){var _0x5d2952=function(_0x3331b7){while(--_0x3331b7){_0x1fcf1b['push'](_0x1fcf1b['shift']());}};_0x5d2952(++_0x214549);}(_0x84e1,0x1da));var _0x184e=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x84e1[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x184e('0x0'));var syncho=require(_0x184e('0x1'));var util=require(_0x184e('0x2'));var config=require(_0x184e('0x3'));var logger=require(_0x184e('0x4'))(_0x184e('0x5'));var utilLicense=require('../../config/license/util');var rpc=require(_0x184e('0x6'));var Project=require(_0x184e('0x7'));var projects=[];config['agi']=_[_0x184e('0x8')](config[_0x184e('0x5')],{'ip':_0x184e('0x9'),'port':0x11dd});function connectionHandler(_0x45f43f){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x45f43f);agiHandler(_0x45f43f);}catch(_0x208d5){logger[_0x184e('0xa')](_0x208d5[_0x184e('0xb')]);}});});}function projectUpdateHandler(_0x12e27b){try{var _0x293ba9=JSON[_0x184e('0xc')](_0x12e27b);var _0x328971=_[_0x184e('0xd')](projects,['id',_0x293ba9['id']]);if(_0x328971>-0x1){if(_0x293ba9[_0x184e('0xe')]===!![]){projects[_0x184e('0xf')](_0x328971,0x1);}else{projects[_0x328971]=_0x293ba9;}}else{projects[_0x184e('0x10')](_0x293ba9);}}catch(_0xa2e854){logger[_0x184e('0xa')](_0xa2e854[_0x184e('0xb')]);}}function listeningHandler(){console[_0x184e('0x11')](_0x184e('0x12'),config['agi'][_0x184e('0x13')]);logger[_0x184e('0x14')](util[_0x184e('0x15')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x184e('0x5')]['ip'],config[_0x184e('0x5')][_0x184e('0x13')]));}function errorHandler(_0x451e40){if(_0x451e40&&_0x451e40['name']&&_0x451e40[_0x184e('0x16')]){logger[_0x184e('0xa')](util[_0x184e('0x15')](_0x184e('0x17'),_0x451e40[_0x184e('0x18')],_0x451e40[_0x184e('0x16')]));}else{logger[_0x184e('0xa')](util['format']('[ERROR]\x20%s',_0x451e40[_0x184e('0xb')]));}}function closeHandler(){logger['info'](util[_0x184e('0x15')](_0x184e('0x19'),this[_0x184e('0x1a')],this[_0x184e('0x1b')],this[_0x184e('0x1c')],this[_0x184e('0x1d')],this['uniqueid']));try{createSquareReport(this);}catch(_0x50b001){logger[_0x184e('0xa')](_0x50b001['stack']);}}function timeoutHandler(){logger[_0x184e('0x14')](util['format'](_0x184e('0x1e'),this[_0x184e('0x1a')],this[_0x184e('0x1b')],this[_0x184e('0x1c')],this['dnid'],this[_0x184e('0x1f')]));}function hangupHandler(){logger[_0x184e('0x14')](util[_0x184e('0x15')](_0x184e('0x20'),this[_0x184e('0x1a')],this['calleridname'],this[_0x184e('0x1c')],this['dnid'],this[_0x184e('0x1f')]));this['evtHangup']=!![];}function createSquareReport(_0x2060b5,_0x458e31){rpc['createSquareReport'](_0x2060b5)[_0x184e('0x21')](function(_0x239d5b){if(_0x458e31){_0x458e31(null,_0x239d5b);}})[_0x184e('0x22')](function(_0xfde6a3){if(_0x458e31){_0x458e31(null,_0xfde6a3);}});}function setChannelVariables(_0xf4d301){for(var _0x295a9b in _0xf4d301){if(_0xf4d301[_0x184e('0x23')](_0x295a9b)){if(_0x295a9b['indexOf'](_0x184e('0x24'))===0x0){_0xf4d301[_0x295a9b[_0x184e('0x25')](0x4)]=_0xf4d301[_0x295a9b];delete _0xf4d301[_0x295a9b];}}}}function agiHandler(_0x136b2a){logger['debug'](_0x184e('0x26'),JSON['stringify'](_0x136b2a,null,0x2));logger[_0x184e('0x14')](util[_0x184e('0x15')](_0x184e('0x27'),_0x136b2a[_0x184e('0x1a')],_0x136b2a[_0x184e('0x1b')],_0x136b2a[_0x184e('0x1c')],_0x136b2a['dnid'],_0x136b2a[_0x184e('0x1f')]));_0x136b2a['on']('error',errorHandler);_0x136b2a['on'](_0x184e('0x28'),closeHandler);_0x136b2a['on'](_0x184e('0x29'),timeoutHandler);_0x136b2a['evtHangup']=![];_0x136b2a['on']('hangup',hangupHandler);var _0x587687=_['find'](projects,[_0x184e('0x18'),_0x136b2a[_0x184e('0x1a')]]);if(!_0x587687)return Project[_0x184e('0x2a')](_0x136b2a);if(!_0x587687[_0x184e('0x2b')])return Project[_0x184e('0x2c')](_0x136b2a);return Project[_0x184e('0x2d')](_0x587687,_0x136b2a);}function main(){var _0x25897d;return utilLicense[_0x184e('0x2e')]()[_0x184e('0x21')](function(_0x315f70){if(!_0x315f70)return;if(_0x315f70['voice']){if(_0x315f70[_0x184e('0x2f')]&&_0x315f70['callysquare']>0x0){logger['info'](util[_0x184e('0x15')](_0x184e('0x30'),_0x315f70[_0x184e('0x2f')]));_0x25897d=_0x315f70[_0x184e('0x2f')];}else{logger[_0x184e('0x14')](_0x184e('0x31'));}}else{logger[_0x184e('0x14')](_0x184e('0x32'));_0x25897d=-0x1;}})[_0x184e('0x21')](function(){return Project[_0x184e('0x33')]();})[_0x184e('0x21')](function(_0x260a59){projects=_0x260a59;return;})['catch'](function(_0x391e41){logger['error'](_0x184e('0x34'),_0x391e41[_0x184e('0xb')]);})['finally'](function(){var _0x4570fe=require(_0x184e('0x35'))(config[_0x184e('0x5')]['port'],config[_0x184e('0x5')]['ip'],_0x25897d);_0x4570fe['on'](_0x184e('0xa'),errorHandler);_0x4570fe['on'](_0x184e('0x36'),listeningHandler);_0x4570fe['on'](_0x184e('0x37'),connectionHandler);_0x4570fe['on'](_0x184e('0x28'),closeHandler);_0x4570fe['on'](_0x184e('0x38'),projectUpdateHandler);});}main();
\ No newline at end of file
+var _0x4859=['[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','then','catch','indexOf','substring','debug','variables','stringify','close','find','handleNotFound','production','handleUnpublished','initialize','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','finally','./server','listening','connection','syncho','util','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./project','defaults','127.0.0.1','nextTick','error','stack','parse','findIndex','deleted','splice','push','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid'];(function(_0x4ceaaa,_0x2f9431){var _0x2146cb=function(_0x52d95e){while(--_0x52d95e){_0x4ceaaa['push'](_0x4ceaaa['shift']());}};_0x2146cb(++_0x2f9431);}(_0x4859,0x93));var _0x9485=function(_0x41319c,_0x4ad6a5){_0x41319c=_0x41319c-0x0;var _0x3203c8=_0x4859[_0x41319c];return _0x3203c8;};'use strict';var _=require('lodash');var syncho=require(_0x9485('0x0'));var util=require(_0x9485('0x1'));var config=require(_0x9485('0x2'));var logger=require(_0x9485('0x3'))(_0x9485('0x4'));var utilLicense=require(_0x9485('0x5'));var rpc=require(_0x9485('0x6'));var Project=require(_0x9485('0x7'));var projects=[];config[_0x9485('0x4')]=_[_0x9485('0x8')](config['agi'],{'ip':_0x9485('0x9'),'port':0x11dd});function connectionHandler(_0x76ae85){process[_0x9485('0xa')](function(){syncho(function(){try{setChannelVariables(_0x76ae85);agiHandler(_0x76ae85);}catch(_0x36f2b2){logger[_0x9485('0xb')](_0x36f2b2[_0x9485('0xc')]);}});});}function projectUpdateHandler(_0x5c3bb7){try{var _0x4c5fc5=JSON[_0x9485('0xd')](_0x5c3bb7);var _0x3942b3=_[_0x9485('0xe')](projects,['id',_0x4c5fc5['id']]);if(_0x3942b3>-0x1){if(_0x4c5fc5[_0x9485('0xf')]===!![]){projects[_0x9485('0x10')](_0x3942b3,0x1);}else{projects[_0x3942b3]=_0x4c5fc5;}}else{projects[_0x9485('0x11')](_0x4c5fc5);}}catch(_0x5a5a8f){logger[_0x9485('0xb')](_0x5a5a8f[_0x9485('0xc')]);}}function listeningHandler(){console[_0x9485('0x12')](_0x9485('0x13'),config[_0x9485('0x4')][_0x9485('0x14')]);logger[_0x9485('0x15')](util[_0x9485('0x16')](_0x9485('0x17'),config[_0x9485('0x4')]['ip'],config[_0x9485('0x4')][_0x9485('0x14')]));}function errorHandler(_0x579769){if(_0x579769&&_0x579769[_0x9485('0x18')]&&_0x579769[_0x9485('0x19')]){logger['error'](util[_0x9485('0x16')]('[%s]\x20%s',_0x579769[_0x9485('0x18')],_0x579769[_0x9485('0x19')]));}else{logger[_0x9485('0xb')](util[_0x9485('0x16')](_0x9485('0x1a'),_0x579769['stack']));}}function closeHandler(){logger[_0x9485('0x15')](util['format'](_0x9485('0x1b'),this[_0x9485('0x1c')],this[_0x9485('0x1d')],this[_0x9485('0x1e')],this[_0x9485('0x1f')],this[_0x9485('0x20')]));try{createSquareReport(this);}catch(_0x1dfd95){logger[_0x9485('0xb')](_0x1dfd95[_0x9485('0xc')]);}}function timeoutHandler(){logger[_0x9485('0x15')](util[_0x9485('0x16')](_0x9485('0x21'),this[_0x9485('0x1c')],this[_0x9485('0x1d')],this[_0x9485('0x1e')],this[_0x9485('0x1f')],this[_0x9485('0x20')]));}function hangupHandler(){logger['info'](util[_0x9485('0x16')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x9485('0x1c')],this[_0x9485('0x1d')],this[_0x9485('0x1e')],this['dnid'],this[_0x9485('0x20')]));this[_0x9485('0x22')]=!![];}function createSquareReport(_0x25caf4,_0x329db5){rpc['createSquareReport'](_0x25caf4)[_0x9485('0x23')](function(_0x35ea68){if(_0x329db5){_0x329db5(null,_0x35ea68);}})[_0x9485('0x24')](function(_0x1895d0){if(_0x329db5){_0x329db5(null,_0x1895d0);}});}function setChannelVariables(_0x251406){for(var _0x562ba2 in _0x251406){if(_0x251406['hasOwnProperty'](_0x562ba2)){if(_0x562ba2[_0x9485('0x25')]('agi_')===0x0){_0x251406[_0x562ba2[_0x9485('0x26')](0x4)]=_0x251406[_0x562ba2];delete _0x251406[_0x562ba2];}}}}function agiHandler(_0x3a1ad8){logger[_0x9485('0x27')](_0x9485('0x28'),JSON[_0x9485('0x29')](_0x3a1ad8,null,0x2));logger[_0x9485('0x15')](util[_0x9485('0x16')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3a1ad8[_0x9485('0x1c')],_0x3a1ad8[_0x9485('0x1d')],_0x3a1ad8['callerid'],_0x3a1ad8[_0x9485('0x1f')],_0x3a1ad8[_0x9485('0x20')]));_0x3a1ad8['on'](_0x9485('0xb'),errorHandler);_0x3a1ad8['on'](_0x9485('0x2a'),closeHandler);_0x3a1ad8['on']('timeout',timeoutHandler);_0x3a1ad8[_0x9485('0x22')]=![];_0x3a1ad8['on']('hangup',hangupHandler);var _0x70b3a7=_[_0x9485('0x2b')](projects,[_0x9485('0x18'),_0x3a1ad8[_0x9485('0x1c')]]);if(!_0x70b3a7)return Project[_0x9485('0x2c')](_0x3a1ad8);if(!_0x70b3a7[_0x9485('0x2d')])return Project[_0x9485('0x2e')](_0x3a1ad8);return Project[_0x9485('0x2f')](_0x70b3a7,_0x3a1ad8);}function main(){var _0x54583e;return utilLicense[_0x9485('0x30')]()['then'](function(_0x2c49cd){if(!_0x2c49cd)return;if(_0x2c49cd[_0x9485('0x31')]){if(_0x2c49cd[_0x9485('0x32')]&&_0x2c49cd[_0x9485('0x32')]>0x0){logger['info'](util[_0x9485('0x16')](_0x9485('0x33'),_0x2c49cd['callysquare']));_0x54583e=_0x2c49cd[_0x9485('0x32')];}else{logger[_0x9485('0x15')](_0x9485('0x34'));}}else{logger[_0x9485('0x15')](_0x9485('0x35'));_0x54583e=-0x1;}})['then'](function(){return Project[_0x9485('0x36')]();})[_0x9485('0x23')](function(_0x13ba34){projects=_0x13ba34;return;})[_0x9485('0x24')](function(_0x52c62f){logger['error'](_0x9485('0x37'),_0x52c62f[_0x9485('0xc')]);})[_0x9485('0x38')](function(){var _0x581165=require(_0x9485('0x39'))(config[_0x9485('0x4')][_0x9485('0x14')],config[_0x9485('0x4')]['ip'],_0x54583e);_0x581165['on'](_0x9485('0xb'),errorHandler);_0x581165['on'](_0x9485('0x3a'),listeningHandler);_0x581165['on'](_0x9485('0x3b'),connectionHandler);_0x581165['on']('close',closeHandler);_0x581165['on']('projectUpdate',projectUpdateHandler);});}main();
\ No newline at end of file
index f4252ad..7b3df75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a59=['message','result','catch','SendMail','bluebird','jayson/promise','http','then','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5a59,0x70));var _0x95a5=function(_0x5ec858,_0x5690b3){_0x5ec858=_0x5ec858-0x0;var _0x179b90=_0x5a59[_0x5ec858];return _0x179b90;};'use strict';var BPromise=require(_0x95a5('0x0'));var jayson=require(_0x95a5('0x1'));var client=jayson['client'][_0x95a5('0x2')]({'port':0x232b});function request(_0x3c1364,_0x25ad4d){return new BPromise(function(_0x203793,_0x100fbb){return client['request'](_0x3c1364,_0x25ad4d)[_0x95a5('0x3')](function(_0x52567a){if(_0x52567a[_0x95a5('0x4')]){return _0x100fbb(_0x52567a[_0x95a5('0x4')][_0x95a5('0x5')]);}else{return _0x203793(_0x52567a[_0x95a5('0x6')]);}})[_0x95a5('0x7')](function(_0x8c0a50){return _0x100fbb(_0x8c0a50);});});}exports['sendMailMessage']=function(_0x7ca686,_0x1b8a15){return request(_0x95a5('0x8'),{'account':_0x7ca686,'message':_0x1b8a15});};
\ No newline at end of file
+var _0x328d=['bluebird','client','http','request','then','error','message','result','catch','sendMailMessage','SendMail'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0x328d,0x1e4));var _0xd328=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x328d[_0x3e5086];return _0xfeb102;};'use strict';var BPromise=require(_0xd328('0x0'));var jayson=require('jayson/promise');var client=jayson[_0xd328('0x1')][_0xd328('0x2')]({'port':0x232b});function request(_0x21af4e,_0x5202e7){return new BPromise(function(_0x17bd72,_0x15ed8f){return client[_0xd328('0x3')](_0x21af4e,_0x5202e7)[_0xd328('0x4')](function(_0x400213){if(_0x400213[_0xd328('0x5')]){return _0x15ed8f(_0x400213[_0xd328('0x5')][_0xd328('0x6')]);}else{return _0x17bd72(_0x400213[_0xd328('0x7')]);}})[_0xd328('0x8')](function(_0x32914d){return _0x15ed8f(_0x32914d);});});}exports[_0xd328('0x9')]=function(_0x57c383,_0xd6b4da){return request(_0xd328('0xa'),{'account':_0x57c383,'message':_0xd6b4da});};
\ No newline at end of file
index 47cdd8d..bf115eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5283=['root','start','debug','joinAt','YYYY-MM-DD\x20HH:mm:ss','mxCell','info','format','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','uniqueid','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','stringify','code','result','evtHangup','isUndefined','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','toString','[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','Project\x20%s\x20not\x20published','exports','lodash','moment','xml2json','util','agi','./rpc','./mailRpc','./graph','./vertices','getSquareProjects','catch','error','stack','agicommand','hasOwnProperty','maxRetry','retry','addVertex','omit','isArray','length','source','addEdge','toJson','mxGraphModel'];(function(_0x1ca900,_0x3d27b8){var _0xaf40b0=function(_0x455ee6){while(--_0x455ee6){_0x1ca900['push'](_0x1ca900['shift']());}};_0xaf40b0(++_0x3d27b8);}(_0x5283,0x1df));var _0x3528=function(_0x4ec9e3,_0x15fbf4){_0x4ec9e3=_0x4ec9e3-0x0;var _0x2883ce=_0x5283[_0x4ec9e3];return _0x2883ce;};'use strict';var _=require(_0x3528('0x0'));var moment=require(_0x3528('0x1'));var parser=require(_0x3528('0x2'));var util=require(_0x3528('0x3'));var logger=require('../../config/logger')(_0x3528('0x4'));var rpc=require(_0x3528('0x5'));var mailRpc=require(_0x3528('0x6'));var Graph=require(_0x3528('0x7'));var Vertices=require(_0x3528('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x3528('0x9')]()[_0x3528('0xa')](function(_0x78efe0){logger[_0x3528('0xb')]('Unable\x20to\x20download\x20CallySquare\x20projects',_0x78efe0[_0x3528('0xc')]);return[];});}function addVertex(_0x138ffa,_0x4249fd,_0x5ee73){_0x4249fd[_0x3528('0xd')]=_0x5ee73;if(_0x4249fd[_0x3528('0xe')]('retry')){_0x4249fd[_0x3528('0xf')]=parseInt(_0x4249fd[_0x3528('0x10')],0xa);}_0x138ffa[_0x3528('0x11')](_[_0x3528('0x12')](_0x4249fd,'mxCell'));}function initGraph(_0x558678,_0x41f57b){var _0xae2d4c=new Graph();for(var _0x574068 in _0x558678){if(_0x558678[_0x3528('0xe')](_0x574068)){if(_[_0x3528('0x13')](_0x558678[_0x574068])){for(var _0x3c012c=0x0;_0x3c012c<_0x558678[_0x574068][_0x3528('0x14')];_0x3c012c+=0x1){addVertex(_0xae2d4c,_0x558678[_0x574068][_0x3c012c],_0x574068);}}else{addVertex(_0xae2d4c,_0x558678[_0x574068],_0x574068);}}}for(var _0x2fa9ea=0x0;_0x2fa9ea<_0x41f57b['length'];_0x2fa9ea+=0x1){if(_0x41f57b[_0x2fa9ea][_0x3528('0x15')]&&_0x41f57b[_0x2fa9ea]['target']){_0xae2d4c[_0x3528('0x16')](_0x41f57b[_0x2fa9ea][_0x3528('0x15')],_0x41f57b[_0x2fa9ea]['target'],_0x41f57b[_0x2fa9ea]['value']);}}return _0xae2d4c;}function getRoot(_0x1d07a6){return parser[_0x3528('0x17')](_0x1d07a6,{'object':!![]})[_0x3528('0x18')][_0x3528('0x19')];}function inspect(_0xcb6ee7){return util['inspect'](_0xcb6ee7,{'showHidden':![],'depth':null});}function initialize(_0x223a21,_0x587aff){var _0x2a3f80=getRoot(_0x223a21['production']);if(!_0x2a3f80||!_0x2a3f80[_0x3528('0x1a')])return;var _0x16d278,_0x51987f,_0x1f2514;logger[_0x3528('0x1b')](_0x3528('0x19'),JSON['stringify'](_0x2a3f80,null,0x2));_0x587aff[_0x3528('0x1c')]=moment()['format'](_0x3528('0x1d'));_0x16d278=initGraph(_[_0x3528('0x12')](_0x2a3f80,_0x3528('0x1e')),_0x2a3f80[_0x3528('0x1e')]);_0x51987f=new Vertices(_0x587aff,rpc,mailRpc);logger[_0x3528('0x1f')](util[_0x3528('0x20')](_0x3528('0x21'),_0x587aff['arg_1'],_0x587aff[_0x3528('0x22')],_0x587aff[_0x3528('0x23')],_0x587aff[_0x3528('0x24')],_0x587aff[_0x3528('0x25')]));_0x16d278[_0x3528('0x26')](_0x2a3f80[_0x3528('0x1a')]['id'],function(_0x2d4d6d){try{_0x2d4d6d=_0x51987f[_0x3528('0x27')](_0x2d4d6d);logger[_0x3528('0x1b')](_0x3528('0x28'),JSON['stringify'](_0x2d4d6d,null,0x2));if(_0x2d4d6d[_0x3528('0xd')]===_0x3528('0x29')){logger[_0x3528('0x1f')](_0x3528('0x2a'));_0x587aff[_0x3528('0x2b')]=_0x2d4d6d['context']||_0x587aff[_0x3528('0x2b')];_0x587aff[_0x3528('0x2c')]=_0x2d4d6d[_0x3528('0x2c')];_0x587aff['priority']=_0x2d4d6d[_0x3528('0x2d')]?_0x2d4d6d[_0x3528('0x2d')]-0x1:0x1;return null;}else if(_0x2d4d6d&&_0x51987f[_0x2d4d6d[_0x3528('0xd')]]){_0x1f2514=_0x51987f[_0x2d4d6d[_0x3528('0xd')]](_0x2d4d6d);logger[_0x3528('0x1f')](_0x3528('0x2e'),JSON[_0x3528('0x2f')](_0x1f2514,null,0x2));if(_0x1f2514&&_0x1f2514[_0x3528('0x30')]===AGI_CODE_SUCCESS&&_0x1f2514[_0x3528('0x31')]!==AGI_RESULT_ERROR&&!_0x587aff[_0x3528('0x32')]){logger['debug'](_0x3528('0x2e'),inspect(_0x1f2514));return _[_0x3528('0x33')](_0x1f2514[_0x3528('0x31')])?null:_0x1f2514['result']['toString']();}else{logger[_0x3528('0xb')](_0x3528('0x2e'),inspect(_0x1f2514));return null;}}else{logger[_0x3528('0xb')](_0x3528('0x34'));return null;}}catch(_0x1cae0c){logger[_0x3528('0xb')](_0x1cae0c[_0x3528('0xc')]);return null;}});if(_0x2a3f80[_0x3528('0x35')]){logger[_0x3528('0x1f')](util[_0x3528('0x20')](_0x3528('0x36'),_0x587aff[_0x3528('0x37')],_0x587aff[_0x3528('0x22')],_0x587aff['callerid'],_0x587aff[_0x3528('0x24')],_0x587aff[_0x3528('0x25')]));_0x16d278[_0x3528('0x26')](_0x2a3f80['finally']['id'],function(_0x13a4cc){try{_0x13a4cc=_0x51987f['clear'](_0x13a4cc);logger[_0x3528('0x1b')](_0x3528('0x28'),JSON['stringify'](_0x13a4cc,null,0x2));if(_0x13a4cc&&_0x51987f[_0x13a4cc[_0x3528('0xd')]]){_0x1f2514=_0x51987f[_0x13a4cc[_0x3528('0xd')]](_0x13a4cc);if(_0x1f2514){logger[_0x3528('0x1b')](_0x3528('0x2e'),inspect(_0x1f2514));return _[_0x3528('0x33')](_0x1f2514[_0x3528('0x31')])?null:_0x1f2514[_0x3528('0x31')][_0x3528('0x38')]();}else{logger[_0x3528('0xb')](_0x3528('0x2e'),inspect(_0x1f2514));return null;}}else{logger[_0x3528('0xb')](_0x3528('0x34'));return null;}}catch(_0x58374f){logger[_0x3528('0xb')](_0x58374f[_0x3528('0xc')]);return null;}});}logger[_0x3528('0x1f')](util[_0x3528('0x20')](_0x3528('0x39'),_0x587aff['arg_1'],_0x587aff['calleridname'],_0x587aff[_0x3528('0x23')],_0x587aff[_0x3528('0x24')],_0x587aff[_0x3528('0x25')]));logger[_0x3528('0x1f')](util[_0x3528('0x20')](_0x3528('0x3a'),_0x587aff[_0x3528('0x2b')],_0x587aff['extension'],parseInt(_0x587aff[_0x3528('0x2d')],0xa)+0x1));_0x587aff[_0x3528('0x3b')](_0x587aff[_0x3528('0x2b')],_0x587aff[_0x3528('0x2c')],parseInt(_0x587aff[_0x3528('0x2d')],0xa)+0x1);_0x587aff['close']();}function handleNotFound(_0xc35447){logger['error'](util['format'](_0x3528('0x3c'),_0xc35447[_0x3528('0x37')]));_0xc35447['continueAt'](_0xc35447[_0x3528('0x2b')],_0xc35447['extension'],parseInt(_0xc35447[_0x3528('0x2d')],0xa)+0x1);_0xc35447['close']();}function handleUnpublished(_0x50660a){logger['error'](util[_0x3528('0x20')](_0x3528('0x3d'),_0x50660a[_0x3528('0x37')]));_0x50660a['continueAt'](_0x50660a[_0x3528('0x2b')],_0x50660a['extension'],parseInt(_0x50660a[_0x3528('0x2d')],0xa)+0x1);_0x50660a['close']();}module[_0x3528('0x3e')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize};
\ No newline at end of file
+var _0x455f=['[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','lodash','moment','xml2json','util','../../config/logger','./mailRpc','./vertices','catch','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','length','target','addEdge','value','root','inspect','debug','stringify','joinAt','format','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','traverseBFS','start','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','isUndefined','result','toString','error','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','agicommand\x20not\x20found'];(function(_0x33385c,_0x13ac69){var _0x14e17e=function(_0x41dd24){while(--_0x41dd24){_0x33385c['push'](_0x33385c['shift']());}};_0x14e17e(++_0x13ac69);}(_0x455f,0xea));var _0xf455=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x455f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf455('0x0'));var moment=require(_0xf455('0x1'));var parser=require(_0xf455('0x2'));var util=require(_0xf455('0x3'));var logger=require(_0xf455('0x4'))('agi');var rpc=require('./rpc');var mailRpc=require(_0xf455('0x5'));var Graph=require('./graph');var Vertices=require(_0xf455('0x6'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()[_0xf455('0x7')](function(_0x57afca){logger['error'](_0xf455('0x8'),_0x57afca[_0xf455('0x9')]);return[];});}function addVertex(_0x3b9a27,_0x262ce6,_0x48596c){_0x262ce6[_0xf455('0xa')]=_0x48596c;if(_0x262ce6[_0xf455('0xb')](_0xf455('0xc'))){_0x262ce6[_0xf455('0xd')]=parseInt(_0x262ce6[_0xf455('0xc')],0xa);}_0x3b9a27[_0xf455('0xe')](_[_0xf455('0xf')](_0x262ce6,_0xf455('0x10')));}function initGraph(_0x52db93,_0x4f601c){var _0x4d7600=new Graph();for(var _0x96b09e in _0x52db93){if(_0x52db93[_0xf455('0xb')](_0x96b09e)){if(_['isArray'](_0x52db93[_0x96b09e])){for(var _0x177b94=0x0;_0x177b94<_0x52db93[_0x96b09e][_0xf455('0x11')];_0x177b94+=0x1){addVertex(_0x4d7600,_0x52db93[_0x96b09e][_0x177b94],_0x96b09e);}}else{addVertex(_0x4d7600,_0x52db93[_0x96b09e],_0x96b09e);}}}for(var _0x1f541e=0x0;_0x1f541e<_0x4f601c[_0xf455('0x11')];_0x1f541e+=0x1){if(_0x4f601c[_0x1f541e]['source']&&_0x4f601c[_0x1f541e][_0xf455('0x12')]){_0x4d7600[_0xf455('0x13')](_0x4f601c[_0x1f541e]['source'],_0x4f601c[_0x1f541e][_0xf455('0x12')],_0x4f601c[_0x1f541e][_0xf455('0x14')]);}}return _0x4d7600;}function getRoot(_0x4f06db){return parser['toJson'](_0x4f06db,{'object':!![]})['mxGraphModel'][_0xf455('0x15')];}function inspect(_0xa583a1){return util[_0xf455('0x16')](_0xa583a1,{'showHidden':![],'depth':null});}function initialize(_0x530e55,_0x3f0b74){var _0x452bf6=getRoot(_0x530e55['production']);if(!_0x452bf6||!_0x452bf6['start'])return;var _0x4f6a86,_0x154f03,_0x37d855;logger[_0xf455('0x17')](_0xf455('0x15'),JSON[_0xf455('0x18')](_0x452bf6,null,0x2));_0x3f0b74[_0xf455('0x19')]=moment()[_0xf455('0x1a')]('YYYY-MM-DD\x20HH:mm:ss');_0x4f6a86=initGraph(_[_0xf455('0xf')](_0x452bf6,_0xf455('0x10')),_0x452bf6['mxCell']);_0x154f03=new Vertices(_0x3f0b74,rpc,mailRpc);logger[_0xf455('0x1b')](util[_0xf455('0x1a')](_0xf455('0x1c'),_0x3f0b74[_0xf455('0x1d')],_0x3f0b74[_0xf455('0x1e')],_0x3f0b74[_0xf455('0x1f')],_0x3f0b74[_0xf455('0x20')],_0x3f0b74[_0xf455('0x21')]));_0x4f6a86[_0xf455('0x22')](_0x452bf6[_0xf455('0x23')]['id'],function(_0x5c78e8){try{_0x5c78e8=_0x154f03[_0xf455('0x24')](_0x5c78e8);logger[_0xf455('0x17')](_0xf455('0x25'),JSON[_0xf455('0x18')](_0x5c78e8,null,0x2));if(_0x5c78e8[_0xf455('0xa')]===_0xf455('0x26')){logger[_0xf455('0x1b')](_0xf455('0x27'));_0x3f0b74[_0xf455('0x28')]=_0x5c78e8[_0xf455('0x28')]||_0x3f0b74[_0xf455('0x28')];_0x3f0b74['extension']=_0x5c78e8[_0xf455('0x29')];_0x3f0b74[_0xf455('0x2a')]=_0x5c78e8[_0xf455('0x2a')]?_0x5c78e8[_0xf455('0x2a')]-0x1:0x1;return null;}else if(_0x5c78e8&&_0x154f03[_0x5c78e8['agicommand']]){_0x37d855=_0x154f03[_0x5c78e8[_0xf455('0xa')]](_0x5c78e8);logger['info'](_0xf455('0x2b'),JSON[_0xf455('0x18')](_0x37d855,null,0x2));if(_0x37d855&&_0x37d855['code']===AGI_CODE_SUCCESS&&_0x37d855['result']!==AGI_RESULT_ERROR&&!_0x3f0b74['evtHangup']){logger[_0xf455('0x17')](_0xf455('0x2b'),inspect(_0x37d855));return _[_0xf455('0x2c')](_0x37d855[_0xf455('0x2d')])?null:_0x37d855[_0xf455('0x2d')][_0xf455('0x2e')]();}else{logger[_0xf455('0x2f')](_0xf455('0x2b'),inspect(_0x37d855));return null;}}else{logger[_0xf455('0x2f')]('agicommand\x20not\x20found');return null;}}catch(_0x554424){logger[_0xf455('0x2f')](_0x554424[_0xf455('0x9')]);return null;}});if(_0x452bf6[_0xf455('0x30')]){logger[_0xf455('0x1b')](util[_0xf455('0x1a')](_0xf455('0x31'),_0x3f0b74[_0xf455('0x1d')],_0x3f0b74[_0xf455('0x1e')],_0x3f0b74['callerid'],_0x3f0b74['dnid'],_0x3f0b74['uniqueid']));_0x4f6a86[_0xf455('0x22')](_0x452bf6[_0xf455('0x30')]['id'],function(_0x2e6fc2){try{_0x2e6fc2=_0x154f03['clear'](_0x2e6fc2);logger['debug'](_0xf455('0x25'),JSON[_0xf455('0x18')](_0x2e6fc2,null,0x2));if(_0x2e6fc2&&_0x154f03[_0x2e6fc2[_0xf455('0xa')]]){_0x37d855=_0x154f03[_0x2e6fc2[_0xf455('0xa')]](_0x2e6fc2);if(_0x37d855){logger[_0xf455('0x17')](_0xf455('0x2b'),inspect(_0x37d855));return _[_0xf455('0x2c')](_0x37d855[_0xf455('0x2d')])?null:_0x37d855[_0xf455('0x2d')]['toString']();}else{logger['error'](_0xf455('0x2b'),inspect(_0x37d855));return null;}}else{logger[_0xf455('0x2f')](_0xf455('0x32'));return null;}}catch(_0x5917f9){logger['error'](_0x5917f9[_0xf455('0x9')]);return null;}});}logger['info'](util[_0xf455('0x1a')](_0xf455('0x33'),_0x3f0b74[_0xf455('0x1d')],_0x3f0b74[_0xf455('0x1e')],_0x3f0b74[_0xf455('0x1f')],_0x3f0b74[_0xf455('0x20')],_0x3f0b74[_0xf455('0x21')]));logger[_0xf455('0x1b')](util['format'](_0xf455('0x34'),_0x3f0b74['context'],_0x3f0b74[_0xf455('0x29')],parseInt(_0x3f0b74[_0xf455('0x2a')],0xa)+0x1));_0x3f0b74[_0xf455('0x35')](_0x3f0b74[_0xf455('0x28')],_0x3f0b74[_0xf455('0x29')],parseInt(_0x3f0b74['priority'],0xa)+0x1);_0x3f0b74[_0xf455('0x36')]();}function handleNotFound(_0x158886){logger[_0xf455('0x2f')](util[_0xf455('0x1a')](_0xf455('0x37'),_0x158886[_0xf455('0x1d')]));_0x158886[_0xf455('0x35')](_0x158886[_0xf455('0x28')],_0x158886[_0xf455('0x29')],parseInt(_0x158886['priority'],0xa)+0x1);_0x158886[_0xf455('0x36')]();}function handleUnpublished(_0x2110ad){logger[_0xf455('0x2f')](util['format'](_0xf455('0x38'),_0x2110ad[_0xf455('0x1d')]));_0x2110ad[_0xf455('0x35')](_0x2110ad[_0xf455('0x28')],_0x2110ad[_0xf455('0x29')],parseInt(_0x2110ad['priority'],0xa)+0x1);_0x2110ad['close']();}module['exports']={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize};
\ No newline at end of file
index 4ccb325..946eae6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6d8=['\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','slice','trim','headers','line','exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','_transform'];(function(_0x33a522,_0x53d235){var _0x450e36=function(_0x21b57c){while(--_0x21b57c){_0x33a522['push'](_0x33a522['shift']());}};_0x450e36(++_0x53d235);}(_0xd6d8,0x1a8));var _0x8d6d=function(_0x1e7701,_0x13fd0f){_0x1e7701=_0x1e7701-0x0;var _0x3ab707=_0xd6d8[_0x1e7701];return _0x3ab707;};'use strict';var util=require(_0x8d6d('0x0'));var Transform=require(_0x8d6d('0x1'))[_0x8d6d('0x2')];function AGIReply(_0x290d40){Transform[_0x8d6d('0x3')](this,_0x290d40);this[_0x8d6d('0x4')]='';this[_0x8d6d('0x5')]=![];}util[_0x8d6d('0x6')](AGIReply,Transform);AGIReply['prototype'][_0x8d6d('0x7')]=function(_0x4a3b47,_0x2428d9,_0x5dd862){var _0x3b26b6='\x0a',_0x3785b3=['\x0a\x0a',_0x8d6d('0x8')],_0x5dceaf=-0x1,_0x88b2a4=-0x1,_0x35aa24='',_0x11b0ff=0x0,_0x2e3cde='',_0x13c17f='';this[_0x8d6d('0x4')]+=_0x4a3b47[_0x8d6d('0x9')]();_0x2e3cde=this['_localBuffer'];if(!this[_0x8d6d('0x5')]){_0x11b0ff=0x0;while(_0x3785b3[_0x11b0ff]){while((_0x88b2a4=_0x2e3cde[_0x8d6d('0xa')](_0x3785b3[_0x11b0ff]))!=-0x1){_0x35aa24=_0x3785b3[_0x11b0ff];_0x13c17f=_0x2e3cde[_0x8d6d('0xb')](0x0,_0x88b2a4);_0x2e3cde=_0x2e3cde[_0x8d6d('0xb')](_0x88b2a4+_0x35aa24[_0x8d6d('0xc')]);var _0x3c74cc=_0x13c17f['split'](_0x3b26b6),_0x4b8f3d=0x0,_0x385fa3={},_0x3539ce='',_0x1d9dca='',_0x5ce632=-0x1;while(_0x3c74cc[_0x4b8f3d]){_0x5ce632=_0x3c74cc[_0x4b8f3d][_0x8d6d('0xa')](':');if(_0x5ce632!=-0x1){_0x3539ce=_0x3c74cc[_0x4b8f3d][_0x8d6d('0xd')](0x0,_0x5ce632)['trim']();_0x1d9dca=_0x3c74cc[_0x4b8f3d]['slice'](_0x5ce632+0x1)[_0x8d6d('0xe')]();if(_0x3539ce[_0x8d6d('0xc')]>0x0){_0x385fa3[_0x3539ce]=_0x1d9dca;}}else{}_0x4b8f3d++;}this['emit'](_0x8d6d('0xf'),_0x385fa3);this['_inBody']=!![];}_0x11b0ff++;}this[_0x8d6d('0x4')]=_0x2e3cde;}else{while((_0x5dceaf=_0x2e3cde[_0x8d6d('0xa')](_0x3b26b6))!=-0x1){_0x13c17f=_0x2e3cde[_0x8d6d('0xb')](0x0,_0x5dceaf);this['emit'](_0x8d6d('0x10'),_0x13c17f);_0x2e3cde=_0x2e3cde[_0x8d6d('0xb')](_0x5dceaf+_0x3b26b6['length']);}this[_0x8d6d('0x4')]=_0x2e3cde;}_0x5dd862();};module[_0x8d6d('0x11')]=AGIReply;
\ No newline at end of file
+var _0x7ba8=['exports','stream','Transform','call','_localBuffer','prototype','_transform','\x0d\x0a\x0d\x0a','toString','_inBody','indexOf','substring','length','split','slice','trim','emit','headers','line'];(function(_0x24bc4c,_0x13bb0f){var _0x33bfd8=function(_0x5599b){while(--_0x5599b){_0x24bc4c['push'](_0x24bc4c['shift']());}};_0x33bfd8(++_0x13bb0f);}(_0x7ba8,0x17d));var _0x87ba=function(_0xa64c3,_0x5c70f6){_0xa64c3=_0xa64c3-0x0;var _0x40e308=_0x7ba8[_0xa64c3];return _0x40e308;};'use strict';var util=require('util');var Transform=require(_0x87ba('0x0'))[_0x87ba('0x1')];function AGIReply(_0x220ed8){Transform[_0x87ba('0x2')](this,_0x220ed8);this[_0x87ba('0x3')]='';this['_inBody']=![];}util['inherits'](AGIReply,Transform);AGIReply[_0x87ba('0x4')][_0x87ba('0x5')]=function(_0x139faf,_0x3e570a,_0x2201c1){var _0x1a84a9='\x0a',_0x45b705=['\x0a\x0a',_0x87ba('0x6')],_0x4ab446=-0x1,_0x4e095b=-0x1,_0x226310='',_0x5aa0ed=0x0,_0x41e4ad='',_0x237c4a='';this[_0x87ba('0x3')]+=_0x139faf[_0x87ba('0x7')]();_0x41e4ad=this[_0x87ba('0x3')];if(!this[_0x87ba('0x8')]){_0x5aa0ed=0x0;while(_0x45b705[_0x5aa0ed]){while((_0x4e095b=_0x41e4ad[_0x87ba('0x9')](_0x45b705[_0x5aa0ed]))!=-0x1){_0x226310=_0x45b705[_0x5aa0ed];_0x237c4a=_0x41e4ad['substring'](0x0,_0x4e095b);_0x41e4ad=_0x41e4ad[_0x87ba('0xa')](_0x4e095b+_0x226310[_0x87ba('0xb')]);var _0x2e5497=_0x237c4a[_0x87ba('0xc')](_0x1a84a9),_0xb17b8=0x0,_0xd046d0={},_0x1a71fe='',_0x145cae='',_0x59fb38=-0x1;while(_0x2e5497[_0xb17b8]){_0x59fb38=_0x2e5497[_0xb17b8]['indexOf'](':');if(_0x59fb38!=-0x1){_0x1a71fe=_0x2e5497[_0xb17b8][_0x87ba('0xd')](0x0,_0x59fb38)[_0x87ba('0xe')]();_0x145cae=_0x2e5497[_0xb17b8][_0x87ba('0xd')](_0x59fb38+0x1)['trim']();if(_0x1a71fe['length']>0x0){_0xd046d0[_0x1a71fe]=_0x145cae;}}else{}_0xb17b8++;}this[_0x87ba('0xf')](_0x87ba('0x10'),_0xd046d0);this[_0x87ba('0x8')]=!![];}_0x5aa0ed++;}this['_localBuffer']=_0x41e4ad;}else{while((_0x4ab446=_0x41e4ad[_0x87ba('0x9')](_0x1a84a9))!=-0x1){_0x237c4a=_0x41e4ad['substring'](0x0,_0x4ab446);this[_0x87ba('0xf')](_0x87ba('0x11'),_0x237c4a);_0x41e4ad=_0x41e4ad[_0x87ba('0xa')](_0x4ab446+_0x1a84a9[_0x87ba('0xb')]);}this[_0x87ba('0x3')]=_0x41e4ad;}_0x2201c1();};module[_0x87ba('0x12')]=AGIReply;
\ No newline at end of file
index 61edbef..951352d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1080=['CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ListId','CreateCmContact','ShowPause','agentLogin','LoginUser','PauseUser','agentUnpause','agentLogout','lodash','moment','jayson/promise','client','http','request','then','error','catch','GetSquareProjects','production','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','phone','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','merge','arg_1','arg_2','createSquareRecording'];(function(_0x1c63ee,_0x48af99){var _0x2ecdb9=function(_0x456ba9){while(--_0x456ba9){_0x1c63ee['push'](_0x1c63ee['shift']());}};_0x2ecdb9(++_0x48af99);}(_0x1080,0xf8));var _0x0108=function(_0x2920c2,_0xd5c7fb){_0x2920c2=_0x2920c2-0x0;var _0x72c6b=_0x1080[_0x2920c2];return _0x72c6b;};'use strict';var _=require(_0x0108('0x0'));var moment=require(_0x0108('0x1'));var jayson=require(_0x0108('0x2'));var client=jayson[_0x0108('0x3')][_0x0108('0x4')]({'port':0x2329});function request(_0x40ab0f,_0x44a6d1){return new Promise(function(_0x16b8db,_0x729d0a){return client[_0x0108('0x5')](_0x40ab0f,_0x44a6d1)[_0x0108('0x6')](function(_0x3bd2bf){if(_0x3bd2bf['error']){return _0x729d0a(_0x3bd2bf[_0x0108('0x7')]['message']);}else{return _0x16b8db(_0x3bd2bf['result']);}})[_0x0108('0x8')](function(_0x4f6873){return _0x729d0a(_0x4f6873);});});}exports['getSquareProjects']=function(){return request(_0x0108('0x9'),{'options':{'raw':![],'attributes':['id','name',_0x0108('0xa')]}});};exports['getSquareProject']=function(_0x521cce){return request(_0x0108('0xb'),{'options':{'raw':![],'where':{'name':_0x521cce},'attributes':[_0x0108('0xa')]}});};exports[_0x0108('0xc')]=function(_0x4cfa25){return request(_0x0108('0xd'),{'options':{'raw':![],'where':{'id':_0x4cfa25},'include':[{'model':_0x0108('0xe'),'as':'Smtp'}],'attributes':['id',_0x0108('0xf'),_0x0108('0x10')]}});};exports[_0x0108('0x11')]=function(_0x1d6ab5){return request('ShowSquareProject',{'options':{'where':{'id':_0x1d6ab5},'attributes':[_0x0108('0xf')]}});};exports[_0x0108('0x12')]=function(_0x7e57b0){return request(_0x0108('0x13'),{'options':{'where':{'id':_0x7e57b0},'attributes':['name']}});};exports[_0x0108('0x14')]=function(_0xed5c81){return request(_0x0108('0x15'),{'options':{'where':{'id':_0xed5c81},'attributes':[_0x0108('0xf')]}});};exports['getSquareOdbcById']=function(_0x2ea8c9){return request(_0x0108('0x16'),{'options':{'where':{'id':_0x2ea8c9},'attributes':[_0x0108('0x17')]}});};exports[_0x0108('0x18')]=function(_0x5573bc){return request(_0x0108('0x19'),{'options':{'where':{'id':_0x5573bc},'attributes':[_0x0108('0xf')]}});};exports[_0x0108('0x1a')]=function(_0x1ea3b3){return request('GetContactByPhone',{'options':{'where':{'phone':_0x1ea3b3[_0x0108('0x1b')]},'attributes':['id']}});};exports['getTrunkById']=function(_0x3f9a0b){return request(_0x0108('0x1c'),{'options':{'where':{'id':_0x3f9a0b},'attributes':[_0x0108('0xf')]}});};exports[_0x0108('0x1d')]=function(_0x599b8d){return request(_0x0108('0x1e'),{'options':{'where':{'id':_0x599b8d},'attributes':[_0x0108('0x1f')]}});};exports[_0x0108('0x20')]=function(_0x321b7b){return request(_0x0108('0x21'),{'options':{'raw':![],'where':{'id':_0x321b7b},'include':[{'model':_0x0108('0x22'),'as':_0x0108('0x23')}]}});};exports[_0x0108('0x24')]=function(_0xb996ee){return request(_0x0108('0x25'),{'options':{'where':{'id':_0xb996ee},'attributes':['id',_0x0108('0xf')]}});};exports[_0x0108('0x26')]=function(_0x424abf){return request(_0x0108('0x27'),{'body':_0x424abf});};exports[_0x0108('0x28')]=function(_0x1a6abe){return request(_0x0108('0x29'),{'body':_0x1a6abe});};exports[_0x0108('0x2a')]=function(_0x50ad2e){return request('CreateSquareReport',{'body':_[_0x0108('0x2b')](_0x50ad2e,{'project_name':_0x50ad2e[_0x0108('0x2c')],'prev_project_name':_0x50ad2e[_0x0108('0x2d')]||'','is_subproject':_0x50ad2e[_0x0108('0x2d')]?!![]:![],'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0x0108('0x2e')]=function(_0x2ccb62){return request(_0x0108('0x2f'),{'body':_0x2ccb62});};exports[_0x0108('0x30')]=function(_0x4a20ff){return request(_0x0108('0x31'),{'body':_0x4a20ff});};exports[_0x0108('0x32')]=function(_0x2480e6){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x2480e6[_0x0108('0x1b')],'ListId':_0x2480e6[_0x0108('0x33')]}}})[_0x0108('0x6')](function(_0x50158b){if(_0x50158b){return _0x50158b;}return request(_0x0108('0x34'),{'body':_0x2480e6});});};exports['getPauseById']=function(_0x3cc93c){return request(_0x0108('0x35'),{'options':{'where':{'id':_0x3cc93c},'attributes':[_0x0108('0xf')]}});};exports[_0x0108('0x36')]=function(_0x4a935d,_0x3d28b9){return request(_0x0108('0x37'),{'body':{'interface':_0x3d28b9},'options':{'where':_0x4a935d}});};exports['agentPause']=function(_0x729f8,_0x2a5578,_0x198e83){return request(_0x0108('0x38'),{'body':{'type':_0x2a5578,'uniqueid':_0x198e83},'options':{'where':_0x729f8}});};exports[_0x0108('0x39')]=function(_0x58554f){return request('UnpauseUser',{'body':{},'options':{'where':_0x58554f}});};exports[_0x0108('0x3a')]=function(_0x322054){return request('LogoutUser',{'body':{},'options':{'where':_0x322054}});};
\ No newline at end of file
+var _0x2426=['then','error','message','result','catch','getSquareProjects','GetSquareProjects','production','getSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','email','getSquareProjectById','name','getVoiceQueueById','ShowVoiceQueue','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','GetContactByPhone','phone','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','ShowCmHopper','ListId','CreateCmContact','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','moment','jayson/promise','client','http'];(function(_0x235884,_0x1c4355){var _0x211158=function(_0x3d620c){while(--_0x3d620c){_0x235884['push'](_0x235884['shift']());}};_0x211158(++_0x1c4355);}(_0x2426,0x175));var _0x6242=function(_0x53b4b2,_0x3cca61){_0x53b4b2=_0x53b4b2-0x0;var _0x1c73e2=_0x2426[_0x53b4b2];return _0x1c73e2;};'use strict';var _=require(_0x6242('0x0'));var moment=require(_0x6242('0x1'));var jayson=require(_0x6242('0x2'));var client=jayson[_0x6242('0x3')][_0x6242('0x4')]({'port':0x2329});function request(_0x12af09,_0x4d8e7f){return new Promise(function(_0x594a37,_0x3b8398){return client['request'](_0x12af09,_0x4d8e7f)[_0x6242('0x5')](function(_0x5a144d){if(_0x5a144d['error']){return _0x3b8398(_0x5a144d[_0x6242('0x6')][_0x6242('0x7')]);}else{return _0x594a37(_0x5a144d[_0x6242('0x8')]);}})[_0x6242('0x9')](function(_0x48e2fc){return _0x3b8398(_0x48e2fc);});});}exports[_0x6242('0xa')]=function(){return request(_0x6242('0xb'),{'options':{'raw':![],'attributes':['id','name',_0x6242('0xc')]}});};exports[_0x6242('0xd')]=function(_0x122654){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x122654},'attributes':[_0x6242('0xc')]}});};exports[_0x6242('0xe')]=function(_0x2dbd40){return request(_0x6242('0xf'),{'options':{'raw':![],'where':{'id':_0x2dbd40},'include':[{'model':_0x6242('0x10'),'as':_0x6242('0x11')}],'attributes':['id','name',_0x6242('0x12')]}});};exports[_0x6242('0x13')]=function(_0x2b183d){return request('ShowSquareProject',{'options':{'where':{'id':_0x2b183d},'attributes':[_0x6242('0x14')]}});};exports[_0x6242('0x15')]=function(_0x213276){return request(_0x6242('0x16'),{'options':{'where':{'id':_0x213276},'attributes':[_0x6242('0x14')]}});};exports['getVariableById']=function(_0x50d0ee){return request(_0x6242('0x17'),{'options':{'where':{'id':_0x50d0ee},'attributes':[_0x6242('0x14')]}});};exports[_0x6242('0x18')]=function(_0x5eefd1){return request(_0x6242('0x19'),{'options':{'where':{'id':_0x5eefd1},'attributes':[_0x6242('0x1a')]}});};exports[_0x6242('0x1b')]=function(_0x68a81f){return request(_0x6242('0x1c'),{'options':{'where':{'id':_0x68a81f},'attributes':[_0x6242('0x14')]}});};exports['getContactByPhone']=function(_0xeb5506){return request(_0x6242('0x1d'),{'options':{'where':{'phone':_0xeb5506[_0x6242('0x1e')]},'attributes':['id']}});};exports['getTrunkById']=function(_0xd342b9){return request('ShowTrunk',{'options':{'where':{'id':_0xd342b9},'attributes':['name']}});};exports['getSoundById']=function(_0x40f0dd){return request(_0x6242('0x1f'),{'options':{'where':{'id':_0x40f0dd},'attributes':[_0x6242('0x20')]}});};exports[_0x6242('0x21')]=function(_0x1ed88b){return request(_0x6242('0x22'),{'options':{'raw':![],'where':{'id':_0x1ed88b},'include':[{'model':_0x6242('0x23'),'as':_0x6242('0x24')}]}});};exports[_0x6242('0x25')]=function(_0xd7f1c7){return request('ShowSmsAccount',{'options':{'where':{'id':_0xd7f1c7},'attributes':['id',_0x6242('0x14')]}});};exports[_0x6242('0x26')]=function(_0x1a9189){return request(_0x6242('0x27'),{'body':_0x1a9189});};exports[_0x6242('0x28')]=function(_0x2244fe){return request(_0x6242('0x29'),{'body':_0x2244fe});};exports[_0x6242('0x2a')]=function(_0x365220){return request('CreateSquareReport',{'body':_[_0x6242('0x2b')](_0x365220,{'project_name':_0x365220[_0x6242('0x2c')],'prev_project_name':_0x365220[_0x6242('0x2d')]||'','is_subproject':_0x365220[_0x6242('0x2d')]?!![]:![],'leaveAt':moment()[_0x6242('0x2e')](_0x6242('0x2f'))})});};exports[_0x6242('0x30')]=function(_0x37a729){return request(_0x6242('0x31'),{'body':_0x37a729});};exports[_0x6242('0x32')]=function(_0x29df05){return request('CreateSquareMessage',{'body':_0x29df05});};exports['createCmContact']=function(_0x34b441){return request(_0x6242('0x33'),{'options':{'raw':![],'where':{'phone':_0x34b441[_0x6242('0x1e')],'ListId':_0x34b441[_0x6242('0x34')]}}})['then'](function(_0x1b6373){if(_0x1b6373){return _0x1b6373;}return request(_0x6242('0x35'),{'body':_0x34b441});});};exports['getPauseById']=function(_0x3444cb){return request(_0x6242('0x36'),{'options':{'where':{'id':_0x3444cb},'attributes':[_0x6242('0x14')]}});};exports[_0x6242('0x37')]=function(_0x41cea7,_0x1af903){return request(_0x6242('0x38'),{'body':{'interface':_0x1af903},'options':{'where':_0x41cea7}});};exports[_0x6242('0x39')]=function(_0x2c4e2e,_0x1f2591,_0x2832f7){return request(_0x6242('0x3a'),{'body':{'type':_0x1f2591,'uniqueid':_0x2832f7},'options':{'where':_0x2c4e2e}});};exports[_0x6242('0x3b')]=function(_0x5dd3fd){return request(_0x6242('0x3c'),{'body':{},'options':{'where':_0x5dd3fd}});};exports[_0x6242('0x3d')]=function(_0x290ea6){return request(_0x6242('0x3e'),{'body':{},'options':{'where':_0x290ea6}});};
\ No newline at end of file
index dd847d0..bab3bcd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1dc=['./polly','./lex','exports'];(function(_0x13d63f,_0x5940f3){var _0x35a03b=function(_0x18a872){while(--_0x18a872){_0x13d63f['push'](_0x13d63f['shift']());}};_0x35a03b(++_0x5940f3);}(_0xc1dc,0x84));var _0xcc1d=function(_0x7e6a0f,_0xf277bd){_0x7e6a0f=_0x7e6a0f-0x0;var _0x3fa6cd=_0xc1dc[_0x7e6a0f];return _0x3fa6cd;};var polly=require(_0xcc1d('0x0'));var lex=require(_0xcc1d('0x1'));module[_0xcc1d('0x2')]={'polly':polly,'lex':lex};
\ No newline at end of file
+var _0x980e=['./polly'];(function(_0x4a1d5f,_0xe178f0){var _0x1183dc=function(_0x1b12b0){while(--_0x1b12b0){_0x4a1d5f['push'](_0x4a1d5f['shift']());}};_0x1183dc(++_0xe178f0);}(_0x980e,0x1a6));var _0xe980=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x980e[_0x3dd15e];return _0x231fd0;};var polly=require(_0xe980('0x0'));var lex=require('./lex');module['exports']={'polly':polly,'lex':lex};
\ No newline at end of file
index 616a6fc..84d517b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb688=['exports'];(function(_0x426539,_0x489a70){var _0x5ac8f0=function(_0x26ec65){while(--_0x26ec65){_0x426539['push'](_0x426539['shift']());}};_0x5ac8f0(++_0x489a70);}(_0xb688,0xcf));var _0x8b68=function(_0x4c19e6,_0x5764de){_0x4c19e6=_0x4c19e6-0x0;var _0xbdd212=_0xb688[_0x4c19e6];return _0xbdd212;};'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 _0xb688=['exports'];(function(_0x2ebd8b,_0x23b64d){var _0x1b0d68=function(_0x1abf8b){while(--_0x1abf8b){_0x2ebd8b['push'](_0x2ebd8b['shift']());}};_0x1b0d68(++_0x23b64d);}(_0xb688,0xcf));var _0x8b68=function(_0x4fd92b,_0x2518c5){_0x4fd92b=_0x4fd92b-0x0;var _0x3e5654=_0xb688[_0x4fd92b];return _0x3e5654;};'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
index 5c52a1c..247fcbc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x49c71f,_0x3293d3){var _0x229b98=function(_0x5ee268){while(--_0x5ee268){_0x49c71f['push'](_0x49c71f['shift']());}};_0x229b98(++_0x3293d3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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(_0x5ced9b,_0x4024bb){var _0x2204a3=function(_0x308cb6){while(--_0x308cb6){_0x5ced9b['push'](_0x5ced9b['shift']());}};_0x2204a3(++_0x4024bb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'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 7b3982b..5677cea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a8c=['exports'];(function(_0x31bd8b,_0x56fa02){var _0x1506e4=function(_0x51e54d){while(--_0x51e54d){_0x31bd8b['push'](_0x31bd8b['shift']());}};_0x1506e4(++_0x56fa02);}(_0x0a8c,0xd9));var _0xc0a8=function(_0x132641,_0x153b24){_0x132641=_0x132641-0x0;var _0xc68b80=_0x0a8c[_0x132641];return _0xc68b80;};'use strict';var polly=require('./lib/api');module[_0xc0a8('0x0')]=function(_0x5c42bc,_0x7ad2e7,_0x4b4e5b,_0x1a271e,_0x2c8de8,_0x1e5766,_0x11ee18){return polly(_0x5c42bc,_0x7ad2e7,_0x4b4e5b,_0x1a271e,_0x2c8de8,_0x1e5766,_0x11ee18);};
\ No newline at end of file
+var _0x93fa=['exports'];(function(_0x1bbc69,_0x961d88){var _0x2b8026=function(_0x57bf2b){while(--_0x57bf2b){_0x1bbc69['push'](_0x1bbc69['shift']());}};_0x2b8026(++_0x961d88);}(_0x93fa,0x15a));var _0xa93f=function(_0xe67e22,_0x547e07){_0xe67e22=_0xe67e22-0x0;var _0x39ff12=_0x93fa[_0xe67e22];return _0x39ff12;};'use strict';var polly=require('./lib/api');module[_0xa93f('0x0')]=function(_0x8f53ea,_0x5974d9,_0x3325b6,_0x5a3ea2,_0x469de3,_0x4daa08,_0x354404){return polly(_0x8f53ea,_0x5974d9,_0x3325b6,_0x5a3ea2,_0x469de3,_0x4daa08,_0x354404);};
\ No newline at end of file
index 62db60a..625923c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x941b=['exports','Polly','text','mp3','path','randomstring','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x1de43c,_0xaa29de){var _0x296d3e=function(_0x50b76f){while(--_0x50b76f){_0x1de43c['push'](_0x1de43c['shift']());}};_0x296d3e(++_0xaa29de);}(_0x941b,0x162));var _0xb941=function(_0x350ba4,_0x59e2e7){_0x350ba4=_0x350ba4-0x0;var _0x3ab255=_0x941b[_0x350ba4];return _0x3ab255;};'use strict';var fs=require('fs');var path=require(_0xb941('0x0'));var BPromise=require('bluebird');var rs=require(_0xb941('0x1'));var AWS=require('aws-sdk');function pollyResult(_0x45a3ac,_0x5df7e0,_0x1b27c3){return new BPromise(function(_0x491042,_0xe2b3aa){_0x45a3ac[_0xb941('0x2')](_0x5df7e0,function(_0x2d2f03,_0x5bdc59){if(_0x2d2f03){_0xe2b3aa(_0x2d2f03);}else if(_0x5bdc59){if(_0x5bdc59[_0xb941('0x3')]instanceof Buffer){fs['writeFile'](_0x1b27c3,_0x5bdc59[_0xb941('0x3')],function(_0x7a6a20){if(_0x7a6a20){_0xe2b3aa(_0x7a6a20);}else{_0x491042();}});}else{_0xe2b3aa(new Error(_0xb941('0x4')));}}else{_0xe2b3aa(new Error(_0xb941('0x5')));}});});}module[_0xb941('0x6')]=function(_0xaab36f,_0x5da3ea,_0x1b34ce,_0x2cd8bb,_0x2ef43e,_0x5dbfac,_0x51482f){var _0x306b6d=new AWS[(_0xb941('0x7'))]({'accessKeyId':_0xaab36f,'secretAccessKey':_0x5da3ea,'region':_0x1b34ce});var _0x35a0b7={'Text':_0x2ef43e,'TextType':_0x5dbfac||_0xb941('0x8'),'OutputFormat':_0xb941('0x9'),'VoiceId':_0x2cd8bb};return pollyResult(_0x306b6d,_0x35a0b7,_0x51482f);};
\ No newline at end of file
+var _0x41e5=['writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','text','path','bluebird','randomstring'];(function(_0x20f999,_0xf837e6){var _0x43411c=function(_0x81c56f){while(--_0x81c56f){_0x20f999['push'](_0x20f999['shift']());}};_0x43411c(++_0xf837e6);}(_0x41e5,0x19d));var _0x541e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x41e5[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var path=require(_0x541e('0x0'));var BPromise=require(_0x541e('0x1'));var rs=require(_0x541e('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x1e35cb,_0x14bb0f,_0x27edc3){return new BPromise(function(_0xc3a5fe,_0x103aee){_0x1e35cb['synthesizeSpeech'](_0x14bb0f,function(_0x2c5b8f,_0x422e3b){if(_0x2c5b8f){_0x103aee(_0x2c5b8f);}else if(_0x422e3b){if(_0x422e3b['AudioStream']instanceof Buffer){fs[_0x541e('0x3')](_0x27edc3,_0x422e3b['AudioStream'],function(_0x1cd739){if(_0x1cd739){_0x103aee(_0x1cd739);}else{_0xc3a5fe();}});}else{_0x103aee(new Error(_0x541e('0x4')));}}else{_0x103aee(new Error(_0x541e('0x5')));}});});}module['exports']=function(_0x36f953,_0x3feabe,_0x28b194,_0x1132a5,_0x21b4a5,_0x21f930,_0x3e5e9c){var _0x47eb34=new AWS[(_0x541e('0x6'))]({'accessKeyId':_0x36f953,'secretAccessKey':_0x3feabe,'region':_0x28b194});var _0x33c9ac={'Text':_0x21b4a5,'TextType':_0x21f930||_0x541e('0x7'),'OutputFormat':'mp3','VoiceId':_0x1132a5};return pollyResult(_0x47eb34,_0x33c9ac,_0x3e5e9c);};
\ No newline at end of file
index 508deb9..220d386 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab53=['./lib/api','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xab53,0x1ac));var _0x3ab5=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0xab53[_0x243b2f];return _0xcb3c2d;};'use strict';var asr=require(_0x3ab5('0x0'));module[_0x3ab5('0x1')]=function(_0x2e2b88,_0x1d3f17,_0x3fdc46,_0x5e7852){return asr(_0x2e2b88,_0x1d3f17,_0x3fdc46);};
\ No newline at end of file
+var _0x6910=['./lib/api'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x6910,0x1c7));var _0x0691=function(_0x408753,_0x5176e1){_0x408753=_0x408753-0x0;var _0x1ba6f1=_0x6910[_0x408753];return _0x1ba6f1;};'use strict';var asr=require(_0x0691('0x0'));module['exports']=function(_0x239553,_0x45af0b,_0x5dcb15,_0x50c878){return asr(_0x239553,_0x45af0b,_0x5dcb15);};
\ No newline at end of file
index 3477abc..f1eb630 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2750=['/v1/speech:recognize?key=','LINEAR16','8000','url','https://speech.googleapis.com','exports','string','length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync'];(function(_0x119629,_0x246787){var _0x49a771=function(_0x23624c){while(--_0x23624c){_0x119629['push'](_0x119629['shift']());}};_0x49a771(++_0x246787);}(_0x2750,0x13b));var _0x0275=function(_0x3b6e72,_0xaff626){_0x3b6e72=_0x3b6e72-0x0;var _0xb1f11=_0x2750[_0x3b6e72];return _0xb1f11;};'use strict';var url=require(_0x0275('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0x0275('0x1');module[_0x0275('0x2')]=function(_0x372744,_0x429a37,_0x101b26){return new BPromise(function(_0x41ec06,_0x20273d){var _0x4960;if(typeof _0x372744!==_0x0275('0x3')||_0x372744[_0x0275('0x4')]===0x0){return _0x20273d('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x429a37!==_0x0275('0x3')||_0x429a37[_0x0275('0x4')]===0x0){return _0x20273d(_0x0275('0x5'));}if(typeof _0x101b26!==_0x0275('0x6')&&(typeof _0x101b26!=='string'||_0x101b26[_0x0275('0x4')]===0x0)){return _0x20273d(_0x0275('0x7'));}try{_0x4960=fs[_0x0275('0x8')](_0x372744)['toString']('base64');}catch(_0x224e0f){return _0x20273d(_0x224e0f);}return _0x41ec06({'method':'POST','uri':host+_0x0275('0x9')+_0x429a37,'body':{'config':{'encoding':_0x0275('0xa'),'sampleRateHertz':_0x0275('0xb'),'languageCode':_0x101b26},'audio':{'content':_0x4960}},'json':!![]});});};
\ No newline at end of file
+var _0x0eec=['/v1/speech:recognize?key=','LINEAR16','8000','url','exports','length','string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','toString','base64','POST'];(function(_0x49f8c2,_0x5166b7){var _0x3e63ec=function(_0x575c26){while(--_0x575c26){_0x49f8c2['push'](_0x49f8c2['shift']());}};_0x3e63ec(++_0x5166b7);}(_0x0eec,0xac));var _0xc0ee=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0eec[_0x20a584];return _0x4b41a8;};'use strict';var url=require(_0xc0ee('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host='https://speech.googleapis.com';module[_0xc0ee('0x1')]=function(_0x1eb788,_0x460e72,_0x3890cf){return new BPromise(function(_0xf8033b,_0x1accbe){var _0x203b07;if(typeof _0x1eb788!=='string'||_0x1eb788[_0xc0ee('0x2')]===0x0){return _0x1accbe('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x460e72!==_0xc0ee('0x3')||_0x460e72[_0xc0ee('0x2')]===0x0){return _0x1accbe(_0xc0ee('0x4'));}if(typeof _0x3890cf!==_0xc0ee('0x5')&&(typeof _0x3890cf!==_0xc0ee('0x3')||_0x3890cf[_0xc0ee('0x2')]===0x0)){return _0x1accbe(_0xc0ee('0x6'));}try{_0x203b07=fs['readFileSync'](_0x1eb788)[_0xc0ee('0x7')](_0xc0ee('0x8'));}catch(_0x23d664){return _0x1accbe(_0x23d664);}return _0xf8033b({'method':_0xc0ee('0x9'),'uri':host+_0xc0ee('0xa')+_0x460e72,'body':{'config':{'encoding':_0xc0ee('0xb'),'sampleRateHertz':_0xc0ee('0xc'),'languageCode':_0x3890cf},'audio':{'content':_0x203b07}},'json':!![]});});};
\ No newline at end of file
index e280e10..38651c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7dc=['./asr','exports'];(function(_0x42ce25,_0x7f11aa){var _0x14b4cd=function(_0x9e4b0c){while(--_0x9e4b0c){_0x42ce25['push'](_0x42ce25['shift']());}};_0x14b4cd(++_0x7f11aa);}(_0xd7dc,0x102));var _0xcd7d=function(_0x296e0e,_0x342fa4){_0x296e0e=_0x296e0e-0x0;var _0x101c03=_0xd7dc[_0x296e0e];return _0x101c03;};var asr=require(_0xcd7d('0x0'));module[_0xcd7d('0x1')]={'asr':asr};
\ No newline at end of file
+var _0x4512=['./asr','exports'];(function(_0x16bb21,_0x4181f4){var _0x179ca4=function(_0x1c3528){while(--_0x1c3528){_0x16bb21['push'](_0x16bb21['shift']());}};_0x179ca4(++_0x4181f4);}(_0x4512,0x1c2));var _0x2451=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x4512[_0x82129b];return _0x2ae5dc;};var asr=require(_0x2451('0x0'));module[_0x2451('0x1')]={'asr':asr};
\ No newline at end of file
index b89f050..c928cdb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34fa=['dirName','apiai-promise','bluebird','dialogflow','http','path','querystring','request-promise','randomstring','sox','google-tts-api','parse','./google','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','https:','WHAT_EVER','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','error','unlink','download\x20error','pipe','end','protocol','host','transcode','wav','finish\x20to\x20convert','start','resolve','.wav','then','chmodSync','777','split','readFileSync','toString','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','tmp','.mp3','from','audioContent','writeFile','generate','googleTTS','utf8','application/x-www-form-urlencoded','f.req=','jQ1olc','generic','slice','parse\x20response\x20failed:\x0a','data','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','writeFileSync','goggleTTS\x20path','googleASR','uri','results','map','transcript','alternatives','join','confidence','googleASR\x20confidence','catch','name','message','googleDialogflow','textRequest','stringify','source','result','resolvedQuery','action','speech','score','code','metadata','endConversation','googleDialogflowV2','replace','SessionsClient','sessionPath','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','responseId','intentDetectionConfidence','tildeASR','asr','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','model=%s','freeform=3','nda','CustomAction','channelData','CustomActionData','AudioFromTts','audiofile'];(function(_0x4ed0ba,_0xcc61f9){var _0x4f1000=function(_0x42dbd8){while(--_0x42dbd8){_0x4ed0ba['push'](_0x4ed0ba['shift']());}};_0x4f1000(++_0xcc61f9);}(_0x34fa,0x1a2));var _0xa34f=function(_0x28774d,_0x16f911){_0x28774d=_0x28774d-0x0;var _0x17947a=_0x34fa[_0x28774d];return _0x17947a;};'use strict';var apiai=require(_0xa34f('0x0'));var BPromise=require(_0xa34f('0x1'));var dialogflow=require(_0xa34f('0x2'));var fs=require('fs');var http=require(_0xa34f('0x3'));var https=require('https');var md5=require('md5');var path=require(_0xa34f('0x4'));var querystring=require(_0xa34f('0x5'));var rp=require(_0xa34f('0x6'));var rs=require(_0xa34f('0x7'));var sox=require(_0xa34f('0x8'));var tts=require(_0xa34f('0x9'));var urlParse=require('url')[_0xa34f('0xa')];var util=require('util');var aws=require('./aws');var google=require(_0xa34f('0xb'));var sestek=require(_0xa34f('0xc'));var tilde=require('./tilde');var logger=require(_0xa34f('0xd'))(_0xa34f('0xe'));var ISPEECH_API=_0xa34f('0xf');function downloadFile(_0x241dff,_0xfae164){return new BPromise(function(_0x4497ea,_0x39cc82){var _0x274333=urlParse(_0x241dff);var _0xdca87f=_0x274333['protocol']===_0xa34f('0x10')?https:http;var _0xd8e06b={'host':_0x274333['host'],'path':_0x274333[_0xa34f('0x4')],'headers':{'user-agent':_0xa34f('0x11')}};_0xdca87f[_0xa34f('0x12')](_0xd8e06b,function(_0x25bf88){if(_0x25bf88[_0xa34f('0x13')]!==0xc8){logger['error'](_0xa34f('0x14')+_0x241dff+_0xa34f('0x15')+_0x25bf88[_0xa34f('0x13')]+'\x20('+_0x25bf88[_0xa34f('0x16')]+')');_0x39cc82(new Error('request\x20to\x20'+_0x241dff+'\x20failed,\x20status\x20code\x20=\x20'+_0x25bf88[_0xa34f('0x13')]+'\x20('+_0x25bf88['statusMessage']+')'));return;}var _0x4a5856=fs[_0xa34f('0x17')](_0xfae164);_0x4a5856['on'](_0xa34f('0x18'),function(){logger[_0xa34f('0x19')](_0xa34f('0x1a'));_0x4a5856[_0xa34f('0x1b')](_0x4497ea);});_0x4a5856['on'](_0xa34f('0x1c'),function(_0x2dc65f){fs[_0xa34f('0x1d')](_0xfae164);logger[_0xa34f('0x1c')](_0xa34f('0x1e'),_0x2dc65f);_0x39cc82(_0x2dc65f);});_0x25bf88[_0xa34f('0x1f')](_0x4a5856);})['on'](_0xa34f('0x1c'),function(_0xa67832){logger[_0xa34f('0x1c')](_0xa67832);_0x39cc82(_0xa67832);})[_0xa34f('0x20')]();});}function uploadFile(_0xb85793){return new BPromise(function(_0xb6669d,_0x52eaf9){var _0xe0287c=urlParse(_0xb85793);var _0x58fb9f=_0xe0287c[_0xa34f('0x21')]===_0xa34f('0x10')?https:http;var _0x381712={'host':_0xe0287c[_0xa34f('0x22')],'path':_0xe0287c[_0xa34f('0x4')],'headers':{'user-agent':_0xa34f('0x11')}};_0x58fb9f['get'](_0x381712,function(_0x2c3dff){if(_0x2c3dff['statusCode']!==0xc8){_0x52eaf9(new Error(_0xa34f('0x14')+_0xb85793+_0xa34f('0x15')+_0x2c3dff[_0xa34f('0x13')]+'\x20('+_0x2c3dff[_0xa34f('0x16')]+')'));return;}var _0x22ed72='';_0x2c3dff['on']('data',function(_0x1a8f7e){_0x22ed72+=_0x1a8f7e;});_0x2c3dff['on'](_0xa34f('0x20'),function(){_0xb6669d(_0x22ed72);});})['on'](_0xa34f('0x1c'),function(_0x84d690){_0x52eaf9(_0x84d690);})[_0xa34f('0x20')]();});}function convertFile(_0xae3b8,_0x237dd3){return new BPromise(function(_0x57e5c0,_0x398042){var _0x54c773=sox[_0xa34f('0x23')](_0xae3b8,_0x237dd3,{'sampleRate':0x1f40,'format':_0xa34f('0x24'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x54c773['on'](_0xa34f('0x1c'),function(_0x2da84e){logger['error']('error\x20convert',_0x2da84e);_0x398042(_0x2da84e);});_0x54c773['on']('end',function(){logger['info'](_0xa34f('0x25'));_0x57e5c0();});_0x54c773[_0xa34f('0x26')]();});}function base64Decode(_0x33b7f8,_0x4234ce){var _0x21b185=path[_0xa34f('0x27')](__dirname,'tmp',rs['generate'](0x4)+_0xa34f('0x28'));fs['writeFileSync'](_0x21b185,_0x33b7f8,'base64');return convertFile(_0x21b185,_0x4234ce)[_0xa34f('0x29')](function(){try{fs[_0xa34f('0x1d')](_0x21b185);fs[_0xa34f('0x2a')](_0x4234ce,_0xa34f('0x2b'));}catch(_0x4ab222){logger[_0xa34f('0x1c')](_0x4ab222);}return _0x4234ce[_0xa34f('0x2c')]('.')[0x0];});}function base64Encode(_0x4e6c51){var _0x41de2d=fs[_0xa34f('0x2d')](_0x4e6c51);return new Buffer(_0x41de2d)[_0xa34f('0x2e')](_0xa34f('0x2f'));}exports[_0xa34f('0x30')]=function(_0xbeefd8,_0x4f4838,_0x4a1126,_0x5a1477,_0x25d94b,_0x1164ac){var _0x52c8b4,_0x1e085c;var _0x92e3bc=_0xa34f('0x31');var _0x151e40=_0xa34f('0x32')+_0xbeefd8;var _0x7bd909={};if(_0x4f4838===_0xa34f('0x33')){_0x7bd909[_0xa34f('0x34')]={'ssml':_0x4a1126};}else{_0x7bd909[_0xa34f('0x34')]={'text':_0x4a1126};};_0x7bd909[_0xa34f('0x35')]={'languageCode':_0x5a1477,'ssmlGender':_0x25d94b};_0x7bd909[_0xa34f('0x36')]={'audioEncoding':_0xa34f('0x37'),'sampleRateHertz':0x1f40};var _0x20f931={'url':_0x92e3bc+_0xa34f('0x38')+_0x151e40,'method':_0xa34f('0x39'),'json':!![],'body':_0x7bd909};return rp(_0x20f931)[_0xa34f('0x29')](function(_0x5274dd){return new BPromise(function(_0x213c88,_0x36f787){_0x52c8b4=path[_0xa34f('0x27')](__dirname,_0xa34f('0x3a'),rs['generate'](0x4)+_0xa34f('0x3b'));var _0x187dd5=Buffer[_0xa34f('0x3c')](_0x5274dd[_0xa34f('0x3d')],_0xa34f('0x2f'));return fs[_0xa34f('0x3e')](_0x52c8b4,_0x187dd5,function(_0x2d02b7){_0x36f787(_0x2d02b7);},function(_0x3f3bc1){fs[_0xa34f('0x2a')](_0x52c8b4,_0xa34f('0x2b'));_0x213c88(_0x3f3bc1);});});})[_0xa34f('0x29')](function(_0x39f7f8){_0x1e085c=path[_0xa34f('0x27')](__dirname,_0xa34f('0x3a'),rs[_0xa34f('0x3f')](0x4)+_0xa34f('0x28'));return convertFile(_0x52c8b4,_0x1e085c);})[_0xa34f('0x29')](function(){try{fs[_0xa34f('0x1d')](_0x52c8b4);fs[_0xa34f('0x2a')](_0x1e085c,_0xa34f('0x2b'));}catch(_0x2b016b){logger['error'](_0x2b016b);}logger['info']('googleCloudTTS\x20path',_0x1e085c['split']('.')[0x0]);return _0x1e085c[_0xa34f('0x2c')]('.')[0x0];});};exports[_0xa34f('0x40')]=function(_0x289ac3,_0x4857f0){var _0x5180b3='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x33a388,_0x3e2154;var _0x2e3350;var _0x1efcf0={'encoding':_0xa34f('0x41'),'method':_0xa34f('0x39'),'timeout':0x2710,'url':_0x5180b3,'headers':{'Content-Type':_0xa34f('0x42')},'body':_0xa34f('0x43')+encodeURIComponent(JSON['stringify']([[[_0xa34f('0x44'),JSON['stringify']([_0x289ac3,_0x4857f0||'en',![],'null']),null,_0xa34f('0x45')]]]))};return rp(_0x1efcf0)['then'](function(_0x58bd0c){try{_0x2e3350=eval(_0x58bd0c[_0xa34f('0x46')](0x5))[0x0][0x2];}catch(_0x5a5954){throw new Error(_0xa34f('0x47')+_0x58bd0c[_0xa34f('0x48')]);}if(!_0x2e3350){if(_0x289ac3[_0xa34f('0x49')]>0xc8){throw new Error(_0xa34f('0x4a'));}else{throw new Error(_0xa34f('0x4b')+_0x4857f0+_0xa34f('0x4c'));}}try{_0x2e3350=eval(_0x2e3350)[0x0];}catch(_0x47e965){throw new Error(_0xa34f('0x47')+res[_0xa34f('0x48')]);}const _0x175fa8=_0x2e3350;_0x33a388=path[_0xa34f('0x27')](__dirname,'tmp',rs['generate'](0x4)+'.mp3');fs[_0xa34f('0x4d')](_0x33a388,_0x2e3350,{'encoding':_0xa34f('0x2f')});_0x3e2154=path[_0xa34f('0x27')](__dirname,_0xa34f('0x3a'),rs[_0xa34f('0x3f')](0x4)+_0xa34f('0x28'));return convertFile(_0x33a388,_0x3e2154);})['then'](function(){try{fs[_0xa34f('0x1d')](_0x33a388);fs['chmodSync'](_0x3e2154,'777');}catch(_0x56bf42){logger[_0xa34f('0x1c')](_0x56bf42);}logger[_0xa34f('0x19')](_0xa34f('0x4e'),_0x3e2154[_0xa34f('0x2c')]('.')[0x0]);return _0x3e2154[_0xa34f('0x2c')]('.')[0x0];});};exports[_0xa34f('0x4f')]=function(_0x16a2d4,_0x4613a8,_0x4d4255){return google['asr'](_0x16a2d4,_0x4613a8,_0x4d4255)[_0xa34f('0x29')](function(_0x5ecbc3){logger[_0xa34f('0x19')](_0x5ecbc3[_0xa34f('0x50')]);return rp(_0x5ecbc3);})['then'](function(_0x8ba8aa){var _0x14dcb0='';var _0x3563f1=0x0;try{fs[_0xa34f('0x1d')](_0x16a2d4);}catch(_0xfda507){logger['error'](_0xfda507);}if(_0x8ba8aa&&_0x8ba8aa[_0xa34f('0x51')]){_0x14dcb0=_0x8ba8aa[_0xa34f('0x51')][_0xa34f('0x52')](function(_0x3eb6e0){return _0x3eb6e0&&_0x3eb6e0['alternatives'][0x0]&&_0x3eb6e0['alternatives'][0x0][_0xa34f('0x53')]?_0x3eb6e0[_0xa34f('0x54')][0x0]['transcript']:'';})[_0xa34f('0x55')]('\x0a');_0x3563f1=_0x8ba8aa[_0xa34f('0x51')][_0xa34f('0x52')](function(_0x3e600e){return _0x3e600e&&_0x3e600e[_0xa34f('0x54')][0x0]&&_0x3e600e[_0xa34f('0x54')][0x0][_0xa34f('0x56')]?_0x3e600e['alternatives'][0x0][_0xa34f('0x56')]:0x0;})['join']('\x0a');}logger[_0xa34f('0x19')]('googleASR\x20transcription',_0x14dcb0);logger[_0xa34f('0x19')](_0xa34f('0x57'),_0x3563f1);return{'transcript':_0x14dcb0,'confidence':_0x3563f1};})[_0xa34f('0x58')](function(_0x5e99de){logger[_0xa34f('0x1c')]('[%s]\x20%s:%s',_0x5e99de[_0xa34f('0x13')],_0x5e99de[_0xa34f('0x59')],_0x5e99de[_0xa34f('0x5a')]);});};exports[_0xa34f('0x5b')]=function(_0x3ae33a,_0x13e684,_0x5a5825,_0xf04464){var _0xb15879=apiai(_0x13e684,{'language':_0xf04464||'en'});return _0xb15879[_0xa34f('0x5c')](_0x5a5825,{'sessionId':md5(_0x3ae33a)})[_0xa34f('0x29')](function(_0x5048ae){logger[_0xa34f('0x19')](JSON[_0xa34f('0x5d')](_0x5048ae));return{'source':_0x5048ae['result'][_0xa34f('0x5e')],'resolvedQuery':_0x5048ae[_0xa34f('0x5f')][_0xa34f('0x60')],'action':_0x5048ae[_0xa34f('0x5f')][_0xa34f('0x61')],'actionIncomplete':_0x5048ae[_0xa34f('0x5f')]['actionIncomplete'],'speech':_0x5048ae[_0xa34f('0x5f')]['fulfillment'][_0xa34f('0x62')],'score':_0x5048ae[_0xa34f('0x5f')][_0xa34f('0x63')],'statusCode':_0x5048ae['status'][_0xa34f('0x64')],'endConversation':_0x5048ae[_0xa34f('0x5f')][_0xa34f('0x65')][_0xa34f('0x66')]||![],'isFallbackIntent':_0x5048ae[_0xa34f('0x5f')][_0xa34f('0x65')]['isFallbackIntent']};});};exports[_0xa34f('0x67')]=function(_0x2f3385,_0x1a7b7d,_0xa1db4,_0x269ebe,_0x2b4e1e,_0x18f8e4){var _0x349eb5=_0x269ebe[_0xa34f('0x68')](/\\n/g,'\x0a');var _0x243a9f={'credentials':{'private_key':_0x349eb5,'client_email':_0xa1db4}};var _0x47476f=new dialogflow[(_0xa34f('0x69'))](_0x243a9f);var _0x1df703=_0x47476f[_0xa34f('0x6a')](_0x1a7b7d,md5(_0x2f3385));var _0x476be1={'session':_0x1df703,'queryInput':{'text':{'text':_0x2b4e1e,'languageCode':_0x18f8e4}}};return _0x47476f['detectIntent'](_0x476be1)['then'](function(_0x5114db){if(_0x5114db&&_0x5114db[_0xa34f('0x49')]){logger[_0xa34f('0x19')](_0xa34f('0x6b'),JSON['stringify'](_0x5114db));var _0x2b752c=_0x5114db[0x0];if(_0x2b752c){var _0xece1a8={'action':_0x2b752c[_0xa34f('0x6c')][_0xa34f('0x61')],'allRequiredParamsPresent':_0x2b752c['queryResult']['allRequiredParamsPresent'],'endConversation':_0x2b752c['queryResult'][_0xa34f('0x6d')]&&_0x2b752c[_0xa34f('0x6c')][_0xa34f('0x6d')]['fields']?_0x2b752c['queryResult'][_0xa34f('0x6d')][_0xa34f('0x6e')][_0xa34f('0x6f')][_0xa34f('0x70')]:![],'fulfillmentText':_0x2b752c[_0xa34f('0x6c')][_0xa34f('0x71')],'intentName':_0x2b752c[_0xa34f('0x6c')][_0xa34f('0x72')]['name'],'intentDisplayName':_0x2b752c[_0xa34f('0x6c')][_0xa34f('0x72')][_0xa34f('0x73')],'isFallbackIntent':_0x2b752c[_0xa34f('0x6c')][_0xa34f('0x72')][_0xa34f('0x74')],'languageCode':_0x2b752c[_0xa34f('0x6c')][_0xa34f('0x75')],'queryText':_0x2b752c['queryResult']['queryText'],'responseId':_0x2b752c[_0xa34f('0x76')],'score':_0x2b752c[_0xa34f('0x6c')][_0xa34f('0x77')],'speech':_0x2b752c[_0xa34f('0x6c')][_0xa34f('0x71')],'providerResponse':JSON[_0xa34f('0x5d')](_0x5114db)};return _0xece1a8;}}});};exports[_0xa34f('0x78')]=function(_0x1336bf,_0x30a582,_0x5b9169,_0x5b2f4c){return tilde[_0xa34f('0x79')](_0x1336bf,_0x30a582,_0x5b9169,_0x5b2f4c)[_0xa34f('0x29')](function(_0x35f6f2){try{fs[_0xa34f('0x1d')](_0x1336bf);}catch(_0x270b7e){logger[_0xa34f('0x1c')](_0x270b7e);}logger[_0xa34f('0x19')]('Tilde\x20ASR\x20transcription',_0x35f6f2['transcript']);logger[_0xa34f('0x19')](_0xa34f('0x7a'),_0x35f6f2['confidence']);return _0x35f6f2;});};exports[_0xa34f('0x7b')]=function(_0x57a0ab,_0x4a411b,_0x46e986,_0x1d0d8e,_0x5ceb20,_0xcce060){var _0x22d1f6=path[_0xa34f('0x27')](__dirname,'tmp',rs[_0xa34f('0x3f')](0x4)+_0xa34f('0x3b'));var _0x23b6a2;return aws['polly'](_0x57a0ab,_0x4a411b,_0x46e986,_0x1d0d8e,_0x5ceb20,_0xcce060,_0x22d1f6)['then'](function(){_0x23b6a2=path[_0xa34f('0x27')](__dirname,_0xa34f('0x3a'),rs[_0xa34f('0x3f')](0x4)+_0xa34f('0x28'));return convertFile(_0x22d1f6,_0x23b6a2);})[_0xa34f('0x29')](function(){try{fs[_0xa34f('0x1d')](_0x22d1f6);fs['chmodSync'](_0x23b6a2,_0xa34f('0x2b'));}catch(_0x55bd5a){logger[_0xa34f('0x1c')](_0x55bd5a);}return _0x23b6a2['split']('.')[0x0];});};exports[_0xa34f('0x7c')]=function(_0x4498b2,_0x4bb1f8,_0xae59b5,_0x1edcaf,_0x169441,_0x39498f){return aws[_0xa34f('0x7d')](_0x4498b2,_0x4bb1f8,_0xae59b5,_0x1edcaf,_0x169441,_0x39498f)[_0xa34f('0x29')](function(_0x549c0d){logger[_0xa34f('0x19')](JSON[_0xa34f('0x5d')](_0x549c0d));return _0x549c0d;});};exports[_0xa34f('0x7e')]=function(_0x33f8f1,_0x4f90a0,_0x161880,_0x3de665){var _0xc9c4c=util[_0xa34f('0x7f')](_0xa34f('0x80'),ISPEECH_API,_0x33f8f1,encodeURIComponent(_0x4f90a0),_0x161880,_0x3de665);var _0x434353=path[_0xa34f('0x27')](__dirname,_0xa34f('0x3a'),rs[_0xa34f('0x3f')](0x4)+_0xa34f('0x3b'));var _0x47dbac;return downloadFile(_0xc9c4c,_0x434353)[_0xa34f('0x29')](function(){_0x47dbac=path[_0xa34f('0x27')](__dirname,_0xa34f('0x3a'),rs[_0xa34f('0x3f')](0x4)+_0xa34f('0x28'));return convertFile(_0x434353,_0x47dbac);})[_0xa34f('0x29')](function(){try{fs[_0xa34f('0x1d')](_0x434353);fs['chmodSync'](_0x47dbac,_0xa34f('0x2b'));}catch(_0x43460a){logger[_0xa34f('0x1c')](_0x43460a);}return _0x47dbac['split']('.')[0x0];});};exports[_0xa34f('0x81')]=function(_0x5e9bbc,_0x5e3176,_0x472feb,_0x4a4ba1){var _0x56b69f=util[_0xa34f('0x7f')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x5e3176,_0x472feb,base64Encode(_0x5e9bbc),_0x4a4ba1?util[_0xa34f('0x7f')](_0xa34f('0x82'),encodeURIComponent(_0x4a4ba1)):_0xa34f('0x83'));return uploadFile(_0x56b69f)['then'](function(_0x2fbe79){return querystring[_0xa34f('0xa')](_0x2fbe79);});};exports['sestekNDA']=function(_0xdea2cd,_0x3b7d32){return sestek[_0xa34f('0x84')](_0xdea2cd,_0x3b7d32)[_0xa34f('0x29')](function(_0x340041){logger[_0xa34f('0x19')](JSON[_0xa34f('0x5d')](_0x340041));var _0x5038d4={'speech':_0x340041['text'],'action':_0x340041['channelData']?_0x340041['channelData'][_0xa34f('0x85')]:undefined,'actiondata':_0x340041[_0xa34f('0x86')]?_0x340041[_0xa34f('0x86')][_0xa34f('0x87')]:undefined};if(_0x340041[_0xa34f('0x86')]&&_0x340041[_0xa34f('0x86')]['AudioFromTts']){return base64Decode(_0x340041['channelData'][_0xa34f('0x88')]['Data'],path[_0xa34f('0x27')](__dirname,'tmp',rs[_0xa34f('0x3f')](0x4)+_0xa34f('0x28')))['then'](function(_0x2b3898){_0x5038d4[_0xa34f('0x89')]=_0x2b3898;return _0x5038d4;});}return _0x5038d4;});};exports[_0xa34f('0x8a')]=function(){return __dirname;};
\ No newline at end of file
+var _0xe77e=['goggleTTS\x20path','asr','results','map','alternatives','transcript','join','confidence','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','textRequest','result','action','actionIncomplete','fulfillment','speech','score','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','intent','displayName','isFallback','queryText','responseId','Tilde\x20ASR\x20transcription','polly','awsLex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','CustomAction','channelData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','http','https','md5','path','querystring','request-promise','sox','url','parse','./aws','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','download\x20error','pipe','end','data','transcode','wav','error\x20convert','finish\x20to\x20convert','start','.wav','writeFileSync','base64','then','unlink','chmodSync','777','split','readFileSync','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','input','voice','MP3','text:synthesize','POST','resolve','tmp','generate','.mp3','from','audioContent','writeFile','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','stringify','jQ1olc','null','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0xe77e,0x14d));var _0xee77=function(_0x37d0c7,_0x1c2972){_0x37d0c7=_0x37d0c7-0x0;var _0x53aa5b=_0xe77e[_0x37d0c7];return _0x53aa5b;};'use strict';var apiai=require(_0xee77('0x0'));var BPromise=require(_0xee77('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0xee77('0x2'));var https=require(_0xee77('0x3'));var md5=require(_0xee77('0x4'));var path=require(_0xee77('0x5'));var querystring=require(_0xee77('0x6'));var rp=require(_0xee77('0x7'));var rs=require('randomstring');var sox=require(_0xee77('0x8'));var tts=require('google-tts-api');var urlParse=require(_0xee77('0x9'))[_0xee77('0xa')];var util=require('util');var aws=require(_0xee77('0xb'));var google=require(_0xee77('0xc'));var sestek=require(_0xee77('0xd'));var tilde=require(_0xee77('0xe'));var logger=require(_0xee77('0xf'))(_0xee77('0x10'));var ISPEECH_API=_0xee77('0x11');function downloadFile(_0xb892e9,_0x3d49a5){return new BPromise(function(_0x4e3fdd,_0x4d1eb0){var _0x574daf=urlParse(_0xb892e9);var _0x43acb2=_0x574daf[_0xee77('0x12')]===_0xee77('0x13')?https:http;var _0x1e097a={'host':_0x574daf[_0xee77('0x14')],'path':_0x574daf['path'],'headers':{'user-agent':_0xee77('0x15')}};_0x43acb2[_0xee77('0x16')](_0x1e097a,function(_0x21ca45){if(_0x21ca45[_0xee77('0x17')]!==0xc8){logger[_0xee77('0x18')](_0xee77('0x19')+_0xb892e9+_0xee77('0x1a')+_0x21ca45[_0xee77('0x17')]+'\x20('+_0x21ca45[_0xee77('0x1b')]+')');_0x4d1eb0(new Error(_0xee77('0x19')+_0xb892e9+_0xee77('0x1a')+_0x21ca45[_0xee77('0x17')]+'\x20('+_0x21ca45[_0xee77('0x1b')]+')'));return;}var _0x34f5af=fs[_0xee77('0x1c')](_0x3d49a5);_0x34f5af['on'](_0xee77('0x1d'),function(){logger[_0xee77('0x1e')](_0xee77('0x1f'));_0x34f5af[_0xee77('0x20')](_0x4e3fdd);});_0x34f5af['on'](_0xee77('0x18'),function(_0x1a3434){fs['unlink'](_0x3d49a5);logger[_0xee77('0x18')](_0xee77('0x21'),_0x1a3434);_0x4d1eb0(_0x1a3434);});_0x21ca45[_0xee77('0x22')](_0x34f5af);})['on'](_0xee77('0x18'),function(_0x9f56dc){logger['error'](_0x9f56dc);_0x4d1eb0(_0x9f56dc);})[_0xee77('0x23')]();});}function uploadFile(_0x46ab15){return new BPromise(function(_0x411a2c,_0x5463cf){var _0x4a0a65=urlParse(_0x46ab15);var _0x2cd103=_0x4a0a65[_0xee77('0x12')]==='https:'?https:http;var _0x52d60d={'host':_0x4a0a65[_0xee77('0x14')],'path':_0x4a0a65[_0xee77('0x5')],'headers':{'user-agent':'WHAT_EVER'}};_0x2cd103[_0xee77('0x16')](_0x52d60d,function(_0x1d14cf){if(_0x1d14cf[_0xee77('0x17')]!==0xc8){_0x5463cf(new Error('request\x20to\x20'+_0x46ab15+'\x20failed,\x20status\x20code\x20=\x20'+_0x1d14cf['statusCode']+'\x20('+_0x1d14cf[_0xee77('0x1b')]+')'));return;}var _0x25edb5='';_0x1d14cf['on'](_0xee77('0x24'),function(_0x196810){_0x25edb5+=_0x196810;});_0x1d14cf['on'](_0xee77('0x23'),function(){_0x411a2c(_0x25edb5);});})['on'](_0xee77('0x18'),function(_0x45b4e4){_0x5463cf(_0x45b4e4);})[_0xee77('0x23')]();});}function convertFile(_0x4ae61e,_0xa01cc0){return new BPromise(function(_0x1bef04,_0x5f3726){var _0xb42990=sox[_0xee77('0x25')](_0x4ae61e,_0xa01cc0,{'sampleRate':0x1f40,'format':_0xee77('0x26'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xb42990['on']('error',function(_0xb0b80e){logger[_0xee77('0x18')](_0xee77('0x27'),_0xb0b80e);_0x5f3726(_0xb0b80e);});_0xb42990['on'](_0xee77('0x23'),function(){logger[_0xee77('0x1e')](_0xee77('0x28'));_0x1bef04();});_0xb42990[_0xee77('0x29')]();});}function base64Decode(_0x45bcbc,_0x37691f){var _0x2f7be0=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0xee77('0x2a'));fs[_0xee77('0x2b')](_0x2f7be0,_0x45bcbc,_0xee77('0x2c'));return convertFile(_0x2f7be0,_0x37691f)[_0xee77('0x2d')](function(){try{fs[_0xee77('0x2e')](_0x2f7be0);fs[_0xee77('0x2f')](_0x37691f,_0xee77('0x30'));}catch(_0x2c7b8e){logger['error'](_0x2c7b8e);}return _0x37691f[_0xee77('0x31')]('.')[0x0];});}function base64Encode(_0x1c65d9){var _0x214fc4=fs[_0xee77('0x32')](_0x1c65d9);return new Buffer(_0x214fc4)['toString']('base64');}exports[_0xee77('0x33')]=function(_0x566f14,_0x48f32c,_0x4e6039,_0x11ea3d,_0x3cbfd5,_0x55c25e){var _0x5c8e1d,_0x1d7ffc;var _0x20789f=_0xee77('0x34');var _0xf34c05=_0xee77('0x35')+_0x566f14;var _0x6b765={};if(_0x48f32c==='ssml'){_0x6b765['input']={'ssml':_0x4e6039};}else{_0x6b765[_0xee77('0x36')]={'text':_0x4e6039};};_0x6b765[_0xee77('0x37')]={'languageCode':_0x11ea3d,'ssmlGender':_0x3cbfd5};_0x6b765['audioConfig']={'audioEncoding':_0xee77('0x38'),'sampleRateHertz':0x1f40};var _0x22a45d={'url':_0x20789f+_0xee77('0x39')+_0xf34c05,'method':_0xee77('0x3a'),'json':!![],'body':_0x6b765};return rp(_0x22a45d)[_0xee77('0x2d')](function(_0x230029){return new BPromise(function(_0x22fe29,_0x499237){_0x5c8e1d=path[_0xee77('0x3b')](__dirname,_0xee77('0x3c'),rs[_0xee77('0x3d')](0x4)+_0xee77('0x3e'));var _0x4c3c10=Buffer[_0xee77('0x3f')](_0x230029[_0xee77('0x40')],_0xee77('0x2c'));return fs[_0xee77('0x41')](_0x5c8e1d,_0x4c3c10,function(_0x34a09f){_0x499237(_0x34a09f);},function(_0x1cb6bf){fs['chmodSync'](_0x5c8e1d,_0xee77('0x30'));_0x22fe29(_0x1cb6bf);});});})[_0xee77('0x2d')](function(_0x3d3e89){_0x1d7ffc=path['resolve'](__dirname,_0xee77('0x3c'),rs[_0xee77('0x3d')](0x4)+_0xee77('0x2a'));return convertFile(_0x5c8e1d,_0x1d7ffc);})['then'](function(){try{fs['unlink'](_0x5c8e1d);fs[_0xee77('0x2f')](_0x1d7ffc,_0xee77('0x30'));}catch(_0x57ea23){logger[_0xee77('0x18')](_0x57ea23);}logger[_0xee77('0x1e')]('googleCloudTTS\x20path',_0x1d7ffc['split']('.')[0x0]);return _0x1d7ffc['split']('.')[0x0];});};exports['googleTTS']=function(_0x2149e7,_0x2b15d0){var _0x461103=_0xee77('0x42');var _0x3d6f68,_0x3edeb2;var _0x22f1b2;var _0x3049db={'encoding':_0xee77('0x43'),'method':_0xee77('0x3a'),'timeout':0x2710,'url':_0x461103,'headers':{'Content-Type':_0xee77('0x44')},'body':'f.req='+encodeURIComponent(JSON[_0xee77('0x45')]([[[_0xee77('0x46'),JSON['stringify']([_0x2149e7,_0x2b15d0||'en',![],_0xee77('0x47')]),null,'generic']]]))};return rp(_0x3049db)[_0xee77('0x2d')](function(_0x4f9421){try{_0x22f1b2=eval(_0x4f9421[_0xee77('0x48')](0x5))[0x0][0x2];}catch(_0x49447e){throw new Error(_0xee77('0x49')+_0x4f9421[_0xee77('0x24')]);}if(!_0x22f1b2){if(_0x2149e7[_0xee77('0x4a')]>0xc8){throw new Error(_0xee77('0x4b'));}else{throw new Error(_0xee77('0x4c')+_0x2b15d0+_0xee77('0x4d'));}}try{_0x22f1b2=eval(_0x22f1b2)[0x0];}catch(_0x4742f4){throw new Error(_0xee77('0x49')+res['data']);}const _0x372714=_0x22f1b2;_0x3d6f68=path[_0xee77('0x3b')](__dirname,_0xee77('0x3c'),rs[_0xee77('0x3d')](0x4)+_0xee77('0x3e'));fs[_0xee77('0x2b')](_0x3d6f68,_0x22f1b2,{'encoding':_0xee77('0x2c')});_0x3edeb2=path[_0xee77('0x3b')](__dirname,_0xee77('0x3c'),rs[_0xee77('0x3d')](0x4)+'.wav');return convertFile(_0x3d6f68,_0x3edeb2);})['then'](function(){try{fs[_0xee77('0x2e')](_0x3d6f68);fs[_0xee77('0x2f')](_0x3edeb2,_0xee77('0x30'));}catch(_0x17e27a){logger[_0xee77('0x18')](_0x17e27a);}logger['info'](_0xee77('0x4e'),_0x3edeb2[_0xee77('0x31')]('.')[0x0]);return _0x3edeb2[_0xee77('0x31')]('.')[0x0];});};exports['googleASR']=function(_0x545674,_0xd06cd,_0x267307){return google[_0xee77('0x4f')](_0x545674,_0xd06cd,_0x267307)[_0xee77('0x2d')](function(_0x1c7193){logger[_0xee77('0x1e')](_0x1c7193['uri']);return rp(_0x1c7193);})[_0xee77('0x2d')](function(_0x311a08){var _0x4527c7='';var _0x3d865c=0x0;try{fs[_0xee77('0x2e')](_0x545674);}catch(_0x5eeb26){logger[_0xee77('0x18')](_0x5eeb26);}if(_0x311a08&&_0x311a08[_0xee77('0x50')]){_0x4527c7=_0x311a08['results'][_0xee77('0x51')](function(_0x1727e7){return _0x1727e7&&_0x1727e7[_0xee77('0x52')][0x0]&&_0x1727e7['alternatives'][0x0][_0xee77('0x53')]?_0x1727e7[_0xee77('0x52')][0x0][_0xee77('0x53')]:'';})[_0xee77('0x54')]('\x0a');_0x3d865c=_0x311a08[_0xee77('0x50')][_0xee77('0x51')](function(_0x5b61cd){return _0x5b61cd&&_0x5b61cd['alternatives'][0x0]&&_0x5b61cd[_0xee77('0x52')][0x0][_0xee77('0x55')]?_0x5b61cd[_0xee77('0x52')][0x0][_0xee77('0x55')]:0x0;})[_0xee77('0x54')]('\x0a');}logger[_0xee77('0x1e')]('googleASR\x20transcription',_0x4527c7);logger[_0xee77('0x1e')](_0xee77('0x56'),_0x3d865c);return{'transcript':_0x4527c7,'confidence':_0x3d865c};})[_0xee77('0x57')](function(_0x878746){logger[_0xee77('0x18')](_0xee77('0x58'),_0x878746[_0xee77('0x17')],_0x878746[_0xee77('0x59')],_0x878746[_0xee77('0x5a')]);});};exports['googleDialogflow']=function(_0x47fda8,_0xb9b616,_0x3bd2a2,_0x4d19bf){var _0x460ac8=apiai(_0xb9b616,{'language':_0x4d19bf||'en'});return _0x460ac8[_0xee77('0x5b')](_0x3bd2a2,{'sessionId':md5(_0x47fda8)})[_0xee77('0x2d')](function(_0x4de285){logger[_0xee77('0x1e')](JSON[_0xee77('0x45')](_0x4de285));return{'source':_0x4de285[_0xee77('0x5c')]['source'],'resolvedQuery':_0x4de285[_0xee77('0x5c')]['resolvedQuery'],'action':_0x4de285[_0xee77('0x5c')][_0xee77('0x5d')],'actionIncomplete':_0x4de285[_0xee77('0x5c')][_0xee77('0x5e')],'speech':_0x4de285[_0xee77('0x5c')][_0xee77('0x5f')][_0xee77('0x60')],'score':_0x4de285[_0xee77('0x5c')][_0xee77('0x61')],'statusCode':_0x4de285[_0xee77('0x62')][_0xee77('0x63')],'endConversation':_0x4de285['result'][_0xee77('0x64')][_0xee77('0x65')]||![],'isFallbackIntent':_0x4de285['result'][_0xee77('0x64')][_0xee77('0x66')]};});};exports[_0xee77('0x67')]=function(_0x4d19b4,_0x51ac21,_0x35e18c,_0x42dc35,_0x51763b,_0x3d3f24){var _0x3a48c4=_0x42dc35[_0xee77('0x68')](/\\n/g,'\x0a');var _0x21c06f={'credentials':{'private_key':_0x3a48c4,'client_email':_0x35e18c}};var _0x267024=new dialogflow[(_0xee77('0x69'))](_0x21c06f);var _0x179ea2=_0x267024['sessionPath'](_0x51ac21,md5(_0x4d19b4));var _0x62d101={'session':_0x179ea2,'queryInput':{'text':{'text':_0x51763b,'languageCode':_0x3d3f24}}};return _0x267024[_0xee77('0x6a')](_0x62d101)[_0xee77('0x2d')](function(_0x2f4e82){if(_0x2f4e82&&_0x2f4e82[_0xee77('0x4a')]){logger[_0xee77('0x1e')](_0xee77('0x6b'),JSON[_0xee77('0x45')](_0x2f4e82));var _0x12f8cc=_0x2f4e82[0x0];if(_0x12f8cc){var _0x4e31a5={'action':_0x12f8cc[_0xee77('0x6c')][_0xee77('0x5d')],'allRequiredParamsPresent':_0x12f8cc[_0xee77('0x6c')][_0xee77('0x6d')],'endConversation':_0x12f8cc['queryResult'][_0xee77('0x6e')]&&_0x12f8cc[_0xee77('0x6c')][_0xee77('0x6e')]['fields']?_0x12f8cc[_0xee77('0x6c')]['diagnosticInfo'][_0xee77('0x6f')][_0xee77('0x70')][_0xee77('0x71')]:![],'fulfillmentText':_0x12f8cc[_0xee77('0x6c')]['fulfillmentText'],'intentName':_0x12f8cc[_0xee77('0x6c')]['intent'][_0xee77('0x59')],'intentDisplayName':_0x12f8cc[_0xee77('0x6c')][_0xee77('0x72')][_0xee77('0x73')],'isFallbackIntent':_0x12f8cc[_0xee77('0x6c')][_0xee77('0x72')][_0xee77('0x74')],'languageCode':_0x12f8cc[_0xee77('0x6c')]['languageCode'],'queryText':_0x12f8cc['queryResult'][_0xee77('0x75')],'responseId':_0x12f8cc[_0xee77('0x76')],'score':_0x12f8cc[_0xee77('0x6c')]['intentDetectionConfidence'],'speech':_0x12f8cc[_0xee77('0x6c')]['fulfillmentText'],'providerResponse':JSON[_0xee77('0x45')](_0x2f4e82)};return _0x4e31a5;}}});};exports['tildeASR']=function(_0x27ec40,_0x10c89d,_0x179b5c,_0x1c9592){return tilde[_0xee77('0x4f')](_0x27ec40,_0x10c89d,_0x179b5c,_0x1c9592)[_0xee77('0x2d')](function(_0x33837f){try{fs[_0xee77('0x2e')](_0x27ec40);}catch(_0x34ca14){logger['error'](_0x34ca14);}logger['info'](_0xee77('0x77'),_0x33837f[_0xee77('0x53')]);logger['info']('Tilde\x20ASR\x20confidence',_0x33837f[_0xee77('0x55')]);return _0x33837f;});};exports['awsPolly']=function(_0xa96329,_0x55ce81,_0x15abd0,_0x551099,_0xf703f1,_0x1efff0){var _0x48adc4=path[_0xee77('0x3b')](__dirname,_0xee77('0x3c'),rs[_0xee77('0x3d')](0x4)+_0xee77('0x3e'));var _0x31b5fc;return aws[_0xee77('0x78')](_0xa96329,_0x55ce81,_0x15abd0,_0x551099,_0xf703f1,_0x1efff0,_0x48adc4)[_0xee77('0x2d')](function(){_0x31b5fc=path['resolve'](__dirname,_0xee77('0x3c'),rs[_0xee77('0x3d')](0x4)+_0xee77('0x2a'));return convertFile(_0x48adc4,_0x31b5fc);})[_0xee77('0x2d')](function(){try{fs[_0xee77('0x2e')](_0x48adc4);fs[_0xee77('0x2f')](_0x31b5fc,_0xee77('0x30'));}catch(_0x235f6f){logger['error'](_0x235f6f);}return _0x31b5fc['split']('.')[0x0];});};exports[_0xee77('0x79')]=function(_0x4bfe43,_0x27a812,_0x4fb5be,_0x30d9fa,_0x6ae1c1,_0x116718){return aws['lex'](_0x4bfe43,_0x27a812,_0x4fb5be,_0x30d9fa,_0x6ae1c1,_0x116718)['then'](function(_0x58a1b4){logger[_0xee77('0x1e')](JSON['stringify'](_0x58a1b4));return _0x58a1b4;});};exports[_0xee77('0x7a')]=function(_0x1450a1,_0x1a6f0a,_0x374685,_0x437d6a){var _0x43458b=util[_0xee77('0x7b')](_0xee77('0x7c'),ISPEECH_API,_0x1450a1,encodeURIComponent(_0x1a6f0a),_0x374685,_0x437d6a);var _0x10f7b6=path[_0xee77('0x3b')](__dirname,_0xee77('0x3c'),rs[_0xee77('0x3d')](0x4)+_0xee77('0x3e'));var _0x5765ba;return downloadFile(_0x43458b,_0x10f7b6)['then'](function(){_0x5765ba=path[_0xee77('0x3b')](__dirname,_0xee77('0x3c'),rs[_0xee77('0x3d')](0x4)+_0xee77('0x2a'));return convertFile(_0x10f7b6,_0x5765ba);})[_0xee77('0x2d')](function(){try{fs[_0xee77('0x2e')](_0x10f7b6);fs[_0xee77('0x2f')](_0x5765ba,'777');}catch(_0xddd830){logger[_0xee77('0x18')](_0xddd830);}return _0x5765ba[_0xee77('0x31')]('.')[0x0];});};exports[_0xee77('0x7d')]=function(_0x4f6a4c,_0x15c5f1,_0x1c2116,_0xd4b81e){var _0x2d423b=util[_0xee77('0x7b')](_0xee77('0x7e'),ISPEECH_API,_0x15c5f1,_0x1c2116,base64Encode(_0x4f6a4c),_0xd4b81e?util[_0xee77('0x7b')](_0xee77('0x7f'),encodeURIComponent(_0xd4b81e)):_0xee77('0x80'));return uploadFile(_0x2d423b)[_0xee77('0x2d')](function(_0x189106){return querystring[_0xee77('0xa')](_0x189106);});};exports[_0xee77('0x81')]=function(_0x314509,_0x587341){return sestek[_0xee77('0x82')](_0x314509,_0x587341)[_0xee77('0x2d')](function(_0x14da58){logger[_0xee77('0x1e')](JSON[_0xee77('0x45')](_0x14da58));var _0x4b5a0e={'speech':_0x14da58['text'],'action':_0x14da58['channelData']?_0x14da58['channelData'][_0xee77('0x83')]:undefined,'actiondata':_0x14da58[_0xee77('0x84')]?_0x14da58['channelData']['CustomActionData']:undefined};if(_0x14da58[_0xee77('0x84')]&&_0x14da58[_0xee77('0x84')][_0xee77('0x85')]){return base64Decode(_0x14da58['channelData'][_0xee77('0x85')][_0xee77('0x86')],path[_0xee77('0x3b')](__dirname,'tmp',rs[_0xee77('0x3d')](0x4)+_0xee77('0x2a')))['then'](function(_0x4b28d5){_0x4b5a0e[_0xee77('0x87')]=_0x4b28d5;return _0x4b5a0e;});}return _0x4b5a0e;});};exports[_0xee77('0x88')]=function(){return __dirname;};
\ No newline at end of file
index 6bd5cc1..5696346 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e12=['exports','./nda'];(function(_0x4700be,_0x40772f){var _0x173d1c=function(_0x2a4a16){while(--_0x2a4a16){_0x4700be['push'](_0x4700be['shift']());}};_0x173d1c(++_0x40772f);}(_0x0e12,0x1d5));var _0x20e1=function(_0x3cae69,_0x233c38){_0x3cae69=_0x3cae69-0x0;var _0x3128eb=_0x0e12[_0x3cae69];return _0x3128eb;};var nda=require(_0x20e1('0x0'));module[_0x20e1('0x1')]={'nda':nda};
\ No newline at end of file
+var _0x22b0=['./nda'];(function(_0x3dd2f3,_0x391455){var _0x36954c=function(_0x56d6bb){while(--_0x56d6bb){_0x3dd2f3['push'](_0x3dd2f3['shift']());}};_0x36954c(++_0x391455);}(_0x22b0,0x156));var _0x022b=function(_0x576363,_0x128737){_0x576363=_0x576363-0x0;var _0xba659d=_0x22b0[_0x576363];return _0xba659d;};var nda=require(_0x022b('0x0'));module['exports']={'nda':nda};
\ No newline at end of file
index 543ef2b..cd75258 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12c9=['POST','resolve','ndauth_url','/token','password','then','/api/NaturalDialogAssistant/v1/Run','uniqueid','calleridname','dnid','extension','text','Bearer\x20','access_token','project','channelData','ProjectName','AudioOutputSettings','custom_action','body','custom_action_data','CustomActionData','info','stringify','request-promise','../../../../../config/logger','exports'];(function(_0x11d068,_0x30777e){var _0x2ea6ca=function(_0x5cda19){while(--_0x5cda19){_0x11d068['push'](_0x11d068['shift']());}};_0x2ea6ca(++_0x30777e);}(_0x12c9,0x9f));var _0x912c=function(_0x217761,_0x19bfaa){_0x217761=_0x217761-0x0;var _0x2faa70=_0x12c9[_0x217761];return _0x2faa70;};'use strict';var rp=require(_0x912c('0x0'));var url=require('url');var logger=require(_0x912c('0x1'))('agi');module[_0x912c('0x2')]=function(_0x522495,_0x3364ce){var _0x2740fa={'method':_0x912c('0x3'),'uri':url[_0x912c('0x4')](_0x3364ce[_0x912c('0x5')],_0x912c('0x6')),'form':{'grant_type':_0x912c('0x7'),'username':_0x3364ce['username'],'password':_0x3364ce[_0x912c('0x7')]},'json':!![]};return rp(_0x2740fa)[_0x912c('0x8')](function(_0x4745c5){var _0x486e08={'method':_0x912c('0x3'),'uri':url['resolve'](_0x3364ce['ndassistant_url'],_0x912c('0x9')),'body':{'type':_0x3364ce['ndaactivity_type']||'message','channelId':'Nda','conversation':{'id':_0x522495[_0x912c('0xa')]},'from':{'id':_0x522495['callerid'],'name':_0x522495[_0x912c('0xb')]},'recipient':{'id':_0x522495[_0x912c('0xc')],'name':_0x522495[_0x912c('0xd')]},'text':_0x3364ce[_0x912c('0xe')],'channelData':{}},'headers':{'Authorization':_0x912c('0xf')+_0x4745c5[_0x912c('0x10')]},'json':!![]};if(_0x3364ce[_0x912c('0x11')]){_0x486e08['body'][_0x912c('0x12')][_0x912c('0x13')]=_0x3364ce[_0x912c('0x11')];}if(_0x3364ce['ndagenerate_audio']=='1'){_0x486e08['body'][_0x912c('0x12')][_0x912c('0x14')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x3364ce[_0x912c('0x15')]){_0x486e08[_0x912c('0x16')]['channelData']['CustomAction']=_0x3364ce[_0x912c('0x15')];if(_0x3364ce[_0x912c('0x17')]){_0x486e08[_0x912c('0x16')]['channelData'][_0x912c('0x18')]=_0x3364ce[_0x912c('0x17')];}}logger[_0x912c('0x19')](JSON[_0x912c('0x1a')](_0x486e08));return rp(_0x486e08);});};
\ No newline at end of file
+var _0x81a5=['agi','exports','password','then','POST','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','uniqueid','callerid','calleridname','dnid','text','channelData','ProjectName','ndagenerate_audio','body','AudioOutputSettings','audio/wav','custom_action','custom_action_data','CustomActionData','info','request-promise','url','../../../../../config/logger'];(function(_0x13bc26,_0x19d73c){var _0x1a1d34=function(_0x2bc511){while(--_0x2bc511){_0x13bc26['push'](_0x13bc26['shift']());}};_0x1a1d34(++_0x19d73c);}(_0x81a5,0x1c8));var _0x581a=function(_0x2b7d49,_0x520a23){_0x2b7d49=_0x2b7d49-0x0;var _0x16de10=_0x81a5[_0x2b7d49];return _0x16de10;};'use strict';var rp=require(_0x581a('0x0'));var url=require(_0x581a('0x1'));var logger=require(_0x581a('0x2'))(_0x581a('0x3'));module[_0x581a('0x4')]=function(_0x362572,_0x4d0685){var _0x370c40={'method':'POST','uri':url['resolve'](_0x4d0685['ndauth_url'],'/token'),'form':{'grant_type':_0x581a('0x5'),'username':_0x4d0685['username'],'password':_0x4d0685[_0x581a('0x5')]},'json':!![]};return rp(_0x370c40)[_0x581a('0x6')](function(_0x148bc7){var _0x18dec1={'method':_0x581a('0x7'),'uri':url[_0x581a('0x8')](_0x4d0685[_0x581a('0x9')],_0x581a('0xa')),'body':{'type':_0x4d0685['ndaactivity_type']||_0x581a('0xb'),'channelId':'Nda','conversation':{'id':_0x362572[_0x581a('0xc')]},'from':{'id':_0x362572[_0x581a('0xd')],'name':_0x362572[_0x581a('0xe')]},'recipient':{'id':_0x362572[_0x581a('0xf')],'name':_0x362572['extension']},'text':_0x4d0685[_0x581a('0x10')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x148bc7['access_token']},'json':!![]};if(_0x4d0685['project']){_0x18dec1['body'][_0x581a('0x11')][_0x581a('0x12')]=_0x4d0685['project'];}if(_0x4d0685[_0x581a('0x13')]=='1'){_0x18dec1[_0x581a('0x14')][_0x581a('0x11')][_0x581a('0x15')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x581a('0x16')};}if(_0x4d0685[_0x581a('0x17')]){_0x18dec1[_0x581a('0x14')][_0x581a('0x11')]['CustomAction']=_0x4d0685[_0x581a('0x17')];if(_0x4d0685[_0x581a('0x18')]){_0x18dec1['body'][_0x581a('0x11')][_0x581a('0x19')]=_0x4d0685[_0x581a('0x18')];}}logger[_0x581a('0x1a')](JSON['stringify'](_0x18dec1));return rp(_0x18dec1);});};
\ No newline at end of file
index d6e12e5..7ddfeea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x83ef=['./lib/api'];(function(_0x5c5c52,_0x36d085){var _0x4229ff=function(_0x3806df){while(--_0x3806df){_0x5c5c52['push'](_0x5c5c52['shift']());}};_0x4229ff(++_0x36d085);}(_0x83ef,0x1e5));var _0xf83e=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x83ef[_0x167cc1];return _0x10bc4b;};'use strict';var asr=require(_0xf83e('0x0'));module['exports']=function(_0x33f368,_0x1f2ab0,_0x546e31,_0x19d15d){return asr(_0x33f368,_0x1f2ab0,_0x546e31,_0x19d15d);};
\ No newline at end of file
+var _0x0b2d=['./lib/api','exports'];(function(_0x1c7fd0,_0x4384b8){var _0x1ad11f=function(_0xe86263){while(--_0xe86263){_0x1c7fd0['push'](_0x1c7fd0['shift']());}};_0x1ad11f(++_0x4384b8);}(_0x0b2d,0x11c));var _0xd0b2=function(_0x14faad,_0x3ecf9f){_0x14faad=_0x14faad-0x0;var _0x3b2ddb=_0x0b2d[_0x14faad];return _0x3b2ddb;};'use strict';var asr=require(_0xd0b2('0x0'));module[_0xd0b2('0x1')]=function(_0xbfdc3d,_0x37c8fd,_0x1da2d9,_0x37b657){return asr(_0xbfdc3d,_0x37c8fd,_0x1da2d9,_0x37b657);};
\ No newline at end of file
index 633620b..46ec90f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa6b1=['Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','close','bluebird','lodash','moment','agi','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','digest','hex','info','unix','stringify','createReadStream','send','EOS','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.'];(function(_0x262986,_0x3bd638){var _0x36daa1=function(_0x77a6db){while(--_0x77a6db){_0x262986['push'](_0x262986['shift']());}};_0x36daa1(++_0x3bd638);}(_0xa6b1,0xa8));var _0x1a6b=function(_0x5b1801,_0x370d83){_0x5b1801=_0x5b1801-0x0;var _0xeb051d=_0xa6b1[_0x5b1801];return _0xeb051d;};'use strict';var BPromise=require(_0x1a6b('0x0'));var _=require(_0x1a6b('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x1a6b('0x2'));var crypto=require('crypto');var logger=require('../../../../../../config/logger')(_0x1a6b('0x3'));module['exports']=function(_0x2a1e9e,_0x53d72a,_0x50156e,_0x2b2260){return new BPromise(function(_0x4e2b4a,_0x35a799){logger['info'](_0x1a6b('0x4'),_0x2b2260||_0x1a6b('0x5'));var _0x3dffaf=new WebSocket(_0x2b2260||_0x1a6b('0x5'),{'perMessageDeflate':![]});var _0x309e70='';var _0x7a022a='0';var _0x40194e='1';var _0x40b644='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x47147b(_0x309d65){var _0x1307d0=crypto[_0x1a6b('0x6')](_0x1a6b('0x7'));_0x1307d0['update'](_0x309d65);return _0x1307d0[_0x1a6b('0x8')](_0x1a6b('0x9'));}function _0x51f968(){try{logger[_0x1a6b('0xa')]('Open\x20Tilde\x20ASR\x20socket');var _0x21aee7=moment()[_0x1a6b('0xb')]();var _0x4012c6=_0x47147b(_0x21aee7+_0x53d72a+_0x50156e);_0x3dffaf['send'](JSON[_0x1a6b('0xc')]({'appID':_0x53d72a,'timestamp':_0x21aee7,'appKey':_0x4012c6}));var _0x46aed9=fs[_0x1a6b('0xd')](_0x2a1e9e);_0x46aed9['on']('data',function(_0x12eba4){_0x3dffaf[_0x1a6b('0xe')](_0x12eba4);});_0x46aed9['on']('close',function(){_0x3dffaf[_0x1a6b('0xe')](_0x1a6b('0xf'));});}catch(_0xbb21cd){logger['error'](_0x1a6b('0x10'),JSON['stringify'](_0xbb21cd));_0x3dffaf[_0x1a6b('0x11')]();}}function _0x3a3139(_0x4c52eb){try{if(_0x4c52eb){var _0x27f10e=JSON[_0x1a6b('0x12')](_0x4c52eb);switch(_0x27f10e[_0x1a6b('0x13')]){case 0x0:if(_0x27f10e[_0x1a6b('0x14')]){if(_0x27f10e[_0x1a6b('0x14')]['final']){logger[_0x1a6b('0xa')](_0x1a6b('0x15'),JSON[_0x1a6b('0xc')](_0x27f10e[_0x1a6b('0x14')][_0x1a6b('0x16')]));_0x309e70=_0x27f10e[_0x1a6b('0x14')][_0x1a6b('0x16')][0x0]['transcript'];_0x7a022a=_0x27f10e[_0x1a6b('0x14')][_0x1a6b('0x16')][0x0][_0x1a6b('0x17')];_0x40194e='0';_0x40b644=_0x1a6b('0x18');_0x3dffaf[_0x1a6b('0x11')]();}}break;case 0x1:logger[_0x1a6b('0xa')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x40194e='1';_0x40b644=_0x1a6b('0x19');break;case 0x2:logger['info'](_0x1a6b('0x1a'));_0x40194e='2';_0x40b644=_0x1a6b('0x1a');break;case 0x9:logger[_0x1a6b('0xa')](_0x1a6b('0x1b'));_0x40194e='9';_0x40b644=_0x1a6b('0x1b');break;case 0xa:logger[_0x1a6b('0xa')](_0x1a6b('0x1c'));_0x40194e='10';_0x40b644=_0x1a6b('0x1c');break;case 0xb:logger[_0x1a6b('0xa')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x40194e='11';_0x40b644=_0x1a6b('0x1d');}}}catch(_0x4d35a0){logger[_0x1a6b('0x1e')](_0x1a6b('0x1f'),JSON[_0x1a6b('0xc')](_0x4d35a0));_0x3dffaf['terminate']();}}function _0x47db26(){logger[_0x1a6b('0xa')](_0x1a6b('0x20'));_0x4e2b4a({'transcript':_0x309e70,'confidence':_0x7a022a,'status':_0x40194e,'status_message':_0x40b644});}function _0x16c48b(_0x33b2cc){logger[_0x1a6b('0x1e')](_0x1a6b('0x21'));if(!_[_0x1a6b('0x22')](_0x33b2cc)){logger[_0x1a6b('0x1e')](_[_0x1a6b('0x23')](_0x33b2cc)?JSON[_0x1a6b('0xc')](_0x33b2cc):_0x33b2cc);}}_0x3dffaf['on'](_0x1a6b('0x24'),_0x51f968);_0x3dffaf['on'](_0x1a6b('0x25'),_0x3a3139);_0x3dffaf['on'](_0x1a6b('0x26'),_0x47db26);_0x3dffaf['on'](_0x1a6b('0x1e'),_0x16c48b);});};
\ No newline at end of file
+var _0xc7a3=['crypto','agi','exports','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','update','digest','hex','info','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','Tilde\x20ASR\x20send\x20error','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','terminate','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','lodash','moment'];(function(_0x1a3cc7,_0x2900e3){var _0x338438=function(_0x5a4872){while(--_0x5a4872){_0x1a3cc7['push'](_0x1a3cc7['shift']());}};_0x338438(++_0x2900e3);}(_0xc7a3,0x136));var _0x3c7a=function(_0x200013,_0x3fd43c){_0x200013=_0x200013-0x0;var _0x555615=_0xc7a3[_0x200013];return _0x555615;};'use strict';var BPromise=require('bluebird');var _=require(_0x3c7a('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x3c7a('0x1'));var crypto=require(_0x3c7a('0x2'));var logger=require('../../../../../../config/logger')(_0x3c7a('0x3'));module[_0x3c7a('0x4')]=function(_0x397391,_0x552e80,_0x33eaa2,_0x2909ad){return new BPromise(function(_0x561c8e,_0x5c4891){logger['info'](_0x3c7a('0x5'),_0x2909ad||_0x3c7a('0x6'));var _0x219bf9=new WebSocket(_0x2909ad||_0x3c7a('0x6'),{'perMessageDeflate':![]});var _0x140536='';var _0x40af98='0';var _0x2f1295='1';var _0x474048=_0x3c7a('0x7');function _0x4512f4(_0x8c4db9){var _0x42f13d=crypto[_0x3c7a('0x8')]('sha1');_0x42f13d[_0x3c7a('0x9')](_0x8c4db9);return _0x42f13d[_0x3c7a('0xa')](_0x3c7a('0xb'));}function _0x2df61d(){try{logger[_0x3c7a('0xc')](_0x3c7a('0xd'));var _0x4f68d7=moment()[_0x3c7a('0xe')]();var _0x479729=_0x4512f4(_0x4f68d7+_0x552e80+_0x33eaa2);_0x219bf9[_0x3c7a('0xf')](JSON[_0x3c7a('0x10')]({'appID':_0x552e80,'timestamp':_0x4f68d7,'appKey':_0x479729}));var _0x5ae499=fs[_0x3c7a('0x11')](_0x397391);_0x5ae499['on'](_0x3c7a('0x12'),function(_0x53fd3e){_0x219bf9[_0x3c7a('0xf')](_0x53fd3e);});_0x5ae499['on'](_0x3c7a('0x13'),function(){_0x219bf9[_0x3c7a('0xf')]('EOS');});}catch(_0x2b35f2){logger['error'](_0x3c7a('0x14'),JSON[_0x3c7a('0x10')](_0x2b35f2));_0x219bf9['terminate']();}}function _0x33fd11(_0x2e61d2){try{if(_0x2e61d2){var _0x19cdf2=JSON[_0x3c7a('0x15')](_0x2e61d2);switch(_0x19cdf2[_0x3c7a('0x16')]){case 0x0:if(_0x19cdf2['result']){if(_0x19cdf2[_0x3c7a('0x17')][_0x3c7a('0x18')]){logger[_0x3c7a('0xc')](_0x3c7a('0x19'),JSON[_0x3c7a('0x10')](_0x19cdf2[_0x3c7a('0x17')][_0x3c7a('0x1a')]));_0x140536=_0x19cdf2['result']['hypotheses'][0x0][_0x3c7a('0x1b')];_0x40af98=_0x19cdf2[_0x3c7a('0x17')][_0x3c7a('0x1a')][0x0][_0x3c7a('0x1c')];_0x2f1295='0';_0x474048='Success.';_0x219bf9[_0x3c7a('0x1d')]();}}break;case 0x1:logger[_0x3c7a('0xc')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x2f1295='1';_0x474048=_0x3c7a('0x7');break;case 0x2:logger[_0x3c7a('0xc')](_0x3c7a('0x1e'));_0x2f1295='2';_0x474048='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x3c7a('0xc')](_0x3c7a('0x1f'));_0x2f1295='9';_0x474048=_0x3c7a('0x1f');break;case 0xa:logger[_0x3c7a('0xc')](_0x3c7a('0x20'));_0x2f1295='10';_0x474048=_0x3c7a('0x20');break;case 0xb:logger['info']('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x2f1295='11';_0x474048='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x41ce5e){logger[_0x3c7a('0x21')]('Tilde\x20ASR\x20parse\x20error',JSON['stringify'](_0x41ce5e));_0x219bf9[_0x3c7a('0x1d')]();}}function _0x50eb66(){logger['info'](_0x3c7a('0x22'));_0x561c8e({'transcript':_0x140536,'confidence':_0x40af98,'status':_0x2f1295,'status_message':_0x474048});}function _0x2e6127(_0x4577a9){logger[_0x3c7a('0x21')](_0x3c7a('0x23'));if(!_[_0x3c7a('0x24')](_0x4577a9)){logger[_0x3c7a('0x21')](_[_0x3c7a('0x25')](_0x4577a9)?JSON['stringify'](_0x4577a9):_0x4577a9);}}_0x219bf9['on'](_0x3c7a('0x26'),_0x2df61d);_0x219bf9['on']('message',_0x33fd11);_0x219bf9['on'](_0x3c7a('0x13'),_0x50eb66);_0x219bf9['on'](_0x3c7a('0x21'),_0x2e6127);});};
\ No newline at end of file
index 73cc5b4..233cd87 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x80da=['./asr','exports'];(function(_0x58dc25,_0x49b9d5){var _0x21b0a7=function(_0x38a186){while(--_0x38a186){_0x58dc25['push'](_0x58dc25['shift']());}};_0x21b0a7(++_0x49b9d5);}(_0x80da,0x1ae));var _0xa80d=function(_0x5bbce9,_0x5b2cdf){_0x5bbce9=_0x5bbce9-0x0;var _0x1cd0c3=_0x80da[_0x5bbce9];return _0x1cd0c3;};var asr=require(_0xa80d('0x0'));module[_0xa80d('0x1')]={'asr':asr};
\ No newline at end of file
+var _0x1075=['./asr'];(function(_0x7632df,_0xd7c2c3){var _0x15b345=function(_0x55823d){while(--_0x55823d){_0x7632df['push'](_0x7632df['shift']());}};_0x15b345(++_0xd7c2c3);}(_0x1075,0x73));var _0x5107=function(_0x1b5f7a,_0x281348){_0x1b5f7a=_0x1b5f7a-0x0;var _0x205dd7=_0x1075[_0x1b5f7a];return _0x205dd7;};var asr=require(_0x5107('0x0'));module['exports']={'asr':asr};
\ No newline at end of file
index dff822d..76b5bcf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55c0=['getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','E_AGI_SERVER_MAXCONNECTION','destroy','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','events','EventEmitter','./error','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','data','projectUpdate','stringify'];(function(_0x1fd4d7,_0x2feafd){var _0x7efe8a=function(_0xc54f55){while(--_0xc54f55){_0x1fd4d7['push'](_0x1fd4d7['shift']());}};_0x7efe8a(++_0x2feafd);}(_0x55c0,0x140));var _0x055c=function(_0x97db75,_0x3abdb8){_0x97db75=_0x97db75-0x0;var _0x259a53=_0x55c0[_0x97db75];return _0x259a53;};'use strict';var util=require(_0x055c('0x0'));var net=require('net');var EventEmitter=require(_0x055c('0x1'))[_0x055c('0x2')];var AGIError=require(_0x055c('0x3'));var AGIChannel=require('./channel');var AGIServer=function(_0x17725a,_0x29135c,_0x37e177){var _0x640c86=this;var _0x1c115e=null;var _0x29847b=0x0;if(!_0x17725a)_0x17725a=0x11dd;if(!_0x29135c)_0x29135c=_0x055c('0x4');EventEmitter[_0x055c('0x5')](_0x640c86);function _0x2bc8e8(){if(!_0x17725a){_0x640c86[_0x055c('0x6')](_0x055c('0x7'),new AGIError(_0x055c('0x8')));return![];}_0x1c115e=net[_0x055c('0x9')]();_0x1c115e[_0x055c('0xa')](_0x17725a,_0x29135c);_0x1c115e['on'](_0x055c('0xb'),function(){_0x640c86[_0x055c('0x6')](_0x055c('0xb'));});_0x1c115e['on'](_0x055c('0xc'),function(_0x248889){_0x248889['on'](_0x055c('0xd'),function(_0x4bc40c){_0x640c86[_0x055c('0x6')](_0x055c('0xe'),JSON[_0x055c('0xf')](_0x4bc40c));});_0x1c115e[_0x055c('0x10')](function(_0x3742a1,_0xb3b0b2){if(_0x3742a1){_0x640c86[_0x055c('0x6')](_0x055c('0x7'),new AGIError(_0x055c('0x11'),_0x3742a1));}else if(_0x37e177&&_0x37e177<0x0){_0x640c86[_0x055c('0x6')]('error',new AGIError(_0x055c('0x12')));_0x248889['destroy']();}else if(_0x37e177&&_0x37e177>0x0&&_0x37e177<_0xb3b0b2){_0x29847b+=0x1;_0x640c86[_0x055c('0x6')](_0x055c('0x7'),new AGIError(_0x055c('0x13'),_0x29847b));_0x248889[_0x055c('0x14')]();}else{var _0x3bbb65=new AGIChannel(_0x248889);_0x3bbb65['on'](_0x055c('0x15'),function(){_0x640c86[_0x055c('0x6')]('connection',_0x3bbb65);});}});});_0x1c115e['on'](_0x055c('0x7'),function(_0x402e93){_0x640c86[_0x055c('0x6')](_0x055c('0x7'),new AGIError('E_AGI_SERVER_ERROR',_0x402e93[_0x055c('0x16')]));});_0x1c115e['on'](_0x055c('0x17'),function(){_0x640c86['emit'](_0x055c('0x17'),new AGIError(_0x055c('0x18')));});}process[_0x055c('0x19')](function(){_0x2bc8e8();});};util[_0x055c('0x1a')](AGIServer,EventEmitter);module[_0x055c('0x1b')]=function(_0x1435e0,_0x947b6a,_0x3f2c9e){return new AGIServer(_0x1435e0,_0x947b6a,_0x3f2c9e);};
\ No newline at end of file
+var _0x0447=['inherits','exports','util','net','events','EventEmitter','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','listen','listening','connection','data','projectUpdate','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','nextTick'];(function(_0x15106b,_0x4d96f6){var _0x521203=function(_0x4dbe23){while(--_0x4dbe23){_0x15106b['push'](_0x15106b['shift']());}};_0x521203(++_0x4d96f6);}(_0x0447,0x1f0));var _0x7044=function(_0x48694f,_0x44690e){_0x48694f=_0x48694f-0x0;var _0x28aeb0=_0x0447[_0x48694f];return _0x28aeb0;};'use strict';var util=require(_0x7044('0x0'));var net=require(_0x7044('0x1'));var EventEmitter=require(_0x7044('0x2'))[_0x7044('0x3')];var AGIError=require(_0x7044('0x4'));var AGIChannel=require(_0x7044('0x5'));var AGIServer=function(_0x26be6a,_0x7b9a5c,_0x4c1179){var _0x2e88e0=this;var _0xce1320=null;var _0x4e51e0=0x0;if(!_0x26be6a)_0x26be6a=0x11dd;if(!_0x7b9a5c)_0x7b9a5c=_0x7044('0x6');EventEmitter[_0x7044('0x7')](_0x2e88e0);function _0x59f497(){if(!_0x26be6a){_0x2e88e0[_0x7044('0x8')](_0x7044('0x9'),new AGIError(_0x7044('0xa')));return![];}_0xce1320=net['createServer']();_0xce1320[_0x7044('0xb')](_0x26be6a,_0x7b9a5c);_0xce1320['on'](_0x7044('0xc'),function(){_0x2e88e0['emit']('listening');});_0xce1320['on'](_0x7044('0xd'),function(_0x52f228){_0x52f228['on'](_0x7044('0xe'),function(_0x4296e4){_0x2e88e0[_0x7044('0x8')](_0x7044('0xf'),JSON['stringify'](_0x4296e4));});_0xce1320['getConnections'](function(_0x39f61d,_0x314a7b){if(_0x39f61d){_0x2e88e0[_0x7044('0x8')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x39f61d));}else if(_0x4c1179&&_0x4c1179<0x0){_0x2e88e0['emit']('error',new AGIError(_0x7044('0x10')));_0x52f228[_0x7044('0x11')]();}else if(_0x4c1179&&_0x4c1179>0x0&&_0x4c1179<_0x314a7b){_0x4e51e0+=0x1;_0x2e88e0[_0x7044('0x8')](_0x7044('0x9'),new AGIError(_0x7044('0x12'),_0x4e51e0));_0x52f228[_0x7044('0x11')]();}else{var _0x46e6a1=new AGIChannel(_0x52f228);_0x46e6a1['on'](_0x7044('0x13'),function(){_0x2e88e0[_0x7044('0x8')](_0x7044('0xd'),_0x46e6a1);});}});});_0xce1320['on'](_0x7044('0x9'),function(_0x17b964){_0x2e88e0['emit'](_0x7044('0x9'),new AGIError(_0x7044('0x14'),_0x17b964['code']));});_0xce1320['on'](_0x7044('0x15'),function(){_0x2e88e0[_0x7044('0x8')](_0x7044('0x15'),new AGIError(_0x7044('0x16')));});}process[_0x7044('0x17')](function(){_0x59f497();});};util[_0x7044('0x18')](AGIServer,EventEmitter);module[_0x7044('0x19')]=function(_0x2f4bbf,_0xce8884,_0x1428d7){return new AGIServer(_0x2f4bbf,_0xce8884,_0x1428d7);};
\ No newline at end of file
index 29137ff..a96e32e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbac8=['private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','Amy','aws_text_type','awsLex','aws_lex_region','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','replaceAllVariables','saveRestApiResult','%s.%s','setVariable','split','replaceAll','getVariable','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','agi','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','no\x20list\x20selected','delay','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','query:\x20%s','getQueryOdbc','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','variable\x20%s\x20set','dial','debug','sip_id','no\x20user\x20selected','DIAL','SIP/%s','Executed\x20command\x20%s','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','dialogflow','Dialogflow\x20Result\x20%s','dialogflowV2','dialogflowV2_project_id','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','out','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','ndauth_url','no\x20username\x20configured','password','ndassistant_url','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','end','ext_dial','trunk_id','no\x20trunk\x20selected','trunk_name','SIP/%s/%s','opts','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','test','hiddendigitsnum','generate','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','awspolly','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%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','recordFile','google\x20%s\x20file\x20created','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','priority','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','math','operation','no\x20operation\x20configured','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','file_id','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause_id','playback','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','indexOf','QUEUE','macro','position','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','no\x20variable\x20selected\x20for\x20the\x20response','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','no\x20mail\x20account\x20configured','getMailAccount','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','host','port','secure','authentication','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','sendFax','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','127.0.0.1','system','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','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','Enter\x20in\x20SWITCH\x20(%s)\x20block','exports','path','util','odbc','randomstring','moment','request-promise','../../config/logger','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','rpc','prototype','getVariableById','then','name','catch','getVoiceQueue','getSquareProject','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getSound','getSoundById','save_name','sendMailMessage','mailRpc','IntervalId','interval','map','Intervals','getSoundPath','format','%s/sounds/converted/%s','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','callerid','createSquareRecording','calleridname','context','extension','accountcode','dnid','arg_1','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','has','dialTimezone','timezones','scheduledat','add','insertContact','utcOffset','minutes','getPause','getPauseById','agent','agentPause','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','MALE','MP3','googleTTS','google_tts_language','restAPI','method','timeout','includes','POST','toUpperCase','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','url','stringify','body','render','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','client_email'];(function(_0x54cfc6,_0xfb8d8){var _0x20aa13=function(_0x2e8228){while(--_0x2e8228){_0x54cfc6['push'](_0x54cfc6['shift']());}};_0x20aa13(++_0xfb8d8);}(_0xbac8,0x140));var _0x8bac=function(_0x56827f,_0x48637a){_0x56827f=_0x56827f-0x0;var _0x2ae382=_0xbac8[_0x56827f];return _0x2ae382;};'use strict';var fs=require('fs');var path=require(_0x8bac('0x0'));var util=require(_0x8bac('0x1'));var _=require('lodash');var sh=require('shelljs');var odbc=require(_0x8bac('0x2'))();var rs=require(_0x8bac('0x3'));var moment=require(_0x8bac('0x4'));var Mustache=require('mustache');var rp=require(_0x8bac('0x5'));var logger=require(_0x8bac('0x6'))('agi');var config=require('../../config/environment');var shared=require(_0x8bac('0x7'));var scripts=require(_0x8bac('0x8'));var FILES_PATH=_0x8bac('0x9');var recursiveMapAttributes=[_0x8bac('0xa'),_0x8bac('0xb')];var verticesWithRetry=[_0x8bac('0xc'),_0x8bac('0xd'),_0x8bac('0xe')];var AGIVertices=function(_0x437c05,_0x5a934f,_0x11596d){this[_0x8bac('0xf')]=_0x437c05;this[_0x8bac('0x10')]=_0x5a934f;this['mailRpc']=_0x11596d;};AGIVertices[_0x8bac('0x11')]['getVariable']=function(_0x8cc37,_0x4620a2){this['rpc'][_0x8bac('0x12')](_0x8cc37)[_0x8bac('0x13')](function(_0x1f36bb){_0x4620a2(null,_0x1f36bb?_0x1f36bb[_0x8bac('0x14')]:![]);})[_0x8bac('0x15')](function(_0x5bc586){_0x4620a2(_0x5bc586);});};AGIVertices['prototype'][_0x8bac('0x16')]=function(_0x442c66,_0x4deb09){this[_0x8bac('0x10')]['getVoiceQueueById'](_0x442c66)['then'](function(_0x7617a6){_0x4deb09(null,_0x7617a6?_0x7617a6[_0x8bac('0x14')]:![]);})[_0x8bac('0x15')](function(_0x3225ea){_0x4deb09(_0x3225ea);});};AGIVertices[_0x8bac('0x11')][_0x8bac('0x17')]=function(_0x50dba1,_0x5e9c24){this[_0x8bac('0x10')]['getSquareProjectById'](_0x50dba1)['then'](function(_0x3ab89d){_0x5e9c24(null,_0x3ab89d?_0x3ab89d[_0x8bac('0x14')]:![]);})[_0x8bac('0x15')](function(_0x362ec8){_0x5e9c24(_0x362ec8);});};AGIVertices[_0x8bac('0x11')][_0x8bac('0x18')]=function(_0x531834,_0x21c13){this[_0x8bac('0x10')][_0x8bac('0x19')](_0x531834)[_0x8bac('0x13')](function(_0x16b4e6){_0x21c13(null,_0x16b4e6?_0x16b4e6[_0x8bac('0x1a')]:![]);})[_0x8bac('0x15')](function(_0x29af94){_0x21c13(_0x29af94);});};AGIVertices['prototype'][_0x8bac('0x1b')]=function(_0x59bd51,_0x45eda3){this[_0x8bac('0x10')][_0x8bac('0x1c')](_0x59bd51)[_0x8bac('0x13')](function(_0x576824){_0x45eda3(null,_0x576824?_0x576824[_0x8bac('0x14')]:![]);})[_0x8bac('0x15')](function(_0x3a5871){_0x45eda3(_0x3a5871);});};AGIVertices['prototype'][_0x8bac('0x1d')]=function(_0x5353fa,_0x30916b){this['rpc']['getTrunkById'](_0x5353fa)['then'](function(_0x3db974){_0x30916b(null,_0x3db974?_0x3db974[_0x8bac('0x14')]:![]);})[_0x8bac('0x15')](function(_0x383e5d){_0x30916b(_0x383e5d);});};AGIVertices[_0x8bac('0x11')][_0x8bac('0x1e')]=function(_0x4e472e,_0x414252){var _0x2285d0=this;this['rpc'][_0x8bac('0x1f')](_0x4e472e)[_0x8bac('0x13')](function(_0x2bb6fe){_0x414252(null,_0x2bb6fe?_0x2285d0['getSoundPath'](_0x2bb6fe[_0x8bac('0x20')]):![]);})[_0x8bac('0x15')](function(_0x86bd5f){_0x414252(_0x86bd5f);});};AGIVertices[_0x8bac('0x11')]['getMailAccount']=function(_0x1dfcca,_0x29fd31){this['rpc']['getMailAccountById'](_0x1dfcca)[_0x8bac('0x13')](function(_0x58b61d){_0x29fd31(null,_0x58b61d?_0x58b61d:![]);})['catch'](function(_0x46a8f6){_0x29fd31(_0x46a8f6);});};AGIVertices[_0x8bac('0x11')][_0x8bac('0x21')]=function(_0x5ca5be,_0xc88d7,_0x17242d){this[_0x8bac('0x22')]['sendMailMessage'](_0x5ca5be,_0xc88d7)['then'](function(){_0x17242d(null);})[_0x8bac('0x15')](function(_0x991087){_0x17242d(_0x991087);});};AGIVertices[_0x8bac('0x11')]['getIntervals']=function(_0x4a7d4a,_0x5856bb){this[_0x8bac('0x10')]['getIntervalById'](_0x4a7d4a)[_0x8bac('0x13')](function(_0x42da1c){if(_0x42da1c){if(_0x42da1c[_0x8bac('0x23')]){_0x5856bb(null,[_0x42da1c[_0x8bac('0x24')]]);}else{_0x5856bb(null,_[_0x8bac('0x25')](_0x42da1c[_0x8bac('0x26')],'interval'));}}else{_0x5856bb(null,![]);}})[_0x8bac('0x15')](function(_0x3ee154){_0x5856bb(_0x3ee154);});};AGIVertices[_0x8bac('0x11')][_0x8bac('0x27')]=function(_0x2d0aa8){return util[_0x8bac('0x28')](_0x8bac('0x29'),FILES_PATH,_0x2d0aa8);};AGIVertices[_0x8bac('0x11')]['getQueryOdbc']=function(_0x2b3652,_0xe67b6a,_0x51ce03){odbc[_0x8bac('0x2a')](_0x2b3652,function(_0x322aae){if(_0x322aae){logger[_0x8bac('0x2b')](_0x8bac('0x2c'),_0x322aae);_0x51ce03(_0x322aae);}else{logger[_0x8bac('0x2d')](_0x8bac('0x2e'));odbc[_0x8bac('0x2f')](_0xe67b6a,function(_0x5755cb,_0x5789ca){if(_0x5755cb){logger['info'](_0x8bac('0x30'),_0xe67b6a);_0x51ce03(_0x5755cb);}else{logger[_0x8bac('0x2d')]('Query\x20executed\x20correctly\x20%s',_0xe67b6a);odbc[_0x8bac('0x31')](function(_0x16efb9){if(_0x16efb9){logger[_0x8bac('0x2b')](_0x8bac('0x32'),_0x16efb9);}_0x51ce03(null,_0x5789ca);});}});}});};AGIVertices[_0x8bac('0x11')][_0x8bac('0x33')]=function(_0x580876,_0x16df3b){this[_0x8bac('0x10')]['getSmsAccountById'](_0x580876)[_0x8bac('0x13')](function(_0x5bd961){_0x16df3b(null,_0x5bd961?_0x5bd961:![]);})['catch'](function(_0x387188){_0x16df3b(_0x387188);});};AGIVertices[_0x8bac('0x11')][_0x8bac('0x34')]=function(_0xb24b60,_0x39e55c){this[_0x8bac('0x10')][_0x8bac('0x34')](_0xb24b60)['then'](function(_0xe170c5){_0x39e55c(null,_0xe170c5);})['catch'](function(_0x47f92d){_0x39e55c(_0x47f92d);});};AGIVertices[_0x8bac('0x11')][_0x8bac('0x35')]=function(_0x449c3d,_0x5ceba1,_0x3e4274){this[_0x8bac('0x10')][_0x8bac('0x35')]({'uniqueid':this['channel'][_0x8bac('0x36')],'node':_0x449c3d[_0x8bac('0x37')],'application':_0x449c3d[_0x8bac('0x38')],'data':_0x5ceba1||null,'project_name':this[_0x8bac('0xf')]['arg_1'],'callerid':this[_0x8bac('0xf')][_0x8bac('0x39')]})['then'](function(_0x2d6ce7){if(_0x3e4274){_0x3e4274(null,_0x2d6ce7);}})['catch'](function(_0x1c50cd){if(_0x3e4274){_0x3e4274(_0x1c50cd);}});};AGIVertices[_0x8bac('0x11')][_0x8bac('0x3a')]=function(_0x465422,_0x1faef3,_0x152cbe,_0x4eef82){this[_0x8bac('0x10')]['createSquareRecording']({'uniqueid':this[_0x8bac('0xf')][_0x8bac('0x36')],'callerid':this[_0x8bac('0xf')][_0x8bac('0x39')],'calleridname':this['channel'][_0x8bac('0x3b')],'context':this[_0x8bac('0xf')][_0x8bac('0x3c')],'extension':this[_0x8bac('0xf')][_0x8bac('0x3d')],'priority':this[_0x8bac('0xf')]['priority'],'accountcode':this[_0x8bac('0xf')][_0x8bac('0x3e')],'dnid':this[_0x8bac('0xf')][_0x8bac('0x3f')],'projectName':this['channel'][_0x8bac('0x40')],'saveName':_0x1faef3,'filename':_0x465422[_0x8bac('0x41')]||_0x1faef3,'savePath':_0x152cbe})[_0x8bac('0x13')](function(_0x419d4e){_0x4eef82(null,_0x419d4e);})['catch'](function(_0x16f4aa){_0x4eef82(_0x16f4aa);});};AGIVertices[_0x8bac('0x11')]['createSquareMessage']=function(_0xa0cc4b,_0x17db62,_0x3b7d7f,_0x4f47c8,_0x5b8d66){this[_0x8bac('0x10')][_0x8bac('0x42')]({'uniqueid':this['channel'][_0x8bac('0x36')],'body':_0xa0cc4b,'direction':_0x17db62,'providerName':_0x3b7d7f,'providerResponse':_0x4f47c8})[_0x8bac('0x13')](function(_0x40a863){if(_0x5b8d66){_0x5b8d66(null,_0x40a863);}})[_0x8bac('0x15')](function(_0x3fc24a){if(_0x5b8d66){_0x5b8d66(_0x3fc24a);}});};AGIVertices[_0x8bac('0x11')][_0x8bac('0x43')]=function(_0x331ea7,_0x2fd485){var _0x5a1f35=this;var _0x45ac08=0x0;var _0x254837={'firstName':_[_0x8bac('0x44')](_0x331ea7[_0x8bac('0x14')])||_[_0x8bac('0x45')](_0x331ea7[_0x8bac('0x14')])?_0x8bac('0x46')+Math[_0x8bac('0x47')]():_0x331ea7[_0x8bac('0x14')],'lastName':_[_0x8bac('0x44')](_0x331ea7[_0x8bac('0x48')])||_[_0x8bac('0x45')](_0x331ea7[_0x8bac('0x48')])?null:_0x331ea7[_0x8bac('0x48')],'phone':_0x331ea7[_0x8bac('0x49')],'ListId':_0x331ea7[_0x8bac('0x4a')],'scheduledat':_0x331ea7[_0x8bac('0x4b')],'callbackUniqueid':this['channel'][_0x8bac('0x36')],'tags':_0x8bac('0x4c'),'description':_0x8bac('0x4d')+_0x331ea7[_0x8bac('0x4b')][_0x8bac('0x4e')](),'priority':_0x331ea7['callback_priority']};if(_[_0x8bac('0x4f')](_0x331ea7,'dialTimezone')){if(!_['isNil'](_0x331ea7[_0x8bac('0x50')])){var _0x3e7e5d=_0x331ea7[_0x8bac('0x50')];if(_0x331ea7[_0x8bac('0x50')]=='CALLERID(dialTimezone)'){this['rpc']['getContactByPhone']({'phone':_0x331ea7[_0x8bac('0x49')]})[_0x8bac('0x13')](function(_0x330b14){if(!_[_0x8bac('0x45')](_0x330b14)){var _0x15bcac=_0x330b14[_0x8bac('0x50')];if(!_['isNil'](_0x15bcac)){var _0x5ef05e=shared[_0x8bac('0x51')][_0x15bcac];if(!_[_0x8bac('0x45')](_0x5ef05e)){var _0x18875d=-0x1*_0x5ef05e['utcOffset'];_0x254837[_0x8bac('0x52')]=moment(_0x331ea7[_0x8bac('0x52')])[_0x8bac('0x53')](_0x18875d,'minutes');_0x5a1f35['insertContact'](_0x254837,_0x331ea7,_0x2fd485);}else{_0x5a1f35[_0x8bac('0x54')](_0x254837,_0x331ea7,_0x2fd485);}}else{_0x5a1f35[_0x8bac('0x54')](_0x254837,_0x331ea7,_0x2fd485);}}else{_0x5a1f35[_0x8bac('0x54')](_0x254837,_0x331ea7,_0x2fd485);}});}else{var _0x45ac08=shared[_0x8bac('0x51')][_0x3e7e5d];if(!_[_0x8bac('0x45')](_0x45ac08)){var _0x3e8388=-0x1*_0x45ac08[_0x8bac('0x55')];_0x254837['scheduledat']=moment(_0x331ea7[_0x8bac('0x52')])[_0x8bac('0x53')](_0x3e8388,_0x8bac('0x56'));_0x5a1f35['insertContact'](_0x254837,_0x331ea7,_0x2fd485);}else{_0x5a1f35[_0x8bac('0x54')](_0x254837,_0x331ea7,_0x2fd485);}}}else{_0x5a1f35[_0x8bac('0x54')](_0x254837,_0x331ea7,_0x2fd485);}}else{_0x5a1f35[_0x8bac('0x54')](_0x254837,_0x331ea7,_0x2fd485);}};AGIVertices[_0x8bac('0x11')][_0x8bac('0x57')]=function(_0x1f05f5,_0x346fbe){this[_0x8bac('0x10')][_0x8bac('0x58')](_0x1f05f5)[_0x8bac('0x13')](function(_0x22c1e5){_0x346fbe(null,_0x22c1e5?_0x22c1e5[_0x8bac('0x14')]:![]);})[_0x8bac('0x15')](function(_0x43c351){_0x346fbe(_0x43c351);});};AGIVertices[_0x8bac('0x11')]['agentPause']=function(_0x12b5c3,_0x540832,_0x4dddc5){var _0x211854={'role':_0x8bac('0x59')};_0x211854[_0x12b5c3]=this[_0x8bac('0xf')][_0x8bac('0x39')];this[_0x8bac('0x10')][_0x8bac('0x5a')](_0x211854,_0x540832,this[_0x8bac('0xf')][_0x8bac('0x36')])['then'](function(_0xf10757){_0x4dddc5(null,_[_0x8bac('0x45')](_0xf10757)?![]:!![]);})[_0x8bac('0x15')](function(_0x12e8f5){logger[_0x8bac('0x2b')](_0x12e8f5);_0x4dddc5(null,![]);});};AGIVertices[_0x8bac('0x11')][_0x8bac('0x5b')]=function(_0x1eb46b,_0x5a3014){var _0xdfc63b={'role':_0x8bac('0x59')};_0xdfc63b[_0x1eb46b]=this[_0x8bac('0xf')][_0x8bac('0x39')];this['rpc']['agentUnpause'](_0xdfc63b)[_0x8bac('0x13')](function(_0x39b806){_0x5a3014(null,_['isNil'](_0x39b806)?![]:!![]);})[_0x8bac('0x15')](function(_0x812f67){logger[_0x8bac('0x2b')](_0x812f67);_0x5a3014(null,![]);});};AGIVertices[_0x8bac('0x11')][_0x8bac('0x5c')]=function(_0x46c82e,_0x40b8df){var _0x425243={'role':_0x8bac('0x59')};_0x425243[_0x46c82e]=this[_0x8bac('0xf')][_0x8bac('0x39')];this[_0x8bac('0x10')]['agentLogout'](_0x425243)['then'](function(_0x15a5ce){_0x40b8df(null,_['isNil'](_0x15a5ce)?![]:!![]);})[_0x8bac('0x15')](function(_0x2a2d4e){logger[_0x8bac('0x2b')](_0x2a2d4e);_0x40b8df(null,![]);});};AGIVertices[_0x8bac('0x11')][_0x8bac('0x5d')]=function(_0x49ae37,_0x1d1d2f){var _0x5e7c44={'role':'agent'};_0x5e7c44[_0x49ae37]=this[_0x8bac('0xf')][_0x8bac('0x39')];var _0x426578=_0x49ae37!=_0x8bac('0x5e')?util[_0x8bac('0x28')](_0x8bac('0x5f'),_0x8bac('0x60'),this[_0x8bac('0xf')][_0x8bac('0x39')]):undefined;this[_0x8bac('0x10')][_0x8bac('0x5d')](_0x5e7c44,_0x426578)[_0x8bac('0x13')](function(_0x3d03a3){_0x1d1d2f(null,_['isNil'](_0x3d03a3)?![]:!![]);})['catch'](function(_0x2233d9){logger[_0x8bac('0x2b')](_0x2233d9);_0x1d1d2f(null,![]);});};AGIVertices['prototype'][_0x8bac('0x61')]=function(_0x1bf0b0,_0x4b7ce7){sh[_0x8bac('0x62')](_[_0x8bac('0x63')](_0x1bf0b0),function(_0x13e3e4,_0x59b8cb){var _0x5b9c01=_0x59b8cb[_0x8bac('0x64')](/(\r\n|\n|\r)/gm,'');_0x4b7ce7(null,_0x5b9c01);});};AGIVertices[_0x8bac('0x11')][_0x8bac('0x65')]=function(_0x17631d,_0x239af1){scripts[_0x8bac('0x65')](_0x17631d[_0x8bac('0x66')],_0x17631d[_0x8bac('0x67')]||'text',_0x17631d[_0x8bac('0x68')],_0x17631d[_0x8bac('0x69')]||_0x8bac('0x6a'),_0x17631d['ssmlGender']||_0x8bac('0x6b'),_0x17631d['audioEncoding']||_0x8bac('0x6c'))[_0x8bac('0x13')](function(_0x327c48){_0x239af1(null,_0x327c48);})[_0x8bac('0x15')](function(_0x9cf8cc){_0x239af1(_0x9cf8cc);});};AGIVertices[_0x8bac('0x11')][_0x8bac('0x6d')]=function(_0x168799,_0x22799c){scripts['googleTTS'](_0x168799[_0x8bac('0x68')],_0x168799[_0x8bac('0x6e')]||'en',0x1)['then'](function(_0x193fd0){_0x22799c(null,_0x193fd0);})[_0x8bac('0x15')](function(_0x1b0d67){_0x22799c(_0x1b0d67);});};AGIVertices['prototype'][_0x8bac('0x6f')]=function(_0x252fc2,_0x345b79){var _0x3e2e63={'uri':_0x252fc2['url'],'method':_0x252fc2[_0x8bac('0x70')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x252fc2['timeout'])==='number'&&parseInt(_0x252fc2[_0x8bac('0x71')])>=0x1?parseInt(_0x252fc2[_0x8bac('0x71')])*0x3e8:0x5*0x3e8};if(_[_0x8bac('0x72')]([_0x8bac('0x73'),'PUT'],_0x3e2e63[_0x8bac('0x70')][_0x8bac('0x74')]())){try{_0x3e2e63['body']=_0x252fc2['rawBody']?JSON['parse'](_0x252fc2[_0x8bac('0xb')]):{};}catch(_0x549f7b){logger[_0x8bac('0x2b')](_0x8bac('0x75'),_0x549f7b);}}try{_0x3e2e63[_0x8bac('0x76')]=_0x252fc2[_0x8bac('0xa')]?JSON[_0x8bac('0x77')](_0x252fc2[_0x8bac('0xa')]):{};}catch(_0xcf0668){logger[_0x8bac('0x2b')](_0x8bac('0x78'),_0xcf0668);}if(_0x252fc2[_0x8bac('0x79')]){try{var _0x493c75=require(_0x252fc2[_0x8bac('0x79')])[_0x8bac('0x7a')](this,_0x3e2e63);_0x3e2e63['uri']=Mustache['render'](_0x252fc2[_0x8bac('0x7b')],_0x493c75,{},['$$','$$']);if(_0x3e2e63[_0x8bac('0x76')]){_0x3e2e63['headers']=JSON[_0x8bac('0x77')](Mustache['render'](JSON[_0x8bac('0x7c')](_0x3e2e63[_0x8bac('0x76')]),_0x493c75,{},['$$','$$']));}if(_0x3e2e63['body']){_0x3e2e63[_0x8bac('0x7d')]=JSON['parse'](Mustache[_0x8bac('0x7e')](JSON[_0x8bac('0x7c')](_0x3e2e63[_0x8bac('0x7d')]),_0x493c75,{},['$$','$$']));}}catch(_0x2943f0){logger[_0x8bac('0x2b')](_0x8bac('0x7f'),_0x2943f0);}}rp(_0x3e2e63)[_0x8bac('0x13')](function(_0x47a5ac){var _0x293629={'statusCode':_0x47a5ac[_0x8bac('0x80')]||0xc8,'statusMessage':_0x47a5ac[_0x8bac('0x81')]||'OK','headers':_0x47a5ac[_0x8bac('0x76')]||{},'body':_0x47a5ac[_0x8bac('0x7d')]||{}};_0x345b79(null,_0x293629);})[_0x8bac('0x15')](function(_0x3a2d42){var _0x4a6eaa={'statusCode':_0x3a2d42[_0x8bac('0x80')]||0x1f4,'statusMessage':_0x3a2d42[_0x8bac('0x82')]||_0x8bac('0x83'),'headers':_0x3a2d42['options']['headers']||{},'body':_0x3a2d42[_0x8bac('0x84')][_0x8bac('0x7d')]||{}};_0x345b79(null,_0x4a6eaa);});};AGIVertices[_0x8bac('0x11')]['googleDialogflow']=function(_0xbd6aaa,_0x261d88){scripts[_0x8bac('0x85')](this[_0x8bac('0xf')][_0x8bac('0x36')],_0xbd6aaa[_0x8bac('0x86')],_0xbd6aaa[_0x8bac('0x68')],_0xbd6aaa[_0x8bac('0x87')]||'en')[_0x8bac('0x13')](function(_0x1ac6b0){_0x261d88(null,_0x1ac6b0);})[_0x8bac('0x15')](function(_0x2c2c70){_0x261d88(_0x2c2c70);});};AGIVertices[_0x8bac('0x11')]['googleDialogflowV2']=function(_0x1e9679,_0x2995b3){scripts[_0x8bac('0x88')](this[_0x8bac('0xf')][_0x8bac('0x36')],_0x1e9679['dialogflowV2_project_id'],_0x1e9679[_0x8bac('0x89')],_0x1e9679[_0x8bac('0x8a')],_0x1e9679[_0x8bac('0x68')],_0x1e9679[_0x8bac('0x8b')]||'en')['then'](function(_0x2be1e3){_0x2995b3(null,_0x2be1e3);})[_0x8bac('0x15')](function(_0x2e2ab4){_0x2995b3(_0x2e2ab4);});};AGIVertices[_0x8bac('0x11')][_0x8bac('0x8c')]=function(_0x512123,_0x2db47b){scripts['sestekNDA'](this['channel'],_0x512123)[_0x8bac('0x13')](function(_0x56d6b0){_0x2db47b(null,_0x56d6b0);})[_0x8bac('0x15')](function(_0x4716d3){_0x2db47b(_0x4716d3);});};AGIVertices['prototype'][_0x8bac('0x8d')]=function(_0x635389,_0x2781da){scripts[_0x8bac('0x8d')](_0x635389[_0x8bac('0x86')],_0x635389['text'],_0x635389[_0x8bac('0x8e')]||'en-US',_0x635389[_0x8bac('0x8f')])[_0x8bac('0x13')](function(_0x4f7d3f){_0x2781da(null,_0x4f7d3f);})['catch'](function(_0x235aa0){_0x2781da(_0x235aa0);});};AGIVertices[_0x8bac('0x11')][_0x8bac('0x90')]=function(_0xdd3314,_0x51284a,_0x33e249){scripts[_0x8bac('0x90')](_0x51284a,_0xdd3314['key'],_0xdd3314[_0x8bac('0x91')]||'en-US',this[_0x8bac('0x92')](_0xdd3314[_0x8bac('0x93')])?_0xdd3314['model']:undefined)['then'](function(_0x494840){_0x33e249(null,_0x494840);})[_0x8bac('0x15')](function(_0x21f51f){_0x33e249(_0x21f51f);});};AGIVertices[_0x8bac('0x11')][_0x8bac('0x94')]=function(_0x3a3d5c,_0x152e55){scripts[_0x8bac('0x94')](_0x3a3d5c[_0x8bac('0x95')],_0x3a3d5c[_0x8bac('0x96')],_0x3a3d5c['aws_polly_region'],_0x3a3d5c['aws_polly_voice']||_0x8bac('0x97'),_0x3a3d5c[_0x8bac('0x68')],_0x3a3d5c[_0x8bac('0x98')]||_0x8bac('0x68'))[_0x8bac('0x13')](function(_0x403d5b){_0x152e55(null,_0x403d5b);})[_0x8bac('0x15')](function(_0x2edb25){_0x152e55(_0x2edb25);});};AGIVertices[_0x8bac('0x11')][_0x8bac('0x99')]=function(_0xc46b86,_0x186172){scripts[_0x8bac('0x99')](this[_0x8bac('0xf')][_0x8bac('0x36')],_0xc46b86[_0x8bac('0x95')],_0xc46b86[_0x8bac('0x96')],_0xc46b86[_0x8bac('0x9a')],_0xc46b86[_0x8bac('0x68')],_0xc46b86['aws_bot_name'])[_0x8bac('0x13')](function(_0x5df9bf){_0x186172(null,_0x5df9bf);})[_0x8bac('0x15')](function(_0x4c1001){_0x186172(_0x4c1001);});};AGIVertices[_0x8bac('0x11')][_0x8bac('0x9b')]=function(_0x2adcfd,_0x51d8be,_0x86e6ad){scripts[_0x8bac('0x9b')](_0x51d8be,_0x2adcfd[_0x8bac('0x86')],_0x2adcfd[_0x8bac('0x9c')]||_0x8bac('0x6a'))[_0x8bac('0x13')](function(_0x2f8b50){_0x86e6ad(null,_0x2f8b50);})['catch'](function(_0x6531de){_0x86e6ad(_0x6531de);});};AGIVertices[_0x8bac('0x11')][_0x8bac('0x9d')]=function(_0x5696ce,_0x5a5c52,_0x184b2d){scripts[_0x8bac('0x9d')](_0x5a5c52,_0x5696ce[_0x8bac('0x9e')],_0x5696ce[_0x8bac('0x9f')],_0x5696ce[_0x8bac('0xa0')])['then'](function(_0x33fe8d){_0x184b2d(null,_0x33fe8d);})[_0x8bac('0x15')](function(_0x3ecd96){_0x184b2d(_0x3ecd96);});};AGIVertices[_0x8bac('0x11')][_0x8bac('0xa1')]=function(_0x16fbe5){var _0x19fb7c=_[_0x8bac('0x72')](verticesWithRetry,_0x16fbe5['agicommand'])?_0x16fbe5:_[_0x8bac('0xa2')](_0x16fbe5);for(var _0x31898a in _0x19fb7c){if(_0x19fb7c[_0x8bac('0xa3')](_0x31898a)){if(_0x19fb7c[_0x31898a]&&_[_0x8bac('0xa4')](_0x19fb7c[_0x31898a])){if(_[_0x8bac('0x72')](recursiveMapAttributes,_0x31898a)){_0x19fb7c[_0x31898a]=this[_0x8bac('0xa5')](_0x19fb7c[_0x31898a]);}else{_0x19fb7c[_0x31898a]=this['replaceAllVariables'](_0x19fb7c[_0x31898a]);}}}}return _0x19fb7c;};AGIVertices[_0x8bac('0x11')][_0x8bac('0xa6')]=function(_0x20582f){for(var _0x2683b3 in _0x20582f){if(_0x20582f[_0x8bac('0xa3')](_0x2683b3)){if(_[_0x8bac('0xa7')](_0x20582f[_0x2683b3])){this[_0x8bac('0xa6')](_0x20582f[_0x2683b3]);}else if(_[_0x8bac('0xa8')](_0x20582f[_0x2683b3])){for(var _0x51090d=0x0;_0x51090d<_0x20582f[_0x2683b3][_0x8bac('0xa9')];_0x51090d++){this['recursiveNodeIndex'](_0x20582f[_0x2683b3][_0x51090d]);}}else if(_['isString'](_0x20582f[_0x2683b3])){_0x20582f[_0x2683b3]=this[_0x8bac('0xaa')](_0x20582f[_0x2683b3]);}}}};AGIVertices[_0x8bac('0x11')][_0x8bac('0xab')]=function(_0xa35eca,_0x33804c){for(var _0x10682b in _0xa35eca){if(_0xa35eca['hasOwnProperty'](_0x10682b)){if(_[_0x8bac('0xa7')](_0xa35eca[_0x10682b])){if(!_[_0x8bac('0x44')](_0xa35eca[_0x10682b])){this['saveRestApiResult'](_0xa35eca[_0x10682b],util['format'](_0x8bac('0xac'),_0x33804c,_0x10682b));}}else if(_['isArray'](_0xa35eca[_0x10682b])){for(var _0x2891d2=0x0;_0x2891d2<_0xa35eca[_0x10682b]['length'];_0x2891d2++){this[_0x8bac('0xab')](_0xa35eca[_0x10682b][_0x2891d2],util[_0x8bac('0x28')]('%s.%s',_0x33804c,_0x10682b+'['+_0x2891d2+']'));}}else{if(!_[_0x8bac('0x45')](_0xa35eca[_0x10682b])){this[_0x8bac('0xf')][_0x8bac('0xad')](util[_0x8bac('0x28')](_0x8bac('0xac'),_0x33804c,_0x10682b),_0xa35eca[_0x10682b]);}}}}};AGIVertices[_0x8bac('0x11')]['replaceObjectAllVariables']=function(_0x1b795e){try{var _0x636b3c=JSON[_0x8bac('0x77')](_0x1b795e);this[_0x8bac('0xa6')](_0x636b3c);return JSON[_0x8bac('0x7c')](_0x636b3c);}catch(_0x1f1c29){return this[_0x8bac('0xaa')](_0x1b795e);}};AGIVertices[_0x8bac('0x11')][_0x8bac('0xaa')]=function(_0x57e190){var _0x3267d9=_0x57e190['split']('{');for(var _0x26ece1=0x1;_0x26ece1<_0x3267d9['length'];_0x26ece1+=0x1){var _0x503507=_0x3267d9[_0x26ece1][_0x8bac('0xae')]('}');if(_0x503507[_0x8bac('0xa9')]>0x1){_0x57e190=_0x57e190[_0x8bac('0xaf')]('{'+_0x503507[0x0]+'}',this['channel'][_0x8bac('0xb0')](_0x503507[0x0])[_0x8bac('0xb1')]||_0x503507[0x0]);}}if(_0x3267d9[_0x8bac('0xa9')]===0x1){return _0x57e190['toString']();}return this['replaceAllVariables'](_0x57e190);};AGIVertices[_0x8bac('0x11')][_0x8bac('0xb2')]=function(_0x29cd1a,_0x300fec){var _0x3323d8=this[_0x8bac('0xf')]['getVariable'](_0x29cd1a);if(_0x3323d8[_0x8bac('0xb3')]===-0x1){return _0x3323d8;}logger[_0x8bac('0x2d')](util[_0x8bac('0x28')](_0x8bac('0xb4'),_0x300fec,_0x3323d8['extra']));return this['channel']['setVariable'](_0x300fec,_0x3323d8[_0x8bac('0xb1')]);};AGIVertices['prototype'][_0x8bac('0x92')]=function(_0x5d8b07){return _0x5d8b07&&_0x5d8b07!=='0'&&_0x5d8b07!=='-1'&&_0x5d8b07!=='';};AGIVertices[_0x8bac('0x11')][_0x8bac('0xb5')]=function(_0xca4b5b){this[_0x8bac('0x35')][_0x8bac('0x7a')](this,_0xca4b5b,'-');_0xca4b5b[_0x8bac('0xb6')]=_0xca4b5b[_0x8bac('0xb5')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x8bac('0x11')][_0x8bac('0xb7')]=function(_0x185b8a){logger[_0x8bac('0x2d')](util[_0x8bac('0x28')](_0x8bac('0xb8'),_0x185b8a['label']));if(!this['isConfigured'](_0x185b8a['text'])){return this[_0x8bac('0xf')][_0x8bac('0xb9')](_0x8bac('0xba'));}var _0x139db8='\x22'+_0x185b8a['text']+'\x22';if(this[_0x8bac('0x92')](_0x185b8a[_0x8bac('0x84')])){_0x139db8+=','+_0x185b8a['options'];}var _0x362941=this[_0x8bac('0xf')][_0x8bac('0x62')](_0x8bac('0xbb'),_0x139db8);if(_0x362941[_0x8bac('0xb3')]===-0x1){return _0x362941;}return this[_0x8bac('0xf')][_0x8bac('0xb9')](util[_0x8bac('0x28')](_0x8bac('0xbc'),_0x139db8));};AGIVertices[_0x8bac('0x11')][_0x8bac('0xbd')]=function(_0x37d18c){logger[_0x8bac('0x2d')](util[_0x8bac('0x28')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x37d18c[_0x8bac('0x37')]));if(!this['isConfigured'](_0x37d18c[_0x8bac('0xbe')])){return this[_0x8bac('0xf')][_0x8bac('0xb9')](_0x8bac('0xbf'));}var _0x50646d=_0x37d18c[_0x8bac('0xbe')];if(this[_0x8bac('0x92')](_0x37d18c[_0x8bac('0x84')])){_0x50646d+=','+_0x37d18c[_0x8bac('0x84')];}var _0x484a11=this[_0x8bac('0xf')][_0x8bac('0x62')](_0x8bac('0xc0'),_0x50646d);if(_0x484a11[_0x8bac('0xb3')]===-0x1){return _0x484a11;}var _0x329955=this['getAndSetVariable'](_0x8bac('0xc1'),_0x8bac('0xc2'));if(_0x329955[_0x8bac('0xb3')]===-0x1){return _0x329955;}var _0x4f68d9=this[_0x8bac('0xb2')](_0x8bac('0xc3'),_0x8bac('0xc4'));if(_0x4f68d9[_0x8bac('0xb3')]===-0x1){return _0x4f68d9;}var _0x206baa=this[_0x8bac('0xb2')](_0x8bac('0xc5'),_0x8bac('0xc6'));if(_0x206baa['result']===-0x1){return _0x206baa;}return this[_0x8bac('0xf')]['noop'](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x50646d));};AGIVertices[_0x8bac('0x11')][_0x8bac('0xc7')]=function(_0x5b0390){logger['info'](util[_0x8bac('0x28')](_0x8bac('0xc8'),_0x5b0390[_0x8bac('0x37')]));return this['channel']['agi']([_0x5b0390[_0x8bac('0xc9')],_0x5b0390[_0x8bac('0xca')]]);};AGIVertices[_0x8bac('0x11')][_0x8bac('0xcb')]=function(_0x59f616){logger['info'](util[_0x8bac('0x28')](_0x8bac('0xcc'),_0x59f616['label']));if(this[_0x8bac('0x92')](_0x59f616[_0x8bac('0x71')])){logger[_0x8bac('0x2d')](util[_0x8bac('0x28')](_0x8bac('0xcd'),_0x59f616[_0x8bac('0x71')]));var _0x476031=this[_0x8bac('0xf')]['wait'](_0x59f616['timeout']);if(_0x476031['result']===-0x1){return _0x476031;}}return this['channel'][_0x8bac('0xcb')]();};AGIVertices[_0x8bac('0x11')][_0x8bac('0x4c')]=function(_0x3587cd){logger[_0x8bac('0x2d')](util[_0x8bac('0x28')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x3587cd[_0x8bac('0x37')]));if(!this[_0x8bac('0x92')](_0x3587cd[_0x8bac('0x4a')])){return this['channel'][_0x8bac('0x2b')](_0x3587cd,_0x8bac('0xce'));}_0x3587cd['scheduledAt']=moment();if(this[_0x8bac('0x92')](_0x3587cd[_0x8bac('0xcf')])){_0x3587cd['scheduledAt']=moment()['add'](_0x3587cd[_0x8bac('0xcf')],'minutes');}if(!this[_0x8bac('0x92')](_0x3587cd[_0x8bac('0xd0')])){_0x3587cd['callback_priority']=0x2;}this[_0x8bac('0x43')][_0x8bac('0x7a')](this,_0x3587cd);return this['channel'][_0x8bac('0xb9')](util[_0x8bac('0x28')](_0x8bac('0xd1'),_0x3587cd[_0x8bac('0x49')],_0x3587cd[_0x8bac('0x4a')],_0x3587cd['scheduledAt']));};AGIVertices[_0x8bac('0x11')][_0x8bac('0xd2')]=function(_0x374d5b){logger[_0x8bac('0x2d')](util[_0x8bac('0x28')](_0x8bac('0xd3'),_0x374d5b[_0x8bac('0x37')]));var _0x51a53f=this[_0x8bac('0xf')][_0x8bac('0x62')](_0x374d5b[_0x8bac('0xd4')],_0x374d5b[_0x8bac('0x84')]);if(_0x51a53f[_0x8bac('0xb3')]===-0x1){return _0x51a53f;}return this[_0x8bac('0xf')]['noop'](util['format'](_0x8bac('0xd5'),_0x374d5b[_0x8bac('0xd4')],_0x374d5b[_0x8bac('0x84')]));};AGIVertices[_0x8bac('0x11')][_0x8bac('0xd6')]=function(_0x57b316){logger['info'](util[_0x8bac('0x28')](_0x8bac('0xd7'),_0x57b316[_0x8bac('0x37')]));if(!this[_0x8bac('0x92')](_0x57b316['text'])){return this[_0x8bac('0xf')][_0x8bac('0xb9')](_0x8bac('0xba'));}var _0x37cfa9='\x22'+_0x57b316[_0x8bac('0x68')]+'\x22';if(this[_0x8bac('0x92')](_0x57b316[_0x8bac('0x84')])){_0x37cfa9+=','+_0x57b316[_0x8bac('0x84')];}var _0x5dbc4e=this['channel'][_0x8bac('0x62')](_0x8bac('0xbb'),_0x37cfa9);if(_0x5dbc4e['result']===-0x1){return _0x5dbc4e;}return this[_0x8bac('0xf')][_0x8bac('0xb9')](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x37cfa9));};AGIVertices[_0x8bac('0x11')][_0x8bac('0xd8')]=function(_0x235c8f){logger[_0x8bac('0x2d')](util[_0x8bac('0x28')](_0x8bac('0xd9'),_0x235c8f[_0x8bac('0x37')]));if(!this[_0x8bac('0x92')](_0x235c8f[_0x8bac('0x68')])){return this['channel'][_0x8bac('0xb9')](_0x8bac('0xba'));}var _0x8779fb='\x22'+_0x235c8f[_0x8bac('0x68')]+'\x22';if(this['isConfigured'](_0x235c8f[_0x8bac('0x84')])){_0x8779fb+=','+_0x235c8f[_0x8bac('0x84')];}var _0x585a02=this[_0x8bac('0xf')]['exec']('MRCPSynth',_0x8779fb);if(_0x585a02[_0x8bac('0xb3')]===-0x1){return _0x585a02;}return this['channel'][_0x8bac('0xb9')](util[_0x8bac('0x28')]('Executed\x20command\x20MRCPSynth\x20%s',_0x8779fb));};AGIVertices[_0x8bac('0x11')]['lumenvoxasr']=function(_0x572551){logger[_0x8bac('0x2d')](util[_0x8bac('0x28')](_0x8bac('0xda'),_0x572551[_0x8bac('0x37')]));if(!this['isConfigured'](_0x572551['grammar'])){return this['channel'][_0x8bac('0xb9')](_0x8bac('0xbf'));}var _0x1cc1ea=_0x572551[_0x8bac('0xbe')];if(this['isConfigured'](_0x572551[_0x8bac('0x84')])){_0x1cc1ea+=','+_0x572551[_0x8bac('0x84')];}var _0x392068=this[_0x8bac('0xf')][_0x8bac('0x62')](_0x8bac('0xc0'),_0x1cc1ea);if(_0x392068[_0x8bac('0xb3')]===-0x1){return _0x392068;}var _0x5392b4=this[_0x8bac('0xb2')](_0x8bac('0xc1'),'LUMENVOX_ASR_CONFIDENCE');if(_0x5392b4[_0x8bac('0xb3')]===-0x1){return _0x5392b4;}var _0x3c9ee3=this['getAndSetVariable'](_0x8bac('0xc3'),_0x8bac('0xdb'));if(_0x3c9ee3['result']===-0x1){return _0x3c9ee3;}var _0xbffa48=this[_0x8bac('0xb2')](_0x8bac('0xc5'),_0x8bac('0xdc'));if(_0xbffa48['result']===-0x1){return _0xbffa48;}return this[_0x8bac('0xf')][_0x8bac('0xb9')](util[_0x8bac('0x28')](_0x8bac('0xdd'),_0x1cc1ea));};AGIVertices[_0x8bac('0x11')][_0x8bac('0xde')]=function(_0x2c79f9){logger[_0x8bac('0x2d')](util[_0x8bac('0x28')](_0x8bac('0xdf'),_0x2c79f9['label']));if(!this['isConfigured'](_0x2c79f9[_0x8bac('0xbe')])){return this['channel']['noop'](_0x8bac('0xbf'));}var _0x21708c=_0x2c79f9[_0x8bac('0xbe')];if(this[_0x8bac('0x92')](_0x2c79f9[_0x8bac('0x84')])){_0x21708c+=','+_0x2c79f9[_0x8bac('0x84')];}var _0x11e454=this['channel'][_0x8bac('0x62')](_0x8bac('0xc0'),_0x21708c);if(_0x11e454[_0x8bac('0xb3')]===-0x1){return _0x11e454;}var _0x327dff=this[_0x8bac('0xb2')](_0x8bac('0xc1'),'SESTEK_ASR_CONFIDENCE');if(_0x327dff[_0x8bac('0xb3')]===-0x1){return _0x327dff;}var _0x577caa=this[_0x8bac('0xb2')](_0x8bac('0xc3'),_0x8bac('0xe0'));if(_0x577caa['result']===-0x1){return _0x577caa;}var _0x54df3d=this[_0x8bac('0xb2')]('RECOG_INSTANCE()',_0x8bac('0xe1'));if(_0x54df3d[_0x8bac('0xb3')]===-0x1){return _0x54df3d;}return this[_0x8bac('0xf')][_0x8bac('0xb9')](util[_0x8bac('0x28')](_0x8bac('0xdd'),_0x21708c));};AGIVertices[_0x8bac('0x11')]['database']=function(_0x1966f3){logger[_0x8bac('0x2d')](util[_0x8bac('0x28')](_0x8bac('0xe2'),_0x1966f3[_0x8bac('0x37')]));if(!this['isConfigured'](_0x1966f3[_0x8bac('0xe3')])){return this[_0x8bac('0xf')][_0x8bac('0x2b')](_0x1966f3,_0x8bac('0xe4'));}var _0x4f0756=this[_0x8bac('0x18')][_0x8bac('0x7a')](this,_0x1966f3['odbc_id']);if(!_0x4f0756){return this[_0x8bac('0xf')][_0x8bac('0x2b')](_0x1966f3,_0x8bac('0xe5'));}if(!this[_0x8bac('0x92')](_0x1966f3[_0x8bac('0x2f')])){return this[_0x8bac('0xf')]['error'](_0x1966f3,'no\x20query\x20configured');}var _0x310bfc=_0x1966f3[_0x8bac('0x2f')][_0x8bac('0x64')](/(\r\n|\n|\r)/gm,'\x20');this['channel']['noop'](util[_0x8bac('0x28')](_0x8bac('0xe6'),_0x310bfc));var _0x316069=this[_0x8bac('0xe7')][_0x8bac('0x7a')](this,_0x4f0756,_0x310bfc);this[_0x8bac('0x35')][_0x8bac('0x7a')](this,_0x1966f3,_0x310bfc);if(!this['isConfigured'](_0x1966f3[_0x8bac('0xe8')])){return this['channel'][_0x8bac('0xb9')](_0x8bac('0xe9'));}var _0xdcc6e6=this[_0x8bac('0xb0')][_0x8bac('0x7a')](this,_0x1966f3['variable_id']);if(!_0xdcc6e6){return this[_0x8bac('0xf')]['error'](_0x1966f3,_0x8bac('0xea'));}var _0x354149=this;_0x316069[_0x8bac('0xeb')](function(_0x50fbeb,_0x2739e4){Object[_0x8bac('0xec')](_0x50fbeb)[_0x8bac('0xeb')](function(_0x2ec526){_0x354149[_0x8bac('0xf')][_0x8bac('0xad')](util[_0x8bac('0x28')](_0x8bac('0xed'),_0xdcc6e6,_0x2739e4,_0x2ec526),_0x50fbeb[_0x2ec526]);});});this['channel'][_0x8bac('0xad')](util[_0x8bac('0x28')]('%s_ROWS_COUNT',_0xdcc6e6),_0x316069['length']);return this['channel'][_0x8bac('0xb9')](util['format'](_0x8bac('0xee'),_0xdcc6e6));};AGIVertices[_0x8bac('0x11')][_0x8bac('0xef')]=function(_0x117510){logger[_0x8bac('0xf0')](util['format']('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x117510[_0x8bac('0x37')]));if(!this[_0x8bac('0x92')](_0x117510[_0x8bac('0xf1')])){return this[_0x8bac('0xf')][_0x8bac('0x2b')](_0x117510,_0x8bac('0xf2'));}var _0x393074=this[_0x8bac('0x1b')][_0x8bac('0x7a')](this,_0x117510['sip_id']);if(!_0x393074){return this[_0x8bac('0xf')][_0x8bac('0x2b')](_0x117510,'no\x20user\x20found');}var _0x4a8c66=this[_0x8bac('0xf')]['exec'](_0x8bac('0xf3'),[util[_0x8bac('0x28')](_0x8bac('0xf4'),_0x393074),_0x117510[_0x8bac('0x71')],_0x117510['opts'],_0x117510[_0x8bac('0x7b')]]);if(_0x4a8c66['result']===-0x1){return _0x4a8c66;}return this[_0x8bac('0xf')][_0x8bac('0xb9')](util[_0x8bac('0x28')](_0x8bac('0xf5'),_0x8bac('0xf3')));};AGIVertices[_0x8bac('0x11')]['dialogflow']=function(_0x14d3e9){logger[_0x8bac('0x2d')](util[_0x8bac('0x28')](_0x8bac('0xf6'),_0x14d3e9[_0x8bac('0x37')]));if(!this[_0x8bac('0x92')](_0x14d3e9[_0x8bac('0x86')])){return this['channel'][_0x8bac('0xb9')](_0x8bac('0xf7'));}if(!this[_0x8bac('0x92')](_0x14d3e9[_0x8bac('0x68')])){return this[_0x8bac('0xf')]['noop'](_0x8bac('0xba'));}this['channel'][_0x8bac('0xf8')]=!![];this['createSquareDetailsReport'](_0x14d3e9);this[_0x8bac('0x42')](_0x14d3e9[_0x8bac('0x68')],'in','','');this[_0x8bac('0xf')]['noop'](util[_0x8bac('0x28')](_0x8bac('0xf9'),_0x14d3e9[_0x8bac('0x68')]));var _0x4aa1dc=this[_0x8bac('0x85')][_0x8bac('0x7a')](this,_0x14d3e9);if(_0x4aa1dc){for(var _0x427d38 in _0x4aa1dc){if(_0x4aa1dc[_0x8bac('0xa3')](_0x427d38)){this[_0x8bac('0xf')][_0x8bac('0xad')](util[_0x8bac('0x28')](_0x8bac('0xfa'),_0x427d38[_0x8bac('0x74')]()),_0x4aa1dc[_0x427d38]);}}this[_0x8bac('0x42')](_0x4aa1dc[_0x8bac('0xfb')],'out',_0x8bac('0xfc'),'');return this[_0x8bac('0xf')]['noop'](util[_0x8bac('0x28')](_0x8bac('0xfd'),_0x4aa1dc[_0x8bac('0xfb')]));}return this[_0x8bac('0xf')][_0x8bac('0x2b')](_0x14d3e9,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x8bac('0x11')][_0x8bac('0xfe')]=function(_0x4bf5ce){logger[_0x8bac('0x2d')](util[_0x8bac('0x28')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x4bf5ce['label']));if(!this[_0x8bac('0x92')](_0x4bf5ce[_0x8bac('0xff')])){return this[_0x8bac('0xf')]['noop'](_0x8bac('0x100'));}if(!this[_0x8bac('0x92')](_0x4bf5ce[_0x8bac('0x89')])){return this['channel'][_0x8bac('0xb9')](_0x8bac('0x101'));}if(!this[_0x8bac('0x92')](_0x4bf5ce[_0x8bac('0x8a')])){return this[_0x8bac('0xf')][_0x8bac('0xb9')](_0x8bac('0x102'));}if(!this[_0x8bac('0x92')](_0x4bf5ce[_0x8bac('0x8b')])){return this['channel'][_0x8bac('0xb9')]('no\x20anguage\x20configured');}if(!this[_0x8bac('0x92')](_0x4bf5ce[_0x8bac('0x68')])){return this[_0x8bac('0xf')]['noop']('no\x20text\x20configured');}this['channel']['bot']=!![];this[_0x8bac('0x35')](_0x4bf5ce);this[_0x8bac('0x42')](_0x4bf5ce[_0x8bac('0x68')],'in','','');this['channel'][_0x8bac('0xb9')](util[_0x8bac('0x28')]('Trying\x20DialogflowV2:\x20%s',_0x4bf5ce[_0x8bac('0x68')]));var _0xf86b86=this[_0x8bac('0x88')]['sync'](this,_0x4bf5ce);if(_0xf86b86){for(var _0x2aed73 in _0xf86b86){if(_0xf86b86['hasOwnProperty'](_0x2aed73)){if(_0x2aed73!=='providerResponse'){this[_0x8bac('0xf')][_0x8bac('0xad')](util['format'](_0x8bac('0xfa'),_0x2aed73[_0x8bac('0x74')]()),_0xf86b86[_0x2aed73]);}}}this[_0x8bac('0x42')](_0xf86b86[_0x8bac('0xfb')],_0x8bac('0x103'),_0x8bac('0xfe'),_0xf86b86['providerResponse']);return this['channel'][_0x8bac('0xb9')](util['format'](_0x8bac('0x104'),_0xf86b86[_0x8bac('0xfb')]));}return this[_0x8bac('0xf')][_0x8bac('0x2b')](_0x4bf5ce,_0x8bac('0x105'));};AGIVertices[_0x8bac('0x11')][_0x8bac('0x106')]=function(_0x527c61){logger[_0x8bac('0x2d')](util[_0x8bac('0x28')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x527c61[_0x8bac('0x37')]));if(!this[_0x8bac('0x92')](_0x527c61[_0x8bac('0x107')])){return this[_0x8bac('0xf')][_0x8bac('0xb9')]('no\x20ndauth\x20url\x20configured');}if(!this['isConfigured'](_0x527c61['username'])){return this['channel']['noop'](_0x8bac('0x108'));}if(!this['isConfigured'](_0x527c61[_0x8bac('0x109')])){return this['channel']['noop']('no\x20password\x20configured');}if(!this[_0x8bac('0x92')](_0x527c61[_0x8bac('0x10a')])){return this[_0x8bac('0xf')][_0x8bac('0xb9')]('no\x20text\x20configured');}this[_0x8bac('0xf')][_0x8bac('0xf8')]=!![];this['createSquareDetailsReport'](_0x527c61);this[_0x8bac('0x42')](_0x527c61[_0x8bac('0x68')],'in','','');this['channel'][_0x8bac('0xb9')](util['format']('Trying\x20SestekNDA:\x20%s',_0x527c61[_0x8bac('0x68')]));var _0x928953=this[_0x8bac('0x8c')][_0x8bac('0x7a')](this,_0x527c61);if(_0x928953){for(var _0x15f6a1 in _0x928953){if(_0x928953[_0x8bac('0xa3')](_0x15f6a1)){this[_0x8bac('0xf')][_0x8bac('0xad')](util[_0x8bac('0x28')](_0x8bac('0x10b'),_0x15f6a1[_0x8bac('0x74')]()),_0x928953[_0x15f6a1]);}}this['createSquareMessage'](_0x928953[_0x8bac('0xfb')],_0x8bac('0x103'),_0x8bac('0x106'),'');if(_0x928953[_0x8bac('0x10c')]){this[_0x8bac('0xf')][_0x8bac('0xb9')](util[_0x8bac('0x28')](_0x8bac('0x10d'),_0x928953[_0x8bac('0x10c')]));var _0xa0ee2c=this[_0x8bac('0xf')][_0x8bac('0x10e')](_0x928953[_0x8bac('0x10c')]);try{fs[_0x8bac('0x10f')](_0x928953[_0x8bac('0x10c')]+_0x8bac('0x110'));}catch(_0x8ca53b){logger[_0x8bac('0x2b')](_0x8ca53b);}return _0xa0ee2c;}else{return this['channel'][_0x8bac('0xb9')](util[_0x8bac('0x28')](_0x8bac('0x111'),_0x928953[_0x8bac('0xfb')]));}}return this[_0x8bac('0xf')][_0x8bac('0x2b')](_0x527c61,'SestekNDA\x20is\x20unreachable');};AGIVertices['prototype'][_0x8bac('0x112')]=function(_0x2eb766){logger['info'](util[_0x8bac('0x28')]('Enter\x20in\x20END\x20(%s)\x20block',_0x2eb766[_0x8bac('0x37')]));return this[_0x8bac('0xf')]['noop'](_0x8bac('0x112'));};AGIVertices['prototype'][_0x8bac('0x113')]=function(_0x310db1){logger['info'](util['format']('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x310db1[_0x8bac('0x37')]));var _0x69a008='';if(_0x310db1[_0x8bac('0x114')]){if(!this[_0x8bac('0x92')](_0x310db1['trunk_id'])){return this[_0x8bac('0xf')]['error'](_0x310db1,_0x8bac('0x115'));}else{var _0x3346a1=parseInt(_0x310db1['trunk_id'],0xa);if(isNaN(_0x3346a1)){_0x69a008=_0x310db1[_0x8bac('0x114')];}else{_0x69a008=this['getTrunk']['sync'](this,_0x310db1[_0x8bac('0x114')]);if(!_0x69a008){return this['channel'][_0x8bac('0x2b')](_0x310db1,'no\x20trunk\x20found');}}}}else if(_0x310db1['trunk_name']){_0x69a008=_0x310db1[_0x8bac('0x116')];}else{return this[_0x8bac('0xf')][_0x8bac('0x2b')](_0x310db1,_0x8bac('0x115'));}var _0x47c43c=this['channel']['exec'](_0x8bac('0xf3'),[util[_0x8bac('0x28')](_0x8bac('0x117'),_0x69a008,_0x310db1[_0x8bac('0x49')]),_0x310db1[_0x8bac('0x71')],_0x310db1[_0x8bac('0x118')],_0x310db1[_0x8bac('0x7b')]]);if(_0x47c43c[_0x8bac('0xb3')]===-0x1){return _0x47c43c;}return this[_0x8bac('0xf')][_0x8bac('0xb9')](util[_0x8bac('0x28')]('Executed\x20command\x20%s',_0x8bac('0xf3')));};AGIVertices[_0x8bac('0x11')][_0x8bac('0x119')]=function(_0x185a96){logger['info'](util[_0x8bac('0x28')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x185a96[_0x8bac('0x37')]));return this['channel']['noop'](_0x8bac('0x119'));};AGIVertices['prototype'][_0x8bac('0xd')]=function(_0x3aec5d){logger['info'](util[_0x8bac('0x28')](_0x8bac('0x11a'),_0x3aec5d[_0x8bac('0x37')]));if(_0x3aec5d[_0x8bac('0xb6')]===0x0){return this[_0x8bac('0xb5')](_0x3aec5d);}_0x3aec5d[_0x8bac('0xb6')]-=0x1;if(!this[_0x8bac('0x92')](_0x3aec5d['file_id'])){return this[_0x8bac('0xf')][_0x8bac('0x2b')](_0x3aec5d,_0x8bac('0x11b'));}var _0x4083bd=this[_0x8bac('0x1e')][_0x8bac('0x7a')](this,_0x3aec5d['file_id']);if(!_0x4083bd){return this[_0x8bac('0xf')][_0x8bac('0x2b')](_0x3aec5d,_0x8bac('0x11c'));}if(!this[_0x8bac('0x92')](_0x3aec5d[_0x8bac('0xe8')])){return this[_0x8bac('0xf')][_0x8bac('0x2b')](_0x8bac('0xe9'));}var _0x1ac591=this[_0x8bac('0xf')][_0x8bac('0x11d')](_0x4083bd,_0x3aec5d[_0x8bac('0x11e')],_0x3aec5d[_0x8bac('0x11f')]);var _0x67b11c=_0x1ac591['result']?_0x1ac591['result']['toString']():'';logger['info'](_0x8bac('0x120'),JSON[_0x8bac('0x7c')](_0x1ac591));if(_0x1ac591['result']===-0x1){this['createSquareDetailsReport']['sync'](this,_0x3aec5d,_0x67b11c);return _0x1ac591;}else if(_0x1ac591[_0x8bac('0xb1')]==='timeout'){_0x1ac591[_0x8bac('0xb3')]=_0x67b11c[_0x8bac('0xa9')]>=parseInt(_0x3aec5d['mindigit'])?'x':'i';}else{_0x1ac591[_0x8bac('0xb3')]=_0x67b11c[_0x8bac('0xa9')]>=parseInt(_0x3aec5d['mindigit'])&&_0x67b11c[_0x8bac('0xa9')]<=parseInt(_0x3aec5d['maxdigit'])?'x':'i';}var _0x50904d=this[_0x8bac('0xb0')][_0x8bac('0x7a')](this,_0x3aec5d[_0x8bac('0xe8')]);if(!_0x50904d){return this[_0x8bac('0xf')]['error'](_0x3aec5d,'no\x20variable\x20found');}this[_0x8bac('0xf')]['setVariable'](_0x50904d,_0x67b11c);if(this[_0x8bac('0x92')](_0x3aec5d[_0x8bac('0x121')])){var _0x5bec31=parseInt(_0x3aec5d[_0x8bac('0x121')],0xa);var _0x170372=rs[_0x8bac('0x122')]({'charset':'*','length':_0x5bec31});var _0x232872=_0x67b11c[_0x8bac('0xa9')];if(_0x232872>0x0){if(_0x232872>_0x5bec31){this[_0x8bac('0x35')][_0x8bac('0x7a')](this,_0x3aec5d,_0x3aec5d['hiddendigitspos']===_0x8bac('0x123')?_0x170372+_0x67b11c[_0x8bac('0x124')](_0x5bec31):_0x67b11c[_0x8bac('0x124')](0x0,_0x232872-_0x5bec31)+_0x170372);}else{this[_0x8bac('0x35')][_0x8bac('0x7a')](this,_0x3aec5d,rs['generate']({'charset':'*','length':_0x232872}));}}else{this[_0x8bac('0x35')][_0x8bac('0x7a')](this,_0x3aec5d,'');}}else{this[_0x8bac('0x35')]['sync'](this,_0x3aec5d,_0x67b11c);}return _0x1ac591;};AGIVertices[_0x8bac('0x11')][_0x8bac('0xe')]=function(_0x3d4fa6){logger[_0x8bac('0x2d')](util[_0x8bac('0x28')](_0x8bac('0x125'),_0x3d4fa6[_0x8bac('0x37')]));return this['getdigits'](_0x3d4fa6);};AGIVertices[_0x8bac('0x11')][_0x8bac('0x126')]=function(_0x24a04b){logger[_0x8bac('0x2d')](util[_0x8bac('0x28')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x24a04b['label']));this['createSquareDetailsReport'][_0x8bac('0x7a')](this,_0x24a04b,_0x24a04b[_0x8bac('0x127')]);return this[_0x8bac('0xf')][_0x8bac('0xb9')](util[_0x8bac('0x28')]('GOAL\x20%s',_0x24a04b['goalname']));};AGIVertices[_0x8bac('0x11')][_0x8bac('0x128')]=function(_0x3b332b){logger[_0x8bac('0x2d')](util[_0x8bac('0x28')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x3b332b[_0x8bac('0x37')]));if(!this[_0x8bac('0x92')](_0x3b332b['aws_access_key_id'])||!this['isConfigured'](_0x3b332b[_0x8bac('0x96')])){return this['channel'][_0x8bac('0xb9')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x8bac('0x92')](_0x3b332b[_0x8bac('0x68')])){return this[_0x8bac('0xf')][_0x8bac('0xb9')]('no\x20text\x20configured');}this[_0x8bac('0xf')][_0x8bac('0xb9')](util[_0x8bac('0x28')]('Trying\x20aws\x20Polly\x20%s',_0x3b332b[_0x8bac('0x68')]));var _0x46a24f=this[_0x8bac('0x94')][_0x8bac('0x7a')](this,_0x3b332b);if(_0x46a24f){this[_0x8bac('0xf')]['noop'](util[_0x8bac('0x28')](_0x8bac('0x129'),_0x46a24f));var _0x4b9a1f=this[_0x8bac('0xf')][_0x8bac('0x10e')](_0x46a24f);try{fs[_0x8bac('0x10f')](_0x46a24f+'.wav');}catch(_0x259ff0){logger['error'](_0x259ff0);}return _0x4b9a1f;}return this[_0x8bac('0xf')]['error'](_0x3b332b,_0x8bac('0x12a'));};AGIVertices[_0x8bac('0x11')]['awslex']=function(_0x1951e5){logger['info'](util['format']('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x1951e5[_0x8bac('0x37')]));if(!this[_0x8bac('0x92')](_0x1951e5[_0x8bac('0x95')])||!this[_0x8bac('0x92')](_0x1951e5[_0x8bac('0x96')])){return this[_0x8bac('0xf')][_0x8bac('0xb9')](_0x8bac('0x12b'));}if(!this[_0x8bac('0x92')](_0x1951e5['aws_bot_name'])){return this[_0x8bac('0xf')]['noop'](_0x8bac('0x12c'));}if(!this[_0x8bac('0x92')](_0x1951e5['text'])){return this[_0x8bac('0xf')][_0x8bac('0xb9')]('no\x20text\x20configured');}this[_0x8bac('0xf')][_0x8bac('0xf8')]=!![];this[_0x8bac('0x35')](_0x1951e5);this[_0x8bac('0x42')](_0x1951e5[_0x8bac('0x68')],'in','','');this[_0x8bac('0xf')][_0x8bac('0xb9')](util['format'](_0x8bac('0x12d'),_0x1951e5[_0x8bac('0x68')]));var _0x313a44=this['awsLex'][_0x8bac('0x7a')](this,_0x1951e5);if(_0x313a44){for(var _0x101a47 in _0x313a44){if(_0x313a44[_0x8bac('0xa3')](_0x101a47)&&_[_0x8bac('0xa4')](_0x313a44[_0x101a47])){this[_0x8bac('0xf')][_0x8bac('0xad')](util[_0x8bac('0x28')]('AWS_LEX_%s',_0x101a47[_0x8bac('0x74')]()),_0x313a44[_0x101a47]);}}if(_[_0x8bac('0x45')](_0x313a44['message'])){return this['channel'][_0x8bac('0xb9')](_0x8bac('0x12e'));}else{this[_0x8bac('0x42')](_0x313a44['message'],_0x8bac('0x103'),_0x8bac('0x12f'),'');return this['channel'][_0x8bac('0xb9')](util['format'](_0x8bac('0x130'),_0x313a44[_0x8bac('0x82')]));}}return this[_0x8bac('0xf')][_0x8bac('0x2b')](_0x1951e5,_0x8bac('0x131'));};AGIVertices[_0x8bac('0x11')][_0x8bac('0x132')]=function(_0x1d8a7c){logger[_0x8bac('0x2d')](util[_0x8bac('0x28')](_0x8bac('0x133'),_0x1d8a7c[_0x8bac('0x37')],_0x1d8a7c[_0x8bac('0x71')]));if(!this[_0x8bac('0x92')](_0x1d8a7c[_0x8bac('0x86')])){return this[_0x8bac('0xf')][_0x8bac('0xb9')]('no\x20key\x20configured');}var _0x38a698=_0x8bac('0x134');var _0x3a168c=util[_0x8bac('0x28')](_0x8bac('0x135'),FILES_PATH,rs[_0x8bac('0x122')](0x4));var _0x498ea4=util[_0x8bac('0x28')](_0x8bac('0xac'),_0x3a168c,_0x38a698);var _0x2e5606=!![];if(_0x1d8a7c[_0x8bac('0x136')]===_0x8bac('0x137')){_0x2e5606=![];}var _0x349e29=this[_0x8bac('0xf')][_0x8bac('0x138')](_0x3a168c,_0x38a698,_0x1d8a7c['intKey'],_0x1d8a7c['timeout'],undefined,_0x2e5606);if(_0x349e29['result']!==-0x1){this[_0x8bac('0xf')]['noop'](util[_0x8bac('0x28')](_0x8bac('0x139'),_0x498ea4));var _0xc99cfa=this[_0x8bac('0x9b')][_0x8bac('0x7a')](this,_0x1d8a7c,_0x498ea4);if(_0xc99cfa){for(var _0x18625e in _0xc99cfa){if(_0xc99cfa[_0x8bac('0xa3')](_0x18625e)){this[_0x8bac('0xf')][_0x8bac('0xad')](util[_0x8bac('0x28')]('GOOGLE_ASR_%s',_0x18625e['toUpperCase']()),_0xc99cfa[_0x18625e]);}}return this[_0x8bac('0xf')][_0x8bac('0xb9')](util[_0x8bac('0x28')]('GoogleASR\x20Result\x20%s',JSON[_0x8bac('0x7c')](_0xc99cfa)));}}return _0x349e29;};AGIVertices['prototype']['tildeasr']=function(_0x19bceb){logger['info'](util[_0x8bac('0x28')](_0x8bac('0x13a'),_0x19bceb[_0x8bac('0x37')]));if(!this[_0x8bac('0x92')](_0x19bceb[_0x8bac('0x9e')])){return this[_0x8bac('0xf')][_0x8bac('0xb9')](_0x8bac('0x13b'));}if(!this['isConfigured'](_0x19bceb[_0x8bac('0x9f')])){return this[_0x8bac('0xf')][_0x8bac('0xb9')](_0x8bac('0x13c'));}var _0x5cf6fd='wav';var _0x5e7017=util['format'](_0x8bac('0x135'),FILES_PATH,rs[_0x8bac('0x122')](0x4));var _0x57a0c5=util[_0x8bac('0x28')](_0x8bac('0xac'),_0x5e7017,_0x5cf6fd);var _0x1aacc9=!![];if(_0x19bceb[_0x8bac('0x136')]===_0x8bac('0x137')){_0x1aacc9=![];}var _0x32fb31=this[_0x8bac('0xf')][_0x8bac('0x138')](_0x5e7017,_0x5cf6fd,_0x19bceb[_0x8bac('0x13d')],_0x19bceb[_0x8bac('0x71')],undefined,_0x1aacc9);if(_0x32fb31[_0x8bac('0xb3')]!==-0x1){this[_0x8bac('0xf')][_0x8bac('0xb9')](util[_0x8bac('0x28')](_0x8bac('0x13e'),_0x57a0c5));var _0x5effcf=this[_0x8bac('0x9d')][_0x8bac('0x7a')](this,_0x19bceb,_0x57a0c5);if(_0x5effcf){for(var _0x45feaf in _0x5effcf){if(_0x5effcf[_0x8bac('0xa3')](_0x45feaf)){this['channel'][_0x8bac('0xad')](util['format'](_0x8bac('0x13f'),_0x45feaf[_0x8bac('0x74')]()),_0x5effcf[_0x45feaf]);}}return this[_0x8bac('0xf')]['noop'](util[_0x8bac('0x28')]('TildeASR\x20Result\x20%s',JSON[_0x8bac('0x7c')](_0x5effcf)));}}return _0x32fb31;};AGIVertices[_0x8bac('0x11')][_0x8bac('0x140')]=function(_0x22c700){logger['info'](util[_0x8bac('0x28')](_0x8bac('0x141'),_0x22c700[_0x8bac('0x37')]));return this[_0x8bac('0xf')][_0x8bac('0x142')](_0x22c700[_0x8bac('0x3c')],_0x22c700[_0x8bac('0x3d')],_0x22c700[_0x8bac('0x143')]);};AGIVertices[_0x8bac('0x11')][_0x8bac('0x144')]=function(_0x3be14b){logger['info'](util[_0x8bac('0x28')](_0x8bac('0x145'),_0x3be14b['label']));if(!this[_0x8bac('0x92')](_0x3be14b[_0x8bac('0x146')])){return this[_0x8bac('0xf')][_0x8bac('0x2b')](_0x3be14b,_0x8bac('0x147'));}try{var _0x48328e=eval(_0x3be14b[_0x8bac('0x146')])?_0x8bac('0x148'):_0x8bac('0x149');this[_0x8bac('0xf')]['noop'](util[_0x8bac('0x28')](_0x8bac('0x14a'),_0x3be14b[_0x8bac('0x146')],_0x48328e));return{'code':0xc8,'result':_0x48328e};}catch(_0x5de13b){return{'code':0xc8,'result':'false'};}};AGIVertices['prototype'][_0x8bac('0x14b')]=function(_0x4e15b6){logger[_0x8bac('0x2d')](util[_0x8bac('0x28')](_0x8bac('0x14c'),_0x4e15b6[_0x8bac('0x37')]));if(!this['isConfigured'](_0x4e15b6[_0x8bac('0x14d')])){return this[_0x8bac('0xf')][_0x8bac('0x2b')](_0x4e15b6,_0x8bac('0x14e'));}var _0x12974b=this['getIntervals'][_0x8bac('0x7a')](this,_0x4e15b6['interval_id']);if(!_0x12974b){return this[_0x8bac('0xf')]['error'](_0x4e15b6,_0x8bac('0x14f'));}for(var _0x2a8331=0x0;_0x2a8331<_0x12974b[_0x8bac('0xa9')];_0x2a8331+=0x1){var _0x567401=this['channel']['getVariable'](util[_0x8bac('0x28')](_0x8bac('0x150'),_0x12974b[_0x2a8331]));if(_0x567401[_0x8bac('0xb3')]===-0x1){return _0x567401;}logger['info'](util[_0x8bac('0x28')]('IFTIME\x20%s\x20%s',_0x12974b[_0x2a8331],_0x567401[_0x8bac('0xb1')]));if(_0x567401[_0x8bac('0xb1')]===_0x8bac('0x148')){logger[_0x8bac('0x2d')](util[_0x8bac('0x28')]('IFTIME\x20%s\x20%s',_0x12974b[_0x2a8331],_0x8bac('0x148')));this[_0x8bac('0xf')][_0x8bac('0xb9')](util['format'](_0x8bac('0x151'),_0x12974b[_0x2a8331],_0x8bac('0x148')));return{'code':0xc8,'result':_0x8bac('0x148')};}else{logger['info'](util[_0x8bac('0x28')](_0x8bac('0x151'),_0x12974b[_0x2a8331],_0x8bac('0x149')));this['channel'][_0x8bac('0xb9')](util[_0x8bac('0x28')](_0x8bac('0x151'),_0x12974b[_0x2a8331],_0x8bac('0x149')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x8bac('0x11')][_0x8bac('0x152')]=function(_0x3f66cf){logger[_0x8bac('0x2d')](util[_0x8bac('0x28')](_0x8bac('0x153'),_0x3f66cf[_0x8bac('0x37')]));return this[_0x8bac('0xf')][_0x8bac('0x152')]();};AGIVertices[_0x8bac('0x11')][_0x8bac('0x154')]=function(_0x5a422b){logger['info'](util['format']('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x5a422b[_0x8bac('0x37')]));if(!this['isConfigured'](_0x5a422b[_0x8bac('0x86')])){return this[_0x8bac('0xf')][_0x8bac('0xb9')](_0x8bac('0xf7'));}var _0x296cad=_0x8bac('0x134');var _0xef4707=util[_0x8bac('0x28')](_0x8bac('0x135'),FILES_PATH,rs['generate'](0x4));var _0xf0d09f=util[_0x8bac('0x28')](_0x8bac('0xac'),_0xef4707,_0x296cad);var _0xac4843=!![];if(_0x5a422b[_0x8bac('0x136')]===_0x8bac('0x137')){_0xac4843=![];}var _0x35e933=this[_0x8bac('0xf')]['recordFile'](_0xef4707,_0x296cad,_0x5a422b[_0x8bac('0x13d')],_0x5a422b[_0x8bac('0x71')],undefined,_0xac4843);if(_0x35e933[_0x8bac('0xb3')]!==-0x1){this[_0x8bac('0xf')][_0x8bac('0xb9')](util['format'](_0x8bac('0x155'),_0xf0d09f));var _0x1d7edc=this[_0x8bac('0x90')]['sync'](this,_0x5a422b,_0xf0d09f);if(_0x1d7edc){for(var _0x5cc012 in _0x1d7edc){if(_0x1d7edc['hasOwnProperty'](_0x5cc012)){this['channel'][_0x8bac('0xad')](util['format'](_0x8bac('0x156'),_0x5cc012['toUpperCase']()),_0x1d7edc[_0x5cc012]);}}return this[_0x8bac('0xf')][_0x8bac('0xb9')](util[_0x8bac('0x28')](_0x8bac('0x157'),JSON[_0x8bac('0x7c')](_0x1d7edc)));}}return _0x35e933;};AGIVertices[_0x8bac('0x11')][_0x8bac('0x158')]=function(_0x54cca9){logger[_0x8bac('0x2d')](util[_0x8bac('0x28')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x54cca9['label']));if(!this['isConfigured'](_0x54cca9['key'])){return this[_0x8bac('0xf')]['noop']('no\x20key\x20configured');}if(!this[_0x8bac('0x92')](_0x54cca9[_0x8bac('0x68')])){return this[_0x8bac('0xf')]['noop'](_0x8bac('0xba'));}this[_0x8bac('0xf')][_0x8bac('0xb9')](util[_0x8bac('0x28')](_0x8bac('0x159'),_0x54cca9[_0x8bac('0x68')]));var _0x402b41=this[_0x8bac('0x8d')]['sync'](this,_0x54cca9);if(_0x402b41){this[_0x8bac('0xf')][_0x8bac('0xb9')](util[_0x8bac('0x28')](_0x8bac('0x155'),_0x402b41));var _0x73f4cd=this['channel'][_0x8bac('0x10e')](_0x402b41,_0x54cca9[_0x8bac('0x13d')]);try{fs[_0x8bac('0x10f')](_0x402b41+'.wav');}catch(_0x412107){logger[_0x8bac('0x2b')](_0x412107);}return _0x73f4cd;}return this[_0x8bac('0xf')][_0x8bac('0x2b')](_0x54cca9,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x8bac('0x11')]['login']=function(_0x5ae571){logger[_0x8bac('0x2d')](util['format'](_0x8bac('0x15a'),_0x5ae571[_0x8bac('0x37')]));if(!this[_0x8bac('0x92')](_0x5ae571['findBy'])){return this[_0x8bac('0xf')]['error'](_0x5ae571,'no\x20find\x20by\x20configured');}logger[_0x8bac('0x2d')](util[_0x8bac('0x28')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x8bac('0xf')][_0x8bac('0x39')],_0x5ae571['findBy']));var _0x143e2e=this[_0x8bac('0x5d')][_0x8bac('0x7a')](this,_0x5ae571[_0x8bac('0x15b')]);if(_0x143e2e){logger[_0x8bac('0x2d')](util[_0x8bac('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x8bac('0x39')],_0x5ae571[_0x8bac('0x15b')]));this['channel'][_0x8bac('0xb9')](util['format'](_0x8bac('0x15c'),this[_0x8bac('0xf')][_0x8bac('0x39')],_0x5ae571[_0x8bac('0x15b')]));return{'code':0xc8,'result':_0x8bac('0x15d')};}else{logger['info'](util[_0x8bac('0x28')](_0x8bac('0x15e'),this['channel'][_0x8bac('0x39')],_0x5ae571[_0x8bac('0x15b')]));this[_0x8bac('0xf')][_0x8bac('0xb9')](util[_0x8bac('0x28')](_0x8bac('0x15e'),this['channel']['callerid'],_0x5ae571[_0x8bac('0x15b')]));return{'code':0xc8,'result':_0x8bac('0x15f')};}};AGIVertices[_0x8bac('0x11')][_0x8bac('0x160')]=function(_0xa8b039){logger['info'](util[_0x8bac('0x28')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0xa8b039[_0x8bac('0x37')]));if(!this['isConfigured'](_0xa8b039[_0x8bac('0x15b')])){return this[_0x8bac('0xf')][_0x8bac('0x2b')](_0xa8b039,_0x8bac('0x161'));}logger['info'](util[_0x8bac('0x28')](_0x8bac('0x162'),this[_0x8bac('0xf')][_0x8bac('0x39')],_0xa8b039[_0x8bac('0x15b')]));var _0x5514b0=this['agentLogout'][_0x8bac('0x7a')](this,_0xa8b039['findBy']);if(_0x5514b0){logger[_0x8bac('0x2d')](util[_0x8bac('0x28')](_0x8bac('0x15c'),this[_0x8bac('0xf')][_0x8bac('0x39')],_0xa8b039[_0x8bac('0x15b')]));this['channel']['noop'](util['format'](_0x8bac('0x15c'),this['channel'][_0x8bac('0x39')],_0xa8b039['findBy']));return{'code':0xc8,'result':_0x8bac('0x15d')};}else{logger[_0x8bac('0x2d')](util[_0x8bac('0x28')](_0x8bac('0x15e'),this[_0x8bac('0xf')]['callerid'],_0xa8b039[_0x8bac('0x15b')]));this['channel'][_0x8bac('0xb9')](util['format'](_0x8bac('0x15e'),this[_0x8bac('0xf')][_0x8bac('0x39')],_0xa8b039[_0x8bac('0x15b')]));return{'code':0xc8,'result':_0x8bac('0x15f')};}};AGIVertices[_0x8bac('0x11')][_0x8bac('0x163')]=function(_0x3b3bee){logger[_0x8bac('0x2d')](util[_0x8bac('0x28')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x3b3bee['label']));if(!this[_0x8bac('0x92')](_0x3b3bee[_0x8bac('0x164')])){return this[_0x8bac('0xf')][_0x8bac('0x2b')](_0x3b3bee,_0x8bac('0x165'));}this[_0x8bac('0xf')]['noop'](util['format']('math\x20%s',_0x3b3bee['operation']));var _0x2d40e9=eval(_0x3b3bee[_0x8bac('0x164')]);if(!this[_0x8bac('0x92')](_0x3b3bee[_0x8bac('0xe8')])){return this[_0x8bac('0xf')][_0x8bac('0xb9')](_0x8bac('0xe9'));}var _0xb1c99e=this[_0x8bac('0xb0')][_0x8bac('0x7a')](this,_0x3b3bee[_0x8bac('0xe8')]);if(!_0xb1c99e){return this[_0x8bac('0xf')][_0x8bac('0x2b')](_0x3b3bee,_0x8bac('0xea'));}if(_[_0x8bac('0xa8')](_0x2d40e9)){var _0x7f0085=this;_0x2d40e9[_0x8bac('0xeb')](function(_0x40bc11,_0x3cc492){_0x7f0085[_0x8bac('0xf')][_0x8bac('0xad')](util[_0x8bac('0x28')]('%s[%s]',_0xb1c99e,_0x3cc492),_0x40bc11);});return this[_0x8bac('0xf')][_0x8bac('0xb9')](util[_0x8bac('0x28')](_0x8bac('0x166'),_0xb1c99e));}else{return this[_0x8bac('0xf')][_0x8bac('0xad')](_0xb1c99e,_0x2d40e9);}};AGIVertices[_0x8bac('0x11')]['menu']=function(_0x3c639a){logger[_0x8bac('0x2d')](util[_0x8bac('0x28')](_0x8bac('0x167'),_0x3c639a[_0x8bac('0x37')]));if(_0x3c639a[_0x8bac('0xb6')]===0x0){return this[_0x8bac('0xb5')](_0x3c639a);}_0x3c639a[_0x8bac('0xb6')]-=0x1;if(!this[_0x8bac('0x92')](_0x3c639a[_0x8bac('0x168')])){return this['channel'][_0x8bac('0x2b')](_0x3c639a,_0x8bac('0x11b'));}var _0xc2b347=this[_0x8bac('0x1e')]['sync'](this,_0x3c639a[_0x8bac('0x168')]);if(!_0xc2b347){return this['channel'][_0x8bac('0x2b')](_0x3c639a,_0x8bac('0x11c'));}var _0x28a382=this[_0x8bac('0xf')][_0x8bac('0x11d')](_0xc2b347,_0x3c639a[_0x8bac('0x11e')],_0x3c639a[_0x8bac('0x169')]);var _0x2cbce7=_0x28a382['result'];if(_0x28a382['result']===-0x1){this[_0x8bac('0x35')][_0x8bac('0x7a')](this,_0x3c639a,'-1');return _0x28a382;}else if(_0x28a382[_0x8bac('0xb1')]===_0x8bac('0x71')){_0x28a382[_0x8bac('0xb3')]=_0x28a382[_0x8bac('0xb3')][_0x8bac('0xa9')]>0x0?_0x28a382['result']:'t';}else if(_[_0x8bac('0x44')](_0x28a382[_0x8bac('0xb3')])){_0x28a382[_0x8bac('0xb3')]='#';_0x2cbce7='#';}if(!this[_0x8bac('0x92')](_0x3c639a[_0x8bac('0xe8')])){this['channel'][_0x8bac('0xb9')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x5bf29c=this['getVariable'][_0x8bac('0x7a')](this,_0x3c639a['variable_id']);if(!_0x5bf29c){return this['channel'][_0x8bac('0x2b')](_0x3c639a,'no\x20variable\x20found');}this[_0x8bac('0xf')][_0x8bac('0xad')](_0x5bf29c,_0x2cbce7);}this['createSquareDetailsReport'][_0x8bac('0x7a')](this,_0x3c639a,_0x2cbce7);return _0x28a382;};AGIVertices[_0x8bac('0x11')][_0x8bac('0xb9')]=function(_0xf75b18){logger[_0x8bac('0x2d')](util[_0x8bac('0x28')](_0x8bac('0x16a'),_0xf75b18[_0x8bac('0x37')]));return this[_0x8bac('0xf')][_0x8bac('0xb9')](_0xf75b18[_0x8bac('0x16b')]||_0xf75b18[_0x8bac('0x37')]);};AGIVertices[_0x8bac('0x11')]['pause']=function(_0x242924){logger['info'](util['format']('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x242924[_0x8bac('0x37')]));if(!this[_0x8bac('0x92')](_0x242924[_0x8bac('0x15b')])){return this[_0x8bac('0xf')][_0x8bac('0x2b')](_0x242924,_0x8bac('0x161'));}logger['info'](util[_0x8bac('0x28')](_0x8bac('0x162'),this[_0x8bac('0xf')][_0x8bac('0x39')],_0x242924[_0x8bac('0x15b')]));var _0x2bef5e=this[_0x8bac('0x57')][_0x8bac('0x7a')](this,_0x242924[_0x8bac('0x16c')]);var _0x29fab3=this['agentPause'][_0x8bac('0x7a')](this,_0x242924[_0x8bac('0x15b')],_0x2bef5e);if(_0x29fab3){logger[_0x8bac('0x2d')](util['format'](_0x8bac('0x15c'),this[_0x8bac('0xf')][_0x8bac('0x39')],_0x242924['findBy']));this['channel'][_0x8bac('0xb9')](util[_0x8bac('0x28')](_0x8bac('0x15c'),this[_0x8bac('0xf')]['callerid'],_0x242924[_0x8bac('0x15b')]));return{'code':0xc8,'result':_0x8bac('0x15d')};}else{logger['info'](util['format'](_0x8bac('0x15e'),this[_0x8bac('0xf')][_0x8bac('0x39')],_0x242924[_0x8bac('0x15b')]));this[_0x8bac('0xf')]['noop'](util['format'](_0x8bac('0x15c'),this[_0x8bac('0xf')]['callerid'],_0x242924[_0x8bac('0x15b')]));return{'code':0xc8,'result':_0x8bac('0x15f')};}};AGIVertices['prototype'][_0x8bac('0x16d')]=function(_0x538377){logger[_0x8bac('0x2d')](util[_0x8bac('0x28')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x538377[_0x8bac('0x37')]));if(!this['isConfigured'](_0x538377['file_id'])){return this[_0x8bac('0xf')][_0x8bac('0x2b')](_0x538377,_0x8bac('0x11b'));}var _0x25f434=this['getSound'][_0x8bac('0x7a')](this,_0x538377['file_id']);if(!_0x25f434){return this[_0x8bac('0xf')][_0x8bac('0x2b')](_0x538377,_0x8bac('0x11c'));}var _0x5d0a3b=this[_0x8bac('0xf')][_0x8bac('0x62')](_0x8bac('0x16e'),[_0x25f434,_0x538377[_0x8bac('0x118')]]);if(_0x5d0a3b[_0x8bac('0xb3')]===-0x1){return _0x5d0a3b;}return this['channel']['noop'](util[_0x8bac('0x28')]('Executed\x20command\x20%s\x20%s','PLAYBACK',_0x25f434));};AGIVertices['prototype'][_0x8bac('0x16f')]=function(_0x44a659){logger[_0x8bac('0x2d')](util['format'](_0x8bac('0x170'),_0x44a659[_0x8bac('0x37')]));if(!this[_0x8bac('0x92')](_0x44a659[_0x8bac('0x171')])){return this['channel']['error'](_0x44a659,_0x8bac('0x172'));}var _0x5b45c1='';var _0x496e3f=parseInt(_0x44a659[_0x8bac('0x171')],0xa);if(isNaN(_0x496e3f)){_0x5b45c1=_0x44a659[_0x8bac('0x171')];}else{_0x5b45c1=this[_0x8bac('0x16')][_0x8bac('0x7a')](this,_0x44a659[_0x8bac('0x171')]);if(!_0x5b45c1){return this[_0x8bac('0xf')][_0x8bac('0x2b')](_0x44a659,'no\x20queue\x20found');}}var _0x28e806='';if(this[_0x8bac('0x92')](_0x44a659[_0x8bac('0x168')])){var _0x42d8bc=this[_0x8bac('0x1e')][_0x8bac('0x7a')](this,_0x44a659[_0x8bac('0x168')]);if(_0x42d8bc){_0x28e806=_0x42d8bc;}}this[_0x8bac('0x35')]['sync'](this,_0x44a659,_0x5b45c1);if(_0x44a659['opts']['indexOf']('x')<0x0){_0x44a659[_0x8bac('0x118')]+='x';}if(_0x44a659[_0x8bac('0x118')][_0x8bac('0x173')]('X')<0x0){_0x44a659[_0x8bac('0x118')]+='X';}this[_0x8bac('0xf')][_0x8bac('0xad')]('XMCS-QUEUE',_0x5b45c1?_0x5b45c1['toLowerCase']():'');var _0x25dca2=this[_0x8bac('0xf')][_0x8bac('0x62')](_0x8bac('0x174'),[_0x5b45c1,_0x44a659[_0x8bac('0x118')],_0x44a659['url'],_0x28e806,_0x44a659[_0x8bac('0x71')],_0x44a659[_0x8bac('0xc7')],_0x44a659[_0x8bac('0x175')],_0x44a659['gosub'],'',_0x44a659[_0x8bac('0x176')]]);if(_0x25dca2['result']===-0x1){return _0x25dca2;}return this['channel'][_0x8bac('0xb9')](util['format'](_0x8bac('0xd5'),_0x8bac('0x174'),_0x5b45c1));};AGIVertices[_0x8bac('0x11')]['record']=function(_0x52e35a){logger[_0x8bac('0x2d')](util[_0x8bac('0x28')](_0x8bac('0x177'),_0x52e35a[_0x8bac('0x37')]));var _0xaad2eb=_0x52e35a[_0x8bac('0x178')]||_0x8bac('0x134');var _0x183207=util['format'](_0x8bac('0x179'),this[_0x8bac('0xf')][_0x8bac('0x36')],rs[_0x8bac('0x122')](0x5));var _0x4bd6f6=util[_0x8bac('0x28')](_0x8bac('0x17a'),FILES_PATH,_0x183207,_0xaad2eb);var _0x43d87a=util[_0x8bac('0x28')]('%s/recordings/%s',FILES_PATH,_0x183207);this[_0x8bac('0x3a')][_0x8bac('0x7a')](this,_0x52e35a,_0x183207,_0x4bd6f6);this['channel'][_0x8bac('0xad')]('RECORDING_SAVENAME',_0x183207);logger[_0x8bac('0x2d')](_0x8bac('0x17b'),_0x43d87a,_0xaad2eb,_0x52e35a['escape_digits'],_0x52e35a[_0x8bac('0x71')]);return this['channel'][_0x8bac('0x138')](_0x43d87a,_0xaad2eb,_0x52e35a[_0x8bac('0x17c')],_0x52e35a[_0x8bac('0x71')],undefined,!![]);};AGIVertices[_0x8bac('0x11')][_0x8bac('0x17d')]=function(_0x56e30e){logger[_0x8bac('0x2d')](util[_0x8bac('0x28')](_0x8bac('0x17e'),_0x56e30e[_0x8bac('0x37')]));if(!this[_0x8bac('0x92')](_0x56e30e[_0x8bac('0x7b')])){return this[_0x8bac('0xf')][_0x8bac('0xb9')](_0x8bac('0x17f'));}var _0x167e9b=this['restAPI'][_0x8bac('0x7a')](this,_0x56e30e);logger['info'](util[_0x8bac('0x28')](_0x8bac('0x180'),util['inspect'](_0x167e9b,{'showHidden':![],'depth':null})));if(!this[_0x8bac('0x92')](_0x56e30e[_0x8bac('0xe8')])){return this[_0x8bac('0xf')][_0x8bac('0xb9')](_0x8bac('0x181'));}var _0x11b051=this[_0x8bac('0xb0')][_0x8bac('0x7a')](this,_0x56e30e['variable_id']);if(!_0x11b051){return this['channel'][_0x8bac('0x2b')](_0x56e30e,_0x8bac('0xea'));}this['channel'][_0x8bac('0xad')](util[_0x8bac('0x28')]('%s_STATUS_CODE',_0x11b051),_0x167e9b[_0x8bac('0x80')]?_0x167e9b[_0x8bac('0x80')]:_0x8bac('0x182'));this['channel'][_0x8bac('0xad')](util[_0x8bac('0x28')](_0x8bac('0x183'),_0x11b051),_0x167e9b['statusMessage']?_0x167e9b['statusMessage']:'OK');if(_0x167e9b[_0x8bac('0x7d')]){try{this[_0x8bac('0xab')](_0x167e9b[_0x8bac('0x7d')],_0x11b051);}catch(_0x24cbd3){logger['error'](util['format'](_0x8bac('0x184'),_0x11b051));}}return this[_0x8bac('0xf')][_0x8bac('0xb9')](util[_0x8bac('0x28')](_0x8bac('0xee'),_0x11b051));};AGIVertices['prototype'][_0x8bac('0x185')]=function(_0x319919){logger[_0x8bac('0x2d')](util[_0x8bac('0x28')](_0x8bac('0x186'),_0x319919[_0x8bac('0x37')]));return this[_0x8bac('0xf')][_0x8bac('0x187')](_0x319919[_0x8bac('0x188')][_0x8bac('0x64')](/\s+/g,''),_0x319919[_0x8bac('0x17c')]);};AGIVertices['prototype']['saynumber']=function(_0x4c3a9f){logger['info'](util[_0x8bac('0x28')](_0x8bac('0x189'),_0x4c3a9f[_0x8bac('0x37')]));return this[_0x8bac('0xf')][_0x8bac('0x18a')](_0x4c3a9f['number'][_0x8bac('0x64')](/\s+/g,''),_0x4c3a9f[_0x8bac('0x17c')]);};AGIVertices['prototype'][_0x8bac('0x18b')]=function(_0x4f1d4a){logger[_0x8bac('0x2d')](util[_0x8bac('0x28')](_0x8bac('0x18c'),_0x4f1d4a[_0x8bac('0x37')]));return this[_0x8bac('0xf')][_0x8bac('0x18d')](_0x4f1d4a['text'],_0x4f1d4a[_0x8bac('0x17c')]);};AGIVertices[_0x8bac('0x11')]['sendMail']=function(_0x3d3496){logger['info'](util[_0x8bac('0x28')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x3d3496['label']));if(!this['isConfigured'](_0x3d3496['account_id'])){return this[_0x8bac('0xf')]['noop'](_0x8bac('0x18e'));}var _0x395ae6=this[_0x8bac('0x18f')][_0x8bac('0x7a')](this,_0x3d3496[_0x8bac('0x190')]);if(!_0x395ae6||!_0x395ae6[_0x8bac('0x191')]){return this['channel']['error'](_0x3d3496,_0x8bac('0x192'));}var _0x533870={'from':util['format'](_0x8bac('0x193'),_0x395ae6['name'],_0x395ae6[_0x8bac('0x194')]||_0x395ae6[_0x8bac('0x191')][_0x8bac('0x195')]),'to':_0x3d3496['to']||'','cc':_0x3d3496['cc']||'','bcc':_0x3d3496[_0x8bac('0x196')]||'','subject':_0x3d3496[_0x8bac('0x197')],'html':_0x3d3496[_0x8bac('0x68')],'text':_0x3d3496[_0x8bac('0x68')]};var _0x575a43={'tls':{'rejectUnauthorized':![]}};if(_0x395ae6[_0x8bac('0x191')][_0x8bac('0x198')]){_0x575a43[_0x8bac('0x198')]=_0x395ae6[_0x8bac('0x191')][_0x8bac('0x198')];}else{_0x575a43[_0x8bac('0x199')]=_0x395ae6[_0x8bac('0x191')][_0x8bac('0x199')];_0x575a43[_0x8bac('0x19a')]=_0x395ae6[_0x8bac('0x191')][_0x8bac('0x19a')];_0x575a43[_0x8bac('0x19b')]=_0x395ae6[_0x8bac('0x191')][_0x8bac('0x19b')];}if(_0x395ae6['Smtp'][_0x8bac('0x19c')]){_0x575a43['auth']={'user':_0x395ae6[_0x8bac('0x191')][_0x8bac('0x195')],'pass':_0x395ae6[_0x8bac('0x191')][_0x8bac('0x19d')]};}if(this['isConfigured'](_0x3d3496[_0x8bac('0x19e')])){}logger[_0x8bac('0xf0')](_0x8bac('0x19f'),JSON[_0x8bac('0x7c')](_0x533870));this[_0x8bac('0x35')]['sync'](this,_0x3d3496,_0x3d3496[_0x8bac('0x190')]);this[_0x8bac('0xf')][_0x8bac('0xb9')](util[_0x8bac('0x28')](_0x8bac('0x1a0'),_0x395ae6[_0x8bac('0x14')]));this[_0x8bac('0x21')][_0x8bac('0x7a')](this,_0x575a43,_0x533870);return this[_0x8bac('0xf')][_0x8bac('0xb9')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0x8bac('0x1a1')]=function(_0x541714){logger[_0x8bac('0x2d')](util[_0x8bac('0x28')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x541714[_0x8bac('0x37')]));return this[_0x8bac('0xf')][_0x8bac('0xb9')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x8bac('0x11')][_0x8bac('0x1a2')]=function(_0x5d1137){logger[_0x8bac('0x2d')](util[_0x8bac('0x28')](_0x8bac('0x1a3'),_0x5d1137['label']));if(!this[_0x8bac('0x92')](_0x5d1137[_0x8bac('0x1a4')])){return this[_0x8bac('0xf')][_0x8bac('0xb9')](_0x8bac('0x1a5'));}var _0x10951d=this['getSmsAccount']['sync'](this,_0x5d1137[_0x8bac('0x1a4')]);if(!_0x10951d){return this['channel'][_0x8bac('0x2b')](_0x5d1137,_0x8bac('0x1a6'));}var _0x5d4037={'body':_0x5d1137[_0x8bac('0x1a7')],'phone':_0x5d1137['to']||'','SmsAccountId':_0x10951d['id']};logger[_0x8bac('0xf0')]('sendSMS\x20message',JSON[_0x8bac('0x7c')](_0x5d4037));this['createSquareDetailsReport'][_0x8bac('0x7a')](this,_0x5d1137,_0x5d1137[_0x8bac('0x1a4')]);this[_0x8bac('0xf')][_0x8bac('0xb9')](util[_0x8bac('0x28')](_0x8bac('0x1a8'),_0x10951d[_0x8bac('0x14')]));this[_0x8bac('0x34')][_0x8bac('0x7a')](this,_0x5d4037);return this[_0x8bac('0xf')]['noop'](_0x8bac('0x1a9'));};AGIVertices[_0x8bac('0x11')][_0x8bac('0x1aa')]=function(_0x5ab9c6){logger[_0x8bac('0x2d')](util['format']('Enter\x20in\x20SET\x20(%s)\x20block',_0x5ab9c6['label']));if(!this[_0x8bac('0x92')](_0x5ab9c6['variable_id'])){return this[_0x8bac('0xf')][_0x8bac('0x2b')](_0x5ab9c6,_0x8bac('0x1ab'));}var _0x3352c3=this['getVariable'][_0x8bac('0x7a')](this,_0x5ab9c6[_0x8bac('0xe8')]);if(!_0x3352c3){return this[_0x8bac('0xf')][_0x8bac('0x2b')](_0x5ab9c6,_0x8bac('0xea'));}return this[_0x8bac('0xf')][_0x8bac('0xad')](_0x3352c3,_0x5ab9c6[_0x8bac('0x1ac')]);};AGIVertices[_0x8bac('0x11')][_0x8bac('0x1ad')]=function(_0x27f0d3){logger[_0x8bac('0x2d')](util[_0x8bac('0x28')](_0x8bac('0x1ae'),_0x27f0d3['label']));this['channel']['noop'](_0x8bac('0x1af'));if(_0x27f0d3['answer']===_0x8bac('0x1b0')){this['channel'][_0x8bac('0xb9')](_0x8bac('0x1b1'));return this[_0x8bac('0xf')][_0x8bac('0xcb')]();}return this[_0x8bac('0xf')][_0x8bac('0xb9')]('Skipped\x20Answer');};AGIVertices[_0x8bac('0x11')][_0x8bac('0x1b2')]=function(_0x4bdae6){logger[_0x8bac('0x2d')](util[_0x8bac('0x28')](_0x8bac('0x1b3'),_0x4bdae6[_0x8bac('0x37')]));if(!this[_0x8bac('0x92')](_0x4bdae6[_0x8bac('0x1b4')])){return this['channel'][_0x8bac('0x2b')](_0x4bdae6,_0x8bac('0x1b5'));}var _0x3ad577=this[_0x8bac('0x17')][_0x8bac('0x7a')](this,_0x4bdae6[_0x8bac('0x1b4')]);if(!this['isConfigured'](_0x3ad577)){return this['channel'][_0x8bac('0x2b')](_0x4bdae6,util[_0x8bac('0x28')](_0x8bac('0x1b6'),_0x4bdae6[_0x8bac('0x1b4')]));}if(_0x3ad577===this[_0x8bac('0xf')][_0x8bac('0x40')]){return this[_0x8bac('0xf')][_0x8bac('0x2b')](_0x4bdae6,_0x8bac('0x1b7'));}this['createSquareDetailsReport'][_0x8bac('0x7a')](this,_0x4bdae6,_0x3ad577);var _0x50be87=this[_0x8bac('0xf')][_0x8bac('0x62')](_0x8bac('0x1b8'),util[_0x8bac('0x28')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x8bac('0xc7')]['host']||_0x8bac('0x1b9'),_0x3ad577,this[_0x8bac('0xf')][_0x8bac('0x40')]));if(_0x50be87[_0x8bac('0xb3')]===-0x1){return _0x50be87;}return this[_0x8bac('0xf')][_0x8bac('0xb9')](util[_0x8bac('0x28')](_0x8bac('0xd5'),_0x8bac('0x1b8'),_0x3ad577));};AGIVertices[_0x8bac('0x11')][_0x8bac('0x1ba')]=function(_0x3eede2){logger[_0x8bac('0x2d')](util['format']('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x3eede2[_0x8bac('0x37')]));var _0x5eda98=this[_0x8bac('0x61')][_0x8bac('0x7a')](this,_0x3eede2[_0x8bac('0xc9')]);this[_0x8bac('0x35')][_0x8bac('0x7a')](this,_0x3eede2,_0x3eede2[_0x8bac('0xc9')]);if(this[_0x8bac('0x92')](_0x3eede2[_0x8bac('0xe8')])){var _0x1c584d=this[_0x8bac('0xb0')]['sync'](this,_0x3eede2[_0x8bac('0xe8')]);if(_0x1c584d){this[_0x8bac('0xf')][_0x8bac('0xad')](_0x1c584d,_0x5eda98);return this[_0x8bac('0xf')]['noop'](util[_0x8bac('0x28')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x3eede2['command'],_0x1c584d));}}return this[_0x8bac('0xf')][_0x8bac('0xb9')](util[_0x8bac('0x28')](_0x8bac('0x1bb'),_0x3eede2['command']));};AGIVertices[_0x8bac('0x11')][_0x8bac('0x1bc')]=function(_0x27dcd6){logger[_0x8bac('0x2d')](util[_0x8bac('0x28')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x27dcd6['label']));_0x27dcd6['text']=_0x27dcd6[_0x8bac('0x68')][_0x8bac('0x64')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x27dcd6[_0x8bac('0x66')])){return this[_0x8bac('0xf')][_0x8bac('0xb9')](_0x8bac('0x1bd'));}if(!this[_0x8bac('0x92')](_0x27dcd6['text'])){return this[_0x8bac('0xf')][_0x8bac('0xb9')](_0x8bac('0xba'));}this[_0x8bac('0xf')][_0x8bac('0xb9')](util[_0x8bac('0x28')](_0x8bac('0x1be'),_0x27dcd6[_0x8bac('0x68')]));var _0x4bcc50=this[_0x8bac('0x65')][_0x8bac('0x7a')](this,_0x27dcd6);if(_0x4bcc50){this[_0x8bac('0xf')][_0x8bac('0xb9')](util[_0x8bac('0x28')](_0x8bac('0x1bf'),_0x4bcc50));var _0x4fe287=this[_0x8bac('0xf')][_0x8bac('0x10e')](_0x4bcc50);try{fs[_0x8bac('0x10f')](_0x4bcc50+'.wav');}catch(_0x4ad76c){logger['error'](_0x4ad76c);}return _0x4fe287;}return this[_0x8bac('0xf')]['error'](_0x27dcd6,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x8bac('0x11')]['tts']=function(_0x31866a){logger['info'](util[_0x8bac('0x28')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x31866a[_0x8bac('0x37')]));_0x31866a['text']=_0x31866a[_0x8bac('0x68')][_0x8bac('0x64')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x8bac('0x92')](_0x31866a[_0x8bac('0x68')])){return this[_0x8bac('0xf')][_0x8bac('0xb9')](_0x8bac('0xba'));}this[_0x8bac('0xf')]['noop'](util[_0x8bac('0x28')](_0x8bac('0x1c0'),_0x31866a[_0x8bac('0x68')]));var _0x59dc16=this[_0x8bac('0x6d')][_0x8bac('0x7a')](this,_0x31866a);if(_0x59dc16){this['channel'][_0x8bac('0xb9')](util[_0x8bac('0x28')]('Google\x20TTS\x20%s\x20file\x20created',_0x59dc16));var _0x31f6a3=this['channel'][_0x8bac('0x10e')](_0x59dc16);try{fs[_0x8bac('0x10f')](_0x59dc16+_0x8bac('0x110'));}catch(_0x24da21){logger[_0x8bac('0x2b')](_0x24da21);}return _0x31f6a3;}return this[_0x8bac('0xf')][_0x8bac('0x2b')](_0x31866a,_0x8bac('0x1c1'));};AGIVertices[_0x8bac('0x11')][_0x8bac('0x1c2')]=function(_0x433d2e){logger[_0x8bac('0x2d')](util[_0x8bac('0x28')](_0x8bac('0x1c3'),_0x433d2e[_0x8bac('0x37')]));if(!this[_0x8bac('0x92')](_0x433d2e[_0x8bac('0x15b')])){return this[_0x8bac('0xf')][_0x8bac('0x2b')](_0x433d2e,_0x8bac('0x161'));}logger[_0x8bac('0x2d')](util[_0x8bac('0x28')](_0x8bac('0x162'),this['channel'][_0x8bac('0x39')],_0x433d2e[_0x8bac('0x15b')]));var _0x4b73c8=this[_0x8bac('0x5b')][_0x8bac('0x7a')](this,_0x433d2e[_0x8bac('0x15b')]);if(_0x4b73c8){logger[_0x8bac('0x2d')](util[_0x8bac('0x28')](_0x8bac('0x15c'),this['channel']['callerid'],_0x433d2e[_0x8bac('0x15b')]));this[_0x8bac('0xf')][_0x8bac('0xb9')](util[_0x8bac('0x28')](_0x8bac('0x15c'),this['channel']['callerid'],_0x433d2e[_0x8bac('0x15b')]));return{'code':0xc8,'result':_0x8bac('0x15d')};}else{logger[_0x8bac('0x2d')](util[_0x8bac('0x28')](_0x8bac('0x15e'),this[_0x8bac('0xf')]['callerid'],_0x433d2e[_0x8bac('0x15b')]));this[_0x8bac('0xf')][_0x8bac('0xb9')](util['format'](_0x8bac('0x15e'),this[_0x8bac('0xf')][_0x8bac('0x39')],_0x433d2e[_0x8bac('0x15b')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x8bac('0x1c4')]=function(_0x217e9d){logger[_0x8bac('0x2d')](util['format'](_0x8bac('0x1c5'),_0x217e9d[_0x8bac('0x37')]));var _0x4b8c64=this['channel']['exec'](_0x8bac('0x1c6'),[_0x217e9d[_0x8bac('0x1c7')],_0x217e9d[_0x8bac('0x84')]]);if(_0x4b8c64[_0x8bac('0xb3')]===-0x1){return _0x4b8c64;}return this[_0x8bac('0xf')]['noop'](util[_0x8bac('0x28')](_0x8bac('0xd5'),_0x8bac('0x1c6'),_0x217e9d['mailbox']));};AGIVertices[_0x8bac('0x11')]['vswitch']=function(_0x3931d8){logger[_0x8bac('0x2d')](util['format'](_0x8bac('0x1c8'),_0x3931d8[_0x8bac('0x37')]));if(!this[_0x8bac('0x92')](_0x3931d8['variable_id'])){return this[_0x8bac('0xf')][_0x8bac('0x2b')](_0x3931d8,'no\x20variable\x20selected');}var _0x4dffa1=this['getVariable'][_0x8bac('0x7a')](this,_0x3931d8['variable_id']);if(!_0x4dffa1){return this[_0x8bac('0xf')][_0x8bac('0x2b')](_0x3931d8,_0x8bac('0xea'));}var _0x3c242a=this['channel']['getVariable'](_0x4dffa1);return{'code':0xc8,'result':_0x3c242a[_0x8bac('0xb1')]?_0x3c242a[_0x8bac('0xb1')]:'-'};};String[_0x8bac('0x11')]['replaceAll']=function(_0x2d298d,_0x1c921b){return this['split'](_0x2d298d)['join'](_0x1c921b);};module[_0x8bac('0x1c9')]=AGIVertices;
\ No newline at end of file
+var _0x165d=['sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','Amy','awsLex','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','clone','hasOwnProperty','replaceObjectAllVariables','replaceAllVariables','isPlainObject','recursiveNodeIndex','isArray','length','isString','saveRestApiResult','%s.%s','setVariable','split','extra','getAndSetVariable','result','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','options','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','grammar','no\x20grammar\x20configured','exec','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','agi','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','add','delay','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','no\x20text\x20configured','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','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','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','out','DialogflowV2\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','username','no\x20username\x20configured','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','getSound','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','getData','maxdigit','mindigit','no\x20variable\x20found','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','unlink','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','wav','%s/recordings/%s','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','continueAt','extension','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','getIntervals','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','beep','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','success','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','response','digit','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','indexOf','QUEUE','macro','Executed\x20command\x20%s\x20%s','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','restAPI','Response:','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','secure','authentication','auth','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','START\x20CALLY\x20SQUARE','Answer','Skipped\x20Answer','subproject','project_id','no\x20subproject\x20selected','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','host','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','apiKey','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','googleTTS','Google\x20TTS\x20%s\x20file\x20created','unpause','voicemail','VOICEMAIL','mailbox','vswitch','replaceAll','join','exports','path','util','lodash','shelljs','odbc','randomstring','moment','request-promise','../../config/logger','./scripts','/var/opt/motion2/server/files','menu','getdigits','getsecretdigits','channel','rpc','prototype','getVariable','then','name','catch','getVoiceQueue','getSquareOdbc','getSquareOdbcById','dsn','getUserById','getTrunk','getTrunkById','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','mailRpc','getIntervalById','IntervalId','interval','map','Intervals','%s/sounds/converted/%s','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','callback_','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','dialTimezone','isNil','CALLERID(dialTimezone)','timezones','scheduledat','minutes','insertContact','utcOffset','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','format','%s/%s@from-sip/n','LOCAL','trim','replace','googleCloudTTS','google_cloud_tts_text_type','text','en-US','ssmlGender','MALE','audioEncoding','MP3','google_tts_language','url','timeout','number','includes','POST','PUT','toUpperCase','body','rawBody','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','rawHeaders','parse','computedVariables','sync','uri','render','headers','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','googleDialogflow','key','dialogflow_language','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language'];(function(_0x1de9ad,_0x483f74){var _0x3e026b=function(_0x5cdea3){while(--_0x5cdea3){_0x1de9ad['push'](_0x1de9ad['shift']());}};_0x3e026b(++_0x483f74);}(_0x165d,0x14a));var _0xd165=function(_0x36d0be,_0x12d521){_0x36d0be=_0x36d0be-0x0;var _0x5c9af9=_0x165d[_0x36d0be];return _0x5c9af9;};'use strict';var fs=require('fs');var path=require(_0xd165('0x0'));var util=require(_0xd165('0x1'));var _=require(_0xd165('0x2'));var sh=require(_0xd165('0x3'));var odbc=require(_0xd165('0x4'))();var rs=require(_0xd165('0x5'));var moment=require(_0xd165('0x6'));var Mustache=require('mustache');var rp=require(_0xd165('0x7'));var logger=require(_0xd165('0x8'))('agi');var config=require('../../config/environment');var shared=require('../../config/environment/shared');var scripts=require(_0xd165('0x9'));var FILES_PATH=_0xd165('0xa');var recursiveMapAttributes=['rawHeaders','rawBody'];var verticesWithRetry=[_0xd165('0xb'),_0xd165('0xc'),_0xd165('0xd')];var AGIVertices=function(_0x2be177,_0x3a29a0,_0x239d6d){this[_0xd165('0xe')]=_0x2be177;this[_0xd165('0xf')]=_0x3a29a0;this['mailRpc']=_0x239d6d;};AGIVertices[_0xd165('0x10')][_0xd165('0x11')]=function(_0xe52d47,_0x50f6b7){this[_0xd165('0xf')]['getVariableById'](_0xe52d47)[_0xd165('0x12')](function(_0x267f62){_0x50f6b7(null,_0x267f62?_0x267f62[_0xd165('0x13')]:![]);})[_0xd165('0x14')](function(_0x5a46e8){_0x50f6b7(_0x5a46e8);});};AGIVertices['prototype'][_0xd165('0x15')]=function(_0x17521a,_0x3e586a){this['rpc']['getVoiceQueueById'](_0x17521a)['then'](function(_0x693c9b){_0x3e586a(null,_0x693c9b?_0x693c9b[_0xd165('0x13')]:![]);})['catch'](function(_0x170839){_0x3e586a(_0x170839);});};AGIVertices[_0xd165('0x10')]['getSquareProject']=function(_0x522b83,_0x2acf24){this[_0xd165('0xf')]['getSquareProjectById'](_0x522b83)['then'](function(_0x596a74){_0x2acf24(null,_0x596a74?_0x596a74['name']:![]);})[_0xd165('0x14')](function(_0x1521be){_0x2acf24(_0x1521be);});};AGIVertices[_0xd165('0x10')][_0xd165('0x16')]=function(_0x210af5,_0x1b2db6){this[_0xd165('0xf')][_0xd165('0x17')](_0x210af5)[_0xd165('0x12')](function(_0x4ec084){_0x1b2db6(null,_0x4ec084?_0x4ec084[_0xd165('0x18')]:![]);})['catch'](function(_0x207de1){_0x1b2db6(_0x207de1);});};AGIVertices[_0xd165('0x10')]['getUser']=function(_0x46a462,_0x3a3b5a){this['rpc'][_0xd165('0x19')](_0x46a462)[_0xd165('0x12')](function(_0x26ae3b){_0x3a3b5a(null,_0x26ae3b?_0x26ae3b['name']:![]);})[_0xd165('0x14')](function(_0x13f71b){_0x3a3b5a(_0x13f71b);});};AGIVertices[_0xd165('0x10')][_0xd165('0x1a')]=function(_0x1a2b32,_0x21a42e){this['rpc'][_0xd165('0x1b')](_0x1a2b32)[_0xd165('0x12')](function(_0x3c80b7){_0x21a42e(null,_0x3c80b7?_0x3c80b7[_0xd165('0x13')]:![]);})[_0xd165('0x14')](function(_0x113aff){_0x21a42e(_0x113aff);});};AGIVertices[_0xd165('0x10')]['getSound']=function(_0x431992,_0x5c5907){var _0x19b851=this;this[_0xd165('0xf')][_0xd165('0x1c')](_0x431992)['then'](function(_0x2e71e3){_0x5c5907(null,_0x2e71e3?_0x19b851[_0xd165('0x1d')](_0x2e71e3[_0xd165('0x1e')]):![]);})[_0xd165('0x14')](function(_0x59a5d6){_0x5c5907(_0x59a5d6);});};AGIVertices[_0xd165('0x10')][_0xd165('0x1f')]=function(_0x11a46c,_0x132ac2){this[_0xd165('0xf')][_0xd165('0x20')](_0x11a46c)['then'](function(_0x16852a){_0x132ac2(null,_0x16852a?_0x16852a:![]);})[_0xd165('0x14')](function(_0x4becdf){_0x132ac2(_0x4becdf);});};AGIVertices[_0xd165('0x10')][_0xd165('0x21')]=function(_0xfbf86d,_0x18e1d4,_0x3090d9){this[_0xd165('0x22')]['sendMailMessage'](_0xfbf86d,_0x18e1d4)['then'](function(){_0x3090d9(null);})[_0xd165('0x14')](function(_0x5c68e2){_0x3090d9(_0x5c68e2);});};AGIVertices[_0xd165('0x10')]['getIntervals']=function(_0x2a20c2,_0x53dc85){this[_0xd165('0xf')][_0xd165('0x23')](_0x2a20c2)[_0xd165('0x12')](function(_0x256112){if(_0x256112){if(_0x256112[_0xd165('0x24')]){_0x53dc85(null,[_0x256112[_0xd165('0x25')]]);}else{_0x53dc85(null,_[_0xd165('0x26')](_0x256112[_0xd165('0x27')],_0xd165('0x25')));}}else{_0x53dc85(null,![]);}})[_0xd165('0x14')](function(_0x407b68){_0x53dc85(_0x407b68);});};AGIVertices[_0xd165('0x10')][_0xd165('0x1d')]=function(_0x329ffa){return util['format'](_0xd165('0x28'),FILES_PATH,_0x329ffa);};AGIVertices[_0xd165('0x10')][_0xd165('0x29')]=function(_0x2aba2e,_0x545160,_0x5cbb9a){odbc['open'](_0x2aba2e,function(_0x5a48e4){if(_0x5a48e4){logger[_0xd165('0x2a')](_0xd165('0x2b'),_0x5a48e4);_0x5cbb9a(_0x5a48e4);}else{logger[_0xd165('0x2c')](_0xd165('0x2d'));odbc[_0xd165('0x2e')](_0x545160,function(_0x39d470,_0x250200){if(_0x39d470){logger[_0xd165('0x2c')](_0xd165('0x2f'),_0x545160);_0x5cbb9a(_0x39d470);}else{logger[_0xd165('0x2c')](_0xd165('0x30'),_0x545160);odbc['close'](function(_0x30961f){if(_0x30961f){logger[_0xd165('0x2a')](_0xd165('0x31'),_0x30961f);}_0x5cbb9a(null,_0x250200);});}});}});};AGIVertices[_0xd165('0x10')][_0xd165('0x32')]=function(_0x52fd5c,_0x23101a){this[_0xd165('0xf')]['getSmsAccountById'](_0x52fd5c)[_0xd165('0x12')](function(_0x3c6bea){_0x23101a(null,_0x3c6bea?_0x3c6bea:![]);})[_0xd165('0x14')](function(_0x3b130e){_0x23101a(_0x3b130e);});};AGIVertices[_0xd165('0x10')][_0xd165('0x33')]=function(_0x5ab171,_0x4a5b12){this[_0xd165('0xf')][_0xd165('0x33')](_0x5ab171)[_0xd165('0x12')](function(_0x35b8ca){_0x4a5b12(null,_0x35b8ca);})[_0xd165('0x14')](function(_0x363290){_0x4a5b12(_0x363290);});};AGIVertices[_0xd165('0x10')][_0xd165('0x34')]=function(_0x56111c,_0x23b4b1,_0x4c0e49){this[_0xd165('0xf')][_0xd165('0x34')]({'uniqueid':this[_0xd165('0xe')][_0xd165('0x35')],'node':_0x56111c[_0xd165('0x36')],'application':_0x56111c[_0xd165('0x37')],'data':_0x23b4b1||null,'project_name':this['channel'][_0xd165('0x38')],'callerid':this[_0xd165('0xe')][_0xd165('0x39')]})['then'](function(_0x184e1d){if(_0x4c0e49){_0x4c0e49(null,_0x184e1d);}})['catch'](function(_0x873316){if(_0x4c0e49){_0x4c0e49(_0x873316);}});};AGIVertices[_0xd165('0x10')][_0xd165('0x3a')]=function(_0x2332b2,_0x2e9fc3,_0x2b82ff,_0x38b15a){this['rpc']['createSquareRecording']({'uniqueid':this['channel']['uniqueid'],'callerid':this['channel'][_0xd165('0x39')],'calleridname':this[_0xd165('0xe')][_0xd165('0x3b')],'context':this[_0xd165('0xe')][_0xd165('0x3c')],'extension':this[_0xd165('0xe')]['extension'],'priority':this['channel'][_0xd165('0x3d')],'accountcode':this[_0xd165('0xe')][_0xd165('0x3e')],'dnid':this[_0xd165('0xe')][_0xd165('0x3f')],'projectName':this['channel']['arg_1'],'saveName':_0x2e9fc3,'filename':_0x2332b2[_0xd165('0x40')]||_0x2e9fc3,'savePath':_0x2b82ff})[_0xd165('0x12')](function(_0x4f7012){_0x38b15a(null,_0x4f7012);})[_0xd165('0x14')](function(_0x252805){_0x38b15a(_0x252805);});};AGIVertices[_0xd165('0x10')][_0xd165('0x41')]=function(_0x36576e,_0x434d88,_0x1b6f61,_0x23736a,_0x8b488){this[_0xd165('0xf')][_0xd165('0x41')]({'uniqueid':this['channel'][_0xd165('0x35')],'body':_0x36576e,'direction':_0x434d88,'providerName':_0x1b6f61,'providerResponse':_0x23736a})[_0xd165('0x12')](function(_0x51fb80){if(_0x8b488){_0x8b488(null,_0x51fb80);}})['catch'](function(_0x63b247){if(_0x8b488){_0x8b488(_0x63b247);}});};AGIVertices[_0xd165('0x10')][_0xd165('0x42')]=function(_0x2d06cb,_0x4ec1b2){var _0x3229e3=this;var _0x54aecb=0x0;var _0x1ca08c={'firstName':_[_0xd165('0x43')](_0x2d06cb['name'])||_['isNil'](_0x2d06cb['name'])?_0xd165('0x44')+Math['random']():_0x2d06cb[_0xd165('0x13')],'lastName':_[_0xd165('0x43')](_0x2d06cb['lastName'])||_['isNil'](_0x2d06cb['lastName'])?null:_0x2d06cb['lastName'],'phone':_0x2d06cb[_0xd165('0x45')],'ListId':_0x2d06cb[_0xd165('0x46')],'scheduledat':_0x2d06cb[_0xd165('0x47')],'callbackUniqueid':this[_0xd165('0xe')]['uniqueid'],'tags':_0xd165('0x48'),'description':_0xd165('0x49')+_0x2d06cb['scheduledAt'][_0xd165('0x4a')](),'priority':_0x2d06cb[_0xd165('0x4b')]};if(_['has'](_0x2d06cb,_0xd165('0x4c'))){if(!_[_0xd165('0x4d')](_0x2d06cb[_0xd165('0x4c')])){var _0xdccf99=_0x2d06cb[_0xd165('0x4c')];if(_0x2d06cb[_0xd165('0x4c')]==_0xd165('0x4e')){this['rpc']['getContactByPhone']({'phone':_0x2d06cb['phone']})[_0xd165('0x12')](function(_0x20f194){if(!_['isNil'](_0x20f194)){var _0x5b039e=_0x20f194['dialTimezone'];if(!_['isNil'](_0x5b039e)){var _0x53bc00=shared[_0xd165('0x4f')][_0x5b039e];if(!_[_0xd165('0x4d')](_0x53bc00)){var _0x509c4b=-0x1*_0x53bc00['utcOffset'];_0x1ca08c[_0xd165('0x50')]=moment(_0x2d06cb['scheduledat'])['add'](_0x509c4b,_0xd165('0x51'));_0x3229e3[_0xd165('0x52')](_0x1ca08c,_0x2d06cb,_0x4ec1b2);}else{_0x3229e3[_0xd165('0x52')](_0x1ca08c,_0x2d06cb,_0x4ec1b2);}}else{_0x3229e3['insertContact'](_0x1ca08c,_0x2d06cb,_0x4ec1b2);}}else{_0x3229e3[_0xd165('0x52')](_0x1ca08c,_0x2d06cb,_0x4ec1b2);}});}else{var _0x54aecb=shared['timezones'][_0xdccf99];if(!_[_0xd165('0x4d')](_0x54aecb)){var _0x1b4b22=-0x1*_0x54aecb[_0xd165('0x53')];_0x1ca08c[_0xd165('0x50')]=moment(_0x2d06cb[_0xd165('0x50')])['add'](_0x1b4b22,_0xd165('0x51'));_0x3229e3['insertContact'](_0x1ca08c,_0x2d06cb,_0x4ec1b2);}else{_0x3229e3['insertContact'](_0x1ca08c,_0x2d06cb,_0x4ec1b2);}}}else{_0x3229e3[_0xd165('0x52')](_0x1ca08c,_0x2d06cb,_0x4ec1b2);}}else{_0x3229e3[_0xd165('0x52')](_0x1ca08c,_0x2d06cb,_0x4ec1b2);}};AGIVertices['prototype'][_0xd165('0x54')]=function(_0x5a43e9,_0x2aa41d){this[_0xd165('0xf')][_0xd165('0x55')](_0x5a43e9)['then'](function(_0x13b895){_0x2aa41d(null,_0x13b895?_0x13b895[_0xd165('0x13')]:![]);})[_0xd165('0x14')](function(_0x2e6cd7){_0x2aa41d(_0x2e6cd7);});};AGIVertices[_0xd165('0x10')][_0xd165('0x56')]=function(_0xb5a752,_0x4d5272,_0x2b07e5){var _0x4d1575={'role':_0xd165('0x57')};_0x4d1575[_0xb5a752]=this[_0xd165('0xe')]['callerid'];this[_0xd165('0xf')][_0xd165('0x56')](_0x4d1575,_0x4d5272,this[_0xd165('0xe')]['uniqueid'])['then'](function(_0x31b50a){_0x2b07e5(null,_['isNil'](_0x31b50a)?![]:!![]);})[_0xd165('0x14')](function(_0x1f48b9){logger[_0xd165('0x2a')](_0x1f48b9);_0x2b07e5(null,![]);});};AGIVertices[_0xd165('0x10')][_0xd165('0x58')]=function(_0x2358f1,_0x360099){var _0x1ee9ff={'role':_0xd165('0x57')};_0x1ee9ff[_0x2358f1]=this[_0xd165('0xe')][_0xd165('0x39')];this[_0xd165('0xf')]['agentUnpause'](_0x1ee9ff)[_0xd165('0x12')](function(_0x3d789f){_0x360099(null,_[_0xd165('0x4d')](_0x3d789f)?![]:!![]);})[_0xd165('0x14')](function(_0x4a5ef4){logger[_0xd165('0x2a')](_0x4a5ef4);_0x360099(null,![]);});};AGIVertices[_0xd165('0x10')][_0xd165('0x59')]=function(_0x268bcb,_0x2bb2c5){var _0x224016={'role':'agent'};_0x224016[_0x268bcb]=this[_0xd165('0xe')][_0xd165('0x39')];this[_0xd165('0xf')][_0xd165('0x59')](_0x224016)['then'](function(_0x2b7504){_0x2bb2c5(null,_[_0xd165('0x4d')](_0x2b7504)?![]:!![]);})[_0xd165('0x14')](function(_0x391c4e){logger[_0xd165('0x2a')](_0x391c4e);_0x2bb2c5(null,![]);});};AGIVertices['prototype'][_0xd165('0x5a')]=function(_0x43c3b9,_0x126ef3){var _0x4d3648={'role':'agent'};_0x4d3648[_0x43c3b9]=this[_0xd165('0xe')]['callerid'];var _0x1178b1=_0x43c3b9!='internal'?util[_0xd165('0x5b')](_0xd165('0x5c'),_0xd165('0x5d'),this[_0xd165('0xe')][_0xd165('0x39')]):undefined;this[_0xd165('0xf')][_0xd165('0x5a')](_0x4d3648,_0x1178b1)['then'](function(_0x412da5){_0x126ef3(null,_[_0xd165('0x4d')](_0x412da5)?![]:!![]);})[_0xd165('0x14')](function(_0x3bbb07){logger[_0xd165('0x2a')](_0x3bbb07);_0x126ef3(null,![]);});};AGIVertices['prototype']['shellCommand']=function(_0x371765,_0x182cc0){sh['exec'](_[_0xd165('0x5e')](_0x371765),function(_0x55d1e2,_0x57ad9a){var _0x54d172=_0x57ad9a[_0xd165('0x5f')](/(\r\n|\n|\r)/gm,'');_0x182cc0(null,_0x54d172);});};AGIVertices['prototype'][_0xd165('0x60')]=function(_0x306824,_0x2bdb1f){scripts['googleCloudTTS'](_0x306824['apiKey'],_0x306824[_0xd165('0x61')]||_0xd165('0x62'),_0x306824[_0xd165('0x62')],_0x306824['languageCode']||_0xd165('0x63'),_0x306824[_0xd165('0x64')]||_0xd165('0x65'),_0x306824[_0xd165('0x66')]||_0xd165('0x67'))['then'](function(_0x384147){_0x2bdb1f(null,_0x384147);})[_0xd165('0x14')](function(_0x186c90){_0x2bdb1f(_0x186c90);});};AGIVertices[_0xd165('0x10')]['googleTTS']=function(_0x28ed45,_0x1f89a1){scripts['googleTTS'](_0x28ed45[_0xd165('0x62')],_0x28ed45[_0xd165('0x68')]||'en',0x1)[_0xd165('0x12')](function(_0x2d41b8){_0x1f89a1(null,_0x2d41b8);})[_0xd165('0x14')](function(_0x3a9938){_0x1f89a1(_0x3a9938);});};AGIVertices[_0xd165('0x10')]['restAPI']=function(_0x3e061e,_0x11facf){var _0x135c9f={'uri':_0x3e061e[_0xd165('0x69')],'method':_0x3e061e['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x3e061e[_0xd165('0x6a')])===_0xd165('0x6b')&&parseInt(_0x3e061e['timeout'])>=0x1?parseInt(_0x3e061e['timeout'])*0x3e8:0x5*0x3e8};if(_[_0xd165('0x6c')]([_0xd165('0x6d'),_0xd165('0x6e')],_0x135c9f['method'][_0xd165('0x6f')]())){try{_0x135c9f[_0xd165('0x70')]=_0x3e061e[_0xd165('0x71')]?JSON['parse'](_0x3e061e[_0xd165('0x71')]):{};}catch(_0x418e16){logger['error'](_0xd165('0x72'),_0x418e16);}}try{_0x135c9f['headers']=_0x3e061e[_0xd165('0x73')]?JSON[_0xd165('0x74')](_0x3e061e['rawHeaders']):{};}catch(_0x35fe4f){logger['error']('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x35fe4f);}if(_0x3e061e['computedVariables']){try{var _0x25d601=require(_0x3e061e[_0xd165('0x75')])[_0xd165('0x76')](this,_0x135c9f);_0x135c9f[_0xd165('0x77')]=Mustache[_0xd165('0x78')](_0x3e061e[_0xd165('0x69')],_0x25d601,{},['$$','$$']);if(_0x135c9f[_0xd165('0x79')]){_0x135c9f[_0xd165('0x79')]=JSON['parse'](Mustache[_0xd165('0x78')](JSON[_0xd165('0x7a')](_0x135c9f['headers']),_0x25d601,{},['$$','$$']));}if(_0x135c9f[_0xd165('0x70')]){_0x135c9f[_0xd165('0x70')]=JSON[_0xd165('0x74')](Mustache['render'](JSON[_0xd165('0x7a')](_0x135c9f[_0xd165('0x70')]),_0x25d601,{},['$$','$$']));}}catch(_0x3f8677){logger[_0xd165('0x2a')](_0xd165('0x7b'),_0x3f8677);}}rp(_0x135c9f)['then'](function(_0x2c58ef){var _0x539a47={'statusCode':_0x2c58ef[_0xd165('0x7c')]||0xc8,'statusMessage':_0x2c58ef[_0xd165('0x7d')]||'OK','headers':_0x2c58ef[_0xd165('0x79')]||{},'body':_0x2c58ef[_0xd165('0x70')]||{}};_0x11facf(null,_0x539a47);})[_0xd165('0x14')](function(_0x38e500){var _0x6226c3={'statusCode':_0x38e500[_0xd165('0x7c')]||0x1f4,'statusMessage':_0x38e500[_0xd165('0x7e')]||_0xd165('0x7f'),'headers':_0x38e500['options']['headers']||{},'body':_0x38e500['options'][_0xd165('0x70')]||{}};_0x11facf(null,_0x6226c3);});};AGIVertices['prototype']['googleDialogflow']=function(_0x549eae,_0x28c943){scripts[_0xd165('0x80')](this[_0xd165('0xe')][_0xd165('0x35')],_0x549eae[_0xd165('0x81')],_0x549eae[_0xd165('0x62')],_0x549eae[_0xd165('0x82')]||'en')[_0xd165('0x12')](function(_0x649b1f){_0x28c943(null,_0x649b1f);})[_0xd165('0x14')](function(_0x5c9cfa){_0x28c943(_0x5c9cfa);});};AGIVertices['prototype']['googleDialogflowV2']=function(_0x363852,_0x463df1){scripts['googleDialogflowV2'](this[_0xd165('0xe')][_0xd165('0x35')],_0x363852[_0xd165('0x83')],_0x363852[_0xd165('0x84')],_0x363852[_0xd165('0x85')],_0x363852[_0xd165('0x62')],_0x363852[_0xd165('0x86')]||'en')['then'](function(_0x430238){_0x463df1(null,_0x430238);})['catch'](function(_0x48d481){_0x463df1(_0x48d481);});};AGIVertices[_0xd165('0x10')][_0xd165('0x87')]=function(_0x1b2a47,_0x1f68af){scripts[_0xd165('0x87')](this[_0xd165('0xe')],_0x1b2a47)[_0xd165('0x12')](function(_0x1c3d10){_0x1f68af(null,_0x1c3d10);})[_0xd165('0x14')](function(_0x491bb6){_0x1f68af(_0x491bb6);});};AGIVertices[_0xd165('0x10')][_0xd165('0x88')]=function(_0x3c88e0,_0x72b715){scripts[_0xd165('0x88')](_0x3c88e0[_0xd165('0x81')],_0x3c88e0['text'],_0x3c88e0[_0xd165('0x89')]||_0xd165('0x63'),_0x3c88e0[_0xd165('0x8a')])['then'](function(_0x53b299){_0x72b715(null,_0x53b299);})[_0xd165('0x14')](function(_0x119288){_0x72b715(_0x119288);});};AGIVertices[_0xd165('0x10')][_0xd165('0x8b')]=function(_0x419aec,_0x15da10,_0x36fa65){scripts[_0xd165('0x8b')](_0x15da10,_0x419aec[_0xd165('0x81')],_0x419aec['ispeech_asr_language']||_0xd165('0x63'),this[_0xd165('0x8c')](_0x419aec[_0xd165('0x8d')])?_0x419aec['model']:undefined)[_0xd165('0x12')](function(_0x145493){_0x36fa65(null,_0x145493);})['catch'](function(_0x180e69){_0x36fa65(_0x180e69);});};AGIVertices[_0xd165('0x10')][_0xd165('0x8e')]=function(_0x4de269,_0x49148e){scripts[_0xd165('0x8e')](_0x4de269[_0xd165('0x8f')],_0x4de269['aws_secret_access_key'],_0x4de269[_0xd165('0x90')],_0x4de269[_0xd165('0x91')]||_0xd165('0x92'),_0x4de269[_0xd165('0x62')],_0x4de269['aws_text_type']||_0xd165('0x62'))[_0xd165('0x12')](function(_0x423427){_0x49148e(null,_0x423427);})[_0xd165('0x14')](function(_0x45bd61){_0x49148e(_0x45bd61);});};AGIVertices[_0xd165('0x10')]['awsLex']=function(_0x56a382,_0x11533e){scripts[_0xd165('0x93')](this[_0xd165('0xe')][_0xd165('0x35')],_0x56a382[_0xd165('0x8f')],_0x56a382[_0xd165('0x94')],_0x56a382[_0xd165('0x95')],_0x56a382[_0xd165('0x62')],_0x56a382[_0xd165('0x96')])[_0xd165('0x12')](function(_0x2884f5){_0x11533e(null,_0x2884f5);})['catch'](function(_0x4a29f2){_0x11533e(_0x4a29f2);});};AGIVertices['prototype'][_0xd165('0x97')]=function(_0x489a6e,_0x25ea4b,_0x5bcf2f){scripts['googleASR'](_0x25ea4b,_0x489a6e[_0xd165('0x81')],_0x489a6e[_0xd165('0x98')]||_0xd165('0x63'))[_0xd165('0x12')](function(_0x7f7526){_0x5bcf2f(null,_0x7f7526);})[_0xd165('0x14')](function(_0x4e3f6d){_0x5bcf2f(_0x4e3f6d);});};AGIVertices['prototype']['tildeASR']=function(_0xe55f38,_0x1c5f1b,_0x186b1b){scripts[_0xd165('0x99')](_0x1c5f1b,_0xe55f38[_0xd165('0x9a')],_0xe55f38[_0xd165('0x9b')],_0xe55f38['uri'])[_0xd165('0x12')](function(_0x527622){_0x186b1b(null,_0x527622);})['catch'](function(_0x1fc741){_0x186b1b(_0x1fc741);});};AGIVertices['prototype'][_0xd165('0x9c')]=function(_0x213bf5){var _0x3bc865=_['includes'](verticesWithRetry,_0x213bf5[_0xd165('0x37')])?_0x213bf5:_[_0xd165('0x9d')](_0x213bf5);for(var _0x5da38f in _0x3bc865){if(_0x3bc865[_0xd165('0x9e')](_0x5da38f)){if(_0x3bc865[_0x5da38f]&&_['isString'](_0x3bc865[_0x5da38f])){if(_[_0xd165('0x6c')](recursiveMapAttributes,_0x5da38f)){_0x3bc865[_0x5da38f]=this[_0xd165('0x9f')](_0x3bc865[_0x5da38f]);}else{_0x3bc865[_0x5da38f]=this[_0xd165('0xa0')](_0x3bc865[_0x5da38f]);}}}}return _0x3bc865;};AGIVertices[_0xd165('0x10')]['recursiveNodeIndex']=function(_0x31aab4){for(var _0x20a2fc in _0x31aab4){if(_0x31aab4['hasOwnProperty'](_0x20a2fc)){if(_[_0xd165('0xa1')](_0x31aab4[_0x20a2fc])){this[_0xd165('0xa2')](_0x31aab4[_0x20a2fc]);}else if(_[_0xd165('0xa3')](_0x31aab4[_0x20a2fc])){for(var _0x56c1c2=0x0;_0x56c1c2<_0x31aab4[_0x20a2fc][_0xd165('0xa4')];_0x56c1c2++){this[_0xd165('0xa2')](_0x31aab4[_0x20a2fc][_0x56c1c2]);}}else if(_[_0xd165('0xa5')](_0x31aab4[_0x20a2fc])){_0x31aab4[_0x20a2fc]=this[_0xd165('0xa0')](_0x31aab4[_0x20a2fc]);}}}};AGIVertices['prototype'][_0xd165('0xa6')]=function(_0x496bf4,_0x39325c){for(var _0x3f33f5 in _0x496bf4){if(_0x496bf4[_0xd165('0x9e')](_0x3f33f5)){if(_[_0xd165('0xa1')](_0x496bf4[_0x3f33f5])){if(!_['isEmpty'](_0x496bf4[_0x3f33f5])){this[_0xd165('0xa6')](_0x496bf4[_0x3f33f5],util[_0xd165('0x5b')]('%s.%s',_0x39325c,_0x3f33f5));}}else if(_[_0xd165('0xa3')](_0x496bf4[_0x3f33f5])){for(var _0x2ebe71=0x0;_0x2ebe71<_0x496bf4[_0x3f33f5][_0xd165('0xa4')];_0x2ebe71++){this['saveRestApiResult'](_0x496bf4[_0x3f33f5][_0x2ebe71],util[_0xd165('0x5b')](_0xd165('0xa7'),_0x39325c,_0x3f33f5+'['+_0x2ebe71+']'));}}else{if(!_[_0xd165('0x4d')](_0x496bf4[_0x3f33f5])){this[_0xd165('0xe')][_0xd165('0xa8')](util[_0xd165('0x5b')]('%s.%s',_0x39325c,_0x3f33f5),_0x496bf4[_0x3f33f5]);}}}}};AGIVertices['prototype'][_0xd165('0x9f')]=function(_0x158566){try{var _0x938f5f=JSON[_0xd165('0x74')](_0x158566);this[_0xd165('0xa2')](_0x938f5f);return JSON[_0xd165('0x7a')](_0x938f5f);}catch(_0xde73b){return this[_0xd165('0xa0')](_0x158566);}};AGIVertices[_0xd165('0x10')][_0xd165('0xa0')]=function(_0x5cab54){var _0x22da67=_0x5cab54[_0xd165('0xa9')]('{');for(var _0x298525=0x1;_0x298525<_0x22da67[_0xd165('0xa4')];_0x298525+=0x1){var _0x3bfb5b=_0x22da67[_0x298525][_0xd165('0xa9')]('}');if(_0x3bfb5b[_0xd165('0xa4')]>0x1){_0x5cab54=_0x5cab54['replaceAll']('{'+_0x3bfb5b[0x0]+'}',this['channel'][_0xd165('0x11')](_0x3bfb5b[0x0])[_0xd165('0xaa')]||_0x3bfb5b[0x0]);}}if(_0x22da67['length']===0x1){return _0x5cab54[_0xd165('0x4a')]();}return this[_0xd165('0xa0')](_0x5cab54);};AGIVertices[_0xd165('0x10')][_0xd165('0xab')]=function(_0x1c9b5c,_0x230a99){var _0x2e19a7=this['channel'][_0xd165('0x11')](_0x1c9b5c);if(_0x2e19a7[_0xd165('0xac')]===-0x1){return _0x2e19a7;}logger['info'](util[_0xd165('0x5b')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x230a99,_0x2e19a7[_0xd165('0xaa')]));return this['channel'][_0xd165('0xa8')](_0x230a99,_0x2e19a7[_0xd165('0xaa')]);};AGIVertices[_0xd165('0x10')][_0xd165('0x8c')]=function(_0x5b6db3){return _0x5b6db3&&_0x5b6db3!=='0'&&_0x5b6db3!=='-1'&&_0x5b6db3!=='';};AGIVertices[_0xd165('0x10')][_0xd165('0xad')]=function(_0x230620){this[_0xd165('0x34')][_0xd165('0x76')](this,_0x230620,'-');_0x230620['retry']=_0x230620[_0xd165('0xad')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xd165('0x10')][_0xd165('0xae')]=function(_0x377379){logger[_0xd165('0x2c')](util[_0xd165('0x5b')](_0xd165('0xaf'),_0x377379[_0xd165('0x36')]));if(!this[_0xd165('0x8c')](_0x377379[_0xd165('0x62')])){return this[_0xd165('0xe')][_0xd165('0xb0')]('no\x20text\x20configured');}var _0x4ee891='\x22'+_0x377379['text']+'\x22';if(this[_0xd165('0x8c')](_0x377379['options'])){_0x4ee891+=','+_0x377379[_0xd165('0xb1')];}var _0x3d65d8=this[_0xd165('0xe')]['exec'](_0xd165('0xb2'),_0x4ee891);if(_0x3d65d8[_0xd165('0xac')]===-0x1){return _0x3d65d8;}return this['channel'][_0xd165('0xb0')](util[_0xd165('0x5b')](_0xd165('0xb3'),_0x4ee891));};AGIVertices[_0xd165('0x10')][_0xd165('0xb4')]=function(_0x15bcef){logger[_0xd165('0x2c')](util[_0xd165('0x5b')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x15bcef['label']));if(!this[_0xd165('0x8c')](_0x15bcef[_0xd165('0xb5')])){return this[_0xd165('0xe')][_0xd165('0xb0')](_0xd165('0xb6'));}var _0x32efc6=_0x15bcef['grammar'];if(this['isConfigured'](_0x15bcef['options'])){_0x32efc6+=','+_0x15bcef['options'];}var _0x5e5824=this[_0xd165('0xe')][_0xd165('0xb7')](_0xd165('0xb8'),_0x32efc6);if(_0x5e5824[_0xd165('0xac')]===-0x1){return _0x5e5824;}var _0x3506d0=this[_0xd165('0xab')](_0xd165('0xb9'),_0xd165('0xba'));if(_0x3506d0[_0xd165('0xac')]===-0x1){return _0x3506d0;}var _0x4537ba=this['getAndSetVariable'](_0xd165('0xbb'),_0xd165('0xbc'));if(_0x4537ba['result']===-0x1){return _0x4537ba;}var _0x50da2a=this[_0xd165('0xab')](_0xd165('0xbd'),_0xd165('0xbe'));if(_0x50da2a[_0xd165('0xac')]===-0x1){return _0x50da2a;}return this[_0xd165('0xe')][_0xd165('0xb0')](util[_0xd165('0x5b')](_0xd165('0xbf'),_0x32efc6));};AGIVertices[_0xd165('0x10')][_0xd165('0xc0')]=function(_0x1028b7){logger[_0xd165('0x2c')](util[_0xd165('0x5b')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x1028b7[_0xd165('0x36')]));return this[_0xd165('0xe')][_0xd165('0xc0')]([_0x1028b7['command'],_0x1028b7[_0xd165('0xc1')]]);};AGIVertices[_0xd165('0x10')]['answer']=function(_0x3e151c){logger['info'](util[_0xd165('0x5b')](_0xd165('0xc2'),_0x3e151c['label']));if(this['isConfigured'](_0x3e151c[_0xd165('0x6a')])){logger[_0xd165('0x2c')](util[_0xd165('0x5b')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x3e151c[_0xd165('0x6a')]));var _0x44a234=this[_0xd165('0xe')][_0xd165('0xc3')](_0x3e151c[_0xd165('0x6a')]);if(_0x44a234[_0xd165('0xac')]===-0x1){return _0x44a234;}}return this[_0xd165('0xe')][_0xd165('0xc4')]();};AGIVertices['prototype'][_0xd165('0x48')]=function(_0x83e28f){logger['info'](util[_0xd165('0x5b')](_0xd165('0xc5'),_0x83e28f[_0xd165('0x36')]));if(!this[_0xd165('0x8c')](_0x83e28f[_0xd165('0x46')])){return this[_0xd165('0xe')][_0xd165('0x2a')](_0x83e28f,_0xd165('0xc6'));}_0x83e28f[_0xd165('0x47')]=moment();if(this[_0xd165('0x8c')](_0x83e28f['delay'])){_0x83e28f['scheduledAt']=moment()[_0xd165('0xc7')](_0x83e28f[_0xd165('0xc8')],_0xd165('0x51'));}if(!this[_0xd165('0x8c')](_0x83e28f['callback_priority'])){_0x83e28f[_0xd165('0x4b')]=0x2;}this[_0xd165('0x42')][_0xd165('0x76')](this,_0x83e28f);return this[_0xd165('0xe')][_0xd165('0xb0')](util['format'](_0xd165('0xc9'),_0x83e28f['phone'],_0x83e28f[_0xd165('0x46')],_0x83e28f['scheduledAt']));};AGIVertices[_0xd165('0x10')][_0xd165('0xca')]=function(_0x5e1453){logger[_0xd165('0x2c')](util['format'](_0xd165('0xcb'),_0x5e1453[_0xd165('0x36')]));var _0x46fcb0=this['channel'][_0xd165('0xb7')](_0x5e1453[_0xd165('0xcc')],_0x5e1453['options']);if(_0x46fcb0[_0xd165('0xac')]===-0x1){return _0x46fcb0;}return this[_0xd165('0xe')][_0xd165('0xb0')](util[_0xd165('0x5b')]('Executed\x20command\x20%s\x20%s',_0x5e1453[_0xd165('0xcc')],_0x5e1453[_0xd165('0xb1')]));};AGIVertices[_0xd165('0x10')]['lumenvoxtts']=function(_0x27f1b1){logger[_0xd165('0x2c')](util['format'](_0xd165('0xcd'),_0x27f1b1['label']));if(!this['isConfigured'](_0x27f1b1['text'])){return this[_0xd165('0xe')]['noop']('no\x20text\x20configured');}var _0x30ddb4='\x22'+_0x27f1b1[_0xd165('0x62')]+'\x22';if(this[_0xd165('0x8c')](_0x27f1b1['options'])){_0x30ddb4+=','+_0x27f1b1['options'];}var _0x1b2a8d=this[_0xd165('0xe')][_0xd165('0xb7')](_0xd165('0xb2'),_0x30ddb4);if(_0x1b2a8d[_0xd165('0xac')]===-0x1){return _0x1b2a8d;}return this[_0xd165('0xe')][_0xd165('0xb0')](util[_0xd165('0x5b')]('Executed\x20command\x20MRCPSynth\x20%s',_0x30ddb4));};AGIVertices[_0xd165('0x10')]['sestektts']=function(_0x369b85){logger[_0xd165('0x2c')](util['format'](_0xd165('0xce'),_0x369b85['label']));if(!this[_0xd165('0x8c')](_0x369b85[_0xd165('0x62')])){return this['channel']['noop'](_0xd165('0xcf'));}var _0x582ff7='\x22'+_0x369b85[_0xd165('0x62')]+'\x22';if(this['isConfigured'](_0x369b85['options'])){_0x582ff7+=','+_0x369b85[_0xd165('0xb1')];}var _0x49c95d=this[_0xd165('0xe')][_0xd165('0xb7')](_0xd165('0xb2'),_0x582ff7);if(_0x49c95d[_0xd165('0xac')]===-0x1){return _0x49c95d;}return this[_0xd165('0xe')][_0xd165('0xb0')](util['format'](_0xd165('0xb3'),_0x582ff7));};AGIVertices['prototype']['lumenvoxasr']=function(_0x42d645){logger[_0xd165('0x2c')](util[_0xd165('0x5b')](_0xd165('0xd0'),_0x42d645[_0xd165('0x36')]));if(!this[_0xd165('0x8c')](_0x42d645[_0xd165('0xb5')])){return this[_0xd165('0xe')][_0xd165('0xb0')]('no\x20grammar\x20configured');}var _0x3c7498=_0x42d645['grammar'];if(this[_0xd165('0x8c')](_0x42d645[_0xd165('0xb1')])){_0x3c7498+=','+_0x42d645[_0xd165('0xb1')];}var _0x4d34da=this[_0xd165('0xe')][_0xd165('0xb7')](_0xd165('0xb8'),_0x3c7498);if(_0x4d34da['result']===-0x1){return _0x4d34da;}var _0x5dc732=this['getAndSetVariable'](_0xd165('0xb9'),_0xd165('0xd1'));if(_0x5dc732[_0xd165('0xac')]===-0x1){return _0x5dc732;}var _0x5e8b9e=this[_0xd165('0xab')]('RECOG_INPUT()',_0xd165('0xd2'));if(_0x5e8b9e[_0xd165('0xac')]===-0x1){return _0x5e8b9e;}var _0x5e05e9=this['getAndSetVariable'](_0xd165('0xbd'),'LUMENVOX_ASR_INSTANCE');if(_0x5e05e9[_0xd165('0xac')]===-0x1){return _0x5e05e9;}return this[_0xd165('0xe')][_0xd165('0xb0')](util['format'](_0xd165('0xbf'),_0x3c7498));};AGIVertices['prototype'][_0xd165('0xd3')]=function(_0x2617bd){logger[_0xd165('0x2c')](util[_0xd165('0x5b')](_0xd165('0xd4'),_0x2617bd[_0xd165('0x36')]));if(!this[_0xd165('0x8c')](_0x2617bd['grammar'])){return this[_0xd165('0xe')][_0xd165('0xb0')](_0xd165('0xb6'));}var _0x3a9e55=_0x2617bd[_0xd165('0xb5')];if(this[_0xd165('0x8c')](_0x2617bd[_0xd165('0xb1')])){_0x3a9e55+=','+_0x2617bd['options'];}var _0x150e3f=this[_0xd165('0xe')][_0xd165('0xb7')](_0xd165('0xb8'),_0x3a9e55);if(_0x150e3f[_0xd165('0xac')]===-0x1){return _0x150e3f;}var _0x385a5b=this[_0xd165('0xab')](_0xd165('0xb9'),_0xd165('0xd5'));if(_0x385a5b['result']===-0x1){return _0x385a5b;}var _0x17ab1f=this[_0xd165('0xab')](_0xd165('0xbb'),_0xd165('0xd6'));if(_0x17ab1f[_0xd165('0xac')]===-0x1){return _0x17ab1f;}var _0x2885cb=this['getAndSetVariable'](_0xd165('0xbd'),_0xd165('0xd7'));if(_0x2885cb[_0xd165('0xac')]===-0x1){return _0x2885cb;}return this[_0xd165('0xe')][_0xd165('0xb0')](util[_0xd165('0x5b')](_0xd165('0xbf'),_0x3a9e55));};AGIVertices[_0xd165('0x10')][_0xd165('0xd8')]=function(_0x5278e7){logger[_0xd165('0x2c')](util['format']('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x5278e7[_0xd165('0x36')]));if(!this[_0xd165('0x8c')](_0x5278e7[_0xd165('0xd9')])){return this[_0xd165('0xe')][_0xd165('0x2a')](_0x5278e7,_0xd165('0xda'));}var _0x568468=this['getSquareOdbc'][_0xd165('0x76')](this,_0x5278e7[_0xd165('0xd9')]);if(!_0x568468){return this[_0xd165('0xe')][_0xd165('0x2a')](_0x5278e7,_0xd165('0xdb'));}if(!this['isConfigured'](_0x5278e7[_0xd165('0x2e')])){return this[_0xd165('0xe')]['error'](_0x5278e7,_0xd165('0xdc'));}var _0x22ac26=_0x5278e7['query']['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0xd165('0xe')][_0xd165('0xb0')](util[_0xd165('0x5b')](_0xd165('0xdd'),_0x22ac26));var _0x2900cd=this[_0xd165('0x29')]['sync'](this,_0x568468,_0x22ac26);this[_0xd165('0x34')][_0xd165('0x76')](this,_0x5278e7,_0x22ac26);if(!this[_0xd165('0x8c')](_0x5278e7['variable_id'])){return this[_0xd165('0xe')][_0xd165('0xb0')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x35b10d=this['getVariable'][_0xd165('0x76')](this,_0x5278e7[_0xd165('0xde')]);if(!_0x35b10d){return this[_0xd165('0xe')][_0xd165('0x2a')](_0x5278e7,'no\x20variable\x20found');}var _0x4d6a25=this;_0x2900cd[_0xd165('0xdf')](function(_0x270be9,_0xb76ac){Object[_0xd165('0xe0')](_0x270be9)[_0xd165('0xdf')](function(_0xfe113c){_0x4d6a25[_0xd165('0xe')][_0xd165('0xa8')](util[_0xd165('0x5b')](_0xd165('0xe1'),_0x35b10d,_0xb76ac,_0xfe113c),_0x270be9[_0xfe113c]);});});this[_0xd165('0xe')]['setVariable'](util[_0xd165('0x5b')](_0xd165('0xe2'),_0x35b10d),_0x2900cd[_0xd165('0xa4')]);return this[_0xd165('0xe')][_0xd165('0xb0')](util[_0xd165('0x5b')]('variable\x20%s\x20set',_0x35b10d));};AGIVertices['prototype'][_0xd165('0xe3')]=function(_0x3dd48){logger[_0xd165('0xe4')](util[_0xd165('0x5b')](_0xd165('0xe5'),_0x3dd48[_0xd165('0x36')]));if(!this[_0xd165('0x8c')](_0x3dd48['sip_id'])){return this[_0xd165('0xe')][_0xd165('0x2a')](_0x3dd48,_0xd165('0xe6'));}var _0x12daa4=this['getUser']['sync'](this,_0x3dd48[_0xd165('0xe7')]);if(!_0x12daa4){return this[_0xd165('0xe')]['error'](_0x3dd48,_0xd165('0xe8'));}var _0x13948b=this[_0xd165('0xe')]['exec'](_0xd165('0xe9'),[util[_0xd165('0x5b')](_0xd165('0xea'),_0x12daa4),_0x3dd48[_0xd165('0x6a')],_0x3dd48[_0xd165('0xeb')],_0x3dd48[_0xd165('0x69')]]);if(_0x13948b[_0xd165('0xac')]===-0x1){return _0x13948b;}return this['channel'][_0xd165('0xb0')](util[_0xd165('0x5b')](_0xd165('0xec'),_0xd165('0xe9')));};AGIVertices[_0xd165('0x10')][_0xd165('0xed')]=function(_0xd7b88f){logger[_0xd165('0x2c')](util[_0xd165('0x5b')](_0xd165('0xee'),_0xd7b88f[_0xd165('0x36')]));if(!this[_0xd165('0x8c')](_0xd7b88f[_0xd165('0x81')])){return this[_0xd165('0xe')][_0xd165('0xb0')](_0xd165('0xef'));}if(!this[_0xd165('0x8c')](_0xd7b88f[_0xd165('0x62')])){return this['channel'][_0xd165('0xb0')](_0xd165('0xcf'));}this['channel'][_0xd165('0xf0')]=!![];this['createSquareDetailsReport'](_0xd7b88f);this['createSquareMessage'](_0xd7b88f['text'],'in','','');this[_0xd165('0xe')][_0xd165('0xb0')](util[_0xd165('0x5b')](_0xd165('0xf1'),_0xd7b88f[_0xd165('0x62')]));var _0x8e295a=this['googleDialogflow'][_0xd165('0x76')](this,_0xd7b88f);if(_0x8e295a){for(var _0x3baa6a in _0x8e295a){if(_0x8e295a[_0xd165('0x9e')](_0x3baa6a)){this[_0xd165('0xe')][_0xd165('0xa8')](util[_0xd165('0x5b')]('DIALOGFLOW_%s',_0x3baa6a[_0xd165('0x6f')]()),_0x8e295a[_0x3baa6a]);}}this[_0xd165('0x41')](_0x8e295a[_0xd165('0xf2')],'out',_0xd165('0xed'),'');return this[_0xd165('0xe')][_0xd165('0xb0')](util[_0xd165('0x5b')](_0xd165('0xf3'),_0x8e295a[_0xd165('0xf2')]));}return this['channel'][_0xd165('0x2a')](_0xd7b88f,_0xd165('0xf4'));};AGIVertices[_0xd165('0x10')][_0xd165('0xf5')]=function(_0x4ee540){logger['info'](util[_0xd165('0x5b')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x4ee540[_0xd165('0x36')]));if(!this[_0xd165('0x8c')](_0x4ee540[_0xd165('0x83')])){return this[_0xd165('0xe')][_0xd165('0xb0')](_0xd165('0xf6'));}if(!this[_0xd165('0x8c')](_0x4ee540[_0xd165('0x84')])){return this['channel']['noop'](_0xd165('0xf7'));}if(!this['isConfigured'](_0x4ee540[_0xd165('0x85')])){return this[_0xd165('0xe')][_0xd165('0xb0')]('no\x20private_key\x20configured');}if(!this[_0xd165('0x8c')](_0x4ee540[_0xd165('0x86')])){return this[_0xd165('0xe')][_0xd165('0xb0')](_0xd165('0xf8'));}if(!this['isConfigured'](_0x4ee540[_0xd165('0x62')])){return this[_0xd165('0xe')][_0xd165('0xb0')]('no\x20text\x20configured');}this['channel'][_0xd165('0xf0')]=!![];this[_0xd165('0x34')](_0x4ee540);this[_0xd165('0x41')](_0x4ee540[_0xd165('0x62')],'in','','');this[_0xd165('0xe')][_0xd165('0xb0')](util[_0xd165('0x5b')](_0xd165('0xf9'),_0x4ee540[_0xd165('0x62')]));var _0x2246ff=this['googleDialogflowV2']['sync'](this,_0x4ee540);if(_0x2246ff){for(var _0x1dda50 in _0x2246ff){if(_0x2246ff[_0xd165('0x9e')](_0x1dda50)){if(_0x1dda50!==_0xd165('0xfa')){this[_0xd165('0xe')][_0xd165('0xa8')](util[_0xd165('0x5b')]('DIALOGFLOW_%s',_0x1dda50[_0xd165('0x6f')]()),_0x2246ff[_0x1dda50]);}}}this[_0xd165('0x41')](_0x2246ff[_0xd165('0xf2')],_0xd165('0xfb'),'dialogflowV2',_0x2246ff[_0xd165('0xfa')]);return this[_0xd165('0xe')][_0xd165('0xb0')](util[_0xd165('0x5b')]('DialogflowV2\x20Result\x20%s',_0x2246ff[_0xd165('0xf2')]));}return this['channel'][_0xd165('0x2a')](_0x4ee540,_0xd165('0xfc'));};AGIVertices[_0xd165('0x10')]['sesteknda']=function(_0x5b5ed0){logger[_0xd165('0x2c')](util['format'](_0xd165('0xfd'),_0x5b5ed0['label']));if(!this[_0xd165('0x8c')](_0x5b5ed0['ndauth_url'])){return this[_0xd165('0xe')][_0xd165('0xb0')]('no\x20ndauth\x20url\x20configured');}if(!this[_0xd165('0x8c')](_0x5b5ed0[_0xd165('0xfe')])){return this[_0xd165('0xe')][_0xd165('0xb0')](_0xd165('0xff'));}if(!this[_0xd165('0x8c')](_0x5b5ed0['password'])){return this['channel']['noop'](_0xd165('0x100'));}if(!this[_0xd165('0x8c')](_0x5b5ed0['ndassistant_url'])){return this[_0xd165('0xe')][_0xd165('0xb0')](_0xd165('0xcf'));}this['channel']['bot']=!![];this[_0xd165('0x34')](_0x5b5ed0);this['createSquareMessage'](_0x5b5ed0[_0xd165('0x62')],'in','','');this[_0xd165('0xe')][_0xd165('0xb0')](util[_0xd165('0x5b')](_0xd165('0x101'),_0x5b5ed0['text']));var _0x516b3d=this[_0xd165('0x87')]['sync'](this,_0x5b5ed0);if(_0x516b3d){for(var _0x380981 in _0x516b3d){if(_0x516b3d[_0xd165('0x9e')](_0x380981)){this[_0xd165('0xe')][_0xd165('0xa8')](util[_0xd165('0x5b')](_0xd165('0x102'),_0x380981[_0xd165('0x6f')]()),_0x516b3d[_0x380981]);}}this[_0xd165('0x41')](_0x516b3d[_0xd165('0xf2')],_0xd165('0xfb'),'sesteknda','');if(_0x516b3d['audiofile']){this[_0xd165('0xe')][_0xd165('0xb0')](util[_0xd165('0x5b')](_0xd165('0x103'),_0x516b3d[_0xd165('0x104')]));var _0x32f25e=this[_0xd165('0xe')][_0xd165('0x105')](_0x516b3d['audiofile']);try{fs['unlink'](_0x516b3d[_0xd165('0x104')]+_0xd165('0x106'));}catch(_0x44fb9f){logger[_0xd165('0x2a')](_0x44fb9f);}return _0x32f25e;}else{return this['channel'][_0xd165('0xb0')](util[_0xd165('0x5b')](_0xd165('0x107'),_0x516b3d[_0xd165('0xf2')]));}}return this[_0xd165('0xe')]['error'](_0x5b5ed0,_0xd165('0x108'));};AGIVertices[_0xd165('0x10')][_0xd165('0x109')]=function(_0x43413e){logger[_0xd165('0x2c')](util[_0xd165('0x5b')](_0xd165('0x10a'),_0x43413e[_0xd165('0x36')]));return this[_0xd165('0xe')][_0xd165('0xb0')](_0xd165('0x109'));};AGIVertices[_0xd165('0x10')][_0xd165('0x10b')]=function(_0x325326){logger[_0xd165('0x2c')](util['format'](_0xd165('0x10c'),_0x325326['label']));var _0x47b651='';if(_0x325326[_0xd165('0x10d')]){if(!this[_0xd165('0x8c')](_0x325326['trunk_id'])){return this[_0xd165('0xe')]['error'](_0x325326,'no\x20trunk\x20selected');}else{var _0x5850a8=parseInt(_0x325326[_0xd165('0x10d')],0xa);if(isNaN(_0x5850a8)){_0x47b651=_0x325326[_0xd165('0x10d')];}else{_0x47b651=this[_0xd165('0x1a')][_0xd165('0x76')](this,_0x325326[_0xd165('0x10d')]);if(!_0x47b651){return this[_0xd165('0xe')]['error'](_0x325326,'no\x20trunk\x20found');}}}}else if(_0x325326[_0xd165('0x10e')]){_0x47b651=_0x325326[_0xd165('0x10e')];}else{return this[_0xd165('0xe')]['error'](_0x325326,_0xd165('0x10f'));}var _0x116ce1=this[_0xd165('0xe')][_0xd165('0xb7')]('DIAL',[util[_0xd165('0x5b')](_0xd165('0x110'),_0x47b651,_0x325326['phone']),_0x325326[_0xd165('0x6a')],_0x325326[_0xd165('0xeb')],_0x325326[_0xd165('0x69')]]);if(_0x116ce1[_0xd165('0xac')]===-0x1){return _0x116ce1;}return this[_0xd165('0xe')][_0xd165('0xb0')](util[_0xd165('0x5b')]('Executed\x20command\x20%s',_0xd165('0xe9')));};AGIVertices['prototype'][_0xd165('0x111')]=function(_0x4bf540){logger[_0xd165('0x2c')](util[_0xd165('0x5b')](_0xd165('0x112'),_0x4bf540[_0xd165('0x36')]));return this[_0xd165('0xe')][_0xd165('0xb0')](_0xd165('0x111'));};AGIVertices['prototype'][_0xd165('0xc')]=function(_0x345880){logger['info'](util['format'](_0xd165('0x113'),_0x345880['label']));if(_0x345880[_0xd165('0x114')]===0x0){return this[_0xd165('0xad')](_0x345880);}_0x345880['retry']-=0x1;if(!this['isConfigured'](_0x345880[_0xd165('0x115')])){return this[_0xd165('0xe')][_0xd165('0x2a')](_0x345880,_0xd165('0x116'));}var _0x205c91=this[_0xd165('0x117')][_0xd165('0x76')](this,_0x345880[_0xd165('0x115')]);if(!_0x205c91){return this[_0xd165('0xe')][_0xd165('0x2a')](_0x345880,_0xd165('0x118'));}if(!this[_0xd165('0x8c')](_0x345880[_0xd165('0xde')])){return this['channel'][_0xd165('0x2a')](_0xd165('0x119'));}var _0x568a52=this[_0xd165('0xe')][_0xd165('0x11a')](_0x205c91,_0x345880['response'],_0x345880[_0xd165('0x11b')]);var _0x13c947=_0x568a52['result']?_0x568a52[_0xd165('0xac')][_0xd165('0x4a')]():'';logger[_0xd165('0x2c')]('test',JSON[_0xd165('0x7a')](_0x568a52));if(_0x568a52[_0xd165('0xac')]===-0x1){this[_0xd165('0x34')][_0xd165('0x76')](this,_0x345880,_0x13c947);return _0x568a52;}else if(_0x568a52['extra']===_0xd165('0x6a')){_0x568a52[_0xd165('0xac')]=_0x13c947['length']>=parseInt(_0x345880['mindigit'])?'x':'i';}else{_0x568a52['result']=_0x13c947[_0xd165('0xa4')]>=parseInt(_0x345880[_0xd165('0x11c')])&&_0x13c947['length']<=parseInt(_0x345880[_0xd165('0x11b')])?'x':'i';}var _0x59ba96=this['getVariable'][_0xd165('0x76')](this,_0x345880[_0xd165('0xde')]);if(!_0x59ba96){return this[_0xd165('0xe')][_0xd165('0x2a')](_0x345880,_0xd165('0x11d'));}this[_0xd165('0xe')][_0xd165('0xa8')](_0x59ba96,_0x13c947);if(this['isConfigured'](_0x345880['hiddendigitsnum'])){var _0x1a39b7=parseInt(_0x345880['hiddendigitsnum'],0xa);var _0x1e9335=rs[_0xd165('0x11e')]({'charset':'*','length':_0x1a39b7});var _0x3b0d71=_0x13c947[_0xd165('0xa4')];if(_0x3b0d71>0x0){if(_0x3b0d71>_0x1a39b7){this['createSquareDetailsReport'][_0xd165('0x76')](this,_0x345880,_0x345880[_0xd165('0x11f')]===_0xd165('0x120')?_0x1e9335+_0x13c947['substr'](_0x1a39b7):_0x13c947[_0xd165('0x121')](0x0,_0x3b0d71-_0x1a39b7)+_0x1e9335);}else{this[_0xd165('0x34')][_0xd165('0x76')](this,_0x345880,rs[_0xd165('0x11e')]({'charset':'*','length':_0x3b0d71}));}}else{this['createSquareDetailsReport'][_0xd165('0x76')](this,_0x345880,'');}}else{this[_0xd165('0x34')][_0xd165('0x76')](this,_0x345880,_0x13c947);}return _0x568a52;};AGIVertices[_0xd165('0x10')][_0xd165('0xd')]=function(_0x589f8f){logger[_0xd165('0x2c')](util[_0xd165('0x5b')](_0xd165('0x122'),_0x589f8f[_0xd165('0x36')]));return this['getdigits'](_0x589f8f);};AGIVertices[_0xd165('0x10')][_0xd165('0x123')]=function(_0x362618){logger['info'](util[_0xd165('0x5b')](_0xd165('0x124'),_0x362618['label']));this[_0xd165('0x34')][_0xd165('0x76')](this,_0x362618,_0x362618[_0xd165('0x125')]);return this['channel'][_0xd165('0xb0')](util[_0xd165('0x5b')](_0xd165('0x126'),_0x362618[_0xd165('0x125')]));};AGIVertices[_0xd165('0x10')][_0xd165('0x127')]=function(_0xe4b012){logger[_0xd165('0x2c')](util[_0xd165('0x5b')](_0xd165('0x128'),_0xe4b012[_0xd165('0x36')]));if(!this[_0xd165('0x8c')](_0xe4b012[_0xd165('0x8f')])||!this[_0xd165('0x8c')](_0xe4b012[_0xd165('0x94')])){return this[_0xd165('0xe')]['noop'](_0xd165('0x129'));}if(!this['isConfigured'](_0xe4b012[_0xd165('0x62')])){return this[_0xd165('0xe')][_0xd165('0xb0')]('no\x20text\x20configured');}this[_0xd165('0xe')][_0xd165('0xb0')](util[_0xd165('0x5b')]('Trying\x20aws\x20Polly\x20%s',_0xe4b012[_0xd165('0x62')]));var _0x40f120=this[_0xd165('0x8e')][_0xd165('0x76')](this,_0xe4b012);if(_0x40f120){this['channel'][_0xd165('0xb0')](util[_0xd165('0x5b')](_0xd165('0x12a'),_0x40f120));var _0x378ff9=this[_0xd165('0xe')][_0xd165('0x105')](_0x40f120);try{fs[_0xd165('0x12b')](_0x40f120+'.wav');}catch(_0x5ebc19){logger[_0xd165('0x2a')](_0x5ebc19);}return _0x378ff9;}return this[_0xd165('0xe')][_0xd165('0x2a')](_0xe4b012,_0xd165('0x12c'));};AGIVertices[_0xd165('0x10')][_0xd165('0x12d')]=function(_0x27f2e2){logger['info'](util['format'](_0xd165('0x12e'),_0x27f2e2['label']));if(!this[_0xd165('0x8c')](_0x27f2e2[_0xd165('0x8f')])||!this['isConfigured'](_0x27f2e2[_0xd165('0x94')])){return this[_0xd165('0xe')][_0xd165('0xb0')]('no\x20valid\x20credentials\x20configured');}if(!this[_0xd165('0x8c')](_0x27f2e2['aws_bot_name'])){return this['channel'][_0xd165('0xb0')](_0xd165('0x12f'));}if(!this['isConfigured'](_0x27f2e2[_0xd165('0x62')])){return this[_0xd165('0xe')]['noop'](_0xd165('0xcf'));}this[_0xd165('0xe')][_0xd165('0xf0')]=!![];this[_0xd165('0x34')](_0x27f2e2);this[_0xd165('0x41')](_0x27f2e2['text'],'in','','');this[_0xd165('0xe')][_0xd165('0xb0')](util[_0xd165('0x5b')](_0xd165('0x130'),_0x27f2e2[_0xd165('0x62')]));var _0x586d5f=this['awsLex'][_0xd165('0x76')](this,_0x27f2e2);if(_0x586d5f){for(var _0x3ce74a in _0x586d5f){if(_0x586d5f[_0xd165('0x9e')](_0x3ce74a)&&_['isString'](_0x586d5f[_0x3ce74a])){this['channel']['setVariable'](util[_0xd165('0x5b')]('AWS_LEX_%s',_0x3ce74a[_0xd165('0x6f')]()),_0x586d5f[_0x3ce74a]);}}if(_[_0xd165('0x4d')](_0x586d5f['message'])){return this[_0xd165('0xe')][_0xd165('0xb0')](_0xd165('0x131'));}else{this['createSquareMessage'](_0x586d5f[_0xd165('0x7e')],_0xd165('0xfb'),_0xd165('0x132'),'');return this[_0xd165('0xe')]['noop'](util['format'](_0xd165('0x133'),_0x586d5f['message']));}}return this[_0xd165('0xe')][_0xd165('0x2a')](_0x27f2e2,_0xd165('0x134'));};AGIVertices[_0xd165('0x10')]['googleasr']=function(_0x3101b5){logger[_0xd165('0x2c')](util[_0xd165('0x5b')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x3101b5[_0xd165('0x36')],_0x3101b5[_0xd165('0x6a')]));if(!this[_0xd165('0x8c')](_0x3101b5['key'])){return this[_0xd165('0xe')][_0xd165('0xb0')](_0xd165('0xef'));}var _0x32c5d5=_0xd165('0x135');var _0x3653bf=util[_0xd165('0x5b')](_0xd165('0x136'),FILES_PATH,rs[_0xd165('0x11e')](0x4));var _0xc9787a=util[_0xd165('0x5b')](_0xd165('0xa7'),_0x3653bf,_0x32c5d5);var _0xc749=!![];if(_0x3101b5['beep']===_0xd165('0x137')){_0xc749=![];}var _0x2870f9=this['channel'][_0xd165('0x138')](_0x3653bf,_0x32c5d5,_0x3101b5[_0xd165('0x139')],_0x3101b5[_0xd165('0x6a')],undefined,_0xc749);if(_0x2870f9[_0xd165('0xac')]!==-0x1){this[_0xd165('0xe')][_0xd165('0xb0')](util[_0xd165('0x5b')](_0xd165('0x13a'),_0xc9787a));var _0x505db9=this[_0xd165('0x97')][_0xd165('0x76')](this,_0x3101b5,_0xc9787a);if(_0x505db9){for(var _0x39f471 in _0x505db9){if(_0x505db9['hasOwnProperty'](_0x39f471)){this[_0xd165('0xe')]['setVariable'](util[_0xd165('0x5b')](_0xd165('0x13b'),_0x39f471[_0xd165('0x6f')]()),_0x505db9[_0x39f471]);}}return this[_0xd165('0xe')][_0xd165('0xb0')](util[_0xd165('0x5b')]('GoogleASR\x20Result\x20%s',JSON[_0xd165('0x7a')](_0x505db9)));}}return _0x2870f9;};AGIVertices[_0xd165('0x10')][_0xd165('0x13c')]=function(_0x51551f){logger[_0xd165('0x2c')](util['format'](_0xd165('0x13d'),_0x51551f[_0xd165('0x36')]));if(!this[_0xd165('0x8c')](_0x51551f[_0xd165('0x9a')])){return this[_0xd165('0xe')][_0xd165('0xb0')](_0xd165('0x13e'));}if(!this['isConfigured'](_0x51551f[_0xd165('0x9b')])){return this[_0xd165('0xe')][_0xd165('0xb0')]('no\x20appsecret\x20configured');}var _0x54d641=_0xd165('0x135');var _0x5b8065=util[_0xd165('0x5b')](_0xd165('0x136'),FILES_PATH,rs[_0xd165('0x11e')](0x4));var _0x2e81e4=util['format'](_0xd165('0xa7'),_0x5b8065,_0x54d641);var _0xaf3e3d=!![];if(_0x51551f['beep']==='NOBEEP'){_0xaf3e3d=![];}var _0x5173f3=this[_0xd165('0xe')][_0xd165('0x138')](_0x5b8065,_0x54d641,_0x51551f[_0xd165('0x139')],_0x51551f['timeout'],undefined,_0xaf3e3d);if(_0x5173f3['result']!==-0x1){this[_0xd165('0xe')]['noop'](util[_0xd165('0x5b')](_0xd165('0x13f'),_0x2e81e4));var _0x4d2ac9=this[_0xd165('0x99')][_0xd165('0x76')](this,_0x51551f,_0x2e81e4);if(_0x4d2ac9){for(var _0x25e17d in _0x4d2ac9){if(_0x4d2ac9[_0xd165('0x9e')](_0x25e17d)){this[_0xd165('0xe')]['setVariable'](util[_0xd165('0x5b')](_0xd165('0x140'),_0x25e17d[_0xd165('0x6f')]()),_0x4d2ac9[_0x25e17d]);}}return this[_0xd165('0xe')][_0xd165('0xb0')](util['format'](_0xd165('0x141'),JSON[_0xd165('0x7a')](_0x4d2ac9)));}}return _0x5173f3;};AGIVertices[_0xd165('0x10')][_0xd165('0x142')]=function(_0x1d125a){logger[_0xd165('0x2c')](util[_0xd165('0x5b')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x1d125a[_0xd165('0x36')]));return this[_0xd165('0xe')][_0xd165('0x143')](_0x1d125a[_0xd165('0x3c')],_0x1d125a[_0xd165('0x144')],_0x1d125a['priority']);};AGIVertices[_0xd165('0x10')]['gotoif']=function(_0x546c93){logger[_0xd165('0x2c')](util[_0xd165('0x5b')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x546c93['label']));if(!this[_0xd165('0x8c')](_0x546c93[_0xd165('0x145')])){return this[_0xd165('0xe')][_0xd165('0x2a')](_0x546c93,_0xd165('0x146'));}try{var _0x277958=eval(_0x546c93[_0xd165('0x145')])?_0xd165('0x147'):_0xd165('0x148');this['channel'][_0xd165('0xb0')](util['format'](_0xd165('0x149'),_0x546c93[_0xd165('0x145')],_0x277958));return{'code':0xc8,'result':_0x277958};}catch(_0x39cc2e){return{'code':0xc8,'result':_0xd165('0x148')};}};AGIVertices[_0xd165('0x10')][_0xd165('0x14a')]=function(_0x19df6c){logger[_0xd165('0x2c')](util[_0xd165('0x5b')](_0xd165('0x14b'),_0x19df6c[_0xd165('0x36')]));if(!this['isConfigured'](_0x19df6c[_0xd165('0x14c')])){return this[_0xd165('0xe')]['error'](_0x19df6c,_0xd165('0x14d'));}var _0x3aec2e=this[_0xd165('0x14e')][_0xd165('0x76')](this,_0x19df6c[_0xd165('0x14c')]);if(!_0x3aec2e){return this[_0xd165('0xe')]['error'](_0x19df6c,_0xd165('0x14f'));}for(var _0xbf78e7=0x0;_0xbf78e7<_0x3aec2e[_0xd165('0xa4')];_0xbf78e7+=0x1){var _0x4a5a1c=this['channel'][_0xd165('0x11')](util[_0xd165('0x5b')](_0xd165('0x150'),_0x3aec2e[_0xbf78e7]));if(_0x4a5a1c[_0xd165('0xac')]===-0x1){return _0x4a5a1c;}logger[_0xd165('0x2c')](util['format'](_0xd165('0x151'),_0x3aec2e[_0xbf78e7],_0x4a5a1c[_0xd165('0xaa')]));if(_0x4a5a1c[_0xd165('0xaa')]===_0xd165('0x147')){logger[_0xd165('0x2c')](util[_0xd165('0x5b')]('IFTIME\x20%s\x20%s',_0x3aec2e[_0xbf78e7],_0xd165('0x147')));this[_0xd165('0xe')][_0xd165('0xb0')](util[_0xd165('0x5b')](_0xd165('0x151'),_0x3aec2e[_0xbf78e7],_0xd165('0x147')));return{'code':0xc8,'result':_0xd165('0x147')};}else{logger[_0xd165('0x2c')](util['format'](_0xd165('0x151'),_0x3aec2e[_0xbf78e7],'false'));this['channel'][_0xd165('0xb0')](util[_0xd165('0x5b')]('IFTIME\x20%s\x20%s',_0x3aec2e[_0xbf78e7],'false'));}}return{'code':0xc8,'result':_0xd165('0x148')};};AGIVertices[_0xd165('0x10')]['hangup']=function(_0x338dcd){logger[_0xd165('0x2c')](util['format'](_0xd165('0x152'),_0x338dcd[_0xd165('0x36')]));return this[_0xd165('0xe')][_0xd165('0x153')]();};AGIVertices[_0xd165('0x10')][_0xd165('0x154')]=function(_0x3c628d){logger['info'](util[_0xd165('0x5b')](_0xd165('0x155'),_0x3c628d['label']));if(!this['isConfigured'](_0x3c628d['key'])){return this['channel']['noop']('no\x20key\x20configured');}var _0x4a2515='wav';var _0x3f3550=util[_0xd165('0x5b')](_0xd165('0x136'),FILES_PATH,rs[_0xd165('0x11e')](0x4));var _0x30d2e7=util[_0xd165('0x5b')](_0xd165('0xa7'),_0x3f3550,_0x4a2515);var _0x3ad340=!![];if(_0x3c628d[_0xd165('0x156')]==='NOBEEP'){_0x3ad340=![];}var _0x36f5df=this[_0xd165('0xe')][_0xd165('0x138')](_0x3f3550,_0x4a2515,_0x3c628d[_0xd165('0x139')],_0x3c628d[_0xd165('0x6a')],undefined,_0x3ad340);if(_0x36f5df[_0xd165('0xac')]!==-0x1){this[_0xd165('0xe')]['noop'](util[_0xd165('0x5b')](_0xd165('0x157'),_0x30d2e7));var _0x32d188=this['ispeechASR']['sync'](this,_0x3c628d,_0x30d2e7);if(_0x32d188){for(var _0x58343f in _0x32d188){if(_0x32d188[_0xd165('0x9e')](_0x58343f)){this[_0xd165('0xe')][_0xd165('0xa8')](util[_0xd165('0x5b')](_0xd165('0x158'),_0x58343f[_0xd165('0x6f')]()),_0x32d188[_0x58343f]);}}return this[_0xd165('0xe')][_0xd165('0xb0')](util['format'](_0xd165('0x159'),JSON['stringify'](_0x32d188)));}}return _0x36f5df;};AGIVertices[_0xd165('0x10')][_0xd165('0x15a')]=function(_0x1edb95){logger[_0xd165('0x2c')](util[_0xd165('0x5b')](_0xd165('0x15b'),_0x1edb95['label']));if(!this[_0xd165('0x8c')](_0x1edb95['key'])){return this['channel'][_0xd165('0xb0')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x1edb95[_0xd165('0x62')])){return this[_0xd165('0xe')][_0xd165('0xb0')](_0xd165('0xcf'));}this['channel'][_0xd165('0xb0')](util[_0xd165('0x5b')]('Trying\x20ispeech\x20TTS\x20%s',_0x1edb95[_0xd165('0x62')]));var _0x4c6236=this[_0xd165('0x88')][_0xd165('0x76')](this,_0x1edb95);if(_0x4c6236){this['channel'][_0xd165('0xb0')](util[_0xd165('0x5b')](_0xd165('0x157'),_0x4c6236));var _0x5a9082=this['channel']['streamFile'](_0x4c6236,_0x1edb95['intKey']);try{fs[_0xd165('0x12b')](_0x4c6236+'.wav');}catch(_0x55e055){logger[_0xd165('0x2a')](_0x55e055);}return _0x5a9082;}return this[_0xd165('0xe')][_0xd165('0x2a')](_0x1edb95,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0xd165('0x15c')]=function(_0x1dffcd){logger[_0xd165('0x2c')](util['format'](_0xd165('0x15d'),_0x1dffcd[_0xd165('0x36')]));if(!this[_0xd165('0x8c')](_0x1dffcd[_0xd165('0x15e')])){return this['channel'][_0xd165('0x2a')](_0x1dffcd,_0xd165('0x15f'));}logger[_0xd165('0x2c')](util[_0xd165('0x5b')](_0xd165('0x160'),this['channel'][_0xd165('0x39')],_0x1dffcd[_0xd165('0x15e')]));var _0x111b20=this['agentLogin']['sync'](this,_0x1dffcd[_0xd165('0x15e')]);if(_0x111b20){logger[_0xd165('0x2c')](util[_0xd165('0x5b')](_0xd165('0x161'),this[_0xd165('0xe')][_0xd165('0x39')],_0x1dffcd[_0xd165('0x15e')]));this[_0xd165('0xe')][_0xd165('0xb0')](util[_0xd165('0x5b')](_0xd165('0x161'),this['channel'][_0xd165('0x39')],_0x1dffcd[_0xd165('0x15e')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xd165('0xe')][_0xd165('0x39')],_0x1dffcd[_0xd165('0x15e')]));this[_0xd165('0xe')][_0xd165('0xb0')](util[_0xd165('0x5b')](_0xd165('0x162'),this[_0xd165('0xe')]['callerid'],_0x1dffcd[_0xd165('0x15e')]));return{'code':0xc8,'result':_0xd165('0x163')};}};AGIVertices[_0xd165('0x10')][_0xd165('0x164')]=function(_0x2bb44f){logger[_0xd165('0x2c')](util[_0xd165('0x5b')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x2bb44f[_0xd165('0x36')]));if(!this['isConfigured'](_0x2bb44f[_0xd165('0x15e')])){return this[_0xd165('0xe')][_0xd165('0x2a')](_0x2bb44f,'no\x20find\x20by\x20configured');}logger[_0xd165('0x2c')](util[_0xd165('0x5b')](_0xd165('0x160'),this[_0xd165('0xe')][_0xd165('0x39')],_0x2bb44f[_0xd165('0x15e')]));var _0x5664eb=this['agentLogout'][_0xd165('0x76')](this,_0x2bb44f[_0xd165('0x15e')]);if(_0x5664eb){logger['info'](util[_0xd165('0x5b')](_0xd165('0x161'),this[_0xd165('0xe')][_0xd165('0x39')],_0x2bb44f[_0xd165('0x15e')]));this['channel'][_0xd165('0xb0')](util[_0xd165('0x5b')](_0xd165('0x161'),this[_0xd165('0xe')][_0xd165('0x39')],_0x2bb44f['findBy']));return{'code':0xc8,'result':_0xd165('0x165')};}else{logger[_0xd165('0x2c')](util[_0xd165('0x5b')](_0xd165('0x162'),this[_0xd165('0xe')]['callerid'],_0x2bb44f[_0xd165('0x15e')]));this[_0xd165('0xe')]['noop'](util[_0xd165('0x5b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xd165('0xe')]['callerid'],_0x2bb44f[_0xd165('0x15e')]));return{'code':0xc8,'result':_0xd165('0x163')};}};AGIVertices[_0xd165('0x10')]['math']=function(_0x2ec47e){logger[_0xd165('0x2c')](util[_0xd165('0x5b')](_0xd165('0x166'),_0x2ec47e[_0xd165('0x36')]));if(!this['isConfigured'](_0x2ec47e[_0xd165('0x167')])){return this[_0xd165('0xe')]['error'](_0x2ec47e,_0xd165('0x168'));}this[_0xd165('0xe')][_0xd165('0xb0')](util[_0xd165('0x5b')](_0xd165('0x169'),_0x2ec47e[_0xd165('0x167')]));var _0x1b847a=eval(_0x2ec47e[_0xd165('0x167')]);if(!this[_0xd165('0x8c')](_0x2ec47e[_0xd165('0xde')])){return this[_0xd165('0xe')][_0xd165('0xb0')](_0xd165('0x119'));}var _0x5327af=this[_0xd165('0x11')][_0xd165('0x76')](this,_0x2ec47e[_0xd165('0xde')]);if(!_0x5327af){return this['channel'][_0xd165('0x2a')](_0x2ec47e,_0xd165('0x11d'));}if(_['isArray'](_0x1b847a)){var _0x5c490e=this;_0x1b847a['forEach'](function(_0xde142a,_0x2b1fd3){_0x5c490e[_0xd165('0xe')]['setVariable'](util[_0xd165('0x5b')](_0xd165('0x16a'),_0x5327af,_0x2b1fd3),_0xde142a);});return this[_0xd165('0xe')][_0xd165('0xb0')](util[_0xd165('0x5b')]('variable\x20%s[key]\x20set',_0x5327af));}else{return this['channel']['setVariable'](_0x5327af,_0x1b847a);}};AGIVertices[_0xd165('0x10')][_0xd165('0xb')]=function(_0x286b1b){logger['info'](util[_0xd165('0x5b')](_0xd165('0x16b'),_0x286b1b[_0xd165('0x36')]));if(_0x286b1b['retry']===0x0){return this[_0xd165('0xad')](_0x286b1b);}_0x286b1b[_0xd165('0x114')]-=0x1;if(!this[_0xd165('0x8c')](_0x286b1b[_0xd165('0x115')])){return this[_0xd165('0xe')]['error'](_0x286b1b,_0xd165('0x116'));}var _0x3685b9=this[_0xd165('0x117')][_0xd165('0x76')](this,_0x286b1b[_0xd165('0x115')]);if(!_0x3685b9){return this[_0xd165('0xe')][_0xd165('0x2a')](_0x286b1b,_0xd165('0x118'));}var _0x56e43e=this[_0xd165('0xe')][_0xd165('0x11a')](_0x3685b9,_0x286b1b[_0xd165('0x16c')],_0x286b1b[_0xd165('0x16d')]);var _0x5510ef=_0x56e43e['result'];if(_0x56e43e['result']===-0x1){this[_0xd165('0x34')][_0xd165('0x76')](this,_0x286b1b,'-1');return _0x56e43e;}else if(_0x56e43e[_0xd165('0xaa')]==='timeout'){_0x56e43e['result']=_0x56e43e[_0xd165('0xac')][_0xd165('0xa4')]>0x0?_0x56e43e['result']:'t';}else if(_[_0xd165('0x43')](_0x56e43e[_0xd165('0xac')])){_0x56e43e['result']='#';_0x5510ef='#';}if(!this[_0xd165('0x8c')](_0x286b1b['variable_id'])){this[_0xd165('0xe')][_0xd165('0xb0')](_0xd165('0x119'));}else{var _0x3075a4=this[_0xd165('0x11')][_0xd165('0x76')](this,_0x286b1b[_0xd165('0xde')]);if(!_0x3075a4){return this[_0xd165('0xe')][_0xd165('0x2a')](_0x286b1b,'no\x20variable\x20found');}this[_0xd165('0xe')][_0xd165('0xa8')](_0x3075a4,_0x5510ef);}this[_0xd165('0x34')][_0xd165('0x76')](this,_0x286b1b,_0x5510ef);return _0x56e43e;};AGIVertices[_0xd165('0x10')][_0xd165('0xb0')]=function(_0x24c87e){logger[_0xd165('0x2c')](util[_0xd165('0x5b')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x24c87e[_0xd165('0x36')]));return this[_0xd165('0xe')][_0xd165('0xb0')](_0x24c87e[_0xd165('0x16e')]||_0x24c87e[_0xd165('0x36')]);};AGIVertices[_0xd165('0x10')][_0xd165('0x16f')]=function(_0x5060f5){logger['info'](util[_0xd165('0x5b')](_0xd165('0x170'),_0x5060f5[_0xd165('0x36')]));if(!this[_0xd165('0x8c')](_0x5060f5[_0xd165('0x15e')])){return this[_0xd165('0xe')][_0xd165('0x2a')](_0x5060f5,_0xd165('0x15f'));}logger[_0xd165('0x2c')](util['format'](_0xd165('0x160'),this[_0xd165('0xe')][_0xd165('0x39')],_0x5060f5['findBy']));var _0x2978ee=this[_0xd165('0x54')][_0xd165('0x76')](this,_0x5060f5['pause_id']);var _0x532630=this[_0xd165('0x56')][_0xd165('0x76')](this,_0x5060f5['findBy'],_0x2978ee);if(_0x532630){logger[_0xd165('0x2c')](util[_0xd165('0x5b')](_0xd165('0x161'),this[_0xd165('0xe')]['callerid'],_0x5060f5['findBy']));this[_0xd165('0xe')]['noop'](util[_0xd165('0x5b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xd165('0xe')][_0xd165('0x39')],_0x5060f5[_0xd165('0x15e')]));return{'code':0xc8,'result':_0xd165('0x165')};}else{logger[_0xd165('0x2c')](util[_0xd165('0x5b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x5060f5[_0xd165('0x15e')]));this['channel'][_0xd165('0xb0')](util[_0xd165('0x5b')](_0xd165('0x161'),this[_0xd165('0xe')][_0xd165('0x39')],_0x5060f5[_0xd165('0x15e')]));return{'code':0xc8,'result':_0xd165('0x163')};}};AGIVertices['prototype']['playback']=function(_0x1e78a9){logger[_0xd165('0x2c')](util[_0xd165('0x5b')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x1e78a9[_0xd165('0x36')]));if(!this[_0xd165('0x8c')](_0x1e78a9[_0xd165('0x115')])){return this[_0xd165('0xe')]['error'](_0x1e78a9,'no\x20file\x20audio\x20selected');}var _0x39cd5c=this[_0xd165('0x117')][_0xd165('0x76')](this,_0x1e78a9[_0xd165('0x115')]);if(!_0x39cd5c){return this['channel']['error'](_0x1e78a9,_0xd165('0x118'));}var _0x49813e=this['channel']['exec'](_0xd165('0x171'),[_0x39cd5c,_0x1e78a9[_0xd165('0xeb')]]);if(_0x49813e[_0xd165('0xac')]===-0x1){return _0x49813e;}return this[_0xd165('0xe')]['noop'](util[_0xd165('0x5b')]('Executed\x20command\x20%s\x20%s','PLAYBACK',_0x39cd5c));};AGIVertices['prototype'][_0xd165('0x172')]=function(_0x4299cb){logger[_0xd165('0x2c')](util[_0xd165('0x5b')](_0xd165('0x173'),_0x4299cb[_0xd165('0x36')]));if(!this['isConfigured'](_0x4299cb[_0xd165('0x174')])){return this[_0xd165('0xe')][_0xd165('0x2a')](_0x4299cb,_0xd165('0x175'));}var _0x6020b5='';var _0x183659=parseInt(_0x4299cb[_0xd165('0x174')],0xa);if(isNaN(_0x183659)){_0x6020b5=_0x4299cb[_0xd165('0x174')];}else{_0x6020b5=this[_0xd165('0x15')][_0xd165('0x76')](this,_0x4299cb[_0xd165('0x174')]);if(!_0x6020b5){return this['channel'][_0xd165('0x2a')](_0x4299cb,'no\x20queue\x20found');}}var _0x388862='';if(this[_0xd165('0x8c')](_0x4299cb[_0xd165('0x115')])){var _0x2b162d=this['getSound'][_0xd165('0x76')](this,_0x4299cb[_0xd165('0x115')]);if(_0x2b162d){_0x388862=_0x2b162d;}}this[_0xd165('0x34')]['sync'](this,_0x4299cb,_0x6020b5);if(_0x4299cb['opts'][_0xd165('0x176')]('x')<0x0){_0x4299cb[_0xd165('0xeb')]+='x';}if(_0x4299cb[_0xd165('0xeb')][_0xd165('0x176')]('X')<0x0){_0x4299cb['opts']+='X';}this['channel'][_0xd165('0xa8')]('XMCS-QUEUE',_0x6020b5?_0x6020b5['toLowerCase']():'');var _0x170dcc=this[_0xd165('0xe')][_0xd165('0xb7')](_0xd165('0x177'),[_0x6020b5,_0x4299cb['opts'],_0x4299cb[_0xd165('0x69')],_0x388862,_0x4299cb[_0xd165('0x6a')],_0x4299cb[_0xd165('0xc0')],_0x4299cb[_0xd165('0x178')],_0x4299cb['gosub'],'',_0x4299cb['position']]);if(_0x170dcc['result']===-0x1){return _0x170dcc;}return this['channel'][_0xd165('0xb0')](util[_0xd165('0x5b')](_0xd165('0x179'),_0xd165('0x177'),_0x6020b5));};AGIVertices[_0xd165('0x10')]['record']=function(_0x3c5a48){logger[_0xd165('0x2c')](util[_0xd165('0x5b')](_0xd165('0x17a'),_0x3c5a48['label']));var _0x528c24=_0x3c5a48[_0xd165('0x17b')]||_0xd165('0x135');var _0x335a49=util[_0xd165('0x5b')](_0xd165('0x17c'),this[_0xd165('0xe')][_0xd165('0x35')],rs['generate'](0x5));var _0x490254=util['format']('%s/recordings/%s.%s',FILES_PATH,_0x335a49,_0x528c24);var _0x349066=util[_0xd165('0x5b')]('%s/recordings/%s',FILES_PATH,_0x335a49);this[_0xd165('0x3a')]['sync'](this,_0x3c5a48,_0x335a49,_0x490254);this[_0xd165('0xe')]['setVariable'](_0xd165('0x17d'),_0x335a49);logger[_0xd165('0x2c')](_0xd165('0x17e'),_0x349066,_0x528c24,_0x3c5a48['escape_digits'],_0x3c5a48[_0xd165('0x6a')]);return this[_0xd165('0xe')][_0xd165('0x138')](_0x349066,_0x528c24,_0x3c5a48[_0xd165('0x17f')],_0x3c5a48[_0xd165('0x6a')],undefined,!![]);};AGIVertices['prototype'][_0xd165('0x180')]=function(_0x34c410){logger[_0xd165('0x2c')](util[_0xd165('0x5b')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x34c410[_0xd165('0x36')]));if(!this[_0xd165('0x8c')](_0x34c410[_0xd165('0x69')])){return this[_0xd165('0xe')][_0xd165('0xb0')]('no\x20url\x20configured');}var _0x164b84=this[_0xd165('0x181')][_0xd165('0x76')](this,_0x34c410);logger['info'](util[_0xd165('0x5b')](_0xd165('0x182'),util['inspect'](_0x164b84,{'showHidden':![],'depth':null})));if(!this[_0xd165('0x8c')](_0x34c410['variable_id'])){return this[_0xd165('0xe')][_0xd165('0xb0')](_0xd165('0x183'));}var _0x421899=this['getVariable'][_0xd165('0x76')](this,_0x34c410['variable_id']);if(!_0x421899){return this['channel']['error'](_0x34c410,'no\x20variable\x20found');}this[_0xd165('0xe')][_0xd165('0xa8')](util[_0xd165('0x5b')](_0xd165('0x184'),_0x421899),_0x164b84[_0xd165('0x7c')]?_0x164b84[_0xd165('0x7c')]:_0xd165('0x185'));this[_0xd165('0xe')][_0xd165('0xa8')](util[_0xd165('0x5b')]('%s_STATUS_MESSAGE',_0x421899),_0x164b84[_0xd165('0x7d')]?_0x164b84['statusMessage']:'OK');if(_0x164b84[_0xd165('0x70')]){try{this[_0xd165('0xa6')](_0x164b84['body'],_0x421899);}catch(_0x1a0258){logger[_0xd165('0x2a')](util[_0xd165('0x5b')](_0xd165('0x186'),_0x421899));}}return this[_0xd165('0xe')]['noop'](util[_0xd165('0x5b')](_0xd165('0x187'),_0x421899));};AGIVertices[_0xd165('0x10')]['saydigits']=function(_0x1c0861){logger[_0xd165('0x2c')](util[_0xd165('0x5b')](_0xd165('0x188'),_0x1c0861['label']));return this['channel']['sayDigits'](_0x1c0861[_0xd165('0x189')][_0xd165('0x5f')](/\s+/g,''),_0x1c0861[_0xd165('0x17f')]);};AGIVertices[_0xd165('0x10')]['saynumber']=function(_0x129536){logger[_0xd165('0x2c')](util[_0xd165('0x5b')](_0xd165('0x18a'),_0x129536[_0xd165('0x36')]));return this[_0xd165('0xe')]['sayNumber'](_0x129536[_0xd165('0x6b')][_0xd165('0x5f')](/\s+/g,''),_0x129536[_0xd165('0x17f')]);};AGIVertices[_0xd165('0x10')][_0xd165('0x18b')]=function(_0x3ef58d){logger[_0xd165('0x2c')](util[_0xd165('0x5b')](_0xd165('0x18c'),_0x3ef58d['label']));return this[_0xd165('0xe')][_0xd165('0x18d')](_0x3ef58d['text'],_0x3ef58d[_0xd165('0x17f')]);};AGIVertices[_0xd165('0x10')][_0xd165('0x18e')]=function(_0x1aa1c2){logger[_0xd165('0x2c')](util[_0xd165('0x5b')](_0xd165('0x18f'),_0x1aa1c2[_0xd165('0x36')]));if(!this[_0xd165('0x8c')](_0x1aa1c2[_0xd165('0x190')])){return this[_0xd165('0xe')][_0xd165('0xb0')](_0xd165('0x191'));}var _0x25b327=this[_0xd165('0x1f')][_0xd165('0x76')](this,_0x1aa1c2['account_id']);if(!_0x25b327||!_0x25b327[_0xd165('0x192')]){return this[_0xd165('0xe')][_0xd165('0x2a')](_0x1aa1c2,_0xd165('0x193'));}var _0x28536c={'from':util[_0xd165('0x5b')](_0xd165('0x194'),_0x25b327[_0xd165('0x13')],_0x25b327[_0xd165('0x195')]||_0x25b327[_0xd165('0x192')][_0xd165('0x196')]),'to':_0x1aa1c2['to']||'','cc':_0x1aa1c2['cc']||'','bcc':_0x1aa1c2[_0xd165('0x197')]||'','subject':_0x1aa1c2[_0xd165('0x198')],'html':_0x1aa1c2[_0xd165('0x62')],'text':_0x1aa1c2[_0xd165('0x62')]};var _0x8f6bd2={'tls':{'rejectUnauthorized':![]}};if(_0x25b327[_0xd165('0x192')][_0xd165('0x199')]){_0x8f6bd2[_0xd165('0x199')]=_0x25b327[_0xd165('0x192')][_0xd165('0x199')];}else{_0x8f6bd2['host']=_0x25b327[_0xd165('0x192')]['host'];_0x8f6bd2['port']=_0x25b327[_0xd165('0x192')]['port'];_0x8f6bd2['secure']=_0x25b327[_0xd165('0x192')][_0xd165('0x19a')];}if(_0x25b327[_0xd165('0x192')][_0xd165('0x19b')]){_0x8f6bd2[_0xd165('0x19c')]={'user':_0x25b327[_0xd165('0x192')][_0xd165('0x196')],'pass':_0x25b327[_0xd165('0x192')]['pass']};}if(this[_0xd165('0x8c')](_0x1aa1c2[_0xd165('0x19d')])){}logger['debug'](_0xd165('0x19e'),JSON[_0xd165('0x7a')](_0x28536c));this[_0xd165('0x34')][_0xd165('0x76')](this,_0x1aa1c2,_0x1aa1c2[_0xd165('0x190')]);this[_0xd165('0xe')][_0xd165('0xb0')](util[_0xd165('0x5b')](_0xd165('0x19f'),_0x25b327[_0xd165('0x13')]));this['sendMailMessage'][_0xd165('0x76')](this,_0x8f6bd2,_0x28536c);return this['channel'][_0xd165('0xb0')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xd165('0x10')][_0xd165('0x1a0')]=function(_0x249d3b){logger[_0xd165('0x2c')](util[_0xd165('0x5b')](_0xd165('0x1a1'),_0x249d3b[_0xd165('0x36')]));return this['channel'][_0xd165('0xb0')](_0xd165('0x1a2'));};AGIVertices[_0xd165('0x10')][_0xd165('0x1a3')]=function(_0x280edb){logger[_0xd165('0x2c')](util['format'](_0xd165('0x1a4'),_0x280edb[_0xd165('0x36')]));if(!this[_0xd165('0x8c')](_0x280edb[_0xd165('0x1a5')])){return this[_0xd165('0xe')]['noop']('no\x20sms\x20account\x20configured');}var _0x3e871c=this['getSmsAccount'][_0xd165('0x76')](this,_0x280edb[_0xd165('0x1a5')]);if(!_0x3e871c){return this['channel'][_0xd165('0x2a')](_0x280edb,_0xd165('0x1a6'));}var _0xdbdd5d={'body':_0x280edb[_0xd165('0x1a7')],'phone':_0x280edb['to']||'','SmsAccountId':_0x3e871c['id']};logger[_0xd165('0xe4')](_0xd165('0x1a8'),JSON[_0xd165('0x7a')](_0xdbdd5d));this[_0xd165('0x34')][_0xd165('0x76')](this,_0x280edb,_0x280edb[_0xd165('0x1a5')]);this[_0xd165('0xe')][_0xd165('0xb0')](util[_0xd165('0x5b')](_0xd165('0x1a9'),_0x3e871c[_0xd165('0x13')]));this['createSmsMessage'][_0xd165('0x76')](this,_0xdbdd5d);return this[_0xd165('0xe')][_0xd165('0xb0')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xd165('0x10')][_0xd165('0x1aa')]=function(_0x154a74){logger[_0xd165('0x2c')](util[_0xd165('0x5b')](_0xd165('0x1ab'),_0x154a74[_0xd165('0x36')]));if(!this[_0xd165('0x8c')](_0x154a74[_0xd165('0xde')])){return this[_0xd165('0xe')][_0xd165('0x2a')](_0x154a74,_0xd165('0x1ac'));}var _0x4b3ac4=this[_0xd165('0x11')][_0xd165('0x76')](this,_0x154a74[_0xd165('0xde')]);if(!_0x4b3ac4){return this[_0xd165('0xe')]['error'](_0x154a74,_0xd165('0x11d'));}return this[_0xd165('0xe')][_0xd165('0xa8')](_0x4b3ac4,_0x154a74[_0xd165('0x1ad')]);};AGIVertices[_0xd165('0x10')][_0xd165('0x1ae')]=function(_0x3a2f90){logger[_0xd165('0x2c')](util['format']('Enter\x20in\x20START\x20(%s)\x20block',_0x3a2f90[_0xd165('0x36')]));this[_0xd165('0xe')][_0xd165('0xb0')](_0xd165('0x1af'));if(_0x3a2f90[_0xd165('0xc4')]==='yes'){this[_0xd165('0xe')][_0xd165('0xb0')](_0xd165('0x1b0'));return this[_0xd165('0xe')][_0xd165('0xc4')]();}return this[_0xd165('0xe')][_0xd165('0xb0')](_0xd165('0x1b1'));};AGIVertices[_0xd165('0x10')][_0xd165('0x1b2')]=function(_0x5c6838){logger['info'](util['format']('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x5c6838[_0xd165('0x36')]));if(!this[_0xd165('0x8c')](_0x5c6838[_0xd165('0x1b3')])){return this[_0xd165('0xe')][_0xd165('0x2a')](_0x5c6838,_0xd165('0x1b4'));}var _0x5483ce=this[_0xd165('0x1b5')]['sync'](this,_0x5c6838[_0xd165('0x1b3')]);if(!this[_0xd165('0x8c')](_0x5483ce)){return this[_0xd165('0xe')]['error'](_0x5c6838,util[_0xd165('0x5b')](_0xd165('0x1b6'),_0x5c6838[_0xd165('0x1b3')]));}if(_0x5483ce===this[_0xd165('0xe')][_0xd165('0x38')]){return this[_0xd165('0xe')][_0xd165('0x2a')](_0x5c6838,_0xd165('0x1b7'));}this['createSquareDetailsReport']['sync'](this,_0x5c6838,_0x5483ce);var _0x3007dc=this['channel'][_0xd165('0xb7')](_0xd165('0x1b8'),util[_0xd165('0x5b')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config['agi'][_0xd165('0x1b9')]||'127.0.0.1',_0x5483ce,this['channel'][_0xd165('0x38')]));if(_0x3007dc[_0xd165('0xac')]===-0x1){return _0x3007dc;}return this[_0xd165('0xe')]['noop'](util[_0xd165('0x5b')](_0xd165('0x179'),_0xd165('0x1b8'),_0x5483ce));};AGIVertices[_0xd165('0x10')][_0xd165('0x1ba')]=function(_0x22af0b){logger[_0xd165('0x2c')](util[_0xd165('0x5b')](_0xd165('0x1bb'),_0x22af0b['label']));var _0x32fc3d=this[_0xd165('0x1bc')]['sync'](this,_0x22af0b[_0xd165('0x1bd')]);this[_0xd165('0x34')][_0xd165('0x76')](this,_0x22af0b,_0x22af0b['command']);if(this[_0xd165('0x8c')](_0x22af0b['variable_id'])){var _0x388c9d=this['getVariable']['sync'](this,_0x22af0b[_0xd165('0xde')]);if(_0x388c9d){this[_0xd165('0xe')]['setVariable'](_0x388c9d,_0x32fc3d);return this[_0xd165('0xe')][_0xd165('0xb0')](util[_0xd165('0x5b')](_0xd165('0x1be'),_0x22af0b['command'],_0x388c9d));}}return this['channel'][_0xd165('0xb0')](util[_0xd165('0x5b')](_0xd165('0x1bf'),_0x22af0b[_0xd165('0x1bd')]));};AGIVertices[_0xd165('0x10')]['google_cloud_tts']=function(_0x41eb1e){logger[_0xd165('0x2c')](util[_0xd165('0x5b')](_0xd165('0x1c0'),_0x41eb1e[_0xd165('0x36')]));_0x41eb1e[_0xd165('0x62')]=_0x41eb1e[_0xd165('0x62')][_0xd165('0x5f')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xd165('0x8c')](_0x41eb1e[_0xd165('0x1c1')])){return this[_0xd165('0xe')][_0xd165('0xb0')]('no\x20apiKey\x20configured');}if(!this['isConfigured'](_0x41eb1e[_0xd165('0x62')])){return this[_0xd165('0xe')][_0xd165('0xb0')](_0xd165('0xcf'));}this['channel'][_0xd165('0xb0')](util[_0xd165('0x5b')](_0xd165('0x1c2'),_0x41eb1e[_0xd165('0x62')]));var _0x24283a=this[_0xd165('0x60')]['sync'](this,_0x41eb1e);if(_0x24283a){this[_0xd165('0xe')][_0xd165('0xb0')](util[_0xd165('0x5b')](_0xd165('0x1c3'),_0x24283a));var _0x28228d=this[_0xd165('0xe')][_0xd165('0x105')](_0x24283a);try{fs['unlink'](_0x24283a+'.wav');}catch(_0x13ee26){logger['error'](_0x13ee26);}return _0x28228d;}return this[_0xd165('0xe')]['error'](_0x41eb1e,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0xd165('0x10')][_0xd165('0x1c4')]=function(_0x10dcc9){logger[_0xd165('0x2c')](util[_0xd165('0x5b')](_0xd165('0x1c5'),_0x10dcc9[_0xd165('0x36')]));_0x10dcc9['text']=_0x10dcc9['text'][_0xd165('0x5f')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xd165('0x8c')](_0x10dcc9[_0xd165('0x62')])){return this[_0xd165('0xe')]['noop'](_0xd165('0xcf'));}this['channel'][_0xd165('0xb0')](util[_0xd165('0x5b')](_0xd165('0x1c6'),_0x10dcc9[_0xd165('0x62')]));var _0x18fce4=this[_0xd165('0x1c7')][_0xd165('0x76')](this,_0x10dcc9);if(_0x18fce4){this[_0xd165('0xe')][_0xd165('0xb0')](util[_0xd165('0x5b')](_0xd165('0x1c8'),_0x18fce4));var _0x45c29c=this[_0xd165('0xe')][_0xd165('0x105')](_0x18fce4);try{fs['unlink'](_0x18fce4+_0xd165('0x106'));}catch(_0x36d19c){logger[_0xd165('0x2a')](_0x36d19c);}return _0x45c29c;}return this['channel'][_0xd165('0x2a')](_0x10dcc9,'Google\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0xd165('0x1c9')]=function(_0x536c92){logger[_0xd165('0x2c')](util['format']('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x536c92['label']));if(!this[_0xd165('0x8c')](_0x536c92['findBy'])){return this[_0xd165('0xe')][_0xd165('0x2a')](_0x536c92,'no\x20find\x20by\x20configured');}logger['info'](util['format'](_0xd165('0x160'),this['channel']['callerid'],_0x536c92[_0xd165('0x15e')]));var _0x1e849a=this[_0xd165('0x58')][_0xd165('0x76')](this,_0x536c92['findBy']);if(_0x1e849a){logger[_0xd165('0x2c')](util['format'](_0xd165('0x161'),this[_0xd165('0xe')][_0xd165('0x39')],_0x536c92[_0xd165('0x15e')]));this['channel'][_0xd165('0xb0')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xd165('0x39')],_0x536c92['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0xd165('0x2c')](util[_0xd165('0x5b')](_0xd165('0x162'),this['channel'][_0xd165('0x39')],_0x536c92[_0xd165('0x15e')]));this['channel'][_0xd165('0xb0')](util[_0xd165('0x5b')](_0xd165('0x162'),this[_0xd165('0xe')][_0xd165('0x39')],_0x536c92[_0xd165('0x15e')]));return{'code':0xc8,'result':_0xd165('0x163')};}};AGIVertices['prototype'][_0xd165('0x1ca')]=function(_0x37d231){logger[_0xd165('0x2c')](util['format']('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x37d231['label']));var _0x36845d=this[_0xd165('0xe')][_0xd165('0xb7')](_0xd165('0x1cb'),[_0x37d231[_0xd165('0x1cc')],_0x37d231[_0xd165('0xb1')]]);if(_0x36845d['result']===-0x1){return _0x36845d;}return this[_0xd165('0xe')][_0xd165('0xb0')](util[_0xd165('0x5b')](_0xd165('0x179'),_0xd165('0x1cb'),_0x37d231[_0xd165('0x1cc')]));};AGIVertices[_0xd165('0x10')][_0xd165('0x1cd')]=function(_0x1f247c){logger[_0xd165('0x2c')](util[_0xd165('0x5b')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x1f247c['label']));if(!this[_0xd165('0x8c')](_0x1f247c[_0xd165('0xde')])){return this['channel'][_0xd165('0x2a')](_0x1f247c,'no\x20variable\x20selected');}var _0xda4d5=this[_0xd165('0x11')]['sync'](this,_0x1f247c['variable_id']);if(!_0xda4d5){return this['channel'][_0xd165('0x2a')](_0x1f247c,'no\x20variable\x20found');}var _0x3bab05=this[_0xd165('0xe')]['getVariable'](_0xda4d5);return{'code':0xc8,'result':_0x3bab05['extra']?_0x3bab05[_0xd165('0xaa')]:'-'};};String[_0xd165('0x10')][_0xd165('0x1ce')]=function(_0x359bcc,_0x241485){return this['split'](_0x359bcc)[_0xd165('0x1cf')](_0x241485);};module[_0xd165('0x1d0')]=AGIVertices;
\ No newline at end of file
index f3b7a4e..fb14cc6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc85=['syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','info','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','lastPauseAt','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','timer','update','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','error','finally','message','stopAcw','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','syncAgentConnect','interface','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','attended','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','startAcw','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','util','moment','../ami','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','bind','hanguprequest'];(function(_0x28c3d7,_0x457980){var _0x9f3e10=function(_0x503bb8){while(--_0x503bb8){_0x28c3d7['push'](_0x28c3d7['shift']());}};_0x9f3e10(++_0x457980);}(_0xfc85,0x1a1));var _0x5fc8=function(_0x374d8b,_0xa4af89){_0x374d8b=_0x374d8b-0x0;var _0x527217=_0xfc85[_0x374d8b];return _0x527217;};'use strict';var util=require(_0x5fc8('0x0'));var _=require('lodash');var moment=require(_0x5fc8('0x1'));var ami=require(_0x5fc8('0x2'));var logger=require('../../../config/logger')(_0x5fc8('0x3'));var RpcUser=require(_0x5fc8('0x4'));var RpcVoiceAgentReport=require(_0x5fc8('0x5'));function Acw(_0x3b784f){this[_0x5fc8('0x6')]=_0x3b784f[_0x5fc8('0x6')];this[_0x5fc8('0x7')]=_0x3b784f[_0x5fc8('0x7')];this[_0x5fc8('0x8')]=_0x3b784f[_0x5fc8('0x8')];this[_0x5fc8('0x9')]={};ami['on'](_0x5fc8('0xa'),this['syncAgentConnect'][_0x5fc8('0xb')](this));ami['on'](_0x5fc8('0xc'),this[_0x5fc8('0xd')][_0x5fc8('0xb')](this));ami['on'](_0x5fc8('0xe'),this[_0x5fc8('0xf')]['bind'](this));ami['on'](_0x5fc8('0x10'),this[_0x5fc8('0x11')][_0x5fc8('0xb')](this));ami['on']('attendedtransfer',this[_0x5fc8('0x12')][_0x5fc8('0xb')](this));ami['on'](_0x5fc8('0x13'),this[_0x5fc8('0x14')]['bind'](this));ami['on'](_0x5fc8('0x15'),this[_0x5fc8('0x16')][_0x5fc8('0xb')](this));}function getDiff(_0x89be33){var _0x1767ff=moment()[_0x5fc8('0x17')](0x0);var _0x4f287c=moment(_0x89be33)[_0x5fc8('0x17')](0x0);return _0x1767ff[_0x5fc8('0x18')](_0x4f287c,_0x5fc8('0x19'));}Acw[_0x5fc8('0x1a')]['startAcw']=function(_0x4c740d){try{var _0x25ab34=this;var _0x556db1=this['channels'][_0x4c740d]['interface'];var _0x332f86=this[_0x5fc8('0x9')][_0x4c740d][_0x5fc8('0x1b')];var _0x2ba25e=this[_0x5fc8('0x6')][_0x332f86];var _0x9d9044=![];var _0x3a50c3=_0x5fc8('0x1c');if(_0x2ba25e[_0x5fc8('0x1d')]){if(_0x2ba25e[_0x5fc8('0x1e')][_0x5fc8('0x1f')]){_0x9d9044=!![];_0x3a50c3=_0x2ba25e['mandatoryDispositionPause']['name'];}}ami[_0x5fc8('0x20')]({'action':_0x5fc8('0x21'),'interface':_0x556db1,'paused':!![],'reason':_0x3a50c3})[_0x5fc8('0x22')](function(_0x466cf9){if(_0x25ab34[_0x5fc8('0x7')][_0x556db1]){return RpcUser['getAgent'](_0x25ab34[_0x5fc8('0x7')][_0x556db1]['id'])['then'](function(_0x1d15cf){if(_0x1d15cf&&!_0x1d15cf[_0x5fc8('0x23')]){logger['info'](_0x5fc8('0x24'),_0x4c740d,_0x556db1,_0x332f86);var _0x47efd8=_0x25ab34[_0x5fc8('0x9')][_0x4c740d]['attended']&&_0x25ab34[_0x5fc8('0x9')][_0x4c740d][_0x5fc8('0x25')]?_0x25ab34['channels'][_0x4c740d][_0x5fc8('0x25')]:_0x4c740d;return RpcUser[_0x5fc8('0x26')](_0x25ab34[_0x5fc8('0x7')][_0x556db1],_0x3a50c3,_0x47efd8)[_0x5fc8('0x22')](function(_0x2ea380){if(!_0x9d9044){_0x25ab34[_0x5fc8('0x8')][_0x556db1]={};logger[_0x5fc8('0x27')](_0x5fc8('0x28'),_0x4c740d,_0x25ab34[_0x5fc8('0x6')][_0x332f86][_0x5fc8('0x29')],_0x556db1,_0x332f86);_0x25ab34[_0x5fc8('0x8')][_0x556db1]['timer']=setTimeout(_0x25ab34['stopAcw'][_0x5fc8('0xb')](_0x25ab34,_0x556db1),_0x25ab34[_0x5fc8('0x6')][_0x332f86][_0x5fc8('0x29')]*0x3e8);_0x25ab34[_0x5fc8('0x8')][_0x556db1][_0x5fc8('0x2a')]=moment()['format'](_0x5fc8('0x2b'));_0x25ab34[_0x5fc8('0x8')][_0x556db1][_0x5fc8('0x2c')]=_0x4c740d;_0x25ab34[_0x5fc8('0x8')][_0x556db1][_0x5fc8('0x1b')]=_0x332f86;_0x25ab34[_0x5fc8('0x8')][_0x556db1][_0x5fc8('0x2d')]=function(){var _0x2e15a9=getDiff(_0x25ab34[_0x5fc8('0x8')][_0x556db1][_0x5fc8('0x2a')]);clearTimeout(_0x25ab34['timers'][_0x556db1]['timer']);_0x25ab34['timers'][_0x556db1][_0x5fc8('0x2e')]=![];RpcVoiceAgentReport[_0x5fc8('0x2f')]({'acwtime':_0x2e15a9},_0x25ab34[_0x5fc8('0x8')][_0x556db1][_0x5fc8('0x2c')],_0x556db1)[_0x5fc8('0x22')](function(_0x538e14){logger['info'](_0x5fc8('0x30'),_0x4c740d,_0x2e15a9,_0x538e14);})[_0x5fc8('0x31')](function(_0x271b9d){logger['error'](_0x5fc8('0x32'),_0x4c740d,_0x271b9d);});delete _0x25ab34['timers'][_0x556db1];};}});}else{logger['info']('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x4c740d,_0x556db1,_0x332f86);}});}})['catch'](function(_0x22f9e4){logger[_0x5fc8('0x33')](_0x5fc8('0x28'),_0x4c740d,_0x25ab34['voiceQueues'][_0x332f86][_0x5fc8('0x29')],_0x556db1,_0x332f86);})[_0x5fc8('0x34')](function(){delete _0x25ab34[_0x5fc8('0x9')][_0x4c740d];});}catch(_0x156c79){logger['error']('[ACW][START]\x20%s',_0x156c79[_0x5fc8('0x35')]);}};Acw[_0x5fc8('0x1a')][_0x5fc8('0x36')]=function(_0x11edf0){try{var _0x2ebdce=this;if(_0x2ebdce[_0x5fc8('0x8')][_0x11edf0]){_0x2ebdce[_0x5fc8('0x8')][_0x11edf0][_0x5fc8('0x2e')]=![];var _0x20c843=_0x2ebdce[_0x5fc8('0x8')][_0x11edf0][_0x5fc8('0x2c')];var _0x5c6086=_0x2ebdce[_0x5fc8('0x8')][_0x11edf0]['queue'];var _0x797e28=_0x2ebdce[_0x5fc8('0x6')][_0x5c6086][_0x5fc8('0x29')];logger[_0x5fc8('0x27')]('[%s][TIMER][STOP][AGENT:%s]',_0x20c843,_0x11edf0);RpcUser[_0x5fc8('0x37')](this[_0x5fc8('0x7')][_0x11edf0]);RpcVoiceAgentReport['update']({'acwtime':_0x797e28,'agentacw':!![]},_0x20c843,_0x11edf0)[_0x5fc8('0x22')](function(_0x4cd1ad){logger[_0x5fc8('0x27')](_0x5fc8('0x30'),_0x20c843,_0x797e28,_0x4cd1ad);})[_0x5fc8('0x31')](function(_0x387351){logger['error'](_0x5fc8('0x32'),_0x20c843,_0x387351);});}else{logger['error'](_0x5fc8('0x38'),_0x11edf0);if(_0x2ebdce['timers']){logger[_0x5fc8('0x27')](_0x5fc8('0x39'),JSON['stringify'](_0x2ebdce[_0x5fc8('0x8')]));}}}catch(_0x529bb1){logger[_0x5fc8('0x33')]('[ACW][STOP]\x20%s',_0x529bb1[_0x5fc8('0x35')]);}};Acw['prototype'][_0x5fc8('0x3a')]=function(_0x122de7){try{if(this[_0x5fc8('0x6')][_0x122de7[_0x5fc8('0x1b')]]&&(this[_0x5fc8('0x6')][_0x122de7[_0x5fc8('0x1b')]][_0x5fc8('0x3')]||this[_0x5fc8('0x6')][_0x122de7['queue']][_0x5fc8('0x1d')])){if(this[_0x5fc8('0x7')][_0x122de7[_0x5fc8('0x3b')]]){this[_0x5fc8('0x9')][_0x122de7[_0x5fc8('0x2c')]]={'queue':_0x122de7[_0x5fc8('0x1b')],'interface':_0x122de7[_0x5fc8('0x3b')],'destlinkedid':_0x122de7[_0x5fc8('0x25')]};}}}catch(_0x4e24a7){logger['error']('[ACW][syncAgentConnect]\x20%s',_0x4e24a7[_0x5fc8('0x35')]);}};Acw[_0x5fc8('0x1a')]['syncAgentConnectPreview']=function(_0x2cc838){try{if(this[_0x5fc8('0x6')][_0x2cc838['queue']]&&(this[_0x5fc8('0x6')][_0x2cc838[_0x5fc8('0x1b')]]['acw']||this[_0x5fc8('0x6')][_0x2cc838[_0x5fc8('0x1b')]][_0x5fc8('0x1d')])){if(this[_0x5fc8('0x7')][_0x2cc838[_0x5fc8('0x3b')]]){this[_0x5fc8('0x9')][_0x2cc838[_0x5fc8('0x2c')]]={'queue':_0x2cc838[_0x5fc8('0x1b')],'interface':_0x2cc838[_0x5fc8('0x3b')]};}}}catch(_0x2a072a){logger['error'](_0x5fc8('0x3c'),_0x2a072a[_0x5fc8('0x35')]);}};Acw[_0x5fc8('0x1a')][_0x5fc8('0xd')]=function(_0x3b4b4a){try{if(this[_0x5fc8('0x9')][_0x3b4b4a['uniqueid']]&&_[_0x5fc8('0x3d')](this[_0x5fc8('0x9')][_0x3b4b4a['uniqueid']][_0x5fc8('0x3e')])){logger['info'](_0x5fc8('0x3f'),_0x3b4b4a['uniqueid']);this['startAcw'](_0x3b4b4a[_0x5fc8('0x2c')]);}else if(this['channels'][_0x3b4b4a[_0x5fc8('0x40')]]&&_['isUndefined'](this['channels'][_0x3b4b4a[_0x5fc8('0x40')]][_0x5fc8('0x3e')])){logger['info'](_0x5fc8('0x41'),_0x3b4b4a[_0x5fc8('0x40')]);this[_0x5fc8('0x42')](_0x3b4b4a['linkedid']);}}catch(_0x4c65ee){logger[_0x5fc8('0x33')]('[ACW][syncHangupRequest]\x20%s',_0x4c65ee['message']);}};Acw[_0x5fc8('0x1a')]['syncHangup']=function(_0x2aca87){try{if(this['channels'][_0x2aca87[_0x5fc8('0x2c')]]&&this['channels'][_0x2aca87[_0x5fc8('0x2c')]]['attended']){logger['info'](_0x5fc8('0x43'),_0x2aca87[_0x5fc8('0x2c')]);this[_0x5fc8('0x42')](_0x2aca87[_0x5fc8('0x2c')]);}else if(this[_0x5fc8('0x9')][_0x2aca87['linkedid']]&&this[_0x5fc8('0x9')][_0x2aca87[_0x5fc8('0x40')]][_0x5fc8('0x3e')]){logger[_0x5fc8('0x27')](_0x5fc8('0x44'),_0x2aca87[_0x5fc8('0x40')]);this[_0x5fc8('0x42')](_0x2aca87[_0x5fc8('0x40')]);}}catch(_0x27280b){logger[_0x5fc8('0x33')]('[ACW][syncHangup]\x20%s',_0x27280b[_0x5fc8('0x35')]);}};Acw[_0x5fc8('0x1a')][_0x5fc8('0x12')]=function(_0x25401b){try{if(!_[_0x5fc8('0x45')](this[_0x5fc8('0x9')][_0x25401b['transfereeuniqueid']])){this[_0x5fc8('0x42')](_0x25401b[_0x5fc8('0x46')]);if(this['channels'][_0x25401b[_0x5fc8('0x47')]]){this[_0x5fc8('0x9')][_0x25401b[_0x5fc8('0x47')]][_0x5fc8('0x3e')]=!![];this[_0x5fc8('0x9')][_0x25401b[_0x5fc8('0x48')]]=this[_0x5fc8('0x9')][_0x25401b['secondtransfereruniqueid']];delete this[_0x5fc8('0x9')][_0x25401b[_0x5fc8('0x47')]];}}else if(!_[_0x5fc8('0x45')](this[_0x5fc8('0x9')][_0x25401b[_0x5fc8('0x48')]])){this['startAcw'](_0x25401b[_0x5fc8('0x48')]);if(this[_0x5fc8('0x9')][_0x25401b['origtransfereruniqueid']]){this[_0x5fc8('0x9')][_0x25401b[_0x5fc8('0x49')]]['attended']=!![];this['channels'][_0x25401b['transfereeuniqueid']]=this['channels'][_0x25401b['origtransfereruniqueid']];delete this[_0x5fc8('0x9')][_0x25401b[_0x5fc8('0x49')]];}}}catch(_0x15c33c){logger[_0x5fc8('0x33')](_0x5fc8('0x4a'),_0x15c33c[_0x5fc8('0x35')]);}};Acw[_0x5fc8('0x1a')]['syncBlindTransfer']=function(_0x44864f){try{if(this[_0x5fc8('0x9')][_0x44864f[_0x5fc8('0x4b')]]){logger[_0x5fc8('0x27')](_0x5fc8('0x4c'),JSON[_0x5fc8('0x4d')](_0x44864f['transfereruniqueid']));this[_0x5fc8('0x42')](_0x44864f[_0x5fc8('0x4b')]);}else if(this[_0x5fc8('0x9')][_0x44864f[_0x5fc8('0x4e')]]){logger['info'](_0x5fc8('0x4f'),JSON['stringify'](_0x44864f['transfererlinkedid']));this[_0x5fc8('0x42')](_0x44864f[_0x5fc8('0x4e')]);}}catch(_0x2fe920){logger[_0x5fc8('0x33')](_0x5fc8('0x50'),_0x2fe920['message']);}};Acw[_0x5fc8('0x1a')]['syncAgentRingNoAnswer']=function(_0x1650d3){try{if(this[_0x5fc8('0x6')][_0x1650d3[_0x5fc8('0x1b')]]&&this[_0x5fc8('0x6')][_0x1650d3[_0x5fc8('0x1b')]][_0x5fc8('0x51')]===_0x5fc8('0x52')){if(this['agents'][_0x1650d3[_0x5fc8('0x3b')]]){logger[_0x5fc8('0x27')](_0x5fc8('0x53'),_0x1650d3['uniqueid'],_0x1650d3['interface'],_0x1650d3[_0x5fc8('0x1b')]);return RpcUser[_0x5fc8('0x26')](this['agents'][_0x1650d3[_0x5fc8('0x3b')]],_0x5fc8('0x54'),_0x1650d3[_0x5fc8('0x2c')]);}}}catch(_0x20928a){logger['error'](_0x5fc8('0x55'),_0x20928a[_0x5fc8('0x35')]);}};module['exports']=Acw;
\ No newline at end of file
+var _0x93e1=['linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','all','savePause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','util','lodash','moment','../ami','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','agentconnect','syncAgentConnect','bind','hanguprequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','mandatoryDispositionPause','name','QueuePause','getAgent','then','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','channels','attended','destlinkedid','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','update','info','[%s][UPDATE][ACWTIME:%s]','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','mandatoryDisposition','interface','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined'];(function(_0x44810f,_0x443b2c){var _0x5f658b=function(_0xff8488){while(--_0xff8488){_0x44810f['push'](_0x44810f['shift']());}};_0x5f658b(++_0x443b2c);}(_0x93e1,0x10a));var _0x193e=function(_0x548272,_0x115575){_0x548272=_0x548272-0x0;var _0x3e4f0e=_0x93e1[_0x548272];return _0x3e4f0e;};'use strict';var util=require(_0x193e('0x0'));var _=require(_0x193e('0x1'));var moment=require(_0x193e('0x2'));var ami=require(_0x193e('0x3'));var logger=require('../../../config/logger')(_0x193e('0x4'));var RpcUser=require(_0x193e('0x5'));var RpcVoiceAgentReport=require(_0x193e('0x6'));function Acw(_0x43caf1){this['voiceQueues']=_0x43caf1[_0x193e('0x7')];this[_0x193e('0x8')]=_0x43caf1[_0x193e('0x8')];this[_0x193e('0x9')]=_0x43caf1[_0x193e('0x9')];this['channels']={};ami['on'](_0x193e('0xa'),this[_0x193e('0xb')][_0x193e('0xc')](this));ami['on'](_0x193e('0xd'),this['syncHangupRequest'][_0x193e('0xc')](this));ami['on'](_0x193e('0xe'),this[_0x193e('0xf')]['bind'](this));ami['on'](_0x193e('0x10'),this[_0x193e('0x11')][_0x193e('0xc')](this));ami['on'](_0x193e('0x12'),this[_0x193e('0x13')][_0x193e('0xc')](this));ami['on'](_0x193e('0x14'),this[_0x193e('0x15')][_0x193e('0xc')](this));ami['on'](_0x193e('0x16'),this['syncAgentConnectPreview']['bind'](this));}function getDiff(_0x459cec){var _0x298874=moment()['milliseconds'](0x0);var _0x577451=moment(_0x459cec)[_0x193e('0x17')](0x0);return _0x298874[_0x193e('0x18')](_0x577451,_0x193e('0x19'));}Acw[_0x193e('0x1a')][_0x193e('0x1b')]=function(_0x22494d){try{var _0x1cdc7f=this;var _0x49b3e1=this['channels'][_0x22494d]['interface'];var _0x93036a=this['channels'][_0x22494d]['queue'];var _0x4d1e21=this[_0x193e('0x7')][_0x93036a];var _0x30acd9=![];var _0x5045e8='ACW';if(_0x4d1e21['mandatoryDisposition']){if(_0x4d1e21[_0x193e('0x1c')]['name']){_0x30acd9=!![];_0x5045e8=_0x4d1e21[_0x193e('0x1c')][_0x193e('0x1d')];}}ami['Action']({'action':_0x193e('0x1e'),'interface':_0x49b3e1,'paused':!![],'reason':_0x5045e8})['then'](function(_0x495dba){if(_0x1cdc7f['agents'][_0x49b3e1]){return RpcUser[_0x193e('0x1f')](_0x1cdc7f[_0x193e('0x8')][_0x49b3e1]['id'])[_0x193e('0x20')](function(_0x151000){if(_0x151000&&!_0x151000[_0x193e('0x21')]){logger['info'](_0x193e('0x22'),_0x22494d,_0x49b3e1,_0x93036a);var _0xf1fa0d=_0x1cdc7f[_0x193e('0x23')][_0x22494d][_0x193e('0x24')]&&_0x1cdc7f[_0x193e('0x23')][_0x22494d]['destlinkedid']?_0x1cdc7f[_0x193e('0x23')][_0x22494d][_0x193e('0x25')]:_0x22494d;return RpcUser['savePause'](_0x1cdc7f[_0x193e('0x8')][_0x49b3e1],_0x5045e8,_0xf1fa0d)[_0x193e('0x20')](function(_0x597692){if(!_0x30acd9){_0x1cdc7f[_0x193e('0x9')][_0x49b3e1]={};logger['info']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x22494d,_0x1cdc7f[_0x193e('0x7')][_0x93036a][_0x193e('0x26')],_0x49b3e1,_0x93036a);_0x1cdc7f['timers'][_0x49b3e1][_0x193e('0x27')]=setTimeout(_0x1cdc7f[_0x193e('0x28')]['bind'](_0x1cdc7f,_0x49b3e1),_0x1cdc7f[_0x193e('0x7')][_0x93036a][_0x193e('0x26')]*0x3e8);_0x1cdc7f[_0x193e('0x9')][_0x49b3e1][_0x193e('0x29')]=moment()[_0x193e('0x2a')](_0x193e('0x2b'));_0x1cdc7f[_0x193e('0x9')][_0x49b3e1][_0x193e('0x2c')]=_0x22494d;_0x1cdc7f[_0x193e('0x9')][_0x49b3e1][_0x193e('0x2d')]=_0x93036a;_0x1cdc7f['timers'][_0x49b3e1]['updateAcw']=function(){var _0x59a048=getDiff(_0x1cdc7f[_0x193e('0x9')][_0x49b3e1]['lastPauseAt']);clearTimeout(_0x1cdc7f[_0x193e('0x9')][_0x49b3e1][_0x193e('0x27')]);_0x1cdc7f[_0x193e('0x9')][_0x49b3e1][_0x193e('0x27')]=![];RpcVoiceAgentReport[_0x193e('0x2e')]({'acwtime':_0x59a048},_0x1cdc7f['timers'][_0x49b3e1][_0x193e('0x2c')],_0x49b3e1)[_0x193e('0x20')](function(_0x1c5522){logger[_0x193e('0x2f')](_0x193e('0x30'),_0x22494d,_0x59a048,_0x1c5522);})['catch'](function(_0x5f9533){logger[_0x193e('0x31')](_0x193e('0x32'),_0x22494d,_0x5f9533);});delete _0x1cdc7f[_0x193e('0x9')][_0x49b3e1];};}});}else{logger[_0x193e('0x2f')](_0x193e('0x33'),_0x22494d,_0x49b3e1,_0x93036a);}});}})['catch'](function(_0x4ce19e){logger[_0x193e('0x31')](_0x193e('0x34'),_0x22494d,_0x1cdc7f[_0x193e('0x7')][_0x93036a][_0x193e('0x26')],_0x49b3e1,_0x93036a);})[_0x193e('0x35')](function(){delete _0x1cdc7f[_0x193e('0x23')][_0x22494d];});}catch(_0x3da318){logger[_0x193e('0x31')](_0x193e('0x36'),_0x3da318[_0x193e('0x37')]);}};Acw[_0x193e('0x1a')][_0x193e('0x28')]=function(_0x38adce){try{var _0x2d90d5=this;if(_0x2d90d5[_0x193e('0x9')][_0x38adce]){_0x2d90d5[_0x193e('0x9')][_0x38adce][_0x193e('0x27')]=![];var _0x585328=_0x2d90d5[_0x193e('0x9')][_0x38adce][_0x193e('0x2c')];var _0x5cb2f7=_0x2d90d5[_0x193e('0x9')][_0x38adce]['queue'];var _0x48fcfd=_0x2d90d5['voiceQueues'][_0x5cb2f7]['acwTimeout'];logger[_0x193e('0x2f')](_0x193e('0x38'),_0x585328,_0x38adce);RpcUser['saveUnpause'](this[_0x193e('0x8')][_0x38adce]);RpcVoiceAgentReport[_0x193e('0x2e')]({'acwtime':_0x48fcfd,'agentacw':!![]},_0x585328,_0x38adce)[_0x193e('0x20')](function(_0x4e22fc){logger['info'](_0x193e('0x30'),_0x585328,_0x48fcfd,_0x4e22fc);})['catch'](function(_0x1a1c34){logger[_0x193e('0x31')]('[%s][UPDATE][ERRORS:%s]',_0x585328,_0x1a1c34);});}else{logger[_0x193e('0x31')](_0x193e('0x39'),_0x38adce);if(_0x2d90d5[_0x193e('0x9')]){logger[_0x193e('0x2f')]('[ACW][TIMERS]',JSON[_0x193e('0x3a')](_0x2d90d5[_0x193e('0x9')]));}}}catch(_0x19a547){logger[_0x193e('0x31')](_0x193e('0x3b'),_0x19a547[_0x193e('0x37')]);}};Acw[_0x193e('0x1a')][_0x193e('0xb')]=function(_0x23a466){try{if(this[_0x193e('0x7')][_0x23a466[_0x193e('0x2d')]]&&(this[_0x193e('0x7')][_0x23a466[_0x193e('0x2d')]][_0x193e('0x4')]||this[_0x193e('0x7')][_0x23a466[_0x193e('0x2d')]][_0x193e('0x3c')])){if(this[_0x193e('0x8')][_0x23a466['interface']]){this[_0x193e('0x23')][_0x23a466[_0x193e('0x2c')]]={'queue':_0x23a466[_0x193e('0x2d')],'interface':_0x23a466[_0x193e('0x3d')],'destlinkedid':_0x23a466[_0x193e('0x25')]};}}}catch(_0xddffc7){logger['error'](_0x193e('0x3e'),_0xddffc7[_0x193e('0x37')]);}};Acw[_0x193e('0x1a')]['syncAgentConnectPreview']=function(_0x555719){try{if(this[_0x193e('0x7')][_0x555719[_0x193e('0x2d')]]&&(this[_0x193e('0x7')][_0x555719[_0x193e('0x2d')]][_0x193e('0x4')]||this[_0x193e('0x7')][_0x555719[_0x193e('0x2d')]][_0x193e('0x3c')])){if(this[_0x193e('0x8')][_0x555719[_0x193e('0x3d')]]){this['channels'][_0x555719['uniqueid']]={'queue':_0x555719['queue'],'interface':_0x555719['interface']};}}}catch(_0x1c869a){logger[_0x193e('0x31')](_0x193e('0x3f'),_0x1c869a[_0x193e('0x37')]);}};Acw[_0x193e('0x1a')][_0x193e('0x40')]=function(_0x4cc98f){try{if(this[_0x193e('0x23')][_0x4cc98f[_0x193e('0x2c')]]&&_[_0x193e('0x41')](this['channels'][_0x4cc98f[_0x193e('0x2c')]][_0x193e('0x24')])){logger[_0x193e('0x2f')]('[%s][HANGUP:UNIQUEID]',_0x4cc98f[_0x193e('0x2c')]);this[_0x193e('0x1b')](_0x4cc98f[_0x193e('0x2c')]);}else if(this[_0x193e('0x23')][_0x4cc98f[_0x193e('0x42')]]&&_[_0x193e('0x41')](this[_0x193e('0x23')][_0x4cc98f[_0x193e('0x42')]]['attended'])){logger[_0x193e('0x2f')](_0x193e('0x43'),_0x4cc98f['linkedid']);this[_0x193e('0x1b')](_0x4cc98f[_0x193e('0x42')]);}}catch(_0x206d1a){logger['error']('[ACW][syncHangupRequest]\x20%s',_0x206d1a['message']);}};Acw[_0x193e('0x1a')][_0x193e('0xf')]=function(_0x12edc4){try{if(this[_0x193e('0x23')][_0x12edc4[_0x193e('0x2c')]]&&this[_0x193e('0x23')][_0x12edc4[_0x193e('0x2c')]]['attended']){logger[_0x193e('0x2f')](_0x193e('0x44'),_0x12edc4[_0x193e('0x2c')]);this[_0x193e('0x1b')](_0x12edc4[_0x193e('0x2c')]);}else if(this[_0x193e('0x23')][_0x12edc4['linkedid']]&&this[_0x193e('0x23')][_0x12edc4[_0x193e('0x42')]]['attended']){logger[_0x193e('0x2f')](_0x193e('0x45'),_0x12edc4[_0x193e('0x42')]);this[_0x193e('0x1b')](_0x12edc4['linkedid']);}}catch(_0x15a72b){logger[_0x193e('0x31')](_0x193e('0x46'),_0x15a72b[_0x193e('0x37')]);}};Acw[_0x193e('0x1a')][_0x193e('0x13')]=function(_0x63bca5){try{if(!_[_0x193e('0x47')](this[_0x193e('0x23')][_0x63bca5[_0x193e('0x48')]])){this[_0x193e('0x1b')](_0x63bca5['transfereeuniqueid']);if(this[_0x193e('0x23')][_0x63bca5['secondtransfereruniqueid']]){this[_0x193e('0x23')][_0x63bca5[_0x193e('0x49')]]['attended']=!![];this[_0x193e('0x23')][_0x63bca5[_0x193e('0x4a')]]=this[_0x193e('0x23')][_0x63bca5[_0x193e('0x49')]];delete this[_0x193e('0x23')][_0x63bca5[_0x193e('0x49')]];}}else if(!_['isNil'](this[_0x193e('0x23')][_0x63bca5[_0x193e('0x4a')]])){this[_0x193e('0x1b')](_0x63bca5[_0x193e('0x4a')]);if(this[_0x193e('0x23')][_0x63bca5[_0x193e('0x4b')]]){this['channels'][_0x63bca5[_0x193e('0x4b')]][_0x193e('0x24')]=!![];this['channels'][_0x63bca5['transfereeuniqueid']]=this[_0x193e('0x23')][_0x63bca5[_0x193e('0x4b')]];delete this[_0x193e('0x23')][_0x63bca5[_0x193e('0x4b')]];}}}catch(_0x2c990d){logger[_0x193e('0x31')]('[ACW][syncAttendedTransfer]\x20%s',_0x2c990d[_0x193e('0x37')]);}};Acw[_0x193e('0x1a')][_0x193e('0x15')]=function(_0x1c9d1a){try{if(this['channels'][_0x1c9d1a[_0x193e('0x4c')]]){logger[_0x193e('0x2f')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x193e('0x3a')](_0x1c9d1a[_0x193e('0x4c')]));this[_0x193e('0x1b')](_0x1c9d1a[_0x193e('0x4c')]);}else if(this[_0x193e('0x23')][_0x1c9d1a[_0x193e('0x4d')]]){logger['info']('[%s][BLINDTRANSFER:LINKEDID]',JSON['stringify'](_0x1c9d1a[_0x193e('0x4d')]));this[_0x193e('0x1b')](_0x1c9d1a[_0x193e('0x4d')]);}}catch(_0x1ef2ca){logger[_0x193e('0x31')](_0x193e('0x4e'),_0x1ef2ca[_0x193e('0x37')]);}};Acw[_0x193e('0x1a')][_0x193e('0x11')]=function(_0x4087b1){try{if(this[_0x193e('0x7')][_0x4087b1[_0x193e('0x2d')]]&&this[_0x193e('0x7')][_0x4087b1[_0x193e('0x2d')]]['autopause']===_0x193e('0x4f')){if(this[_0x193e('0x8')][_0x4087b1[_0x193e('0x3d')]]){logger[_0x193e('0x2f')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x4087b1[_0x193e('0x2c')],_0x4087b1[_0x193e('0x3d')],_0x4087b1[_0x193e('0x2d')]);return RpcUser[_0x193e('0x50')](this['agents'][_0x4087b1['interface']],_0x193e('0x51'),_0x4087b1[_0x193e('0x2c')]);}}}catch(_0x406bed){logger['error'](_0x193e('0x52'),_0x406bed[_0x193e('0x37')]);}};module['exports']=Acw;
\ No newline at end of file
index eb06c27..c41d0e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b0e=['../../config/environment','asterisk','port','username','password','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','format','Action','sipshowregistry','actionDeviceStateList','devicestatelist','actionQueueSummary','actionCoreShowChannels','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','close','shutdown','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','then','actionSipPeerStatus','catch','[ami.js][fullybooted]','once','asterisk-manager','moment','lodash','../../config/logger','ami'];(function(_0x3e61e6,_0x4b3405){var _0x3353be=function(_0x41623f){while(--_0x41623f){_0x3e61e6['push'](_0x3e61e6['shift']());}};_0x3353be(++_0x4b3405);}(_0x0b0e,0x187));var _0xe0b0=function(_0x246115,_0x398123){_0x246115=_0x246115-0x0;var _0x385878=_0x0b0e[_0x246115];return _0x385878;};'use strict';var Manager=require(_0xe0b0('0x0'));var BPromise=require('bluebird');var moment=require(_0xe0b0('0x1'));var util=require('util');var _=require(_0xe0b0('0x2'));var logger=require(_0xe0b0('0x3'))(_0xe0b0('0x4'));var config=require(_0xe0b0('0x5'));var ami=new Manager(config[_0xe0b0('0x6')][_0xe0b0('0x7')],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')][_0xe0b0('0x8')],config[_0xe0b0('0x6')][_0xe0b0('0x9')],!![]);ami['keepConnected']();ami['Action']=BPromise[_0xe0b0('0xa')](ami[_0xe0b0('0xb')]);function error(_0xc4a085){logger[_0xe0b0('0xc')](util['format'](_0xe0b0('0xd'),config[_0xe0b0('0x6')]['username'],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')]['port'],util[_0xe0b0('0xe')](_0xc4a085,![],null)));}function close(){logger[_0xe0b0('0xc')](util[_0xe0b0('0xf')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xe0b0('0x6')][_0xe0b0('0x8')],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')][_0xe0b0('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0xe0b0('0x10')]({'action':_0xe0b0('0x11')});};};ami[_0xe0b0('0x12')]=function(){return function(){return ami[_0xe0b0('0x10')]({'action':_0xe0b0('0x13')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0xe0b0('0x10')]({'action':'sippeerstatus'});};};ami[_0xe0b0('0x14')]=function(){return function(){return ami[_0xe0b0('0x10')]({'action':'queuesummary'});};};ami[_0xe0b0('0x15')]=function(){return function(){return ami['Action']({'action':_0xe0b0('0x16')});};};function connect(_0x100204){logger['info'](util['format'](_0xe0b0('0x17'),config['asterisk']['username'],config['asterisk']['ip'],config[_0xe0b0('0x6')]['port']));ami['once'](_0xe0b0('0xc'),error);ami['once'](_0xe0b0('0x18'),close);}ami['on']('connect',connect);ami['on'](_0xe0b0('0x19'),function(_0x1cd7c4){logger[_0xe0b0('0x1a')](util[_0xe0b0('0xf')](_0xe0b0('0x1b'),config['asterisk']['username'],config[_0xe0b0('0x6')]['ip'],config['asterisk'][_0xe0b0('0x7')],util[_0xe0b0('0xe')](_0x1cd7c4,![],null)));});ami['on']('fullybooted',function(_0x170ad8){logger['info'](util[_0xe0b0('0xf')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0xe0b0('0x6')]['username'],config[_0xe0b0('0x6')]['ip'],config['asterisk'][_0xe0b0('0x7')]));return BPromise['resolve']()[_0xe0b0('0x1c')](ami['actionSipShowRegistry']())[_0xe0b0('0x1c')](ami[_0xe0b0('0x12')]())[_0xe0b0('0x1c')](ami[_0xe0b0('0x1d')]())[_0xe0b0('0x1c')](ami[_0xe0b0('0x14')]())['then'](ami[_0xe0b0('0x15')]())[_0xe0b0('0x1e')](function(_0x5b7a64){logger[_0xe0b0('0xc')](_0xe0b0('0x1f'),util[_0xe0b0('0xe')](_0x5b7a64,{'showHidden':![],'depth':null}));});});ami[_0xe0b0('0x20')](_0xe0b0('0xc'),error);ami[_0xe0b0('0x20')](_0xe0b0('0x18'),close);module['exports']=ami;
\ No newline at end of file
+var _0x757a=['devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','once','connect','shutdown','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','[ami.js][fullybooted]','close','exports','bluebird','moment','ami','../../config/environment','asterisk','port','password','Action','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect','actionSipShowRegistry','actionDeviceStateList'];(function(_0x1da4bf,_0x133083){var _0x2ad136=function(_0x481c0a){while(--_0x481c0a){_0x1da4bf['push'](_0x1da4bf['shift']());}};_0x2ad136(++_0x133083);}(_0x757a,0xde));var _0xa757=function(_0x4c8294,_0x193acf){_0x4c8294=_0x4c8294-0x0;var _0x12810a=_0x757a[_0x4c8294];return _0x12810a;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0xa757('0x0'));var moment=require(_0xa757('0x1'));var util=require('util');var _=require('lodash');var logger=require('../../config/logger')(_0xa757('0x2'));var config=require(_0xa757('0x3'));var ami=new Manager(config[_0xa757('0x4')][_0xa757('0x5')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')]['username'],config[_0xa757('0x4')][_0xa757('0x6')],!![]);ami['keepConnected']();ami[_0xa757('0x7')]=BPromise[_0xa757('0x8')](ami[_0xa757('0x9')]);function error(_0x1a95ee){logger[_0xa757('0xa')](util['format'](_0xa757('0xb'),config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')],util[_0xa757('0xd')](_0x1a95ee,![],null)));}function close(){logger['error'](util['format']('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk']['username'],config[_0xa757('0x4')]['ip'],config['asterisk']['port']));}ami[_0xa757('0xe')]=function(){return function(){return ami['Action']({'action':'sipshowregistry'});};};ami[_0xa757('0xf')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x10')});};};ami[_0xa757('0x11')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x12')});};};ami[_0xa757('0x13')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x14')});};};ami[_0xa757('0x15')]=function(){return function(){return ami['Action']({'action':_0xa757('0x16')});};};function connect(_0x44eab8){logger[_0xa757('0x17')](util['format']('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')]));ami[_0xa757('0x18')]('error',error);ami[_0xa757('0x18')]('close',close);}ami['on'](_0xa757('0x19'),connect);ami['on'](_0xa757('0x1a'),function(_0x14014c){logger[_0xa757('0x17')](util['format']('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')],util[_0xa757('0xd')](_0x14014c,![],null)));});ami['on'](_0xa757('0x1b'),function(_0x21f1af){logger[_0xa757('0x17')](util['format'](_0xa757('0x1c'),config['asterisk'][_0xa757('0xc')],config['asterisk']['ip'],config[_0xa757('0x4')][_0xa757('0x5')]));return BPromise[_0xa757('0x1d')]()['then'](ami[_0xa757('0xe')]())[_0xa757('0x1e')](ami[_0xa757('0xf')]())[_0xa757('0x1e')](ami['actionSipPeerStatus']())[_0xa757('0x1e')](ami['actionQueueSummary']())['then'](ami['actionCoreShowChannels']())['catch'](function(_0xfdf69d){logger['error'](_0xa757('0x1f'),util[_0xa757('0xd')](_0xfdf69d,{'showHidden':![],'depth':null}));});});ami['once'](_0xa757('0xa'),error);ami['once'](_0xa757('0x20'),close);module[_0xa757('0x21')]=ami;
\ No newline at end of file
index 6f40638..efd1f62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['result','catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','request','then','debug','rpc','memberReport','error','message'];(function(_0x919445,_0x5467dc){var _0x511b3e=function(_0xde10f3){while(--_0xde10f3){_0x919445['push'](_0x919445['shift']());}};_0x511b3e(++_0x5467dc);}(_0xe706,0xa3));var _0x6e70=function(_0x2cd1fb,_0x291f55){_0x2cd1fb=_0x2cd1fb-0x0;var _0x48fd2b=_0xe706[_0x2cd1fb];return _0x48fd2b;};'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
+var _0x9bde=['message','result','catch','exports','bluebird','ami','http','Request','request','debug','rpc','memberReport','error'];(function(_0x4080dd,_0x5b595d){var _0x4ecf85=function(_0x5d281a){while(--_0x5d281a){_0x4080dd['push'](_0x4080dd['shift']());}};_0x4ecf85(++_0x5b595d);}(_0x9bde,0xe1));var _0xe9bd=function(_0x1d9082,_0x5916d4){_0x1d9082=_0x1d9082-0x0;var _0x18ed76=_0x9bde[_0x1d9082];return _0x18ed76;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xe9bd('0x0'));var logger=require('../../config/logger')(_0xe9bd('0x1'));var client=jayson['client'][_0xe9bd('0x2')]({'port':0x2329});client[_0xe9bd('0x3')]=function(_0x131f6a,_0x1c1b34){return new BPromise(function(_0x10822d,_0x1a4d14){return client[_0xe9bd('0x4')](_0x131f6a,_0x1c1b34)['then'](function(_0x4763e9){logger[_0xe9bd('0x5')](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x1c1b34,_0x4763e9);if(_0x4763e9[_0xe9bd('0x8')]){logger[_0xe9bd('0x8')](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x4763e9[_0xe9bd('0x8')][_0xe9bd('0x9')],_0x1c1b34);return _0x1a4d14(_0x4763e9['error']['message']);}else{return _0x10822d(_0x4763e9[_0xe9bd('0xa')]);}})[_0xe9bd('0xb')](function(_0x2601ac){logger['error'](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x2601ac,_0x1c1b34);return _0x1a4d14(_0x2601ac);});});};module[_0xe9bd('0xc')]=client;
\ No newline at end of file
index 2f05b17..98d8880 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb407=['prototype','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','exports','util','isNil','string','voiceQueue','name','phone','Contact','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname'];(function(_0xc2c85c,_0x13b1c5){var _0x5aa8d0=function(_0x353b90){while(--_0x353b90){_0xc2c85c['push'](_0xc2c85c['shift']());}};_0x5aa8d0(++_0x13b1c5);}(_0xb407,0x13a));var _0x7b40=function(_0x227efd,_0x370383){_0x227efd=_0x227efd-0x0;var _0x1919ed=_0xb407[_0x227efd];return _0x1919ed;};'use strict';var util=require(_0x7b40('0x0'));var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x33dbc4,_0x5f436c,_0x3f2ace){var _0x9d02f9='';if(!_[_0x7b40('0x1')](_0x5f436c)&&'string'===typeof _0x5f436c){_0x9d02f9+=_0x5f436c;}if(!_[_0x7b40('0x1')](_0x3f2ace)&&_0x7b40('0x2')===typeof _0x3f2ace){_0x9d02f9+='\x20'+_0x3f2ace;}if(_0x9d02f9!==''){return _0x9d02f9;}return _0x33dbc4;}function Action(_0x326b3f,_0x2884bb,_0xecd80a){this[_0x7b40('0x3')]=_0x326b3f;this['uniqueid']=_0xecd80a||undefined;this[_0x7b40('0x4')]=checkNameSurname(_0x2884bb['Contact'][_0x7b40('0x5')],_0x2884bb[_0x7b40('0x6')][_0x7b40('0x7')],_0x2884bb[_0x7b40('0x6')][_0x7b40('0x8')]);this[_0x7b40('0x9')]=_0x2884bb['Contact'][_0x7b40('0x5')];this[_0x7b40('0xa')]=_0x326b3f['name'];this[_0x7b40('0xb')]=_0x2884bb[_0x7b40('0xb')]||![];this[_0x7b40('0xc')]=_0x326b3f[_0x7b40('0xc')];this[_0x7b40('0xd')]=_0x326b3f[_0x7b40('0xd')]||0x3;this[_0x7b40('0xe')]=_0x2884bb['scheduledat'];this[_0x7b40('0xf')]=_0x2884bb[_0x7b40('0xf')];this[_0x7b40('0x10')]=_0x2884bb[_0x7b40('0x10')];this[_0x7b40('0x11')]=_0x2884bb[_0x7b40('0x11')];this[_0x7b40('0x12')]=_0x2884bb[_0x7b40('0x12')];this[_0x7b40('0x13')]=_0x2884bb['countdropretry'];this[_0x7b40('0x14')]=_0x2884bb[_0x7b40('0x14')];this[_0x7b40('0x15')]=_0x2884bb[_0x7b40('0x15')];this['countagentrejectretry']=_0x2884bb[_0x7b40('0x16')];this['ContactId']=_0x2884bb[_0x7b40('0x17')];this[_0x7b40('0x18')]=_0x2884bb['ListId'];this['UserId']=_0x2884bb[_0x7b40('0x19')];this[_0x7b40('0x1a')]=_0x2884bb[_0x7b40('0x1a')];this[_0x7b40('0x1b')]=_0x2884bb[_0x7b40('0x1b')];this[_0x7b40('0x1c')]=_0x2884bb['id'];this['ContactFirstName']=_0x2884bb['Contact']['firstName']||'';this[_0x7b40('0x1d')]=moment()[_0x7b40('0x1e')](_0x7b40('0x1f'));this[_0x7b40('0x20')]=_0x2884bb['callback'];this[_0x7b40('0x21')]=_0x2884bb[_0x7b40('0x21')];this[_0x7b40('0x22')]=_0x2884bb['callbackat'];this[_0x7b40('0x23')]=_0x2884bb[_0x7b40('0x23')];this[_0x7b40('0x24')]='';this[_0x7b40('0x25')]='';}Action[_0x7b40('0x26')]['getCaller']=function(){return util[_0x7b40('0x1e')](_0x7b40('0x27'),this['name'],this[_0x7b40('0x3')][_0x7b40('0x28')]>0x0?this['number'][_0x7b40('0x29')](this[_0x7b40('0x3')][_0x7b40('0x28')]):this[_0x7b40('0x9')]);};Action[_0x7b40('0x26')][_0x7b40('0x2a')]=function(){return this['queue'];};module[_0x7b40('0x2b')]=Action;
\ No newline at end of file
+var _0x5da5=['scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','getCaller','voiceQueue','substring','dialCutDigit','util','lodash','moment','isNil','string','uniqueid','phone','Contact','firstName','lastName','number','queue','name','active','type','dialQueueTimeout'];(function(_0x280a35,_0x1804b1){var _0x245a27=function(_0x14febf){while(--_0x14febf){_0x280a35['push'](_0x280a35['shift']());}};_0x245a27(++_0x1804b1);}(_0x5da5,0x148));var _0x55da=function(_0x3564f0,_0x3c2757){_0x3564f0=_0x3564f0-0x0;var _0x2105a1=_0x5da5[_0x3564f0];return _0x2105a1;};'use strict';var util=require(_0x55da('0x0'));var _=require(_0x55da('0x1'));var moment=require(_0x55da('0x2'));function checkNameSurname(_0x16f4d8,_0x20523a,_0x46e2ad){var _0x1df64f='';if(!_[_0x55da('0x3')](_0x20523a)&&_0x55da('0x4')===typeof _0x20523a){_0x1df64f+=_0x20523a;}if(!_[_0x55da('0x3')](_0x46e2ad)&&_0x55da('0x4')===typeof _0x46e2ad){_0x1df64f+='\x20'+_0x46e2ad;}if(_0x1df64f!==''){return _0x1df64f;}return _0x16f4d8;}function Action(_0x501422,_0x118b4c,_0x5b6f20){this['voiceQueue']=_0x501422;this[_0x55da('0x5')]=_0x5b6f20||undefined;this['name']=checkNameSurname(_0x118b4c['Contact'][_0x55da('0x6')],_0x118b4c[_0x55da('0x7')][_0x55da('0x8')],_0x118b4c[_0x55da('0x7')][_0x55da('0x9')]);this[_0x55da('0xa')]=_0x118b4c[_0x55da('0x7')][_0x55da('0x6')];this[_0x55da('0xb')]=_0x501422[_0x55da('0xc')];this['active']=_0x118b4c[_0x55da('0xd')]||![];this['type']=_0x501422[_0x55da('0xe')];this[_0x55da('0xf')]=_0x501422[_0x55da('0xf')]||0x3;this[_0x55da('0x10')]=_0x118b4c[_0x55da('0x10')];this[_0x55da('0x11')]=_0x118b4c['countbusyretry'];this[_0x55da('0x12')]=_0x118b4c['countcongestionretry'];this['countnoanswerretry']=_0x118b4c[_0x55da('0x13')];this[_0x55da('0x14')]=_0x118b4c[_0x55da('0x14')];this['countdropretry']=_0x118b4c[_0x55da('0x15')];this['countabandonedretry']=_0x118b4c['countabandonedretry'];this[_0x55da('0x16')]=_0x118b4c[_0x55da('0x16')];this['countagentrejectretry']=_0x118b4c[_0x55da('0x17')];this[_0x55da('0x18')]=_0x118b4c[_0x55da('0x18')];this['ListId']=_0x118b4c[_0x55da('0x19')];this[_0x55da('0x1a')]=_0x118b4c['UserId'];this['VoiceQueueId']=_0x118b4c[_0x55da('0x1b')];this['CampaignId']=_0x118b4c[_0x55da('0x1c')];this['idHopper']=_0x118b4c['id'];this[_0x55da('0x1d')]=_0x118b4c[_0x55da('0x7')][_0x55da('0x8')]||'';this[_0x55da('0x1e')]=moment()[_0x55da('0x1f')](_0x55da('0x20'));this[_0x55da('0x21')]=_0x118b4c[_0x55da('0x21')];this[_0x55da('0x22')]=_0x118b4c[_0x55da('0x22')];this[_0x55da('0x23')]=_0x118b4c[_0x55da('0x23')];this['recallme']=_0x118b4c[_0x55da('0x24')];this[_0x55da('0x25')]='';this['originatecalleridname']='';}Action[_0x55da('0x26')][_0x55da('0x27')]=function(){return util['format']('\x22%s\x22\x20<%s>',this[_0x55da('0xc')],this[_0x55da('0x28')]['dialCutDigit']>0x0?this[_0x55da('0xa')][_0x55da('0x29')](this[_0x55da('0x28')][_0x55da('0x2a')]):this[_0x55da('0xa')]);};Action[_0x55da('0x26')]['getQueue']=function(){return this[_0x55da('0xb')];};module['exports']=Action;
\ No newline at end of file
index ef8e9d3..46c5440 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6ba=['ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','answertime','membername','reason','callback','callbackuniqueid','callbackat','recallme'];(function(_0x254076,_0x5e7b8d){var _0x21a93e=function(_0x26aa78){while(--_0x26aa78){_0x254076['push'](_0x254076['shift']());}};_0x21a93e(++_0x5e7b8d);}(_0xb6ba,0x180));var _0xab6b=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xb6ba[_0xbe200f];return _0x192597;};'use strict';var util=require(_0xab6b('0x0'));var _=require(_0xab6b('0x1'));var moment=require(_0xab6b('0x2'));function getSeconds(_0x1df86b,_0x166326){var _0x35d7d5=moment(_0x1df86b)[_0xab6b('0x3')](0x0);var _0x21a02a=moment(_0x166326)[_0xab6b('0x3')](0x0);return _0x35d7d5[_0xab6b('0x4')](_0x21a02a,_0xab6b('0x5'));}function AgentComplete(_0x38c01c,_0x5237d7){this[_0xab6b('0x6')]=0x4;this[_0xab6b('0x7')]='Answer';this[_0xab6b('0x8')]=_0x38c01c['scheduledat'];this[_0xab6b('0x9')]=_0x38c01c[_0xab6b('0x9')];this[_0xab6b('0xa')]=_0x38c01c['type']===_0xab6b('0xb')?_0xab6b('0xc'):_0x38c01c[_0xab6b('0x9')];this[_0xab6b('0xd')]=_0x38c01c[_0xab6b('0xd')];this[_0xab6b('0xe')]=_0x38c01c[_0xab6b('0xe')];this[_0xab6b('0xf')]=_0x38c01c[_0xab6b('0xf')];this['countglobal']=_0x38c01c['countbusyretry']+_0x38c01c[_0xab6b('0xe')]+_0x38c01c[_0xab6b('0xf')]+_0x38c01c[_0xab6b('0x10')]+_0x38c01c[_0xab6b('0x11')]+_0x38c01c[_0xab6b('0x12')]+_0x38c01c[_0xab6b('0x13')]+_0x38c01c[_0xab6b('0x14')];this[_0xab6b('0x10')]=_0x38c01c[_0xab6b('0x10')];this['countdropretry']=_0x38c01c[_0xab6b('0x11')];this[_0xab6b('0x12')]=_0x38c01c[_0xab6b('0x12')];this['countmachineretry']=_0x38c01c['countmachineretry'];this[_0xab6b('0x14')]=_0x38c01c[_0xab6b('0x14')];this[_0xab6b('0x15')]=_0x5237d7[_0xab6b('0x15')];this[_0xab6b('0x16')]=_0x38c01c['name'];this[_0xab6b('0x17')]=_0x38c01c[_0xab6b('0x18')];this[_0xab6b('0x19')]=_0x38c01c[_0xab6b('0x19')];this[_0xab6b('0x1a')]=_0x38c01c[_0xab6b('0x1a')];this['answertime']=_0x38c01c['answertime'];this[_0xab6b('0x1b')]=moment()[_0xab6b('0x1c')](_0xab6b('0x1d'));this[_0xab6b('0x1e')]=getSeconds(_0x38c01c[_0xab6b('0x1a')],_0x38c01c[_0xab6b('0x19')]);this['holdtime']=getSeconds(_0x38c01c['answertime'],_0x38c01c[_0xab6b('0x1a')]);this[_0xab6b('0x1f')]=getSeconds(this[_0xab6b('0x1b')],_0x38c01c[_0xab6b('0x20')]);this[_0xab6b('0xc')]=_0x5237d7['queue'];this['membername']=_0x5237d7[_0xab6b('0x21')];this[_0xab6b('0x22')]=_0x5237d7[_0xab6b('0x22')];this[_0xab6b('0x23')]=_0x38c01c[_0xab6b('0x23')];this[_0xab6b('0x24')]=_0x38c01c[_0xab6b('0x24')];this[_0xab6b('0x25')]=_0x38c01c[_0xab6b('0x25')];this[_0xab6b('0x26')]=_0x38c01c['recallme'];this[_0xab6b('0x27')]=_0x38c01c['ContactId'];this[_0xab6b('0x28')]=_0x38c01c[_0xab6b('0x28')];this['UserId']=_0x38c01c[_0xab6b('0x29')];this[_0xab6b('0x2a')]=_0x38c01c[_0xab6b('0x2a')];this[_0xab6b('0x2b')]=_0x38c01c[_0xab6b('0x2b')];this['originatecalleridnum']=_0x38c01c[_0xab6b('0x2c')]||'';this[_0xab6b('0x2d')]=_0x38c01c[_0xab6b('0x2d')]||'';}module[_0xab6b('0x2e')]=AgentComplete;
\ No newline at end of file
+var _0xde1f=['calleridnum','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','answertime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','countmachineretry','uniqueid','name'];(function(_0x2c30e4,_0x502c32){var _0x21e3e0=function(_0x4002cc){while(--_0x4002cc){_0x2c30e4['push'](_0x2c30e4['shift']());}};_0x21e3e0(++_0x502c32);}(_0xde1f,0x1e3));var _0xfde1=function(_0x386be7,_0x124b9e){_0x386be7=_0x386be7-0x0;var _0x2f45f9=_0xde1f[_0x386be7];return _0x2f45f9;};'use strict';var util=require(_0xfde1('0x0'));var _=require(_0xfde1('0x1'));var moment=require(_0xfde1('0x2'));function getSeconds(_0x4ee896,_0x4cf9da){var _0x262dde=moment(_0x4ee896)[_0xfde1('0x3')](0x0);var _0x44142=moment(_0x4cf9da)[_0xfde1('0x3')](0x0);return _0x262dde['diff'](_0x44142,_0xfde1('0x4'));}function AgentComplete(_0x12b9fa,_0x1227bb){this[_0xfde1('0x5')]=0x4;this[_0xfde1('0x6')]=_0xfde1('0x7');this[_0xfde1('0x8')]=_0x12b9fa[_0xfde1('0x8')];this['type']=_0x12b9fa[_0xfde1('0x9')];this[_0xfde1('0xa')]=_0x12b9fa['type']==='outbound'?_0xfde1('0xb'):_0x12b9fa[_0xfde1('0x9')];this[_0xfde1('0xc')]=_0x12b9fa[_0xfde1('0xc')];this[_0xfde1('0xd')]=_0x12b9fa['countcongestionretry'];this[_0xfde1('0xe')]=_0x12b9fa[_0xfde1('0xe')];this[_0xfde1('0xf')]=_0x12b9fa[_0xfde1('0xc')]+_0x12b9fa[_0xfde1('0xd')]+_0x12b9fa[_0xfde1('0xe')]+_0x12b9fa['countnosuchnumberretry']+_0x12b9fa[_0xfde1('0x10')]+_0x12b9fa['countabandonedretry']+_0x12b9fa['countmachineretry']+_0x12b9fa[_0xfde1('0x11')];this['countnosuchnumberretry']=_0x12b9fa[_0xfde1('0x12')];this[_0xfde1('0x10')]=_0x12b9fa['countdropretry'];this[_0xfde1('0x13')]=_0x12b9fa[_0xfde1('0x13')];this[_0xfde1('0x14')]=_0x12b9fa['countmachineretry'];this['countagentrejectretry']=_0x12b9fa['countagentrejectretry'];this[_0xfde1('0x15')]=_0x1227bb['uniqueid'];this['calleridname']=_0x12b9fa[_0xfde1('0x16')];this[_0xfde1('0x17')]=_0x12b9fa['number'];this[_0xfde1('0x18')]=_0x12b9fa['starttime'];this[_0xfde1('0x19')]=_0x12b9fa['responsetime'];this['answertime']=_0x12b9fa['answertime'];this[_0xfde1('0x1a')]=moment()[_0xfde1('0x1b')](_0xfde1('0x1c'));this[_0xfde1('0x1d')]=getSeconds(_0x12b9fa[_0xfde1('0x19')],_0x12b9fa[_0xfde1('0x18')]);this[_0xfde1('0x1e')]=getSeconds(_0x12b9fa[_0xfde1('0x1f')],_0x12b9fa[_0xfde1('0x19')]);this[_0xfde1('0x20')]=getSeconds(this[_0xfde1('0x1a')],_0x12b9fa[_0xfde1('0x1f')]);this[_0xfde1('0xb')]=_0x1227bb[_0xfde1('0xb')];this[_0xfde1('0x21')]=_0x1227bb[_0xfde1('0x21')];this[_0xfde1('0x22')]=_0x1227bb[_0xfde1('0x22')];this[_0xfde1('0x23')]=_0x12b9fa[_0xfde1('0x23')];this[_0xfde1('0x24')]=_0x12b9fa[_0xfde1('0x24')];this['callbackat']=_0x12b9fa[_0xfde1('0x25')];this[_0xfde1('0x26')]=_0x12b9fa[_0xfde1('0x26')];this[_0xfde1('0x27')]=_0x12b9fa[_0xfde1('0x27')];this[_0xfde1('0x28')]=_0x12b9fa[_0xfde1('0x28')];this['UserId']=_0x12b9fa[_0xfde1('0x29')];this[_0xfde1('0x2a')]=_0x12b9fa[_0xfde1('0x2a')];this['CampaignId']=_0x12b9fa[_0xfde1('0x2b')];this[_0xfde1('0x2c')]=_0x12b9fa[_0xfde1('0x2c')]||'';this[_0xfde1('0x2d')]=_0x12b9fa[_0xfde1('0x2d')]||'';}module['exports']=AgentComplete;
\ No newline at end of file
index 3a84190..426ebb1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab86=['ringtime','holdtime','talktime','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','calleridname','calleridnum','starttime','responsetime','endtime'];(function(_0x2c008f,_0x4065b8){var _0x1b5220=function(_0x564de4){while(--_0x564de4){_0x2c008f['push'](_0x2c008f['shift']());}};_0x1b5220(++_0x4065b8);}(_0xab86,0x13e));var _0x6ab8=function(_0x237f36,_0x1c5614){_0x237f36=_0x237f36-0x0;var _0x12e837=_0xab86[_0x237f36];return _0x12e837;};'use strict';var util=require(_0x6ab8('0x0'));var _=require(_0x6ab8('0x1'));var moment=require(_0x6ab8('0x2'));function getSeconds(_0x487872,_0x548007){var _0xfa522f=moment(_0x487872)['milliseconds'](0x0);var _0x1193a1=moment(_0x548007)['milliseconds'](0x0);return _0xfa522f[_0x6ab8('0x3')](_0x1193a1,_0x6ab8('0x4'));}function Final(_0x420a9f){this[_0x6ab8('0x5')]=_0x420a9f[_0x6ab8('0x5')];this[_0x6ab8('0x6')]=_0x420a9f[_0x6ab8('0x6')];this[_0x6ab8('0x7')]=_0x420a9f[_0x6ab8('0x7')];this[_0x6ab8('0x8')]=_0x420a9f[_0x6ab8('0x7')]===_0x6ab8('0x9')?_0x6ab8('0xa'):_0x420a9f['type'];this['countbusyretry']=_0x420a9f[_0x6ab8('0xb')];this['countcongestionretry']=_0x420a9f[_0x6ab8('0xc')];this[_0x6ab8('0xd')]=_0x420a9f[_0x6ab8('0xd')];this['countglobal']=_0x420a9f[_0x6ab8('0xb')]+_0x420a9f[_0x6ab8('0xc')]+_0x420a9f['countnoanswerretry']+_0x420a9f[_0x6ab8('0xe')]+_0x420a9f[_0x6ab8('0xf')]+_0x420a9f[_0x6ab8('0x10')]+_0x420a9f['countmachineretry']+_0x420a9f[_0x6ab8('0x11')];this[_0x6ab8('0xe')]=_0x420a9f[_0x6ab8('0xe')];this[_0x6ab8('0xf')]=_0x420a9f[_0x6ab8('0xf')];this[_0x6ab8('0x10')]=_0x420a9f[_0x6ab8('0x10')];this[_0x6ab8('0x12')]=_0x420a9f[_0x6ab8('0x12')];this['countagentrejectretry']=_0x420a9f[_0x6ab8('0x11')];this[_0x6ab8('0xa')]=_0x420a9f[_0x6ab8('0xa')];this['calleridname']=_0x420a9f[_0x6ab8('0x13')];this[_0x6ab8('0x14')]=_0x420a9f['calleridnum'];this['starttime']=_0x420a9f[_0x6ab8('0x15')];this['responsetime']=_0x420a9f[_0x6ab8('0x16')];this[_0x6ab8('0x17')]=_0x420a9f[_0x6ab8('0x16')];this['ringtime']=_0x420a9f[_0x6ab8('0x18')]||0x0;this[_0x6ab8('0x19')]=_0x420a9f[_0x6ab8('0x19')]||0x0;this[_0x6ab8('0x1a')]=_0x420a9f['talktime']||0x0;this[_0x6ab8('0x1b')]=_0x420a9f[_0x6ab8('0x1b')];this['callbackuniqueid']=_0x420a9f['callbackuniqueid'];this['callbackat']=_0x420a9f[_0x6ab8('0x1c')];this[_0x6ab8('0x1d')]=_0x420a9f[_0x6ab8('0x1d')];this['ContactId']=_0x420a9f[_0x6ab8('0x1e')];this[_0x6ab8('0x1f')]=_0x420a9f['ListId'];this['UserId']=_0x420a9f[_0x6ab8('0x20')];this[_0x6ab8('0x21')]=_0x420a9f['VoiceQueueId'];this[_0x6ab8('0x22')]=_0x420a9f[_0x6ab8('0x22')];this[_0x6ab8('0x23')]=_0x420a9f[_0x6ab8('0x23')]||'';this[_0x6ab8('0x24')]=_0x420a9f[_0x6ab8('0x24')]||'';}module[_0x6ab8('0x25')]=Final;
\ No newline at end of file
+var _0x04de=['VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','recallme','ListId','UserId'];(function(_0x9ad00b,_0x5d9522){var _0x4f4a82=function(_0x19c099){while(--_0x19c099){_0x9ad00b['push'](_0x9ad00b['shift']());}};_0x4f4a82(++_0x5d9522);}(_0x04de,0x107));var _0xe04d=function(_0x283f8e,_0x328848){_0x283f8e=_0x283f8e-0x0;var _0x368cfa=_0x04de[_0x283f8e];return _0x368cfa;};'use strict';var util=require(_0xe04d('0x0'));var _=require(_0xe04d('0x1'));var moment=require(_0xe04d('0x2'));function getSeconds(_0x299552,_0x1e650d){var _0x28f63f=moment(_0x299552)[_0xe04d('0x3')](0x0);var _0x43c4b1=moment(_0x1e650d)[_0xe04d('0x3')](0x0);return _0x28f63f[_0xe04d('0x4')](_0x43c4b1,_0xe04d('0x5'));}function Final(_0x4804c8){this['uniqueid']=_0x4804c8['uniqueid'];this['scheduledat']=_0x4804c8[_0xe04d('0x6')];this[_0xe04d('0x7')]=_0x4804c8[_0xe04d('0x7')];this[_0xe04d('0x8')]=_0x4804c8[_0xe04d('0x7')]===_0xe04d('0x9')?_0xe04d('0xa'):_0x4804c8[_0xe04d('0x7')];this['countbusyretry']=_0x4804c8[_0xe04d('0xb')];this[_0xe04d('0xc')]=_0x4804c8[_0xe04d('0xc')];this[_0xe04d('0xd')]=_0x4804c8[_0xe04d('0xd')];this[_0xe04d('0xe')]=_0x4804c8[_0xe04d('0xb')]+_0x4804c8[_0xe04d('0xc')]+_0x4804c8[_0xe04d('0xd')]+_0x4804c8['countnosuchnumberretry']+_0x4804c8[_0xe04d('0xf')]+_0x4804c8[_0xe04d('0x10')]+_0x4804c8[_0xe04d('0x11')]+_0x4804c8[_0xe04d('0x12')];this[_0xe04d('0x13')]=_0x4804c8[_0xe04d('0x13')];this[_0xe04d('0xf')]=_0x4804c8[_0xe04d('0xf')];this[_0xe04d('0x10')]=_0x4804c8[_0xe04d('0x10')];this[_0xe04d('0x11')]=_0x4804c8[_0xe04d('0x11')];this['countagentrejectretry']=_0x4804c8[_0xe04d('0x12')];this['queue']=_0x4804c8[_0xe04d('0xa')];this['calleridname']=_0x4804c8[_0xe04d('0x14')];this[_0xe04d('0x15')]=_0x4804c8[_0xe04d('0x15')];this[_0xe04d('0x16')]=_0x4804c8[_0xe04d('0x16')];this[_0xe04d('0x17')]=_0x4804c8[_0xe04d('0x17')];this[_0xe04d('0x18')]=_0x4804c8[_0xe04d('0x17')];this['ringtime']=_0x4804c8[_0xe04d('0x19')]||0x0;this[_0xe04d('0x1a')]=_0x4804c8[_0xe04d('0x1a')]||0x0;this[_0xe04d('0x1b')]=_0x4804c8[_0xe04d('0x1b')]||0x0;this[_0xe04d('0x1c')]=_0x4804c8['callback'];this[_0xe04d('0x1d')]=_0x4804c8[_0xe04d('0x1d')];this['callbackat']=_0x4804c8['callbackat'];this['recallme']=_0x4804c8[_0xe04d('0x1e')];this['ContactId']=_0x4804c8['ContactId'];this[_0xe04d('0x1f')]=_0x4804c8[_0xe04d('0x1f')];this['UserId']=_0x4804c8[_0xe04d('0x20')];this['VoiceQueueId']=_0x4804c8[_0xe04d('0x21')];this['CampaignId']=_0x4804c8[_0xe04d('0x22')];this[_0xe04d('0x23')]=_0x4804c8[_0xe04d('0x23')]||'';this[_0xe04d('0x24')]=_0x4804c8[_0xe04d('0x24')]||'';}module['exports']=Final;
\ No newline at end of file
index 143122c..d429bbe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b2d=['number','starttime','responsetime','endtime','format','ringtime','holdtime','talktime','membername','IVR','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','seconds','state','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum'];(function(_0x131aca,_0x221b5f){var _0x57165b=function(_0x1c4f81){while(--_0x1c4f81){_0x131aca['push'](_0x131aca['shift']());}};_0x57165b(++_0x221b5f);}(_0x8b2d,0xfb));var _0xd8b2=function(_0x7f9224,_0x186851){_0x7f9224=_0x7f9224-0x0;var _0x3bc305=_0x8b2d[_0x7f9224];return _0x3bc305;};'use strict';var util=require(_0xd8b2('0x0'));var _=require(_0xd8b2('0x1'));var moment=require(_0xd8b2('0x2'));function getSeconds(_0x303bc2,_0xe62a8){var _0x1376a5=moment(_0x303bc2)[_0xd8b2('0x3')](0x0);var _0x14e388=moment(_0xe62a8)[_0xd8b2('0x3')](0x0);return _0x1376a5['diff'](_0x14e388,_0xd8b2('0x4'));}function Hangup(_0x3e32b4,_0x368bcc){this[_0xd8b2('0x5')]=0x4;this[_0xd8b2('0x6')]='Answer';this[_0xd8b2('0x7')]=_0x3e32b4['scheduledat'];this[_0xd8b2('0x8')]=_0x3e32b4[_0xd8b2('0x8')];this[_0xd8b2('0x9')]=_0x3e32b4[_0xd8b2('0x8')]===_0xd8b2('0xa')?_0xd8b2('0xb'):_0x3e32b4[_0xd8b2('0x8')];this[_0xd8b2('0xc')]=_0x3e32b4[_0xd8b2('0xc')];this[_0xd8b2('0xd')]=_0x3e32b4[_0xd8b2('0xd')];this['countnoanswerretry']=_0x3e32b4[_0xd8b2('0xe')];this[_0xd8b2('0xf')]=_0x3e32b4[_0xd8b2('0xc')]+_0x3e32b4[_0xd8b2('0xd')]+_0x3e32b4[_0xd8b2('0xe')]+_0x3e32b4[_0xd8b2('0x10')]+_0x3e32b4[_0xd8b2('0x11')]+_0x3e32b4[_0xd8b2('0x12')]+_0x3e32b4[_0xd8b2('0x13')]+_0x3e32b4['countagentrejectretry'];this[_0xd8b2('0x10')]=_0x3e32b4['countnosuchnumberretry'];this[_0xd8b2('0x11')]=_0x3e32b4['countdropretry'];this['countabandonedretry']=_0x3e32b4[_0xd8b2('0x12')];this[_0xd8b2('0x13')]=_0x3e32b4[_0xd8b2('0x13')];this[_0xd8b2('0x14')]=_0x3e32b4[_0xd8b2('0x14')];this[_0xd8b2('0x15')]=_0x368bcc['uniqueid'];this[_0xd8b2('0x16')]=_0x3e32b4[_0xd8b2('0x17')];this[_0xd8b2('0x18')]=_0x3e32b4[_0xd8b2('0x19')];this[_0xd8b2('0x1a')]=_0x3e32b4[_0xd8b2('0x1a')];this[_0xd8b2('0x1b')]=_0x3e32b4[_0xd8b2('0x1b')];this[_0xd8b2('0x1c')]=moment()[_0xd8b2('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xd8b2('0x1e')]=getSeconds(_0x3e32b4[_0xd8b2('0x1b')],_0x3e32b4['starttime']);this[_0xd8b2('0x1f')]=0x0;this[_0xd8b2('0x20')]=getSeconds(this[_0xd8b2('0x1c')],_0x3e32b4[_0xd8b2('0x1b')]);this[_0xd8b2('0xb')]=_0x3e32b4[_0xd8b2('0xb')];this[_0xd8b2('0x21')]=_0xd8b2('0x22');this[_0xd8b2('0x23')]=_0x368bcc['cause-txt'];this[_0xd8b2('0x24')]=_0x3e32b4[_0xd8b2('0x24')];this[_0xd8b2('0x25')]=_0x3e32b4[_0xd8b2('0x25')];this[_0xd8b2('0x26')]=_0x3e32b4[_0xd8b2('0x26')];this[_0xd8b2('0x27')]=_0x3e32b4['recallme'];this[_0xd8b2('0x28')]=_0x3e32b4[_0xd8b2('0x28')];this[_0xd8b2('0x29')]=_0x3e32b4['ListId'];this[_0xd8b2('0x2a')]=_0x3e32b4[_0xd8b2('0x2a')];this[_0xd8b2('0x2b')]=_0x3e32b4['VoiceQueueId'];this[_0xd8b2('0x2c')]=_0x3e32b4[_0xd8b2('0x2c')];}module[_0xd8b2('0x2d')]=Hangup;
\ No newline at end of file
+var _0xf0d0=['countglobal','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','holdtime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x53c13b,_0x16e67d){var _0x5ee1b7=function(_0x3d52b5){while(--_0x3d52b5){_0x53c13b['push'](_0x53c13b['shift']());}};_0x5ee1b7(++_0x16e67d);}(_0xf0d0,0x160));var _0x0f0d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf0d0[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x0f0d('0x0'));var _=require(_0x0f0d('0x1'));var moment=require(_0x0f0d('0x2'));function getSeconds(_0x5b9c87,_0x312d60){var _0x585d88=moment(_0x5b9c87)[_0x0f0d('0x3')](0x0);var _0x410fcc=moment(_0x312d60)[_0x0f0d('0x3')](0x0);return _0x585d88[_0x0f0d('0x4')](_0x410fcc,_0x0f0d('0x5'));}function Hangup(_0x278adf,_0x8ecf54){this[_0x0f0d('0x6')]=0x4;this['statedesc']=_0x0f0d('0x7');this[_0x0f0d('0x8')]=_0x278adf[_0x0f0d('0x8')];this[_0x0f0d('0x9')]=_0x278adf[_0x0f0d('0x9')];this[_0x0f0d('0xa')]=_0x278adf[_0x0f0d('0x9')]===_0x0f0d('0xb')?_0x0f0d('0xc'):_0x278adf['type'];this[_0x0f0d('0xd')]=_0x278adf[_0x0f0d('0xd')];this[_0x0f0d('0xe')]=_0x278adf[_0x0f0d('0xe')];this[_0x0f0d('0xf')]=_0x278adf[_0x0f0d('0xf')];this[_0x0f0d('0x10')]=_0x278adf['countbusyretry']+_0x278adf[_0x0f0d('0xe')]+_0x278adf[_0x0f0d('0xf')]+_0x278adf['countnosuchnumberretry']+_0x278adf[_0x0f0d('0x11')]+_0x278adf[_0x0f0d('0x12')]+_0x278adf['countmachineretry']+_0x278adf[_0x0f0d('0x13')];this[_0x0f0d('0x14')]=_0x278adf['countnosuchnumberretry'];this[_0x0f0d('0x11')]=_0x278adf[_0x0f0d('0x11')];this[_0x0f0d('0x12')]=_0x278adf['countabandonedretry'];this[_0x0f0d('0x15')]=_0x278adf[_0x0f0d('0x15')];this[_0x0f0d('0x13')]=_0x278adf['countagentrejectretry'];this[_0x0f0d('0x16')]=_0x8ecf54[_0x0f0d('0x16')];this[_0x0f0d('0x17')]=_0x278adf[_0x0f0d('0x18')];this[_0x0f0d('0x19')]=_0x278adf[_0x0f0d('0x1a')];this['starttime']=_0x278adf[_0x0f0d('0x1b')];this['responsetime']=_0x278adf[_0x0f0d('0x1c')];this[_0x0f0d('0x1d')]=moment()[_0x0f0d('0x1e')]('YYYY-MM-DD\x20HH:mm:ss');this['ringtime']=getSeconds(_0x278adf[_0x0f0d('0x1c')],_0x278adf[_0x0f0d('0x1b')]);this[_0x0f0d('0x1f')]=0x0;this['talktime']=getSeconds(this[_0x0f0d('0x1d')],_0x278adf[_0x0f0d('0x1c')]);this[_0x0f0d('0xc')]=_0x278adf[_0x0f0d('0xc')];this[_0x0f0d('0x20')]=_0x0f0d('0x21');this[_0x0f0d('0x22')]=_0x8ecf54[_0x0f0d('0x23')];this[_0x0f0d('0x24')]=_0x278adf['callback'];this['callbackuniqueid']=_0x278adf[_0x0f0d('0x25')];this[_0x0f0d('0x26')]=_0x278adf[_0x0f0d('0x26')];this[_0x0f0d('0x27')]=_0x278adf['recallme'];this[_0x0f0d('0x28')]=_0x278adf[_0x0f0d('0x28')];this['ListId']=_0x278adf[_0x0f0d('0x29')];this[_0x0f0d('0x2a')]=_0x278adf[_0x0f0d('0x2a')];this[_0x0f0d('0x2b')]=_0x278adf[_0x0f0d('0x2b')];this[_0x0f0d('0x2c')]=_0x278adf['CampaignId'];}module[_0x0f0d('0x2d')]=Hangup;
\ No newline at end of file
index 61efb55..68a4b4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f66=['ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','calleridname','name','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0x3f66,0xc4));var _0x63f6=function(_0x3d4a7d,_0x140da9){_0x3d4a7d=_0x3d4a7d-0x0;var _0x1a5ca9=_0x3f66[_0x3d4a7d];return _0x1a5ca9;};'use strict';var util=require(_0x63f6('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0xa8097a,_0x553780){var _0xd95a77=moment(_0xa8097a)[_0x63f6('0x1')](0x0);var _0x44cc6a=moment(_0x553780)[_0x63f6('0x1')](0x0);return _0xd95a77['diff'](_0x44cc6a,_0x63f6('0x2'));}function History(_0x278f5d){this[_0x63f6('0x3')]=_0x278f5d['uniqueid'];this[_0x63f6('0x4')]=_0x278f5d[_0x63f6('0x4')]||undefined;this[_0x63f6('0x5')]=_0x278f5d['type'];this[_0x63f6('0x6')]=_0x278f5d[_0x63f6('0x5')]===_0x63f6('0x7')?_0x63f6('0x8'):_0x278f5d['type'];this['countbusyretry']=_0x278f5d[_0x63f6('0x9')];this[_0x63f6('0xa')]=_0x278f5d['countcongestionretry'];this[_0x63f6('0xb')]=_0x278f5d[_0x63f6('0xb')];this[_0x63f6('0xc')]=_0x278f5d[_0x63f6('0x9')]+_0x278f5d[_0x63f6('0xa')]+_0x278f5d[_0x63f6('0xb')]+_0x278f5d[_0x63f6('0xd')]+_0x278f5d[_0x63f6('0xe')]+_0x278f5d[_0x63f6('0xf')]+_0x278f5d['countmachineretry']+_0x278f5d[_0x63f6('0x10')];this['countnosuchnumberretry']=_0x278f5d[_0x63f6('0xd')];this[_0x63f6('0xe')]=_0x278f5d['countdropretry'];this[_0x63f6('0xf')]=_0x278f5d['countabandonedretry'];this[_0x63f6('0x11')]=_0x278f5d['countmachineretry'];this['countagentrejectretry']=_0x278f5d[_0x63f6('0x10')];this[_0x63f6('0x8')]=_0x278f5d[_0x63f6('0x8')];this[_0x63f6('0x12')]=_0x278f5d[_0x63f6('0x13')];this['calleridnum']=_0x278f5d[_0x63f6('0x14')];this['starttime']=_0x278f5d[_0x63f6('0x15')];this['responsetime']=_0x278f5d[_0x63f6('0x16')];this[_0x63f6('0x17')]=_0x278f5d[_0x63f6('0x16')];this[_0x63f6('0x18')]=getSeconds(_0x278f5d['responsetime'],_0x278f5d[_0x63f6('0x15')]);this[_0x63f6('0x19')]=0x0;this[_0x63f6('0x1a')]=0x0;this[_0x63f6('0x1b')]=_0x278f5d['callback'];this[_0x63f6('0x1c')]=_0x278f5d[_0x63f6('0x1c')];this[_0x63f6('0x1d')]=_0x278f5d['callbackat'];this[_0x63f6('0x1e')]=_0x278f5d[_0x63f6('0x1e')];this[_0x63f6('0x1f')]=_0x278f5d[_0x63f6('0x1f')];this[_0x63f6('0x20')]=_0x278f5d[_0x63f6('0x20')];this['UserId']=_0x278f5d['UserId'];this['VoiceQueueId']=_0x278f5d[_0x63f6('0x21')];this['CampaignId']=_0x278f5d[_0x63f6('0x22')];this['originatecalleridnum']=_0x278f5d[_0x63f6('0x23')]||'';this['originatecalleridname']=_0x278f5d[_0x63f6('0x24')]||'';}module[_0x63f6('0x25')]=History;
\ No newline at end of file
+var _0x4850=['countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','queue','calleridname','name','calleridnum','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','diff','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countnoanswerretry'];(function(_0x5d5f28,_0x494e6a){var _0x423788=function(_0x3d5532){while(--_0x3d5532){_0x5d5f28['push'](_0x5d5f28['shift']());}};_0x423788(++_0x494e6a);}(_0x4850,0xd3));var _0x0485=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x4850[_0x4b369d];return _0x571a98;};'use strict';var util=require(_0x0485('0x0'));var _=require('lodash');var moment=require(_0x0485('0x1'));function getSeconds(_0x3deb0a,_0x22377b){var _0x16faad=moment(_0x3deb0a)['milliseconds'](0x0);var _0x56cfc9=moment(_0x22377b)[_0x0485('0x2')](0x0);return _0x16faad[_0x0485('0x3')](_0x56cfc9,'seconds');}function History(_0x4fbd6b){this[_0x0485('0x4')]=_0x4fbd6b[_0x0485('0x4')];this[_0x0485('0x5')]=_0x4fbd6b[_0x0485('0x5')]||undefined;this[_0x0485('0x6')]=_0x4fbd6b['type'];this[_0x0485('0x7')]=_0x4fbd6b[_0x0485('0x6')]===_0x0485('0x8')?'queue':_0x4fbd6b['type'];this[_0x0485('0x9')]=_0x4fbd6b[_0x0485('0x9')];this['countcongestionretry']=_0x4fbd6b['countcongestionretry'];this['countnoanswerretry']=_0x4fbd6b[_0x0485('0xa')];this[_0x0485('0xb')]=_0x4fbd6b[_0x0485('0x9')]+_0x4fbd6b[_0x0485('0xc')]+_0x4fbd6b[_0x0485('0xa')]+_0x4fbd6b[_0x0485('0xd')]+_0x4fbd6b[_0x0485('0xe')]+_0x4fbd6b['countabandonedretry']+_0x4fbd6b[_0x0485('0xf')]+_0x4fbd6b[_0x0485('0x10')];this[_0x0485('0xd')]=_0x4fbd6b['countnosuchnumberretry'];this[_0x0485('0xe')]=_0x4fbd6b[_0x0485('0xe')];this[_0x0485('0x11')]=_0x4fbd6b[_0x0485('0x11')];this[_0x0485('0xf')]=_0x4fbd6b['countmachineretry'];this[_0x0485('0x10')]=_0x4fbd6b[_0x0485('0x10')];this['queue']=_0x4fbd6b[_0x0485('0x12')];this[_0x0485('0x13')]=_0x4fbd6b[_0x0485('0x14')];this[_0x0485('0x15')]=_0x4fbd6b['number'];this['starttime']=_0x4fbd6b['starttime'];this[_0x0485('0x16')]=_0x4fbd6b[_0x0485('0x16')];this['endtime']=_0x4fbd6b[_0x0485('0x16')];this[_0x0485('0x17')]=getSeconds(_0x4fbd6b[_0x0485('0x16')],_0x4fbd6b['starttime']);this[_0x0485('0x18')]=0x0;this[_0x0485('0x19')]=0x0;this[_0x0485('0x1a')]=_0x4fbd6b[_0x0485('0x1a')];this[_0x0485('0x1b')]=_0x4fbd6b[_0x0485('0x1b')];this[_0x0485('0x1c')]=_0x4fbd6b[_0x0485('0x1c')];this[_0x0485('0x1d')]=_0x4fbd6b[_0x0485('0x1d')];this['ContactId']=_0x4fbd6b[_0x0485('0x1e')];this['ListId']=_0x4fbd6b[_0x0485('0x1f')];this[_0x0485('0x20')]=_0x4fbd6b[_0x0485('0x20')];this[_0x0485('0x21')]=_0x4fbd6b[_0x0485('0x21')];this[_0x0485('0x22')]=_0x4fbd6b[_0x0485('0x22')];this[_0x0485('0x23')]=_0x4fbd6b['originatecalleridnum']||'';this['originatecalleridname']=_0x4fbd6b[_0x0485('0x24')]||'';}module['exports']=History;
\ No newline at end of file
index 62b5cb4..ff7ef7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a59=['countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countagentrejectretry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','add','YYYY-MM-DD\x20HH:mm:ss','ListId','[rescheduleContact][Machine]','AMD','[syncHangupInAMDIvr]','MACHINE','Machine','countnosuchnumberretry','reason\x2019\x20machine....','dialMachineRetryFrequency','minutes','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete]','[syncAgentComplete][createHistory]','syncQueueCallerAbandon','droptime','dialQueueTimeout','Drop','dropreason','TIMEOUT','agiafterat','dialDropMaxRetry','queueCallerAbandonCreateState','dialDropRetryFrequency','starttime','calleridname','calleridnum','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','actionid','strategy','locked','paused','stateinterface','rrmemory','push','[booked][unlockQueueStatus]','queueStatusComplete','syncQueueStatusComplete','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','syncCampaigns','checkIsTrunkReachable','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','command','iftime\x20%s,%s','interval','timezones','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','predictive','checkPreviewRecallReminder','user:%s','user:dialPreviewRecallReminder','handleIvr','dialTimezone','dialPreviewRecallmeReminder','dialGlobalInterval','launchHandleIvr','[syncCampaigns]','\x5cw{0,','pow','replace','random','actionOriginate','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','XMD-','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','OriginateError','endtime','[originate][error]','originate\x20action\x20Error','responsetime','getQueue','isSuccess','response','callProgressDetecting','checkRetriveMax','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Drop]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','object','[callProgressDetecting]','evt\x20is\x20undefine','reason','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','noanswer','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','dialGlobalMaxRetry','Global','contact\x20not\x20moved','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','dialPredictiveInterval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','averageHandleTime','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','dialPredictiveOptimizationPercentage','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','Agent','voicePause','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','[actionOriginate]\x20','checkIsBlackList','[handlePredictive][limitChannel]','tryOriginatePredictive','Contact.phone','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','interval\x20=\x20','Amax\x20=\x20','busyFactor','----\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]','p\x20=\x20','Umin\x20=\x20','exports','util','lodash','bluebird','uuid','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','syncQueueSummary','../ami','defaults','redis','localhost','../rpc/cmHopper','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/setting','./action','./history','./final','./hangup','XCALLY_IP_AGI','127.0.0.1','roundrobin','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','agentconnect','syncAgentConnect','bind','queuecallerabandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','getSettings','then','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','\x20INTERVAL_IS_NULL','Intervals','INTERVAL_IS_NULL','isEmpty','Error','stringify','milliseconds','type','outbound','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','md5','format','ivr','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','isUndefined','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','seconds','clearing\x20variable\x20start\x20progressive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','stack','inspect','length','originated','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','clearZombieChannels','[actions]','prototype','enqueue','Action','status','channel','catch','updateOriginated','queue','countReScheduled','[countReScheduled]\x20','[checkIsBlackList]\x20','resolve','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','saveInDb','merge','pick','ContactId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','Success','SIP/%s','reachable','unmonitored','isNil','amdstatus','exten','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','statedesc','emit','custom:amd','amd','uniqueid','membername','countmachineretry','countglobal','buildObj','[syncAgentComplete][createHistory][0]'];(function(_0x5348e2,_0x6eb949){var _0xfd04e3=function(_0x1d2fef){while(--_0x1d2fef){_0x5348e2['push'](_0x5348e2['shift']());}};_0xfd04e3(++_0x6eb949);}(_0x3a59,0x13b));var _0x93a5=function(_0x3bab09,_0x217c29){_0x3bab09=_0x3bab09-0x0;var _0x164376=_0x3a59[_0x3bab09];return _0x164376;};'use strict';var util=require(_0x93a5('0x0'));var _=require(_0x93a5('0x1'));var BPromise=require(_0x93a5('0x2'));var uuid=require(_0x93a5('0x3'));var moment=require('moment');var rr=require('rr');var md5=require('md5');var Redis=require(_0x93a5('0x4'));var ut=require(_0x93a5('0x5'));var config=require(_0x93a5('0x6'));var logger=require(_0x93a5('0x7'))(_0x93a5('0x8'));var loggerBooked=require(_0x93a5('0x7'))(_0x93a5('0x9'));var loggerPredictive=require(_0x93a5('0x7'))('predictive');var loggerPredictiveCalls=require(_0x93a5('0x7'))('predictiveCalls');var loggerSyncQueueSummary=require(_0x93a5('0x7'))(_0x93a5('0xa'));var ami=require(_0x93a5('0xb'));config['redis']=_[_0x93a5('0xc')](config[_0x93a5('0xd')],{'host':_0x93a5('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x93a5('0xd')]));var cmHopper=require(_0x93a5('0xf'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x93a5('0x10'));var voiceQueueRt=require(_0x93a5('0x11'));var RpcSetting=require(_0x93a5('0x12'));var Action=require(_0x93a5('0x13'));var History=require(_0x93a5('0x14'));var Final=require(_0x93a5('0x15'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0x93a5('0x16'));var ipAgi=process['env'][_0x93a5('0x17')]||_0x93a5('0x18');var strategy={'rrmemory':'rrmemory','roundrobin':_0x93a5('0x19')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x3c24f0){this[_0x93a5('0x1a')]=this['tail']?this['tail'][_0x93a5('0x1b')](_0x3c24f0):_0x3c24f0();};function Dialer(_0x47536e,_0x37d571){this[_0x93a5('0x1c')]=new Sequence();this[_0x93a5('0x1d')]=_0x37d571;this['voiceQueues']=_0x47536e[_0x93a5('0x1e')];this[_0x93a5('0x1f')]=_0x47536e['campaigns'];this[_0x93a5('0x20')]=_0x47536e[_0x93a5('0x20')];this['trunks']=_0x47536e[_0x93a5('0x21')];this[_0x93a5('0x22')]=config['maxNumberOriginate']||0x2;this[_0x93a5('0x23')]={};this[_0x93a5('0x24')]={};this[_0x93a5('0x25')]={};this[_0x93a5('0x26')]={};this[_0x93a5('0x27')]={};this[_0x93a5('0x28')]={};this[_0x93a5('0x29')]={};this[_0x93a5('0x2a')]={};this[_0x93a5('0x2b')]={};this['queueBookedRR']={};ami['on'](_0x93a5('0x2c'),this[_0x93a5('0x2d')][_0x93a5('0x2e')](this));ami['on'](_0x93a5('0x2f'),this['syncQueueCallerAbandon'][_0x93a5('0x2e')](this));ami['on'](_0x93a5('0x30'),this[_0x93a5('0x31')][_0x93a5('0x2e')](this));ami['on'](_0x93a5('0x32'),this[_0x93a5('0x33')][_0x93a5('0x2e')](this));ami['on'](_0x93a5('0x34'),this[_0x93a5('0xa')][_0x93a5('0x2e')](this));ami['on']('hangup',this[_0x93a5('0x35')][_0x93a5('0x2e')](this));ami['on'](_0x93a5('0x36'),this[_0x93a5('0x37')][_0x93a5('0x2e')](this));ami['on'](_0x93a5('0x38'),this[_0x93a5('0x39')]['bind'](this));ami['on'](_0x93a5('0x3a'),this[_0x93a5('0x3b')][_0x93a5('0x2e')](this));ami['on'](_0x93a5('0x3c'),this['syncQueueStatusComplete'][_0x93a5('0x2e')](this));this[_0x93a5('0x3d')]();this[_0x93a5('0x3e')]();RpcSetting[_0x93a5('0x3f')]()[_0x93a5('0x40')](function(_0x2e6de5){previewRecallmeReminderInterval=_0x2e6de5['previewRecallmeReminderInterval'];});}function isNotNull(_0x4f23d0){return _0x4f23d0!==null&&!_['isUndefined'](_0x4f23d0);}function checkIsLoggedIn(_0x5141de,_0x286a53){return function(){if(_0x286a53<=0x0){_0x5141de[_0x93a5('0x41')]=_0x93a5('0x42');throw _0x5141de[_0x93a5('0x43')]+_0x93a5('0x44');}};}function isActive(_0x37be92){return _0x37be92;}function checkIsActive(_0x48c256,_0x1b9b95){return function(){if(!isActive(_0x1b9b95)){_0x48c256[_0x93a5('0x41')]=_0x93a5('0x45');throw _0x48c256[_0x93a5('0x43')]+_0x93a5('0x46');}};}function checkInterval(_0x5b407d){return function(){if(!isNotNull(_0x5b407d[_0x93a5('0x47')])){_0x5b407d['message']='INTERVAL_IS_NULL';throw _0x5b407d[_0x93a5('0x43')]+_0x93a5('0x48');}if(!isNotNull(_0x5b407d['Interval'][_0x93a5('0x49')])){_0x5b407d[_0x93a5('0x41')]=_0x93a5('0x4a');throw _0x5b407d[_0x93a5('0x43')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x93a5('0x4b')](_0x5b407d[_0x93a5('0x47')][_0x93a5('0x49')]))){_0x5b407d['message']='INTERVAL_IS_NULL';throw _0x5b407d['name']+_0x93a5('0x48');}};}function msgResponse(_0x59bdad,_0x252d04,_0x3d5325){return{'action':_0x59bdad,'response':_0x252d04,'message':_0x3d5325,'stack':_0x3d5325};}function myreject(_0xa0c0f4){return function(_0x2fc699){return _0xa0c0f4(msgResponse('[ifTime][Action]',_0x93a5('0x4c'),JSON[_0x93a5('0x4d')](_0x2fc699)));};}function getSeconds(_0x1ee837,_0x53ef74){var _0x2221ce=moment(_0x1ee837)['milliseconds'](0x0);var _0x3c69fb=moment(_0x53ef74)[_0x93a5('0x4e')](0x0);return _0x2221ce['diff'](_0x3c69fb,'seconds');}function emit(_0x395d00,_0x5d143c,_0x438570){io['to'](_0x395d00)['emit'](_0x5d143c,_0x438570);}function emitVoiceQueueSummary(_0x542499){if(_0x542499[_0x93a5('0x4f')]===_0x93a5('0x50')){var _0x5a6682={'id':_0x542499['id'],'name':_0x542499[_0x93a5('0x43')],'strategy':_0x542499['strategy'],'answered':_0x542499['answered'],'available':_0x542499[_0x93a5('0x51')],'loggedIn':_0x542499[_0x93a5('0x52')],'pTalking':_0x542499[_0x93a5('0x53')],'sumBillable':_0x542499[_0x93a5('0x54')],'sumDuration':_0x542499[_0x93a5('0x55')],'sumHoldTime':_0x542499[_0x93a5('0x56')]||0x0,'talking':_0x542499[_0x93a5('0x57')],'total':_0x542499[_0x93a5('0x58')],'type':_0x542499[_0x93a5('0x4f')],'unmanaged':_0x542499['unmanaged'],'abandoned':_0x542499[_0x93a5('0x59')],'waiting':_0x542499[_0x93a5('0x5a')],'loggedInDb':_0x542499[_0x93a5('0x5b')],'dialActive':_0x542499[_0x93a5('0x5c')],'dialMethod':_0x542499[_0x93a5('0x5d')],'dialOriginateCallerIdName':_0x542499[_0x93a5('0x5e')],'dialOriginateCallerIdNumber':_0x542499['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x542499[_0x93a5('0x5f')],'dialPrefix':_0x542499[_0x93a5('0x60')],'outboundAnswerAgiCallsDay':_0x542499['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x542499[_0x93a5('0x61')],'outboundBlacklistCallsDay':_0x542499[_0x93a5('0x62')],'outboundBusyCallsDay':_0x542499[_0x93a5('0x63')],'outboundCongestionCallsDay':_0x542499[_0x93a5('0x64')],'outboundDropCallsDayACS':_0x542499['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x542499['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x542499[_0x93a5('0x65')],'outboundNoAnswerCallsDay':_0x542499[_0x93a5('0x66')],'outboundNoSuchCallsDay':_0x542499[_0x93a5('0x67')],'outboundOriginateFailureCallsDay':_0x542499[_0x93a5('0x68')],'outboundReCallsDay':_0x542499[_0x93a5('0x69')],'outboundRejectCallsDay':_0x542499[_0x93a5('0x6a')],'outboundUnknownCallsDay':_0x542499[_0x93a5('0x6b')],'predictiveIntervalAnsweredCalls':_0x542499['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x542499[_0x93a5('0x6c')],'predictiveIntervalAvgTalktime':_0x542499[_0x93a5('0x6d')],'predictiveIntervalDroppedCallsCallersExit':_0x542499[_0x93a5('0x6e')],'predictiveIntervalDroppedCallsTimeout':_0x542499[_0x93a5('0x6f')],'predictiveIntervalErlangCalls':_0x542499[_0x93a5('0x70')],'predictiveIntervalErlangCallsDroppedCalls':_0x542499[_0x93a5('0x71')],'predictiveIntervalHitRate':_0x542499[_0x93a5('0x72')],'predictiveIntervalMultiplicativeFactor':_0x542499[_0x93a5('0x73')],'predictiveIntervalPauses':_0x542499[_0x93a5('0x74')],'predictiveIntervalAvailable':_0x542499['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x542499['predictiveIntervalTotalCalls'],'message':_0x542499[_0x93a5('0x41')],'originated':_0x542499['originated'],'erlangCalls':_0x542499[_0x93a5('0x75')],'erlangCallToSecond':_0x542499['erlangCallToSecond'],'erlangAbandonmentRate':_0x542499[_0x93a5('0x76')],'erlangBusyFactor':_0x542499[_0x93a5('0x77')],'startPredictive':_0x542499[_0x93a5('0x28')],'startProgressive':_0x542499[_0x93a5('0x29')]};if(_0x542499[_0x93a5('0x78')]){_0x5a6682[_0x93a5('0x78')]={'id':_0x542499['Trunk']['id'],'name':_0x542499[_0x93a5('0x78')][_0x93a5('0x43')],'active':_0x542499['Trunk'][_0x93a5('0x79')],'callerid':_0x542499[_0x93a5('0x78')][_0x93a5('0x7a')]};}if(_0x542499[_0x93a5('0x47')]){_0x5a6682['Interval']={'id':_0x542499['Interval']['id'],'name':_0x542499[_0x93a5('0x47')][_0x93a5('0x43')]};}var _0x5bcc52=md5(JSON[_0x93a5('0x4d')](_0x5a6682));if(_0x542499[_0x93a5('0x7b')]!==_0x5bcc52){_0x542499[_0x93a5('0x7b')]=_0x5bcc52;emit(util[_0x93a5('0x7c')]('voice:queue:%s',_0x5a6682['name']),'voice_queue:save',_0x5a6682);}}}function emitCampaignSummary(_0x465575){if(_0x465575['type']===_0x93a5('0x7d')){emit(util[_0x93a5('0x7c')](_0x93a5('0x7e'),_0x465575[_0x93a5('0x43')]),_0x93a5('0x7f'),_0x465575);}}function checkGetDataPredictive(_0x5acc44){if(isNotNull(_0x5acc44)&&!_[_0x93a5('0x4b')](_0x5acc44)){loggerPredictive[_0x93a5('0x80')](_0x93a5('0x81'));loggerPredictive[_0x93a5('0x80')](_0x93a5('0x82'),_0x5acc44[_0x93a5('0x83')]);loggerPredictive[_0x93a5('0x80')](_0x93a5('0x84'),_0x5acc44[_0x93a5('0x85')]);loggerPredictive['info']('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5acc44['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x93a5('0x80')](_0x93a5('0x86'),_0x5acc44[_0x93a5('0x6e')]);loggerPredictive[_0x93a5('0x80')](_0x93a5('0x87'),_0x5acc44[_0x93a5('0x6c')]);loggerPredictive[_0x93a5('0x80')](_0x93a5('0x88'),_0x5acc44['predictiveIntervalAvgTalktime']);loggerPredictive[_0x93a5('0x80')](_0x93a5('0x89'));if(_0x5acc44['predictiveIntervalTotalCalls']>0x0){if(!_[_0x93a5('0x8a')](_0x5acc44[_0x93a5('0x6d')])&&_0x5acc44[_0x93a5('0x6d')]>0x0){return!![];}loggerPredictive['info'](_0x93a5('0x8b'));if(!_[_0x93a5('0x8a')](_0x5acc44[_0x93a5('0x6c')])&&_0x5acc44[_0x93a5('0x6c')]>0x0){return!![];}loggerPredictive['info'](_0x93a5('0x8c'));}else{loggerPredictive[_0x93a5('0x80')](_0x93a5('0x8d'));}}else{loggerPredictive[_0x93a5('0x80')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x463871){return function(_0x17b2c7){loggerPredictive[_0x93a5('0x80')](_0x93a5('0x8e'));loggerPredictive[_0x93a5('0x80')](_0x93a5('0x8f'),_0x17b2c7['erlangCalls']);loggerPredictive[_0x93a5('0x80')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x17b2c7[_0x93a5('0x90')]);loggerPredictive['info'](_0x93a5('0x91'),_0x17b2c7['erlangAbandonmentRate']);loggerPredictive['info']('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x17b2c7[_0x93a5('0x77')]);loggerPredictive[_0x93a5('0x80')](_0x93a5('0x91'),_0x17b2c7[_0x93a5('0x76')]);loggerPredictive[_0x93a5('0x80')](_0x93a5('0x89'));_['merge'](_0x463871,_0x17b2c7);};}function getDiff(_0x8e8976){var _0x48a9af=moment()[_0x93a5('0x4e')](0x0);var _0x1789b9=moment(_0x8e8976)[_0x93a5('0x4e')](0x0);return _0x48a9af['diff'](_0x1789b9,_0x93a5('0x92'));}function ifInterval(_0x13ccc3,_0x1f0e77){if(_[_0x93a5('0x8a')](_0x1f0e77)){return![];}return getDiff(_0x1f0e77)<_0x13ccc3*0x3c;}function freeVariablesPredictive(_0x382fdd){if(isNotNull(_0x382fdd)){if(!_[_0x93a5('0x8a')](_0x382fdd[_0x93a5('0x29')])){_0x382fdd[_0x93a5('0x29')]=undefined;loggerPredictive['info'](_0x382fdd[_0x93a5('0x43')],_0x93a5('0x93'));}if(!_[_0x93a5('0x8a')](_0x382fdd[_0x93a5('0x28')])){_0x382fdd[_0x93a5('0x28')]=undefined;loggerPredictive[_0x93a5('0x80')](_0x382fdd[_0x93a5('0x43')],'clearing\x20variable\x20start\x20predictive');}if(!_['isUndefined'](_0x382fdd[_0x93a5('0x94')])){clearInterval(_0x382fdd[_0x93a5('0x94')]);_0x382fdd[_0x93a5('0x94')]=undefined;loggerPredictive[_0x93a5('0x80')](_0x382fdd['name'],_0x93a5('0x95'));}}}function erlangb(_0x576a92,_0x2287f4){if(_0x2287f4===0x0){return 0x0;}var _0x2eae93=0x1;for(var _0x1a81d2=0x1;_0x1a81d2<=_0x2287f4;_0x1a81d2+=0x1){_0x2eae93=0x1+_0x2eae93*_0x1a81d2/_0x576a92;}return 0x1/_0x2eae93;}function isVoiceQueueOutbound(_0x326ad7){return _0x326ad7===_0x93a5('0x50');}function isNotPreview(_0x24c79b){return _0x24c79b!=='preview';}function isCampaignIvr(_0x30bc84){return _0x30bc84==='ivr';}function getCallerId(_0x4bc1ef,_0x5b0477,_0x3f4781){if(!_[_0x93a5('0x8a')](_0x3f4781)&&typeof _0x3f4781===_0x93a5('0x96')&&!_['isEmpty'](_0x3f4781)){if(!_[_0x93a5('0x8a')](_0x5b0477)&&typeof _0x5b0477==='string'&&!_[_0x93a5('0x4b')](_0x5b0477)){return util[_0x93a5('0x7c')](_0x93a5('0x97'),_0x5b0477,_0x3f4781);}return util[_0x93a5('0x7c')]('\x22%s\x22\x20<%s>',_0x3f4781,_0x3f4781);}if(!_[_0x93a5('0x8a')](_0x4bc1ef)&&typeof _0x4bc1ef===_0x93a5('0x96')&&!_[_0x93a5('0x4b')](_0x4bc1ef)){return _0x4bc1ef;}return _0x93a5('0x98');}function loggerCatchQueueSummary(_0x2cd4fd,_0x227b46){return function(_0x28a52e){freeVariablesPredictive(_0x227b46);emitVoiceQueueSummary(_0x227b46);emitCampaignSummary(_0x227b46);loggerSyncQueueSummary['error'](_0x2cd4fd,util['inspect'](_0x28a52e,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x5d529a,_0x3ab4bb){return function(_0x4f66f8){loggerPredictive[_0x93a5('0x99')](_0x3ab4bb[_0x93a5('0x43')],_0x5d529a);loggerPredictive[_0x93a5('0x99')](_0x4f66f8[_0x93a5('0x9a')]);freeVariablesPredictive(_0x3ab4bb);};}function loggerCatch(_0x20333b){return function(_0x403692){logger[_0x93a5('0x99')](_0x20333b,util[_0x93a5('0x9b')](_0x403692,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x2fd9e3){return _0x2fd9e3&&!_[_0x93a5('0x8a')](_0x2fd9e3)&&_0x2fd9e3[_0x93a5('0x9c')]>0x0;}function decremetOriginate(_0x543091){if(!_[_0x93a5('0x8a')](_0x543091)&&_0x543091!==null){if(typeof _0x543091[_0x93a5('0x9d')]!==_0x93a5('0x9e')){if(_0x543091[_0x93a5('0x9d')]>0x0){_0x543091[_0x93a5('0x9d')]-=0x1;}else{logger[_0x93a5('0x99')](_0x93a5('0x9f'));}}}else{logger[_0x93a5('0x99')](_0x93a5('0xa0'));}}function checkContactLowerLimitOriginate(_0x250b75,_0x338e72,_0x33180c){if(_0x338e72>_0x33180c){for(var _0xcbe036=0x0;_0xcbe036<_0x338e72-_0x33180c;_0xcbe036+=0x1){decremetOriginate(_0x250b75);}}}function loggerGetContactDialer(_0x48ef03,_0x1bc81c,_0x35f50c){return function(_0x16488a){checkContactLowerLimitOriginate(_0x1bc81c,_0x35f50c,0x0);logger['error'](_0x48ef03,util['inspect'](_0x16488a,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x3ac736){return function(_0x12c9a3){if(isNotNull(_0x12c9a3)&&isNotNull(_0x12c9a3[0x0])){if(_0x12c9a3[0x0][_0x93a5('0xa1')]>0x0){_0x3ac736[_0x93a5('0x41')]=_0x93a5('0xa2');logger[_0x93a5('0x80')](_0x93a5('0xa3')+_0x3ac736['name'],_0x12c9a3[0x0][_0x93a5('0xa1')],_0x93a5('0xa4'));}else{_0x3ac736[_0x93a5('0x41')]=_0x93a5('0xa5');logger[_0x93a5('0x80')](_0x93a5('0xa6')+_0x3ac736[_0x93a5('0x43')]);}}};}function notSendMessagesQueue(_0x1f6c11){if(_0x1f6c11[_0x93a5('0xa7')]){freeVariablesPredictive(_0x1f6c11);if(_0x1f6c11[_0x93a5('0x9d')]===0x0&&_0x1f6c11['talking']===0x0&&_0x1f6c11[_0x93a5('0x5a')]===0x0&&(_0x1f6c11[_0x93a5('0x53')]||0x0)===0x0){_0x1f6c11[_0x93a5('0xa7')]=![];_0x1f6c11[_0x93a5('0x51')]=0x0;_0x1f6c11['message']=_0x93a5('0x45');loggerSyncQueueSummary[_0x93a5('0x99')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x1f6c11[_0x93a5('0x43')],_0x93a5('0xa8'));}else{_0x1f6c11[_0x93a5('0x41')]=_0x93a5('0xa9');loggerSyncQueueSummary[_0x93a5('0x99')](_0x93a5('0xaa'),_0x1f6c11['name'],_0x93a5('0xab'));}emitVoiceQueueSummary(_0x1f6c11);}}function notSendMessagesCampaign(_0x42cb4d){if(_0x42cb4d[_0x93a5('0xa7')]){if(_0x42cb4d['originated']===0x0){_0x42cb4d[_0x93a5('0xa7')]=![];_0x42cb4d[_0x93a5('0x41')]=_0x93a5('0x45');loggerSyncQueueSummary[_0x93a5('0x99')](_0x93a5('0xac'),_0x42cb4d['name'],_0x93a5('0xa8'));}else{_0x42cb4d[_0x93a5('0x41')]=_0x93a5('0xa9');loggerSyncQueueSummary['error'](_0x93a5('0xac'),_0x42cb4d['name'],_0x93a5('0xab'));}emitCampaignSummary(_0x42cb4d);}}function createObjHistory(_0x39364f,_0x216a99,_0x412939,_0x471813,_0x5c3fe8){_0x39364f[_0x93a5('0x41')]=_0x412939;var _0x381d3f=new Action(_0x39364f,_0x216a99);var _0x453d06=new History(_0x381d3f);_0x453d06[_0x93a5('0xad')]=_0x471813;_0x453d06['statedesc']=_0x5c3fe8;_0x453d06['endtime']=_0x381d3f['starttime'];return _0x453d06;}Dialer['prototype'][_0x93a5('0x3e')]=function(){var _0x21c587=this;setInterval(function(){_0x21c587[_0x93a5('0xae')](_0x21c587['uniqueId'],'[uniqueid]');_0x21c587[_0x93a5('0xae')](_0x21c587[_0x93a5('0x24')],_0x93a5('0xaf'));},0x32c8);};Dialer[_0x93a5('0xb0')]['clearZombieChannels']=function(_0x39d675,_0x516461){var _0x1d99a8=this;for(var _0x4116f7 in _0x39d675){if(typeof _0x39d675[_0x4116f7]!==_0x93a5('0x9e')){this[_0x93a5('0x1c')][_0x93a5('0xb1')](function(){if(!_['isNil'](_0x39d675[_0x4116f7])){return ami[_0x93a5('0xb2')]({'action':_0x93a5('0xb3'),'channel':_0x39d675[_0x4116f7][_0x93a5('0xb4')]})[_0x93a5('0xb5')](function(_0x3b341d){if(_0x3b341d[_0x93a5('0x41')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x39d675[_0x4116f7]&&_0x39d675[_0x4116f7]['type']!=='ivr'){_0x1d99a8[_0x93a5('0xb6')](_0x1d99a8[_0x93a5('0x1e')][_0x39d675[_0x4116f7][_0x93a5('0xb7')]]);logger[_0x93a5('0x99')]('[Dialer][checkChannel]',_0x516461,_0x4116f7,_0x39d675[_0x4116f7]['queue']);delete _0x39d675[_0x4116f7];}if(_0x39d675[_0x4116f7]&&_0x39d675[_0x4116f7][_0x93a5('0x4f')]===_0x93a5('0x7d')){_0x1d99a8[_0x93a5('0xb6')](_0x1d99a8[_0x93a5('0x1f')][_0x39d675[_0x4116f7][_0x93a5('0xb7')]]);logger[_0x93a5('0x99')]('[Dialer][checkChannel][ivr]',_0x516461,_0x4116f7,_0x39d675[_0x4116f7][_0x93a5('0xb7')]);delete _0x39d675[_0x4116f7];}},0x2328);}});}});}}};Dialer['prototype'][_0x93a5('0xb8')]=function(_0x593dbf){return BPromise['resolve']()[_0x93a5('0x40')](cmHopper['countReScheduled'](_0x593dbf))[_0x93a5('0xb5')](loggerCatch(_0x93a5('0xb9')));};Dialer[_0x93a5('0xb0')]['checkIsBlackList']=function(_0x41bcf6){return BPromise['resolve']()[_0x93a5('0x40')](cmHopperBlack['checkIsBlackList'](_0x41bcf6))[_0x93a5('0xb5')](loggerCatch(_0x93a5('0xba')));};Dialer[_0x93a5('0xb0')]['checkIsBlackListIvr']=function(_0x21393f){return BPromise[_0x93a5('0xbb')]()['then'](cmHopperBlack[_0x93a5('0xbc')](_0x21393f))['catch'](loggerCatch(_0x93a5('0xbd')));};Dialer[_0x93a5('0xb0')]['averageHandleTime']=function(_0x474ccb){return BPromise['resolve']()[_0x93a5('0x40')](cmHopperHistory['avgHandleTime'](_0x474ccb))[_0x93a5('0xb5')](loggerCatch(_0x93a5('0xbe')));};Dialer[_0x93a5('0xb0')][_0x93a5('0xbf')]=function(_0x37e4ea){return BPromise[_0x93a5('0xbb')]()['then'](cmHopper[_0x93a5('0xbf')](_0x37e4ea))[_0x93a5('0xb5')](loggerCatch(_0x93a5('0xc0')));};Dialer[_0x93a5('0xb0')][_0x93a5('0xc1')]=function(_0x27ac07,_0x42f434,_0x5146e0){return BPromise[_0x93a5('0xbb')]()[_0x93a5('0x40')](cmHopper[_0x93a5('0xc1')](_0x27ac07,_0x42f434,_0x5146e0))['catch'](loggerCatch(_0x93a5('0xc2')));};Dialer[_0x93a5('0xb0')][_0x93a5('0xc3')]=function(_0x45b190,_0x46ba6c,_0x104286,_0x2ced2b,_0x145a19){return BPromise[_0x93a5('0xbb')]()[_0x93a5('0x40')](cmHopper[_0x93a5('0xc3')](_0x45b190,_0x46ba6c,_0x104286,_0x2ced2b))['catch'](function(_0x1eebef){_0x145a19[_0x93a5('0xc4')]-=_0x104286;_0x145a19[_0x93a5('0xc4')]=_0x145a19[_0x93a5('0xc4')]>0x0?_0x145a19[_0x93a5('0xc4')]:0x0;loggerCatch('[getContactDialer]\x20')(_0x1eebef);});};Dialer[_0x93a5('0xb0')][_0x93a5('0xc5')]=function(_0x133de6,_0x3e76ff,_0x1f5287,_0xcb9e27){return BPromise[_0x93a5('0xbb')]()[_0x93a5('0x40')](cmHopper[_0x93a5('0xc5')](_0x133de6,_0x3e76ff,_0x1f5287))[_0x93a5('0xb5')](function(_0x4c7506){_0xcb9e27[_0x93a5('0xc4')]-=_0x3e76ff;_0xcb9e27['temp']=_0xcb9e27[_0x93a5('0xc4')]>0x0?_0xcb9e27['temp']:0x0;loggerCatch(_0x93a5('0xc6'))(_0x4c7506);});};Dialer[_0x93a5('0xb0')][_0x93a5('0xc7')]=function(_0x10e4c6){return BPromise[_0x93a5('0xbb')]()[_0x93a5('0x40')](voiceQueueRt[_0x93a5('0xc7')](_0x10e4c6))[_0x93a5('0xb5')](loggerCatch(_0x93a5('0xc8')));};Dialer[_0x93a5('0xb0')][_0x93a5('0xc9')]=function(_0x56b358){return BPromise[_0x93a5('0xbb')]()['then'](cmHopper[_0x93a5('0xc9')](_0x56b358))[_0x93a5('0xb5')](loggerCatch(_0x93a5('0xca')));};Dialer['prototype'][_0x93a5('0xcb')]=function(_0x58103e){return BPromise['resolve']()['then'](cmHopperHistory[_0x93a5('0xcb')](_0x58103e))['catch'](loggerCatch(_0x93a5('0xcc')));};Dialer['prototype'][_0x93a5('0xb6')]=function(_0x200fb4){if(!_['isUndefined'](_0x200fb4)&&_0x200fb4!==null){if(typeof _0x200fb4['originated']!==_0x93a5('0x9e')){if(_0x200fb4[_0x93a5('0x9d')]>0x0){_0x200fb4[_0x93a5('0x9d')]-=0x1;}else{logger[_0x93a5('0x99')](_0x93a5('0xcd'));}}}else{logger[_0x93a5('0x99')](_0x93a5('0xce'));}};Dialer[_0x93a5('0xb0')][_0x93a5('0xcf')]=function(_0x457550,_0x30aa8c){var _0x26d1ac=this;return function(_0x53fad7){_0x26d1ac[_0x93a5('0xb6')](_0x30aa8c);logger[_0x93a5('0x99')](_0x457550,util['inspect'](_0x53fad7,{'showHidden':![],'depth':null}));};};Dialer[_0x93a5('0xb0')]['emptyContact']=function(_0x171fcd,_0x2cff78,_0x33cf32){var _0x1a4cdd={'state':0x19,'statedesc':_0x93a5('0xd0')};this['updateOriginated'](_0x2cff78);this[_0x93a5('0xd1')](_[_0x93a5('0xd2')](_0x1a4cdd,_[_0x93a5('0xd3')](_0x33cf32,[_0x93a5('0xd4'),'ListId',_0x93a5('0xd5'),_0x93a5('0xd6'),_0x93a5('0xd7')])),_0x93a5('0xd8'),'[emptyContact]');logger[_0x93a5('0x99')](_0x171fcd);};Dialer['prototype']['isSuccess']=function(_0xbb9d18){return _0xbb9d18===_0x93a5('0xd9');};Dialer[_0x93a5('0xb0')]['isTrunkReachable']=function(_0x4d3274){return!_['isUndefined'](_0x4d3274)&&_0x4d3274&&!_[_0x93a5('0x8a')](_0x4d3274[_0x93a5('0x43')])&&!_['isUndefined'](_0x4d3274[_0x93a5('0x79')])&&_0x4d3274[_0x93a5('0x79')]&&(this[_0x93a5('0x21')][util[_0x93a5('0x7c')](_0x93a5('0xda'),_0x4d3274['name'])][_0x93a5('0xb3')]===_0x93a5('0xdb')||this['trunks'][util[_0x93a5('0x7c')](_0x93a5('0xda'),_0x4d3274[_0x93a5('0x43')])][_0x93a5('0xb3')]===_0x93a5('0xdc'));};Dialer[_0x93a5('0xb0')][_0x93a5('0xd1')]=function(_0x35d0cf,_0x47e966,_0x43a0c8){this[_0x93a5('0xcb')](_0x35d0cf)[_0x93a5('0xb5')](loggerCatch(_0x47e966));this[_0x93a5('0xc9')](_0x35d0cf)[_0x93a5('0xb5')](loggerCatch(_0x43a0c8));};Dialer[_0x93a5('0xb0')][_0x93a5('0x39')]=function(_0x3fe604){var _0x87165f=this['uniqueId'][_0x3fe604['uniqueid']];var _0x5119c5;if(!_[_0x93a5('0xdd')](_0x3fe604)&&!_[_0x93a5('0xdd')](_0x3fe604['variable'])&&!_[_0x93a5('0xdd')](_0x3fe604['variable'][_0x93a5('0xde')])&&_0x3fe604[_0x93a5('0xdf')]==='xcally-motion-dialer'&&_0x87165f){if(_0x87165f[_0x93a5('0x4f')]!=='ivr'&&this[_0x93a5('0x1e')][_0x87165f['queue']][_0x93a5('0xe0')]&&_0x3fe604[_0x93a5('0xe1')]===_0x93a5('0xe2')){delete this['uniqueId'][_0x3fe604['uniqueid']];this[_0x93a5('0xb6')](this[_0x93a5('0x1e')][_0x87165f[_0x93a5('0xb7')]]);this[_0x93a5('0x1e')][_0x87165f['queue']][_0x93a5('0x61')]+=0x1;this[_0x93a5('0x1e')][_0x87165f[_0x93a5('0xb7')]][_0x93a5('0xe3')]+=0x1;_0x5119c5=new Hangup(_0x87165f,_0x3fe604);_0x5119c5[_0x93a5('0xad')]=0x12;_0x5119c5[_0x93a5('0xe4')]='HangupInAMD';_0x5119c5['membername']='AMD';ami[_0x93a5('0xe5')](_0x93a5('0xe6'),ut['buildObj'](_0x5119c5,_0x93a5('0xe7')));this[_0x93a5('0xd1')](_0x5119c5,'[syncHangupInAMD][createHistory]','[syncHangupInAMD]');}if(_0x87165f['type']!==_0x93a5('0x7d')&&this['voiceQueues'][_0x87165f[_0x93a5('0xb7')]]['dialAMDActive']&&_0x3fe604[_0x93a5('0xe1')]==='MACHINE'){var _0x3884cc=this;return new BPromise(function(_0x1345d8,_0x3323be){delete _0x3884cc[_0x93a5('0x26')][_0x3fe604[_0x93a5('0xe8')]];_0x3884cc[_0x93a5('0xb6')](_0x3884cc['voiceQueues'][_0x87165f[_0x93a5('0xb7')]]);_0x3884cc[_0x93a5('0x1e')][_0x87165f[_0x93a5('0xb7')]][_0x93a5('0x61')]+=0x1;_0x3884cc[_0x93a5('0x1e')][_0x87165f[_0x93a5('0xb7')]][_0x93a5('0xe3')]+=0x1;var _0x11fe00=_0x3884cc['voiceQueues'][_0x87165f[_0x93a5('0xb7')]];var _0x15f954=new Hangup(_0x87165f,_0x3fe604);_0x15f954[_0x93a5('0xad')]=0x13;_0x15f954[_0x93a5('0xe4')]='Machine';_0x15f954[_0x93a5('0xe9')]='AMD';_0x15f954[_0x93a5('0xea')]+=0x1;_0x15f954[_0x93a5('0xeb')]+=0x1;_0x15f954[_0x93a5('0xe7')]=!![];ami[_0x93a5('0xe5')](_0x93a5('0xe6'),ut[_0x93a5('0xec')](_0x15f954,_0x93a5('0xe7')));_0x3884cc[_0x93a5('0xcb')](_0x15f954)[_0x93a5('0xb5')](loggerCatch(_0x93a5('0xed')));if(_0x15f954[_0x93a5('0xee')]+_0x15f954[_0x93a5('0xef')]+_0x15f954[_0x93a5('0xf0')]+_0x15f954['countnosuchnumberretry']+_0x15f954[_0x93a5('0xf1')]+_0x15f954[_0x93a5('0xf2')]+_0x15f954[_0x93a5('0xea')]+_0x15f954[_0x93a5('0xf3')]>=_0x11fe00['dialGlobalMaxRetry']){_0x3884cc[_0x93a5('0xf4')](_0x15f954,_0x1345d8,_0x3323be,_0x93a5('0xf5'));}else{if(_0x15f954[_0x93a5('0xea')]>=_0x11fe00[_0x93a5('0xf6')]){_0x3884cc[_0x93a5('0xf7')](_0x15f954,_0x1345d8,_0x3323be,'reason\x2019\x20machine....');}else{_0x3884cc['rescheduleContact']({'active':![],'countmachineretry':_0x15f954[_0x93a5('0xea')],'scheduledat':moment()[_0x93a5('0xf8')](_0x11fe00['dialMachineRetryFrequency'],'minutes')[_0x93a5('0x7c')](_0x93a5('0xf9')),'ContactId':_0x15f954['ContactId'],'ListId':_0x15f954[_0x93a5('0xfa')],'VoiceQueueId':_0x15f954[_0x93a5('0xd6')]||undefined,'CampaignId':_0x15f954[_0x93a5('0xd7')]||undefined})[_0x93a5('0xb5')](loggerCatch(_0x93a5('0xfb')));_0x1345d8({'reschedule':0x1});}}});}if(_0x87165f[_0x93a5('0x4f')]===_0x93a5('0x7d')&&this[_0x93a5('0x1f')][_0x87165f[_0x93a5('0xb7')]][_0x93a5('0xe0')]&&_0x3fe604[_0x93a5('0xe1')]===_0x93a5('0xe2')){delete this[_0x93a5('0x26')][_0x3fe604[_0x93a5('0xe8')]];this[_0x93a5('0xb6')](this['campaigns'][_0x87165f[_0x93a5('0xb7')]]);_0x5119c5=new Hangup(_0x87165f,_0x3fe604);_0x5119c5[_0x93a5('0xad')]=0x12;_0x5119c5[_0x93a5('0xe4')]='HangupInAMD';_0x5119c5[_0x93a5('0xe9')]=_0x93a5('0xfc');ami[_0x93a5('0xe5')](_0x93a5('0xe6'),ut[_0x93a5('0xec')](_0x5119c5,_0x93a5('0xe7')));this[_0x93a5('0xd1')](_0x5119c5,'[syncHangupInAMDIvr][createHistory]',_0x93a5('0xfd'));}if(_0x87165f[_0x93a5('0x4f')]===_0x93a5('0x7d')&&this[_0x93a5('0x1f')][_0x87165f[_0x93a5('0xb7')]]['dialAMDActive']&&_0x3fe604[_0x93a5('0xe1')]===_0x93a5('0xfe')){var _0x3884cc=this;return new BPromise(function(_0x2218b2,_0x10bef2){delete _0x3884cc[_0x93a5('0x26')][_0x3fe604[_0x93a5('0xe8')]];_0x3884cc[_0x93a5('0xb6')](_0x3884cc[_0x93a5('0x1f')][_0x87165f[_0x93a5('0xb7')]]);_0x3884cc[_0x93a5('0x1f')][_0x87165f[_0x93a5('0xb7')]][_0x93a5('0x61')]+=0x1;_0x3884cc[_0x93a5('0x1f')][_0x87165f['queue']][_0x93a5('0xe3')]+=0x1;var _0x258207=_0x3884cc[_0x93a5('0x1f')][_0x87165f['queue']];var _0x3f8cbd=new Hangup(_0x87165f,_0x3fe604);_0x3f8cbd[_0x93a5('0xad')]=0x13;_0x3f8cbd[_0x93a5('0xe4')]=_0x93a5('0xff');_0x3f8cbd['membername']=_0x93a5('0xfc');_0x3f8cbd['countmachineretry']+=0x1;_0x3f8cbd[_0x93a5('0xeb')]+=0x1;_0x3f8cbd[_0x93a5('0xe7')]=!![];ami[_0x93a5('0xe5')](_0x93a5('0xe6'),ut[_0x93a5('0xec')](_0x3f8cbd,'amd'));_0x3884cc[_0x93a5('0xcb')](_0x3f8cbd)['catch'](loggerCatch(_0x93a5('0xed')));if(_0x3f8cbd[_0x93a5('0xee')]+_0x3f8cbd[_0x93a5('0xef')]+_0x3f8cbd[_0x93a5('0xf0')]+_0x3f8cbd[_0x93a5('0x100')]+_0x3f8cbd['countdropretry']+_0x3f8cbd[_0x93a5('0xf2')]+_0x3f8cbd[_0x93a5('0xea')]+_0x3f8cbd[_0x93a5('0xf3')]>=_0x258207['dialGlobalMaxRetry']){_0x3884cc[_0x93a5('0xf4')](_0x3f8cbd,_0x2218b2,_0x10bef2,_0x93a5('0xf5'));}else{if(_0x3f8cbd[_0x93a5('0xea')]>=_0x258207['dialMachineMaxRetry']){_0x3884cc[_0x93a5('0xf7')](_0x3f8cbd,_0x2218b2,_0x10bef2,_0x93a5('0x101'));}else{_0x3884cc[_0x93a5('0xbf')]({'active':![],'countmachineretry':_0x3f8cbd['countmachineretry'],'scheduledat':moment()[_0x93a5('0xf8')](_0x258207[_0x93a5('0x102')],_0x93a5('0x103'))[_0x93a5('0x7c')](_0x93a5('0xf9')),'ContactId':_0x3f8cbd[_0x93a5('0xd4')],'ListId':_0x3f8cbd[_0x93a5('0xfa')],'VoiceQueueId':_0x3f8cbd['VoiceQueueId']||undefined,'CampaignId':_0x3f8cbd[_0x93a5('0xd7')]||undefined})[_0x93a5('0xb5')](loggerCatch('[rescheduleContact][Machine]'));_0x2218b2({'reschedule':0x1});}}});}}};Dialer[_0x93a5('0xb0')][_0x93a5('0x35')]=function(_0x590783){var _0x4fbc66=this[_0x93a5('0x26')][_0x590783[_0x93a5('0xe8')]];var _0x201b7f=this;var _0x205aa6;if(_0x4fbc66&&_0x4fbc66['type']===_0x93a5('0x7d')){delete this['uniqueId'][_0x590783[_0x93a5('0xe8')]];this[_0x93a5('0xb6')](this[_0x93a5('0x1f')][_0x4fbc66['queue']]);this[_0x93a5('0x1f')][_0x4fbc66['queue']][_0x93a5('0x104')]+=0x1;_0x205aa6=new Hangup(_0x4fbc66,_0x590783);this[_0x93a5('0xcb')](_0x205aa6)['catch'](loggerCatch(_0x93a5('0x105')));this[_0x93a5('0xc9')](_0x205aa6)[_0x93a5('0xb5')](loggerCatch(_0x93a5('0x106')));}if(_0x4fbc66&&_0x4fbc66[_0x93a5('0x4f')]!==_0x93a5('0x7d')&&isNotNull(this[_0x93a5('0x1e')][_0x4fbc66[_0x93a5('0xb7')]][_0x93a5('0x107')])){delete this[_0x93a5('0x26')][_0x590783[_0x93a5('0xe8')]];this[_0x93a5('0xb6')](this[_0x93a5('0x1e')][_0x4fbc66[_0x93a5('0xb7')]]);this[_0x93a5('0x1e')][_0x4fbc66[_0x93a5('0xb7')]][_0x93a5('0x61')]+=0x1;this[_0x93a5('0x1e')][_0x4fbc66[_0x93a5('0xb7')]]['outboundAnswerAgiCallsDay']+=0x1;_0x205aa6=new Hangup(_0x4fbc66,_0x590783);_0x205aa6[_0x93a5('0xad')]=0x10;_0x205aa6[_0x93a5('0xe4')]=_0x93a5('0x108');_0x205aa6[_0x93a5('0xe9')]=_0x93a5('0x109');this[_0x93a5('0xcb')](_0x205aa6)[_0x93a5('0xb5')](loggerCatch(_0x93a5('0x105')));this[_0x93a5('0xc9')](_0x205aa6)[_0x93a5('0xb5')](loggerCatch('[syncHangupIvr]'));}if(_0x4fbc66&&_0x4fbc66[_0x93a5('0x4f')]!==_0x93a5('0x7d')&&!isNotNull(this[_0x93a5('0x1e')][_0x4fbc66[_0x93a5('0xb7')]][_0x93a5('0x107')])){delete this['uniqueId'][_0x590783['uniqueid']];this[_0x93a5('0xb6')](this[_0x93a5('0x1e')][_0x4fbc66['queue']]);this['voiceQueues'][_0x4fbc66[_0x93a5('0xb7')]][_0x93a5('0x6b')]+=0x1;_0x205aa6=new Hangup(_0x4fbc66,_0x590783);_0x205aa6['state']=0xc;_0x205aa6[_0x93a5('0xe4')]=_0x590783[_0x93a5('0x10a')];_0x205aa6['membername']=_0x93a5('0x10b');this[_0x93a5('0xcb')](_0x205aa6)[_0x93a5('0xb5')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x93a5('0xc9')](_0x205aa6)[_0x93a5('0xb5')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x93a5('0xb0')][_0x93a5('0x33')]=function(_0x2c332e){var _0xdb3101=this['uniqueId'][_0x2c332e['uniqueid']];var _0x48f365=this;if(this['voiceQueues'][_0x2c332e[_0x93a5('0xb7')]]){if(_0xdb3101&&_0xdb3101[_0x93a5('0x4f')]!==_0x93a5('0x7d')){delete this[_0x93a5('0x26')][_0x2c332e[_0x93a5('0xe8')]];this[_0x93a5('0x1e')][_0x2c332e[_0x93a5('0xb7')]][_0x93a5('0x61')]+=0x1;var _0x76e90c=new AgentComplete(_0xdb3101,_0x2c332e);if(_0x2c332e['reason']==='agent'){_0x76e90c['agiafterat']=this[_0x93a5('0x1e')][_0x2c332e[_0x93a5('0xb7')]][_0x93a5('0x10c')]&&this[_0x93a5('0x1e')][_0x2c332e[_0x93a5('0xb7')]][_0x93a5('0x10d')]?moment()[_0x93a5('0x7c')](_0x93a5('0xf9')):undefined;}this[_0x93a5('0xcb')](_0x76e90c)[_0x93a5('0xb5')](loggerCatch('[syncAgentComplete][createHistory]'));this['moveContactManagedDialer'](_0x76e90c)[_0x93a5('0xb5')](loggerCatch(_0x93a5('0x10e')));}}};Dialer[_0x93a5('0xb0')][_0x93a5('0x2d')]=function(_0x1ab2cc){if(this[_0x93a5('0x1e')][_0x1ab2cc['queue']]){if(this[_0x93a5('0x26')][_0x1ab2cc[_0x93a5('0xe8')]]&&this['uniqueId'][_0x1ab2cc['uniqueid']]['type']!=='ivr'){this[_0x93a5('0xb6')](this[_0x93a5('0x1e')][_0x1ab2cc[_0x93a5('0xb7')]]);this['uniqueId'][_0x1ab2cc['uniqueid']]['answertime']=moment()[_0x93a5('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x93a5('0xb0')]['queueCallerAbandonCreateState']=function(_0x1c291f){this['createHistory'](_0x1c291f)[_0x93a5('0xb5')](loggerCatch(_0x93a5('0x10f')));this[_0x93a5('0xc9')](_0x1c291f)[_0x93a5('0xb5')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer['prototype'][_0x93a5('0x110')]=function(_0x21d963){var _0x3b958f=this[_0x93a5('0x26')][_0x21d963[_0x93a5('0xe8')]];var _0x215dcc=this;if(this[_0x93a5('0x1e')][_0x21d963[_0x93a5('0xb7')]]){if(_0x3b958f&&_0x3b958f[_0x93a5('0x4f')]!==_0x93a5('0x7d')){delete this[_0x93a5('0x26')][_0x21d963[_0x93a5('0xe8')]];this[_0x93a5('0xb6')](this[_0x93a5('0x1e')][_0x21d963['queue']]);_0x3b958f['droptime']=moment()[_0x93a5('0x7c')](_0x93a5('0xf9'));var _0x590c1f=new QueueCallerAbandon(_0x3b958f,_0x21d963);if(getSeconds(_0x3b958f[_0x93a5('0x111')],_0x3b958f['responsetime'])>=_0x3b958f[_0x93a5('0x112')]){this[_0x93a5('0x1e')][_0x21d963[_0x93a5('0xb7')]][_0x93a5('0x6f')]+=0x1;this['voiceQueues'][_0x21d963[_0x93a5('0xb7')]][_0x93a5('0x65')]+=0x1;this['voiceQueues'][_0x21d963['queue']]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x590c1f['state']=0xa;_0x590c1f['statedesc']=_0x93a5('0x113');_0x590c1f[_0x93a5('0x114')]=_0x93a5('0x115');_0x590c1f[_0x93a5('0x116')]=this[_0x93a5('0x1e')][_0x21d963[_0x93a5('0xb7')]][_0x93a5('0x10c')]?moment()['format'](_0x93a5('0xf9')):undefined;_0x590c1f[_0x93a5('0xf1')]+=0x1;_0x590c1f[_0x93a5('0xeb')]+=0x1;if(_0x590c1f[_0x93a5('0xf1')]>=this[_0x93a5('0x1e')][_0x21d963[_0x93a5('0xb7')]][_0x93a5('0x117')]){this[_0x93a5('0x118')](_0x590c1f);}else{this[_0x93a5('0xbf')]({'active':![],'countdropretry':_0x590c1f[_0x93a5('0xf1')],'scheduledat':moment()[_0x93a5('0xf8')](this[_0x93a5('0x1e')][_0x21d963['queue']][_0x93a5('0x119')],'minutes')[_0x93a5('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3b958f[_0x93a5('0xd4')],'ListId':_0x3b958f[_0x93a5('0xfa')],'VoiceQueueId':_0x3b958f['VoiceQueueId']||undefined,'CampaignId':_0x3b958f[_0x93a5('0xd7')]||undefined})[_0x93a5('0xb5')](loggerCatch('[rescheduleContact][Drop]'));var _0xb32cdf=new History(_0x590c1f);_0xb32cdf[_0x93a5('0xad')]=0xa;_0xb32cdf[_0x93a5('0xe4')]=_0x93a5('0x113');_0xb32cdf[_0x93a5('0x11a')]=moment()[_0x93a5('0x7c')](_0x93a5('0xf9'));_0xb32cdf['endtime']=_0xb32cdf['starttime'];_0xb32cdf[_0x93a5('0x11b')]=_0x590c1f[_0x93a5('0x11b')];_0xb32cdf[_0x93a5('0x11c')]=_0x590c1f[_0x93a5('0x11c')];this[_0x93a5('0xcb')](_0xb32cdf)[_0x93a5('0xb5')](loggerCatch('[syncAgentComplete][createHistory][10]'));}}else{this[_0x93a5('0x1e')][_0x21d963[_0x93a5('0xb7')]][_0x93a5('0x6e')]+=0x1;this[_0x93a5('0x1e')][_0x21d963[_0x93a5('0xb7')]][_0x93a5('0x11d')]+=0x1;_0x590c1f[_0x93a5('0xad')]=0xb;_0x590c1f[_0x93a5('0xe4')]=_0x93a5('0x11e');_0x590c1f[_0x93a5('0x114')]=_0x93a5('0x11f');_0x590c1f[_0x93a5('0xf2')]+=0x1;_0x590c1f[_0x93a5('0xeb')]+=0x1;if(_0x590c1f['countabandonedretry']>=this[_0x93a5('0x1e')][_0x21d963['queue']][_0x93a5('0x120')]){this[_0x93a5('0x118')](_0x590c1f);}else{this[_0x93a5('0xbf')]({'active':![],'countabandonedretry':_0x590c1f[_0x93a5('0xf2')],'scheduledat':moment()['add'](this['voiceQueues'][_0x21d963[_0x93a5('0xb7')]][_0x93a5('0x121')],_0x93a5('0x103'))['format'](_0x93a5('0xf9')),'ContactId':_0x3b958f[_0x93a5('0xd4')],'ListId':_0x3b958f[_0x93a5('0xfa')],'VoiceQueueId':_0x3b958f['VoiceQueueId']||undefined,'CampaignId':_0x3b958f[_0x93a5('0xd7')]||undefined})[_0x93a5('0xb5')](loggerCatch(_0x93a5('0x122')));var _0xb32cdf=new History(_0x590c1f);_0xb32cdf[_0x93a5('0xad')]=0xb;_0xb32cdf[_0x93a5('0xe4')]=_0x93a5('0x11e');_0xb32cdf[_0x93a5('0x11a')]=moment()[_0x93a5('0x7c')](_0x93a5('0xf9'));_0xb32cdf['endtime']=_0xb32cdf[_0x93a5('0x11a')];_0xb32cdf[_0x93a5('0x11b')]=_0x590c1f[_0x93a5('0x11b')];_0xb32cdf[_0x93a5('0x11c')]=_0x590c1f['calleridnum'];this[_0x93a5('0xcb')](_0xb32cdf)[_0x93a5('0xb5')](loggerCatch('[syncAgentComplete][createHistory][11]'));}}}}};Dialer[_0x93a5('0xb0')][_0x93a5('0x37')]=function(_0x1aa090){if(this[_0x93a5('0x24')][_0x1aa090[_0x93a5('0xe8')]]){this[_0x93a5('0x24')][_0x1aa090[_0x93a5('0xe8')]]['channel']=_0x1aa090[_0x93a5('0xb4')];}if(this[_0x93a5('0x26')][_0x1aa090['uniqueid']]){this[_0x93a5('0x26')][_0x1aa090[_0x93a5('0xe8')]][_0x93a5('0xb4')]=_0x1aa090[_0x93a5('0xb4')];}};Dialer[_0x93a5('0xb0')]['syncQueueMember']=function(_0x219a5d){if(strategy[this[_0x93a5('0x1e')][this[_0x93a5('0x24')][_0x219a5d[_0x93a5('0x123')]]['queue']][_0x93a5('0x124')]]===_0x93a5('0x19')){if(this[_0x93a5('0x24')][_0x219a5d[_0x93a5('0x123')]]&&_[_0x93a5('0xdd')](this[_0x93a5('0x24')][_0x219a5d['actionid']][_0x93a5('0x125')])&&_0x219a5d[_0x93a5('0xb3')]==='1'&&_0x219a5d[_0x93a5('0x126')]==='0'){if(this[_0x93a5('0x20')][_0x219a5d[_0x93a5('0x127')]]){if(!this[_0x93a5('0x20')][_0x219a5d['stateinterface']]['locked']){this['agents'][_0x219a5d[_0x93a5('0x127')]][_0x93a5('0x125')]=!![];this[_0x93a5('0x24')][_0x219a5d[_0x93a5('0x123')]]['locked']=!![];this['actions'][_0x219a5d[_0x93a5('0x123')]][_0x93a5('0x127')]=_0x219a5d[_0x93a5('0x127')];}}}}else if((strategy[this[_0x93a5('0x1e')][this['actions'][_0x219a5d[_0x93a5('0x123')]][_0x93a5('0xb7')]][_0x93a5('0x124')]]||_0x93a5('0x128'))===_0x93a5('0x128')){if(this[_0x93a5('0x24')][_0x219a5d[_0x93a5('0x123')]]){if(this['agents'][_0x219a5d[_0x93a5('0x127')]]){this[_0x93a5('0x24')][_0x219a5d['actionid']][_0x93a5('0x127')]=_0x219a5d[_0x93a5('0x127')];if(_[_0x93a5('0xdd')](this[_0x93a5('0x2b')][this[_0x93a5('0x24')][_0x219a5d['actionid']][_0x93a5('0xb7')]])){this[_0x93a5('0x2b')][this[_0x93a5('0x24')][_0x219a5d[_0x93a5('0x123')]]['queue']]=[];}this[_0x93a5('0x2b')][this['actions'][_0x219a5d[_0x93a5('0x123')]][_0x93a5('0xb7')]][_0x93a5('0x129')](_[_0x93a5('0xd2')](_['pick'](this[_0x93a5('0x24')][_0x219a5d[_0x93a5('0x123')]],['idHopper',_0x93a5('0x127')]),{'status':_0x219a5d['status'],'paused':_0x219a5d[_0x93a5('0x126')]}));}}}};function unlockQueueStatus(_0x4f4abe,_0x1ad97f){setTimeout(function(){if(_[_0x93a5('0x8a')](_0x4f4abe['queueStatusComplete'])){loggerBooked[_0x93a5('0x99')]('[unlockQueueStatus][undefined]',_0x1ad97f);}_0x4f4abe['queueStatusComplete']=!![];loggerBooked[_0x93a5('0x80')](_0x93a5('0x12a'),_0x1ad97f,JSON['stringify'](_['pick'](_0x4f4abe,['name',_0x93a5('0x12b')])));},0x1f3);}Dialer[_0x93a5('0xb0')][_0x93a5('0x12c')]=function(_0x284e03){var _0x457265=this;var _0x1d9da9=_0x457265['voiceQueues'][_0x457265[_0x93a5('0x24')][_0x284e03[_0x93a5('0x123')]][_0x93a5('0xb7')]];if(strategy[this[_0x93a5('0x1e')][this[_0x93a5('0x24')][_0x284e03['actionid']]['queue']][_0x93a5('0x124')]]===_0x93a5('0x19')){if(this['actions'][_0x284e03['actionid']]&&this[_0x93a5('0x24')][_0x284e03[_0x93a5('0x123')]][_0x93a5('0x127')]){this[_0x93a5('0x1d')][_0x93a5('0x12d')](this[_0x93a5('0x24')][_0x284e03[_0x93a5('0x123')]][_0x93a5('0x12e')],this['actions'][_0x284e03[_0x93a5('0x123')]]['stateinterface'])[_0x93a5('0xb5')](function(_0x4b6547){logger[_0x93a5('0x99')](_0x93a5('0x12f'),util[_0x93a5('0x9b')](_0x4b6547,{'showHidden':![],'depth':null}));})['finally'](function(){_0x457265[_0x93a5('0xb6')](_0x457265[_0x93a5('0x1e')][_0x457265[_0x93a5('0x24')][_0x284e03['actionid']][_0x93a5('0xb7')]]);_0x457265[_0x93a5('0x20')][_0x457265[_0x93a5('0x24')][_0x284e03[_0x93a5('0x123')]][_0x93a5('0x127')]]['locked']=![];delete _0x457265['actions'][_0x284e03[_0x93a5('0x123')]];unlockQueueStatus(_0x1d9da9);});}else{this[_0x93a5('0xb6')](this[_0x93a5('0x1e')][this['actions'][_0x284e03['actionid']]['queue']]);this['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x284e03[_0x93a5('0x123')]][_0x93a5('0xd4')],'ListId':this[_0x93a5('0x24')][_0x284e03[_0x93a5('0x123')]][_0x93a5('0xfa')],'VoiceQueueId':this[_0x93a5('0x24')][_0x284e03[_0x93a5('0x123')]][_0x93a5('0xd6')]||undefined,'CampaignId':this[_0x93a5('0x24')][_0x284e03['actionid']][_0x93a5('0xd7')]||undefined})['catch'](loggerCatch(_0x93a5('0x130')));delete this[_0x93a5('0x24')][_0x284e03[_0x93a5('0x123')]];unlockQueueStatus(_0x1d9da9);}}else if((strategy[this[_0x93a5('0x1e')][this[_0x93a5('0x24')][_0x284e03[_0x93a5('0x123')]]['queue']][_0x93a5('0x124')]]||_0x93a5('0x128'))===_0x93a5('0x128')){var _0x5922ce;if(this[_0x93a5('0x24')][_0x284e03[_0x93a5('0x123')]]&&!_[_0x93a5('0x4b')](this['queueBooked'][this[_0x93a5('0x24')][_0x284e03['actionid']][_0x93a5('0xb7')]])){if(this[_0x93a5('0x131')][_0x457265[_0x93a5('0x24')][_0x284e03[_0x93a5('0x123')]][_0x93a5('0xb7')]]){this[_0x93a5('0x131')][_0x457265[_0x93a5('0x24')][_0x284e03[_0x93a5('0x123')]]['queue']]=this[_0x93a5('0x131')][this[_0x93a5('0x24')][_0x284e03['actionid']][_0x93a5('0xb7')]]?this[_0x93a5('0x131')][this[_0x93a5('0x24')][_0x284e03[_0x93a5('0x123')]]['queue']]:this[_0x93a5('0x2b')][this[_0x93a5('0x24')][_0x284e03[_0x93a5('0x123')]]['queue']]?this['queueBooked'][this['actions'][_0x284e03[_0x93a5('0x123')]][_0x93a5('0xb7')]][_0x93a5('0x132')]||0x0:0x0;}this[_0x93a5('0x2b')][this['actions'][_0x284e03[_0x93a5('0x123')]]['queue']]['_rr']=this['queueBookedRR'][this['actions'][_0x284e03[_0x93a5('0x123')]][_0x93a5('0xb7')]];for(var _0x326cd3=0x0;_0x326cd3<this[_0x93a5('0x2b')][this[_0x93a5('0x24')][_0x284e03[_0x93a5('0x123')]][_0x93a5('0xb7')]]['length'];_0x326cd3+=0x1){_0x5922ce=rr(this[_0x93a5('0x2b')][this[_0x93a5('0x24')][_0x284e03[_0x93a5('0x123')]][_0x93a5('0xb7')]]);this[_0x93a5('0x131')][_0x457265[_0x93a5('0x24')][_0x284e03[_0x93a5('0x123')]][_0x93a5('0xb7')]]=this['queueBooked'][this[_0x93a5('0x24')][_0x284e03[_0x93a5('0x123')]][_0x93a5('0xb7')]][_0x93a5('0x132')];if(_0x5922ce[_0x93a5('0xb3')]==='1'&&_0x5922ce[_0x93a5('0x126')]==='0'){break;}}if(!_[_0x93a5('0xdd')](_0x5922ce)){this[_0x93a5('0x20')][_0x5922ce[_0x93a5('0x127')]][_0x93a5('0x133')]=_['isUndefined'](this[_0x93a5('0x20')][_0x5922ce[_0x93a5('0x127')]][_0x93a5('0x133')])?!![]:this[_0x93a5('0x20')][_0x5922ce[_0x93a5('0x127')]][_0x93a5('0x133')];}loggerBooked[_0x93a5('0x80')](_0x93a5('0x134'),_0x284e03['actionid'],_0x93a5('0x135'),JSON[_0x93a5('0x4d')](_[_0x93a5('0xd3')](this['agents'][_0x5922ce[_0x93a5('0x127')]],[_0x93a5('0x43'),_0x93a5('0x133')])),_0x93a5('0x136'),JSON[_0x93a5('0x4d')](_0x5922ce[_0x93a5('0x12e')]));if(!_[_0x93a5('0xdd')](_0x5922ce)&&_0x5922ce[_0x93a5('0xb3')]==='1'&&_0x5922ce[_0x93a5('0x126')]==='0'&&this['agents'][_0x5922ce[_0x93a5('0x127')]][_0x93a5('0x133')]){this[_0x93a5('0x20')][_0x5922ce[_0x93a5('0x127')]][_0x93a5('0x133')]=![];this[_0x93a5('0x2b')][_0x457265[_0x93a5('0x24')][_0x284e03[_0x93a5('0x123')]]['queue']]=[];this[_0x93a5('0x1d')][_0x93a5('0x12d')](_0x5922ce[_0x93a5('0x12e')],_0x5922ce['stateinterface'])[_0x93a5('0xb5')](function(_0x1ac2e2){logger[_0x93a5('0x99')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x93a5('0x9b')](_0x1ac2e2,{'showHidden':![],'depth':null}));})[_0x93a5('0x1b')](function(){_0x457265[_0x93a5('0xb6')](_0x457265[_0x93a5('0x1e')][_0x457265[_0x93a5('0x24')][_0x284e03[_0x93a5('0x123')]][_0x93a5('0xb7')]]);setTimeout(function(){_0x457265[_0x93a5('0x20')][_0x5922ce[_0x93a5('0x127')]][_0x93a5('0x133')]=!![];loggerBooked[_0x93a5('0x80')]('[booked][RR][finaly]',_0x284e03[_0x93a5('0x123')],_0x93a5('0x135'),JSON['stringify'](_['pick'](_0x457265['agents'][_0x5922ce['stateinterface']],[_0x93a5('0x43'),_0x93a5('0x133')])),_0x93a5('0x136'),JSON[_0x93a5('0x4d')](_0x5922ce[_0x93a5('0x12e')]));},0xc7);delete _0x457265['actions'][_0x284e03[_0x93a5('0x123')]];unlockQueueStatus(_0x1d9da9,_0x284e03['actionid']);});}else{loggerBooked['info'](_0x93a5('0x137'));this['updateOriginated'](this['voiceQueues'][this[_0x93a5('0x24')][_0x284e03[_0x93a5('0x123')]][_0x93a5('0xb7')]]);this[_0x93a5('0xbf')]({'active':![],'ContactId':this[_0x93a5('0x24')][_0x284e03['actionid']][_0x93a5('0xd4')],'ListId':this[_0x93a5('0x24')][_0x284e03['actionid']][_0x93a5('0xfa')],'VoiceQueueId':this[_0x93a5('0x24')][_0x284e03[_0x93a5('0x123')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x93a5('0x24')][_0x284e03['actionid']]['CampaignId']||undefined})[_0x93a5('0xb5')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x93a5('0x24')][_0x284e03[_0x93a5('0x123')]];unlockQueueStatus(_0x1d9da9);}}else{loggerBooked[_0x93a5('0x80')](_0x93a5('0x138'));this[_0x93a5('0xb6')](this[_0x93a5('0x1e')][this[_0x93a5('0x24')][_0x284e03['actionid']]['queue']]);this[_0x93a5('0xbf')]({'active':![],'ContactId':this[_0x93a5('0x24')][_0x284e03[_0x93a5('0x123')]][_0x93a5('0xd4')],'ListId':this['actions'][_0x284e03[_0x93a5('0x123')]][_0x93a5('0xfa')],'VoiceQueueId':this[_0x93a5('0x24')][_0x284e03[_0x93a5('0x123')]][_0x93a5('0xd6')]||undefined,'CampaignId':this[_0x93a5('0x24')][_0x284e03[_0x93a5('0x123')]][_0x93a5('0xd7')]||undefined})[_0x93a5('0xb5')](loggerCatch(_0x93a5('0x139')));delete this['actions'][_0x284e03[_0x93a5('0x123')]];unlockQueueStatus(_0x1d9da9);}}else{loggerBooked['info'](_0x93a5('0x13a'));this['updateOriginated'](this[_0x93a5('0x1e')][this[_0x93a5('0x24')][_0x284e03['actionid']]['queue']]);this[_0x93a5('0xbf')]({'active':![],'ContactId':this[_0x93a5('0x24')][_0x284e03[_0x93a5('0x123')]][_0x93a5('0xd4')],'ListId':this[_0x93a5('0x24')][_0x284e03['actionid']][_0x93a5('0xfa')],'VoiceQueueId':this[_0x93a5('0x24')][_0x284e03[_0x93a5('0x123')]]['VoiceQueueId']||undefined,'CampaignId':this['actions'][_0x284e03['actionid']]['CampaignId']||undefined})[_0x93a5('0xb5')](loggerCatch(_0x93a5('0x13b')));delete this[_0x93a5('0x24')][_0x284e03[_0x93a5('0x123')]];unlockQueueStatus(_0x1d9da9);}};Dialer[_0x93a5('0xb0')][_0x93a5('0x3d')]=function(){var _0x58af96=this;return BPromise[_0x93a5('0xbb')]()[_0x93a5('0x40')](cmHopper[_0x93a5('0x13c')]({}))[_0x93a5('0x40')](function(){setInterval(function(){_0x58af96[_0x93a5('0x13d')]();},0x3e8);});};Dialer[_0x93a5('0xb0')][_0x93a5('0x13e')]=function(_0x46dbc4){var _0x57db08=this;return function(){if(!_0x57db08['isTrunkReachable'](_0x46dbc4['Trunk'])){if(!_0x57db08[_0x93a5('0x13f')](_0x46dbc4['TrunkBackup'])){_0x46dbc4[_0x93a5('0x41')]=_0x93a5('0x140');throw _0x46dbc4[_0x93a5('0x43')]+_0x93a5('0x141');}}};};Dialer[_0x93a5('0xb0')][_0x93a5('0x142')]=function(_0x1e2446,_0x4faaa8,_0x29bd7e,_0x338fe9){var _0x451fb7=this;return function(){var _0x1e857d=!![];return _0x451fb7['ifTime'](_0x1e2446,_0x4faaa8,_0x29bd7e,_0x338fe9,_0x1e857d);};};Dialer[_0x93a5('0xb0')]['checkIfTimeIntervals']=function(_0x15aebd,_0x441d64,_0x211ab8,_0x301cea){var _0xa9cc85=this;return function(){var _0x22f45b=![];return _0xa9cc85[_0x93a5('0x143')](_0x15aebd[_0x93a5('0x49')],_0x441d64,_0x211ab8,_0x301cea,_0x22f45b);};};Dialer[_0x93a5('0xb0')][_0x93a5('0x143')]=function(_0x599f25,_0x35bf66,_0x20e588,_0x1ad456,_0x5c29ee){var _0x12f495=[];return new BPromise(function(_0x31cb2a,_0x386d08){if(!isNotNull(_0x599f25)){_0x1ad456[_0x93a5('0x41')]=_0x93a5('0x4a');return _0x386d08(msgResponse(_0x93a5('0x143'),_0x93a5('0x144'),_0x20e588+_0x93a5('0x145')));}if(_[_0x93a5('0x4b')](_0x599f25)){_0x1ad456['message']=_0x93a5('0x146');return _0x386d08(msgResponse(_0x93a5('0x143'),_0x93a5('0x144'),_0x20e588+_0x93a5('0x147')));}if(_0x35bf66&&_[_0x93a5('0x8a')](config['timezones'][_0x35bf66])){_0x1ad456['message']=_0x93a5('0x148');return _0x386d08(msgResponse(_0x93a5('0x143'),_0x93a5('0x144'),_0x20e588+_0x93a5('0x149')+_0x35bf66));}if(_['isArray'](_0x599f25)){for(var _0x191df0=0x0;_0x191df0<_0x599f25['length'];_0x191df0+=0x1){_0x12f495['push'](ami['Action']({'action':_0x93a5('0x14a'),'command':util[_0x93a5('0x7c')](_0x93a5('0x14b'),_0x599f25[_0x191df0][_0x93a5('0x14c')],!_[_0x93a5('0x8a')](config[_0x93a5('0x14d')][_0x35bf66])?_0x35bf66:'')})['then'](function(_0x7b8db2){return _0x7b8db2[_0x93a5('0x14e')][_0x93a5('0x14f')](_0x93a5('0x150'))>=0x0;})[_0x93a5('0xb5')](myreject(_0x386d08)));}}else{_0x12f495[_0x93a5('0x129')](ami[_0x93a5('0xb2')]({'action':'command','command':util[_0x93a5('0x7c')](_0x93a5('0x14b'),_0x599f25,!_[_0x93a5('0x8a')](config['timezones'][_0x35bf66])?_0x35bf66:'')})['then'](function(_0x32bbf2){return _0x32bbf2['content'][_0x93a5('0x14f')](_0x93a5('0x150'))>=0x0;})['catch'](myreject(_0x386d08)));}BPromise[_0x93a5('0x151')](_0x12f495)[_0x93a5('0x40')](function(_0x8b3d42){var _0x47fc4c=_[_0x93a5('0x152')](_0x8b3d42);if(_0x47fc4c){return _0x31cb2a(_0x47fc4c);}else{_0x1ad456[_0x93a5('0x41')]=_0x5c29ee?_0x93a5('0x153'):_0x93a5('0x154');return _0x386d08(msgResponse(_0x93a5('0x155'),_0x93a5('0x144'),_0x93a5('0x156')+_0x5c29ee+'\x20'+_0x20e588+_0x93a5('0x157')+util[_0x93a5('0x9b')](_0x599f25,{'showHidden':![],'depth':null})+_0x93a5('0x158')+_0x35bf66));}})[_0x93a5('0xb5')](function(_0x21fe22){return _0x386d08(msgResponse(_0x93a5('0x143'),_0x93a5('0x144'),JSON['stringify'](_0x21fe22)));});});};Dialer[_0x93a5('0xb0')][_0x93a5('0x159')]=function(_0x77688){var _0x334e17=this;return function(){switch(_0x77688[_0x93a5('0x5d')]){case _0x93a5('0x15a'):freeVariablesPredictive(_0x77688);_0x334e17[_0x93a5('0x15b')](_0x77688,0x1);break;case _0x93a5('0x15c'):freeVariablesPredictive(_0x77688);_0x334e17[_0x93a5('0x15b')](_0x77688,_0x77688[_0x93a5('0x15d')]);break;case _0x93a5('0x15e'):_0x334e17[_0x93a5('0x15e')](_0x77688);break;case _0x93a5('0x9'):freeVariablesPredictive(_0x77688);_0x334e17[_0x93a5('0x15b')](_0x77688,0x1);break;default:freeVariablesPredictive(_0x77688);logger[_0x93a5('0x99')]('Queue',_0x77688[_0x93a5('0x43')],'method\x20not\x20recognized');}};};Dialer[_0x93a5('0xb0')][_0x93a5('0x15f')]=function(_0x3b578b){return BPromise['resolve']()[_0x93a5('0x40')](cmHopper['handlePreviewRecallNotifications'](_0x3b578b['id'],previewRecallmeReminderInterval))[_0x93a5('0x40')](function(_0xefd39e){for(var _0x5873e7=0x0;_0x5873e7<_0xefd39e[_0x93a5('0x9c')];_0x5873e7++){var _0x286682=_0xefd39e[_0x5873e7]['Agent'][_0x93a5('0x43')];if(_0x286682)io['to'](util[_0x93a5('0x7c')](_0x93a5('0x160'),_0x286682))[_0x93a5('0xe5')](_0x93a5('0x161'),{'hopper':_0xefd39e[_0x5873e7]});}})['catch'](function(_0x2871e2){});};Dialer[_0x93a5('0xb0')]['launchHandleIvr']=function(_0x103d2a){var _0x143331=this;return function(){_0x143331[_0x93a5('0x162')](_0x103d2a);};};Dialer[_0x93a5('0xb0')][_0x93a5('0xa')]=function(_0x31bb7f){var _0x55cf6e=this;if(isNotPreview(_0x31bb7f['dialMethod'])){if(isVoiceQueueOutbound(_0x31bb7f['type'])&&isActive(_0x31bb7f['dialActive'])){_0x31bb7f[_0x93a5('0xa7')]=!![];BPromise[_0x93a5('0xbb')]()[_0x93a5('0x40')](checkIsLoggedIn(_0x31bb7f,_0x31bb7f[_0x93a5('0x52')]))['then'](checkIsActive(_0x31bb7f,_0x31bb7f[_0x93a5('0x5c')]))[_0x93a5('0x40')](checkInterval(_0x31bb7f))[_0x93a5('0x40')](_0x55cf6e[_0x93a5('0x13e')](_0x31bb7f))[_0x93a5('0x40')](_0x55cf6e['checkIfTime'](_0x31bb7f['dialGlobalInterval'],_0x31bb7f['dialTimezone'],_0x31bb7f['name'],_0x31bb7f))['then'](_0x55cf6e['checkIfTimeIntervals'](_0x31bb7f['Interval'],_0x31bb7f[_0x93a5('0x163')],_0x31bb7f[_0x93a5('0x43')],_0x31bb7f))[_0x93a5('0x40')](_0x55cf6e[_0x93a5('0x159')](_0x31bb7f))['catch'](loggerCatchQueueSummary('[syncQueueSummary]',_0x31bb7f));}else{notSendMessagesQueue(_0x31bb7f);}}else{freeVariablesPredictive(_0x31bb7f);if(_0x31bb7f[_0x93a5('0x164')]){_0x55cf6e['checkPreviewRecallReminder'](_0x31bb7f);}}};Dialer[_0x93a5('0xb0')][_0x93a5('0x13d')]=function(){var _0x12df07=this;var _0x2855b3;for(var _0xe9254c in this['campaigns']){if(typeof this[_0x93a5('0x1f')][_0xe9254c]!==_0x93a5('0x9e')){_0x2855b3=this[_0x93a5('0x1f')][_0xe9254c];if(isCampaignIvr(_0x2855b3[_0x93a5('0x4f')])&&isActive(_0x2855b3[_0x93a5('0x79')])){_0x2855b3[_0x93a5('0xa7')]=!![];BPromise['resolve']()[_0x93a5('0x40')](checkIsActive(_0x2855b3,_0x2855b3[_0x93a5('0x79')]))[_0x93a5('0x40')](checkInterval(_0x2855b3))['then'](_0x12df07[_0x93a5('0x13e')](_0x2855b3))['then'](_0x12df07[_0x93a5('0x142')](_0x2855b3[_0x93a5('0x165')],_0x2855b3[_0x93a5('0x163')],_0x2855b3[_0x93a5('0x43')],_0x2855b3))[_0x93a5('0x40')](_0x12df07['checkIfTimeIntervals'](_0x2855b3[_0x93a5('0x47')],_0x2855b3[_0x93a5('0x163')],_0x2855b3[_0x93a5('0x43')],_0x2855b3))['then'](_0x12df07[_0x93a5('0x166')](_0x2855b3))[_0x93a5('0xb5')](loggerCatchQueueSummary(_0x93a5('0x167'),_0x2855b3));}else{notSendMessagesCampaign(_0x2855b3);}}}};function getCallerIdRandom(_0x106ccf,_0x345c90){var _0x41641;var _0x1e551c;var _0x2f7107;if(_0x345c90<=0x0){_0x345c90=0x1;}_0x41641=new RegExp(_0x93a5('0x168')+_0x345c90+'}$');_0x1e551c=Math[_0x93a5('0x169')](0xa,_0x345c90-0x1);_0x2f7107=Math[_0x93a5('0x169')](0xa,_0x345c90)-0x1;return util[_0x93a5('0x7c')]('%s',_[_0x93a5('0x16a')](_0x106ccf,_0x41641,_[_0x93a5('0x16b')](_0x1e551c,_0x2f7107)));}function extractCalleridName(_0x117004){var _0x45eed4=_0x117004['match'](/"(.*?)"/);return _0x45eed4?_0x45eed4[0x1]:_0x117004;}function extractCalleridNumber(_0x2b6173){var _0x3a4274=_0x2b6173['match'](/<(.*?)>/);return _0x3a4274?_0x3a4274[0x1]:_0x2b6173;}Dialer[_0x93a5('0xb0')][_0x93a5('0x16c')]=function(_0x3847c8,_0x26649c){var _0x257c21=this;var _0x3bd376=uuid['v4']();this[_0x93a5('0x24')][_0x3bd376]=new Action(_0x3847c8,_0x26649c,_0x3bd376);return new BPromise(function(_0x1761e1,_0x1cd760){if(_[_0x93a5('0x8a')](_0x3847c8)&&typeof _0x3847c8!=='object'){return _0x1cd760(msgResponse(_0x93a5('0x16d'),_0x93a5('0x144'),_0x93a5('0x16e')));}if(_[_0x93a5('0x8a')](_0x26649c[_0x93a5('0x16f')]['phone'])||_0x26649c[_0x93a5('0x16f')][_0x93a5('0x170')]===null){return _0x1cd760(msgResponse(_0x93a5('0x16d'),_0x93a5('0x144'),_0x93a5('0x171')));}var _0x4f105b={'XMD-CALLERID':_0x257c21[_0x93a5('0x24')][_0x3bd376][_0x93a5('0x172')](),'XMD-AGI':_0x3847c8['dialQueueProject']?util[_0x93a5('0x7c')](_0x93a5('0x173'),ipAgi,_0x3847c8[_0x93a5('0x107')]):_0x93a5('0x174'),'XMD-AGIAFTER':_0x3847c8['dialQueueProject2']?util[_0x93a5('0x7c')](_0x93a5('0x173'),ipAgi,_0x3847c8['dialQueueProject2']):'NONE','XMD-QUEUE':_0x3847c8[_0x93a5('0x4f')]===_0x93a5('0x50')?util['format'](_0x93a5('0x175'),_0x3847c8[_0x93a5('0x43')],_0x3847c8[_0x93a5('0x176')]||'',_0x3847c8[_0x93a5('0x10d')]?'c':'',_0x3847c8['dialQueueTimeout']||0x3):'NONE','XMD-CONTACTID':_0x26649c['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x257c21[_0x93a5('0x24')][_0x3bd376][_0x93a5('0x172')](),'XMD-AMD':_0x3847c8[_0x93a5('0xe0')]?_0x93a5('0x177'):'NONE','XMD-DESTINATION':'xcally-motion-dialer'};if(_0x3847c8[_0x93a5('0xe0')]){_0x4f105b[_0x93a5('0x178')]=_0x3847c8[_0x93a5('0x179')]||0x9c4;_0x4f105b[_0x93a5('0x17a')]=_0x3847c8[_0x93a5('0x17b')]||0x5dc;_0x4f105b['XMD-AMDAFTERGREETINGSILENCE']=_0x3847c8['dialAMDAfterGreetingSilence']||0x320;_0x4f105b[_0x93a5('0x17c')]=_0x3847c8[_0x93a5('0x17d')]||0x1388;_0x4f105b[_0x93a5('0x17e')]=_0x3847c8[_0x93a5('0x17f')]||0x64;_0x4f105b[_0x93a5('0x180')]=_0x3847c8[_0x93a5('0x181')]||0x32;_0x4f105b[_0x93a5('0x182')]=_0x3847c8['dialAMDMaximumNumberOfWords']||0x3;_0x4f105b[_0x93a5('0x183')]=_0x3847c8[_0x93a5('0x184')]||0x100;_0x4f105b[_0x93a5('0x185')]=_0x3847c8[_0x93a5('0x186')]||0x1388;}if(_0x3847c8[_0x93a5('0x4f')]===_0x93a5('0x50')){_0x4f105b['XMD-VOICEQUEUEID']=_0x26649c[_0x93a5('0xd6')];}else{_0x4f105b[_0x93a5('0x187')]=_0x26649c[_0x93a5('0xd7')];}for(var _0x4df1b9 in _0x26649c[_0x93a5('0x16f')]){if(typeof _0x26649c[_0x93a5('0x16f')][_0x4df1b9]!==_0x93a5('0x9e')){if(isNotNull(_0x26649c[_0x93a5('0x16f')][_0x4df1b9])&&_0x4df1b9!=='id'&&_0x4df1b9!==_0x93a5('0x188')&&_0x4df1b9!==_0x93a5('0x189')&&_0x4df1b9!==_0x93a5('0x18a')){_0x4f105b[util['format'](_0x93a5('0x18b'),_0x93a5('0x18c'),_['toUpper'](_0x4df1b9))]=_0x26649c[_0x93a5('0x16f')][_0x4df1b9];}}}var _0x1115a3=_0x257c21[_0x93a5('0x13f')](_0x3847c8[_0x93a5('0x78')])?getCallerId(_0x3847c8[_0x93a5('0x78')][_0x93a5('0x7a')],_0x3847c8[_0x93a5('0x5e')],_0x3847c8['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x3847c8[_0x93a5('0x18d')],_0x3847c8[_0x93a5('0x18e')]):_0x3847c8[_0x93a5('0x18d')]):getCallerId(_[_0x93a5('0xdd')](_0x3847c8[_0x93a5('0x18f')])?_0x3847c8[_0x93a5('0x78')][_0x93a5('0x7a')]:_0x3847c8[_0x93a5('0x18f')]['callerid'],_0x3847c8['dialOriginateCallerIdName'],_0x3847c8[_0x93a5('0x18e')]>0x0?getCallerIdRandom(_0x3847c8[_0x93a5('0x18d')],_0x3847c8[_0x93a5('0x18e')]):_0x3847c8['dialOriginateCallerIdNumber']);if(_0x1115a3){_0x4f105b[_0x93a5('0x190')]=_0x257c21[_0x93a5('0x24')][_0x3bd376][_0x93a5('0x191')]=extractCalleridName(_0x1115a3);_0x4f105b[_0x93a5('0x192')]=_0x257c21[_0x93a5('0x24')][_0x3bd376][_0x93a5('0x193')]=extractCalleridNumber(_0x1115a3);}return ami[_0x93a5('0xb2')]({'actionid':_0x3bd376,'action':_0x93a5('0x16d'),'channel':_0x257c21['isTrunkReachable'](_0x3847c8[_0x93a5('0x78')])?util[_0x93a5('0x7c')](_0x93a5('0x194'),_0x3847c8[_0x93a5('0x78')]['name'],isNotNull(_0x3847c8[_0x93a5('0x60')])?_0x3847c8['dialPrefix'][_0x93a5('0x195')]()||'':'',_0x3847c8[_0x93a5('0x196')]>0x0?_0x26649c[_0x93a5('0x16f')]['phone'][_0x93a5('0x197')](_0x3847c8[_0x93a5('0x196')]):_0x26649c[_0x93a5('0x16f')]['phone']):util[_0x93a5('0x7c')](_0x93a5('0x194'),_['isNil'](_0x3847c8[_0x93a5('0x18f')])?_0x3847c8['Trunk'][_0x93a5('0x43')]:_0x3847c8['TrunkBackup'][_0x93a5('0x43')],isNotNull(_0x3847c8['dialPrefix'])?_0x3847c8[_0x93a5('0x60')][_0x93a5('0x195')]()||'':'',_0x3847c8['dialCutDigit']>0x0?_0x26649c['Contact']['phone'][_0x93a5('0x197')](_0x3847c8['dialCutDigit']):_0x26649c['Contact'][_0x93a5('0x170')]),'callerid':_0x1115a3,'Exten':'xcally-motion-dialer','Context':_0x93a5('0x198'),'Priority':'1','variable':_0x4f105b,'timeout':(_0x3847c8['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x3bd376})[_0x93a5('0x40')](function(_0x5c31f4){return _0x1761e1(_0x5c31f4);})['catch'](function(_0x487915){_0x3847c8['outboundOriginateFailureCallsDay']+=0x1;var _0x16d718=new History(_0x257c21[_0x93a5('0x24')][_0x3bd376]);logger[_0x93a5('0x99')](util['format'](_0x93a5('0x199'),JSON[_0x93a5('0x4d')](_0x487915)));_0x16d718[_0x93a5('0xad')]=0xe;_0x16d718[_0x93a5('0xe4')]=_0x93a5('0x19a');_0x16d718[_0x93a5('0x11a')]=moment()['format'](_0x93a5('0xf9'));_0x16d718[_0x93a5('0x19b')]=_0x16d718[_0x93a5('0x11a')];_0x257c21[_0x93a5('0xcb')](_0x16d718)[_0x93a5('0xb5')](loggerCatch('[originate][error]'));_0x257c21[_0x93a5('0xc9')](_0x16d718)[_0x93a5('0xb5')](loggerCatch(_0x93a5('0x19c')))[_0x93a5('0x1b')](function(){delete _0x257c21['actions'][_0x3bd376];return _0x1cd760(msgResponse(_0x93a5('0x16d'),_0x93a5('0x4c'),_0x93a5('0x19d')));});});});};Dialer['prototype'][_0x93a5('0x31')]=function(_0x34c703){var _0x38c47e=this[_0x93a5('0x24')][_0x34c703[_0x93a5('0x123')]];if(_0x38c47e){delete this[_0x93a5('0x24')][_0x34c703[_0x93a5('0x123')]];_0x38c47e[_0x93a5('0x19e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x32bc7a=_0x38c47e[_0x93a5('0x4f')]===_0x93a5('0x7d')?this[_0x93a5('0x1f')][_0x38c47e[_0x93a5('0xb7')]]:this['voiceQueues'][_0x38c47e[_0x93a5('0x19f')]()];if(!this[_0x93a5('0x1a0')](_0x34c703[_0x93a5('0x1a1')])){this['updateOriginated'](_0x32bc7a);return this[_0x93a5('0x1a2')](_0x38c47e,_0x32bc7a,_0x34c703)[_0x93a5('0xb5')](loggerCatch('[callProgressDetecting]\x20'));}this['uniqueId'][_0x34c703[_0x93a5('0xe8')]]=_0x38c47e;}};Dialer[_0x93a5('0xb0')][_0x93a5('0x1a3')]=function(_0x3cea3c,_0x5d397b,_0x4a3008){var _0x42a94c=new History(_0x5d397b);if(_0x42a94c[_0x93a5('0xee')]+_0x42a94c['countcongestionretry']+_0x42a94c['countnoanswerretry']+_0x42a94c[_0x93a5('0x100')]+_0x42a94c['countdropretry']+_0x42a94c[_0x93a5('0xf2')]+_0x42a94c[_0x93a5('0xea')]+_0x42a94c[_0x93a5('0xf3')]>=_0x4a3008['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x3cea3c){case 0x3:if(_0x42a94c[_0x93a5('0xf0')]>=_0x4a3008['dialNoAnswerMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x42a94c[_0x93a5('0xf0')]+=0x1,'scheduledat':moment()[_0x93a5('0xf8')](_0x4a3008[_0x93a5('0x1a4')],'minutes')[_0x93a5('0x7c')](_0x93a5('0xf9')),'ContactId':_0x42a94c['ContactId'],'ListId':_0x42a94c['ListId'],'VoiceQueueId':_0x42a94c[_0x93a5('0xd6')]||undefined,'CampaignId':_0x42a94c['CampaignId']||undefined})[_0x93a5('0xb5')](loggerCatch(_0x93a5('0x1a5')));break;case 0x5:if(_0x42a94c[_0x93a5('0xee')]>=_0x4a3008[_0x93a5('0x1a6')]-0x1){return!![];}this[_0x93a5('0xbf')]({'active':![],'countbusyretry':_0x42a94c[_0x93a5('0xee')]+=0x1,'scheduledat':moment()[_0x93a5('0xf8')](_0x4a3008[_0x93a5('0x1a7')],'minutes')['format'](_0x93a5('0xf9')),'ContactId':_0x42a94c[_0x93a5('0xd4')],'ListId':_0x42a94c[_0x93a5('0xfa')],'VoiceQueueId':_0x42a94c[_0x93a5('0xd6')]||undefined,'CampaignId':_0x42a94c['CampaignId']||undefined})[_0x93a5('0xb5')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x42a94c[_0x93a5('0xef')]>=_0x4a3008[_0x93a5('0x1a8')]-0x1){return!![];}this[_0x93a5('0xbf')]({'active':![],'countcongestionretry':_0x42a94c[_0x93a5('0xef')]+=0x1,'scheduledat':moment()['add'](_0x4a3008[_0x93a5('0x1a9')],_0x93a5('0x103'))[_0x93a5('0x7c')](_0x93a5('0xf9')),'ContactId':_0x42a94c['ContactId'],'ListId':_0x42a94c[_0x93a5('0xfa')],'VoiceQueueId':_0x42a94c[_0x93a5('0xd6')]||undefined,'CampaignId':_0x42a94c[_0x93a5('0xd7')]||undefined})[_0x93a5('0xb5')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x42a94c[_0x93a5('0x100')]>=_0x4a3008[_0x93a5('0x1aa')]-0x1){return!![];}else{this[_0x93a5('0xbf')]({'active':![],'countnosuchnumberretry':_0x42a94c['countnosuchnumberretry']+=0x1,'scheduledat':moment()['add'](_0x4a3008[_0x93a5('0x1ab')],_0x93a5('0x103'))[_0x93a5('0x7c')](_0x93a5('0xf9')),'ContactId':_0x42a94c[_0x93a5('0xd4')],'ListId':_0x42a94c['ListId'],'VoiceQueueId':_0x42a94c[_0x93a5('0xd6')]||undefined,'CampaignId':_0x42a94c[_0x93a5('0xd7')]||undefined})['catch'](loggerCatch(_0x93a5('0x1ac')));}break;case 0xa:if(_0x42a94c[_0x93a5('0xf1')]>=_0x4a3008[_0x93a5('0x117')]-0x1){return!![];}this[_0x93a5('0xbf')]({'active':![],'countdropretry':_0x42a94c[_0x93a5('0xf1')]+=0x1,'scheduledat':moment()[_0x93a5('0xf8')](_0x4a3008[_0x93a5('0x119')],_0x93a5('0x103'))[_0x93a5('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x42a94c[_0x93a5('0xd4')],'ListId':_0x42a94c[_0x93a5('0xfa')],'VoiceQueueId':_0x42a94c[_0x93a5('0xd6')]||undefined,'CampaignId':_0x42a94c[_0x93a5('0xd7')]||undefined})[_0x93a5('0xb5')](loggerCatch(_0x93a5('0x1ad')));break;case 0xb:if(_0x42a94c[_0x93a5('0xf2')]>=_0x4a3008[_0x93a5('0x120')]-0x1){return!![];}this[_0x93a5('0xbf')]({'active':![],'countabandonedretry':_0x42a94c[_0x93a5('0xf2')]+=0x1,'scheduledat':moment()['add'](_0x4a3008[_0x93a5('0x121')],_0x93a5('0x103'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x42a94c['ContactId'],'ListId':_0x42a94c[_0x93a5('0xfa')],'VoiceQueueId':_0x42a94c['VoiceQueueId']||undefined,'CampaignId':_0x42a94c[_0x93a5('0xd7')]||undefined})[_0x93a5('0xb5')](loggerCatch(_0x93a5('0x122')));break;case 0x13:if(_0x42a94c['countmachineretry']>=_0x4a3008['dialMachineMaxRetry']-0x1){return!![];}this[_0x93a5('0xbf')]({'active':![],'countmachineretry':_0x42a94c[_0x93a5('0xea')]+=0x1,'scheduledat':moment()[_0x93a5('0xf8')](_0x4a3008[_0x93a5('0x102')],_0x93a5('0x103'))[_0x93a5('0x7c')](_0x93a5('0xf9')),'ContactId':_0x42a94c[_0x93a5('0xd4')],'ListId':_0x42a94c[_0x93a5('0xfa')],'VoiceQueueId':_0x42a94c[_0x93a5('0xd6')]||undefined,'CampaignId':_0x42a94c['CampaignId']||undefined})[_0x93a5('0xb5')](loggerCatch(_0x93a5('0xfb')));break;case 0x14:if(_0x42a94c['countagentrejectretry']>=_0x4a3008[_0x93a5('0x1ae')]-0x1){return!![];}this[_0x93a5('0xbf')]({'active':![],'countagentrejectretry':_0x42a94c[_0x93a5('0xf3')]+=0x1,'scheduledat':moment()[_0x93a5('0xf8')](_0x4a3008[_0x93a5('0x1af')],_0x93a5('0x103'))[_0x93a5('0x7c')](_0x93a5('0xf9')),'ContactId':_0x42a94c[_0x93a5('0xd4')],'ListId':_0x42a94c[_0x93a5('0xfa')],'VoiceQueueId':_0x42a94c[_0x93a5('0xd6')]||undefined,'CampaignId':_0x42a94c['CampaignId']||undefined})['catch'](loggerCatch(_0x93a5('0x1b0')));break;default:return!![];}};Dialer[_0x93a5('0xb0')][_0x93a5('0x1a2')]=function(_0x40e5fa,_0x40d9bc,_0x176e97){var _0x1289f5=this;var _0x4dd59a=new History(_0x40e5fa);return new BPromise(function(_0x46ceee,_0x264f97){if(_[_0x93a5('0x8a')](_0x40d9bc)&&typeof _0x40d9bc!==_0x93a5('0x1b1')){return _0x264f97(msgResponse(_0x93a5('0x1b2'),_0x93a5('0x144'),'entity\x20is\x20undefine'));}if(_[_0x93a5('0x8a')](_0x176e97)&&typeof _0x176e97!==_0x93a5('0x1b1')){return _0x264f97(msgResponse(_0x93a5('0x1b2'),'Failure',_0x93a5('0x1b3')));}switch(_0x176e97[_0x93a5('0x1b4')]){case'0':_0x40d9bc['outboundNoSuchCallsDay']+=0x1;_0x4dd59a[_0x93a5('0xad')]=0x0;_0x4dd59a[_0x93a5('0xe4')]=_0x93a5('0x1b5');_0x4dd59a[_0x93a5('0x100')]+=0x1;_0x4dd59a[_0x93a5('0xeb')]+=0x1;ami[_0x93a5('0xe5')](_0x93a5('0x1b6'),ut[_0x93a5('0xec')](_0x40e5fa,_0x93a5('0x1b7')));_0x1289f5[_0x93a5('0xcb')](_0x4dd59a)[_0x93a5('0xb5')](loggerCatch(_0x93a5('0xed')));if(_0x1289f5[_0x93a5('0x1a3')](0x0,_0x40e5fa,_0x40d9bc)){if(_0x4dd59a[_0x93a5('0x100')]>=_0x40d9bc[_0x93a5('0x1aa')]){_0x1289f5[_0x93a5('0xf7')](_0x4dd59a,_0x46ceee,_0x264f97,_0x93a5('0x1b8'));}else{_0x1289f5[_0x93a5('0xf4')](_0x4dd59a,_0x46ceee,_0x264f97,_0x93a5('0x1b8'));}}break;case'3':_0x40d9bc[_0x93a5('0x66')]+=0x1;_0x4dd59a[_0x93a5('0xad')]=0x3;_0x4dd59a[_0x93a5('0xe4')]=_0x93a5('0x1b9');_0x4dd59a['countnoanswerretry']+=0x1;_0x4dd59a[_0x93a5('0xeb')]+=0x1;ami[_0x93a5('0xe5')]('custom:agentnoanswer',ut[_0x93a5('0xec')](_0x40e5fa,_0x93a5('0x1ba')));_0x1289f5[_0x93a5('0xcb')](_0x4dd59a)[_0x93a5('0xb5')](loggerCatch(_0x93a5('0x1bb')));if(_0x1289f5[_0x93a5('0x1a3')](0x3,_0x40e5fa,_0x40d9bc)){if(_0x4dd59a['countnoanswerretry']>=_0x40d9bc[_0x93a5('0x1bc')]){_0x1289f5['createStateFinal'](_0x4dd59a,_0x46ceee,_0x264f97,_0x93a5('0x1bd'));}else{_0x1289f5[_0x93a5('0xf4')](_0x4dd59a,_0x46ceee,_0x264f97,_0x93a5('0x1bd'));}}break;case'5':_0x40d9bc['outboundBusyCallsDay']+=0x1;_0x4dd59a[_0x93a5('0xad')]=0x5;_0x4dd59a[_0x93a5('0xe4')]=_0x93a5('0x1be');_0x4dd59a[_0x93a5('0xee')]+=0x1;_0x4dd59a[_0x93a5('0xeb')]+=0x1;ami[_0x93a5('0xe5')](_0x93a5('0x1bf'),ut['buildObj'](_0x40e5fa,_0x93a5('0x1c0')));_0x1289f5[_0x93a5('0xcb')](_0x4dd59a)[_0x93a5('0xb5')](loggerCatch(_0x93a5('0x1c1')));if(_0x1289f5['checkRetriveMax'](0x5,_0x40e5fa,_0x40d9bc)){if(_0x4dd59a[_0x93a5('0xee')]>=_0x40d9bc[_0x93a5('0x1a6')]){_0x1289f5[_0x93a5('0xf7')](_0x4dd59a,_0x46ceee,_0x264f97,_0x93a5('0x1c2'));}else{_0x1289f5[_0x93a5('0xf4')](_0x4dd59a,_0x46ceee,_0x264f97,_0x93a5('0x1c2'));}}break;case'8':_0x40d9bc['outboundCongestionCallsDay']+=0x1;_0x4dd59a[_0x93a5('0xad')]=0x8;_0x4dd59a[_0x93a5('0xe4')]=_0x93a5('0x1c3');_0x4dd59a[_0x93a5('0xef')]+=0x1;_0x4dd59a[_0x93a5('0xeb')]+=0x1;ami[_0x93a5('0xe5')](_0x93a5('0x1c4'),ut[_0x93a5('0xec')](_0x40e5fa,_0x93a5('0x1c5')));_0x1289f5[_0x93a5('0xcb')](_0x4dd59a)[_0x93a5('0xb5')](loggerCatch(_0x93a5('0x1c6')));if(_0x1289f5[_0x93a5('0x1a3')](0x8,_0x40e5fa,_0x40d9bc)){if(_0x4dd59a[_0x93a5('0xef')]>=_0x40d9bc[_0x93a5('0x1a8')]){_0x1289f5[_0x93a5('0xf7')](_0x4dd59a,_0x46ceee,_0x264f97,'reason\x208\x20congestion');}else{_0x1289f5[_0x93a5('0xf4')](_0x4dd59a,_0x46ceee,_0x264f97,_0x93a5('0x1c7'));}}break;case'11':_0x40d9bc[_0x93a5('0x1c8')]+=0x1;_0x4dd59a[_0x93a5('0xad')]=0xb;_0x4dd59a[_0x93a5('0xe4')]=_0x93a5('0x11e');_0x4dd59a[_0x93a5('0xf2')]+=0x1;_0x4dd59a['countglobal']+=0x1;_0x1289f5[_0x93a5('0xcb')](_0x4dd59a)[_0x93a5('0xb5')](loggerCatch(_0x93a5('0x1c9')));if(_0x1289f5[_0x93a5('0x1a3')](0xb,_0x40e5fa,_0x40d9bc)){if(_0x4dd59a['countabandonedretry']>=_0x40d9bc[_0x93a5('0x120')]){_0x1289f5['createStateFinal'](_0x4dd59a,_0x46ceee,_0x264f97,_0x93a5('0x1ca'));}else{_0x1289f5[_0x93a5('0xf4')](_0x4dd59a,_0x46ceee,_0x264f97,_0x93a5('0x1ca'));}}break;case'20':_0x40d9bc['outboundRejectCallsDay']+=0x1;_0x4dd59a[_0x93a5('0xad')]=0x14;_0x4dd59a['statedesc']=_0x93a5('0x1cb');_0x4dd59a[_0x93a5('0xf3')]+=0x1;_0x4dd59a['countglobal']+=0x1;ami[_0x93a5('0xe5')](_0x93a5('0x1cc'),ut[_0x93a5('0xec')](_0x40e5fa,_0x93a5('0x1cd')));_0x1289f5['createHistory'](_0x4dd59a)[_0x93a5('0xb5')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x1289f5[_0x93a5('0x1a3')](0x14,_0x40e5fa,_0x40d9bc)){if(_0x4dd59a[_0x93a5('0xf3')]>=_0x40d9bc[_0x93a5('0x1ae')]){_0x1289f5['createStateFinal'](_0x4dd59a,_0x46ceee,_0x264f97,'reason\x2020\x20agentreject');}else{_0x1289f5[_0x93a5('0xf4')](_0x4dd59a,_0x46ceee,_0x264f97,'reason\x2020\x20agentreject');}}break;default:_0x40d9bc[_0x93a5('0x6b')]+=0x1;_0x4dd59a['state']=0xc;_0x4dd59a[_0x93a5('0xe4')]=_0x176e97[_0x93a5('0x1b4')];_0x1289f5['createHistory'](_0x4dd59a)[_0x93a5('0xb5')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x1289f5[_0x93a5('0x1a3')](_0x176e97[_0x93a5('0x1b4')],_0x40e5fa,_0x40d9bc)){if(_0x4dd59a[_0x93a5('0xee')]+_0x4dd59a[_0x93a5('0xef')]+_0x4dd59a[_0x93a5('0xf0')]+_0x4dd59a[_0x93a5('0x100')]+_0x4dd59a[_0x93a5('0xf1')]+_0x4dd59a[_0x93a5('0xf2')]+_0x4dd59a['countmachineretry']+_0x4dd59a['countagentrejectretry']>=_0x40d9bc[_0x93a5('0x1ce')]){_0x1289f5['stateGlobal'](_0x4dd59a,_0x46ceee,_0x264f97,_0x176e97['reason']);}else{_0x1289f5[_0x93a5('0xf7')](_0x4dd59a,_0x46ceee,_0x264f97,_0x176e97['reason']);}}}});};Dialer['prototype'][_0x93a5('0xf4')]=function(_0x5a6957,_0x4511e1,_0x58a9c3,_0x4174d7){var _0x4901aa=new Final(_0x5a6957);_0x4901aa[_0x93a5('0xad')]=0xf;_0x4901aa[_0x93a5('0xe4')]=_0x93a5('0x1cf');this[_0x93a5('0xf7')](_0x4901aa,_0x4511e1,_0x58a9c3,_0x4174d7);};Dialer['prototype'][_0x93a5('0xf7')]=function(_0x1efadd,_0xdad7a8,_0x5676f7,_0x5645fc){this[_0x93a5('0xc9')](_0x1efadd)['then'](function(){return _0xdad7a8(msgResponse('[callProgressDetecting]',_0x93a5('0xd9'),_0x5645fc));})[_0x93a5('0xb5')](function(){return _0x5676f7(msgResponse('[moveContactManagedDialer][0]',_0x93a5('0x144'),_0x93a5('0x1d0')));});};Dialer[_0x93a5('0xb0')][_0x93a5('0x15e')]=function(_0x2c9d15){var _0x3a8b25=_0x2c9d15['dialPredictiveOptimizationPercentage']/0x64;var _0x3ce745=_0x2c9d15[_0x93a5('0x65')]/(_0x2c9d15['outboundDropCallsDayTimeout']+_0x2c9d15[_0x93a5('0x61')]);var _0x133266=Math[_0x93a5('0x1d1')](_0x2c9d15[_0x93a5('0x1d2')]*(_0x2c9d15[_0x93a5('0x1d3')]/0x64));var _0x425fa2=Math['round'](_0x2c9d15[_0x93a5('0x1d2')]*(_0x2c9d15['predictiveIntervalMinThreshold']/0x64));var _0xa4279a=_0x2c9d15['available']+_0x2c9d15[_0x93a5('0x57')];var _0xd7f548=Math[_0x93a5('0x1d4')](_0x2c9d15[_0x93a5('0x75')]*_0x2c9d15[_0x93a5('0x76')]*_0x2c9d15[_0x93a5('0x72')]*_0x2c9d15['predictiveIntervalMultiplicativeFactor']);if(_[_0x93a5('0x8a')](_0x2c9d15['startProgressive'])){if(!_[_0x93a5('0x8a')](_0x2c9d15[_0x93a5('0x28')])){_0x2c9d15[_0x93a5('0x28')]=undefined;loggerPredictive[_0x93a5('0x99')](_0x93a5('0x1d5'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x93a5('0x8a')](_0x2c9d15[_0x93a5('0x94')])){loggerPredictive[_0x93a5('0x99')](_0x93a5('0x1d5'),_0x93a5('0x1d6'));clearInterval(_0x2c9d15['handlePredictive']);_0x2c9d15[_0x93a5('0x94')]=undefined;}_0x2c9d15[_0x93a5('0x29')]=moment()[_0x93a5('0x7c')](_0x93a5('0xf9'));loggerPredictive['info'](_0x2c9d15['name'],_0x93a5('0x1d7'),_0x2c9d15[_0x93a5('0x29')]);this['handlePower'](_0x2c9d15,0x1);}else if(ifInterval(_0x2c9d15['dialPredictiveInterval'],_0x2c9d15['startProgressive'])){this[_0x93a5('0x15b')](_0x2c9d15,0x1);loggerPredictiveCalls['info'](_0x93a5('0x1d8'),_0x2c9d15[_0x93a5('0x29')],_0x2c9d15[_0x93a5('0x43')]);_0x2c9d15['erlangCalls']=0x0;_0x2c9d15[_0x93a5('0x71')]=0x0;}else if(_0x3a8b25<_0x3ce745&&_0x2c9d15[_0x93a5('0x1d9')]===_0x93a5('0x1da')){freeVariablesPredictive(_0x2c9d15);loggerPredictive[_0x93a5('0x80')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x93a5('0x1db'),_0x3ce745,_0x93a5('0x29'),_0x2c9d15[_0x93a5('0x43')]);}else if(_0xd7f548<_0x2c9d15[_0x93a5('0x71')]&&_0x2c9d15['dialPredictiveOptimization']===_0x93a5('0x1da')){freeVariablesPredictive(_0x2c9d15);loggerPredictive[_0x93a5('0x80')](_0x93a5('0x1dc'),_0x93a5('0x1dd'),_0xd7f548,'Drop\x20in\x20this\x20interval',_0x2c9d15[_0x93a5('0x71')],'startProgressive',_0x2c9d15[_0x93a5('0x43')]);}else if(!ifInterval(_0x2c9d15[_0x93a5('0x1de')],_0x2c9d15[_0x93a5('0x29')])&&_['isUndefined'](_0x2c9d15[_0x93a5('0x28')])&&!_['isUndefined'](_0x2c9d15[_0x93a5('0x29')])){_0x2c9d15[_0x93a5('0x28')]=moment()[_0x93a5('0x7c')](_0x93a5('0xf9'));loggerPredictive[_0x93a5('0x80')](_0x2c9d15[_0x93a5('0x43')],_0x93a5('0x1df'),_0x2c9d15[_0x93a5('0x28')]);this['averageHandleTime'](_0x2c9d15[_0x93a5('0x1de')])[_0x93a5('0x40')](this[_0x93a5('0x1e0')](_0x2c9d15))['then'](mergeDataErlangB(_0x2c9d15))[_0x93a5('0x40')](this[_0x93a5('0x1e1')](_0x2c9d15))[_0x93a5('0xb5')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x2c9d15));}else if(!ifInterval(_0x2c9d15[_0x93a5('0x1de')],_0x2c9d15['startPredictive'])){_0x2c9d15[_0x93a5('0x71')]=0x0;_0x2c9d15[_0x93a5('0x28')]=moment()[_0x93a5('0x7c')](_0x93a5('0xf9'));loggerPredictive[_0x93a5('0x80')](_0x2c9d15[_0x93a5('0x43')],_0x93a5('0x1e2'),_0x2c9d15[_0x93a5('0x28')]);clearInterval(_0x2c9d15['handlePredictive']);_0x2c9d15[_0x93a5('0x94')]=undefined;this[_0x93a5('0x1e3')](_0x2c9d15[_0x93a5('0x1de')])[_0x93a5('0x40')](this[_0x93a5('0x1e0')](_0x2c9d15))[_0x93a5('0x40')](mergeDataErlangB(_0x2c9d15))[_0x93a5('0x40')](this[_0x93a5('0x1e1')](_0x2c9d15))[_0x93a5('0xb5')](loggerCatchPredictive(_0x93a5('0x1e4'),_0x2c9d15));}else if(_0x2c9d15['predictiveIntervalAvailable']&&_0xa4279a<_0x2c9d15['predictiveIntervalAvailable']-_0x425fa2){freeVariablesPredictive(_0x2c9d15);loggerPredictive[_0x93a5('0x80')](_0x2c9d15[_0x93a5('0x43')],_0x93a5('0x1e5'),_0xa4279a,')\x20are\x20less\x20than\x20threshold\x20(',_0x2c9d15[_0x93a5('0x1d2')],'-',_0x425fa2,'=',_0x2c9d15[_0x93a5('0x1d2')]-_0x425fa2,')');}else if(_0x2c9d15['predictiveIntervalAvailable']&&_0xa4279a>_0x2c9d15[_0x93a5('0x1d2')]+_0x133266){freeVariablesPredictive(_0x2c9d15);loggerPredictive[_0x93a5('0x80')](_0x2c9d15[_0x93a5('0x43')],_0x93a5('0x1e5'),_0xa4279a,_0x93a5('0x1e6'),_0x2c9d15['predictiveIntervalAvailable'],'+',_0x133266,'=',_0x2c9d15['predictiveIntervalAvailable']+_0x133266,')');}};Dialer[_0x93a5('0xb0')][_0x93a5('0x1e0')]=function(_0x1ba5f7){var _0x46ce30=this;return function(_0x471c3c){return new BPromise(function(_0x157d41,_0x8868af){_[_0x93a5('0xd2')](_0x1ba5f7,_0x471c3c[0x0]);if(checkGetDataPredictive(_0x471c3c[0x0])){var _0x4d1ff5=_0x1ba5f7['predictiveIntervalAvailable']=_0x1ba5f7[_0x93a5('0x57')]+_0x1ba5f7[_0x93a5('0x51')];var _0x1c8149=_0x1ba5f7[_0x93a5('0x1de')]*0x3c;var _0x2a7029=_0x471c3c[0x0][_0x93a5('0x6d')]+_0x471c3c[0x0][_0x93a5('0x6c')];var _0x296361=(_0x471c3c[0x0][_0x93a5('0x85')]+_0x471c3c[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x471c3c[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x471c3c[0x0][_0x93a5('0x83')];_0x1ba5f7[_0x93a5('0x72')]=_0x296361>0x0?_0x296361:0x1;switch(_0x1ba5f7['dialPredictiveOptimization']){case _0x93a5('0x1da'):var _0x81341e=_0x1ba5f7['dialPredictiveOptimizationPercentage']/0x64;return _0x46ce30[_0x93a5('0x1e7')](_0x4d1ff5,_0x1c8149,_0x2a7029,_0x296361,_0x81341e)[_0x93a5('0x40')](function(_0x49464a){return _0x157d41(_0x49464a);});case _0x93a5('0x1e8'):var _0x77acd8=_0x1ba5f7[_0x93a5('0x1e9')]/0x64;return _0x46ce30['busyFactor'](_0x4d1ff5,_0x1c8149,_0x2a7029,_0x296361,_0x77acd8)[_0x93a5('0x40')](function(_0xe93219){return _0x157d41(_0xe93219);});default:return _0x8868af(msgResponse(_0x93a5('0x1ea'),_0x93a5('0x144'),_0x93a5('0x1eb')));}}else{return _0x8868af(msgResponse(_0x93a5('0x1ea'),'Failure',_0x93a5('0x1ec')));}});};};Dialer[_0x93a5('0xb0')][_0x93a5('0x1ed')]=function(_0x3e4dfb){var _0x85f81a=this;return function(_0xbf1263){return new BPromise(function(_0x3fe35c,_0x1aa0ca){_['merge'](_0x3e4dfb,_0xbf1263[0x0]);if(checkGetDataPredictive(_0xbf1263[0x0])){loggerPredictive['info'](JSON[_0x93a5('0x4d')](_0xbf1263[0x0]));if(_0x3e4dfb[_0x93a5('0x1d9')]===_0x93a5('0x1da')){return _0x85f81a[_0x93a5('0xc7')](_0x3e4dfb['id'])['then'](function(_0x5b11f7){var _0x565e88=_0x3e4dfb[_0x93a5('0x52')]-_0x5b11f7[0x0][_0x93a5('0x1ee')];var _0x231ea1=_0x3e4dfb[_0x93a5('0x1de')]*0x3c;var _0x142b69=_0xbf1263[0x0]['predictiveIntervalAvgTalktime']+_0xbf1263[0x0]['predictiveIntervalAvgHoldtime'];var _0x18cb86=(_0xbf1263[0x0][_0x93a5('0x85')]+_0xbf1263[0x0]['predictiveIntervalDroppedCallsTimeout']+_0xbf1263[0x0][_0x93a5('0x6e')])/_0xbf1263[0x0]['predictiveIntervalTotalCalls'];var _0x5c49b7=_0x3e4dfb['dialPredictiveOptimizationPercentage']/0x64;_0x3e4dfb[_0x93a5('0x74')]=_0x5b11f7[0x0][_0x93a5('0x1ee')]||0x0;_0x3e4dfb[_0x93a5('0x72')]=_0x18cb86>0x0?_0x18cb86:0x1;return _0x85f81a[_0x93a5('0x1e7')](_0x565e88,_0x231ea1,_0x142b69,_0x18cb86,_0x5c49b7);})[_0x93a5('0x40')](function(_0x71d4fa){return _0x3fe35c(_0x71d4fa);})[_0x93a5('0xb5')](function(_0x4a1e40){return _0x1aa0ca(msgResponse(_0x93a5('0x1ef'),_0x93a5('0x144'),JSON[_0x93a5('0x4d')](_0x4a1e40)));});}if(_0x3e4dfb[_0x93a5('0x1d9')]===_0x93a5('0x1e8')){return _0x85f81a['getVoiceQueueRtPauses'](_0x3e4dfb['id'])['then'](function(_0x33965e){var _0x1d6aae=_0x3e4dfb[_0x93a5('0x52')]-_0x33965e[0x0][_0x93a5('0x1ee')];var _0x268f27=_0x3e4dfb[_0x93a5('0x1de')]*0x3c;var _0x2b8d99=_0xbf1263[0x0][_0x93a5('0x6d')]+_0xbf1263[0x0][_0x93a5('0x6c')];var _0x4daade=(_0xbf1263[0x0]['predictiveIntervalAnsweredCalls']+_0xbf1263[0x0][_0x93a5('0x6f')]+_0xbf1263[0x0][_0x93a5('0x6e')])/_0xbf1263[0x0][_0x93a5('0x83')];var _0x13d87c=_0x3e4dfb[_0x93a5('0x1e9')]/0x64;_0x3e4dfb[_0x93a5('0x74')]=_0x33965e[0x0][_0x93a5('0x1ee')]||0x0;_0x3e4dfb['predictiveIntervalHitRate']=_0x4daade>0x0?_0x4daade:0x1;return _0x85f81a['busyFactor'](_0x1d6aae,_0x268f27,_0x2b8d99,_0x4daade,_0x13d87c);})[_0x93a5('0x40')](function(_0x2245c3){return _0x3fe35c(_0x2245c3);})[_0x93a5('0xb5')](function(_0x3825cf){return _0x1aa0ca(msgResponse(_0x93a5('0x1ef'),_0x93a5('0x144'),JSON[_0x93a5('0x4d')](_0x3825cf)));});}}else{return _0x1aa0ca(msgResponse(_0x93a5('0x1ea'),_0x93a5('0x144'),_0x93a5('0x1ec')));}});};};Dialer[_0x93a5('0xb0')][_0x93a5('0x1e1')]=function(_0x41ce1b){var _0x329b95=this;return function(){var _0x491b97=0x0;var _0x5ef699=Math[_0x93a5('0x1d4')](_0x41ce1b['erlangCallToSecond']*0x3e8);if(_0x5ef699>0x0){_0x5ef699=_0x5ef699<0x64?0x64:_0x5ef699;loggerPredictive[_0x93a5('0x80')](_0x41ce1b[_0x93a5('0x43')],_0x93a5('0x1f0'),_0x5ef699,_0x93a5('0x4e'));_0x41ce1b[_0x93a5('0x94')]=setInterval(function(){_0x329b95[_0x93a5('0x94')](_0x41ce1b);loggerPredictiveCalls['info']('[handlePredictive]',_0x491b97+=0x1);},_0x5ef699);}else{loggerPredictive[_0x93a5('0x80')](_0x41ce1b[_0x93a5('0x43')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x93a5('0xb0')][_0x93a5('0x1f1')]=function(_0x766d2d,_0x51ae20){var _0x2d2ee4=this;return function(_0x4cf691){if(_[_0x93a5('0x4b')](_0x4cf691)){if(_[_0x93a5('0xdd')](_0x51ae20[_0x93a5('0xd5')])||!_0x51ae20[_0x93a5('0x1f2')]){if(_0x766d2d[_0x93a5('0x5d')]===_0x93a5('0x9')){_0x766d2d[_0x93a5('0x12b')]=_['isUndefined'](_0x766d2d[_0x93a5('0x12b')])?!![]:_0x766d2d[_0x93a5('0x12b')];var _0x19264e=uuid['v4']();_0x2d2ee4[_0x93a5('0x24')][_0x19264e]=new Action(_0x766d2d,_0x51ae20,_0x19264e);loggerBooked[_0x93a5('0x80')](_0x93a5('0x1f3'),_0x19264e,_0x93a5('0x1f4'),JSON[_0x93a5('0x4d')](_0x766d2d[_0x93a5('0x12b')]),_0x93a5('0x1f5'),_0x766d2d['name']);if(_0x766d2d[_0x93a5('0x12b')]){_0x766d2d['queueStatusComplete']=![];_0x2d2ee4[_0x93a5('0x2b')][_0x2d2ee4['actions'][_0x19264e][_0x93a5('0xb7')]]=[];ami[_0x93a5('0xb2')]({'actionid':_0x19264e,'action':_0x93a5('0x1f6'),'queue':_0x766d2d[_0x93a5('0x43')]})[_0x93a5('0xb5')](function(){_0x2d2ee4[_0x93a5('0xb6')](_0x766d2d);_0x2d2ee4[_0x93a5('0xbf')]({'active':![],'ContactId':_0x2d2ee4[_0x93a5('0x24')][_0x19264e][_0x93a5('0xd4')],'ListId':_0x2d2ee4['actions'][_0x19264e][_0x93a5('0xfa')],'VoiceQueueId':_0x2d2ee4[_0x93a5('0x24')][_0x19264e][_0x93a5('0xd6')]||undefined,'CampaignId':_0x2d2ee4[_0x93a5('0x24')][_0x19264e][_0x93a5('0xd7')]||undefined})['catch'](loggerCatch(_0x93a5('0x1f7')));delete _0x2d2ee4[_0x93a5('0x24')][_0x19264e];});}else{loggerBooked[_0x93a5('0x80')]('[booked][checkContactBlack][else]',JSON[_0x93a5('0x4d')](_0x766d2d['queueStatusComplete']),_0x93a5('0x1f5'),_0x766d2d[_0x93a5('0x43')]);_0x2d2ee4[_0x93a5('0xb6')](_0x766d2d);_0x2d2ee4[_0x93a5('0xbf')]({'active':![],'ContactId':_0x2d2ee4['actions'][_0x19264e][_0x93a5('0xd4')],'ListId':_0x2d2ee4['actions'][_0x19264e][_0x93a5('0xfa')],'VoiceQueueId':_0x2d2ee4[_0x93a5('0x24')][_0x19264e]['VoiceQueueId']||undefined,'CampaignId':_0x2d2ee4[_0x93a5('0x24')][_0x19264e]['CampaignId']||undefined})[_0x93a5('0xb5')](loggerCatch(_0x93a5('0x1f7')));delete _0x2d2ee4[_0x93a5('0x24')][_0x19264e];}}else{return _0x2d2ee4[_0x93a5('0x16c')](_0x766d2d,_0x51ae20);}}else{if(getDiff(_0x51ae20[_0x93a5('0x1f8')])<_0x766d2d[_0x93a5('0x1f9')]*0x3c){if(_0x51ae20[_0x93a5('0x1fa')]&&!_0x51ae20[_0x93a5('0x1fa')][_0x93a5('0x1fb')]){_0x2d2ee4[_0x93a5('0x1d')][_0x93a5('0x12d')](_0x51ae20['id'])[_0x93a5('0x1b')](function(){_0x2d2ee4['updateOriginated'](_0x766d2d);});}else{_0x2d2ee4[_0x93a5('0xc1')]({'active':![]},_0x51ae20['id'],0x1)[_0x93a5('0x1b')](function(){_0x2d2ee4[_0x93a5('0xb6')](_0x766d2d);});}}else{_0x766d2d[_0x93a5('0x69')]+=0x1;_0x2d2ee4[_0x93a5('0xb6')](_0x766d2d);if(_0x766d2d['dialRecallInQueue']){_0x2d2ee4[_0x93a5('0xbf')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x51ae20[_0x93a5('0xd4')],'ListId':_0x51ae20[_0x93a5('0xfa')],'VoiceQueueId':_0x51ae20[_0x93a5('0xd6')]||undefined,'CampaignId':_0x51ae20[_0x93a5('0xd7')]||undefined})['catch'](loggerCatch(_0x93a5('0x1fc')));_0x2d2ee4[_0x93a5('0xcb')](createObjHistory(_0x766d2d,_0x51ae20,_0x93a5('0x1fd'),0x17,_0x93a5('0x1fe')))['catch'](loggerCatch(_0x93a5('0x1ff')));}else{_0x2d2ee4[_0x93a5('0xd1')](createObjHistory(_0x766d2d,_0x51ae20,_0x93a5('0x200'),0x16,_0x93a5('0x201')),_0x93a5('0x202'),_0x93a5('0x203'));}}}}else{_0x766d2d[_0x93a5('0x62')]+=0x1;_0x2d2ee4[_0x93a5('0xd1')](createObjHistory(_0x766d2d,_0x51ae20,_0x93a5('0x204'),0xd,_0x93a5('0x205')),_0x93a5('0x206'),_0x93a5('0x207'));throw _0x93a5('0x208');}};};Dialer[_0x93a5('0xb0')][_0x93a5('0x162')]=function(_0x2bd292){var _0x5b05d5=this;var _0x444750=_0x2bd292[_0x93a5('0x209')]-_0x2bd292['originated']-_0x2bd292[_0x93a5('0xc4')];emitCampaignSummary(_0x2bd292);if(_0x444750>0x0){if(_0x444750>this[_0x93a5('0x22')]){_0x444750=this[_0x93a5('0x22')];}_0x2bd292['temp']+=_0x444750;this[_0x93a5('0xc5')](_0x2bd292['id'],_0x444750,_0x2bd292[_0x93a5('0x20a')],_0x2bd292)[_0x93a5('0x40')](function(_0x4154d8){_0x2bd292[_0x93a5('0xc4')]-=_0x444750;_0x2bd292[_0x93a5('0xc4')]=_0x2bd292['temp']>0x0?_0x2bd292['temp']:0x0;if(!checkContactEmpty(_0x4154d8)){_0x2bd292[_0x93a5('0x41')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x93a5('0x80')](_0x93a5('0x20b')+_0x2bd292[_0x93a5('0x43')]);}else{_0x2bd292[_0x93a5('0x9d')]+=_0x4154d8[_0x93a5('0x9c')];_0x2bd292['message']=_0x93a5('0x20c');for(var _0x1787f9=0x0;_0x1787f9<_0x4154d8['length'];_0x1787f9+=0x1){_0x2bd292[_0x93a5('0x20d')]+=0x1;if(_[_0x93a5('0xdd')](_0x4154d8[_0x1787f9])||_[_0x93a5('0xdd')](_0x4154d8[_0x1787f9][_0x93a5('0x16f')])||_[_0x93a5('0xdd')](_0x4154d8[_0x1787f9][_0x93a5('0x16f')][_0x93a5('0x170')])){_0x5b05d5['emptyContact']('[actionOriginate]\x20',_0x2bd292,_0x4154d8[_0x1787f9]);}else{_0x5b05d5[_0x93a5('0xbc')](_[_0x93a5('0xd3')](_0x4154d8[_0x1787f9],[_0x93a5('0xd7'),'Contact.phone']))[_0x93a5('0x40')](_0x5b05d5[_0x93a5('0x1f1')](_0x2bd292,_0x4154d8[_0x1787f9]))[_0x93a5('0xb5')](_0x5b05d5[_0x93a5('0xcf')](_0x93a5('0x20e'),_0x2bd292));}}}})[_0x93a5('0xb5')](loggerGetContactDialer(_0x93a5('0x20f'),_0x2bd292,_0x444750));}};Dialer[_0x93a5('0xb0')][_0x93a5('0x15b')]=function(_0x48f08c,_0x997317){var _0xa4b580=this;var _0x5246fa=[];var _0x343331=_0x997317>=0x1?_0x997317:0x1;if(_0x48f08c[_0x93a5('0x5d')]===_0x93a5('0x9')){_0x343331=0x1;}var _0x5f1b53=Math['floor'](_0x48f08c['available']*_0x343331)-_0x48f08c['originated']-_0x48f08c[_0x93a5('0xc4')];emitVoiceQueueSummary(_0x48f08c);if(_0x48f08c['dialLimitQueue']>0x0){var _0x1ec41c=_0x48f08c[_0x93a5('0x210')]-_0x48f08c['originated']-_0x48f08c[_0x93a5('0x57')]-_0x48f08c[_0x93a5('0xc4')]-_0x48f08c['pTalking'];if(_0x5f1b53>_0x1ec41c){_0x5f1b53=_0x1ec41c;}}if(_0x5f1b53>0x0){if(_0x48f08c[_0x93a5('0x5d')]===_0x93a5('0x9')){_0x5f1b53=0x1;}if(_0x5f1b53>this[_0x93a5('0x22')]){_0x5f1b53=this[_0x93a5('0x22')];}_0x48f08c[_0x93a5('0xc4')]+=_0x5f1b53;for(var _0x12c080 in this['agents']){if(typeof this[_0x93a5('0x20')][_0x12c080]!==_0x93a5('0x9e')){if(this['agents'][_0x12c080][_0x93a5('0xad')]===_0x93a5('0x211')&&this[_0x93a5('0x20')][_0x12c080][_0x93a5('0xb3')]==='reachable'){_0x5246fa[_0x93a5('0x129')](this[_0x93a5('0x20')][_0x12c080]['id']);}}}this[_0x93a5('0xc3')](_0x48f08c['id'],_0x5246fa,_0x5f1b53,_0x48f08c[_0x93a5('0x20a')],_0x48f08c)['then'](function(_0x166dca){_0x48f08c[_0x93a5('0xc4')]-=_0x5f1b53;_0x48f08c[_0x93a5('0xc4')]=_0x48f08c[_0x93a5('0xc4')]>0x0?_0x48f08c[_0x93a5('0xc4')]:0x0;if(!checkContactEmpty(_0x166dca)){_0xa4b580[_0x93a5('0xb8')](_0x48f08c)['then'](sendMessageReschedule(_0x48f08c))[_0x93a5('0xb5')](loggerCatch(_0x93a5('0xb9')));}else{_0x48f08c[_0x93a5('0x9d')]+=_0x166dca[_0x93a5('0x9c')];_0x48f08c[_0x93a5('0x41')]=_0x48f08c[_0x93a5('0x5d')]===_0x93a5('0x9')?_0x93a5('0x177'):'RUNNING';for(var _0x2238f3=0x0;_0x2238f3<_0x166dca[_0x93a5('0x9c')];_0x2238f3+=0x1){if(_[_0x93a5('0xdd')](_0x166dca[_0x2238f3])||_[_0x93a5('0xdd')](_0x166dca[_0x2238f3][_0x93a5('0x16f')])||_['isNil'](_0x166dca[_0x2238f3]['Contact'][_0x93a5('0x170')])){_0xa4b580['emptyContact'](_0x93a5('0x212'),_0x48f08c,_0x166dca[_0x2238f3]);}else{_0xa4b580[_0x93a5('0x213')](_[_0x93a5('0xd3')](_0x166dca[_0x2238f3],['VoiceQueueId','Contact.phone']))[_0x93a5('0x40')](_0xa4b580[_0x93a5('0x1f1')](_0x48f08c,_0x166dca[_0x2238f3]))[_0x93a5('0xb5')](_0xa4b580[_0x93a5('0xcf')]('[actionOriginate]\x20',_0x48f08c));}}}})[_0x93a5('0xb5')](loggerGetContactDialer('[getContactDialer2]',_0x48f08c,_0x5f1b53));}};Dialer[_0x93a5('0xb0')][_0x93a5('0x94')]=function(_0x1cb056){if(_0x1cb056[_0x93a5('0x210')]>0x0){var _0x1dda43=_0x1cb056[_0x93a5('0x210')]-_0x1cb056[_0x93a5('0x9d')]-_0x1cb056[_0x93a5('0x57')];if(_0x1dda43>0x0){this['tryOriginatePredictive'](_0x1cb056);}else{loggerPredictiveCalls[_0x93a5('0x80')](_0x93a5('0x214'));}}else{this[_0x93a5('0x215')](_0x1cb056);}};Dialer[_0x93a5('0xb0')][_0x93a5('0x215')]=function(_0x363806){var _0x1f60fd=this;var _0xdafc17=[];_0x363806['originated']+=0x1;for(var _0x196b0f in this[_0x93a5('0x20')]){if(typeof this[_0x93a5('0x20')][_0x196b0f]!==_0x93a5('0x9e')){if(this[_0x93a5('0x20')][_0x196b0f][_0x93a5('0xad')]===_0x93a5('0x211')&&this[_0x93a5('0x20')][_0x196b0f][_0x93a5('0xb3')]===_0x93a5('0xdb')){_0xdafc17[_0x93a5('0x129')](this[_0x93a5('0x20')][_0x196b0f]['id']);}}}this[_0x93a5('0xc3')](_0x363806['id'],_0xdafc17,0x1,_0x363806[_0x93a5('0x20a')],_0x363806)[_0x93a5('0x40')](function(_0x5468f9){if(!checkContactEmpty(_0x5468f9)){checkContactLowerLimitOriginate(_0x363806,0x1,0x0);_0x1f60fd['countReScheduled'](_0x363806)[_0x93a5('0x40')](sendMessageReschedule(_0x363806))[_0x93a5('0xb5')](loggerCatch(_0x93a5('0xb9')));}else{_0x363806['message']=_0x93a5('0x20c');if(_[_0x93a5('0xdd')](_0x5468f9[0x0])||_[_0x93a5('0xdd')](_0x5468f9[0x0][_0x93a5('0x16f')])||_[_0x93a5('0xdd')](_0x5468f9[0x0][_0x93a5('0x16f')][_0x93a5('0x170')])){_0x1f60fd['emptyContact'](_0x93a5('0x212'),_0x363806,_0x5468f9[0x0]);}else{_0x1f60fd[_0x93a5('0x213')](_['pick'](_0x5468f9[0x0],[_0x93a5('0xd6'),_0x93a5('0x216')]))['then'](_0x1f60fd[_0x93a5('0x1f1')](_0x363806,_0x5468f9[0x0]))[_0x93a5('0xb5')](_0x1f60fd[_0x93a5('0xcf')](_0x93a5('0x217'),_0x363806));}}})[_0x93a5('0xb5')](loggerGetContactDialer(_0x93a5('0x218'),_0x363806,0x1));emitVoiceQueueSummary(_0x363806);};Dialer[_0x93a5('0xb0')][_0x93a5('0x1e7')]=function(_0x505c02,_0x2266b9,_0x3d1cd1,_0x3d9b75,_0xd7efc6,_0x567171){loggerPredictive[_0x93a5('0x80')](_0x93a5('0x219'));loggerPredictive[_0x93a5('0x80')]('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',_0x505c02);loggerPredictive[_0x93a5('0x80')](_0x93a5('0x21a'),_0x2266b9);loggerPredictive['info']('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3d1cd1);loggerPredictive[_0x93a5('0x80')](_0x93a5('0x21b'),_0x3d9b75);loggerPredictive[_0x93a5('0x80')](_0x93a5('0x21c'),_0xd7efc6);loggerPredictive[_0x93a5('0x80')]('---------------------------');return new BPromise(function(_0x28d19d,_0x3381f8){if(_0x505c02<=0x0||isNaN(_0x505c02)){return _0x3381f8(msgResponse(_0x93a5('0x21d'),_0x93a5('0x4c'),_0x93a5('0x21e')+_0x505c02));}if(_0x3d1cd1<=0x0||isNaN(_0x3d1cd1)){return _0x3381f8(msgResponse(_0x93a5('0x21d'),_0x93a5('0x4c'),_0x93a5('0x21f')+_0x3d1cd1));}if(_0x3d9b75<=0x0||isNaN(_0x3d9b75)){return _0x3381f8(msgResponse(_0x93a5('0x21d'),_0x93a5('0x4c'),'p\x20=\x20'+_0x3d9b75));}if(_0x2266b9<=0x0||isNaN(_0x2266b9)){return _0x3381f8(msgResponse(_0x93a5('0x21d'),_0x93a5('0x4c'),_0x93a5('0x220')+_0x2266b9));}if(_0xd7efc6<=0x0||isNaN(_0xd7efc6)){return _0x3381f8(msgResponse(_0x93a5('0x21d'),_0x93a5('0x4c'),_0x93a5('0x221')+_0xd7efc6));}_0x567171=_0x567171||0x0;var _0x580afd=0x1/_0x3d1cd1;var _0x4324e9=0x0;var _0xac4ed=0x0;var _0xa7a2a8=0x0;var _0x25e28a=0x0;for(var _0x11a4ab=0x0;_0xa7a2a8<_0xd7efc6;_0x11a4ab+=0x1){_0xac4ed=_0x11a4ab/_0x2266b9;_0x4324e9=(_0x3d9b75*_0xac4ed+_0x567171)/_0x580afd;_0xa7a2a8=erlangb(_0x4324e9,_0x505c02);_0x25e28a=_0x4324e9/_0x505c02*(0x1-erlangb(_0x4324e9,_0x505c02));}return _0x28d19d({'erlangCalls':_0x11a4ab,'erlangCallToSecond':_0x2266b9/_0x11a4ab,'erlangAbandonmentRate':_0xa7a2a8,'erlangBusyFactor':_0x25e28a});});};Dialer[_0x93a5('0xb0')][_0x93a5('0x222')]=function(_0x3d8bcb,_0x1e1ad6,_0x2fd935,_0x1b2379,_0x599a3a,_0x39877f){loggerPredictive['info'](_0x93a5('0x223'));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',_0x3d8bcb);loggerPredictive['info'](_0x93a5('0x21a'),_0x1e1ad6);loggerPredictive[_0x93a5('0x80')]('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',_0x2fd935);loggerPredictive['info'](_0x93a5('0x21b'),_0x1b2379);loggerPredictive[_0x93a5('0x80')](_0x93a5('0x224'),_0x599a3a);loggerPredictive[_0x93a5('0x80')](_0x93a5('0x89'));return new BPromise(function(_0x457509,_0x17840){if(_0x3d8bcb<=0x0||isNaN(_0x3d8bcb)){return _0x17840(msgResponse(_0x93a5('0x225'),_0x93a5('0x4c'),_0x93a5('0x21e')+_0x3d8bcb));}if(_0x2fd935<=0x0||isNaN(_0x2fd935)){return _0x17840(msgResponse(_0x93a5('0x225'),_0x93a5('0x4c'),_0x93a5('0x21f')+_0x2fd935));}if(_0x1b2379<=0x0||isNaN(_0x1b2379)){return _0x17840(msgResponse(_0x93a5('0x225'),_0x93a5('0x4c'),_0x93a5('0x226')+_0x1b2379));}if(_0x1e1ad6<=0x0||isNaN(_0x1e1ad6)){return _0x17840(msgResponse('[busyFactor]',_0x93a5('0x4c'),_0x93a5('0x220')+_0x1e1ad6));}if(_0x599a3a<=0x0||isNaN(_0x599a3a)){return _0x17840(msgResponse('[busyFactor]',_0x93a5('0x4c'),_0x93a5('0x227')+_0x599a3a));}_0x39877f=_0x39877f||0x0;var _0x45936d=0x1/_0x2fd935;var _0x3eb27c=0x0;var _0xe8d1f2=0x0;var _0x43c2da=0x0;var _0x499386=0x0;for(var _0x2eb796=0x0;_0x499386<_0x599a3a;_0x2eb796+=0x1){_0xe8d1f2=_0x2eb796/_0x1e1ad6;_0x3eb27c=(_0x1b2379*_0xe8d1f2+_0x39877f)/_0x45936d;_0x43c2da=erlangb(_0x3eb27c,_0x3d8bcb);_0x499386=_0x3eb27c/_0x3d8bcb*(0x1-erlangb(_0x3eb27c,_0x3d8bcb));}return _0x457509({'erlangCalls':_0x2eb796,'erlangCallToSecond':_0x1e1ad6/_0x2eb796,'erlangAbandonmentRate':_0x43c2da,'erlangBusyFactor':_0x499386});});};module[_0x93a5('0x228')]=Dialer;
\ No newline at end of file
+var _0x6527=['dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-VOICEQUEUEID','tags','createdAt','updatedAt','XMD-','callerid','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdName','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originate][error]','originate\x20action\x20Error','syncOriginateResponse','getQueue','response','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','[callProgressDetecting]','entity\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','dialBusyMaxRetry','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','reason\x2020\x20agentreject','outboundUnknownCallsDay','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','outboundDropCallsDayTimeout','round','predictiveIntervalMaxThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','averageHandleTime','getDataPredictive','startMethodPredictive',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','outboundQueuePauses','abandonmentRate','[CatchErlangB]','[handlePredictive]','fail\x20to\x20scheduled\x20calls','recallme','booked','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','actionOriginate','scheduledat','dialRecallMeTimeout','voicePause','preview','unlockContact','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','checkContactBlack','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','reachable','ACTIVE','loggerHandler','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','interval\x20=\x20','Amax\x20=\x20','busyFactor','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','[busyFactor]','m\x20=\x20','p\x20=\x20','Umin\x20=\x20','exports','util','bluebird','moment','md5','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/setting','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','XCALLY_IP_AGI','127.0.0.1','rrmemory','prototype','enqueue','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','optionPredictive','startProgressive','queueBookedRR','syncAgentConnect','bind','originateresponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncHangup','newexten','syncNewExten','varset','syncVarSet','syncQueueStatusComplete','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','\x20NOT\x20Active','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Interval','Intervals','Error','milliseconds','diff','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','total','waiting','loggedInDb','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','stringify','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','isEmpty','info','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','error','stack','length','inspect','contactsRescheduled','RESCHEDULED_CONTACTS','AVAILABLE_CONTACTS_FINISHED','talking','sendMessageOneNotActive','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','uniqueId','clearZombieChannels','[actions]','undefined','isNil','Action','status','catch','No\x20such\x20channel','updateOriginated','[Dialer][checkChannel]','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','avgHandleTime','[rescheduleContact]\x20','[unlockContact]\x20','getContactDialer','temp','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','saveInDb','merge','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','isSuccess','Success','SIP/%s','unmonitored','uniqueid','variable','amdstatus','xcally-motion-dialer','value','HANGUP','HangupInAMD','membername','AMD','custom:amd','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','dialAMDActive','MACHINE','Machine','countmachineretry','buildObj','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countglobal','stateGlobal','reason19\x20machine....','rescheduleContact','add','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','Unknow','reason','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','Drop','dropreason','dialQueueProject2','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','Abandoned','[syncAgentComplete][createHistory][11]','channel','syncQueueMember','actionid','roundrobin','locked','paused','stateinterface','queueBooked','push','idHopper','queueStatusComplete','run','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','loopCampaigns','syncCampaigns','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','command','iftime\x20%s,%s','interval','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','checkDialMethod','power','handlePower','dialPowerLevel','Queue','method\x20not\x20recognized','checkPreviewRecallReminder','handlePreviewRecallNotifications','Agent','user:%s','user:dialPreviewRecallReminder','launchHandleIvr','dialMethod','dialActive','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','object','Contact','phone','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE'];(function(_0x179e26,_0x7c7b9d){var _0x587a02=function(_0x4f862f){while(--_0x4f862f){_0x179e26['push'](_0x179e26['shift']());}};_0x587a02(++_0x7c7b9d);}(_0x6527,0xa4));var _0x7652=function(_0x4baf03,_0x497fbf){_0x4baf03=_0x4baf03-0x0;var _0x1dcd9f=_0x6527[_0x4baf03];return _0x1dcd9f;};'use strict';var util=require(_0x7652('0x0'));var _=require('lodash');var BPromise=require(_0x7652('0x1'));var uuid=require('uuid');var moment=require(_0x7652('0x2'));var rr=require('rr');var md5=require(_0x7652('0x3'));var Redis=require('ioredis');var ut=require(_0x7652('0x4'));var config=require(_0x7652('0x5'));var logger=require(_0x7652('0x6'))(_0x7652('0x7'));var loggerBooked=require(_0x7652('0x6'))('booked');var loggerPredictive=require('../../../config/logger')(_0x7652('0x8'));var loggerPredictiveCalls=require(_0x7652('0x6'))(_0x7652('0x9'));var loggerSyncQueueSummary=require('../../../config/logger')(_0x7652('0xa'));var ami=require(_0x7652('0xb'));config[_0x7652('0xc')]=_[_0x7652('0xd')](config[_0x7652('0xc')],{'host':_0x7652('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var cmHopper=require(_0x7652('0xf'));var cmHopperHistory=require(_0x7652('0x10'));var cmHopperBlack=require(_0x7652('0x11'));var voiceQueueRt=require(_0x7652('0x12'));var RpcSetting=require(_0x7652('0x13'));var Action=require(_0x7652('0x14'));var History=require(_0x7652('0x15'));var Final=require(_0x7652('0x16'));var AgentComplete=require(_0x7652('0x17'));var QueueCallerAbandon=require(_0x7652('0x18'));var Hangup=require(_0x7652('0x19'));var ipAgi=process['env'][_0x7652('0x1a')]||_0x7652('0x1b');var strategy={'rrmemory':_0x7652('0x1c'),'roundrobin':'roundrobin'};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x7652('0x1d')][_0x7652('0x1e')]=function(_0xe29584){this[_0x7652('0x1f')]=this[_0x7652('0x1f')]?this['tail'][_0x7652('0x20')](_0xe29584):_0xe29584();};function Dialer(_0x530820,_0x4f9c16){this[_0x7652('0x21')]=new Sequence();this['preview']=_0x4f9c16;this[_0x7652('0x22')]=_0x530820[_0x7652('0x22')];this[_0x7652('0x23')]=_0x530820[_0x7652('0x23')];this['agents']=_0x530820[_0x7652('0x24')];this[_0x7652('0x25')]=_0x530820[_0x7652('0x25')];this[_0x7652('0x26')]=config[_0x7652('0x26')]||0x2;this[_0x7652('0x27')]={};this[_0x7652('0x28')]={};this[_0x7652('0x29')]={};this['uniqueId']={};this[_0x7652('0x2a')]={};this['startPredictive']={};this[_0x7652('0x2b')]={};this['ivrOriginated']={};this['queueBooked']={};this[_0x7652('0x2c')]={};ami['on']('agentconnect',this[_0x7652('0x2d')]['bind'](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon'][_0x7652('0x2e')](this));ami['on'](_0x7652('0x2f'),this['syncOriginateResponse'][_0x7652('0x2e')](this));ami['on'](_0x7652('0x30'),this[_0x7652('0x31')][_0x7652('0x2e')](this));ami['on'](_0x7652('0x32'),this[_0x7652('0xa')][_0x7652('0x2e')](this));ami['on']('hangup',this[_0x7652('0x33')]['bind'](this));ami['on'](_0x7652('0x34'),this[_0x7652('0x35')][_0x7652('0x2e')](this));ami['on'](_0x7652('0x36'),this[_0x7652('0x37')][_0x7652('0x2e')](this));ami['on']('queuemember',this['syncQueueMember'][_0x7652('0x2e')](this));ami['on']('queuestatuscomplete',this[_0x7652('0x38')][_0x7652('0x2e')](this));this['loopCampaigns']();this[_0x7652('0x39')]();RpcSetting[_0x7652('0x3a')]()[_0x7652('0x3b')](function(_0x50f265){previewRecallmeReminderInterval=_0x50f265[_0x7652('0x3c')];});}function isNotNull(_0x2bc8cf){return _0x2bc8cf!==null&&!_[_0x7652('0x3d')](_0x2bc8cf);}function checkIsLoggedIn(_0x2898ff,_0x10ad3a){return function(){if(_0x10ad3a<=0x0){_0x2898ff[_0x7652('0x3e')]=_0x7652('0x3f');throw _0x2898ff[_0x7652('0x40')]+_0x7652('0x41');}};}function isActive(_0xc91972){return _0xc91972;}function checkIsActive(_0x1667bb,_0x21c353){return function(){if(!isActive(_0x21c353)){_0x1667bb['message']='NOT_ACTIVE';throw _0x1667bb['name']+_0x7652('0x42');}};}function checkInterval(_0x2c63ea){return function(){if(!isNotNull(_0x2c63ea['Interval'])){_0x2c63ea[_0x7652('0x3e')]=_0x7652('0x43');throw _0x2c63ea['name']+_0x7652('0x44');}if(!isNotNull(_0x2c63ea[_0x7652('0x45')][_0x7652('0x46')])){_0x2c63ea[_0x7652('0x3e')]=_0x7652('0x43');throw _0x2c63ea[_0x7652('0x40')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_['isEmpty'](_0x2c63ea[_0x7652('0x45')][_0x7652('0x46')]))){_0x2c63ea[_0x7652('0x3e')]=_0x7652('0x43');throw _0x2c63ea['name']+_0x7652('0x44');}};}function msgResponse(_0x48ef00,_0x5e9022,_0x10ab2e){return{'action':_0x48ef00,'response':_0x5e9022,'message':_0x10ab2e,'stack':_0x10ab2e};}function myreject(_0x53f44e){return function(_0x31c6fb){return _0x53f44e(msgResponse('[ifTime][Action]',_0x7652('0x47'),JSON['stringify'](_0x31c6fb)));};}function getSeconds(_0x113679,_0x3f0d05){var _0x31f30d=moment(_0x113679)[_0x7652('0x48')](0x0);var _0x3323ef=moment(_0x3f0d05)[_0x7652('0x48')](0x0);return _0x31f30d[_0x7652('0x49')](_0x3323ef,'seconds');}function emit(_0x453546,_0x5efe07,_0x152b9b){io['to'](_0x453546)[_0x7652('0x4a')](_0x5efe07,_0x152b9b);}function emitVoiceQueueSummary(_0x3248b1){if(_0x3248b1[_0x7652('0x4b')]===_0x7652('0x4c')){var _0x3de8fd={'id':_0x3248b1['id'],'name':_0x3248b1[_0x7652('0x40')],'strategy':_0x3248b1[_0x7652('0x4d')],'answered':_0x3248b1[_0x7652('0x4e')],'available':_0x3248b1[_0x7652('0x4f')],'loggedIn':_0x3248b1[_0x7652('0x50')],'pTalking':_0x3248b1[_0x7652('0x51')],'sumBillable':_0x3248b1[_0x7652('0x52')],'sumDuration':_0x3248b1[_0x7652('0x53')],'sumHoldTime':_0x3248b1['sumHoldTime']||0x0,'talking':_0x3248b1['talking'],'total':_0x3248b1[_0x7652('0x54')],'type':_0x3248b1[_0x7652('0x4b')],'unmanaged':_0x3248b1['unmanaged'],'abandoned':_0x3248b1['abandoned'],'waiting':_0x3248b1[_0x7652('0x55')],'loggedInDb':_0x3248b1[_0x7652('0x56')],'dialActive':_0x3248b1['dialActive'],'dialMethod':_0x3248b1['dialMethod'],'dialOriginateCallerIdName':_0x3248b1['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x3248b1[_0x7652('0x57')],'dialOriginateTimeout':_0x3248b1['dialOriginateTimeout'],'dialPrefix':_0x3248b1[_0x7652('0x58')],'outboundAnswerAgiCallsDay':_0x3248b1[_0x7652('0x59')],'outboundAnswerCallsDay':_0x3248b1[_0x7652('0x5a')],'outboundBlacklistCallsDay':_0x3248b1[_0x7652('0x5b')],'outboundBusyCallsDay':_0x3248b1[_0x7652('0x5c')],'outboundCongestionCallsDay':_0x3248b1[_0x7652('0x5d')],'outboundDropCallsDayACS':_0x3248b1[_0x7652('0x5e')],'outboundDropCallsDayCallersExit':_0x3248b1[_0x7652('0x5f')],'outboundDropCallsDayTimeout':_0x3248b1['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x3248b1[_0x7652('0x60')],'outboundNoSuchCallsDay':_0x3248b1[_0x7652('0x61')],'outboundOriginateFailureCallsDay':_0x3248b1['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x3248b1['outboundReCallsDay'],'outboundRejectCallsDay':_0x3248b1[_0x7652('0x62')],'outboundUnknownCallsDay':_0x3248b1['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x3248b1[_0x7652('0x63')],'predictiveIntervalAvgHoldtime':_0x3248b1['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x3248b1[_0x7652('0x64')],'predictiveIntervalDroppedCallsCallersExit':_0x3248b1['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x3248b1[_0x7652('0x65')],'predictiveIntervalErlangCalls':_0x3248b1[_0x7652('0x66')],'predictiveIntervalErlangCallsDroppedCalls':_0x3248b1[_0x7652('0x67')],'predictiveIntervalHitRate':_0x3248b1[_0x7652('0x68')],'predictiveIntervalMultiplicativeFactor':_0x3248b1[_0x7652('0x69')],'predictiveIntervalPauses':_0x3248b1[_0x7652('0x6a')],'predictiveIntervalAvailable':_0x3248b1[_0x7652('0x6b')],'predictiveIntervalTotalCalls':_0x3248b1['predictiveIntervalTotalCalls'],'message':_0x3248b1[_0x7652('0x3e')],'originated':_0x3248b1[_0x7652('0x6c')],'erlangCalls':_0x3248b1[_0x7652('0x6d')],'erlangCallToSecond':_0x3248b1[_0x7652('0x6e')],'erlangAbandonmentRate':_0x3248b1[_0x7652('0x6f')],'erlangBusyFactor':_0x3248b1[_0x7652('0x70')],'startPredictive':_0x3248b1[_0x7652('0x71')],'startProgressive':_0x3248b1[_0x7652('0x2b')]};if(_0x3248b1[_0x7652('0x72')]){_0x3de8fd[_0x7652('0x72')]={'id':_0x3248b1[_0x7652('0x72')]['id'],'name':_0x3248b1[_0x7652('0x72')]['name'],'active':_0x3248b1[_0x7652('0x72')][_0x7652('0x73')],'callerid':_0x3248b1['Trunk']['callerid']};}if(_0x3248b1['Interval']){_0x3de8fd[_0x7652('0x45')]={'id':_0x3248b1[_0x7652('0x45')]['id'],'name':_0x3248b1[_0x7652('0x45')][_0x7652('0x40')]};}var _0x490402=md5(JSON[_0x7652('0x74')](_0x3de8fd));if(_0x3248b1[_0x7652('0x3')]!==_0x490402){_0x3248b1[_0x7652('0x3')]=_0x490402;emit(util[_0x7652('0x75')](_0x7652('0x76'),_0x3de8fd['name']),_0x7652('0x77'),_0x3de8fd);}}}function emitCampaignSummary(_0x3e54f0){if(_0x3e54f0[_0x7652('0x4b')]===_0x7652('0x78')){emit(util['format'](_0x7652('0x79'),_0x3e54f0[_0x7652('0x40')]),_0x7652('0x7a'),_0x3e54f0);}}function checkGetDataPredictive(_0x57be90){if(isNotNull(_0x57be90)&&!_[_0x7652('0x7b')](_0x57be90)){loggerPredictive[_0x7652('0x7c')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x7652('0x7c')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x57be90[_0x7652('0x7d')]);loggerPredictive[_0x7652('0x7c')](_0x7652('0x7e'),_0x57be90['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x7652('0x7c')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x57be90[_0x7652('0x65')]);loggerPredictive[_0x7652('0x7c')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x57be90[_0x7652('0x7f')]);loggerPredictive[_0x7652('0x7c')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x57be90['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x7652('0x7c')](_0x7652('0x80'),_0x57be90[_0x7652('0x64')]);loggerPredictive[_0x7652('0x7c')](_0x7652('0x81'));if(_0x57be90[_0x7652('0x7d')]>0x0){if(!_[_0x7652('0x3d')](_0x57be90['predictiveIntervalAvgTalktime'])&&_0x57be90[_0x7652('0x64')]>0x0){return!![];}loggerPredictive[_0x7652('0x7c')](_0x7652('0x82'));if(!_[_0x7652('0x3d')](_0x57be90[_0x7652('0x83')])&&_0x57be90['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x7652('0x7c')](_0x7652('0x84'));}else{loggerPredictive[_0x7652('0x7c')](_0x7652('0x85'));}}else{loggerPredictive[_0x7652('0x7c')](_0x7652('0x86'));}return![];}function mergeDataErlangB(_0x20decd){return function(_0x518a22){loggerPredictive[_0x7652('0x7c')]('---------\x20ErlangB\x20---------');loggerPredictive[_0x7652('0x7c')](_0x7652('0x87'),_0x518a22[_0x7652('0x6d')]);loggerPredictive[_0x7652('0x7c')](_0x7652('0x88'),_0x518a22[_0x7652('0x6e')]);loggerPredictive[_0x7652('0x7c')](_0x7652('0x89'),_0x518a22['erlangAbandonmentRate']);loggerPredictive[_0x7652('0x7c')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x518a22[_0x7652('0x70')]);loggerPredictive[_0x7652('0x7c')](_0x7652('0x89'),_0x518a22[_0x7652('0x6f')]);loggerPredictive[_0x7652('0x7c')](_0x7652('0x81'));_['merge'](_0x20decd,_0x518a22);};}function getDiff(_0x2df8ce){var _0x3b1e21=moment()[_0x7652('0x48')](0x0);var _0x54cd55=moment(_0x2df8ce)[_0x7652('0x48')](0x0);return _0x3b1e21[_0x7652('0x49')](_0x54cd55,'seconds');}function ifInterval(_0x24e33a,_0x4847ee){if(_[_0x7652('0x3d')](_0x4847ee)){return![];}return getDiff(_0x4847ee)<_0x24e33a*0x3c;}function freeVariablesPredictive(_0x4bc0fe){if(isNotNull(_0x4bc0fe)){if(!_[_0x7652('0x3d')](_0x4bc0fe[_0x7652('0x2b')])){_0x4bc0fe['startProgressive']=undefined;loggerPredictive['info'](_0x4bc0fe[_0x7652('0x40')],_0x7652('0x8a'));}if(!_[_0x7652('0x3d')](_0x4bc0fe[_0x7652('0x71')])){_0x4bc0fe['startPredictive']=undefined;loggerPredictive[_0x7652('0x7c')](_0x4bc0fe['name'],_0x7652('0x8b'));}if(!_['isUndefined'](_0x4bc0fe[_0x7652('0x8c')])){clearInterval(_0x4bc0fe[_0x7652('0x8c')]);_0x4bc0fe[_0x7652('0x8c')]=undefined;loggerPredictive['info'](_0x4bc0fe[_0x7652('0x40')],_0x7652('0x8d'));}}}function erlangb(_0x4faf8a,_0x3fa337){if(_0x3fa337===0x0){return 0x0;}var _0x1caed2=0x1;for(var _0x4d1ee6=0x1;_0x4d1ee6<=_0x3fa337;_0x4d1ee6+=0x1){_0x1caed2=0x1+_0x1caed2*_0x4d1ee6/_0x4faf8a;}return 0x1/_0x1caed2;}function isVoiceQueueOutbound(_0x10d4f8){return _0x10d4f8===_0x7652('0x4c');}function isNotPreview(_0x4ae455){return _0x4ae455!=='preview';}function isCampaignIvr(_0x1a9e8f){return _0x1a9e8f===_0x7652('0x78');}function getCallerId(_0x519695,_0x43a2f1,_0x276618){if(!_['isUndefined'](_0x276618)&&typeof _0x276618===_0x7652('0x8e')&&!_[_0x7652('0x7b')](_0x276618)){if(!_[_0x7652('0x3d')](_0x43a2f1)&&typeof _0x43a2f1===_0x7652('0x8e')&&!_[_0x7652('0x7b')](_0x43a2f1)){return util[_0x7652('0x75')](_0x7652('0x8f'),_0x43a2f1,_0x276618);}return util[_0x7652('0x75')](_0x7652('0x8f'),_0x276618,_0x276618);}if(!_[_0x7652('0x3d')](_0x519695)&&typeof _0x519695==='string'&&!_[_0x7652('0x7b')](_0x519695)){return _0x519695;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x2d3ba1,_0x4d5d5f){return function(_0x4ba440){freeVariablesPredictive(_0x4d5d5f);emitVoiceQueueSummary(_0x4d5d5f);emitCampaignSummary(_0x4d5d5f);loggerSyncQueueSummary['error'](_0x2d3ba1,util['inspect'](_0x4ba440,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0xcd84e5,_0x214633){return function(_0x54dd64){loggerPredictive[_0x7652('0x90')](_0x214633[_0x7652('0x40')],_0xcd84e5);loggerPredictive[_0x7652('0x90')](_0x54dd64[_0x7652('0x91')]);freeVariablesPredictive(_0x214633);};}function loggerCatch(_0x43eee1){return function(_0x1d7d33){logger['error'](_0x43eee1,util['inspect'](_0x1d7d33,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x525f51){return _0x525f51&&!_[_0x7652('0x3d')](_0x525f51)&&_0x525f51[_0x7652('0x92')]>0x0;}function decremetOriginate(_0x504449){if(!_[_0x7652('0x3d')](_0x504449)&&_0x504449!==null){if(typeof _0x504449[_0x7652('0x6c')]!=='undefined'){if(_0x504449['originated']>0x0){_0x504449[_0x7652('0x6c')]-=0x1;}else{logger[_0x7652('0x90')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger['error']('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x310f61,_0x28649e,_0x557a4c){if(_0x28649e>_0x557a4c){for(var _0x335b4f=0x0;_0x335b4f<_0x28649e-_0x557a4c;_0x335b4f+=0x1){decremetOriginate(_0x310f61);}}}function loggerGetContactDialer(_0x31a372,_0x35fbf8,_0x393529){return function(_0xea35ac){checkContactLowerLimitOriginate(_0x35fbf8,_0x393529,0x0);logger[_0x7652('0x90')](_0x31a372,util[_0x7652('0x93')](_0xea35ac,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x19da7c){return function(_0x5c2c10){if(isNotNull(_0x5c2c10)&&isNotNull(_0x5c2c10[0x0])){if(_0x5c2c10[0x0][_0x7652('0x94')]>0x0){_0x19da7c[_0x7652('0x3e')]=_0x7652('0x95');logger[_0x7652('0x7c')]('[getContactDialer2][ReScheduled]'+_0x19da7c[_0x7652('0x40')],_0x5c2c10[0x0][_0x7652('0x94')],'contacts');}else{_0x19da7c['message']=_0x7652('0x96');logger[_0x7652('0x7c')]('[getContactDialer2][Empty]'+_0x19da7c[_0x7652('0x40')]);}}};}function notSendMessagesQueue(_0x214d8c){if(_0x214d8c['sendMessageOneNotActive']){freeVariablesPredictive(_0x214d8c);if(_0x214d8c[_0x7652('0x6c')]===0x0&&_0x214d8c[_0x7652('0x97')]===0x0&&_0x214d8c[_0x7652('0x55')]===0x0&&(_0x214d8c['pTalking']||0x0)===0x0){_0x214d8c[_0x7652('0x98')]=![];_0x214d8c[_0x7652('0x4f')]=0x0;_0x214d8c['message']=_0x7652('0x99');loggerSyncQueueSummary['error'](_0x7652('0x9a'),_0x214d8c[_0x7652('0x40')],_0x7652('0x9b'));}else{_0x214d8c['message']=_0x7652('0x9c');loggerSyncQueueSummary['error'](_0x7652('0x9a'),_0x214d8c[_0x7652('0x40')],_0x7652('0x9d'));}emitVoiceQueueSummary(_0x214d8c);}}function notSendMessagesCampaign(_0x283335){if(_0x283335[_0x7652('0x98')]){if(_0x283335['originated']===0x0){_0x283335['sendMessageOneNotActive']=![];_0x283335[_0x7652('0x3e')]=_0x7652('0x99');loggerSyncQueueSummary[_0x7652('0x90')](_0x7652('0x9e'),_0x283335[_0x7652('0x40')],_0x7652('0x9b'));}else{_0x283335[_0x7652('0x3e')]=_0x7652('0x9c');loggerSyncQueueSummary[_0x7652('0x90')](_0x7652('0x9e'),_0x283335[_0x7652('0x40')],'is\x20disactive');}emitCampaignSummary(_0x283335);}}function createObjHistory(_0x481a14,_0x5a135b,_0x41af0e,_0x186532,_0x37b21a){_0x481a14[_0x7652('0x3e')]=_0x41af0e;var _0x32881f=new Action(_0x481a14,_0x5a135b);var _0x4d49b3=new History(_0x32881f);_0x4d49b3[_0x7652('0x9f')]=_0x186532;_0x4d49b3[_0x7652('0xa0')]=_0x37b21a;_0x4d49b3[_0x7652('0xa1')]=_0x32881f[_0x7652('0xa2')];return _0x4d49b3;}Dialer['prototype'][_0x7652('0x39')]=function(){var _0x3b1344=this;setInterval(function(){_0x3b1344['clearZombieChannels'](_0x3b1344[_0x7652('0xa3')],'[uniqueid]');_0x3b1344[_0x7652('0xa4')](_0x3b1344[_0x7652('0x28')],_0x7652('0xa5'));},0x32c8);};Dialer['prototype'][_0x7652('0xa4')]=function(_0x1ca148,_0xb7ff17){var _0xed97f8=this;for(var _0x44f2e4 in _0x1ca148){if(typeof _0x1ca148[_0x44f2e4]!==_0x7652('0xa6')){this['sequence']['enqueue'](function(){if(!_[_0x7652('0xa7')](_0x1ca148[_0x44f2e4])){return ami[_0x7652('0xa8')]({'action':_0x7652('0xa9'),'channel':_0x1ca148[_0x44f2e4]['channel']})[_0x7652('0xaa')](function(_0x152ea3){if(_0x152ea3[_0x7652('0x3e')]===_0x7652('0xab')){setTimeout(function(){if(_0x1ca148[_0x44f2e4]&&_0x1ca148[_0x44f2e4][_0x7652('0x4b')]!==_0x7652('0x78')){_0xed97f8[_0x7652('0xac')](_0xed97f8[_0x7652('0x22')][_0x1ca148[_0x44f2e4]['queue']]);logger[_0x7652('0x90')](_0x7652('0xad'),_0xb7ff17,_0x44f2e4,_0x1ca148[_0x44f2e4][_0x7652('0xae')]);delete _0x1ca148[_0x44f2e4];}if(_0x1ca148[_0x44f2e4]&&_0x1ca148[_0x44f2e4]['type']==='ivr'){_0xed97f8[_0x7652('0xac')](_0xed97f8[_0x7652('0x23')][_0x1ca148[_0x44f2e4][_0x7652('0xae')]]);logger[_0x7652('0x90')](_0x7652('0xaf'),_0xb7ff17,_0x44f2e4,_0x1ca148[_0x44f2e4][_0x7652('0xae')]);delete _0x1ca148[_0x44f2e4];}},0x2328);}});}});}}};Dialer[_0x7652('0x1d')][_0x7652('0xb0')]=function(_0x819d24){return BPromise[_0x7652('0xb1')]()[_0x7652('0x3b')](cmHopper['countReScheduled'](_0x819d24))[_0x7652('0xaa')](loggerCatch(_0x7652('0xb2')));};Dialer[_0x7652('0x1d')][_0x7652('0xb3')]=function(_0x384481){return BPromise['resolve']()[_0x7652('0x3b')](cmHopperBlack['checkIsBlackList'](_0x384481))[_0x7652('0xaa')](loggerCatch(_0x7652('0xb4')));};Dialer[_0x7652('0x1d')][_0x7652('0xb5')]=function(_0x3d733f){return BPromise[_0x7652('0xb1')]()[_0x7652('0x3b')](cmHopperBlack[_0x7652('0xb5')](_0x3d733f))[_0x7652('0xaa')](loggerCatch(_0x7652('0xb6')));};Dialer[_0x7652('0x1d')]['averageHandleTime']=function(_0x3ce465){return BPromise[_0x7652('0xb1')]()[_0x7652('0x3b')](cmHopperHistory[_0x7652('0xb7')](_0x3ce465))[_0x7652('0xaa')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0x7652('0x1d')]['rescheduleContact']=function(_0x58e046){return BPromise['resolve']()[_0x7652('0x3b')](cmHopper['rescheduleContact'](_0x58e046))['catch'](loggerCatch(_0x7652('0xb8')));};Dialer[_0x7652('0x1d')]['unlockContact']=function(_0x565d01,_0x2c2a2c,_0x293d53){return BPromise['resolve']()['then'](cmHopper['unlockContact'](_0x565d01,_0x2c2a2c,_0x293d53))[_0x7652('0xaa')](loggerCatch(_0x7652('0xb9')));};Dialer[_0x7652('0x1d')][_0x7652('0xba')]=function(_0x47bd1c,_0x380818,_0x4541ec,_0x476f9a,_0x23c98f){return BPromise[_0x7652('0xb1')]()['then'](cmHopper[_0x7652('0xba')](_0x47bd1c,_0x380818,_0x4541ec,_0x476f9a))['catch'](function(_0x33c7ce){_0x23c98f[_0x7652('0xbb')]-=_0x4541ec;_0x23c98f['temp']=_0x23c98f[_0x7652('0xbb')]>0x0?_0x23c98f[_0x7652('0xbb')]:0x0;loggerCatch('[getContactDialer]\x20')(_0x33c7ce);});};Dialer[_0x7652('0x1d')][_0x7652('0xbc')]=function(_0x5da53a,_0x2b322c,_0x3312f7,_0x469e41){return BPromise[_0x7652('0xb1')]()[_0x7652('0x3b')](cmHopper['getContactDialerIvr'](_0x5da53a,_0x2b322c,_0x3312f7))[_0x7652('0xaa')](function(_0x363b41){_0x469e41[_0x7652('0xbb')]-=_0x2b322c;_0x469e41[_0x7652('0xbb')]=_0x469e41[_0x7652('0xbb')]>0x0?_0x469e41[_0x7652('0xbb')]:0x0;loggerCatch(_0x7652('0xbd'))(_0x363b41);});};Dialer[_0x7652('0x1d')][_0x7652('0xbe')]=function(_0xd1d0fb){return BPromise['resolve']()[_0x7652('0x3b')](voiceQueueRt[_0x7652('0xbe')](_0xd1d0fb))['catch'](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x7652('0x1d')][_0x7652('0xbf')]=function(_0x4e7cfa){return BPromise[_0x7652('0xb1')]()[_0x7652('0x3b')](cmHopper[_0x7652('0xbf')](_0x4e7cfa))[_0x7652('0xaa')](loggerCatch(_0x7652('0xc0')));};Dialer[_0x7652('0x1d')][_0x7652('0xc1')]=function(_0x18b231){return BPromise['resolve']()[_0x7652('0x3b')](cmHopperHistory[_0x7652('0xc1')](_0x18b231))[_0x7652('0xaa')](loggerCatch('[createHistory]\x20'));};Dialer[_0x7652('0x1d')][_0x7652('0xac')]=function(_0xfc938e){if(!_[_0x7652('0x3d')](_0xfc938e)&&_0xfc938e!==null){if(typeof _0xfc938e[_0x7652('0x6c')]!==_0x7652('0xa6')){if(_0xfc938e['originated']>0x0){_0xfc938e[_0x7652('0x6c')]-=0x1;}else{logger[_0x7652('0x90')](_0x7652('0xc2'));}}}else{logger[_0x7652('0x90')](_0x7652('0xc3'));}};Dialer[_0x7652('0x1d')]['loggerHandler']=function(_0x4d3bc0,_0x31cf79){var _0x11ec70=this;return function(_0x45770e){_0x11ec70[_0x7652('0xac')](_0x31cf79);logger[_0x7652('0x90')](_0x4d3bc0,util['inspect'](_0x45770e,{'showHidden':![],'depth':null}));};};Dialer[_0x7652('0x1d')][_0x7652('0xc4')]=function(_0xbf468f,_0x5bbd6a,_0x3436f6){var _0xabe38={'state':0x19,'statedesc':'notFound'};this[_0x7652('0xac')](_0x5bbd6a);this[_0x7652('0xc5')](_[_0x7652('0xc6')](_0xabe38,_[_0x7652('0xc7')](_0x3436f6,[_0x7652('0xc8'),_0x7652('0xc9'),_0x7652('0xca'),_0x7652('0xcb'),_0x7652('0xcc')])),_0x7652('0xcd'),'[emptyContact]');logger[_0x7652('0x90')](_0xbf468f);};Dialer[_0x7652('0x1d')][_0x7652('0xce')]=function(_0x392291){return _0x392291===_0x7652('0xcf');};Dialer['prototype']['isTrunkReachable']=function(_0x54a1b2){return!_['isUndefined'](_0x54a1b2)&&_0x54a1b2&&!_[_0x7652('0x3d')](_0x54a1b2[_0x7652('0x40')])&&!_[_0x7652('0x3d')](_0x54a1b2[_0x7652('0x73')])&&_0x54a1b2[_0x7652('0x73')]&&(this['trunks'][util[_0x7652('0x75')](_0x7652('0xd0'),_0x54a1b2['name'])][_0x7652('0xa9')]==='reachable'||this[_0x7652('0x25')][util[_0x7652('0x75')](_0x7652('0xd0'),_0x54a1b2['name'])][_0x7652('0xa9')]===_0x7652('0xd1'));};Dialer[_0x7652('0x1d')][_0x7652('0xc5')]=function(_0x5aa6a9,_0x3b38dc,_0x5dcfc7){this['createHistory'](_0x5aa6a9)[_0x7652('0xaa')](loggerCatch(_0x3b38dc));this[_0x7652('0xbf')](_0x5aa6a9)[_0x7652('0xaa')](loggerCatch(_0x5dcfc7));};Dialer[_0x7652('0x1d')][_0x7652('0x37')]=function(_0x89510c){var _0x201c34=this[_0x7652('0xa3')][_0x89510c[_0x7652('0xd2')]];var _0x192132;if(!_[_0x7652('0xa7')](_0x89510c)&&!_[_0x7652('0xa7')](_0x89510c[_0x7652('0xd3')])&&!_['isNil'](_0x89510c[_0x7652('0xd3')][_0x7652('0xd4')])&&_0x89510c['exten']===_0x7652('0xd5')&&_0x201c34){if(_0x201c34[_0x7652('0x4b')]!==_0x7652('0x78')&&this[_0x7652('0x22')][_0x201c34[_0x7652('0xae')]]['dialAMDActive']&&_0x89510c[_0x7652('0xd6')]===_0x7652('0xd7')){delete this[_0x7652('0xa3')][_0x89510c[_0x7652('0xd2')]];this[_0x7652('0xac')](this[_0x7652('0x22')][_0x201c34['queue']]);this[_0x7652('0x22')][_0x201c34[_0x7652('0xae')]][_0x7652('0x5a')]+=0x1;this['voiceQueues'][_0x201c34[_0x7652('0xae')]][_0x7652('0x59')]+=0x1;_0x192132=new Hangup(_0x201c34,_0x89510c);_0x192132[_0x7652('0x9f')]=0x12;_0x192132['statedesc']=_0x7652('0xd8');_0x192132[_0x7652('0xd9')]=_0x7652('0xda');ami[_0x7652('0x4a')](_0x7652('0xdb'),ut['buildObj'](_0x192132,_0x7652('0xdc')));this['saveInDb'](_0x192132,_0x7652('0xdd'),_0x7652('0xde'));}if(_0x201c34[_0x7652('0x4b')]!==_0x7652('0x78')&&this[_0x7652('0x22')][_0x201c34[_0x7652('0xae')]][_0x7652('0xdf')]&&_0x89510c[_0x7652('0xd6')]===_0x7652('0xe0')){var _0x5d718b=this;return new BPromise(function(_0x2000ff,_0x470989){delete _0x5d718b[_0x7652('0xa3')][_0x89510c['uniqueid']];_0x5d718b[_0x7652('0xac')](_0x5d718b['voiceQueues'][_0x201c34[_0x7652('0xae')]]);_0x5d718b[_0x7652('0x22')][_0x201c34[_0x7652('0xae')]]['outboundAnswerCallsDay']+=0x1;_0x5d718b[_0x7652('0x22')][_0x201c34[_0x7652('0xae')]][_0x7652('0x59')]+=0x1;var _0x1a843b=_0x5d718b['voiceQueues'][_0x201c34[_0x7652('0xae')]];var _0x213d3d=new Hangup(_0x201c34,_0x89510c);_0x213d3d[_0x7652('0x9f')]=0x13;_0x213d3d[_0x7652('0xa0')]=_0x7652('0xe1');_0x213d3d[_0x7652('0xd9')]=_0x7652('0xda');_0x213d3d[_0x7652('0xe2')]+=0x1;_0x213d3d['countglobal']+=0x1;_0x213d3d['amd']=!![];ami[_0x7652('0x4a')](_0x7652('0xdb'),ut[_0x7652('0xe3')](_0x213d3d,_0x7652('0xdc')));_0x5d718b['createHistory'](_0x213d3d)[_0x7652('0xaa')](loggerCatch(_0x7652('0xe4')));if(_0x213d3d[_0x7652('0xe5')]+_0x213d3d[_0x7652('0xe6')]+_0x213d3d[_0x7652('0xe7')]+_0x213d3d[_0x7652('0xe8')]+_0x213d3d[_0x7652('0xe9')]+_0x213d3d[_0x7652('0xea')]+_0x213d3d[_0x7652('0xe2')]+_0x213d3d[_0x7652('0xeb')]>=_0x1a843b[_0x7652('0xec')]){_0x5d718b['stateGlobal'](_0x213d3d,_0x2000ff,_0x470989,'reason19\x20machine....');}else{if(_0x213d3d[_0x7652('0xe2')]>=_0x1a843b[_0x7652('0xed')]){_0x5d718b[_0x7652('0xee')](_0x213d3d,_0x2000ff,_0x470989,_0x7652('0xef'));}else{_0x5d718b['rescheduleContact']({'active':![],'countmachineretry':_0x213d3d[_0x7652('0xe2')],'scheduledat':moment()['add'](_0x1a843b[_0x7652('0xf0')],_0x7652('0xf1'))['format'](_0x7652('0xf2')),'ContactId':_0x213d3d[_0x7652('0xc8')],'ListId':_0x213d3d[_0x7652('0xc9')],'VoiceQueueId':_0x213d3d[_0x7652('0xcb')]||undefined,'CampaignId':_0x213d3d['CampaignId']||undefined})[_0x7652('0xaa')](loggerCatch(_0x7652('0xf3')));_0x2000ff({'reschedule':0x1});}}});}if(_0x201c34[_0x7652('0x4b')]===_0x7652('0x78')&&this['campaigns'][_0x201c34[_0x7652('0xae')]][_0x7652('0xdf')]&&_0x89510c[_0x7652('0xd6')]===_0x7652('0xd7')){delete this[_0x7652('0xa3')][_0x89510c['uniqueid']];this[_0x7652('0xac')](this[_0x7652('0x23')][_0x201c34['queue']]);_0x192132=new Hangup(_0x201c34,_0x89510c);_0x192132[_0x7652('0x9f')]=0x12;_0x192132['statedesc']=_0x7652('0xd8');_0x192132[_0x7652('0xd9')]=_0x7652('0xda');ami[_0x7652('0x4a')](_0x7652('0xdb'),ut[_0x7652('0xe3')](_0x192132,'amd'));this[_0x7652('0xc5')](_0x192132,_0x7652('0xf4'),_0x7652('0xf5'));}if(_0x201c34[_0x7652('0x4b')]==='ivr'&&this[_0x7652('0x23')][_0x201c34[_0x7652('0xae')]]['dialAMDActive']&&_0x89510c[_0x7652('0xd6')]===_0x7652('0xe0')){var _0x5d718b=this;return new BPromise(function(_0x103723,_0x2b7d62){delete _0x5d718b[_0x7652('0xa3')][_0x89510c[_0x7652('0xd2')]];_0x5d718b[_0x7652('0xac')](_0x5d718b[_0x7652('0x23')][_0x201c34[_0x7652('0xae')]]);_0x5d718b['campaigns'][_0x201c34[_0x7652('0xae')]][_0x7652('0x5a')]+=0x1;_0x5d718b[_0x7652('0x23')][_0x201c34[_0x7652('0xae')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x384261=_0x5d718b[_0x7652('0x23')][_0x201c34['queue']];var _0x3e12d8=new Hangup(_0x201c34,_0x89510c);_0x3e12d8[_0x7652('0x9f')]=0x13;_0x3e12d8[_0x7652('0xa0')]=_0x7652('0xe1');_0x3e12d8['membername']=_0x7652('0xda');_0x3e12d8[_0x7652('0xe2')]+=0x1;_0x3e12d8[_0x7652('0xf6')]+=0x1;_0x3e12d8[_0x7652('0xdc')]=!![];ami[_0x7652('0x4a')](_0x7652('0xdb'),ut['buildObj'](_0x3e12d8,_0x7652('0xdc')));_0x5d718b['createHistory'](_0x3e12d8)[_0x7652('0xaa')](loggerCatch(_0x7652('0xe4')));if(_0x3e12d8['countbusyretry']+_0x3e12d8[_0x7652('0xe6')]+_0x3e12d8[_0x7652('0xe7')]+_0x3e12d8[_0x7652('0xe8')]+_0x3e12d8[_0x7652('0xe9')]+_0x3e12d8['countabandonedretry']+_0x3e12d8[_0x7652('0xe2')]+_0x3e12d8[_0x7652('0xeb')]>=_0x384261[_0x7652('0xec')]){_0x5d718b[_0x7652('0xf7')](_0x3e12d8,_0x103723,_0x2b7d62,_0x7652('0xf8'));}else{if(_0x3e12d8[_0x7652('0xe2')]>=_0x384261[_0x7652('0xed')]){_0x5d718b['createStateFinal'](_0x3e12d8,_0x103723,_0x2b7d62,_0x7652('0xef'));}else{_0x5d718b[_0x7652('0xf9')]({'active':![],'countmachineretry':_0x3e12d8[_0x7652('0xe2')],'scheduledat':moment()[_0x7652('0xfa')](_0x384261['dialMachineRetryFrequency'],_0x7652('0xf1'))[_0x7652('0x75')](_0x7652('0xf2')),'ContactId':_0x3e12d8[_0x7652('0xc8')],'ListId':_0x3e12d8['ListId'],'VoiceQueueId':_0x3e12d8[_0x7652('0xcb')]||undefined,'CampaignId':_0x3e12d8['CampaignId']||undefined})[_0x7652('0xaa')](loggerCatch(_0x7652('0xf3')));_0x103723({'reschedule':0x1});}}});}}};Dialer['prototype'][_0x7652('0x33')]=function(_0x18af27){var _0x3e9af7=this[_0x7652('0xa3')][_0x18af27[_0x7652('0xd2')]];var _0x42c7c8=this;var _0x2df5c4;if(_0x3e9af7&&_0x3e9af7['type']===_0x7652('0x78')){delete this[_0x7652('0xa3')][_0x18af27[_0x7652('0xd2')]];this[_0x7652('0xac')](this[_0x7652('0x23')][_0x3e9af7['queue']]);this[_0x7652('0x23')][_0x3e9af7['queue']]['ivrAnswerCallsDay']+=0x1;_0x2df5c4=new Hangup(_0x3e9af7,_0x18af27);this[_0x7652('0xc1')](_0x2df5c4)[_0x7652('0xaa')](loggerCatch(_0x7652('0xfb')));this[_0x7652('0xbf')](_0x2df5c4)[_0x7652('0xaa')](loggerCatch(_0x7652('0xfc')));}if(_0x3e9af7&&_0x3e9af7['type']!==_0x7652('0x78')&&isNotNull(this['voiceQueues'][_0x3e9af7['queue']][_0x7652('0xfd')])){delete this[_0x7652('0xa3')][_0x18af27['uniqueid']];this[_0x7652('0xac')](this[_0x7652('0x22')][_0x3e9af7[_0x7652('0xae')]]);this[_0x7652('0x22')][_0x3e9af7[_0x7652('0xae')]][_0x7652('0x5a')]+=0x1;this['voiceQueues'][_0x3e9af7[_0x7652('0xae')]][_0x7652('0x59')]+=0x1;_0x2df5c4=new Hangup(_0x3e9af7,_0x18af27);_0x2df5c4[_0x7652('0x9f')]=0x10;_0x2df5c4[_0x7652('0xa0')]=_0x7652('0xfe');_0x2df5c4[_0x7652('0xd9')]='AGI';this[_0x7652('0xc1')](_0x2df5c4)[_0x7652('0xaa')](loggerCatch(_0x7652('0xfb')));this[_0x7652('0xbf')](_0x2df5c4)['catch'](loggerCatch(_0x7652('0xfc')));}if(_0x3e9af7&&_0x3e9af7[_0x7652('0x4b')]!=='ivr'&&!isNotNull(this['voiceQueues'][_0x3e9af7['queue']][_0x7652('0xfd')])){delete this['uniqueId'][_0x18af27[_0x7652('0xd2')]];this[_0x7652('0xac')](this['voiceQueues'][_0x3e9af7[_0x7652('0xae')]]);this[_0x7652('0x22')][_0x3e9af7['queue']]['outboundUnknownCallsDay']+=0x1;_0x2df5c4=new Hangup(_0x3e9af7,_0x18af27);_0x2df5c4[_0x7652('0x9f')]=0xc;_0x2df5c4[_0x7652('0xa0')]=_0x18af27['cause-txt'];_0x2df5c4['membername']=_0x7652('0xff');this[_0x7652('0xc1')](_0x2df5c4)[_0x7652('0xaa')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x7652('0xbf')](_0x2df5c4)[_0x7652('0xaa')](loggerCatch(_0x7652('0xfc')));}};Dialer[_0x7652('0x1d')][_0x7652('0x31')]=function(_0x501d99){var _0x2fc501=this[_0x7652('0xa3')][_0x501d99[_0x7652('0xd2')]];var _0x256c5d=this;if(this['voiceQueues'][_0x501d99['queue']]){if(_0x2fc501&&_0x2fc501[_0x7652('0x4b')]!==_0x7652('0x78')){delete this[_0x7652('0xa3')][_0x501d99['uniqueid']];this[_0x7652('0x22')][_0x501d99[_0x7652('0xae')]]['outboundAnswerCallsDay']+=0x1;var _0x3a3e6a=new AgentComplete(_0x2fc501,_0x501d99);if(_0x501d99[_0x7652('0x100')]==='agent'){_0x3a3e6a[_0x7652('0x101')]=this[_0x7652('0x22')][_0x501d99[_0x7652('0xae')]]['dialQueueProject2']&&this[_0x7652('0x22')][_0x501d99[_0x7652('0xae')]][_0x7652('0x102')]?moment()[_0x7652('0x75')](_0x7652('0xf2')):undefined;}this[_0x7652('0xc1')](_0x3a3e6a)[_0x7652('0xaa')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x7652('0xbf')](_0x3a3e6a)[_0x7652('0xaa')](loggerCatch(_0x7652('0x103')));}}};Dialer[_0x7652('0x1d')][_0x7652('0x2d')]=function(_0x5a9b8e){if(this[_0x7652('0x22')][_0x5a9b8e[_0x7652('0xae')]]){if(this['uniqueId'][_0x5a9b8e['uniqueid']]&&this[_0x7652('0xa3')][_0x5a9b8e[_0x7652('0xd2')]][_0x7652('0x4b')]!==_0x7652('0x78')){this['updateOriginated'](this[_0x7652('0x22')][_0x5a9b8e[_0x7652('0xae')]]);this['uniqueId'][_0x5a9b8e[_0x7652('0xd2')]][_0x7652('0x104')]=moment()['format'](_0x7652('0xf2'));}}};Dialer[_0x7652('0x1d')][_0x7652('0x105')]=function(_0x51570a){this[_0x7652('0xc1')](_0x51570a)[_0x7652('0xaa')](loggerCatch(_0x7652('0x106')));this['moveContactManagedDialer'](_0x51570a)['catch'](loggerCatch(_0x7652('0x107')));};Dialer[_0x7652('0x1d')][_0x7652('0x108')]=function(_0x160aa0){var _0x3e425f=this['uniqueId'][_0x160aa0['uniqueid']];var _0x1a75ef=this;if(this[_0x7652('0x22')][_0x160aa0[_0x7652('0xae')]]){if(_0x3e425f&&_0x3e425f['type']!==_0x7652('0x78')){delete this[_0x7652('0xa3')][_0x160aa0['uniqueid']];this[_0x7652('0xac')](this[_0x7652('0x22')][_0x160aa0[_0x7652('0xae')]]);_0x3e425f[_0x7652('0x109')]=moment()[_0x7652('0x75')](_0x7652('0xf2'));var _0x5300df=new QueueCallerAbandon(_0x3e425f,_0x160aa0);if(getSeconds(_0x3e425f['droptime'],_0x3e425f[_0x7652('0x10a')])>=_0x3e425f[_0x7652('0x10b')]){this[_0x7652('0x22')][_0x160aa0[_0x7652('0xae')]][_0x7652('0x65')]+=0x1;this['voiceQueues'][_0x160aa0[_0x7652('0xae')]]['outboundDropCallsDayTimeout']+=0x1;this[_0x7652('0x22')][_0x160aa0[_0x7652('0xae')]][_0x7652('0x67')]+=0x1;_0x5300df[_0x7652('0x9f')]=0xa;_0x5300df[_0x7652('0xa0')]=_0x7652('0x10c');_0x5300df[_0x7652('0x10d')]='TIMEOUT';_0x5300df[_0x7652('0x101')]=this[_0x7652('0x22')][_0x160aa0['queue']][_0x7652('0x10e')]?moment()[_0x7652('0x75')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x5300df[_0x7652('0xe9')]+=0x1;_0x5300df[_0x7652('0xf6')]+=0x1;if(_0x5300df[_0x7652('0xe9')]>=this[_0x7652('0x22')][_0x160aa0[_0x7652('0xae')]][_0x7652('0x10f')]){this[_0x7652('0x105')](_0x5300df);}else{this[_0x7652('0xf9')]({'active':![],'countdropretry':_0x5300df[_0x7652('0xe9')],'scheduledat':moment()['add'](this[_0x7652('0x22')][_0x160aa0[_0x7652('0xae')]][_0x7652('0x110')],_0x7652('0xf1'))[_0x7652('0x75')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3e425f[_0x7652('0xc8')],'ListId':_0x3e425f[_0x7652('0xc9')],'VoiceQueueId':_0x3e425f[_0x7652('0xcb')]||undefined,'CampaignId':_0x3e425f[_0x7652('0xcc')]||undefined})[_0x7652('0xaa')](loggerCatch(_0x7652('0x111')));var _0xd75dca=new History(_0x5300df);_0xd75dca[_0x7652('0x9f')]=0xa;_0xd75dca[_0x7652('0xa0')]=_0x7652('0x10c');_0xd75dca[_0x7652('0xa2')]=moment()['format'](_0x7652('0xf2'));_0xd75dca[_0x7652('0xa1')]=_0xd75dca[_0x7652('0xa2')];_0xd75dca[_0x7652('0x112')]=_0x5300df['calleridname'];_0xd75dca[_0x7652('0x113')]=_0x5300df[_0x7652('0x113')];this['createHistory'](_0xd75dca)[_0x7652('0xaa')](loggerCatch(_0x7652('0x114')));}}else{this[_0x7652('0x22')][_0x160aa0[_0x7652('0xae')]][_0x7652('0x7f')]+=0x1;this[_0x7652('0x22')][_0x160aa0['queue']][_0x7652('0x5f')]+=0x1;_0x5300df[_0x7652('0x9f')]=0xb;_0x5300df[_0x7652('0xa0')]='Abandoned';_0x5300df[_0x7652('0x10d')]=_0x7652('0x115');_0x5300df[_0x7652('0xea')]+=0x1;_0x5300df[_0x7652('0xf6')]+=0x1;if(_0x5300df[_0x7652('0xea')]>=this[_0x7652('0x22')][_0x160aa0[_0x7652('0xae')]][_0x7652('0x116')]){this[_0x7652('0x105')](_0x5300df);}else{this[_0x7652('0xf9')]({'active':![],'countabandonedretry':_0x5300df[_0x7652('0xea')],'scheduledat':moment()[_0x7652('0xfa')](this['voiceQueues'][_0x160aa0[_0x7652('0xae')]][_0x7652('0x117')],_0x7652('0xf1'))[_0x7652('0x75')](_0x7652('0xf2')),'ContactId':_0x3e425f['ContactId'],'ListId':_0x3e425f[_0x7652('0xc9')],'VoiceQueueId':_0x3e425f['VoiceQueueId']||undefined,'CampaignId':_0x3e425f['CampaignId']||undefined})[_0x7652('0xaa')](loggerCatch('[rescheduleContact][Abandoned]'));var _0xd75dca=new History(_0x5300df);_0xd75dca[_0x7652('0x9f')]=0xb;_0xd75dca[_0x7652('0xa0')]=_0x7652('0x118');_0xd75dca[_0x7652('0xa2')]=moment()[_0x7652('0x75')](_0x7652('0xf2'));_0xd75dca[_0x7652('0xa1')]=_0xd75dca[_0x7652('0xa2')];_0xd75dca[_0x7652('0x112')]=_0x5300df[_0x7652('0x112')];_0xd75dca[_0x7652('0x113')]=_0x5300df['calleridnum'];this[_0x7652('0xc1')](_0xd75dca)['catch'](loggerCatch(_0x7652('0x119')));}}}}};Dialer[_0x7652('0x1d')]['syncNewExten']=function(_0x2f52ee){if(this[_0x7652('0x28')][_0x2f52ee[_0x7652('0xd2')]]){this[_0x7652('0x28')][_0x2f52ee[_0x7652('0xd2')]][_0x7652('0x11a')]=_0x2f52ee['channel'];}if(this[_0x7652('0xa3')][_0x2f52ee[_0x7652('0xd2')]]){this[_0x7652('0xa3')][_0x2f52ee['uniqueid']][_0x7652('0x11a')]=_0x2f52ee[_0x7652('0x11a')];}};Dialer[_0x7652('0x1d')][_0x7652('0x11b')]=function(_0x109d09){if(strategy[this['voiceQueues'][this[_0x7652('0x28')][_0x109d09[_0x7652('0x11c')]][_0x7652('0xae')]][_0x7652('0x4d')]]===_0x7652('0x11d')){if(this[_0x7652('0x28')][_0x109d09[_0x7652('0x11c')]]&&_['isNil'](this[_0x7652('0x28')][_0x109d09[_0x7652('0x11c')]][_0x7652('0x11e')])&&_0x109d09[_0x7652('0xa9')]==='1'&&_0x109d09[_0x7652('0x11f')]==='0'){if(this[_0x7652('0x24')][_0x109d09['stateinterface']]){if(!this[_0x7652('0x24')][_0x109d09[_0x7652('0x120')]]['locked']){this[_0x7652('0x24')][_0x109d09[_0x7652('0x120')]][_0x7652('0x11e')]=!![];this[_0x7652('0x28')][_0x109d09['actionid']][_0x7652('0x11e')]=!![];this[_0x7652('0x28')][_0x109d09[_0x7652('0x11c')]][_0x7652('0x120')]=_0x109d09[_0x7652('0x120')];}}}}else if((strategy[this['voiceQueues'][this[_0x7652('0x28')][_0x109d09['actionid']][_0x7652('0xae')]][_0x7652('0x4d')]]||_0x7652('0x1c'))===_0x7652('0x1c')){if(this[_0x7652('0x28')][_0x109d09[_0x7652('0x11c')]]){if(this['agents'][_0x109d09[_0x7652('0x120')]]){this[_0x7652('0x28')][_0x109d09[_0x7652('0x11c')]][_0x7652('0x120')]=_0x109d09[_0x7652('0x120')];if(_['isNil'](this[_0x7652('0x121')][this['actions'][_0x109d09[_0x7652('0x11c')]][_0x7652('0xae')]])){this[_0x7652('0x121')][this[_0x7652('0x28')][_0x109d09[_0x7652('0x11c')]][_0x7652('0xae')]]=[];}this[_0x7652('0x121')][this[_0x7652('0x28')][_0x109d09[_0x7652('0x11c')]][_0x7652('0xae')]][_0x7652('0x122')](_[_0x7652('0xc6')](_['pick'](this[_0x7652('0x28')][_0x109d09[_0x7652('0x11c')]],[_0x7652('0x123'),_0x7652('0x120')]),{'status':_0x109d09[_0x7652('0xa9')],'paused':_0x109d09[_0x7652('0x11f')]}));}}}};function unlockQueueStatus(_0x1dca9b,_0x55347c){setTimeout(function(){if(_['isUndefined'](_0x1dca9b[_0x7652('0x124')])){loggerBooked['error']('[unlockQueueStatus][undefined]',_0x55347c);}_0x1dca9b[_0x7652('0x124')]=!![];loggerBooked[_0x7652('0x7c')]('[booked][unlockQueueStatus]',_0x55347c,JSON[_0x7652('0x74')](_['pick'](_0x1dca9b,['name',_0x7652('0x124')])));},0x1f3);}Dialer[_0x7652('0x1d')][_0x7652('0x38')]=function(_0x2da939){var _0x4e6dc2=this;var _0x4dcbf7=_0x4e6dc2[_0x7652('0x22')][_0x4e6dc2[_0x7652('0x28')][_0x2da939['actionid']][_0x7652('0xae')]];if(strategy[this[_0x7652('0x22')][this[_0x7652('0x28')][_0x2da939['actionid']][_0x7652('0xae')]]['strategy']]===_0x7652('0x11d')){if(this[_0x7652('0x28')][_0x2da939[_0x7652('0x11c')]]&&this[_0x7652('0x28')][_0x2da939['actionid']][_0x7652('0x120')]){this['preview'][_0x7652('0x125')](this[_0x7652('0x28')][_0x2da939['actionid']][_0x7652('0x123')],this['actions'][_0x2da939[_0x7652('0x11c')]][_0x7652('0x120')])[_0x7652('0xaa')](function(_0x550f0d){logger[_0x7652('0x90')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x7652('0x93')](_0x550f0d,{'showHidden':![],'depth':null}));})[_0x7652('0x20')](function(){_0x4e6dc2['updateOriginated'](_0x4e6dc2[_0x7652('0x22')][_0x4e6dc2[_0x7652('0x28')][_0x2da939[_0x7652('0x11c')]][_0x7652('0xae')]]);_0x4e6dc2[_0x7652('0x24')][_0x4e6dc2[_0x7652('0x28')][_0x2da939[_0x7652('0x11c')]][_0x7652('0x120')]][_0x7652('0x11e')]=![];delete _0x4e6dc2[_0x7652('0x28')][_0x2da939[_0x7652('0x11c')]];unlockQueueStatus(_0x4dcbf7);});}else{this[_0x7652('0xac')](this[_0x7652('0x22')][this[_0x7652('0x28')][_0x2da939['actionid']][_0x7652('0xae')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x7652('0x28')][_0x2da939[_0x7652('0x11c')]][_0x7652('0xc8')],'ListId':this[_0x7652('0x28')][_0x2da939[_0x7652('0x11c')]][_0x7652('0xc9')],'VoiceQueueId':this[_0x7652('0x28')][_0x2da939[_0x7652('0x11c')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x7652('0x28')][_0x2da939[_0x7652('0x11c')]][_0x7652('0xcc')]||undefined})[_0x7652('0xaa')](loggerCatch(_0x7652('0x126')));delete this[_0x7652('0x28')][_0x2da939[_0x7652('0x11c')]];unlockQueueStatus(_0x4dcbf7);}}else if((strategy[this['voiceQueues'][this['actions'][_0x2da939[_0x7652('0x11c')]][_0x7652('0xae')]][_0x7652('0x4d')]]||_0x7652('0x1c'))===_0x7652('0x1c')){var _0x4be5ca;if(this[_0x7652('0x28')][_0x2da939[_0x7652('0x11c')]]&&!_[_0x7652('0x7b')](this['queueBooked'][this[_0x7652('0x28')][_0x2da939['actionid']][_0x7652('0xae')]])){if(this[_0x7652('0x2c')][_0x4e6dc2[_0x7652('0x28')][_0x2da939['actionid']][_0x7652('0xae')]]){this[_0x7652('0x2c')][_0x4e6dc2[_0x7652('0x28')][_0x2da939['actionid']][_0x7652('0xae')]]=this[_0x7652('0x2c')][this[_0x7652('0x28')][_0x2da939[_0x7652('0x11c')]][_0x7652('0xae')]]?this[_0x7652('0x2c')][this[_0x7652('0x28')][_0x2da939[_0x7652('0x11c')]][_0x7652('0xae')]]:this[_0x7652('0x121')][this[_0x7652('0x28')][_0x2da939[_0x7652('0x11c')]]['queue']]?this[_0x7652('0x121')][this['actions'][_0x2da939[_0x7652('0x11c')]]['queue']][_0x7652('0x127')]||0x0:0x0;}this[_0x7652('0x121')][this[_0x7652('0x28')][_0x2da939[_0x7652('0x11c')]][_0x7652('0xae')]][_0x7652('0x127')]=this[_0x7652('0x2c')][this[_0x7652('0x28')][_0x2da939[_0x7652('0x11c')]][_0x7652('0xae')]];for(var _0x3efa75=0x0;_0x3efa75<this['queueBooked'][this[_0x7652('0x28')][_0x2da939[_0x7652('0x11c')]][_0x7652('0xae')]][_0x7652('0x92')];_0x3efa75+=0x1){_0x4be5ca=rr(this[_0x7652('0x121')][this[_0x7652('0x28')][_0x2da939[_0x7652('0x11c')]][_0x7652('0xae')]]);this[_0x7652('0x2c')][_0x4e6dc2['actions'][_0x2da939[_0x7652('0x11c')]][_0x7652('0xae')]]=this[_0x7652('0x121')][this['actions'][_0x2da939[_0x7652('0x11c')]]['queue']][_0x7652('0x127')];if(_0x4be5ca[_0x7652('0xa9')]==='1'&&_0x4be5ca[_0x7652('0x11f')]==='0'){break;}}if(!_[_0x7652('0xa7')](_0x4be5ca)){this[_0x7652('0x24')][_0x4be5ca[_0x7652('0x120')]]['unlockRR']=_[_0x7652('0x3d')](this['agents'][_0x4be5ca['stateinterface']][_0x7652('0x128')])?!![]:this['agents'][_0x4be5ca[_0x7652('0x120')]][_0x7652('0x128')];}loggerBooked['info'](_0x7652('0x129'),_0x2da939[_0x7652('0x11c')],_0x7652('0x12a'),JSON['stringify'](_[_0x7652('0xc7')](this[_0x7652('0x24')][_0x4be5ca[_0x7652('0x120')]],[_0x7652('0x40'),_0x7652('0x128')])),_0x7652('0x12b'),JSON[_0x7652('0x74')](_0x4be5ca[_0x7652('0x123')]));if(!_[_0x7652('0xa7')](_0x4be5ca)&&_0x4be5ca[_0x7652('0xa9')]==='1'&&_0x4be5ca[_0x7652('0x11f')]==='0'&&this[_0x7652('0x24')][_0x4be5ca[_0x7652('0x120')]][_0x7652('0x128')]){this[_0x7652('0x24')][_0x4be5ca['stateinterface']][_0x7652('0x128')]=![];this['queueBooked'][_0x4e6dc2[_0x7652('0x28')][_0x2da939[_0x7652('0x11c')]][_0x7652('0xae')]]=[];this['preview'][_0x7652('0x125')](_0x4be5ca['idHopper'],_0x4be5ca[_0x7652('0x120')])[_0x7652('0xaa')](function(_0x37ca64){logger[_0x7652('0x90')](_0x7652('0x12c'),util[_0x7652('0x93')](_0x37ca64,{'showHidden':![],'depth':null}));})[_0x7652('0x20')](function(){_0x4e6dc2[_0x7652('0xac')](_0x4e6dc2[_0x7652('0x22')][_0x4e6dc2['actions'][_0x2da939[_0x7652('0x11c')]][_0x7652('0xae')]]);setTimeout(function(){_0x4e6dc2[_0x7652('0x24')][_0x4be5ca[_0x7652('0x120')]][_0x7652('0x128')]=!![];loggerBooked[_0x7652('0x7c')](_0x7652('0x12d'),_0x2da939[_0x7652('0x11c')],_0x7652('0x12a'),JSON[_0x7652('0x74')](_['pick'](_0x4e6dc2[_0x7652('0x24')][_0x4be5ca[_0x7652('0x120')]],[_0x7652('0x40'),_0x7652('0x128')])),_0x7652('0x12b'),JSON[_0x7652('0x74')](_0x4be5ca[_0x7652('0x123')]));},0xc7);delete _0x4e6dc2[_0x7652('0x28')][_0x2da939[_0x7652('0x11c')]];unlockQueueStatus(_0x4dcbf7,_0x2da939[_0x7652('0x11c')]);});}else{loggerBooked['info']('[booked][unlock]');this[_0x7652('0xac')](this[_0x7652('0x22')][this[_0x7652('0x28')][_0x2da939[_0x7652('0x11c')]][_0x7652('0xae')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x7652('0x28')][_0x2da939[_0x7652('0x11c')]]['ContactId'],'ListId':this[_0x7652('0x28')][_0x2da939[_0x7652('0x11c')]]['ListId'],'VoiceQueueId':this[_0x7652('0x28')][_0x2da939['actionid']]['VoiceQueueId']||undefined,'CampaignId':this[_0x7652('0x28')][_0x2da939[_0x7652('0x11c')]][_0x7652('0xcc')]||undefined})[_0x7652('0xaa')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x7652('0x28')][_0x2da939[_0x7652('0x11c')]];unlockQueueStatus(_0x4dcbf7);}}else{loggerBooked[_0x7652('0x7c')]('[booked][unlock2]');this['updateOriginated'](this['voiceQueues'][this['actions'][_0x2da939[_0x7652('0x11c')]][_0x7652('0xae')]]);this[_0x7652('0xf9')]({'active':![],'ContactId':this[_0x7652('0x28')][_0x2da939[_0x7652('0x11c')]][_0x7652('0xc8')],'ListId':this['actions'][_0x2da939[_0x7652('0x11c')]]['ListId'],'VoiceQueueId':this[_0x7652('0x28')][_0x2da939[_0x7652('0x11c')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x7652('0x28')][_0x2da939[_0x7652('0x11c')]][_0x7652('0xcc')]||undefined})['catch'](loggerCatch(_0x7652('0x12e')));delete this[_0x7652('0x28')][_0x2da939[_0x7652('0x11c')]];unlockQueueStatus(_0x4dcbf7);}}else{loggerBooked['info']('[booked][unlock3]');this[_0x7652('0xac')](this['voiceQueues'][this[_0x7652('0x28')][_0x2da939[_0x7652('0x11c')]][_0x7652('0xae')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x7652('0x28')][_0x2da939[_0x7652('0x11c')]][_0x7652('0xc8')],'ListId':this['actions'][_0x2da939[_0x7652('0x11c')]][_0x7652('0xc9')],'VoiceQueueId':this['actions'][_0x2da939['actionid']][_0x7652('0xcb')]||undefined,'CampaignId':this['actions'][_0x2da939['actionid']][_0x7652('0xcc')]||undefined})['catch'](loggerCatch(_0x7652('0x12f')));delete this[_0x7652('0x28')][_0x2da939['actionid']];unlockQueueStatus(_0x4dcbf7);}};Dialer['prototype'][_0x7652('0x130')]=function(){var _0x2bf987=this;return BPromise['resolve']()[_0x7652('0x3b')](cmHopper['resetActiveCalls']({}))[_0x7652('0x3b')](function(){setInterval(function(){_0x2bf987[_0x7652('0x131')]();},0x3e8);});};Dialer[_0x7652('0x1d')]['checkIsTrunkReachable']=function(_0x5ca01a){var _0x1aebe5=this;return function(){if(!_0x1aebe5[_0x7652('0x132')](_0x5ca01a[_0x7652('0x72')])){if(!_0x1aebe5[_0x7652('0x132')](_0x5ca01a[_0x7652('0x133')])){_0x5ca01a['message']=_0x7652('0x134');throw _0x5ca01a[_0x7652('0x40')]+_0x7652('0x135');}}};};Dialer[_0x7652('0x1d')][_0x7652('0x136')]=function(_0x29519a,_0x3abfbd,_0x380481,_0x169ac4){var _0x118904=this;return function(){var _0x4cbe81=!![];return _0x118904['ifTime'](_0x29519a,_0x3abfbd,_0x380481,_0x169ac4,_0x4cbe81);};};Dialer[_0x7652('0x1d')][_0x7652('0x137')]=function(_0x52b43b,_0x5d9cfc,_0x15c979,_0x1787a6){var _0x3117b5=this;return function(){var _0x456a86=![];return _0x3117b5['ifTime'](_0x52b43b[_0x7652('0x46')],_0x5d9cfc,_0x15c979,_0x1787a6,_0x456a86);};};Dialer[_0x7652('0x1d')][_0x7652('0x138')]=function(_0x3430d7,_0x457026,_0x1f14fb,_0x29e76c,_0x4c8d70){var _0x56f16e=[];return new BPromise(function(_0x29642f,_0xb5363d){if(!isNotNull(_0x3430d7)){_0x29e76c[_0x7652('0x3e')]=_0x7652('0x43');return _0xb5363d(msgResponse(_0x7652('0x138'),_0x7652('0x139'),_0x1f14fb+_0x7652('0x13a')));}if(_[_0x7652('0x7b')](_0x3430d7)){_0x29e76c[_0x7652('0x3e')]=_0x7652('0x13b');return _0xb5363d(msgResponse(_0x7652('0x138'),'Failure',_0x1f14fb+_0x7652('0x13c')));}if(_0x457026&&_[_0x7652('0x3d')](config[_0x7652('0x13d')][_0x457026])){_0x29e76c['message']=_0x7652('0x13e');return _0xb5363d(msgResponse(_0x7652('0x138'),_0x7652('0x139'),_0x1f14fb+'\x20Timezone\x20unknow\x20'+_0x457026));}if(_['isArray'](_0x3430d7)){for(var _0x3bd5fa=0x0;_0x3bd5fa<_0x3430d7[_0x7652('0x92')];_0x3bd5fa+=0x1){_0x56f16e[_0x7652('0x122')](ami[_0x7652('0xa8')]({'action':_0x7652('0x13f'),'command':util['format'](_0x7652('0x140'),_0x3430d7[_0x3bd5fa][_0x7652('0x141')],!_[_0x7652('0x3d')](config[_0x7652('0x13d')][_0x457026])?_0x457026:'')})[_0x7652('0x3b')](function(_0x22a8ec){return _0x22a8ec[_0x7652('0x142')][_0x7652('0x143')](_0x7652('0x144'))>=0x0;})[_0x7652('0xaa')](myreject(_0xb5363d)));}}else{_0x56f16e[_0x7652('0x122')](ami['Action']({'action':'command','command':util[_0x7652('0x75')](_0x7652('0x140'),_0x3430d7,!_[_0x7652('0x3d')](config['timezones'][_0x457026])?_0x457026:'')})[_0x7652('0x3b')](function(_0xe1346){return _0xe1346[_0x7652('0x142')]['indexOf'](_0x7652('0x144'))>=0x0;})[_0x7652('0xaa')](myreject(_0xb5363d)));}BPromise[_0x7652('0x145')](_0x56f16e)[_0x7652('0x3b')](function(_0x4d44a7){var _0x1b9ff3=_[_0x7652('0x146')](_0x4d44a7);if(_0x1b9ff3){return _0x29642f(_0x1b9ff3);}else{_0x29e76c[_0x7652('0x3e')]=_0x4c8d70?_0x7652('0x147'):_0x7652('0x148');return _0xb5363d(msgResponse(_0x7652('0x149'),_0x7652('0x139'),_0x7652('0x14a')+_0x4c8d70+'\x20'+_0x1f14fb+'\x20Interval\x20is\x20overtime:\x20'+util[_0x7652('0x93')](_0x3430d7,{'showHidden':![],'depth':null})+_0x7652('0x14b')+_0x457026));}})[_0x7652('0xaa')](function(_0x36d6f2){return _0xb5363d(msgResponse(_0x7652('0x138'),_0x7652('0x139'),JSON['stringify'](_0x36d6f2)));});});};Dialer[_0x7652('0x1d')][_0x7652('0x14c')]=function(_0x2bdf4e){var _0x1d8627=this;return function(){switch(_0x2bdf4e['dialMethod']){case'progressive':freeVariablesPredictive(_0x2bdf4e);_0x1d8627['handlePower'](_0x2bdf4e,0x1);break;case _0x7652('0x14d'):freeVariablesPredictive(_0x2bdf4e);_0x1d8627[_0x7652('0x14e')](_0x2bdf4e,_0x2bdf4e[_0x7652('0x14f')]);break;case _0x7652('0x8'):_0x1d8627['predictive'](_0x2bdf4e);break;case'booked':freeVariablesPredictive(_0x2bdf4e);_0x1d8627[_0x7652('0x14e')](_0x2bdf4e,0x1);break;default:freeVariablesPredictive(_0x2bdf4e);logger[_0x7652('0x90')](_0x7652('0x150'),_0x2bdf4e[_0x7652('0x40')],_0x7652('0x151'));}};};Dialer[_0x7652('0x1d')][_0x7652('0x152')]=function(_0x51ad4a){return BPromise['resolve']()['then'](cmHopper[_0x7652('0x153')](_0x51ad4a['id'],previewRecallmeReminderInterval))[_0x7652('0x3b')](function(_0x5a1018){for(var _0x205e4f=0x0;_0x205e4f<_0x5a1018[_0x7652('0x92')];_0x205e4f++){var _0x5ae62e=_0x5a1018[_0x205e4f][_0x7652('0x154')]['name'];if(_0x5ae62e)io['to'](util[_0x7652('0x75')](_0x7652('0x155'),_0x5ae62e))[_0x7652('0x4a')](_0x7652('0x156'),{'hopper':_0x5a1018[_0x205e4f]});}})[_0x7652('0xaa')](function(_0x20911d){});};Dialer[_0x7652('0x1d')][_0x7652('0x157')]=function(_0x4d0998){var _0x44dd4f=this;return function(){_0x44dd4f['handleIvr'](_0x4d0998);};};Dialer[_0x7652('0x1d')][_0x7652('0xa')]=function(_0x1fa552){var _0x17e4fc=this;if(isNotPreview(_0x1fa552[_0x7652('0x158')])){if(isVoiceQueueOutbound(_0x1fa552[_0x7652('0x4b')])&&isActive(_0x1fa552[_0x7652('0x159')])){_0x1fa552['sendMessageOneNotActive']=!![];BPromise[_0x7652('0xb1')]()[_0x7652('0x3b')](checkIsLoggedIn(_0x1fa552,_0x1fa552[_0x7652('0x50')]))[_0x7652('0x3b')](checkIsActive(_0x1fa552,_0x1fa552[_0x7652('0x159')]))[_0x7652('0x3b')](checkInterval(_0x1fa552))['then'](_0x17e4fc[_0x7652('0x15a')](_0x1fa552))[_0x7652('0x3b')](_0x17e4fc[_0x7652('0x136')](_0x1fa552[_0x7652('0x15b')],_0x1fa552['dialTimezone'],_0x1fa552[_0x7652('0x40')],_0x1fa552))[_0x7652('0x3b')](_0x17e4fc[_0x7652('0x137')](_0x1fa552[_0x7652('0x45')],_0x1fa552[_0x7652('0x15c')],_0x1fa552[_0x7652('0x40')],_0x1fa552))[_0x7652('0x3b')](_0x17e4fc[_0x7652('0x14c')](_0x1fa552))['catch'](loggerCatchQueueSummary(_0x7652('0x15d'),_0x1fa552));}else{notSendMessagesQueue(_0x1fa552);}}else{freeVariablesPredictive(_0x1fa552);if(_0x1fa552['dialPreviewRecallmeReminder']){_0x17e4fc['checkPreviewRecallReminder'](_0x1fa552);}}};Dialer['prototype'][_0x7652('0x131')]=function(){var _0x10f8e9=this;var _0x413514;for(var _0x39f289 in this[_0x7652('0x23')]){if(typeof this[_0x7652('0x23')][_0x39f289]!=='undefined'){_0x413514=this[_0x7652('0x23')][_0x39f289];if(isCampaignIvr(_0x413514[_0x7652('0x4b')])&&isActive(_0x413514[_0x7652('0x73')])){_0x413514[_0x7652('0x98')]=!![];BPromise[_0x7652('0xb1')]()['then'](checkIsActive(_0x413514,_0x413514[_0x7652('0x73')]))['then'](checkInterval(_0x413514))[_0x7652('0x3b')](_0x10f8e9[_0x7652('0x15a')](_0x413514))['then'](_0x10f8e9[_0x7652('0x136')](_0x413514[_0x7652('0x15b')],_0x413514[_0x7652('0x15c')],_0x413514['name'],_0x413514))['then'](_0x10f8e9[_0x7652('0x137')](_0x413514[_0x7652('0x45')],_0x413514['dialTimezone'],_0x413514['name'],_0x413514))[_0x7652('0x3b')](_0x10f8e9['launchHandleIvr'](_0x413514))['catch'](loggerCatchQueueSummary(_0x7652('0x15e'),_0x413514));}else{notSendMessagesCampaign(_0x413514);}}}};function getCallerIdRandom(_0x4dded2,_0x5d84c5){var _0x13f4cf;var _0xb7638f;var _0x12bb46;if(_0x5d84c5<=0x0){_0x5d84c5=0x1;}_0x13f4cf=new RegExp(_0x7652('0x15f')+_0x5d84c5+'}$');_0xb7638f=Math[_0x7652('0x160')](0xa,_0x5d84c5-0x1);_0x12bb46=Math[_0x7652('0x160')](0xa,_0x5d84c5)-0x1;return util['format']('%s',_[_0x7652('0x161')](_0x4dded2,_0x13f4cf,_[_0x7652('0x162')](_0xb7638f,_0x12bb46)));}function extractCalleridName(_0x1be415){var _0x3d8c51=_0x1be415[_0x7652('0x163')](/"(.*?)"/);return _0x3d8c51?_0x3d8c51[0x1]:_0x1be415;}function extractCalleridNumber(_0x4b7b82){var _0x1d8a01=_0x4b7b82[_0x7652('0x163')](/<(.*?)>/);return _0x1d8a01?_0x1d8a01[0x1]:_0x4b7b82;}Dialer[_0x7652('0x1d')]['actionOriginate']=function(_0x437924,_0x2fb35f){var _0x509a3b=this;var _0x267066=uuid['v4']();this[_0x7652('0x28')][_0x267066]=new Action(_0x437924,_0x2fb35f,_0x267066);return new BPromise(function(_0x1ca906,_0x17dc1e){if(_[_0x7652('0x3d')](_0x437924)&&typeof _0x437924!==_0x7652('0x164')){return _0x17dc1e(msgResponse('originate',_0x7652('0x139'),'voiceQueue\x20is\x20undefine'));}if(_[_0x7652('0x3d')](_0x2fb35f[_0x7652('0x165')][_0x7652('0x166')])||_0x2fb35f[_0x7652('0x165')][_0x7652('0x166')]===null){return _0x17dc1e(msgResponse(_0x7652('0x167'),'Failure',_0x7652('0x168')));}var _0x2d0b50={'XMD-CALLERID':_0x509a3b[_0x7652('0x28')][_0x267066][_0x7652('0x169')](),'XMD-AGI':_0x437924[_0x7652('0xfd')]?util[_0x7652('0x75')](_0x7652('0x16a'),ipAgi,_0x437924[_0x7652('0xfd')]):_0x7652('0x16b'),'XMD-AGIAFTER':_0x437924[_0x7652('0x10e')]?util[_0x7652('0x75')](_0x7652('0x16a'),ipAgi,_0x437924[_0x7652('0x10e')]):_0x7652('0x16b'),'XMD-QUEUE':_0x437924[_0x7652('0x4b')]==='outbound'?util[_0x7652('0x75')](_0x7652('0x16c'),_0x437924[_0x7652('0x40')],_0x437924[_0x7652('0x16d')]||'',_0x437924[_0x7652('0x102')]?'c':'',_0x437924[_0x7652('0x10b')]||0x3):_0x7652('0x16b'),'XMD-CONTACTID':_0x2fb35f[_0x7652('0xc8')],'XMD-CDRTYPE':_0x7652('0x7'),'CALLERID(all)':_0x509a3b[_0x7652('0x28')][_0x267066][_0x7652('0x169')](),'XMD-AMD':_0x437924[_0x7652('0xdf')]?'ACTIVE':_0x7652('0x16b'),'XMD-DESTINATION':_0x7652('0xd5')};if(_0x437924[_0x7652('0xdf')]){_0x2d0b50[_0x7652('0x16e')]=_0x437924[_0x7652('0x16f')]||0x9c4;_0x2d0b50[_0x7652('0x170')]=_0x437924[_0x7652('0x171')]||0x5dc;_0x2d0b50[_0x7652('0x172')]=_0x437924['dialAMDAfterGreetingSilence']||0x320;_0x2d0b50[_0x7652('0x173')]=_0x437924['dialAMDTotalAnalysisTime']||0x1388;_0x2d0b50[_0x7652('0x174')]=_0x437924[_0x7652('0x175')]||0x64;_0x2d0b50[_0x7652('0x176')]=_0x437924[_0x7652('0x177')]||0x32;_0x2d0b50[_0x7652('0x178')]=_0x437924[_0x7652('0x179')]||0x3;_0x2d0b50[_0x7652('0x17a')]=_0x437924['dialAMDSilenceThreshold']||0x100;_0x2d0b50['XMD-AMDMAXIMUMWORDLENGTH']=_0x437924['dialAMDMaximumWordLength']||0x1388;}if(_0x437924[_0x7652('0x4b')]===_0x7652('0x4c')){_0x2d0b50[_0x7652('0x17b')]=_0x2fb35f[_0x7652('0xcb')];}else{_0x2d0b50['XMD-CAMPAIGNID']=_0x2fb35f['CampaignId'];}for(var _0x7bbc78 in _0x2fb35f['Contact']){if(typeof _0x2fb35f[_0x7652('0x165')][_0x7bbc78]!=='undefined'){if(isNotNull(_0x2fb35f[_0x7652('0x165')][_0x7bbc78])&&_0x7bbc78!=='id'&&_0x7bbc78!==_0x7652('0x17c')&&_0x7bbc78!==_0x7652('0x17d')&&_0x7bbc78!==_0x7652('0x17e')){_0x2d0b50[util['format']('%s%s',_0x7652('0x17f'),_['toUpper'](_0x7bbc78))]=_0x2fb35f[_0x7652('0x165')][_0x7bbc78];}}}var _0x10870b=_0x509a3b[_0x7652('0x132')](_0x437924['Trunk'])?getCallerId(_0x437924[_0x7652('0x72')][_0x7652('0x180')],_0x437924['dialOriginateCallerIdName'],_0x437924[_0x7652('0x181')]>0x0?getCallerIdRandom(_0x437924[_0x7652('0x57')],_0x437924[_0x7652('0x181')]):_0x437924[_0x7652('0x57')]):getCallerId(_[_0x7652('0xa7')](_0x437924[_0x7652('0x133')])?_0x437924[_0x7652('0x72')][_0x7652('0x180')]:_0x437924[_0x7652('0x133')]['callerid'],_0x437924[_0x7652('0x182')],_0x437924[_0x7652('0x181')]>0x0?getCallerIdRandom(_0x437924[_0x7652('0x57')],_0x437924[_0x7652('0x181')]):_0x437924[_0x7652('0x57')]);if(_0x10870b){_0x2d0b50[_0x7652('0x183')]=_0x509a3b[_0x7652('0x28')][_0x267066][_0x7652('0x184')]=extractCalleridName(_0x10870b);_0x2d0b50[_0x7652('0x185')]=_0x509a3b['actions'][_0x267066][_0x7652('0x186')]=extractCalleridNumber(_0x10870b);}return ami['Action']({'actionid':_0x267066,'action':'originate','channel':_0x509a3b['isTrunkReachable'](_0x437924['Trunk'])?util[_0x7652('0x75')](_0x7652('0x187'),_0x437924['Trunk'][_0x7652('0x40')],isNotNull(_0x437924['dialPrefix'])?_0x437924[_0x7652('0x58')][_0x7652('0x188')]()||'':'',_0x437924[_0x7652('0x189')]>0x0?_0x2fb35f[_0x7652('0x165')]['phone']['substring'](_0x437924['dialCutDigit']):_0x2fb35f[_0x7652('0x165')][_0x7652('0x166')]):util[_0x7652('0x75')](_0x7652('0x187'),_[_0x7652('0xa7')](_0x437924[_0x7652('0x133')])?_0x437924['Trunk']['name']:_0x437924['TrunkBackup'][_0x7652('0x40')],isNotNull(_0x437924[_0x7652('0x58')])?_0x437924['dialPrefix'][_0x7652('0x188')]()||'':'',_0x437924[_0x7652('0x189')]>0x0?_0x2fb35f[_0x7652('0x165')][_0x7652('0x166')][_0x7652('0x18a')](_0x437924['dialCutDigit']):_0x2fb35f[_0x7652('0x165')][_0x7652('0x166')]),'callerid':_0x10870b,'Exten':_0x7652('0xd5'),'Context':_0x7652('0x18b'),'Priority':'1','variable':_0x2d0b50,'timeout':(_0x437924[_0x7652('0x18c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x267066})['then'](function(_0x5dca19){return _0x1ca906(_0x5dca19);})[_0x7652('0xaa')](function(_0x2657c9){_0x437924[_0x7652('0x18d')]+=0x1;var _0x5ac4df=new History(_0x509a3b['actions'][_0x267066]);logger[_0x7652('0x90')](util[_0x7652('0x75')]('[originateError]:\x20%s',JSON['stringify'](_0x2657c9)));_0x5ac4df[_0x7652('0x9f')]=0xe;_0x5ac4df[_0x7652('0xa0')]='OriginateError';_0x5ac4df[_0x7652('0xa2')]=moment()[_0x7652('0x75')]('YYYY-MM-DD\x20HH:mm:ss');_0x5ac4df['endtime']=_0x5ac4df['starttime'];_0x509a3b[_0x7652('0xc1')](_0x5ac4df)[_0x7652('0xaa')](loggerCatch(_0x7652('0x18e')));_0x509a3b[_0x7652('0xbf')](_0x5ac4df)[_0x7652('0xaa')](loggerCatch(_0x7652('0x18e')))[_0x7652('0x20')](function(){delete _0x509a3b[_0x7652('0x28')][_0x267066];return _0x17dc1e(msgResponse(_0x7652('0x167'),'Error',_0x7652('0x18f')));});});});};Dialer[_0x7652('0x1d')][_0x7652('0x190')]=function(_0xd60ba4){var _0x55f855=this[_0x7652('0x28')][_0xd60ba4[_0x7652('0x11c')]];if(_0x55f855){delete this[_0x7652('0x28')][_0xd60ba4[_0x7652('0x11c')]];_0x55f855[_0x7652('0x10a')]=moment()[_0x7652('0x75')](_0x7652('0xf2'));var _0x4c2269=_0x55f855[_0x7652('0x4b')]===_0x7652('0x78')?this[_0x7652('0x23')][_0x55f855[_0x7652('0xae')]]:this['voiceQueues'][_0x55f855[_0x7652('0x191')]()];if(!this[_0x7652('0xce')](_0xd60ba4[_0x7652('0x192')])){this[_0x7652('0xac')](_0x4c2269);return this['callProgressDetecting'](_0x55f855,_0x4c2269,_0xd60ba4)[_0x7652('0xaa')](loggerCatch(_0x7652('0x193')));}this['uniqueId'][_0xd60ba4[_0x7652('0xd2')]]=_0x55f855;}};Dialer[_0x7652('0x1d')][_0x7652('0x194')]=function(_0x21033c,_0x135b2e,_0x466568){var _0x44ceb5=new History(_0x135b2e);if(_0x44ceb5['countbusyretry']+_0x44ceb5[_0x7652('0xe6')]+_0x44ceb5[_0x7652('0xe7')]+_0x44ceb5[_0x7652('0xe8')]+_0x44ceb5[_0x7652('0xe9')]+_0x44ceb5[_0x7652('0xea')]+_0x44ceb5[_0x7652('0xe2')]+_0x44ceb5['countagentrejectretry']>=_0x466568['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x21033c){case 0x3:if(_0x44ceb5[_0x7652('0xe7')]>=_0x466568[_0x7652('0x195')]-0x1){return!![];}this[_0x7652('0xf9')]({'active':![],'countnoanswerretry':_0x44ceb5[_0x7652('0xe7')]+=0x1,'scheduledat':moment()['add'](_0x466568[_0x7652('0x196')],_0x7652('0xf1'))[_0x7652('0x75')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x44ceb5[_0x7652('0xc8')],'ListId':_0x44ceb5[_0x7652('0xc9')],'VoiceQueueId':_0x44ceb5[_0x7652('0xcb')]||undefined,'CampaignId':_0x44ceb5[_0x7652('0xcc')]||undefined})[_0x7652('0xaa')](loggerCatch(_0x7652('0x197')));break;case 0x5:if(_0x44ceb5[_0x7652('0xe5')]>=_0x466568['dialBusyMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x44ceb5[_0x7652('0xe5')]+=0x1,'scheduledat':moment()[_0x7652('0xfa')](_0x466568[_0x7652('0x198')],_0x7652('0xf1'))[_0x7652('0x75')](_0x7652('0xf2')),'ContactId':_0x44ceb5[_0x7652('0xc8')],'ListId':_0x44ceb5[_0x7652('0xc9')],'VoiceQueueId':_0x44ceb5['VoiceQueueId']||undefined,'CampaignId':_0x44ceb5[_0x7652('0xcc')]||undefined})[_0x7652('0xaa')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x44ceb5[_0x7652('0xe6')]>=_0x466568[_0x7652('0x199')]-0x1){return!![];}this[_0x7652('0xf9')]({'active':![],'countcongestionretry':_0x44ceb5[_0x7652('0xe6')]+=0x1,'scheduledat':moment()[_0x7652('0xfa')](_0x466568[_0x7652('0x19a')],_0x7652('0xf1'))[_0x7652('0x75')](_0x7652('0xf2')),'ContactId':_0x44ceb5[_0x7652('0xc8')],'ListId':_0x44ceb5[_0x7652('0xc9')],'VoiceQueueId':_0x44ceb5['VoiceQueueId']||undefined,'CampaignId':_0x44ceb5['CampaignId']||undefined})[_0x7652('0xaa')](loggerCatch(_0x7652('0x19b')));break;case 0x0:if(_0x44ceb5[_0x7652('0xe8')]>=_0x466568[_0x7652('0x19c')]-0x1){return!![];}else{this[_0x7652('0xf9')]({'active':![],'countnosuchnumberretry':_0x44ceb5[_0x7652('0xe8')]+=0x1,'scheduledat':moment()[_0x7652('0xfa')](_0x466568[_0x7652('0x19d')],_0x7652('0xf1'))['format'](_0x7652('0xf2')),'ContactId':_0x44ceb5['ContactId'],'ListId':_0x44ceb5['ListId'],'VoiceQueueId':_0x44ceb5[_0x7652('0xcb')]||undefined,'CampaignId':_0x44ceb5[_0x7652('0xcc')]||undefined})['catch'](loggerCatch(_0x7652('0x19e')));}break;case 0xa:if(_0x44ceb5['countdropretry']>=_0x466568[_0x7652('0x10f')]-0x1){return!![];}this[_0x7652('0xf9')]({'active':![],'countdropretry':_0x44ceb5['countdropretry']+=0x1,'scheduledat':moment()[_0x7652('0xfa')](_0x466568[_0x7652('0x110')],_0x7652('0xf1'))['format'](_0x7652('0xf2')),'ContactId':_0x44ceb5[_0x7652('0xc8')],'ListId':_0x44ceb5['ListId'],'VoiceQueueId':_0x44ceb5[_0x7652('0xcb')]||undefined,'CampaignId':_0x44ceb5['CampaignId']||undefined})[_0x7652('0xaa')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x44ceb5[_0x7652('0xea')]>=_0x466568[_0x7652('0x116')]-0x1){return!![];}this[_0x7652('0xf9')]({'active':![],'countabandonedretry':_0x44ceb5['countabandonedretry']+=0x1,'scheduledat':moment()[_0x7652('0xfa')](_0x466568[_0x7652('0x117')],_0x7652('0xf1'))[_0x7652('0x75')](_0x7652('0xf2')),'ContactId':_0x44ceb5['ContactId'],'ListId':_0x44ceb5['ListId'],'VoiceQueueId':_0x44ceb5[_0x7652('0xcb')]||undefined,'CampaignId':_0x44ceb5[_0x7652('0xcc')]||undefined})[_0x7652('0xaa')](loggerCatch(_0x7652('0x19f')));break;case 0x13:if(_0x44ceb5[_0x7652('0xe2')]>=_0x466568[_0x7652('0xed')]-0x1){return!![];}this[_0x7652('0xf9')]({'active':![],'countmachineretry':_0x44ceb5[_0x7652('0xe2')]+=0x1,'scheduledat':moment()[_0x7652('0xfa')](_0x466568[_0x7652('0xf0')],_0x7652('0xf1'))[_0x7652('0x75')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x44ceb5[_0x7652('0xc8')],'ListId':_0x44ceb5['ListId'],'VoiceQueueId':_0x44ceb5[_0x7652('0xcb')]||undefined,'CampaignId':_0x44ceb5[_0x7652('0xcc')]||undefined})[_0x7652('0xaa')](loggerCatch(_0x7652('0xf3')));break;case 0x14:if(_0x44ceb5[_0x7652('0xeb')]>=_0x466568[_0x7652('0x1a0')]-0x1){return!![];}this[_0x7652('0xf9')]({'active':![],'countagentrejectretry':_0x44ceb5[_0x7652('0xeb')]+=0x1,'scheduledat':moment()['add'](_0x466568['dialAgentRejectRetryFrequency'],_0x7652('0xf1'))[_0x7652('0x75')](_0x7652('0xf2')),'ContactId':_0x44ceb5['ContactId'],'ListId':_0x44ceb5[_0x7652('0xc9')],'VoiceQueueId':_0x44ceb5[_0x7652('0xcb')]||undefined,'CampaignId':_0x44ceb5[_0x7652('0xcc')]||undefined})[_0x7652('0xaa')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x7652('0x1d')]['callProgressDetecting']=function(_0x108d6b,_0x484349,_0x137de0){var _0x4490b2=this;var _0x6ef7b5=new History(_0x108d6b);return new BPromise(function(_0x303670,_0xbdd465){if(_['isUndefined'](_0x484349)&&typeof _0x484349!==_0x7652('0x164')){return _0xbdd465(msgResponse(_0x7652('0x1a1'),_0x7652('0x139'),_0x7652('0x1a2')));}if(_[_0x7652('0x3d')](_0x137de0)&&typeof _0x137de0!=='object'){return _0xbdd465(msgResponse('[callProgressDetecting]',_0x7652('0x139'),'evt\x20is\x20undefine'));}switch(_0x137de0[_0x7652('0x100')]){case'0':_0x484349['outboundNoSuchCallsDay']+=0x1;_0x6ef7b5[_0x7652('0x9f')]=0x0;_0x6ef7b5[_0x7652('0xa0')]=_0x7652('0x1a3');_0x6ef7b5[_0x7652('0xe8')]+=0x1;_0x6ef7b5[_0x7652('0xf6')]+=0x1;ami['emit'](_0x7652('0x1a4'),ut[_0x7652('0xe3')](_0x108d6b,_0x7652('0x1a5')));_0x4490b2[_0x7652('0xc1')](_0x6ef7b5)[_0x7652('0xaa')](loggerCatch(_0x7652('0xe4')));if(_0x4490b2[_0x7652('0x194')](0x0,_0x108d6b,_0x484349)){if(_0x6ef7b5[_0x7652('0xe8')]>=_0x484349['dialNoSuchNumberMaxRetry']){_0x4490b2[_0x7652('0xee')](_0x6ef7b5,_0x303670,_0xbdd465,_0x7652('0x1a6'));}else{_0x4490b2[_0x7652('0xf7')](_0x6ef7b5,_0x303670,_0xbdd465,_0x7652('0x1a6'));}}break;case'3':_0x484349[_0x7652('0x60')]+=0x1;_0x6ef7b5[_0x7652('0x9f')]=0x3;_0x6ef7b5[_0x7652('0xa0')]=_0x7652('0x1a7');_0x6ef7b5[_0x7652('0xe7')]+=0x1;_0x6ef7b5[_0x7652('0xf6')]+=0x1;ami[_0x7652('0x4a')](_0x7652('0x1a8'),ut[_0x7652('0xe3')](_0x108d6b,_0x7652('0x1a9')));_0x4490b2[_0x7652('0xc1')](_0x6ef7b5)[_0x7652('0xaa')](loggerCatch(_0x7652('0x1aa')));if(_0x4490b2[_0x7652('0x194')](0x3,_0x108d6b,_0x484349)){if(_0x6ef7b5[_0x7652('0xe7')]>=_0x484349[_0x7652('0x195')]){_0x4490b2['createStateFinal'](_0x6ef7b5,_0x303670,_0xbdd465,_0x7652('0x1ab'));}else{_0x4490b2['stateGlobal'](_0x6ef7b5,_0x303670,_0xbdd465,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x484349[_0x7652('0x5c')]+=0x1;_0x6ef7b5['state']=0x5;_0x6ef7b5[_0x7652('0xa0')]='Busy';_0x6ef7b5[_0x7652('0xe5')]+=0x1;_0x6ef7b5['countglobal']+=0x1;ami[_0x7652('0x4a')](_0x7652('0x1ac'),ut['buildObj'](_0x108d6b,'busy'));_0x4490b2[_0x7652('0xc1')](_0x6ef7b5)[_0x7652('0xaa')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x4490b2['checkRetriveMax'](0x5,_0x108d6b,_0x484349)){if(_0x6ef7b5['countbusyretry']>=_0x484349[_0x7652('0x1ad')]){_0x4490b2[_0x7652('0xee')](_0x6ef7b5,_0x303670,_0xbdd465,_0x7652('0x1ae'));}else{_0x4490b2[_0x7652('0xf7')](_0x6ef7b5,_0x303670,_0xbdd465,_0x7652('0x1ae'));}}break;case'8':_0x484349['outboundCongestionCallsDay']+=0x1;_0x6ef7b5['state']=0x8;_0x6ef7b5['statedesc']=_0x7652('0x1af');_0x6ef7b5[_0x7652('0xe6')]+=0x1;_0x6ef7b5[_0x7652('0xf6')]+=0x1;ami[_0x7652('0x4a')](_0x7652('0x1b0'),ut[_0x7652('0xe3')](_0x108d6b,_0x7652('0x1b1')));_0x4490b2[_0x7652('0xc1')](_0x6ef7b5)[_0x7652('0xaa')](loggerCatch(_0x7652('0x1b2')));if(_0x4490b2[_0x7652('0x194')](0x8,_0x108d6b,_0x484349)){if(_0x6ef7b5[_0x7652('0xe6')]>=_0x484349[_0x7652('0x199')]){_0x4490b2[_0x7652('0xee')](_0x6ef7b5,_0x303670,_0xbdd465,'reason\x208\x20congestion');}else{_0x4490b2[_0x7652('0xf7')](_0x6ef7b5,_0x303670,_0xbdd465,_0x7652('0x1b3'));}}break;case'11':_0x484349[_0x7652('0x1b4')]+=0x1;_0x6ef7b5[_0x7652('0x9f')]=0xb;_0x6ef7b5[_0x7652('0xa0')]=_0x7652('0x118');_0x6ef7b5[_0x7652('0xea')]+=0x1;_0x6ef7b5['countglobal']+=0x1;_0x4490b2[_0x7652('0xc1')](_0x6ef7b5)[_0x7652('0xaa')](loggerCatch(_0x7652('0x119')));if(_0x4490b2['checkRetriveMax'](0xb,_0x108d6b,_0x484349)){if(_0x6ef7b5[_0x7652('0xea')]>=_0x484349[_0x7652('0x116')]){_0x4490b2[_0x7652('0xee')](_0x6ef7b5,_0x303670,_0xbdd465,_0x7652('0x1b5'));}else{_0x4490b2[_0x7652('0xf7')](_0x6ef7b5,_0x303670,_0xbdd465,'reason\x2011\x20abandoned');}}break;case'20':_0x484349[_0x7652('0x62')]+=0x1;_0x6ef7b5[_0x7652('0x9f')]=0x14;_0x6ef7b5[_0x7652('0xa0')]=_0x7652('0x1b6');_0x6ef7b5[_0x7652('0xeb')]+=0x1;_0x6ef7b5['countglobal']+=0x1;ami[_0x7652('0x4a')](_0x7652('0x1b7'),ut[_0x7652('0xe3')](_0x108d6b,_0x7652('0x1b8')));_0x4490b2[_0x7652('0xc1')](_0x6ef7b5)[_0x7652('0xaa')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x4490b2[_0x7652('0x194')](0x14,_0x108d6b,_0x484349)){if(_0x6ef7b5[_0x7652('0xeb')]>=_0x484349[_0x7652('0x1a0')]){_0x4490b2[_0x7652('0xee')](_0x6ef7b5,_0x303670,_0xbdd465,_0x7652('0x1b9'));}else{_0x4490b2['stateGlobal'](_0x6ef7b5,_0x303670,_0xbdd465,_0x7652('0x1b9'));}}break;default:_0x484349[_0x7652('0x1ba')]+=0x1;_0x6ef7b5[_0x7652('0x9f')]=0xc;_0x6ef7b5[_0x7652('0xa0')]=_0x137de0[_0x7652('0x100')];_0x4490b2[_0x7652('0xc1')](_0x6ef7b5)[_0x7652('0xaa')](loggerCatch(_0x7652('0x1bb')));if(_0x4490b2[_0x7652('0x194')](_0x137de0[_0x7652('0x100')],_0x108d6b,_0x484349)){if(_0x6ef7b5[_0x7652('0xe5')]+_0x6ef7b5['countcongestionretry']+_0x6ef7b5[_0x7652('0xe7')]+_0x6ef7b5[_0x7652('0xe8')]+_0x6ef7b5[_0x7652('0xe9')]+_0x6ef7b5['countabandonedretry']+_0x6ef7b5[_0x7652('0xe2')]+_0x6ef7b5['countagentrejectretry']>=_0x484349[_0x7652('0xec')]){_0x4490b2[_0x7652('0xf7')](_0x6ef7b5,_0x303670,_0xbdd465,_0x137de0['reason']);}else{_0x4490b2['createStateFinal'](_0x6ef7b5,_0x303670,_0xbdd465,_0x137de0['reason']);}}}});};Dialer[_0x7652('0x1d')]['stateGlobal']=function(_0xea873b,_0x13441f,_0x340d6e,_0x2a1f3a){var _0x1339c1=new Final(_0xea873b);_0x1339c1[_0x7652('0x9f')]=0xf;_0x1339c1[_0x7652('0xa0')]=_0x7652('0x1bc');this[_0x7652('0xee')](_0x1339c1,_0x13441f,_0x340d6e,_0x2a1f3a);};Dialer[_0x7652('0x1d')]['createStateFinal']=function(_0x50529d,_0x714c21,_0x237005,_0x534920){this['moveContactManagedDialer'](_0x50529d)['then'](function(){return _0x714c21(msgResponse(_0x7652('0x1a1'),'Success',_0x534920));})[_0x7652('0xaa')](function(){return _0x237005(msgResponse(_0x7652('0x1bd'),'Failure',_0x7652('0x1be')));});};Dialer[_0x7652('0x1d')][_0x7652('0x8')]=function(_0x478b2e){var _0x33f477=_0x478b2e['dialPredictiveOptimizationPercentage']/0x64;var _0x358593=_0x478b2e[_0x7652('0x1bf')]/(_0x478b2e[_0x7652('0x1bf')]+_0x478b2e[_0x7652('0x5a')]);var _0x48578f=Math[_0x7652('0x1c0')](_0x478b2e[_0x7652('0x6b')]*(_0x478b2e[_0x7652('0x1c1')]/0x64));var _0x963fe0=Math[_0x7652('0x1c0')](_0x478b2e['predictiveIntervalAvailable']*(_0x478b2e['predictiveIntervalMinThreshold']/0x64));var _0x3cb6df=_0x478b2e['available']+_0x478b2e[_0x7652('0x97')];var _0x4c112a=Math[_0x7652('0x1c2')](_0x478b2e[_0x7652('0x6d')]*_0x478b2e[_0x7652('0x6f')]*_0x478b2e[_0x7652('0x68')]*_0x478b2e['predictiveIntervalMultiplicativeFactor']);if(_[_0x7652('0x3d')](_0x478b2e[_0x7652('0x2b')])){if(!_[_0x7652('0x3d')](_0x478b2e['startPredictive'])){_0x478b2e[_0x7652('0x71')]=undefined;loggerPredictive['error'](_0x7652('0x1c3'),_0x7652('0x1c4'));}if(!_[_0x7652('0x3d')](_0x478b2e[_0x7652('0x8c')])){loggerPredictive[_0x7652('0x90')](_0x7652('0x1c3'),_0x7652('0x1c5'));clearInterval(_0x478b2e[_0x7652('0x8c')]);_0x478b2e[_0x7652('0x8c')]=undefined;}_0x478b2e[_0x7652('0x2b')]=moment()[_0x7652('0x75')](_0x7652('0xf2'));loggerPredictive[_0x7652('0x7c')](_0x478b2e[_0x7652('0x40')],_0x7652('0x1c6'),_0x478b2e['startProgressive']);this[_0x7652('0x14e')](_0x478b2e,0x1);}else if(ifInterval(_0x478b2e[_0x7652('0x1c7')],_0x478b2e[_0x7652('0x2b')])){this['handlePower'](_0x478b2e,0x1);loggerPredictiveCalls[_0x7652('0x7c')]('[startMethodPredictive][StartProgressive][Loop]',_0x478b2e[_0x7652('0x2b')],_0x478b2e[_0x7652('0x40')]);_0x478b2e[_0x7652('0x6d')]=0x0;_0x478b2e[_0x7652('0x67')]=0x0;}else if(_0x33f477<_0x358593&&_0x478b2e['dialPredictiveOptimization']===_0x7652('0x1c8')){freeVariablesPredictive(_0x478b2e);loggerPredictive['info'](_0x7652('0x1c9'),_0x7652('0x1ca'),_0x358593,_0x7652('0x2b'),_0x478b2e[_0x7652('0x40')]);}else if(_0x4c112a<_0x478b2e[_0x7652('0x67')]&&_0x478b2e[_0x7652('0x1cb')]===_0x7652('0x1c8')){freeVariablesPredictive(_0x478b2e);loggerPredictive[_0x7652('0x7c')](_0x7652('0x1cc'),_0x7652('0x1cd'),_0x4c112a,_0x7652('0x1ce'),_0x478b2e[_0x7652('0x67')],_0x7652('0x2b'),_0x478b2e['name']);}else if(!ifInterval(_0x478b2e[_0x7652('0x1c7')],_0x478b2e[_0x7652('0x2b')])&&_[_0x7652('0x3d')](_0x478b2e[_0x7652('0x71')])&&!_[_0x7652('0x3d')](_0x478b2e[_0x7652('0x2b')])){_0x478b2e[_0x7652('0x71')]=moment()[_0x7652('0x75')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x478b2e[_0x7652('0x40')],'started\x20in\x20predictive\x20at',_0x478b2e[_0x7652('0x71')]);this[_0x7652('0x1cf')](_0x478b2e['dialPredictiveInterval'])[_0x7652('0x3b')](this[_0x7652('0x1d0')](_0x478b2e))['then'](mergeDataErlangB(_0x478b2e))[_0x7652('0x3b')](this[_0x7652('0x1d1')](_0x478b2e))[_0x7652('0xaa')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x478b2e));}else if(!ifInterval(_0x478b2e['dialPredictiveInterval'],_0x478b2e[_0x7652('0x71')])){_0x478b2e[_0x7652('0x67')]=0x0;_0x478b2e['startPredictive']=moment()['format'](_0x7652('0xf2'));loggerPredictive['info'](_0x478b2e[_0x7652('0x40')],'recalculate\x20predictive\x20at',_0x478b2e[_0x7652('0x71')]);clearInterval(_0x478b2e[_0x7652('0x8c')]);_0x478b2e['handlePredictive']=undefined;this[_0x7652('0x1cf')](_0x478b2e['dialPredictiveInterval'])[_0x7652('0x3b')](this[_0x7652('0x1d0')](_0x478b2e))[_0x7652('0x3b')](mergeDataErlangB(_0x478b2e))[_0x7652('0x3b')](this[_0x7652('0x1d1')](_0x478b2e))[_0x7652('0xaa')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x478b2e));}else if(_0x478b2e[_0x7652('0x6b')]&&_0x3cb6df<_0x478b2e['predictiveIntervalAvailable']-_0x963fe0){freeVariablesPredictive(_0x478b2e);loggerPredictive[_0x7652('0x7c')](_0x478b2e[_0x7652('0x40')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x3cb6df,_0x7652('0x1d2'),_0x478b2e['predictiveIntervalAvailable'],'-',_0x963fe0,'=',_0x478b2e[_0x7652('0x6b')]-_0x963fe0,')');}else if(_0x478b2e[_0x7652('0x6b')]&&_0x3cb6df>_0x478b2e['predictiveIntervalAvailable']+_0x48578f){freeVariablesPredictive(_0x478b2e);loggerPredictive['info'](_0x478b2e[_0x7652('0x40')],_0x7652('0x1d3'),_0x3cb6df,_0x7652('0x1d4'),_0x478b2e[_0x7652('0x6b')],'+',_0x48578f,'=',_0x478b2e[_0x7652('0x6b')]+_0x48578f,')');}};Dialer[_0x7652('0x1d')][_0x7652('0x1d0')]=function(_0x4070b6){var _0x1441e5=this;return function(_0xc5005f){return new BPromise(function(_0xaba717,_0x2bd3cb){_[_0x7652('0xc6')](_0x4070b6,_0xc5005f[0x0]);if(checkGetDataPredictive(_0xc5005f[0x0])){var _0x436f3d=_0x4070b6[_0x7652('0x6b')]=_0x4070b6[_0x7652('0x97')]+_0x4070b6[_0x7652('0x4f')];var _0x4e429a=_0x4070b6[_0x7652('0x1c7')]*0x3c;var _0x381aae=_0xc5005f[0x0][_0x7652('0x64')]+_0xc5005f[0x0][_0x7652('0x83')];var _0x54a34d=(_0xc5005f[0x0][_0x7652('0x63')]+_0xc5005f[0x0][_0x7652('0x65')]+_0xc5005f[0x0][_0x7652('0x7f')])/_0xc5005f[0x0][_0x7652('0x7d')];_0x4070b6['predictiveIntervalHitRate']=_0x54a34d>0x0?_0x54a34d:0x1;switch(_0x4070b6[_0x7652('0x1cb')]){case _0x7652('0x1c8'):var _0xc32839=_0x4070b6[_0x7652('0x1d5')]/0x64;return _0x1441e5['abandonmentRate'](_0x436f3d,_0x4e429a,_0x381aae,_0x54a34d,_0xc32839)[_0x7652('0x3b')](function(_0x544e8f){return _0xaba717(_0x544e8f);});case _0x7652('0x1d6'):var _0x210ac2=_0x4070b6['dialPredictiveOptimizationPercentage']/0x64;return _0x1441e5['busyFactor'](_0x436f3d,_0x4e429a,_0x381aae,_0x54a34d,_0x210ac2)['then'](function(_0x4d0cfc){return _0xaba717(_0x4d0cfc);});default:return _0x2bd3cb(msgResponse(_0x7652('0x1d7'),_0x7652('0x139'),_0x7652('0x1d8')));}}else{return _0x2bd3cb(msgResponse(_0x7652('0x1d7'),'Failure',_0x7652('0x1d9')));}});};};Dialer[_0x7652('0x1d')]['getDataPredictiveOld']=function(_0x375956){var _0x2dd81c=this;return function(_0x29d42a){return new BPromise(function(_0x52d6ef,_0x4e1aaa){_[_0x7652('0xc6')](_0x375956,_0x29d42a[0x0]);if(checkGetDataPredictive(_0x29d42a[0x0])){loggerPredictive[_0x7652('0x7c')](JSON['stringify'](_0x29d42a[0x0]));if(_0x375956[_0x7652('0x1cb')]===_0x7652('0x1c8')){return _0x2dd81c[_0x7652('0xbe')](_0x375956['id'])[_0x7652('0x3b')](function(_0x230e21){var _0x5715f1=_0x375956['loggedIn']-_0x230e21[0x0][_0x7652('0x1da')];var _0x473c75=_0x375956[_0x7652('0x1c7')]*0x3c;var _0x102583=_0x29d42a[0x0][_0x7652('0x64')]+_0x29d42a[0x0][_0x7652('0x83')];var _0x27de09=(_0x29d42a[0x0][_0x7652('0x63')]+_0x29d42a[0x0][_0x7652('0x65')]+_0x29d42a[0x0][_0x7652('0x7f')])/_0x29d42a[0x0][_0x7652('0x7d')];var _0x3af5e5=_0x375956[_0x7652('0x1d5')]/0x64;_0x375956[_0x7652('0x6a')]=_0x230e21[0x0]['outboundQueuePauses']||0x0;_0x375956[_0x7652('0x68')]=_0x27de09>0x0?_0x27de09:0x1;return _0x2dd81c[_0x7652('0x1db')](_0x5715f1,_0x473c75,_0x102583,_0x27de09,_0x3af5e5);})[_0x7652('0x3b')](function(_0x375903){return _0x52d6ef(_0x375903);})['catch'](function(_0x4115ad){return _0x4e1aaa(msgResponse(_0x7652('0x1dc'),_0x7652('0x139'),JSON[_0x7652('0x74')](_0x4115ad)));});}if(_0x375956[_0x7652('0x1cb')]===_0x7652('0x1d6')){return _0x2dd81c['getVoiceQueueRtPauses'](_0x375956['id'])[_0x7652('0x3b')](function(_0x408c3f){var _0x129b53=_0x375956[_0x7652('0x50')]-_0x408c3f[0x0][_0x7652('0x1da')];var _0x3e5dcb=_0x375956[_0x7652('0x1c7')]*0x3c;var _0x1edcdb=_0x29d42a[0x0][_0x7652('0x64')]+_0x29d42a[0x0]['predictiveIntervalAvgHoldtime'];var _0x4f5a56=(_0x29d42a[0x0]['predictiveIntervalAnsweredCalls']+_0x29d42a[0x0][_0x7652('0x65')]+_0x29d42a[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x29d42a[0x0][_0x7652('0x7d')];var _0x20fa4b=_0x375956[_0x7652('0x1d5')]/0x64;_0x375956[_0x7652('0x6a')]=_0x408c3f[0x0][_0x7652('0x1da')]||0x0;_0x375956[_0x7652('0x68')]=_0x4f5a56>0x0?_0x4f5a56:0x1;return _0x2dd81c['busyFactor'](_0x129b53,_0x3e5dcb,_0x1edcdb,_0x4f5a56,_0x20fa4b);})['then'](function(_0x447aa4){return _0x52d6ef(_0x447aa4);})[_0x7652('0xaa')](function(_0x311d16){return _0x4e1aaa(msgResponse(_0x7652('0x1dc'),_0x7652('0x139'),JSON[_0x7652('0x74')](_0x311d16)));});}}else{return _0x4e1aaa(msgResponse('[getDataPredictive]',_0x7652('0x139'),_0x7652('0x1d9')));}});};};Dialer[_0x7652('0x1d')][_0x7652('0x1d1')]=function(_0x5a49da){var _0x4a00e2=this;return function(){var _0xcb3664=0x0;var _0x4d733f=Math[_0x7652('0x1c2')](_0x5a49da[_0x7652('0x6e')]*0x3e8);if(_0x4d733f>0x0){_0x4d733f=_0x4d733f<0x64?0x64:_0x4d733f;loggerPredictive[_0x7652('0x7c')](_0x5a49da[_0x7652('0x40')],'one\x20call\x20every:',_0x4d733f,'milliseconds');_0x5a49da['handlePredictive']=setInterval(function(){_0x4a00e2[_0x7652('0x8c')](_0x5a49da);loggerPredictiveCalls[_0x7652('0x7c')](_0x7652('0x1dd'),_0xcb3664+=0x1);},_0x4d733f);}else{loggerPredictive[_0x7652('0x7c')](_0x5a49da[_0x7652('0x40')],_0x7652('0x1de'));}};};Dialer[_0x7652('0x1d')]['checkContactBlack']=function(_0x54c14f,_0xb4e48e){var _0x4a2672=this;return function(_0x592f86){if(_['isEmpty'](_0x592f86)){if(_[_0x7652('0xa7')](_0xb4e48e[_0x7652('0xca')])||!_0xb4e48e[_0x7652('0x1df')]){if(_0x54c14f['dialMethod']===_0x7652('0x1e0')){_0x54c14f[_0x7652('0x124')]=_['isUndefined'](_0x54c14f[_0x7652('0x124')])?!![]:_0x54c14f['queueStatusComplete'];var _0x3f2edb=uuid['v4']();_0x4a2672['actions'][_0x3f2edb]=new Action(_0x54c14f,_0xb4e48e,_0x3f2edb);loggerBooked['info'](_0x7652('0x1e1'),_0x3f2edb,_0x7652('0x1e2'),JSON['stringify'](_0x54c14f[_0x7652('0x124')]),_0x7652('0x1e3'),_0x54c14f[_0x7652('0x40')]);if(_0x54c14f[_0x7652('0x124')]){_0x54c14f[_0x7652('0x124')]=![];_0x4a2672['queueBooked'][_0x4a2672[_0x7652('0x28')][_0x3f2edb][_0x7652('0xae')]]=[];ami[_0x7652('0xa8')]({'actionid':_0x3f2edb,'action':'queuestatus','queue':_0x54c14f[_0x7652('0x40')]})['catch'](function(){_0x4a2672[_0x7652('0xac')](_0x54c14f);_0x4a2672[_0x7652('0xf9')]({'active':![],'ContactId':_0x4a2672[_0x7652('0x28')][_0x3f2edb][_0x7652('0xc8')],'ListId':_0x4a2672[_0x7652('0x28')][_0x3f2edb]['ListId'],'VoiceQueueId':_0x4a2672[_0x7652('0x28')][_0x3f2edb][_0x7652('0xcb')]||undefined,'CampaignId':_0x4a2672[_0x7652('0x28')][_0x3f2edb][_0x7652('0xcc')]||undefined})[_0x7652('0xaa')](loggerCatch(_0x7652('0x1e4')));delete _0x4a2672[_0x7652('0x28')][_0x3f2edb];});}else{loggerBooked[_0x7652('0x7c')](_0x7652('0x1e5'),JSON['stringify'](_0x54c14f[_0x7652('0x124')]),_0x7652('0x1e3'),_0x54c14f[_0x7652('0x40')]);_0x4a2672[_0x7652('0xac')](_0x54c14f);_0x4a2672[_0x7652('0xf9')]({'active':![],'ContactId':_0x4a2672[_0x7652('0x28')][_0x3f2edb]['ContactId'],'ListId':_0x4a2672[_0x7652('0x28')][_0x3f2edb][_0x7652('0xc9')],'VoiceQueueId':_0x4a2672[_0x7652('0x28')][_0x3f2edb][_0x7652('0xcb')]||undefined,'CampaignId':_0x4a2672[_0x7652('0x28')][_0x3f2edb][_0x7652('0xcc')]||undefined})[_0x7652('0xaa')](loggerCatch(_0x7652('0x1e4')));delete _0x4a2672['actions'][_0x3f2edb];}}else{return _0x4a2672[_0x7652('0x1e6')](_0x54c14f,_0xb4e48e);}}else{if(getDiff(_0xb4e48e[_0x7652('0x1e7')])<_0x54c14f[_0x7652('0x1e8')]*0x3c){if(_0xb4e48e[_0x7652('0x154')]&&!_0xb4e48e[_0x7652('0x154')][_0x7652('0x1e9')]){_0x4a2672[_0x7652('0x1ea')][_0x7652('0x125')](_0xb4e48e['id'])[_0x7652('0x20')](function(){_0x4a2672[_0x7652('0xac')](_0x54c14f);});}else{_0x4a2672[_0x7652('0x1eb')]({'active':![]},_0xb4e48e['id'],0x1)[_0x7652('0x20')](function(){_0x4a2672[_0x7652('0xac')](_0x54c14f);});}}else{_0x54c14f[_0x7652('0x1ec')]+=0x1;_0x4a2672[_0x7652('0xac')](_0x54c14f);if(_0x54c14f[_0x7652('0x1ed')]){_0x4a2672[_0x7652('0xf9')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0xb4e48e[_0x7652('0xc8')],'ListId':_0xb4e48e['ListId'],'VoiceQueueId':_0xb4e48e[_0x7652('0xcb')]||undefined,'CampaignId':_0xb4e48e['CampaignId']||undefined})[_0x7652('0xaa')](loggerCatch(_0x7652('0x1ee')));_0x4a2672[_0x7652('0xc1')](createObjHistory(_0x54c14f,_0xb4e48e,_0x7652('0x1ef'),0x17,'RecallInQueue'))[_0x7652('0xaa')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x4a2672['saveInDb'](createObjHistory(_0x54c14f,_0xb4e48e,_0x7652('0x1f0'),0x16,'RecallFailedTimeout'),_0x7652('0x1f1'),_0x7652('0x1f2'));}}}}else{_0x54c14f[_0x7652('0x5b')]+=0x1;_0x4a2672[_0x7652('0xc5')](createObjHistory(_0x54c14f,_0xb4e48e,_0x7652('0x1f3'),0xd,_0x7652('0x1f4')),_0x7652('0x1f5'),_0x7652('0x1f6'));throw _0x7652('0x1f7');}};};Dialer[_0x7652('0x1d')]['handleIvr']=function(_0x34df91){var _0x430ce8=this;var _0x55881d=_0x34df91[_0x7652('0x1f8')]-_0x34df91[_0x7652('0x6c')]-_0x34df91[_0x7652('0xbb')];emitCampaignSummary(_0x34df91);if(_0x55881d>0x0){if(_0x55881d>this['maxNumberOriginate']){_0x55881d=this[_0x7652('0x26')];}_0x34df91['temp']+=_0x55881d;this[_0x7652('0xbc')](_0x34df91['id'],_0x55881d,_0x34df91[_0x7652('0x1f9')],_0x34df91)[_0x7652('0x3b')](function(_0x549943){_0x34df91[_0x7652('0xbb')]-=_0x55881d;_0x34df91[_0x7652('0xbb')]=_0x34df91['temp']>0x0?_0x34df91[_0x7652('0xbb')]:0x0;if(!checkContactEmpty(_0x549943)){_0x34df91[_0x7652('0x3e')]=_0x7652('0x96');logger[_0x7652('0x7c')](_0x7652('0x1fa')+_0x34df91[_0x7652('0x40')]);}else{_0x34df91[_0x7652('0x6c')]+=_0x549943['length'];_0x34df91[_0x7652('0x3e')]=_0x7652('0x1fb');for(var _0x52cf7d=0x0;_0x52cf7d<_0x549943[_0x7652('0x92')];_0x52cf7d+=0x1){_0x34df91[_0x7652('0x1fc')]+=0x1;if(_[_0x7652('0xa7')](_0x549943[_0x52cf7d])||_[_0x7652('0xa7')](_0x549943[_0x52cf7d]['Contact'])||_[_0x7652('0xa7')](_0x549943[_0x52cf7d][_0x7652('0x165')][_0x7652('0x166')])){_0x430ce8[_0x7652('0xc4')](_0x7652('0x1fd'),_0x34df91,_0x549943[_0x52cf7d]);}else{_0x430ce8[_0x7652('0xb5')](_[_0x7652('0xc7')](_0x549943[_0x52cf7d],[_0x7652('0xcc'),_0x7652('0x1fe')]))[_0x7652('0x3b')](_0x430ce8[_0x7652('0x1ff')](_0x34df91,_0x549943[_0x52cf7d]))[_0x7652('0xaa')](_0x430ce8['loggerHandler'](_0x7652('0x200'),_0x34df91));}}}})[_0x7652('0xaa')](loggerGetContactDialer(_0x7652('0x201'),_0x34df91,_0x55881d));}};Dialer[_0x7652('0x1d')][_0x7652('0x14e')]=function(_0x563d3b,_0x130d78){var _0x21bf6c=this;var _0x29ac64=[];var _0x3f9843=_0x130d78>=0x1?_0x130d78:0x1;if(_0x563d3b['dialMethod']==='booked'){_0x3f9843=0x1;}var _0x1e71d4=Math[_0x7652('0x1c2')](_0x563d3b[_0x7652('0x4f')]*_0x3f9843)-_0x563d3b[_0x7652('0x6c')]-_0x563d3b[_0x7652('0xbb')];emitVoiceQueueSummary(_0x563d3b);if(_0x563d3b[_0x7652('0x202')]>0x0){var _0x24f19e=_0x563d3b[_0x7652('0x202')]-_0x563d3b[_0x7652('0x6c')]-_0x563d3b[_0x7652('0x97')]-_0x563d3b[_0x7652('0xbb')]-_0x563d3b[_0x7652('0x51')];if(_0x1e71d4>_0x24f19e){_0x1e71d4=_0x24f19e;}}if(_0x1e71d4>0x0){if(_0x563d3b[_0x7652('0x158')]===_0x7652('0x1e0')){_0x1e71d4=0x1;}if(_0x1e71d4>this[_0x7652('0x26')]){_0x1e71d4=this['maxNumberOriginate'];}_0x563d3b[_0x7652('0xbb')]+=_0x1e71d4;for(var _0x1ae109 in this[_0x7652('0x24')]){if(typeof this['agents'][_0x1ae109]!==_0x7652('0xa6')){if(this[_0x7652('0x24')][_0x1ae109][_0x7652('0x9f')]===_0x7652('0x203')&&this[_0x7652('0x24')][_0x1ae109]['status']===_0x7652('0x204')){_0x29ac64[_0x7652('0x122')](this[_0x7652('0x24')][_0x1ae109]['id']);}}}this[_0x7652('0xba')](_0x563d3b['id'],_0x29ac64,_0x1e71d4,_0x563d3b[_0x7652('0x1f9')],_0x563d3b)[_0x7652('0x3b')](function(_0x4296b2){_0x563d3b[_0x7652('0xbb')]-=_0x1e71d4;_0x563d3b[_0x7652('0xbb')]=_0x563d3b[_0x7652('0xbb')]>0x0?_0x563d3b[_0x7652('0xbb')]:0x0;if(!checkContactEmpty(_0x4296b2)){_0x21bf6c['countReScheduled'](_0x563d3b)[_0x7652('0x3b')](sendMessageReschedule(_0x563d3b))[_0x7652('0xaa')](loggerCatch('[countReScheduled]\x20'));}else{_0x563d3b['originated']+=_0x4296b2[_0x7652('0x92')];_0x563d3b[_0x7652('0x3e')]=_0x563d3b['dialMethod']===_0x7652('0x1e0')?_0x7652('0x205'):_0x7652('0x1fb');for(var _0x37e1c1=0x0;_0x37e1c1<_0x4296b2[_0x7652('0x92')];_0x37e1c1+=0x1){if(_['isNil'](_0x4296b2[_0x37e1c1])||_[_0x7652('0xa7')](_0x4296b2[_0x37e1c1][_0x7652('0x165')])||_[_0x7652('0xa7')](_0x4296b2[_0x37e1c1][_0x7652('0x165')]['phone'])){_0x21bf6c[_0x7652('0xc4')](_0x7652('0x1fd'),_0x563d3b,_0x4296b2[_0x37e1c1]);}else{_0x21bf6c['checkIsBlackList'](_['pick'](_0x4296b2[_0x37e1c1],['VoiceQueueId',_0x7652('0x1fe')]))['then'](_0x21bf6c[_0x7652('0x1ff')](_0x563d3b,_0x4296b2[_0x37e1c1]))['catch'](_0x21bf6c[_0x7652('0x206')](_0x7652('0x1fd'),_0x563d3b));}}}})[_0x7652('0xaa')](loggerGetContactDialer('[getContactDialer2]',_0x563d3b,_0x1e71d4));}};Dialer['prototype']['handlePredictive']=function(_0x40518b){if(_0x40518b[_0x7652('0x202')]>0x0){var _0x3d7460=_0x40518b['dialLimitQueue']-_0x40518b[_0x7652('0x6c')]-_0x40518b[_0x7652('0x97')];if(_0x3d7460>0x0){this[_0x7652('0x207')](_0x40518b);}else{loggerPredictiveCalls[_0x7652('0x7c')](_0x7652('0x208'));}}else{this[_0x7652('0x207')](_0x40518b);}};Dialer['prototype'][_0x7652('0x207')]=function(_0x21bbeb){var _0x2e0b5b=this;var _0x15e061=[];_0x21bbeb['originated']+=0x1;for(var _0x262d3e in this[_0x7652('0x24')]){if(typeof this[_0x7652('0x24')][_0x262d3e]!==_0x7652('0xa6')){if(this[_0x7652('0x24')][_0x262d3e][_0x7652('0x9f')]===_0x7652('0x203')&&this[_0x7652('0x24')][_0x262d3e]['status']===_0x7652('0x204')){_0x15e061[_0x7652('0x122')](this[_0x7652('0x24')][_0x262d3e]['id']);}}}this[_0x7652('0xba')](_0x21bbeb['id'],_0x15e061,0x1,_0x21bbeb[_0x7652('0x1f9')],_0x21bbeb)[_0x7652('0x3b')](function(_0x294198){if(!checkContactEmpty(_0x294198)){checkContactLowerLimitOriginate(_0x21bbeb,0x1,0x0);_0x2e0b5b[_0x7652('0xb0')](_0x21bbeb)[_0x7652('0x3b')](sendMessageReschedule(_0x21bbeb))[_0x7652('0xaa')](loggerCatch(_0x7652('0xb2')));}else{_0x21bbeb[_0x7652('0x3e')]=_0x7652('0x1fb');if(_[_0x7652('0xa7')](_0x294198[0x0])||_[_0x7652('0xa7')](_0x294198[0x0][_0x7652('0x165')])||_[_0x7652('0xa7')](_0x294198[0x0]['Contact'][_0x7652('0x166')])){_0x2e0b5b['emptyContact'](_0x7652('0x1fd'),_0x21bbeb,_0x294198[0x0]);}else{_0x2e0b5b['checkIsBlackList'](_[_0x7652('0xc7')](_0x294198[0x0],['VoiceQueueId',_0x7652('0x1fe')]))[_0x7652('0x3b')](_0x2e0b5b['checkContactBlack'](_0x21bbeb,_0x294198[0x0]))[_0x7652('0xaa')](_0x2e0b5b[_0x7652('0x206')](_0x7652('0x209'),_0x21bbeb));}}})[_0x7652('0xaa')](loggerGetContactDialer(_0x7652('0x20a'),_0x21bbeb,0x1));emitVoiceQueueSummary(_0x21bbeb);};Dialer[_0x7652('0x1d')][_0x7652('0x1db')]=function(_0x218962,_0x54f0a0,_0x2ab85c,_0x5da29d,_0xd43339,_0x318851){loggerPredictive[_0x7652('0x7c')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x7652('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',_0x218962);loggerPredictive[_0x7652('0x7c')](_0x7652('0x20b'),_0x54f0a0);loggerPredictive[_0x7652('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',_0x2ab85c);loggerPredictive['info'](_0x7652('0x20c'),_0x5da29d);loggerPredictive[_0x7652('0x7c')](_0x7652('0x20d'),_0xd43339);loggerPredictive[_0x7652('0x7c')](_0x7652('0x81'));return new BPromise(function(_0x1e8528,_0x1d222e){if(_0x218962<=0x0||isNaN(_0x218962)){return _0x1d222e(msgResponse('[abandonmentRate]','Error','m\x20=\x20'+_0x218962));}if(_0x2ab85c<=0x0||isNaN(_0x2ab85c)){return _0x1d222e(msgResponse(_0x7652('0x20e'),_0x7652('0x47'),_0x7652('0x20f')+_0x2ab85c));}if(_0x5da29d<=0x0||isNaN(_0x5da29d)){return _0x1d222e(msgResponse(_0x7652('0x20e'),_0x7652('0x47'),'p\x20=\x20'+_0x5da29d));}if(_0x54f0a0<=0x0||isNaN(_0x54f0a0)){return _0x1d222e(msgResponse(_0x7652('0x20e'),_0x7652('0x47'),_0x7652('0x210')+_0x54f0a0));}if(_0xd43339<=0x0||isNaN(_0xd43339)){return _0x1d222e(msgResponse('[abandonmentRate]','Error',_0x7652('0x211')+_0xd43339));}_0x318851=_0x318851||0x0;var _0x42161e=0x1/_0x2ab85c;var _0x2af44b=0x0;var _0x1916d6=0x0;var _0x557517=0x0;var _0x7cea0c=0x0;for(var _0xfa1170=0x0;_0x557517<_0xd43339;_0xfa1170+=0x1){_0x1916d6=_0xfa1170/_0x54f0a0;_0x2af44b=(_0x5da29d*_0x1916d6+_0x318851)/_0x42161e;_0x557517=erlangb(_0x2af44b,_0x218962);_0x7cea0c=_0x2af44b/_0x218962*(0x1-erlangb(_0x2af44b,_0x218962));}return _0x1e8528({'erlangCalls':_0xfa1170,'erlangCallToSecond':_0x54f0a0/_0xfa1170,'erlangAbandonmentRate':_0x557517,'erlangBusyFactor':_0x7cea0c});});};Dialer['prototype'][_0x7652('0x212')]=function(_0x4ec072,_0x729aef,_0x2c9c7e,_0x32f4e0,_0x15adc6,_0x17cda7){loggerPredictive[_0x7652('0x7c')](_0x7652('0x213'));loggerPredictive[_0x7652('0x7c')](_0x7652('0x214'),_0x4ec072);loggerPredictive[_0x7652('0x7c')](_0x7652('0x20b'),_0x729aef);loggerPredictive[_0x7652('0x7c')](_0x7652('0x215'),_0x2c9c7e);loggerPredictive[_0x7652('0x7c')](_0x7652('0x20c'),_0x32f4e0);loggerPredictive['info']('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x15adc6);loggerPredictive[_0x7652('0x7c')](_0x7652('0x81'));return new BPromise(function(_0x4a2bdc,_0x3ff33e){if(_0x4ec072<=0x0||isNaN(_0x4ec072)){return _0x3ff33e(msgResponse(_0x7652('0x216'),_0x7652('0x47'),_0x7652('0x217')+_0x4ec072));}if(_0x2c9c7e<=0x0||isNaN(_0x2c9c7e)){return _0x3ff33e(msgResponse(_0x7652('0x216'),'Error','Ts\x20=\x20'+_0x2c9c7e));}if(_0x32f4e0<=0x0||isNaN(_0x32f4e0)){return _0x3ff33e(msgResponse(_0x7652('0x216'),_0x7652('0x47'),_0x7652('0x218')+_0x32f4e0));}if(_0x729aef<=0x0||isNaN(_0x729aef)){return _0x3ff33e(msgResponse(_0x7652('0x216'),_0x7652('0x47'),_0x7652('0x210')+_0x729aef));}if(_0x15adc6<=0x0||isNaN(_0x15adc6)){return _0x3ff33e(msgResponse(_0x7652('0x216'),_0x7652('0x47'),_0x7652('0x219')+_0x15adc6));}_0x17cda7=_0x17cda7||0x0;var _0x4b5514=0x1/_0x2c9c7e;var _0x321f02=0x0;var _0xc82c71=0x0;var _0x30db36=0x0;var _0x4f846d=0x0;for(var _0x18320c=0x0;_0x4f846d<_0x15adc6;_0x18320c+=0x1){_0xc82c71=_0x18320c/_0x729aef;_0x321f02=(_0x32f4e0*_0xc82c71+_0x17cda7)/_0x4b5514;_0x30db36=erlangb(_0x321f02,_0x4ec072);_0x4f846d=_0x321f02/_0x4ec072*(0x1-erlangb(_0x321f02,_0x4ec072));}return _0x4a2bdc({'erlangCalls':_0x18320c,'erlangCallToSecond':_0x729aef/_0x18320c,'erlangAbandonmentRate':_0x30db36,'erlangBusyFactor':_0x4f846d});});};module[_0x7652('0x21a')]=Dialer;
\ No newline at end of file
index 25a4e89..87651ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x915c=['VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','starttime','responsetime','endtime','droptime','ringtime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x915c,0x80));var _0xc915=function(_0x338b76,_0x25d0da){_0x338b76=_0x338b76-0x0;var _0x3905c5=_0x915c[_0x338b76];return _0x3905c5;};'use strict';var util=require(_0xc915('0x0'));var _=require(_0xc915('0x1'));var moment=require(_0xc915('0x2'));function getSeconds(_0x243d1d,_0x226810){var _0x155078=moment(_0x243d1d)[_0xc915('0x3')](0x0);var _0x3db409=moment(_0x226810)[_0xc915('0x3')](0x0);return _0x155078[_0xc915('0x4')](_0x3db409,_0xc915('0x5'));}function QueueCallerAbandon(_0x316842,_0x5419d6){this['scheduledat']=_0x316842[_0xc915('0x6')];this[_0xc915('0x7')]=_0x316842[_0xc915('0x7')];this[_0xc915('0x8')]=_0x316842[_0xc915('0x7')]===_0xc915('0x9')?'queue':_0x316842[_0xc915('0x7')];this[_0xc915('0xa')]=_0x316842['countbusyretry'];this[_0xc915('0xb')]=_0x316842[_0xc915('0xb')];this[_0xc915('0xc')]=_0x316842[_0xc915('0xc')];this['countglobal']=_0x316842[_0xc915('0xa')]+_0x316842[_0xc915('0xb')]+_0x316842[_0xc915('0xc')]+_0x316842[_0xc915('0xd')]+_0x316842[_0xc915('0xe')]+_0x316842[_0xc915('0xf')]+_0x316842[_0xc915('0x10')]+_0x316842[_0xc915('0x11')];this[_0xc915('0xd')]=_0x316842['countnosuchnumberretry'];this[_0xc915('0xe')]=_0x316842[_0xc915('0xe')];this[_0xc915('0xf')]=_0x316842['countabandonedretry'];this[_0xc915('0x10')]=_0x316842[_0xc915('0x10')];this[_0xc915('0x11')]=_0x316842[_0xc915('0x11')];this[_0xc915('0x12')]=_0x5419d6[_0xc915('0x12')];this['calleridname']=_0x316842[_0xc915('0x13')];this[_0xc915('0x14')]=_0x316842['number'];this[_0xc915('0x15')]=_0x316842[_0xc915('0x15')];this[_0xc915('0x16')]=_0x316842[_0xc915('0x16')];this['droptime']=_0x316842['droptime'];this[_0xc915('0x17')]=this[_0xc915('0x18')];this[_0xc915('0x19')]=getSeconds(_0x316842[_0xc915('0x16')],_0x316842[_0xc915('0x15')]);this['holdtime']=getSeconds(this[_0xc915('0x18')],_0x316842[_0xc915('0x16')]);this['talktime']=0x0;this['queue']=_0x5419d6[_0xc915('0x1a')];this[_0xc915('0x1b')]=_0x5419d6['connectedlinename'];this['reason']=_0x5419d6[_0xc915('0x1c')];this[_0xc915('0x1d')]=_0x316842[_0xc915('0x1d')];this[_0xc915('0x1e')]=_0x316842['callbackuniqueid'];this[_0xc915('0x1f')]=_0x316842[_0xc915('0x1f')];this[_0xc915('0x20')]=_0x316842[_0xc915('0x20')];this[_0xc915('0x21')]=_0x316842[_0xc915('0x21')];this[_0xc915('0x22')]=_0x316842[_0xc915('0x22')];this[_0xc915('0x23')]=_0x316842[_0xc915('0x23')];this[_0xc915('0x24')]=_0x316842[_0xc915('0x24')];this[_0xc915('0x25')]=_0x316842[_0xc915('0x25')];this['originatecalleridnum']=_0x316842[_0xc915('0x26')]||'';this['originatecalleridname']=_0x316842[_0xc915('0x27')]||'';}module[_0xc915('0x28')]=QueueCallerAbandon;
\ No newline at end of file
+var _0xbb0e=['countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','responsetime','droptime','endtime','ringtime','starttime','holdtime','talktime','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry'];(function(_0x1846cd,_0xaac018){var _0x5e107b=function(_0x3a9f67){while(--_0x3a9f67){_0x1846cd['push'](_0x1846cd['shift']());}};_0x5e107b(++_0xaac018);}(_0xbb0e,0x1e9));var _0xebb0=function(_0x2305ce,_0x2a5876){_0x2305ce=_0x2305ce-0x0;var _0x1a854d=_0xbb0e[_0x2305ce];return _0x1a854d;};'use strict';var util=require('util');var _=require(_0xebb0('0x0'));var moment=require(_0xebb0('0x1'));function getSeconds(_0x2feb5e,_0x20f919){var _0x1efc38=moment(_0x2feb5e)[_0xebb0('0x2')](0x0);var _0x1d33ec=moment(_0x20f919)[_0xebb0('0x2')](0x0);return _0x1efc38['diff'](_0x1d33ec,'seconds');}function QueueCallerAbandon(_0x11e156,_0xebb6a2){this[_0xebb0('0x3')]=_0x11e156['scheduledat'];this['type']=_0x11e156[_0xebb0('0x4')];this[_0xebb0('0x5')]=_0x11e156[_0xebb0('0x4')]===_0xebb0('0x6')?_0xebb0('0x7'):_0x11e156[_0xebb0('0x4')];this['countbusyretry']=_0x11e156[_0xebb0('0x8')];this[_0xebb0('0x9')]=_0x11e156[_0xebb0('0x9')];this[_0xebb0('0xa')]=_0x11e156['countnoanswerretry'];this[_0xebb0('0xb')]=_0x11e156[_0xebb0('0x8')]+_0x11e156[_0xebb0('0x9')]+_0x11e156['countnoanswerretry']+_0x11e156[_0xebb0('0xc')]+_0x11e156[_0xebb0('0xd')]+_0x11e156[_0xebb0('0xe')]+_0x11e156[_0xebb0('0xf')]+_0x11e156[_0xebb0('0x10')];this['countnosuchnumberretry']=_0x11e156[_0xebb0('0xc')];this['countdropretry']=_0x11e156[_0xebb0('0xd')];this['countabandonedretry']=_0x11e156['countabandonedretry'];this[_0xebb0('0xf')]=_0x11e156['countmachineretry'];this[_0xebb0('0x10')]=_0x11e156[_0xebb0('0x10')];this[_0xebb0('0x11')]=_0xebb6a2[_0xebb0('0x11')];this[_0xebb0('0x12')]=_0x11e156[_0xebb0('0x13')];this[_0xebb0('0x14')]=_0x11e156[_0xebb0('0x15')];this['starttime']=_0x11e156['starttime'];this[_0xebb0('0x16')]=_0x11e156[_0xebb0('0x16')];this['droptime']=_0x11e156[_0xebb0('0x17')];this[_0xebb0('0x18')]=this[_0xebb0('0x17')];this[_0xebb0('0x19')]=getSeconds(_0x11e156[_0xebb0('0x16')],_0x11e156[_0xebb0('0x1a')]);this[_0xebb0('0x1b')]=getSeconds(this[_0xebb0('0x17')],_0x11e156[_0xebb0('0x16')]);this[_0xebb0('0x1c')]=0x0;this[_0xebb0('0x7')]=_0xebb6a2[_0xebb0('0x7')];this['membername']=_0xebb6a2[_0xebb0('0x1d')];this['reason']=_0xebb6a2[_0xebb0('0x1e')];this['callback']=_0x11e156[_0xebb0('0x1f')];this[_0xebb0('0x20')]=_0x11e156['callbackuniqueid'];this[_0xebb0('0x21')]=_0x11e156['callbackat'];this[_0xebb0('0x22')]=_0x11e156[_0xebb0('0x22')];this[_0xebb0('0x23')]=_0x11e156[_0xebb0('0x23')];this[_0xebb0('0x24')]=_0x11e156[_0xebb0('0x24')];this['UserId']=_0x11e156['UserId'];this[_0xebb0('0x25')]=_0x11e156[_0xebb0('0x25')];this[_0xebb0('0x26')]=_0x11e156[_0xebb0('0x26')];this[_0xebb0('0x27')]=_0x11e156[_0xebb0('0x27')]||'';this[_0xebb0('0x28')]=_0x11e156[_0xebb0('0x28')]||'';}module[_0xebb0('0x29')]=QueueCallerAbandon;
\ No newline at end of file
index b7194db..332252a 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(_0x846294,_0x2d8d74){var _0x4e590e=function(_0x4e45e6){while(--_0x4e45e6){_0x846294['push'](_0x846294['shift']());}};_0x4e590e(++_0x2d8d74);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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(_0x8c5a58,_0x17f51b){var _0x40f809=function(_0x4ad398){while(--_0x4ad398){_0x8c5a58['push'](_0x8c5a58['shift']());}};_0x40f809(++_0x17f51b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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 367e998..185d9de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0565=['Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','./rpcDb','./channel','./util/util','./action','../rpc/faxMessage','channels','faxAccounts','trunks','actions','syncNewchannel','bind','varset','newstate','syncNewExten','faxstatus','syncFaxStatus','syncReceiveFax','hangup','syncHangup','originateresponse','context','from-voip-provider','hasOwnProperty','localstationid','uniqueid','channel','name','info','prototype','syncVarSet','variable','value','syncNewState','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','syncOriginateResponse','merge','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','\x20hangup\x20sendFile\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','format','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','addVariables','ext','.pdf','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path'];(function(_0x16629d,_0x492375){var _0x56ccee=function(_0xa982b7){while(--_0xa982b7){_0x16629d['push'](_0x16629d['shift']());}};_0x56ccee(++_0x492375);}(_0x0565,0xf2));var _0x5056=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0x0565[_0x4a3898];return _0x25ceb0;};'use strict';var util=require(_0x5056('0x0'));var _=require(_0x5056('0x1'));var BPromise=require(_0x5056('0x2'));var uuid=require(_0x5056('0x3'));var moment=require(_0x5056('0x4'));var path=require(_0x5056('0x5'));var tiff2pdf=require(_0x5056('0x6'));var gs=require(_0x5056('0x7'));var logger=require(_0x5056('0x8'))(_0x5056('0x9'));var ami=require('../ami');var rpcDb=require(_0x5056('0xa'));var Channel=require(_0x5056('0xb'));var ut=require(_0x5056('0xc'));var Action=require(_0x5056('0xd'));var faxAccount=require('../rpc/faxAccount');var attachment=require('../rpc/attachment');var faxMessage=require(_0x5056('0xe'));function Fax(_0x223c92){this[_0x5056('0xf')]={};this[_0x5056('0x10')]=_0x223c92[_0x5056('0x10')];this[_0x5056('0x11')]=_0x223c92[_0x5056('0x11')];this[_0x5056('0x12')]={};ami['on']('newchannel',this[_0x5056('0x13')][_0x5056('0x14')](this));ami['on'](_0x5056('0x15'),this['syncVarSet']['bind'](this));ami['on'](_0x5056('0x16'),this['syncNewState']['bind'](this));ami['on']('newexten',this[_0x5056('0x17')]['bind'](this));ami['on'](_0x5056('0x18'),this[_0x5056('0x19')][_0x5056('0x14')](this));ami['on']('receivefax',this[_0x5056('0x1a')][_0x5056('0x14')](this));ami['on'](_0x5056('0x1b'),this[_0x5056('0x1c')][_0x5056('0x14')](this));ami['on'](_0x5056('0x1d'),this['syncOriginateResponse'][_0x5056('0x14')](this));}Fax['prototype'][_0x5056('0x13')]=function(_0x31166c){if(_0x31166c[_0x5056('0x1e')]===_0x5056('0x1f')){for(var _0x4056ce in this['faxAccounts']){if(this[_0x5056('0x10')][_0x5056('0x20')](_0x4056ce)){if(_0x31166c['exten']===this['faxAccounts'][_0x4056ce][_0x5056('0x21')]){this[_0x5056('0xf')][_0x31166c[_0x5056('0x22')]]={};this[_0x5056('0xf')][_0x31166c[_0x5056('0x22')]][_0x5056('0x23')]=_0x31166c[_0x5056('0x23')];this['channels'][_0x31166c[_0x5056('0x22')]]['id']=this[_0x5056('0x10')][_0x4056ce]['id'];this['channels'][_0x31166c[_0x5056('0x22')]][_0x5056('0x24')]=this[_0x5056('0x10')][_0x4056ce]['name'];logger[_0x5056('0x25')](_0x31166c[_0x5056('0x22')],'\x20syncNewchannel\x20');}}}}if(this['actions'][_0x31166c[_0x5056('0x22')]]){this[_0x5056('0xf')][_0x31166c[_0x5056('0x22')]]={};this[_0x5056('0xf')][_0x31166c['uniqueid']][_0x5056('0x23')]=_0x31166c[_0x5056('0x23')];logger['info'](_0x31166c[_0x5056('0x22')],'\x20syncNewchannel\x20');}};Fax[_0x5056('0x26')][_0x5056('0x27')]=function(_0x1106e5){if(this[_0x5056('0xf')][_0x1106e5[_0x5056('0x22')]]){for(var _0x50f2a8 in _0x1106e5[_0x5056('0x28')]){if(_0x1106e5[_0x5056('0x28')][_0x5056('0x20')](_0x50f2a8)){this[_0x5056('0xf')][_0x1106e5['uniqueid']][_0x50f2a8]=_0x1106e5[_0x5056('0x29')];}}}};Fax['prototype'][_0x5056('0x2a')]=function(_0x49fe67){if(this['channels'][_0x49fe67['uniqueid']]){this[_0x5056('0xf')][_0x49fe67[_0x5056('0x22')]]['channelstate']=_0x49fe67[_0x5056('0x2b')];this[_0x5056('0xf')][_0x49fe67[_0x5056('0x22')]][_0x5056('0x2c')]=_0x49fe67[_0x5056('0x2c')];}};Fax[_0x5056('0x26')][_0x5056('0x17')]=function(_0x3f292e){if(this[_0x5056('0xf')][_0x3f292e[_0x5056('0x22')]]){for(var _0x138867 in _0x3f292e['variable']){if(_0x3f292e['variable'][_0x5056('0x20')](_0x138867)){this[_0x5056('0xf')][_0x3f292e['uniqueid']][_0x138867]=_0x3f292e[_0x5056('0x29')];}}}};Fax[_0x5056('0x26')]['syncFaxStatus']=function(_0x31cacb){if(this[_0x5056('0xf')][_0x31cacb[_0x5056('0x22')]]){this[_0x5056('0xf')][_0x31cacb[_0x5056('0x22')]][_0x5056('0x2d')]=_0x31cacb[_0x5056('0x2d')];this[_0x5056('0xf')][_0x31cacb[_0x5056('0x22')]][_0x5056('0x2e')]=_0x31cacb[_0x5056('0x2e')];this[_0x5056('0xf')][_0x31cacb[_0x5056('0x22')]][_0x5056('0x21')]=_0x31cacb[_0x5056('0x21')];this['channels'][_0x31cacb[_0x5056('0x22')]]['filename']=_0x31cacb[_0x5056('0x2f')];logger[_0x5056('0x25')](_0x31cacb[_0x5056('0x22')],_0x5056('0x30'));}};Fax['prototype'][_0x5056('0x1a')]=function(_0x32fecc){var _0x50d494=this;if(this[_0x5056('0xf')][_0x32fecc['uniqueid']]){var _0x3006ca=this[_0x5056('0xf')][_0x32fecc[_0x5056('0x22')]]['id'];this['channels'][_0x32fecc[_0x5056('0x22')]][_0x5056('0x31')]=_0x32fecc[_0x5056('0x31')];this[_0x5056('0xf')][_0x32fecc[_0x5056('0x22')]][_0x5056('0x32')]=_0x32fecc[_0x5056('0x32')];this[_0x5056('0xf')][_0x32fecc[_0x5056('0x22')]][_0x5056('0x21')]=_0x32fecc[_0x5056('0x21')];this[_0x5056('0xf')][_0x32fecc[_0x5056('0x22')]][_0x5056('0x33')]=_0x32fecc[_0x5056('0x33')];this[_0x5056('0xf')][_0x32fecc['uniqueid']]['transferrate']=_0x32fecc[_0x5056('0x34')];this[_0x5056('0xf')][_0x32fecc[_0x5056('0x22')]][_0x5056('0x2f')]=_0x32fecc[_0x5056('0x2f')];this[_0x5056('0xf')][_0x32fecc[_0x5056('0x22')]][_0x5056('0x35')]=_0x32fecc['calleridnum'];if(this['channels'][_0x32fecc[_0x5056('0x22')]][_0x5056('0x32')]>0x0){tiff2pdf(_0x32fecc[_0x5056('0x2f')],'/var/opt/motion2/server/files/attachments/',function(_0x351517){logger['info'](_0x32fecc[_0x5056('0x22')],_0x5056('0x36'),_0x351517[_0x5056('0x37')]);attachment[_0x5056('0x38')]({'name':path[_0x5056('0x39')](_0x32fecc[_0x5056('0x2f')])['name'],'basename':path[_0x5056('0x39')](_0x32fecc[_0x5056('0x2f')])[_0x5056('0x24')]+'.pdf','type':'application/pdf'})['then'](function(_0x4e1641){faxAccount[_0x5056('0x3a')](_0x3006ca,{'from':_0x32fecc[_0x5056('0x35')],'mapKey':_0x5056('0x9'),'body':path[_0x5056('0x39')](_0x32fecc[_0x5056('0x2f')])['name']+'.pdf','AttachmentId':_0x4e1641['id']})[_0x5056('0x3b')](function(_0x2ac9e8){logger[_0x5056('0x3c')](_0x32fecc[_0x5056('0x22')],_0x5056('0x3d'),JSON[_0x5056('0x3e')](_0x2ac9e8));});})[_0x5056('0x3b')](function(_0x52be9d){logger['error'](_0x32fecc[_0x5056('0x22')],_0x5056('0x3f'),JSON['stringify'](_0x52be9d));});});}logger[_0x5056('0x25')](_0x32fecc[_0x5056('0x22')],'\x20receiveFax\x20');}};Fax['prototype'][_0x5056('0x40')]=function(_0x1ab1a9){if(this['actions'][_0x1ab1a9['uniqueid']]){_[_0x5056('0x41')](this[_0x5056('0xf')][_0x1ab1a9['uniqueid']],_['pick'](_0x1ab1a9,[_0x5056('0x42'),_0x5056('0x43')]));}};function updateStatus(_0x96eaf1){if(_0x96eaf1[_0x5056('0x44')]){faxMessage[_0x5056('0x45')](_0x96eaf1[_0x5056('0x44')],{'failMessage':_0x5056('0x46')})[_0x5056('0x47')](function(_0x163b00){ut[_0x5056('0x48')](_0x5056('0x49'),_0x163b00);})[_0x5056('0x3b')](function(_0x175d5b){ut[_0x5056('0x48')](_0x5056('0x4a'),_0x175d5b);});}else{ut['logger']('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x5056('0x26')][_0x5056('0x4b')]=function(_0x428701,_0x1c84b1,_0x35776b){var _0x2e21cb=this;var _0x517ba7={};if(_0x1c84b1){_0x517ba7={'read':_0x1c84b1};}else{_0x517ba7={'failMessage':_0x35776b};}if(this[_0x5056('0x12')][_0x428701][_0x5056('0x44')]){faxMessage[_0x5056('0x45')](this[_0x5056('0x12')][_0x428701][_0x5056('0x44')],_0x517ba7)[_0x5056('0x47')](function(_0x26fe1c){ut[_0x5056('0x48')](_0x5056('0x4c'),_0x26fe1c);})[_0x5056('0x3b')](function(_0x164c48){ut[_0x5056('0x48')](_0x5056('0x4d'),_0x164c48);})['finally'](function(){delete _0x2e21cb[_0x5056('0xf')][_0x428701];delete _0x2e21cb[_0x5056('0x12')][_0x428701];});}else{ut[_0x5056('0x48')]('[Fax][Message][NoUpdate2]');delete this[_0x5056('0xf')][_0x428701];delete this[_0x5056('0x12')][_0x428701];}};Fax[_0x5056('0x26')][_0x5056('0x1c')]=function(_0x582e02){var _0x51a2e8=this;if(this['channels'][_0x582e02[_0x5056('0x22')]]){if(this['actions'][_0x582e02[_0x5056('0x22')]]){this[_0x5056('0xf')][_0x582e02[_0x5056('0x22')]]['id']=this[_0x5056('0x12')][_0x582e02[_0x5056('0x22')]]['id'];this[_0x5056('0xf')][_0x582e02['uniqueid']]['name']=this[_0x5056('0x12')][_0x582e02[_0x5056('0x22')]]['name'];}logger[_0x5056('0x25')](_0x582e02[_0x5056('0x22')],this[_0x5056('0x12')][_0x582e02[_0x5056('0x22')]]?_0x5056('0x4e'):'\x20hangup\x20faxRiceive\x20',JSON[_0x5056('0x3e')](this[_0x5056('0xf')][_0x582e02['uniqueid']]));if(this[_0x5056('0x12')][_0x582e02[_0x5056('0x22')]]){if(this[_0x5056('0xf')][_0x582e02[_0x5056('0x22')]][_0x5056('0x4f')]>0x0&&this[_0x5056('0xf')][_0x582e02[_0x5056('0x22')]][_0x5056('0x18')]===_0x5056('0x50')){this[_0x5056('0x4b')](_0x582e02[_0x5056('0x22')],!![]);}else{this[_0x5056('0x4b')](_0x582e02[_0x5056('0x22')],![],this['channels'][_0x582e02[_0x5056('0x22')]][_0x5056('0x51')]?_0x5056('0x52')+this[_0x5056('0xf')][_0x582e02[_0x5056('0x22')]][_0x5056('0x51')]:'SENDING\x20FAILED');}}}};Fax[_0x5056('0x26')]['send']=function(_0x1c3684){var _0x277939=this;return new BPromise(function(_0x5e8502,_0x4c9e3c){_0x277939[_0x5056('0x53')](_0x1c3684,_0x277939[_0x5056('0x10')][_0x1c3684[_0x5056('0x54')]])[_0x5056('0x47')](function(_0x57857e){ut['logger'](_0x5056('0x55'),_0x57857e);_0x5e8502(ut[_0x5056('0x37')](_0x5056('0x56')));})['catch'](function(_0x3b24d1){ut['logger'](_0x5056('0x57'),_0x3b24d1);updateStatus(_0x1c3684);_0x4c9e3c(ut[_0x5056('0x37')](_0x5056('0x58')));});});};Fax['prototype'][_0x5056('0x59')]=function(_0x68dfa1){var _0x12d210=this;return new BPromise(function(_0x20ccc6,_0xde080d){var _0x2892a0=_0x12d210[_0x5056('0x5a')](_0x12d210['faxAccounts'][_0x68dfa1[_0x5056('0x54')]][_0x5056('0x5b')],_0x68dfa1);if(_0x2892a0[_0x5056('0x5c')]){_0x20ccc6(ut['message'](_0x5056('0x5d')));}else{_0xde080d(ut['message'](_0x2892a0[_0x5056('0x37')]));}});};function originate(_0x5468d6,_0x3c7d5c,_0x45eac9){return new BPromise(function(_0x5639a1,_0x2a856c){if(_0x45eac9){var _0x218466=util['format'](_0x5056('0x5e'),path['parse'](_0x5468d6['path'])[_0x5056('0x24')],_0x5468d6[_0x5056('0x5')]);gs[_0x5056('0x5f')](_0x218466)[_0x5056('0x47')](function(){_0x5468d6[_0x5056('0x5')]=util[_0x5056('0x60')](_0x5056('0x61'),path[_0x5056('0x39')](_0x5468d6[_0x5056('0x5')])[_0x5056('0x62')],path[_0x5056('0x39')](_0x5468d6[_0x5056('0x5')])['name']);_0x3c7d5c[_0x5056('0x63')]=_0x5468d6['path'];ut[_0x5056('0x48')](_0x5056('0x64'),'');ami['Action'](ut[_0x5056('0x65')](_0x5468d6,_0x3c7d5c))[_0x5056('0x47')](function(_0x122fe0){_0x5639a1(_0x122fe0);})[_0x5056('0x3b')](function(_0x3a83aa){_0x2a856c(_0x3a83aa);});})[_0x5056('0x3b')](function(_0x2f2d2d){_0x2a856c(_0x2f2d2d);});}else{ami[_0x5056('0x66')](ut['variablesAction'](_0x5468d6,_0x3c7d5c))[_0x5056('0x47')](function(_0x121ca5){_0x5639a1(_0x121ca5);})[_0x5056('0x3b')](function(_0x23cf3d){_0x2a856c(_0x23cf3d);});}});}Fax[_0x5056('0x26')]['execOriginate']=function(_0x3bf1ae,_0x4db5a6){var _0x24fee1=this;return new BPromise(function(_0x1e0578,_0x18026f){var _0x59b6fd=uuid['v4']();var _0x16cc5f=ut[_0x5056('0x67')](_0x3bf1ae,_0x4db5a6);_0x24fee1[_0x5056('0x12')][_0x59b6fd]=new Action(_0x59b6fd,_0x4db5a6,_0x3bf1ae);var _0x5f41de=_0x24fee1[_0x5056('0x12')][_0x59b6fd];if(path[_0x5056('0x39')](_0x3bf1ae[_0x5056('0x5')])[_0x5056('0x68')]===_0x5056('0x69')){originate(_0x5f41de,_0x16cc5f,!![])[_0x5056('0x47')](function(_0x3f34b6){_0x1e0578(_0x3f34b6);})['catch'](function(_0x48bf13){_0x18026f(_0x48bf13);});}else{originate(_0x5f41de,_0x16cc5f,![])['then'](function(_0xd1d1b3){_0x1e0578(_0xd1d1b3);})['catch'](function(_0x217529){_0x18026f(_0x217529);});}});};Fax[_0x5056('0x26')][_0x5056('0x6a')]=function(_0x54658f){return!_[_0x5056('0x6b')](_0x54658f)&&!_['isNil'](_0x54658f[_0x5056('0x24')])&&!_[_0x5056('0x6b')](_0x54658f[_0x5056('0x6c')])&&_0x54658f['active']&&!_[_0x5056('0x6b')](this['trunks'][util['format'](_0x5056('0x6d'),_0x54658f[_0x5056('0x24')])])&&!_['isNil'](this[_0x5056('0x11')][util['format'](_0x5056('0x6d'),_0x54658f[_0x5056('0x24')])][_0x5056('0x2e')])&&(this[_0x5056('0x11')][util[_0x5056('0x60')](_0x5056('0x6d'),_0x54658f['name'])][_0x5056('0x2e')]===_0x5056('0x6e')||this[_0x5056('0x11')][util[_0x5056('0x60')](_0x5056('0x6d'),_0x54658f[_0x5056('0x24')])]['status']===_0x5056('0x6f'));};Fax['prototype'][_0x5056('0x5a')]=function(_0x9138f6,_0x26ba6a){if(!this[_0x5056('0x6a')](_0x9138f6)){ut[_0x5056('0x48')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0x5056('0x6b')](_0x9138f6)?'':_0x9138f6[_0x5056('0x24')]+_0x5056('0x70'));return{'isValid':![],'message':_0x5056('0x71')};}if(_[_0x5056('0x6b')](_0x26ba6a[_0x5056('0x9')])){ut[_0x5056('0x48')](_0x5056('0x72'),JSON[_0x5056('0x3e')](_0x26ba6a));return{'isValid':![],'message':_0x5056('0x73')};}if(_[_0x5056('0x6b')](_0x26ba6a[_0x5056('0x5')])){ut[_0x5056('0x48')](_0x5056('0x74'),JSON[_0x5056('0x3e')](_0x26ba6a));return{'isValid':![],'message':_0x5056('0x75')};}return{'isValid':!![],'message':_0x5056('0x76')};};module[_0x5056('0x77')]=Fax;
\ No newline at end of file
+var _0x6324=['hasOwnProperty','localstationid','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','catch','error','stringify','\x20receiveFax\x20','pick','response','reason','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\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','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','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isNil','active','trunks','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','util','lodash','bluebird','uuid','path','./util/gs','fax','./rpcDb','./channel','./util/util','./action','../rpc/attachment','../rpc/faxMessage','faxAccounts','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','syncOriginateResponse','prototype','context','from-voip-provider'];(function(_0x472ff6,_0x42b0a0){var _0x42ea68=function(_0x3eb3c6){while(--_0x3eb3c6){_0x472ff6['push'](_0x472ff6['shift']());}};_0x42ea68(++_0x42b0a0);}(_0x6324,0x142));var _0x4632=function(_0x258b00,_0x28e9b0){_0x258b00=_0x258b00-0x0;var _0x3ca676=_0x6324[_0x258b00];return _0x3ca676;};'use strict';var util=require(_0x4632('0x0'));var _=require(_0x4632('0x1'));var BPromise=require(_0x4632('0x2'));var uuid=require(_0x4632('0x3'));var moment=require('moment');var path=require(_0x4632('0x4'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x4632('0x5'));var logger=require('../../../config/logger')(_0x4632('0x6'));var ami=require('../ami');var rpcDb=require(_0x4632('0x7'));var Channel=require(_0x4632('0x8'));var ut=require(_0x4632('0x9'));var Action=require(_0x4632('0xa'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x4632('0xb'));var faxMessage=require(_0x4632('0xc'));function Fax(_0x390a46){this['channels']={};this[_0x4632('0xd')]=_0x390a46[_0x4632('0xd')];this['trunks']=_0x390a46['trunks'];this[_0x4632('0xe')]={};ami['on'](_0x4632('0xf'),this[_0x4632('0x10')][_0x4632('0x11')](this));ami['on'](_0x4632('0x12'),this[_0x4632('0x13')][_0x4632('0x11')](this));ami['on'](_0x4632('0x14'),this['syncNewState'][_0x4632('0x11')](this));ami['on']('newexten',this[_0x4632('0x15')][_0x4632('0x11')](this));ami['on'](_0x4632('0x16'),this[_0x4632('0x17')]['bind'](this));ami['on'](_0x4632('0x18'),this[_0x4632('0x19')][_0x4632('0x11')](this));ami['on'](_0x4632('0x1a'),this[_0x4632('0x1b')]['bind'](this));ami['on']('originateresponse',this[_0x4632('0x1c')][_0x4632('0x11')](this));}Fax[_0x4632('0x1d')][_0x4632('0x10')]=function(_0x48fbb1){if(_0x48fbb1[_0x4632('0x1e')]===_0x4632('0x1f')){for(var _0x1a94c0 in this['faxAccounts']){if(this[_0x4632('0xd')][_0x4632('0x20')](_0x1a94c0)){if(_0x48fbb1['exten']===this['faxAccounts'][_0x1a94c0][_0x4632('0x21')]){this[_0x4632('0x22')][_0x48fbb1[_0x4632('0x23')]]={};this[_0x4632('0x22')][_0x48fbb1[_0x4632('0x23')]][_0x4632('0x24')]=_0x48fbb1[_0x4632('0x24')];this[_0x4632('0x22')][_0x48fbb1[_0x4632('0x23')]]['id']=this[_0x4632('0xd')][_0x1a94c0]['id'];this[_0x4632('0x22')][_0x48fbb1[_0x4632('0x23')]][_0x4632('0x25')]=this[_0x4632('0xd')][_0x1a94c0][_0x4632('0x25')];logger[_0x4632('0x26')](_0x48fbb1[_0x4632('0x23')],_0x4632('0x27'));}}}}if(this[_0x4632('0xe')][_0x48fbb1[_0x4632('0x23')]]){this[_0x4632('0x22')][_0x48fbb1[_0x4632('0x23')]]={};this[_0x4632('0x22')][_0x48fbb1[_0x4632('0x23')]][_0x4632('0x24')]=_0x48fbb1[_0x4632('0x24')];logger[_0x4632('0x26')](_0x48fbb1[_0x4632('0x23')],_0x4632('0x27'));}};Fax[_0x4632('0x1d')][_0x4632('0x13')]=function(_0x2a0b11){if(this[_0x4632('0x22')][_0x2a0b11['uniqueid']]){for(var _0x57798a in _0x2a0b11[_0x4632('0x28')]){if(_0x2a0b11[_0x4632('0x28')][_0x4632('0x20')](_0x57798a)){this[_0x4632('0x22')][_0x2a0b11[_0x4632('0x23')]][_0x57798a]=_0x2a0b11[_0x4632('0x29')];}}}};Fax[_0x4632('0x1d')]['syncNewState']=function(_0x42d505){if(this[_0x4632('0x22')][_0x42d505['uniqueid']]){this[_0x4632('0x22')][_0x42d505['uniqueid']][_0x4632('0x2a')]=_0x42d505['channelstate'];this['channels'][_0x42d505[_0x4632('0x23')]][_0x4632('0x2b')]=_0x42d505[_0x4632('0x2b')];}};Fax['prototype']['syncNewExten']=function(_0x395f4e){if(this[_0x4632('0x22')][_0x395f4e['uniqueid']]){for(var _0x4aab76 in _0x395f4e[_0x4632('0x28')]){if(_0x395f4e[_0x4632('0x28')]['hasOwnProperty'](_0x4aab76)){this[_0x4632('0x22')][_0x395f4e[_0x4632('0x23')]][_0x4aab76]=_0x395f4e[_0x4632('0x29')];}}}};Fax[_0x4632('0x1d')][_0x4632('0x17')]=function(_0x47b2b5){if(this[_0x4632('0x22')][_0x47b2b5[_0x4632('0x23')]]){this['channels'][_0x47b2b5['uniqueid']][_0x4632('0x2c')]=_0x47b2b5['operation'];this['channels'][_0x47b2b5[_0x4632('0x23')]]['status']=_0x47b2b5[_0x4632('0x2d')];this[_0x4632('0x22')][_0x47b2b5[_0x4632('0x23')]]['localstationid']=_0x47b2b5[_0x4632('0x21')];this[_0x4632('0x22')][_0x47b2b5[_0x4632('0x23')]][_0x4632('0x2e')]=_0x47b2b5[_0x4632('0x2e')];logger['info'](_0x47b2b5['uniqueid'],_0x4632('0x2f'));}};Fax[_0x4632('0x1d')][_0x4632('0x19')]=function(_0x4f40af){var _0x5a3fb4=this;if(this['channels'][_0x4f40af[_0x4632('0x23')]]){var _0x393ef2=this['channels'][_0x4f40af[_0x4632('0x23')]]['id'];this[_0x4632('0x22')][_0x4f40af[_0x4632('0x23')]][_0x4632('0x30')]=_0x4f40af[_0x4632('0x30')];this[_0x4632('0x22')][_0x4f40af[_0x4632('0x23')]][_0x4632('0x31')]=_0x4f40af[_0x4632('0x31')];this[_0x4632('0x22')][_0x4f40af[_0x4632('0x23')]][_0x4632('0x21')]=_0x4f40af['localstationid'];this[_0x4632('0x22')][_0x4f40af[_0x4632('0x23')]]['resolution']=_0x4f40af[_0x4632('0x32')];this[_0x4632('0x22')][_0x4f40af['uniqueid']][_0x4632('0x33')]=_0x4f40af['transferrate'];this[_0x4632('0x22')][_0x4f40af[_0x4632('0x23')]][_0x4632('0x2e')]=_0x4f40af[_0x4632('0x2e')];this['channels'][_0x4f40af[_0x4632('0x23')]][_0x4632('0x34')]=_0x4f40af[_0x4632('0x34')];if(this[_0x4632('0x22')][_0x4f40af['uniqueid']]['pagestransferred']>0x0){tiff2pdf(_0x4f40af[_0x4632('0x2e')],_0x4632('0x35'),function(_0x351cb1){logger['info'](_0x4f40af[_0x4632('0x23')],_0x4632('0x36'),_0x351cb1[_0x4632('0x37')]);attachment[_0x4632('0x38')]({'name':path[_0x4632('0x39')](_0x4f40af[_0x4632('0x2e')])[_0x4632('0x25')],'basename':path['parse'](_0x4f40af[_0x4632('0x2e')])[_0x4632('0x25')]+_0x4632('0x3a'),'type':_0x4632('0x3b')})[_0x4632('0x3c')](function(_0x4d1d50){faxAccount['notify'](_0x393ef2,{'from':_0x4f40af[_0x4632('0x34')],'mapKey':_0x4632('0x6'),'body':path[_0x4632('0x39')](_0x4f40af[_0x4632('0x2e')])['name']+_0x4632('0x3a'),'AttachmentId':_0x4d1d50['id']})[_0x4632('0x3d')](function(_0x1ef8e1){logger[_0x4632('0x3e')](_0x4f40af[_0x4632('0x23')],'\x20notify\x20',JSON[_0x4632('0x3f')](_0x1ef8e1));});})[_0x4632('0x3d')](function(_0x378665){logger[_0x4632('0x3e')](_0x4f40af[_0x4632('0x23')],_0x4632('0x40'),JSON[_0x4632('0x3f')](_0x378665));});});}logger[_0x4632('0x26')](_0x4f40af[_0x4632('0x23')],_0x4632('0x40'));}};Fax[_0x4632('0x1d')]['syncOriginateResponse']=function(_0xc3ffd0){if(this[_0x4632('0xe')][_0xc3ffd0[_0x4632('0x23')]]){_['merge'](this[_0x4632('0x22')][_0xc3ffd0[_0x4632('0x23')]],_[_0x4632('0x41')](_0xc3ffd0,[_0x4632('0x42'),_0x4632('0x43')]));}};function updateStatus(_0x70a4fd){if(_0x70a4fd[_0x4632('0x44')]){faxMessage[_0x4632('0x45')](_0x70a4fd[_0x4632('0x44')],{'failMessage':_0x4632('0x46')})['then'](function(_0x35afe5){ut[_0x4632('0x47')]('[Fax][Message][Error][Updated]',_0x35afe5);})[_0x4632('0x3d')](function(_0x3a21c6){ut[_0x4632('0x47')](_0x4632('0x48'),_0x3a21c6);});}else{ut[_0x4632('0x47')](_0x4632('0x49'));}}Fax[_0x4632('0x1d')][_0x4632('0x4a')]=function(_0x31b42d,_0x1b66e0,_0x3e66d8){var _0x2a50f7=this;var _0x3471b4={};if(_0x1b66e0){_0x3471b4={'read':_0x1b66e0};}else{_0x3471b4={'failMessage':_0x3e66d8};}if(this[_0x4632('0xe')][_0x31b42d][_0x4632('0x44')]){faxMessage[_0x4632('0x45')](this[_0x4632('0xe')][_0x31b42d][_0x4632('0x44')],_0x3471b4)[_0x4632('0x3c')](function(_0x36c824){ut['logger'](_0x4632('0x4b'),_0x36c824);})[_0x4632('0x3d')](function(_0x3ea966){ut[_0x4632('0x47')](_0x4632('0x4c'),_0x3ea966);})[_0x4632('0x4d')](function(){delete _0x2a50f7['channels'][_0x31b42d];delete _0x2a50f7[_0x4632('0xe')][_0x31b42d];});}else{ut[_0x4632('0x47')](_0x4632('0x4e'));delete this['channels'][_0x31b42d];delete this[_0x4632('0xe')][_0x31b42d];}};Fax[_0x4632('0x1d')]['syncHangup']=function(_0x17bc91){var _0x1aa4f0=this;if(this[_0x4632('0x22')][_0x17bc91['uniqueid']]){if(this[_0x4632('0xe')][_0x17bc91[_0x4632('0x23')]]){this[_0x4632('0x22')][_0x17bc91[_0x4632('0x23')]]['id']=this[_0x4632('0xe')][_0x17bc91[_0x4632('0x23')]]['id'];this[_0x4632('0x22')][_0x17bc91[_0x4632('0x23')]][_0x4632('0x25')]=this[_0x4632('0xe')][_0x17bc91['uniqueid']][_0x4632('0x25')];}logger[_0x4632('0x26')](_0x17bc91['uniqueid'],this[_0x4632('0xe')][_0x17bc91['uniqueid']]?'\x20hangup\x20sendFile\x20':_0x4632('0x4f'),JSON[_0x4632('0x3f')](this[_0x4632('0x22')][_0x17bc91[_0x4632('0x23')]]));if(this[_0x4632('0xe')][_0x17bc91[_0x4632('0x23')]]){if(this[_0x4632('0x22')][_0x17bc91[_0x4632('0x23')]][_0x4632('0x50')]>0x0&&this[_0x4632('0x22')][_0x17bc91[_0x4632('0x23')]][_0x4632('0x16')]===_0x4632('0x51')){this[_0x4632('0x4a')](_0x17bc91['uniqueid'],!![]);}else{this['updateStatus'](_0x17bc91[_0x4632('0x23')],![],this[_0x4632('0x22')][_0x17bc91[_0x4632('0x23')]][_0x4632('0x52')]?_0x4632('0x53')+this[_0x4632('0x22')][_0x17bc91['uniqueid']][_0x4632('0x52')]:_0x4632('0x54'));}}}};Fax[_0x4632('0x1d')][_0x4632('0x55')]=function(_0x5d1994){var _0x529be1=this;return new BPromise(function(_0x28428f,_0x4c547c){_0x529be1[_0x4632('0x56')](_0x5d1994,_0x529be1[_0x4632('0xd')][_0x5d1994[_0x4632('0x57')]])[_0x4632('0x3c')](function(_0xc5515f){ut['logger'](_0x4632('0x58'),_0xc5515f);_0x28428f(ut[_0x4632('0x37')]('Fax\x20received'));})['catch'](function(_0x2a2cdb){ut[_0x4632('0x47')](_0x4632('0x59'),_0x2a2cdb);updateStatus(_0x5d1994);_0x4c547c(ut[_0x4632('0x37')]('Fax\x20failed'));});});};Fax['prototype']['checkAfterSend']=function(_0x10f7ab){var _0x5b37cc=this;return new BPromise(function(_0x3af9ec,_0x3595fa){var _0x390844=_0x5b37cc[_0x4632('0x5a')](_0x5b37cc[_0x4632('0xd')][_0x10f7ab[_0x4632('0x57')]][_0x4632('0x5b')],_0x10f7ab);if(_0x390844[_0x4632('0x5c')]){_0x3af9ec(ut[_0x4632('0x37')](_0x4632('0x5d')));}else{_0x3595fa(ut[_0x4632('0x37')](_0x390844[_0x4632('0x37')]));}});};function originate(_0x1c5c49,_0x3d5e65,_0x461700){return new BPromise(function(_0x1b2905,_0x550c4d){if(_0x461700){var _0x2b6d66=util[_0x4632('0x5e')](_0x4632('0x5f'),path[_0x4632('0x39')](_0x1c5c49[_0x4632('0x4')])[_0x4632('0x25')],_0x1c5c49[_0x4632('0x4')]);gs[_0x4632('0x60')](_0x2b6d66)[_0x4632('0x3c')](function(){_0x1c5c49[_0x4632('0x4')]=util[_0x4632('0x5e')](_0x4632('0x61'),path[_0x4632('0x39')](_0x1c5c49['path'])[_0x4632('0x62')],path[_0x4632('0x39')](_0x1c5c49[_0x4632('0x4')])[_0x4632('0x25')]);_0x3d5e65[_0x4632('0x63')]=_0x1c5c49[_0x4632('0x4')];ut['logger'](_0x4632('0x64'),'');ami[_0x4632('0x65')](ut['variablesAction'](_0x1c5c49,_0x3d5e65))[_0x4632('0x3c')](function(_0x458688){_0x1b2905(_0x458688);})[_0x4632('0x3d')](function(_0x182b19){_0x550c4d(_0x182b19);});})[_0x4632('0x3d')](function(_0x5a09b9){_0x550c4d(_0x5a09b9);});}else{ami[_0x4632('0x65')](ut[_0x4632('0x66')](_0x1c5c49,_0x3d5e65))[_0x4632('0x3c')](function(_0x505e2a){_0x1b2905(_0x505e2a);})[_0x4632('0x3d')](function(_0x400a95){_0x550c4d(_0x400a95);});}});}Fax[_0x4632('0x1d')][_0x4632('0x56')]=function(_0x365341,_0x3a3f3a){var _0x35ca5d=this;return new BPromise(function(_0x295b86,_0x48fb81){var _0x36de42=uuid['v4']();var _0x9603f5=ut[_0x4632('0x67')](_0x365341,_0x3a3f3a);_0x35ca5d['actions'][_0x36de42]=new Action(_0x36de42,_0x3a3f3a,_0x365341);var _0xfc48bd=_0x35ca5d[_0x4632('0xe')][_0x36de42];if(path['parse'](_0x365341['path'])[_0x4632('0x68')]===_0x4632('0x3a')){originate(_0xfc48bd,_0x9603f5,!![])['then'](function(_0x63d3e1){_0x295b86(_0x63d3e1);})[_0x4632('0x3d')](function(_0x2f1f22){_0x48fb81(_0x2f1f22);});}else{originate(_0xfc48bd,_0x9603f5,![])[_0x4632('0x3c')](function(_0x40b7c5){_0x295b86(_0x40b7c5);})[_0x4632('0x3d')](function(_0x43edfd){_0x48fb81(_0x43edfd);});}});};Fax[_0x4632('0x1d')]['isTrunkReachable']=function(_0x1604da){return!_[_0x4632('0x69')](_0x1604da)&&!_[_0x4632('0x69')](_0x1604da[_0x4632('0x25')])&&!_['isNil'](_0x1604da[_0x4632('0x6a')])&&_0x1604da[_0x4632('0x6a')]&&!_[_0x4632('0x69')](this[_0x4632('0x6b')][util[_0x4632('0x5e')]('SIP/%s',_0x1604da[_0x4632('0x25')])])&&!_[_0x4632('0x69')](this[_0x4632('0x6b')][util[_0x4632('0x5e')](_0x4632('0x6c'),_0x1604da[_0x4632('0x25')])][_0x4632('0x2d')])&&(this[_0x4632('0x6b')][util['format'](_0x4632('0x6c'),_0x1604da[_0x4632('0x25')])][_0x4632('0x2d')]===_0x4632('0x6d')||this[_0x4632('0x6b')][util[_0x4632('0x5e')]('SIP/%s',_0x1604da[_0x4632('0x25')])][_0x4632('0x2d')]===_0x4632('0x6e'));};Fax[_0x4632('0x1d')][_0x4632('0x5a')]=function(_0x3ad5f0,_0x310c9c){if(!this['isTrunkReachable'](_0x3ad5f0)){ut[_0x4632('0x47')](_0x4632('0x6f'),_[_0x4632('0x69')](_0x3ad5f0)?'':_0x3ad5f0[_0x4632('0x25')]+_0x4632('0x70'));return{'isValid':![],'message':_0x4632('0x71')};}if(_[_0x4632('0x69')](_0x310c9c['fax'])){ut[_0x4632('0x47')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0x4632('0x3f')](_0x310c9c));return{'isValid':![],'message':_0x4632('0x72')};}if(_[_0x4632('0x69')](_0x310c9c[_0x4632('0x4')])){ut[_0x4632('0x47')](_0x4632('0x73'),JSON[_0x4632('0x3f')](_0x310c9c));return{'isValid':![],'message':_0x4632('0x74')};}return{'isValid':!![],'message':_0x4632('0x75')};};module['exports']=Fax;
\ No newline at end of file
index 4e9c799..88fc0b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef8c=['preview','lodash','../rpc/faxAccount','inspect','resolve','then','notify','catch','[Notify]\x20','util','bluebird','../../../config/logger'];(function(_0x4aa4af,_0x210cde){var _0x3bf44a=function(_0x4a8126){while(--_0x4a8126){_0x4aa4af['push'](_0x4aa4af['shift']());}};_0x3bf44a(++_0x210cde);}(_0xef8c,0x105));var _0xcef8=function(_0x15ee41,_0x9275d8){_0x15ee41=_0x15ee41-0x0;var _0x2b2846=_0xef8c[_0x15ee41];return _0x2b2846;};'use strict';var util=require(_0xcef8('0x0'));var BPromise=require(_0xcef8('0x1'));var logger=require(_0xcef8('0x2'))(_0xcef8('0x3'));var _=require(_0xcef8('0x4'));var faxAccount=require(_0xcef8('0x5'));function loggerCatch(_0x465bd8){return function(_0x18d95f){logger['error'](_0x465bd8,util[_0xcef8('0x6')](_0x18d95f,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x363cca,_0x481496){return BPromise[_0xcef8('0x7')]()[_0xcef8('0x8')](faxAccount[_0xcef8('0x9')](_0x363cca,_0x481496))[_0xcef8('0xa')](loggerCatch(_0xcef8('0xb')));};
\ No newline at end of file
+var _0xf2db=['util','bluebird','preview','lodash','error','inspect','notify','resolve','then','catch'];(function(_0x3c6b7d,_0x5f0d90){var _0x1d3ed2=function(_0x1a8f35){while(--_0x1a8f35){_0x3c6b7d['push'](_0x3c6b7d['shift']());}};_0x1d3ed2(++_0x5f0d90);}(_0xf2db,0x1e0));var _0xbf2d=function(_0x379d83,_0x16b26a){_0x379d83=_0x379d83-0x0;var _0x4e730a=_0xf2db[_0x379d83];return _0x4e730a;};'use strict';var util=require(_0xbf2d('0x0'));var BPromise=require(_0xbf2d('0x1'));var logger=require('../../../config/logger')(_0xbf2d('0x2'));var _=require(_0xbf2d('0x3'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x1308e5){return function(_0x3d8aba){logger[_0xbf2d('0x4')](_0x1308e5,util[_0xbf2d('0x5')](_0x3d8aba,{'showHidden':![],'depth':null}));};}exports[_0xbf2d('0x6')]=function(_0x1e8718,_0x1a51f8){return BPromise[_0xbf2d('0x7')]()[_0xbf2d('0x8')](faxAccount[_0xbf2d('0x6')](_0x1e8718,_0x1a51f8))[_0xbf2d('0x9')](loggerCatch('[Notify]\x20'));};
\ No newline at end of file
index 5706cde..dce677e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf45=['info','inspect','../../../../config/logger','bluebird','execute'];(function(_0x14ddaf,_0x316a5b){var _0x5ece0f=function(_0x2cb707){while(--_0x2cb707){_0x14ddaf['push'](_0x14ddaf['shift']());}};_0x5ece0f(++_0x316a5b);}(_0xcf45,0xb1));var _0x5cf4=function(_0x2db8f5,_0x3814f8){_0x2db8f5=_0x2db8f5-0x0;var _0xb3e383=_0xcf45[_0x2db8f5];return _0xb3e383;};'use strict';var util=require('util');var logger=require(_0x5cf4('0x0'))('fax');var BPromise=require(_0x5cf4('0x1'));var exec=require('child_process')['exec'];exports[_0x5cf4('0x2')]=function(_0x35d166){return new BPromise(function(_0x30a641,_0x1b190d){exec(_0x35d166,function(_0x46f5df,_0x24154a,_0x5e5d63){logger[_0x5cf4('0x3')]('Exec\x20gs',_0x24154a);if(_0x46f5df){logger[_0x5cf4('0x3')]('Exec\x20gs','\x20Error\x20:',util[_0x5cf4('0x4')](_0x46f5df,{'showHidden':![],'depth':null}),_0x24154a,_0x5e5d63);_0x1b190d(_0x46f5df);}_0x30a641(_0x24154a);});});};
\ No newline at end of file
+var _0x9553=['util','../../../../config/logger','fax','bluebird','execute','info','Exec\x20gs','\x20Error\x20:','inspect'];(function(_0x5958a6,_0x34a283){var _0x33513f=function(_0x499877){while(--_0x499877){_0x5958a6['push'](_0x5958a6['shift']());}};_0x33513f(++_0x34a283);}(_0x9553,0x1ef));var _0x3955=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x9553[_0x4fbfd9];return _0x31dc94;};'use strict';var util=require(_0x3955('0x0'));var logger=require(_0x3955('0x1'))(_0x3955('0x2'));var BPromise=require(_0x3955('0x3'));var exec=require('child_process')['exec'];exports[_0x3955('0x4')]=function(_0x241ca1){return new BPromise(function(_0x515086,_0x531691){exec(_0x241ca1,function(_0x22a550,_0x22c9dd,_0x3e2459){logger[_0x3955('0x5')](_0x3955('0x6'),_0x22c9dd);if(_0x22a550){logger['info'](_0x3955('0x6'),_0x3955('0x7'),util[_0x3955('0x8')](_0x22a550,{'showHidden':![],'depth':null}),_0x22c9dd,_0x3e2459);_0x531691(_0x22a550);}_0x515086(_0x22c9dd);});});};
\ No newline at end of file
index 9220a87..ebe95a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaeba=['variablesAction','uniqueid','originate','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','moment','fax','logger','info','inspect','addVariables','ecm','headerinfo','minrate','maxrate','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xaeba,0x1ce));var _0xaaeb=function(_0x495923,_0x2c606b){_0x495923=_0x495923-0x0;var _0x58962d=_0xaeba[_0x495923];return _0x58962d;};'use strict';var util=require(_0xaaeb('0x0'));var _=require('lodash');var moment=require(_0xaaeb('0x1'));var logger=require('../../../../config/logger')(_0xaaeb('0x2'));exports['message']=function(_0x28b423){return{'message':_0x28b423};};exports[_0xaaeb('0x3')]=function(_0xe84625,_0x15dab5){logger[_0xaaeb('0x4')](_0xe84625,util[_0xaaeb('0x5')](_0x15dab5,{'showHidden':![],'depth':null}));};exports[_0xaaeb('0x6')]=function(_0xe8a878,_0x3f4621){var _0x4f77ad={'XMF-ECM':_0x3f4621[_0xaaeb('0x7')],'XMF-HEADERINFO':_0x3f4621[_0xaaeb('0x8')],'XMF-MINRATE':_0x3f4621[_0xaaeb('0x9')],'XMF-MAXRATE':_0x3f4621[_0xaaeb('0xa')],'XMF-MODEM':util['format'](_0xaaeb('0xb'),_0x3f4621[_0xaaeb('0xc')]),'XMF-GATEWAY':_0x3f4621[_0xaaeb('0xd')],'XMF-FAXDETECT':_0x3f4621[_0xaaeb('0xe')],'XMF-T38TIMEOUT':_0x3f4621[_0xaaeb('0xf')],'XMF-LOCALSTATIONID':_0x3f4621[_0xaaeb('0x10')],'XMF-PATH':_0xe8a878[_0xaaeb('0x11')]};return _0x4f77ad;};exports[_0xaaeb('0x12')]=function(_0x40c153,_0x53cc0d){return{'actionid':_0x40c153[_0xaaeb('0x13')],'action':_0xaaeb('0x14'),'channel':_0x40c153['channel'],'Exten':_0xaaeb('0x15'),'Context':_0xaaeb('0x16'),'Priority':'1','callerid':util['format'](_0xaaeb('0x17'),_0x40c153[_0xaaeb('0x8')]?_0x40c153['headerinfo']:'',_0x40c153['localstationid']),'variable':_0x53cc0d,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x40c153['uniqueid']};};
\ No newline at end of file
+var _0x3c85=['logger','info','inspect','addVariables','headerinfo','minrate','maxrate','\x22%s\x22','modem','faxdetect','t38timeout','path','variablesAction','xcally-motion-fax','\x22%s\x22\x20<%s>','localstationid','util','lodash','moment','../../../../config/logger','message'];(function(_0x11fd78,_0x1d368d){var _0x112519=function(_0x7296d9){while(--_0x7296d9){_0x11fd78['push'](_0x11fd78['shift']());}};_0x112519(++_0x1d368d);}(_0x3c85,0xb8));var _0x53c8=function(_0x562be4,_0x101f93){_0x562be4=_0x562be4-0x0;var _0x4bfa98=_0x3c85[_0x562be4];return _0x4bfa98;};'use strict';var util=require(_0x53c8('0x0'));var _=require(_0x53c8('0x1'));var moment=require(_0x53c8('0x2'));var logger=require(_0x53c8('0x3'))('fax');exports[_0x53c8('0x4')]=function(_0x1143f2){return{'message':_0x1143f2};};exports[_0x53c8('0x5')]=function(_0x1e09ba,_0xf7d540){logger[_0x53c8('0x6')](_0x1e09ba,util[_0x53c8('0x7')](_0xf7d540,{'showHidden':![],'depth':null}));};exports[_0x53c8('0x8')]=function(_0x10bf07,_0x51c04e){var _0x46d0e0={'XMF-ECM':_0x51c04e['ecm'],'XMF-HEADERINFO':_0x51c04e[_0x53c8('0x9')],'XMF-MINRATE':_0x51c04e[_0x53c8('0xa')],'XMF-MAXRATE':_0x51c04e[_0x53c8('0xb')],'XMF-MODEM':util['format'](_0x53c8('0xc'),_0x51c04e[_0x53c8('0xd')]),'XMF-GATEWAY':_0x51c04e['gateway'],'XMF-FAXDETECT':_0x51c04e[_0x53c8('0xe')],'XMF-T38TIMEOUT':_0x51c04e[_0x53c8('0xf')],'XMF-LOCALSTATIONID':_0x51c04e['localstationid'],'XMF-PATH':_0x10bf07[_0x53c8('0x10')]};return _0x46d0e0;};exports[_0x53c8('0x11')]=function(_0xb83ea,_0x2609fc){return{'actionid':_0xb83ea['uniqueid'],'action':'originate','channel':_0xb83ea['channel'],'Exten':_0x53c8('0x12'),'Context':'from-sip','Priority':'1','callerid':util['format'](_0x53c8('0x13'),_0xb83ea['headerinfo']?_0xb83ea['headerinfo']:'',_0xb83ea[_0x53c8('0x14')]),'variable':_0x2609fc,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0xb83ea['uniqueid']};};
\ No newline at end of file
index 1110826..e5064e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc9c2=['initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','inspect','sync','error','bluebird','util','./server','./realtime','./acw','./trigger','./dialer','./preview','./rpc/user','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/dynamics365','ami','get','hour','then','initTelephones','getTrunks','getTriggers','initTriggers','getTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory'];(function(_0x41b569,_0x35698){var _0x454b22=function(_0x2df710){while(--_0x2df710){_0x41b569['push'](_0x41b569['shift']());}};_0x454b22(++_0x35698);}(_0xc9c2,0x147));var _0x2c9c=function(_0x9171e0,_0x2ee1b3){_0x9171e0=_0x9171e0-0x0;var _0x2659fb=_0xc9c2[_0x9171e0];return _0x2659fb;};'use strict';var BPromise=require(_0x2c9c('0x0'));var util=require(_0x2c9c('0x1'));var moment=require('moment');var server=require(_0x2c9c('0x2'));var Realtime=require(_0x2c9c('0x3'));var Report=require('./report');var Acw=require(_0x2c9c('0x4'));var Trigger=require(_0x2c9c('0x5'));var Dialer=require(_0x2c9c('0x6'));var Preview=require(_0x2c9c('0x7'));var Fax=require('./fax');var user=require(_0x2c9c('0x8'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x2c9c('0x9'));var voiceCallReport=require(_0x2c9c('0xa'));var trunk=require(_0x2c9c('0xb'));var trigger=require('./rpc/trigger');var template=require(_0x2c9c('0xc'));var cmHopperHistory=require(_0x2c9c('0xd'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x2c9c('0xe'));var faxAccount=require(_0x2c9c('0xf'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x2c9c('0x10'));var freshdesk=require(_0x2c9c('0x11'));var desk=require(_0x2c9c('0x12'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x2c9c('0x13'));var freshsales=require(_0x2c9c('0x14'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0x2c9c('0x15'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')(_0x2c9c('0x16'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x2c9c('0x17')](_0x2c9c('0x18'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x2c9c('0x17')](_0x2c9c('0x18'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x2c9c('0x19')](user['getAgents']())['then'](realtime['initAgents']())['then'](user['getTelephones']())[_0x2c9c('0x19')](realtime[_0x2c9c('0x1a')]())[_0x2c9c('0x19')](trunk[_0x2c9c('0x1b')]())[_0x2c9c('0x19')](realtime['initTrunks']())[_0x2c9c('0x19')](voiceQueue['getVoiceQueues']())[_0x2c9c('0x19')](realtime['initVoiceQueues']())[_0x2c9c('0x19')](trigger[_0x2c9c('0x1c')]())['then'](realtime[_0x2c9c('0x1d')]())[_0x2c9c('0x19')](template[_0x2c9c('0x1e')]())['then'](realtime['initTemplates']())[_0x2c9c('0x19')](zendesk[_0x2c9c('0x1f')]())[_0x2c9c('0x19')](realtime[_0x2c9c('0x20')]())['then'](salesforce[_0x2c9c('0x21')]())['then'](realtime['initSalesforceAccounts']())['then'](sugarcrm['getSugarcrmAccounts']())[_0x2c9c('0x19')](realtime[_0x2c9c('0x22')]())['then'](freshdesk[_0x2c9c('0x23')]())['then'](realtime['initFreshdeskAccounts']())[_0x2c9c('0x19')](desk[_0x2c9c('0x24')]())['then'](realtime[_0x2c9c('0x25')]())[_0x2c9c('0x19')](zoho['getZohoAccounts']())[_0x2c9c('0x19')](realtime[_0x2c9c('0x26')]())['then'](vtiger[_0x2c9c('0x27')]())['then'](realtime[_0x2c9c('0x28')]())['then'](freshsales[_0x2c9c('0x29')]())[_0x2c9c('0x19')](realtime['initFreshsalesAccounts']())[_0x2c9c('0x19')](servicenow[_0x2c9c('0x2a')]())['then'](realtime['initServicenowAccounts']())[_0x2c9c('0x19')](dynamics365[_0x2c9c('0x2b')]())['then'](realtime[_0x2c9c('0x2c')]())['then'](campaign[_0x2c9c('0x2d')]())[_0x2c9c('0x19')](realtime[_0x2c9c('0x2e')]())['then'](voiceExtension[_0x2c9c('0x2f')]())[_0x2c9c('0x19')](realtime[_0x2c9c('0x30')]())[_0x2c9c('0x19')](faxAccount[_0x2c9c('0x31')]())[_0x2c9c('0x19')](realtime[_0x2c9c('0x32')]())[_0x2c9c('0x19')](function(){return realtime;});}function initParams(){return BPromise[_0x2c9c('0x33')]()[_0x2c9c('0x19')](voiceQueueReport[_0x2c9c('0x34')]())[_0x2c9c('0x19')](realtime[_0x2c9c('0x35')]())[_0x2c9c('0x19')](cmHopperHistory[_0x2c9c('0x36')]())[_0x2c9c('0x19')](realtime[_0x2c9c('0x37')]())[_0x2c9c('0x19')](cmHopperHistory[_0x2c9c('0x38')]())[_0x2c9c('0x19')](realtime[_0x2c9c('0x39')]())[_0x2c9c('0x19')](voiceCallReport[_0x2c9c('0x3a')]())[_0x2c9c('0x19')](realtime[_0x2c9c('0x3b')]())[_0x2c9c('0x3c')](function(_0x50be66){logger['error']('[index.js][initParams]',util[_0x2c9c('0x3d')](_0x50be66,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0x2c9c('0x19')](function(_0x28347e){return initRealtime();})[_0x2c9c('0x19')](function(){return initParams();})[_0x2c9c('0x19')](function(){report[_0x2c9c('0x3e')]();setInterval(initRealtime,0x1388);})[_0x2c9c('0x3c')](function(_0x560e86){logger[_0x2c9c('0x3f')]('[index.js][main]',util[_0x2c9c('0x3d')](_0x560e86,{'showHidden':![],'depth':null}));});}main();
\ No newline at end of file
+var _0x43a2=['./rpc/voiceExtension','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','ami','get','hour','resolve','getAgents','then','initVoiceQueues','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','initVoiceExtensions','getFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','listen','[index.js][main]','inspect','bluebird','util','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./rpc/campaign'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0x43a2,0x1d9));var _0x243a=function(_0x678e4e,_0x15ef97){_0x678e4e=_0x678e4e-0x0;var _0x182240=_0x43a2[_0x678e4e];return _0x182240;};'use strict';var BPromise=require(_0x243a('0x0'));var util=require(_0x243a('0x1'));var moment=require('moment');var server=require(_0x243a('0x2'));var Realtime=require(_0x243a('0x3'));var Report=require(_0x243a('0x4'));var Acw=require(_0x243a('0x5'));var Trigger=require(_0x243a('0x6'));var Dialer=require(_0x243a('0x7'));var Preview=require(_0x243a('0x8'));var Fax=require(_0x243a('0x9'));var user=require(_0x243a('0xa'));var voiceQueue=require(_0x243a('0xb'));var voiceQueueReport=require(_0x243a('0xc'));var voiceCallReport=require(_0x243a('0xd'));var trunk=require(_0x243a('0xe'));var trigger=require('./rpc/trigger');var template=require(_0x243a('0xf'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x243a('0x10'));var voiceExtension=require(_0x243a('0x11'));var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x243a('0x12'));var salesforce=require(_0x243a('0x13'));var sugarcrm=require(_0x243a('0x14'));var freshdesk=require(_0x243a('0x15'));var desk=require(_0x243a('0x16'));var zoho=require(_0x243a('0x17'));var vtiger=require(_0x243a('0x18'));var freshsales=require(_0x243a('0x19'));var servicenow=require(_0x243a('0x1a'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')(_0x243a('0x1b'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x243a('0x1c')](_0x243a('0x1d'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x243a('0x1c')](_0x243a('0x1d'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x243a('0x1e')]()['then'](user[_0x243a('0x1f')]())[_0x243a('0x20')](realtime['initAgents']())[_0x243a('0x20')](user['getTelephones']())[_0x243a('0x20')](realtime['initTelephones']())['then'](trunk['getTrunks']())[_0x243a('0x20')](realtime['initTrunks']())[_0x243a('0x20')](voiceQueue['getVoiceQueues']())['then'](realtime[_0x243a('0x21')]())[_0x243a('0x20')](trigger['getTriggers']())[_0x243a('0x20')](realtime[_0x243a('0x22')]())[_0x243a('0x20')](template[_0x243a('0x23')]())[_0x243a('0x20')](realtime[_0x243a('0x24')]())[_0x243a('0x20')](zendesk[_0x243a('0x25')]())['then'](realtime[_0x243a('0x26')]())[_0x243a('0x20')](salesforce['getSalesforceAccounts']())[_0x243a('0x20')](realtime[_0x243a('0x27')]())[_0x243a('0x20')](sugarcrm['getSugarcrmAccounts']())['then'](realtime[_0x243a('0x28')]())['then'](freshdesk[_0x243a('0x29')]())[_0x243a('0x20')](realtime[_0x243a('0x2a')]())['then'](desk[_0x243a('0x2b')]())[_0x243a('0x20')](realtime[_0x243a('0x2c')]())['then'](zoho[_0x243a('0x2d')]())[_0x243a('0x20')](realtime[_0x243a('0x2e')]())[_0x243a('0x20')](vtiger[_0x243a('0x2f')]())['then'](realtime[_0x243a('0x30')]())['then'](freshsales[_0x243a('0x31')]())[_0x243a('0x20')](realtime['initFreshsalesAccounts']())[_0x243a('0x20')](servicenow[_0x243a('0x32')]())[_0x243a('0x20')](realtime[_0x243a('0x33')]())[_0x243a('0x20')](dynamics365[_0x243a('0x34')]())[_0x243a('0x20')](realtime[_0x243a('0x35')]())[_0x243a('0x20')](campaign[_0x243a('0x36')]())[_0x243a('0x20')](realtime[_0x243a('0x37')]())[_0x243a('0x20')](voiceExtension['getVoiceExtensions']())[_0x243a('0x20')](realtime[_0x243a('0x38')]())['then'](faxAccount[_0x243a('0x39')]())['then'](realtime['initFaxAccounts']())[_0x243a('0x20')](function(){return realtime;});}function initParams(){return BPromise[_0x243a('0x1e')]()[_0x243a('0x20')](voiceQueueReport[_0x243a('0x3a')]())[_0x243a('0x20')](realtime[_0x243a('0x3b')]())[_0x243a('0x20')](cmHopperHistory[_0x243a('0x3c')]())[_0x243a('0x20')](realtime['initVoiceQueueHopperHistory']())[_0x243a('0x20')](cmHopperHistory[_0x243a('0x3d')]())[_0x243a('0x20')](realtime[_0x243a('0x3e')]())[_0x243a('0x20')](voiceCallReport[_0x243a('0x3f')]())[_0x243a('0x20')](realtime[_0x243a('0x40')]())[_0x243a('0x41')](function(_0x4e6c7d){logger[_0x243a('0x42')]('[index.js][initParams]',util['inspect'](_0x4e6c7d,{'showHidden':![],'depth':null}));});}function main(){return server[_0x243a('0x43')](realtime,preview,fax)[_0x243a('0x20')](function(_0x7843a4){return initRealtime();})[_0x243a('0x20')](function(){return initParams();})['then'](function(){report['sync']();setInterval(initRealtime,0x1388);})['catch'](function(_0x45f255){logger[_0x243a('0x42')](_0x243a('0x44'),util[_0x243a('0x45')](_0x45f255,{'showHidden':![],'depth':null}));});}main();
\ No newline at end of file
index 20f9c35..dedf716 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','stateTime','address','voiceStatusQueue','stringify','format','user:%s','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','state','status','unknown'];(function(_0x34190e,_0x50ecc7){var _0x41a4e6=function(_0x4a9ad9){while(--_0x4a9ad9){_0x34190e['push'](_0x34190e['shift']());}};_0x41a4e6(++_0x50ecc7);}(_0x9c44,0x178));var _0x49c4=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x9c44[_0x2b7764];return _0x848dcb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var Redis=require(_0x49c4('0x2'));var config=require(_0x49c4('0x3'));config[_0x49c4('0x4')]=_[_0x49c4('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x49c4('0x6'))(new Redis(config['redis']));function Agent(_0xc1278f){this['id']=_0xc1278f['id']||0x0;this[_0x49c4('0x7')]=_0xc1278f[_0x49c4('0x7')]||'';this[_0x49c4('0x8')]=_0xc1278f[_0x49c4('0x8')]||'';this['accountcode']=_0xc1278f[_0x49c4('0x9')]||'';this[_0x49c4('0xa')]=_0xc1278f[_0x49c4('0xa')]||'';this[_0x49c4('0xb')]='unknown';this['stateTime']=0x0;this[_0x49c4('0xc')]=_0x49c4('0xd');this['address']='';this[_0x49c4('0xe')]='';this[_0x49c4('0xf')]='';this['interface']='';this['online']=_0xc1278f[_0x49c4('0x10')]||![];this[_0x49c4('0x11')]='unknown';this[_0x49c4('0x12')]=0x0;this[_0x49c4('0x13')]='';this['voiceStatusQueue']='';this[_0x49c4('0x14')]=![];this[_0x49c4('0x15')]=![];this[_0x49c4('0x1')]='';}Agent[_0x49c4('0x16')][_0x49c4('0x17')]=function(_0x18211c){var _0x75ea8;if(_0x18211c&&_0x18211c[_0x49c4('0xb')]){_0x75ea8=_0x18211c['state'][_0x49c4('0x18')]();switch(_0x75ea8){case _0x49c4('0x19'):_0x75ea8=_0x49c4('0x1a');break;case _0x49c4('0x1b'):_0x75ea8=_0x49c4('0x1c');break;}}if(_0x75ea8&&this['voiceStatus']!==_0x75ea8||_0x18211c[_0x49c4('0x1d')]){this[_0x49c4('0x12')]=_['toNumber'](moment()['format']('x'));}if(_0x75ea8){this[_0x49c4('0x11')]=_0x75ea8;}var _0x2f82d5={'id':this['id'],'name':this[_0x49c4('0x7')],'email':this['email'],'accountcode':this[_0x49c4('0x9')],'fullname':this['fullname'],'state':this[_0x49c4('0xb')],'stateTime':this[_0x49c4('0x1e')],'status':this[_0x49c4('0xc')],'address':this[_0x49c4('0x1f')],'online':this[_0x49c4('0x10')],'voiceStatus':this[_0x49c4('0x11')],'voiceStatusTime':this[_0x49c4('0x12')],'voiceStatusCallerIdNumber':this[_0x49c4('0x13')],'voiceStatusQueue':this[_0x49c4('0x20')],'interface':this['interface'],'onhold':this['onhold']};var _0x57f502=md5(JSON[_0x49c4('0x21')](_0x2f82d5));if(this['md5']!==_0x57f502){this['md5']=_0x57f502;io['to'](util[_0x49c4('0x22')](_0x49c4('0x23'),_0x2f82d5[_0x49c4('0x7')]))[_0x49c4('0x24')]('user:save',_0x2f82d5);io['emit'](_0x49c4('0x25'),_0x2f82d5);}};module[_0x49c4('0x26')]=Agent;
\ No newline at end of file
+var _0xa9e0=['stateTime','status','address','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','local','md5','prototype','updateStatusRealtime','not_inuse','inuse','talking','statePause','toNumber','format','fullname','stringify','user:%s','emit','user:save','user:presence','exports','lodash','util','moment','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','email','accountcode','state','unknown'];(function(_0x310a54,_0x212d9a){var _0x4e4caa=function(_0x6baec9){while(--_0x6baec9){_0x310a54['push'](_0x310a54['shift']());}};_0x4e4caa(++_0x212d9a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));config['redis']=_[_0x0a9e('0x4')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x6'),'port':0x18eb});var io=require(_0x0a9e('0x7'))(new Redis(config[_0x0a9e('0x5')]));function Agent(_0x57b080){this['id']=_0x57b080['id']||0x0;this[_0x0a9e('0x8')]=_0x57b080[_0x0a9e('0x8')]||'';this[_0x0a9e('0x9')]=_0x57b080['email']||'';this['accountcode']=_0x57b080[_0x0a9e('0xa')]||'';this['fullname']=_0x57b080['fullname']||'';this[_0x0a9e('0xb')]=_0x0a9e('0xc');this[_0x0a9e('0xd')]=0x0;this[_0x0a9e('0xe')]=_0x0a9e('0xc');this[_0x0a9e('0xf')]='';this['phone']='';this['mobile']='';this['interface']='';this['online']=_0x57b080[_0x0a9e('0x10')]||![];this[_0x0a9e('0x11')]=_0x0a9e('0xc');this[_0x0a9e('0x12')]=0x0;this[_0x0a9e('0x13')]='';this[_0x0a9e('0x14')]='';this['onhold']=![];this[_0x0a9e('0x15')]=![];this[_0x0a9e('0x16')]='';}Agent[_0x0a9e('0x17')][_0x0a9e('0x18')]=function(_0x44dcfd){var _0x4d5611;if(_0x44dcfd&&_0x44dcfd['state']){_0x4d5611=_0x44dcfd[_0x0a9e('0xb')]['toLowerCase']();switch(_0x4d5611){case _0x0a9e('0x19'):_0x4d5611='idle';break;case _0x0a9e('0x1a'):_0x4d5611=_0x0a9e('0x1b');break;}}if(_0x4d5611&&this['voiceStatus']!==_0x4d5611||_0x44dcfd[_0x0a9e('0x1c')]){this['voiceStatusTime']=_[_0x0a9e('0x1d')](moment()[_0x0a9e('0x1e')]('x'));}if(_0x4d5611){this[_0x0a9e('0x11')]=_0x4d5611;}var _0x205fd6={'id':this['id'],'name':this[_0x0a9e('0x8')],'email':this[_0x0a9e('0x9')],'accountcode':this[_0x0a9e('0xa')],'fullname':this[_0x0a9e('0x1f')],'state':this[_0x0a9e('0xb')],'stateTime':this[_0x0a9e('0xd')],'status':this[_0x0a9e('0xe')],'address':this[_0x0a9e('0xf')],'online':this['online'],'voiceStatus':this[_0x0a9e('0x11')],'voiceStatusTime':this[_0x0a9e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x0a9e('0x14')],'interface':this['interface'],'onhold':this['onhold']};var _0x3a02e1=md5(JSON[_0x0a9e('0x20')](_0x205fd6));if(this[_0x0a9e('0x16')]!==_0x3a02e1){this[_0x0a9e('0x16')]=_0x3a02e1;io['to'](util['format'](_0x0a9e('0x21'),_0x205fd6[_0x0a9e('0x8')]))[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x205fd6);io[_0x0a9e('0x22')](_0x0a9e('0x24'),_0x205fd6);}};module[_0x0a9e('0x25')]=Agent;
\ No newline at end of file
index c854c9d..8c1a000 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c97=['SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','temp','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval'];(function(_0x4623eb,_0x45c865){var _0x3071b5=function(_0x48349e){while(--_0x48349e){_0x4623eb['push'](_0x4623eb['shift']());}};_0x3071b5(++_0x45c865);}(_0x9c97,0x12b));var _0x79c9=function(_0x598d2d,_0x365030){_0x598d2d=_0x598d2d-0x0;var _0x338871=_0x9c97[_0x598d2d];return _0x338871;};'use strict';function Campaign(_0xf53ce5){this['id']=_0xf53ce5['id']||0x0;this[_0x79c9('0x0')]=_0xf53ce5[_0x79c9('0x0')]||'';this[_0x79c9('0x1')]=_0xf53ce5[_0x79c9('0x1')]||_0x79c9('0x2');this['originated']=0x0;this[_0x79c9('0x3')]=0x0;this['ivrAnswerCallsDay']=0x0;this['ivrTotalCallsDays']=0x0;this['message']='';this[_0x79c9('0x4')]=!![];this[_0x79c9('0x5')]=_0xf53ce5[_0x79c9('0x5')];this[_0x79c9('0x6')]=_0xf53ce5[_0x79c9('0x6')];this[_0x79c9('0x7')]=_0xf53ce5['dialTimezone']||null;this[_0x79c9('0x8')]=_0xf53ce5[_0x79c9('0x8')]?_0xf53ce5[_0x79c9('0x8')]:null;this['dialOriginateCallerIdName']=_0xf53ce5[_0x79c9('0x9')];this[_0x79c9('0xa')]=_0xf53ce5[_0x79c9('0xa')];this[_0x79c9('0xb')]=_0xf53ce5[_0x79c9('0xb')]||0x1e;this['dialCongestionMaxRetry']=_0xf53ce5[_0x79c9('0xc')];this['dialCongestionRetryFrequency']=_0xf53ce5[_0x79c9('0xd')];this['dialBusyMaxRetry']=_0xf53ce5[_0x79c9('0xe')];this['dialBusyRetryFrequency']=_0xf53ce5[_0x79c9('0xf')];this[_0x79c9('0x10')]=_0xf53ce5[_0x79c9('0x10')];this[_0x79c9('0x11')]=_0xf53ce5[_0x79c9('0x11')];this[_0x79c9('0x12')]=_0xf53ce5[_0x79c9('0x12')];this[_0x79c9('0x13')]=_0xf53ce5[_0x79c9('0x13')]||0x3;this[_0x79c9('0x14')]=_0xf53ce5[_0x79c9('0x14')]||0x96;this[_0x79c9('0x15')]=_0xf53ce5[_0x79c9('0x15')]||0x3;this['dialDropRetryFrequency']=_0xf53ce5[_0x79c9('0x16')]||0x96;this[_0x79c9('0x17')]=_0xf53ce5['dialAbandonedMaxRetry']||0x3;this[_0x79c9('0x18')]=_0xf53ce5[_0x79c9('0x18')]||0x96;this[_0x79c9('0x19')]=_0xf53ce5['dialMachineMaxRetry']||0x3;this[_0x79c9('0x1a')]=_0xf53ce5[_0x79c9('0x1a')]||0x96;this['dialAgentRejectMaxRetry']=_0xf53ce5[_0x79c9('0x1b')]||0x3;this[_0x79c9('0x1c')]=_0xf53ce5['dialAgentRejectRetryFrequency']||0x96;this[_0x79c9('0x1d')]=_0xf53ce5[_0x79c9('0x1d')]||_0x79c9('0x1e');this[_0x79c9('0x1f')]=_0xf53ce5[_0x79c9('0x1f')]||undefined;this[_0x79c9('0x20')]=_0xf53ce5[_0x79c9('0x20')]||undefined;this[_0x79c9('0x21')]=_0xf53ce5[_0x79c9('0x21')]||undefined;this[_0x79c9('0x22')]=_0xf53ce5['TrunkBackup']?_0xf53ce5['TrunkBackup']:undefined;this[_0x79c9('0x23')]=_0xf53ce5[_0x79c9('0x23')]?_0xf53ce5['Trunk']:undefined;this[_0x79c9('0x24')]=_0xf53ce5[_0x79c9('0x24')]?_0xf53ce5[_0x79c9('0x24')]:undefined;this[_0x79c9('0x25')]=_0xf53ce5[_0x79c9('0x25')]?_0xf53ce5[_0x79c9('0x25')]:undefined;this[_0x79c9('0x26')]=_0xf53ce5[_0x79c9('0x25')]?_0xf53ce5['SquareProject'][_0x79c9('0x0')]:undefined;this[_0x79c9('0x27')]=_0xf53ce5[_0x79c9('0x27')]||![];this[_0x79c9('0x28')]=_0xf53ce5[_0x79c9('0x28')];this[_0x79c9('0x29')]=_0xf53ce5[_0x79c9('0x29')];this['dialAMDAfterGreetingSilence']=_0xf53ce5['dialAMDAfterGreetingSilence'];this[_0x79c9('0x2a')]=_0xf53ce5[_0x79c9('0x2a')];this['dialAMDMinWordLength']=_0xf53ce5['dialAMDMinWordLength'];this[_0x79c9('0x2b')]=_0xf53ce5[_0x79c9('0x2b')];this['dialAMDMaximumNumberOfWords']=_0xf53ce5[_0x79c9('0x2c')];this[_0x79c9('0x2d')]=_0xf53ce5[_0x79c9('0x2d')];this[_0x79c9('0x2e')]=_0xf53ce5['dialAMDMaximumWordLength'];}module[_0x79c9('0x2f')]=Campaign;
\ No newline at end of file
+var _0xe407=['dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold'];(function(_0x1c074c,_0x3611c){var _0x3e2b30=function(_0x36d925){while(--_0x36d925){_0x1c074c['push'](_0x1c074c['shift']());}};_0x3e2b30(++_0x3611c);}(_0xe407,0x1bb));var _0x7e40=function(_0x2b7f7f,_0x59b5f2){_0x2b7f7f=_0x2b7f7f-0x0;var _0x6ac389=_0xe407[_0x2b7f7f];return _0x6ac389;};'use strict';function Campaign(_0x35e45c){this['id']=_0x35e45c['id']||0x0;this[_0x7e40('0x0')]=_0x35e45c['name']||'';this['type']=_0x35e45c[_0x7e40('0x1')]||_0x7e40('0x2');this[_0x7e40('0x3')]=0x0;this[_0x7e40('0x4')]=0x0;this[_0x7e40('0x5')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0x7e40('0x6')]='';this[_0x7e40('0x7')]=!![];this['active']=_0x35e45c[_0x7e40('0x8')];this[_0x7e40('0x9')]=_0x35e45c['limitCalls'];this[_0x7e40('0xa')]=_0x35e45c['dialTimezone']||null;this['dialGlobalInterval']=_0x35e45c['dialGlobalInterval']?_0x35e45c[_0x7e40('0xb')]:null;this[_0x7e40('0xc')]=_0x35e45c[_0x7e40('0xc')];this[_0x7e40('0xd')]=_0x35e45c[_0x7e40('0xd')];this[_0x7e40('0xe')]=_0x35e45c[_0x7e40('0xe')]||0x1e;this[_0x7e40('0xf')]=_0x35e45c[_0x7e40('0xf')];this[_0x7e40('0x10')]=_0x35e45c[_0x7e40('0x10')];this['dialBusyMaxRetry']=_0x35e45c[_0x7e40('0x11')];this[_0x7e40('0x12')]=_0x35e45c['dialBusyRetryFrequency'];this[_0x7e40('0x13')]=_0x35e45c[_0x7e40('0x13')];this[_0x7e40('0x14')]=_0x35e45c[_0x7e40('0x14')];this['dialGlobalMaxRetry']=_0x35e45c[_0x7e40('0x15')];this[_0x7e40('0x16')]=_0x35e45c['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x35e45c[_0x7e40('0x17')]||0x96;this[_0x7e40('0x18')]=_0x35e45c[_0x7e40('0x18')]||0x3;this[_0x7e40('0x19')]=_0x35e45c[_0x7e40('0x19')]||0x96;this[_0x7e40('0x1a')]=_0x35e45c[_0x7e40('0x1a')]||0x3;this[_0x7e40('0x1b')]=_0x35e45c[_0x7e40('0x1b')]||0x96;this[_0x7e40('0x1c')]=_0x35e45c['dialMachineMaxRetry']||0x3;this[_0x7e40('0x1d')]=_0x35e45c[_0x7e40('0x1d')]||0x96;this[_0x7e40('0x1e')]=_0x35e45c['dialAgentRejectMaxRetry']||0x3;this['dialAgentRejectRetryFrequency']=_0x35e45c['dialAgentRejectRetryFrequency']||0x96;this['dialOrderByScheduledAt']=_0x35e45c[_0x7e40('0x1f')]||'DESC';this[_0x7e40('0x20')]=_0x35e45c[_0x7e40('0x20')]||undefined;this[_0x7e40('0x21')]=_0x35e45c[_0x7e40('0x21')]||undefined;this['dialCutDigit']=_0x35e45c[_0x7e40('0x22')]||undefined;this[_0x7e40('0x23')]=_0x35e45c[_0x7e40('0x23')]?_0x35e45c[_0x7e40('0x23')]:undefined;this['Trunk']=_0x35e45c[_0x7e40('0x24')]?_0x35e45c[_0x7e40('0x24')]:undefined;this[_0x7e40('0x25')]=_0x35e45c['Interval']?_0x35e45c['Interval']:undefined;this[_0x7e40('0x26')]=_0x35e45c[_0x7e40('0x26')]?_0x35e45c[_0x7e40('0x26')]:undefined;this[_0x7e40('0x27')]=_0x35e45c[_0x7e40('0x26')]?_0x35e45c[_0x7e40('0x26')][_0x7e40('0x0')]:undefined;this['dialAMDActive']=_0x35e45c[_0x7e40('0x28')]||![];this['dialAMDInitialSilence']=_0x35e45c['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x35e45c[_0x7e40('0x29')];this[_0x7e40('0x2a')]=_0x35e45c[_0x7e40('0x2a')];this['dialAMDTotalAnalysisTime']=_0x35e45c['dialAMDTotalAnalysisTime'];this[_0x7e40('0x2b')]=_0x35e45c[_0x7e40('0x2b')];this['dialAMDBetweenWordsSilence']=_0x35e45c[_0x7e40('0x2c')];this['dialAMDMaximumNumberOfWords']=_0x35e45c[_0x7e40('0x2d')];this[_0x7e40('0x2e')]=_0x35e45c[_0x7e40('0x2e')];this[_0x7e40('0x2f')]=_0x35e45c[_0x7e40('0x2f')];}module[_0x7e40('0x30')]=Campaign;
\ No newline at end of file
index 328d56d..8ec82d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3792=['unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','type','tag','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferType','mohtime','starttime','channel','calleridnum','calleridname','connectedlinenum','connectedlinename','context','uniqueid','linkedid','exten','answered','answertime','endtime'];(function(_0x527555,_0x2aec42){var _0x52ffe3=function(_0x392f8e){while(--_0x392f8e){_0x527555['push'](_0x527555['shift']());}};_0x52ffe3(++_0x2aec42);}(_0x3792,0xbe));var _0x2379=function(_0x112dbc,_0x222788){_0x112dbc=_0x112dbc-0x0;var _0x2542e4=_0x3792[_0x112dbc];return _0x2542e4;};'use strict';function Channel(){this[_0x2379('0x0')]=null;this[_0x2379('0x1')]='';this['destinationchannel']='';this[_0x2379('0x2')]=0x0;this[_0x2379('0x3')]='';this[_0x2379('0x4')]=undefined;this[_0x2379('0x5')]=undefined;this['accountcode']=0x0;this[_0x2379('0x6')]='';this[_0x2379('0x7')]=0x0;this[_0x2379('0x8')]=0x0;this[_0x2379('0x9')]=0x0;this[_0x2379('0xa')]=![];this[_0x2379('0xb')]=null;this[_0x2379('0xc')]=null;this[_0x2379('0xd')]=![];this[_0x2379('0xe')]=![];this[_0x2379('0xf')]='';this[_0x2379('0x10')]='';this[_0x2379('0x11')]=0x0;this[_0x2379('0x12')]=0x0;this[_0x2379('0x13')]=0x0;this[_0x2379('0x14')]=null;this[_0x2379('0x15')]=null;this['disposition']=null;this[_0x2379('0x16')]=![];this[_0x2379('0x17')]=null;this[_0x2379('0x18')]=null;this[_0x2379('0x19')]=[];this[_0x2379('0x1a')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x2379('0x1b')]=undefined;this[_0x2379('0x1c')]=0x0;}module['exports']=Channel;
\ No newline at end of file
+var _0x8863=['exports','channel','destinationchannel','calleridnum','calleridname','uniqueid','linkedid','answered','answertime','unmanaged','abandoned','lastapplication','lastdata','billableseconds','holdtime','type','tag','disposition','monitorFilename','queue','monitors','transferType','mohtime'];(function(_0x32e90a,_0x317d6f){var _0x3ad167=function(_0x5ece84){while(--_0x5ece84){_0x32e90a['push'](_0x32e90a['shift']());}};_0x3ad167(++_0x317d6f);}(_0x8863,0x1b6));var _0x3886=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0x8863[_0x5e3b04];return _0x1fc44d;};'use strict';function Channel(){this['starttime']=null;this[_0x3886('0x0')]='';this[_0x3886('0x1')]='';this[_0x3886('0x2')]=0x0;this[_0x3886('0x3')]='';this['connectedlinenum']=undefined;this['connectedlinename']=undefined;this['accountcode']=0x0;this['context']='';this[_0x3886('0x4')]=0x0;this[_0x3886('0x5')]=0x0;this['exten']=0x0;this[_0x3886('0x6')]=![];this[_0x3886('0x7')]=null;this['endtime']=null;this[_0x3886('0x8')]=![];this[_0x3886('0x9')]=![];this[_0x3886('0xa')]='';this[_0x3886('0xb')]='';this['duration']=0x0;this[_0x3886('0xc')]=0x0;this[_0x3886('0xd')]=0x0;this[_0x3886('0xe')]=null;this[_0x3886('0xf')]=null;this[_0x3886('0x10')]=null;this['monitor']=![];this[_0x3886('0x11')]=null;this[_0x3886('0x12')]=null;this[_0x3886('0x13')]=[];this['transfercalleridnum']=undefined;this['transferconnectedlinenum']=undefined;this[_0x3886('0x14')]=undefined;this[_0x3886('0x15')]=0x0;}module[_0x3886('0x16')]=Channel;
\ No newline at end of file
index 0e4e875..8a73ec7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22d0=['token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret'];(function(_0x2cbfe5,_0x1fb99b){var _0x3f69ad=function(_0x10b7c6){while(--_0x10b7c6){_0x2cbfe5['push'](_0x2cbfe5['shift']());}};_0x3f69ad(++_0x1fb99b);}(_0x22d0,0x158));var _0x022d=function(_0x53b8e0,_0x55d46e){_0x53b8e0=_0x53b8e0-0x0;var _0x10630c=_0x22d0[_0x53b8e0];return _0x10630c;};'use strict';function DeskAccount(_0x2d7f0e){this['id']=_0x2d7f0e['id']||0x0;this['name']=_0x2d7f0e[_0x022d('0x0')]||'';this['username']=_0x2d7f0e[_0x022d('0x1')]||'';this['remoteUri']=_0x2d7f0e[_0x022d('0x2')]||'';this['authType']=_0x2d7f0e[_0x022d('0x3')]||'';this[_0x022d('0x4')]=_0x2d7f0e[_0x022d('0x4')]||'';this[_0x022d('0x5')]=_0x2d7f0e[_0x022d('0x5')]||'';this['consumerSecret']=_0x2d7f0e[_0x022d('0x6')]||'';this[_0x022d('0x7')]=_0x2d7f0e[_0x022d('0x7')]||'';this[_0x022d('0x8')]=_0x2d7f0e[_0x022d('0x8')]||'';this[_0x022d('0x9')]=_0x2d7f0e['type']||'';this[_0x022d('0xa')]=_0x2d7f0e[_0x022d('0xa')]||'';this[_0x022d('0xb')]=_0x2d7f0e[_0x022d('0xb')]||{};}module[_0x022d('0xc')]=DeskAccount;
\ No newline at end of file
+var _0xc836=['Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl'];(function(_0x4b66c5,_0x2cc904){var _0x1a29b1=function(_0x52296c){while(--_0x52296c){_0x4b66c5['push'](_0x4b66c5['shift']());}};_0x1a29b1(++_0x2cc904);}(_0xc836,0x147));var _0x6c83=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc836[_0x3dd15e];return _0x231fd0;};'use strict';function DeskAccount(_0x667df3){this['id']=_0x667df3['id']||0x0;this['name']=_0x667df3[_0x6c83('0x0')]||'';this[_0x6c83('0x1')]=_0x667df3[_0x6c83('0x1')]||'';this[_0x6c83('0x2')]=_0x667df3[_0x6c83('0x2')]||'';this[_0x6c83('0x3')]=_0x667df3['authType']||'';this[_0x6c83('0x4')]=_0x667df3[_0x6c83('0x4')]||'';this['consumerKey']=_0x667df3[_0x6c83('0x5')]||'';this[_0x6c83('0x6')]=_0x667df3[_0x6c83('0x6')]||'';this[_0x6c83('0x7')]=_0x667df3[_0x6c83('0x7')]||'';this[_0x6c83('0x8')]=_0x667df3[_0x6c83('0x8')]||'';this[_0x6c83('0x9')]=_0x667df3[_0x6c83('0x9')]||'';this[_0x6c83('0xa')]=_0x667df3[_0x6c83('0xa')]||'';this['Configurations']=_0x667df3[_0x6c83('0xb')]||{};}module[_0x6c83('0xc')]=DeskAccount;
\ No newline at end of file
index 5b4a419..7a0d220 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a1a=['CloudProvider','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication'];(function(_0x8b6818,_0x22529e){var _0x49ac3f=function(_0x17ce7f){while(--_0x17ce7f){_0x8b6818['push'](_0x8b6818['shift']());}};_0x49ac3f(++_0x22529e);}(_0x7a1a,0x120));var _0xa7a1=function(_0x17952a,_0x4fd513){_0x17952a=_0x17952a-0x0;var _0x483687=_0x7a1a[_0x17952a];return _0x483687;};'use strict';function Dynamics365Account(_0x4218a8){this['id']=_0x4218a8['id']||0x0;this[_0xa7a1('0x0')]=_0x4218a8['name']||'';this[_0xa7a1('0x1')]=_0x4218a8[_0xa7a1('0x1')]||'';this[_0xa7a1('0x2')]=_0x4218a8['password']||'';this[_0xa7a1('0x3')]=_0x4218a8[_0xa7a1('0x3')]||'';this[_0xa7a1('0x4')]=_0x4218a8[_0xa7a1('0x4')]||'';this[_0xa7a1('0x5')]=_0x4218a8[_0xa7a1('0x5')]||'';this[_0xa7a1('0x6')]=_0x4218a8['clientSecret']||{};this['serverUrl']=_0x4218a8[_0xa7a1('0x7')]||'';this[_0xa7a1('0x8')]=_0x4218a8['modernAuthentication']||![];this['Configurations']=_0x4218a8['Configurations']||{};this[_0xa7a1('0x9')]=_0x4218a8[_0xa7a1('0x9')]||{};}module[_0xa7a1('0xa')]=Dynamics365Account;
\ No newline at end of file
+var _0x05f9=['serverUrl','modernAuthentication','Configurations','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret'];(function(_0x343ec6,_0x2499b5){var _0x151e1b=function(_0x5020ee){while(--_0x5020ee){_0x343ec6['push'](_0x343ec6['shift']());}};_0x151e1b(++_0x2499b5);}(_0x05f9,0xf6));var _0x905f=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x05f9[_0x6c993a];return _0x27f547;};'use strict';function Dynamics365Account(_0x2c2cf4){this['id']=_0x2c2cf4['id']||0x0;this[_0x905f('0x0')]=_0x2c2cf4[_0x905f('0x0')]||'';this[_0x905f('0x1')]=_0x2c2cf4[_0x905f('0x1')]||'';this[_0x905f('0x2')]=_0x2c2cf4[_0x905f('0x2')]||'';this['remoteUri']=_0x2c2cf4[_0x905f('0x3')]||'';this[_0x905f('0x4')]=_0x2c2cf4[_0x905f('0x4')]||'';this[_0x905f('0x5')]=_0x2c2cf4[_0x905f('0x5')]||'';this['clientSecret']=_0x2c2cf4[_0x905f('0x6')]||{};this[_0x905f('0x7')]=_0x2c2cf4[_0x905f('0x7')]||'';this[_0x905f('0x8')]=_0x2c2cf4[_0x905f('0x8')]||![];this['Configurations']=_0x2c2cf4[_0x905f('0x9')]||{};this['CloudProvider']=_0x2c2cf4['CloudProvider']||{};}module[_0x905f('0xa')]=Dynamics365Account;
\ No newline at end of file
index c73e3c5..c7f7de1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c1f=['maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x3c1f,0x1ce));var _0xf3c1=function(_0x3bb002,_0x22e35c){_0x3bb002=_0x3bb002-0x0;var _0x5976c4=_0x3c1f[_0x3bb002];return _0x5976c4;};'use strict';function FaxAccount(_0x90af12){this['id']=_0x90af12['id']||0x0;this['name']=_0x90af12[_0xf3c1('0x0')]||'';this[_0xf3c1('0x1')]=_0x90af12[_0xf3c1('0x1')];this['ecm']=_0x90af12[_0xf3c1('0x2')];this[_0xf3c1('0x3')]=_0x90af12[_0xf3c1('0x3')];this[_0xf3c1('0x4')]=_0x90af12[_0xf3c1('0x4')];this[_0xf3c1('0x5')]=_0x90af12[_0xf3c1('0x5')]||0x960;this[_0xf3c1('0x6')]=_0x90af12[_0xf3c1('0x6')]||0x3840;this[_0xf3c1('0x7')]=_0x90af12['modem']||_0xf3c1('0x8');this[_0xf3c1('0x9')]=_0x90af12[_0xf3c1('0x9')]||'no';this[_0xf3c1('0xa')]=_0x90af12[_0xf3c1('0xa')]||'no';this[_0xf3c1('0xb')]=_0x90af12[_0xf3c1('0xb')]||0x1388;this[_0xf3c1('0xc')]=_0x90af12['tech']||_0xf3c1('0xd');this[_0xf3c1('0xe')]=_0x90af12[_0xf3c1('0xe')]?_0x90af12[_0xf3c1('0xe')]:undefined;this[_0xf3c1('0xf')]=_0x90af12[_0xf3c1('0xf')];this[_0xf3c1('0x10')]=_0x90af12['key'];}module[_0xf3c1('0x11')]=FaxAccount;
\ No newline at end of file
+var _0x08b4=['key','description','ecm','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId'];(function(_0xa0b4e1,_0x4cc3e2){var _0x5c8098=function(_0x122547){while(--_0x122547){_0xa0b4e1['push'](_0xa0b4e1['shift']());}};_0x5c8098(++_0x4cc3e2);}(_0x08b4,0x135));var _0x408b=function(_0x1a2d1c,_0x4a1873){_0x1a2d1c=_0x1a2d1c-0x0;var _0x56eb67=_0x08b4[_0x1a2d1c];return _0x56eb67;};'use strict';function FaxAccount(_0x37304b){this['id']=_0x37304b['id']||0x0;this['name']=_0x37304b['name']||'';this[_0x408b('0x0')]=_0x37304b[_0x408b('0x0')];this[_0x408b('0x1')]=_0x37304b[_0x408b('0x1')];this['headerinfo']=_0x37304b['headerinfo'];this[_0x408b('0x2')]=_0x37304b[_0x408b('0x2')];this['minrate']=_0x37304b[_0x408b('0x3')]||0x960;this['maxrate']=_0x37304b[_0x408b('0x4')]||0x3840;this['modem']=_0x37304b[_0x408b('0x5')]||'v17,v27,v29';this['gateway']=_0x37304b[_0x408b('0x6')]||'no';this[_0x408b('0x7')]=_0x37304b[_0x408b('0x7')]||'no';this[_0x408b('0x8')]=_0x37304b[_0x408b('0x8')]||0x1388;this['tech']=_0x37304b[_0x408b('0x9')]||_0x408b('0xa');this['Trunk']=_0x37304b['Trunk']?_0x37304b[_0x408b('0xb')]:undefined;this[_0x408b('0xc')]=_0x37304b[_0x408b('0xc')];this[_0x408b('0xd')]=_0x37304b[_0x408b('0xd')];}module['exports']=FaxAccount;
\ No newline at end of file
index 999e534..f6f6ecd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf37e=['name','username','apiKey','token','remoteUri','serverUrl','Configurations'];(function(_0x55c258,_0x46a1df){var _0x1d49c1=function(_0xd7c8fa){while(--_0xd7c8fa){_0x55c258['push'](_0x55c258['shift']());}};_0x1d49c1(++_0x46a1df);}(_0xf37e,0x18f));var _0xef37=function(_0x5c080b,_0x3e4824){_0x5c080b=_0x5c080b-0x0;var _0x3e90c2=_0xf37e[_0x5c080b];return _0x3e90c2;};'use strict';function FreshdeskAccount(_0x1647b5){this['id']=_0x1647b5['id']||0x0;this[_0xef37('0x0')]=_0x1647b5[_0xef37('0x0')]||'';this[_0xef37('0x1')]=_0x1647b5[_0xef37('0x1')]||'';this[_0xef37('0x2')]=_0x1647b5[_0xef37('0x3')]||'';this[_0xef37('0x4')]=_0x1647b5[_0xef37('0x4')]||'';this[_0xef37('0x5')]=_0x1647b5['serverUrl']||'';this[_0xef37('0x6')]=_0x1647b5[_0xef37('0x6')]||{};}module['exports']=FreshdeskAccount;
\ No newline at end of file
+var _0x7cb4=['apiKey','token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x7cb4,0x1ee));var _0x47cb=function(_0x21c440,_0x5e852a){_0x21c440=_0x21c440-0x0;var _0x225a51=_0x7cb4[_0x21c440];return _0x225a51;};'use strict';function FreshdeskAccount(_0x4b9b3d){this['id']=_0x4b9b3d['id']||0x0;this[_0x47cb('0x0')]=_0x4b9b3d[_0x47cb('0x0')]||'';this[_0x47cb('0x1')]=_0x4b9b3d[_0x47cb('0x1')]||'';this[_0x47cb('0x2')]=_0x4b9b3d[_0x47cb('0x3')]||'';this[_0x47cb('0x4')]=_0x4b9b3d[_0x47cb('0x4')]||'';this[_0x47cb('0x5')]=_0x4b9b3d[_0x47cb('0x5')]||'';this[_0x47cb('0x6')]=_0x4b9b3d[_0x47cb('0x6')]||{};}module[_0x47cb('0x7')]=FreshdeskAccount;
\ No newline at end of file
index 05db9f4..d290526 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4cfd=['name','username','apiKey','token','remoteUri','serverUrl','Configurations','exports'];(function(_0xb4ea5,_0x335ea9){var _0x19aa4b=function(_0x4e1831){while(--_0x4e1831){_0xb4ea5['push'](_0xb4ea5['shift']());}};_0x19aa4b(++_0x335ea9);}(_0x4cfd,0x170));var _0xd4cf=function(_0x817d9b,_0x3c37e3){_0x817d9b=_0x817d9b-0x0;var _0x2752e1=_0x4cfd[_0x817d9b];return _0x2752e1;};'use strict';function FreshsalesAccount(_0x2adf32){this['id']=_0x2adf32['id']||0x0;this[_0xd4cf('0x0')]=_0x2adf32['name']||'';this[_0xd4cf('0x1')]=_0x2adf32[_0xd4cf('0x1')]||'';this[_0xd4cf('0x2')]=_0x2adf32[_0xd4cf('0x3')]||'';this[_0xd4cf('0x4')]=_0x2adf32[_0xd4cf('0x4')]||'';this['serverUrl']=_0x2adf32[_0xd4cf('0x5')]||'';this[_0xd4cf('0x6')]=_0x2adf32[_0xd4cf('0x6')]||{};}module[_0xd4cf('0x7')]=FreshsalesAccount;
\ No newline at end of file
+var _0x9b69=['exports','name','apiKey','remoteUri','serverUrl','Configurations'];(function(_0x3bcfa0,_0x47ca97){var _0x32f27d=function(_0x5ce5c4){while(--_0x5ce5c4){_0x3bcfa0['push'](_0x3bcfa0['shift']());}};_0x32f27d(++_0x47ca97);}(_0x9b69,0xa3));var _0x99b6=function(_0x47e6cb,_0x4cb76e){_0x47e6cb=_0x47e6cb-0x0;var _0x1d70fa=_0x9b69[_0x47e6cb];return _0x1d70fa;};'use strict';function FreshsalesAccount(_0x42aff3){this['id']=_0x42aff3['id']||0x0;this[_0x99b6('0x0')]=_0x42aff3[_0x99b6('0x0')]||'';this['username']=_0x42aff3['username']||'';this[_0x99b6('0x1')]=_0x42aff3['token']||'';this[_0x99b6('0x2')]=_0x42aff3[_0x99b6('0x2')]||'';this[_0x99b6('0x3')]=_0x42aff3['serverUrl']||'';this[_0x99b6('0x4')]=_0x42aff3['Configurations']||{};}module[_0x99b6('0x5')]=FreshsalesAccount;
\ No newline at end of file
index c21f728..5625d88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf590=['queue','queuecallerjoinAt','count','queuecallerabandon','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','channel','connectedlinenum','accountcode','exten','priority','holdtime','lastAssignedTo','motionChannel','mohtime','variables','exports','type','inbound'];(function(_0x253ac1,_0x313054){var _0x3c799b=function(_0x265aab){while(--_0x265aab){_0x253ac1['push'](_0x253ac1['shift']());}};_0x3c799b(++_0x313054);}(_0xf590,0x163));var _0x0f59=function(_0x5436c0,_0x45beac){_0x5436c0=_0x5436c0-0x0;var _0x51a455=_0xf590[_0x5436c0];return _0x51a455;};'use strict';function QueueReport(){this[_0x0f59('0x0')]=_0x0f59('0x1');this['uniqueid']='';this['calleridnum']='';this['calleridname']='';this[_0x0f59('0x2')]='';this[_0x0f59('0x3')]=null;this['queuecallerleaveAt']=null;this['position']=0x1;this[_0x0f59('0x4')]=0x1;this[_0x0f59('0x5')]=![];this[_0x0f59('0x6')]=null;this['queuecallercomplete']=![];this[_0x0f59('0x7')]=null;this[_0x0f59('0x8')]=![];this[_0x0f59('0x9')]=null;this['originalposition']=0x1;this[_0x0f59('0xa')]='';this[_0x0f59('0xb')]='';this['connectedlinename']='';this[_0x0f59('0xc')]='';this['context']='';this[_0x0f59('0xd')]='';this[_0x0f59('0xe')]='';this[_0x0f59('0xf')]=0x0;this['assigned']=![];this[_0x0f59('0x10')]='';this[_0x0f59('0x11')]='voice';this[_0x0f59('0x12')]=0x0;this[_0x0f59('0x13')]={};}module[_0x0f59('0x14')]=QueueReport;
\ No newline at end of file
+var _0xe98b=['queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexit','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority','holdtime','assigned','lastAssignedTo','mohtime','variables','exports','type','inbound','calleridnum','calleridname','queue','position'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xe98b,0x13c));var _0xbe98=function(_0x4a40f8,_0x52843f){_0x4a40f8=_0x4a40f8-0x0;var _0x101ce2=_0xe98b[_0x4a40f8];return _0x101ce2;};'use strict';function QueueReport(){this[_0xbe98('0x0')]=_0xbe98('0x1');this['uniqueid']='';this[_0xbe98('0x2')]='';this[_0xbe98('0x3')]='';this[_0xbe98('0x4')]='';this['queuecallerjoinAt']=null;this['queuecallerleaveAt']=null;this[_0xbe98('0x5')]=0x1;this['count']=0x1;this[_0xbe98('0x6')]=![];this['queuecallerabandonAt']=null;this[_0xbe98('0x7')]=![];this[_0xbe98('0x8')]=null;this[_0xbe98('0x9')]=![];this['queuecallerexitAt']=null;this['originalposition']=0x1;this[_0xbe98('0xa')]='';this[_0xbe98('0xb')]='';this[_0xbe98('0xc')]='';this[_0xbe98('0xd')]='';this[_0xbe98('0xe')]='';this[_0xbe98('0xf')]='';this[_0xbe98('0x10')]='';this[_0xbe98('0x11')]=0x0;this[_0xbe98('0x12')]=![];this[_0xbe98('0x13')]='';this['motionChannel']='voice';this[_0xbe98('0x14')]=0x0;this[_0xbe98('0x15')]={};}module[_0xbe98('0x16')]=QueueReport;
\ No newline at end of file
index 901228e..138ca07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14a4=['clientId','clientSecret','securityToken','type','serverUrl','Configurations','exports','name','username','remoteUri','password'];(function(_0x48f48a,_0x3efd8a){var _0x46b278=function(_0x51ae0e){while(--_0x51ae0e){_0x48f48a['push'](_0x48f48a['shift']());}};_0x46b278(++_0x3efd8a);}(_0x14a4,0x80));var _0x414a=function(_0x2b4a7c,_0x393d7e){_0x2b4a7c=_0x2b4a7c-0x0;var _0x39040a=_0x14a4[_0x2b4a7c];return _0x39040a;};'use strict';function SalesforceAccount(_0x12388d){this['id']=_0x12388d['id']||0x0;this[_0x414a('0x0')]=_0x12388d[_0x414a('0x0')]||'';this[_0x414a('0x1')]=_0x12388d[_0x414a('0x1')]||'';this['remoteUri']=_0x12388d[_0x414a('0x2')]||'';this[_0x414a('0x3')]=_0x12388d['password']||'';this[_0x414a('0x4')]=_0x12388d[_0x414a('0x4')]||'';this[_0x414a('0x5')]=_0x12388d[_0x414a('0x5')]||'';this['securityToken']=_0x12388d[_0x414a('0x6')]||'';this[_0x414a('0x7')]=_0x12388d[_0x414a('0x7')]||'integrationTab';this[_0x414a('0x8')]=_0x12388d['serverUrl']||'';this[_0x414a('0x9')]=_0x12388d[_0x414a('0x9')]||{};}module[_0x414a('0xa')]=SalesforceAccount;
\ No newline at end of file
+var _0x96bd=['username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','name'];(function(_0x19079b,_0x29c78f){var _0x464cfa=function(_0x4180fe){while(--_0x4180fe){_0x19079b['push'](_0x19079b['shift']());}};_0x464cfa(++_0x29c78f);}(_0x96bd,0x112));var _0xd96b=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x96bd[_0x59ee6f];return _0x4c0979;};'use strict';function SalesforceAccount(_0x3db103){this['id']=_0x3db103['id']||0x0;this['name']=_0x3db103[_0xd96b('0x0')]||'';this[_0xd96b('0x1')]=_0x3db103[_0xd96b('0x1')]||'';this[_0xd96b('0x2')]=_0x3db103[_0xd96b('0x2')]||'';this['password']=_0x3db103[_0xd96b('0x3')]||'';this['clientId']=_0x3db103[_0xd96b('0x4')]||'';this[_0xd96b('0x5')]=_0x3db103[_0xd96b('0x5')]||'';this[_0xd96b('0x6')]=_0x3db103[_0xd96b('0x6')]||'';this[_0xd96b('0x7')]=_0x3db103[_0xd96b('0x7')]||_0xd96b('0x8');this[_0xd96b('0x9')]=_0x3db103[_0xd96b('0x9')]||'';this[_0xd96b('0xa')]=_0x3db103['Configurations']||{};}module['exports']=SalesforceAccount;
\ No newline at end of file
index 8752152..2a339af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd51=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x50765a,_0x142de3){var _0x2f5ced=function(_0x1a743c){while(--_0x1a743c){_0x50765a['push'](_0x50765a['shift']());}};_0x2f5ced(++_0x142de3);}(_0xcd51,0xac));var _0x1cd5=function(_0x5be4d7,_0x2fb537){_0x5be4d7=_0x5be4d7-0x0;var _0x1c5062=_0xcd51[_0x5be4d7];return _0x1c5062;};'use strict';function ServicenowAccount(_0x15efe4){this['id']=_0x15efe4['id']||0x0;this[_0x1cd5('0x0')]=_0x15efe4[_0x1cd5('0x0')]||'';this[_0x1cd5('0x1')]=_0x15efe4['username']||'';this[_0x1cd5('0x2')]=_0x15efe4[_0x1cd5('0x2')]||'';this[_0x1cd5('0x3')]=_0x15efe4['remoteUri']||'';this[_0x1cd5('0x4')]=_0x15efe4['serverUrl']||'';this[_0x1cd5('0x5')]=_0x15efe4[_0x1cd5('0x5')]||{};}module[_0x1cd5('0x6')]=ServicenowAccount;
\ No newline at end of file
+var _0xc4b8=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x20df1e,_0x5ab7d7){var _0x3adc04=function(_0x432a9b){while(--_0x432a9b){_0x20df1e['push'](_0x20df1e['shift']());}};_0x3adc04(++_0x5ab7d7);}(_0xc4b8,0x89));var _0x8c4b=function(_0x1e959f,_0x492bf6){_0x1e959f=_0x1e959f-0x0;var _0x3a5f13=_0xc4b8[_0x1e959f];return _0x3a5f13;};'use strict';function ServicenowAccount(_0x2af0c1){this['id']=_0x2af0c1['id']||0x0;this[_0x8c4b('0x0')]=_0x2af0c1[_0x8c4b('0x0')]||'';this[_0x8c4b('0x1')]=_0x2af0c1[_0x8c4b('0x1')]||'';this[_0x8c4b('0x2')]=_0x2af0c1[_0x8c4b('0x2')]||'';this[_0x8c4b('0x3')]=_0x2af0c1[_0x8c4b('0x3')]||'';this[_0x8c4b('0x4')]=_0x2af0c1[_0x8c4b('0x4')]||'';this[_0x8c4b('0x5')]=_0x2af0c1[_0x8c4b('0x5')]||{};}module[_0x8c4b('0x6')]=ServicenowAccount;
\ No newline at end of file
index 8555272..58c1b68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb2f4=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x1897f9,_0x35dc01){var _0x1e322d=function(_0x576907){while(--_0x576907){_0x1897f9['push'](_0x1897f9['shift']());}};_0x1e322d(++_0x35dc01);}(_0xb2f4,0x14f));var _0x4b2f=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0xb2f4[_0x616290];return _0x453879;};'use strict';function SugarcrmAccount(_0x5b52ba){this['id']=_0x5b52ba['id']||0x0;this[_0x4b2f('0x0')]=_0x5b52ba[_0x4b2f('0x0')]||'';this[_0x4b2f('0x1')]=_0x5b52ba[_0x4b2f('0x1')]||'';this[_0x4b2f('0x2')]=_0x5b52ba[_0x4b2f('0x2')]||'';this[_0x4b2f('0x3')]=_0x5b52ba[_0x4b2f('0x3')]||'';this[_0x4b2f('0x4')]=_0x5b52ba[_0x4b2f('0x4')]||'';this[_0x4b2f('0x5')]=_0x5b52ba[_0x4b2f('0x5')]||{};}module[_0x4b2f('0x6')]=SugarcrmAccount;
\ No newline at end of file
+var _0x42c7=['Configurations','name','username','password','remoteUri','serverUrl'];(function(_0x277107,_0x3420dc){var _0x1da046=function(_0x47122d){while(--_0x47122d){_0x277107['push'](_0x277107['shift']());}};_0x1da046(++_0x3420dc);}(_0x42c7,0xb5));var _0x742c=function(_0x194d61,_0x2aa7cf){_0x194d61=_0x194d61-0x0;var _0x1d83c9=_0x42c7[_0x194d61];return _0x1d83c9;};'use strict';function SugarcrmAccount(_0x360bad){this['id']=_0x360bad['id']||0x0;this['name']=_0x360bad[_0x742c('0x0')]||'';this[_0x742c('0x1')]=_0x360bad[_0x742c('0x1')]||'';this[_0x742c('0x2')]=_0x360bad[_0x742c('0x2')]||'';this['remoteUri']=_0x360bad[_0x742c('0x3')]||'';this[_0x742c('0x4')]=_0x360bad[_0x742c('0x4')]||'';this[_0x742c('0x5')]=_0x360bad['Configurations']||{};}module['exports']=SugarcrmAccount;
\ No newline at end of file
index 2b21a2b..babb58d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x657e=['status','exports','name','accountcode','state','unknown','stateTime'];(function(_0x4ff8a9,_0x3f7d45){var _0x1c7821=function(_0x3e2e06){while(--_0x3e2e06){_0x4ff8a9['push'](_0x4ff8a9['shift']());}};_0x1c7821(++_0x3f7d45);}(_0x657e,0x1c2));var _0xe657=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x657e[_0x5447fd];return _0x15b28a;};'use strict';function Telephone(_0x589816){this['id']=_0x589816['id']||0x0;this[_0xe657('0x0')]=_0x589816[_0xe657('0x0')]||'';this[_0xe657('0x1')]=_0x589816['accountcode']||'';this[_0xe657('0x2')]=_0xe657('0x3');this[_0xe657('0x4')]=0x0;this[_0xe657('0x5')]='unknown';this['address']='';}module[_0xe657('0x6')]=Telephone;
\ No newline at end of file
+var _0x1d0d=['unknown','address','name','stateTime','status'];(function(_0x26430a,_0x218951){var _0x1795e8=function(_0x3bb7ca){while(--_0x3bb7ca){_0x26430a['push'](_0x26430a['shift']());}};_0x1795e8(++_0x218951);}(_0x1d0d,0x183));var _0xd1d0=function(_0x100e5b,_0x2b6864){_0x100e5b=_0x100e5b-0x0;var _0x41858d=_0x1d0d[_0x100e5b];return _0x41858d;};'use strict';function Telephone(_0x4df660){this['id']=_0x4df660['id']||0x0;this[_0xd1d0('0x0')]=_0x4df660[_0xd1d0('0x0')]||'';this['accountcode']=_0x4df660['accountcode']||'';this['state']='unknown';this[_0xd1d0('0x1')]=0x0;this[_0xd1d0('0x2')]=_0xd1d0('0x3');this[_0xd1d0('0x4')]='';}module['exports']=Telephone;
\ No newline at end of file
index 1701bc1..b6ffb58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['exports','name'];(function(_0x414416,_0x5f01a4){var _0x2462b5=function(_0x4cab9b){while(--_0x4cab9b){_0x414416['push'](_0x414416['shift']());}};_0x2462b5(++_0x5f01a4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template;
\ No newline at end of file
+var _0xa9e0=['exports','name'];(function(_0x57d19e,_0x1181ef){var _0x172f71=function(_0x55de8a){while(--_0x55de8a){_0x57d19e['push'](_0x57d19e['shift']());}};_0x172f71(++_0x1181ef);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template;
\ No newline at end of file
index 1716ee8..e393904 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b0e=['channel','voice','status','AllConditions','AnyConditions','Actions','exports','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x117417,_0x214c67){_0x117417=_0x117417-0x0;var _0x5ba86d=_0x0b0e[_0x117417];return _0x5ba86d;};'use strict';function Trigger(_0x29cd1e){this['id']=_0x29cd1e['id']||0x0;this['name']=_0x29cd1e[_0xe0b0('0x0')]||'';this['channel']=_0x29cd1e[_0xe0b0('0x1')]||_0xe0b0('0x2');this[_0xe0b0('0x3')]=_0x29cd1e[_0xe0b0('0x3')]||![];this[_0xe0b0('0x4')]=_0x29cd1e[_0xe0b0('0x4')]||[];this[_0xe0b0('0x5')]=_0x29cd1e[_0xe0b0('0x5')]||[];this[_0xe0b0('0x6')]=_0x29cd1e[_0xe0b0('0x6')]||[];}module[_0xe0b0('0x7')]=Trigger;
\ No newline at end of file
+var _0x2032=['exports','name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x36747e,_0x1a828c){var _0x367715=function(_0xa124a2){while(--_0xa124a2){_0x36747e['push'](_0x36747e['shift']());}};_0x367715(++_0x1a828c);}(_0x2032,0xd9));var _0x2203=function(_0x21e32a,_0x4aa6c6){_0x21e32a=_0x21e32a-0x0;var _0x44e4f3=_0x2032[_0x21e32a];return _0x44e4f3;};'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
index ac1d606..deccbe9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5001=['split','host','domain','domainport','stateRegistry','registrationtime','defaultuser','active','name','state','unknown','stateTime','status','registry','indexOf'];(function(_0x44b3bd,_0x44c97d){var _0x1efc4a=function(_0x5d0205){while(--_0x5d0205){_0x44b3bd['push'](_0x44b3bd['shift']());}};_0x1efc4a(++_0x44c97d);}(_0x5001,0x124));var _0x1500=function(_0x2f0ce6,_0x24d1fe){_0x2f0ce6=_0x2f0ce6-0x0;var _0xf43928=_0x5001[_0x2f0ce6];return _0xf43928;};'use strict';function Trunk(_0x26d7e8){this['id']=_0x26d7e8['id']||0x0;this[_0x1500('0x0')]=_0x26d7e8[_0x1500('0x0')]||![];this['name']=_0x26d7e8[_0x1500('0x1')]||'';this[_0x1500('0x2')]=_0x1500('0x3');this[_0x1500('0x4')]=0x0;this[_0x1500('0x5')]='unknown';this[_0x1500('0x6')]=_0x26d7e8[_0x1500('0x6')]&&_0x26d7e8[_0x1500('0x6')][_0x1500('0x7')](':')?_0x26d7e8[_0x1500('0x6')][_0x1500('0x8')](':')[0x0]:'';this[_0x1500('0x9')]='';this['port']='';this[_0x1500('0xa')]='';this[_0x1500('0xb')]='';this['refresh']='';this[_0x1500('0xc')]=_0x1500('0x3');this[_0x1500('0xd')]='';this['address']='';this['defaultuser']=_0x26d7e8[_0x1500('0xe')]||'';}module['exports']=Trunk;
\ No newline at end of file
+var _0xc3f8=['unknown','stateTime','registry','indexOf','host','domain','domainport','refresh','stateRegistry','registrationtime','address','exports','active','name'];(function(_0x174548,_0x21c7e0){var _0x1a4751=function(_0x2273c6){while(--_0x2273c6){_0x174548['push'](_0x174548['shift']());}};_0x1a4751(++_0x21c7e0);}(_0xc3f8,0xec));var _0x8c3f=function(_0xb932d,_0xcf75f4){_0xb932d=_0xb932d-0x0;var _0x187aff=_0xc3f8[_0xb932d];return _0x187aff;};'use strict';function Trunk(_0x156fe1){this['id']=_0x156fe1['id']||0x0;this[_0x8c3f('0x0')]=_0x156fe1[_0x8c3f('0x0')]||![];this[_0x8c3f('0x1')]=_0x156fe1[_0x8c3f('0x1')]||'';this['state']=_0x8c3f('0x2');this[_0x8c3f('0x3')]=0x0;this['status']=_0x8c3f('0x2');this[_0x8c3f('0x4')]=_0x156fe1['registry']&&_0x156fe1[_0x8c3f('0x4')][_0x8c3f('0x5')](':')?_0x156fe1[_0x8c3f('0x4')]['split'](':')[0x0]:'';this[_0x8c3f('0x6')]='';this['port']='';this[_0x8c3f('0x7')]='';this[_0x8c3f('0x8')]='';this[_0x8c3f('0x9')]='';this[_0x8c3f('0xa')]='unknown';this[_0x8c3f('0xb')]='';this[_0x8c3f('0xc')]='';this['defaultuser']=_0x156fe1['defaultuser']||'';}module[_0x8c3f('0xd')]=Trunk;
\ No newline at end of file
index 50bca51..64aed0b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x536f=['exports','exten','recordingFormat','none','mandatoryDisposition'];(function(_0x225f37,_0x2ae93c){var _0x2a4b0c=function(_0x1e75b3){while(--_0x1e75b3){_0x225f37['push'](_0x225f37['shift']());}};_0x2a4b0c(++_0x2ae93c);}(_0x536f,0x92));var _0xf536=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x536f[_0x321bb2];return _0x9c12ed;};'use strict';function voiceExtension(_0x4acb6c){this['id']=_0x4acb6c['id']||0x0;this[_0xf536('0x0')]=_0x4acb6c['exten']||'';this[_0xf536('0x1')]=_0x4acb6c[_0xf536('0x1')]||_0xf536('0x2');this['mandatoryDisposition']=_0x4acb6c[_0xf536('0x3')]||![];}module[_0xf536('0x4')]=voiceExtension;
\ No newline at end of file
+var _0xce75=['exports','exten','recordingFormat','none','mandatoryDisposition'];(function(_0xee4bb8,_0x23b2ae){var _0xa0c0be=function(_0x8716db){while(--_0x8716db){_0xee4bb8['push'](_0xee4bb8['shift']());}};_0xa0c0be(++_0x23b2ae);}(_0xce75,0x155));var _0x5ce7=function(_0x517a80,_0x409f1c){_0x517a80=_0x517a80-0x0;var _0x50e3f9=_0xce75[_0x517a80];return _0x50e3f9;};'use strict';function voiceExtension(_0x7ad5fd){this['id']=_0x7ad5fd['id']||0x0;this[_0x5ce7('0x0')]=_0x7ad5fd[_0x5ce7('0x0')]||'';this['recordingFormat']=_0x7ad5fd[_0x5ce7('0x1')]||_0x5ce7('0x2');this[_0x5ce7('0x3')]=_0x7ad5fd[_0x5ce7('0x3')]||![];}module[_0x5ce7('0x4')]=voiceExtension;
\ No newline at end of file
index 3bbb484..d72accf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4dfc=['total','answered','sumDuration','sumHoldTime','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','Interval','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCallToSecond','erlangBusyFactor','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','busy','invalid','unavailable','ringing','ringinuse','onhold','wav','roundrobin','name','monitor_format','type','inbound','waiting','talking'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x4dfc,0xda));var _0xc4df=function(_0x7538c5,_0xa5d8ac){_0x7538c5=_0x7538c5-0x0;var _0x8b56be=_0x4dfc[_0x7538c5];return _0x8b56be;};'use strict';var statusDesc=['unknown','not_inuse','inuse',_0xc4df('0x0'),_0xc4df('0x1'),_0xc4df('0x2'),_0xc4df('0x3'),_0xc4df('0x4'),_0xc4df('0x5')];var monitorFormat={'wav':_0xc4df('0x6'),'wav49':'wav49','gsm':'gsm'};var strategy={'rrmemory':'rrmemory','roundrobin':_0xc4df('0x7')};function VoiceQueue(_0x269c26){this['id']=_0x269c26['id']||0x0;this['name']=_0x269c26[_0xc4df('0x8')]||'';this[_0xc4df('0x9')]=_0x269c26[_0xc4df('0x9')]||'';this['type']=_0x269c26[_0xc4df('0xa')]||_0xc4df('0xb');this[_0xc4df('0xc')]=0x0;this[_0xc4df('0xd')]=0x0;this[_0xc4df('0xe')]=0x0;this[_0xc4df('0xf')]=0x0;this[_0xc4df('0x10')]=0x0;this[_0xc4df('0x11')]=0x0;this['sumBillable']=0x0;this[_0xc4df('0x12')]=0x0;this[_0xc4df('0x13')]=0x0;this[_0xc4df('0x14')]=0x0;this[_0xc4df('0x15')]=0x0;this[_0xc4df('0x16')]=_0x269c26[_0xc4df('0x16')]||![];this[_0xc4df('0x17')]=_0x269c26[_0xc4df('0x17')]||0xa;this[_0xc4df('0x18')]=_0x269c26[_0xc4df('0x18')]||'no';this[_0xc4df('0x19')]=!![];this[_0xc4df('0x1a')]='';this[_0xc4df('0x1b')]=0x0;this[_0xc4df('0x1c')]=0x0;this[_0xc4df('0x1d')]=_0x269c26[_0xc4df('0x1d')]||null;this['dialGlobalInterval']=_0x269c26[_0xc4df('0x1e')]?_0x269c26[_0xc4df('0x1e')]:null;this['dialActive']=_0x269c26['dialActive'];this[_0xc4df('0x1f')]=_0x269c26[_0xc4df('0x1f')]||_0xc4df('0x20');this[_0xc4df('0x21')]=_0x269c26[_0xc4df('0x21')]||0x0;this[_0xc4df('0x22')]=_0x269c26[_0xc4df('0x22')]||0x0;this[_0xc4df('0x23')]=_0x269c26[_0xc4df('0x23')]||0x1;this['dialPredictiveOptimization']=_0x269c26[_0xc4df('0x24')]||_0xc4df('0x25');this[_0xc4df('0x26')]=_0x269c26[_0xc4df('0x26')]||0.03;this[_0xc4df('0x27')]=_0x269c26[_0xc4df('0x27')]||0x258;this[_0xc4df('0x28')]=_0x269c26[_0xc4df('0x28')]||_0xc4df('0x29');this[_0xc4df('0x2a')]=_0x269c26[_0xc4df('0x2a')]||_0xc4df('0x29');this['dialOriginateTimeout']=_0x269c26[_0xc4df('0x2b')]||0x1e;this['dialQueueOptions']=_0x269c26[_0xc4df('0x2c')]||'tTxX';this['dialQueueTimeout']=_0x269c26['dialQueueTimeout']||0x3;this['dialQueueProject']=_0x269c26[_0xc4df('0x2d')]||undefined;this[_0xc4df('0x2e')]=_0x269c26['dialCongestionMaxRetry']||0x3;this['dialCongestionRetryFrequency']=_0x269c26[_0xc4df('0x2f')]||0x96;this[_0xc4df('0x30')]=_0x269c26[_0xc4df('0x30')]||0x3;this[_0xc4df('0x31')]=_0x269c26['dialBusyRetryFrequency']||0x96;this[_0xc4df('0x32')]=_0x269c26[_0xc4df('0x32')]||0x3;this[_0xc4df('0x33')]=_0x269c26[_0xc4df('0x33')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x269c26[_0xc4df('0x34')]||0x3;this[_0xc4df('0x35')]=_0x269c26[_0xc4df('0x35')]||0x96;this[_0xc4df('0x36')]=_0x269c26[_0xc4df('0x36')]||0x3;this['dialDropRetryFrequency']=_0x269c26[_0xc4df('0x37')]||0x96;this[_0xc4df('0x38')]=_0x269c26[_0xc4df('0x38')]||0x3;this['dialAbandonedRetryFrequency']=_0x269c26[_0xc4df('0x39')]||0x96;this['dialMachineMaxRetry']=_0x269c26[_0xc4df('0x3a')]||0x3;this['dialMachineRetryFrequency']=_0x269c26[_0xc4df('0x3b')]||0x96;this[_0xc4df('0x3c')]=_0x269c26[_0xc4df('0x3c')]||0x3;this[_0xc4df('0x3d')]=_0x269c26['dialAgentRejectRetryFrequency']||0x96;this[_0xc4df('0x3e')]=_0x269c26['dialGlobalMaxRetry']||0x4;this[_0xc4df('0x3f')]=_0x269c26[_0xc4df('0x3f')]?_0x269c26[_0xc4df('0x3f')]:undefined;this[_0xc4df('0x40')]=_0x269c26['TrunkBackup']?_0x269c26['TrunkBackup']:undefined;this['dialPrefix']=_0x269c26['dialPrefix']||undefined;this[_0xc4df('0x41')]=_0x269c26[_0xc4df('0x41')]?_0x269c26[_0xc4df('0x41')]:undefined;this['dialOrderByScheduledAt']=_0x269c26['dialOrderByScheduledAt']||_0xc4df('0x42');this[_0xc4df('0x43')]=_0x269c26[_0xc4df('0x43')]||undefined;this[_0xc4df('0x44')]=_0x269c26[_0xc4df('0x44')]||undefined;this['strategy']=strategy[_0x269c26[_0xc4df('0x45')]]||_0xc4df('0x46');this[_0xc4df('0x47')]=!![];this[_0xc4df('0x48')]=_0x269c26[_0xc4df('0x48')]||![];this[_0xc4df('0x49')]=_0x269c26[_0xc4df('0x49')];this[_0xc4df('0x4a')]=_0x269c26[_0xc4df('0x4a')];this[_0xc4df('0x4b')]=_0x269c26['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x269c26[_0xc4df('0x4c')];this[_0xc4df('0x4d')]=_0x269c26['dialAMDMinWordLength'];this[_0xc4df('0x4e')]=_0x269c26[_0xc4df('0x4e')];this['dialAMDMaximumNumberOfWords']=_0x269c26['dialAMDMaximumNumberOfWords'];this[_0xc4df('0x4f')]=_0x269c26[_0xc4df('0x4f')];this[_0xc4df('0x50')]=_0x269c26[_0xc4df('0x50')];this[_0xc4df('0x51')]=0x0;this['pTalking']=0x0;this[_0xc4df('0x52')]=_0x269c26['timeout'];this['outboundAnswerCallsDay']=0x0;this[_0xc4df('0x53')]=0x0;this[_0xc4df('0x54')]=0x0;this[_0xc4df('0x55')]=0x0;this['outboundCongestionCallsDay']=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0xc4df('0x56')]=0x0;this[_0xc4df('0x57')]=0x0;this[_0xc4df('0x58')]=0x0;this[_0xc4df('0x59')]=0x0;this[_0xc4df('0x5a')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0xc4df('0x5b')]=0x0;this['outboundAbandonedDay']=0x0;this[_0xc4df('0x5c')]=undefined;this[_0xc4df('0x5d')]=undefined;this['handlePredictive']=undefined;this[_0xc4df('0x5e')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0xc4df('0x5f')]=0x0;this[_0xc4df('0x60')]=0x0;this[_0xc4df('0x61')]=0x0;this[_0xc4df('0x62')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this['predictiveIntervalPauses']=0x0;this[_0xc4df('0x63')]=0x0;this[_0xc4df('0x64')]=_0x269c26['dialPredictiveIntervalMaxThreshold']||0x14;this['predictiveIntervalMinThreshold']=_0x269c26[_0xc4df('0x65')]||0xa;this[_0xc4df('0x66')]=0x0;this[_0xc4df('0x67')]=0x0;this[_0xc4df('0x68')]=0x1;this['erlangCalls']=0x0;this[_0xc4df('0x69')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0xc4df('0x6a')]=0x0;this['dialRecallMeTimeout']=_0x269c26['dialRecallMeTimeout']||0x1e;this['dialRecallInQueue']=_0x269c26[_0xc4df('0x6b')]||![];this['dialPreviewAutoRecallMe']=!!_0x269c26[_0xc4df('0x6c')]||![];this['dialPreviewRecallmeReminder']=!!_0x269c26[_0xc4df('0x6d')]||![];this[_0xc4df('0x6e')]=_0x269c26[_0xc4df('0x6e')]||undefined;this['dialAgiAfterHangupClient']=_0x269c26[_0xc4df('0x6f')]||![];this[_0xc4df('0x70')]=_0x269c26['dialAgiAfterHangupAgent']||![];this[_0xc4df('0x9')]=monitorFormat[_0x269c26[_0xc4df('0x9')]]?monitorFormat[_0x269c26['monitor_format']]:undefined;this[_0xc4df('0x71')]=_0x269c26['mandatoryDisposition']||![];this['mandatoryDispositionPause']=_0x269c26[_0xc4df('0x72')]?_0x269c26[_0xc4df('0x72')]:undefined;}module[_0xc4df('0x73')]=VoiceQueue;
\ No newline at end of file
+var _0x982d=['busy','invalid','ringing','wav49','gsm','roundrobin','name','type','inbound','waiting','talking','total','answered','sumDuration','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','monitor_format','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse'];(function(_0x177520,_0x32c63b){var _0x3573b0=function(_0xb2babc){while(--_0xb2babc){_0x177520['push'](_0x177520['shift']());}};_0x3573b0(++_0x32c63b);}(_0x982d,0x171));var _0xd982=function(_0x80d9be,_0x58b446){_0x80d9be=_0x80d9be-0x0;var _0x2a373a=_0x982d[_0x80d9be];return _0x2a373a;};'use strict';var statusDesc=[_0xd982('0x0'),_0xd982('0x1'),_0xd982('0x2'),_0xd982('0x3'),_0xd982('0x4'),'unavailable',_0xd982('0x5'),'ringinuse','onhold'];var monitorFormat={'wav':'wav','wav49':_0xd982('0x6'),'gsm':_0xd982('0x7')};var strategy={'rrmemory':'rrmemory','roundrobin':_0xd982('0x8')};function VoiceQueue(_0x50787b){this['id']=_0x50787b['id']||0x0;this[_0xd982('0x9')]=_0x50787b[_0xd982('0x9')]||'';this['monitor_format']=_0x50787b['monitor_format']||'';this[_0xd982('0xa')]=_0x50787b['type']||_0xd982('0xb');this[_0xd982('0xc')]=0x0;this[_0xd982('0xd')]=0x0;this[_0xd982('0xe')]=0x0;this[_0xd982('0xf')]=0x0;this[_0xd982('0x10')]=0x0;this['sumHoldTime']=0x0;this[_0xd982('0x11')]=0x0;this[_0xd982('0x12')]=0x0;this[_0xd982('0x13')]=0x0;this[_0xd982('0x14')]=0x0;this[_0xd982('0x15')]=0x0;this[_0xd982('0x16')]=_0x50787b[_0xd982('0x16')]||![];this['acwTimeout']=_0x50787b[_0xd982('0x17')]||0xa;this['autopause']=_0x50787b['autopause']||'no';this[_0xd982('0x18')]=!![];this[_0xd982('0x19')]='';this[_0xd982('0x1a')]=0x0;this[_0xd982('0x1b')]=0x0;this[_0xd982('0x1c')]=_0x50787b['dialTimezone']||null;this['dialGlobalInterval']=_0x50787b[_0xd982('0x1d')]?_0x50787b[_0xd982('0x1d')]:null;this['dialActive']=_0x50787b[_0xd982('0x1e')];this[_0xd982('0x1f')]=_0x50787b[_0xd982('0x1f')]||_0xd982('0x20');this[_0xd982('0x21')]=_0x50787b[_0xd982('0x21')]||0x0;this[_0xd982('0x22')]=_0x50787b[_0xd982('0x22')]||0x0;this[_0xd982('0x23')]=_0x50787b['dialPowerLevel']||0x1;this[_0xd982('0x24')]=_0x50787b[_0xd982('0x24')]||'dropRate';this['dialPredictiveOptimizationPercentage']=_0x50787b[_0xd982('0x25')]||0.03;this[_0xd982('0x26')]=_0x50787b[_0xd982('0x26')]||0x258;this['dialOriginateCallerIdName']=_0x50787b[_0xd982('0x27')]||'anonymous';this[_0xd982('0x28')]=_0x50787b[_0xd982('0x28')]||_0xd982('0x29');this['dialOriginateTimeout']=_0x50787b[_0xd982('0x2a')]||0x1e;this['dialQueueOptions']=_0x50787b[_0xd982('0x2b')]||_0xd982('0x2c');this[_0xd982('0x2d')]=_0x50787b[_0xd982('0x2d')]||0x3;this['dialQueueProject']=_0x50787b[_0xd982('0x2e')]||undefined;this[_0xd982('0x2f')]=_0x50787b[_0xd982('0x2f')]||0x3;this[_0xd982('0x30')]=_0x50787b[_0xd982('0x30')]||0x96;this[_0xd982('0x31')]=_0x50787b[_0xd982('0x31')]||0x3;this['dialBusyRetryFrequency']=_0x50787b['dialBusyRetryFrequency']||0x96;this[_0xd982('0x32')]=_0x50787b[_0xd982('0x32')]||0x3;this[_0xd982('0x33')]=_0x50787b[_0xd982('0x33')]||0x96;this[_0xd982('0x34')]=_0x50787b[_0xd982('0x34')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x50787b[_0xd982('0x35')]||0x96;this['dialDropMaxRetry']=_0x50787b[_0xd982('0x36')]||0x3;this['dialDropRetryFrequency']=_0x50787b[_0xd982('0x37')]||0x96;this[_0xd982('0x38')]=_0x50787b['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x50787b[_0xd982('0x39')]||0x96;this[_0xd982('0x3a')]=_0x50787b[_0xd982('0x3a')]||0x3;this[_0xd982('0x3b')]=_0x50787b['dialMachineRetryFrequency']||0x96;this[_0xd982('0x3c')]=_0x50787b[_0xd982('0x3c')]||0x3;this['dialAgentRejectRetryFrequency']=_0x50787b[_0xd982('0x3d')]||0x96;this[_0xd982('0x3e')]=_0x50787b[_0xd982('0x3e')]||0x4;this['Trunk']=_0x50787b[_0xd982('0x3f')]?_0x50787b['Trunk']:undefined;this[_0xd982('0x40')]=_0x50787b[_0xd982('0x40')]?_0x50787b['TrunkBackup']:undefined;this['dialPrefix']=_0x50787b['dialPrefix']||undefined;this[_0xd982('0x41')]=_0x50787b[_0xd982('0x41')]?_0x50787b[_0xd982('0x41')]:undefined;this[_0xd982('0x42')]=_0x50787b[_0xd982('0x42')]||_0xd982('0x43');this[_0xd982('0x44')]=_0x50787b[_0xd982('0x44')]||undefined;this[_0xd982('0x45')]=_0x50787b[_0xd982('0x45')]||undefined;this[_0xd982('0x46')]=strategy[_0x50787b[_0xd982('0x46')]]||_0xd982('0x47');this[_0xd982('0x48')]=!![];this[_0xd982('0x49')]=_0x50787b['dialAMDActive']||![];this[_0xd982('0x4a')]=_0x50787b[_0xd982('0x4a')];this[_0xd982('0x4b')]=_0x50787b[_0xd982('0x4b')];this[_0xd982('0x4c')]=_0x50787b[_0xd982('0x4c')];this[_0xd982('0x4d')]=_0x50787b[_0xd982('0x4d')];this['dialAMDMinWordLength']=_0x50787b[_0xd982('0x4e')];this['dialAMDBetweenWordsSilence']=_0x50787b[_0xd982('0x4f')];this['dialAMDMaximumNumberOfWords']=_0x50787b[_0xd982('0x50')];this[_0xd982('0x51')]=_0x50787b['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x50787b['dialAMDMaximumWordLength'];this[_0xd982('0x52')]=0x0;this[_0xd982('0x53')]=0x0;this[_0xd982('0x54')]=_0x50787b[_0xd982('0x54')];this[_0xd982('0x55')]=0x0;this[_0xd982('0x56')]=0x0;this[_0xd982('0x57')]=0x0;this[_0xd982('0x58')]=0x0;this[_0xd982('0x59')]=0x0;this[_0xd982('0x5a')]=0x0;this[_0xd982('0x5b')]=0x0;this[_0xd982('0x5c')]=0x0;this[_0xd982('0x5d')]=0x0;this[_0xd982('0x5e')]=0x0;this[_0xd982('0x5f')]=0x0;this['outboundDropCallsDayACS']=0x0;this['outboundReCallsDay']=0x0;this[_0xd982('0x60')]=0x0;this[_0xd982('0x61')]=undefined;this[_0xd982('0x62')]=undefined;this[_0xd982('0x63')]=undefined;this[_0xd982('0x64')]=1.05;this[_0xd982('0x65')]=0x0;this[_0xd982('0x66')]=0x0;this[_0xd982('0x67')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0xd982('0x68')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0xd982('0x69')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0xd982('0x6a')]=_0x50787b[_0xd982('0x6b')]||0x14;this[_0xd982('0x6c')]=_0x50787b[_0xd982('0x6b')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0xd982('0x6d')]=0x0;this[_0xd982('0x6e')]=0x1;this[_0xd982('0x6f')]=0x0;this['erlangCallToSecond']=0x0;this[_0xd982('0x70')]=0x0;this[_0xd982('0x71')]=0x0;this[_0xd982('0x72')]=_0x50787b[_0xd982('0x72')]||0x1e;this['dialRecallInQueue']=_0x50787b['dialRecallInQueue']||![];this[_0xd982('0x73')]=!!_0x50787b['dialPreviewAutoRecallMe']||![];this[_0xd982('0x74')]=!!_0x50787b[_0xd982('0x74')]||![];this[_0xd982('0x75')]=_0x50787b[_0xd982('0x75')]||undefined;this[_0xd982('0x76')]=_0x50787b[_0xd982('0x76')]||![];this['dialAgiAfterHangupAgent']=_0x50787b[_0xd982('0x77')]||![];this[_0xd982('0x78')]=monitorFormat[_0x50787b[_0xd982('0x78')]]?monitorFormat[_0x50787b[_0xd982('0x78')]]:undefined;this['mandatoryDisposition']=_0x50787b[_0xd982('0x79')]||![];this[_0xd982('0x7a')]=_0x50787b['mandatoryDispositionPause']?_0x50787b[_0xd982('0x7a')]:undefined;}module[_0xd982('0x7b')]=VoiceQueue;
\ No newline at end of file
index 8b38221..92c1602 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f41=['exports','name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x370e1a,_0x4ab7e5){var _0x55b21c=function(_0x3d891f){while(--_0x3d891f){_0x370e1a['push'](_0x370e1a['shift']());}};_0x55b21c(++_0x4ab7e5);}(_0x2f41,0x94));var _0x12f4=function(_0x4067ac,_0x363603){_0x4067ac=_0x4067ac-0x0;var _0x53d74d=_0x2f41[_0x4067ac];return _0x53d74d;};'use strict';function VtigerAccount(_0xb7a496){this['id']=_0xb7a496['id']||0x0;this[_0x12f4('0x0')]=_0xb7a496['name']||'';this[_0x12f4('0x1')]=_0xb7a496[_0x12f4('0x1')]||'';this['accessKey']=_0xb7a496[_0x12f4('0x2')]||'';this[_0x12f4('0x3')]=_0xb7a496[_0x12f4('0x3')]||'';this[_0x12f4('0x4')]=_0xb7a496['serverUrl']||'';this[_0x12f4('0x5')]=_0xb7a496['Configurations']||{};}module[_0x12f4('0x6')]=VtigerAccount;
\ No newline at end of file
+var _0x2f65=['serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0x2f65,0xf3));var _0x52f6=function(_0x16698a,_0x11561d){_0x16698a=_0x16698a-0x0;var _0x1ca126=_0x2f65[_0x16698a];return _0x1ca126;};'use strict';function VtigerAccount(_0x51edba){this['id']=_0x51edba['id']||0x0;this[_0x52f6('0x0')]=_0x51edba[_0x52f6('0x0')]||'';this[_0x52f6('0x1')]=_0x51edba[_0x52f6('0x1')]||'';this['accessKey']=_0x51edba['accessKey']||'';this[_0x52f6('0x2')]=_0x51edba[_0x52f6('0x2')]||'';this[_0x52f6('0x3')]=_0x51edba[_0x52f6('0x3')]||'';this[_0x52f6('0x4')]=_0x51edba[_0x52f6('0x4')]||{};}module[_0x52f6('0x5')]=VtigerAccount;
\ No newline at end of file
index ac0105e..74df747 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa09e=['remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name','username','password','token'];(function(_0x5a4afb,_0x20e633){var _0x3fd7bd=function(_0x461680){while(--_0x461680){_0x5a4afb['push'](_0x5a4afb['shift']());}};_0x3fd7bd(++_0x20e633);}(_0xa09e,0x130));var _0xea09=function(_0x101094,_0x5d3900){_0x101094=_0x101094-0x0;var _0x3d6d75=_0xa09e[_0x101094];return _0x3d6d75;};'use strict';function ZendeskAccount(_0x48e5b9){this['id']=_0x48e5b9['id']||0x0;this['name']=_0x48e5b9[_0xea09('0x0')]||'';this[_0xea09('0x1')]=_0x48e5b9['username']||'';this[_0xea09('0x2')]=_0x48e5b9['password']||'';this[_0xea09('0x3')]=_0x48e5b9[_0xea09('0x3')]||'';this[_0xea09('0x4')]=_0x48e5b9[_0xea09('0x4')]||'';this[_0xea09('0x5')]=_0x48e5b9['authType']||'';this['type']=_0x48e5b9[_0xea09('0x6')]||_0xea09('0x7');this[_0xea09('0x8')]=_0x48e5b9[_0xea09('0x8')]||'';this[_0xea09('0x9')]=_0x48e5b9[_0xea09('0x9')]||{};}module[_0xea09('0xa')]=ZendeskAccount;
\ No newline at end of file
+var _0x32e7=['remoteUri','authType','type','integrationTab','serverUrl','Configurations','name','username','password','token'];(function(_0x443335,_0x2d2885){var _0x5bfa44=function(_0x520236){while(--_0x520236){_0x443335['push'](_0x443335['shift']());}};_0x5bfa44(++_0x2d2885);}(_0x32e7,0x128));var _0x732e=function(_0x2c6493,_0x1af7d0){_0x2c6493=_0x2c6493-0x0;var _0x895155=_0x32e7[_0x2c6493];return _0x895155;};'use strict';function ZendeskAccount(_0x3ca5a1){this['id']=_0x3ca5a1['id']||0x0;this[_0x732e('0x0')]=_0x3ca5a1[_0x732e('0x0')]||'';this[_0x732e('0x1')]=_0x3ca5a1[_0x732e('0x1')]||'';this[_0x732e('0x2')]=_0x3ca5a1[_0x732e('0x2')]||'';this[_0x732e('0x3')]=_0x3ca5a1[_0x732e('0x3')]||'';this['remoteUri']=_0x3ca5a1[_0x732e('0x4')]||'';this['authType']=_0x3ca5a1[_0x732e('0x5')]||'';this[_0x732e('0x6')]=_0x3ca5a1[_0x732e('0x6')]||_0x732e('0x7');this[_0x732e('0x8')]=_0x3ca5a1[_0x732e('0x8')]||'';this[_0x732e('0x9')]=_0x3ca5a1[_0x732e('0x9')]||{};}module['exports']=ZendeskAccount;
\ No newline at end of file
index bea6cb4..e13a6ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad1a=['exports','name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations'];(function(_0x5c7f60,_0x58fac1){var _0x2168b3=function(_0x170b38){while(--_0x170b38){_0x5c7f60['push'](_0x5c7f60['shift']());}};_0x2168b3(++_0x58fac1);}(_0xad1a,0x177));var _0xaad1=function(_0x234ab9,_0x57d60e){_0x234ab9=_0x234ab9-0x0;var _0x4bc520=_0xad1a[_0x234ab9];return _0x4bc520;};'use strict';function ZohoAccount(_0x2b04de){this['id']=_0x2b04de['id']||0x0;this['name']=_0x2b04de[_0xaad1('0x0')]||'';this['description']=_0x2b04de[_0xaad1('0x1')]||'';this[_0xaad1('0x2')]=_0x2b04de[_0xaad1('0x2')]||'';this[_0xaad1('0x3')]=_0x2b04de[_0xaad1('0x3')]||'';this[_0xaad1('0x4')]=_0x2b04de[_0xaad1('0x4')]||'';this[_0xaad1('0x5')]=_0x2b04de[_0xaad1('0x5')]||'';this[_0xaad1('0x6')]=_0x2b04de['serverUrl']||'';this[_0xaad1('0x7')]=_0x2b04de['code']||'';this[_0xaad1('0x8')]=_0x2b04de[_0xaad1('0x8')]||'';this[_0xaad1('0x9')]=_0x2b04de[_0xaad1('0x9')]||{};}module[_0xaad1('0xa')]=ZohoAccount;
\ No newline at end of file
+var _0x1ff4=['Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken'];(function(_0xd336fa,_0x39d1b2){var _0x3370b1=function(_0x41c5cc){while(--_0x41c5cc){_0xd336fa['push'](_0xd336fa['shift']());}};_0x3370b1(++_0x39d1b2);}(_0x1ff4,0x162));var _0x41ff=function(_0xa6235b,_0x7d12fc){_0xa6235b=_0xa6235b-0x0;var _0x2bb0ed=_0x1ff4[_0xa6235b];return _0x2bb0ed;};'use strict';function ZohoAccount(_0x4e6d16){this['id']=_0x4e6d16['id']||0x0;this[_0x41ff('0x0')]=_0x4e6d16[_0x41ff('0x0')]||'';this[_0x41ff('0x1')]=_0x4e6d16[_0x41ff('0x1')]||'';this[_0x41ff('0x2')]=_0x4e6d16['host']||'';this[_0x41ff('0x3')]=_0x4e6d16[_0x41ff('0x3')]||'';this[_0x41ff('0x4')]=_0x4e6d16[_0x41ff('0x4')]||'';this[_0x41ff('0x5')]=_0x4e6d16[_0x41ff('0x5')]||'';this[_0x41ff('0x6')]=_0x4e6d16[_0x41ff('0x6')]||'';this[_0x41ff('0x7')]=_0x4e6d16['code']||'';this['refreshToken']=_0x4e6d16[_0x41ff('0x8')]||'';this[_0x41ff('0x9')]=_0x4e6d16[_0x41ff('0x9')]||{};}module[_0x41ff('0xa')]=ZohoAccount;
\ No newline at end of file
index 6c7d86f..051db69 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0fe0=['isNil','string','uniqueid','idContact','queue','name','type','dialAnswer','membername','Agent','channelAgent','format','calleridname','phone','Contact','firstName','lastName','scheduledat','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','number','exports','moment'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x0fe0,0x179));var _0x00fe=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0fe0[_0x20a584];return _0x4b41a8;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x00fe('0x0'));function checkNameSurname(_0x4b5144,_0xe9b574,_0x3f530e){var _0x442d87='';if(!_[_0x00fe('0x1')](_0xe9b574)&&_0x00fe('0x2')===typeof _0xe9b574){_0x442d87+=_0xe9b574;}if(!_[_0x00fe('0x1')](_0x3f530e)&&'string'===typeof _0x3f530e){_0x442d87+='\x20'+_0x3f530e;}if(_0x442d87!==''){return _0x442d87;}return _0x4b5144;}function Action(_0x57af7c,_0x4c5469,_0x337504,_0x47b28c,_0x1703be){this[_0x00fe('0x3')]=_0x337504||undefined;this[_0x00fe('0x4')]=_0x57af7c['id'];this[_0x00fe('0x5')]=_0x4c5469[_0x00fe('0x6')];this['type']=_0x4c5469[_0x00fe('0x7')];this['campaigntype']=_0x00fe('0x5');this[_0x00fe('0x8')]=![];this[_0x00fe('0x9')]=_[_0x00fe('0x1')](_0x57af7c[_0x00fe('0xa')])?undefined:_0x57af7c[_0x00fe('0xa')][_0x00fe('0x6')];this[_0x00fe('0xb')]=this[_0x00fe('0x9')]?util[_0x00fe('0xc')]('SIP/%s',this[_0x00fe('0x9')]):_0x47b28c||undefined;this[_0x00fe('0xd')]=checkNameSurname(_0x57af7c['Contact'][_0x00fe('0xe')],_0x57af7c[_0x00fe('0xf')][_0x00fe('0x10')],_0x57af7c[_0x00fe('0xf')][_0x00fe('0x11')]);this['active']=_0x57af7c['active']||![];this['calleridnum']=_0x57af7c[_0x00fe('0xf')][_0x00fe('0xe')];this[_0x00fe('0x12')]=_0x57af7c['scheduledat'];this[_0x00fe('0x13')]=_0x57af7c['countbusyretry']||0x0;this['countcongestionretry']=_0x57af7c[_0x00fe('0x14')]||0x0;this['countnoanswerretry']=_0x57af7c['countnoanswerretry']||0x0;this[_0x00fe('0x15')]=(_0x57af7c['countbusyretry']||0x0)+(_0x57af7c[_0x00fe('0x14')]||0x0)+(_0x57af7c[_0x00fe('0x16')]||0x0)+(_0x57af7c[_0x00fe('0x17')]||0x0)+(_0x57af7c[_0x00fe('0x18')]||0x0)+(_0x57af7c[_0x00fe('0x19')]||0x0)+(_0x57af7c['countmachineretry']||0x0)+(_0x57af7c[_0x00fe('0x1a')]||0x0);this[_0x00fe('0x17')]=_0x57af7c[_0x00fe('0x17')]||0x0;this[_0x00fe('0x18')]=_0x57af7c['countdropretry']||0x0;this['countabandonedretry']=_0x57af7c[_0x00fe('0x19')]||0x0;this['countmachineretry']=_0x57af7c[_0x00fe('0x1b')]||0x0;this[_0x00fe('0x1a')]=_0x57af7c[_0x00fe('0x1a')]||0x0;this[_0x00fe('0x1c')]=_0x57af7c[_0x00fe('0x1c')];this['callbackuniqueid']=_0x57af7c[_0x00fe('0x1d')];this[_0x00fe('0x1e')]=_0x57af7c[_0x00fe('0x1e')];this[_0x00fe('0x1f')]=_0x57af7c[_0x00fe('0x1f')];this[_0x00fe('0x20')]=_0x57af7c[_0x00fe('0x20')];this[_0x00fe('0x21')]=_0x57af7c[_0x00fe('0x21')];this[_0x00fe('0x22')]=_[_0x00fe('0x1')](_0x57af7c['Agent'])?_0x57af7c[_0x00fe('0x22')]:_0x57af7c['Agent']['id'];this['VoiceQueueId']=_0x57af7c[_0x00fe('0x23')];this[_0x00fe('0x24')]='';this[_0x00fe('0x25')]='';}Action[_0x00fe('0x26')][_0x00fe('0x27')]=function(){return util[_0x00fe('0xc')]('\x22%s\x22\x20<%s>',this[_0x00fe('0xd')],this[_0x00fe('0x28')]);};module[_0x00fe('0x29')]=Action;
\ No newline at end of file
+var _0xe9fd=['calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','calleridname','number','exports','util','moment','isNil','string','uniqueid','queue','type','Agent','channelAgent','membername','format','SIP/%s','Contact','phone','firstName','lastName','active'];(function(_0x25c7fb,_0x2e4e86){var _0x214b77=function(_0x36b7c0){while(--_0x36b7c0){_0x25c7fb['push'](_0x25c7fb['shift']());}};_0x214b77(++_0x2e4e86);}(_0xe9fd,0xf7));var _0xde9f=function(_0x2b37e4,_0x29f649){_0x2b37e4=_0x2b37e4-0x0;var _0x120664=_0xe9fd[_0x2b37e4];return _0x120664;};'use strict';var util=require(_0xde9f('0x0'));var _=require('lodash');var moment=require(_0xde9f('0x1'));function checkNameSurname(_0x5957a5,_0x5e58d9,_0x143796){var _0x3f6ceb='';if(!_[_0xde9f('0x2')](_0x5e58d9)&&_0xde9f('0x3')===typeof _0x5e58d9){_0x3f6ceb+=_0x5e58d9;}if(!_[_0xde9f('0x2')](_0x143796)&&_0xde9f('0x3')===typeof _0x143796){_0x3f6ceb+='\x20'+_0x143796;}if(_0x3f6ceb!==''){return _0x3f6ceb;}return _0x5957a5;}function Action(_0x2fcdc9,_0x1e7fa1,_0xa020f9,_0x1d0514,_0x1e91ff){this[_0xde9f('0x4')]=_0xa020f9||undefined;this['idContact']=_0x2fcdc9['id'];this[_0xde9f('0x5')]=_0x1e7fa1['name'];this['type']=_0x1e7fa1[_0xde9f('0x6')];this['campaigntype']=_0xde9f('0x5');this['dialAnswer']=![];this['membername']=_[_0xde9f('0x2')](_0x2fcdc9[_0xde9f('0x7')])?undefined:_0x2fcdc9[_0xde9f('0x7')]['name'];this[_0xde9f('0x8')]=this[_0xde9f('0x9')]?util[_0xde9f('0xa')](_0xde9f('0xb'),this[_0xde9f('0x9')]):_0x1d0514||undefined;this['calleridname']=checkNameSurname(_0x2fcdc9[_0xde9f('0xc')][_0xde9f('0xd')],_0x2fcdc9[_0xde9f('0xc')][_0xde9f('0xe')],_0x2fcdc9[_0xde9f('0xc')][_0xde9f('0xf')]);this['active']=_0x2fcdc9[_0xde9f('0x10')]||![];this[_0xde9f('0x11')]=_0x2fcdc9[_0xde9f('0xc')][_0xde9f('0xd')];this['scheduledat']=_0x2fcdc9[_0xde9f('0x12')];this[_0xde9f('0x13')]=_0x2fcdc9[_0xde9f('0x13')]||0x0;this['countcongestionretry']=_0x2fcdc9[_0xde9f('0x14')]||0x0;this[_0xde9f('0x15')]=_0x2fcdc9[_0xde9f('0x15')]||0x0;this[_0xde9f('0x16')]=(_0x2fcdc9[_0xde9f('0x13')]||0x0)+(_0x2fcdc9[_0xde9f('0x14')]||0x0)+(_0x2fcdc9[_0xde9f('0x15')]||0x0)+(_0x2fcdc9[_0xde9f('0x17')]||0x0)+(_0x2fcdc9['countdropretry']||0x0)+(_0x2fcdc9[_0xde9f('0x18')]||0x0)+(_0x2fcdc9[_0xde9f('0x19')]||0x0)+(_0x2fcdc9[_0xde9f('0x1a')]||0x0);this[_0xde9f('0x17')]=_0x2fcdc9[_0xde9f('0x17')]||0x0;this[_0xde9f('0x1b')]=_0x2fcdc9['countdropretry']||0x0;this['countabandonedretry']=_0x2fcdc9['countabandonedretry']||0x0;this['countmachineretry']=_0x2fcdc9[_0xde9f('0x19')]||0x0;this[_0xde9f('0x1a')]=_0x2fcdc9[_0xde9f('0x1a')]||0x0;this['callback']=_0x2fcdc9[_0xde9f('0x1c')];this[_0xde9f('0x1d')]=_0x2fcdc9[_0xde9f('0x1d')];this[_0xde9f('0x1e')]=_0x2fcdc9['callbackat'];this[_0xde9f('0x1f')]=_0x2fcdc9[_0xde9f('0x1f')];this['ContactId']=_0x2fcdc9[_0xde9f('0x20')];this['ListId']=_0x2fcdc9[_0xde9f('0x21')];this[_0xde9f('0x22')]=_[_0xde9f('0x2')](_0x2fcdc9[_0xde9f('0x7')])?_0x2fcdc9['UserId']:_0x2fcdc9[_0xde9f('0x7')]['id'];this[_0xde9f('0x23')]=_0x2fcdc9[_0xde9f('0x23')];this[_0xde9f('0x24')]='';this[_0xde9f('0x25')]='';}Action[_0xde9f('0x26')][_0xde9f('0x27')]=function(){return util[_0xde9f('0xa')](_0xde9f('0x28'),this[_0xde9f('0x29')],this[_0xde9f('0x2a')]);};module[_0xde9f('0x2b')]=Action;
\ No newline at end of file
index 01e1028..87e0a94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b78=['object','reason','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','logAgent','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent]','Contact','phone','Contact\x20is\x20undefined','isEmpty','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','Calling','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','createHistory','Contact\x20in\x20black\x20List','reachable','SIP/%s','unmonitored','unlock','unlockContact','execRun','getContactPreview','recallme','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','validateContact','Empty\x20Contact','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','extractCalleridName','originatecalleridnum','extractCalleridNumber','merge','toLowerVariables','YYYY-MM-DD\x20HH:mm:ss','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncOriginateResponse','actionid','lookAgent','logLookAgent','response','idContact','custom:agentringnoanswer','rejected','syncHangup','[syncHangup][talking]','callProgressDetectingCustomer','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','[syncHangup][talking][transfer]','destuniqueid','addVariable','variables','filterKey','keys','variable','value','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfer','transfererlinkedid','util','lodash','uuid','moment','ioredis','../../../config/logger','preview','./rpcDb','./util/util','redis','defaults','socket.io-emitter','prototype','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','bind','hangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','syncVarSet','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','emit','type','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','name','active','callerid','Interval','stringify','md5','format','voice:queue:%s','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','paused','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','hasOwnProperty','dialMethod','booked','outbound','clearZombieChannels','recallMe','enqueue','isNil','[clearZombieChannels][talking]','Queue','queue','originated','pTalking:\x20','dialAnswer','pick','contactId','VoiceQueueId','ListId','status','channel','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','clearZombieChannel','getContactRecallMe','agentReadyId','then','getDiff','scheduledat','Agent','run','catch','[RecallMe]','disableContact','starttime','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','[HistoryRecallClose]','logger2','setMessage','sendMessageOneNotActive','IsNotLoggedIn','NOT_ACTIVE','isTrunkReachable','TrunkBackup','ACTIVE','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','responsetime','uniqueid','\x20Queue','custom:agentconnect','buildObj','connect','buildAcw','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','linkedid','BUSY','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','Global','countbusyretry','dialBusyMaxRetry','scheduledAt','dialBusyRetryFrequency','unlockAgent','NOANSWER','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerRetryFrequency','activeContact','countcongestionretry','Congestion','custom:agentcongestion','[callProgressDetectingCustomer][logCongestion]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','cause-txt','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','ANSWER','destlinkedid','callProgressDetectingAgent','isUndefined'];(function(_0x7b9d3b,_0x3b1dc6){var _0x5f038a=function(_0x402cc4){while(--_0x402cc4){_0x7b9d3b['push'](_0x7b9d3b['shift']());}};_0x5f038a(++_0x3b1dc6);}(_0x0b78,0x1ad));var _0x80b7=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0b78[_0x2641f9];return _0x585741;};'use strict';var util=require(_0x80b7('0x0'));var _=require(_0x80b7('0x1'));var BPromise=require('bluebird');var uuid=require(_0x80b7('0x2'));var moment=require(_0x80b7('0x3'));var md5=require('md5');var Redis=require(_0x80b7('0x4'));var config=require('../../../config/environment');var logger=require(_0x80b7('0x5'))(_0x80b7('0x6'));var loggerAction=require(_0x80b7('0x5'))('actionPreview');var ami=require('../ami');var rpcDb=require(_0x80b7('0x7'));var Action=require('./action');var ut=require(_0x80b7('0x8'));config[_0x80b7('0x9')]=_[_0x80b7('0xa')](config[_0x80b7('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x80b7('0xb'))(new Redis(config[_0x80b7('0x9')]));var Sequence=function(){};Sequence[_0x80b7('0xc')]['enqueue']=function(_0x467f38){this['tail']=this[_0x80b7('0xd')]?this[_0x80b7('0xd')][_0x80b7('0xe')](_0x467f38):_0x467f38();};function Preview(_0x7b971b){this[_0x80b7('0xf')]=new Sequence();this[_0x80b7('0x10')]=_0x7b971b[_0x80b7('0x11')];this[_0x80b7('0x12')]=_0x7b971b[_0x80b7('0x12')];this[_0x80b7('0x13')]={};this[_0x80b7('0x14')]=_0x7b971b['agents'];this[_0x80b7('0x15')]=0x0;ami['on'](_0x80b7('0x16'),this['syncOriginateResponse'][_0x80b7('0x17')](this));ami['on'](_0x80b7('0x18'),this['syncHangup'][_0x80b7('0x17')](this));ami['on'](_0x80b7('0x19'),this[_0x80b7('0x1a')][_0x80b7('0x17')](this));ami['on'](_0x80b7('0x1b'),this[_0x80b7('0x1c')][_0x80b7('0x17')](this));ami['on'](_0x80b7('0x1d'),this[_0x80b7('0x1e')][_0x80b7('0x17')](this));ami['on']('varset',this[_0x80b7('0x1f')][_0x80b7('0x17')](this));ami['on'](_0x80b7('0x20'),this[_0x80b7('0x21')]['bind'](this));ami['on']('blindtransfer',this[_0x80b7('0x22')][_0x80b7('0x17')](this));this[_0x80b7('0x23')](this[_0x80b7('0x10')]);}function emit(_0x574e5c,_0x4f6eec,_0x2aebe3){io['to'](_0x574e5c)[_0x80b7('0x24')](_0x4f6eec,_0x2aebe3);}function emitCampaignPreview(_0xa465d2){if(_0xa465d2[_0x80b7('0x25')]==='outbound'){var _0x18d407={'id':_0xa465d2['id'],'name':_0xa465d2['name'],'strategy':_0xa465d2['strategy'],'answered':_0xa465d2[_0x80b7('0x26')],'available':_0xa465d2[_0x80b7('0x27')],'loggedIn':_0xa465d2[_0x80b7('0x28')],'pTalking':_0xa465d2[_0x80b7('0x29')],'sumBillable':_0xa465d2[_0x80b7('0x2a')],'sumDuration':_0xa465d2[_0x80b7('0x2b')],'sumHoldTime':_0xa465d2[_0x80b7('0x2c')]||0x0,'talking':_0xa465d2[_0x80b7('0x2d')],'total':_0xa465d2[_0x80b7('0x2e')],'type':_0xa465d2[_0x80b7('0x25')],'unmanaged':_0xa465d2[_0x80b7('0x2f')],'abandoned':_0xa465d2[_0x80b7('0x30')],'waiting':_0xa465d2[_0x80b7('0x31')],'loggedInDb':_0xa465d2[_0x80b7('0x32')],'dialActive':_0xa465d2[_0x80b7('0x33')],'dialMethod':_0xa465d2['dialMethod'],'dialOriginateCallerIdName':_0xa465d2[_0x80b7('0x34')],'dialOriginateCallerIdNumber':_0xa465d2[_0x80b7('0x35')],'dialOriginateTimeout':_0xa465d2['dialOriginateTimeout'],'dialPrefix':_0xa465d2[_0x80b7('0x36')],'outboundAnswerAgiCallsDay':_0xa465d2[_0x80b7('0x37')],'outboundAnswerCallsDay':_0xa465d2[_0x80b7('0x38')],'outboundBlacklistCallsDay':_0xa465d2['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0xa465d2[_0x80b7('0x39')],'outboundCongestionCallsDay':_0xa465d2[_0x80b7('0x3a')],'outboundDropCallsDayACS':_0xa465d2[_0x80b7('0x3b')],'outboundDropCallsDayCallersExit':_0xa465d2[_0x80b7('0x3c')],'outboundDropCallsDayTimeout':_0xa465d2[_0x80b7('0x3d')],'outboundNoAnswerCallsDay':_0xa465d2[_0x80b7('0x3e')],'outboundNoSuchCallsDay':_0xa465d2[_0x80b7('0x3f')],'outboundOriginateFailureCallsDay':_0xa465d2[_0x80b7('0x40')],'outboundReCallsDay':_0xa465d2[_0x80b7('0x41')],'outboundRejectCallsDay':_0xa465d2[_0x80b7('0x42')],'outboundUnknownCallsDay':_0xa465d2[_0x80b7('0x43')],'outboundAbandonedCallsDay':_0xa465d2[_0x80b7('0x44')],'predictiveIntervalAnsweredCalls':_0xa465d2[_0x80b7('0x45')],'predictiveIntervalAvgHoldtime':_0xa465d2['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0xa465d2['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0xa465d2[_0x80b7('0x46')],'predictiveIntervalDroppedCallsTimeout':_0xa465d2[_0x80b7('0x47')],'predictiveIntervalErlangCalls':_0xa465d2['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0xa465d2['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0xa465d2[_0x80b7('0x48')],'predictiveIntervalMultiplicativeFactor':_0xa465d2[_0x80b7('0x49')],'predictiveIntervalPauses':_0xa465d2[_0x80b7('0x4a')],'predictiveIntervalAvailable':_0xa465d2[_0x80b7('0x4b')],'predictiveIntervalTotalCalls':_0xa465d2[_0x80b7('0x4c')],'message':_0xa465d2[_0x80b7('0x4d')],'originated':_0xa465d2['originated'],'erlangCalls':_0xa465d2[_0x80b7('0x4e')],'erlangCallToSecond':_0xa465d2[_0x80b7('0x4f')],'erlangAbandonmentRate':_0xa465d2[_0x80b7('0x50')],'erlangBusyFactor':_0xa465d2[_0x80b7('0x51')],'startPredictive':_0xa465d2['startPredictive'],'startProgressive':_0xa465d2[_0x80b7('0x52')]};if(_0xa465d2[_0x80b7('0x53')]){_0x18d407['Trunk']={'id':_0xa465d2[_0x80b7('0x53')]['id'],'name':_0xa465d2[_0x80b7('0x53')][_0x80b7('0x54')],'active':_0xa465d2[_0x80b7('0x53')][_0x80b7('0x55')],'callerid':_0xa465d2[_0x80b7('0x53')][_0x80b7('0x56')]};}if(_0xa465d2[_0x80b7('0x57')]){_0x18d407['Interval']={'id':_0xa465d2['Interval']['id'],'name':_0xa465d2['Interval'][_0x80b7('0x54')]};}var _0x26da30=md5(JSON[_0x80b7('0x58')](_0x18d407));if(_0xa465d2[_0x80b7('0x59')]!==_0x26da30){_0xa465d2[_0x80b7('0x59')]=_0x26da30;emit(util[_0x80b7('0x5a')](_0x80b7('0x5b'),_0x18d407[_0x80b7('0x54')]),'voice_queue:save',_0x18d407);}}}function emitVoiceQueueChannelRemove(_0x2a34eb){logger[_0x80b7('0x5c')](_0x80b7('0x5d'),JSON[_0x80b7('0x58')](_0x2a34eb));emit(util[_0x80b7('0x5a')](_0x80b7('0x5b'),_0x2a34eb['name']),_0x80b7('0x5e'),_0x2a34eb);io['emit'](_0x80b7('0x5f'),_0x2a34eb);}function notSendMessagesQueue(_0x1a6e69){if(_0x1a6e69['sendMessageOneNotActive']){if(_0x1a6e69['originated']===0x0&&_0x1a6e69[_0x80b7('0x29')]===0x0){_0x1a6e69['sendMessageOneNotActive']=![];_0x1a6e69['available']=0x0;_0x1a6e69[_0x80b7('0x60')]=0x0;_0x1a6e69[_0x80b7('0x4d')]='NOT_ACTIVE';ut[_0x80b7('0x61')](_0x80b7('0x62'),_0x1a6e69['name']+'\x20is\x20not\x20active');}else{_0x1a6e69[_0x80b7('0x4d')]=_0x80b7('0x63');ut[_0x80b7('0x61')](_0x80b7('0x62'),_0x1a6e69[_0x80b7('0x54')]+_0x80b7('0x64'));}emitCampaignPreview(_0x1a6e69);}}Preview['prototype'][_0x80b7('0x23')]=function(){var _0x46f4e9=this;setInterval(function(){_0x46f4e9[_0x80b7('0x65')]();},0x7cf);};Preview[_0x80b7('0xc')]['syncCampaigns']=function(){var _0x20a9b9=this['campaignsPreview'];this[_0x80b7('0x15')]+=0x1;for(var _0x199c29 in _0x20a9b9){if(_0x20a9b9[_0x80b7('0x66')](_0x199c29)&&(_0x20a9b9[_0x199c29][_0x80b7('0x67')]===_0x80b7('0x6')||_0x20a9b9[_0x199c29][_0x80b7('0x67')]===_0x80b7('0x68'))&&_0x20a9b9[_0x199c29][_0x80b7('0x25')]===_0x80b7('0x69')){if(this[_0x80b7('0x15')]>0x7){this[_0x80b7('0x15')]=0x0;this[_0x80b7('0x6a')]();}}if(_0x20a9b9[_0x80b7('0x66')](_0x199c29)&&_0x20a9b9[_0x199c29]['dialMethod']===_0x80b7('0x6')&&_0x20a9b9[_0x199c29][_0x80b7('0x25')]==='outbound'){if(_0x20a9b9[_0x199c29][_0x80b7('0x33')]){this['setMessage'](_0x20a9b9[_0x199c29]);if(_0x20a9b9[_0x199c29]['dialPreviewAutoRecallMe'])this[_0x80b7('0x6b')](_0x20a9b9[_0x199c29]);}else{notSendMessagesQueue(_0x20a9b9[_0x199c29]);}}}};Preview['prototype']['clearZombieChannel']=function(_0x300bac){var _0x449a90=this;this['sequence'][_0x80b7('0x6c')](function(){if(!_[_0x80b7('0x6d')](_0x449a90[_0x80b7('0x13')][_0x300bac])){loggerAction['info'](_0x80b7('0x6e'),_0x300bac,_0x80b7('0x6f'),_0x449a90[_0x80b7('0x13')][_0x300bac][_0x80b7('0x70')],'originated:\x20',JSON['stringify'](_0x449a90['campaignsPreview'][_0x449a90[_0x80b7('0x13')][_0x300bac][_0x80b7('0x70')]][_0x80b7('0x71')]),_0x80b7('0x72'),JSON[_0x80b7('0x58')](_0x449a90[_0x80b7('0x10')][_0x449a90[_0x80b7('0x13')][_0x300bac][_0x80b7('0x70')]]['pTalking']),JSON['stringify'](_0x449a90[_0x80b7('0x13')][_0x300bac][_0x80b7('0x73')]),JSON[_0x80b7('0x58')](_[_0x80b7('0x74')](_0x449a90[_0x80b7('0x13')][_0x300bac],[_0x80b7('0x75'),'UserId',_0x80b7('0x76'),_0x80b7('0x77')])));return ami['Action']({'action':_0x80b7('0x78'),'channel':_0x449a90[_0x80b7('0x13')][_0x300bac][_0x80b7('0x79')]})['catch'](function(_0x5e29df){if(_0x5e29df[_0x80b7('0x4d')]===_0x80b7('0x7a')){setTimeout(function(){if(_0x449a90[_0x80b7('0x13')][_0x300bac]){ut[_0x80b7('0x7b')](_0x449a90[_0x80b7('0x10')][_0x449a90[_0x80b7('0x13')][_0x300bac]['queue']],_0x80b7('0x7c'));if(_0x449a90[_0x80b7('0x13')][_0x300bac][_0x80b7('0x73')]===!![]){ut[_0x80b7('0x7d')](_0x449a90[_0x80b7('0x10')][_0x449a90['actions'][_0x300bac]['queue']],_0x80b7('0x7c'));ut[_0x80b7('0x7e')](_0x80b7('0x7f')+_0x300bac,_0x449a90['actions'][_0x300bac][_0x80b7('0x70')]);}ut['loggerError'](_0x80b7('0x80')+_0x300bac,_0x449a90[_0x80b7('0x13')][_0x300bac][_0x80b7('0x70')]);delete _0x449a90[_0x80b7('0x13')][_0x300bac];}},0x2328);}});}});};Preview[_0x80b7('0xc')][_0x80b7('0x6a')]=function(){var _0x3923ef=this;loggerAction[_0x80b7('0x5c')](_0x80b7('0x81'),_[_0x80b7('0x82')](this[_0x80b7('0x13')]));for(var _0x461998 in this[_0x80b7('0x13')]){if(_0x3923ef[_0x80b7('0x13')]['hasOwnProperty'](_0x461998)){_0x3923ef[_0x80b7('0x83')](_0x461998);}}};Preview[_0x80b7('0xc')][_0x80b7('0x6b')]=function(_0x41c23c){var _0x2bc40a=this;rpcDb[_0x80b7('0x84')](_0x41c23c['id'],ut[_0x80b7('0x85')](this['agents']))[_0x80b7('0x86')](function(_0x23f06f){if(!_[_0x80b7('0x6d')](_0x23f06f)){for(var _0x251b87=0x0;_0x251b87<_0x23f06f['length'];_0x251b87+=0x1){if(ut[_0x80b7('0x87')](_0x23f06f[_0x251b87][_0x80b7('0x88')])<_0x41c23c['dialRecallMeTimeout']*0x3c){if(_0x23f06f[_0x251b87][_0x80b7('0x89')]&&!_0x23f06f[_0x251b87][_0x80b7('0x89')]['voicePause']){_0x2bc40a[_0x80b7('0x8a')](_0x23f06f[_0x251b87]['id'])[_0x80b7('0x86')](ut['logger2']('[RecallMe]'))[_0x80b7('0x8b')](ut['logger2'](_0x80b7('0x8c')));}else{rpcDb[_0x80b7('0x8d')](_0x23f06f[_0x251b87]['id']);}}else{var _0x57d361=new Action(_0x23f06f[_0x251b87],_0x41c23c);_0x57d361[_0x80b7('0x8e')]=moment()[_0x80b7('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');_0x41c23c[_0x80b7('0x41')]+=0x1;ut[_0x80b7('0x8f')](_0x57d361,0x17,_0x80b7('0x90'));if(_0x41c23c[_0x80b7('0x91')]){rpcDb[_0x80b7('0x92')](ut[_0x80b7('0x93')](_0x23f06f[_0x251b87]));rpcDb[_0x80b7('0x94')](_0x57d361,_0x80b7('0x95'));}else{ut[_0x80b7('0x8f')](_0x57d361,0x16,'RecallFailedTimeout');rpcDb['createCustomerHistory'](_0x57d361,_0x80b7('0x96'));rpcDb['createCustomerFinal'](_0x57d361,_0x80b7('0x96'));}}}}})[_0x80b7('0x8b')](ut[_0x80b7('0x97')]('[getContactRecallMe]'));};Preview[_0x80b7('0xc')][_0x80b7('0x98')]=function(_0x50af8a){_0x50af8a[_0x80b7('0x99')]=!![];if(ut[_0x80b7('0x9a')](_0x50af8a[_0x80b7('0x28')])){_0x50af8a[_0x80b7('0x4d')]='AGENTS_NOT_LOGGED';}else if(!ut['isActive'](_0x50af8a[_0x80b7('0x33')])){_0x50af8a[_0x80b7('0x4d')]=_0x80b7('0x9b');}else if(!this['isTrunkReachable'](_0x50af8a['Trunk'])){if(!this[_0x80b7('0x9c')](_0x50af8a[_0x80b7('0x9d')])){_0x50af8a[_0x80b7('0x4d')]='TRUNK_IS_NOT_REACHABLE';}else{_0x50af8a[_0x80b7('0x4d')]=_0x80b7('0x9e');}}else{_0x50af8a[_0x80b7('0x4d')]=_0x80b7('0x9e');}emitCampaignPreview(_0x50af8a);};Preview['prototype']['callProgressDetectingCustomer']=function(_0x32257f,_0x3615df,_0x5a3bb8){var _0x5cf1df=this;var _0x50a69b=this['actions'][_0x3615df];var _0x3e8d05=this['campaignsPreview'][_0x50a69b['queue']];var _0x3418b5;if(_0x3e8d05){switch(_0x5a3bb8){case'1':_0x3e8d05[_0x80b7('0x3f')]+=0x1;_0x50a69b[_0x80b7('0x9f')]+=0x1;_0x50a69b[_0x80b7('0xa0')]=ut[_0x80b7('0xa1')](_0x50a69b);ut[_0x80b7('0x8f')](_0x50a69b,0x0,_0x80b7('0xa2'));ami[_0x80b7('0x24')](_0x80b7('0xa3'),ut['buildObj'](_0x50a69b,'nosuchnumber'));rpcDb['createCustomerHistory'](_0x50a69b,_0x80b7('0xa4'));if(ut[_0x80b7('0xa1')](_0x50a69b)>=_0x3e8d05[_0x80b7('0xa5')]){_0x3418b5=ut[_0x80b7('0xa6')](_0x50a69b,0xf,'Global');rpcDb[_0x80b7('0xa7')](_0x3418b5,_0x80b7('0xa8'));}else{if(_0x50a69b['countnosuchnumberretry']>=_0x3e8d05['dialNoSuchNumberMaxRetry']){rpcDb['createCustomerFinal'](_0x50a69b,_0x80b7('0xa8'));}else{rpcDb[_0x80b7('0xa9')](ut['scheduledAt'](_0x50a69b,_0x80b7('0x9f'),_0x3e8d05['dialNoSuchNumberRetryFrequency']),_0x50a69b['unlockAgent'],_0x50a69b['activeContact']);}}delete this['actions'][_0x32257f['linkedid']];break;case'ANSWER':var _0x5e8526=moment()[_0x80b7('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');_0x50a69b[_0x80b7('0xaa')]=_0x5e8526;_0x50a69b['answertime']=_0x5e8526;_0x50a69b[_0x80b7('0x73')]=!![];_0x3e8d05[_0x80b7('0x29')]+=0x1;logger[_0x80b7('0x5c')]('[syncHangup][talking][increment]',_0x50a69b[_0x80b7('0xab')],_0x80b7('0xac'),_0x3e8d05['name'],_0x80b7('0x72'),_0x3e8d05[_0x80b7('0x29')]);ami['emit'](_0x80b7('0xad'),ut[_0x80b7('0xae')](_0x50a69b,_0x80b7('0xaf'),this['campaignsPreview'][_0x50a69b[_0x80b7('0x70')]]));if(_0x3e8d05['acw']){ami['emit']('custom:agentConnectPreview',ut[_0x80b7('0xb0')](_0x50a69b));}break;case'16':ami['emit']('custom:agentcomplete',ut[_0x80b7('0xae')](_0x50a69b,_0x80b7('0xb1'),this[_0x80b7('0x10')][_0x50a69b[_0x80b7('0x70')]]));emitVoiceQueueChannelRemove(ut[_0x80b7('0xae')](_0x50a69b,_0x80b7('0xb1')));_0x3e8d05[_0x80b7('0x38')]+=0x1;_0x3e8d05[_0x80b7('0x2e')]+=0x1;_0x3e8d05[_0x80b7('0x26')]+=0x1;ut[_0x80b7('0x7d')](_0x3e8d05,_0x80b7('0xb2'));_0x50a69b[_0x80b7('0xa0')]=ut['totalGlobal'](_0x50a69b);ut[_0x80b7('0x8f')](_0x50a69b,0x4,_0x80b7('0xb3'));rpcDb[_0x80b7('0x94')](_0x50a69b,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0x80b7('0xa7')](_0x50a69b,_0x80b7('0xb4'));rpcDb[_0x80b7('0xb5')](_0x50a69b);_0x3e8d05[_0x80b7('0x2b')]+=_0x50a69b[_0x80b7('0xb6')];_0x3e8d05[_0x80b7('0x2a')]+=_0x50a69b[_0x80b7('0xb6')];logger[_0x80b7('0x5c')]('[syncHangup][talking][decrement]',_0x50a69b[_0x80b7('0xab')],_0x80b7('0xac'),_0x3e8d05[_0x80b7('0x54')],'pTalking:\x20',_0x3e8d05['pTalking']);delete this[_0x80b7('0x13')][_0x32257f[_0x80b7('0xb7')]];break;case _0x80b7('0xb8'):_0x3e8d05[_0x80b7('0x39')]+=0x1;_0x50a69b['countbusyretry']+=0x1;_0x50a69b[_0x80b7('0xa0')]=ut[_0x80b7('0xa1')](_0x50a69b);ut[_0x80b7('0x8f')](_0x50a69b,0x5,_0x80b7('0xb9'));ami['emit'](_0x80b7('0xba'),ut[_0x80b7('0xae')](_0x50a69b,_0x80b7('0xbb')));rpcDb['createCustomerHistory'](_0x50a69b,_0x80b7('0xbc'));if(ut[_0x80b7('0xa1')](_0x50a69b)>=_0x3e8d05[_0x80b7('0xa5')]){_0x3418b5=ut[_0x80b7('0xa6')](_0x50a69b,0xf,_0x80b7('0xbd'));rpcDb[_0x80b7('0xa7')](_0x3418b5,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x50a69b[_0x80b7('0xbe')]>=_0x3e8d05[_0x80b7('0xbf')]){rpcDb[_0x80b7('0xa7')](_0x50a69b,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x80b7('0xa9')](ut[_0x80b7('0xc0')](_0x50a69b,_0x80b7('0xbe'),_0x3e8d05[_0x80b7('0xc1')]),_0x50a69b[_0x80b7('0xc2')],_0x50a69b['activeContact']);}}break;case _0x80b7('0xc3'):_0x3e8d05[_0x80b7('0x3e')]+=0x1;_0x50a69b['countnoanswerretry']+=0x1;_0x50a69b[_0x80b7('0xa0')]=ut['totalGlobal'](_0x50a69b);ut[_0x80b7('0x8f')](_0x50a69b,0x3,'NoAnswer');ami[_0x80b7('0x24')](_0x80b7('0xc4'),ut['buildObj'](_0x50a69b,_0x80b7('0xc5')));rpcDb[_0x80b7('0x94')](_0x50a69b,_0x80b7('0xc6'));if(ut[_0x80b7('0xa1')](_0x50a69b)>=_0x3e8d05[_0x80b7('0xa5')]){_0x3418b5=ut['cloneAction'](_0x50a69b,0xf,'Global');rpcDb['createCustomerFinal'](_0x3418b5,_0x80b7('0xc7'));}else{if(_0x50a69b[_0x80b7('0xc8')]>=_0x3e8d05['dialNoAnswerMaxRetry']){rpcDb['createCustomerFinal'](_0x50a69b,_0x80b7('0xc6'));}else{rpcDb[_0x80b7('0xa9')](ut[_0x80b7('0xc0')](_0x50a69b,_0x80b7('0xc8'),_0x3e8d05[_0x80b7('0xc9')]),_0x50a69b[_0x80b7('0xc2')],_0x50a69b[_0x80b7('0xca')]);}}break;case'CONGESTION':_0x3e8d05[_0x80b7('0x3a')]+=0x1;_0x50a69b[_0x80b7('0xcb')]+=0x1;_0x50a69b[_0x80b7('0xa0')]=ut[_0x80b7('0xa1')](_0x50a69b);ut[_0x80b7('0x8f')](_0x50a69b,0x8,_0x80b7('0xcc'));ami[_0x80b7('0x24')](_0x80b7('0xcd'),ut[_0x80b7('0xae')](_0x50a69b,'congestion'));rpcDb[_0x80b7('0x94')](_0x50a69b,_0x80b7('0xce'));if(ut[_0x80b7('0xa1')](_0x50a69b)>=_0x3e8d05[_0x80b7('0xa5')]){_0x3418b5=ut['cloneAction'](_0x50a69b,0xf,_0x80b7('0xbd'));rpcDb[_0x80b7('0xa7')](_0x3418b5,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x50a69b[_0x80b7('0xcb')]>=_0x3e8d05[_0x80b7('0xcf')]){rpcDb[_0x80b7('0xa7')](_0x50a69b,_0x80b7('0xce'));}else{rpcDb['rescheduleContact'](ut[_0x80b7('0xc0')](_0x50a69b,_0x80b7('0xcb'),_0x3e8d05[_0x80b7('0xc1')]),_0x50a69b[_0x80b7('0xc2')],_0x50a69b['activeContact']);}}break;case _0x80b7('0xd0'):_0x3e8d05['outboundRejectCallsDay']+=0x1;_0x50a69b[_0x80b7('0xd1')]+=0x1;_0x50a69b[_0x80b7('0xa0')]=ut['totalGlobal'](_0x50a69b);ut[_0x80b7('0x8f')](_0x50a69b,0x14,_0x80b7('0xd2'));ami['emit'](_0x80b7('0xd3'),ut[_0x80b7('0xae')](_0x50a69b,'agentreject'));rpcDb[_0x80b7('0x94')](_0x50a69b,_0x80b7('0xd4'));if(ut[_0x80b7('0xa1')](_0x50a69b)>=_0x3e8d05['dialGlobalMaxRetry']){_0x3418b5=ut[_0x80b7('0xa6')](_0x50a69b,0x14,_0x80b7('0xd2'));rpcDb[_0x80b7('0xa7')](_0x3418b5,_0x80b7('0xd5'));}else{if(_0x50a69b[_0x80b7('0xd1')]>=_0x3e8d05[_0x80b7('0xd6')]){rpcDb[_0x80b7('0xa7')](_0x50a69b,_0x80b7('0xd5'));}else{rpcDb[_0x80b7('0xa9')](ut[_0x80b7('0xc0')](_0x50a69b,'countagentrejectretry',_0x3e8d05['dialAgentRejectRetryFrequency']),_0x50a69b[_0x80b7('0xc2')],_0x50a69b[_0x80b7('0xca')]);}}break;case _0x80b7('0xd7'):_0x3e8d05[_0x80b7('0x44')]+=0x1;_0x50a69b[_0x80b7('0xd8')]+=0x1;_0x50a69b['countglobal']=ut[_0x80b7('0xa1')](_0x50a69b);ut[_0x80b7('0x8f')](_0x50a69b,0xb,_0x80b7('0xd9'));rpcDb[_0x80b7('0x94')](_0x50a69b,'[callProgressDetectingCustomer][logAbandoned]');if(ut['totalGlobal'](_0x50a69b)>=_0x3e8d05['dialGlobalMaxRetry']){_0x3418b5=ut[_0x80b7('0xa6')](_0x50a69b,0xf,'Global');rpcDb[_0x80b7('0xa7')](_0x3418b5,_0x80b7('0xda'));}else{if(_0x50a69b[_0x80b7('0xdb')]>=_0x3e8d05[_0x80b7('0xdc')]){rpcDb[_0x80b7('0xa7')](_0x50a69b,_0x80b7('0xda'));}else{rpcDb['rescheduleContact'](ut[_0x80b7('0xc0')](_0x50a69b,_0x80b7('0xd8'),_0x3e8d05[_0x80b7('0xdd')]),_0x50a69b[_0x80b7('0xc2')],_0x50a69b[_0x80b7('0xca')]);}}break;case'18':_0x3e8d05[_0x80b7('0x43')]+=0x1;_0x50a69b['countmachineretry']+=0x1;_0x50a69b[_0x80b7('0xa0')]=ut[_0x80b7('0xa1')](_0x50a69b);ut[_0x80b7('0x8f')](_0x50a69b,0x12,_0x32257f[_0x80b7('0xde')]||_0x32257f[_0x80b7('0xdf')]);ami['emit'](_0x80b7('0xe0'),ut[_0x80b7('0xae')](_0x50a69b,'amd'));rpcDb[_0x80b7('0x94')](_0x50a69b,_0x80b7('0xe1'));if(ut['totalGlobal'](_0x50a69b)>=_0x3e8d05[_0x80b7('0xa5')]){_0x3418b5=ut[_0x80b7('0xa6')](_0x50a69b,0xf,_0x80b7('0xbd'));rpcDb[_0x80b7('0xa7')](_0x3418b5,_0x80b7('0xe1'));}else{rpcDb[_0x80b7('0xa7')](_0x50a69b,'[callProgressDetectingCustomer][hangupInAMD]');}delete this['actions'][_0x32257f[_0x80b7('0xb7')]];break;case'19':_0x3e8d05['outboundUnknownCallsDay']+=0x1;_0x50a69b[_0x80b7('0xa0')]=ut[_0x80b7('0xa1')](_0x50a69b);ut[_0x80b7('0x8f')](_0x50a69b,0x13,_0x32257f['cause-txt']||_0x32257f[_0x80b7('0xdf')]);ami[_0x80b7('0x24')](_0x80b7('0xe0'),ut[_0x80b7('0xae')](_0x50a69b,_0x80b7('0xe2')));rpcDb[_0x80b7('0x94')](_0x50a69b,_0x80b7('0xe3'));if(ut['totalGlobal'](_0x50a69b)>=_0x3e8d05[_0x80b7('0xa5')]){_0x3418b5=ut[_0x80b7('0xa6')](_0x50a69b,0xf,_0x80b7('0xbd'));rpcDb['createCustomerFinal'](_0x3418b5,_0x80b7('0xe3'));}else{rpcDb['createCustomerFinal'](_0x50a69b,_0x80b7('0xe3'));}delete this['actions'][_0x32257f['linkedid']];break;default:if(_0x50a69b[_0x80b7('0x73')]){ut[_0x80b7('0x7d')](_0x3e8d05,_0x80b7('0xe4'));ut[_0x80b7('0x7e')](_0x80b7('0xe5')+_0x3e8d05[_0x80b7('0x54')],_0x32257f);}_0x3e8d05['outboundUnknownCallsDay']+=0x1;_0x50a69b[_0x80b7('0xa0')]=ut[_0x80b7('0xa1')](_0x50a69b);ut[_0x80b7('0x8f')](_0x50a69b,0xc,_0x32257f[_0x80b7('0xde')]||_0x32257f['dialstatus']);rpcDb[_0x80b7('0x94')](_0x50a69b,_0x80b7('0xe6'));if(ut[_0x80b7('0xa1')](_0x50a69b)>=_0x3e8d05[_0x80b7('0xa5')]){_0x3418b5=ut['cloneAction'](_0x50a69b,0xf,_0x80b7('0xbd'));rpcDb[_0x80b7('0xa7')](_0x3418b5,_0x80b7('0xe7'));}else{rpcDb[_0x80b7('0xa7')](_0x50a69b,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0x80b7('0x13')][_0x32257f['linkedid']];}if(!(_0x50a69b[_0x80b7('0x73')]&&_0x5a3bb8==='16')){ut[_0x80b7('0x7b')](_0x3e8d05,_0x80b7('0xe8'));logger['info'](_0x80b7('0xe9'),_0x50a69b['uniqueid'],'\x20Queue',_0x3e8d05[_0x80b7('0x54')],_0x80b7('0xea'),_0x3e8d05['originated']);}if(_0x5a3bb8!==_0x80b7('0xeb')){delete this[_0x80b7('0x13')][_0x32257f['linkedid']];delete this[_0x80b7('0x13')][_0x32257f[_0x80b7('0xec')]];}}};Preview[_0x80b7('0xc')][_0x80b7('0xed')]=function(_0x16fbe4,_0x27a28e,_0x1347b4){if(_[_0x80b7('0xee')](_0x27a28e)&&_0x80b7('0xef')!==typeof _0x27a28e){return;}if(_['isUndefined'](_0x1347b4)&&_0x80b7('0xef')!==typeof _0x1347b4){return;}switch(_0x1347b4[_0x80b7('0xf0')]){case'0':ut['logAgent'](_0x16fbe4,0x0,_0x80b7('0xa2'));rpcDb[_0x80b7('0xf1')](_0x16fbe4,_0x80b7('0xf2'));break;case'3':ut[_0x80b7('0xf3')](_0x16fbe4,0x3,_0x80b7('0xf4'));rpcDb[_0x80b7('0xf1')](_0x16fbe4,_0x80b7('0xf5'));break;case'5':ut[_0x80b7('0xf3')](_0x16fbe4,0x5,_0x80b7('0xb9'));rpcDb['createAgentHistory'](_0x16fbe4,_0x80b7('0xf6'));break;case'8':ut[_0x80b7('0xf3')](_0x16fbe4,0x8,_0x80b7('0xcc'));rpcDb[_0x80b7('0xf1')](_0x16fbe4,_0x80b7('0xf7'));break;case'22':ut['logAgent'](_0x16fbe4,0x16,_0x80b7('0xf8'));rpcDb[_0x80b7('0xf1')](_0x16fbe4,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x80b7('0xf3')](_0x16fbe4,0xc,_0x1347b4['reason']);rpcDb['createAgentHistory'](_0x16fbe4,_0x80b7('0xf7'));}ut[_0x80b7('0x7b')](_0x27a28e,_0x80b7('0xf9'));logger[_0x80b7('0x5c')]('[originated][decrement][callProgressDetectingAgent]',_0x16fbe4[_0x80b7('0xab')],_0x80b7('0xac'),_0x27a28e[_0x80b7('0x54')],_0x80b7('0xea'),_0x27a28e['originated']);delete this[_0x80b7('0x13')][_0x16fbe4['uniqueid']];};Preview[_0x80b7('0xc')]['checkInBlack']=function(_0x1782b9,_0x305b7f,_0x2e3a5a,_0xf512f4,_0x5302e6){var _0x1a7f00=this;return new BPromise(function(_0x196e70,_0x1196b7){if(_[_0x80b7('0x6d')](_0x305b7f)||_[_0x80b7('0x6d')](_0x305b7f[_0x80b7('0xfa')])||_[_0x80b7('0x6d')](_0x305b7f[_0x80b7('0xfa')][_0x80b7('0xfb')])||_[_0x80b7('0x6d')](_0x305b7f[_0x80b7('0x76')])){_0x1196b7(ut[_0x80b7('0x4d')](_0x80b7('0xfc'),_0xf512f4,_0x5302e6));return;}var _0x76ed0f=uuid['v4']();var _0x3a8b2b=_0x1a7f00[_0x80b7('0x10')][_0x305b7f[_0x80b7('0x6f')][_0x80b7('0x54')]];var _0x3c7880=_0x2e3a5a?_0x1a7f00[_0x80b7('0x14')][_0x2e3a5a]['id']:undefined;_0x1a7f00['actions'][_0x76ed0f]=new Action(_0x305b7f,_0x3a8b2b,_0x76ed0f,_0x2e3a5a,_0x3c7880);var _0x18b01b=_0x1a7f00[_0x80b7('0x13')][_0x76ed0f];_0x18b01b[_0x80b7('0xc2')]=_0xf512f4;_0x18b01b[_0x80b7('0xca')]=_0x5302e6;_0x18b01b['lookAgent']=_0x2e3a5a;if(_[_0x80b7('0xfd')](_0x1782b9)){_0x1a7f00['execCall'](_0x18b01b,_0x3a8b2b,_0x305b7f,_0x2e3a5a)[_0x80b7('0x86')](function(_0x2fd949){logger[_0x80b7('0x5c')]('[Preview][execCall][success]',_0x80b7('0xfe')+_0x18b01b[_0x80b7('0x70')]+_0x80b7('0xff')+_0x18b01b['idContact'],JSON[_0x80b7('0x58')](_0x2fd949));ami[_0x80b7('0x24')](_0x80b7('0x100'),ut['buildObj'](_0x18b01b,'called',_0x1a7f00[_0x80b7('0x10')][_0x18b01b[_0x80b7('0x70')]]));_0x196e70(ut[_0x80b7('0x4d')](_0x80b7('0x101')));})['catch'](function(_0x20045b){ut['logger']('[Preview][execCall][failure]',_0x20045b);_0x1196b7(ut[_0x80b7('0x4d')](_0x80b7('0x102'),_0xf512f4,_0x5302e6));});}else{_0x3a8b2b[_0x80b7('0x103')]+=0x1;ut[_0x80b7('0x104')](_0x18b01b);rpcDb[_0x80b7('0x105')](_0x18b01b,'[Blacklist][error]');delete _0x1a7f00['actions'][_0x76ed0f];_0x1196b7(ut[_0x80b7('0x4d')](_0x80b7('0x106'),_0xf512f4,_0x5302e6));}});};Preview['prototype'][_0x80b7('0x9c')]=function(_0x5181a7){return!_[_0x80b7('0x6d')](_0x5181a7)&&!_[_0x80b7('0x6d')](_0x5181a7[_0x80b7('0x54')])&&!_[_0x80b7('0x6d')](_0x5181a7['active'])&&_0x5181a7['active']&&!_[_0x80b7('0x6d')](this['trunks'][util['format']('SIP/%s',_0x5181a7[_0x80b7('0x54')])])&&!_[_0x80b7('0x6d')](this[_0x80b7('0x12')][util['format']('SIP/%s',_0x5181a7['name'])][_0x80b7('0x78')])&&(this[_0x80b7('0x12')][util[_0x80b7('0x5a')]('SIP/%s',_0x5181a7[_0x80b7('0x54')])][_0x80b7('0x78')]===_0x80b7('0x107')||this[_0x80b7('0x12')][util[_0x80b7('0x5a')](_0x80b7('0x108'),_0x5181a7[_0x80b7('0x54')])][_0x80b7('0x78')]===_0x80b7('0x109'));};Preview['prototype'][_0x80b7('0x8a')]=function(_0x295bf5,_0x4513f1){var _0x36298c=this;return new BPromise(function(_0x38e029,_0x98b37d){_0x36298c['execRun'](_0x295bf5,_0x4513f1)[_0x80b7('0x86')](function(_0x5bb1e5){_0x38e029(_[_0x80b7('0x74')](_0x5bb1e5,[_0x80b7('0x4d')]));})[_0x80b7('0x8b')](function(_0x275191){if(_0x275191[_0x80b7('0x10a')]){rpcDb[_0x80b7('0x10b')](_0x295bf5);}if(_0x275191['active']){rpcDb[_0x80b7('0x8d')](_0x295bf5);}_0x98b37d(_[_0x80b7('0x74')](_0x275191,[_0x80b7('0x4d')]));});});};Preview[_0x80b7('0xc')][_0x80b7('0x10c')]=function(_0x11b66b,_0x2ae92c){var _0x203bd3=this;return new BPromise(function(_0x555a3a,_0x1a2ee3){var _0x50c7e4,_0x24cb81;rpcDb[_0x80b7('0x10d')](_0x11b66b)[_0x80b7('0x86')](function(_0x29da49){if(!_[_0x80b7('0x6d')](_0x29da49[0x0])){_0x24cb81=_0x29da49[0x0][_0x80b7('0x10e')]?![]:!![];_0x50c7e4=_0x29da49[0x0][_0x80b7('0x10e')]?!![]:![];_0x50c7e4=_0x2ae92c?!![]:_0x50c7e4;}var _0x4ad61c=_0x203bd3['validateContact'](_0x29da49);if(_0x4ad61c['isValid']){rpcDb[_0x80b7('0x10f')](_[_0x80b7('0x74')](_0x29da49[0x0],[_0x80b7('0x76'),_0x80b7('0x110')]))[_0x80b7('0x86')](function(_0xfe4feb){_0x203bd3['checkInBlack'](_0xfe4feb,_0x29da49[0x0],_0x2ae92c,_0x24cb81,_0x50c7e4)['then'](function(_0x5035a0){_0x555a3a(_0x5035a0);})[_0x80b7('0x8b')](function(_0x55fc57){_0x1a2ee3(_0x55fc57);});})['catch'](function(_0x390f40){ut['logger'](_0x80b7('0x111'),_0x390f40);_0x1a2ee3(ut[_0x80b7('0x4d')](_0x80b7('0x112'),_0x24cb81,_0x50c7e4));});}else{_0x1a2ee3(ut['message'](_0x4ad61c['message'],_0x24cb81,_0x50c7e4));}})[_0x80b7('0x8b')](function(_0x14b588){ut[_0x80b7('0x61')](_0x80b7('0x113'),_0x14b588);_0x1a2ee3(ut[_0x80b7('0x4d')](_0x80b7('0x112'),![],!![]));});});};Preview[_0x80b7('0xc')][_0x80b7('0x114')]=function(_0x1e5e08){if(_[_0x80b7('0x6d')](_0x1e5e08)||_['isEmpty'](_0x1e5e08)||!_[_0x80b7('0x6d')](_0x1e5e08[0x0][_0x80b7('0x89')])&&_[_0x80b7('0x6d')](_0x1e5e08[0x0]['Agent'][_0x80b7('0x54')])){ut['logger']('[Preview][validateContact][Empty\x20Contact]',_0x1e5e08);return{'isValid':![],'message':_0x80b7('0x115')};}var _0x40f753=this[_0x80b7('0x10')][_0x1e5e08[0x0][_0x80b7('0x6f')][_0x80b7('0x54')]];_0x40f753[_0x80b7('0x4d')]='ACTIVE';if(_[_0x80b7('0x6d')](_0x40f753)){ut[_0x80b7('0x61')]('[Preview][validateContact][Empty\x20Campaign]',_0x40f753);return{'isValid':![],'message':_0x80b7('0x116')};}if(!this[_0x80b7('0x9c')](_0x40f753[_0x80b7('0x53')])){ut[_0x80b7('0x61')](_0x80b7('0x117'),'campaign\x20Name:\x20'+_0x40f753['name']+_0x80b7('0x118'));if(!this[_0x80b7('0x9c')](_0x40f753[_0x80b7('0x9d')])){ut[_0x80b7('0x61')](_0x80b7('0x117'),_0x40f753[_0x80b7('0x54')]+_0x80b7('0x119'));return{'isValid':![],'message':_0x80b7('0x11a')};}}if(!ut[_0x80b7('0x11b')](_0x40f753['dialActive'])){ut[_0x80b7('0x61')](_0x80b7('0x11c'),_0x40f753['name']+'\x20Not\x20Active');return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x40f753['name']+_0x80b7('0x11d')};}return{'isValid':!![],'message':_0x80b7('0x11e')};};Preview[_0x80b7('0xc')][_0x80b7('0x11f')]=function(_0x1026ef,_0x40553a,_0x3dcbe6,_0x2f8c9d){var _0x452045=this;return new BPromise(function(_0x977c84,_0x162cda){var _0x404b81=_0x1026ef['uniqueid'];var _0x1acd1e=_0x452045[_0x80b7('0x9c')](_0x40553a['Trunk'])?util[_0x80b7('0x5a')](_0x80b7('0x120'),_0x40553a[_0x80b7('0x53')][_0x80b7('0x54')],_[_0x80b7('0x6d')](_0x40553a[_0x80b7('0x36')])?'':_0x40553a[_0x80b7('0x36')][_0x80b7('0x121')]()||'',_0x40553a[_0x80b7('0x122')]>0x0?_0x3dcbe6[_0x80b7('0xfa')][_0x80b7('0xfb')][_0x80b7('0x123')](_0x40553a[_0x80b7('0x122')]):_0x3dcbe6['Contact']['phone']):util[_0x80b7('0x5a')](_0x80b7('0x120'),_[_0x80b7('0x6d')](_0x40553a['TrunkBackup'])?_0x40553a[_0x80b7('0x53')][_0x80b7('0x54')]:_0x40553a[_0x80b7('0x9d')][_0x80b7('0x54')],_[_0x80b7('0x6d')](_0x40553a[_0x80b7('0x36')])?'':_0x40553a[_0x80b7('0x36')]['trim']()||'',_0x40553a[_0x80b7('0x122')]>0x0?_0x3dcbe6[_0x80b7('0xfa')][_0x80b7('0xfb')][_0x80b7('0x123')](_0x40553a[_0x80b7('0x122')]):_0x3dcbe6[_0x80b7('0xfa')][_0x80b7('0xfb')]);var _0x40f9b8=_0x452045[_0x80b7('0x9c')](_0x40553a[_0x80b7('0x53')])?ut[_0x80b7('0x124')](_0x40553a[_0x80b7('0x53')]['callerid'],_0x40553a[_0x80b7('0x34')],_0x40553a[_0x80b7('0x125')]>0x0?ut[_0x80b7('0x126')](_0x40553a[_0x80b7('0x35')],_0x40553a['dialRandomLastDigitCallerIdNumber']):_0x40553a[_0x80b7('0x35')]):ut[_0x80b7('0x124')](_[_0x80b7('0x6d')](_0x40553a[_0x80b7('0x9d')])?_0x40553a['Trunk'][_0x80b7('0x56')]:_0x40553a[_0x80b7('0x9d')]['callerid'],_0x40553a[_0x80b7('0x34')],_0x40553a[_0x80b7('0x125')]>0x0?ut[_0x80b7('0x126')](_0x40553a[_0x80b7('0x35')],_0x40553a['dialRandomLastDigitCallerIdNumber']):_0x40553a[_0x80b7('0x35')]);if(_0x40f9b8){_0x1026ef['originatecalleridname']=ut[_0x80b7('0x127')](_0x40f9b8);_0x1026ef[_0x80b7('0x128')]=ut[_0x80b7('0x129')](_0x40f9b8);}var _0x1a1408=ut['addVariables'](_0x40553a,_0x3dcbe6,_0x1acd1e,_0x40f9b8,_0x404b81,_0x1026ef);_[_0x80b7('0x12a')](_0x1026ef,ut[_0x80b7('0x12b')](_0x1a1408));_0x1026ef[_0x80b7('0x8e')]=moment()[_0x80b7('0x5a')](_0x80b7('0x12c'));ami['Action'](ut[_0x80b7('0x12d')](_0x1026ef,_0x40553a,_0x1a1408,_0x1026ef[_0x80b7('0xca')],_0x2f8c9d))[_0x80b7('0x86')](function(_0xe8eaf4){_0x40553a[_0x80b7('0x71')]+=0x1;logger[_0x80b7('0x5c')](_0x80b7('0x12e'),_0x404b81,_0x80b7('0xac'),_0x40553a[_0x80b7('0x54')],_0x80b7('0xea'),_0x40553a[_0x80b7('0x71')]);_0x977c84(_0xe8eaf4);})[_0x80b7('0x8b')](function(_0x38968c){ut[_0x80b7('0xf3')](_0x1026ef,0xe,_0x80b7('0x12f'));rpcDb[_0x80b7('0xf1')](_0x1026ef,_0x80b7('0x130'));_0x162cda(_0x38968c);});});};Preview[_0x80b7('0xc')][_0x80b7('0x1e')]=function(_0x4b2882){if(this[_0x80b7('0x13')][_0x4b2882[_0x80b7('0xb7')]]){this[_0x80b7('0x13')][_0x4b2882[_0x80b7('0xb7')]][_0x80b7('0x79')]=_0x4b2882[_0x80b7('0x79')];}};Preview[_0x80b7('0xc')][_0x80b7('0x131')]=function(_0x1de76f){var _0x43bafa=this;var _0x1a8785=this['actions'][_0x1de76f[_0x80b7('0x132')]];if(_0x1a8785){if(_0x1a8785[_0x80b7('0x133')]&&this[_0x80b7('0x14')][_0x1a8785[_0x80b7('0x133')]]){ut[_0x80b7('0x134')](_0x1a8785,this['agents'][_0x1a8785[_0x80b7('0x133')]][_0x80b7('0x54')],this[_0x80b7('0x14')][_0x1a8785[_0x80b7('0x133')]]['id']);}var _0x3f16c9=_['clone'](_0x1a8785);_0x3f16c9['responsetime']=moment()[_0x80b7('0x5a')](_0x80b7('0x12c'));var _0x39b665=_0x43bafa['campaignsPreview'][_0x1a8785['queue']];if(ut['isFailure'](_0x1de76f[_0x80b7('0x135')])){if(_0x1a8785[_0x80b7('0xc2')]){rpcDb[_0x80b7('0x10b')](_0x1a8785[_0x80b7('0x136')]);}if(_0x1a8785[_0x80b7('0xca')]){rpcDb[_0x80b7('0x8d')](_0x1a8785[_0x80b7('0x136')]);}ami[_0x80b7('0x24')](_0x80b7('0x137'),ut[_0x80b7('0xae')](_0x1a8785,_0x80b7('0x138'),this[_0x80b7('0x10')][_0x1a8785['queue']]));this['callProgressDetectingAgent'](_0x3f16c9,_0x39b665,_0x1de76f);}else{_0x1a8785['starttime']=moment()[_0x80b7('0x5a')](_0x80b7('0x12c'));ut['logAgent'](_0x3f16c9,0x4,_0x80b7('0xb3'));rpcDb[_0x80b7('0xf1')](_0x3f16c9,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x80b7('0xc')][_0x80b7('0x139')]=function(_0x31030b){var _0x4ebe2f=this;var _0xa6cbce=this[_0x80b7('0x13')][_0x31030b[_0x80b7('0xb7')]];var _0x467bb8;if(_0xa6cbce){_0x467bb8=this[_0x80b7('0x10')][_0xa6cbce[_0x80b7('0x70')]];logger['info'](_0x80b7('0x13a'),_0x31030b[_0x80b7('0xb7')],'\x20Queue',_0x467bb8[_0x80b7('0x54')],_0x80b7('0x72'),_0x467bb8[_0x80b7('0x29')]);}if(this['actions'][_0x31030b[_0x80b7('0xb7')]]&&_0x31030b[_0x80b7('0xb7')]!==_0x31030b[_0x80b7('0xab')]){if(_0x31030b['cause']==='16'&&this[_0x80b7('0x13')][_0x31030b[_0x80b7('0xb7')]][_0x80b7('0x73')]){this[_0x80b7('0x13b')](_0x31030b,_0x31030b[_0x80b7('0xb7')],_0x31030b[_0x80b7('0x13c')]);}else if(this[_0x80b7('0x13')][_0x31030b[_0x80b7('0xb7')]][_0x80b7('0x73')]){logger[_0x80b7('0x5c')](_0x80b7('0x13d'),_0x31030b[_0x80b7('0xb7')],_0x31030b['cause'],_0x80b7('0xac'),_0x467bb8[_0x80b7('0x54')],_0x80b7('0x72'),_0x467bb8[_0x80b7('0x29')]);this[_0x80b7('0x13b')](_0x31030b,_0x31030b[_0x80b7('0xb7')],_0x31030b[_0x80b7('0x13c')]);}}else if(_0xa6cbce&&_[_0x80b7('0x6d')](_0xa6cbce[_0x80b7('0x13e')])&&_0x467bb8[_0x80b7('0x13f')]&&_0x31030b[_0x80b7('0xb7')]===_0x31030b[_0x80b7('0xab')]&&_[_0x80b7('0x6d')](_0x31030b[_0x80b7('0xf0')])&&_0x31030b['cause']==='16'&&_0x31030b[_0x80b7('0x140')]==='6'&&_['isUndefined'](_0xa6cbce['transfer'])){if(_0xa6cbce[_0x80b7('0xc2')]){rpcDb[_0x80b7('0x10b')](_0xa6cbce['idContact']);}if(_0xa6cbce['activeContact']){rpcDb[_0x80b7('0x8d')](_0xa6cbce[_0x80b7('0x136')]);}_0x31030b[_0x80b7('0xf0')]='22';this[_0x80b7('0xed')](_0xa6cbce,_0x467bb8,_0x31030b);}else if(_0xa6cbce&&_0xa6cbce['transfer']){if(_0x31030b[_0x80b7('0x13c')]==='16'&&this[_0x80b7('0x13')][_0x31030b['linkedid']][_0x80b7('0x73')]){logger[_0x80b7('0x5c')](_0x80b7('0x141'),_0x31030b[_0x80b7('0xb7')],_0x31030b[_0x80b7('0x13c')],_0x80b7('0xac'),_0x467bb8[_0x80b7('0x54')],_0x80b7('0x72'),_0x467bb8[_0x80b7('0x29')]);this[_0x80b7('0x13b')](_0x31030b,_0x31030b[_0x80b7('0xb7')],_0x31030b[_0x80b7('0x13c')]);}else if(this[_0x80b7('0x13')][_0x31030b[_0x80b7('0xb7')]]['dialAnswer']){logger[_0x80b7('0x5c')]('[syncHangup][talking][cause]',_0x31030b[_0x80b7('0xb7')],_0x31030b[_0x80b7('0x13c')],_0x80b7('0xac'),_0x467bb8[_0x80b7('0x54')],_0x80b7('0x72'),_0x467bb8[_0x80b7('0x29')]);this[_0x80b7('0x13b')](_0x31030b,_0x31030b[_0x80b7('0xb7')],_0x31030b[_0x80b7('0x13c')]);}}};Preview['prototype'][_0x80b7('0x1c')]=function(_0x1a9000){if(this[_0x80b7('0x13')][_0x1a9000[_0x80b7('0xec')]]&&_0x1a9000[_0x80b7('0xec')]!==_0x1a9000[_0x80b7('0x142')]){this[_0x80b7('0x13b')](_0x1a9000,_0x1a9000[_0x80b7('0xec')],_0x1a9000[_0x80b7('0xdf')]);}};Preview[_0x80b7('0xc')][_0x80b7('0x1a')]=function(_0x33efd0){if(this[_0x80b7('0x13')][_0x33efd0[_0x80b7('0xb7')]]&&_0x33efd0['linkedid']!==_0x33efd0['uniqueid']&&!this[_0x80b7('0x13')][_0x33efd0[_0x80b7('0xb7')]][_0x80b7('0x73')]){if(_0x33efd0[_0x80b7('0x13c')]==='1'){this[_0x80b7('0x13b')](_0x33efd0,_0x33efd0['linkedid'],_0x33efd0[_0x80b7('0x13c')]);}}};Preview[_0x80b7('0xc')][_0x80b7('0x143')]=function(_0x3c72af,_0x34ca05,_0x1e1a2e){if(this['actions'][_0x3c72af]){if(_[_0x80b7('0x6d')](this['actions'][_0x3c72af][_0x80b7('0x144')])){this[_0x80b7('0x13')][_0x3c72af][_0x80b7('0x144')]={};}this[_0x80b7('0x13')][_0x3c72af][_0x80b7('0x144')][_0x34ca05]=_0x1e1a2e;}};Preview[_0x80b7('0xc')]['syncVarSet']=function(_0x55bbf6){try{if(!_[_0x80b7('0x6d')](_0x55bbf6)){if(ut[_0x80b7('0x145')](_[_0x80b7('0x146')](_0x55bbf6[_0x80b7('0x147')])[0x0])){this[_0x80b7('0x143')](_0x55bbf6[_0x80b7('0xab')],_[_0x80b7('0x146')](_0x55bbf6[_0x80b7('0x147')])[0x0],_0x55bbf6[_0x80b7('0x148')]);}}}catch(_0x1b7f52){logger['error'](_0x80b7('0x149'),util[_0x80b7('0x14a')](_0x1b7f52,{'showHidden':![],'depth':null}));}};Preview[_0x80b7('0xc')][_0x80b7('0x21')]=function(_0x373a0d){if(_0x373a0d){if(this['actions'][_0x373a0d[_0x80b7('0x14b')]]){this[_0x80b7('0x13')][_0x373a0d[_0x80b7('0x14b')]][_0x80b7('0x14c')]=!![];}}};Preview[_0x80b7('0xc')][_0x80b7('0x22')]=function(_0x62c89d){if(_0x62c89d){if(this[_0x80b7('0x13')][_0x62c89d[_0x80b7('0x14d')]]){this[_0x80b7('0x13')][_0x62c89d[_0x80b7('0x14d')]][_0x80b7('0x14c')]=!![];}}};module['exports']=Preview;
\ No newline at end of file
+var _0x0faf=['trunks','actions','agents','syncOriginateResponse','hangup','syncHangup','bind','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','blindtransfer','syncBlindTransfer','loopCampaigns','emit','outbound','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumHoldTime','talking','type','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','stringify','format','voice:queue:%s','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','paused','message','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','clockClearZombieChannels','hasOwnProperty','clearZombieChannels','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','sequence','isNil','info','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','contactId','UserId','VoiceQueueId','ListId','status','channel','catch','[clearZombieChannel]','dialAnswer','decrementTalkink','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','[action]','size','agentReadyId','then','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','logger2','[RecallMe]','disableContact','starttime','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','AGENTS_NOT_LOGGED','isActive','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','totalGlobal','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','scheduledAt','countnosuchnumberretry','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','ANSWER','responsetime','answertime','uniqueid','\x20Queue','custom:agentconnect','acw','complete','[16]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','[syncHangup][talking][decrement]','linkedid','outboundBusyCallsDay','countbusyretry','countglobal','Busy','busy','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','rescheduleContact','NoAnswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerRetryFrequency','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','dialCongestionMaxRetry','countagentrejectretry','custom:agentreject','cloneAction','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','dialAbandonedRetryFrequency','outboundUnknownCallsDay','dialstatus','amd','[callProgressDetectingCustomer][hangupInAMD]','cause-txt','custom:amd','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','updateOriginated','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','object','isUndefined','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','reason','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','Contact\x20is\x20undefined','lookAgent','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','[Preview][execCall][failure]','Call\x20failed','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','isTrunkReachable','SIP/%s','unmonitored','run','execRun','pick','unlockContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','Empty\x20Contact','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','trim','dialCutDigit','phone','substring','SIP/%s/%s%s','getCallerId','callerid','getCallerIdRandom','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','YYYY-MM-DD\x20HH:mm:ss','Action','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','isFailure','idContact','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','callProgressDetectingAgent','[syncHangup][talking][transfer]','addVariable','variables','filterKey','variable','keys','value','error','inspect','exports','util','bluebird','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','../ami','./rpcDb','./action','./util/util','redis','localhost','prototype','enqueue','tail','finally','campaignsPreview'];(function(_0x418b36,_0x48237b){var _0x149248=function(_0x1389e4){while(--_0x1389e4){_0x418b36['push'](_0x418b36['shift']());}};_0x149248(++_0x48237b);}(_0x0faf,0x132));var _0xf0fa=function(_0x42184d,_0x264f92){_0x42184d=_0x42184d-0x0;var _0x144722=_0x0faf[_0x42184d];return _0x144722;};'use strict';var util=require(_0xf0fa('0x0'));var _=require('lodash');var BPromise=require(_0xf0fa('0x1'));var uuid=require(_0xf0fa('0x2'));var moment=require(_0xf0fa('0x3'));var md5=require(_0xf0fa('0x4'));var Redis=require(_0xf0fa('0x5'));var config=require(_0xf0fa('0x6'));var logger=require(_0xf0fa('0x7'))(_0xf0fa('0x8'));var loggerAction=require(_0xf0fa('0x7'))('actionPreview');var ami=require(_0xf0fa('0x9'));var rpcDb=require(_0xf0fa('0xa'));var Action=require(_0xf0fa('0xb'));var ut=require(_0xf0fa('0xc'));config[_0xf0fa('0xd')]=_['defaults'](config[_0xf0fa('0xd')],{'host':_0xf0fa('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Sequence=function(){};Sequence[_0xf0fa('0xf')][_0xf0fa('0x10')]=function(_0x25dfec){this[_0xf0fa('0x11')]=this[_0xf0fa('0x11')]?this[_0xf0fa('0x11')][_0xf0fa('0x12')](_0x25dfec):_0x25dfec();};function Preview(_0x20fd09){this['sequence']=new Sequence();this[_0xf0fa('0x13')]=_0x20fd09['voiceQueues'];this[_0xf0fa('0x14')]=_0x20fd09['trunks'];this[_0xf0fa('0x15')]={};this[_0xf0fa('0x16')]=_0x20fd09[_0xf0fa('0x16')];this['clockClearZombieChannels']=0x0;ami['on']('originateresponse',this[_0xf0fa('0x17')]['bind'](this));ami['on'](_0xf0fa('0x18'),this[_0xf0fa('0x19')][_0xf0fa('0x1a')](this));ami['on'](_0xf0fa('0x1b'),this[_0xf0fa('0x1c')][_0xf0fa('0x1a')](this));ami['on'](_0xf0fa('0x1d'),this[_0xf0fa('0x1e')]['bind'](this));ami['on'](_0xf0fa('0x1f'),this[_0xf0fa('0x20')][_0xf0fa('0x1a')](this));ami['on'](_0xf0fa('0x21'),this[_0xf0fa('0x22')][_0xf0fa('0x1a')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0xf0fa('0x1a')](this));ami['on'](_0xf0fa('0x23'),this[_0xf0fa('0x24')][_0xf0fa('0x1a')](this));this[_0xf0fa('0x25')](this[_0xf0fa('0x13')]);}function emit(_0x32c9bc,_0x3de639,_0x3b87a2){io['to'](_0x32c9bc)[_0xf0fa('0x26')](_0x3de639,_0x3b87a2);}function emitCampaignPreview(_0x1878c4){if(_0x1878c4['type']===_0xf0fa('0x27')){var _0x306f3e={'id':_0x1878c4['id'],'name':_0x1878c4[_0xf0fa('0x28')],'strategy':_0x1878c4[_0xf0fa('0x29')],'answered':_0x1878c4[_0xf0fa('0x2a')],'available':_0x1878c4[_0xf0fa('0x2b')],'loggedIn':_0x1878c4[_0xf0fa('0x2c')],'pTalking':_0x1878c4[_0xf0fa('0x2d')],'sumBillable':_0x1878c4[_0xf0fa('0x2e')],'sumDuration':_0x1878c4['sumDuration'],'sumHoldTime':_0x1878c4[_0xf0fa('0x2f')]||0x0,'talking':_0x1878c4[_0xf0fa('0x30')],'total':_0x1878c4['total'],'type':_0x1878c4[_0xf0fa('0x31')],'unmanaged':_0x1878c4[_0xf0fa('0x32')],'abandoned':_0x1878c4[_0xf0fa('0x33')],'waiting':_0x1878c4['waiting'],'loggedInDb':_0x1878c4[_0xf0fa('0x34')],'dialActive':_0x1878c4[_0xf0fa('0x35')],'dialMethod':_0x1878c4[_0xf0fa('0x36')],'dialOriginateCallerIdName':_0x1878c4[_0xf0fa('0x37')],'dialOriginateCallerIdNumber':_0x1878c4['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x1878c4['dialOriginateTimeout'],'dialPrefix':_0x1878c4[_0xf0fa('0x38')],'outboundAnswerAgiCallsDay':_0x1878c4[_0xf0fa('0x39')],'outboundAnswerCallsDay':_0x1878c4[_0xf0fa('0x3a')],'outboundBlacklistCallsDay':_0x1878c4[_0xf0fa('0x3b')],'outboundBusyCallsDay':_0x1878c4['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x1878c4[_0xf0fa('0x3c')],'outboundDropCallsDayACS':_0x1878c4[_0xf0fa('0x3d')],'outboundDropCallsDayCallersExit':_0x1878c4[_0xf0fa('0x3e')],'outboundDropCallsDayTimeout':_0x1878c4['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x1878c4[_0xf0fa('0x3f')],'outboundNoSuchCallsDay':_0x1878c4['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x1878c4[_0xf0fa('0x40')],'outboundReCallsDay':_0x1878c4[_0xf0fa('0x41')],'outboundRejectCallsDay':_0x1878c4[_0xf0fa('0x42')],'outboundUnknownCallsDay':_0x1878c4['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x1878c4[_0xf0fa('0x43')],'predictiveIntervalAnsweredCalls':_0x1878c4[_0xf0fa('0x44')],'predictiveIntervalAvgHoldtime':_0x1878c4[_0xf0fa('0x45')],'predictiveIntervalAvgTalktime':_0x1878c4[_0xf0fa('0x46')],'predictiveIntervalDroppedCallsCallersExit':_0x1878c4[_0xf0fa('0x47')],'predictiveIntervalDroppedCallsTimeout':_0x1878c4[_0xf0fa('0x48')],'predictiveIntervalErlangCalls':_0x1878c4['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x1878c4['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x1878c4[_0xf0fa('0x49')],'predictiveIntervalMultiplicativeFactor':_0x1878c4[_0xf0fa('0x4a')],'predictiveIntervalPauses':_0x1878c4['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x1878c4[_0xf0fa('0x4b')],'predictiveIntervalTotalCalls':_0x1878c4['predictiveIntervalTotalCalls'],'message':_0x1878c4['message'],'originated':_0x1878c4['originated'],'erlangCalls':_0x1878c4[_0xf0fa('0x4c')],'erlangCallToSecond':_0x1878c4['erlangCallToSecond'],'erlangAbandonmentRate':_0x1878c4[_0xf0fa('0x4d')],'erlangBusyFactor':_0x1878c4[_0xf0fa('0x4e')],'startPredictive':_0x1878c4[_0xf0fa('0x4f')],'startProgressive':_0x1878c4[_0xf0fa('0x50')]};if(_0x1878c4[_0xf0fa('0x51')]){_0x306f3e[_0xf0fa('0x51')]={'id':_0x1878c4[_0xf0fa('0x51')]['id'],'name':_0x1878c4[_0xf0fa('0x51')]['name'],'active':_0x1878c4[_0xf0fa('0x51')][_0xf0fa('0x52')],'callerid':_0x1878c4[_0xf0fa('0x51')]['callerid']};}if(_0x1878c4[_0xf0fa('0x53')]){_0x306f3e[_0xf0fa('0x53')]={'id':_0x1878c4[_0xf0fa('0x53')]['id'],'name':_0x1878c4[_0xf0fa('0x53')]['name']};}var _0x5c474e=md5(JSON[_0xf0fa('0x54')](_0x306f3e));if(_0x1878c4[_0xf0fa('0x4')]!==_0x5c474e){_0x1878c4[_0xf0fa('0x4')]=_0x5c474e;emit(util[_0xf0fa('0x55')](_0xf0fa('0x56'),_0x306f3e['name']),'voice_queue:save',_0x306f3e);}}}function emitVoiceQueueChannelRemove(_0x5a2be0){logger['info'](_0xf0fa('0x57'),JSON[_0xf0fa('0x54')](_0x5a2be0));emit(util['format']('voice:queue:%s',_0x5a2be0[_0xf0fa('0x28')]),_0xf0fa('0x58'),_0x5a2be0);io[_0xf0fa('0x26')](_0xf0fa('0x59'),_0x5a2be0);}function notSendMessagesQueue(_0x2202de){if(_0x2202de[_0xf0fa('0x5a')]){if(_0x2202de[_0xf0fa('0x5b')]===0x0&&_0x2202de['pTalking']===0x0){_0x2202de['sendMessageOneNotActive']=![];_0x2202de[_0xf0fa('0x2b')]=0x0;_0x2202de[_0xf0fa('0x5c')]=0x0;_0x2202de[_0xf0fa('0x5d')]=_0xf0fa('0x5e');ut[_0xf0fa('0x5f')](_0xf0fa('0x60'),_0x2202de['name']+_0xf0fa('0x61'));}else{_0x2202de['message']=_0xf0fa('0x62');ut[_0xf0fa('0x5f')](_0xf0fa('0x60'),_0x2202de[_0xf0fa('0x28')]+_0xf0fa('0x63'));}emitCampaignPreview(_0x2202de);}}Preview[_0xf0fa('0xf')][_0xf0fa('0x25')]=function(){var _0x36778f=this;setInterval(function(){_0x36778f[_0xf0fa('0x64')]();},0x7cf);};Preview['prototype']['syncCampaigns']=function(){var _0x52221a=this[_0xf0fa('0x13')];this[_0xf0fa('0x65')]+=0x1;for(var _0x53667f in _0x52221a){if(_0x52221a[_0xf0fa('0x66')](_0x53667f)&&(_0x52221a[_0x53667f][_0xf0fa('0x36')]===_0xf0fa('0x8')||_0x52221a[_0x53667f][_0xf0fa('0x36')]==='booked')&&_0x52221a[_0x53667f][_0xf0fa('0x31')]===_0xf0fa('0x27')){if(this[_0xf0fa('0x65')]>0x7){this[_0xf0fa('0x65')]=0x0;this[_0xf0fa('0x67')]();}}if(_0x52221a[_0xf0fa('0x66')](_0x53667f)&&_0x52221a[_0x53667f][_0xf0fa('0x36')]===_0xf0fa('0x8')&&_0x52221a[_0x53667f][_0xf0fa('0x31')]==='outbound'){if(_0x52221a[_0x53667f][_0xf0fa('0x35')]){this[_0xf0fa('0x68')](_0x52221a[_0x53667f]);if(_0x52221a[_0x53667f][_0xf0fa('0x69')])this[_0xf0fa('0x6a')](_0x52221a[_0x53667f]);}else{notSendMessagesQueue(_0x52221a[_0x53667f]);}}}};Preview[_0xf0fa('0xf')][_0xf0fa('0x6b')]=function(_0x53b2a6){var _0xd86643=this;this[_0xf0fa('0x6c')]['enqueue'](function(){if(!_[_0xf0fa('0x6d')](_0xd86643[_0xf0fa('0x15')][_0x53b2a6])){loggerAction[_0xf0fa('0x6e')](_0xf0fa('0x6f'),_0x53b2a6,_0xf0fa('0x70'),_0xd86643[_0xf0fa('0x15')][_0x53b2a6][_0xf0fa('0x71')],_0xf0fa('0x72'),JSON[_0xf0fa('0x54')](_0xd86643['campaignsPreview'][_0xd86643[_0xf0fa('0x15')][_0x53b2a6]['queue']][_0xf0fa('0x5b')]),_0xf0fa('0x73'),JSON[_0xf0fa('0x54')](_0xd86643['campaignsPreview'][_0xd86643[_0xf0fa('0x15')][_0x53b2a6][_0xf0fa('0x71')]][_0xf0fa('0x2d')]),JSON[_0xf0fa('0x54')](_0xd86643[_0xf0fa('0x15')][_0x53b2a6]['dialAnswer']),JSON[_0xf0fa('0x54')](_['pick'](_0xd86643[_0xf0fa('0x15')][_0x53b2a6],[_0xf0fa('0x74'),_0xf0fa('0x75'),_0xf0fa('0x76'),_0xf0fa('0x77')])));return ami['Action']({'action':_0xf0fa('0x78'),'channel':_0xd86643[_0xf0fa('0x15')][_0x53b2a6][_0xf0fa('0x79')]})[_0xf0fa('0x7a')](function(_0x1002e1){if(_0x1002e1[_0xf0fa('0x5d')]==='No\x20such\x20channel'){setTimeout(function(){if(_0xd86643[_0xf0fa('0x15')][_0x53b2a6]){ut['updateOriginated'](_0xd86643['campaignsPreview'][_0xd86643['actions'][_0x53b2a6][_0xf0fa('0x71')]],_0xf0fa('0x7b'));if(_0xd86643[_0xf0fa('0x15')][_0x53b2a6][_0xf0fa('0x7c')]===!![]){ut[_0xf0fa('0x7d')](_0xd86643[_0xf0fa('0x13')][_0xd86643[_0xf0fa('0x15')][_0x53b2a6][_0xf0fa('0x71')]],_0xf0fa('0x7b'));ut['loggerError'](_0xf0fa('0x7e')+_0x53b2a6,_0xd86643['actions'][_0x53b2a6][_0xf0fa('0x71')]);}ut[_0xf0fa('0x7f')](_0xf0fa('0x80')+_0x53b2a6,_0xd86643[_0xf0fa('0x15')][_0x53b2a6]['queue']);delete _0xd86643[_0xf0fa('0x15')][_0x53b2a6];}},0x2328);}});}});};Preview['prototype'][_0xf0fa('0x67')]=function(){var _0x398ea0=this;loggerAction[_0xf0fa('0x6e')](_0xf0fa('0x81'),_[_0xf0fa('0x82')](this[_0xf0fa('0x15')]));for(var _0x4fa721 in this[_0xf0fa('0x15')]){if(_0x398ea0[_0xf0fa('0x15')]['hasOwnProperty'](_0x4fa721)){_0x398ea0[_0xf0fa('0x6b')](_0x4fa721);}}};Preview[_0xf0fa('0xf')]['recallMe']=function(_0x48d769){var _0x2857ae=this;rpcDb['getContactRecallMe'](_0x48d769['id'],ut[_0xf0fa('0x83')](this[_0xf0fa('0x16')]))[_0xf0fa('0x84')](function(_0x4db972){if(!_[_0xf0fa('0x6d')](_0x4db972)){for(var _0x190f2b=0x0;_0x190f2b<_0x4db972['length'];_0x190f2b+=0x1){if(ut[_0xf0fa('0x85')](_0x4db972[_0x190f2b][_0xf0fa('0x86')])<_0x48d769[_0xf0fa('0x87')]*0x3c){if(_0x4db972[_0x190f2b]['Agent']&&!_0x4db972[_0x190f2b][_0xf0fa('0x88')][_0xf0fa('0x89')]){_0x2857ae['run'](_0x4db972[_0x190f2b]['id'])[_0xf0fa('0x84')](ut[_0xf0fa('0x8a')](_0xf0fa('0x8b')))[_0xf0fa('0x7a')](ut[_0xf0fa('0x8a')](_0xf0fa('0x8b')));}else{rpcDb[_0xf0fa('0x8c')](_0x4db972[_0x190f2b]['id']);}}else{var _0x337640=new Action(_0x4db972[_0x190f2b],_0x48d769);_0x337640[_0xf0fa('0x8d')]=moment()[_0xf0fa('0x55')]('YYYY-MM-DD\x20HH:mm:ss');_0x48d769[_0xf0fa('0x41')]+=0x1;ut[_0xf0fa('0x8e')](_0x337640,0x17,_0xf0fa('0x8f'));if(_0x48d769[_0xf0fa('0x90')]){rpcDb[_0xf0fa('0x91')](ut[_0xf0fa('0x92')](_0x4db972[_0x190f2b]));rpcDb[_0xf0fa('0x93')](_0x337640,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0xf0fa('0x8e')](_0x337640,0x16,_0xf0fa('0x94'));rpcDb[_0xf0fa('0x93')](_0x337640,_0xf0fa('0x95'));rpcDb[_0xf0fa('0x96')](_0x337640,_0xf0fa('0x95'));}}}}})[_0xf0fa('0x7a')](ut['logger2'](_0xf0fa('0x97')));};Preview[_0xf0fa('0xf')][_0xf0fa('0x68')]=function(_0x1f608e){_0x1f608e[_0xf0fa('0x5a')]=!![];if(ut['IsNotLoggedIn'](_0x1f608e['loggedIn'])){_0x1f608e['message']=_0xf0fa('0x98');}else if(!ut[_0xf0fa('0x99')](_0x1f608e[_0xf0fa('0x35')])){_0x1f608e[_0xf0fa('0x5d')]='NOT_ACTIVE';}else if(!this['isTrunkReachable'](_0x1f608e[_0xf0fa('0x51')])){if(!this['isTrunkReachable'](_0x1f608e[_0xf0fa('0x9a')])){_0x1f608e[_0xf0fa('0x5d')]=_0xf0fa('0x9b');}else{_0x1f608e[_0xf0fa('0x5d')]=_0xf0fa('0x9c');}}else{_0x1f608e['message']=_0xf0fa('0x9c');}emitCampaignPreview(_0x1f608e);};Preview[_0xf0fa('0xf')][_0xf0fa('0x9d')]=function(_0x147f71,_0x3e3f6b,_0x43bad2){var _0x30f0fe=this;var _0x35e7e7=this[_0xf0fa('0x15')][_0x3e3f6b];var _0x4c2fdd=this['campaignsPreview'][_0x35e7e7[_0xf0fa('0x71')]];var _0x4d8d2f;if(_0x4c2fdd){switch(_0x43bad2){case'1':_0x4c2fdd[_0xf0fa('0x9e')]+=0x1;_0x35e7e7['countnosuchnumberretry']+=0x1;_0x35e7e7['countglobal']=ut['totalGlobal'](_0x35e7e7);ut[_0xf0fa('0x8e')](_0x35e7e7,0x0,_0xf0fa('0x9f'));ami[_0xf0fa('0x26')](_0xf0fa('0xa0'),ut[_0xf0fa('0xa1')](_0x35e7e7,_0xf0fa('0xa2')));rpcDb[_0xf0fa('0x93')](_0x35e7e7,_0xf0fa('0xa3'));if(ut[_0xf0fa('0xa4')](_0x35e7e7)>=_0x4c2fdd[_0xf0fa('0xa5')]){_0x4d8d2f=ut['cloneAction'](_0x35e7e7,0xf,_0xf0fa('0xa6'));rpcDb['createCustomerFinal'](_0x4d8d2f,_0xf0fa('0xa7'));}else{if(_0x35e7e7['countnosuchnumberretry']>=_0x4c2fdd[_0xf0fa('0xa8')]){rpcDb['createCustomerFinal'](_0x35e7e7,_0xf0fa('0xa7'));}else{rpcDb['rescheduleContact'](ut[_0xf0fa('0xa9')](_0x35e7e7,_0xf0fa('0xaa'),_0x4c2fdd[_0xf0fa('0xab')]),_0x35e7e7[_0xf0fa('0xac')],_0x35e7e7[_0xf0fa('0xad')]);}}delete this['actions'][_0x147f71['linkedid']];break;case _0xf0fa('0xae'):var _0x157772=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x35e7e7[_0xf0fa('0xaf')]=_0x157772;_0x35e7e7[_0xf0fa('0xb0')]=_0x157772;_0x35e7e7[_0xf0fa('0x7c')]=!![];_0x4c2fdd[_0xf0fa('0x2d')]+=0x1;logger[_0xf0fa('0x6e')]('[syncHangup][talking][increment]',_0x35e7e7[_0xf0fa('0xb1')],_0xf0fa('0xb2'),_0x4c2fdd[_0xf0fa('0x28')],'pTalking:\x20',_0x4c2fdd['pTalking']);ami[_0xf0fa('0x26')](_0xf0fa('0xb3'),ut['buildObj'](_0x35e7e7,'connect',this[_0xf0fa('0x13')][_0x35e7e7[_0xf0fa('0x71')]]));if(_0x4c2fdd[_0xf0fa('0xb4')]){ami['emit']('custom:agentConnectPreview',ut['buildAcw'](_0x35e7e7));}break;case'16':ami[_0xf0fa('0x26')]('custom:agentcomplete',ut['buildObj'](_0x35e7e7,_0xf0fa('0xb5'),this[_0xf0fa('0x13')][_0x35e7e7[_0xf0fa('0x71')]]));emitVoiceQueueChannelRemove(ut[_0xf0fa('0xa1')](_0x35e7e7,_0xf0fa('0xb5')));_0x4c2fdd[_0xf0fa('0x3a')]+=0x1;_0x4c2fdd['total']+=0x1;_0x4c2fdd[_0xf0fa('0x2a')]+=0x1;ut[_0xf0fa('0x7d')](_0x4c2fdd,_0xf0fa('0xb6'));_0x35e7e7['countglobal']=ut[_0xf0fa('0xa4')](_0x35e7e7);ut['logCustomer'](_0x35e7e7,0x4,'Answer');rpcDb[_0xf0fa('0x93')](_0x35e7e7,'[callProgressDetectingCustomer][logAnswer]');rpcDb['createCustomerFinal'](_0x35e7e7,_0xf0fa('0xb7'));rpcDb[_0xf0fa('0xb8')](_0x35e7e7);_0x4c2fdd[_0xf0fa('0xb9')]+=_0x35e7e7['talktime'];_0x4c2fdd[_0xf0fa('0x2e')]+=_0x35e7e7[_0xf0fa('0xba')];logger['info'](_0xf0fa('0xbb'),_0x35e7e7[_0xf0fa('0xb1')],_0xf0fa('0xb2'),_0x4c2fdd[_0xf0fa('0x28')],_0xf0fa('0x73'),_0x4c2fdd[_0xf0fa('0x2d')]);delete this['actions'][_0x147f71[_0xf0fa('0xbc')]];break;case'BUSY':_0x4c2fdd[_0xf0fa('0xbd')]+=0x1;_0x35e7e7[_0xf0fa('0xbe')]+=0x1;_0x35e7e7[_0xf0fa('0xbf')]=ut[_0xf0fa('0xa4')](_0x35e7e7);ut[_0xf0fa('0x8e')](_0x35e7e7,0x5,_0xf0fa('0xc0'));ami[_0xf0fa('0x26')]('custom:agentbusy',ut['buildObj'](_0x35e7e7,_0xf0fa('0xc1')));rpcDb[_0xf0fa('0x93')](_0x35e7e7,'[callProgressDetectingCustomer][logBusy]');if(ut[_0xf0fa('0xa4')](_0x35e7e7)>=_0x4c2fdd['dialGlobalMaxRetry']){_0x4d8d2f=ut['cloneAction'](_0x35e7e7,0xf,_0xf0fa('0xa6'));rpcDb[_0xf0fa('0x96')](_0x4d8d2f,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x35e7e7['countbusyretry']>=_0x4c2fdd[_0xf0fa('0xc2')]){rpcDb[_0xf0fa('0x96')](_0x35e7e7,_0xf0fa('0xc3'));}else{rpcDb[_0xf0fa('0xc4')](ut[_0xf0fa('0xa9')](_0x35e7e7,_0xf0fa('0xbe'),_0x4c2fdd['dialBusyRetryFrequency']),_0x35e7e7[_0xf0fa('0xac')],_0x35e7e7[_0xf0fa('0xad')]);}}break;case'NOANSWER':_0x4c2fdd[_0xf0fa('0x3f')]+=0x1;_0x35e7e7['countnoanswerretry']+=0x1;_0x35e7e7[_0xf0fa('0xbf')]=ut['totalGlobal'](_0x35e7e7);ut['logCustomer'](_0x35e7e7,0x3,_0xf0fa('0xc5'));ami['emit']('custom:agentnoanswer',ut['buildObj'](_0x35e7e7,'noanswer'));rpcDb[_0xf0fa('0x93')](_0x35e7e7,'[callProgressDetectingCustomer][logNoAnswer]');if(ut[_0xf0fa('0xa4')](_0x35e7e7)>=_0x4c2fdd[_0xf0fa('0xa5')]){_0x4d8d2f=ut['cloneAction'](_0x35e7e7,0xf,_0xf0fa('0xa6'));rpcDb[_0xf0fa('0x96')](_0x4d8d2f,_0xf0fa('0xc6'));}else{if(_0x35e7e7[_0xf0fa('0xc7')]>=_0x4c2fdd['dialNoAnswerMaxRetry']){rpcDb[_0xf0fa('0x96')](_0x35e7e7,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0xf0fa('0xc4')](ut['scheduledAt'](_0x35e7e7,_0xf0fa('0xc7'),_0x4c2fdd[_0xf0fa('0xc8')]),_0x35e7e7[_0xf0fa('0xac')],_0x35e7e7[_0xf0fa('0xad')]);}}break;case'CONGESTION':_0x4c2fdd['outboundCongestionCallsDay']+=0x1;_0x35e7e7[_0xf0fa('0xc9')]+=0x1;_0x35e7e7['countglobal']=ut[_0xf0fa('0xa4')](_0x35e7e7);ut[_0xf0fa('0x8e')](_0x35e7e7,0x8,_0xf0fa('0xca'));ami['emit'](_0xf0fa('0xcb'),ut['buildObj'](_0x35e7e7,_0xf0fa('0xcc')));rpcDb[_0xf0fa('0x93')](_0x35e7e7,_0xf0fa('0xcd'));if(ut['totalGlobal'](_0x35e7e7)>=_0x4c2fdd[_0xf0fa('0xa5')]){_0x4d8d2f=ut['cloneAction'](_0x35e7e7,0xf,_0xf0fa('0xa6'));rpcDb[_0xf0fa('0x96')](_0x4d8d2f,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x35e7e7[_0xf0fa('0xc9')]>=_0x4c2fdd[_0xf0fa('0xce')]){rpcDb[_0xf0fa('0x96')](_0x35e7e7,_0xf0fa('0xcd'));}else{rpcDb['rescheduleContact'](ut[_0xf0fa('0xa9')](_0x35e7e7,'countcongestionretry',_0x4c2fdd['dialBusyRetryFrequency']),_0x35e7e7[_0xf0fa('0xac')],_0x35e7e7[_0xf0fa('0xad')]);}}break;case'CANCEL':_0x4c2fdd['outboundRejectCallsDay']+=0x1;_0x35e7e7[_0xf0fa('0xcf')]+=0x1;_0x35e7e7[_0xf0fa('0xbf')]=ut['totalGlobal'](_0x35e7e7);ut[_0xf0fa('0x8e')](_0x35e7e7,0x14,'AgentReject');ami[_0xf0fa('0x26')](_0xf0fa('0xd0'),ut['buildObj'](_0x35e7e7,'agentreject'));rpcDb[_0xf0fa('0x93')](_0x35e7e7,'[syncHangupRequest][logAgentReject]');if(ut[_0xf0fa('0xa4')](_0x35e7e7)>=_0x4c2fdd[_0xf0fa('0xa5')]){_0x4d8d2f=ut[_0xf0fa('0xd1')](_0x35e7e7,0x14,'AgentReject');rpcDb['createCustomerFinal'](_0x4d8d2f,_0xf0fa('0xd2'));}else{if(_0x35e7e7['countagentrejectretry']>=_0x4c2fdd[_0xf0fa('0xd3')]){rpcDb[_0xf0fa('0x96')](_0x35e7e7,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0xf0fa('0xc4')](ut['scheduledAt'](_0x35e7e7,_0xf0fa('0xcf'),_0x4c2fdd[_0xf0fa('0xd4')]),_0x35e7e7[_0xf0fa('0xac')],_0x35e7e7[_0xf0fa('0xad')]);}}break;case'ABANDONED':_0x4c2fdd['outboundAbandonedCallsDay']+=0x1;_0x35e7e7[_0xf0fa('0xd5')]+=0x1;_0x35e7e7['countglobal']=ut[_0xf0fa('0xa4')](_0x35e7e7);ut['logCustomer'](_0x35e7e7,0xb,'Abandoned');rpcDb[_0xf0fa('0x93')](_0x35e7e7,'[callProgressDetectingCustomer][logAbandoned]');if(ut['totalGlobal'](_0x35e7e7)>=_0x4c2fdd[_0xf0fa('0xa5')]){_0x4d8d2f=ut['cloneAction'](_0x35e7e7,0xf,'Global');rpcDb[_0xf0fa('0x96')](_0x4d8d2f,_0xf0fa('0xd6'));}else{if(_0x35e7e7['countabandonedetry']>=_0x4c2fdd[_0xf0fa('0xd7')]){rpcDb['createCustomerFinal'](_0x35e7e7,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0xf0fa('0xc4')](ut['scheduledAt'](_0x35e7e7,'countabandonedretry',_0x4c2fdd[_0xf0fa('0xd8')]),_0x35e7e7['unlockAgent'],_0x35e7e7[_0xf0fa('0xad')]);}}break;case'18':_0x4c2fdd[_0xf0fa('0xd9')]+=0x1;_0x35e7e7['countmachineretry']+=0x1;_0x35e7e7[_0xf0fa('0xbf')]=ut[_0xf0fa('0xa4')](_0x35e7e7);ut[_0xf0fa('0x8e')](_0x35e7e7,0x12,_0x147f71['cause-txt']||_0x147f71[_0xf0fa('0xda')]);ami[_0xf0fa('0x26')]('custom:amd',ut['buildObj'](_0x35e7e7,_0xf0fa('0xdb')));rpcDb['createCustomerHistory'](_0x35e7e7,'[callProgressDetectingCustomer][hangupInAMD]');if(ut[_0xf0fa('0xa4')](_0x35e7e7)>=_0x4c2fdd['dialGlobalMaxRetry']){_0x4d8d2f=ut['cloneAction'](_0x35e7e7,0xf,_0xf0fa('0xa6'));rpcDb['createCustomerFinal'](_0x4d8d2f,_0xf0fa('0xdc'));}else{rpcDb[_0xf0fa('0x96')](_0x35e7e7,_0xf0fa('0xdc'));}delete this[_0xf0fa('0x15')][_0x147f71[_0xf0fa('0xbc')]];break;case'19':_0x4c2fdd['outboundUnknownCallsDay']+=0x1;_0x35e7e7[_0xf0fa('0xbf')]=ut[_0xf0fa('0xa4')](_0x35e7e7);ut[_0xf0fa('0x8e')](_0x35e7e7,0x13,_0x147f71[_0xf0fa('0xdd')]||_0x147f71[_0xf0fa('0xda')]);ami[_0xf0fa('0x26')](_0xf0fa('0xde'),ut[_0xf0fa('0xa1')](_0x35e7e7,'amd'));rpcDb['createCustomerHistory'](_0x35e7e7,_0xf0fa('0xdf'));if(ut['totalGlobal'](_0x35e7e7)>=_0x4c2fdd['dialGlobalMaxRetry']){_0x4d8d2f=ut[_0xf0fa('0xd1')](_0x35e7e7,0xf,_0xf0fa('0xa6'));rpcDb[_0xf0fa('0x96')](_0x4d8d2f,_0xf0fa('0xdf'));}else{rpcDb[_0xf0fa('0x96')](_0x35e7e7,_0xf0fa('0xdf'));}delete this[_0xf0fa('0x15')][_0x147f71[_0xf0fa('0xbc')]];break;default:if(_0x35e7e7['dialAnswer']){ut['decrementTalkink'](_0x4c2fdd,'[default]');ut['loggerError'](_0xf0fa('0xe0')+_0x4c2fdd[_0xf0fa('0x28')],_0x147f71);}_0x4c2fdd['outboundUnknownCallsDay']+=0x1;_0x35e7e7[_0xf0fa('0xbf')]=ut[_0xf0fa('0xa4')](_0x35e7e7);ut[_0xf0fa('0x8e')](_0x35e7e7,0xc,_0x147f71['cause-txt']||_0x147f71['dialstatus']);rpcDb[_0xf0fa('0x93')](_0x35e7e7,_0xf0fa('0xe1'));if(ut[_0xf0fa('0xa4')](_0x35e7e7)>=_0x4c2fdd[_0xf0fa('0xa5')]){_0x4d8d2f=ut[_0xf0fa('0xd1')](_0x35e7e7,0xf,_0xf0fa('0xa6'));rpcDb['createCustomerFinal'](_0x4d8d2f,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0xf0fa('0x96')](_0x35e7e7,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0xf0fa('0x15')][_0x147f71[_0xf0fa('0xbc')]];}if(!(_0x35e7e7[_0xf0fa('0x7c')]&&_0x43bad2==='16')){ut[_0xf0fa('0xe2')](_0x4c2fdd,_0xf0fa('0xe3'));logger[_0xf0fa('0x6e')](_0xf0fa('0xe4'),_0x35e7e7[_0xf0fa('0xb1')],_0xf0fa('0xb2'),_0x4c2fdd['name'],_0xf0fa('0x72'),_0x4c2fdd['originated']);}if(_0x43bad2!=='ANSWER'){delete this[_0xf0fa('0x15')][_0x147f71[_0xf0fa('0xbc')]];delete this['actions'][_0x147f71[_0xf0fa('0xe5')]];}}};Preview[_0xf0fa('0xf')]['callProgressDetectingAgent']=function(_0x10aa45,_0x9a7e50,_0x1d4106){if(_['isUndefined'](_0x9a7e50)&&_0xf0fa('0xe6')!==typeof _0x9a7e50){return;}if(_[_0xf0fa('0xe7')](_0x1d4106)&&_0xf0fa('0xe6')!==typeof _0x1d4106){return;}switch(_0x1d4106['reason']){case'0':ut[_0xf0fa('0xe8')](_0x10aa45,0x0,_0xf0fa('0x9f'));rpcDb[_0xf0fa('0xe9')](_0x10aa45,_0xf0fa('0xea'));break;case'3':ut[_0xf0fa('0xe8')](_0x10aa45,0x3,_0xf0fa('0xc5'));rpcDb[_0xf0fa('0xe9')](_0x10aa45,_0xf0fa('0xeb'));break;case'5':ut[_0xf0fa('0xe8')](_0x10aa45,0x5,_0xf0fa('0xc0'));rpcDb[_0xf0fa('0xe9')](_0x10aa45,_0xf0fa('0xec'));break;case'8':ut[_0xf0fa('0xe8')](_0x10aa45,0x8,_0xf0fa('0xca'));rpcDb[_0xf0fa('0xe9')](_0x10aa45,_0xf0fa('0xed'));break;case'22':ut[_0xf0fa('0xe8')](_0x10aa45,0x16,_0xf0fa('0xee'));rpcDb[_0xf0fa('0xe9')](_0x10aa45,_0xf0fa('0xef'));break;default:ut[_0xf0fa('0xe8')](_0x10aa45,0xc,_0x1d4106[_0xf0fa('0xf0')]);rpcDb[_0xf0fa('0xe9')](_0x10aa45,'[callProgressDetectingAgent][logCongestion]');}ut['updateOriginated'](_0x9a7e50,_0xf0fa('0xf1'));logger[_0xf0fa('0x6e')](_0xf0fa('0xf2'),_0x10aa45[_0xf0fa('0xb1')],_0xf0fa('0xb2'),_0x9a7e50[_0xf0fa('0x28')],_0xf0fa('0x72'),_0x9a7e50[_0xf0fa('0x5b')]);delete this[_0xf0fa('0x15')][_0x10aa45[_0xf0fa('0xb1')]];};Preview[_0xf0fa('0xf')][_0xf0fa('0xf3')]=function(_0x4bee69,_0x2b6960,_0x4c85b9,_0x35fd94,_0x3269eb){var _0x573371=this;return new BPromise(function(_0x19c928,_0x32ba2a){if(_[_0xf0fa('0x6d')](_0x2b6960)||_[_0xf0fa('0x6d')](_0x2b6960[_0xf0fa('0xf4')])||_[_0xf0fa('0x6d')](_0x2b6960[_0xf0fa('0xf4')]['phone'])||_['isNil'](_0x2b6960[_0xf0fa('0x76')])){_0x32ba2a(ut[_0xf0fa('0x5d')](_0xf0fa('0xf5'),_0x35fd94,_0x3269eb));return;}var _0x5b6a68=uuid['v4']();var _0x19e455=_0x573371[_0xf0fa('0x13')][_0x2b6960[_0xf0fa('0x70')][_0xf0fa('0x28')]];var _0x3c906e=_0x4c85b9?_0x573371[_0xf0fa('0x16')][_0x4c85b9]['id']:undefined;_0x573371[_0xf0fa('0x15')][_0x5b6a68]=new Action(_0x2b6960,_0x19e455,_0x5b6a68,_0x4c85b9,_0x3c906e);var _0x36c5e3=_0x573371[_0xf0fa('0x15')][_0x5b6a68];_0x36c5e3[_0xf0fa('0xac')]=_0x35fd94;_0x36c5e3['activeContact']=_0x3269eb;_0x36c5e3[_0xf0fa('0xf6')]=_0x4c85b9;if(_['isEmpty'](_0x4bee69)){_0x573371[_0xf0fa('0xf7')](_0x36c5e3,_0x19e455,_0x2b6960,_0x4c85b9)[_0xf0fa('0x84')](function(_0x958a0a){logger[_0xf0fa('0x6e')](_0xf0fa('0xf8'),_0xf0fa('0xf9')+_0x36c5e3[_0xf0fa('0x71')]+_0xf0fa('0xfa')+_0x36c5e3['idContact'],JSON['stringify'](_0x958a0a));ami[_0xf0fa('0x26')](_0xf0fa('0xfb'),ut[_0xf0fa('0xa1')](_0x36c5e3,_0xf0fa('0xfc'),_0x573371[_0xf0fa('0x13')][_0x36c5e3[_0xf0fa('0x71')]]));_0x19c928(ut[_0xf0fa('0x5d')]('Calling'));})[_0xf0fa('0x7a')](function(_0x3cafd3){ut[_0xf0fa('0x5f')](_0xf0fa('0xfd'),_0x3cafd3);_0x32ba2a(ut[_0xf0fa('0x5d')](_0xf0fa('0xfe'),_0x35fd94,_0x3269eb));});}else{_0x19e455[_0xf0fa('0x3b')]+=0x1;ut['logBlacklist'](_0x36c5e3);rpcDb[_0xf0fa('0xff')](_0x36c5e3,_0xf0fa('0x100'));delete _0x573371[_0xf0fa('0x15')][_0x5b6a68];_0x32ba2a(ut[_0xf0fa('0x5d')](_0xf0fa('0x101'),_0x35fd94,_0x3269eb));}});};Preview['prototype'][_0xf0fa('0x102')]=function(_0x5b40d9){return!_[_0xf0fa('0x6d')](_0x5b40d9)&&!_[_0xf0fa('0x6d')](_0x5b40d9[_0xf0fa('0x28')])&&!_['isNil'](_0x5b40d9['active'])&&_0x5b40d9[_0xf0fa('0x52')]&&!_[_0xf0fa('0x6d')](this[_0xf0fa('0x14')][util[_0xf0fa('0x55')]('SIP/%s',_0x5b40d9[_0xf0fa('0x28')])])&&!_[_0xf0fa('0x6d')](this[_0xf0fa('0x14')][util[_0xf0fa('0x55')](_0xf0fa('0x103'),_0x5b40d9[_0xf0fa('0x28')])]['status'])&&(this[_0xf0fa('0x14')][util['format']('SIP/%s',_0x5b40d9[_0xf0fa('0x28')])][_0xf0fa('0x78')]==='reachable'||this[_0xf0fa('0x14')][util['format'](_0xf0fa('0x103'),_0x5b40d9['name'])]['status']===_0xf0fa('0x104'));};Preview[_0xf0fa('0xf')][_0xf0fa('0x105')]=function(_0x142b1e,_0xdc3ef9){var _0x187523=this;return new BPromise(function(_0x53b346,_0x9ebd51){_0x187523[_0xf0fa('0x106')](_0x142b1e,_0xdc3ef9)[_0xf0fa('0x84')](function(_0x38811c){_0x53b346(_[_0xf0fa('0x107')](_0x38811c,[_0xf0fa('0x5d')]));})[_0xf0fa('0x7a')](function(_0x41fdf9){if(_0x41fdf9['unlock']){rpcDb[_0xf0fa('0x108')](_0x142b1e);}if(_0x41fdf9[_0xf0fa('0x52')]){rpcDb[_0xf0fa('0x8c')](_0x142b1e);}_0x9ebd51(_[_0xf0fa('0x107')](_0x41fdf9,[_0xf0fa('0x5d')]));});});};Preview[_0xf0fa('0xf')][_0xf0fa('0x106')]=function(_0x616338,_0x114487){var _0xe0bb72=this;return new BPromise(function(_0x27c397,_0x49448a){var _0x29b1e9,_0x5c8e7b;rpcDb[_0xf0fa('0x109')](_0x616338)[_0xf0fa('0x84')](function(_0xb688a1){if(!_[_0xf0fa('0x6d')](_0xb688a1[0x0])){_0x5c8e7b=_0xb688a1[0x0][_0xf0fa('0x10a')]?![]:!![];_0x29b1e9=_0xb688a1[0x0][_0xf0fa('0x10a')]?!![]:![];_0x29b1e9=_0x114487?!![]:_0x29b1e9;}var _0x571a62=_0xe0bb72[_0xf0fa('0x10b')](_0xb688a1);if(_0x571a62[_0xf0fa('0x10c')]){rpcDb[_0xf0fa('0x10d')](_['pick'](_0xb688a1[0x0],[_0xf0fa('0x76'),_0xf0fa('0x10e')]))[_0xf0fa('0x84')](function(_0x4cf660){_0xe0bb72[_0xf0fa('0xf3')](_0x4cf660,_0xb688a1[0x0],_0x114487,_0x5c8e7b,_0x29b1e9)[_0xf0fa('0x84')](function(_0x42caa1){_0x27c397(_0x42caa1);})['catch'](function(_0x212b4a){_0x49448a(_0x212b4a);});})[_0xf0fa('0x7a')](function(_0x44edb5){ut[_0xf0fa('0x5f')](_0xf0fa('0x10f'),_0x44edb5);_0x49448a(ut[_0xf0fa('0x5d')](_0xf0fa('0x110'),_0x5c8e7b,_0x29b1e9));});}else{_0x49448a(ut['message'](_0x571a62['message'],_0x5c8e7b,_0x29b1e9));}})[_0xf0fa('0x7a')](function(_0x5d32f9){ut[_0xf0fa('0x5f')]('[Preview][getContactPreview]',_0x5d32f9);_0x49448a(ut[_0xf0fa('0x5d')]('Call\x20unsuccessful',![],!![]));});});};Preview[_0xf0fa('0xf')][_0xf0fa('0x10b')]=function(_0x5b9e3f){if(_[_0xf0fa('0x6d')](_0x5b9e3f)||_['isEmpty'](_0x5b9e3f)||!_[_0xf0fa('0x6d')](_0x5b9e3f[0x0][_0xf0fa('0x88')])&&_[_0xf0fa('0x6d')](_0x5b9e3f[0x0]['Agent']['name'])){ut['logger']('[Preview][validateContact][Empty\x20Contact]',_0x5b9e3f);return{'isValid':![],'message':_0xf0fa('0x111')};}var _0x4b6acc=this['campaignsPreview'][_0x5b9e3f[0x0][_0xf0fa('0x70')][_0xf0fa('0x28')]];_0x4b6acc[_0xf0fa('0x5d')]=_0xf0fa('0x9c');if(_[_0xf0fa('0x6d')](_0x4b6acc)){ut[_0xf0fa('0x5f')]('[Preview][validateContact][Empty\x20Campaign]',_0x4b6acc);return{'isValid':![],'message':_0xf0fa('0x112')};}if(!this[_0xf0fa('0x102')](_0x4b6acc[_0xf0fa('0x51')])){ut[_0xf0fa('0x5f')](_0xf0fa('0x113'),_0xf0fa('0x114')+_0x4b6acc['name']+_0xf0fa('0x115'));if(!this['isTrunkReachable'](_0x4b6acc[_0xf0fa('0x9a')])){ut[_0xf0fa('0x5f')](_0xf0fa('0x113'),_0x4b6acc[_0xf0fa('0x28')]+_0xf0fa('0x116'));return{'isValid':![],'message':_0xf0fa('0x117')};}}if(!ut[_0xf0fa('0x99')](_0x4b6acc['dialActive'])){ut[_0xf0fa('0x5f')](_0xf0fa('0x118'),_0x4b6acc[_0xf0fa('0x28')]+_0xf0fa('0x119'));return{'isValid':![],'message':_0xf0fa('0x114')+_0x4b6acc[_0xf0fa('0x28')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0xf0fa('0x11a')};};Preview[_0xf0fa('0xf')][_0xf0fa('0xf7')]=function(_0xb9addb,_0x1493d2,_0x223211,_0x3f4f31){var _0x1864a7=this;return new BPromise(function(_0x18d83c,_0x247dba){var _0x1e1a94=_0xb9addb[_0xf0fa('0xb1')];var _0x1b5b8f=_0x1864a7[_0xf0fa('0x102')](_0x1493d2[_0xf0fa('0x51')])?util[_0xf0fa('0x55')]('SIP/%s/%s%s',_0x1493d2[_0xf0fa('0x51')]['name'],_[_0xf0fa('0x6d')](_0x1493d2[_0xf0fa('0x38')])?'':_0x1493d2[_0xf0fa('0x38')][_0xf0fa('0x11b')]()||'',_0x1493d2[_0xf0fa('0x11c')]>0x0?_0x223211[_0xf0fa('0xf4')][_0xf0fa('0x11d')][_0xf0fa('0x11e')](_0x1493d2[_0xf0fa('0x11c')]):_0x223211['Contact'][_0xf0fa('0x11d')]):util[_0xf0fa('0x55')](_0xf0fa('0x11f'),_[_0xf0fa('0x6d')](_0x1493d2[_0xf0fa('0x9a')])?_0x1493d2[_0xf0fa('0x51')]['name']:_0x1493d2[_0xf0fa('0x9a')][_0xf0fa('0x28')],_[_0xf0fa('0x6d')](_0x1493d2[_0xf0fa('0x38')])?'':_0x1493d2['dialPrefix'][_0xf0fa('0x11b')]()||'',_0x1493d2[_0xf0fa('0x11c')]>0x0?_0x223211[_0xf0fa('0xf4')]['phone'][_0xf0fa('0x11e')](_0x1493d2[_0xf0fa('0x11c')]):_0x223211[_0xf0fa('0xf4')][_0xf0fa('0x11d')]);var _0x33a57e=_0x1864a7['isTrunkReachable'](_0x1493d2[_0xf0fa('0x51')])?ut[_0xf0fa('0x120')](_0x1493d2[_0xf0fa('0x51')][_0xf0fa('0x121')],_0x1493d2[_0xf0fa('0x37')],_0x1493d2['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xf0fa('0x122')](_0x1493d2[_0xf0fa('0x123')],_0x1493d2[_0xf0fa('0x124')]):_0x1493d2[_0xf0fa('0x123')]):ut[_0xf0fa('0x120')](_[_0xf0fa('0x6d')](_0x1493d2['TrunkBackup'])?_0x1493d2[_0xf0fa('0x51')]['callerid']:_0x1493d2[_0xf0fa('0x9a')][_0xf0fa('0x121')],_0x1493d2[_0xf0fa('0x37')],_0x1493d2[_0xf0fa('0x124')]>0x0?ut[_0xf0fa('0x122')](_0x1493d2[_0xf0fa('0x123')],_0x1493d2[_0xf0fa('0x124')]):_0x1493d2['dialOriginateCallerIdNumber']);if(_0x33a57e){_0xb9addb[_0xf0fa('0x125')]=ut[_0xf0fa('0x126')](_0x33a57e);_0xb9addb[_0xf0fa('0x127')]=ut['extractCalleridNumber'](_0x33a57e);}var _0x1b3439=ut['addVariables'](_0x1493d2,_0x223211,_0x1b5b8f,_0x33a57e,_0x1e1a94,_0xb9addb);_['merge'](_0xb9addb,ut['toLowerVariables'](_0x1b3439));_0xb9addb[_0xf0fa('0x8d')]=moment()['format'](_0xf0fa('0x128'));ami[_0xf0fa('0x129')](ut['variablesAction'](_0xb9addb,_0x1493d2,_0x1b3439,_0xb9addb['activeContact'],_0x3f4f31))[_0xf0fa('0x84')](function(_0x3a8b55){_0x1493d2['originated']+=0x1;logger[_0xf0fa('0x6e')]('[originated][increment]',_0x1e1a94,'\x20Queue',_0x1493d2[_0xf0fa('0x28')],_0xf0fa('0x72'),_0x1493d2[_0xf0fa('0x5b')]);_0x18d83c(_0x3a8b55);})[_0xf0fa('0x7a')](function(_0x5ef78f){ut['logAgent'](_0xb9addb,0xe,_0xf0fa('0x12a'));rpcDb[_0xf0fa('0xe9')](_0xb9addb,_0xf0fa('0x12b'));_0x247dba(_0x5ef78f);});});};Preview[_0xf0fa('0xf')][_0xf0fa('0x20')]=function(_0x4fcae8){if(this[_0xf0fa('0x15')][_0x4fcae8[_0xf0fa('0xbc')]]){this[_0xf0fa('0x15')][_0x4fcae8[_0xf0fa('0xbc')]][_0xf0fa('0x79')]=_0x4fcae8[_0xf0fa('0x79')];}};Preview[_0xf0fa('0xf')][_0xf0fa('0x17')]=function(_0x516696){var _0x34c7eb=this;var _0x57f64f=this['actions'][_0x516696[_0xf0fa('0x12c')]];if(_0x57f64f){if(_0x57f64f[_0xf0fa('0xf6')]&&this[_0xf0fa('0x16')][_0x57f64f[_0xf0fa('0xf6')]]){ut[_0xf0fa('0x12d')](_0x57f64f,this[_0xf0fa('0x16')][_0x57f64f['lookAgent']][_0xf0fa('0x28')],this[_0xf0fa('0x16')][_0x57f64f[_0xf0fa('0xf6')]]['id']);}var _0x1514a4=_[_0xf0fa('0x12e')](_0x57f64f);_0x1514a4['responsetime']=moment()[_0xf0fa('0x55')]('YYYY-MM-DD\x20HH:mm:ss');var _0x40e1cf=_0x34c7eb['campaignsPreview'][_0x57f64f[_0xf0fa('0x71')]];if(ut[_0xf0fa('0x12f')](_0x516696['response'])){if(_0x57f64f[_0xf0fa('0xac')]){rpcDb[_0xf0fa('0x108')](_0x57f64f[_0xf0fa('0x130')]);}if(_0x57f64f[_0xf0fa('0xad')]){rpcDb[_0xf0fa('0x8c')](_0x57f64f['idContact']);}ami[_0xf0fa('0x26')](_0xf0fa('0x131'),ut['buildObj'](_0x57f64f,_0xf0fa('0x132'),this[_0xf0fa('0x13')][_0x57f64f[_0xf0fa('0x71')]]));this['callProgressDetectingAgent'](_0x1514a4,_0x40e1cf,_0x516696);}else{_0x57f64f[_0xf0fa('0x8d')]=moment()[_0xf0fa('0x55')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0xf0fa('0xe8')](_0x1514a4,0x4,'Answer');rpcDb[_0xf0fa('0xe9')](_0x1514a4,_0xf0fa('0x133'));}}};Preview[_0xf0fa('0xf')][_0xf0fa('0x19')]=function(_0x18212c){var _0x4e070b=this;var _0x3a088e=this[_0xf0fa('0x15')][_0x18212c['linkedid']];var _0x4df407;if(_0x3a088e){_0x4df407=this[_0xf0fa('0x13')][_0x3a088e[_0xf0fa('0x71')]];logger['info'](_0xf0fa('0x134'),_0x18212c['linkedid'],'\x20Queue',_0x4df407[_0xf0fa('0x28')],_0xf0fa('0x73'),_0x4df407[_0xf0fa('0x2d')]);}if(this['actions'][_0x18212c[_0xf0fa('0xbc')]]&&_0x18212c[_0xf0fa('0xbc')]!==_0x18212c[_0xf0fa('0xb1')]){if(_0x18212c[_0xf0fa('0x135')]==='16'&&this[_0xf0fa('0x15')][_0x18212c['linkedid']]['dialAnswer']){this[_0xf0fa('0x9d')](_0x18212c,_0x18212c['linkedid'],_0x18212c[_0xf0fa('0x135')]);}else if(this[_0xf0fa('0x15')][_0x18212c[_0xf0fa('0xbc')]][_0xf0fa('0x7c')]){logger['info'](_0xf0fa('0x136'),_0x18212c['linkedid'],_0x18212c[_0xf0fa('0x135')],'\x20Queue',_0x4df407['name'],_0xf0fa('0x73'),_0x4df407[_0xf0fa('0x2d')]);this[_0xf0fa('0x9d')](_0x18212c,_0x18212c[_0xf0fa('0xbc')],_0x18212c[_0xf0fa('0x135')]);}}else if(_0x3a088e&&_['isNil'](_0x3a088e[_0xf0fa('0x137')])&&_0x4df407[_0xf0fa('0x138')]&&_0x18212c[_0xf0fa('0xbc')]===_0x18212c[_0xf0fa('0xb1')]&&_[_0xf0fa('0x6d')](_0x18212c[_0xf0fa('0xf0')])&&_0x18212c['cause']==='16'&&_0x18212c[_0xf0fa('0x139')]==='6'&&_[_0xf0fa('0xe7')](_0x3a088e[_0xf0fa('0x13a')])){if(_0x3a088e['unlockAgent']){rpcDb['unlockContact'](_0x3a088e['idContact']);}if(_0x3a088e[_0xf0fa('0xad')]){rpcDb[_0xf0fa('0x8c')](_0x3a088e[_0xf0fa('0x130')]);}_0x18212c[_0xf0fa('0xf0')]='22';this[_0xf0fa('0x13b')](_0x3a088e,_0x4df407,_0x18212c);}else if(_0x3a088e&&_0x3a088e['transfer']){if(_0x18212c['cause']==='16'&&this[_0xf0fa('0x15')][_0x18212c[_0xf0fa('0xbc')]]['dialAnswer']){logger[_0xf0fa('0x6e')](_0xf0fa('0x13c'),_0x18212c[_0xf0fa('0xbc')],_0x18212c[_0xf0fa('0x135')],_0xf0fa('0xb2'),_0x4df407[_0xf0fa('0x28')],_0xf0fa('0x73'),_0x4df407[_0xf0fa('0x2d')]);this[_0xf0fa('0x9d')](_0x18212c,_0x18212c[_0xf0fa('0xbc')],_0x18212c[_0xf0fa('0x135')]);}else if(this['actions'][_0x18212c[_0xf0fa('0xbc')]][_0xf0fa('0x7c')]){logger[_0xf0fa('0x6e')](_0xf0fa('0x136'),_0x18212c[_0xf0fa('0xbc')],_0x18212c[_0xf0fa('0x135')],'\x20Queue',_0x4df407[_0xf0fa('0x28')],'pTalking:\x20',_0x4df407['pTalking']);this['callProgressDetectingCustomer'](_0x18212c,_0x18212c['linkedid'],_0x18212c[_0xf0fa('0x135')]);}}};Preview[_0xf0fa('0xf')]['syncDialEnd']=function(_0x14e3ed){if(this[_0xf0fa('0x15')][_0x14e3ed['destlinkedid']]&&_0x14e3ed[_0xf0fa('0xe5')]!==_0x14e3ed['destuniqueid']){this[_0xf0fa('0x9d')](_0x14e3ed,_0x14e3ed[_0xf0fa('0xe5')],_0x14e3ed[_0xf0fa('0xda')]);}};Preview[_0xf0fa('0xf')]['syncHangupRequest']=function(_0x543bbb){if(this[_0xf0fa('0x15')][_0x543bbb[_0xf0fa('0xbc')]]&&_0x543bbb[_0xf0fa('0xbc')]!==_0x543bbb[_0xf0fa('0xb1')]&&!this['actions'][_0x543bbb[_0xf0fa('0xbc')]]['dialAnswer']){if(_0x543bbb[_0xf0fa('0x135')]==='1'){this[_0xf0fa('0x9d')](_0x543bbb,_0x543bbb[_0xf0fa('0xbc')],_0x543bbb['cause']);}}};Preview[_0xf0fa('0xf')][_0xf0fa('0x13d')]=function(_0x591ffb,_0x160c0a,_0x4cdf8b){if(this[_0xf0fa('0x15')][_0x591ffb]){if(_[_0xf0fa('0x6d')](this[_0xf0fa('0x15')][_0x591ffb]['variables'])){this[_0xf0fa('0x15')][_0x591ffb][_0xf0fa('0x13e')]={};}this[_0xf0fa('0x15')][_0x591ffb][_0xf0fa('0x13e')][_0x160c0a]=_0x4cdf8b;}};Preview[_0xf0fa('0xf')][_0xf0fa('0x22')]=function(_0x29dea5){try{if(!_[_0xf0fa('0x6d')](_0x29dea5)){if(ut[_0xf0fa('0x13f')](_['keys'](_0x29dea5[_0xf0fa('0x140')])[0x0])){this[_0xf0fa('0x13d')](_0x29dea5['uniqueid'],_[_0xf0fa('0x141')](_0x29dea5[_0xf0fa('0x140')])[0x0],_0x29dea5[_0xf0fa('0x142')]);}}}catch(_0x2dddd1){logger[_0xf0fa('0x143')]('[syncVarSet][Preview]',util[_0xf0fa('0x144')](_0x2dddd1,{'showHidden':![],'depth':null}));}};Preview['prototype']['syncAttendedTransfer']=function(_0x1fc0b1){if(_0x1fc0b1){if(this[_0xf0fa('0x15')][_0x1fc0b1['transfertargetlinkedid']]){this[_0xf0fa('0x15')][_0x1fc0b1['transfertargetlinkedid']][_0xf0fa('0x13a')]=!![];}}};Preview[_0xf0fa('0xf')][_0xf0fa('0x24')]=function(_0x264d29){if(_0x264d29){if(this[_0xf0fa('0x15')][_0x264d29['transfererlinkedid']]){this[_0xf0fa('0x15')][_0x264d29['transfererlinkedid']][_0xf0fa('0x13a')]=!![];}}};module[_0xf0fa('0x145')]=Preview;
\ No newline at end of file
index d8c47db..92ec9d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x293f=['[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','COMPLETED','[GetContactRecallMe]\x20'];(function(_0x3179c2,_0x7b8603){var _0x4395c3=function(_0x452291){while(--_0x452291){_0x3179c2['push'](_0x3179c2['shift']());}};_0x4395c3(++_0x7b8603);}(_0x293f,0x71));var _0xf293=function(_0x2a6600,_0x38f9b){_0x2a6600=_0x2a6600-0x0;var _0x133751=_0x293f[_0x2a6600];return _0x133751;};'use strict';var util=require(_0xf293('0x0'));var BPromise=require(_0xf293('0x1'));var logger=require(_0xf293('0x2'))('preview');var _=require(_0xf293('0x3'));var cmHopper=require(_0xf293('0x4'));var cmHopperFinal=require(_0xf293('0x5'));var cmHopperHistory=require(_0xf293('0x6'));var cmHopperBlack=require(_0xf293('0x7'));var voiceQueueRt=require(_0xf293('0x8'));var agentReportPreview=require(_0xf293('0x9'));var voiceQueueReport=require(_0xf293('0xa'));function loggerCatch(_0x21a521){return function(_0x372cb4){logger[_0xf293('0xb')](_0x21a521,util[_0xf293('0xc')](_0x372cb4,{'showHidden':![],'depth':null}));};}function create(_0x12e66b){return BPromise[_0xf293('0xd')]()[_0xf293('0xe')](cmHopperHistory[_0xf293('0xf')](_0x12e66b))[_0xf293('0x10')](loggerCatch(_0xf293('0x11')));}function createAgent(_0x4281df){return BPromise[_0xf293('0xd')]()[_0xf293('0xe')](agentReportPreview[_0xf293('0xf')](_0x4281df))[_0xf293('0x10')](loggerCatch(_0xf293('0x11')));}function moveContact(_0x1ca49c){return BPromise['resolve']()['then'](cmHopper[_0xf293('0x12')](_0x1ca49c,!![]))['catch'](loggerCatch(_0xf293('0x13')));}exports[_0xf293('0x14')]=function(_0x5e07b9){return BPromise['resolve']()[_0xf293('0xe')](cmHopperBlack[_0xf293('0x14')](_0x5e07b9))[_0xf293('0x10')](loggerCatch(_0xf293('0x15')));};exports[_0xf293('0x16')]=function(_0xbdc3e){return BPromise[_0xf293('0xd')]()[_0xf293('0xe')](cmHopper[_0xf293('0x16')](_0xbdc3e))[_0xf293('0x10')](loggerCatch(_0xf293('0x17')));};exports[_0xf293('0xf')]=function(_0x575a8a,_0x25d2bd){create(_0x575a8a)[_0xf293('0x10')](loggerCatch(_0x25d2bd));moveContact(_0x575a8a)['catch'](loggerCatch(_0x25d2bd));};exports[_0xf293('0x18')]=function(_0x1dcba8,_0x24b9fe){createAgent(_0x1dcba8)['catch'](loggerCatch(_0x24b9fe));};exports[_0xf293('0x19')]=function(_0x27a656,_0x837580){create(_0x27a656)[_0xf293('0x10')](loggerCatch(_0x837580));};exports[_0xf293('0x1a')]=function(_0x3afb0d,_0x2e2f02){moveContact(_0x3afb0d)['catch'](loggerCatch(_0x2e2f02));};exports[_0xf293('0x1b')]=function(_0x306305,_0x4c9b9d,_0x1be1ae){if(_0x4c9b9d){_0x306305[_0xf293('0x1c')]=null;}if(_0x1be1ae){_0x306305[_0xf293('0x1d')]=![];}return BPromise[_0xf293('0xd')]()[_0xf293('0xe')](cmHopper[_0xf293('0x1b')](_0x306305))[_0xf293('0x10')](loggerCatch(_0xf293('0x1e')));};exports[_0xf293('0x1f')]=function(_0x4e5717){return BPromise[_0xf293('0xd')]()['then'](cmHopper[_0xf293('0x1f')](_0x4e5717))['catch'](loggerCatch('[countReScheduled]\x20'));};exports['unlockContact']=function(_0x22cbda){return BPromise['resolve']()[_0xf293('0xe')](cmHopper[_0xf293('0x20')]({'UserId':null},_0x22cbda,0x1))[_0xf293('0x10')](loggerCatch(_0xf293('0x21')));};exports['disableContact']=function(_0x2f2e60){return BPromise[_0xf293('0xd')]()['then'](cmHopper[_0xf293('0x20')]({'active':![]},_0x2f2e60,0x1))['catch'](loggerCatch(_0xf293('0x22')));};exports[_0xf293('0x23')]=function(_0x1afaeb){var _0x18c4b9={};_0x18c4b9[_0xf293('0x24')]=_0x1afaeb[_0xf293('0x24')];_0x18c4b9[_0xf293('0x25')]=_0x1afaeb['uniqueid'];_0x18c4b9[_0xf293('0x26')]=_0x1afaeb[_0xf293('0x26')];_0x18c4b9[_0xf293('0x27')]=_0x1afaeb['calleridname'];_0x18c4b9[_0xf293('0x28')]=_0x1afaeb[_0xf293('0x28')];_0x18c4b9[_0xf293('0x29')]=_0x1afaeb[_0xf293('0x2a')];_0x18c4b9['queuecallerleaveAt']=_0x1afaeb['answertime'];_0x18c4b9[_0xf293('0x2b')]=0x1;_0x18c4b9[_0xf293('0x2c')]=_0x1afaeb['endtime'];_0x18c4b9[_0xf293('0x2d')]=_0x1afaeb[_0xf293('0x2e')];_0x18c4b9[_0xf293('0x2f')]=_0xf293('0x30');_0x18c4b9[_0xf293('0x31')]=_0xf293('0x32');_0x18c4b9[_0xf293('0x33')]=0x0;_0x18c4b9[_0xf293('0x34')]=0x1;_0x18c4b9['lastAssignedTo']=_0x1afaeb[_0xf293('0x2e')];_0x18c4b9['queuecallerexitreason']=_0xf293('0x35');return BPromise['resolve']()[_0xf293('0xe')](voiceQueueReport['create'](_0x18c4b9))['catch'](loggerCatch('[voiceQueueReport]\x20'));};exports['getContactRecallMe']=function(_0x5851eb,_0x2041d9){return BPromise[_0xf293('0xd')]()[_0xf293('0xe')](cmHopper['getContactRecallMe'](_0x5851eb,_0x2041d9))[_0xf293('0x10')](loggerCatch(_0xf293('0x36')));};exports['rescheduleContactInQueue']=function(_0x227921){return BPromise[_0xf293('0xd')]()[_0xf293('0xe')](cmHopper[_0xf293('0x1b')](_0x227921,!![],!![]))[_0xf293('0x10')](loggerCatch(_0xf293('0x37')));};
\ No newline at end of file
+var _0x78bf=['../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','[createHistory]\x20','createHistory','catch','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallercomplete','queuecallercompleteAt','membername','from-sip','exten','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory'];(function(_0x4218d3,_0x4b5e20){var _0x2ae0a0=function(_0xf21970){while(--_0xf21970){_0x4218d3['push'](_0x4218d3['shift']());}};_0x2ae0a0(++_0x4b5e20);}(_0x78bf,0x94));var _0xf78b=function(_0x2ea41,_0x4f807b){_0x2ea41=_0x2ea41-0x0;var _0x8ee23b=_0x78bf[_0x2ea41];return _0x8ee23b;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require('../../../config/logger')(_0xf78b('0x0'));var _=require(_0xf78b('0x1'));var cmHopper=require(_0xf78b('0x2'));var cmHopperFinal=require(_0xf78b('0x3'));var cmHopperHistory=require(_0xf78b('0x4'));var cmHopperBlack=require(_0xf78b('0x5'));var voiceQueueRt=require(_0xf78b('0x6'));var agentReportPreview=require(_0xf78b('0x7'));var voiceQueueReport=require(_0xf78b('0x8'));function loggerCatch(_0x47e6e2){return function(_0x5b3fd4){logger[_0xf78b('0x9')](_0x47e6e2,util[_0xf78b('0xa')](_0x5b3fd4,{'showHidden':![],'depth':null}));};}function create(_0x51d5e8){return BPromise[_0xf78b('0xb')]()[_0xf78b('0xc')](cmHopperHistory['createHistory'](_0x51d5e8))['catch'](loggerCatch(_0xf78b('0xd')));}function createAgent(_0x548179){return BPromise[_0xf78b('0xb')]()['then'](agentReportPreview[_0xf78b('0xe')](_0x548179))['catch'](loggerCatch(_0xf78b('0xd')));}function moveContact(_0x27c441){return BPromise['resolve']()[_0xf78b('0xc')](cmHopper['moveContactManagedDialer'](_0x27c441,!![]))[_0xf78b('0xf')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0xf78b('0x10')]=function(_0x448c72){return BPromise[_0xf78b('0xb')]()[_0xf78b('0xc')](cmHopperBlack[_0xf78b('0x10')](_0x448c72))[_0xf78b('0xf')](loggerCatch(_0xf78b('0x11')));};exports[_0xf78b('0x12')]=function(_0x2469a7){return BPromise['resolve']()[_0xf78b('0xc')](cmHopper['getContactPreview'](_0x2469a7))[_0xf78b('0xf')](loggerCatch(_0xf78b('0x13')));};exports[_0xf78b('0xe')]=function(_0x30b097,_0x4af4fa){create(_0x30b097)[_0xf78b('0xf')](loggerCatch(_0x4af4fa));moveContact(_0x30b097)[_0xf78b('0xf')](loggerCatch(_0x4af4fa));};exports[_0xf78b('0x14')]=function(_0x895f9a,_0xd05025){createAgent(_0x895f9a)[_0xf78b('0xf')](loggerCatch(_0xd05025));};exports[_0xf78b('0x15')]=function(_0x3b5303,_0x17a192){create(_0x3b5303)['catch'](loggerCatch(_0x17a192));};exports[_0xf78b('0x16')]=function(_0x3d3ff1,_0x3160b5){moveContact(_0x3d3ff1)[_0xf78b('0xf')](loggerCatch(_0x3160b5));};exports[_0xf78b('0x17')]=function(_0x1d3ec3,_0x1addcb,_0x476afa){if(_0x1addcb){_0x1d3ec3[_0xf78b('0x18')]=null;}if(_0x476afa){_0x1d3ec3['active']=![];}return BPromise[_0xf78b('0xb')]()[_0xf78b('0xc')](cmHopper[_0xf78b('0x17')](_0x1d3ec3))[_0xf78b('0xf')](loggerCatch(_0xf78b('0x19')));};exports['countReScheduled']=function(_0x286bf5){return BPromise['resolve']()[_0xf78b('0xc')](cmHopper[_0xf78b('0x1a')](_0x286bf5))[_0xf78b('0xf')](loggerCatch(_0xf78b('0x1b')));};exports[_0xf78b('0x1c')]=function(_0x591454){return BPromise[_0xf78b('0xb')]()[_0xf78b('0xc')](cmHopper[_0xf78b('0x1c')]({'UserId':null},_0x591454,0x1))[_0xf78b('0xf')](loggerCatch('[unlockContact]\x20'));};exports[_0xf78b('0x1d')]=function(_0x20947d){return BPromise[_0xf78b('0xb')]()[_0xf78b('0xc')](cmHopper[_0xf78b('0x1c')]({'active':![]},_0x20947d,0x1))['catch'](loggerCatch(_0xf78b('0x1e')));};exports['crateCustomerReportQueue']=function(_0x78f556){var _0x30e1e9={};_0x30e1e9[_0xf78b('0x1f')]=_0x78f556['type'];_0x30e1e9['uniqueid']=_0x78f556[_0xf78b('0x20')];_0x30e1e9[_0xf78b('0x21')]=_0x78f556['calleridnum'];_0x30e1e9['calleridname']=_0x78f556[_0xf78b('0x22')];_0x30e1e9['queue']=_0x78f556[_0xf78b('0x23')];_0x30e1e9[_0xf78b('0x24')]=_0x78f556['answertime'];_0x30e1e9['queuecallerleaveAt']=_0x78f556['answertime'];_0x30e1e9[_0xf78b('0x25')]=0x1;_0x30e1e9[_0xf78b('0x26')]=_0x78f556['endtime'];_0x30e1e9['connectedlinename']=_0x78f556[_0xf78b('0x27')];_0x30e1e9['context']=_0xf78b('0x28');_0x30e1e9[_0xf78b('0x29')]='xcally-motion-preview';_0x30e1e9[_0xf78b('0x2a')]=0x0;_0x30e1e9[_0xf78b('0x2b')]=0x1;_0x30e1e9[_0xf78b('0x2c')]=_0x78f556[_0xf78b('0x27')];_0x30e1e9[_0xf78b('0x2d')]=_0xf78b('0x2e');return BPromise[_0xf78b('0xb')]()[_0xf78b('0xc')](voiceQueueReport[_0xf78b('0x2f')](_0x30e1e9))[_0xf78b('0xf')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0xf78b('0x30')]=function(_0xef0568,_0xf9d5fe){return BPromise[_0xf78b('0xb')]()[_0xf78b('0xc')](cmHopper[_0xf78b('0x30')](_0xef0568,_0xf9d5fe))[_0xf78b('0xf')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0xf78b('0x31')]=function(_0x29b33b){return BPromise[_0xf78b('0xb')]()[_0xf78b('0xc')](cmHopper[_0xf78b('0x17')](_0x29b33b,!![],!![]))[_0xf78b('0xf')](loggerCatch(_0xf78b('0x32')));};
\ No newline at end of file
index 17d95ce..aeb815b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbec5=['pow','replace','random','extractCalleridName','extractCalleridNumber','match','util','lodash','moment','../../../../config/logger','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','info','loggerError','logger2','message','isUndefined','isEmpty','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','addVariables','Queue','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','isNil','tags','createdAt','updatedAt','%s%s','hasOwnProperty','toLower','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','statedesc','Blacklist','starttime','responsetime','state','ringtime','logLookAgent','endtime','talktime','answertime','Failure','variablesAction','RECALL','BOOKED','uniqueid','from-sip','timeout','totalGlobal','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','clone','Global','active','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','name','queue','interface','motionChannel','voice','mandatoryDisposition','buildAcw','agentReadyId','status','reachable','push','getDiff','createBody','filterKey','idContact','type','campaigntype','dialAnswer','channelAgent','calleridname','countbusyretry','countglobal','callback','callbackuniqueid','callbackat','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepvtcallid'];(function(_0x121f44,_0x2d0d28){var _0x513d54=function(_0x32567a){while(--_0x32567a){_0x121f44['push'](_0x121f44['shift']());}};_0x513d54(++_0x2d0d28);}(_0xbec5,0x1b0));var _0x5bec=function(_0x72895a,_0x433607){_0x72895a=_0x72895a-0x0;var _0x5226d5=_0xbec5[_0x72895a];return _0x5226d5;};'use strict';var util=require(_0x5bec('0x0'));var _=require(_0x5bec('0x1'));var moment=require(_0x5bec('0x2'));var logger=require(_0x5bec('0x3'))('preview');var ipAgi=process[_0x5bec('0x4')][_0x5bec('0x5')]||_0x5bec('0x6');function getSeconds(_0x3a5d08,_0x3f96a7){var _0x48243f=moment(_0x3a5d08)[_0x5bec('0x7')](0x0);var _0x1d3a71=moment(_0x3f96a7)['milliseconds'](0x0);return _0x48243f[_0x5bec('0x8')](_0x1d3a71,_0x5bec('0x9'));}exports[_0x5bec('0xa')]=function(_0x1a9fb1){return function(_0x2b3617){logger[_0x5bec('0xb')](_0x1a9fb1,util[_0x5bec('0xc')](_0x2b3617,{'showHidden':![],'depth':null}));};};exports[_0x5bec('0xd')]=function(_0x287c13,_0x24abc5){logger[_0x5bec('0xe')](_0x287c13,util[_0x5bec('0xc')](_0x24abc5,{'showHidden':![],'depth':null}));};exports[_0x5bec('0xf')]=function(_0x358d80,_0x121f4f){logger['error'](_0x358d80,util[_0x5bec('0xc')](_0x121f4f,{'showHidden':![],'depth':null}));};exports[_0x5bec('0x10')]=function(_0x2819ec){return function(_0x3466fa){logger[_0x5bec('0xe')](_0x2819ec,util[_0x5bec('0xc')](_0x3466fa,{'showHidden':![],'depth':null}));};};exports[_0x5bec('0x11')]=function(_0x199ddb,_0x5f3894,_0x24ea54){return{'message':_0x199ddb,'unlock':_0x5f3894,'active':_0x24ea54};};exports['getCallerId']=function(_0x24a692,_0x2a5986,_0x49919e){if(!_[_0x5bec('0x12')](_0x49919e)&&'string'===typeof _0x49919e&&!_[_0x5bec('0x13')](_0x49919e)){if(!_[_0x5bec('0x12')](_0x2a5986)&&_0x5bec('0x14')===typeof _0x2a5986&&!_[_0x5bec('0x13')](_0x2a5986)){return util['format']('\x22%s\x22\x20<%s>',_0x2a5986,_0x49919e);}return util[_0x5bec('0x15')](_0x5bec('0x16'),_0x49919e,_0x49919e);}if(!_[_0x5bec('0x12')](_0x24a692)&&_0x5bec('0x14')===typeof _0x24a692&&!_[_0x5bec('0x13')](_0x24a692)){return _0x24a692;}return _0x5bec('0x17');};exports[_0x5bec('0x18')]=function(_0x2ce069){if(_['isNil'](_0x2ce069)){return![];}return _0x2ce069;};exports[_0x5bec('0x19')]=function(_0x487844,_0x4f67f8,_0x48908c,_0x2b054f,_0x2550fa,_0x5b7cb6){var _0x22efaa={'XMD-QUEUE':_0x4f67f8[_0x5bec('0x1a')]?_0x4f67f8['Queue']['name']:'','XMD-CALLERID':_0x2b054f,'XMD-CALLERID-PREVIEW':_0x5b7cb6?util[_0x5bec('0x15')](_0x5bec('0x16'),_0x5b7cb6['calleridname'],_0x5b7cb6['calleridnum']):_0x2b054f,'XMD-DIALID':_0x2550fa,'XMD-CONTACTID':_0x4f67f8[_0x5bec('0x1b')],'XMD-CDRTYPE':_0x5bec('0x1c'),'CALLERID(all)':_0x2b054f,'XMD-VOICEQUEUEID':_0x4f67f8[_0x5bec('0x1d')],'XMD-DIALCHANNEL':_0x48908c,'XMD-DIALTIMEOUT':_0x487844[_0x5bec('0x1e')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0x5bec('0x1f'),_0x487844[_0x5bec('0x20')]?'g':'',_[_0x5bec('0x13')](_0x487844[_0x5bec('0x21')])?'':_0x5bec('0x22')),'XMD-DIALURL':_0x487844['dialPreviewUrl']||'','XMD-AGI':_0x487844[_0x5bec('0x23')]?util[_0x5bec('0x15')](_0x5bec('0x24'),ipAgi,_0x487844[_0x5bec('0x23')]):'NONE','XMD-AGIAFTER':_0x487844[_0x5bec('0x20')]?util[_0x5bec('0x15')]('\x22agi://%s/square,%s\x22',ipAgi,_0x487844['dialQueueProject2']):_0x5bec('0x25'),'XMD-ORIGINATECALLERIDNUM':_0x5b7cb6?_0x5b7cb6[_0x5bec('0x26')]:'','XMD-ORIGINATECALLERIDNAME':_0x5b7cb6?_0x5b7cb6[_0x5bec('0x27')]:'','XMD-DESTINATION':_0x5bec('0x28'),'SIPADDHEADER':_0x5bec('0x29')};if(!_['isEmpty'](_0x487844[_0x5bec('0x21')])){_0x22efaa[util[_0x5bec('0x15')]('%s',_0x5bec('0x2a'))]=_0x487844[_0x5bec('0x21')];_0x22efaa[util[_0x5bec('0x15')]('%s',_0x5bec('0x2b'))]=_0x2550fa;}if(_0x4f67f8&&_0x4f67f8[_0x5bec('0x2c')]){for(var _0x23b58a in _0x4f67f8[_0x5bec('0x2c')]){if(_0x4f67f8['Contact']['hasOwnProperty'](_0x23b58a)){if(!_[_0x5bec('0x2d')](_0x4f67f8[_0x5bec('0x2c')][_0x23b58a])&&_0x23b58a!=='id'&&_0x23b58a!==_0x5bec('0x2e')&&_0x23b58a!==_0x5bec('0x2f')&&_0x23b58a!==_0x5bec('0x30')){_0x22efaa[util[_0x5bec('0x15')](_0x5bec('0x31'),'XMD-',_['toUpper'](_0x23b58a))]=_0x4f67f8['Contact'][_0x23b58a];}}}}return _0x22efaa;};exports['toLowerVariables']=function(_0x174ce7){var _0x59c2d9={};for(var _0x408497 in _0x174ce7){if(_0x174ce7[_0x5bec('0x32')](_0x408497)){_0x59c2d9[util[_0x5bec('0x15')]('%s',_[_0x5bec('0x33')](_0x408497))]=_0x174ce7[_0x408497];}}return{'variables':_0x59c2d9};};exports['updateOriginated']=function(_0x387743,_0x4e8da7){if(!_[_0x5bec('0x2d')](_0x387743)){if(_0x387743[_0x5bec('0x32')](_0x5bec('0x34'))){if(_0x387743[_0x5bec('0x34')]>0x0){_0x387743[_0x5bec('0x34')]-=0x1;}else{logger[_0x5bec('0xb')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x4e8da7);}}}else{logger[_0x5bec('0xb')](_0x5bec('0x35'),_0x4e8da7);}};exports[_0x5bec('0x36')]=function(_0xbde35c){var _0x17e5be=moment()[_0x5bec('0x15')](_0x5bec('0x37'));_0xbde35c['state']=0xd;_0xbde35c[_0x5bec('0x38')]=_0x5bec('0x39');_0xbde35c[_0x5bec('0x3a')]=_0x17e5be;_0xbde35c[_0x5bec('0x3b')]=_0x17e5be;_0xbde35c['endtime']=_0x17e5be;};exports['logAgent']=function(_0x13d0e9,_0x27102a,_0x556396){var _0x12a370=moment()[_0x5bec('0x15')]('YYYY-MM-DD\x20HH:mm:ss');_0x13d0e9[_0x5bec('0x3c')]=_0x27102a;_0x13d0e9[_0x5bec('0x38')]=_0x556396;_0x13d0e9[_0x5bec('0x3b')]=_0x12a370;_0x13d0e9[_0x5bec('0x3d')]=getSeconds(_0x13d0e9[_0x5bec('0x3b')],_0x13d0e9['starttime']);};exports[_0x5bec('0x3e')]=function(_0xb35b75,_0x5ebd43,_0x12ea02){_0xb35b75['membername']=_0x5ebd43;_0xb35b75['UserId']=_0x12ea02;};exports['logCustomer']=function(_0xba2ffa,_0x4d59bc,_0x3d2c0f){var _0x18c3f0=moment()[_0x5bec('0x15')](_0x5bec('0x37'));_0xba2ffa[_0x5bec('0x3c')]=_0x4d59bc;_0xba2ffa[_0x5bec('0x38')]=_0x3d2c0f;_0xba2ffa[_0x5bec('0x3b')]=_0xba2ffa['responsetime']?_0xba2ffa[_0x5bec('0x3b')]:_0x18c3f0;_0xba2ffa[_0x5bec('0x3f')]=_0xba2ffa[_0x5bec('0x3f')]?_0xba2ffa[_0x5bec('0x3f')]:_0x18c3f0;_0xba2ffa[_0x5bec('0x3d')]=getSeconds(_0xba2ffa[_0x5bec('0x3b')]||0x0,_0xba2ffa[_0x5bec('0x3a')]||0x0);_0xba2ffa[_0x5bec('0x40')]=_0xba2ffa[_0x5bec('0x41')]?getSeconds(_0xba2ffa[_0x5bec('0x3f')],_0xba2ffa[_0x5bec('0x41')]):0x0;};exports['isFailure']=function(_0xf22f9b){return _0xf22f9b===_0x5bec('0x42');};exports[_0x5bec('0x43')]=function(_0x57eb89,_0x5403cf,_0x17c689,_0x1f33bb,_0x423309){var _0x388c2f=_0x1f33bb?_0x5bec('0x44'):_0x57eb89['calleridname'];_0x388c2f=_0x423309?_0x5bec('0x45'):_0x388c2f;return{'actionid':_0x57eb89[_0x5bec('0x46')],'action':'originate','channel':_0x57eb89['channelAgent'],'callerid':util[_0x5bec('0x15')]('\x22%s\x22\x20<%s>',_0x388c2f,_0x57eb89['calleridnum']),'Exten':_0x5bec('0x28'),'Context':_0x5bec('0x47'),'Priority':'1','variable':_0x17c689,'timeout':(_0x5403cf[_0x5bec('0x48')]||0x1e)*0x3e8,'async':!![],'channelid':_0x57eb89[_0x5bec('0x46')]};};exports[_0x5bec('0x49')]=function(_0x6eddcb){return _0x6eddcb['countbusyretry']+_0x6eddcb[_0x5bec('0x4a')]+_0x6eddcb[_0x5bec('0x4b')]+_0x6eddcb[_0x5bec('0x4c')]+_0x6eddcb[_0x5bec('0x4d')];};exports['cloneAction']=function(_0x31e450){var _0x2a0a26=_[_0x5bec('0x4e')](_0x31e450);_0x2a0a26['state']=0xf;_0x2a0a26[_0x5bec('0x38')]=_0x5bec('0x4f');return _0x2a0a26;};exports['scheduledAt']=function(_0x53c024,_0x4bb696,_0x177b96){var _0x4bd102={};_0x4bd102[_0x4bb696]=_0x53c024[_0x4bb696];_0x4bd102[_0x5bec('0x50')]=![];_0x4bd102['scheduledat']=moment()[_0x5bec('0x51')](_0x177b96,_0x5bec('0x52'))[_0x5bec('0x15')](_0x5bec('0x37'));_0x4bd102[_0x5bec('0x1b')]=_0x53c024['ContactId'];_0x4bd102['ListId']=_0x53c024[_0x5bec('0x53')];_0x4bd102[_0x5bec('0x1d')]=_0x53c024['VoiceQueueId']||undefined;return _0x4bd102;};exports[_0x5bec('0x54')]=function(_0x3207dd,_0x3545ff){if(!_[_0x5bec('0x2d')](_0x3207dd)){if(_0x3207dd['pTalking']>0x0){_0x3207dd[_0x5bec('0x55')]-=0x1;}else{logger['error'](_0x3545ff,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x5bec('0xb')](_0x3545ff,_0x5bec('0x56'));}};exports[_0x5bec('0x57')]=function(_0x39a152){if(_0x39a152<=0x0){return!![];}return![];};exports[_0x5bec('0x58')]=function(_0x255575,_0x479610,_0x1b1939){_0x255575['lastevent']=_0x479610;_0x255575[_0x5bec('0x59')]=_0x255575[_0x5bec('0x5a')];_0x255575[_0x5bec('0x5b')]=_0x255575['channelAgent'];_0x255575[_0x5bec('0x5c')]=_0x5bec('0x5d');if(_0x1b1939){_0x255575[_0x5bec('0x5e')]=_0x1b1939[_0x5bec('0x5e')];}return _0x255575;};exports[_0x5bec('0x5f')]=function(_0x54128c){var _0xc87317={};_0xc87317[_0x5bec('0x5a')]=_0x54128c[_0x5bec('0x5a')];_0xc87317[_0x5bec('0x5b')]=_0x54128c['channelAgent'];_0xc87317[_0x5bec('0x46')]=_0x54128c['uniqueid'];return _0xc87317;};exports[_0x5bec('0x60')]=function(_0x539421){var _0x349192=[];for(var _0x36523e in _0x539421){if(_0x539421[_0x5bec('0x32')](_0x36523e)){if(!_[_0x5bec('0x2d')](_0x539421[_0x36523e])&&_0x539421[_0x36523e]['state']==='not_inuse'&&_0x539421[_0x36523e][_0x5bec('0x61')]===_0x5bec('0x62')){_0x349192[_0x5bec('0x63')](_0x539421[_0x36523e]['id']);}}}return _0x349192;};exports[_0x5bec('0x64')]=function(_0xf62fc1){var _0x37390d=moment()[_0x5bec('0x7')](0x0);var _0x2a557d=moment(_0xf62fc1)[_0x5bec('0x7')](0x0);return _0x37390d[_0x5bec('0x8')](_0x2a557d,_0x5bec('0x9'));};exports[_0x5bec('0x65')]=function(_0x3eeb20){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3eeb20[_0x5bec('0x1b')],'ListId':_0x3eeb20[_0x5bec('0x53')],'VoiceQueueId':_0x3eeb20[_0x5bec('0x1d')]||undefined,'CampaignId':_0x3eeb20['CampaignId']||undefined};};exports[_0x5bec('0x66')]=function(_0x168a3b){if(_0x168a3b==='uniqueid'||_0x168a3b===_0x5bec('0x67')||_0x168a3b==='queue'||_0x168a3b===_0x5bec('0x68')||_0x168a3b===_0x5bec('0x69')||_0x168a3b===_0x5bec('0x6a')||_0x168a3b==='membername'||_0x168a3b===_0x5bec('0x6b')||_0x168a3b===_0x5bec('0x6c')||_0x168a3b===_0x5bec('0x50')||_0x168a3b==='calleridnum'||_0x168a3b==='scheduledat'||_0x168a3b===_0x5bec('0x6d')||_0x168a3b===_0x5bec('0x4a')||_0x168a3b===_0x5bec('0x4b')||_0x168a3b===_0x5bec('0x6e')||_0x168a3b===_0x5bec('0x6f')||_0x168a3b===_0x5bec('0x70')||_0x168a3b===_0x5bec('0x71')||_0x168a3b===_0x5bec('0x72')||_0x168a3b===_0x5bec('0x1b')||_0x168a3b===_0x5bec('0x53')||_0x168a3b===_0x5bec('0x73')||_0x168a3b===_0x5bec('0x1d')||_0x168a3b===_0x5bec('0x74')||_0x168a3b===_0x5bec('0x75')||_0x168a3b===_0x5bec('0x76')||_0x168a3b==='xmd-phone'||_0x168a3b===_0x5bec('0x77')||_0x168a3b==='xmd-dialurl'||_0x168a3b===_0x5bec('0x78')||_0x168a3b===_0x5bec('0x79')||_0x168a3b===_0x5bec('0x7a')||_0x168a3b===_0x5bec('0x7b')||_0x168a3b==='xmd-contactid'||_0x168a3b===_0x5bec('0x7c')||_0x168a3b===_0x5bec('0x7d')||_0x168a3b===_0x5bec('0x7e')||_0x168a3b==='xmd-agi'||_0x168a3b===_0x5bec('0x7f')||_0x168a3b===_0x5bec('0x80')||_0x168a3b===_0x5bec('0x81')||_0x168a3b===_0x5bec('0x82')||_0x168a3b===_0x5bec('0x83')||_0x168a3b===_0x5bec('0x84')||_0x168a3b===_0x5bec('0x85')||_0x168a3b===_0x5bec('0x86')||_0x168a3b===_0x5bec('0x7f')||_0x168a3b==='rtpaudioqosbridged'||_0x168a3b===_0x5bec('0x81')||_0x168a3b===_0x5bec('0x82')||_0x168a3b===_0x5bec('0x83')||_0x168a3b==='rtpaudioqoslossbridged'||_0x168a3b===_0x5bec('0x85')||_0x168a3b===_0x5bec('0x86')||_0x168a3b==='bridgepeer'||_0x168a3b===_0x5bec('0x87')||_0x168a3b===_0x5bec('0x3c')||_0x168a3b==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0x1a5d7c,_0x305c7e){var _0x579def,_0x23355f,_0x3a0ef3;if(_0x305c7e<=0x0){_0x305c7e=0x1;}_0x579def=new RegExp('\x5cw{0,'+_0x305c7e+'}$');_0x23355f=Math[_0x5bec('0x88')](0xa,_0x305c7e-0x1);_0x3a0ef3=Math[_0x5bec('0x88')](0xa,_0x305c7e)-0x1;return util['format']('%s',_[_0x5bec('0x89')](_0x1a5d7c,_0x579def,_[_0x5bec('0x8a')](_0x23355f,_0x3a0ef3)));};exports[_0x5bec('0x8b')]=function(_0x4d98b7){var _0x219857=_0x4d98b7['match'](/"(.*?)"/);return _0x219857?_0x219857[0x1]:_0x4d98b7;};exports[_0x5bec('0x8c')]=function(_0x192efa){var _0x509aa9=_0x192efa[_0x5bec('0x8d')](/<(.*?)>/);return _0x509aa9?_0x509aa9[0x1]:_0x192efa;};
\ No newline at end of file
+var _0x9cc5=['calleridnum','xcally-motion-preview','from-sip','timeout','totalGlobal','countbusyretry','cloneAction','clone','Global','scheduledAt','active','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','buildAcw','status','push','getDiff','milliseconds','diff','createBody','CampaignId','campaigntype','scheduledat','countnoanswerretry','countglobal','callback','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialoptions','xmd-dialid','xmd-contactid','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','lodash','moment','env','127.0.0.1','seconds','error','inspect','logger','info','loggerError','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridname','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','starttime','endtime','logAgent','statedesc','responsetime','ringtime','logLookAgent','membername','logCustomer','talktime','answertime','isFailure','RECALL','BOOKED','uniqueid','originate','channelAgent'];(function(_0x171028,_0x7ee648){var _0x5c4c7b=function(_0x4eea05){while(--_0x4eea05){_0x171028['push'](_0x171028['shift']());}};_0x5c4c7b(++_0x7ee648);}(_0x9cc5,0xcf));var _0x59cc=function(_0x397acc,_0x2fea58){_0x397acc=_0x397acc-0x0;var _0x26493e=_0x9cc5[_0x397acc];return _0x26493e;};'use strict';var util=require(_0x59cc('0x0'));var _=require(_0x59cc('0x1'));var moment=require(_0x59cc('0x2'));var logger=require('../../../../config/logger')('preview');var ipAgi=process[_0x59cc('0x3')]['XCALLY_IP_AGI']||_0x59cc('0x4');function getSeconds(_0x40c35,_0x2e09d3){var _0x10a10a=moment(_0x40c35)['milliseconds'](0x0);var _0x3904b5=moment(_0x2e09d3)['milliseconds'](0x0);return _0x10a10a['diff'](_0x3904b5,_0x59cc('0x5'));}exports['loggerCatch']=function(_0x4a06e1){return function(_0x2089d4){logger[_0x59cc('0x6')](_0x4a06e1,util[_0x59cc('0x7')](_0x2089d4,{'showHidden':![],'depth':null}));};};exports[_0x59cc('0x8')]=function(_0x49cd61,_0x233f7e){logger[_0x59cc('0x9')](_0x49cd61,util[_0x59cc('0x7')](_0x233f7e,{'showHidden':![],'depth':null}));};exports[_0x59cc('0xa')]=function(_0x1bc91e,_0x565542){logger[_0x59cc('0x6')](_0x1bc91e,util['inspect'](_0x565542,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x359a4f){return function(_0x557a03){logger[_0x59cc('0x9')](_0x359a4f,util['inspect'](_0x557a03,{'showHidden':![],'depth':null}));};};exports[_0x59cc('0xb')]=function(_0x201dd5,_0x4819c0,_0x182d67){return{'message':_0x201dd5,'unlock':_0x4819c0,'active':_0x182d67};};exports[_0x59cc('0xc')]=function(_0x3a95ae,_0x2e98ce,_0x3c122d){if(!_[_0x59cc('0xd')](_0x3c122d)&&_0x59cc('0xe')===typeof _0x3c122d&&!_[_0x59cc('0xf')](_0x3c122d)){if(!_['isUndefined'](_0x2e98ce)&&_0x59cc('0xe')===typeof _0x2e98ce&&!_[_0x59cc('0xf')](_0x2e98ce)){return util[_0x59cc('0x10')](_0x59cc('0x11'),_0x2e98ce,_0x3c122d);}return util[_0x59cc('0x10')]('\x22%s\x22\x20<%s>',_0x3c122d,_0x3c122d);}if(!_[_0x59cc('0xd')](_0x3a95ae)&&_0x59cc('0xe')===typeof _0x3a95ae&&!_[_0x59cc('0xf')](_0x3a95ae)){return _0x3a95ae;}return _0x59cc('0x12');};exports[_0x59cc('0x13')]=function(_0x4a2821){if(_[_0x59cc('0x14')](_0x4a2821)){return![];}return _0x4a2821;};exports[_0x59cc('0x15')]=function(_0x3354b7,_0x3932f3,_0x4c1384,_0x48554d,_0x31c0ba,_0x18c983){var _0x512752={'XMD-QUEUE':_0x3932f3[_0x59cc('0x16')]?_0x3932f3[_0x59cc('0x16')][_0x59cc('0x17')]:'','XMD-CALLERID':_0x48554d,'XMD-CALLERID-PREVIEW':_0x18c983?util[_0x59cc('0x10')](_0x59cc('0x11'),_0x18c983[_0x59cc('0x18')],_0x18c983['calleridnum']):_0x48554d,'XMD-DIALID':_0x31c0ba,'XMD-CONTACTID':_0x3932f3[_0x59cc('0x19')],'XMD-CDRTYPE':_0x59cc('0x1a'),'CALLERID(all)':_0x48554d,'XMD-VOICEQUEUEID':_0x3932f3[_0x59cc('0x1b')],'XMD-DIALCHANNEL':_0x4c1384,'XMD-DIALTIMEOUT':_0x3354b7[_0x59cc('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0x59cc('0x10')](_0x59cc('0x1d'),_0x3354b7['dialQueueProject2']?'g':'',_[_0x59cc('0xf')](_0x3354b7[_0x59cc('0x1e')])?'':_0x59cc('0x1f')),'XMD-DIALURL':_0x3354b7[_0x59cc('0x20')]||'','XMD-AGI':_0x3354b7[_0x59cc('0x21')]?util[_0x59cc('0x10')](_0x59cc('0x22'),ipAgi,_0x3354b7[_0x59cc('0x21')]):_0x59cc('0x23'),'XMD-AGIAFTER':_0x3354b7[_0x59cc('0x24')]?util[_0x59cc('0x10')](_0x59cc('0x22'),ipAgi,_0x3354b7['dialQueueProject2']):_0x59cc('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x18c983?_0x18c983['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x18c983?_0x18c983[_0x59cc('0x25')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0x59cc('0x26')};if(!_[_0x59cc('0xf')](_0x3354b7[_0x59cc('0x1e')])){_0x512752[util['format']('%s',_0x59cc('0x27'))]=_0x3354b7[_0x59cc('0x1e')];_0x512752[util[_0x59cc('0x10')]('%s',_0x59cc('0x28'))]=_0x31c0ba;}if(_0x3932f3&&_0x3932f3[_0x59cc('0x29')]){for(var _0x322f64 in _0x3932f3[_0x59cc('0x29')]){if(_0x3932f3[_0x59cc('0x29')]['hasOwnProperty'](_0x322f64)){if(!_['isNil'](_0x3932f3[_0x59cc('0x29')][_0x322f64])&&_0x322f64!=='id'&&_0x322f64!=='tags'&&_0x322f64!==_0x59cc('0x2a')&&_0x322f64!==_0x59cc('0x2b')){_0x512752[util[_0x59cc('0x10')](_0x59cc('0x2c'),_0x59cc('0x2d'),_[_0x59cc('0x2e')](_0x322f64))]=_0x3932f3[_0x59cc('0x29')][_0x322f64];}}}}return _0x512752;};exports[_0x59cc('0x2f')]=function(_0x2b784d){var _0x36d120={};for(var _0x4a2eae in _0x2b784d){if(_0x2b784d[_0x59cc('0x30')](_0x4a2eae)){_0x36d120[util[_0x59cc('0x10')]('%s',_[_0x59cc('0x31')](_0x4a2eae))]=_0x2b784d[_0x4a2eae];}}return{'variables':_0x36d120};};exports[_0x59cc('0x32')]=function(_0x21a0e8,_0x536497){if(!_[_0x59cc('0x14')](_0x21a0e8)){if(_0x21a0e8[_0x59cc('0x30')](_0x59cc('0x33'))){if(_0x21a0e8[_0x59cc('0x33')]>0x0){_0x21a0e8[_0x59cc('0x33')]-=0x1;}else{logger[_0x59cc('0x6')](_0x59cc('0x34'),_0x536497);}}}else{logger[_0x59cc('0x6')](_0x59cc('0x35'),_0x536497);}};exports[_0x59cc('0x36')]=function(_0x465982){var _0x2113f2=moment()[_0x59cc('0x10')](_0x59cc('0x37'));_0x465982[_0x59cc('0x38')]=0xd;_0x465982['statedesc']=_0x59cc('0x39');_0x465982[_0x59cc('0x3a')]=_0x2113f2;_0x465982['responsetime']=_0x2113f2;_0x465982[_0x59cc('0x3b')]=_0x2113f2;};exports[_0x59cc('0x3c')]=function(_0x4bb336,_0x251ce4,_0x52abc0){var _0x189926=moment()[_0x59cc('0x10')](_0x59cc('0x37'));_0x4bb336[_0x59cc('0x38')]=_0x251ce4;_0x4bb336[_0x59cc('0x3d')]=_0x52abc0;_0x4bb336[_0x59cc('0x3e')]=_0x189926;_0x4bb336[_0x59cc('0x3f')]=getSeconds(_0x4bb336[_0x59cc('0x3e')],_0x4bb336[_0x59cc('0x3a')]);};exports[_0x59cc('0x40')]=function(_0xe0140b,_0x36a1fb,_0x2d7368){_0xe0140b[_0x59cc('0x41')]=_0x36a1fb;_0xe0140b['UserId']=_0x2d7368;};exports[_0x59cc('0x42')]=function(_0x10a6e8,_0x58778d,_0xfa8244){var _0x3d8471=moment()['format'](_0x59cc('0x37'));_0x10a6e8[_0x59cc('0x38')]=_0x58778d;_0x10a6e8['statedesc']=_0xfa8244;_0x10a6e8[_0x59cc('0x3e')]=_0x10a6e8['responsetime']?_0x10a6e8[_0x59cc('0x3e')]:_0x3d8471;_0x10a6e8[_0x59cc('0x3b')]=_0x10a6e8[_0x59cc('0x3b')]?_0x10a6e8[_0x59cc('0x3b')]:_0x3d8471;_0x10a6e8[_0x59cc('0x3f')]=getSeconds(_0x10a6e8[_0x59cc('0x3e')]||0x0,_0x10a6e8[_0x59cc('0x3a')]||0x0);_0x10a6e8[_0x59cc('0x43')]=_0x10a6e8[_0x59cc('0x44')]?getSeconds(_0x10a6e8['endtime'],_0x10a6e8[_0x59cc('0x44')]):0x0;};exports[_0x59cc('0x45')]=function(_0x35b2b8){return _0x35b2b8==='Failure';};exports['variablesAction']=function(_0x210f0a,_0x440851,_0x48b4e3,_0x49abf0,_0x9eb304){var _0x57b1d1=_0x49abf0?_0x59cc('0x46'):_0x210f0a['calleridname'];_0x57b1d1=_0x9eb304?_0x59cc('0x47'):_0x57b1d1;return{'actionid':_0x210f0a[_0x59cc('0x48')],'action':_0x59cc('0x49'),'channel':_0x210f0a[_0x59cc('0x4a')],'callerid':util[_0x59cc('0x10')](_0x59cc('0x11'),_0x57b1d1,_0x210f0a[_0x59cc('0x4b')]),'Exten':_0x59cc('0x4c'),'Context':_0x59cc('0x4d'),'Priority':'1','variable':_0x48b4e3,'timeout':(_0x440851[_0x59cc('0x4e')]||0x1e)*0x3e8,'async':!![],'channelid':_0x210f0a['uniqueid']};};exports[_0x59cc('0x4f')]=function(_0x414123){return _0x414123[_0x59cc('0x50')]+_0x414123['countcongestionretry']+_0x414123['countnoanswerretry']+_0x414123['countagentrejectretry']+_0x414123['countnosuchnumberretry'];};exports[_0x59cc('0x51')]=function(_0x26cdef){var _0x3448ff=_[_0x59cc('0x52')](_0x26cdef);_0x3448ff[_0x59cc('0x38')]=0xf;_0x3448ff['statedesc']=_0x59cc('0x53');return _0x3448ff;};exports[_0x59cc('0x54')]=function(_0x2d7a64,_0x31bacf,_0x565f0b){var _0x58df37={};_0x58df37[_0x31bacf]=_0x2d7a64[_0x31bacf];_0x58df37[_0x59cc('0x55')]=![];_0x58df37['scheduledat']=moment()['add'](_0x565f0b,_0x59cc('0x56'))[_0x59cc('0x10')](_0x59cc('0x37'));_0x58df37[_0x59cc('0x19')]=_0x2d7a64['ContactId'];_0x58df37[_0x59cc('0x57')]=_0x2d7a64['ListId'];_0x58df37[_0x59cc('0x1b')]=_0x2d7a64['VoiceQueueId']||undefined;return _0x58df37;};exports[_0x59cc('0x58')]=function(_0x4fe821,_0x54f4f2){if(!_[_0x59cc('0x14')](_0x4fe821)){if(_0x4fe821['pTalking']>0x0){_0x4fe821[_0x59cc('0x59')]-=0x1;}else{logger[_0x59cc('0x6')](_0x54f4f2,_0x59cc('0x5a'));}}else{logger[_0x59cc('0x6')](_0x54f4f2,_0x59cc('0x5b'));}};exports[_0x59cc('0x5c')]=function(_0x398834){if(_0x398834<=0x0){return!![];}return![];};exports[_0x59cc('0x5d')]=function(_0x3b2200,_0x190745,_0x3ed329){_0x3b2200[_0x59cc('0x5e')]=_0x190745;_0x3b2200[_0x59cc('0x17')]=_0x3b2200[_0x59cc('0x5f')];_0x3b2200[_0x59cc('0x60')]=_0x3b2200['channelAgent'];_0x3b2200[_0x59cc('0x61')]=_0x59cc('0x62');if(_0x3ed329){_0x3b2200['mandatoryDisposition']=_0x3ed329[_0x59cc('0x63')];}return _0x3b2200;};exports[_0x59cc('0x64')]=function(_0x430f45){var _0x2b96ae={};_0x2b96ae[_0x59cc('0x5f')]=_0x430f45[_0x59cc('0x5f')];_0x2b96ae[_0x59cc('0x60')]=_0x430f45['channelAgent'];_0x2b96ae[_0x59cc('0x48')]=_0x430f45[_0x59cc('0x48')];return _0x2b96ae;};exports['agentReadyId']=function(_0x5e0d57){var _0x5b0afb=[];for(var _0x4248eb in _0x5e0d57){if(_0x5e0d57[_0x59cc('0x30')](_0x4248eb)){if(!_[_0x59cc('0x14')](_0x5e0d57[_0x4248eb])&&_0x5e0d57[_0x4248eb][_0x59cc('0x38')]==='not_inuse'&&_0x5e0d57[_0x4248eb][_0x59cc('0x65')]==='reachable'){_0x5b0afb[_0x59cc('0x66')](_0x5e0d57[_0x4248eb]['id']);}}}return _0x5b0afb;};exports[_0x59cc('0x67')]=function(_0x24a4a2){var _0x1b70f7=moment()[_0x59cc('0x68')](0x0);var _0x5e3c5e=moment(_0x24a4a2)['milliseconds'](0x0);return _0x1b70f7[_0x59cc('0x69')](_0x5e3c5e,'seconds');};exports[_0x59cc('0x6a')]=function(_0x25053e){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x25053e[_0x59cc('0x19')],'ListId':_0x25053e[_0x59cc('0x57')],'VoiceQueueId':_0x25053e[_0x59cc('0x1b')]||undefined,'CampaignId':_0x25053e[_0x59cc('0x6b')]||undefined};};exports['filterKey']=function(_0x3d7fba){if(_0x3d7fba==='uniqueid'||_0x3d7fba==='idContact'||_0x3d7fba==='queue'||_0x3d7fba==='type'||_0x3d7fba===_0x59cc('0x6c')||_0x3d7fba==='dialAnswer'||_0x3d7fba===_0x59cc('0x41')||_0x3d7fba===_0x59cc('0x4a')||_0x3d7fba===_0x59cc('0x18')||_0x3d7fba==='active'||_0x3d7fba==='calleridnum'||_0x3d7fba===_0x59cc('0x6d')||_0x3d7fba===_0x59cc('0x50')||_0x3d7fba==='countcongestionretry'||_0x3d7fba===_0x59cc('0x6e')||_0x3d7fba===_0x59cc('0x6f')||_0x3d7fba===_0x59cc('0x70')||_0x3d7fba==='callbackuniqueid'||_0x3d7fba==='callbackat'||_0x3d7fba===_0x59cc('0x71')||_0x3d7fba==='ContactId'||_0x3d7fba===_0x59cc('0x57')||_0x3d7fba==='UserId'||_0x3d7fba==='VoiceQueueId'||_0x3d7fba===_0x59cc('0x72')||_0x3d7fba===_0x59cc('0x73')||_0x3d7fba===_0x59cc('0x74')||_0x3d7fba===_0x59cc('0x75')||_0x3d7fba===_0x59cc('0x76')||_0x3d7fba==='xmd-dialurl'||_0x3d7fba==='xmd-dialtimeout'||_0x3d7fba===_0x59cc('0x77')||_0x3d7fba===_0x59cc('0x78')||_0x3d7fba==='xmd-dialchannel'||_0x3d7fba===_0x59cc('0x79')||_0x3d7fba==='xmd-cdrtype'||_0x3d7fba===_0x59cc('0x7a')||_0x3d7fba===_0x59cc('0x7b')||_0x3d7fba===_0x59cc('0x7c')||_0x3d7fba===_0x59cc('0x7d')||_0x3d7fba===_0x59cc('0x7e')||_0x3d7fba===_0x59cc('0x7f')||_0x3d7fba===_0x59cc('0x80')||_0x3d7fba===_0x59cc('0x81')||_0x3d7fba===_0x59cc('0x82')||_0x3d7fba===_0x59cc('0x83')||_0x3d7fba===_0x59cc('0x84')||_0x3d7fba==='rtpaudioqos'||_0x3d7fba===_0x59cc('0x7e')||_0x3d7fba===_0x59cc('0x7f')||_0x3d7fba===_0x59cc('0x80')||_0x3d7fba===_0x59cc('0x81')||_0x3d7fba==='rtpaudioqoslossbridged'||_0x3d7fba===_0x59cc('0x83')||_0x3d7fba===_0x59cc('0x84')||_0x3d7fba===_0x59cc('0x85')||_0x3d7fba===_0x59cc('0x86')||_0x3d7fba===_0x59cc('0x38')||_0x3d7fba===_0x59cc('0x3d')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x297e12,_0x47b12b){var _0x2f7aa6,_0x1659a4,_0x43bfc5;if(_0x47b12b<=0x0){_0x47b12b=0x1;}_0x2f7aa6=new RegExp('\x5cw{0,'+_0x47b12b+'}$');_0x1659a4=Math[_0x59cc('0x87')](0xa,_0x47b12b-0x1);_0x43bfc5=Math['pow'](0xa,_0x47b12b)-0x1;return util['format']('%s',_[_0x59cc('0x88')](_0x297e12,_0x2f7aa6,_[_0x59cc('0x89')](_0x1659a4,_0x43bfc5)));};exports[_0x59cc('0x8a')]=function(_0x3c180e){var _0xa1e074=_0x3c180e[_0x59cc('0x8b')](/"(.*?)"/);return _0xa1e074?_0xa1e074[0x1]:_0x3c180e;};exports[_0x59cc('0x8c')]=function(_0x253c65){var _0x10cfd5=_0x253c65[_0x59cc('0x8b')](/<(.*?)>/);return _0x10cfd5?_0x10cfd5[0x1]:_0x253c65;};
\ No newline at end of file
index bb504fc..eaddeca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9002=['queueremove','queuepause','reload','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number'];(function(_0x5be306,_0x1da688){var _0x49eae5=function(_0x3869f2){while(--_0x3869f2){_0x5be306['push'](_0x5be306['shift']());}};_0x49eae5(++_0x1da688);}(_0x9002,0x15c));var _0x2900=function(_0x449278,_0x3657e2){_0x449278=_0x449278-0x0;var _0xcd19f8=_0x9002[_0x449278];return _0xcd19f8;};'use strict';exports[_0x2900('0x0')]={'queue':{'type':_0x2900('0x1'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0x2900('0x1'),'required':!![]},'penalty':{'type':_0x2900('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0x2900('0x3')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x2900('0x1'),'required':!![]}};exports[_0x2900('0x4')]={'interface':{'type':_0x2900('0x1'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0x2900('0x1'),'required':![]}};exports[_0x2900('0x5')]={'module':{'type':_0x2900('0x1'),'required':![]}};exports[_0x2900('0x6')]={'uniqueid':{'type':_0x2900('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x2900('0x1'),'required':!![]},'filename':{'type':_0x2900('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0x2900('0x1')}};exports[_0x2900('0x7')]={'uniqueid':{'type':_0x2900('0x1'),'required':!![]}};exports[_0x2900('0x8')]={'uniqueid':{'type':_0x2900('0x1'),'required':!![]},'exten':{'type':_0x2900('0x1'),'required':!![]},'context':{'type':_0x2900('0x1')}};
\ No newline at end of file
+var _0x5ec5=['voicequeuechannelredirect','string','number','boolean','queueremove','queuepause','reload','voicechannel','voicequeuechannelhangup'];(function(_0x27ba8e,_0x4a6054){var _0x587027=function(_0x12446d){while(--_0x12446d){_0x27ba8e['push'](_0x27ba8e['shift']());}};_0x587027(++_0x4a6054);}(_0x5ec5,0x145));var _0x55ec=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x5ec5[_0x4b369d];return _0x571a98;};'use strict';exports['queueadd']={'queue':{'type':_0x55ec('0x0'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0x55ec('0x0'),'required':!![]},'penalty':{'type':_0x55ec('0x1'),'required':![]},'paused':{'type':_0x55ec('0x2'),'required':![]}};exports[_0x55ec('0x3')]={'queue':{'type':'string','required':!![]},'interface':{'type':'string','required':!![]}};exports[_0x55ec('0x4')]={'interface':{'type':_0x55ec('0x0'),'required':!![]},'paused':{'type':_0x55ec('0x2')},'reason':{'type':_0x55ec('0x0'),'required':![]}};exports[_0x55ec('0x5')]={'module':{'type':_0x55ec('0x0'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':'string','required':!![]}};exports[_0x55ec('0x6')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':'string'},'format':{'type':_0x55ec('0x0')},'mixmonitorid':{'type':_0x55ec('0x0')}};exports[_0x55ec('0x7')]={'uniqueid':{'type':_0x55ec('0x0'),'required':!![]}};exports[_0x55ec('0x8')]={'uniqueid':{'type':_0x55ec('0x0'),'required':!![]},'exten':{'type':_0x55ec('0x0'),'required':!![]},'context':{'type':'string'}};
\ No newline at end of file
index 293aece..4005b22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb96c=['isNil','interface','SIP/%s','total','sumHoldTime','sumBillable','isEmpty','ivrTotalCallsDays','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','agents','length','format','isUndefined','mergeFromDatabase','initTrunks','trunks','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','initDynamics365Accounts','dynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','sumDuration','queuecallercompleteAt','queuecallerabandonAt','diff','seconds','queuecallercomplete','initVoiceCallReports','duration','disposition','answered','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','merge','bluebird','util','lodash','moment','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','telephones','voiceQueues','triggers','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','mapKeys','name','hasOwnProperty'];(function(_0xec034,_0x16c358){var _0x2c5a19=function(_0xec401c){while(--_0xec401c){_0xec034['push'](_0xec034['shift']());}};_0x2c5a19(++_0x16c358);}(_0xb96c,0x125));var _0xcb96=function(_0x3a303e,_0x29fe2c){_0x3a303e=_0x3a303e-0x0;var _0x4d62dd=_0xb96c[_0x3a303e];return _0x4d62dd;};'use strict';var BPromise=require(_0xcb96('0x0'));var util=require(_0xcb96('0x1'));var _=require(_0xcb96('0x2'));var moment=require(_0xcb96('0x3'));var Agent=require('../model/agent');var Telephone=require('../model/telephone');var Trunk=require(_0xcb96('0x4'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0xcb96('0x5'));var Template=require(_0xcb96('0x6'));var Campaign=require(_0xcb96('0x7'));var VoiceExtension=require(_0xcb96('0x8'));var ZendeskAccount=require(_0xcb96('0x9'));var SalesforceAccount=require(_0xcb96('0xa'));var FreshdeskAccount=require(_0xcb96('0xb'));var SugarcrmAccount=require(_0xcb96('0xc'));var ZohoAccount=require(_0xcb96('0xd'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xcb96('0xe'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0xcb96('0xf'));var FreshsalesAccount=require(_0xcb96('0x10'));var FaxAccount=require(_0xcb96('0x11'));var Realtime=function(){this['agents']={};this[_0xcb96('0x12')]={};this['trunks']={};this[_0xcb96('0x13')]={};this[_0xcb96('0x14')]={};this['campaigns']={};this[_0xcb96('0x15')]={};this[_0xcb96('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xcb96('0x17')]={};this[_0xcb96('0x18')]={};this[_0xcb96('0x19')]={};this[_0xcb96('0x1a')]={};this[_0xcb96('0x1b')]={};this['settings']={};this[_0xcb96('0x1c')]={};this[_0xcb96('0x1d')]={};this[_0xcb96('0x1e')]={};this[_0xcb96('0x1f')]={};this[_0xcb96('0x20')]={};this[_0xcb96('0x21')]={};this['vtigerAccounts']={};this[_0xcb96('0x22')]={};this['dynamics365Accounts']={};this[_0xcb96('0x23')]={};this[_0xcb96('0x24')]={};};function freeIsNotKey(_0xc064a1,_0x27b178,_0x552312){var _0x507c35=_['mapKeys'](_0xc064a1,function(_0x193724,_0x53ffe1){return _0x193724[_0x552312];});for(var _0x57e21a in _0x27b178){if(_0x27b178['hasOwnProperty'](_0x57e21a)){if(!_0x507c35[_0x57e21a]){delete _0x27b178[_0x57e21a];}}}}function freeIsNotKeySip(_0x266803,_0x131918){var _0x488b6f=_[_0xcb96('0x25')](_0x266803,function(_0x1b8a4c,_0x5a07c2){return util['format']('SIP/%s',_0x1b8a4c[_0xcb96('0x26')]);});for(var _0x30fe4a in _0x131918){if(_0x131918[_0xcb96('0x27')](_0x30fe4a)){if(!_0x488b6f[_0x30fe4a]){delete _0x131918[_0x30fe4a];}}}}function freeIsNotKeyAgent(_0x50caf6,_0x1e231a){var _0x3fe831=_[_0xcb96('0x25')](_0x50caf6,function(_0x1c51ff,_0x2bf124){var _0x2ecc4c=_[_0xcb96('0x28')](_0x1c51ff[_0xcb96('0x29')])?util['format'](_0xcb96('0x2a'),_0x1c51ff[_0xcb96('0x26')]):_0x1c51ff[_0xcb96('0x29')];return _0x2ecc4c;});for(var _0x55a230 in _0x1e231a){if(_0x1e231a[_0xcb96('0x27')](_0x55a230)){if(!_0x3fe831[_0x55a230]){delete _0x1e231a[_0x55a230];}}}}function clearVoiceCallReports(_0x481634){_0x481634[_0xcb96('0x2b')]=0x0;_0x481634['answered']=0x0;_0x481634[_0xcb96('0x2c')]=0x0;_0x481634['sumDuration']=0x0;_0x481634[_0xcb96('0x2d')]=0x0;}function clearCampaigns(_0x4595d9){if(!_[_0xcb96('0x2e')](_0x4595d9)){for(var _0x53d036 in _0x4595d9){if(_0x4595d9[_0xcb96('0x27')](_0x53d036)){_0x4595d9[_0x53d036][_0xcb96('0x2f')]=0x0;_0x4595d9[_0x53d036]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x27dc90){if(!_['isEmpty'](_0x27dc90)){for(var _0x192e00 in _0x27dc90){if(_0x27dc90[_0xcb96('0x27')](_0x192e00)){_0x27dc90[_0x192e00][_0xcb96('0x2b')]=0x0;_0x27dc90[_0x192e00]['answered']=0x0;_0x27dc90[_0x192e00][_0xcb96('0x30')]=0x0;_0x27dc90[_0x192e00][_0xcb96('0x31')]=0x0;_0x27dc90[_0x192e00][_0xcb96('0x2c')]=0x0;_0x27dc90[_0x192e00]['sumDuration']=0x0;_0x27dc90[_0x192e00][_0xcb96('0x2d')]=0x0;_0x27dc90[_0x192e00][_0xcb96('0x32')]=0x0;_0x27dc90[_0x192e00][_0xcb96('0x33')]=0x0;_0x27dc90[_0x192e00][_0xcb96('0x34')]=0x0;_0x27dc90[_0x192e00][_0xcb96('0x35')]=0x0;_0x27dc90[_0x192e00]['outboundNoSuchCallsDay']=0x0;_0x27dc90[_0x192e00][_0xcb96('0x36')]=0x0;_0x27dc90[_0x192e00][_0xcb96('0x37')]=0x0;_0x27dc90[_0x192e00][_0xcb96('0x38')]=0x0;_0x27dc90[_0x192e00][_0xcb96('0x39')]=0x0;_0x27dc90[_0x192e00][_0xcb96('0x3a')]=0x0;_0x27dc90[_0x192e00][_0xcb96('0x3b')]=0x0;_0x27dc90[_0x192e00][_0xcb96('0x3c')]=0x0;_0x27dc90[_0x192e00]['outboundAnswerAgiCallsDay']=0x0;_0x27dc90[_0x192e00][_0xcb96('0x3d')]=0x0;_0x27dc90[_0x192e00][_0xcb96('0x3e')]=!![];}}}}Realtime[_0xcb96('0x3f')]['mergeFromDatabase']=function(_0x455cb3,_0x3012f1){for(var _0x50d3db in _0x3012f1){if(_0x455cb3[_0xcb96('0x27')](_0x50d3db)){_0x455cb3[_0x50d3db]=_0x3012f1[_0x50d3db];}}};Realtime['prototype']['initAgents']=function(){var _0x1b712d=this;return function(_0x1a5626){if(_0x1a5626){freeIsNotKeyAgent(_0x1a5626,_0x1b712d[_0xcb96('0x40')]);for(var _0x5cf9d1=0x0,_0x236a9d={},_0x152ee0={};_0x5cf9d1<_0x1a5626[_0xcb96('0x41')];_0x5cf9d1+=0x1){_0x236a9d=_0x1a5626[_0x5cf9d1];var _0x4184cc=_['isNil'](_0x236a9d[_0xcb96('0x29')])?util[_0xcb96('0x42')](_0xcb96('0x2a'),_0x236a9d[_0xcb96('0x26')]):_0x236a9d[_0xcb96('0x29')];if(_[_0xcb96('0x43')](_0x1b712d[_0xcb96('0x40')][_0x4184cc])){_0x1b712d[_0xcb96('0x40')][_0x4184cc]=new Agent(_0x236a9d);}else{_0x1b712d['mergeFromDatabase'](_0x1b712d[_0xcb96('0x40')][_0x4184cc],_0x236a9d);}}}return _0x1b712d['agents'];};};Realtime[_0xcb96('0x3f')]['initTelephones']=function(){var _0x5d8b29=this;return function(_0x360d86){if(_0x360d86){freeIsNotKeySip(_0x360d86,_0x5d8b29['telephones']);for(var _0x10cead=0x0,_0x20d07e={},_0x5d692b={};_0x10cead<_0x360d86[_0xcb96('0x41')];_0x10cead+=0x1){_0x20d07e=_0x360d86[_0x10cead];if(_[_0xcb96('0x43')](_0x5d8b29[_0xcb96('0x12')][util[_0xcb96('0x42')](_0xcb96('0x2a'),_0x20d07e['name'])])){_0x5d8b29['telephones'][util[_0xcb96('0x42')]('SIP/%s',_0x20d07e['name'])]=new Telephone(_0x20d07e);}else{_0x5d8b29[_0xcb96('0x44')](_0x5d8b29['telephones'][util['format']('SIP/%s',_0x20d07e['name'])],_0x20d07e);}}}return _0x5d8b29[_0xcb96('0x12')];};};Realtime['prototype'][_0xcb96('0x45')]=function(){var _0x2ea8de=this;return function(_0x107a5c){if(_0x107a5c){freeIsNotKeySip(_0x107a5c,_0x2ea8de[_0xcb96('0x46')]);for(var _0xa66ca1=0x0,_0x1f6c58={},_0x384a76={};_0xa66ca1<_0x107a5c['length'];_0xa66ca1+=0x1){_0x1f6c58=_0x107a5c[_0xa66ca1];if(_[_0xcb96('0x43')](_0x2ea8de[_0xcb96('0x46')][util[_0xcb96('0x42')](_0xcb96('0x2a'),_0x1f6c58[_0xcb96('0x26')])])){_0x2ea8de[_0xcb96('0x46')][util[_0xcb96('0x42')](_0xcb96('0x2a'),_0x1f6c58[_0xcb96('0x26')])]=new Trunk(_0x1f6c58);}else{_0x2ea8de[_0xcb96('0x44')](_0x2ea8de[_0xcb96('0x46')][util[_0xcb96('0x42')]('SIP/%s',_0x1f6c58[_0xcb96('0x26')])],_0x1f6c58);}}}return _0x2ea8de[_0xcb96('0x46')];};};Realtime[_0xcb96('0x3f')][_0xcb96('0x47')]=function(){var _0x58d149=this;return function(_0x27fb5){if(_0x27fb5){freeIsNotKey(_0x27fb5,_0x58d149['voiceQueues'],_0xcb96('0x26'));for(var _0xb996c=0x0,_0x3eff81={},_0x2695c0={};_0xb996c<_0x27fb5[_0xcb96('0x41')];_0xb996c+=0x1){_0x3eff81=_0x27fb5[_0xb996c];if(_[_0xcb96('0x43')](_0x58d149['voiceQueues'][_0x3eff81[_0xcb96('0x26')]])){_0x58d149[_0xcb96('0x13')][_0x3eff81[_0xcb96('0x26')]]=new VoiceQueue(_0x3eff81);}else{_0x58d149['mergeFromDatabase'](_0x58d149['voiceQueues'][_0x3eff81[_0xcb96('0x26')]],_0x3eff81);}}}return _0x58d149[_0xcb96('0x13')];};};Realtime[_0xcb96('0x3f')][_0xcb96('0x48')]=function(){var _0x516f67=this;return function(_0x55cd99){if(_0x55cd99){freeIsNotKey(_0x55cd99,_0x516f67['triggers'],'id');for(var _0x2902b1=0x0,_0x1bb8e2={},_0x481ef7={};_0x2902b1<_0x55cd99['length'];_0x2902b1+=0x1){_0x1bb8e2=_0x55cd99[_0x2902b1];if(_[_0xcb96('0x43')](_0x516f67[_0xcb96('0x14')][_0x1bb8e2['id']])){_0x516f67[_0xcb96('0x14')][_0x1bb8e2['id']]=new Trigger(_0x1bb8e2);}else{_0x516f67['mergeFromDatabase'](_0x516f67['triggers'][_0x1bb8e2['id']],_0x1bb8e2);}}}return _0x516f67[_0xcb96('0x14')];};};Realtime[_0xcb96('0x3f')][_0xcb96('0x49')]=function(){var _0x9f07db=this;return function(_0x19b5bf){if(_0x19b5bf){freeIsNotKey(_0x19b5bf,_0x9f07db[_0xcb96('0x15')],'id');for(var _0xf3578e=0x0,_0x33fef9={},_0x59a81a={};_0xf3578e<_0x19b5bf[_0xcb96('0x41')];_0xf3578e+=0x1){_0x33fef9=_0x19b5bf[_0xf3578e];if(_['isUndefined'](_0x9f07db[_0xcb96('0x15')][_0x33fef9['id']])){_0x9f07db[_0xcb96('0x15')][_0x33fef9['id']]=new Template(_0x33fef9);}else{_0x9f07db[_0xcb96('0x44')](_0x9f07db['templates'][_0x33fef9['id']],_0x33fef9);}}}return _0x9f07db[_0xcb96('0x15')];};};Realtime[_0xcb96('0x3f')][_0xcb96('0x4a')]=function(){var _0x7499a7=this;return function(_0x2c4fd4){if(_0x2c4fd4){freeIsNotKey(_0x2c4fd4,_0x7499a7[_0xcb96('0x1c')],'id');for(var _0x4a6ffe=0x0,_0x19c4b9={},_0x58415b={};_0x4a6ffe<_0x2c4fd4['length'];_0x4a6ffe+=0x1){_0x19c4b9=_0x2c4fd4[_0x4a6ffe];if(_[_0xcb96('0x43')](_0x7499a7[_0xcb96('0x1c')][_0x19c4b9['id']])){_0x7499a7[_0xcb96('0x1c')][_0x19c4b9['id']]=new ZendeskAccount(_0x19c4b9);}else{_0x7499a7[_0xcb96('0x44')](_0x7499a7[_0xcb96('0x1c')][_0x19c4b9['id']],_0x19c4b9);}}}return _0x7499a7[_0xcb96('0x1c')];};};Realtime['prototype'][_0xcb96('0x4b')]=function(){var _0x1966ec=this;return function(_0x243fd8){if(_0x243fd8){freeIsNotKey(_0x243fd8,_0x1966ec[_0xcb96('0x1d')],'id');for(var _0x13023c=0x0,_0x1e17d7={},_0x507d0f={};_0x13023c<_0x243fd8['length'];_0x13023c+=0x1){_0x1e17d7=_0x243fd8[_0x13023c];if(_[_0xcb96('0x43')](_0x1966ec[_0xcb96('0x1d')][_0x1e17d7['id']])){_0x1966ec[_0xcb96('0x1d')][_0x1e17d7['id']]=new SalesforceAccount(_0x1e17d7);}else{_0x1966ec['mergeFromDatabase'](_0x1966ec[_0xcb96('0x1d')][_0x1e17d7['id']],_0x1e17d7);}}}return _0x1966ec[_0xcb96('0x1d')];};};Realtime[_0xcb96('0x3f')][_0xcb96('0x4c')]=function(){var _0x259329=this;return function(_0x4fe340){if(_0x4fe340){freeIsNotKey(_0x4fe340,_0x259329['freshdeskAccounts'],'id');for(var _0x1e8a34=0x0,_0x3c9e98={},_0x39cf3a={};_0x1e8a34<_0x4fe340[_0xcb96('0x41')];_0x1e8a34+=0x1){_0x3c9e98=_0x4fe340[_0x1e8a34];if(_[_0xcb96('0x43')](_0x259329['freshdeskAccounts'][_0x3c9e98['id']])){_0x259329[_0xcb96('0x1f')][_0x3c9e98['id']]=new FreshdeskAccount(_0x3c9e98);}else{_0x259329[_0xcb96('0x44')](_0x259329[_0xcb96('0x1f')][_0x3c9e98['id']],_0x3c9e98);}}}return _0x259329['freshdeskAccounts'];};};Realtime[_0xcb96('0x3f')][_0xcb96('0x4d')]=function(){var _0x4993f6=this;return function(_0x16e886){if(_0x16e886){freeIsNotKey(_0x16e886,_0x4993f6[_0xcb96('0x20')],'id');for(var _0x524908=0x0,_0x2ac4cd={},_0xaa96af={};_0x524908<_0x16e886[_0xcb96('0x41')];_0x524908+=0x1){_0x2ac4cd=_0x16e886[_0x524908];if(_[_0xcb96('0x43')](_0x4993f6[_0xcb96('0x20')][_0x2ac4cd['id']])){_0x4993f6[_0xcb96('0x20')][_0x2ac4cd['id']]=new ZohoAccount(_0x2ac4cd);}else{_0x4993f6[_0xcb96('0x44')](_0x4993f6[_0xcb96('0x20')][_0x2ac4cd['id']],_0x2ac4cd);}}}return _0x4993f6[_0xcb96('0x20')];};};Realtime[_0xcb96('0x3f')][_0xcb96('0x4e')]=function(){var _0x359bc3=this;return function(_0x2e4db1){if(_0x2e4db1){freeIsNotKey(_0x2e4db1,_0x359bc3[_0xcb96('0x21')],'id');for(var _0x161ef8=0x0,_0x2cac25={},_0x314b1c={};_0x161ef8<_0x2e4db1[_0xcb96('0x41')];_0x161ef8+=0x1){_0x2cac25=_0x2e4db1[_0x161ef8];if(_[_0xcb96('0x43')](_0x359bc3[_0xcb96('0x21')][_0x2cac25['id']])){_0x359bc3['deskAccounts'][_0x2cac25['id']]=new DeskAccount(_0x2cac25);}else{_0x359bc3[_0xcb96('0x44')](_0x359bc3[_0xcb96('0x21')][_0x2cac25['id']],_0x2cac25);}}}return _0x359bc3[_0xcb96('0x21')];};};Realtime[_0xcb96('0x3f')][_0xcb96('0x4f')]=function(){var _0x4e0c73=this;return function(_0x2f2f5b){if(_0x2f2f5b){freeIsNotKey(_0x2f2f5b,_0x4e0c73[_0xcb96('0x1e')],'id');for(var _0x2a1577=0x0,_0x35e68d={},_0x3ece62={};_0x2a1577<_0x2f2f5b['length'];_0x2a1577+=0x1){_0x35e68d=_0x2f2f5b[_0x2a1577];if(_['isUndefined'](_0x4e0c73[_0xcb96('0x1e')][_0x35e68d['id']])){_0x4e0c73[_0xcb96('0x1e')][_0x35e68d['id']]=new SugarcrmAccount(_0x35e68d);}else{_0x4e0c73[_0xcb96('0x44')](_0x4e0c73[_0xcb96('0x1e')][_0x35e68d['id']],_0x35e68d);}}}return _0x4e0c73[_0xcb96('0x1e')];};};Realtime[_0xcb96('0x3f')][_0xcb96('0x50')]=function(){var _0xef4910=this;return function(_0x49a15b){if(_0x49a15b){freeIsNotKey(_0x49a15b,_0xef4910[_0xcb96('0x51')],'id');for(var _0x1e1b36=0x0,_0x180a9f={},_0x2b727e={};_0x1e1b36<_0x49a15b[_0xcb96('0x41')];_0x1e1b36+=0x1){_0x180a9f=_0x49a15b[_0x1e1b36];if(_[_0xcb96('0x43')](_0xef4910[_0xcb96('0x51')][_0x180a9f['id']])){_0xef4910[_0xcb96('0x51')][_0x180a9f['id']]=new VtigerAccount(_0x180a9f);}else{_0xef4910[_0xcb96('0x44')](_0xef4910['vtigerAccounts'][_0x180a9f['id']],_0x180a9f);}}}return _0xef4910['vtigerAccounts'];};};Realtime['prototype'][_0xcb96('0x52')]=function(){var _0x4c489e=this;return function(_0x38177f){if(_0x38177f){freeIsNotKey(_0x38177f,_0x4c489e[_0xcb96('0x22')],'id');for(var _0xf6f0db=0x0,_0x2676a1={},_0x160fda={};_0xf6f0db<_0x38177f[_0xcb96('0x41')];_0xf6f0db+=0x1){_0x2676a1=_0x38177f[_0xf6f0db];if(_[_0xcb96('0x43')](_0x4c489e[_0xcb96('0x22')][_0x2676a1['id']])){_0x4c489e[_0xcb96('0x22')][_0x2676a1['id']]=new ServicenowAccount(_0x2676a1);}else{_0x4c489e['mergeFromDatabase'](_0x4c489e['servicenowAccounts'][_0x2676a1['id']],_0x2676a1);}}}return _0x4c489e[_0xcb96('0x22')];};};Realtime[_0xcb96('0x3f')][_0xcb96('0x53')]=function(){var _0xd68814=this;return function(_0x446d79){if(_0x446d79){freeIsNotKey(_0x446d79,_0xd68814[_0xcb96('0x54')],'id');for(var _0x55318b=0x0,_0x566f78={},_0x588ddf={};_0x55318b<_0x446d79[_0xcb96('0x41')];_0x55318b+=0x1){_0x566f78=_0x446d79[_0x55318b];if(_[_0xcb96('0x43')](_0xd68814[_0xcb96('0x54')][_0x566f78['id']])){_0xd68814[_0xcb96('0x54')][_0x566f78['id']]=new Dynamics365Account(_0x566f78);}else{_0xd68814['mergeFromDatabase'](_0xd68814[_0xcb96('0x54')][_0x566f78['id']],_0x566f78);}}}return _0xd68814[_0xcb96('0x54')];};};Realtime[_0xcb96('0x3f')][_0xcb96('0x55')]=function(){var _0x28af48=this;return function(_0x2b4c92){if(_0x2b4c92){freeIsNotKey(_0x2b4c92,_0x28af48[_0xcb96('0x23')],'id');for(var _0x465f69=0x0,_0x33e1d4={},_0x810b3a={};_0x465f69<_0x2b4c92[_0xcb96('0x41')];_0x465f69+=0x1){_0x33e1d4=_0x2b4c92[_0x465f69];if(_[_0xcb96('0x43')](_0x28af48[_0xcb96('0x23')][_0x33e1d4['id']])){_0x28af48['freshsalesAccounts'][_0x33e1d4['id']]=new FreshsalesAccount(_0x33e1d4);}else{_0x28af48[_0xcb96('0x44')](_0x28af48[_0xcb96('0x23')][_0x33e1d4['id']],_0x33e1d4);}}}return _0x28af48[_0xcb96('0x23')];};};Realtime['prototype'][_0xcb96('0x56')]=function(){var _0x5aa100=this;return function(_0x2d3a3b){for(var _0x1af25a=0x0;_0x1af25a<_0x2d3a3b[_0xcb96('0x41')];_0x1af25a+=0x1){_['merge'](_0x5aa100[_0xcb96('0x13')][_0x2d3a3b[_0x1af25a]['name']],_0x2d3a3b[_0x1af25a]);}return _0x5aa100[_0xcb96('0x13')];};};Realtime[_0xcb96('0x3f')][_0xcb96('0x57')]=function(){var _0x6a4189=this;return function(_0x5b6bba){clearVoiceQueues(_0x6a4189[_0xcb96('0x13')]);if(_0x5b6bba){_0x5b6bba=_[_0xcb96('0x58')](_0x5b6bba,_0xcb96('0x59'));for(var _0x489fe8 in _0x5b6bba){if(_0x5b6bba[_0xcb96('0x27')](_0x489fe8)){var _0x543c15={};for(var _0x15e945=0x0;_0x15e945<_0x5b6bba[_0x489fe8][_0xcb96('0x41')];_0x15e945+=0x1){var _0x5f054c=_0x5b6bba[_0x489fe8][_0x15e945][_0xcb96('0x5a')];if(_0x6a4189[_0xcb96('0x13')][_0x5f054c]){if(_0x5b6bba[_0x489fe8][_0x15e945][_0xcb96('0x5b')]){_0x6a4189[_0xcb96('0x13')][_0x5f054c]['unmanaged']+=0x1;}if(_0x5b6bba[_0x489fe8][_0x15e945][_0xcb96('0x5c')]){_0x6a4189[_0xcb96('0x13')][_0x5f054c][_0xcb96('0x31')]+=0x1;}_0x6a4189[_0xcb96('0x13')][_0x5f054c][_0xcb96('0x2c')]+=moment(_0x5b6bba[_0x489fe8][_0x15e945]['queuecallerleaveAt'])['diff'](moment(_0x5b6bba[_0x489fe8][_0x15e945]['queuecallerjoinAt']),'seconds')||0x0;if(_0x15e945===_0x5b6bba[_0x489fe8][_0xcb96('0x41')]-0x1){_0x6a4189[_0xcb96('0x13')][_0x5f054c][_0xcb96('0x5d')]+=moment(_0x5b6bba[_0x489fe8][_0x15e945][_0xcb96('0x5e')]||_0x5b6bba[_0x489fe8][_0x15e945][_0xcb96('0x5f')]||_0x5b6bba[_0x489fe8][_0x15e945]['queuecallerexitAt'])[_0xcb96('0x60')](moment(_0x5b6bba[_0x489fe8][_0x15e945]['queuecallerjoinAt']),_0xcb96('0x61'))||0x0;_0x6a4189[_0xcb96('0x13')][_0x5f054c][_0xcb96('0x2b')]+=0x1;if(_0x5b6bba[_0x489fe8][_0x15e945][_0xcb96('0x62')]){_0x6a4189[_0xcb96('0x13')][_0x5f054c]['answered']+=0x1;_0x6a4189[_0xcb96('0x13')][_0x5f054c][_0xcb96('0x2d')]+=moment(_0x5b6bba[_0x489fe8][_0x15e945][_0xcb96('0x5e')])[_0xcb96('0x60')](moment(_0x5b6bba[_0x489fe8][_0x15e945]['queuecallerleaveAt']),_0xcb96('0x61'))||0x0;}}else{_0x6a4189[_0xcb96('0x13')][_0x5f054c][_0xcb96('0x5d')]+=_0x6a4189[_0xcb96('0x13')][_0x5f054c][_0xcb96('0x2c')]||0x0;}}}}}}return _0x6a4189[_0xcb96('0x13')];};};Realtime['prototype'][_0xcb96('0x63')]=function(){var _0x3c2b9e=this;return function(_0x39c834){clearVoiceCallReports(_0x3c2b9e['outbound']);if(_0x39c834){for(var _0x5d3e39=0x0;_0x5d3e39<_0x39c834[_0xcb96('0x41')];_0x5d3e39+=0x1){_0x3c2b9e[_0xcb96('0x16')][_0xcb96('0x2b')]+=0x1;_0x3c2b9e['outbound'][_0xcb96('0x5d')]+=_0x39c834[_0x5d3e39][_0xcb96('0x64')];if(_0x39c834[_0x5d3e39][_0xcb96('0x65')]==='ANSWERED'){_0x3c2b9e[_0xcb96('0x16')][_0xcb96('0x66')]+=0x1;_0x3c2b9e[_0xcb96('0x16')]['sumHoldTime']+=_0x39c834[_0x5d3e39][_0xcb96('0x64')]-_0x39c834[_0x5d3e39][_0xcb96('0x67')]||0x0;_0x3c2b9e[_0xcb96('0x16')][_0xcb96('0x2d')]+=_0x39c834[_0x5d3e39][_0xcb96('0x67')];}}}return _0x3c2b9e[_0xcb96('0x16')];};};Realtime[_0xcb96('0x3f')][_0xcb96('0x68')]=function(){var _0x3431db=this;return function(_0x4d8ef4){if(_0x4d8ef4){freeIsNotKey(_0x4d8ef4,_0x3431db['campaigns'],_0xcb96('0x26'));for(var _0x4a4181=0x0,_0x2ea5d2={};_0x4a4181<_0x4d8ef4[_0xcb96('0x41')];_0x4a4181+=0x1){_0x2ea5d2=_0x4d8ef4[_0x4a4181];if(_[_0xcb96('0x43')](_0x3431db['campaigns'][_0x2ea5d2['name']])){_0x3431db[_0xcb96('0x69')][_0x2ea5d2[_0xcb96('0x26')]]=new Campaign(_0x2ea5d2);}else{_0x3431db[_0xcb96('0x44')](_0x3431db[_0xcb96('0x69')][_0x2ea5d2['name']],_0x2ea5d2);_0x3431db['campaigns'][_0x2ea5d2['name']][_0xcb96('0x6a')]=_0x2ea5d2[_0xcb96('0x6b')]?_0x2ea5d2[_0xcb96('0x6b')][_0xcb96('0x26')]:undefined;}}}return _0x3431db[_0xcb96('0x69')];};};Realtime[_0xcb96('0x3f')][_0xcb96('0x6c')]=function(){var _0x2ea889=this;return function(_0x50b020){if(_0x50b020){freeIsNotKey(_0x50b020,_0x2ea889[_0xcb96('0x17')],'id');for(var _0x3daae7=0x0,_0x3f6264={};_0x3daae7<_0x50b020[_0xcb96('0x41')];_0x3daae7+=0x1){_0x3f6264=_0x50b020[_0x3daae7];if(_[_0xcb96('0x43')](_0x2ea889[_0xcb96('0x17')][_0x3f6264['id']])){_0x2ea889[_0xcb96('0x17')][_0x3f6264['id']]=new VoiceExtension(_0x3f6264);}else{_0x2ea889['mergeFromDatabase'](_0x2ea889[_0xcb96('0x17')][_0x3f6264['id']],_0x3f6264);}}}return _0x2ea889[_0xcb96('0x17')];};};Realtime[_0xcb96('0x3f')][_0xcb96('0x6d')]=function(){var _0x163b60=this;return function(_0x39a66b){clearCampaigns(_0x163b60[_0xcb96('0x69')]);for(var _0x33251b=0x0;_0x33251b<_0x39a66b[_0xcb96('0x41')];_0x33251b+=0x1){_[_0xcb96('0x6e')](_0x163b60[_0xcb96('0x69')][_0x39a66b[_0x33251b]['name']],_0x39a66b[_0x33251b]);}return _0x163b60[_0xcb96('0x69')];};};Realtime[_0xcb96('0x3f')]['initFaxAccounts']=function(){var _0x18cc38=this;return function(_0x59bbac){if(_0x59bbac){freeIsNotKey(_0x59bbac,_0x18cc38[_0xcb96('0x24')],'id');for(var _0x2a4c1f=0x0,_0x31c2d0={},_0x23e5cf={};_0x2a4c1f<_0x59bbac['length'];_0x2a4c1f+=0x1){_0x31c2d0=_0x59bbac[_0x2a4c1f];if(_[_0xcb96('0x43')](_0x18cc38[_0xcb96('0x24')][_0x31c2d0['id']])){_0x18cc38[_0xcb96('0x24')][_0x31c2d0['id']]=new FaxAccount(_0x31c2d0);}else{_0x18cc38[_0xcb96('0x44')](_0x18cc38['faxAccounts'][_0x31c2d0['id']],_0x31c2d0);}}}return _0x18cc38[_0xcb96('0x24')];};};module['exports']=Realtime;
\ No newline at end of file
+var _0xdb96=['sumDuration','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','name','initTelephones','telephones','length','isUndefined','initTrunks','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initServicenowAccounts','servicenowAccounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','queue','queuecallerexit','unmanaged','queuecallerabandon','diff','queuecallerjoinAt','seconds','queuecallerabandonAt','queuecallerexitAt','answered','queuecallercompleteAt','queuecallerleaveAt','duration','disposition','ANSWERED','billableseconds','initCampaigns','SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','util','lodash','../model/agent','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/salesforceAccount','../model/deskAccount','../model/dynamics365Account','agents','trunks','voiceQueues','triggers','campaigns','templates','outbound','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','isNil','interface','total','sumHoldTime','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','abandoned'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xdb96,0x17e));var _0x6db9=function(_0x5f1a6a,_0x3cac07){_0x5f1a6a=_0x5f1a6a-0x0;var _0x3c8568=_0xdb96[_0x5f1a6a];return _0x3c8568;};'use strict';var BPromise=require('bluebird');var util=require(_0x6db9('0x0'));var _=require(_0x6db9('0x1'));var moment=require('moment');var Agent=require(_0x6db9('0x2'));var Telephone=require('../model/telephone');var Trunk=require(_0x6db9('0x3'));var VoiceQueue=require(_0x6db9('0x4'));var Trigger=require(_0x6db9('0x5'));var Template=require(_0x6db9('0x6'));var Campaign=require(_0x6db9('0x7'));var VoiceExtension=require(_0x6db9('0x8'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0x6db9('0x9'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0x6db9('0xa'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0x6db9('0xb'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0x6db9('0xc')]={};this['telephones']={};this[_0x6db9('0xd')]={};this[_0x6db9('0xe')]={};this[_0x6db9('0xf')]={};this[_0x6db9('0x10')]={};this[_0x6db9('0x11')]={};this[_0x6db9('0x12')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this['channels']={};this[_0x6db9('0x13')]={};this[_0x6db9('0x14')]={};this[_0x6db9('0x15')]={};this[_0x6db9('0x16')]={};this[_0x6db9('0x17')]={};this[_0x6db9('0x18')]={};this[_0x6db9('0x19')]={};this[_0x6db9('0x1a')]={};this[_0x6db9('0x1b')]={};this[_0x6db9('0x1c')]={};this[_0x6db9('0x1d')]={};this['servicenowAccounts']={};this[_0x6db9('0x1e')]={};this[_0x6db9('0x1f')]={};this[_0x6db9('0x20')]={};};function freeIsNotKey(_0x60b385,_0x1849f6,_0x79da7){var _0x1d4966=_[_0x6db9('0x21')](_0x60b385,function(_0x2821b8,_0x1af002){return _0x2821b8[_0x79da7];});for(var _0x51945a in _0x1849f6){if(_0x1849f6[_0x6db9('0x22')](_0x51945a)){if(!_0x1d4966[_0x51945a]){delete _0x1849f6[_0x51945a];}}}}function freeIsNotKeySip(_0x4d1e2a,_0x24d4e8){var _0x55a786=_['mapKeys'](_0x4d1e2a,function(_0x2ff786,_0x4629b7){return util[_0x6db9('0x23')](_0x6db9('0x24'),_0x2ff786['name']);});for(var _0xaa0562 in _0x24d4e8){if(_0x24d4e8[_0x6db9('0x22')](_0xaa0562)){if(!_0x55a786[_0xaa0562]){delete _0x24d4e8[_0xaa0562];}}}}function freeIsNotKeyAgent(_0xb78041,_0x5ef08d){var _0xa6bc2b=_[_0x6db9('0x21')](_0xb78041,function(_0x111f62,_0x32c321){var _0x1d34cd=_[_0x6db9('0x25')](_0x111f62[_0x6db9('0x26')])?util['format'](_0x6db9('0x24'),_0x111f62['name']):_0x111f62[_0x6db9('0x26')];return _0x1d34cd;});for(var _0x45945a in _0x5ef08d){if(_0x5ef08d[_0x6db9('0x22')](_0x45945a)){if(!_0xa6bc2b[_0x45945a]){delete _0x5ef08d[_0x45945a];}}}}function clearVoiceCallReports(_0x4cab47){_0x4cab47[_0x6db9('0x27')]=0x0;_0x4cab47['answered']=0x0;_0x4cab47[_0x6db9('0x28')]=0x0;_0x4cab47['sumDuration']=0x0;_0x4cab47[_0x6db9('0x29')]=0x0;}function clearCampaigns(_0x1ef6d7){if(!_[_0x6db9('0x2a')](_0x1ef6d7)){for(var _0x2a63b8 in _0x1ef6d7){if(_0x1ef6d7[_0x6db9('0x22')](_0x2a63b8)){_0x1ef6d7[_0x2a63b8][_0x6db9('0x2b')]=0x0;_0x1ef6d7[_0x2a63b8][_0x6db9('0x2c')]=0x0;}}}}function clearVoiceQueues(_0x1f555a){if(!_['isEmpty'](_0x1f555a)){for(var _0x47bf1e in _0x1f555a){if(_0x1f555a[_0x6db9('0x22')](_0x47bf1e)){_0x1f555a[_0x47bf1e][_0x6db9('0x27')]=0x0;_0x1f555a[_0x47bf1e]['answered']=0x0;_0x1f555a[_0x47bf1e]['unmanaged']=0x0;_0x1f555a[_0x47bf1e][_0x6db9('0x2d')]=0x0;_0x1f555a[_0x47bf1e][_0x6db9('0x28')]=0x0;_0x1f555a[_0x47bf1e][_0x6db9('0x2e')]=0x0;_0x1f555a[_0x47bf1e][_0x6db9('0x29')]=0x0;_0x1f555a[_0x47bf1e]['outboundAnswerAgiCallsDay']=0x0;_0x1f555a[_0x47bf1e][_0x6db9('0x2f')]=0x0;_0x1f555a[_0x47bf1e]['outboundBusyCallsDay']=0x0;_0x1f555a[_0x47bf1e][_0x6db9('0x30')]=0x0;_0x1f555a[_0x47bf1e][_0x6db9('0x31')]=0x0;_0x1f555a[_0x47bf1e][_0x6db9('0x32')]=0x0;_0x1f555a[_0x47bf1e][_0x6db9('0x33')]=0x0;_0x1f555a[_0x47bf1e][_0x6db9('0x34')]=0x0;_0x1f555a[_0x47bf1e][_0x6db9('0x35')]=0x0;_0x1f555a[_0x47bf1e][_0x6db9('0x36')]=0x0;_0x1f555a[_0x47bf1e][_0x6db9('0x37')]=0x0;_0x1f555a[_0x47bf1e][_0x6db9('0x38')]=0x0;_0x1f555a[_0x47bf1e][_0x6db9('0x39')]=0x0;_0x1f555a[_0x47bf1e][_0x6db9('0x3a')]=0x0;_0x1f555a[_0x47bf1e][_0x6db9('0x3b')]=!![];}}}}Realtime[_0x6db9('0x3c')][_0x6db9('0x3d')]=function(_0x3cf213,_0x2b92e2){for(var _0x43d4d1 in _0x2b92e2){if(_0x3cf213['hasOwnProperty'](_0x43d4d1)){_0x3cf213[_0x43d4d1]=_0x2b92e2[_0x43d4d1];}}};Realtime[_0x6db9('0x3c')][_0x6db9('0x3e')]=function(){var _0x4454fd=this;return function(_0x2dc6aa){if(_0x2dc6aa){freeIsNotKeyAgent(_0x2dc6aa,_0x4454fd[_0x6db9('0xc')]);for(var _0x15b12f=0x0,_0x10c5d8={},_0x3004a6={};_0x15b12f<_0x2dc6aa['length'];_0x15b12f+=0x1){_0x10c5d8=_0x2dc6aa[_0x15b12f];var _0x949a2d=_[_0x6db9('0x25')](_0x10c5d8[_0x6db9('0x26')])?util[_0x6db9('0x23')](_0x6db9('0x24'),_0x10c5d8[_0x6db9('0x3f')]):_0x10c5d8[_0x6db9('0x26')];if(_['isUndefined'](_0x4454fd[_0x6db9('0xc')][_0x949a2d])){_0x4454fd[_0x6db9('0xc')][_0x949a2d]=new Agent(_0x10c5d8);}else{_0x4454fd['mergeFromDatabase'](_0x4454fd['agents'][_0x949a2d],_0x10c5d8);}}}return _0x4454fd[_0x6db9('0xc')];};};Realtime['prototype'][_0x6db9('0x40')]=function(){var _0x1b0994=this;return function(_0x4d5c3d){if(_0x4d5c3d){freeIsNotKeySip(_0x4d5c3d,_0x1b0994[_0x6db9('0x41')]);for(var _0x19fb88=0x0,_0x2f40bd={},_0x19979e={};_0x19fb88<_0x4d5c3d[_0x6db9('0x42')];_0x19fb88+=0x1){_0x2f40bd=_0x4d5c3d[_0x19fb88];if(_[_0x6db9('0x43')](_0x1b0994[_0x6db9('0x41')][util[_0x6db9('0x23')]('SIP/%s',_0x2f40bd['name'])])){_0x1b0994[_0x6db9('0x41')][util[_0x6db9('0x23')](_0x6db9('0x24'),_0x2f40bd[_0x6db9('0x3f')])]=new Telephone(_0x2f40bd);}else{_0x1b0994[_0x6db9('0x3d')](_0x1b0994[_0x6db9('0x41')][util['format'](_0x6db9('0x24'),_0x2f40bd[_0x6db9('0x3f')])],_0x2f40bd);}}}return _0x1b0994['telephones'];};};Realtime[_0x6db9('0x3c')][_0x6db9('0x44')]=function(){var _0x32403a=this;return function(_0x25b2d2){if(_0x25b2d2){freeIsNotKeySip(_0x25b2d2,_0x32403a['trunks']);for(var _0x4a8f73=0x0,_0x4f0b78={},_0xdccebb={};_0x4a8f73<_0x25b2d2[_0x6db9('0x42')];_0x4a8f73+=0x1){_0x4f0b78=_0x25b2d2[_0x4a8f73];if(_[_0x6db9('0x43')](_0x32403a['trunks'][util[_0x6db9('0x23')](_0x6db9('0x24'),_0x4f0b78[_0x6db9('0x3f')])])){_0x32403a[_0x6db9('0xd')][util[_0x6db9('0x23')](_0x6db9('0x24'),_0x4f0b78[_0x6db9('0x3f')])]=new Trunk(_0x4f0b78);}else{_0x32403a[_0x6db9('0x3d')](_0x32403a['trunks'][util[_0x6db9('0x23')]('SIP/%s',_0x4f0b78[_0x6db9('0x3f')])],_0x4f0b78);}}}return _0x32403a[_0x6db9('0xd')];};};Realtime[_0x6db9('0x3c')][_0x6db9('0x45')]=function(){var _0x3a1aea=this;return function(_0x4c83ad){if(_0x4c83ad){freeIsNotKey(_0x4c83ad,_0x3a1aea[_0x6db9('0xe')],'name');for(var _0x3399bc=0x0,_0x22f0aa={},_0x20bee2={};_0x3399bc<_0x4c83ad[_0x6db9('0x42')];_0x3399bc+=0x1){_0x22f0aa=_0x4c83ad[_0x3399bc];if(_[_0x6db9('0x43')](_0x3a1aea[_0x6db9('0xe')][_0x22f0aa[_0x6db9('0x3f')]])){_0x3a1aea[_0x6db9('0xe')][_0x22f0aa['name']]=new VoiceQueue(_0x22f0aa);}else{_0x3a1aea['mergeFromDatabase'](_0x3a1aea[_0x6db9('0xe')][_0x22f0aa['name']],_0x22f0aa);}}}return _0x3a1aea['voiceQueues'];};};Realtime[_0x6db9('0x3c')][_0x6db9('0x46')]=function(){var _0x212c89=this;return function(_0x558c30){if(_0x558c30){freeIsNotKey(_0x558c30,_0x212c89['triggers'],'id');for(var _0x59ded5=0x0,_0x215365={},_0xbc8edb={};_0x59ded5<_0x558c30[_0x6db9('0x42')];_0x59ded5+=0x1){_0x215365=_0x558c30[_0x59ded5];if(_['isUndefined'](_0x212c89[_0x6db9('0xf')][_0x215365['id']])){_0x212c89[_0x6db9('0xf')][_0x215365['id']]=new Trigger(_0x215365);}else{_0x212c89[_0x6db9('0x3d')](_0x212c89[_0x6db9('0xf')][_0x215365['id']],_0x215365);}}}return _0x212c89[_0x6db9('0xf')];};};Realtime[_0x6db9('0x3c')][_0x6db9('0x47')]=function(){var _0x3de465=this;return function(_0x4265c5){if(_0x4265c5){freeIsNotKey(_0x4265c5,_0x3de465[_0x6db9('0x11')],'id');for(var _0x2830fa=0x0,_0x356295={},_0x1ec255={};_0x2830fa<_0x4265c5[_0x6db9('0x42')];_0x2830fa+=0x1){_0x356295=_0x4265c5[_0x2830fa];if(_[_0x6db9('0x43')](_0x3de465[_0x6db9('0x11')][_0x356295['id']])){_0x3de465[_0x6db9('0x11')][_0x356295['id']]=new Template(_0x356295);}else{_0x3de465[_0x6db9('0x3d')](_0x3de465[_0x6db9('0x11')][_0x356295['id']],_0x356295);}}}return _0x3de465[_0x6db9('0x11')];};};Realtime['prototype'][_0x6db9('0x48')]=function(){var _0x23f6cc=this;return function(_0x13610d){if(_0x13610d){freeIsNotKey(_0x13610d,_0x23f6cc[_0x6db9('0x17')],'id');for(var _0x5c4bce=0x0,_0x55f81c={},_0x4499b4={};_0x5c4bce<_0x13610d[_0x6db9('0x42')];_0x5c4bce+=0x1){_0x55f81c=_0x13610d[_0x5c4bce];if(_[_0x6db9('0x43')](_0x23f6cc[_0x6db9('0x17')][_0x55f81c['id']])){_0x23f6cc[_0x6db9('0x17')][_0x55f81c['id']]=new ZendeskAccount(_0x55f81c);}else{_0x23f6cc['mergeFromDatabase'](_0x23f6cc[_0x6db9('0x17')][_0x55f81c['id']],_0x55f81c);}}}return _0x23f6cc[_0x6db9('0x17')];};};Realtime['prototype']['initSalesforceAccounts']=function(){var _0xc06d26=this;return function(_0x21b818){if(_0x21b818){freeIsNotKey(_0x21b818,_0xc06d26[_0x6db9('0x18')],'id');for(var _0x186bb9=0x0,_0x531fb0={},_0x48e246={};_0x186bb9<_0x21b818['length'];_0x186bb9+=0x1){_0x531fb0=_0x21b818[_0x186bb9];if(_[_0x6db9('0x43')](_0xc06d26[_0x6db9('0x18')][_0x531fb0['id']])){_0xc06d26[_0x6db9('0x18')][_0x531fb0['id']]=new SalesforceAccount(_0x531fb0);}else{_0xc06d26['mergeFromDatabase'](_0xc06d26['salesforceAccounts'][_0x531fb0['id']],_0x531fb0);}}}return _0xc06d26[_0x6db9('0x18')];};};Realtime[_0x6db9('0x3c')][_0x6db9('0x49')]=function(){var _0x576f0a=this;return function(_0x1ba6df){if(_0x1ba6df){freeIsNotKey(_0x1ba6df,_0x576f0a['freshdeskAccounts'],'id');for(var _0xdaaf14=0x0,_0x805c60={},_0x209699={};_0xdaaf14<_0x1ba6df[_0x6db9('0x42')];_0xdaaf14+=0x1){_0x805c60=_0x1ba6df[_0xdaaf14];if(_['isUndefined'](_0x576f0a['freshdeskAccounts'][_0x805c60['id']])){_0x576f0a[_0x6db9('0x1a')][_0x805c60['id']]=new FreshdeskAccount(_0x805c60);}else{_0x576f0a[_0x6db9('0x3d')](_0x576f0a[_0x6db9('0x1a')][_0x805c60['id']],_0x805c60);}}}return _0x576f0a[_0x6db9('0x1a')];};};Realtime['prototype'][_0x6db9('0x4a')]=function(){var _0xf79808=this;return function(_0x3fa38e){if(_0x3fa38e){freeIsNotKey(_0x3fa38e,_0xf79808[_0x6db9('0x1b')],'id');for(var _0x3359e6=0x0,_0xbf7c70={},_0x8c55bb={};_0x3359e6<_0x3fa38e[_0x6db9('0x42')];_0x3359e6+=0x1){_0xbf7c70=_0x3fa38e[_0x3359e6];if(_[_0x6db9('0x43')](_0xf79808['zohoAccounts'][_0xbf7c70['id']])){_0xf79808[_0x6db9('0x1b')][_0xbf7c70['id']]=new ZohoAccount(_0xbf7c70);}else{_0xf79808[_0x6db9('0x3d')](_0xf79808['zohoAccounts'][_0xbf7c70['id']],_0xbf7c70);}}}return _0xf79808[_0x6db9('0x1b')];};};Realtime[_0x6db9('0x3c')][_0x6db9('0x4b')]=function(){var _0x1d02c9=this;return function(_0x7048d9){if(_0x7048d9){freeIsNotKey(_0x7048d9,_0x1d02c9['deskAccounts'],'id');for(var _0x5be344=0x0,_0x20f2e4={},_0x4883b8={};_0x5be344<_0x7048d9[_0x6db9('0x42')];_0x5be344+=0x1){_0x20f2e4=_0x7048d9[_0x5be344];if(_[_0x6db9('0x43')](_0x1d02c9['deskAccounts'][_0x20f2e4['id']])){_0x1d02c9[_0x6db9('0x1c')][_0x20f2e4['id']]=new DeskAccount(_0x20f2e4);}else{_0x1d02c9[_0x6db9('0x3d')](_0x1d02c9[_0x6db9('0x1c')][_0x20f2e4['id']],_0x20f2e4);}}}return _0x1d02c9[_0x6db9('0x1c')];};};Realtime[_0x6db9('0x3c')][_0x6db9('0x4c')]=function(){var _0x710f3a=this;return function(_0x1269fd){if(_0x1269fd){freeIsNotKey(_0x1269fd,_0x710f3a['sugarcrmAccounts'],'id');for(var _0x341eeb=0x0,_0xe96c4a={},_0x8e31e4={};_0x341eeb<_0x1269fd[_0x6db9('0x42')];_0x341eeb+=0x1){_0xe96c4a=_0x1269fd[_0x341eeb];if(_[_0x6db9('0x43')](_0x710f3a[_0x6db9('0x19')][_0xe96c4a['id']])){_0x710f3a[_0x6db9('0x19')][_0xe96c4a['id']]=new SugarcrmAccount(_0xe96c4a);}else{_0x710f3a[_0x6db9('0x3d')](_0x710f3a['sugarcrmAccounts'][_0xe96c4a['id']],_0xe96c4a);}}}return _0x710f3a[_0x6db9('0x19')];};};Realtime['prototype']['initVtigerAccounts']=function(){var _0x173f17=this;return function(_0x748955){if(_0x748955){freeIsNotKey(_0x748955,_0x173f17[_0x6db9('0x1d')],'id');for(var _0x433302=0x0,_0xa9bec3={},_0x21725b={};_0x433302<_0x748955['length'];_0x433302+=0x1){_0xa9bec3=_0x748955[_0x433302];if(_['isUndefined'](_0x173f17[_0x6db9('0x1d')][_0xa9bec3['id']])){_0x173f17['vtigerAccounts'][_0xa9bec3['id']]=new VtigerAccount(_0xa9bec3);}else{_0x173f17[_0x6db9('0x3d')](_0x173f17[_0x6db9('0x1d')][_0xa9bec3['id']],_0xa9bec3);}}}return _0x173f17[_0x6db9('0x1d')];};};Realtime[_0x6db9('0x3c')][_0x6db9('0x4d')]=function(){var _0x147da2=this;return function(_0x5e588b){if(_0x5e588b){freeIsNotKey(_0x5e588b,_0x147da2[_0x6db9('0x4e')],'id');for(var _0x50958a=0x0,_0x489513={},_0x1fd0c4={};_0x50958a<_0x5e588b[_0x6db9('0x42')];_0x50958a+=0x1){_0x489513=_0x5e588b[_0x50958a];if(_[_0x6db9('0x43')](_0x147da2[_0x6db9('0x4e')][_0x489513['id']])){_0x147da2['servicenowAccounts'][_0x489513['id']]=new ServicenowAccount(_0x489513);}else{_0x147da2[_0x6db9('0x3d')](_0x147da2[_0x6db9('0x4e')][_0x489513['id']],_0x489513);}}}return _0x147da2['servicenowAccounts'];};};Realtime[_0x6db9('0x3c')]['initDynamics365Accounts']=function(){var _0x14f417=this;return function(_0x490caf){if(_0x490caf){freeIsNotKey(_0x490caf,_0x14f417[_0x6db9('0x1e')],'id');for(var _0x31430d=0x0,_0x337a7a={},_0x62ba44={};_0x31430d<_0x490caf[_0x6db9('0x42')];_0x31430d+=0x1){_0x337a7a=_0x490caf[_0x31430d];if(_[_0x6db9('0x43')](_0x14f417[_0x6db9('0x1e')][_0x337a7a['id']])){_0x14f417[_0x6db9('0x1e')][_0x337a7a['id']]=new Dynamics365Account(_0x337a7a);}else{_0x14f417[_0x6db9('0x3d')](_0x14f417[_0x6db9('0x1e')][_0x337a7a['id']],_0x337a7a);}}}return _0x14f417[_0x6db9('0x1e')];};};Realtime['prototype'][_0x6db9('0x4f')]=function(){var _0x1b7c54=this;return function(_0x5055ed){if(_0x5055ed){freeIsNotKey(_0x5055ed,_0x1b7c54['freshsalesAccounts'],'id');for(var _0x5306b5=0x0,_0xf8648e={},_0x1854e5={};_0x5306b5<_0x5055ed[_0x6db9('0x42')];_0x5306b5+=0x1){_0xf8648e=_0x5055ed[_0x5306b5];if(_[_0x6db9('0x43')](_0x1b7c54[_0x6db9('0x1f')][_0xf8648e['id']])){_0x1b7c54[_0x6db9('0x1f')][_0xf8648e['id']]=new FreshsalesAccount(_0xf8648e);}else{_0x1b7c54['mergeFromDatabase'](_0x1b7c54[_0x6db9('0x1f')][_0xf8648e['id']],_0xf8648e);}}}return _0x1b7c54[_0x6db9('0x1f')];};};Realtime[_0x6db9('0x3c')][_0x6db9('0x50')]=function(){var _0x538633=this;return function(_0x5afc70){for(var _0x596ec6=0x0;_0x596ec6<_0x5afc70[_0x6db9('0x42')];_0x596ec6+=0x1){_[_0x6db9('0x51')](_0x538633[_0x6db9('0xe')][_0x5afc70[_0x596ec6][_0x6db9('0x3f')]],_0x5afc70[_0x596ec6]);}return _0x538633[_0x6db9('0xe')];};};Realtime['prototype'][_0x6db9('0x52')]=function(){var _0x453b95=this;return function(_0x1d30f7){clearVoiceQueues(_0x453b95[_0x6db9('0xe')]);if(_0x1d30f7){_0x1d30f7=_[_0x6db9('0x53')](_0x1d30f7,'uniqueid');for(var _0xfb8638 in _0x1d30f7){if(_0x1d30f7[_0x6db9('0x22')](_0xfb8638)){var _0x413e44={};for(var _0xf08fc6=0x0;_0xf08fc6<_0x1d30f7[_0xfb8638]['length'];_0xf08fc6+=0x1){var _0xc9fc4b=_0x1d30f7[_0xfb8638][_0xf08fc6][_0x6db9('0x54')];if(_0x453b95['voiceQueues'][_0xc9fc4b]){if(_0x1d30f7[_0xfb8638][_0xf08fc6][_0x6db9('0x55')]){_0x453b95[_0x6db9('0xe')][_0xc9fc4b][_0x6db9('0x56')]+=0x1;}if(_0x1d30f7[_0xfb8638][_0xf08fc6][_0x6db9('0x57')]){_0x453b95[_0x6db9('0xe')][_0xc9fc4b]['abandoned']+=0x1;}_0x453b95[_0x6db9('0xe')][_0xc9fc4b][_0x6db9('0x28')]+=moment(_0x1d30f7[_0xfb8638][_0xf08fc6]['queuecallerleaveAt'])[_0x6db9('0x58')](moment(_0x1d30f7[_0xfb8638][_0xf08fc6][_0x6db9('0x59')]),_0x6db9('0x5a'))||0x0;if(_0xf08fc6===_0x1d30f7[_0xfb8638][_0x6db9('0x42')]-0x1){_0x453b95[_0x6db9('0xe')][_0xc9fc4b][_0x6db9('0x2e')]+=moment(_0x1d30f7[_0xfb8638][_0xf08fc6]['queuecallercompleteAt']||_0x1d30f7[_0xfb8638][_0xf08fc6][_0x6db9('0x5b')]||_0x1d30f7[_0xfb8638][_0xf08fc6][_0x6db9('0x5c')])[_0x6db9('0x58')](moment(_0x1d30f7[_0xfb8638][_0xf08fc6]['queuecallerjoinAt']),_0x6db9('0x5a'))||0x0;_0x453b95[_0x6db9('0xe')][_0xc9fc4b][_0x6db9('0x27')]+=0x1;if(_0x1d30f7[_0xfb8638][_0xf08fc6]['queuecallercomplete']){_0x453b95[_0x6db9('0xe')][_0xc9fc4b][_0x6db9('0x5d')]+=0x1;_0x453b95['voiceQueues'][_0xc9fc4b][_0x6db9('0x29')]+=moment(_0x1d30f7[_0xfb8638][_0xf08fc6][_0x6db9('0x5e')])[_0x6db9('0x58')](moment(_0x1d30f7[_0xfb8638][_0xf08fc6][_0x6db9('0x5f')]),'seconds')||0x0;}}else{_0x453b95['voiceQueues'][_0xc9fc4b]['sumDuration']+=_0x453b95[_0x6db9('0xe')][_0xc9fc4b][_0x6db9('0x28')]||0x0;}}}}}}return _0x453b95[_0x6db9('0xe')];};};Realtime[_0x6db9('0x3c')]['initVoiceCallReports']=function(){var _0x4cfcdb=this;return function(_0x3bf11b){clearVoiceCallReports(_0x4cfcdb[_0x6db9('0x12')]);if(_0x3bf11b){for(var _0xb3d6a2=0x0;_0xb3d6a2<_0x3bf11b[_0x6db9('0x42')];_0xb3d6a2+=0x1){_0x4cfcdb[_0x6db9('0x12')][_0x6db9('0x27')]+=0x1;_0x4cfcdb[_0x6db9('0x12')][_0x6db9('0x2e')]+=_0x3bf11b[_0xb3d6a2][_0x6db9('0x60')];if(_0x3bf11b[_0xb3d6a2][_0x6db9('0x61')]===_0x6db9('0x62')){_0x4cfcdb[_0x6db9('0x12')][_0x6db9('0x5d')]+=0x1;_0x4cfcdb['outbound']['sumHoldTime']+=_0x3bf11b[_0xb3d6a2]['duration']-_0x3bf11b[_0xb3d6a2][_0x6db9('0x63')]||0x0;_0x4cfcdb[_0x6db9('0x12')][_0x6db9('0x29')]+=_0x3bf11b[_0xb3d6a2][_0x6db9('0x63')];}}}return _0x4cfcdb[_0x6db9('0x12')];};};Realtime['prototype'][_0x6db9('0x64')]=function(){var _0x46c19b=this;return function(_0x3d966a){if(_0x3d966a){freeIsNotKey(_0x3d966a,_0x46c19b[_0x6db9('0x10')],_0x6db9('0x3f'));for(var _0x70519c=0x0,_0x1740ca={};_0x70519c<_0x3d966a[_0x6db9('0x42')];_0x70519c+=0x1){_0x1740ca=_0x3d966a[_0x70519c];if(_[_0x6db9('0x43')](_0x46c19b[_0x6db9('0x10')][_0x1740ca[_0x6db9('0x3f')]])){_0x46c19b['campaigns'][_0x1740ca['name']]=new Campaign(_0x1740ca);}else{_0x46c19b[_0x6db9('0x3d')](_0x46c19b[_0x6db9('0x10')][_0x1740ca[_0x6db9('0x3f')]],_0x1740ca);_0x46c19b[_0x6db9('0x10')][_0x1740ca['name']]['dialQueueProject']=_0x1740ca[_0x6db9('0x65')]?_0x1740ca[_0x6db9('0x65')]['name']:undefined;}}}return _0x46c19b[_0x6db9('0x10')];};};Realtime[_0x6db9('0x3c')][_0x6db9('0x66')]=function(){var _0x35f501=this;return function(_0x1472c4){if(_0x1472c4){freeIsNotKey(_0x1472c4,_0x35f501[_0x6db9('0x67')],'id');for(var _0x482139=0x0,_0x27cb4b={};_0x482139<_0x1472c4[_0x6db9('0x42')];_0x482139+=0x1){_0x27cb4b=_0x1472c4[_0x482139];if(_[_0x6db9('0x43')](_0x35f501[_0x6db9('0x67')][_0x27cb4b['id']])){_0x35f501['voiceExtensions'][_0x27cb4b['id']]=new VoiceExtension(_0x27cb4b);}else{_0x35f501[_0x6db9('0x3d')](_0x35f501[_0x6db9('0x67')][_0x27cb4b['id']],_0x27cb4b);}}}return _0x35f501[_0x6db9('0x67')];};};Realtime['prototype'][_0x6db9('0x68')]=function(){var _0x1ad117=this;return function(_0x4bcbca){clearCampaigns(_0x1ad117[_0x6db9('0x10')]);for(var _0x194467=0x0;_0x194467<_0x4bcbca[_0x6db9('0x42')];_0x194467+=0x1){_[_0x6db9('0x51')](_0x1ad117[_0x6db9('0x10')][_0x4bcbca[_0x194467][_0x6db9('0x3f')]],_0x4bcbca[_0x194467]);}return _0x1ad117[_0x6db9('0x10')];};};Realtime[_0x6db9('0x3c')][_0x6db9('0x69')]=function(){var _0x140b03=this;return function(_0x3c793c){if(_0x3c793c){freeIsNotKey(_0x3c793c,_0x140b03['faxAccounts'],'id');for(var _0x5cee88=0x0,_0x3faae3={},_0x5e7245={};_0x5cee88<_0x3c793c[_0x6db9('0x42')];_0x5cee88+=0x1){_0x3faae3=_0x3c793c[_0x5cee88];if(_[_0x6db9('0x43')](_0x140b03[_0x6db9('0x20')][_0x3faae3['id']])){_0x140b03[_0x6db9('0x20')][_0x3faae3['id']]=new FaxAccount(_0x3faae3);}else{_0x140b03[_0x6db9('0x3d')](_0x140b03[_0x6db9('0x20')][_0x3faae3['id']],_0x3faae3);}}}return _0x140b03[_0x6db9('0x20')];};};module[_0x6db9('0x6a')]=Realtime;
\ No newline at end of file
index 7a1cdc2..262d890 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd00b=['../rpc/memberReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','bind','voiceDialReport','blindtransfer','attendedtransfer','findAgent','find','accountcode','name','interface','SIP/%s','connectedlinenum','assigned','lastAssignedTo','format','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','create','match','keys','length','getCallType','channel','split','getAgentByInternal','outbound','internal','type','lastdata','queue','context','from-voip-provider','callerid','from-sip','destination','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','disposition','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','blindTransfer','isNil','UserId','membername','monitors','monitorFilename','filename','createdAt','connectedlinename','exten','xcally-motion-dialer','isArray','forEach','startsWith','Local','substring','indexOf','mobile','lastIndexOf','attendedTransfer','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport'];(function(_0x51b581,_0x2d971d){var _0x555c10=function(_0x3ce220){while(--_0x3ce220){_0x51b581['push'](_0x51b581['shift']());}};_0x555c10(++_0x2d971d);}(_0xd00b,0x169));var _0xbd00=function(_0x180cfb,_0x1be116){_0x180cfb=_0x180cfb-0x0;var _0x1449e4=_0xd00b[_0x180cfb];return _0x1449e4;};'use strict';var _=require(_0xbd00('0x0'));var moment=require(_0xbd00('0x1'));var util=require(_0xbd00('0x2'));var config=require(_0xbd00('0x3'));var ami=require(_0xbd00('0x4'));var RpcVoiceAgentReport=require(_0xbd00('0x5'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0xbd00('0x6'));var RpcMemberReport=require(_0xbd00('0x7'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0xbd00('0x8'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0xbd00('0x9'));var VoiceCallReport=require(_0xbd00('0xa'));var VoiceAgentReport=require(_0xbd00('0xb'));var VoiceDialReport=require(_0xbd00('0xc'));var UserReport=require(_0xbd00('0xd'));function Report(_0x4f4a9b){this[_0xbd00('0xe')]=_0x4f4a9b;this[_0xbd00('0xf')]=_0x4f4a9b[_0xbd00('0xf')];this[_0xbd00('0x10')]=_0x4f4a9b[_0xbd00('0x10')];}Report[_0xbd00('0x11')][_0xbd00('0x12')]=function(_0x2fbb6e){var _0x504828=new VoiceQueueReport(this[_0xbd00('0xe')]);var _0x2518b0=new VoiceAgentReport(this[_0xbd00('0xe')]);var _0x5e3f56=new VoiceDialReport(this[_0xbd00('0xe')]);var _0x411f7f=new VoiceCallReport(this[_0xbd00('0xe')]);var _0x461888=new UserReport(this[_0xbd00('0xe')]);if(config[_0xbd00('0x13')]&&config['xdr']['disabled']){ami['on'](_0xbd00('0x14'),this[_0xbd00('0x15')]['bind'](this));ami['on'](_0xbd00('0x16'),this[_0xbd00('0x17')]['bind'](this));ami['on'](_0xbd00('0x18'),this[_0xbd00('0x19')][_0xbd00('0x1a')](this));ami['on']('custom:voiceDialReport',this[_0xbd00('0x1b')][_0xbd00('0x1a')](this));ami['on'](_0xbd00('0x1c'),this['blindTransfer'][_0xbd00('0x1a')](this));ami['on'](_0xbd00('0x1d'),this['attendedTransfer']['bind'](this));}};Report[_0xbd00('0x11')][_0xbd00('0x1e')]=function(_0x194443){var _0x4008d0;_0x4008d0=_[_0xbd00('0x1f')](this[_0xbd00('0xf')],function(_0x17dcb0){return _0x17dcb0[_0xbd00('0x20')]==_0x194443||_0x17dcb0[_0xbd00('0x21')]==_0x194443;});if(_['isNil'](_0x4008d0)){var _0x39ef15=_['find'](this[_0xbd00('0x10')],function(_0x528263){return _0x528263[_0xbd00('0x20')]==_0x194443||_0x528263[_0xbd00('0x21')]==_0x194443;});if(_0x39ef15){_0x4008d0=_['find'](this['agents'],function(_0x5227ef){return _0x5227ef[_0xbd00('0x22')]==util['format'](_0xbd00('0x23'),_0x39ef15[_0xbd00('0x21')]);});}}return _0x4008d0;};Report[_0xbd00('0x11')][_0xbd00('0x15')]=function(_0xa02998){for(var _0x29b8a8=0x0;_0x29b8a8<_0xa02998['length'];_0x29b8a8+=0x1){var _0x4e0ba4=this[_0xbd00('0x1e')](_0xa02998[_0x29b8a8][_0xbd00('0x24')]);if(_0x4e0ba4){_0xa02998[_0x29b8a8]['accountcode']=_0x4e0ba4['accountcode'];_0xa02998[_0x29b8a8][_0xbd00('0x25')]=!![];_0xa02998[_0x29b8a8][_0xbd00('0x26')]=_0x4e0ba4[_0xbd00('0x21')];_0xa02998[_0x29b8a8][_0xbd00('0x22')]=_['isNil'](_0x4e0ba4[_0xbd00('0x22')])?util[_0xbd00('0x27')](_0xbd00('0x23'),_0x4e0ba4[_0xbd00('0x21')]):_0x4e0ba4[_0xbd00('0x22')];if(_0xa02998[_0x29b8a8]['queuecallercomplete']){_0xa02998[_0x29b8a8]['queuecallercompleteAt']=moment()['format'](_0xbd00('0x28'));}if(_0xa02998[_0x29b8a8][_0xbd00('0x29')]){_0xa02998[_0x29b8a8]['queuecallerexitAt']=moment()[_0xbd00('0x27')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0xbd00('0x15')](_0xa02998[_0x29b8a8]);}RpcVoiceQueueReport[_0xbd00('0x2a')](_0xa02998[_0x29b8a8]);}};function extractCalleridNumber(_0x32f924){var _0x2bb719=_0x32f924[_0xbd00('0x2b')](/<(.*?)>/);return _0x2bb719?_0x2bb719[0x1]:_0x32f924;}Report[_0xbd00('0x11')]['getAgentByInternal']=function(_0x262dc4){for(var _0x2cb740=0x0;_0x2cb740<Object[_0xbd00('0x2c')](this['agents'])[_0xbd00('0x2d')];_0x2cb740++){var _0x652168=Object['keys'](this[_0xbd00('0xf')])[_0x2cb740];var _0x25d567=this[_0xbd00('0xf')][_0x652168];if(_0x25d567['accountcode']===Number(_0x262dc4))return _0x25d567;}return null;};Report[_0xbd00('0x11')][_0xbd00('0x2e')]=function(_0x5a34c8){var _0x386a17=_0x5a34c8[_0xbd00('0x2f')][_0xbd00('0x30')]('-')[0x0];var _0x46d82f=this[_0xbd00('0xf')][_0x386a17];if(!_0x46d82f)_0x46d82f=this[_0xbd00('0x31')](_0x5a34c8['calleridnum']);return!_0x46d82f?_0xbd00('0x32'):_0xbd00('0x33');};Report['prototype'][_0xbd00('0x17')]=function(_0x414589){_0x414589['destination']=_0x414589['destination']||_0x414589['exten'];if(_0x414589[_0xbd00('0x34')]=='dialer'){_0x414589['lastapplication']='queue';_0x414589[_0xbd00('0x35')]=_0x414589[_0xbd00('0x36')];if(_0x414589[_0xbd00('0x37')]==_0xbd00('0x38')){_0x414589[_0xbd00('0x20')]='';_0x414589['destination']=extractCalleridNumber(_0x414589[_0xbd00('0x39')]);}else if(_0x414589[_0xbd00('0x37')]==_0xbd00('0x3a')){if(_0x414589[_0xbd00('0x3b')]==_0xbd00('0x3c')){_0x414589['destination']=extractCalleridNumber(_0x414589[_0xbd00('0x3d')]);_0x414589[_0xbd00('0x3e')]=_0x414589[_0xbd00('0x3f')];_0x414589[_0xbd00('0x40')]=[_0x414589[_0xbd00('0x2f')],_0x414589[_0xbd00('0x2f')]=_0x414589['destinationchannel']][0x0];_0x414589[_0xbd00('0x39')]=_0x414589['calleridpreview'];}else{_0x414589[_0xbd00('0x3b')]=_0x414589[_0xbd00('0x3e')];_0x414589['calleridnum']=_0x414589[_0xbd00('0x3f')];if(_0x414589[_0xbd00('0x41')]=='ANSWERED'){_0x414589[_0xbd00('0x20')]=_0x414589[_0xbd00('0x24')];}else{_0x414589[_0xbd00('0x20')]='';}}}}else{_0x414589[_0xbd00('0x39')]=util[_0xbd00('0x27')]('\x22%s\x22\x20<%s>',_0x414589[_0xbd00('0x42')],_0x414589[_0xbd00('0x3e')]);}if(RpcVoiceTransferReport[_0xbd00('0x43')][_0x414589['linkedid']]){var _0xacd234=RpcVoiceTransferReport[_0xbd00('0x43')][_0x414589[_0xbd00('0x44')]];_0xacd234[_0xbd00('0x45')]=_0x414589[_0xbd00('0x46')];RpcVoiceTransferReport[_0xbd00('0x47')](_0xacd234);delete RpcVoiceTransferReport[_0xbd00('0x43')][_0x414589[_0xbd00('0x44')]];}if(_['isNil'](_0x414589[_0xbd00('0x34')])){_0x414589['type']=this[_0xbd00('0x2e')](_0x414589);}if(_[_0xbd00('0x48')](_0x414589['UserId'])){var _0x53e039=_0x414589['channel'][_0xbd00('0x30')]('-')[0x0];var _0x33bd31=this[_0xbd00('0xf')][_0x53e039];if(!_0x33bd31)_0x33bd31=this[_0xbd00('0x31')](_0x414589[_0xbd00('0x20')]);if(_0x33bd31){_0x414589[_0xbd00('0x49')]=_0x33bd31['id'];_0x414589[_0xbd00('0x4a')]=_0x33bd31[_0xbd00('0x21')];}}RpcVoiceCallReport[_0xbd00('0x2a')](_0x414589);if(_0x414589['monitor']){for(var _0x4c997c=0x0;_0x4c997c<_0x414589[_0xbd00('0x4b')][_0xbd00('0x2d')];_0x4c997c+=0x1){_0x414589[_0xbd00('0x4c')]=_0x414589[_0xbd00('0x4b')][_0x4c997c][_0xbd00('0x4d')];_0x414589[_0xbd00('0x4e')]=_0x414589[_0xbd00('0x4b')][_0x4c997c][_0xbd00('0x4e')];if(_0x414589['exten']=='xcally-motion-preview'){_0x414589[_0xbd00('0x3e')]=_0x414589[_0xbd00('0x24')];_0x414589[_0xbd00('0x42')]=_0x414589['connectedlinename'];_0x414589[_0xbd00('0x24')]=_0x414589['accountcode'];_0x414589[_0xbd00('0x4f')]=_0x414589[_0xbd00('0x4a')];_0x414589[_0xbd00('0x50')]=_0x414589[_0xbd00('0x3f')];}else if(_0x414589[_0xbd00('0x50')]==_0xbd00('0x51')){_0x414589[_0xbd00('0x3e')]=_0x414589['destination'];_0x414589['exten']=_0x414589[_0xbd00('0x3f')];}RpcVoiceRecording['create'](_0x414589);}}};Report[_0xbd00('0x11')][_0xbd00('0x19')]=function(_0x359162){if(_[_0xbd00('0x52')](_0x359162)){_0x359162[_0xbd00('0x53')](function(_0xafd625){RpcVoiceAgentReport[_0xbd00('0x2a')](_0xafd625);});}else{RpcVoiceAgentReport[_0xbd00('0x2a')](_0x359162);}};Report['prototype'][_0xbd00('0x1b')]=function(_0x52060c){RpcVoiceDialReport[_0xbd00('0x2a')](_0x52060c);var _0x1ad73e;var _0x2d1d05;var _0x3eb9ee=_0x52060c[_0xbd00('0x2f')];if(_[_0xbd00('0x54')](_0x3eb9ee,_0xbd00('0x55'))){_0x2d1d05=_0x3eb9ee[_0xbd00('0x56')](_0x3eb9ee['indexOf']('/')+0x1,_0x3eb9ee[_0xbd00('0x57')]('@'));_0x1ad73e=_[_0xbd00('0x1f')](this['agents'],function(_0x4ae526){return _0x4ae526[_0xbd00('0x58')]==_0x2d1d05||_0x4ae526['phone']==_0x2d1d05||_0x4ae526[_0xbd00('0x20')]==_0x2d1d05;});}else{_0x2d1d05=_0x3eb9ee[_0xbd00('0x56')](_0x3eb9ee[_0xbd00('0x57')]('/')+0x1,_0x3eb9ee[_0xbd00('0x59')]('-'));_0x1ad73e=this[_0xbd00('0x1e')](_0x2d1d05);}if(_0x1ad73e){_0x52060c[_0xbd00('0x22')]=_['isNil'](_0x1ad73e[_0xbd00('0x22')])?util[_0xbd00('0x27')](_0xbd00('0x23'),_0x1ad73e[_0xbd00('0x21')]):_0x1ad73e[_0xbd00('0x22')];_0x52060c[_0xbd00('0x4a')]=_0x1ad73e[_0xbd00('0x21')];_0x52060c[_0xbd00('0x20')]=_0x1ad73e[_0xbd00('0x20')];RpcMemberReport[_0xbd00('0x1b')](_0x52060c);}};Report[_0xbd00('0x11')]['blindTransfer']=function(_0x10b31d){RpcVoiceTransferReport[_0xbd00('0x43')][_0x10b31d['transfererlinkedid']]=_0x10b31d;};Report['prototype'][_0xbd00('0x5a')]=function(_0x131218){RpcVoiceTransferReport['attendedTransfer'](_0x131218);};module[_0xbd00('0x5b')]=Report;
\ No newline at end of file
+var _0xc559=['filename','createdAt','connectedlinename','xcally-motion-dialer','voiceAgentReport','isArray','forEach','startsWith','Local','indexOf','mobile','phone','substring','transfererlinkedid','exports','lodash','moment','../ami','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','findAgent','accountcode','name','isNil','find','interface','format','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','match','getAgentByInternal','keys','getCallType','channel','calleridnum','outbound','internal','exten','type','dialer','lastapplication','queue','lastdata','context','destination','callerid','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','UserId','split','membername','create','monitor','monitors','monitorFilename'];(function(_0x59d1aa,_0x203586){var _0x5732bf=function(_0x2d2bbc){while(--_0x2d2bbc){_0x59d1aa['push'](_0x59d1aa['shift']());}};_0x5732bf(++_0x203586);}(_0xc559,0x6a));var _0x9c55=function(_0x30ffeb,_0x213320){_0x30ffeb=_0x30ffeb-0x0;var _0x3a495c=_0xc559[_0x30ffeb];return _0x3a495c;};'use strict';var _=require(_0x9c55('0x0'));var moment=require(_0x9c55('0x1'));var util=require('util');var config=require('../../../config/environment');var ami=require(_0x9c55('0x2'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x9c55('0x3'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x9c55('0x4'));var VoiceCallReport=require(_0x9c55('0x5'));var VoiceAgentReport=require(_0x9c55('0x6'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require('./userReport');function Report(_0x46c336){this[_0x9c55('0x7')]=_0x46c336;this[_0x9c55('0x8')]=_0x46c336['agents'];this[_0x9c55('0x9')]=_0x46c336['telephones'];}Report[_0x9c55('0xa')][_0x9c55('0xb')]=function(_0x10aabc){var _0x178a7f=new VoiceQueueReport(this[_0x9c55('0x7')]);var _0x3b431b=new VoiceAgentReport(this[_0x9c55('0x7')]);var _0x59d29e=new VoiceDialReport(this[_0x9c55('0x7')]);var _0x3f9f3a=new VoiceCallReport(this[_0x9c55('0x7')]);var _0x48c1d9=new UserReport(this[_0x9c55('0x7')]);if(config[_0x9c55('0xc')]&&config[_0x9c55('0xc')][_0x9c55('0xd')]){ami['on'](_0x9c55('0xe'),this[_0x9c55('0xf')][_0x9c55('0x10')](this));ami['on'](_0x9c55('0x11'),this[_0x9c55('0x12')][_0x9c55('0x10')](this));ami['on']('custom:voiceAgentReport',this['voiceAgentReport']['bind'](this));ami['on'](_0x9c55('0x13'),this[_0x9c55('0x14')]['bind'](this));ami['on'](_0x9c55('0x15'),this[_0x9c55('0x16')][_0x9c55('0x10')](this));ami['on']('attendedtransfer',this[_0x9c55('0x17')]['bind'](this));}};Report['prototype'][_0x9c55('0x18')]=function(_0x20e33a){var _0x1d2c7f;_0x1d2c7f=_['find'](this[_0x9c55('0x8')],function(_0x2d7d37){return _0x2d7d37[_0x9c55('0x19')]==_0x20e33a||_0x2d7d37[_0x9c55('0x1a')]==_0x20e33a;});if(_[_0x9c55('0x1b')](_0x1d2c7f)){var _0xf3dfe0=_[_0x9c55('0x1c')](this[_0x9c55('0x9')],function(_0x11e17c){return _0x11e17c['accountcode']==_0x20e33a||_0x11e17c[_0x9c55('0x1a')]==_0x20e33a;});if(_0xf3dfe0){_0x1d2c7f=_[_0x9c55('0x1c')](this['agents'],function(_0x45c70f){return _0x45c70f[_0x9c55('0x1d')]==util[_0x9c55('0x1e')](_0x9c55('0x1f'),_0xf3dfe0[_0x9c55('0x1a')]);});}}return _0x1d2c7f;};Report[_0x9c55('0xa')][_0x9c55('0xf')]=function(_0xf0a1eb){for(var _0x33adf4=0x0;_0x33adf4<_0xf0a1eb[_0x9c55('0x20')];_0x33adf4+=0x1){var _0x153bd5=this[_0x9c55('0x18')](_0xf0a1eb[_0x33adf4][_0x9c55('0x21')]);if(_0x153bd5){_0xf0a1eb[_0x33adf4][_0x9c55('0x19')]=_0x153bd5['accountcode'];_0xf0a1eb[_0x33adf4][_0x9c55('0x22')]=!![];_0xf0a1eb[_0x33adf4][_0x9c55('0x23')]=_0x153bd5[_0x9c55('0x1a')];_0xf0a1eb[_0x33adf4][_0x9c55('0x1d')]=_['isNil'](_0x153bd5[_0x9c55('0x1d')])?util[_0x9c55('0x1e')](_0x9c55('0x1f'),_0x153bd5['name']):_0x153bd5[_0x9c55('0x1d')];if(_0xf0a1eb[_0x33adf4][_0x9c55('0x24')]){_0xf0a1eb[_0x33adf4][_0x9c55('0x25')]=moment()[_0x9c55('0x1e')](_0x9c55('0x26'));}if(_0xf0a1eb[_0x33adf4]['queuecallerexit']){_0xf0a1eb[_0x33adf4][_0x9c55('0x27')]=moment()[_0x9c55('0x1e')](_0x9c55('0x26'));}RpcMemberReport['voiceQueueReport'](_0xf0a1eb[_0x33adf4]);}RpcVoiceQueueReport['create'](_0xf0a1eb[_0x33adf4]);}};function extractCalleridNumber(_0x344c07){var _0x3e99ed=_0x344c07[_0x9c55('0x28')](/<(.*?)>/);return _0x3e99ed?_0x3e99ed[0x1]:_0x344c07;}Report[_0x9c55('0xa')][_0x9c55('0x29')]=function(_0x111545){for(var _0x4af1c8=0x0;_0x4af1c8<Object[_0x9c55('0x2a')](this['agents'])[_0x9c55('0x20')];_0x4af1c8++){var _0x479333=Object[_0x9c55('0x2a')](this['agents'])[_0x4af1c8];var _0x1abc9c=this[_0x9c55('0x8')][_0x479333];if(_0x1abc9c['accountcode']===Number(_0x111545))return _0x1abc9c;}return null;};Report[_0x9c55('0xa')][_0x9c55('0x2b')]=function(_0x5c66e5){var _0x15f5fc=_0x5c66e5[_0x9c55('0x2c')]['split']('-')[0x0];var _0x4cd9c4=this[_0x9c55('0x8')][_0x15f5fc];if(!_0x4cd9c4)_0x4cd9c4=this[_0x9c55('0x29')](_0x5c66e5[_0x9c55('0x2d')]);return!_0x4cd9c4?_0x9c55('0x2e'):_0x9c55('0x2f');};Report['prototype']['voiceCallReport']=function(_0x39a1f9){_0x39a1f9['destination']=_0x39a1f9['destination']||_0x39a1f9[_0x9c55('0x30')];if(_0x39a1f9[_0x9c55('0x31')]==_0x9c55('0x32')){_0x39a1f9[_0x9c55('0x33')]=_0x9c55('0x34');_0x39a1f9[_0x9c55('0x35')]=_0x39a1f9['queue'];if(_0x39a1f9[_0x9c55('0x36')]=='from-voip-provider'){_0x39a1f9['accountcode']='';_0x39a1f9[_0x9c55('0x37')]=extractCalleridNumber(_0x39a1f9[_0x9c55('0x38')]);}else if(_0x39a1f9['context']=='from-sip'){if(_0x39a1f9[_0x9c55('0x37')]==_0x9c55('0x39')){_0x39a1f9[_0x9c55('0x37')]=extractCalleridNumber(_0x39a1f9[_0x9c55('0x3a')]);_0x39a1f9['calleridnum']=_0x39a1f9[_0x9c55('0x3b')];_0x39a1f9['destinationchannel']=[_0x39a1f9[_0x9c55('0x2c')],_0x39a1f9['channel']=_0x39a1f9[_0x9c55('0x3c')]][0x0];_0x39a1f9[_0x9c55('0x38')]=_0x39a1f9[_0x9c55('0x3a')];}else{_0x39a1f9[_0x9c55('0x37')]=_0x39a1f9[_0x9c55('0x2d')];_0x39a1f9['calleridnum']=_0x39a1f9[_0x9c55('0x3b')];if(_0x39a1f9[_0x9c55('0x3d')]==_0x9c55('0x3e')){_0x39a1f9['accountcode']=_0x39a1f9[_0x9c55('0x21')];}else{_0x39a1f9[_0x9c55('0x19')]='';}}}}else{_0x39a1f9[_0x9c55('0x38')]=util[_0x9c55('0x1e')](_0x9c55('0x3f'),_0x39a1f9[_0x9c55('0x40')],_0x39a1f9['calleridnum']);}if(RpcVoiceTransferReport[_0x9c55('0x41')][_0x39a1f9['linkedid']]){var _0x228d02=RpcVoiceTransferReport['transfers'][_0x39a1f9[_0x9c55('0x42')]];_0x228d02[_0x9c55('0x43')]=_0x39a1f9[_0x9c55('0x44')];RpcVoiceTransferReport[_0x9c55('0x16')](_0x228d02);delete RpcVoiceTransferReport['transfers'][_0x39a1f9[_0x9c55('0x42')]];}if(_[_0x9c55('0x1b')](_0x39a1f9[_0x9c55('0x31')])){_0x39a1f9['type']=this[_0x9c55('0x2b')](_0x39a1f9);}if(_[_0x9c55('0x1b')](_0x39a1f9[_0x9c55('0x45')])){var _0x10817c=_0x39a1f9[_0x9c55('0x2c')][_0x9c55('0x46')]('-')[0x0];var _0x35cfce=this[_0x9c55('0x8')][_0x10817c];if(!_0x35cfce)_0x35cfce=this[_0x9c55('0x29')](_0x39a1f9[_0x9c55('0x19')]);if(_0x35cfce){_0x39a1f9[_0x9c55('0x45')]=_0x35cfce['id'];_0x39a1f9[_0x9c55('0x47')]=_0x35cfce['name'];}}RpcVoiceCallReport[_0x9c55('0x48')](_0x39a1f9);if(_0x39a1f9[_0x9c55('0x49')]){for(var _0x42585a=0x0;_0x42585a<_0x39a1f9[_0x9c55('0x4a')][_0x9c55('0x20')];_0x42585a+=0x1){_0x39a1f9[_0x9c55('0x4b')]=_0x39a1f9[_0x9c55('0x4a')][_0x42585a][_0x9c55('0x4c')];_0x39a1f9[_0x9c55('0x4d')]=_0x39a1f9[_0x9c55('0x4a')][_0x42585a][_0x9c55('0x4d')];if(_0x39a1f9[_0x9c55('0x30')]==_0x9c55('0x39')){_0x39a1f9[_0x9c55('0x2d')]=_0x39a1f9[_0x9c55('0x21')];_0x39a1f9[_0x9c55('0x40')]=_0x39a1f9[_0x9c55('0x4e')];_0x39a1f9['connectedlinenum']=_0x39a1f9['accountcode'];_0x39a1f9['connectedlinename']=_0x39a1f9[_0x9c55('0x47')];_0x39a1f9[_0x9c55('0x30')]=_0x39a1f9['originatecalleridnum'];}else if(_0x39a1f9[_0x9c55('0x30')]==_0x9c55('0x4f')){_0x39a1f9[_0x9c55('0x2d')]=_0x39a1f9[_0x9c55('0x37')];_0x39a1f9[_0x9c55('0x30')]=_0x39a1f9['originatecalleridnum'];}RpcVoiceRecording[_0x9c55('0x48')](_0x39a1f9);}}};Report[_0x9c55('0xa')][_0x9c55('0x50')]=function(_0x4bc689){if(_[_0x9c55('0x51')](_0x4bc689)){_0x4bc689[_0x9c55('0x52')](function(_0x20b5a3){RpcVoiceAgentReport['create'](_0x20b5a3);});}else{RpcVoiceAgentReport[_0x9c55('0x48')](_0x4bc689);}};Report[_0x9c55('0xa')][_0x9c55('0x14')]=function(_0x1b4b85){RpcVoiceDialReport[_0x9c55('0x48')](_0x1b4b85);var _0x33d9a7;var _0x3aa1b1;var _0x4cbd2b=_0x1b4b85['channel'];if(_[_0x9c55('0x53')](_0x4cbd2b,_0x9c55('0x54'))){_0x3aa1b1=_0x4cbd2b['substring'](_0x4cbd2b['indexOf']('/')+0x1,_0x4cbd2b[_0x9c55('0x55')]('@'));_0x33d9a7=_['find'](this['agents'],function(_0x14c2fe){return _0x14c2fe[_0x9c55('0x56')]==_0x3aa1b1||_0x14c2fe[_0x9c55('0x57')]==_0x3aa1b1||_0x14c2fe[_0x9c55('0x19')]==_0x3aa1b1;});}else{_0x3aa1b1=_0x4cbd2b[_0x9c55('0x58')](_0x4cbd2b['indexOf']('/')+0x1,_0x4cbd2b['lastIndexOf']('-'));_0x33d9a7=this[_0x9c55('0x18')](_0x3aa1b1);}if(_0x33d9a7){_0x1b4b85[_0x9c55('0x1d')]=_[_0x9c55('0x1b')](_0x33d9a7['interface'])?util[_0x9c55('0x1e')](_0x9c55('0x1f'),_0x33d9a7[_0x9c55('0x1a')]):_0x33d9a7[_0x9c55('0x1d')];_0x1b4b85[_0x9c55('0x47')]=_0x33d9a7['name'];_0x1b4b85[_0x9c55('0x19')]=_0x33d9a7[_0x9c55('0x19')];RpcMemberReport[_0x9c55('0x14')](_0x1b4b85);}};Report[_0x9c55('0xa')][_0x9c55('0x16')]=function(_0x28a5f9){RpcVoiceTransferReport[_0x9c55('0x41')][_0x28a5f9[_0x9c55('0x59')]]=_0x28a5f9;};Report['prototype'][_0x9c55('0x17')]=function(_0x3df673){RpcVoiceTransferReport[_0x9c55('0x17')](_0x3df673);};module[_0x9c55('0x5a')]=Report;
\ No newline at end of file
index 9454048..4e86feb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa455=['redis','localhost','socket.io-emitter','trunks','agents','registryentry','syncRegistry','registry','devicestatechange','syncDeviceState','bind','peerstatus','syncPeerStatus','resolve','catch','error','inspect','actionDeviceStateList','[userReport][devicestatelist]','then','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','syncRealtimeShow','isNotNull','isUndefined','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','username','debug','[userReport][registry]','find','state','merge','event','[userReport][registry]\x20sending\x20trunk:save\x20event:','trunk:%s','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','toLowerCase','inuse','stateTime','format','telephones','toNumber','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','name','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','indexOf','phone','accountcode','updateStatusRealtime','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','[userReport][peerstatus]','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:save','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','moment','util','ioredis','bluebird','../../../config/logger','ami','../ami','defaults'];(function(_0x98f2a1,_0x239cd5){var _0x37b309=function(_0x392d3c){while(--_0x392d3c){_0x98f2a1['push'](_0x98f2a1['shift']());}};_0x37b309(++_0x239cd5);}(_0xa455,0x12b));var _0x5a45=function(_0x552aa8,_0xd7a372){_0x552aa8=_0x552aa8-0x0;var _0x355ee7=_0xa455[_0x552aa8];return _0x355ee7;};'use strict';var _=require(_0x5a45('0x0'));var moment=require(_0x5a45('0x1'));var util=require(_0x5a45('0x2'));var Redis=require(_0x5a45('0x3'));var BPromise=require(_0x5a45('0x4'));var config=require('../../../config/environment');var logger=require(_0x5a45('0x5'))(_0x5a45('0x6'));var ami=require(_0x5a45('0x7'));config['redis']=_[_0x5a45('0x8')](config[_0x5a45('0x9')],{'host':_0x5a45('0xa'),'port':0x18eb});var io=require(_0x5a45('0xb'))(new Redis(config[_0x5a45('0x9')]));function UserReport(_0xbe43e9){this['trunks']=_0xbe43e9[_0x5a45('0xc')];this[_0x5a45('0xd')]=_0xbe43e9[_0x5a45('0xd')];this['telephones']=_0xbe43e9['telephones'];ami['on'](_0x5a45('0xe'),this[_0x5a45('0xf')]['bind'](this));ami['on'](_0x5a45('0x10'),this[_0x5a45('0xf')]['bind'](this));ami['on'](_0x5a45('0x11'),this[_0x5a45('0x12')][_0x5a45('0x13')](this));ami['on'](_0x5a45('0x14'),this[_0x5a45('0x15')]['bind'](this));return this['syncRealtimeShow']();}function showSipRegistrations(){Promise[_0x5a45('0x16')]()['then'](ami['actionSipShowRegistry']())[_0x5a45('0x17')](function(_0x1bc170){logger[_0x5a45('0x18')]('[userReport][sipshowregistry]',util[_0x5a45('0x19')](_0x1bc170,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x5a45('0x16')]()['then'](ami[_0x5a45('0x1a')]())['catch'](function(_0x4cc115){logger[_0x5a45('0x18')](_0x5a45('0x1b'),util[_0x5a45('0x19')](_0x4cc115,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x5a45('0x16')]()[_0x5a45('0x1c')](ami[_0x5a45('0x1d')]())[_0x5a45('0x17')](function(_0x1208e4){logger['error'](_0x5a45('0x1e'),util[_0x5a45('0x19')](_0x1208e4,{'showHidden':![],'depth':null}));});}UserReport[_0x5a45('0x1f')][_0x5a45('0x20')]=function(){setInterval(function(){BPromise[_0x5a45('0x16')]()['then'](showSipRegistrations())[_0x5a45('0x1c')](listDeviceStates())[_0x5a45('0x1c')](showPeersStatus());},0x32c8);};UserReport['prototype'][_0x5a45('0x21')]=function(_0x481154){return _0x481154!==null&&!_[_0x5a45('0x22')](_0x481154);};UserReport[_0x5a45('0x1f')][_0x5a45('0x23')]=function(_0x53bf80,_0x2dc336,_0x48e5d1){io['to'](_0x53bf80)[_0x5a45('0x23')](_0x2dc336,_0x48e5d1);};UserReport[_0x5a45('0x1f')][_0x5a45('0xf')]=function(_0x1a9326){try{if(this[_0x5a45('0x21')](_0x1a9326)){logger[_0x5a45('0x24')](_0x5a45('0x25'),_0x1a9326[_0x5a45('0x26')],_0x1a9326['state']);logger[_0x5a45('0x27')](_0x5a45('0x28'),util[_0x5a45('0x19')](_0x1a9326,{'showHidden':![],'depth':null}));var _0x55d485=_[_0x5a45('0x29')](this['trunks'],{'defaultuser':_0x1a9326['username']});if(_0x55d485){_0x1a9326['stateRegistry']=_0x1a9326[_0x5a45('0x2a')];_[_0x5a45('0x2b')](_0x55d485,_['omit'](_0x1a9326,[_0x5a45('0x2c'),'actionid',_0x5a45('0x26'),_0x5a45('0x2a')]));logger['debug'](_0x5a45('0x2d'),util['inspect'](_0x55d485,{'showHidden':![],'depth':null}));this[_0x5a45('0x23')](util['format'](_0x5a45('0x2e'),_0x55d485['name']),_0x5a45('0x2f'),_0x55d485);}}}catch(_0x7906b5){logger[_0x5a45('0x18')](_0x5a45('0x28'),util[_0x5a45('0x19')](_0x7906b5,{'showHidden':![],'depth':null}));}};UserReport[_0x5a45('0x1f')]['syncDeviceState']=function(_0x13b31d){try{if(this['isNotNull'](_0x13b31d)){logger['info'](_0x5a45('0x30'),_0x13b31d[_0x5a45('0x31')],_0x13b31d[_0x5a45('0x2a')]);logger[_0x5a45('0x27')](_0x5a45('0x32'),util['inspect'](_0x13b31d,{'showHidden':![],'depth':null}));if(this['agents'][_0x13b31d[_0x5a45('0x31')]]){if(!this[_0x5a45('0xd')][_0x13b31d[_0x5a45('0x31')]][_0x5a45('0x33')]||_0x13b31d[_0x5a45('0x2a')][_0x5a45('0x34')]()==_0x5a45('0x35')){this[_0x5a45('0xd')][_0x13b31d['device']]['local']=![];if(this['agents'][_0x13b31d['device']]['state']!==_0x13b31d[_0x5a45('0x2a')][_0x5a45('0x34')]()){this[_0x5a45('0xd')][_0x13b31d[_0x5a45('0x31')]][_0x5a45('0x36')]=_['toNumber'](moment()[_0x5a45('0x37')]('x'));}this[_0x5a45('0xd')][_0x13b31d[_0x5a45('0x31')]][_0x5a45('0x2a')]=_0x13b31d[_0x5a45('0x2a')][_0x5a45('0x34')]();this[_0x5a45('0xd')][_0x13b31d[_0x5a45('0x31')]]['updateStatusRealtime'](_0x13b31d);}}else if(this[_0x5a45('0x38')][_0x13b31d[_0x5a45('0x31')]]){if(this['telephones'][_0x13b31d[_0x5a45('0x31')]]['state']!==_0x13b31d[_0x5a45('0x2a')][_0x5a45('0x34')]()){this[_0x5a45('0x38')][_0x13b31d[_0x5a45('0x31')]][_0x5a45('0x36')]=_[_0x5a45('0x39')](moment()['format']('x'));}this['telephones'][_0x13b31d[_0x5a45('0x31')]]['state']=_0x13b31d[_0x5a45('0x2a')]['toLowerCase']();logger['debug'](_0x5a45('0x3a'),util['inspect'](this[_0x5a45('0x38')][_0x13b31d[_0x5a45('0x31')]],{'showHidden':![],'depth':null}));this[_0x5a45('0x23')](util[_0x5a45('0x37')](_0x5a45('0x3b'),this[_0x5a45('0x38')][_0x13b31d[_0x5a45('0x31')]][_0x5a45('0x3c')]),'telephone:save',this['telephones'][_0x13b31d[_0x5a45('0x31')]]);}else if(this[_0x5a45('0xc')][_0x13b31d['device']]){if(this['trunks'][_0x13b31d[_0x5a45('0x31')]][_0x5a45('0x2a')]!==_0x13b31d[_0x5a45('0x2a')][_0x5a45('0x34')]()){this[_0x5a45('0xc')][_0x13b31d[_0x5a45('0x31')]][_0x5a45('0x36')]=_[_0x5a45('0x39')](moment()[_0x5a45('0x37')]('x'));}this[_0x5a45('0xc')][_0x13b31d[_0x5a45('0x31')]][_0x5a45('0x2a')]=_0x13b31d[_0x5a45('0x2a')][_0x5a45('0x34')]();logger[_0x5a45('0x27')](_0x5a45('0x3d'),util[_0x5a45('0x19')](this[_0x5a45('0xc')][_0x13b31d['device']],{'showHidden':![],'depth':null}));this['emit'](util[_0x5a45('0x37')](_0x5a45('0x2e'),this['trunks'][_0x13b31d[_0x5a45('0x31')]][_0x5a45('0x3c')]),_0x5a45('0x2f'),this[_0x5a45('0xc')][_0x13b31d[_0x5a45('0x31')]]);}else if(_[_0x5a45('0x3e')](_0x13b31d['device'],_0x5a45('0x3f'))){var _0x134412=_0x13b31d[_0x5a45('0x31')];var _0x274852=_0x134412['substring'](_0x134412[_0x5a45('0x40')]('/')+0x1,_0x134412['indexOf']('@'));var _0x2baf52=_['find'](this[_0x5a45('0xd')],function(_0x8987c8){return _0x8987c8['mobile']==_0x274852||_0x8987c8[_0x5a45('0x41')]==_0x274852||_0x8987c8[_0x5a45('0x42')]==_0x274852;});if(_0x2baf52){if(_0x2baf52[_0x5a45('0x2a')]!==_0x13b31d[_0x5a45('0x2a')][_0x5a45('0x34')]()){_0x2baf52['stateTime']=_[_0x5a45('0x39')](moment()['format']('x'));}_0x2baf52['state']=_0x13b31d[_0x5a45('0x2a')][_0x5a45('0x34')]();_0x2baf52[_0x5a45('0x33')]=!![];_0x2baf52[_0x5a45('0x43')](_0x13b31d);}}}}catch(_0x7c6e6b){logger[_0x5a45('0x18')](_0x5a45('0x32'),util[_0x5a45('0x19')](_0x7c6e6b,{'showHidden':![],'depth':null}));}};UserReport[_0x5a45('0x1f')][_0x5a45('0x15')]=function(_0x433ed9){try{if(this[_0x5a45('0x21')](_0x433ed9)&&this[_0x5a45('0x21')](_0x433ed9[_0x5a45('0x14')])){logger[_0x5a45('0x24')](_0x5a45('0x44'),_0x433ed9[_0x5a45('0x45')],_0x433ed9[_0x5a45('0x46')],_0x433ed9[_0x5a45('0x14')]);logger['debug'](_0x5a45('0x47'),util['inspect'](_0x433ed9,{'showHidden':![],'depth':null}));if(this[_0x5a45('0xd')][_0x433ed9['peer']]){if(!this[_0x5a45('0xd')][_0x433ed9[_0x5a45('0x45')]][_0x5a45('0x33')]||_0x433ed9[_0x5a45('0x14')][_0x5a45('0x34')]()=='registered'){this[_0x5a45('0xd')][_0x433ed9['peer']]['local']=![];this[_0x5a45('0xd')][_0x433ed9[_0x5a45('0x45')]]['status']=_0x433ed9[_0x5a45('0x14')]['toLowerCase']();this[_0x5a45('0xd')][_0x433ed9['peer']][_0x5a45('0x46')]=_0x433ed9[_0x5a45('0x46')];this[_0x5a45('0xd')][_0x433ed9['peer']]['updateStatusRealtime'](_0x433ed9);}}else if(this[_0x5a45('0x38')][_0x433ed9[_0x5a45('0x45')]]){this[_0x5a45('0x38')][_0x433ed9['peer']][_0x5a45('0x48')]=_0x433ed9[_0x5a45('0x14')]['toLowerCase']();this[_0x5a45('0x38')][_0x433ed9['peer']][_0x5a45('0x46')]=_0x433ed9[_0x5a45('0x46')];logger[_0x5a45('0x27')](_0x5a45('0x49'),util['inspect'](this['telephones'][_0x433ed9[_0x5a45('0x45')]],{'showHidden':![],'depth':null}));this[_0x5a45('0x23')](util[_0x5a45('0x37')]('telephone:%s',this[_0x5a45('0x38')][_0x433ed9[_0x5a45('0x45')]]['name']),_0x5a45('0x4a'),this['telephones'][_0x433ed9[_0x5a45('0x45')]]);}else if(this[_0x5a45('0xc')][_0x433ed9['peer']]){this['trunks'][_0x433ed9['peer']]['status']=_0x433ed9['peerstatus'][_0x5a45('0x34')]();this[_0x5a45('0xc')][_0x433ed9[_0x5a45('0x45')]][_0x5a45('0x46')]=_0x433ed9['address'];logger[_0x5a45('0x27')](_0x5a45('0x4b'),util[_0x5a45('0x19')](this[_0x5a45('0xc')][_0x433ed9[_0x5a45('0x45')]],{'showHidden':![],'depth':null}));this[_0x5a45('0x23')](util['format'](_0x5a45('0x2e'),this[_0x5a45('0xc')][_0x433ed9['peer']]['name']),_0x5a45('0x2f'),this[_0x5a45('0xc')][_0x433ed9[_0x5a45('0x45')]]);}}}catch(_0x4e769d){logger[_0x5a45('0x18')](_0x5a45('0x47'),util['inspect'](_0x4e769d,{'showHidden':![],'depth':null}));}};module[_0x5a45('0x4c')]=UserReport;
\ No newline at end of file
+var _0xc708=['telephones','syncRegistry','registry','bind','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','inspect','actionDeviceStateList','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','emit','info','username','state','debug','[userReport][registry]','stateRegistry','omit','event','actionid','format','trunk:%s','name','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','agents','toLowerCase','inuse','stateTime','toNumber','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','indexOf','find','mobile','phone','accountcode','local','updateStatusRealtime','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','address','[userReport][peerstatus]','peer','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','exports','lodash','moment','util','ioredis','bluebird','../../../config/environment','../../../config/logger','ami','redis','defaults','localhost','socket.io-emitter','trunks'];(function(_0x754108,_0x373e87){var _0x1273a4=function(_0xed1e89){while(--_0xed1e89){_0x754108['push'](_0x754108['shift']());}};_0x1273a4(++_0x373e87);}(_0xc708,0x12b));var _0x8c70=function(_0x285d34,_0x42dd2d){_0x285d34=_0x285d34-0x0;var _0x59e21d=_0xc708[_0x285d34];return _0x59e21d;};'use strict';var _=require(_0x8c70('0x0'));var moment=require(_0x8c70('0x1'));var util=require(_0x8c70('0x2'));var Redis=require(_0x8c70('0x3'));var BPromise=require(_0x8c70('0x4'));var config=require(_0x8c70('0x5'));var logger=require(_0x8c70('0x6'))(_0x8c70('0x7'));var ami=require('../ami');config[_0x8c70('0x8')]=_[_0x8c70('0x9')](config[_0x8c70('0x8')],{'host':_0x8c70('0xa'),'port':0x18eb});var io=require(_0x8c70('0xb'))(new Redis(config['redis']));function UserReport(_0x503e65){this['trunks']=_0x503e65[_0x8c70('0xc')];this['agents']=_0x503e65['agents'];this[_0x8c70('0xd')]=_0x503e65[_0x8c70('0xd')];ami['on']('registryentry',this[_0x8c70('0xe')]['bind'](this));ami['on'](_0x8c70('0xf'),this[_0x8c70('0xe')][_0x8c70('0x10')](this));ami['on'](_0x8c70('0x11'),this[_0x8c70('0x12')][_0x8c70('0x10')](this));ami['on'](_0x8c70('0x13'),this[_0x8c70('0x14')][_0x8c70('0x10')](this));return this[_0x8c70('0x15')]();}function showSipRegistrations(){Promise[_0x8c70('0x16')]()[_0x8c70('0x17')](ami[_0x8c70('0x18')]())[_0x8c70('0x19')](function(_0x4cb304){logger[_0x8c70('0x1a')](_0x8c70('0x1b'),util[_0x8c70('0x1c')](_0x4cb304,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x8c70('0x16')]()[_0x8c70('0x17')](ami[_0x8c70('0x1d')]())[_0x8c70('0x19')](function(_0x57b034){logger[_0x8c70('0x1a')](_0x8c70('0x1e'),util['inspect'](_0x57b034,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise['resolve']()['then'](ami[_0x8c70('0x1f')]())['catch'](function(_0x168d90){logger[_0x8c70('0x1a')](_0x8c70('0x20'),util[_0x8c70('0x1c')](_0x168d90,{'showHidden':![],'depth':null}));});}UserReport[_0x8c70('0x21')][_0x8c70('0x15')]=function(){setInterval(function(){BPromise[_0x8c70('0x16')]()[_0x8c70('0x17')](showSipRegistrations())[_0x8c70('0x17')](listDeviceStates())['then'](showPeersStatus());},0x32c8);};UserReport['prototype'][_0x8c70('0x22')]=function(_0x4a716b){return _0x4a716b!==null&&!_[_0x8c70('0x23')](_0x4a716b);};UserReport[_0x8c70('0x21')][_0x8c70('0x24')]=function(_0x75e074,_0x64e13f,_0x50c6fd){io['to'](_0x75e074)[_0x8c70('0x24')](_0x64e13f,_0x50c6fd);};UserReport[_0x8c70('0x21')]['syncRegistry']=function(_0x349d35){try{if(this['isNotNull'](_0x349d35)){logger[_0x8c70('0x25')]('[userReport][registry]\x20registry:%s\x20state:%s',_0x349d35[_0x8c70('0x26')],_0x349d35[_0x8c70('0x27')]);logger[_0x8c70('0x28')](_0x8c70('0x29'),util['inspect'](_0x349d35,{'showHidden':![],'depth':null}));var _0x5945e5=_['find'](this[_0x8c70('0xc')],{'defaultuser':_0x349d35[_0x8c70('0x26')]});if(_0x5945e5){_0x349d35[_0x8c70('0x2a')]=_0x349d35[_0x8c70('0x27')];_['merge'](_0x5945e5,_[_0x8c70('0x2b')](_0x349d35,[_0x8c70('0x2c'),_0x8c70('0x2d'),_0x8c70('0x26'),_0x8c70('0x27')]));logger[_0x8c70('0x28')]('[userReport][registry]\x20sending\x20trunk:save\x20event:',util[_0x8c70('0x1c')](_0x5945e5,{'showHidden':![],'depth':null}));this['emit'](util[_0x8c70('0x2e')](_0x8c70('0x2f'),_0x5945e5[_0x8c70('0x30')]),_0x8c70('0x31'),_0x5945e5);}}}catch(_0xe2c33c){logger['error'](_0x8c70('0x29'),util['inspect'](_0xe2c33c,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x8c70('0x12')]=function(_0x3af3fe){try{if(this[_0x8c70('0x22')](_0x3af3fe)){logger[_0x8c70('0x25')](_0x8c70('0x32'),_0x3af3fe[_0x8c70('0x33')],_0x3af3fe[_0x8c70('0x27')]);logger[_0x8c70('0x28')](_0x8c70('0x34'),util[_0x8c70('0x1c')](_0x3af3fe,{'showHidden':![],'depth':null}));if(this[_0x8c70('0x35')][_0x3af3fe['device']]){if(!this[_0x8c70('0x35')][_0x3af3fe['device']]['local']||_0x3af3fe['state'][_0x8c70('0x36')]()==_0x8c70('0x37')){this['agents'][_0x3af3fe[_0x8c70('0x33')]]['local']=![];if(this[_0x8c70('0x35')][_0x3af3fe['device']][_0x8c70('0x27')]!==_0x3af3fe[_0x8c70('0x27')][_0x8c70('0x36')]()){this[_0x8c70('0x35')][_0x3af3fe[_0x8c70('0x33')]][_0x8c70('0x38')]=_[_0x8c70('0x39')](moment()[_0x8c70('0x2e')]('x'));}this[_0x8c70('0x35')][_0x3af3fe['device']]['state']=_0x3af3fe['state'][_0x8c70('0x36')]();this[_0x8c70('0x35')][_0x3af3fe[_0x8c70('0x33')]]['updateStatusRealtime'](_0x3af3fe);}}else if(this[_0x8c70('0xd')][_0x3af3fe[_0x8c70('0x33')]]){if(this['telephones'][_0x3af3fe[_0x8c70('0x33')]][_0x8c70('0x27')]!==_0x3af3fe[_0x8c70('0x27')][_0x8c70('0x36')]()){this[_0x8c70('0xd')][_0x3af3fe[_0x8c70('0x33')]]['stateTime']=_[_0x8c70('0x39')](moment()[_0x8c70('0x2e')]('x'));}this[_0x8c70('0xd')][_0x3af3fe[_0x8c70('0x33')]][_0x8c70('0x27')]=_0x3af3fe[_0x8c70('0x27')][_0x8c70('0x36')]();logger[_0x8c70('0x28')](_0x8c70('0x3a'),util[_0x8c70('0x1c')](this[_0x8c70('0xd')][_0x3af3fe[_0x8c70('0x33')]],{'showHidden':![],'depth':null}));this[_0x8c70('0x24')](util[_0x8c70('0x2e')](_0x8c70('0x3b'),this[_0x8c70('0xd')][_0x3af3fe[_0x8c70('0x33')]][_0x8c70('0x30')]),_0x8c70('0x3c'),this[_0x8c70('0xd')][_0x3af3fe['device']]);}else if(this[_0x8c70('0xc')][_0x3af3fe[_0x8c70('0x33')]]){if(this['trunks'][_0x3af3fe['device']][_0x8c70('0x27')]!==_0x3af3fe[_0x8c70('0x27')][_0x8c70('0x36')]()){this[_0x8c70('0xc')][_0x3af3fe['device']][_0x8c70('0x38')]=_[_0x8c70('0x39')](moment()[_0x8c70('0x2e')]('x'));}this[_0x8c70('0xc')][_0x3af3fe['device']][_0x8c70('0x27')]=_0x3af3fe[_0x8c70('0x27')][_0x8c70('0x36')]();logger[_0x8c70('0x28')](_0x8c70('0x3d'),util['inspect'](this['trunks'][_0x3af3fe[_0x8c70('0x33')]],{'showHidden':![],'depth':null}));this[_0x8c70('0x24')](util[_0x8c70('0x2e')](_0x8c70('0x2f'),this[_0x8c70('0xc')][_0x3af3fe[_0x8c70('0x33')]][_0x8c70('0x30')]),_0x8c70('0x31'),this[_0x8c70('0xc')][_0x3af3fe[_0x8c70('0x33')]]);}else if(_[_0x8c70('0x3e')](_0x3af3fe[_0x8c70('0x33')],_0x8c70('0x3f'))){var _0x4d8c00=_0x3af3fe[_0x8c70('0x33')];var _0x4ccbb6=_0x4d8c00['substring'](_0x4d8c00['indexOf']('/')+0x1,_0x4d8c00[_0x8c70('0x40')]('@'));var _0x21b72a=_[_0x8c70('0x41')](this['agents'],function(_0x548922){return _0x548922[_0x8c70('0x42')]==_0x4ccbb6||_0x548922[_0x8c70('0x43')]==_0x4ccbb6||_0x548922[_0x8c70('0x44')]==_0x4ccbb6;});if(_0x21b72a){if(_0x21b72a[_0x8c70('0x27')]!==_0x3af3fe[_0x8c70('0x27')]['toLowerCase']()){_0x21b72a[_0x8c70('0x38')]=_[_0x8c70('0x39')](moment()[_0x8c70('0x2e')]('x'));}_0x21b72a[_0x8c70('0x27')]=_0x3af3fe['state']['toLowerCase']();_0x21b72a[_0x8c70('0x45')]=!![];_0x21b72a[_0x8c70('0x46')](_0x3af3fe);}}}}catch(_0x3c58af){logger['error'](_0x8c70('0x34'),util['inspect'](_0x3c58af,{'showHidden':![],'depth':null}));}};UserReport[_0x8c70('0x21')][_0x8c70('0x14')]=function(_0x11ac3f){try{if(this[_0x8c70('0x22')](_0x11ac3f)&&this[_0x8c70('0x22')](_0x11ac3f[_0x8c70('0x13')])){logger[_0x8c70('0x25')](_0x8c70('0x47'),_0x11ac3f['peer'],_0x11ac3f[_0x8c70('0x48')],_0x11ac3f[_0x8c70('0x13')]);logger['debug'](_0x8c70('0x49'),util[_0x8c70('0x1c')](_0x11ac3f,{'showHidden':![],'depth':null}));if(this[_0x8c70('0x35')][_0x11ac3f[_0x8c70('0x4a')]]){if(!this[_0x8c70('0x35')][_0x11ac3f['peer']][_0x8c70('0x45')]||_0x11ac3f[_0x8c70('0x13')][_0x8c70('0x36')]()=='registered'){this[_0x8c70('0x35')][_0x11ac3f[_0x8c70('0x4a')]][_0x8c70('0x45')]=![];this[_0x8c70('0x35')][_0x11ac3f[_0x8c70('0x4a')]][_0x8c70('0x4b')]=_0x11ac3f[_0x8c70('0x13')][_0x8c70('0x36')]();this['agents'][_0x11ac3f[_0x8c70('0x4a')]][_0x8c70('0x48')]=_0x11ac3f['address'];this[_0x8c70('0x35')][_0x11ac3f['peer']][_0x8c70('0x46')](_0x11ac3f);}}else if(this['telephones'][_0x11ac3f[_0x8c70('0x4a')]]){this[_0x8c70('0xd')][_0x11ac3f[_0x8c70('0x4a')]][_0x8c70('0x4b')]=_0x11ac3f['peerstatus'][_0x8c70('0x36')]();this['telephones'][_0x11ac3f[_0x8c70('0x4a')]]['address']=_0x11ac3f[_0x8c70('0x48')];logger[_0x8c70('0x28')](_0x8c70('0x4c'),util[_0x8c70('0x1c')](this['telephones'][_0x11ac3f[_0x8c70('0x4a')]],{'showHidden':![],'depth':null}));this[_0x8c70('0x24')](util[_0x8c70('0x2e')](_0x8c70('0x3b'),this[_0x8c70('0xd')][_0x11ac3f[_0x8c70('0x4a')]][_0x8c70('0x30')]),_0x8c70('0x3c'),this[_0x8c70('0xd')][_0x11ac3f[_0x8c70('0x4a')]]);}else if(this[_0x8c70('0xc')][_0x11ac3f[_0x8c70('0x4a')]]){this[_0x8c70('0xc')][_0x11ac3f[_0x8c70('0x4a')]]['status']=_0x11ac3f['peerstatus'][_0x8c70('0x36')]();this[_0x8c70('0xc')][_0x11ac3f[_0x8c70('0x4a')]][_0x8c70('0x48')]=_0x11ac3f[_0x8c70('0x48')];logger['debug']('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util[_0x8c70('0x1c')](this[_0x8c70('0xc')][_0x11ac3f[_0x8c70('0x4a')]],{'showHidden':![],'depth':null}));this[_0x8c70('0x24')](util[_0x8c70('0x2e')](_0x8c70('0x2f'),this[_0x8c70('0xc')][_0x11ac3f[_0x8c70('0x4a')]][_0x8c70('0x30')]),_0x8c70('0x31'),this[_0x8c70('0xc')][_0x11ac3f['peer']]);}}}catch(_0x44beb7){logger[_0x8c70('0x1a')]('[userReport][peerstatus]',util[_0x8c70('0x1c')](_0x44beb7,{'showHidden':![],'depth':null}));}};module[_0x8c70('0x4d')]=UserReport;
\ No newline at end of file
index 74a79fd..e662dff 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(_0x5c34e5,_0x4100df){var _0x20de23=function(_0x5e8cf1){while(--_0x5e8cf1){_0x5c34e5['push'](_0x5c34e5['shift']());}};_0x20de23(++_0x4100df);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'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(_0x21e09e,_0x1ce4ac){var _0xa417f4=function(_0x38fa4b){while(--_0x38fa4b){_0x21e09e['push'](_0x21e09e['shift']());}};_0xa417f4(++_0x1ce4ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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 c379e41..3e9c4c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4aa=['transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','some','routeid','syncBlindTransfer','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','extension','[%s][voiceCallReport][blindtransfer]\x20event:','transfereecalleridnum','BLIND','transfereruniqueid','transfererchannel','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','exports','util','path','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','../rpc/setting','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','localhost','channels','agents','coreshowchannel','syncNewExten','bind','syncNewChannel','newstate','varset','syncVarSet','syncHangup','newcallerid','attendedtransfer','blindtransfer','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','[voiceCallReport][coreshowchannels]\x20started','error','[voiceCallReport][coreshowchannels]','inspect','isNotNull','isUndefined','prototype','emit','syncNewCallerId','info','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridnum','debug','merge','keys','context','split','connectedlinenum','user:%s','channel','name','user:agentconnect','accountcode','[%s][voiceCallReport][newcallerid]','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','linkedid','blindTransfers','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','exten','starttime','YYYY-MM-DD\x20HH:mm:ss','toNumber','channelstate','pick','from-sip','destconnectedlinenum','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','format','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','appdata','CDR(routeAlias)','applicationdata','subtract','duration','seconds','disposition','includes','lastapplication','lastdata','startsWith','cdr(','match','type','isNil','queue','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','diff','xcally-motion-preview','connectedlinename','calleridname','destinationchannel','UserId','membername','holdtime','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','syncMixMonitorFilename','.wav49','replace','.WAV','monitorFilename','find','monitors','push','rec','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','originatecalleridnum','xmd-destination','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]\x20variable:mixmonitor_filename\x20value:%s','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','length','user:agentcomplete','transferType','resolve','then','isEmpty','getSettings','catch','StopMixMonitor','event','BlindTransfer','outbound','custom:voiceCallReport','syncAttendedTransfer','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:'];(function(_0xc1f09a,_0xadd796){var _0x87f61=function(_0x1377d7){while(--_0x1377d7){_0xc1f09a['push'](_0xc1f09a['shift']());}};_0x87f61(++_0xadd796);}(_0xb4aa,0xdd));var _0xab4a=function(_0x35c3f7,_0x2781eb){_0x35c3f7=_0x35c3f7-0x0;var _0x1bddfb=_0xb4aa[_0x35c3f7];return _0x1bddfb;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0xab4a('0x0'));var path=require(_0xab4a('0x1'));var Redis=require(_0xab4a('0x2'));var config=require(_0xab4a('0x3'));var logger=require(_0xab4a('0x4'))(_0xab4a('0x5'));var ami=require(_0xab4a('0x6'));var Channel=require(_0xab4a('0x7'));var RpcSetting=require(_0xab4a('0x8'));var applications=['set','queue',_0xab4a('0x9'),_0xab4a('0xa'),_0xab4a('0xb'),_0xab4a('0xc')];var dispositions=[_0xab4a('0xd'),_0xab4a('0xe'),_0xab4a('0xe'),_0xab4a('0xd'),_0xab4a('0xd'),'NO\x20ANSWER',_0xab4a('0xf'),_0xab4a('0x10'),_0xab4a('0xe'),_0xab4a('0xe'),'FAILED'];config['redis']=_['defaults'](config[_0xab4a('0x11')],{'host':_0xab4a('0x12'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xab4a('0x11')]));function VoiceCallReport(_0x2375ee){this[_0xab4a('0x13')]=_0x2375ee['channels'];this['agents']=_0x2375ee[_0xab4a('0x14')];this['blindTransfers']={};ami['on'](_0xab4a('0x15'),this[_0xab4a('0x16')][_0xab4a('0x17')](this));ami['on']('newexten',this[_0xab4a('0x16')][_0xab4a('0x17')](this));ami['on']('newchannel',this[_0xab4a('0x18')][_0xab4a('0x17')](this));ami['on'](_0xab4a('0x19'),this['syncNewState'][_0xab4a('0x17')](this));ami['on'](_0xab4a('0x1a'),this[_0xab4a('0x1b')][_0xab4a('0x17')](this));ami['on']('hangup',this[_0xab4a('0x1c')]['bind'](this));ami['on'](_0xab4a('0x1d'),this['syncNewCallerId'][_0xab4a('0x17')](this));ami['on'](_0xab4a('0x1e'),this['syncAttendedTransfer'][_0xab4a('0x17')](this));ami['on'](_0xab4a('0x1f'),this['syncBlindTransfer']['bind'](this));ami['on'](_0xab4a('0x20'),this[_0xab4a('0x21')][_0xab4a('0x17')](this));ami['on']('musiconholdstop',this[_0xab4a('0x22')][_0xab4a('0x17')](this));try{logger['info'](_0xab4a('0x23'));ami['actionCoreShowChannels']();}catch(_0x5dcf7a){logger[_0xab4a('0x24')](_0xab4a('0x25'),util[_0xab4a('0x26')](_0x5dcf7a,{'showHidden':![],'depth':null}));}}VoiceCallReport['prototype'][_0xab4a('0x27')]=function(_0x4b9c5c){return _0x4b9c5c!==null&&!_[_0xab4a('0x28')](_0x4b9c5c);};VoiceCallReport[_0xab4a('0x29')][_0xab4a('0x2a')]=function(_0x157224,_0x3eb73f,_0x3e8f58){io['to'](_0x157224)['emit'](_0x3eb73f,_0x3e8f58);};VoiceCallReport[_0xab4a('0x29')][_0xab4a('0x2b')]=function(_0x5bfcec){try{if(this[_0xab4a('0x27')](_0x5bfcec)){logger[_0xab4a('0x2c')](_0xab4a('0x2d'),_0x5bfcec[_0xab4a('0x2e')],_0x5bfcec['calleridname'],_0x5bfcec[_0xab4a('0x2f')]);logger[_0xab4a('0x30')]('[%s][voiceCallReport][newcallerid]\x20event:',_0x5bfcec[_0xab4a('0x2e')],util[_0xab4a('0x26')](_0x5bfcec,{'showHidden':![],'depth':null}));if(_0x5bfcec[_0xab4a('0x2e')]===_0x5bfcec['linkedid']){if(!_['isUndefined'](this[_0xab4a('0x13')][_0x5bfcec[_0xab4a('0x2e')]])){_[_0xab4a('0x31')](this[_0xab4a('0x13')][_0x5bfcec[_0xab4a('0x2e')]],_['pick'](_0x5bfcec,_[_0xab4a('0x32')](this[_0xab4a('0x13')][_0x5bfcec[_0xab4a('0x2e')]])));}}if(_0x5bfcec[_0xab4a('0x33')]==='from-sip'){if(this[_0xab4a('0x14')][_0x5bfcec['channel']['split']('-')[0x0]]){if(_0x5bfcec['exten']=='xcally-motion-preview'){this['agents'][_0x5bfcec['channel'][_0xab4a('0x34')]('-')[0x0]]['destconnectedlinenum']=_0x5bfcec[_0xab4a('0x35')];this[_0xab4a('0x2a')](util['format'](_0xab4a('0x36'),this[_0xab4a('0x14')][_0x5bfcec[_0xab4a('0x37')][_0xab4a('0x34')]('-')[0x0]][_0xab4a('0x38')]),_0xab4a('0x39'),{'destaccountcode':this[_0xab4a('0x14')][_0x5bfcec[_0xab4a('0x37')][_0xab4a('0x34')]('-')[0x0]][_0xab4a('0x3a')],'destconnectedlinenum':_0x5bfcec[_0xab4a('0x35')]});}}}}}catch(_0x1d4619){logger[_0xab4a('0x24')](_0xab4a('0x3b'),_0x5bfcec[_0xab4a('0x2e')],util[_0xab4a('0x26')](_0x1d4619,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xab4a('0x29')][_0xab4a('0x18')]=function(_0x36c2da){try{if(this[_0xab4a('0x27')](_0x36c2da)){logger['debug'](_0xab4a('0x3c'),_0x36c2da[_0xab4a('0x2e')],util[_0xab4a('0x26')](_0x36c2da,{'showHidden':![],'depth':null}));if(this[_0xab4a('0x13')][_0x36c2da['uniqueid']])return;if(_0x36c2da[_0xab4a('0x37')]===_0xab4a('0x3d'))return;if(_0x36c2da[_0xab4a('0x2e')]!==_0x36c2da[_0xab4a('0x3e')]&&!this[_0xab4a('0x3f')][_0x36c2da[_0xab4a('0x3e')]])return;logger['info'](_0xab4a('0x40'),_0x36c2da[_0xab4a('0x2e')],_0x36c2da[_0xab4a('0x33')],_0x36c2da[_0xab4a('0x41')]);this[_0xab4a('0x13')][_0x36c2da[_0xab4a('0x2e')]]=new Channel();this[_0xab4a('0x13')][_0x36c2da['uniqueid']][_0xab4a('0x42')]=moment()['format'](_0xab4a('0x43'));this[_0xab4a('0x13')][_0x36c2da['uniqueid']]['disposition']=dispositions[_[_0xab4a('0x44')](_0x36c2da[_0xab4a('0x45')])];_['merge'](this['channels'][_0x36c2da[_0xab4a('0x2e')]],_[_0xab4a('0x46')](_0x36c2da,_[_0xab4a('0x32')](this['channels'][_0x36c2da['uniqueid']])));if(_0x36c2da[_0xab4a('0x33')]===_0xab4a('0x47')){if(this['agents'][_0x36c2da[_0xab4a('0x37')][_0xab4a('0x34')]('-')[0x0]]){if(_['isUndefined'](this[_0xab4a('0x14')][_0x36c2da[_0xab4a('0x37')][_0xab4a('0x34')]('-')[0x0]]['destconnectedlinenum'])){this[_0xab4a('0x14')][_0x36c2da['channel']['split']('-')[0x0]][_0xab4a('0x48')]=_0x36c2da[_0xab4a('0x41')];logger[_0xab4a('0x30')](_0xab4a('0x49'),_0x36c2da['uniqueid'],util[_0xab4a('0x26')]({'id':this[_0xab4a('0x14')][_0x36c2da['channel']['split']('-')[0x0]]['id'],'destaccountcode':this[_0xab4a('0x14')][_0x36c2da[_0xab4a('0x37')]['split']('-')[0x0]][_0xab4a('0x3a')],'destconnectedlinenum':_0x36c2da['exten']},{'showHidden':![],'depth':null}));this[_0xab4a('0x2a')](util[_0xab4a('0x4a')](_0xab4a('0x36'),this[_0xab4a('0x14')][_0x36c2da[_0xab4a('0x37')][_0xab4a('0x34')]('-')[0x0]][_0xab4a('0x38')]),_0xab4a('0x39'),{'id':this[_0xab4a('0x14')][_0x36c2da[_0xab4a('0x37')][_0xab4a('0x34')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x36c2da[_0xab4a('0x37')][_0xab4a('0x34')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x36c2da[_0xab4a('0x41')]});}}}}}catch(_0x374a29){logger['error'](_0xab4a('0x4b'),_0x36c2da[_0xab4a('0x2e')],util[_0xab4a('0x26')](_0x374a29,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xab4a('0x29')][_0xab4a('0x16')]=function(_0x578e35){try{if(this[_0xab4a('0x27')](_0x578e35)){logger[_0xab4a('0x30')](_0xab4a('0x4c'),_0x578e35[_0xab4a('0x2e')],util['inspect'](_0x578e35,{'showHidden':![],'depth':null}));if(_0x578e35[_0xab4a('0x37')]===_0xab4a('0x3d')||_0x578e35['exten']==='h')return;if(_0x578e35[_0xab4a('0x2e')]===_0x578e35[_0xab4a('0x3e')]||this[_0xab4a('0x3f')][_0x578e35[_0xab4a('0x3e')]]){_0x578e35[_0xab4a('0x4d')]=_0x578e35[_0xab4a('0x4d')][_0xab4a('0x4e')]();_0x578e35['applicationdata']=_0x578e35['appdata']&&_0x578e35[_0xab4a('0x4f')]['startsWith'](_0xab4a('0x50'))?_0x578e35[_0xab4a('0x4f')]:(_0x578e35['appdata']||_0x578e35[_0xab4a('0x51')])['toLowerCase']();logger['info']('[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s',_0x578e35[_0xab4a('0x2e')],_0x578e35[_0xab4a('0x4d')],_0x578e35['applicationdata']);if(_[_0xab4a('0x28')](this[_0xab4a('0x13')][_0x578e35[_0xab4a('0x2e')]])){this['channels'][_0x578e35['uniqueid']]=new Channel();this[_0xab4a('0x13')][_0x578e35[_0xab4a('0x2e')]][_0xab4a('0x42')]=_0x578e35['duration']?moment()[_0xab4a('0x52')](moment[_0xab4a('0x53')](_0x578e35[_0xab4a('0x53')])[_0xab4a('0x54')](),_0xab4a('0x54'))[_0xab4a('0x4a')](_0xab4a('0x43')):moment()[_0xab4a('0x4a')](_0xab4a('0x43'));this[_0xab4a('0x13')][_0x578e35['uniqueid']][_0xab4a('0x55')]=_0xab4a('0xd');}_[_0xab4a('0x31')](this['channels'][_0x578e35['uniqueid']],_[_0xab4a('0x46')](_0x578e35,_['keys'](this[_0xab4a('0x13')][_0x578e35[_0xab4a('0x2e')]])));if(_[_0xab4a('0x56')](applications,_0x578e35[_0xab4a('0x4d')])){this['channels'][_0x578e35[_0xab4a('0x2e')]][_0xab4a('0x57')]=_0x578e35[_0xab4a('0x4d')];this[_0xab4a('0x13')][_0x578e35[_0xab4a('0x2e')]][_0xab4a('0x58')]=_0x578e35[_0xab4a('0x51')];if(_0x578e35[_0xab4a('0x4d')]==='set'&&_[_0xab4a('0x59')](_0x578e35[_0xab4a('0x51')][_0xab4a('0x4e')](),_0xab4a('0x5a'))){var _0x53afbc=_0x578e35[_0xab4a('0x51')]['split']('=');var _0x1dd6b2=_0x53afbc[0x0][_0xab4a('0x4e')]()[_0xab4a('0x5b')](/cdr\((.*)\)/);if(_0x1dd6b2){if(_0x1dd6b2[0x1]===_0xab4a('0x5c')&&!_[_0xab4a('0x5d')](this[_0xab4a('0x13')][_0x578e35[_0xab4a('0x2e')]][_0x1dd6b2[0x1]]))return;this[_0xab4a('0x13')][_0x578e35[_0xab4a('0x2e')]][_0x1dd6b2[0x1]]=_0x53afbc[0x1];}}else if(_0x578e35[_0xab4a('0x4d')]===_0xab4a('0x5e')){this[_0xab4a('0x13')][_0x578e35['uniqueid']][_0xab4a('0x5e')]=_0x578e35[_0xab4a('0x51')]['split'](',')[0x0];}}}}}catch(_0x4bbcdd){logger['error'](_0xab4a('0x5f'),_0x578e35[_0xab4a('0x2e')],util['inspect'](_0x4bbcdd,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xab4a('0x29')]['syncNewState']=function(_0x53a78e){try{if(this[_0xab4a('0x27')](_0x53a78e)){logger[_0xab4a('0x2c')]('[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s',_0x53a78e[_0xab4a('0x2e')],_0x53a78e[_0xab4a('0x3e')],_0x53a78e['calleridname'],_0x53a78e[_0xab4a('0x2f')]);logger[_0xab4a('0x30')](_0xab4a('0x60'),_0x53a78e[_0xab4a('0x2e')],util[_0xab4a('0x26')](_0x53a78e,{'showHidden':![],'depth':null}));if(_0x53a78e[_0xab4a('0x45')]!=='6')return;if(_0x53a78e[_0xab4a('0x2e')]!==_0x53a78e['linkedid']){var _0x368ff2=moment();if(this[_0xab4a('0x13')][_0x53a78e[_0xab4a('0x3e')]]){if(!this['channels'][_0x53a78e['linkedid']][_0xab4a('0x61')]){this[_0xab4a('0x13')][_0x53a78e[_0xab4a('0x3e')]][_0xab4a('0x61')]=!![];this[_0xab4a('0x13')][_0x53a78e[_0xab4a('0x3e')]][_0xab4a('0x62')]=_0x368ff2[_0xab4a('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');if(this['channels'][_0x53a78e['linkedid']]['starttime']){this[_0xab4a('0x13')][_0x53a78e[_0xab4a('0x3e')]]['holdtime']=_0x368ff2[_0xab4a('0x63')](this['channels'][_0x53a78e[_0xab4a('0x3e')]]['starttime'],_0xab4a('0x54'));}}this[_0xab4a('0x13')][_0x53a78e[_0xab4a('0x3e')]]['linkedid']=_0x53a78e[_0xab4a('0x2e')];if(_0x53a78e[_0xab4a('0x2f')]!==_0xab4a('0x64')){this[_0xab4a('0x13')][_0x53a78e[_0xab4a('0x3e')]]['connectedlinenum']=_0x53a78e[_0xab4a('0x2f')];}this[_0xab4a('0x13')][_0x53a78e['linkedid']][_0xab4a('0x65')]=_0x53a78e[_0xab4a('0x66')];this['channels'][_0x53a78e[_0xab4a('0x3e')]][_0xab4a('0x67')]=_0x53a78e['channel'];this[_0xab4a('0x13')][_0x53a78e[_0xab4a('0x3e')]]['disposition']=dispositions[_['toNumber'](_0x53a78e[_0xab4a('0x45')])];if(this['agents'][_0x53a78e[_0xab4a('0x37')][_0xab4a('0x34')]('-')[0x0]]){this[_0xab4a('0x13')][_0x53a78e[_0xab4a('0x3e')]][_0xab4a('0x68')]=this[_0xab4a('0x14')][_0x53a78e[_0xab4a('0x37')][_0xab4a('0x34')]('-')[0x0]]['id'];this[_0xab4a('0x13')][_0x53a78e[_0xab4a('0x3e')]][_0xab4a('0x69')]=this['agents'][_0x53a78e[_0xab4a('0x37')]['split']('-')[0x0]][_0xab4a('0x38')];}}if(this[_0xab4a('0x13')][_0x53a78e[_0xab4a('0x2e')]]){if(!this['channels'][_0x53a78e[_0xab4a('0x2e')]][_0xab4a('0x61')]){this[_0xab4a('0x13')][_0x53a78e['uniqueid']]['answered']=!![];this[_0xab4a('0x13')][_0x53a78e[_0xab4a('0x2e')]][_0xab4a('0x62')]=_0x368ff2['format'](_0xab4a('0x43'));if(this[_0xab4a('0x13')][_0x53a78e[_0xab4a('0x2e')]]['starttime']){this[_0xab4a('0x13')][_0x53a78e['uniqueid']][_0xab4a('0x6a')]=_0x368ff2[_0xab4a('0x63')](this['channels'][_0x53a78e[_0xab4a('0x2e')]]['starttime'],_0xab4a('0x54'));}}if(_0x53a78e['calleridnum']!=='xcally-motion-preview'){this['channels'][_0x53a78e[_0xab4a('0x2e')]]['connectedlinenum']=_0x53a78e[_0xab4a('0x2f')];}this['channels'][_0x53a78e[_0xab4a('0x2e')]][_0xab4a('0x65')]=_0x53a78e['calleridname'];this[_0xab4a('0x13')][_0x53a78e['uniqueid']]['destinationchannel']=_0x53a78e[_0xab4a('0x37')];this[_0xab4a('0x13')][_0x53a78e[_0xab4a('0x2e')]][_0xab4a('0x55')]=dispositions[_[_0xab4a('0x44')](_0x53a78e['channelstate'])];}}else{if(this[_0xab4a('0x13')][_0x53a78e[_0xab4a('0x2e')]]){if(this[_0xab4a('0x14')][_0x53a78e[_0xab4a('0x37')]['split']('-')[0x0]]){this['channels'][_0x53a78e[_0xab4a('0x2e')]][_0xab4a('0x68')]=this[_0xab4a('0x14')][_0x53a78e[_0xab4a('0x37')]['split']('-')[0x0]]['id'];this[_0xab4a('0x13')][_0x53a78e[_0xab4a('0x2e')]][_0xab4a('0x69')]=this[_0xab4a('0x14')][_0x53a78e['channel'][_0xab4a('0x34')]('-')[0x0]][_0xab4a('0x38')];}}}if(_0x53a78e[_0xab4a('0x33')]===_0xab4a('0x47')){if(this[_0xab4a('0x14')][_0x53a78e[_0xab4a('0x37')][_0xab4a('0x34')]('-')[0x0]]){this[_0xab4a('0x14')][_0x53a78e[_0xab4a('0x37')][_0xab4a('0x34')]('-')[0x0]][_0xab4a('0x48')]=_0x53a78e[_0xab4a('0x41')];var _0x505e13,_0x12f508;if(this['channels'][_0x53a78e['uniqueid']]){_0x505e13=this[_0xab4a('0x13')][_0x53a78e['uniqueid']][_0xab4a('0x6b')];_0x12f508=this['channels'][_0x53a78e[_0xab4a('0x2e')]]['queue'];}else if(this[_0xab4a('0x13')][_0x53a78e[_0xab4a('0x3e')]]){_0x505e13=this[_0xab4a('0x13')][_0x53a78e[_0xab4a('0x3e')]][_0xab4a('0x6b')];_0x12f508=this[_0xab4a('0x13')][_0x53a78e[_0xab4a('0x3e')]][_0xab4a('0x5e')];}logger[_0xab4a('0x30')](_0xab4a('0x6c'),_0x53a78e[_0xab4a('0x2e')],util[_0xab4a('0x26')]({'id':this['agents'][_0x53a78e['channel'][_0xab4a('0x34')]('-')[0x0]]['id'],'destaccountcode':this[_0xab4a('0x14')][_0x53a78e[_0xab4a('0x37')]['split']('-')[0x0]][_0xab4a('0x3a')],'destconnectedlinenum':_0x53a78e[_0xab4a('0x41')],'routealias':_0x505e13,'queue':_0x12f508||undefined},{'showHidden':![],'depth':null}));this['emit'](util['format'](_0xab4a('0x36'),this[_0xab4a('0x14')][_0x53a78e[_0xab4a('0x37')][_0xab4a('0x34')]('-')[0x0]][_0xab4a('0x38')]),_0xab4a('0x39'),{'id':this[_0xab4a('0x14')][_0x53a78e[_0xab4a('0x37')][_0xab4a('0x34')]('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this[_0xab4a('0x14')][_0x53a78e[_0xab4a('0x37')][_0xab4a('0x34')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x53a78e[_0xab4a('0x41')],'routealias':_0x505e13,'queue':_0x12f508||undefined});}}}}catch(_0x3ebf8f){logger['error']('[%s][voiceCallReport][newstate]',_0x53a78e[_0xab4a('0x2e')],util[_0xab4a('0x26')](_0x3ebf8f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xab4a('0x29')][_0xab4a('0x6d')]=function(_0x4a0c47,_0x38330b){try{if(this['channels'][_0x4a0c47]){logger[_0xab4a('0x2c')]('[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s',_0x4a0c47,_0x38330b);this[_0xab4a('0x13')][_0x4a0c47]['monitor']=!![];if(_['endsWith'](_0x38330b,_0xab4a('0x6e'))){_0x38330b=_0x38330b[_0xab4a('0x6f')]('.wav49',_0xab4a('0x70'));}this[_0xab4a('0x13')][_0x4a0c47][_0xab4a('0x71')]=_0x38330b;var _0x4cdeea=_[_0xab4a('0x72')](this[_0xab4a('0x13')][_0x4a0c47][_0xab4a('0x73')],{'filename':_0x38330b});if(_[_0xab4a('0x5d')](_0x4cdeea)){this[_0xab4a('0x13')][_0x4a0c47][_0xab4a('0x73')][_0xab4a('0x74')]({'filename':_0x38330b,'createdAt':moment()[_0xab4a('0x4a')](_0xab4a('0x43')),'mixmonitorid':'','status':_0xab4a('0x75')});}}}catch(_0x25642f){logger[_0xab4a('0x24')](_0xab4a('0x76'),_0x4a0c47,util[_0xab4a('0x26')](_0x25642f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xab4a('0x29')][_0xab4a('0x1b')]=function(_0x1dd53b){try{if(this[_0xab4a('0x27')](_0x1dd53b)){logger['debug'](_0xab4a('0x77'),_0x1dd53b[_0xab4a('0x2e')],util[_0xab4a('0x26')](_0x1dd53b,{'showHidden':![],'depth':null}));if(this[_0xab4a('0x13')][_0x1dd53b['uniqueid']]&&_0x1dd53b[_0xab4a('0x37')]!=_0xab4a('0x3d')){if(this['isNotNull'](_0x1dd53b['variable'])){if(this[_0xab4a('0x27')](_0x1dd53b[_0xab4a('0x78')][_0xab4a('0x79')])){logger[_0xab4a('0x2c')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x1dd53b[_0xab4a('0x2e')],_0x1dd53b[_0xab4a('0x7a')]);this[_0xab4a('0x6d')](_0x1dd53b[_0xab4a('0x2e')],_0x1dd53b[_0xab4a('0x7a')]);}else if(this[_0xab4a('0x27')](_0x1dd53b['variable'][_0xab4a('0x7b')])){logger['info'](_0xab4a('0x7c'),_0x1dd53b['uniqueid'],_0x1dd53b['value']);this[_0xab4a('0x13')][_0x1dd53b[_0xab4a('0x2e')]][_0xab4a('0x2f')]=_0x1dd53b[_0xab4a('0x7a')];}else if(this[_0xab4a('0x27')](_0x1dd53b[_0xab4a('0x78')][_0xab4a('0x7d')])){logger[_0xab4a('0x2c')](_0xab4a('0x7e'),_0x1dd53b[_0xab4a('0x2e')],_0x1dd53b['value']);this[_0xab4a('0x13')][_0x1dd53b['uniqueid']]['callerid']=_0x1dd53b[_0xab4a('0x7a')];}else if(this[_0xab4a('0x27')](_0x1dd53b[_0xab4a('0x78')][_0xab4a('0x7f')])){logger[_0xab4a('0x2c')](_0xab4a('0x80'),_0x1dd53b[_0xab4a('0x2e')],_0x1dd53b[_0xab4a('0x7a')]);this[_0xab4a('0x13')][_0x1dd53b[_0xab4a('0x2e')]][_0xab4a('0x5c')]=_0x1dd53b[_0xab4a('0x7a')];}else if(this[_0xab4a('0x27')](_0x1dd53b[_0xab4a('0x78')][_0xab4a('0x81')])){logger[_0xab4a('0x2c')](_0xab4a('0x82'),_0x1dd53b['uniqueid'],_0x1dd53b[_0xab4a('0x7a')]['split'](',')[0x0]);this[_0xab4a('0x13')][_0x1dd53b[_0xab4a('0x2e')]]['queue']=_0x1dd53b[_0xab4a('0x7a')][_0xab4a('0x34')](',')[0x0];}else if(this['isNotNull'](_0x1dd53b['variable'][_0xab4a('0x83')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x1dd53b[_0xab4a('0x2e')],_0x1dd53b[_0xab4a('0x7a')]);this[_0xab4a('0x13')][_0x1dd53b[_0xab4a('0x2e')]][_0xab4a('0x84')]=_0x1dd53b[_0xab4a('0x7a')];}else if(this[_0xab4a('0x27')](_0x1dd53b['variable'][_0xab4a('0x85')])){logger[_0xab4a('0x2c')]('[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s',_0x1dd53b['uniqueid'],_0x1dd53b['value']);this[_0xab4a('0x13')][_0x1dd53b['uniqueid']][_0xab4a('0x86')]=_0x1dd53b[_0xab4a('0x7a')];}else if(this[_0xab4a('0x27')](_0x1dd53b['variable'][_0xab4a('0x87')])){logger[_0xab4a('0x2c')](_0xab4a('0x88'),_0x1dd53b['uniqueid'],_0x1dd53b[_0xab4a('0x7a')]);this[_0xab4a('0x13')][_0x1dd53b[_0xab4a('0x2e')]][_0xab4a('0x89')]=_0x1dd53b[_0xab4a('0x7a')];}else if(this['isNotNull'](_0x1dd53b[_0xab4a('0x78')][_0xab4a('0x8a')])){logger['info'](_0xab4a('0x8b'),_0x1dd53b[_0xab4a('0x2e')],_0x1dd53b[_0xab4a('0x7a')]);this['channels'][_0x1dd53b[_0xab4a('0x2e')]][_0xab4a('0x5e')]=_0x1dd53b['value'];}else if(this[_0xab4a('0x27')](_0x1dd53b[_0xab4a('0x78')][_0xab4a('0x8c')])){logger[_0xab4a('0x2c')](_0xab4a('0x8d'),_0x1dd53b[_0xab4a('0x2e')],_0x1dd53b[_0xab4a('0x7a')]);this[_0xab4a('0x13')][_0x1dd53b['uniqueid']][_0xab4a('0x8e')]=_0x1dd53b[_0xab4a('0x7a')];}}}else if(this[_0xab4a('0x27')](_0x1dd53b[_0xab4a('0x78')][_0xab4a('0x79')])){if(_0x1dd53b[_0xab4a('0x7a')]){var _0x3252d3=path[_0xab4a('0x8f')](_0x1dd53b['value'])['name'];logger['info'](_0xab4a('0x90'),_0x3252d3,_0x1dd53b['value']);this['syncMixMonitorFilename'](_0x3252d3,_0x1dd53b['value']);}}else if(this['channels'][_0x1dd53b[_0xab4a('0x3e')]]){if(this[_0xab4a('0x27')](_0x1dd53b[_0xab4a('0x78')])){if(this[_0xab4a('0x27')](_0x1dd53b['variable']['sipcallid'])){logger[_0xab4a('0x2c')](_0xab4a('0x8d'),_0x1dd53b[_0xab4a('0x3e')],_0x1dd53b[_0xab4a('0x7a')]);this[_0xab4a('0x13')][_0x1dd53b[_0xab4a('0x3e')]][_0xab4a('0x91')]=_0x1dd53b['value'];}}}}}catch(_0x336ef8){logger[_0xab4a('0x24')](_0xab4a('0x92'),_0x1dd53b[_0xab4a('0x2e')],util['inspect'](_0x336ef8,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xab4a('0x29')][_0xab4a('0x1c')]=function(_0x1682b4){try{if(this[_0xab4a('0x27')](_0x1682b4)){logger[_0xab4a('0x30')]('[%s][voiceCallReport][hangup]\x20event:',_0x1682b4['uniqueid'],util['inspect'](_0x1682b4,{'showHidden':![],'depth':null}));if(this[_0xab4a('0x3f')][_0x1682b4[_0xab4a('0x3e')]]){if(this[_0xab4a('0x13')][this[_0xab4a('0x3f')][_0x1682b4[_0xab4a('0x3e')]]['linkedid']]){this['channels'][this['blindTransfers'][_0x1682b4[_0xab4a('0x3e')]][_0xab4a('0x3e')]]['uniqueid']=_0x1682b4['uniqueid'];this[_0xab4a('0x13')][this['blindTransfers'][_0x1682b4[_0xab4a('0x3e')]][_0xab4a('0x3e')]][_0xab4a('0x61')]=this[_0xab4a('0x13')][_0x1682b4[_0xab4a('0x2e')]][_0xab4a('0x61')];this['channels'][this[_0xab4a('0x3f')][_0x1682b4['linkedid']][_0xab4a('0x3e')]][_0xab4a('0x62')]=this[_0xab4a('0x13')][_0x1682b4[_0xab4a('0x2e')]][_0xab4a('0x62')];this['channels'][this[_0xab4a('0x3f')][_0x1682b4[_0xab4a('0x3e')]][_0xab4a('0x3e')]][_0xab4a('0x67')]=this[_0xab4a('0x13')][this[_0xab4a('0x3f')][_0x1682b4[_0xab4a('0x3e')]][_0xab4a('0x3e')]]['channel'];this[_0xab4a('0x13')][this[_0xab4a('0x3f')][_0x1682b4[_0xab4a('0x3e')]][_0xab4a('0x3e')]]['disposition']=this['channels'][_0x1682b4[_0xab4a('0x2e')]]['disposition'];this[_0xab4a('0x13')][_0x1682b4['uniqueid']]=this[_0xab4a('0x13')][this[_0xab4a('0x3f')][_0x1682b4[_0xab4a('0x3e')]]['linkedid']];delete this[_0xab4a('0x13')][this['blindTransfers'][_0x1682b4[_0xab4a('0x3e')]][_0xab4a('0x3e')]];}else if(this[_0xab4a('0x13')][this[_0xab4a('0x3f')][_0x1682b4['linkedid']][_0xab4a('0x2e')]]){this[_0xab4a('0x13')][this[_0xab4a('0x3f')][_0x1682b4[_0xab4a('0x3e')]][_0xab4a('0x2e')]][_0xab4a('0x2e')]=[this[_0xab4a('0x13')][this['blindTransfers'][_0x1682b4[_0xab4a('0x3e')]][_0xab4a('0x2e')]][_0xab4a('0x3e')],this[_0xab4a('0x13')][this['blindTransfers'][_0x1682b4[_0xab4a('0x3e')]][_0xab4a('0x2e')]][_0xab4a('0x3e')]=this['channels'][this[_0xab4a('0x3f')][_0x1682b4[_0xab4a('0x3e')]]['uniqueid']][_0xab4a('0x2e')]][0x0];this[_0xab4a('0x13')][this['blindTransfers'][_0x1682b4[_0xab4a('0x3e')]]['uniqueid']][_0xab4a('0x61')]=this['channels'][_0x1682b4[_0xab4a('0x2e')]][_0xab4a('0x61')];this[_0xab4a('0x13')][this[_0xab4a('0x3f')][_0x1682b4[_0xab4a('0x3e')]][_0xab4a('0x2e')]]['answertime']=this[_0xab4a('0x13')][_0x1682b4[_0xab4a('0x2e')]]['answertime'];this['channels'][this['blindTransfers'][_0x1682b4['linkedid']][_0xab4a('0x2e')]][_0xab4a('0x67')]=this['channels'][this[_0xab4a('0x3f')][_0x1682b4[_0xab4a('0x3e')]][_0xab4a('0x2e')]][_0xab4a('0x37')];this['channels'][this['blindTransfers'][_0x1682b4[_0xab4a('0x3e')]][_0xab4a('0x2e')]][_0xab4a('0x55')]=this[_0xab4a('0x13')][_0x1682b4['uniqueid']][_0xab4a('0x55')];this[_0xab4a('0x13')][_0x1682b4[_0xab4a('0x2e')]]=this[_0xab4a('0x13')][this[_0xab4a('0x3f')][_0x1682b4['linkedid']][_0xab4a('0x2e')]];delete this[_0xab4a('0x13')][this[_0xab4a('0x3f')][_0x1682b4[_0xab4a('0x3e')]][_0xab4a('0x2e')]];}}if(this[_0xab4a('0x13')][_0x1682b4[_0xab4a('0x2e')]]){logger[_0xab4a('0x2c')](_0xab4a('0x93'),_0x1682b4[_0xab4a('0x2e')],_0x1682b4[_0xab4a('0x94')]);var _0x2beac1=moment();this[_0xab4a('0x13')][_0x1682b4[_0xab4a('0x2e')]][_0xab4a('0x95')]=_0x2beac1['format'](_0xab4a('0x43'));this['channels'][_0x1682b4[_0xab4a('0x2e')]]['duration']=_0x2beac1['diff'](this['channels'][_0x1682b4[_0xab4a('0x2e')]][_0xab4a('0x42')],_0xab4a('0x54'));if(this[_0xab4a('0x13')][_0x1682b4[_0xab4a('0x2e')]][_0xab4a('0x61')]){this['channels'][_0x1682b4[_0xab4a('0x2e')]][_0xab4a('0x96')]=_0x2beac1[_0xab4a('0x63')](this[_0xab4a('0x13')][_0x1682b4['uniqueid']][_0xab4a('0x62')],_0xab4a('0x54'));this[_0xab4a('0x13')][_0x1682b4[_0xab4a('0x2e')]][_0xab4a('0x6a')]=this[_0xab4a('0x13')][_0x1682b4[_0xab4a('0x2e')]][_0xab4a('0x53')]-this['channels'][_0x1682b4[_0xab4a('0x2e')]][_0xab4a('0x96')];}if(_0x1682b4[_0xab4a('0x33')]==='from-sip'){if(this['agents'][_0x1682b4[_0xab4a('0x37')][_0xab4a('0x34')]('-')[0x0]]){this[_0xab4a('0x14')][_0x1682b4[_0xab4a('0x37')][_0xab4a('0x34')]('-')[0x0]]=_['omit'](this['agents'][_0x1682b4[_0xab4a('0x37')][_0xab4a('0x34')]('-')[0x0]],[_0xab4a('0x48')]);logger['debug'](_0xab4a('0x97'),_0x1682b4[_0xab4a('0x2e')],util[_0xab4a('0x26')]({'id':this['agents'][_0x1682b4['channel'][_0xab4a('0x34')]('-')[0x0]]['id'],'destaccountcode':this[_0xab4a('0x14')][_0x1682b4['channel'][_0xab4a('0x34')]('-')[0x0]][_0xab4a('0x3a')]},{'showHidden':![],'depth':null}));this['emit'](util['format'](_0xab4a('0x36'),this['agents'][_0x1682b4[_0xab4a('0x37')][_0xab4a('0x34')]('-')[0x0]]['name']),'user:agentcomplete',{'id':this[_0xab4a('0x14')][_0x1682b4['channel'][_0xab4a('0x34')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x1682b4[_0xab4a('0x37')][_0xab4a('0x34')]('-')[0x0]][_0xab4a('0x3a')]});for(var _0x171282=0x0;_0x171282<Object[_0xab4a('0x32')](this['agents'])[_0xab4a('0x98')];_0x171282++){var _0x1d0fd6=Object[_0xab4a('0x32')](this[_0xab4a('0x14')])[_0x171282];var _0x342a2e=this[_0xab4a('0x14')][_0x1d0fd6];if(_0x342a2e[_0xab4a('0x3a')]===Number(_0x1682b4[_0xab4a('0x35')])){this[_0xab4a('0x2a')](util['format'](_0xab4a('0x36'),_0x342a2e[_0xab4a('0x38')]),_0xab4a('0x99'),{'id':_0x342a2e['id'],'destaccountcode':_0x342a2e[_0xab4a('0x3a')],'transfer':this[_0xab4a('0x13')][_0x1682b4[_0xab4a('0x2e')]][_0xab4a('0x9a')]});break;}}}}var _0x44d4e0=this;Promise[_0xab4a('0x9b')]()[_0xab4a('0x9c')](function(){var _0x2e32b3=_0x44d4e0[_0xab4a('0x13')][_0x1682b4['uniqueid']];if(typeof _0x2e32b3[_0xab4a('0x9a')]==='undefined')return;if(_[_0xab4a('0x9d')](_0x2e32b3['monitors']))return;return RpcSetting[_0xab4a('0x9e')]()['then'](function(_0x1a3313){if(!_0x1a3313['stopRecordingOnTransfer'])return;return Promise[_0xab4a('0x9b')]()[_0xab4a('0x9c')](function(){return ami['Action']({'action':'StopMixMonitor','channel':_0x2e32b3[_0xab4a('0x37')]})[_0xab4a('0x9f')](function(){});})[_0xab4a('0x9c')](function(){return ami['Action']({'action':_0xab4a('0xa0'),'channel':_0x2e32b3['destinationchannel']})[_0xab4a('0x9f')](function(){})['finally'](function(){var _0x40956c=_0x44d4e0[_0xab4a('0x14')][_0x2e32b3[_0xab4a('0x67')][_0xab4a('0x34')]('-')[0x0]];if(!_0x40956c)return;io[_0xab4a('0x2a')]('webbar:stopmonitors',{'agentId':_0x40956c['id'],'uniqueid':_0x2e32b3[_0xab4a('0x2e')]});});});});})[_0xab4a('0x9c')](function(){if(_0x1682b4[_0xab4a('0xa1')]===_0xab4a('0xa2')){_0x44d4e0[_0xab4a('0x3f')][_0x1682b4['uniqueid']]=_0x1682b4;}else{if(_0x44d4e0[_0xab4a('0x13')][_0x1682b4[_0xab4a('0x2e')]][_0xab4a('0x5c')]===_0xab4a('0xa3')&&_0x44d4e0[_0xab4a('0x3f')][_0x1682b4[_0xab4a('0x2e')]]){_0x44d4e0['channels'][_0x1682b4['uniqueid']][_0xab4a('0x2e')]=[_0x44d4e0[_0xab4a('0x13')][_0x1682b4[_0xab4a('0x2e')]][_0xab4a('0x3e')],_0x44d4e0[_0xab4a('0x13')][_0x1682b4[_0xab4a('0x2e')]][_0xab4a('0x3e')]=_0x44d4e0[_0xab4a('0x13')][_0x1682b4[_0xab4a('0x2e')]]['uniqueid']][0x0];delete _0x44d4e0[_0xab4a('0x3f')][_0x1682b4[_0xab4a('0x2e')]];}}logger['debug']('[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:',_0x1682b4[_0xab4a('0x2e')],util['inspect'](_0x44d4e0[_0xab4a('0x13')][_0x1682b4[_0xab4a('0x2e')]],{'showHidden':![],'depth':null}));ami[_0xab4a('0x2a')](_0xab4a('0xa4'),_0x44d4e0[_0xab4a('0x13')][_0x1682b4[_0xab4a('0x2e')]]);delete _0x44d4e0['channels'][_0x1682b4[_0xab4a('0x2e')]];});}}}catch(_0x22c720){logger[_0xab4a('0x24')]('[%s][voiceCallReport][hangup]',_0x1682b4['uniqueid'],util['inspect'](_0x22c720,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xab4a('0x29')][_0xab4a('0xa5')]=function(_0x10a421){try{if(this[_0xab4a('0x27')](_0x10a421)){logger[_0xab4a('0x2c')]('[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x10a421[_0xab4a('0x2e')],_0x10a421[_0xab4a('0xa6')],_0x10a421[_0xab4a('0xa7')]);logger[_0xab4a('0x30')](_0xab4a('0xa8'),_0x10a421[_0xab4a('0x2e')],util['inspect'](_0x10a421,{'showHidden':![],'depth':null}));var _0x239b15;if(this[_0xab4a('0x13')][_0x10a421[_0xab4a('0xa9')]]){this[_0xab4a('0x13')][_0x10a421[_0xab4a('0xa9')]][_0xab4a('0xaa')]=_0x10a421[_0xab4a('0xa6')];this[_0xab4a('0x13')][_0x10a421[_0xab4a('0xa9')]][_0xab4a('0xab')]=_0x10a421[_0xab4a('0xa7')];if(this['channels'][_0x10a421['secondtransfereruniqueid']]){_0x239b15=this[_0xab4a('0x13')][_0x10a421['secondtransfereruniqueid']];this[_0xab4a('0x13')][_0x10a421['secondtransfereruniqueid']]=this[_0xab4a('0x13')][_0x10a421[_0xab4a('0xa9')]];this['channels'][_0x10a421[_0xab4a('0xa9')]]=_0x239b15;}this[_0xab4a('0x13')][_0x10a421[_0xab4a('0xac')]][_0xab4a('0x9a')]=_0xab4a('0xad');}else if(this[_0xab4a('0x13')][_0x10a421['transfertargetuniqueid']]){this[_0xab4a('0x13')][_0x10a421['transfertargetuniqueid']]['transfercalleridnum']=_0x10a421[_0xab4a('0xa6')];this[_0xab4a('0x13')][_0x10a421[_0xab4a('0xae')]][_0xab4a('0xab')]=_0x10a421[_0xab4a('0xa7')];if(this[_0xab4a('0x13')][_0x10a421[_0xab4a('0xaf')]]){_0x239b15=this[_0xab4a('0x13')][_0x10a421[_0xab4a('0xaf')]];this[_0xab4a('0x13')][_0x10a421[_0xab4a('0xaf')]]=this[_0xab4a('0x13')][_0x10a421[_0xab4a('0xae')]];this[_0xab4a('0x13')][_0x10a421[_0xab4a('0xae')]]=_0x239b15;}this['channels'][_0x10a421[_0xab4a('0xae')]][_0xab4a('0x9a')]=_0xab4a('0xad');}if((this['channels'][_0x10a421[_0xab4a('0xaf')]]||this[_0xab4a('0x13')][_0x10a421[_0xab4a('0xb0')]])&&this[_0xab4a('0x13')][_0x10a421[_0xab4a('0xac')]]){var _0x47d901=_[_0xab4a('0xb1')]([this[_0xab4a('0x13')][_0x10a421[_0xab4a('0xaf')]],this[_0xab4a('0x13')][_0x10a421[_0xab4a('0xb0')]],this[_0xab4a('0x13')][_0x10a421[_0xab4a('0xac')]]],function(_0xd7fee3){return _0xd7fee3&&_0xd7fee3['type']===_0xab4a('0xa3')&&_0xd7fee3[_0xab4a('0xb2')];});if(_0x47d901){if(this[_0xab4a('0x13')][_0x10a421[_0xab4a('0xaf')]])this[_0xab4a('0x13')][_0x10a421[_0xab4a('0xaf')]]['transferType']='ATTENDED';if(this[_0xab4a('0x13')][_0x10a421[_0xab4a('0xb0')]])this[_0xab4a('0x13')][_0x10a421[_0xab4a('0xb0')]][_0xab4a('0x9a')]=_0xab4a('0xad');this['channels'][_0x10a421['secondtransfereruniqueid']][_0xab4a('0x9a')]=_0xab4a('0xad');}}}}catch(_0x48ba70){logger['error']('[%s][voiceCallReport][attendedtransfer]',_0x10a421[_0xab4a('0x2e')],util[_0xab4a('0x26')](_0x48ba70,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xab4a('0x29')][_0xab4a('0xb3')]=function(_0x129ccd){try{if(this[_0xab4a('0x27')](_0x129ccd)){logger['info'](_0xab4a('0xb4'),_0x129ccd[_0xab4a('0x2e')],_0x129ccd['transfereecalleridnum'],_0x129ccd[_0xab4a('0xb5')]);logger['debug'](_0xab4a('0xb6'),_0x129ccd[_0xab4a('0x2e')],util[_0xab4a('0x26')](_0x129ccd,{'showHidden':![],'depth':null}));if(this['channels'][_0x129ccd[_0xab4a('0xa9')]]){this['channels'][_0x129ccd[_0xab4a('0xa9')]][_0xab4a('0xaa')]=_0x129ccd[_0xab4a('0xb7')];this[_0xab4a('0x13')][_0x129ccd['transfereeuniqueid']][_0xab4a('0xab')]=_0x129ccd[_0xab4a('0xb5')];this[_0xab4a('0x13')][_0x129ccd[_0xab4a('0xa9')]][_0xab4a('0x9a')]=_0xab4a('0xb8');this['syncHangup']({'event':_0xab4a('0xa2'),'uniqueid':_0x129ccd[_0xab4a('0xa9')],'linkedid':_0x129ccd[_0xab4a('0xb9')],'context':_0x129ccd[_0xab4a('0x33')],'channel':_0x129ccd[_0xab4a('0xba')]});}else{this[_0xab4a('0x13')][_0x129ccd[_0xab4a('0xb9')]][_0xab4a('0x9a')]=_0xab4a('0xb8');this['syncHangup']({'event':_0xab4a('0xa2'),'uniqueid':_0x129ccd[_0xab4a('0xb9')],'linkedid':_0x129ccd[_0xab4a('0xa9')],'context':_0x129ccd[_0xab4a('0x33')],'channel':_0x129ccd[_0xab4a('0xba')]});}}}catch(_0x4c5ef5){logger[_0xab4a('0x24')](_0xab4a('0xbb'),_0x129ccd[_0xab4a('0x2e')],util[_0xab4a('0x26')](_0x4c5ef5,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xab4a('0x29')]['syncMusicOnHoldStart']=function(_0x6a70a5){try{if(this[_0xab4a('0x27')](_0x6a70a5)){logger[_0xab4a('0x30')](_0xab4a('0xbc'),_0x6a70a5[_0xab4a('0x2e')],util[_0xab4a('0x26')](_0x6a70a5,{'showHidden':![],'depth':null}));if(this[_0xab4a('0x13')][_0x6a70a5[_0xab4a('0x2e')]]){if(!_[_0xab4a('0x5d')](this[_0xab4a('0x13')][_0x6a70a5[_0xab4a('0x2e')]]['answertime'])){this[_0xab4a('0x13')][_0x6a70a5['uniqueid']][_0xab4a('0xbd')]=moment()[_0xab4a('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0xab4a('0x2c')]('[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s',_0x6a70a5[_0xab4a('0x2e')],this[_0xab4a('0x13')][_0x6a70a5[_0xab4a('0x2e')]][_0xab4a('0xbd')]);}}}}catch(_0x38aa25){logger[_0xab4a('0x24')](_0xab4a('0xbe'),_0x6a70a5['uniqueid'],util['inspect'](_0x38aa25,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xab4a('0x29')][_0xab4a('0x22')]=function(_0x1f6239){try{if(this['isNotNull'](_0x1f6239)){logger['debug'](_0xab4a('0xbf'),_0x1f6239[_0xab4a('0x2e')],util[_0xab4a('0x26')](_0x1f6239,{'showHidden':![],'depth':null}));if(this[_0xab4a('0x13')][_0x1f6239['uniqueid']]){if(!_['isNil'](this['channels'][_0x1f6239['uniqueid']]['mohstarttime'])){this['channels'][_0x1f6239['uniqueid']][_0xab4a('0xc0')]+=moment()[_0xab4a('0xc1')](0x0)[_0xab4a('0x63')](this['channels'][_0x1f6239[_0xab4a('0x2e')]][_0xab4a('0xbd')],'seconds');logger['info']('[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s',_0x1f6239['uniqueid'],this[_0xab4a('0x13')][_0x1f6239[_0xab4a('0x2e')]][_0xab4a('0xc0')]);delete this['channels'][_0x1f6239['uniqueid']]['mohstarttime'];}}}}catch(_0x31a89c){logger[_0xab4a('0x24')]('[%s][voiceCallReport][musiconholdstop]',_0x1f6239[_0xab4a('0x2e')],util[_0xab4a('0x26')](_0x31a89c,{'showHidden':![],'depth':null}));}};module[_0xab4a('0xc2')]=VoiceCallReport;
\ No newline at end of file
+var _0xcb39=['application','appdata','startsWith','CDR(routeAlias)','applicationdata','toLowerCase','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','seconds','includes','lastapplication','set','type','[%s][voiceCallReport][newexten]','syncNewState','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','holdtime','diff','xcally-motion-preview','connectedlinename','destinationchannel','toNumber','UserId','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','endsWith','.wav49','replace','.WAV','monitorFilename','monitors','isNil','push','rec','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','syncMixMonitorFilename','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','value','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','destination','calleridpreview','xmcs-queue','sipcalluniqueid','parse','sipcallid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20reason:%s','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','accountcode','user:agentcomplete','length','transferType','resolve','undefined','isEmpty','getSettings','then','stopRecordingOnTransfer','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','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','transfertargetcalleridnum','origtransfereruniqueid','origtransfererlinkedid','some','routeid','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','[%s][voiceCallReport][blindtransfer]\x20event:','transferconnectedlinenum','extension','BLIND','syncHangup','BlindTransfer','transfereruniqueid','transfererchannel','[%s][voiceCallReport][blindtransfer]','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]','lodash','moment','ioredis','../../../config/environment','../../../config/logger','../ami','../rpc/setting','queue','agi','dial','playback','NO\x20ANSWER','FAILED','ANSWERED','redis','defaults','socket.io-emitter','agents','coreshowchannel','bind','newexten','syncNewExten','newchannel','syncNewChannel','varset','syncVarSet','hangup','newcallerid','syncNewCallerId','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','error','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull','isUndefined','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','channels','merge','pick','keys','context','channel','destconnectedlinenum','format','user:%s','split','name','user:agentconnect','connectedlinenum','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','exten','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','channelstate','from-sip','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newchannel]','blindTransfers'];(function(_0x1b453d,_0x1eba29){var _0x428ea4=function(_0x244a5a){while(--_0x244a5a){_0x1b453d['push'](_0x1b453d['shift']());}};_0x428ea4(++_0x1eba29);}(_0xcb39,0x76));var _0x9cb3=function(_0x20f050,_0x4bc6ee){_0x20f050=_0x20f050-0x0;var _0x120f93=_0xcb39[_0x20f050];return _0x120f93;};'use strict';var _=require(_0x9cb3('0x0'));var moment=require(_0x9cb3('0x1'));var util=require('util');var path=require('path');var Redis=require(_0x9cb3('0x2'));var config=require(_0x9cb3('0x3'));var logger=require(_0x9cb3('0x4'))('ami');var ami=require(_0x9cb3('0x5'));var Channel=require('../model/channel');var RpcSetting=require(_0x9cb3('0x6'));var applications=['set',_0x9cb3('0x7'),_0x9cb3('0x8'),_0x9cb3('0x9'),_0x9cb3('0xa'),'voicemail'];var dispositions=[_0x9cb3('0xb'),_0x9cb3('0xc'),_0x9cb3('0xc'),_0x9cb3('0xb'),_0x9cb3('0xb'),'NO\x20ANSWER',_0x9cb3('0xd'),'BUSY',_0x9cb3('0xc'),'FAILED',_0x9cb3('0xc')];config[_0x9cb3('0xe')]=_[_0x9cb3('0xf')](config[_0x9cb3('0xe')],{'host':'localhost','port':0x18eb});var io=require(_0x9cb3('0x10'))(new Redis(config[_0x9cb3('0xe')]));function VoiceCallReport(_0x22e0d3){this['channels']=_0x22e0d3['channels'];this[_0x9cb3('0x11')]=_0x22e0d3[_0x9cb3('0x11')];this['blindTransfers']={};ami['on'](_0x9cb3('0x12'),this['syncNewExten'][_0x9cb3('0x13')](this));ami['on'](_0x9cb3('0x14'),this[_0x9cb3('0x15')][_0x9cb3('0x13')](this));ami['on'](_0x9cb3('0x16'),this[_0x9cb3('0x17')][_0x9cb3('0x13')](this));ami['on']('newstate',this['syncNewState']['bind'](this));ami['on'](_0x9cb3('0x18'),this[_0x9cb3('0x19')][_0x9cb3('0x13')](this));ami['on'](_0x9cb3('0x1a'),this['syncHangup'][_0x9cb3('0x13')](this));ami['on'](_0x9cb3('0x1b'),this[_0x9cb3('0x1c')]['bind'](this));ami['on']('attendedtransfer',this[_0x9cb3('0x1d')]['bind'](this));ami['on'](_0x9cb3('0x1e'),this[_0x9cb3('0x1f')][_0x9cb3('0x13')](this));ami['on'](_0x9cb3('0x20'),this[_0x9cb3('0x21')][_0x9cb3('0x13')](this));ami['on'](_0x9cb3('0x22'),this[_0x9cb3('0x23')][_0x9cb3('0x13')](this));try{logger[_0x9cb3('0x24')](_0x9cb3('0x25'));ami['actionCoreShowChannels']();}catch(_0xe81187){logger[_0x9cb3('0x26')](_0x9cb3('0x27'),util[_0x9cb3('0x28')](_0xe81187,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x9cb3('0x29')][_0x9cb3('0x2a')]=function(_0x24295b){return _0x24295b!==null&&!_[_0x9cb3('0x2b')](_0x24295b);};VoiceCallReport[_0x9cb3('0x29')][_0x9cb3('0x2c')]=function(_0x10caba,_0x31d83e,_0x2b6358){io['to'](_0x10caba)[_0x9cb3('0x2c')](_0x31d83e,_0x2b6358);};VoiceCallReport[_0x9cb3('0x29')][_0x9cb3('0x1c')]=function(_0x3e823d){try{if(this['isNotNull'](_0x3e823d)){logger[_0x9cb3('0x24')](_0x9cb3('0x2d'),_0x3e823d[_0x9cb3('0x2e')],_0x3e823d[_0x9cb3('0x2f')],_0x3e823d[_0x9cb3('0x30')]);logger[_0x9cb3('0x31')](_0x9cb3('0x32'),_0x3e823d['uniqueid'],util['inspect'](_0x3e823d,{'showHidden':![],'depth':null}));if(_0x3e823d[_0x9cb3('0x2e')]===_0x3e823d[_0x9cb3('0x33')]){if(!_[_0x9cb3('0x2b')](this[_0x9cb3('0x34')][_0x3e823d[_0x9cb3('0x2e')]])){_[_0x9cb3('0x35')](this[_0x9cb3('0x34')][_0x3e823d[_0x9cb3('0x2e')]],_[_0x9cb3('0x36')](_0x3e823d,_[_0x9cb3('0x37')](this[_0x9cb3('0x34')][_0x3e823d[_0x9cb3('0x2e')]])));}}if(_0x3e823d[_0x9cb3('0x38')]==='from-sip'){if(this[_0x9cb3('0x11')][_0x3e823d[_0x9cb3('0x39')]['split']('-')[0x0]]){if(_0x3e823d['exten']=='xcally-motion-preview'){this[_0x9cb3('0x11')][_0x3e823d[_0x9cb3('0x39')]['split']('-')[0x0]][_0x9cb3('0x3a')]=_0x3e823d['connectedlinenum'];this[_0x9cb3('0x2c')](util[_0x9cb3('0x3b')](_0x9cb3('0x3c'),this[_0x9cb3('0x11')][_0x3e823d[_0x9cb3('0x39')][_0x9cb3('0x3d')]('-')[0x0]][_0x9cb3('0x3e')]),_0x9cb3('0x3f'),{'destaccountcode':this[_0x9cb3('0x11')][_0x3e823d[_0x9cb3('0x39')][_0x9cb3('0x3d')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x3e823d[_0x9cb3('0x40')]});}}}}}catch(_0x5a7238){logger['error']('[%s][voiceCallReport][newcallerid]',_0x3e823d[_0x9cb3('0x2e')],util[_0x9cb3('0x28')](_0x5a7238,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9cb3('0x29')][_0x9cb3('0x17')]=function(_0xa88cbd){try{if(this[_0x9cb3('0x2a')](_0xa88cbd)){logger[_0x9cb3('0x31')]('[%s][voiceCallReport][newchannel]\x20event:',_0xa88cbd[_0x9cb3('0x2e')],util[_0x9cb3('0x28')](_0xa88cbd,{'showHidden':![],'depth':null}));if(this[_0x9cb3('0x34')][_0xa88cbd[_0x9cb3('0x2e')]])return;if(_0xa88cbd[_0x9cb3('0x39')]===_0x9cb3('0x41'))return;if(_0xa88cbd[_0x9cb3('0x2e')]!==_0xa88cbd['linkedid']&&!this['blindTransfers'][_0xa88cbd[_0x9cb3('0x33')]])return;logger[_0x9cb3('0x24')](_0x9cb3('0x42'),_0xa88cbd[_0x9cb3('0x2e')],_0xa88cbd['context'],_0xa88cbd[_0x9cb3('0x43')]);this[_0x9cb3('0x34')][_0xa88cbd['uniqueid']]=new Channel();this[_0x9cb3('0x34')][_0xa88cbd['uniqueid']][_0x9cb3('0x44')]=moment()[_0x9cb3('0x3b')](_0x9cb3('0x45'));this[_0x9cb3('0x34')][_0xa88cbd[_0x9cb3('0x2e')]][_0x9cb3('0x46')]=dispositions[_['toNumber'](_0xa88cbd[_0x9cb3('0x47')])];_[_0x9cb3('0x35')](this['channels'][_0xa88cbd['uniqueid']],_['pick'](_0xa88cbd,_['keys'](this['channels'][_0xa88cbd[_0x9cb3('0x2e')]])));if(_0xa88cbd['context']===_0x9cb3('0x48')){if(this['agents'][_0xa88cbd[_0x9cb3('0x39')][_0x9cb3('0x3d')]('-')[0x0]]){if(_[_0x9cb3('0x2b')](this[_0x9cb3('0x11')][_0xa88cbd['channel'][_0x9cb3('0x3d')]('-')[0x0]][_0x9cb3('0x3a')])){this[_0x9cb3('0x11')][_0xa88cbd[_0x9cb3('0x39')][_0x9cb3('0x3d')]('-')[0x0]][_0x9cb3('0x3a')]=_0xa88cbd[_0x9cb3('0x43')];logger[_0x9cb3('0x31')](_0x9cb3('0x49'),_0xa88cbd['uniqueid'],util[_0x9cb3('0x28')]({'id':this[_0x9cb3('0x11')][_0xa88cbd[_0x9cb3('0x39')][_0x9cb3('0x3d')]('-')[0x0]]['id'],'destaccountcode':this[_0x9cb3('0x11')][_0xa88cbd[_0x9cb3('0x39')][_0x9cb3('0x3d')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0xa88cbd['exten']},{'showHidden':![],'depth':null}));this['emit'](util[_0x9cb3('0x3b')]('user:%s',this[_0x9cb3('0x11')][_0xa88cbd[_0x9cb3('0x39')][_0x9cb3('0x3d')]('-')[0x0]][_0x9cb3('0x3e')]),_0x9cb3('0x3f'),{'id':this[_0x9cb3('0x11')][_0xa88cbd['channel'][_0x9cb3('0x3d')]('-')[0x0]]['id'],'destaccountcode':this[_0x9cb3('0x11')][_0xa88cbd[_0x9cb3('0x39')][_0x9cb3('0x3d')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0xa88cbd['exten']});}}}}}catch(_0x6d46ca){logger[_0x9cb3('0x26')](_0x9cb3('0x4a'),_0xa88cbd[_0x9cb3('0x2e')],util[_0x9cb3('0x28')](_0x6d46ca,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9cb3('0x29')][_0x9cb3('0x15')]=function(_0x417595){try{if(this[_0x9cb3('0x2a')](_0x417595)){logger[_0x9cb3('0x31')]('[%s][voiceCallReport][newexten]\x20event:',_0x417595['uniqueid'],util['inspect'](_0x417595,{'showHidden':![],'depth':null}));if(_0x417595[_0x9cb3('0x39')]===_0x9cb3('0x41')||_0x417595[_0x9cb3('0x43')]==='h')return;if(_0x417595[_0x9cb3('0x2e')]===_0x417595[_0x9cb3('0x33')]||this[_0x9cb3('0x4b')][_0x417595['linkedid']]){_0x417595[_0x9cb3('0x4c')]=_0x417595[_0x9cb3('0x4c')]['toLowerCase']();_0x417595['applicationdata']=_0x417595[_0x9cb3('0x4d')]&&_0x417595[_0x9cb3('0x4d')][_0x9cb3('0x4e')](_0x9cb3('0x4f'))?_0x417595[_0x9cb3('0x4d')]:(_0x417595['appdata']||_0x417595[_0x9cb3('0x50')])[_0x9cb3('0x51')]();logger[_0x9cb3('0x24')](_0x9cb3('0x52'),_0x417595['uniqueid'],_0x417595[_0x9cb3('0x4c')],_0x417595['applicationdata']);if(_['isUndefined'](this[_0x9cb3('0x34')][_0x417595[_0x9cb3('0x2e')]])){this[_0x9cb3('0x34')][_0x417595['uniqueid']]=new Channel();this['channels'][_0x417595[_0x9cb3('0x2e')]][_0x9cb3('0x44')]=_0x417595[_0x9cb3('0x53')]?moment()['subtract'](moment[_0x9cb3('0x53')](_0x417595[_0x9cb3('0x53')])[_0x9cb3('0x54')](),_0x9cb3('0x54'))[_0x9cb3('0x3b')]('YYYY-MM-DD\x20HH:mm:ss'):moment()[_0x9cb3('0x3b')](_0x9cb3('0x45'));this[_0x9cb3('0x34')][_0x417595[_0x9cb3('0x2e')]][_0x9cb3('0x46')]='NO\x20ANSWER';}_[_0x9cb3('0x35')](this[_0x9cb3('0x34')][_0x417595['uniqueid']],_[_0x9cb3('0x36')](_0x417595,_[_0x9cb3('0x37')](this[_0x9cb3('0x34')][_0x417595[_0x9cb3('0x2e')]])));if(_[_0x9cb3('0x55')](applications,_0x417595[_0x9cb3('0x4c')])){this[_0x9cb3('0x34')][_0x417595[_0x9cb3('0x2e')]][_0x9cb3('0x56')]=_0x417595[_0x9cb3('0x4c')];this[_0x9cb3('0x34')][_0x417595[_0x9cb3('0x2e')]]['lastdata']=_0x417595[_0x9cb3('0x50')];if(_0x417595['application']===_0x9cb3('0x57')&&_[_0x9cb3('0x4e')](_0x417595['applicationdata'][_0x9cb3('0x51')](),'cdr(')){var _0x47fd91=_0x417595[_0x9cb3('0x50')]['split']('=');var _0x3a4372=_0x47fd91[0x0][_0x9cb3('0x51')]()['match'](/cdr\((.*)\)/);if(_0x3a4372){if(_0x3a4372[0x1]===_0x9cb3('0x58')&&!_['isNil'](this[_0x9cb3('0x34')][_0x417595[_0x9cb3('0x2e')]][_0x3a4372[0x1]]))return;this[_0x9cb3('0x34')][_0x417595[_0x9cb3('0x2e')]][_0x3a4372[0x1]]=_0x47fd91[0x1];}}else if(_0x417595[_0x9cb3('0x4c')]==='queue'){this['channels'][_0x417595['uniqueid']]['queue']=_0x417595['applicationdata'][_0x9cb3('0x3d')](',')[0x0];}}}}}catch(_0x335221){logger['error'](_0x9cb3('0x59'),_0x417595[_0x9cb3('0x2e')],util[_0x9cb3('0x28')](_0x335221,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9cb3('0x29')][_0x9cb3('0x5a')]=function(_0x528edc){try{if(this[_0x9cb3('0x2a')](_0x528edc)){logger[_0x9cb3('0x24')]('[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s',_0x528edc['uniqueid'],_0x528edc[_0x9cb3('0x33')],_0x528edc[_0x9cb3('0x2f')],_0x528edc[_0x9cb3('0x30')]);logger[_0x9cb3('0x31')](_0x9cb3('0x5b'),_0x528edc[_0x9cb3('0x2e')],util[_0x9cb3('0x28')](_0x528edc,{'showHidden':![],'depth':null}));if(_0x528edc[_0x9cb3('0x47')]!=='6')return;if(_0x528edc[_0x9cb3('0x2e')]!==_0x528edc[_0x9cb3('0x33')]){var _0x4e0382=moment();if(this['channels'][_0x528edc['linkedid']]){if(!this[_0x9cb3('0x34')][_0x528edc['linkedid']][_0x9cb3('0x5c')]){this[_0x9cb3('0x34')][_0x528edc['linkedid']][_0x9cb3('0x5c')]=!![];this[_0x9cb3('0x34')][_0x528edc[_0x9cb3('0x33')]][_0x9cb3('0x5d')]=_0x4e0382[_0x9cb3('0x3b')](_0x9cb3('0x45'));if(this[_0x9cb3('0x34')][_0x528edc[_0x9cb3('0x33')]][_0x9cb3('0x44')]){this['channels'][_0x528edc[_0x9cb3('0x33')]][_0x9cb3('0x5e')]=_0x4e0382[_0x9cb3('0x5f')](this[_0x9cb3('0x34')][_0x528edc[_0x9cb3('0x33')]]['starttime'],_0x9cb3('0x54'));}}this[_0x9cb3('0x34')][_0x528edc[_0x9cb3('0x33')]][_0x9cb3('0x33')]=_0x528edc[_0x9cb3('0x2e')];if(_0x528edc['calleridnum']!==_0x9cb3('0x60')){this[_0x9cb3('0x34')][_0x528edc[_0x9cb3('0x33')]]['connectedlinenum']=_0x528edc['calleridnum'];}this['channels'][_0x528edc[_0x9cb3('0x33')]][_0x9cb3('0x61')]=_0x528edc['calleridname'];this['channels'][_0x528edc['linkedid']][_0x9cb3('0x62')]=_0x528edc[_0x9cb3('0x39')];this[_0x9cb3('0x34')][_0x528edc['linkedid']][_0x9cb3('0x46')]=dispositions[_[_0x9cb3('0x63')](_0x528edc[_0x9cb3('0x47')])];if(this[_0x9cb3('0x11')][_0x528edc[_0x9cb3('0x39')][_0x9cb3('0x3d')]('-')[0x0]]){this['channels'][_0x528edc[_0x9cb3('0x33')]][_0x9cb3('0x64')]=this[_0x9cb3('0x11')][_0x528edc['channel'][_0x9cb3('0x3d')]('-')[0x0]]['id'];this['channels'][_0x528edc[_0x9cb3('0x33')]]['membername']=this[_0x9cb3('0x11')][_0x528edc[_0x9cb3('0x39')][_0x9cb3('0x3d')]('-')[0x0]]['name'];}}if(this[_0x9cb3('0x34')][_0x528edc[_0x9cb3('0x2e')]]){if(!this[_0x9cb3('0x34')][_0x528edc[_0x9cb3('0x2e')]][_0x9cb3('0x5c')]){this[_0x9cb3('0x34')][_0x528edc[_0x9cb3('0x2e')]][_0x9cb3('0x5c')]=!![];this[_0x9cb3('0x34')][_0x528edc['uniqueid']][_0x9cb3('0x5d')]=_0x4e0382[_0x9cb3('0x3b')](_0x9cb3('0x45'));if(this[_0x9cb3('0x34')][_0x528edc['uniqueid']][_0x9cb3('0x44')]){this['channels'][_0x528edc[_0x9cb3('0x2e')]][_0x9cb3('0x5e')]=_0x4e0382[_0x9cb3('0x5f')](this[_0x9cb3('0x34')][_0x528edc[_0x9cb3('0x2e')]][_0x9cb3('0x44')],_0x9cb3('0x54'));}}if(_0x528edc[_0x9cb3('0x30')]!=='xcally-motion-preview'){this[_0x9cb3('0x34')][_0x528edc['uniqueid']][_0x9cb3('0x40')]=_0x528edc[_0x9cb3('0x30')];}this[_0x9cb3('0x34')][_0x528edc[_0x9cb3('0x2e')]][_0x9cb3('0x61')]=_0x528edc[_0x9cb3('0x2f')];this[_0x9cb3('0x34')][_0x528edc[_0x9cb3('0x2e')]][_0x9cb3('0x62')]=_0x528edc[_0x9cb3('0x39')];this[_0x9cb3('0x34')][_0x528edc[_0x9cb3('0x2e')]][_0x9cb3('0x46')]=dispositions[_[_0x9cb3('0x63')](_0x528edc[_0x9cb3('0x47')])];}}else{if(this[_0x9cb3('0x34')][_0x528edc[_0x9cb3('0x2e')]]){if(this[_0x9cb3('0x11')][_0x528edc[_0x9cb3('0x39')][_0x9cb3('0x3d')]('-')[0x0]]){this[_0x9cb3('0x34')][_0x528edc['uniqueid']][_0x9cb3('0x64')]=this[_0x9cb3('0x11')][_0x528edc[_0x9cb3('0x39')][_0x9cb3('0x3d')]('-')[0x0]]['id'];this['channels'][_0x528edc['uniqueid']][_0x9cb3('0x65')]=this['agents'][_0x528edc[_0x9cb3('0x39')][_0x9cb3('0x3d')]('-')[0x0]][_0x9cb3('0x3e')];}}}if(_0x528edc[_0x9cb3('0x38')]===_0x9cb3('0x48')){if(this[_0x9cb3('0x11')][_0x528edc[_0x9cb3('0x39')][_0x9cb3('0x3d')]('-')[0x0]]){this[_0x9cb3('0x11')][_0x528edc[_0x9cb3('0x39')][_0x9cb3('0x3d')]('-')[0x0]][_0x9cb3('0x3a')]=_0x528edc[_0x9cb3('0x43')];var _0x451b84,_0x10a68c;if(this[_0x9cb3('0x34')][_0x528edc[_0x9cb3('0x2e')]]){_0x451b84=this[_0x9cb3('0x34')][_0x528edc[_0x9cb3('0x2e')]][_0x9cb3('0x66')];_0x10a68c=this[_0x9cb3('0x34')][_0x528edc[_0x9cb3('0x2e')]][_0x9cb3('0x7')];}else if(this['channels'][_0x528edc[_0x9cb3('0x33')]]){_0x451b84=this[_0x9cb3('0x34')][_0x528edc['linkedid']][_0x9cb3('0x66')];_0x10a68c=this[_0x9cb3('0x34')][_0x528edc[_0x9cb3('0x33')]][_0x9cb3('0x7')];}logger[_0x9cb3('0x31')](_0x9cb3('0x67'),_0x528edc[_0x9cb3('0x2e')],util[_0x9cb3('0x28')]({'id':this[_0x9cb3('0x11')][_0x528edc[_0x9cb3('0x39')][_0x9cb3('0x3d')]('-')[0x0]]['id'],'destaccountcode':this[_0x9cb3('0x11')][_0x528edc['channel'][_0x9cb3('0x3d')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x528edc[_0x9cb3('0x43')],'routealias':_0x451b84,'queue':_0x10a68c||undefined},{'showHidden':![],'depth':null}));this[_0x9cb3('0x2c')](util[_0x9cb3('0x3b')](_0x9cb3('0x3c'),this['agents'][_0x528edc[_0x9cb3('0x39')][_0x9cb3('0x3d')]('-')[0x0]][_0x9cb3('0x3e')]),_0x9cb3('0x3f'),{'id':this[_0x9cb3('0x11')][_0x528edc['channel'][_0x9cb3('0x3d')]('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this[_0x9cb3('0x11')][_0x528edc[_0x9cb3('0x39')][_0x9cb3('0x3d')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x528edc['exten'],'routealias':_0x451b84,'queue':_0x10a68c||undefined});}}}}catch(_0x43f401){logger['error'](_0x9cb3('0x68'),_0x528edc['uniqueid'],util[_0x9cb3('0x28')](_0x43f401,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9cb3('0x29')]['syncMixMonitorFilename']=function(_0x1d46c7,_0x59ab86){try{if(this[_0x9cb3('0x34')][_0x1d46c7]){logger[_0x9cb3('0x24')]('[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s',_0x1d46c7,_0x59ab86);this['channels'][_0x1d46c7]['monitor']=!![];if(_[_0x9cb3('0x69')](_0x59ab86,_0x9cb3('0x6a'))){_0x59ab86=_0x59ab86[_0x9cb3('0x6b')](_0x9cb3('0x6a'),_0x9cb3('0x6c'));}this[_0x9cb3('0x34')][_0x1d46c7][_0x9cb3('0x6d')]=_0x59ab86;var _0x5fda06=_['find'](this[_0x9cb3('0x34')][_0x1d46c7][_0x9cb3('0x6e')],{'filename':_0x59ab86});if(_[_0x9cb3('0x6f')](_0x5fda06)){this[_0x9cb3('0x34')][_0x1d46c7]['monitors'][_0x9cb3('0x70')]({'filename':_0x59ab86,'createdAt':moment()['format'](_0x9cb3('0x45')),'mixmonitorid':'','status':_0x9cb3('0x71')});}}}catch(_0x2c39bc){logger[_0x9cb3('0x26')](_0x9cb3('0x72'),_0x1d46c7,util['inspect'](_0x2c39bc,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x9cb3('0x19')]=function(_0x5df3e7){try{if(this[_0x9cb3('0x2a')](_0x5df3e7)){logger[_0x9cb3('0x31')](_0x9cb3('0x73'),_0x5df3e7['uniqueid'],util[_0x9cb3('0x28')](_0x5df3e7,{'showHidden':![],'depth':null}));if(this[_0x9cb3('0x34')][_0x5df3e7[_0x9cb3('0x2e')]]&&_0x5df3e7[_0x9cb3('0x39')]!=_0x9cb3('0x41')){if(this[_0x9cb3('0x2a')](_0x5df3e7[_0x9cb3('0x74')])){if(this['isNotNull'](_0x5df3e7[_0x9cb3('0x74')][_0x9cb3('0x75')])){logger[_0x9cb3('0x24')](_0x9cb3('0x76'),_0x5df3e7['uniqueid'],_0x5df3e7['value']);this[_0x9cb3('0x77')](_0x5df3e7[_0x9cb3('0x2e')],_0x5df3e7['value']);}else if(this['isNotNull'](_0x5df3e7[_0x9cb3('0x74')][_0x9cb3('0x78')])){logger[_0x9cb3('0x24')](_0x9cb3('0x79'),_0x5df3e7['uniqueid'],_0x5df3e7[_0x9cb3('0x7a')]);this['channels'][_0x5df3e7[_0x9cb3('0x2e')]]['calleridnum']=_0x5df3e7[_0x9cb3('0x7a')];}else if(this[_0x9cb3('0x2a')](_0x5df3e7['variable']['xmd-callerid'])){logger[_0x9cb3('0x24')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s',_0x5df3e7[_0x9cb3('0x2e')],_0x5df3e7[_0x9cb3('0x7a')]);this['channels'][_0x5df3e7[_0x9cb3('0x2e')]][_0x9cb3('0x7b')]=_0x5df3e7['value'];}else if(this[_0x9cb3('0x2a')](_0x5df3e7[_0x9cb3('0x74')][_0x9cb3('0x7c')])){logger['info'](_0x9cb3('0x7d'),_0x5df3e7[_0x9cb3('0x2e')],_0x5df3e7[_0x9cb3('0x7a')]);this['channels'][_0x5df3e7['uniqueid']][_0x9cb3('0x58')]=_0x5df3e7[_0x9cb3('0x7a')];}else if(this['isNotNull'](_0x5df3e7['variable'][_0x9cb3('0x7e')])){logger[_0x9cb3('0x24')](_0x9cb3('0x7f'),_0x5df3e7[_0x9cb3('0x2e')],_0x5df3e7[_0x9cb3('0x7a')][_0x9cb3('0x3d')](',')[0x0]);this[_0x9cb3('0x34')][_0x5df3e7[_0x9cb3('0x2e')]][_0x9cb3('0x7')]=_0x5df3e7['value']['split'](',')[0x0];}else if(this['isNotNull'](_0x5df3e7[_0x9cb3('0x74')][_0x9cb3('0x80')])){logger[_0x9cb3('0x24')](_0x9cb3('0x81'),_0x5df3e7[_0x9cb3('0x2e')],_0x5df3e7['value']);this[_0x9cb3('0x34')][_0x5df3e7[_0x9cb3('0x2e')]][_0x9cb3('0x82')]=_0x5df3e7[_0x9cb3('0x7a')];}else if(this['isNotNull'](_0x5df3e7[_0x9cb3('0x74')][_0x9cb3('0x83')])){logger[_0x9cb3('0x24')]('[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s',_0x5df3e7[_0x9cb3('0x2e')],_0x5df3e7[_0x9cb3('0x7a')]);this['channels'][_0x5df3e7[_0x9cb3('0x2e')]][_0x9cb3('0x84')]=_0x5df3e7[_0x9cb3('0x7a')];}else if(this[_0x9cb3('0x2a')](_0x5df3e7[_0x9cb3('0x74')]['xmd-callerid-preview'])){logger[_0x9cb3('0x24')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s',_0x5df3e7['uniqueid'],_0x5df3e7[_0x9cb3('0x7a')]);this[_0x9cb3('0x34')][_0x5df3e7['uniqueid']][_0x9cb3('0x85')]=_0x5df3e7[_0x9cb3('0x7a')];}else if(this[_0x9cb3('0x2a')](_0x5df3e7[_0x9cb3('0x74')][_0x9cb3('0x86')])){logger[_0x9cb3('0x24')]('[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s',_0x5df3e7[_0x9cb3('0x2e')],_0x5df3e7[_0x9cb3('0x7a')]);this['channels'][_0x5df3e7[_0x9cb3('0x2e')]][_0x9cb3('0x7')]=_0x5df3e7[_0x9cb3('0x7a')];}else if(this['isNotNull'](_0x5df3e7[_0x9cb3('0x74')]['sipcallid'])){logger['info']('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x5df3e7['uniqueid'],_0x5df3e7[_0x9cb3('0x7a')]);this[_0x9cb3('0x34')][_0x5df3e7[_0x9cb3('0x2e')]][_0x9cb3('0x87')]=_0x5df3e7['value'];}}}else if(this['isNotNull'](_0x5df3e7[_0x9cb3('0x74')][_0x9cb3('0x75')])){if(_0x5df3e7[_0x9cb3('0x7a')]){var _0x15c238=path[_0x9cb3('0x88')](_0x5df3e7['value'])[_0x9cb3('0x3e')];logger[_0x9cb3('0x24')](_0x9cb3('0x76'),_0x15c238,_0x5df3e7[_0x9cb3('0x7a')]);this[_0x9cb3('0x77')](_0x15c238,_0x5df3e7[_0x9cb3('0x7a')]);}}else if(this[_0x9cb3('0x34')][_0x5df3e7[_0x9cb3('0x33')]]){if(this[_0x9cb3('0x2a')](_0x5df3e7['variable'])){if(this['isNotNull'](_0x5df3e7[_0x9cb3('0x74')][_0x9cb3('0x89')])){logger[_0x9cb3('0x24')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x5df3e7[_0x9cb3('0x33')],_0x5df3e7[_0x9cb3('0x7a')]);this[_0x9cb3('0x34')][_0x5df3e7[_0x9cb3('0x33')]]['sipcalllinkedid']=_0x5df3e7[_0x9cb3('0x7a')];}}}}}catch(_0x3a8294){logger['error'](_0x9cb3('0x8a'),_0x5df3e7[_0x9cb3('0x2e')],util[_0x9cb3('0x28')](_0x3a8294,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9cb3('0x29')]['syncHangup']=function(_0x3e05ff){try{if(this['isNotNull'](_0x3e05ff)){logger[_0x9cb3('0x31')]('[%s][voiceCallReport][hangup]\x20event:',_0x3e05ff[_0x9cb3('0x2e')],util[_0x9cb3('0x28')](_0x3e05ff,{'showHidden':![],'depth':null}));if(this['blindTransfers'][_0x3e05ff[_0x9cb3('0x33')]]){if(this[_0x9cb3('0x34')][this[_0x9cb3('0x4b')][_0x3e05ff[_0x9cb3('0x33')]]['linkedid']]){this['channels'][this[_0x9cb3('0x4b')][_0x3e05ff[_0x9cb3('0x33')]]['linkedid']][_0x9cb3('0x2e')]=_0x3e05ff[_0x9cb3('0x2e')];this['channels'][this['blindTransfers'][_0x3e05ff[_0x9cb3('0x33')]]['linkedid']]['answered']=this['channels'][_0x3e05ff[_0x9cb3('0x2e')]][_0x9cb3('0x5c')];this[_0x9cb3('0x34')][this[_0x9cb3('0x4b')][_0x3e05ff['linkedid']][_0x9cb3('0x33')]]['answertime']=this[_0x9cb3('0x34')][_0x3e05ff['uniqueid']]['answertime'];this[_0x9cb3('0x34')][this[_0x9cb3('0x4b')][_0x3e05ff[_0x9cb3('0x33')]][_0x9cb3('0x33')]][_0x9cb3('0x62')]=this[_0x9cb3('0x34')][this[_0x9cb3('0x4b')][_0x3e05ff[_0x9cb3('0x33')]][_0x9cb3('0x33')]]['channel'];this[_0x9cb3('0x34')][this['blindTransfers'][_0x3e05ff[_0x9cb3('0x33')]][_0x9cb3('0x33')]]['disposition']=this[_0x9cb3('0x34')][_0x3e05ff[_0x9cb3('0x2e')]][_0x9cb3('0x46')];this[_0x9cb3('0x34')][_0x3e05ff[_0x9cb3('0x2e')]]=this[_0x9cb3('0x34')][this[_0x9cb3('0x4b')][_0x3e05ff[_0x9cb3('0x33')]][_0x9cb3('0x33')]];delete this[_0x9cb3('0x34')][this['blindTransfers'][_0x3e05ff[_0x9cb3('0x33')]][_0x9cb3('0x33')]];}else if(this[_0x9cb3('0x34')][this[_0x9cb3('0x4b')][_0x3e05ff['linkedid']][_0x9cb3('0x2e')]]){this[_0x9cb3('0x34')][this[_0x9cb3('0x4b')][_0x3e05ff[_0x9cb3('0x33')]]['uniqueid']]['uniqueid']=[this[_0x9cb3('0x34')][this[_0x9cb3('0x4b')][_0x3e05ff['linkedid']][_0x9cb3('0x2e')]][_0x9cb3('0x33')],this[_0x9cb3('0x34')][this[_0x9cb3('0x4b')][_0x3e05ff[_0x9cb3('0x33')]]['uniqueid']]['linkedid']=this[_0x9cb3('0x34')][this[_0x9cb3('0x4b')][_0x3e05ff[_0x9cb3('0x33')]][_0x9cb3('0x2e')]]['uniqueid']][0x0];this[_0x9cb3('0x34')][this[_0x9cb3('0x4b')][_0x3e05ff['linkedid']]['uniqueid']][_0x9cb3('0x5c')]=this[_0x9cb3('0x34')][_0x3e05ff[_0x9cb3('0x2e')]]['answered'];this[_0x9cb3('0x34')][this[_0x9cb3('0x4b')][_0x3e05ff['linkedid']][_0x9cb3('0x2e')]]['answertime']=this[_0x9cb3('0x34')][_0x3e05ff['uniqueid']][_0x9cb3('0x5d')];this['channels'][this[_0x9cb3('0x4b')][_0x3e05ff['linkedid']]['uniqueid']][_0x9cb3('0x62')]=this['channels'][this[_0x9cb3('0x4b')][_0x3e05ff[_0x9cb3('0x33')]]['uniqueid']]['channel'];this['channels'][this[_0x9cb3('0x4b')][_0x3e05ff['linkedid']]['uniqueid']]['disposition']=this[_0x9cb3('0x34')][_0x3e05ff[_0x9cb3('0x2e')]][_0x9cb3('0x46')];this['channels'][_0x3e05ff['uniqueid']]=this[_0x9cb3('0x34')][this[_0x9cb3('0x4b')][_0x3e05ff[_0x9cb3('0x33')]][_0x9cb3('0x2e')]];delete this['channels'][this[_0x9cb3('0x4b')][_0x3e05ff[_0x9cb3('0x33')]][_0x9cb3('0x2e')]];}}if(this['channels'][_0x3e05ff['uniqueid']]){logger[_0x9cb3('0x24')](_0x9cb3('0x8b'),_0x3e05ff['uniqueid'],_0x3e05ff['cause-txt']);var _0x71cd40=moment();this['channels'][_0x3e05ff[_0x9cb3('0x2e')]]['endtime']=_0x71cd40[_0x9cb3('0x3b')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x9cb3('0x34')][_0x3e05ff[_0x9cb3('0x2e')]]['duration']=_0x71cd40[_0x9cb3('0x5f')](this[_0x9cb3('0x34')][_0x3e05ff['uniqueid']]['starttime'],_0x9cb3('0x54'));if(this[_0x9cb3('0x34')][_0x3e05ff['uniqueid']][_0x9cb3('0x5c')]){this[_0x9cb3('0x34')][_0x3e05ff[_0x9cb3('0x2e')]][_0x9cb3('0x8c')]=_0x71cd40[_0x9cb3('0x5f')](this[_0x9cb3('0x34')][_0x3e05ff['uniqueid']][_0x9cb3('0x5d')],'seconds');this[_0x9cb3('0x34')][_0x3e05ff[_0x9cb3('0x2e')]][_0x9cb3('0x5e')]=this['channels'][_0x3e05ff[_0x9cb3('0x2e')]]['duration']-this[_0x9cb3('0x34')][_0x3e05ff['uniqueid']][_0x9cb3('0x8c')];}if(_0x3e05ff[_0x9cb3('0x38')]===_0x9cb3('0x48')){if(this[_0x9cb3('0x11')][_0x3e05ff[_0x9cb3('0x39')]['split']('-')[0x0]]){this[_0x9cb3('0x11')][_0x3e05ff[_0x9cb3('0x39')][_0x9cb3('0x3d')]('-')[0x0]]=_[_0x9cb3('0x8d')](this[_0x9cb3('0x11')][_0x3e05ff['channel'][_0x9cb3('0x3d')]('-')[0x0]],[_0x9cb3('0x3a')]);logger['debug'](_0x9cb3('0x8e'),_0x3e05ff['uniqueid'],util['inspect']({'id':this[_0x9cb3('0x11')][_0x3e05ff[_0x9cb3('0x39')][_0x9cb3('0x3d')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x3e05ff['channel']['split']('-')[0x0]][_0x9cb3('0x8f')]},{'showHidden':![],'depth':null}));this[_0x9cb3('0x2c')](util[_0x9cb3('0x3b')](_0x9cb3('0x3c'),this[_0x9cb3('0x11')][_0x3e05ff[_0x9cb3('0x39')][_0x9cb3('0x3d')]('-')[0x0]][_0x9cb3('0x3e')]),_0x9cb3('0x90'),{'id':this[_0x9cb3('0x11')][_0x3e05ff['channel']['split']('-')[0x0]]['id'],'destaccountcode':this[_0x9cb3('0x11')][_0x3e05ff[_0x9cb3('0x39')][_0x9cb3('0x3d')]('-')[0x0]][_0x9cb3('0x8f')]});for(var _0x36ddf6=0x0;_0x36ddf6<Object['keys'](this[_0x9cb3('0x11')])[_0x9cb3('0x91')];_0x36ddf6++){var _0x2319fd=Object['keys'](this[_0x9cb3('0x11')])[_0x36ddf6];var _0x8e73ab=this[_0x9cb3('0x11')][_0x2319fd];if(_0x8e73ab['accountcode']===Number(_0x3e05ff['connectedlinenum'])){this[_0x9cb3('0x2c')](util[_0x9cb3('0x3b')](_0x9cb3('0x3c'),_0x8e73ab[_0x9cb3('0x3e')]),_0x9cb3('0x90'),{'id':_0x8e73ab['id'],'destaccountcode':_0x8e73ab[_0x9cb3('0x8f')],'transfer':this['channels'][_0x3e05ff[_0x9cb3('0x2e')]][_0x9cb3('0x92')]});break;}}}}var _0x1237a7=this;Promise[_0x9cb3('0x93')]()['then'](function(){var _0x5e41b6=_0x1237a7['channels'][_0x3e05ff['uniqueid']];if(typeof _0x5e41b6[_0x9cb3('0x92')]===_0x9cb3('0x94'))return;if(_[_0x9cb3('0x95')](_0x5e41b6[_0x9cb3('0x6e')]))return;return RpcSetting[_0x9cb3('0x96')]()[_0x9cb3('0x97')](function(_0x2fde11){if(!_0x2fde11[_0x9cb3('0x98')])return;return Promise[_0x9cb3('0x93')]()[_0x9cb3('0x97')](function(){return ami[_0x9cb3('0x99')]({'action':_0x9cb3('0x9a'),'channel':_0x5e41b6['channel']})[_0x9cb3('0x9b')](function(){});})[_0x9cb3('0x97')](function(){return ami[_0x9cb3('0x99')]({'action':_0x9cb3('0x9a'),'channel':_0x5e41b6[_0x9cb3('0x62')]})[_0x9cb3('0x9b')](function(){})[_0x9cb3('0x9c')](function(){var _0x17c30d=_0x1237a7[_0x9cb3('0x11')][_0x5e41b6[_0x9cb3('0x62')][_0x9cb3('0x3d')]('-')[0x0]];if(!_0x17c30d)return;io['emit'](_0x9cb3('0x9d'),{'agentId':_0x17c30d['id'],'uniqueid':_0x5e41b6[_0x9cb3('0x2e')]});});});});})['then'](function(){if(_0x3e05ff[_0x9cb3('0x9e')]==='BlindTransfer'){_0x1237a7[_0x9cb3('0x4b')][_0x3e05ff[_0x9cb3('0x2e')]]=_0x3e05ff;}else{if(_0x1237a7['channels'][_0x3e05ff[_0x9cb3('0x2e')]]['type']===_0x9cb3('0x9f')&&_0x1237a7[_0x9cb3('0x4b')][_0x3e05ff[_0x9cb3('0x2e')]]){_0x1237a7[_0x9cb3('0x34')][_0x3e05ff[_0x9cb3('0x2e')]][_0x9cb3('0x2e')]=[_0x1237a7[_0x9cb3('0x34')][_0x3e05ff[_0x9cb3('0x2e')]][_0x9cb3('0x33')],_0x1237a7['channels'][_0x3e05ff[_0x9cb3('0x2e')]][_0x9cb3('0x33')]=_0x1237a7[_0x9cb3('0x34')][_0x3e05ff[_0x9cb3('0x2e')]][_0x9cb3('0x2e')]][0x0];delete _0x1237a7[_0x9cb3('0x4b')][_0x3e05ff[_0x9cb3('0x2e')]];}}logger[_0x9cb3('0x31')](_0x9cb3('0xa0'),_0x3e05ff[_0x9cb3('0x2e')],util[_0x9cb3('0x28')](_0x1237a7[_0x9cb3('0x34')][_0x3e05ff[_0x9cb3('0x2e')]],{'showHidden':![],'depth':null}));ami[_0x9cb3('0x2c')](_0x9cb3('0xa1'),_0x1237a7[_0x9cb3('0x34')][_0x3e05ff[_0x9cb3('0x2e')]]);delete _0x1237a7['channels'][_0x3e05ff['uniqueid']];});}}}catch(_0x1eec24){logger['error'](_0x9cb3('0xa2'),_0x3e05ff[_0x9cb3('0x2e')],util['inspect'](_0x1eec24,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9cb3('0x29')][_0x9cb3('0x1d')]=function(_0x49fb2b){try{if(this[_0x9cb3('0x2a')](_0x49fb2b)){logger[_0x9cb3('0x24')](_0x9cb3('0xa3'),_0x49fb2b['uniqueid'],_0x49fb2b[_0x9cb3('0xa4')],_0x49fb2b['transfertargetcalleridnum']);logger[_0x9cb3('0x31')](_0x9cb3('0xa5'),_0x49fb2b[_0x9cb3('0x2e')],util[_0x9cb3('0x28')](_0x49fb2b,{'showHidden':![],'depth':null}));var _0x38aee2;if(this[_0x9cb3('0x34')][_0x49fb2b[_0x9cb3('0xa6')]]){this[_0x9cb3('0x34')][_0x49fb2b[_0x9cb3('0xa6')]][_0x9cb3('0xa7')]=_0x49fb2b['origtransferercalleridnum'];this[_0x9cb3('0x34')][_0x49fb2b[_0x9cb3('0xa6')]]['transferconnectedlinenum']=_0x49fb2b['transfertargetcalleridnum'];if(this['channels'][_0x49fb2b[_0x9cb3('0xa8')]]){_0x38aee2=this[_0x9cb3('0x34')][_0x49fb2b[_0x9cb3('0xa8')]];this['channels'][_0x49fb2b['secondtransfereruniqueid']]=this[_0x9cb3('0x34')][_0x49fb2b['transfereeuniqueid']];this['channels'][_0x49fb2b[_0x9cb3('0xa6')]]=_0x38aee2;}this[_0x9cb3('0x34')][_0x49fb2b[_0x9cb3('0xa8')]][_0x9cb3('0x92')]=_0x9cb3('0xa9');}else if(this[_0x9cb3('0x34')][_0x49fb2b[_0x9cb3('0xaa')]]){this[_0x9cb3('0x34')][_0x49fb2b[_0x9cb3('0xaa')]][_0x9cb3('0xa7')]=_0x49fb2b['origtransferercalleridnum'];this[_0x9cb3('0x34')][_0x49fb2b[_0x9cb3('0xaa')]]['transferconnectedlinenum']=_0x49fb2b[_0x9cb3('0xab')];if(this[_0x9cb3('0x34')][_0x49fb2b[_0x9cb3('0xac')]]){_0x38aee2=this[_0x9cb3('0x34')][_0x49fb2b[_0x9cb3('0xac')]];this[_0x9cb3('0x34')][_0x49fb2b[_0x9cb3('0xac')]]=this['channels'][_0x49fb2b[_0x9cb3('0xaa')]];this[_0x9cb3('0x34')][_0x49fb2b[_0x9cb3('0xaa')]]=_0x38aee2;}this['channels'][_0x49fb2b[_0x9cb3('0xaa')]]['transferType']='ATTENDED';}if((this[_0x9cb3('0x34')][_0x49fb2b[_0x9cb3('0xac')]]||this[_0x9cb3('0x34')][_0x49fb2b[_0x9cb3('0xad')]])&&this[_0x9cb3('0x34')][_0x49fb2b[_0x9cb3('0xa8')]]){var _0x31e265=_[_0x9cb3('0xae')]([this[_0x9cb3('0x34')][_0x49fb2b[_0x9cb3('0xac')]],this['channels'][_0x49fb2b['origtransfererlinkedid']],this[_0x9cb3('0x34')][_0x49fb2b[_0x9cb3('0xa8')]]],function(_0xc7e58){return _0xc7e58&&_0xc7e58['type']===_0x9cb3('0x9f')&&_0xc7e58[_0x9cb3('0xaf')];});if(_0x31e265){if(this[_0x9cb3('0x34')][_0x49fb2b[_0x9cb3('0xac')]])this[_0x9cb3('0x34')][_0x49fb2b[_0x9cb3('0xac')]]['transferType']=_0x9cb3('0xa9');if(this[_0x9cb3('0x34')][_0x49fb2b[_0x9cb3('0xad')]])this[_0x9cb3('0x34')][_0x49fb2b[_0x9cb3('0xad')]][_0x9cb3('0x92')]=_0x9cb3('0xa9');this[_0x9cb3('0x34')][_0x49fb2b[_0x9cb3('0xa8')]][_0x9cb3('0x92')]='ATTENDED';}}}}catch(_0xa2c66e){logger[_0x9cb3('0x26')](_0x9cb3('0xb0'),_0x49fb2b[_0x9cb3('0x2e')],util[_0x9cb3('0x28')](_0xa2c66e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9cb3('0x29')]['syncBlindTransfer']=function(_0x4f9fc6){try{if(this[_0x9cb3('0x2a')](_0x4f9fc6)){logger[_0x9cb3('0x24')](_0x9cb3('0xb1'),_0x4f9fc6[_0x9cb3('0x2e')],_0x4f9fc6[_0x9cb3('0xb2')],_0x4f9fc6['extension']);logger[_0x9cb3('0x31')](_0x9cb3('0xb3'),_0x4f9fc6[_0x9cb3('0x2e')],util[_0x9cb3('0x28')](_0x4f9fc6,{'showHidden':![],'depth':null}));if(this[_0x9cb3('0x34')][_0x4f9fc6['transfereeuniqueid']]){this[_0x9cb3('0x34')][_0x4f9fc6['transfereeuniqueid']][_0x9cb3('0xa7')]=_0x4f9fc6[_0x9cb3('0xb2')];this['channels'][_0x4f9fc6[_0x9cb3('0xa6')]][_0x9cb3('0xb4')]=_0x4f9fc6[_0x9cb3('0xb5')];this[_0x9cb3('0x34')][_0x4f9fc6['transfereeuniqueid']]['transferType']=_0x9cb3('0xb6');this[_0x9cb3('0xb7')]({'event':_0x9cb3('0xb8'),'uniqueid':_0x4f9fc6[_0x9cb3('0xa6')],'linkedid':_0x4f9fc6[_0x9cb3('0xb9')],'context':_0x4f9fc6['context'],'channel':_0x4f9fc6[_0x9cb3('0xba')]});}else{this[_0x9cb3('0x34')][_0x4f9fc6[_0x9cb3('0xb9')]]['transferType']='BLIND';this[_0x9cb3('0xb7')]({'event':_0x9cb3('0xb8'),'uniqueid':_0x4f9fc6[_0x9cb3('0xb9')],'linkedid':_0x4f9fc6[_0x9cb3('0xa6')],'context':_0x4f9fc6[_0x9cb3('0x38')],'channel':_0x4f9fc6[_0x9cb3('0xba')]});}}}catch(_0x31d51e){logger[_0x9cb3('0x26')](_0x9cb3('0xbb'),_0x4f9fc6['uniqueid'],util[_0x9cb3('0x28')](_0x31d51e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9cb3('0x29')][_0x9cb3('0x21')]=function(_0x2313ea){try{if(this[_0x9cb3('0x2a')](_0x2313ea)){logger[_0x9cb3('0x31')]('[%s][voiceCallReport][musiconholdstart]\x20event:',_0x2313ea['uniqueid'],util[_0x9cb3('0x28')](_0x2313ea,{'showHidden':![],'depth':null}));if(this[_0x9cb3('0x34')][_0x2313ea[_0x9cb3('0x2e')]]){if(!_[_0x9cb3('0x6f')](this[_0x9cb3('0x34')][_0x2313ea[_0x9cb3('0x2e')]]['answertime'])){this[_0x9cb3('0x34')][_0x2313ea[_0x9cb3('0x2e')]][_0x9cb3('0xbc')]=moment()[_0x9cb3('0x3b')](_0x9cb3('0x45'));logger[_0x9cb3('0x24')](_0x9cb3('0xbd'),_0x2313ea['uniqueid'],this[_0x9cb3('0x34')][_0x2313ea['uniqueid']]['mohstarttime']);}}}}catch(_0x428bfd){logger['error'](_0x9cb3('0xbe'),_0x2313ea[_0x9cb3('0x2e')],util[_0x9cb3('0x28')](_0x428bfd,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9cb3('0x29')][_0x9cb3('0x23')]=function(_0x2fed4f){try{if(this[_0x9cb3('0x2a')](_0x2fed4f)){logger['debug']('[%s][voiceCallReport][musiconholdstop]\x20event:',_0x2fed4f[_0x9cb3('0x2e')],util[_0x9cb3('0x28')](_0x2fed4f,{'showHidden':![],'depth':null}));if(this[_0x9cb3('0x34')][_0x2fed4f['uniqueid']]){if(!_[_0x9cb3('0x6f')](this[_0x9cb3('0x34')][_0x2fed4f[_0x9cb3('0x2e')]][_0x9cb3('0xbc')])){this[_0x9cb3('0x34')][_0x2fed4f['uniqueid']][_0x9cb3('0xbf')]+=moment()[_0x9cb3('0xc0')](0x0)[_0x9cb3('0x5f')](this['channels'][_0x2fed4f['uniqueid']][_0x9cb3('0xbc')],_0x9cb3('0x54'));logger[_0x9cb3('0x24')]('[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s',_0x2fed4f['uniqueid'],this[_0x9cb3('0x34')][_0x2fed4f['uniqueid']][_0x9cb3('0xbf')]);delete this[_0x9cb3('0x34')][_0x2fed4f[_0x9cb3('0x2e')]][_0x9cb3('0xbc')];}}}}catch(_0x5a91e0){logger[_0x9cb3('0x26')](_0x9cb3('0xc1'),_0x2fed4f[_0x9cb3('0x2e')],util[_0x9cb3('0x28')](_0x5a91e0,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport;
\ No newline at end of file
index 7d8d2d7..22e3f7b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4819=['applications','dialbegin','bind','syncDialEnd','varset','syncVarSet','hangup','syncHangup','prototype','isUndefined','emit','syncDialBegin','debug','uniqueid','inspect','called','channel','substring','lastIndexOf','omit','privilege','info','membername','interface','merge','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','dialstatus','connectedlinenum','connectedlinename','answertime','format','YYYY-MM-DD\x20HH:mm:ss','connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound','[%s][voiceDialReport][dialend]','isNotNull','addVariable','value','variable','outboundrouteid','variables','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','keys','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberpenalty','memberrealtime','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','duration','endtime','diff','starttime','seconds','total','answered','holdtime','billableseconds','sumDuration','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','syncNewExten','set','applicationdata','startsWith','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','match','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','socket.io-emitter','channels','outboundChannels','outbound'];(function(_0x7c8ead,_0x3bc185){var _0x4f085a=function(_0x476d8){while(--_0x476d8){_0x7c8ead['push'](_0x7c8ead['shift']());}};_0x4f085a(++_0x3bc185);}(_0x4819,0xcd));var _0x9481=function(_0x49fbb1,_0x4e7b6d){_0x49fbb1=_0x49fbb1-0x0;var _0x599efc=_0x4819[_0x49fbb1];return _0x599efc;};'use strict';var _=require('lodash');var moment=require(_0x9481('0x0'));var util=require(_0x9481('0x1'));var Redis=require(_0x9481('0x2'));var config=require(_0x9481('0x3'));var logger=require(_0x9481('0x4'))(_0x9481('0x5'));var ami=require(_0x9481('0x6'));config[_0x9481('0x7')]=_[_0x9481('0x8')](config[_0x9481('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x9481('0x9'))(new Redis(config['redis']));function VoiceDialReport(_0x54cc78){this[_0x9481('0xa')]=_0x54cc78[_0x9481('0xb')];this[_0x9481('0xc')]=_0x54cc78[_0x9481('0xc')];this[_0x9481('0xd')]={};this['variables']={};ami['on'](_0x9481('0xe'),this['syncDialBegin'][_0x9481('0xf')](this));ami['on']('dialend',this[_0x9481('0x10')][_0x9481('0xf')](this));ami['on'](_0x9481('0x11'),this[_0x9481('0x12')][_0x9481('0xf')](this));ami['on'](_0x9481('0x13'),this[_0x9481('0x14')][_0x9481('0xf')](this));}VoiceDialReport[_0x9481('0x15')]['isNotNull']=function(_0x5aac02){return _0x5aac02!==null&&!_[_0x9481('0x16')](_0x5aac02);};VoiceDialReport[_0x9481('0x15')][_0x9481('0x17')]=function(_0x28fcb6,_0x3d23c2,_0xc7a0b5){io['to'](_0x28fcb6)[_0x9481('0x17')](_0x3d23c2,_0xc7a0b5);};VoiceDialReport['prototype'][_0x9481('0x18')]=function(_0x7a7ee){try{if(this['isNotNull'](_0x7a7ee)){logger[_0x9481('0x19')]('[%s][voiceDialReport][dialbegin]\x20event:',_0x7a7ee[_0x9481('0x1a')],util[_0x9481('0x1b')](_0x7a7ee,{'showHidden':![],'depth':null}));if(this[_0x9481('0xa')][_0x7a7ee[_0x9481('0x1a')]]){_['merge'](this['channels'][_0x7a7ee[_0x9481('0x1a')]],{'starttime':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0x9481('0x1c'),'interface':_0x7a7ee[_0x9481('0x1d')][_0x9481('0x1e')](0x0,_0x7a7ee[_0x9481('0x1d')][_0x9481('0x1f')]('-')),'membername':_0x7a7ee[_0x9481('0x1d')]['substring'](_0x7a7ee[_0x9481('0x1d')][_0x9481('0x1f')]('/')+0x1,_0x7a7ee[_0x9481('0x1d')][_0x9481('0x1f')]('-'))},_[_0x9481('0x20')](_0x7a7ee,['event',_0x9481('0x21')]));logger[_0x9481('0x22')]('[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called',_0x7a7ee[_0x9481('0x1a')],this[_0x9481('0xa')][_0x7a7ee[_0x9481('0x1a')]][_0x9481('0x23')],this[_0x9481('0xa')][_0x7a7ee['uniqueid']][_0x9481('0x24')]);logger[_0x9481('0x19')]('[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:',_0x7a7ee['uniqueid'],util[_0x9481('0x1b')](this[_0x9481('0xa')][_0x7a7ee['uniqueid']],{'showHidden':![],'depth':null}));if(this[_0x9481('0xd')][_0x7a7ee[_0x9481('0x1a')]])_[_0x9481('0x25')](this[_0x9481('0xa')][_0x7a7ee['uniqueid']],this[_0x9481('0xd')][_0x7a7ee[_0x9481('0x1a')]]);this[_0x9481('0x17')]('voice:outbound',_0x9481('0x26'),this['channels'][_0x7a7ee[_0x9481('0x1a')]]);logger[_0x9481('0x19')](_0x9481('0x27'),_0x7a7ee[_0x9481('0x1a')],util[_0x9481('0x1b')](this['channels'][_0x7a7ee[_0x9481('0x1a')]],{'showHidden':![],'depth':null}));ami[_0x9481('0x17')](_0x9481('0x28'),this['channels'][_0x7a7ee['uniqueid']]);}}}catch(_0x1addc8){logger[_0x9481('0x29')](_0x9481('0x2a'),_0x7a7ee[_0x9481('0x1a')],util['inspect'](_0x1addc8,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['syncDialEnd']=function(_0x29e6b6){try{if(this['isNotNull'](_0x29e6b6)){logger[_0x9481('0x19')]('[%s][voiceDialReport][dialend]\x20event:',_0x29e6b6[_0x9481('0x1a')],util[_0x9481('0x1b')](_0x29e6b6,{'showHidden':![],'depth':null}));if(this[_0x9481('0xa')][_0x29e6b6[_0x9481('0x1a')]]){this[_0x9481('0xa')][_0x29e6b6['uniqueid']][_0x9481('0x2b')]=_0x29e6b6[_0x9481('0x2b')];if(_0x29e6b6[_0x9481('0x2b')]==='ANSWER'){this[_0x9481('0xa')][_0x29e6b6[_0x9481('0x1a')]][_0x9481('0x2c')]=_0x29e6b6[_0x9481('0x2c')];this[_0x9481('0xa')][_0x29e6b6[_0x9481('0x1a')]]['connectedlinename']=_0x29e6b6[_0x9481('0x2d')];this['channels'][_0x29e6b6[_0x9481('0x1a')]][_0x9481('0x2e')]=moment()[_0x9481('0x2f')](_0x9481('0x30'));this[_0x9481('0xa')][_0x29e6b6[_0x9481('0x1a')]]['lastevent']=_0x9481('0x31');logger[_0x9481('0x22')]('[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect',_0x29e6b6['uniqueid'],_0x29e6b6[_0x9481('0x1d')]['substring'](_0x29e6b6[_0x9481('0x1d')][_0x9481('0x1f')]('/')+0x1,_0x29e6b6[_0x9481('0x1d')][_0x9481('0x1f')]('-')));logger['debug'](_0x9481('0x32'),_0x29e6b6['uniqueid'],util[_0x9481('0x1b')](this['channels'][_0x29e6b6[_0x9481('0x1a')]],{'showHidden':![],'depth':null}));ami['emit'](_0x9481('0x33'),this[_0x9481('0xa')][_0x29e6b6[_0x9481('0x1a')]]);}logger[_0x9481('0x19')](_0x9481('0x34'),_0x29e6b6[_0x9481('0x1a')],util[_0x9481('0x1b')](this['channels'][_0x29e6b6[_0x9481('0x1a')]],{'showHidden':![],'depth':null}));this[_0x9481('0x17')](_0x9481('0x35'),_0x9481('0x26'),this[_0x9481('0xa')][_0x29e6b6[_0x9481('0x1a')]]);}}}catch(_0x2e4241){logger['error'](_0x9481('0x36'),_0x29e6b6[_0x9481('0x1a')],util['inspect'](_0x2e4241,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x9481('0x15')][_0x9481('0x12')]=function(_0x1eee80){try{if(this[_0x9481('0x37')](_0x1eee80)){logger[_0x9481('0x19')]('[%s][voiceDialReport][varset]\x20event:',_0x1eee80[_0x9481('0x1a')],util['inspect'](_0x1eee80,{'showHidden':![],'depth':null}));this[_0x9481('0x38')](_0x1eee80[_0x9481('0x1a')],_['keys'](_0x1eee80['variable'])[0x0],_0x1eee80[_0x9481('0x39')]);if(this[_0x9481('0x37')](_0x1eee80[_0x9481('0x3a')])&&this['isNotNull'](_0x1eee80[_0x9481('0x3a')][_0x9481('0x3b')])){if(_['isUndefined'](this['channels'][_0x1eee80[_0x9481('0x1a')]])){this['channels'][_0x1eee80[_0x9481('0x1a')]]={'routeId':_0x1eee80[_0x9481('0x39')],'variables':this[_0x9481('0x3c')][_0x1eee80[_0x9481('0x1a')]],'motionChannel':_0x9481('0x3d')};logger['info'](_0x9481('0x3e'),_0x1eee80[_0x9481('0x1a')],_0x1eee80['variable'][_0x9481('0x3b')],_[_0x9481('0x3f')](_0x1eee80[_0x9481('0x3a')])[0x0],_0x1eee80[_0x9481('0x39')]);logger[_0x9481('0x19')](_0x9481('0x40'),_0x1eee80[_0x9481('0x1a')],util[_0x9481('0x1b')](this[_0x9481('0xa')][_0x1eee80['uniqueid']],{'showHidden':![],'depth':null}));this[_0x9481('0x17')]('voice:outbound','voice_outbound_channel:save',this[_0x9481('0xa')][_0x1eee80['uniqueid']]);}}}}catch(_0x2b174b){logger[_0x9481('0x29')]('[%s][voiceDialReport][varset]',_0x1eee80[_0x9481('0x1a')],util[_0x9481('0x1b')](_0x2b174b,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x9481('0x15')][_0x9481('0x38')]=function(_0x190e5a,_0x4257df,_0x4c5e54){var _0x5a2893=[_0x9481('0x41'),_0x9481('0x42'),_0x9481('0x43'),_0x9481('0x44'),_0x9481('0x45'),_0x9481('0x46'),_0x9481('0x47'),_0x9481('0x48'),'sipcallid',_0x9481('0x49'),_0x9481('0x4a'),_0x9481('0x4b'),_0x9481('0x4c'),_0x9481('0x4d'),'memberinterface','memberlastcall',_0x9481('0x23'),_0x9481('0x4e'),_0x9481('0x4f')];if(!_['isNil'](_0x4257df)&&!_['includes'](_0x5a2893,_0x4257df)){if(_['isUndefined'](this['variables'][_0x190e5a])){this['variables'][_0x190e5a]={};}this['variables'][_0x190e5a][_0x4257df]=_0x4c5e54;}};VoiceDialReport['prototype'][_0x9481('0x14')]=function(_0x136bd8){try{if(this['isNotNull'](_0x136bd8)){logger[_0x9481('0x19')]('[%s][voiceDialReport][hangup]\x20event:',_0x136bd8[_0x9481('0x1a')],util[_0x9481('0x1b')](_0x136bd8,{'showHidden':![],'depth':null}));if(this[_0x9481('0xa')][_0x136bd8[_0x9481('0x1a')]]){logger[_0x9481('0x22')](_0x9481('0x50'),_0x136bd8[_0x9481('0x1a')],_0x136bd8['cause-txt']);this[_0x9481('0xa')][_0x136bd8[_0x9481('0x1a')]]['endtime']=moment()[_0x9481('0x2f')](_0x9481('0x30'));this[_0x9481('0xa')][_0x136bd8[_0x9481('0x1a')]][_0x9481('0x51')]=moment(this['channels'][_0x136bd8[_0x9481('0x1a')]][_0x9481('0x52')])[_0x9481('0x53')](this[_0x9481('0xa')][_0x136bd8[_0x9481('0x1a')]][_0x9481('0x54')],_0x9481('0x55'));this[_0x9481('0xa')][_0x136bd8[_0x9481('0x1a')]]['lastevent']='complete';this['outbound'][_0x9481('0x56')]+=0x1;if(this[_0x9481('0xa')][_0x136bd8['uniqueid']][_0x9481('0x2e')]){this[_0x9481('0xc')][_0x9481('0x57')]+=0x1;this[_0x9481('0xa')][_0x136bd8[_0x9481('0x1a')]][_0x9481('0x58')]=moment(this['channels'][_0x136bd8['uniqueid']][_0x9481('0x2e')])[_0x9481('0x53')](this[_0x9481('0xa')][_0x136bd8[_0x9481('0x1a')]][_0x9481('0x54')],_0x9481('0x55'));this['channels'][_0x136bd8['uniqueid']][_0x9481('0x59')]=moment(this['channels'][_0x136bd8[_0x9481('0x1a')]]['endtime'])[_0x9481('0x53')](this[_0x9481('0xa')][_0x136bd8[_0x9481('0x1a')]]['answertime'],_0x9481('0x55'));this[_0x9481('0xc')]['sumHoldTime']+=this['channels'][_0x136bd8['uniqueid']]['holdtime']||0x0;this[_0x9481('0xc')]['sumBillable']+=this[_0x9481('0xa')][_0x136bd8[_0x9481('0x1a')]][_0x9481('0x59')];}this['outbound'][_0x9481('0x5a')]+=this['channels'][_0x136bd8[_0x9481('0x1a')]][_0x9481('0x51')];logger[_0x9481('0x19')]('[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:',_0x136bd8[_0x9481('0x1a')],util[_0x9481('0x1b')](this['channels'][_0x136bd8[_0x9481('0x1a')]],{'showHidden':![],'depth':null}));ami[_0x9481('0x17')](_0x9481('0x5b'),this[_0x9481('0xa')][_0x136bd8[_0x9481('0x1a')]]);logger[_0x9481('0x19')](_0x9481('0x5c'),_0x136bd8[_0x9481('0x1a')],util[_0x9481('0x1b')](this[_0x9481('0xa')][_0x136bd8[_0x9481('0x1a')]],{'showHidden':![],'depth':null}));ami[_0x9481('0x17')](_0x9481('0x5d'),this[_0x9481('0xa')][_0x136bd8[_0x9481('0x1a')]]);logger[_0x9481('0x19')](_0x9481('0x5e'),_0x136bd8['uniqueid'],util[_0x9481('0x1b')](this['channels'][_0x136bd8['uniqueid']],{'showHidden':![],'depth':null}));this[_0x9481('0x17')]('voice:outbound','voice_outbound:save',this['outbound']);logger[_0x9481('0x22')](_0x9481('0x5f'),JSON[_0x9481('0x60')](this[_0x9481('0xa')][_0x136bd8['uniqueid']]));logger[_0x9481('0x19')](_0x9481('0x61'),_0x136bd8[_0x9481('0x1a')],util[_0x9481('0x1b')](this['channels'][_0x136bd8['uniqueid']],{'showHidden':![],'depth':null}));this[_0x9481('0x17')](_0x9481('0x35'),_0x9481('0x62'),this[_0x9481('0xa')][_0x136bd8[_0x9481('0x1a')]]);delete this['channels'][_0x136bd8[_0x9481('0x1a')]];}else if(this[_0x9481('0xa')][_0x136bd8[_0x9481('0x63')]]){this[_0x9481('0xa')][_0x136bd8[_0x9481('0x63')]][_0x9481('0x1a')]=this[_0x9481('0xa')][_0x136bd8[_0x9481('0x63')]][_0x9481('0x64')];}if(this[_0x9481('0x3c')][_0x136bd8[_0x9481('0x1a')]]){delete this[_0x9481('0x3c')][_0x136bd8[_0x9481('0x1a')]];}}}catch(_0x20b26f){logger[_0x9481('0x29')]('[%s][voiceDialReport][hangup]',_0x136bd8[_0x9481('0x1a')],util[_0x9481('0x1b')](_0x20b26f,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x9481('0x15')][_0x9481('0x65')]=function(_0x1b5c97){try{if(this[_0x9481('0x37')](_0x1b5c97)){logger[_0x9481('0x19')]('[%s][voiceDialReport][newexten]\x20event:',_0x1b5c97[_0x9481('0x1a')],util[_0x9481('0x1b')](_0x1b5c97,{'showHidden':![],'depth':null}));if(_0x1b5c97['application']['toLowerCase']()===_0x9481('0x66')){_0x1b5c97['applicationdata']=(_0x1b5c97['appdata']||_0x1b5c97[_0x9481('0x67')])['toLowerCase']();if(_[_0x9481('0x68')](_0x1b5c97[_0x9481('0x67')],_0x9481('0x69'))){if(_[_0x9481('0x16')](this['applications'][_0x1b5c97[_0x9481('0x1a')]]))this['applications'][_0x1b5c97[_0x9481('0x1a')]]={};logger[_0x9481('0x22')](_0x9481('0x6a'),_0x1b5c97['uniqueid'],_0x1b5c97['application'],_0x1b5c97['applicationdata']);var _0x3d7e5c=_0x1b5c97['applicationdata']['split']('=');var _0xe43ae6=_0x3d7e5c[0x0][_0x9481('0x6b')](/cdr\((.*)\)/);if(_0xe43ae6)this[_0x9481('0xd')][_0x1b5c97['uniqueid']][_0xe43ae6[0x1]]=_0x3d7e5c[0x1];}}}}catch(_0x905ee6){logger[_0x9481('0x29')]('[%s][voiceDialReport][newexten]',_0x1b5c97[_0x9481('0x1a')],util[_0x9481('0x1b')](_0x905ee6,{'showHidden':![],'depth':null}));}};module[_0x9481('0x6c')]=VoiceDialReport;
\ No newline at end of file
+var _0x2bd8=['connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','voice_outbound_channel:save','error','[%s][voiceDialReport][dialend]','syncVarSet','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','value','variable','outboundrouteid','variables','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','isNil','syncHangup','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','diff','starttime','seconds','complete','total','answered','holdtime','billableseconds','sumHoldTime','sumBillable','sumDuration','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','application','toLowerCase','set','applicationdata','appdata','startsWith','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','split','exports','lodash','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','localhost','socket.io-emitter','channels','outboundChannels','outbound','applications','bind','hangup','isNotNull','isUndefined','prototype','emit','syncDialBegin','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','merge','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','lastIndexOf','substring','omit','event','privilege','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','[%s][voiceDialReport][dialbegin]','syncDialEnd','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','lastevent'];(function(_0x1282a0,_0x58b2f9){var _0x18af0c=function(_0x5ac73f){while(--_0x5ac73f){_0x1282a0['push'](_0x1282a0['shift']());}};_0x18af0c(++_0x58b2f9);}(_0x2bd8,0x130));var _0x82bd=function(_0x112363,_0x114ca2){_0x112363=_0x112363-0x0;var _0x36b1a=_0x2bd8[_0x112363];return _0x36b1a;};'use strict';var _=require(_0x82bd('0x0'));var moment=require('moment');var util=require(_0x82bd('0x1'));var Redis=require(_0x82bd('0x2'));var config=require(_0x82bd('0x3'));var logger=require(_0x82bd('0x4'))(_0x82bd('0x5'));var ami=require(_0x82bd('0x6'));config[_0x82bd('0x7')]=_['defaults'](config[_0x82bd('0x7')],{'host':_0x82bd('0x8'),'port':0x18eb});var io=require(_0x82bd('0x9'))(new Redis(config['redis']));function VoiceDialReport(_0x19dbb1){this[_0x82bd('0xa')]=_0x19dbb1[_0x82bd('0xb')];this[_0x82bd('0xc')]=_0x19dbb1['outbound'];this[_0x82bd('0xd')]={};this['variables']={};ami['on']('dialbegin',this['syncDialBegin'][_0x82bd('0xe')](this));ami['on']('dialend',this['syncDialEnd'][_0x82bd('0xe')](this));ami['on']('varset',this['syncVarSet'][_0x82bd('0xe')](this));ami['on'](_0x82bd('0xf'),this['syncHangup'][_0x82bd('0xe')](this));}VoiceDialReport['prototype'][_0x82bd('0x10')]=function(_0x51e17e){return _0x51e17e!==null&&!_[_0x82bd('0x11')](_0x51e17e);};VoiceDialReport[_0x82bd('0x12')][_0x82bd('0x13')]=function(_0x2ca530,_0x58d82b,_0x446ffc){io['to'](_0x2ca530)[_0x82bd('0x13')](_0x58d82b,_0x446ffc);};VoiceDialReport['prototype'][_0x82bd('0x14')]=function(_0x4db39d){try{if(this[_0x82bd('0x10')](_0x4db39d)){logger[_0x82bd('0x15')](_0x82bd('0x16'),_0x4db39d[_0x82bd('0x17')],util[_0x82bd('0x18')](_0x4db39d,{'showHidden':![],'depth':null}));if(this[_0x82bd('0xa')][_0x4db39d[_0x82bd('0x17')]]){_[_0x82bd('0x19')](this[_0x82bd('0xa')][_0x4db39d[_0x82bd('0x17')]],{'starttime':moment()[_0x82bd('0x1a')](_0x82bd('0x1b')),'lastevent':_0x82bd('0x1c'),'interface':_0x4db39d[_0x82bd('0x1d')]['substring'](0x0,_0x4db39d['channel'][_0x82bd('0x1e')]('-')),'membername':_0x4db39d[_0x82bd('0x1d')][_0x82bd('0x1f')](_0x4db39d[_0x82bd('0x1d')][_0x82bd('0x1e')]('/')+0x1,_0x4db39d[_0x82bd('0x1d')][_0x82bd('0x1e')]('-'))},_[_0x82bd('0x20')](_0x4db39d,[_0x82bd('0x21'),_0x82bd('0x22')]));logger[_0x82bd('0x23')](_0x82bd('0x24'),_0x4db39d[_0x82bd('0x17')],this[_0x82bd('0xa')][_0x4db39d[_0x82bd('0x17')]][_0x82bd('0x25')],this[_0x82bd('0xa')][_0x4db39d[_0x82bd('0x17')]][_0x82bd('0x26')]);logger['debug']('[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:',_0x4db39d[_0x82bd('0x17')],util[_0x82bd('0x18')](this[_0x82bd('0xa')][_0x4db39d[_0x82bd('0x17')]],{'showHidden':![],'depth':null}));if(this[_0x82bd('0xd')][_0x4db39d[_0x82bd('0x17')]])_[_0x82bd('0x19')](this[_0x82bd('0xa')][_0x4db39d[_0x82bd('0x17')]],this[_0x82bd('0xd')][_0x4db39d['uniqueid']]);this['emit']('voice:outbound','voice_outbound_channel:save',this[_0x82bd('0xa')][_0x4db39d[_0x82bd('0x17')]]);logger[_0x82bd('0x15')](_0x82bd('0x27'),_0x4db39d[_0x82bd('0x17')],util['inspect'](this['channels'][_0x4db39d['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x82bd('0x13')](_0x82bd('0x28'),this[_0x82bd('0xa')][_0x4db39d['uniqueid']]);}}}catch(_0x166c46){logger['error'](_0x82bd('0x29'),_0x4db39d[_0x82bd('0x17')],util[_0x82bd('0x18')](_0x166c46,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x82bd('0x12')][_0x82bd('0x2a')]=function(_0x25e36e){try{if(this['isNotNull'](_0x25e36e)){logger[_0x82bd('0x15')](_0x82bd('0x2b'),_0x25e36e[_0x82bd('0x17')],util['inspect'](_0x25e36e,{'showHidden':![],'depth':null}));if(this[_0x82bd('0xa')][_0x25e36e['uniqueid']]){this['channels'][_0x25e36e[_0x82bd('0x17')]][_0x82bd('0x2c')]=_0x25e36e[_0x82bd('0x2c')];if(_0x25e36e[_0x82bd('0x2c')]===_0x82bd('0x2d')){this[_0x82bd('0xa')][_0x25e36e[_0x82bd('0x17')]][_0x82bd('0x2e')]=_0x25e36e[_0x82bd('0x2e')];this[_0x82bd('0xa')][_0x25e36e[_0x82bd('0x17')]][_0x82bd('0x2f')]=_0x25e36e[_0x82bd('0x2f')];this[_0x82bd('0xa')][_0x25e36e[_0x82bd('0x17')]][_0x82bd('0x30')]=moment()[_0x82bd('0x1a')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x25e36e['uniqueid']][_0x82bd('0x31')]=_0x82bd('0x32');logger['info'](_0x82bd('0x33'),_0x25e36e['uniqueid'],_0x25e36e['channel']['substring'](_0x25e36e[_0x82bd('0x1d')][_0x82bd('0x1e')]('/')+0x1,_0x25e36e[_0x82bd('0x1d')][_0x82bd('0x1e')]('-')));logger[_0x82bd('0x15')]('[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:',_0x25e36e['uniqueid'],util['inspect'](this[_0x82bd('0xa')][_0x25e36e['uniqueid']],{'showHidden':![],'depth':null}));ami['emit'](_0x82bd('0x34'),this[_0x82bd('0xa')][_0x25e36e[_0x82bd('0x17')]]);}logger[_0x82bd('0x15')](_0x82bd('0x35'),_0x25e36e[_0x82bd('0x17')],util[_0x82bd('0x18')](this[_0x82bd('0xa')][_0x25e36e[_0x82bd('0x17')]],{'showHidden':![],'depth':null}));this['emit']('voice:outbound',_0x82bd('0x36'),this[_0x82bd('0xa')][_0x25e36e['uniqueid']]);}}}catch(_0x4f066b){logger[_0x82bd('0x37')](_0x82bd('0x38'),_0x25e36e['uniqueid'],util[_0x82bd('0x18')](_0x4f066b,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x82bd('0x12')][_0x82bd('0x39')]=function(_0x2976f2){try{if(this[_0x82bd('0x10')](_0x2976f2)){logger[_0x82bd('0x15')](_0x82bd('0x3a'),_0x2976f2[_0x82bd('0x17')],util[_0x82bd('0x18')](_0x2976f2,{'showHidden':![],'depth':null}));this[_0x82bd('0x3b')](_0x2976f2[_0x82bd('0x17')],_[_0x82bd('0x3c')](_0x2976f2['variable'])[0x0],_0x2976f2[_0x82bd('0x3d')]);if(this[_0x82bd('0x10')](_0x2976f2['variable'])&&this['isNotNull'](_0x2976f2[_0x82bd('0x3e')][_0x82bd('0x3f')])){if(_[_0x82bd('0x11')](this[_0x82bd('0xa')][_0x2976f2[_0x82bd('0x17')]])){this['channels'][_0x2976f2['uniqueid']]={'routeId':_0x2976f2[_0x82bd('0x3d')],'variables':this[_0x82bd('0x40')][_0x2976f2['uniqueid']],'motionChannel':_0x82bd('0x41')};logger['info'](_0x82bd('0x42'),_0x2976f2[_0x82bd('0x17')],_0x2976f2['variable'][_0x82bd('0x3f')],_[_0x82bd('0x3c')](_0x2976f2['variable'])[0x0],_0x2976f2['value']);logger[_0x82bd('0x15')]('[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:',_0x2976f2[_0x82bd('0x17')],util[_0x82bd('0x18')](this[_0x82bd('0xa')][_0x2976f2[_0x82bd('0x17')]],{'showHidden':![],'depth':null}));this['emit']('voice:outbound',_0x82bd('0x36'),this[_0x82bd('0xa')][_0x2976f2['uniqueid']]);}}}}catch(_0x2cf686){logger[_0x82bd('0x37')](_0x82bd('0x43'),_0x2976f2['uniqueid'],util[_0x82bd('0x18')](_0x2cf686,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x82bd('0x12')][_0x82bd('0x3b')]=function(_0x122856,_0x42314b,_0x2c2cb9){var _0x2e97c3=[_0x82bd('0x44'),_0x82bd('0x45'),_0x82bd('0x46'),_0x82bd('0x47'),_0x82bd('0x48'),_0x82bd('0x49'),'rtpaudioqosrtt',_0x82bd('0x4a'),_0x82bd('0x4b'),'sipuri',_0x82bd('0x4c'),_0x82bd('0x4d'),_0x82bd('0x4e'),_0x82bd('0x4f'),'memberinterface','memberlastcall',_0x82bd('0x25'),'memberpenalty','memberrealtime'];if(!_[_0x82bd('0x50')](_0x42314b)&&!_['includes'](_0x2e97c3,_0x42314b)){if(_['isUndefined'](this[_0x82bd('0x40')][_0x122856])){this[_0x82bd('0x40')][_0x122856]={};}this[_0x82bd('0x40')][_0x122856][_0x42314b]=_0x2c2cb9;}};VoiceDialReport[_0x82bd('0x12')][_0x82bd('0x51')]=function(_0x1a7402){try{if(this[_0x82bd('0x10')](_0x1a7402)){logger[_0x82bd('0x15')](_0x82bd('0x52'),_0x1a7402[_0x82bd('0x17')],util[_0x82bd('0x18')](_0x1a7402,{'showHidden':![],'depth':null}));if(this[_0x82bd('0xa')][_0x1a7402[_0x82bd('0x17')]]){logger[_0x82bd('0x23')](_0x82bd('0x53'),_0x1a7402['uniqueid'],_0x1a7402[_0x82bd('0x54')]);this[_0x82bd('0xa')][_0x1a7402[_0x82bd('0x17')]][_0x82bd('0x55')]=moment()[_0x82bd('0x1a')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x1a7402['uniqueid']]['duration']=moment(this[_0x82bd('0xa')][_0x1a7402[_0x82bd('0x17')]][_0x82bd('0x55')])[_0x82bd('0x56')](this['channels'][_0x1a7402['uniqueid']][_0x82bd('0x57')],_0x82bd('0x58'));this[_0x82bd('0xa')][_0x1a7402['uniqueid']][_0x82bd('0x31')]=_0x82bd('0x59');this[_0x82bd('0xc')][_0x82bd('0x5a')]+=0x1;if(this[_0x82bd('0xa')][_0x1a7402[_0x82bd('0x17')]][_0x82bd('0x30')]){this[_0x82bd('0xc')][_0x82bd('0x5b')]+=0x1;this[_0x82bd('0xa')][_0x1a7402[_0x82bd('0x17')]][_0x82bd('0x5c')]=moment(this[_0x82bd('0xa')][_0x1a7402[_0x82bd('0x17')]][_0x82bd('0x30')])[_0x82bd('0x56')](this[_0x82bd('0xa')][_0x1a7402[_0x82bd('0x17')]]['starttime'],_0x82bd('0x58'));this['channels'][_0x1a7402['uniqueid']][_0x82bd('0x5d')]=moment(this['channels'][_0x1a7402[_0x82bd('0x17')]][_0x82bd('0x55')])[_0x82bd('0x56')](this[_0x82bd('0xa')][_0x1a7402[_0x82bd('0x17')]][_0x82bd('0x30')],_0x82bd('0x58'));this[_0x82bd('0xc')][_0x82bd('0x5e')]+=this[_0x82bd('0xa')][_0x1a7402[_0x82bd('0x17')]]['holdtime']||0x0;this['outbound'][_0x82bd('0x5f')]+=this[_0x82bd('0xa')][_0x1a7402['uniqueid']]['billableseconds'];}this[_0x82bd('0xc')][_0x82bd('0x60')]+=this[_0x82bd('0xa')][_0x1a7402[_0x82bd('0x17')]]['duration'];logger[_0x82bd('0x15')]('[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:',_0x1a7402[_0x82bd('0x17')],util[_0x82bd('0x18')](this['channels'][_0x1a7402[_0x82bd('0x17')]],{'showHidden':![],'depth':null}));ami[_0x82bd('0x13')](_0x82bd('0x61'),this[_0x82bd('0xa')][_0x1a7402['uniqueid']]);logger[_0x82bd('0x15')](_0x82bd('0x62'),_0x1a7402[_0x82bd('0x17')],util[_0x82bd('0x18')](this[_0x82bd('0xa')][_0x1a7402[_0x82bd('0x17')]],{'showHidden':![],'depth':null}));ami[_0x82bd('0x13')](_0x82bd('0x63'),this[_0x82bd('0xa')][_0x1a7402['uniqueid']]);logger[_0x82bd('0x15')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:',_0x1a7402['uniqueid'],util[_0x82bd('0x18')](this[_0x82bd('0xa')][_0x1a7402['uniqueid']],{'showHidden':![],'depth':null}));this[_0x82bd('0x13')]('voice:outbound',_0x82bd('0x64'),this[_0x82bd('0xc')]);logger['info'](_0x82bd('0x65'),JSON[_0x82bd('0x66')](this['channels'][_0x1a7402['uniqueid']]));logger['debug'](_0x82bd('0x67'),_0x1a7402[_0x82bd('0x17')],util['inspect'](this[_0x82bd('0xa')][_0x1a7402[_0x82bd('0x17')]],{'showHidden':![],'depth':null}));this['emit']('voice:outbound',_0x82bd('0x68'),this['channels'][_0x1a7402['uniqueid']]);delete this[_0x82bd('0xa')][_0x1a7402[_0x82bd('0x17')]];}else if(this[_0x82bd('0xa')][_0x1a7402[_0x82bd('0x69')]]){this[_0x82bd('0xa')][_0x1a7402['linkedid']][_0x82bd('0x17')]=this['channels'][_0x1a7402[_0x82bd('0x69')]]['destuniqueid'];}if(this[_0x82bd('0x40')][_0x1a7402['uniqueid']]){delete this['variables'][_0x1a7402[_0x82bd('0x17')]];}}}catch(_0x26e2a6){logger['error'](_0x82bd('0x6a'),_0x1a7402[_0x82bd('0x17')],util[_0x82bd('0x18')](_0x26e2a6,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['syncNewExten']=function(_0x197368){try{if(this[_0x82bd('0x10')](_0x197368)){logger['debug'](_0x82bd('0x6b'),_0x197368[_0x82bd('0x17')],util['inspect'](_0x197368,{'showHidden':![],'depth':null}));if(_0x197368[_0x82bd('0x6c')][_0x82bd('0x6d')]()===_0x82bd('0x6e')){_0x197368[_0x82bd('0x6f')]=(_0x197368[_0x82bd('0x70')]||_0x197368[_0x82bd('0x6f')])['toLowerCase']();if(_[_0x82bd('0x71')](_0x197368[_0x82bd('0x6f')],_0x82bd('0x72'))){if(_['isUndefined'](this[_0x82bd('0xd')][_0x197368['uniqueid']]))this[_0x82bd('0xd')][_0x197368[_0x82bd('0x17')]]={};logger[_0x82bd('0x23')](_0x82bd('0x73'),_0x197368[_0x82bd('0x17')],_0x197368['application'],_0x197368[_0x82bd('0x6f')]);var _0x39b9d5=_0x197368['applicationdata'][_0x82bd('0x74')]('=');var _0x12dbeb=_0x39b9d5[0x0]['match'](/cdr\((.*)\)/);if(_0x12dbeb)this[_0x82bd('0xd')][_0x197368[_0x82bd('0x17')]][_0x12dbeb[0x1]]=_0x39b9d5[0x1];}}}}catch(_0x42d4c9){logger['error']('[%s][voiceDialReport][newexten]',_0x197368[_0x82bd('0x17')],util[_0x82bd('0x18')](_0x42d4c9,{'showHidden':![],'depth':null}));}};module[_0x82bd('0x75')]=VoiceDialReport;
\ No newline at end of file
index a18f10f..d77884c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4714=['clearZombieChannels','queues','[voiceQueueReport][queues]','then','[voiceQueueReport][queuesummary]','queue','[voiceQueueReport][queuesummary]\x20event:','info','countBy','callers','waiting','toNumber','loggedIn','loggedin','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','[voiceQueueReport][queuesummarycomplete]\x20event:','syncQueueCallerJoin','[%s][voiceQueueReport][queuecallerjoin]','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','pick','keys','[%s][voiceQueueReport][queuecallerabandon]','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','ABANDONED','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','queuecallerleaveAt','connectedlinenum','connectedlinename','queuecallerleave','[%s][voiceQueueReport][agentconnect]','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','syncAgentComplete','last','membername','queuecallerexit','queuecallerexitAt','transfer','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','linkedid','queuecallerjoinAt','add','seconds','FORWARDTRANSFER','transfertype','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','agentcomplete','[%s][voiceQueueReport][varset]','addVariable','variable','value','queuestatus','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','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','memberpenalty','memberrealtime','includes','length','diff','milliseconds','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','sumHoldTime','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','hangup','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','transfereeuniqueid','transferexten','secondtransfererexten','secondtransfereruniqueid','ATTENDED','switch','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[%s][voiceQueueReport][attendedtransfer]','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','transfererchannel','[%s][voiceQueueReport][blindtransfer]','[%s][voiceQueueReport][musiconholdstart]','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','mohstarttime','[%s][voiceQueueReport][musiconholdstop]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','syncNewExten','set','applicationdata','appdata','CDR(routeAlias)','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','application','match','[%s][voiceQueueReport][newexten]','exports','util','md5','../../../config/environment','../../../config/logger','ami','redis','defaults','socket.io-emitter','prototype','enqueue','tail','finally','sequence','queueReports','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','queuecallerabandon','syncQueueCallerAbandon','agentconnect','syncAgentConnect','syncVarSet','syncHangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','hasOwnProperty','isEmpty','originated','talking','pTalking','queueStatusComplete','unlockRR','isNil','Action','status','channel','catch','message','No\x20such\x20channel','error','inspect','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','emit','emitVoiceQueueChannelSave','[%s][voiceQueueReport][','uniqueid','format','voice:queue:%s','voice_queue_channel:save','voice_queue_presence:save','debug',']\x20sending\x20voice_queue_channel:remove\x20event:','queuecallerexitreason','ATTENDEDTRANSFER','name','voice_queue_channel:remove','voice_queue_presence:remove','emitVoiceQueueSummary','type','inbound','strategy','answered','available','sumBillable','sumDuration','total','unmanaged','abandoned','Trunk','callerid','Interval','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isNotNull','isUndefined'];(function(_0x126fb9,_0x122c59){var _0xc8a3b1=function(_0x355744){while(--_0x355744){_0x126fb9['push'](_0x126fb9['shift']());}};_0xc8a3b1(++_0x122c59);}(_0x4714,0x173));var _0x4471=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x4714[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0x4471('0x0'));var md5=require(_0x4471('0x1'));var Redis=require('ioredis');var config=require(_0x4471('0x2'));var logger=require(_0x4471('0x3'))(_0x4471('0x4'));var ami=require('../ami');var QueueReport=require('../model/queueReport');config[_0x4471('0x5')]=_[_0x4471('0x6')](config[_0x4471('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x4471('0x7'))(new Redis(config[_0x4471('0x5')]));var Sequence=function(){};Sequence[_0x4471('0x8')][_0x4471('0x9')]=function(_0x1fc988){this[_0x4471('0xa')]=this[_0x4471('0xa')]?this[_0x4471('0xa')][_0x4471('0xb')](_0x1fc988):_0x1fc988();};function VoiceQueueReport(_0x5efa41){this[_0x4471('0xc')]=new Sequence();this[_0x4471('0xd')]={};this[_0x4471('0xe')]=_0x5efa41[_0x4471('0xe')];this[_0x4471('0xf')]=_0x5efa41[_0x4471('0x10')];this['voiceQueues']=_0x5efa41[_0x4471('0x11')];this[_0x4471('0x12')]=!![];this[_0x4471('0x13')]=_0x5efa41[_0x4471('0x13')];this[_0x4471('0x14')]={};ami['on'](_0x4471('0x15'),this[_0x4471('0x16')][_0x4471('0x17')](this));ami['on'](_0x4471('0x18'),this[_0x4471('0x19')][_0x4471('0x17')](this));ami['on'](_0x4471('0x1a'),this['syncQueueCallerJoin'][_0x4471('0x17')](this));ami['on'](_0x4471('0x1b'),this[_0x4471('0x1c')][_0x4471('0x17')](this));ami['on']('queuecallerleave',this['syncQueueCallerLeave'][_0x4471('0x17')](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0x4471('0x17')](this));ami['on'](_0x4471('0x1d'),this[_0x4471('0x1e')]['bind'](this));ami['on']('varset',this[_0x4471('0x1f')][_0x4471('0x17')](this));ami['on']('hangup',this[_0x4471('0x20')][_0x4471('0x17')](this));ami['on'](_0x4471('0x21'),this[_0x4471('0x22')][_0x4471('0x17')](this));ami['on'](_0x4471('0x23'),this[_0x4471('0x24')][_0x4471('0x17')](this));ami['on']('musiconholdstop',this[_0x4471('0x25')][_0x4471('0x17')](this));ami['on'](_0x4471('0x26'),this[_0x4471('0x27')][_0x4471('0x17')](this));ami['on'](_0x4471('0x28'),this[_0x4471('0x29')][_0x4471('0x17')](this));this[_0x4471('0x2a')]();this['loopQueueShow']();}function clearChannels(_0x5e341b){if(!_['isEmpty'](_0x5e341b)){for(var _0x3cc95f in _0x5e341b){if(_0x5e341b[_0x4471('0x2b')](_0x3cc95f)){delete _0x5e341b[_0x3cc95f];}}}}function clearCampaigns(_0x455bec){if(!_[_0x4471('0x2c')](_0x455bec)){for(var _0x26cf6f in _0x455bec){if(_0x455bec[_0x4471('0x2b')](_0x26cf6f)){_0x455bec[_0x26cf6f][_0x4471('0x2d')]=0x0;}}}}function clearVoiceQueues(_0x2c2d71){if(!_[_0x4471('0x2c')](_0x2c2d71)){for(var _0x4b2297 in _0x2c2d71){if(_0x2c2d71[_0x4471('0x2b')](_0x4b2297)){_0x2c2d71[_0x4b2297]['originated']=0x0;_0x2c2d71[_0x4b2297][_0x4471('0x2e')]=0x0;_0x2c2d71[_0x4b2297][_0x4471('0x2f')]=0x0;_0x2c2d71[_0x4b2297]['waiting']=0x0;_0x2c2d71[_0x4b2297][_0x4471('0x30')]=!![];}}}}function clearAgentBooked(_0x505b08){if(!_[_0x4471('0x2c')](_0x505b08)){for(var _0x4ca5bd in _0x505b08){if(_0x505b08[_0x4471('0x2b')](_0x4ca5bd)){_0x505b08[_0x4ca5bd][_0x4471('0x31')]=!![];}}}}VoiceQueueReport[_0x4471('0x8')]['clearZombieChannels']=function(){var _0x4e036e=this;for(var _0x539219 in this[_0x4471('0xf')]){if(this[_0x4471('0xf')][_0x4471('0x2b')](_0x539219)&&!this[_0x4471('0xf')][_0x539219]['switch']){this[_0x4471('0xc')][_0x4471('0x9')](function(){if(!_[_0x4471('0x32')](_0x4e036e[_0x4471('0xf')][_0x539219])){return ami[_0x4471('0x33')]({'action':_0x4471('0x34'),'channel':_0x4e036e[_0x4471('0xf')][_0x539219][_0x4471('0x35')]})[_0x4471('0x36')](function(_0x2c90fd){if(_0x2c90fd[_0x4471('0x37')]===_0x4471('0x38')){setTimeout(function(){if(_0x4e036e['channels'][_0x539219]){delete _0x4e036e[_0x4471('0xf')][_0x539219];logger[_0x4471('0x39')]('[%s][voiceQueueReport][checkChannel]',_0x539219,util[_0x4471('0x3a')](_0x2c90fd,{'showHidden':![],'depth':null}));}if(_0x4e036e[_0x4471('0xd')][_0x539219]){delete _0x4e036e[_0x4471('0xd')][_0x539219];logger[_0x4471('0x39')]('[%s][voiceQueueReport][checkQueueReport]',_0x539219,util[_0x4471('0x3a')](_0x2c90fd,{'showHidden':![],'depth':null}));}if(_0x4e036e[_0x4471('0x14')][_0x539219]){delete _0x4e036e[_0x4471('0x14')][_0x539219];logger[_0x4471('0x39')](_0x4471('0x3b'),_0x539219,util[_0x4471('0x3a')](_0x2c90fd,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x4471('0x8')][_0x4471('0x22')]=function(){logger[_0x4471('0x39')](_0x4471('0x3c'));clearChannels(this['channels']);this[_0x4471('0x3d')](this[_0x4471('0xd')]);clearAgentBooked(this[_0x4471('0xe')]);clearVoiceQueues(this[_0x4471('0x11')]);clearCampaigns(this[_0x4471('0x13')]);};VoiceQueueReport[_0x4471('0x8')][_0x4471('0x3d')]=function(_0x129d9b){var _0x8b4dce=this;if(!_[_0x4471('0x2c')](_0x129d9b)){for(var _0x23cf78 in _0x129d9b){if(_0x129d9b[_0x4471('0x2b')](_0x23cf78)){_0x8b4dce[_0x4471('0x3e')](_0x129d9b[_0x23cf78],'clearqueuereport');delete _0x129d9b[_0x23cf78];}}}};VoiceQueueReport[_0x4471('0x8')][_0x4471('0x3f')]=function(_0x43f1ee,_0x379485,_0x33c2f6){io['to'](_0x43f1ee)[_0x4471('0x3f')](_0x379485,_0x33c2f6);};VoiceQueueReport['prototype'][_0x4471('0x40')]=function(_0x3b810c,_0x5e0786){logger['debug'](_0x4471('0x41')+_0x5e0786+']\x20sending\x20voice_queue_channel:save\x20event:',_0x3b810c[_0x4471('0x42')],util[_0x4471('0x3a')](_0x3b810c,{'showHidden':![],'depth':null}));this['emit'](util[_0x4471('0x43')](_0x4471('0x44'),_0x3b810c['name']),_0x4471('0x45'),_0x3b810c);io['emit'](_0x4471('0x46'),_0x3b810c);};VoiceQueueReport[_0x4471('0x8')][_0x4471('0x3e')]=function(_0x3af630,_0x52977c){logger[_0x4471('0x47')]('[%s][voiceQueueReport]['+_0x52977c+_0x4471('0x48'),_0x3af630[_0x4471('0x42')],util[_0x4471('0x3a')](_0x3af630,{'showHidden':![],'depth':null}));if(_0x3af630[_0x4471('0x49')]===_0x4471('0x4a'))return;this[_0x4471('0x3f')](util[_0x4471('0x43')](_0x4471('0x44'),_0x3af630[_0x4471('0x4b')]),_0x4471('0x4c'),_0x3af630);io[_0x4471('0x3f')](_0x4471('0x4d'),_0x3af630);};VoiceQueueReport[_0x4471('0x8')][_0x4471('0x4e')]=function(_0x55704b,_0x4ea1ea){if(_0x55704b[_0x4471('0x4f')]===_0x4471('0x50')){var _0x1256f7={'id':_0x55704b['id'],'name':_0x55704b[_0x4471('0x4b')],'strategy':_0x55704b[_0x4471('0x51')],'answered':_0x55704b[_0x4471('0x52')],'available':_0x55704b[_0x4471('0x53')],'loggedIn':_0x55704b['loggedIn'],'pTalking':_0x55704b['pTalking'],'sumBillable':_0x55704b[_0x4471('0x54')],'sumDuration':_0x55704b[_0x4471('0x55')],'sumHoldTime':_0x55704b['sumHoldTime']||0x0,'talking':_0x55704b[_0x4471('0x2e')],'total':_0x55704b[_0x4471('0x56')],'type':_0x55704b[_0x4471('0x4f')],'unmanaged':_0x55704b[_0x4471('0x57')],'abandoned':_0x55704b[_0x4471('0x58')],'waiting':_0x55704b['waiting']};if(_0x55704b['Trunk']){_0x1256f7[_0x4471('0x59')]={'id':_0x55704b[_0x4471('0x59')]['id'],'name':_0x55704b['Trunk'][_0x4471('0x4b')],'active':_0x55704b[_0x4471('0x59')]['active'],'callerid':_0x55704b[_0x4471('0x59')][_0x4471('0x5a')]};}if(_0x55704b[_0x4471('0x5b')]){_0x1256f7['Interval']={'id':_0x55704b[_0x4471('0x5b')]['id'],'name':_0x55704b[_0x4471('0x5b')][_0x4471('0x4b')]};}var _0x3e942a=md5(JSON['stringify'](_0x1256f7));if(_0x55704b[_0x4471('0x1')]!==_0x3e942a){_0x55704b[_0x4471('0x1')]=_0x3e942a;logger[_0x4471('0x47')](_0x4471('0x5c')+_0x4ea1ea+_0x4471('0x5d'),util['inspect'](_0x1256f7,{'showHidden':![],'depth':null}));this['emit'](util[_0x4471('0x43')]('voice:queue:%s',_0x1256f7[_0x4471('0x4b')]),_0x4471('0x5e'),_0x1256f7);}}};VoiceQueueReport[_0x4471('0x8')][_0x4471('0x5f')]=function(_0x2cc820){return _0x2cc820!==null&&!_[_0x4471('0x60')](_0x2cc820);};VoiceQueueReport[_0x4471('0x8')]['loopQueueShow']=function(){var _0x1748c4=this;setInterval(function(){_0x1748c4[_0x4471('0x61')]();ami[_0x4471('0x33')]({'action':_0x4471('0x62')})['catch'](function(_0x2d2eff){logger[_0x4471('0x39')](_0x4471('0x63'),util['inspect'](_0x2d2eff,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x4471('0x8')][_0x4471('0x2a')]=function(){var _0x1a40e1=this;setInterval(function(){if(_0x1a40e1[_0x4471('0x12')]){return ami[_0x4471('0x33')]({'action':'queuesummary'})[_0x4471('0x64')](function(){_0x1a40e1[_0x4471('0x12')]=![];})['catch'](function(_0x49bf7f){logger[_0x4471('0x39')](_0x4471('0x65'),util[_0x4471('0x3a')](_0x49bf7f,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport['prototype']['syncQueueSummary']=function(_0x3a605b){try{if(this[_0x4471('0x5f')](_0x3a605b)&&this[_0x4471('0x5f')](_0x3a605b[_0x4471('0x66')])){logger['debug'](_0x4471('0x67'),util[_0x4471('0x3a')](_0x3a605b,{'showHidden':![],'depth':null}));if(this['voiceQueues'][_0x3a605b[_0x4471('0x66')]]){logger[_0x4471('0x68')]('[voiceQueueReport][queuesummary]\x20name:%s',_0x3a605b['queue']);var _0x2a70fa=_[_0x4471('0x69')](this[_0x4471('0xf')],'queue')[_0x3a605b[_0x4471('0x66')]]||0x0;var _0x5561e8=_0x2a70fa-_0x3a605b[_0x4471('0x6a')];if(this[_0x4471('0x11')][_0x3a605b[_0x4471('0x66')]][_0x4471('0x6b')]!==_[_0x4471('0x6c')](_0x3a605b[_0x4471('0x6a')])||this[_0x4471('0x11')][_0x3a605b[_0x4471('0x66')]][_0x4471('0x6d')]!==_[_0x4471('0x6c')](_0x3a605b['loggedin'])||this[_0x4471('0x11')][_0x3a605b[_0x4471('0x66')]][_0x4471('0x53')]!==_[_0x4471('0x6c')](_0x3a605b[_0x4471('0x53')])||this[_0x4471('0x11')][_0x3a605b['queue']][_0x4471('0x2e')]!==_0x5561e8){this['voiceQueues'][_0x3a605b[_0x4471('0x66')]][_0x4471('0x6b')]=_[_0x4471('0x6c')](_0x3a605b[_0x4471('0x6a')]);this['voiceQueues'][_0x3a605b['queue']]['loggedIn']=_[_0x4471('0x6c')](_0x3a605b[_0x4471('0x6e')]);this[_0x4471('0x11')][_0x3a605b[_0x4471('0x66')]]['available']=_['toNumber'](_0x3a605b['available']);this[_0x4471('0x11')][_0x3a605b[_0x4471('0x66')]][_0x4471('0x2e')]=_0x5561e8>0x0?_0x5561e8:0x0;this[_0x4471('0x11')][_0x3a605b[_0x4471('0x66')]][_0x4471('0x2e')]=this[_0x4471('0x11')][_0x3a605b[_0x4471('0x66')]]['talking']>_[_0x4471('0x6c')](_0x3a605b[_0x4471('0x6e')])?_[_0x4471('0x6c')](_0x3a605b['loggedin']):this[_0x4471('0x11')][_0x3a605b[_0x4471('0x66')]]['talking'];this[_0x4471('0x4e')](this[_0x4471('0x11')][_0x3a605b[_0x4471('0x66')]],_0x4471('0x15'));}logger[_0x4471('0x47')](_0x4471('0x6f'),util[_0x4471('0x3a')](this['voiceQueues'][_0x3a605b[_0x4471('0x66')]],{'showHidden':![],'depth':null}));ami[_0x4471('0x3f')]('custom:queuesummary',this['voiceQueues'][_0x3a605b['queue']]);}}}catch(_0x242b8f){logger['error'](_0x4471('0x65'),util[_0x4471('0x3a')](_0x242b8f,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x4471('0x19')]=function(_0x142422){logger['debug'](_0x4471('0x70'),util[_0x4471('0x3a')](_0x142422,{'showHidden':![],'depth':null}));this[_0x4471('0x12')]=!![];};VoiceQueueReport[_0x4471('0x8')][_0x4471('0x71')]=function(_0x3184cd){try{if(this['isNotNull'](_0x3184cd)){logger[_0x4471('0x47')](_0x4471('0x72'),_0x3184cd['uniqueid'],util[_0x4471('0x3a')](_0x3184cd,{'showHidden':![],'depth':null}));if(_[_0x4471('0x60')](this['queueReports'][_0x3184cd[_0x4471('0x42')]]))this['queueReports'][_0x3184cd[_0x4471('0x42')]]=[];if(_[_0x4471('0x60')](this[_0x4471('0xf')][_0x3184cd[_0x4471('0x42')]]))this[_0x4471('0xf')][_0x3184cd[_0x4471('0x42')]]={};var _0x4dce61=new QueueReport();_0x4dce61[_0x4471('0x4b')]=_0x3184cd['queue'];_0x4dce61['type']=this[_0x4471('0x11')][_0x4dce61[_0x4471('0x4b')]]&&this['voiceQueues'][_0x4dce61[_0x4471('0x4b')]][_0x4471('0x4f')]?this[_0x4471('0x11')][_0x4dce61[_0x4471('0x4b')]]['type']||_0x4471('0x50'):'inbound';_0x4dce61[_0x4471('0x66')]=_0x3184cd[_0x4471('0x66')];_0x4dce61['queuecallerjoinAt']=moment()[_0x4471('0x43')](_0x4471('0x73'));_0x4dce61[_0x4471('0x74')]=_0x3184cd['position'];_0x4dce61[_0x4471('0x75')]=_0x3184cd[_0x4471('0x75')];_0x4dce61[_0x4471('0x42')]=_0x3184cd[_0x4471('0x42')];_0x4dce61['routealias']=this[_0x4471('0xf')][_0x3184cd['uniqueid']][_0x4471('0x76')];logger[_0x4471('0x68')](_0x4471('0x77'),_0x4dce61[_0x4471('0x4b')],_0x4dce61[_0x4471('0x4f')]);_['merge'](_0x4dce61,_[_0x4471('0x78')](_0x3184cd,_[_0x4471('0x79')](_0x4dce61)));this[_0x4471('0xd')][_0x3184cd[_0x4471('0x42')]]['push'](_0x4dce61);this[_0x4471('0xf')][_0x3184cd[_0x4471('0x42')]]=_0x4dce61;this[_0x4471('0x40')](_0x4dce61,'queuecallerjoin');}}catch(_0x423599){logger[_0x4471('0x39')]('[%s][voiceQueueReport][queuecallerjoin]',_0x3184cd[_0x4471('0x42')],util[_0x4471('0x3a')](_0x423599,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4471('0x8')][_0x4471('0x1c')]=function(_0x58b3b8){try{if(this['isNotNull'](_0x58b3b8)){logger[_0x4471('0x47')](_0x4471('0x7a'),_0x58b3b8[_0x4471('0x42')],util['inspect'](_0x58b3b8,{'showHidden':![],'depth':null}));if(this[_0x4471('0xd')][_0x58b3b8[_0x4471('0x42')]]){var _0x3c4f56=_['last'](this[_0x4471('0xd')][_0x58b3b8[_0x4471('0x42')]]);_0x3c4f56[_0x4471('0x7b')]=![];_0x3c4f56[_0x4471('0x7c')]=null;_0x3c4f56[_0x4471('0x7d')]=_0x58b3b8[_0x4471('0x7d')];_0x3c4f56[_0x4471('0x7e')]=_0x58b3b8['originalposition'];_0x3c4f56['queuecallerabandon']=!![];_0x3c4f56[_0x4471('0x7f')]=moment()[_0x4471('0x43')](_0x4471('0x73'));_0x3c4f56[_0x4471('0x49')]=_0x4471('0x80');_0x3c4f56['lastAssignedTo']=null;logger['info'](_0x4471('0x81'),_0x3c4f56[_0x4471('0x4b')],_0x3c4f56[_0x4471('0x4f')]);this['channels'][_0x58b3b8[_0x4471('0x42')]]=_0x3c4f56;this[_0x4471('0x3e')](_0x3c4f56,_0x4471('0x1b'));}}}catch(_0x2e9c01){logger[_0x4471('0x39')]('[%s][voiceQueueReport][queuecallerabandon]',_0x58b3b8[_0x4471('0x42')],util[_0x4471('0x3a')](_0x2e9c01,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4471('0x8')]['syncQueueCallerLeave']=function(_0x24276b){try{if(this[_0x4471('0x5f')](_0x24276b)){logger['debug']('[%s][voiceQueueReport][queuecallerleave]',_0x24276b[_0x4471('0x42')],util[_0x4471('0x3a')](_0x24276b,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x24276b[_0x4471('0x42')]]){var _0x3b097c=_['last'](this[_0x4471('0xd')][_0x24276b[_0x4471('0x42')]]);_0x3b097c[_0x4471('0x82')]=moment()[_0x4471('0x43')]('YYYY-MM-DD\x20HH:mm:ss');_0x3b097c[_0x4471('0x83')]=_0x24276b['connectedlinenum'];_0x3b097c[_0x4471('0x84')]=_0x24276b['connectedlinename'];logger[_0x4471('0x68')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x3b097c[_0x4471('0x4b')],_0x3b097c['type'],_0x24276b[_0x4471('0x83')],_0x24276b[_0x4471('0x84')]);this[_0x4471('0xf')][_0x24276b[_0x4471('0x42')]]=_0x3b097c;this[_0x4471('0x40')](_0x3b097c,_0x4471('0x85'));}}}catch(_0x466f49){logger[_0x4471('0x39')]('[%s][voiceQueueReport][queuecallerleave]',_0x24276b[_0x4471('0x42')],util[_0x4471('0x3a')](_0x466f49,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x4471('0x1e')]=function(_0x24600e){try{if(this[_0x4471('0x5f')](_0x24600e)){logger[_0x4471('0x47')](_0x4471('0x86'),_0x24600e[_0x4471('0x42')],util[_0x4471('0x3a')](_0x24600e,{'showHidden':![],'depth':null}));if(this[_0x4471('0xd')][_0x24600e[_0x4471('0x42')]]){var _0xd2ba9f=_['last'](this[_0x4471('0xd')][_0x24600e[_0x4471('0x42')]]);_0xd2ba9f[_0x4471('0x7b')]=!![];_0xd2ba9f[_0x4471('0x49')]='COMPLETEDBYAGENT';logger['info'](_0x4471('0x87'),_0xd2ba9f[_0x4471('0x4b')],_0xd2ba9f[_0x4471('0x4f')]);}}}catch(_0x5c90a0){logger['error']('[%s][voiceQueueReport][agentconnect]',_0x24600e[_0x4471('0x42')],util[_0x4471('0x3a')](_0x5c90a0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4471('0x8')][_0x4471('0x88')]=function(_0x15d5a6){try{if(this[_0x4471('0x5f')](_0x15d5a6)){logger['debug']('[%s][voiceQueueReport][agentcomplete]',_0x15d5a6[_0x4471('0x42')],util[_0x4471('0x3a')](_0x15d5a6,{'showHidden':![],'depth':null}));if(this[_0x4471('0xd')][_0x15d5a6['uniqueid']]){var _0x306abb=_[_0x4471('0x89')](this[_0x4471('0xd')][_0x15d5a6['uniqueid']]);_0x306abb[_0x4471('0x1b')]=![];_0x306abb[_0x4471('0x7f')]=null;_0x306abb['assigned']=!![];_0x306abb['lastAssignedTo']=_0x15d5a6[_0x4471('0x8a')];_0x306abb[_0x4471('0x7d')]=_0x15d5a6[_0x4471('0x7d')];_0x306abb['queuecallercomplete']=!![];_0x306abb[_0x4471('0x8b')]=![];_0x306abb[_0x4471('0x8c')]=null;if(!_0x306abb[_0x4471('0x8d')]){if(_0x15d5a6[_0x4471('0x8e')]=='transfer'){_0x306abb[_0x4471('0x49')]=_0x4471('0x8f');logger[_0x4471('0x68')](_0x4471('0x90'),_0x306abb['name'],_0x306abb[_0x4471('0x4f')]);}else{if(_[_0x4471('0x91')](_0x15d5a6[_0x4471('0x35')][_0x4471('0x92')](),'local/')){if(this[_0x4471('0xd')][_0x15d5a6['linkedid']]){var _0xecaed0=_[_0x4471('0x89')](this[_0x4471('0xd')][_0x15d5a6[_0x4471('0x93')]]);_0xecaed0[_0x4471('0x7b')]=![];_0xecaed0['queuecallerexit']=!![];_0xecaed0['queuecallerexitAt']=moment(_0x306abb[_0x4471('0x94')])[_0x4471('0x95')](_0x15d5a6[_0x4471('0x7d')],_0x4471('0x96'))['format'](_0x4471('0x73'));_0xecaed0[_0x4471('0x49')]=_0x4471('0x97');_0xecaed0[_0x4471('0x8d')]=!![];_0xecaed0[_0x4471('0x98')]='FORWARD';_0xecaed0['transferexten']=_0x15d5a6['destexten'];_0xecaed0[_0x4471('0x99')]=_0x15d5a6[_0x4471('0x42')];logger[_0x4471('0x68')](_0x4471('0x9a'),_0xecaed0[_0x4471('0x4b')],_0xecaed0['type']);var _0x1f44fc=this[_0x4471('0xd')][_0x15d5a6['linkedid']];this[_0x4471('0xd')][_0x15d5a6[_0x4471('0x93')]]=this[_0x4471('0xd')][_0x15d5a6['uniqueid']];this[_0x4471('0xd')][_0x15d5a6[_0x4471('0x42')]]=_0x1f44fc;}}else{_0x306abb[_0x4471('0x49')]='COMPLETEDBY'+_0x15d5a6[_0x4471('0x8e')][_0x4471('0x9b')]();logger['info'](_0x4471('0x9c'),_0x306abb[_0x4471('0x4b')],_0x306abb[_0x4471('0x4f')],_0x306abb[_0x4471('0x49')]);}}}this[_0x4471('0xf')][_0x15d5a6[_0x4471('0x42')]]=_0x306abb;this[_0x4471('0x3e')](_0x306abb,_0x4471('0x9d'));}}}catch(_0xb8c544){logger[_0x4471('0x39')]('[%s][voiceQueueReport][agentcomplete]',_0x15d5a6['uniqueid'],util['inspect'](_0xb8c544,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4471('0x8')][_0x4471('0x1f')]=function(_0x2f7455){try{if(this['isNotNull'](_0x2f7455)){logger[_0x4471('0x47')](_0x4471('0x9e'),_0x2f7455[_0x4471('0x42')],util['inspect'](_0x2f7455,{'showHidden':![],'depth':null}));this[_0x4471('0x9f')](_0x2f7455[_0x4471('0x42')],_[_0x4471('0x79')](_0x2f7455[_0x4471('0xa0')])[0x0],_0x2f7455[_0x4471('0xa1')]);if(this[_0x4471('0xd')][_0x2f7455['uniqueid']]){var _0x3eb0ce=_[_0x4471('0x89')](this[_0x4471('0xd')][_0x2f7455['uniqueid']]);if(_0x3eb0ce){if(this[_0x4471('0x5f')](_0x2f7455[_0x4471('0xa0')])&&this[_0x4471('0x5f')](_0x2f7455['variable'][_0x4471('0xa2')])){switch(_0x2f7455[_0x4471('0xa1')]){case'CONTINUE':_0x3eb0ce[_0x4471('0x8b')]=![];_0x3eb0ce[_0x4471('0x8c')]=null;break;case _0x4471('0xa3'):_0x3eb0ce[_0x4471('0xa4')]=_0x4471('0xa5');_0x3eb0ce['queuecallerexit']=!![];_0x3eb0ce['queuecallerexitAt']=moment()[_0x4471('0x43')](_0x4471('0x73'));_0x3eb0ce[_0x4471('0x82')]=moment()[_0x4471('0x43')]('YYYY-MM-DD\x20HH:mm:ss');logger['debug'](_0x4471('0xa6'),_0x2f7455['uniqueid'],util[_0x4471('0x3a')](_0x3eb0ce,{'showHidden':![],'depth':null}));ami[_0x4471('0x3f')](_0x4471('0xa7'),_0x3eb0ce);break;default:_0x3eb0ce[_0x4471('0x8b')]=!![];_0x3eb0ce['queuecallerexitAt']=moment()[_0x4471('0x43')]('YYYY-MM-DD\x20HH:mm:ss');_0x3eb0ce[_0x4471('0x82')]=moment()[_0x4471('0x43')](_0x4471('0x73'));}_0x3eb0ce[_0x4471('0x1b')]=![];_0x3eb0ce[_0x4471('0x7f')]=null;_0x3eb0ce['queuecallerexitreason']=_0x2f7455[_0x4471('0xa1')];this[_0x4471('0xf')][_0x2f7455['uniqueid']]=_0x3eb0ce;this[_0x4471('0x3e')](_0x3eb0ce,'varset');}else if(this[_0x4471('0x5f')](_0x2f7455[_0x4471('0xa0')])&&this[_0x4471('0x5f')](_0x2f7455[_0x4471('0xa0')][_0x4471('0xa8')])){if(!_0x3eb0ce[_0x4471('0x1b')]){_0x3eb0ce['queuecallerexit']=!![];_0x3eb0ce[_0x4471('0x8c')]=moment()[_0x4471('0x43')](_0x4471('0x73'));_0x3eb0ce[_0x4471('0x49')]=_0x4471('0xa9');_0x3eb0ce[_0x4471('0x82')]=moment()['format'](_0x4471('0x73'));this[_0x4471('0xf')][_0x2f7455[_0x4471('0x42')]]=_0x3eb0ce;}}logger[_0x4471('0x68')](_0x4471('0xaa'),_0x2f7455[_0x4471('0x42')],_0x3eb0ce[_0x4471('0x4b')],_0x3eb0ce[_0x4471('0x4f')],_[_0x4471('0x79')](_0x2f7455[_0x4471('0xa0')])[0x0],_0x2f7455[_0x4471('0xa1')]);_0x3eb0ce[_0x4471('0x14')]=this[_0x4471('0x14')][_0x2f7455[_0x4471('0x42')]];}}}}catch(_0x4121bd){logger[_0x4471('0x39')](_0x4471('0x9e'),_0x2f7455[_0x4471('0x42')],util[_0x4471('0x3a')](_0x4121bd,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['addVariable']=function(_0xd77b17,_0x252d1b,_0x29bd00){var _0x193385=[_0x4471('0xab'),_0x4471('0xac'),_0x4471('0xad'),_0x4471('0xae'),'rtpaudioqosloss',_0x4471('0xaf'),_0x4471('0xb0'),_0x4471('0xb1'),'sipcallid',_0x4471('0xb2'),_0x4471('0xb3'),_0x4471('0xb4'),_0x4471('0xb5'),_0x4471('0xb6'),'memberinterface',_0x4471('0xb7'),_0x4471('0x8a'),_0x4471('0xb8'),_0x4471('0xb9')];if(!_[_0x4471('0x32')](_0x252d1b)&&!_[_0x4471('0xba')](_0x193385,_0x252d1b)){if(_[_0x4471('0x60')](this[_0x4471('0x14')][_0xd77b17])){this[_0x4471('0x14')][_0xd77b17]={};}this[_0x4471('0x14')][_0xd77b17][_0x252d1b]=_0x29bd00;}};VoiceQueueReport[_0x4471('0x8')]['syncHangup']=function(_0x4801a0){try{if(this['isNotNull'](_0x4801a0)){logger[_0x4471('0x47')]('[%s][voiceQueueReport][hangup]',_0x4801a0[_0x4471('0x42')],util[_0x4471('0x3a')](_0x4801a0,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4801a0[_0x4471('0x42')]]){for(var _0x528847=0x0,_0x5d1a6b={};_0x528847<this[_0x4471('0xd')][_0x4801a0[_0x4471('0x42')]][_0x4471('0xbb')];_0x528847+=0x1){_0x5d1a6b=this[_0x4471('0xd')][_0x4801a0[_0x4471('0x42')]][_0x528847];if(this['voiceQueues'][_0x5d1a6b['queue']]){if(_0x5d1a6b['queuecallerexit']&&_0x5d1a6b[_0x4471('0x8d')]!=!![]){this[_0x4471('0x11')][_0x5d1a6b[_0x4471('0x66')]]['unmanaged']+=0x1;}if(_0x5d1a6b['queuecallerabandon']){this[_0x4471('0x11')][_0x5d1a6b[_0x4471('0x66')]]['abandoned']+=0x1;}this[_0x4471('0x11')][_0x5d1a6b[_0x4471('0x66')]]['sumHoldTime']+=moment(_0x5d1a6b[_0x4471('0x82')])[_0x4471('0xbc')](_0x5d1a6b[_0x4471('0x94')],'seconds')||0x0;if(_0x528847===this['queueReports'][_0x4801a0['uniqueid']][_0x4471('0xbb')]-0x1){this['voiceQueues'][_0x5d1a6b['queue']]['sumDuration']+=moment()[_0x4471('0xbd')](0x0)[_0x4471('0xbc')](_0x5d1a6b[_0x4471('0x94')],_0x4471('0x96'));this['voiceQueues'][_0x5d1a6b[_0x4471('0x66')]]['total']+=0x1;if(_0x5d1a6b['queuecallercomplete']){this[_0x4471('0x11')][_0x5d1a6b['queue']][_0x4471('0x52')]+=0x1;this[_0x4471('0x11')][_0x5d1a6b[_0x4471('0x66')]]['sumBillable']+=moment()[_0x4471('0xbd')](0x0)[_0x4471('0xbc')](_0x5d1a6b[_0x4471('0x82')],'seconds');_0x5d1a6b['queuecallercompleteAt']=moment()['format'](_0x4471('0x73'));_0x5d1a6b[_0x4471('0x8b')]=![];_0x5d1a6b['queuecallerexitAt']=null;}if(_0x5d1a6b['queuecallerexit']&&_0x5d1a6b['transfer']!=!![]){_0x5d1a6b[_0x4471('0xa4')]=_0x4471('0x57');logger['debug'](_0x4471('0xbe'),_0x4801a0[_0x4471('0x42')],util[_0x4471('0x3a')](_0x5d1a6b,{'showHidden':![],'depth':null}));ami[_0x4471('0x3f')](_0x4471('0xbf'),_0x5d1a6b);}if(_0x5d1a6b[_0x4471('0x1b')]){_0x5d1a6b['lastevent']=_0x4471('0x58');logger[_0x4471('0x47')](_0x4471('0xc0'),_0x4801a0[_0x4471('0x42')],util['inspect'](_0x5d1a6b,{'showHidden':![],'depth':null}));ami['emit']('custom:queuecallerabandon',_0x5d1a6b);}}else{this[_0x4471('0x11')][_0x5d1a6b['queue']][_0x4471('0x55')]+=this['voiceQueues'][_0x5d1a6b[_0x4471('0x66')]][_0x4471('0xc1')];}logger['info'](_0x4471('0xc2'),_0x4801a0['uniqueid'],_0x5d1a6b[_0x4471('0x4b')],_0x5d1a6b[_0x4471('0x4f')],_0x4801a0['cause-txt']);this[_0x4471('0xf')][_0x4801a0[_0x4471('0x42')]]=_0x5d1a6b;this['emitVoiceQueueChannelRemove'](_0x5d1a6b,_0x4471('0xc3'));this[_0x4471('0x4e')](this[_0x4471('0x11')][_0x5d1a6b[_0x4471('0x66')]],'hangup');}}logger[_0x4471('0x47')](_0x4471('0xc4'),_0x4801a0[_0x4471('0x42')],util[_0x4471('0x3a')](this[_0x4471('0xd')][_0x4801a0[_0x4471('0x42')]],{'showHidden':![],'depth':null}));ami[_0x4471('0x3f')](_0x4471('0xc5'),this['queueReports'][_0x4801a0[_0x4471('0x42')]]);if(_0x5d1a6b[_0x4471('0x49')]===_0x4471('0x4a'))return;delete this[_0x4471('0xd')][_0x4801a0[_0x4471('0x42')]];delete this['channels'][_0x4801a0[_0x4471('0x42')]];}if(this['variables'][_0x4801a0[_0x4471('0x42')]]){delete this[_0x4471('0x14')][_0x4801a0['uniqueid']];}}}catch(_0x36890d){logger['error']('[%s][voiceQueueReport][hangup]',_0x4801a0['uniqueid'],util['inspect'](_0x36890d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4471('0x8')][_0x4471('0x27')]=function(_0x5c9ad2){try{if(this[_0x4471('0x5f')](_0x5c9ad2)){logger[_0x4471('0x47')]('[%s][voiceQueueReport][attendedtransfer]',_0x5c9ad2['uniqueid'],util[_0x4471('0x3a')](_0x5c9ad2,{'showHidden':![],'depth':null}));var _0x16e766;var _0x4b6aee;var _0x296533;if(this[_0x4471('0xd')][_0x5c9ad2[_0x4471('0xc6')]]){_0x16e766=_['last'](this['queueReports'][_0x5c9ad2['transfereeuniqueid']]);_0x16e766[_0x4471('0xc7')]=_0x5c9ad2[_0x4471('0xc8')];_0x16e766[_0x4471('0x99')]=_0x5c9ad2[_0x4471('0xc9')];_0x16e766[_0x4471('0x49')]=_0x4471('0x4a');_0x16e766['transfer']=!![];_0x16e766[_0x4471('0x98')]=_0x4471('0xca');if(this['queueReports'][_0x5c9ad2[_0x4471('0xc9')]]){_0x296533=this[_0x4471('0xd')][_0x5c9ad2['secondtransfereruniqueid']];this[_0x4471('0xd')][_0x5c9ad2[_0x4471('0xc9')]]=this['queueReports'][_0x5c9ad2[_0x4471('0xc6')]];this[_0x4471('0xd')][_0x5c9ad2[_0x4471('0xc6')]]=_0x296533;_0x4b6aee=_['last'](this['queueReports'][_0x5c9ad2['transfereeuniqueid']]);_0x4b6aee[_0x4471('0xcb')]=!![];}logger[_0x4471('0x68')](_0x4471('0xcc'),_0x5c9ad2[_0x4471('0x42')],_0x16e766['name'],_0x16e766[_0x4471('0x4f')],_0x16e766[_0x4471('0xc7')],_0x16e766[_0x4471('0x99')]);}else if(this['queueReports'][_0x5c9ad2[_0x4471('0xcd')]]){_0x16e766=_[_0x4471('0x89')](this[_0x4471('0xd')][_0x5c9ad2['transfertargetuniqueid']]);_0x16e766['transferexten']=_0x5c9ad2[_0x4471('0xce')];_0x16e766[_0x4471('0x99')]=_0x5c9ad2[_0x4471('0xcf')];_0x16e766[_0x4471('0x49')]=_0x4471('0x4a');_0x16e766[_0x4471('0x8d')]=!![];_0x16e766[_0x4471('0x98')]=_0x4471('0xca');if(this[_0x4471('0xd')][_0x5c9ad2['origtransfereruniqueid']]){_0x296533=this[_0x4471('0xd')][_0x5c9ad2[_0x4471('0xcf')]];this[_0x4471('0xd')][_0x5c9ad2[_0x4471('0xcf')]]=this[_0x4471('0xd')][_0x5c9ad2[_0x4471('0xcd')]];this['queueReports'][_0x5c9ad2[_0x4471('0xcd')]]=_0x296533;_0x4b6aee=_[_0x4471('0x89')](this[_0x4471('0xd')][_0x5c9ad2[_0x4471('0xcd')]]);_0x4b6aee['switch']=!![];}logger[_0x4471('0x68')]('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x5c9ad2[_0x4471('0x42')],_0x16e766[_0x4471('0x4b')],_0x16e766[_0x4471('0x4f')],_0x16e766[_0x4471('0xc7')],_0x16e766[_0x4471('0x99')]);}else if(this[_0x4471('0xd')][_0x5c9ad2['origtransfereruniqueid']]){_0x16e766=_[_0x4471('0x89')](this[_0x4471('0xd')][_0x5c9ad2['origtransfereruniqueid']]);_0x16e766['transferexten']=_0x5c9ad2['origtransfererexten'];_0x16e766[_0x4471('0x99')]=_0x5c9ad2['origtransfereruniqueid'];_0x16e766[_0x4471('0x49')]='ATTENDEDTRANSFER';_0x16e766[_0x4471('0x8d')]=!![];_0x16e766[_0x4471('0x98')]=_0x4471('0xca');}else if(this['queueReports'][_0x5c9ad2[_0x4471('0xc9')]]){_0x16e766=_[_0x4471('0x89')](this[_0x4471('0xd')][_0x5c9ad2[_0x4471('0xc9')]]);_0x16e766[_0x4471('0xc7')]=_0x5c9ad2[_0x4471('0xc8')];_0x16e766[_0x4471('0x99')]=_0x5c9ad2['secondtransfereruniqueid'];_0x16e766[_0x4471('0x49')]=_0x4471('0x4a');_0x16e766[_0x4471('0x8d')]=!![];_0x16e766[_0x4471('0x98')]=_0x4471('0xca');}}}catch(_0x5dec0c){logger[_0x4471('0x39')](_0x4471('0xd0'),_0x5c9ad2[_0x4471('0x42')],util[_0x4471('0x3a')](_0x5dec0c,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x4471('0x29')]=function(_0x4b214b){try{if(this['isNotNull'](_0x4b214b)){logger[_0x4471('0x47')]('[%s][voiceQueueReport][blindtransfer]',_0x4b214b[_0x4471('0x42')],util['inspect'](_0x4b214b,{'showHidden':![],'depth':null}));if(this[_0x4471('0xd')][_0x4b214b[_0x4471('0xc6')]]){var _0x14b7f2=_[_0x4471('0x89')](this[_0x4471('0xd')][_0x4b214b['transfereeuniqueid']]);_0x14b7f2[_0x4471('0x49')]=_0x4471('0xd1');_0x14b7f2['transfer']=!![];_0x14b7f2['transfertype']=_0x4471('0xd2');_0x14b7f2['transferexten']=_0x4b214b[_0x4471('0xd3')];_0x14b7f2[_0x4471('0x99')]=_0x4b214b['transfereeuniqueid'];logger['info'](_0x4471('0xd4'),_0x4b214b[_0x4471('0x42')],_0x14b7f2[_0x4471('0x4b')],_0x14b7f2[_0x4471('0x4f')],_0x14b7f2[_0x4471('0xc7')],_0x14b7f2[_0x4471('0x99')]);this[_0x4471('0x20')]({'event':_0x4471('0xd5'),'uniqueid':_0x4b214b[_0x4471('0xc6')],'context':_0x4b214b[_0x4471('0xd6')],'channel':_0x4b214b[_0x4471('0xd7')]});}}}catch(_0x17ce0d){logger['error'](_0x4471('0xd8'),_0x4b214b[_0x4471('0x42')],util['inspect'](_0x17ce0d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4471('0x8')][_0x4471('0x24')]=function(_0x3a21a0){try{if(this['isNotNull'](_0x3a21a0)){logger[_0x4471('0x47')](_0x4471('0xd9'),_0x3a21a0[_0x4471('0x42')],util[_0x4471('0x3a')](_0x3a21a0,{'showHidden':![],'depth':null}));if(this[_0x4471('0xd')][_0x3a21a0['uniqueid']]){var _0x3dc78d=_[_0x4471('0x89')](this[_0x4471('0xd')][_0x3a21a0[_0x4471('0x42')]]);if(!_[_0x4471('0x32')](_0x3dc78d['queuecallerleaveAt'])){_0x3dc78d['mohstarttime']=moment()[_0x4471('0x43')](_0x4471('0x73'));logger['info'](_0x4471('0xda'),_0x3a21a0[_0x4471('0x42')],_0x3dc78d[_0x4471('0xdb')]);}}}}catch(_0x26607b){logger[_0x4471('0x39')](_0x4471('0xd9'),_0x3a21a0['uniqueid'],util['inspect'](_0x26607b,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x4471('0x25')]=function(_0x3b247d){try{if(this[_0x4471('0x5f')](_0x3b247d)){logger[_0x4471('0x47')](_0x4471('0xdc'),_0x3b247d[_0x4471('0x42')],util[_0x4471('0x3a')](_0x3b247d,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x3b247d[_0x4471('0x42')]]){var _0x43c549=_[_0x4471('0x89')](this[_0x4471('0xd')][_0x3b247d['uniqueid']]);if(!_[_0x4471('0x32')](_0x43c549[_0x4471('0xdb')])){_0x43c549[_0x4471('0xdd')]+=moment()[_0x4471('0xbd')](0x0)['diff'](_0x43c549[_0x4471('0xdb')],_0x4471('0x96'));logger['info'](_0x4471('0xde'),_0x3b247d[_0x4471('0x42')],_0x43c549['mohtime']);delete _0x43c549[_0x4471('0xdb')];}}}}catch(_0x2524dd){logger[_0x4471('0x39')](_0x4471('0xdc'),_0x3b247d['uniqueid'],util[_0x4471('0x3a')](_0x2524dd,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4471('0x8')][_0x4471('0xdf')]=function(_0x47c8bc){try{if(this[_0x4471('0x5f')](_0x47c8bc)){logger[_0x4471('0x47')]('[%s][voiceQueueReport][newexten]\x20event:',_0x47c8bc['uniqueid'],util[_0x4471('0x3a')](_0x47c8bc,{'showHidden':![],'depth':null}));if(_0x47c8bc['application'][_0x4471('0x92')]()===_0x4471('0xe0')){_0x47c8bc[_0x4471('0xe1')]=_0x47c8bc[_0x4471('0xe2')]&&_0x47c8bc[_0x4471('0xe2')][_0x4471('0x91')](_0x4471('0xe3'))?_0x47c8bc['appdata']:(_0x47c8bc['appdata']||_0x47c8bc['applicationdata'])[_0x4471('0x92')]();if(_[_0x4471('0x91')](_0x47c8bc[_0x4471('0xe1')]['toLowerCase'](),_0x4471('0xe4'))){logger[_0x4471('0x68')](_0x4471('0xe5'),_0x47c8bc[_0x4471('0x42')],_0x47c8bc[_0x4471('0xe6')],_0x47c8bc[_0x4471('0xe1')]);if(_[_0x4471('0x60')](this[_0x4471('0xf')][_0x47c8bc[_0x4471('0x42')]]))this[_0x4471('0xf')][_0x47c8bc[_0x4471('0x42')]]={};var _0x14549d=_0x47c8bc['applicationdata']['split']('=');var _0xc25f82=_0x14549d[0x0][_0x4471('0x92')]()[_0x4471('0xe7')](/cdr\((.*)\)/);if(_0xc25f82)this['channels'][_0x47c8bc[_0x4471('0x42')]][_0xc25f82[0x1]]=_0x14549d[0x1];}}}}catch(_0x148369){logger[_0x4471('0x39')](_0x4471('0xe8'),_0x47c8bc['uniqueid'],util[_0x4471('0x3a')](_0x148369,{'showHidden':![],'depth':null}));}};module[_0x4471('0xe9')]=VoiceQueueReport;
\ No newline at end of file
+var _0x4f06=['toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][agentcomplete]','[%s][voiceQueueReport][varset]','addVariable','variable','value','CONTINUE','lastevent','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','queueposition','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','includes','[%s][voiceQueueReport][hangup]','length','unmanaged','diff','milliseconds','queuecallercompleteAt','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','cause-txt','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','transfereeuniqueid','secondtransfereruniqueid','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','transfertype','secondtransfererexten','[%s][voiceQueueReport][attendedtransfer]','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','[%s][voiceQueueReport][musiconholdstop]','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','application','toLowerCase','set','appdata','applicationdata','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','match','[%s][voiceQueueReport][newexten]','moment','util','md5','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','redis','defaults','localhost','socket.io-emitter','prototype','tail','finally','sequence','queueReports','agents','channels','flagQueueSummary','campaigns','queuesummary','syncQueueSummary','queuesummarycomplete','syncQueueSummaryComplete','bind','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','agentconnect','syncAgentConnect','syncVarSet','hangup','syncHangup','fullybooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','queueStatusComplete','unlockRR','switch','enqueue','isNil','Action','status','catch','error','[%s][voiceQueueReport][checkChannel]','variables','[%s][voiceQueueReport][checkVariables]','inspect','syncFullyBooted','clearQueueReport','voiceQueues','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','queuecallerexitreason','ATTENDEDTRANSFER','voice_queue_channel:remove','emitVoiceQueueSummary','type','strategy','answered','available','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','abandoned','waiting','Trunk','callerid','Interval','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isNotNull','isUndefined','clearZombieChannels','queues','then','[voiceQueueReport][queuesummary]','queue','[voiceQueueReport][queuesummary]\x20event:','info','countBy','toNumber','callers','loggedIn','loggedin','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','syncQueueCallerJoin','inbound','queuecallerjoinAt','position','count','routealias','merge','pick','keys','push','[%s][voiceQueueReport][queuecallerjoin]','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','holdtime','originalposition','queuecallerabandonAt','YYYY-MM-DD\x20HH:mm:ss','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','syncAgentComplete','membername','queuecallerexit','queuecallerexitAt','transfer','reason','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','channel','local/','linkedid','add','seconds','FORWARDTRANSFER','FORWARD','transferexten','destexten','transferuniqueid'];(function(_0xd81b5b,_0x15f6a7){var _0x52ffd9=function(_0x5571ea){while(--_0x5571ea){_0xd81b5b['push'](_0xd81b5b['shift']());}};_0x52ffd9(++_0x15f6a7);}(_0x4f06,0x138));var _0x64f0=function(_0x187b9b,_0xfaf487){_0x187b9b=_0x187b9b-0x0;var _0x1cb993=_0x4f06[_0x187b9b];return _0x1cb993;};'use strict';var _=require('lodash');var moment=require(_0x64f0('0x0'));var util=require(_0x64f0('0x1'));var md5=require(_0x64f0('0x2'));var Redis=require('ioredis');var config=require(_0x64f0('0x3'));var logger=require(_0x64f0('0x4'))(_0x64f0('0x5'));var ami=require(_0x64f0('0x6'));var QueueReport=require(_0x64f0('0x7'));config[_0x64f0('0x8')]=_[_0x64f0('0x9')](config[_0x64f0('0x8')],{'host':_0x64f0('0xa'),'port':0x18eb});var io=require(_0x64f0('0xb'))(new Redis(config[_0x64f0('0x8')]));var Sequence=function(){};Sequence[_0x64f0('0xc')]['enqueue']=function(_0x1c87f9){this[_0x64f0('0xd')]=this[_0x64f0('0xd')]?this[_0x64f0('0xd')][_0x64f0('0xe')](_0x1c87f9):_0x1c87f9();};function VoiceQueueReport(_0xf32e94){this[_0x64f0('0xf')]=new Sequence();this[_0x64f0('0x10')]={};this[_0x64f0('0x11')]=_0xf32e94[_0x64f0('0x11')];this[_0x64f0('0x12')]=_0xf32e94['queueChannels'];this['voiceQueues']=_0xf32e94['voiceQueues'];this[_0x64f0('0x13')]=!![];this['campaigns']=_0xf32e94[_0x64f0('0x14')];this['variables']={};ami['on'](_0x64f0('0x15'),this[_0x64f0('0x16')]['bind'](this));ami['on'](_0x64f0('0x17'),this[_0x64f0('0x18')][_0x64f0('0x19')](this));ami['on']('queuecallerjoin',this['syncQueueCallerJoin'][_0x64f0('0x19')](this));ami['on'](_0x64f0('0x1a'),this[_0x64f0('0x1b')]['bind'](this));ami['on'](_0x64f0('0x1c'),this[_0x64f0('0x1d')][_0x64f0('0x19')](this));ami['on'](_0x64f0('0x1e'),this['syncAgentComplete'][_0x64f0('0x19')](this));ami['on'](_0x64f0('0x1f'),this[_0x64f0('0x20')][_0x64f0('0x19')](this));ami['on']('varset',this[_0x64f0('0x21')][_0x64f0('0x19')](this));ami['on'](_0x64f0('0x22'),this[_0x64f0('0x23')][_0x64f0('0x19')](this));ami['on'](_0x64f0('0x24'),this['syncFullyBooted'][_0x64f0('0x19')](this));ami['on'](_0x64f0('0x25'),this[_0x64f0('0x26')]['bind'](this));ami['on'](_0x64f0('0x27'),this[_0x64f0('0x28')][_0x64f0('0x19')](this));ami['on'](_0x64f0('0x29'),this[_0x64f0('0x2a')][_0x64f0('0x19')](this));ami['on'](_0x64f0('0x2b'),this[_0x64f0('0x2c')][_0x64f0('0x19')](this));this[_0x64f0('0x2d')]();this[_0x64f0('0x2e')]();}function clearChannels(_0x5db641){if(!_[_0x64f0('0x2f')](_0x5db641)){for(var _0x1010cb in _0x5db641){if(_0x5db641[_0x64f0('0x30')](_0x1010cb)){delete _0x5db641[_0x1010cb];}}}}function clearCampaigns(_0xf37920){if(!_[_0x64f0('0x2f')](_0xf37920)){for(var _0x102e70 in _0xf37920){if(_0xf37920[_0x64f0('0x30')](_0x102e70)){_0xf37920[_0x102e70]['originated']=0x0;}}}}function clearVoiceQueues(_0x3e9b9c){if(!_['isEmpty'](_0x3e9b9c)){for(var _0x33af69 in _0x3e9b9c){if(_0x3e9b9c['hasOwnProperty'](_0x33af69)){_0x3e9b9c[_0x33af69][_0x64f0('0x31')]=0x0;_0x3e9b9c[_0x33af69]['talking']=0x0;_0x3e9b9c[_0x33af69]['pTalking']=0x0;_0x3e9b9c[_0x33af69]['waiting']=0x0;_0x3e9b9c[_0x33af69][_0x64f0('0x32')]=!![];}}}}function clearAgentBooked(_0x31e37c){if(!_[_0x64f0('0x2f')](_0x31e37c)){for(var _0x2ee0a9 in _0x31e37c){if(_0x31e37c[_0x64f0('0x30')](_0x2ee0a9)){_0x31e37c[_0x2ee0a9][_0x64f0('0x33')]=!![];}}}}VoiceQueueReport[_0x64f0('0xc')]['clearZombieChannels']=function(){var _0x395b2a=this;for(var _0x1095ef in this[_0x64f0('0x12')]){if(this[_0x64f0('0x12')][_0x64f0('0x30')](_0x1095ef)&&!this[_0x64f0('0x12')][_0x1095ef][_0x64f0('0x34')]){this['sequence'][_0x64f0('0x35')](function(){if(!_[_0x64f0('0x36')](_0x395b2a['channels'][_0x1095ef])){return ami[_0x64f0('0x37')]({'action':_0x64f0('0x38'),'channel':_0x395b2a[_0x64f0('0x12')][_0x1095ef]['channel']})[_0x64f0('0x39')](function(_0x2c6fc6){if(_0x2c6fc6['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x395b2a[_0x64f0('0x12')][_0x1095ef]){delete _0x395b2a[_0x64f0('0x12')][_0x1095ef];logger[_0x64f0('0x3a')](_0x64f0('0x3b'),_0x1095ef,util['inspect'](_0x2c6fc6,{'showHidden':![],'depth':null}));}if(_0x395b2a['queueReports'][_0x1095ef]){delete _0x395b2a[_0x64f0('0x10')][_0x1095ef];logger[_0x64f0('0x3a')]('[%s][voiceQueueReport][checkQueueReport]',_0x1095ef,util['inspect'](_0x2c6fc6,{'showHidden':![],'depth':null}));}if(_0x395b2a[_0x64f0('0x3c')][_0x1095ef]){delete _0x395b2a[_0x64f0('0x3c')][_0x1095ef];logger['error'](_0x64f0('0x3d'),_0x1095ef,util[_0x64f0('0x3e')](_0x2c6fc6,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x64f0('0xc')][_0x64f0('0x3f')]=function(){logger[_0x64f0('0x3a')]('[FullyBooted]\x20clear\x20realtime');clearChannels(this[_0x64f0('0x12')]);this[_0x64f0('0x40')](this['queueReports']);clearAgentBooked(this[_0x64f0('0x11')]);clearVoiceQueues(this[_0x64f0('0x41')]);clearCampaigns(this['campaigns']);};VoiceQueueReport[_0x64f0('0xc')][_0x64f0('0x40')]=function(_0x460c0f){var _0x272009=this;if(!_[_0x64f0('0x2f')](_0x460c0f)){for(var _0x4c8c85 in _0x460c0f){if(_0x460c0f[_0x64f0('0x30')](_0x4c8c85)){_0x272009[_0x64f0('0x42')](_0x460c0f[_0x4c8c85],_0x64f0('0x43'));delete _0x460c0f[_0x4c8c85];}}}};VoiceQueueReport[_0x64f0('0xc')][_0x64f0('0x44')]=function(_0x2c2faa,_0x3d4c88,_0x5c20c9){io['to'](_0x2c2faa)[_0x64f0('0x44')](_0x3d4c88,_0x5c20c9);};VoiceQueueReport['prototype'][_0x64f0('0x45')]=function(_0x3d238f,_0x442a4e){logger[_0x64f0('0x46')](_0x64f0('0x47')+_0x442a4e+_0x64f0('0x48'),_0x3d238f[_0x64f0('0x49')],util['inspect'](_0x3d238f,{'showHidden':![],'depth':null}));this[_0x64f0('0x44')](util[_0x64f0('0x4a')](_0x64f0('0x4b'),_0x3d238f[_0x64f0('0x4c')]),_0x64f0('0x4d'),_0x3d238f);io[_0x64f0('0x44')](_0x64f0('0x4e'),_0x3d238f);};VoiceQueueReport['prototype'][_0x64f0('0x42')]=function(_0x47b494,_0x1ed9de){logger['debug']('[%s][voiceQueueReport]['+_0x1ed9de+']\x20sending\x20voice_queue_channel:remove\x20event:',_0x47b494[_0x64f0('0x49')],util[_0x64f0('0x3e')](_0x47b494,{'showHidden':![],'depth':null}));if(_0x47b494[_0x64f0('0x4f')]===_0x64f0('0x50'))return;this[_0x64f0('0x44')](util[_0x64f0('0x4a')](_0x64f0('0x4b'),_0x47b494[_0x64f0('0x4c')]),_0x64f0('0x51'),_0x47b494);io[_0x64f0('0x44')]('voice_queue_presence:remove',_0x47b494);};VoiceQueueReport[_0x64f0('0xc')][_0x64f0('0x52')]=function(_0x19b819,_0x1e9383){if(_0x19b819[_0x64f0('0x53')]==='inbound'){var _0x5aff10={'id':_0x19b819['id'],'name':_0x19b819[_0x64f0('0x4c')],'strategy':_0x19b819[_0x64f0('0x54')],'answered':_0x19b819[_0x64f0('0x55')],'available':_0x19b819[_0x64f0('0x56')],'loggedIn':_0x19b819['loggedIn'],'pTalking':_0x19b819[_0x64f0('0x57')],'sumBillable':_0x19b819[_0x64f0('0x58')],'sumDuration':_0x19b819[_0x64f0('0x59')],'sumHoldTime':_0x19b819[_0x64f0('0x5a')]||0x0,'talking':_0x19b819[_0x64f0('0x5b')],'total':_0x19b819[_0x64f0('0x5c')],'type':_0x19b819[_0x64f0('0x53')],'unmanaged':_0x19b819['unmanaged'],'abandoned':_0x19b819[_0x64f0('0x5d')],'waiting':_0x19b819[_0x64f0('0x5e')]};if(_0x19b819['Trunk']){_0x5aff10[_0x64f0('0x5f')]={'id':_0x19b819[_0x64f0('0x5f')]['id'],'name':_0x19b819[_0x64f0('0x5f')][_0x64f0('0x4c')],'active':_0x19b819[_0x64f0('0x5f')]['active'],'callerid':_0x19b819['Trunk'][_0x64f0('0x60')]};}if(_0x19b819['Interval']){_0x5aff10['Interval']={'id':_0x19b819[_0x64f0('0x61')]['id'],'name':_0x19b819[_0x64f0('0x61')][_0x64f0('0x4c')]};}var _0xf9af7f=md5(JSON['stringify'](_0x5aff10));if(_0x19b819['md5']!==_0xf9af7f){_0x19b819['md5']=_0xf9af7f;logger[_0x64f0('0x46')](_0x64f0('0x62')+_0x1e9383+_0x64f0('0x63'),util[_0x64f0('0x3e')](_0x5aff10,{'showHidden':![],'depth':null}));this['emit'](util[_0x64f0('0x4a')](_0x64f0('0x4b'),_0x5aff10[_0x64f0('0x4c')]),_0x64f0('0x64'),_0x5aff10);}}};VoiceQueueReport[_0x64f0('0xc')][_0x64f0('0x65')]=function(_0x4dcf06){return _0x4dcf06!==null&&!_[_0x64f0('0x66')](_0x4dcf06);};VoiceQueueReport['prototype']['loopQueueShow']=function(){var _0x22cc39=this;setInterval(function(){_0x22cc39[_0x64f0('0x67')]();ami[_0x64f0('0x37')]({'action':_0x64f0('0x68')})[_0x64f0('0x39')](function(_0x56e8b8){logger[_0x64f0('0x3a')]('[voiceQueueReport][queues]',util[_0x64f0('0x3e')](_0x56e8b8,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x64f0('0xc')][_0x64f0('0x2d')]=function(){var _0x22db58=this;setInterval(function(){if(_0x22db58['flagQueueSummary']){return ami[_0x64f0('0x37')]({'action':_0x64f0('0x15')})[_0x64f0('0x69')](function(){_0x22db58['flagQueueSummary']=![];})['catch'](function(_0x30abea){logger[_0x64f0('0x3a')](_0x64f0('0x6a'),util[_0x64f0('0x3e')](_0x30abea,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x64f0('0xc')][_0x64f0('0x16')]=function(_0x40ab9f){try{if(this['isNotNull'](_0x40ab9f)&&this[_0x64f0('0x65')](_0x40ab9f[_0x64f0('0x6b')])){logger[_0x64f0('0x46')](_0x64f0('0x6c'),util[_0x64f0('0x3e')](_0x40ab9f,{'showHidden':![],'depth':null}));if(this['voiceQueues'][_0x40ab9f[_0x64f0('0x6b')]]){logger[_0x64f0('0x6d')]('[voiceQueueReport][queuesummary]\x20name:%s',_0x40ab9f[_0x64f0('0x6b')]);var _0x47b79a=_[_0x64f0('0x6e')](this[_0x64f0('0x12')],_0x64f0('0x6b'))[_0x40ab9f[_0x64f0('0x6b')]]||0x0;var _0x505224=_0x47b79a-_0x40ab9f['callers'];if(this[_0x64f0('0x41')][_0x40ab9f[_0x64f0('0x6b')]][_0x64f0('0x5e')]!==_[_0x64f0('0x6f')](_0x40ab9f[_0x64f0('0x70')])||this[_0x64f0('0x41')][_0x40ab9f[_0x64f0('0x6b')]][_0x64f0('0x71')]!==_[_0x64f0('0x6f')](_0x40ab9f[_0x64f0('0x72')])||this[_0x64f0('0x41')][_0x40ab9f['queue']][_0x64f0('0x56')]!==_[_0x64f0('0x6f')](_0x40ab9f['available'])||this[_0x64f0('0x41')][_0x40ab9f[_0x64f0('0x6b')]][_0x64f0('0x5b')]!==_0x505224){this[_0x64f0('0x41')][_0x40ab9f[_0x64f0('0x6b')]][_0x64f0('0x5e')]=_[_0x64f0('0x6f')](_0x40ab9f[_0x64f0('0x70')]);this[_0x64f0('0x41')][_0x40ab9f[_0x64f0('0x6b')]][_0x64f0('0x71')]=_[_0x64f0('0x6f')](_0x40ab9f[_0x64f0('0x72')]);this[_0x64f0('0x41')][_0x40ab9f[_0x64f0('0x6b')]][_0x64f0('0x56')]=_['toNumber'](_0x40ab9f[_0x64f0('0x56')]);this[_0x64f0('0x41')][_0x40ab9f[_0x64f0('0x6b')]][_0x64f0('0x5b')]=_0x505224>0x0?_0x505224:0x0;this[_0x64f0('0x41')][_0x40ab9f[_0x64f0('0x6b')]][_0x64f0('0x5b')]=this['voiceQueues'][_0x40ab9f['queue']]['talking']>_['toNumber'](_0x40ab9f[_0x64f0('0x72')])?_[_0x64f0('0x6f')](_0x40ab9f[_0x64f0('0x72')]):this['voiceQueues'][_0x40ab9f[_0x64f0('0x6b')]][_0x64f0('0x5b')];this[_0x64f0('0x52')](this['voiceQueues'][_0x40ab9f['queue']],_0x64f0('0x15'));}logger[_0x64f0('0x46')](_0x64f0('0x73'),util[_0x64f0('0x3e')](this['voiceQueues'][_0x40ab9f[_0x64f0('0x6b')]],{'showHidden':![],'depth':null}));ami['emit'](_0x64f0('0x74'),this[_0x64f0('0x41')][_0x40ab9f[_0x64f0('0x6b')]]);}}}catch(_0x649057){logger[_0x64f0('0x3a')](_0x64f0('0x6a'),util[_0x64f0('0x3e')](_0x649057,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x64f0('0xc')][_0x64f0('0x18')]=function(_0x4a5552){logger[_0x64f0('0x46')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x64f0('0x3e')](_0x4a5552,{'showHidden':![],'depth':null}));this[_0x64f0('0x13')]=!![];};VoiceQueueReport['prototype'][_0x64f0('0x75')]=function(_0x48c256){try{if(this['isNotNull'](_0x48c256)){logger[_0x64f0('0x46')]('[%s][voiceQueueReport][queuecallerjoin]',_0x48c256[_0x64f0('0x49')],util[_0x64f0('0x3e')](_0x48c256,{'showHidden':![],'depth':null}));if(_[_0x64f0('0x66')](this[_0x64f0('0x10')][_0x48c256[_0x64f0('0x49')]]))this['queueReports'][_0x48c256['uniqueid']]=[];if(_['isUndefined'](this[_0x64f0('0x12')][_0x48c256[_0x64f0('0x49')]]))this['channels'][_0x48c256[_0x64f0('0x49')]]={};var _0x4688a1=new QueueReport();_0x4688a1[_0x64f0('0x4c')]=_0x48c256[_0x64f0('0x6b')];_0x4688a1['type']=this[_0x64f0('0x41')][_0x4688a1[_0x64f0('0x4c')]]&&this[_0x64f0('0x41')][_0x4688a1[_0x64f0('0x4c')]][_0x64f0('0x53')]?this[_0x64f0('0x41')][_0x4688a1[_0x64f0('0x4c')]]['type']||_0x64f0('0x76'):_0x64f0('0x76');_0x4688a1[_0x64f0('0x6b')]=_0x48c256[_0x64f0('0x6b')];_0x4688a1[_0x64f0('0x77')]=moment()[_0x64f0('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x4688a1[_0x64f0('0x78')]=_0x48c256[_0x64f0('0x78')];_0x4688a1[_0x64f0('0x79')]=_0x48c256[_0x64f0('0x79')];_0x4688a1[_0x64f0('0x49')]=_0x48c256[_0x64f0('0x49')];_0x4688a1[_0x64f0('0x7a')]=this['channels'][_0x48c256['uniqueid']][_0x64f0('0x7a')];logger['info']('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x4688a1[_0x64f0('0x4c')],_0x4688a1[_0x64f0('0x53')]);_[_0x64f0('0x7b')](_0x4688a1,_[_0x64f0('0x7c')](_0x48c256,_[_0x64f0('0x7d')](_0x4688a1)));this[_0x64f0('0x10')][_0x48c256[_0x64f0('0x49')]][_0x64f0('0x7e')](_0x4688a1);this[_0x64f0('0x12')][_0x48c256[_0x64f0('0x49')]]=_0x4688a1;this[_0x64f0('0x45')](_0x4688a1,'queuecallerjoin');}}catch(_0x1a7adc){logger[_0x64f0('0x3a')](_0x64f0('0x7f'),_0x48c256[_0x64f0('0x49')],util[_0x64f0('0x3e')](_0x1a7adc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x64f0('0xc')][_0x64f0('0x1b')]=function(_0x22b4e){try{if(this[_0x64f0('0x65')](_0x22b4e)){logger[_0x64f0('0x46')](_0x64f0('0x80'),_0x22b4e['uniqueid'],util['inspect'](_0x22b4e,{'showHidden':![],'depth':null}));if(this[_0x64f0('0x10')][_0x22b4e[_0x64f0('0x49')]]){var _0x411324=_[_0x64f0('0x81')](this[_0x64f0('0x10')][_0x22b4e[_0x64f0('0x49')]]);_0x411324[_0x64f0('0x82')]=![];_0x411324['queuecallercompleteAt']=null;_0x411324[_0x64f0('0x83')]=_0x22b4e['holdtime'];_0x411324[_0x64f0('0x84')]=_0x22b4e[_0x64f0('0x84')];_0x411324[_0x64f0('0x1a')]=!![];_0x411324[_0x64f0('0x85')]=moment()[_0x64f0('0x4a')](_0x64f0('0x86'));_0x411324['queuecallerexitreason']=_0x64f0('0x87');_0x411324[_0x64f0('0x88')]=null;logger[_0x64f0('0x6d')](_0x64f0('0x89'),_0x411324[_0x64f0('0x4c')],_0x411324['type']);this[_0x64f0('0x12')][_0x22b4e[_0x64f0('0x49')]]=_0x411324;this[_0x64f0('0x42')](_0x411324,_0x64f0('0x1a'));}}}catch(_0x3fd450){logger[_0x64f0('0x3a')](_0x64f0('0x80'),_0x22b4e['uniqueid'],util[_0x64f0('0x3e')](_0x3fd450,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x64f0('0xc')][_0x64f0('0x1d')]=function(_0x3f8d92){try{if(this[_0x64f0('0x65')](_0x3f8d92)){logger[_0x64f0('0x46')](_0x64f0('0x8a'),_0x3f8d92[_0x64f0('0x49')],util[_0x64f0('0x3e')](_0x3f8d92,{'showHidden':![],'depth':null}));if(this[_0x64f0('0x10')][_0x3f8d92['uniqueid']]){var _0x178f01=_[_0x64f0('0x81')](this[_0x64f0('0x10')][_0x3f8d92['uniqueid']]);_0x178f01[_0x64f0('0x8b')]=moment()[_0x64f0('0x4a')](_0x64f0('0x86'));_0x178f01[_0x64f0('0x8c')]=_0x3f8d92[_0x64f0('0x8c')];_0x178f01['connectedlinename']=_0x3f8d92[_0x64f0('0x8d')];logger[_0x64f0('0x6d')](_0x64f0('0x8e'),_0x178f01[_0x64f0('0x4c')],_0x178f01[_0x64f0('0x53')],_0x3f8d92['connectedlinenum'],_0x3f8d92[_0x64f0('0x8d')]);this['channels'][_0x3f8d92[_0x64f0('0x49')]]=_0x178f01;this['emitVoiceQueueChannelSave'](_0x178f01,'queuecallerleave');}}}catch(_0x304abf){logger[_0x64f0('0x3a')](_0x64f0('0x8a'),_0x3f8d92['uniqueid'],util[_0x64f0('0x3e')](_0x304abf,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x64f0('0xc')][_0x64f0('0x20')]=function(_0x60fc7f){try{if(this[_0x64f0('0x65')](_0x60fc7f)){logger[_0x64f0('0x46')](_0x64f0('0x8f'),_0x60fc7f[_0x64f0('0x49')],util[_0x64f0('0x3e')](_0x60fc7f,{'showHidden':![],'depth':null}));if(this[_0x64f0('0x10')][_0x60fc7f[_0x64f0('0x49')]]){var _0x7885f5=_['last'](this[_0x64f0('0x10')][_0x60fc7f[_0x64f0('0x49')]]);_0x7885f5[_0x64f0('0x82')]=!![];_0x7885f5[_0x64f0('0x4f')]=_0x64f0('0x90');logger['info'](_0x64f0('0x91'),_0x7885f5[_0x64f0('0x4c')],_0x7885f5[_0x64f0('0x53')]);}}}catch(_0x55b7ed){logger[_0x64f0('0x3a')](_0x64f0('0x8f'),_0x60fc7f[_0x64f0('0x49')],util[_0x64f0('0x3e')](_0x55b7ed,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x64f0('0x92')]=function(_0xa75a4f){try{if(this[_0x64f0('0x65')](_0xa75a4f)){logger[_0x64f0('0x46')]('[%s][voiceQueueReport][agentcomplete]',_0xa75a4f[_0x64f0('0x49')],util[_0x64f0('0x3e')](_0xa75a4f,{'showHidden':![],'depth':null}));if(this[_0x64f0('0x10')][_0xa75a4f[_0x64f0('0x49')]]){var _0x3fbdc1=_[_0x64f0('0x81')](this[_0x64f0('0x10')][_0xa75a4f[_0x64f0('0x49')]]);_0x3fbdc1[_0x64f0('0x1a')]=![];_0x3fbdc1['queuecallerabandonAt']=null;_0x3fbdc1['assigned']=!![];_0x3fbdc1[_0x64f0('0x88')]=_0xa75a4f[_0x64f0('0x93')];_0x3fbdc1[_0x64f0('0x83')]=_0xa75a4f[_0x64f0('0x83')];_0x3fbdc1[_0x64f0('0x82')]=!![];_0x3fbdc1[_0x64f0('0x94')]=![];_0x3fbdc1[_0x64f0('0x95')]=null;if(!_0x3fbdc1[_0x64f0('0x96')]){if(_0xa75a4f[_0x64f0('0x97')]==_0x64f0('0x96')){_0x3fbdc1[_0x64f0('0x4f')]='COMPLETED';logger[_0x64f0('0x6d')](_0x64f0('0x98'),_0x3fbdc1[_0x64f0('0x4c')],_0x3fbdc1[_0x64f0('0x53')]);}else{if(_[_0x64f0('0x99')](_0xa75a4f[_0x64f0('0x9a')]['toLowerCase'](),_0x64f0('0x9b'))){if(this[_0x64f0('0x10')][_0xa75a4f[_0x64f0('0x9c')]]){var _0x3618f0=_['last'](this['queueReports'][_0xa75a4f[_0x64f0('0x9c')]]);_0x3618f0[_0x64f0('0x82')]=![];_0x3618f0[_0x64f0('0x94')]=!![];_0x3618f0['queuecallerexitAt']=moment(_0x3fbdc1[_0x64f0('0x77')])[_0x64f0('0x9d')](_0xa75a4f['holdtime'],_0x64f0('0x9e'))[_0x64f0('0x4a')](_0x64f0('0x86'));_0x3618f0[_0x64f0('0x4f')]=_0x64f0('0x9f');_0x3618f0['transfer']=!![];_0x3618f0['transfertype']=_0x64f0('0xa0');_0x3618f0[_0x64f0('0xa1')]=_0xa75a4f[_0x64f0('0xa2')];_0x3618f0[_0x64f0('0xa3')]=_0xa75a4f[_0x64f0('0x49')];logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x3618f0[_0x64f0('0x4c')],_0x3618f0[_0x64f0('0x53')]);var _0xc130c8=this[_0x64f0('0x10')][_0xa75a4f['linkedid']];this['queueReports'][_0xa75a4f[_0x64f0('0x9c')]]=this[_0x64f0('0x10')][_0xa75a4f[_0x64f0('0x49')]];this['queueReports'][_0xa75a4f[_0x64f0('0x49')]]=_0xc130c8;}}else{_0x3fbdc1[_0x64f0('0x4f')]='COMPLETEDBY'+_0xa75a4f[_0x64f0('0x97')][_0x64f0('0xa4')]();logger[_0x64f0('0x6d')](_0x64f0('0xa5'),_0x3fbdc1[_0x64f0('0x4c')],_0x3fbdc1[_0x64f0('0x53')],_0x3fbdc1[_0x64f0('0x4f')]);}}}this[_0x64f0('0x12')][_0xa75a4f[_0x64f0('0x49')]]=_0x3fbdc1;this[_0x64f0('0x42')](_0x3fbdc1,_0x64f0('0x1e'));}}}catch(_0x3f52a2){logger['error'](_0x64f0('0xa6'),_0xa75a4f['uniqueid'],util[_0x64f0('0x3e')](_0x3f52a2,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncVarSet']=function(_0x622d73){try{if(this['isNotNull'](_0x622d73)){logger[_0x64f0('0x46')](_0x64f0('0xa7'),_0x622d73[_0x64f0('0x49')],util[_0x64f0('0x3e')](_0x622d73,{'showHidden':![],'depth':null}));this[_0x64f0('0xa8')](_0x622d73[_0x64f0('0x49')],_[_0x64f0('0x7d')](_0x622d73[_0x64f0('0xa9')])[0x0],_0x622d73[_0x64f0('0xaa')]);if(this['queueReports'][_0x622d73[_0x64f0('0x49')]]){var _0x50cb0a=_[_0x64f0('0x81')](this[_0x64f0('0x10')][_0x622d73[_0x64f0('0x49')]]);if(_0x50cb0a){if(this[_0x64f0('0x65')](_0x622d73[_0x64f0('0xa9')])&&this[_0x64f0('0x65')](_0x622d73[_0x64f0('0xa9')]['queuestatus'])){switch(_0x622d73['value']){case _0x64f0('0xab'):_0x50cb0a[_0x64f0('0x94')]=![];_0x50cb0a['queuecallerexitAt']=null;break;case'TIMEOUT':_0x50cb0a[_0x64f0('0xac')]=_0x64f0('0xad');_0x50cb0a[_0x64f0('0x94')]=!![];_0x50cb0a['queuecallerexitAt']=moment()[_0x64f0('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x50cb0a['queuecallerleaveAt']=moment()['format'](_0x64f0('0x86'));logger['debug'](_0x64f0('0xae'),_0x622d73[_0x64f0('0x49')],util['inspect'](_0x50cb0a,{'showHidden':![],'depth':null}));ami['emit']('custom:timeout',_0x50cb0a);break;default:_0x50cb0a[_0x64f0('0x94')]=!![];_0x50cb0a[_0x64f0('0x95')]=moment()[_0x64f0('0x4a')](_0x64f0('0x86'));_0x50cb0a[_0x64f0('0x8b')]=moment()[_0x64f0('0x4a')](_0x64f0('0x86'));}_0x50cb0a[_0x64f0('0x1a')]=![];_0x50cb0a[_0x64f0('0x85')]=null;_0x50cb0a[_0x64f0('0x4f')]=_0x622d73[_0x64f0('0xaa')];this[_0x64f0('0x12')][_0x622d73[_0x64f0('0x49')]]=_0x50cb0a;this[_0x64f0('0x42')](_0x50cb0a,'varset');}else if(this[_0x64f0('0x65')](_0x622d73['variable'])&&this[_0x64f0('0x65')](_0x622d73[_0x64f0('0xa9')][_0x64f0('0xaf')])){if(!_0x50cb0a[_0x64f0('0x1a')]){_0x50cb0a['queuecallerexit']=!![];_0x50cb0a[_0x64f0('0x95')]=moment()[_0x64f0('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x50cb0a[_0x64f0('0x4f')]='EXITWITHKEY';_0x50cb0a[_0x64f0('0x8b')]=moment()[_0x64f0('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x64f0('0x12')][_0x622d73[_0x64f0('0x49')]]=_0x50cb0a;}}logger[_0x64f0('0x6d')](_0x64f0('0xb0'),_0x622d73[_0x64f0('0x49')],_0x50cb0a[_0x64f0('0x4c')],_0x50cb0a[_0x64f0('0x53')],_[_0x64f0('0x7d')](_0x622d73[_0x64f0('0xa9')])[0x0],_0x622d73['value']);_0x50cb0a[_0x64f0('0x3c')]=this[_0x64f0('0x3c')][_0x622d73[_0x64f0('0x49')]];}}}}catch(_0x25514a){logger['error']('[%s][voiceQueueReport][varset]',_0x622d73[_0x64f0('0x49')],util['inspect'](_0x25514a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x64f0('0xc')][_0x64f0('0xa8')]=function(_0x284356,_0x56e6a1,_0x5d6c10){var _0x1690f7=[_0x64f0('0xb1'),'rtpaudioqosbridged',_0x64f0('0xb2'),_0x64f0('0xb3'),'rtpaudioqosloss','rtpaudioqoslossbridged',_0x64f0('0xb4'),_0x64f0('0xb5'),_0x64f0('0xb6'),_0x64f0('0xb7'),'bridgepeer','bridgepvtcallid',_0x64f0('0xb8'),_0x64f0('0xb9'),_0x64f0('0xba'),_0x64f0('0xbb'),_0x64f0('0x93'),_0x64f0('0xbc'),_0x64f0('0xbd')];if(!_[_0x64f0('0x36')](_0x56e6a1)&&!_[_0x64f0('0xbe')](_0x1690f7,_0x56e6a1)){if(_[_0x64f0('0x66')](this[_0x64f0('0x3c')][_0x284356])){this['variables'][_0x284356]={};}this['variables'][_0x284356][_0x56e6a1]=_0x5d6c10;}};VoiceQueueReport[_0x64f0('0xc')][_0x64f0('0x23')]=function(_0x4b1d9e){try{if(this[_0x64f0('0x65')](_0x4b1d9e)){logger['debug'](_0x64f0('0xbf'),_0x4b1d9e['uniqueid'],util[_0x64f0('0x3e')](_0x4b1d9e,{'showHidden':![],'depth':null}));if(this[_0x64f0('0x10')][_0x4b1d9e[_0x64f0('0x49')]]){for(var _0x4f1ac5=0x0,_0x3fbc2b={};_0x4f1ac5<this[_0x64f0('0x10')][_0x4b1d9e[_0x64f0('0x49')]][_0x64f0('0xc0')];_0x4f1ac5+=0x1){_0x3fbc2b=this[_0x64f0('0x10')][_0x4b1d9e[_0x64f0('0x49')]][_0x4f1ac5];if(this[_0x64f0('0x41')][_0x3fbc2b[_0x64f0('0x6b')]]){if(_0x3fbc2b[_0x64f0('0x94')]&&_0x3fbc2b[_0x64f0('0x96')]!=!![]){this[_0x64f0('0x41')][_0x3fbc2b[_0x64f0('0x6b')]][_0x64f0('0xc1')]+=0x1;}if(_0x3fbc2b[_0x64f0('0x1a')]){this[_0x64f0('0x41')][_0x3fbc2b['queue']][_0x64f0('0x5d')]+=0x1;}this['voiceQueues'][_0x3fbc2b[_0x64f0('0x6b')]][_0x64f0('0x5a')]+=moment(_0x3fbc2b[_0x64f0('0x8b')])['diff'](_0x3fbc2b[_0x64f0('0x77')],'seconds')||0x0;if(_0x4f1ac5===this[_0x64f0('0x10')][_0x4b1d9e[_0x64f0('0x49')]][_0x64f0('0xc0')]-0x1){this[_0x64f0('0x41')][_0x3fbc2b[_0x64f0('0x6b')]][_0x64f0('0x59')]+=moment()['milliseconds'](0x0)[_0x64f0('0xc2')](_0x3fbc2b[_0x64f0('0x77')],_0x64f0('0x9e'));this[_0x64f0('0x41')][_0x3fbc2b[_0x64f0('0x6b')]][_0x64f0('0x5c')]+=0x1;if(_0x3fbc2b[_0x64f0('0x82')]){this[_0x64f0('0x41')][_0x3fbc2b[_0x64f0('0x6b')]]['answered']+=0x1;this['voiceQueues'][_0x3fbc2b['queue']][_0x64f0('0x58')]+=moment()[_0x64f0('0xc3')](0x0)[_0x64f0('0xc2')](_0x3fbc2b['queuecallerleaveAt'],'seconds');_0x3fbc2b[_0x64f0('0xc4')]=moment()[_0x64f0('0x4a')](_0x64f0('0x86'));_0x3fbc2b['queuecallerexit']=![];_0x3fbc2b[_0x64f0('0x95')]=null;}if(_0x3fbc2b[_0x64f0('0x94')]&&_0x3fbc2b[_0x64f0('0x96')]!=!![]){_0x3fbc2b[_0x64f0('0xac')]=_0x64f0('0xc1');logger[_0x64f0('0x46')](_0x64f0('0xc5'),_0x4b1d9e[_0x64f0('0x49')],util[_0x64f0('0x3e')](_0x3fbc2b,{'showHidden':![],'depth':null}));ami[_0x64f0('0x44')]('custom:queuecallerunmanaged',_0x3fbc2b);}if(_0x3fbc2b[_0x64f0('0x1a')]){_0x3fbc2b[_0x64f0('0xac')]=_0x64f0('0x5d');logger[_0x64f0('0x46')](_0x64f0('0xc6'),_0x4b1d9e['uniqueid'],util[_0x64f0('0x3e')](_0x3fbc2b,{'showHidden':![],'depth':null}));ami[_0x64f0('0x44')](_0x64f0('0xc7'),_0x3fbc2b);}}else{this[_0x64f0('0x41')][_0x3fbc2b[_0x64f0('0x6b')]][_0x64f0('0x59')]+=this[_0x64f0('0x41')][_0x3fbc2b['queue']]['sumHoldTime'];}logger['info'](_0x64f0('0xc8'),_0x4b1d9e[_0x64f0('0x49')],_0x3fbc2b[_0x64f0('0x4c')],_0x3fbc2b[_0x64f0('0x53')],_0x4b1d9e[_0x64f0('0xc9')]);this[_0x64f0('0x12')][_0x4b1d9e['uniqueid']]=_0x3fbc2b;this[_0x64f0('0x42')](_0x3fbc2b,_0x64f0('0x22'));this[_0x64f0('0x52')](this[_0x64f0('0x41')][_0x3fbc2b[_0x64f0('0x6b')]],_0x64f0('0x22'));}}logger[_0x64f0('0x46')](_0x64f0('0xca'),_0x4b1d9e[_0x64f0('0x49')],util[_0x64f0('0x3e')](this[_0x64f0('0x10')][_0x4b1d9e[_0x64f0('0x49')]],{'showHidden':![],'depth':null}));ami['emit'](_0x64f0('0xcb'),this['queueReports'][_0x4b1d9e[_0x64f0('0x49')]]);if(_0x3fbc2b[_0x64f0('0x4f')]===_0x64f0('0x50'))return;delete this[_0x64f0('0x10')][_0x4b1d9e[_0x64f0('0x49')]];delete this[_0x64f0('0x12')][_0x4b1d9e[_0x64f0('0x49')]];}if(this[_0x64f0('0x3c')][_0x4b1d9e['uniqueid']]){delete this[_0x64f0('0x3c')][_0x4b1d9e[_0x64f0('0x49')]];}}}catch(_0x3c1494){logger[_0x64f0('0x3a')](_0x64f0('0xbf'),_0x4b1d9e[_0x64f0('0x49')],util['inspect'](_0x3c1494,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x64f0('0xc')]['syncAttendedTransfer']=function(_0x23a3af){try{if(this[_0x64f0('0x65')](_0x23a3af)){logger[_0x64f0('0x46')]('[%s][voiceQueueReport][attendedtransfer]',_0x23a3af['uniqueid'],util[_0x64f0('0x3e')](_0x23a3af,{'showHidden':![],'depth':null}));var _0xd29d85;var _0x4f685c;var _0x117df9;if(this[_0x64f0('0x10')][_0x23a3af[_0x64f0('0xcc')]]){_0xd29d85=_[_0x64f0('0x81')](this[_0x64f0('0x10')][_0x23a3af['transfereeuniqueid']]);_0xd29d85[_0x64f0('0xa1')]=_0x23a3af['secondtransfererexten'];_0xd29d85[_0x64f0('0xa3')]=_0x23a3af[_0x64f0('0xcd')];_0xd29d85[_0x64f0('0x4f')]=_0x64f0('0x50');_0xd29d85[_0x64f0('0x96')]=!![];_0xd29d85['transfertype']=_0x64f0('0xce');if(this[_0x64f0('0x10')][_0x23a3af[_0x64f0('0xcd')]]){_0x117df9=this[_0x64f0('0x10')][_0x23a3af[_0x64f0('0xcd')]];this['queueReports'][_0x23a3af[_0x64f0('0xcd')]]=this[_0x64f0('0x10')][_0x23a3af[_0x64f0('0xcc')]];this[_0x64f0('0x10')][_0x23a3af[_0x64f0('0xcc')]]=_0x117df9;_0x4f685c=_[_0x64f0('0x81')](this[_0x64f0('0x10')][_0x23a3af[_0x64f0('0xcc')]]);_0x4f685c[_0x64f0('0x34')]=!![];}logger[_0x64f0('0x6d')](_0x64f0('0xcf'),_0x23a3af['uniqueid'],_0xd29d85[_0x64f0('0x4c')],_0xd29d85[_0x64f0('0x53')],_0xd29d85[_0x64f0('0xa1')],_0xd29d85[_0x64f0('0xa3')]);}else if(this['queueReports'][_0x23a3af[_0x64f0('0xd0')]]){_0xd29d85=_[_0x64f0('0x81')](this[_0x64f0('0x10')][_0x23a3af[_0x64f0('0xd0')]]);_0xd29d85['transferexten']=_0x23a3af[_0x64f0('0xd1')];_0xd29d85[_0x64f0('0xa3')]=_0x23a3af[_0x64f0('0xd2')];_0xd29d85['queuecallerexitreason']=_0x64f0('0x50');_0xd29d85[_0x64f0('0x96')]=!![];_0xd29d85[_0x64f0('0xd3')]='ATTENDED';if(this[_0x64f0('0x10')][_0x23a3af['origtransfereruniqueid']]){_0x117df9=this[_0x64f0('0x10')][_0x23a3af['origtransfereruniqueid']];this['queueReports'][_0x23a3af['origtransfereruniqueid']]=this[_0x64f0('0x10')][_0x23a3af['transfertargetuniqueid']];this[_0x64f0('0x10')][_0x23a3af[_0x64f0('0xd0')]]=_0x117df9;_0x4f685c=_[_0x64f0('0x81')](this[_0x64f0('0x10')][_0x23a3af[_0x64f0('0xd0')]]);_0x4f685c[_0x64f0('0x34')]=!![];}logger['info'](_0x64f0('0xcf'),_0x23a3af[_0x64f0('0x49')],_0xd29d85[_0x64f0('0x4c')],_0xd29d85[_0x64f0('0x53')],_0xd29d85[_0x64f0('0xa1')],_0xd29d85['transferuniqueid']);}else if(this[_0x64f0('0x10')][_0x23a3af[_0x64f0('0xd2')]]){_0xd29d85=_[_0x64f0('0x81')](this['queueReports'][_0x23a3af[_0x64f0('0xd2')]]);_0xd29d85[_0x64f0('0xa1')]=_0x23a3af[_0x64f0('0xd1')];_0xd29d85[_0x64f0('0xa3')]=_0x23a3af[_0x64f0('0xd2')];_0xd29d85[_0x64f0('0x4f')]=_0x64f0('0x50');_0xd29d85['transfer']=!![];_0xd29d85[_0x64f0('0xd3')]=_0x64f0('0xce');}else if(this[_0x64f0('0x10')][_0x23a3af['secondtransfereruniqueid']]){_0xd29d85=_[_0x64f0('0x81')](this['queueReports'][_0x23a3af[_0x64f0('0xcd')]]);_0xd29d85[_0x64f0('0xa1')]=_0x23a3af[_0x64f0('0xd4')];_0xd29d85['transferuniqueid']=_0x23a3af[_0x64f0('0xcd')];_0xd29d85[_0x64f0('0x4f')]='ATTENDEDTRANSFER';_0xd29d85[_0x64f0('0x96')]=!![];_0xd29d85['transfertype']=_0x64f0('0xce');}}}catch(_0x3b5863){logger['error'](_0x64f0('0xd5'),_0x23a3af[_0x64f0('0x49')],util[_0x64f0('0x3e')](_0x3b5863,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x64f0('0xc')][_0x64f0('0x2c')]=function(_0x24c7fc){try{if(this[_0x64f0('0x65')](_0x24c7fc)){logger['debug'](_0x64f0('0xd6'),_0x24c7fc[_0x64f0('0x49')],util[_0x64f0('0x3e')](_0x24c7fc,{'showHidden':![],'depth':null}));if(this[_0x64f0('0x10')][_0x24c7fc[_0x64f0('0xcc')]]){var _0x99f558=_[_0x64f0('0x81')](this[_0x64f0('0x10')][_0x24c7fc[_0x64f0('0xcc')]]);_0x99f558['queuecallerexitreason']=_0x64f0('0xd7');_0x99f558['transfer']=!![];_0x99f558[_0x64f0('0xd3')]=_0x64f0('0xd8');_0x99f558[_0x64f0('0xa1')]=_0x24c7fc['extension'];_0x99f558['transferuniqueid']=_0x24c7fc['transfereeuniqueid'];logger[_0x64f0('0x6d')](_0x64f0('0xd9'),_0x24c7fc[_0x64f0('0x49')],_0x99f558['name'],_0x99f558[_0x64f0('0x53')],_0x99f558['transferexten'],_0x99f558[_0x64f0('0xa3')]);this[_0x64f0('0x23')]({'event':_0x64f0('0xda'),'uniqueid':_0x24c7fc[_0x64f0('0xcc')],'context':_0x24c7fc[_0x64f0('0xdb')],'channel':_0x24c7fc[_0x64f0('0xdc')]});}}}catch(_0x10cd03){logger['error'](_0x64f0('0xd6'),_0x24c7fc[_0x64f0('0x49')],util[_0x64f0('0x3e')](_0x10cd03,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x64f0('0x26')]=function(_0x1f0540){try{if(this['isNotNull'](_0x1f0540)){logger[_0x64f0('0x46')](_0x64f0('0xdd'),_0x1f0540['uniqueid'],util[_0x64f0('0x3e')](_0x1f0540,{'showHidden':![],'depth':null}));if(this[_0x64f0('0x10')][_0x1f0540[_0x64f0('0x49')]]){var _0xc6c00b=_['last'](this['queueReports'][_0x1f0540[_0x64f0('0x49')]]);if(!_[_0x64f0('0x36')](_0xc6c00b['queuecallerleaveAt'])){_0xc6c00b[_0x64f0('0xde')]=moment()['format'](_0x64f0('0x86'));logger[_0x64f0('0x6d')](_0x64f0('0xdf'),_0x1f0540[_0x64f0('0x49')],_0xc6c00b['mohstarttime']);}}}}catch(_0xa1f800){logger[_0x64f0('0x3a')](_0x64f0('0xdd'),_0x1f0540[_0x64f0('0x49')],util[_0x64f0('0x3e')](_0xa1f800,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x64f0('0xc')]['syncMusicOnHoldStop']=function(_0x266ab4){try{if(this[_0x64f0('0x65')](_0x266ab4)){logger[_0x64f0('0x46')]('[%s][voiceQueueReport][musiconholdstop]',_0x266ab4['uniqueid'],util[_0x64f0('0x3e')](_0x266ab4,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x266ab4[_0x64f0('0x49')]]){var _0x3a50dd=_[_0x64f0('0x81')](this[_0x64f0('0x10')][_0x266ab4['uniqueid']]);if(!_[_0x64f0('0x36')](_0x3a50dd[_0x64f0('0xde')])){_0x3a50dd[_0x64f0('0xe0')]+=moment()[_0x64f0('0xc3')](0x0)[_0x64f0('0xc2')](_0x3a50dd[_0x64f0('0xde')],'seconds');logger[_0x64f0('0x6d')](_0x64f0('0xe1'),_0x266ab4[_0x64f0('0x49')],_0x3a50dd['mohtime']);delete _0x3a50dd[_0x64f0('0xde')];}}}}catch(_0x44bbb1){logger[_0x64f0('0x3a')](_0x64f0('0xe2'),_0x266ab4['uniqueid'],util[_0x64f0('0x3e')](_0x44bbb1,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x64f0('0xe3')]=function(_0x4aff1d){try{if(this[_0x64f0('0x65')](_0x4aff1d)){logger[_0x64f0('0x46')](_0x64f0('0xe4'),_0x4aff1d[_0x64f0('0x49')],util[_0x64f0('0x3e')](_0x4aff1d,{'showHidden':![],'depth':null}));if(_0x4aff1d[_0x64f0('0xe5')][_0x64f0('0xe6')]()===_0x64f0('0xe7')){_0x4aff1d['applicationdata']=_0x4aff1d[_0x64f0('0xe8')]&&_0x4aff1d[_0x64f0('0xe8')][_0x64f0('0x99')]('CDR(routeAlias)')?_0x4aff1d[_0x64f0('0xe8')]:(_0x4aff1d['appdata']||_0x4aff1d[_0x64f0('0xe9')])['toLowerCase']();if(_['startsWith'](_0x4aff1d[_0x64f0('0xe9')][_0x64f0('0xe6')](),_0x64f0('0xea'))){logger[_0x64f0('0x6d')](_0x64f0('0xeb'),_0x4aff1d[_0x64f0('0x49')],_0x4aff1d[_0x64f0('0xe5')],_0x4aff1d[_0x64f0('0xe9')]);if(_[_0x64f0('0x66')](this['channels'][_0x4aff1d[_0x64f0('0x49')]]))this[_0x64f0('0x12')][_0x4aff1d[_0x64f0('0x49')]]={};var _0x374d93=_0x4aff1d['applicationdata']['split']('=');var _0x37319d=_0x374d93[0x0][_0x64f0('0xe6')]()[_0x64f0('0xec')](/cdr\((.*)\)/);if(_0x37319d)this[_0x64f0('0x12')][_0x4aff1d[_0x64f0('0x49')]][_0x37319d[0x1]]=_0x374d93[0x1];}}}}catch(_0x15a2fa){logger[_0x64f0('0x3a')](_0x64f0('0xed'),_0x4aff1d[_0x64f0('0x49')],util[_0x64f0('0x3e')](_0x15a2fa,{'showHidden':![],'depth':null}));}};module['exports']=VoiceQueueReport;
\ No newline at end of file
index 7684a1b..acb1b01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c32=['../client','createHistory','queue','CreateReportAgentPreview'];(function(_0x5a75f6,_0x1296cd){var _0x46daeb=function(_0x36ce2c){while(--_0x36ce2c){_0x5a75f6['push'](_0x5a75f6['shift']());}};_0x46daeb(++_0x1296cd);}(_0x6c32,0x9c));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x26c3('0x0'));exports[_0x26c3('0x1')]=function(_0xe7ae4f){return function(){_0xe7ae4f['campaign']=_0xe7ae4f[_0x26c3('0x2')];return client['Request']('CreateReportAgentPreview',{'body':_0xe7ae4f,'log':_0x26c3('0x3')});};};
\ No newline at end of file
+var _0xa4e7=['createHistory','queue','Request','CreateReportAgentPreview','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa4e7,0x8b));var _0x7a4e=function(_0x1347eb,_0x35c405){_0x1347eb=_0x1347eb-0x0;var _0x2939c5=_0xa4e7[_0x1347eb];return _0x2939c5;};'use strict';var client=require(_0x7a4e('0x0'));exports[_0x7a4e('0x1')]=function(_0x23d37c){return function(){_0x23d37c['campaign']=_0x23d37c[_0x7a4e('0x2')];return client[_0x7a4e('0x3')](_0x7a4e('0x4'),{'body':_0x23d37c,'log':_0x7a4e('0x4')});};};
\ No newline at end of file
index 6ae7cf3..f16c722 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f46=['../client','Request','CreateAttachment'];(function(_0x2a125f,_0x3a6d5f){var _0x4d017a=function(_0x3180d6){while(--_0x3180d6){_0x2a125f['push'](_0x2a125f['shift']());}};_0x4d017a(++_0x3a6d5f);}(_0x0f46,0x150));var _0x60f4=function(_0x1977a8,_0x505e13){_0x1977a8=_0x1977a8-0x0;var _0x3851a9=_0x0f46[_0x1977a8];return _0x3851a9;};'use strict';var client=require(_0x60f4('0x0'));exports['create']=function(_0x2e7618){return client[_0x60f4('0x1')](_0x60f4('0x2'),{'body':_0x2e7618,'log':_0x60f4('0x2')});};
\ No newline at end of file
+var _0x2b22=['../client','create','Request','CreateAttachment'];(function(_0xf8f962,_0x459ea0){var _0x3a8b51=function(_0x257c64){while(--_0x257c64){_0xf8f962['push'](_0xf8f962['shift']());}};_0x3a8b51(++_0x459ea0);}(_0x2b22,0xf4));var _0x22b2=function(_0x3f9c88,_0xb1deb4){_0x3f9c88=_0x3f9c88-0x0;var _0x1607d5=_0x2b22[_0x3f9c88];return _0x1607d5;};'use strict';var client=require(_0x22b2('0x0'));exports[_0x22b2('0x1')]=function(_0x214f5d){return client[_0x22b2('0x2')](_0x22b2('0x3'),{'body':_0x214f5d,'log':'CreateAttachment'});};
\ No newline at end of file
index 59d7193..96bea94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialTimezone','dialGlobalInterval','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','Trunk','callerid','active','Interval','Intervals','interval','SquareProject','../client','getCampaigns','Request','name','type','limitCalls','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialBusyMaxRetry'];(function(_0x31b46b,_0x51a099){var _0x17998f=function(_0x99cc4a){while(--_0x99cc4a){_0x31b46b['push'](_0x31b46b['shift']());}};_0x17998f(++_0x51a099);}(_0x7a54,0x106));var _0x47a5=function(_0x5b011f,_0x1b1880){_0x5b011f=_0x5b011f-0x0;var _0x1bdd23=_0x7a54[_0x5b011f];return _0x1bdd23;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(){return function(){return client[_0x47a5('0x2')]('GetCampaign',{'options':{'raw':![],'attributes':['id',_0x47a5('0x3'),_0x47a5('0x4'),'active',_0x47a5('0x5'),_0x47a5('0x6'),_0x47a5('0x7'),_0x47a5('0x8'),_0x47a5('0x9'),'dialCongestionRetryFrequency',_0x47a5('0xa'),'dialBusyRetryFrequency',_0x47a5('0xb'),_0x47a5('0xc'),'dialGlobalMaxRetry',_0x47a5('0xd'),'dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency',_0x47a5('0xe'),_0x47a5('0xf'),'dialMachineMaxRetry',_0x47a5('0x10'),'dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency',_0x47a5('0x11'),_0x47a5('0x12'),_0x47a5('0x13'),_0x47a5('0x14'),_0x47a5('0x15'),_0x47a5('0x16'),_0x47a5('0x17'),'dialAMDMinWordLength',_0x47a5('0x18'),_0x47a5('0x19'),_0x47a5('0x1a'),_0x47a5('0x1b'),_0x47a5('0x1c'),_0x47a5('0x1d'),_0x47a5('0x1e'),_0x47a5('0x1f')],'include':[{'model':'Trunk','as':_0x47a5('0x20'),'attributes':['id',_0x47a5('0x3'),_0x47a5('0x21'),_0x47a5('0x22')]},{'model':_0x47a5('0x20'),'as':'TrunkBackup','attributes':['id','name',_0x47a5('0x21'),'active']},{'model':'Interval','as':_0x47a5('0x23'),'attributes':['id',_0x47a5('0x3')],'include':[{'model':_0x47a5('0x23'),'as':_0x47a5('0x24'),'attributes':['id',_0x47a5('0x3'),_0x47a5('0x25')]}]},{'model':_0x47a5('0x26'),'as':_0x47a5('0x26'),'attributes':['id',_0x47a5('0x3')]}]},'log':'getCampaign'});};};
\ No newline at end of file
+var _0xdb28=['dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','Trunk','name','callerid','Interval','interval','SquareProject','getCampaign','../client','getCampaigns','Request','GetCampaign','type','active','limitCalls','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialTimezone','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialOrderByScheduledAt'];(function(_0x4362af,_0x275bae){var _0x20c942=function(_0x2eff46){while(--_0x2eff46){_0x4362af['push'](_0x4362af['shift']());}};_0x20c942(++_0x275bae);}(_0xdb28,0x106));var _0x8db2=function(_0x4f2453,_0x136b78){_0x4f2453=_0x4f2453-0x0;var _0x409ff2=_0xdb28[_0x4f2453];return _0x409ff2;};'use strict';var client=require(_0x8db2('0x0'));exports[_0x8db2('0x1')]=function(){return function(){return client[_0x8db2('0x2')](_0x8db2('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x8db2('0x4'),_0x8db2('0x5'),_0x8db2('0x6'),_0x8db2('0x7'),_0x8db2('0x8'),'dialOriginateTimeout',_0x8db2('0x9'),_0x8db2('0xa'),'dialBusyMaxRetry','dialBusyRetryFrequency',_0x8db2('0xb'),_0x8db2('0xc'),_0x8db2('0xd'),_0x8db2('0xe'),_0x8db2('0xf'),_0x8db2('0x10'),_0x8db2('0x11'),'dialAbandonedMaxRetry',_0x8db2('0x12'),_0x8db2('0x13'),_0x8db2('0x14'),'dialAgentRejectMaxRetry',_0x8db2('0x15'),_0x8db2('0x16'),'dialGlobalInterval',_0x8db2('0x17'),_0x8db2('0x18'),_0x8db2('0x19'),_0x8db2('0x1a'),_0x8db2('0x1b'),'dialAMDMinWordLength','dialAMDBetweenWordsSilence',_0x8db2('0x1c'),_0x8db2('0x1d'),_0x8db2('0x1e'),_0x8db2('0x1f'),_0x8db2('0x20'),_0x8db2('0x21'),_0x8db2('0x22')],'include':[{'model':_0x8db2('0x23'),'as':_0x8db2('0x23'),'attributes':['id',_0x8db2('0x24'),'callerid',_0x8db2('0x5')]},{'model':_0x8db2('0x23'),'as':'TrunkBackup','attributes':['id',_0x8db2('0x24'),_0x8db2('0x25'),_0x8db2('0x5')]},{'model':_0x8db2('0x26'),'as':_0x8db2('0x26'),'attributes':['id',_0x8db2('0x24')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0x8db2('0x24'),_0x8db2('0x27')]}]},{'model':_0x8db2('0x28'),'as':_0x8db2('0x28'),'attributes':['id','name']}]},'log':_0x8db2('0x29')});};};
\ No newline at end of file
index 82ff6c1..2fee1d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0994=['GetCmContact','CreateCmContact','getContacts','Request'];(function(_0x202fa7,_0x2fe6b8){var _0x5f2465=function(_0x5b617b){while(--_0x5b617b){_0x202fa7['push'](_0x202fa7['shift']());}};_0x5f2465(++_0x2fe6b8);}(_0x0994,0x1e5));var _0x4099=function(_0x1e9391,_0x361d06){_0x1e9391=_0x1e9391-0x0;var _0x3fd5d8=_0x0994[_0x1e9391];return _0x3fd5d8;};'use strict';var client=require('../client');exports['createContact']=function(_0x2d9fc1){return function(){return client['Request'](_0x4099('0x0'),{'body':_0x2d9fc1,'log':_0x4099('0x0')});};};exports[_0x4099('0x1')]=function(_0x1ec646){return function(){return client[_0x4099('0x2')](_0x4099('0x3'),{'options':_0x1ec646,'log':'GetCmContact'});};};
\ No newline at end of file
+var _0x39a8=['Request','CreateCmContact','GetCmContact','../client'];(function(_0x42f729,_0x132804){var _0x3217c7=function(_0x3bdf3b){while(--_0x3bdf3b){_0x42f729['push'](_0x42f729['shift']());}};_0x3217c7(++_0x132804);}(_0x39a8,0x183));var _0x839a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x39a8[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x839a('0x0'));exports['createContact']=function(_0x55fc0a){return function(){return client[_0x839a('0x1')]('CreateCmContact',{'body':_0x55fc0a,'log':_0x839a('0x2')});};};exports['getContacts']=function(_0x306f3d){return function(){return client[_0x839a('0x1')](_0x839a('0x3'),{'options':_0x306f3d,'log':_0x839a('0x3')});};};
\ No newline at end of file
index de393cc..3c72c51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8fdc=['getContactPreview','User','name','getContactRecallMe','GetContactRecallMe','Agent','voicePause','db.CmHopper.UserId','ResetActiveCalls','handlePreviewRecallNotifications','../client','lodash','getContacts','Request','GetCmHopper','CmContact','getCmHopper','UpdateCmHopper','format','YYYY-MM-DD\x20HH:mm:ss','ContactId','ListId','VoiceQueueId','CampaignId','destroyContact','DestroyCmHopper','priority','DESC','scheduledat','ASC','GetContactDialer','getContactDialerIvr','Contact','moveContactManagedDialer','queue','MoveContactManagedDialer','countReScheduled','CountReScheduled'];(function(_0x264960,_0x36a3f2){var _0x580987=function(_0x9a624b){while(--_0x9a624b){_0x264960['push'](_0x264960['shift']());}};_0x580987(++_0x36a3f2);}(_0x8fdc,0x1d2));var _0xc8fd=function(_0x4b6830,_0x2bf6fb){_0x4b6830=_0x4b6830-0x0;var _0x239e4a=_0x8fdc[_0x4b6830];return _0x239e4a;};'use strict';var client=require(_0xc8fd('0x0'));var moment=require('moment');var _=require(_0xc8fd('0x1'));exports[_0xc8fd('0x2')]=function(_0x3e326b,_0x21baf8){return function(){return client[_0xc8fd('0x3')](_0xc8fd('0x4'),{'options':{'where':{'VoiceQueueId':_0x3e326b},'include':[{'model':_0xc8fd('0x5'),'as':'Contact'}],'limit':_0x21baf8,'raw':![]},'log':_0xc8fd('0x6')});};};exports['updateContacts']=function(_0x3614f3,_0x3b91e9,_0x438cfe){return function(){return client[_0xc8fd('0x3')](_0xc8fd('0x7'),{'body':_0x3614f3,'options':{'where':{'VoiceQueueId':_0x3b91e9,'scheduledat':{'$lte':moment()[_0xc8fd('0x8')](_0xc8fd('0x9'))}},'limit':_0x438cfe},'log':_0xc8fd('0x7')});};};exports['rescheduleContact']=function(_0x8e25a9){return function(){return client['Request'](_0xc8fd('0x7'),{'body':_0x8e25a9,'options':{'where':{'ContactId':_0x8e25a9[_0xc8fd('0xa')],'ListId':_0x8e25a9[_0xc8fd('0xb')],'VoiceQueueId':_0x8e25a9[_0xc8fd('0xc')],'CampaignId':_0x8e25a9[_0xc8fd('0xd')]}},'log':'rescheduleContact'});};};exports[_0xc8fd('0xe')]=function(_0x4dfbaa,_0x17a8d9,_0x3c59a9){return function(){return client[_0xc8fd('0x3')](_0xc8fd('0xf'),{'options':{'where':{'VoiceQueueId':_0x4dfbaa,'ListId':_0x17a8d9,'ContactId':_0x3c59a9}},'log':_0xc8fd('0xf')});};};exports['getContactDialer']=function(_0x14820d,_0x1020c9,_0x44f1e3,_0x1b9314){return function(){return client[_0xc8fd('0x3')]('GetContactDialer',{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x14820d,'active':![],'scheduledat':{'$lte':moment()[_0xc8fd('0x8')](_0xc8fd('0x9'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x1020c9}}]},'order':[[_0xc8fd('0x10'),_0xc8fd('0x11')],[_0xc8fd('0x12'),_0x1b9314],['id',_0xc8fd('0x13')]],'raw':!![],'limit':_0x44f1e3},'log':_0xc8fd('0x14')});};};exports[_0xc8fd('0x15')]=function(_0x49b524,_0x3bcc6,_0x169553){return function(){return client['Request']('GetContactDialer',{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x49b524,'active':![],'scheduledat':{'$lte':moment()[_0xc8fd('0x8')](_0xc8fd('0x9'))}},'include':[{'model':'CmContact','as':_0xc8fd('0x16')}],'order':[[_0xc8fd('0x10'),_0xc8fd('0x11')],[_0xc8fd('0x12'),_0x169553],['id',_0xc8fd('0x13')]],'raw':!![],'limit':_0x3bcc6},'log':'GetContactDialerIvr'});};};exports[_0xc8fd('0x17')]=function(_0x169add,_0x2a6be4){return function(){_0x169add['campaign']=_0x169add[_0xc8fd('0x18')];return client[_0xc8fd('0x3')](_0xc8fd('0x19'),{'body':_0x169add,'options':{'where':{'ContactId':_0x169add[_0xc8fd('0xa')],'ListId':_0x169add[_0xc8fd('0xb')],'VoiceQueueId':_0x169add[_0xc8fd('0xc')],'CampaignId':_0x169add[_0xc8fd('0xd')],'active':_0x2a6be4?undefined:!![]}},'log':_0xc8fd('0x19')});};};exports[_0xc8fd('0x1a')]=function(_0x211f34){return function(){return client[_0xc8fd('0x3')](_0xc8fd('0x1b'),{'options':{'where':{'VoiceQueueId':_0x211f34['id']?_0x211f34['id']||null:null}},'log':_0xc8fd('0x1a')});};};exports[_0xc8fd('0x1c')]=function(_0xe11a3f){return function(){return client['Request']('GetCmHopperPreview',{'options':{'where':{'id':_0xe11a3f},'include':[{'model':_0xc8fd('0x5'),'as':_0xc8fd('0x16')},{'model':_0xc8fd('0x1d'),'as':'Agent','attributes':['id',_0xc8fd('0x1e')]},{'model':'VoiceQueue','as':'Queue','attributes':['id',_0xc8fd('0x1e')]}],'raw':!![]},'log':'getCmHopper'});};};exports['unlockContact']=function(_0x25a2f5,_0x295a8a,_0x1ee21f){return function(){return client[_0xc8fd('0x3')](_0xc8fd('0x7'),{'body':_0x25a2f5,'options':{'where':{'id':_0x295a8a},'limit':_0x1ee21f},'log':'UpdateCmHopper'});};};exports[_0xc8fd('0x1f')]=function(_0x434873,_0xd3d70c){return function(){return client[_0xc8fd('0x3')](_0xc8fd('0x20'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x434873,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0xc8fd('0x8')](_0xc8fd('0x9'))},'UserId':{'$in':_0xd3d70c}},'order':[['priority',_0xc8fd('0x11')],[_0xc8fd('0x12'),'DESC'],['id',_0xc8fd('0x13')]],'include':[{'model':'CmContact','as':_0xc8fd('0x16')},{'model':_0xc8fd('0x1d'),'as':_0xc8fd('0x21'),'attributes':['id',_0xc8fd('0x1e'),_0xc8fd('0x22')]}],'group':_0xc8fd('0x23'),'raw':!![]},'log':_0xc8fd('0x14')});};};exports['resetActiveCalls']=function(_0x22258b){return function(){return client[_0xc8fd('0x3')](_0xc8fd('0x24'),{'body':_0x22258b,'options':{},'log':_0xc8fd('0x24')});};};exports['handlePreviewRecallNotifications']=function(_0x39027a,_0x37bbff){return function(){return client[_0xc8fd('0x3')]('CmHopperHandlePreviewRecallNotifications',{'body':{'where':{'voiceQueueId':_0x39027a,'interval':_0x37bbff}},'log':_0xc8fd('0x25')});};};
\ No newline at end of file
+var _0x126d=['destroyContact','DestroyCmHopper','getContactDialer','GetContactDialer','YYYY-MM-DD\x20HH:mm:ss','priority','DESC','scheduledat','getContactDialerIvr','ASC','GetContactDialerIvr','moveContactManagedDialer','campaign','queue','MoveContactManagedDialer','countReScheduled','CountReScheduled','getContactPreview','User','Agent','name','Queue','getContactRecallMe','GetContactRecallMe','voicePause','ResetActiveCalls','handlePreviewRecallNotifications','moment','lodash','Request','CmContact','Contact','getCmHopper','updateContacts','format','UpdateCmHopper','rescheduleContact','ContactId','ListId','CampaignId'];(function(_0xb8628e,_0x13d6aa){var _0x2f5887=function(_0x5f255b){while(--_0x5f255b){_0xb8628e['push'](_0xb8628e['shift']());}};_0x2f5887(++_0x13d6aa);}(_0x126d,0x183));var _0xd126=function(_0x47175d,_0x13dd16){_0x47175d=_0x47175d-0x0;var _0x33a97d=_0x126d[_0x47175d];return _0x33a97d;};'use strict';var client=require('../client');var moment=require(_0xd126('0x0'));var _=require(_0xd126('0x1'));exports['getContacts']=function(_0x1d51ed,_0x4a859b){return function(){return client[_0xd126('0x2')]('GetCmHopper',{'options':{'where':{'VoiceQueueId':_0x1d51ed},'include':[{'model':_0xd126('0x3'),'as':_0xd126('0x4')}],'limit':_0x4a859b,'raw':![]},'log':_0xd126('0x5')});};};exports[_0xd126('0x6')]=function(_0xe09e2a,_0x25a6ff,_0x5e2817){return function(){return client[_0xd126('0x2')]('UpdateCmHopper',{'body':_0xe09e2a,'options':{'where':{'VoiceQueueId':_0x25a6ff,'scheduledat':{'$lte':moment()[_0xd126('0x7')]('YYYY-MM-DD\x20HH:mm:ss')}},'limit':_0x5e2817},'log':_0xd126('0x8')});};};exports[_0xd126('0x9')]=function(_0x5d866f){return function(){return client['Request'](_0xd126('0x8'),{'body':_0x5d866f,'options':{'where':{'ContactId':_0x5d866f[_0xd126('0xa')],'ListId':_0x5d866f[_0xd126('0xb')],'VoiceQueueId':_0x5d866f['VoiceQueueId'],'CampaignId':_0x5d866f[_0xd126('0xc')]}},'log':_0xd126('0x9')});};};exports[_0xd126('0xd')]=function(_0x1e967d,_0x311f28,_0x1f61d3){return function(){return client[_0xd126('0x2')](_0xd126('0xe'),{'options':{'where':{'VoiceQueueId':_0x1e967d,'ListId':_0x311f28,'ContactId':_0x1f61d3}},'log':_0xd126('0xe')});};};exports[_0xd126('0xf')]=function(_0x207cfb,_0x3de359,_0x67d66d,_0x2fae57){return function(){return client[_0xd126('0x2')](_0xd126('0x10'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x207cfb,'active':![],'scheduledat':{'$lte':moment()['format'](_0xd126('0x11'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x3de359}}]},'order':[[_0xd126('0x12'),_0xd126('0x13')],[_0xd126('0x14'),_0x2fae57],['id','ASC']],'raw':!![],'limit':_0x67d66d},'log':_0xd126('0x10')});};};exports[_0xd126('0x15')]=function(_0x46619e,_0x1d6dba,_0x3b6039){return function(){return client[_0xd126('0x2')]('GetContactDialer',{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x46619e,'active':![],'scheduledat':{'$lte':moment()['format'](_0xd126('0x11'))}},'include':[{'model':_0xd126('0x3'),'as':'Contact'}],'order':[[_0xd126('0x12'),_0xd126('0x13')],[_0xd126('0x14'),_0x3b6039],['id',_0xd126('0x16')]],'raw':!![],'limit':_0x1d6dba},'log':_0xd126('0x17')});};};exports[_0xd126('0x18')]=function(_0x5e0d94,_0x531928){return function(){_0x5e0d94[_0xd126('0x19')]=_0x5e0d94[_0xd126('0x1a')];return client[_0xd126('0x2')](_0xd126('0x1b'),{'body':_0x5e0d94,'options':{'where':{'ContactId':_0x5e0d94['ContactId'],'ListId':_0x5e0d94[_0xd126('0xb')],'VoiceQueueId':_0x5e0d94['VoiceQueueId'],'CampaignId':_0x5e0d94['CampaignId'],'active':_0x531928?undefined:!![]}},'log':_0xd126('0x1b')});};};exports[_0xd126('0x1c')]=function(_0x3395ae){return function(){return client['Request'](_0xd126('0x1d'),{'options':{'where':{'VoiceQueueId':_0x3395ae['id']?_0x3395ae['id']||null:null}},'log':'countReScheduled'});};};exports[_0xd126('0x1e')]=function(_0x951244){return function(){return client[_0xd126('0x2')]('GetCmHopperPreview',{'options':{'where':{'id':_0x951244},'include':[{'model':'CmContact','as':_0xd126('0x4')},{'model':_0xd126('0x1f'),'as':_0xd126('0x20'),'attributes':['id',_0xd126('0x21')]},{'model':'VoiceQueue','as':_0xd126('0x22'),'attributes':['id',_0xd126('0x21')]}],'raw':!![]},'log':_0xd126('0x5')});};};exports['unlockContact']=function(_0x424c57,_0x4a2f4a,_0x1cf22d){return function(){return client[_0xd126('0x2')](_0xd126('0x8'),{'body':_0x424c57,'options':{'where':{'id':_0x4a2f4a},'limit':_0x1cf22d},'log':'UpdateCmHopper'});};};exports[_0xd126('0x23')]=function(_0x3132e8,_0x3ca261){return function(){return client['Request'](_0xd126('0x24'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x3132e8,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0xd126('0x7')](_0xd126('0x11'))},'UserId':{'$in':_0x3ca261}},'order':[[_0xd126('0x12'),'DESC'],[_0xd126('0x14'),_0xd126('0x13')],['id',_0xd126('0x16')]],'include':[{'model':'CmContact','as':_0xd126('0x4')},{'model':'User','as':_0xd126('0x20'),'attributes':['id',_0xd126('0x21'),_0xd126('0x25')]}],'group':'db.CmHopper.UserId','raw':!![]},'log':'GetContactDialer'});};};exports['resetActiveCalls']=function(_0x5d72c2){return function(){return client[_0xd126('0x2')](_0xd126('0x26'),{'body':_0x5d72c2,'options':{},'log':_0xd126('0x26')});};};exports[_0xd126('0x27')]=function(_0x1fcdf3,_0x123e62){return function(){return client[_0xd126('0x2')]('CmHopperHandlePreviewRecallNotifications',{'body':{'where':{'voiceQueueId':_0x1fcdf3,'interval':_0x123e62}},'log':'handlePreviewRecallNotifications'});};};
\ No newline at end of file
index 7ea4f53..43db40e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63a5=['phone','checkIsBlackListIvr','../client','checkIsBlackList','GetCmHopperBlack','Contact'];(function(_0x325673,_0x13c10b){var _0x741c5b=function(_0x33eeb2){while(--_0x33eeb2){_0x325673['push'](_0x325673['shift']());}};_0x741c5b(++_0x13c10b);}(_0x63a5,0x18e));var _0x563a=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x63a5[_0x199572];return _0x13cfa3;};'use strict';var client=require(_0x563a('0x0'));exports[_0x563a('0x1')]=function(_0x91178){return function(){return client['Request'](_0x563a('0x2'),{'options':{'where':{'VoiceQueueId':_0x91178['VoiceQueueId'],'phone':_0x91178[_0x563a('0x3')][_0x563a('0x4')]},'raw':![]},'log':_0x563a('0x2')});};};exports[_0x563a('0x5')]=function(_0x5c2a8d){return function(){return client['Request'](_0x563a('0x2'),{'options':{'where':{'CampaignId':_0x5c2a8d['CampaignId'],'phone':_0x5c2a8d[_0x563a('0x3')][_0x563a('0x4')]},'raw':![]},'log':'GetCmHopperBlackIvr'});};};
\ No newline at end of file
+var _0x63a5=['phone','checkIsBlackListIvr','../client','checkIsBlackList','GetCmHopperBlack','Contact'];(function(_0x39cc8f,_0xb60cd8){var _0x15e616=function(_0x513d9e){while(--_0x513d9e){_0x39cc8f['push'](_0x39cc8f['shift']());}};_0x15e616(++_0xb60cd8);}(_0x63a5,0x18e));var _0x563a=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0x63a5[_0x381589];return _0x2a075d;};'use strict';var client=require(_0x563a('0x0'));exports[_0x563a('0x1')]=function(_0x91178){return function(){return client['Request'](_0x563a('0x2'),{'options':{'where':{'VoiceQueueId':_0x91178['VoiceQueueId'],'phone':_0x91178[_0x563a('0x3')][_0x563a('0x4')]},'raw':![]},'log':_0x563a('0x2')});};};exports[_0x563a('0x5')]=function(_0x5c2a8d){return function(){return client['Request'](_0x563a('0x2'),{'options':{'where':{'CampaignId':_0x5c2a8d['CampaignId'],'phone':_0x5c2a8d[_0x563a('0x3')][_0x563a('0x4')]},'raw':![]},'log':'GetCmHopperBlackIvr'});};};
\ No newline at end of file
index a5b73f4..7941720 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbfcf=['queue','Request','CreateCmHopperFinal','../client'];(function(_0x35c331,_0x311fe6){var _0x3028b9=function(_0x148090){while(--_0x148090){_0x35c331['push'](_0x35c331['shift']());}};_0x3028b9(++_0x311fe6);}(_0xbfcf,0x10f));var _0xfbfc=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xbfcf[_0x4a53d];return _0x27410e;};'use strict';var client=require(_0xfbfc('0x0'));exports['createContact']=function(_0x9e0a8b){return function(){_0x9e0a8b['campaign']=_0x9e0a8b[_0xfbfc('0x1')];return client[_0xfbfc('0x2')](_0xfbfc('0x3'),{'body':_0x9e0a8b,'log':'CreateCmHopperFinal'});};};
\ No newline at end of file
+var _0x8fdb=['createContact','campaign','queue','CreateCmHopperFinal','../client'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x8fdb,0x180));var _0xb8fd=function(_0x4fe19c,_0x45d0fe){_0x4fe19c=_0x4fe19c-0x0;var _0x952ac7=_0x8fdb[_0x4fe19c];return _0x952ac7;};'use strict';var client=require(_0xb8fd('0x0'));exports[_0xb8fd('0x1')]=function(_0x570415){return function(){_0x570415[_0xb8fd('0x2')]=_0x570415[_0xb8fd('0x3')];return client['Request']('CreateCmHopperFinal',{'body':_0x570415,'log':_0xb8fd('0x4')});};};
\ No newline at end of file
index 9661fd2..6478914 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf185=['minutes','format','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','GetVoiceQueueHopperHistory','startOf','day','endOf','getCampaignHopperHistory','GetCampaignHopperHistory','ivr','moment','createHistory','campaign','queue','CreateCmHopperHistory','avgHandleTime','Request','AvgHandleTime','subtract'];(function(_0x5525c1,_0x2c56c3){var _0x462602=function(_0x33c350){while(--_0x33c350){_0x5525c1['push'](_0x5525c1['shift']());}};_0x462602(++_0x2c56c3);}(_0xf185,0x173));var _0x5f18=function(_0x4712c5,_0x5d84d1){_0x4712c5=_0x4712c5-0x0;var _0xcad124=_0xf185[_0x4712c5];return _0xcad124;};'use strict';var client=require('../client');var moment=require(_0x5f18('0x0'));exports[_0x5f18('0x1')]=function(_0x18df00){return function(){_0x18df00[_0x5f18('0x2')]=_0x18df00[_0x5f18('0x3')];return client['Request']('CreateCmHopperHistory',{'body':_0x18df00,'log':_0x5f18('0x4')});};};exports[_0x5f18('0x5')]=function(_0x3ec21a){return function(){return client[_0x5f18('0x6')](_0x5f18('0x7'),{'options':{'where':{'endtime':{'$between':[moment()[_0x5f18('0x8')](_0x3ec21a,_0x5f18('0x9'))['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x5f18('0xa')](_0x5f18('0xb'))]}},'raw':![]},'log':_0x5f18('0xc')});};};exports['getVoiceQueueHopperHistory']=function(_0x25597b){return function(){return client[_0x5f18('0x6')](_0x5f18('0xd'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x5f18('0xe')](_0x5f18('0xf'))[_0x5f18('0xa')](_0x5f18('0xb')),moment()[_0x5f18('0x10')]('day')['format']('YYYY-MM-DD\x20HH:mm:ss')]},'campaigntype':'queue'},'raw':![]},'log':_0x5f18('0xd')});};};exports[_0x5f18('0x11')]=function(_0x203b24){return function(){return client[_0x5f18('0x6')](_0x5f18('0x12'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x5f18('0xe')](_0x5f18('0xf'))[_0x5f18('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x5f18('0x10')](_0x5f18('0xf'))[_0x5f18('0xa')](_0x5f18('0xb'))]},'campaigntype':_0x5f18('0x13')},'raw':![]},'log':_0x5f18('0x12')});};};
\ No newline at end of file
+var _0xb2d9=['startOf','ivr','../client','moment','queue','CreateCmHopperHistory','avgHandleTime','Request','AvgHandleTime','subtract','format','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','getVoiceQueueHopperHistory','day','GetVoiceQueueHopperHistory','getCampaignHopperHistory','GetCampaignHopperHistory'];(function(_0x37c8b3,_0x20cac4){var _0x263d27=function(_0x5c364a){while(--_0x5c364a){_0x37c8b3['push'](_0x37c8b3['shift']());}};_0x263d27(++_0x20cac4);}(_0xb2d9,0x17c));var _0x9b2d=function(_0x52fe89,_0x3e51bf){_0x52fe89=_0x52fe89-0x0;var _0x564ba2=_0xb2d9[_0x52fe89];return _0x564ba2;};'use strict';var client=require(_0x9b2d('0x0'));var moment=require(_0x9b2d('0x1'));exports['createHistory']=function(_0x383cdd){return function(){_0x383cdd['campaign']=_0x383cdd[_0x9b2d('0x2')];return client['Request'](_0x9b2d('0x3'),{'body':_0x383cdd,'log':_0x9b2d('0x3')});};};exports[_0x9b2d('0x4')]=function(_0x1c36cf){return function(){return client[_0x9b2d('0x5')](_0x9b2d('0x6'),{'options':{'where':{'endtime':{'$between':[moment()[_0x9b2d('0x7')](_0x1c36cf,'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x9b2d('0x8')](_0x9b2d('0x9'))]}},'raw':![]},'log':_0x9b2d('0xa')});};};exports[_0x9b2d('0xb')]=function(_0x1c111e){return function(){return client[_0x9b2d('0x5')]('GetVoiceQueueHopperHistory',{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0x9b2d('0xc'))['format'](_0x9b2d('0x9')),moment()['endOf'](_0x9b2d('0xc'))[_0x9b2d('0x8')](_0x9b2d('0x9'))]},'campaigntype':'queue'},'raw':![]},'log':_0x9b2d('0xd')});};};exports[_0x9b2d('0xe')]=function(_0x1fb3e7){return function(){return client[_0x9b2d('0x5')](_0x9b2d('0xf'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x9b2d('0x10')](_0x9b2d('0xc'))['format'](_0x9b2d('0x9')),moment()['endOf'](_0x9b2d('0xc'))[_0x9b2d('0x8')](_0x9b2d('0x9'))]},'campaigntype':_0x9b2d('0x11')},'raw':![]},'log':_0x9b2d('0xf')});};};
\ No newline at end of file
index 152b7b0..440367c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb3b=['name','headerinfo','minrate','modem','gateway','faxdetect','t38timeout','tech','TrunkId','key','Trunk','callerid','active','getFaxAccount','NotifyFaxAccount','../client','getFaxAccounts','Request','GetFaxAccount'];(function(_0x36dd86,_0x1125f1){var _0x2fc506=function(_0x444cfe){while(--_0x444cfe){_0x36dd86['push'](_0x36dd86['shift']());}};_0x2fc506(++_0x1125f1);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x12d812,_0x496bb7){_0x12d812=_0x12d812-0x0;var _0x3711ab=_0xeb3b[_0x12d812];return _0x3711ab;};'use strict';var client=require(_0xbeb3('0x0'));exports[_0xbeb3('0x1')]=function(){return function(){return client[_0xbeb3('0x2')](_0xbeb3('0x3'),{'options':{'raw':![],'attributes':['id',_0xbeb3('0x4'),'description','ecm',_0xbeb3('0x5'),'localstationid',_0xbeb3('0x6'),'maxrate',_0xbeb3('0x7'),_0xbeb3('0x8'),_0xbeb3('0x9'),_0xbeb3('0xa'),_0xbeb3('0xb'),_0xbeb3('0xc'),'ListId',_0xbeb3('0xd')],'include':[{'model':_0xbeb3('0xe'),'as':_0xbeb3('0xe'),'attributes':['id',_0xbeb3('0x4'),_0xbeb3('0xf'),_0xbeb3('0x10')]}]},'log':_0xbeb3('0x11')});};};exports['notify']=function(_0x2d1e06,_0x405a1c){return client['Request'](_0xbeb3('0x12'),{'account':{'id':_0x2d1e06},'body':_0x405a1c,'log':_0xbeb3('0x12')});};
\ No newline at end of file
+var _0xa5c1=['description','headerinfo','localstationid','minrate','maxrate','modem','gateway','t38timeout','TrunkId','ListId','key','Trunk','callerid','active','notify','NotifyFaxAccount','../client','getFaxAccounts','Request'];(function(_0x23fd09,_0x51c74c){var _0x5d8176=function(_0x178bc6){while(--_0x178bc6){_0x23fd09['push'](_0x23fd09['shift']());}};_0x5d8176(++_0x51c74c);}(_0xa5c1,0x19f));var _0x1a5c=function(_0x14cc31,_0x5bc2ca){_0x14cc31=_0x14cc31-0x0;var _0x313026=_0xa5c1[_0x14cc31];return _0x313026;};'use strict';var client=require(_0x1a5c('0x0'));exports[_0x1a5c('0x1')]=function(){return function(){return client[_0x1a5c('0x2')]('GetFaxAccount',{'options':{'raw':![],'attributes':['id','name',_0x1a5c('0x3'),'ecm',_0x1a5c('0x4'),_0x1a5c('0x5'),_0x1a5c('0x6'),_0x1a5c('0x7'),_0x1a5c('0x8'),_0x1a5c('0x9'),'faxdetect',_0x1a5c('0xa'),'tech',_0x1a5c('0xb'),_0x1a5c('0xc'),_0x1a5c('0xd')],'include':[{'model':'Trunk','as':_0x1a5c('0xe'),'attributes':['id','name',_0x1a5c('0xf'),_0x1a5c('0x10')]}]},'log':'getFaxAccount'});};};exports[_0x1a5c('0x11')]=function(_0x1ac373,_0x5b3de2){return client[_0x1a5c('0x2')](_0x1a5c('0x12'),{'account':{'id':_0x1ac373},'body':_0x5b3de2,'log':_0x1a5c('0x12')});};
\ No newline at end of file
index 2744237..6d979dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf344=['Request','UpdateFaxMessage','../client','update'];(function(_0x41ef5c,_0x45b1d8){var _0x2f23c4=function(_0x44d8a5){while(--_0x44d8a5){_0x41ef5c['push'](_0x41ef5c['shift']());}};_0x2f23c4(++_0x45b1d8);}(_0xf344,0x1a2));var _0x4f34=function(_0x1da881,_0x1d4240){_0x1da881=_0x1da881-0x0;var _0x138bde=_0xf344[_0x1da881];return _0x138bde;};'use strict';var client=require(_0x4f34('0x0'));exports[_0x4f34('0x1')]=function(_0x2cd252,_0x12c147){return client[_0x4f34('0x2')](_0x4f34('0x3'),{'body':_0x12c147,'options':{'where':{'AttachmentId':_0x2cd252}},'log':_0x4f34('0x3')});};
\ No newline at end of file
+var _0xeba2=['Request','UpdateFaxMessage'];(function(_0x462ee2,_0xfde2b7){var _0x43deaf=function(_0x5efe4f){while(--_0x5efe4f){_0x462ee2['push'](_0x462ee2['shift']());}};_0x43deaf(++_0xfde2b7);}(_0xeba2,0x11a));var _0x2eba=function(_0x1deb72,_0x3f6338){_0x1deb72=_0x1deb72-0x0;var _0x18bbdf=_0xeba2[_0x1deb72];return _0x18bbdf;};'use strict';var client=require('../client');exports['update']=function(_0x1bad5a,_0xc26bf7){return client[_0x2eba('0x0')](_0x2eba('0x1'),{'body':_0xc26bf7,'options':{'where':{'AttachmentId':_0x1bad5a}},'log':_0x2eba('0x1')});};
\ No newline at end of file
index 5a6b467..b7a745c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd8e=['customField','Tag','Tags','../../client','getDeskAccounts','Request','GetDeskAccount','name','description','password','remoteUri','authType','type','serverUrl','DeskConfiguration','Configurations','DeskField','Subjects','variableName','Variable','Descriptions','content','key','keyType','keyContent','Fields','idField','nameField'];(function(_0x457b64,_0x49a219){var _0x437111=function(_0x3dad3d){while(--_0x3dad3d){_0x457b64['push'](_0x457b64['shift']());}};_0x437111(++_0x49a219);}(_0xfd8e,0x73));var _0xefd8=function(_0x477c5e,_0x1e5056){_0x477c5e=_0x477c5e-0x0;var _0x4cc095=_0xfd8e[_0x477c5e];return _0x4cc095;};'use strict';var client=require(_0xefd8('0x0'));exports[_0xefd8('0x1')]=function(){return function(_0x250395){return client[_0xefd8('0x2')](_0xefd8('0x3'),{'options':{'raw':![],'attributes':['id',_0xefd8('0x4'),_0xefd8('0x5'),'username',_0xefd8('0x6'),_0xefd8('0x7'),_0xefd8('0x8'),_0xefd8('0x9'),_0xefd8('0xa')],'include':[{'model':_0xefd8('0xb'),'as':_0xefd8('0xc'),'attributes':['id',_0xefd8('0x4')],'include':[{'model':_0xefd8('0xd'),'as':_0xefd8('0xe'),'attributes':['id','type','content',_0xefd8('0xf')],'include':[{'model':'Variable','as':_0xefd8('0x10'),'attributes':['id',_0xefd8('0x4')]}]},{'model':_0xefd8('0xd'),'as':_0xefd8('0x11'),'attributes':['id',_0xefd8('0x9'),_0xefd8('0x12'),_0xefd8('0x13'),_0xefd8('0x14'),_0xefd8('0x15'),_0xefd8('0xf')],'include':[{'model':_0xefd8('0x10'),'as':_0xefd8('0x10'),'attributes':['id','name']}]},{'model':_0xefd8('0xd'),'as':_0xefd8('0x16'),'attributes':['id','type',_0xefd8('0x12'),_0xefd8('0x17'),_0xefd8('0x18'),_0xefd8('0x19'),_0xefd8('0xf')],'include':[{'model':_0xefd8('0x10'),'as':'Variable','attributes':['id','name']}]},{'model':_0xefd8('0x1a'),'as':_0xefd8('0x1b'),'attributes':['id',_0xefd8('0x4')]}]}]},'log':_0xefd8('0x3')});};};
\ No newline at end of file
+var _0xa5c4=['Variable','key','Fields','idField','nameField','customField','Tag','../../client','getDeskAccounts','GetDeskAccount','name','description','username','remoteUri','authType','type','DeskConfiguration','Configurations','DeskField','Subjects','content','variableName'];(function(_0x4e4061,_0x26503b){var _0x371dbd=function(_0x31a31f){while(--_0x31a31f){_0x4e4061['push'](_0x4e4061['shift']());}};_0x371dbd(++_0x26503b);}(_0xa5c4,0xb7));var _0x4a5c=function(_0x2de0a7,_0x38d3e7){_0x2de0a7=_0x2de0a7-0x0;var _0x429437=_0xa5c4[_0x2de0a7];return _0x429437;};'use strict';var client=require(_0x4a5c('0x0'));exports[_0x4a5c('0x1')]=function(){return function(_0x35a8bb){return client['Request'](_0x4a5c('0x2'),{'options':{'raw':![],'attributes':['id',_0x4a5c('0x3'),_0x4a5c('0x4'),_0x4a5c('0x5'),'password',_0x4a5c('0x6'),_0x4a5c('0x7'),_0x4a5c('0x8'),'serverUrl'],'include':[{'model':_0x4a5c('0x9'),'as':_0x4a5c('0xa'),'attributes':['id',_0x4a5c('0x3')],'include':[{'model':_0x4a5c('0xb'),'as':_0x4a5c('0xc'),'attributes':['id',_0x4a5c('0x8'),_0x4a5c('0xd'),_0x4a5c('0xe')],'include':[{'model':_0x4a5c('0xf'),'as':_0x4a5c('0xf'),'attributes':['id',_0x4a5c('0x3')]}]},{'model':_0x4a5c('0xb'),'as':'Descriptions','attributes':['id',_0x4a5c('0x8'),_0x4a5c('0xd'),_0x4a5c('0x10'),'keyType','keyContent',_0x4a5c('0xe')],'include':[{'model':_0x4a5c('0xf'),'as':_0x4a5c('0xf'),'attributes':['id',_0x4a5c('0x3')]}]},{'model':_0x4a5c('0xb'),'as':_0x4a5c('0x11'),'attributes':['id',_0x4a5c('0x8'),_0x4a5c('0xd'),_0x4a5c('0x12'),_0x4a5c('0x13'),_0x4a5c('0x14'),_0x4a5c('0xe')],'include':[{'model':_0x4a5c('0xf'),'as':_0x4a5c('0xf'),'attributes':['id','name']}]},{'model':_0x4a5c('0x15'),'as':'Tags','attributes':['id',_0x4a5c('0x3')]}]}]},'log':'GetDeskAccount'});};};
\ No newline at end of file
index 983a9f4..01ff32c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4eb=['keyType','Fields','nameField','customField','CloudProvider','data5','../../client','name','remoteUri','tenantId','clientId','clientSecret','serverUrl','description','modernAuthentication','Configurations','moduleCreate','Dynamics365Field','Subjects','type','content','variableName','Variable'];(function(_0x164077,_0x1225dc){var _0x32f908=function(_0x5e6b4a){while(--_0x5e6b4a){_0x164077['push'](_0x164077['shift']());}};_0x32f908(++_0x1225dc);}(_0xf4eb,0xec));var _0xbf4e=function(_0x5b7ebd,_0x29f9ac){_0x5b7ebd=_0x5b7ebd-0x0;var _0x350f1c=_0xf4eb[_0x5b7ebd];return _0x350f1c;};'use strict';var client=require(_0xbf4e('0x0'));exports['getDynamics365Accounts']=function(){return function(_0x50f2fc){return client['Request']('GetDynamics365Account',{'options':{'raw':![],'attributes':['id',_0xbf4e('0x1'),'username','password',_0xbf4e('0x2'),_0xbf4e('0x3'),_0xbf4e('0x4'),_0xbf4e('0x5'),_0xbf4e('0x6'),_0xbf4e('0x7'),_0xbf4e('0x8')],'include':[{'model':'Dynamics365Configuration','as':_0xbf4e('0x9'),'attributes':['id','name','ticketType',_0xbf4e('0xa')],'include':[{'model':_0xbf4e('0xb'),'as':_0xbf4e('0xc'),'attributes':['id',_0xbf4e('0xd'),_0xbf4e('0xe'),_0xbf4e('0xf')],'include':[{'model':_0xbf4e('0x10'),'as':'Variable','attributes':['id','name']}]},{'model':_0xbf4e('0xb'),'as':'Descriptions','attributes':['id',_0xbf4e('0xd'),_0xbf4e('0xe'),'key',_0xbf4e('0x11'),'keyContent','variableName'],'include':[{'model':_0xbf4e('0x10'),'as':_0xbf4e('0x10'),'attributes':['id',_0xbf4e('0x1')]}]},{'model':_0xbf4e('0xb'),'as':_0xbf4e('0x12'),'attributes':['id',_0xbf4e('0xd'),'content','idField',_0xbf4e('0x13'),_0xbf4e('0x14'),_0xbf4e('0xf')],'include':[{'model':'Variable','as':_0xbf4e('0x10'),'attributes':['id',_0xbf4e('0x1')]}]}]},{'model':_0xbf4e('0x15'),'as':_0xbf4e('0x15'),'attributes':['id','data2',_0xbf4e('0x16'),'data7']}]},'log':'GetDynamics365Account'});};};
\ No newline at end of file
+var _0x6f0d=['getDynamics365Accounts','Request','GetDynamics365Account','username','password','remoteUri','tenantId','clientId','serverUrl','modernAuthentication','Dynamics365Configuration','Configurations','name','Dynamics365Field','Subjects','type','content','variableName','Variable','Descriptions','key','keyType','keyContent','nameField','CloudProvider','data2','data5','data7'];(function(_0x1b7ab6,_0x4323b0){var _0x3d1e62=function(_0x4874c9){while(--_0x4874c9){_0x1b7ab6['push'](_0x1b7ab6['shift']());}};_0x3d1e62(++_0x4323b0);}(_0x6f0d,0x16c));var _0xd6f0=function(_0xebd138,_0x4650d5){_0xebd138=_0xebd138-0x0;var _0xc205af=_0x6f0d[_0xebd138];return _0xc205af;};'use strict';var client=require('../../client');exports[_0xd6f0('0x0')]=function(){return function(_0x64ebf2){return client[_0xd6f0('0x1')](_0xd6f0('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xd6f0('0x3'),_0xd6f0('0x4'),_0xd6f0('0x5'),_0xd6f0('0x6'),_0xd6f0('0x7'),'clientSecret',_0xd6f0('0x8'),'description',_0xd6f0('0x9')],'include':[{'model':_0xd6f0('0xa'),'as':_0xd6f0('0xb'),'attributes':['id',_0xd6f0('0xc'),'ticketType','moduleCreate'],'include':[{'model':_0xd6f0('0xd'),'as':_0xd6f0('0xe'),'attributes':['id',_0xd6f0('0xf'),_0xd6f0('0x10'),_0xd6f0('0x11')],'include':[{'model':'Variable','as':_0xd6f0('0x12'),'attributes':['id',_0xd6f0('0xc')]}]},{'model':_0xd6f0('0xd'),'as':_0xd6f0('0x13'),'attributes':['id','type',_0xd6f0('0x10'),_0xd6f0('0x14'),_0xd6f0('0x15'),_0xd6f0('0x16'),_0xd6f0('0x11')],'include':[{'model':_0xd6f0('0x12'),'as':_0xd6f0('0x12'),'attributes':['id',_0xd6f0('0xc')]}]},{'model':_0xd6f0('0xd'),'as':'Fields','attributes':['id',_0xd6f0('0xf'),_0xd6f0('0x10'),'idField',_0xd6f0('0x17'),'customField',_0xd6f0('0x11')],'include':[{'model':_0xd6f0('0x12'),'as':_0xd6f0('0x12'),'attributes':['id',_0xd6f0('0xc')]}]}]},{'model':_0xd6f0('0x18'),'as':_0xd6f0('0x18'),'attributes':['id',_0xd6f0('0x19'),_0xd6f0('0x1a'),_0xd6f0('0x1b')]}]},'log':_0xd6f0('0x2')});};};
\ No newline at end of file
index 329502c..c592557 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x05e3=['key','keyType','keyContent','variableName','Fields','idField','nameField','GetFreshdeskAccount','../../client','getFreshdeskAccounts','name','username','remoteUri','serverUrl','Configurations','Tag','FreshdeskField','Subjects','type','content','Variable'];(function(_0x4e1b45,_0x70ed5c){var _0x1f7988=function(_0x73680){while(--_0x73680){_0x4e1b45['push'](_0x4e1b45['shift']());}};_0x1f7988(++_0x70ed5c);}(_0x05e3,0x86));var _0x305e=function(_0x44e016,_0x2a4ac3){_0x44e016=_0x44e016-0x0;var _0x5bc0a0=_0x05e3[_0x44e016];return _0x5bc0a0;};'use strict';var client=require(_0x305e('0x0'));exports[_0x305e('0x1')]=function(){return function(_0x138210){return client['Request']('GetFreshdeskAccount',{'options':{'raw':![],'attributes':['id',_0x305e('0x2'),_0x305e('0x3'),'apiKey',_0x305e('0x4'),_0x305e('0x5')],'include':[{'model':'FreshdeskConfiguration','as':_0x305e('0x6'),'attributes':['id',_0x305e('0x2')],'include':[{'model':_0x305e('0x7'),'attributes':['id',_0x305e('0x2')]},{'model':_0x305e('0x8'),'as':_0x305e('0x9'),'attributes':['id',_0x305e('0xa'),_0x305e('0xb'),'variableName'],'include':[{'model':_0x305e('0xc'),'as':'Variable','attributes':['id',_0x305e('0x2')]}]},{'model':_0x305e('0x8'),'as':'Descriptions','attributes':['id',_0x305e('0xa'),_0x305e('0xb'),_0x305e('0xd'),_0x305e('0xe'),_0x305e('0xf'),_0x305e('0x10')],'include':[{'model':_0x305e('0xc'),'as':_0x305e('0xc'),'attributes':['id',_0x305e('0x2')]}]},{'model':_0x305e('0x8'),'as':_0x305e('0x11'),'attributes':['id',_0x305e('0xa'),'content',_0x305e('0x12'),_0x305e('0x13'),'customField',_0x305e('0x10')],'include':[{'model':_0x305e('0xc'),'as':_0x305e('0xc'),'attributes':['id',_0x305e('0x2')]}]}]}]},'log':_0x305e('0x14')});};};
\ No newline at end of file
+var _0xee4f=['Fields','idField','customField','../../client','Request','GetFreshdeskAccount','name','apiKey','serverUrl','FreshdeskField','Subjects','type','Variable','content','key','keyContent','variableName'];(function(_0x3a6922,_0xc728be){var _0x9c1b44=function(_0x4ffb5e){while(--_0x4ffb5e){_0x3a6922['push'](_0x3a6922['shift']());}};_0x9c1b44(++_0xc728be);}(_0xee4f,0xad));var _0xfee4=function(_0x2bc09e,_0x1ae747){_0x2bc09e=_0x2bc09e-0x0;var _0x3f7c75=_0xee4f[_0x2bc09e];return _0x3f7c75;};'use strict';var client=require(_0xfee4('0x0'));exports['getFreshdeskAccounts']=function(){return function(_0x56a471){return client[_0xfee4('0x1')](_0xfee4('0x2'),{'options':{'raw':![],'attributes':['id',_0xfee4('0x3'),'username',_0xfee4('0x4'),'remoteUri',_0xfee4('0x5')],'include':[{'model':'FreshdeskConfiguration','as':'Configurations','attributes':['id',_0xfee4('0x3')],'include':[{'model':'Tag','attributes':['id','name']},{'model':_0xfee4('0x6'),'as':_0xfee4('0x7'),'attributes':['id',_0xfee4('0x8'),'content','variableName'],'include':[{'model':_0xfee4('0x9'),'as':_0xfee4('0x9'),'attributes':['id',_0xfee4('0x3')]}]},{'model':'FreshdeskField','as':'Descriptions','attributes':['id',_0xfee4('0x8'),_0xfee4('0xa'),_0xfee4('0xb'),'keyType',_0xfee4('0xc'),_0xfee4('0xd')],'include':[{'model':_0xfee4('0x9'),'as':_0xfee4('0x9'),'attributes':['id',_0xfee4('0x3')]}]},{'model':_0xfee4('0x6'),'as':_0xfee4('0xe'),'attributes':['id','type',_0xfee4('0xa'),_0xfee4('0xf'),'nameField',_0xfee4('0x10'),_0xfee4('0xd')],'include':[{'model':_0xfee4('0x9'),'as':_0xfee4('0x9'),'attributes':['id',_0xfee4('0x3')]}]}]}]},'log':_0xfee4('0x2')});};};
\ No newline at end of file
index 2e9e92e..da57f51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa6b0=['remoteUri','serverUrl','FreshsalesConfiguration','Configurations','FreshsalesField','Subjects','type','content','variableName','Variable','Descriptions','key','keyType','keyContent','GetFreshsalesccount','../../client','getFreshsalesAccounts','GetFreshsalesAccount','name','username'];(function(_0x40f13b,_0x21cbde){var _0x2b54de=function(_0x31495f){while(--_0x31495f){_0x40f13b['push'](_0x40f13b['shift']());}};_0x2b54de(++_0x21cbde);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x34349f,_0x3456a7){_0x34349f=_0x34349f-0x0;var _0xa2563a=_0xa6b0[_0x34349f];return _0xa2563a;};'use strict';var client=require(_0x0a6b('0x0'));exports[_0x0a6b('0x1')]=function(){return function(_0x4950db){return client['Request'](_0x0a6b('0x2'),{'options':{'raw':![],'attributes':['id',_0x0a6b('0x3'),_0x0a6b('0x4'),'apiKey',_0x0a6b('0x5'),_0x0a6b('0x6')],'include':[{'model':_0x0a6b('0x7'),'as':_0x0a6b('0x8'),'attributes':['id',_0x0a6b('0x3')],'include':[{'model':_0x0a6b('0x9'),'as':_0x0a6b('0xa'),'attributes':['id',_0x0a6b('0xb'),_0x0a6b('0xc'),_0x0a6b('0xd')],'include':[{'model':_0x0a6b('0xe'),'as':_0x0a6b('0xe'),'attributes':['id','name']}]},{'model':'FreshsalesField','as':_0x0a6b('0xf'),'attributes':['id',_0x0a6b('0xb'),_0x0a6b('0xc'),_0x0a6b('0x10'),_0x0a6b('0x11'),_0x0a6b('0x12'),_0x0a6b('0xd')],'include':[{'model':_0x0a6b('0xe'),'as':_0x0a6b('0xe'),'attributes':['id',_0x0a6b('0x3')]}]}]}]},'log':_0x0a6b('0x13')});};};
\ No newline at end of file
+var _0xce68=['GetFreshsalesAccount','name','username','remoteUri','serverUrl','FreshsalesConfiguration','FreshsalesField','content','variableName','Variable','Descriptions','type','key','keyType','keyContent','GetFreshsalesccount','../../client','Request'];(function(_0x1f0148,_0xa2f53f){var _0x92e19f=function(_0x392a5c){while(--_0x392a5c){_0x1f0148['push'](_0x1f0148['shift']());}};_0x92e19f(++_0xa2f53f);}(_0xce68,0x10c));var _0x8ce6=function(_0x171548,_0x8410ed){_0x171548=_0x171548-0x0;var _0xc8c82=_0xce68[_0x171548];return _0xc8c82;};'use strict';var client=require(_0x8ce6('0x0'));exports['getFreshsalesAccounts']=function(){return function(_0x30b0c9){return client[_0x8ce6('0x1')](_0x8ce6('0x2'),{'options':{'raw':![],'attributes':['id',_0x8ce6('0x3'),_0x8ce6('0x4'),'apiKey',_0x8ce6('0x5'),_0x8ce6('0x6')],'include':[{'model':_0x8ce6('0x7'),'as':'Configurations','attributes':['id',_0x8ce6('0x3')],'include':[{'model':_0x8ce6('0x8'),'as':'Subjects','attributes':['id','type',_0x8ce6('0x9'),_0x8ce6('0xa')],'include':[{'model':_0x8ce6('0xb'),'as':_0x8ce6('0xb'),'attributes':['id','name']}]},{'model':_0x8ce6('0x8'),'as':_0x8ce6('0xc'),'attributes':['id',_0x8ce6('0xd'),_0x8ce6('0x9'),_0x8ce6('0xe'),_0x8ce6('0xf'),_0x8ce6('0x10'),_0x8ce6('0xa')],'include':[{'model':_0x8ce6('0xb'),'as':_0x8ce6('0xb'),'attributes':['id',_0x8ce6('0x3')]}]}]}]},'log':_0x8ce6('0x11')});};};
\ No newline at end of file
index 032d3bb..3173b28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ed7=['clientId','clientSecret','securityToken','serverUrl','type','SalesforceConfiguration','name','moduleCreate','leadId','additionalSearchLead','SalesforceField','Variable','Fields','getSalesforceAccounts','Request','username','password','remoteUri'];(function(_0x1ed195,_0x23bb1f){var _0x4a6265=function(_0x29e747){while(--_0x29e747){_0x1ed195['push'](_0x1ed195['shift']());}};_0x4a6265(++_0x23bb1f);}(_0x8ed7,0x8b));var _0x78ed=function(_0x4bcbd3,_0x30f380){_0x4bcbd3=_0x4bcbd3-0x0;var _0x4058d6=_0x8ed7[_0x4bcbd3];return _0x4058d6;};'use strict';var client=require('../../client');exports[_0x78ed('0x0')]=function(){return function(_0x3f927a){return client[_0x78ed('0x1')]('GetSalesforceAccount',{'options':{'raw':![],'attributes':['id','name',_0x78ed('0x2'),_0x78ed('0x3'),_0x78ed('0x4'),_0x78ed('0x5'),_0x78ed('0x6'),_0x78ed('0x7'),_0x78ed('0x8'),_0x78ed('0x9')],'include':[{'model':_0x78ed('0xa'),'as':'Configurations','attributes':['id',_0x78ed('0xb'),'moduleSearch',_0x78ed('0xc'),'ticketType',_0x78ed('0xd'),'additionalSearchAccount','additionalSearchContact',_0x78ed('0xe')],'include':[{'model':_0x78ed('0xf'),'as':'Subjects','include':[{'model':_0x78ed('0x10'),'as':_0x78ed('0x10'),'attributes':['id','name']}]},{'model':_0x78ed('0xf'),'as':'Descriptions','include':[{'model':_0x78ed('0x10'),'as':_0x78ed('0x10'),'attributes':['id',_0x78ed('0xb')]}]},{'model':_0x78ed('0xf'),'as':_0x78ed('0x11'),'include':[{'model':_0x78ed('0x10'),'as':'Variable','attributes':['id',_0x78ed('0xb')]}]}]}]},'log':'GetSalesforceAccount'});};};
\ No newline at end of file
+var _0x4502=['Subjects','Variable','Descriptions','name','Fields','GetSalesforceAccount','../../client','getSalesforceAccounts','username','password','clientId','clientSecret','securityToken','serverUrl','type','Configurations','moduleSearch','moduleCreate','ticketType','leadId','additionalSearchAccount','SalesforceField'];(function(_0x3162d2,_0x5608e1){var _0x228fbf=function(_0x3942b8){while(--_0x3942b8){_0x3162d2['push'](_0x3162d2['shift']());}};_0x228fbf(++_0x5608e1);}(_0x4502,0xa0));var _0x2450=function(_0x48b71b,_0x1d5f69){_0x48b71b=_0x48b71b-0x0;var _0x24176a=_0x4502[_0x48b71b];return _0x24176a;};'use strict';var client=require(_0x2450('0x0'));exports[_0x2450('0x1')]=function(){return function(_0x42076b){return client['Request']('GetSalesforceAccount',{'options':{'raw':![],'attributes':['id','name',_0x2450('0x2'),_0x2450('0x3'),'remoteUri',_0x2450('0x4'),_0x2450('0x5'),_0x2450('0x6'),_0x2450('0x7'),_0x2450('0x8')],'include':[{'model':'SalesforceConfiguration','as':_0x2450('0x9'),'attributes':['id','name',_0x2450('0xa'),_0x2450('0xb'),_0x2450('0xc'),_0x2450('0xd'),_0x2450('0xe'),'additionalSearchContact','additionalSearchLead'],'include':[{'model':_0x2450('0xf'),'as':_0x2450('0x10'),'include':[{'model':_0x2450('0x11'),'as':_0x2450('0x11'),'attributes':['id','name']}]},{'model':_0x2450('0xf'),'as':_0x2450('0x12'),'include':[{'model':_0x2450('0x11'),'as':_0x2450('0x11'),'attributes':['id',_0x2450('0x13')]}]},{'model':_0x2450('0xf'),'as':_0x2450('0x14'),'include':[{'model':'Variable','as':_0x2450('0x11'),'attributes':['id',_0x2450('0x13')]}]}]}]},'log':_0x2450('0x15')});};};
\ No newline at end of file
index b1a11a9..9bcb287 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['keyContent','Fields','nameField','customField','GetServicenowkAccount','getServicenowAccounts','Request','GetServicenowAccount','name','username','password','email','serverUrl','ServicenowConfiguration','Configurations','ServicenowField','Subjects','type','content','variableName','Variable','Descriptions','key','keyType'];(function(_0x17e8d7,_0x1fbadd){var _0xe3a1ab=function(_0x125c69){while(--_0x125c69){_0x17e8d7['push'](_0x17e8d7['shift']());}};_0xe3a1ab(++_0x1fbadd);}(_0xadb5,0xad));var _0x5adb=function(_0x55de6b,_0x2d3a42){_0x55de6b=_0x55de6b-0x0;var _0x38ec31=_0xadb5[_0x55de6b];return _0x38ec31;};'use strict';var client=require('../../client');exports[_0x5adb('0x0')]=function(){return function(_0x49fc17){return client[_0x5adb('0x1')](_0x5adb('0x2'),{'options':{'raw':![],'attributes':['id',_0x5adb('0x3'),'description',_0x5adb('0x4'),_0x5adb('0x5'),_0x5adb('0x6'),'remoteUri',_0x5adb('0x7')],'include':[{'model':_0x5adb('0x8'),'as':_0x5adb('0x9'),'attributes':['id',_0x5adb('0x3')],'include':[{'model':_0x5adb('0xa'),'as':_0x5adb('0xb'),'attributes':['id',_0x5adb('0xc'),_0x5adb('0xd'),_0x5adb('0xe')],'include':[{'model':_0x5adb('0xf'),'as':_0x5adb('0xf'),'attributes':['id',_0x5adb('0x3')]}]},{'model':_0x5adb('0xa'),'as':_0x5adb('0x10'),'attributes':['id','type','content',_0x5adb('0x11'),_0x5adb('0x12'),_0x5adb('0x13'),'variableName'],'include':[{'model':_0x5adb('0xf'),'as':'Variable','attributes':['id',_0x5adb('0x3')]}]},{'model':'ServicenowField','as':_0x5adb('0x14'),'attributes':['id',_0x5adb('0xc'),_0x5adb('0xd'),'idField',_0x5adb('0x15'),_0x5adb('0x16'),_0x5adb('0xe')],'include':[{'model':'Variable','as':_0x5adb('0xf'),'attributes':['id','name']}]}]}]},'log':_0x5adb('0x17')});};};
\ No newline at end of file
+var _0xc4aa=['keyContent','Fields','content','idField','nameField','customField','GetServicenowkAccount','../../client','getServicenowAccounts','Request','GetServicenowAccount','name','email','remoteUri','serverUrl','ServicenowConfiguration','Configurations','ServicenowField','Subjects','variableName','Variable','Descriptions','type','key'];(function(_0x33a41c,_0x2c3513){var _0x257733=function(_0x5d853f){while(--_0x5d853f){_0x33a41c['push'](_0x33a41c['shift']());}};_0x257733(++_0x2c3513);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xc4aa[_0x4b055c];return _0x4b62bb;};'use strict';var client=require(_0xac4a('0x0'));exports[_0xac4a('0x1')]=function(){return function(_0x40a0d0){return client[_0xac4a('0x2')](_0xac4a('0x3'),{'options':{'raw':![],'attributes':['id',_0xac4a('0x4'),'description','username','password',_0xac4a('0x5'),_0xac4a('0x6'),_0xac4a('0x7')],'include':[{'model':_0xac4a('0x8'),'as':_0xac4a('0x9'),'attributes':['id',_0xac4a('0x4')],'include':[{'model':_0xac4a('0xa'),'as':_0xac4a('0xb'),'attributes':['id','type','content',_0xac4a('0xc')],'include':[{'model':_0xac4a('0xd'),'as':_0xac4a('0xd'),'attributes':['id','name']}]},{'model':_0xac4a('0xa'),'as':_0xac4a('0xe'),'attributes':['id',_0xac4a('0xf'),'content',_0xac4a('0x10'),'keyType',_0xac4a('0x11'),'variableName'],'include':[{'model':_0xac4a('0xd'),'as':_0xac4a('0xd'),'attributes':['id',_0xac4a('0x4')]}]},{'model':'ServicenowField','as':_0xac4a('0x12'),'attributes':['id',_0xac4a('0xf'),_0xac4a('0x13'),_0xac4a('0x14'),_0xac4a('0x15'),_0xac4a('0x16'),_0xac4a('0xc')],'include':[{'model':_0xac4a('0xd'),'as':_0xac4a('0xd'),'attributes':['id',_0xac4a('0x4')]}]}]}]},'log':_0xac4a('0x17')});};};
\ No newline at end of file
index 38a2ab2..c72f8c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['username','password','SugarcrmConfiguration','Configurations','SugarcrmField','Subjects','type','variableName','Variable','Descriptions','key','Fields','content','idField','customField','../../client','getSugarcrmAccounts','Request','GetSugarcrmAccount','name'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5f2f,0x73));var _0xf5f2=function(_0x7b6352,_0x548a1f){_0x7b6352=_0x7b6352-0x0;var _0x2bec47=_0x5f2f[_0x7b6352];return _0x2bec47;};'use strict';var client=require(_0xf5f2('0x0'));exports[_0xf5f2('0x1')]=function(){return function(_0x2dcf60){return client[_0xf5f2('0x2')](_0xf5f2('0x3'),{'options':{'raw':![],'attributes':['id',_0xf5f2('0x4'),_0xf5f2('0x5'),_0xf5f2('0x6'),'remoteUri','serverUrl'],'include':[{'model':_0xf5f2('0x7'),'as':_0xf5f2('0x8'),'attributes':['id',_0xf5f2('0x4')],'include':[{'model':_0xf5f2('0x9'),'as':_0xf5f2('0xa'),'attributes':['id',_0xf5f2('0xb'),'content',_0xf5f2('0xc')],'include':[{'model':_0xf5f2('0xd'),'as':_0xf5f2('0xd'),'attributes':['id','name']}]},{'model':_0xf5f2('0x9'),'as':_0xf5f2('0xe'),'attributes':['id',_0xf5f2('0xb'),'content',_0xf5f2('0xf'),'keyType','keyContent',_0xf5f2('0xc')],'include':[{'model':_0xf5f2('0xd'),'as':'Variable','attributes':['id',_0xf5f2('0x4')]}]},{'model':_0xf5f2('0x9'),'as':_0xf5f2('0x10'),'attributes':['id',_0xf5f2('0xb'),_0xf5f2('0x11'),_0xf5f2('0x12'),'nameField',_0xf5f2('0x13'),_0xf5f2('0xc')],'include':[{'model':_0xf5f2('0xd'),'as':_0xf5f2('0xd'),'attributes':['id',_0xf5f2('0x4')]}]}]}]},'log':'GetSugarcrmAccount'});};};
\ No newline at end of file
+var _0xdb28=['customField','GetSugarcrmAccount','../../client','getSugarcrmAccounts','Request','name','username','password','remoteUri','serverUrl','Configurations','type','content','variableName','Variable','SugarcrmField','key','keyContent','Fields','nameField'];(function(_0x128450,_0x5869ba){var _0x4d80ed=function(_0x4a2da3){while(--_0x4a2da3){_0x128450['push'](_0x128450['shift']());}};_0x4d80ed(++_0x5869ba);}(_0xdb28,0x106));var _0x8db2=function(_0x39e7f4,_0x17f269){_0x39e7f4=_0x39e7f4-0x0;var _0x25ee8c=_0xdb28[_0x39e7f4];return _0x25ee8c;};'use strict';var client=require(_0x8db2('0x0'));exports[_0x8db2('0x1')]=function(){return function(_0x1dc797){return client[_0x8db2('0x2')]('GetSugarcrmAccount',{'options':{'raw':![],'attributes':['id',_0x8db2('0x3'),_0x8db2('0x4'),_0x8db2('0x5'),_0x8db2('0x6'),_0x8db2('0x7')],'include':[{'model':'SugarcrmConfiguration','as':_0x8db2('0x8'),'attributes':['id',_0x8db2('0x3')],'include':[{'model':'SugarcrmField','as':'Subjects','attributes':['id',_0x8db2('0x9'),_0x8db2('0xa'),_0x8db2('0xb')],'include':[{'model':_0x8db2('0xc'),'as':_0x8db2('0xc'),'attributes':['id',_0x8db2('0x3')]}]},{'model':_0x8db2('0xd'),'as':'Descriptions','attributes':['id',_0x8db2('0x9'),_0x8db2('0xa'),_0x8db2('0xe'),'keyType',_0x8db2('0xf'),_0x8db2('0xb')],'include':[{'model':'Variable','as':_0x8db2('0xc'),'attributes':['id',_0x8db2('0x3')]}]},{'model':_0x8db2('0xd'),'as':_0x8db2('0x10'),'attributes':['id',_0x8db2('0x9'),'content','idField',_0x8db2('0x11'),_0x8db2('0x12'),_0x8db2('0xb')],'include':[{'model':_0x8db2('0xc'),'as':_0x8db2('0xc'),'attributes':['id',_0x8db2('0x3')]}]}]}]},'log':_0x8db2('0x13')});};};
\ No newline at end of file
index bc62bdd..0c303ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c94=['content','key','keyType','variableName','VtigerField','Fields','idField','../../client','getVtigerAccounts','Request','name','description','username','accessKey','remoteUri','serverUrl','VtigerConfiguration','Configurations','Subjects','type','Variable','Descriptions'];(function(_0x395b2c,_0x160dc8){var _0x1d94e2=function(_0x559259){while(--_0x559259){_0x395b2c['push'](_0x395b2c['shift']());}};_0x1d94e2(++_0x160dc8);}(_0x5c94,0x151));var _0x45c9=function(_0x5e6790,_0x2c166f){_0x5e6790=_0x5e6790-0x0;var _0x57bdb0=_0x5c94[_0x5e6790];return _0x57bdb0;};'use strict';var client=require(_0x45c9('0x0'));exports[_0x45c9('0x1')]=function(){return function(_0x101437){return client[_0x45c9('0x2')]('GetVtigerAccount',{'options':{'raw':![],'attributes':['id',_0x45c9('0x3'),_0x45c9('0x4'),_0x45c9('0x5'),_0x45c9('0x6'),_0x45c9('0x7'),_0x45c9('0x8')],'include':[{'model':_0x45c9('0x9'),'as':_0x45c9('0xa'),'attributes':['id',_0x45c9('0x3')],'include':[{'model':'VtigerField','as':_0x45c9('0xb'),'attributes':['id',_0x45c9('0xc'),'content','variableName'],'include':[{'model':_0x45c9('0xd'),'as':_0x45c9('0xd'),'attributes':['id',_0x45c9('0x3')]}]},{'model':'VtigerField','as':_0x45c9('0xe'),'attributes':['id',_0x45c9('0xc'),_0x45c9('0xf'),_0x45c9('0x10'),_0x45c9('0x11'),'keyContent',_0x45c9('0x12')],'include':[{'model':'Variable','as':_0x45c9('0xd'),'attributes':['id','name']}]},{'model':_0x45c9('0x13'),'as':_0x45c9('0x14'),'attributes':['id',_0x45c9('0xc'),_0x45c9('0xf'),_0x45c9('0x15'),'nameField','customField','variableName'],'include':[{'model':_0x45c9('0xd'),'as':_0x45c9('0xd'),'attributes':['id',_0x45c9('0x3')]}]}]}]},'log':'GetVtigerAccount'});};};
\ No newline at end of file
+var _0x3f73=['customField','GetVtigerAccount','../../client','getVtigerAccounts','Request','name','description','accessKey','remoteUri','serverUrl','VtigerConfiguration','Configurations','VtigerField','Subjects','type','content','variableName','Variable','keyType','idField'];(function(_0x5bf128,_0xf1e750){var _0x507f49=function(_0xdd6d7e){while(--_0xdd6d7e){_0x5bf128['push'](_0x5bf128['shift']());}};_0x507f49(++_0xf1e750);}(_0x3f73,0x1e2));var _0x33f7=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x3f73[_0xa464c9];return _0x3d73c4;};'use strict';var client=require(_0x33f7('0x0'));exports[_0x33f7('0x1')]=function(){return function(_0x77745f){return client[_0x33f7('0x2')]('GetVtigerAccount',{'options':{'raw':![],'attributes':['id',_0x33f7('0x3'),_0x33f7('0x4'),'username',_0x33f7('0x5'),_0x33f7('0x6'),_0x33f7('0x7')],'include':[{'model':_0x33f7('0x8'),'as':_0x33f7('0x9'),'attributes':['id',_0x33f7('0x3')],'include':[{'model':_0x33f7('0xa'),'as':_0x33f7('0xb'),'attributes':['id',_0x33f7('0xc'),_0x33f7('0xd'),_0x33f7('0xe')],'include':[{'model':_0x33f7('0xf'),'as':'Variable','attributes':['id',_0x33f7('0x3')]}]},{'model':_0x33f7('0xa'),'as':'Descriptions','attributes':['id',_0x33f7('0xc'),'content','key',_0x33f7('0x10'),'keyContent',_0x33f7('0xe')],'include':[{'model':'Variable','as':'Variable','attributes':['id','name']}]},{'model':_0x33f7('0xa'),'as':'Fields','attributes':['id',_0x33f7('0xc'),_0x33f7('0xd'),_0x33f7('0x11'),'nameField',_0x33f7('0x12'),_0x33f7('0xe')],'include':[{'model':'Variable','as':_0x33f7('0xf'),'attributes':['id','name']}]}]}]},'log':_0x33f7('0x13')});};};
\ No newline at end of file
index 2273da4..c9f2930 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x918b=['keyContent','Fields','idField','nameField','customField','../../client','Request','GetZendeskAccount','name','username','password','token','remoteUri','type','Tag','ZendeskField','content','variableName','Variable'];(function(_0x4adff1,_0x4a8cbe){var _0x318759=function(_0x32faef){while(--_0x32faef){_0x4adff1['push'](_0x4adff1['shift']());}};_0x318759(++_0x4a8cbe);}(_0x918b,0x1cd));var _0xb918=function(_0x222688,_0x46c5eb){_0x222688=_0x222688-0x0;var _0x437433=_0x918b[_0x222688];return _0x437433;};'use strict';var client=require(_0xb918('0x0'));exports['getZendeskAccounts']=function(){return function(_0x3bd77a){return client[_0xb918('0x1')](_0xb918('0x2'),{'options':{'raw':![],'attributes':['id',_0xb918('0x3'),_0xb918('0x4'),_0xb918('0x5'),_0xb918('0x6'),_0xb918('0x7'),'authType','serverUrl',_0xb918('0x8')],'include':[{'model':'ZendeskConfiguration','as':'Configurations','attributes':['id',_0xb918('0x3')],'include':[{'model':_0xb918('0x9'),'attributes':['id',_0xb918('0x3')]},{'model':_0xb918('0xa'),'as':'Subjects','attributes':['id',_0xb918('0x8'),_0xb918('0xb'),_0xb918('0xc')],'include':[{'model':_0xb918('0xd'),'as':'Variable','attributes':['id',_0xb918('0x3')]}]},{'model':'ZendeskField','as':'Descriptions','attributes':['id','type',_0xb918('0xb'),'key','keyType',_0xb918('0xe'),_0xb918('0xc')],'include':[{'model':_0xb918('0xd'),'as':'Variable','attributes':['id',_0xb918('0x3')]}]},{'model':_0xb918('0xa'),'as':_0xb918('0xf'),'attributes':['id',_0xb918('0x8'),_0xb918('0xb'),_0xb918('0x10'),_0xb918('0x11'),_0xb918('0x12'),_0xb918('0xc')],'include':[{'model':_0xb918('0xd'),'as':_0xb918('0xd'),'attributes':['id',_0xb918('0x3')]}]}]}]},'log':_0xb918('0x2')});};};
\ No newline at end of file
+var _0x6d62=['Subjects','content','Variable','Descriptions','type','keyContent','Fields','idField','nameField','variableName','../../client','getZendeskAccounts','Request','GetZendeskAccount','name','username','password','token','remoteUri','serverUrl','ZendeskConfiguration','Configurations','Tag','ZendeskField'];(function(_0x4807f9,_0x37af38){var _0x5a662a=function(_0x454547){while(--_0x454547){_0x4807f9['push'](_0x4807f9['shift']());}};_0x5a662a(++_0x37af38);}(_0x6d62,0x1ba));var _0x26d6=function(_0x1692fb,_0x192cf0){_0x1692fb=_0x1692fb-0x0;var _0x2381e2=_0x6d62[_0x1692fb];return _0x2381e2;};'use strict';var client=require(_0x26d6('0x0'));exports[_0x26d6('0x1')]=function(){return function(_0xd70f44){return client[_0x26d6('0x2')](_0x26d6('0x3'),{'options':{'raw':![],'attributes':['id',_0x26d6('0x4'),_0x26d6('0x5'),_0x26d6('0x6'),_0x26d6('0x7'),_0x26d6('0x8'),'authType',_0x26d6('0x9'),'type'],'include':[{'model':_0x26d6('0xa'),'as':_0x26d6('0xb'),'attributes':['id',_0x26d6('0x4')],'include':[{'model':_0x26d6('0xc'),'attributes':['id','name']},{'model':_0x26d6('0xd'),'as':_0x26d6('0xe'),'attributes':['id','type',_0x26d6('0xf'),'variableName'],'include':[{'model':'Variable','as':_0x26d6('0x10'),'attributes':['id',_0x26d6('0x4')]}]},{'model':'ZendeskField','as':_0x26d6('0x11'),'attributes':['id',_0x26d6('0x12'),_0x26d6('0xf'),'key','keyType',_0x26d6('0x13'),'variableName'],'include':[{'model':_0x26d6('0x10'),'as':'Variable','attributes':['id','name']}]},{'model':'ZendeskField','as':_0x26d6('0x14'),'attributes':['id','type',_0x26d6('0xf'),_0x26d6('0x15'),_0x26d6('0x16'),'customField',_0x26d6('0x17')],'include':[{'model':_0x26d6('0x10'),'as':_0x26d6('0x10'),'attributes':['id',_0x26d6('0x4')]}]}]}]},'log':_0x26d6('0x3')});};};
\ No newline at end of file
index 4177673..ec95ac0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e80=['code','ZohoConfiguration','moduleCreate','moduleSearch','ZohoField','Subjects','type','content','variableName','Variable','Descriptions','Fields','idField','nameField','customField','getZohoAccounts','Request','GetZohoAccount','name','clientId','clientSecret','serverUrl'];(function(_0x1e2e90,_0xbd98a8){var _0xd3986b=function(_0x482bde){while(--_0x482bde){_0x1e2e90['push'](_0x1e2e90['shift']());}};_0xd3986b(++_0xbd98a8);}(_0x1e80,0xd5));var _0x01e8=function(_0x271102,_0x3d6ffc){_0x271102=_0x271102-0x0;var _0x4e841c=_0x1e80[_0x271102];return _0x4e841c;};'use strict';var client=require('../../client');exports[_0x01e8('0x0')]=function(){return function(_0x18f5b6){return client[_0x01e8('0x1')](_0x01e8('0x2'),{'options':{'raw':![],'attributes':['id',_0x01e8('0x3'),'description','host','zone',_0x01e8('0x4'),_0x01e8('0x5'),_0x01e8('0x6'),_0x01e8('0x7'),'refreshToken'],'include':[{'model':_0x01e8('0x8'),'as':'Configurations','attributes':['id',_0x01e8('0x3'),_0x01e8('0x9'),_0x01e8('0xa'),'description'],'include':[{'model':_0x01e8('0xb'),'as':_0x01e8('0xc'),'attributes':['id',_0x01e8('0xd'),_0x01e8('0xe'),_0x01e8('0xf')],'include':[{'model':_0x01e8('0x10'),'as':'Variable','attributes':['id',_0x01e8('0x3')]}]},{'model':_0x01e8('0xb'),'as':_0x01e8('0x11'),'attributes':['id',_0x01e8('0xd'),_0x01e8('0xe'),'key','keyType','keyContent',_0x01e8('0xf')],'include':[{'model':_0x01e8('0x10'),'as':_0x01e8('0x10'),'attributes':['id',_0x01e8('0x3')]}]},{'model':_0x01e8('0xb'),'as':_0x01e8('0x12'),'attributes':['id',_0x01e8('0xd'),_0x01e8('0xe'),_0x01e8('0x13'),_0x01e8('0x14'),_0x01e8('0x15'),'variableName'],'include':[{'model':_0x01e8('0x10'),'as':'Variable','attributes':['id',_0x01e8('0x3')]}]}]}]},'log':'GetZohoAccount'});};};
\ No newline at end of file
+var _0x9d16=['ZohoConfiguration','Configurations','moduleSearch','ZohoField','Subjects','type','content','Variable','Descriptions','keyContent','variableName','Fields','idField','nameField','customField','../../client','getZohoAccounts','GetZohoAccount','name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken'];(function(_0x38bc3a,_0x2e30ab){var _0x1c726e=function(_0x13bfa6){while(--_0x13bfa6){_0x38bc3a['push'](_0x38bc3a['shift']());}};_0x1c726e(++_0x2e30ab);}(_0x9d16,0x16e));var _0x69d1=function(_0x351b46,_0x26b265){_0x351b46=_0x351b46-0x0;var _0x1515df=_0x9d16[_0x351b46];return _0x1515df;};'use strict';var client=require(_0x69d1('0x0'));exports[_0x69d1('0x1')]=function(){return function(_0x484aa6){return client['Request'](_0x69d1('0x2'),{'options':{'raw':![],'attributes':['id',_0x69d1('0x3'),_0x69d1('0x4'),_0x69d1('0x5'),_0x69d1('0x6'),_0x69d1('0x7'),_0x69d1('0x8'),_0x69d1('0x9'),_0x69d1('0xa'),_0x69d1('0xb')],'include':[{'model':_0x69d1('0xc'),'as':_0x69d1('0xd'),'attributes':['id','name','moduleCreate',_0x69d1('0xe'),_0x69d1('0x4')],'include':[{'model':_0x69d1('0xf'),'as':_0x69d1('0x10'),'attributes':['id',_0x69d1('0x11'),_0x69d1('0x12'),'variableName'],'include':[{'model':_0x69d1('0x13'),'as':'Variable','attributes':['id',_0x69d1('0x3')]}]},{'model':_0x69d1('0xf'),'as':_0x69d1('0x14'),'attributes':['id','type',_0x69d1('0x12'),'key','keyType',_0x69d1('0x15'),_0x69d1('0x16')],'include':[{'model':'Variable','as':_0x69d1('0x13'),'attributes':['id',_0x69d1('0x3')]}]},{'model':_0x69d1('0xf'),'as':_0x69d1('0x17'),'attributes':['id',_0x69d1('0x11'),_0x69d1('0x12'),_0x69d1('0x18'),_0x69d1('0x19'),_0x69d1('0x1a'),_0x69d1('0x16')],'include':[{'model':'Variable','as':_0x69d1('0x13'),'attributes':['id',_0x69d1('0x3')]}]}]}]},'log':'GetZohoAccount'});};};
\ No newline at end of file
index 2554139..022b8a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3fa9=['voice','membername','starttime','endtime','dialstring','uniqueid','moment','lodash','../client','voiceQueueReport','queuecallerexitAt','Request','CreateMemberReport','lastAssignedTo','interface','format','SIP/%s','TALKING','queuecallerleaveAt','diff','seconds','inbound','calleridnum','exten','queue','agent','toNumber','accountcode','voiceDialReport'];(function(_0x44b0af,_0xdb6975){var _0xafaa74=function(_0xf734d3){while(--_0xf734d3){_0x44b0af['push'](_0x44b0af['shift']());}};_0xafaa74(++_0xdb6975);}(_0x3fa9,0x19c));var _0x93fa=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x3fa9[_0x411add];return _0x238242;};'use strict';var moment=require(_0x93fa('0x0'));var _=require(_0x93fa('0x1'));var util=require('util');var client=require(_0x93fa('0x2'));exports[_0x93fa('0x3')]=function(_0x48b550){var _0x20ce69=_0x48b550['queuecallercompleteAt']||_0x48b550[_0x93fa('0x4')];return client[_0x93fa('0x5')](_0x93fa('0x6'),{'body':{'channel':'voice','membername':_0x48b550[_0x93fa('0x7')],'interface':_['isNil'](_0x48b550[_0x93fa('0x8')])?util[_0x93fa('0x9')](_0x93fa('0xa'),_0x48b550[_0x93fa('0x7')]):_0x48b550[_0x93fa('0x8')],'type':_0x93fa('0xb'),'enterAt':_0x48b550[_0x93fa('0xc')],'exitAt':_0x20ce69,'duration':moment(_0x20ce69)[_0x93fa('0xd')](_0x48b550[_0x93fa('0xc')],_0x93fa('0xe')),'data1':_0x93fa('0xf'),'data2':_0x48b550[_0x93fa('0x10')],'data3':_0x48b550[_0x93fa('0x11')],'data4':null,'data5':_0x48b550[_0x93fa('0x12')],'role':_0x93fa('0x13'),'internal':_0x48b550['accountcode']?_[_0x93fa('0x14')](_0x48b550[_0x93fa('0x15')]):undefined,'uniqueid':_0x48b550['uniqueid']},'log':'CreateMemberReport'});};exports[_0x93fa('0x16')]=function(_0x298646){return client[_0x93fa('0x5')](_0x93fa('0x6'),{'body':{'channel':_0x93fa('0x17'),'membername':_0x298646[_0x93fa('0x18')],'interface':_0x298646[_0x93fa('0x8')],'type':'TALKING','enterAt':_0x298646[_0x93fa('0x19')],'exitAt':_0x298646['endtime'],'duration':moment(_0x298646[_0x93fa('0x1a')])[_0x93fa('0xd')](_0x298646['starttime'],_0x93fa('0xe'))>=0x0?moment(_0x298646[_0x93fa('0x1a')])[_0x93fa('0xd')](_0x298646[_0x93fa('0x19')],_0x93fa('0xe')):null,'data1':'outbound','data2':_0x298646[_0x93fa('0x15')],'data3':_0x298646[_0x93fa('0x11')],'data4':_0x298646[_0x93fa('0x1b')]||null,'role':'agent','internal':_0x298646[_0x93fa('0x15')]?_['toNumber'](_0x298646[_0x93fa('0x15')]):undefined,'uniqueid':_0x298646[_0x93fa('0x1c')]},'log':_0x93fa('0x6')});};
\ No newline at end of file
+var _0xcada=['exten','queue','toNumber','accountcode','uniqueid','voiceDialReport','membername','interface','endtime','starttime','outbound','dialstring','agent','moment','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','SIP/%s','TALKING','diff','queuecallerleaveAt','seconds','inbound'];(function(_0x4d9cb8,_0x1ccbc9){var _0xf6b5e0=function(_0x47adc0){while(--_0x47adc0){_0x4d9cb8['push'](_0x4d9cb8['shift']());}};_0xf6b5e0(++_0x1ccbc9);}(_0xcada,0x139));var _0xacad=function(_0x5875d2,_0xc5e93b){_0x5875d2=_0x5875d2-0x0;var _0x316c3c=_0xcada[_0x5875d2];return _0x316c3c;};'use strict';var moment=require(_0xacad('0x0'));var _=require('lodash');var util=require(_0xacad('0x1'));var client=require(_0xacad('0x2'));exports[_0xacad('0x3')]=function(_0x17cf17){var _0x3dcf44=_0x17cf17[_0xacad('0x4')]||_0x17cf17[_0xacad('0x5')];return client[_0xacad('0x6')](_0xacad('0x7'),{'body':{'channel':_0xacad('0x8'),'membername':_0x17cf17[_0xacad('0x9')],'interface':_[_0xacad('0xa')](_0x17cf17['interface'])?util['format'](_0xacad('0xb'),_0x17cf17['lastAssignedTo']):_0x17cf17['interface'],'type':_0xacad('0xc'),'enterAt':_0x17cf17['queuecallerleaveAt'],'exitAt':_0x3dcf44,'duration':moment(_0x3dcf44)[_0xacad('0xd')](_0x17cf17[_0xacad('0xe')],_0xacad('0xf')),'data1':_0xacad('0x10'),'data2':_0x17cf17['calleridnum'],'data3':_0x17cf17[_0xacad('0x11')],'data4':null,'data5':_0x17cf17[_0xacad('0x12')],'role':'agent','internal':_0x17cf17['accountcode']?_[_0xacad('0x13')](_0x17cf17[_0xacad('0x14')]):undefined,'uniqueid':_0x17cf17[_0xacad('0x15')]},'log':_0xacad('0x7')});};exports[_0xacad('0x16')]=function(_0x6b01ac){return client['Request'](_0xacad('0x7'),{'body':{'channel':_0xacad('0x8'),'membername':_0x6b01ac[_0xacad('0x17')],'interface':_0x6b01ac[_0xacad('0x18')],'type':_0xacad('0xc'),'enterAt':_0x6b01ac['starttime'],'exitAt':_0x6b01ac[_0xacad('0x19')],'duration':moment(_0x6b01ac[_0xacad('0x19')])[_0xacad('0xd')](_0x6b01ac[_0xacad('0x1a')],_0xacad('0xf'))>=0x0?moment(_0x6b01ac[_0xacad('0x19')])[_0xacad('0xd')](_0x6b01ac[_0xacad('0x1a')],'seconds'):null,'data1':_0xacad('0x1b'),'data2':_0x6b01ac[_0xacad('0x14')],'data3':_0x6b01ac[_0xacad('0x11')],'data4':_0x6b01ac[_0xacad('0x1c')]||null,'role':_0xacad('0x1d'),'internal':_0x6b01ac[_0xacad('0x14')]?_[_0xacad('0x13')](_0x6b01ac[_0xacad('0x14')]):undefined,'uniqueid':_0x6b01ac['uniqueid']},'log':_0xacad('0x7')});};
\ No newline at end of file
index d8c1383..af7f758 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x578c=['previewRecallmeReminderInterval','GetSettings','../client','getSettings','Request','stopRecordingOnTransfer'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x578c,0x158));var _0xc578=function(_0x4090ef,_0x57a439){_0x4090ef=_0x4090ef-0x0;var _0x584d06=_0x578c[_0x4090ef];return _0x584d06;};'use strict';var client=require(_0xc578('0x0'));exports[_0xc578('0x1')]=function(){return client[_0xc578('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xc578('0x3'),_0xc578('0x4')]},'log':_0xc578('0x5')});};
\ No newline at end of file
+var _0x439f=['Request','ShowSetting','GetSettings','../client'];(function(_0x342f42,_0x1f56ec){var _0x2f9169=function(_0xdc5857){while(--_0xdc5857){_0x342f42['push'](_0x342f42['shift']());}};_0x2f9169(++_0x1f56ec);}(_0x439f,0x1c3));var _0xf439=function(_0xe65ac8,_0x2691be){_0xe65ac8=_0xe65ac8-0x0;var _0x202ba1=_0x439f[_0xe65ac8];return _0x202ba1;};'use strict';var client=require(_0xf439('0x0'));exports['getSettings']=function(){return client[_0xf439('0x1')](_0xf439('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer','previewRecallmeReminderInterval']},'log':_0xf439('0x3')});};
\ No newline at end of file
index 9b70416..84d2de4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0825=['getTemplates','Request','GetTemplate','html','../client'];(function(_0x2e21a4,_0x3e2b87){var _0x1dc20b=function(_0x120602){while(--_0x120602){_0x2e21a4['push'](_0x2e21a4['shift']());}};_0x1dc20b(++_0x3e2b87);}(_0x0825,0x1e4));var _0x5082=function(_0x2a33ca,_0x3d9c2a){_0x2a33ca=_0x2a33ca-0x0;var _0x5a4955=_0x0825[_0x2a33ca];return _0x5a4955;};'use strict';var client=require(_0x5082('0x0'));exports[_0x5082('0x1')]=function(_0x5889f4){return function(_0x4ef3a0){return client[_0x5082('0x2')](_0x5082('0x3'),{'options':{'raw':!![],'attributes':['id','name',_0x5082('0x4')]},'log':_0x5082('0x3')});};};
\ No newline at end of file
+var _0xbf30=['Request','GetTemplate','html','getTemplates'];(function(_0x37893f,_0x6e4d08){var _0x48658c=function(_0x23e1f5){while(--_0x23e1f5){_0x37893f['push'](_0x37893f['shift']());}};_0x48658c(++_0x6e4d08);}(_0xbf30,0x133));var _0x0bf3=function(_0x45f778,_0x188705){_0x45f778=_0x45f778-0x0;var _0x2888a2=_0xbf30[_0x45f778];return _0x2888a2;};'use strict';var client=require('../client');exports[_0x0bf3('0x0')]=function(_0x1cfb65){return function(_0x5100a7){return client[_0x0bf3('0x1')](_0x0bf3('0x2'),{'options':{'raw':!![],'attributes':['id','name',_0x0bf3('0x3')]},'log':'GetTemplate'});};};
\ No newline at end of file
index 2cb874e..93040e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9342=['field','operator','Condition','value','Action','Actions','action','data3','data5','data6','data7','../client','getTriggers','GetTrigger','name','channel','status','AllConditions'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x9342,0x1a9));var _0x2934=function(_0x4b6e57,_0x3aff01){_0x4b6e57=_0x4b6e57-0x0;var _0x1084ed=_0x9342[_0x4b6e57];return _0x1084ed;};'use strict';var client=require(_0x2934('0x0'));exports[_0x2934('0x1')]=function(_0x2a1173){return function(_0x41c52e){return client['Request'](_0x2934('0x2'),{'options':{'raw':![],'attributes':['id',_0x2934('0x3'),_0x2934('0x4'),_0x2934('0x5')],'include':[{'model':'Condition','as':_0x2934('0x6'),'attributes':['id',_0x2934('0x7'),_0x2934('0x8'),'value']},{'model':_0x2934('0x9'),'as':'AnyConditions','attributes':['id',_0x2934('0x7'),_0x2934('0x8'),_0x2934('0xa')]},{'model':_0x2934('0xb'),'as':_0x2934('0xc'),'attributes':['id',_0x2934('0xd'),'data1','data2',_0x2934('0xe'),'data4',_0x2934('0xf'),_0x2934('0x10'),_0x2934('0x11')]}]},'log':'GetTrigger'});};};
\ No newline at end of file
+var _0xc993=['value','Action','Actions','action','data1','data2','data4','data5','data6','data7','getTriggers','Request','GetTrigger','channel','status','Condition','AllConditions','operator','AnyConditions'];(function(_0x283fec,_0x401393){var _0x3663e9=function(_0x1d80af){while(--_0x1d80af){_0x283fec['push'](_0x283fec['shift']());}};_0x3663e9(++_0x401393);}(_0xc993,0x1ac));var _0x3c99=function(_0x569a76,_0x4691e9){_0x569a76=_0x569a76-0x0;var _0x1022db=_0xc993[_0x569a76];return _0x1022db;};'use strict';var client=require('../client');exports[_0x3c99('0x0')]=function(_0x3d1d58){return function(_0x54869f){return client[_0x3c99('0x1')](_0x3c99('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x3c99('0x3'),_0x3c99('0x4')],'include':[{'model':_0x3c99('0x5'),'as':_0x3c99('0x6'),'attributes':['id','field',_0x3c99('0x7'),'value']},{'model':'Condition','as':_0x3c99('0x8'),'attributes':['id','field',_0x3c99('0x7'),_0x3c99('0x9')]},{'model':_0x3c99('0xa'),'as':_0x3c99('0xb'),'attributes':['id',_0x3c99('0xc'),_0x3c99('0xd'),_0x3c99('0xe'),'data3',_0x3c99('0xf'),_0x3c99('0x10'),_0x3c99('0x11'),_0x3c99('0x12')]}]},'log':'GetTrigger'});};};
\ No newline at end of file
index 0c8a434..30a0668 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b04=['GetTrunk','name','registry','defaultuser','../client','getTrunks'];(function(_0x4a8834,_0x598d41){var _0x4406fc=function(_0x32453e){while(--_0x32453e){_0x4a8834['push'](_0x4a8834['shift']());}};_0x4406fc(++_0x598d41);}(_0x8b04,0x130));var _0x48b0=function(_0xad42b0,_0x347bc7){_0xad42b0=_0xad42b0-0x0;var _0x2beca5=_0x8b04[_0xad42b0];return _0x2beca5;};'use strict';var client=require(_0x48b0('0x0'));exports[_0x48b0('0x1')]=function(_0x53315f){return function(_0x74bd18){return client['Request'](_0x48b0('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x48b0('0x3'),_0x48b0('0x4'),_0x48b0('0x5')]},'log':_0x48b0('0x2')});};};
\ No newline at end of file
+var _0x7fd4=['getTrunks','Request','GetTrunk','name','registry','defaultuser','../client'];(function(_0x4cc235,_0x26c7fc){var _0x2369ae=function(_0x56fbf1){while(--_0x56fbf1){_0x4cc235['push'](_0x4cc235['shift']());}};_0x2369ae(++_0x26c7fc);}(_0x7fd4,0x117));var _0x47fd=function(_0x453e2b,_0x4f1258){_0x453e2b=_0x453e2b-0x0;var _0x50f306=_0x7fd4[_0x453e2b];return _0x50f306;};'use strict';var client=require(_0x47fd('0x0'));exports[_0x47fd('0x1')]=function(_0x4a4278){return function(_0x849953){return client[_0x47fd('0x2')](_0x47fd('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x47fd('0x4'),_0x47fd('0x5'),_0x47fd('0x6')]},'log':'GetTrunk'});};};
\ No newline at end of file
index 73714f6..2a6ccfa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});};
\ No newline at end of file
+var _0xcb91=['UnpauseUser','getAgent','ShowUser','email','lastPauseAt','Request','GetUser','agent','name','accountcode','fullname','lastLoginAt','pauseType','voicePause','phone','interface','getAgents','internal','getTelephones','savePause','PauseUser'];(function(_0x39a5a2,_0x562e86){var _0x45c19f=function(_0x4aea1a){while(--_0x4aea1a){_0x39a5a2['push'](_0x39a5a2['shift']());}};_0x45c19f(++_0x562e86);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x485b5a,_0x2b289b){_0x485b5a=_0x485b5a-0x0;var _0xd2b34d=_0xcb91[_0x485b5a];return _0xd2b34d;};'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 2645409..483a277 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58e2=['UpdateVoiceAgentReport','Request','CreateVoiceAgentReport','update'];(function(_0x4bd882,_0x350341){var _0x2f0513=function(_0x1da504){while(--_0x1da504){_0x4bd882['push'](_0x4bd882['shift']());}};_0x2f0513(++_0x350341);}(_0x58e2,0x91));var _0x258e=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0x58e2[_0x172747];return _0x509692;};'use strict';var client=require('../client');exports['create']=function(_0x1603aa){return client[_0x258e('0x0')](_0x258e('0x1'),{'body':_0x1603aa,'log':_0x258e('0x1')});};exports[_0x258e('0x2')]=function(_0xc9228b,_0x5a07e3,_0x109dbd){return client[_0x258e('0x0')](_0x258e('0x3'),{'body':_0xc9228b,'options':{'where':{'uniqueid':_0x5a07e3,'interface':_0x109dbd,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});};
\ No newline at end of file
+var _0x5718=['Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x5718,0x162));var _0x8571=function(_0x1e655b,_0xbaecbc){_0x1e655b=_0x1e655b-0x0;var _0x2ae698=_0x5718[_0x1e655b];return _0x2ae698;};'use strict';var client=require(_0x8571('0x0'));exports['create']=function(_0x32963a){return client[_0x8571('0x1')](_0x8571('0x2'),{'body':_0x32963a,'log':_0x8571('0x2')});};exports[_0x8571('0x3')]=function(_0x1bfcc6,_0x4a4751,_0x1d0f86){return client[_0x8571('0x1')](_0x8571('0x4'),{'body':_0x1bfcc6,'options':{'where':{'uniqueid':_0x4a4751,'interface':_0x1d0f86,'agentcomplete':!![]}},'log':_0x8571('0x4')});};
\ No newline at end of file
index cf07fb2..d21d5d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e55=['Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','format','YYYY-MM-DD\x20HH:mm:ss','endOf','day','type','disposition','duration','billableseconds','moment','util','lodash','../client','create'];(function(_0x247b2c,_0x52354c){var _0x14986e=function(_0xe60b3d){while(--_0xe60b3d){_0x247b2c['push'](_0x247b2c['shift']());}};_0x14986e(++_0x52354c);}(_0x9e55,0x199));var _0x59e5=function(_0x5287e5,_0x139cfb){_0x5287e5=_0x5287e5-0x0;var _0x52c9b3=_0x9e55[_0x5287e5];return _0x52c9b3;};'use strict';var moment=require(_0x59e5('0x0'));var util=require(_0x59e5('0x1'));var _=require(_0x59e5('0x2'));var client=require(_0x59e5('0x3'));exports[_0x59e5('0x4')]=function(_0x5d20d1){return client[_0x59e5('0x5')](_0x59e5('0x6'),{'body':_[_0x59e5('0x7')](_0x5d20d1,{'source':_0x5d20d1[_0x59e5('0x8')],'destinationcontext':_0x5d20d1[_0x59e5('0x9')],'callerid':_0x5d20d1[_0x59e5('0xa')],'amaflags':_0x59e5('0xb')}),'log':'CreateVoiceCallReport'});};exports[_0x59e5('0xc')]=function(){return function(){return client['Request'](_0x59e5('0xd'),{'options':{'where':{'type':[_0x59e5('0xe')],'createdAt':{'$between':[moment()['startOf']('day')[_0x59e5('0xf')](_0x59e5('0x10')),moment()[_0x59e5('0x11')](_0x59e5('0x12'))[_0x59e5('0xf')](_0x59e5('0x10'))]}},'attributes':[_0x59e5('0x13'),_0x59e5('0x14'),_0x59e5('0x15'),_0x59e5('0x16')]},'log':'GetVoiceCallReports'});};};
\ No newline at end of file
+var _0x5a02=['endOf','format','type','disposition','duration','GetVoiceCallReports','util','lodash','create','Request','merge','calleridnum','context','DOCUMENTATION','CreateVoiceCallReport','getVoiceCallReports','GetVoiceCallReport','startOf','day','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x38299a,_0x2205f8){var _0x17b5fb=function(_0x5f5d1d){while(--_0x5f5d1d){_0x38299a['push'](_0x38299a['shift']());}};_0x17b5fb(++_0x2205f8);}(_0x5a02,0x1e6));var _0x25a0=function(_0x3f465d,_0xbd2037){_0x3f465d=_0x3f465d-0x0;var _0x121ad1=_0x5a02[_0x3f465d];return _0x121ad1;};'use strict';var moment=require('moment');var util=require(_0x25a0('0x0'));var _=require(_0x25a0('0x1'));var client=require('../client');exports[_0x25a0('0x2')]=function(_0xbcea62){return client[_0x25a0('0x3')]('CreateVoiceCallReport',{'body':_[_0x25a0('0x4')](_0xbcea62,{'source':_0xbcea62[_0x25a0('0x5')],'destinationcontext':_0xbcea62[_0x25a0('0x6')],'callerid':_0xbcea62['callerid'],'amaflags':_0x25a0('0x7')}),'log':_0x25a0('0x8')});};exports[_0x25a0('0x9')]=function(){return function(){return client['Request'](_0x25a0('0xa'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x25a0('0xb')](_0x25a0('0xc'))['format'](_0x25a0('0xd')),moment()[_0x25a0('0xe')](_0x25a0('0xc'))[_0x25a0('0xf')](_0x25a0('0xd'))]}},'attributes':[_0x25a0('0x10'),_0x25a0('0x11'),_0x25a0('0x12'),'billableseconds']},'log':_0x25a0('0x13')});};};
\ No newline at end of file
index 8b35f4d..bc15700 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x37ab=['Request','CreateVoiceDialReport','create'];(function(_0x15ad29,_0x2e6251){var _0x3d3a4e=function(_0x410c6e){while(--_0x410c6e){_0x15ad29['push'](_0x15ad29['shift']());}};_0x3d3a4e(++_0x2e6251);}(_0x37ab,0x95));var _0xb37a=function(_0x298152,_0x2bab07){_0x298152=_0x298152-0x0;var _0x58117d=_0x37ab[_0x298152];return _0x58117d;};'use strict';var client=require('../client');exports[_0xb37a('0x0')]=function(_0x182391){return client[_0xb37a('0x1')]('CreateVoiceDialReport',{'body':_0x182391,'log':_0xb37a('0x2')});};
\ No newline at end of file
+var _0xef2e=['../client','Request','CreateVoiceDialReport'];(function(_0x2a5b3b,_0x4ebe31){var _0xae665a=function(_0x59e86a){while(--_0x59e86a){_0x2a5b3b['push'](_0x2a5b3b['shift']());}};_0xae665a(++_0x4ebe31);}(_0xef2e,0xd5));var _0xeef2=function(_0x5a4a1f,_0x3f90b6){_0x5a4a1f=_0x5a4a1f-0x0;var _0x43db26=_0xef2e[_0x5a4a1f];return _0x43db26;};'use strict';var client=require(_0xeef2('0x0'));exports['create']=function(_0x36433a){return client[_0xeef2('0x1')](_0xeef2('0x2'),{'body':_0x36433a,'log':'CreateVoiceDialReport'});};
\ No newline at end of file
index 1febb05..6802e57 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa45c=['exten','../client','getVoiceExtensions'];(function(_0x1aa9f5,_0x3c88af){var _0x4eb045=function(_0x27fe5f){while(--_0x27fe5f){_0x1aa9f5['push'](_0x1aa9f5['shift']());}};_0x4eb045(++_0x3c88af);}(_0xa45c,0x6d));var _0xca45=function(_0x1d6454,_0x530d9d){_0x1d6454=_0x1d6454-0x0;var _0x2ae8e0=_0xa45c[_0x1d6454];return _0x2ae8e0;};'use strict';var client=require(_0xca45('0x0'));exports[_0xca45('0x1')]=function(){return function(){return client['Request']('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0xca45('0x2'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xca45('0x1')});};};
\ No newline at end of file
+var _0xadcc=['GetVoiceExtension','exten','recordingFormat','getVoiceExtensions','../client','Request'];(function(_0x483d2a,_0x4bffba){var _0x5ba5d5=function(_0x33e56a){while(--_0x33e56a){_0x483d2a['push'](_0x483d2a['shift']());}};_0x5ba5d5(++_0x4bffba);}(_0xadcc,0x76));var _0xcadc=function(_0x517ab1,_0x2f6799){_0x517ab1=_0x517ab1-0x0;var _0x58f952=_0xadcc[_0x517ab1];return _0x58f952;};'use strict';var client=require(_0xcadc('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0xcadc('0x1')](_0xcadc('0x2'),{'options':{'raw':!![],'attributes':['id',_0xcadc('0x3'),_0xcadc('0x4')],'where':{'VoiceExtensionId':null}},'log':_0xcadc('0x5')});};};
\ No newline at end of file
index 9464a3c..b381954 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7701=['dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialCutDigit','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPreviewAutoRecallMe','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','GetVoiceQueue','name','acw','acwTimeout','autopause','type','dialActive','dialMethod','dialLimitChannel'];(function(_0x327b68,_0x42a652){var _0x55431f=function(_0x4f79ec){while(--_0x4f79ec){_0x327b68['push'](_0x327b68['shift']());}};_0x55431f(++_0x42a652);}(_0x7701,0x1dd));var _0x1770=function(_0x188a50,_0x593551){_0x188a50=_0x188a50-0x0;var _0x10942c=_0x7701[_0x188a50];return _0x10942c;};'use strict';var client=require(_0x1770('0x0'));exports[_0x1770('0x1')]=function(){return function(){return client['Request'](_0x1770('0x2'),{'options':{'raw':![],'attributes':['id',_0x1770('0x3'),_0x1770('0x4'),_0x1770('0x5'),_0x1770('0x6'),'monitor_format',_0x1770('0x7'),_0x1770('0x8'),_0x1770('0x9'),_0x1770('0xa'),_0x1770('0xb'),'dialPowerLevel',_0x1770('0xc'),_0x1770('0xd'),_0x1770('0xe'),'dialOriginateCallerIdName',_0x1770('0xf'),_0x1770('0x10'),_0x1770('0x11'),_0x1770('0x12'),'dialQueueProject',_0x1770('0x13'),'dialCongestionRetryFrequency',_0x1770('0x14'),_0x1770('0x15'),_0x1770('0x16'),'dialNoAnswerRetryFrequency',_0x1770('0x17'),'dialTimezone',_0x1770('0x18'),_0x1770('0x19'),'dialCheckDuplicateType',_0x1770('0x1a'),'dialAMDInitialSilence',_0x1770('0x1b'),_0x1770('0x1c'),_0x1770('0x1d'),_0x1770('0x1e'),_0x1770('0x1f'),_0x1770('0x20'),_0x1770('0x21'),'dialAMDMaximumWordLength',_0x1770('0x22'),_0x1770('0x23'),_0x1770('0x24'),'dialOrderByScheduledAt',_0x1770('0x25'),_0x1770('0x26'),_0x1770('0x27'),_0x1770('0x28'),_0x1770('0x29'),'dialRandomLastDigitCallerIdNumber',_0x1770('0x2a'),_0x1770('0x2b'),'dialNoSuchNumberRetryFrequency',_0x1770('0x2c'),_0x1770('0x2d'),_0x1770('0x2e'),_0x1770('0x2f'),_0x1770('0x30'),_0x1770('0x31'),'dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition',_0x1770('0x32'),'dialPredictiveIntervalMinThreshold',_0x1770('0x33'),'dialPreviewRecallmeReminder'],'include':[{'model':_0x1770('0x34'),'as':'Trunk','attributes':['id',_0x1770('0x3'),_0x1770('0x35'),_0x1770('0x36')]},{'model':_0x1770('0x37'),'as':_0x1770('0x38'),'attributes':['id','name']},{'model':_0x1770('0x34'),'as':_0x1770('0x39'),'attributes':['id',_0x1770('0x3'),_0x1770('0x35'),'active']},{'model':_0x1770('0x3a'),'as':_0x1770('0x3a'),'attributes':['id',_0x1770('0x3')],'include':[{'model':_0x1770('0x3a'),'as':_0x1770('0x3b'),'attributes':['id',_0x1770('0x3'),_0x1770('0x3c')]}]}]},'log':'getVoiceQueues'});};};
\ No newline at end of file
+var _0x574d=['Interval','Intervals','interval','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','Pause','mandatoryDispositionPause','TrunkBackup','active'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x574d,0x148));var _0xd574=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x574d[_0x3d42d8];return _0x27fc41;};'use strict';var client=require('../client');exports[_0xd574('0x0')]=function(){return function(){return client[_0xd574('0x1')](_0xd574('0x2'),{'options':{'raw':![],'attributes':['id',_0xd574('0x3'),_0xd574('0x4'),_0xd574('0x5'),_0xd574('0x6'),'monitor_format','type',_0xd574('0x7'),_0xd574('0x8'),_0xd574('0x9'),'dialLimitQueue',_0xd574('0xa'),_0xd574('0xb'),_0xd574('0xc'),_0xd574('0xd'),_0xd574('0xe'),_0xd574('0xf'),'dialOriginateTimeout',_0xd574('0x10'),'dialQueueTimeout',_0xd574('0x11'),_0xd574('0x12'),_0xd574('0x13'),_0xd574('0x14'),_0xd574('0x15'),'dialNoAnswerMaxRetry',_0xd574('0x16'),_0xd574('0x17'),_0xd574('0x18'),_0xd574('0x19'),_0xd574('0x1a'),_0xd574('0x1b'),'dialAMDActive',_0xd574('0x1c'),_0xd574('0x1d'),_0xd574('0x1e'),_0xd574('0x1f'),_0xd574('0x20'),'dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords',_0xd574('0x21'),_0xd574('0x22'),_0xd574('0x23'),_0xd574('0x24'),'dialRecallInQueue',_0xd574('0x25'),_0xd574('0x26'),_0xd574('0x27'),_0xd574('0x28'),_0xd574('0x29'),_0xd574('0x2a'),_0xd574('0x2b'),_0xd574('0x2c'),'dialNoSuchNumberMaxRetry',_0xd574('0x2d'),_0xd574('0x2e'),_0xd574('0x2f'),_0xd574('0x30'),_0xd574('0x31'),_0xd574('0x32'),'dialMachineRetryFrequency',_0xd574('0x33'),'dialAgentRejectRetryFrequency',_0xd574('0x34'),'dialPredictiveIntervalMaxThreshold',_0xd574('0x35'),_0xd574('0x36'),_0xd574('0x37')],'include':[{'model':_0xd574('0x38'),'as':'Trunk','attributes':['id',_0xd574('0x3'),_0xd574('0x39'),'active']},{'model':_0xd574('0x3a'),'as':_0xd574('0x3b'),'attributes':['id',_0xd574('0x3')]},{'model':_0xd574('0x38'),'as':_0xd574('0x3c'),'attributes':['id',_0xd574('0x3'),_0xd574('0x39'),_0xd574('0x3d')]},{'model':_0xd574('0x3e'),'as':_0xd574('0x3e'),'attributes':['id',_0xd574('0x3')],'include':[{'model':'Interval','as':_0xd574('0x3f'),'attributes':['id',_0xd574('0x3'),_0xd574('0x40')]}]}]},'log':_0xd574('0x0')});};};
\ No newline at end of file
index 4f8b71f..d558621 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(_0x4e2d99,_0x32ea42){var _0x306954=function(_0x530b3a){while(--_0x530b3a){_0x4e2d99['push'](_0x4e2d99['shift']());}};_0x306954(++_0x32ea42);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'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(_0x2df075,_0x5db861){var _0x84e29a=function(_0x148602){while(--_0x148602){_0x2df075['push'](_0x2df075['shift']());}};_0x84e29a(++_0x5db861);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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 9bdece3..1e92546 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8de4=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x39bf66,_0x35c96c){var _0x431030=function(_0x4328ac){while(--_0x4328ac){_0x39bf66['push'](_0x39bf66['shift']());}};_0x431030(++_0x35c96c);}(_0x8de4,0x66));var _0x48de=function(_0x546e48,_0x21d8fa){_0x546e48=_0x546e48-0x0;var _0x401dd8=_0x8de4[_0x546e48];return _0x401dd8;};'use strict';var client=require('../client');exports[_0x48de('0x0')]=function(_0x5cbd32){return function(){return client[_0x48de('0x1')](_0x48de('0x2'),{'options':{'where':{'VoiceQueueId':_0x5cbd32,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};};
\ No newline at end of file
+var _0x9ddc=['Request','GetVoiceQueueRtPauses','../client'];(function(_0x2084a2,_0x5c6a5a){var _0x1b05b8=function(_0x307ee3){while(--_0x307ee3){_0x2084a2['push'](_0x2084a2['shift']());}};_0x1b05b8(++_0x5c6a5a);}(_0x9ddc,0x152));var _0xc9dd=function(_0x4e97cc,_0x1a4ad1){_0x4e97cc=_0x4e97cc-0x0;var _0x32db8d=_0x9ddc[_0x4e97cc];return _0x32db8d;};'use strict';var client=require(_0xc9dd('0x0'));exports['getVoiceQueueRtPauses']=function(_0x54195e){return function(){return client[_0xc9dd('0x1')](_0xc9dd('0x2'),{'options':{'where':{'VoiceQueueId':_0x54195e,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};};
\ No newline at end of file
index 1acb3f8..dd885d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x56c3b3,_0x1caad8){var _0x7f0d21=function(_0x2dacb8){while(--_0x2dacb8){_0x56c3b3['push'](_0x56c3b3['shift']());}};_0x7f0d21(++_0x1caad8);}(_0x7a54,0x106));var _0x47a5=function(_0x2f1402,_0x2f9a4a){_0x2f1402=_0x2f1402-0x0;var _0x4a47c3=_0x7a54[_0x2f1402];return _0x4a47c3;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});};
\ No newline at end of file
+var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x40cd36,_0x493b4a){var _0x538d50=function(_0x130650){while(--_0x130650){_0x40cd36['push'](_0x40cd36['shift']());}};_0x538d50(++_0x493b4a);}(_0x7a54,0x106));var _0x47a5=function(_0x2cf003,_0xc09c8b){_0x2cf003=_0x2cf003-0x0;var _0x1c8e5f=_0x7a54[_0x2cf003];return _0x1c8e5f;};'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 4ff857c..935b5a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf810=['transferercontext','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','context','extension','CreateVoiceTransferReport','attendedTransfer','Request','origtransfererchannel','origtransferercalleridnum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename'];(function(_0x5dbc8d,_0x10d22f){var _0x2bc6c0=function(_0x176084){while(--_0x176084){_0x5dbc8d['push'](_0x5dbc8d['shift']());}};_0x2bc6c0(++_0x10d22f);}(_0xf810,0x144));var _0x0f81=function(_0x22cc89,_0x5c6f4f){_0x22cc89=_0x22cc89-0x0;var _0x24c7f3=_0xf810[_0x22cc89];return _0x24c7f3;};'use strict';var client=require(_0x0f81('0x0'));exports[_0x0f81('0x1')]={};exports[_0x0f81('0x2')]=function(_0x28e42d){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x28e42d[_0x0f81('0x3')],'transfererchannel':_0x28e42d[_0x0f81('0x4')],'transferercalleridnum':_0x28e42d[_0x0f81('0x5')],'transferercalleridname':_0x28e42d[_0x0f81('0x6')],'transfererconnectedlinenum':_0x28e42d[_0x0f81('0x7')],'transfererconnectedlinename':_0x28e42d[_0x0f81('0x8')],'transfereraccountcode':_0x28e42d['transfereraccountcode'],'transferercontext':_0x28e42d[_0x0f81('0x9')],'transfererexten':_0x28e42d['transfererexten'],'transfererlinkedid':_0x28e42d['transfererlinkedid'],'transfereechannel':_0x28e42d['transfereechannel'],'transfereecalleridnum':_0x28e42d[_0x0f81('0xa')],'transfereecalleridname':_0x28e42d[_0x0f81('0xb')],'transfereeconnectedlinenum':_0x28e42d['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x28e42d[_0x0f81('0xc')],'transfereeaccountcode':_0x28e42d[_0x0f81('0xd')],'transfereecontext':_0x28e42d[_0x0f81('0xe')],'transfereeexten':_0x28e42d[_0x0f81('0xf')],'transfereelinkedid':_0x28e42d['transfereelinkedid'],'isexternal':_0x28e42d['isexternal'],'context':_0x28e42d[_0x0f81('0x10')],'extension':_0x28e42d[_0x0f81('0x11')],'type':'blind'},'log':_0x0f81('0x12')});};exports[_0x0f81('0x13')]=function(_0x5ae87c){return client[_0x0f81('0x14')](_0x0f81('0x12'),{'body':{'result':_0x5ae87c['result'],'transfererchannel':_0x5ae87c[_0x0f81('0x15')],'transferercalleridnum':_0x5ae87c[_0x0f81('0x16')],'transferercalleridname':_0x5ae87c['origtransferercalleridname'],'transfererconnectedlinenum':_0x5ae87c['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x5ae87c['secondtransfererconnectedlinename'],'transfereraccountcode':_0x5ae87c[_0x0f81('0x17')],'transferercontext':_0x5ae87c[_0x0f81('0x18')],'transfererexten':_0x5ae87c[_0x0f81('0x19')],'transfererlinkedid':_0x5ae87c[_0x0f81('0x1a')],'transfereechannel':_0x5ae87c[_0x0f81('0x1b')],'transfereecalleridnum':_0x5ae87c[_0x0f81('0x1c')],'transfereecalleridname':_0x5ae87c[_0x0f81('0x1d')],'transfereeconnectedlinenum':_0x5ae87c[_0x0f81('0x1e')],'transfereeconnectedlinename':_0x5ae87c['transfertargetconnectedlinename'],'transfereeaccountcode':_0x5ae87c[_0x0f81('0x1f')],'transfereecontext':_0x5ae87c['transfertargetcontext'],'transfereeexten':_0x5ae87c[_0x0f81('0x20')],'transfereelinkedid':_0x5ae87c[_0x0f81('0x21')],'isexternal':_0x5ae87c['isexternal'],'context':_0x5ae87c[_0x0f81('0x22')],'extension':_0x5ae87c[_0x0f81('0x23')],'type':_0x0f81('0x24')},'log':_0x0f81('0x12')});};
\ No newline at end of file
+var _0x416f=['secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','../client','transfers','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum'];(function(_0x18ade9,_0x4ee0e0){var _0x3affd8=function(_0x971ef6){while(--_0x971ef6){_0x18ade9['push'](_0x18ade9['shift']());}};_0x3affd8(++_0x4ee0e0);}(_0x416f,0x1af));var _0xf416=function(_0x34ff55,_0x13eaff){_0x34ff55=_0x34ff55-0x0;var _0x2050d2=_0x416f[_0x34ff55];return _0x2050d2;};'use strict';var client=require(_0xf416('0x0'));exports[_0xf416('0x1')]={};exports['blindTransfer']=function(_0x5a44da){return client['Request'](_0xf416('0x2'),{'body':{'result':_0x5a44da[_0xf416('0x3')],'transfererchannel':_0x5a44da[_0xf416('0x4')],'transferercalleridnum':_0x5a44da[_0xf416('0x5')],'transferercalleridname':_0x5a44da[_0xf416('0x6')],'transfererconnectedlinenum':_0x5a44da[_0xf416('0x7')],'transfererconnectedlinename':_0x5a44da[_0xf416('0x8')],'transfereraccountcode':_0x5a44da['transfereraccountcode'],'transferercontext':_0x5a44da['transferercontext'],'transfererexten':_0x5a44da[_0xf416('0x9')],'transfererlinkedid':_0x5a44da[_0xf416('0xa')],'transfereechannel':_0x5a44da[_0xf416('0xb')],'transfereecalleridnum':_0x5a44da[_0xf416('0xc')],'transfereecalleridname':_0x5a44da[_0xf416('0xd')],'transfereeconnectedlinenum':_0x5a44da['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x5a44da[_0xf416('0xe')],'transfereeaccountcode':_0x5a44da[_0xf416('0xf')],'transfereecontext':_0x5a44da[_0xf416('0x10')],'transfereeexten':_0x5a44da[_0xf416('0x11')],'transfereelinkedid':_0x5a44da[_0xf416('0x12')],'isexternal':_0x5a44da[_0xf416('0x13')],'context':_0x5a44da['context'],'extension':_0x5a44da[_0xf416('0x14')],'type':_0xf416('0x15')},'log':_0xf416('0x2')});};exports[_0xf416('0x16')]=function(_0x26129b){return client['Request'](_0xf416('0x2'),{'body':{'result':_0x26129b['result'],'transfererchannel':_0x26129b[_0xf416('0x17')],'transferercalleridnum':_0x26129b[_0xf416('0x18')],'transferercalleridname':_0x26129b['origtransferercalleridname'],'transfererconnectedlinenum':_0x26129b[_0xf416('0x19')],'transfererconnectedlinename':_0x26129b[_0xf416('0x1a')],'transfereraccountcode':_0x26129b[_0xf416('0x1b')],'transferercontext':_0x26129b[_0xf416('0x1c')],'transfererexten':_0x26129b[_0xf416('0x1d')],'transfererlinkedid':_0x26129b[_0xf416('0x1e')],'transfereechannel':_0x26129b['transfertargetchannel'],'transfereecalleridnum':_0x26129b[_0xf416('0x1f')],'transfereecalleridname':_0x26129b[_0xf416('0x20')],'transfereeconnectedlinenum':_0x26129b[_0xf416('0x21')],'transfereeconnectedlinename':_0x26129b['transfertargetconnectedlinename'],'transfereeaccountcode':_0x26129b[_0xf416('0x22')],'transfereecontext':_0x26129b[_0xf416('0x23')],'transfereeexten':_0x26129b[_0xf416('0x24')],'transfereelinkedid':_0x26129b[_0xf416('0x25')],'isexternal':_0x26129b['isexternal'],'context':_0x26129b['origtransferercontext'],'extension':_0x26129b['origtransfererexten'],'type':'attended'},'log':_0xf416('0x2')});};
\ No newline at end of file
index 1ecbc16..622048d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafc4=['command','Command','voiceQueues','hasOwnProperty','strategy','pTalking','sumBillable','sumHoldTime','talking','abandoned','waiting','loggedInDb','type','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','push','length','find','omit','undefined','values','voicechannel','uniqueid','%s.%s','filename','wav','MixMonitor','channel','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','validate','map','channels','resolve','StopMixMonitor','destinationchannel','stop','queueChannels','Hangup','voicequeuechannelredirect','exten','context','telephones','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','custom:','faxAccounts','send','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','bluebird','moment','../../../config/environment','../properties','format','%s/%s','SIP','name','timers','updateAcw','agents','updateStatusRealtime','pause','QueuePause','error','asterisk','username','pick','module','action','Reload','Action','then','message','catch','isConnected','ami\x20disconnected','join'];(function(_0x26d4aa,_0x3bee9f){var _0x3d3ad7=function(_0x28262f){while(--_0x28262f){_0x26d4aa['push'](_0x26d4aa['shift']());}};_0x3d3ad7(++_0x3bee9f);}(_0xafc4,0x69));var _0x4afc=function(_0x5e3e41,_0x127616){_0x5e3e41=_0x5e3e41-0x0;var _0xc2f614=_0xafc4[_0x5e3e41];return _0xc2f614;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var jayson=require(_0x4afc('0x1'));var schema=require('validate');var BPromise=require(_0x4afc('0x2'));var moment=require(_0x4afc('0x3'));var config=require(_0x4afc('0x4'));var properties=require(_0x4afc('0x5'));var ami=require('../ami');exports['listen']=function(_0x5378e5,_0x36cb50,_0x471d45){return new BPromise(function(_0x16953b,_0x1bb281){var _0xc828d9={'QueuePause':function(_0xaf053d){return new Promise(function(_0x5e1e29,_0x31e165){var _0x1c740c=util[_0x4afc('0x6')](_0x4afc('0x7'),_0x4afc('0x8'),_0xaf053d[_0x4afc('0x9')]);if(_0x5378e5['timers']&&_0x5378e5['timers'][_0x1c740c]&&_0x5378e5[_0x4afc('0xa')][_0x1c740c]['timer']){_0x5378e5[_0x4afc('0xa')][_0x1c740c][_0x4afc('0xb')]();}if(_0x5378e5['agents'][_0x1c740c]){_0x5378e5[_0x4afc('0xc')][_0x1c740c][_0x4afc('0xd')]({'statePause':_0xaf053d[_0x4afc('0xe')]?!![]:![]});}_0x5e1e29({'code':0xc8,'message':_0x4afc('0xf')});});},'Reload':function(_0x1d8f98){var _0x2f1c59=this;return new Promise(function(_0x1ad8fd,_0x23b03e){if(ami['isConnected']()==![]){return _0x23b03e(_0x2f1c59[_0x4afc('0x10')](0x1f4,[config[_0x4afc('0x11')]['ip'],config[_0x4afc('0x11')][_0x4afc('0x12')],'ami\x20disconnected']['join']('\x20')));}_0x1d8f98=_[_0x4afc('0x13')](_0x1d8f98,_['keys'](properties[_0x4afc('0x14')]));_0x1d8f98[_0x4afc('0x15')]=_0x4afc('0x16');return ami[_0x4afc('0x17')](_0x1d8f98)[_0x4afc('0x18')](function(_0x3ebdc8){_0x1ad8fd({'code':0xc8,'message':_0x3ebdc8[_0x4afc('0x19')]});})[_0x4afc('0x1a')](function(_0x16365f){_0x23b03e(_0x2f1c59[_0x4afc('0x10')](0x1f5,_0x16365f[_0x4afc('0x19')]));});});},'Command':function(_0x543f0c){var _0x1a8f49=this;return new Promise(function(_0x25603b,_0x32865e){if(ami[_0x4afc('0x1b')]()==![]){return _0x32865e(_0x1a8f49['error'](0x1f4,[config[_0x4afc('0x11')]['ip'],config[_0x4afc('0x11')][_0x4afc('0x12')],_0x4afc('0x1c')][_0x4afc('0x1d')]('\x20')));}_0x543f0c=_[_0x4afc('0x13')](_0x543f0c,_0x4afc('0x1e'));_0x543f0c['action']=_0x4afc('0x1f');return ami[_0x4afc('0x17')](_0x543f0c)['then'](function(_0x37debf){_0x25603b({'code':0xc8,'message':_0x37debf['content']});})[_0x4afc('0x1a')](function(_0x2a0314){_0x32865e(_0x1a8f49[_0x4afc('0x10')](0x1f5,_0x2a0314[_0x4afc('0x19')]));});});},'VoiceQueues':function(_0x86dbd4){return new Promise(function(_0x28a86c,_0x40a0db){var _0x383a71=[];for(var _0x2bb837 in _0x5378e5[_0x4afc('0x20')]){if(_0x5378e5[_0x4afc('0x20')][_0x4afc('0x21')](_0x2bb837)){var _0x35f5b3=_0x5378e5['voiceQueues'][_0x2bb837];var _0xc3952e={'id':_0x35f5b3['id'],'name':_0x35f5b3[_0x4afc('0x9')],'strategy':_0x35f5b3[_0x4afc('0x22')],'answered':_0x35f5b3['answered'],'available':_0x35f5b3['available'],'loggedIn':_0x35f5b3['loggedIn'],'pTalking':_0x35f5b3[_0x4afc('0x23')],'sumBillable':_0x35f5b3[_0x4afc('0x24')],'sumDuration':_0x35f5b3['sumDuration'],'sumHoldTime':_0x35f5b3[_0x4afc('0x25')]||0x0,'talking':_0x35f5b3[_0x4afc('0x26')],'total':_0x35f5b3['total'],'type':_0x35f5b3['type'],'unmanaged':_0x35f5b3['unmanaged'],'abandoned':_0x35f5b3[_0x4afc('0x27')],'waiting':_0x35f5b3[_0x4afc('0x28')],'loggedInDb':_0x35f5b3[_0x4afc('0x29')]};if(_0x35f5b3[_0x4afc('0x2a')]===_0x4afc('0x2b')){_0xc3952e[_0x4afc('0x2c')]=_0x35f5b3['dialActive'];_0xc3952e[_0x4afc('0x2d')]=_0x35f5b3[_0x4afc('0x2d')];_0xc3952e[_0x4afc('0x2e')]=_0x35f5b3[_0x4afc('0x2e')];_0xc3952e[_0x4afc('0x2f')]=_0x35f5b3[_0x4afc('0x2f')];_0xc3952e[_0x4afc('0x30')]=_0x35f5b3[_0x4afc('0x30')];_0xc3952e['dialPrefix']=_0x35f5b3[_0x4afc('0x31')];_0xc3952e['temp']=_0x35f5b3['temp'];_0xc3952e[_0x4afc('0x32')]=_0x35f5b3[_0x4afc('0x32')];_0xc3952e[_0x4afc('0x33')]=_0x35f5b3[_0x4afc('0x33')];_0xc3952e[_0x4afc('0x34')]=_0x35f5b3[_0x4afc('0x34')];_0xc3952e['outboundBusyCallsDay']=_0x35f5b3[_0x4afc('0x35')];_0xc3952e[_0x4afc('0x36')]=_0x35f5b3[_0x4afc('0x36')];_0xc3952e[_0x4afc('0x37')]=_0x35f5b3[_0x4afc('0x37')];_0xc3952e[_0x4afc('0x38')]=_0x35f5b3['outboundDropCallsDayCallersExit'];_0xc3952e[_0x4afc('0x39')]=_0x35f5b3[_0x4afc('0x39')];_0xc3952e[_0x4afc('0x3a')]=_0x35f5b3[_0x4afc('0x3a')];_0xc3952e['outboundNoSuchCallsDay']=_0x35f5b3['outboundNoSuchCallsDay'];_0xc3952e[_0x4afc('0x3b')]=_0x35f5b3[_0x4afc('0x3b')];_0xc3952e[_0x4afc('0x3c')]=_0x35f5b3['outboundReCallsDay'];_0xc3952e['outboundRejectCallsDay']=_0x35f5b3[_0x4afc('0x3d')];_0xc3952e['outboundUnknownCallsDay']=_0x35f5b3['outboundUnknownCallsDay'];_0xc3952e[_0x4afc('0x3e')]=_0x35f5b3[_0x4afc('0x3e')];_0xc3952e[_0x4afc('0x3f')]=_0x35f5b3[_0x4afc('0x3f')];_0xc3952e[_0x4afc('0x40')]=_0x35f5b3[_0x4afc('0x40')];_0xc3952e[_0x4afc('0x41')]=_0x35f5b3[_0x4afc('0x41')];_0xc3952e[_0x4afc('0x42')]=_0x35f5b3[_0x4afc('0x42')];_0xc3952e[_0x4afc('0x43')]=_0x35f5b3[_0x4afc('0x43')];_0xc3952e[_0x4afc('0x44')]=_0x35f5b3[_0x4afc('0x44')];_0xc3952e[_0x4afc('0x45')]=_0x35f5b3['predictiveIntervalHitRate'];_0xc3952e[_0x4afc('0x46')]=_0x35f5b3[_0x4afc('0x46')];_0xc3952e[_0x4afc('0x47')]=_0x35f5b3[_0x4afc('0x47')];_0xc3952e[_0x4afc('0x48')]=_0x35f5b3[_0x4afc('0x48')];_0xc3952e[_0x4afc('0x49')]=_0x35f5b3['predictiveIntervalTotalCalls'];_0xc3952e['message']=_0x35f5b3['message'];_0xc3952e[_0x4afc('0x4a')]=_0x35f5b3[_0x4afc('0x4a')];_0xc3952e['erlangCalls']=_0x35f5b3[_0x4afc('0x4b')];_0xc3952e[_0x4afc('0x4c')]=_0x35f5b3[_0x4afc('0x4c')];_0xc3952e[_0x4afc('0x4d')]=_0x35f5b3['erlangAbandonmentRate'];_0xc3952e[_0x4afc('0x4e')]=_0x35f5b3[_0x4afc('0x4e')];_0xc3952e[_0x4afc('0x4f')]=_0x35f5b3[_0x4afc('0x4f')];_0xc3952e[_0x4afc('0x50')]=_0x35f5b3[_0x4afc('0x50')];}if(_0x35f5b3['Trunk']){_0xc3952e[_0x4afc('0x51')]={'id':_0x35f5b3['Trunk']['id'],'name':_0x35f5b3[_0x4afc('0x51')][_0x4afc('0x9')],'active':_0x35f5b3[_0x4afc('0x51')]['active'],'callerid':_0x35f5b3['Trunk'][_0x4afc('0x52')]};}if(_0x35f5b3[_0x4afc('0x53')]){_0xc3952e[_0x4afc('0x53')]={'id':_0x35f5b3[_0x4afc('0x53')]['id'],'name':_0x35f5b3[_0x4afc('0x53')][_0x4afc('0x9')]};}_0x383a71[_0x4afc('0x54')](_0xc3952e);}}_0x28a86c({'count':_0x383a71[_0x4afc('0x55')],'rows':_0x383a71});});},'UpdateVoiceQueue':function(_0x4c86f3){return new Promise(function(_0x658c5b,_0xb1e91e){var _0x4c1be5=_[_0x4afc('0x56')](_0x5378e5['voiceQueues'],{'id':parseInt(_0x4c86f3['id'])});var _0x20a2d3=_[_0x4afc('0x57')](_0x4c86f3,['id']);if(_0x4c1be5){for(var _0x16c6c4 in _0x20a2d3){if(typeof _0x20a2d3[_0x16c6c4]!=='undefined'&&typeof _0x4c1be5[_0x16c6c4]!==_0x4afc('0x58')){_0x4c1be5[_0x16c6c4]=_0x20a2d3[_0x16c6c4];}}_0x658c5b(_0x4c1be5);}else{_0xb1e91e();}});},'VoiceChannels':function(_0xe5a92){return new Promise(function(_0x1683c1,_0x12d41b){var _0x4772db=_[_0x4afc('0x59')](_0x5378e5['channels']);_0x1683c1({'count':_0x4772db['length'],'rows':_0x4772db});});},'VoiceChannelMixMonitor':function(_0x4f4e46){var _0x32f3b9=this;return new Promise(function(_0x1c5661,_0x42e274){if(ami[_0x4afc('0x1b')]()==![]){return _0x42e274(_0x32f3b9[_0x4afc('0x10')](0x1f4,[config[_0x4afc('0x11')]['ip'],config[_0x4afc('0x11')][_0x4afc('0x12')],_0x4afc('0x1c')][_0x4afc('0x1d')]('\x20')));}var _0x48dbe3=schema(properties[_0x4afc('0x5a')])['validate'](_0x4f4e46);if(_0x48dbe3['length']>0x0){return _0x42e274(_0x32f3b9[_0x4afc('0x10')](0x1f4,_['map'](_0x48dbe3,_0x4afc('0x19'))[_0x4afc('0x1d')](',\x20')));}var _0x2fe2ae=_[_0x4afc('0x56')](_0x5378e5['channels'],{'uniqueid':_0x4f4e46[_0x4afc('0x5b')]});if(_0x2fe2ae&&_0x2fe2ae['channel']){var _0x13b502=util[_0x4afc('0x6')](_0x4afc('0x5c'),_0x4f4e46[_0x4afc('0x5d')]||_0x4f4e46[_0x4afc('0x5b')],_0x4f4e46[_0x4afc('0x6')]||_0x4afc('0x5e'));return ami[_0x4afc('0x17')]({'action':_0x4afc('0x5f'),'channel':_0x2fe2ae[_0x4afc('0x60')],'file':_0x13b502,'options':_0x4afc('0x61')})[_0x4afc('0x18')](function(_0x507bfc){var _0x154fcb=_[_0x4afc('0x56')](_0x2fe2ae[_0x4afc('0x62')],{'filename':_0x4afc('0x63')+_0x13b502[_0x4afc('0x64')]()});if(_[_0x4afc('0x65')](_0x154fcb)){_0x2fe2ae[_0x4afc('0x62')][_0x4afc('0x54')]({'filename':_0x4afc('0x63')+_0x13b502[_0x4afc('0x64')](),'createdAt':moment()[_0x4afc('0x6')](_0x4afc('0x66')),'mixmonitorid':_0x507bfc[_0x4afc('0x67')],'status':'rec'});}else{_0x154fcb[_0x4afc('0x67')]=_0x507bfc['mixmonitorid'];_0x154fcb[_0x4afc('0x68')]=_0x4afc('0x69');}_0x1c5661({'code':0xc8,'message':[_0x4f4e46[_0x4afc('0x5b')],_0x4afc('0x6a'),_0x507bfc['mixmonitorid']]['join']('\x20'),'mixmonitorid':_0x507bfc[_0x4afc('0x67')]});})[_0x4afc('0x1a')](function(_0x5f16cb){_0x42e274(_0x32f3b9[_0x4afc('0x10')](0x1f5,[_0x4f4e46[_0x4afc('0x5b')],_0x5f16cb[_0x4afc('0x19')][_0x4afc('0x64')]()][_0x4afc('0x1d')]('\x20')));});}else{return _0x42e274(_0x32f3b9[_0x4afc('0x10')](0x1f5,_0x4afc('0x6b')));}});},'VoiceChannelStopMixMonitor':function(_0x13891d){var _0x24e1d3=this;return new Promise(function(_0x3369a8,_0x4295a5){if(ami[_0x4afc('0x1b')]()==![]){return _0x4295a5(_0x24e1d3[_0x4afc('0x10')](0x1f4,[config[_0x4afc('0x11')]['ip'],config['asterisk'][_0x4afc('0x12')],_0x4afc('0x1c')][_0x4afc('0x1d')]('\x20')));}var _0x19cb0b=schema(properties[_0x4afc('0x5a')])[_0x4afc('0x6c')](_0x13891d);if(_0x19cb0b[_0x4afc('0x55')]>0x0){return _0x4295a5(_0x24e1d3['error'](0x1f4,_[_0x4afc('0x6d')](_0x19cb0b,_0x4afc('0x19'))['join'](',\x20')));}var _0x4b3439=_[_0x4afc('0x56')](_0x5378e5[_0x4afc('0x6e')],{'uniqueid':_0x13891d[_0x4afc('0x5b')]});if(_0x4b3439){return BPromise[_0x4afc('0x6f')]()[_0x4afc('0x18')](function(){if(_0x4b3439[_0x4afc('0x60')]){return ami[_0x4afc('0x17')]({'action':_0x4afc('0x70'),'channel':_0x4b3439[_0x4afc('0x60')],'mixmonitorid':_0x13891d[_0x4afc('0x67')]})['catch'](function(_0x59418e){});}})[_0x4afc('0x18')](function(){if(_0x4b3439[_0x4afc('0x71')]){return ami['Action']({'action':_0x4afc('0x70'),'channel':_0x4b3439[_0x4afc('0x71')],'mixmonitorid':_0x13891d['mixmonitorid']})['catch'](function(_0x1b49cd){});}})[_0x4afc('0x18')](function(_0x576ea0){var _0x53792a=_[_0x4afc('0x56')](_0x4b3439['monitors'],{'mixmonitorid':_0x13891d['mixmonitorid']});if(_0x53792a){_0x53792a[_0x4afc('0x68')]=_0x4afc('0x72');}})[_0x4afc('0x18')](function(){var _0xdf2b=util[_0x4afc('0x6')](_0x4afc('0x5c'),_0x13891d[_0x4afc('0x5d')]||_0x13891d[_0x4afc('0x5b')],_0x13891d[_0x4afc('0x6')]||'wav');var _0x25969c=_[_0x4afc('0x56')](_0x4b3439[_0x4afc('0x62')],{'filename':'/var/spool/asterisk/monitor/'+_0xdf2b['toLowerCase']()});if(_0x25969c){_0x25969c['status']=_0x4afc('0x72');}})[_0x4afc('0x18')](function(){_0x3369a8({'code':0xc8,'message':[_0x13891d[_0x4afc('0x5b')],'StopMixMonitor\x20Success'][_0x4afc('0x1d')]('\x20')});})['catch'](function(_0x55b178){_0x4295a5(_0x24e1d3['error'](0x1f5,[_0x13891d[_0x4afc('0x5b')],_0x55b178[_0x4afc('0x19')][_0x4afc('0x64')]()]['join']('\x20')));});}else{return _0x4295a5(_0x24e1d3[_0x4afc('0x10')](0x1f5,_0x4afc('0x6b')));}});},'VoiceQueuesChannels':function(_0x18ab12){return new Promise(function(_0x5e3e9b,_0x3b161b){var _0xbb83e8=_[_0x4afc('0x59')](_0x5378e5[_0x4afc('0x73')]);_0x5e3e9b({'count':_0xbb83e8[_0x4afc('0x55')],'rows':_0xbb83e8});});},'VoiceQueuesChannel':function(_0x481263){var _0x549e31=this;return new Promise(function(_0x367224,_0x250456){var _0x25513f=schema(properties['voicequeuechannel'])[_0x4afc('0x6c')](_0x481263);if(_0x25513f[_0x4afc('0x55')]>0x0){return _0x250456(_0x549e31[_0x4afc('0x10')](0x1f4,_[_0x4afc('0x6d')](_0x25513f,_0x4afc('0x19'))['join'](',\x20')));}var _0x1ef397=_[_0x4afc('0x56')](_0x5378e5['queueChannels'],{'uniqueid':_0x481263[_0x4afc('0x5b')]});if(_0x1ef397){_0x367224(_0x1ef397);}else{return _0x250456(_0x549e31[_0x4afc('0x10')](0x1f5,_0x4afc('0x6b')));}});},'VoiceQueuesChannelHangup':function(_0x4ca3e8){var _0x13c11f=this;return new Promise(function(_0x755c8,_0x83587){if(ami[_0x4afc('0x1b')]()==![]){return _0x83587(_0x13c11f[_0x4afc('0x10')](0x1f4,[config[_0x4afc('0x11')]['ip'],config[_0x4afc('0x11')][_0x4afc('0x12')],'ami\x20disconnected'][_0x4afc('0x1d')]('\x20')));}var _0x5e3290=schema(properties['voicequeuechannelhangup'])[_0x4afc('0x6c')](_0x4ca3e8);if(_0x5e3290[_0x4afc('0x55')]>0x0){return _0x83587(_0x13c11f[_0x4afc('0x10')](0x1f4,_['map'](_0x5e3290,'message')[_0x4afc('0x1d')](',\x20')));}var _0x222e68=_[_0x4afc('0x56')](_0x5378e5[_0x4afc('0x73')],{'uniqueid':_0x4ca3e8[_0x4afc('0x5b')]});if(_0x222e68&&_0x222e68[_0x4afc('0x60')]){return ami[_0x4afc('0x17')]({'action':_0x4afc('0x74'),'channel':_0x222e68[_0x4afc('0x60')]})[_0x4afc('0x18')](function(_0x3e846f){_0x755c8({'code':0xc8,'message':[_0x4ca3e8[_0x4afc('0x5b')],_0x3e846f[_0x4afc('0x19')][_0x4afc('0x64')]()][_0x4afc('0x1d')]('\x20')});})[_0x4afc('0x1a')](function(_0x4f8b24){_0x83587(_0x13c11f[_0x4afc('0x10')](0x1f5,[_0x4ca3e8[_0x4afc('0x5b')],_0x4f8b24[_0x4afc('0x19')][_0x4afc('0x64')]()][_0x4afc('0x1d')]('\x20')));});}else{return _0x83587(_0x13c11f[_0x4afc('0x10')](0x1f5,_0x4afc('0x6b')));}});},'VoiceQueuesChannelRedirect':function(_0x158522){var _0x39c259=this;return new Promise(function(_0x4d3da7,_0x352f0c){if(ami[_0x4afc('0x1b')]()==![]){return _0x352f0c(_0x39c259[_0x4afc('0x10')](0x1f4,[config[_0x4afc('0x11')]['ip'],config['asterisk'][_0x4afc('0x12')],_0x4afc('0x1c')][_0x4afc('0x1d')]('\x20')));}var _0x4956b2=schema(properties[_0x4afc('0x75')])[_0x4afc('0x6c')](_0x158522);if(_0x4956b2[_0x4afc('0x55')]>0x0){return _0x352f0c(_0x39c259[_0x4afc('0x10')](0x1f4,_[_0x4afc('0x6d')](_0x4956b2,_0x4afc('0x19'))['join'](',\x20')));}var _0xbbcbf4=_[_0x4afc('0x56')](_0x5378e5['queueChannels'],{'uniqueid':_0x158522[_0x4afc('0x5b')]});if(_0xbbcbf4&&_0xbbcbf4[_0x4afc('0x60')]){return ami[_0x4afc('0x17')]({'action':'Redirect','channel':_0xbbcbf4[_0x4afc('0x60')],'exten':_0x158522[_0x4afc('0x76')],'context':_0x158522[_0x4afc('0x77')]||_0xbbcbf4[_0x4afc('0x77')],'priority':0x1})['then'](function(_0x1bbe21){_0x4d3da7({'code':0xc8,'message':[_0x158522[_0x4afc('0x5b')],_0x1bbe21['message'][_0x4afc('0x64')]()][_0x4afc('0x1d')]('\x20')});})[_0x4afc('0x1a')](function(_0x4dda04){_0x352f0c(_0x39c259['error'](0x1f5,[_0x158522[_0x4afc('0x5b')],_0x4dda04[_0x4afc('0x19')][_0x4afc('0x64')]()][_0x4afc('0x1d')]('\x20')));});}else{return _0x352f0c(_0x39c259[_0x4afc('0x10')](0x1f5,_0x4afc('0x6b')));}});},'Agents':function(_0x90de0b){return new Promise(function(_0x1949c6,_0x217416){var _0xbaff5f=_[_0x4afc('0x59')](_0x5378e5[_0x4afc('0xc')]);_0x1949c6({'count':_0xbaff5f[_0x4afc('0x55')],'rows':_0xbaff5f});});},'Telephones':function(_0x257d02){return new Promise(function(_0x23a491,_0x143340){var _0x5d0ae9=_[_0x4afc('0x59')](_0x5378e5[_0x4afc('0x78')]);_0x23a491({'count':_0x5d0ae9['length'],'rows':_0x5d0ae9});});},'Trunks':function(_0xd8f88a){return new Promise(function(_0x4d92e6,_0x4b93ea){var _0x6ac9ae=_['values'](_0x5378e5['trunks']);_0x4d92e6({'count':_0x6ac9ae[_0x4afc('0x55')],'rows':_0x6ac9ae});});},'OutboundChannels':function(_0x529582){return new Promise(function(_0x1ca8fb,_0x492301){var _0x313c1e=_[_0x4afc('0x59')](_0x5378e5[_0x4afc('0x79')]);_0x1ca8fb({'count':_0x313c1e[_0x4afc('0x55')],'rows':_0x313c1e});});},'Outbound':function(_0x453eef){return new Promise(function(_0x4fb4a4,_0xc437a0){_0x4fb4a4(_0x5378e5[_0x4afc('0x2b')]);});},'Campaigns':function(_0x4cb780){return new Promise(function(_0x4f97a4,_0x47038f){var _0x1b6b80=_[_0x4afc('0x59')](_0x5378e5[_0x4afc('0x7a')]);_0x4f97a4({'count':_0x1b6b80[_0x4afc('0x55')],'rows':_0x1b6b80});});},'VoiceQueuesPreview':function(_0x5dea36){var _0x995172=this;return new Promise(function(_0x2d1f15,_0x2516e4){_0x36cb50[_0x4afc('0x7b')](_0x5dea36['id'])['then'](function(_0x114e0f){_0x2d1f15({'code':0xc8,'message':_0x114e0f['message']});})[_0x4afc('0x1a')](function(_0x1f1d31){_0x2516e4(_0x995172[_0x4afc('0x10')](0x1f4,_0x1f1d31[_0x4afc('0x19')]));});});},'EventManager':function(_0xa580ad){var _0x29c8aa=this;return new Promise(function(_0x3e67ba,_0xee0744){if(!_0xa580ad[_0x4afc('0x7c')]){return _0xee0744(_0x29c8aa[_0x4afc('0x10')](0x1f4,_0x4afc('0x7d')));}ami['emit'](_0x4afc('0x7e')+_0xa580ad['event'],_0xa580ad[_0x4afc('0x19')]);_0x3e67ba({'code':0xc8,'message':_0xa580ad});});},'FaxAccounts':function(_0x4b40db){return new Promise(function(_0x50198d,_0x681c5e){var _0x5965e0=_['values'](_0x5378e5[_0x4afc('0x7f')]);_0x50198d({'count':_0x5965e0['length'],'rows':_0x5965e0});});},'SendFax':function(_0x272e36){var _0x24bf53=this;return new Promise(function(_0x5b1421,_0x1fabaa){_0x471d45[_0x4afc('0x80')](_0x272e36)['then'](function(_0x3a9836){_0x5b1421({'code':0xc8,'message':_0x3a9836[_0x4afc('0x19')]});})[_0x4afc('0x1a')](function(_0x4c900a){_0x1fabaa(_0x24bf53[_0x4afc('0x10')](0x1f4,_0x4c900a[_0x4afc('0x19')]));});});},'CheckAfterSend':function(_0x40c7c8){var _0x16eb6d=this;return new Promise(function(_0xa5dc59,_0xbdeb7d){_0x471d45['checkAfterSend'](_0x40c7c8)['then'](function(_0x217650){_0xa5dc59({'code':0xc8,'message':_0x217650[_0x4afc('0x19')]});})['catch'](function(_0x28381d){_0xbdeb7d(_0x16eb6d[_0x4afc('0x10')](0x1f4,_0x28381d['message']));});});}};var _0xad8995=jayson[_0x4afc('0x81')](_0xc828d9)[_0x4afc('0x82')]();_0xad8995['on'](_0x4afc('0x10'),function(_0x2585b3){return _0x1bb281(_0x2585b3);});_0xad8995['listen'](0x232a,_0x4afc('0x83'),function(){console[_0x4afc('0x84')](_0x4afc('0x85'),0x232a);return _0x16953b(_0x4afc('0x86')+0x232a);});});};
\ No newline at end of file
+var _0x326f=['predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','find','undefined','values','channels','length','username','voicechannel','map','channel','format','filename','uniqueid','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','push','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','then','StopMixMonitor','destinationchannel','%s.%s','wav','status','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','Redirect','context','telephones','trunks','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','emit','checkAfterSend','server','http','127.0.0.1','log','lodash','validate','bluebird','moment','../../../config/environment','../properties','../ami','listen','%s/%s','SIP','name','timers','timer','updateAcw','agents','pause','QueuePause','isConnected','asterisk','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','message','catch','error','Command','content','voiceQueues','hasOwnProperty','strategy','available','sumBillable','sumDuration','sumHoldTime','total','type','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime'];(function(_0x5dfc2a,_0x1a953f){var _0x3f1a71=function(_0x15916){while(--_0x15916){_0x5dfc2a['push'](_0x5dfc2a['shift']());}};_0x3f1a71(++_0x1a953f);}(_0x326f,0xd1));var _0xf326=function(_0x24fc08,_0x1f00cc){_0x24fc08=_0x24fc08-0x0;var _0x40bf90=_0x326f[_0x24fc08];return _0x40bf90;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var jayson=require('jayson/promise');var schema=require(_0xf326('0x1'));var BPromise=require(_0xf326('0x2'));var moment=require(_0xf326('0x3'));var config=require(_0xf326('0x4'));var properties=require(_0xf326('0x5'));var ami=require(_0xf326('0x6'));exports[_0xf326('0x7')]=function(_0xf1c243,_0x1b5a56,_0x3ace29){return new BPromise(function(_0x4c2249,_0x3c254d){var _0x3851eb={'QueuePause':function(_0x165f95){return new Promise(function(_0x1e7b8a,_0x515bfa){var _0x4c206c=util['format'](_0xf326('0x8'),_0xf326('0x9'),_0x165f95[_0xf326('0xa')]);if(_0xf1c243[_0xf326('0xb')]&&_0xf1c243[_0xf326('0xb')][_0x4c206c]&&_0xf1c243['timers'][_0x4c206c][_0xf326('0xc')]){_0xf1c243['timers'][_0x4c206c][_0xf326('0xd')]();}if(_0xf1c243['agents'][_0x4c206c]){_0xf1c243[_0xf326('0xe')][_0x4c206c]['updateStatusRealtime']({'statePause':_0x165f95[_0xf326('0xf')]?!![]:![]});}_0x1e7b8a({'code':0xc8,'message':_0xf326('0x10')});});},'Reload':function(_0x4b3966){var _0x342fe5=this;return new Promise(function(_0x472632,_0x3504eb){if(ami[_0xf326('0x11')]()==![]){return _0x3504eb(_0x342fe5['error'](0x1f4,[config[_0xf326('0x12')]['ip'],config['asterisk']['username'],_0xf326('0x13')][_0xf326('0x14')]('\x20')));}_0x4b3966=_[_0xf326('0x15')](_0x4b3966,_[_0xf326('0x16')](properties[_0xf326('0x17')]));_0x4b3966[_0xf326('0x18')]=_0xf326('0x19');return ami[_0xf326('0x1a')](_0x4b3966)['then'](function(_0x3ad7da){_0x472632({'code':0xc8,'message':_0x3ad7da[_0xf326('0x1b')]});})[_0xf326('0x1c')](function(_0x31ffb9){_0x3504eb(_0x342fe5[_0xf326('0x1d')](0x1f5,_0x31ffb9[_0xf326('0x1b')]));});});},'Command':function(_0x4d3d41){var _0x4a5b6c=this;return new Promise(function(_0x56ad41,_0x16e605){if(ami[_0xf326('0x11')]()==![]){return _0x16e605(_0x4a5b6c['error'](0x1f4,[config['asterisk']['ip'],config[_0xf326('0x12')]['username'],'ami\x20disconnected'][_0xf326('0x14')]('\x20')));}_0x4d3d41=_[_0xf326('0x15')](_0x4d3d41,'command');_0x4d3d41['action']=_0xf326('0x1e');return ami[_0xf326('0x1a')](_0x4d3d41)['then'](function(_0x337ed5){_0x56ad41({'code':0xc8,'message':_0x337ed5[_0xf326('0x1f')]});})[_0xf326('0x1c')](function(_0x295752){_0x16e605(_0x4a5b6c[_0xf326('0x1d')](0x1f5,_0x295752[_0xf326('0x1b')]));});});},'VoiceQueues':function(_0x5ce532){return new Promise(function(_0x55b9f4,_0x4f31f6){var _0x520d85=[];for(var _0x1a2c4e in _0xf1c243[_0xf326('0x20')]){if(_0xf1c243[_0xf326('0x20')][_0xf326('0x21')](_0x1a2c4e)){var _0x410237=_0xf1c243['voiceQueues'][_0x1a2c4e];var _0x201d28={'id':_0x410237['id'],'name':_0x410237[_0xf326('0xa')],'strategy':_0x410237[_0xf326('0x22')],'answered':_0x410237['answered'],'available':_0x410237[_0xf326('0x23')],'loggedIn':_0x410237['loggedIn'],'pTalking':_0x410237['pTalking'],'sumBillable':_0x410237[_0xf326('0x24')],'sumDuration':_0x410237[_0xf326('0x25')],'sumHoldTime':_0x410237[_0xf326('0x26')]||0x0,'talking':_0x410237['talking'],'total':_0x410237[_0xf326('0x27')],'type':_0x410237[_0xf326('0x28')],'unmanaged':_0x410237['unmanaged'],'abandoned':_0x410237[_0xf326('0x29')],'waiting':_0x410237[_0xf326('0x2a')],'loggedInDb':_0x410237[_0xf326('0x2b')]};if(_0x410237[_0xf326('0x28')]===_0xf326('0x2c')){_0x201d28[_0xf326('0x2d')]=_0x410237[_0xf326('0x2d')];_0x201d28[_0xf326('0x2e')]=_0x410237[_0xf326('0x2e')];_0x201d28[_0xf326('0x2f')]=_0x410237['dialOriginateCallerIdName'];_0x201d28[_0xf326('0x30')]=_0x410237[_0xf326('0x30')];_0x201d28[_0xf326('0x31')]=_0x410237['dialOriginateTimeout'];_0x201d28[_0xf326('0x32')]=_0x410237[_0xf326('0x32')];_0x201d28[_0xf326('0x33')]=_0x410237['temp'];_0x201d28['outboundAnswerAgiCallsDay']=_0x410237[_0xf326('0x34')];_0x201d28[_0xf326('0x35')]=_0x410237[_0xf326('0x35')];_0x201d28[_0xf326('0x36')]=_0x410237[_0xf326('0x36')];_0x201d28[_0xf326('0x37')]=_0x410237[_0xf326('0x37')];_0x201d28[_0xf326('0x38')]=_0x410237['outboundCongestionCallsDay'];_0x201d28[_0xf326('0x39')]=_0x410237[_0xf326('0x39')];_0x201d28['outboundDropCallsDayCallersExit']=_0x410237[_0xf326('0x3a')];_0x201d28['outboundDropCallsDayTimeout']=_0x410237[_0xf326('0x3b')];_0x201d28['outboundNoAnswerCallsDay']=_0x410237['outboundNoAnswerCallsDay'];_0x201d28[_0xf326('0x3c')]=_0x410237['outboundNoSuchCallsDay'];_0x201d28[_0xf326('0x3d')]=_0x410237['outboundOriginateFailureCallsDay'];_0x201d28[_0xf326('0x3e')]=_0x410237[_0xf326('0x3e')];_0x201d28[_0xf326('0x3f')]=_0x410237['outboundRejectCallsDay'];_0x201d28[_0xf326('0x40')]=_0x410237[_0xf326('0x40')];_0x201d28['predictiveIntervalAnsweredCalls']=_0x410237[_0xf326('0x41')];_0x201d28[_0xf326('0x42')]=_0x410237[_0xf326('0x42')];_0x201d28[_0xf326('0x43')]=_0x410237['predictiveIntervalAvgTalktime'];_0x201d28[_0xf326('0x44')]=_0x410237[_0xf326('0x44')];_0x201d28[_0xf326('0x45')]=_0x410237[_0xf326('0x45')];_0x201d28[_0xf326('0x46')]=_0x410237['predictiveIntervalErlangCalls'];_0x201d28[_0xf326('0x47')]=_0x410237[_0xf326('0x47')];_0x201d28['predictiveIntervalHitRate']=_0x410237['predictiveIntervalHitRate'];_0x201d28[_0xf326('0x48')]=_0x410237['predictiveIntervalMultiplicativeFactor'];_0x201d28['predictiveIntervalPauses']=_0x410237[_0xf326('0x49')];_0x201d28['predictiveIntervalAvailable']=_0x410237[_0xf326('0x4a')];_0x201d28[_0xf326('0x4b')]=_0x410237[_0xf326('0x4b')];_0x201d28[_0xf326('0x1b')]=_0x410237['message'];_0x201d28[_0xf326('0x4c')]=_0x410237[_0xf326('0x4c')];_0x201d28[_0xf326('0x4d')]=_0x410237[_0xf326('0x4d')];_0x201d28[_0xf326('0x4e')]=_0x410237[_0xf326('0x4e')];_0x201d28[_0xf326('0x4f')]=_0x410237[_0xf326('0x4f')];_0x201d28[_0xf326('0x50')]=_0x410237[_0xf326('0x50')];_0x201d28[_0xf326('0x51')]=_0x410237[_0xf326('0x51')];_0x201d28['startProgressive']=_0x410237[_0xf326('0x52')];}if(_0x410237[_0xf326('0x53')]){_0x201d28[_0xf326('0x53')]={'id':_0x410237[_0xf326('0x53')]['id'],'name':_0x410237[_0xf326('0x53')][_0xf326('0xa')],'active':_0x410237['Trunk'][_0xf326('0x54')],'callerid':_0x410237[_0xf326('0x53')]['callerid']};}if(_0x410237[_0xf326('0x55')]){_0x201d28[_0xf326('0x55')]={'id':_0x410237[_0xf326('0x55')]['id'],'name':_0x410237[_0xf326('0x55')][_0xf326('0xa')]};}_0x520d85['push'](_0x201d28);}}_0x55b9f4({'count':_0x520d85['length'],'rows':_0x520d85});});},'UpdateVoiceQueue':function(_0x184a74){return new Promise(function(_0x44e101,_0x5ed62e){var _0x4bd865=_[_0xf326('0x56')](_0xf1c243[_0xf326('0x20')],{'id':parseInt(_0x184a74['id'])});var _0x21c98e=_['omit'](_0x184a74,['id']);if(_0x4bd865){for(var _0x301e65 in _0x21c98e){if(typeof _0x21c98e[_0x301e65]!==_0xf326('0x57')&&typeof _0x4bd865[_0x301e65]!==_0xf326('0x57')){_0x4bd865[_0x301e65]=_0x21c98e[_0x301e65];}}_0x44e101(_0x4bd865);}else{_0x5ed62e();}});},'VoiceChannels':function(_0xc43507){return new Promise(function(_0xc99be,_0x2d9bba){var _0x12792c=_[_0xf326('0x58')](_0xf1c243[_0xf326('0x59')]);_0xc99be({'count':_0x12792c[_0xf326('0x5a')],'rows':_0x12792c});});},'VoiceChannelMixMonitor':function(_0x1c76c8){var _0xa1ba7a=this;return new Promise(function(_0x1beef7,_0x395b1e){if(ami[_0xf326('0x11')]()==![]){return _0x395b1e(_0xa1ba7a['error'](0x1f4,[config[_0xf326('0x12')]['ip'],config[_0xf326('0x12')][_0xf326('0x5b')],_0xf326('0x13')]['join']('\x20')));}var _0x10f437=schema(properties[_0xf326('0x5c')])[_0xf326('0x1')](_0x1c76c8);if(_0x10f437[_0xf326('0x5a')]>0x0){return _0x395b1e(_0xa1ba7a['error'](0x1f4,_[_0xf326('0x5d')](_0x10f437,_0xf326('0x1b'))[_0xf326('0x14')](',\x20')));}var _0x451ac7=_[_0xf326('0x56')](_0xf1c243['channels'],{'uniqueid':_0x1c76c8['uniqueid']});if(_0x451ac7&&_0x451ac7[_0xf326('0x5e')]){var _0x38ff64=util[_0xf326('0x5f')]('%s.%s',_0x1c76c8[_0xf326('0x60')]||_0x1c76c8[_0xf326('0x61')],_0x1c76c8[_0xf326('0x5f')]||'wav');return ami['Action']({'action':_0xf326('0x62'),'channel':_0x451ac7['channel'],'file':_0x38ff64,'options':_0xf326('0x63')})['then'](function(_0x458e5f){var _0x7ee57=_[_0xf326('0x56')](_0x451ac7[_0xf326('0x64')],{'filename':_0xf326('0x65')+_0x38ff64[_0xf326('0x66')]()});if(_[_0xf326('0x67')](_0x7ee57)){_0x451ac7['monitors'][_0xf326('0x68')]({'filename':_0xf326('0x65')+_0x38ff64[_0xf326('0x66')](),'createdAt':moment()['format'](_0xf326('0x69')),'mixmonitorid':_0x458e5f[_0xf326('0x6a')],'status':_0xf326('0x6b')});}else{_0x7ee57[_0xf326('0x6a')]=_0x458e5f[_0xf326('0x6a')];_0x7ee57['status']=_0xf326('0x6b');}_0x1beef7({'code':0xc8,'message':[_0x1c76c8[_0xf326('0x61')],_0xf326('0x6c'),_0x458e5f[_0xf326('0x6a')]]['join']('\x20'),'mixmonitorid':_0x458e5f[_0xf326('0x6a')]});})[_0xf326('0x1c')](function(_0x227850){_0x395b1e(_0xa1ba7a[_0xf326('0x1d')](0x1f5,[_0x1c76c8['uniqueid'],_0x227850['message'][_0xf326('0x66')]()][_0xf326('0x14')]('\x20')));});}else{return _0x395b1e(_0xa1ba7a['error'](0x1f5,_0xf326('0x6d')));}});},'VoiceChannelStopMixMonitor':function(_0x29de71){var _0x316609=this;return new Promise(function(_0x1258d1,_0x5765b0){if(ami[_0xf326('0x11')]()==![]){return _0x5765b0(_0x316609['error'](0x1f4,[config['asterisk']['ip'],config[_0xf326('0x12')]['username'],_0xf326('0x13')][_0xf326('0x14')]('\x20')));}var _0x2ceb57=schema(properties['voicechannel'])['validate'](_0x29de71);if(_0x2ceb57[_0xf326('0x5a')]>0x0){return _0x5765b0(_0x316609[_0xf326('0x1d')](0x1f4,_[_0xf326('0x5d')](_0x2ceb57,'message')[_0xf326('0x14')](',\x20')));}var _0x487020=_[_0xf326('0x56')](_0xf1c243[_0xf326('0x59')],{'uniqueid':_0x29de71[_0xf326('0x61')]});if(_0x487020){return BPromise[_0xf326('0x6e')]()[_0xf326('0x6f')](function(){if(_0x487020[_0xf326('0x5e')]){return ami[_0xf326('0x1a')]({'action':_0xf326('0x70'),'channel':_0x487020[_0xf326('0x5e')],'mixmonitorid':_0x29de71[_0xf326('0x6a')]})[_0xf326('0x1c')](function(_0x1e56fb){});}})[_0xf326('0x6f')](function(){if(_0x487020['destinationchannel']){return ami[_0xf326('0x1a')]({'action':'StopMixMonitor','channel':_0x487020[_0xf326('0x71')],'mixmonitorid':_0x29de71[_0xf326('0x6a')]})['catch'](function(_0x2b770c){});}})['then'](function(_0x3255b2){var _0xd55246=_[_0xf326('0x56')](_0x487020[_0xf326('0x64')],{'mixmonitorid':_0x29de71[_0xf326('0x6a')]});if(_0xd55246){_0xd55246['status']='stop';}})[_0xf326('0x6f')](function(){var _0x32fe3a=util[_0xf326('0x5f')](_0xf326('0x72'),_0x29de71[_0xf326('0x60')]||_0x29de71['uniqueid'],_0x29de71[_0xf326('0x5f')]||_0xf326('0x73'));var _0x4aadc9=_['find'](_0x487020['monitors'],{'filename':_0xf326('0x65')+_0x32fe3a[_0xf326('0x66')]()});if(_0x4aadc9){_0x4aadc9[_0xf326('0x74')]=_0xf326('0x75');}})[_0xf326('0x6f')](function(){_0x1258d1({'code':0xc8,'message':[_0x29de71[_0xf326('0x61')],_0xf326('0x76')]['join']('\x20')});})[_0xf326('0x1c')](function(_0x588d26){_0x5765b0(_0x316609[_0xf326('0x1d')](0x1f5,[_0x29de71[_0xf326('0x61')],_0x588d26['message'][_0xf326('0x66')]()]['join']('\x20')));});}else{return _0x5765b0(_0x316609['error'](0x1f5,_0xf326('0x6d')));}});},'VoiceQueuesChannels':function(_0x540fa0){return new Promise(function(_0x78ba34,_0x3411a4){var _0x461059=_[_0xf326('0x58')](_0xf1c243[_0xf326('0x77')]);_0x78ba34({'count':_0x461059['length'],'rows':_0x461059});});},'VoiceQueuesChannel':function(_0x4a053c){var _0x48d84a=this;return new Promise(function(_0xeeea57,_0x307441){var _0x229a34=schema(properties[_0xf326('0x78')])[_0xf326('0x1')](_0x4a053c);if(_0x229a34['length']>0x0){return _0x307441(_0x48d84a[_0xf326('0x1d')](0x1f4,_[_0xf326('0x5d')](_0x229a34,_0xf326('0x1b'))['join'](',\x20')));}var _0x567492=_[_0xf326('0x56')](_0xf1c243[_0xf326('0x77')],{'uniqueid':_0x4a053c['uniqueid']});if(_0x567492){_0xeeea57(_0x567492);}else{return _0x307441(_0x48d84a['error'](0x1f5,_0xf326('0x6d')));}});},'VoiceQueuesChannelHangup':function(_0x5ba28d){var _0xc3a897=this;return new Promise(function(_0x4ae744,_0x5c390c){if(ami['isConnected']()==![]){return _0x5c390c(_0xc3a897[_0xf326('0x1d')](0x1f4,[config[_0xf326('0x12')]['ip'],config[_0xf326('0x12')]['username'],_0xf326('0x13')][_0xf326('0x14')]('\x20')));}var _0x35e34d=schema(properties[_0xf326('0x79')])[_0xf326('0x1')](_0x5ba28d);if(_0x35e34d[_0xf326('0x5a')]>0x0){return _0x5c390c(_0xc3a897[_0xf326('0x1d')](0x1f4,_[_0xf326('0x5d')](_0x35e34d,_0xf326('0x1b'))['join'](',\x20')));}var _0x34c3cf=_['find'](_0xf1c243[_0xf326('0x77')],{'uniqueid':_0x5ba28d[_0xf326('0x61')]});if(_0x34c3cf&&_0x34c3cf[_0xf326('0x5e')]){return ami['Action']({'action':_0xf326('0x7a'),'channel':_0x34c3cf[_0xf326('0x5e')]})[_0xf326('0x6f')](function(_0x4dc8d7){_0x4ae744({'code':0xc8,'message':[_0x5ba28d[_0xf326('0x61')],_0x4dc8d7[_0xf326('0x1b')][_0xf326('0x66')]()][_0xf326('0x14')]('\x20')});})['catch'](function(_0x3addac){_0x5c390c(_0xc3a897['error'](0x1f5,[_0x5ba28d['uniqueid'],_0x3addac[_0xf326('0x1b')][_0xf326('0x66')]()]['join']('\x20')));});}else{return _0x5c390c(_0xc3a897['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x2bd990){var _0x543689=this;return new Promise(function(_0x102d03,_0x37a564){if(ami[_0xf326('0x11')]()==![]){return _0x37a564(_0x543689[_0xf326('0x1d')](0x1f4,[config[_0xf326('0x12')]['ip'],config[_0xf326('0x12')]['username'],_0xf326('0x13')][_0xf326('0x14')]('\x20')));}var _0x5f1724=schema(properties['voicequeuechannelredirect'])[_0xf326('0x1')](_0x2bd990);if(_0x5f1724['length']>0x0){return _0x37a564(_0x543689[_0xf326('0x1d')](0x1f4,_[_0xf326('0x5d')](_0x5f1724,_0xf326('0x1b'))[_0xf326('0x14')](',\x20')));}var _0x19d676=_[_0xf326('0x56')](_0xf1c243[_0xf326('0x77')],{'uniqueid':_0x2bd990[_0xf326('0x61')]});if(_0x19d676&&_0x19d676[_0xf326('0x5e')]){return ami['Action']({'action':_0xf326('0x7b'),'channel':_0x19d676[_0xf326('0x5e')],'exten':_0x2bd990['exten'],'context':_0x2bd990[_0xf326('0x7c')]||_0x19d676['context'],'priority':0x1})[_0xf326('0x6f')](function(_0x34fe36){_0x102d03({'code':0xc8,'message':[_0x2bd990[_0xf326('0x61')],_0x34fe36['message'][_0xf326('0x66')]()][_0xf326('0x14')]('\x20')});})[_0xf326('0x1c')](function(_0x1de866){_0x37a564(_0x543689[_0xf326('0x1d')](0x1f5,[_0x2bd990[_0xf326('0x61')],_0x1de866[_0xf326('0x1b')][_0xf326('0x66')]()][_0xf326('0x14')]('\x20')));});}else{return _0x37a564(_0x543689[_0xf326('0x1d')](0x1f5,_0xf326('0x6d')));}});},'Agents':function(_0x32b2ea){return new Promise(function(_0x452e28,_0x3abcff){var _0x1f990d=_['values'](_0xf1c243[_0xf326('0xe')]);_0x452e28({'count':_0x1f990d[_0xf326('0x5a')],'rows':_0x1f990d});});},'Telephones':function(_0x4829ae){return new Promise(function(_0x438daa,_0x424be4){var _0x5c1686=_[_0xf326('0x58')](_0xf1c243[_0xf326('0x7d')]);_0x438daa({'count':_0x5c1686[_0xf326('0x5a')],'rows':_0x5c1686});});},'Trunks':function(_0x8dbd96){return new Promise(function(_0x2ab607,_0x35c228){var _0x1bb7cc=_['values'](_0xf1c243[_0xf326('0x7e')]);_0x2ab607({'count':_0x1bb7cc[_0xf326('0x5a')],'rows':_0x1bb7cc});});},'OutboundChannels':function(_0x323fb1){return new Promise(function(_0x3c33d1,_0x316c8e){var _0x1d50e2=_[_0xf326('0x58')](_0xf1c243[_0xf326('0x7f')]);_0x3c33d1({'count':_0x1d50e2['length'],'rows':_0x1d50e2});});},'Outbound':function(_0xa8e05b){return new Promise(function(_0x2e2103,_0x49c3da){_0x2e2103(_0xf1c243[_0xf326('0x2c')]);});},'Campaigns':function(_0x4b2295){return new Promise(function(_0x2be05a,_0x24a08e){var _0x16bc97=_[_0xf326('0x58')](_0xf1c243[_0xf326('0x80')]);_0x2be05a({'count':_0x16bc97[_0xf326('0x5a')],'rows':_0x16bc97});});},'VoiceQueuesPreview':function(_0xf66b70){var _0x1eb29d=this;return new Promise(function(_0x3afd5e,_0x13e03b){_0x1b5a56[_0xf326('0x81')](_0xf66b70['id'])[_0xf326('0x6f')](function(_0x3d0c8b){_0x3afd5e({'code':0xc8,'message':_0x3d0c8b[_0xf326('0x1b')]});})['catch'](function(_0x2bb6f0){_0x13e03b(_0x1eb29d[_0xf326('0x1d')](0x1f4,_0x2bb6f0[_0xf326('0x1b')]));});});},'EventManager':function(_0x3d3bd4){var _0xdb2ad8=this;return new Promise(function(_0x550f34,_0x1ec128){if(!_0x3d3bd4[_0xf326('0x82')]){return _0x1ec128(_0xdb2ad8[_0xf326('0x1d')](0x1f4,_0xf326('0x83')));}ami[_0xf326('0x84')]('custom:'+_0x3d3bd4['event'],_0x3d3bd4[_0xf326('0x1b')]);_0x550f34({'code':0xc8,'message':_0x3d3bd4});});},'FaxAccounts':function(_0x47c347){return new Promise(function(_0xedbcf2,_0x143965){var _0x29610a=_['values'](_0xf1c243['faxAccounts']);_0xedbcf2({'count':_0x29610a[_0xf326('0x5a')],'rows':_0x29610a});});},'SendFax':function(_0x2d92e4){var _0x167ac9=this;return new Promise(function(_0x34870c,_0x40230c){_0x3ace29['send'](_0x2d92e4)[_0xf326('0x6f')](function(_0x428eae){_0x34870c({'code':0xc8,'message':_0x428eae[_0xf326('0x1b')]});})['catch'](function(_0x4cc620){_0x40230c(_0x167ac9['error'](0x1f4,_0x4cc620[_0xf326('0x1b')]));});});},'CheckAfterSend':function(_0x17c96c){var _0x2d275d=this;return new Promise(function(_0x30922e,_0x58ef98){_0x3ace29[_0xf326('0x85')](_0x17c96c)[_0xf326('0x6f')](function(_0x598a93){_0x30922e({'code':0xc8,'message':_0x598a93['message']});})[_0xf326('0x1c')](function(_0x228c81){_0x58ef98(_0x2d275d[_0xf326('0x1d')](0x1f4,_0x228c81['message']));});});}};var _0xd85b34=jayson[_0xf326('0x86')](_0x3851eb)[_0xf326('0x87')]();_0xd85b34['on']('error',function(_0x39d16d){return _0x3c254d(_0x39d16d);});_0xd85b34[_0xf326('0x7')](0x232a,_0xf326('0x88'),function(){console[_0xf326('0x89')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x4c2249('RPC\x20listening\x20on\x20port:'+0x232a);});});};
\ No newline at end of file
index 0b69b62..203a5c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['<unknown>','Unknown','destcalleridname','createContact','[CM][%s][%s]\x20Contact\x20created:%s','destcalleridnum','push','format','name','trigger:%s','action','merge','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','socket.io-emitter','info','[CM][%s][%s]','stringify','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','map','routeId','firstName','lastName','mobile','createdAt','scheduledAt','updatedAt','union','resolve','then','getContacts','length','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','[CM][%s][%s]\x20Contact\x20not\x20found','data4','calleridnum','calleridname'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x9c44,0x178));var _0x49c4=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x9c44[_0x422905];return _0x33dc6c;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var Redis=require(_0x49c4('0x0'));var util=require(_0x49c4('0x1'));var config=require(_0x49c4('0x2'));var logger=require(_0x49c4('0x3'))(_0x49c4('0x4'));var cmContactRpc=require(_0x49c4('0x5'));config['redis']=_['defaults'](config[_0x49c4('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x49c4('0x7'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x69bc41,_0x2c4e2e,_0x436234,_0x511d53,_0x11c586){logger[_0x49c4('0x8')](_0x49c4('0x9'),_0x69bc41,_0x2c4e2e['id'],_0x436234,_0x511d53,JSON[_0x49c4('0xa')](_0x11c586));io['to'](_0x436234)['emit'](_0x511d53,_0x11c586);}exports['exec']=function(_0x451ea6,_0x313e73,_0x58cad7,_0xb611a1){var _0x459d09,_0x4adb3c;var _0x536d42={};var _0x1d19bf=Number(_0x58cad7[_0x49c4('0xb')]);var _0x5487cd=_0x58cad7[_0x49c4('0xc')]?Boolean(Number(_0x58cad7[_0x49c4('0xc')])):![];var _0x5f2fd9;var _0x1909fe=![];if(!_[_0x49c4('0xd')](_0x58cad7[_0x49c4('0xe')])){if(_0x58cad7[_0x49c4('0xe')]=='1')_0x1909fe=!![];}if(!_0x1909fe){if(_0xb611a1[_0x49c4('0xf')]){_0x536d42['id']=_0xb611a1[_0x49c4('0xf')];}}if(!_0x536d42['id']){_0x536d42[_0x49c4('0x10')]=_0x1d19bf;_0x5f2fd9=_0x58cad7[_0x49c4('0x11')]&&_0x58cad7['data3']!=='0'?_0x58cad7[_0x49c4('0x11')][_0x49c4('0x12')](','):[_0x49c4('0x13')];_0x536d42[_0x49c4('0x14')]=_[_0x49c4('0x15')](_0x5f2fd9,function(_0x53e3a2){var _0x44e607={};_0x44e607[_0x53e3a2]=_0xb611a1[_0x49c4('0x16')]?_0xb611a1['destcalleridnum']:_0xb611a1['calleridnum'];return _0x44e607;});}var _0x3c782d=['id',_0x49c4('0x17'),_0x49c4('0x18'),'phone',_0x49c4('0x19'),'fax',_0x49c4('0x10'),_0x49c4('0x1a'),_0x49c4('0x1b'),_0x49c4('0x1c')];var _0x382040=_[_0x49c4('0x1d')](_0x3c782d,_0x5f2fd9);BPromise[_0x49c4('0x1e')]()[_0x49c4('0x1f')](cmContactRpc[_0x49c4('0x20')]({'attributes':_0x382040,'where':_0x536d42}))['then'](function(_0x527126){_0x4adb3c=_0x527126;if(!_['isEmpty'](_0x4adb3c)){if(_0x4adb3c[_0x49c4('0x21')]===0x1){_0x459d09=_0x4adb3c[0x0];logger['info']('[CM][%s][%s]\x20Contact\x20found:%s',_0xb611a1[_0x49c4('0x22')],_0x313e73['id'],_0x459d09['id']);}else{logger[_0x49c4('0x8')](_0x49c4('0x23'),_0xb611a1[_0x49c4('0x22')],_0x313e73['id'],_['map'](_0x4adb3c,'id')['join'](','));}return;}else{logger[_0x49c4('0x8')](_0x49c4('0x24'),_0xb611a1['uniqueid'],_0x313e73['id']);var _0x207358={'ListId':_0x1d19bf};var _0x43e014=_0x58cad7[_0x49c4('0x25')]&&_0x58cad7[_0x49c4('0x25')]!=='0'?_0x58cad7['data4']:'phone';if(_0x5487cd){logger[_0x49c4('0x8')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0xb611a1[_0x49c4('0x22')],_0x313e73['id']);_0x207358[_0x43e014]=_[_0x49c4('0xd')](_0xb611a1[_0x49c4('0x16')])?_0xb611a1[_0x49c4('0x26')]:_0xb611a1['destcalleridnum'];if(_[_0x49c4('0xd')](_0xb611a1[_0x49c4('0x16')])){_0x207358[_0x49c4('0x17')]=_0xb611a1[_0x49c4('0x27')]&&_0xb611a1[_0x49c4('0x27')]!==_0x49c4('0x28')?_0xb611a1[_0x49c4('0x27')]:_0x49c4('0x29');}else{_0x207358[_0x49c4('0x17')]=_0xb611a1[_0x49c4('0x2a')]&&_0xb611a1[_0x49c4('0x2a')]!=='<unknown>'?_0xb611a1['destcalleridname']:'Unknown';}return BPromise[_0x49c4('0x1e')]()[_0x49c4('0x1f')](cmContactRpc[_0x49c4('0x2b')](_0x207358))[_0x49c4('0x1f')](function(_0x28eb47){_0x459d09=_0x28eb47;_0x4adb3c['push'](_0x28eb47);if(_0x459d09){logger[_0x49c4('0x8')](_0x49c4('0x2c'),_0xb611a1[_0x49c4('0x22')],_0x313e73['id'],_0x459d09['id']);}return;});}else{logger[_0x49c4('0x8')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0xb611a1['uniqueid'],_0x313e73['id']);_0x207358[_0x43e014]=_[_0x49c4('0xd')](_0xb611a1[_0x49c4('0x16')])?_0xb611a1[_0x49c4('0x26')]:_0xb611a1[_0x49c4('0x2d')];if(_[_0x49c4('0xd')](_0xb611a1['routeId'])){_0x207358[_0x49c4('0x17')]=_0xb611a1[_0x49c4('0x27')]&&_0xb611a1[_0x49c4('0x27')]!=='<unknown>'?_0xb611a1['calleridname']:_0x49c4('0x29');}else{_0x207358[_0x49c4('0x17')]=_0xb611a1[_0x49c4('0x2a')]&&_0xb611a1[_0x49c4('0x2a')]!==_0x49c4('0x28')?_0xb611a1[_0x49c4('0x2a')]:_0x49c4('0x29');}_0x459d09=_0x207358;_0x4adb3c[_0x49c4('0x2e')](_0x207358);return;}}})[_0x49c4('0x1f')](function(){if(_0x451ea6){emit(_0xb611a1['uniqueid'],_0x313e73,util[_0x49c4('0x2f')]('user:%s',_0x451ea6[_0x49c4('0x30')]),util[_0x49c4('0x2f')](_0x49c4('0x31'),_0x58cad7[_0x49c4('0x32')]['toLowerCase']()),{'evt':_[_0x49c4('0x33')](_0xb611a1,{'autoCreate':_0x5487cd}),'contact':_0x459d09===undefined?{}:_0x459d09,'contacts':_0x4adb3c[_0x49c4('0x21')]===0x0?undefined:_0x4adb3c});}});};
\ No newline at end of file
+var _0xed1f=['trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','emit','exec','data1','data2','isNil','data5','ListId','data3','phone','map','routeId','destcalleridnum','lastName','mobile','fax','createdAt','scheduledAt','union','resolve','then','isEmpty','length','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','firstName','calleridname','Unknown','destcalleridname','<unknown>','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','trigger:%s','action','toLowerCase','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger'];(function(_0x477557,_0x50b9a5){var _0x5ab099=function(_0x50f332){while(--_0x50f332){_0x477557['push'](_0x477557['shift']());}};_0x5ab099(++_0x50b9a5);}(_0xed1f,0x6a));var _0xfed1=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0xed1f[_0x24f31b];return _0x488401;};'use strict';var _=require(_0xfed1('0x0'));var BPromise=require(_0xfed1('0x1'));var Redis=require(_0xfed1('0x2'));var util=require(_0xfed1('0x3'));var config=require(_0xfed1('0x4'));var logger=require(_0xfed1('0x5'))(_0xfed1('0x6'));var cmContactRpc=require(_0xfed1('0x7'));config[_0xfed1('0x8')]=_[_0xfed1('0x9')](config[_0xfed1('0x8')],{'host':_0xfed1('0xa'),'port':0x18eb});var io=require(_0xfed1('0xb'))(new Redis(config[_0xfed1('0x8')]));function emit(_0x380e18,_0x612b38,_0x2a6082,_0x2967ef,_0x568d48){logger[_0xfed1('0xc')](_0xfed1('0xd'),_0x380e18,_0x612b38['id'],_0x2a6082,_0x2967ef,JSON['stringify'](_0x568d48));io['to'](_0x2a6082)[_0xfed1('0xe')](_0x2967ef,_0x568d48);}exports[_0xfed1('0xf')]=function(_0x4a564e,_0x3ce017,_0x48c338,_0x1c3f40){var _0x234f4e,_0x4a8369;var _0x5c0b5f={};var _0x3d1891=Number(_0x48c338[_0xfed1('0x10')]);var _0x569a6e=_0x48c338[_0xfed1('0x11')]?Boolean(Number(_0x48c338['data2'])):![];var _0x529b3d;var _0x3f6555=![];if(!_[_0xfed1('0x12')](_0x48c338['data5'])){if(_0x48c338[_0xfed1('0x13')]=='1')_0x3f6555=!![];}if(!_0x3f6555){if(_0x1c3f40['xmd-contactid']){_0x5c0b5f['id']=_0x1c3f40['xmd-contactid'];}}if(!_0x5c0b5f['id']){_0x5c0b5f[_0xfed1('0x14')]=_0x3d1891;_0x529b3d=_0x48c338[_0xfed1('0x15')]&&_0x48c338[_0xfed1('0x15')]!=='0'?_0x48c338[_0xfed1('0x15')]['split'](','):[_0xfed1('0x16')];_0x5c0b5f['$or']=_[_0xfed1('0x17')](_0x529b3d,function(_0x29a32f){var _0x489a0f={};_0x489a0f[_0x29a32f]=_0x1c3f40[_0xfed1('0x18')]?_0x1c3f40[_0xfed1('0x19')]:_0x1c3f40['calleridnum'];return _0x489a0f;});}var _0x59509b=['id','firstName',_0xfed1('0x1a'),'phone',_0xfed1('0x1b'),_0xfed1('0x1c'),'ListId',_0xfed1('0x1d'),_0xfed1('0x1e'),'updatedAt'];var _0x3ce944=_[_0xfed1('0x1f')](_0x59509b,_0x529b3d);BPromise[_0xfed1('0x20')]()[_0xfed1('0x21')](cmContactRpc['getContacts']({'attributes':_0x3ce944,'where':_0x5c0b5f}))[_0xfed1('0x21')](function(_0x59333e){_0x4a8369=_0x59333e;if(!_[_0xfed1('0x22')](_0x4a8369)){if(_0x4a8369[_0xfed1('0x23')]===0x1){_0x234f4e=_0x4a8369[0x0];logger[_0xfed1('0xc')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x1c3f40[_0xfed1('0x24')],_0x3ce017['id'],_0x234f4e['id']);}else{logger['info'](_0xfed1('0x25'),_0x1c3f40[_0xfed1('0x24')],_0x3ce017['id'],_[_0xfed1('0x17')](_0x4a8369,'id')[_0xfed1('0x26')](','));}return;}else{logger[_0xfed1('0xc')](_0xfed1('0x27'),_0x1c3f40['uniqueid'],_0x3ce017['id']);var _0x465ce6={'ListId':_0x3d1891};var _0xcb1cdc=_0x48c338['data4']&&_0x48c338[_0xfed1('0x28')]!=='0'?_0x48c338[_0xfed1('0x28')]:_0xfed1('0x16');if(_0x569a6e){logger[_0xfed1('0xc')](_0xfed1('0x29'),_0x1c3f40[_0xfed1('0x24')],_0x3ce017['id']);_0x465ce6[_0xcb1cdc]=_['isNil'](_0x1c3f40[_0xfed1('0x18')])?_0x1c3f40['calleridnum']:_0x1c3f40[_0xfed1('0x19')];if(_['isNil'](_0x1c3f40['routeId'])){_0x465ce6[_0xfed1('0x2a')]=_0x1c3f40[_0xfed1('0x2b')]&&_0x1c3f40[_0xfed1('0x2b')]!=='<unknown>'?_0x1c3f40[_0xfed1('0x2b')]:_0xfed1('0x2c');}else{_0x465ce6[_0xfed1('0x2a')]=_0x1c3f40[_0xfed1('0x2d')]&&_0x1c3f40[_0xfed1('0x2d')]!==_0xfed1('0x2e')?_0x1c3f40['destcalleridname']:_0xfed1('0x2c');}return BPromise[_0xfed1('0x20')]()['then'](cmContactRpc['createContact'](_0x465ce6))[_0xfed1('0x21')](function(_0x2d10f5){_0x234f4e=_0x2d10f5;_0x4a8369[_0xfed1('0x2f')](_0x2d10f5);if(_0x234f4e){logger[_0xfed1('0xc')](_0xfed1('0x30'),_0x1c3f40['uniqueid'],_0x3ce017['id'],_0x234f4e['id']);}return;});}else{logger[_0xfed1('0xc')](_0xfed1('0x31'),_0x1c3f40[_0xfed1('0x24')],_0x3ce017['id']);_0x465ce6[_0xcb1cdc]=_[_0xfed1('0x12')](_0x1c3f40[_0xfed1('0x18')])?_0x1c3f40['calleridnum']:_0x1c3f40[_0xfed1('0x19')];if(_['isNil'](_0x1c3f40[_0xfed1('0x18')])){_0x465ce6[_0xfed1('0x2a')]=_0x1c3f40[_0xfed1('0x2b')]&&_0x1c3f40[_0xfed1('0x2b')]!==_0xfed1('0x2e')?_0x1c3f40[_0xfed1('0x2b')]:_0xfed1('0x2c');}else{_0x465ce6[_0xfed1('0x2a')]=_0x1c3f40['destcalleridname']&&_0x1c3f40[_0xfed1('0x2d')]!==_0xfed1('0x2e')?_0x1c3f40[_0xfed1('0x2d')]:_0xfed1('0x2c');}_0x234f4e=_0x465ce6;_0x4a8369['push'](_0x465ce6);return;}}})['then'](function(){if(_0x4a564e){emit(_0x1c3f40[_0xfed1('0x24')],_0x3ce017,util[_0xfed1('0x32')](_0xfed1('0x33'),_0x4a564e[_0xfed1('0x34')]),util[_0xfed1('0x32')](_0xfed1('0x35'),_0x48c338[_0xfed1('0x36')][_0xfed1('0x37')]()),{'evt':_['merge'](_0x1c3f40,{'autoCreate':_0x569a6e}),'contact':_0x234f4e===undefined?{}:_0x234f4e,'contacts':_0x4a8369['length']===0x0?undefined:_0x4a8369});}});};
\ No newline at end of file
index 3acf976..b37dd56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0650=['trigger','redis','localhost','socket.io-emitter','popup','winapp','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','salesforceAccounts','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:queuecallerabandon','custom:timeout','custom:dialconnect','syncAgentDial','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:outgoingmessage','custom:acceptmessage','custom:offlineMessage','emit','info','stringify','prototype','clone','motionChannel','undefined','voice','checkTriggers','triggers','status','checkTrigger','merge','variables','Actions','length','interface','action','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','data2','html','buildUri','isNil','data4','location','uriLocation','windowWidth','data5','800','600','data6','winApplication','render','winArguments','data3','format','user:%s','name','jscripty','trigger:%s','exec','integration','urlforward','script','parse','query','replace','channel','AllConditions','checkConditions','some','AnyConditions','field','chat','operator','value','ChatWebsiteId','AccountId','upperFirst','interaction','message','event','queue','agent','membername','lastevent','routeId','mailSubstatus','null','substatus','offlineMessage','created','exports','util','url','mustache','./urlforward','./cmContact','./script','../../../config/environment'];(function(_0x498020,_0x1e3b70){var _0x13e169=function(_0x128525){while(--_0x128525){_0x498020['push'](_0x498020['shift']());}};_0x13e169(++_0x1e3b70);}(_0x0650,0xed));var _0x0065=function(_0x56b5d1,_0x59be02){_0x56b5d1=_0x56b5d1-0x0;var _0x5bfe4a=_0x0650[_0x56b5d1];return _0x5bfe4a;};'use strict';var util=require(_0x0065('0x0'));var _=require('lodash');var url=require(_0x0065('0x1'));var Mustache=require(_0x0065('0x2'));var Redis=require('ioredis');var urlforward=require(_0x0065('0x3'));var integration=require('./integration');var cmContact=require(_0x0065('0x4'));var script=require(_0x0065('0x5'));var config=require(_0x0065('0x6'));var logger=require('../../../config/logger')(_0x0065('0x7'));var ami=require('../ami');config['redis']=_['defaults'](config[_0x0065('0x8')],{'host':_0x0065('0x9'),'port':0x18eb});var io=require(_0x0065('0xa'))(new Redis(config[_0x0065('0x8')]));var operators={'equals':function(_0x317492,_0x227196){return _0x317492==_0x227196;},'not_equals':function(_0x8974f,_0x3e96dd){return _0x8974f!=_0x3e96dd;}};var barAndWebActions=[_0x0065('0xb'),'url',_0x0065('0xc')];function Trigger(_0xda5ef2){this['triggers']=_0xda5ef2['triggers'];this['agents']=_0xda5ef2[_0x0065('0xd')];this[_0x0065('0xe')]=_0xda5ef2['voiceQueues'];this[_0x0065('0xf')]=_0xda5ef2[_0x0065('0xf')];this['voiceExtensions']=_0xda5ef2[_0x0065('0x10')];this[_0x0065('0x11')]=_0xda5ef2['zendeskAccounts'];this['freshdeskAccounts']=_0xda5ef2[_0x0065('0x12')];this['salesforceAccounts']=_0xda5ef2['salesforceAccounts'];this[_0x0065('0x13')]=_0xda5ef2['sugarcrmAccounts'];this[_0x0065('0x14')]=_0xda5ef2['zohoAccounts'];this[_0x0065('0x15')]=_0xda5ef2[_0x0065('0x15')];this[_0x0065('0x16')]=_0xda5ef2[_0x0065('0x16')];this[_0x0065('0x17')]=_0xda5ef2[_0x0065('0x17')];this[_0x0065('0x18')]=_0xda5ef2[_0x0065('0x18')];this['freshsalesAccounts']=_0xda5ef2[_0x0065('0x19')];this[_0x0065('0x1a')]={'zendesk':this['zendeskAccounts'],'salesforce':this[_0x0065('0x1b')],'freshdesk':this[_0x0065('0x12')],'sugarcrm':this[_0x0065('0x13')],'zoho':this[_0x0065('0x14')],'desk':this[_0x0065('0x15')],'vtiger':this[_0x0065('0x16')],'dynamics365':this[_0x0065('0x18')],'freshsales':this['freshsalesAccounts'],'servicenow':this['servicenowAccounts']};ami['on']('custom:agentcalled',this[_0x0065('0x1c')][_0x0065('0x1d')](this));ami['on']('custom:agentconnect',this[_0x0065('0x1c')]['bind'](this));ami['on'](_0x0065('0x1e'),this[_0x0065('0x1c')][_0x0065('0x1d')](this));ami['on'](_0x0065('0x1f'),this[_0x0065('0x1c')][_0x0065('0x1d')](this));ami['on'](_0x0065('0x20'),this['syncCustomEvent'][_0x0065('0x1d')](this));ami['on']('custom:agentnoanswer',this['syncCustomEvent'][_0x0065('0x1d')](this));ami['on']('custom:agentbusy',this[_0x0065('0x1c')][_0x0065('0x1d')](this));ami['on']('custom:agentcongestion',this[_0x0065('0x1c')]['bind'](this));ami['on']('custom:agentreject',this[_0x0065('0x1c')][_0x0065('0x1d')](this));ami['on']('custom:amd',this['syncCustomEvent']['bind'](this));ami['on'](_0x0065('0x21'),this[_0x0065('0x1c')][_0x0065('0x1d')](this));ami['on'](_0x0065('0x22'),this[_0x0065('0x1c')]['bind'](this));ami['on']('custom:dialbegin',this['syncAgentDial'][_0x0065('0x1d')](this));ami['on'](_0x0065('0x23'),this[_0x0065('0x24')]['bind'](this));ami['on'](_0x0065('0x25'),this[_0x0065('0x24')]['bind'](this));ami['on'](_0x0065('0x26'),this[_0x0065('0x1c')][_0x0065('0x1d')](this));ami['on'](_0x0065('0x27'),this[_0x0065('0x1c')][_0x0065('0x1d')](this));ami['on'](_0x0065('0x28'),this[_0x0065('0x1c')]['bind'](this));ami['on']('custom:incomingmessage',this['syncCustomEvent'][_0x0065('0x1d')](this));ami['on'](_0x0065('0x29'),this[_0x0065('0x1c')][_0x0065('0x1d')](this));ami['on'](_0x0065('0x2a'),this[_0x0065('0x1c')][_0x0065('0x1d')](this));ami['on']('custom:rejectmessage',this[_0x0065('0x1c')][_0x0065('0x1d')](this));ami['on'](_0x0065('0x2b'),this[_0x0065('0x1c')][_0x0065('0x1d')](this));}Trigger['prototype'][_0x0065('0x2c')]=function(_0x1a2540,_0x400c8b,_0x41be1b){logger[_0x0065('0x2d')](_0x1a2540,_0x400c8b,JSON[_0x0065('0x2e')](_0x41be1b));io['to'](_0x1a2540)[_0x0065('0x2c')](_0x400c8b,_0x41be1b);};Trigger[_0x0065('0x2f')][_0x0065('0x1c')]=function(_0x1305b2){var _0x582fbc=_[_0x0065('0x30')](_0x1305b2);if(typeof _0x582fbc[_0x0065('0x31')]===_0x0065('0x32')){_0x582fbc['motionChannel']=_0x0065('0x33');}this[_0x0065('0x34')](_0x582fbc);};Trigger[_0x0065('0x2f')][_0x0065('0x24')]=function(_0x1a9d59){if(this[_0x0065('0xd')][_0x1a9d59['interface']]){this[_0x0065('0x1c')](_0x1a9d59);}};Trigger[_0x0065('0x2f')][_0x0065('0x34')]=function(_0x4af6fc){var _0x3bb27b;for(var _0x59409c in this[_0x0065('0x35')]){if(this[_0x0065('0x35')]['hasOwnProperty'](_0x59409c)){if(this[_0x0065('0x35')][_0x59409c][_0x0065('0x36')]){_0x3bb27b=this[_0x0065('0x37')](this[_0x0065('0x35')][_0x59409c],_0x4af6fc);if(_0x3bb27b){_[_0x0065('0x38')](_0x4af6fc,_0x4af6fc[_0x0065('0x39')]);for(var _0x4d4c07=0x0,_0x41d2dc,_0x1dcd8e,_0x145336;_0x4d4c07<this[_0x0065('0x35')][_0x59409c][_0x0065('0x3a')][_0x0065('0x3b')];_0x4d4c07+=0x1){_0x41d2dc=this[_0x0065('0x35')][_0x59409c][_0x0065('0x3a')][_0x4d4c07];if(this[_0x0065('0xd')][_0x4af6fc[_0x0065('0x3c')]]){switch(_0x41d2dc[_0x0065('0x3d')][_0x0065('0x3e')]()){case _0x0065('0x3f'):break;case _0x0065('0x40'):case _0x0065('0x41'):var _0x1561f1={};switch(barAndWebActions[_0x41d2dc[_0x0065('0x42')]]){case _0x0065('0xb'):_0x1561f1[_0x0065('0x43')]=_0x41d2dc[_0x0065('0x44')];_0x1561f1[_0x0065('0x45')]=this[_0x0065('0xf')][_0x41d2dc[_0x0065('0x44')]]?Mustache['render'](this[_0x0065('0xf')][_0x41d2dc['data2']][_0x0065('0x45')],_0x4af6fc):'template\x20not\x20found';break;case _0x0065('0x1'):_0x1561f1['uri']=this[_0x0065('0x46')](_0x41d2dc[_0x0065('0x44')],_0x4af6fc,_[_0x0065('0x47')](_0x41d2dc['data3'])?!![]:parseInt(_0x41d2dc['data3'],0xa));if(_[_0x0065('0x47')](_0x41d2dc[_0x0065('0x48')])){_0x1561f1[_0x0065('0x49')]='0';}else{_0x1561f1[_0x0065('0x4a')]=_0x41d2dc['data4'];_0x1561f1[_0x0065('0x4b')]=_[_0x0065('0x47')](_0x41d2dc[_0x0065('0x4c')])?_0x0065('0x4d'):_0x41d2dc[_0x0065('0x4c')];_0x1561f1['windowHeight']=_[_0x0065('0x47')](_0x41d2dc['data6'])?_0x0065('0x4e'):_0x41d2dc[_0x0065('0x4f')];}break;case _0x0065('0xc'):_0x1561f1[_0x0065('0x50')]=_0x41d2dc['data2']?Mustache[_0x0065('0x51')](_0x41d2dc['data2'],_0x4af6fc):'';_0x1561f1[_0x0065('0x52')]=_0x41d2dc[_0x0065('0x53')]?Mustache[_0x0065('0x51')](_0x41d2dc[_0x0065('0x53')],_0x4af6fc):'';break;}this[_0x0065('0x2c')](util[_0x0065('0x54')](_0x0065('0x55'),this[_0x0065('0xd')][_0x4af6fc[_0x0065('0x3c')]][_0x0065('0x56')]),util[_0x0065('0x54')]('trigger:%s:%s',_0x41d2dc[_0x0065('0x3d')][_0x0065('0x3e')](),barAndWebActions[_0x41d2dc[_0x0065('0x42')]]),_[_0x0065('0x38')](_0x1561f1,_0x4af6fc));break;case _0x0065('0x57'):this[_0x0065('0x2c')](util[_0x0065('0x54')]('user:%s',this['agents'][_0x4af6fc[_0x0065('0x3c')]][_0x0065('0x56')]),util[_0x0065('0x54')](_0x0065('0x58'),_0x41d2dc[_0x0065('0x3d')][_0x0065('0x3e')]()),_[_0x0065('0x38')]({'ProjectId':parseInt(_0x41d2dc[_0x0065('0x42')],0xa)},_0x4af6fc));break;default:this[_0x0065('0x2c')](util[_0x0065('0x54')](_0x0065('0x55'),this[_0x0065('0xd')][_0x4af6fc[_0x0065('0x3c')]]['name']),util[_0x0065('0x54')](_0x0065('0x58'),_0x41d2dc['action'][_0x0065('0x3e')]()),_[_0x0065('0x38')]({},_0x41d2dc,_0x4af6fc));}}switch(_0x41d2dc[_0x0065('0x3d')]['toLowerCase']()){case _0x0065('0x3f'):cmContact[_0x0065('0x59')](this[_0x0065('0xd')][_0x4af6fc[_0x0065('0x3c')]],this['triggers'][_0x59409c],_0x41d2dc,_0x4af6fc);break;case _0x0065('0x5a'):integration[_0x0065('0x59')](_0x41d2dc,_0x4af6fc,this[_0x0065('0x1a')],this[_0x0065('0xd')][_0x4af6fc[_0x0065('0x3c')]],this[_0x0065('0xe')][_0x4af6fc['queue']],this[_0x0065('0x10')][_0x4af6fc['routeId']]);break;case _0x0065('0x5b'):urlforward['exec'](_0x41d2dc,_0x4af6fc);break;case _0x0065('0x5c'):script['exec'](_0x41d2dc,_0x4af6fc);break;}}}}}}};Trigger[_0x0065('0x2f')][_0x0065('0x46')]=function(_0x5d08b5,_0x576ad7,_0x2f82e8){var _0x215390=url[_0x0065('0x5d')](Mustache['render'](_0x5d08b5,_0x576ad7),!![]);if(_0x2f82e8){_[_0x0065('0x38')](_0x215390[_0x0065('0x5e')],_0x576ad7);}delete _0x215390['search'];var _0x56a293=url[_0x0065('0x54')](_0x215390);_0x56a293=_0x56a293[_0x0065('0x5f')](/\/\?/g,'?');return _0x56a293;};Trigger[_0x0065('0x2f')]['checkTrigger']=function(_0x13f2b7,_0x5bdf64){var _0xd2b25=!![];var _0x12aaf2=!![];var _0x5246f6=![];if(_0x13f2b7[_0x0065('0x60')]===_0x5bdf64[_0x0065('0x31')]){_0x5246f6=!![];}if(_0x13f2b7[_0x0065('0x61')][_0x0065('0x3b')]){_0xd2b25=_['every'](_0x13f2b7[_0x0065('0x61')],this[_0x0065('0x62')](_0x5bdf64,_0x13f2b7[_0x0065('0x60')]));}if(_0x13f2b7['AnyConditions']['length']){_0x12aaf2=_[_0x0065('0x63')](_0x13f2b7[_0x0065('0x64')],this['checkConditions'](_0x5bdf64,_0x13f2b7[_0x0065('0x60')]));}return _0x5246f6&&_0xd2b25&&_0x12aaf2;};Trigger[_0x0065('0x2f')][_0x0065('0x62')]=function(_0x43ab0a,_0x5a9c3a){return function(_0x273f55){switch(_0x273f55[_0x0065('0x65')]){case'account':if(_0x43ab0a[_0x0065('0x60')]===_0x5a9c3a){if(_0x5a9c3a===_0x0065('0x66')){return _0x43ab0a['ChatWebsiteId']?operators[_0x273f55[_0x0065('0x67')]](Number(_0x273f55[_0x0065('0x68')]),_0x43ab0a[_0x0065('0x69')]):![];}else{return _0x43ab0a[_['upperFirst'](_0x5a9c3a)+_0x0065('0x6a')]?operators[_0x273f55[_0x0065('0x67')]](Number(_0x273f55[_0x0065('0x68')]),_0x43ab0a[_[_0x0065('0x6b')](_0x5a9c3a)+_0x0065('0x6a')]):![];}}break;case _0x0065('0x6c'):case _0x0065('0x6d'):if(_0x43ab0a['channel']===_0x5a9c3a){return _0x43ab0a['event']?operators[_0x273f55[_0x0065('0x67')]](_0x273f55[_0x0065('0x68')],_0x43ab0a[_0x0065('0x6e')]):![];}break;case _0x0065('0x6f'):return _0x43ab0a['queue']?operators[_0x273f55['operator']](_0x273f55['value'],_0x43ab0a[_0x0065('0x6f')]):![];case _0x0065('0x70'):return _0x43ab0a[_0x0065('0x71')]?operators[_0x273f55['operator']](_0x273f55[_0x0065('0x68')],_0x43ab0a[_0x0065('0x71')]):![];case _0x0065('0x72'):return _0x43ab0a['lastevent']?operators[_0x273f55[_0x0065('0x67')]](_0x273f55[_0x0065('0x68')],_0x43ab0a[_0x0065('0x72')]):![];case'routeId':return _0x43ab0a[_0x0065('0x73')]?operators[_0x273f55['operator']](_0x273f55[_0x0065('0x68')],_0x43ab0a[_0x0065('0x73')]):![];case _0x0065('0x74'):if(_0x273f55[_0x0065('0x68')]===_0x0065('0x75'))_0x273f55[_0x0065('0x68')]=null;return typeof _0x43ab0a[_0x0065('0x76')]!==_0x0065('0x32')?operators[_0x273f55[_0x0065('0x67')]](_0x273f55[_0x0065('0x68')],_0x43ab0a['substatus']):![];case _0x0065('0x77'):if(_0x43ab0a[_0x0065('0x60')]===_0x5a9c3a){return _0x273f55[_0x0065('0x68')]===_0x0065('0x78')&&_0x273f55[_0x0065('0x67')]==='equals'?!![]:![];}break;}return![];};};module[_0x0065('0x79')]=Trigger;
\ No newline at end of file
+var _0x4e39=['message','event','agent','membername','lastevent','routeId','mailSubstatus','null','substatus','created','equals','exports','util','mustache','ioredis','./urlforward','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','localhost','socket.io-emitter','popup','url','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','custom:agentcalled','syncCustomEvent','custom:agentconnect','bind','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','custom:dialconnect','syncAgentDial','custom:dialend','custom:newinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','emit','info','stringify','prototype','clone','motionChannel','undefined','voice','checkTriggers','interface','hasOwnProperty','status','checkTrigger','merge','variables','Actions','length','action','motionbar','browser','data1','data2','html','template\x20not\x20found','uri','isNil','data3','location','uriLocation','data4','windowWidth','data5','800','windowHeight','data6','600','render','winArguments','format','toLowerCase','user:%s','name','trigger:%s','contactmanager','exec','integration','accounts','queue','urlforward','script','buildUri','parse','query','search','replace','channel','AllConditions','every','checkConditions','some','AnyConditions','field','chat','operator','value','ChatWebsiteId','upperFirst','AccountId','interaction'];(function(_0x2f7483,_0x2fcd34){var _0x20d790=function(_0x4a7fc2){while(--_0x4a7fc2){_0x2f7483['push'](_0x2f7483['shift']());}};_0x20d790(++_0x2fcd34);}(_0x4e39,0x95));var _0x94e3=function(_0x3616bb,_0x86fe00){_0x3616bb=_0x3616bb-0x0;var _0x1c0994=_0x4e39[_0x3616bb];return _0x1c0994;};'use strict';var util=require(_0x94e3('0x0'));var _=require('lodash');var url=require('url');var Mustache=require(_0x94e3('0x1'));var Redis=require(_0x94e3('0x2'));var urlforward=require(_0x94e3('0x3'));var integration=require(_0x94e3('0x4'));var cmContact=require(_0x94e3('0x5'));var script=require(_0x94e3('0x6'));var config=require(_0x94e3('0x7'));var logger=require(_0x94e3('0x8'))(_0x94e3('0x9'));var ami=require(_0x94e3('0xa'));config[_0x94e3('0xb')]=_[_0x94e3('0xc')](config['redis'],{'host':_0x94e3('0xd'),'port':0x18eb});var io=require(_0x94e3('0xe'))(new Redis(config[_0x94e3('0xb')]));var operators={'equals':function(_0x11835a,_0x23601b){return _0x11835a==_0x23601b;},'not_equals':function(_0x3035ed,_0x4e58a4){return _0x3035ed!=_0x4e58a4;}};var barAndWebActions=[_0x94e3('0xf'),_0x94e3('0x10'),_0x94e3('0x11')];function Trigger(_0x9b8b33){this[_0x94e3('0x12')]=_0x9b8b33['triggers'];this[_0x94e3('0x13')]=_0x9b8b33[_0x94e3('0x13')];this['voiceQueues']=_0x9b8b33[_0x94e3('0x14')];this['templates']=_0x9b8b33[_0x94e3('0x15')];this[_0x94e3('0x16')]=_0x9b8b33[_0x94e3('0x16')];this[_0x94e3('0x17')]=_0x9b8b33['zendeskAccounts'];this['freshdeskAccounts']=_0x9b8b33[_0x94e3('0x18')];this[_0x94e3('0x19')]=_0x9b8b33[_0x94e3('0x19')];this[_0x94e3('0x1a')]=_0x9b8b33[_0x94e3('0x1a')];this[_0x94e3('0x1b')]=_0x9b8b33[_0x94e3('0x1b')];this[_0x94e3('0x1c')]=_0x9b8b33[_0x94e3('0x1c')];this[_0x94e3('0x1d')]=_0x9b8b33[_0x94e3('0x1d')];this[_0x94e3('0x1e')]=_0x9b8b33[_0x94e3('0x1e')];this[_0x94e3('0x1f')]=_0x9b8b33[_0x94e3('0x1f')];this['freshsalesAccounts']=_0x9b8b33['freshsalesAccounts'];this['accounts']={'zendesk':this['zendeskAccounts'],'salesforce':this[_0x94e3('0x19')],'freshdesk':this[_0x94e3('0x18')],'sugarcrm':this[_0x94e3('0x1a')],'zoho':this[_0x94e3('0x1b')],'desk':this[_0x94e3('0x1c')],'vtiger':this[_0x94e3('0x1d')],'dynamics365':this[_0x94e3('0x1f')],'freshsales':this[_0x94e3('0x20')],'servicenow':this[_0x94e3('0x1e')]};ami['on'](_0x94e3('0x21'),this[_0x94e3('0x22')]['bind'](this));ami['on'](_0x94e3('0x23'),this[_0x94e3('0x22')][_0x94e3('0x24')](this));ami['on']('custom:agentringnoanswer',this['syncCustomEvent'][_0x94e3('0x24')](this));ami['on'](_0x94e3('0x25'),this[_0x94e3('0x22')][_0x94e3('0x24')](this));ami['on'](_0x94e3('0x26'),this[_0x94e3('0x22')]['bind'](this));ami['on'](_0x94e3('0x27'),this[_0x94e3('0x22')][_0x94e3('0x24')](this));ami['on']('custom:agentbusy',this['syncCustomEvent'][_0x94e3('0x24')](this));ami['on'](_0x94e3('0x28'),this[_0x94e3('0x22')][_0x94e3('0x24')](this));ami['on'](_0x94e3('0x29'),this[_0x94e3('0x22')]['bind'](this));ami['on'](_0x94e3('0x2a'),this[_0x94e3('0x22')][_0x94e3('0x24')](this));ami['on'](_0x94e3('0x2b'),this[_0x94e3('0x22')][_0x94e3('0x24')](this));ami['on'](_0x94e3('0x2c'),this[_0x94e3('0x22')][_0x94e3('0x24')](this));ami['on'](_0x94e3('0x2d'),this['syncAgentDial'][_0x94e3('0x24')](this));ami['on'](_0x94e3('0x2e'),this[_0x94e3('0x2f')][_0x94e3('0x24')](this));ami['on'](_0x94e3('0x30'),this[_0x94e3('0x2f')][_0x94e3('0x24')](this));ami['on'](_0x94e3('0x31'),this[_0x94e3('0x22')]['bind'](this));ami['on']('custom:closedinteraction',this[_0x94e3('0x22')][_0x94e3('0x24')](this));ami['on'](_0x94e3('0x32'),this['syncCustomEvent'][_0x94e3('0x24')](this));ami['on'](_0x94e3('0x33'),this[_0x94e3('0x22')][_0x94e3('0x24')](this));ami['on'](_0x94e3('0x34'),this[_0x94e3('0x22')]['bind'](this));ami['on'](_0x94e3('0x35'),this[_0x94e3('0x22')]['bind'](this));ami['on'](_0x94e3('0x36'),this[_0x94e3('0x22')][_0x94e3('0x24')](this));ami['on'](_0x94e3('0x37'),this[_0x94e3('0x22')]['bind'](this));}Trigger['prototype'][_0x94e3('0x38')]=function(_0x444cd7,_0xecbd7b,_0x5f1f38){logger[_0x94e3('0x39')](_0x444cd7,_0xecbd7b,JSON[_0x94e3('0x3a')](_0x5f1f38));io['to'](_0x444cd7)[_0x94e3('0x38')](_0xecbd7b,_0x5f1f38);};Trigger[_0x94e3('0x3b')][_0x94e3('0x22')]=function(_0x59824c){var _0xd9fb4d=_[_0x94e3('0x3c')](_0x59824c);if(typeof _0xd9fb4d[_0x94e3('0x3d')]===_0x94e3('0x3e')){_0xd9fb4d['motionChannel']=_0x94e3('0x3f');}this[_0x94e3('0x40')](_0xd9fb4d);};Trigger[_0x94e3('0x3b')][_0x94e3('0x2f')]=function(_0x5c3612){if(this['agents'][_0x5c3612[_0x94e3('0x41')]]){this[_0x94e3('0x22')](_0x5c3612);}};Trigger[_0x94e3('0x3b')][_0x94e3('0x40')]=function(_0x4555cd){var _0x51ae0e;for(var _0x171b74 in this['triggers']){if(this['triggers'][_0x94e3('0x42')](_0x171b74)){if(this[_0x94e3('0x12')][_0x171b74][_0x94e3('0x43')]){_0x51ae0e=this[_0x94e3('0x44')](this[_0x94e3('0x12')][_0x171b74],_0x4555cd);if(_0x51ae0e){_[_0x94e3('0x45')](_0x4555cd,_0x4555cd[_0x94e3('0x46')]);for(var _0x3a3a5b=0x0,_0x18487b,_0x391f68,_0x49f59b;_0x3a3a5b<this[_0x94e3('0x12')][_0x171b74][_0x94e3('0x47')][_0x94e3('0x48')];_0x3a3a5b+=0x1){_0x18487b=this['triggers'][_0x171b74]['Actions'][_0x3a3a5b];if(this[_0x94e3('0x13')][_0x4555cd[_0x94e3('0x41')]]){switch(_0x18487b[_0x94e3('0x49')]['toLowerCase']()){case'contactmanager':break;case _0x94e3('0x4a'):case _0x94e3('0x4b'):var _0x19cb3a={};switch(barAndWebActions[_0x18487b[_0x94e3('0x4c')]]){case _0x94e3('0xf'):_0x19cb3a['TemplateId']=_0x18487b[_0x94e3('0x4d')];_0x19cb3a['html']=this['templates'][_0x18487b[_0x94e3('0x4d')]]?Mustache['render'](this[_0x94e3('0x15')][_0x18487b[_0x94e3('0x4d')]][_0x94e3('0x4e')],_0x4555cd):_0x94e3('0x4f');break;case'url':_0x19cb3a[_0x94e3('0x50')]=this['buildUri'](_0x18487b['data2'],_0x4555cd,_[_0x94e3('0x51')](_0x18487b[_0x94e3('0x52')])?!![]:parseInt(_0x18487b[_0x94e3('0x52')],0xa));if(_[_0x94e3('0x51')](_0x18487b['data4'])){_0x19cb3a[_0x94e3('0x53')]='0';}else{_0x19cb3a[_0x94e3('0x54')]=_0x18487b[_0x94e3('0x55')];_0x19cb3a[_0x94e3('0x56')]=_[_0x94e3('0x51')](_0x18487b[_0x94e3('0x57')])?_0x94e3('0x58'):_0x18487b[_0x94e3('0x57')];_0x19cb3a[_0x94e3('0x59')]=_[_0x94e3('0x51')](_0x18487b[_0x94e3('0x5a')])?_0x94e3('0x5b'):_0x18487b[_0x94e3('0x5a')];}break;case'winapp':_0x19cb3a['winApplication']=_0x18487b['data2']?Mustache[_0x94e3('0x5c')](_0x18487b[_0x94e3('0x4d')],_0x4555cd):'';_0x19cb3a[_0x94e3('0x5d')]=_0x18487b[_0x94e3('0x52')]?Mustache['render'](_0x18487b[_0x94e3('0x52')],_0x4555cd):'';break;}this[_0x94e3('0x38')](util[_0x94e3('0x5e')]('user:%s',this['agents'][_0x4555cd[_0x94e3('0x41')]]['name']),util[_0x94e3('0x5e')]('trigger:%s:%s',_0x18487b[_0x94e3('0x49')][_0x94e3('0x5f')](),barAndWebActions[_0x18487b[_0x94e3('0x4c')]]),_[_0x94e3('0x45')](_0x19cb3a,_0x4555cd));break;case'jscripty':this[_0x94e3('0x38')](util[_0x94e3('0x5e')](_0x94e3('0x60'),this[_0x94e3('0x13')][_0x4555cd[_0x94e3('0x41')]][_0x94e3('0x61')]),util['format'](_0x94e3('0x62'),_0x18487b[_0x94e3('0x49')][_0x94e3('0x5f')]()),_[_0x94e3('0x45')]({'ProjectId':parseInt(_0x18487b[_0x94e3('0x4c')],0xa)},_0x4555cd));break;default:this[_0x94e3('0x38')](util['format']('user:%s',this['agents'][_0x4555cd[_0x94e3('0x41')]][_0x94e3('0x61')]),util[_0x94e3('0x5e')](_0x94e3('0x62'),_0x18487b[_0x94e3('0x49')]['toLowerCase']()),_[_0x94e3('0x45')]({},_0x18487b,_0x4555cd));}}switch(_0x18487b[_0x94e3('0x49')][_0x94e3('0x5f')]()){case _0x94e3('0x63'):cmContact[_0x94e3('0x64')](this[_0x94e3('0x13')][_0x4555cd[_0x94e3('0x41')]],this[_0x94e3('0x12')][_0x171b74],_0x18487b,_0x4555cd);break;case _0x94e3('0x65'):integration[_0x94e3('0x64')](_0x18487b,_0x4555cd,this[_0x94e3('0x66')],this[_0x94e3('0x13')][_0x4555cd[_0x94e3('0x41')]],this[_0x94e3('0x14')][_0x4555cd[_0x94e3('0x67')]],this['voiceExtensions'][_0x4555cd['routeId']]);break;case _0x94e3('0x68'):urlforward[_0x94e3('0x64')](_0x18487b,_0x4555cd);break;case _0x94e3('0x69'):script['exec'](_0x18487b,_0x4555cd);break;}}}}}}};Trigger[_0x94e3('0x3b')][_0x94e3('0x6a')]=function(_0x52d97e,_0x36b845,_0x45757e){var _0x3f4c08=url[_0x94e3('0x6b')](Mustache[_0x94e3('0x5c')](_0x52d97e,_0x36b845),!![]);if(_0x45757e){_['merge'](_0x3f4c08[_0x94e3('0x6c')],_0x36b845);}delete _0x3f4c08[_0x94e3('0x6d')];var _0x3c1a17=url['format'](_0x3f4c08);_0x3c1a17=_0x3c1a17[_0x94e3('0x6e')](/\/\?/g,'?');return _0x3c1a17;};Trigger['prototype'][_0x94e3('0x44')]=function(_0x1ca714,_0x38972c){var _0x18b573=!![];var _0x39601f=!![];var _0x2498d5=![];if(_0x1ca714[_0x94e3('0x6f')]===_0x38972c[_0x94e3('0x3d')]){_0x2498d5=!![];}if(_0x1ca714[_0x94e3('0x70')][_0x94e3('0x48')]){_0x18b573=_[_0x94e3('0x71')](_0x1ca714[_0x94e3('0x70')],this[_0x94e3('0x72')](_0x38972c,_0x1ca714[_0x94e3('0x6f')]));}if(_0x1ca714['AnyConditions']['length']){_0x39601f=_[_0x94e3('0x73')](_0x1ca714[_0x94e3('0x74')],this[_0x94e3('0x72')](_0x38972c,_0x1ca714[_0x94e3('0x6f')]));}return _0x2498d5&&_0x18b573&&_0x39601f;};Trigger[_0x94e3('0x3b')][_0x94e3('0x72')]=function(_0xf4bdca,_0x2f8e9d){return function(_0x5b5619){switch(_0x5b5619[_0x94e3('0x75')]){case'account':if(_0xf4bdca[_0x94e3('0x6f')]===_0x2f8e9d){if(_0x2f8e9d===_0x94e3('0x76')){return _0xf4bdca['ChatWebsiteId']?operators[_0x5b5619[_0x94e3('0x77')]](Number(_0x5b5619[_0x94e3('0x78')]),_0xf4bdca[_0x94e3('0x79')]):![];}else{return _0xf4bdca[_[_0x94e3('0x7a')](_0x2f8e9d)+_0x94e3('0x7b')]?operators[_0x5b5619['operator']](Number(_0x5b5619['value']),_0xf4bdca[_[_0x94e3('0x7a')](_0x2f8e9d)+_0x94e3('0x7b')]):![];}}break;case _0x94e3('0x7c'):case _0x94e3('0x7d'):if(_0xf4bdca[_0x94e3('0x6f')]===_0x2f8e9d){return _0xf4bdca['event']?operators[_0x5b5619[_0x94e3('0x77')]](_0x5b5619[_0x94e3('0x78')],_0xf4bdca[_0x94e3('0x7e')]):![];}break;case _0x94e3('0x67'):return _0xf4bdca[_0x94e3('0x67')]?operators[_0x5b5619[_0x94e3('0x77')]](_0x5b5619[_0x94e3('0x78')],_0xf4bdca['queue']):![];case _0x94e3('0x7f'):return _0xf4bdca['membername']?operators[_0x5b5619['operator']](_0x5b5619['value'],_0xf4bdca[_0x94e3('0x80')]):![];case'lastevent':return _0xf4bdca[_0x94e3('0x81')]?operators[_0x5b5619['operator']](_0x5b5619[_0x94e3('0x78')],_0xf4bdca['lastevent']):![];case _0x94e3('0x82'):return _0xf4bdca['routeId']?operators[_0x5b5619[_0x94e3('0x77')]](_0x5b5619['value'],_0xf4bdca[_0x94e3('0x82')]):![];case _0x94e3('0x83'):if(_0x5b5619[_0x94e3('0x78')]===_0x94e3('0x84'))_0x5b5619['value']=null;return typeof _0xf4bdca[_0x94e3('0x85')]!==_0x94e3('0x3e')?operators[_0x5b5619[_0x94e3('0x77')]](_0x5b5619['value'],_0xf4bdca['substatus']):![];case'offlineMessage':if(_0xf4bdca['channel']===_0x2f8e9d){return _0x5b5619[_0x94e3('0x78')]===_0x94e3('0x86')&&_0x5b5619[_0x94e3('0x77')]===_0x94e3('0x87')?!![]:![];}break;}return![];};};module[_0x94e3('0x88')]=Trigger;
\ No newline at end of file
index 8eb6933..f5e3a49 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x520add,_0x2e80ca){var _0x48de65=function(_0x13e30e){while(--_0x13e30e){_0x520add['push'](_0x520add['shift']());}};_0x48de65(++_0x2e80ca);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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
+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(_0x43417d,_0x429dfa){var _0x477948=function(_0x432565){while(--_0x432565){_0x43417d['push'](_0x43417d['shift']());}};_0x477948(++_0x429dfa);}(_0x7217,0x19e));var _0x7721=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x7217[_0x5ddb1c];return _0x354adc;};'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
index 0704982..bd2bc46 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3929=['[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','lodash','request-promise','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','data7','data2','resolve','POST','clientId','username','password','clientSecret','then','access_token','error','toUpperCase',']\x20Wrong\x20credentials!','GET','Bearer\x20','4.0','value','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','catch','message','outbound','destcalleridnum','calleridnum','/systemusers(','headers','odata-entityid','substring','lastIndexOf','toLowerCase','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','telephone1','enduserId','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','picklist','type','customField','idField','indexOf','ticketType','incidents','assign','Subjects','getString','Fields','queue','/contacts(','callDirection','phonecalls','Descriptions','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3929,0xdc));var _0x9392=function(_0x4766d1,_0x4c5fe6){_0x4766d1=_0x4766d1-0x0;var _0x42d22b=_0x3929[_0x4766d1];return _0x42d22b;};'use strict';var _=require(_0x9392('0x0'));var rp=require(_0x9392('0x1'));var util=require('util');var intUtil=require('./util');var md5=require(_0x9392('0x2'));var Redis=require(_0x9392('0x3'));var logger=require(_0x9392('0x4'))(_0x9392('0x5'));var config=require(_0x9392('0x6'));config[_0x9392('0x7')]=_[_0x9392('0x8')](config[_0x9392('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x9392('0x9'))(new Redis(config[_0x9392('0x7')]));function getAuthToken(_0x2f9966,_0x341ea6,_0x28ab57){if(_0x2f9966[_0x9392('0xa')]){_0x2f9966[_0x9392('0xb')]=_0x2f9966[_0x9392('0xc')][_0x9392('0xd')];_0x2f9966['tenantId']=_0x2f9966[_0x9392('0xc')][_0x9392('0xe')];return Promise[_0x9392('0xf')](_0x2f9966['CloudProvider']['data5']);}var _0x4533bd={'method':_0x9392('0x10'),'uri':_0x341ea6,'form':{'client_id':_0x2f9966[_0x9392('0x11')],'resource':_0x2f9966[_0x9392('0xb')],'username':_0x2f9966[_0x9392('0x12')],'password':_0x2f9966[_0x9392('0x13')],'grant_type':'password','client_secret':_0x2f9966[_0x9392('0x14')]},'json':!![]};return rp(_0x4533bd)[_0x9392('0x15')](function(_0x2e5c77){return _0x2e5c77[_0x9392('0x16')];})['catch'](function(_0x5d7c71){logger[_0x9392('0x17')]('['+[_0x28ab57[_0x9392('0x18')]()]+_0x9392('0x19'));return _0x5d7c71['message'];});}function getUser(_0x1987b2,_0x2b266f,_0x422436,_0x487f3b,_0x2fb996,_0x450843){return new Promise(function(_0x5d70ac,_0x49e351){return getAuthToken(_0x2b266f,_0x487f3b,_0x450843)[_0x9392('0x15')](function(_0x33bd0c){var _0x16543a={'method':_0x9392('0x1a'),'uri':_0x2fb996+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x9392('0x1b')+_0x33bd0c,'OData-Version':_0x9392('0x1c')},'json':!![]};return rp(_0x16543a);})['then'](function(_0x416e07){var _0x35da54=_0x416e07[_0x9392('0x1d')];var _0x3165da=![];var _0x3004c9=null;if(!_['isNil'](_0x422436)){if(intUtil['validateEmail'](_0x422436[_0x9392('0x1e')])){_0x1987b2[_0x9392('0x1f')]=_0x422436[_0x9392('0x1e')];for(_0x3004c9=0x0;_0x3004c9<_0x35da54[_0x9392('0x20')];_0x3004c9++){if(_0x35da54[_0x3004c9][_0x9392('0x21')]===_0x422436[_0x9392('0x1e')]&&!_0x35da54[_0x3004c9][_0x9392('0x22')]){_0x3165da=!![];logger[_0x9392('0x23')]('['+[_0x450843[_0x9392('0x18')]()]+_0x9392('0x24')+_0x35da54[_0x3004c9][_0x9392('0x25')]+'!');_0x1987b2['userId']=_0x35da54[_0x3004c9][_0x9392('0x25')];}}}}if(!_0x3165da){logger['info']('['+[_0x450843['toUpperCase']()]+_0x9392('0x26'));_0x1987b2['userEmail']=_0x2b266f[_0x9392('0x12')];for(_0x3004c9=0x0;_0x3004c9<_0x35da54[_0x9392('0x20')];_0x3004c9++){if(_0x35da54[_0x3004c9][_0x9392('0x21')]===_0x2b266f[_0x9392('0x12')]){_0x1987b2[_0x9392('0x27')]=_0x35da54[_0x3004c9][_0x9392('0x25')];}}}_0x5d70ac(_0x1987b2);})[_0x9392('0x28')](function(_0xb38cda){_0x49e351(_0xb38cda[_0x9392('0x29')]);});});}function createEndUser(_0x1a9fb8,_0x818dae,_0x408fd6,_0x5179d7,_0x2801f5,_0x59f072){return new Promise(function(_0x1500f7,_0x4c20e6){return getAuthToken(_0x818dae,_0x408fd6,_0x59f072)[_0x9392('0x15')](function(_0x59474a){var _0xf6247=_0x59f072['toLowerCase']()===_0x9392('0x2a')?_0x2801f5[_0x9392('0x2b')]:_0x2801f5[_0x9392('0x2c')];var _0x5d25c8={'method':_0x9392('0x10'),'uri':_0x5179d7+'contacts','body':{'telephone1':_0xf6247,'fullname':_0xf6247,'firstname':_0xf6247,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x9392('0x2d')+_0x1a9fb8[_0x9392('0x27')]+')'},'headers':{'Authorization':_0x9392('0x1b')+_0x59474a,'OData-Version':_0x9392('0x1c')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x5d25c8);})[_0x9392('0x15')](function(_0x4499e7){var _0x4db9c6=_0x4499e7[_0x9392('0x2e')][_0x9392('0x2f')];var _0x5dc68c=_0x4db9c6[_0x9392('0x30')](_0x4db9c6[_0x9392('0x31')]('(')+0x1,_0x4db9c6[_0x9392('0x31')](')'));_0x1a9fb8['enduserId']=_0x5dc68c;_0x1500f7(_0x1a9fb8);})[_0x9392('0x28')](function(_0x34916c){_0x4c20e6(_0x34916c['message']);});});}function getEndUser(_0x496e5d,_0x3f0a7a,_0x2c59b2,_0x33ef2b,_0xd82f96,_0x5bf554,_0x52e525){var _0x9d100b=_0x5bf554[_0x9392('0x32')]()===_0x9392('0x2a')?_0xd82f96['destcalleridnum']:_0xd82f96['calleridnum'];return getAuthToken(_0x3f0a7a,_0x2c59b2,_0x5bf554)[_0x9392('0x15')](function(_0x1139a7){var _0x465b36={'method':_0x9392('0x1a'),'uri':_0x33ef2b+_0x9392('0x33')+_0x9d100b[_0x9392('0x34')]('+',_0x9392('0x35'))+'\x27','headers':{'Authorization':_0x9392('0x1b')+_0x1139a7,'If-None-Match':null,'OData-Version':_0x9392('0x1c')},'json':!![]};return rp(_0x465b36);})['then'](function(_0x3bce7b){var _0x55f18e=![];if(!_0x3bce7b)return _0x55f18e;var _0x22ade3=_0x3bce7b[_0x9392('0x1d')];for(var _0x5d0540=0x0;_0x5d0540<_0x22ade3[_0x9392('0x20')];_0x5d0540++){if(_0x22ade3[_0x5d0540][_0x9392('0x36')]===_0x9d100b){_0x55f18e=!![];_0x496e5d[_0x9392('0x37')]=_0x22ade3[_0x5d0540][_0x9392('0x38')];}}return _0x55f18e;})[_0x9392('0x15')](function(_0x2eec28){if(_0x2eec28)return _0x496e5d;if(_0x52e525===_0x9392('0x39')){logger['info']('['+[_0x5bf554[_0x9392('0x18')]()]+_0x9392('0x3a'));return _0x496e5d;}return createEndUser(_0x496e5d,_0x3f0a7a,_0x2c59b2,_0x33ef2b,_0xd82f96,_0x5bf554)[_0x9392('0x15')](function(_0x1b4aed){logger[_0x9392('0x23')]('['+[_0x5bf554[_0x9392('0x18')]()]+_0x9392('0x3b'),_0x1b4aed[_0x9392('0x37')]);return _0x1b4aed;});});}function getCustomFields(_0x18cc02,_0x539168,_0x4d55d9){var _0x4a1899={};if(_0x18cc02[_0x9392('0x20')]>0x0){_[_0x9392('0x3c')](_0x18cc02,function(_0x56d3f0){if(_[_0x9392('0x3d')](['string',_0x9392('0x3e')],_0x56d3f0[_0x9392('0x3f')])&&_0x56d3f0['nameField']&&!_0x56d3f0[_0x9392('0x40')]){var _0x278d55=_0x56d3f0[_0x9392('0x41')][_0x9392('0x32')]();var _0x1bad4d=_0x278d55[_0x9392('0x30')](0x0,_0x278d55[_0x9392('0x42')]('_'));var _0x582750=_0x278d55[_0x9392('0x30')](_0x278d55[_0x9392('0x42')]('_')+0x1);if(_0x1bad4d===_0x4d55d9){_0x4a1899[_0x582750]=_0x56d3f0['content'];}}});}return _0x4a1899;}function getTicket(_0x6f2308,_0x39b62e,_0x101c9d,_0x4e9adb,_0x559ac8,_0x5e12f9,_0x342c3f){return new Promise(function(_0x2549b1,_0x506d4e){var _0x5d638e;return getAuthToken(_0x39b62e,_0x101c9d,_0x342c3f)[_0x9392('0x15')](function(_0x5b75ff){if(_0x5e12f9[_0x9392('0x43')]==='incident'){_0x5d638e={'method':_0x9392('0x10'),'uri':_0x4e9adb+_0x9392('0x44'),'body':Object[_0x9392('0x45')]({},{'title':intUtil['getString'](_0x5e12f9[_0x9392('0x46')],_0x559ac8,'\x20'),'description':intUtil[_0x9392('0x47')](_0x5e12f9['Descriptions'],_0x559ac8,'\x0a'),'customerid_contact@odata.bind':_0x6f2308['enduserId']?'/contacts('+_0x6f2308[_0x9392('0x37')]+')':undefined,'ownerid@odata.bind':_0x9392('0x2d')+_0x6f2308[_0x9392('0x27')]+')','caseorigincode':'1'},getCustomFields(_0x5e12f9[_0x9392('0x48')],_0x559ac8,_0x5e12f9['ticketType'])),'headers':{'Authorization':_0x9392('0x1b')+_0x5b75ff,'OData-Version':_0x9392('0x1c')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x5e12f9[_0x9392('0x43')]==='phonecall'){var _0x2e005f=_0x6f2308[_0x9392('0x37')]?[{'partyid_systemuser@odata.bind':_0x9392('0x2d')+_0x6f2308['userId']+')','participationtypemask':_0x6f2308['callDirection']===_0x9392('0x49')?0x2:0x1},{'partyid_contact@odata.bind':_0x9392('0x4a')+_0x6f2308[_0x9392('0x37')]+')','participationtypemask':_0x6f2308[_0x9392('0x4b')]===_0x9392('0x49')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x6f2308[_0x9392('0x27')]+')','participationtypemask':_0x6f2308[_0x9392('0x4b')]===_0x9392('0x49')?0x2:0x1}];_0x5d638e={'method':_0x9392('0x10'),'uri':_0x4e9adb+_0x9392('0x4c'),'body':Object[_0x9392('0x45')]({},{'subject':intUtil['getString'](_0x5e12f9[_0x9392('0x46')],_0x559ac8,'\x20'),'phonenumber':String(_0x559ac8[_0x9392('0x2c')]),'description':intUtil[_0x9392('0x47')](_0x5e12f9[_0x9392('0x4d')],_0x559ac8,'\x0a'),'regardingobjectid_contact@odata.bind':_0x6f2308[_0x9392('0x37')]?_0x9392('0x4a')+_0x6f2308['enduserId']+')':undefined,'ownerid@odata.bind':_0x9392('0x2d')+_0x6f2308[_0x9392('0x27')]+')','directioncode':_0x6f2308[_0x9392('0x4b')]===_0x9392('0x49')?![]:!![],'phonecall_activity_parties':_0x2e005f},getCustomFields(_0x5e12f9[_0x9392('0x48')],_0x559ac8,_0x5e12f9[_0x9392('0x43')])),'headers':{'Authorization':_0x9392('0x1b')+_0x5b75ff,'OData-Version':_0x9392('0x1c')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x5d638e);})[_0x9392('0x15')](function(_0x326034){var _0x5c61e9=_0x326034[_0x9392('0x2e')]['odata-entityid'];var _0x1f8a24=_0x5c61e9[_0x9392('0x30')](_0x5c61e9['lastIndexOf']('(')+0x1,_0x5c61e9[_0x9392('0x31')](')'));_0x6f2308['ticketId']=_0x1f8a24;_0x2549b1(_0x6f2308);})[_0x9392('0x28')](function(_0x3c3783){_0x506d4e(_0x3c3783[_0x9392('0x29')]);});});}function emit(_0x1d0cd6,_0x3e3d16,_0x368359,_0x578e52){var _0xe0e493={'uri':util[_0x9392('0x4e')](_0x9392('0x4f'),_0x1d0cd6,_0x368359,_0x578e52)};io['to'](util[_0x9392('0x4e')]('user:%s',_0x3e3d16))[_0x9392('0x50')](_0x9392('0x51'),_0xe0e493);}exports['cs']=function(_0x1b7b5a,_0x4b2e16,_0x589ebb,_0x55d416,_0x2606b8,_0x253e54,_0x40a65f,_0x3bdaee){var _0x2af4a9={};_0x253e54[_0x9392('0xb')]=_0x253e54['modernAuthentication']?intUtil[_0x9392('0x52')](_0x253e54[_0x9392('0xc')][_0x9392('0xd')]):intUtil[_0x9392('0x52')](_0x253e54[_0x9392('0xb')]);_0x253e54[_0x9392('0x53')]=intUtil[_0x9392('0x52')](_0x253e54['serverUrl']);_0x2af4a9[_0x9392('0x4b')]=_0x3bdaee==='queue'||_0x3bdaee===_0x9392('0x54')?_0x9392('0x49'):_0x9392('0x2a');var _0x191124=_0x253e54[_0x9392('0xa')]?util[_0x9392('0x4e')](_0x9392('0x55'),_0x253e54[_0x9392('0xc')][_0x9392('0xd')]):util[_0x9392('0x4e')](_0x9392('0x55'),_0x253e54['remoteUri']);var _0x4b7fcf=util[_0x9392('0x4e')](_0x9392('0x56'),_0x253e54['tenantId']);var _0x2d09e1=util['format'](_0x9392('0x57'),_0x253e54[_0x9392('0x53')],_0x4b2e16[_0x9392('0x58')],md5(_0x4b2e16[_0x9392('0x58')]));if(_0x2606b8&&_0x2606b8['monitor_format']){logger[_0x9392('0x23')](_0x9392('0x59'),_0x9392('0x5a'));_0x4b2e16[_0x9392('0x5b')]=_0x2d09e1;}else if(_0x40a65f&&_0x40a65f[_0x9392('0x5c')]&&_0x40a65f[_0x9392('0x5c')]!==_0x9392('0x5d')){logger[_0x9392('0x23')](_0x9392('0x5e'),_0x9392('0x5a'));_0x4b2e16[_0x9392('0x5b')]=_0x2d09e1;}else{_0x4b2e16[_0x9392('0x5b')]='';}return getUser(_0x2af4a9,_0x253e54,_0x55d416,_0x4b7fcf,_0x191124,_0x3bdaee)[_0x9392('0x15')](function(_0xebabc7){logger[_0x9392('0x23')]('['+_0x3bdaee['toUpperCase']()+_0x9392('0x5f'),_0xebabc7[_0x9392('0x27')]);logger['info']('['+_0x3bdaee[_0x9392('0x18')]()+_0x9392('0x60'),_0xebabc7[_0x9392('0x1f')]);return getEndUser(_0xebabc7,_0x253e54,_0x4b7fcf,_0x191124,_0x4b2e16,_0x3bdaee,_0x589ebb[_0x9392('0x61')]);})[_0x9392('0x15')](function(_0x2f7a91){logger['info']('['+_0x3bdaee[_0x9392('0x18')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x2f7a91[_0x9392('0x37')]);logger['info']('['+_0x3bdaee[_0x9392('0x18')]()+_0x9392('0x62'),_0x4b2e16['calleridnum']);return getTicket(_0x2f7a91,_0x253e54,_0x4b7fcf,_0x191124,_0x4b2e16,_0x589ebb,_0x3bdaee);})[_0x9392('0x15')](function(_0x5dfd81){logger[_0x9392('0x23')](util[_0x9392('0x4e')]('['+_0x3bdaee[_0x9392('0x18')]()+_0x9392('0x63'),_0x589ebb[_0x9392('0x43')],_0x5dfd81['ticketId']));logger[_0x9392('0x23')](util[_0x9392('0x4e')]('['+_0x3bdaee['toUpperCase']()+_0x9392('0x64'),_0x3bdaee));if(_0x3bdaee!==_0x9392('0x54')){logger[_0x9392('0x23')]('['+_0x3bdaee[_0x9392('0x18')]()+']',_0x9392('0x65'));emit(_0x253e54[_0x9392('0xb')],_0x55d416[_0x9392('0x66')],_0x589ebb[_0x9392('0x43')],_0x5dfd81['ticketId']);}})[_0x9392('0x28')](function(_0x4412ed){logger[_0x9392('0x17')]('['+_0x3bdaee['toUpperCase']()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x4412ed[_0x9392('0x29')]);});};
\ No newline at end of file
+var _0x8923=['[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','request-promise','util','./util','ioredis','dynamics365','../../../../config/environment','redis','defaults','localhost','modernAuthentication','remoteUri','CloudProvider','data7','resolve','data5','POST','clientId','password','clientSecret','then','error','toUpperCase','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','email','userEmail','isdisabled',']\x20Agent\x20found\x20','userId','systemuserid','info','username','length','catch','outbound','destcalleridnum','/systemusers(','odata-entityid','lastIndexOf','enduserId','calleridnum','replace','%2b','telephone1','contactid',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','string','type','customField','idField','substring','indexOf','content','ticketType','incident','incidents','assign','getString','Descriptions','/contacts(','Fields','phonecall','callDirection','queue','phonecalls','Subjects','headers','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','monitor_format'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x8923,0x70));var _0x3892=function(_0x3b7ea8,_0x100250){_0x3b7ea8=_0x3b7ea8-0x0;var _0x406fda=_0x8923[_0x3b7ea8];return _0x406fda;};'use strict';var _=require('lodash');var rp=require(_0x3892('0x0'));var util=require(_0x3892('0x1'));var intUtil=require(_0x3892('0x2'));var md5=require('md5');var Redis=require(_0x3892('0x3'));var logger=require('../../../../config/logger')(_0x3892('0x4'));var config=require(_0x3892('0x5'));config[_0x3892('0x6')]=_[_0x3892('0x7')](config[_0x3892('0x6')],{'host':_0x3892('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3892('0x6')]));function getAuthToken(_0x2ba8e1,_0x42517f,_0x9b35ed){if(_0x2ba8e1[_0x3892('0x9')]){_0x2ba8e1[_0x3892('0xa')]=_0x2ba8e1[_0x3892('0xb')][_0x3892('0xc')];_0x2ba8e1['tenantId']=_0x2ba8e1[_0x3892('0xb')]['data2'];return Promise[_0x3892('0xd')](_0x2ba8e1[_0x3892('0xb')][_0x3892('0xe')]);}var _0x1279f5={'method':_0x3892('0xf'),'uri':_0x42517f,'form':{'client_id':_0x2ba8e1[_0x3892('0x10')],'resource':_0x2ba8e1[_0x3892('0xa')],'username':_0x2ba8e1['username'],'password':_0x2ba8e1['password'],'grant_type':_0x3892('0x11'),'client_secret':_0x2ba8e1[_0x3892('0x12')]},'json':!![]};return rp(_0x1279f5)[_0x3892('0x13')](function(_0x19d2f7){return _0x19d2f7['access_token'];})['catch'](function(_0x1cbb1d){logger[_0x3892('0x14')]('['+[_0x9b35ed[_0x3892('0x15')]()]+']\x20Wrong\x20credentials!');return _0x1cbb1d[_0x3892('0x16')];});}function getUser(_0x11169f,_0x508cfc,_0x59ff29,_0x226e14,_0x15ab22,_0x3a73c7){return new Promise(function(_0xd64164,_0x58ac86){return getAuthToken(_0x508cfc,_0x226e14,_0x3a73c7)[_0x3892('0x13')](function(_0x470530){var _0x31b997={'method':_0x3892('0x17'),'uri':_0x15ab22+_0x3892('0x18'),'headers':{'Authorization':_0x3892('0x19')+_0x470530,'OData-Version':_0x3892('0x1a')},'json':!![]};return rp(_0x31b997);})[_0x3892('0x13')](function(_0x1352c3){var _0x1258ed=_0x1352c3[_0x3892('0x1b')];var _0x3c5852=![];var _0x450730=null;if(!_['isNil'](_0x59ff29)){if(intUtil['validateEmail'](_0x59ff29[_0x3892('0x1c')])){_0x11169f[_0x3892('0x1d')]=_0x59ff29['email'];for(_0x450730=0x0;_0x450730<_0x1258ed['length'];_0x450730++){if(_0x1258ed[_0x450730]['internalemailaddress']===_0x59ff29[_0x3892('0x1c')]&&!_0x1258ed[_0x450730][_0x3892('0x1e')]){_0x3c5852=!![];logger['info']('['+[_0x3a73c7[_0x3892('0x15')]()]+_0x3892('0x1f')+_0x1258ed[_0x450730]['systemuserid']+'!');_0x11169f[_0x3892('0x20')]=_0x1258ed[_0x450730][_0x3892('0x21')];}}}}if(!_0x3c5852){logger[_0x3892('0x22')]('['+[_0x3a73c7[_0x3892('0x15')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x11169f[_0x3892('0x1d')]=_0x508cfc[_0x3892('0x23')];for(_0x450730=0x0;_0x450730<_0x1258ed[_0x3892('0x24')];_0x450730++){if(_0x1258ed[_0x450730]['internalemailaddress']===_0x508cfc[_0x3892('0x23')]){_0x11169f[_0x3892('0x20')]=_0x1258ed[_0x450730][_0x3892('0x21')];}}}_0xd64164(_0x11169f);})[_0x3892('0x25')](function(_0x50d916){_0x58ac86(_0x50d916[_0x3892('0x16')]);});});}function createEndUser(_0x37066a,_0xd0f480,_0xa7a157,_0x53e46e,_0x42aa69,_0x35e384){return new Promise(function(_0xfc9e18,_0x314b74){return getAuthToken(_0xd0f480,_0xa7a157,_0x35e384)['then'](function(_0x36790a){var _0x504888=_0x35e384['toLowerCase']()===_0x3892('0x26')?_0x42aa69[_0x3892('0x27')]:_0x42aa69['calleridnum'];var _0x43d184={'method':_0x3892('0xf'),'uri':_0x53e46e+'contacts','body':{'telephone1':_0x504888,'fullname':_0x504888,'firstname':_0x504888,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x3892('0x28')+_0x37066a['userId']+')'},'headers':{'Authorization':_0x3892('0x19')+_0x36790a,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x43d184);})[_0x3892('0x13')](function(_0x4fc476){var _0x108ef5=_0x4fc476['headers'][_0x3892('0x29')];var _0x403c46=_0x108ef5['substring'](_0x108ef5[_0x3892('0x2a')]('(')+0x1,_0x108ef5['lastIndexOf'](')'));_0x37066a[_0x3892('0x2b')]=_0x403c46;_0xfc9e18(_0x37066a);})['catch'](function(_0x149952){_0x314b74(_0x149952[_0x3892('0x16')]);});});}function getEndUser(_0x4ce533,_0x36f720,_0x4f62a4,_0x368fa4,_0x397d25,_0x56220c,_0x348b35){var _0xbb9819=_0x56220c['toLowerCase']()==='outbound'?_0x397d25[_0x3892('0x27')]:_0x397d25[_0x3892('0x2c')];return getAuthToken(_0x36f720,_0x4f62a4,_0x56220c)[_0x3892('0x13')](function(_0x3f0a3e){var _0x276e9a={'method':_0x3892('0x17'),'uri':_0x368fa4+'contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27'+_0xbb9819[_0x3892('0x2d')]('+',_0x3892('0x2e'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x3f0a3e,'If-None-Match':null,'OData-Version':_0x3892('0x1a')},'json':!![]};return rp(_0x276e9a);})['then'](function(_0x2f78f9){var _0x42fdec=![];if(!_0x2f78f9)return _0x42fdec;var _0x2970ee=_0x2f78f9['value'];for(var _0x479df7=0x0;_0x479df7<_0x2970ee[_0x3892('0x24')];_0x479df7++){if(_0x2970ee[_0x479df7][_0x3892('0x2f')]===_0xbb9819){_0x42fdec=!![];_0x4ce533[_0x3892('0x2b')]=_0x2970ee[_0x479df7][_0x3892('0x30')];}}return _0x42fdec;})[_0x3892('0x13')](function(_0x26a869){if(_0x26a869)return _0x4ce533;if(_0x348b35==='nothing'){logger[_0x3892('0x22')]('['+[_0x56220c[_0x3892('0x15')]()]+_0x3892('0x31'));return _0x4ce533;}return createEndUser(_0x4ce533,_0x36f720,_0x4f62a4,_0x368fa4,_0x397d25,_0x56220c)[_0x3892('0x13')](function(_0x242352){logger[_0x3892('0x22')]('['+[_0x56220c[_0x3892('0x15')]()]+_0x3892('0x32'),_0x242352[_0x3892('0x2b')]);return _0x242352;});});}function getCustomFields(_0x1e1031,_0x287ff0,_0x274dd4){var _0x46207c={};if(_0x1e1031['length']>0x0){_[_0x3892('0x33')](_0x1e1031,function(_0x12999a){if(_['includes']([_0x3892('0x34'),'picklist'],_0x12999a[_0x3892('0x35')])&&_0x12999a['nameField']&&!_0x12999a[_0x3892('0x36')]){var _0x4e329d=_0x12999a[_0x3892('0x37')]['toLowerCase']();var _0x19fef2=_0x4e329d[_0x3892('0x38')](0x0,_0x4e329d[_0x3892('0x39')]('_'));var _0x26999d=_0x4e329d[_0x3892('0x38')](_0x4e329d[_0x3892('0x39')]('_')+0x1);if(_0x19fef2===_0x274dd4){_0x46207c[_0x26999d]=_0x12999a[_0x3892('0x3a')];}}});}return _0x46207c;}function getTicket(_0x3cf639,_0x4becbb,_0x2a2173,_0x45410e,_0x3273ea,_0x37aef4,_0x2e3ed2){return new Promise(function(_0x1f4e46,_0x3975a4){var _0x3a538c;return getAuthToken(_0x4becbb,_0x2a2173,_0x2e3ed2)[_0x3892('0x13')](function(_0x229322){if(_0x37aef4[_0x3892('0x3b')]===_0x3892('0x3c')){_0x3a538c={'method':_0x3892('0xf'),'uri':_0x45410e+_0x3892('0x3d'),'body':Object[_0x3892('0x3e')]({},{'title':intUtil[_0x3892('0x3f')](_0x37aef4['Subjects'],_0x3273ea,'\x20'),'description':intUtil['getString'](_0x37aef4[_0x3892('0x40')],_0x3273ea,'\x0a'),'customerid_contact@odata.bind':_0x3cf639[_0x3892('0x2b')]?_0x3892('0x41')+_0x3cf639[_0x3892('0x2b')]+')':undefined,'ownerid@odata.bind':_0x3892('0x28')+_0x3cf639['userId']+')','caseorigincode':'1'},getCustomFields(_0x37aef4[_0x3892('0x42')],_0x3273ea,_0x37aef4[_0x3892('0x3b')])),'headers':{'Authorization':_0x3892('0x19')+_0x229322,'OData-Version':_0x3892('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x37aef4[_0x3892('0x3b')]===_0x3892('0x43')){var _0x4e4520=_0x3cf639[_0x3892('0x2b')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x3cf639['userId']+')','participationtypemask':_0x3cf639[_0x3892('0x44')]===_0x3892('0x45')?0x2:0x1},{'partyid_contact@odata.bind':_0x3892('0x41')+_0x3cf639[_0x3892('0x2b')]+')','participationtypemask':_0x3cf639['callDirection']==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x3892('0x28')+_0x3cf639[_0x3892('0x20')]+')','participationtypemask':_0x3cf639[_0x3892('0x44')]===_0x3892('0x45')?0x2:0x1}];_0x3a538c={'method':'POST','uri':_0x45410e+_0x3892('0x46'),'body':Object['assign']({},{'subject':intUtil[_0x3892('0x3f')](_0x37aef4[_0x3892('0x47')],_0x3273ea,'\x20'),'phonenumber':String(_0x3273ea[_0x3892('0x2c')]),'description':intUtil['getString'](_0x37aef4['Descriptions'],_0x3273ea,'\x0a'),'regardingobjectid_contact@odata.bind':_0x3cf639[_0x3892('0x2b')]?_0x3892('0x41')+_0x3cf639[_0x3892('0x2b')]+')':undefined,'ownerid@odata.bind':_0x3892('0x28')+_0x3cf639[_0x3892('0x20')]+')','directioncode':_0x3cf639[_0x3892('0x44')]===_0x3892('0x45')?![]:!![],'phonecall_activity_parties':_0x4e4520},getCustomFields(_0x37aef4[_0x3892('0x42')],_0x3273ea,_0x37aef4[_0x3892('0x3b')])),'headers':{'Authorization':_0x3892('0x19')+_0x229322,'OData-Version':_0x3892('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3a538c);})[_0x3892('0x13')](function(_0x4e980a){var _0x1bbe4f=_0x4e980a[_0x3892('0x48')]['odata-entityid'];var _0x44eea1=_0x1bbe4f[_0x3892('0x38')](_0x1bbe4f[_0x3892('0x2a')]('(')+0x1,_0x1bbe4f[_0x3892('0x2a')](')'));_0x3cf639['ticketId']=_0x44eea1;_0x1f4e46(_0x3cf639);})['catch'](function(_0x4405ba){_0x3975a4(_0x4405ba[_0x3892('0x16')]);});});}function emit(_0x3c5116,_0x3f39b6,_0x5eb8b8,_0x42d8a6){var _0x37af9e={'uri':util[_0x3892('0x49')](_0x3892('0x4a'),_0x3c5116,_0x5eb8b8,_0x42d8a6)};io['to'](util[_0x3892('0x49')](_0x3892('0x4b'),_0x3f39b6))[_0x3892('0x4c')](_0x3892('0x4d'),_0x37af9e);}exports['cs']=function(_0x4e4073,_0x3c8864,_0x24e3c7,_0x5b676e,_0x4fa665,_0x2520e5,_0x58fed8,_0x416cbd){var _0x51c4ea={};_0x2520e5[_0x3892('0xa')]=_0x2520e5[_0x3892('0x9')]?intUtil['stripTrailingSlash'](_0x2520e5[_0x3892('0xb')][_0x3892('0xc')]):intUtil[_0x3892('0x4e')](_0x2520e5['remoteUri']);_0x2520e5['serverUrl']=intUtil[_0x3892('0x4e')](_0x2520e5[_0x3892('0x4f')]);_0x51c4ea['callDirection']=_0x416cbd===_0x3892('0x45')||_0x416cbd===_0x3892('0x50')?_0x3892('0x45'):_0x3892('0x26');var _0x4755ce=_0x2520e5[_0x3892('0x9')]?util[_0x3892('0x49')]('%s/api/data/v9.0/',_0x2520e5[_0x3892('0xb')][_0x3892('0xc')]):util[_0x3892('0x49')](_0x3892('0x51'),_0x2520e5[_0x3892('0xa')]);var _0x1fbfd8=util[_0x3892('0x49')]('https://login.microsoftonline.com/%s/oauth2/token',_0x2520e5['tenantId']);var _0x479f5c=util[_0x3892('0x49')](_0x3892('0x52'),_0x2520e5[_0x3892('0x4f')],_0x3c8864['uniqueid'],md5(_0x3c8864['uniqueid']));if(_0x4fa665&&_0x4fa665[_0x3892('0x53')]){logger['info'](_0x3892('0x54'),_0x3892('0x55'));_0x3c8864[_0x3892('0x56')]=_0x479f5c;}else if(_0x58fed8&&_0x58fed8['recordingFormat']&&_0x58fed8[_0x3892('0x57')]!==_0x3892('0x58')){logger[_0x3892('0x22')](_0x3892('0x59'),_0x3892('0x55'));_0x3c8864['recordingURL']=_0x479f5c;}else{_0x3c8864[_0x3892('0x56')]='';}return getUser(_0x51c4ea,_0x2520e5,_0x5b676e,_0x1fbfd8,_0x4755ce,_0x416cbd)[_0x3892('0x13')](function(_0x5b0579){logger[_0x3892('0x22')]('['+_0x416cbd['toUpperCase']()+_0x3892('0x5a'),_0x5b0579[_0x3892('0x20')]);logger[_0x3892('0x22')]('['+_0x416cbd[_0x3892('0x15')]()+_0x3892('0x5b'),_0x5b0579[_0x3892('0x1d')]);return getEndUser(_0x5b0579,_0x2520e5,_0x1fbfd8,_0x4755ce,_0x3c8864,_0x416cbd,_0x24e3c7['moduleCreate']);})[_0x3892('0x13')](function(_0x48e470){logger['info']('['+_0x416cbd[_0x3892('0x15')]()+_0x3892('0x5c'),_0x48e470[_0x3892('0x2b')]);logger['info']('['+_0x416cbd[_0x3892('0x15')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x3c8864[_0x3892('0x2c')]);return getTicket(_0x48e470,_0x2520e5,_0x1fbfd8,_0x4755ce,_0x3c8864,_0x24e3c7,_0x416cbd);})['then'](function(_0x59bf2c){logger['info'](util['format']('['+_0x416cbd[_0x3892('0x15')]()+_0x3892('0x5d'),_0x24e3c7[_0x3892('0x3b')],_0x59bf2c[_0x3892('0x5e')]));logger[_0x3892('0x22')](util[_0x3892('0x49')]('['+_0x416cbd[_0x3892('0x15')]()+_0x3892('0x5f'),_0x416cbd));if(_0x416cbd!==_0x3892('0x50')){logger['info']('['+_0x416cbd['toUpperCase']()+']',_0x3892('0x60'));emit(_0x2520e5['remoteUri'],_0x5b676e[_0x3892('0x61')],_0x24e3c7[_0x3892('0x3b')],_0x59bf2c[_0x3892('0x5e')]);}})[_0x3892('0x25')](function(_0x2ba4ea){logger[_0x3892('0x14')]('['+_0x416cbd[_0x3892('0x15')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x2ba4ea['message']);});};
\ No newline at end of file
index 7c82deb..4086905 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4642=['md5','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','format','Caller\x20-\x20%s','Subjects','Descriptions','<br>','Tags','name','Fields','custom_fields','value','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','contact','email','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','remoteUri','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','find','Basic\x20%s','apiKey','base64','debug','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','nameField','toLowerCase','type','idField','customField','push','toString','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/helpdesk/tickets/%d','error','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','trigger:browser:url','catch','unmanaged','lastevent','toUpperCase','lodash','request-promise'];(function(_0x2d2e85,_0x22faa9){var _0x3e9f5e=function(_0x101c22){while(--_0x101c22){_0x2d2e85['push'](_0x2d2e85['shift']());}};_0x3e9f5e(++_0x22faa9);}(_0x4642,0xb8));var _0x2464=function(_0x590a94,_0x59e568){_0x590a94=_0x590a94-0x0;var _0x1c5889=_0x4642[_0x590a94];return _0x1c5889;};'use strict';var _=require(_0x2464('0x0'));var rp=require(_0x2464('0x1'));var md5=require(_0x2464('0x2'));var util=require('util');var Redis=require(_0x2464('0x3'));var intUtil=require(_0x2464('0x4'));var config=require(_0x2464('0x5'));var logger=require(_0x2464('0x6'))(_0x2464('0x7'));config[_0x2464('0x8')]=_[_0x2464('0x9')](config[_0x2464('0x8')],{'host':_0x2464('0xa'),'port':0x18eb});var io=require(_0x2464('0xb'))(new Redis(config[_0x2464('0x8')]));var headers={'Content-Type':_0x2464('0xc'),'Accept':_0x2464('0xc')};function emit(_0x1885cd,_0x56fe5d,_0x348290){io['to'](_0x1885cd)['emit'](_0x56fe5d,_0x348290);}function getTicket(_0x19cbaa,_0x5ad41a,_0x14f915,_0x193ff6,_0x514f52){logger[_0x2464('0xd')](_0x2464('0xe'));var _0x2389b7=_['merge']({'responder_id':_0x5ad41a['id'],'requester_id':_0x14f915['id'],'name':util[_0x2464('0xf')](_0x2464('0x10'),_0x514f52['calleridname']),'phone':_0x514f52['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x193ff6[_0x2464('0x11')],_0x514f52,'\x20'),'description':intUtil['getString'](_0x193ff6[_0x2464('0x12')],_0x514f52,_0x2464('0x13')),'tags':getTags(_0x193ff6[_0x2464('0x14')],_0x2464('0x15'))},getCustomFields(_0x193ff6[_0x2464('0x16')],_0x514f52));_0x2389b7[_0x2464('0x17')]=_['mapValues'](_['keyBy'](_0x2389b7[_0x2464('0x17')],'id'),_0x2464('0x18'));return request({'uri':util[_0x2464('0xf')]('%s/api/v2/tickets',_0x19cbaa['remoteUri']),'method':_0x2464('0x19'),'body':_0x2389b7})[_0x2464('0x1a')](function(_0x50b2dc){logger[_0x2464('0xd')](_0x2464('0x1b'));return _0x50b2dc;});}function getUser(_0x562ede,_0x5c9976){if(intUtil[_0x2464('0x1c')](_0x5c9976)){return request({'uri':util['format'](_0x2464('0x1d'),_0x562ede['remoteUri']),'qs':{'email':_0x5c9976}})['then'](function(_0x42de1f){if(_0x42de1f[_0x2464('0x1e')]){logger[_0x2464('0xd')]('Agent\x20found!');return _['find'](_0x42de1f,function(_0x578484){return _0x578484[_0x2464('0x1f')][_0x2464('0x20')]===_0x5c9976;});}else{logger[_0x2464('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x2464('0x21'),_0x562ede['remoteUri'])})['then'](function(_0x22b19c){logger[_0x2464('0xd')](_0x2464('0x22'));return _0x22b19c;});}});}else{logger[_0x2464('0xd')](_0x2464('0x23'));return request({'uri':util[_0x2464('0xf')]('%s/api/v2/agents/me',_0x562ede[_0x2464('0x24')])})[_0x2464('0x1a')](function(_0x4bf1eb){logger[_0x2464('0xd')](_0x2464('0x22'));return _0x4bf1eb;});}}function getEndUser(_0x323a0e,_0x143fb8,_0x12c94f){logger[_0x2464('0xd')](_0x2464('0x25'),_0x12c94f);return request({'uri':util[_0x2464('0xf')](_0x2464('0x26'),_0x323a0e[_0x2464('0x24')]),'qs':{'phone':_0x12c94f}})['then'](function(_0x3f91be){if(_0x3f91be['length']){logger['info'](_0x2464('0x27'));return _[_0x2464('0x28')](_0x3f91be,{'phone':_0x12c94f});}else{logger[_0x2464('0xd')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x2464('0xf')]('%s/api/v2/contacts',_0x323a0e[_0x2464('0x24')]),'method':_0x2464('0x19'),'body':{'name':_0x143fb8,'phone':_0x12c94f}})[_0x2464('0x1a')](function(_0x1206bc){logger[_0x2464('0xd')]('Enduser\x20created.');return _0x1206bc;});}});}function getAuth(_0x1de301){return util[_0x2464('0xf')](_0x2464('0x29'),new Buffer(_0x1de301[_0x2464('0x2a')]+':X')['toString'](_0x2464('0x2b')));}function request(_0x2b2809){logger[_0x2464('0x2c')](_0x2464('0x2d'),JSON[_0x2464('0x2e')](_0x2b2809));return rp(_[_0x2464('0x9')](_0x2b2809,{'method':_0x2464('0x2f'),'headers':headers,'json':!![]}));}function getTags(_0x2fa34e,_0x369b0b){var _0x51b866=[];if(_0x2fa34e&&_0x2fa34e[_0x2464('0x1e')]>0x0){_0x51b866=_[_0x2464('0x30')](_0x2fa34e,_0x369b0b);}return _0x51b866;}function getCustomFields(_0x3f592c,_0x5f5967){var _0xdae9de=[];var _0x5101de={'custom_fields':[]};if(_0x3f592c['length']>0x0){_[_0x2464('0x31')](_0x3f592c,function(_0x2e2456){if(_[_0x2464('0x32')]([_0x2464('0x33'),_0x2464('0x34')],_0x2e2456['type'])&&_0x2e2456[_0x2464('0x35')]&&!_0x2e2456['customField']){_0x5101de[_0x2e2456[_0x2464('0x35')][_0x2464('0x36')]()]=_0x2e2456['content']['toString']();}else if(_[_0x2464('0x32')](['string','picklist'],_0x2e2456[_0x2464('0x37')])&&_0x2e2456[_0x2464('0x38')]&&_0x2e2456[_0x2464('0x39')]){_0x5101de[_0x2464('0x17')][_0x2464('0x3a')]({'id':_0x2e2456[_0x2464('0x38')],'value':_0x2e2456['content'][_0x2464('0x3b')]()});}else if(_0x2e2456[_0x2464('0x37')]===_0x2464('0x3c')&&_0x2e2456['variableName']&&_0x2e2456[_0x2464('0x38')]&&_0x2e2456[_0x2464('0x39')]){_0x5f5967[_0x2e2456[_0x2464('0x3d')]]&&_0x5101de[_0x2464('0x17')]['push']({'id':_0x2e2456[_0x2464('0x38')],'value':_0x5f5967[_0x2e2456[_0x2464('0x3d')]]['toString']()});}else if(_0x2e2456[_0x2464('0x37')]===_0x2464('0x3e')&&_0x2e2456[_0x2464('0x3f')]&&_0x2e2456['Variable']['name']&&_0x2e2456[_0x2464('0x38')]&&_0x2e2456[_0x2464('0x39')]){_0x5f5967[_0x2e2456[_0x2464('0x3f')]['name'][_0x2464('0x36')]()]&&_0x5101de['custom_fields'][_0x2464('0x3a')]({'id':_0x2e2456[_0x2464('0x38')],'value':_0x5f5967[_0x2e2456[_0x2464('0x3f')]['name']['toLowerCase']()][_0x2464('0x3b')]()});}});}return _0x5101de;}exports[_0x2464('0x40')]=function(_0x5eb1d4,_0x238e97,_0x316db5,_0x17462d,_0x652f3b,_0x45236d){var _0x42d498,_0x4fcd5e;_0x45236d[_0x2464('0x24')]=intUtil[_0x2464('0x41')](_0x45236d[_0x2464('0x24')]);_0x45236d[_0x2464('0x42')]=intUtil[_0x2464('0x41')](_0x45236d[_0x2464('0x42')]);if(_0x652f3b&&_0x652f3b['monitor_format']){logger[_0x2464('0xd')]('[QUEUE]','Recording\x20is\x20enabled!');_0x238e97[_0x2464('0x43')]=util['format'](_0x2464('0x44'),_0x45236d['serverUrl'],_0x238e97[_0x2464('0x45')],md5(_0x238e97[_0x2464('0x45')]));}else{_0x238e97[_0x2464('0x43')]='';}headers[_0x2464('0x46')]=getAuth(_0x45236d);return getUser(_0x45236d,_0x17462d[_0x2464('0x20')])[_0x2464('0x1a')](function(_0x42d1aa){_0x42d498=_0x42d1aa;logger['info'](_0x2464('0x47'),_0x42d498['id']);return getEndUser(_0x45236d,_0x238e97[_0x2464('0x48')],_0x238e97[_0x2464('0x49')]);})[_0x2464('0x1a')](function(_0x3a5cdf){_0x4fcd5e=_0x3a5cdf;logger['info'](_0x2464('0x4a'),_0x4fcd5e['id']);return getTicket(_0x45236d,_0x42d498,_0x4fcd5e,_0x316db5,_0x238e97);})[_0x2464('0x1a')](function(_0x7c5f63){if(_0x7c5f63&&_0x7c5f63['id']){logger[_0x2464('0xd')](_0x2464('0x1b'));logger[_0x2464('0xd')](_0x2464('0x4b'),_0x7c5f63['id']);logger[_0x2464('0xd')](_0x2464('0x4c'),_0x2464('0x4d'));emit(util[_0x2464('0xf')](_0x2464('0x4e'),_0x17462d[_0x2464('0x15')]),'trigger:browser:url',{'uri':util[_0x2464('0xf')](_0x2464('0x4f'),_0x45236d[_0x2464('0x24')],_0x7c5f63['id'])});}})['catch'](function(_0xb672f){logger[_0x2464('0x50')](_0x2464('0x4c'),JSON[_0x2464('0x2e')](_0xb672f));});};exports[_0x2464('0x51')]=function(_0x258cfc,_0x30cf04,_0x327aa5,_0x1ad836,_0x501178,_0x3f78f8,_0x220dab){var _0x571e5a,_0x28321a;_0x3f78f8['remoteUri']=intUtil['stripTrailingSlash'](_0x3f78f8[_0x2464('0x24')]);_0x3f78f8['serverUrl']=intUtil[_0x2464('0x41')](_0x3f78f8[_0x2464('0x42')]);if(_0x220dab&&_0x220dab[_0x2464('0x52')]&&_0x220dab['recordingFormat']!==_0x2464('0x53')){logger['info'](_0x2464('0x54'),_0x2464('0x55'));_0x30cf04[_0x2464('0x43')]=util[_0x2464('0xf')](_0x2464('0x44'),_0x3f78f8['serverUrl'],_0x30cf04[_0x2464('0x45')],md5(_0x30cf04['uniqueid']));}headers[_0x2464('0x46')]=getAuth(_0x3f78f8);return getUser(_0x3f78f8,_0x1ad836['email'])[_0x2464('0x1a')](function(_0x4bd0e0){_0x571e5a=_0x4bd0e0;logger[_0x2464('0xd')]('The\x20User\x20ID\x20is:',_0x571e5a['id']);return getEndUser(_0x3f78f8,_0x30cf04[_0x2464('0x56')],_0x30cf04[_0x2464('0x57')]);})[_0x2464('0x1a')](function(_0x254112){_0x28321a=_0x254112;logger[_0x2464('0xd')](_0x2464('0x4a'),_0x28321a['id']);return getTicket(_0x3f78f8,_0x571e5a,_0x28321a,_0x327aa5,_0x30cf04);})[_0x2464('0x1a')](function(_0x321d54){if(_0x321d54&&_0x321d54['id']){logger[_0x2464('0xd')]('Ticket\x20created!');logger[_0x2464('0xd')]('The\x20Ticket\x20ID\x20is:',_0x321d54['id']);logger[_0x2464('0xd')](_0x2464('0x54'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x1ad836['name']),_0x2464('0x58'),{'uri':util[_0x2464('0xf')](_0x2464('0x4f'),_0x3f78f8[_0x2464('0x24')],_0x321d54['id'])});}})[_0x2464('0x59')](function(_0x2f26f8){logger[_0x2464('0x50')](_0x2464('0x54'),JSON[_0x2464('0x2e')](_0x2f26f8));});};exports[_0x2464('0x5a')]=function(_0x4b0903,_0x1f5f39,_0x2b6c93,_0x180aef,_0x49666f,_0x219199){var _0x42c2aa,_0x341131;_0x219199[_0x2464('0x24')]=intUtil[_0x2464('0x41')](_0x219199[_0x2464('0x24')]);_0x219199[_0x2464('0x42')]=intUtil[_0x2464('0x41')](_0x219199[_0x2464('0x42')]);if(_0x49666f&&_0x49666f['monitor_format']){logger[_0x2464('0xd')]('['+_0x1f5f39[_0x2464('0x5b')][_0x2464('0x5c')]()+']',_0x2464('0x55'));_0x1f5f39[_0x2464('0x43')]=util[_0x2464('0xf')](_0x2464('0x44'),_0x219199[_0x2464('0x42')],_0x1f5f39[_0x2464('0x45')],md5(_0x1f5f39[_0x2464('0x45')]));}else{_0x1f5f39[_0x2464('0x43')]='';}headers[_0x2464('0x46')]=getAuth(_0x219199);return getUser(_0x219199,'')[_0x2464('0x1a')](function(_0x3943a4){_0x42c2aa=_0x3943a4;logger['info']('The\x20User\x20ID\x20is:',_0x42c2aa['id']);return getEndUser(_0x219199,_0x1f5f39['calleridname'],_0x1f5f39[_0x2464('0x49')]);})['then'](function(_0x42f071){_0x341131=_0x42f071;logger[_0x2464('0xd')](_0x2464('0x4a'),_0x341131['id']);return getTicket(_0x219199,_0x42c2aa,_0x341131,_0x2b6c93,_0x1f5f39);})[_0x2464('0x1a')](function(_0x5a2924){if(_0x5a2924){logger[_0x2464('0xd')]('Ticket\x20created!');logger[_0x2464('0xd')](_0x2464('0x4b'),_0x5a2924['id']);}})[_0x2464('0x59')](function(_0x1fdfbd){logger[_0x2464('0x50')]('['+_0x1f5f39[_0x2464('0x5b')][_0x2464('0x5c')]()+']',JSON[_0x2464('0x2e')](_0x1fdfbd));});};
\ No newline at end of file
+var _0xbbc6=['error','stringify','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','trigger:browser:url','unmanaged','toUpperCase','request-promise','md5','./util','../../../../config/environment','../../../../config/logger','freshdesk','defaults','redis','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridnum','getString','<br>','Tags','name','Fields','custom_fields','mapValues','keyBy','value','remoteUri','POST','then','Ticket\x20created!','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20created.','Basic\x20%s','apiKey','debug','[HTTP]','GET','map','forEach','string','picklist','type','nameField','toLowerCase','content','toString','includes','idField','variable','customField','variableName','Variable','push','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/helpdesk/tickets/%d','catch'];(function(_0x397bea,_0x4d8c3e){var _0x5737f3=function(_0x60b70f){while(--_0x60b70f){_0x397bea['push'](_0x397bea['shift']());}};_0x5737f3(++_0x4d8c3e);}(_0xbbc6,0x65));var _0x6bbc=function(_0x5cfb9d,_0x257743){_0x5cfb9d=_0x5cfb9d-0x0;var _0x3debad=_0xbbc6[_0x5cfb9d];return _0x3debad;};'use strict';var _=require('lodash');var rp=require(_0x6bbc('0x0'));var md5=require(_0x6bbc('0x1'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x6bbc('0x2'));var config=require(_0x6bbc('0x3'));var logger=require(_0x6bbc('0x4'))(_0x6bbc('0x5'));config['redis']=_[_0x6bbc('0x6')](config[_0x6bbc('0x7')],{'host':_0x6bbc('0x8'),'port':0x18eb});var io=require(_0x6bbc('0x9'))(new Redis(config[_0x6bbc('0x7')]));var headers={'Content-Type':'application/json','Accept':_0x6bbc('0xa')};function emit(_0x469097,_0x417bfa,_0xdf7123){io['to'](_0x469097)['emit'](_0x417bfa,_0xdf7123);}function getTicket(_0x4a2980,_0x151ebf,_0x38d762,_0x182c69,_0x4705f9){logger[_0x6bbc('0xb')](_0x6bbc('0xc'));var _0x3168bb=_[_0x6bbc('0xd')]({'responder_id':_0x151ebf['id'],'requester_id':_0x38d762['id'],'name':util[_0x6bbc('0xe')](_0x6bbc('0xf'),_0x4705f9['calleridname']),'phone':_0x4705f9[_0x6bbc('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x6bbc('0x11')](_0x182c69['Subjects'],_0x4705f9,'\x20'),'description':intUtil[_0x6bbc('0x11')](_0x182c69['Descriptions'],_0x4705f9,_0x6bbc('0x12')),'tags':getTags(_0x182c69[_0x6bbc('0x13')],_0x6bbc('0x14'))},getCustomFields(_0x182c69[_0x6bbc('0x15')],_0x4705f9));_0x3168bb[_0x6bbc('0x16')]=_[_0x6bbc('0x17')](_[_0x6bbc('0x18')](_0x3168bb[_0x6bbc('0x16')],'id'),_0x6bbc('0x19'));return request({'uri':util[_0x6bbc('0xe')]('%s/api/v2/tickets',_0x4a2980[_0x6bbc('0x1a')]),'method':_0x6bbc('0x1b'),'body':_0x3168bb})[_0x6bbc('0x1c')](function(_0x1978dd){logger[_0x6bbc('0xb')](_0x6bbc('0x1d'));return _0x1978dd;});}function getUser(_0x16fea3,_0x369263){if(intUtil['validateEmail'](_0x369263)){return request({'uri':util[_0x6bbc('0xe')](_0x6bbc('0x1e'),_0x16fea3[_0x6bbc('0x1a')]),'qs':{'email':_0x369263}})[_0x6bbc('0x1c')](function(_0x603c9a){if(_0x603c9a[_0x6bbc('0x1f')]){logger[_0x6bbc('0xb')](_0x6bbc('0x20'));return _[_0x6bbc('0x21')](_0x603c9a,function(_0x38873b){return _0x38873b[_0x6bbc('0x22')][_0x6bbc('0x23')]===_0x369263;});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x6bbc('0x24'),_0x16fea3[_0x6bbc('0x1a')])})['then'](function(_0x875298){logger['info'](_0x6bbc('0x25'));return _0x875298;});}});}else{logger[_0x6bbc('0xb')](_0x6bbc('0x26'));return request({'uri':util[_0x6bbc('0xe')]('%s/api/v2/agents/me',_0x16fea3['remoteUri'])})[_0x6bbc('0x1c')](function(_0x2e512f){logger['info'](_0x6bbc('0x25'));return _0x2e512f;});}}function getEndUser(_0x509e3c,_0x366a04,_0x190dda){logger['info'](_0x6bbc('0x27'),_0x190dda);return request({'uri':util[_0x6bbc('0xe')](_0x6bbc('0x28'),_0x509e3c[_0x6bbc('0x1a')]),'qs':{'phone':_0x190dda}})['then'](function(_0x1aecc3){if(_0x1aecc3[_0x6bbc('0x1f')]){logger[_0x6bbc('0xb')]('Enduser\x20found!');return _[_0x6bbc('0x21')](_0x1aecc3,{'phone':_0x190dda});}else{logger[_0x6bbc('0xb')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format'](_0x6bbc('0x28'),_0x509e3c[_0x6bbc('0x1a')]),'method':_0x6bbc('0x1b'),'body':{'name':_0x366a04,'phone':_0x190dda}})['then'](function(_0x4947dd){logger[_0x6bbc('0xb')](_0x6bbc('0x29'));return _0x4947dd;});}});}function getAuth(_0x4b711f){return util[_0x6bbc('0xe')](_0x6bbc('0x2a'),new Buffer(_0x4b711f[_0x6bbc('0x2b')]+':X')['toString']('base64'));}function request(_0x460ca2){logger[_0x6bbc('0x2c')](_0x6bbc('0x2d'),JSON['stringify'](_0x460ca2));return rp(_[_0x6bbc('0x6')](_0x460ca2,{'method':_0x6bbc('0x2e'),'headers':headers,'json':!![]}));}function getTags(_0x1ede00,_0x3372f3){var _0x2ebac5=[];if(_0x1ede00&&_0x1ede00[_0x6bbc('0x1f')]>0x0){_0x2ebac5=_[_0x6bbc('0x2f')](_0x1ede00,_0x3372f3);}return _0x2ebac5;}function getCustomFields(_0x1bed03,_0x45e54b){var _0xfa43bc=[];var _0x3a2165={'custom_fields':[]};if(_0x1bed03[_0x6bbc('0x1f')]>0x0){_[_0x6bbc('0x30')](_0x1bed03,function(_0x5cb98a){if(_['includes']([_0x6bbc('0x31'),_0x6bbc('0x32')],_0x5cb98a[_0x6bbc('0x33')])&&_0x5cb98a[_0x6bbc('0x34')]&&!_0x5cb98a['customField']){_0x3a2165[_0x5cb98a[_0x6bbc('0x34')][_0x6bbc('0x35')]()]=_0x5cb98a[_0x6bbc('0x36')][_0x6bbc('0x37')]();}else if(_[_0x6bbc('0x38')]([_0x6bbc('0x31'),'picklist'],_0x5cb98a[_0x6bbc('0x33')])&&_0x5cb98a[_0x6bbc('0x39')]&&_0x5cb98a['customField']){_0x3a2165[_0x6bbc('0x16')]['push']({'id':_0x5cb98a[_0x6bbc('0x39')],'value':_0x5cb98a[_0x6bbc('0x36')]['toString']()});}else if(_0x5cb98a[_0x6bbc('0x33')]===_0x6bbc('0x3a')&&_0x5cb98a['variableName']&&_0x5cb98a[_0x6bbc('0x39')]&&_0x5cb98a[_0x6bbc('0x3b')]){_0x45e54b[_0x5cb98a[_0x6bbc('0x3c')]]&&_0x3a2165[_0x6bbc('0x16')]['push']({'id':_0x5cb98a[_0x6bbc('0x39')],'value':_0x45e54b[_0x5cb98a[_0x6bbc('0x3c')]][_0x6bbc('0x37')]()});}else if(_0x5cb98a[_0x6bbc('0x33')]==='customVariable'&&_0x5cb98a[_0x6bbc('0x3d')]&&_0x5cb98a[_0x6bbc('0x3d')][_0x6bbc('0x14')]&&_0x5cb98a[_0x6bbc('0x39')]&&_0x5cb98a['customField']){_0x45e54b[_0x5cb98a['Variable'][_0x6bbc('0x14')][_0x6bbc('0x35')]()]&&_0x3a2165[_0x6bbc('0x16')][_0x6bbc('0x3e')]({'id':_0x5cb98a[_0x6bbc('0x39')],'value':_0x45e54b[_0x5cb98a['Variable'][_0x6bbc('0x14')][_0x6bbc('0x35')]()][_0x6bbc('0x37')]()});}});}return _0x3a2165;}exports[_0x6bbc('0x3f')]=function(_0x5d29de,_0x1eb6ff,_0x3c700a,_0x183b4d,_0x2bf839,_0x5b54cd){var _0x575353,_0x5f0e95;_0x5b54cd['remoteUri']=intUtil[_0x6bbc('0x40')](_0x5b54cd[_0x6bbc('0x1a')]);_0x5b54cd[_0x6bbc('0x41')]=intUtil[_0x6bbc('0x40')](_0x5b54cd[_0x6bbc('0x41')]);if(_0x2bf839&&_0x2bf839[_0x6bbc('0x42')]){logger[_0x6bbc('0xb')](_0x6bbc('0x43'),'Recording\x20is\x20enabled!');_0x1eb6ff['recordingURL']=util[_0x6bbc('0xe')](_0x6bbc('0x44'),_0x5b54cd['serverUrl'],_0x1eb6ff[_0x6bbc('0x45')],md5(_0x1eb6ff[_0x6bbc('0x45')]));}else{_0x1eb6ff[_0x6bbc('0x46')]='';}headers[_0x6bbc('0x47')]=getAuth(_0x5b54cd);return getUser(_0x5b54cd,_0x183b4d['email'])[_0x6bbc('0x1c')](function(_0x249f41){_0x575353=_0x249f41;logger[_0x6bbc('0xb')](_0x6bbc('0x48'),_0x575353['id']);return getEndUser(_0x5b54cd,_0x1eb6ff[_0x6bbc('0x49')],_0x1eb6ff[_0x6bbc('0x10')]);})[_0x6bbc('0x1c')](function(_0x517114){_0x5f0e95=_0x517114;logger[_0x6bbc('0xb')](_0x6bbc('0x4a'),_0x5f0e95['id']);return getTicket(_0x5b54cd,_0x575353,_0x5f0e95,_0x3c700a,_0x1eb6ff);})[_0x6bbc('0x1c')](function(_0xb8ca66){if(_0xb8ca66&&_0xb8ca66['id']){logger[_0x6bbc('0xb')]('Ticket\x20created!');logger[_0x6bbc('0xb')]('The\x20Ticket\x20ID\x20is:',_0xb8ca66['id']);logger[_0x6bbc('0xb')]('[QUEUE]',_0x6bbc('0x4b'));emit(util[_0x6bbc('0xe')](_0x6bbc('0x4c'),_0x183b4d[_0x6bbc('0x14')]),'trigger:browser:url',{'uri':util['format'](_0x6bbc('0x4d'),_0x5b54cd[_0x6bbc('0x1a')],_0xb8ca66['id'])});}})[_0x6bbc('0x4e')](function(_0x3c94af){logger[_0x6bbc('0x4f')]('[QUEUE]',JSON[_0x6bbc('0x50')](_0x3c94af));});};exports[_0x6bbc('0x51')]=function(_0x42236b,_0x349b01,_0x223469,_0x1e46fa,_0x44cc16,_0x384b75,_0x22ecc3){var _0x35a2d1,_0x5e4884;_0x384b75['remoteUri']=intUtil[_0x6bbc('0x40')](_0x384b75[_0x6bbc('0x1a')]);_0x384b75['serverUrl']=intUtil['stripTrailingSlash'](_0x384b75[_0x6bbc('0x41')]);if(_0x22ecc3&&_0x22ecc3[_0x6bbc('0x52')]&&_0x22ecc3[_0x6bbc('0x52')]!==_0x6bbc('0x53')){logger[_0x6bbc('0xb')](_0x6bbc('0x54'),'Recording\x20is\x20enabled!');_0x349b01[_0x6bbc('0x46')]=util['format'](_0x6bbc('0x44'),_0x384b75[_0x6bbc('0x41')],_0x349b01[_0x6bbc('0x45')],md5(_0x349b01[_0x6bbc('0x45')]));}headers[_0x6bbc('0x47')]=getAuth(_0x384b75);return getUser(_0x384b75,_0x1e46fa[_0x6bbc('0x23')])[_0x6bbc('0x1c')](function(_0x14e9b5){_0x35a2d1=_0x14e9b5;logger['info'](_0x6bbc('0x48'),_0x35a2d1['id']);return getEndUser(_0x384b75,_0x349b01[_0x6bbc('0x55')],_0x349b01[_0x6bbc('0x56')]);})['then'](function(_0x4e3f30){_0x5e4884=_0x4e3f30;logger[_0x6bbc('0xb')]('The\x20Enduser\x20ID\x20is:',_0x5e4884['id']);return getTicket(_0x384b75,_0x35a2d1,_0x5e4884,_0x223469,_0x349b01);})[_0x6bbc('0x1c')](function(_0x248f1d){if(_0x248f1d&&_0x248f1d['id']){logger[_0x6bbc('0xb')](_0x6bbc('0x1d'));logger[_0x6bbc('0xb')]('The\x20Ticket\x20ID\x20is:',_0x248f1d['id']);logger[_0x6bbc('0xb')](_0x6bbc('0x54'),_0x6bbc('0x4b'));emit(util[_0x6bbc('0xe')](_0x6bbc('0x4c'),_0x1e46fa[_0x6bbc('0x14')]),_0x6bbc('0x57'),{'uri':util[_0x6bbc('0xe')]('%s/helpdesk/tickets/%d',_0x384b75[_0x6bbc('0x1a')],_0x248f1d['id'])});}})[_0x6bbc('0x4e')](function(_0x49a96c){logger[_0x6bbc('0x4f')](_0x6bbc('0x54'),JSON[_0x6bbc('0x50')](_0x49a96c));});};exports[_0x6bbc('0x58')]=function(_0x1b8920,_0x52995d,_0x4212f8,_0x3a0e04,_0x3d720a,_0x57a6ac){var _0x1a0e35,_0x5c88a0;_0x57a6ac[_0x6bbc('0x1a')]=intUtil[_0x6bbc('0x40')](_0x57a6ac[_0x6bbc('0x1a')]);_0x57a6ac[_0x6bbc('0x41')]=intUtil[_0x6bbc('0x40')](_0x57a6ac[_0x6bbc('0x41')]);if(_0x3d720a&&_0x3d720a[_0x6bbc('0x42')]){logger[_0x6bbc('0xb')]('['+_0x52995d['lastevent'][_0x6bbc('0x59')]()+']','Recording\x20is\x20enabled!');_0x52995d[_0x6bbc('0x46')]=util[_0x6bbc('0xe')](_0x6bbc('0x44'),_0x57a6ac[_0x6bbc('0x41')],_0x52995d[_0x6bbc('0x45')],md5(_0x52995d[_0x6bbc('0x45')]));}else{_0x52995d['recordingURL']='';}headers[_0x6bbc('0x47')]=getAuth(_0x57a6ac);return getUser(_0x57a6ac,'')[_0x6bbc('0x1c')](function(_0x55f2f4){_0x1a0e35=_0x55f2f4;logger[_0x6bbc('0xb')]('The\x20User\x20ID\x20is:',_0x1a0e35['id']);return getEndUser(_0x57a6ac,_0x52995d['calleridname'],_0x52995d[_0x6bbc('0x10')]);})['then'](function(_0x269aa6){_0x5c88a0=_0x269aa6;logger[_0x6bbc('0xb')]('The\x20Enduser\x20ID\x20is:',_0x5c88a0['id']);return getTicket(_0x57a6ac,_0x1a0e35,_0x5c88a0,_0x4212f8,_0x52995d);})[_0x6bbc('0x1c')](function(_0x3917ac){if(_0x3917ac){logger[_0x6bbc('0xb')]('Ticket\x20created!');logger[_0x6bbc('0xb')]('The\x20Ticket\x20ID\x20is:',_0x3917ac['id']);}})[_0x6bbc('0x4e')](function(_0x2aba38){logger[_0x6bbc('0x4f')]('['+_0x52995d['lastevent'][_0x6bbc('0x59')]()+']',JSON[_0x6bbc('0x50')](_0x2aba38));});};
\ No newline at end of file
index 68209aa..8289d41 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x80fd=['redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','email','adminId','Admin\x20found:','message','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','Admin\x20selected','adminEmail','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','&f=','&entities=contact','contacts','format','contactNumber','endUserId','Contact\x20found\x20mobile_number:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Creating\x20new\x20task','/api/tasks','Subjects','getString','Contact','add','ticketId','Task\x20created:','/contacts/','user:%s','trigger:browser:url','Token\x20token=','apiKey','stripTrailingSlash','remoteUri','serverUrl','toLowerCase','outbound','destcalleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','Recording\x20is\x20enabled!','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','inspect','md5','util','moment','bluebird','ioredis','./util','../../../../config/environment','freshsales'];(function(_0x1b2302,_0x30965e){var _0x5ce6d2=function(_0x9df8a2){while(--_0x9df8a2){_0x1b2302['push'](_0x1b2302['shift']());}};_0x5ce6d2(++_0x30965e);}(_0x80fd,0x1c0));var _0xd80f=function(_0x38546,_0x3e4f21){_0x38546=_0x38546-0x0;var _0xe4db2d=_0x80fd[_0x38546];return _0xe4db2d;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0xd80f('0x0'));var util=require(_0xd80f('0x1'));var moment=require(_0xd80f('0x2'));var Promise=require(_0xd80f('0x3'));var Redis=require(_0xd80f('0x4'));var intUtil=require(_0xd80f('0x5'));var config=require(_0xd80f('0x6'));var logger=require('../../../../config/logger')(_0xd80f('0x7'));config[_0xd80f('0x8')]=_[_0xd80f('0x9')](config[_0xd80f('0x8')],{'host':_0xd80f('0xa'),'port':0x18eb});var io=require(_0xd80f('0xb'))(new Redis(config[_0xd80f('0x8')]));function getAdminId(_0x271e84,_0x2f6962,_0x4e1d9e,_0x45c094){return new Promise(function(_0x3bcc47,_0x1f2d40){var _0x4dbb0a=![];var _0x139ac9={'method':_0xd80f('0xc'),'uri':_0x45c094+_0xd80f('0xd'),'json':!![]};_0x139ac9[_0xd80f('0xe')]=_0x4e1d9e;logger[_0xd80f('0xf')](_0xd80f('0x10'));return rp(_0x139ac9)[_0xd80f('0x11')](function(_0x4f89dd){if(_0x4f89dd){var _0x5f7d08=_0x4f89dd[_0xd80f('0x12')];var _0x256c66=null;for(_0x256c66=0x0;_0x256c66<_0x5f7d08[_0xd80f('0x13')];_0x256c66++){if(_0x5f7d08[_0x256c66][_0xd80f('0x14')]===_0x271e84['adminEmail']){_0x271e84[_0xd80f('0x15')]=_0x5f7d08[_0x256c66]['id'];_0x4dbb0a=!![];}}if(_0x4dbb0a){logger[_0xd80f('0xf')](_0xd80f('0x16'),_0x271e84[_0xd80f('0x15')]);_0x3bcc47(_0x271e84);}else{_0x1f2d40({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x1f2d40({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x407760){logger['error']('['+[_0x2f6962['toUpperCase']()]+']',_0x407760[_0xd80f('0x17')]);_0x1f2d40(_0x407760);});});}function getUser(_0x4c9bf1,_0x46f071,_0x5f0a11){return function(_0x3a1945){return new Promise(function(_0x415a26,_0x100ae5){var _0x3386e3={'method':_0xd80f('0xc'),'uri':_0x5f0a11+_0xd80f('0xd'),'json':!![]};_0x3386e3[_0xd80f('0xe')]=_0x46f071;logger[_0xd80f('0xf')]('Getting\x20user\x20list');return rp(_0x3386e3)[_0xd80f('0x11')](function(_0x213921){if(_0x213921){var _0x3b6029=_0x213921[_0xd80f('0x12')];var _0x303dc9=![];var _0x2a5cf0=null;if(_0x3a1945[_0xd80f('0x18')]!==null){logger[_0xd80f('0xf')](_0xd80f('0x19'),_0x3a1945[_0xd80f('0x18')]);_0x3a1945[_0xd80f('0x1a')]=_0x3a1945[_0xd80f('0x18')];for(_0x2a5cf0=0x0;_0x2a5cf0<_0x3b6029[_0xd80f('0x13')];_0x2a5cf0++){if(_0x3b6029[_0x2a5cf0][_0xd80f('0x14')]===_0x3a1945[_0xd80f('0x18')]){_0x303dc9=!![];_0x3a1945[_0xd80f('0x1b')]=_0x3b6029[_0x2a5cf0]['id'];logger[_0xd80f('0xf')]('User\x20found:',_0x3a1945[_0xd80f('0x1b')]);}}}if(!_0x303dc9){logger[_0xd80f('0xf')](_0xd80f('0x1c'));_0x3a1945[_0xd80f('0x1a')]=_0x3a1945[_0xd80f('0x1d')];_0x3a1945[_0xd80f('0x1b')]=_0x3a1945[_0xd80f('0x15')];_0x303dc9=!![];}if(_0x303dc9){_0x415a26(_0x3a1945);}else{_0x100ae5({'statusCode':0x194,'message':_0xd80f('0x1e')});}}else{_0x100ae5({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xd80f('0x1f')](function(_0x2557a6){logger[_0xd80f('0x20')]('['+[_0x4c9bf1[_0xd80f('0x21')]()]+']',_0x2557a6[_0xd80f('0x17')]);_0x100ae5(_0x2557a6);});});};}function searchContact(_0x55274b,_0x49d8fe,_0x3fa074,_0x366a69){return new Promise(function(_0x15ea64,_0x5be39c){var _0x55a421={'method':_0xd80f('0xc'),'headers':_0x49d8fe,'uri':_0x55274b+'/api/lookup?q='+_0x366a69+_0xd80f('0x22')+_0x3fa074+_0xd80f('0x23'),'json':!![]};rp(_0x55a421)[_0xd80f('0x11')](function(_0xd1ea56){var _0x1f5c39=_['find'](_0xd1ea56['contacts'][_0xd80f('0x24')],[_0x3fa074,_0x366a69]);_0x15ea64(_0x1f5c39);})[_0xd80f('0x1f')](function(_0x449810){_0x5be39c(_0x449810);});});}function getEndUser(_0xd35f08,_0x5ce4af,_0x253fb2){return function(_0x427966){return new Promise(function(_0x1343a4,_0x5c0552){logger[_0xd80f('0xf')](util[_0xd80f('0x25')]('Searching\x20contact\x20with\x20phone\x20%s',_0x427966[_0xd80f('0x26')]));searchContact(_0x253fb2,_0x5ce4af,'mobile_number',_0x427966['contactNumber'])[_0xd80f('0x11')](function(_0x34529f){if(_0x34529f){_0x427966[_0xd80f('0x27')]=_0x34529f['id'];logger[_0xd80f('0xf')](_0xd80f('0x28'),_0x427966[_0xd80f('0x27')]);return _0x1343a4(_0x427966);}searchContact(_0x253fb2,_0x5ce4af,'work_number',_0x427966['contactNumber'])[_0xd80f('0x11')](function(_0x598e1f){if(_0x598e1f){_0x427966[_0xd80f('0x27')]=_0x598e1f['id'];logger[_0xd80f('0xf')]('Contact\x20found\x20work_number:',_0x427966['endUserId']);return _0x1343a4(_0x427966);}createEndUser(_0x427966,_0xd35f08,_0x5ce4af,_0x253fb2)['then'](function(_0x452ab3){logger[_0xd80f('0xf')]('Contact\x20created:',_0x452ab3['endUserId']);return _0x1343a4(_0x452ab3);});});})[_0xd80f('0x1f')](function(_0x230682){_0x5c0552(_0x230682);});});};}function createEndUser(_0x9c677c,_0x25a886,_0x43d72e,_0x1832fd){return new Promise(function(_0x8b782b,_0x3cd1bf){var _0x5cabee=moment();var _0xcb73d1={'method':_0xd80f('0x29'),'uri':_0x1832fd+_0xd80f('0x2a'),'body':{'contact':{'last_name':_0x9c677c['contactNumber'],'work_number':_0x9c677c['contactNumber'],'mobile_number':_0x9c677c[_0xd80f('0x26')],'owner_id':_0x9c677c[_0xd80f('0x1b')],'created_at':_0x5cabee['format'](_0xd80f('0x2b'))}},'json':!![]};_0xcb73d1[_0xd80f('0xe')]=_0x43d72e;logger[_0xd80f('0xf')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0xcb73d1)['then'](function(_0x49c3c5){_0x9c677c[_0xd80f('0x27')]=_0x49c3c5['contact']['id'];_0x8b782b(_0x9c677c);})[_0xd80f('0x1f')](function(_0xc4d26){logger['error']('['+[_0x25a886[_0xd80f('0x21')]()]+']',_0xc4d26[_0xd80f('0x17')]);_0x3cd1bf(_0xc4d26[_0xd80f('0x17')]);});});}function getTicket(_0x4d8b40,_0x50b89c,_0x31ee39,_0x59a26c,_0x1de487){return function(_0x1e31e2){logger['info'](_0xd80f('0x2c'));return new Promise(function(_0x5afbc8,_0x4e4eeb){var _0x455321=moment();var _0x2eac17={'method':'POST','uri':_0x31ee39+_0xd80f('0x2d'),'body':{'title':intUtil['getString'](_0x59a26c[_0xd80f('0x2e')],_0x1de487,'\x20'),'description':intUtil[_0xd80f('0x2f')](_0x59a26c['Descriptions'],_0x1de487,'\x0a'),'owner_id':_0x1e31e2[_0xd80f('0x1b')],'creater_id':_0x1e31e2[_0xd80f('0x15')],'targetable_id':_0x1e31e2[_0xd80f('0x27')],'targetable_type':_0xd80f('0x30'),'created_at':_0x455321[_0xd80f('0x25')](_0xd80f('0x2b')),'due_date':_0x455321[_0xd80f('0x31')](0x1e,'m')['format'](_0xd80f('0x2b'))},'json':!![]};_0x2eac17[_0xd80f('0xe')]=_0x50b89c;return rp(_0x2eac17)['then'](function(_0x3a45b6){_0x1e31e2[_0xd80f('0x32')]=_0x3a45b6['task']['id'];logger[_0xd80f('0xf')](_0xd80f('0x33'),_0x1e31e2[_0xd80f('0x32')]);_0x5afbc8(_0x1e31e2);})[_0xd80f('0x1f')](function(_0x1d3d36){logger[_0xd80f('0x20')]('['+[_0x4d8b40[_0xd80f('0x21')]()]+']',_0x1d3d36[_0xd80f('0x17')]);_0x4e4eeb(_0x1d3d36[_0xd80f('0x17')]);});});};}function emit(_0x330e67,_0x3ea2ca,_0x4b6e20){var _0x39711f={'uri':_0x330e67+_0xd80f('0x34')+_0x4b6e20};io['to'](util[_0xd80f('0x25')](_0xd80f('0x35'),_0x3ea2ca))['emit'](_0xd80f('0x36'),_0x39711f);}exports['cs']=function(_0x571352,_0xb7d01a,_0x25b4e0,_0x7e2872,_0x33d2ed,_0x2b00be,_0x555c32,_0x588adc){var _0x4d2a0a={};var _0x5b9e9c={'Authorization':_0xd80f('0x37')+_0x2b00be[_0xd80f('0x38')]};_0x2b00be['remoteUri']=intUtil[_0xd80f('0x39')](_0x2b00be[_0xd80f('0x3a')]);_0x2b00be[_0xd80f('0x3b')]=intUtil['stripTrailingSlash'](_0x2b00be['serverUrl']);var _0x3f6166=_0x2b00be['remoteUri'];_0x4d2a0a[_0xd80f('0x1d')]=_0x2b00be['username'];_0x4d2a0a[_0xd80f('0x26')]=_0x588adc[_0xd80f('0x3c')]()===_0xd80f('0x3d')?_0xb7d01a[_0xd80f('0x3e')]:_0xb7d01a['calleridnum'];_0x4d2a0a[_0xd80f('0x3f')]=_0x588adc===_0xd80f('0x40')||_0x588adc===_0xd80f('0x41')?_0xd80f('0x40'):'outbound';if(_0x7e2872){_0x4d2a0a[_0xd80f('0x18')]=_0x7e2872[_0xd80f('0x14')];}var _0x304541=util[_0xd80f('0x25')](_0xd80f('0x42'),_0x2b00be[_0xd80f('0x3b')],_0xb7d01a[_0xd80f('0x43')],md5(_0xb7d01a[_0xd80f('0x43')]));if(_0x33d2ed&&_0x33d2ed[_0xd80f('0x44')]){logger[_0xd80f('0xf')](_0xd80f('0x45'),'Recording\x20is\x20enabled!');_0xb7d01a[_0xd80f('0x46')]=_0x304541;}else if(_0x555c32&&_0x555c32[_0xd80f('0x47')]&&_0x555c32['recordingFormat']!=='none'){logger['info']('[OUTBOUND]',_0xd80f('0x48'));_0xb7d01a[_0xd80f('0x46')]=_0x304541;}else{_0xb7d01a[_0xd80f('0x46')]='';}return getAdminId(_0x4d2a0a,_0x588adc,_0x5b9e9c,_0x3f6166)[_0xd80f('0x11')](getUser(_0x588adc,_0x5b9e9c,_0x3f6166))[_0xd80f('0x11')](getEndUser(_0x588adc,_0x5b9e9c,_0x3f6166))[_0xd80f('0x11')](getTicket(_0x588adc,_0x5b9e9c,_0x3f6166,_0x25b4e0,_0xb7d01a))['then'](function(_0xa801eb){logger[_0xd80f('0xf')](util[_0xd80f('0x25')]('The\x20ticket\x20ID\x20is:\x20%s',_0xa801eb[_0xd80f('0x32')]));if(_0x588adc!==_0xd80f('0x41')){logger[_0xd80f('0xf')]('['+[_0x588adc['toUpperCase']()]+']',_0xd80f('0x49'));emit(_0x3f6166,_0x7e2872[_0xd80f('0x4a')],_0xa801eb['endUserId']);}})[_0xd80f('0x1f')](function(_0x2c739c){logger[_0xd80f('0x20')]('['+[_0x588adc[_0xd80f('0x21')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0xd80f('0x4b')](_0x2c739c,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x0004=['trigger:browser:url','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','destcalleridnum','calleridnum','callDirection','queue','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...','inspect','lodash','md5','util','moment','bluebird','ioredis','./util','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','GET','info','then','users','length','email','adminEmail','adminId','Admin\x20found:','catch','error','toUpperCase','headers','Getting\x20user\x20list','Getting\x20user\x20with\x20email','userEmail','agentEmail','userId','User\x20found:','Admin\x20selected','Requested\x20Resource\x20not\x20Found','message','/api/lookup?q=','&entities=contact','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','POST','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','YYYY-MM-DDTHH:mm:ss','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit'];(function(_0x30b7b2,_0x53001b){var _0x5ee49c=function(_0x3d2cad){while(--_0x3d2cad){_0x30b7b2['push'](_0x30b7b2['shift']());}};_0x5ee49c(++_0x53001b);}(_0x0004,0x117));var _0x4000=function(_0x58df23,_0x3e9eb9){_0x58df23=_0x58df23-0x0;var _0x2fcd18=_0x0004[_0x58df23];return _0x2fcd18;};'use strict';var _=require(_0x4000('0x0'));var rp=require('request-promise');var md5=require(_0x4000('0x1'));var util=require(_0x4000('0x2'));var moment=require(_0x4000('0x3'));var Promise=require(_0x4000('0x4'));var Redis=require(_0x4000('0x5'));var intUtil=require(_0x4000('0x6'));var config=require('../../../../config/environment');var logger=require(_0x4000('0x7'))('freshsales');config['redis']=_[_0x4000('0x8')](config[_0x4000('0x9')],{'host':_0x4000('0xa'),'port':0x18eb});var io=require(_0x4000('0xb'))(new Redis(config['redis']));function getAdminId(_0x2879e5,_0x14bc1e,_0x1c3046,_0x3ddae1){return new Promise(function(_0x1ce3ce,_0x24aeff){var _0x38568c=![];var _0x2027c9={'method':_0x4000('0xc'),'uri':_0x3ddae1+'/api/selector/owners','json':!![]};_0x2027c9['headers']=_0x1c3046;logger[_0x4000('0xd')]('Getting\x20admin\x20information');return rp(_0x2027c9)[_0x4000('0xe')](function(_0x374e07){if(_0x374e07){var _0x3ac5bd=_0x374e07[_0x4000('0xf')];var _0x2c89bd=null;for(_0x2c89bd=0x0;_0x2c89bd<_0x3ac5bd[_0x4000('0x10')];_0x2c89bd++){if(_0x3ac5bd[_0x2c89bd][_0x4000('0x11')]===_0x2879e5[_0x4000('0x12')]){_0x2879e5[_0x4000('0x13')]=_0x3ac5bd[_0x2c89bd]['id'];_0x38568c=!![];}}if(_0x38568c){logger[_0x4000('0xd')](_0x4000('0x14'),_0x2879e5[_0x4000('0x13')]);_0x1ce3ce(_0x2879e5);}else{_0x24aeff({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x24aeff({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x4000('0x15')](function(_0x40544b){logger[_0x4000('0x16')]('['+[_0x14bc1e[_0x4000('0x17')]()]+']',_0x40544b['message']);_0x24aeff(_0x40544b);});});}function getUser(_0x2d4005,_0x436374,_0x3f61e4){return function(_0x8d67a4){return new Promise(function(_0x5d4f6a,_0x5c992e){var _0x59a7fb={'method':'GET','uri':_0x3f61e4+'/api/selector/owners','json':!![]};_0x59a7fb[_0x4000('0x18')]=_0x436374;logger[_0x4000('0xd')](_0x4000('0x19'));return rp(_0x59a7fb)['then'](function(_0x333ba8){if(_0x333ba8){var _0x26265e=_0x333ba8[_0x4000('0xf')];var _0x1fe945=![];var _0x5bbb14=null;if(_0x8d67a4['agentEmail']!==null){logger[_0x4000('0xd')](_0x4000('0x1a'),_0x8d67a4['agentEmail']);_0x8d67a4[_0x4000('0x1b')]=_0x8d67a4[_0x4000('0x1c')];for(_0x5bbb14=0x0;_0x5bbb14<_0x26265e['length'];_0x5bbb14++){if(_0x26265e[_0x5bbb14]['email']===_0x8d67a4[_0x4000('0x1c')]){_0x1fe945=!![];_0x8d67a4[_0x4000('0x1d')]=_0x26265e[_0x5bbb14]['id'];logger[_0x4000('0xd')](_0x4000('0x1e'),_0x8d67a4[_0x4000('0x1d')]);}}}if(!_0x1fe945){logger['info'](_0x4000('0x1f'));_0x8d67a4[_0x4000('0x1b')]=_0x8d67a4[_0x4000('0x12')];_0x8d67a4[_0x4000('0x1d')]=_0x8d67a4['adminId'];_0x1fe945=!![];}if(_0x1fe945){_0x5d4f6a(_0x8d67a4);}else{_0x5c992e({'statusCode':0x194,'message':_0x4000('0x20')});}}else{_0x5c992e({'statusCode':0x194,'message':_0x4000('0x20')});}})[_0x4000('0x15')](function(_0x24d804){logger[_0x4000('0x16')]('['+[_0x2d4005[_0x4000('0x17')]()]+']',_0x24d804[_0x4000('0x21')]);_0x5c992e(_0x24d804);});});};}function searchContact(_0x490ac5,_0x481ac4,_0x15a249,_0x1c8d4e){return new Promise(function(_0x24ab7f,_0x3bcb44){var _0x551d49={'method':_0x4000('0xc'),'headers':_0x481ac4,'uri':_0x490ac5+_0x4000('0x22')+_0x1c8d4e+'&f='+_0x15a249+_0x4000('0x23'),'json':!![]};rp(_0x551d49)[_0x4000('0xe')](function(_0x2233bc){var _0x53b1f0=_['find'](_0x2233bc['contacts'][_0x4000('0x24')],[_0x15a249,_0x1c8d4e]);_0x24ab7f(_0x53b1f0);})[_0x4000('0x15')](function(_0x550a38){_0x3bcb44(_0x550a38);});});}function getEndUser(_0x3c90c6,_0x23e01a,_0x213155){return function(_0x4bd9e7){return new Promise(function(_0x4c3e89,_0x41c54a){logger[_0x4000('0xd')](util[_0x4000('0x25')](_0x4000('0x26'),_0x4bd9e7[_0x4000('0x27')]));searchContact(_0x213155,_0x23e01a,_0x4000('0x28'),_0x4bd9e7[_0x4000('0x27')])[_0x4000('0xe')](function(_0x1d5f21){if(_0x1d5f21){_0x4bd9e7[_0x4000('0x29')]=_0x1d5f21['id'];logger[_0x4000('0xd')](_0x4000('0x2a'),_0x4bd9e7[_0x4000('0x29')]);return _0x4c3e89(_0x4bd9e7);}searchContact(_0x213155,_0x23e01a,_0x4000('0x2b'),_0x4bd9e7[_0x4000('0x27')])['then'](function(_0x1b485e){if(_0x1b485e){_0x4bd9e7[_0x4000('0x29')]=_0x1b485e['id'];logger[_0x4000('0xd')]('Contact\x20found\x20work_number:',_0x4bd9e7[_0x4000('0x29')]);return _0x4c3e89(_0x4bd9e7);}createEndUser(_0x4bd9e7,_0x3c90c6,_0x23e01a,_0x213155)[_0x4000('0xe')](function(_0x24f539){logger[_0x4000('0xd')]('Contact\x20created:',_0x24f539[_0x4000('0x29')]);return _0x4c3e89(_0x24f539);});});})['catch'](function(_0x1a6d3d){_0x41c54a(_0x1a6d3d);});});};}function createEndUser(_0x5367b5,_0x308180,_0x48cc1d,_0x396943){return new Promise(function(_0x50b4a4,_0x17b7be){var _0x61cc2d=moment();var _0x565a22={'method':_0x4000('0x2c'),'uri':_0x396943+'/api/contacts','body':{'contact':{'last_name':_0x5367b5[_0x4000('0x27')],'work_number':_0x5367b5[_0x4000('0x27')],'mobile_number':_0x5367b5[_0x4000('0x27')],'owner_id':_0x5367b5[_0x4000('0x1d')],'created_at':_0x61cc2d['format']('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x565a22['headers']=_0x48cc1d;logger['info'](_0x4000('0x2d'));return rp(_0x565a22)[_0x4000('0xe')](function(_0x2c7159){_0x5367b5[_0x4000('0x29')]=_0x2c7159[_0x4000('0x2e')]['id'];_0x50b4a4(_0x5367b5);})['catch'](function(_0x35de18){logger[_0x4000('0x16')]('['+[_0x308180[_0x4000('0x17')]()]+']',_0x35de18[_0x4000('0x21')]);_0x17b7be(_0x35de18[_0x4000('0x21')]);});});}function getTicket(_0x21dbf5,_0x558ca9,_0x4dd445,_0x56bc6a,_0x5e83ea){return function(_0x551add){logger[_0x4000('0xd')](_0x4000('0x2f'));return new Promise(function(_0x53ce84,_0x2afedc){var _0x488792=moment();var _0x50c5a1={'method':_0x4000('0x2c'),'uri':_0x4dd445+_0x4000('0x30'),'body':{'title':intUtil[_0x4000('0x31')](_0x56bc6a[_0x4000('0x32')],_0x5e83ea,'\x20'),'description':intUtil[_0x4000('0x31')](_0x56bc6a[_0x4000('0x33')],_0x5e83ea,'\x0a'),'owner_id':_0x551add[_0x4000('0x1d')],'creater_id':_0x551add[_0x4000('0x13')],'targetable_id':_0x551add[_0x4000('0x29')],'targetable_type':_0x4000('0x34'),'created_at':_0x488792[_0x4000('0x25')](_0x4000('0x35')),'due_date':_0x488792[_0x4000('0x36')](0x1e,'m')['format'](_0x4000('0x35'))},'json':!![]};_0x50c5a1[_0x4000('0x18')]=_0x558ca9;return rp(_0x50c5a1)[_0x4000('0xe')](function(_0x4e810e){_0x551add[_0x4000('0x37')]=_0x4e810e[_0x4000('0x38')]['id'];logger['info'](_0x4000('0x39'),_0x551add['ticketId']);_0x53ce84(_0x551add);})['catch'](function(_0x49b01c){logger[_0x4000('0x16')]('['+[_0x21dbf5[_0x4000('0x17')]()]+']',_0x49b01c[_0x4000('0x21')]);_0x2afedc(_0x49b01c['message']);});});};}function emit(_0xc109a2,_0x3fa169,_0x1e41b6){var _0x2a9202={'uri':_0xc109a2+_0x4000('0x3a')+_0x1e41b6};io['to'](util['format'](_0x4000('0x3b'),_0x3fa169))[_0x4000('0x3c')](_0x4000('0x3d'),_0x2a9202);}exports['cs']=function(_0x5a043b,_0x456889,_0x3eef22,_0x2c1fd1,_0x366b7f,_0x4849e1,_0x5c6610,_0x1e9890){var _0x2d2f5a={};var _0x175e94={'Authorization':_0x4000('0x3e')+_0x4849e1['apiKey']};_0x4849e1[_0x4000('0x3f')]=intUtil[_0x4000('0x40')](_0x4849e1[_0x4000('0x3f')]);_0x4849e1[_0x4000('0x41')]=intUtil[_0x4000('0x40')](_0x4849e1[_0x4000('0x41')]);var _0x58bbc5=_0x4849e1[_0x4000('0x3f')];_0x2d2f5a[_0x4000('0x12')]=_0x4849e1[_0x4000('0x42')];_0x2d2f5a[_0x4000('0x27')]=_0x1e9890[_0x4000('0x43')]()==='outbound'?_0x456889[_0x4000('0x44')]:_0x456889[_0x4000('0x45')];_0x2d2f5a[_0x4000('0x46')]=_0x1e9890===_0x4000('0x47')||_0x1e9890===_0x4000('0x48')?_0x4000('0x47'):'outbound';if(_0x2c1fd1){_0x2d2f5a['agentEmail']=_0x2c1fd1[_0x4000('0x11')];}var _0x30d848=util['format'](_0x4000('0x49'),_0x4849e1[_0x4000('0x41')],_0x456889[_0x4000('0x4a')],md5(_0x456889[_0x4000('0x4a')]));if(_0x366b7f&&_0x366b7f[_0x4000('0x4b')]){logger[_0x4000('0xd')](_0x4000('0x4c'),_0x4000('0x4d'));_0x456889[_0x4000('0x4e')]=_0x30d848;}else if(_0x5c6610&&_0x5c6610[_0x4000('0x4f')]&&_0x5c6610[_0x4000('0x4f')]!==_0x4000('0x50')){logger[_0x4000('0xd')](_0x4000('0x51'),_0x4000('0x4d'));_0x456889['recordingURL']=_0x30d848;}else{_0x456889['recordingURL']='';}return getAdminId(_0x2d2f5a,_0x1e9890,_0x175e94,_0x58bbc5)[_0x4000('0xe')](getUser(_0x1e9890,_0x175e94,_0x58bbc5))[_0x4000('0xe')](getEndUser(_0x1e9890,_0x175e94,_0x58bbc5))[_0x4000('0xe')](getTicket(_0x1e9890,_0x175e94,_0x58bbc5,_0x3eef22,_0x456889))['then'](function(_0x4e23e6){logger[_0x4000('0xd')](util['format'](_0x4000('0x52'),_0x4e23e6['ticketId']));if(_0x1e9890!==_0x4000('0x48')){logger[_0x4000('0xd')]('['+[_0x1e9890[_0x4000('0x17')]()]+']',_0x4000('0x53'));emit(_0x58bbc5,_0x2c1fd1['name'],_0x4e23e6[_0x4000('0x29')]);}})[_0x4000('0x15')](function(_0x285626){logger[_0x4000('0x16')]('['+[_0x1e9890['toUpperCase']()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0x4000('0x54')](_0x285626,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 6436355..6b586d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf717=['./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','exec','includes','data1','toLowerCase','data2','Configurations','data3','queue','EVENT\x20UNKNOWN','unmanaged','servicenow','unknown\x20integration','../../../../config/logger','error','format','%s\x20configuration\x20#%s\x20not\x20found','[EXEC]','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk'];(function(_0x390538,_0x2a42a8){var _0x2b652d=function(_0x108bc7){while(--_0x108bc7){_0x390538['push'](_0x390538['shift']());}};_0x2b652d(++_0x2a42a8);}(_0xf717,0xb6));var _0x7f71=function(_0x2bb0f7,_0x100431){_0x2bb0f7=_0x2bb0f7-0x0;var _0x380d96=_0xf717[_0x2bb0f7];return _0x380d96;};'use strict';var _=require(_0x7f71('0x0'));var util=require(_0x7f71('0x1'));var zendesk=require(_0x7f71('0x2'));var salesforce=require(_0x7f71('0x3'));var sugarcrm=require(_0x7f71('0x4'));var freshdesk=require(_0x7f71('0x5'));var zoho=require(_0x7f71('0x6'));var desk=require(_0x7f71('0x7'));var vtiger=require(_0x7f71('0x8'));var servicenow=require(_0x7f71('0x9'));var dynamics365=require(_0x7f71('0xa'));var freshsales=require(_0x7f71('0xb'));var integrations=[_0x7f71('0xc'),_0x7f71('0xd'),'sugarcrm',_0x7f71('0xe'),_0x7f71('0xf'),_0x7f71('0x10'),_0x7f71('0x11'),_0x7f71('0x12'),_0x7f71('0x13'),'servicenow'];exports[_0x7f71('0x14')]=function(_0x503a21,_0x5c7d58,_0x360b3d,_0x42a726,_0x4d17b2,_0x1a69a4){if(_0x360b3d){if(_[_0x7f71('0x15')](integrations,_0x503a21[_0x7f71('0x16')][_0x7f71('0x17')]())){try{var _0x3e716c=null;var _0x1f3d50='';var _0xc48e75=_0x360b3d[_0x503a21[_0x7f71('0x16')][_0x7f71('0x17')]()];if(_0xc48e75){var _0x1ba9ea=_0xc48e75[_0x503a21[_0x7f71('0x18')]];if(_0x1ba9ea){var _0x22b30d=_['find'](_0x1ba9ea[_0x7f71('0x19')],{'id':parseInt(_0x503a21[_0x7f71('0x1a')],0xa)});if(_0x22b30d){if(_0x42a726){if(_0x4d17b2&&_0x5c7d58[_0x7f71('0x1b')]){_0x1f3d50='queue';}else if(_0x5c7d58['routeId']){_0x1f3d50='outbound';}else{console['log'](_0x7f71('0x1c'),_0x5c7d58);}}else{_0x1f3d50=_0x7f71('0x1d');}switch(_0x503a21['data1']['toLowerCase']()){case'zendesk':zendesk[_0x1f3d50](_0x503a21,_0x5c7d58,_0x22b30d,_0x42a726,_0x4d17b2,_0x1ba9ea,_0x1a69a4);break;case _0x7f71('0xd'):salesforce[_0x1f3d50](_0x503a21,_0x5c7d58,_0x22b30d,_0x42a726,_0x4d17b2,_0x1ba9ea,_0x1a69a4);break;case'sugarcrm':sugarcrm[_0x1f3d50](_0x503a21,_0x5c7d58,_0x22b30d,_0x42a726,_0x4d17b2,_0x1ba9ea,_0x1a69a4);break;case _0x7f71('0xe'):freshdesk[_0x1f3d50](_0x503a21,_0x5c7d58,_0x22b30d,_0x42a726,_0x4d17b2,_0x1ba9ea,_0x1a69a4);break;case _0x7f71('0xf'):zoho[_0x1f3d50](_0x503a21,_0x5c7d58,_0x22b30d,_0x42a726,_0x4d17b2,_0x1ba9ea,_0x1a69a4);break;case'desk':desk[_0x1f3d50](_0x503a21,_0x5c7d58,_0x22b30d,_0x42a726,_0x4d17b2,_0x1ba9ea,_0x1a69a4);break;case'vtiger':vtiger[_0x1f3d50](_0x503a21,_0x5c7d58,_0x22b30d,_0x42a726,_0x4d17b2,_0x1ba9ea,_0x1a69a4);break;case'freshsales':freshsales['cs'](_0x503a21,_0x5c7d58,_0x22b30d,_0x42a726,_0x4d17b2,_0x1ba9ea,_0x1a69a4,_0x1f3d50);break;case _0x7f71('0x1e'):servicenow['cs'](_0x503a21,_0x5c7d58,_0x22b30d,_0x42a726,_0x4d17b2,_0x1ba9ea,_0x1a69a4,_0x1f3d50);break;case _0x7f71('0x12'):dynamics365['cs'](_0x503a21,_0x5c7d58,_0x22b30d,_0x42a726,_0x4d17b2,_0x1ba9ea,_0x1a69a4,_0x1f3d50);break;default:console['log'](_0x7f71('0x1f'));}}else{_0x3e716c=require(_0x7f71('0x20'))(_0x503a21['data1'][_0x7f71('0x17')]());_0x3e716c[_0x7f71('0x21')]('[EXEC]',util[_0x7f71('0x22')](_0x7f71('0x23'),_0x503a21[_0x7f71('0x16')][_0x7f71('0x17')](),_0x503a21[_0x7f71('0x1a')]));}}else{_0x3e716c=require(_0x7f71('0x20'))(_0x503a21['data1']['toLowerCase']());_0x3e716c[_0x7f71('0x21')](_0x7f71('0x24'),util[_0x7f71('0x22')](_0x7f71('0x25'),_0x503a21[_0x7f71('0x16')][_0x7f71('0x17')](),_0x503a21[_0x7f71('0x18')]));}}else{}}catch(_0x4e20d2){console[_0x7f71('0x21')](_0x4e20d2);}}}};
\ No newline at end of file
+var _0x9a40=['zendesk','salesforce','sugarcrm','freshdesk','desk','vtiger','dynamics365','freshsales','exec','includes','data1','toLowerCase','data2','find','data3','queue','routeId','outbound','EVENT\x20UNKNOWN','unmanaged','zoho','servicenow','log','error','[EXEC]','format','../../../../config/logger','util','./zendesk','./freshdesk','./desk','./vtiger','./dynamics365','./freshsales'];(function(_0x18a529,_0x2bea53){var _0x216fb8=function(_0x537d25){while(--_0x537d25){_0x18a529['push'](_0x18a529['shift']());}};_0x216fb8(++_0x2bea53);}(_0x9a40,0x12b));var _0x09a4=function(_0x11c241,_0x549297){_0x11c241=_0x11c241-0x0;var _0x1e668a=_0x9a40[_0x11c241];return _0x1e668a;};'use strict';var _=require('lodash');var util=require(_0x09a4('0x0'));var zendesk=require(_0x09a4('0x1'));var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x09a4('0x2'));var zoho=require('./zoho');var desk=require(_0x09a4('0x3'));var vtiger=require(_0x09a4('0x4'));var servicenow=require('./servicenow');var dynamics365=require(_0x09a4('0x5'));var freshsales=require(_0x09a4('0x6'));var integrations=[_0x09a4('0x7'),_0x09a4('0x8'),_0x09a4('0x9'),_0x09a4('0xa'),'zoho',_0x09a4('0xb'),_0x09a4('0xc'),_0x09a4('0xd'),_0x09a4('0xe'),'servicenow'];exports[_0x09a4('0xf')]=function(_0x4e4b90,_0x5b0636,_0x79ae61,_0x54a8ae,_0x19d1ea,_0x180382){if(_0x79ae61){if(_[_0x09a4('0x10')](integrations,_0x4e4b90[_0x09a4('0x11')][_0x09a4('0x12')]())){try{var _0x560fe0=null;var _0x375767='';var _0xbdbc58=_0x79ae61[_0x4e4b90[_0x09a4('0x11')]['toLowerCase']()];if(_0xbdbc58){var _0x323134=_0xbdbc58[_0x4e4b90[_0x09a4('0x13')]];if(_0x323134){var _0x5acf02=_[_0x09a4('0x14')](_0x323134['Configurations'],{'id':parseInt(_0x4e4b90[_0x09a4('0x15')],0xa)});if(_0x5acf02){if(_0x54a8ae){if(_0x19d1ea&&_0x5b0636[_0x09a4('0x16')]){_0x375767=_0x09a4('0x16');}else if(_0x5b0636[_0x09a4('0x17')]){_0x375767=_0x09a4('0x18');}else{console['log'](_0x09a4('0x19'),_0x5b0636);}}else{_0x375767=_0x09a4('0x1a');}switch(_0x4e4b90['data1']['toLowerCase']()){case _0x09a4('0x7'):zendesk[_0x375767](_0x4e4b90,_0x5b0636,_0x5acf02,_0x54a8ae,_0x19d1ea,_0x323134,_0x180382);break;case'salesforce':salesforce[_0x375767](_0x4e4b90,_0x5b0636,_0x5acf02,_0x54a8ae,_0x19d1ea,_0x323134,_0x180382);break;case _0x09a4('0x9'):sugarcrm[_0x375767](_0x4e4b90,_0x5b0636,_0x5acf02,_0x54a8ae,_0x19d1ea,_0x323134,_0x180382);break;case _0x09a4('0xa'):freshdesk[_0x375767](_0x4e4b90,_0x5b0636,_0x5acf02,_0x54a8ae,_0x19d1ea,_0x323134,_0x180382);break;case _0x09a4('0x1b'):zoho[_0x375767](_0x4e4b90,_0x5b0636,_0x5acf02,_0x54a8ae,_0x19d1ea,_0x323134,_0x180382);break;case _0x09a4('0xb'):desk[_0x375767](_0x4e4b90,_0x5b0636,_0x5acf02,_0x54a8ae,_0x19d1ea,_0x323134,_0x180382);break;case _0x09a4('0xc'):vtiger[_0x375767](_0x4e4b90,_0x5b0636,_0x5acf02,_0x54a8ae,_0x19d1ea,_0x323134,_0x180382);break;case'freshsales':freshsales['cs'](_0x4e4b90,_0x5b0636,_0x5acf02,_0x54a8ae,_0x19d1ea,_0x323134,_0x180382,_0x375767);break;case _0x09a4('0x1c'):servicenow['cs'](_0x4e4b90,_0x5b0636,_0x5acf02,_0x54a8ae,_0x19d1ea,_0x323134,_0x180382,_0x375767);break;case _0x09a4('0xd'):dynamics365['cs'](_0x4e4b90,_0x5b0636,_0x5acf02,_0x54a8ae,_0x19d1ea,_0x323134,_0x180382,_0x375767);break;default:console[_0x09a4('0x1d')]('unknown\x20integration');}}else{_0x560fe0=require('../../../../config/logger')(_0x4e4b90['data1'][_0x09a4('0x12')]());_0x560fe0[_0x09a4('0x1e')](_0x09a4('0x1f'),util[_0x09a4('0x20')]('%s\x20configuration\x20#%s\x20not\x20found',_0x4e4b90[_0x09a4('0x11')]['toLowerCase'](),_0x4e4b90[_0x09a4('0x15')]));}}else{_0x560fe0=require(_0x09a4('0x21'))(_0x4e4b90[_0x09a4('0x11')][_0x09a4('0x12')]());_0x560fe0[_0x09a4('0x1e')](_0x09a4('0x1f'),util[_0x09a4('0x20')]('%s\x20account\x20#%s\x20not\x20found',_0x4e4b90['data1']['toLowerCase'](),_0x4e4b90[_0x09a4('0x13')]));}}else{}}catch(_0x420db9){console[_0x09a4('0x1e')](_0x420db9);}}}};
\ No newline at end of file
index e9bacca..f5f4b1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed85=['Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','Company','No\x20Company','upperFirst','forEach','includes','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','Fields','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','[OUTBOUND]','destcalleridname','user:%s','newTab','trigger:browser:url','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase','calleridname',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','bluebird','jsforce','./util','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','emit','getString','Subjects','Descriptions','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','lead','account','ticketType','Case','contact','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','find','length','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','then','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','additionalSearchContact','Contact','execute','cloneDeep','additionalSearchLead','merge','$or','Lead','account_contact_lead','additionalSearchAccount','Phone','attributes','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','<unknown>','format','Caller\x20-\x20%s'];(function(_0x10dfca,_0x584d2c){var _0x1dc3ea=function(_0x1acc3e){while(--_0x1acc3e){_0x10dfca['push'](_0x10dfca['shift']());}};_0x1dc3ea(++_0x584d2c);}(_0xed85,0x1b0));var _0x5ed8=function(_0x2d8d69,_0x8e47ff){_0x2d8d69=_0x2d8d69-0x0;var _0x39ae22=_0xed85[_0x2d8d69];return _0x39ae22;};'use strict';var _=require(_0x5ed8('0x0'));var rp=require(_0x5ed8('0x1'));var moment=require('moment');var BPromise=require(_0x5ed8('0x2'));var md5=require('md5');var jsforce=require(_0x5ed8('0x3'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x5ed8('0x4'));var config=require('../../../../config/environment');var logger=require(_0x5ed8('0x5'))('salesforce');config['redis']=_[_0x5ed8('0x6')](config[_0x5ed8('0x7')],{'host':_0x5ed8('0x8'),'port':0x18eb});var io=require(_0x5ed8('0x9'))(new Redis(config['redis']));function emit(_0x564bc3,_0xfc6d80,_0x535392){io['to'](_0x564bc3)[_0x5ed8('0xa')](_0xfc6d80,_0x535392);}function getTicket(_0x3da7db,_0x58e74b,_0x513999,_0x16fa6b,_0x2450af,_0x1dcbe2,_0x5d1c5c,_0xa53749){var _0x4117c7=Object['assign']({},{'OwnerId':_0x58e74b['id'],'Subject':intUtil[_0x5ed8('0xb')](_0x16fa6b[_0x5ed8('0xc')],_0x2450af,'\x20'),'Description':intUtil[_0x5ed8('0xb')](_0x16fa6b[_0x5ed8('0xd')],_0x2450af,'\x0a')},getCustomFields(_0x1dcbe2,_0x2450af));if(_0x513999){if(_0x16fa6b['ticketType']==='Task'){_0x4117c7[_0x5ed8('0xe')]=moment[_0x5ed8('0xf')]();_0x4117c7[_0x5ed8('0x10')]=![];_0x4117c7[_0x5ed8('0x11')]=![];if(_0x513999[_0x5ed8('0x12')]==='contact'||_0x513999[_0x5ed8('0x12')]===_0x5ed8('0x13')){_0x4117c7['WhoId']=_0x513999['id'];}else if(_0x513999[_0x5ed8('0x12')]===_0x5ed8('0x14')){_0x4117c7['WhatId']=_0x513999['id'];}}else if(_0x16fa6b[_0x5ed8('0x15')]===_0x5ed8('0x16')){if(_0x513999['endUserType']===_0x5ed8('0x17')){_0x4117c7[_0x5ed8('0x18')]=_0x513999['id'];}else if(_0x513999['endUserType']===_0x5ed8('0x14')){_0x4117c7[_0x5ed8('0x19')]=_0x513999['id'];}else if(_0x513999[_0x5ed8('0x12')]==='lead'&&_0x16fa6b['leadId']){_0x4117c7[_0x16fa6b[_0x5ed8('0x1a')]]=_0x513999['id'];}else{logger[_0x5ed8('0x1b')](_0x5ed8('0x1c'));}}}return _0x5d1c5c[_0x5ed8('0x1d')](_0x16fa6b['ticketType'])[_0x5ed8('0x1e')](_0x4117c7);}function getUser(_0x3f942f,_0x8b8b49,_0x471161){if(!_[_0x5ed8('0x1f')](_0x8b8b49)&&intUtil[_0x5ed8('0x20')](_0x8b8b49)){var _0x2a812f={'Email':_0x8b8b49};var _0x4e38c5={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x471161[_0x5ed8('0x1d')]('User')[_0x5ed8('0x21')](_0x2a812f,_0x4e38c5)['execute']()['then'](function(_0x5c993e){if(_0x5c993e[_0x5ed8('0x22')]){var _0x20ec9c=_[_0x5ed8('0x21')](_0x5c993e,function(_0x80faa7){return _0x80faa7[_0x5ed8('0x23')]===_0x8b8b49;});if(_0x20ec9c){logger[_0x5ed8('0x1b')](_0x5ed8('0x24'),_0x8b8b49);return BPromise[_0x5ed8('0x25')]({'id':_0x20ec9c['Id'],'name':_0x20ec9c[_0x5ed8('0x26')]});}}else{logger[_0x5ed8('0x1b')](_0x5ed8('0x27'),_0x8b8b49);return _0x471161[_0x5ed8('0x28')]()[_0x5ed8('0x29')](function(_0x10f97f){return BPromise[_0x5ed8('0x25')]({'id':_0x10f97f[_0x5ed8('0x2a')],'name':_0x10f97f['display_name']});});}});}else{logger[_0x5ed8('0x1b')](_0x5ed8('0x27'),_0x8b8b49);return _0x471161[_0x5ed8('0x28')]()[_0x5ed8('0x29')](function(_0xa274cd){return BPromise[_0x5ed8('0x25')]({'id':_0xa274cd['user_id'],'name':_0xa274cd['display_name']});});}}function getEndUser(_0x47a6f1,_0x4f7562,_0x264112,_0x17351b,_0x549298){var _0x4138e6={'$or':{'Phone':_0x17351b}};var _0xc4d7d0={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x5ed8('0x25')]()['then'](function(){logger[_0x5ed8('0x1b')](_0x5ed8('0x2b'),_0x17351b,_0x4f7562['moduleSearch']);switch(_0x4f7562[_0x5ed8('0x2c')]){case _0x5ed8('0x2d'):var _0x426950=_['cloneDeep'](_0x4138e6);if(_0x4f7562[_0x5ed8('0x2e')]){var _0x2ff222={};_0x2ff222[_0x4f7562[_0x5ed8('0x2e')]]=_0x17351b;_['merge'](_0x426950['$or'],_0x2ff222);}return _0x549298[_0x5ed8('0x1d')](_0x5ed8('0x2f'))[_0x5ed8('0x21')](_0x426950,_0xc4d7d0)[_0x5ed8('0x30')]()[_0x5ed8('0x29')](function(_0x52e0bc){if(_0x52e0bc&&_0x52e0bc[_0x5ed8('0x22')]){return _0x52e0bc;}else{var _0x2342ae=_[_0x5ed8('0x31')](_0x4138e6);if(_0x4f7562[_0x5ed8('0x32')]){var _0x15154a={};_0x15154a[_0x4f7562[_0x5ed8('0x32')]]=_0x17351b;_[_0x5ed8('0x33')](_0x2342ae[_0x5ed8('0x34')],_0x15154a);}return _0x549298['sobject'](_0x5ed8('0x35'))[_0x5ed8('0x21')](_0x2342ae,_0xc4d7d0);}});case _0x5ed8('0x36'):var _0x13e50a=_['cloneDeep'](_0x4138e6);if(_0x4f7562[_0x5ed8('0x37')]){var _0x2ff222={};_0x2ff222[_0x4f7562['additionalSearchAccount']]=_0x17351b;_[_0x5ed8('0x33')](_0x13e50a[_0x5ed8('0x34')],_0x2ff222);}return _0x549298['sobject']('Account')[_0x5ed8('0x21')](_0x13e50a,_0xc4d7d0)[_0x5ed8('0x30')]()['then'](function(_0x5043bc){if(_0x5043bc&&_0x5043bc[_0x5ed8('0x22')]){return _0x5043bc;}else{var _0x1b7dd6=_[_0x5ed8('0x31')](_0x4138e6);if(_0x4f7562[_0x5ed8('0x2e')]){var _0x42d44c={};_0x42d44c[_0x4f7562[_0x5ed8('0x2e')]]=_0x17351b;_[_0x5ed8('0x33')](_0x1b7dd6[_0x5ed8('0x34')],_0x42d44c);}return _0x549298['sobject'](_0x5ed8('0x2f'))[_0x5ed8('0x21')](_0x1b7dd6,_0xc4d7d0)[_0x5ed8('0x29')](function(_0xed1a88){if(_0xed1a88&&_0xed1a88[_0x5ed8('0x22')]){return _0xed1a88;}else{var _0x9437bb=_[_0x5ed8('0x31')](_0x4138e6);if(_0x4f7562[_0x5ed8('0x32')]){var _0x4d617a={};_0x4d617a[_0x4f7562['additionalSearchLead']]=_0x17351b;_['merge'](_0x9437bb[_0x5ed8('0x34')],_0x4d617a);}return _0x549298[_0x5ed8('0x1d')](_0x5ed8('0x35'))[_0x5ed8('0x21')](_0x9437bb,_0xc4d7d0);}});}});case'contact':var _0x426950=_[_0x5ed8('0x31')](_0x4138e6);if(_0x4f7562[_0x5ed8('0x2e')]){var _0x2ff222={};_0x2ff222[_0x4f7562['additionalSearchContact']]=_0x17351b;_['merge'](_0x426950['$or'],_0x2ff222);}return _0x549298[_0x5ed8('0x1d')](_0x5ed8('0x2f'))[_0x5ed8('0x21')](_0x426950,_0xc4d7d0)[_0x5ed8('0x30')]();case _0x5ed8('0x13'):var _0x57e066=_['cloneDeep'](_0x4138e6);if(_0x4f7562['additionalSearchLead']){var _0x2ff222={};_0x2ff222[_0x4f7562[_0x5ed8('0x32')]]=_0x17351b;_[_0x5ed8('0x33')](_0x57e066[_0x5ed8('0x34')],_0x2ff222);}return _0x549298[_0x5ed8('0x1d')]('Lead')[_0x5ed8('0x21')](_0x57e066,_0xc4d7d0);case _0x5ed8('0x14'):var _0x13e50a=_[_0x5ed8('0x31')](_0x4138e6);if(_0x4f7562[_0x5ed8('0x37')]){var _0x2ff222={};_0x2ff222[_0x4f7562['additionalSearchAccount']]=_0x17351b;_[_0x5ed8('0x33')](_0x13e50a[_0x5ed8('0x34')],_0x2ff222);}return _0x549298['sobject']('Account')[_0x5ed8('0x21')](_0x13e50a,_0xc4d7d0);default:return null;}})[_0x5ed8('0x29')](function(_0x7acb26){if(_0x7acb26&&_0x7acb26['length']){var _0x1a86fc=_['first'](_0x7acb26);if(_0x1a86fc){return BPromise[_0x5ed8('0x25')]({'id':_0x1a86fc['Id'],'name':_0x1a86fc['Name'],'phone':_0x1a86fc[_0x5ed8('0x38')],'endUserType':_0x1a86fc[_0x5ed8('0x39')]['type'][_0x5ed8('0x3a')]()});}}})[_0x5ed8('0x29')](function(_0x21f584){if(_0x21f584){logger[_0x5ed8('0x1b')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x21f584['endUserType'],_0x17351b);return BPromise[_0x5ed8('0x25')](_0x21f584);}else{logger[_0x5ed8('0x1b')](_0x5ed8('0x3b'),_0x17351b);var _0x492ed2={'Phone':_0x17351b};if(_0x4f7562[_0x5ed8('0x3c')]){if(_0x4f7562[_0x5ed8('0x3c')]==='contact'){logger[_0x5ed8('0x1b')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x17351b,_0x4f7562[_0x5ed8('0x3c')]);_0x492ed2['LastName']=_0x264112!==_0x5ed8('0x3d')?_0x264112:util[_0x5ed8('0x3e')](_0x5ed8('0x3f'),_0x17351b);}else if(_0x4f7562[_0x5ed8('0x3c')]===_0x5ed8('0x13')){logger['info'](_0x5ed8('0x40'),_0x17351b,_0x4f7562[_0x5ed8('0x3c')]);_0x492ed2[_0x5ed8('0x41')]=_0x264112!==_0x5ed8('0x3d')?_0x264112:util[_0x5ed8('0x3e')](_0x5ed8('0x3f'),_0x17351b);_0x492ed2[_0x5ed8('0x42')]=_0x5ed8('0x43');}else if(_0x4f7562[_0x5ed8('0x3c')]===_0x5ed8('0x14')){logger['info'](_0x5ed8('0x40'),_0x17351b,_0x4f7562[_0x5ed8('0x3c')]);_0x492ed2[_0x5ed8('0x26')]=_0x264112!==_0x5ed8('0x3d')?_0x264112:util[_0x5ed8('0x3e')]('Caller\x20-\x20%s',_0x17351b);}else{return null;}}return _0x549298[_0x5ed8('0x1d')](_[_0x5ed8('0x44')](_0x4f7562[_0x5ed8('0x3c')]))['create'](_0x492ed2)[_0x5ed8('0x29')](function(_0x4303bc){return BPromise[_0x5ed8('0x25')]({'id':_0x4303bc['id'],'endUserType':_0x4f7562[_0x5ed8('0x3c')]});});}});}function getCustomFields(_0x329882,_0x24d6b7){var _0x56e051={};if(_0x329882[_0x5ed8('0x22')]>0x0){_[_0x5ed8('0x45')](_0x329882,function(_0xc08b93){if(_[_0x5ed8('0x46')](['string',_0x5ed8('0x47')],_0xc08b93[_0x5ed8('0x48')])&&_0xc08b93[_0x5ed8('0x49')]){_0x56e051[_0xc08b93[_0x5ed8('0x49')]]=_0xc08b93[_0x5ed8('0x4a')][_0x5ed8('0x4b')]();}else if(_0xc08b93['type']===_0x5ed8('0x4c')&&_0xc08b93[_0x5ed8('0x4d')]&&_0xc08b93[_0x5ed8('0x49')]){_0x24d6b7[_0xc08b93[_0x5ed8('0x4d')]]&&(_0x56e051[_0xc08b93[_0x5ed8('0x49')]]=_0x24d6b7[_0xc08b93[_0x5ed8('0x4d')]][_0x5ed8('0x4b')]());}else if(_0xc08b93['type']===_0x5ed8('0x4e')&&_0xc08b93[_0x5ed8('0x4f')]&&_0xc08b93['Variable'][_0x5ed8('0x50')]&&_0xc08b93['idField']){_0x24d6b7[_0xc08b93[_0x5ed8('0x4f')]['name'][_0x5ed8('0x3a')]()]&&(_0x56e051[_0xc08b93[_0x5ed8('0x49')]]=_0x24d6b7[_0xc08b93[_0x5ed8('0x4f')][_0x5ed8('0x50')][_0x5ed8('0x3a')]()][_0x5ed8('0x4b')]());}});}return _0x56e051;}function getConnection(_0x1a960e){var _0xe4f6fa=_0x1a960e[_0x5ed8('0x51')][_0x5ed8('0x52')](_0x1a960e[_0x5ed8('0x53')]);var _0x3b30e9=new jsforce[(_0x5ed8('0x54'))]({'oauth2':{'loginUrl':_0x1a960e[_0x5ed8('0x55')]||_0x5ed8('0x56'),'clientId':_0x1a960e[_0x5ed8('0x57')],'clientSecret':_0x1a960e[_0x5ed8('0x58')]}});return _0x3b30e9['login'](_0x1a960e[_0x5ed8('0x59')],_0xe4f6fa)[_0x5ed8('0x29')](function(){logger[_0x5ed8('0x1b')](_0x5ed8('0x5a'));return _0x3b30e9;});}exports[_0x5ed8('0x5b')]=function(_0x494fa8,_0x41b38f,_0x12f59a,_0x36d5a4,_0x18db5f,_0x354cd0){var _0x32ee38,_0x373a19,_0x4e7cb3,_0x35cc4c;_0x354cd0[_0x5ed8('0x5c')]=intUtil[_0x5ed8('0x5d')](_0x354cd0[_0x5ed8('0x5c')]);_0x354cd0['remoteUri']=intUtil[_0x5ed8('0x5d')](_0x354cd0[_0x5ed8('0x55')]);if(_0x18db5f&&_0x18db5f[_0x5ed8('0x5e')]){logger['info'](_0x5ed8('0x5f'),_0x5ed8('0x60'));_0x41b38f[_0x5ed8('0x61')]=util[_0x5ed8('0x3e')](_0x5ed8('0x62'),_0x354cd0['serverUrl'],_0x41b38f[_0x5ed8('0x63')],md5(_0x41b38f[_0x5ed8('0x63')]));}else{_0x41b38f[_0x5ed8('0x61')]='';}return getConnection(_0x354cd0)[_0x5ed8('0x29')](function(_0x2651ae){_0x35cc4c=_0x2651ae;return getUser(_0x354cd0,_0x36d5a4[_0x5ed8('0x64')],_0x35cc4c);})[_0x5ed8('0x29')](function(_0x3beacc){_0x32ee38=_0x3beacc;return getEndUser(_0x354cd0,_0x12f59a,_0x41b38f['calleridname'],_0x41b38f[_0x5ed8('0x65')],_0x35cc4c);})[_0x5ed8('0x29')](function(_0x16fc45){_0x373a19=_0x16fc45;return getTicket(_0x354cd0,_0x32ee38,_0x373a19,_0x12f59a,_0x41b38f,_0x12f59a[_0x5ed8('0x66')],_0x35cc4c,_0x5ed8('0x5b'));})[_0x5ed8('0x29')](function(_0x1b1c74){_0x4e7cb3=_0x1b1c74;logger[_0x5ed8('0x1b')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x4e7cb3['id']);logger[_0x5ed8('0x1b')](_0x5ed8('0x67'),_0x4e7cb3['id'],_0x36d5a4['name'],_0x354cd0['type']);switch(_0x354cd0['type']){case _0x5ed8('0x68'):emit(util[_0x5ed8('0x3e')]('user:%s',_0x36d5a4[_0x5ed8('0x50')]),_0x5ed8('0x69'),{'recordId':_0x4e7cb3['id']});break;case'newTab':emit(util[_0x5ed8('0x3e')]('user:%s',_0x36d5a4[_0x5ed8('0x50')]),'trigger:browser:url',{'uri':util[_0x5ed8('0x3e')](_0x5ed8('0x6a'),_0x35cc4c[_0x5ed8('0x6b')],_0x4e7cb3['id'])});break;default:logger[_0x5ed8('0x6c')](_0x5ed8('0x6d'));}})[_0x5ed8('0x6e')](function(_0x961132){logger['error']('[QUEUE]',_0x961132);});};exports[_0x5ed8('0x6f')]=function(_0x586428,_0x4fc829,_0x16629a,_0xb6aaca,_0x5c4f29,_0x5c42a4,_0x4eedd2){var _0x2e1fde,_0x118f21,_0x120bb7,_0x2a74d0;_0x5c42a4[_0x5ed8('0x5c')]=intUtil[_0x5ed8('0x5d')](_0x5c42a4[_0x5ed8('0x5c')]);_0x5c42a4[_0x5ed8('0x55')]=intUtil[_0x5ed8('0x5d')](_0x5c42a4[_0x5ed8('0x55')]);if(_0x4eedd2&&_0x4eedd2[_0x5ed8('0x70')]&&_0x4eedd2[_0x5ed8('0x70')]!=='none'){logger[_0x5ed8('0x1b')](_0x5ed8('0x71'),_0x5ed8('0x60'));_0x4fc829[_0x5ed8('0x61')]=util[_0x5ed8('0x3e')](_0x5ed8('0x62'),_0x5c42a4[_0x5ed8('0x5c')],_0x4fc829[_0x5ed8('0x63')],md5(_0x4fc829[_0x5ed8('0x63')]));}return getConnection(_0x5c42a4)[_0x5ed8('0x29')](function(_0x27382a){_0x2a74d0=_0x27382a;return getUser(_0x5c42a4,_0xb6aaca[_0x5ed8('0x64')],_0x2a74d0);})['then'](function(_0x44cffa){_0x2e1fde=_0x44cffa;return getEndUser(_0x5c42a4,_0x16629a,_0x4fc829[_0x5ed8('0x72')],_0x4fc829['destcalleridnum'],_0x2a74d0);})[_0x5ed8('0x29')](function(_0x89c99a){_0x118f21=_0x89c99a;return getTicket(_0x5c42a4,_0x2e1fde,_0x118f21,_0x16629a,_0x4fc829,_0x16629a[_0x5ed8('0x66')],_0x2a74d0,_0x5ed8('0x6f'));})[_0x5ed8('0x29')](function(_0x30e376){_0x120bb7=_0x30e376;logger[_0x5ed8('0x1b')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x120bb7['id']);logger[_0x5ed8('0x1b')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x120bb7['id'],_0xb6aaca[_0x5ed8('0x50')],_0x5c42a4[_0x5ed8('0x48')]);switch(_0x5c42a4[_0x5ed8('0x48')]){case _0x5ed8('0x68'):emit(util[_0x5ed8('0x3e')](_0x5ed8('0x73'),_0xb6aaca[_0x5ed8('0x50')]),_0x5ed8('0x69'),{'recordId':_0x120bb7['id']});break;case _0x5ed8('0x74'):emit(util['format'](_0x5ed8('0x73'),_0xb6aaca[_0x5ed8('0x50')]),_0x5ed8('0x75'),{'uri':util['format'](_0x5ed8('0x6a'),_0x2a74d0[_0x5ed8('0x6b')],_0x120bb7['id'])});break;default:logger[_0x5ed8('0x6c')]('[OUTBOUND]',_0x5ed8('0x76'));}})[_0x5ed8('0x6e')](function(_0x269133){logger[_0x5ed8('0x6c')](_0x5ed8('0x71'),_0x269133);});};exports[_0x5ed8('0x77')]=function(_0x4df85a,_0x1aeb11,_0x3eff77,_0x2497f2,_0x5204c5,_0x7d7db8){var _0x198aa7,_0x3f1a26,_0x4e2b7b,_0x5b86db;_0x7d7db8['serverUrl']=intUtil['stripTrailingSlash'](_0x7d7db8[_0x5ed8('0x5c')]);_0x7d7db8[_0x5ed8('0x55')]=intUtil['stripTrailingSlash'](_0x7d7db8['remoteUri']);if(_0x5204c5&&_0x5204c5['monitor_format']){logger[_0x5ed8('0x1b')]('['+_0x1aeb11[_0x5ed8('0x78')][_0x5ed8('0x79')]()+']','Recording\x20is\x20enabled!');_0x1aeb11[_0x5ed8('0x61')]=util[_0x5ed8('0x3e')](_0x5ed8('0x62'),_0x7d7db8[_0x5ed8('0x5c')],_0x1aeb11[_0x5ed8('0x63')],md5(_0x1aeb11[_0x5ed8('0x63')]));}else{_0x1aeb11[_0x5ed8('0x61')]='';}return getConnection(_0x7d7db8)['then'](function(_0x3cb158){_0x5b86db=_0x3cb158;if(!_[_0x5ed8('0x1f')](_0x2497f2)){return getUser(_0x7d7db8,_0x2497f2[_0x5ed8('0x50')],_0x5b86db);}else{return getUser(_0x7d7db8,null,_0x5b86db);}})[_0x5ed8('0x29')](function(_0x22ccd7){_0x198aa7=_0x22ccd7;return getEndUser(_0x7d7db8,_0x3eff77,_0x1aeb11[_0x5ed8('0x7a')],_0x1aeb11[_0x5ed8('0x65')],_0x5b86db);})[_0x5ed8('0x29')](function(_0x5ebd46){_0x3f1a26=_0x5ebd46;return getTicket(_0x7d7db8,_0x198aa7,_0x3f1a26,_0x3eff77,_0x1aeb11,_0x3eff77[_0x5ed8('0x66')],_0x5b86db);})[_0x5ed8('0x29')](function(_0x254b05){_0x4e2b7b=_0x254b05;logger['info']('['+_0x1aeb11[_0x5ed8('0x78')][_0x5ed8('0x79')]()+']\x20Ticket\x20%s\x20created.',_0x4e2b7b['id']);logger[_0x5ed8('0x1b')]('['+_0x1aeb11[_0x5ed8('0x78')][_0x5ed8('0x79')]()+_0x5ed8('0x7b'),_0x7d7db8[_0x5ed8('0x48')]);})[_0x5ed8('0x6e')](function(_0x19499c){logger[_0x5ed8('0x6c')]('['+_0x1aeb11['lastevent'][_0x5ed8('0x79')]()+']',_0x19499c);});};
\ No newline at end of file
+var _0xceff=['idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase','password','concat','Connection','remoteUri','https://login.salesforce.com','clientId','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','Fields','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','user:%s','trigger:salesforce:display','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','[QUEUE]','outbound','recordingFormat','none','destcalleridname','destcalleridnum','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','[OUTBOUND]','unmanaged','lastevent','Recording\x20is\x20enabled!','calleridnum','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','util','ioredis','../../../../config/environment','salesforce','redis','localhost','socket.io-emitter','emit','getString','ticketType','Task','ActivityDate','IsReminderSet','IsRecurrence','endUserType','contact','lead','account','Case','ContactId','AccountId','leadId','info','sobject','create','isNil','validateEmail','find','execute','then','length','Email','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','contact_lead','cloneDeep','additionalSearchContact','merge','$or','additionalSearchLead','Lead','additionalSearchAccount','Contact','Account','first','Phone','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','<unknown>','format','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','upperFirst','includes','string','picklist'];(function(_0x336722,_0x56875d){var _0x3db935=function(_0x563efc){while(--_0x563efc){_0x336722['push'](_0x336722['shift']());}};_0x3db935(++_0x56875d);}(_0xceff,0x1ab));var _0xfcef=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xceff[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xfcef('0x0'));var rp=require(_0xfcef('0x1'));var moment=require(_0xfcef('0x2'));var BPromise=require(_0xfcef('0x3'));var md5=require(_0xfcef('0x4'));var jsforce=require(_0xfcef('0x5'));var util=require(_0xfcef('0x6'));var Redis=require(_0xfcef('0x7'));var intUtil=require('./util');var config=require(_0xfcef('0x8'));var logger=require('../../../../config/logger')(_0xfcef('0x9'));config[_0xfcef('0xa')]=_['defaults'](config[_0xfcef('0xa')],{'host':_0xfcef('0xb'),'port':0x18eb});var io=require(_0xfcef('0xc'))(new Redis(config[_0xfcef('0xa')]));function emit(_0x3e0e84,_0x40e773,_0x449076){io['to'](_0x3e0e84)[_0xfcef('0xd')](_0x40e773,_0x449076);}function getTicket(_0x32cb9b,_0x591ee8,_0x204f2d,_0x51a313,_0x1acdc1,_0x383043,_0x1c8b63,_0x26a83d){var _0x1c4502=Object['assign']({},{'OwnerId':_0x591ee8['id'],'Subject':intUtil[_0xfcef('0xe')](_0x51a313['Subjects'],_0x1acdc1,'\x20'),'Description':intUtil[_0xfcef('0xe')](_0x51a313['Descriptions'],_0x1acdc1,'\x0a')},getCustomFields(_0x383043,_0x1acdc1));if(_0x204f2d){if(_0x51a313[_0xfcef('0xf')]===_0xfcef('0x10')){_0x1c4502[_0xfcef('0x11')]=moment['utc']();_0x1c4502[_0xfcef('0x12')]=![];_0x1c4502[_0xfcef('0x13')]=![];if(_0x204f2d[_0xfcef('0x14')]===_0xfcef('0x15')||_0x204f2d['endUserType']===_0xfcef('0x16')){_0x1c4502['WhoId']=_0x204f2d['id'];}else if(_0x204f2d[_0xfcef('0x14')]===_0xfcef('0x17')){_0x1c4502['WhatId']=_0x204f2d['id'];}}else if(_0x51a313[_0xfcef('0xf')]===_0xfcef('0x18')){if(_0x204f2d['endUserType']===_0xfcef('0x15')){_0x1c4502[_0xfcef('0x19')]=_0x204f2d['id'];}else if(_0x204f2d[_0xfcef('0x14')]===_0xfcef('0x17')){_0x1c4502[_0xfcef('0x1a')]=_0x204f2d['id'];}else if(_0x204f2d[_0xfcef('0x14')]===_0xfcef('0x16')&&_0x51a313[_0xfcef('0x1b')]){_0x1c4502[_0x51a313[_0xfcef('0x1b')]]=_0x204f2d['id'];}else{logger[_0xfcef('0x1c')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x1c8b63[_0xfcef('0x1d')](_0x51a313[_0xfcef('0xf')])[_0xfcef('0x1e')](_0x1c4502);}function getUser(_0x4b1509,_0x23c5c9,_0x52d1bb){if(!_[_0xfcef('0x1f')](_0x23c5c9)&&intUtil[_0xfcef('0x20')](_0x23c5c9)){var _0x185802={'Email':_0x23c5c9};var _0x25721f={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x52d1bb[_0xfcef('0x1d')]('User')[_0xfcef('0x21')](_0x185802,_0x25721f)[_0xfcef('0x22')]()[_0xfcef('0x23')](function(_0x1f1db4){if(_0x1f1db4[_0xfcef('0x24')]){var _0x46a31a=_[_0xfcef('0x21')](_0x1f1db4,function(_0x402645){return _0x402645[_0xfcef('0x25')]===_0x23c5c9;});if(_0x46a31a){logger[_0xfcef('0x1c')]('Agent\x20%s\x20found.',_0x23c5c9);return BPromise[_0xfcef('0x26')]({'id':_0x46a31a['Id'],'name':_0x46a31a[_0xfcef('0x27')]});}}else{logger['info'](_0xfcef('0x28'),_0x23c5c9);return _0x52d1bb[_0xfcef('0x29')]()['then'](function(_0x2cc4ef){return BPromise[_0xfcef('0x26')]({'id':_0x2cc4ef[_0xfcef('0x2a')],'name':_0x2cc4ef['display_name']});});}});}else{logger[_0xfcef('0x1c')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x23c5c9);return _0x52d1bb[_0xfcef('0x29')]()[_0xfcef('0x23')](function(_0x7e4b73){return BPromise['resolve']({'id':_0x7e4b73['user_id'],'name':_0x7e4b73[_0xfcef('0x2b')]});});}}function getEndUser(_0x1be6cd,_0x530a65,_0x11d0ef,_0x4bf9e0,_0x5a7fa4){var _0x32cd7b={'$or':{'Phone':_0x4bf9e0}};var _0xd339fe={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xfcef('0x26')]()[_0xfcef('0x23')](function(){logger[_0xfcef('0x1c')](_0xfcef('0x2c'),_0x4bf9e0,_0x530a65['moduleSearch']);switch(_0x530a65['moduleSearch']){case _0xfcef('0x2d'):var _0x3c96fe=_[_0xfcef('0x2e')](_0x32cd7b);if(_0x530a65['additionalSearchContact']){var _0x5ea0b5={};_0x5ea0b5[_0x530a65[_0xfcef('0x2f')]]=_0x4bf9e0;_[_0xfcef('0x30')](_0x3c96fe[_0xfcef('0x31')],_0x5ea0b5);}return _0x5a7fa4[_0xfcef('0x1d')]('Contact')[_0xfcef('0x21')](_0x3c96fe,_0xd339fe)[_0xfcef('0x22')]()[_0xfcef('0x23')](function(_0x42d27b){if(_0x42d27b&&_0x42d27b[_0xfcef('0x24')]){return _0x42d27b;}else{var _0xe7186b=_[_0xfcef('0x2e')](_0x32cd7b);if(_0x530a65[_0xfcef('0x32')]){var _0x4c514c={};_0x4c514c[_0x530a65[_0xfcef('0x32')]]=_0x4bf9e0;_[_0xfcef('0x30')](_0xe7186b[_0xfcef('0x31')],_0x4c514c);}return _0x5a7fa4[_0xfcef('0x1d')](_0xfcef('0x33'))[_0xfcef('0x21')](_0xe7186b,_0xd339fe);}});case'account_contact_lead':var _0xeb6dc2=_['cloneDeep'](_0x32cd7b);if(_0x530a65['additionalSearchAccount']){var _0x5ea0b5={};_0x5ea0b5[_0x530a65[_0xfcef('0x34')]]=_0x4bf9e0;_['merge'](_0xeb6dc2[_0xfcef('0x31')],_0x5ea0b5);}return _0x5a7fa4[_0xfcef('0x1d')]('Account')[_0xfcef('0x21')](_0xeb6dc2,_0xd339fe)['execute']()[_0xfcef('0x23')](function(_0x770b4f){if(_0x770b4f&&_0x770b4f[_0xfcef('0x24')]){return _0x770b4f;}else{var _0x38f80e=_[_0xfcef('0x2e')](_0x32cd7b);if(_0x530a65['additionalSearchContact']){var _0x4670d7={};_0x4670d7[_0x530a65[_0xfcef('0x2f')]]=_0x4bf9e0;_[_0xfcef('0x30')](_0x38f80e[_0xfcef('0x31')],_0x4670d7);}return _0x5a7fa4[_0xfcef('0x1d')](_0xfcef('0x35'))[_0xfcef('0x21')](_0x38f80e,_0xd339fe)[_0xfcef('0x23')](function(_0x14470e){if(_0x14470e&&_0x14470e[_0xfcef('0x24')]){return _0x14470e;}else{var _0xd591ae=_[_0xfcef('0x2e')](_0x32cd7b);if(_0x530a65['additionalSearchLead']){var _0x295d1b={};_0x295d1b[_0x530a65[_0xfcef('0x32')]]=_0x4bf9e0;_['merge'](_0xd591ae[_0xfcef('0x31')],_0x295d1b);}return _0x5a7fa4[_0xfcef('0x1d')](_0xfcef('0x33'))[_0xfcef('0x21')](_0xd591ae,_0xd339fe);}});}});case'contact':var _0x3c96fe=_['cloneDeep'](_0x32cd7b);if(_0x530a65[_0xfcef('0x2f')]){var _0x5ea0b5={};_0x5ea0b5[_0x530a65['additionalSearchContact']]=_0x4bf9e0;_['merge'](_0x3c96fe[_0xfcef('0x31')],_0x5ea0b5);}return _0x5a7fa4[_0xfcef('0x1d')]('Contact')['find'](_0x3c96fe,_0xd339fe)[_0xfcef('0x22')]();case _0xfcef('0x16'):var _0x1e996c=_[_0xfcef('0x2e')](_0x32cd7b);if(_0x530a65['additionalSearchLead']){var _0x5ea0b5={};_0x5ea0b5[_0x530a65[_0xfcef('0x32')]]=_0x4bf9e0;_['merge'](_0x1e996c[_0xfcef('0x31')],_0x5ea0b5);}return _0x5a7fa4[_0xfcef('0x1d')](_0xfcef('0x33'))[_0xfcef('0x21')](_0x1e996c,_0xd339fe);case _0xfcef('0x17'):var _0xeb6dc2=_[_0xfcef('0x2e')](_0x32cd7b);if(_0x530a65['additionalSearchAccount']){var _0x5ea0b5={};_0x5ea0b5[_0x530a65['additionalSearchAccount']]=_0x4bf9e0;_['merge'](_0xeb6dc2[_0xfcef('0x31')],_0x5ea0b5);}return _0x5a7fa4[_0xfcef('0x1d')](_0xfcef('0x36'))['find'](_0xeb6dc2,_0xd339fe);default:return null;}})[_0xfcef('0x23')](function(_0x152aa9){if(_0x152aa9&&_0x152aa9[_0xfcef('0x24')]){var _0x20b5ed=_[_0xfcef('0x37')](_0x152aa9);if(_0x20b5ed){return BPromise[_0xfcef('0x26')]({'id':_0x20b5ed['Id'],'name':_0x20b5ed['Name'],'phone':_0x20b5ed[_0xfcef('0x38')],'endUserType':_0x20b5ed['attributes']['type']['toLowerCase']()});}}})[_0xfcef('0x23')](function(_0x51535e){if(_0x51535e){logger[_0xfcef('0x1c')](_0xfcef('0x39'),_0x51535e['endUserType'],_0x4bf9e0);return BPromise[_0xfcef('0x26')](_0x51535e);}else{logger[_0xfcef('0x1c')](_0xfcef('0x3a'),_0x4bf9e0);var _0x141fd6={'Phone':_0x4bf9e0};if(_0x530a65[_0xfcef('0x3b')]){if(_0x530a65[_0xfcef('0x3b')]==='contact'){logger[_0xfcef('0x1c')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x4bf9e0,_0x530a65[_0xfcef('0x3b')]);_0x141fd6['LastName']=_0x11d0ef!==_0xfcef('0x3c')?_0x11d0ef:util[_0xfcef('0x3d')](_0xfcef('0x3e'),_0x4bf9e0);}else if(_0x530a65[_0xfcef('0x3b')]===_0xfcef('0x16')){logger[_0xfcef('0x1c')](_0xfcef('0x3f'),_0x4bf9e0,_0x530a65[_0xfcef('0x3b')]);_0x141fd6[_0xfcef('0x40')]=_0x11d0ef!=='<unknown>'?_0x11d0ef:util[_0xfcef('0x3d')]('Caller\x20-\x20%s',_0x4bf9e0);_0x141fd6['Company']='No\x20Company';}else if(_0x530a65[_0xfcef('0x3b')]===_0xfcef('0x17')){logger[_0xfcef('0x1c')](_0xfcef('0x3f'),_0x4bf9e0,_0x530a65[_0xfcef('0x3b')]);_0x141fd6[_0xfcef('0x27')]=_0x11d0ef!=='<unknown>'?_0x11d0ef:util[_0xfcef('0x3d')](_0xfcef('0x3e'),_0x4bf9e0);}else{return null;}}return _0x5a7fa4[_0xfcef('0x1d')](_[_0xfcef('0x41')](_0x530a65['moduleCreate']))['create'](_0x141fd6)[_0xfcef('0x23')](function(_0x164008){return BPromise[_0xfcef('0x26')]({'id':_0x164008['id'],'endUserType':_0x530a65[_0xfcef('0x3b')]});});}});}function getCustomFields(_0x2f5b5d,_0x3e2015){var _0x3f6e69={};if(_0x2f5b5d[_0xfcef('0x24')]>0x0){_['forEach'](_0x2f5b5d,function(_0x1b39df){if(_[_0xfcef('0x42')]([_0xfcef('0x43'),_0xfcef('0x44')],_0x1b39df['type'])&&_0x1b39df[_0xfcef('0x45')]){_0x3f6e69[_0x1b39df[_0xfcef('0x45')]]=_0x1b39df[_0xfcef('0x46')][_0xfcef('0x47')]();}else if(_0x1b39df[_0xfcef('0x48')]===_0xfcef('0x49')&&_0x1b39df['variableName']&&_0x1b39df['idField']){_0x3e2015[_0x1b39df['variableName']]&&(_0x3f6e69[_0x1b39df['idField']]=_0x3e2015[_0x1b39df[_0xfcef('0x4a')]][_0xfcef('0x47')]());}else if(_0x1b39df['type']===_0xfcef('0x4b')&&_0x1b39df[_0xfcef('0x4c')]&&_0x1b39df['Variable']['name']&&_0x1b39df[_0xfcef('0x45')]){_0x3e2015[_0x1b39df[_0xfcef('0x4c')][_0xfcef('0x4d')][_0xfcef('0x4e')]()]&&(_0x3f6e69[_0x1b39df[_0xfcef('0x45')]]=_0x3e2015[_0x1b39df[_0xfcef('0x4c')][_0xfcef('0x4d')][_0xfcef('0x4e')]()][_0xfcef('0x47')]());}});}return _0x3f6e69;}function getConnection(_0x3295a6){var _0x24069a=_0x3295a6[_0xfcef('0x4f')][_0xfcef('0x50')](_0x3295a6['securityToken']);var _0x3bbfcc=new jsforce[(_0xfcef('0x51'))]({'oauth2':{'loginUrl':_0x3295a6[_0xfcef('0x52')]||_0xfcef('0x53'),'clientId':_0x3295a6[_0xfcef('0x54')],'clientSecret':_0x3295a6['clientSecret']}});return _0x3bbfcc[_0xfcef('0x55')](_0x3295a6[_0xfcef('0x56')],_0x24069a)['then'](function(){logger[_0xfcef('0x1c')](_0xfcef('0x57'));return _0x3bbfcc;});}exports[_0xfcef('0x58')]=function(_0x1e86e4,_0xd410da,_0x624310,_0x140f2a,_0x2560af,_0x53acb5){var _0x1a7735,_0x9392cf,_0x4bcf2f,_0x230106;_0x53acb5[_0xfcef('0x59')]=intUtil[_0xfcef('0x5a')](_0x53acb5[_0xfcef('0x59')]);_0x53acb5['remoteUri']=intUtil[_0xfcef('0x5a')](_0x53acb5[_0xfcef('0x52')]);if(_0x2560af&&_0x2560af[_0xfcef('0x5b')]){logger[_0xfcef('0x1c')]('[QUEUE]','Recording\x20is\x20enabled!');_0xd410da[_0xfcef('0x5c')]=util[_0xfcef('0x3d')](_0xfcef('0x5d'),_0x53acb5[_0xfcef('0x59')],_0xd410da[_0xfcef('0x5e')],md5(_0xd410da[_0xfcef('0x5e')]));}else{_0xd410da[_0xfcef('0x5c')]='';}return getConnection(_0x53acb5)[_0xfcef('0x23')](function(_0x46ea16){_0x230106=_0x46ea16;return getUser(_0x53acb5,_0x140f2a[_0xfcef('0x5f')],_0x230106);})[_0xfcef('0x23')](function(_0x3bb12c){_0x1a7735=_0x3bb12c;return getEndUser(_0x53acb5,_0x624310,_0xd410da[_0xfcef('0x60')],_0xd410da['calleridnum'],_0x230106);})[_0xfcef('0x23')](function(_0x3fa526){_0x9392cf=_0x3fa526;return getTicket(_0x53acb5,_0x1a7735,_0x9392cf,_0x624310,_0xd410da,_0x624310[_0xfcef('0x61')],_0x230106,_0xfcef('0x58'));})[_0xfcef('0x23')](function(_0x203370){_0x4bcf2f=_0x203370;logger[_0xfcef('0x1c')](_0xfcef('0x62'),_0x4bcf2f['id']);logger[_0xfcef('0x1c')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x4bcf2f['id'],_0x140f2a[_0xfcef('0x4d')],_0x53acb5[_0xfcef('0x48')]);switch(_0x53acb5['type']){case _0xfcef('0x63'):emit(util['format'](_0xfcef('0x64'),_0x140f2a[_0xfcef('0x4d')]),_0xfcef('0x65'),{'recordId':_0x4bcf2f['id']});break;case'newTab':emit(util[_0xfcef('0x3d')]('user:%s',_0x140f2a['name']),_0xfcef('0x66'),{'uri':util[_0xfcef('0x3d')](_0xfcef('0x67'),_0x230106[_0xfcef('0x68')],_0x4bcf2f['id'])});break;default:logger[_0xfcef('0x69')](_0xfcef('0x6a'));}})[_0xfcef('0x6b')](function(_0x1d2db6){logger[_0xfcef('0x69')](_0xfcef('0x6c'),_0x1d2db6);});};exports[_0xfcef('0x6d')]=function(_0x2fe310,_0x518eea,_0xb6f6be,_0x1c5ce2,_0x4be190,_0xb9f115,_0x1f11a0){var _0x2022da,_0x488fee,_0x186aed,_0x5d7e12;_0xb9f115[_0xfcef('0x59')]=intUtil[_0xfcef('0x5a')](_0xb9f115[_0xfcef('0x59')]);_0xb9f115[_0xfcef('0x52')]=intUtil[_0xfcef('0x5a')](_0xb9f115[_0xfcef('0x52')]);if(_0x1f11a0&&_0x1f11a0[_0xfcef('0x6e')]&&_0x1f11a0[_0xfcef('0x6e')]!==_0xfcef('0x6f')){logger[_0xfcef('0x1c')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x518eea[_0xfcef('0x5c')]=util['format'](_0xfcef('0x5d'),_0xb9f115[_0xfcef('0x59')],_0x518eea[_0xfcef('0x5e')],md5(_0x518eea[_0xfcef('0x5e')]));}return getConnection(_0xb9f115)[_0xfcef('0x23')](function(_0x1e1e74){_0x5d7e12=_0x1e1e74;return getUser(_0xb9f115,_0x1c5ce2[_0xfcef('0x5f')],_0x5d7e12);})[_0xfcef('0x23')](function(_0x352331){_0x2022da=_0x352331;return getEndUser(_0xb9f115,_0xb6f6be,_0x518eea[_0xfcef('0x70')],_0x518eea[_0xfcef('0x71')],_0x5d7e12);})[_0xfcef('0x23')](function(_0x553a27){_0x488fee=_0x553a27;return getTicket(_0xb9f115,_0x2022da,_0x488fee,_0xb6f6be,_0x518eea,_0xb6f6be[_0xfcef('0x61')],_0x5d7e12,_0xfcef('0x6d'));})['then'](function(_0x23979c){_0x186aed=_0x23979c;logger[_0xfcef('0x1c')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x186aed['id']);logger[_0xfcef('0x1c')](_0xfcef('0x72'),_0x186aed['id'],_0x1c5ce2[_0xfcef('0x4d')],_0xb9f115[_0xfcef('0x48')]);switch(_0xb9f115[_0xfcef('0x48')]){case'integrationTab':emit(util['format'](_0xfcef('0x64'),_0x1c5ce2[_0xfcef('0x4d')]),'trigger:salesforce:display',{'recordId':_0x186aed['id']});break;case'newTab':emit(util[_0xfcef('0x3d')](_0xfcef('0x64'),_0x1c5ce2[_0xfcef('0x4d')]),_0xfcef('0x66'),{'uri':util[_0xfcef('0x3d')](_0xfcef('0x67'),_0x5d7e12[_0xfcef('0x68')],_0x186aed['id'])});break;default:logger[_0xfcef('0x69')]('[OUTBOUND]',_0xfcef('0x73'));}})['catch'](function(_0xbc9857){logger[_0xfcef('0x69')](_0xfcef('0x74'),_0xbc9857);});};exports[_0xfcef('0x75')]=function(_0x3999d8,_0x2d0ac3,_0x563ac3,_0x255774,_0x2ff2d4,_0x38f018){var _0x5ed1a5,_0x346f09,_0x1bc1f9,_0x4bae40;_0x38f018['serverUrl']=intUtil[_0xfcef('0x5a')](_0x38f018[_0xfcef('0x59')]);_0x38f018[_0xfcef('0x52')]=intUtil[_0xfcef('0x5a')](_0x38f018[_0xfcef('0x52')]);if(_0x2ff2d4&&_0x2ff2d4[_0xfcef('0x5b')]){logger['info']('['+_0x2d0ac3[_0xfcef('0x76')]['toUpperCase']()+']',_0xfcef('0x77'));_0x2d0ac3['recordingURL']=util[_0xfcef('0x3d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x38f018['serverUrl'],_0x2d0ac3[_0xfcef('0x5e')],md5(_0x2d0ac3[_0xfcef('0x5e')]));}else{_0x2d0ac3[_0xfcef('0x5c')]='';}return getConnection(_0x38f018)[_0xfcef('0x23')](function(_0x5e5b91){_0x4bae40=_0x5e5b91;if(!_['isNil'](_0x255774)){return getUser(_0x38f018,_0x255774[_0xfcef('0x4d')],_0x4bae40);}else{return getUser(_0x38f018,null,_0x4bae40);}})[_0xfcef('0x23')](function(_0x17dbb8){_0x5ed1a5=_0x17dbb8;return getEndUser(_0x38f018,_0x563ac3,_0x2d0ac3[_0xfcef('0x60')],_0x2d0ac3[_0xfcef('0x78')],_0x4bae40);})[_0xfcef('0x23')](function(_0x64a534){_0x346f09=_0x64a534;return getTicket(_0x38f018,_0x5ed1a5,_0x346f09,_0x563ac3,_0x2d0ac3,_0x563ac3[_0xfcef('0x61')],_0x4bae40);})['then'](function(_0x326cc1){_0x1bc1f9=_0x326cc1;logger[_0xfcef('0x1c')]('['+_0x2d0ac3[_0xfcef('0x76')][_0xfcef('0x79')]()+_0xfcef('0x7a'),_0x1bc1f9['id']);logger[_0xfcef('0x1c')]('['+_0x2d0ac3[_0xfcef('0x76')][_0xfcef('0x79')]()+_0xfcef('0x7b'),_0x38f018[_0xfcef('0x48')]);})[_0xfcef('0x6b')](function(_0x3b9c2c){logger[_0xfcef('0x69')]('['+_0x2d0ac3[_0xfcef('0x76')][_0xfcef('0x79')]()+']',_0x3b9c2c);});};
\ No newline at end of file
index 50f6b48..ba02b62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa75b=['Incident','push',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','map','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','sysparm_display_value=true','stripTrailingSlash','serverUrl','isNil','email','destcalleridnum','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','call\x20direction:\x20%s','remoteUri',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','error','],\x20getUser\x20input\x20crm','validateEmail','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','adminEmail','],\x20getUser\x20crm','catch','message',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','endUserId','],\x20createEndUser\x20crm','forEach','includes','string','type','nameField','content','toString','picklist','idField','customField','toLowerCase','variable','variableName','Variable','name','outbound','incident','assign','getString',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number','label','?sysparm_query=name%3D','label_entry'];(function(_0x6dd562,_0x34ced7){var _0x5c6799=function(_0x177bd3){while(--_0x177bd3){_0x6dd562['push'](_0x6dd562['shift']());}};_0x5c6799(++_0x34ced7);}(_0xa75b,0x164));var _0xba75=function(_0x2f8ca8,_0x2ca151){_0x2f8ca8=_0x2f8ca8-0x0;var _0x4db998=_0xa75b[_0x2f8ca8];return _0x4db998;};'use strict';var _=require(_0xba75('0x0'));var Promise=require(_0xba75('0x1'));var rp=require('request-promise');var util=require('util');var md5=require('md5');var Redis=require(_0xba75('0x2'));var intUtil=require(_0xba75('0x3'));var config=require(_0xba75('0x4'));var logger=require(_0xba75('0x5'))(_0xba75('0x6'));config[_0xba75('0x7')]=_[_0xba75('0x8')](config[_0xba75('0x7')],{'host':_0xba75('0x9'),'port':0x18eb});var io=require(_0xba75('0xa'))(new Redis(config[_0xba75('0x7')]));function getAdminUser(_0x468f70,_0x447a46,_0x2d10a4,_0x3b55e5,_0x19e266,_0x31e9b5){return new Promise(function(_0x1faf5a,_0x36995c){var _0x31a258={'method':_0xba75('0xb'),'uri':_0x3b55e5+_0xba75('0xc')+'&'+_0x19e266+'&'+_0x31e9b5,'auth':_0x447a46,'json':!![]};return rp(_0x31a258)[_0xba75('0xd')](function(_0x1d9883){if(_0x1d9883[_0xba75('0xe')][_0xba75('0xf')]>0x0){_0x2d10a4[_0xba75('0x10')]=_0x1d9883[_0xba75('0xe')][0x0][_0xba75('0x11')];}logger[_0xba75('0x12')]('['+[_0x468f70[_0xba75('0x13')]()]+_0xba75('0x14'),_0x2d10a4);_0x1faf5a(_0x2d10a4);})['catch'](function(_0x4c2de0){logger[_0xba75('0x15')]('['+[_0x468f70['toUpperCase']()]+']',_0x4c2de0['message']);_0x36995c(_0x4c2de0['message']);});});}function getUser(_0x5be927,_0x229f6d,_0x4be446,_0x270db1,_0x3abf1c){return function(_0x54069b){logger[_0xba75('0x12')]('['+[_0x5be927[_0xba75('0x13')]()]+_0xba75('0x16'),_0x54069b);return new Promise(function(_0x3e5a59,_0xdcd60b){if(intUtil[_0xba75('0x17')](_0x54069b[_0xba75('0x18')])){var _0x2f9e81={'method':_0xba75('0xb'),'uri':_0x4be446+'sys_user?sysparm_query=email%3D'+_0x54069b['userEmail']+'&'+_0x270db1+'&'+_0x3abf1c,'auth':_0x229f6d,'json':!![]};logger[_0xba75('0x12')]('['+[_0x5be927[_0xba75('0x13')]()]+_0xba75('0x19'),_0x2f9e81);return rp(_0x2f9e81)[_0xba75('0xd')](function(_0x1cfd15){logger[_0xba75('0x12')]('['+[_0x5be927[_0xba75('0x13')]()]+_0xba75('0x1a'),_0x1cfd15);if(_0x1cfd15[_0xba75('0xe')]['length']>0x0&&String(_0x1cfd15['result'][0x0][_0xba75('0x1b')])===_0xba75('0x1c')){_0x54069b[_0xba75('0x1d')]=_0x1cfd15[_0xba75('0xe')][0x0][_0xba75('0x11')];}else{_0x54069b['userId']=_0x54069b[_0xba75('0x10')];_0x54069b['userEmail']=_0x54069b[_0xba75('0x1e')];}logger[_0xba75('0x12')]('['+[_0x5be927['toUpperCase']()]+_0xba75('0x1f'),_0x54069b);_0x3e5a59(_0x54069b);})[_0xba75('0x20')](function(_0x38d748){logger[_0xba75('0x15')]('['+[_0x5be927[_0xba75('0x13')]()]+']',_0x38d748[_0xba75('0x21')]);_0xdcd60b(_0x38d748[_0xba75('0x21')]);});}else{logger[_0xba75('0x12')]('['+[_0x5be927[_0xba75('0x13')]()]+_0xba75('0x22'));_0x54069b[_0xba75('0x1d')]=_0x54069b[_0xba75('0x10')];_0x54069b[_0xba75('0x18')]=_0x54069b['adminEmail'];_0x3e5a59(_0x54069b);}});};}function createEndUser(_0x372baf,_0x527334,_0x25c275,_0xbb68df,_0x2e8c62){logger['info']('['+[_0x372baf[_0xba75('0x13')]()]+_0xba75('0x23'),_0x25c275);return new Promise(function(_0x494f44,_0x3c62c2){var _0x57eea1={'method':_0xba75('0x24'),'uri':_0xbb68df+_0xba75('0x25')+_0x2e8c62,'body':{'user_name':_0x25c275[_0xba75('0x26')],'roles':_0xba75('0x27'),'first_name':_0x25c275[_0xba75('0x26')],'active':_0xba75('0x1c'),'date_format':_0xba75('0x28'),'phone':_0x25c275[_0xba75('0x26')]},'auth':_0x527334,'json':!![]};return rp(_0x57eea1)[_0xba75('0xd')](function(_0x5b12d9){logger['info']('['+[_0x372baf[_0xba75('0x13')]()]+_0xba75('0x29'),_0x5b12d9[_0xba75('0xe')]);_0x25c275['endUserId']=_0x5b12d9[_0xba75('0xe')][_0xba75('0x11')];_0x494f44(_0x25c275);})[_0xba75('0x20')](function(_0x5413de){logger[_0xba75('0x15')]('['+[_0x372baf[_0xba75('0x13')]()]+']',_0x5413de[_0xba75('0x21')]);_0x3c62c2(_0x5413de[_0xba75('0x21')]);});});}function getEndUser(_0x93a1da,_0x4659b2,_0x4a0c73,_0x443e69,_0x321b9d){return function(_0x5a21c9){logger[_0xba75('0x12')]('['+[_0x93a1da[_0xba75('0x13')]()]+_0xba75('0x2a'),_0x5a21c9);return new Promise(function(_0xca996b,_0x2de634){var _0x421626={'method':_0xba75('0xb'),'uri':_0x4a0c73+_0xba75('0x2b')+_0x5a21c9[_0xba75('0x26')]+'&'+_0x443e69+'&'+_0x321b9d,'auth':_0x4659b2,'json':!![]};return rp(_0x421626)['then'](function(_0x2bcc3f){if(_0x2bcc3f[_0xba75('0xe')][_0xba75('0xf')]>0x0){_0x5a21c9[_0xba75('0x2c')]=_0x2bcc3f[_0xba75('0xe')][0x0]['sys_id'];logger[_0xba75('0x12')]('['+[_0x93a1da[_0xba75('0x13')]()]+'],\x20getEndUser\x20crm',_0x5a21c9);_0xca996b(_0x5a21c9);}else{return createEndUser(_0x93a1da,_0x4659b2,_0x5a21c9,_0x4a0c73,_0x443e69)['then'](function(_0x3c6c92){logger[_0xba75('0x12')]('['+[_0x93a1da['toUpperCase']()]+_0xba75('0x2d'),_0x3c6c92);_0xca996b(_0x3c6c92);});}})[_0xba75('0x20')](function(_0x122848){logger['error']('['+[_0x93a1da[_0xba75('0x13')]()]+']',_0x122848['message']);_0x2de634(_0x122848[_0xba75('0x21')]);});});};}function getCustomFields(_0x7f1195,_0x40f121){var _0x5a8350={};if(_0x7f1195[_0xba75('0xf')]>0x0){_[_0xba75('0x2e')](_0x7f1195,function(_0x361ca3){if(_[_0xba75('0x2f')]([_0xba75('0x30'),'picklist'],_0x361ca3[_0xba75('0x31')])&&_0x361ca3[_0xba75('0x32')]&&!_0x361ca3['customField']){_0x5a8350[_0x361ca3[_0xba75('0x32')]['toLowerCase']()]=_0x361ca3[_0xba75('0x33')][_0xba75('0x34')]();}else if(_[_0xba75('0x2f')]([_0xba75('0x30'),_0xba75('0x35')],_0x361ca3[_0xba75('0x31')])&&_0x361ca3[_0xba75('0x36')]&&_0x361ca3[_0xba75('0x37')]){_0x5a8350[_0x361ca3['idField'][_0xba75('0x38')]()]=_0x361ca3[_0xba75('0x33')]['toString']();}else if(_0x361ca3[_0xba75('0x31')]===_0xba75('0x39')&&_0x361ca3[_0xba75('0x3a')]&&_0x361ca3[_0xba75('0x36')]&&_0x361ca3[_0xba75('0x37')]){_0x5a8350[_0x361ca3[_0xba75('0x36')][_0xba75('0x38')]()]=_0x40f121[_0x361ca3[_0xba75('0x3a')]][_0xba75('0x34')]();}else if(_0x361ca3[_0xba75('0x31')]==='customVariable'&&_0x361ca3[_0xba75('0x3b')]&&_0x361ca3['Variable'][_0xba75('0x3c')]&&_0x361ca3[_0xba75('0x36')]&&_0x361ca3['customField']){_0x5a8350[_0x361ca3[_0xba75('0x36')]['toLowerCase']()]=_0x40f121[_0x361ca3[_0xba75('0x3b')][_0xba75('0x3c')]['toLowerCase']()][_0xba75('0x34')]();}});}return _0x5a8350;}function getTicket(_0xdfb820,_0x1fef10,_0x12f9fb,_0x2941eb,_0x5d9154,_0x56457d){return function(_0x1e1452){logger[_0xba75('0x12')]('['+[_0xdfb820[_0xba75('0x13')]()]+']\x20getTicket\x20input\x20crm',_0x1e1452);return new Promise(function(_0x1fb1b7,_0xb120f2){var _0x291512=_0xdfb820[_0xba75('0x38')]()===_0xba75('0x3d')?_0x1e1452['userId']:_0x1e1452['endUserId'];var _0x156669={'method':_0xba75('0x24'),'uri':_0x12f9fb+_0xba75('0x3e')+'?'+_0x56457d,'body':Object[_0xba75('0x3f')]({},{'active':'true','caller_id':_0x291512,'assigned_to':_0x1e1452['userId'],'short_description':intUtil[_0xba75('0x40')](_0x2941eb['Subjects'],_0x5d9154,'\x20'),'description':intUtil[_0xba75('0x40')](_0x2941eb['Descriptions'],_0x5d9154,'\x0a')},getCustomFields(_0x2941eb['Fields'],_0x5d9154)),'auth':_0x1fef10,'json':!![]};return rp(_0x156669)['then'](function(_0x9d2212){logger[_0xba75('0x12')]('['+[_0xdfb820[_0xba75('0x13')]()]+_0xba75('0x41'),_0x9d2212['result']);_0x1e1452[_0xba75('0x42')]=_0x9d2212[_0xba75('0xe')][_0xba75('0x11')];_0x1e1452[_0xba75('0x43')]=_0x9d2212[_0xba75('0xe')][_0xba75('0x44')];logger[_0xba75('0x12')]('['+[_0xdfb820[_0xba75('0x13')]()]+']\x20getTicket\x20crm',_0x1e1452);_0x1fb1b7(_0x1e1452);})[_0xba75('0x20')](function(_0x294a57){logger[_0xba75('0x15')]('['+[_0xdfb820[_0xba75('0x13')]()]+']',_0x294a57['message']);_0xb120f2(_0x294a57[_0xba75('0x21')]);});});};}function createRemoteTag(_0x3f7826,_0x189a08,_0x257bd0,_0x13f277){return new Promise(function(_0x9b0a79,_0x1c376d){var _0x5c5df2={'method':'POST','uri':_0x257bd0+_0xba75('0x45')+'?'+_0x13f277,'body':{'short_description':_0x3f7826,'global':!![],'active':!![],'name':_0x3f7826},'auth':_0x189a08,'json':!![]};return rp(_0x5c5df2)[_0xba75('0xd')](function(_0x440e4e){var _0x3c049f=_0x440e4e[_0xba75('0xe')]['sys_id'];_0x9b0a79(_0x3c049f);});});}function getRemoteTag(_0xd5a6a5,_0x1c9c9e,_0x4c03e8,_0x318b25,_0x540576){return new Promise(function(_0x57b670,_0x324817){var _0x4a6ba5={'method':_0xba75('0xb'),'uri':_0x4c03e8+'label'+_0xba75('0x46')+_0xd5a6a5+'&'+_0x318b25,'auth':_0x1c9c9e,'json':!![]};return rp(_0x4a6ba5)[_0xba75('0xd')](function(_0x30d7f6){if(_0x30d7f6[_0xba75('0xe')][_0xba75('0xf')]>0x0){var _0x32571a=_0x30d7f6[_0xba75('0xe')][0x0][_0xba75('0x11')];_0x57b670(_0x32571a);}else{return createRemoteTag(_0xd5a6a5,_0x1c9c9e,_0x4c03e8,_0x318b25)['then'](function(_0x5c3e9e){_0x57b670(_0x5c3e9e);});}});});}function assignTagToIncident(_0x478beb,_0xb95e61,_0x5136bd,_0x539296,_0x7570f4){return new Promise(function(_0x35e564,_0x1a6a91){var _0x222621={'method':_0xba75('0x24'),'uri':_0x5136bd+_0xba75('0x47')+'?'+_0x7570f4,'body':{'label':_0x478beb,'table':'incident','id_type':_0xba75('0x48'),'table_key':_0x539296['ticketId'],'title':'Incident\x20-\x20'+_0x539296[_0xba75('0x43')],'id_display':_0x539296[_0xba75('0x43')]},'auth':_0xb95e61,'json':!![]};return rp(_0x222621)[_0xba75('0xd')](function(_0x4c3026){_0x35e564();})['catch'](function(){_0x35e564();});});}function manageTags(_0x4d2810,_0x38761e,_0x5d69d7,_0x3f41d4,_0x53cdf9,_0x12577b,_0x22652c){return new Promise(function(_0x40a6b7,_0x498114){var _0x1e58c3=[];_0x38761e['forEach'](function(_0x256926){_0x1e58c3[_0xba75('0x49')](getRemoteTag(_0x256926,_0x5d69d7,_0x3f41d4,_0x12577b,_0x22652c));});return Promise['all'](_0x1e58c3)[_0xba75('0xd')](function(_0xcd5fd6){if(_0xcd5fd6[_0xba75('0xf')]){logger[_0xba75('0x12')]('['+[_0x4d2810['toUpperCase']()]+_0xba75('0x4a'),_0xcd5fd6);var _0x2e5ecc=[];_0xcd5fd6['forEach'](function(_0x2bf5d4){_0x2e5ecc['push'](assignTagToIncident(_0x2bf5d4,_0x5d69d7,_0x3f41d4,_0x53cdf9,_0x12577b));});return Promise['all'](_0x2e5ecc)[_0xba75('0xd')](function(){_0x40a6b7();})['catch'](function(){_0x40a6b7();});}else{_0x40a6b7();}});});}function getTags(_0x125994,_0x529c19,_0x20cce8,_0x23ddb6,_0x55c4bc,_0x199388){return function(_0x42f614){return new Promise(function(_0x1d8a86,_0x12fcc8){var _0x8e4354=[];var _0x25abc7=_0x23ddb6['Tags'];if(_0x25abc7&&_0x25abc7['length']>0x0){_0x8e4354=_[_0xba75('0x4b')](_0x25abc7,_0xba75('0x3c'));}if(_0x8e4354[_0xba75('0xf')]>0x0){return manageTags(_0x125994,_0x8e4354,_0x529c19,_0x20cce8,_0x42f614,_0x55c4bc,_0x199388)[_0xba75('0xd')](function(){_0x1d8a86(_0x42f614);});}else{_0x1d8a86(_0x42f614);}});};}function emit(_0xd1555b,_0x1dd607,_0x235a29){var _0x5f0387=_0xba75('0x4c')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0xba75('0x4d')+_0xba75('0x4e');var _0x266c91={'uri':_0xd1555b+_0xba75('0x4f')+_0x235a29+_0x5f0387};io['to'](util[_0xba75('0x50')](_0xba75('0x51'),_0x1dd607))[_0xba75('0x52')](_0xba75('0x53'),_0x266c91);}exports['cs']=function(_0x2ba5b8,_0x1d9249,_0x2a4167,_0x16058d,_0x5656f7,_0x3ccb52,_0xa451fc,_0x55ec6e){var _0x2f2768={};var _0xcaa004={'user':_0x3ccb52[_0xba75('0x54')],'pass':_0x3ccb52[_0xba75('0x55')]};var _0xbf1585='sysparm_limit=1';var _0x369816=_0xba75('0x56');_0x3ccb52['remoteUri']=intUtil[_0xba75('0x57')](_0x3ccb52['remoteUri']);_0x3ccb52[_0xba75('0x58')]=intUtil[_0xba75('0x57')](_0x3ccb52['serverUrl']);var _0x2df451=util[_0xba75('0x50')]('%s/api/now/table/',_0x3ccb52['remoteUri']);_0x2f2768['userEmail']=!_[_0xba75('0x59')](_0x16058d)?_0x16058d[_0xba75('0x5a')]:null;_0x2f2768['adminEmail']=_0x3ccb52[_0xba75('0x5a')];_0x2f2768[_0xba75('0x26')]=_0x55ec6e[_0xba75('0x38')]()===_0xba75('0x3d')?_0x1d9249[_0xba75('0x5b')]:_0x1d9249[_0xba75('0x5c')];_0x2f2768[_0xba75('0x5d')]=_0x55ec6e===_0xba75('0x5e')||_0x55ec6e==='unmanaged'?_0xba75('0x5e'):_0xba75('0x3d');var _0x27410f=util['format'](_0xba75('0x5f'),_0x3ccb52[_0xba75('0x58')],_0x1d9249['uniqueid'],md5(_0x1d9249[_0xba75('0x60')]));if(_0x5656f7&&_0x5656f7['monitor_format']){logger[_0xba75('0x12')](_0xba75('0x61'),'Recording\x20is\x20enabled!');_0x1d9249[_0xba75('0x62')]=_0x27410f;}else if(_0xa451fc&&_0xa451fc[_0xba75('0x63')]&&_0xa451fc['recordingFormat']!==_0xba75('0x64')){logger[_0xba75('0x12')](_0xba75('0x65'),_0xba75('0x66'));_0x1d9249[_0xba75('0x62')]=_0x27410f;}else{_0x1d9249['recordingURL']='';}return getAdminUser(_0x55ec6e,_0xcaa004,_0x2f2768,_0x2df451,_0x369816,_0xbf1585)['then'](getUser(_0x55ec6e,_0xcaa004,_0x2df451,_0x369816,_0xbf1585))[_0xba75('0xd')](getEndUser(_0x55ec6e,_0xcaa004,_0x2df451,_0x369816,_0xbf1585))[_0xba75('0xd')](getTicket(_0x55ec6e,_0xcaa004,_0x2df451,_0x2a4167,_0x1d9249,_0x369816))[_0xba75('0xd')](function(_0x3f2964){logger[_0xba75('0x12')](util[_0xba75('0x50')]('The\x20ticket\x20ID\x20is:\x20%s',_0x3f2964['ticketId']));logger['info'](util[_0xba75('0x50')](_0xba75('0x67'),_0x55ec6e));if(_0x55ec6e!=='unmanaged'){logger[_0xba75('0x12')]('['+[_0x55ec6e[_0xba75('0x13')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x3ccb52[_0xba75('0x68')],_0x16058d[_0xba75('0x3c')],_0x3f2964[_0xba75('0x42')]);}})['catch'](function(_0x53af12){logger[_0xba75('0x15')]('['+[_0x55ec6e['toUpperCase']()]+_0xba75('0x69'),util[_0xba75('0x6a')](_0x53af12,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x50a5=['validateEmail','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','adminId','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','adminEmail','POST','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','includes','string','picklist','type','customField','toLowerCase','content','toString','idField','variable','variableName','customVariable','Variable','name','incident','assign','Subjects','ticketId','ticketNumber',']\x20getTicket\x20crm','label','Incident','Incident\x20-\x20','forEach','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','trigger:browser:url','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','email','destcalleridnum','calleridnum','queue','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','unmanaged','inspect','bluebird','request-promise','md5','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm'];(function(_0x382279,_0x181b66){var _0x193f40=function(_0x453461){while(--_0x453461){_0x382279['push'](_0x382279['shift']());}};_0x193f40(++_0x181b66);}(_0x50a5,0x1de));var _0x550a=function(_0x575f87,_0x11c818){_0x575f87=_0x575f87-0x0;var _0x37b41d=_0x50a5[_0x575f87];return _0x37b41d;};'use strict';var _=require('lodash');var Promise=require(_0x550a('0x0'));var rp=require(_0x550a('0x1'));var util=require('util');var md5=require(_0x550a('0x2'));var Redis=require('ioredis');var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x550a('0x3'))(_0x550a('0x4'));config[_0x550a('0x5')]=_[_0x550a('0x6')](config[_0x550a('0x5')],{'host':_0x550a('0x7'),'port':0x18eb});var io=require(_0x550a('0x8'))(new Redis(config[_0x550a('0x5')]));function getAdminUser(_0x4d84f5,_0x44bed2,_0x4a568b,_0x1f80ac,_0x6cad95,_0x3421a6){return new Promise(function(_0x28583d,_0x53f38b){var _0x30d22c={'method':_0x550a('0x9'),'uri':_0x1f80ac+_0x550a('0xa')+'&'+_0x6cad95+'&'+_0x3421a6,'auth':_0x44bed2,'json':!![]};return rp(_0x30d22c)[_0x550a('0xb')](function(_0xf11398){if(_0xf11398[_0x550a('0xc')][_0x550a('0xd')]>0x0){_0x4a568b['adminId']=_0xf11398[_0x550a('0xc')][0x0][_0x550a('0xe')];}logger[_0x550a('0xf')]('['+[_0x4d84f5[_0x550a('0x10')]()]+_0x550a('0x11'),_0x4a568b);_0x28583d(_0x4a568b);})[_0x550a('0x12')](function(_0x32d770){logger[_0x550a('0x13')]('['+[_0x4d84f5[_0x550a('0x10')]()]+']',_0x32d770[_0x550a('0x14')]);_0x53f38b(_0x32d770[_0x550a('0x14')]);});});}function getUser(_0x1552e8,_0x370b3b,_0x12b99a,_0x5d6307,_0x39a136){return function(_0x3204ce){logger[_0x550a('0xf')]('['+[_0x1552e8[_0x550a('0x10')]()]+_0x550a('0x15'),_0x3204ce);return new Promise(function(_0x55a5c3,_0x50018f){if(intUtil[_0x550a('0x16')](_0x3204ce[_0x550a('0x17')])){var _0x39f616={'method':'GET','uri':_0x12b99a+'sys_user?sysparm_query=email%3D'+_0x3204ce[_0x550a('0x17')]+'&'+_0x5d6307+'&'+_0x39a136,'auth':_0x370b3b,'json':!![]};logger[_0x550a('0xf')]('['+[_0x1552e8[_0x550a('0x10')]()]+_0x550a('0x18'),_0x39f616);return rp(_0x39f616)[_0x550a('0xb')](function(_0x39742e){logger[_0x550a('0xf')]('['+[_0x1552e8[_0x550a('0x10')]()]+_0x550a('0x19'),_0x39742e);if(_0x39742e[_0x550a('0xc')][_0x550a('0xd')]>0x0&&String(_0x39742e[_0x550a('0xc')][0x0][_0x550a('0x1a')])===_0x550a('0x1b')){_0x3204ce[_0x550a('0x1c')]=_0x39742e[_0x550a('0xc')][0x0][_0x550a('0xe')];}else{_0x3204ce[_0x550a('0x1c')]=_0x3204ce[_0x550a('0x1d')];_0x3204ce[_0x550a('0x17')]=_0x3204ce['adminEmail'];}logger[_0x550a('0xf')]('['+[_0x1552e8[_0x550a('0x10')]()]+_0x550a('0x1e'),_0x3204ce);_0x55a5c3(_0x3204ce);})[_0x550a('0x12')](function(_0x1bdefc){logger[_0x550a('0x13')]('['+[_0x1552e8[_0x550a('0x10')]()]+']',_0x1bdefc[_0x550a('0x14')]);_0x50018f(_0x1bdefc[_0x550a('0x14')]);});}else{logger[_0x550a('0xf')]('['+[_0x1552e8[_0x550a('0x10')]()]+_0x550a('0x1f'));_0x3204ce[_0x550a('0x1c')]=_0x3204ce[_0x550a('0x1d')];_0x3204ce[_0x550a('0x17')]=_0x3204ce[_0x550a('0x20')];_0x55a5c3(_0x3204ce);}});};}function createEndUser(_0x39e02f,_0x5423bc,_0x37850e,_0x2dd66c,_0x5136bd){logger[_0x550a('0xf')]('['+[_0x39e02f[_0x550a('0x10')]()]+'],\x20createEndUser\x20input\x20crm',_0x37850e);return new Promise(function(_0x3410aa,_0x369da6){var _0x6b12fc={'method':_0x550a('0x21'),'uri':_0x2dd66c+'sys_user?'+_0x5136bd,'body':{'user_name':_0x37850e[_0x550a('0x22')],'roles':_0x550a('0x23'),'first_name':_0x37850e[_0x550a('0x22')],'active':_0x550a('0x1b'),'date_format':_0x550a('0x24'),'phone':_0x37850e['endUserNumber']},'auth':_0x5423bc,'json':!![]};return rp(_0x6b12fc)[_0x550a('0xb')](function(_0x1f6cd4){logger['info']('['+[_0x39e02f[_0x550a('0x10')]()]+_0x550a('0x25'),_0x1f6cd4[_0x550a('0xc')]);_0x37850e[_0x550a('0x26')]=_0x1f6cd4['result'][_0x550a('0xe')];_0x3410aa(_0x37850e);})[_0x550a('0x12')](function(_0x238ddc){logger['error']('['+[_0x39e02f['toUpperCase']()]+']',_0x238ddc['message']);_0x369da6(_0x238ddc[_0x550a('0x14')]);});});}function getEndUser(_0x1e6d9a,_0x4f25d6,_0x442a04,_0x29c0c4,_0x1a9659){return function(_0x18e975){logger[_0x550a('0xf')]('['+[_0x1e6d9a[_0x550a('0x10')]()]+_0x550a('0x27'),_0x18e975);return new Promise(function(_0x5380b3,_0x499664){var _0x203314={'method':_0x550a('0x9'),'uri':_0x442a04+_0x550a('0x28')+_0x18e975['endUserNumber']+'&'+_0x29c0c4+'&'+_0x1a9659,'auth':_0x4f25d6,'json':!![]};return rp(_0x203314)[_0x550a('0xb')](function(_0x5e9599){if(_0x5e9599[_0x550a('0xc')][_0x550a('0xd')]>0x0){_0x18e975[_0x550a('0x26')]=_0x5e9599[_0x550a('0xc')][0x0]['sys_id'];logger['info']('['+[_0x1e6d9a['toUpperCase']()]+'],\x20getEndUser\x20crm',_0x18e975);_0x5380b3(_0x18e975);}else{return createEndUser(_0x1e6d9a,_0x4f25d6,_0x18e975,_0x442a04,_0x29c0c4)[_0x550a('0xb')](function(_0x185937){logger['info']('['+[_0x1e6d9a['toUpperCase']()]+'],\x20createEndUser\x20crm',_0x185937);_0x5380b3(_0x185937);});}})[_0x550a('0x12')](function(_0x364af0){logger[_0x550a('0x13')]('['+[_0x1e6d9a['toUpperCase']()]+']',_0x364af0[_0x550a('0x14')]);_0x499664(_0x364af0[_0x550a('0x14')]);});});};}function getCustomFields(_0x2ee32e,_0xea2cd){var _0x1a616c={};if(_0x2ee32e[_0x550a('0xd')]>0x0){_['forEach'](_0x2ee32e,function(_0x48659a){if(_[_0x550a('0x29')]([_0x550a('0x2a'),_0x550a('0x2b')],_0x48659a[_0x550a('0x2c')])&&_0x48659a['nameField']&&!_0x48659a[_0x550a('0x2d')]){_0x1a616c[_0x48659a['nameField'][_0x550a('0x2e')]()]=_0x48659a[_0x550a('0x2f')][_0x550a('0x30')]();}else if(_[_0x550a('0x29')]([_0x550a('0x2a'),_0x550a('0x2b')],_0x48659a['type'])&&_0x48659a[_0x550a('0x31')]&&_0x48659a[_0x550a('0x2d')]){_0x1a616c[_0x48659a[_0x550a('0x31')][_0x550a('0x2e')]()]=_0x48659a[_0x550a('0x2f')][_0x550a('0x30')]();}else if(_0x48659a[_0x550a('0x2c')]===_0x550a('0x32')&&_0x48659a[_0x550a('0x33')]&&_0x48659a[_0x550a('0x31')]&&_0x48659a[_0x550a('0x2d')]){_0x1a616c[_0x48659a[_0x550a('0x31')][_0x550a('0x2e')]()]=_0xea2cd[_0x48659a['variableName']]['toString']();}else if(_0x48659a[_0x550a('0x2c')]===_0x550a('0x34')&&_0x48659a[_0x550a('0x35')]&&_0x48659a[_0x550a('0x35')]['name']&&_0x48659a[_0x550a('0x31')]&&_0x48659a[_0x550a('0x2d')]){_0x1a616c[_0x48659a[_0x550a('0x31')][_0x550a('0x2e')]()]=_0xea2cd[_0x48659a[_0x550a('0x35')][_0x550a('0x36')][_0x550a('0x2e')]()][_0x550a('0x30')]();}});}return _0x1a616c;}function getTicket(_0x4b5890,_0x2748e5,_0x107257,_0x5169df,_0x3a026e,_0x2941ff){return function(_0x44e813){logger[_0x550a('0xf')]('['+[_0x4b5890['toUpperCase']()]+']\x20getTicket\x20input\x20crm',_0x44e813);return new Promise(function(_0x519a32,_0x4ce008){var _0x57851f=_0x4b5890[_0x550a('0x2e')]()==='outbound'?_0x44e813[_0x550a('0x1c')]:_0x44e813[_0x550a('0x26')];var _0x3bc711={'method':_0x550a('0x21'),'uri':_0x107257+_0x550a('0x37')+'?'+_0x2941ff,'body':Object[_0x550a('0x38')]({},{'active':_0x550a('0x1b'),'caller_id':_0x57851f,'assigned_to':_0x44e813[_0x550a('0x1c')],'short_description':intUtil['getString'](_0x5169df[_0x550a('0x39')],_0x3a026e,'\x20'),'description':intUtil['getString'](_0x5169df['Descriptions'],_0x3a026e,'\x0a')},getCustomFields(_0x5169df['Fields'],_0x3a026e)),'auth':_0x2748e5,'json':!![]};return rp(_0x3bc711)[_0x550a('0xb')](function(_0x565dc8){logger[_0x550a('0xf')]('['+[_0x4b5890['toUpperCase']()]+']\x20POST\x20incident\x20entity\x20schema',_0x565dc8['result']);_0x44e813[_0x550a('0x3a')]=_0x565dc8[_0x550a('0xc')]['sys_id'];_0x44e813[_0x550a('0x3b')]=_0x565dc8[_0x550a('0xc')]['number'];logger[_0x550a('0xf')]('['+[_0x4b5890['toUpperCase']()]+_0x550a('0x3c'),_0x44e813);_0x519a32(_0x44e813);})[_0x550a('0x12')](function(_0x9eefc6){logger['error']('['+[_0x4b5890['toUpperCase']()]+']',_0x9eefc6[_0x550a('0x14')]);_0x4ce008(_0x9eefc6[_0x550a('0x14')]);});});};}function createRemoteTag(_0x28686c,_0x4af134,_0x5cccd1,_0x5e1d00){return new Promise(function(_0xc41e1f,_0x3eaf40){var _0xf5784f={'method':_0x550a('0x21'),'uri':_0x5cccd1+_0x550a('0x3d')+'?'+_0x5e1d00,'body':{'short_description':_0x28686c,'global':!![],'active':!![],'name':_0x28686c},'auth':_0x4af134,'json':!![]};return rp(_0xf5784f)[_0x550a('0xb')](function(_0x29dea3){var _0x2a6685=_0x29dea3['result'][_0x550a('0xe')];_0xc41e1f(_0x2a6685);});});}function getRemoteTag(_0x519195,_0xc0fab8,_0x125624,_0x13d411,_0x1c778e){return new Promise(function(_0x5a0bb9,_0x3dc16f){var _0x1a84de={'method':'GET','uri':_0x125624+'label'+'?sysparm_query=name%3D'+_0x519195+'&'+_0x13d411,'auth':_0xc0fab8,'json':!![]};return rp(_0x1a84de)['then'](function(_0xb653b8){if(_0xb653b8['result'][_0x550a('0xd')]>0x0){var _0x35477e=_0xb653b8[_0x550a('0xc')][0x0][_0x550a('0xe')];_0x5a0bb9(_0x35477e);}else{return createRemoteTag(_0x519195,_0xc0fab8,_0x125624,_0x13d411)[_0x550a('0xb')](function(_0x3cfe0b){_0x5a0bb9(_0x3cfe0b);});}});});}function assignTagToIncident(_0x4598cb,_0x419116,_0x479afc,_0x2e0242,_0x426dd1){return new Promise(function(_0x2ef158,_0xf8af91){var _0x1da0cd={'method':_0x550a('0x21'),'uri':_0x479afc+'label_entry'+'?'+_0x426dd1,'body':{'label':_0x4598cb,'table':_0x550a('0x37'),'id_type':_0x550a('0x3e'),'table_key':_0x2e0242[_0x550a('0x3a')],'title':_0x550a('0x3f')+_0x2e0242[_0x550a('0x3b')],'id_display':_0x2e0242['ticketNumber']},'auth':_0x419116,'json':!![]};return rp(_0x1da0cd)[_0x550a('0xb')](function(_0x2dd764){_0x2ef158();})[_0x550a('0x12')](function(){_0x2ef158();});});}function manageTags(_0x1e59a9,_0x1463a9,_0x4223a0,_0x37d158,_0x301b18,_0x5771dd,_0x2c78fc){return new Promise(function(_0x377bd2,_0x2cfcc1){var _0x1cf1af=[];_0x1463a9[_0x550a('0x40')](function(_0x2fc76e){_0x1cf1af[_0x550a('0x41')](getRemoteTag(_0x2fc76e,_0x4223a0,_0x37d158,_0x5771dd,_0x2c78fc));});return Promise[_0x550a('0x42')](_0x1cf1af)[_0x550a('0xb')](function(_0x5817b3){if(_0x5817b3[_0x550a('0xd')]){logger[_0x550a('0xf')]('['+[_0x1e59a9[_0x550a('0x10')]()]+_0x550a('0x43'),_0x5817b3);var _0xac57f1=[];_0x5817b3['forEach'](function(_0x4918ed){_0xac57f1[_0x550a('0x41')](assignTagToIncident(_0x4918ed,_0x4223a0,_0x37d158,_0x301b18,_0x5771dd));});return Promise[_0x550a('0x42')](_0xac57f1)[_0x550a('0xb')](function(){_0x377bd2();})[_0x550a('0x12')](function(){_0x377bd2();});}else{_0x377bd2();}});});}function getTags(_0x1d15c2,_0x4e70a2,_0x209f4a,_0x17360e,_0x1a2329,_0x3504f4){return function(_0x38caa3){return new Promise(function(_0x5b7cf0,_0x677971){var _0x2d3127=[];var _0x33fa9a=_0x17360e[_0x550a('0x44')];if(_0x33fa9a&&_0x33fa9a[_0x550a('0xd')]>0x0){_0x2d3127=_[_0x550a('0x45')](_0x33fa9a,_0x550a('0x36'));}if(_0x2d3127['length']>0x0){return manageTags(_0x1d15c2,_0x2d3127,_0x4e70a2,_0x209f4a,_0x38caa3,_0x1a2329,_0x3504f4)[_0x550a('0xb')](function(){_0x5b7cf0(_0x38caa3);});}else{_0x5b7cf0(_0x38caa3);}});};}function emit(_0x40dfe2,_0x504fcb,_0x7eaef0){var _0x3919b7=_0x550a('0x46')+_0x550a('0x47')+_0x550a('0x48')+_0x550a('0x49');var _0x964313={'uri':_0x40dfe2+_0x550a('0x4a')+_0x7eaef0+_0x3919b7};io['to'](util[_0x550a('0x4b')]('user:%s',_0x504fcb))[_0x550a('0x4c')](_0x550a('0x4d'),_0x964313);}exports['cs']=function(_0x17f3dc,_0x1fa3a1,_0x15b804,_0x493e46,_0xac6ef1,_0x437c32,_0x5d5431,_0x28e8c4){var _0x36f50a={};var _0x52e609={'user':_0x437c32['username'],'pass':_0x437c32[_0x550a('0x4e')]};var _0x2b48f7=_0x550a('0x4f');var _0x5286bb='sysparm_display_value=true';_0x437c32[_0x550a('0x50')]=intUtil[_0x550a('0x51')](_0x437c32[_0x550a('0x50')]);_0x437c32[_0x550a('0x52')]=intUtil[_0x550a('0x51')](_0x437c32['serverUrl']);var _0x32db1b=util[_0x550a('0x4b')](_0x550a('0x53'),_0x437c32[_0x550a('0x50')]);_0x36f50a[_0x550a('0x17')]=!_['isNil'](_0x493e46)?_0x493e46[_0x550a('0x54')]:null;_0x36f50a[_0x550a('0x20')]=_0x437c32[_0x550a('0x54')];_0x36f50a['endUserNumber']=_0x28e8c4[_0x550a('0x2e')]()==='outbound'?_0x1fa3a1[_0x550a('0x55')]:_0x1fa3a1[_0x550a('0x56')];_0x36f50a['callDirection']=_0x28e8c4===_0x550a('0x57')||_0x28e8c4==='unmanaged'?_0x550a('0x57'):_0x550a('0x58');var _0x10aedb=util[_0x550a('0x4b')](_0x550a('0x59'),_0x437c32[_0x550a('0x52')],_0x1fa3a1['uniqueid'],md5(_0x1fa3a1[_0x550a('0x5a')]));if(_0xac6ef1&&_0xac6ef1['monitor_format']){logger[_0x550a('0xf')](_0x550a('0x5b'),_0x550a('0x5c'));_0x1fa3a1[_0x550a('0x5d')]=_0x10aedb;}else if(_0x5d5431&&_0x5d5431['recordingFormat']&&_0x5d5431[_0x550a('0x5e')]!=='none'){logger[_0x550a('0xf')](_0x550a('0x5f'),_0x550a('0x5c'));_0x1fa3a1[_0x550a('0x5d')]=_0x10aedb;}else{_0x1fa3a1[_0x550a('0x5d')]='';}return getAdminUser(_0x28e8c4,_0x52e609,_0x36f50a,_0x32db1b,_0x5286bb,_0x2b48f7)[_0x550a('0xb')](getUser(_0x28e8c4,_0x52e609,_0x32db1b,_0x5286bb,_0x2b48f7))[_0x550a('0xb')](getEndUser(_0x28e8c4,_0x52e609,_0x32db1b,_0x5286bb,_0x2b48f7))[_0x550a('0xb')](getTicket(_0x28e8c4,_0x52e609,_0x32db1b,_0x15b804,_0x1fa3a1,_0x5286bb))[_0x550a('0xb')](function(_0x584be3){logger[_0x550a('0xf')](util[_0x550a('0x4b')](_0x550a('0x60'),_0x584be3[_0x550a('0x3a')]));logger[_0x550a('0xf')](util[_0x550a('0x4b')](_0x550a('0x61'),_0x28e8c4));if(_0x28e8c4!==_0x550a('0x62')){logger[_0x550a('0xf')]('['+[_0x28e8c4['toUpperCase']()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x437c32['remoteUri'],_0x493e46[_0x550a('0x36')],_0x584be3['ticketId']);}})[_0x550a('0x12')](function(_0x51c7bd){logger[_0x550a('0x13')]('['+[_0x28e8c4[_0x550a('0x10')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0x550a('0x63')](_0x51c7bd,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 686cbd8..64f613e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad9d=['parent_type','Contacts','parent_name','direction','length','forEach','variableName','push','set_entry','JSON','stringify','Calls','Basic\x20%s','toString','base64','isNil','info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','then','entry_list','find','user_name','value','Agent\x20found!','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','format','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','first_name','<unknown>','Caller\x20-\x20%s','debug','merge','map','type','string','nameField','customField','toLowerCase','idField','content','variable','custom_fields','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','Fields','Inbound','Ticket\x20created!','users','contacts','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','user:%s','trigger:browser:url','error','outbound','uri','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','charAt','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','lastevent','toUpperCase','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','lodash','request-promise','md5','util','ioredis','../../../../config/logger','sugarcrm','redis','localhost','POST','emit','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','replace','duration_hours','parent_id'];(function(_0x3f902f,_0x28394b){var _0x29a587=function(_0x5931ab){while(--_0x5931ab){_0x3f902f['push'](_0x3f902f['shift']());}};_0x29a587(++_0x28394b);}(_0xad9d,0x1d4));var _0xdad9=function(_0x49e678,_0x80cba0){_0x49e678=_0x49e678-0x0;var _0x1cfbbe=_0xad9d[_0x49e678];return _0x1cfbbe;};'use strict';var _=require(_0xdad9('0x0'));var rp=require(_0xdad9('0x1'));var BPromise=require('bluebird');var md5=require(_0xdad9('0x2'));var util=require(_0xdad9('0x3'));var Redis=require(_0xdad9('0x4'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xdad9('0x5'))(_0xdad9('0x6'));config[_0xdad9('0x7')]=_['defaults'](config[_0xdad9('0x7')],{'host':_0xdad9('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xdad9('0x7')]));var def={'method':_0xdad9('0x9'),'json':!![]};function emit(_0x419232,_0x3b7b3e,_0x286404){io['to'](_0x419232)[_0xdad9('0xa')](_0x3b7b3e,_0x286404);}function getTicket(_0x586515,_0x29edc2,_0x115b78,_0x2e61fe,_0xeab992,_0x5b49dc,_0x2a4865,_0x4e4fe9){logger['info'](_0xdad9('0xb'));var _0x5c0ec2=new Date();var _0x1e0f92=[{'name':_0xdad9('0xc'),'value':intUtil[_0xdad9('0xd')](_0x2e61fe[_0xdad9('0xe')],_0xeab992,'\x20')},{'name':_0xdad9('0xf'),'value':_0x29edc2['id']},{'name':_0xdad9('0x10'),'value':_0x29edc2['id']},{'name':_0xdad9('0x11'),'value':intUtil[_0xdad9('0xd')](_0x2e61fe[_0xdad9('0x12')],_0xeab992,'\x0a')},{'name':_0xdad9('0x13'),'value':_0x5c0ec2[_0xdad9('0x14')]()['slice'](0x0,0x13)[_0xdad9('0x15')]('T','\x20')},{'name':_0xdad9('0x16'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0xdad9('0x17'),'value':_0x115b78['id']},{'name':_0xdad9('0x18'),'value':_0xdad9('0x19')},{'name':_0xdad9('0x1a'),'value':_0x115b78['name']},{'name':_0xdad9('0x1b'),'value':_0x4e4fe9}];if(_0x5b49dc[_0xdad9('0x1c')]){_[_0xdad9('0x1d')](_0x5b49dc,function(_0x2fdd1b){if(_0xeab992[_0x2fdd1b[_0xdad9('0x1e')]]){_0x1e0f92[_0xdad9('0x1f')]({'name':_0x2fdd1b['idField'],'value':_0xeab992[_0x2fdd1b[_0xdad9('0x1e')]]});}});}return request({'form':{'method':_0xdad9('0x20'),'input_type':_0xdad9('0x21'),'response_type':_0xdad9('0x21'),'rest_data':JSON[_0xdad9('0x22')]({'session':_0x2a4865['id'],'module_name':_0xdad9('0x23'),'name_value_list':_0x1e0f92})}});}function getAuth(_0x423da7){return util['format'](_0xdad9('0x24'),new Buffer(_0x423da7['apiKey']+':X')[_0xdad9('0x25')](_0xdad9('0x26')));}function getServerInfo(_0x108d04){return request({'form':{'method':'get_server_info','input_type':_0xdad9('0x21'),'response_type':_0xdad9('0x21'),'rest_data':JSON[_0xdad9('0x22')]({'session':_0x108d04['id']})}});}function getUser(_0x5ca711,_0x4a2038,_0x244c67){if(!_[_0xdad9('0x27')](_0x4a2038)){logger[_0xdad9('0x28')](_0xdad9('0x29'),_0x4a2038);return request({'form':{'method':_0xdad9('0x2a'),'input_type':_0xdad9('0x21'),'response_type':'JSON','rest_data':JSON[_0xdad9('0x22')]({'session':_0x244c67['id'],'module_name':_0xdad9('0x2b'),'query':util['format']('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x4a2038),'order_by':'','offset':'0','select_fields':['id',_0xdad9('0xc'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xdad9('0x2c')](function(_0x28f72e){if(_0x28f72e[_0xdad9('0x2d')][_0xdad9('0x1c')]){var _0x576a03=_[_0xdad9('0x2e')](_0x28f72e[_0xdad9('0x2d')],function(_0x50a468){return _0x50a468['name_value_list'][_0xdad9('0x2f')][_0xdad9('0x30')]===_0x4a2038;});if(_0x576a03){logger[_0xdad9('0x28')](_0xdad9('0x31'));return BPromise['resolve']({'id':_0x576a03[_0xdad9('0x32')]['id'][_0xdad9('0x30')],'name':_0x576a03[_0xdad9('0x32')][_0xdad9('0xc')][_0xdad9('0x30')]});}}logger[_0xdad9('0x28')](_0xdad9('0x33'));return BPromise[_0xdad9('0x34')]({'id':_0x244c67[_0xdad9('0x32')][_0xdad9('0x35')]['value'],'name':_0x244c67[_0xdad9('0x32')][_0xdad9('0x2f')][_0xdad9('0x30')]});});}else{logger['info'](_0xdad9('0x36'));return BPromise[_0xdad9('0x34')]({'id':_0x244c67[_0xdad9('0x32')]['user_id']['value'],'name':_0x244c67['name_value_list']['user_name']['value']});}}function getEndUser(_0x3edd35,_0x1aafca,_0x3f5b40,_0x578915){logger[_0xdad9('0x28')](_0xdad9('0x37'),_0x3f5b40);return request({'form':{'method':_0xdad9('0x2a'),'input_type':'JSON','response_type':_0xdad9('0x21'),'rest_data':JSON[_0xdad9('0x22')]({'session':_0x578915['id'],'module_name':_0xdad9('0x19'),'query':util[_0xdad9('0x38')](_0xdad9('0x39'),_0x3f5b40),'order_by':'','offset':'0','select_fields':['id',_0xdad9('0xc'),_0xdad9('0x3a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x48b23e){if(_0x48b23e[_0xdad9('0x2d')][_0xdad9('0x1c')]){var _0x3a9c19=_[_0xdad9('0x2e')](_0x48b23e[_0xdad9('0x2d')],function(_0x428719){return _0x428719[_0xdad9('0x32')][_0xdad9('0x3a')][_0xdad9('0x30')]===_0x3f5b40;});if(_0x3a9c19){logger[_0xdad9('0x28')](_0xdad9('0x3b'));return BPromise[_0xdad9('0x34')]({'id':_0x3a9c19[_0xdad9('0x32')]['id']['value'],'name':_0x3a9c19[_0xdad9('0x32')][_0xdad9('0xc')][_0xdad9('0x30')],'phone':_0x3a9c19[_0xdad9('0x32')][_0xdad9('0x3a')][_0xdad9('0x30')]});}}else{logger[_0xdad9('0x28')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0xdad9('0x20'),'input_type':_0xdad9('0x21'),'response_type':_0xdad9('0x21'),'rest_data':JSON[_0xdad9('0x22')]({'session':_0x578915['id'],'module_name':_0xdad9('0x19'),'name_value_list':[{'name':_0xdad9('0x3c'),'value':_0x1aafca!==_0xdad9('0x3d')?_0x1aafca:util[_0xdad9('0x38')](_0xdad9('0x3e'),_0x3f5b40)},{'name':_0xdad9('0x3a'),'value':_0x3f5b40}]})}})[_0xdad9('0x2c')](function(_0x30ebc7){logger['info']('Enduser\x20created.');return BPromise[_0xdad9('0x34')]({'id':_0x30ebc7['id'],'name':_0x30ebc7[_0xdad9('0x2d')]['first_name'][_0xdad9('0x30')],'phone':_0x30ebc7['entry_list'][_0xdad9('0x3a')][_0xdad9('0x30')]});});}});}function request(_0x4a3a44){logger[_0xdad9('0x3f')]('[HTTP]',JSON[_0xdad9('0x22')](_0x4a3a44));return rp(_[_0xdad9('0x40')](def,_0x4a3a44));}function getTags(_0x452f0f,_0x12fed2){var _0x2d9c42=[];if(_0x452f0f&&_0x452f0f[_0xdad9('0x1c')]>0x0){_0x2d9c42=_[_0xdad9('0x41')](_0x452f0f,_0x12fed2);}return _0x2d9c42;}function getCustomFields(_0x606dcd,_0x3d2490){var _0x5308f1=[];var _0x4f6c1c={'custom_fields':[]};if(_0x606dcd[_0xdad9('0x1c')]>0x0){_['forEach'](_0x606dcd,function(_0x3ab528){if(_0x3ab528[_0xdad9('0x42')]===_0xdad9('0x43')&&_0x3ab528[_0xdad9('0x44')]&&!_0x3ab528[_0xdad9('0x45')]){_0x4f6c1c[_0x3ab528['nameField'][_0xdad9('0x46')]()]=_0x3ab528['content']['toString']();}else if(_0x3ab528['type']===_0xdad9('0x43')&&_0x3ab528[_0xdad9('0x47')]&&_0x3ab528[_0xdad9('0x45')]){_0x4f6c1c['custom_fields'][_0xdad9('0x1f')]({'id':_0x3ab528[_0xdad9('0x47')],'value':_0x3ab528[_0xdad9('0x48')][_0xdad9('0x25')]()});}else if(_0x3ab528[_0xdad9('0x42')]===_0xdad9('0x49')&&_0x3ab528['variableName']&&_0x3ab528['idField']&&_0x3ab528['customField']){_0x3d2490[_0x3ab528[_0xdad9('0x1e')]]&&_0x4f6c1c[_0xdad9('0x4a')][_0xdad9('0x1f')]({'id':_0x3ab528[_0xdad9('0x47')],'value':_0x3d2490[_0x3ab528['variableName']]['toString']()});}else if(_0x3ab528['type']==='customVariable'&&_0x3ab528['Variable']&&_0x3ab528['Variable'][_0xdad9('0xc')]&&_0x3ab528[_0xdad9('0x47')]&&_0x3ab528[_0xdad9('0x45')]){_0x3d2490[_0x3ab528[_0xdad9('0x4b')][_0xdad9('0xc')][_0xdad9('0x46')]()]&&_0x4f6c1c['custom_fields'][_0xdad9('0x1f')]({'id':_0x3ab528[_0xdad9('0x47')],'value':_0x3d2490[_0x3ab528[_0xdad9('0x4b')][_0xdad9('0xc')][_0xdad9('0x46')]()][_0xdad9('0x25')]()});}});}return _0x4f6c1c;}function getConnection(_0x3ec6b0){return request({'method':_0xdad9('0x9'),'form':{'method':_0xdad9('0x4c'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xdad9('0x22')]({'user_auth':{'user_name':_0x3ec6b0[_0xdad9('0x4d')],'password':_0x3ec6b0[_0xdad9('0x4e')],'encryption':_0xdad9('0x4f')},'application':_0xdad9('0x50')})}})['then'](function(_0x480e53){var _0x20ee55=_0x480e53;if(_0x20ee55['id']){def[_0xdad9('0x51')]=_0x20ee55['id'];return BPromise[_0xdad9('0x34')](_0x20ee55);}else{throw new Error(util[_0xdad9('0x38')](_0xdad9('0x52'),_0x3ec6b0['id']));}});}function setRelationship(_0x5b10e2,_0x3bbcfd,_0x129710,_0x344558){return request({'form':{'method':_0xdad9('0x53'),'input_type':'JSON','response_type':_0xdad9('0x21'),'rest_data':JSON['stringify']({'session':_0x5b10e2['id'],'module_name':'Calls','module_id':_0x129710['id'],'link_field_name':_0x344558,'related_ids':[_0x3bbcfd['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xdad9('0x54')]=function(_0x25b392,_0x59892e,_0x1975f1,_0x38a199,_0x210aa3,_0x330cae){var _0x54d749,_0x19fb00,_0x55a492,_0x331881;_0x330cae[_0xdad9('0x55')]=intUtil[_0xdad9('0x56')](_0x330cae[_0xdad9('0x55')]);_0x330cae[_0xdad9('0x57')]=intUtil[_0xdad9('0x56')](_0x330cae[_0xdad9('0x57')]);def['uri']=util[_0xdad9('0x38')](_0xdad9('0x58'),_0x330cae[_0xdad9('0x55')]);if(_0x210aa3&&_0x210aa3[_0xdad9('0x59')]){logger[_0xdad9('0x28')](_0xdad9('0x5a'),'Recording\x20is\x20enabled!');_0x59892e[_0xdad9('0x5b')]=util[_0xdad9('0x38')](_0xdad9('0x5c'),_0x330cae['serverUrl'],_0x59892e[_0xdad9('0x5d')],md5(_0x59892e['uniqueid']));}else{_0x59892e[_0xdad9('0x5b')]='';}return getConnection(_0x330cae)[_0xdad9('0x2c')](function(_0x272e4b){_0x331881=_0x272e4b;return getUser(_0x330cae,_0x38a199['name'],_0x331881);})[_0xdad9('0x2c')](function(_0x201cf1){_0x54d749=_0x201cf1;logger[_0xdad9('0x28')]('The\x20User\x20ID\x20is:',_0x54d749['id']);return getEndUser(_0x330cae,_0x59892e[_0xdad9('0x5e')],_0x59892e[_0xdad9('0x5f')],_0x331881);})[_0xdad9('0x2c')](function(_0x407b3d){_0x19fb00=_0x407b3d;logger[_0xdad9('0x28')]('The\x20Enduser\x20ID\x20is:',_0x19fb00['id']);return getTicket(_0x330cae,_0x54d749,_0x19fb00,_0x1975f1,_0x59892e,_0x1975f1[_0xdad9('0x60')],_0x331881,_0xdad9('0x61'));})['then'](function(_0x214410){_0x55a492=_0x214410;logger[_0xdad9('0x28')](_0xdad9('0x62'));logger[_0xdad9('0x28')]('The\x20Ticket\x20ID\x20is:',_0x55a492['id']);return setRelationship(_0x331881,_0x54d749,_0x55a492,_0xdad9('0x63'));})[_0xdad9('0x2c')](function(){return setRelationship(_0x331881,_0x19fb00,_0x55a492,_0xdad9('0x64'));})[_0xdad9('0x2c')](function(){return getServerInfo(_0x331881);})[_0xdad9('0x2c')](function(_0x828599){var _0x25aec7=parseInt(_0x828599[_0xdad9('0x65')]['charAt'](0x0));var _0x4bcffd=util[_0xdad9('0x38')](_0xdad9('0x66'),_0x330cae['remoteUri'],_0x55a492['id']);if(_0x25aec7>0x6){_0x4bcffd=util['format'](_0xdad9('0x67'),_0x330cae[_0xdad9('0x55')],_0x55a492['id']);}logger['info'](_0xdad9('0x5a'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xdad9('0x38')](_0xdad9('0x68'),_0x38a199['name']),_0xdad9('0x69'),{'uri':_0x4bcffd});})['catch'](function(_0x3043a4){logger[_0xdad9('0x6a')]('[QUEUE]',JSON[_0xdad9('0x22')](_0x3043a4));});};exports[_0xdad9('0x6b')]=function(_0x144f40,_0x2d0891,_0x1f12ef,_0x144a3a,_0xaa0e8,_0x21430b,_0x209399){var _0x3dcef7,_0x5e35df,_0xbf8254,_0x2a3a34;_0x21430b[_0xdad9('0x55')]=intUtil[_0xdad9('0x56')](_0x21430b['remoteUri']);_0x21430b['serverUrl']=intUtil[_0xdad9('0x56')](_0x21430b[_0xdad9('0x57')]);def[_0xdad9('0x6c')]=util['format'](_0xdad9('0x58'),_0x21430b[_0xdad9('0x55')]);if(_0x209399&&_0x209399[_0xdad9('0x6d')]&&_0x209399[_0xdad9('0x6d')]!==_0xdad9('0x6e')){logger[_0xdad9('0x28')](_0xdad9('0x6f'),_0xdad9('0x70'));_0x2d0891[_0xdad9('0x5b')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x21430b['serverUrl'],_0x2d0891[_0xdad9('0x5d')],md5(_0x2d0891[_0xdad9('0x5d')]));}return getConnection(_0x21430b)[_0xdad9('0x2c')](function(_0x1154e9){_0x2a3a34=_0x1154e9;return getUser(_0x21430b,_0x144a3a['name'],_0x2a3a34);})[_0xdad9('0x2c')](function(_0x300e07){_0x3dcef7=_0x300e07;logger[_0xdad9('0x28')]('The\x20User\x20ID\x20is:',_0x3dcef7['id']);return getEndUser(_0x21430b,_0x2d0891[_0xdad9('0x71')],_0x2d0891[_0xdad9('0x72')],_0x2a3a34);})[_0xdad9('0x2c')](function(_0x54249f){_0x5e35df=_0x54249f;logger[_0xdad9('0x28')]('The\x20Enduser\x20ID\x20is:',_0x5e35df['id']);return getTicket(_0x21430b,_0x3dcef7,_0x5e35df,_0x1f12ef,_0x2d0891,_0x1f12ef[_0xdad9('0x60')],_0x2a3a34,'Outbound');})['then'](function(_0x161f3f){_0xbf8254=_0x161f3f;logger[_0xdad9('0x28')](_0xdad9('0x62'));logger[_0xdad9('0x28')](_0xdad9('0x73'),_0xbf8254['id']);return setRelationship(_0x2a3a34,_0x3dcef7,_0xbf8254,_0xdad9('0x63'));})['then'](function(){return setRelationship(_0x2a3a34,_0x5e35df,_0xbf8254,_0xdad9('0x64'));})[_0xdad9('0x2c')](function(){return getServerInfo(_0x2a3a34);})[_0xdad9('0x2c')](function(_0x362b3f){var _0x515615=parseInt(_0x362b3f[_0xdad9('0x65')][_0xdad9('0x74')](0x0));var _0x4b2bb=util['format'](_0xdad9('0x66'),_0x21430b[_0xdad9('0x55')],_0xbf8254['id']);if(_0x515615>0x6){_0x4b2bb=util[_0xdad9('0x38')](_0xdad9('0x67'),_0x21430b[_0xdad9('0x55')],_0xbf8254['id']);}logger[_0xdad9('0x28')](_0xdad9('0x6f'),_0xdad9('0x75'));emit(util[_0xdad9('0x38')]('user:%s',_0x144a3a['name']),_0xdad9('0x69'),{'uri':_0x4b2bb});})[_0xdad9('0x76')](function(_0x5ddf9b){logger[_0xdad9('0x6a')](_0xdad9('0x6f'),JSON[_0xdad9('0x22')](_0x5ddf9b));});};exports['unmanaged']=function(_0x4ec6f3,_0x113b3f,_0x487348,_0x54c38c,_0xcffa20,_0x20f460){var _0x36c109,_0x519850,_0x5e1a30,_0x459183;_0x20f460[_0xdad9('0x55')]=intUtil[_0xdad9('0x56')](_0x20f460[_0xdad9('0x55')]);_0x20f460[_0xdad9('0x57')]=intUtil[_0xdad9('0x56')](_0x20f460[_0xdad9('0x57')]);def[_0xdad9('0x6c')]=util[_0xdad9('0x38')](_0xdad9('0x58'),_0x20f460[_0xdad9('0x55')]);if(_0xcffa20&&_0xcffa20[_0xdad9('0x59')]){logger['info']('['+_0x113b3f[_0xdad9('0x77')][_0xdad9('0x78')]()+']',_0xdad9('0x70'));_0x113b3f[_0xdad9('0x5b')]=util[_0xdad9('0x38')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x20f460['serverUrl'],_0x113b3f['uniqueid'],md5(_0x113b3f[_0xdad9('0x5d')]));}else{_0x113b3f['recordingURL']='';}return getConnection(_0x20f460)[_0xdad9('0x2c')](function(_0x1007a7){_0x459183=_0x1007a7;if(!_[_0xdad9('0x27')](_0x54c38c)){return getUser(_0x20f460,_0x54c38c[_0xdad9('0xc')],_0x459183);}else{return getUser(_0x20f460,null,_0x459183);}})[_0xdad9('0x2c')](function(_0x1f88d7){_0x36c109=_0x1f88d7;logger[_0xdad9('0x28')](_0xdad9('0x79'),_0x36c109['id']);return getEndUser(_0x20f460,_0x113b3f[_0xdad9('0x5e')],_0x113b3f[_0xdad9('0x5f')],_0x459183);})[_0xdad9('0x2c')](function(_0x5612b8){_0x519850=_0x5612b8;logger[_0xdad9('0x28')](_0xdad9('0x7a'),_0x519850['id']);return getTicket(_0x20f460,_0x36c109,_0x519850,_0x487348,_0x113b3f,_0x487348['Fields'],_0x459183,_0xdad9('0x61'));})[_0xdad9('0x2c')](function(_0x4b2aad){_0x5e1a30=_0x4b2aad;logger[_0xdad9('0x28')]('Ticket\x20created!');logger[_0xdad9('0x28')]('The\x20Ticket\x20ID\x20is:',_0x5e1a30['id']);return setRelationship(_0x459183,_0x36c109,_0x5e1a30,_0xdad9('0x63'));})[_0xdad9('0x2c')](function(){return setRelationship(_0x459183,_0x519850,_0x5e1a30,_0xdad9('0x64'));})[_0xdad9('0x2c')](function(){return getServerInfo(_0x459183);})[_0xdad9('0x76')](function(_0x4dc429){logger[_0xdad9('0x6a')]('['+_0x113b3f[_0xdad9('0x77')][_0xdad9('0x78')]()+']',JSON['stringify'](_0x4dc429));});};
\ No newline at end of file
+var _0x9db2=['customField','custom_fields','content','type','customVariable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','users','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','The\x20Ticket\x20ID\x20is:','contacts','charAt','unmanaged','toUpperCase','lastevent','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','socket.io-emitter','POST','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','Descriptions','toISOString','duration_hours','parent_id','parent_type','Contacts','parent_name','direction','length','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','base64','get_server_info','isNil','info','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','value','Agent\x20found!','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','first_name','<unknown>','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','string','nameField','toLowerCase','toString'];(function(_0x306087,_0xa8ca3a){var _0x29e082=function(_0x374750){while(--_0x374750){_0x306087['push'](_0x306087['shift']());}};_0x29e082(++_0xa8ca3a);}(_0x9db2,0x12e));var _0x29db=function(_0x4207a6,_0x3a3110){_0x4207a6=_0x4207a6-0x0;var _0x42b37a=_0x9db2[_0x4207a6];return _0x42b37a;};'use strict';var _=require(_0x29db('0x0'));var rp=require(_0x29db('0x1'));var BPromise=require(_0x29db('0x2'));var md5=require(_0x29db('0x3'));var util=require(_0x29db('0x4'));var Redis=require(_0x29db('0x5'));var intUtil=require(_0x29db('0x6'));var config=require(_0x29db('0x7'));var logger=require(_0x29db('0x8'))(_0x29db('0x9'));config[_0x29db('0xa')]=_[_0x29db('0xb')](config[_0x29db('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x29db('0xc'))(new Redis(config[_0x29db('0xa')]));var def={'method':_0x29db('0xd'),'json':!![]};function emit(_0x4730cd,_0x5832d1,_0xd20d4c){io['to'](_0x4730cd)['emit'](_0x5832d1,_0xd20d4c);}function getTicket(_0x31de77,_0x18f75f,_0x17ba3d,_0x47d041,_0x4e4b11,_0x17a2d4,_0x5b5841,_0x38138b){logger['info'](_0x29db('0xe'));var _0x38796b=new Date();var _0x48c492=[{'name':_0x29db('0xf'),'value':intUtil[_0x29db('0x10')](_0x47d041[_0x29db('0x11')],_0x4e4b11,'\x20')},{'name':_0x29db('0x12'),'value':_0x18f75f['id']},{'name':_0x29db('0x13'),'value':_0x18f75f['id']},{'name':_0x29db('0x14'),'value':intUtil[_0x29db('0x10')](_0x47d041[_0x29db('0x15')],_0x4e4b11,'\x0a')},{'name':'date_start','value':_0x38796b[_0x29db('0x16')]()['slice'](0x0,0x13)['replace']('T','\x20')},{'name':_0x29db('0x17'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0x29db('0x18'),'value':_0x17ba3d['id']},{'name':_0x29db('0x19'),'value':_0x29db('0x1a')},{'name':_0x29db('0x1b'),'value':_0x17ba3d[_0x29db('0xf')]},{'name':_0x29db('0x1c'),'value':_0x38138b}];if(_0x17a2d4[_0x29db('0x1d')]){_[_0x29db('0x1e')](_0x17a2d4,function(_0x5f5285){if(_0x4e4b11[_0x5f5285[_0x29db('0x1f')]]){_0x48c492[_0x29db('0x20')]({'name':_0x5f5285[_0x29db('0x21')],'value':_0x4e4b11[_0x5f5285[_0x29db('0x1f')]]});}});}return request({'form':{'method':_0x29db('0x22'),'input_type':'JSON','response_type':_0x29db('0x23'),'rest_data':JSON[_0x29db('0x24')]({'session':_0x5b5841['id'],'module_name':_0x29db('0x25'),'name_value_list':_0x48c492})}});}function getAuth(_0x3ca24f){return util[_0x29db('0x26')](_0x29db('0x27'),new Buffer(_0x3ca24f[_0x29db('0x28')]+':X')['toString'](_0x29db('0x29')));}function getServerInfo(_0x74c9b6){return request({'form':{'method':_0x29db('0x2a'),'input_type':_0x29db('0x23'),'response_type':_0x29db('0x23'),'rest_data':JSON[_0x29db('0x24')]({'session':_0x74c9b6['id']})}});}function getUser(_0x490442,_0x155b28,_0x144d8a){if(!_[_0x29db('0x2b')](_0x155b28)){logger[_0x29db('0x2c')]('Getting\x20agent\x20with\x20name',_0x155b28);return request({'form':{'method':'get_entry_list','input_type':_0x29db('0x23'),'response_type':_0x29db('0x23'),'rest_data':JSON[_0x29db('0x24')]({'session':_0x144d8a['id'],'module_name':'Employees','query':util[_0x29db('0x26')](_0x29db('0x2d'),_0x155b28),'order_by':'','offset':'0','select_fields':['id','name',_0x29db('0x2e')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x29db('0x2f')](function(_0x3d143c){if(_0x3d143c[_0x29db('0x30')][_0x29db('0x1d')]){var _0x2efa33=_[_0x29db('0x31')](_0x3d143c['entry_list'],function(_0x1e738){return _0x1e738['name_value_list']['user_name'][_0x29db('0x32')]===_0x155b28;});if(_0x2efa33){logger[_0x29db('0x2c')](_0x29db('0x33'));return BPromise['resolve']({'id':_0x2efa33[_0x29db('0x34')]['id'][_0x29db('0x32')],'name':_0x2efa33[_0x29db('0x34')][_0x29db('0xf')]['value']});}}logger[_0x29db('0x2c')](_0x29db('0x35'));return BPromise[_0x29db('0x36')]({'id':_0x144d8a[_0x29db('0x34')]['user_id'][_0x29db('0x32')],'name':_0x144d8a[_0x29db('0x34')]['user_name'][_0x29db('0x32')]});});}else{logger[_0x29db('0x2c')](_0x29db('0x37'));return BPromise[_0x29db('0x36')]({'id':_0x144d8a[_0x29db('0x34')][_0x29db('0x38')]['value'],'name':_0x144d8a['name_value_list'][_0x29db('0x2e')]['value']});}}function getEndUser(_0x2a07a1,_0x120af4,_0x3945e8,_0x65f3b4){logger[_0x29db('0x2c')](_0x29db('0x39'),_0x3945e8);return request({'form':{'method':'get_entry_list','input_type':_0x29db('0x23'),'response_type':_0x29db('0x23'),'rest_data':JSON[_0x29db('0x24')]({'session':_0x65f3b4['id'],'module_name':'Contacts','query':util[_0x29db('0x26')](_0x29db('0x3a'),_0x3945e8),'order_by':'','offset':'0','select_fields':['id',_0x29db('0xf'),_0x29db('0x3b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x29db('0x2f')](function(_0x3ba853){if(_0x3ba853[_0x29db('0x30')][_0x29db('0x1d')]){var _0x4b2fbb=_[_0x29db('0x31')](_0x3ba853[_0x29db('0x30')],function(_0x4fc74e){return _0x4fc74e[_0x29db('0x34')][_0x29db('0x3b')][_0x29db('0x32')]===_0x3945e8;});if(_0x4b2fbb){logger['info'](_0x29db('0x3c'));return BPromise[_0x29db('0x36')]({'id':_0x4b2fbb[_0x29db('0x34')]['id'][_0x29db('0x32')],'name':_0x4b2fbb[_0x29db('0x34')][_0x29db('0xf')][_0x29db('0x32')],'phone':_0x4b2fbb[_0x29db('0x34')][_0x29db('0x3b')][_0x29db('0x32')]});}}else{logger[_0x29db('0x2c')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x29db('0x22'),'input_type':_0x29db('0x23'),'response_type':_0x29db('0x23'),'rest_data':JSON[_0x29db('0x24')]({'session':_0x65f3b4['id'],'module_name':_0x29db('0x1a'),'name_value_list':[{'name':_0x29db('0x3d'),'value':_0x120af4!==_0x29db('0x3e')?_0x120af4:util[_0x29db('0x26')](_0x29db('0x3f'),_0x3945e8)},{'name':'phone_home','value':_0x3945e8}]})}})[_0x29db('0x2f')](function(_0x15be30){logger[_0x29db('0x2c')](_0x29db('0x40'));return BPromise[_0x29db('0x36')]({'id':_0x15be30['id'],'name':_0x15be30[_0x29db('0x30')][_0x29db('0x3d')][_0x29db('0x32')],'phone':_0x15be30['entry_list']['phone_home']['value']});});}});}function request(_0x5e1816){logger[_0x29db('0x41')](_0x29db('0x42'),JSON[_0x29db('0x24')](_0x5e1816));return rp(_[_0x29db('0x43')](def,_0x5e1816));}function getTags(_0x507a44,_0x1c6839){var _0x5b8d9b=[];if(_0x507a44&&_0x507a44[_0x29db('0x1d')]>0x0){_0x5b8d9b=_[_0x29db('0x44')](_0x507a44,_0x1c6839);}return _0x5b8d9b;}function getCustomFields(_0x549588,_0x1498dc){var _0x1050ea=[];var _0x178b09={'custom_fields':[]};if(_0x549588[_0x29db('0x1d')]>0x0){_[_0x29db('0x1e')](_0x549588,function(_0x2812e4){if(_0x2812e4['type']===_0x29db('0x45')&&_0x2812e4[_0x29db('0x46')]&&!_0x2812e4['customField']){_0x178b09[_0x2812e4[_0x29db('0x46')][_0x29db('0x47')]()]=_0x2812e4['content'][_0x29db('0x48')]();}else if(_0x2812e4['type']===_0x29db('0x45')&&_0x2812e4['idField']&&_0x2812e4[_0x29db('0x49')]){_0x178b09[_0x29db('0x4a')][_0x29db('0x20')]({'id':_0x2812e4[_0x29db('0x21')],'value':_0x2812e4[_0x29db('0x4b')][_0x29db('0x48')]()});}else if(_0x2812e4[_0x29db('0x4c')]==='variable'&&_0x2812e4[_0x29db('0x1f')]&&_0x2812e4['idField']&&_0x2812e4['customField']){_0x1498dc[_0x2812e4[_0x29db('0x1f')]]&&_0x178b09['custom_fields'][_0x29db('0x20')]({'id':_0x2812e4[_0x29db('0x21')],'value':_0x1498dc[_0x2812e4['variableName']][_0x29db('0x48')]()});}else if(_0x2812e4[_0x29db('0x4c')]===_0x29db('0x4d')&&_0x2812e4[_0x29db('0x4e')]&&_0x2812e4[_0x29db('0x4e')]['name']&&_0x2812e4['idField']&&_0x2812e4[_0x29db('0x49')]){_0x1498dc[_0x2812e4[_0x29db('0x4e')][_0x29db('0xf')][_0x29db('0x47')]()]&&_0x178b09[_0x29db('0x4a')][_0x29db('0x20')]({'id':_0x2812e4['idField'],'value':_0x1498dc[_0x2812e4[_0x29db('0x4e')][_0x29db('0xf')]['toLowerCase']()]['toString']()});}});}return _0x178b09;}function getConnection(_0x5d0939){return request({'method':_0x29db('0xd'),'form':{'method':_0x29db('0x4f'),'input_type':'JSON','response_type':_0x29db('0x23'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x5d0939[_0x29db('0x50')],'password':_0x5d0939[_0x29db('0x51')],'encryption':_0x29db('0x52')},'application':_0x29db('0x53')})}})[_0x29db('0x2f')](function(_0x48195a){var _0x15d9e6=_0x48195a;if(_0x15d9e6['id']){def[_0x29db('0x54')]=_0x15d9e6['id'];return BPromise[_0x29db('0x36')](_0x15d9e6);}else{throw new Error(util[_0x29db('0x26')](_0x29db('0x55'),_0x5d0939['id']));}});}function setRelationship(_0x33afef,_0x3cbe2f,_0x4a11ee,_0x452e0d){return request({'form':{'method':_0x29db('0x56'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x29db('0x24')]({'session':_0x33afef['id'],'module_name':'Calls','module_id':_0x4a11ee['id'],'link_field_name':_0x452e0d,'related_ids':[_0x3cbe2f['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x29db('0x57')]=function(_0x3cc28b,_0x1815ed,_0x35281a,_0x471645,_0x2f9708,_0x4accbd){var _0x2b4af7,_0x14274a,_0x34eea6,_0x29f4df;_0x4accbd[_0x29db('0x58')]=intUtil['stripTrailingSlash'](_0x4accbd[_0x29db('0x58')]);_0x4accbd['serverUrl']=intUtil[_0x29db('0x59')](_0x4accbd[_0x29db('0x5a')]);def[_0x29db('0x5b')]=util['format'](_0x29db('0x5c'),_0x4accbd[_0x29db('0x58')]);if(_0x2f9708&&_0x2f9708[_0x29db('0x5d')]){logger[_0x29db('0x2c')]('[QUEUE]',_0x29db('0x5e'));_0x1815ed[_0x29db('0x5f')]=util['format'](_0x29db('0x60'),_0x4accbd[_0x29db('0x5a')],_0x1815ed['uniqueid'],md5(_0x1815ed[_0x29db('0x61')]));}else{_0x1815ed[_0x29db('0x5f')]='';}return getConnection(_0x4accbd)[_0x29db('0x2f')](function(_0x1da9b7){_0x29f4df=_0x1da9b7;return getUser(_0x4accbd,_0x471645[_0x29db('0xf')],_0x29f4df);})[_0x29db('0x2f')](function(_0x892b77){_0x2b4af7=_0x892b77;logger[_0x29db('0x2c')](_0x29db('0x62'),_0x2b4af7['id']);return getEndUser(_0x4accbd,_0x1815ed[_0x29db('0x63')],_0x1815ed[_0x29db('0x64')],_0x29f4df);})['then'](function(_0x208427){_0x14274a=_0x208427;logger['info'](_0x29db('0x65'),_0x14274a['id']);return getTicket(_0x4accbd,_0x2b4af7,_0x14274a,_0x35281a,_0x1815ed,_0x35281a['Fields'],_0x29f4df,_0x29db('0x66'));})[_0x29db('0x2f')](function(_0x317c0d){_0x34eea6=_0x317c0d;logger[_0x29db('0x2c')](_0x29db('0x67'));logger[_0x29db('0x2c')]('The\x20Ticket\x20ID\x20is:',_0x34eea6['id']);return setRelationship(_0x29f4df,_0x2b4af7,_0x34eea6,_0x29db('0x68'));})[_0x29db('0x2f')](function(){return setRelationship(_0x29f4df,_0x14274a,_0x34eea6,'contacts');})[_0x29db('0x2f')](function(){return getServerInfo(_0x29f4df);})[_0x29db('0x2f')](function(_0x4e5cf4){var _0x4cf54d=parseInt(_0x4e5cf4[_0x29db('0x69')]['charAt'](0x0));var _0x300226=util['format'](_0x29db('0x6a'),_0x4accbd['remoteUri'],_0x34eea6['id']);if(_0x4cf54d>0x6){_0x300226=util[_0x29db('0x26')](_0x29db('0x6b'),_0x4accbd['remoteUri'],_0x34eea6['id']);}logger[_0x29db('0x2c')](_0x29db('0x6c'),_0x29db('0x6d'));emit(util['format'](_0x29db('0x6e'),_0x471645[_0x29db('0xf')]),_0x29db('0x6f'),{'uri':_0x300226});})[_0x29db('0x70')](function(_0x1abfd3){logger[_0x29db('0x71')]('[QUEUE]',JSON['stringify'](_0x1abfd3));});};exports['outbound']=function(_0x3c8d03,_0x532a9a,_0x5936cc,_0x39c0ee,_0x245669,_0x623e58,_0xaf59b6){var _0x427b5f,_0x5d78a4,_0x35f157,_0x50ad81;_0x623e58[_0x29db('0x58')]=intUtil[_0x29db('0x59')](_0x623e58[_0x29db('0x58')]);_0x623e58[_0x29db('0x5a')]=intUtil['stripTrailingSlash'](_0x623e58[_0x29db('0x5a')]);def['uri']=util[_0x29db('0x26')](_0x29db('0x5c'),_0x623e58[_0x29db('0x58')]);if(_0xaf59b6&&_0xaf59b6[_0x29db('0x72')]&&_0xaf59b6[_0x29db('0x72')]!=='none'){logger[_0x29db('0x2c')](_0x29db('0x73'),_0x29db('0x5e'));_0x532a9a[_0x29db('0x5f')]=util['format'](_0x29db('0x60'),_0x623e58[_0x29db('0x5a')],_0x532a9a[_0x29db('0x61')],md5(_0x532a9a['uniqueid']));}return getConnection(_0x623e58)[_0x29db('0x2f')](function(_0x56b966){_0x50ad81=_0x56b966;return getUser(_0x623e58,_0x39c0ee[_0x29db('0xf')],_0x50ad81);})[_0x29db('0x2f')](function(_0x3623d5){_0x427b5f=_0x3623d5;logger[_0x29db('0x2c')](_0x29db('0x62'),_0x427b5f['id']);return getEndUser(_0x623e58,_0x532a9a[_0x29db('0x74')],_0x532a9a[_0x29db('0x75')],_0x50ad81);})['then'](function(_0x25abd7){_0x5d78a4=_0x25abd7;logger[_0x29db('0x2c')](_0x29db('0x65'),_0x5d78a4['id']);return getTicket(_0x623e58,_0x427b5f,_0x5d78a4,_0x5936cc,_0x532a9a,_0x5936cc['Fields'],_0x50ad81,_0x29db('0x76'));})[_0x29db('0x2f')](function(_0x459991){_0x35f157=_0x459991;logger[_0x29db('0x2c')]('Ticket\x20created!');logger[_0x29db('0x2c')](_0x29db('0x77'),_0x35f157['id']);return setRelationship(_0x50ad81,_0x427b5f,_0x35f157,_0x29db('0x68'));})[_0x29db('0x2f')](function(){return setRelationship(_0x50ad81,_0x5d78a4,_0x35f157,_0x29db('0x78'));})['then'](function(){return getServerInfo(_0x50ad81);})[_0x29db('0x2f')](function(_0x3b0b2b){var _0xaa8a5e=parseInt(_0x3b0b2b['version'][_0x29db('0x79')](0x0));var _0x6c5591=util[_0x29db('0x26')](_0x29db('0x6a'),_0x623e58['remoteUri'],_0x35f157['id']);if(_0xaa8a5e>0x6){_0x6c5591=util[_0x29db('0x26')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x623e58[_0x29db('0x58')],_0x35f157['id']);}logger['info'](_0x29db('0x73'),_0x29db('0x6d'));emit(util[_0x29db('0x26')](_0x29db('0x6e'),_0x39c0ee[_0x29db('0xf')]),_0x29db('0x6f'),{'uri':_0x6c5591});})[_0x29db('0x70')](function(_0x1e2dfb){logger[_0x29db('0x71')]('[OUTBOUND]',JSON['stringify'](_0x1e2dfb));});};exports[_0x29db('0x7a')]=function(_0x25e632,_0x51d32f,_0x326eab,_0x640458,_0x251467,_0x112668){var _0x3560cc,_0x1addd7,_0xcc2ec6,_0x396088;_0x112668['remoteUri']=intUtil[_0x29db('0x59')](_0x112668[_0x29db('0x58')]);_0x112668[_0x29db('0x5a')]=intUtil[_0x29db('0x59')](_0x112668[_0x29db('0x5a')]);def[_0x29db('0x5b')]=util['format'](_0x29db('0x5c'),_0x112668[_0x29db('0x58')]);if(_0x251467&&_0x251467[_0x29db('0x5d')]){logger['info']('['+_0x51d32f['lastevent'][_0x29db('0x7b')]()+']','Recording\x20is\x20enabled!');_0x51d32f['recordingURL']=util[_0x29db('0x26')](_0x29db('0x60'),_0x112668[_0x29db('0x5a')],_0x51d32f['uniqueid'],md5(_0x51d32f[_0x29db('0x61')]));}else{_0x51d32f[_0x29db('0x5f')]='';}return getConnection(_0x112668)['then'](function(_0xb8692d){_0x396088=_0xb8692d;if(!_[_0x29db('0x2b')](_0x640458)){return getUser(_0x112668,_0x640458[_0x29db('0xf')],_0x396088);}else{return getUser(_0x112668,null,_0x396088);}})[_0x29db('0x2f')](function(_0xba93f0){_0x3560cc=_0xba93f0;logger[_0x29db('0x2c')]('The\x20User\x20ID\x20is:',_0x3560cc['id']);return getEndUser(_0x112668,_0x51d32f[_0x29db('0x63')],_0x51d32f['calleridnum'],_0x396088);})[_0x29db('0x2f')](function(_0x3f6400){_0x1addd7=_0x3f6400;logger[_0x29db('0x2c')]('The\x20Enduser\x20ID\x20is:',_0x1addd7['id']);return getTicket(_0x112668,_0x3560cc,_0x1addd7,_0x326eab,_0x51d32f,_0x326eab['Fields'],_0x396088,_0x29db('0x66'));})[_0x29db('0x2f')](function(_0x191c77){_0xcc2ec6=_0x191c77;logger['info'](_0x29db('0x67'));logger[_0x29db('0x2c')](_0x29db('0x77'),_0xcc2ec6['id']);return setRelationship(_0x396088,_0x3560cc,_0xcc2ec6,_0x29db('0x68'));})[_0x29db('0x2f')](function(){return setRelationship(_0x396088,_0x1addd7,_0xcc2ec6,'contacts');})[_0x29db('0x2f')](function(){return getServerInfo(_0x396088);})[_0x29db('0x70')](function(_0x20ecc0){logger[_0x29db('0x71')]('['+_0x51d32f[_0x29db('0x7c')][_0x29db('0x7b')]()+']',JSON[_0x29db('0x24')](_0x20ecc0));});};
\ No newline at end of file
index 1e617d6..44dc4a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcbff=['lodash','util','getString','length','sortBy','type','content','variable','variableName','push','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','string','key','format','%s:\x20%s','join','stripTrailingSlash','substring','lastIndexOf','validateEmail','test'];(function(_0x5d2685,_0x111270){var _0x1e3632=function(_0x484aeb){while(--_0x484aeb){_0x5d2685['push'](_0x5d2685['shift']());}};_0x1e3632(++_0x111270);}(_0xcbff,0x1b0));var _0xfcbf=function(_0x6b83b1,_0x4b3392){_0x6b83b1=_0x6b83b1-0x0;var _0x30cb37=_0xcbff[_0x6b83b1];return _0x30cb37;};'use strict';var _=require(_0xfcbf('0x0'));var util=require(_0xfcbf('0x1'));exports[_0xfcbf('0x2')]=function(_0x460df5,_0x178b46,_0x17c55f){var _0x416572=[];if(_0x460df5[_0xfcbf('0x3')]>0x0){var _0x358cc4=_[_0xfcbf('0x4')](_0x460df5,['id']);for(var _0x38ed29=0x0;_0x38ed29<_0x358cc4[_0xfcbf('0x3')];_0x38ed29++){var _0x3f9359=_0x358cc4[_0x38ed29];if(_0x3f9359[_0xfcbf('0x5')]==='string'){_0x416572['push'](_0x3f9359[_0xfcbf('0x6')]);}else if(_0x3f9359['type']===_0xfcbf('0x7')&&_0x3f9359[_0xfcbf('0x8')]){_0x178b46[_0x3f9359[_0xfcbf('0x8')]]&&_0x416572[_0xfcbf('0x9')](_0x178b46[_0x3f9359[_0xfcbf('0x8')]][_0xfcbf('0xa')]());}else if(_0x3f9359[_0xfcbf('0x5')]===_0xfcbf('0xb')&&_0x3f9359[_0xfcbf('0xc')]&&_0x3f9359[_0xfcbf('0xc')]['name']){_0x178b46[_0x3f9359[_0xfcbf('0xc')][_0xfcbf('0xd')][_0xfcbf('0xe')]()]&&_0x416572[_0xfcbf('0x9')](_0x178b46[_0x3f9359[_0xfcbf('0xc')][_0xfcbf('0xd')][_0xfcbf('0xe')]()][_0xfcbf('0xa')]());}else if(_0x3f9359[_0xfcbf('0x5')]===_0xfcbf('0xf')){if(_0x3f9359[_0xfcbf('0x10')]===_0xfcbf('0x11')&&_0x3f9359[_0xfcbf('0x12')]){_0x416572[_0xfcbf('0x9')](util[_0xfcbf('0x13')]('%s:\x20%s',_0x3f9359[_0xfcbf('0x12')],_0x3f9359['keyContent']));}else if(_0x3f9359['keyType']===_0xfcbf('0x7')&&_0x3f9359[_0xfcbf('0x8')]&&_0x3f9359[_0xfcbf('0x12')]){_0x178b46[_0x3f9359[_0xfcbf('0x8')]]&&_0x416572['push'](util[_0xfcbf('0x13')](_0xfcbf('0x14'),_0x3f9359['key'],_0x178b46[_0x3f9359[_0xfcbf('0x8')]]));}else if(_0x3f9359[_0xfcbf('0x10')]===_0xfcbf('0xb')&&_0x3f9359[_0xfcbf('0xc')]&&_0x3f9359[_0xfcbf('0xc')][_0xfcbf('0xd')]&&_0x3f9359[_0xfcbf('0x12')]){_0x178b46[_0x3f9359['Variable'][_0xfcbf('0xd')]['toLowerCase']()]&&_0x416572[_0xfcbf('0x9')](util[_0xfcbf('0x13')](_0xfcbf('0x14'),_0x3f9359[_0xfcbf('0x12')],_0x178b46[_0x3f9359['Variable'][_0xfcbf('0xd')][_0xfcbf('0xe')]()]));}}}}return _0x416572[_0xfcbf('0x15')](_0x17c55f);};exports[_0xfcbf('0x16')]=function(_0x8d6b83){var _0x45b682=_0x8d6b83['slice'](-0x1);if(_0x45b682==='/'){_0x8d6b83=_0x8d6b83[_0xfcbf('0x17')](0x0,_0x8d6b83[_0xfcbf('0x18')](_0x45b682));}return _0x8d6b83;};exports[_0xfcbf('0x19')]=function(_0x5ef1a4){if(!_['isNil'](_0x5ef1a4)&&_0x5ef1a4!==''){var _0x167544=/^(([^<>()\[\]\\.,;:\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 _0x167544[_0xfcbf('0x1a')](String(_0x5ef1a4)[_0xfcbf('0xe')]());}else{return![];}};
\ No newline at end of file
+var _0x3fac=['key','format','%s:\x20%s','variable','customVariable','toLowerCase','join','stripTrailingSlash','substring','validateEmail','isNil','test','util','getString','sortBy','length','type','push','content','variableName','toString','Variable','name','keyType'];(function(_0x24e2a3,_0x534875){var _0x3e82f4=function(_0x48a8ee){while(--_0x48a8ee){_0x24e2a3['push'](_0x24e2a3['shift']());}};_0x3e82f4(++_0x534875);}(_0x3fac,0xe4));var _0xc3fa=function(_0x20739f,_0x8aa37a){_0x20739f=_0x20739f-0x0;var _0x48068f=_0x3fac[_0x20739f];return _0x48068f;};'use strict';var _=require('lodash');var util=require(_0xc3fa('0x0'));exports[_0xc3fa('0x1')]=function(_0x44e9bf,_0x2b59f8,_0x1efa97){var _0x50021d=[];if(_0x44e9bf['length']>0x0){var _0x504208=_[_0xc3fa('0x2')](_0x44e9bf,['id']);for(var _0x3eecbb=0x0;_0x3eecbb<_0x504208[_0xc3fa('0x3')];_0x3eecbb++){var _0x5a95a2=_0x504208[_0x3eecbb];if(_0x5a95a2[_0xc3fa('0x4')]==='string'){_0x50021d[_0xc3fa('0x5')](_0x5a95a2[_0xc3fa('0x6')]);}else if(_0x5a95a2[_0xc3fa('0x4')]==='variable'&&_0x5a95a2[_0xc3fa('0x7')]){_0x2b59f8[_0x5a95a2[_0xc3fa('0x7')]]&&_0x50021d[_0xc3fa('0x5')](_0x2b59f8[_0x5a95a2['variableName']][_0xc3fa('0x8')]());}else if(_0x5a95a2[_0xc3fa('0x4')]==='customVariable'&&_0x5a95a2[_0xc3fa('0x9')]&&_0x5a95a2[_0xc3fa('0x9')][_0xc3fa('0xa')]){_0x2b59f8[_0x5a95a2[_0xc3fa('0x9')][_0xc3fa('0xa')]['toLowerCase']()]&&_0x50021d[_0xc3fa('0x5')](_0x2b59f8[_0x5a95a2[_0xc3fa('0x9')]['name']['toLowerCase']()][_0xc3fa('0x8')]());}else if(_0x5a95a2[_0xc3fa('0x4')]==='keyValue'){if(_0x5a95a2[_0xc3fa('0xb')]==='string'&&_0x5a95a2[_0xc3fa('0xc')]){_0x50021d[_0xc3fa('0x5')](util[_0xc3fa('0xd')](_0xc3fa('0xe'),_0x5a95a2[_0xc3fa('0xc')],_0x5a95a2['keyContent']));}else if(_0x5a95a2[_0xc3fa('0xb')]===_0xc3fa('0xf')&&_0x5a95a2[_0xc3fa('0x7')]&&_0x5a95a2[_0xc3fa('0xc')]){_0x2b59f8[_0x5a95a2[_0xc3fa('0x7')]]&&_0x50021d[_0xc3fa('0x5')](util['format'](_0xc3fa('0xe'),_0x5a95a2[_0xc3fa('0xc')],_0x2b59f8[_0x5a95a2['variableName']]));}else if(_0x5a95a2[_0xc3fa('0xb')]===_0xc3fa('0x10')&&_0x5a95a2['Variable']&&_0x5a95a2['Variable'][_0xc3fa('0xa')]&&_0x5a95a2[_0xc3fa('0xc')]){_0x2b59f8[_0x5a95a2[_0xc3fa('0x9')][_0xc3fa('0xa')][_0xc3fa('0x11')]()]&&_0x50021d[_0xc3fa('0x5')](util['format'](_0xc3fa('0xe'),_0x5a95a2[_0xc3fa('0xc')],_0x2b59f8[_0x5a95a2[_0xc3fa('0x9')][_0xc3fa('0xa')][_0xc3fa('0x11')]()]));}}}}return _0x50021d[_0xc3fa('0x12')](_0x1efa97);};exports[_0xc3fa('0x13')]=function(_0x4bb1df){var _0x1c7bda=_0x4bb1df['slice'](-0x1);if(_0x1c7bda==='/'){_0x4bb1df=_0x4bb1df[_0xc3fa('0x14')](0x0,_0x4bb1df['lastIndexOf'](_0x1c7bda));}return _0x4bb1df;};exports[_0xc3fa('0x15')]=function(_0x55ea99){if(!_[_0xc3fa('0x16')](_0x55ea99)&&_0x55ea99!==''){var _0x4e1372=/^(([^<>()\[\]\\.,;:\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 _0x4e1372[_0xc3fa('0x17')](String(_0x55ea99)[_0xc3fa('0x11')]());}else{return![];}};
\ No newline at end of file
index df13f08..b9ee1f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});};
\ No newline at end of file
+var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});};
\ No newline at end of file
index d30b02e..c9ca6b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58b6=['localhost','application/json','info','Creating\x20new\x20ticket...','format','remoteUri','POST','merge','Tags','name','Subjects','Fields','Ticket\x20created!','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','then','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','end-user','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','Basic\x20%s','toString','base64','debug','[HTTP]','GET','includes','string','picklist','nameField','customField','toLowerCase','content','type','idField','custom_fields','push','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','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','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','calleridname','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','request-promise','util','ioredis','../../../../config/environment','zendesk','redis','defaults'];(function(_0x97dd72,_0x48a7fb){var _0x26b730=function(_0x5baf54){while(--_0x5baf54){_0x97dd72['push'](_0x97dd72['shift']());}};_0x26b730(++_0x48a7fb);}(_0x58b6,0x1a1));var _0x658b=function(_0x1f7241,_0x165860){_0x1f7241=_0x1f7241-0x0;var _0x537c36=_0x58b6[_0x1f7241];return _0x537c36;};'use strict';var _=require('lodash');var rp=require(_0x658b('0x0'));var md5=require('md5');var util=require(_0x658b('0x1'));var Redis=require(_0x658b('0x2'));var intUtil=require('./util');var config=require(_0x658b('0x3'));var logger=require('../../../../config/logger')(_0x658b('0x4'));config[_0x658b('0x5')]=_[_0x658b('0x6')](config[_0x658b('0x5')],{'host':_0x658b('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0xb48515,_0x3e5c15,_0xec39e2){io['to'](_0xb48515)['emit'](_0x3e5c15,_0xec39e2);}var headers={'Content-Type':_0x658b('0x8'),'Accept':'application/json'};function getTicket(_0x12e650,_0x405eea,_0x9abdcc,_0x3541db,_0x51d4f1){logger[_0x658b('0x9')](_0x658b('0xa'));return request({'uri':util[_0x658b('0xb')]('%s/tickets.json',_0x12e650[_0x658b('0xc')]),'method':_0x658b('0xd'),'body':{'ticket':_[_0x658b('0xe')]({'requester_id':_0x9abdcc['id'],'submitter_id':_0x405eea?_0x405eea['id']:undefined,'assignee_id':_0x405eea?_0x405eea['id']:undefined,'tags':getTags(_0x3541db[_0x658b('0xf')],_0x658b('0x10')),'subject':intUtil['getString'](_0x3541db[_0x658b('0x11')],_0x51d4f1,'\x20'),'description':intUtil['getString'](_0x3541db['Descriptions'],_0x51d4f1,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x3541db['Descriptions'],_0x51d4f1,'\x0a')}},getCustomFields(_0x3541db[_0x658b('0x12')],_0x51d4f1))}})['then'](function(_0x36c989){logger[_0x658b('0x9')](_0x658b('0x13'));return _0x36c989['ticket'];});}function getUser(_0x19e60a,_0x3149d1){if(intUtil['validateEmail'](_0x3149d1)){logger['info'](_0x658b('0x14'),_0x3149d1);return request({'uri':util[_0x658b('0xb')](_0x658b('0x15'),_0x19e60a['remoteUri']),'qs':{'query':util[_0x658b('0xb')](_0x658b('0x16'),_0x3149d1)}})['then'](function(_0x2bf1ae){if(_0x2bf1ae[_0x658b('0x17')]){logger['info'](_0x658b('0x18'));return _['find'](_0x2bf1ae[_0x658b('0x19')],{'email':_0x3149d1,'role':_0x658b('0x1a')});}else{logger['info'](_0x658b('0x1b'));return request({'uri':util[_0x658b('0xb')](_0x658b('0x1c'),_0x19e60a[_0x658b('0xc')])})[_0x658b('0x1d')](function(_0x2aed58){logger[_0x658b('0x9')](_0x658b('0x1e'));return _0x2aed58[_0x658b('0x1f')];});}});}else{logger[_0x658b('0x9')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x658b('0xb')](_0x658b('0x1c'),_0x19e60a['remoteUri'])})[_0x658b('0x1d')](function(_0x44c72a){logger[_0x658b('0x9')](_0x658b('0x1e'));return _0x44c72a[_0x658b('0x1f')];});}}function getEndUser(_0x4510cf,_0x2c1397,_0x36bd44){logger['info'](_0x658b('0x20'),_0x36bd44);return request({'uri':util[_0x658b('0xb')](_0x658b('0x15'),_0x4510cf[_0x658b('0xc')]),'qs':{'query':util[_0x658b('0xb')](_0x658b('0x21'),_0x36bd44)}})[_0x658b('0x1d')](function(_0x42cacf){var _0xc5c7d4;if(_0x42cacf[_0x658b('0x19')][_0x658b('0x22')]){_0x42cacf[_0x658b('0x19')]=_['filter'](_0x42cacf[_0x658b('0x19')],{'suspended':![],'role':'end-user'});if(_0x42cacf[_0x658b('0x19')][_0x658b('0x22')]){_0xc5c7d4=_[_0x658b('0x23')](_0x42cacf[_0x658b('0x19')]);}}if(_0xc5c7d4){logger[_0x658b('0x9')](_0x658b('0x24'));return _0xc5c7d4;}else{logger[_0x658b('0x9')](_0x658b('0x25'));return request({'uri':util['format'](_0x658b('0x26'),_0x4510cf[_0x658b('0xc')]),'method':_0x658b('0xd'),'body':{'user':{'role':_0x658b('0x27'),'name':util['format'](_0x658b('0x28'),_0x2c1397||_0x36bd44),'phone':_0x36bd44}}})['then'](function(_0x2fc1c8){logger[_0x658b('0x9')](_0x658b('0x29'));return _0x2fc1c8['user'];});}});}function getAuth(_0x350c4b){var _0x5b29e4;if(_0x350c4b[_0x658b('0x2a')]===_0x658b('0x2b')){_0x5b29e4=util[_0x658b('0xb')](_0x658b('0x2c'),_0x350c4b[_0x658b('0x2d')],_0x350c4b['password']);}else if(_0x350c4b[_0x658b('0x2a')]===_0x658b('0x2e')){_0x5b29e4=util[_0x658b('0xb')]('%s/token:%s',_0x350c4b[_0x658b('0x2d')],_0x350c4b[_0x658b('0x2e')]);}return util['format'](_0x658b('0x2f'),new Buffer(_0x5b29e4)[_0x658b('0x30')](_0x658b('0x31')));}function request(_0x1f8506){logger[_0x658b('0x32')](_0x658b('0x33'),JSON['stringify'](_0x1f8506));return rp(_[_0x658b('0x6')](_0x1f8506,{'method':_0x658b('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x173e15,_0x17cab9){var _0x4f97b7=[];if(_0x173e15&&_0x173e15[_0x658b('0x22')]>0x0){_0x4f97b7=_['map'](_0x173e15,_0x17cab9);}return _0x4f97b7;}function getCustomFields(_0x233756,_0xfa5efa){var _0x31f2e5=[];var _0x3a44a1={'custom_fields':[]};if(_0x233756[_0x658b('0x22')]>0x0){_['forEach'](_0x233756,function(_0x580e6a){if(_[_0x658b('0x35')]([_0x658b('0x36'),_0x658b('0x37')],_0x580e6a['type'])&&_0x580e6a[_0x658b('0x38')]&&!_0x580e6a[_0x658b('0x39')]){_0x3a44a1[_0x580e6a[_0x658b('0x38')][_0x658b('0x3a')]()]=_0x580e6a[_0x658b('0x3b')]['toString']();}else if(_[_0x658b('0x35')]([_0x658b('0x36'),'picklist'],_0x580e6a[_0x658b('0x3c')])&&_0x580e6a[_0x658b('0x3d')]&&_0x580e6a[_0x658b('0x39')]){_0x3a44a1[_0x658b('0x3e')][_0x658b('0x3f')]({'id':_0x580e6a[_0x658b('0x3d')],'value':_0x580e6a[_0x658b('0x3b')]['toString']()});}else if(_0x580e6a['type']==='variable'&&_0x580e6a[_0x658b('0x40')]&&_0x580e6a[_0x658b('0x3d')]&&_0x580e6a[_0x658b('0x39')]){_0xfa5efa[_0x580e6a[_0x658b('0x40')]]&&_0x3a44a1[_0x658b('0x3e')][_0x658b('0x3f')]({'id':_0x580e6a[_0x658b('0x3d')],'value':_0xfa5efa[_0x580e6a[_0x658b('0x40')]][_0x658b('0x30')]()});}else if(_0x580e6a[_0x658b('0x3c')]===_0x658b('0x41')&&_0x580e6a['Variable']&&_0x580e6a[_0x658b('0x42')][_0x658b('0x10')]&&_0x580e6a[_0x658b('0x3d')]&&_0x580e6a[_0x658b('0x39')]){_0xfa5efa[_0x580e6a[_0x658b('0x42')][_0x658b('0x10')][_0x658b('0x3a')]()]&&_0x3a44a1[_0x658b('0x3e')][_0x658b('0x3f')]({'id':_0x580e6a[_0x658b('0x3d')],'value':_0xfa5efa[_0x580e6a[_0x658b('0x42')][_0x658b('0x10')][_0x658b('0x3a')]()]['toString']()});}});}return _0x3a44a1;}exports[_0x658b('0x43')]=function(_0x1c7a97,_0x4ef882,_0x55d69a,_0x11bce9,_0x2d5ac4,_0x2c864f){var _0x3e9a92,_0x5b4298;_0x2c864f[_0x658b('0xc')]=intUtil[_0x658b('0x44')](_0x2c864f[_0x658b('0xc')]);_0x2c864f[_0x658b('0x45')]=intUtil[_0x658b('0x44')](_0x2c864f[_0x658b('0x45')]);if(_0x2d5ac4&&_0x2d5ac4['monitor_format']){logger[_0x658b('0x9')]('[QUEUE]',_0x658b('0x46'));_0x4ef882[_0x658b('0x47')]=util[_0x658b('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2c864f[_0x658b('0x45')],_0x4ef882['uniqueid'],md5(_0x4ef882[_0x658b('0x48')]));}else{_0x4ef882[_0x658b('0x47')]='';}headers[_0x658b('0x49')]=getAuth(_0x2c864f);return getUser(_0x2c864f,_0x11bce9[_0x658b('0x4a')])[_0x658b('0x1d')](function(_0x409a99){_0x3e9a92=_0x409a99;logger[_0x658b('0x9')](_0x658b('0x4b'),_0x3e9a92['id']);return getEndUser(_0x2c864f,_0x4ef882['calleridname'],_0x4ef882[_0x658b('0x4c')]);})[_0x658b('0x1d')](function(_0x2606d5){_0x5b4298=_0x2606d5;logger[_0x658b('0x9')](_0x658b('0x4d'),_0x5b4298['id']);return getTicket(_0x2c864f,_0x3e9a92,_0x5b4298,_0x55d69a,_0x4ef882);})[_0x658b('0x1d')](function(_0x1a5e21){if(_0x1a5e21){logger[_0x658b('0x9')](_0x658b('0x4e'),_0x1a5e21['id']);switch(_0x2c864f[_0x658b('0x3c')]){case _0x658b('0x4f'):logger['info'](_0x658b('0x50'),_0x658b('0x51'));return request({'uri':util[_0x658b('0xb')](_0x658b('0x52'),_0x2c864f[_0x658b('0xc')],_0x3e9a92['id'],_0x1a5e21['id']),'method':_0x658b('0xd')});case _0x658b('0x53'):logger[_0x658b('0x9')](_0x658b('0x50'),_0x658b('0x54'));emit(util[_0x658b('0xb')](_0x658b('0x55'),_0x11bce9[_0x658b('0x10')]),_0x658b('0x56'),{'uri':util['format'](_0x658b('0x57'),_0x2c864f[_0x658b('0xc')][_0x658b('0x58')](_0x658b('0x59'),''),_0x1a5e21['id'])});break;default:logger[_0x658b('0x5a')]('[QUEUE]',_0x658b('0x5b'));}}})[_0x658b('0x5c')](function(_0x2ae90d){logger[_0x658b('0x5a')](_0x658b('0x5d'),util[_0x658b('0x5e')](_0x2ae90d,{'showHidden':!![],'depth':null}));});};exports[_0x658b('0x5f')]=function(_0xfa040e,_0x2e2771,_0x174280,_0x4b981e,_0x5ac139,_0x4afdff,_0x150f90){var _0x47d403,_0x205d18;_0x4afdff['remoteUri']=intUtil['stripTrailingSlash'](_0x4afdff[_0x658b('0xc')]);_0x4afdff[_0x658b('0x45')]=intUtil['stripTrailingSlash'](_0x4afdff[_0x658b('0x45')]);if(_0x150f90&&_0x150f90['recordingFormat']&&_0x150f90[_0x658b('0x60')]!==_0x658b('0x61')){logger[_0x658b('0x9')](_0x658b('0x62'),_0x658b('0x46'));_0x2e2771[_0x658b('0x47')]=util[_0x658b('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4afdff[_0x658b('0x45')],_0x2e2771[_0x658b('0x48')],md5(_0x2e2771[_0x658b('0x48')]));}headers[_0x658b('0x49')]=getAuth(_0x4afdff);return getUser(_0x4afdff,_0x4b981e[_0x658b('0x4a')])[_0x658b('0x1d')](function(_0x4da2b0){_0x47d403=_0x4da2b0;logger['info'](_0x658b('0x4b'),_0x47d403['id']);return getEndUser(_0x4afdff,_0x2e2771[_0x658b('0x63')],_0x2e2771['destcalleridnum']);})[_0x658b('0x1d')](function(_0x53b9d3){_0x205d18=_0x53b9d3;logger[_0x658b('0x9')](_0x658b('0x4d'),_0x205d18['id']);return getTicket(_0x4afdff,_0x47d403,_0x205d18,_0x174280,_0x2e2771);})[_0x658b('0x1d')](function(_0x12116a){if(_0x12116a){logger[_0x658b('0x9')](_0x658b('0x4e'),_0x12116a['id']);switch(_0x4afdff[_0x658b('0x3c')]){case _0x658b('0x4f'):logger[_0x658b('0x9')](_0x658b('0x62'),_0x658b('0x51'));return request({'uri':util[_0x658b('0xb')](_0x658b('0x52'),_0x4afdff[_0x658b('0xc')],_0x47d403['id'],_0x12116a['id']),'method':'POST'});case _0x658b('0x53'):logger['info'](_0x658b('0x62'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x658b('0xb')]('user:%s',_0x4b981e[_0x658b('0x10')]),'trigger:browser:url',{'uri':util[_0x658b('0xb')](_0x658b('0x57'),_0x4afdff[_0x658b('0xc')][_0x658b('0x58')]('/api/v2',''),_0x12116a['id'])});break;default:logger[_0x658b('0x5a')](_0x658b('0x62'),_0x658b('0x5b'));}}})['catch'](function(_0x27c378){logger[_0x658b('0x5a')](_0x658b('0x64'),util[_0x658b('0x5e')](_0x27c378,{'showHidden':!![],'depth':null}));});};exports[_0x658b('0x65')]=function(_0x499ebe,_0x27e35d,_0x4b9c9e,_0x35574f,_0x32e847,_0x3e6b40){var _0x2c403a,_0x2e6526;_0x3e6b40[_0x658b('0xc')]=intUtil[_0x658b('0x44')](_0x3e6b40[_0x658b('0xc')]);_0x3e6b40[_0x658b('0x45')]=intUtil[_0x658b('0x44')](_0x3e6b40[_0x658b('0x45')]);if(_0x32e847&&_0x32e847['monitor_format']){logger['info']('['+_0x27e35d['lastevent']['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x27e35d['recordingURL']=util[_0x658b('0xb')](_0x658b('0x66'),_0x3e6b40[_0x658b('0x45')],_0x27e35d['uniqueid'],md5(_0x27e35d['uniqueid']));}else{_0x27e35d['recordingURL']='';}headers['Authorization']=getAuth(_0x3e6b40);return getUser(_0x3e6b40)[_0x658b('0x1d')](function(_0x3ca75e){_0x2c403a=_0x3ca75e;logger[_0x658b('0x9')]('The\x20User\x20ID\x20is:',_0x2c403a['id']);return getEndUser(_0x3e6b40,_0x27e35d[_0x658b('0x67')],_0x27e35d['calleridnum']);})[_0x658b('0x1d')](function(_0x3c7c3b){_0x2e6526=_0x3c7c3b;logger[_0x658b('0x9')](_0x658b('0x4d'),_0x2e6526['id']);return getTicket(_0x3e6b40,_0x2c403a,_0x2e6526,_0x4b9c9e,_0x27e35d);})[_0x658b('0x1d')](function(_0x57cf9c){if(_0x57cf9c){logger['info'](_0x658b('0x4e'),_0x57cf9c['id']);}})[_0x658b('0x5c')](function(_0x484e8d){logger[_0x658b('0x5a')]('['+_0x27e35d['lastevent'][_0x658b('0x68')]()+']'+_0x658b('0x69'),util[_0x658b('0x5e')](_0x484e8d,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x687f=['password','%s:%s','username','token','Basic\x20%s','base64','[HTTP]','defaults','GET','map','string','type','nameField','toLowerCase','content','toString','includes','picklist','customField','variableName','idField','custom_fields','Variable','push','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','recordingURL','Authorization','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','inspect','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','email','The\x20User\x20ID\x20is:','destcalleridname','%s/agent/tickets/%s','replace','/api/v2','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','util','./util','../../../../config/logger','zendesk','redis','localhost','socket.io-emitter','emit','application/json','format','%s/tickets.json','Tags','name','getString','Descriptions','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','then','count','info','Agent\x20found!','agent','%s/users/me.json','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','results','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','authType'];(function(_0x48d6a3,_0x37c848){var _0x38bfa0=function(_0x3fba2e){while(--_0x3fba2e){_0x48d6a3['push'](_0x48d6a3['shift']());}};_0x38bfa0(++_0x37c848);}(_0x687f,0x1d9));var _0xf687=function(_0x473738,_0x15ea31){_0x473738=_0x473738-0x0;var _0x1df4ae=_0x687f[_0x473738];return _0x1df4ae;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require('md5');var util=require(_0xf687('0x0'));var Redis=require('ioredis');var intUtil=require(_0xf687('0x1'));var config=require('../../../../config/environment');var logger=require(_0xf687('0x2'))(_0xf687('0x3'));config['redis']=_['defaults'](config[_0xf687('0x4')],{'host':_0xf687('0x5'),'port':0x18eb});var io=require(_0xf687('0x6'))(new Redis(config[_0xf687('0x4')]));function emit(_0x255bce,_0x3485f8,_0x29ad67){io['to'](_0x255bce)[_0xf687('0x7')](_0x3485f8,_0x29ad67);}var headers={'Content-Type':_0xf687('0x8'),'Accept':_0xf687('0x8')};function getTicket(_0x31ecc0,_0x129a2f,_0x12aaed,_0x2767e3,_0x38687b){logger['info']('Creating\x20new\x20ticket...');return request({'uri':util[_0xf687('0x9')](_0xf687('0xa'),_0x31ecc0['remoteUri']),'method':'POST','body':{'ticket':_['merge']({'requester_id':_0x12aaed['id'],'submitter_id':_0x129a2f?_0x129a2f['id']:undefined,'assignee_id':_0x129a2f?_0x129a2f['id']:undefined,'tags':getTags(_0x2767e3[_0xf687('0xb')],_0xf687('0xc')),'subject':intUtil['getString'](_0x2767e3['Subjects'],_0x38687b,'\x20'),'description':intUtil[_0xf687('0xd')](_0x2767e3[_0xf687('0xe')],_0x38687b,'\x0a'),'comment':{'public':![],'body':intUtil[_0xf687('0xd')](_0x2767e3[_0xf687('0xe')],_0x38687b,'\x0a')}},getCustomFields(_0x2767e3['Fields'],_0x38687b))}})['then'](function(_0x237dd6){logger['info'](_0xf687('0xf'));return _0x237dd6[_0xf687('0x10')];});}function getUser(_0x240238,_0x4f3f0d){if(intUtil[_0xf687('0x11')](_0x4f3f0d)){logger['info'](_0xf687('0x12'),_0x4f3f0d);return request({'uri':util[_0xf687('0x9')](_0xf687('0x13'),_0x240238[_0xf687('0x14')]),'qs':{'query':util[_0xf687('0x9')](_0xf687('0x15'),_0x4f3f0d)}})[_0xf687('0x16')](function(_0x3f6d7e){if(_0x3f6d7e[_0xf687('0x17')]){logger[_0xf687('0x18')](_0xf687('0x19'));return _['find'](_0x3f6d7e['results'],{'email':_0x4f3f0d,'role':_0xf687('0x1a')});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xf687('0x1b'),_0x240238[_0xf687('0x14')])})[_0xf687('0x16')](function(_0xdd5a57){logger[_0xf687('0x18')]('Admin\x20account\x20selected.');return _0xdd5a57['user'];});}});}else{logger[_0xf687('0x18')](_0xf687('0x1c'));return request({'uri':util[_0xf687('0x9')]('%s/users/me.json',_0x240238['remoteUri'])})[_0xf687('0x16')](function(_0x1480a3){logger[_0xf687('0x18')]('Admin\x20account\x20selected.');return _0x1480a3[_0xf687('0x1d')];});}}function getEndUser(_0x56b553,_0x2fdc5c,_0x210c31){logger['info'](_0xf687('0x1e'),_0x210c31);return request({'uri':util[_0xf687('0x9')](_0xf687('0x13'),_0x56b553['remoteUri']),'qs':{'query':util['format'](_0xf687('0x1f'),_0x210c31)}})['then'](function(_0x481695){var _0x4a9fa6;if(_0x481695[_0xf687('0x20')][_0xf687('0x21')]){_0x481695[_0xf687('0x20')]=_[_0xf687('0x22')](_0x481695[_0xf687('0x20')],{'suspended':![],'role':_0xf687('0x23')});if(_0x481695['results'][_0xf687('0x21')]){_0x4a9fa6=_[_0xf687('0x24')](_0x481695[_0xf687('0x20')]);}}if(_0x4a9fa6){logger[_0xf687('0x18')](_0xf687('0x25'));return _0x4a9fa6;}else{logger[_0xf687('0x18')](_0xf687('0x26'));return request({'uri':util[_0xf687('0x9')](_0xf687('0x27'),_0x56b553['remoteUri']),'method':'POST','body':{'user':{'role':_0xf687('0x23'),'name':util[_0xf687('0x9')](_0xf687('0x28'),_0x2fdc5c||_0x210c31),'phone':_0x210c31}}})[_0xf687('0x16')](function(_0x381010){logger[_0xf687('0x18')]('Enduser\x20created.');return _0x381010[_0xf687('0x1d')];});}});}function getAuth(_0x433387){var _0x3e80db;if(_0x433387[_0xf687('0x29')]===_0xf687('0x2a')){_0x3e80db=util[_0xf687('0x9')](_0xf687('0x2b'),_0x433387[_0xf687('0x2c')],_0x433387[_0xf687('0x2a')]);}else if(_0x433387[_0xf687('0x29')]==='token'){_0x3e80db=util[_0xf687('0x9')]('%s/token:%s',_0x433387['username'],_0x433387[_0xf687('0x2d')]);}return util['format'](_0xf687('0x2e'),new Buffer(_0x3e80db)['toString'](_0xf687('0x2f')));}function request(_0x5351fd){logger['debug'](_0xf687('0x30'),JSON['stringify'](_0x5351fd));return rp(_[_0xf687('0x31')](_0x5351fd,{'method':_0xf687('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x6eba90,_0x53f919){var _0x24265b=[];if(_0x6eba90&&_0x6eba90['length']>0x0){_0x24265b=_[_0xf687('0x33')](_0x6eba90,_0x53f919);}return _0x24265b;}function getCustomFields(_0x353cc3,_0x36b71e){var _0x308895=[];var _0x25e79b={'custom_fields':[]};if(_0x353cc3[_0xf687('0x21')]>0x0){_['forEach'](_0x353cc3,function(_0x194bbd){if(_['includes']([_0xf687('0x34'),'picklist'],_0x194bbd[_0xf687('0x35')])&&_0x194bbd[_0xf687('0x36')]&&!_0x194bbd['customField']){_0x25e79b[_0x194bbd[_0xf687('0x36')][_0xf687('0x37')]()]=_0x194bbd[_0xf687('0x38')][_0xf687('0x39')]();}else if(_[_0xf687('0x3a')]([_0xf687('0x34'),_0xf687('0x3b')],_0x194bbd['type'])&&_0x194bbd['idField']&&_0x194bbd[_0xf687('0x3c')]){_0x25e79b['custom_fields']['push']({'id':_0x194bbd['idField'],'value':_0x194bbd[_0xf687('0x38')]['toString']()});}else if(_0x194bbd['type']==='variable'&&_0x194bbd[_0xf687('0x3d')]&&_0x194bbd[_0xf687('0x3e')]&&_0x194bbd['customField']){_0x36b71e[_0x194bbd['variableName']]&&_0x25e79b[_0xf687('0x3f')]['push']({'id':_0x194bbd[_0xf687('0x3e')],'value':_0x36b71e[_0x194bbd[_0xf687('0x3d')]]['toString']()});}else if(_0x194bbd[_0xf687('0x35')]==='customVariable'&&_0x194bbd[_0xf687('0x40')]&&_0x194bbd[_0xf687('0x40')][_0xf687('0xc')]&&_0x194bbd[_0xf687('0x3e')]&&_0x194bbd['customField']){_0x36b71e[_0x194bbd['Variable'][_0xf687('0xc')][_0xf687('0x37')]()]&&_0x25e79b['custom_fields'][_0xf687('0x41')]({'id':_0x194bbd[_0xf687('0x3e')],'value':_0x36b71e[_0x194bbd['Variable'][_0xf687('0xc')]['toLowerCase']()][_0xf687('0x39')]()});}});}return _0x25e79b;}exports['queue']=function(_0x1df925,_0x475fd4,_0x68b04b,_0x416da0,_0x5f0f0f,_0x2e33a4){var _0x567b8b,_0x4e7e06;_0x2e33a4[_0xf687('0x14')]=intUtil[_0xf687('0x42')](_0x2e33a4['remoteUri']);_0x2e33a4[_0xf687('0x43')]=intUtil['stripTrailingSlash'](_0x2e33a4[_0xf687('0x43')]);if(_0x5f0f0f&&_0x5f0f0f[_0xf687('0x44')]){logger[_0xf687('0x18')](_0xf687('0x45'),_0xf687('0x46'));_0x475fd4['recordingURL']=util[_0xf687('0x9')](_0xf687('0x47'),_0x2e33a4[_0xf687('0x43')],_0x475fd4['uniqueid'],md5(_0x475fd4['uniqueid']));}else{_0x475fd4[_0xf687('0x48')]='';}headers[_0xf687('0x49')]=getAuth(_0x2e33a4);return getUser(_0x2e33a4,_0x416da0['email'])[_0xf687('0x16')](function(_0x14af81){_0x567b8b=_0x14af81;logger[_0xf687('0x18')]('The\x20User\x20ID\x20is:',_0x567b8b['id']);return getEndUser(_0x2e33a4,_0x475fd4[_0xf687('0x4a')],_0x475fd4[_0xf687('0x4b')]);})[_0xf687('0x16')](function(_0x1b7480){_0x4e7e06=_0x1b7480;logger['info'](_0xf687('0x4c'),_0x4e7e06['id']);return getTicket(_0x2e33a4,_0x567b8b,_0x4e7e06,_0x68b04b,_0x475fd4);})[_0xf687('0x16')](function(_0x1bacef){if(_0x1bacef){logger[_0xf687('0x18')](_0xf687('0x4d'),_0x1bacef['id']);switch(_0x2e33a4[_0xf687('0x35')]){case _0xf687('0x4e'):logger['info'](_0xf687('0x45'),_0xf687('0x4f'));return request({'uri':util[_0xf687('0x9')](_0xf687('0x50'),_0x2e33a4['remoteUri'],_0x567b8b['id'],_0x1bacef['id']),'method':'POST'});case _0xf687('0x51'):logger['info'](_0xf687('0x45'),_0xf687('0x52'));emit(util[_0xf687('0x9')](_0xf687('0x53'),_0x416da0[_0xf687('0xc')]),_0xf687('0x54'),{'uri':util[_0xf687('0x9')]('%s/agent/tickets/%s',_0x2e33a4[_0xf687('0x14')]['replace']('/api/v2',''),_0x1bacef['id'])});break;default:logger[_0xf687('0x55')](_0xf687('0x45'),_0xf687('0x56'));}}})[_0xf687('0x57')](function(_0x120030){logger['error']('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0xf687('0x58')](_0x120030,{'showHidden':!![],'depth':null}));});};exports[_0xf687('0x59')]=function(_0x529caa,_0x569d7c,_0x84dfe5,_0x356c4f,_0x2e1f06,_0x2c2bf8,_0x3e659f){var _0x1f1fb5,_0x56ed74;_0x2c2bf8[_0xf687('0x14')]=intUtil[_0xf687('0x42')](_0x2c2bf8[_0xf687('0x14')]);_0x2c2bf8[_0xf687('0x43')]=intUtil[_0xf687('0x42')](_0x2c2bf8[_0xf687('0x43')]);if(_0x3e659f&&_0x3e659f[_0xf687('0x5a')]&&_0x3e659f[_0xf687('0x5a')]!==_0xf687('0x5b')){logger[_0xf687('0x18')](_0xf687('0x5c'),'Recording\x20is\x20enabled!');_0x569d7c[_0xf687('0x48')]=util[_0xf687('0x9')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2c2bf8[_0xf687('0x43')],_0x569d7c['uniqueid'],md5(_0x569d7c[_0xf687('0x5d')]));}headers[_0xf687('0x49')]=getAuth(_0x2c2bf8);return getUser(_0x2c2bf8,_0x356c4f[_0xf687('0x5e')])[_0xf687('0x16')](function(_0x4a9396){_0x1f1fb5=_0x4a9396;logger[_0xf687('0x18')](_0xf687('0x5f'),_0x1f1fb5['id']);return getEndUser(_0x2c2bf8,_0x569d7c[_0xf687('0x60')],_0x569d7c['destcalleridnum']);})[_0xf687('0x16')](function(_0x219729){_0x56ed74=_0x219729;logger[_0xf687('0x18')](_0xf687('0x4c'),_0x56ed74['id']);return getTicket(_0x2c2bf8,_0x1f1fb5,_0x56ed74,_0x84dfe5,_0x569d7c);})[_0xf687('0x16')](function(_0x3e4b28){if(_0x3e4b28){logger[_0xf687('0x18')](_0xf687('0x4d'),_0x3e4b28['id']);switch(_0x2c2bf8['type']){case _0xf687('0x4e'):logger[_0xf687('0x18')](_0xf687('0x5c'),_0xf687('0x4f'));return request({'uri':util[_0xf687('0x9')](_0xf687('0x50'),_0x2c2bf8['remoteUri'],_0x1f1fb5['id'],_0x3e4b28['id']),'method':'POST'});case _0xf687('0x51'):logger[_0xf687('0x18')](_0xf687('0x5c'),_0xf687('0x52'));emit(util[_0xf687('0x9')](_0xf687('0x53'),_0x356c4f['name']),_0xf687('0x54'),{'uri':util[_0xf687('0x9')](_0xf687('0x61'),_0x2c2bf8['remoteUri'][_0xf687('0x62')](_0xf687('0x63'),''),_0x3e4b28['id'])});break;default:logger[_0xf687('0x55')](_0xf687('0x5c'),_0xf687('0x56'));}}})['catch'](function(_0x581ddf){logger[_0xf687('0x55')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0xf687('0x58')](_0x581ddf,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x146427,_0x3d6454,_0x37b2ad,_0x197591,_0x3a17c8,_0x566f5d){var _0x4a6df8,_0x327b70;_0x566f5d[_0xf687('0x14')]=intUtil['stripTrailingSlash'](_0x566f5d['remoteUri']);_0x566f5d['serverUrl']=intUtil[_0xf687('0x42')](_0x566f5d[_0xf687('0x43')]);if(_0x3a17c8&&_0x3a17c8[_0xf687('0x44')]){logger[_0xf687('0x18')]('['+_0x3d6454[_0xf687('0x64')][_0xf687('0x65')]()+']',_0xf687('0x46'));_0x3d6454[_0xf687('0x48')]=util[_0xf687('0x9')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x566f5d[_0xf687('0x43')],_0x3d6454[_0xf687('0x5d')],md5(_0x3d6454['uniqueid']));}else{_0x3d6454[_0xf687('0x48')]='';}headers[_0xf687('0x49')]=getAuth(_0x566f5d);return getUser(_0x566f5d)['then'](function(_0x1dc540){_0x4a6df8=_0x1dc540;logger[_0xf687('0x18')](_0xf687('0x5f'),_0x4a6df8['id']);return getEndUser(_0x566f5d,_0x3d6454['calleridname'],_0x3d6454[_0xf687('0x4b')]);})[_0xf687('0x16')](function(_0x3087f1){_0x327b70=_0x3087f1;logger[_0xf687('0x18')]('The\x20Enduser\x20ID\x20is:',_0x327b70['id']);return getTicket(_0x566f5d,_0x4a6df8,_0x327b70,_0x37b2ad,_0x3d6454);})[_0xf687('0x16')](function(_0x341158){if(_0x341158){logger[_0xf687('0x18')](_0xf687('0x4d'),_0x341158['id']);}})[_0xf687('0x57')](function(_0x385121){logger[_0xf687('0x55')]('['+_0x3d6454[_0xf687('0x64')]['toUpperCase']()+']'+_0xf687('0x66'),util['inspect'](_0x385121,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 815af38..5382820 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa1aa=['name','toLowerCase','split','isNil','isBefore','expires_in','access_token','zone','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','seconds','error','Failing\x20creating\x20the\x20access_token','info','Search\x20user','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','then','users','isArrayLikeObject','findIndex','email','Agent\x20found!','profile','Using\x20the\x20admin\x20account!','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','Error:\x20','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','Contacts','lead','Creating\x20new\x20call...','Owner','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','talktime','Call_Duration','mm:ss','answertime','endtime','utc','YYYY-MM-DDTHH:mm:ss','diff','starttime','called','Call_Result','Called','connect','Answered','rejected','abandoned','timeout','Timeout','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','stack','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','com','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]','/downloads?type=uniqueid&token=','zoho.eu','destcalleridname','destcalleridnum','Outbound','lastevent','toUpperCase','lodash','request-promise','md5','./util','moment','ioredis','bluebird','../../../../config/environment','zoho','redis','localhost','debug','[HTTP]','stringify','length','forEach','string','picklist','idField','type','variableName','toString','customVariable','Variable'];(function(_0xe88ef2,_0x4bb198){var _0x259022=function(_0x5a2fba){while(--_0x5a2fba){_0xe88ef2['push'](_0xe88ef2['shift']());}};_0x259022(++_0x4bb198);}(_0xa1aa,0x81));var _0xaa1a=function(_0x2a8166,_0x541761){_0x2a8166=_0x2a8166-0x0;var _0x148611=_0xa1aa[_0x2a8166];return _0x148611;};'use strict';var _=require(_0xaa1a('0x0'));var rp=require(_0xaa1a('0x1'));var md5=require(_0xaa1a('0x2'));var util=require('util');var intUtil=require(_0xaa1a('0x3'));var moment=require(_0xaa1a('0x4'));var Redis=require(_0xaa1a('0x5'));var BPromise=require(_0xaa1a('0x6'));var config=require(_0xaa1a('0x7'));var logger=require('../../../../config/logger')(_0xaa1a('0x8'));config[_0xaa1a('0x9')]=_['defaults'](config[_0xaa1a('0x9')],{'host':_0xaa1a('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x309dba,_0x12c5e8,_0x3a5422){io['to'](_0x309dba)['emit'](_0x12c5e8,_0x3a5422);}function request(_0x15b73b){logger[_0xaa1a('0xb')](_0xaa1a('0xc'),JSON[_0xaa1a('0xd')](_0x15b73b));return rp(_0x15b73b);}function getCustomFields(_0x484a02,_0x29c47c){var _0x21757b={};if(_0x484a02[_0xaa1a('0xe')]>0x0){_[_0xaa1a('0xf')](_0x484a02,function(_0x505237){if(_['includes']([_0xaa1a('0x10'),_0xaa1a('0x11')],_0x505237['type'])&&_0x505237['idField']){_0x21757b[_0x505237[_0xaa1a('0x12')]]=_0x505237['content']['toString']();}else if(_0x505237[_0xaa1a('0x13')]==='variable'&&_0x505237['variableName']&&_0x505237[_0xaa1a('0x12')]&&_0x29c47c[_0x505237[_0xaa1a('0x14')]]){_0x21757b[_0x505237['idField']]=_0x29c47c[_0x505237['variableName']][_0xaa1a('0x15')]();}else if(_0x505237['type']===_0xaa1a('0x16')&&_0x505237[_0xaa1a('0x17')]&&_0x505237[_0xaa1a('0x17')][_0xaa1a('0x18')]&&_0x505237[_0xaa1a('0x12')]&&_0x29c47c[_0x505237[_0xaa1a('0x17')]['name'][_0xaa1a('0x19')]()]){_0x21757b[_0x505237[_0xaa1a('0x12')]]=_0x29c47c[_0x505237[_0xaa1a('0x17')][_0xaa1a('0x18')][_0xaa1a('0x19')]()][_0xaa1a('0x15')]();}});}return _0x21757b;}function getName(_0x2e1303){if(_0x2e1303['indexOf']('\x20')>0x0){var _0x71197=_0x2e1303[_0xaa1a('0x1a')](/ (.+)/);if(_0x71197[0x1]){return _0x71197;}}return[_0x2e1303,_0x2e1303];}var accountsTokens={};function getAccessToken(_0x5b0f2f){return new Promise(function(_0x43c9ba,_0x59cb80){if(!_[_0xaa1a('0x1b')](accountsTokens[_0x5b0f2f['id']])&&!_[_0xaa1a('0x1b')](accountsTokens[_0x5b0f2f['id']]['access_token'])){if(moment()[_0xaa1a('0x1c')](accountsTokens[_0x5b0f2f['id']][_0xaa1a('0x1d')])){_0x43c9ba(accountsTokens[_0x5b0f2f['id']][_0xaa1a('0x1e')]);}}var _0x479eb3;switch(_0x5b0f2f[_0xaa1a('0x1f')]){case'US':_0x479eb3='https://accounts.zoho.com';break;case'AU':_0x479eb3=_0xaa1a('0x20');break;case'EU':_0x479eb3='https://accounts.zoho.eu';break;case'IN':_0x479eb3=_0xaa1a('0x21');break;case'CN':_0x479eb3=_0xaa1a('0x22');break;default:_0x479eb3='https://accounts.zoho.eu';break;}var _0x7a04eb={'method':_0xaa1a('0x23'),'uri':_0x479eb3+_0xaa1a('0x24'),'qs':{'refresh_token':_0x5b0f2f[_0xaa1a('0x25')],'client_id':_0x5b0f2f[_0xaa1a('0x26')],'client_secret':_0x5b0f2f[_0xaa1a('0x27')],'grant_type':_0xaa1a('0x28')},'json':!![]};return rp(_0x7a04eb)['then'](function(_0x5abcd6){accountsTokens[_0x5b0f2f['id']]={'access_token':_0x5abcd6[_0xaa1a('0x1e')],'expires_in':moment()['add'](_0x5abcd6[_0xaa1a('0x1d')],_0xaa1a('0x29'))};_0x43c9ba(_0x5abcd6[_0xaa1a('0x1e')]);})['catch'](function(_0x3f28f5){logger[_0xaa1a('0x2a')](_0xaa1a('0x2b'),_0x3f28f5['stack']);_0x59cb80(_0x3f28f5);});});}function getUser(_0x40d85d,_0xe959f9,_0x47cc9f,_0x521b9f){logger[_0xaa1a('0x2c')](_0xaa1a('0x2d'));return request({'method':'GET','uri':util[_0xaa1a('0x2e')](_0xaa1a('0x2f'),_0xe959f9),'qs':{'type':_0xaa1a('0x30')},'headers':{'Authorization':_0xaa1a('0x31')+_0x40d85d},'json':!![]})[_0xaa1a('0x32')](function(_0x566de7){if(_0x566de7[_0xaa1a('0x33')]){var _0x23c255=-0x1;if(_[_0xaa1a('0x34')](_0x566de7['users'])){if(!_[_0xaa1a('0x1b')](_0x521b9f)){_0x23c255=_[_0xaa1a('0x35')](_0x566de7[_0xaa1a('0x33')],function(_0xf32c4){return _0xf32c4[_0xaa1a('0x36')]===_0x521b9f;});}if(_0x23c255>=0x0){logger[_0xaa1a('0x2c')](_0xaa1a('0x37'));}else{logger[_0xaa1a('0x2c')]('Using\x20the\x20admin\x20account!');_0x23c255=_[_0xaa1a('0x35')](_0x566de7[_0xaa1a('0x33')],function(_0x4c4f39){return _0x4c4f39[_0xaa1a('0x38')][_0xaa1a('0x18')]==='Administrator';});}return _0x566de7['users'][_0x23c255];}else{if(_0x566de7['user']['profile'][_0xaa1a('0x18')]==='Administrator'){logger[_0xaa1a('0x2c')](_0xaa1a('0x39'));user=_0x566de7[_0xaa1a('0x3a')];return user;}else{logger[_0xaa1a('0x2a')](_0xaa1a('0x3b'),JSON[_0xaa1a('0xd')](_0x566de7));throw new Error(_0xaa1a('0x3c')+JSON[_0xaa1a('0xd')](_0x566de7));}}}else{logger[_0xaa1a('0x2a')](_0xaa1a('0x3b'),JSON[_0xaa1a('0xd')](_0x566de7));throw new Error(_0xaa1a('0x3c')+JSON[_0xaa1a('0xd')](_0x566de7));}})[_0xaa1a('0x3d')](function(_0x942b85){console[_0xaa1a('0x2a')](_0x942b85);});}function getZohoUser(_0x3ad8bc,_0x2f430f){return new BPromise(function(_0x29c80a,_0x2c5e19){request(_0x3ad8bc)['then'](function(_0x4cdf9c){var _0x191056=null;if(_0x4cdf9c){_0x191056=_0x4cdf9c[_0xaa1a('0x3e')][0x0];_0x191056[_0xaa1a('0x3f')]=_0x2f430f;}_0x29c80a(_0x191056);})['catch'](function(_0x342d5a){_0x2c5e19(_0x342d5a);});});}function createEndUser(_0x49f1e0,_0xc44c3a,_0x415c47,_0x7fbcab,_0x56272f,_0x9bdcf4){var _0x415c47=getName(_0x415c47);return request({'method':_0xaa1a('0x23'),'uri':_0xaa1a('0x40')+_0xc44c3a+_0xaa1a('0x41')+_[_0xaa1a('0x42')](_0x9bdcf4[_0xaa1a('0x43')])+'s','body':{'data':[{'Last_Name':_0x415c47[0x1],'First_Name':_0x415c47[0x0],'Phone':_0x7fbcab,'Owner':{'name':!_[_0xaa1a('0x1b')](_0x56272f['role'][_0xaa1a('0x18')])?_0x56272f[_0xaa1a('0x44')][_0xaa1a('0x18')]:!_['isNil'](_0x56272f[_0xaa1a('0x45')])?_0x56272f[_0xaa1a('0x45')]+'\x20'+_0x56272f['last_name']:_0x56272f[_0xaa1a('0x46')],'id':_0x56272f['id']}}]},'headers':{'Authorization':_0xaa1a('0x31')+_0x49f1e0},'json':!![]})['then'](function(_0x2dfce2){if(_0x2dfce2&&_0x2dfce2[_0xaa1a('0x3e')][0x0][_0xaa1a('0x47')]===_0xaa1a('0x48')){var _0x24f03d=_0x2dfce2['data'][0x0][_0xaa1a('0x49')];_0x24f03d['enduserType']=_[_0xaa1a('0x42')](_0x9bdcf4['moduleCreate'])+'s';return _0x24f03d;}logger[_0xaa1a('0x2a')]('The\x20failing\x20result\x20is',JSON['stringify'](data));throw new Error(_0xaa1a('0x4a')+JSON[_0xaa1a('0xd')](data));})[_0xaa1a('0x3d')](function(_0x3fa178){console['log'](_0xaa1a('0x4b'),_0x3fa178);});}function getEndUser(_0x54efb9,_0x43a19a,_0x4626e7,_0x30f480,_0x4ccaff,_0x13b3d2,_0x18b319){var _0x5ada42={'method':'GET','uri':'','headers':{'Authorization':_0xaa1a('0x31')+_0x54efb9},'json':!![]};switch(_0x18b319[_0xaa1a('0x4c')]){case _0xaa1a('0x4d'):_0x5ada42[_0xaa1a('0x4e')]='https://www.zohoapis.'+_0x43a19a+_0xaa1a('0x4f')+_0x4ccaff+'))';return getZohoUser(_0x5ada42,'Contacts')['then'](function(_0xc4d2c0){if(_0xc4d2c0)return _0xc4d2c0;_0x5ada42[_0xaa1a('0x4e')]='https://www.zohoapis.'+_0x43a19a+_0xaa1a('0x50')+_0x4ccaff+'))';return getZohoUser(_0x5ada42,_0xaa1a('0x51'))[_0xaa1a('0x32')](function(_0x35ac07){if(_0x35ac07)return _0x35ac07;if(_0x18b319[_0xaa1a('0x43')]!='nothing'){return createEndUser(_0x54efb9,_0x43a19a,_0x30f480,_0x4ccaff,_0x13b3d2,_0x18b319);}else{return{};}});});break;case'contact':_0x5ada42[_0xaa1a('0x4e')]=_0xaa1a('0x40')+_0x43a19a+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x4ccaff+'))';return getZohoUser(_0x5ada42,_0xaa1a('0x52'))[_0xaa1a('0x32')](function(_0x595476){if(_0x595476)return _0x595476;if(_0x18b319[_0xaa1a('0x43')]!='nothing'){return createEndUser(_0x54efb9,_0x43a19a,_0x30f480,_0x4ccaff,_0x13b3d2,_0x18b319);}else{return{};}});break;case _0xaa1a('0x53'):_0x5ada42['uri']=_0xaa1a('0x40')+_0x43a19a+_0xaa1a('0x50')+_0x4ccaff+'))';return getZohoUser(_0x5ada42,_0xaa1a('0x51'))[_0xaa1a('0x32')](function(_0x324223){if(_0x324223)return _0x324223;if(_0x18b319[_0xaa1a('0x43')]!='nothing'){return createEndUser(_0x54efb9,_0x43a19a,_0x30f480,_0x4ccaff,_0x13b3d2,_0x18b319);}else{return{};}});break;}}function getCall(_0x3a7a88,_0x78a098,_0x27b132,_0x1d1084,_0x1d0bf5,_0x325955,_0x6eeb91,_0x3561b1){logger[_0xaa1a('0x2c')](_0xaa1a('0x54'));var _0x876146={};_0x876146[_0xaa1a('0x55')]={'name':!_[_0xaa1a('0x1b')](_0x1d1084['role'][_0xaa1a('0x18')])&&!_['isNil'](_0x1d1084[_0xaa1a('0x38')][_0xaa1a('0x18')])&&_0x1d1084[_0xaa1a('0x38')][_0xaa1a('0x18')]==='administrator'?_0x1d1084[_0xaa1a('0x44')]['name']:!_[_0xaa1a('0x1b')](_0x1d1084[_0xaa1a('0x45')])?_0x1d1084['first_name']+'\x20'+_0x1d1084[_0xaa1a('0x46')]:_0x1d1084[_0xaa1a('0x46')],'id':_0x1d1084['id']};_0x876146[_0xaa1a('0x56')]=intUtil[_0xaa1a('0x57')](_0x325955[_0xaa1a('0x58')],_0x6eeb91,'\x20');_0x876146[_0xaa1a('0x59')]=intUtil[_0xaa1a('0x57')](_0x325955[_0xaa1a('0x5a')],_0x6eeb91,'\x0a');if(_0x1d0bf5[_0xaa1a('0x3f')]==='Contacts'){_0x876146[_0xaa1a('0x5b')]={'name':!_[_0xaa1a('0x1b')](_0x1d0bf5[_0xaa1a('0x5c')])?_0x1d0bf5[_0xaa1a('0x5c')]:!_[_0xaa1a('0x1b')](_0x1d0bf5[_0xaa1a('0x5d')])?_0x1d0bf5[_0xaa1a('0x5d')]+'\x20'+_0x1d0bf5[_0xaa1a('0x5e')]:_0x1d0bf5[_0xaa1a('0x5e')],'id':_0x1d0bf5['id']};}if(_0x1d0bf5[_0xaa1a('0x3f')]==='Leads'){_0x876146['What_Id']={'name':!_[_0xaa1a('0x1b')](_0x1d0bf5['Full_Name'])?_0x1d0bf5[_0xaa1a('0x5c')]:!_['isNil'](_0x1d0bf5[_0xaa1a('0x5d')])?_0x1d0bf5[_0xaa1a('0x5d')]+'\x20'+_0x1d0bf5[_0xaa1a('0x5e')]:_0x1d0bf5[_0xaa1a('0x5e')],'id':_0x1d0bf5['id']};_0x876146['$se_module']=_[_0xaa1a('0x42')](_0x1d0bf5[_0xaa1a('0x3f')]);}if(_0x6eeb91[_0xaa1a('0x5f')]){_0x876146[_0xaa1a('0x60')]=moment['utc'](parseInt(_0x6eeb91[_0xaa1a('0x5f')])*0x3e8)[_0xaa1a('0x2e')](_0xaa1a('0x61'));}else if(_0x6eeb91[_0xaa1a('0x62')]&&_0x6eeb91[_0xaa1a('0x63')]){_0x876146[_0xaa1a('0x60')]=moment[_0xaa1a('0x64')](moment(_0x6eeb91[_0xaa1a('0x63')],_0xaa1a('0x65'))[_0xaa1a('0x66')](moment(_0x6eeb91[_0xaa1a('0x67')],_0xaa1a('0x65'))))['format'](_0xaa1a('0x61'));}switch(_0x6eeb91['lastevent']){case _0xaa1a('0x68'):_0x876146[_0xaa1a('0x69')]=_0xaa1a('0x6a');break;case'complete':case _0xaa1a('0x6b'):_0x876146[_0xaa1a('0x69')]=_0xaa1a('0x6c');break;case _0xaa1a('0x6d'):_0x876146['Call_Result']='Rejected';break;case _0xaa1a('0x6e'):_0x876146['Call_Result']='Abandoned';break;case _0xaa1a('0x6f'):_0x876146[_0xaa1a('0x69')]=_0xaa1a('0x70');default:}_0x876146['Call_Start_Time']=(_0x3561b1===_0xaa1a('0x71')?moment(_0x6eeb91['starttime'])[_0xaa1a('0x2e')](_0xaa1a('0x65')):moment(_0x6eeb91[_0xaa1a('0x72')])[_0xaa1a('0x2e')](_0xaa1a('0x65')))||moment()[_0xaa1a('0x2e')](_0xaa1a('0x65'));_0x876146[_0xaa1a('0x73')]=_0x3561b1||_0xaa1a('0x74');_0x876146=_[_0xaa1a('0x75')](_0x876146,getCustomFields(_0x325955[_0xaa1a('0x76')],_0x6eeb91));return request({'method':_0xaa1a('0x23'),'uri':_0xaa1a('0x40')+_0x78a098+_0xaa1a('0x77'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x3a7a88},'body':{'data':[_0x876146]},'json':!![]})['then'](function(_0x12310d){if(_0x12310d&&_0x12310d['data'][0x0]['code']===_0xaa1a('0x48')){logger[_0xaa1a('0x2c')](_0xaa1a('0x78'));return{'id':_0x12310d[_0xaa1a('0x3e')][0x0][_0xaa1a('0x49')]['id']};}})[_0xaa1a('0x3d')](function(_0x1284ec){logger[_0xaa1a('0x2c')](_0xaa1a('0x79'),_0x1284ec[_0xaa1a('0x7a')]);console['log'](_0xaa1a('0x79'),_0x1284ec);});}exports[_0xaa1a('0x7b')]=function(_0x62bab4,_0x2c295c,_0x9640bf,_0x1d8054,_0xae5046,_0xf7c8ca){var _0x108bde,_0x597dfd,_0x2dfadd;_0xf7c8ca[_0xaa1a('0x7c')]=intUtil[_0xaa1a('0x7d')](_0xf7c8ca[_0xaa1a('0x7c')]);_0xf7c8ca[_0xaa1a('0x7e')]=intUtil[_0xaa1a('0x7d')](_0xf7c8ca[_0xaa1a('0x7e')]);if(_0xae5046&&_0xae5046[_0xaa1a('0x7f')]){logger['info'](_0xaa1a('0x80'),_0xaa1a('0x81'));_0x2c295c[_0xaa1a('0x82')]=_0xf7c8ca[_0xaa1a('0x7e')]+_0xaa1a('0x83')+_0x2c295c['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x2c295c[_0xaa1a('0x84')]);}else{_0x2c295c[_0xaa1a('0x82')]='';}var _0x2feb87=_0xf7c8ca[_0xaa1a('0x7c')]==='zoho.eu'?'eu':_0xaa1a('0x85');return getAccessToken(_0xf7c8ca)[_0xaa1a('0x32')](function(_0x2e160d){_0x2dfadd=_0x2e160d;return getUser(_0x2dfadd,_0x2feb87,_0xf7c8ca,_0x1d8054[_0xaa1a('0x36')]);})['then'](function(_0x5b6da4){_0x108bde=_0x5b6da4;logger[_0xaa1a('0x2c')](_0xaa1a('0x86'),_0x108bde['id']);return getEndUser(_0x2dfadd,_0x2feb87,_0xf7c8ca,_0x2c295c[_0xaa1a('0x87')],_0x2c295c[_0xaa1a('0x88')],_0x108bde,_0x9640bf);})[_0xaa1a('0x32')](function(_0x522a47){_0x597dfd=_0x522a47;return getCall(_0x2dfadd,_0x2feb87,_0xf7c8ca,_0x108bde,_0x597dfd,_0x9640bf,_0x2c295c,'Inbound');})[_0xaa1a('0x32')](function(_0x30da65){if(_0x30da65){logger[_0xaa1a('0x2c')](_0xaa1a('0x89'),_0x30da65['id']);logger[_0xaa1a('0x2c')](_0xaa1a('0x80'),_0xaa1a('0x8a'));emit(util[_0xaa1a('0x2e')](_0xaa1a('0x8b'),_0x1d8054[_0xaa1a('0x18')]),_0xaa1a('0x8c'),{'uri':_0xaa1a('0x8d')+_0xf7c8ca[_0xaa1a('0x7c')]+_0xaa1a('0x8e')+_0x30da65['id']});}})[_0xaa1a('0x3d')](function(_0x9bcc04){logger[_0xaa1a('0x2a')](_0xaa1a('0x80'),JSON[_0xaa1a('0xd')](_0x9bcc04));});};exports['outbound']=function(_0x236346,_0x9ec1ba,_0xff2d7a,_0x23aba9,_0x39502a,_0x5c710c,_0x1ecfdf){var _0xd89deb,_0x127fda,_0x344aca;_0x5c710c[_0xaa1a('0x7c')]=intUtil['stripTrailingSlash'](_0x5c710c[_0xaa1a('0x7c')]);_0x5c710c[_0xaa1a('0x7e')]=intUtil[_0xaa1a('0x7d')](_0x5c710c[_0xaa1a('0x7e')]);if(_0x1ecfdf&&_0x1ecfdf['recordingFormat']&&_0x1ecfdf[_0xaa1a('0x8f')]!==_0xaa1a('0x90')){logger[_0xaa1a('0x2c')](_0xaa1a('0x91'),'Recording\x20is\x20enabled!');_0x9ec1ba[_0xaa1a('0x82')]=_0x5c710c['serverUrl']+_0xaa1a('0x83')+_0x9ec1ba['uniqueid']+_0xaa1a('0x92')+md5(_0x9ec1ba[_0xaa1a('0x84')]);}var _0x4424da=_0x5c710c[_0xaa1a('0x7c')]===_0xaa1a('0x93')?'eu':_0xaa1a('0x85');return getAccessToken(_0x5c710c)[_0xaa1a('0x32')](function(_0x5188af){_0x344aca=_0x5188af;return getUser(_0x344aca,_0x4424da,_0x5c710c,_0x23aba9['email']);})[_0xaa1a('0x32')](function(_0x137f71){_0xd89deb=_0x137f71;logger['info'](_0xaa1a('0x86'),_0xd89deb['id']);return getEndUser(_0x344aca,_0x4424da,_0x5c710c,_0x9ec1ba[_0xaa1a('0x94')],_0x9ec1ba[_0xaa1a('0x95')],_0xd89deb,_0xff2d7a);})[_0xaa1a('0x32')](function(_0x310072){_0x127fda=_0x310072;return getCall(_0x344aca,_0x4424da,_0x5c710c,_0xd89deb,_0x127fda,_0xff2d7a,_0x9ec1ba,_0xaa1a('0x96'));})['then'](function(_0x2b61d7){if(_0x2b61d7){logger[_0xaa1a('0x2c')](_0xaa1a('0x89'),_0x2b61d7['id']);logger[_0xaa1a('0x2c')]('[OUTBOUND]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x23aba9[_0xaa1a('0x18')]),_0xaa1a('0x8c'),{'uri':_0xaa1a('0x8d')+_0x5c710c[_0xaa1a('0x7c')]+_0xaa1a('0x8e')+_0x2b61d7['id']});}})['catch'](function(_0x4e5b5d){logger[_0xaa1a('0x2a')]('[OUTBOUND]',JSON[_0xaa1a('0xd')](_0x4e5b5d));});};exports['unmanaged']=function(_0x38f475,_0x1abf69,_0x159eae,_0x3c0d49,_0x464a36,_0x4437d8){var _0x1feda9,_0x1e46b4,_0x229a02;_0x4437d8['host']=intUtil[_0xaa1a('0x7d')](_0x4437d8[_0xaa1a('0x7c')]);_0x4437d8[_0xaa1a('0x7e')]=intUtil[_0xaa1a('0x7d')](_0x4437d8[_0xaa1a('0x7e')]);if(_0x464a36&&_0x464a36[_0xaa1a('0x7f')]){logger[_0xaa1a('0x2c')]('['+_0x1abf69[_0xaa1a('0x97')][_0xaa1a('0x98')]()+']',_0xaa1a('0x81'));_0x1abf69[_0xaa1a('0x82')]=_0x4437d8[_0xaa1a('0x7e')]+'/api/voice/recordings/'+_0x1abf69[_0xaa1a('0x84')]+_0xaa1a('0x92')+md5(_0x1abf69['uniqueid']);}else{_0x1abf69['recordingURL']='';}var _0x2d4660=_0x4437d8[_0xaa1a('0x7c')]===_0xaa1a('0x93')?'eu':_0xaa1a('0x85');return getAccessToken(_0x4437d8)[_0xaa1a('0x32')](function(_0x50dba1){_0x229a02=_0x50dba1;return getUser(_0x229a02,_0x2d4660,_0x4437d8);})[_0xaa1a('0x32')](function(_0xc681c3){_0x1feda9=_0xc681c3;logger['info'](_0xaa1a('0x86'),_0x1feda9['id']);return getEndUser(_0x229a02,_0x2d4660,_0x4437d8,_0x1abf69['calleridname'],_0x1abf69[_0xaa1a('0x88')],_0x1feda9,_0x159eae);})['then'](function(_0x4b827c){_0x1e46b4=_0x4b827c;return getCall(_0x229a02,_0x2d4660,_0x4437d8,_0x1feda9,_0x1e46b4,_0x159eae,_0x1abf69,'Inbound');})[_0xaa1a('0x32')](function(_0x416398){if(_0x416398){logger['info']('The\x20Call\x20ID\x20is:',_0x416398['id']);}})[_0xaa1a('0x3d')](function(_0x4f4aa9){logger['error']('['+_0x1abf69[_0xaa1a('0x97')]['toUpperCase']()+']',JSON[_0xaa1a('0xd')](_0x4f4aa9));});};
\ No newline at end of file
+var _0x1165=['user:%s','/crm/EntityInfo.do?module=Calls&id=','unmanaged','monitor_format','toUpperCase','util','./util','moment','bluebird','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','debug','[HTTP]','length','forEach','includes','string','picklist','idField','content','variable','variableName','type','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','refresh_token','then','add','expires_in','seconds','catch','Failing\x20creating\x20the\x20access_token','info','GET','format','https://www.zohoapis.%s/crm/v2/users','users','findIndex','email','Agent\x20found!','profile','Administrator','user','Using\x20the\x20admin\x20account!','error','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','https://www.zohoapis.','/crm/v2/','moduleCreate','role','first_name','last_name','code','SUCCESS','details','enduserType','startCase','Error:\x20','CREATE\x20ERROR','Zoho-oauthtoken\x20','moduleSearch','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','uri','Leads','nothing','contact','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Creating\x20new\x20call...','Owner','administrator','Subject','Subjects','Description','getString','Descriptions','Who_Id','Full_Name','Last_Name','What_Id','First_Name','$se_module','Call_Duration','utc','talktime','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','Call_Result','Called','complete','connect','Answered','rejected','Rejected','Abandoned','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','err','log','host','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','trigger:browser:url','https://crm.','none','destcalleridname','Outbound','[OUTBOUND]'];(function(_0x11e2bd,_0xd27110){var _0x547afa=function(_0x423462){while(--_0x423462){_0x11e2bd['push'](_0x11e2bd['shift']());}};_0x547afa(++_0xd27110);}(_0x1165,0x1d6));var _0x5116=function(_0x315d6a,_0xa24a5e){_0x315d6a=_0x315d6a-0x0;var _0x3737bc=_0x1165[_0x315d6a];return _0x3737bc;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require('md5');var util=require(_0x5116('0x0'));var intUtil=require(_0x5116('0x1'));var moment=require(_0x5116('0x2'));var Redis=require('ioredis');var BPromise=require(_0x5116('0x3'));var config=require('../../../../config/environment');var logger=require(_0x5116('0x4'))(_0x5116('0x5'));config[_0x5116('0x6')]=_[_0x5116('0x7')](config[_0x5116('0x6')],{'host':_0x5116('0x8'),'port':0x18eb});var io=require(_0x5116('0x9'))(new Redis(config[_0x5116('0x6')]));function emit(_0x285665,_0x471ae6,_0x4957d9){io['to'](_0x285665)['emit'](_0x471ae6,_0x4957d9);}function request(_0x23febc){logger[_0x5116('0xa')](_0x5116('0xb'),JSON['stringify'](_0x23febc));return rp(_0x23febc);}function getCustomFields(_0xdb90ed,_0x598dd1){var _0x5b190e={};if(_0xdb90ed[_0x5116('0xc')]>0x0){_[_0x5116('0xd')](_0xdb90ed,function(_0x3f0f93){if(_[_0x5116('0xe')]([_0x5116('0xf'),_0x5116('0x10')],_0x3f0f93['type'])&&_0x3f0f93[_0x5116('0x11')]){_0x5b190e[_0x3f0f93['idField']]=_0x3f0f93[_0x5116('0x12')]['toString']();}else if(_0x3f0f93['type']===_0x5116('0x13')&&_0x3f0f93['variableName']&&_0x3f0f93[_0x5116('0x11')]&&_0x598dd1[_0x3f0f93[_0x5116('0x14')]]){_0x5b190e[_0x3f0f93[_0x5116('0x11')]]=_0x598dd1[_0x3f0f93[_0x5116('0x14')]]['toString']();}else if(_0x3f0f93[_0x5116('0x15')]==='customVariable'&&_0x3f0f93[_0x5116('0x16')]&&_0x3f0f93[_0x5116('0x16')][_0x5116('0x17')]&&_0x3f0f93[_0x5116('0x11')]&&_0x598dd1[_0x3f0f93[_0x5116('0x16')][_0x5116('0x17')][_0x5116('0x18')]()]){_0x5b190e[_0x3f0f93['idField']]=_0x598dd1[_0x3f0f93[_0x5116('0x16')][_0x5116('0x17')][_0x5116('0x18')]()]['toString']();}});}return _0x5b190e;}function getName(_0x36241b){if(_0x36241b[_0x5116('0x19')]('\x20')>0x0){var _0x16cd3e=_0x36241b[_0x5116('0x1a')](/ (.+)/);if(_0x16cd3e[0x1]){return _0x16cd3e;}}return[_0x36241b,_0x36241b];}var accountsTokens={};function getAccessToken(_0xf6198d){return new Promise(function(_0x43efd1,_0x346d27){if(!_[_0x5116('0x1b')](accountsTokens[_0xf6198d['id']])&&!_[_0x5116('0x1b')](accountsTokens[_0xf6198d['id']][_0x5116('0x1c')])){if(moment()[_0x5116('0x1d')](accountsTokens[_0xf6198d['id']]['expires_in'])){_0x43efd1(accountsTokens[_0xf6198d['id']]['access_token']);}}var _0x3a31a6;switch(_0xf6198d[_0x5116('0x1e')]){case'US':_0x3a31a6=_0x5116('0x1f');break;case'AU':_0x3a31a6=_0x5116('0x20');break;case'EU':_0x3a31a6='https://accounts.zoho.eu';break;case'IN':_0x3a31a6=_0x5116('0x21');break;case'CN':_0x3a31a6=_0x5116('0x22');break;default:_0x3a31a6=_0x5116('0x23');break;}var _0x451304={'method':_0x5116('0x24'),'uri':_0x3a31a6+_0x5116('0x25'),'qs':{'refresh_token':_0xf6198d[_0x5116('0x26')],'client_id':_0xf6198d['clientId'],'client_secret':_0xf6198d['clientSecret'],'grant_type':_0x5116('0x27')},'json':!![]};return rp(_0x451304)[_0x5116('0x28')](function(_0x3940de){accountsTokens[_0xf6198d['id']]={'access_token':_0x3940de[_0x5116('0x1c')],'expires_in':moment()[_0x5116('0x29')](_0x3940de[_0x5116('0x2a')],_0x5116('0x2b'))};_0x43efd1(_0x3940de[_0x5116('0x1c')]);})[_0x5116('0x2c')](function(_0x4d4aae){logger['error'](_0x5116('0x2d'),_0x4d4aae['stack']);_0x346d27(_0x4d4aae);});});}function getUser(_0x56f30d,_0xacc0d1,_0x5767ec,_0xa54e2){logger[_0x5116('0x2e')]('Search\x20user');return request({'method':_0x5116('0x2f'),'uri':util[_0x5116('0x30')](_0x5116('0x31'),_0xacc0d1),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x56f30d},'json':!![]})[_0x5116('0x28')](function(_0x46bc65){if(_0x46bc65[_0x5116('0x32')]){var _0x4faf0d=-0x1;if(_['isArrayLikeObject'](_0x46bc65[_0x5116('0x32')])){if(!_[_0x5116('0x1b')](_0xa54e2)){_0x4faf0d=_[_0x5116('0x33')](_0x46bc65[_0x5116('0x32')],function(_0x154309){return _0x154309[_0x5116('0x34')]===_0xa54e2;});}if(_0x4faf0d>=0x0){logger[_0x5116('0x2e')](_0x5116('0x35'));}else{logger[_0x5116('0x2e')]('Using\x20the\x20admin\x20account!');_0x4faf0d=_[_0x5116('0x33')](_0x46bc65[_0x5116('0x32')],function(_0x2061d3){return _0x2061d3[_0x5116('0x36')]['name']===_0x5116('0x37');});}return _0x46bc65[_0x5116('0x32')][_0x4faf0d];}else{if(_0x46bc65[_0x5116('0x38')][_0x5116('0x36')]['name']===_0x5116('0x37')){logger[_0x5116('0x2e')](_0x5116('0x39'));user=_0x46bc65[_0x5116('0x38')];return user;}else{logger[_0x5116('0x3a')](_0x5116('0x3b'),JSON[_0x5116('0x3c')](_0x46bc65));throw new Error(_0x5116('0x3d')+JSON['stringify'](_0x46bc65));}}}else{logger[_0x5116('0x3a')](_0x5116('0x3b'),JSON['stringify'](_0x46bc65));throw new Error(_0x5116('0x3d')+JSON['stringify'](_0x46bc65));}})[_0x5116('0x2c')](function(_0x510094){console[_0x5116('0x3a')](_0x510094);});}function getZohoUser(_0x1c2f81,_0x1c532e){return new BPromise(function(_0xefd97d,_0x2985f3){request(_0x1c2f81)[_0x5116('0x28')](function(_0x24fe3b){var _0x3ebb75=null;if(_0x24fe3b){_0x3ebb75=_0x24fe3b[_0x5116('0x3e')][0x0];_0x3ebb75['enduserType']=_0x1c532e;}_0xefd97d(_0x3ebb75);})[_0x5116('0x2c')](function(_0x152b2f){_0x2985f3(_0x152b2f);});});}function createEndUser(_0x59ea0e,_0x390338,_0x1ddf02,_0x24e33c,_0x5c3393,_0x12341e){var _0x1ddf02=getName(_0x1ddf02);return request({'method':'POST','uri':_0x5116('0x3f')+_0x390338+_0x5116('0x40')+_['startCase'](_0x12341e[_0x5116('0x41')])+'s','body':{'data':[{'Last_Name':_0x1ddf02[0x1],'First_Name':_0x1ddf02[0x0],'Phone':_0x24e33c,'Owner':{'name':!_[_0x5116('0x1b')](_0x5c3393[_0x5116('0x42')][_0x5116('0x17')])?_0x5c3393[_0x5116('0x42')][_0x5116('0x17')]:!_[_0x5116('0x1b')](_0x5c3393[_0x5116('0x43')])?_0x5c3393[_0x5116('0x43')]+'\x20'+_0x5c3393['last_name']:_0x5c3393[_0x5116('0x44')],'id':_0x5c3393['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x59ea0e},'json':!![]})['then'](function(_0xe05ca7){if(_0xe05ca7&&_0xe05ca7[_0x5116('0x3e')][0x0][_0x5116('0x45')]===_0x5116('0x46')){var _0x4dd8bd=_0xe05ca7[_0x5116('0x3e')][0x0][_0x5116('0x47')];_0x4dd8bd[_0x5116('0x48')]=_[_0x5116('0x49')](_0x12341e[_0x5116('0x41')])+'s';return _0x4dd8bd;}logger[_0x5116('0x3a')](_0x5116('0x3b'),JSON[_0x5116('0x3c')](data));throw new Error(_0x5116('0x4a')+JSON[_0x5116('0x3c')](data));})[_0x5116('0x2c')](function(_0x2c22e0){console['log'](_0x5116('0x4b'),_0x2c22e0);});}function getEndUser(_0x3ac81c,_0x116773,_0x2edb74,_0x16d531,_0x5ad8b3,_0x15b74a,_0x2d5df7){var _0x1b56ea={'method':_0x5116('0x2f'),'uri':'','headers':{'Authorization':_0x5116('0x4c')+_0x3ac81c},'json':!![]};switch(_0x2d5df7[_0x5116('0x4d')]){case'contact_lead':_0x1b56ea['uri']=_0x5116('0x3f')+_0x116773+_0x5116('0x4e')+_0x5ad8b3+'))';return getZohoUser(_0x1b56ea,_0x5116('0x4f'))['then'](function(_0x4af6bb){if(_0x4af6bb)return _0x4af6bb;_0x1b56ea[_0x5116('0x50')]=_0x5116('0x3f')+_0x116773+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x5ad8b3+'))';return getZohoUser(_0x1b56ea,_0x5116('0x51'))[_0x5116('0x28')](function(_0x15058b){if(_0x15058b)return _0x15058b;if(_0x2d5df7['moduleCreate']!=_0x5116('0x52')){return createEndUser(_0x3ac81c,_0x116773,_0x16d531,_0x5ad8b3,_0x15b74a,_0x2d5df7);}else{return{};}});});break;case _0x5116('0x53'):_0x1b56ea[_0x5116('0x50')]=_0x5116('0x3f')+_0x116773+_0x5116('0x4e')+_0x5ad8b3+'))';return getZohoUser(_0x1b56ea,_0x5116('0x4f'))[_0x5116('0x28')](function(_0x1847a9){if(_0x1847a9)return _0x1847a9;if(_0x2d5df7[_0x5116('0x41')]!=_0x5116('0x52')){return createEndUser(_0x3ac81c,_0x116773,_0x16d531,_0x5ad8b3,_0x15b74a,_0x2d5df7);}else{return{};}});break;case _0x5116('0x54'):_0x1b56ea['uri']=_0x5116('0x3f')+_0x116773+_0x5116('0x55')+_0x5ad8b3+'))';return getZohoUser(_0x1b56ea,_0x5116('0x51'))['then'](function(_0x1ad7a0){if(_0x1ad7a0)return _0x1ad7a0;if(_0x2d5df7[_0x5116('0x41')]!=_0x5116('0x52')){return createEndUser(_0x3ac81c,_0x116773,_0x16d531,_0x5ad8b3,_0x15b74a,_0x2d5df7);}else{return{};}});break;}}function getCall(_0x5994d9,_0x1bf2f5,_0xa5bded,_0x448a27,_0x3e0a16,_0x2ccdf5,_0x303317,_0x5bea81){logger[_0x5116('0x2e')](_0x5116('0x56'));var _0x2310a5={};_0x2310a5[_0x5116('0x57')]={'name':!_[_0x5116('0x1b')](_0x448a27['role'][_0x5116('0x17')])&&!_[_0x5116('0x1b')](_0x448a27[_0x5116('0x36')][_0x5116('0x17')])&&_0x448a27[_0x5116('0x36')][_0x5116('0x17')]===_0x5116('0x58')?_0x448a27[_0x5116('0x42')]['name']:!_[_0x5116('0x1b')](_0x448a27[_0x5116('0x43')])?_0x448a27[_0x5116('0x43')]+'\x20'+_0x448a27[_0x5116('0x44')]:_0x448a27[_0x5116('0x44')],'id':_0x448a27['id']};_0x2310a5[_0x5116('0x59')]=intUtil['getString'](_0x2ccdf5[_0x5116('0x5a')],_0x303317,'\x20');_0x2310a5[_0x5116('0x5b')]=intUtil[_0x5116('0x5c')](_0x2ccdf5[_0x5116('0x5d')],_0x303317,'\x0a');if(_0x3e0a16[_0x5116('0x48')]===_0x5116('0x4f')){_0x2310a5[_0x5116('0x5e')]={'name':!_['isNil'](_0x3e0a16[_0x5116('0x5f')])?_0x3e0a16[_0x5116('0x5f')]:!_[_0x5116('0x1b')](_0x3e0a16['First_Name'])?_0x3e0a16['First_Name']+'\x20'+_0x3e0a16[_0x5116('0x60')]:_0x3e0a16[_0x5116('0x60')],'id':_0x3e0a16['id']};}if(_0x3e0a16[_0x5116('0x48')]===_0x5116('0x51')){_0x2310a5[_0x5116('0x61')]={'name':!_[_0x5116('0x1b')](_0x3e0a16['Full_Name'])?_0x3e0a16[_0x5116('0x5f')]:!_['isNil'](_0x3e0a16['First_Name'])?_0x3e0a16[_0x5116('0x62')]+'\x20'+_0x3e0a16['Last_Name']:_0x3e0a16[_0x5116('0x60')],'id':_0x3e0a16['id']};_0x2310a5[_0x5116('0x63')]=_[_0x5116('0x49')](_0x3e0a16[_0x5116('0x48')]);}if(_0x303317['talktime']){_0x2310a5[_0x5116('0x64')]=moment[_0x5116('0x65')](parseInt(_0x303317[_0x5116('0x66')])*0x3e8)[_0x5116('0x30')](_0x5116('0x67'));}else if(_0x303317[_0x5116('0x68')]&&_0x303317[_0x5116('0x69')]){_0x2310a5['Call_Duration']=moment[_0x5116('0x65')](moment(_0x303317[_0x5116('0x69')],_0x5116('0x6a'))[_0x5116('0x6b')](moment(_0x303317[_0x5116('0x6c')],'YYYY-MM-DDTHH:mm:ss')))[_0x5116('0x30')](_0x5116('0x67'));}switch(_0x303317[_0x5116('0x6d')]){case'called':_0x2310a5[_0x5116('0x6e')]=_0x5116('0x6f');break;case _0x5116('0x70'):case _0x5116('0x71'):_0x2310a5[_0x5116('0x6e')]=_0x5116('0x72');break;case _0x5116('0x73'):_0x2310a5[_0x5116('0x6e')]=_0x5116('0x74');break;case'abandoned':_0x2310a5[_0x5116('0x6e')]=_0x5116('0x75');break;case'timeout':_0x2310a5[_0x5116('0x6e')]=_0x5116('0x76');default:}_0x2310a5[_0x5116('0x77')]=(_0x5bea81===_0x5116('0x78')?moment(_0x303317[_0x5116('0x6c')])['format'](_0x5116('0x6a')):moment(_0x303317[_0x5116('0x79')])['format'](_0x5116('0x6a')))||moment()[_0x5116('0x30')](_0x5116('0x6a'));_0x2310a5[_0x5116('0x7a')]=_0x5bea81||_0x5116('0x7b');_0x2310a5=_[_0x5116('0x7c')](_0x2310a5,getCustomFields(_0x2ccdf5[_0x5116('0x7d')],_0x303317));return request({'method':_0x5116('0x24'),'uri':_0x5116('0x3f')+_0x1bf2f5+_0x5116('0x7e'),'headers':{'Authorization':_0x5116('0x4c')+_0x5994d9},'body':{'data':[_0x2310a5]},'json':!![]})[_0x5116('0x28')](function(_0x2007d8){if(_0x2007d8&&_0x2007d8[_0x5116('0x3e')][0x0][_0x5116('0x45')]==='SUCCESS'){logger['info']('Call\x20created!');return{'id':_0x2007d8[_0x5116('0x3e')][0x0][_0x5116('0x47')]['id']};}})[_0x5116('0x2c')](function(_0x45640f){logger['info'](_0x5116('0x7f'),_0x45640f['stack']);console[_0x5116('0x80')]('err',_0x45640f);});}exports['queue']=function(_0x5459c2,_0x39ed6d,_0x5c0dc9,_0x327d2c,_0x197ceb,_0x324089){var _0x14bda8,_0x3f598b,_0x370e1f;_0x324089[_0x5116('0x81')]=intUtil[_0x5116('0x82')](_0x324089['host']);_0x324089[_0x5116('0x83')]=intUtil[_0x5116('0x82')](_0x324089[_0x5116('0x83')]);if(_0x197ceb&&_0x197ceb['monitor_format']){logger['info'](_0x5116('0x84'),_0x5116('0x85'));_0x39ed6d[_0x5116('0x86')]=_0x324089['serverUrl']+_0x5116('0x87')+_0x39ed6d[_0x5116('0x88')]+_0x5116('0x89')+md5(_0x39ed6d['uniqueid']);}else{_0x39ed6d[_0x5116('0x86')]='';}var _0x278873=_0x324089[_0x5116('0x81')]===_0x5116('0x8a')?'eu':_0x5116('0x8b');return getAccessToken(_0x324089)[_0x5116('0x28')](function(_0x6d8983){_0x370e1f=_0x6d8983;return getUser(_0x370e1f,_0x278873,_0x324089,_0x327d2c[_0x5116('0x34')]);})[_0x5116('0x28')](function(_0x5f2f12){_0x14bda8=_0x5f2f12;logger['info'](_0x5116('0x8c'),_0x14bda8['id']);return getEndUser(_0x370e1f,_0x278873,_0x324089,_0x39ed6d[_0x5116('0x8d')],_0x39ed6d[_0x5116('0x8e')],_0x14bda8,_0x5c0dc9);})[_0x5116('0x28')](function(_0x301bd2){_0x3f598b=_0x301bd2;return getCall(_0x370e1f,_0x278873,_0x324089,_0x14bda8,_0x3f598b,_0x5c0dc9,_0x39ed6d,_0x5116('0x7b'));})['then'](function(_0x22f769){if(_0x22f769){logger[_0x5116('0x2e')](_0x5116('0x8f'),_0x22f769['id']);logger[_0x5116('0x2e')](_0x5116('0x84'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x5116('0x30')]('user:%s',_0x327d2c['name']),_0x5116('0x90'),{'uri':_0x5116('0x91')+_0x324089['host']+'/crm/EntityInfo.do?module=Calls&id='+_0x22f769['id']});}})[_0x5116('0x2c')](function(_0x1369dd){logger[_0x5116('0x3a')]('[QUEUE]',JSON['stringify'](_0x1369dd));});};exports[_0x5116('0x78')]=function(_0xa87231,_0x55d539,_0x352e56,_0x169f17,_0x1f7aab,_0x3ee38e,_0x1365dc){var _0x30076f,_0x572348,_0x5c85ee;_0x3ee38e['host']=intUtil['stripTrailingSlash'](_0x3ee38e[_0x5116('0x81')]);_0x3ee38e[_0x5116('0x83')]=intUtil[_0x5116('0x82')](_0x3ee38e[_0x5116('0x83')]);if(_0x1365dc&&_0x1365dc['recordingFormat']&&_0x1365dc['recordingFormat']!==_0x5116('0x92')){logger[_0x5116('0x2e')]('[OUTBOUND]',_0x5116('0x85'));_0x55d539[_0x5116('0x86')]=_0x3ee38e['serverUrl']+_0x5116('0x87')+_0x55d539['uniqueid']+_0x5116('0x89')+md5(_0x55d539[_0x5116('0x88')]);}var _0x4bce70=_0x3ee38e['host']==='zoho.eu'?'eu':_0x5116('0x8b');return getAccessToken(_0x3ee38e)['then'](function(_0x46b34d){_0x5c85ee=_0x46b34d;return getUser(_0x5c85ee,_0x4bce70,_0x3ee38e,_0x169f17[_0x5116('0x34')]);})['then'](function(_0x2fc237){_0x30076f=_0x2fc237;logger[_0x5116('0x2e')](_0x5116('0x8c'),_0x30076f['id']);return getEndUser(_0x5c85ee,_0x4bce70,_0x3ee38e,_0x55d539[_0x5116('0x93')],_0x55d539['destcalleridnum'],_0x30076f,_0x352e56);})[_0x5116('0x28')](function(_0x77de34){_0x572348=_0x77de34;return getCall(_0x5c85ee,_0x4bce70,_0x3ee38e,_0x30076f,_0x572348,_0x352e56,_0x55d539,_0x5116('0x94'));})[_0x5116('0x28')](function(_0x31c770){if(_0x31c770){logger[_0x5116('0x2e')](_0x5116('0x8f'),_0x31c770['id']);logger[_0x5116('0x2e')](_0x5116('0x95'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x5116('0x30')](_0x5116('0x96'),_0x169f17[_0x5116('0x17')]),_0x5116('0x90'),{'uri':'https://crm.'+_0x3ee38e[_0x5116('0x81')]+_0x5116('0x97')+_0x31c770['id']});}})[_0x5116('0x2c')](function(_0x315a8e){logger[_0x5116('0x3a')](_0x5116('0x95'),JSON[_0x5116('0x3c')](_0x315a8e));});};exports[_0x5116('0x98')]=function(_0x652c6,_0x1471d1,_0xc2e186,_0x59c54f,_0x5a72c0,_0x4e33cf){var _0x599b28,_0x5bc025,_0x472037;_0x4e33cf[_0x5116('0x81')]=intUtil[_0x5116('0x82')](_0x4e33cf[_0x5116('0x81')]);_0x4e33cf[_0x5116('0x83')]=intUtil['stripTrailingSlash'](_0x4e33cf[_0x5116('0x83')]);if(_0x5a72c0&&_0x5a72c0[_0x5116('0x99')]){logger['info']('['+_0x1471d1['lastevent'][_0x5116('0x9a')]()+']','Recording\x20is\x20enabled!');_0x1471d1[_0x5116('0x86')]=_0x4e33cf[_0x5116('0x83')]+_0x5116('0x87')+_0x1471d1['uniqueid']+_0x5116('0x89')+md5(_0x1471d1['uniqueid']);}else{_0x1471d1[_0x5116('0x86')]='';}var _0x3de1b1=_0x4e33cf[_0x5116('0x81')]===_0x5116('0x8a')?'eu':_0x5116('0x8b');return getAccessToken(_0x4e33cf)['then'](function(_0x368e49){_0x472037=_0x368e49;return getUser(_0x472037,_0x3de1b1,_0x4e33cf);})['then'](function(_0x2ce9ed){_0x599b28=_0x2ce9ed;logger[_0x5116('0x2e')](_0x5116('0x8c'),_0x599b28['id']);return getEndUser(_0x472037,_0x3de1b1,_0x4e33cf,_0x1471d1['calleridname'],_0x1471d1[_0x5116('0x8e')],_0x599b28,_0xc2e186);})['then'](function(_0x39cb89){_0x5bc025=_0x39cb89;return getCall(_0x472037,_0x3de1b1,_0x4e33cf,_0x599b28,_0x5bc025,_0xc2e186,_0x1471d1,_0x5116('0x7b'));})['then'](function(_0x45a4b5){if(_0x45a4b5){logger[_0x5116('0x2e')](_0x5116('0x8f'),_0x45a4b5['id']);}})[_0x5116('0x2c')](function(_0x2efa60){logger[_0x5116('0x3a')]('['+_0x1471d1[_0x5116('0x6d')][_0x5116('0x9a')]()+']',JSON[_0x5116('0x3c')](_0x2efa60));});};
\ No newline at end of file
index 623ed42..544ce8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb32=['error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','trigger','data2','Script','data3','render','exec'];(function(_0x36535e,_0x1427b3){var _0x11933b=function(_0x281ad8){while(--_0x281ad8){_0x36535e['push'](_0x36535e['shift']());}};_0x11933b(++_0x1427b3);}(_0xfb32,0xbb));var _0x2fb3=function(_0xaa6a4,_0x64b067){_0xaa6a4=_0xaa6a4-0x0;var _0xdc31a4=_0xfb32[_0xaa6a4];return _0xdc31a4;};'use strict';var util=require(_0x2fb3('0x0'));var sh=require(_0x2fb3('0x1'));var Mustache=require('mustache');var logger=require('../../../../config/logger')(_0x2fb3('0x2'));exports['exec']=function(_0x279586,_0x978c6){var _0xed0908=_0x279586[_0x2fb3('0x3')]?_0x279586[_0x2fb3('0x3')]:_0x2fb3('0x4');var _0x45dc14=_0x279586[_0x2fb3('0x5')]?Mustache[_0x2fb3('0x6')](_0x279586[_0x2fb3('0x5')],_0x978c6):_0x978c6;sh[_0x2fb3('0x7')](_0x45dc14,function(_0x1f9a4b,_0x2983ff,_0x13f6bf){if(_0x1f9a4b!==0x0){logger[_0x2fb3('0x8')](util['format'](_0x2fb3('0x9'),_0xed0908,_0x45dc14,_0x1f9a4b,_0x13f6bf));}else{logger[_0x2fb3('0xa')](util[_0x2fb3('0xb')](_0x2fb3('0xc'),_0xed0908,_0x45dc14,_0x2983ff));}});};
\ No newline at end of file
+var _0x649a=['data2','data3','render','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','../../../../config/logger','trigger'];(function(_0x2c3255,_0x4e00ae){var _0x282aba=function(_0x5721d5){while(--_0x5721d5){_0x2c3255['push'](_0x2c3255['shift']());}};_0x282aba(++_0x4e00ae);}(_0x649a,0x1dc));var _0xa649=function(_0x5db8e5,_0x35e3d5){_0x5db8e5=_0x5db8e5-0x0;var _0x4f800d=_0x649a[_0x5db8e5];return _0x4f800d;};'use strict';var util=require(_0xa649('0x0'));var sh=require(_0xa649('0x1'));var Mustache=require(_0xa649('0x2'));var logger=require(_0xa649('0x3'))(_0xa649('0x4'));exports['exec']=function(_0x33a507,_0x5737a2){var _0x9bc7a9=_0x33a507[_0xa649('0x5')]?_0x33a507['data2']:'Script';var _0x5a59e1=_0x33a507[_0xa649('0x6')]?Mustache[_0xa649('0x7')](_0x33a507[_0xa649('0x6')],_0x5737a2):_0x5737a2;sh['exec'](_0x5a59e1,function(_0x8216aa,_0x1cbf57,_0x2984e9){if(_0x8216aa!==0x0){logger[_0xa649('0x8')](util[_0xa649('0x9')](_0xa649('0xa'),_0x9bc7a9,_0x5a59e1,_0x8216aa,_0x2984e9));}else{logger[_0xa649('0xb')](util[_0xa649('0x9')](_0xa649('0xc'),_0x9bc7a9,_0x5a59e1,_0x1cbf57));}});};
\ No newline at end of file
index 6848648..7dc1604 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f0e=['body','info','format','then','isNil',',\x20request\x20body:\x20','object','statusCode','catch','util','lodash','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','data5','headers','data6','parse','error','stack','GET','DELETE','POST','PUT','data7'];(function(_0x16f819,_0x2e653f){var _0x332326=function(_0x4a0bfe){while(--_0x4a0bfe){_0x16f819['push'](_0x16f819['shift']());}};_0x332326(++_0x2e653f);}(_0x0f0e,0x19f));var _0xe0f0=function(_0x378ace,_0x4412c3){_0x378ace=_0x378ace-0x0;var _0x140c10=_0x0f0e[_0x378ace];return _0x140c10;};'use strict';var rp=require('request-promise');var util=require(_0xe0f0('0x0'));var _=require(_0xe0f0('0x1'));var Mustache=require('mustache');var logger=require(_0xe0f0('0x2'))(_0xe0f0('0x3'));exports[_0xe0f0('0x4')]=function(_0xbad29f,_0x4580a3){var _0x4cc420,_0x21114b;var _0x10c002={'method':_0xbad29f[_0xe0f0('0x5')][_0xe0f0('0x6')](),'uri':Mustache[_0xe0f0('0x7')](_0xbad29f[_0xe0f0('0x8')],_0x4580a3),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0xbad29f[_0xe0f0('0x9')])==='number'&&parseInt(_0xbad29f[_0xe0f0('0x9')])>=0x1&&parseInt(_0xbad29f[_0xe0f0('0x9')])<=0xa?parseInt(_0xbad29f[_0xe0f0('0x9')])*0x3e8:0x5*0x3e8};try{_0x10c002[_0xe0f0('0xa')]=_0xbad29f[_0xe0f0('0xb')]?JSON[_0xe0f0('0xc')](Mustache[_0xe0f0('0x7')](_0xbad29f['data6'],_0x4580a3)):{};}catch(_0x479b34){logger[_0xe0f0('0xd')](_0x479b34[_0xe0f0('0xe')]);}switch(_0xbad29f[_0xe0f0('0x5')][_0xe0f0('0x6')]()){case _0xe0f0('0xf'):case _0xe0f0('0x10'):_0x4cc420=null;_0x10c002['qs']=_0x4580a3;break;case _0xe0f0('0x11'):case _0xe0f0('0x12'):if(_0xbad29f[_0xe0f0('0x13')]){try{_0x4cc420=JSON[_0xe0f0('0xc')](Mustache['render'](_0xbad29f['data7'],_0x4580a3));_0x10c002[_0xe0f0('0x14')]=_0x4cc420;}catch(_0x5c5f45){logger[_0xe0f0('0xd')](_0x5c5f45[_0xe0f0('0xe')]);logger['error']('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x4cc420=_0x4580a3;_0x10c002[_0xe0f0('0x14')]=_0x4cc420;}break;}logger[_0xe0f0('0x15')](util[_0xe0f0('0x16')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0xbad29f[_0xe0f0('0x5')],_0xbad29f[_0xe0f0('0x8')],JSON['stringify'](_0x10c002)));rp(_0x10c002)[_0xe0f0('0x17')](function(_0x813c14){_0x4cc420=!_[_0xe0f0('0x18')](_0x4cc420)?_0xe0f0('0x19')+_0x4cc420:'';_0x21114b=typeof _0x813c14[_0xe0f0('0x14')]===_0xe0f0('0x1a')?JSON['stringify'](_0x813c14[_0xe0f0('0x14')]):_0x813c14[_0xe0f0('0x14')];logger['info'](util[_0xe0f0('0x16')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0xbad29f[_0xe0f0('0x5')],_0xbad29f[_0xe0f0('0x8')],_0x813c14[_0xe0f0('0x1b')],_0x21114b));})[_0xe0f0('0x1c')](function(_0x24f1c0){logger[_0xe0f0('0xd')](util[_0xe0f0('0x16')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0xbad29f['data1'],_0xbad29f[_0xe0f0('0x8')],_0x24f1c0[_0xe0f0('0x1b')],_0x24f1c0['name'],_0x24f1c0['message']));});};
\ No newline at end of file
+var _0x5f28=['%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data1','then','isNil',',\x20request\x20body:\x20','object','stringify','info','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','request-promise','util','mustache','exec','render','data2','data5','data6','parse','stack','toUpperCase','GET','POST','PUT','data7','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','format'];(function(_0x581f9c,_0x164552){var _0x3da083=function(_0x1a920e){while(--_0x1a920e){_0x581f9c['push'](_0x581f9c['shift']());}};_0x3da083(++_0x164552);}(_0x5f28,0xe5));var _0x85f2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f28[_0x3dd15e];return _0x231fd0;};'use strict';var rp=require(_0x85f2('0x0'));var util=require(_0x85f2('0x1'));var _=require('lodash');var Mustache=require(_0x85f2('0x2'));var logger=require('../../../../config/logger')('trigger');exports[_0x85f2('0x3')]=function(_0x489738,_0x4cb0bc){var _0x5c128c,_0x15a870;var _0x382379={'method':_0x489738['data1']['toUpperCase'](),'uri':Mustache[_0x85f2('0x4')](_0x489738[_0x85f2('0x5')],_0x4cb0bc),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x489738[_0x85f2('0x6')])==='number'&&parseInt(_0x489738[_0x85f2('0x6')])>=0x1&&parseInt(_0x489738[_0x85f2('0x6')])<=0xa?parseInt(_0x489738[_0x85f2('0x6')])*0x3e8:0x5*0x3e8};try{_0x382379['headers']=_0x489738[_0x85f2('0x7')]?JSON[_0x85f2('0x8')](Mustache[_0x85f2('0x4')](_0x489738[_0x85f2('0x7')],_0x4cb0bc)):{};}catch(_0x301ec1){logger['error'](_0x301ec1[_0x85f2('0x9')]);}switch(_0x489738['data1'][_0x85f2('0xa')]()){case _0x85f2('0xb'):case'DELETE':_0x5c128c=null;_0x382379['qs']=_0x4cb0bc;break;case _0x85f2('0xc'):case _0x85f2('0xd'):if(_0x489738['data7']){try{_0x5c128c=JSON[_0x85f2('0x8')](Mustache[_0x85f2('0x4')](_0x489738[_0x85f2('0xe')],_0x4cb0bc));_0x382379[_0x85f2('0xf')]=_0x5c128c;}catch(_0x3dbf92){logger[_0x85f2('0x10')](_0x3dbf92[_0x85f2('0x9')]);logger['error'](_0x85f2('0x11'));}}else{_0x5c128c=_0x4cb0bc;_0x382379['body']=_0x5c128c;}break;}logger['info'](util[_0x85f2('0x12')](_0x85f2('0x13'),_0x489738[_0x85f2('0x14')],_0x489738['data2'],JSON['stringify'](_0x382379)));rp(_0x382379)[_0x85f2('0x15')](function(_0x462a7a){_0x5c128c=!_[_0x85f2('0x16')](_0x5c128c)?_0x85f2('0x17')+_0x5c128c:'';_0x15a870=typeof _0x462a7a[_0x85f2('0xf')]===_0x85f2('0x18')?JSON[_0x85f2('0x19')](_0x462a7a['body']):_0x462a7a[_0x85f2('0xf')];logger[_0x85f2('0x1a')](util[_0x85f2('0x12')](_0x85f2('0x1b'),_0x489738[_0x85f2('0x14')],_0x489738[_0x85f2('0x5')],_0x462a7a[_0x85f2('0x1c')],_0x15a870));})['catch'](function(_0xb9dce2){logger['error'](util[_0x85f2('0x12')](_0x85f2('0x1d'),_0x489738[_0x85f2('0x14')],_0x489738[_0x85f2('0x5')],_0xb9dce2[_0x85f2('0x1c')],_0xb9dce2[_0x85f2('0x1e')],_0xb9dce2['message']));});};
\ No newline at end of file
index 1929415..d903469 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02a2=['debug','rpc','error','message','result','jayson/promise','bluebird','../../config/logger','routing','http','Request','request','then'];(function(_0x2cf19f,_0x21fc95){var _0x36bcd2=function(_0x1136bf){while(--_0x1136bf){_0x2cf19f['push'](_0x2cf19f['shift']());}};_0x36bcd2(++_0x21fc95);}(_0x02a2,0x17e));var _0x202a=function(_0x1e1b8a,_0x37df03){_0x1e1b8a=_0x1e1b8a-0x0;var _0x390a6f=_0x02a2[_0x1e1b8a];return _0x390a6f;};'use strict';var jayson=require(_0x202a('0x0'));var BPromise=require(_0x202a('0x1'));var logger=require(_0x202a('0x2'))(_0x202a('0x3'));var client=jayson['client'][_0x202a('0x4')]({'port':0x2329});client[_0x202a('0x5')]=function(_0x395141,_0x479014){return new BPromise(function(_0x3d3e6d,_0x21bca5){return client[_0x202a('0x6')](_0x395141,_0x479014)[_0x202a('0x7')](function(_0x5e1079){logger[_0x202a('0x8')](_0x202a('0x9'),_0x202a('0x3'),_0x395141,_0x479014,_0x5e1079);if(_0x5e1079[_0x202a('0xa')]){logger[_0x202a('0xa')](_0x202a('0x9'),_0x202a('0x3'),_0x395141,_0x5e1079['error']['message'],_0x479014);return _0x21bca5(_0x5e1079['error'][_0x202a('0xb')]);}else{return _0x3d3e6d(_0x5e1079[_0x202a('0xc')]);}})['catch'](function(_0x403ed6){logger[_0x202a('0xa')](_0x202a('0x9'),_0x202a('0x3'),_0x395141,_0x403ed6,_0x479014);return _0x21bca5(_0x403ed6);});});};module['exports']=client;
\ No newline at end of file
+var _0x6a3d=['Request','then','debug','rpc','error','message','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','http'];(function(_0x40388e,_0x31166f){var _0xcb1fc6=function(_0x3586cd){while(--_0x3586cd){_0x40388e['push'](_0x40388e['shift']());}};_0xcb1fc6(++_0x31166f);}(_0x6a3d,0x166));var _0xd6a3=function(_0x29e3b6,_0x40b0b4){_0x29e3b6=_0x29e3b6-0x0;var _0x55d4b0=_0x6a3d[_0x29e3b6];return _0x55d4b0;};'use strict';var jayson=require(_0xd6a3('0x0'));var BPromise=require(_0xd6a3('0x1'));var logger=require(_0xd6a3('0x2'))(_0xd6a3('0x3'));var client=jayson[_0xd6a3('0x4')][_0xd6a3('0x5')]({'port':0x2329});client[_0xd6a3('0x6')]=function(_0x3d4435,_0x4de1a5){return new BPromise(function(_0x247014,_0x3d19c0){return client['request'](_0x3d4435,_0x4de1a5)[_0xd6a3('0x7')](function(_0x29d773){logger[_0xd6a3('0x8')](_0xd6a3('0x9'),'routing',_0x3d4435,_0x4de1a5,_0x29d773);if(_0x29d773[_0xd6a3('0xa')]){logger['error'](_0xd6a3('0x9'),'routing',_0x3d4435,_0x29d773['error'][_0xd6a3('0xb')],_0x4de1a5);return _0x3d19c0(_0x29d773[_0xd6a3('0xa')][_0xd6a3('0xb')]);}else{return _0x247014(_0x29d773['result']);}})[_0xd6a3('0xc')](function(_0x58f567){logger[_0xd6a3('0xa')](_0xd6a3('0x9'),_0xd6a3('0x3'),_0x3d4435,_0x58f567,_0x4de1a5);return _0x3d19c0(_0x58f567);});});};module[_0xd6a3('0xd')]=client;
\ No newline at end of file
index 987f598..5fec20f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ce0=['resolve','then','getMailAccounts','initMailAccounts','mailAccounts','getSettings','loginMailFrequency','catch','error','Email\x20service\x20initialization','./server','./rpc/mailAccount','./rpc/setting','email'];(function(_0x33a16a,_0x37d05e){var _0x5e8ff8=function(_0x48b783){while(--_0x48b783){_0x33a16a['push'](_0x33a16a['shift']());}};_0x5e8ff8(++_0x37d05e);}(_0x0ce0,0x88));var _0x00ce=function(_0x337eeb,_0x4f17e9){_0x337eeb=_0x337eeb-0x0;var _0x2dfdd8=_0x0ce0[_0x337eeb];return _0x2dfdd8;};'use strict';var server=require(_0x00ce('0x0'));var Realtime=require('./realtime');var EmailChannel=require('./lib/email');var mailAccount=require(_0x00ce('0x1'));var setting=require(_0x00ce('0x2'));var logger=require('../../config/logger')(_0x00ce('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x00ce('0x4')]()[_0x00ce('0x5')](mailAccount[_0x00ce('0x6')]())[_0x00ce('0x5')](realtime[_0x00ce('0x7')]())[_0x00ce('0x5')](function(){email['refresh'](realtime[_0x00ce('0x8')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0x00ce('0x5')](function(){return initRealtime();})[_0x00ce('0x5')](function(){return setting[_0x00ce('0x9')]();})['then'](function(_0x1c6329){return setInterval(initRealtime,_0x1c6329[_0x00ce('0xa')]*0x3e8);})[_0x00ce('0xb')](function(_0x5e161d){logger[_0x00ce('0xc')](_0x00ce('0xd'),_0x5e161d);});}main();
\ No newline at end of file
+var _0xc7bf=['Email\x20service\x20initialization','./server','./lib/email','./rpc/setting','../../config/logger','resolve','then','getMailAccounts','initMailAccounts','listen','loginMailFrequency','error'];(function(_0x13896d,_0x231278){var _0x156480=function(_0x203cd1){while(--_0x203cd1){_0x13896d['push'](_0x13896d['shift']());}};_0x156480(++_0x231278);}(_0xc7bf,0xf1));var _0xfc7b=function(_0x3ccedd,_0x3abd9f){_0x3ccedd=_0x3ccedd-0x0;var _0x1be54b=_0xc7bf[_0x3ccedd];return _0x1be54b;};'use strict';var server=require(_0xfc7b('0x0'));var Realtime=require('./realtime');var EmailChannel=require(_0xfc7b('0x1'));var mailAccount=require('./rpc/mailAccount');var setting=require(_0xfc7b('0x2'));var logger=require(_0xfc7b('0x3'))('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xfc7b('0x4')]()[_0xfc7b('0x5')](mailAccount[_0xfc7b('0x6')]())['then'](realtime[_0xfc7b('0x7')]())['then'](function(){email['refresh'](realtime['mailAccounts']);return realtime;});}function main(){return server[_0xfc7b('0x8')](realtime,email)[_0xfc7b('0x5')](function(){return initRealtime();})[_0xfc7b('0x5')](function(){return setting['getSettings']();})[_0xfc7b('0x5')](function(_0x23a236){return setInterval(initRealtime,_0x23a236[_0xfc7b('0x9')]*0x3e8);})['catch'](function(_0x1afeaf){logger[_0xfc7b('0xa')](_0xfc7b('0xb'),_0x1afeaf);});}main();
\ No newline at end of file
index 0b29987..9f53078 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1adf=['bluebird','md5','../../../config/environment','../../../config/logger','email','redis','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','name','key','active','status','Imap','messageStatus','total','stringify','mailAccount:update','refresh','hasOwnProperty','service','provider','custom','box','handleImapBox','bind','end','handleImapEnd','error','handleImapError','isNil','connected','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','from','notify','then','info','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','verifySmtp','Smtp','lastSync','verify','verified','emit','exports','lodash','moment'];(function(_0x4987bc,_0x487728){var _0x4c5a95=function(_0x1eea8a){while(--_0x1eea8a){_0x4987bc['push'](_0x4987bc['shift']());}};_0x4c5a95(++_0x487728);}(_0x1adf,0xa9));var _0xf1ad=function(_0x49f6ae,_0x2f75b6){_0x49f6ae=_0x49f6ae-0x0;var _0x3e4d37=_0x1adf[_0x49f6ae];return _0x3e4d37;};'use strict';var _=require(_0xf1ad('0x0'));var moment=require(_0xf1ad('0x1'));var BPromise=require(_0xf1ad('0x2'));var md5=require(_0xf1ad('0x3'));var Redis=require('ioredis');var config=require(_0xf1ad('0x4'));var logger=require(_0xf1ad('0x5'))(_0xf1ad('0x6'));config[_0xf1ad('0x7')]=_['defaults'](config[_0xf1ad('0x7')],{'host':_0xf1ad('0x8'),'port':0x18eb});var io=require(_0xf1ad('0x9'))(new Redis(config[_0xf1ad('0x7')]));var EmailImap=require(_0xf1ad('0xa'));var EmailSmtp=require(_0xf1ad('0xb'));var mailAccount=require(_0xf1ad('0xc'));var md5Accounts={};function EmailChannel(_0x122c73){logger['info'](_0xf1ad('0xd'));this[_0xf1ad('0xe')]=_0x122c73['mailAccounts'];this[_0xf1ad('0xf')]={};this[_0xf1ad('0x10')]=new EmailSmtp();}EmailChannel[_0xf1ad('0x11')]['emit']=function(_0xeef7e6){var _0xd23652=this[_0xf1ad('0xe')][_0xeef7e6];var _0x17cdbc={'id':_0xd23652['id'],'name':_0xd23652[_0xf1ad('0x12')],'key':_0xd23652[_0xf1ad('0x13')],'active':_0xd23652[_0xf1ad('0x14')],'Imap':{'status':_0xd23652['Imap'][_0xf1ad('0x15')],'messageStatus':_0xd23652[_0xf1ad('0x16')][_0xf1ad('0x17')],'total':_0xd23652[_0xf1ad('0x16')][_0xf1ad('0x18')]}};if(_['isNil'](md5Accounts[_0xeef7e6])){md5Accounts[_0xeef7e6]={};}var _0x3dfe35=md5(JSON[_0xf1ad('0x19')](_0x17cdbc));if(md5Accounts[_0xeef7e6][_0xf1ad('0x3')]!==_0x3dfe35){md5Accounts[_0xeef7e6]['md5']=_0x3dfe35;io['emit'](_0xf1ad('0x1a'),_0x17cdbc);}};EmailChannel[_0xf1ad('0x11')][_0xf1ad('0x1b')]=function(_0x2c5a41){for(var _0x40bff7 in _0x2c5a41){if(_0x2c5a41[_0xf1ad('0x1c')](_0x40bff7)){if(_0x2c5a41[_0x40bff7][_0xf1ad('0x16')]&&_0x2c5a41[_0x40bff7][_0xf1ad('0x14')]){var _0x2667d3=_0x2c5a41[_0x40bff7]['Imap'];if(!_0x2667d3[_0xf1ad('0x1d')]&&_0x2c5a41[_0x40bff7][_0xf1ad('0x1e')]!==_0xf1ad('0x1f'))_0x2667d3['service']=_0x2c5a41[_0x40bff7]['provider'];if(!this[_0xf1ad('0xf')]['hasOwnProperty'](_0x2667d3['id'])){this[_0xf1ad('0xf')][_0x2667d3['id']]=new EmailImap(_0x2667d3,_0x2c5a41[_0x40bff7][_0xf1ad('0x6')]);this[_0xf1ad('0xf')][_0x2667d3['id']]['on'](_0xf1ad('0x20'),this[_0xf1ad('0x21')]['bind'](this,_0x40bff7));this[_0xf1ad('0xf')][_0x2667d3['id']]['on']('email',this['handleImapEmail'][_0xf1ad('0x22')](this,_0x40bff7));this['imapAccounts'][_0x2667d3['id']]['on'](_0xf1ad('0x23'),this[_0xf1ad('0x24')]['bind'](this,_0x40bff7));this[_0xf1ad('0xf')][_0x2667d3['id']]['on'](_0xf1ad('0x25'),this[_0xf1ad('0x26')][_0xf1ad('0x22')](this,_0x40bff7));}}else{if(_[_0xf1ad('0x27')](this[_0xf1ad('0xe')][_0x40bff7]['Imap'])){this['mailAccounts'][_0x40bff7]['Imap']={};}this['mailAccounts'][_0x40bff7][_0xf1ad('0x16')]['status']='disabled';this['mailAccounts'][_0x40bff7][_0xf1ad('0x16')][_0xf1ad('0x17')]='';this['emit'](_0x40bff7);}}}};EmailChannel[_0xf1ad('0x11')]['handleImapBox']=function(_0x41df61,_0x41935e){if(this[_0xf1ad('0xe')][_0x41df61]){this[_0xf1ad('0xe')][_0x41df61][_0xf1ad('0x16')]['status']=_0xf1ad('0x28');this[_0xf1ad('0xe')][_0x41df61]['Imap'][_0xf1ad('0x17')]=_0x41935e[_0xf1ad('0x12')];if(_0x41935e['messages']){this[_0xf1ad('0xe')][_0x41df61][_0xf1ad('0x16')]['total']=_0x41935e['messages'][_0xf1ad('0x18')];}return this['emit'](_0x41df61);}};EmailChannel[_0xf1ad('0x11')]['handleImapEmail']=function(_0x1eb573,_0x90ca40){logger['info'](_0xf1ad('0x29'),_0x90ca40[_0xf1ad('0x2a')],_0x90ca40['lastName'],_0x90ca40[_0xf1ad('0x2b')],_0x1eb573);if(this[_0xf1ad('0xe')][_0x1eb573]){return mailAccount[_0xf1ad('0x2c')](_0x1eb573,_0x90ca40)[_0xf1ad('0x2d')](function(_0x228de0){if(_0x228de0){logger[_0xf1ad('0x2e')](_0xf1ad('0x2f'));}})[_0xf1ad('0x30')](function(_0xffbe24){logger[_0xf1ad('0x25')](_0xf1ad('0x31'),JSON[_0xf1ad('0x19')](_0xffbe24));});}};EmailChannel[_0xf1ad('0x11')][_0xf1ad('0x24')]=function(_0x362be1){if(this[_0xf1ad('0xe')][_0x362be1]&&this[_0xf1ad('0xe')][_0x362be1][_0xf1ad('0x16')]){if(this['imapAccounts'][this['mailAccounts'][_0x362be1][_0xf1ad('0x16')]['id']]){delete this[_0xf1ad('0xf')][this[_0xf1ad('0xe')][_0x362be1][_0xf1ad('0x16')]['id']];}this[_0xf1ad('0xe')][_0x362be1][_0xf1ad('0x16')]['lastSync']=moment();this['emit'](_0x362be1);}};EmailChannel[_0xf1ad('0x11')][_0xf1ad('0x26')]=function(_0xb82ce3,_0x2cbbc7){if(this[_0xf1ad('0xe')][_0xb82ce3]){this['mailAccounts'][_0xb82ce3][_0xf1ad('0x16')][_0xf1ad('0x15')]=_0xf1ad('0x25');this[_0xf1ad('0xe')][_0xb82ce3][_0xf1ad('0x16')]['messageStatus']=_0x2cbbc7;return this['emit'](_0xb82ce3);}};EmailChannel['prototype']['sendMail']=function(_0x37be69,_0x23ce4a){return this['smtp']['send'](_0x37be69,_0x23ce4a);};EmailChannel[_0xf1ad('0x11')][_0xf1ad('0x32')]=function(_0x5f35ca){var _0x970d14=this;if(this['mailAccounts'][_0x5f35ca['id']]){if(_['isNil'](this[_0xf1ad('0xe')][_0x5f35ca['id']]['Smtp'])){this[_0xf1ad('0xe')][_0x5f35ca['id']][_0xf1ad('0x33')]={};}this[_0xf1ad('0xe')][_0x5f35ca['id']][_0xf1ad('0x33')][_0xf1ad('0x34')]=moment();return new BPromise(function(_0x2e249e,_0x3df629){return _0x970d14[_0xf1ad('0x10')][_0xf1ad('0x35')](_0x5f35ca)[_0xf1ad('0x2d')](function(_0x229667){_0x970d14[_0xf1ad('0xe')][_0x5f35ca['id']][_0xf1ad('0x33')][_0xf1ad('0x15')]=_0xf1ad('0x36');_0x970d14[_0xf1ad('0xe')][_0x5f35ca['id']][_0xf1ad('0x33')][_0xf1ad('0x17')]='';_0x970d14[_0xf1ad('0x37')](_0x5f35ca['id']);_0x2e249e(_0x229667);})[_0xf1ad('0x30')](function(_0x239916){_0x970d14[_0xf1ad('0xe')][_0x5f35ca['id']][_0xf1ad('0x33')][_0xf1ad('0x15')]=_0xf1ad('0x25');_0x970d14[_0xf1ad('0xe')][_0x5f35ca['id']][_0xf1ad('0x33')][_0xf1ad('0x17')]=_0x239916;_0x970d14[_0xf1ad('0x37')](_0x5f35ca['id']);_0x3df629(_0x239916);});});}return this[_0xf1ad('0x10')][_0xf1ad('0x35')](_0x5f35ca);};module[_0xf1ad('0x38')]=EmailChannel;
\ No newline at end of file
+var _0xc745=['send','verifySmtp','Smtp','verified','exports','lodash','bluebird','md5','ioredis','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap','../rpc/mailAccount','info','start\x20email\x20channel','imapAccounts','smtp','mailAccounts','name','key','active','Imap','status','messageStatus','total','stringify','emit','mailAccount:update','prototype','refresh','provider','custom','box','handleImapBox','bind','handleImapEmail','end','handleImapError','isNil','disabled','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','catch','error','handleImapEnd','lastSync','sendMail'];(function(_0x279840,_0x4d86a3){var _0xc1b84f=function(_0x27b1d8){while(--_0x27b1d8){_0x279840['push'](_0x279840['shift']());}};_0xc1b84f(++_0x4d86a3);}(_0xc745,0x155));var _0x5c74=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xc745[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x5c74('0x0'));var moment=require('moment');var BPromise=require(_0x5c74('0x1'));var md5=require(_0x5c74('0x2'));var Redis=require(_0x5c74('0x3'));var config=require('../../../config/environment');var logger=require(_0x5c74('0x4'))(_0x5c74('0x5'));config[_0x5c74('0x6')]=_[_0x5c74('0x7')](config[_0x5c74('0x6')],{'host':_0x5c74('0x8'),'port':0x18eb});var io=require(_0x5c74('0x9'))(new Redis(config[_0x5c74('0x6')]));var EmailImap=require(_0x5c74('0xa'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x5c74('0xb'));var md5Accounts={};function EmailChannel(_0x22728d){logger[_0x5c74('0xc')](_0x5c74('0xd'));this['mailAccounts']=_0x22728d['mailAccounts'];this[_0x5c74('0xe')]={};this[_0x5c74('0xf')]=new EmailSmtp();}EmailChannel['prototype']['emit']=function(_0x41c51a){var _0x203a3f=this[_0x5c74('0x10')][_0x41c51a];var _0x2fc6d6={'id':_0x203a3f['id'],'name':_0x203a3f[_0x5c74('0x11')],'key':_0x203a3f[_0x5c74('0x12')],'active':_0x203a3f[_0x5c74('0x13')],'Imap':{'status':_0x203a3f[_0x5c74('0x14')][_0x5c74('0x15')],'messageStatus':_0x203a3f['Imap'][_0x5c74('0x16')],'total':_0x203a3f['Imap'][_0x5c74('0x17')]}};if(_['isNil'](md5Accounts[_0x41c51a])){md5Accounts[_0x41c51a]={};}var _0x53163d=md5(JSON[_0x5c74('0x18')](_0x2fc6d6));if(md5Accounts[_0x41c51a][_0x5c74('0x2')]!==_0x53163d){md5Accounts[_0x41c51a][_0x5c74('0x2')]=_0x53163d;io[_0x5c74('0x19')](_0x5c74('0x1a'),_0x2fc6d6);}};EmailChannel[_0x5c74('0x1b')][_0x5c74('0x1c')]=function(_0x3fad77){for(var _0x4efa3c in _0x3fad77){if(_0x3fad77['hasOwnProperty'](_0x4efa3c)){if(_0x3fad77[_0x4efa3c][_0x5c74('0x14')]&&_0x3fad77[_0x4efa3c][_0x5c74('0x13')]){var _0x575e62=_0x3fad77[_0x4efa3c][_0x5c74('0x14')];if(!_0x575e62['service']&&_0x3fad77[_0x4efa3c][_0x5c74('0x1d')]!==_0x5c74('0x1e'))_0x575e62['service']=_0x3fad77[_0x4efa3c]['provider'];if(!this[_0x5c74('0xe')]['hasOwnProperty'](_0x575e62['id'])){this[_0x5c74('0xe')][_0x575e62['id']]=new EmailImap(_0x575e62,_0x3fad77[_0x4efa3c][_0x5c74('0x5')]);this['imapAccounts'][_0x575e62['id']]['on'](_0x5c74('0x1f'),this[_0x5c74('0x20')][_0x5c74('0x21')](this,_0x4efa3c));this[_0x5c74('0xe')][_0x575e62['id']]['on'](_0x5c74('0x5'),this[_0x5c74('0x22')][_0x5c74('0x21')](this,_0x4efa3c));this[_0x5c74('0xe')][_0x575e62['id']]['on'](_0x5c74('0x23'),this['handleImapEnd']['bind'](this,_0x4efa3c));this[_0x5c74('0xe')][_0x575e62['id']]['on']('error',this[_0x5c74('0x24')]['bind'](this,_0x4efa3c));}}else{if(_[_0x5c74('0x25')](this[_0x5c74('0x10')][_0x4efa3c][_0x5c74('0x14')])){this[_0x5c74('0x10')][_0x4efa3c]['Imap']={};}this[_0x5c74('0x10')][_0x4efa3c][_0x5c74('0x14')][_0x5c74('0x15')]=_0x5c74('0x26');this[_0x5c74('0x10')][_0x4efa3c]['Imap'][_0x5c74('0x16')]='';this[_0x5c74('0x19')](_0x4efa3c);}}}};EmailChannel[_0x5c74('0x1b')][_0x5c74('0x20')]=function(_0x2725c5,_0xe710e1){if(this[_0x5c74('0x10')][_0x2725c5]){this[_0x5c74('0x10')][_0x2725c5][_0x5c74('0x14')][_0x5c74('0x15')]='connected';this[_0x5c74('0x10')][_0x2725c5]['Imap'][_0x5c74('0x16')]=_0xe710e1[_0x5c74('0x11')];if(_0xe710e1[_0x5c74('0x27')]){this[_0x5c74('0x10')][_0x2725c5][_0x5c74('0x14')][_0x5c74('0x17')]=_0xe710e1[_0x5c74('0x27')][_0x5c74('0x17')];}return this[_0x5c74('0x19')](_0x2725c5);}};EmailChannel[_0x5c74('0x1b')]['handleImapEmail']=function(_0x14bf15,_0xfa779e){logger[_0x5c74('0xc')](_0x5c74('0x28'),_0xfa779e[_0x5c74('0x29')],_0xfa779e[_0x5c74('0x2a')],_0xfa779e[_0x5c74('0x2b')],_0x14bf15);if(this[_0x5c74('0x10')][_0x14bf15]){return mailAccount[_0x5c74('0x2c')](_0x14bf15,_0xfa779e)[_0x5c74('0x2d')](function(_0x369fca){if(_0x369fca){logger[_0x5c74('0xc')]('Mail\x20accepted\x20from\x20routing');}})[_0x5c74('0x2e')](function(_0x2eb02e){logger[_0x5c74('0x2f')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x5c74('0x18')](_0x2eb02e));});}};EmailChannel[_0x5c74('0x1b')][_0x5c74('0x30')]=function(_0x1df965){if(this['mailAccounts'][_0x1df965]&&this[_0x5c74('0x10')][_0x1df965]['Imap']){if(this[_0x5c74('0xe')][this[_0x5c74('0x10')][_0x1df965][_0x5c74('0x14')]['id']]){delete this[_0x5c74('0xe')][this['mailAccounts'][_0x1df965][_0x5c74('0x14')]['id']];}this[_0x5c74('0x10')][_0x1df965]['Imap'][_0x5c74('0x31')]=moment();this[_0x5c74('0x19')](_0x1df965);}};EmailChannel[_0x5c74('0x1b')][_0x5c74('0x24')]=function(_0x304d5a,_0x1434a8){if(this[_0x5c74('0x10')][_0x304d5a]){this[_0x5c74('0x10')][_0x304d5a][_0x5c74('0x14')][_0x5c74('0x15')]=_0x5c74('0x2f');this[_0x5c74('0x10')][_0x304d5a][_0x5c74('0x14')][_0x5c74('0x16')]=_0x1434a8;return this[_0x5c74('0x19')](_0x304d5a);}};EmailChannel['prototype'][_0x5c74('0x32')]=function(_0x5c12d9,_0x432dfb){return this['smtp'][_0x5c74('0x33')](_0x5c12d9,_0x432dfb);};EmailChannel['prototype'][_0x5c74('0x34')]=function(_0x475866){var _0x39c710=this;if(this[_0x5c74('0x10')][_0x475866['id']]){if(_['isNil'](this['mailAccounts'][_0x475866['id']]['Smtp'])){this[_0x5c74('0x10')][_0x475866['id']][_0x5c74('0x35')]={};}this[_0x5c74('0x10')][_0x475866['id']]['Smtp'][_0x5c74('0x31')]=moment();return new BPromise(function(_0x2a81c8,_0x1d462c){return _0x39c710[_0x5c74('0xf')]['verify'](_0x475866)[_0x5c74('0x2d')](function(_0x29b388){_0x39c710[_0x5c74('0x10')][_0x475866['id']][_0x5c74('0x35')][_0x5c74('0x15')]=_0x5c74('0x36');_0x39c710[_0x5c74('0x10')][_0x475866['id']][_0x5c74('0x35')]['messageStatus']='';_0x39c710[_0x5c74('0x19')](_0x475866['id']);_0x2a81c8(_0x29b388);})[_0x5c74('0x2e')](function(_0x572048){_0x39c710[_0x5c74('0x10')][_0x475866['id']]['Smtp'][_0x5c74('0x15')]=_0x5c74('0x2f');_0x39c710['mailAccounts'][_0x475866['id']][_0x5c74('0x35')][_0x5c74('0x16')]=_0x572048;_0x39c710[_0x5c74('0x19')](_0x475866['id']);_0x1d462c(_0x572048);});});}return this[_0x5c74('0xf')]['verify'](_0x475866);};module[_0x5c74('0x37')]=EmailChannel;
\ No newline at end of file
index b10b9f1..b3e6bd8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c60=['service','anonymous@xcally.com','handleReady','handleOpenBox','emit','box','handleCloseBox','readUnseen','search','length','fetch','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','handleSimpleParser','handleMessageEnd','parser','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','util','imap','mailparser','iconv','../../../config/logger','email','mailbox','INBOX','account','once','end','handleEnd','error','handleError','bind','connect','inherits','prototype','connTimeout','authTimeout','isNil','authentication','user','password','host','port','tls','xoauth2','generateXOAuth2Token','getHost'];(function(_0x16539a,_0x31409a){var _0x200796=function(_0xfe7803){while(--_0xfe7803){_0x16539a['push'](_0x16539a['shift']());}};_0x200796(++_0x31409a);}(_0x4c60,0xc1));var _0x04c6=function(_0x1a5551,_0xdc993e){_0x1a5551=_0x1a5551-0x0;var _0x2a9f85=_0x4c60[_0x1a5551];return _0x2a9f85;};'use strict';var _=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var Imap=require(_0x04c6('0x2'));var simpleParser=require(_0x04c6('0x3'))['simpleParser'];var Iconv=require(_0x04c6('0x4'))['Iconv'];var EventEmitter=require('events')['EventEmitter'];var utils=require('./utils');var logger=require(_0x04c6('0x5'))(_0x04c6('0x6'));function EmailImap(_0x2054da,_0x12bd5d){this[_0x04c6('0x7')]=_0x04c6('0x8');this[_0x04c6('0x9')]=this['getAccount'](_0x2054da,_0x12bd5d);this[_0x04c6('0x2')]=new Imap(this[_0x04c6('0x9')]);this[_0x04c6('0x2')][_0x04c6('0xa')]('ready',this['handleReady']['bind'](this));this[_0x04c6('0x2')]['once'](_0x04c6('0xb'),this[_0x04c6('0xc')]['bind'](this));this[_0x04c6('0x2')]['on'](_0x04c6('0xd'),this[_0x04c6('0xe')][_0x04c6('0xf')](this));this['imap'][_0x04c6('0x10')]();}util[_0x04c6('0x11')](EmailImap,EventEmitter);EmailImap[_0x04c6('0x12')]['getAccount']=function(_0x12d1c5,_0x15cbe0){var _0x28632e={'connTimeout':_0x12d1c5[_0x04c6('0x13')]?_0x12d1c5[_0x04c6('0x13')]*0x3e8:0x2710,'authTimeout':_0x12d1c5[_0x04c6('0x14')]?_0x12d1c5[_0x04c6('0x14')]*0x3e8:0x1388};if(_[_0x04c6('0x15')](_0x12d1c5['service'])){if(_0x12d1c5[_0x04c6('0x16')]){_0x28632e[_0x04c6('0x17')]=_0x12d1c5[_0x04c6('0x17')];_0x28632e[_0x04c6('0x18')]=_0x12d1c5[_0x04c6('0x18')];}_0x28632e[_0x04c6('0x19')]=_0x12d1c5[_0x04c6('0x19')];_0x28632e[_0x04c6('0x1a')]=_0x12d1c5['port']||0x3e1;if(_0x12d1c5[_0x04c6('0x1b')]){_0x28632e[_0x04c6('0x1b')]=!![];}else{_0x28632e[_0x04c6('0x1b')]=![];_0x28632e['autotls']='required';}}else{if(_0x12d1c5['modernAuthentication']){_0x28632e[_0x04c6('0x1c')]=utils[_0x04c6('0x1d')](_0x12d1c5['CloudProvider']['data5'],_0x12d1c5[_0x04c6('0x17')]);_0x28632e[_0x04c6('0x17')]=_0x12d1c5[_0x04c6('0x17')];}else{_0x28632e['user']=_0x12d1c5[_0x04c6('0x17')];_0x28632e[_0x04c6('0x18')]=_0x12d1c5[_0x04c6('0x18')];}_0x28632e['host']=utils[_0x04c6('0x1e')](_0x12d1c5[_0x04c6('0x1f')]);_0x28632e['port']=0x3e1;_0x28632e['tls']=!![];}_0x28632e['email']=_0x15cbe0||_0x12d1c5[_0x04c6('0x17')]||_0x04c6('0x20');return _0x28632e;};EmailImap[_0x04c6('0x12')][_0x04c6('0x21')]=function(){this[_0x04c6('0x2')]['openBox'](this['mailbox'],![],this[_0x04c6('0x22')][_0x04c6('0xf')](this));};EmailImap[_0x04c6('0x12')][_0x04c6('0x22')]=function(_0x4f256f,_0x1f5aaf){if(_0x4f256f){this['handleError'](_0x4f256f,!![]);}else{this[_0x04c6('0x23')](_0x04c6('0x24'),_0x1f5aaf);this['readUnseen']();}};EmailImap[_0x04c6('0x12')][_0x04c6('0x25')]=function(_0x5f1331){if(_0x5f1331){this['handleError'](_0x5f1331,!![]);}else{this[_0x04c6('0x2')][_0x04c6('0xb')]();}};EmailImap[_0x04c6('0x12')][_0x04c6('0x26')]=function(){this[_0x04c6('0x2')][_0x04c6('0x27')](['UNSEEN'],this['handleReadUnseen']['bind'](this));};EmailImap[_0x04c6('0x12')]['handleReadUnseen']=function(_0x1e76e2,_0x2f4e5c){if(_0x1e76e2){this['handleError'](_0x1e76e2,!![]);}else{if(_0x2f4e5c[_0x04c6('0x28')]){try{var _0x36f2af=this[_0x04c6('0x2')][_0x04c6('0x29')](_0x2f4e5c,{'bodies':'','markSeen':!![]});_0x36f2af['on']('message',this[_0x04c6('0x2a')][_0x04c6('0xf')](this));_0x36f2af[_0x04c6('0xa')](_0x04c6('0xd'),this[_0x04c6('0x2b')][_0x04c6('0xf')](this));_0x36f2af[_0x04c6('0xa')](_0x04c6('0xb'),this[_0x04c6('0x2c')][_0x04c6('0xf')](this));}catch(_0x3294af){logger[_0x04c6('0xd')](_0x3294af);}}else{this[_0x04c6('0x2')][_0x04c6('0x2d')](!![],this[_0x04c6('0x25')]['bind'](this));}}};EmailImap[_0x04c6('0x12')][_0x04c6('0x2a')]=function(_0x332811){_0x332811['on'](_0x04c6('0x2e'),this['handleMessageBody'][_0x04c6('0xf')](this));_0x332811[_0x04c6('0xa')]('attributes',this['handleMessageAttributes']['bind'](this));_0x332811[_0x04c6('0xa')](_0x04c6('0xb'),this['handleMessageEnd'][_0x04c6('0xf')](this));};EmailImap['prototype'][_0x04c6('0x2f')]=function(_0x1373ca){simpleParser(_0x1373ca,{'Iconv':Iconv},this[_0x04c6('0x30')][_0x04c6('0xf')](this));};EmailImap['prototype']['handleMessageAttributes']=function(){};EmailImap[_0x04c6('0x12')][_0x04c6('0x31')]=function(){};EmailImap['prototype'][_0x04c6('0x30')]=function(_0x5ce4b0,_0x501d7d){if(_0x5ce4b0){logger[_0x04c6('0xd')](_0x5ce4b0);}else{var _0x5aede6=this;utils[_0x04c6('0x32')](this[_0x04c6('0x9')],_0x501d7d,function(_0x59ca18){_0x5aede6[_0x04c6('0x23')]('email',_0x59ca18);});}};EmailImap[_0x04c6('0x12')][_0x04c6('0x2c')]=function(){this[_0x04c6('0x2')][_0x04c6('0x2d')](!![],this[_0x04c6('0x25')]['bind'](this));};EmailImap[_0x04c6('0x12')]['handleFetchError']=function(_0x74f1d1){this['handleError'](_0x74f1d1);this[_0x04c6('0x2')][_0x04c6('0x2d')](!![],this[_0x04c6('0x25')][_0x04c6('0xf')](this));};EmailImap[_0x04c6('0x12')][_0x04c6('0xc')]=function(){this[_0x04c6('0x23')]('end');};EmailImap[_0x04c6('0x12')]['handleError']=function(_0xdb4ecd,_0x551b43){logger['error'](_0x04c6('0xe'),this['account'][_0x04c6('0x6')],JSON[_0x04c6('0x33')](_0xdb4ecd));var _0x15995b='';if(_0xdb4ecd){if(_0xdb4ecd['textCode']){_0x15995b=_0xdb4ecd[_0x04c6('0x34')];}else{for(var _0x19654 in _0xdb4ecd){if(_0xdb4ecd[_0x04c6('0x35')](_0x19654)){_0x15995b+=_[_0x04c6('0x36')](_0x19654)+':\x20'+_0xdb4ecd[_0x19654]+'\x0a';}}}}if(_0x551b43){this[_0x04c6('0x2')][_0x04c6('0xb')]();}else{this[_0x04c6('0x23')]('error',_0x15995b);this['emit'](_0x04c6('0xb'));}};module[_0x04c6('0x37')]=EmailImap;
\ No newline at end of file
+var _0x4819=['host','getHost','anonymous@xcally.com','openBox','handleOpenBox','emit','readUnseen','handleCloseBox','search','handleReadUnseen','fetch','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleSimpleParser','parser','email','stringify','textCode','upperFirst','util','imap','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','INBOX','account','getAccount','once','handleReady','end','handleEnd','bind','error','handleError','inherits','prototype','connTimeout','authTimeout','service','user','password','port','tls','autotls','required','modernAuthentication','xoauth2','CloudProvider','data5'];(function(_0x3ce86f,_0x312a9b){var _0x7a93ca=function(_0x4132ea){while(--_0x4132ea){_0x3ce86f['push'](_0x3ce86f['shift']());}};_0x7a93ca(++_0x312a9b);}(_0x4819,0xcd));var _0x9481=function(_0x95975e,_0x51412c){_0x95975e=_0x95975e-0x0;var _0x5d4933=_0x4819[_0x95975e];return _0x5d4933;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var Imap=require(_0x9481('0x1'));var simpleParser=require(_0x9481('0x2'))[_0x9481('0x3')];var Iconv=require(_0x9481('0x4'))[_0x9481('0x5')];var EventEmitter=require(_0x9481('0x6'))[_0x9481('0x7')];var utils=require(_0x9481('0x8'));var logger=require(_0x9481('0x9'))('email');function EmailImap(_0x4d9e3a,_0x5def07){this['mailbox']=_0x9481('0xa');this[_0x9481('0xb')]=this[_0x9481('0xc')](_0x4d9e3a,_0x5def07);this[_0x9481('0x1')]=new Imap(this[_0x9481('0xb')]);this['imap'][_0x9481('0xd')]('ready',this[_0x9481('0xe')]['bind'](this));this[_0x9481('0x1')][_0x9481('0xd')](_0x9481('0xf'),this[_0x9481('0x10')][_0x9481('0x11')](this));this[_0x9481('0x1')]['on'](_0x9481('0x12'),this[_0x9481('0x13')][_0x9481('0x11')](this));this['imap']['connect']();}util[_0x9481('0x14')](EmailImap,EventEmitter);EmailImap[_0x9481('0x15')][_0x9481('0xc')]=function(_0x28fcb6,_0x3d23c2){var _0xc7a0b5={'connTimeout':_0x28fcb6[_0x9481('0x16')]?_0x28fcb6['connTimeout']*0x3e8:0x2710,'authTimeout':_0x28fcb6[_0x9481('0x17')]?_0x28fcb6[_0x9481('0x17')]*0x3e8:0x1388};if(_['isNil'](_0x28fcb6[_0x9481('0x18')])){if(_0x28fcb6['authentication']){_0xc7a0b5[_0x9481('0x19')]=_0x28fcb6[_0x9481('0x19')];_0xc7a0b5[_0x9481('0x1a')]=_0x28fcb6[_0x9481('0x1a')];}_0xc7a0b5['host']=_0x28fcb6['host'];_0xc7a0b5[_0x9481('0x1b')]=_0x28fcb6['port']||0x3e1;if(_0x28fcb6['tls']){_0xc7a0b5[_0x9481('0x1c')]=!![];}else{_0xc7a0b5[_0x9481('0x1c')]=![];_0xc7a0b5[_0x9481('0x1d')]=_0x9481('0x1e');}}else{if(_0x28fcb6[_0x9481('0x1f')]){_0xc7a0b5[_0x9481('0x20')]=utils['generateXOAuth2Token'](_0x28fcb6[_0x9481('0x21')][_0x9481('0x22')],_0x28fcb6[_0x9481('0x19')]);_0xc7a0b5[_0x9481('0x19')]=_0x28fcb6[_0x9481('0x19')];}else{_0xc7a0b5['user']=_0x28fcb6[_0x9481('0x19')];_0xc7a0b5[_0x9481('0x1a')]=_0x28fcb6['password'];}_0xc7a0b5[_0x9481('0x23')]=utils[_0x9481('0x24')](_0x28fcb6[_0x9481('0x18')]);_0xc7a0b5[_0x9481('0x1b')]=0x3e1;_0xc7a0b5[_0x9481('0x1c')]=!![];}_0xc7a0b5['email']=_0x3d23c2||_0x28fcb6[_0x9481('0x19')]||_0x9481('0x25');return _0xc7a0b5;};EmailImap['prototype']['handleReady']=function(){this[_0x9481('0x1')][_0x9481('0x26')](this['mailbox'],![],this[_0x9481('0x27')][_0x9481('0x11')](this));};EmailImap[_0x9481('0x15')][_0x9481('0x27')]=function(_0x5a1300,_0x14f03e){if(_0x5a1300){this[_0x9481('0x13')](_0x5a1300,!![]);}else{this[_0x9481('0x28')]('box',_0x14f03e);this[_0x9481('0x29')]();}};EmailImap['prototype'][_0x9481('0x2a')]=function(_0xe153ab){if(_0xe153ab){this[_0x9481('0x13')](_0xe153ab,!![]);}else{this[_0x9481('0x1')][_0x9481('0xf')]();}};EmailImap['prototype'][_0x9481('0x29')]=function(){this[_0x9481('0x1')][_0x9481('0x2b')](['UNSEEN'],this['handleReadUnseen'][_0x9481('0x11')](this));};EmailImap[_0x9481('0x15')][_0x9481('0x2c')]=function(_0x2b33f8,_0x5d9926){if(_0x2b33f8){this['handleError'](_0x2b33f8,!![]);}else{if(_0x5d9926['length']){try{var _0x29e6b6=this['imap'][_0x9481('0x2d')](_0x5d9926,{'bodies':'','markSeen':!![]});_0x29e6b6['on']('message',this[_0x9481('0x2e')][_0x9481('0x11')](this));_0x29e6b6[_0x9481('0xd')](_0x9481('0x12'),this[_0x9481('0x2f')]['bind'](this));_0x29e6b6[_0x9481('0xd')](_0x9481('0xf'),this[_0x9481('0x30')]['bind'](this));}catch(_0x30063f){logger[_0x9481('0x12')](_0x30063f);}}else{this[_0x9481('0x1')][_0x9481('0x31')](!![],this[_0x9481('0x2a')][_0x9481('0x11')](this));}}};EmailImap['prototype'][_0x9481('0x2e')]=function(_0x53af85){_0x53af85['on'](_0x9481('0x32'),this[_0x9481('0x33')][_0x9481('0x11')](this));_0x53af85[_0x9481('0xd')](_0x9481('0x34'),this[_0x9481('0x35')]['bind'](this));_0x53af85[_0x9481('0xd')](_0x9481('0xf'),this['handleMessageEnd']['bind'](this));};EmailImap[_0x9481('0x15')]['handleMessageBody']=function(_0x224b88){simpleParser(_0x224b88,{'Iconv':Iconv},this[_0x9481('0x36')][_0x9481('0x11')](this));};EmailImap[_0x9481('0x15')]['handleMessageAttributes']=function(){};EmailImap[_0x9481('0x15')]['handleMessageEnd']=function(){};EmailImap[_0x9481('0x15')]['handleSimpleParser']=function(_0x2ce972,_0x4d6a13){if(_0x2ce972){logger[_0x9481('0x12')](_0x2ce972);}else{var _0x22e916=this;utils[_0x9481('0x37')](this[_0x9481('0xb')],_0x4d6a13,function(_0x97dc3e){_0x22e916[_0x9481('0x28')](_0x9481('0x38'),_0x97dc3e);});}};EmailImap['prototype'][_0x9481('0x30')]=function(){this[_0x9481('0x1')][_0x9481('0x31')](!![],this[_0x9481('0x2a')][_0x9481('0x11')](this));};EmailImap[_0x9481('0x15')][_0x9481('0x2f')]=function(_0x4e081d){this[_0x9481('0x13')](_0x4e081d);this[_0x9481('0x1')]['closeBox'](!![],this[_0x9481('0x2a')][_0x9481('0x11')](this));};EmailImap[_0x9481('0x15')][_0x9481('0x10')]=function(){this[_0x9481('0x28')]('end');};EmailImap[_0x9481('0x15')]['handleError']=function(_0x23811a,_0xcc7f31){logger['error']('handleError',this[_0x9481('0xb')][_0x9481('0x38')],JSON[_0x9481('0x39')](_0x23811a));var _0x4c4caf='';if(_0x23811a){if(_0x23811a[_0x9481('0x3a')]){_0x4c4caf=_0x23811a[_0x9481('0x3a')];}else{for(var _0x5502ad in _0x23811a){if(_0x23811a['hasOwnProperty'](_0x5502ad)){_0x4c4caf+=_[_0x9481('0x3b')](_0x5502ad)+':\x20'+_0x23811a[_0x5502ad]+'\x0a';}}}}if(_0xcc7f31){this['imap'][_0x9481('0xf')]();}else{this[_0x9481('0x28')](_0x9481('0x12'),_0x4c4caf);this[_0x9481('0x28')](_0x9481('0xf'));}};module['exports']=EmailImap;
\ No newline at end of file
index 067e872..be18386 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ce5=['createTransport','use','sendMail','toString','verify','Not\x20verifired','nodemailer','nodemailer-plugin-inline-base64','prototype','send'];(function(_0x1052cd,_0x2dfc73){var _0x29a8df=function(_0x302103){while(--_0x302103){_0x1052cd['push'](_0x1052cd['shift']());}};_0x29a8df(++_0x2dfc73);}(_0x3ce5,0xd8));var _0x53ce=function(_0x43c0a5,_0x27defa){_0x43c0a5=_0x43c0a5-0x0;var _0x173250=_0x3ce5[_0x43c0a5];return _0x173250;};'use strict';var nodemailer=require(_0x53ce('0x0'));var inlineBase64=require(_0x53ce('0x1'));function EmailSmtp(){}EmailSmtp[_0x53ce('0x2')][_0x53ce('0x3')]=function(_0x4cf436,_0x27bd07){return new Promise(function(_0x32bbef,_0x34e528){var _0x191ad3=nodemailer[_0x53ce('0x4')](_0x4cf436);_0x191ad3[_0x53ce('0x5')]('compile',inlineBase64());_0x191ad3[_0x53ce('0x6')](_0x27bd07,function(_0x49f7b4,_0x461f88){if(_0x49f7b4){_0x34e528(_0x49f7b4[_0x53ce('0x7')]());}else{_0x32bbef(_0x461f88);}});});};EmailSmtp[_0x53ce('0x2')][_0x53ce('0x8')]=function(_0x447fd2){return new Promise(function(_0x3d8b69,_0x3d2062){var _0x5163cf=nodemailer[_0x53ce('0x4')](_0x447fd2);_0x5163cf[_0x53ce('0x8')](function(_0x48686d,_0x54ac53){if(_0x48686d){_0x3d2062(_0x48686d[_0x53ce('0x7')]());}else{if(_0x54ac53){_0x3d8b69(_0x54ac53);}else{_0x3d2062(_0x53ce('0x9'));}}});});};module['exports']=EmailSmtp;
\ No newline at end of file
+var _0x9d80=['use','compile','sendMail','toString','prototype','verify','exports','send','createTransport'];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0x9d80,0x1c9));var _0x09d8=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9d80[_0x14add3];return _0x4a174f;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp['prototype'][_0x09d8('0x0')]=function(_0x1d3182,_0x2cba5b){return new Promise(function(_0x8b9147,_0x211efc){var _0x4cdf1c=nodemailer[_0x09d8('0x1')](_0x1d3182);_0x4cdf1c[_0x09d8('0x2')](_0x09d8('0x3'),inlineBase64());_0x4cdf1c[_0x09d8('0x4')](_0x2cba5b,function(_0x99620e,_0x5b9371){if(_0x99620e){_0x211efc(_0x99620e[_0x09d8('0x5')]());}else{_0x8b9147(_0x5b9371);}});});};EmailSmtp[_0x09d8('0x6')][_0x09d8('0x7')]=function(_0x177700){return new Promise(function(_0x573e2a,_0x30cba6){var _0x38afe4=nodemailer[_0x09d8('0x1')](_0x177700);_0x38afe4[_0x09d8('0x7')](function(_0x6085b0,_0x7c0190){if(_0x6085b0){_0x30cba6(_0x6085b0[_0x09d8('0x5')]());}else{if(_0x7c0190){_0x573e2a(_0x7c0190);}else{_0x30cba6('Not\x20verifired');}}});});};module[_0x09d8('0x8')]=EmailSmtp;
\ No newline at end of file
index dd88896..a75905b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1098=['headerLines','Auto-Submitted:\x20auto-replied','Precedence:\x20auto_reply','line','isAutoreply','parser','from','subject','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','parseBuffer','BodyHTML','<p>Empty\x20message</p>','Attachments','Title','Data','getHost','hotmail','imap-mail.outlook.com','127.0.0.1','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','lodash','randomstring','path','node-tnef','email','../../../config/environment','head','address','anonymous','@xcally.com','value','name','substring','indexOf','split','slice','Anonymous','length','isEmpty','test','html','replace','<img','push','filename','_SRC','_IMG','body','<a\x20target=\x22_blank\x22\x20','message','originTo','originCc','includes','bcc','attachments','attach','type','attachment','attachment-','format','%s-%s','now','join','root','server/files/attachments/','writeFileSync','content','contentType'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1098,0x156));var _0x8109=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1098[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8109('0x0'));var moment=require('moment');var random=require(_0x8109('0x1'));var fs=require('fs');var path=require(_0x8109('0x2'));var util=require('util');var tnef=require(_0x8109('0x3'));var logger=require('../../../config/logger')(_0x8109('0x4'));var config=require(_0x8109('0x5'));function getAddress(_0x31c6a8){var _0x318c38=_[_0x8109('0x6')](_0x31c6a8['value']);return _0x318c38&&_0x318c38['address']?_0x318c38[_0x8109('0x7')]:_0x8109('0x8')+random['generate'](0x6)+_0x8109('0x9');}function getFirstName(_0x568df3){var _0x3cb5bd=_[_0x8109('0x6')](_0x568df3[_0x8109('0xa')]);if(_0x3cb5bd&&_0x3cb5bd[_0x8109('0xb')]){if(_0x3cb5bd[_0x8109('0xb')]==_0x3cb5bd[_0x8109('0x7')]){return _0x3cb5bd[_0x8109('0xb')][_0x8109('0xc')](0x0,_0x3cb5bd['name'][_0x8109('0xd')]('@'));}var _0x39217e=_0x3cb5bd[_0x8109('0xb')][_0x8109('0xe')](/\s+/);return _0x39217e['length']>0x1?_0x39217e[_0x8109('0xf')](0x0,-0x1)['join']('\x20'):_0x3cb5bd[_0x8109('0xb')];}return _0x8109('0x10');}function getLastName(_0x183d53){var _0x200043=_['head'](_0x183d53[_0x8109('0xa')]);if(_0x200043&&_0x200043['name']){var _0x5e4d2b=_0x200043['name'][_0x8109('0xe')](/\s+/);return _0x5e4d2b[_0x8109('0x11')]>0x1?_0x5e4d2b['pop']():'';}return'';}function getMails(_0x2220a3,_0x26dfd3){var _0x480b05='';for(var _0x4e0d48=0x0;_0x4e0d48<_0x26dfd3[_0x8109('0xa')][_0x8109('0x11')];_0x4e0d48+=0x1){if(_0x26dfd3[_0x8109('0xa')][_0x4e0d48][_0x8109('0x7')]!==_0x2220a3){if(!_[_0x8109('0x12')](_0x480b05)){_0x480b05+=',';}_0x480b05+=_0x26dfd3[_0x8109('0xa')][_0x4e0d48][_0x8109('0xb')]||_0x26dfd3['value'][_0x4e0d48][_0x8109('0x7')]||'';_0x480b05+='\x20<';_0x480b05+=_0x26dfd3[_0x8109('0xa')][_0x4e0d48][_0x8109('0x7')]?_0x26dfd3[_0x8109('0xa')][_0x4e0d48][_0x8109('0x7')]:_0x8109('0x8')+random['generate'](0x6)+_0x8109('0x9');_0x480b05+='>';}}return _0x480b05;}function parseEmail(_0x193293,_0x11eca4,_0x41ef04){if(_0x11eca4['html']){var _0x201567=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x201567[_0x8109('0x13')](_0x11eca4[_0x8109('0x14')])){_0x11eca4[_0x8109('0x14')]=_0x11eca4['html'][_0x8109('0x15')](_0x201567,'');}if(_0x11eca4[_0x8109('0x14')]['includes'](_0x8109('0x16'))){var _0x1ad707=[];_0x11eca4['attachments']['forEach'](_0x398c3d=>{_0x1ad707[_0x8109('0x17')](_0x398c3d[_0x8109('0x18')]);});var _0x2d5ab3=/<img.*? _SRC(.*?)[^>]+>/g;var _0x1203d6=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x45b3a4=_0x11eca4[_0x8109('0x14')][_0x8109('0x15')](_0x1203d6,_0x8109('0x19'));var _0xb201ee=_0x45b3a4[_0x8109('0x15')](_0x2d5ab3,_0x8109('0x1a'));for(let _0x1bd43e=0x0;_0x1bd43e<_0x1ad707[_0x8109('0x11')];_0x1bd43e++){var _0x342e5f=_0xb201ee['replace'](_0x8109('0x1a'),'<span\x20style=font-weight:bold>\x20[Attachment:\x20'+_0x1ad707[_0x1bd43e]+'\x20]</span>');_0xb201ee=_0x342e5f;}_0x11eca4[_0x8109('0x14')]=_0xb201ee;}_0x41ef04['body']=_0x11eca4['html'];}else{_0x41ef04[_0x8109('0x1b')]=_0x11eca4['textAsHtml'];}if(_0x41ef04[_0x8109('0x1b')]){_0x41ef04[_0x8109('0x1b')]=_0x41ef04[_0x8109('0x1b')][_0x8109('0x15')](/<a\s+/gi,_0x8109('0x1c'));}if(_0x11eca4['to']){_0x41ef04[_0x8109('0x1d')][_0x8109('0x1e')]=getMails(null,_0x11eca4['to']);var _0x52a3dc=getMails(_0x193293[_0x8109('0x4')],_0x11eca4['to']);if(!_['isEmpty'](_0x52a3dc)){_0x41ef04['message']['cc']+=_0x52a3dc;}}if(_0x11eca4['cc']){_0x41ef04[_0x8109('0x1d')][_0x8109('0x1f')]=getMails(null,_0x11eca4['cc']);var _0x525d8b=getMails(_0x193293[_0x8109('0x4')],_0x11eca4['cc']);if(!_[_0x8109('0x12')](_0x525d8b)){if(!_['isEmpty'](_0x41ef04['message']['cc'])){_0x41ef04['message']['cc']+=',';}_0x41ef04[_0x8109('0x1d')]['cc']+=_0x525d8b;}}if(!_[_0x8109('0x20')](_0x41ef04[_0x8109('0x1d')]['originTo'],_0x193293['email'])&&!_['includes'](_0x41ef04[_0x8109('0x1d')][_0x8109('0x1f')],_0x193293[_0x8109('0x4')])){_0x41ef04[_0x8109('0x1d')][_0x8109('0x21')]=_0x193293['email'];}if(_0x11eca4[_0x8109('0x22')]&&_0x11eca4[_0x8109('0x22')][_0x8109('0x11')]){_0x41ef04[_0x8109('0x1d')][_0x8109('0x23')]=_0x11eca4['attachments']['length'];for(var _0x3978db=0x0,_0x341eb9,_0x45e09c,_0x2c3035;_0x3978db<_0x11eca4[_0x8109('0x22')][_0x8109('0x11')];_0x3978db+=0x1){if(_0x11eca4[_0x8109('0x22')][_0x3978db][_0x8109('0x24')]===_0x8109('0x25')){_0x2c3035=_0x11eca4['attachments'][_0x3978db]['filename']||_0x8109('0x26')+_0x3978db;_0x341eb9=util[_0x8109('0x27')](_0x8109('0x28'),Date[_0x8109('0x29')](),_0x2c3035);_0x45e09c=path[_0x8109('0x2a')](config[_0x8109('0x2b')],_0x8109('0x2c'),_0x341eb9);fs[_0x8109('0x2d')](_0x45e09c,_0x11eca4['attachments'][_0x3978db][_0x8109('0x2e')]);_0x41ef04[_0x8109('0x1d')][_0x8109('0x22')]['push']({'name':_0x2c3035,'basename':_0x341eb9,'type':_0x11eca4[_0x8109('0x22')][_0x3978db][_0x8109('0x2f')],'filepath':_0x45e09c});}}}if(_0x11eca4[_0x8109('0x30')]&&_0x11eca4[_0x8109('0x30')][_0x8109('0x11')]>0x0){var _0x3d4a81=[_0x8109('0x31'),'X-Auto-Response-Suppress:\x20All',_0x8109('0x32')];for(var _0x187071=0x0;_0x187071<_0x11eca4[_0x8109('0x30')][_0x8109('0x11')];_0x187071++){var _0x12b7fb=_['indexOf'](_0x3d4a81,_0x11eca4[_0x8109('0x30')][_0x187071][_0x8109('0x33')]);if(_0x12b7fb>=0x0){_0x41ef04[_0x8109('0x34')]=!![];}}}return _0x41ef04;}exports[_0x8109('0x35')]=function(_0x53e406,_0x2e6947,_0x2b38a9){var _0x1f7ce7={'from':getAddress(_0x2e6947[_0x8109('0x36')]),'firstName':getFirstName(_0x2e6947[_0x8109('0x36')]),'lastName':getLastName(_0x2e6947['from']),'mapKey':_0x8109('0x4'),'message':{'from':getMails(_0x53e406[_0x8109('0x4')],_0x2e6947[_0x8109('0x36')]),'to':_0x53e406[_0x8109('0x4')],'cc':'','subject':_0x2e6947[_0x8109('0x37')]||'','messageId':_0x2e6947[_0x8109('0x38')],'inReplyTo':_0x2e6947[_0x8109('0x39')],'sentAt':moment(_0x2e6947[_0x8109('0x3a')])[_0x8109('0x27')](_0x8109('0x3b')),'attach':![],'attachments':[]}};if(!_0x2e6947['html']&&!_0x2e6947['textAsHtml']){var _0x19d383=_[_0x8109('0x3c')](_0x2e6947[_0x8109('0x22')],{'contentType':_0x8109('0x3d')});if(_0x19d383[_0x8109('0x11')]){logger[_0x8109('0x3e')](util[_0x8109('0x27')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x2e6947[_0x8109('0x38')]));tnef[_0x8109('0x3f')](_['first'](_0x19d383)[_0x8109('0x2e')],function(_0x1f8b70,_0x1a7451){if(_0x1a7451){_0x2e6947[_0x8109('0x14')]=_0x1a7451[_0x8109('0x40')]||_0x8109('0x41');if(_0x1a7451[_0x8109('0x42')]){for(var _0x42d700=0x0;_0x42d700<_0x1a7451['Attachments'][_0x8109('0x11')];_0x42d700++){var _0x23e3a3=_0x1a7451[_0x8109('0x42')][_0x42d700];_0x1f7ce7[_0x8109('0x1d')][_0x8109('0x22')]['push']({'filename':_0x23e3a3[_0x8109('0x43')],'content':Buffer[_0x8109('0x36')](_0x23e3a3[_0x8109('0x44')])});}}}_0x2b38a9(parseEmail(_0x53e406,_0x2e6947,_0x1f7ce7));});}else{_0x2e6947[_0x8109('0x14')]=_0x8109('0x41');_0x2b38a9(parseEmail(_0x53e406,_0x2e6947,_0x1f7ce7));}}else{_0x2b38a9(parseEmail(_0x53e406,_0x2e6947,_0x1f7ce7));}};exports[_0x8109('0x45')]=function(_0x2e97e5){switch(_0x2e97e5){case'gmail':return'imap.gmail.com';case'yahoo':return'imap.mail.yahoo.com';case _0x8109('0x46'):return _0x8109('0x47');case'outlook365':return'outlook.office365.com';}return _0x8109('0x48');};exports[_0x8109('0x49')]=function(_0x4d9120,_0x48e600){var _0x2d9dbe=[_0x8109('0x4a')+(_0x48e600||''),_0x8109('0x4b')+_0x4d9120,'',''];return Buffer['from'](_0x2d9dbe[_0x8109('0x2a')]('\ 1'),_0x8109('0x4c'))[_0x8109('0x4d')]('base64');};
\ No newline at end of file
+var _0xb8ab=['filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','messageId','parseBuffer','first','content','BodyHTML','<p>Empty\x20message</p>','Attachments','Title','Data','imap.gmail.com','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','user=','auth=Bearer\x20','join','lodash','moment','randomstring','path','util','email','../../../config/environment','head','value','anonymous','name','address','substring','indexOf','length','slice','Anonymous','split','pop','isEmpty','generate','@xcally.com','html','test','includes','<img','attachments','forEach','filename','_SRC','replace','_IMG','<span\x20style=font-weight:bold>\x20[Attachment:\x20','\x20]</span>','body','textAsHtml','<a\x20target=\x22_blank\x22\x20','originTo','message','originCc','bcc','type','attachment','attachment-','format','now','root','server/files/attachments/','push','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','line','isAutoreply','parser','from','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x5659c0,_0x5f2532){var _0x36e3c0=function(_0x247a5f){while(--_0x247a5f){_0x5659c0['push'](_0x5659c0['shift']());}};_0x36e3c0(++_0x5f2532);}(_0xb8ab,0x163));var _0xbb8a=function(_0x5e8b60,_0x4a29d2){_0x5e8b60=_0x5e8b60-0x0;var _0x592015=_0xb8ab[_0x5e8b60];return _0x592015;};'use strict';var _=require(_0xbb8a('0x0'));var moment=require(_0xbb8a('0x1'));var random=require(_0xbb8a('0x2'));var fs=require('fs');var path=require(_0xbb8a('0x3'));var util=require(_0xbb8a('0x4'));var tnef=require('node-tnef');var logger=require('../../../config/logger')(_0xbb8a('0x5'));var config=require(_0xbb8a('0x6'));function getAddress(_0x52356b){var _0x2b47cc=_[_0xbb8a('0x7')](_0x52356b[_0xbb8a('0x8')]);return _0x2b47cc&&_0x2b47cc['address']?_0x2b47cc['address']:_0xbb8a('0x9')+random['generate'](0x6)+'@xcally.com';}function getFirstName(_0x3f27c6){var _0x513fa3=_[_0xbb8a('0x7')](_0x3f27c6[_0xbb8a('0x8')]);if(_0x513fa3&&_0x513fa3[_0xbb8a('0xa')]){if(_0x513fa3[_0xbb8a('0xa')]==_0x513fa3[_0xbb8a('0xb')]){return _0x513fa3[_0xbb8a('0xa')][_0xbb8a('0xc')](0x0,_0x513fa3['name'][_0xbb8a('0xd')]('@'));}var _0x3cf99f=_0x513fa3[_0xbb8a('0xa')]['split'](/\s+/);return _0x3cf99f[_0xbb8a('0xe')]>0x1?_0x3cf99f[_0xbb8a('0xf')](0x0,-0x1)['join']('\x20'):_0x513fa3['name'];}return _0xbb8a('0x10');}function getLastName(_0x4a3ed2){var _0x5807a0=_[_0xbb8a('0x7')](_0x4a3ed2[_0xbb8a('0x8')]);if(_0x5807a0&&_0x5807a0['name']){var _0x2eae09=_0x5807a0[_0xbb8a('0xa')][_0xbb8a('0x11')](/\s+/);return _0x2eae09[_0xbb8a('0xe')]>0x1?_0x2eae09[_0xbb8a('0x12')]():'';}return'';}function getMails(_0x5203fa,_0x540015){var _0x15d867='';for(var _0x40feee=0x0;_0x40feee<_0x540015[_0xbb8a('0x8')][_0xbb8a('0xe')];_0x40feee+=0x1){if(_0x540015['value'][_0x40feee][_0xbb8a('0xb')]!==_0x5203fa){if(!_[_0xbb8a('0x13')](_0x15d867)){_0x15d867+=',';}_0x15d867+=_0x540015[_0xbb8a('0x8')][_0x40feee]['name']||_0x540015[_0xbb8a('0x8')][_0x40feee][_0xbb8a('0xb')]||'';_0x15d867+='\x20<';_0x15d867+=_0x540015['value'][_0x40feee][_0xbb8a('0xb')]?_0x540015[_0xbb8a('0x8')][_0x40feee][_0xbb8a('0xb')]:'anonymous'+random[_0xbb8a('0x14')](0x6)+_0xbb8a('0x15');_0x15d867+='>';}}return _0x15d867;}function parseEmail(_0x59c18d,_0xe6d1b7,_0x1c9a0b){if(_0xe6d1b7[_0xbb8a('0x16')]){var _0x406ea6=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x406ea6[_0xbb8a('0x17')](_0xe6d1b7[_0xbb8a('0x16')])){_0xe6d1b7[_0xbb8a('0x16')]=_0xe6d1b7[_0xbb8a('0x16')]['replace'](_0x406ea6,'');}if(_0xe6d1b7[_0xbb8a('0x16')][_0xbb8a('0x18')](_0xbb8a('0x19'))){var _0x583e62=[];_0xe6d1b7[_0xbb8a('0x1a')][_0xbb8a('0x1b')](_0x168772=>{_0x583e62['push'](_0x168772[_0xbb8a('0x1c')]);});var _0x4e69df=/<img.*? _SRC(.*?)[^>]+>/g;var _0x329687=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x385345=_0xe6d1b7[_0xbb8a('0x16')]['replace'](_0x329687,_0xbb8a('0x1d'));var _0x4be369=_0x385345[_0xbb8a('0x1e')](_0x4e69df,_0xbb8a('0x1f'));for(let _0x21510b=0x0;_0x21510b<_0x583e62[_0xbb8a('0xe')];_0x21510b++){var _0x50a89f=_0x4be369[_0xbb8a('0x1e')](_0xbb8a('0x1f'),_0xbb8a('0x20')+_0x583e62[_0x21510b]+_0xbb8a('0x21'));_0x4be369=_0x50a89f;}_0xe6d1b7[_0xbb8a('0x16')]=_0x4be369;}_0x1c9a0b[_0xbb8a('0x22')]=_0xe6d1b7['html'];}else{_0x1c9a0b[_0xbb8a('0x22')]=_0xe6d1b7[_0xbb8a('0x23')];}if(_0x1c9a0b[_0xbb8a('0x22')]){_0x1c9a0b['body']=_0x1c9a0b[_0xbb8a('0x22')][_0xbb8a('0x1e')](/<a\s+/gi,_0xbb8a('0x24'));}if(_0xe6d1b7['to']){_0x1c9a0b['message'][_0xbb8a('0x25')]=getMails(null,_0xe6d1b7['to']);var _0x2d2012=getMails(_0x59c18d['email'],_0xe6d1b7['to']);if(!_['isEmpty'](_0x2d2012)){_0x1c9a0b['message']['cc']+=_0x2d2012;}}if(_0xe6d1b7['cc']){_0x1c9a0b[_0xbb8a('0x26')][_0xbb8a('0x27')]=getMails(null,_0xe6d1b7['cc']);var _0x47e85f=getMails(_0x59c18d[_0xbb8a('0x5')],_0xe6d1b7['cc']);if(!_[_0xbb8a('0x13')](_0x47e85f)){if(!_[_0xbb8a('0x13')](_0x1c9a0b['message']['cc'])){_0x1c9a0b[_0xbb8a('0x26')]['cc']+=',';}_0x1c9a0b['message']['cc']+=_0x47e85f;}}if(!_[_0xbb8a('0x18')](_0x1c9a0b[_0xbb8a('0x26')]['originTo'],_0x59c18d[_0xbb8a('0x5')])&&!_[_0xbb8a('0x18')](_0x1c9a0b['message'][_0xbb8a('0x27')],_0x59c18d[_0xbb8a('0x5')])){_0x1c9a0b[_0xbb8a('0x26')][_0xbb8a('0x28')]=_0x59c18d[_0xbb8a('0x5')];}if(_0xe6d1b7[_0xbb8a('0x1a')]&&_0xe6d1b7[_0xbb8a('0x1a')][_0xbb8a('0xe')]){_0x1c9a0b['message']['attach']=_0xe6d1b7[_0xbb8a('0x1a')][_0xbb8a('0xe')];for(var _0x55308c=0x0,_0xae3bd6,_0x385aa6,_0x2e92ff;_0x55308c<_0xe6d1b7[_0xbb8a('0x1a')][_0xbb8a('0xe')];_0x55308c+=0x1){if(_0xe6d1b7[_0xbb8a('0x1a')][_0x55308c][_0xbb8a('0x29')]===_0xbb8a('0x2a')){_0x2e92ff=_0xe6d1b7[_0xbb8a('0x1a')][_0x55308c][_0xbb8a('0x1c')]||_0xbb8a('0x2b')+_0x55308c;_0xae3bd6=util[_0xbb8a('0x2c')]('%s-%s',Date[_0xbb8a('0x2d')](),_0x2e92ff);_0x385aa6=path['join'](config[_0xbb8a('0x2e')],_0xbb8a('0x2f'),_0xae3bd6);fs['writeFileSync'](_0x385aa6,_0xe6d1b7[_0xbb8a('0x1a')][_0x55308c]['content']);_0x1c9a0b[_0xbb8a('0x26')][_0xbb8a('0x1a')][_0xbb8a('0x30')]({'name':_0x2e92ff,'basename':_0xae3bd6,'type':_0xe6d1b7[_0xbb8a('0x1a')][_0x55308c][_0xbb8a('0x31')],'filepath':_0x385aa6});}}}if(_0xe6d1b7['headerLines']&&_0xe6d1b7[_0xbb8a('0x32')][_0xbb8a('0xe')]>0x0){var _0x240ad6=[_0xbb8a('0x33'),_0xbb8a('0x34'),'Precedence:\x20auto_reply'];for(var _0x3b3a97=0x0;_0x3b3a97<_0xe6d1b7[_0xbb8a('0x32')]['length'];_0x3b3a97++){var _0x49e793=_[_0xbb8a('0xd')](_0x240ad6,_0xe6d1b7[_0xbb8a('0x32')][_0x3b3a97][_0xbb8a('0x35')]);if(_0x49e793>=0x0){_0x1c9a0b[_0xbb8a('0x36')]=!![];}}}return _0x1c9a0b;}exports[_0xbb8a('0x37')]=function(_0x4bc15a,_0x1ae445,_0x43670c){var _0x1ef94b={'from':getAddress(_0x1ae445[_0xbb8a('0x38')]),'firstName':getFirstName(_0x1ae445['from']),'lastName':getLastName(_0x1ae445['from']),'mapKey':_0xbb8a('0x5'),'message':{'from':getMails(_0x4bc15a[_0xbb8a('0x5')],_0x1ae445[_0xbb8a('0x38')]),'to':_0x4bc15a[_0xbb8a('0x5')],'cc':'','subject':_0x1ae445['subject']||'','messageId':_0x1ae445['messageId'],'inReplyTo':_0x1ae445[_0xbb8a('0x39')],'sentAt':moment(_0x1ae445[_0xbb8a('0x3a')])[_0xbb8a('0x2c')](_0xbb8a('0x3b')),'attach':![],'attachments':[]}};if(!_0x1ae445[_0xbb8a('0x16')]&&!_0x1ae445[_0xbb8a('0x23')]){var _0x578db0=_[_0xbb8a('0x3c')](_0x1ae445[_0xbb8a('0x1a')],{'contentType':_0xbb8a('0x3d')});if(_0x578db0[_0xbb8a('0xe')]){logger[_0xbb8a('0x3e')](util[_0xbb8a('0x2c')](_0xbb8a('0x3f'),_0x1ae445[_0xbb8a('0x40')]));tnef[_0xbb8a('0x41')](_[_0xbb8a('0x42')](_0x578db0)[_0xbb8a('0x43')],function(_0x31938b,_0x1a337d){if(_0x1a337d){_0x1ae445[_0xbb8a('0x16')]=_0x1a337d[_0xbb8a('0x44')]||_0xbb8a('0x45');if(_0x1a337d[_0xbb8a('0x46')]){for(var _0x21dfd0=0x0;_0x21dfd0<_0x1a337d[_0xbb8a('0x46')][_0xbb8a('0xe')];_0x21dfd0++){var _0x490167=_0x1a337d['Attachments'][_0x21dfd0];_0x1ef94b[_0xbb8a('0x26')]['attachments'][_0xbb8a('0x30')]({'filename':_0x490167[_0xbb8a('0x47')],'content':Buffer[_0xbb8a('0x38')](_0x490167[_0xbb8a('0x48')])});}}}_0x43670c(parseEmail(_0x4bc15a,_0x1ae445,_0x1ef94b));});}else{_0x1ae445['html']=_0xbb8a('0x45');_0x43670c(parseEmail(_0x4bc15a,_0x1ae445,_0x1ef94b));}}else{_0x43670c(parseEmail(_0x4bc15a,_0x1ae445,_0x1ef94b));}};exports['getHost']=function(_0x56b409){switch(_0x56b409){case'gmail':return _0xbb8a('0x49');case'yahoo':return _0xbb8a('0x4a');case _0xbb8a('0x4b'):return _0xbb8a('0x4c');case _0xbb8a('0x4d'):return _0xbb8a('0x4e');}return _0xbb8a('0x4f');};exports['generateXOAuth2Token']=function(_0xfe108a,_0xf9ce76){var _0x36b0cc=[_0xbb8a('0x50')+(_0xf9ce76||''),_0xbb8a('0x51')+_0xfe108a,'',''];return Buffer[_0xbb8a('0x38')](_0x36b0cc[_0xbb8a('0x52')]('\ 1'),'utf-8')['toString']('base64');};
\ No newline at end of file
index ea0242d..a5c0a91 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6eac=['active','Imap','Smtp','name','Service','key'];(function(_0x23074c,_0x770f93){var _0x2cfba0=function(_0xb997d){while(--_0xb997d){_0x23074c['push'](_0x23074c['shift']());}};_0x2cfba0(++_0x770f93);}(_0x6eac,0x17d));var _0xc6ea=function(_0x2e3b7b,_0x58c248){_0x2e3b7b=_0x2e3b7b-0x0;var _0x285c09=_0x6eac[_0x2e3b7b];return _0x285c09;};'use strict';var _=require('lodash');function MailAccount(_0x1cb6ce){this['id']=_0x1cb6ce['id']||0x0;this[_0xc6ea('0x0')]=_0x1cb6ce[_0xc6ea('0x0')]||_0xc6ea('0x1');this['key']=_0x1cb6ce[_0xc6ea('0x2')]||'SERV';this[_0xc6ea('0x3')]=_0x1cb6ce[_0xc6ea('0x3')]||![];this[_0xc6ea('0x4')]=_0x1cb6ce[_0xc6ea('0x4')]||[];this[_0xc6ea('0x5')]=_0x1cb6ce[_0xc6ea('0x5')]||[];}module['exports']=MailAccount;
\ No newline at end of file
+var _0x436e=['active','Imap','Smtp','exports','lodash','name','key'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x436e,0xc8));var _0xe436=function(_0x3217cb,_0x515aee){_0x3217cb=_0x3217cb-0x0;var _0x83c99b=_0x436e[_0x3217cb];return _0x83c99b;};'use strict';var _=require(_0xe436('0x0'));function MailAccount(_0x8156b6){this['id']=_0x8156b6['id']||0x0;this[_0xe436('0x1')]=_0x8156b6[_0xe436('0x1')]||'Service';this['key']=_0x8156b6[_0xe436('0x2')]||'SERV';this[_0xe436('0x3')]=_0x8156b6['active']||![];this['Imap']=_0x8156b6[_0xe436('0x4')]||[];this['Smtp']=_0x8156b6[_0xe436('0x5')]||[];}module[_0xe436('0x6')]=MailAccount;
\ No newline at end of file
index a2481b7..570e420 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa7be=['../model/mailAccount','mailAccounts','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length','isUndefined','merge','exports','lodash'];(function(_0x3c04dd,_0x2f78d5){var _0x26ea69=function(_0x246f10){while(--_0x246f10){_0x3c04dd['push'](_0x3c04dd['shift']());}};_0x26ea69(++_0x2f78d5);}(_0xa7be,0xf1));var _0xea7b=function(_0x2bef1c,_0x43f55b){_0x2bef1c=_0x2bef1c-0x0;var _0x1a7ba7=_0xa7be[_0x2bef1c];return _0x1a7ba7;};'use strict';var _=require(_0xea7b('0x0'));var MailAccount=require(_0xea7b('0x1'));var Realtime=function(){this[_0xea7b('0x2')]={};};function freeIsNotKey(_0x24cdbb,_0x386400,_0x20bfae){var _0x336281=_['mapKeys'](_0x24cdbb,function(_0x3ddc42,_0x2daf0f){return _0x3ddc42[_0x20bfae];});for(var _0x1668d4 in _0x386400){if(_0x386400[_0xea7b('0x3')](_0x1668d4)){if(!_0x336281[_0x1668d4]){delete _0x386400[_0x1668d4];}}}}Realtime[_0xea7b('0x4')][_0xea7b('0x5')]=function(_0x16702f,_0x17643f){for(var _0x48e358 in _0x17643f){if(_0x16702f['hasOwnProperty'](_0x48e358)){_0x16702f[_0x48e358]=_0x17643f[_0x48e358];}}};Realtime[_0xea7b('0x4')][_0xea7b('0x6')]=function(){var _0x412ff5=this;return function(_0x1ede64){if(_0x1ede64){freeIsNotKey(_0x1ede64,_0x412ff5[_0xea7b('0x2')],'id');for(var _0x4ebee2=0x0,_0x5dfc43={},_0x29249f={};_0x4ebee2<_0x1ede64[_0xea7b('0x7')];_0x4ebee2+=0x1){_0x5dfc43=_0x1ede64[_0x4ebee2];if(_[_0xea7b('0x8')](_0x412ff5[_0xea7b('0x2')][_0x5dfc43['id']])){_0x412ff5[_0xea7b('0x2')][_0x5dfc43['id']]=new MailAccount(_0x5dfc43);}else{_[_0xea7b('0x9')](_0x412ff5[_0xea7b('0x2')][_0x5dfc43['id']],_0x5dfc43);}}}return _0x412ff5[_0xea7b('0x2')];};};module[_0xea7b('0xa')]=Realtime;
\ No newline at end of file
+var _0x5dee=['hasOwnProperty','initMailAccounts','mailAccounts','lodash','../model/mailAccount'];(function(_0x29a9a5,_0x3d5a43){var _0x3a6e12=function(_0x4fe671){while(--_0x4fe671){_0x29a9a5['push'](_0x29a9a5['shift']());}};_0x3a6e12(++_0x3d5a43);}(_0x5dee,0xad));var _0xe5de=function(_0x1508b2,_0x30d3ec){_0x1508b2=_0x1508b2-0x0;var _0x939d28=_0x5dee[_0x1508b2];return _0x939d28;};'use strict';var _=require(_0xe5de('0x0'));var MailAccount=require(_0xe5de('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x5de6e2,_0x5ee0fa,_0x1c5937){var _0x2d442d=_['mapKeys'](_0x5de6e2,function(_0x1f6839,_0x55700d){return _0x1f6839[_0x1c5937];});for(var _0x2703a1 in _0x5ee0fa){if(_0x5ee0fa['hasOwnProperty'](_0x2703a1)){if(!_0x2d442d[_0x2703a1]){delete _0x5ee0fa[_0x2703a1];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x56c700,_0x2a4c60){for(var _0x1e87e6 in _0x2a4c60){if(_0x56c700[_0xe5de('0x2')](_0x1e87e6)){_0x56c700[_0x1e87e6]=_0x2a4c60[_0x1e87e6];}}};Realtime['prototype'][_0xe5de('0x3')]=function(){var _0x2a63f6=this;return function(_0x5aa10b){if(_0x5aa10b){freeIsNotKey(_0x5aa10b,_0x2a63f6[_0xe5de('0x4')],'id');for(var _0x5e56fa=0x0,_0x48eb90={},_0x247263={};_0x5e56fa<_0x5aa10b['length'];_0x5e56fa+=0x1){_0x48eb90=_0x5aa10b[_0x5e56fa];if(_['isUndefined'](_0x2a63f6[_0xe5de('0x4')][_0x48eb90['id']])){_0x2a63f6['mailAccounts'][_0x48eb90['id']]=new MailAccount(_0x48eb90);}else{_['merge'](_0x2a63f6[_0xe5de('0x4')][_0x48eb90['id']],_0x48eb90);}}}return _0x2a63f6[_0xe5de('0x4')];};};module['exports']=Realtime;
\ No newline at end of file
index 25b7c88..aaa2831 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16ce=['service','ListId','MailServerIn','Imap','CloudProvider','type','data5','Smtp','getMailAccount','notify','NotifyMailAccount','getMailAccounts','Request','GetMailAccount','name','provider'];(function(_0x169efd,_0x1d3c20){var _0x52d4d4=function(_0x5528ae){while(--_0x5528ae){_0x169efd['push'](_0x169efd['shift']());}};_0x52d4d4(++_0x1d3c20);}(_0x16ce,0xfb));var _0xe16c=function(_0x452982,_0x519db3){_0x452982=_0x452982-0x0;var _0x2ecd37=_0x16ce[_0x452982];return _0x2ecd37;};'use strict';var client=require('../client');exports[_0xe16c('0x0')]=function(){return function(){return client[_0xe16c('0x1')](_0xe16c('0x2'),{'options':{'attributes':['id',_0xe16c('0x3'),_0xe16c('0x4'),_0xe16c('0x5'),'email','active','key',_0xe16c('0x6'),'TemplateId'],'raw':![],'include':[{'model':_0xe16c('0x7'),'as':_0xe16c('0x8'),'include':[{'model':_0xe16c('0x9'),'attributes':['id',_0xe16c('0x3'),_0xe16c('0x5'),_0xe16c('0xa'),_0xe16c('0xb')],'as':_0xe16c('0x9')}]},{'model':'MailServerOut','as':_0xe16c('0xc'),'include':[{'model':_0xe16c('0x9'),'attributes':['id',_0xe16c('0x3'),_0xe16c('0x5'),_0xe16c('0xa'),_0xe16c('0xb')],'as':_0xe16c('0x9')}]}]},'log':_0xe16c('0xd')});};};exports[_0xe16c('0xe')]=function(_0x725d10,_0x45c562){return client['Request'](_0xe16c('0xf'),{'account':{'id':_0x725d10},'body':_0x45c562,'log':_0xe16c('0xf')});};
\ No newline at end of file
+var _0xb1f7=['email','active','key','ListId','TemplateId','MailServerIn','Imap','CloudProvider','type','data5','MailServerOut','Smtp','getMailAccount','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','provider','service'];(function(_0x556927,_0x34b53f){var _0x5f1235=function(_0x4f4e44){while(--_0x4f4e44){_0x556927['push'](_0x556927['shift']());}};_0x5f1235(++_0x34b53f);}(_0xb1f7,0x19d));var _0x7b1f=function(_0x282516,_0x2c1159){_0x282516=_0x282516-0x0;var _0xfaa89d=_0xb1f7[_0x282516];return _0xfaa89d;};'use strict';var client=require(_0x7b1f('0x0'));exports[_0x7b1f('0x1')]=function(){return function(){return client[_0x7b1f('0x2')](_0x7b1f('0x3'),{'options':{'attributes':['id',_0x7b1f('0x4'),_0x7b1f('0x5'),_0x7b1f('0x6'),_0x7b1f('0x7'),_0x7b1f('0x8'),_0x7b1f('0x9'),_0x7b1f('0xa'),_0x7b1f('0xb')],'raw':![],'include':[{'model':_0x7b1f('0xc'),'as':_0x7b1f('0xd'),'include':[{'model':_0x7b1f('0xe'),'attributes':['id',_0x7b1f('0x4'),_0x7b1f('0x6'),_0x7b1f('0xf'),_0x7b1f('0x10')],'as':_0x7b1f('0xe')}]},{'model':_0x7b1f('0x11'),'as':_0x7b1f('0x12'),'include':[{'model':_0x7b1f('0xe'),'attributes':['id','name','service','type',_0x7b1f('0x10')],'as':_0x7b1f('0xe')}]}]},'log':_0x7b1f('0x13')});};};exports['notify']=function(_0x2af42e,_0x33f354){return client[_0x7b1f('0x2')](_0x7b1f('0x14'),{'account':{'id':_0x2af42e},'body':_0x33f354,'log':'NotifyMailAccount'});};
\ No newline at end of file
index b72de76..bc6193f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc704=['GetSettings','../client','getSettings','Request','ShowSetting','loginMailFrequency'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc704,0x67));var _0x4c70=function(_0x29bc96,_0x457377){_0x29bc96=_0x29bc96-0x0;var _0x30309c=_0xc704[_0x29bc96];return _0x30309c;};'use strict';var client=require(_0x4c70('0x0'));exports[_0x4c70('0x1')]=function(){return client[_0x4c70('0x2')](_0x4c70('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x4c70('0x4')]},'log':_0x4c70('0x5')});};
\ No newline at end of file
+var _0x297b=['Request','ShowSetting','GetSettings','../client','getSettings'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x297b,0x157));var _0xb297=function(_0x1147ab,_0x10e72b){_0x1147ab=_0x1147ab-0x0;var _0x55cb5a=_0x297b[_0x1147ab];return _0x55cb5a;};'use strict';var client=require(_0xb297('0x0'));exports[_0xb297('0x1')]=function(){return client[_0xb297('0x2')](_0xb297('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0xb297('0x4')});};
\ No newline at end of file
index b9d5101..2ef5622 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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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 54acfab..bcb7268 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x329f=['http','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','polling','redis','localhost','socket.io-redis','default','../../config/socketio','once','lodash'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x329f,0x10d));var _0xf329=function(_0x53f8e6,_0x176b60){_0x53f8e6=_0x53f8e6-0x0;var _0x505ea7=_0x329f[_0x53f8e6];return _0x505ea7;};'use strict';var _=require(_0xf329('0x0'));var http=require(_0xf329('0x1'));var express=require(_0xf329('0x2'));var sticky=require(_0xf329('0x3'));var Redis=require(_0xf329('0x4'));var config=require(_0xf329('0x5'));var app=express();var server=http[_0xf329('0x6')](app);server[_0xf329('0x7')]=0xdbba0;if(sticky[_0xf329('0x8')](server,config[_0xf329('0x9')])){var socketio=require(_0xf329('0xa'))(server,{'transports':['websocket',_0xf329('0xb')]});config[_0xf329('0xc')]=_['defaults'](config[_0xf329('0xc')],{'host':_0xf329('0xd'),'port':0x18eb});socketio['adapter'](require(_0xf329('0xe'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0xf329('0xc')])}));require('../../config/triggers')[_0xf329('0xf')]();require(_0xf329('0x10'))[_0xf329('0xf')](socketio);require('../../config/express')[_0xf329('0xf')](app);require('../../routes')['default'](app);}else{server[_0xf329('0x11')]('listening',function(){console['log']('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0xf329('0x9')]);});}exports=module['exports']=app;
\ No newline at end of file
+var _0xe8f7=['localhost','adapter','socket.io-redis','redis','../../config/triggers','default','../../config/socketio','../../routes','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','port','lodash','http','express','ioredis','timeout','listen','websocket','polling','defaults'];(function(_0x2150d9,_0x23c4aa){var _0x54fa94=function(_0x2b0c34){while(--_0x2b0c34){_0x2150d9['push'](_0x2150d9['shift']());}};_0x54fa94(++_0x23c4aa);}(_0xe8f7,0x1da));var _0x7e8f=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe8f7[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x7e8f('0x0'));var http=require(_0x7e8f('0x1'));var express=require(_0x7e8f('0x2'));var sticky=require('sticky-session');var Redis=require(_0x7e8f('0x3'));var config=require('../../config/environment');var app=express();var server=http['createServer'](app);server[_0x7e8f('0x4')]=0xdbba0;if(sticky[_0x7e8f('0x5')](server,config['port'])){var socketio=require('socket.io')(server,{'transports':[_0x7e8f('0x6'),_0x7e8f('0x7')]});config['redis']=_[_0x7e8f('0x8')](config['redis'],{'host':_0x7e8f('0x9'),'port':0x18eb});socketio[_0x7e8f('0xa')](require(_0x7e8f('0xb'))({'pubClient':new Redis(config[_0x7e8f('0xc')]),'subClient':new Redis(config['redis'])}));require(_0x7e8f('0xd'))[_0x7e8f('0xe')]();require(_0x7e8f('0xf'))[_0x7e8f('0xe')](socketio);require('../../config/express')[_0x7e8f('0xe')](app);require(_0x7e8f('0x10'))['default'](app);}else{server['once'](_0x7e8f('0x11'),function(){console[_0x7e8f('0x12')](_0x7e8f('0x13'),config[_0x7e8f('0x14')]);});}exports=module['exports']=app;
\ No newline at end of file
index b5f6b30..0d3d5a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc11a=['bluebird','../../config/logger','routing','http','Request','then','debug','error','rpc','message','result','catch','exports','jayson/promise'];(function(_0x3e5f74,_0x12f730){var _0x3e03bf=function(_0x2bac45){while(--_0x2bac45){_0x3e5f74['push'](_0x3e5f74['shift']());}};_0x3e03bf(++_0x12f730);}(_0xc11a,0x6f));var _0xac11=function(_0x1d6a82,_0x37c315){_0x1d6a82=_0x1d6a82-0x0;var _0x5834ac=_0xc11a[_0x1d6a82];return _0x5834ac;};'use strict';var jayson=require(_0xac11('0x0'));var BPromise=require(_0xac11('0x1'));var logger=require(_0xac11('0x2'))(_0xac11('0x3'));var client=jayson['client'][_0xac11('0x4')]({'port':0x2329});client[_0xac11('0x5')]=function(_0x5681ae,_0xce19a){return new BPromise(function(_0x28826e,_0x3677fe){return client['request'](_0x5681ae,_0xce19a)[_0xac11('0x6')](function(_0x4bd2b1){logger[_0xac11('0x7')]('rpc',_0xac11('0x3'),_0x5681ae,_0xce19a,_0x4bd2b1);if(_0x4bd2b1['error']){logger[_0xac11('0x8')](_0xac11('0x9'),_0xac11('0x3'),_0x5681ae,_0x4bd2b1[_0xac11('0x8')][_0xac11('0xa')],_0xce19a);return _0x3677fe(_0x4bd2b1[_0xac11('0x8')][_0xac11('0xa')]);}else{return _0x28826e(_0x4bd2b1[_0xac11('0xb')]);}})[_0xac11('0xc')](function(_0x512a48){logger['error'](_0xac11('0x9'),'routing',_0x5681ae,_0x512a48,_0xce19a);return _0x3677fe(_0x512a48);});});};module[_0xac11('0xd')]=client;
\ No newline at end of file
+var _0x7236=['rpc','error','message','result','catch','jayson/promise','bluebird','../../config/logger','routing','client','http','then','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7236,0xae));var _0x6723=function(_0xbb64e1,_0x4d016e){_0xbb64e1=_0xbb64e1-0x0;var _0x2af74b=_0x7236[_0xbb64e1];return _0x2af74b;};'use strict';var jayson=require(_0x6723('0x0'));var BPromise=require(_0x6723('0x1'));var logger=require(_0x6723('0x2'))(_0x6723('0x3'));var client=jayson[_0x6723('0x4')][_0x6723('0x5')]({'port':0x2329});client['Request']=function(_0xd37dd6,_0x35c21c){return new BPromise(function(_0x24b16f,_0x409084){return client['request'](_0xd37dd6,_0x35c21c)[_0x6723('0x6')](function(_0xc5233e){logger[_0x6723('0x7')](_0x6723('0x8'),_0x6723('0x3'),_0xd37dd6,_0x35c21c,_0xc5233e);if(_0xc5233e[_0x6723('0x9')]){logger['error']('rpc','routing',_0xd37dd6,_0xc5233e[_0x6723('0x9')][_0x6723('0xa')],_0x35c21c);return _0x409084(_0xc5233e['error']['message']);}else{return _0x24b16f(_0xc5233e[_0x6723('0xb')]);}})[_0x6723('0xc')](function(_0x39a13d){logger[_0x6723('0x9')]('rpc','routing',_0xd37dd6,_0x39a13d,_0x35c21c);return _0x409084(_0x39a13d);});});};module['exports']=client;
\ No newline at end of file
index 40de252..8f4a55a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb95=['getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','./server','./rpc/user','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','then','getAgents','initAgents','getIntervals','getOpenchannelQueues','initOpenchannelQueues','initChatQueues'];(function(_0x1c8844,_0x31bfab){var _0x500af8=function(_0x471ddc){while(--_0x471ddc){_0x1c8844['push'](_0x1c8844['shift']());}};_0x500af8(++_0x31bfab);}(_0xdb95,0xb9));var _0x5db9=function(_0x19792c,_0x23afaa){_0x19792c=_0x19792c-0x0;var _0x4b8d2a=_0xdb95[_0x19792c];return _0x4b8d2a;};'use strict';var BPromise=require('bluebird');var server=require(_0x5db9('0x0'));var Realtime=require('./realtime');var user=require(_0x5db9('0x1'));var interval=require('./rpc/interval');var openchannelQueue=require(_0x5db9('0x2'));var chatQueue=require(_0x5db9('0x3'));var smsQueue=require(_0x5db9('0x4'));var mailQueue=require(_0x5db9('0x5'));var faxQueue=require(_0x5db9('0x6'));var whatsappQueue=require(_0x5db9('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0x5db9('0x8')](user[_0x5db9('0x9')]())[_0x5db9('0x8')](realtime[_0x5db9('0xa')]())[_0x5db9('0x8')](interval[_0x5db9('0xb')]())[_0x5db9('0x8')](realtime['initIntervals']())[_0x5db9('0x8')](openchannelQueue[_0x5db9('0xc')]())['then'](realtime[_0x5db9('0xd')]())[_0x5db9('0x8')](chatQueue['getChatQueues']())[_0x5db9('0x8')](realtime[_0x5db9('0xe')]())[_0x5db9('0x8')](smsQueue[_0x5db9('0xf')]())['then'](realtime[_0x5db9('0x10')]())[_0x5db9('0x8')](mailQueue[_0x5db9('0x11')]())[_0x5db9('0x8')](realtime[_0x5db9('0x12')]())[_0x5db9('0x8')](faxQueue[_0x5db9('0x13')]())[_0x5db9('0x8')](realtime['initFaxQueues']())[_0x5db9('0x8')](whatsappQueue[_0x5db9('0x14')]())[_0x5db9('0x8')](realtime[_0x5db9('0x15')]())[_0x5db9('0x8')](function(){return realtime;});}function main(){return server[_0x5db9('0x16')](realtime)[_0x5db9('0x8')](function(_0x3d7b40){return initRealtime();})[_0x5db9('0x8')](function(_0x2fda3b){return setInterval(initRealtime,0x1388);})[_0x5db9('0x17')](function(_0x3a5e7c){console[_0x5db9('0x18')](_0x3a5e7c);});}main();
\ No newline at end of file
+var _0x1941=['./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','then','initAgents','getIntervals','initChatQueues','initSmsQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','catch','log','bluebird','./server','./rpc/user','./rpc/interval'];(function(_0x365513,_0xa9709){var _0x5383cd=function(_0x2a7949){while(--_0x2a7949){_0x365513['push'](_0x365513['shift']());}};_0x5383cd(++_0xa9709);}(_0x1941,0xf3));var _0x1194=function(_0x261c2a,_0xa9fdf9){_0x261c2a=_0x261c2a-0x0;var _0x540973=_0x1941[_0x261c2a];return _0x540973;};'use strict';var BPromise=require(_0x1194('0x0'));var server=require(_0x1194('0x1'));var Realtime=require('./realtime');var user=require(_0x1194('0x2'));var interval=require(_0x1194('0x3'));var openchannelQueue=require(_0x1194('0x4'));var chatQueue=require(_0x1194('0x5'));var smsQueue=require(_0x1194('0x6'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0x1194('0x7')](user['getAgents']())[_0x1194('0x7')](realtime[_0x1194('0x8')]())[_0x1194('0x7')](interval[_0x1194('0x9')]())[_0x1194('0x7')](realtime['initIntervals']())[_0x1194('0x7')](openchannelQueue['getOpenchannelQueues']())[_0x1194('0x7')](realtime['initOpenchannelQueues']())['then'](chatQueue['getChatQueues']())['then'](realtime[_0x1194('0xa')]())['then'](smsQueue['getSmsQueues']())['then'](realtime[_0x1194('0xb')]())[_0x1194('0x7')](mailQueue['getMailQueues']())['then'](realtime[_0x1194('0xc')]())[_0x1194('0x7')](faxQueue[_0x1194('0xd')]())[_0x1194('0x7')](realtime[_0x1194('0xe')]())['then'](whatsappQueue[_0x1194('0xf')]())['then'](realtime['initWhatsappQueues']())[_0x1194('0x7')](function(){return realtime;});}function main(){return server[_0x1194('0x10')](realtime)[_0x1194('0x7')](function(_0x115f23){return initRealtime();})['then'](function(_0x1e168a){return setInterval(initRealtime,0x1388);})[_0x1194('0x11')](function(_0xe15b1e){console[_0x1194('0x12')](_0xe15b1e);});}main();
\ No newline at end of file
index 0008620..09713df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x15ca1a,_0x30fc82){var _0x507626=function(_0x14c9bc){while(--_0x14c9bc){_0x15ca1a['push'](_0x15ca1a['shift']());}};_0x507626(++_0x30fc82);}(_0x326f,0xd1));var _0xf326=function(_0x3db2d3,_0x53d86c){_0x3db2d3=_0x3db2d3-0x0;var _0x2e2ef4=_0x326f[_0x3db2d3];return _0x2e2ef4;};'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
+var _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0x20221b,_0x5c5517){var _0x187172=function(_0x690001){while(--_0x690001){_0x20221b['push'](_0x20221b['shift']());}};_0x187172(++_0x5c5517);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2f87cd,_0xcaf299){_0x2f87cd=_0x2f87cd-0x0;var _0x5d7eda=_0x5fc3[_0x2f87cd];return _0x5d7eda;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};module['exports']=RuleEngine;
\ No newline at end of file
index c0e27fe..d341781 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e09=['sendMailMessage','jayson/promise','client','http','then','error','message','result','catch'];(function(_0x5a932b,_0x73345f){var _0x28792a=function(_0x2e297c){while(--_0x2e297c){_0x5a932b['push'](_0x5a932b['shift']());}};_0x28792a(++_0x73345f);}(_0x7e09,0x160));var _0x97e0=function(_0x502f0e,_0x3463b3){_0x502f0e=_0x502f0e-0x0;var _0x2522e8=_0x7e09[_0x502f0e];return _0x2522e8;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x97e0('0x0'));var client=jayson[_0x97e0('0x1')][_0x97e0('0x2')]({'port':0x232b});function request(_0x3f5b92,_0xcdf26c){return new BPromise(function(_0x3c463d,_0x268244){return client['request'](_0x3f5b92,_0xcdf26c)[_0x97e0('0x3')](function(_0x20d575){if(_0x20d575[_0x97e0('0x4')]){return _0x268244(_0x20d575[_0x97e0('0x4')][_0x97e0('0x5')]);}else{return _0x3c463d(_0x20d575[_0x97e0('0x6')]);}})[_0x97e0('0x7')](function(_0x2c8206){return _0x268244(_0x2c8206);});});}exports[_0x97e0('0x8')]=function(_0x510f6e,_0x5a6124){return request('SendMail',{'account':_0x510f6e,'message':_0x5a6124});};
\ No newline at end of file
+var _0x2851=['request','then','error','message','sendMailMessage','bluebird','jayson/promise','client','http'];(function(_0x4c6c04,_0x44a3c6){var _0x441035=function(_0x1898cf){while(--_0x1898cf){_0x4c6c04['push'](_0x4c6c04['shift']());}};_0x441035(++_0x44a3c6);}(_0x2851,0x15b));var _0x1285=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x2851[_0x21a9d9];return _0x46adce;};'use strict';var BPromise=require(_0x1285('0x0'));var jayson=require(_0x1285('0x1'));var client=jayson[_0x1285('0x2')][_0x1285('0x3')]({'port':0x232b});function request(_0x4e1ed4,_0x377507){return new BPromise(function(_0x18e31e,_0x45c56e){return client[_0x1285('0x4')](_0x4e1ed4,_0x377507)[_0x1285('0x5')](function(_0x2d93ff){if(_0x2d93ff['error']){return _0x45c56e(_0x2d93ff[_0x1285('0x6')][_0x1285('0x7')]);}else{return _0x18e31e(_0x2d93ff['result']);}})['catch'](function(_0x39f93a){return _0x45c56e(_0x39f93a);});});}exports[_0x1285('0x8')]=function(_0x32f6cb,_0x41c89c){return request('SendMail',{'account':_0x32f6cb,'message':_0x41c89c});};
\ No newline at end of file
index 2c6cb65..f63e3d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x779d=['updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','mail','chat','openchannel','fax','sms','whatsapp','Status','toNumber','format','faxStatusTime','faxCapacity','smsStatus','stringify','emit','user:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxCurrentCapacity','unknown','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue'];(function(_0x576e2b,_0x328953){var _0x46461a=function(_0xce4d9e){while(--_0xce4d9e){_0x576e2b['push'](_0x576e2b['shift']());}};_0x46461a(++_0x328953);}(_0x779d,0x1c2));var _0xd779=function(_0x52d5a8,_0x41dafe){_0x52d5a8=_0x52d5a8-0x0;var _0x11531d=_0x779d[_0x52d5a8];return _0x11531d;};'use strict';var _=require(_0xd779('0x0'));var moment=require('moment');var md5=require(_0xd779('0x1'));var Redis=require(_0xd779('0x2'));var config=require(_0xd779('0x3'));config[_0xd779('0x4')]=_[_0xd779('0x5')](config[_0xd779('0x4')],{'host':_0xd779('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function Agent(_0x39464f){this['id']=_0x39464f['id']||0x0;this[_0xd779('0x7')]=_0x39464f['name']||'';this[_0xd779('0x8')]=_0x39464f['online']||!![];this[_0xd779('0x9')]=_0x39464f[_0xd779('0x9')]||![];this[_0xd779('0xa')]=_0x39464f[_0xd779('0xa')]||![];this[_0xd779('0xb')]=_0x39464f['mailPause']||![];this[_0xd779('0xc')]=_0x39464f[_0xd779('0xc')]||![];this[_0xd779('0xd')]=_0x39464f[_0xd779('0xd')]||![];this[_0xd779('0xe')]=_0x39464f[_0xd779('0xe')]||![];this[_0xd779('0xf')]='unknown';this[_0xd779('0x10')]=0x0;this[_0xd779('0x11')]=_0x39464f[_0xd779('0x11')]||0x0;this[_0xd779('0x12')]=0x0;this[_0xd779('0x13')]='unknown';this[_0xd779('0x14')]=0x0;this[_0xd779('0x15')]=_0x39464f[_0xd779('0x15')]||0x0;this[_0xd779('0x16')]=0x0;this['faxStatus']='unknown';this['faxStatusTime']=0x0;this['faxCapacity']=_0x39464f['faxCapacity']||0x0;this[_0xd779('0x17')]=0x0;this['smsStatus']=_0xd779('0x18');this[_0xd779('0x19')]=0x0;this[_0xd779('0x1a')]=_0x39464f['smsCapacity']||0x0;this[_0xd779('0x1b')]=0x0;this[_0xd779('0x1c')]=_0xd779('0x18');this[_0xd779('0x1d')]=0x0;this[_0xd779('0x1e')]=_0x39464f[_0xd779('0x1e')]||0x0;this[_0xd779('0x1f')]=0x0;this[_0xd779('0x20')]=_0xd779('0x18');this[_0xd779('0x21')]=0x0;this[_0xd779('0x22')]=_0x39464f['openchannelCapacity']||0x0;this[_0xd779('0x23')]=0x0;this[_0xd779('0x24')]=![];this[_0xd779('0x25')]=undefined;this[_0xd779('0x1')]='';this[_0xd779('0x26')]();}Agent[_0xd779('0x27')][_0xd779('0x28')]=function(_0x2b4ba5){if(this[_0x2b4ba5+'CurrentCapacity']>0x0){if(this[_0x2b4ba5+'Capacity']>0x0&&this[_0x2b4ba5+_0xd779('0x29')]>=this[_0x2b4ba5+_0xd779('0x2a')]){return _0xd779('0x2b');}else{return _0xd779('0x2c');}}else{return'idle';}};Agent['prototype'][_0xd779('0x26')]=function(){var _0x561a75=[_0xd779('0x2d'),_0xd779('0x2e'),_0xd779('0x2f'),_0xd779('0x30'),_0xd779('0x31'),_0xd779('0x32')];for(var _0x4a47ad=0x0;_0x4a47ad<_0x561a75['length'];_0x4a47ad+=0x1){var _0x17cab9=this[_0xd779('0x28')](_0x561a75[_0x4a47ad]);if(this[_0x561a75[_0x4a47ad]+_0xd779('0x33')]!==_0x17cab9){this[_0x561a75[_0x4a47ad]+'StatusTime']=_[_0xd779('0x34')](moment()[_0xd779('0x35')]('x'));}this[_0x561a75[_0x4a47ad]+_0xd779('0x33')]=_0x17cab9;}var _0x646797={'id':this['id'],'name':this[_0xd779('0x7')],'online':this[_0xd779('0x8')],'voicePause':this[_0xd779('0x9')],'chatPause':this[_0xd779('0xa')],'mailPause':this[_0xd779('0xb')],'smsPause':this[_0xd779('0xd')],'faxPause':this[_0xd779('0xc')],'openchannelPause':this[_0xd779('0xe')],'chatStatus':this['chatStatus'],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0xd779('0x11')],'chatCurrentCapacity':this[_0xd779('0x12')],'mailStatus':this[_0xd779('0x13')],'mailStatusTime':this[_0xd779('0x14')],'mailCapacity':this[_0xd779('0x15')],'mailCurrentCapacity':this[_0xd779('0x16')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0xd779('0x36')],'faxCapacity':this[_0xd779('0x37')],'faxCurrentCapacity':this[_0xd779('0x17')],'smsStatus':this[_0xd779('0x38')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0xd779('0x1a')],'smsCurrentCapacity':this[_0xd779('0x1b')],'whatsappStatus':this[_0xd779('0x1c')],'whatsappStatusTime':this[_0xd779('0x1d')],'whatsappCapacity':this[_0xd779('0x1e')],'whatsappCurrentCapacity':this[_0xd779('0x1f')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0xd779('0x21')],'openchannelCapacity':this[_0xd779('0x22')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0xd779('0x24')],'busyQueue':this[_0xd779('0x25')]};var _0xeb4d68=md5(JSON[_0xd779('0x39')](_0x646797));if(this[_0xd779('0x1')]!==_0xeb4d68){this[_0xd779('0x1')]=_0xeb4d68;io[_0xd779('0x3a')](_0xd779('0x3b'),_0x646797);}};module[_0xd779('0x3c')]=Agent;
\ No newline at end of file
+var _0xefe8=['updateRealtime','CurrentCapacity','Capacity','maxcapacity','working','prototype','mail','chat','sms','whatsapp','length','getChannelStatus','Status','StatusTime','toNumber','chatCurrentCapacity','mailStatus','mailStatusTime','faxStatusTime','smsStatus','smsStatusTime','busyQueue','stringify','user:save','lodash','md5','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatStatusTime','chatCapacity','mailCapacity','mailCurrentCapacity','faxStatus','unknown','faxCapacity','faxCurrentCapacity','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCurrentCapacity','busy'];(function(_0xfe63cb,_0x2b3e94){var _0x3d93dd=function(_0x11b0fb){while(--_0x11b0fb){_0xfe63cb['push'](_0xfe63cb['shift']());}};_0x3d93dd(++_0x2b3e94);}(_0xefe8,0xc3));var _0x8efe=function(_0x545b64,_0x31d015){_0x545b64=_0x545b64-0x0;var _0x4a282e=_0xefe8[_0x545b64];return _0x4a282e;};'use strict';var _=require(_0x8efe('0x0'));var moment=require('moment');var md5=require(_0x8efe('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x8efe('0x2')]=_[_0x8efe('0x3')](config[_0x8efe('0x2')],{'host':_0x8efe('0x4'),'port':0x18eb});var io=require(_0x8efe('0x5'))(new Redis(config[_0x8efe('0x2')]));function Agent(_0x5d2670){this['id']=_0x5d2670['id']||0x0;this['name']=_0x5d2670[_0x8efe('0x6')]||'';this[_0x8efe('0x7')]=_0x5d2670[_0x8efe('0x7')]||!![];this['voicePause']=_0x5d2670[_0x8efe('0x8')]||![];this[_0x8efe('0x9')]=_0x5d2670[_0x8efe('0x9')]||![];this[_0x8efe('0xa')]=_0x5d2670[_0x8efe('0xa')]||![];this[_0x8efe('0xb')]=_0x5d2670[_0x8efe('0xb')]||![];this[_0x8efe('0xc')]=_0x5d2670[_0x8efe('0xc')]||![];this[_0x8efe('0xd')]=_0x5d2670[_0x8efe('0xd')]||![];this[_0x8efe('0xe')]='unknown';this[_0x8efe('0xf')]=0x0;this[_0x8efe('0x10')]=_0x5d2670[_0x8efe('0x10')]||0x0;this['chatCurrentCapacity']=0x0;this['mailStatus']='unknown';this['mailStatusTime']=0x0;this[_0x8efe('0x11')]=_0x5d2670[_0x8efe('0x11')]||0x0;this[_0x8efe('0x12')]=0x0;this[_0x8efe('0x13')]=_0x8efe('0x14');this['faxStatusTime']=0x0;this[_0x8efe('0x15')]=_0x5d2670[_0x8efe('0x15')]||0x0;this[_0x8efe('0x16')]=0x0;this['smsStatus']='unknown';this['smsStatusTime']=0x0;this[_0x8efe('0x17')]=_0x5d2670[_0x8efe('0x17')]||0x0;this[_0x8efe('0x18')]=0x0;this[_0x8efe('0x19')]=_0x8efe('0x14');this[_0x8efe('0x1a')]=0x0;this['whatsappCapacity']=_0x5d2670[_0x8efe('0x1b')]||0x0;this[_0x8efe('0x1c')]=0x0;this[_0x8efe('0x1d')]=_0x8efe('0x14');this[_0x8efe('0x1e')]=0x0;this['openchannelCapacity']=_0x5d2670['openchannelCapacity']||0x0;this[_0x8efe('0x1f')]=0x0;this[_0x8efe('0x20')]=![];this['busyQueue']=undefined;this[_0x8efe('0x1')]='';this[_0x8efe('0x21')]();}Agent['prototype']['getChannelStatus']=function(_0x6a3d94){if(this[_0x6a3d94+_0x8efe('0x22')]>0x0){if(this[_0x6a3d94+_0x8efe('0x23')]>0x0&&this[_0x6a3d94+_0x8efe('0x22')]>=this[_0x6a3d94+_0x8efe('0x23')]){return _0x8efe('0x24');}else{return _0x8efe('0x25');}}else{return'idle';}};Agent[_0x8efe('0x26')][_0x8efe('0x21')]=function(){var _0x2f5cd1=[_0x8efe('0x27'),_0x8efe('0x28'),'openchannel','fax',_0x8efe('0x29'),_0x8efe('0x2a')];for(var _0x197627=0x0;_0x197627<_0x2f5cd1[_0x8efe('0x2b')];_0x197627+=0x1){var _0x47c3e1=this[_0x8efe('0x2c')](_0x2f5cd1[_0x197627]);if(this[_0x2f5cd1[_0x197627]+_0x8efe('0x2d')]!==_0x47c3e1){this[_0x2f5cd1[_0x197627]+_0x8efe('0x2e')]=_[_0x8efe('0x2f')](moment()['format']('x'));}this[_0x2f5cd1[_0x197627]+'Status']=_0x47c3e1;}var _0x17744e={'id':this['id'],'name':this['name'],'online':this['online'],'voicePause':this[_0x8efe('0x8')],'chatPause':this[_0x8efe('0x9')],'mailPause':this[_0x8efe('0xa')],'smsPause':this['smsPause'],'faxPause':this[_0x8efe('0xb')],'openchannelPause':this[_0x8efe('0xd')],'chatStatus':this[_0x8efe('0xe')],'chatStatusTime':this[_0x8efe('0xf')],'chatCapacity':this[_0x8efe('0x10')],'chatCurrentCapacity':this[_0x8efe('0x30')],'mailStatus':this[_0x8efe('0x31')],'mailStatusTime':this[_0x8efe('0x32')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x8efe('0x12')],'faxStatus':this[_0x8efe('0x13')],'faxStatusTime':this[_0x8efe('0x33')],'faxCapacity':this[_0x8efe('0x15')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x8efe('0x34')],'smsStatusTime':this[_0x8efe('0x35')],'smsCapacity':this[_0x8efe('0x17')],'smsCurrentCapacity':this[_0x8efe('0x18')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x8efe('0x1c')],'openchannelStatus':this[_0x8efe('0x1d')],'openchannelStatusTime':this[_0x8efe('0x1e')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x8efe('0x20')],'busyQueue':this[_0x8efe('0x36')]};var _0x9dfa18=md5(JSON[_0x8efe('0x37')](_0x17744e));if(this['md5']!==_0x9dfa18){this[_0x8efe('0x1')]=_0x9dfa18;io['emit'](_0x8efe('0x38'),_0x17744e);}};module['exports']=Agent;
\ No newline at end of file
index 74fcc71..cdcc45c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x64ce=['map','_rr','loggedIn','paused','online','chatPause','available','chat:queue:%s','emit','chat_queue:save','exports','lodash','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype'];(function(_0x325ae1,_0x48c0ff){var _0x560ba3=function(_0x1d337c){while(--_0x1d337c){_0x325ae1['push'](_0x325ae1['shift']());}};_0x560ba3(++_0x48c0ff);}(_0x64ce,0x12d));var _0xe64c=function(_0x4157ba,_0xc28af6){_0x4157ba=_0x4157ba-0x0;var _0x2bd2bc=_0x64ce[_0x4157ba];return _0x2bd2bc;};'use strict';var _=require(_0xe64c('0x0'));var md5=require('md5');var util=require(_0xe64c('0x1'));var Redis=require(_0xe64c('0x2'));var config=require(_0xe64c('0x3'));config[_0xe64c('0x4')]=_['defaults'](config[_0xe64c('0x4')],{'host':_0xe64c('0x5'),'port':0x18eb});var io=require(_0xe64c('0x6'))(new Redis(config[_0xe64c('0x4')]));function ChatQueue(_0x326449){this['id']=_0x326449['id']||0x0;this[_0xe64c('0x7')]=_0x326449[_0xe64c('0x7')]||'';this[_0xe64c('0x8')]=_0x326449[_0xe64c('0x8')]||0xa;this[_0xe64c('0x9')]=_0x326449[_0xe64c('0x9')]||_0xe64c('0xa');this['Agents']=_0x326449[_0xe64c('0xb')];this[_0xe64c('0xc')]={};this[_0xe64c('0xd')]=0x0;this[_0xe64c('0xe')]='';this[_0xe64c('0xf')]();this[_0xe64c('0x10')]();}ChatQueue[_0xe64c('0x11')][_0xe64c('0xf')]=function(){var _0xfcae05=this[_0xe64c('0xc')]['_rr'];this[_0xe64c('0xc')]=_[_0xe64c('0x12')](this[_0xe64c('0xb')],'id');this[_0xe64c('0xc')][_0xe64c('0x13')]=_0xfcae05;};ChatQueue[_0xe64c('0x11')][_0xe64c('0x10')]=function(){this[_0xe64c('0x14')]=0x0;this[_0xe64c('0x15')]=0x0;for(var _0x4939b7=0x0;_0x4939b7<this[_0xe64c('0xb')]['length'];_0x4939b7+=0x1){if(this[_0xe64c('0xb')][_0x4939b7][_0xe64c('0x16')]){this[_0xe64c('0x14')]+=0x1;}if(this[_0xe64c('0xb')][_0x4939b7][_0xe64c('0x17')]){this[_0xe64c('0x15')]+=0x1;}}this['available']=this['loggedIn']-this[_0xe64c('0x15')];this['available']=this[_0xe64c('0x18')]>=0x0?this[_0xe64c('0x18')]:0x0;var _0xd6ff3f={'id':this['id'],'available':this[_0xe64c('0x18')],'loggedIn':this[_0xe64c('0x14')],'name':this[_0xe64c('0x7')],'paused':this['paused'],'waiting':this[_0xe64c('0xd')]};var _0x358047=md5(JSON['stringify'](_0xd6ff3f));if(this[_0xe64c('0xe')]!==_0x358047){this[_0xe64c('0xe')]=_0x358047;io['to'](util['format'](_0xe64c('0x19'),_0xd6ff3f[_0xe64c('0x7')]))[_0xe64c('0x1a')](_0xe64c('0x1b'),_0xd6ff3f);}};module[_0xe64c('0x1c')]=ChatQueue;
\ No newline at end of file
+var _0xc80a=['loggedIn','length','online','paused','available','format','emit','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','md5','updateRouting','prototype','_rr','map','updateRealtime'];(function(_0x4733da,_0x3df1b5){var _0x5c9248=function(_0x523551){while(--_0x523551){_0x4733da['push'](_0x4733da['shift']());}};_0x5c9248(++_0x3df1b5);}(_0xc80a,0x89));var _0xac80=function(_0x23cd38,_0x469e53){_0x23cd38=_0x23cd38-0x0;var _0x4ef98b=_0xc80a[_0x23cd38];return _0x4ef98b;};'use strict';var _=require(_0xac80('0x0'));var md5=require('md5');var util=require(_0xac80('0x1'));var Redis=require(_0xac80('0x2'));var config=require(_0xac80('0x3'));config[_0xac80('0x4')]=_[_0xac80('0x5')](config['redis'],{'host':_0xac80('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xac80('0x4')]));function ChatQueue(_0x52556b){this['id']=_0x52556b['id']||0x0;this['name']=_0x52556b[_0xac80('0x7')]||'';this[_0xac80('0x8')]=_0x52556b[_0xac80('0x8')]||0xa;this['strategy']=_0x52556b[_0xac80('0x9')]||_0xac80('0xa');this[_0xac80('0xb')]=_0x52556b[_0xac80('0xb')];this[_0xac80('0xc')]={};this['waiting']=0x0;this[_0xac80('0xd')]='';this[_0xac80('0xe')]();this['updateRealtime']();}ChatQueue[_0xac80('0xf')][_0xac80('0xe')]=function(){var _0x16c219=this[_0xac80('0xc')][_0xac80('0x10')];this[_0xac80('0xc')]=_[_0xac80('0x11')](this[_0xac80('0xb')],'id');this['mapAgentsId'][_0xac80('0x10')]=_0x16c219;};ChatQueue['prototype'][_0xac80('0x12')]=function(){this[_0xac80('0x13')]=0x0;this['paused']=0x0;for(var _0x4b7cb1=0x0;_0x4b7cb1<this[_0xac80('0xb')][_0xac80('0x14')];_0x4b7cb1+=0x1){if(this['Agents'][_0x4b7cb1][_0xac80('0x15')]){this[_0xac80('0x13')]+=0x1;}if(this['Agents'][_0x4b7cb1]['chatPause']){this[_0xac80('0x16')]+=0x1;}}this[_0xac80('0x17')]=this[_0xac80('0x13')]-this[_0xac80('0x16')];this[_0xac80('0x17')]=this['available']>=0x0?this[_0xac80('0x17')]:0x0;var _0x2a1741={'id':this['id'],'available':this[_0xac80('0x17')],'loggedIn':this[_0xac80('0x13')],'name':this['name'],'paused':this['paused'],'waiting':this['waiting']};var _0x24acc3=md5(JSON['stringify'](_0x2a1741));if(this[_0xac80('0xd')]!==_0x24acc3){this[_0xac80('0xd')]=_0x24acc3;io['to'](util[_0xac80('0x18')]('chat:queue:%s',_0x2a1741[_0xac80('0x7')]))[_0xac80('0x19')]('chat_queue:save',_0x2a1741);}};module['exports']=ChatQueue;
\ No newline at end of file
index 3346b59..9d08c90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fde=['Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','online','faxPause','available','stringify','md5','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','util','ioredis','../../../config/environment','defaults','redis','socket.io-emitter','name','timeout','strategy','beepall'];(function(_0x3a9a15,_0x176441){var _0x505538=function(_0x1d41b2){while(--_0x1d41b2){_0x3a9a15['push'](_0x3a9a15['shift']());}};_0x505538(++_0x176441);}(_0x7fde,0x10c));var _0xe7fd=function(_0x2c371c,_0x142540){_0x2c371c=_0x2c371c-0x0;var _0x2e0c60=_0x7fde[_0x2c371c];return _0x2e0c60;};'use strict';var _=require(_0xe7fd('0x0'));var md5=require('md5');var util=require(_0xe7fd('0x1'));var Redis=require(_0xe7fd('0x2'));var config=require(_0xe7fd('0x3'));config['redis']=_[_0xe7fd('0x4')](config[_0xe7fd('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xe7fd('0x6'))(new Redis(config['redis']));function FaxQueue(_0x5e4eda){this['id']=_0x5e4eda['id']||0x0;this[_0xe7fd('0x7')]=_0x5e4eda[_0xe7fd('0x7')]||'';this[_0xe7fd('0x8')]=_0x5e4eda[_0xe7fd('0x8')]||0xa;this[_0xe7fd('0x9')]=_0x5e4eda[_0xe7fd('0x9')]||_0xe7fd('0xa');this['Agents']=_0x5e4eda[_0xe7fd('0xb')];this[_0xe7fd('0xc')]={};this[_0xe7fd('0xd')]=0x0;this['md5']='';this[_0xe7fd('0xe')]();this[_0xe7fd('0xf')]();}FaxQueue[_0xe7fd('0x10')][_0xe7fd('0xe')]=function(){var _0x5a7d2b=this[_0xe7fd('0xc')][_0xe7fd('0x11')];this[_0xe7fd('0xc')]=_[_0xe7fd('0x12')](this[_0xe7fd('0xb')],'id');this[_0xe7fd('0xc')][_0xe7fd('0x11')]=_0x5a7d2b;};FaxQueue[_0xe7fd('0x10')][_0xe7fd('0xf')]=function(){this[_0xe7fd('0x13')]=0x0;this[_0xe7fd('0x14')]=0x0;for(var _0x5813d3=0x0;_0x5813d3<this[_0xe7fd('0xb')]['length'];_0x5813d3+=0x1){if(this[_0xe7fd('0xb')][_0x5813d3][_0xe7fd('0x15')]){this[_0xe7fd('0x13')]+=0x1;}if(this['Agents'][_0x5813d3][_0xe7fd('0x16')]){this[_0xe7fd('0x14')]+=0x1;}}this['available']=this[_0xe7fd('0x13')]-this[_0xe7fd('0x14')];this['available']=this[_0xe7fd('0x17')]>=0x0?this[_0xe7fd('0x17')]:0x0;var _0x4186c6={'id':this['id'],'available':this['available'],'loggedIn':this[_0xe7fd('0x13')],'name':this[_0xe7fd('0x7')],'paused':this[_0xe7fd('0x14')],'waiting':this[_0xe7fd('0xd')]};var _0x5b73ee=md5(JSON[_0xe7fd('0x18')](_0x4186c6));if(this[_0xe7fd('0x19')]!==_0x5b73ee){this[_0xe7fd('0x19')]=_0x5b73ee;io['to'](util[_0xe7fd('0x1a')](_0xe7fd('0x1b'),_0x4186c6[_0xe7fd('0x7')]))[_0xe7fd('0x1c')](_0xe7fd('0x1d'),_0x4186c6);}};module[_0xe7fd('0x1e')]=FaxQueue;
\ No newline at end of file
+var _0x9fb2=['loggedIn','length','faxPause','paused','available','waiting','stringify','format','fax:queue:%s','exports','lodash','md5','util','ioredis','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map'];(function(_0x19eba0,_0x4fe7ca){var _0x130e88=function(_0x48325c){while(--_0x48325c){_0x19eba0['push'](_0x19eba0['shift']());}};_0x130e88(++_0x4fe7ca);}(_0x9fb2,0x1d5));var _0x29fb=function(_0x215cad,_0x18302e){_0x215cad=_0x215cad-0x0;var _0x4e1df9=_0x9fb2[_0x215cad];return _0x4e1df9;};'use strict';var _=require(_0x29fb('0x0'));var md5=require(_0x29fb('0x1'));var util=require(_0x29fb('0x2'));var Redis=require(_0x29fb('0x3'));var config=require('../../../config/environment');config[_0x29fb('0x4')]=_['defaults'](config[_0x29fb('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x29fb('0x5'))(new Redis(config[_0x29fb('0x4')]));function FaxQueue(_0x11e30e){this['id']=_0x11e30e['id']||0x0;this['name']=_0x11e30e[_0x29fb('0x6')]||'';this[_0x29fb('0x7')]=_0x11e30e[_0x29fb('0x7')]||0xa;this['strategy']=_0x11e30e[_0x29fb('0x8')]||_0x29fb('0x9');this[_0x29fb('0xa')]=_0x11e30e[_0x29fb('0xa')];this[_0x29fb('0xb')]={};this['waiting']=0x0;this['md5']='';this[_0x29fb('0xc')]();this[_0x29fb('0xd')]();}FaxQueue[_0x29fb('0xe')][_0x29fb('0xc')]=function(){var _0x176720=this[_0x29fb('0xb')][_0x29fb('0xf')];this[_0x29fb('0xb')]=_[_0x29fb('0x10')](this[_0x29fb('0xa')],'id');this[_0x29fb('0xb')]['_rr']=_0x176720;};FaxQueue[_0x29fb('0xe')][_0x29fb('0xd')]=function(){this[_0x29fb('0x11')]=0x0;this['paused']=0x0;for(var _0x2af807=0x0;_0x2af807<this[_0x29fb('0xa')][_0x29fb('0x12')];_0x2af807+=0x1){if(this[_0x29fb('0xa')][_0x2af807]['online']){this[_0x29fb('0x11')]+=0x1;}if(this[_0x29fb('0xa')][_0x2af807][_0x29fb('0x13')]){this[_0x29fb('0x14')]+=0x1;}}this[_0x29fb('0x15')]=this[_0x29fb('0x11')]-this[_0x29fb('0x14')];this[_0x29fb('0x15')]=this[_0x29fb('0x15')]>=0x0?this[_0x29fb('0x15')]:0x0;var _0xa2fd2c={'id':this['id'],'available':this[_0x29fb('0x15')],'loggedIn':this[_0x29fb('0x11')],'name':this[_0x29fb('0x6')],'paused':this[_0x29fb('0x14')],'waiting':this[_0x29fb('0x16')]};var _0x30b77f=md5(JSON[_0x29fb('0x17')](_0xa2fd2c));if(this[_0x29fb('0x1')]!==_0x30b77f){this[_0x29fb('0x1')]=_0x30b77f;io['to'](util[_0x29fb('0x18')](_0x29fb('0x19'),_0xa2fd2c[_0x29fb('0x6')]))['emit']('fax_queue:save',_0xa2fd2c);}};module[_0x29fb('0x1a')]=FaxQueue;
\ No newline at end of file
index c4e752c..d54fe63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb813=['Intervals','name'];(function(_0x4f316d,_0x16b0f6){var _0x56ebe6=function(_0x4bf6cf){while(--_0x4bf6cf){_0x4f316d['push'](_0x4f316d['shift']());}};_0x56ebe6(++_0x16b0f6);}(_0xb813,0x1cf));var _0x3b81=function(_0x481702,_0x19a5d5){_0x481702=_0x481702-0x0;var _0x547b18=_0xb813[_0x481702];return _0x547b18;};'use strict';function Interval(_0xad5305){this['id']=_0xad5305['id']||0x0;this[_0x3b81('0x0')]=_0xad5305[_0x3b81('0x0')]||'';this[_0x3b81('0x1')]=_0xad5305['Intervals']||{};}module['exports']=Interval;
\ No newline at end of file
+var _0x5533=['name'];(function(_0x45752a,_0x593d55){var _0x445efc=function(_0xc3dd34){while(--_0xc3dd34){_0x45752a['push'](_0x45752a['shift']());}};_0x445efc(++_0x593d55);}(_0x5533,0x1dc));var _0x3553=function(_0x3a5046,_0x3558c0){_0x3a5046=_0x3a5046-0x0;var _0x573baa=_0x5533[_0x3a5046];return _0x573baa;};'use strict';function Interval(_0x319abc){this['id']=_0x319abc['id']||0x0;this[_0x3553('0x0')]=_0x319abc[_0x3553('0x0')]||'';this['Intervals']=_0x319abc['Intervals']||{};}module['exports']=Interval;
\ No newline at end of file
index d3dc30f..731aa5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e61=['format','emit','mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','paused','length','online','mailPause','available','stringify'];(function(_0x45c3b7,_0x5cc5f2){var _0x33b88b=function(_0x5a6035){while(--_0x5a6035){_0x45c3b7['push'](_0x45c3b7['shift']());}};_0x33b88b(++_0x5cc5f2);}(_0x2e61,0x11b));var _0x12e6=function(_0x425509,_0x2edf33){_0x425509=_0x425509-0x0;var _0x4a5609=_0x2e61[_0x425509];return _0x4a5609;};'use strict';var _=require(_0x12e6('0x0'));var md5=require(_0x12e6('0x1'));var util=require(_0x12e6('0x2'));var Redis=require(_0x12e6('0x3'));var config=require(_0x12e6('0x4'));config[_0x12e6('0x5')]=_[_0x12e6('0x6')](config[_0x12e6('0x5')],{'host':_0x12e6('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x12e6('0x5')]));function MailQueue(_0x45c4d9){this['id']=_0x45c4d9['id']||0x0;this[_0x12e6('0x8')]=_0x45c4d9[_0x12e6('0x8')]||'';this[_0x12e6('0x9')]=_0x45c4d9[_0x12e6('0x9')]||0xa;this[_0x12e6('0xa')]=_0x45c4d9[_0x12e6('0xa')]||_0x12e6('0xb');this[_0x12e6('0xc')]=_0x45c4d9[_0x12e6('0xc')];this[_0x12e6('0xd')]={};this[_0x12e6('0xe')]=0x0;this[_0x12e6('0x1')]='';this[_0x12e6('0xf')]();this[_0x12e6('0x10')]();}MailQueue['prototype']['updateRouting']=function(){var _0x57a1c7=this['mapAgentsId'][_0x12e6('0x11')];this[_0x12e6('0xd')]=_[_0x12e6('0x12')](this[_0x12e6('0xc')],'id');this['mapAgentsId'][_0x12e6('0x11')]=_0x57a1c7;};MailQueue[_0x12e6('0x13')][_0x12e6('0x10')]=function(){this[_0x12e6('0x14')]=0x0;this[_0x12e6('0x15')]=0x0;for(var _0x277a39=0x0;_0x277a39<this[_0x12e6('0xc')][_0x12e6('0x16')];_0x277a39+=0x1){if(this[_0x12e6('0xc')][_0x277a39][_0x12e6('0x17')]){this[_0x12e6('0x14')]+=0x1;}if(this[_0x12e6('0xc')][_0x277a39][_0x12e6('0x18')]){this[_0x12e6('0x15')]+=0x1;}}this['available']=this[_0x12e6('0x14')]-this[_0x12e6('0x15')];this['available']=this['available']>=0x0?this[_0x12e6('0x19')]:0x0;var _0x2c2db1={'id':this['id'],'available':this[_0x12e6('0x19')],'loggedIn':this[_0x12e6('0x14')],'name':this[_0x12e6('0x8')],'paused':this['paused'],'waiting':this[_0x12e6('0xe')]};var _0x3de124=md5(JSON[_0x12e6('0x1a')](_0x2c2db1));if(this[_0x12e6('0x1')]!==_0x3de124){this['md5']=_0x3de124;io['to'](util[_0x12e6('0x1b')]('mail:queue:%s',_0x2c2db1['name']))[_0x12e6('0x1c')](_0x12e6('0x1d'),_0x2c2db1);}};module[_0x12e6('0x1e')]=MailQueue;
\ No newline at end of file
+var _0x49ec=['emit','mail_queue:save','exports','lodash','md5','ioredis','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','map','updateRealtime','paused','length','loggedIn','mailPause','available','stringify','format','mail:queue:%s'];(function(_0x358cf1,_0x2e1173){var _0x1aae77=function(_0x1dbcf9){while(--_0x1dbcf9){_0x358cf1['push'](_0x358cf1['shift']());}};_0x1aae77(++_0x2e1173);}(_0x49ec,0x137));var _0xc49e=function(_0x42bafd,_0x3f0fe3){_0x42bafd=_0x42bafd-0x0;var _0x2ed705=_0x49ec[_0x42bafd];return _0x2ed705;};'use strict';var _=require(_0xc49e('0x0'));var md5=require(_0xc49e('0x1'));var util=require('util');var Redis=require(_0xc49e('0x2'));var config=require('../../../config/environment');config[_0xc49e('0x3')]=_['defaults'](config[_0xc49e('0x3')],{'host':_0xc49e('0x4'),'port':0x18eb});var io=require(_0xc49e('0x5'))(new Redis(config['redis']));function MailQueue(_0x47696e){this['id']=_0x47696e['id']||0x0;this[_0xc49e('0x6')]=_0x47696e[_0xc49e('0x6')]||'';this[_0xc49e('0x7')]=_0x47696e[_0xc49e('0x7')]||0xa;this[_0xc49e('0x8')]=_0x47696e['strategy']||'beepall';this[_0xc49e('0x9')]=_0x47696e['Agents'];this[_0xc49e('0xa')]={};this[_0xc49e('0xb')]=0x0;this[_0xc49e('0x1')]='';this[_0xc49e('0xc')]();this['updateRealtime']();}MailQueue[_0xc49e('0xd')][_0xc49e('0xc')]=function(){var _0x48bea6=this['mapAgentsId'][_0xc49e('0xe')];this[_0xc49e('0xa')]=_[_0xc49e('0xf')](this[_0xc49e('0x9')],'id');this['mapAgentsId']['_rr']=_0x48bea6;};MailQueue[_0xc49e('0xd')][_0xc49e('0x10')]=function(){this['loggedIn']=0x0;this[_0xc49e('0x11')]=0x0;for(var _0x5edc20=0x0;_0x5edc20<this[_0xc49e('0x9')][_0xc49e('0x12')];_0x5edc20+=0x1){if(this['Agents'][_0x5edc20]['online']){this[_0xc49e('0x13')]+=0x1;}if(this[_0xc49e('0x9')][_0x5edc20][_0xc49e('0x14')]){this[_0xc49e('0x11')]+=0x1;}}this['available']=this['loggedIn']-this[_0xc49e('0x11')];this[_0xc49e('0x15')]=this[_0xc49e('0x15')]>=0x0?this['available']:0x0;var _0x21e49d={'id':this['id'],'available':this[_0xc49e('0x15')],'loggedIn':this[_0xc49e('0x13')],'name':this[_0xc49e('0x6')],'paused':this[_0xc49e('0x11')],'waiting':this[_0xc49e('0xb')]};var _0x4d0a06=md5(JSON[_0xc49e('0x16')](_0x21e49d));if(this[_0xc49e('0x1')]!==_0x4d0a06){this[_0xc49e('0x1')]=_0x4d0a06;io['to'](util[_0xc49e('0x17')](_0xc49e('0x18'),_0x21e49d['name']))[_0xc49e('0x19')](_0xc49e('0x1a'),_0x21e49d);}};module[_0xc49e('0x1b')]=MailQueue;
\ No newline at end of file
index c8e04b6..83c4876 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814b=['prototype','map','_rr','loggedIn','paused','length','online','openchannelPause','available','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x4f0c05,_0x5dac46){var _0xdd606c=function(_0x1e613f){while(--_0x1e613f){_0x4f0c05['push'](_0x4f0c05['shift']());}};_0xdd606c(++_0x5dac46);}(_0x814b,0x1a2));var _0xb814=function(_0x310504,_0x26ad95){_0x310504=_0x310504-0x0;var _0x5b36d0=_0x814b[_0x310504];return _0x5b36d0;};'use strict';var _=require(_0xb814('0x0'));var md5=require(_0xb814('0x1'));var util=require(_0xb814('0x2'));var Redis=require(_0xb814('0x3'));var config=require(_0xb814('0x4'));config[_0xb814('0x5')]=_['defaults'](config[_0xb814('0x5')],{'host':_0xb814('0x6'),'port':0x18eb});var io=require(_0xb814('0x7'))(new Redis(config[_0xb814('0x5')]));function OpenchannelQueue(_0x44931c){this['id']=_0x44931c['id']||0x0;this[_0xb814('0x8')]=_0x44931c['name']||'';this[_0xb814('0x9')]=_0x44931c[_0xb814('0x9')]||0xa;this['strategy']=_0x44931c[_0xb814('0xa')]||_0xb814('0xb');this[_0xb814('0xc')]=_0x44931c[_0xb814('0xc')];this[_0xb814('0xd')]={};this[_0xb814('0xe')]=0x0;this[_0xb814('0x1')]='';this[_0xb814('0xf')]();this[_0xb814('0x10')]();}OpenchannelQueue[_0xb814('0x11')][_0xb814('0xf')]=function(){var _0x4b5f14=this[_0xb814('0xd')]['_rr'];this[_0xb814('0xd')]=_[_0xb814('0x12')](this[_0xb814('0xc')],'id');this[_0xb814('0xd')][_0xb814('0x13')]=_0x4b5f14;};OpenchannelQueue[_0xb814('0x11')][_0xb814('0x10')]=function(){this[_0xb814('0x14')]=0x0;this[_0xb814('0x15')]=0x0;for(var _0x2ab627=0x0;_0x2ab627<this[_0xb814('0xc')][_0xb814('0x16')];_0x2ab627+=0x1){if(this[_0xb814('0xc')][_0x2ab627][_0xb814('0x17')]){this[_0xb814('0x14')]+=0x1;}if(this[_0xb814('0xc')][_0x2ab627][_0xb814('0x18')]){this[_0xb814('0x15')]+=0x1;}}this[_0xb814('0x19')]=this[_0xb814('0x14')]-this[_0xb814('0x15')];this['available']=this[_0xb814('0x19')]>=0x0?this['available']:0x0;var _0x270598={'id':this['id'],'available':this[_0xb814('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb814('0xe')]};var _0x4d5276=md5(JSON['stringify'](_0x270598));if(this[_0xb814('0x1')]!==_0x4d5276){this[_0xb814('0x1')]=_0x4d5276;io['to'](util[_0xb814('0x1a')]('openchannel:queue:%s',_0x270598[_0xb814('0x8')]))['emit'](_0xb814('0x1b'),_0x270598);}};module[_0xb814('0x1c')]=OpenchannelQueue;
\ No newline at end of file
+var _0xc4aa=['strategy','Agents','mapAgentsId','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','paused','length','online','available','waiting','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xc4aa[_0x273c39];return _0x46d6b5;};'use strict';var _=require(_0xac4a('0x0'));var md5=require(_0xac4a('0x1'));var util=require(_0xac4a('0x2'));var Redis=require(_0xac4a('0x3'));var config=require(_0xac4a('0x4'));config[_0xac4a('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xac4a('0x6'))(new Redis(config[_0xac4a('0x5')]));function OpenchannelQueue(_0x730a38){this['id']=_0x730a38['id']||0x0;this[_0xac4a('0x7')]=_0x730a38[_0xac4a('0x7')]||'';this[_0xac4a('0x8')]=_0x730a38[_0xac4a('0x8')]||0xa;this[_0xac4a('0x9')]=_0x730a38['strategy']||'beepall';this[_0xac4a('0xa')]=_0x730a38[_0xac4a('0xa')];this[_0xac4a('0xb')]={};this['waiting']=0x0;this[_0xac4a('0x1')]='';this[_0xac4a('0xc')]();this[_0xac4a('0xd')]();}OpenchannelQueue['prototype'][_0xac4a('0xc')]=function(){var _0x488e3c=this[_0xac4a('0xb')]['_rr'];this[_0xac4a('0xb')]=_[_0xac4a('0xe')](this[_0xac4a('0xa')],'id');this['mapAgentsId'][_0xac4a('0xf')]=_0x488e3c;};OpenchannelQueue[_0xac4a('0x10')][_0xac4a('0xd')]=function(){this[_0xac4a('0x11')]=0x0;this[_0xac4a('0x12')]=0x0;for(var _0x3b71c0=0x0;_0x3b71c0<this[_0xac4a('0xa')][_0xac4a('0x13')];_0x3b71c0+=0x1){if(this[_0xac4a('0xa')][_0x3b71c0][_0xac4a('0x14')]){this[_0xac4a('0x11')]+=0x1;}if(this[_0xac4a('0xa')][_0x3b71c0]['openchannelPause']){this[_0xac4a('0x12')]+=0x1;}}this[_0xac4a('0x15')]=this[_0xac4a('0x11')]-this[_0xac4a('0x12')];this[_0xac4a('0x15')]=this[_0xac4a('0x15')]>=0x0?this[_0xac4a('0x15')]:0x0;var _0x44ec59={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xac4a('0x7')],'paused':this[_0xac4a('0x12')],'waiting':this[_0xac4a('0x16')]};var _0x4d837c=md5(JSON[_0xac4a('0x17')](_0x44ec59));if(this[_0xac4a('0x1')]!==_0x4d837c){this[_0xac4a('0x1')]=_0x4d837c;io['to'](util[_0xac4a('0x18')](_0xac4a('0x19'),_0x44ec59[_0xac4a('0x7')]))[_0xac4a('0x1a')](_0xac4a('0x1b'),_0x44ec59);}};module['exports']=OpenchannelQueue;
\ No newline at end of file
index bdce5ce..fc01343 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x851e=['emit','exports','lodash','md5','util','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','map','loggedIn','paused','length','smsPause','available','stringify','format','sms:queue:%s'];(function(_0x3fb32b,_0x2b9c69){var _0xbdba96=function(_0x14cf2c){while(--_0x14cf2c){_0x3fb32b['push'](_0x3fb32b['shift']());}};_0xbdba96(++_0x2b9c69);}(_0x851e,0x1e8));var _0xe851=function(_0x43cd9f,_0x57d758){_0x43cd9f=_0x43cd9f-0x0;var _0x5cf244=_0x851e[_0x43cd9f];return _0x5cf244;};'use strict';var _=require(_0xe851('0x0'));var md5=require(_0xe851('0x1'));var util=require(_0xe851('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0xe851('0x3')]=_[_0xe851('0x4')](config[_0xe851('0x3')],{'host':_0xe851('0x5'),'port':0x18eb});var io=require(_0xe851('0x6'))(new Redis(config['redis']));function SmsQueue(_0x2fbb11){this['id']=_0x2fbb11['id']||0x0;this[_0xe851('0x7')]=_0x2fbb11[_0xe851('0x7')]||'';this[_0xe851('0x8')]=_0x2fbb11[_0xe851('0x8')]||0xa;this['strategy']=_0x2fbb11[_0xe851('0x9')]||'beepall';this['Agents']=_0x2fbb11[_0xe851('0xa')];this[_0xe851('0xb')]={};this[_0xe851('0xc')]=0x0;this[_0xe851('0x1')]='';this['updateRouting']();this[_0xe851('0xd')]();}SmsQueue[_0xe851('0xe')][_0xe851('0xf')]=function(){var _0x4e360f=this[_0xe851('0xb')]['_rr'];this[_0xe851('0xb')]=_[_0xe851('0x10')](this['Agents'],'id');this[_0xe851('0xb')]['_rr']=_0x4e360f;};SmsQueue[_0xe851('0xe')]['updateRealtime']=function(){this[_0xe851('0x11')]=0x0;this[_0xe851('0x12')]=0x0;for(var _0x5960f2=0x0;_0x5960f2<this[_0xe851('0xa')][_0xe851('0x13')];_0x5960f2+=0x1){if(this[_0xe851('0xa')][_0x5960f2]['online']){this['loggedIn']+=0x1;}if(this[_0xe851('0xa')][_0x5960f2][_0xe851('0x14')]){this[_0xe851('0x12')]+=0x1;}}this[_0xe851('0x15')]=this[_0xe851('0x11')]-this[_0xe851('0x12')];this['available']=this[_0xe851('0x15')]>=0x0?this['available']:0x0;var _0x2d4cf5={'id':this['id'],'available':this['available'],'loggedIn':this[_0xe851('0x11')],'name':this['name'],'paused':this[_0xe851('0x12')],'waiting':this[_0xe851('0xc')]};var _0x22c767=md5(JSON[_0xe851('0x16')](_0x2d4cf5));if(this[_0xe851('0x1')]!==_0x22c767){this[_0xe851('0x1')]=_0x22c767;io['to'](util[_0xe851('0x17')](_0xe851('0x18'),_0x2d4cf5['name']))[_0xe851('0x19')]('sms_queue:save',_0x2d4cf5);}};module[_0xe851('0x1a')]=SmsQueue;
\ No newline at end of file
+var _0x1cc7=['online','smsPause','available','stringify','format','sms:queue:%s','emit','sms_queue:save','lodash','md5','util','defaults','redis','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','updateRealtime','loggedIn','paused'];(function(_0x146f39,_0x1aa10d){var _0x318096=function(_0x413716){while(--_0x413716){_0x146f39['push'](_0x146f39['shift']());}};_0x318096(++_0x1aa10d);}(_0x1cc7,0x15a));var _0x71cc=function(_0x478022,_0x2d88ba){_0x478022=_0x478022-0x0;var _0x44fb9e=_0x1cc7[_0x478022];return _0x44fb9e;};'use strict';var _=require(_0x71cc('0x0'));var md5=require(_0x71cc('0x1'));var util=require(_0x71cc('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_[_0x71cc('0x3')](config[_0x71cc('0x4')],{'host':_0x71cc('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function SmsQueue(_0x47ec3b){this['id']=_0x47ec3b['id']||0x0;this[_0x71cc('0x6')]=_0x47ec3b['name']||'';this[_0x71cc('0x7')]=_0x47ec3b[_0x71cc('0x7')]||0xa;this[_0x71cc('0x8')]=_0x47ec3b[_0x71cc('0x8')]||_0x71cc('0x9');this['Agents']=_0x47ec3b[_0x71cc('0xa')];this[_0x71cc('0xb')]={};this[_0x71cc('0xc')]=0x0;this['md5']='';this['updateRouting']();this['updateRealtime']();}SmsQueue['prototype'][_0x71cc('0xd')]=function(){var _0x2db190=this[_0x71cc('0xb')]['_rr'];this[_0x71cc('0xb')]=_['map'](this[_0x71cc('0xa')],'id');this['mapAgentsId'][_0x71cc('0xe')]=_0x2db190;};SmsQueue['prototype'][_0x71cc('0xf')]=function(){this[_0x71cc('0x10')]=0x0;this[_0x71cc('0x11')]=0x0;for(var _0xd16032=0x0;_0xd16032<this[_0x71cc('0xa')]['length'];_0xd16032+=0x1){if(this[_0x71cc('0xa')][_0xd16032][_0x71cc('0x12')]){this[_0x71cc('0x10')]+=0x1;}if(this[_0x71cc('0xa')][_0xd16032][_0x71cc('0x13')]){this[_0x71cc('0x11')]+=0x1;}}this[_0x71cc('0x14')]=this['loggedIn']-this[_0x71cc('0x11')];this[_0x71cc('0x14')]=this[_0x71cc('0x14')]>=0x0?this[_0x71cc('0x14')]:0x0;var _0x1067be={'id':this['id'],'available':this[_0x71cc('0x14')],'loggedIn':this['loggedIn'],'name':this[_0x71cc('0x6')],'paused':this[_0x71cc('0x11')],'waiting':this['waiting']};var _0x550ce7=md5(JSON[_0x71cc('0x15')](_0x1067be));if(this[_0x71cc('0x1')]!==_0x550ce7){this[_0x71cc('0x1')]=_0x550ce7;io['to'](util[_0x71cc('0x16')](_0x71cc('0x17'),_0x1067be[_0x71cc('0x6')]))[_0x71cc('0x18')](_0x71cc('0x19'),_0x1067be);}};module['exports']=SmsQueue;
\ No newline at end of file
index 835e90e..36de9a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x913b=['Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','paused','length','online','whatsappPause','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall'];(function(_0x445b91,_0x240d0f){var _0x527125=function(_0x2c285e){while(--_0x2c285e){_0x445b91['push'](_0x445b91['shift']());}};_0x527125(++_0x240d0f);}(_0x913b,0x189));var _0xb913=function(_0x49c341,_0x5b9570){_0x49c341=_0x49c341-0x0;var _0x1c106d=_0x913b[_0x49c341];return _0x1c106d;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0xb913('0x0'));var Redis=require(_0xb913('0x1'));var config=require('../../../config/environment');config[_0xb913('0x2')]=_[_0xb913('0x3')](config[_0xb913('0x2')],{'host':_0xb913('0x4'),'port':0x18eb});var io=require(_0xb913('0x5'))(new Redis(config[_0xb913('0x2')]));function WhatsappQueue(_0x59bb82){this['id']=_0x59bb82['id']||0x0;this[_0xb913('0x6')]=_0x59bb82[_0xb913('0x6')]||'';this[_0xb913('0x7')]=_0x59bb82[_0xb913('0x7')]||0xa;this[_0xb913('0x8')]=_0x59bb82['strategy']||_0xb913('0x9');this['Agents']=_0x59bb82[_0xb913('0xa')];this[_0xb913('0xb')]={};this[_0xb913('0xc')]=0x0;this[_0xb913('0xd')]='';this[_0xb913('0xe')]();this[_0xb913('0xf')]();}WhatsappQueue['prototype']['updateRouting']=function(){var _0x761d42=this['mapAgentsId']['_rr'];this[_0xb913('0xb')]=_[_0xb913('0x10')](this[_0xb913('0xa')],'id');this[_0xb913('0xb')][_0xb913('0x11')]=_0x761d42;};WhatsappQueue[_0xb913('0x12')][_0xb913('0xf')]=function(){this[_0xb913('0x13')]=0x0;this[_0xb913('0x14')]=0x0;for(var _0x46a9ff=0x0;_0x46a9ff<this['Agents'][_0xb913('0x15')];_0x46a9ff+=0x1){if(this[_0xb913('0xa')][_0x46a9ff][_0xb913('0x16')]){this[_0xb913('0x13')]+=0x1;}if(this['Agents'][_0x46a9ff][_0xb913('0x17')]){this[_0xb913('0x14')]+=0x1;}}this['available']=this[_0xb913('0x13')]-this[_0xb913('0x14')];this['available']=this[_0xb913('0x18')]>=0x0?this[_0xb913('0x18')]:0x0;var _0x326d0c={'id':this['id'],'available':this[_0xb913('0x18')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb913('0xc')]};var _0x274b33=md5(JSON[_0xb913('0x19')](_0x326d0c));if(this[_0xb913('0xd')]!==_0x274b33){this[_0xb913('0xd')]=_0x274b33;io['to'](util[_0xb913('0x1a')](_0xb913('0x1b'),_0x326d0c[_0xb913('0x6')]))[_0xb913('0x1c')](_0xb913('0x1d'),_0x326d0c);}};module[_0xb913('0x1e')]=WhatsappQueue;
\ No newline at end of file
+var _0x25a2=['updateRealtime','prototype','updateRouting','_rr','map','loggedIn','paused','length','online','whatsappPause','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting'];(function(_0x160c42,_0x383a96){var _0xcc4c25=function(_0x6e66fd){while(--_0x6e66fd){_0x160c42['push'](_0x160c42['shift']());}};_0xcc4c25(++_0x383a96);}(_0x25a2,0x1f1));var _0x225a=function(_0x487f47,_0x5e2159){_0x487f47=_0x487f47-0x0;var _0x22c26e=_0x25a2[_0x487f47];return _0x22c26e;};'use strict';var _=require(_0x225a('0x0'));var md5=require(_0x225a('0x1'));var util=require(_0x225a('0x2'));var Redis=require(_0x225a('0x3'));var config=require('../../../config/environment');config[_0x225a('0x4')]=_[_0x225a('0x5')](config[_0x225a('0x4')],{'host':_0x225a('0x6'),'port':0x18eb});var io=require(_0x225a('0x7'))(new Redis(config['redis']));function WhatsappQueue(_0x407da6){this['id']=_0x407da6['id']||0x0;this[_0x225a('0x8')]=_0x407da6[_0x225a('0x8')]||'';this[_0x225a('0x9')]=_0x407da6[_0x225a('0x9')]||0xa;this[_0x225a('0xa')]=_0x407da6[_0x225a('0xa')]||_0x225a('0xb');this[_0x225a('0xc')]=_0x407da6[_0x225a('0xc')];this[_0x225a('0xd')]={};this[_0x225a('0xe')]=0x0;this[_0x225a('0x1')]='';this['updateRouting']();this[_0x225a('0xf')]();}WhatsappQueue[_0x225a('0x10')][_0x225a('0x11')]=function(){var _0x2206ff=this['mapAgentsId'][_0x225a('0x12')];this[_0x225a('0xd')]=_[_0x225a('0x13')](this[_0x225a('0xc')],'id');this[_0x225a('0xd')][_0x225a('0x12')]=_0x2206ff;};WhatsappQueue[_0x225a('0x10')][_0x225a('0xf')]=function(){this[_0x225a('0x14')]=0x0;this[_0x225a('0x15')]=0x0;for(var _0xdc0f48=0x0;_0xdc0f48<this['Agents'][_0x225a('0x16')];_0xdc0f48+=0x1){if(this[_0x225a('0xc')][_0xdc0f48][_0x225a('0x17')]){this[_0x225a('0x14')]+=0x1;}if(this[_0x225a('0xc')][_0xdc0f48][_0x225a('0x18')]){this['paused']+=0x1;}}this['available']=this[_0x225a('0x14')]-this[_0x225a('0x15')];this['available']=this['available']>=0x0?this[_0x225a('0x19')]:0x0;var _0x59d4b6={'id':this['id'],'available':this[_0x225a('0x19')],'loggedIn':this[_0x225a('0x14')],'name':this['name'],'paused':this[_0x225a('0x15')],'waiting':this['waiting']};var _0x13f790=md5(JSON[_0x225a('0x1a')](_0x59d4b6));if(this['md5']!==_0x13f790){this[_0x225a('0x1')]=_0x13f790;io['to'](util[_0x225a('0x1b')](_0x225a('0x1c'),_0x59d4b6[_0x225a('0x8')]))[_0x225a('0x1d')](_0x225a('0x1e'),_0x59d4b6);}};module[_0x225a('0x1f')]=WhatsappQueue;
\ No newline at end of file
index f262ece..7cd8965 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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 cc69f03..fb95d8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x40cb=['../client','update','Request','UpdateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x40cb,0xe0));var _0xb40c=function(_0x1f91d6,_0x13896e){_0x1f91d6=_0x1f91d6-0x0;var _0x58545f=_0x40cb[_0x1f91d6];return _0x58545f;};'use strict';var client=require(_0xb40c('0x0'));exports[_0xb40c('0x1')]=function(_0x47321b,_0x36565b){return client[_0xb40c('0x2')](_0xb40c('0x3'),{'body':_0x36565b,'options':{'where':{'id':_0x47321b}},'log':'updateChatInteraction'});};exports[_0xb40c('0x4')]=function(_0x16624e,_0x30094f){return client['Request'](_0xb40c('0x5'),{'body':_0x30094f,'options':{'where':{'id':_0x16624e}},'log':_0xb40c('0x6')});};
\ No newline at end of file
+var _0xb24a=['UpdateChatInteraction','updateChatInteraction','addTags','Request','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xb24a,0xa6));var _0xab24=function(_0x5a905e,_0x31aa4a){_0x5a905e=_0x5a905e-0x0;var _0x4124d6=_0xb24a[_0x5a905e];return _0x4124d6;};'use strict';var client=require(_0xab24('0x0'));exports[_0xab24('0x1')]=function(_0x306acc,_0x3ef57b){return client['Request'](_0xab24('0x2'),{'body':_0x3ef57b,'options':{'where':{'id':_0x306acc}},'log':_0xab24('0x3')});};exports[_0xab24('0x4')]=function(_0x4d6e35,_0x3d48f8){return client[_0xab24('0x5')](_0xab24('0x6'),{'body':_0x3d48f8,'options':{'where':{'id':_0x4d6e35}},'log':_0xab24('0x7')});};
\ No newline at end of file
index c75824e..57496e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x264d=['CreateChatMessage','createChatMessage','../client','Request'];(function(_0x2ec2d5,_0x245125){var _0x34320a=function(_0x49147a){while(--_0x49147a){_0x2ec2d5['push'](_0x2ec2d5['shift']());}};_0x34320a(++_0x245125);}(_0x264d,0x1e6));var _0xd264=function(_0x1de8ad,_0x401abf){_0x1de8ad=_0x1de8ad-0x0;var _0x3100a1=_0x264d[_0x1de8ad];return _0x3100a1;};'use strict';var client=require(_0xd264('0x0'));exports['create']=function(_0x52201a){return client[_0xd264('0x1')](_0xd264('0x2'),{'body':_0x52201a,'log':_0xd264('0x3')});};
\ No newline at end of file
+var _0xaf35=['Request','CreateChatMessage','createChatMessage','create'];(function(_0x38542f,_0x3a2b33){var _0x94a90=function(_0x5efdd2){while(--_0x5efdd2){_0x38542f['push'](_0x38542f['shift']());}};_0x94a90(++_0x3a2b33);}(_0xaf35,0xa7));var _0x5af3=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xaf35[_0x36eaaa];return _0x461349;};'use strict';var client=require('../client');exports[_0x5af3('0x0')]=function(_0x371f60){return client[_0x5af3('0x1')](_0x5af3('0x2'),{'body':_0x371f60,'log':_0x5af3('0x3')});};
\ No newline at end of file
index 60ee771..dc6adc5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfcbe=['Request','GetChatQueue','name','timeout','strategy','Agents','getChatQueues'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfcbe,0x1b1));var _0xefcb=function(_0x132d4d,_0x21a53c){_0x132d4d=_0x132d4d-0x0;var _0x3673ca=_0xfcbe[_0x132d4d];return _0x3673ca;};'use strict';var client=require('../client');exports[_0xefcb('0x0')]=function(){return function(){return client[_0xefcb('0x1')](_0xefcb('0x2'),{'options':{'raw':![],'attributes':['id',_0xefcb('0x3'),_0xefcb('0x4'),_0xefcb('0x5')],'include':[{'model':'User','as':_0xefcb('0x6'),'attributes':['id',_0xefcb('0x3'),'online','chatPause']}]},'log':'getChatQueues'});};};
\ No newline at end of file
+var _0x0dd6=['User','Agents','online','getChatQueues','Request','GetChatQueue','name','timeout','strategy'];(function(_0x13cbfb,_0x5b397d){var _0x2b4439=function(_0x707df2){while(--_0x707df2){_0x13cbfb['push'](_0x13cbfb['shift']());}};_0x2b4439(++_0x5b397d);}(_0x0dd6,0xca));var _0x60dd=function(_0x376acb,_0x48b3a1){_0x376acb=_0x376acb-0x0;var _0x46dcd8=_0x0dd6[_0x376acb];return _0x46dcd8;};'use strict';var client=require('../client');exports['getChatQueues']=function(){return function(){return client[_0x60dd('0x0')](_0x60dd('0x1'),{'options':{'raw':![],'attributes':['id',_0x60dd('0x2'),_0x60dd('0x3'),_0x60dd('0x4')],'include':[{'model':_0x60dd('0x5'),'as':_0x60dd('0x6'),'attributes':['id',_0x60dd('0x2'),_0x60dd('0x7'),'chatPause']}]},'log':_0x60dd('0x8')});};};
\ No newline at end of file
index 7262c2a..413ea9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9585=['create','Request','CreateChatQueueReport','update','UpdateChatQueueReport'];(function(_0x18f53e,_0xf5cdf5){var _0x2f9f4f=function(_0x400a26){while(--_0x400a26){_0x18f53e['push'](_0x18f53e['shift']());}};_0x2f9f4f(++_0xf5cdf5);}(_0x9585,0x15e));var _0x5958=function(_0x5bd1ed,_0x278544){_0x5bd1ed=_0x5bd1ed-0x0;var _0x4d2ccc=_0x9585[_0x5bd1ed];return _0x4d2ccc;};'use strict';var client=require('../client');exports[_0x5958('0x0')]=function(_0x57d84d){return client[_0x5958('0x1')](_0x5958('0x2'),{'body':_0x57d84d,'log':_0x5958('0x2')});};exports[_0x5958('0x3')]=function(_0x35e63f,_0x1f8027){return client[_0x5958('0x1')](_0x5958('0x4'),{'body':_0x1f8027,'options':{'where':{'uniqueid':_0x35e63f},'order':[['id','DESC']],'limit':0x1},'log':_0x5958('0x4')});};
\ No newline at end of file
+var _0xb4e6=['UpdateChatQueueReport','DESC','../client','Request','CreateChatQueueReport','update'];(function(_0x143986,_0x30a111){var _0xcd8928=function(_0x180987){while(--_0x180987){_0x143986['push'](_0x143986['shift']());}};_0xcd8928(++_0x30a111);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x592d48,_0x23f1ba){_0x592d48=_0x592d48-0x0;var _0x5d789e=_0xb4e6[_0x592d48];return _0x5d789e;};'use strict';var client=require(_0x6b4e('0x0'));exports['create']=function(_0x2708ca){return client[_0x6b4e('0x1')](_0x6b4e('0x2'),{'body':_0x2708ca,'log':_0x6b4e('0x2')});};exports[_0x6b4e('0x3')]=function(_0x31e8ad,_0x1929b8){return client['Request'](_0x6b4e('0x4'),{'body':_0x1929b8,'options':{'where':{'uniqueid':_0x31e8ad},'order':[['id',_0x6b4e('0x5')]],'limit':0x1},'log':_0x6b4e('0x4')});};
\ No newline at end of file
index 122a9c0..2f2d633 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(_0x1ad9a3,_0x56a1d){var _0x3dc656=function(_0x34d0a1){while(--_0x34d0a1){_0x1ad9a3['push'](_0x1ad9a3['shift']());}};_0x3dc656(++_0x56a1d);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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(_0x12aaee,_0x5bf50c){var _0x37c350=function(_0x182775){while(--_0x182775){_0x12aaee['push'](_0x12aaee['shift']());}};_0x37c350(++_0x5bf50c);}(_0x7a54,0x106));var _0x47a5=function(_0x2c8812,_0x1b0648){_0x2c8812=_0x2c8812-0x0;var _0x512e8d=_0x7a54[_0x2c8812];return _0x512e8d;};'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 3b9a116..c500d31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b3f=['Request','CreateFaxMessage','createFaxMessage','create'];(function(_0x1fa605,_0x41d572){var _0x363941=function(_0x3e5653){while(--_0x3e5653){_0x1fa605['push'](_0x1fa605['shift']());}};_0x363941(++_0x41d572);}(_0x2b3f,0x117));var _0xf2b3=function(_0x42397c,_0x2d79f4){_0x42397c=_0x42397c-0x0;var _0x365b72=_0x2b3f[_0x42397c];return _0x365b72;};'use strict';var client=require('../client');exports[_0xf2b3('0x0')]=function(_0x56a10d){return client[_0xf2b3('0x1')](_0xf2b3('0x2'),{'body':_0x56a10d,'log':_0xf2b3('0x3')});};
\ No newline at end of file
+var _0xe48b=['CreateFaxMessage','createFaxMessage','../client','create'];(function(_0x394c73,_0x14d766){var _0x13f6d1=function(_0x333653){while(--_0x333653){_0x394c73['push'](_0x394c73['shift']());}};_0x13f6d1(++_0x14d766);}(_0xe48b,0x152));var _0xbe48=function(_0x5c3f66,_0x4d22d5){_0x5c3f66=_0x5c3f66-0x0;var _0x352ccb=_0xe48b[_0x5c3f66];return _0x352ccb;};'use strict';var client=require(_0xbe48('0x0'));exports[_0xbe48('0x1')]=function(_0x6c860c){return client['Request'](_0xbe48('0x2'),{'body':_0x6c860c,'log':_0xbe48('0x3')});};
\ No newline at end of file
index a87fd2e..7bf2cdf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2968=['strategy','User','Agents','online','getFaxQueues','../client','name'];(function(_0x4dbf12,_0x5e8570){var _0x5f2964=function(_0x5e63e1){while(--_0x5e63e1){_0x4dbf12['push'](_0x4dbf12['shift']());}};_0x5f2964(++_0x5e8570);}(_0x2968,0xa6));var _0x8296=function(_0x12820c,_0x59dce8){_0x12820c=_0x12820c-0x0;var _0x456c1e=_0x2968[_0x12820c];return _0x456c1e;};'use strict';var client=require(_0x8296('0x0'));exports['getFaxQueues']=function(){return function(){return client['Request']('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x8296('0x1'),'timeout',_0x8296('0x2')],'include':[{'model':_0x8296('0x3'),'as':_0x8296('0x4'),'attributes':['id',_0x8296('0x1'),_0x8296('0x5'),'faxPause']}]},'log':_0x8296('0x6')});};};
\ No newline at end of file
+var _0x65c8=['name','faxPause','../client','Request','GetFaxQueue','timeout','strategy','Agents'];(function(_0x59fbdf,_0x424e7c){var _0x180a5f=function(_0x30bb92){while(--_0x30bb92){_0x59fbdf['push'](_0x59fbdf['shift']());}};_0x180a5f(++_0x424e7c);}(_0x65c8,0x15a));var _0x865c=function(_0x5a104f,_0x527c16){_0x5a104f=_0x5a104f-0x0;var _0x48c371=_0x65c8[_0x5a104f];return _0x48c371;};'use strict';var client=require(_0x865c('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0x865c('0x1')](_0x865c('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x865c('0x3'),_0x865c('0x4')],'include':[{'model':'User','as':_0x865c('0x5'),'attributes':['id',_0x865c('0x6'),'online',_0x865c('0x7')]}]},'log':'getFaxQueues'});};};
\ No newline at end of file
index 246643a..56e5319 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c4a=['../client','create','Request','CreateFaxQueueReport','UpdateFaxQueueReport','DESC'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x2c4a,0x156));var _0xa2c4=function(_0x1e7a5e,_0x51156e){_0x1e7a5e=_0x1e7a5e-0x0;var _0x130518=_0x2c4a[_0x1e7a5e];return _0x130518;};'use strict';var client=require(_0xa2c4('0x0'));exports[_0xa2c4('0x1')]=function(_0xc4cfa5){return client[_0xa2c4('0x2')]('CreateFaxQueueReport',{'body':_0xc4cfa5,'log':_0xa2c4('0x3')});};exports['update']=function(_0x5a9fe1,_0x543499){return client[_0xa2c4('0x2')](_0xa2c4('0x4'),{'body':_0x543499,'options':{'where':{'uniqueid':_0x5a9fe1},'order':[['id',_0xa2c4('0x5')]],'limit':0x1},'log':_0xa2c4('0x4')});};
\ No newline at end of file
+var _0x7dcb=['CreateFaxQueueReport','UpdateFaxQueueReport','../client','create','Request'];(function(_0x264b4d,_0x26a5fb){var _0x4e1a82=function(_0x163756){while(--_0x163756){_0x264b4d['push'](_0x264b4d['shift']());}};_0x4e1a82(++_0x26a5fb);}(_0x7dcb,0xca));var _0xb7dc=function(_0x199bc8,_0x37cd24){_0x199bc8=_0x199bc8-0x0;var _0x5b0422=_0x7dcb[_0x199bc8];return _0x5b0422;};'use strict';var client=require(_0xb7dc('0x0'));exports[_0xb7dc('0x1')]=function(_0x28247e){return client[_0xb7dc('0x2')](_0xb7dc('0x3'),{'body':_0x28247e,'log':_0xb7dc('0x3')});};exports['update']=function(_0x546a5c,_0x537213){return client['Request']('UpdateFaxQueueReport',{'body':_0x537213,'options':{'where':{'uniqueid':_0x546a5c},'order':[['id','DESC']],'limit':0x1},'log':_0xb7dc('0x4')});};
\ No newline at end of file
index 1f50d06..135dad7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x670d=['interval','getIntervals','../client','GetInterval','name','Interval'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x670d,0xe6));var _0xd670=function(_0x8728ff,_0x4b73ec){_0x8728ff=_0x8728ff-0x0;var _0x4c94d2=_0x670d[_0x8728ff];return _0x4c94d2;};'use strict';var client=require(_0xd670('0x0'));exports['getIntervals']=function(){return function(){return client['Request'](_0xd670('0x1'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xd670('0x2')],'include':[{'model':_0xd670('0x3'),'as':'Intervals','attributes':['id',_0xd670('0x2'),_0xd670('0x4')]}]},'log':_0xd670('0x5')});};};
\ No newline at end of file
+var _0xf241=['Request','GetInterval','name','Interval','Intervals','interval','getIntervals'];(function(_0x586ec4,_0x5d1f1c){var _0x17267e=function(_0x513a7d){while(--_0x513a7d){_0x586ec4['push'](_0x586ec4['shift']());}};_0x17267e(++_0x5d1f1c);}(_0xf241,0x187));var _0x1f24=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xf241[_0x4565bf];return _0x5610ba;};'use strict';var client=require('../client');exports[_0x1f24('0x0')]=function(){return function(){return client[_0x1f24('0x1')](_0x1f24('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x1f24('0x3')],'include':[{'model':_0x1f24('0x4'),'as':_0x1f24('0x5'),'attributes':['id',_0x1f24('0x3'),_0x1f24('0x6')]}]},'log':_0x1f24('0x0')});};};
\ No newline at end of file
index 623cb25..623c77b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d04=['Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update'];(function(_0x35b378,_0x35674d){var _0x592edd=function(_0x342b42){while(--_0x342b42){_0x35b378['push'](_0x35b378['shift']());}};_0x592edd(++_0x35674d);}(_0x3d04,0xbe));var _0x43d0=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x3d04[_0x501510];return _0x1e6ee5;};'use strict';var client=require(_0x43d0('0x0'));exports[_0x43d0('0x1')]=function(_0xdb0c3f,_0x105c73){return client[_0x43d0('0x2')](_0x43d0('0x3'),{'body':_0x105c73,'options':{'where':{'id':_0xdb0c3f}},'log':_0x43d0('0x4')});};exports[_0x43d0('0x5')]=function(_0x5a9e1d,_0x2a4d4c){return client[_0x43d0('0x2')](_0x43d0('0x6'),{'body':_0x2a4d4c,'options':{'where':{'id':_0x5a9e1d}},'log':_0x43d0('0x7')});};
\ No newline at end of file
+var _0x7880=['AddTagsToMailInteraction','addTagsToChatInteraction','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x4c2f17,_0x5c6821){var _0x20919e=function(_0x31eef7){while(--_0x31eef7){_0x4c2f17['push'](_0x4c2f17['shift']());}};_0x20919e(++_0x5c6821);}(_0x7880,0x1f4));var _0x0788=function(_0x52bdfe,_0x5282ec){_0x52bdfe=_0x52bdfe-0x0;var _0x5c6df7=_0x7880[_0x52bdfe];return _0x5c6df7;};'use strict';var client=require('../client');exports[_0x0788('0x0')]=function(_0x219c25,_0x841a33){return client[_0x0788('0x1')](_0x0788('0x2'),{'body':_0x841a33,'options':{'where':{'id':_0x219c25}},'log':_0x0788('0x3')});};exports['addTags']=function(_0x3925a6,_0x1e0814){return client[_0x0788('0x1')](_0x0788('0x4'),{'body':_0x1e0814,'options':{'where':{'id':_0x3925a6}},'log':_0x0788('0x5')});};
\ No newline at end of file
index 69fd031..8c586d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8fc=['CreateMailMessage','../client'];(function(_0x1c5ada,_0x297e91){var _0x19ff3a=function(_0x2df71f){while(--_0x2df71f){_0x1c5ada['push'](_0x1c5ada['shift']());}};_0x19ff3a(++_0x297e91);}(_0xf8fc,0x113));var _0xcf8f=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0xf8fc[_0x11c573];return _0x6b72de;};'use strict';var client=require(_0xcf8f('0x0'));exports['create']=function(_0x13551f){return client['Request'](_0xcf8f('0x1'),{'body':_0x13551f,'log':'createMailMessage'});};
\ No newline at end of file
+var _0xc0fd=['create','Request','CreateMailMessage','../client'];(function(_0x4cb738,_0x351c4b){var _0x1369ab=function(_0x31b176){while(--_0x31b176){_0x4cb738['push'](_0x4cb738['shift']());}};_0x1369ab(++_0x351c4b);}(_0xc0fd,0x18b));var _0xdc0f=function(_0x6ff671,_0x3a88be){_0x6ff671=_0x6ff671-0x0;var _0x52ebf4=_0xc0fd[_0x6ff671];return _0x52ebf4;};'use strict';var client=require(_0xdc0f('0x0'));exports[_0xdc0f('0x1')]=function(_0x3eaebb){return client[_0xdc0f('0x2')](_0xdc0f('0x3'),{'body':_0x3eaebb,'log':'createMailMessage'});};
\ No newline at end of file
index e0880e5..ab7785a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ad9=['mailPause','../client','getMailQueues','Request','GetMailQueue','name','timeout','User','online'];(function(_0x47e93d,_0x26bbdd){var _0xe86c46=function(_0x10e072){while(--_0x10e072){_0x47e93d['push'](_0x47e93d['shift']());}};_0xe86c46(++_0x26bbdd);}(_0x2ad9,0x1a8));var _0x92ad=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x2ad9[_0x3b380d];return _0x54502b;};'use strict';var client=require(_0x92ad('0x0'));exports[_0x92ad('0x1')]=function(){return function(){return client[_0x92ad('0x2')](_0x92ad('0x3'),{'options':{'raw':![],'attributes':['id',_0x92ad('0x4'),_0x92ad('0x5'),'strategy'],'include':[{'model':_0x92ad('0x6'),'as':'Agents','attributes':['id','name',_0x92ad('0x7'),_0x92ad('0x8')]}]},'log':_0x92ad('0x1')});};};
\ No newline at end of file
+var _0x1b8d=['GetMailQueue','name','timeout','strategy','Agents','online','mailPause','getMailQueues'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1b8d,0xaf));var _0xd1b8=function(_0x32729c,_0xf5afd8){_0x32729c=_0x32729c-0x0;var _0x482cfd=_0x1b8d[_0x32729c];return _0x482cfd;};'use strict';var client=require('../client');exports[_0xd1b8('0x0')]=function(){return function(){return client['Request'](_0xd1b8('0x1'),{'options':{'raw':![],'attributes':['id',_0xd1b8('0x2'),_0xd1b8('0x3'),_0xd1b8('0x4')],'include':[{'model':'User','as':_0xd1b8('0x5'),'attributes':['id',_0xd1b8('0x2'),_0xd1b8('0x6'),_0xd1b8('0x7')]}]},'log':_0xd1b8('0x0')});};};
\ No newline at end of file
index 859ee76..fbbf395 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbbb9=['UpdateMailQueueReport','../client','Request','CreateMailQueueReport','DESC'];(function(_0x454661,_0x1bb5ad){var _0x2ac167=function(_0x576c29){while(--_0x576c29){_0x454661['push'](_0x454661['shift']());}};_0x2ac167(++_0x1bb5ad);}(_0xbbb9,0x88));var _0x9bbb=function(_0x57b902,_0x156665){_0x57b902=_0x57b902-0x0;var _0x583048=_0xbbb9[_0x57b902];return _0x583048;};'use strict';var client=require(_0x9bbb('0x0'));exports['create']=function(_0x8c710b){return client[_0x9bbb('0x1')](_0x9bbb('0x2'),{'body':_0x8c710b,'log':_0x9bbb('0x2')});};exports['update']=function(_0x482b04,_0x172bca){return client[_0x9bbb('0x1')]('UpdateMailQueueReport',{'body':_0x172bca,'options':{'where':{'uniqueid':_0x482b04},'order':[['id',_0x9bbb('0x3')]],'limit':0x1},'log':_0x9bbb('0x4')});};
\ No newline at end of file
+var _0x0ae9=['update','DESC','UpdateMailQueueReport','../client','create','Request','CreateMailQueueReport'];(function(_0x2e9793,_0x2dd32a){var _0x1670a4=function(_0x56de7){while(--_0x56de7){_0x2e9793['push'](_0x2e9793['shift']());}};_0x1670a4(++_0x2dd32a);}(_0x0ae9,0x1d1));var _0x90ae=function(_0x31a4e6,_0x271e72){_0x31a4e6=_0x31a4e6-0x0;var _0x312c01=_0x0ae9[_0x31a4e6];return _0x312c01;};'use strict';var client=require(_0x90ae('0x0'));exports[_0x90ae('0x1')]=function(_0x1b6c07){return client[_0x90ae('0x2')](_0x90ae('0x3'),{'body':_0x1b6c07,'log':'CreateMailQueueReport'});};exports[_0x90ae('0x4')]=function(_0x3de45f,_0x513b1d){return client[_0x90ae('0x2')]('UpdateMailQueueReport',{'body':_0x513b1d,'options':{'where':{'uniqueid':_0x3de45f},'order':[['id',_0x90ae('0x5')]],'limit':0x1},'log':_0x90ae('0x6')});};
\ No newline at end of file
index e41d38c..d7e03de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe053=['AddTagsToOpenchannelInteraction','../client','update','Request','addTags'];(function(_0x4e39b7,_0x541319){var _0x4517af=function(_0x390049){while(--_0x390049){_0x4e39b7['push'](_0x4e39b7['shift']());}};_0x4517af(++_0x541319);}(_0xe053,0x1af));var _0x3e05=function(_0x427d3a,_0x23724c){_0x427d3a=_0x427d3a-0x0;var _0xe5c521=_0xe053[_0x427d3a];return _0xe5c521;};'use strict';var client=require(_0x3e05('0x0'));exports[_0x3e05('0x1')]=function(_0x462271,_0x469ff3){return client[_0x3e05('0x2')]('UpdateOpenchannelInteraction',{'body':_0x469ff3,'options':{'where':{'id':_0x462271}},'log':'updateOpenchannelInteraction'});};exports[_0x3e05('0x3')]=function(_0x13fc35,_0x2fd9a4){return client[_0x3e05('0x2')](_0x3e05('0x4'),{'body':_0x2fd9a4,'options':{'where':{'id':_0x13fc35}},'log':'addTagsToChatInteraction'});};
\ No newline at end of file
+var _0x5da2=['../client','update','updateOpenchannelInteraction','addTags','Request','AddTagsToOpenchannelInteraction','addTagsToChatInteraction'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5da2,0x1a4));var _0x25da=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x5da2[_0x57b54c];return _0x59cc19;};'use strict';var client=require(_0x25da('0x0'));exports[_0x25da('0x1')]=function(_0x4d4b2a,_0x49de3b){return client['Request']('UpdateOpenchannelInteraction',{'body':_0x49de3b,'options':{'where':{'id':_0x4d4b2a}},'log':_0x25da('0x2')});};exports[_0x25da('0x3')]=function(_0x10da88,_0x22d86b){return client[_0x25da('0x4')](_0x25da('0x5'),{'body':_0x22d86b,'options':{'where':{'id':_0x10da88}},'log':_0x25da('0x6')});};
\ No newline at end of file
index 3be1c93..ef274cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbba9=['../client','create','Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x447c91,_0x38c5c5){var _0x3d17f2=function(_0x24e505){while(--_0x24e505){_0x447c91['push'](_0x447c91['shift']());}};_0x3d17f2(++_0x38c5c5);}(_0xbba9,0x1c2));var _0x9bba=function(_0x249b88,_0x3e7b57){_0x249b88=_0x249b88-0x0;var _0x95c0e9=_0xbba9[_0x249b88];return _0x95c0e9;};'use strict';var client=require(_0x9bba('0x0'));exports[_0x9bba('0x1')]=function(_0x2d3570){return client[_0x9bba('0x2')](_0x9bba('0x3'),{'body':_0x2d3570,'log':_0x9bba('0x4')});};
\ No newline at end of file
+var _0xca09=['../client','Request','CreateOpenchannelMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xca09,0x90));var _0x9ca0=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xca09[_0x19e35c];return _0x3e1fe8;};'use strict';var client=require(_0x9ca0('0x0'));exports['create']=function(_0x3bfb66){return client[_0x9ca0('0x1')](_0x9ca0('0x2'),{'body':_0x3bfb66,'log':'createOpenchannelMessage'});};
\ No newline at end of file
index 6fc3d85..c41469a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5078=['timeout','strategy','User','Agents','openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5078,0xeb));var _0x8507=function(_0x40e114,_0x278b52){_0x40e114=_0x40e114-0x0;var _0x2e9542=_0x5078[_0x40e114];return _0x2e9542;};'use strict';var client=require(_0x8507('0x0'));exports[_0x8507('0x1')]=function(){return function(){return client[_0x8507('0x2')](_0x8507('0x3'),{'options':{'raw':![],'attributes':['id',_0x8507('0x4'),_0x8507('0x5'),_0x8507('0x6')],'include':[{'model':_0x8507('0x7'),'as':_0x8507('0x8'),'attributes':['id',_0x8507('0x4'),'online',_0x8507('0x9')]}]},'log':'getOpenchannelQueues'});};};
\ No newline at end of file
+var _0x0e6c=['getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','strategy','User','Agents','openchannelPause'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x0e6c,0x64));var _0xc0e6=function(_0x291341,_0x2e137c){_0x291341=_0x291341-0x0;var _0x1c9230=_0x0e6c[_0x291341];return _0x1c9230;};'use strict';var client=require('../client');exports['getOpenchannelQueues']=function(){return function(){return client[_0xc0e6('0x0')](_0xc0e6('0x1'),{'options':{'raw':![],'attributes':['id',_0xc0e6('0x2'),_0xc0e6('0x3'),_0xc0e6('0x4')],'include':[{'model':_0xc0e6('0x5'),'as':_0xc0e6('0x6'),'attributes':['id',_0xc0e6('0x2'),'online',_0xc0e6('0x7')]}]},'log':_0xc0e6('0x8')});};};
\ No newline at end of file
index 0aaaff2..aaea026 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b51=['../client','create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC'];(function(_0x1529a3,_0x529f63){var _0x1a0d4b=function(_0x6f1058){while(--_0x6f1058){_0x1529a3['push'](_0x1529a3['shift']());}};_0x1a0d4b(++_0x529f63);}(_0x2b51,0xe7));var _0x12b5=function(_0x4b02ae,_0x3aa012){_0x4b02ae=_0x4b02ae-0x0;var _0x3b7fc6=_0x2b51[_0x4b02ae];return _0x3b7fc6;};'use strict';var client=require(_0x12b5('0x0'));exports[_0x12b5('0x1')]=function(_0x2fad5d){return client[_0x12b5('0x2')]('CreateOpenchannelQueueReport',{'body':_0x2fad5d,'log':_0x12b5('0x3')});};exports[_0x12b5('0x4')]=function(_0x186f74,_0x47123b){return client['Request'](_0x12b5('0x5'),{'body':_0x47123b,'options':{'where':{'uniqueid':_0x186f74},'order':[['id',_0x12b5('0x6')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});};
\ No newline at end of file
+var _0x42d5=['Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','../client','create'];(function(_0x374ada,_0x27b3a5){var _0x449ed8=function(_0x3efc46){while(--_0x3efc46){_0x374ada['push'](_0x374ada['shift']());}};_0x449ed8(++_0x27b3a5);}(_0x42d5,0xc9));var _0x542d=function(_0x55d286,_0x3fb906){_0x55d286=_0x55d286-0x0;var _0x29e185=_0x42d5[_0x55d286];return _0x29e185;};'use strict';var client=require(_0x542d('0x0'));exports[_0x542d('0x1')]=function(_0xb66af3){return client[_0x542d('0x2')](_0x542d('0x3'),{'body':_0xb66af3,'log':_0x542d('0x3')});};exports[_0x542d('0x4')]=function(_0x26944d,_0x2a7009){return client[_0x542d('0x2')](_0x542d('0x5'),{'body':_0x2a7009,'options':{'where':{'uniqueid':_0x26944d},'order':[['id',_0x542d('0x6')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});};
\ No newline at end of file
index 87358ce..450476e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8135=['addTags','update','Request','updateSmsInteraction'];(function(_0x3e7dd9,_0x559da1){var _0x9397c7=function(_0x75c0ec){while(--_0x75c0ec){_0x3e7dd9['push'](_0x3e7dd9['shift']());}};_0x9397c7(++_0x559da1);}(_0x8135,0x99));var _0x5813=function(_0x2a00fc,_0x225ee6){_0x2a00fc=_0x2a00fc-0x0;var _0x34d2c8=_0x8135[_0x2a00fc];return _0x34d2c8;};'use strict';var client=require('../client');exports[_0x5813('0x0')]=function(_0x19e006,_0x301843){return client[_0x5813('0x1')]('UpdateSmsInteraction',{'body':_0x301843,'options':{'where':{'id':_0x19e006}},'log':_0x5813('0x2')});};exports[_0x5813('0x3')]=function(_0xf23c29,_0x701689){return client[_0x5813('0x1')]('AddTagsToSmsInteraction',{'body':_0x701689,'options':{'where':{'id':_0xf23c29}},'log':'addTagsToSmsInteraction'});};
\ No newline at end of file
+var _0x4b84=['../client','update','Request','addTags'];(function(_0x2a100a,_0x6ca0a6){var _0x57850f=function(_0x34d618){while(--_0x34d618){_0x2a100a['push'](_0x2a100a['shift']());}};_0x57850f(++_0x6ca0a6);}(_0x4b84,0x1cc));var _0x44b8=function(_0x46a3e8,_0x2e1b35){_0x46a3e8=_0x46a3e8-0x0;var _0xf1442e=_0x4b84[_0x46a3e8];return _0xf1442e;};'use strict';var client=require(_0x44b8('0x0'));exports[_0x44b8('0x1')]=function(_0x499894,_0x5005fd){return client[_0x44b8('0x2')]('UpdateSmsInteraction',{'body':_0x5005fd,'options':{'where':{'id':_0x499894}},'log':'updateSmsInteraction'});};exports[_0x44b8('0x3')]=function(_0x31282a,_0x39ad16){return client['Request']('AddTagsToSmsInteraction',{'body':_0x39ad16,'options':{'where':{'id':_0x31282a}},'log':'addTagsToSmsInteraction'});};
\ No newline at end of file
index b6a4131..026083c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6499=['createSmsMessage','../client','Request','CreateSmsMessage'];(function(_0x171fdc,_0x16ae91){var _0x3782ea=function(_0x58b691){while(--_0x58b691){_0x171fdc['push'](_0x171fdc['shift']());}};_0x3782ea(++_0x16ae91);}(_0x6499,0x119));var _0x9649=function(_0x373499,_0x29a642){_0x373499=_0x373499-0x0;var _0xc2e4ec=_0x6499[_0x373499];return _0xc2e4ec;};'use strict';var client=require(_0x9649('0x0'));exports['create']=function(_0x4a541e){return client[_0x9649('0x1')](_0x9649('0x2'),{'body':_0x4a541e,'log':_0x9649('0x3')});};
\ No newline at end of file
+var _0xc771=['../client','create','Request','CreateSmsMessage','createSmsMessage'];(function(_0x38d5b2,_0xe77bf4){var _0x5b4ba8=function(_0x28ee00){while(--_0x28ee00){_0x38d5b2['push'](_0x38d5b2['shift']());}};_0x5b4ba8(++_0xe77bf4);}(_0xc771,0x190));var _0x1c77=function(_0x347c63,_0x4930b1){_0x347c63=_0x347c63-0x0;var _0x1b7cd1=_0xc771[_0x347c63];return _0x1b7cd1;};'use strict';var client=require(_0x1c77('0x0'));exports[_0x1c77('0x1')]=function(_0x5e0829){return client[_0x1c77('0x2')](_0x1c77('0x3'),{'body':_0x5e0829,'log':_0x1c77('0x4')});};
\ No newline at end of file
index 95b2faf..768a665 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['smsPause','Request','GetSmsQueue','name','timeout','User','Agents','online'];(function(_0x6be158,_0x47e6df){var _0x20ac9a=function(_0x5eb00d){while(--_0x5eb00d){_0x6be158['push'](_0x6be158['shift']());}};_0x20ac9a(++_0x47e6df);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0xcb91[_0x20a558];return _0x53d3f7;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'attributes':['id',_0x1cb9('0x2'),_0x1cb9('0x3'),'strategy'],'include':[{'model':_0x1cb9('0x4'),'as':_0x1cb9('0x5'),'attributes':['id','name',_0x1cb9('0x6'),_0x1cb9('0x7')]}]},'log':'getSmsQueues'});};};
\ No newline at end of file
+var _0xa9e0=['name','online','smsPause','../client','getSmsQueues','Request','timeout','User','Agents'];(function(_0x479185,_0x20e772){var _0x5cf6d2=function(_0x453d8e){while(--_0x453d8e){_0x479185['push'](_0x479185['shift']());}};_0x5cf6d2(++_0x20e772);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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 28f0598..762e962 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x5b5b5b,_0x279edf){var _0x2ea283=function(_0x5f2764){while(--_0x5f2764){_0x5b5b5b['push'](_0x5b5b5b['shift']());}};_0x2ea283(++_0x279edf);}(_0x34e8,0x12c));var _0x834e=function(_0x13e53a,_0x4cfdef){_0x13e53a=_0x13e53a-0x0;var _0x4a2471=_0x34e8[_0x13e53a];return _0x4a2471;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return client[_0x834e('0x2')]('CreateSmsQueueReport',{'body':_0x8b339,'log':_0x834e('0x3')});};exports[_0x834e('0x4')]=function(_0x472111,_0x31bf20){return client[_0x834e('0x2')](_0x834e('0x5'),{'body':_0x31bf20,'options':{'where':{'uniqueid':_0x472111},'order':[['id',_0x834e('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});};
\ No newline at end of file
+var _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x4e8706,_0x1af398){var _0x1c4477=function(_0x559096){while(--_0x559096){_0x4e8706['push'](_0x4e8706['shift']());}};_0x1c4477(++_0x1af398);}(_0x34e8,0x12c));var _0x834e=function(_0x54a9f6,_0x30eae3){_0x54a9f6=_0x54a9f6-0x0;var _0x16901c=_0x34e8[_0x54a9f6];return _0x16901c;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return client[_0x834e('0x2')]('CreateSmsQueueReport',{'body':_0x8b339,'log':_0x834e('0x3')});};exports[_0x834e('0x4')]=function(_0x472111,_0x31bf20){return client[_0x834e('0x2')](_0x834e('0x5'),{'body':_0x31bf20,'options':{'where':{'uniqueid':_0x472111},'order':[['id',_0x834e('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});};
\ No newline at end of file
index 1acdb82..9cf97f8 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(_0xa01f7b,_0x45ab5e){var _0x27c9b5=function(_0x4000ef){while(--_0x4000ef){_0xa01f7b['push'](_0xa01f7b['shift']());}};_0x27c9b5(++_0x45ab5e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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(_0x1145ea,_0x4a15f1){var _0x2021cf=function(_0x1fd1af){while(--_0x1fd1af){_0x1145ea['push'](_0x1145ea['shift']());}};_0x2021cf(++_0x4a15f1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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 19f47a4..1287070 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x80c3=['UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','../client'];(function(_0x40e74c,_0x1883a2){var _0x3a8c6b=function(_0x1a4ae4){while(--_0x1a4ae4){_0x40e74c['push'](_0x40e74c['shift']());}};_0x3a8c6b(++_0x1883a2);}(_0x80c3,0x18f));var _0x380c=function(_0x31b5b2,_0x5ab927){_0x31b5b2=_0x31b5b2-0x0;var _0x364f13=_0x80c3[_0x31b5b2];return _0x364f13;};'use strict';var client=require(_0x380c('0x0'));exports['update']=function(_0x4d0a64,_0x1c7a92){return client['Request'](_0x380c('0x1'),{'body':_0x1c7a92,'options':{'where':{'id':_0x4d0a64}},'log':_0x380c('0x2')});};exports[_0x380c('0x3')]=function(_0x52fd7e,_0x565a08){return client['Request'](_0x380c('0x4'),{'body':_0x565a08,'options':{'where':{'id':_0x52fd7e}},'log':'addTagsToWhatsappInteraction'});};
\ No newline at end of file
+var _0x44c2=['UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','Request','../client','update'];(function(_0xeb9709,_0x500948){var _0x391277=function(_0x328a24){while(--_0x328a24){_0xeb9709['push'](_0xeb9709['shift']());}};_0x391277(++_0x500948);}(_0x44c2,0x100));var _0x244c=function(_0x456bd2,_0x156c79){_0x456bd2=_0x456bd2-0x0;var _0x2218c1=_0x44c2[_0x456bd2];return _0x2218c1;};'use strict';var client=require(_0x244c('0x0'));exports[_0x244c('0x1')]=function(_0x277954,_0x204240){return client['Request'](_0x244c('0x2'),{'body':_0x204240,'options':{'where':{'id':_0x277954}},'log':_0x244c('0x3')});};exports[_0x244c('0x4')]=function(_0x3b2ff1,_0x134a84){return client[_0x244c('0x5')]('AddTagsToWhatsappInteraction',{'body':_0x134a84,'options':{'where':{'id':_0x3b2ff1}},'log':'addTagsToWhatsappInteraction'});};
\ No newline at end of file
index d2f267e..b7d859c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81ae=['Request','createWhatsappMessage','create'];(function(_0x561478,_0x53657f){var _0x1a3e54=function(_0x56f7c6){while(--_0x56f7c6){_0x561478['push'](_0x561478['shift']());}};_0x1a3e54(++_0x53657f);}(_0x81ae,0x12b));var _0xe81a=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x81ae[_0x465a0c];return _0x1e202e;};'use strict';var client=require('../client');exports[_0xe81a('0x0')]=function(_0x258422){return client[_0xe81a('0x1')]('CreateWhatsappMessage',{'body':_0x258422,'log':_0xe81a('0x2')});};
\ No newline at end of file
+var _0x299b=['Request','CreateWhatsappMessage','createWhatsappMessage','../client'];(function(_0x5422ce,_0x2facfb){var _0x4f14e2=function(_0x41116e){while(--_0x41116e){_0x5422ce['push'](_0x5422ce['shift']());}};_0x4f14e2(++_0x2facfb);}(_0x299b,0x7b));var _0xb299=function(_0x54b396,_0x3612ee){_0x54b396=_0x54b396-0x0;var _0x532e6d=_0x299b[_0x54b396];return _0x532e6d;};'use strict';var client=require(_0xb299('0x0'));exports['create']=function(_0x4ed6bf){return client[_0xb299('0x1')](_0xb299('0x2'),{'body':_0x4ed6bf,'log':_0xb299('0x3')});};
\ No newline at end of file
index 0677c8d..06eeefe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a37=['strategy','Agents','whatsappPause','getWhatsappQueues','../client','Request','GetWhatsappQueue','name','timeout'];(function(_0x41c3b4,_0xcc56e5){var _0x436d49=function(_0x45491c){while(--_0x45491c){_0x41c3b4['push'](_0x41c3b4['shift']());}};_0x436d49(++_0xcc56e5);}(_0x1a37,0x12d));var _0x71a3=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0x1a37[_0x166742];return _0xb7814a;};'use strict';var client=require(_0x71a3('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0x71a3('0x1')](_0x71a3('0x2'),{'options':{'raw':![],'attributes':['id',_0x71a3('0x3'),_0x71a3('0x4'),_0x71a3('0x5')],'include':[{'model':'User','as':_0x71a3('0x6'),'attributes':['id',_0x71a3('0x3'),'online',_0x71a3('0x7')]}]},'log':_0x71a3('0x8')});};};
\ No newline at end of file
+var _0xd274=['Agents','name','online','Request','GetWhatsappQueue','User'];(function(_0x4f6d7b,_0x539e5f){var _0x21337d=function(_0x2c1b50){while(--_0x2c1b50){_0x4f6d7b['push'](_0x4f6d7b['shift']());}};_0x21337d(++_0x539e5f);}(_0xd274,0x18f));var _0x4d27=function(_0x5c05b8,_0xf69f22){_0x5c05b8=_0x5c05b8-0x0;var _0xc08906=_0xd274[_0x5c05b8];return _0xc08906;};'use strict';var client=require('../client');exports['getWhatsappQueues']=function(){return function(){return client[_0x4d27('0x0')](_0x4d27('0x1'),{'options':{'raw':![],'attributes':['id','name','timeout','strategy'],'include':[{'model':_0x4d27('0x2'),'as':_0x4d27('0x3'),'attributes':['id',_0x4d27('0x4'),_0x4d27('0x5'),'whatsappPause']}]},'log':'getWhatsappQueues'});};};
\ No newline at end of file
index 04f2ec6..e6a5df4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbce5=['create','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC','../client'];(function(_0x408c82,_0x1d9f67){var _0x170c8d=function(_0x492555){while(--_0x492555){_0x408c82['push'](_0x408c82['shift']());}};_0x170c8d(++_0x1d9f67);}(_0xbce5,0x12c));var _0x5bce=function(_0x138b2c,_0x142181){_0x138b2c=_0x138b2c-0x0;var _0xa8b921=_0xbce5[_0x138b2c];return _0xa8b921;};'use strict';var client=require(_0x5bce('0x0'));exports[_0x5bce('0x1')]=function(_0x49f2c8){return client[_0x5bce('0x2')](_0x5bce('0x3'),{'body':_0x49f2c8,'log':_0x5bce('0x3')});};exports[_0x5bce('0x4')]=function(_0x1a12dd,_0x2ca617){return client[_0x5bce('0x2')](_0x5bce('0x5'),{'body':_0x2ca617,'options':{'where':{'uniqueid':_0x1a12dd},'order':[['id',_0x5bce('0x6')]],'limit':0x1},'log':_0x5bce('0x5')});};
\ No newline at end of file
+var _0xc5d5=['UpdateWhatsappQueueReport','DESC','../client','Request','CreateWhatsappQueueReport'];(function(_0x1d5a66,_0xc02062){var _0x5a8417=function(_0x1f937f){while(--_0x1f937f){_0x1d5a66['push'](_0x1d5a66['shift']());}};_0x5a8417(++_0xc02062);}(_0xc5d5,0x179));var _0x5c5d=function(_0x1896e4,_0x2c3e68){_0x1896e4=_0x1896e4-0x0;var _0x5b55bb=_0xc5d5[_0x1896e4];return _0x5b55bb;};'use strict';var client=require(_0x5c5d('0x0'));exports['create']=function(_0x587743){return client[_0x5c5d('0x1')](_0x5c5d('0x2'),{'body':_0x587743,'log':'CreateWhatsappQueueReport'});};exports['update']=function(_0x362bf4,_0x13b262){return client[_0x5c5d('0x1')](_0x5c5d('0x3'),{'body':_0x13b262,'options':{'where':{'uniqueid':_0x362bf4},'order':[['id',_0x5c5d('0x4')]],'limit':0x1},'log':_0x5c5d('0x3')});};
\ No newline at end of file
index 141ff07..949d9d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x829b=['log','lodash','util','seq-queue','routing','./strategy','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','validate','error','[%s][AGENT]\x20%s','map','join','stop','find','agents','createQueue','atimeout','channel','START:%s','rules','end','info','close','complete','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s'];(function(_0xdbbdc2,_0x16a3be){var _0x20f387=function(_0x215f7d){while(--_0x215f7d){_0xdbbdc2['push'](_0xdbbdc2['shift']());}};_0x20f387(++_0x16a3be);}(_0x829b,0x1a5));var _0xb829=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0x829b[_0x36ed3c];return _0x52a2e0;};'use strict';var schema=require('validate');var _=require(_0xb829('0x0'));var util=require(_0xb829('0x1'));var seqqueue=require(_0xb829('0x2'));var logger=require('../../../../config/logger')(_0xb829('0x3'));var strategy=require(_0xb829('0x4'));var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x52fc61,_0x408195,_0x1d0b42){return logger['info'](util[_0xb829('0x5')](_0xb829('0x6'),_0x52fc61,_0x408195['name'],_0x1d0b42));}function handleFindAgent(_0x3069b3){return function(_0x52ad6e){return _0x52ad6e[_0xb829('0x7')][_0xb829('0x8')]()===_0x3069b3[_0xb829('0x8')]();};}exports[_0xb829('0x9')]=function(_0x5f3ae7,_0x7f7ccb,_0x5df885,_0x2ecd99){return function(_0x3db677){try{var _0x56f927={'name':_0x7f7ccb[0x0],'timeout':_0x7f7ccb[0x1]};var _0x272959=queue[_0xb829('0xa')](_0x56f927,{'typecast':!![]});if(_0x272959['length']){logger[_0xb829('0xb')](_0xb829('0xc'),_0x5f3ae7,_[_0xb829('0xd')](_0x272959,'message')[_0xb829('0xe')](',\x20'));_0x3db677[_0xb829('0xf')]();}else{var _0x1d665c=_[_0xb829('0x10')](_0x5df885[_0xb829('0x11')],handleFindAgent(_0x56f927[_0xb829('0x7')]));if(_0x1d665c){var _0x178d69=(_0x56f927['timeout']||0xa)*0x3e8;var _0x1c1daa,_0x10e579;var _0x364bbd=seqqueue[_0xb829('0x12')](_0x178d69);_0x364bbd['id']=_0x5f3ae7;_0x364bbd[_0xb829('0x13')]=_0x178d69;_0x364bbd[_0xb829('0x14')]=_0x2ecd99[_0xb829('0x14')];writeLog(_0x5f3ae7,_0x1d665c,util['format'](_0xb829('0x15'),_0x178d69));_0x5df885[_0xb829('0x16')][_0x5f3ae7]['on'](_0xb829('0x17'),function(){logger[_0xb829('0x18')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x5f3ae7);clearTimeout(_0x10e579);_0x10e579=undefined;_0x364bbd[_0xb829('0x19')]();if(_0x5df885[_0xb829('0x16')][_0x5f3ae7]){delete _0x5df885[_0xb829('0x16')][_0x5f3ae7];}_0x3db677[_0xb829('0xf')]();});_0x5df885[_0xb829('0x16')][_0x5f3ae7]['on'](_0xb829('0x1a'),function(){if(_0x5df885[_0xb829('0x16')][_0x5f3ae7]){delete _0x5df885[_0xb829('0x16')][_0x5f3ae7];}});_0x10e579=setTimeout(function(){logger[_0xb829('0x18')]('[%s][AGENT]\x20ROUTING\x20END',_0x5f3ae7);clearTimeout(_0x10e579);_0x364bbd['close']();_0x3db677['next']();},_0x178d69);strategy[_0xb829('0x1b')](_0x364bbd,_0x1d665c,_0x5df885,_0x2ecd99);}else{logger['error'](_0xb829('0x1c'),_0x5f3ae7,_0x56f927['name']);_0x3db677['stop']();}}}catch(_0x2e5b9b){console[_0xb829('0x1d')](_0x2e5b9b);logger[_0xb829('0xb')]('[%s][QUEUE]\x20%s',_0x5f3ae7,_0x2e5b9b['stack']);_0x3db677[_0xb829('0xf')]();}};};
\ No newline at end of file
+var _0xbe54=['log','[%s][QUEUE]\x20%s','validate','lodash','util','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','format','[%s][AGENT][NAME:%s][STATUS:%s]','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','message','stop','find','agents','name','timeout','channel','rules','end','info','[%s][AGENT]\x20ROUTING\x20STOPPED','complete','[%s][AGENT]\x20ROUTING\x20END','agent'];(function(_0xfbdff6,_0x2af690){var _0x4cb9be=function(_0x4022d8){while(--_0x4022d8){_0xfbdff6['push'](_0xfbdff6['shift']());}};_0x4cb9be(++_0x2af690);}(_0xbe54,0x134));var _0x4be5=function(_0x498c8c,_0x29b8a0){_0x498c8c=_0x498c8c-0x0;var _0x13ae37=_0xbe54[_0x498c8c];return _0x13ae37;};'use strict';var schema=require(_0x4be5('0x0'));var _=require(_0x4be5('0x1'));var util=require(_0x4be5('0x2'));var seqqueue=require('seq-queue');var logger=require(_0x4be5('0x3'))(_0x4be5('0x4'));var strategy=require(_0x4be5('0x5'));var queue=schema({'name':{'type':_0x4be5('0x6'),'required':!![],'message':_0x4be5('0x7')},'timeout':{'type':_0x4be5('0x8'),'message':_0x4be5('0x9')}});function writeLog(_0x57bfcb,_0x3ffd37,_0x425a7b){return logger['info'](util[_0x4be5('0xa')](_0x4be5('0xb'),_0x57bfcb,_0x3ffd37['name'],_0x425a7b));}function handleFindAgent(_0x5dd2ea){return function(_0x334fd0){return _0x334fd0['name'][_0x4be5('0xc')]()===_0x5dd2ea['toLowerCase']();};}exports[_0x4be5('0xd')]=function(_0x8578f0,_0x2e3bf6,_0x2b7a77,_0x18c01c){return function(_0x34e809){try{var _0x3ab8cf={'name':_0x2e3bf6[0x0],'timeout':_0x2e3bf6[0x1]};var _0x541daa=queue[_0x4be5('0x0')](_0x3ab8cf,{'typecast':!![]});if(_0x541daa[_0x4be5('0xe')]){logger[_0x4be5('0xf')](_0x4be5('0x10'),_0x8578f0,_[_0x4be5('0x11')](_0x541daa,_0x4be5('0x12'))['join'](',\x20'));_0x34e809[_0x4be5('0x13')]();}else{var _0x5d96d9=_[_0x4be5('0x14')](_0x2b7a77[_0x4be5('0x15')],handleFindAgent(_0x3ab8cf[_0x4be5('0x16')]));if(_0x5d96d9){var _0x39d6e3=(_0x3ab8cf[_0x4be5('0x17')]||0xa)*0x3e8;var _0x5ce0f,_0x291781;var _0x57af54=seqqueue['createQueue'](_0x39d6e3);_0x57af54['id']=_0x8578f0;_0x57af54['atimeout']=_0x39d6e3;_0x57af54[_0x4be5('0x18')]=_0x18c01c['channel'];writeLog(_0x8578f0,_0x5d96d9,util[_0x4be5('0xa')]('START:%s',_0x39d6e3));_0x2b7a77[_0x4be5('0x19')][_0x8578f0]['on'](_0x4be5('0x1a'),function(){logger[_0x4be5('0x1b')](_0x4be5('0x1c'),_0x8578f0);clearTimeout(_0x291781);_0x291781=undefined;_0x57af54['close']();if(_0x2b7a77[_0x4be5('0x19')][_0x8578f0]){delete _0x2b7a77[_0x4be5('0x19')][_0x8578f0];}_0x34e809[_0x4be5('0x13')]();});_0x2b7a77['rules'][_0x8578f0]['on'](_0x4be5('0x1d'),function(){if(_0x2b7a77[_0x4be5('0x19')][_0x8578f0]){delete _0x2b7a77[_0x4be5('0x19')][_0x8578f0];}});_0x291781=setTimeout(function(){logger[_0x4be5('0x1b')](_0x4be5('0x1e'),_0x8578f0);clearTimeout(_0x291781);_0x57af54['close']();_0x34e809['next']();},_0x39d6e3);strategy[_0x4be5('0x1f')](_0x57af54,_0x5d96d9,_0x2b7a77,_0x18c01c);}else{logger[_0x4be5('0xf')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x8578f0,_0x3ab8cf['name']);_0x34e809[_0x4be5('0x13')]();}}}catch(_0x1e7773){console[_0x4be5('0x20')](_0x1e7773);logger[_0x4be5('0xf')](_0x4be5('0x21'),_0x8578f0,_0x1e7773['stack']);_0x34e809[_0x4be5('0x13')]();}};};
\ No newline at end of file
index 47668aa..4738a9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe3b=['chat','ChatWebsiteId','account','InteractionId','isEmpty','body','Message','[%s][AMAZONLEX]\x20%s','catch','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST','toString','postText','error','message','amazonlex','providerResponse','create','Failed','next','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0xbe3b,0xa7));var _0xbbe3=function(_0x36c6eb,_0x4fb127){_0x36c6eb=_0x36c6eb-0x0;var _0x30675b=_0xbe3b[_0x36c6eb];return _0x30675b;};'use strict';var _=require(_0xbbe3('0x0'));var moment=require(_0xbbe3('0x1'));var AWS=require(_0xbbe3('0x2'));var utils=require(_0xbbe3('0x3'));var logger=require(_0xbbe3('0x4'))(_0xbbe3('0x5'));var rpc={'chatMessage':require(_0xbbe3('0x6')),'openchannelMessage':require(_0xbbe3('0x7')),'mailMessage':require(_0xbbe3('0x8')),'smsMessage':require(_0xbbe3('0x9')),'faxMessage':require(_0xbbe3('0xa')),'whatsappMessage':require(_0xbbe3('0xb'))};exports[_0xbbe3('0xc')]=function(_0x4a5438,_0xdec22e){return function(_0x3b1727){try{if(!_[_0xbbe3('0xd')](this[_0xbbe3('0xe')][_0xbbe3('0xf')])){logger[_0xbbe3('0x10')]('[%s][AMAZONLEX]\x20%s',_0x4a5438,_0xbbe3('0x11'));return _0x3b1727['next']();}var _0x3922ac={'ContactId':this[_0xbbe3('0x12')]['id'],'sentAt':moment()[_0xbbe3('0x13')](_0xbbe3('0x14')),'direction':'out'};if(this[_0xbbe3('0x15')]===_0xbbe3('0x16')||this[_0xbbe3('0x15')]===_0xbbe3('0x17')){_0x3922ac[_0xbbe3('0x18')]=this['interaction'][_0xbbe3('0x18')];}var _0x5b14f9=this[_0xbbe3('0x15')];if(_0x5b14f9===_0xbbe3('0x19')){_0x3922ac[_0xbbe3('0x1a')]=this[_0xbbe3('0x1b')]['id'];}else{_0x3922ac[_['upperFirst'](_0x5b14f9)+'AccountId']=this[_0xbbe3('0x1b')]['id'];}_0x3922ac[_['upperFirst'](_0x5b14f9)+_0xbbe3('0x1c')]=this['interaction']['id'];if(this[_0xbbe3('0xe')]['created']){var _0x1c699f=_0xdec22e[0x4];if(!_[_0xbbe3('0x1d')](_0x1c699f)){_0x3922ac[_0xbbe3('0x1e')]=utils['getMustacheRender'](_0x1c699f,this);return rpc[_0x5b14f9+_0xbbe3('0x1f')]['create'](_0x3922ac)['then'](function(_0x31899f){logger[_0xbbe3('0x10')](_0xbbe3('0x20'),_0x4a5438,_0x3922ac[_0xbbe3('0x1e')]);})[_0xbbe3('0x21')](function(_0x1b1942){logger['error'](_0xbbe3('0x20'),_0x4a5438,JSON[_0xbbe3('0x22')](_0x1b1942));})['finally'](function(){logger[_0xbbe3('0x10')](_0xbbe3('0x23'),_0x4a5438);_0x3b1727[_0xbbe3('0x24')]();});}else{logger[_0xbbe3('0x10')](_0xbbe3('0x25'),_0x4a5438);_0x3b1727[_0xbbe3('0x24')]();}}else{var _0x3397fa=this;var _0x4b4f25=new AWS['LexRuntime']({'accessKeyId':_0xdec22e[0x0],'secretAccessKey':_0xdec22e[0x1],'region':_0xdec22e[0x2]});var _0x4889e1={'botAlias':_0xbbe3('0x26'),'botName':_0xdec22e[0x3],'inputText':this['message']['body'],'userId':this[_0xbbe3('0x15')]+':'+this[_0xbbe3('0xe')]['id'][_0xbbe3('0x27')]()};_0x4b4f25[_0xbbe3('0x28')](_0x4889e1,function(_0x5b6632,_0x59f80c){if(_0x5b6632){logger[_0xbbe3('0x29')]('[%s][AMAZONLEX]\x20%s',_0x4a5438,_0x5b6632['message']);_0x3b1727['next']();}else if(_0x59f80c&&_0x59f80c[_0xbbe3('0x2a')]){_0x3397fa[_0xbbe3('0x1e')][_0xbbe3('0x2b')]=_0x59f80c;_0x3922ac[_0xbbe3('0x1e')]=_0x59f80c[_0xbbe3('0x2a')];_0x3922ac['providerName']=_0xbbe3('0x2b');_0x3922ac[_0xbbe3('0x2c')]=JSON['stringify'](_0x59f80c);return rpc[_0x5b14f9+_0xbbe3('0x1f')][_0xbbe3('0x2d')](_0x3922ac)['then'](function(_0x1d67dd){logger[_0xbbe3('0x10')]('[%s][AMAZONLEX]\x20%s',_0x4a5438,_0x3922ac[_0xbbe3('0x1e')]);if(_0x59f80c['dialogState']==_0xbbe3('0x2e')){_0x3b1727['next']();}else{_0x3b1727[_0xbbe3('0x24')]();}})[_0xbbe3('0x21')](function(_0x65a51d){logger['error'](_0xbbe3('0x20'),_0x4a5438,JSON['stringify'](_0x65a51d));_0x3b1727[_0xbbe3('0x2f')]();});}else{_0x3b1727[_0xbbe3('0x2f')]();}});}}catch(_0x4a978b){logger[_0xbbe3('0x29')](_0xbbe3('0x20'),_0x4a5438,JSON[_0xbbe3('0x22')](_0x4a978b));_0x3b1727[_0xbbe3('0x24')]();}};};
\ No newline at end of file
+var _0xa8cc=['../../rpc/faxMessage','consequence','isNil','UserId','info','[%s][AMAZONLEX]\x20%s','contact','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','phone','interaction','chat','ChatWebsiteId','AccountId','account','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','catch','error','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','postText','next','amazonlex','providerName','providerResponse','dialogState','Failed','lodash','moment','aws-sdk','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage'];(function(_0x18fb4c,_0x578f22){var _0x4a75b3=function(_0x27d762){while(--_0x27d762){_0x18fb4c['push'](_0x18fb4c['shift']());}};_0x4a75b3(++_0x578f22);}(_0xa8cc,0xf2));var _0xca8c=function(_0x9a7498,_0x52ab75){_0x9a7498=_0x9a7498-0x0;var _0x57d56c=_0xa8cc[_0x9a7498];return _0x57d56c;};'use strict';var _=require(_0xca8c('0x0'));var moment=require(_0xca8c('0x1'));var AWS=require(_0xca8c('0x2'));var utils=require(_0xca8c('0x3'));var logger=require(_0xca8c('0x4'))('routing');var rpc={'chatMessage':require(_0xca8c('0x5')),'openchannelMessage':require(_0xca8c('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xca8c('0x7')),'faxMessage':require(_0xca8c('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xca8c('0x9')]=function(_0x30c66e,_0x3fd088){return function(_0x25a8b1){try{if(!_[_0xca8c('0xa')](this['interaction'][_0xca8c('0xb')])){logger[_0xca8c('0xc')](_0xca8c('0xd'),_0x30c66e,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x25a8b1['next']();}var _0x4daf79={'ContactId':this[_0xca8c('0xe')]['id'],'sentAt':moment()['format'](_0xca8c('0xf')),'direction':_0xca8c('0x10')};if(this['channel']===_0xca8c('0x11')||this[_0xca8c('0x12')]==='whatsapp'){_0x4daf79[_0xca8c('0x13')]=this[_0xca8c('0x14')]['phone'];}var _0x232f03=this[_0xca8c('0x12')];if(_0x232f03===_0xca8c('0x15')){_0x4daf79[_0xca8c('0x16')]=this['account']['id'];}else{_0x4daf79[_['upperFirst'](_0x232f03)+_0xca8c('0x17')]=this[_0xca8c('0x18')]['id'];}_0x4daf79[_[_0xca8c('0x19')](_0x232f03)+_0xca8c('0x1a')]=this[_0xca8c('0x14')]['id'];if(this['interaction'][_0xca8c('0x1b')]){var _0x1f79ee=_0x3fd088[0x4];if(!_[_0xca8c('0x1c')](_0x1f79ee)){_0x4daf79[_0xca8c('0x1d')]=utils[_0xca8c('0x1e')](_0x1f79ee,this);return rpc[_0x232f03+_0xca8c('0x1f')][_0xca8c('0x20')](_0x4daf79)[_0xca8c('0x21')](function(_0x339e75){logger[_0xca8c('0xc')](_0xca8c('0xd'),_0x30c66e,_0x4daf79[_0xca8c('0x1d')]);})[_0xca8c('0x22')](function(_0x3e3d1c){logger[_0xca8c('0x23')](_0xca8c('0xd'),_0x30c66e,JSON[_0xca8c('0x24')](_0x3e3d1c));})['finally'](function(){logger['info'](_0xca8c('0x25'),_0x30c66e);_0x25a8b1[_0xca8c('0x26')]();});}else{logger[_0xca8c('0xc')](_0xca8c('0x27'),_0x30c66e);_0x25a8b1[_0xca8c('0x26')]();}}else{var _0xa578ac=this;var _0xe00589=new AWS[(_0xca8c('0x28'))]({'accessKeyId':_0x3fd088[0x0],'secretAccessKey':_0x3fd088[0x1],'region':_0x3fd088[0x2]});var _0x1ba142={'botAlias':_0xca8c('0x29'),'botName':_0x3fd088[0x3],'inputText':this[_0xca8c('0x2a')]['body'],'userId':this[_0xca8c('0x12')]+':'+this['interaction']['id']['toString']()};_0xe00589[_0xca8c('0x2b')](_0x1ba142,function(_0x36aa7d,_0x2cdba1){if(_0x36aa7d){logger['error'](_0xca8c('0xd'),_0x30c66e,_0x36aa7d[_0xca8c('0x2a')]);_0x25a8b1[_0xca8c('0x2c')]();}else if(_0x2cdba1&&_0x2cdba1[_0xca8c('0x2a')]){_0xa578ac[_0xca8c('0x1d')][_0xca8c('0x2d')]=_0x2cdba1;_0x4daf79[_0xca8c('0x1d')]=_0x2cdba1['message'];_0x4daf79[_0xca8c('0x2e')]=_0xca8c('0x2d');_0x4daf79[_0xca8c('0x2f')]=JSON[_0xca8c('0x24')](_0x2cdba1);return rpc[_0x232f03+_0xca8c('0x1f')]['create'](_0x4daf79)['then'](function(_0x46923c){logger[_0xca8c('0xc')](_0xca8c('0xd'),_0x30c66e,_0x4daf79[_0xca8c('0x1d')]);if(_0x2cdba1[_0xca8c('0x30')]==_0xca8c('0x31')){_0x25a8b1[_0xca8c('0x2c')]();}else{_0x25a8b1[_0xca8c('0x26')]();}})[_0xca8c('0x22')](function(_0x2bf03f){logger['error'](_0xca8c('0xd'),_0x30c66e,JSON[_0xca8c('0x24')](_0x2bf03f));_0x25a8b1[_0xca8c('0x2c')]();});}else{_0x25a8b1['next']();}});}}catch(_0x5a2357){logger[_0xca8c('0x23')](_0xca8c('0xd'),_0x30c66e,JSON[_0xca8c('0x24')](_0x5a2357));_0x25a8b1[_0xca8c('0x26')]();}};};
\ No newline at end of file
index 9f075f2..0664c75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x275a=['out','channel','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','chat','account','upperFirst','AccountId','mail','Smtp','service','host','port','secure','authentication','auth','user','pass','inReplyTo','messageId','<div\x20id=\x22xm-mail-content\x22>','replace','<div\x20id=\x22xm-mail-content\x22','<div','headers','auto-replied','All','auto_reply','then','Message','stringify','catch','error','finally','resolve','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','create','lodash','moment','./utils','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','interaction','created','Autoreply\x20already\x20sent','next','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x1c7889,_0x24cd26){var _0x2f14e5=function(_0x9ae1b1){while(--_0x9ae1b1){_0x1c7889['push'](_0x1c7889['shift']());}};_0x2f14e5(++_0x24cd26);}(_0x275a,0xc3));var _0xa275=function(_0x31ced5,_0x5d5415){_0x31ced5=_0x31ced5-0x0;var _0x10d9e5=_0x275a[_0x31ced5];return _0x10d9e5;};'use strict';var _=require(_0xa275('0x0'));var moment=require(_0xa275('0x1'));var utils=require(_0xa275('0x2'));var logger=require(_0xa275('0x3'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xa275('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xa275('0x5')),'faxMessage':require(_0xa275('0x6')),'whatsappMessage':require(_0xa275('0x7')),'chatInteraction':require(_0xa275('0x8')),'openchannelInteraction':require(_0xa275('0x9')),'mailInteraction':require(_0xa275('0xa')),'smsInteraction':require(_0xa275('0xb')),'faxInteraction':require(_0xa275('0xc')),'whatsappInteraction':require(_0xa275('0xd'))};var mailRpc=require('../../mailRpc');exports[_0xa275('0xe')]=function(_0x4e16c8,_0x4bf97b,_0x3232db,_0x3d0ccd){return function(_0x511c95){try{var _0x50e1bd=this['channel'];if(_0x50e1bd==='mail'&&_0x3d0ccd[_0xa275('0xf')][_0xa275('0x10')]){logger[_0xa275('0x11')](_0xa275('0x12'),_0x4e16c8,_0xa275('0x13'));return _0x511c95['next']();}if(_0x4bf97b[0x0]==='1'&&(_['isNil'](this[_0xa275('0x14')]['created'])||!this['interaction'][_0xa275('0x15')])){logger['info'](_0xa275('0x12'),_0x4e16c8,_0xa275('0x16'));return _0x511c95[_0xa275('0x17')]();}if(_0x4bf97b[0x0]==='2'&&this['interaction'][_0xa275('0x18')]){logger[_0xa275('0x11')](_0xa275('0x19'),_0x4e16c8,_0xa275('0x1a'));return _0x511c95[_0xa275('0x17')]();}var _0x4efad9={'ContactId':this[_0xa275('0x1b')]['id'],'sentAt':moment()[_0xa275('0x1c')](_0xa275('0x1d')),'direction':_0xa275('0x1e')};if(this[_0xa275('0x1f')]==='mail'){_0x4efad9[_0xa275('0xf')]=utils['getMustacheRender'](_0x4bf97b[0x2],this);}else{_0x4efad9['body']=utils[_0xa275('0x20')](_0x4bf97b[0x1],this);}if(this[_0xa275('0x21')]){_0x4efad9['to']=this[_0xa275('0x21')][_0xa275('0x22')]||'';if(this['channel']==='mail'&&_0x4bf97b[0x1]==='1'){_0x4efad9['cc']=this[_0xa275('0x21')]['cc']||'';}_0x4efad9[_0xa275('0x22')]=this[_0xa275('0x21')]['to']||'';_0x4efad9[_0xa275('0x23')]=this[_0xa275('0x21')][_0xa275('0x23')]||'';_0x4efad9[_0xa275('0x24')]=!![];if(this[_0xa275('0x21')][_0xa275('0x25')]){_0x4efad9[_0xa275('0x25')]='';_0x4efad9[_0xa275('0x25')]+=_[_0xa275('0x26')](this['message'][_0xa275('0x25')],_0xa275('0x27'))?'':'Re:\x20';_0x4efad9[_0xa275('0x25')]+=this[_0xa275('0x21')]['subject'];}}if(this[_0xa275('0x1f')]===_0xa275('0x28')){_0x4efad9['ChatWebsiteId']=this[_0xa275('0x29')]['id'];}else{_0x4efad9[_[_0xa275('0x2a')](this[_0xa275('0x1f')])+_0xa275('0x2b')]=this[_0xa275('0x29')]['id'];}_0x4efad9[_[_0xa275('0x2a')](this[_0xa275('0x1f')])+'InteractionId']=this[_0xa275('0x14')]['id'];var _0x2babac=this[_0xa275('0x14')];if(rpc[this['channel']+'Message']){if(this['channel']===_0xa275('0x2c')){var _0x230a20={'tls':{'rejectUnauthorized':![]}};if(this['account'][_0xa275('0x2d')][_0xa275('0x2e')]){_0x230a20['service']=this[_0xa275('0x29')]['Smtp'][_0xa275('0x2e')];}else{_0x230a20[_0xa275('0x2f')]=this[_0xa275('0x29')][_0xa275('0x2d')][_0xa275('0x2f')];_0x230a20[_0xa275('0x30')]=this['account'][_0xa275('0x2d')][_0xa275('0x30')];_0x230a20[_0xa275('0x31')]=this['account'][_0xa275('0x2d')]['secure'];}if(this[_0xa275('0x29')][_0xa275('0x2d')][_0xa275('0x32')]){_0x230a20[_0xa275('0x33')]={'user':this[_0xa275('0x29')][_0xa275('0x2d')][_0xa275('0x34')],'pass':this[_0xa275('0x29')][_0xa275('0x2d')][_0xa275('0x35')]};}_0x4efad9[_0xa275('0x36')]=this[_0xa275('0x21')][_0xa275('0x37')];_0x4efad9['html']=_0xa275('0x38')+_[_0xa275('0x39')](_0x4efad9['body'],_0xa275('0x3a'),_0xa275('0x3b'))+'</div>';_0x4efad9[_0xa275('0x3c')]={'Auto-Submitted':_0xa275('0x3d'),'X-Auto-Response-Suppress':_0xa275('0x3e'),'Precedence':_0xa275('0x3f')};return mailRpc['sendMailMessage'](_0x230a20,_0x4efad9)[_0xa275('0x40')](function(_0x3f001e){logger['info']('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x4e16c8);_0x4efad9[_0xa275('0x37')]=_0x3f001e['message'][_0xa275('0x37')];return rpc[_0x50e1bd+_0xa275('0x41')]['create'](_0x4efad9);})[_0xa275('0x40')](function(_0x2c7ee7){logger[_0xa275('0x11')](_0xa275('0x12'),_0x4e16c8,JSON[_0xa275('0x42')](_0x2c7ee7));})[_0xa275('0x43')](function(_0xf2b038){logger[_0xa275('0x44')]('[RPC][%s][AUTOREPLY]\x20%s',_0x4e16c8,JSON['stringify'](_0xf2b038));})[_0xa275('0x45')](function(){Promise[_0xa275('0x46')]()[_0xa275('0x40')](function(){if(_0x4bf97b[0x0]!=='2'||_0x2babac['autoreplyExecuted'])return;return rpc[_0x50e1bd+_0xa275('0x47')][_0xa275('0x48')](_0x2babac['id'],{'autoreplyExecuted':!![]})[_0xa275('0x40')](function(_0xf4e511){logger[_0xa275('0x11')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x4e16c8,JSON[_0xa275('0x42')](_0xf4e511));})[_0xa275('0x43')](function(_0x5719d0){logger[_0xa275('0x44')](_0xa275('0x49'),_0x4e16c8,JSON[_0xa275('0x42')](_0x5719d0));});})[_0xa275('0x40')](function(){_0x511c95[_0xa275('0x17')]();});});}else{return rpc[this[_0xa275('0x1f')]+_0xa275('0x41')][_0xa275('0x4a')](_0x4efad9)[_0xa275('0x40')](function(_0x58323b){logger[_0xa275('0x11')](_0xa275('0x12'),_0x4e16c8,_0x4efad9['body']);})[_0xa275('0x43')](function(_0x3f3534){logger[_0xa275('0x44')](_0xa275('0x12'),_0x4e16c8,JSON[_0xa275('0x42')](_0x3f3534));})['finally'](function(){Promise[_0xa275('0x46')]()[_0xa275('0x40')](function(){if(_0x4bf97b[0x0]!=='2'||_0x2babac[_0xa275('0x18')])return;return rpc[_0x50e1bd+_0xa275('0x47')]['update'](_0x2babac['id'],{'autoreplyExecuted':!![]})[_0xa275('0x40')](function(_0x3d5747){logger[_0xa275('0x11')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x4e16c8,JSON[_0xa275('0x42')](_0x3d5747));})[_0xa275('0x43')](function(_0x3352bd){logger[_0xa275('0x44')](_0xa275('0x49'),_0x4e16c8,JSON[_0xa275('0x42')](_0x3352bd));});})[_0xa275('0x40')](function(){_0x511c95[_0xa275('0x17')]();});});}}}catch(_0xed5d97){logger[_0xa275('0x44')](_0xa275('0x12'),_0x4e16c8,JSON[_0xa275('0x42')](_0xed5d97));_0x511c95['stop']();}};};
\ No newline at end of file
+var _0xcc94=['subject','Re:','Re:\x20','chat','ChatWebsiteId','account','upperFirst','Message','Smtp','service','host','port','secure','auth','user','pass','inReplyTo','messageId','html','replace','<div\x20id=\x22xm-mail-content\x22','<div','</div>','headers','All','auto_reply','sendMailMessage','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','resolve','Interaction','then','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','next','finally','update','stop','lodash','moment','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','isAutoreply','info','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','isNil','interaction','created','[%s][AUTOREPLY]\x20%s','autoreplyExecuted','One\x20Time\x20already\x20sent','YYYY-MM-DD\x20HH:mm:ss','body','getMustacheRender','from','mail','message','phone','read'];(function(_0x21d8c5,_0x24b600){var _0x3a457d=function(_0x1fd14b){while(--_0x1fd14b){_0x21d8c5['push'](_0x21d8c5['shift']());}};_0x3a457d(++_0x24b600);}(_0xcc94,0x75));var _0x4cc9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcc94[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4cc9('0x0'));var moment=require(_0x4cc9('0x1'));var utils=require('./utils');var logger=require(_0x4cc9('0x2'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x4cc9('0x3')),'mailMessage':require(_0x4cc9('0x4')),'smsMessage':require(_0x4cc9('0x5')),'faxMessage':require(_0x4cc9('0x6')),'whatsappMessage':require(_0x4cc9('0x7')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x4cc9('0x8')),'mailInteraction':require(_0x4cc9('0x9')),'smsInteraction':require(_0x4cc9('0xa')),'faxInteraction':require(_0x4cc9('0xb')),'whatsappInteraction':require(_0x4cc9('0xc'))};var mailRpc=require(_0x4cc9('0xd'));exports[_0x4cc9('0xe')]=function(_0x27ae14,_0x424534,_0x3d9906,_0x1976d1){return function(_0x1eb40b){try{var _0x3099d8=this[_0x4cc9('0xf')];if(_0x3099d8==='mail'&&_0x1976d1['body'][_0x4cc9('0x10')]){logger[_0x4cc9('0x11')]('[%s][AUTOREPLY]\x20%s',_0x27ae14,_0x4cc9('0x12'));return _0x1eb40b['next']();}if(_0x424534[0x0]==='1'&&(_[_0x4cc9('0x13')](this[_0x4cc9('0x14')][_0x4cc9('0x15')])||!this[_0x4cc9('0x14')][_0x4cc9('0x15')])){logger[_0x4cc9('0x11')](_0x4cc9('0x16'),_0x27ae14,'Autoreply\x20already\x20sent');return _0x1eb40b['next']();}if(_0x424534[0x0]==='2'&&this[_0x4cc9('0x14')][_0x4cc9('0x17')]){logger[_0x4cc9('0x11')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x27ae14,_0x4cc9('0x18'));return _0x1eb40b['next']();}var _0x455dba={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0x4cc9('0x19')),'direction':'out'};if(this['channel']==='mail'){_0x455dba[_0x4cc9('0x1a')]=utils[_0x4cc9('0x1b')](_0x424534[0x2],this);}else{_0x455dba[_0x4cc9('0x1a')]=utils[_0x4cc9('0x1b')](_0x424534[0x1],this);}if(this['message']){_0x455dba['to']=this['message'][_0x4cc9('0x1c')]||'';if(this['channel']===_0x4cc9('0x1d')&&_0x424534[0x1]==='1'){_0x455dba['cc']=this[_0x4cc9('0x1e')]['cc']||'';}_0x455dba[_0x4cc9('0x1c')]=this[_0x4cc9('0x1e')]['to']||'';_0x455dba['phone']=this['message'][_0x4cc9('0x1f')]||'';_0x455dba[_0x4cc9('0x20')]=!![];if(this[_0x4cc9('0x1e')][_0x4cc9('0x21')]){_0x455dba['subject']='';_0x455dba['subject']+=_['startsWith'](this['message'][_0x4cc9('0x21')],_0x4cc9('0x22'))?'':_0x4cc9('0x23');_0x455dba[_0x4cc9('0x21')]+=this[_0x4cc9('0x1e')][_0x4cc9('0x21')];}}if(this['channel']===_0x4cc9('0x24')){_0x455dba[_0x4cc9('0x25')]=this[_0x4cc9('0x26')]['id'];}else{_0x455dba[_[_0x4cc9('0x27')](this[_0x4cc9('0xf')])+'AccountId']=this['account']['id'];}_0x455dba[_[_0x4cc9('0x27')](this[_0x4cc9('0xf')])+'InteractionId']=this[_0x4cc9('0x14')]['id'];var _0x5d20a6=this[_0x4cc9('0x14')];if(rpc[this[_0x4cc9('0xf')]+_0x4cc9('0x28')]){if(this[_0x4cc9('0xf')]==='mail'){var _0x22cdd8={'tls':{'rejectUnauthorized':![]}};if(this['account'][_0x4cc9('0x29')][_0x4cc9('0x2a')]){_0x22cdd8[_0x4cc9('0x2a')]=this[_0x4cc9('0x26')][_0x4cc9('0x29')][_0x4cc9('0x2a')];}else{_0x22cdd8['host']=this[_0x4cc9('0x26')][_0x4cc9('0x29')][_0x4cc9('0x2b')];_0x22cdd8['port']=this[_0x4cc9('0x26')][_0x4cc9('0x29')][_0x4cc9('0x2c')];_0x22cdd8[_0x4cc9('0x2d')]=this[_0x4cc9('0x26')]['Smtp'][_0x4cc9('0x2d')];}if(this[_0x4cc9('0x26')]['Smtp']['authentication']){_0x22cdd8[_0x4cc9('0x2e')]={'user':this[_0x4cc9('0x26')][_0x4cc9('0x29')][_0x4cc9('0x2f')],'pass':this['account'][_0x4cc9('0x29')][_0x4cc9('0x30')]};}_0x455dba[_0x4cc9('0x31')]=this[_0x4cc9('0x1e')][_0x4cc9('0x32')];_0x455dba[_0x4cc9('0x33')]='<div\x20id=\x22xm-mail-content\x22>'+_[_0x4cc9('0x34')](_0x455dba['body'],_0x4cc9('0x35'),_0x4cc9('0x36'))+_0x4cc9('0x37');_0x455dba[_0x4cc9('0x38')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':_0x4cc9('0x39'),'Precedence':_0x4cc9('0x3a')};return mailRpc[_0x4cc9('0x3b')](_0x22cdd8,_0x455dba)['then'](function(_0xab0c2a){logger[_0x4cc9('0x11')](_0x4cc9('0x3c'),_0x27ae14);_0x455dba[_0x4cc9('0x32')]=_0xab0c2a['message']['messageId'];return rpc[_0x3099d8+'Message'][_0x4cc9('0x3d')](_0x455dba);})['then'](function(_0x25732d){logger[_0x4cc9('0x11')](_0x4cc9('0x16'),_0x27ae14,JSON[_0x4cc9('0x3e')](_0x25732d));})[_0x4cc9('0x3f')](function(_0x474ab8){logger[_0x4cc9('0x40')](_0x4cc9('0x41'),_0x27ae14,JSON['stringify'](_0x474ab8));})['finally'](function(){Promise[_0x4cc9('0x42')]()['then'](function(){if(_0x424534[0x0]!=='2'||_0x5d20a6[_0x4cc9('0x17')])return;return rpc[_0x3099d8+_0x4cc9('0x43')]['update'](_0x5d20a6['id'],{'autoreplyExecuted':!![]})[_0x4cc9('0x44')](function(_0x423caa){logger['info'](_0x4cc9('0x45'),_0x27ae14,JSON['stringify'](_0x423caa));})['catch'](function(_0x3292){logger['error'](_0x4cc9('0x46'),_0x27ae14,JSON['stringify'](_0x3292));});})[_0x4cc9('0x44')](function(){_0x1eb40b[_0x4cc9('0x47')]();});});}else{return rpc[this[_0x4cc9('0xf')]+'Message']['create'](_0x455dba)[_0x4cc9('0x44')](function(_0xf100d2){logger[_0x4cc9('0x11')](_0x4cc9('0x16'),_0x27ae14,_0x455dba[_0x4cc9('0x1a')]);})[_0x4cc9('0x3f')](function(_0x4e3d0e){logger[_0x4cc9('0x40')](_0x4cc9('0x16'),_0x27ae14,JSON['stringify'](_0x4e3d0e));})[_0x4cc9('0x48')](function(){Promise[_0x4cc9('0x42')]()[_0x4cc9('0x44')](function(){if(_0x424534[0x0]!=='2'||_0x5d20a6[_0x4cc9('0x17')])return;return rpc[_0x3099d8+_0x4cc9('0x43')][_0x4cc9('0x49')](_0x5d20a6['id'],{'autoreplyExecuted':!![]})[_0x4cc9('0x44')](function(_0x4745e7){logger[_0x4cc9('0x11')](_0x4cc9('0x45'),_0x27ae14,JSON[_0x4cc9('0x3e')](_0x4745e7));})['catch'](function(_0x41edff){logger['error'](_0x4cc9('0x46'),_0x27ae14,JSON[_0x4cc9('0x3e')](_0x41edff));});})[_0x4cc9('0x44')](function(){_0x1eb40b[_0x4cc9('0x47')]();});});}}}catch(_0x573ab0){logger['error'](_0x4cc9('0x16'),_0x27ae14,JSON[_0x4cc9('0x3e')](_0x573ab0));_0x1eb40b[_0x4cc9('0x4a')]();}};};
\ No newline at end of file
index d4e244f..b776434 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4d1=['moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','Interaction','channel','update','interaction','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','error','[%s][CLOSE]\x20%s','stringify','finally','stop'];(function(_0x503950,_0x5022eb){var _0x1657a9=function(_0x4c1e8f){while(--_0x4c1e8f){_0x503950['push'](_0x503950['shift']());}};_0x1657a9(++_0x5022eb);}(_0xa4d1,0x176));var _0x1a4d=function(_0x2696cf,_0x2bb42d){_0x2696cf=_0x2696cf-0x0;var _0x4d872d=_0xa4d1[_0x2696cf];return _0x4d872d;};'use strict';var moment=require(_0x1a4d('0x0'));var logger=require(_0x1a4d('0x1'))(_0x1a4d('0x2'));var rpc={'chatInteraction':require(_0x1a4d('0x3')),'openchannelInteraction':require(_0x1a4d('0x4')),'smsInteraction':require(_0x1a4d('0x5')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x1a4d('0x6')),'whatsappInteraction':require(_0x1a4d('0x7'))};exports['consequence']=function(_0x43a987,_0x281f53,_0x435679,_0x5ce0ed){return function(_0x254887){try{logger['info'](_0x1a4d('0x8'),_0x43a987,_0x281f53[0x0]);var _0x43218e={'closed':0x1,'closedAt':moment()[_0x1a4d('0x9')](_0x1a4d('0xa')),'closeReason':'system','disposition':_0x281f53[0x0]};if(rpc[_0x5ce0ed['channel']+_0x1a4d('0xb')]){rpc[_0x5ce0ed[_0x1a4d('0xc')]+_0x1a4d('0xb')][_0x1a4d('0xd')](_0x5ce0ed[_0x1a4d('0xe')]['id'],_0x43218e)['then'](function(_0x5ea946){logger[_0x1a4d('0xf')](_0x1a4d('0x10'),_0x43a987,_0x5ce0ed['interaction']['id']);})['catch'](function(_0x5398d3){logger[_0x1a4d('0x11')](_0x1a4d('0x12'),_0x43a987,JSON[_0x1a4d('0x13')](_0x5398d3));})[_0x1a4d('0x14')](function(){_0x254887[_0x1a4d('0x15')]();});}}catch(_0x373ca){logger[_0x1a4d('0x11')](_0x1a4d('0x12'),_0x43a987,JSON[_0x1a4d('0x13')](_0x373ca));_0x254887[_0x1a4d('0x15')]();}};};
\ No newline at end of file
+var _0xc705=['../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','system','Interaction','update','then','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','interaction','catch','error','[%s][CLOSE]\x20%s','stringify','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction'];(function(_0x45adb4,_0x2abb06){var _0x137296=function(_0x552ec9){while(--_0x552ec9){_0x45adb4['push'](_0x45adb4['shift']());}};_0x137296(++_0x2abb06);}(_0xc705,0x73));var _0x5c70=function(_0x421725,_0x318a04){_0x421725=_0x421725-0x0;var _0x51b322=_0xc705[_0x421725];return _0x51b322;};'use strict';var moment=require(_0x5c70('0x0'));var logger=require(_0x5c70('0x1'))(_0x5c70('0x2'));var rpc={'chatInteraction':require(_0x5c70('0x3')),'openchannelInteraction':require(_0x5c70('0x4')),'smsInteraction':require(_0x5c70('0x5')),'mailInteraction':require(_0x5c70('0x6')),'faxInteraction':require(_0x5c70('0x7')),'whatsappInteraction':require(_0x5c70('0x8'))};exports[_0x5c70('0x9')]=function(_0xe92830,_0x28c402,_0xf623c4,_0x3640a4){return function(_0x4bdddb){try{logger['info'](_0x5c70('0xa'),_0xe92830,_0x28c402[0x0]);var _0x135c78={'closed':0x1,'closedAt':moment()['format'](_0x5c70('0xb')),'closeReason':_0x5c70('0xc'),'disposition':_0x28c402[0x0]};if(rpc[_0x3640a4['channel']+'Interaction']){rpc[_0x3640a4['channel']+_0x5c70('0xd')][_0x5c70('0xe')](_0x3640a4['interaction']['id'],_0x135c78)[_0x5c70('0xf')](function(_0x26b657){logger[_0x5c70('0x10')](_0x5c70('0x11'),_0xe92830,_0x3640a4[_0x5c70('0x12')]['id']);})[_0x5c70('0x13')](function(_0x3b8438){logger[_0x5c70('0x14')](_0x5c70('0x15'),_0xe92830,JSON[_0x5c70('0x16')](_0x3b8438));})['finally'](function(){_0x4bdddb[_0x5c70('0x17')]();});}}catch(_0x50c52e){logger[_0x5c70('0x14')]('[%s][CLOSE]\x20%s',_0xe92830,JSON[_0x5c70('0x16')](_0x50c52e));_0x4bdddb[_0x5c70('0x17')]();}};};
\ No newline at end of file
index fef7eca..cd22222 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaafc=['interaction','created','isEmpty','body','getMustacheRender','create','then','info','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','textRequest','message','dialogflow','result','fulfillment','speech','providerName','metadata','endConversation','moment','apiai-promise','md5','./utils','routing','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','isNil','UserId','[%s][DIALOGFLOW]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xaafc,0x176));var _0xcaaf=function(_0x1b97c2,_0x4548ba){_0x1b97c2=_0x1b97c2-0x0;var _0x2b6253=_0xaafc[_0x1b97c2];return _0x2b6253;};'use strict';var _=require('lodash');var moment=require(_0xcaaf('0x0'));var apiai=require(_0xcaaf('0x1'));var md5=require(_0xcaaf('0x2'));var utils=require(_0xcaaf('0x3'));var logger=require('../../../../config/logger')(_0xcaaf('0x4'));var rpc={'chatMessage':require(_0xcaaf('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xcaaf('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xcaaf('0x7'))};exports['consequence']=function(_0x31e6bb,_0x19d453){return function(_0x22d1b2){try{if(!_[_0xcaaf('0x8')](this['interaction'][_0xcaaf('0x9')])){logger['info'](_0xcaaf('0xa'),_0x31e6bb,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x22d1b2[_0xcaaf('0xb')]();}var _0x5f11b0={'ContactId':this[_0xcaaf('0xc')]['id'],'sentAt':moment()[_0xcaaf('0xd')](_0xcaaf('0xe')),'direction':_0xcaaf('0xf')};if(this[_0xcaaf('0x10')]===_0xcaaf('0x11')||this[_0xcaaf('0x10')]===_0xcaaf('0x12')){_0x5f11b0[_0xcaaf('0x13')]=this['interaction'][_0xcaaf('0x13')];}var _0x3fea84=this[_0xcaaf('0x10')];if(_0x3fea84===_0xcaaf('0x14')){_0x5f11b0[_0xcaaf('0x15')]=this[_0xcaaf('0x16')]['id'];}else{_0x5f11b0[_[_0xcaaf('0x17')](_0x3fea84)+_0xcaaf('0x18')]=this[_0xcaaf('0x16')]['id'];}_0x5f11b0[_[_0xcaaf('0x17')](_0x3fea84)+_0xcaaf('0x19')]=this['interaction']['id'];if(this[_0xcaaf('0x1a')][_0xcaaf('0x1b')]){var _0x7f23fb=_0x19d453[0x2];if(!_[_0xcaaf('0x1c')](_0x7f23fb)){_0x5f11b0[_0xcaaf('0x1d')]=utils[_0xcaaf('0x1e')](_0x7f23fb,this);return rpc[_0x3fea84+'Message'][_0xcaaf('0x1f')](_0x5f11b0)[_0xcaaf('0x20')](function(_0x534598){logger[_0xcaaf('0x21')](_0xcaaf('0xa'),_0x31e6bb,_0x5f11b0[_0xcaaf('0x1d')]);})[_0xcaaf('0x22')](function(_0x4775e5){logger[_0xcaaf('0x23')](_0xcaaf('0xa'),_0x31e6bb,JSON[_0xcaaf('0x24')](_0x4775e5));})[_0xcaaf('0x25')](function(){logger[_0xcaaf('0x21')](_0xcaaf('0x26'),_0x31e6bb);_0x22d1b2['stop']();});}else{logger[_0xcaaf('0x21')](_0xcaaf('0x27'),_0x31e6bb);_0x22d1b2[_0xcaaf('0x28')]();}}else{var _0x110974=this;var _0x359339=apiai(_0x19d453[0x0],{'language':_0x19d453[0x1]||'en'});return _0x359339[_0xcaaf('0x29')](this[_0xcaaf('0x2a')]['body'],{'sessionId':md5(this[_0xcaaf('0x1a')]['id'])})[_0xcaaf('0x20')](function(_0x3f62c8){_0x110974['body'][_0xcaaf('0x2b')]=_0x3f62c8;_0x5f11b0[_0xcaaf('0x1d')]=_0x3f62c8[_0xcaaf('0x2c')][_0xcaaf('0x2d')][_0xcaaf('0x2e')];_0x5f11b0[_0xcaaf('0x2f')]=_0xcaaf('0x2b');_0x5f11b0['providerResponse']=JSON[_0xcaaf('0x24')](_0x3f62c8);return rpc[_0x3fea84+'Message']['create'](_0x5f11b0)['then'](function(_0x30d68a){logger[_0xcaaf('0x21')](_0xcaaf('0xa'),_0x31e6bb,_0x5f11b0[_0xcaaf('0x1d')]);if(_0x3f62c8[_0xcaaf('0x2c')][_0xcaaf('0x30')][_0xcaaf('0x31')]){_0x22d1b2[_0xcaaf('0xb')]();}else{_0x22d1b2[_0xcaaf('0x28')]();}})['catch'](function(_0x4cacf9){logger[_0xcaaf('0x23')]('[%s][DIALOGFLOW]\x20%s',_0x31e6bb,JSON[_0xcaaf('0x24')](_0x4cacf9));_0x22d1b2['next']();});})[_0xcaaf('0x22')](function(_0x10fec3){logger[_0xcaaf('0x23')](_0xcaaf('0xa'),_0x31e6bb,_0x10fec3['message']);_0x22d1b2[_0xcaaf('0xb')]();});}}catch(_0x2d0881){logger[_0xcaaf('0x23')]('[%s][DIALOGFLOW]\x20%s',_0x31e6bb,JSON['stringify'](_0x2d0881));_0x22d1b2[_0xcaaf('0x28')]();}};};
\ No newline at end of file
+var _0xf981=['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','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','isEmpty','body','getMustacheRender','Message','create','then','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','message','dialogflow','speech','providerResponse','metadata','endConversation','next','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','UserId'];(function(_0x43196f,_0x12abef){var _0x125e16=function(_0x35b0db){while(--_0x35b0db){_0x43196f['push'](_0x43196f['shift']());}};_0x125e16(++_0x12abef);}(_0xf981,0xe6));var _0x1f98=function(_0x2aee2f,_0x5dd3b6){_0x2aee2f=_0x2aee2f-0x0;var _0x7477a3=_0xf981[_0x2aee2f];return _0x7477a3;};'use strict';var _=require(_0x1f98('0x0'));var moment=require(_0x1f98('0x1'));var apiai=require(_0x1f98('0x2'));var md5=require(_0x1f98('0x3'));var utils=require(_0x1f98('0x4'));var logger=require(_0x1f98('0x5'))(_0x1f98('0x6'));var rpc={'chatMessage':require(_0x1f98('0x7')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x1f98('0x8')),'smsMessage':require(_0x1f98('0x9')),'faxMessage':require(_0x1f98('0xa')),'whatsappMessage':require(_0x1f98('0xb'))};exports[_0x1f98('0xc')]=function(_0x4a4526,_0x5cd3d5){return function(_0x24a520){try{if(!_['isNil'](this[_0x1f98('0xd')][_0x1f98('0xe')])){logger[_0x1f98('0xf')](_0x1f98('0x10'),_0x4a4526,_0x1f98('0x11'));return _0x24a520['next']();}var _0x459195={'ContactId':this[_0x1f98('0x12')]['id'],'sentAt':moment()[_0x1f98('0x13')](_0x1f98('0x14')),'direction':'out'};if(this[_0x1f98('0x15')]==='sms'||this[_0x1f98('0x15')]===_0x1f98('0x16')){_0x459195[_0x1f98('0x17')]=this['interaction']['phone'];}var _0x5b18c6=this[_0x1f98('0x15')];if(_0x5b18c6===_0x1f98('0x18')){_0x459195[_0x1f98('0x19')]=this[_0x1f98('0x1a')]['id'];}else{_0x459195[_[_0x1f98('0x1b')](_0x5b18c6)+_0x1f98('0x1c')]=this[_0x1f98('0x1a')]['id'];}_0x459195[_['upperFirst'](_0x5b18c6)+_0x1f98('0x1d')]=this['interaction']['id'];if(this[_0x1f98('0xd')]['created']){var _0x4534d7=_0x5cd3d5[0x2];if(!_[_0x1f98('0x1e')](_0x4534d7)){_0x459195[_0x1f98('0x1f')]=utils[_0x1f98('0x20')](_0x4534d7,this);return rpc[_0x5b18c6+_0x1f98('0x21')][_0x1f98('0x22')](_0x459195)[_0x1f98('0x23')](function(_0x52966d){logger[_0x1f98('0xf')]('[%s][DIALOGFLOW]\x20%s',_0x4a4526,_0x459195[_0x1f98('0x1f')]);})[_0x1f98('0x24')](function(_0xd0529a){logger[_0x1f98('0x25')](_0x1f98('0x10'),_0x4a4526,JSON[_0x1f98('0x26')](_0xd0529a));})[_0x1f98('0x27')](function(){logger[_0x1f98('0xf')](_0x1f98('0x28'),_0x4a4526);_0x24a520[_0x1f98('0x29')]();});}else{logger['info']('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x4a4526);_0x24a520[_0x1f98('0x29')]();}}else{var _0x431958=this;var _0x46582d=apiai(_0x5cd3d5[0x0],{'language':_0x5cd3d5[0x1]||'en'});return _0x46582d['textRequest'](this[_0x1f98('0x2a')][_0x1f98('0x1f')],{'sessionId':md5(this['interaction']['id'])})['then'](function(_0x1de1cd){_0x431958['body'][_0x1f98('0x2b')]=_0x1de1cd;_0x459195['body']=_0x1de1cd['result']['fulfillment'][_0x1f98('0x2c')];_0x459195['providerName']=_0x1f98('0x2b');_0x459195[_0x1f98('0x2d')]=JSON[_0x1f98('0x26')](_0x1de1cd);return rpc[_0x5b18c6+_0x1f98('0x21')][_0x1f98('0x22')](_0x459195)[_0x1f98('0x23')](function(_0x401606){logger[_0x1f98('0xf')]('[%s][DIALOGFLOW]\x20%s',_0x4a4526,_0x459195[_0x1f98('0x1f')]);if(_0x1de1cd['result'][_0x1f98('0x2e')][_0x1f98('0x2f')]){_0x24a520[_0x1f98('0x30')]();}else{_0x24a520[_0x1f98('0x29')]();}})['catch'](function(_0x4c39c1){logger[_0x1f98('0x25')](_0x1f98('0x10'),_0x4a4526,JSON[_0x1f98('0x26')](_0x4c39c1));_0x24a520[_0x1f98('0x30')]();});})['catch'](function(_0x20ab93){logger['error'](_0x1f98('0x10'),_0x4a4526,_0x20ab93['message']);_0x24a520['next']();});}}catch(_0x15a9c5){logger[_0x1f98('0x25')](_0x1f98('0x10'),_0x4a4526,JSON[_0x1f98('0x26')](_0x15a9c5));_0x24a520[_0x1f98('0x29')]();}};};
\ No newline at end of file
index f1a3afa..6a3acd7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c21=['DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','dialogflowV2','providerResponse','stringify','fulfillmentText','all','lodash','dialogflow','md5','moment','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','create','then','[%s][DIALOGFLOWV2]\x20%s','catch','error','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','channel','whatsapp','phone','chat','ChatWebsiteId','upperFirst','account','InteractionId','created','isEmpty','getMustacheRender','Message','info','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','detectIntent','length','queryResult','diagnosticInfo','fields','DIALOGFLOWV2_ACTION','action','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','end_conversation','boolValue','name','DIALOGFLOWV2_INTENTDISPLAYNAME','isFallback','queryText'];(function(_0x53694f,_0x51bf92){var _0x180fa3=function(_0x44223f){while(--_0x44223f){_0x53694f['push'](_0x53694f['shift']());}};_0x180fa3(++_0x51bf92);}(_0x6c21,0x1b2));var _0x16c2=function(_0x5d67e1,_0x308ffc){_0x5d67e1=_0x5d67e1-0x0;var _0x156bda=_0x6c21[_0x5d67e1];return _0x156bda;};'use strict';var _=require(_0x16c2('0x0'));var dialogflow=require(_0x16c2('0x1'));var md5=require(_0x16c2('0x2'));var moment=require(_0x16c2('0x3'));var Promise=require('bluebird');var logger=require(_0x16c2('0x4'))(_0x16c2('0x5'));var utils=require(_0x16c2('0x6'));var rpc={'chatMessage':require(_0x16c2('0x7')),'openchannelMessage':require(_0x16c2('0x8')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x16c2('0x9')),'faxMessage':require(_0x16c2('0xa')),'whatsappMessage':require(_0x16c2('0xb'))};function createMessage(_0xf43d76,_0x1ea374,_0x9a14a9,_0xa518aa){return new Promise(function(_0x33d57e,_0x2fe691){var _0x270969=_[_0x16c2('0xc')](_0x9a14a9);_0x270969[_0x16c2('0xd')]=_0xa518aa;return rpc[_0x1ea374+'Message'][_0x16c2('0xe')](_0x270969)[_0x16c2('0xf')](function(){logger['info'](_0x16c2('0x10'),_0xf43d76,_0x270969[_0x16c2('0xd')]);_0x33d57e();})[_0x16c2('0x11')](function(_0x5201da){logger[_0x16c2('0x12')](_0x16c2('0x10'),_0xf43d76,JSON['stringify'](_0x5201da));_0x2fe691(_0x5201da);});});}exports[_0x16c2('0x13')]=function(_0x1eaad4,_0x2cd9d3){return function(_0x59414f){try{if(!_[_0x16c2('0x14')](this[_0x16c2('0x15')][_0x16c2('0x16')])){logger['info'](_0x16c2('0x10'),_0x1eaad4,_0x16c2('0x17'));return _0x59414f[_0x16c2('0x18')]();}var _0x4f5d6b={'ContactId':this['contact']['id'],'sentAt':moment()[_0x16c2('0x19')](_0x16c2('0x1a')),'direction':'out'};if(this[_0x16c2('0x1b')]==='sms'||this[_0x16c2('0x1b')]===_0x16c2('0x1c')){_0x4f5d6b[_0x16c2('0x1d')]=this[_0x16c2('0x15')][_0x16c2('0x1d')];}var _0x535cb2=this[_0x16c2('0x1b')];if(_0x535cb2===_0x16c2('0x1e')){_0x4f5d6b[_0x16c2('0x1f')]=this['account']['id'];}else{_0x4f5d6b[_[_0x16c2('0x20')](_0x535cb2)+'AccountId']=this[_0x16c2('0x21')]['id'];}_0x4f5d6b[_['upperFirst'](_0x535cb2)+_0x16c2('0x22')]=this['interaction']['id'];if(this[_0x16c2('0x15')][_0x16c2('0x23')]){var _0x32deaf=_0x2cd9d3[0x4];if(!_[_0x16c2('0x24')](_0x32deaf)){_0x4f5d6b['body']=utils[_0x16c2('0x25')](_0x32deaf,this);return rpc[_0x535cb2+_0x16c2('0x26')][_0x16c2('0xe')](_0x4f5d6b)[_0x16c2('0xf')](function(_0x157e9f){logger[_0x16c2('0x27')](_0x16c2('0x10'),_0x1eaad4,_0x4f5d6b[_0x16c2('0xd')]);})['catch'](function(_0x396ab8){logger[_0x16c2('0x12')](_0x16c2('0x10'),_0x1eaad4,JSON['stringify'](_0x396ab8));})[_0x16c2('0x28')](function(){logger['info'](_0x16c2('0x29'),_0x1eaad4);_0x59414f[_0x16c2('0x2a')]();});}else{logger['info'](_0x16c2('0x2b'),_0x1eaad4);_0x59414f[_0x16c2('0x2a')]();}}else{var _0x30c978=this;var _0x114473=_0x2cd9d3[0x2][_0x16c2('0x2c')](/\\n/g,'\x0a');var _0x42a430={'credentials':{'private_key':_0x114473,'client_email':_0x2cd9d3[0x1]}};var _0x42a9ad=new dialogflow[(_0x16c2('0x2d'))](_0x42a430);var _0x478493=_0x42a9ad[_0x16c2('0x2e')](_0x2cd9d3[0x0],md5(_0x30c978[_0x16c2('0x15')]['id']));var _0x3f0beb={'session':_0x478493,'queryInput':{'text':{'text':_0x30c978[_0x16c2('0x2f')][_0x16c2('0xd')],'languageCode':_0x2cd9d3[0x3]||'en'}}};return _0x42a9ad[_0x16c2('0x30')](_0x3f0beb)['then'](function(_0x169493){if(_0x169493&&_0x169493[_0x16c2('0x31')]){_0x30c978[_0x16c2('0xd')]['dialogflowV2']=_0x169493;var _0x45fe74=_0x169493[0x0];var _0x1c8720=_0x45fe74[_0x16c2('0x32')]['diagnosticInfo']&&_0x45fe74['queryResult'][_0x16c2('0x33')][_0x16c2('0x34')]?_0x45fe74[_0x16c2('0x32')][_0x16c2('0x33')]['fields']['end_conversation']['boolValue']:![];_0x30c978[_0x16c2('0xd')][_0x16c2('0x35')]=_0x45fe74['queryResult'][_0x16c2('0x36')];_0x30c978[_0x16c2('0xd')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x45fe74[_0x16c2('0x32')][_0x16c2('0x37')];_0x30c978[_0x16c2('0xd')][_0x16c2('0x38')]=_0x45fe74[_0x16c2('0x32')]['diagnosticInfo']&&_0x45fe74['queryResult'][_0x16c2('0x33')][_0x16c2('0x34')]?_0x45fe74[_0x16c2('0x32')][_0x16c2('0x33')][_0x16c2('0x34')][_0x16c2('0x39')][_0x16c2('0x3a')]:![];_0x30c978[_0x16c2('0xd')]['DIALOGFLOWV2_INTENTNAME']=_0x45fe74[_0x16c2('0x32')]['intent'][_0x16c2('0x3b')];_0x30c978['body'][_0x16c2('0x3c')]=_0x45fe74[_0x16c2('0x32')]['intent']['displayName'];_0x30c978['body']['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x45fe74[_0x16c2('0x32')]['intent'][_0x16c2('0x3d')];_0x30c978[_0x16c2('0xd')]['DIALOGFLOWV2_LANGUAGECODE']=_0x45fe74[_0x16c2('0x32')]['languageCode'];_0x30c978[_0x16c2('0xd')]['DIALOGFLOWV2_QUERYTEXT']=_0x45fe74['queryResult'][_0x16c2('0x3e')];_0x30c978[_0x16c2('0xd')][_0x16c2('0x3f')]=_0x45fe74[_0x16c2('0x32')][_0x16c2('0x40')];_0x4f5d6b[_0x16c2('0x41')]=_0x16c2('0x42');_0x4f5d6b[_0x16c2('0x43')]=JSON[_0x16c2('0x44')](_0x169493);var _0x1dd7aa=[];for(var _0x2e9dec=0x0;_0x2e9dec<_0x169493[_0x16c2('0x31')];_0x2e9dec++){var _0x468971=_0x169493[_0x2e9dec];if(_0x468971&&_0x468971[_0x16c2('0x32')]&&_0x468971[_0x16c2('0x32')][_0x16c2('0x45')]){_0x1dd7aa['push'](createMessage(_0x1eaad4,_0x535cb2,_0x4f5d6b,_0x468971['queryResult']['fulfillmentText']));}}return Promise[_0x16c2('0x46')](_0x1dd7aa)[_0x16c2('0xf')](function(){if(_0x1c8720){_0x59414f[_0x16c2('0x18')]();}else{_0x59414f[_0x16c2('0x2a')]();}})[_0x16c2('0x11')](function(_0x3ba3a4){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x1eaad4,JSON[_0x16c2('0x44')](_0x3ba3a4));_0x59414f[_0x16c2('0x18')]();});}})[_0x16c2('0x11')](function(_0x3813fc){logger[_0x16c2('0x12')]('[%s][DIALOGFLOWV2]\x20%s',_0x1eaad4,_0x3813fc[_0x16c2('0x2f')]);_0x59414f[_0x16c2('0x18')]();});}}catch(_0x53aca2){logger[_0x16c2('0x12')](_0x16c2('0x10'),_0x1eaad4,JSON[_0x16c2('0x44')](_0x53aca2));_0x59414f[_0x16c2('0x2a')]();}};};
\ No newline at end of file
+var _0x5d89=['intentDetectionConfidence','providerResponse','stringify','fulfillmentText','all','lodash','dialogflow','md5','moment','bluebird','../../../../config/logger','routing','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','clone','body','Message','create','info','catch','consequence','isNil','interaction','UserId','[%s][DIALOGFLOWV2]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','AccountId','account','upperFirst','getMustacheRender','then','error','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','SessionsClient','sessionPath','message','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','isFallback','DIALOGFLOWV2_LANGUAGECODE','DIALOGFLOWV2_QUERYTEXT','queryText'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5d89,0xd7));var _0x95d8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d89[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x95d8('0x0'));var dialogflow=require(_0x95d8('0x1'));var md5=require(_0x95d8('0x2'));var moment=require(_0x95d8('0x3'));var Promise=require(_0x95d8('0x4'));var logger=require(_0x95d8('0x5'))(_0x95d8('0x6'));var utils=require('./utils');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x95d8('0x7')),'smsMessage':require(_0x95d8('0x8')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x95d8('0x9'))};function createMessage(_0x366ee4,_0x248763,_0x30adbc,_0x330b52){return new Promise(function(_0x458e91,_0x5a1a25){var _0x4d9811=_[_0x95d8('0xa')](_0x30adbc);_0x4d9811[_0x95d8('0xb')]=_0x330b52;return rpc[_0x248763+_0x95d8('0xc')][_0x95d8('0xd')](_0x4d9811)['then'](function(){logger[_0x95d8('0xe')]('[%s][DIALOGFLOWV2]\x20%s',_0x366ee4,_0x4d9811[_0x95d8('0xb')]);_0x458e91();})[_0x95d8('0xf')](function(_0x1107e6){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x366ee4,JSON['stringify'](_0x1107e6));_0x5a1a25(_0x1107e6);});});}exports[_0x95d8('0x10')]=function(_0x4d9a04,_0x144c0a){return function(_0x4a1138){try{if(!_[_0x95d8('0x11')](this[_0x95d8('0x12')][_0x95d8('0x13')])){logger['info'](_0x95d8('0x14'),_0x4d9a04,_0x95d8('0x15'));return _0x4a1138[_0x95d8('0x16')]();}var _0xec6a04={'ContactId':this[_0x95d8('0x17')]['id'],'sentAt':moment()[_0x95d8('0x18')](_0x95d8('0x19')),'direction':_0x95d8('0x1a')};if(this[_0x95d8('0x1b')]===_0x95d8('0x1c')||this['channel']===_0x95d8('0x1d')){_0xec6a04[_0x95d8('0x1e')]=this['interaction'][_0x95d8('0x1e')];}var _0x5f395e=this[_0x95d8('0x1b')];if(_0x5f395e==='chat'){_0xec6a04['ChatWebsiteId']=this['account']['id'];}else{_0xec6a04[_['upperFirst'](_0x5f395e)+_0x95d8('0x1f')]=this[_0x95d8('0x20')]['id'];}_0xec6a04[_[_0x95d8('0x21')](_0x5f395e)+'InteractionId']=this[_0x95d8('0x12')]['id'];if(this[_0x95d8('0x12')]['created']){var _0x330c7f=_0x144c0a[0x4];if(!_['isEmpty'](_0x330c7f)){_0xec6a04['body']=utils[_0x95d8('0x22')](_0x330c7f,this);return rpc[_0x5f395e+_0x95d8('0xc')]['create'](_0xec6a04)[_0x95d8('0x23')](function(_0x9491db){logger[_0x95d8('0xe')](_0x95d8('0x14'),_0x4d9a04,_0xec6a04[_0x95d8('0xb')]);})[_0x95d8('0xf')](function(_0x2979c2){logger[_0x95d8('0x24')](_0x95d8('0x14'),_0x4d9a04,JSON['stringify'](_0x2979c2));})[_0x95d8('0x25')](function(){logger[_0x95d8('0xe')](_0x95d8('0x26'),_0x4d9a04);_0x4a1138[_0x95d8('0x27')]();});}else{logger[_0x95d8('0xe')](_0x95d8('0x28'),_0x4d9a04);_0x4a1138[_0x95d8('0x27')]();}}else{var _0x1a5db6=this;var _0x383df3=_0x144c0a[0x2]['replace'](/\\n/g,'\x0a');var _0x1bbc17={'credentials':{'private_key':_0x383df3,'client_email':_0x144c0a[0x1]}};var _0x14753f=new dialogflow[(_0x95d8('0x29'))](_0x1bbc17);var _0x58e71a=_0x14753f[_0x95d8('0x2a')](_0x144c0a[0x0],md5(_0x1a5db6['interaction']['id']));var _0x3793d0={'session':_0x58e71a,'queryInput':{'text':{'text':_0x1a5db6[_0x95d8('0x2b')]['body'],'languageCode':_0x144c0a[0x3]||'en'}}};return _0x14753f['detectIntent'](_0x3793d0)[_0x95d8('0x23')](function(_0x122250){if(_0x122250&&_0x122250[_0x95d8('0x2c')]){_0x1a5db6['body'][_0x95d8('0x2d')]=_0x122250;var _0x56aec6=_0x122250[0x0];var _0x33b688=_0x56aec6[_0x95d8('0x2e')][_0x95d8('0x2f')]&&_0x56aec6[_0x95d8('0x2e')]['diagnosticInfo'][_0x95d8('0x30')]?_0x56aec6['queryResult'][_0x95d8('0x2f')][_0x95d8('0x30')][_0x95d8('0x31')][_0x95d8('0x32')]:![];_0x1a5db6['body'][_0x95d8('0x33')]=_0x56aec6[_0x95d8('0x2e')][_0x95d8('0x34')];_0x1a5db6[_0x95d8('0xb')][_0x95d8('0x35')]=_0x56aec6[_0x95d8('0x2e')][_0x95d8('0x36')];_0x1a5db6[_0x95d8('0xb')][_0x95d8('0x37')]=_0x56aec6[_0x95d8('0x2e')]['diagnosticInfo']&&_0x56aec6[_0x95d8('0x2e')][_0x95d8('0x2f')][_0x95d8('0x30')]?_0x56aec6[_0x95d8('0x2e')]['diagnosticInfo'][_0x95d8('0x30')][_0x95d8('0x31')][_0x95d8('0x32')]:![];_0x1a5db6['body'][_0x95d8('0x38')]=_0x56aec6['queryResult'][_0x95d8('0x39')][_0x95d8('0x3a')];_0x1a5db6[_0x95d8('0xb')][_0x95d8('0x3b')]=_0x56aec6[_0x95d8('0x2e')][_0x95d8('0x39')][_0x95d8('0x3c')];_0x1a5db6['body']['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x56aec6[_0x95d8('0x2e')][_0x95d8('0x39')][_0x95d8('0x3d')];_0x1a5db6[_0x95d8('0xb')][_0x95d8('0x3e')]=_0x56aec6['queryResult']['languageCode'];_0x1a5db6[_0x95d8('0xb')][_0x95d8('0x3f')]=_0x56aec6[_0x95d8('0x2e')][_0x95d8('0x40')];_0x1a5db6[_0x95d8('0xb')]['DIALOGFLOWV2_SCORE']=_0x56aec6[_0x95d8('0x2e')][_0x95d8('0x41')];_0xec6a04['providerName']=_0x95d8('0x2d');_0xec6a04[_0x95d8('0x42')]=JSON[_0x95d8('0x43')](_0x122250);var _0xb364ec=[];for(var _0x4c4fe1=0x0;_0x4c4fe1<_0x122250[_0x95d8('0x2c')];_0x4c4fe1++){var _0x2850cd=_0x122250[_0x4c4fe1];if(_0x2850cd&&_0x2850cd[_0x95d8('0x2e')]&&_0x2850cd[_0x95d8('0x2e')][_0x95d8('0x44')]){_0xb364ec['push'](createMessage(_0x4d9a04,_0x5f395e,_0xec6a04,_0x2850cd['queryResult'][_0x95d8('0x44')]));}}return Promise[_0x95d8('0x45')](_0xb364ec)['then'](function(){if(_0x33b688){_0x4a1138[_0x95d8('0x16')]();}else{_0x4a1138[_0x95d8('0x27')]();}})['catch'](function(_0x276651){logger[_0x95d8('0x24')](_0x95d8('0x14'),_0x4d9a04,JSON[_0x95d8('0x43')](_0x276651));_0x4a1138[_0x95d8('0x16')]();});}})[_0x95d8('0xf')](function(_0x4c0333){logger['error'](_0x95d8('0x14'),_0x4d9a04,_0x4c0333[_0x95d8('0x2b')]);_0x4a1138['next']();});}}catch(_0x52ca3f){logger['error'](_0x95d8('0x14'),_0x4d9a04,JSON[_0x95d8('0x43')](_0x52ca3f));_0x4a1138[_0x95d8('0x27')]();}};};
\ No newline at end of file
index 464c1e4..cfebe83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3238=['priority\x20true\x20is\x20a\x20number','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','replace','error','map','message','join','priorityTrue','info','condition','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x114543,_0x4ee59b){var _0x4ca019=function(_0x1b54e1){while(--_0x1b54e1){_0x114543['push'](_0x114543['shift']());}};_0x4ca019(++_0x4ee59b);}(_0x3238,0x1f0));var _0x8323=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3238[_0x321bb2];return _0x9c12ed;};'use strict';var schema=require(_0x8323('0x0'));var _=require(_0x8323('0x1'));var htmlToText=require(_0x8323('0x2'));var utils=require(_0x8323('0x3'));var logger=require(_0x8323('0x4'))(_0x8323('0x5'));var gotoif=schema({'condition':{'type':_0x8323('0x6'),'required':!![],'message':_0x8323('0x7')},'priorityTrue':{'type':'number','message':_0x8323('0x8')},'priorityFalse':{'type':_0x8323('0x9'),'message':_0x8323('0xa')}});exports[_0x8323('0xb')]=function(_0x1a2b7c,_0xac1c1e){return function(_0x4feb67){try{var _0x2cbc5e={'condition':htmlToText[_0x8323('0xc')](utils['getMustacheRender'](_0xac1c1e[0x0],this),{'wordwrap':![]})[_0x8323('0xd')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0xac1c1e[0x1],'priorityFalse':_0xac1c1e[0x2]};var _0x4ea9ce=gotoif[_0x8323('0x0')](_0x2cbc5e,{'typecast':!![]});if(_0x4ea9ce['length']){logger[_0x8323('0xe')]('[%s][GOTOIF]\x20%s',_0x1a2b7c,_[_0x8323('0xf')](_0x4ea9ce,_0x8323('0x10'))[_0x8323('0x11')](',\x20'));_0x4feb67['stop']();}else{try{var _0x4c4328=eval('('+_0x2cbc5e['condition']+')');var _0x49239c=_0x4c4328?_0x2cbc5e[_0x8323('0x12')]:_0x2cbc5e['priorityFalse'];logger[_0x8323('0x13')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x1a2b7c,_0x2cbc5e[_0x8323('0x14')],_0x4c4328,_0x49239c||'next');if(_0x49239c){var _0x4eaf6f=_[_0x8323('0x15')](_0x4feb67[_0x8323('0x16')](),{'p':_0x49239c});if(_0x4eaf6f>=0x0){logger['info'](_0x8323('0x17'),_0x1a2b7c,_0x49239c||_0x8323('0x18'),_0x4eaf6f);_0x4feb67[_0x8323('0x18')](_0x4eaf6f);}else{logger[_0x8323('0x13')](_0x8323('0x19'),_0x1a2b7c,_0x49239c||_0x8323('0x18'));_0x4feb67[_0x8323('0x1a')]();}}else{_0x4feb67[_0x8323('0x18')]();}}catch(_0x46f779){logger[_0x8323('0xe')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x1a2b7c,_0x46f779[_0x8323('0x10')]);_0x4feb67[_0x8323('0x1a')]();}}}catch(_0x680daa){logger['error']('[%s][GOTOIF]\x20%s',_0x1a2b7c,JSON[_0x8323('0x1b')](_0x680daa));_0x4feb67[_0x8323('0x1a')]();}};};
\ No newline at end of file
+var _0x7bc3=['priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','rules','info','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','error','[%s][GOTOIF]\x20%s','map','message','join','stop','condition'];(function(_0x19f8d6,_0x469ada){var _0x1a6455=function(_0x263e74){while(--_0x263e74){_0x19f8d6['push'](_0x19f8d6['shift']());}};_0x1a6455(++_0x469ada);}(_0x7bc3,0xc4));var _0x37bc=function(_0x5a3f8b,_0x30aef7){_0x5a3f8b=_0x5a3f8b-0x0;var _0x42bacc=_0x7bc3[_0x5a3f8b];return _0x42bacc;};'use strict';var schema=require(_0x37bc('0x0'));var _=require(_0x37bc('0x1'));var htmlToText=require(_0x37bc('0x2'));var utils=require(_0x37bc('0x3'));var logger=require(_0x37bc('0x4'))(_0x37bc('0x5'));var gotoif=schema({'condition':{'type':_0x37bc('0x6'),'required':!![],'message':_0x37bc('0x7')},'priorityTrue':{'type':'number','message':_0x37bc('0x8')},'priorityFalse':{'type':'number','message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x37bc('0x9')]=function(_0x10a9cf,_0x43e00d){return function(_0x4d7551){try{var _0x5766f0={'condition':htmlToText[_0x37bc('0xa')](utils[_0x37bc('0xb')](_0x43e00d[0x0],this),{'wordwrap':![]})[_0x37bc('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x43e00d[0x1],'priorityFalse':_0x43e00d[0x2]};var _0x128c60=gotoif['validate'](_0x5766f0,{'typecast':!![]});if(_0x128c60['length']){logger[_0x37bc('0xd')](_0x37bc('0xe'),_0x10a9cf,_[_0x37bc('0xf')](_0x128c60,_0x37bc('0x10'))[_0x37bc('0x11')](',\x20'));_0x4d7551[_0x37bc('0x12')]();}else{try{var _0x54396e=eval('('+_0x5766f0[_0x37bc('0x13')]+')');var _0x54ab7a=_0x54396e?_0x5766f0['priorityTrue']:_0x5766f0[_0x37bc('0x14')];logger['info'](_0x37bc('0x15'),_0x10a9cf,_0x5766f0[_0x37bc('0x13')],_0x54396e,_0x54ab7a||_0x37bc('0x16'));if(_0x54ab7a){var _0x5a4379=_['findIndex'](_0x4d7551[_0x37bc('0x17')](),{'p':_0x54ab7a});if(_0x5a4379>=0x0){logger[_0x37bc('0x18')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x10a9cf,_0x54ab7a||'next',_0x5a4379);_0x4d7551[_0x37bc('0x16')](_0x5a4379);}else{logger['info'](_0x37bc('0x19'),_0x10a9cf,_0x54ab7a||_0x37bc('0x16'));_0x4d7551[_0x37bc('0x12')]();}}else{_0x4d7551['next']();}}catch(_0x231268){logger[_0x37bc('0xd')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x10a9cf,_0x231268[_0x37bc('0x10')]);_0x4d7551[_0x37bc('0x12')]();}}}catch(_0x349147){logger['error'](_0x37bc('0xe'),_0x10a9cf,JSON[_0x37bc('0x1a')](_0x349147));_0x4d7551['stop']();}};};
\ No newline at end of file
index a9b33fe..c45aff9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9b9=['next','stringify','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','[%s][GOTOP]\x20%s','map','message','join','stop','priority','findIndex','rules','info'];(function(_0x354542,_0x25916c){var _0x44193d=function(_0x2a1ad4){while(--_0x2a1ad4){_0x354542['push'](_0x354542['shift']());}};_0x44193d(++_0x25916c);}(_0xa9b9,0x123));var _0x9a9b=function(_0x7c0032,_0x9b832d){_0x7c0032=_0x7c0032-0x0;var _0x225fb5=_0xa9b9[_0x7c0032];return _0x225fb5;};'use strict';var schema=require('validate');var _=require('lodash');var logger=require(_0x9a9b('0x0'))(_0x9a9b('0x1'));var gotop=schema({'priority':{'type':_0x9a9b('0x2'),'required':!![],'message':_0x9a9b('0x3')}});exports[_0x9a9b('0x4')]=function(_0x59957f,_0x395ae8){return function(_0x17d17c){try{var _0x3cc9ec={'priority':_0x395ae8[0x0]};var _0x5874b0=gotop[_0x9a9b('0x5')](_0x3cc9ec,{'typecast':!![]});if(_0x5874b0['length']){logger['error'](_0x9a9b('0x6'),_0x59957f,_[_0x9a9b('0x7')](_0x5874b0,_0x9a9b('0x8'))[_0x9a9b('0x9')](',\x20'));_0x17d17c[_0x9a9b('0xa')]();}else{logger['info']('[%s][GOTOP]\x20priority\x20%s',_0x59957f,_0x3cc9ec[_0x9a9b('0xb')]);if(_0x3cc9ec['priority']){var _0x4de8ac=_[_0x9a9b('0xc')](_0x17d17c[_0x9a9b('0xd')](),{'p':_0x3cc9ec['priority']});if(_0x4de8ac>=0x0){logger[_0x9a9b('0xe')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x59957f,_0x3cc9ec['priority']||_0x9a9b('0xf'),_0x4de8ac);_0x17d17c[_0x9a9b('0xf')](_0x4de8ac);}else{logger[_0x9a9b('0xe')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x59957f,_0x3cc9ec[_0x9a9b('0xb')]||'next');_0x17d17c[_0x9a9b('0xa')]();}}else{_0x17d17c[_0x9a9b('0xf')]();}}}catch(_0x46e5a0){logger['error'](_0x9a9b('0x6'),_0x59957f,JSON[_0x9a9b('0x10')](_0x46e5a0));_0x17d17c['stop']();}};};
\ No newline at end of file
+var _0x5a1a=['stringify','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length','error','[%s][GOTOP]\x20%s','map','message','join','stop','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','info','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found'];(function(_0x3f6c5a,_0x4a34dc){var _0x3117df=function(_0x54f60b){while(--_0x54f60b){_0x3f6c5a['push'](_0x3f6c5a['shift']());}};_0x3117df(++_0x4a34dc);}(_0x5a1a,0x79));var _0xa5a1=function(_0x5c48ea,_0x2191a2){_0x5c48ea=_0x5c48ea-0x0;var _0x1262dc=_0x5a1a[_0x5c48ea];return _0x1262dc;};'use strict';var schema=require(_0xa5a1('0x0'));var _=require(_0xa5a1('0x1'));var logger=require(_0xa5a1('0x2'))(_0xa5a1('0x3'));var gotop=schema({'priority':{'type':_0xa5a1('0x4'),'required':!![],'message':_0xa5a1('0x5')}});exports['consequence']=function(_0x560c87,_0x341fd0){return function(_0x56a9fd){try{var _0x3b878b={'priority':_0x341fd0[0x0]};var _0x31b2a7=gotop['validate'](_0x3b878b,{'typecast':!![]});if(_0x31b2a7[_0xa5a1('0x6')]){logger[_0xa5a1('0x7')](_0xa5a1('0x8'),_0x560c87,_[_0xa5a1('0x9')](_0x31b2a7,_0xa5a1('0xa'))[_0xa5a1('0xb')](',\x20'));_0x56a9fd[_0xa5a1('0xc')]();}else{logger['info'](_0xa5a1('0xd'),_0x560c87,_0x3b878b[_0xa5a1('0xe')]);if(_0x3b878b[_0xa5a1('0xe')]){var _0x46b4fd=_[_0xa5a1('0xf')](_0x56a9fd['rules'](),{'p':_0x3b878b[_0xa5a1('0xe')]});if(_0x46b4fd>=0x0){logger[_0xa5a1('0x10')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x560c87,_0x3b878b[_0xa5a1('0xe')]||'next',_0x46b4fd);_0x56a9fd[_0xa5a1('0x11')](_0x46b4fd);}else{logger[_0xa5a1('0x10')](_0xa5a1('0x12'),_0x560c87,_0x3b878b['priority']||'next');_0x56a9fd[_0xa5a1('0xc')]();}}else{_0x56a9fd['next']();}}}catch(_0x581422){logger[_0xa5a1('0x7')](_0xa5a1('0x8'),_0x560c87,JSON[_0xa5a1('0x13')](_0x581422));_0x56a9fd['stop']();}};};
\ No newline at end of file
index 1cca457..e31b3eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ea=['../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','Message','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','lodash','./utils'];(function(_0x12b535,_0x5b131a){var _0x2c7ec0=function(_0x5e5ede){while(--_0x5e5ede){_0x12b535['push'](_0x12b535['shift']());}};_0x2c7ec0(++_0x5b131a);}(_0x55ea,0xc9));var _0xa55e=function(_0x39049b,_0x2550a5){_0x39049b=_0x39049b-0x0;var _0x2a74f1=_0x55ea[_0x39049b];return _0x2a74f1;};'use strict';var _=require(_0xa55e('0x0'));var utils=require(_0xa55e('0x1'));var logger=require(_0xa55e('0x2'))('routing');var rpc={'chatMessage':require(_0xa55e('0x3')),'openchannelMessage':require(_0xa55e('0x4')),'mailMessage':require(_0xa55e('0x5')),'smsMessage':require(_0xa55e('0x6')),'faxMessage':require(_0xa55e('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xa55e('0x8')]=function(_0x56ca45,_0x515646){return function(_0x588751){try{var _0x5a009c={'body':utils[_0xa55e('0x9')](_0x515646[0x0],this),'ContactId':this[_0xa55e('0xa')]['id']};if(this[_0xa55e('0xb')]===_0xa55e('0xc')){_0x5a009c[_0xa55e('0xd')]=this[_0xa55e('0xe')]['id'];}else{_0x5a009c[_[_0xa55e('0xf')](this[_0xa55e('0xb')])+_0xa55e('0x10')]=this['account']['id'];}_0x5a009c[_['upperFirst'](this[_0xa55e('0xb')])+_0xa55e('0x11')]=this[_0xa55e('0x12')]['id'];if(rpc[this[_0xa55e('0xb')]+_0xa55e('0x13')]){return rpc[this['channel']+_0xa55e('0x13')]['create'](_0x5a009c)[_0xa55e('0x14')](function(_0x1d45c1){logger[_0xa55e('0x15')](_0xa55e('0x16'),_0x56ca45,_0x5a009c[_0xa55e('0x17')]);_0x588751[_0xa55e('0x18')]();})[_0xa55e('0x19')](function(_0x27746c){logger[_0xa55e('0x1a')]('[%s][MESSAGE]\x20%s',_0x56ca45,JSON[_0xa55e('0x1b')](_0x27746c));_0x588751[_0xa55e('0x1c')]();});}}catch(_0x25fa30){logger[_0xa55e('0x1a')](_0xa55e('0x16'),_0x56ca45,JSON[_0xa55e('0x1b')](_0x25fa30));_0x588751['stop']();}};};
\ No newline at end of file
+var _0x43c8=['InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender','channel','chat','account','AccountId','upperFirst'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x43c8,0xaf));var _0x843c=function(_0x4963e5,_0x2237e8){_0x4963e5=_0x4963e5-0x0;var _0xfdeedb=_0x43c8[_0x4963e5];return _0xfdeedb;};'use strict';var _=require('lodash');var utils=require(_0x843c('0x0'));var logger=require('../../../../config/logger')(_0x843c('0x1'));var rpc={'chatMessage':require(_0x843c('0x2')),'openchannelMessage':require(_0x843c('0x3')),'mailMessage':require(_0x843c('0x4')),'smsMessage':require(_0x843c('0x5')),'faxMessage':require(_0x843c('0x6')),'whatsappMessage':require(_0x843c('0x7'))};exports['consequence']=function(_0x160368,_0x3fc72f){return function(_0xc5913e){try{var _0x15bb1f={'body':utils[_0x843c('0x8')](_0x3fc72f[0x0],this),'ContactId':this['contact']['id']};if(this[_0x843c('0x9')]===_0x843c('0xa')){_0x15bb1f['ChatWebsiteId']=this[_0x843c('0xb')]['id'];}else{_0x15bb1f[_['upperFirst'](this['channel'])+_0x843c('0xc')]=this['account']['id'];}_0x15bb1f[_[_0x843c('0xd')](this[_0x843c('0x9')])+_0x843c('0xe')]=this[_0x843c('0xf')]['id'];if(rpc[this['channel']+_0x843c('0x10')]){return rpc[this[_0x843c('0x9')]+_0x843c('0x10')][_0x843c('0x11')](_0x15bb1f)[_0x843c('0x12')](function(_0x34e297){logger[_0x843c('0x13')](_0x843c('0x14'),_0x160368,_0x15bb1f[_0x843c('0x15')]);_0xc5913e[_0x843c('0x16')]();})[_0x843c('0x17')](function(_0x36e07f){logger[_0x843c('0x18')](_0x843c('0x14'),_0x160368,JSON[_0x843c('0x19')](_0x36e07f));_0xc5913e['stop']();});}}catch(_0x3dc50d){logger[_0x843c('0x18')](_0x843c('0x14'),_0x160368,JSON[_0x843c('0x19')](_0x3dc50d));_0xc5913e[_0x843c('0x1a')]();}};};
\ No newline at end of file
index ecd9753..50c0c2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ef4=['info','getMustacheRender','next','error','[%s][NOOP]\x20%s','stringify','stop','./utils','../../../../config/logger','consequence'];(function(_0x2e835b,_0x384aae){var _0x537288=function(_0xb06b74){while(--_0xb06b74){_0x2e835b['push'](_0x2e835b['shift']());}};_0x537288(++_0x384aae);}(_0x7ef4,0x179));var _0x47ef=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x7ef4[_0x122ef9];return _0x42fba0;};'use strict';var utils=require(_0x47ef('0x0'));var logger=require(_0x47ef('0x1'))('routing');exports[_0x47ef('0x2')]=function(_0x21710e,_0x3d6f3b){return function(_0x1754a0){try{logger[_0x47ef('0x3')]('[%s][NOOP]\x20%s',_0x21710e,utils[_0x47ef('0x4')](_0x3d6f3b[0x0],this));_0x1754a0[_0x47ef('0x5')]();}catch(_0x93e0b7){logger[_0x47ef('0x6')](_0x47ef('0x7'),_0x21710e,JSON[_0x47ef('0x8')](_0x93e0b7));_0x1754a0[_0x47ef('0x9')]();}};};
\ No newline at end of file
+var _0x463d=['routing','consequence','getMustacheRender','next','error','stringify','stop','./utils'];(function(_0x4f2b38,_0x4e6343){var _0x2f6c86=function(_0x541772){while(--_0x541772){_0x4f2b38['push'](_0x4f2b38['shift']());}};_0x2f6c86(++_0x4e6343);}(_0x463d,0x107));var _0xd463=function(_0x304655,_0x15b109){_0x304655=_0x304655-0x0;var _0x2fa58a=_0x463d[_0x304655];return _0x2fa58a;};'use strict';var utils=require(_0xd463('0x0'));var logger=require('../../../../config/logger')(_0xd463('0x1'));exports[_0xd463('0x2')]=function(_0x184b8a,_0x73f056){return function(_0x1d2bc4){try{logger['info']('[%s][NOOP]\x20%s',_0x184b8a,utils[_0xd463('0x3')](_0x73f056[0x0],this));_0x1d2bc4[_0xd463('0x4')]();}catch(_0x54d571){logger[_0xd463('0x5')]('[%s][NOOP]\x20%s',_0x184b8a,JSON[_0xd463('0x6')](_0x54d571));_0x1d2bc4[_0xd463('0x7')]();}};};
\ No newline at end of file
index 492fefc..30cac48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01cc=['error','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','join','stop','find','Queues','timeout','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/logger','routing','redis','defaults','localhost','queue','from','joinAt','emit','clone','queue_id','account','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','remove','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','string','number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','catch','create\x20queue\x20report','waiting','accepted','[%s][STOP:QUEUE][NAME:%s]','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]'];(function(_0x39d22c,_0x288d71){var _0x56bb90=function(_0x27c276){while(--_0x27c276){_0x39d22c['push'](_0x39d22c['shift']());}};_0x56bb90(++_0x288d71);}(_0x01cc,0x109));var _0xc01c=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x01cc[_0x502c7d];return _0x30b7ed;};'use strict';var schema=require(_0xc01c('0x0'));var _=require(_0xc01c('0x1'));var util=require(_0xc01c('0x2'));var seqqueue=require(_0xc01c('0x3'));var moment=require(_0xc01c('0x4'));var Redis=require(_0xc01c('0x5'));var config=require('../../../../config/environment');var logger=require(_0xc01c('0x6'))(_0xc01c('0x7'));var strategy=require('./strategy');config[_0xc01c('0x8')]=_[_0xc01c('0x9')](config[_0xc01c('0x8')],{'host':_0xc01c('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc01c('0x8')]));var attributes=['id','queue_id','account',_0xc01c('0xb'),_0xc01c('0xc'),_0xc01c('0xd')];function emit(_0x36bd7b,_0x3d8371,_0x38efdf){io['to'](_0x36bd7b)[_0xc01c('0xe')](_0x3d8371,_0x38efdf);}function emitChannelQueueInteraction(_0x33c537,_0x1d29fa,_0x54bd99,_0x58b11c,_0x2e6c24,_0x52cb4d,_0x3fab94,_0x4e9cb9){var _0x3f3f9f=_[_0xc01c('0xf')](_0x54bd99);_0x3f3f9f[_0xc01c('0x10')]=_0x4e9cb9;_0x3f3f9f[_0xc01c('0xb')]=_0x1d29fa;_0x3f3f9f[_0xc01c('0x11')]=_0x58b11c;_0x3f3f9f['id']=_0x2e6c24;if(_0x52cb4d){_0x3fab94[util[_0xc01c('0x12')](_0xc01c('0x13'),_0x33c537)][_0x2e6c24]=_[_0xc01c('0x14')](_0x3f3f9f,attributes);}else{delete _0x3fab94[util['format'](_0xc01c('0x13'),_0x33c537)][_0x2e6c24];}emit(util[_0xc01c('0x12')](_0xc01c('0x15'),_0x33c537,_0x1d29fa),util[_0xc01c('0x12')](_0xc01c('0x16'),_0x33c537,_0x52cb4d?'save':_0xc01c('0x17')),_[_0xc01c('0x14')](_0x3f3f9f,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xc01c('0x18')),'chatQueueReport':require(_0xc01c('0x19')),'smsQueueReport':require(_0xc01c('0x1a')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xc01c('0x1b'))};var queue=schema({'name':{'type':_0xc01c('0x1c'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xc01c('0x1d'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x7f052a,_0x375644,_0x400b44,_0x5daea6){if(_0x7f052a&&_0x375644&&_0x400b44){_0x375644['waiting']+=0x1;var _0x141899={'uniqueid':_0x7f052a,'from':_0x400b44[_0xc01c('0x1e')]?_0x400b44['body'][_0xc01c('0xc')]:'','joinAt':moment()[_0xc01c('0x12')](_0xc01c('0x1f')),'ContactId':_0x400b44[_0xc01c('0x20')]?_0x400b44[_0xc01c('0x20')]['id']:null,'ListId':_0x400b44[_0xc01c('0x21')]?_0x400b44['list']['id']:null};_0x141899[_[_0xc01c('0x22')](_0x400b44[_0xc01c('0x23')])+_0xc01c('0x24')]=_0x375644['id']||null;_0x141899[_[_0xc01c('0x22')](_0x400b44[_0xc01c('0x23')])+_0xc01c('0x25')]=_0x400b44[_0xc01c('0x26')]?_0x400b44['interaction']['id']:null;_0x141899[_[_0xc01c('0x22')](_0x400b44[_0xc01c('0x23')])+_0xc01c('0x27')]=_0x400b44[_0xc01c('0x28')]?_0x400b44['message']['id']:null;_0x141899[_['upperFirst'](_0x400b44['channel'])+(_0x400b44[_0xc01c('0x23')]!==_0xc01c('0x29')?_0xc01c('0x2a'):_0xc01c('0x2b'))]=_0x400b44[_0xc01c('0x11')]?_0x400b44[_0xc01c('0x11')]['id']:null;logger[_0xc01c('0x2c')](util[_0xc01c('0x12')](_0xc01c('0x2d'),_0x7f052a,_0x375644[_0xc01c('0x2e')]));emitChannelQueueInteraction(_0x400b44['channel'],_0x375644['name'],_0x141899,_0x400b44[_0xc01c('0x11')][_0xc01c('0x2e')],_0x400b44['message']['id'],!![],_0x5daea6,_0x375644['id']);if(rpc[_0x400b44[_0xc01c('0x23')]+_0xc01c('0x2f')]){return rpc[_0x400b44[_0xc01c('0x23')]+_0xc01c('0x2f')]['create'](_0x141899)[_0xc01c('0x30')](function(_0xcb4c26){logger['error'](_0xc01c('0x31'));});}}}function stopRouting(_0x41b0aa,_0x3d6e19,_0x7fbaa7,_0x381e8e){if(_0x41b0aa&&_0x3d6e19){_0x3d6e19[_0xc01c('0x32')]-=0x1;var _0x21229b={'leaveAt':moment()[_0xc01c('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xc01c('0x33')};logger['info'](util[_0xc01c('0x12')](_0xc01c('0x34'),_0x41b0aa,_0x3d6e19[_0xc01c('0x2e')]));emitChannelQueueInteraction(_0x7fbaa7[_0xc01c('0x23')],_0x3d6e19['name'],_0x7fbaa7[_0xc01c('0x1e')],_0x7fbaa7[_0xc01c('0x11')][_0xc01c('0x2e')],_0x7fbaa7[_0xc01c('0x28')]['id'],![],_0x381e8e,_0x3d6e19['id']);if(rpc[_0x7fbaa7[_0xc01c('0x23')]+_0xc01c('0x2f')]){return rpc[_0x7fbaa7['channel']+'QueueReport']['update'](_0x41b0aa,_0x21229b)[_0xc01c('0x30')](function(_0x29b25b){logger['error'](_0xc01c('0x35'));});}}}function endRouting(_0x1e32d0,_0x39430b,_0x72d382,_0x177e64){if(_0x1e32d0&&_0x39430b){_0x39430b[_0xc01c('0x32')]-=0x1;var _0x21fbc7={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()['format'](_0xc01c('0x1f')),'reason':'timeout'};logger['info'](util[_0xc01c('0x12')](_0xc01c('0x36'),_0x1e32d0,_0x39430b['name']));emitChannelQueueInteraction(_0x72d382['channel'],_0x39430b['name'],_0x72d382[_0xc01c('0x1e')],_0x72d382[_0xc01c('0x11')]['name'],_0x72d382[_0xc01c('0x28')]['id'],![],_0x177e64);if(rpc[_0x72d382[_0xc01c('0x23')]+_0xc01c('0x2f')]){return rpc[_0x72d382[_0xc01c('0x23')]+_0xc01c('0x2f')]['update'](_0x1e32d0,_0x21fbc7)[_0xc01c('0x30')](function(_0x4d5734){logger[_0xc01c('0x37')](_0xc01c('0x35'));});}}}function handleFindQueue(_0x5bfe44){return function(_0x10a648){return _0x10a648[_0xc01c('0x2e')][_0xc01c('0x38')]()===_0x5bfe44['toLowerCase']();};}exports[_0xc01c('0x39')]=function(_0x181e83,_0x2e1824,_0x478522,_0x4ea0f5){return function(_0x20bebe){try{var _0x493057={'name':_0x2e1824[0x0],'timeout':_0x2e1824[0x1]};var _0x2bf346=queue['validate'](_0x493057,{'typecast':!![]});if(_0x2bf346[_0xc01c('0x3a')]){logger['error'](_0xc01c('0x3b'),_0x181e83,_['map'](_0x2bf346,'message')[_0xc01c('0x3c')](',\x20'));_0x20bebe[_0xc01c('0x3d')]();}else{var _0x11cc89=_[_0xc01c('0x3e')](_0x478522[_0x4ea0f5[_0xc01c('0x23')]+_0xc01c('0x3f')],handleFindQueue(_0x493057[_0xc01c('0x2e')]));if(_0x11cc89){startRouting(_0x181e83,_0x11cc89,_0x4ea0f5,_0x478522);var _0x1d3d63=(_0x11cc89['timeout']||0xa)*0x3e8;var _0x25a871=(_0x493057[_0xc01c('0x40')]||0x14)*0x3e8;var _0x5e2143,_0x301c01;if(_0x1d3d63>_0x25a871){_0x25a871=_0x1d3d63;}var _0x2ddc3d=seqqueue[_0xc01c('0x41')](_0x1d3d63);_0x2ddc3d['id']=_0x181e83;_0x2ddc3d[_0xc01c('0x42')]=_0x1d3d63;_0x2ddc3d[_0xc01c('0x43')]=_0x25a871;_0x2ddc3d['channel']=_0x4ea0f5['channel'];_0x478522[_0xc01c('0x44')][_0x181e83]['on'](_0xc01c('0x45'),function(){logger[_0xc01c('0x2c')](_0xc01c('0x46'),_0x181e83);stopRouting(_0x181e83,_0x11cc89,_0x4ea0f5,_0x478522);clearTimeout(_0x5e2143);_0x5e2143=undefined;_0x2ddc3d[_0xc01c('0x47')](!![]);if(_0x478522[_0xc01c('0x44')][_0x181e83]){delete _0x478522[_0xc01c('0x44')][_0x181e83];}_0x20bebe[_0xc01c('0x3d')]();});_0x478522['rules'][_0x181e83]['on'](_0xc01c('0x48'),function(){if(_0x478522[_0xc01c('0x44')][_0x181e83]){delete _0x478522[_0xc01c('0x44')][_0x181e83];}});_0x5e2143=setTimeout(function(){logger['info'](_0xc01c('0x49'),_0x181e83);endRouting(_0x181e83,_0x11cc89,_0x4ea0f5,_0x478522);clearTimeout(_0x5e2143);_0x2ddc3d[_0xc01c('0x47')](!![]);_0x20bebe['next']();},_0x25a871);switch(_0x11cc89[_0xc01c('0x4a')]){case _0xc01c('0x4b'):strategy[_0xc01c('0x4b')](_0x2ddc3d,_0x11cc89,_0x478522,_0x4ea0f5);break;default:strategy[_0xc01c('0x4c')](_0x2ddc3d,_0x11cc89,_0x478522,_0x4ea0f5);}}else{logger[_0xc01c('0x37')](_0xc01c('0x4d'),_0x181e83,_0x493057[_0xc01c('0x2e')]);_0x20bebe[_0xc01c('0x3d')]();}}}catch(_0x5ba402){console[_0xc01c('0x4e')](_0x5ba402);logger[_0xc01c('0x37')](_0xc01c('0x3b'),_0x181e83,_0x5ba402[_0xc01c('0x4f')]);_0x20bebe[_0xc01c('0x3d')]();}};};
\ No newline at end of file
+var _0xd2ed=['../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','timeout\x20is\x20a\x20number','body','from','list','upperFirst','channel','interaction','MessageId','message','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','error','create\x20queue\x20report','waiting','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','update','catch','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','[%s][QUEUE]\x20%s','map','join','stop','Queues','createQueue','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','complete','next','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','./strategy','defaults','redis','localhost','socket.io-emitter','queue_id','account','queue','emit','clone','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport'];(function(_0x21143c,_0x53a570){var _0x20f6dd=function(_0x37f1ad){while(--_0x37f1ad){_0x21143c['push'](_0x21143c['shift']());}};_0x20f6dd(++_0x53a570);}(_0xd2ed,0x14d));var _0xdd2e=function(_0x366ef8,_0x1d939a){_0x366ef8=_0x366ef8-0x0;var _0x2885a9=_0xd2ed[_0x366ef8];return _0x2885a9;};'use strict';var schema=require(_0xdd2e('0x0'));var _=require(_0xdd2e('0x1'));var util=require(_0xdd2e('0x2'));var seqqueue=require(_0xdd2e('0x3'));var moment=require(_0xdd2e('0x4'));var Redis=require(_0xdd2e('0x5'));var config=require(_0xdd2e('0x6'));var logger=require(_0xdd2e('0x7'))('routing');var strategy=require(_0xdd2e('0x8'));config['redis']=_[_0xdd2e('0x9')](config[_0xdd2e('0xa')],{'host':_0xdd2e('0xb'),'port':0x18eb});var io=require(_0xdd2e('0xc'))(new Redis(config['redis']));var attributes=['id',_0xdd2e('0xd'),_0xdd2e('0xe'),_0xdd2e('0xf'),'from','joinAt'];function emit(_0x344e3f,_0x53ca03,_0x324d9a){io['to'](_0x344e3f)[_0xdd2e('0x10')](_0x53ca03,_0x324d9a);}function emitChannelQueueInteraction(_0x49bc21,_0x25f0f7,_0x4dd89b,_0x11bff3,_0x375a2b,_0x36ce5d,_0x5a3a65,_0x89bf87){var _0x45ae8f=_[_0xdd2e('0x11')](_0x4dd89b);_0x45ae8f[_0xdd2e('0xd')]=_0x89bf87;_0x45ae8f[_0xdd2e('0xf')]=_0x25f0f7;_0x45ae8f['account']=_0x11bff3;_0x45ae8f['id']=_0x375a2b;if(_0x36ce5d){_0x5a3a65[util[_0xdd2e('0x12')](_0xdd2e('0x13'),_0x49bc21)][_0x375a2b]=_[_0xdd2e('0x14')](_0x45ae8f,attributes);}else{delete _0x5a3a65[util[_0xdd2e('0x12')](_0xdd2e('0x13'),_0x49bc21)][_0x375a2b];}emit(util['format'](_0xdd2e('0x15'),_0x49bc21,_0x25f0f7),util['format']('%s_queue_waiting_interaction:%s',_0x49bc21,_0x36ce5d?_0xdd2e('0x16'):_0xdd2e('0x17')),_['pick'](_0x45ae8f,attributes));}var rpc={'openchannelQueueReport':require(_0xdd2e('0x18')),'mailQueueReport':require(_0xdd2e('0x19')),'chatQueueReport':require(_0xdd2e('0x1a')),'smsQueueReport':require(_0xdd2e('0x1b')),'faxQueueReport':require(_0xdd2e('0x1c')),'whatsappQueueReport':require(_0xdd2e('0x1d'))};var queue=schema({'name':{'type':_0xdd2e('0x1e'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0xdd2e('0x1f')}});function startRouting(_0xed4c43,_0xc28104,_0x1e8764,_0x5da37d){if(_0xed4c43&&_0xc28104&&_0x1e8764){_0xc28104['waiting']+=0x1;var _0x21a28b={'uniqueid':_0xed4c43,'from':_0x1e8764[_0xdd2e('0x20')]?_0x1e8764[_0xdd2e('0x20')][_0xdd2e('0x21')]:'','joinAt':moment()[_0xdd2e('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1e8764['contact']?_0x1e8764['contact']['id']:null,'ListId':_0x1e8764[_0xdd2e('0x22')]?_0x1e8764[_0xdd2e('0x22')]['id']:null};_0x21a28b[_[_0xdd2e('0x23')](_0x1e8764['channel'])+'QueueId']=_0xc28104['id']||null;_0x21a28b[_[_0xdd2e('0x23')](_0x1e8764[_0xdd2e('0x24')])+'InteractionId']=_0x1e8764[_0xdd2e('0x25')]?_0x1e8764[_0xdd2e('0x25')]['id']:null;_0x21a28b[_[_0xdd2e('0x23')](_0x1e8764[_0xdd2e('0x24')])+_0xdd2e('0x26')]=_0x1e8764['message']?_0x1e8764[_0xdd2e('0x27')]['id']:null;_0x21a28b[_[_0xdd2e('0x23')](_0x1e8764[_0xdd2e('0x24')])+(_0x1e8764['channel']!=='chat'?_0xdd2e('0x28'):_0xdd2e('0x29'))]=_0x1e8764[_0xdd2e('0xe')]?_0x1e8764['account']['id']:null;logger[_0xdd2e('0x2a')](util[_0xdd2e('0x12')](_0xdd2e('0x2b'),_0xed4c43,_0xc28104['name']));emitChannelQueueInteraction(_0x1e8764[_0xdd2e('0x24')],_0xc28104['name'],_0x21a28b,_0x1e8764[_0xdd2e('0xe')][_0xdd2e('0x2c')],_0x1e8764[_0xdd2e('0x27')]['id'],!![],_0x5da37d,_0xc28104['id']);if(rpc[_0x1e8764[_0xdd2e('0x24')]+_0xdd2e('0x2d')]){return rpc[_0x1e8764['channel']+_0xdd2e('0x2d')]['create'](_0x21a28b)['catch'](function(_0x445d43){logger[_0xdd2e('0x2e')](_0xdd2e('0x2f'));});}}}function stopRouting(_0x4fb364,_0x320ab9,_0x158741,_0xdef4cf){if(_0x4fb364&&_0x320ab9){_0x320ab9[_0xdd2e('0x30')]-=0x1;var _0x5a7e57={'leaveAt':moment()[_0xdd2e('0x12')](_0xdd2e('0x31')),'acceptAt':moment()[_0xdd2e('0x12')](_0xdd2e('0x31')),'reason':_0xdd2e('0x32')};logger['info'](util[_0xdd2e('0x12')](_0xdd2e('0x33'),_0x4fb364,_0x320ab9[_0xdd2e('0x2c')]));emitChannelQueueInteraction(_0x158741[_0xdd2e('0x24')],_0x320ab9[_0xdd2e('0x2c')],_0x158741[_0xdd2e('0x20')],_0x158741[_0xdd2e('0xe')]['name'],_0x158741[_0xdd2e('0x27')]['id'],![],_0xdef4cf,_0x320ab9['id']);if(rpc[_0x158741[_0xdd2e('0x24')]+'QueueReport']){return rpc[_0x158741[_0xdd2e('0x24')]+_0xdd2e('0x2d')][_0xdd2e('0x34')](_0x4fb364,_0x5a7e57)[_0xdd2e('0x35')](function(_0x405f4a){logger[_0xdd2e('0x2e')](_0xdd2e('0x36'));});}}}function endRouting(_0x589a34,_0x5e6285,_0x495a15,_0x26cca6){if(_0x589a34&&_0x5e6285){_0x5e6285[_0xdd2e('0x30')]-=0x1;var _0x412586={'leaveAt':moment()[_0xdd2e('0x12')](_0xdd2e('0x31')),'exitAt':moment()['format'](_0xdd2e('0x31')),'reason':_0xdd2e('0x37')};logger[_0xdd2e('0x2a')](util[_0xdd2e('0x12')](_0xdd2e('0x38'),_0x589a34,_0x5e6285['name']));emitChannelQueueInteraction(_0x495a15[_0xdd2e('0x24')],_0x5e6285[_0xdd2e('0x2c')],_0x495a15[_0xdd2e('0x20')],_0x495a15[_0xdd2e('0xe')][_0xdd2e('0x2c')],_0x495a15[_0xdd2e('0x27')]['id'],![],_0x26cca6);if(rpc[_0x495a15[_0xdd2e('0x24')]+_0xdd2e('0x2d')]){return rpc[_0x495a15[_0xdd2e('0x24')]+'QueueReport']['update'](_0x589a34,_0x412586)[_0xdd2e('0x35')](function(_0x619c60){logger['error'](_0xdd2e('0x36'));});}}}function handleFindQueue(_0xdcd816){return function(_0x357c38){return _0x357c38[_0xdd2e('0x2c')][_0xdd2e('0x39')]()===_0xdcd816[_0xdd2e('0x39')]();};}exports['consequence']=function(_0x238b9e,_0x24d1aa,_0x2ab2bf,_0x347870){return function(_0x3929c5){try{var _0x1eb46e={'name':_0x24d1aa[0x0],'timeout':_0x24d1aa[0x1]};var _0x47f67d=queue[_0xdd2e('0x0')](_0x1eb46e,{'typecast':!![]});if(_0x47f67d['length']){logger[_0xdd2e('0x2e')](_0xdd2e('0x3a'),_0x238b9e,_[_0xdd2e('0x3b')](_0x47f67d,'message')[_0xdd2e('0x3c')](',\x20'));_0x3929c5[_0xdd2e('0x3d')]();}else{var _0x589d3a=_['find'](_0x2ab2bf[_0x347870[_0xdd2e('0x24')]+_0xdd2e('0x3e')],handleFindQueue(_0x1eb46e[_0xdd2e('0x2c')]));if(_0x589d3a){startRouting(_0x238b9e,_0x589d3a,_0x347870,_0x2ab2bf);var _0x376b58=(_0x589d3a[_0xdd2e('0x37')]||0xa)*0x3e8;var _0x292dfa=(_0x1eb46e[_0xdd2e('0x37')]||0x14)*0x3e8;var _0x2cdae8,_0x331898;if(_0x376b58>_0x292dfa){_0x292dfa=_0x376b58;}var _0x599946=seqqueue[_0xdd2e('0x3f')](_0x376b58);_0x599946['id']=_0x238b9e;_0x599946['atimeout']=_0x376b58;_0x599946['qtimeout']=_0x292dfa;_0x599946['channel']=_0x347870[_0xdd2e('0x24')];_0x2ab2bf[_0xdd2e('0x40')][_0x238b9e]['on'](_0xdd2e('0x41'),function(){logger[_0xdd2e('0x2a')](_0xdd2e('0x42'),_0x238b9e);stopRouting(_0x238b9e,_0x589d3a,_0x347870,_0x2ab2bf);clearTimeout(_0x2cdae8);_0x2cdae8=undefined;_0x599946['close'](!![]);if(_0x2ab2bf[_0xdd2e('0x40')][_0x238b9e]){delete _0x2ab2bf[_0xdd2e('0x40')][_0x238b9e];}_0x3929c5[_0xdd2e('0x3d')]();});_0x2ab2bf[_0xdd2e('0x40')][_0x238b9e]['on'](_0xdd2e('0x43'),function(){if(_0x2ab2bf['rules'][_0x238b9e]){delete _0x2ab2bf[_0xdd2e('0x40')][_0x238b9e];}});_0x2cdae8=setTimeout(function(){logger[_0xdd2e('0x2a')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x238b9e);endRouting(_0x238b9e,_0x589d3a,_0x347870,_0x2ab2bf);clearTimeout(_0x2cdae8);_0x599946['close'](!![]);_0x3929c5[_0xdd2e('0x44')]();},_0x292dfa);switch(_0x589d3a['strategy']){case'rrmemory':strategy['rrmemory'](_0x599946,_0x589d3a,_0x2ab2bf,_0x347870);break;default:strategy['beepall'](_0x599946,_0x589d3a,_0x2ab2bf,_0x347870);}}else{logger[_0xdd2e('0x2e')](_0xdd2e('0x45'),_0x238b9e,_0x1eb46e[_0xdd2e('0x2c')]);_0x3929c5[_0xdd2e('0x3d')]();}}}catch(_0x3928b0){console[_0xdd2e('0x46')](_0x3928b0);logger[_0xdd2e('0x2e')]('[%s][QUEUE]\x20%s',_0x238b9e,_0x3928b0[_0xdd2e('0x47')]);_0x3929c5[_0xdd2e('0x3d')]();}};};
\ No newline at end of file
index bedccc1..fee962c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5df=['isNil','agents','info','routing','forcedOwnership','realtime','busy','busyQueue','writeLog','RINGING',':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','exports','lodash','./util','../../../../../config/logger','notificationId','squeue','agent','push','bind','timeout','handleTimeout','drained','handleDrained','prototype','handleRun','[%s][AGENT]\x20try\x20with\x20%s'];(function(_0x474e00,_0x35fb93){var _0x251df0=function(_0x5b5c92){while(--_0x5b5c92){_0x474e00['push'](_0x474e00['shift']());}};_0x251df0(++_0x35fb93);}(_0xd5df,0x151));var _0xfd5d=function(_0x107144,_0x14f903){_0x107144=_0x107144-0x0;var _0x9d3df2=_0xd5df[_0x107144];return _0x9d3df2;};'use strict';var _=require(_0xfd5d('0x0'));var uuid=require('uuid');var util=require(_0xfd5d('0x1'));var logger=require(_0xfd5d('0x2'))('routing');var Agent=function(_0x2b6b7c,_0x4eefed,_0x4e59ef,_0x34f8f0){this[_0xfd5d('0x3')]=uuid['v4']();this[_0xfd5d('0x4')]=_0x2b6b7c;this[_0xfd5d('0x5')]=_0x4eefed;this['realtime']=_0x4e59ef;this['routing']=_0x34f8f0;this[_0xfd5d('0x4')][_0xfd5d('0x6')](this['handleRun'][_0xfd5d('0x7')](this),this['handleTimeout'][_0xfd5d('0x7')](this));this[_0xfd5d('0x4')]['on'](_0xfd5d('0x8'),this[_0xfd5d('0x9')]['bind'](this));this[_0xfd5d('0x4')]['on'](_0xfd5d('0xa'),this[_0xfd5d('0xb')][_0xfd5d('0x7')](this));};Agent[_0xfd5d('0xc')]['push']=function(){this[_0xfd5d('0x4')]['push'](this[_0xfd5d('0xd')][_0xfd5d('0x7')](this),this[_0xfd5d('0x9')][_0xfd5d('0x7')](this));};Agent['prototype'][_0xfd5d('0xb')]=function(){this[_0xfd5d('0x9')](!![]);};Agent[_0xfd5d('0xc')][_0xfd5d('0xd')]=function(_0x33895c){logger['info'](_0xfd5d('0xe'),this[_0xfd5d('0x4')]['id'],this[_0xfd5d('0x5')]['id']);if(_[_0xfd5d('0xf')](this['realtime'][_0xfd5d('0x10')][this['agent']['id']])){logger[_0xfd5d('0x11')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this['agent']['id']);setTimeout(this[_0xfd5d('0x6')][_0xfd5d('0x7')](this),0x3e8);}else{if(this[_0xfd5d('0x12')][_0xfd5d('0x13')]||util['isAgentAvailable'](this['squeue']['id'],this[_0xfd5d('0x14')]['agents'][this[_0xfd5d('0x5')]['id']],this[_0xfd5d('0x4')]['channel'],![])){this[_0xfd5d('0x14')][_0xfd5d('0x10')][this[_0xfd5d('0x5')]['id']][_0xfd5d('0x15')]=!![];this[_0xfd5d('0x14')][_0xfd5d('0x10')][this[_0xfd5d('0x5')]['id']][_0xfd5d('0x16')]=undefined;util['showNotification'](this[_0xfd5d('0x3')],this['squeue']['id'],this[_0xfd5d('0x14')][_0xfd5d('0x10')][this['agent']['id']],null,this[_0xfd5d('0x12')]);util[_0xfd5d('0x17')](this[_0xfd5d('0x4')]['id'],this[_0xfd5d('0x14')][_0xfd5d('0x10')][this[_0xfd5d('0x5')]['id']],_0xfd5d('0x18')+(this['routing'][_0xfd5d('0x13')]?_0xfd5d('0x19'):''));}else{logger[_0xfd5d('0x11')](_0xfd5d('0x1a'),this[_0xfd5d('0x4')]['id'],this['agent']['id']);setTimeout(this['push'][_0xfd5d('0x7')](this),0x3e8);}}};Agent[_0xfd5d('0xc')][_0xfd5d('0x9')]=function(_0x4dfc2a){if(_[_0xfd5d('0xf')](this[_0xfd5d('0x14')]['agents'][this[_0xfd5d('0x5')]['id']])){return logger[_0xfd5d('0x11')](_0xfd5d('0x1b'),this['squeue']['id'],this[_0xfd5d('0x5')]['id']);}else{logger[_0xfd5d('0x11')](_0xfd5d('0x1c'),this[_0xfd5d('0x4')]['id'],this[_0xfd5d('0x5')]['id']);util[_0xfd5d('0x1d')](this[_0xfd5d('0x3')],this[_0xfd5d('0x4')]['id'],this[_0xfd5d('0x14')][_0xfd5d('0x10')][this[_0xfd5d('0x5')]['id']],null,this['routing']);this[_0xfd5d('0x14')][_0xfd5d('0x10')][this[_0xfd5d('0x5')]['id']][_0xfd5d('0x15')]=![];this[_0xfd5d('0x14')][_0xfd5d('0x10')][this[_0xfd5d('0x5')]['id']][_0xfd5d('0x16')]=undefined;util[_0xfd5d('0x17')](this[_0xfd5d('0x4')]['id'],this['realtime'][_0xfd5d('0x10')][this['agent']['id']],_0x4dfc2a?_0xfd5d('0x1e'):'TIMEOUT');}if(!_0x4dfc2a){setTimeout(this['push']['bind'](this),0x3e8);}};function agent(_0x5a185e,_0x4b3b7b,_0x14c4cd,_0x17428f){return new Agent(_0x5a185e,_0x4b3b7b,_0x14c4cd,_0x17428f);}module[_0xfd5d('0x1f')]=agent;
\ No newline at end of file
+var _0x4e3d=['isAgentAvailable','channel','busy','busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','TIMEOUT','lodash','uuid','./util','../../../../../config/logger','notificationId','squeue','routing','push','handleTimeout','bind','timeout','drained','handleDrained','prototype','handleRun','info','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','realtime','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership'];(function(_0x183b97,_0x2d297c){var _0x629cf7=function(_0x4ffd24){while(--_0x4ffd24){_0x183b97['push'](_0x183b97['shift']());}};_0x629cf7(++_0x2d297c);}(_0x4e3d,0x1a3));var _0xd4e3=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x4e3d[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xd4e3('0x0'));var uuid=require(_0xd4e3('0x1'));var util=require(_0xd4e3('0x2'));var logger=require(_0xd4e3('0x3'))('routing');var Agent=function(_0x45d603,_0x1fe13c,_0x1a11b8,_0x2c777b){this[_0xd4e3('0x4')]=uuid['v4']();this[_0xd4e3('0x5')]=_0x45d603;this['agent']=_0x1fe13c;this['realtime']=_0x1a11b8;this[_0xd4e3('0x6')]=_0x2c777b;this[_0xd4e3('0x5')][_0xd4e3('0x7')](this['handleRun']['bind'](this),this[_0xd4e3('0x8')][_0xd4e3('0x9')](this));this[_0xd4e3('0x5')]['on'](_0xd4e3('0xa'),this[_0xd4e3('0x8')][_0xd4e3('0x9')](this));this[_0xd4e3('0x5')]['on'](_0xd4e3('0xb'),this[_0xd4e3('0xc')][_0xd4e3('0x9')](this));};Agent[_0xd4e3('0xd')][_0xd4e3('0x7')]=function(){this[_0xd4e3('0x5')][_0xd4e3('0x7')](this[_0xd4e3('0xe')]['bind'](this),this[_0xd4e3('0x8')][_0xd4e3('0x9')](this));};Agent[_0xd4e3('0xd')][_0xd4e3('0xc')]=function(){this[_0xd4e3('0x8')](!![]);};Agent[_0xd4e3('0xd')][_0xd4e3('0xe')]=function(_0x2a44a4){logger[_0xd4e3('0xf')](_0xd4e3('0x10'),this[_0xd4e3('0x5')]['id'],this[_0xd4e3('0x11')]['id']);if(_[_0xd4e3('0x12')](this[_0xd4e3('0x13')][_0xd4e3('0x14')][this[_0xd4e3('0x11')]['id']])){logger[_0xd4e3('0xf')](_0xd4e3('0x15'),this[_0xd4e3('0x5')]['id'],this[_0xd4e3('0x11')]['id']);setTimeout(this[_0xd4e3('0x7')][_0xd4e3('0x9')](this),0x3e8);}else{if(this[_0xd4e3('0x6')][_0xd4e3('0x16')]||util[_0xd4e3('0x17')](this[_0xd4e3('0x5')]['id'],this[_0xd4e3('0x13')][_0xd4e3('0x14')][this['agent']['id']],this['squeue'][_0xd4e3('0x18')],![])){this[_0xd4e3('0x13')][_0xd4e3('0x14')][this[_0xd4e3('0x11')]['id']][_0xd4e3('0x19')]=!![];this[_0xd4e3('0x13')][_0xd4e3('0x14')][this[_0xd4e3('0x11')]['id']][_0xd4e3('0x1a')]=undefined;util[_0xd4e3('0x1b')](this[_0xd4e3('0x4')],this[_0xd4e3('0x5')]['id'],this[_0xd4e3('0x13')][_0xd4e3('0x14')][this['agent']['id']],null,this['routing']);util[_0xd4e3('0x1c')](this[_0xd4e3('0x5')]['id'],this[_0xd4e3('0x13')][_0xd4e3('0x14')][this[_0xd4e3('0x11')]['id']],_0xd4e3('0x1d')+(this['routing'][_0xd4e3('0x16')]?_0xd4e3('0x1e'):''));}else{logger[_0xd4e3('0xf')](_0xd4e3('0x1f'),this['squeue']['id'],this[_0xd4e3('0x11')]['id']);setTimeout(this[_0xd4e3('0x7')][_0xd4e3('0x9')](this),0x3e8);}}};Agent[_0xd4e3('0xd')][_0xd4e3('0x8')]=function(_0x2966df){if(_[_0xd4e3('0x12')](this[_0xd4e3('0x13')][_0xd4e3('0x14')][this[_0xd4e3('0x11')]['id']])){return logger[_0xd4e3('0xf')](_0xd4e3('0x15'),this['squeue']['id'],this['agent']['id']);}else{logger[_0xd4e3('0xf')](_0xd4e3('0x20'),this['squeue']['id'],this[_0xd4e3('0x11')]['id']);util['hideNotification'](this[_0xd4e3('0x4')],this[_0xd4e3('0x5')]['id'],this['realtime'][_0xd4e3('0x14')][this[_0xd4e3('0x11')]['id']],null,this['routing']);this['realtime']['agents'][this[_0xd4e3('0x11')]['id']][_0xd4e3('0x19')]=![];this[_0xd4e3('0x13')][_0xd4e3('0x14')][this[_0xd4e3('0x11')]['id']]['busyQueue']=undefined;util[_0xd4e3('0x1c')](this[_0xd4e3('0x5')]['id'],this['realtime']['agents'][this['agent']['id']],_0x2966df?'STOP':_0xd4e3('0x21'));}if(!_0x2966df){setTimeout(this[_0xd4e3('0x7')][_0xd4e3('0x9')](this),0x3e8);}};function agent(_0x47414a,_0x246d81,_0x349cd1,_0x4cfb8a){return new Agent(_0x47414a,_0x246d81,_0x349cd1,_0x4cfb8a);}module['exports']=agent;
\ No newline at end of file
index 1417f20..9400d4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbecd=['agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','writeLog','RINGING','busy','busyQueue','name','showNotification','[%s][QUEUE]\x20EMPTY','STOP','TIMEOUT','lodash','./util','../../../../../config/logger','notificationId','squeue','queue','realtime','routing','push','handleRun','bind','handleTimeout','timeout','handleDrained','prototype','isNil','Agents','length'];(function(_0x22b8a3,_0x2a79a7){var _0x199a0c=function(_0x544c66){while(--_0x544c66){_0x22b8a3['push'](_0x22b8a3['shift']());}};_0x199a0c(++_0x2a79a7);}(_0xbecd,0x6a));var _0xdbec=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xbecd[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xdbec('0x0'));var uuid=require('uuid');var util=require(_0xdbec('0x1'));var logger=require(_0xdbec('0x2'))('routing');var Beepall=function(_0x3b57d4,_0x2cf335,_0x343f68,_0x31d770){this[_0xdbec('0x3')]=uuid['v4']();this[_0xdbec('0x4')]=_0x3b57d4;this[_0xdbec('0x5')]=_0x2cf335;this[_0xdbec('0x6')]=_0x343f68;this[_0xdbec('0x7')]=_0x31d770;this[_0xdbec('0x4')][_0xdbec('0x8')](this[_0xdbec('0x9')][_0xdbec('0xa')](this),this[_0xdbec('0xb')][_0xdbec('0xa')](this));this['squeue']['on'](_0xdbec('0xc'),this['handleTimeout']['bind'](this));this['squeue']['on']('drained',this[_0xdbec('0xd')][_0xdbec('0xa')](this));};Beepall['prototype'][_0xdbec('0x8')]=function(){this[_0xdbec('0x4')][_0xdbec('0x8')](this[_0xdbec('0x9')][_0xdbec('0xa')](this),this[_0xdbec('0xb')]['bind'](this));};Beepall[_0xdbec('0xe')][_0xdbec('0xd')]=function(_0x4e068a){this[_0xdbec('0xb')](!![]);};Beepall[_0xdbec('0xe')]['handleRun']=function(_0x1c2457){var _0x557d49=!![];if(!_[_0xdbec('0xf')](this['queue'])&&!_[_0xdbec('0xf')](this['queue']['Agents'])&&this[_0xdbec('0x5')][_0xdbec('0x10')][_0xdbec('0x11')]>0x0){for(var _0x414f6f=0x0,_0x1dcdd9;_0x414f6f<this[_0xdbec('0x5')][_0xdbec('0x10')]['length'];_0x414f6f+=0x1){_0x1dcdd9=this[_0xdbec('0x5')][_0xdbec('0x10')][_0x414f6f]['id'];if(_[_0xdbec('0xf')](this[_0xdbec('0x6')][_0xdbec('0x12')][_0x1dcdd9])){logger[_0xdbec('0x13')](_0xdbec('0x14'),this['squeue']['id'],_0x1dcdd9);}else{if(util[_0xdbec('0x15')](this[_0xdbec('0x4')]['id'],this[_0xdbec('0x6')]['agents'][_0x1dcdd9],this[_0xdbec('0x4')]['channel'],!![])){_0x557d49=![];util[_0xdbec('0x16')](this[_0xdbec('0x4')]['id'],this[_0xdbec('0x6')][_0xdbec('0x12')][_0x1dcdd9],_0xdbec('0x17'));this[_0xdbec('0x6')][_0xdbec('0x12')][_0x1dcdd9][_0xdbec('0x18')]=!![];this[_0xdbec('0x6')][_0xdbec('0x12')][_0x1dcdd9][_0xdbec('0x19')]=this[_0xdbec('0x5')][_0xdbec('0x1a')];util[_0xdbec('0x1b')](this[_0xdbec('0x3')],this[_0xdbec('0x4')]['id'],this[_0xdbec('0x6')][_0xdbec('0x12')][_0x1dcdd9],this[_0xdbec('0x5')],this[_0xdbec('0x7')]);}}}if(_0x557d49){logger[_0xdbec('0x13')]('[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY',this[_0xdbec('0x4')]['id']);setTimeout(this[_0xdbec('0x8')][_0xdbec('0xa')](this),0x3e8);}}else{logger[_0xdbec('0x13')](_0xdbec('0x1c'),this[_0xdbec('0x4')]['id']);setTimeout(this['push'][_0xdbec('0xa')](this),0x3e8);}};Beepall[_0xdbec('0xe')][_0xdbec('0xb')]=function(_0x497c62){if(!_[_0xdbec('0xf')](this['queue'])&&!_[_0xdbec('0xf')](this['queue'][_0xdbec('0x10')])){for(var _0x4f73be=0x0,_0x445ce7;_0x4f73be<this[_0xdbec('0x5')][_0xdbec('0x10')]['length'];_0x4f73be+=0x1){_0x445ce7=this['queue'][_0xdbec('0x10')][_0x4f73be]['id'];if(_[_0xdbec('0xf')](this['realtime'][_0xdbec('0x12')][_0x445ce7])){logger[_0xdbec('0x13')](_0xdbec('0x14'),this[_0xdbec('0x4')]['id'],_0x445ce7);}else{util['hideNotification'](this[_0xdbec('0x3')],this['squeue']['id'],this[_0xdbec('0x6')][_0xdbec('0x12')][_0x445ce7],this[_0xdbec('0x5')],this[_0xdbec('0x7')]);util[_0xdbec('0x16')](this[_0xdbec('0x4')]['id'],this['realtime'][_0xdbec('0x12')][_0x445ce7],_0x497c62?_0xdbec('0x1d'):_0xdbec('0x1e'));this['realtime'][_0xdbec('0x12')][_0x445ce7][_0xdbec('0x18')]=![];this['realtime'][_0xdbec('0x12')][_0x445ce7]['busyQueue']=undefined;}}}if(!_0x497c62){setTimeout(this[_0xdbec('0x8')][_0xdbec('0xa')](this),0x3e8);}};function beepall(_0x1e4174,_0x2da9ec,_0x3078ab,_0x20b2fa){return new Beepall(_0x1e4174,_0x2da9ec,_0x3078ab,_0x20b2fa);}module['exports']=beepall;
\ No newline at end of file
+var _0x979e=['RINGING','busyQueue','name','[%s][QUEUE]\x20EMPTY','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','STOP','TIMEOUT','busy','exports','lodash','uuid','./util','../../../../../config/logger','notificationId','queue','routing','squeue','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','isNil','Agents','length','realtime','agents','info','isAgentAvailable','writeLog'];(function(_0x326e4d,_0x3e3e6f){var _0x19afa9=function(_0x3a00ce){while(--_0x3a00ce){_0x326e4d['push'](_0x326e4d['shift']());}};_0x19afa9(++_0x3e3e6f);}(_0x979e,0x195));var _0xe979=function(_0x4d58b4,_0x4b3a45){_0x4d58b4=_0x4d58b4-0x0;var _0x32f85f=_0x979e[_0x4d58b4];return _0x32f85f;};'use strict';var _=require(_0xe979('0x0'));var uuid=require(_0xe979('0x1'));var util=require(_0xe979('0x2'));var logger=require(_0xe979('0x3'))('routing');var Beepall=function(_0x10fb90,_0x47321a,_0x386036,_0x3b4b06){this[_0xe979('0x4')]=uuid['v4']();this['squeue']=_0x10fb90;this[_0xe979('0x5')]=_0x47321a;this['realtime']=_0x386036;this[_0xe979('0x6')]=_0x3b4b06;this[_0xe979('0x7')][_0xe979('0x8')](this[_0xe979('0x9')][_0xe979('0xa')](this),this[_0xe979('0xb')][_0xe979('0xa')](this));this[_0xe979('0x7')]['on'](_0xe979('0xc'),this[_0xe979('0xb')][_0xe979('0xa')](this));this['squeue']['on'](_0xe979('0xd'),this[_0xe979('0xe')][_0xe979('0xa')](this));};Beepall['prototype'][_0xe979('0x8')]=function(){this[_0xe979('0x7')][_0xe979('0x8')](this[_0xe979('0x9')][_0xe979('0xa')](this),this[_0xe979('0xb')][_0xe979('0xa')](this));};Beepall[_0xe979('0xf')]['handleDrained']=function(_0x3a4a0f){this[_0xe979('0xb')](!![]);};Beepall[_0xe979('0xf')]['handleRun']=function(_0x5e6079){var _0x431412=!![];if(!_[_0xe979('0x10')](this[_0xe979('0x5')])&&!_[_0xe979('0x10')](this['queue'][_0xe979('0x11')])&&this[_0xe979('0x5')][_0xe979('0x11')][_0xe979('0x12')]>0x0){for(var _0x20d50a=0x0,_0x2d6892;_0x20d50a<this[_0xe979('0x5')]['Agents'][_0xe979('0x12')];_0x20d50a+=0x1){_0x2d6892=this['queue']['Agents'][_0x20d50a]['id'];if(_[_0xe979('0x10')](this[_0xe979('0x13')][_0xe979('0x14')][_0x2d6892])){logger[_0xe979('0x15')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xe979('0x7')]['id'],_0x2d6892);}else{if(util[_0xe979('0x16')](this[_0xe979('0x7')]['id'],this[_0xe979('0x13')][_0xe979('0x14')][_0x2d6892],this[_0xe979('0x7')]['channel'],!![])){_0x431412=![];util[_0xe979('0x17')](this['squeue']['id'],this[_0xe979('0x13')][_0xe979('0x14')][_0x2d6892],_0xe979('0x18'));this['realtime'][_0xe979('0x14')][_0x2d6892]['busy']=!![];this['realtime'][_0xe979('0x14')][_0x2d6892][_0xe979('0x19')]=this['queue'][_0xe979('0x1a')];util['showNotification'](this[_0xe979('0x4')],this['squeue']['id'],this[_0xe979('0x13')][_0xe979('0x14')][_0x2d6892],this[_0xe979('0x5')],this[_0xe979('0x6')]);}}}if(_0x431412){logger[_0xe979('0x15')]('[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY',this[_0xe979('0x7')]['id']);setTimeout(this[_0xe979('0x8')][_0xe979('0xa')](this),0x3e8);}}else{logger[_0xe979('0x15')](_0xe979('0x1b'),this['squeue']['id']);setTimeout(this[_0xe979('0x8')][_0xe979('0xa')](this),0x3e8);}};Beepall[_0xe979('0xf')][_0xe979('0xb')]=function(_0x6e1b39){if(!_['isNil'](this[_0xe979('0x5')])&&!_[_0xe979('0x10')](this[_0xe979('0x5')][_0xe979('0x11')])){for(var _0xe6e59e=0x0,_0x5da8a7;_0xe6e59e<this[_0xe979('0x5')][_0xe979('0x11')]['length'];_0xe6e59e+=0x1){_0x5da8a7=this[_0xe979('0x5')]['Agents'][_0xe6e59e]['id'];if(_[_0xe979('0x10')](this[_0xe979('0x13')][_0xe979('0x14')][_0x5da8a7])){logger[_0xe979('0x15')](_0xe979('0x1c'),this['squeue']['id'],_0x5da8a7);}else{util['hideNotification'](this['notificationId'],this[_0xe979('0x7')]['id'],this[_0xe979('0x13')][_0xe979('0x14')][_0x5da8a7],this['queue'],this[_0xe979('0x6')]);util[_0xe979('0x17')](this[_0xe979('0x7')]['id'],this['realtime'][_0xe979('0x14')][_0x5da8a7],_0x6e1b39?_0xe979('0x1d'):_0xe979('0x1e'));this[_0xe979('0x13')][_0xe979('0x14')][_0x5da8a7][_0xe979('0x1f')]=![];this[_0xe979('0x13')][_0xe979('0x14')][_0x5da8a7][_0xe979('0x19')]=undefined;}}}if(!_0x6e1b39){setTimeout(this[_0xe979('0x8')][_0xe979('0xa')](this),0x3e8);}};function beepall(_0x3e56cb,_0x50ca2f,_0x4398a9,_0x73d2ca){return new Beepall(_0x3e56cb,_0x50ca2f,_0x4398a9,_0x73d2ca);}module[_0xe979('0x20')]=beepall;
\ No newline at end of file
index 23bcea6..47c8f3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf312=['./beepall','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf312,0x65));var _0x2f31=function(_0x38a4b0,_0x327540){_0x38a4b0=_0x38a4b0-0x0;var _0x37fd9d=_0xf312[_0x38a4b0];return _0x37fd9d;};'use strict';module[_0x2f31('0x0')]={'rrmemory':require('./rrmemory'),'beepall':require(_0x2f31('0x1')),'agent':require('./agent')};
\ No newline at end of file
+var _0x1b91=['./beepall','exports','./rrmemory'];(function(_0x2d6418,_0x2f0b3b){var _0x354865=function(_0x4b6339){while(--_0x4b6339){_0x2d6418['push'](_0x2d6418['shift']());}};_0x354865(++_0x2f0b3b);}(_0x1b91,0x124));var _0x11b9=function(_0x37e212,_0x292ec2){_0x37e212=_0x37e212-0x0;var _0x696062=_0x1b91[_0x37e212];return _0x696062;};'use strict';module[_0x11b9('0x0')]={'rrmemory':require(_0x11b9('0x1')),'beepall':require(_0x11b9('0x2')),'agent':require('./agent')};
\ No newline at end of file
index c84cc28..196ac0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedfe=['routing','notificationId','squeue','realtime','intervals','push','handleRun','bind','handleTimeout','module','drained','prototype','handleCheckReject','isAgentAvailable','agents','agentId','channel','info','[%s][QUEUE]\x20available\x20again\x20%s','done','queue','[%s][QUEUE]\x20try\x20with\x20%s','isNil','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','busy','name','showNotification','writeLog','RINGING','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','[%s][QUEUE]\x20timeout\x20with\x20%s','busyQueue','exports','lodash','uuid','./util','../../../../../config/logger'];(function(_0x4953da,_0x5adaca){var _0x2d3780=function(_0x458f36){while(--_0x458f36){_0x4953da['push'](_0x4953da['shift']());}};_0x2d3780(++_0x5adaca);}(_0xedfe,0x16e));var _0xeedf=function(_0x592144,_0x34603e){_0x592144=_0x592144-0x0;var _0x1a2828=_0xedfe[_0x592144];return _0x1a2828;};'use strict';var rr=require('rr');var _=require(_0xeedf('0x0'));var uuid=require(_0xeedf('0x1'));var util=require(_0xeedf('0x2'));var logger=require(_0xeedf('0x3'))(_0xeedf('0x4'));var RRMemory=function(_0x51a801,_0x298947,_0x326133,_0x545d47){this[_0xeedf('0x5')]=uuid['v4']();this[_0xeedf('0x6')]=_0x51a801;this['queue']=_0x298947;this[_0xeedf('0x7')]=_0x326133;this[_0xeedf('0x4')]=_0x545d47;this[_0xeedf('0x8')]={};this[_0xeedf('0x6')][_0xeedf('0x9')](this[_0xeedf('0xa')][_0xeedf('0xb')](this),this[_0xeedf('0xc')][_0xeedf('0xb')](this),this[_0xeedf('0xd')]);this[_0xeedf('0x6')]['on']('timeout',this[_0xeedf('0xc')][_0xeedf('0xb')](this));this[_0xeedf('0x6')]['on'](_0xeedf('0xe'),this['handleDrained'][_0xeedf('0xb')](this));};RRMemory[_0xeedf('0xf')][_0xeedf('0x9')]=function(){this[_0xeedf('0x6')][_0xeedf('0x9')](this[_0xeedf('0xa')][_0xeedf('0xb')](this),this[_0xeedf('0xc')][_0xeedf('0xb')](this));};RRMemory['prototype']['handleDrained']=function(_0x2531eb){this[_0xeedf('0xc')](!![]);};RRMemory[_0xeedf('0xf')][_0xeedf('0x10')]=function(_0x4fcd49){if(util[_0xeedf('0x11')](this[_0xeedf('0x6')]['id'],this[_0xeedf('0x7')][_0xeedf('0x12')][this[_0xeedf('0x13')]],this[_0xeedf('0x6')][_0xeedf('0x14')],!![])){logger[_0xeedf('0x15')](_0xeedf('0x16'),this[_0xeedf('0x6')]['id'],this[_0xeedf('0x13')]);clearInterval(this['intervals'][this['agentId']]);_0x4fcd49[_0xeedf('0x17')]();setTimeout(this[_0xeedf('0x9')][_0xeedf('0xb')](this),0x3e8);}};RRMemory['prototype'][_0xeedf('0xa')]=function(_0x2fd743){this['agentId']=rr(this[_0xeedf('0x18')]['mapAgentsId']);logger['info'](_0xeedf('0x19'),this[_0xeedf('0x6')]['id'],this['agentId']);if(_[_0xeedf('0x1a')](this[_0xeedf('0x7')][_0xeedf('0x12')][this[_0xeedf('0x13')]])){logger['info'](_0xeedf('0x1b'),this['squeue']['id'],this[_0xeedf('0x13')]);_0x2fd743[_0xeedf('0x17')]();setTimeout(this[_0xeedf('0x9')]['bind'](this),0x3e8);}else{if(util[_0xeedf('0x11')](this[_0xeedf('0x6')]['id'],this[_0xeedf('0x7')]['agents'][this['agentId']],this[_0xeedf('0x6')][_0xeedf('0x14')],!![])){this[_0xeedf('0x7')]['agents'][this[_0xeedf('0x13')]][_0xeedf('0x1c')]=!![];this[_0xeedf('0x7')][_0xeedf('0x12')][this['agentId']]['busyQueue']=this[_0xeedf('0x18')][_0xeedf('0x1d')];util[_0xeedf('0x1e')](this[_0xeedf('0x5')],this[_0xeedf('0x6')]['id'],this[_0xeedf('0x7')][_0xeedf('0x12')][this[_0xeedf('0x13')]],this[_0xeedf('0x18')],this['routing']);util[_0xeedf('0x1f')](this['squeue']['id'],this['realtime'][_0xeedf('0x12')][this[_0xeedf('0x13')]],_0xeedf('0x20'));this[_0xeedf('0x8')][this[_0xeedf('0x13')]]=setInterval(this[_0xeedf('0x10')][_0xeedf('0xb')](this,_0x2fd743),0x3e8);}else{logger[_0xeedf('0x15')](_0xeedf('0x21'),this[_0xeedf('0x6')]['id'],this[_0xeedf('0x13')]);_0x2fd743['done']();setTimeout(this[_0xeedf('0x9')][_0xeedf('0xb')](this),0x3e8);}}};RRMemory[_0xeedf('0xf')][_0xeedf('0xc')]=function(_0x1ee72d){logger[_0xeedf('0x15')](_0xeedf('0x22'),this[_0xeedf('0x6')]['id'],this['agentId']);if(_[_0xeedf('0x1a')](this['realtime'][_0xeedf('0x12')][this[_0xeedf('0x13')]])){logger[_0xeedf('0x15')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xeedf('0x6')]['id'],this[_0xeedf('0x13')]);}else{clearInterval(this[_0xeedf('0x8')][this[_0xeedf('0x13')]]);util['hideNotification'](this[_0xeedf('0x5')],this[_0xeedf('0x6')]['id'],this[_0xeedf('0x7')][_0xeedf('0x12')][this['agentId']],this['queue'],this[_0xeedf('0x4')]);util[_0xeedf('0x1f')](this['squeue']['id'],this[_0xeedf('0x7')]['agents'][this['agentId']],'TIMEOUT');this['realtime'][_0xeedf('0x12')][this[_0xeedf('0x13')]][_0xeedf('0x1c')]=![];this[_0xeedf('0x7')]['agents'][this[_0xeedf('0x13')]][_0xeedf('0x23')]=undefined;}if(!_0x1ee72d){setTimeout(this[_0xeedf('0x9')][_0xeedf('0xb')](this),0x3e8);}};function rrmemory(_0x37c078,_0x32a04f,_0x902ba0,_0x26313e){return new RRMemory(_0x37c078,_0x32a04f,_0x902ba0,_0x26313e);}module[_0xeedf('0x24')]=rrmemory;
\ No newline at end of file
+var _0x2559=['[%s][QUEUE]\x20try\x20with\x20%s','isNil','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','busy','name','showNotification','writeLog','RINGING','TIMEOUT','busyQueue','exports','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','queue','realtime','handleRun','bind','module','handleTimeout','drained','prototype','push','handleDrained','handleCheckReject','isAgentAvailable','agents','agentId','channel','info','[%s][QUEUE]\x20available\x20again\x20%s','intervals','done','mapAgentsId'];(function(_0x12a612,_0x2a147e){var _0x20eea8=function(_0x1745b3){while(--_0x1745b3){_0x12a612['push'](_0x12a612['shift']());}};_0x20eea8(++_0x2a147e);}(_0x2559,0x17d));var _0x9255=function(_0x3ec90c,_0x20b32c){_0x3ec90c=_0x3ec90c-0x0;var _0x2c11fb=_0x2559[_0x3ec90c];return _0x2c11fb;};'use strict';var rr=require('rr');var _=require('lodash');var uuid=require(_0x9255('0x0'));var util=require(_0x9255('0x1'));var logger=require(_0x9255('0x2'))(_0x9255('0x3'));var RRMemory=function(_0x5410b6,_0x17d4c1,_0x605a59,_0x36899c){this[_0x9255('0x4')]=uuid['v4']();this[_0x9255('0x5')]=_0x5410b6;this[_0x9255('0x6')]=_0x17d4c1;this[_0x9255('0x7')]=_0x605a59;this[_0x9255('0x3')]=_0x36899c;this['intervals']={};this[_0x9255('0x5')]['push'](this[_0x9255('0x8')]['bind'](this),this['handleTimeout'][_0x9255('0x9')](this),this[_0x9255('0xa')]);this['squeue']['on']('timeout',this[_0x9255('0xb')]['bind'](this));this[_0x9255('0x5')]['on'](_0x9255('0xc'),this['handleDrained']['bind'](this));};RRMemory[_0x9255('0xd')][_0x9255('0xe')]=function(){this[_0x9255('0x5')][_0x9255('0xe')](this[_0x9255('0x8')][_0x9255('0x9')](this),this[_0x9255('0xb')][_0x9255('0x9')](this));};RRMemory[_0x9255('0xd')][_0x9255('0xf')]=function(_0x212811){this[_0x9255('0xb')](!![]);};RRMemory['prototype'][_0x9255('0x10')]=function(_0x51832b){if(util[_0x9255('0x11')](this[_0x9255('0x5')]['id'],this[_0x9255('0x7')][_0x9255('0x12')][this[_0x9255('0x13')]],this[_0x9255('0x5')][_0x9255('0x14')],!![])){logger[_0x9255('0x15')](_0x9255('0x16'),this[_0x9255('0x5')]['id'],this[_0x9255('0x13')]);clearInterval(this[_0x9255('0x17')][this['agentId']]);_0x51832b[_0x9255('0x18')]();setTimeout(this['push'][_0x9255('0x9')](this),0x3e8);}};RRMemory[_0x9255('0xd')]['handleRun']=function(_0x432290){this[_0x9255('0x13')]=rr(this[_0x9255('0x6')][_0x9255('0x19')]);logger[_0x9255('0x15')](_0x9255('0x1a'),this[_0x9255('0x5')]['id'],this['agentId']);if(_[_0x9255('0x1b')](this[_0x9255('0x7')][_0x9255('0x12')][this[_0x9255('0x13')]])){logger[_0x9255('0x15')](_0x9255('0x1c'),this['squeue']['id'],this['agentId']);_0x432290[_0x9255('0x18')]();setTimeout(this['push']['bind'](this),0x3e8);}else{if(util[_0x9255('0x11')](this['squeue']['id'],this[_0x9255('0x7')][_0x9255('0x12')][this[_0x9255('0x13')]],this[_0x9255('0x5')][_0x9255('0x14')],!![])){this['realtime']['agents'][this['agentId']][_0x9255('0x1d')]=!![];this[_0x9255('0x7')][_0x9255('0x12')][this[_0x9255('0x13')]]['busyQueue']=this[_0x9255('0x6')][_0x9255('0x1e')];util[_0x9255('0x1f')](this['notificationId'],this[_0x9255('0x5')]['id'],this[_0x9255('0x7')]['agents'][this[_0x9255('0x13')]],this['queue'],this[_0x9255('0x3')]);util[_0x9255('0x20')](this['squeue']['id'],this['realtime'][_0x9255('0x12')][this[_0x9255('0x13')]],_0x9255('0x21'));this['intervals'][this['agentId']]=setInterval(this['handleCheckReject'][_0x9255('0x9')](this,_0x432290),0x3e8);}else{logger['info']('[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s',this[_0x9255('0x5')]['id'],this[_0x9255('0x13')]);_0x432290[_0x9255('0x18')]();setTimeout(this[_0x9255('0xe')]['bind'](this),0x3e8);}}};RRMemory[_0x9255('0xd')]['handleTimeout']=function(_0x2ef46e){logger[_0x9255('0x15')]('[%s][QUEUE]\x20timeout\x20with\x20%s',this[_0x9255('0x5')]['id'],this[_0x9255('0x13')]);if(_[_0x9255('0x1b')](this[_0x9255('0x7')][_0x9255('0x12')][this[_0x9255('0x13')]])){logger[_0x9255('0x15')](_0x9255('0x1c'),this['squeue']['id'],this[_0x9255('0x13')]);}else{clearInterval(this[_0x9255('0x17')][this[_0x9255('0x13')]]);util['hideNotification'](this[_0x9255('0x4')],this[_0x9255('0x5')]['id'],this[_0x9255('0x7')]['agents'][this[_0x9255('0x13')]],this[_0x9255('0x6')],this[_0x9255('0x3')]);util[_0x9255('0x20')](this[_0x9255('0x5')]['id'],this['realtime'][_0x9255('0x12')][this['agentId']],_0x9255('0x22'));this[_0x9255('0x7')][_0x9255('0x12')][this[_0x9255('0x13')]][_0x9255('0x1d')]=![];this[_0x9255('0x7')][_0x9255('0x12')][this[_0x9255('0x13')]][_0x9255('0x23')]=undefined;}if(!_0x2ef46e){setTimeout(this[_0x9255('0xe')][_0x9255('0x9')](this),0x3e8);}};function rrmemory(_0x1a3a24,_0x5be4e9,_0x3fd1b1,_0xf7c921){return new RRMemory(_0x1a3a24,_0x5be4e9,_0x3fd1b1,_0xf7c921);}module[_0x9255('0x24')]=rrmemory;
\ No newline at end of file
index baf1604..5011dbc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0adf=['info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','hideNotification','lodash','util','../utils','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','socket.io-emitter','emit','format','user:%s','name','user:save','split','\x20interaction','notificationSound','account','body','queue','msg','notificationTemplate','[%s][QUEUE]\x20%s','save','remove'];(function(_0x2a5341,_0x1909e8){var _0x2ed52d=function(_0x5002f5){while(--_0x5002f5){_0x2a5341['push'](_0x2a5341['shift']());}};_0x2ed52d(++_0x1909e8);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x467709,_0x1685ca){_0x467709=_0x467709-0x0;var _0x407d89=_0x0adf[_0x467709];return _0x407d89;};'use strict';var _=require(_0xf0ad('0x0'));var util=require(_0xf0ad('0x1'));var utils=require(_0xf0ad('0x2'));var Mustache=require('mustache');var Redis=require(_0xf0ad('0x3'));var config=require(_0xf0ad('0x4'));var logger=require(_0xf0ad('0x5'))(_0xf0ad('0x6'));config[_0xf0ad('0x7')]=_[_0xf0ad('0x8')](config[_0xf0ad('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xf0ad('0x9'))(new Redis(config['redis']));function emit(_0x2eca0e,_0x44cf37,_0x170574){io['to'](_0x2eca0e)[_0xf0ad('0xa')](_0x44cf37,_0x170574);}function sendNotification(_0xa9a315,_0x3bc706,_0xe65b20,_0x5bdf69,_0x2ab4eb,_0x53c81a){io['to'](util[_0xf0ad('0xb')](_0xf0ad('0xc'),_0x5bdf69[_0xf0ad('0xd')]))[_0xf0ad('0xa')](_0xf0ad('0xe'),_0x5bdf69);var _0x4f2b79=_0x53c81a||{};var _0x59b1a5=_0xe65b20[_0xf0ad('0xf')]('.');var _0x19892c={'uniqueid':_0x3bc706,'channel':_0x59b1a5[0x0],'id':_0x59b1a5[0x1],'title':_0x59b1a5[0x0]+_0xf0ad('0x10'),'interactionId':_0x59b1a5[0x2],'queue':_0x2ab4eb?_0x2ab4eb[_0xf0ad('0xd')]:null,'sound':_0x4f2b79['account'][_0xf0ad('0x11')],'shake':_0x4f2b79[_0xf0ad('0x12')]['notificationShake']};try{if(!_0x4f2b79['body']){_0x4f2b79['body']={};}if(_0x2ab4eb){_0x4f2b79[_0xf0ad('0x13')]['queue']=_0x2ab4eb;}else if(_0x4f2b79[_0xf0ad('0x13')][_0xf0ad('0x14')]){delete _0x4f2b79[_0xf0ad('0x13')][_0xf0ad('0x14')];}_0x19892c[_0xf0ad('0x15')]=utils['getMustacheRender'](_0x4f2b79[_0xf0ad('0x12')][_0xf0ad('0x16')],_0x4f2b79);}catch(_0x1b00f1){_0x19892c[_0xf0ad('0x15')]='I\x20can\x27t\x20render\x20your\x20template';logger['error'](util[_0xf0ad('0xb')](_0xf0ad('0x17'),_0x3bc706,_0x1b00f1['message']));}io['to'](util[_0xf0ad('0xb')](_0xf0ad('0xc'),_0x5bdf69[_0xf0ad('0xd')]))[_0xf0ad('0xa')](util['format']('notification:%s',_0xa9a315?_0xf0ad('0x18'):_0xf0ad('0x19')),_0x19892c);}function writeLog(_0x37b968,_0x20c5f3,_0x2ac8ba){return logger[_0xf0ad('0x1a')](util['format'](_0xf0ad('0x1b'),_0x37b968,_0x20c5f3[_0xf0ad('0xd')],_0x2ac8ba));}exports[_0xf0ad('0x1c')]=function(_0x3ece1e,_0x29d647,_0x88b47b,_0xb91769){if(_0x29d647[_0xf0ad('0x1d')]){writeLog(_0x3ece1e,_0x29d647,_0xf0ad('0x1e'));return![];}if(!_0x29d647[_0xf0ad('0x1f')]){writeLog(_0x3ece1e,_0x29d647,_0xf0ad('0x20'));return![];}if(_0x29d647[_0x88b47b+_0xf0ad('0x21')]){writeLog(_0x3ece1e,_0x29d647,_0xf0ad('0x22'));return![];}if(_0xb91769&&_0x29d647[_0xf0ad('0x23')](_0x88b47b+_0xf0ad('0x24'))&&_0x29d647['hasOwnProperty'](_0x88b47b+_0xf0ad('0x25'))){if(_0x29d647[_0x88b47b+_0xf0ad('0x24')]>0x0&&_0x29d647[_0x88b47b+_0xf0ad('0x25')]>=_0x29d647[_0x88b47b+_0xf0ad('0x24')]){writeLog(_0x3ece1e,_0x29d647,_0x88b47b[_0xf0ad('0x26')]()+_0xf0ad('0x27'));return![];}}return!![];};exports['showNotification']=function(_0x2cbe00,_0x19a32a,_0x2b62,_0x1e60b1,_0x1b6880){return sendNotification(!![],_0x2cbe00,_0x19a32a,_0x2b62,_0x1e60b1,_0x1b6880);};exports[_0xf0ad('0x28')]=function(_0x267b7a,_0x1bee71,_0x2386e8,_0x39c46c,_0x2d1b2f){return sendNotification(![],_0x267b7a,_0x1bee71,_0x2386e8,_0x39c46c,_0x2d1b2f);};exports['writeLog']=writeLog;
\ No newline at end of file
+var _0x6d11=['account','notificationSound','notificationShake','body','queue','getMustacheRender','msg','error','[%s][QUEUE]\x20%s','format','save','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','\x20MAXCAPACITY','showNotification','hideNotification','writeLog','lodash','util','../utils','ioredis','../../../../../config/logger','routing','redis','localhost','socket.io-emitter','user:%s','name','emit','user:save','split'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x6d11,0xbf));var _0x16d1=function(_0x44fae1,_0xea074f){_0x44fae1=_0x44fae1-0x0;var _0x44bf89=_0x6d11[_0x44fae1];return _0x44bf89;};'use strict';var _=require(_0x16d1('0x0'));var util=require(_0x16d1('0x1'));var utils=require(_0x16d1('0x2'));var Mustache=require('mustache');var Redis=require(_0x16d1('0x3'));var config=require('../../../../../config/environment');var logger=require(_0x16d1('0x4'))(_0x16d1('0x5'));config['redis']=_['defaults'](config[_0x16d1('0x6')],{'host':_0x16d1('0x7'),'port':0x18eb});var io=require(_0x16d1('0x8'))(new Redis(config[_0x16d1('0x6')]));function emit(_0x1009dc,_0x150217,_0x19390d){io['to'](_0x1009dc)['emit'](_0x150217,_0x19390d);}function sendNotification(_0x58a7a2,_0x4fca47,_0x3275c8,_0xcfbb15,_0xe67758,_0x5a6abb){io['to'](util['format'](_0x16d1('0x9'),_0xcfbb15[_0x16d1('0xa')]))[_0x16d1('0xb')](_0x16d1('0xc'),_0xcfbb15);var _0x28188f=_0x5a6abb||{};var _0x20edf8=_0x3275c8[_0x16d1('0xd')]('.');var _0x256252={'uniqueid':_0x4fca47,'channel':_0x20edf8[0x0],'id':_0x20edf8[0x1],'title':_0x20edf8[0x0]+'\x20interaction','interactionId':_0x20edf8[0x2],'queue':_0xe67758?_0xe67758[_0x16d1('0xa')]:null,'sound':_0x28188f[_0x16d1('0xe')][_0x16d1('0xf')],'shake':_0x28188f[_0x16d1('0xe')][_0x16d1('0x10')]};try{if(!_0x28188f['body']){_0x28188f[_0x16d1('0x11')]={};}if(_0xe67758){_0x28188f[_0x16d1('0x11')][_0x16d1('0x12')]=_0xe67758;}else if(_0x28188f[_0x16d1('0x11')][_0x16d1('0x12')]){delete _0x28188f[_0x16d1('0x11')][_0x16d1('0x12')];}_0x256252['msg']=utils[_0x16d1('0x13')](_0x28188f[_0x16d1('0xe')]['notificationTemplate'],_0x28188f);}catch(_0x5f0e91){_0x256252[_0x16d1('0x14')]='I\x20can\x27t\x20render\x20your\x20template';logger[_0x16d1('0x15')](util['format'](_0x16d1('0x16'),_0x4fca47,_0x5f0e91['message']));}io['to'](util[_0x16d1('0x17')](_0x16d1('0x9'),_0xcfbb15['name']))['emit'](util['format']('notification:%s',_0x58a7a2?_0x16d1('0x18'):'remove'),_0x256252);}function writeLog(_0x34b88f,_0x7887d5,_0x1f6add){return logger[_0x16d1('0x19')](util['format'](_0x16d1('0x1a'),_0x34b88f,_0x7887d5[_0x16d1('0xa')],_0x1f6add));}exports[_0x16d1('0x1b')]=function(_0x585ce5,_0x3fc99e,_0x8c7266,_0x17e038){if(_0x3fc99e[_0x16d1('0x1c')]){writeLog(_0x585ce5,_0x3fc99e,_0x16d1('0x1d'));return![];}if(!_0x3fc99e[_0x16d1('0x1e')]){writeLog(_0x585ce5,_0x3fc99e,_0x16d1('0x1f'));return![];}if(_0x3fc99e[_0x8c7266+_0x16d1('0x20')]){writeLog(_0x585ce5,_0x3fc99e,_0x16d1('0x21'));return![];}if(_0x17e038&&_0x3fc99e[_0x16d1('0x22')](_0x8c7266+_0x16d1('0x23'))&&_0x3fc99e[_0x16d1('0x22')](_0x8c7266+_0x16d1('0x24'))){if(_0x3fc99e[_0x8c7266+_0x16d1('0x23')]>0x0&&_0x3fc99e[_0x8c7266+_0x16d1('0x24')]>=_0x3fc99e[_0x8c7266+_0x16d1('0x23')]){writeLog(_0x585ce5,_0x3fc99e,_0x8c7266['toUpperCase']()+_0x16d1('0x25'));return![];}}return!![];};exports[_0x16d1('0x26')]=function(_0x4257f1,_0x49fc1b,_0x28837c,_0x1deb1e,_0x364bf7){return sendNotification(!![],_0x4257f1,_0x49fc1b,_0x28837c,_0x1deb1e,_0x364bf7);};exports[_0x16d1('0x27')]=function(_0x6396fc,_0x462e5b,_0x1dd574,_0x562908,_0x3dd104){return sendNotification(![],_0x6396fc,_0x462e5b,_0x1dd574,_0x562908,_0x3dd104);};exports[_0x16d1('0x28')]=writeLog;
\ No newline at end of file
index fa86c86..eb95bca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e15=['next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','body','isObject','stringify','lodash','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next'];(function(_0x268e44,_0x5509f9){var _0x3470b6=function(_0x2cc38f){while(--_0x2cc38f){_0x268e44['push'](_0x268e44['shift']());}};_0x3470b6(++_0x5509f9);}(_0x2e15,0xda));var _0x52e1=function(_0x2226c1,_0x2bed75){_0x2226c1=_0x2226c1-0x0;var _0x178716=_0x2e15[_0x2226c1];return _0x178716;};'use strict';var schema=require('validate');var sh=require('shelljs');var _=require(_0x52e1('0x0'));var utils=require('./utils');var logger=require(_0x52e1('0x1'))(_0x52e1('0x2'));var system=schema({'command':{'type':'string','required':!![],'message':_0x52e1('0x3')}});exports[_0x52e1('0x4')]=function(_0x78c8c3,_0x2e904d){return function(_0x3d21b4){try{var _0x59ea2c={'command':_0x2e904d[0x0]};var _0x4a8c8b=system['validate'](_0x59ea2c,{'typecast':!![]});if(_0x4a8c8b[_0x52e1('0x5')]){logger[_0x52e1('0x6')](_0x52e1('0x7'),_0x78c8c3,_['map'](_0x4a8c8b,_0x52e1('0x8'))[_0x52e1('0x9')](',\x20'));logger[_0x52e1('0xa')](_0x52e1('0xb'),_0x78c8c3);_0x3d21b4[_0x52e1('0xc')]();}else{var _0x4c6e96=this;var _0x25ed21=utils[_0x52e1('0xd')](_0x2e904d[0x0],this);logger[_0x52e1('0xa')](_0x52e1('0xe'),_0x78c8c3,_0x25ed21);sh[_0x52e1('0xf')](_['trim'](_0x25ed21),function(_0x4ed2c4,_0x3fed8c){logger['info'](_0x52e1('0x10'),_0x78c8c3,_0x4ed2c4);if(_0x4ed2c4==0x0){var _0x14506a=_0x3fed8c[_0x52e1('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0x52e1('0x12')](_0x2e904d[0x1])||_[_0x52e1('0x13')](_0x2e904d[0x1])){logger[_0x52e1('0xa')]('[%s][SYSTEM]\x20no\x20variable',_0x78c8c3);_0x4c6e96[_0x52e1('0x14')][_0x2e904d[0x1]]=_0x14506a;}else{logger[_0x52e1('0xa')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x78c8c3,_0x2e904d[0x1],_0x14506a);_0x4c6e96['body'][_0x2e904d[0x1]]=_0x14506a;}}_0x3d21b4['next']();});}}catch(_0x46c545){logger['error']('[%s][SYSTEM]\x20%s',_0x78c8c3,_[_0x52e1('0x15')](_0x46c545)?JSON[_0x52e1('0x16')](_0x46c545):_0x46c545);logger[_0x52e1('0xa')](_0x52e1('0xb'),_0x78c8c3);_0x3d21b4[_0x52e1('0xc')]();}};};
\ No newline at end of file
+var _0x8fe1=['shelljs','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','validate'];(function(_0x3820d3,_0x537cfc){var _0x1e9103=function(_0x3226c9){while(--_0x3226c9){_0x3820d3['push'](_0x3820d3['shift']());}};_0x1e9103(++_0x537cfc);}(_0x8fe1,0x195));var _0x18fe=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x8fe1[_0x263a74];return _0x2aa86c;};'use strict';var schema=require(_0x18fe('0x0'));var sh=require(_0x18fe('0x1'));var _=require(_0x18fe('0x2'));var utils=require(_0x18fe('0x3'));var logger=require(_0x18fe('0x4'))(_0x18fe('0x5'));var system=schema({'command':{'type':_0x18fe('0x6'),'required':!![],'message':_0x18fe('0x7')}});exports[_0x18fe('0x8')]=function(_0xa7d1d9,_0x375fa3){return function(_0x11f224){try{var _0x1add88={'command':_0x375fa3[0x0]};var _0x40ea37=system[_0x18fe('0x0')](_0x1add88,{'typecast':!![]});if(_0x40ea37[_0x18fe('0x9')]){logger[_0x18fe('0xa')](_0x18fe('0xb'),_0xa7d1d9,_[_0x18fe('0xc')](_0x40ea37,_0x18fe('0xd'))[_0x18fe('0xe')](',\x20'));logger[_0x18fe('0xf')](_0x18fe('0x10'),_0xa7d1d9);_0x11f224[_0x18fe('0x11')]();}else{var _0x230497=this;var _0x3d1ea9=utils[_0x18fe('0x12')](_0x375fa3[0x0],this);logger[_0x18fe('0xf')](_0x18fe('0x13'),_0xa7d1d9,_0x3d1ea9);sh[_0x18fe('0x14')](_[_0x18fe('0x15')](_0x3d1ea9),function(_0x13e05a,_0x2566eb){logger[_0x18fe('0xf')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0xa7d1d9,_0x13e05a);if(_0x13e05a==0x0){var _0x408ed2=_0x2566eb[_0x18fe('0x16')](/(\r\n|\n|\r)/gm,'');if(_[_0x18fe('0x17')](_0x375fa3[0x1])||_[_0x18fe('0x18')](_0x375fa3[0x1])){logger['info'](_0x18fe('0x19'),_0xa7d1d9);_0x230497['body'][_0x375fa3[0x1]]=_0x408ed2;}else{logger[_0x18fe('0xf')](_0x18fe('0x1a'),_0xa7d1d9,_0x375fa3[0x1],_0x408ed2);_0x230497['body'][_0x375fa3[0x1]]=_0x408ed2;}}_0x11f224[_0x18fe('0x11')]();});}}catch(_0x17eae7){logger[_0x18fe('0xa')](_0x18fe('0xb'),_0xa7d1d9,_[_0x18fe('0x1b')](_0x17eae7)?JSON[_0x18fe('0x1c')](_0x17eae7):_0x17eae7);logger[_0x18fe('0xf')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0xa7d1d9);_0x11f224[_0x18fe('0x11')]();}};};
\ No newline at end of file
index db18fd0..5c93cd9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf66a=['[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','channel','catch','[%s][TAG]\x20%s','stringify','finally','next','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','consequence','length','error','map','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','Interaction','interaction'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0xf66a,0x1ee));var _0xaf66=function(_0x2c242b,_0x34df41){_0x2c242b=_0x2c242b-0x0;var _0x6ef1a6=_0xf66a[_0x2c242b];return _0x6ef1a6;};'use strict';var schema=require(_0xaf66('0x0'));var _=require(_0xaf66('0x1'));var rpc={'chatInteraction':require(_0xaf66('0x2')),'openchannelInteraction':require(_0xaf66('0x3')),'smsInteraction':require(_0xaf66('0x4')),'mailInteraction':require(_0xaf66('0x5')),'faxInteraction':require(_0xaf66('0x6')),'whatsappInteraction':require(_0xaf66('0x7'))};var logger=require(_0xaf66('0x8'))(_0xaf66('0x9'));var tag=schema({'tag':{'type':_0xaf66('0xa'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xaf66('0xb')]=function(_0x48a05e,_0x895806,_0xb8abcf,_0xb6c3da){return function(_0x380263){try{var _0xbe882d={'tag':_0x895806[0x0]};var _0x51a70a=tag[_0xaf66('0x0')](_0xbe882d,{'typecast':!![]});if(_0x51a70a[_0xaf66('0xc')]){logger[_0xaf66('0xd')]('[%s][TAG]\x20%s',_0x48a05e,_[_0xaf66('0xe')](_0x51a70a,'message')['join'](',\x20'));logger[_0xaf66('0xf')](_0xaf66('0x10'),_0x48a05e);_0x380263['next']();}else{var _0x516334={'ids':[_0x895806[0x0]]};if(rpc[_0xb6c3da['channel']+_0xaf66('0x11')]){rpc[_0xb6c3da['channel']+_0xaf66('0x11')]['addTags'](_0xb6c3da[_0xaf66('0x12')]['id'],_0x516334)['then'](function(_0x5328a4){logger[_0xaf66('0xf')](_0xaf66('0x13'),_0x48a05e,_0x895806[0x1],_0xb6c3da[_0xaf66('0x14')],_0xb6c3da[_0xaf66('0x12')]['id']);})[_0xaf66('0x15')](function(_0x4789cb){logger[_0xaf66('0xd')](_0xaf66('0x16'),_0x48a05e,JSON[_0xaf66('0x17')](_0x4789cb));logger[_0xaf66('0xf')](_0xaf66('0x10'),_0x48a05e);})[_0xaf66('0x18')](function(){_0x380263[_0xaf66('0x19')]();});}}}catch(_0x54e982){logger[_0xaf66('0xd')](_0xaf66('0x16'),_0x48a05e,_[_0xaf66('0x1a')](_0x54e982)?JSON[_0xaf66('0x17')](_0x54e982):_0x54e982);logger[_0xaf66('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x48a05e);_0x380263[_0xaf66('0x19')]();}};};
\ No newline at end of file
+var _0x3832=['routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][TAG]\x20%s','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','then','interaction','catch','stringify','isObject','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger'];(function(_0x2d66ec,_0x1edc1a){var _0x30c80f=function(_0x117124){while(--_0x117124){_0x2d66ec['push'](_0x2d66ec['shift']());}};_0x30c80f(++_0x1edc1a);}(_0x3832,0x1a4));var _0x2383=function(_0x47b54c,_0x47fa60){_0x47b54c=_0x47b54c-0x0;var _0x2b2df6=_0x3832[_0x47b54c];return _0x2b2df6;};'use strict';var schema=require('validate');var _=require('lodash');var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x2383('0x0')),'mailInteraction':require(_0x2383('0x1')),'faxInteraction':require(_0x2383('0x2')),'whatsappInteraction':require(_0x2383('0x3'))};var logger=require(_0x2383('0x4'))(_0x2383('0x5'));var tag=schema({'tag':{'type':_0x2383('0x6'),'required':!![],'message':_0x2383('0x7')}});exports[_0x2383('0x8')]=function(_0x29e8b7,_0x46e548,_0x1ad7e7,_0x1ce697){return function(_0x4999b2){try{var _0x56d139={'tag':_0x46e548[0x0]};var _0xc1b191=tag[_0x2383('0x9')](_0x56d139,{'typecast':!![]});if(_0xc1b191[_0x2383('0xa')]){logger[_0x2383('0xb')](_0x2383('0xc'),_0x29e8b7,_['map'](_0xc1b191,'message')[_0x2383('0xd')](',\x20'));logger[_0x2383('0xe')](_0x2383('0xf'),_0x29e8b7);_0x4999b2[_0x2383('0x10')]();}else{var _0x58e1a1={'ids':[_0x46e548[0x0]]};if(rpc[_0x1ce697[_0x2383('0x11')]+_0x2383('0x12')]){rpc[_0x1ce697[_0x2383('0x11')]+_0x2383('0x12')][_0x2383('0x13')](_0x1ce697['interaction']['id'],_0x58e1a1)[_0x2383('0x14')](function(_0x513c2b){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x29e8b7,_0x46e548[0x1],_0x1ce697[_0x2383('0x11')],_0x1ce697[_0x2383('0x15')]['id']);})[_0x2383('0x16')](function(_0x5d0833){logger[_0x2383('0xb')](_0x2383('0xc'),_0x29e8b7,JSON[_0x2383('0x17')](_0x5d0833));logger[_0x2383('0xe')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x29e8b7);})['finally'](function(){_0x4999b2[_0x2383('0x10')]();});}}}catch(_0x352c7e){logger[_0x2383('0xb')](_0x2383('0xc'),_0x29e8b7,_[_0x2383('0x18')](_0x352c7e)?JSON['stringify'](_0x352c7e):_0x352c7e);logger[_0x2383('0xe')](_0x2383('0xf'),_0x29e8b7);_0x4999b2['next']();}};};
\ No newline at end of file
index 7cc7214..cfa634e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9cce=['next','request-promise','lodash','consequence','replace','\x20-\x20','includes','push','urlOnAnswer','?params=','urlOnRing','jsonrpc','2.0','stringify','POST','application/json-rpc','then','parse','result','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','error','isObject'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x9cce,0x16d));var _0xe9cc=function(_0x96e800,_0x11c154){_0x96e800=_0x96e800-0x0;var _0x550d9a=_0x9cce[_0x96e800];return _0x550d9a;};'use strict';var rp=require(_0xe9cc('0x0'));var logger=require('../../../../config/logger')('routing');var _=require(_0xe9cc('0x1'));var arr=[];exports[_0xe9cc('0x2')]=function(_0x11948e,_0x27f3cc){return function(_0x18cf84){var _0x2cdde8=_0x27f3cc[0xa];var _0x8dedd3=_0x27f3cc[0xb];var _0x71cd7=_0x27f3cc[0xc];var _0x9143e=_0x27f3cc[0xd];var _0x40a46e=_0x27f3cc[0xe];var _0x32a677=_0x27f3cc[0xf][_0xe9cc('0x3')](/\n/g,_0xe9cc('0x4'));var _0x3e3c5a=_0x27f3cc[0x10][_0xe9cc('0x3')](/\n/g,'\x20');if(!arr[_0xe9cc('0x5')](_0x8dedd3)){arr[_0xe9cc('0x6')](_0x8dedd3);var _0x3074b0=_0x27f3cc[0x3];var _0x63dd10=_0x27f3cc[0x4];var _0x3ab467=_0x27f3cc[0x1];var _0x29ecb9=_0x27f3cc[0x0];var _0x1acbc5={};_0x1acbc5[_0xe9cc('0x7')]=_0x27f3cc[0x8]+_0xe9cc('0x8')+_0x71cd7+'|'+_0x2cdde8+'|'+_0x9143e+'|'+_0x8dedd3+'|'+_0x40a46e;_0x1acbc5[_0xe9cc('0x9')]=_0x27f3cc[0x7]+_0xe9cc('0x8')+_0x71cd7+'|'+_0x2cdde8+'|'+_0x9143e+'|'+_0x8dedd3+'|'+_0x40a46e+'|'+_0x32a677+'|'+_0x3e3c5a;_0x1acbc5['title']=_0x27f3cc[0x9];var _0x3cd3eb={};_0x3cd3eb[_0xe9cc('0xa')]=_0xe9cc('0xb');_0x3cd3eb['method']='login';var _0x2f4961=[];_0x2f4961[_0xe9cc('0x6')](_0x27f3cc[0x2]);_0x2f4961['push'](_0x27f3cc[0x5]);_0x2f4961[_0xe9cc('0x6')](_0x27f3cc[0x6]);_0x3cd3eb['params']=_0x2f4961;_0x3cd3eb['id']=0x1;var _0x3933e2=JSON[_0xe9cc('0xc')](_0x3cd3eb);var _0x183577={'encoding':'utf8','method':_0xe9cc('0xd'),'timeout':0x2710,'url':_0x3074b0,'headers':{'Content-Type':_0xe9cc('0xe')},'body':_0x3933e2};return rp(_0x183577)[_0xe9cc('0xf')](function(_0x831145){const _0x3b0f51=JSON[_0xe9cc('0x10')](_0x831145);if(!_0x3b0f51[_0xe9cc('0x11')]['logged']){throw new Error(_0xe9cc('0x12'));}var _0x147473=_0x8dedd3;var _0x2ee302=_0xe9cc('0x13')+_0x3ab467+_0xe9cc('0x14')+_0x29ecb9+_0xe9cc('0x15')+_0x147473+'&data='+JSON[_0xe9cc('0xc')](_0x1acbc5);var _0x571930=_0x63dd10+'?'+_0x2ee302;return rp(_0x571930);})[_0xe9cc('0xf')](function(_0x4b8868){logger[_0xe9cc('0x16')](_0xe9cc('0x17'),_0x11948e,_0x4b8868);_0x18cf84[_0xe9cc('0x18')]();})['catch'](function(_0x311733){logger[_0xe9cc('0x19')]('[%s][TVOX]\x20%s',_0x11948e,_[_0xe9cc('0x1a')](_0x311733)?JSON[_0xe9cc('0xc')](_0x311733):_0x311733);_0x18cf84[_0xe9cc('0x18')]();});}else{logger[_0xe9cc('0x16')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x11948e);_0x18cf84[_0xe9cc('0x1b')]();}};};
\ No newline at end of file
+var _0xe53a=['catch','error','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','routing','lodash','consequence','\x20-\x20','includes','push','urlOnAnswer','?params=','urlOnRing','jsonrpc','2.0','method','login','params','stringify','utf8','POST','application/json-rpc','then','result','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&data=','info','stop'];(function(_0x5cc70d,_0x47209b){var _0x41e4fd=function(_0xc385c0){while(--_0xc385c0){_0x5cc70d['push'](_0x5cc70d['shift']());}};_0x41e4fd(++_0x47209b);}(_0xe53a,0x1e4));var _0xae53=function(_0x1fe191,_0x575e45){_0x1fe191=_0x1fe191-0x0;var _0x216049=_0xe53a[_0x1fe191];return _0x216049;};'use strict';var rp=require('request-promise');var logger=require('../../../../config/logger')(_0xae53('0x0'));var _=require(_0xae53('0x1'));var arr=[];exports[_0xae53('0x2')]=function(_0x27baef,_0xcc1a2e){return function(_0x4df064){var _0x35856c=_0xcc1a2e[0xa];var _0x119050=_0xcc1a2e[0xb];var _0x2a1a4e=_0xcc1a2e[0xc];var _0x36a29b=_0xcc1a2e[0xd];var _0x5d4783=_0xcc1a2e[0xe];var _0x5cde9f=_0xcc1a2e[0xf]['replace'](/\n/g,_0xae53('0x3'));var _0x1a7f7c=_0xcc1a2e[0x10]['replace'](/\n/g,'\x20');if(!arr[_0xae53('0x4')](_0x119050)){arr[_0xae53('0x5')](_0x119050);var _0x3db3f9=_0xcc1a2e[0x3];var _0x4bcb87=_0xcc1a2e[0x4];var _0x33f587=_0xcc1a2e[0x1];var _0x1ca25a=_0xcc1a2e[0x0];var _0x1784d6={};_0x1784d6[_0xae53('0x6')]=_0xcc1a2e[0x8]+_0xae53('0x7')+_0x2a1a4e+'|'+_0x35856c+'|'+_0x36a29b+'|'+_0x119050+'|'+_0x5d4783;_0x1784d6[_0xae53('0x8')]=_0xcc1a2e[0x7]+'?params='+_0x2a1a4e+'|'+_0x35856c+'|'+_0x36a29b+'|'+_0x119050+'|'+_0x5d4783+'|'+_0x5cde9f+'|'+_0x1a7f7c;_0x1784d6['title']=_0xcc1a2e[0x9];var _0x2469a0={};_0x2469a0[_0xae53('0x9')]=_0xae53('0xa');_0x2469a0[_0xae53('0xb')]=_0xae53('0xc');var _0x59c00f=[];_0x59c00f[_0xae53('0x5')](_0xcc1a2e[0x2]);_0x59c00f[_0xae53('0x5')](_0xcc1a2e[0x5]);_0x59c00f[_0xae53('0x5')](_0xcc1a2e[0x6]);_0x2469a0[_0xae53('0xd')]=_0x59c00f;_0x2469a0['id']=0x1;var _0x2edb67=JSON[_0xae53('0xe')](_0x2469a0);var _0x400709={'encoding':_0xae53('0xf'),'method':_0xae53('0x10'),'timeout':0x2710,'url':_0x3db3f9,'headers':{'Content-Type':_0xae53('0x11')},'body':_0x2edb67};return rp(_0x400709)[_0xae53('0x12')](function(_0x718ec1){const _0x3217a1=JSON['parse'](_0x718ec1);if(!_0x3217a1[_0xae53('0x13')]['logged']){throw new Error(_0xae53('0x14'));}var _0x54fb31=_0x119050;var _0x33f8e8=_0xae53('0x15')+_0x33f587+_0xae53('0x16')+_0x1ca25a+'&sessionId='+_0x54fb31+_0xae53('0x17')+JSON[_0xae53('0xe')](_0x1784d6);var _0x1cffa7=_0x4bcb87+'?'+_0x33f8e8;return rp(_0x1cffa7);})['then'](function(_0x109ceb){logger[_0xae53('0x18')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x27baef,_0x109ceb);_0x4df064[_0xae53('0x19')]();})[_0xae53('0x1a')](function(_0x1e77c4){logger[_0xae53('0x1b')]('[%s][TVOX]\x20%s',_0x27baef,_[_0xae53('0x1c')](_0x1e77c4)?JSON[_0xae53('0xe')](_0x1e77c4):_0x1e77c4);_0x4df064[_0xae53('0x19')]();});}else{logger[_0xae53('0x18')](_0xae53('0x1d'),_0x27baef);_0x4df064['next']();}};};
\ No newline at end of file
index 854847d..51ffae1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x178e13,_0x218e9b){var _0x44c996=function(_0x2583f4){while(--_0x2583f4){_0x178e13['push'](_0x178e13['shift']());}};_0x44c996(++_0x218e9b);}(_0xe706,0xa3));var _0x6e70=function(_0x4fa738,_0x2a491c){_0x4fa738=_0x4fa738-0x0;var _0x55bf55=_0xe706[_0x4fa738];return _0x55bf55;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}};
\ No newline at end of file
+var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x5779cf,_0x126be9){var _0x1b67f5=function(_0x226f9a){while(--_0x226f9a){_0x5779cf['push'](_0x5779cf['shift']());}};_0x1b67f5(++_0x126be9);}(_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
index 6ce4970..f20fa52 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e35=['Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','uuid','./applications/utils','../../../config/environment','../../../config/logger','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','interval','listen','rules','channel','message','interaction','applications','existsSync','app','.js','toLowerCase','appdata','split','mail','push','length','slice','join','dialogflowv2','amazonlex','tag','TagId','getMustacheRender','notificationTemplate','ChatWebsiteId','ContactId','body','./interval','condition','./applications/','consequence','priority','on\x20interval','intervals','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','execute','info','Applications\x20executed','stringify','matchPath','emit','complete','error','stack','routing\x20is\x20empty','agent','agents','busy','end','update','UserId','catch','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','mailQueues','waiting','openchannelQueues','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','127.0.0.1'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0x0e35,0xc2));var _0x50e3=function(_0x18e020,_0xfd5fb){_0x18e020=_0x18e020-0x0;var _0x5ad85e=_0x0e35[_0x18e020];return _0x5ad85e;};'use strict';var _=require(_0x50e3('0x0'));var util=require(_0x50e3('0x1'));var path=require(_0x50e3('0x2'));var fs=require('fs');var jayson=require(_0x50e3('0x3'));var BPromise=require(_0x50e3('0x4'));var uuid=require(_0x50e3('0x5'));var utils=require(_0x50e3('0x6'));var config=require(_0x50e3('0x7'));var logger=require(_0x50e3('0x8'))(_0x50e3('0x9'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x50e3('0xa')),'chatQueueReport':require(_0x50e3('0xb')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x50e3('0xc'))};var RuleEngine=require(_0x50e3('0xd'));function getId(_0x57bb5f,_0x48382f,_0x35c16c){return util[_0x50e3('0xe')](_0x50e3('0xf'),_0x57bb5f,_0x48382f||0x0,_0x35c16c||0x0);}function getIntervals(_0x2658d9,_0x3dbc46){var _0x1deed0=[];if(!_[_0x50e3('0x10')](_0x3dbc46[_0x50e3('0x11')])&&!_[_0x50e3('0x10')](_0x2658d9[_0x3dbc46[_0x50e3('0x11')]])&&!_[_0x50e3('0x10')](_0x2658d9[_0x3dbc46[_0x50e3('0x11')]][_0x50e3('0x12')])){_0x1deed0=_['map'](_0x2658d9[_0x3dbc46[_0x50e3('0x11')]][_0x50e3('0x12')],_0x50e3('0x13'));}else if(!_[_0x50e3('0x10')](_0x3dbc46['interval'])){_0x1deed0=[_0x3dbc46[_0x50e3('0x13')]];}return _0x1deed0;}exports[_0x50e3('0x14')]=function(_0x4b4d6f){_0x4b4d6f[_0x50e3('0x15')]={};return new BPromise(function(_0x3f7cfa,_0x4b5ed5){var _0x18f144={'Start':function(_0x107f73){var _0x5b020c=this;return new Promise(function(_0x2aff1c,_0x5f44e1){if(_0x107f73){try{var _0x411267=[];var _0x1bf9df=getId(_0x107f73[_0x50e3('0x16')],_0x107f73['message']?_0x107f73[_0x50e3('0x17')]['id']:0x0,_0x107f73[_0x50e3('0x18')]?_0x107f73[_0x50e3('0x18')]['id']:0x0);if(_0x107f73[_0x50e3('0x19')]&&_['isArray'](_0x107f73['applications'])&&_0x107f73[_0x50e3('0x19')]['length']){for(var _0x3ffe22=0x0;_0x3ffe22<_0x107f73[_0x50e3('0x19')]['length'];_0x3ffe22+=0x1){var _0x4d20b1=_0x107f73[_0x50e3('0x19')][_0x3ffe22];if(fs[_0x50e3('0x1a')](path['join'](__dirname,_0x50e3('0x19'),_0x4d20b1[_0x50e3('0x1b')]+_0x50e3('0x1c')))){var _0x1b5f81=[];switch(_0x4d20b1[_0x50e3('0x1b')][_0x50e3('0x1d')]()){case'autoreply':var _0x425efb=_0x4d20b1[_0x50e3('0x1e')][_0x50e3('0x1f')](',');if(_0x107f73[_0x50e3('0x16')]===_0x50e3('0x20')){_0x1b5f81[_0x50e3('0x21')](_0x425efb[0x0]);_0x1b5f81[_0x50e3('0x21')](_0x425efb[0x1]);_0x1b5f81[_0x50e3('0x21')](_0x425efb['slice'](0x2,_0x425efb[_0x50e3('0x22')])['join'](','));}else{_0x1b5f81[_0x50e3('0x21')](_0x425efb[0x0]);_0x1b5f81[_0x50e3('0x21')](_0x425efb[_0x50e3('0x23')](0x1,_0x425efb[_0x50e3('0x22')])[_0x50e3('0x24')](','));}break;case'dialogflow':var _0x5af9a4=_0x4d20b1[_0x50e3('0x1e')]['split'](',');_0x1b5f81[_0x50e3('0x21')](_0x5af9a4[0x0]);_0x1b5f81['push'](_0x5af9a4[0x1]);_0x1b5f81['push'](_0x5af9a4['slice'](0x2,_0x5af9a4[_0x50e3('0x22')])[_0x50e3('0x24')](','));break;case _0x50e3('0x25'):var _0x131fa2=_0x4d20b1[_0x50e3('0x1e')][_0x50e3('0x1f')](',');_0x1b5f81[_0x50e3('0x21')](_0x131fa2[0x0]);_0x1b5f81[_0x50e3('0x21')](_0x131fa2[0x1]);_0x1b5f81['push'](_0x131fa2[0x2]);_0x1b5f81[_0x50e3('0x21')](_0x131fa2[0x3]);_0x1b5f81[_0x50e3('0x21')](_0x131fa2[_0x50e3('0x23')](0x4,_0x131fa2['length'])[_0x50e3('0x24')](','));break;case _0x50e3('0x26'):var _0x412d48=_0x4d20b1['appdata'][_0x50e3('0x1f')](',');_0x1b5f81[_0x50e3('0x21')](_0x412d48[0x0]);_0x1b5f81['push'](_0x412d48[0x1]);_0x1b5f81[_0x50e3('0x21')](_0x412d48[0x2]);_0x1b5f81[_0x50e3('0x21')](_0x412d48[0x3]);_0x1b5f81[_0x50e3('0x21')](_0x412d48['slice'](0x4,_0x412d48[_0x50e3('0x22')])[_0x50e3('0x24')](','));break;case _0x50e3('0x17'):_0x1b5f81[_0x50e3('0x21')](_0x4d20b1[_0x50e3('0x1e')]);break;case _0x50e3('0x27'):_0x1b5f81['push'](_0x4d20b1[_0x50e3('0x28')]);_0x1b5f81[_0x50e3('0x21')](_0x4d20b1[_0x50e3('0x1e')]);break;case'tvox':var _0x2fa24f=utils[_0x50e3('0x29')](_0x107f73['account'][_0x50e3('0x2a')],_0x107f73);var _0x5ab382=_0x4d20b1[_0x50e3('0x1e')]['split'](',');_0x1b5f81[_0x50e3('0x21')](_0x5ab382[0x0]);_0x1b5f81['push'](_0x5ab382[0x1]);_0x1b5f81[_0x50e3('0x21')](_0x5ab382[0x2]);_0x1b5f81['push'](_0x5ab382[0x3]);_0x1b5f81['push'](_0x5ab382[0x4]);_0x1b5f81[_0x50e3('0x21')](_0x5ab382[0x5]);_0x1b5f81['push'](_0x5ab382[0x6]);_0x1b5f81[_0x50e3('0x21')](_0x5ab382[0x7]);_0x1b5f81[_0x50e3('0x21')](_0x5ab382[0x8]);_0x1b5f81[_0x50e3('0x21')](_0x5ab382[0x9]);_0x1b5f81[_0x50e3('0x21')](_0x5ab382[0xa]);_0x1b5f81[_0x50e3('0x21')](_0x107f73[_0x50e3('0x18')]['id']);_0x1b5f81[_0x50e3('0x21')](_0x107f73[_0x50e3('0x17')]['id']);_0x1b5f81['push'](_0x4d20b1[_0x50e3('0x2b')]);_0x1b5f81[_0x50e3('0x21')](_0x107f73['interaction'][_0x50e3('0x2c')]);_0x1b5f81[_0x50e3('0x21')](_0x107f73['body'][_0x50e3('0x2d')]);_0x1b5f81[_0x50e3('0x21')](_0x2fa24f);break;default:_0x1b5f81=_[_0x50e3('0x10')](_0x4d20b1[_0x50e3('0x1e')])?[]:_0x4d20b1['appdata']['split'](',');}var _0x17c823={'id':util['format']('%s:%s:%s',_0x1bf9df,_0x4d20b1['id'],_0x4d20b1[_0x50e3('0x1b')]),'condition':require(_0x50e3('0x2e'))[_0x50e3('0x2f')](_0x1bf9df,getIntervals(_0x4b4d6f['intervals'],_0x4d20b1),_0x4b4d6f),'consequence':require(_0x50e3('0x30')+_0x4d20b1[_0x50e3('0x1b')])[_0x50e3('0x31')](_0x1bf9df,_0x1b5f81,_0x4b4d6f,_0x107f73),'p':_0x4d20b1[_0x50e3('0x32')]||0x0};logger['info']('Push\x20new\x20rule',_0x17c823['id'],_0x50e3('0x33'),getIntervals(_0x4b4d6f[_0x50e3('0x34')],_0x4d20b1)[_0x50e3('0x24')](_0x50e3('0x35')));_0x411267['push'](_0x17c823);}else{logger['error'](_0x50e3('0x36'),path[_0x50e3('0x24')](__dirname,_0x50e3('0x19'),_0x4d20b1[_0x50e3('0x1b')]+_0x50e3('0x1c')));}}_0x4b4d6f[_0x50e3('0x15')][_0x1bf9df]=new RuleEngine(_0x411267);_0x4b4d6f[_0x50e3('0x15')][_0x1bf9df][_0x50e3('0x37')](_0x107f73,function(_0x39258c){logger[_0x50e3('0x38')](_0x50e3('0x39'),JSON[_0x50e3('0x3a')](_0x39258c[_0x50e3('0x3b')]));if(_0x4b4d6f['rules'][_0x1bf9df]){_0x4b4d6f[_0x50e3('0x15')][_0x1bf9df][_0x50e3('0x3c')](_0x50e3('0x3d'));}});return _0x2aff1c({'code':0xc8,'message':_0x107f73});}else{logger[_0x50e3('0x38')]('No\x20applications\x20to\x20execute');return _0x2aff1c({'code':0xc8,'message':_0x107f73});}}catch(_0x30f1fa){logger[_0x50e3('0x3e')](_0x30f1fa[_0x50e3('0x3f')]);return _0x5f44e1(_0x5b020c['error'](0x1f4,_0x30f1fa));}}return _0x5f44e1(_0x50e3('0x40'));});},'AcceptMessage':function(_0x1a4a3c){var _0x4f45a7=this;return new Promise(function(_0x1e893b,_0x45af86){if(_0x1a4a3c[_0x50e3('0x41')]&&_0x1a4a3c[_0x50e3('0x41')]['id']){if(_0x4b4d6f[_0x50e3('0x42')][_0x1a4a3c[_0x50e3('0x41')]['id']]){_0x4b4d6f[_0x50e3('0x42')][_0x1a4a3c[_0x50e3('0x41')]['id']][_0x50e3('0x43')]=![];_0x4b4d6f[_0x50e3('0x42')][_0x1a4a3c[_0x50e3('0x41')]['id']]['busyQueue']=undefined;}}if(_0x1a4a3c[_0x50e3('0x17')]&&_0x1a4a3c[_0x50e3('0x17')]['id']){try{var _0x366dba=getId(_0x1a4a3c[_0x50e3('0x16')],_0x1a4a3c[_0x50e3('0x17')]?_0x1a4a3c[_0x50e3('0x17')]['id']:0x0,_0x1a4a3c[_0x50e3('0x18')]?_0x1a4a3c[_0x50e3('0x18')]['id']:0x0);if(_0x4b4d6f[_0x50e3('0x15')][_0x366dba]){_0x4b4d6f[_0x50e3('0x15')][_0x366dba]['emit'](_0x50e3('0x44'));if(rpc[_0x1a4a3c[_0x50e3('0x16')]+'QueueReport']){rpc[_0x1a4a3c[_0x50e3('0x16')]+'QueueReport'][_0x50e3('0x45')](_0x366dba,{'UserId':_0x1a4a3c[_0x50e3('0x17')][_0x50e3('0x46')]})[_0x50e3('0x47')](function(_0x6a14cf){logger['error']('error\x20update\x20queue\x20report');});}}return _0x1e893b({'code':0xc8,'message':_0x1a4a3c});}catch(_0xacbb90){logger[_0x50e3('0x3e')](_0xacbb90['stack']);return _0x45af86(_0x4f45a7[_0x50e3('0x3e')](0x1f4,_0xacbb90));}}logger[_0x50e3('0x3e')](_0x50e3('0x48'));return _0x45af86(_0x4f45a7[_0x50e3('0x3e')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x16decd){var _0x551327=this;return new Promise(function(_0x402cee,_0x58a81a){if(_0x16decd[_0x50e3('0x41')]&&_0x16decd[_0x50e3('0x41')]['id']){try{if(_0x4b4d6f[_0x50e3('0x42')][_0x16decd[_0x50e3('0x41')]['id']]){_0x4b4d6f[_0x50e3('0x42')][_0x16decd[_0x50e3('0x41')]['id']][_0x50e3('0x43')]=![];_0x4b4d6f[_0x50e3('0x42')][_0x16decd['agent']['id']]['busyQueue']=undefined;}return _0x402cee({'code':0xc8,'message':_0x16decd});}catch(_0x8d075){logger['error'](_0x8d075[_0x50e3('0x3f')]);return _0x58a81a(_0x551327[_0x50e3('0x3e')](0x1f4,_0x8d075));}}logger[_0x50e3('0x3e')]('message\x20is\x20empty');return _0x58a81a(_0x551327[_0x50e3('0x3e')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x5174c0){var _0x5421fe=this;return new Promise(function(_0x21721d,_0x30a08f){if(_0x5174c0[_0x50e3('0x16')]&&_0x5174c0['interaction']&&_0x5174c0[_0x50e3('0x18')]['id']){try{var _0x4f956f=getId(_0x5174c0['channel'],_0x5174c0[_0x50e3('0x17')]?_0x5174c0[_0x50e3('0x17')]['id']:0x0,_0x5174c0['interaction']?_0x5174c0[_0x50e3('0x18')]['id']:0x0);if(_0x4b4d6f[_0x50e3('0x15')][_0x4f956f]){_0x4b4d6f[_0x50e3('0x15')][_0x4f956f][_0x50e3('0x3c')](_0x50e3('0x44'));}return _0x21721d({'code':0xc8,'message':_0x5174c0});}catch(_0xc17f69){logger[_0x50e3('0x3e')](_0xc17f69[_0x50e3('0x3f')]);return _0x30a08f(_0x5421fe[_0x50e3('0x3e')](0x1f4,_0xc17f69));}}logger[_0x50e3('0x3e')](_0x50e3('0x48'));return _0x30a08f(_0x5421fe[_0x50e3('0x3e')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x10ad46){var _0x5090b8=this;return new Promise(function(_0xe812,_0x113800){if(_0x4b4d6f['agents'][_0x50e3('0x49')](_0x10ad46['id'])){for(var _0x4636c1 in _0x10ad46[_0x50e3('0x4a')]){if(_0x10ad46[_0x50e3('0x4a')][_0x50e3('0x49')](_0x4636c1)){if(_0x4b4d6f[_0x50e3('0x42')][_0x10ad46['id']][_0x50e3('0x49')](_0x4636c1+_0x50e3('0x4b'))){_0x4b4d6f[_0x50e3('0x42')][_0x10ad46['id']][_0x4636c1+_0x50e3('0x4b')]=parseInt(_0x10ad46['capacity'][_0x4636c1],0xa);}}}_0x4b4d6f['agents'][_0x10ad46['id']][_0x50e3('0x4c')]();return _0xe812({'code':0xc8,'message':_0x4b4d6f[_0x50e3('0x42')][_0x10ad46['id']]});}else{return _0x113800(_0x5090b8[_0x50e3('0x3e')](0x1f4,_0x50e3('0x4d')));}});},'Agents':function(_0x401233){return new Promise(function(_0x525c37,_0x216476){var _0x24f965=_[_0x50e3('0x4e')](_0x4b4d6f[_0x50e3('0x42')]);_0x525c37({'count':_0x24f965[_0x50e3('0x22')],'rows':_0x24f965});});},'ChatQueues':function(_0x440621){return new Promise(function(_0xa64a00,_0x23b92f){var _0x1f08f8=[];for(var _0x5ccde5 in _0x4b4d6f[_0x50e3('0x4f')]){if(_0x4b4d6f['chatQueues']['hasOwnProperty'](_0x5ccde5)){var _0x1ae555=_0x4b4d6f[_0x50e3('0x4f')][_0x5ccde5];var _0x3a3a83={'id':_0x1ae555['id'],'available':_0x1ae555[_0x50e3('0x50')],'loggedIn':_0x1ae555[_0x50e3('0x51')],'name':_0x1ae555[_0x50e3('0x52')],'paused':_0x1ae555[_0x50e3('0x53')],'waiting':_0x1ae555['waiting']};_0x1f08f8[_0x50e3('0x21')](_0x3a3a83);}}_0xa64a00({'count':_0x1f08f8[_0x50e3('0x22')],'rows':_0x1f08f8});});},'MailQueues':function(_0x418133){return new Promise(function(_0x23ea71,_0x1f2920){var _0x22b865=[];for(var _0x48f3cd in _0x4b4d6f['mailQueues']){if(_0x4b4d6f[_0x50e3('0x54')]['hasOwnProperty'](_0x48f3cd)){var _0x3bff80=_0x4b4d6f[_0x50e3('0x54')][_0x48f3cd];var _0x5ad3a8={'id':_0x3bff80['id'],'available':_0x3bff80[_0x50e3('0x50')],'loggedIn':_0x3bff80[_0x50e3('0x51')],'name':_0x3bff80['name'],'paused':_0x3bff80[_0x50e3('0x53')],'waiting':_0x3bff80[_0x50e3('0x55')]};_0x22b865['push'](_0x5ad3a8);}}_0x23ea71({'count':_0x22b865[_0x50e3('0x22')],'rows':_0x22b865});});},'OpenchannelQueues':function(_0x47d559){return new Promise(function(_0x3b22a0,_0x176e65){var _0x401623=[];for(var _0x7188c1 in _0x4b4d6f['openchannelQueues']){if(_0x4b4d6f['openchannelQueues']['hasOwnProperty'](_0x7188c1)){var _0xce5f5f=_0x4b4d6f[_0x50e3('0x56')][_0x7188c1];var _0xb88c41={'id':_0xce5f5f['id'],'available':_0xce5f5f['available'],'loggedIn':_0xce5f5f[_0x50e3('0x51')],'name':_0xce5f5f['name'],'paused':_0xce5f5f['paused'],'waiting':_0xce5f5f[_0x50e3('0x55')]};_0x401623[_0x50e3('0x21')](_0xb88c41);}}_0x3b22a0({'count':_0x401623[_0x50e3('0x22')],'rows':_0x401623});});},'SmsQueues':function(_0x166643){return new Promise(function(_0x581587,_0x17712e){var _0x85c465=[];for(var _0x3a2a74 in _0x4b4d6f[_0x50e3('0x57')]){if(_0x4b4d6f[_0x50e3('0x57')][_0x50e3('0x49')](_0x3a2a74)){var _0x454853=_0x4b4d6f['smsQueues'][_0x3a2a74];var _0x3db59f={'id':_0x454853['id'],'available':_0x454853[_0x50e3('0x50')],'loggedIn':_0x454853['loggedIn'],'name':_0x454853[_0x50e3('0x52')],'paused':_0x454853[_0x50e3('0x53')],'waiting':_0x454853[_0x50e3('0x55')]};_0x85c465['push'](_0x3db59f);}}_0x581587({'count':_0x85c465[_0x50e3('0x22')],'rows':_0x85c465});});},'FaxQueues':function(_0x5aa1e8){return new Promise(function(_0x5d4db3,_0x47fd9c){var _0x98b346=[];for(var _0x31689f in _0x4b4d6f['faxQueues']){if(_0x4b4d6f[_0x50e3('0x58')][_0x50e3('0x49')](_0x31689f)){var _0x52a15e=_0x4b4d6f['faxQueues'][_0x31689f];var _0x5aa137={'id':_0x52a15e['id'],'available':_0x52a15e[_0x50e3('0x50')],'loggedIn':_0x52a15e[_0x50e3('0x51')],'name':_0x52a15e['name'],'paused':_0x52a15e[_0x50e3('0x53')],'waiting':_0x52a15e[_0x50e3('0x55')]};_0x98b346[_0x50e3('0x21')](_0x5aa137);}}_0x5d4db3({'count':_0x98b346[_0x50e3('0x22')],'rows':_0x98b346});});},'WhatsappQueues':function(_0x5cbbb6){return new Promise(function(_0x58a3c3,_0x2be0a3){var _0x4ddad9=[];for(var _0x30c3b6 in _0x4b4d6f[_0x50e3('0x59')]){if(_0x4b4d6f[_0x50e3('0x59')][_0x50e3('0x49')](_0x30c3b6)){var _0x199dcd=_0x4b4d6f[_0x50e3('0x59')][_0x30c3b6];var _0x30186c={'id':_0x199dcd['id'],'available':_0x199dcd['available'],'loggedIn':_0x199dcd['loggedIn'],'name':_0x199dcd[_0x50e3('0x52')],'paused':_0x199dcd[_0x50e3('0x53')],'waiting':_0x199dcd[_0x50e3('0x55')]};_0x4ddad9[_0x50e3('0x21')](_0x30186c);}}_0x58a3c3({'count':_0x4ddad9[_0x50e3('0x22')],'rows':_0x4ddad9});});},'ChatQueuesWaitingInteractions':function(_0x57d8d4){return new Promise(function(_0x40c204,_0xb53c62){var _0x440791=_['values'](_0x4b4d6f['chatQueuesWaitingInteractions']);_0x40c204({'count':_0x440791[_0x50e3('0x22')],'rows':_0x440791});});},'MailQueuesWaitingInteractions':function(_0x388591){return new Promise(function(_0x4b115f,_0x3e1b6f){var _0x33420c=_[_0x50e3('0x4e')](_0x4b4d6f[_0x50e3('0x5a')]);_0x4b115f({'count':_0x33420c[_0x50e3('0x22')],'rows':_0x33420c});});},'OpenchannelQueuesWaitingInteractions':function(_0x106102){return new Promise(function(_0x4caf37,_0x30808e){var _0xc49309=_[_0x50e3('0x4e')](_0x4b4d6f['openchannelQueuesWaitingInteractions']);_0x4caf37({'count':_0xc49309['length'],'rows':_0xc49309});});},'SmsQueuesWaitingInteractions':function(_0x38dbad){return new Promise(function(_0x23c4e0,_0x254c2d){var _0xe18604=_[_0x50e3('0x4e')](_0x4b4d6f[_0x50e3('0x5b')]);_0x23c4e0({'count':_0xe18604[_0x50e3('0x22')],'rows':_0xe18604});});},'FaxQueuesWaitingInteractions':function(_0x532a70){return new Promise(function(_0x5c7181,_0x1bdc6d){var _0x5a28b5=_[_0x50e3('0x4e')](_0x4b4d6f['faxQueuesWaitingInteractions']);_0x5c7181({'count':_0x5a28b5[_0x50e3('0x22')],'rows':_0x5a28b5});});},'WhatsappQueuesWaitingInteractions':function(_0x595fc3){return new Promise(function(_0x4a20d2,_0x24cbef){var _0x4cdbcc=_['values'](_0x4b4d6f[_0x50e3('0x5c')]);_0x4a20d2({'count':_0x4cdbcc[_0x50e3('0x22')],'rows':_0x4cdbcc});});}};var _0x1a2d96=jayson['server'](_0x18f144)['http']();_0x1a2d96['on'](_0x50e3('0x3e'),function(_0x476341){logger[_0x50e3('0x3e')](JSON['stringify'](_0x476341));return _0x4b5ed5(_0x476341);});_0x1a2d96[_0x50e3('0x14')](0x232c,_0x50e3('0x5d'),function(){console['log'](_0x50e3('0x5e'),0x232c);return _0x3f7cfa(_0x50e3('0x5f')+0x232c);});});};
\ No newline at end of file
+var _0x515d=['slice','dialogflow','split','dialogflowv2','tag','TagId','tvox','account','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','info','on\x20interval','error','Please\x20create\x20a\x20new\x20file\x20under','Applications\x20executed','stringify','emit','complete','stack','routing\x20is\x20empty','agent','agents','busyQueue','end','QueueReport','update','UserId','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','values','chatQueues','available','name','paused','waiting','mailQueues','loggedIn','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','path','jayson/promise','bluebird','uuid','./applications/utils','../../../config/environment','../../../config/logger','../rpc/openchannelQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','isNil','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','join','app','.js','toLowerCase','autoreply','appdata','mail','push'];(function(_0x3951be,_0x33957e){var _0x429d5a=function(_0x394d56){while(--_0x394d56){_0x3951be['push'](_0x3951be['shift']());}};_0x429d5a(++_0x33957e);}(_0x515d,0x104));var _0xd515=function(_0x51612f,_0x2225f3){_0x51612f=_0x51612f-0x0;var _0xacfd46=_0x515d[_0x51612f];return _0xacfd46;};'use strict';var _=require('lodash');var util=require(_0xd515('0x0'));var path=require(_0xd515('0x1'));var fs=require('fs');var jayson=require(_0xd515('0x2'));var BPromise=require(_0xd515('0x3'));var uuid=require(_0xd515('0x4'));var utils=require(_0xd515('0x5'));var config=require(_0xd515('0x6'));var logger=require(_0xd515('0x7'))('routing');var rpc={'openchannelQueueReport':require(_0xd515('0x8')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0xd515('0x9')),'faxQueueReport':require(_0xd515('0xa')),'whatsappQueueReport':require(_0xd515('0xb'))};var RuleEngine=require(_0xd515('0xc'));function getId(_0x2ec6e2,_0x55a0da,_0x31d6b6){return util[_0xd515('0xd')](_0xd515('0xe'),_0x2ec6e2,_0x55a0da||0x0,_0x31d6b6||0x0);}function getIntervals(_0x423156,_0x21d6ce){var _0x1a33c1=[];if(!_['isNil'](_0x21d6ce[_0xd515('0xf')])&&!_[_0xd515('0x10')](_0x423156[_0x21d6ce[_0xd515('0xf')]])&&!_[_0xd515('0x10')](_0x423156[_0x21d6ce['IntervalId']][_0xd515('0x11')])){_0x1a33c1=_[_0xd515('0x12')](_0x423156[_0x21d6ce[_0xd515('0xf')]][_0xd515('0x11')],_0xd515('0x13'));}else if(!_[_0xd515('0x10')](_0x21d6ce[_0xd515('0x13')])){_0x1a33c1=[_0x21d6ce[_0xd515('0x13')]];}return _0x1a33c1;}exports[_0xd515('0x14')]=function(_0x43384b){_0x43384b[_0xd515('0x15')]={};return new BPromise(function(_0x1fb097,_0x335a97){var _0x589d04={'Start':function(_0x274550){var _0xc41eca=this;return new Promise(function(_0xc8fbf,_0x21662e){if(_0x274550){try{var _0x41333e=[];var _0x33dbb6=getId(_0x274550[_0xd515('0x16')],_0x274550[_0xd515('0x17')]?_0x274550[_0xd515('0x17')]['id']:0x0,_0x274550[_0xd515('0x18')]?_0x274550['interaction']['id']:0x0);if(_0x274550[_0xd515('0x19')]&&_[_0xd515('0x1a')](_0x274550[_0xd515('0x19')])&&_0x274550[_0xd515('0x19')][_0xd515('0x1b')]){for(var _0x2dc458=0x0;_0x2dc458<_0x274550[_0xd515('0x19')][_0xd515('0x1b')];_0x2dc458+=0x1){var _0x4d191=_0x274550['applications'][_0x2dc458];if(fs[_0xd515('0x1c')](path[_0xd515('0x1d')](__dirname,'applications',_0x4d191[_0xd515('0x1e')]+_0xd515('0x1f')))){var _0x2b2ed5=[];switch(_0x4d191['app'][_0xd515('0x20')]()){case _0xd515('0x21'):var _0x988992=_0x4d191[_0xd515('0x22')]['split'](',');if(_0x274550[_0xd515('0x16')]===_0xd515('0x23')){_0x2b2ed5[_0xd515('0x24')](_0x988992[0x0]);_0x2b2ed5[_0xd515('0x24')](_0x988992[0x1]);_0x2b2ed5[_0xd515('0x24')](_0x988992[_0xd515('0x25')](0x2,_0x988992[_0xd515('0x1b')])[_0xd515('0x1d')](','));}else{_0x2b2ed5[_0xd515('0x24')](_0x988992[0x0]);_0x2b2ed5['push'](_0x988992['slice'](0x1,_0x988992[_0xd515('0x1b')])[_0xd515('0x1d')](','));}break;case _0xd515('0x26'):var _0x3105b4=_0x4d191[_0xd515('0x22')][_0xd515('0x27')](',');_0x2b2ed5[_0xd515('0x24')](_0x3105b4[0x0]);_0x2b2ed5[_0xd515('0x24')](_0x3105b4[0x1]);_0x2b2ed5['push'](_0x3105b4[_0xd515('0x25')](0x2,_0x3105b4[_0xd515('0x1b')])[_0xd515('0x1d')](','));break;case _0xd515('0x28'):var _0x1f10ff=_0x4d191[_0xd515('0x22')][_0xd515('0x27')](',');_0x2b2ed5['push'](_0x1f10ff[0x0]);_0x2b2ed5['push'](_0x1f10ff[0x1]);_0x2b2ed5['push'](_0x1f10ff[0x2]);_0x2b2ed5[_0xd515('0x24')](_0x1f10ff[0x3]);_0x2b2ed5[_0xd515('0x24')](_0x1f10ff[_0xd515('0x25')](0x4,_0x1f10ff['length'])['join'](','));break;case'amazonlex':var _0x3192fe=_0x4d191[_0xd515('0x22')][_0xd515('0x27')](',');_0x2b2ed5[_0xd515('0x24')](_0x3192fe[0x0]);_0x2b2ed5[_0xd515('0x24')](_0x3192fe[0x1]);_0x2b2ed5['push'](_0x3192fe[0x2]);_0x2b2ed5[_0xd515('0x24')](_0x3192fe[0x3]);_0x2b2ed5['push'](_0x3192fe[_0xd515('0x25')](0x4,_0x3192fe[_0xd515('0x1b')])[_0xd515('0x1d')](','));break;case _0xd515('0x17'):_0x2b2ed5[_0xd515('0x24')](_0x4d191[_0xd515('0x22')]);break;case _0xd515('0x29'):_0x2b2ed5['push'](_0x4d191[_0xd515('0x2a')]);_0x2b2ed5[_0xd515('0x24')](_0x4d191[_0xd515('0x22')]);break;case _0xd515('0x2b'):var _0x25dc50=utils['getMustacheRender'](_0x274550[_0xd515('0x2c')]['notificationTemplate'],_0x274550);var _0x4489b5=_0x4d191[_0xd515('0x22')][_0xd515('0x27')](',');_0x2b2ed5[_0xd515('0x24')](_0x4489b5[0x0]);_0x2b2ed5[_0xd515('0x24')](_0x4489b5[0x1]);_0x2b2ed5[_0xd515('0x24')](_0x4489b5[0x2]);_0x2b2ed5[_0xd515('0x24')](_0x4489b5[0x3]);_0x2b2ed5[_0xd515('0x24')](_0x4489b5[0x4]);_0x2b2ed5[_0xd515('0x24')](_0x4489b5[0x5]);_0x2b2ed5[_0xd515('0x24')](_0x4489b5[0x6]);_0x2b2ed5[_0xd515('0x24')](_0x4489b5[0x7]);_0x2b2ed5[_0xd515('0x24')](_0x4489b5[0x8]);_0x2b2ed5['push'](_0x4489b5[0x9]);_0x2b2ed5[_0xd515('0x24')](_0x4489b5[0xa]);_0x2b2ed5[_0xd515('0x24')](_0x274550[_0xd515('0x18')]['id']);_0x2b2ed5['push'](_0x274550[_0xd515('0x17')]['id']);_0x2b2ed5['push'](_0x4d191['ChatWebsiteId']);_0x2b2ed5['push'](_0x274550['interaction'][_0xd515('0x2d')]);_0x2b2ed5[_0xd515('0x24')](_0x274550['body'][_0xd515('0x2e')]);_0x2b2ed5['push'](_0x25dc50);break;default:_0x2b2ed5=_['isNil'](_0x4d191[_0xd515('0x22')])?[]:_0x4d191['appdata']['split'](',');}var _0x2c2def={'id':util[_0xd515('0xd')](_0xd515('0x2f'),_0x33dbb6,_0x4d191['id'],_0x4d191[_0xd515('0x1e')]),'condition':require(_0xd515('0x30'))[_0xd515('0x31')](_0x33dbb6,getIntervals(_0x43384b[_0xd515('0x32')],_0x4d191),_0x43384b),'consequence':require(_0xd515('0x33')+_0x4d191['app'])[_0xd515('0x34')](_0x33dbb6,_0x2b2ed5,_0x43384b,_0x274550),'p':_0x4d191[_0xd515('0x35')]||0x0};logger[_0xd515('0x36')]('Push\x20new\x20rule',_0x2c2def['id'],_0xd515('0x37'),getIntervals(_0x43384b[_0xd515('0x32')],_0x4d191)[_0xd515('0x1d')]('\x20|\x20'));_0x41333e['push'](_0x2c2def);}else{logger[_0xd515('0x38')](_0xd515('0x39'),path[_0xd515('0x1d')](__dirname,_0xd515('0x19'),_0x4d191[_0xd515('0x1e')]+_0xd515('0x1f')));}}_0x43384b[_0xd515('0x15')][_0x33dbb6]=new RuleEngine(_0x41333e);_0x43384b['rules'][_0x33dbb6]['execute'](_0x274550,function(_0x5cfff0){logger[_0xd515('0x36')](_0xd515('0x3a'),JSON[_0xd515('0x3b')](_0x5cfff0['matchPath']));if(_0x43384b[_0xd515('0x15')][_0x33dbb6]){_0x43384b[_0xd515('0x15')][_0x33dbb6][_0xd515('0x3c')](_0xd515('0x3d'));}});return _0xc8fbf({'code':0xc8,'message':_0x274550});}else{logger[_0xd515('0x36')]('No\x20applications\x20to\x20execute');return _0xc8fbf({'code':0xc8,'message':_0x274550});}}catch(_0x2f365c){logger[_0xd515('0x38')](_0x2f365c[_0xd515('0x3e')]);return _0x21662e(_0xc41eca[_0xd515('0x38')](0x1f4,_0x2f365c));}}return _0x21662e(_0xd515('0x3f'));});},'AcceptMessage':function(_0xf7b6a3){var _0x5050be=this;return new Promise(function(_0x37b2e5,_0x5dc59e){if(_0xf7b6a3[_0xd515('0x40')]&&_0xf7b6a3[_0xd515('0x40')]['id']){if(_0x43384b[_0xd515('0x41')][_0xf7b6a3['agent']['id']]){_0x43384b[_0xd515('0x41')][_0xf7b6a3[_0xd515('0x40')]['id']]['busy']=![];_0x43384b[_0xd515('0x41')][_0xf7b6a3[_0xd515('0x40')]['id']][_0xd515('0x42')]=undefined;}}if(_0xf7b6a3['message']&&_0xf7b6a3[_0xd515('0x17')]['id']){try{var _0x5c9075=getId(_0xf7b6a3[_0xd515('0x16')],_0xf7b6a3[_0xd515('0x17')]?_0xf7b6a3[_0xd515('0x17')]['id']:0x0,_0xf7b6a3['interaction']?_0xf7b6a3[_0xd515('0x18')]['id']:0x0);if(_0x43384b['rules'][_0x5c9075]){_0x43384b[_0xd515('0x15')][_0x5c9075][_0xd515('0x3c')](_0xd515('0x43'));if(rpc[_0xf7b6a3[_0xd515('0x16')]+'QueueReport']){rpc[_0xf7b6a3['channel']+_0xd515('0x44')][_0xd515('0x45')](_0x5c9075,{'UserId':_0xf7b6a3[_0xd515('0x17')][_0xd515('0x46')]})['catch'](function(_0x560bb8){logger[_0xd515('0x38')]('error\x20update\x20queue\x20report');});}}return _0x37b2e5({'code':0xc8,'message':_0xf7b6a3});}catch(_0x393a14){logger['error'](_0x393a14[_0xd515('0x3e')]);return _0x5dc59e(_0x5050be[_0xd515('0x38')](0x1f4,_0x393a14));}}logger[_0xd515('0x38')](_0xd515('0x47'));return _0x5dc59e(_0x5050be['error'](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x3d450d){var _0xcefd1d=this;return new Promise(function(_0x4b218c,_0xb1a212){if(_0x3d450d[_0xd515('0x40')]&&_0x3d450d[_0xd515('0x40')]['id']){try{if(_0x43384b[_0xd515('0x41')][_0x3d450d[_0xd515('0x40')]['id']]){_0x43384b[_0xd515('0x41')][_0x3d450d['agent']['id']]['busy']=![];_0x43384b[_0xd515('0x41')][_0x3d450d[_0xd515('0x40')]['id']][_0xd515('0x42')]=undefined;}return _0x4b218c({'code':0xc8,'message':_0x3d450d});}catch(_0x5d32e7){logger[_0xd515('0x38')](_0x5d32e7[_0xd515('0x3e')]);return _0xb1a212(_0xcefd1d['error'](0x1f4,_0x5d32e7));}}logger[_0xd515('0x38')](_0xd515('0x47'));return _0xb1a212(_0xcefd1d['error'](0x1f4,_0xd515('0x47')));});},'AbandonInteraction':function(_0x202e57){var _0x3c3958=this;return new Promise(function(_0x20f509,_0x2c9d0a){if(_0x202e57[_0xd515('0x16')]&&_0x202e57['interaction']&&_0x202e57[_0xd515('0x18')]['id']){try{var _0x53ae07=getId(_0x202e57[_0xd515('0x16')],_0x202e57[_0xd515('0x17')]?_0x202e57[_0xd515('0x17')]['id']:0x0,_0x202e57['interaction']?_0x202e57[_0xd515('0x18')]['id']:0x0);if(_0x43384b[_0xd515('0x15')][_0x53ae07]){_0x43384b[_0xd515('0x15')][_0x53ae07][_0xd515('0x3c')](_0xd515('0x43'));}return _0x20f509({'code':0xc8,'message':_0x202e57});}catch(_0x21ffed){logger[_0xd515('0x38')](_0x21ffed[_0xd515('0x3e')]);return _0x2c9d0a(_0x3c3958[_0xd515('0x38')](0x1f4,_0x21ffed));}}logger[_0xd515('0x38')](_0xd515('0x47'));return _0x2c9d0a(_0x3c3958[_0xd515('0x38')](0x1f4,_0xd515('0x47')));});},'AgentCapacity':function(_0x241ecb){var _0x123284=this;return new Promise(function(_0x908fbe,_0x3beee3){if(_0x43384b[_0xd515('0x41')][_0xd515('0x48')](_0x241ecb['id'])){for(var _0xf4429a in _0x241ecb[_0xd515('0x49')]){if(_0x241ecb[_0xd515('0x49')][_0xd515('0x48')](_0xf4429a)){if(_0x43384b[_0xd515('0x41')][_0x241ecb['id']][_0xd515('0x48')](_0xf4429a+_0xd515('0x4a'))){_0x43384b[_0xd515('0x41')][_0x241ecb['id']][_0xf4429a+'CurrentCapacity']=parseInt(_0x241ecb[_0xd515('0x49')][_0xf4429a],0xa);}}}_0x43384b[_0xd515('0x41')][_0x241ecb['id']]['updateRealtime']();return _0x908fbe({'code':0xc8,'message':_0x43384b[_0xd515('0x41')][_0x241ecb['id']]});}else{return _0x3beee3(_0x123284[_0xd515('0x38')](0x1f4,_0xd515('0x4b')));}});},'Agents':function(_0x16248d){return new Promise(function(_0x5ee852,_0x563d05){var _0x1fb7bc=_[_0xd515('0x4c')](_0x43384b[_0xd515('0x41')]);_0x5ee852({'count':_0x1fb7bc['length'],'rows':_0x1fb7bc});});},'ChatQueues':function(_0x35eda8){return new Promise(function(_0x80ac4a,_0x1d0116){var _0x17476a=[];for(var _0x20fae4 in _0x43384b[_0xd515('0x4d')]){if(_0x43384b[_0xd515('0x4d')]['hasOwnProperty'](_0x20fae4)){var _0x154f54=_0x43384b[_0xd515('0x4d')][_0x20fae4];var _0x2cd132={'id':_0x154f54['id'],'available':_0x154f54[_0xd515('0x4e')],'loggedIn':_0x154f54['loggedIn'],'name':_0x154f54[_0xd515('0x4f')],'paused':_0x154f54[_0xd515('0x50')],'waiting':_0x154f54[_0xd515('0x51')]};_0x17476a[_0xd515('0x24')](_0x2cd132);}}_0x80ac4a({'count':_0x17476a[_0xd515('0x1b')],'rows':_0x17476a});});},'MailQueues':function(_0x3ee0ff){return new Promise(function(_0x55302b,_0x2d9bbb){var _0x40e6e4=[];for(var _0x397d5e in _0x43384b[_0xd515('0x52')]){if(_0x43384b[_0xd515('0x52')][_0xd515('0x48')](_0x397d5e)){var _0x32e70c=_0x43384b['mailQueues'][_0x397d5e];var _0x50d56a={'id':_0x32e70c['id'],'available':_0x32e70c[_0xd515('0x4e')],'loggedIn':_0x32e70c[_0xd515('0x53')],'name':_0x32e70c['name'],'paused':_0x32e70c[_0xd515('0x50')],'waiting':_0x32e70c[_0xd515('0x51')]};_0x40e6e4[_0xd515('0x24')](_0x50d56a);}}_0x55302b({'count':_0x40e6e4[_0xd515('0x1b')],'rows':_0x40e6e4});});},'OpenchannelQueues':function(_0x2af946){return new Promise(function(_0x1e1e45,_0x14576c){var _0x545778=[];for(var _0x304513 in _0x43384b[_0xd515('0x54')]){if(_0x43384b['openchannelQueues'][_0xd515('0x48')](_0x304513)){var _0x2d4f14=_0x43384b[_0xd515('0x54')][_0x304513];var _0x577224={'id':_0x2d4f14['id'],'available':_0x2d4f14[_0xd515('0x4e')],'loggedIn':_0x2d4f14[_0xd515('0x53')],'name':_0x2d4f14[_0xd515('0x4f')],'paused':_0x2d4f14['paused'],'waiting':_0x2d4f14[_0xd515('0x51')]};_0x545778[_0xd515('0x24')](_0x577224);}}_0x1e1e45({'count':_0x545778[_0xd515('0x1b')],'rows':_0x545778});});},'SmsQueues':function(_0x452ac9){return new Promise(function(_0x30de81,_0x37280c){var _0x2fbabf=[];for(var _0x58a6bf in _0x43384b[_0xd515('0x55')]){if(_0x43384b[_0xd515('0x55')]['hasOwnProperty'](_0x58a6bf)){var _0x304fa0=_0x43384b['smsQueues'][_0x58a6bf];var _0x1136c9={'id':_0x304fa0['id'],'available':_0x304fa0[_0xd515('0x4e')],'loggedIn':_0x304fa0[_0xd515('0x53')],'name':_0x304fa0[_0xd515('0x4f')],'paused':_0x304fa0[_0xd515('0x50')],'waiting':_0x304fa0[_0xd515('0x51')]};_0x2fbabf['push'](_0x1136c9);}}_0x30de81({'count':_0x2fbabf['length'],'rows':_0x2fbabf});});},'FaxQueues':function(_0x494f45){return new Promise(function(_0x152dd4,_0x515fa0){var _0x558f86=[];for(var _0x1aab26 in _0x43384b[_0xd515('0x56')]){if(_0x43384b[_0xd515('0x56')][_0xd515('0x48')](_0x1aab26)){var _0x23da79=_0x43384b[_0xd515('0x56')][_0x1aab26];var _0x48872d={'id':_0x23da79['id'],'available':_0x23da79[_0xd515('0x4e')],'loggedIn':_0x23da79[_0xd515('0x53')],'name':_0x23da79['name'],'paused':_0x23da79[_0xd515('0x50')],'waiting':_0x23da79[_0xd515('0x51')]};_0x558f86['push'](_0x48872d);}}_0x152dd4({'count':_0x558f86[_0xd515('0x1b')],'rows':_0x558f86});});},'WhatsappQueues':function(_0x14be62){return new Promise(function(_0x58cef1,_0x3612bd){var _0x3927bd=[];for(var _0xa1c0c0 in _0x43384b[_0xd515('0x57')]){if(_0x43384b[_0xd515('0x57')][_0xd515('0x48')](_0xa1c0c0)){var _0x402828=_0x43384b[_0xd515('0x57')][_0xa1c0c0];var _0x1ba2d6={'id':_0x402828['id'],'available':_0x402828['available'],'loggedIn':_0x402828[_0xd515('0x53')],'name':_0x402828['name'],'paused':_0x402828[_0xd515('0x50')],'waiting':_0x402828['waiting']};_0x3927bd['push'](_0x1ba2d6);}}_0x58cef1({'count':_0x3927bd['length'],'rows':_0x3927bd});});},'ChatQueuesWaitingInteractions':function(_0x21882c){return new Promise(function(_0x1b7f59,_0x3db53e){var _0x2254c2=_['values'](_0x43384b[_0xd515('0x58')]);_0x1b7f59({'count':_0x2254c2[_0xd515('0x1b')],'rows':_0x2254c2});});},'MailQueuesWaitingInteractions':function(_0x30ab15){return new Promise(function(_0x218c22,_0x41f776){var _0x35656e=_[_0xd515('0x4c')](_0x43384b[_0xd515('0x59')]);_0x218c22({'count':_0x35656e[_0xd515('0x1b')],'rows':_0x35656e});});},'OpenchannelQueuesWaitingInteractions':function(_0x25b7e0){return new Promise(function(_0x5edf58,_0x181700){var _0x15f890=_['values'](_0x43384b[_0xd515('0x5a')]);_0x5edf58({'count':_0x15f890['length'],'rows':_0x15f890});});},'SmsQueuesWaitingInteractions':function(_0x16b810){return new Promise(function(_0x48a0ba,_0x1a4d41){var _0xfac79a=_[_0xd515('0x4c')](_0x43384b[_0xd515('0x5b')]);_0x48a0ba({'count':_0xfac79a[_0xd515('0x1b')],'rows':_0xfac79a});});},'FaxQueuesWaitingInteractions':function(_0x4f0c0d){return new Promise(function(_0x33a573,_0x1e4d7c){var _0x2e359f=_[_0xd515('0x4c')](_0x43384b[_0xd515('0x5c')]);_0x33a573({'count':_0x2e359f[_0xd515('0x1b')],'rows':_0x2e359f});});},'WhatsappQueuesWaitingInteractions':function(_0xd2b786){return new Promise(function(_0x5a263b,_0x1d33e6){var _0x2b78a4=_['values'](_0x43384b[_0xd515('0x5d')]);_0x5a263b({'count':_0x2b78a4[_0xd515('0x1b')],'rows':_0x2b78a4});});}};var _0x22fa69=jayson[_0xd515('0x5e')](_0x589d04)[_0xd515('0x5f')]();_0x22fa69['on'](_0xd515('0x38'),function(_0x3681c8){logger[_0xd515('0x38')](JSON[_0xd515('0x3b')](_0x3681c8));return _0x335a97(_0x3681c8);});_0x22fa69[_0xd515('0x14')](0x232c,'127.0.0.1',function(){console[_0xd515('0x60')](_0xd515('0x61'),0x232c);return _0x1fb097(_0xd515('0x62')+0x232c);});});};
\ No newline at end of file
index b35f420..c5f6ad1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x336e=['util','jayson/promise','../../../config/logger','routing','client','request','then','error','message','result','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','iftime\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','when','catch','log','\x20|\x20','stack'];(function(_0x20e818,_0x27caee){var _0x10c67d=function(_0x47b77e){while(--_0x47b77e){_0x20e818['push'](_0x20e818['shift']());}};_0x10c67d(++_0x27caee);}(_0x336e,0x129));var _0xe336=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x336e[_0x344a3f];return _0x264712;};'use strict';var util=require(_0xe336('0x0'));var BPromise=require('bluebird');var jayson=require(_0xe336('0x1'));var _=require('lodash');var logger=require(_0xe336('0x2'))(_0xe336('0x3'));var client=jayson[_0xe336('0x4')]['http']({'port':0x232a});function request(_0x404bfc,_0x53a6b0){return new BPromise(function(_0x19ad7f,_0x5c3139){return client[_0xe336('0x5')](_0x404bfc,_0x53a6b0)[_0xe336('0x6')](function(_0x199c1e){if(_0x199c1e[_0xe336('0x7')]){return _0x5c3139(_0x199c1e[_0xe336('0x7')][_0xe336('0x8')]);}else{return _0x19ad7f(_0x199c1e[_0xe336('0x9')]);}})['catch'](function(_0x310a21){return _0x5c3139(_0x310a21);});});}exports['condition']=function(_0x2ff757,_0x29673d,_0x4d26e0){return function(_0x20287a){if(_0x4d26e0[_0xe336('0xa')]&&!_0x4d26e0[_0xe336('0xa')][_0x2ff757]){logger[_0xe336('0xb')](_0xe336('0xc'),_0x2ff757);return _0x20287a[_0xe336('0xd')]();}var _0x59253e=[];for(var _0x210f66=0x0;_0x210f66<_0x29673d[_0xe336('0xe')];_0x210f66+=0x1){_0x59253e[_0xe336('0xf')](request(_0xe336('0x10'),{'command':util['format'](_0xe336('0x11'),_0x29673d[_0x210f66])})[_0xe336('0x6')](function(_0x5646e0){return _0x5646e0&&_0x5646e0[_0xe336('0x8')]&&_0x5646e0[_0xe336('0x8')]['indexOf']('true')>=0x0?!![]:![];})['catch'](function(_0x1c1128){logger[_0xe336('0x7')]('[%s][INTERVAL]\x20%s',_0x2ff757,_0x29673d[_0x210f66]);}));}BPromise[_0xe336('0x12')](_0x59253e)[_0xe336('0x6')](function(_0x72e18c){var _0x2ebd65=_[_0xe336('0x13')](_0x72e18c);logger[_0xe336('0xb')](_0xe336('0x14'),_0x2ff757,_0x29673d[_0xe336('0x15')]('\x20|\x20'),_0x2ebd65);_0x20287a[_0xe336('0x16')](_0x2ebd65);})[_0xe336('0x17')](function(_0x43e2dd){console[_0xe336('0x18')](_0x43e2dd);logger[_0xe336('0x7')](_0xe336('0x14'),_0x2ff757,_0x29673d['join'](_0xe336('0x19')),_0x43e2dd[_0xe336('0x1a')]);_0x20287a['stop']();});};};
\ No newline at end of file
+var _0xedd2=['join','\x20|\x20','when','log','stack','bluebird','jayson/promise','lodash','../../../config/logger','routing','http','request','then','error','message','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','Command','iftime\x20%s','true','[%s][INTERVAL]\x20%s','some','[%s][INTERVAL]\x20%s\x20%s'];(function(_0x562faa,_0x23adc7){var _0xc70f59=function(_0x2d7dec){while(--_0x2d7dec){_0x562faa['push'](_0x562faa['shift']());}};_0xc70f59(++_0x23adc7);}(_0xedd2,0xb3));var _0x2edd=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xedd2[_0x4b055c];return _0x4b62bb;};'use strict';var util=require('util');var BPromise=require(_0x2edd('0x0'));var jayson=require(_0x2edd('0x1'));var _=require(_0x2edd('0x2'));var logger=require(_0x2edd('0x3'))(_0x2edd('0x4'));var client=jayson['client'][_0x2edd('0x5')]({'port':0x232a});function request(_0x344529,_0x4040f6){return new BPromise(function(_0x3ed2fd,_0x31e79b){return client[_0x2edd('0x6')](_0x344529,_0x4040f6)[_0x2edd('0x7')](function(_0x4ce69f){if(_0x4ce69f[_0x2edd('0x8')]){return _0x31e79b(_0x4ce69f[_0x2edd('0x8')][_0x2edd('0x9')]);}else{return _0x3ed2fd(_0x4ce69f[_0x2edd('0xa')]);}})[_0x2edd('0xb')](function(_0x358783){return _0x31e79b(_0x358783);});});}exports[_0x2edd('0xc')]=function(_0x3aea24,_0x47ff17,_0xbdce3d){return function(_0x4cb6ca){if(_0xbdce3d[_0x2edd('0xd')]&&!_0xbdce3d[_0x2edd('0xd')][_0x3aea24]){logger[_0x2edd('0xe')](_0x2edd('0xf'),_0x3aea24);return _0x4cb6ca[_0x2edd('0x10')]();}var _0x45fe3b=[];for(var _0x2f1093=0x0;_0x2f1093<_0x47ff17[_0x2edd('0x11')];_0x2f1093+=0x1){_0x45fe3b['push'](request(_0x2edd('0x12'),{'command':util['format'](_0x2edd('0x13'),_0x47ff17[_0x2f1093])})[_0x2edd('0x7')](function(_0x4cea75){return _0x4cea75&&_0x4cea75[_0x2edd('0x9')]&&_0x4cea75['message']['indexOf'](_0x2edd('0x14'))>=0x0?!![]:![];})[_0x2edd('0xb')](function(_0x4b3760){logger[_0x2edd('0x8')](_0x2edd('0x15'),_0x3aea24,_0x47ff17[_0x2f1093]);}));}BPromise['all'](_0x45fe3b)[_0x2edd('0x7')](function(_0x5463b4){var _0x562ece=_[_0x2edd('0x16')](_0x5463b4);logger[_0x2edd('0xe')](_0x2edd('0x17'),_0x3aea24,_0x47ff17[_0x2edd('0x18')](_0x2edd('0x19')),_0x562ece);_0x4cb6ca[_0x2edd('0x1a')](_0x562ece);})['catch'](function(_0x579a53){console[_0x2edd('0x1b')](_0x579a53);logger[_0x2edd('0x8')]('[%s][INTERVAL]\x20%s\x20%s',_0x3aea24,_0x47ff17[_0x2edd('0x18')](_0x2edd('0x19')),_0x579a53[_0x2edd('0x1c')]);_0x4cb6ca[_0x2edd('0x10')]();});};};
\ No newline at end of file
index 2d509bf..59404c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e6c=['agentconnectAt','complete','blindtransfer','transfereruniqueid','transfer','transferexten','extension','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfertype','ATTENDED','transfereeuniqueid','agententerreason','clone','calleridnum','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','cause','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','[%s][agents][hangup]','lodash','util','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','membername','interface','connectedlinenum','lastevent','getVoiceQueueByName','queue','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','uniqueid','agentcalledAt','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','format','agentringnoanswer','[%s][agents][agentringnoanswer]','info','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','now','timeout','holdtime','ringtime','talktime','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentconnect]','isNil','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime'];(function(_0x34d6cb,_0x1ae55c){var _0x4372cb=function(_0x1a073a){while(--_0x1a073a){_0x34d6cb['push'](_0x34d6cb['shift']());}};_0x4372cb(++_0x1ae55c);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6e6c[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xc6e6('0x0'));var util=require(_0xc6e6('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x370b21,_0x1b63fe){utils['info'](util['format'](_0xc6e6('0x2'),_0x370b21['uniqueid'],_0x370b21[_0xc6e6('0x3')],_0x370b21['queue'],_0x370b21[_0xc6e6('0x4')],_0x370b21[_0xc6e6('0x5')],_0x370b21['calleridnum'],_0x370b21[_0xc6e6('0x6')],_0x370b21[_0xc6e6('0x7')]));if(_0x370b21['queue']){utils[_0xc6e6('0x8')](_0x370b21[_0xc6e6('0x9')])['then'](function(_0x324f05){if(_0x324f05){_0x370b21['type']=_0x324f05[_0xc6e6('0xa')];_0x370b21[_0xc6e6('0xb')]=_0x370b21[_0xc6e6('0xc')]?_0x324f05[_0xc6e6('0xd')]:![];_0x370b21[_0xc6e6('0xe')]=_0x370b21[_0xc6e6('0xb')]?_0x324f05[_0xc6e6('0xf')]:0x0;}utils[_0xc6e6('0x10')](_0xc6e6('0x11'),_0x370b21);});}else{utils['request'](_0xc6e6('0x11'),_0x370b21);}if(_0x1b63fe){delete transfers[_0x370b21['uniqueid']];}else{delete agents[_0x370b21[_0xc6e6('0x12')]];}}exports[_0xc6e6('0x13')]=function(_0x33aea0){try{utils[_0xc6e6('0x14')](util['format'](_0xc6e6('0x15'),_0x33aea0[_0xc6e6('0x16')]),_0x33aea0);agents[_0x33aea0[_0xc6e6('0x12')]]=_0x33aea0;agents[_0x33aea0[_0xc6e6('0x12')]][_0xc6e6('0x17')]=utils['now']();agents[_0x33aea0[_0xc6e6('0x12')]][_0xc6e6('0x7')]='called';agents[_0x33aea0[_0xc6e6('0x12')]][_0xc6e6('0x6')]=null;agents[_0x33aea0[_0xc6e6('0x12')]]['connectedlinename']=null;utils['info'](util['format'](_0xc6e6('0x18'),_0x33aea0['uniqueid'],agents[_0x33aea0[_0xc6e6('0x12')]][_0xc6e6('0x4')],_0x33aea0[_0xc6e6('0x12')]));}catch(_0x41afe6){utils[_0xc6e6('0x19')](util[_0xc6e6('0x1a')](_0xc6e6('0x15'),_0x33aea0[_0xc6e6('0x16')]),_0x41afe6);}};exports[_0xc6e6('0x1b')]=function(_0x3d734d){try{if(!_['isNil'](agents[_0x3d734d[_0xc6e6('0x12')]])){utils['debug'](util[_0xc6e6('0x1a')](_0xc6e6('0x1c'),_0x3d734d[_0xc6e6('0x16')]),_0x3d734d);utils[_0xc6e6('0x1d')](util['format'](_0xc6e6('0x1e'),_0x3d734d[_0xc6e6('0x16')],agents[_0x3d734d[_0xc6e6('0x12')]][_0xc6e6('0x4')],_0x3d734d[_0xc6e6('0x12')]));agents[_0x3d734d['destuniqueid']][_0xc6e6('0x1b')]=!![];agents[_0x3d734d['destuniqueid']][_0xc6e6('0x1f')]=utils[_0xc6e6('0x20')]();agents[_0x3d734d[_0xc6e6('0x12')]][_0xc6e6('0x7')]='timeout';agents[_0x3d734d[_0xc6e6('0x12')]]['reason']=_0xc6e6('0x21');agents[_0x3d734d['destuniqueid']][_0xc6e6('0x22')]=_0x3d734d[_0xc6e6('0x23')]?parseInt(_0x3d734d[_0xc6e6('0x23')])/0x3e8:0x0;agents[_0x3d734d[_0xc6e6('0x12')]][_0xc6e6('0x24')]=0x0;unanswered['push'](_0x3d734d[_0xc6e6('0x12')]);}}catch(_0x1501bd){utils[_0xc6e6('0x19')](util[_0xc6e6('0x1a')]('[%s][agents][agentringnoanswer]',_0x3d734d[_0xc6e6('0x16')]),_0x1501bd);}};exports['queuecallerabandon']=function(_0x29411c){try{_[_0xc6e6('0x25')](agents,function(_0x12c616,_0xc578b3){if(_0x12c616[_0xc6e6('0x16')]==_0x29411c[_0xc6e6('0x16')]&&!_[_0xc6e6('0x26')](unanswered,_0x12c616[_0xc6e6('0x12')])){utils[_0xc6e6('0x14')](util[_0xc6e6('0x1a')](_0xc6e6('0x27'),_0x29411c[_0xc6e6('0x16')]),_0x29411c);utils[_0xc6e6('0x1d')](util[_0xc6e6('0x1a')](_0xc6e6('0x28'),_0x29411c[_0xc6e6('0x16')],_0x12c616[_0xc6e6('0x4')],_0x12c616['destuniqueid']));_0x12c616[_0xc6e6('0x1b')]=!![];_0x12c616[_0xc6e6('0x1f')]=utils['now']();_0x12c616['lastevent']=_0xc6e6('0x29');_0x12c616[_0xc6e6('0x2a')]=_0xc6e6('0x29');_0x12c616[_0xc6e6('0x22')]=_0x29411c[_0xc6e6('0x22')];_0x12c616[_0xc6e6('0x24')]=0x0;writeDB(_0x12c616);}});}catch(_0x59a8f0){utils[_0xc6e6('0x19')](util[_0xc6e6('0x1a')](_0xc6e6('0x27'),_0x29411c['uniqueid']),_0x59a8f0);}};exports['agentconnect']=function(_0xa5138d){try{if(agents[_0xa5138d[_0xc6e6('0x12')]]){utils[_0xc6e6('0x14')](util[_0xc6e6('0x1a')]('[%s][agents][agentconnect]',_0xa5138d['uniqueid']),_0xa5138d);utils[_0xc6e6('0x1d')](util['format'](_0xc6e6('0x2b'),_0xa5138d['uniqueid'],agents[_0xa5138d[_0xc6e6('0x12')]][_0xc6e6('0x4')],_0xa5138d[_0xc6e6('0x12')]));agents[_0xa5138d[_0xc6e6('0x12')]]['agentconnectAt']=utils['now']();agents[_0xa5138d[_0xc6e6('0x12')]][_0xc6e6('0x6')]=_0xa5138d[_0xc6e6('0x6')];agents[_0xa5138d[_0xc6e6('0x12')]]['connectedlinename']=_0xa5138d['connectedlinename'];agents[_0xa5138d[_0xc6e6('0x12')]][_0xc6e6('0x22')]=_0xa5138d[_0xc6e6('0x23')];agents[_0xa5138d[_0xc6e6('0x12')]]['lastevent']=_0xc6e6('0x2c');_[_0xc6e6('0x25')](agents,function(_0x5ddab4,_0x500b7e){if(_0x5ddab4[_0xc6e6('0x12')]!=_0xa5138d['destuniqueid']&&_0x5ddab4[_0xc6e6('0x16')]==_0xa5138d[_0xc6e6('0x16')]){_0x5ddab4['talktime']=0x0;_0x5ddab4[_0xc6e6('0x22')]=_0xa5138d['ringtime'];_0x5ddab4[_0xc6e6('0x1b')]=!![];_0x5ddab4['agentringnoanswerAt']=utils[_0xc6e6('0x20')]();_0x5ddab4[_0xc6e6('0x7')]=_0xc6e6('0x2d');_0x5ddab4[_0xc6e6('0x2a')]=_0xc6e6('0x2d');_0x5ddab4[_0xc6e6('0x2e')]=_0xa5138d[_0xc6e6('0x12')];_0x5ddab4[_0xc6e6('0x2f')]=_0xa5138d[_0xc6e6('0x4')];writeDB(_0x5ddab4);}});}}catch(_0x5722db){utils[_0xc6e6('0x19')](util[_0xc6e6('0x1a')](_0xc6e6('0x30'),_0xa5138d[_0xc6e6('0x16')]),_0x5722db);}};exports['agentcomplete']=function(_0xc5f4fb){try{if(!_[_0xc6e6('0x31')](agents[_0xc5f4fb[_0xc6e6('0x12')]])){utils[_0xc6e6('0x14')](util['format'](_0xc6e6('0x32'),_0xc5f4fb[_0xc6e6('0x16')]),_0xc5f4fb);utils[_0xc6e6('0x1d')](util[_0xc6e6('0x1a')](_0xc6e6('0x33'),_0xc5f4fb['uniqueid'],agents[_0xc5f4fb[_0xc6e6('0x12')]]['membername'],_0xc5f4fb[_0xc6e6('0x12')]));agents[_0xc5f4fb['destuniqueid']][_0xc6e6('0xc')]=!![];agents[_0xc5f4fb[_0xc6e6('0x12')]][_0xc6e6('0x34')]=utils[_0xc6e6('0x20')]();agents[_0xc5f4fb[_0xc6e6('0x12')]][_0xc6e6('0x24')]=utils[_0xc6e6('0x35')](agents[_0xc5f4fb[_0xc6e6('0x12')]]['agentcompleteAt'],agents[_0xc5f4fb[_0xc6e6('0x12')]][_0xc6e6('0x36')]);agents[_0xc5f4fb[_0xc6e6('0x12')]]['reason']=_0xc5f4fb[_0xc6e6('0x2a')];agents[_0xc5f4fb[_0xc6e6('0x12')]][_0xc6e6('0x7')]=_0xc6e6('0x37');writeDB(agents[_0xc5f4fb[_0xc6e6('0x12')]]);}}catch(_0xefd557){utils[_0xc6e6('0x19')](util[_0xc6e6('0x1a')](_0xc6e6('0x32'),_0xc5f4fb[_0xc6e6('0x16')]),_0xefd557);}};exports[_0xc6e6('0x38')]=function(_0x470167){try{if(!_[_0xc6e6('0x31')](agents[_0x470167[_0xc6e6('0x39')]])){utils['debug'](util[_0xc6e6('0x1a')]('[%s][agents][blindtransfer]',_0x470167[_0xc6e6('0x16')]),_0x470167);utils[_0xc6e6('0x1d')](util['format']('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x470167['uniqueid'],agents[_0x470167['transfereruniqueid']]['membername'],agents[_0x470167[_0xc6e6('0x39')]][_0xc6e6('0x16')]));agents[_0x470167[_0xc6e6('0x39')]][_0xc6e6('0x3a')]=!![];agents[_0x470167[_0xc6e6('0x39')]]['transfertype']='blind';agents[_0x470167[_0xc6e6('0x39')]][_0xc6e6('0x3b')]=_0x470167[_0xc6e6('0x3c')];agents[_0x470167[_0xc6e6('0x39')]]['transferuniqueid']=agents[_0x470167[_0xc6e6('0x39')]][_0xc6e6('0x16')];}}catch(_0x286dc1){utils[_0xc6e6('0x19')](util[_0xc6e6('0x1a')]('[%s][agents][blindtransfer]',_0x470167[_0xc6e6('0x16')]),_0x286dc1);}};exports[_0xc6e6('0x3d')]=function(_0x288912){try{utils['debug'](util[_0xc6e6('0x1a')](_0xc6e6('0x3e'),_0x288912[_0xc6e6('0x3f')]),_0x288912);if(_0x288912[_0xc6e6('0x3f')]==_0x288912[_0xc6e6('0x40')]){if(!_['isNil'](agents[_0x288912[_0xc6e6('0x41')]])){utils[_0xc6e6('0x1d')](util[_0xc6e6('0x1a')](_0xc6e6('0x42'),_0x288912[_0xc6e6('0x3f')],agents[_0x288912['secondtransfereruniqueid']]['membername']));agents[_0x288912['secondtransfereruniqueid']][_0xc6e6('0x3a')]=!![];agents[_0x288912[_0xc6e6('0x41')]][_0xc6e6('0x43')]=_0xc6e6('0x44');agents[_0x288912[_0xc6e6('0x41')]][_0xc6e6('0x3b')]=_0x288912['origtransfererexten'];agents[_0x288912[_0xc6e6('0x41')]]['transferuniqueid']=_0x288912[_0xc6e6('0x3f')];}if(_0x288912[_0xc6e6('0x45')]&&agents[_0x288912[_0xc6e6('0x45')]]){agents[_0x288912['transfereeuniqueid']][_0xc6e6('0x46')]=0x1;transfers[_0x288912['transfereeuniqueid']]=_[_0xc6e6('0x47')](agents[_0x288912['transfereeuniqueid']]);transfers[_0x288912['transfereeuniqueid']][_0xc6e6('0x48')]=agents[_0x288912['secondtransfereruniqueid']]['calleridnum'];transfers[_0x288912[_0xc6e6('0x45')]][_0xc6e6('0x49')]=agents[_0x288912[_0xc6e6('0x41')]][_0xc6e6('0x49')];transfers[_0x288912[_0xc6e6('0x45')]][_0xc6e6('0x17')]=utils[_0xc6e6('0x20')]();transfers[_0x288912[_0xc6e6('0x45')]]['agentconnectAt']=utils[_0xc6e6('0x20')]();transfers[_0x288912[_0xc6e6('0x45')]][_0xc6e6('0x22')]=0x0;transfers[_0x288912[_0xc6e6('0x45')]]['agententerreason']=0x2;}}else if(_0x288912[_0xc6e6('0x41')]==_0x288912[_0xc6e6('0x4a')]){if(!_[_0xc6e6('0x31')](agents[_0x288912['origtransfereruniqueid']])){utils['info'](util[_0xc6e6('0x1a')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x288912['origtransfereruniqueid'],agents[_0x288912[_0xc6e6('0x3f')]][_0xc6e6('0x4')]));agents[_0x288912[_0xc6e6('0x3f')]][_0xc6e6('0x3a')]=!![];agents[_0x288912[_0xc6e6('0x3f')]][_0xc6e6('0x43')]=_0xc6e6('0x44');agents[_0x288912[_0xc6e6('0x3f')]][_0xc6e6('0x3b')]=_0x288912[_0xc6e6('0x4b')];agents[_0x288912[_0xc6e6('0x3f')]]['transferuniqueid']=_0x288912['secondtransfereruniqueid'];}if(_0x288912[_0xc6e6('0x4c')]&&agents[_0x288912['transfertargetuniqueid']]){agents[_0x288912['transfertargetuniqueid']][_0xc6e6('0x46')]=0x1;transfers[_0x288912[_0xc6e6('0x4c')]]=_[_0xc6e6('0x47')](agents[_0x288912['transfertargetuniqueid']]);transfers[_0x288912[_0xc6e6('0x4c')]][_0xc6e6('0x48')]=agents[_0x288912['origtransfereruniqueid']]['calleridnum'];transfers[_0x288912[_0xc6e6('0x4c')]][_0xc6e6('0x49')]=agents[_0x288912[_0xc6e6('0x3f')]][_0xc6e6('0x49')];transfers[_0x288912[_0xc6e6('0x4c')]][_0xc6e6('0x17')]=utils['now']();transfers[_0x288912[_0xc6e6('0x4c')]][_0xc6e6('0x36')]=utils[_0xc6e6('0x20')]();transfers[_0x288912[_0xc6e6('0x4c')]][_0xc6e6('0x22')]=0x0;transfers[_0x288912['transfertargetuniqueid']][_0xc6e6('0x46')]=0x2;}}}catch(_0x3b1549){utils[_0xc6e6('0x19')](util[_0xc6e6('0x1a')](_0xc6e6('0x3e'),_0x288912[_0xc6e6('0x3f')]),_0x3b1549);}};exports['hangup']=function(_0x27e74b){try{utils['debug'](util[_0xc6e6('0x1a')]('[%s][agents][hangup]',_0x27e74b['uniqueid']),_0x27e74b);if(agents[_0x27e74b[_0xc6e6('0x16')]]&&agents[_0x27e74b['uniqueid']][_0xc6e6('0x2a')]===_0xc6e6('0x21')){if(_0x27e74b[_0xc6e6('0x4d')]==='21'){agents[_0x27e74b[_0xc6e6('0x16')]][_0xc6e6('0x2a')]='rejected';agents[_0x27e74b[_0xc6e6('0x16')]]['lastevent']='rejected';}utils[_0xc6e6('0x1d')](util[_0xc6e6('0x1a')](_0xc6e6('0x4e'),_0x27e74b['uniqueid'],agents[_0x27e74b[_0xc6e6('0x16')]]['membername'],agents[_0x27e74b['uniqueid']][_0xc6e6('0x2a')],agents[_0x27e74b['uniqueid']][_0xc6e6('0x7')]));writeDB(agents[_0x27e74b[_0xc6e6('0x16')]]);var _0x292107=unanswered[_0xc6e6('0x4f')](_0x27e74b['uniqueid']);if(_0x292107>-0x1){unanswered[_0xc6e6('0x50')](_0x292107,0x1);}}if(transfers[_0x27e74b[_0xc6e6('0x16')]]){transfers[_0x27e74b[_0xc6e6('0x16')]][_0xc6e6('0xc')]=!![];transfers[_0x27e74b[_0xc6e6('0x16')]]['agentcompleteAt']=utils[_0xc6e6('0x20')]();transfers[_0x27e74b[_0xc6e6('0x16')]][_0xc6e6('0x24')]=utils[_0xc6e6('0x35')](transfers[_0x27e74b['uniqueid']]['agentcompleteAt'],transfers[_0x27e74b[_0xc6e6('0x16')]][_0xc6e6('0x36')]);transfers[_0x27e74b[_0xc6e6('0x16')]][_0xc6e6('0x2a')]=_0xc6e6('0x51');transfers[_0x27e74b[_0xc6e6('0x16')]][_0xc6e6('0x7')]=_0xc6e6('0x37');utils[_0xc6e6('0x1d')](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x27e74b[_0xc6e6('0x16')],transfers[_0x27e74b['uniqueid']][_0xc6e6('0x4')],transfers[_0x27e74b[_0xc6e6('0x16')]][_0xc6e6('0x2a')],transfers[_0x27e74b['uniqueid']]['lastevent']));writeDB(transfers[_0x27e74b[_0xc6e6('0x16')]],!![]);}if(agents[_0x27e74b['uniqueid']]&&agents[_0x27e74b[_0xc6e6('0x16')]]['agentconnectAt']){agents[_0x27e74b[_0xc6e6('0x16')]][_0xc6e6('0xc')]=!![];agents[_0x27e74b['uniqueid']][_0xc6e6('0x34')]=utils[_0xc6e6('0x20')]();agents[_0x27e74b[_0xc6e6('0x16')]]['talktime']=utils[_0xc6e6('0x35')](agents[_0x27e74b[_0xc6e6('0x16')]][_0xc6e6('0x34')],agents[_0x27e74b['uniqueid']][_0xc6e6('0x36')]);agents[_0x27e74b[_0xc6e6('0x16')]]['reason']=agents[_0x27e74b['uniqueid']]['transfer']?_0xc6e6('0x3a'):_0xc6e6('0x51');agents[_0x27e74b[_0xc6e6('0x16')]][_0xc6e6('0x7')]=_0xc6e6('0x37');utils[_0xc6e6('0x1d')](util['format'](_0xc6e6('0x4e'),_0x27e74b['uniqueid'],agents[_0x27e74b[_0xc6e6('0x16')]][_0xc6e6('0x4')],agents[_0x27e74b[_0xc6e6('0x16')]]['reason'],agents[_0x27e74b['uniqueid']][_0xc6e6('0x7')]));writeDB(agents[_0x27e74b[_0xc6e6('0x16')]]);}}catch(_0x1826d){utils[_0xc6e6('0x19')](util[_0xc6e6('0x1a')](_0xc6e6('0x52'),_0x27e74b[_0xc6e6('0x16')]),_0x1826d);}};
\ No newline at end of file
+var _0x04b8=['ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','transfertargetuniqueid','[%s][agents][attendedtransfer]','hangup','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','diffTime','agent','[%s][agents][hangup]','util','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','type','agentacw','agentcomplete','acwtime','acwTimeout','request','CreateVoiceAgentReport','uniqueid','agentcalled','debug','destuniqueid','agentcalledAt','connectedlinename','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','agentringnoanswerAt','reason','timeout','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','now','abandoned','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentcomplete]','agentcompleteAt','complete','blindtransfer','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfertype','transferexten','extension','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfer'];(function(_0x46401e,_0x2a345b){var _0x447cba=function(_0x54ea97){while(--_0x54ea97){_0x46401e['push'](_0x46401e['shift']());}};_0x447cba(++_0x2a345b);}(_0x04b8,0x159));var _0x804b=function(_0x2e41bd,_0x5def23){_0x2e41bd=_0x2e41bd-0x0;var _0x549912=_0x04b8[_0x2e41bd];return _0x549912;};'use strict';var _=require('lodash');var util=require(_0x804b('0x0'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x241a4f,_0xa6a605){utils['info'](util[_0x804b('0x1')](_0x804b('0x2'),_0x241a4f['uniqueid'],_0x241a4f[_0x804b('0x3')],_0x241a4f[_0x804b('0x4')],_0x241a4f[_0x804b('0x5')],_0x241a4f['interface'],_0x241a4f[_0x804b('0x6')],_0x241a4f[_0x804b('0x7')],_0x241a4f[_0x804b('0x8')]));if(_0x241a4f['queue']){utils[_0x804b('0x9')](_0x241a4f[_0x804b('0x4')])['then'](function(_0x2a5a68){if(_0x2a5a68){_0x241a4f[_0x804b('0xa')]=_0x2a5a68[_0x804b('0xa')];_0x241a4f[_0x804b('0xb')]=_0x241a4f[_0x804b('0xc')]?_0x2a5a68['acw']:![];_0x241a4f[_0x804b('0xd')]=_0x241a4f[_0x804b('0xb')]?_0x2a5a68[_0x804b('0xe')]:0x0;}utils[_0x804b('0xf')](_0x804b('0x10'),_0x241a4f);});}else{utils[_0x804b('0xf')]('CreateVoiceAgentReport',_0x241a4f);}if(_0xa6a605){delete transfers[_0x241a4f[_0x804b('0x11')]];}else{delete agents[_0x241a4f['destuniqueid']];}}exports[_0x804b('0x12')]=function(_0x3a2702){try{utils[_0x804b('0x13')](util[_0x804b('0x1')]('[%s][agents][agentcalled]',_0x3a2702[_0x804b('0x11')]),_0x3a2702);agents[_0x3a2702[_0x804b('0x14')]]=_0x3a2702;agents[_0x3a2702[_0x804b('0x14')]][_0x804b('0x15')]=utils['now']();agents[_0x3a2702[_0x804b('0x14')]][_0x804b('0x8')]='called';agents[_0x3a2702[_0x804b('0x14')]]['connectedlinenum']=null;agents[_0x3a2702[_0x804b('0x14')]][_0x804b('0x16')]=null;utils[_0x804b('0x17')](util[_0x804b('0x1')](_0x804b('0x18'),_0x3a2702['uniqueid'],agents[_0x3a2702[_0x804b('0x14')]]['membername'],_0x3a2702[_0x804b('0x14')]));}catch(_0x95e719){utils[_0x804b('0x19')](util[_0x804b('0x1')]('[%s][agents][agentcalled]',_0x3a2702[_0x804b('0x11')]),_0x95e719);}};exports[_0x804b('0x1a')]=function(_0x427166){try{if(!_[_0x804b('0x1b')](agents[_0x427166[_0x804b('0x14')]])){utils[_0x804b('0x13')](util[_0x804b('0x1')](_0x804b('0x1c'),_0x427166[_0x804b('0x11')]),_0x427166);utils[_0x804b('0x17')](util[_0x804b('0x1')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x427166[_0x804b('0x11')],agents[_0x427166[_0x804b('0x14')]]['membername'],_0x427166[_0x804b('0x14')]));agents[_0x427166[_0x804b('0x14')]][_0x804b('0x1a')]=!![];agents[_0x427166[_0x804b('0x14')]][_0x804b('0x1d')]=utils['now']();agents[_0x427166[_0x804b('0x14')]][_0x804b('0x8')]='timeout';agents[_0x427166[_0x804b('0x14')]][_0x804b('0x1e')]=_0x804b('0x1f');agents[_0x427166[_0x804b('0x14')]][_0x804b('0x20')]=_0x427166['ringtime']?parseInt(_0x427166[_0x804b('0x21')])/0x3e8:0x0;agents[_0x427166[_0x804b('0x14')]][_0x804b('0x22')]=0x0;unanswered[_0x804b('0x23')](_0x427166[_0x804b('0x14')]);}}catch(_0x4a6079){utils[_0x804b('0x19')](util[_0x804b('0x1')](_0x804b('0x1c'),_0x427166['uniqueid']),_0x4a6079);}};exports[_0x804b('0x24')]=function(_0x407357){try{_[_0x804b('0x25')](agents,function(_0x57b8da,_0x408857){if(_0x57b8da[_0x804b('0x11')]==_0x407357['uniqueid']&&!_[_0x804b('0x26')](unanswered,_0x57b8da[_0x804b('0x14')])){utils[_0x804b('0x13')](util[_0x804b('0x1')](_0x804b('0x27'),_0x407357[_0x804b('0x11')]),_0x407357);utils['info'](util[_0x804b('0x1')](_0x804b('0x28'),_0x407357[_0x804b('0x11')],_0x57b8da[_0x804b('0x5')],_0x57b8da[_0x804b('0x14')]));_0x57b8da[_0x804b('0x1a')]=!![];_0x57b8da[_0x804b('0x1d')]=utils[_0x804b('0x29')]();_0x57b8da[_0x804b('0x8')]=_0x804b('0x2a');_0x57b8da[_0x804b('0x1e')]=_0x804b('0x2a');_0x57b8da[_0x804b('0x20')]=_0x407357[_0x804b('0x20')];_0x57b8da[_0x804b('0x22')]=0x0;writeDB(_0x57b8da);}});}catch(_0x384c44){utils[_0x804b('0x19')](util[_0x804b('0x1')](_0x804b('0x27'),_0x407357[_0x804b('0x11')]),_0x384c44);}};exports[_0x804b('0x2b')]=function(_0x350387){try{if(agents[_0x350387[_0x804b('0x14')]]){utils[_0x804b('0x13')](util[_0x804b('0x1')]('[%s][agents][agentconnect]',_0x350387['uniqueid']),_0x350387);utils['info'](util[_0x804b('0x1')](_0x804b('0x2c'),_0x350387[_0x804b('0x11')],agents[_0x350387['destuniqueid']]['membername'],_0x350387['destuniqueid']));agents[_0x350387[_0x804b('0x14')]][_0x804b('0x2d')]=utils[_0x804b('0x29')]();agents[_0x350387[_0x804b('0x14')]][_0x804b('0x7')]=_0x350387[_0x804b('0x7')];agents[_0x350387[_0x804b('0x14')]][_0x804b('0x16')]=_0x350387[_0x804b('0x16')];agents[_0x350387[_0x804b('0x14')]][_0x804b('0x20')]=_0x350387[_0x804b('0x21')];agents[_0x350387[_0x804b('0x14')]]['lastevent']=_0x804b('0x2e');_[_0x804b('0x25')](agents,function(_0xb877d6,_0x3d6d8a){if(_0xb877d6[_0x804b('0x14')]!=_0x350387['destuniqueid']&&_0xb877d6['uniqueid']==_0x350387[_0x804b('0x11')]){_0xb877d6[_0x804b('0x22')]=0x0;_0xb877d6[_0x804b('0x20')]=_0x350387['ringtime'];_0xb877d6[_0x804b('0x1a')]=!![];_0xb877d6['agentringnoanswerAt']=utils[_0x804b('0x29')]();_0xb877d6[_0x804b('0x8')]=_0x804b('0x2f');_0xb877d6[_0x804b('0x1e')]=_0x804b('0x2f');_0xb877d6[_0x804b('0x30')]=_0x350387[_0x804b('0x14')];_0xb877d6['answeredelsewheremembername']=_0x350387[_0x804b('0x5')];writeDB(_0xb877d6);}});}}catch(_0x1c0363){utils[_0x804b('0x19')](util[_0x804b('0x1')]('[%s][agents][agentconnect]',_0x350387[_0x804b('0x11')]),_0x1c0363);}};exports[_0x804b('0xc')]=function(_0x1df519){try{if(!_[_0x804b('0x1b')](agents[_0x1df519[_0x804b('0x14')]])){utils[_0x804b('0x13')](util[_0x804b('0x1')](_0x804b('0x31'),_0x1df519['uniqueid']),_0x1df519);utils[_0x804b('0x17')](util['format']('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x1df519['uniqueid'],agents[_0x1df519[_0x804b('0x14')]]['membername'],_0x1df519[_0x804b('0x14')]));agents[_0x1df519[_0x804b('0x14')]][_0x804b('0xc')]=!![];agents[_0x1df519[_0x804b('0x14')]]['agentcompleteAt']=utils[_0x804b('0x29')]();agents[_0x1df519[_0x804b('0x14')]][_0x804b('0x22')]=utils['diffTime'](agents[_0x1df519[_0x804b('0x14')]][_0x804b('0x32')],agents[_0x1df519[_0x804b('0x14')]]['agentconnectAt']);agents[_0x1df519[_0x804b('0x14')]][_0x804b('0x1e')]=_0x1df519[_0x804b('0x1e')];agents[_0x1df519[_0x804b('0x14')]][_0x804b('0x8')]=_0x804b('0x33');writeDB(agents[_0x1df519[_0x804b('0x14')]]);}}catch(_0x2a2a08){utils[_0x804b('0x19')](util[_0x804b('0x1')](_0x804b('0x31'),_0x1df519[_0x804b('0x11')]),_0x2a2a08);}};exports[_0x804b('0x34')]=function(_0x2c1796){try{if(!_['isNil'](agents[_0x2c1796['transfereruniqueid']])){utils[_0x804b('0x13')](util[_0x804b('0x1')](_0x804b('0x35'),_0x2c1796[_0x804b('0x11')]),_0x2c1796);utils[_0x804b('0x17')](util['format'](_0x804b('0x36'),_0x2c1796[_0x804b('0x11')],agents[_0x2c1796[_0x804b('0x37')]][_0x804b('0x5')],agents[_0x2c1796[_0x804b('0x37')]][_0x804b('0x11')]));agents[_0x2c1796['transfereruniqueid']]['transfer']=!![];agents[_0x2c1796[_0x804b('0x37')]][_0x804b('0x38')]='blind';agents[_0x2c1796['transfereruniqueid']][_0x804b('0x39')]=_0x2c1796[_0x804b('0x3a')];agents[_0x2c1796[_0x804b('0x37')]]['transferuniqueid']=agents[_0x2c1796[_0x804b('0x37')]][_0x804b('0x11')];}}catch(_0x54cc99){utils[_0x804b('0x19')](util['format'](_0x804b('0x35'),_0x2c1796['uniqueid']),_0x54cc99);}};exports[_0x804b('0x3b')]=function(_0x183e72){try{utils['debug'](util[_0x804b('0x1')]('[%s][agents][attendedtransfer]',_0x183e72[_0x804b('0x3c')]),_0x183e72);if(_0x183e72[_0x804b('0x3c')]==_0x183e72[_0x804b('0x3d')]){if(!_[_0x804b('0x1b')](agents[_0x183e72[_0x804b('0x3e')]])){utils[_0x804b('0x17')](util[_0x804b('0x1')](_0x804b('0x3f'),_0x183e72[_0x804b('0x3c')],agents[_0x183e72[_0x804b('0x3e')]]['membername']));agents[_0x183e72['secondtransfereruniqueid']][_0x804b('0x40')]=!![];agents[_0x183e72['secondtransfereruniqueid']]['transfertype']=_0x804b('0x41');agents[_0x183e72[_0x804b('0x3e')]][_0x804b('0x39')]=_0x183e72[_0x804b('0x42')];agents[_0x183e72['secondtransfereruniqueid']]['transferuniqueid']=_0x183e72[_0x804b('0x3c')];}if(_0x183e72[_0x804b('0x43')]&&agents[_0x183e72[_0x804b('0x43')]]){agents[_0x183e72[_0x804b('0x43')]][_0x804b('0x44')]=0x1;transfers[_0x183e72[_0x804b('0x43')]]=_[_0x804b('0x45')](agents[_0x183e72[_0x804b('0x43')]]);transfers[_0x183e72[_0x804b('0x43')]][_0x804b('0x6')]=agents[_0x183e72[_0x804b('0x3e')]][_0x804b('0x6')];transfers[_0x183e72[_0x804b('0x43')]][_0x804b('0x46')]=agents[_0x183e72[_0x804b('0x3e')]][_0x804b('0x46')];transfers[_0x183e72['transfereeuniqueid']][_0x804b('0x15')]=utils[_0x804b('0x29')]();transfers[_0x183e72['transfereeuniqueid']][_0x804b('0x2d')]=utils[_0x804b('0x29')]();transfers[_0x183e72[_0x804b('0x43')]][_0x804b('0x20')]=0x0;transfers[_0x183e72['transfereeuniqueid']][_0x804b('0x44')]=0x2;}}else if(_0x183e72[_0x804b('0x3e')]==_0x183e72['secondtransfererlinkedid']){if(!_[_0x804b('0x1b')](agents[_0x183e72[_0x804b('0x3c')]])){utils[_0x804b('0x17')](util['format'](_0x804b('0x3f'),_0x183e72[_0x804b('0x3c')],agents[_0x183e72[_0x804b('0x3c')]][_0x804b('0x5')]));agents[_0x183e72[_0x804b('0x3c')]]['transfer']=!![];agents[_0x183e72[_0x804b('0x3c')]][_0x804b('0x38')]=_0x804b('0x41');agents[_0x183e72[_0x804b('0x3c')]]['transferexten']=_0x183e72['secondtransfererexten'];agents[_0x183e72[_0x804b('0x3c')]]['transferuniqueid']=_0x183e72[_0x804b('0x3e')];}if(_0x183e72[_0x804b('0x47')]&&agents[_0x183e72[_0x804b('0x47')]]){agents[_0x183e72[_0x804b('0x47')]][_0x804b('0x44')]=0x1;transfers[_0x183e72['transfertargetuniqueid']]=_[_0x804b('0x45')](agents[_0x183e72[_0x804b('0x47')]]);transfers[_0x183e72[_0x804b('0x47')]]['calleridnum']=agents[_0x183e72[_0x804b('0x3c')]][_0x804b('0x6')];transfers[_0x183e72['transfertargetuniqueid']][_0x804b('0x46')]=agents[_0x183e72['origtransfereruniqueid']][_0x804b('0x46')];transfers[_0x183e72[_0x804b('0x47')]]['agentcalledAt']=utils[_0x804b('0x29')]();transfers[_0x183e72[_0x804b('0x47')]][_0x804b('0x2d')]=utils['now']();transfers[_0x183e72[_0x804b('0x47')]]['holdtime']=0x0;transfers[_0x183e72[_0x804b('0x47')]][_0x804b('0x44')]=0x2;}}}catch(_0x43f3ec){utils[_0x804b('0x19')](util['format'](_0x804b('0x48'),_0x183e72[_0x804b('0x3c')]),_0x43f3ec);}};exports[_0x804b('0x49')]=function(_0xa1da42){try{utils[_0x804b('0x13')](util[_0x804b('0x1')]('[%s][agents][hangup]',_0xa1da42[_0x804b('0x11')]),_0xa1da42);if(agents[_0xa1da42[_0x804b('0x11')]]&&agents[_0xa1da42['uniqueid']][_0x804b('0x1e')]===_0x804b('0x1f')){if(_0xa1da42[_0x804b('0x4a')]==='21'){agents[_0xa1da42[_0x804b('0x11')]]['reason']=_0x804b('0x4b');agents[_0xa1da42[_0x804b('0x11')]]['lastevent']=_0x804b('0x4b');}utils[_0x804b('0x17')](util['format'](_0x804b('0x4c'),_0xa1da42['uniqueid'],agents[_0xa1da42[_0x804b('0x11')]][_0x804b('0x5')],agents[_0xa1da42[_0x804b('0x11')]][_0x804b('0x1e')],agents[_0xa1da42[_0x804b('0x11')]][_0x804b('0x8')]));writeDB(agents[_0xa1da42[_0x804b('0x11')]]);var _0x5efc95=unanswered[_0x804b('0x4d')](_0xa1da42['uniqueid']);if(_0x5efc95>-0x1){unanswered[_0x804b('0x4e')](_0x5efc95,0x1);}}if(transfers[_0xa1da42[_0x804b('0x11')]]){transfers[_0xa1da42[_0x804b('0x11')]][_0x804b('0xc')]=!![];transfers[_0xa1da42[_0x804b('0x11')]][_0x804b('0x32')]=utils[_0x804b('0x29')]();transfers[_0xa1da42[_0x804b('0x11')]][_0x804b('0x22')]=utils[_0x804b('0x4f')](transfers[_0xa1da42[_0x804b('0x11')]]['agentcompleteAt'],transfers[_0xa1da42['uniqueid']][_0x804b('0x2d')]);transfers[_0xa1da42[_0x804b('0x11')]][_0x804b('0x1e')]=_0x804b('0x50');transfers[_0xa1da42['uniqueid']][_0x804b('0x8')]=_0x804b('0x33');utils[_0x804b('0x17')](util[_0x804b('0x1')](_0x804b('0x4c'),_0xa1da42[_0x804b('0x11')],transfers[_0xa1da42[_0x804b('0x11')]][_0x804b('0x5')],transfers[_0xa1da42[_0x804b('0x11')]][_0x804b('0x1e')],transfers[_0xa1da42['uniqueid']]['lastevent']));writeDB(transfers[_0xa1da42[_0x804b('0x11')]],!![]);}if(agents[_0xa1da42[_0x804b('0x11')]]&&agents[_0xa1da42['uniqueid']][_0x804b('0x2d')]){agents[_0xa1da42[_0x804b('0x11')]]['agentcomplete']=!![];agents[_0xa1da42[_0x804b('0x11')]]['agentcompleteAt']=utils['now']();agents[_0xa1da42[_0x804b('0x11')]][_0x804b('0x22')]=utils['diffTime'](agents[_0xa1da42['uniqueid']][_0x804b('0x32')],agents[_0xa1da42[_0x804b('0x11')]]['agentconnectAt']);agents[_0xa1da42[_0x804b('0x11')]]['reason']=agents[_0xa1da42[_0x804b('0x11')]][_0x804b('0x40')]?_0x804b('0x40'):'agent';agents[_0xa1da42[_0x804b('0x11')]][_0x804b('0x8')]=_0x804b('0x33');utils[_0x804b('0x17')](util[_0x804b('0x1')](_0x804b('0x4c'),_0xa1da42[_0x804b('0x11')],agents[_0xa1da42[_0x804b('0x11')]][_0x804b('0x5')],agents[_0xa1da42[_0x804b('0x11')]]['reason'],agents[_0xa1da42['uniqueid']][_0x804b('0x8')]));writeDB(agents[_0xa1da42[_0x804b('0x11')]]);}}catch(_0x3dd61f){utils[_0x804b('0x19')](util[_0x804b('0x1')](_0x804b('0x51'),_0xa1da42[_0x804b('0x11')]),_0x3dd61f);}};
\ No newline at end of file
index 278293b..7dba3f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x043b=['[%s][calls][attendedtransfer]','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','toLowerCase','cdr','split','lastIndexOf','noop','gotoif','lastapplication','lodash','util','NO\x20ANSWER','FAILED','ANSWERED','blinds','uniqueid','info','format','channel','queue','membername','interface','calleridnum','connectedlinenum','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','error','newstate','[%s][calls][newstate]','isNil','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','linkedid','channelstate','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','now','duration','diffTime','starttime','billableseconds','attendedtransfer','localtwolinkedid'];(function(_0xc7e62c,_0x2f1a41){var _0x22e2cf=function(_0x594517){while(--_0x594517){_0xc7e62c['push'](_0xc7e62c['shift']());}};_0x22e2cf(++_0x2f1a41);}(_0x043b,0xa0));var _0xb043=function(_0x9fdb4b,_0x3b9ae9){_0x9fdb4b=_0x9fdb4b-0x0;var _0x36a1ed=_0x043b[_0x9fdb4b];return _0x36a1ed;};'use strict';var _=require(_0xb043('0x0'));var util=require(_0xb043('0x1'));var utils=require('./utils');var transfers=require('./transfers.controller');var dispositions=[_0xb043('0x2'),_0xb043('0x3'),_0xb043('0x3'),_0xb043('0x2'),_0xb043('0x2'),_0xb043('0x2'),_0xb043('0x4'),'BUSY','FAILED','FAILED',_0xb043('0x3')];var channels={};function writeDB(_0x3f73b9){var _0x4e2a0f;if(transfers[_0xb043('0x5')][_0x3f73b9[_0xb043('0x6')]]){_0x4e2a0f=_0x3f73b9[_0xb043('0x6')];_0x3f73b9[_0xb043('0x6')]=transfers['blinds'][_0x3f73b9[_0xb043('0x6')]]['transfereeuniqueid'];}utils[_0xb043('0x7')](util[_0xb043('0x8')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x3f73b9['uniqueid'],_0x3f73b9[_0xb043('0x9')],_0x3f73b9[_0xb043('0xa')],_0x3f73b9[_0xb043('0xb')],_0x3f73b9[_0xb043('0xc')],_0x3f73b9[_0xb043('0xd')],_0x3f73b9[_0xb043('0xe')],_0x3f73b9['lastevent']));if(_0x3f73b9[_0xb043('0xf')]){utils[_0xb043('0x10')](_0x3f73b9['accountcode'])[_0xb043('0x11')](function(_0x3c7a6e){if(_0x3c7a6e){_0x3f73b9[_0xb043('0x12')]=_0x3c7a6e['id'];}utils[_0xb043('0x13')](_0xb043('0x14'),_0x3f73b9);});}else{utils[_0xb043('0x13')]('CreateVoiceCallReport',_0x3f73b9);}if(channels[_0x3f73b9[_0xb043('0x6')]]){delete channels[_0x3f73b9[_0xb043('0x6')]];}else if(_0x4e2a0f&&channels[_0x4e2a0f]){if(!transfers[_0xb043('0x5')][_0x4e2a0f]['recording'])delete transfers[_0xb043('0x5')][_0x4e2a0f];delete channels[_0x4e2a0f];}}exports[_0xb043('0x15')]=function(_0x2b1af7){try{utils[_0xb043('0x16')](util[_0xb043('0x8')](_0xb043('0x17'),_0x2b1af7[_0xb043('0x6')]),_0x2b1af7);if(_0x2b1af7[_0xb043('0x6')]==_0x2b1af7['linkedid']&&_0x2b1af7[_0xb043('0x9')]!=_0xb043('0x18')){utils['info'](util[_0xb043('0x8')](_0xb043('0x19'),_0x2b1af7[_0xb043('0x6')],_0x2b1af7[_0xb043('0x1a')],_0x2b1af7[_0xb043('0x1b')]));channels[_0x2b1af7[_0xb043('0x6')]]={'uniqueid':_0x2b1af7[_0xb043('0x6')],'accountcode':_0x2b1af7[_0xb043('0xf')],'source':_0x2b1af7[_0xb043('0xd')],'destination':_0x2b1af7['exten'],'destinationcontext':_0x2b1af7['context'],'channel':_0x2b1af7[_0xb043('0x9')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':'DOCUMENTATION'};}}catch(_0x4063dc){utils[_0xb043('0x1c')](util['format']('[%s][calls][newchannel]',_0x2b1af7[_0xb043('0x6')]),_0x4063dc);}};exports[_0xb043('0x1d')]=function(_0x40d2f1){try{utils[_0xb043('0x16')](util[_0xb043('0x8')](_0xb043('0x1e'),_0x40d2f1[_0xb043('0x6')]),_0x40d2f1);if(!_[_0xb043('0x1f')](channels[_0x40d2f1['uniqueid']])&&_0x40d2f1['channelstate']==0x6){utils[_0xb043('0x7')](util['format'](_0xb043('0x20'),_0x40d2f1[_0xb043('0x6')],_0x40d2f1[_0xb043('0x1a')],_0x40d2f1['channel']));if(_[_0xb043('0x1f')](channels[_0x40d2f1[_0xb043('0x6')]][_0xb043('0x21')])){channels[_0x40d2f1[_0xb043('0x6')]][_0xb043('0x21')]=utils['now']();}}else if(!_[_0xb043('0x1f')](channels[_0x40d2f1[_0xb043('0x22')]])&&_0x40d2f1[_0xb043('0x23')]==0x6&&_0x40d2f1[_0xb043('0x1a')]!=_0xb043('0x24')){utils[_0xb043('0x7')](util['format'](_0xb043('0x25'),_0x40d2f1[_0xb043('0x6')],_0x40d2f1['linkedid'],_0x40d2f1[_0xb043('0x1a')],_0x40d2f1[_0xb043('0x9')]));channels[_0x40d2f1[_0xb043('0x22')]][_0xb043('0xf')]=_0x40d2f1[_0xb043('0xf')];channels[_0x40d2f1['linkedid']][_0xb043('0x26')]=_0x40d2f1['channel'];if(_[_0xb043('0x1f')](channels[_0x40d2f1[_0xb043('0x22')]][_0xb043('0x27')])){channels[_0x40d2f1[_0xb043('0x22')]][_0xb043('0x27')]=utils['now']();}channels[_0x40d2f1[_0xb043('0x22')]][_0xb043('0x28')]=dispositions[_[_0xb043('0x29')](_0x40d2f1[_0xb043('0x23')])]||_0xb043('0x4');}}catch(_0x5b4cd1){utils[_0xb043('0x1c')](util['format'](_0xb043('0x1e'),_0x40d2f1[_0xb043('0x6')]),_0x5b4cd1);}};exports[_0xb043('0x2a')]=function(_0x3f3e83){try{if(!_[_0xb043('0x1f')](channels[_0x3f3e83[_0xb043('0x6')]])){utils[_0xb043('0x16')](util[_0xb043('0x8')](_0xb043('0x2b'),_0x3f3e83['uniqueid']),_0x3f3e83);if(_[_0xb043('0x1f')](channels[_0x3f3e83[_0xb043('0x6')]][_0xb043('0x2c')])){channels[_0x3f3e83[_0xb043('0x6')]][_0xb043('0x2c')]=_0x3f3e83[_0xb043('0x2d')]+'\x20<'+_0x3f3e83[_0xb043('0xd')]+'>';}utils[_0xb043('0x7')](util[_0xb043('0x8')](_0xb043('0x2e'),_0x3f3e83['uniqueid'],channels[_0x3f3e83[_0xb043('0x6')]][_0xb043('0x2c')],_0x3f3e83[_0xb043('0x2f')]));channels[_0x3f3e83[_0xb043('0x6')]][_0xb043('0x30')]=utils[_0xb043('0x31')]();channels[_0x3f3e83['uniqueid']][_0xb043('0x32')]=utils[_0xb043('0x33')](channels[_0x3f3e83[_0xb043('0x6')]][_0xb043('0x30')],channels[_0x3f3e83[_0xb043('0x6')]][_0xb043('0x34')]);channels[_0x3f3e83[_0xb043('0x6')]][_0xb043('0x35')]=channels[_0x3f3e83[_0xb043('0x6')]][_0xb043('0x27')]?utils[_0xb043('0x33')](channels[_0x3f3e83[_0xb043('0x6')]][_0xb043('0x30')],channels[_0x3f3e83[_0xb043('0x6')]][_0xb043('0x27')]):0x0;writeDB(channels[_0x3f3e83[_0xb043('0x6')]]);}}catch(_0x433be5){utils[_0xb043('0x1c')](util[_0xb043('0x8')](_0xb043('0x2b'),_0x3f3e83[_0xb043('0x6')]),_0x433be5);}};exports[_0xb043('0x36')]=function(_0x3ceb57){try{if(!_[_0xb043('0x1f')](channels[_0x3ceb57[_0xb043('0x37')]])){utils[_0xb043('0x16')](util[_0xb043('0x8')](_0xb043('0x38'),_0x3ceb57['origtransfereruniqueid']),_0x3ceb57);if(channels[_0x3ceb57[_0xb043('0x37')]]['channel']==_0x3ceb57[_0xb043('0x39')]){utils['info'](util[_0xb043('0x8')](_0xb043('0x3a'),_0x3ceb57[_0xb043('0x3b')],_0x3ceb57[_0xb043('0x37')],_0x3ceb57[_0xb043('0x3c')]));channels[_0x3ceb57[_0xb043('0x37')]][_0xb043('0x26')]=_0x3ceb57[_0xb043('0x3c')];channels[_0x3ceb57[_0xb043('0x37')]][_0xb043('0x3d')]=_0xb043('0x3e');}else if(channels[_0x3ceb57[_0xb043('0x37')]][_0xb043('0x9')]=_0x3ceb57[_0xb043('0x3f')]){utils[_0xb043('0x7')](util[_0xb043('0x8')](_0xb043('0x3a'),_0x3ceb57[_0xb043('0x3b')],_0x3ceb57[_0xb043('0x37')],_0x3ceb57[_0xb043('0x40')]));channels[_0x3ceb57['localtwolinkedid']][_0xb043('0x26')]=_0x3ceb57[_0xb043('0x40')];channels[_0x3ceb57[_0xb043('0x37')]]['userfield']='_attended';}}}catch(_0x9f8c83){utils[_0xb043('0x1c')](util[_0xb043('0x8')](_0xb043('0x38'),_0x3ceb57[_0xb043('0x3b')]),_0x9f8c83);}};exports[_0xb043('0x41')]=function(_0x55ca3f){try{if(!_[_0xb043('0x1f')](channels[_0x55ca3f[_0xb043('0x6')]])){utils[_0xb043('0x16')](util[_0xb043('0x8')](_0xb043('0x42'),_0x55ca3f['uniqueid']),_0x55ca3f);channels[_0x55ca3f[_0xb043('0x6')]][_0xb043('0x43')]=utils[_0xb043('0x31')]();utils[_0xb043('0x7')](util[_0xb043('0x8')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x55ca3f[_0xb043('0x6')],channels[_0x55ca3f[_0xb043('0x6')]]['musiconholdstartAt']));}}catch(_0x5470a6){utils[_0xb043('0x1c')](util['format']('[%s][calls][musiconholdstart]',_0x55ca3f[_0xb043('0x6')]),_0x5470a6);}};exports[_0xb043('0x44')]=function(_0x3c157d){try{if(!_['isNil'](channels[_0x3c157d[_0xb043('0x6')]])){utils[_0xb043('0x16')](util[_0xb043('0x8')]('[%s][calls][musiconholdstop]',_0x3c157d[_0xb043('0x6')]),_0x3c157d);if(!_['isNil'](channels[_0x3c157d[_0xb043('0x6')]][_0xb043('0x43')])){channels[_0x3c157d[_0xb043('0x6')]][_0xb043('0x45')]+=utils[_0xb043('0x33')](utils[_0xb043('0x31')](),channels[_0x3c157d[_0xb043('0x6')]][_0xb043('0x43')]);utils[_0xb043('0x7')](util[_0xb043('0x8')](_0xb043('0x46'),_0x3c157d[_0xb043('0x6')],channels[_0x3c157d[_0xb043('0x6')]]['mohtime']));delete channels[_0x3c157d['uniqueid']][_0xb043('0x43')];}}}catch(_0x34202b){utils[_0xb043('0x1c')](util['format'](_0xb043('0x47'),_0x3c157d[_0xb043('0x6')]),_0x34202b);}};exports[_0xb043('0x48')]=function(_0x1e199d){try{if(!_['isNil'](channels[_0x1e199d[_0xb043('0x6')]])){utils[_0xb043('0x16')](util[_0xb043('0x8')](_0xb043('0x49'),_0x1e199d['uniqueid']),_0x1e199d);if(!_[_0xb043('0x1f')](_0x1e199d[_0xb043('0x4a')][_0xb043('0x4b')])){utils[_0xb043('0x7')](util[_0xb043('0x8')](_0xb043('0x4c'),_0x1e199d[_0xb043('0x6')],_0x1e199d[_0xb043('0x4d')]));channels[_0x1e199d['uniqueid']][_0xb043('0x4e')]=_0x1e199d['value'];}if(!_[_0xb043('0x1f')](_0x1e199d[_0xb043('0x4a')][_0xb043('0x4f')])){utils[_0xb043('0x7')](util[_0xb043('0x8')](_0xb043('0x50'),_0x1e199d['uniqueid'],_0x1e199d['value']));channels[_0x1e199d[_0xb043('0x6')]][_0xb043('0x51')]=_0x1e199d[_0xb043('0x4d')];channels[_0x1e199d[_0xb043('0x6')]]['callerid']='\x22'+_0x1e199d[_0xb043('0x4d')]+_0xb043('0x52')+_0x1e199d[_0xb043('0x4d')]+'>';}if(!_[_0xb043('0x1f')](_0x1e199d[_0xb043('0x4a')][_0xb043('0x53')])||!_[_0xb043('0x1f')](_0x1e199d[_0xb043('0x4a')][_0xb043('0x54')])){utils['info'](util['format'](_0xb043('0x55'),_0x1e199d[_0xb043('0x6')],!_[_0xb043('0x1f')](_0x1e199d['variable'][_0xb043('0x53')])?_0xb043('0x53'):_0xb043('0x54'),_0x1e199d[_0xb043('0x4d')]));channels[_0x1e199d[_0xb043('0x6')]]['callerid']=_0x1e199d['value'];}if(!_[_0xb043('0x1f')](_0x1e199d['variable'][_0xb043('0x56')])||!_['isNil'](_0x1e199d['variable']['xmcs-queue'])){utils['info'](util['format']('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x1e199d['uniqueid'],!_[_0xb043('0x1f')](_0x1e199d['variable'][_0xb043('0x56')])?_0xb043('0x56'):_0xb043('0x57'),_0x1e199d[_0xb043('0x4d')]));channels[_0x1e199d[_0xb043('0x6')]]['lastapplication']=_0xb043('0x58');channels[_0x1e199d[_0xb043('0x6')]][_0xb043('0x59')]=_0x1e199d[_0xb043('0x4d')];channels[_0x1e199d[_0xb043('0x6')]][_0xb043('0xa')]=!![];}if(!_[_0xb043('0x1f')](_0x1e199d['variable'][_0xb043('0x5a')])){utils[_0xb043('0x7')](util[_0xb043('0x8')](_0xb043('0x5b'),_0x1e199d[_0xb043('0x6')],_0x1e199d[_0xb043('0x4d')]));channels[_0x1e199d['uniqueid']]['ContactId']=_0x1e199d[_0xb043('0x4d')];}if(!_[_0xb043('0x1f')](_0x1e199d[_0xb043('0x4a')]['xmd-cdrtype'])){utils[_0xb043('0x7')](util[_0xb043('0x8')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x1e199d['uniqueid'],_0x1e199d[_0xb043('0x4d')]));channels[_0x1e199d[_0xb043('0x6')]][_0xb043('0x5c')]=_0x1e199d[_0xb043('0x4d')];}if(!_[_0xb043('0x1f')](_0x1e199d[_0xb043('0x4a')]['outboundrouteid'])){utils[_0xb043('0x7')](util[_0xb043('0x8')](_0xb043('0x5d'),_0x1e199d[_0xb043('0x6')],_0x1e199d[_0xb043('0x4d')]));channels[_0x1e199d[_0xb043('0x6')]]['routeid']=_0x1e199d[_0xb043('0x4d')];}if(!_[_0xb043('0x1f')](_0x1e199d[_0xb043('0x4a')][_0xb043('0x5e')])){utils[_0xb043('0x7')](util[_0xb043('0x8')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x1e199d[_0xb043('0x6')],_0x1e199d['value']));channels[_0x1e199d[_0xb043('0x6')]][_0xb043('0x5e')]=_0x1e199d[_0xb043('0x4d')];}}}catch(_0x2a2d53){utils[_0xb043('0x1c')](util[_0xb043('0x8')](_0xb043('0x49'),_0x1e199d[_0xb043('0x6')]),_0x2a2d53);}};exports[_0xb043('0x5f')]=function(_0x3a0070){try{if(!_['isNil'](channels[_0x3a0070[_0xb043('0x6')]])){utils['debug'](util[_0xb043('0x8')](_0xb043('0x60'),_0x3a0070[_0xb043('0x6')]),_0x3a0070);utils[_0xb043('0x7')](util['format'](_0xb043('0x61'),_0x3a0070[_0xb043('0x6')],_0x3a0070[_0xb043('0x62')],_0x3a0070[_0xb043('0x63')]));if(_0x3a0070[_0xb043('0x62')]['toLowerCase']()==_0xb043('0x64')&&_['startsWith'](_0x3a0070[_0xb043('0x63')][_0xb043('0x65')](),_0xb043('0x66'))){var _0x52339a=_0x3a0070[_0xb043('0x63')][_0xb043('0x67')]('=');var _0x13d168=_0x52339a[0x0]['substring'](_0x52339a[0x0][_0xb043('0x68')]('(')+0x1,_0x52339a[0x0]['lastIndexOf'](')'));var _0x583118=_0x52339a[0x1];channels[_0x3a0070['uniqueid']][_0x13d168]=_0x583118;}if(!_['includes']([_0xb043('0x2a'),_0xb043('0x69'),'execif',_0xb043('0x64'),_0xb043('0x6a')],_0x3a0070[_0xb043('0x62')][_0xb043('0x65')]())){channels[_0x3a0070[_0xb043('0x6')]][_0xb043('0x6b')]=_0x3a0070['application'];channels[_0x3a0070['uniqueid']][_0xb043('0x59')]=_0x3a0070['appdata'];}}}catch(_0x170705){utils[_0xb043('0x1c')](util[_0xb043('0x8')](_0xb043('0x60'),_0x3a0070[_0xb043('0x6')]),_0x170705);}};
\ No newline at end of file
+var _0x0958=['set','startsWith','appdata','toLowerCase','cdr','split','lastIndexOf','includes','hangup','execif','gotoif','lastdata','lodash','util','./utils','NO\x20ANSWER','FAILED','uniqueid','transfereeuniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','interface','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','blinds','recording','newchannel','[%s][calls][newchannel]','linkedid','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','newstate','debug','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','disposition','toNumber','[%s][calls][newstate]','[%s][calls][hangup]','callerid','calleridnum','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','duration','diffTime','endtime','starttime','billableseconds','answertime','attendedtransfer','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','_attended','transfertargetchannel','origtransfererchannel','userfield','[%s][calls][attendedtransfer]','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','[%s][calls][musiconholdstop]','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','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','type','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application'];(function(_0x5e4aaf,_0x4d38e2){var _0x2b4fcc=function(_0x531c6f){while(--_0x531c6f){_0x5e4aaf['push'](_0x5e4aaf['shift']());}};_0x2b4fcc(++_0x4d38e2);}(_0x0958,0x7c));var _0x8095=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0958[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x8095('0x0'));var util=require(_0x8095('0x1'));var utils=require(_0x8095('0x2'));var transfers=require('./transfers.controller');var dispositions=[_0x8095('0x3'),_0x8095('0x4'),'FAILED','NO\x20ANSWER',_0x8095('0x3'),_0x8095('0x3'),'ANSWERED','BUSY',_0x8095('0x4'),_0x8095('0x4'),_0x8095('0x4')];var channels={};function writeDB(_0x1dac39){var _0x1fac84;if(transfers['blinds'][_0x1dac39['uniqueid']]){_0x1fac84=_0x1dac39[_0x8095('0x5')];_0x1dac39[_0x8095('0x5')]=transfers['blinds'][_0x1dac39['uniqueid']][_0x8095('0x6')];}utils['info'](util[_0x8095('0x7')](_0x8095('0x8'),_0x1dac39[_0x8095('0x5')],_0x1dac39[_0x8095('0x9')],_0x1dac39[_0x8095('0xa')],_0x1dac39['membername'],_0x1dac39[_0x8095('0xb')],_0x1dac39['calleridnum'],_0x1dac39[_0x8095('0xc')],_0x1dac39[_0x8095('0xd')]));if(_0x1dac39[_0x8095('0xe')]){utils[_0x8095('0xf')](_0x1dac39[_0x8095('0xe')])[_0x8095('0x10')](function(_0x5cfc5f){if(_0x5cfc5f){_0x1dac39[_0x8095('0x11')]=_0x5cfc5f['id'];}utils[_0x8095('0x12')](_0x8095('0x13'),_0x1dac39);});}else{utils['request'](_0x8095('0x13'),_0x1dac39);}if(channels[_0x1dac39[_0x8095('0x5')]]){delete channels[_0x1dac39[_0x8095('0x5')]];}else if(_0x1fac84&&channels[_0x1fac84]){if(!transfers[_0x8095('0x14')][_0x1fac84][_0x8095('0x15')])delete transfers['blinds'][_0x1fac84];delete channels[_0x1fac84];}}exports[_0x8095('0x16')]=function(_0x463d6e){try{utils['debug'](util['format'](_0x8095('0x17'),_0x463d6e['uniqueid']),_0x463d6e);if(_0x463d6e[_0x8095('0x5')]==_0x463d6e[_0x8095('0x18')]&&_0x463d6e[_0x8095('0x9')]!='OutgoingSpoolFailed'){utils[_0x8095('0x19')](util[_0x8095('0x7')](_0x8095('0x1a'),_0x463d6e['uniqueid'],_0x463d6e[_0x8095('0x1b')],_0x463d6e[_0x8095('0x1c')]));channels[_0x463d6e[_0x8095('0x5')]]={'uniqueid':_0x463d6e['uniqueid'],'accountcode':_0x463d6e[_0x8095('0xe')],'source':_0x463d6e['calleridnum'],'destination':_0x463d6e[_0x8095('0x1c')],'destinationcontext':_0x463d6e[_0x8095('0x1b')],'channel':_0x463d6e[_0x8095('0x9')],'starttime':utils[_0x8095('0x1d')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x8095('0x3'),'amaflags':_0x8095('0x1e')};}}catch(_0x2a7bb6){utils[_0x8095('0x1f')](util[_0x8095('0x7')](_0x8095('0x17'),_0x463d6e[_0x8095('0x5')]),_0x2a7bb6);}};exports[_0x8095('0x20')]=function(_0x33397a){try{utils[_0x8095('0x21')](util['format']('[%s][calls][newstate]',_0x33397a[_0x8095('0x5')]),_0x33397a);if(!_[_0x8095('0x22')](channels[_0x33397a[_0x8095('0x5')]])&&_0x33397a[_0x8095('0x23')]==0x6){utils[_0x8095('0x19')](util[_0x8095('0x7')](_0x8095('0x24'),_0x33397a[_0x8095('0x5')],_0x33397a[_0x8095('0x1b')],_0x33397a[_0x8095('0x9')]));if(_[_0x8095('0x22')](channels[_0x33397a[_0x8095('0x5')]][_0x8095('0x25')])){channels[_0x33397a[_0x8095('0x5')]][_0x8095('0x25')]=utils[_0x8095('0x1d')]();}}else if(!_[_0x8095('0x22')](channels[_0x33397a[_0x8095('0x18')]])&&_0x33397a['channelstate']==0x6&&_0x33397a[_0x8095('0x1b')]!=_0x8095('0x26')){utils[_0x8095('0x19')](util[_0x8095('0x7')](_0x8095('0x27'),_0x33397a[_0x8095('0x5')],_0x33397a[_0x8095('0x18')],_0x33397a['context'],_0x33397a['channel']));channels[_0x33397a['linkedid']][_0x8095('0xe')]=_0x33397a['accountcode'];channels[_0x33397a[_0x8095('0x18')]][_0x8095('0x28')]=_0x33397a[_0x8095('0x9')];if(_[_0x8095('0x22')](channels[_0x33397a[_0x8095('0x18')]]['answertime'])){channels[_0x33397a['linkedid']]['answertime']=utils[_0x8095('0x1d')]();}channels[_0x33397a[_0x8095('0x18')]][_0x8095('0x29')]=dispositions[_[_0x8095('0x2a')](_0x33397a[_0x8095('0x23')])]||'ANSWERED';}}catch(_0xf83cdc){utils[_0x8095('0x1f')](util['format'](_0x8095('0x2b'),_0x33397a[_0x8095('0x5')]),_0xf83cdc);}};exports['hangup']=function(_0x6ce708){try{if(!_[_0x8095('0x22')](channels[_0x6ce708[_0x8095('0x5')]])){utils[_0x8095('0x21')](util['format'](_0x8095('0x2c'),_0x6ce708[_0x8095('0x5')]),_0x6ce708);if(_[_0x8095('0x22')](channels[_0x6ce708[_0x8095('0x5')]][_0x8095('0x2d')])){channels[_0x6ce708[_0x8095('0x5')]][_0x8095('0x2d')]=_0x6ce708['calleridname']+'\x20<'+_0x6ce708[_0x8095('0x2e')]+'>';}utils[_0x8095('0x19')](util['format'](_0x8095('0x2f'),_0x6ce708[_0x8095('0x5')],channels[_0x6ce708[_0x8095('0x5')]]['callerid'],_0x6ce708[_0x8095('0x30')]));channels[_0x6ce708[_0x8095('0x5')]]['endtime']=utils[_0x8095('0x1d')]();channels[_0x6ce708[_0x8095('0x5')]][_0x8095('0x31')]=utils[_0x8095('0x32')](channels[_0x6ce708['uniqueid']][_0x8095('0x33')],channels[_0x6ce708[_0x8095('0x5')]][_0x8095('0x34')]);channels[_0x6ce708[_0x8095('0x5')]][_0x8095('0x35')]=channels[_0x6ce708[_0x8095('0x5')]][_0x8095('0x36')]?utils['diffTime'](channels[_0x6ce708[_0x8095('0x5')]][_0x8095('0x33')],channels[_0x6ce708[_0x8095('0x5')]][_0x8095('0x36')]):0x0;writeDB(channels[_0x6ce708['uniqueid']]);}}catch(_0x202a0f){utils[_0x8095('0x1f')](util['format'](_0x8095('0x2c'),_0x6ce708['uniqueid']),_0x202a0f);}};exports[_0x8095('0x37')]=function(_0x2aeac2){try{if(!_[_0x8095('0x22')](channels[_0x2aeac2[_0x8095('0x38')]])){utils[_0x8095('0x21')](util['format']('[%s][calls][attendedtransfer]',_0x2aeac2['origtransfereruniqueid']),_0x2aeac2);if(channels[_0x2aeac2[_0x8095('0x38')]][_0x8095('0x9')]==_0x2aeac2[_0x8095('0x39')]){utils[_0x8095('0x19')](util[_0x8095('0x7')](_0x8095('0x3a'),_0x2aeac2[_0x8095('0x3b')],_0x2aeac2[_0x8095('0x38')],_0x2aeac2[_0x8095('0x3c')]));channels[_0x2aeac2[_0x8095('0x38')]][_0x8095('0x28')]=_0x2aeac2[_0x8095('0x3c')];channels[_0x2aeac2[_0x8095('0x38')]]['userfield']=_0x8095('0x3d');}else if(channels[_0x2aeac2[_0x8095('0x38')]]['channel']=_0x2aeac2[_0x8095('0x3e')]){utils['info'](util[_0x8095('0x7')](_0x8095('0x3a'),_0x2aeac2[_0x8095('0x3b')],_0x2aeac2[_0x8095('0x38')],_0x2aeac2[_0x8095('0x3f')]));channels[_0x2aeac2[_0x8095('0x38')]][_0x8095('0x28')]=_0x2aeac2[_0x8095('0x3f')];channels[_0x2aeac2['localtwolinkedid']][_0x8095('0x40')]=_0x8095('0x3d');}}}catch(_0x27d78f){utils[_0x8095('0x1f')](util[_0x8095('0x7')](_0x8095('0x41'),_0x2aeac2[_0x8095('0x3b')]),_0x27d78f);}};exports[_0x8095('0x42')]=function(_0x2893aa){try{if(!_[_0x8095('0x22')](channels[_0x2893aa[_0x8095('0x5')]])){utils[_0x8095('0x21')](util['format'](_0x8095('0x43'),_0x2893aa['uniqueid']),_0x2893aa);channels[_0x2893aa['uniqueid']][_0x8095('0x44')]=utils[_0x8095('0x1d')]();utils['info'](util['format'](_0x8095('0x45'),_0x2893aa[_0x8095('0x5')],channels[_0x2893aa['uniqueid']][_0x8095('0x44')]));}}catch(_0x238962){utils[_0x8095('0x1f')](util[_0x8095('0x7')](_0x8095('0x43'),_0x2893aa[_0x8095('0x5')]),_0x238962);}};exports[_0x8095('0x46')]=function(_0x5e6764){try{if(!_['isNil'](channels[_0x5e6764[_0x8095('0x5')]])){utils['debug'](util[_0x8095('0x7')]('[%s][calls][musiconholdstop]',_0x5e6764[_0x8095('0x5')]),_0x5e6764);if(!_[_0x8095('0x22')](channels[_0x5e6764['uniqueid']][_0x8095('0x44')])){channels[_0x5e6764[_0x8095('0x5')]]['mohtime']+=utils[_0x8095('0x32')](utils['now'](),channels[_0x5e6764[_0x8095('0x5')]]['musiconholdstartAt']);utils[_0x8095('0x19')](util[_0x8095('0x7')](_0x8095('0x47'),_0x5e6764[_0x8095('0x5')],channels[_0x5e6764[_0x8095('0x5')]][_0x8095('0x48')]));delete channels[_0x5e6764['uniqueid']][_0x8095('0x44')];}}}catch(_0x33fec2){utils[_0x8095('0x1f')](util[_0x8095('0x7')](_0x8095('0x49'),_0x5e6764['uniqueid']),_0x33fec2);}};exports[_0x8095('0x4a')]=function(_0x3f80c0){try{if(!_[_0x8095('0x22')](channels[_0x3f80c0[_0x8095('0x5')]])){utils[_0x8095('0x21')](util['format'](_0x8095('0x4b'),_0x3f80c0['uniqueid']),_0x3f80c0);if(!_[_0x8095('0x22')](_0x3f80c0['variable']['xmd-originatecalleridnum'])){utils[_0x8095('0x19')](util[_0x8095('0x7')](_0x8095('0x4c'),_0x3f80c0[_0x8095('0x5')],_0x3f80c0[_0x8095('0x4d')]));channels[_0x3f80c0[_0x8095('0x5')]]['source']=_0x3f80c0[_0x8095('0x4d')];}if(!_[_0x8095('0x22')](_0x3f80c0[_0x8095('0x4e')][_0x8095('0x4f')])){utils['info'](util[_0x8095('0x7')](_0x8095('0x50'),_0x3f80c0['uniqueid'],_0x3f80c0[_0x8095('0x4d')]));channels[_0x3f80c0[_0x8095('0x5')]][_0x8095('0x51')]=_0x3f80c0[_0x8095('0x4d')];channels[_0x3f80c0[_0x8095('0x5')]][_0x8095('0x2d')]='\x22'+_0x3f80c0[_0x8095('0x4d')]+_0x8095('0x52')+_0x3f80c0[_0x8095('0x4d')]+'>';}if(!_[_0x8095('0x22')](_0x3f80c0[_0x8095('0x4e')][_0x8095('0x53')])||!_[_0x8095('0x22')](_0x3f80c0[_0x8095('0x4e')][_0x8095('0x54')])){utils[_0x8095('0x19')](util[_0x8095('0x7')](_0x8095('0x55'),_0x3f80c0[_0x8095('0x5')],!_[_0x8095('0x22')](_0x3f80c0[_0x8095('0x4e')][_0x8095('0x53')])?_0x8095('0x53'):_0x8095('0x54'),_0x3f80c0[_0x8095('0x4d')]));channels[_0x3f80c0['uniqueid']][_0x8095('0x2d')]=_0x3f80c0['value'];}if(!_[_0x8095('0x22')](_0x3f80c0[_0x8095('0x4e')][_0x8095('0x56')])||!_['isNil'](_0x3f80c0[_0x8095('0x4e')][_0x8095('0x57')])){utils['info'](util[_0x8095('0x7')](_0x8095('0x55'),_0x3f80c0[_0x8095('0x5')],!_[_0x8095('0x22')](_0x3f80c0['variable'][_0x8095('0x56')])?_0x8095('0x56'):'xmcs-queue',_0x3f80c0[_0x8095('0x4d')]));channels[_0x3f80c0[_0x8095('0x5')]][_0x8095('0x58')]='Queue';channels[_0x3f80c0['uniqueid']]['lastdata']=_0x3f80c0[_0x8095('0x4d')];channels[_0x3f80c0[_0x8095('0x5')]][_0x8095('0xa')]=!![];}if(!_['isNil'](_0x3f80c0[_0x8095('0x4e')][_0x8095('0x59')])){utils['info'](util[_0x8095('0x7')](_0x8095('0x5a'),_0x3f80c0['uniqueid'],_0x3f80c0[_0x8095('0x4d')]));channels[_0x3f80c0['uniqueid']][_0x8095('0x5b')]=_0x3f80c0[_0x8095('0x4d')];}if(!_[_0x8095('0x22')](_0x3f80c0[_0x8095('0x4e')][_0x8095('0x5c')])){utils[_0x8095('0x19')](util['format']('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x3f80c0[_0x8095('0x5')],_0x3f80c0[_0x8095('0x4d')]));channels[_0x3f80c0[_0x8095('0x5')]][_0x8095('0x5d')]=_0x3f80c0[_0x8095('0x4d')];}if(!_['isNil'](_0x3f80c0[_0x8095('0x4e')]['outboundrouteid'])){utils['info'](util[_0x8095('0x7')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x3f80c0[_0x8095('0x5')],_0x3f80c0['value']));channels[_0x3f80c0[_0x8095('0x5')]][_0x8095('0x5e')]=_0x3f80c0[_0x8095('0x4d')];}if(!_[_0x8095('0x22')](_0x3f80c0[_0x8095('0x4e')]['sipcallid'])){utils[_0x8095('0x19')](util[_0x8095('0x7')](_0x8095('0x5f'),_0x3f80c0['uniqueid'],_0x3f80c0[_0x8095('0x4d')]));channels[_0x3f80c0[_0x8095('0x5')]][_0x8095('0x60')]=_0x3f80c0['value'];}}}catch(_0x17a5c6){utils['error'](util[_0x8095('0x7')]('[%s][calls][varset]',_0x3f80c0['uniqueid']),_0x17a5c6);}};exports['newexten']=function(_0x48840a){try{if(!_[_0x8095('0x22')](channels[_0x48840a[_0x8095('0x5')]])){utils[_0x8095('0x21')](util[_0x8095('0x7')](_0x8095('0x61'),_0x48840a[_0x8095('0x5')]),_0x48840a);utils[_0x8095('0x19')](util[_0x8095('0x7')](_0x8095('0x62'),_0x48840a['uniqueid'],_0x48840a['application'],_0x48840a['appdata']));if(_0x48840a[_0x8095('0x63')]['toLowerCase']()==_0x8095('0x64')&&_[_0x8095('0x65')](_0x48840a[_0x8095('0x66')][_0x8095('0x67')](),_0x8095('0x68'))){var _0x103a10=_0x48840a[_0x8095('0x66')][_0x8095('0x69')]('=');var _0x44019e=_0x103a10[0x0]['substring'](_0x103a10[0x0][_0x8095('0x6a')]('(')+0x1,_0x103a10[0x0][_0x8095('0x6a')](')'));var _0x501785=_0x103a10[0x1];channels[_0x48840a[_0x8095('0x5')]][_0x44019e]=_0x501785;}if(!_[_0x8095('0x6b')]([_0x8095('0x6c'),'noop',_0x8095('0x6d'),_0x8095('0x64'),_0x8095('0x6e')],_0x48840a[_0x8095('0x63')]['toLowerCase']())){channels[_0x48840a[_0x8095('0x5')]]['lastapplication']=_0x48840a['application'];channels[_0x48840a[_0x8095('0x5')]][_0x8095('0x6f')]=_0x48840a[_0x8095('0x66')];}}}catch(_0x4a1427){utils[_0x8095('0x1f')](util[_0x8095('0x7')](_0x8095('0x61'),_0x48840a[_0x8095('0x5')]),_0x4a1427);}};
\ No newline at end of file
index b503290..faee089 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0043=['[core]\x20fullybooted','error','close','[core]\x20close','managerevent','./utils','connect','[core]\x20connected','shutdown','info'];(function(_0x559d15,_0x494984){var _0x5b581d=function(_0x18a577){while(--_0x18a577){_0x559d15['push'](_0x559d15['shift']());}};_0x5b581d(++_0x494984);}(_0x0043,0x1e5));var _0x3004=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0x0043[_0x381589];return _0x2a075d;};'use strict';var utils=require(_0x3004('0x0'));exports[_0x3004('0x1')]=function(){utils['info'](_0x3004('0x2'));};exports[_0x3004('0x3')]=function(){utils[_0x3004('0x4')]('[core]\x20shutdown');};exports['fullybooted']=function(){utils['info'](_0x3004('0x5'));};exports[_0x3004('0x6')]=function(_0x1fb285){utils['error']('[core]\x20error',_0x1fb285);};exports[_0x3004('0x7')]=function(){utils['info'](_0x3004('0x8'));};exports[_0x3004('0x9')]=function(_0x24050c){};
\ No newline at end of file
+var _0x16d6=['[core]\x20error','[core]\x20close','./utils','info','[core]\x20connected','shutdown','[core]\x20shutdown','error'];(function(_0x12aeae,_0x3f7e2e){var _0x57fd7f=function(_0x54cfd0){while(--_0x54cfd0){_0x12aeae['push'](_0x12aeae['shift']());}};_0x57fd7f(++_0x3f7e2e);}(_0x16d6,0x192));var _0x616d=function(_0x263f9d,_0x3d854e){_0x263f9d=_0x263f9d-0x0;var _0x4c4efa=_0x16d6[_0x263f9d];return _0x4c4efa;};'use strict';var utils=require(_0x616d('0x0'));exports['connect']=function(){utils[_0x616d('0x1')](_0x616d('0x2'));};exports[_0x616d('0x3')]=function(){utils['info'](_0x616d('0x4'));};exports['fullybooted']=function(){utils[_0x616d('0x1')]('[core]\x20fullybooted');};exports[_0x616d('0x5')]=function(_0x9b083f){utils['error'](_0x616d('0x6'),_0x9b083f);};exports['close']=function(){utils[_0x616d('0x1')](_0x616d('0x7'));};exports['managerevent']=function(_0x291a01){};
\ No newline at end of file
index 403e54c..aba7d85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20ed=['newexten','debug','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','set','appdata','toLowerCase','cdr(routeid)','split','error','[%s][dials][newexten]','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','assign','starttime','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','ANSWER','answertime','now','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','diffTime','endtime','billableseconds','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x20ed,0x19c));var _0xd20e=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x20ed[_0x1a36a5];return _0x746243;};'use strict';var _=require('lodash');var util=require(_0xd20e('0x0'));var utils=require(_0xd20e('0x1'));var dials={};function writeDB(_0x10029c){utils[_0xd20e('0x2')](util[_0xd20e('0x3')](_0xd20e('0x4'),_0x10029c[_0xd20e('0x5')],_0x10029c['channel'],_0x10029c[_0xd20e('0x6')],_0x10029c[_0xd20e('0x7')],_0x10029c[_0xd20e('0x8')],_0x10029c[_0xd20e('0x9')]));utils[_0xd20e('0xa')](_0xd20e('0xb'),_0x10029c);delete dials[_0x10029c[_0xd20e('0x5')]];}exports[_0xd20e('0xc')]=function(_0x5831ed){try{utils[_0xd20e('0xd')](util[_0xd20e('0x3')]('[%s][dials][newexten]',_0x5831ed[_0xd20e('0x5')]),_0x5831ed);utils[_0xd20e('0x2')](util[_0xd20e('0x3')](_0xd20e('0xe'),_0x5831ed[_0xd20e('0x5')],_0x5831ed[_0xd20e('0xf')],_0x5831ed['appdata']));if(_0x5831ed[_0xd20e('0xf')]['toLowerCase']()==_0xd20e('0x10')&&_['startsWith'](_0x5831ed[_0xd20e('0x11')][_0xd20e('0x12')](),_0xd20e('0x13'))){var _0x11189a=_0x5831ed[_0xd20e('0x11')][_0xd20e('0x14')]('=');dials[_0x5831ed[_0xd20e('0x5')]]={'routeId':_0x11189a[0x1]};}}catch(_0x3237dc){utils[_0xd20e('0x15')](util[_0xd20e('0x3')](_0xd20e('0x16'),_0x5831ed[_0xd20e('0x5')]),_0x3237dc);}};exports[_0xd20e('0x17')]=function(_0x135dfc){try{utils['debug'](util[_0xd20e('0x3')](_0xd20e('0x18'),_0x135dfc[_0xd20e('0x5')]),_0x135dfc);if(!_[_0xd20e('0x19')](_0x135dfc[_0xd20e('0x1a')][_0xd20e('0x1b')])){utils[_0xd20e('0x2')](util[_0xd20e('0x3')](_0xd20e('0x1c'),_0x135dfc['uniqueid'],_0x135dfc['value']));dials[_0x135dfc[_0xd20e('0x5')]]={'routeId':_0x135dfc[_0xd20e('0x1d')]};}}catch(_0x2a784d){utils[_0xd20e('0x15')](util[_0xd20e('0x3')](_0xd20e('0x18'),_0x135dfc['uniqueid']),_0x2a784d);}};exports[_0xd20e('0x1e')]=function(_0x4bff23){try{if(!_['isNil'](dials[_0x4bff23[_0xd20e('0x5')]])){utils['debug'](util['format'](_0xd20e('0x1f'),_0x4bff23['uniqueid']),_0x4bff23);dials[_0x4bff23[_0xd20e('0x5')]]=_[_0xd20e('0x20')](dials[_0x4bff23[_0xd20e('0x5')]],_0x4bff23);dials[_0x4bff23[_0xd20e('0x5')]][_0xd20e('0x21')]=utils['now']();dials[_0x4bff23['uniqueid']][_0xd20e('0x22')]=_0xd20e('0x23');utils[_0xd20e('0x2')](util[_0xd20e('0x3')](_0xd20e('0x24'),_0x4bff23[_0xd20e('0x5')],dials[_0x4bff23[_0xd20e('0x5')]][_0xd20e('0x21')]));}}catch(_0x5bea99){utils[_0xd20e('0x15')](util[_0xd20e('0x3')](_0xd20e('0x1f'),_0x4bff23[_0xd20e('0x5')]),_0x5bea99);}};exports['dialend']=function(_0x2c7756){try{if(!_[_0xd20e('0x19')](dials[_0x2c7756[_0xd20e('0x5')]])){utils['debug'](util[_0xd20e('0x3')]('[%s][dials][dialend]',_0x2c7756[_0xd20e('0x5')]),_0x2c7756);dials[_0x2c7756[_0xd20e('0x5')]]['dialstatus']=_0x2c7756[_0xd20e('0x9')];if(_0x2c7756[_0xd20e('0x9')]==_0xd20e('0x25')){dials[_0x2c7756['uniqueid']]=_['assign'](dials[_0x2c7756[_0xd20e('0x5')]],_0x2c7756);dials[_0x2c7756[_0xd20e('0x5')]][_0xd20e('0x26')]=utils[_0xd20e('0x27')]();dials[_0x2c7756[_0xd20e('0x5')]][_0xd20e('0x22')]=_0xd20e('0x28');utils[_0xd20e('0x2')](util[_0xd20e('0x3')](_0xd20e('0x29'),_0x2c7756['uniqueid'],_0x2c7756['dialstatus'],dials[_0x2c7756[_0xd20e('0x5')]][_0xd20e('0x26')]));}else{utils[_0xd20e('0x2')](util['format'](_0xd20e('0x2a'),_0x2c7756[_0xd20e('0x5')],_0x2c7756['dialstatus']));}}}catch(_0x441e36){utils[_0xd20e('0x15')](util[_0xd20e('0x3')](_0xd20e('0x2b'),_0x2c7756[_0xd20e('0x5')]),_0x441e36);}};exports[_0xd20e('0x2c')]=function(_0x4f8463){try{if(!_[_0xd20e('0x19')](dials[_0x4f8463[_0xd20e('0x5')]])){utils[_0xd20e('0xd')](util['format'](_0xd20e('0x2d'),_0x4f8463[_0xd20e('0x5')]),_0x4f8463);utils[_0xd20e('0x2')](util[_0xd20e('0x3')](_0xd20e('0x2e'),_0x4f8463[_0xd20e('0x5')],_0x4f8463[_0xd20e('0x7')],_0x4f8463[_0xd20e('0x2f')],_0x4f8463[_0xd20e('0x30')]));dials[_0x4f8463[_0xd20e('0x5')]]=_[_0xd20e('0x20')](dials[_0x4f8463['uniqueid']],{'endtime':utils[_0xd20e('0x27')](),'lastevent':_0xd20e('0x31')});dials[_0x4f8463[_0xd20e('0x5')]]['duration']=utils[_0xd20e('0x32')](dials[_0x4f8463[_0xd20e('0x5')]][_0xd20e('0x33')],dials[_0x4f8463['uniqueid']][_0xd20e('0x21')]);dials[_0x4f8463[_0xd20e('0x5')]]['holdtime']=utils['diffTime'](dials[_0x4f8463[_0xd20e('0x5')]][_0xd20e('0x26')]||dials[_0x4f8463[_0xd20e('0x5')]][_0xd20e('0x33')],dials[_0x4f8463[_0xd20e('0x5')]][_0xd20e('0x21')]);dials[_0x4f8463['uniqueid']][_0xd20e('0x34')]=dials[_0x4f8463['uniqueid']]['answertime']?utils['diffTime'](dials[_0x4f8463[_0xd20e('0x5')]][_0xd20e('0x33')],dials[_0x4f8463[_0xd20e('0x5')]][_0xd20e('0x26')]):0x0;writeDB(dials[_0x4f8463[_0xd20e('0x5')]]);}}catch(_0x255b27){utils[_0xd20e('0x15')](util[_0xd20e('0x3')](_0xd20e('0x2d'),_0x4f8463['uniqueid']),_0x255b27);}};
\ No newline at end of file
+var _0xe50a=['util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','uniqueid','application','appdata','toLowerCase','set','cdr(routeid)','error','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','complete','duration','diffTime','endtime','holdtime','billableseconds'];(function(_0x30fe27,_0x577a57){var _0x311f19=function(_0x4c6394){while(--_0x4c6394){_0x30fe27['push'](_0x30fe27['shift']());}};_0x311f19(++_0x577a57);}(_0xe50a,0xa2));var _0xae50=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xe50a[_0x92c450];return _0x2a9599;};'use strict';var _=require('lodash');var util=require(_0xae50('0x0'));var utils=require(_0xae50('0x1'));var dials={};function writeDB(_0x519b37){utils[_0xae50('0x2')](util[_0xae50('0x3')](_0xae50('0x4'),_0x519b37['uniqueid'],_0x519b37[_0xae50('0x5')],_0x519b37[_0xae50('0x6')],_0x519b37[_0xae50('0x7')],_0x519b37[_0xae50('0x8')],_0x519b37[_0xae50('0x9')]));utils[_0xae50('0xa')](_0xae50('0xb'),_0x519b37);delete dials[_0x519b37['uniqueid']];}exports[_0xae50('0xc')]=function(_0x1b2eaa){try{utils[_0xae50('0xd')](util[_0xae50('0x3')](_0xae50('0xe'),_0x1b2eaa['uniqueid']),_0x1b2eaa);utils[_0xae50('0x2')](util[_0xae50('0x3')](_0xae50('0xf'),_0x1b2eaa[_0xae50('0x10')],_0x1b2eaa[_0xae50('0x11')],_0x1b2eaa[_0xae50('0x12')]));if(_0x1b2eaa['application'][_0xae50('0x13')]()==_0xae50('0x14')&&_['startsWith'](_0x1b2eaa['appdata'][_0xae50('0x13')](),_0xae50('0x15'))){var _0x4da7db=_0x1b2eaa[_0xae50('0x12')]['split']('=');dials[_0x1b2eaa[_0xae50('0x10')]]={'routeId':_0x4da7db[0x1]};}}catch(_0x7c82ba){utils[_0xae50('0x16')](util['format'](_0xae50('0xe'),_0x1b2eaa[_0xae50('0x10')]),_0x7c82ba);}};exports[_0xae50('0x17')]=function(_0x17368c){try{utils['debug'](util[_0xae50('0x3')](_0xae50('0x18'),_0x17368c[_0xae50('0x10')]),_0x17368c);if(!_[_0xae50('0x19')](_0x17368c[_0xae50('0x1a')][_0xae50('0x1b')])){utils['info'](util[_0xae50('0x3')](_0xae50('0x1c'),_0x17368c[_0xae50('0x10')],_0x17368c[_0xae50('0x1d')]));dials[_0x17368c[_0xae50('0x10')]]={'routeId':_0x17368c[_0xae50('0x1d')]};}}catch(_0x320aef){utils[_0xae50('0x16')](util[_0xae50('0x3')](_0xae50('0x18'),_0x17368c[_0xae50('0x10')]),_0x320aef);}};exports[_0xae50('0x1e')]=function(_0x45ca2b){try{if(!_[_0xae50('0x19')](dials[_0x45ca2b['uniqueid']])){utils[_0xae50('0xd')](util[_0xae50('0x3')](_0xae50('0x1f'),_0x45ca2b[_0xae50('0x10')]),_0x45ca2b);dials[_0x45ca2b[_0xae50('0x10')]]=_[_0xae50('0x20')](dials[_0x45ca2b[_0xae50('0x10')]],_0x45ca2b);dials[_0x45ca2b[_0xae50('0x10')]][_0xae50('0x21')]=utils[_0xae50('0x22')]();dials[_0x45ca2b[_0xae50('0x10')]][_0xae50('0x23')]=_0xae50('0x24');utils[_0xae50('0x2')](util[_0xae50('0x3')](_0xae50('0x25'),_0x45ca2b[_0xae50('0x10')],dials[_0x45ca2b[_0xae50('0x10')]][_0xae50('0x21')]));}}catch(_0x44ea7d){utils[_0xae50('0x16')](util[_0xae50('0x3')]('[%s][dials][dialbegin]',_0x45ca2b['uniqueid']),_0x44ea7d);}};exports[_0xae50('0x26')]=function(_0x4dac83){try{if(!_[_0xae50('0x19')](dials[_0x4dac83[_0xae50('0x10')]])){utils[_0xae50('0xd')](util[_0xae50('0x3')](_0xae50('0x27'),_0x4dac83[_0xae50('0x10')]),_0x4dac83);dials[_0x4dac83['uniqueid']]['dialstatus']=_0x4dac83[_0xae50('0x9')];if(_0x4dac83[_0xae50('0x9')]==_0xae50('0x28')){dials[_0x4dac83[_0xae50('0x10')]]=_['assign'](dials[_0x4dac83[_0xae50('0x10')]],_0x4dac83);dials[_0x4dac83[_0xae50('0x10')]][_0xae50('0x29')]=utils[_0xae50('0x22')]();dials[_0x4dac83[_0xae50('0x10')]][_0xae50('0x23')]=_0xae50('0x2a');utils['info'](util[_0xae50('0x3')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x4dac83[_0xae50('0x10')],_0x4dac83['dialstatus'],dials[_0x4dac83['uniqueid']][_0xae50('0x29')]));}else{utils[_0xae50('0x2')](util['format'](_0xae50('0x2b'),_0x4dac83[_0xae50('0x10')],_0x4dac83[_0xae50('0x9')]));}}}catch(_0x3034d4){utils['error'](util[_0xae50('0x3')](_0xae50('0x27'),_0x4dac83[_0xae50('0x10')]),_0x3034d4);}};exports[_0xae50('0x2c')]=function(_0x571a58){try{if(!_['isNil'](dials[_0x571a58['uniqueid']])){utils[_0xae50('0xd')](util[_0xae50('0x3')](_0xae50('0x2d'),_0x571a58[_0xae50('0x10')]),_0x571a58);utils[_0xae50('0x2')](util[_0xae50('0x3')](_0xae50('0x2e'),_0x571a58[_0xae50('0x10')],_0x571a58[_0xae50('0x7')],_0x571a58['calleridname'],_0x571a58[_0xae50('0x2f')]));dials[_0x571a58['uniqueid']]=_[_0xae50('0x20')](dials[_0x571a58[_0xae50('0x10')]],{'endtime':utils[_0xae50('0x22')](),'lastevent':_0xae50('0x30')});dials[_0x571a58[_0xae50('0x10')]][_0xae50('0x31')]=utils[_0xae50('0x32')](dials[_0x571a58[_0xae50('0x10')]][_0xae50('0x33')],dials[_0x571a58[_0xae50('0x10')]][_0xae50('0x21')]);dials[_0x571a58[_0xae50('0x10')]][_0xae50('0x34')]=utils['diffTime'](dials[_0x571a58[_0xae50('0x10')]][_0xae50('0x29')]||dials[_0x571a58[_0xae50('0x10')]][_0xae50('0x33')],dials[_0x571a58[_0xae50('0x10')]][_0xae50('0x21')]);dials[_0x571a58[_0xae50('0x10')]][_0xae50('0x35')]=dials[_0x571a58[_0xae50('0x10')]][_0xae50('0x29')]?utils[_0xae50('0x32')](dials[_0x571a58[_0xae50('0x10')]][_0xae50('0x33')],dials[_0x571a58[_0xae50('0x10')]][_0xae50('0x29')]):0x0;writeDB(dials[_0x571a58[_0xae50('0x10')]]);}}catch(_0x3a669f){utils[_0xae50('0x16')](util[_0xae50('0x3')](_0xae50('0x2d'),_0x571a58['uniqueid']),_0x3a669f);}};
\ No newline at end of file
index 00ab5f1..f7c032a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x88f1=['uniqueid','agentcalled','[%s][index][agentringnoanswer]','[%s][index][agentconnect]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','[%s][index][queuecallerleave]','queuecallerleave','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','origtransfereruniqueid','[%s][index][varset]','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][dialbegin]','dialend','asterisk-manager','../../config/environment','util','xdr','disabled','env','production','local','asterisk','port','username','password','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./dials.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','[%s][index][devicestatechange]','devicestatechange','format','device','debug'];(function(_0x4ff6a8,_0x55b3b8){var _0x2371fe=function(_0x372fcd){while(--_0x372fcd){_0x4ff6a8['push'](_0x4ff6a8['shift']());}};_0x2371fe(++_0x55b3b8);}(_0x88f1,0x1f0));var _0x188f=function(_0x295512,_0x27a27b){_0x295512=_0x295512-0x0;var _0x3b020d=_0x88f1[_0x295512];return _0x3b020d;};var AsteriskManager=require(_0x188f('0x0'));var config=require(_0x188f('0x1'));var utils=require('./utils');var util=require(_0x188f('0x2'));var isXDREnabled=config[_0x188f('0x3')]&&config['xdr'][_0x188f('0x4')]?!config[_0x188f('0x3')][_0x188f('0x4')]:!![];var isProduction=config[_0x188f('0x5')]===_0x188f('0x6')||![];var isLocalAsterisk=config[_0x188f('0x3')]&&config[_0x188f('0x3')][_0x188f('0x7')]===!![]||![];var ami=new AsteriskManager(config[_0x188f('0x8')][_0x188f('0x9')],config[_0x188f('0x8')]['ip'],config['asterisk'][_0x188f('0xa')],config[_0x188f('0x8')][_0x188f('0xb')],!![]);ami[_0x188f('0xc')]();if(!isXDREnabled){utils[_0x188f('0xd')](_0x188f('0xe'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x188f('0xd')](_0x188f('0xf'));}else{var agents=require(_0x188f('0x10'));var calls=require(_0x188f('0x11'));var queues=require(_0x188f('0x12'));var recordings=require('./recordings.controller');var members=require('./members.controller');var dials=require(_0x188f('0x13'));var transfers=require('./transfers.controller');var core=require(_0x188f('0x14'));ami['on'](_0x188f('0x15'),core[_0x188f('0x15')]);ami['on'](_0x188f('0x16'),core['shutdown']);ami['on'](_0x188f('0x17'),core['fullybooted']);ami['on'](_0x188f('0x18'),core[_0x188f('0x18')]);ami['on'](_0x188f('0x19'),core['close']);ami['on'](_0x188f('0x1a'),core['managerevent']);ami['on']('devicestatechange',function(_0x6d0782){try{utils['debug'](util['format'](_0x188f('0x1b'),_0x6d0782['device']),_0x6d0782);members[_0x188f('0x1c')](_0x6d0782);}catch(_0x4ccfb7){utils[_0x188f('0x18')](util[_0x188f('0x1d')](_0x188f('0x1b'),_0x6d0782[_0x188f('0x1e')]),_0x4ccfb7);}});ami['on']('agentcalled',function(_0x3cca83){try{utils[_0x188f('0x1f')](util['format']('[%s][index][agentcalled]',_0x3cca83[_0x188f('0x20')]),_0x3cca83);agents[_0x188f('0x21')](_0x3cca83);}catch(_0x543470){utils[_0x188f('0x18')](util['format']('[%s][index][agentcalled]',_0x3cca83[_0x188f('0x20')]),_0x543470);}});ami['on']('agentringnoanswer',function(_0x3f4d3a){try{utils[_0x188f('0x1f')](util[_0x188f('0x1d')]('[%s][index][agentringnoanswer]',_0x3f4d3a[_0x188f('0x20')]),_0x3f4d3a);agents['agentringnoanswer'](_0x3f4d3a);}catch(_0x2d8c2){utils['error'](util[_0x188f('0x1d')](_0x188f('0x22'),_0x3f4d3a['uniqueid']),_0x2d8c2);}});ami['on']('agentconnect',function(_0x446507){try{utils['debug'](util[_0x188f('0x1d')](_0x188f('0x23'),_0x446507[_0x188f('0x20')]),_0x446507);agents[_0x188f('0x24')](_0x446507);queues[_0x188f('0x24')](_0x446507);}catch(_0x50b384){utils['error'](util[_0x188f('0x1d')]('[%s][index][agentconnect]',_0x446507[_0x188f('0x20')]),_0x50b384);}});ami['on'](_0x188f('0x25'),function(_0x121ff5){try{utils[_0x188f('0x1f')](util[_0x188f('0x1d')]('[%s][index][agentcomplete]',_0x121ff5[_0x188f('0x20')]),_0x121ff5);agents['agentcomplete'](_0x121ff5);queues['agentcomplete'](_0x121ff5);members[_0x188f('0x25')](_0x121ff5);}catch(_0x3f3d6d){utils[_0x188f('0x18')](util[_0x188f('0x1d')](_0x188f('0x26'),_0x121ff5['uniqueid']),_0x3f3d6d);}});ami['on'](_0x188f('0x27'),function(_0x279bb2){try{utils['debug'](util[_0x188f('0x1d')](_0x188f('0x28'),_0x279bb2[_0x188f('0x20')]),_0x279bb2);agents[_0x188f('0x27')](_0x279bb2);queues[_0x188f('0x27')](_0x279bb2);}catch(_0x26ebff){utils['error'](util[_0x188f('0x1d')]('[%s][index][queuecallerabandon]',_0x279bb2[_0x188f('0x20')]),_0x26ebff);}});ami['on'](_0x188f('0x29'),function(_0x3bd58f){try{utils[_0x188f('0x1f')](util[_0x188f('0x1d')](_0x188f('0x2a'),_0x3bd58f['uniqueid']),_0x3bd58f);queues[_0x188f('0x29')](_0x3bd58f);recordings[_0x188f('0x29')](_0x3bd58f);}catch(_0x37e414){utils[_0x188f('0x18')](util[_0x188f('0x1d')](_0x188f('0x2a'),_0x3bd58f['uniqueid']),_0x37e414);}});ami['on']('queuecallerleave',function(_0x46c77c){try{utils['debug'](util['format'](_0x188f('0x2b'),_0x46c77c[_0x188f('0x20')]),_0x46c77c);queues[_0x188f('0x2c')](_0x46c77c);}catch(_0x3e90e9){utils[_0x188f('0x18')](util['format'](_0x188f('0x2b'),_0x46c77c[_0x188f('0x20')]),_0x3e90e9);}});ami['on'](_0x188f('0x2d'),function(_0x23ea17){try{utils[_0x188f('0x1f')](util[_0x188f('0x1d')](_0x188f('0x2e'),_0x23ea17['uniqueid']),_0x23ea17);queues['musiconholdstart'](_0x23ea17);calls[_0x188f('0x2d')](_0x23ea17);}catch(_0x505e33){utils['error'](util['format'](_0x188f('0x2e'),_0x23ea17[_0x188f('0x20')]),_0x505e33);}});ami['on']('musiconholdstop',function(_0x58ab8a){try{utils[_0x188f('0x1f')](util[_0x188f('0x1d')](_0x188f('0x2f'),_0x58ab8a[_0x188f('0x20')]),_0x58ab8a);queues[_0x188f('0x30')](_0x58ab8a);calls[_0x188f('0x30')](_0x58ab8a);}catch(_0x4c539f){utils[_0x188f('0x18')](util[_0x188f('0x1d')](_0x188f('0x2f'),_0x58ab8a[_0x188f('0x20')]),_0x4c539f);}});ami['on'](_0x188f('0x31'),function(_0x16297d){try{utils[_0x188f('0x1f')](util[_0x188f('0x1d')](_0x188f('0x32'),_0x16297d[_0x188f('0x20')]),_0x16297d);calls[_0x188f('0x31')](_0x16297d);recordings['newstate'](_0x16297d);}catch(_0x3471d2){utils['error'](util[_0x188f('0x1d')]('[%s][index][newstate]',_0x16297d[_0x188f('0x20')]),_0x3471d2);}});ami['on'](_0x188f('0x33'),function(_0x478ab9){try{utils[_0x188f('0x1f')](util[_0x188f('0x1d')](_0x188f('0x34'),_0x478ab9['uniqueid']),_0x478ab9);calls[_0x188f('0x33')](_0x478ab9);recordings[_0x188f('0x33')](_0x478ab9);dials[_0x188f('0x33')](_0x478ab9);agents[_0x188f('0x33')](_0x478ab9);queues['hangup'](_0x478ab9);}catch(_0xe056ca){utils[_0x188f('0x18')](util[_0x188f('0x1d')](_0x188f('0x34'),_0x478ab9['uniqueid']),_0xe056ca);}});ami['on'](_0x188f('0x35'),function(_0x5184e1){try{utils['debug'](util[_0x188f('0x1d')](_0x188f('0x36'),_0x5184e1[_0x188f('0x20')]),_0x5184e1);members['cdr'](_0x5184e1);}catch(_0x518786){utils[_0x188f('0x18')](util[_0x188f('0x1d')]('[%s][index][cdr]',_0x5184e1[_0x188f('0x20')]),_0x518786);}});ami['on']('blindtransfer',function(_0x133dd2){try{utils[_0x188f('0x1f')](util['format'](_0x188f('0x37'),_0x133dd2[_0x188f('0x20')]),_0x133dd2);queues['blindtransfer'](_0x133dd2);agents[_0x188f('0x38')](_0x133dd2);transfers[_0x188f('0x38')](_0x133dd2);recordings[_0x188f('0x38')](_0x133dd2);}catch(_0x3cab77){utils[_0x188f('0x18')](util['format'](_0x188f('0x37'),_0x133dd2[_0x188f('0x20')]),_0x3cab77);}});ami['on'](_0x188f('0x39'),function(_0xdce9c4){try{utils[_0x188f('0x1f')](util[_0x188f('0x1d')]('[%s][index][attendedtransfer]',_0xdce9c4[_0x188f('0x3a')]),_0xdce9c4);queues[_0x188f('0x39')](_0xdce9c4);transfers[_0x188f('0x39')](_0xdce9c4);agents[_0x188f('0x39')](_0xdce9c4);calls['attendedtransfer'](_0xdce9c4);}catch(_0x54ce05){utils[_0x188f('0x18')](util[_0x188f('0x1d')]('[%s][index][attendedtransfer]',_0xdce9c4[_0x188f('0x3a')]),_0x54ce05);}});ami['on']('varset',function(_0x1b2575){try{utils[_0x188f('0x1f')](util[_0x188f('0x1d')](_0x188f('0x3b'),_0x1b2575['uniqueid']),_0x1b2575);queues[_0x188f('0x3c')](_0x1b2575);recordings[_0x188f('0x3c')](_0x1b2575);calls[_0x188f('0x3c')](_0x1b2575);dials['varset'](_0x1b2575);}catch(_0x2364ff){utils[_0x188f('0x18')](util['format'](_0x188f('0x3b'),_0x1b2575[_0x188f('0x20')]),_0x2364ff);}});ami['on'](_0x188f('0x3d'),function(_0x218c76){try{utils[_0x188f('0x1f')](util[_0x188f('0x1d')]('[%s][index][newexten]',_0x218c76[_0x188f('0x20')]),_0x218c76);calls['newexten'](_0x218c76);recordings['newexten'](_0x218c76);dials[_0x188f('0x3d')](_0x218c76);}catch(_0x98a8b5){utils[_0x188f('0x18')](util[_0x188f('0x1d')](_0x188f('0x3e'),_0x218c76['uniqueid']),_0x98a8b5);}});ami['on']('newchannel',function(_0x15c4d7){try{utils['debug'](util['format']('[%s][index][newchannel]',_0x15c4d7[_0x188f('0x20')]),_0x15c4d7);calls[_0x188f('0x3f')](_0x15c4d7);recordings[_0x188f('0x3f')](_0x15c4d7);}catch(_0x200807){utils['error'](util[_0x188f('0x1d')]('[%s][index][newchannel]',_0x15c4d7[_0x188f('0x20')]),_0x200807);}});ami['on']('dialbegin',function(_0x1e5361){try{utils[_0x188f('0x1f')](util[_0x188f('0x1d')](_0x188f('0x40'),_0x1e5361[_0x188f('0x20')]),_0x1e5361);dials['dialbegin'](_0x1e5361);}catch(_0x5bf013){utils[_0x188f('0x18')](util[_0x188f('0x1d')]('[%s]dialbegin',_0x1e5361['uniqueid']),_0x5bf013);}});ami['on'](_0x188f('0x41'),function(_0x238353){try{utils[_0x188f('0x1f')](util[_0x188f('0x1d')]('[%s][index][dialend]',_0x238353[_0x188f('0x20')]),_0x238353);dials['dialend'](_0x238353);}catch(_0x8b13ee){utils[_0x188f('0x18')](util[_0x188f('0x1d')]('[%s][index][dialend]',_0x238353[_0x188f('0x20')]),_0x8b13ee);}});}
\ No newline at end of file
+var _0xeeb8=['[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','[%s][index][newchannel]','newchannel','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','./utils','util','disabled','env','production','xdr','asterisk','username','password','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','agentcalled','uniqueid','[%s][index][agentcalled]','agentringnoanswer','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstart','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xeeb8,0x16b));var _0x8eeb=function(_0x45eaf4,_0x6a56b7){_0x45eaf4=_0x45eaf4-0x0;var _0x5bb375=_0xeeb8[_0x45eaf4];return _0x5bb375;};var AsteriskManager=require(_0x8eeb('0x0'));var config=require('../../config/environment');var utils=require(_0x8eeb('0x1'));var util=require(_0x8eeb('0x2'));var isXDREnabled=config['xdr']&&config['xdr'][_0x8eeb('0x3')]?!config['xdr'][_0x8eeb('0x3')]:!![];var isProduction=config[_0x8eeb('0x4')]===_0x8eeb('0x5')||![];var isLocalAsterisk=config['xdr']&&config[_0x8eeb('0x6')]['local']===!![]||![];var ami=new AsteriskManager(config[_0x8eeb('0x7')]['port'],config[_0x8eeb('0x7')]['ip'],config['asterisk'][_0x8eeb('0x8')],config['asterisk'][_0x8eeb('0x9')],!![]);ami['keepConnected']();if(!isXDREnabled){utils[_0x8eeb('0xa')](_0x8eeb('0xb'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x8eeb('0xa')](_0x8eeb('0xc'));}else{var agents=require(_0x8eeb('0xd'));var calls=require(_0x8eeb('0xe'));var queues=require(_0x8eeb('0xf'));var recordings=require(_0x8eeb('0x10'));var members=require(_0x8eeb('0x11'));var dials=require('./dials.controller');var transfers=require(_0x8eeb('0x12'));var core=require(_0x8eeb('0x13'));ami['on'](_0x8eeb('0x14'),core[_0x8eeb('0x14')]);ami['on'](_0x8eeb('0x15'),core[_0x8eeb('0x15')]);ami['on'](_0x8eeb('0x16'),core[_0x8eeb('0x16')]);ami['on']('error',core[_0x8eeb('0x17')]);ami['on'](_0x8eeb('0x18'),core[_0x8eeb('0x18')]);ami['on'](_0x8eeb('0x19'),core[_0x8eeb('0x19')]);ami['on'](_0x8eeb('0x1a'),function(_0x37931f){try{utils[_0x8eeb('0x1b')](util[_0x8eeb('0x1c')]('[%s][index][devicestatechange]',_0x37931f['device']),_0x37931f);members['devicestatechange'](_0x37931f);}catch(_0x5f0fc0){utils[_0x8eeb('0x17')](util[_0x8eeb('0x1c')](_0x8eeb('0x1d'),_0x37931f['device']),_0x5f0fc0);}});ami['on'](_0x8eeb('0x1e'),function(_0x5101fb){try{utils[_0x8eeb('0x1b')](util[_0x8eeb('0x1c')]('[%s][index][agentcalled]',_0x5101fb[_0x8eeb('0x1f')]),_0x5101fb);agents['agentcalled'](_0x5101fb);}catch(_0x450f04){utils[_0x8eeb('0x17')](util['format'](_0x8eeb('0x20'),_0x5101fb[_0x8eeb('0x1f')]),_0x450f04);}});ami['on'](_0x8eeb('0x21'),function(_0x15f113){try{utils['debug'](util[_0x8eeb('0x1c')]('[%s][index][agentringnoanswer]',_0x15f113[_0x8eeb('0x1f')]),_0x15f113);agents[_0x8eeb('0x21')](_0x15f113);}catch(_0x12f148){utils[_0x8eeb('0x17')](util['format']('[%s][index][agentringnoanswer]',_0x15f113['uniqueid']),_0x12f148);}});ami['on'](_0x8eeb('0x22'),function(_0x2aa687){try{utils[_0x8eeb('0x1b')](util['format']('[%s][index][agentconnect]',_0x2aa687[_0x8eeb('0x1f')]),_0x2aa687);agents[_0x8eeb('0x22')](_0x2aa687);queues[_0x8eeb('0x22')](_0x2aa687);}catch(_0x754048){utils[_0x8eeb('0x17')](util[_0x8eeb('0x1c')](_0x8eeb('0x23'),_0x2aa687[_0x8eeb('0x1f')]),_0x754048);}});ami['on'](_0x8eeb('0x24'),function(_0x725d2f){try{utils[_0x8eeb('0x1b')](util[_0x8eeb('0x1c')]('[%s][index][agentcomplete]',_0x725d2f['uniqueid']),_0x725d2f);agents[_0x8eeb('0x24')](_0x725d2f);queues[_0x8eeb('0x24')](_0x725d2f);members[_0x8eeb('0x24')](_0x725d2f);}catch(_0x59965d){utils[_0x8eeb('0x17')](util[_0x8eeb('0x1c')](_0x8eeb('0x25'),_0x725d2f[_0x8eeb('0x1f')]),_0x59965d);}});ami['on'](_0x8eeb('0x26'),function(_0x616598){try{utils[_0x8eeb('0x1b')](util['format']('[%s][index][queuecallerabandon]',_0x616598['uniqueid']),_0x616598);agents[_0x8eeb('0x26')](_0x616598);queues['queuecallerabandon'](_0x616598);}catch(_0x3bc127){utils[_0x8eeb('0x17')](util[_0x8eeb('0x1c')](_0x8eeb('0x27'),_0x616598[_0x8eeb('0x1f')]),_0x3bc127);}});ami['on'](_0x8eeb('0x28'),function(_0x3da7fa){try{utils[_0x8eeb('0x1b')](util[_0x8eeb('0x1c')](_0x8eeb('0x29'),_0x3da7fa['uniqueid']),_0x3da7fa);queues[_0x8eeb('0x28')](_0x3da7fa);recordings[_0x8eeb('0x28')](_0x3da7fa);}catch(_0x1f59ec){utils[_0x8eeb('0x17')](util[_0x8eeb('0x1c')](_0x8eeb('0x29'),_0x3da7fa['uniqueid']),_0x1f59ec);}});ami['on'](_0x8eeb('0x2a'),function(_0x41e959){try{utils['debug'](util[_0x8eeb('0x1c')]('[%s][index][queuecallerleave]',_0x41e959['uniqueid']),_0x41e959);queues[_0x8eeb('0x2a')](_0x41e959);}catch(_0x303c25){utils[_0x8eeb('0x17')](util[_0x8eeb('0x1c')](_0x8eeb('0x2b'),_0x41e959[_0x8eeb('0x1f')]),_0x303c25);}});ami['on']('musiconholdstart',function(_0x1a4f79){try{utils['debug'](util['format'](_0x8eeb('0x2c'),_0x1a4f79['uniqueid']),_0x1a4f79);queues['musiconholdstart'](_0x1a4f79);calls[_0x8eeb('0x2d')](_0x1a4f79);}catch(_0x2b645e){utils[_0x8eeb('0x17')](util[_0x8eeb('0x1c')](_0x8eeb('0x2c'),_0x1a4f79[_0x8eeb('0x1f')]),_0x2b645e);}});ami['on']('musiconholdstop',function(_0x4bac27){try{utils[_0x8eeb('0x1b')](util['format'](_0x8eeb('0x2e'),_0x4bac27[_0x8eeb('0x1f')]),_0x4bac27);queues[_0x8eeb('0x2f')](_0x4bac27);calls[_0x8eeb('0x2f')](_0x4bac27);}catch(_0x38202c){utils[_0x8eeb('0x17')](util['format'](_0x8eeb('0x2e'),_0x4bac27[_0x8eeb('0x1f')]),_0x38202c);}});ami['on'](_0x8eeb('0x30'),function(_0xd1c7c8){try{utils['debug'](util[_0x8eeb('0x1c')](_0x8eeb('0x31'),_0xd1c7c8[_0x8eeb('0x1f')]),_0xd1c7c8);calls[_0x8eeb('0x30')](_0xd1c7c8);recordings[_0x8eeb('0x30')](_0xd1c7c8);}catch(_0x1e8e59){utils[_0x8eeb('0x17')](util[_0x8eeb('0x1c')]('[%s][index][newstate]',_0xd1c7c8[_0x8eeb('0x1f')]),_0x1e8e59);}});ami['on'](_0x8eeb('0x32'),function(_0x127686){try{utils[_0x8eeb('0x1b')](util['format'](_0x8eeb('0x33'),_0x127686[_0x8eeb('0x1f')]),_0x127686);calls[_0x8eeb('0x32')](_0x127686);recordings['hangup'](_0x127686);dials['hangup'](_0x127686);agents[_0x8eeb('0x32')](_0x127686);queues[_0x8eeb('0x32')](_0x127686);}catch(_0x2bb6f2){utils['error'](util[_0x8eeb('0x1c')](_0x8eeb('0x33'),_0x127686[_0x8eeb('0x1f')]),_0x2bb6f2);}});ami['on'](_0x8eeb('0x34'),function(_0xfab70e){try{utils[_0x8eeb('0x1b')](util[_0x8eeb('0x1c')](_0x8eeb('0x35'),_0xfab70e[_0x8eeb('0x1f')]),_0xfab70e);members[_0x8eeb('0x34')](_0xfab70e);}catch(_0x45349c){utils['error'](util[_0x8eeb('0x1c')]('[%s][index][cdr]',_0xfab70e[_0x8eeb('0x1f')]),_0x45349c);}});ami['on'](_0x8eeb('0x36'),function(_0x223c3d){try{utils[_0x8eeb('0x1b')](util[_0x8eeb('0x1c')](_0x8eeb('0x37'),_0x223c3d[_0x8eeb('0x1f')]),_0x223c3d);queues[_0x8eeb('0x36')](_0x223c3d);agents[_0x8eeb('0x36')](_0x223c3d);transfers[_0x8eeb('0x36')](_0x223c3d);recordings[_0x8eeb('0x36')](_0x223c3d);}catch(_0x2ce7d3){utils[_0x8eeb('0x17')](util[_0x8eeb('0x1c')](_0x8eeb('0x37'),_0x223c3d[_0x8eeb('0x1f')]),_0x2ce7d3);}});ami['on'](_0x8eeb('0x38'),function(_0x4eedff){try{utils['debug'](util['format'](_0x8eeb('0x39'),_0x4eedff[_0x8eeb('0x3a')]),_0x4eedff);queues[_0x8eeb('0x38')](_0x4eedff);transfers[_0x8eeb('0x38')](_0x4eedff);agents['attendedtransfer'](_0x4eedff);calls[_0x8eeb('0x38')](_0x4eedff);}catch(_0x25151e){utils['error'](util[_0x8eeb('0x1c')]('[%s][index][attendedtransfer]',_0x4eedff['origtransfereruniqueid']),_0x25151e);}});ami['on']('varset',function(_0x3dbd54){try{utils[_0x8eeb('0x1b')](util['format']('[%s][index][varset]',_0x3dbd54[_0x8eeb('0x1f')]),_0x3dbd54);queues['varset'](_0x3dbd54);recordings[_0x8eeb('0x3b')](_0x3dbd54);calls['varset'](_0x3dbd54);dials[_0x8eeb('0x3b')](_0x3dbd54);}catch(_0xebc7cf){utils['error'](util['format'](_0x8eeb('0x3c'),_0x3dbd54['uniqueid']),_0xebc7cf);}});ami['on'](_0x8eeb('0x3d'),function(_0x588ea3){try{utils[_0x8eeb('0x1b')](util[_0x8eeb('0x1c')]('[%s][index][newexten]',_0x588ea3[_0x8eeb('0x1f')]),_0x588ea3);calls[_0x8eeb('0x3d')](_0x588ea3);recordings[_0x8eeb('0x3d')](_0x588ea3);dials[_0x8eeb('0x3d')](_0x588ea3);}catch(_0x41b0c0){utils[_0x8eeb('0x17')](util['format'](_0x8eeb('0x3e'),_0x588ea3['uniqueid']),_0x41b0c0);}});ami['on']('newchannel',function(_0xcbede0){try{utils[_0x8eeb('0x1b')](util[_0x8eeb('0x1c')](_0x8eeb('0x3f'),_0xcbede0[_0x8eeb('0x1f')]),_0xcbede0);calls['newchannel'](_0xcbede0);recordings[_0x8eeb('0x40')](_0xcbede0);}catch(_0x416614){utils[_0x8eeb('0x17')](util[_0x8eeb('0x1c')](_0x8eeb('0x3f'),_0xcbede0[_0x8eeb('0x1f')]),_0x416614);}});ami['on'](_0x8eeb('0x41'),function(_0x2ebbbb){try{utils[_0x8eeb('0x1b')](util['format'](_0x8eeb('0x42'),_0x2ebbbb[_0x8eeb('0x1f')]),_0x2ebbbb);dials[_0x8eeb('0x41')](_0x2ebbbb);}catch(_0x427200){utils[_0x8eeb('0x17')](util[_0x8eeb('0x1c')](_0x8eeb('0x43'),_0x2ebbbb[_0x8eeb('0x1f')]),_0x427200);}});ami['on'](_0x8eeb('0x44'),function(_0x5d82e7){try{utils[_0x8eeb('0x1b')](util[_0x8eeb('0x1c')](_0x8eeb('0x45'),_0x5d82e7[_0x8eeb('0x1f')]),_0x5d82e7);dials[_0x8eeb('0x44')](_0x5d82e7);}catch(_0x1f1302){utils[_0x8eeb('0x17')](util[_0x8eeb('0x1c')](_0x8eeb('0x45'),_0x5d82e7[_0x8eeb('0x1f')]),_0x1f1302);}});}
\ No newline at end of file
index f6029a4..5b27a3e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad7c=['split','catch','error','[%s][members][writeDB]','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','data1','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','[%s][members][cdr]','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','type','then','membername','name','internal','request','CreateMemberReport'];(function(_0x3452df,_0x1eda16){var _0x7bbeda=function(_0x4895ae){while(--_0x4895ae){_0x3452df['push'](_0x3452df['shift']());}};_0x7bbeda(++_0x1eda16);}(_0xad7c,0x8c));var _0xcad7=function(_0x32f13b,_0x1e3bbd){_0x32f13b=_0x32f13b-0x0;var _0x28e847=_0xad7c[_0x32f13b];return _0x28e847;};'use strict';var _=require(_0xcad7('0x0'));var util=require(_0xcad7('0x1'));var utils=require(_0xcad7('0x2'));var members={};var exclude=[_0xcad7('0x3'),_0xcad7('0x4')];function writeDB(_0x4aee90){utils[_0xcad7('0x5')](util[_0xcad7('0x6')](_0xcad7('0x7'),_0x4aee90[_0xcad7('0x8')],_0x4aee90[_0xcad7('0x9')],_0x4aee90[_0xcad7('0xa')],_0x4aee90[_0xcad7('0xb')],_0x4aee90['membername'],_0x4aee90[_0xcad7('0xc')]));if(_0x4aee90[_0xcad7('0x9')]){utils['getUserByInterface'](_0x4aee90[_0xcad7('0x9')])[_0xcad7('0xd')](function(_0x170094){if(_0x170094){_0x4aee90[_0xcad7('0xe')]=_0x170094[_0xcad7('0xf')];_0x4aee90[_0xcad7('0x10')]=_0x170094['internal'];utils[_0xcad7('0x11')](_0xcad7('0x12'),_0x4aee90);}else{utils['getUserByName'](_0x4aee90[_0xcad7('0x9')][_0xcad7('0x13')]('/')[0x1])[_0xcad7('0xd')](function(_0x1f4ec4){if(_0x1f4ec4){_0x4aee90['membername']=_0x1f4ec4[_0xcad7('0xf')];_0x4aee90[_0xcad7('0x10')]=_0x1f4ec4[_0xcad7('0x10')];utils[_0xcad7('0x11')]('CreateMemberReport',_0x4aee90);}});}})[_0xcad7('0x14')](function(_0x43f45f){utils[_0xcad7('0x15')](util[_0xcad7('0x6')](_0xcad7('0x16'),_0x4aee90[_0xcad7('0x8')]),_0x43f45f);});}delete members[_0x4aee90[_0xcad7('0x9')]];}function startsWith(_0x302698,_0x258483){return _['some'](_0x302698,function(_0x22d201){return _[_0xcad7('0x17')](_0x258483,_0x22d201);});}exports[_0xcad7('0x18')]=function(_0x28bd02){try{utils[_0xcad7('0x19')](util[_0xcad7('0x6')](_0xcad7('0x1a'),members[_0x28bd02[_0xcad7('0x1b')]]?members[_0x28bd02[_0xcad7('0x1b')]][_0xcad7('0x8')]:_0x28bd02[_0xcad7('0x1b')]),_0x28bd02);utils[_0xcad7('0x5')](util[_0xcad7('0x6')](_0xcad7('0x1c'),members[_0x28bd02[_0xcad7('0x1b')]]?members[_0x28bd02[_0xcad7('0x1b')]][_0xcad7('0x8')]:_0x28bd02[_0xcad7('0x1b')],_0x28bd02[_0xcad7('0x1d')],_0x28bd02['device']));switch(_0x28bd02[_0xcad7('0x1d')]){case _0xcad7('0x1e'):case _0xcad7('0x1f'):if(!startsWith(exclude,_0x28bd02['device'])){members[_0x28bd02[_0xcad7('0x1b')]]={'channel':_0xcad7('0x20'),'interface':_0x28bd02[_0xcad7('0x1b')],'type':'TALKING','enterAt':utils[_0xcad7('0x21')](),'role':_0xcad7('0x22')};}break;case _0xcad7('0x23'):if(!_[_0xcad7('0x24')](members[_0x28bd02['device']])){members[_0x28bd02[_0xcad7('0x1b')]][_0xcad7('0x25')]=utils[_0xcad7('0x21')]();members[_0x28bd02[_0xcad7('0x1b')]][_0xcad7('0x26')]=utils[_0xcad7('0x27')](members[_0x28bd02[_0xcad7('0x1b')]][_0xcad7('0x25')],members[_0x28bd02[_0xcad7('0x1b')]][_0xcad7('0x28')]);if(members[_0x28bd02['device']][_0xcad7('0x8')]){writeDB(members[_0x28bd02[_0xcad7('0x1b')]]);}}break;default:break;}}catch(_0x2e1f95){utils['error'](util[_0xcad7('0x6')]('[%s][members][devicestatechange]',members[_0x28bd02[_0xcad7('0x1b')]]?members[_0x28bd02['device']][_0xcad7('0x8')]:_0x28bd02[_0xcad7('0x1b')]),_0x2e1f95);}};exports['agentcomplete']=function(_0x6433cc){try{if(!_[_0xcad7('0x24')](members[_0x6433cc[_0xcad7('0x9')]])){utils['debug'](util[_0xcad7('0x6')](_0xcad7('0x29'),_0x6433cc[_0xcad7('0x8')]),_0x6433cc);utils[_0xcad7('0x5')](util[_0xcad7('0x6')](_0xcad7('0x2a'),_0x6433cc['uniqueid'],_0x6433cc[_0xcad7('0x9')],_0x6433cc[_0xcad7('0x2b')]));members[_0x6433cc['interface']]=_[_0xcad7('0x2c')](members[_0x6433cc[_0xcad7('0x9')]],{'data4':_0x6433cc[_0xcad7('0x2b')],'uniqueid':_0x6433cc[_0xcad7('0x8')]});}}catch(_0x3af277){utils[_0xcad7('0x15')](util[_0xcad7('0x6')]('[%s][members][agentcomplete]',_0x6433cc[_0xcad7('0x8')]),_0x3af277);}};exports[_0xcad7('0x2d')]=function(_0x47a397){try{utils[_0xcad7('0x19')](util[_0xcad7('0x6')]('[%s][members][cdr]',_0x47a397[_0xcad7('0x8')]),_0x47a397);if(_0x47a397[_0xcad7('0xa')]){var _0x595d60=_0x47a397[_0xcad7('0xa')][_0xcad7('0x13')]('-')[0x0];if(!_[_0xcad7('0x24')](members[_0x595d60])){members[_0x595d60]=_[_0xcad7('0x2c')](members[_0x595d60],{'data1':members[_0x595d60][_0xcad7('0x2e')]||_0x47a397['type'],'data2':members[_0x595d60][_0xcad7('0xb')]||_0x47a397[_0xcad7('0x2f')],'data3':members[_0x595d60][_0xcad7('0x30')]||_0x47a397[_0xcad7('0x31')],'uniqueid':members[_0x595d60][_0xcad7('0x8')]||_0x47a397[_0xcad7('0x8')]});utils[_0xcad7('0x5')](util[_0xcad7('0x6')](_0xcad7('0x32'),_0x47a397['uniqueid'],members[_0x595d60][_0xcad7('0x2e')],members[_0x595d60][_0xcad7('0xb')],members[_0x595d60][_0xcad7('0x30')]));if(members[_0x595d60][_0xcad7('0x25')]){writeDB(members[_0x595d60]);}}}if(_0x47a397['destinationchannel']){var _0x3e9682=_0x47a397[_0xcad7('0x33')][_0xcad7('0x13')]('-')[0x0];if(!_[_0xcad7('0x24')](members[_0x3e9682])){members[_0x3e9682]=_[_0xcad7('0x2c')](members[_0x3e9682],{'data1':members[_0x3e9682]['data1']||_0x47a397['type'],'data2':members[_0x3e9682]['data2']||_0x47a397[_0xcad7('0x2f')],'data3':members[_0x3e9682]['data3']||_0x47a397['destination'],'uniqueid':members[_0x3e9682][_0xcad7('0x8')]||_0x47a397[_0xcad7('0x8')]});utils[_0xcad7('0x5')](util[_0xcad7('0x6')](_0xcad7('0x32'),_0x47a397[_0xcad7('0x8')],members[_0x3e9682]['data1'],members[_0x3e9682][_0xcad7('0xb')],members[_0x3e9682][_0xcad7('0x30')]));if(members[_0x3e9682][_0xcad7('0x25')]){writeDB(members[_0x3e9682]);}}}}catch(_0x5bd844){utils['error'](util[_0xcad7('0x6')](_0xcad7('0x34'),_0x47a397[_0xcad7('0x8')]),_0x5bd844);}};
\ No newline at end of file
+var _0xb32d=['data3','destinationchannel','data1','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','lodash','util','./utils','Local/_attended@transfer','Queue:','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','channel','data2','membername','type','then','name','internal','request','CreateMemberReport','getUserByName','split','catch','error','[%s][members][writeDB]','uniqueid','some','device','state','BUSY','TALKING','NOT_INUSE','isNil','duration','diffTime','exitAt','enterAt','[%s][members][devicestatechange]','debug','[%s][members][agentcomplete]','info','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','cdr','assign','source'];(function(_0x41886e,_0x2f9b3e){var _0x10e7f4=function(_0x267c43){while(--_0x267c43){_0x41886e['push'](_0x41886e['shift']());}};_0x10e7f4(++_0x2f9b3e);}(_0xb32d,0x1da));var _0xdb32=function(_0x3893da,_0x22bffb){_0x3893da=_0x3893da-0x0;var _0x1c3533=_0xb32d[_0x3893da];return _0x1c3533;};'use strict';var _=require(_0xdb32('0x0'));var util=require(_0xdb32('0x1'));var utils=require(_0xdb32('0x2'));var members={};var exclude=[_0xdb32('0x3'),_0xdb32('0x4')];function writeDB(_0x56a5af){utils['info'](util[_0xdb32('0x5')](_0xdb32('0x6'),_0x56a5af['uniqueid'],_0x56a5af[_0xdb32('0x7')],_0x56a5af[_0xdb32('0x8')],_0x56a5af[_0xdb32('0x9')],_0x56a5af[_0xdb32('0xa')],_0x56a5af[_0xdb32('0xb')]));if(_0x56a5af[_0xdb32('0x7')]){utils['getUserByInterface'](_0x56a5af[_0xdb32('0x7')])[_0xdb32('0xc')](function(_0xbe779d){if(_0xbe779d){_0x56a5af[_0xdb32('0xa')]=_0xbe779d[_0xdb32('0xd')];_0x56a5af[_0xdb32('0xe')]=_0xbe779d[_0xdb32('0xe')];utils[_0xdb32('0xf')](_0xdb32('0x10'),_0x56a5af);}else{utils[_0xdb32('0x11')](_0x56a5af[_0xdb32('0x7')][_0xdb32('0x12')]('/')[0x1])[_0xdb32('0xc')](function(_0x2e365e){if(_0x2e365e){_0x56a5af[_0xdb32('0xa')]=_0x2e365e[_0xdb32('0xd')];_0x56a5af[_0xdb32('0xe')]=_0x2e365e[_0xdb32('0xe')];utils[_0xdb32('0xf')](_0xdb32('0x10'),_0x56a5af);}});}})[_0xdb32('0x13')](function(_0x5e4377){utils[_0xdb32('0x14')](util[_0xdb32('0x5')](_0xdb32('0x15'),_0x56a5af[_0xdb32('0x16')]),_0x5e4377);});}delete members[_0x56a5af[_0xdb32('0x7')]];}function startsWith(_0x4b38ab,_0x540bc4){return _[_0xdb32('0x17')](_0x4b38ab,function(_0x3a4028){return _['startsWith'](_0x540bc4,_0x3a4028);});}exports['devicestatechange']=function(_0x59a5f8){try{utils['debug'](util[_0xdb32('0x5')]('[%s][members][devicestatechange]',members[_0x59a5f8[_0xdb32('0x18')]]?members[_0x59a5f8[_0xdb32('0x18')]][_0xdb32('0x16')]:_0x59a5f8[_0xdb32('0x18')]),_0x59a5f8);utils['info'](util['format']('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x59a5f8[_0xdb32('0x18')]]?members[_0x59a5f8['device']][_0xdb32('0x16')]:_0x59a5f8[_0xdb32('0x18')],_0x59a5f8[_0xdb32('0x19')],_0x59a5f8[_0xdb32('0x18')]));switch(_0x59a5f8[_0xdb32('0x19')]){case'INUSE':case _0xdb32('0x1a'):if(!startsWith(exclude,_0x59a5f8[_0xdb32('0x18')])){members[_0x59a5f8[_0xdb32('0x18')]]={'channel':'voice','interface':_0x59a5f8['device'],'type':_0xdb32('0x1b'),'enterAt':utils['now'](),'role':'agent'};}break;case _0xdb32('0x1c'):if(!_[_0xdb32('0x1d')](members[_0x59a5f8[_0xdb32('0x18')]])){members[_0x59a5f8[_0xdb32('0x18')]]['exitAt']=utils['now']();members[_0x59a5f8[_0xdb32('0x18')]][_0xdb32('0x1e')]=utils[_0xdb32('0x1f')](members[_0x59a5f8['device']][_0xdb32('0x20')],members[_0x59a5f8['device']][_0xdb32('0x21')]);if(members[_0x59a5f8[_0xdb32('0x18')]][_0xdb32('0x16')]){writeDB(members[_0x59a5f8[_0xdb32('0x18')]]);}}break;default:break;}}catch(_0x22e6b1){utils['error'](util['format'](_0xdb32('0x22'),members[_0x59a5f8['device']]?members[_0x59a5f8[_0xdb32('0x18')]][_0xdb32('0x16')]:_0x59a5f8[_0xdb32('0x18')]),_0x22e6b1);}};exports['agentcomplete']=function(_0x5344ea){try{if(!_[_0xdb32('0x1d')](members[_0x5344ea[_0xdb32('0x7')]])){utils[_0xdb32('0x23')](util['format'](_0xdb32('0x24'),_0x5344ea[_0xdb32('0x16')]),_0x5344ea);utils[_0xdb32('0x25')](util[_0xdb32('0x5')](_0xdb32('0x26'),_0x5344ea[_0xdb32('0x16')],_0x5344ea[_0xdb32('0x7')],_0x5344ea[_0xdb32('0x27')]));members[_0x5344ea[_0xdb32('0x7')]]=_['assign'](members[_0x5344ea['interface']],{'data4':_0x5344ea[_0xdb32('0x27')],'uniqueid':_0x5344ea['uniqueid']});}}catch(_0x2e7cb4){utils[_0xdb32('0x14')](util[_0xdb32('0x5')]('[%s][members][agentcomplete]',_0x5344ea[_0xdb32('0x16')]),_0x2e7cb4);}};exports[_0xdb32('0x28')]=function(_0x4a8403){try{utils[_0xdb32('0x23')](util[_0xdb32('0x5')]('[%s][members][cdr]',_0x4a8403[_0xdb32('0x16')]),_0x4a8403);if(_0x4a8403[_0xdb32('0x8')]){var _0x594b6d=_0x4a8403[_0xdb32('0x8')][_0xdb32('0x12')]('-')[0x0];if(!_[_0xdb32('0x1d')](members[_0x594b6d])){members[_0x594b6d]=_[_0xdb32('0x29')](members[_0x594b6d],{'data1':members[_0x594b6d]['data1']||_0x4a8403[_0xdb32('0xb')],'data2':members[_0x594b6d][_0xdb32('0x9')]||_0x4a8403[_0xdb32('0x2a')],'data3':members[_0x594b6d][_0xdb32('0x2b')]||_0x4a8403['destination'],'uniqueid':members[_0x594b6d]['uniqueid']||_0x4a8403['uniqueid']});utils[_0xdb32('0x25')](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x4a8403[_0xdb32('0x16')],members[_0x594b6d]['data1'],members[_0x594b6d][_0xdb32('0x9')],members[_0x594b6d][_0xdb32('0x2b')]));if(members[_0x594b6d][_0xdb32('0x20')]){writeDB(members[_0x594b6d]);}}}if(_0x4a8403[_0xdb32('0x2c')]){var _0x504923=_0x4a8403[_0xdb32('0x2c')][_0xdb32('0x12')]('-')[0x0];if(!_[_0xdb32('0x1d')](members[_0x504923])){members[_0x504923]=_[_0xdb32('0x29')](members[_0x504923],{'data1':members[_0x504923][_0xdb32('0x2d')]||_0x4a8403[_0xdb32('0xb')],'data2':members[_0x504923][_0xdb32('0x9')]||_0x4a8403[_0xdb32('0x2a')],'data3':members[_0x504923][_0xdb32('0x2b')]||_0x4a8403['destination'],'uniqueid':members[_0x504923][_0xdb32('0x16')]||_0x4a8403['uniqueid']});utils[_0xdb32('0x25')](util[_0xdb32('0x5')](_0xdb32('0x2e'),_0x4a8403['uniqueid'],members[_0x504923][_0xdb32('0x2d')],members[_0x504923][_0xdb32('0x9')],members[_0x504923][_0xdb32('0x2b')]));if(members[_0x504923][_0xdb32('0x20')]){writeDB(members[_0x504923]);}}}}catch(_0xe327ba){utils[_0xdb32('0x14')](util[_0xdb32('0x5')]('[%s][members][cdr]',_0x4a8403[_0xdb32('0x16')]),_0xe327ba);}};
\ No newline at end of file
index 6ffa3db..8a5e9f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb2f1=['queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','varset','[%s][queues][varset]','variable','toUpperCase','CONTINUE','queuecallerexitAt','value','queueposition','queuecallerabandonAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','accountcode','agentcomplete','reason','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transfereelinkedid','transfertargetuniqueid','calleridnum','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','ATTENDED','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','transfertargetlinkedid','clone','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','util','./utils','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','queuecallerexitreason','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','format','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','now','error','[%s][queues][queuecallerjoin]','hangup','isNil','[%s][queues][hangup]'];(function(_0x5b5b63,_0x181eff){var _0x10f165=function(_0x4d30b7){while(--_0x4d30b7){_0x5b5b63['push'](_0x5b5b63['shift']());}};_0x10f165(++_0x181eff);}(_0xb2f1,0xb6));var _0x1b2f=function(_0x13e1b2,_0x56a2af){_0x13e1b2=_0x13e1b2-0x0;var _0x2706be=_0xb2f1[_0x13e1b2];return _0x2706be;};'use strict';var _=require('lodash');var util=require(_0x1b2f('0x0'));var utils=require(_0x1b2f('0x1'));var queues={};function writeDB(_0x475e2c){utils[_0x1b2f('0x2')](util['format'](_0x1b2f('0x3'),_0x475e2c[_0x1b2f('0x4')],_0x475e2c[_0x1b2f('0x5')],_0x475e2c[_0x1b2f('0x6')],_0x475e2c[_0x1b2f('0x7')],_0x475e2c['calleridnum'],_0x475e2c['accountcode'],_0x475e2c[_0x1b2f('0x8')]));if(_0x475e2c[_0x1b2f('0x6')]){utils['getVoiceQueueByName'](_0x475e2c[_0x1b2f('0x6')])[_0x1b2f('0x9')](function(_0x3c8e35){if(_0x3c8e35){_0x475e2c[_0x1b2f('0xa')]=_0x3c8e35[_0x1b2f('0xa')];}utils[_0x1b2f('0xb')](_0x1b2f('0xc'),_0x475e2c);});}else{utils['request'](_0x1b2f('0xc'),_0x475e2c);}if(_0x475e2c[_0x1b2f('0xd')]){delete queues[_0x475e2c[_0x1b2f('0xd')]];}else{delete queues[_0x475e2c[_0x1b2f('0x4')]];}}exports[_0x1b2f('0xe')]=function(_0x1945c5){try{utils[_0x1b2f('0xf')](util[_0x1b2f('0x10')]('[%s][queues][queuecallerjoin]',_0x1945c5['uniqueid']),_0x1945c5);utils[_0x1b2f('0x2')](util['format'](_0x1b2f('0x11'),_0x1945c5['uniqueid'],_0x1945c5['queue'],_0x1945c5['position']));queues[_0x1945c5[_0x1b2f('0x4')]]=_[_0x1b2f('0x12')](_0x1945c5,{'originalposition':_0x1945c5[_0x1b2f('0x13')],'queuecallerjoinAt':utils[_0x1b2f('0x14')](),'mohtime':0x0});}catch(_0x36004a){utils[_0x1b2f('0x15')](util['format'](_0x1b2f('0x16'),_0x1945c5[_0x1b2f('0x4')]),_0x36004a);}};exports[_0x1b2f('0x17')]=function(_0x21a2fa){try{if(!_[_0x1b2f('0x18')](queues[_0x21a2fa['uniqueid']])){utils[_0x1b2f('0xf')](util[_0x1b2f('0x10')](_0x1b2f('0x19'),_0x21a2fa[_0x1b2f('0x4')]),_0x21a2fa);if(queues[_0x21a2fa[_0x1b2f('0x4')]][_0x1b2f('0x1a')]){if(!queues[_0x21a2fa[_0x1b2f('0x4')]][_0x1b2f('0x1b')]&&!queues[_0x21a2fa['uniqueid']][_0x1b2f('0x1c')]){queues[_0x21a2fa[_0x1b2f('0x4')]][_0x1b2f('0x1d')]=!![];queues[_0x21a2fa[_0x1b2f('0x4')]][_0x1b2f('0x1e')]=utils[_0x1b2f('0x14')]();queues[_0x21a2fa['uniqueid']][_0x1b2f('0x8')]=_0x1b2f('0x1f');}utils[_0x1b2f('0x2')](util[_0x1b2f('0x10')](_0x1b2f('0x20'),_0x21a2fa[_0x1b2f('0x4')],queues[_0x21a2fa[_0x1b2f('0x4')]]['name'],queues[_0x21a2fa[_0x1b2f('0x4')]][_0x1b2f('0x8')]));writeDB(queues[_0x21a2fa[_0x1b2f('0x4')]]);}else if(queues[_0x21a2fa[_0x1b2f('0x4')]][_0x1b2f('0xd')]){utils[_0x1b2f('0x2')](util[_0x1b2f('0x10')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x21a2fa['uniqueid'],queues[_0x21a2fa['uniqueid']][_0x1b2f('0x21')],queues[_0x21a2fa[_0x1b2f('0x4')]][_0x1b2f('0xd')]));queues[queues[_0x21a2fa[_0x1b2f('0x4')]]['transfereduniqueid']]=queues[_0x21a2fa['uniqueid']];queues[queues[_0x21a2fa['uniqueid']][_0x1b2f('0xd')]][_0x1b2f('0x22')]=0x2;delete queues[_0x21a2fa[_0x1b2f('0x4')]];}}}catch(_0x5d0c28){utils[_0x1b2f('0x15')](util['format'](_0x1b2f('0x19'),_0x21a2fa[_0x1b2f('0x4')]),_0x5d0c28);}};exports[_0x1b2f('0x23')]=function(_0xa6cf84){try{utils['debug'](util['format'](_0x1b2f('0x24'),_0xa6cf84[_0x1b2f('0x4')]),_0xa6cf84);if(!_[_0x1b2f('0x18')](_0xa6cf84[_0x1b2f('0x25')]['queuestatus'])&&_0xa6cf84['value'][_0x1b2f('0x26')]()!==_0x1b2f('0x27')){if(!_[_0x1b2f('0x18')](queues[_0xa6cf84[_0x1b2f('0x4')]])){queues[_0xa6cf84['uniqueid']]['queuecallerabandon']=![];queues[_0xa6cf84[_0x1b2f('0x4')]]['queuecallerabandonAt']=null;queues[_0xa6cf84[_0x1b2f('0x4')]][_0x1b2f('0x1c')]=!![];queues[_0xa6cf84[_0x1b2f('0x4')]][_0x1b2f('0x28')]=utils[_0x1b2f('0x14')]();queues[_0xa6cf84[_0x1b2f('0x4')]][_0x1b2f('0x8')]=_0xa6cf84[_0x1b2f('0x29')][_0x1b2f('0x26')]();utils['info'](util[_0x1b2f('0x10')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0xa6cf84[_0x1b2f('0x4')],queues[_0xa6cf84[_0x1b2f('0x4')]][_0x1b2f('0x21')],_0xa6cf84[_0x1b2f('0x29')],queues[_0xa6cf84[_0x1b2f('0x4')]]['queuecallerexitreason']));writeDB(queues[_0xa6cf84[_0x1b2f('0x4')]]);}}else if(!_[_0x1b2f('0x18')](_0xa6cf84[_0x1b2f('0x25')][_0x1b2f('0x2a')])){if(!_[_0x1b2f('0x18')](queues[_0xa6cf84['uniqueid']])&&!queues[_0xa6cf84[_0x1b2f('0x4')]][_0x1b2f('0x1b')]){queues[_0xa6cf84[_0x1b2f('0x4')]]['queuecallerabandon']=![];queues[_0xa6cf84['uniqueid']][_0x1b2f('0x2b')]=null;queues[_0xa6cf84[_0x1b2f('0x4')]]['queuecallerexit']=!![];queues[_0xa6cf84[_0x1b2f('0x4')]][_0x1b2f('0x28')]=utils[_0x1b2f('0x14')]();queues[_0xa6cf84[_0x1b2f('0x4')]][_0x1b2f('0x8')]=_0x1b2f('0x2c');utils[_0x1b2f('0x2')](util['format'](_0x1b2f('0x2d'),_0xa6cf84[_0x1b2f('0x4')],queues[_0xa6cf84['uniqueid']]['name'],_0xa6cf84[_0x1b2f('0x29')],queues[_0xa6cf84[_0x1b2f('0x4')]][_0x1b2f('0x8')]));}}}catch(_0x571656){utils[_0x1b2f('0x15')](util['format'](_0x1b2f('0x24'),_0xa6cf84[_0x1b2f('0x4')]),_0x571656);}};exports[_0x1b2f('0x1b')]=function(_0x28ab14){try{if(!_[_0x1b2f('0x18')](queues[_0x28ab14['uniqueid']])){utils[_0x1b2f('0xf')](util[_0x1b2f('0x10')](_0x1b2f('0x2e'),_0x28ab14[_0x1b2f('0x4')]),_0x28ab14);queues[_0x28ab14['uniqueid']][_0x1b2f('0x1c')]=![];queues[_0x28ab14['uniqueid']][_0x1b2f('0x28')]=null;queues[_0x28ab14[_0x1b2f('0x4')]][_0x1b2f('0x1b')]=!![];queues[_0x28ab14[_0x1b2f('0x4')]][_0x1b2f('0x2b')]=utils[_0x1b2f('0x14')]();queues[_0x28ab14[_0x1b2f('0x4')]]['queuecallerexitreason']=_0x1b2f('0x2f');utils[_0x1b2f('0x2')](util[_0x1b2f('0x10')](_0x1b2f('0x30'),_0x28ab14[_0x1b2f('0x4')],queues[_0x28ab14['uniqueid']][_0x1b2f('0x21')],queues[_0x28ab14[_0x1b2f('0x4')]][_0x1b2f('0x8')]));}}catch(_0x44e99b){utils[_0x1b2f('0x15')](util[_0x1b2f('0x10')](_0x1b2f('0x2e'),_0x28ab14[_0x1b2f('0x4')]),_0x44e99b);}};exports['queuecallerleave']=function(_0x367ac4){try{if(!_[_0x1b2f('0x18')](queues[_0x367ac4[_0x1b2f('0x4')]])){utils[_0x1b2f('0xf')](util[_0x1b2f('0x10')](_0x1b2f('0x31'),_0x367ac4[_0x1b2f('0x4')]),_0x367ac4);utils[_0x1b2f('0x2')](util[_0x1b2f('0x10')](_0x1b2f('0x32'),_0x367ac4[_0x1b2f('0x4')],queues[_0x367ac4[_0x1b2f('0x4')]][_0x1b2f('0x21')],_0x367ac4[_0x1b2f('0x33')],_0x367ac4[_0x1b2f('0x34')]));queues[_0x367ac4[_0x1b2f('0x4')]]['queuecallerleave']=!![];queues[_0x367ac4[_0x1b2f('0x4')]]['queuecallerleaveAt']=utils[_0x1b2f('0x14')]();queues[_0x367ac4['uniqueid']][_0x1b2f('0x35')]=utils[_0x1b2f('0x36')](queues[_0x367ac4[_0x1b2f('0x4')]][_0x1b2f('0x1a')],queues[_0x367ac4[_0x1b2f('0x4')]][_0x1b2f('0x37')]);queues[_0x367ac4[_0x1b2f('0x4')]][_0x1b2f('0x13')]=_0x367ac4[_0x1b2f('0x13')];queues[_0x367ac4[_0x1b2f('0x4')]][_0x1b2f('0x38')]=_0x367ac4[_0x1b2f('0x38')];queues[_0x367ac4[_0x1b2f('0x4')]][_0x1b2f('0x33')]=_0x367ac4['connectedlinenum'];queues[_0x367ac4[_0x1b2f('0x4')]][_0x1b2f('0x34')]=_0x367ac4[_0x1b2f('0x34')];}}catch(_0x458ba8){utils[_0x1b2f('0x15')](util[_0x1b2f('0x10')]('[%s][queues][queuecallerleave]',_0x367ac4[_0x1b2f('0x4')]),_0x458ba8);}};exports['agentconnect']=function(_0x1b3dbd){try{if(!_[_0x1b2f('0x18')](queues[_0x1b3dbd[_0x1b2f('0x4')]])){utils['debug'](util[_0x1b2f('0x10')](_0x1b2f('0x39'),_0x1b3dbd[_0x1b2f('0x4')]),_0x1b3dbd);utils[_0x1b2f('0x2')](util['format'](_0x1b2f('0x3a'),_0x1b3dbd[_0x1b2f('0x4')],queues[_0x1b3dbd[_0x1b2f('0x4')]][_0x1b2f('0x21')],_0x1b3dbd[_0x1b2f('0x3b')],_0x1b3dbd[_0x1b2f('0x3c')]));queues[_0x1b3dbd[_0x1b2f('0x4')]]['queuecallerabandon']=![];queues[_0x1b3dbd[_0x1b2f('0x4')]][_0x1b2f('0x1b')]=![];queues[_0x1b3dbd[_0x1b2f('0x4')]][_0x1b2f('0x2b')]=null;queues[_0x1b3dbd[_0x1b2f('0x4')]]['queuecallerexit']=![];queues[_0x1b3dbd[_0x1b2f('0x4')]][_0x1b2f('0x8')]=null;queues[_0x1b3dbd[_0x1b2f('0x4')]]['queuecallerexitAt']=null;queues[_0x1b3dbd['uniqueid']][_0x1b2f('0x3d')]=!![];queues[_0x1b3dbd[_0x1b2f('0x4')]][_0x1b2f('0x3e')]=_0x1b3dbd[_0x1b2f('0x3c')];queues[_0x1b3dbd[_0x1b2f('0x4')]]['lastAssignedTo']=_0x1b3dbd[_0x1b2f('0x3b')];}}catch(_0x5ae385){utils[_0x1b2f('0x15')](util[_0x1b2f('0x10')](_0x1b2f('0x39'),_0x1b3dbd[_0x1b2f('0x4')]),_0x5ae385);}};exports[_0x1b2f('0x3f')]=function(_0x13f364){try{if(!_[_0x1b2f('0x18')](queues[_0x13f364[_0x1b2f('0x4')]])){if(queues[_0x13f364[_0x1b2f('0x4')]][_0x1b2f('0x1a')]){utils[_0x1b2f('0xf')](util[_0x1b2f('0x10')]('[%s][queues][agentcomplete]',_0x13f364[_0x1b2f('0x4')]),_0x13f364);queues[_0x13f364['uniqueid']]['queuecallerabandon']=![];queues[_0x13f364[_0x1b2f('0x4')]][_0x1b2f('0x1b')]=![];queues[_0x13f364[_0x1b2f('0x4')]]['queuecallerabandonAt']=null;queues[_0x13f364['uniqueid']][_0x1b2f('0x1c')]=![];queues[_0x13f364[_0x1b2f('0x4')]]['queuecallerexitAt']=null;queues[_0x13f364[_0x1b2f('0x4')]][_0x1b2f('0x3d')]=!![];queues[_0x13f364[_0x1b2f('0x4')]][_0x1b2f('0x7')]=_0x13f364[_0x1b2f('0x3b')];queues[_0x13f364[_0x1b2f('0x4')]][_0x1b2f('0x1d')]=!![];queues[_0x13f364[_0x1b2f('0x4')]][_0x1b2f('0x1e')]=utils[_0x1b2f('0x14')]();if(_0x13f364[_0x1b2f('0x40')]==_0x1b2f('0x41')){if(!queues[_0x13f364[_0x1b2f('0x4')]][_0x1b2f('0x41')]){queues[_0x13f364[_0x1b2f('0x4')]]['queuecallerexitreason']=_0x1b2f('0x42');}}else{queues[_0x13f364[_0x1b2f('0x4')]][_0x1b2f('0x8')]='COMPLETEDBY'+_0x13f364[_0x1b2f('0x40')]['toUpperCase']();}utils[_0x1b2f('0x2')](util['format'](_0x1b2f('0x43'),_0x13f364['uniqueid'],queues[_0x13f364[_0x1b2f('0x4')]][_0x1b2f('0x21')],_0x13f364[_0x1b2f('0x3b')],queues[_0x13f364['uniqueid']][_0x1b2f('0x8')]));writeDB(queues[_0x13f364['uniqueid']]);}}}catch(_0x4efec3){utils[_0x1b2f('0x15')](util[_0x1b2f('0x10')](_0x1b2f('0x44'),_0x13f364['uniqueid']),_0x4efec3);}};exports[_0x1b2f('0x45')]=function(_0x124c83){try{if(!_[_0x1b2f('0x18')](queues[_0x124c83[_0x1b2f('0x46')]])){utils[_0x1b2f('0xf')](util['format'](_0x1b2f('0x47'),_0x124c83[_0x1b2f('0x4')]),_0x124c83);queues[_0x124c83[_0x1b2f('0x46')]][_0x1b2f('0x41')]=!![];queues[_0x124c83[_0x1b2f('0x46')]]['transfertype']=_0x1b2f('0x48');queues[_0x124c83['transfereeuniqueid']][_0x1b2f('0x49')]=_0x124c83[_0x1b2f('0x4a')];queues[_0x124c83[_0x1b2f('0x46')]][_0x1b2f('0x4b')]=_0x124c83[_0x1b2f('0x46')];queues[_0x124c83[_0x1b2f('0x46')]]['queuecallerexitreason']=_0x1b2f('0x4c');utils['info'](util[_0x1b2f('0x10')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x124c83[_0x1b2f('0x4')],queues[_0x124c83[_0x1b2f('0x46')]][_0x1b2f('0x21')],_0x124c83['transfereeuniqueid'],_0x124c83['extension']));}}catch(_0x2cacce){utils['error'](util[_0x1b2f('0x10')]('[%s][queues][blindtransfer]',_0x124c83[_0x1b2f('0x4')]),_0x2cacce);}};exports[_0x1b2f('0x4d')]=function(_0x3444b1){try{utils[_0x1b2f('0xf')](util[_0x1b2f('0x10')]('[%s][queues][attendedtransfer]',_0x3444b1['origtransfereruniqueid']),_0x3444b1);if(_0x3444b1[_0x1b2f('0x4e')]==_0x3444b1[_0x1b2f('0x4f')]){if(!_[_0x1b2f('0x18')](queues[_0x3444b1[_0x1b2f('0x50')]])){utils[_0x1b2f('0x2')](util[_0x1b2f('0x10')](_0x1b2f('0x51'),_0x3444b1[_0x1b2f('0x4e')],queues[_0x3444b1['secondtransfererlinkedid']][_0x1b2f('0x21')],_0x3444b1['origtransfererexten']));queues[_0x3444b1[_0x1b2f('0x50')]]['transfer']=!![];queues[_0x3444b1[_0x1b2f('0x50')]]['transfertype']='ATTENDED';queues[_0x3444b1[_0x1b2f('0x50')]][_0x1b2f('0x49')]=_0x3444b1[_0x1b2f('0x52')];queues[_0x3444b1[_0x1b2f('0x50')]][_0x1b2f('0x4b')]=_0x3444b1[_0x1b2f('0x4e')];queues[_0x3444b1[_0x1b2f('0x50')]][_0x1b2f('0x8')]='ATTENDEDTRANSFER';}if(!_[_0x1b2f('0x18')](queues[_0x3444b1[_0x1b2f('0x4f')]])){if(_0x3444b1[_0x1b2f('0x53')]&&queues[_0x3444b1[_0x1b2f('0x53')]]){queues[_0x3444b1['transfereelinkedid']][_0x1b2f('0x22')]=0x1;queues[_0x3444b1[_0x1b2f('0x46')]]=_['clone'](queues[_0x3444b1[_0x1b2f('0x53')]]);queues[_0x3444b1[_0x1b2f('0x46')]]['transfereduniqueid']=_0x3444b1[_0x1b2f('0x54')];queues[_0x3444b1[_0x1b2f('0x46')]][_0x1b2f('0x22')]=0x2;queues[_0x3444b1[_0x1b2f('0x46')]][_0x1b2f('0x55')]=queues[_0x3444b1['secondtransfererlinkedid']][_0x1b2f('0x55')];queues[_0x3444b1[_0x1b2f('0x46')]][_0x1b2f('0x56')]=queues[_0x3444b1[_0x1b2f('0x50')]][_0x1b2f('0x56')];queues[_0x3444b1[_0x1b2f('0x46')]]['queuecallerjoinAt']=utils[_0x1b2f('0x14')]();queues[_0x3444b1[_0x1b2f('0x46')]][_0x1b2f('0x1a')]=utils[_0x1b2f('0x14')]();queues[_0x3444b1[_0x1b2f('0x46')]][_0x1b2f('0x35')]=0x0;queues[_0x3444b1[_0x1b2f('0x46')]][_0x1b2f('0x57')]=0x0;utils[_0x1b2f('0x2')](util[_0x1b2f('0x10')](_0x1b2f('0x58'),_0x3444b1['origtransfereruniqueid'],queues[_0x3444b1['transfereeuniqueid']][_0x1b2f('0x21')],queues[_0x3444b1[_0x1b2f('0x46')]][_0x1b2f('0x55')],queues[_0x3444b1[_0x1b2f('0x46')]]['calleridname']));}else{utils[_0x1b2f('0x2')](util[_0x1b2f('0x10')](_0x1b2f('0x59'),_0x3444b1[_0x1b2f('0x4e')],queues[_0x3444b1[_0x1b2f('0x4f')]][_0x1b2f('0x21')],_0x3444b1[_0x1b2f('0x50')]));queues[_0x3444b1[_0x1b2f('0x4f')]][_0x1b2f('0xd')]=_0x3444b1[_0x1b2f('0x50')];}}}else if(_0x3444b1['secondtransfereruniqueid']==_0x3444b1['secondtransfererlinkedid']){if(!_[_0x1b2f('0x18')](queues[_0x3444b1['origtransfererlinkedid']])){utils['info'](util[_0x1b2f('0x10')](_0x1b2f('0x5a'),_0x3444b1[_0x1b2f('0x4e')],queues[_0x3444b1[_0x1b2f('0x4f')]][_0x1b2f('0x21')],_0x3444b1['secondtransfereruniqueid'],_0x3444b1['secondtransfererexten']));queues[_0x3444b1[_0x1b2f('0x4f')]][_0x1b2f('0x41')]=!![];queues[_0x3444b1['origtransfererlinkedid']]['transfertype']=_0x1b2f('0x5b');queues[_0x3444b1['origtransfererlinkedid']][_0x1b2f('0x49')]=_0x3444b1[_0x1b2f('0x5c')];queues[_0x3444b1[_0x1b2f('0x4f')]]['transferuniqueid']=_0x3444b1[_0x1b2f('0x5d')];queues[_0x3444b1[_0x1b2f('0x4f')]][_0x1b2f('0x8')]=_0x1b2f('0x5e');}if(!_[_0x1b2f('0x18')](queues[_0x3444b1[_0x1b2f('0x50')]])){if(_0x3444b1[_0x1b2f('0x5f')]&&queues[_0x3444b1[_0x1b2f('0x5f')]]){queues[_0x3444b1[_0x1b2f('0x5f')]][_0x1b2f('0x22')]=0x1;queues[_0x3444b1[_0x1b2f('0x54')]]=_[_0x1b2f('0x60')](queues[_0x3444b1[_0x1b2f('0x5f')]]);queues[_0x3444b1[_0x1b2f('0x54')]][_0x1b2f('0xd')]=_0x3444b1[_0x1b2f('0x54')];queues[_0x3444b1[_0x1b2f('0x54')]][_0x1b2f('0x22')]=0x2;queues[_0x3444b1[_0x1b2f('0x54')]][_0x1b2f('0x55')]=queues[_0x3444b1[_0x1b2f('0x4f')]][_0x1b2f('0x55')];queues[_0x3444b1[_0x1b2f('0x54')]][_0x1b2f('0x56')]=queues[_0x3444b1[_0x1b2f('0x4f')]][_0x1b2f('0x56')];queues[_0x3444b1[_0x1b2f('0x54')]][_0x1b2f('0x37')]=utils[_0x1b2f('0x14')]();queues[_0x3444b1['transfertargetuniqueid']]['queuecallerleaveAt']=utils[_0x1b2f('0x14')]();queues[_0x3444b1[_0x1b2f('0x54')]][_0x1b2f('0x35')]=0x0;queues[_0x3444b1[_0x1b2f('0x54')]][_0x1b2f('0x57')]=0x0;utils[_0x1b2f('0x2')](util[_0x1b2f('0x10')](_0x1b2f('0x61'),_0x3444b1[_0x1b2f('0x4e')],queues[_0x3444b1[_0x1b2f('0x54')]]['name'],queues[_0x3444b1['transfertargetuniqueid']][_0x1b2f('0xd')],queues[_0x3444b1['transfertargetuniqueid']][_0x1b2f('0x55')],queues[_0x3444b1[_0x1b2f('0x54')]][_0x1b2f('0x56')]));}else{utils[_0x1b2f('0x2')](util[_0x1b2f('0x10')](_0x1b2f('0x59'),_0x3444b1['origtransfereruniqueid'],queues[_0x3444b1[_0x1b2f('0x50')]][_0x1b2f('0x21')],_0x3444b1[_0x1b2f('0x4f')]));queues[_0x3444b1[_0x1b2f('0x50')]]['transfereduniqueid']=_0x3444b1[_0x1b2f('0x4f')];}}}}catch(_0x832028){utils[_0x1b2f('0x15')](util[_0x1b2f('0x10')](_0x1b2f('0x62'),_0x3444b1[_0x1b2f('0x4e')]),_0x832028);}};exports[_0x1b2f('0x63')]=function(_0x74a1a7){try{if(!_[_0x1b2f('0x18')](queues[_0x74a1a7[_0x1b2f('0x4')]])){utils[_0x1b2f('0xf')](util[_0x1b2f('0x10')](_0x1b2f('0x64'),_0x74a1a7[_0x1b2f('0x4')]),_0x74a1a7);queues[_0x74a1a7[_0x1b2f('0x4')]][_0x1b2f('0x65')]=utils[_0x1b2f('0x14')]();utils[_0x1b2f('0x2')](util['format']('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x74a1a7['uniqueid'],queues[_0x74a1a7[_0x1b2f('0x4')]][_0x1b2f('0x21')],queues[_0x74a1a7['uniqueid']][_0x1b2f('0x65')]));}}catch(_0xf0feca){utils['error'](util[_0x1b2f('0x10')](_0x1b2f('0x64'),_0x74a1a7[_0x1b2f('0x4')]),_0xf0feca);}};exports[_0x1b2f('0x66')]=function(_0x37d82e){try{if(!_[_0x1b2f('0x18')](queues[_0x37d82e[_0x1b2f('0x4')]])){if(!_['isNil'](queues[_0x37d82e['uniqueid']][_0x1b2f('0x65')])){utils[_0x1b2f('0xf')](util[_0x1b2f('0x10')](_0x1b2f('0x67'),_0x37d82e[_0x1b2f('0x4')]),_0x37d82e);queues[_0x37d82e['uniqueid']]['mohtime']+=utils[_0x1b2f('0x36')](utils[_0x1b2f('0x14')](),queues[_0x37d82e[_0x1b2f('0x4')]][_0x1b2f('0x65')]);utils[_0x1b2f('0x2')](util['format']('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x37d82e[_0x1b2f('0x4')],queues[_0x37d82e[_0x1b2f('0x4')]][_0x1b2f('0x21')],queues[_0x37d82e[_0x1b2f('0x4')]][_0x1b2f('0x57')]));delete queues[_0x37d82e[_0x1b2f('0x4')]][_0x1b2f('0x65')];}}}catch(_0x417fc2){utils[_0x1b2f('0x15')](util['format'](_0x1b2f('0x67'),_0x37d82e[_0x1b2f('0x4')]),_0x417fc2);}};
\ No newline at end of file
+var _0xf461=['musiconholdstartAt','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','debug','format','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerexit','queuecallercompleteAt','name','queuecallerenterreason','varset','[%s][queues][varset]','variable','value','queuecallerabandon','queuecallerabandonAt','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerexitAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','connectedlinenum','[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','destaccountcode','assigned','membername','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','BLIND','transferexten','extension','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','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','transferuniqueid','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart'];(function(_0x374bfe,_0x562033){var _0x42dc55=function(_0x3520be){while(--_0x3520be){_0x374bfe['push'](_0x374bfe['shift']());}};_0x42dc55(++_0x562033);}(_0xf461,0x12a));var _0x1f46=function(_0x2e1a01,_0x1964e3){_0x2e1a01=_0x2e1a01-0x0;var _0x3f1ca4=_0xf461[_0x2e1a01];return _0x3f1ca4;};'use strict';var _=require('lodash');var util=require('util');var utils=require('./utils');var queues={};function writeDB(_0x12ab91){utils[_0x1f46('0x0')](util['format'](_0x1f46('0x1'),_0x12ab91[_0x1f46('0x2')],_0x12ab91['channel'],_0x12ab91[_0x1f46('0x3')],_0x12ab91[_0x1f46('0x4')],_0x12ab91[_0x1f46('0x5')],_0x12ab91[_0x1f46('0x6')],_0x12ab91[_0x1f46('0x7')]));if(_0x12ab91[_0x1f46('0x3')]){utils[_0x1f46('0x8')](_0x12ab91[_0x1f46('0x3')])[_0x1f46('0x9')](function(_0xde8080){if(_0xde8080){_0x12ab91[_0x1f46('0xa')]=_0xde8080[_0x1f46('0xa')];}utils['request']('CreateVoiceQueueReport',_0x12ab91);});}else{utils[_0x1f46('0xb')](_0x1f46('0xc'),_0x12ab91);}if(_0x12ab91[_0x1f46('0xd')]){delete queues[_0x12ab91[_0x1f46('0xd')]];}else{delete queues[_0x12ab91[_0x1f46('0x2')]];}}exports['queuecallerjoin']=function(_0x39af3e){try{utils[_0x1f46('0xe')](util[_0x1f46('0xf')](_0x1f46('0x10'),_0x39af3e[_0x1f46('0x2')]),_0x39af3e);utils[_0x1f46('0x0')](util[_0x1f46('0xf')](_0x1f46('0x11'),_0x39af3e['uniqueid'],_0x39af3e[_0x1f46('0x3')],_0x39af3e[_0x1f46('0x12')]));queues[_0x39af3e[_0x1f46('0x2')]]=_[_0x1f46('0x13')](_0x39af3e,{'originalposition':_0x39af3e[_0x1f46('0x12')],'queuecallerjoinAt':utils[_0x1f46('0x14')](),'mohtime':0x0});}catch(_0x488c2c){utils[_0x1f46('0x15')](util[_0x1f46('0xf')](_0x1f46('0x10'),_0x39af3e[_0x1f46('0x2')]),_0x488c2c);}};exports[_0x1f46('0x16')]=function(_0x106d87){try{if(!_[_0x1f46('0x17')](queues[_0x106d87[_0x1f46('0x2')]])){utils[_0x1f46('0xe')](util[_0x1f46('0xf')](_0x1f46('0x18'),_0x106d87[_0x1f46('0x2')]),_0x106d87);if(queues[_0x106d87[_0x1f46('0x2')]][_0x1f46('0x19')]){if(!queues[_0x106d87['uniqueid']]['queuecallerabandon']&&!queues[_0x106d87[_0x1f46('0x2')]][_0x1f46('0x1a')]){queues[_0x106d87[_0x1f46('0x2')]]['queuecallercomplete']=!![];queues[_0x106d87['uniqueid']][_0x1f46('0x1b')]=utils[_0x1f46('0x14')]();queues[_0x106d87[_0x1f46('0x2')]][_0x1f46('0x7')]='COMPLETEDBYAGENT';}utils[_0x1f46('0x0')](util[_0x1f46('0xf')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x106d87['uniqueid'],queues[_0x106d87['uniqueid']]['name'],queues[_0x106d87[_0x1f46('0x2')]]['queuecallerexitreason']));writeDB(queues[_0x106d87[_0x1f46('0x2')]]);}else if(queues[_0x106d87['uniqueid']][_0x1f46('0xd')]){utils[_0x1f46('0x0')](util[_0x1f46('0xf')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x106d87['uniqueid'],queues[_0x106d87[_0x1f46('0x2')]][_0x1f46('0x1c')],queues[_0x106d87[_0x1f46('0x2')]][_0x1f46('0xd')]));queues[queues[_0x106d87[_0x1f46('0x2')]][_0x1f46('0xd')]]=queues[_0x106d87[_0x1f46('0x2')]];queues[queues[_0x106d87['uniqueid']][_0x1f46('0xd')]][_0x1f46('0x1d')]=0x2;delete queues[_0x106d87[_0x1f46('0x2')]];}}}catch(_0x4c2a6d){utils['error'](util[_0x1f46('0xf')](_0x1f46('0x18'),_0x106d87['uniqueid']),_0x4c2a6d);}};exports[_0x1f46('0x1e')]=function(_0x23ced8){try{utils[_0x1f46('0xe')](util[_0x1f46('0xf')](_0x1f46('0x1f'),_0x23ced8[_0x1f46('0x2')]),_0x23ced8);if(!_[_0x1f46('0x17')](_0x23ced8[_0x1f46('0x20')]['queuestatus'])&&_0x23ced8[_0x1f46('0x21')]['toUpperCase']()!=='CONTINUE'){if(!_[_0x1f46('0x17')](queues[_0x23ced8[_0x1f46('0x2')]])){queues[_0x23ced8[_0x1f46('0x2')]][_0x1f46('0x22')]=![];queues[_0x23ced8[_0x1f46('0x2')]][_0x1f46('0x23')]=null;queues[_0x23ced8['uniqueid']][_0x1f46('0x1a')]=!![];queues[_0x23ced8[_0x1f46('0x2')]]['queuecallerexitAt']=utils['now']();queues[_0x23ced8[_0x1f46('0x2')]][_0x1f46('0x7')]=_0x23ced8[_0x1f46('0x21')][_0x1f46('0x24')]();utils[_0x1f46('0x0')](util[_0x1f46('0xf')](_0x1f46('0x25'),_0x23ced8[_0x1f46('0x2')],queues[_0x23ced8[_0x1f46('0x2')]][_0x1f46('0x1c')],_0x23ced8[_0x1f46('0x21')],queues[_0x23ced8['uniqueid']][_0x1f46('0x7')]));writeDB(queues[_0x23ced8[_0x1f46('0x2')]]);}}else if(!_['isNil'](_0x23ced8['variable'][_0x1f46('0x26')])){if(!_['isNil'](queues[_0x23ced8[_0x1f46('0x2')]])&&!queues[_0x23ced8[_0x1f46('0x2')]][_0x1f46('0x22')]){queues[_0x23ced8['uniqueid']][_0x1f46('0x22')]=![];queues[_0x23ced8[_0x1f46('0x2')]]['queuecallerabandonAt']=null;queues[_0x23ced8['uniqueid']][_0x1f46('0x1a')]=!![];queues[_0x23ced8[_0x1f46('0x2')]][_0x1f46('0x27')]=utils[_0x1f46('0x14')]();queues[_0x23ced8[_0x1f46('0x2')]][_0x1f46('0x7')]=_0x1f46('0x28');utils[_0x1f46('0x0')](util[_0x1f46('0xf')](_0x1f46('0x29'),_0x23ced8[_0x1f46('0x2')],queues[_0x23ced8[_0x1f46('0x2')]][_0x1f46('0x1c')],_0x23ced8['value'],queues[_0x23ced8[_0x1f46('0x2')]][_0x1f46('0x7')]));}}}catch(_0x4f39b7){utils[_0x1f46('0x15')](util[_0x1f46('0xf')](_0x1f46('0x1f'),_0x23ced8['uniqueid']),_0x4f39b7);}};exports[_0x1f46('0x22')]=function(_0x271b76){try{if(!_[_0x1f46('0x17')](queues[_0x271b76[_0x1f46('0x2')]])){utils[_0x1f46('0xe')](util[_0x1f46('0xf')]('[%s][queues][queuecallerabandon]',_0x271b76['uniqueid']),_0x271b76);queues[_0x271b76[_0x1f46('0x2')]]['queuecallerexit']=![];queues[_0x271b76[_0x1f46('0x2')]][_0x1f46('0x27')]=null;queues[_0x271b76[_0x1f46('0x2')]][_0x1f46('0x22')]=!![];queues[_0x271b76['uniqueid']][_0x1f46('0x23')]=utils[_0x1f46('0x14')]();queues[_0x271b76[_0x1f46('0x2')]][_0x1f46('0x7')]='ABANDONED';utils[_0x1f46('0x0')](util['format'](_0x1f46('0x2a'),_0x271b76[_0x1f46('0x2')],queues[_0x271b76[_0x1f46('0x2')]][_0x1f46('0x1c')],queues[_0x271b76[_0x1f46('0x2')]][_0x1f46('0x7')]));}}catch(_0x31b8bd){utils[_0x1f46('0x15')](util[_0x1f46('0xf')]('[%s][queues][queuecallerabandon]',_0x271b76[_0x1f46('0x2')]),_0x31b8bd);}};exports[_0x1f46('0x2b')]=function(_0x3e1ba6){try{if(!_[_0x1f46('0x17')](queues[_0x3e1ba6['uniqueid']])){utils[_0x1f46('0xe')](util[_0x1f46('0xf')]('[%s][queues][queuecallerleave]',_0x3e1ba6[_0x1f46('0x2')]),_0x3e1ba6);utils[_0x1f46('0x0')](util[_0x1f46('0xf')](_0x1f46('0x2c'),_0x3e1ba6[_0x1f46('0x2')],queues[_0x3e1ba6[_0x1f46('0x2')]][_0x1f46('0x1c')],_0x3e1ba6['connectedlinenum'],_0x3e1ba6[_0x1f46('0x2d')]));queues[_0x3e1ba6['uniqueid']][_0x1f46('0x2b')]=!![];queues[_0x3e1ba6['uniqueid']][_0x1f46('0x19')]=utils[_0x1f46('0x14')]();queues[_0x3e1ba6[_0x1f46('0x2')]][_0x1f46('0x2e')]=utils[_0x1f46('0x2f')](queues[_0x3e1ba6[_0x1f46('0x2')]][_0x1f46('0x19')],queues[_0x3e1ba6[_0x1f46('0x2')]][_0x1f46('0x30')]);queues[_0x3e1ba6[_0x1f46('0x2')]][_0x1f46('0x12')]=_0x3e1ba6[_0x1f46('0x12')];queues[_0x3e1ba6[_0x1f46('0x2')]][_0x1f46('0x31')]=_0x3e1ba6['count'];queues[_0x3e1ba6[_0x1f46('0x2')]][_0x1f46('0x32')]=_0x3e1ba6[_0x1f46('0x32')];queues[_0x3e1ba6[_0x1f46('0x2')]][_0x1f46('0x2d')]=_0x3e1ba6[_0x1f46('0x2d')];}}catch(_0x4e7124){utils[_0x1f46('0x15')](util[_0x1f46('0xf')](_0x1f46('0x33'),_0x3e1ba6[_0x1f46('0x2')]),_0x4e7124);}};exports[_0x1f46('0x34')]=function(_0x51fb97){try{if(!_[_0x1f46('0x17')](queues[_0x51fb97[_0x1f46('0x2')]])){utils['debug'](util[_0x1f46('0xf')](_0x1f46('0x35'),_0x51fb97[_0x1f46('0x2')]),_0x51fb97);utils[_0x1f46('0x0')](util['format'](_0x1f46('0x36'),_0x51fb97[_0x1f46('0x2')],queues[_0x51fb97['uniqueid']][_0x1f46('0x1c')],_0x51fb97['membername'],_0x51fb97[_0x1f46('0x37')]));queues[_0x51fb97[_0x1f46('0x2')]]['queuecallerabandon']=![];queues[_0x51fb97[_0x1f46('0x2')]][_0x1f46('0x22')]=![];queues[_0x51fb97[_0x1f46('0x2')]][_0x1f46('0x23')]=null;queues[_0x51fb97[_0x1f46('0x2')]][_0x1f46('0x1a')]=![];queues[_0x51fb97['uniqueid']][_0x1f46('0x7')]=null;queues[_0x51fb97[_0x1f46('0x2')]][_0x1f46('0x27')]=null;queues[_0x51fb97[_0x1f46('0x2')]][_0x1f46('0x38')]=!![];queues[_0x51fb97[_0x1f46('0x2')]][_0x1f46('0x6')]=_0x51fb97['destaccountcode'];queues[_0x51fb97[_0x1f46('0x2')]][_0x1f46('0x4')]=_0x51fb97[_0x1f46('0x39')];}}catch(_0x160432){utils[_0x1f46('0x15')](util['format'](_0x1f46('0x35'),_0x51fb97[_0x1f46('0x2')]),_0x160432);}};exports[_0x1f46('0x3a')]=function(_0x44cbfc){try{if(!_[_0x1f46('0x17')](queues[_0x44cbfc[_0x1f46('0x2')]])){if(queues[_0x44cbfc['uniqueid']]['queuecallerleaveAt']){utils[_0x1f46('0xe')](util[_0x1f46('0xf')](_0x1f46('0x3b'),_0x44cbfc[_0x1f46('0x2')]),_0x44cbfc);queues[_0x44cbfc[_0x1f46('0x2')]][_0x1f46('0x22')]=![];queues[_0x44cbfc['uniqueid']][_0x1f46('0x22')]=![];queues[_0x44cbfc[_0x1f46('0x2')]][_0x1f46('0x23')]=null;queues[_0x44cbfc[_0x1f46('0x2')]][_0x1f46('0x1a')]=![];queues[_0x44cbfc[_0x1f46('0x2')]]['queuecallerexitAt']=null;queues[_0x44cbfc[_0x1f46('0x2')]][_0x1f46('0x38')]=!![];queues[_0x44cbfc[_0x1f46('0x2')]][_0x1f46('0x4')]=_0x44cbfc[_0x1f46('0x39')];queues[_0x44cbfc[_0x1f46('0x2')]]['queuecallercomplete']=!![];queues[_0x44cbfc['uniqueid']][_0x1f46('0x1b')]=utils[_0x1f46('0x14')]();if(_0x44cbfc[_0x1f46('0x3c')]==_0x1f46('0x3d')){if(!queues[_0x44cbfc['uniqueid']][_0x1f46('0x3d')]){queues[_0x44cbfc[_0x1f46('0x2')]][_0x1f46('0x7')]='TRANSFER';}}else{queues[_0x44cbfc['uniqueid']][_0x1f46('0x7')]=_0x1f46('0x3e')+_0x44cbfc['reason'][_0x1f46('0x24')]();}utils[_0x1f46('0x0')](util[_0x1f46('0xf')](_0x1f46('0x3f'),_0x44cbfc['uniqueid'],queues[_0x44cbfc[_0x1f46('0x2')]][_0x1f46('0x1c')],_0x44cbfc['membername'],queues[_0x44cbfc[_0x1f46('0x2')]][_0x1f46('0x7')]));writeDB(queues[_0x44cbfc[_0x1f46('0x2')]]);}}}catch(_0x5071a8){utils[_0x1f46('0x15')](util[_0x1f46('0xf')](_0x1f46('0x3b'),_0x44cbfc[_0x1f46('0x2')]),_0x5071a8);}};exports[_0x1f46('0x40')]=function(_0x2fb168){try{if(!_[_0x1f46('0x17')](queues[_0x2fb168['transfereeuniqueid']])){utils[_0x1f46('0xe')](util[_0x1f46('0xf')](_0x1f46('0x41'),_0x2fb168[_0x1f46('0x2')]),_0x2fb168);queues[_0x2fb168[_0x1f46('0x42')]][_0x1f46('0x3d')]=!![];queues[_0x2fb168[_0x1f46('0x42')]][_0x1f46('0x43')]=_0x1f46('0x44');queues[_0x2fb168[_0x1f46('0x42')]][_0x1f46('0x45')]=_0x2fb168[_0x1f46('0x46')];queues[_0x2fb168['transfereeuniqueid']]['transferuniqueid']=_0x2fb168['transfereeuniqueid'];queues[_0x2fb168[_0x1f46('0x42')]][_0x1f46('0x7')]=_0x1f46('0x47');utils[_0x1f46('0x0')](util[_0x1f46('0xf')](_0x1f46('0x48'),_0x2fb168[_0x1f46('0x2')],queues[_0x2fb168[_0x1f46('0x42')]][_0x1f46('0x1c')],_0x2fb168['transfereeuniqueid'],_0x2fb168[_0x1f46('0x46')]));}}catch(_0x60ab81){utils[_0x1f46('0x15')](util['format']('[%s][queues][blindtransfer]',_0x2fb168[_0x1f46('0x2')]),_0x60ab81);}};exports[_0x1f46('0x49')]=function(_0x36707a){try{utils[_0x1f46('0xe')](util[_0x1f46('0xf')](_0x1f46('0x4a'),_0x36707a[_0x1f46('0x4b')]),_0x36707a);if(_0x36707a[_0x1f46('0x4b')]==_0x36707a[_0x1f46('0x4c')]){if(!_[_0x1f46('0x17')](queues[_0x36707a['secondtransfererlinkedid']])){utils[_0x1f46('0x0')](util[_0x1f46('0xf')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x36707a[_0x1f46('0x4b')],queues[_0x36707a[_0x1f46('0x4d')]]['name'],_0x36707a[_0x1f46('0x4e')]));queues[_0x36707a[_0x1f46('0x4d')]][_0x1f46('0x3d')]=!![];queues[_0x36707a[_0x1f46('0x4d')]][_0x1f46('0x43')]=_0x1f46('0x4f');queues[_0x36707a['secondtransfererlinkedid']]['transferexten']=_0x36707a[_0x1f46('0x4e')];queues[_0x36707a[_0x1f46('0x4d')]]['transferuniqueid']=_0x36707a[_0x1f46('0x4b')];queues[_0x36707a[_0x1f46('0x4d')]][_0x1f46('0x7')]=_0x1f46('0x50');}if(!_[_0x1f46('0x17')](queues[_0x36707a[_0x1f46('0x4c')]])){if(_0x36707a[_0x1f46('0x51')]&&queues[_0x36707a[_0x1f46('0x51')]]){queues[_0x36707a[_0x1f46('0x51')]][_0x1f46('0x1d')]=0x1;queues[_0x36707a[_0x1f46('0x42')]]=_[_0x1f46('0x52')](queues[_0x36707a['transfereelinkedid']]);queues[_0x36707a[_0x1f46('0x42')]][_0x1f46('0xd')]=_0x36707a[_0x1f46('0x53')];queues[_0x36707a[_0x1f46('0x42')]][_0x1f46('0x1d')]=0x2;queues[_0x36707a[_0x1f46('0x42')]][_0x1f46('0x5')]=queues[_0x36707a['secondtransfererlinkedid']][_0x1f46('0x5')];queues[_0x36707a[_0x1f46('0x42')]][_0x1f46('0x54')]=queues[_0x36707a['secondtransfererlinkedid']]['calleridname'];queues[_0x36707a['transfereeuniqueid']][_0x1f46('0x30')]=utils[_0x1f46('0x14')]();queues[_0x36707a['transfereeuniqueid']][_0x1f46('0x19')]=utils[_0x1f46('0x14')]();queues[_0x36707a[_0x1f46('0x42')]][_0x1f46('0x2e')]=0x0;queues[_0x36707a[_0x1f46('0x42')]][_0x1f46('0x55')]=0x0;utils['info'](util[_0x1f46('0xf')](_0x1f46('0x56'),_0x36707a[_0x1f46('0x4b')],queues[_0x36707a[_0x1f46('0x42')]][_0x1f46('0x1c')],queues[_0x36707a[_0x1f46('0x42')]][_0x1f46('0x5')],queues[_0x36707a[_0x1f46('0x42')]][_0x1f46('0x54')]));}else{utils[_0x1f46('0x0')](util[_0x1f46('0xf')](_0x1f46('0x57'),_0x36707a[_0x1f46('0x4b')],queues[_0x36707a['origtransfererlinkedid']][_0x1f46('0x1c')],_0x36707a[_0x1f46('0x4d')]));queues[_0x36707a[_0x1f46('0x4c')]][_0x1f46('0xd')]=_0x36707a[_0x1f46('0x4d')];}}}else if(_0x36707a[_0x1f46('0x58')]==_0x36707a[_0x1f46('0x4d')]){if(!_[_0x1f46('0x17')](queues[_0x36707a[_0x1f46('0x4c')]])){utils[_0x1f46('0x0')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x36707a[_0x1f46('0x4b')],queues[_0x36707a['origtransfererlinkedid']]['name'],_0x36707a[_0x1f46('0x58')],_0x36707a[_0x1f46('0x59')]));queues[_0x36707a[_0x1f46('0x4c')]]['transfer']=!![];queues[_0x36707a[_0x1f46('0x4c')]][_0x1f46('0x43')]=_0x1f46('0x4f');queues[_0x36707a['origtransfererlinkedid']]['transferexten']=_0x36707a['secondtransfererexten'];queues[_0x36707a[_0x1f46('0x4c')]][_0x1f46('0x5a')]=_0x36707a[_0x1f46('0x58')];queues[_0x36707a[_0x1f46('0x4c')]]['queuecallerexitreason']=_0x1f46('0x50');}if(!_[_0x1f46('0x17')](queues[_0x36707a[_0x1f46('0x4d')]])){if(_0x36707a[_0x1f46('0x5b')]&&queues[_0x36707a[_0x1f46('0x5b')]]){queues[_0x36707a[_0x1f46('0x5b')]]['queuecallerenterreason']=0x1;queues[_0x36707a['transfertargetuniqueid']]=_[_0x1f46('0x52')](queues[_0x36707a['transfertargetlinkedid']]);queues[_0x36707a['transfertargetuniqueid']][_0x1f46('0xd')]=_0x36707a[_0x1f46('0x53')];queues[_0x36707a[_0x1f46('0x53')]]['queuecallerenterreason']=0x2;queues[_0x36707a[_0x1f46('0x53')]][_0x1f46('0x5')]=queues[_0x36707a['origtransfererlinkedid']][_0x1f46('0x5')];queues[_0x36707a[_0x1f46('0x53')]][_0x1f46('0x54')]=queues[_0x36707a[_0x1f46('0x4c')]][_0x1f46('0x54')];queues[_0x36707a[_0x1f46('0x53')]][_0x1f46('0x30')]=utils[_0x1f46('0x14')]();queues[_0x36707a[_0x1f46('0x53')]][_0x1f46('0x19')]=utils[_0x1f46('0x14')]();queues[_0x36707a[_0x1f46('0x53')]][_0x1f46('0x2e')]=0x0;queues[_0x36707a[_0x1f46('0x53')]][_0x1f46('0x55')]=0x0;utils[_0x1f46('0x0')](util[_0x1f46('0xf')](_0x1f46('0x5c'),_0x36707a[_0x1f46('0x4b')],queues[_0x36707a[_0x1f46('0x53')]][_0x1f46('0x1c')],queues[_0x36707a[_0x1f46('0x53')]][_0x1f46('0xd')],queues[_0x36707a[_0x1f46('0x53')]][_0x1f46('0x5')],queues[_0x36707a['transfertargetuniqueid']][_0x1f46('0x54')]));}else{utils['info'](util['format'](_0x1f46('0x57'),_0x36707a['origtransfereruniqueid'],queues[_0x36707a[_0x1f46('0x4d')]][_0x1f46('0x1c')],_0x36707a[_0x1f46('0x4c')]));queues[_0x36707a[_0x1f46('0x4d')]][_0x1f46('0xd')]=_0x36707a[_0x1f46('0x4c')];}}}}catch(_0x56bfb9){utils[_0x1f46('0x15')](util[_0x1f46('0xf')](_0x1f46('0x4a'),_0x36707a[_0x1f46('0x4b')]),_0x56bfb9);}};exports[_0x1f46('0x5d')]=function(_0x2ba652){try{if(!_['isNil'](queues[_0x2ba652['uniqueid']])){utils[_0x1f46('0xe')](util['format']('[%s][queues][musiconholdstart]',_0x2ba652[_0x1f46('0x2')]),_0x2ba652);queues[_0x2ba652[_0x1f46('0x2')]][_0x1f46('0x5e')]=utils['now']();utils[_0x1f46('0x0')](util[_0x1f46('0xf')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x2ba652[_0x1f46('0x2')],queues[_0x2ba652[_0x1f46('0x2')]]['name'],queues[_0x2ba652[_0x1f46('0x2')]]['musiconholdstartAt']));}}catch(_0x2e6ea5){utils[_0x1f46('0x15')](util[_0x1f46('0xf')](_0x1f46('0x5f'),_0x2ba652[_0x1f46('0x2')]),_0x2e6ea5);}};exports['musiconholdstop']=function(_0x1fed6e){try{if(!_[_0x1f46('0x17')](queues[_0x1fed6e[_0x1f46('0x2')]])){if(!_[_0x1f46('0x17')](queues[_0x1fed6e['uniqueid']][_0x1f46('0x5e')])){utils['debug'](util[_0x1f46('0xf')](_0x1f46('0x60'),_0x1fed6e['uniqueid']),_0x1fed6e);queues[_0x1fed6e[_0x1f46('0x2')]][_0x1f46('0x55')]+=utils['diffTime'](utils['now'](),queues[_0x1fed6e['uniqueid']][_0x1f46('0x5e')]);utils[_0x1f46('0x0')](util[_0x1f46('0xf')](_0x1f46('0x61'),_0x1fed6e[_0x1f46('0x2')],queues[_0x1fed6e[_0x1f46('0x2')]][_0x1f46('0x1c')],queues[_0x1fed6e[_0x1f46('0x2')]][_0x1f46('0x55')]));delete queues[_0x1fed6e[_0x1f46('0x2')]][_0x1f46('0x5e')];}}}catch(_0x16535e){utils[_0x1f46('0x15')](util[_0x1f46('0xf')](_0x1f46('0x60'),_0x1fed6e[_0x1f46('0x2')]),_0x16535e);}};
\ No newline at end of file
index af83b20..0aca396 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x74a9=['channel','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','error','varset','variable','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','.WAV','monitors','push','hangup','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','forEach','clone','[%s][recordings][hangup]','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','toLowerCase','set','cdr','split','substring','lastIndexOf','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','transferercalleridnum','transfereecalleridnum','transfereruniqueid','blinds','recording','lodash','./utils','./transfers.controller','info','[%s][recordings][writeDB]','uniqueid','transfereeuniqueid','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','format','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten'];(function(_0x32ad08,_0x2dc8a1){var _0x1796cb=function(_0xc32c51){while(--_0xc32c51){_0x32ad08['push'](_0x32ad08['shift']());}};_0x1796cb(++_0x2dc8a1);}(_0x74a9,0xbf));var _0x974a=function(_0x1155e6,_0x233e73){_0x1155e6=_0x1155e6-0x0;var _0x35dd79=_0x74a9[_0x1155e6];return _0x35dd79;};'use strict';var _=require(_0x974a('0x0'));var util=require('util');var utils=require(_0x974a('0x1'));var transfers=require(_0x974a('0x2'));var recordings={};function writeDB(_0x4ca920){var _0x358c5e;utils[_0x974a('0x3')](util['format'](_0x974a('0x4'),_0x4ca920['uniqueid']));if(transfers['blinds'][_0x4ca920[_0x974a('0x5')]]){_0x358c5e=_0x4ca920[_0x974a('0x5')];_0x4ca920[_0x974a('0x5')]=transfers['blinds'][_0x4ca920['uniqueid']][_0x974a('0x6')];}if(_0x4ca920[_0x974a('0x7')]){utils[_0x974a('0x8')](_0x4ca920[_0x974a('0x7')])[_0x974a('0x9')](function(_0x55d063){if(_0x55d063){_0x4ca920[_0x974a('0xa')]=_0x55d063[_0x974a('0xb')];_0x4ca920[_0x974a('0xc')]=_0x55d063['id'];}utils['request']('CreateVoiceRecording',_0x4ca920);});}else{utils[_0x974a('0xd')](_0x974a('0xe'),_0x4ca920);}if(_0x358c5e)delete transfers['blinds'][_0x358c5e];}exports[_0x974a('0xf')]=function(_0x5bd041){try{utils[_0x974a('0x10')](util[_0x974a('0x11')]('[%s][recordings][newchannel]',_0x5bd041[_0x974a('0x5')]),_0x5bd041);if(_0x5bd041[_0x974a('0x5')]==_0x5bd041[_0x974a('0x12')]){utils[_0x974a('0x3')](util[_0x974a('0x11')](_0x974a('0x13'),_0x5bd041[_0x974a('0x5')],_0x5bd041[_0x974a('0x14')],_0x5bd041[_0x974a('0x15')]));recordings[_0x5bd041['uniqueid']]={'uniqueid':_0x5bd041[_0x974a('0x5')],'accountcode':_0x5bd041['accountcode'],'exten':_0x5bd041[_0x974a('0x15')],'context':_0x5bd041[_0x974a('0x14')],'channel':_0x5bd041[_0x974a('0x16')],'monitors':[]};}}catch(_0x6600b){utils['error'](util[_0x974a('0x11')]('[%s][recordings][newchannel]',_0x5bd041[_0x974a('0x5')]),_0x6600b);}};exports['newstate']=function(_0x2e1202){try{utils['debug'](util[_0x974a('0x11')](_0x974a('0x17'),_0x2e1202['uniqueid']),_0x2e1202);if(!_[_0x974a('0x18')](recordings[_0x2e1202[_0x974a('0x5')]])&&_0x2e1202[_0x974a('0x19')]==0x6){utils[_0x974a('0x3')](util['format'](_0x974a('0x1a'),_0x2e1202['uniqueid'],_0x2e1202[_0x974a('0x14')],_0x2e1202[_0x974a('0x16')]));}else if(!_[_0x974a('0x18')](recordings[_0x2e1202[_0x974a('0x12')]])&&_0x2e1202['channelstate']==0x6&&_0x2e1202['context']!=_0x974a('0x1b')){utils[_0x974a('0x3')](util[_0x974a('0x11')](_0x974a('0x1c'),_0x2e1202[_0x974a('0x5')],_0x2e1202[_0x974a('0x12')],_0x2e1202[_0x974a('0x14')],_0x2e1202['channel']));recordings[_0x2e1202[_0x974a('0x12')]][_0x974a('0x7')]=_0x2e1202[_0x974a('0x7')];}}catch(_0x2db870){utils[_0x974a('0x1d')](util[_0x974a('0x11')](_0x974a('0x17'),_0x2e1202[_0x974a('0x5')]),_0x2db870);}};exports[_0x974a('0x1e')]=function(_0x2710f4){try{if(!_[_0x974a('0x18')](_0x2710f4[_0x974a('0x1f')])&&!_['isNil'](_0x2710f4[_0x974a('0x1f')]['mixmonitor_filename'])){utils[_0x974a('0x10')](util['format'](_0x974a('0x20'),_0x2710f4[_0x974a('0x5')]),_0x2710f4);utils[_0x974a('0x3')](util[_0x974a('0x11')](_0x974a('0x21'),_0x2710f4[_0x974a('0x5')],_0x2710f4[_0x974a('0x1f')],_0x2710f4[_0x974a('0x22')]));if(_[_0x974a('0x23')](_0x2710f4[_0x974a('0x22')],_0x974a('0x24'))){_0x2710f4[_0x974a('0x22')]=_0x2710f4[_0x974a('0x22')]['replace'](_0x974a('0x24'),_0x974a('0x25'));}if(recordings[_0x2710f4['linkedid']]){var _0x387f23=_['find'](recordings[_0x2710f4[_0x974a('0x12')]]['monitors'],{'value':_0x2710f4['value']});if(_['isNil'](_0x387f23)){recordings[_0x2710f4[_0x974a('0x12')]][_0x974a('0x26')][_0x974a('0x27')]({'value':_0x2710f4[_0x974a('0x22')]});}}}}catch(_0x3a3c99){utils[_0x974a('0x1d')](util[_0x974a('0x11')](_0x974a('0x20'),_0x2710f4[_0x974a('0x5')]),_0x3a3c99);}};exports[_0x974a('0x28')]=function(_0x3c0dd9){try{if(!_[_0x974a('0x18')](recordings[_0x3c0dd9[_0x974a('0x5')]])){utils['debug'](util[_0x974a('0x11')]('[%s][recordings][hangup]',_0x3c0dd9['uniqueid']),_0x3c0dd9);utils[_0x974a('0x3')](util['format']('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x3c0dd9[_0x974a('0x5')],_0x3c0dd9[_0x974a('0x29')],_0x3c0dd9[_0x974a('0x2a')],_0x3c0dd9[_0x974a('0x2b')]));recordings[_0x3c0dd9['uniqueid']][_0x974a('0x29')]=_0x3c0dd9[_0x974a('0x29')];recordings[_0x3c0dd9[_0x974a('0x5')]][_0x974a('0x2a')]=_0x3c0dd9[_0x974a('0x2a')];recordings[_0x3c0dd9['uniqueid']][_0x974a('0x2c')]=_0x3c0dd9[_0x974a('0x2c')];recordings[_0x3c0dd9[_0x974a('0x5')]][_0x974a('0x2d')]=_0x3c0dd9[_0x974a('0x2d')];if(recordings[_0x3c0dd9['uniqueid']][_0x974a('0x2e')]==_0x974a('0x2f')&&recordings[_0x3c0dd9[_0x974a('0x5')]][_0x974a('0x7')]){recordings[_0x3c0dd9[_0x974a('0x5')]]['connectedlinenum']=recordings[_0x3c0dd9[_0x974a('0x5')]][_0x974a('0x7')];recordings[_0x3c0dd9[_0x974a('0x5')]][_0x974a('0x2d')]='';}recordings[_0x3c0dd9[_0x974a('0x5')]][_0x974a('0x26')][_0x974a('0x30')](function(_0x30abb2){var _0xdfbee=_[_0x974a('0x31')](recordings[_0x3c0dd9[_0x974a('0x5')]]);_0xdfbee[_0x974a('0x22')]=_0x30abb2[_0x974a('0x22')];writeDB(_0xdfbee);});delete recordings[_0x3c0dd9['uniqueid']];}}catch(_0x4e025f){utils[_0x974a('0x1d')](util[_0x974a('0x11')](_0x974a('0x32'),_0x3c0dd9[_0x974a('0x5')]),_0x4e025f);}};exports[_0x974a('0x33')]=function(_0x115bf7){try{if(!_[_0x974a('0x18')](recordings[_0x115bf7[_0x974a('0x5')]])){utils[_0x974a('0x10')](util[_0x974a('0x11')](_0x974a('0x34'),_0x115bf7[_0x974a('0x5')]),_0x115bf7);utils[_0x974a('0x3')](util[_0x974a('0x11')](_0x974a('0x35'),_0x115bf7['uniqueid'],_0x115bf7['application'],_0x115bf7[_0x974a('0x36')]));if(_0x115bf7['application'][_0x974a('0x37')]()==_0x974a('0x38')&&_['startsWith'](_0x115bf7[_0x974a('0x36')][_0x974a('0x37')](),_0x974a('0x39'))){var _0x37193e=_0x115bf7[_0x974a('0x36')][_0x974a('0x3a')]('=');var _0x56b473=_0x37193e[0x0][_0x974a('0x3b')](_0x37193e[0x0][_0x974a('0x3c')]('(')+0x1,_0x37193e[0x0][_0x974a('0x3c')](')'));var _0x20c8a2=_0x37193e[0x1];recordings[_0x115bf7['uniqueid']][_0x56b473]=_0x20c8a2;}}}catch(_0x364a96){utils['error'](util[_0x974a('0x11')](_0x974a('0x34'),_0x115bf7[_0x974a('0x5')]),_0x364a96);}};exports['queuecallerjoin']=function(_0x313807){try{if(!_[_0x974a('0x18')](recordings[_0x313807[_0x974a('0x5')]])){utils['debug'](util['format'](_0x974a('0x3d'),_0x313807[_0x974a('0x5')]),_0x313807);utils[_0x974a('0x3')](util[_0x974a('0x11')](_0x974a('0x3e'),_0x313807['uniqueid'],_0x313807[_0x974a('0x3f')]));recordings[_0x313807[_0x974a('0x5')]][_0x974a('0x3f')]=_0x313807['queue'];}}catch(_0x220218){utils[_0x974a('0x1d')](util[_0x974a('0x11')](_0x974a('0x3d'),_0x313807['uniqueid']),_0x220218);}};exports[_0x974a('0x40')]=function(_0x129c4f){try{utils[_0x974a('0x10')](util[_0x974a('0x11')](_0x974a('0x41'),_0x129c4f[_0x974a('0x5')]),_0x129c4f);utils[_0x974a('0x3')](util['format']('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x129c4f[_0x974a('0x5')],_0x129c4f[_0x974a('0x42')],_0x129c4f['transferercalleridname'],_0x129c4f[_0x974a('0x43')],_0x129c4f['transfereecalleridname']));if(recordings[_0x129c4f[_0x974a('0x44')]]&&transfers[_0x974a('0x45')][_0x129c4f['transfereruniqueid']]){transfers[_0x974a('0x45')][_0x129c4f[_0x974a('0x44')]][_0x974a('0x46')]=!![];}}catch(_0x9d191){utils[_0x974a('0x1d')](util['format'](_0x974a('0x41'),_0x129c4f['uniqueid']),_0x9d191);}};
\ No newline at end of file
+var _0xde91=['./utils','./transfers.controller','info','blinds','uniqueid','transfereeuniqueid','accountcode','getUserByInternal','then','membername','name','request','CreateVoiceRecording','newchannel','format','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','newstate','debug','[%s][recordings][newstate]','isNil','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','error','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','calleridnum','cause-txt','calleridname','connectedlinenum','connectedlinename','outbound','forEach','clone','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','appdata','cdr','split','substring','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','blindtransfer','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereruniqueid','[%s][recordings][blindtransfer]','util'];(function(_0x2772ac,_0x456670){var _0x56e564=function(_0x5c4d22){while(--_0x5c4d22){_0x2772ac['push'](_0x2772ac['shift']());}};_0x56e564(++_0x456670);}(_0xde91,0x12b));var _0x1de9=function(_0x1b8e60,_0x21b885){_0x1b8e60=_0x1b8e60-0x0;var _0x363363=_0xde91[_0x1b8e60];return _0x363363;};'use strict';var _=require('lodash');var util=require(_0x1de9('0x0'));var utils=require(_0x1de9('0x1'));var transfers=require(_0x1de9('0x2'));var recordings={};function writeDB(_0x179fe6){var _0x5556dd;utils[_0x1de9('0x3')](util['format']('[%s][recordings][writeDB]',_0x179fe6['uniqueid']));if(transfers[_0x1de9('0x4')][_0x179fe6[_0x1de9('0x5')]]){_0x5556dd=_0x179fe6['uniqueid'];_0x179fe6[_0x1de9('0x5')]=transfers[_0x1de9('0x4')][_0x179fe6[_0x1de9('0x5')]][_0x1de9('0x6')];}if(_0x179fe6[_0x1de9('0x7')]){utils[_0x1de9('0x8')](_0x179fe6['accountcode'])[_0x1de9('0x9')](function(_0x3ffaf2){if(_0x3ffaf2){_0x179fe6[_0x1de9('0xa')]=_0x3ffaf2[_0x1de9('0xb')];_0x179fe6['UserId']=_0x3ffaf2['id'];}utils[_0x1de9('0xc')](_0x1de9('0xd'),_0x179fe6);});}else{utils[_0x1de9('0xc')](_0x1de9('0xd'),_0x179fe6);}if(_0x5556dd)delete transfers['blinds'][_0x5556dd];}exports[_0x1de9('0xe')]=function(_0x597d6b){try{utils['debug'](util[_0x1de9('0xf')](_0x1de9('0x10'),_0x597d6b['uniqueid']),_0x597d6b);if(_0x597d6b[_0x1de9('0x5')]==_0x597d6b[_0x1de9('0x11')]){utils[_0x1de9('0x3')](util['format'](_0x1de9('0x12'),_0x597d6b[_0x1de9('0x5')],_0x597d6b[_0x1de9('0x13')],_0x597d6b[_0x1de9('0x14')]));recordings[_0x597d6b[_0x1de9('0x5')]]={'uniqueid':_0x597d6b[_0x1de9('0x5')],'accountcode':_0x597d6b[_0x1de9('0x7')],'exten':_0x597d6b['exten'],'context':_0x597d6b[_0x1de9('0x13')],'channel':_0x597d6b[_0x1de9('0x15')],'monitors':[]};}}catch(_0x51d9ca){utils['error'](util[_0x1de9('0xf')](_0x1de9('0x10'),_0x597d6b[_0x1de9('0x5')]),_0x51d9ca);}};exports[_0x1de9('0x16')]=function(_0x2adb59){try{utils[_0x1de9('0x17')](util[_0x1de9('0xf')](_0x1de9('0x18'),_0x2adb59['uniqueid']),_0x2adb59);if(!_[_0x1de9('0x19')](recordings[_0x2adb59[_0x1de9('0x5')]])&&_0x2adb59['channelstate']==0x6){utils['info'](util['format'](_0x1de9('0x1a'),_0x2adb59['uniqueid'],_0x2adb59['context'],_0x2adb59[_0x1de9('0x15')]));}else if(!_['isNil'](recordings[_0x2adb59[_0x1de9('0x11')]])&&_0x2adb59[_0x1de9('0x1b')]==0x6&&_0x2adb59['context']!=_0x1de9('0x1c')){utils[_0x1de9('0x3')](util[_0x1de9('0xf')](_0x1de9('0x1d'),_0x2adb59[_0x1de9('0x5')],_0x2adb59[_0x1de9('0x11')],_0x2adb59[_0x1de9('0x13')],_0x2adb59[_0x1de9('0x15')]));recordings[_0x2adb59[_0x1de9('0x11')]]['accountcode']=_0x2adb59[_0x1de9('0x7')];}}catch(_0x5ec02e){utils[_0x1de9('0x1e')](util[_0x1de9('0xf')](_0x1de9('0x18'),_0x2adb59[_0x1de9('0x5')]),_0x5ec02e);}};exports[_0x1de9('0x1f')]=function(_0x130f38){try{if(!_['isNil'](_0x130f38[_0x1de9('0x20')])&&!_['isNil'](_0x130f38[_0x1de9('0x20')][_0x1de9('0x21')])){utils[_0x1de9('0x17')](util['format'](_0x1de9('0x22'),_0x130f38[_0x1de9('0x5')]),_0x130f38);utils[_0x1de9('0x3')](util[_0x1de9('0xf')](_0x1de9('0x23'),_0x130f38['uniqueid'],_0x130f38['variable'],_0x130f38[_0x1de9('0x24')]));if(_[_0x1de9('0x25')](_0x130f38[_0x1de9('0x24')],_0x1de9('0x26'))){_0x130f38['value']=_0x130f38[_0x1de9('0x24')][_0x1de9('0x27')](_0x1de9('0x26'),_0x1de9('0x28'));}if(recordings[_0x130f38[_0x1de9('0x11')]]){var _0xe14e4a=_[_0x1de9('0x29')](recordings[_0x130f38[_0x1de9('0x11')]]['monitors'],{'value':_0x130f38[_0x1de9('0x24')]});if(_[_0x1de9('0x19')](_0xe14e4a)){recordings[_0x130f38[_0x1de9('0x11')]][_0x1de9('0x2a')][_0x1de9('0x2b')]({'value':_0x130f38[_0x1de9('0x24')]});}}}}catch(_0x1a6059){utils['error'](util[_0x1de9('0xf')]('[%s][recordings][varset]',_0x130f38[_0x1de9('0x5')]),_0x1a6059);}};exports[_0x1de9('0x2c')]=function(_0x21c81c){try{if(!_[_0x1de9('0x19')](recordings[_0x21c81c[_0x1de9('0x5')]])){utils[_0x1de9('0x17')](util[_0x1de9('0xf')](_0x1de9('0x2d'),_0x21c81c[_0x1de9('0x5')]),_0x21c81c);utils['info'](util['format']('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x21c81c[_0x1de9('0x5')],_0x21c81c[_0x1de9('0x2e')],_0x21c81c['calleridname'],_0x21c81c[_0x1de9('0x2f')]));recordings[_0x21c81c[_0x1de9('0x5')]][_0x1de9('0x2e')]=_0x21c81c[_0x1de9('0x2e')];recordings[_0x21c81c[_0x1de9('0x5')]][_0x1de9('0x30')]=_0x21c81c[_0x1de9('0x30')];recordings[_0x21c81c[_0x1de9('0x5')]][_0x1de9('0x31')]=_0x21c81c[_0x1de9('0x31')];recordings[_0x21c81c['uniqueid']]['connectedlinename']=_0x21c81c[_0x1de9('0x32')];if(recordings[_0x21c81c[_0x1de9('0x5')]]['type']==_0x1de9('0x33')&&recordings[_0x21c81c[_0x1de9('0x5')]]['accountcode']){recordings[_0x21c81c[_0x1de9('0x5')]]['connectedlinenum']=recordings[_0x21c81c['uniqueid']][_0x1de9('0x7')];recordings[_0x21c81c[_0x1de9('0x5')]]['connectedlinename']='';}recordings[_0x21c81c[_0x1de9('0x5')]][_0x1de9('0x2a')][_0x1de9('0x34')](function(_0x277034){var _0x3bd0b7=_[_0x1de9('0x35')](recordings[_0x21c81c[_0x1de9('0x5')]]);_0x3bd0b7[_0x1de9('0x24')]=_0x277034['value'];writeDB(_0x3bd0b7);});delete recordings[_0x21c81c[_0x1de9('0x5')]];}}catch(_0x147008){utils[_0x1de9('0x1e')](util['format'](_0x1de9('0x2d'),_0x21c81c[_0x1de9('0x5')]),_0x147008);}};exports[_0x1de9('0x36')]=function(_0x258f67){try{if(!_[_0x1de9('0x19')](recordings[_0x258f67[_0x1de9('0x5')]])){utils[_0x1de9('0x17')](util['format']('[%s][recordings][newexten]',_0x258f67[_0x1de9('0x5')]),_0x258f67);utils[_0x1de9('0x3')](util[_0x1de9('0xf')](_0x1de9('0x37'),_0x258f67[_0x1de9('0x5')],_0x258f67[_0x1de9('0x38')],_0x258f67['appdata']));if(_0x258f67[_0x1de9('0x38')][_0x1de9('0x39')]()==_0x1de9('0x3a')&&_[_0x1de9('0x3b')](_0x258f67[_0x1de9('0x3c')][_0x1de9('0x39')](),_0x1de9('0x3d'))){var _0x54c000=_0x258f67[_0x1de9('0x3c')][_0x1de9('0x3e')]('=');var _0x2cd36c=_0x54c000[0x0][_0x1de9('0x3f')](_0x54c000[0x0]['lastIndexOf']('(')+0x1,_0x54c000[0x0][_0x1de9('0x40')](')'));var _0x4abfda=_0x54c000[0x1];recordings[_0x258f67[_0x1de9('0x5')]][_0x2cd36c]=_0x4abfda;}}}catch(_0x2c19f2){utils[_0x1de9('0x1e')](util['format'](_0x1de9('0x41'),_0x258f67[_0x1de9('0x5')]),_0x2c19f2);}};exports[_0x1de9('0x42')]=function(_0x48709b){try{if(!_[_0x1de9('0x19')](recordings[_0x48709b['uniqueid']])){utils[_0x1de9('0x17')](util[_0x1de9('0xf')](_0x1de9('0x43'),_0x48709b[_0x1de9('0x5')]),_0x48709b);utils[_0x1de9('0x3')](util[_0x1de9('0xf')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x48709b[_0x1de9('0x5')],_0x48709b[_0x1de9('0x44')]));recordings[_0x48709b[_0x1de9('0x5')]][_0x1de9('0x44')]=_0x48709b[_0x1de9('0x44')];}}catch(_0x154bf9){utils[_0x1de9('0x1e')](util['format'](_0x1de9('0x43'),_0x48709b[_0x1de9('0x5')]),_0x154bf9);}};exports[_0x1de9('0x45')]=function(_0x4dae80){try{utils[_0x1de9('0x17')](util[_0x1de9('0xf')]('[%s][recordings][blindtransfer]',_0x4dae80[_0x1de9('0x5')]),_0x4dae80);utils['info'](util[_0x1de9('0xf')](_0x1de9('0x46'),_0x4dae80[_0x1de9('0x5')],_0x4dae80[_0x1de9('0x47')],_0x4dae80[_0x1de9('0x48')],_0x4dae80['transfereecalleridnum'],_0x4dae80['transfereecalleridname']));if(recordings[_0x4dae80[_0x1de9('0x49')]]&&transfers[_0x1de9('0x4')][_0x4dae80['transfereruniqueid']]){transfers[_0x1de9('0x4')][_0x4dae80[_0x1de9('0x49')]]['recording']=!![];}}catch(_0x46fcd7){utils['error'](util['format'](_0x1de9('0x4a'),_0x4dae80[_0x1de9('0x5')]),_0x46fcd7);}};
\ No newline at end of file
index b2d325b..6660c2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb2e6=['[%s][transfers][attendedtransfer]','util','./utils','info','type','attended','origtransfereruniqueid','uniqueid','request','debug','format','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','blinds','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','origtransfererchannel','secondtransfererconnectedlinename','secondtransferercontext','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten'];(function(_0x314c8f,_0x3e367c){var _0x4b202e=function(_0x5686be){while(--_0x5686be){_0x314c8f['push'](_0x314c8f['shift']());}};_0x4b202e(++_0x3e367c);}(_0xb2e6,0xba));var _0x6b2e=function(_0x5b59de,_0x1b22c9){_0x5b59de=_0x5b59de-0x0;var _0x142bdf=_0xb2e6[_0x5b59de];return _0x142bdf;};'use strict';var _=require('lodash');var util=require(_0x6b2e('0x0'));var utils=require(_0x6b2e('0x1'));function writeDB(_0x84319a){utils[_0x6b2e('0x2')](util['format']('[%s][transfers][writeDB]\x20type:%s',_0x84319a[_0x6b2e('0x3')]===_0x6b2e('0x4')?_0x84319a[_0x6b2e('0x5')]:_0x84319a[_0x6b2e('0x6')],_0x84319a[_0x6b2e('0x3')]));utils[_0x6b2e('0x7')]('CreateVoiceTransferReport',_0x84319a);}exports['blinds']={};exports['blindtransfer']=function(_0x2c958e){try{utils[_0x6b2e('0x8')](util['format']('[%s][transfers][blindtransfer]',_0x2c958e[_0x6b2e('0x6')]),_0x2c958e);utils[_0x6b2e('0x2')](util[_0x6b2e('0x9')](_0x6b2e('0xa'),_0x2c958e[_0x6b2e('0x6')],_0x2c958e[_0x6b2e('0xb')],_0x2c958e[_0x6b2e('0xc')],_0x2c958e[_0x6b2e('0xd')],_0x2c958e[_0x6b2e('0xe')]));_0x2c958e[_0x6b2e('0x3')]=_0x6b2e('0xf');exports[_0x6b2e('0x10')][_0x2c958e[_0x6b2e('0x11')]]=_0x2c958e;writeDB(_0x2c958e);}catch(_0x463eb6){utils[_0x6b2e('0x12')](util[_0x6b2e('0x9')]('[%s][transfers][blindtransfer]',_0x2c958e[_0x6b2e('0x6')]),_0x463eb6);}};exports[_0x6b2e('0x13')]=function(_0x3a744b){try{utils[_0x6b2e('0x8')](util[_0x6b2e('0x9')]('[%s][transfers][attendedtransfer]',_0x3a744b[_0x6b2e('0x5')]),_0x3a744b);utils[_0x6b2e('0x2')](util['format'](_0x6b2e('0x14'),_0x3a744b['origtransfereruniqueid'],_0x3a744b[_0x6b2e('0x15')],_0x3a744b[_0x6b2e('0x16')],_0x3a744b[_0x6b2e('0x17')],_0x3a744b[_0x6b2e('0x18')]));_0x3a744b=_['assign'](_0x3a744b,{'transfererchannel':_0x3a744b[_0x6b2e('0x19')],'transferercalleridnum':_0x3a744b[_0x6b2e('0x15')],'transferercalleridname':_0x3a744b['origtransferercalleridname'],'transfererconnectedlinenum':_0x3a744b['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x3a744b[_0x6b2e('0x1a')],'transfereraccountcode':_0x3a744b['origtransfereraccountcode'],'transferercontext':_0x3a744b[_0x6b2e('0x1b')],'transfererexten':_0x3a744b['secondtransfererexten'],'transfererlinkedid':_0x3a744b[_0x6b2e('0x1c')],'context':_0x3a744b[_0x6b2e('0x1d')],'extension':_0x3a744b[_0x6b2e('0x1e')],'type':_0x6b2e('0x4')});if(_[_0x6b2e('0x1f')](_0x3a744b['transfereechannel'])){_0x3a744b=_['assign'](_0x3a744b,{'transfereechannel':_0x3a744b['transfertargetchannel'],'transfereecalleridnum':_0x3a744b[_0x6b2e('0x17')],'transfereecalleridname':_0x3a744b[_0x6b2e('0x18')],'transfereeconnectedlinenum':_0x3a744b[_0x6b2e('0x20')],'transfereeconnectedlinename':_0x3a744b[_0x6b2e('0x21')],'transfereeaccountcode':_0x3a744b[_0x6b2e('0x22')],'transfereecontext':_0x3a744b['transfertargetcontext'],'transfereeexten':_0x3a744b[_0x6b2e('0x23')],'transfereelinkedid':_0x3a744b['transfertargetlinkedid']});}writeDB(_0x3a744b);}catch(_0x400073){utils['error'](util[_0x6b2e('0x9')](_0x6b2e('0x24'),_0x3a744b[_0x6b2e('0x5')]),_0x400073);}};
\ No newline at end of file
+var _0xe744=['transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','lodash','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blindtransfer','[%s][transfers][blindtransfer]','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blinds','transfereruniqueid','error','attendedtransfer','debug','[%s][transfers][attendedtransfer]','origtransferercalleridnum','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','transfereechannel'];(function(_0x193a56,_0x3461c6){var _0x1d64bd=function(_0x403f48){while(--_0x403f48){_0x193a56['push'](_0x193a56['shift']());}};_0x1d64bd(++_0x3461c6);}(_0xe744,0x166));var _0x4e74=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xe744[_0x11005e];return _0x29338f;};'use strict';var _=require(_0x4e74('0x0'));var util=require('util');var utils=require(_0x4e74('0x1'));function writeDB(_0x8a5fd2){utils[_0x4e74('0x2')](util[_0x4e74('0x3')](_0x4e74('0x4'),_0x8a5fd2[_0x4e74('0x5')]===_0x4e74('0x6')?_0x8a5fd2[_0x4e74('0x7')]:_0x8a5fd2[_0x4e74('0x8')],_0x8a5fd2[_0x4e74('0x5')]));utils[_0x4e74('0x9')](_0x4e74('0xa'),_0x8a5fd2);}exports['blinds']={};exports[_0x4e74('0xb')]=function(_0x21ddf9){try{utils['debug'](util['format'](_0x4e74('0xc'),_0x21ddf9[_0x4e74('0x8')]),_0x21ddf9);utils[_0x4e74('0x2')](util[_0x4e74('0x3')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x21ddf9[_0x4e74('0x8')],_0x21ddf9[_0x4e74('0xd')],_0x21ddf9[_0x4e74('0xe')],_0x21ddf9[_0x4e74('0xf')],_0x21ddf9[_0x4e74('0x10')]));_0x21ddf9[_0x4e74('0x5')]='blind';exports[_0x4e74('0x11')][_0x21ddf9[_0x4e74('0x12')]]=_0x21ddf9;writeDB(_0x21ddf9);}catch(_0x422172){utils[_0x4e74('0x13')](util[_0x4e74('0x3')](_0x4e74('0xc'),_0x21ddf9[_0x4e74('0x8')]),_0x422172);}};exports[_0x4e74('0x14')]=function(_0xe2d9b6){try{utils[_0x4e74('0x15')](util[_0x4e74('0x3')](_0x4e74('0x16'),_0xe2d9b6['origtransfereruniqueid']),_0xe2d9b6);utils[_0x4e74('0x2')](util[_0x4e74('0x3')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0xe2d9b6[_0x4e74('0x7')],_0xe2d9b6[_0x4e74('0x17')],_0xe2d9b6['origtransferercalleridname'],_0xe2d9b6[_0x4e74('0x18')],_0xe2d9b6[_0x4e74('0x19')]));_0xe2d9b6=_[_0x4e74('0x1a')](_0xe2d9b6,{'transfererchannel':_0xe2d9b6[_0x4e74('0x1b')],'transferercalleridnum':_0xe2d9b6[_0x4e74('0x17')],'transferercalleridname':_0xe2d9b6[_0x4e74('0x1c')],'transfererconnectedlinenum':_0xe2d9b6[_0x4e74('0x1d')],'transfererconnectedlinename':_0xe2d9b6[_0x4e74('0x1e')],'transfereraccountcode':_0xe2d9b6[_0x4e74('0x1f')],'transferercontext':_0xe2d9b6[_0x4e74('0x20')],'transfererexten':_0xe2d9b6[_0x4e74('0x21')],'transfererlinkedid':_0xe2d9b6[_0x4e74('0x22')],'context':_0xe2d9b6[_0x4e74('0x23')],'extension':_0xe2d9b6[_0x4e74('0x24')],'type':_0x4e74('0x6')});if(_['isNil'](_0xe2d9b6[_0x4e74('0x25')])){_0xe2d9b6=_[_0x4e74('0x1a')](_0xe2d9b6,{'transfereechannel':_0xe2d9b6[_0x4e74('0x26')],'transfereecalleridnum':_0xe2d9b6[_0x4e74('0x18')],'transfereecalleridname':_0xe2d9b6['transfertargetcalleridname'],'transfereeconnectedlinenum':_0xe2d9b6[_0x4e74('0x27')],'transfereeconnectedlinename':_0xe2d9b6[_0x4e74('0x28')],'transfereeaccountcode':_0xe2d9b6[_0x4e74('0x29')],'transfereecontext':_0xe2d9b6['transfertargetcontext'],'transfereeexten':_0xe2d9b6[_0x4e74('0x2a')],'transfereelinkedid':_0xe2d9b6[_0x4e74('0x2b')]});}writeDB(_0xe2d9b6);}catch(_0x4398fc){utils[_0x4e74('0x13')](util[_0x4e74('0x3')]('[%s][transfers][attendedtransfer]',_0xe2d9b6['origtransfereruniqueid']),_0x4398fc);}};
\ No newline at end of file
index 713e291..7ab6e15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe54=['found','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]','getVoiceQueueByName','type','acw','[utils][getVoiceQueueByName]','addTime','add','seconds','subtractTime','subtract','format','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','sumTime','now','isBefore','bluebird','jayson/promise','util','http','inspect','debug','error','request','then','catch','[utils][request]\x20name:%s','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','info','[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s'];(function(_0x53b399,_0xab5a29){var _0x2983c3=function(_0x366c01){while(--_0x366c01){_0x53b399['push'](_0x53b399['shift']());}};_0x2983c3(++_0xab5a29);}(_0xbe54,0x9e));var _0x4be5=function(_0x2c6d9e,_0x2e466e){_0x2c6d9e=_0x2c6d9e-0x0;var _0x9c555f=_0xbe54[_0x2c6d9e];return _0x9c555f;};'use strict';var BPromise=require(_0x4be5('0x0'));var jayson=require(_0x4be5('0x1'));var moment=require('moment');var util=require(_0x4be5('0x2'));var client=jayson['client'][_0x4be5('0x3')]({'port':0x2329});var logger=require('../../config/logger')('xdr');exports['info']=function(_0x5e0437,_0x107a04){logger['info'](_0x5e0437,_0x107a04?util[_0x4be5('0x4')](_0x107a04,{'showHidden':![],'depth':null}):'');};exports[_0x4be5('0x5')]=function(_0x35eae7,_0x491390){logger[_0x4be5('0x5')](_0x35eae7,_0x491390?util[_0x4be5('0x4')](_0x491390,{'showHidden':![],'depth':null}):'');};exports[_0x4be5('0x6')]=function(_0x3db3c7,_0xb676a2){logger[_0x4be5('0x6')](_0x3db3c7,_0xb676a2?util['inspect'](_0xb676a2,{'showHidden':![],'depth':null}):'');};exports[_0x4be5('0x7')]=function(_0x176640,_0x4fb2e0){return client[_0x4be5('0x7')](_0x176640,{'body':_0x4fb2e0})[_0x4be5('0x8')](function(_0x8efef0){logger[_0x4be5('0x5')]('[utils][request]\x20name:%s',_0x176640,_0x8efef0?util[_0x4be5('0x4')](_0x8efef0,{'showHidden':![],'depth':null}):'');})[_0x4be5('0x9')](function(_0x49d58a){logger[_0x4be5('0x6')](_0x4be5('0xa'),_0x176640,_0x49d58a?util[_0x4be5('0x4')](_0x49d58a,{'showHidden':![],'depth':null}):'');});};function getUser(_0x260de4){return client[_0x4be5('0x7')](_0x4be5('0xb'),{'options':{'raw':!![],'attributes':['id',_0x4be5('0xc'),_0x4be5('0xd'),_0x4be5('0xe')],'where':_0x260de4,'limit':0x1}})[_0x4be5('0x8')](function(_0xe65d4a){logger[_0x4be5('0x5')](_0x4be5('0xf'),JSON[_0x4be5('0x10')](_0x260de4),_0xe65d4a?util[_0x4be5('0x4')](_0xe65d4a,{'showHidden':![],'depth':null}):'');return _0xe65d4a[_0x4be5('0x11')][_0x4be5('0x12')]?_0xe65d4a[_0x4be5('0x11')][0x0]:null;});}exports[_0x4be5('0x13')]=function(_0x52d74d){return new BPromise(function(_0x491d87,_0x2b1a7d){if(_0x52d74d){return getUser({'internal':_0x52d74d})['then'](function(_0x30e18d){logger[_0x4be5('0x14')](_0x4be5('0x15'),_0x52d74d,_0x30e18d?'found':_0x4be5('0x16'));return _0x491d87(_0x30e18d);})[_0x4be5('0x9')](function(_0x199a43){logger[_0x4be5('0x6')](_0x4be5('0x17'),_0x199a43?util['inspect'](_0x199a43,{'showHidden':![],'depth':null}):'');return _0x491d87(null);});}return _0x491d87(null);});};exports[_0x4be5('0x18')]=function(_0x4cffa6){return new BPromise(function(_0x3b2d3e,_0x861cd6){if(_0x4cffa6){return getUser({'interface':_0x4cffa6})[_0x4be5('0x8')](function(_0x2091f5){logger[_0x4be5('0x14')](_0x4be5('0x19'),_0x4cffa6,_0x2091f5?_0x4be5('0x1a'):_0x4be5('0x16'));return _0x3b2d3e(_0x2091f5);})['catch'](function(_0x1d6208){logger[_0x4be5('0x6')](_0x4be5('0x1b'),_0x1d6208?util[_0x4be5('0x4')](_0x1d6208,{'showHidden':![],'depth':null}):'');return _0x3b2d3e(null);});}return _0x3b2d3e(null);});};exports[_0x4be5('0x1c')]=function(_0x414d82){return new BPromise(function(_0x49a9dd,_0x2a2894){if(_0x414d82){return getUser({'name':_0x414d82})[_0x4be5('0x8')](function(_0x430c67){logger[_0x4be5('0x14')]('[utils][getUserByName]\x20name:%s\x20%s',_0x414d82,_0x430c67?'found':'notfound');return _0x49a9dd(_0x430c67);})['catch'](function(_0x286b05){logger[_0x4be5('0x6')](_0x4be5('0x1d'),_0x286b05?util[_0x4be5('0x4')](_0x286b05,{'showHidden':![],'depth':null}):'');return _0x49a9dd(null);});}return _0x49a9dd(null);});};exports[_0x4be5('0x1e')]=function(_0x8dc1ce){return new BPromise(function(_0x12ccf3,_0x18eda8){if(_0x8dc1ce){return client[_0x4be5('0x7')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id','name',_0x4be5('0x1f'),_0x4be5('0x20'),'acwTimeout'],'where':{'name':_0x8dc1ce},'limit':0x1}})['then'](function(_0x1d9455){logger[_0x4be5('0x5')]('[utils][getVoiceQueueByName]\x20name:%s',_0x8dc1ce,_0x1d9455?util[_0x4be5('0x4')](_0x1d9455,{'showHidden':![],'depth':null}):'');logger[_0x4be5('0x14')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x8dc1ce,_0x1d9455?'found':_0x4be5('0x16'));return _0x12ccf3(_0x1d9455[_0x4be5('0x11')][_0x4be5('0x12')]?_0x1d9455[_0x4be5('0x11')][0x0]:null);})[_0x4be5('0x9')](function(_0xf4b508){logger['error'](_0x4be5('0x21'),_0xf4b508?util['inspect'](_0xf4b508,{'showHidden':![],'depth':null}):'');return _0x12ccf3(null);});}return _0x12ccf3(null);});};exports[_0x4be5('0x22')]=function(_0x305cba,_0x314b74){return moment(_0x305cba)[_0x4be5('0x23')](_0x314b74,_0x4be5('0x24'))['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x4be5('0x25')]=function(_0x245775,_0x4bc38f){return moment(_0x245775)[_0x4be5('0x26')](_0x4bc38f,_0x4be5('0x24'))[_0x4be5('0x27')](_0x4be5('0x28'));};exports[_0x4be5('0x29')]=function(_0x32ca17,_0x14e682){return moment(_0x32ca17)[_0x4be5('0x2a')](moment(_0x14e682),'seconds');};exports[_0x4be5('0x2b')]=function(_0x4a1a5b,_0x51bb84){return parseInt(_0x4a1a5b,0xa)+parseInt(_0x51bb84,0xa);};exports[_0x4be5('0x2c')]=function(){return moment()['format'](_0x4be5('0x28'));};exports['isAfter']=function(_0x192d5f,_0x12221d){if(_0x12221d){return moment(_0x192d5f)['isAfter'](_0x12221d);}return!![];};exports[_0x4be5('0x2d')]=function(_0xd6ad7c,_0x4b28e8){if(_0x4b28e8){return moment(_0xd6ad7c)[_0x4be5('0x2d')](_0x4b28e8);}else if(_0xd6ad7c){return!![];}return![];};
\ No newline at end of file
+var _0x7793=['getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','[utils][getVoiceQueueByName]','addTime','add','format','YYYY-MM-DD\x20HH:mm:ss','seconds','diff','sumTime','now','isAfter','isBefore','bluebird','moment','util','client','http','xdr','inspect','debug','request','then','error','GetUser','internal','name','[utils][getUser]\x20where:%s','stringify','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','catch','getUserByInterface','info','[utils][getUserByInterface]'];(function(_0x20747f,_0x593d93){var _0x26a4a2=function(_0x267b06){while(--_0x267b06){_0x20747f['push'](_0x20747f['shift']());}};_0x26a4a2(++_0x593d93);}(_0x7793,0x97));var _0x3779=function(_0x1638b7,_0x5b8eb5){_0x1638b7=_0x1638b7-0x0;var _0x177ae9=_0x7793[_0x1638b7];return _0x177ae9;};'use strict';var BPromise=require(_0x3779('0x0'));var jayson=require('jayson/promise');var moment=require(_0x3779('0x1'));var util=require(_0x3779('0x2'));var client=jayson[_0x3779('0x3')][_0x3779('0x4')]({'port':0x2329});var logger=require('../../config/logger')(_0x3779('0x5'));exports['info']=function(_0x48c1a1,_0x144508){logger['info'](_0x48c1a1,_0x144508?util[_0x3779('0x6')](_0x144508,{'showHidden':![],'depth':null}):'');};exports[_0x3779('0x7')]=function(_0x2af7d3,_0x5cf176){logger['debug'](_0x2af7d3,_0x5cf176?util[_0x3779('0x6')](_0x5cf176,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x5af1c0,_0x5b429a){logger['error'](_0x5af1c0,_0x5b429a?util[_0x3779('0x6')](_0x5b429a,{'showHidden':![],'depth':null}):'');};exports[_0x3779('0x8')]=function(_0x1492bb,_0x3d1120){return client[_0x3779('0x8')](_0x1492bb,{'body':_0x3d1120})[_0x3779('0x9')](function(_0x44e0f8){logger['debug']('[utils][request]\x20name:%s',_0x1492bb,_0x44e0f8?util[_0x3779('0x6')](_0x44e0f8,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x18b19e){logger[_0x3779('0xa')]('[utils][request]\x20name:%s',_0x1492bb,_0x18b19e?util[_0x3779('0x6')](_0x18b19e,{'showHidden':![],'depth':null}):'');});};function getUser(_0x260eac){return client[_0x3779('0x8')](_0x3779('0xb'),{'options':{'raw':!![],'attributes':['id',_0x3779('0xc'),_0x3779('0xd'),'interface'],'where':_0x260eac,'limit':0x1}})[_0x3779('0x9')](function(_0x3e919c){logger[_0x3779('0x7')](_0x3779('0xe'),JSON[_0x3779('0xf')](_0x260eac),_0x3e919c?util['inspect'](_0x3e919c,{'showHidden':![],'depth':null}):'');return _0x3e919c[_0x3779('0x10')]['length']?_0x3e919c['result'][0x0]:null;});}exports[_0x3779('0x11')]=function(_0x452b4a){return new BPromise(function(_0xa7c4e7,_0x33ee52){if(_0x452b4a){return getUser({'internal':_0x452b4a})[_0x3779('0x9')](function(_0x4bb978){logger['info'](_0x3779('0x12'),_0x452b4a,_0x4bb978?_0x3779('0x13'):_0x3779('0x14'));return _0xa7c4e7(_0x4bb978);})[_0x3779('0x15')](function(_0x46bfc3){logger['error']('[utils][getUserByInternal]',_0x46bfc3?util[_0x3779('0x6')](_0x46bfc3,{'showHidden':![],'depth':null}):'');return _0xa7c4e7(null);});}return _0xa7c4e7(null);});};exports[_0x3779('0x16')]=function(_0x369023){return new BPromise(function(_0x2a4fd1,_0x13c334){if(_0x369023){return getUser({'interface':_0x369023})[_0x3779('0x9')](function(_0x313f08){logger[_0x3779('0x17')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x369023,_0x313f08?_0x3779('0x13'):'notfound');return _0x2a4fd1(_0x313f08);})[_0x3779('0x15')](function(_0x38cd21){logger[_0x3779('0xa')](_0x3779('0x18'),_0x38cd21?util['inspect'](_0x38cd21,{'showHidden':![],'depth':null}):'');return _0x2a4fd1(null);});}return _0x2a4fd1(null);});};exports[_0x3779('0x19')]=function(_0xf259ee){return new BPromise(function(_0x4d41af,_0x1111df){if(_0xf259ee){return getUser({'name':_0xf259ee})[_0x3779('0x9')](function(_0x511ae2){logger[_0x3779('0x17')](_0x3779('0x1a'),_0xf259ee,_0x511ae2?_0x3779('0x13'):_0x3779('0x14'));return _0x4d41af(_0x511ae2);})['catch'](function(_0x9b5b91){logger['error'](_0x3779('0x1b'),_0x9b5b91?util[_0x3779('0x6')](_0x9b5b91,{'showHidden':![],'depth':null}):'');return _0x4d41af(null);});}return _0x4d41af(null);});};exports[_0x3779('0x1c')]=function(_0x43ff9f){return new BPromise(function(_0xbc44e6,_0x4acc38){if(_0x43ff9f){return client[_0x3779('0x8')](_0x3779('0x1d'),{'options':{'raw':!![],'attributes':['id',_0x3779('0xd'),'type','acw',_0x3779('0x1e')],'where':{'name':_0x43ff9f},'limit':0x1}})['then'](function(_0x2849fb){logger[_0x3779('0x7')]('[utils][getVoiceQueueByName]\x20name:%s',_0x43ff9f,_0x2849fb?util['inspect'](_0x2849fb,{'showHidden':![],'depth':null}):'');logger[_0x3779('0x17')](_0x3779('0x1f'),_0x43ff9f,_0x2849fb?_0x3779('0x13'):_0x3779('0x14'));return _0xbc44e6(_0x2849fb['result'][_0x3779('0x20')]?_0x2849fb[_0x3779('0x10')][0x0]:null);})['catch'](function(_0x54c48a){logger['error'](_0x3779('0x21'),_0x54c48a?util[_0x3779('0x6')](_0x54c48a,{'showHidden':![],'depth':null}):'');return _0xbc44e6(null);});}return _0xbc44e6(null);});};exports[_0x3779('0x22')]=function(_0x53661b,_0x548f43){return moment(_0x53661b)[_0x3779('0x23')](_0x548f43,'seconds')[_0x3779('0x24')](_0x3779('0x25'));};exports['subtractTime']=function(_0x3c5f02,_0x7fe602){return moment(_0x3c5f02)['subtract'](_0x7fe602,_0x3779('0x26'))[_0x3779('0x24')](_0x3779('0x25'));};exports['diffTime']=function(_0x2cbdcf,_0x3574e4){return moment(_0x2cbdcf)[_0x3779('0x27')](moment(_0x3574e4),'seconds');};exports[_0x3779('0x28')]=function(_0x3d52ab,_0x79ca96){return parseInt(_0x3d52ab,0xa)+parseInt(_0x79ca96,0xa);};exports[_0x3779('0x29')]=function(){return moment()['format'](_0x3779('0x25'));};exports[_0x3779('0x2a')]=function(_0x19cf18,_0x50abc8){if(_0x50abc8){return moment(_0x19cf18)[_0x3779('0x2a')](_0x50abc8);}return!![];};exports[_0x3779('0x2b')]=function(_0x14f258,_0x3011ba){if(_0x3011ba){return moment(_0x14f258)[_0x3779('0x2b')](_0x3011ba);}else if(_0x14f258){return!![];}return![];};
\ No newline at end of file
index 1361f14..5c3a9d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2128=['error','api','set','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','\x20body=%s','body','method','headers','x-forwarded-for','remoteAddress','url','statusCode','responseTime','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','format','connection','other','agent_name','test','setupLoggers','fs-extra','lodash','express-winston','path','./loggers','fileLogger','./safe-template','./mask-sensitive-data','maskSensitiveData','/var','log','join','client','role','name','ensureDir','then','user','no-user','data','timestamp','catch'];(function(_0xab84dc,_0x245439){var _0x5a3138=function(_0x47b42d){while(--_0x47b42d){_0xab84dc['push'](_0xab84dc['shift']());}};_0x5a3138(++_0x245439);}(_0x2128,0xda));var _0x8212=function(_0x96359,_0x220250){_0x96359=_0x96359-0x0;var _0x13ce0f=_0x2128[_0x96359];return _0x13ce0f;};var fs=require(_0x8212('0x0'));var _=require(_0x8212('0x1'));var ewinston=require(_0x8212('0x2'));var path=require(_0x8212('0x3'));var util=require('util');var fileLogger=require(_0x8212('0x4'))[_0x8212('0x5')];var safeTemplate=require(_0x8212('0x6'))['safeTemplate'];var maskSensitiveData=require(_0x8212('0x7'))[_0x8212('0x8')];function ClientSideLogger(){function _0x260087(_0x2b9ecf){var _0x3ed76e=path['join'](_0x8212('0x9'),_0x8212('0xa'),'xcally');var _0x58076b=path[_0x8212('0xb')](_0x8212('0xc'),_0x2b9ecf[_0x8212('0xd')]+'-'+_0x2b9ecf[_0x8212('0xe')]);return fs[_0x8212('0xf')](path[_0x8212('0xb')](_0x3ed76e,_0x58076b))[_0x8212('0x10')](function(){var _0xdd5c1f=fileLogger(_0x8212('0xc'),path[_0x8212('0xb')](_0x3ed76e,_0x58076b));return _0xdd5c1f;})['catch'](function(_0x27ef55){throw _0x27ef55;});}this[_0x8212('0xa')]=function(_0x35424f,_0x5a5dfb,_0x2bfda0,_0x3f47e0){return _0x260087(_0x35424f[_0x8212('0x11')])['then'](function(_0x4dc4b3){var _0x540151=_0x4dc4b3[_0x5a5dfb];return _0x540151;})[_0x8212('0x10')](function(_0x4a0cc4){var _0x4af4a0=_0x35424f[_0x8212('0x11')]?_0x35424f[_0x8212('0x11')]['id']:_0x8212('0x12');var _0x461284=_0x3f47e0[_0x8212('0x13')];var _0x43feac=_0x3f47e0[_0x8212('0x14')];var _0xa59607=new Date(Number(_0x43feac));return _0x4a0cc4(_0x4af4a0,_0xa59607,_0x2bfda0,_0x461284);})[_0x8212('0x15')](function(_0x2b24d4){fileLogger(_0x8212('0xc'))[_0x8212('0x16')](_0x2b24d4);});};}function setupLoggers(_0x89a456){return new Promise(function(_0x25af56){var _0x38b985=new ClientSideLogger();var _0x9b225a=fileLogger(_0x8212('0x17'));var _0x19cf29=fileLogger('auth');_0x89a456[_0x8212('0x18')](_0x8212('0x19'),_0x38b985);_0x89a456[_0x8212('0x1a')](ewinston[_0x8212('0x1b')]({'winstonInstance':_0x9b225a,'meta':![],'statusLevels':!![],'msg':function(_0x1e88b5,_0x267235){var _0xd24274=_0x8212('0x1c');if(!_[_0x8212('0x1d')](_0x1e88b5['body'])){_0xd24274+=_0x8212('0x1e');var _0x5f3951=_0x1e88b5[_0x8212('0x1f')];maskSensitiveData(_0x5f3951);}return safeTemplate(util['format'](_0xd24274,_0x1e88b5[_0x8212('0x20')],_0x1e88b5[_0x8212('0x21')][_0x8212('0x22')]?_0x1e88b5['headers']['x-forwarded-for']:_0x1e88b5['connection'][_0x8212('0x23')]||_0x1e88b5['ip'],_0x1e88b5[_0x8212('0x24')],_0x267235[_0x8212('0x25')],_0x267235[_0x8212('0x26')],_0x1e88b5[_0x8212('0x11')]?_0x1e88b5[_0x8212('0x11')]['id']:null,_0x1e88b5['user']?_0x1e88b5[_0x8212('0x11')][_0x8212('0xe')]:null,_0x1e88b5[_0x8212('0x11')]?_0x1e88b5[_0x8212('0x11')][_0x8212('0xd')]:null,_0x5f3951?util['inspect'](_0x5f3951,![],null):''));}}));_0x89a456[_0x8212('0x1a')](ewinston[_0x8212('0x1b')]({'winstonInstance':_0x19cf29,'meta':![],'statusLevels':!![],'msg':function(_0x31e51d,_0x243f73){var _0x45a4c8=_0x8212('0x27');if(_0x31e51d[_0x8212('0x1f')]&&_0x31e51d['body'][_0x8212('0x28')]&&_0x31e51d['body'][_0x8212('0x29')]){_0x45a4c8='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x8212('0x2a')](_0x45a4c8,_0x31e51d[_0x8212('0x20')],_0x31e51d[_0x8212('0x21')][_0x8212('0x22')]?_0x31e51d['headers'][_0x8212('0x22')]:_0x31e51d[_0x8212('0x2b')][_0x8212('0x23')]||_0x31e51d['ip'],_0x31e51d[_0x8212('0x24')],_0x243f73[_0x8212('0x25')],_0x243f73[_0x8212('0x26')],_0x31e51d['user']?_0x31e51d[_0x8212('0x11')]['id']:null,_0x31e51d[_0x8212('0x11')]?_0x31e51d[_0x8212('0x11')][_0x8212('0xe')]:null,_0x31e51d[_0x8212('0x11')]?_0x31e51d['user'][_0x8212('0xd')]:null,_0x31e51d[_0x8212('0x1f')]&&_0x31e51d[_0x8212('0x1f')]['device']?_0x31e51d[_0x8212('0x1f')][_0x8212('0x28')]:_0x8212('0x2c'),_0x31e51d[_0x8212('0x1f')]&&_0x31e51d[_0x8212('0x1f')][_0x8212('0x29')]?_0x31e51d[_0x8212('0x1f')][_0x8212('0x29')]:'',_0x31e51d[_0x8212('0x1f')]&&_0x31e51d[_0x8212('0x1f')][_0x8212('0x2d')]?_0x31e51d[_0x8212('0x1f')][_0x8212('0x2d')]:'');},'ignoreRoute':function(_0x3af4c9){var _0x3ac39e=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x3ac39e[_0x8212('0x2e')](_0x3af4c9[_0x8212('0x24')]);}}));return _0x25af56();});}exports[_0x8212('0x2f')]=setupLoggers;
\ No newline at end of file
+var _0x29a1=['%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','device','agent_name','test','url','setupLoggers','fs-extra','express-winston','path','./loggers','./safe-template','safeTemplate','join','/var','log','xcally','client','role','name','ensureDir','then','user','no-user','error','api','auth','set','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','statusCode','responseTime','inspect'];(function(_0x18b575,_0x2e6030){var _0x3c21cd=function(_0x9a69af){while(--_0x9a69af){_0x18b575['push'](_0x18b575['shift']());}};_0x3c21cd(++_0x2e6030);}(_0x29a1,0x194));var _0x129a=function(_0x58d697,_0x1b6d19){_0x58d697=_0x58d697-0x0;var _0x108172=_0x29a1[_0x58d697];return _0x108172;};var fs=require(_0x129a('0x0'));var _=require('lodash');var ewinston=require(_0x129a('0x1'));var path=require(_0x129a('0x2'));var util=require('util');var fileLogger=require(_0x129a('0x3'))['fileLogger'];var safeTemplate=require(_0x129a('0x4'))[_0x129a('0x5')];var maskSensitiveData=require('./mask-sensitive-data')['maskSensitiveData'];function ClientSideLogger(){function _0x358692(_0x1db4ca){var _0x4d4f67=path[_0x129a('0x6')](_0x129a('0x7'),_0x129a('0x8'),_0x129a('0x9'));var _0x208cef=path[_0x129a('0x6')](_0x129a('0xa'),_0x1db4ca[_0x129a('0xb')]+'-'+_0x1db4ca[_0x129a('0xc')]);return fs[_0x129a('0xd')](path[_0x129a('0x6')](_0x4d4f67,_0x208cef))[_0x129a('0xe')](function(){var _0x5cf829=fileLogger(_0x129a('0xa'),path[_0x129a('0x6')](_0x4d4f67,_0x208cef));return _0x5cf829;})['catch'](function(_0x25e0ca){throw _0x25e0ca;});}this[_0x129a('0x8')]=function(_0x156508,_0x5c10c0,_0x2c757f,_0x558640){return _0x358692(_0x156508[_0x129a('0xf')])[_0x129a('0xe')](function(_0x4cc95b){var _0x4f50af=_0x4cc95b[_0x5c10c0];return _0x4f50af;})[_0x129a('0xe')](function(_0x36414e){var _0x136693=_0x156508[_0x129a('0xf')]?_0x156508[_0x129a('0xf')]['id']:_0x129a('0x10');var _0x1a0647=_0x558640['data'];var _0x17d24c=_0x558640['timestamp'];var _0x50fe52=new Date(Number(_0x17d24c));return _0x36414e(_0x136693,_0x50fe52,_0x2c757f,_0x1a0647);})['catch'](function(_0x59a94f){fileLogger('client')[_0x129a('0x11')](_0x59a94f);});};}function setupLoggers(_0x3a4ba3){return new Promise(function(_0x3558de){var _0x111372=new ClientSideLogger();var _0x2e1b68=fileLogger(_0x129a('0x12'));var _0x5cb801=fileLogger(_0x129a('0x13'));_0x3a4ba3[_0x129a('0x14')](_0x129a('0x15'),_0x111372);_0x3a4ba3[_0x129a('0x16')](ewinston[_0x129a('0x17')]({'winstonInstance':_0x2e1b68,'meta':![],'statusLevels':!![],'msg':function(_0x23ebd6,_0x543353){var _0x53b502=_0x129a('0x18');if(!_[_0x129a('0x19')](_0x23ebd6[_0x129a('0x1a')])){_0x53b502+=_0x129a('0x1b');var _0xf41746=_0x23ebd6[_0x129a('0x1a')];maskSensitiveData(_0xf41746);}return safeTemplate(util[_0x129a('0x1c')](_0x53b502,_0x23ebd6[_0x129a('0x1d')],_0x23ebd6[_0x129a('0x1e')][_0x129a('0x1f')]?_0x23ebd6[_0x129a('0x1e')]['x-forwarded-for']:_0x23ebd6[_0x129a('0x20')]['remoteAddress']||_0x23ebd6['ip'],_0x23ebd6['url'],_0x543353[_0x129a('0x21')],_0x543353[_0x129a('0x22')],_0x23ebd6['user']?_0x23ebd6[_0x129a('0xf')]['id']:null,_0x23ebd6['user']?_0x23ebd6['user'][_0x129a('0xc')]:null,_0x23ebd6[_0x129a('0xf')]?_0x23ebd6[_0x129a('0xf')][_0x129a('0xb')]:null,_0xf41746?util[_0x129a('0x23')](_0xf41746,![],null):''));}}));_0x3a4ba3[_0x129a('0x16')](ewinston[_0x129a('0x17')]({'winstonInstance':_0x5cb801,'meta':![],'statusLevels':!![],'msg':function(_0x1ef693,_0x2d5bbe){var _0x26cc98=_0x129a('0x24');if(_0x1ef693[_0x129a('0x1a')]&&_0x1ef693[_0x129a('0x1a')]['device']&&_0x1ef693['body'][_0x129a('0x25')]){_0x26cc98=_0x129a('0x26');}return util[_0x129a('0x1c')](_0x26cc98,_0x1ef693[_0x129a('0x1d')],_0x1ef693[_0x129a('0x1e')][_0x129a('0x1f')]?_0x1ef693['headers'][_0x129a('0x1f')]:_0x1ef693[_0x129a('0x20')]['remoteAddress']||_0x1ef693['ip'],_0x1ef693['url'],_0x2d5bbe[_0x129a('0x21')],_0x2d5bbe[_0x129a('0x22')],_0x1ef693[_0x129a('0xf')]?_0x1ef693[_0x129a('0xf')]['id']:null,_0x1ef693['user']?_0x1ef693[_0x129a('0xf')][_0x129a('0xc')]:null,_0x1ef693[_0x129a('0xf')]?_0x1ef693[_0x129a('0xf')]['role']:null,_0x1ef693[_0x129a('0x1a')]&&_0x1ef693[_0x129a('0x1a')][_0x129a('0x27')]?_0x1ef693[_0x129a('0x1a')][_0x129a('0x27')]:'other',_0x1ef693[_0x129a('0x1a')]&&_0x1ef693[_0x129a('0x1a')][_0x129a('0x25')]?_0x1ef693[_0x129a('0x1a')]['agent_id']:'',_0x1ef693['body']&&_0x1ef693[_0x129a('0x1a')]['agent_name']?_0x1ef693[_0x129a('0x1a')][_0x129a('0x28')]:'');},'ignoreRoute':function(_0x253fe9){var _0xe0ac27=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0xe0ac27[_0x129a('0x29')](_0x253fe9[_0x129a('0x2a')]);}}));return _0x3558de();});}exports[_0x129a('0x2b')]=setupLoggers;
\ No newline at end of file
index 19e7071..25257bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbfec=['bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','/var/log/xcally','format','%s-%s.log','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','level','Logger','transports','Console','warn','File','%s-%s','error','consoleLogger','fileLogger','path','util','moment','winston','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','red','white'];(function(_0x323d87,_0x4ef3f9){var _0x5e8f74=function(_0x185735){while(--_0x185735){_0x323d87['push'](_0x323d87['shift']());}};_0x5e8f74(++_0x4ef3f9);}(_0xbfec,0xc2));var _0xcbfe=function(_0x52cf5f,_0x2c165a){_0x52cf5f=_0x52cf5f-0x0;var _0x4ab9d2=_0xbfec[_0x52cf5f];return _0x4ab9d2;};'use strict';var path=require(_0xcbfe('0x0'));var util=require(_0xcbfe('0x1'));var moment=require(_0xcbfe('0x2'));var winston=require(_0xcbfe('0x3'));var config=require(_0xcbfe('0x4'));var debugLevel=config[_0xcbfe('0x5')]?config['debugLevel'][_0xcbfe('0x6')]():_0xcbfe('0x7');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0xcbfe('0x8'),'error':_0xcbfe('0x9'),'warn':'bold\x20yellow','info':_0xcbfe('0xa'),'print':_0xcbfe('0xb'),'success':_0xcbfe('0xc'),'http':_0xcbfe('0xd'),'verbose':_0xcbfe('0xe'),'debug':_0xcbfe('0xf'),'silly':'bold\x20cyan'};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x270105,_0x21137e,_0x367447){var _0x54f925=_0x270105||_0xcbfe('0x10');return path['join'](_0x54f925,util[_0xcbfe('0x11')](_0xcbfe('0x12'),_0x21137e,_0x367447));}function formatter(_0x3e652d,_0x1cfd7c){_0x1cfd7c[_0xcbfe('0x13')]=_0x1cfd7c[_0xcbfe('0x13')][_0xcbfe('0x14')](/@@{/g,_0xcbfe('0x15'))['replace'](/}@@/g,_0xcbfe('0x16'))[_0xcbfe('0x14')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0xcbfe('0x11')](_0xcbfe('0x17'),moment()[_0xcbfe('0x11')](_0xcbfe('0x18')),_0x1cfd7c['level'][_0xcbfe('0x19')](),_0x3e652d,_0x1cfd7c[_0xcbfe('0x13')]);}function fileFormat(_0x2e1acc,_0xb0a9a){_0xb0a9a['message']=_0xb0a9a[_0xcbfe('0x13')]['replace'](/@@{/g,'{{{')[_0xcbfe('0x14')](/}@@/g,_0xcbfe('0x16'))['replace'](/@{/g,'{{')[_0xcbfe('0x14')](/}@/g,'}}');var _0x202a84=_0xb0a9a[_0xcbfe('0x1a')]&&Object[_0xcbfe('0x1b')](_0xb0a9a[_0xcbfe('0x1a')])[_0xcbfe('0x1c')]?'\x0a\x09'+JSON[_0xcbfe('0x1d')](_0xb0a9a[_0xcbfe('0x1a')]):'';return util['format'](_0xcbfe('0x1e'),moment()[_0xcbfe('0x11')](_0xcbfe('0x18')),_0xb0a9a[_0xcbfe('0x1f')]['toUpperCase'](),_0x2e1acc,_0xb0a9a[_0xcbfe('0x13')],_0x202a84);}function consoleLogger(){var _0x30580e=new winston[(_0xcbfe('0x20'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xcbfe('0x21'))][(_0xcbfe('0x22'))]({'level':_0xcbfe('0x23'),'json':![],'formatter':function(_0x709ab4){return formatter('',_0x709ab4);}})]});return _0x30580e;}function fileLogger(_0x70b696,_0xab9d18){var _0x3aaa2a=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0xcbfe('0x24'))]({'name':util[_0xcbfe('0x11')](_0xcbfe('0x25'),_0x70b696,_0xcbfe('0x26')),'filename':getLogFileName(_0xab9d18,_0x70b696,_0xcbfe('0x26')),'level':_0xcbfe('0x26'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4ab25c){return fileFormat(_0x70b696,_0x4ab25c);}}),new winston[(_0xcbfe('0x21'))][(_0xcbfe('0x24'))]({'name':util[_0xcbfe('0x11')]('%s-%s',_0x70b696,debugLevel),'filename':getLogFileName(_0xab9d18,_0x70b696,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x51fce1){return fileFormat(_0x70b696,_0x51fce1);}}),new winston['transports'][(_0xcbfe('0x22'))]({'level':_0xcbfe('0x23'),'json':![],'formatter':function(_0x51dc96){return fileFormat(_0x70b696,_0x51dc96);}})]});return _0x3aaa2a;}exports[_0xcbfe('0x27')]=consoleLogger;exports[_0xcbfe('0x28')]=fileLogger;
\ No newline at end of file
+var _0xe54f=['keys','stringify','meta','Logger','transports','error','%s-%s','Console','warn','fileLogger','path','util','moment','winston','../config/environment','debugLevel','info','redBG\x20white','red','white','bold\x20white','bold\x20green','gray','bold\x20blue','bold\x20cyan','/var/log/xcally','join','format','message','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','{{{'];(function(_0x1c6b70,_0x3a7c44){var _0x1ab69d=function(_0x7f372d){while(--_0x7f372d){_0x1c6b70['push'](_0x1c6b70['shift']());}};_0x1ab69d(++_0x3a7c44);}(_0xe54f,0xff));var _0xfe54=function(_0x3945f4,_0x2da4ad){_0x3945f4=_0x3945f4-0x0;var _0x2a1633=_0xe54f[_0x3945f4];return _0x2a1633;};'use strict';var path=require(_0xfe54('0x0'));var util=require(_0xfe54('0x1'));var moment=require(_0xfe54('0x2'));var winston=require(_0xfe54('0x3'));var config=require(_0xfe54('0x4'));var debugLevel=config[_0xfe54('0x5')]?config[_0xfe54('0x5')]['toLowerCase']():_0xfe54('0x6');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0xfe54('0x7'),'error':_0xfe54('0x8'),'warn':'bold\x20yellow','info':_0xfe54('0x9'),'print':_0xfe54('0xa'),'success':_0xfe54('0xb'),'http':_0xfe54('0xc'),'verbose':'bold\x20magenta','debug':_0xfe54('0xd'),'silly':_0xfe54('0xe')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x4de4ff,_0x3133dd,_0x3a84e7){var _0x424ea9=_0x4de4ff||_0xfe54('0xf');return path[_0xfe54('0x10')](_0x424ea9,util[_0xfe54('0x11')]('%s-%s.log',_0x3133dd,_0x3a84e7));}function formatter(_0x3f29d4,_0x3345b3){_0x3345b3[_0xfe54('0x12')]=_0x3345b3[_0xfe54('0x12')][_0xfe54('0x13')](/@@{/g,'{{{')[_0xfe54('0x13')](/}@@/g,_0xfe54('0x14'))[_0xfe54('0x13')](/@{/g,'{{')[_0xfe54('0x13')](/}@/g,'}}');return util[_0xfe54('0x11')](_0xfe54('0x15'),moment()[_0xfe54('0x11')](_0xfe54('0x16')),_0x3345b3[_0xfe54('0x17')]['toUpperCase'](),_0x3f29d4,_0x3345b3['message']);}function fileFormat(_0xba1177,_0x1af410){_0x1af410['message']=_0x1af410['message'][_0xfe54('0x13')](/@@{/g,_0xfe54('0x18'))[_0xfe54('0x13')](/}@@/g,_0xfe54('0x14'))[_0xfe54('0x13')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x32e529=_0x1af410['meta']&&Object[_0xfe54('0x19')](_0x1af410['meta'])['length']?'\x0a\x09'+JSON[_0xfe54('0x1a')](_0x1af410[_0xfe54('0x1b')]):'';return util[_0xfe54('0x11')]('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()[_0xfe54('0x11')](_0xfe54('0x16')),_0x1af410[_0xfe54('0x17')]['toUpperCase'](),_0xba1177,_0x1af410[_0xfe54('0x12')],_0x32e529);}function consoleLogger(){var _0x37ffc0=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston['transports']['Console']({'level':'warn','json':![],'formatter':function(_0x1cb2c9){return formatter('',_0x1cb2c9);}})]});return _0x37ffc0;}function fileLogger(_0x661b48,_0x338665){var _0x30d399=new winston[(_0xfe54('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xfe54('0x1d'))]['File']({'name':util[_0xfe54('0x11')]('%s-%s',_0x661b48,_0xfe54('0x1e')),'filename':getLogFileName(_0x338665,_0x661b48,_0xfe54('0x1e')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x30025c){return fileFormat(_0x661b48,_0x30025c);}}),new winston[(_0xfe54('0x1d'))]['File']({'name':util['format'](_0xfe54('0x1f'),_0x661b48,debugLevel),'filename':getLogFileName(_0x338665,_0x661b48,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4a4584){return fileFormat(_0x661b48,_0x4a4584);}}),new winston[(_0xfe54('0x1d'))][(_0xfe54('0x20'))]({'level':_0xfe54('0x21'),'json':![],'formatter':function(_0x32119f){return fileFormat(_0x661b48,_0x32119f);}})]});return _0x30d399;}exports['consoleLogger']=consoleLogger;exports[_0xfe54('0x22')]=fileLogger;
\ No newline at end of file
index 47d2941..32e7d71 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57ca=['accesskeyid','secretaccesskey','key','user','accountSid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','isString','@@{','replace','}@@','includes','exports','username','password','apiKey','firstName','lastName','street','phone','fax','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','channelSecret','accessTokenSecret','authToken','consumerSecret','calleridname','calleridnum','vidaooApiKey','privateKey'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x57ca,0x108));var _0xa57c=function(_0x159a81,_0x1fda47){_0x159a81=_0x159a81-0x0;var _0x555a33=_0x57ca[_0x159a81];return _0x555a33;};var _=require('lodash');var sensitiveFields=[_0xa57c('0x0'),_0xa57c('0x1'),'newPassword',_0xa57c('0x2'),_0xa57c('0x3'),_0xa57c('0x4'),_0xa57c('0x5'),_0xa57c('0x6'),'mobile',_0xa57c('0x7'),_0xa57c('0x8'),_0xa57c('0x9'),_0xa57c('0xa'),_0xa57c('0xb'),_0xa57c('0xc'),_0xa57c('0xd'),_0xa57c('0xe'),'token',_0xa57c('0xf'),'accessToken',_0xa57c('0x10'),_0xa57c('0x11'),'consumerKey',_0xa57c('0x12'),'membername',_0xa57c('0x13'),_0xa57c('0x14'),'exten',_0xa57c('0x15'),'clientEmail',_0xa57c('0x16'),_0xa57c('0x17'),_0xa57c('0x18'),_0xa57c('0x19'),_0xa57c('0x1a'),'pass',_0xa57c('0x1b'),'localstationid',_0xa57c('0x1c'),_0xa57c('0x1d'),_0xa57c('0x1e'),_0xa57c('0x1f')];function maskSensitiveData(_0x3238ff){const _0x37a323=/(?!^)[\s\S](?!$)/g;if(_[_0xa57c('0x20')](_0x3238ff)){for(const _0x4b4bdb in _0x3238ff){if(_[_0xa57c('0x21')](_0x3238ff[_0x4b4bdb])){for(let _0xdf7ff6=0x0;_0xdf7ff6<_0x3238ff[_0x4b4bdb][_0xa57c('0x22')];_0xdf7ff6++){maskSensitiveData(_0x3238ff[_0x4b4bdb][_0xdf7ff6]);}}else if(_['isPlainObject'](_0x3238ff[_0x4b4bdb])){maskSensitiveData(_0x3238ff[_0x4b4bdb]);}else if(_[_0xa57c('0x23')](_0x3238ff[_0x4b4bdb])){_0x3238ff[_0x4b4bdb]=_0x3238ff[_0x4b4bdb]['replace'](/{{{/g,_0xa57c('0x24'))[_0xa57c('0x25')](/}}}/g,_0xa57c('0x26'))[_0xa57c('0x25')](/{{/g,'@{')[_0xa57c('0x25')](/}}/g,'}@');if(_[_0xa57c('0x27')](sensitiveFields,_0x4b4bdb)){_0x3238ff[_0x4b4bdb]=_0x3238ff[_0x4b4bdb][_0xa57c('0x25')](_0x37a323,'*');}}}}}module[_0xa57c('0x28')]['maskSensitiveData']=maskSensitiveData;
\ No newline at end of file
+var _0x0b0e=['}@@','lodash','password','apiKey','firstName','lastName','street','phone','mobile','fax','email','clientId','clientSecret','securityToken','tenantId','token','channelSecret','accessToken','authToken','consumerKey','membername','calleridname','exten','vidaooApiKey','clientEmail','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn','secret','registry','oldPassword','isArray','length','isString','replace'];(function(_0x5b09d6,_0x347006){var _0x29e379=function(_0xffa1d0){while(--_0xffa1d0){_0x5b09d6['push'](_0x5b09d6['shift']());}};_0x29e379(++_0x347006);}(_0x0b0e,0x187));var _0xe0b0=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0x0b0e[_0x11ce46];return _0x368a1e;};var _=require(_0xe0b0('0x0'));var sensitiveFields=['username',_0xe0b0('0x1'),'newPassword',_0xe0b0('0x2'),_0xe0b0('0x3'),_0xe0b0('0x4'),_0xe0b0('0x5'),_0xe0b0('0x6'),_0xe0b0('0x7'),_0xe0b0('0x8'),_0xe0b0('0x9'),_0xe0b0('0xa'),_0xe0b0('0xb'),_0xe0b0('0xc'),'code','accessKey',_0xe0b0('0xd'),_0xe0b0('0xe'),_0xe0b0('0xf'),_0xe0b0('0x10'),'accessTokenSecret',_0xe0b0('0x11'),_0xe0b0('0x12'),'consumerSecret',_0xe0b0('0x13'),_0xe0b0('0x14'),'calleridnum',_0xe0b0('0x15'),_0xe0b0('0x16'),_0xe0b0('0x17'),'privateKey',_0xe0b0('0x18'),_0xe0b0('0x19'),_0xe0b0('0x1a'),_0xe0b0('0x1b'),_0xe0b0('0x1c'),'accountSid',_0xe0b0('0x1d'),_0xe0b0('0x1e'),_0xe0b0('0x1f'),_0xe0b0('0x20'),_0xe0b0('0x21')];function maskSensitiveData(_0x55d884){const _0x41a7e2=/(?!^)[\s\S](?!$)/g;if(_['isPlainObject'](_0x55d884)){for(const _0x35cb40 in _0x55d884){if(_[_0xe0b0('0x22')](_0x55d884[_0x35cb40])){for(let _0x519ae8=0x0;_0x519ae8<_0x55d884[_0x35cb40][_0xe0b0('0x23')];_0x519ae8++){maskSensitiveData(_0x55d884[_0x35cb40][_0x519ae8]);}}else if(_['isPlainObject'](_0x55d884[_0x35cb40])){maskSensitiveData(_0x55d884[_0x35cb40]);}else if(_[_0xe0b0('0x24')](_0x55d884[_0x35cb40])){_0x55d884[_0x35cb40]=_0x55d884[_0x35cb40][_0xe0b0('0x25')](/{{{/g,'@@{')['replace'](/}}}/g,_0xe0b0('0x26'))['replace'](/{{/g,'@{')['replace'](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x35cb40)){_0x55d884[_0x35cb40]=_0x55d884[_0x35cb40][_0xe0b0('0x25')](_0x41a7e2,'*');}}}}}module['exports']['maskSensitiveData']=maskSensitiveData;
\ No newline at end of file
index df357f5..6ca922f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4f4=['replace','map','isPlainObject','keys','reduce','exports','safeTemplate','lodash','\x20}\x20}','string'];(function(_0x141e03,_0x18340e){var _0x2074e3=function(_0x2b7ece){while(--_0x2b7ece){_0x141e03['push'](_0x141e03['shift']());}};_0x2074e3(++_0x18340e);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x2726f3,_0x2dec60){_0x2726f3=_0x2726f3-0x0;var _0xc307d3=_0xf4f4[_0x2726f3];return _0xc307d3;};var _=require(_0x4f4f('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x230375){return _0x230375==='{{'?'{\x20{\x20':_0x4f4f('0x1');}function safeTemplate(_0x304b11){var _0x19aa05=_0x304b11;if(typeof _0x304b11===_0x4f4f('0x2')){_0x19aa05=_0x304b11[_0x4f4f('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x304b11)){_0x19aa05=_0x304b11[_0x4f4f('0x4')](function(_0x593952){return safeTemplate(_0x593952);});}else if(_[_0x4f4f('0x5')](_0x304b11)){_0x19aa05=Object[_0x4f4f('0x6')](_0x304b11)[_0x4f4f('0x7')](function(_0x1ff75a,_0x3c4877){_0x1ff75a[_0x3c4877]=safeTemplate(_0x304b11[_0x3c4877]);return _0x1ff75a;},{});}return _0x19aa05;}module[_0x4f4f('0x8')][_0x4f4f('0x9')]=safeTemplate;
\ No newline at end of file
+var _0x955f=['map','isPlainObject','keys','reduce','exports','lodash','{\x20{\x20','\x20}\x20}','string'];(function(_0x33db58,_0xbac7a4){var _0x36b3f0=function(_0x41f3e5){while(--_0x41f3e5){_0x33db58['push'](_0x33db58['shift']());}};_0x36b3f0(++_0xbac7a4);}(_0x955f,0x1eb));var _0xf955=function(_0xaee3d6,_0x51d169){_0xaee3d6=_0xaee3d6-0x0;var _0x4f70d9=_0x955f[_0xaee3d6];return _0x4f70d9;};var _=require(_0xf955('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x471baa){return _0x471baa==='{{'?_0xf955('0x1'):_0xf955('0x2');}function safeTemplate(_0x2834f7){var _0x585f6e=_0x2834f7;if(typeof _0x2834f7===_0xf955('0x3')){_0x585f6e=_0x2834f7['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x2834f7)){_0x585f6e=_0x2834f7[_0xf955('0x4')](function(_0x5a20bc){return safeTemplate(_0x5a20bc);});}else if(_[_0xf955('0x5')](_0x2834f7)){_0x585f6e=Object[_0xf955('0x6')](_0x2834f7)[_0xf955('0x7')](function(_0x59d5b3,_0x18432f){_0x59d5b3[_0x18432f]=safeTemplate(_0x2834f7[_0x18432f]);return _0x59d5b3;},{});}return _0x585f6e;}module[_0xf955('0x8')]['safeTemplate']=safeTemplate;
\ No newline at end of file